Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 26 May 2008 17:14:37 +0000 (10:14 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 26 May 2008 17:14:37 +0000 (10:14 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc64: global_reg_snapshot is not for userspace

382 files changed:
.gitignore
Documentation/ABI/testing/sysfs-class-bdi
Documentation/DocBook/kernel-locking.tmpl
Documentation/cpu-freq/governors.txt
Documentation/hwmon/ibmaem [new file with mode: 0644]
MAINTAINERS
arch/arm/mach-at91/at91x40.c
arch/arm/mach-integrator/impd1.c
arch/arm/mach-integrator/pci_v3.c
arch/arm/mach-omap1/board-palmte.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-s3c2410/mach-bast.c
arch/arm/mach-s3c2410/mach-vr1000.c
arch/arm/mach-sa1100/collie.c
arch/arm/plat-omap/clock.c
arch/arm/plat-s3c24xx/s3c244x.c
arch/frv/mm/init.c
arch/m68k/lib/string.c
arch/powerpc/boot/.gitignore
arch/powerpc/boot/Makefile
arch/powerpc/boot/dts/mpc8377_mds.dts
arch/powerpc/configs/chrp32_defconfig
arch/powerpc/configs/g5_defconfig
arch/powerpc/configs/iseries_defconfig
arch/powerpc/configs/pmac32_defconfig
arch/powerpc/configs/ppc64_defconfig
arch/powerpc/configs/pseries_defconfig
arch/powerpc/kernel/prom_init_check.sh
arch/powerpc/mm/hash_low_32.S
arch/powerpc/mm/pgtable_32.c
arch/powerpc/platforms/ps3/mm.c
arch/powerpc/sysdev/mpic.c
arch/sh/drivers/heartbeat.c
arch/um/Kconfig
arch/um/drivers/pcap_user.c
arch/um/kernel/ksyms.c
arch/um/os-Linux/sys-i386/registers.c
arch/um/sys-x86_64/ksyms.c
arch/x86/Kconfig
arch/x86/boot/printf.c
arch/x86/kernel/apic_64.c
arch/x86/kernel/cpu/cpufreq/longrun.c
arch/x86/kernel/cpu/cpufreq/powernow-k8.c
arch/x86/kernel/kvmclock.c
arch/x86/kernel/tsc_32.c
arch/x86/kernel/tsc_64.c
arch/x86/kvm/mmu.c
arch/x86/pci/common.c
arch/x86/vdso/vclock_gettime.c
arch/x86/xen/mmu.c
drivers/acpi/dispatcher/dsmethod.c
drivers/acpi/executer/exmutex.c
drivers/atm/fore200e.h
drivers/atm/fore200e_mkfirm.c
drivers/atm/he.h
drivers/atm/idt77252.c
drivers/atm/idt77252.h
drivers/atm/iphase.h
drivers/atm/nicstarmac.copyright
drivers/base/core.c
drivers/block/brd.c
drivers/block/viodasd.c
drivers/cdrom/viocd.c
drivers/char/drm/drm_sysfs.c
drivers/char/ip2/Makefile
drivers/char/ip2/ip2main.c
drivers/char/viocons.c
drivers/char/viotape.c
drivers/cpufreq/freq_table.c
drivers/dma/iop-adma.c
drivers/edac/mpc85xx_edac.c
drivers/firewire/fw-cdev.c
drivers/gpio/gpiolib.c
drivers/gpio/mcp23s08.c
drivers/gpio/pca953x.c
drivers/hid/hid-debug.c
drivers/hid/hid-input.c
drivers/hid/usbhid/hid-quirks.c
drivers/hid/usbhid/usbkbd.c
drivers/hid/usbhid/usbmouse.c
drivers/hwmon/Kconfig
drivers/hwmon/Makefile
drivers/hwmon/hdaps.c
drivers/hwmon/i5k_amb.c
drivers/hwmon/ibmaem.c [new file with mode: 0644]
drivers/ide/ide-probe.c
drivers/ieee1394/sbp2.c
drivers/infiniband/core/mad.c
drivers/infiniband/core/user_mad.c
drivers/infiniband/core/uverbs_main.c
drivers/infiniband/hw/cxgb3/iwch_qp.c
drivers/infiniband/hw/ipath/ipath_sdma.c
drivers/infiniband/hw/ipath/ipath_uc.c
drivers/infiniband/hw/mlx4/qp.c
drivers/infiniband/hw/mthca/mthca_main.c
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
drivers/input/keyboard/aaed2000_kbd.c
drivers/input/keyboard/corgikbd.c
drivers/input/keyboard/jornada680_kbd.c
drivers/input/keyboard/jornada720_kbd.c
drivers/input/keyboard/spitzkbd.c
drivers/input/touchscreen/jornada720_ts.c
drivers/isdn/capi/capiutil.c
drivers/isdn/hysdn/Kconfig
drivers/isdn/hysdn/boardergo.c
drivers/isdn/hysdn/hycapi.c
drivers/leds/led-class.c
drivers/md/bitmap.c
drivers/md/md.c
drivers/md/multipath.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c
drivers/media/video/Kconfig
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/videobuf-core.c
drivers/mfd/Kconfig
drivers/mmc/host/Kconfig
drivers/net/3c509.c
drivers/net/Kconfig
drivers/net/atlx/atl1.c
drivers/net/au1000_eth.c
drivers/net/bfin_mac.c
drivers/net/bonding/bond_sysfs.c
drivers/net/cassini.c
drivers/net/cpmac.c
drivers/net/dm9000.c
drivers/net/e1000e/netdev.c
drivers/net/ehea/ehea_main.c
drivers/net/forcedeth.c
drivers/net/fs_enet/fs_enet-main.c
drivers/net/hamradio/scc.c
drivers/net/irda/irda-usb.c
drivers/net/irda/irda-usb.h
drivers/net/myri10ge/myri10ge.c
drivers/net/pcmcia/fmvj18x_cs.c
drivers/net/pcmcia/xirc2ps_cs.c
drivers/net/pcnet32.c
drivers/net/phy/Kconfig
drivers/net/phy/phy_device.c
drivers/net/pppol2tp.c
drivers/net/s2io-regs.h
drivers/net/s2io.c
drivers/net/s2io.h
drivers/net/sb1250-mac.c
drivers/net/sc92031.c
drivers/net/sfc/bitfield.h
drivers/net/sfc/boards.c
drivers/net/sfc/efx.c
drivers/net/sfc/falcon.c
drivers/net/sfc/falcon.h
drivers/net/sfc/falcon_hwdefs.h
drivers/net/sfc/falcon_io.h
drivers/net/sfc/falcon_xmac.c
drivers/net/sfc/net_driver.h
drivers/net/sfc/rx.c
drivers/net/sfc/selftest.c
drivers/net/sfc/sfe4001.c
drivers/net/sfc/tenxpress.c
drivers/net/sfc/tx.c
drivers/net/sfc/workarounds.h
drivers/net/sfc/xfp_phy.c
drivers/net/sky2.c
drivers/net/tokenring/3c359.h
drivers/net/tokenring/olympic.h
drivers/net/tulip/uli526x.c
drivers/net/ucc_geth.c
drivers/net/usb/asix.c
drivers/net/usb/catc.c
drivers/net/usb/cdc_subset.c
drivers/net/usb/rndis_host.c
drivers/net/virtio_net.c
drivers/net/wan/hdlc.c
drivers/net/wan/hdlc_cisco.c
drivers/net/wireless/airo.c
drivers/net/wireless/ath5k/base.c
drivers/net/wireless/ath5k/hw.c
drivers/net/wireless/b43/Kconfig
drivers/net/wireless/b43legacy/Kconfig
drivers/net/wireless/hostap/hostap_cs.c
drivers/net/wireless/hostap/hostap_hw.c
drivers/net/wireless/ipw2200.c
drivers/net/wireless/libertas/ethtool.c
drivers/net/wireless/libertas/main.c
drivers/net/wireless/orinoco_cs.c
drivers/net/wireless/rtl8187_dev.c
drivers/net/wireless/zd1211rw/zd_mac.c
drivers/net/wireless/zd1211rw/zd_usb.c
drivers/net/xen-netfront.c
drivers/power/power_supply_core.c
drivers/s390/char/vmlogrdr.c
drivers/sbus/char/bpp.c
drivers/scsi/3w-9xxx.c
drivers/scsi/aha152x.c
drivers/scsi/atp870u.c
drivers/scsi/ch.c
drivers/scsi/hptiop.c
drivers/scsi/mac_esp.c
drivers/scsi/osst.c
drivers/scsi/qla1280.c
drivers/scsi/sg.c
drivers/scsi/st.c
drivers/serial/8250_pci.c
drivers/serial/serial_core.c
drivers/spi/spidev.c
drivers/uio/uio.c
drivers/usb/class/Kconfig
drivers/usb/class/Makefile
drivers/usb/class/cdc-wdm.c [new file with mode: 0644]
drivers/usb/core/hcd.c
drivers/usb/gadget/pxa27x_udc.c
drivers/usb/host/ehci-orion.c
drivers/usb/misc/phidgetkit.c
drivers/usb/misc/phidgetmotorcontrol.c
drivers/usb/misc/phidgetservo.c
drivers/usb/serial/ch341.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio.h
drivers/usb/serial/option.c
drivers/usb/serial/pl2303.c
drivers/usb/serial/pl2303.h
drivers/video/aty/atyfb_base.c
drivers/video/aty/radeon_base.c
drivers/video/display/display-sysfs.c
drivers/video/matrox/matroxfb_base.h
drivers/video/pxafb.c
drivers/video/s3c2410fb.c
drivers/video/s3c2410fb.h
drivers/video/sis/sis_main.c
drivers/video/sm501fb.c
drivers/watchdog/Kconfig
drivers/watchdog/Makefile
drivers/watchdog/bfin_wdt.c
drivers/watchdog/booke_wdt.c
drivers/watchdog/geodewdt.c [new file with mode: 0644]
drivers/watchdog/hpwdt.c
drivers/watchdog/iTCO_wdt.c
drivers/watchdog/w83697hf_wdt.c
fs/cifs/AUTHORS
fs/cifs/CHANGES
fs/cifs/README
fs/cifs/TODO
fs/cifs/cifs_dfs_ref.c
fs/cifs/cifs_fs_sb.h
fs/cifs/cifs_spnego.c
fs/cifs/cifsfs.c
fs/cifs/cifsfs.h
fs/cifs/cifsglob.h
fs/cifs/cifspdu.h
fs/cifs/cifsproto.h
fs/cifs/cifssmb.c
fs/cifs/connect.c
fs/cifs/dir.c
fs/cifs/dns_resolve.c
fs/cifs/file.c
fs/cifs/inode.c
fs/cifs/ioctl.c
fs/cifs/link.c
fs/cifs/netmisc.c
fs/cifs/ntlmssp.h
fs/cifs/readdir.c
fs/ecryptfs/crypto.c
fs/ecryptfs/miscdev.c
fs/fuse/inode.c
fs/gfs2/glops.c
fs/gfs2/incore.h
fs/gfs2/inode.c
fs/gfs2/meta_io.c
fs/gfs2/ops_fstype.c
fs/gfs2/ops_super.c
fs/gfs2/rgrp.c
fs/hppfs/Makefile
fs/nfsd/nfs4callback.c
fs/ntfs/upcase.c
fs/ocfs2/alloc.c
fs/proc/inode.c
fs/proc/proc_misc.c
fs/sysfs/dir.c
fs/xfs/linux-2.6/xfs_buf.c
fs/xfs/linux-2.6/xfs_buf.h
fs/xfs/linux-2.6/xfs_file.c
fs/xfs/linux-2.6/xfs_vnode.h
fs/xfs/xfs_inode.c
fs/xfs/xfs_vnodeops.c
fs/xfs/xfs_vnodeops.h
include/asm-arm/arch-omap/board-palmte.h
include/asm-arm/arch-omap/clock.h
include/asm-arm/arch-omap/entry-macro.S
include/asm-arm/arch-omap/gpio.h
include/asm-arm/arch-omap/hardware.h
include/asm-arm/arch-sa1100/collie.h
include/asm-arm/page.h
include/asm-arm/system.h
include/asm-generic/gpio.h
include/asm-mips/gic.h
include/asm-mips/mach-au1x00/au1000.h
include/asm-powerpc/mpic.h
include/asm-x86/page.h
include/asm-x86/pgtable-3level.h
include/asm-x86/pgtable.h
include/asm-x86/pgtable_32.h
include/asm-x86/pgtable_64.h
include/asm-x86/tlbflush.h
include/asm-x86/xen/page.h
include/linux/Kbuild
include/linux/atm.h
include/linux/atm_tcp.h
include/linux/device.h
include/linux/gpio.h
include/linux/hid.h
include/linux/hiddev.h
include/linux/mman.h
include/linux/mmzone.h
include/linux/netdevice.h
include/linux/netfilter.h
include/linux/netfilter_arp/arp_tables.h
include/linux/netfilter_ipv4/ip_tables.h
include/linux/netfilter_ipv6/ip6_tables.h
include/linux/pci_ids.h
include/linux/raid/bitmap.h
include/linux/raid/md.h
include/linux/raid/md_k.h
include/linux/sm501.h
include/linux/sunrpc/svc_rdma.h
include/linux/tcp.h
include/linux/types.h
include/linux/usb/cdc.h
include/media/videobuf-core.h
include/net/mac80211.h
include/net/ndisc.h
include/net/netlink.h
init/Kconfig
init/do_mounts_md.c
kernel/cgroup.c
kernel/exit.c
kernel/module.c
kernel/signal.c
kernel/stop_machine.c
kernel/sys.c
lib/lmb.c
mm/backing-dev.c
mm/memory.c
mm/mmap.c
mm/nommu.c
mm/page_alloc.c
mm/swap.c
net/8021q/vlan.c
net/8021q/vlan_dev.c
net/core/dev.c
net/core/pktgen.c
net/ipv4/arp.c
net/ipv4/ip_gre.c
net/ipv4/ipip.c
net/ipv4/route.c
net/ipv4/tcp_output.c
net/ipv6/addrconf.c
net/ipv6/ndisc.c
net/ipv6/route.c
net/ipv6/sit.c
net/key/af_key.c
net/mac80211/mlme.c
net/mac80211/util.c
net/mac80211/wext.c
net/sched/cls_api.c
net/sunrpc/svc_xprt.c
net/sunrpc/svcauth_unix.c
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
net/sunrpc/xprtrdma/svc_rdma_sendto.c
net/sunrpc/xprtrdma/svc_rdma_transport.c
net/xfrm/xfrm_user.c
scripts/ver_linux
sound/core/sound.c
sound/drivers/pcsp/pcsp.c
sound/drivers/pcsp/pcsp.h
sound/drivers/pcsp/pcsp_lib.c
sound/drivers/pcsp/pcsp_mixer.c
sound/oss/Kconfig
sound/pci/hda/patch_analog.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/pci/hda/patch_via.c
sound/usb/caiaq/caiaq-device.c

index 9c0d650..d24ad50 100644 (file)
@@ -52,6 +52,7 @@ series
 
 # cscope files
 cscope.*
+ncscope.*
 
 *.orig
 *~
index 5ac1e01..5f50097 100644 (file)
@@ -14,6 +14,10 @@ MAJOR:MINOR
        non-block filesystems which provide their own BDI, such as NFS
        and FUSE.
 
+MAJOR:MINOR-fuseblk
+
+       Value of st_dev on fuseblk filesystems.
+
 default
 
        The default backing dev, used for non-block device backed
index 77c42f4..2510763 100644 (file)
 </sect1>
 </chapter>
 
+<chapter id="trylock-functions">
+ <title>The trylock Functions</title>
+  <para>
+   There are functions that try to acquire a lock only once and immediately
+   return a value telling about success or failure to acquire the lock.
+   They can be used if you need no access to the data protected with the lock
+   when some other thread is holding the lock. You should acquire the lock
+   later if you then need access to the data protected with the lock.
+  </para>
+
+  <para>
+    <function>spin_trylock()</function> does not spin but returns non-zero if
+    it acquires the spinlock on the first try or 0 if not. This function can
+    be used in all contexts like <function>spin_lock</function>: you must have
+    disabled the contexts that might interrupt you and acquire the spin lock.
+  </para>
+
+  <para>
+    <function>mutex_trylock()</function> does not suspend your task
+    but returns non-zero if it could lock the mutex on the first try
+    or 0 if not. This function cannot be safely used in hardware or software
+    interrupt contexts despite not sleeping.
+  </para>
+</chapter>
+
   <chapter id="Examples">
    <title>Common Examples</title>
     <para>
index 6a9c55b..dcec056 100644 (file)
@@ -129,14 +129,6 @@ to its default value of '80' it means that between the checking
 intervals the CPU needs to be on average more than 80% in use to then
 decide that the CPU frequency needs to be increased.  
 
-sampling_down_factor: this parameter controls the rate that the CPU
-makes a decision on when to decrease the frequency.  When set to its
-default value of '5' it means that at 1/5 the sampling_rate the kernel
-makes a decision to lower the frequency.  Five "lower rate" decisions
-have to be made in a row before the CPU frequency is actually lower.
-If set to '1' then the frequency decreases as quickly as it increases,
-if set to '2' it decreases at half the rate of the increase.
-
 ignore_nice_load: this parameter takes a value of '0' or '1'. When
 set to '0' (its default), all processes are counted towards the
 'cpu utilisation' value.  When set to '1', the processes that are
diff --git a/Documentation/hwmon/ibmaem b/Documentation/hwmon/ibmaem
new file mode 100644 (file)
index 0000000..2fefaf5
--- /dev/null
@@ -0,0 +1,37 @@
+Kernel driver ibmaem
+======================
+
+Supported systems:
+  * Any recent IBM System X server with Active Energy Manager support.
+    This includes the x3350, x3550, x3650, x3655, x3755, x3850 M2,
+    x3950 M2, and certain HS2x/LS2x/QS2x blades.  The IPMI host interface
+    driver ("ipmi-si") needs to be loaded for this driver to do anything.
+    Prefix: 'ibmaem'
+    Datasheet: Not available
+
+Author: Darrick J. Wong
+
+Description
+-----------
+
+This driver implements sensor reading support for the energy and power
+meters available on various IBM System X hardware through the BMC.  All
+sensor banks will be exported as platform devices; this driver can talk
+to both v1 and v2 interfaces.  This driver is completely separate from the
+older ibmpex driver.
+
+The v1 AEM interface has a simple set of features to monitor energy use.
+There is a register that displays an estimate of raw energy consumption
+since the last BMC reset, and a power sensor that returns average power
+use over a configurable interval.
+
+The v2 AEM interface is a bit more sophisticated, being able to present
+a wider range of energy and power use registers, the power cap as
+set by the AEM software, and temperature sensors.
+
+Special Features
+----------------
+
+The "power_cap" value displays the current system power cap, as set by
+the Active Energy Manager software.  Setting the power cap from the host
+is not currently supported.
index a029161..0a6d2ca 100644 (file)
@@ -982,13 +982,6 @@ L: bonding-devel@lists.sourceforge.net
 W:     http://sourceforge.net/projects/bonding/
 S:     Supported
 
-BROADBAND PROCESSOR ARCHITECTURE
-P:     Arnd Bergmann
-M:     arnd@arndb.de
-L:     linuxppc-dev@ozlabs.org
-W:     http://www.penguinppc.org/ppc64/
-S:     Supported
-
 BROADCOM B44 10/100 ETHERNET DRIVER
 P:     Gary Zambrano
 M:     zambrano@broadcom.com
@@ -1052,6 +1045,14 @@ L:       linux-kernel@vger.kernel.org
 L:     discuss@x86-64.org
 S:     Maintained
 
+CELL BROADBAND ENGINE ARCHITECTURE
+P:     Arnd Bergmann
+M:     arnd@arndb.de
+L:     linuxppc-dev@ozlabs.org
+L:     cbe-oss-dev@ozlabs.org
+W:     http://www.ibm.com/developerworks/power/cell/
+S:     Supported
+
 CFAG12864B LCD DRIVER
 P:     Miguel Ojeda Sandonis
 M:     maxextreme@gmail.com
@@ -1239,6 +1240,20 @@ L:       video4linux-list@redhat.com
 W:     http://linuxtv.org
 S:     Maintained
 
+CXGB3 ETHERNET DRIVER (CXGB3)
+P:     Divy Le Ray
+M:     divy@chelsio.com
+L:     netdev@vger.kernel.org
+W:     http://www.chelsio.com
+S:     Supported
+
+CXGB3 IWARP RNIC DRIVER (IW_CXGB3)
+P:     Steve Wise
+M:     swise@chelsio.com
+L:     general@lists.openfabrics.org
+W:     http://www.openfabrics.org
+S:     Supported
+
 CYBERPRO FB DRIVER
 P:     Russell King
 M:     rmk@arm.linux.org.uk
@@ -1645,8 +1660,10 @@ W:       http://linux-fbdev.sourceforge.net/
 S:     Maintained
 
 FREESCALE DMA DRIVER
-P;     Zhang Wei
-M:     wei.zhang@freescale.com
+P:     Li Yang
+M:     leoli@freescale.com
+P:     Zhang Wei
+M:     zw@zh-kernel.org
 L:     linuxppc-embedded@ozlabs.org
 L:     linux-kernel@vger.kernel.org
 S:     Maintained
@@ -3142,7 +3159,7 @@ PCI ERROR RECOVERY
 P:     Linas Vepstas
 M:     linas@austin.ibm.com
 L:     linux-kernel@vger.kernel.org
-L:     linux-pci@atrey.karlin.mff.cuni.cz
+L:     linux-pci@vger.kernel.org
 S:     Supported
 
 PCI SUBSYSTEM
@@ -3776,6 +3793,14 @@ M:       dbrownell@users.sourceforge.net
 L:     spi-devel-general@lists.sourceforge.net
 S:     Maintained
 
+SPU FILE SYSTEM
+P:     Jeremy Kerr
+M:     jk@ozlabs.org
+L:     linuxppc-dev@ozlabs.org
+L:     cbe-oss-dev@ozlabs.org
+W:     http://www.ibm.com/developerworks/power/cell/
+S:     Supported
+
 STABLE BRANCH:
 P:     Greg Kroah-Hartman
 M:     greg@kroah.com
@@ -4350,6 +4375,14 @@ M:       gregkh@suse.de
 L:     linux-kernel@vger.kernel.org
 S:     Maintained
 
+UTIL-LINUX-NG PACKAGE
+P:     Karel Zak
+M:     kzak@redhat.com
+L:     util-linux-ng@vger.kernel.org
+W:     http://kernel.org/~kzak/util-linux-ng/
+T:     git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git
+S:     Maintained
+
 VFAT/FAT/MSDOS FILESYSTEM:
 P:     OGAWA Hirofumi
 M:     hirofumi@mail.parknet.co.jp
index 1de121f..f446477 100644 (file)
 #include <asm/mach/arch.h>
 #include <asm/arch/at91x40.h>
 #include <asm/arch/at91_st.h>
+#include <asm/arch/timex.h>
 #include "generic.h"
 
 /*
- * This is used in the gpio code, stub locally.
+ * Export the clock functions for the AT91X40. Some external code common
+ * to all AT91 family parts relys on this, like the gpio and serial support.
  */
 int clk_enable(struct clk *clk)
 {
        return 0;
 }
 
+void clk_disable(struct clk *clk)
+{
+}
+
+unsigned long clk_get_rate(struct clk *clk)
+{
+       return AT91X40_MASTER_CLOCK;
+}
+
+struct clk *clk_get(struct device *dev, const char *id)
+{
+       return NULL;
+}
+
 void __init at91x40_initialize(unsigned long main_clock)
 {
        at91_extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1)
index 92d79fb..62e653a 100644 (file)
@@ -369,7 +369,8 @@ static int impd1_probe(struct lm_device *dev)
 
        lm_set_drvdata(dev, impd1);
 
-       printk("IM-PD1 found at 0x%08lx\n", dev->resource.start);
+       printk("IM-PD1 found at 0x%08lx\n",
+               (unsigned long)dev->resource.start);
 
        for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) {
                impd1->vcos[i].owner = THIS_MODULE,
index d55fa4e..c07f497 100644 (file)
@@ -405,7 +405,6 @@ v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
                addr, fsr, pc, instr, __raw_readl(SC_LBFADDR), __raw_readl(SC_LBFCODE) & 255,
                v3_readb(V3_LB_ISTAT));
        printk(KERN_DEBUG "%s", buf);
-       printascii(buf);
 #endif
 
        v3_writeb(V3_LB_ISTAT, 0);
@@ -447,6 +446,7 @@ static irqreturn_t v3_irq(int dummy, void *devid)
        unsigned long pc = instruction_pointer(regs);
        unsigned long instr = *(unsigned long *)pc;
        char buf[128];
+       extern void printascii(const char *);
 
        sprintf(buf, "V3 int %d: pc=0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x "
                "ISTAT=%02x\n", IRQ_AP_V3INT, pc, instr,
index a0b16a7..a4d2012 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
-#include <linux/spi/tsc2102.h>
 #include <linux/interrupt.h>
 #include <linux/apm-emulation.h>
 
@@ -315,14 +314,6 @@ static void palmte_get_power_status(struct apm_power_info *info, int *battery)
 #define palmte_get_power_status        NULL
 #endif
 
-static struct tsc2102_config palmte_tsc2102_config = {
-       .use_internal   = 0,
-       .monitor        = TSC_BAT1 | TSC_AUX | TSC_TEMP,
-       .temp_at25c     = { 2200, 2615 },
-       .apm_report     = palmte_get_power_status,
-       .alsa_config    = &palmte_alsa_config,
-};
-
 static struct omap_board_config_kernel palmte_config[] __initdata = {
        { OMAP_TAG_USB,         &palmte_usb_config },
        { OMAP_TAG_MMC,         &palmte_mmc_config },
@@ -336,7 +327,6 @@ static struct spi_board_info palmte_spi_info[] __initdata = {
                .bus_num        = 2,    /* uWire (officially) */
                .chip_select    = 0,    /* As opposed to 3 */
                .irq            = OMAP_GPIO_IRQ(PALMTE_PINTDAV_GPIO),
-               .platform_data  = &palmte_tsc2102_config,
                .max_speed_hz   = 8000000,
        },
 };
index dace382..e7d0fcd 100644 (file)
@@ -38,7 +38,6 @@
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxa2xx-regs.h>
 #include <asm/arch/pxa2xx-gpio.h>
-#include <asm/arch/pxa27x-udc.h>
 #include <asm/arch/irda.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/ohci.h>
index 661a235..27f63d5 100644 (file)
@@ -374,7 +374,7 @@ static struct resource bast_dm9k_resource[] = {
        [2] = {
                .start = IRQ_DM9000,
                .end   = IRQ_DM9000,
-               .flags = IORESOURCE_IRQ,
+               .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
        }
 
 };
index c564233..4c4b5c4 100644 (file)
@@ -263,7 +263,7 @@ static struct resource vr1000_dm9k0_resource[] = {
        [2] = {
                .start = IRQ_VR1000_DM9000A,
                .end   = IRQ_VR1000_DM9000A,
-               .flags = IORESOURCE_IRQ
+               .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
        }
 
 };
@@ -282,7 +282,7 @@ static struct resource vr1000_dm9k1_resource[] = {
        [2] = {
                .start = IRQ_VR1000_DM9000N,
                .end   = IRQ_VR1000_DM9000N,
-               .flags = IORESOURCE_IRQ
+               .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
        }
 };
 
index 6496eb6..2f772a3 100644 (file)
@@ -225,26 +225,28 @@ static void __init collie_init(void)
        int ret = 0;
 
        /* cpu initialize */
-       GAFR = ( GPIO_SSP_TXD | \
-                GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SSP_CLK | GPIO_TIC_ACK | \
-                GPIO_32_768kHz );
-
-       GPDR = ( GPIO_LDD8 | GPIO_LDD9 | GPIO_LDD10 | GPIO_LDD11 | GPIO_LDD12 | \
-                GPIO_LDD13 | GPIO_LDD14 | GPIO_LDD15 | GPIO_SSP_TXD | \
-                GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SDLC_SCLK | \
-                GPIO_SDLC_AAF | GPIO_UART_SCLK1 | GPIO_32_768kHz );
-       GPLR = GPIO_GPIO18;
-
-       // PPC pin setting
-       PPDR = ( PPC_LDD0 | PPC_LDD1 | PPC_LDD2 | PPC_LDD3 | PPC_LDD4 | PPC_LDD5 | \
-                PPC_LDD6 | PPC_LDD7 | PPC_L_PCLK | PPC_L_LCLK | PPC_L_FCLK | PPC_L_BIAS | \
-                PPC_TXD1 | PPC_TXD2 | PPC_RXD2 | PPC_TXD3 | PPC_TXD4 | PPC_SCLK | PPC_SFRM );
-
-       PSDR = ( PPC_RXD1 | PPC_RXD2 | PPC_RXD3 | PPC_RXD4 );
-
-       GAFR |= GPIO_32_768kHz;
-       GPDR |= GPIO_32_768kHz;
-       TUCR  = TUCR_32_768kHz;
+       GAFR = GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SSP_CLK |
+               GPIO_MCP_CLK | GPIO_32_768kHz;
+
+       GPDR = GPIO_LDD8 | GPIO_LDD9 | GPIO_LDD10 | GPIO_LDD11 | GPIO_LDD12 |
+               GPIO_LDD13 | GPIO_LDD14 | GPIO_LDD15 | GPIO_SSP_TXD |
+               GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SDLC_SCLK |
+               COLLIE_GPIO_UCB1x00_RESET | COLLIE_GPIO_nMIC_ON |
+               COLLIE_GPIO_nREMOCON_ON | GPIO_32_768kHz;
+
+       PPDR = PPC_LDD0 | PPC_LDD1 | PPC_LDD2 | PPC_LDD3 | PPC_LDD4 | PPC_LDD5 |
+               PPC_LDD6 | PPC_LDD7 | PPC_L_PCLK | PPC_L_LCLK | PPC_L_FCLK | PPC_L_BIAS |
+               PPC_TXD1 | PPC_TXD2 | PPC_TXD3 | PPC_TXD4 | PPC_SCLK | PPC_SFRM;
+
+       PWER = COLLIE_GPIO_AC_IN | COLLIE_GPIO_CO | COLLIE_GPIO_ON_KEY |
+               COLLIE_GPIO_WAKEUP | COLLIE_GPIO_nREMOCON_INT | PWER_RTC;
+
+       PGSR = COLLIE_GPIO_nREMOCON_ON;
+
+       PSDR = PPC_RXD1 | PPC_RXD2 | PPC_RXD3 | PPC_RXD4;
+
+       PCFR = PCFR_OPDE;
+
 
        platform_scoop_config = &collie_pcmcia_config;
 
index 2946c19..2db5580 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/clk.h>
 #include <linux/mutex.h>
 #include <linux/platform_device.h>
+#include <linux/cpufreq.h>
 
 #include <asm/io.h>
 
index f197bb3..2f01af5 100644 (file)
@@ -65,6 +65,7 @@ void __init s3c244x_map_io(struct map_desc *mach_desc, int size)
 
        /* rename any peripherals used differing from the s3c2410 */
 
+       s3c_device_sdi.name  = "s3c2440-sdi";
        s3c_device_i2c.name  = "s3c2440-i2c";
        s3c_device_nand.name = "s3c2440-nand";
        s3c_device_usbgadget.name = "s3c2440-usbgadget";
index b841ecf..9af7740 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/types.h>
 #include <linux/bootmem.h>
 #include <linux/highmem.h>
+#include <linux/module.h>
 
 #include <asm/setup.h>
 #include <asm/segment.h>
@@ -56,7 +57,9 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
  */
 static unsigned long empty_bad_page_table;
 static unsigned long empty_bad_page;
+
 unsigned long empty_zero_page;
+EXPORT_SYMBOL(empty_zero_page);
 
 /*****************************************************************************/
 /*
index 891e134..4253f87 100644 (file)
@@ -15,6 +15,12 @@ char *strcpy(char *dest, const char *src)
 }
 EXPORT_SYMBOL(strcpy);
 
+char *strcat(char *dest, const char *src)
+{
+       return __kernel_strcpy(dest + __kernel_strlen(dest), src);
+}
+EXPORT_SYMBOL(strcat);
+
 void *memset(void *s, int c, size_t count)
 {
        void *xs = s;
index 2347294..2f50acd 100644 (file)
@@ -20,21 +20,19 @@ kernel-vmlinux.strip.gz
 mktree
 uImage
 cuImage.*
+dtbImage.*
 treeImage.*
 zImage
+zImage.initrd
 zImage.bin.*
 zImage.chrp
 zImage.coff
-zImage.coff.lds
-zImage.ep*
+zImage.holly
 zImage.iseries
 zImage.*lds
 zImage.miboot
 zImage.pmac
 zImage.pseries
-zImage.redboot*
-zImage.sandpoint
-zImage.vmode
 zconf.h
 zlib.h
 zutil.h
index 7822d25..f5e0b2a 100644 (file)
@@ -99,7 +99,7 @@ $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds: $(obj)/%: $(srct
        @cp $< $@
 
 clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
-               empty.c zImage zImage.coff.lds zImage.ps3.lds zImage.lds
+               empty.c zImage.coff.lds zImage.ps3.lds zImage.lds
 
 quiet_cmd_bootcc = BOOTCC  $@
       cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $<
@@ -339,7 +339,9 @@ install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
        sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $<
 
 # anything not in $(targets)
-clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.* treeImage.* \
+clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \
+       zImage zImage.initrd zImage.chrp zImage.coff zImage.holly \
+       zImage.iseries zImage.miboot zImage.pmac zImage.pseries \
        otheros.bld *.dtb
 
 # clean up files cached by wrapper
index 1e7802c..fea5925 100644 (file)
                dma@82a8 {
                        #address-cells = <1>;
                        #size-cells = <1>;
-                       compatible = "fsl,mpc8349-dma";
+                       compatible = "fsl,mpc8377-dma", "fsl,elo-dma";
                        reg = <0x82a8 4>;
                        ranges = <0 0x8100 0x1a8>;
                        interrupt-parent = <&ipic>;
                        interrupts = <0x47 8>;
                        cell-index = <0>;
                        dma-channel@0 {
-                               compatible = "fsl,mpc8349-dma-channel";
+                               compatible = "fsl,mpc8377-dma-channel", "fsl,elo-dma-channel";
                                reg = <0 0x80>;
+                               interrupt-parent = <&ipic>;
+                               interrupts = <0x47 8>;
                        };
                        dma-channel@80 {
-                               compatible = "fsl,mpc8349-dma-channel";
+                               compatible = "fsl,mpc8377-dma-channel", "fsl,elo-dma-channel";
                                reg = <0x80 0x80>;
+                               interrupt-parent = <&ipic>;
+                               interrupts = <0x47 8>;
                        };
                        dma-channel@100 {
-                               compatible = "fsl,mpc8349-dma-channel";
+                               compatible = "fsl,mpc8377-dma-channel", "fsl,elo-dma-channel";
                                reg = <0x100 0x80>;
+                               interrupt-parent = <&ipic>;
+                               interrupts = <0x47 8>;
                        };
                        dma-channel@180 {
-                               compatible = "fsl,mpc8349-dma-channel";
+                               compatible = "fsl,mpc8377-dma-channel", "fsl,elo-dma-channel";
                                reg = <0x180 0x28>;
+                               interrupt-parent = <&ipic>;
+                               interrupts = <0x47 8>;
                        };
                };
 
index d7fd298..05360d4 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.25-rc6
-# Thu Mar 27 13:55:37 2008
+# Linux kernel version: 2.6.26-rc3
+# Tue May 20 20:00:44 2008
 #
 # CONFIG_PPC64 is not set
 
@@ -32,6 +32,8 @@ CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_HARDIRQS=y
 # CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
 CONFIG_IRQ_PER_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_ARCH_HAS_ILOG2_U32=y
 CONFIG_GENERIC_HWEIGHT=y
@@ -88,6 +90,7 @@ CONFIG_INITRAMFS_SOURCE=""
 CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
 CONFIG_SYSCTL_SYSCALL=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -95,6 +98,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
+CONFIG_PCSPKR_PLATFORM=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
@@ -115,12 +119,14 @@ CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
+# CONFIG_HAVE_DMA_ATTRS is not set
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 # CONFIG_MODVERSIONS is not set
@@ -217,11 +223,13 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 # CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_FORCE_MAX_ZONEORDER=11
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
 # CONFIG_PM is not set
@@ -245,6 +253,7 @@ CONFIG_ARCH_SUPPORTS_MSI=y
 # CONFIG_PCI_DEBUG is not set
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
+# CONFIG_HAS_RAPIDIO is not set
 
 #
 # Advanced setup
@@ -254,11 +263,11 @@ CONFIG_ARCH_SUPPORTS_MSI=y
 #
 # Default settings for advanced configuration options are used
 #
-CONFIG_HIGHMEM_START=0xfe000000
 CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_PAGE_OFFSET=0xc0000000
 CONFIG_KERNEL_START=0xc0000000
+CONFIG_PHYSICAL_START=0x00000000
 CONFIG_TASK_SIZE=0xc0000000
-CONFIG_BOOT_LOAD=0x00800000
 
 #
 # Networking
@@ -299,8 +308,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
@@ -398,6 +405,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_CONNECTOR is not set
 # CONFIG_MTD is not set
 CONFIG_OF_DEVICE=y
+CONFIG_OF_I2C=y
 # CONFIG_PARPORT is not set
 # CONFIG_PNP is not set
 CONFIG_BLK_DEV=y
@@ -484,22 +492,8 @@ CONFIG_BLK_DEV_SL82C105=y
 # CONFIG_BLK_DEV_TRM290 is not set
 CONFIG_BLK_DEV_VIA82CXXX=y
 # CONFIG_BLK_DEV_TC86C001 is not set
-
-#
-# Other IDE chipsets support
-#
-
-#
-# Note: most of these also require special kernel boot parameters
-#
-# CONFIG_BLK_DEV_4DRIVES is not set
-# CONFIG_BLK_DEV_ALI14XX is not set
-# CONFIG_BLK_DEV_DTC2278 is not set
-# CONFIG_BLK_DEV_HT6560B is not set
-# CONFIG_BLK_DEV_QD65XX is not set
-# CONFIG_BLK_DEV_UMC8672 is not set
 CONFIG_BLK_DEV_IDEDMA=y
-CONFIG_IDE_ARCH_OBSOLETE_INIT=y
+# CONFIG_BLK_DEV_HD_ONLY is not set
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -641,7 +635,6 @@ CONFIG_DE4X5=y
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
 CONFIG_NET_PCI=y
 CONFIG_PCNET32=y
-# CONFIG_PCNET32_NAPI is not set
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_AC3200 is not set
@@ -684,7 +677,6 @@ CONFIG_NETDEV_1000=y
 # 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
@@ -703,6 +695,7 @@ CONFIG_NETDEV_10000=y
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
 # CONFIG_BNX2X is not set
+# CONFIG_SFC is not set
 # CONFIG_TR is not set
 
 #
@@ -710,6 +703,7 @@ CONFIG_NETDEV_10000=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 
 #
 # USB Network Adapters
@@ -813,6 +807,7 @@ CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_NOZOMI is not set
 
@@ -853,13 +848,7 @@ CONFIG_DEVPORT=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
 # CONFIG_I2C_CHARDEV is not set
-
-#
-# I2C Algorithms
-#
 CONFIG_I2C_ALGOBIT=y
-# CONFIG_I2C_ALGOPCF is not set
-# CONFIG_I2C_ALGOPCA is not set
 
 #
 # I2C Hardware Bus support
@@ -890,6 +879,7 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_VIAPRO is not set
 # CONFIG_I2C_VOODOO3 is not set
 # CONFIG_I2C_PCA_ISA is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
 
 #
 # Miscellaneous I2C Chip support
@@ -899,19 +889,13 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_TPS65010 is not set
 # CONFIG_SENSORS_MAX6875 is not set
 # CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
 # CONFIG_I2C_DEBUG_CHIP is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
@@ -928,12 +912,22 @@ CONFIG_SSB_POSSIBLE=y
 # Multifunction device drivers
 #
 # CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
 
 #
 # Multimedia devices
 #
+
+#
+# Multimedia core support
+#
 # CONFIG_VIDEO_DEV is not set
 # CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
 # CONFIG_DAB is not set
 
 #
@@ -953,8 +947,8 @@ CONFIG_FB_CFB_IMAGEBLIT=y
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 # CONFIG_FB_SYS_FOPS is not set
-CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 CONFIG_FB_MACMODES=y
 CONFIG_FB_BACKLIGHT=y
@@ -1072,11 +1066,13 @@ CONFIG_USB_DEVICE_CLASS=y
 #
 # USB Host Controller Drivers
 #
+# CONFIG_USB_C67X00_HCD is not set
 CONFIG_USB_EHCI_HCD=m
 # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
 # CONFIG_USB_EHCI_TT_NEWSCHED is not set
 # CONFIG_USB_EHCI_HCD_PPC_OF is not set
 # CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_OHCI_HCD_PPC_OF is not set
 # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
@@ -1112,6 +1108,7 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_ALAUDA is not set
 # CONFIG_USB_STORAGE_ONETOUCH is not set
 # CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
 # CONFIG_USB_LIBUSUAL is not set
 
 #
@@ -1153,14 +1150,11 @@ CONFIG_USB_MON=y
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
 # CONFIG_EDAC is not set
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
-
-#
-# Userspace I/O
-#
 # CONFIG_UIO is not set
 
 #
@@ -1180,7 +1174,6 @@ CONFIG_FS_MBCACHE=y
 # 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_DNOTIFY=y
 CONFIG_INOTIFY=y
@@ -1314,6 +1307,7 @@ CONFIG_NLS_ISO8859_1=m
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 CONFIG_CRC_CCITT=m
 # CONFIG_CRC16 is not set
 # CONFIG_CRC_ITU_T is not set
@@ -1334,6 +1328,7 @@ CONFIG_HAVE_LMB=y
 # CONFIG_PRINTK_TIME is not set
 CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 # CONFIG_DEBUG_FS is not set
@@ -1344,6 +1339,7 @@ CONFIG_DETECT_SOFTLOCKUP=y
 CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
 # CONFIG_SLUB_DEBUG_ON is not set
 # CONFIG_SLUB_STATS is not set
 # CONFIG_DEBUG_RT_MUTEXES is not set
@@ -1357,6 +1353,7 @@ CONFIG_DEBUG_SPINLOCK_SLEEP=y
 CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
 # CONFIG_BOOT_PRINTK_DELAY is not set
@@ -1371,6 +1368,7 @@ CONFIG_DEBUGGER=y
 CONFIG_XMON=y
 CONFIG_XMON_DEFAULT=y
 CONFIG_XMON_DISASSEMBLY=y
+CONFIG_IRQSTACKS=y
 # CONFIG_BDI_SWITCH is not set
 # CONFIG_BOOTX_TEXT is not set
 # CONFIG_PPC_EARLY_DEBUG is not set
@@ -1382,50 +1380,80 @@ CONFIG_XMON_DISASSEMBLY=y
 # CONFIG_SECURITY is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
 CONFIG_CRYPTO_ALGAPI=m
 CONFIG_CRYPTO_BLKCIPHER=m
-# CONFIG_CRYPTO_SEQIV is not set
 CONFIG_CRYPTO_MANAGER=m
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=m
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
 # CONFIG_CRYPTO_HMAC is not set
 # CONFIG_CRYPTO_XCBC is not set
-# CONFIG_CRYPTO_NULL is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_MD4 is not set
 # CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
 CONFIG_CRYPTO_SHA1=m
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=m
-CONFIG_CRYPTO_PCBC=m
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_XTS is not set
-# CONFIG_CRYPTO_CTR is not set
-# CONFIG_CRYPTO_GCM is not set
-# CONFIG_CRYPTO_CCM is not set
-# CONFIG_CRYPTO_CRYPTD is not set
-# CONFIG_CRYPTO_DES is not set
-# CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
 # CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_ARC4=m
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
 # CONFIG_CRYPTO_CAST5 is not set
 # CONFIG_CRYPTO_CAST6 is not set
-# CONFIG_CRYPTO_TEA is not set
-CONFIG_CRYPTO_ARC4=m
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
 # CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_ANUBIS is not set
-# CONFIG_CRYPTO_SEED is not set
 # CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
 # CONFIG_CRYPTO_DEFLATE is not set
-# CONFIG_CRYPTO_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_CAMELLIA is not set
-# CONFIG_CRYPTO_TEST is not set
-# CONFIG_CRYPTO_AUTHENC is not set
 # CONFIG_CRYPTO_LZO is not set
 # CONFIG_CRYPTO_HW is not set
 # CONFIG_PPC_CLOCK is not set
+# CONFIG_VIRTUALIZATION is not set
index 88338a9..db34909 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.25-rc6
-# Thu Mar 27 13:55:43 2008
+# Linux kernel version: 2.6.26-rc3
+# Tue May 20 20:01:18 2008
 #
 CONFIG_PPC64=y
 
@@ -29,6 +29,9 @@ CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_HAVE_SETUP_PER_CPU_AREA=y
 CONFIG_IRQ_PER_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_ARCH_HAS_ILOG2_U32=y
 CONFIG_ARCH_HAS_ILOG2_U64=y
@@ -91,6 +94,7 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
 CONFIG_SYSCTL_SYSCALL=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -119,12 +123,14 @@ CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
+# CONFIG_HAVE_DMA_ATTRS is not set
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 CONFIG_MODVERSIONS=y
@@ -165,11 +171,11 @@ CONFIG_PPC_PMAC=y
 CONFIG_PPC_PMAC64=y
 # CONFIG_PPC_MAPLE is not set
 # CONFIG_PPC_PASEMI is not set
-# CONFIG_PPC_CELLEB is not set
 # CONFIG_PPC_PS3 is not set
 # CONFIG_PPC_CELL is not set
 # CONFIG_PPC_CELL_NATIVE is not set
 # CONFIG_PPC_IBM_CELL_BLADE is not set
+# CONFIG_PPC_CELLEB is not set
 # CONFIG_PQ2ADS is not set
 CONFIG_PPC_NATIVE=y
 # CONFIG_IPIC is not set
@@ -190,6 +196,7 @@ CONFIG_CPU_FREQ_TABLE=y
 CONFIG_CPU_FREQ_STAT=y
 # CONFIG_CPU_FREQ_STAT_DETAILS is not set
 CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
@@ -224,7 +231,6 @@ CONFIG_PREEMPT_NONE=y
 CONFIG_BINFMT_ELF=y
 CONFIG_COMPAT_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
-CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_HUGETLB_PAGE_SIZE_VARIABLE=y
 CONFIG_IOMMU_VMERGE=y
 CONFIG_IOMMU_HELPER=y
@@ -248,12 +254,14 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
+CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 # CONFIG_PPC_HAS_HASH_64K is not set
 # CONFIG_PPC_64K_PAGES is not set
+CONFIG_FORCE_MAX_ZONEORDER=13
 # CONFIG_SCHED_SMT is not set
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
@@ -278,7 +286,10 @@ CONFIG_PCI_MSI=y
 # CONFIG_PCI_DEBUG is not set
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
+# CONFIG_HAS_RAPIDIO is not set
+CONFIG_PAGE_OFFSET=0xc000000000000000
 CONFIG_KERNEL_START=0xc000000000000000
+CONFIG_PHYSICAL_START=0x00000000
 
 #
 # Networking
@@ -325,8 +336,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
@@ -342,6 +351,7 @@ CONFIG_NF_CONNTRACK=m
 # CONFIG_NF_CT_ACCT is not set
 CONFIG_NF_CONNTRACK_MARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
+# CONFIG_NF_CT_PROTO_DCCP is not set
 # CONFIG_NF_CT_PROTO_SCTP is not set
 # CONFIG_NF_CT_PROTO_UDPLITE is not set
 # CONFIG_NF_CONNTRACK_AMANDA is not set
@@ -418,6 +428,7 @@ CONFIG_FW_LOADER=y
 # CONFIG_CONNECTOR is not set
 # CONFIG_MTD is not set
 CONFIG_OF_DEVICE=y
+CONFIG_OF_I2C=y
 # CONFIG_PARPORT is not set
 CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_FD is not set
@@ -465,7 +476,6 @@ CONFIG_IDE_PROC_FS=y
 #
 # IDE chipset support/bugfixes
 #
-CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_PLATFORM is not set
 CONFIG_BLK_DEV_IDEDMA_SFF=y
 
@@ -506,7 +516,7 @@ CONFIG_BLK_DEV_IDE_PMAC=y
 CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
 CONFIG_BLK_DEV_IDEDMA_PMAC=y
 CONFIG_BLK_DEV_IDEDMA=y
-CONFIG_IDE_ARCH_OBSOLETE_INIT=y
+# CONFIG_BLK_DEV_HD_ONLY is not set
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -584,61 +594,10 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_SRP is not set
 CONFIG_ATA=y
 # CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=y
 # CONFIG_SATA_AHCI is not set
-CONFIG_SATA_SVW=y
-# 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_SATA_INIC162X 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_CMD640_PCI is not set
-# CONFIG_PATA_CMD64X is not set
-# CONFIG_PATA_CS5520 is not set
-# CONFIG_PATA_CS5530 is not set
-# CONFIG_PATA_CYPRESS is not set
-# CONFIG_PATA_EFAR is not set
-# CONFIG_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_IT8213 is not set
-# CONFIG_PATA_JMICRON is not set
-# CONFIG_PATA_TRIFLEX is not set
-# CONFIG_PATA_MARVELL is not set
-# CONFIG_PATA_MPIIX is not set
-# CONFIG_PATA_OLDPIIX is not set
-# CONFIG_PATA_NETCELL is not set
-# CONFIG_PATA_NINJA32 is not set
-# CONFIG_PATA_NS87410 is not set
-# CONFIG_PATA_NS87415 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
-# CONFIG_PATA_PLATFORM is not set
+# CONFIG_ATA_SFF is not set
 CONFIG_MD=y
 CONFIG_BLK_DEV_MD=y
 CONFIG_MD_LINEAR=y
@@ -740,7 +699,6 @@ CONFIG_E1000=y
 # 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=y
 # CONFIG_BNX2 is not set
@@ -755,10 +713,10 @@ CONFIG_NETDEV_10000=y
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
 # CONFIG_NIU is not set
-# CONFIG_PASEMI_MAC is not set
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
 # CONFIG_BNX2X is not set
+# CONFIG_SFC is not set
 CONFIG_TR=y
 CONFIG_IBMOL=y
 # CONFIG_3C359 is not set
@@ -769,6 +727,7 @@ CONFIG_IBMOL=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 
 #
 # USB Network Adapters
@@ -865,6 +824,7 @@ CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_NOZOMI is not set
 
@@ -895,13 +855,7 @@ CONFIG_DEVPORT=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=y
-
-#
-# I2C Algorithms
-#
 CONFIG_I2C_ALGOBIT=y
-# CONFIG_I2C_ALGOPCF is not set
-# CONFIG_I2C_ALGOPCA is not set
 
 #
 # I2C Hardware Bus support
@@ -930,6 +884,7 @@ CONFIG_I2C_POWERMAC=y
 # CONFIG_I2C_VIA is not set
 # CONFIG_I2C_VIAPRO is not set
 # CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
 
 #
 # Miscellaneous I2C Chip support
@@ -939,19 +894,13 @@ CONFIG_I2C_POWERMAC=y
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_TPS65010 is not set
 # CONFIG_SENSORS_MAX6875 is not set
 # CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
 # CONFIG_I2C_DEBUG_CHIP is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
@@ -968,12 +917,22 @@ CONFIG_SSB_POSSIBLE=y
 # Multifunction device drivers
 #
 # CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
 
 #
 # Multimedia devices
 #
+
+#
+# Multimedia core support
+#
 # CONFIG_VIDEO_DEV is not set
 # CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
 CONFIG_DAB=y
 # CONFIG_USB_DABUSB is not set
 
@@ -995,8 +954,8 @@ CONFIG_FB_CFB_IMAGEBLIT=y
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 # CONFIG_FB_SYS_FOPS is not set
-CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 CONFIG_FB_MACMODES=y
 CONFIG_FB_BACKLIGHT=y
@@ -1112,6 +1071,7 @@ CONFIG_SND_VERBOSE_PROCFS=y
 # CONFIG_SND_AU8810 is not set
 # CONFIG_SND_AU8820 is not set
 # CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AW2 is not set
 # CONFIG_SND_AZT3328 is not set
 # CONFIG_SND_BT87X is not set
 # CONFIG_SND_CA0106 is not set
@@ -1198,11 +1158,11 @@ CONFIG_SND_USB_AUDIO=m
 # CONFIG_SND_SOC is not set
 
 #
-# SoC Audio support for SuperH
+# ALSA SoC audio for Freescale SOCs
 #
 
 #
-# ALSA SoC audio for Freescale SOCs
+# SoC Audio for the Texas Instruments OMAP
 #
 
 #
@@ -1222,6 +1182,7 @@ CONFIG_USB_HID=y
 CONFIG_HID_FF=y
 CONFIG_HID_PID=y
 CONFIG_LOGITECH_FF=y
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
 # CONFIG_PANTHERLORD_FF is not set
 CONFIG_THRUSTMASTER_FF=y
 # CONFIG_ZEROPLUS_FF is not set
@@ -1245,11 +1206,13 @@ CONFIG_USB_DEVICE_CLASS=y
 #
 # USB Host Controller Drivers
 #
+# CONFIG_USB_C67X00_HCD is not set
 CONFIG_USB_EHCI_HCD=y
 # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
 # CONFIG_USB_EHCI_TT_NEWSCHED is not set
 # CONFIG_USB_EHCI_HCD_PPC_OF is not set
 # CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_OHCI_HCD_PPC_OF=y
 CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
@@ -1288,6 +1251,7 @@ CONFIG_USB_STORAGE_JUMPSHOT=y
 # CONFIG_USB_STORAGE_ALAUDA is not set
 # CONFIG_USB_STORAGE_ONETOUCH is not set
 # CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
 # CONFIG_USB_LIBUSUAL is not set
 
 #
@@ -1342,9 +1306,11 @@ CONFIG_USB_SERIAL_KOBIL_SCT=m
 CONFIG_USB_SERIAL_MCT_U232=m
 # CONFIG_USB_SERIAL_MOS7720 is not set
 # CONFIG_USB_SERIAL_MOS7840 is not set
+# CONFIG_USB_SERIAL_MOTOROLA is not set
 # CONFIG_USB_SERIAL_NAVMAN is not set
 CONFIG_USB_SERIAL_PL2303=m
 # CONFIG_USB_SERIAL_OTI6858 is not set
+# CONFIG_USB_SERIAL_SPCP8X5 is not set
 # CONFIG_USB_SERIAL_HP4X is not set
 CONFIG_USB_SERIAL_SAFE=m
 CONFIG_USB_SERIAL_SAFE_PADDED=y
@@ -1383,14 +1349,11 @@ CONFIG_USB_APPLEDISPLAY=m
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
 # CONFIG_EDAC is not set
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
-
-#
-# Userspace I/O
-#
 # CONFIG_UIO is not set
 
 #
@@ -1420,9 +1383,9 @@ CONFIG_REISERFS_FS_SECURITY=y
 CONFIG_FS_POSIX_ACL=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
-CONFIG_XFS_SECURITY=y
 CONFIG_XFS_POSIX_ACL=y
 # CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
 # CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
 CONFIG_DNOTIFY=y
@@ -1488,13 +1451,11 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
-# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=y
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
-CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
@@ -1583,9 +1544,10 @@ CONFIG_NLS_UTF8=y
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 CONFIG_CRC_CCITT=m
 # CONFIG_CRC16 is not set
-# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC_ITU_T=m
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
 CONFIG_LIBCRC32C=m
@@ -1603,6 +1565,7 @@ CONFIG_HAVE_LMB=y
 # CONFIG_PRINTK_TIME is not set
 CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=2048
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_FS=y
@@ -1613,18 +1576,23 @@ CONFIG_DETECT_SOFTLOCKUP=y
 CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
 # CONFIG_SLUB_DEBUG_ON is not set
 # CONFIG_SLUB_STATS 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=y
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT 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_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
 # CONFIG_BOOT_PRINTK_DELAY is not set
@@ -1648,53 +1616,83 @@ CONFIG_BOOTX_TEXT=y
 # CONFIG_SECURITY is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_AEAD=m
 CONFIG_CRYPTO_BLKCIPHER=y
-# CONFIG_CRYPTO_SEQIV is not set
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_MANAGER=y
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_NULL=m
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_AUTHENC=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
 CONFIG_CRYPTO_HMAC=y
 # CONFIG_CRYPTO_XCBC is not set
-CONFIG_CRYPTO_NULL=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_SHA1=m
 CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_SHA512=m
-CONFIG_CRYPTO_WP512=m
 # CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=y
-CONFIG_CRYPTO_PCBC=m
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_XTS is not set
-# CONFIG_CRYPTO_CTR is not set
-# CONFIG_CRYPTO_GCM is not set
-# CONFIG_CRYPTO_CCM is not set
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_FCRYPT is not set
-CONFIG_CRYPTO_BLOWFISH=m
-CONFIG_CRYPTO_TWOFISH=m
-CONFIG_CRYPTO_TWOFISH_COMMON=m
-CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
 CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_BLOWFISH=m
+# CONFIG_CRYPTO_CAMELLIA is not set
 CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
-CONFIG_CRYPTO_TEA=m
-CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
 CONFIG_CRYPTO_KHAZAD=m
-CONFIG_CRYPTO_ANUBIS=m
-# CONFIG_CRYPTO_SEED is not set
 # CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
 CONFIG_CRYPTO_DEFLATE=m
-CONFIG_CRYPTO_MICHAEL_MIC=m
-CONFIG_CRYPTO_CRC32C=m
-# CONFIG_CRYPTO_CAMELLIA is not set
-CONFIG_CRYPTO_TEST=m
-CONFIG_CRYPTO_AUTHENC=m
 # CONFIG_CRYPTO_LZO is not set
 # CONFIG_CRYPTO_HW is not set
 # CONFIG_PPC_CLOCK is not set
+# CONFIG_VIRTUALIZATION is not set
index b3128fb..63f0bdb 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.25-rc6
-# Thu Mar 27 13:55:45 2008
+# Linux kernel version: 2.6.26-rc3
+# Tue May 20 20:01:36 2008
 #
 CONFIG_PPC64=y
 
@@ -30,6 +30,9 @@ CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_HAVE_SETUP_PER_CPU_AREA=y
 CONFIG_IRQ_PER_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_ARCH_HAS_ILOG2_U32=y
 CONFIG_ARCH_HAS_ILOG2_U64=y
@@ -91,6 +94,7 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
 CONFIG_SYSCTL_SYSCALL=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -118,12 +122,14 @@ CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
+# CONFIG_HAVE_DMA_ATTRS is not set
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 CONFIG_MODVERSIONS=y
@@ -172,11 +178,11 @@ CONFIG_VIOPATH=y
 # CONFIG_PPC_PMAC is not set
 # CONFIG_PPC_MAPLE is not set
 # CONFIG_PPC_PASEMI is not set
-# CONFIG_PPC_CELLEB is not set
 # CONFIG_PPC_PS3 is not set
 # CONFIG_PPC_CELL is not set
 # CONFIG_PPC_CELL_NATIVE is not set
 # CONFIG_PPC_IBM_CELL_BLADE is not set
+# CONFIG_PPC_CELLEB is not set
 # CONFIG_PQ2ADS is not set
 # CONFIG_IPIC is not set
 # CONFIG_MPIC is not set
@@ -212,7 +218,6 @@ CONFIG_PREEMPT_NONE=y
 CONFIG_BINFMT_ELF=y
 CONFIG_COMPAT_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
-CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_IOMMU_VMERGE=y
 CONFIG_IOMMU_HELPER=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
@@ -234,12 +239,14 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
+CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 # CONFIG_PPC_HAS_HASH_64K is not set
 # CONFIG_PPC_64K_PAGES is not set
+CONFIG_FORCE_MAX_ZONEORDER=13
 # CONFIG_SCHED_SMT is not set
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
@@ -263,7 +270,10 @@ CONFIG_ARCH_SUPPORTS_MSI=y
 # CONFIG_PCI_DEBUG is not set
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
+# CONFIG_HAS_RAPIDIO is not set
+CONFIG_PAGE_OFFSET=0xc000000000000000
 CONFIG_KERNEL_START=0xc000000000000000
+CONFIG_PHYSICAL_START=0x00000000
 
 #
 # Networking
@@ -310,8 +320,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
@@ -327,6 +335,7 @@ CONFIG_NF_CONNTRACK=m
 # CONFIG_NF_CT_ACCT is not set
 CONFIG_NF_CONNTRACK_MARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
+# CONFIG_NF_CT_PROTO_DCCP is not set
 # CONFIG_NF_CT_PROTO_SCTP is not set
 # CONFIG_NF_CT_PROTO_UDPLITE is not set
 # CONFIG_NF_CONNTRACK_AMANDA is not set
@@ -631,7 +640,6 @@ CONFIG_MII=y
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
 CONFIG_NET_PCI=y
 CONFIG_PCNET32=y
-CONFIG_PCNET32_NAPI=y
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
@@ -667,7 +675,6 @@ CONFIG_E1000=m
 # 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
@@ -682,10 +689,10 @@ CONFIG_NETDEV_10000=y
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
 # CONFIG_NIU is not set
-# CONFIG_PASEMI_MAC is not set
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
 # CONFIG_BNX2X is not set
+# CONFIG_SFC is not set
 CONFIG_TR=y
 CONFIG_IBMOL=y
 # CONFIG_3C359 is not set
@@ -696,6 +703,7 @@ CONFIG_IBMOL=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 # CONFIG_WAN is not set
 CONFIG_ISERIES_VETH=y
 # CONFIG_FDDI is not set
@@ -762,6 +770,7 @@ CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_NOZOMI is not set
 
@@ -793,12 +802,7 @@ CONFIG_MAX_RAW_DEVS=256
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
@@ -815,12 +819,22 @@ CONFIG_SSB_POSSIBLE=y
 # Multifunction device drivers
 #
 # CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
 
 #
 # Multimedia devices
 #
+
+#
+# Multimedia core support
+#
 # CONFIG_VIDEO_DEV is not set
 # CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
 # CONFIG_DAB is not set
 
 #
@@ -854,14 +868,11 @@ CONFIG_DUMMY_CONSOLE=y
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
 # CONFIG_EDAC is not set
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
-
-#
-# Userspace I/O
-#
 # CONFIG_UIO is not set
 
 #
@@ -895,9 +906,9 @@ CONFIG_JFS_SECURITY=y
 CONFIG_FS_POSIX_ACL=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
-CONFIG_XFS_SECURITY=y
 CONFIG_XFS_POSIX_ACL=y
 # CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
 CONFIG_GFS2_FS=m
 CONFIG_GFS2_FS_LOCKING_NOLOCK=m
 CONFIG_GFS2_FS_LOCKING_DLM=m
@@ -966,13 +977,11 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
-# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
-CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=m
@@ -1047,9 +1056,10 @@ CONFIG_DLM=m
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 CONFIG_CRC_CCITT=m
 # CONFIG_CRC16 is not set
-# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC_ITU_T=m
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
 CONFIG_LIBCRC32C=m
@@ -1071,6 +1081,7 @@ CONFIG_HAVE_LMB=y
 # CONFIG_PRINTK_TIME is not set
 CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=2048
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_FS=y
@@ -1081,18 +1092,23 @@ CONFIG_DETECT_SOFTLOCKUP=y
 CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
 # CONFIG_SLUB_DEBUG_ON is not set
 # CONFIG_SLUB_STATS 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_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT 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_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
 # CONFIG_BOOT_PRINTK_DELAY is not set
@@ -1116,53 +1132,83 @@ CONFIG_IRQSTACKS=y
 # CONFIG_SECURITY is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_AEAD=m
 CONFIG_CRYPTO_BLKCIPHER=y
-# CONFIG_CRYPTO_SEQIV is not set
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_MANAGER=y
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_NULL=m
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_AUTHENC=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
 CONFIG_CRYPTO_HMAC=y
 # CONFIG_CRYPTO_XCBC is not set
-CONFIG_CRYPTO_NULL=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_SHA1=m
 CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_SHA512=m
-CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_TGR192=m
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=y
-CONFIG_CRYPTO_PCBC=m
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_XTS is not set
-# CONFIG_CRYPTO_CTR is not set
-# CONFIG_CRYPTO_GCM is not set
-# CONFIG_CRYPTO_CCM is not set
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_FCRYPT is not set
-CONFIG_CRYPTO_BLOWFISH=m
-CONFIG_CRYPTO_TWOFISH=m
-CONFIG_CRYPTO_TWOFISH_COMMON=m
-CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
 CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_BLOWFISH=m
+# CONFIG_CRYPTO_CAMELLIA is not set
 CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
-CONFIG_CRYPTO_TEA=m
-CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
 CONFIG_CRYPTO_KHAZAD=m
-CONFIG_CRYPTO_ANUBIS=m
-CONFIG_CRYPTO_SEED=m
 # CONFIG_CRYPTO_SALSA20 is not set
+CONFIG_CRYPTO_SEED=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
 CONFIG_CRYPTO_DEFLATE=m
-CONFIG_CRYPTO_MICHAEL_MIC=m
-CONFIG_CRYPTO_CRC32C=m
-# CONFIG_CRYPTO_CAMELLIA is not set
-CONFIG_CRYPTO_TEST=m
-CONFIG_CRYPTO_AUTHENC=m
 # CONFIG_CRYPTO_LZO is not set
 # CONFIG_CRYPTO_HW is not set
 # CONFIG_PPC_CLOCK is not set
+# CONFIG_VIRTUALIZATION is not set
index fca1142..3688e4b 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.25-rc6
-# Thu Mar 27 13:56:21 2008
+# Linux kernel version: 2.6.26-rc3
+# Tue May 20 20:02:24 2008
 #
 # CONFIG_PPC64 is not set
 
@@ -31,6 +31,8 @@ CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_HARDIRQS=y
 # CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
 CONFIG_IRQ_PER_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_ARCH_HAS_ILOG2_U32=y
 CONFIG_GENERIC_HWEIGHT=y
@@ -91,6 +93,7 @@ CONFIG_INITRAMFS_SOURCE=""
 CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
 CONFIG_SYSCTL_SYSCALL=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -119,12 +122,14 @@ CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
+# CONFIG_HAVE_DMA_ATTRS is not set
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 # CONFIG_MODVERSIONS is not set
@@ -185,6 +190,7 @@ CONFIG_CPU_FREQ_TABLE=y
 CONFIG_CPU_FREQ_STAT=y
 # CONFIG_CPU_FREQ_STAT_DETAILS is not set
 CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
@@ -236,16 +242,17 @@ CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 # CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
 CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
+CONFIG_FORCE_MAX_ZONEORDER=11
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
 CONFIG_ARCH_WANTS_FREEZER_CONTROL=y
 CONFIG_PM=y
-# CONFIG_PM_LEGACY is not set
 CONFIG_PM_DEBUG=y
 # CONFIG_PM_VERBOSE is not set
 CONFIG_CAN_PM_TRACE=y
@@ -292,6 +299,7 @@ CONFIG_YENTA_TOSHIBA=y
 # CONFIG_I82092 is not set
 CONFIG_PCCARD_NONSTATIC=m
 # CONFIG_HOTPLUG_PCI is not set
+# CONFIG_HAS_RAPIDIO is not set
 
 #
 # Advanced setup
@@ -301,11 +309,11 @@ CONFIG_PCCARD_NONSTATIC=m
 #
 # Default settings for advanced configuration options are used
 #
-CONFIG_HIGHMEM_START=0xfe000000
 CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_PAGE_OFFSET=0xc0000000
 CONFIG_KERNEL_START=0xc0000000
+CONFIG_PHYSICAL_START=0x00000000
 CONFIG_TASK_SIZE=0xc0000000
-CONFIG_BOOT_LOAD=0x00800000
 
 #
 # Networking
@@ -352,8 +360,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
@@ -369,6 +375,7 @@ CONFIG_NF_CONNTRACK=m
 # CONFIG_NF_CT_ACCT is not set
 # CONFIG_NF_CONNTRACK_MARK is not set
 # CONFIG_NF_CONNTRACK_EVENTS is not set
+CONFIG_NF_CT_PROTO_DCCP=m
 # CONFIG_NF_CT_PROTO_SCTP is not set
 # CONFIG_NF_CT_PROTO_UDPLITE is not set
 # CONFIG_NF_CONNTRACK_AMANDA is not set
@@ -445,6 +452,7 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m
 CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
 # CONFIG_NF_NAT_SNMP_BASIC is not set
+CONFIG_NF_NAT_PROTO_DCCP=m
 CONFIG_NF_NAT_FTP=m
 CONFIG_NF_NAT_IRC=m
 CONFIG_NF_NAT_TFTP=m
@@ -586,7 +594,6 @@ CONFIG_MAC80211=m
 # Rate control algorithm selection
 #
 CONFIG_MAC80211_RC_DEFAULT_PID=y
-# CONFIG_MAC80211_RC_DEFAULT_SIMPLE is not set
 # CONFIG_MAC80211_RC_DEFAULT_NONE is not set
 
 #
@@ -598,7 +605,7 @@ CONFIG_MAC80211_RC_DEFAULT_PID=y
 #
 CONFIG_MAC80211_RC_DEFAULT="pid"
 CONFIG_MAC80211_RC_PID=y
-# CONFIG_MAC80211_RC_SIMPLE is not set
+# CONFIG_MAC80211_MESH is not set
 CONFIG_MAC80211_LEDS=y
 # CONFIG_MAC80211_DEBUG_PACKET_ALIGNMENT is not set
 # CONFIG_MAC80211_DEBUG is not set
@@ -607,7 +614,6 @@ CONFIG_IEEE80211=m
 CONFIG_IEEE80211_CRYPT_WEP=m
 CONFIG_IEEE80211_CRYPT_CCMP=m
 CONFIG_IEEE80211_CRYPT_TKIP=m
-# CONFIG_IEEE80211_SOFTMAC is not set
 # CONFIG_RFKILL is not set
 # CONFIG_NET_9P is not set
 
@@ -629,6 +635,7 @@ CONFIG_CONNECTOR=y
 CONFIG_PROC_EVENTS=y
 # CONFIG_MTD is not set
 CONFIG_OF_DEVICE=y
+CONFIG_OF_I2C=y
 # CONFIG_PARPORT is not set
 CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_FD is not set
@@ -720,7 +727,7 @@ CONFIG_BLK_DEV_IDE_PMAC=y
 CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
 CONFIG_BLK_DEV_IDEDMA_PMAC=y
 CONFIG_BLK_DEV_IDEDMA=y
-CONFIG_IDE_ARCH_OBSOLETE_INIT=y
+# CONFIG_BLK_DEV_HD_ONLY is not set
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -906,7 +913,6 @@ CONFIG_SUNGEM=y
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
 CONFIG_NET_PCI=y
 CONFIG_PCNET32=y
-# CONFIG_PCNET32_NAPI is not set
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
@@ -940,7 +946,6 @@ CONFIG_NETDEV_1000=y
 # 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
@@ -959,6 +964,7 @@ CONFIG_NETDEV_10000=y
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
 # CONFIG_BNX2X is not set
+# CONFIG_SFC is not set
 # CONFIG_TR is not set
 
 #
@@ -992,6 +998,8 @@ CONFIG_P54_COMMON=m
 # CONFIG_P54_USB is not set
 # CONFIG_P54_PCI is not set
 # CONFIG_ATH5K is not set
+# CONFIG_IWLCORE is not set
+# CONFIG_IWLWIFI_LEDS is not set
 # CONFIG_IWL4965 is not set
 # CONFIG_IWL3945 is not set
 # CONFIG_HOSTAP is not set
@@ -1110,6 +1118,7 @@ CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_NOZOMI is not set
 
@@ -1156,13 +1165,7 @@ CONFIG_DEVPORT=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=m
-
-#
-# I2C Algorithms
-#
 CONFIG_I2C_ALGOBIT=y
-# CONFIG_I2C_ALGOPCF is not set
-# CONFIG_I2C_ALGOPCA is not set
 
 #
 # I2C Hardware Bus support
@@ -1192,6 +1195,7 @@ CONFIG_I2C_POWERMAC=y
 # CONFIG_I2C_VIA is not set
 # CONFIG_I2C_VIAPRO is not set
 # CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
 
 #
 # Miscellaneous I2C Chip support
@@ -1201,19 +1205,13 @@ CONFIG_I2C_POWERMAC=y
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_TPS65010 is not set
 # CONFIG_SENSORS_MAX6875 is not set
 # CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
 # CONFIG_I2C_DEBUG_CHIP is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
 # CONFIG_W1 is not set
 CONFIG_POWER_SUPPLY=y
 # CONFIG_POWER_SUPPLY_DEBUG is not set
@@ -1230,6 +1228,7 @@ CONFIG_BATTERY_PMU=y
 #
 CONFIG_SSB_POSSIBLE=y
 CONFIG_SSB=m
+CONFIG_SSB_SPROM=y
 CONFIG_SSB_PCIHOST_POSSIBLE=y
 CONFIG_SSB_PCIHOST=y
 CONFIG_SSB_B43_PCI_BRIDGE=y
@@ -1243,12 +1242,22 @@ CONFIG_SSB_DRIVER_PCICORE=y
 # Multifunction device drivers
 #
 # CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
 
 #
 # Multimedia devices
 #
+
+#
+# Multimedia core support
+#
 # CONFIG_VIDEO_DEV is not set
 # CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
 # CONFIG_DAB is not set
 
 #
@@ -1276,8 +1285,8 @@ CONFIG_FB_CFB_IMAGEBLIT=y
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 # CONFIG_FB_SYS_FOPS is not set
-CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 CONFIG_FB_MACMODES=y
 CONFIG_FB_BACKLIGHT=y
@@ -1413,6 +1422,7 @@ CONFIG_SND_DUMMY=m
 # CONFIG_SND_AU8810 is not set
 # CONFIG_SND_AU8820 is not set
 # CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AW2 is not set
 # CONFIG_SND_AZT3328 is not set
 # CONFIG_SND_BT87X is not set
 # CONFIG_SND_CA0106 is not set
@@ -1505,11 +1515,11 @@ CONFIG_SND_USB_AUDIO=m
 # CONFIG_SND_SOC is not set
 
 #
-# SoC Audio support for SuperH
+# ALSA SoC audio for Freescale SOCs
 #
 
 #
-# ALSA SoC audio for Freescale SOCs
+# SoC Audio for the Texas Instruments OMAP
 #
 
 #
@@ -1543,17 +1553,18 @@ CONFIG_USB_DEVICEFS=y
 CONFIG_USB_DEVICE_CLASS=y
 CONFIG_USB_DYNAMIC_MINORS=y
 # CONFIG_USB_SUSPEND is not set
-# CONFIG_USB_PERSIST is not set
 # CONFIG_USB_OTG is not set
 
 #
 # USB Host Controller Drivers
 #
+# CONFIG_USB_C67X00_HCD is not set
 CONFIG_USB_EHCI_HCD=m
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 # CONFIG_USB_EHCI_TT_NEWSCHED is not set
 # CONFIG_USB_EHCI_HCD_PPC_OF is not set
 # CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_OHCI_HCD_PPC_OF is not set
 # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
@@ -1587,7 +1598,9 @@ CONFIG_USB_STORAGE=m
 # 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=y
 # CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
 # CONFIG_USB_LIBUSUAL is not set
 
 #
@@ -1642,9 +1655,11 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
 # CONFIG_USB_SERIAL_MCT_U232 is not set
 # CONFIG_USB_SERIAL_MOS7720 is not set
 # CONFIG_USB_SERIAL_MOS7840 is not set
+# CONFIG_USB_SERIAL_MOTOROLA is not set
 # CONFIG_USB_SERIAL_NAVMAN is not set
 # CONFIG_USB_SERIAL_PL2303 is not set
 # CONFIG_USB_SERIAL_OTI6858 is not set
+# CONFIG_USB_SERIAL_SPCP8X5 is not set
 # CONFIG_USB_SERIAL_HP4X is not set
 # CONFIG_USB_SERIAL_SAFE is not set
 # CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
@@ -1695,14 +1710,12 @@ CONFIG_LEDS_TRIGGERS=y
 # CONFIG_LEDS_TRIGGER_TIMER is not set
 CONFIG_LEDS_TRIGGER_IDE_DISK=y
 # CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
+# CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
 # CONFIG_EDAC is not set
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
-
-#
-# Userspace I/O
-#
 # CONFIG_UIO is not set
 
 #
@@ -1786,13 +1799,11 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
-# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
-CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=m
@@ -1877,9 +1888,10 @@ CONFIG_NLS_UTF8=m
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 CONFIG_CRC_CCITT=y
 CONFIG_CRC16=y
-# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC_ITU_T=m
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
 CONFIG_LIBCRC32C=m
@@ -1901,6 +1913,7 @@ CONFIG_HAVE_LMB=y
 # CONFIG_PRINTK_TIME is not set
 CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 # CONFIG_DEBUG_FS is not set
@@ -1911,6 +1924,7 @@ CONFIG_DETECT_SOFTLOCKUP=y
 CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
 # CONFIG_SLUB_DEBUG_ON is not set
 # CONFIG_SLUB_STATS is not set
 # CONFIG_DEBUG_RT_MUTEXES is not set
@@ -1923,6 +1937,7 @@ CONFIG_SCHED_DEBUG=y
 CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
 # CONFIG_BOOT_PRINTK_DELAY is not set
@@ -1936,6 +1951,7 @@ CONFIG_DEBUGGER=y
 CONFIG_XMON=y
 CONFIG_XMON_DEFAULT=y
 CONFIG_XMON_DISASSEMBLY=y
+CONFIG_IRQSTACKS=y
 # CONFIG_BDI_SWITCH is not set
 CONFIG_BOOTX_TEXT=y
 # CONFIG_PPC_EARLY_DEBUG is not set
@@ -1947,54 +1963,84 @@ CONFIG_BOOTX_TEXT=y
 # CONFIG_SECURITY is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_BLKCIPHER=y
-# CONFIG_CRYPTO_SEQIV is not set
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_MANAGER=y
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_NULL=m
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_AUTHENC=y
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
 CONFIG_CRYPTO_HMAC=y
 # CONFIG_CRYPTO_XCBC is not set
-CONFIG_CRYPTO_NULL=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_SHA1=y
 CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_SHA512=m
-CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_TGR192=m
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=y
-CONFIG_CRYPTO_PCBC=m
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_XTS is not set
-# CONFIG_CRYPTO_CTR is not set
-# CONFIG_CRYPTO_GCM is not set
-# CONFIG_CRYPTO_CCM is not set
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_FCRYPT is not set
-CONFIG_CRYPTO_BLOWFISH=m
-CONFIG_CRYPTO_TWOFISH=m
-CONFIG_CRYPTO_TWOFISH_COMMON=m
-CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
 CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_BLOWFISH=m
+# CONFIG_CRYPTO_CAMELLIA is not set
 CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
-CONFIG_CRYPTO_TEA=m
-CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
 CONFIG_CRYPTO_KHAZAD=m
-CONFIG_CRYPTO_ANUBIS=m
-# CONFIG_CRYPTO_SEED is not set
 # CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
 CONFIG_CRYPTO_DEFLATE=m
-CONFIG_CRYPTO_MICHAEL_MIC=m
-CONFIG_CRYPTO_CRC32C=m
-# CONFIG_CRYPTO_CAMELLIA is not set
-# CONFIG_CRYPTO_TEST is not set
-CONFIG_CRYPTO_AUTHENC=y
 # CONFIG_CRYPTO_LZO is not set
 CONFIG_CRYPTO_HW=y
 # CONFIG_CRYPTO_DEV_HIFN_795X is not set
 # CONFIG_PPC_CLOCK is not set
+# CONFIG_VIRTUALIZATION is not set
index 970282b..40f84fa 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.25-rc6
-# Thu Mar 27 13:56:24 2008
+# Linux kernel version: 2.6.26-rc3
+# Tue May 20 20:03:02 2008
 #
 CONFIG_PPC64=y
 
@@ -30,6 +30,9 @@ CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_HAVE_SETUP_PER_CPU_AREA=y
 CONFIG_IRQ_PER_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_ARCH_HAS_ILOG2_U32=y
 CONFIG_ARCH_HAS_ILOG2_U64=y
@@ -82,6 +85,7 @@ CONFIG_LOG_BUF_SHIFT=17
 CONFIG_CGROUPS=y
 # CONFIG_CGROUP_DEBUG is not set
 # CONFIG_CGROUP_NS is not set
+# CONFIG_CGROUP_DEVICE is not set
 CONFIG_CPUSETS=y
 # CONFIG_GROUP_SCHED is not set
 # CONFIG_CGROUP_CPUACCT is not set
@@ -101,6 +105,7 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
 CONFIG_SYSCTL_SYSCALL=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -108,6 +113,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
+CONFIG_PCSPKR_PLATFORM=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
@@ -129,12 +135,14 @@ CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
+# CONFIG_HAVE_DMA_ATTRS is not set
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 CONFIG_MODVERSIONS=y
@@ -194,11 +202,11 @@ CONFIG_PPC_PASEMI=y
 CONFIG_PPC_PASEMI_IOMMU=y
 # CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set
 CONFIG_PPC_PASEMI_MDIO=y
-CONFIG_PPC_CELLEB=y
 # CONFIG_PPC_PS3 is not set
 CONFIG_PPC_CELL=y
 CONFIG_PPC_CELL_NATIVE=y
 CONFIG_PPC_IBM_CELL_BLADE=y
+CONFIG_PPC_CELLEB=y
 
 #
 # Cell Broadband Engine options
@@ -241,6 +249,7 @@ CONFIG_CPU_FREQ_TABLE=y
 CONFIG_CPU_FREQ_STAT=y
 # CONFIG_CPU_FREQ_STAT_DETAILS is not set
 CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
@@ -277,7 +286,6 @@ CONFIG_PREEMPT_NONE=y
 CONFIG_BINFMT_ELF=y
 CONFIG_COMPAT_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
-CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_HUGETLB_PAGE_SIZE_VARIABLE=y
 CONFIG_IOMMU_VMERGE=y
 CONFIG_IOMMU_HELPER=y
@@ -307,6 +315,7 @@ CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
 CONFIG_SPARSEMEM_VMEMMAP=y
 CONFIG_MEMORY_HOTPLUG=y
 CONFIG_MEMORY_HOTPLUG_SPARSE=y
+CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
 CONFIG_ZONE_DMA_FLAG=1
@@ -314,6 +323,7 @@ CONFIG_BOUNCE=y
 CONFIG_ARCH_MEMORY_PROBE=y
 CONFIG_PPC_HAS_HASH_64K=y
 # CONFIG_PPC_64K_PAGES is not set
+CONFIG_FORCE_MAX_ZONEORDER=13
 # CONFIG_SCHED_SMT is not set
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
@@ -356,7 +366,10 @@ CONFIG_HOTPLUG_PCI=m
 # CONFIG_HOTPLUG_PCI_SHPC is not set
 CONFIG_HOTPLUG_PCI_RPA=m
 CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
+# CONFIG_HAS_RAPIDIO is not set
+CONFIG_PAGE_OFFSET=0xc000000000000000
 CONFIG_KERNEL_START=0xc000000000000000
+CONFIG_PHYSICAL_START=0x00000000
 
 #
 # Networking
@@ -406,8 +419,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
@@ -423,6 +434,7 @@ CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CT_ACCT=y
 CONFIG_NF_CONNTRACK_MARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
+# CONFIG_NF_CT_PROTO_DCCP is not set
 CONFIG_NF_CT_PROTO_GRE=m
 CONFIG_NF_CT_PROTO_SCTP=m
 # CONFIG_NF_CT_PROTO_UDPLITE is not set
@@ -501,6 +513,7 @@ CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
 CONFIG_NF_NAT_SNMP_BASIC=m
 CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_PROTO_SCTP=m
 CONFIG_NF_NAT_FTP=m
 CONFIG_NF_NAT_IRC=m
 CONFIG_NF_NAT_TFTP=m
@@ -571,6 +584,7 @@ CONFIG_FW_LOADER=y
 # CONFIG_CONNECTOR is not set
 # CONFIG_MTD is not set
 CONFIG_OF_DEVICE=y
+CONFIG_OF_I2C=y
 # CONFIG_PARPORT is not set
 CONFIG_BLK_DEV=y
 CONFIG_BLK_DEV_FD=y
@@ -618,7 +632,6 @@ CONFIG_IDE_PROC_FS=y
 #
 # IDE chipset support/bugfixes
 #
-CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_PLATFORM is not set
 CONFIG_BLK_DEV_IDEDMA_SFF=y
 
@@ -661,7 +674,7 @@ CONFIG_BLK_DEV_IDE_PMAC=y
 CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
 CONFIG_BLK_DEV_IDEDMA_PMAC=y
 CONFIG_BLK_DEV_IDEDMA=y
-CONFIG_IDE_ARCH_OBSOLETE_INIT=y
+# CONFIG_BLK_DEV_HD_ONLY is not set
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -747,64 +760,10 @@ CONFIG_SCSI_DEBUG=m
 # CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
 CONFIG_ATA=y
 CONFIG_ATA_NONSTANDARD=y
+CONFIG_SATA_PMP=y
 # CONFIG_SATA_AHCI is not set
-CONFIG_SATA_SVW=y
-# CONFIG_ATA_PIIX is not set
-CONFIG_SATA_MV=y
-# CONFIG_SATA_NV is not set
-# CONFIG_PDC_ADMA is not set
-# CONFIG_SATA_QSTOR is not set
-# CONFIG_SATA_PROMISE is not set
-# CONFIG_SATA_SX4 is not set
-# CONFIG_SATA_SIL is not set
 CONFIG_SATA_SIL24=y
-# CONFIG_SATA_SIS is not set
-# CONFIG_SATA_ULI is not set
-# CONFIG_SATA_VIA is not set
-# CONFIG_SATA_VITESSE is not set
-# CONFIG_SATA_INIC162X 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_CMD640_PCI is not set
-# CONFIG_PATA_CMD64X is not set
-# CONFIG_PATA_CS5520 is not set
-# CONFIG_PATA_CS5530 is not set
-# CONFIG_PATA_CYPRESS is not set
-# CONFIG_PATA_EFAR is not set
-# CONFIG_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_IT8213 is not set
-# CONFIG_PATA_JMICRON is not set
-# CONFIG_PATA_TRIFLEX is not set
-# CONFIG_PATA_MARVELL is not set
-# CONFIG_PATA_MPIIX is not set
-# CONFIG_PATA_OLDPIIX is not set
-# CONFIG_PATA_NETCELL is not set
-# CONFIG_PATA_NINJA32 is not set
-# CONFIG_PATA_NS87410 is not set
-# CONFIG_PATA_NS87415 is not set
-# CONFIG_PATA_OPTI is not set
-# CONFIG_PATA_OPTIDMA is not set
-CONFIG_PATA_PCMCIA=y
-# 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=y
-CONFIG_PATA_PLATFORM=y
-# CONFIG_PATA_OF_PLATFORM is not set
-CONFIG_PATA_SCC=y
+# CONFIG_ATA_SFF is not set
 CONFIG_MD=y
 CONFIG_BLK_DEV_MD=y
 CONFIG_MD_LINEAR=y
@@ -866,6 +825,7 @@ CONFIG_WINDFARM=y
 CONFIG_WINDFARM_PM81=y
 CONFIG_WINDFARM_PM91=y
 CONFIG_WINDFARM_PM112=y
+CONFIG_WINDFARM_PM121=y
 # CONFIG_PMAC_RACKMETER is not set
 CONFIG_NETDEVICES=y
 # CONFIG_NETDEVICES_MULTIQUEUE is not set
@@ -911,7 +871,6 @@ CONFIG_IBM_NEW_EMAC_TAH=y
 CONFIG_IBM_NEW_EMAC_EMAC4=y
 CONFIG_NET_PCI=y
 CONFIG_PCNET32=y
-# CONFIG_PCNET32_NAPI is not set
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
@@ -947,7 +906,6 @@ CONFIG_E1000=y
 # 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=y
 # CONFIG_BNX2 is not set
@@ -969,6 +927,7 @@ CONFIG_PASEMI_MAC=y
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
 # CONFIG_BNX2X is not set
+# CONFIG_SFC is not set
 CONFIG_TR=y
 CONFIG_IBMOL=y
 # CONFIG_3C359 is not set
@@ -979,6 +938,7 @@ CONFIG_IBMOL=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 
 #
 # USB Network Adapters
@@ -1083,6 +1043,7 @@ CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_NOZOMI is not set
 
@@ -1121,8 +1082,6 @@ CONFIG_HVC_BEAT=y
 CONFIG_HVCS=m
 # CONFIG_IPMI_HANDLER is not set
 # CONFIG_HW_RANDOM is not set
-CONFIG_GEN_RTC=y
-# CONFIG_GEN_RTC_X is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
 
@@ -1141,13 +1100,7 @@ CONFIG_DEVPORT=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=y
-
-#
-# I2C Algorithms
-#
 CONFIG_I2C_ALGOBIT=y
-# CONFIG_I2C_ALGOPCF is not set
-# CONFIG_I2C_ALGOPCA is not set
 
 #
 # I2C Hardware Bus support
@@ -1177,6 +1130,7 @@ CONFIG_I2C_PASEMI=y
 # CONFIG_I2C_VIA is not set
 # CONFIG_I2C_VIAPRO is not set
 # CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
 
 #
 # Miscellaneous I2C Chip support
@@ -1186,19 +1140,13 @@ CONFIG_I2C_PASEMI=y
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_TPS65010 is not set
 # CONFIG_SENSORS_MAX6875 is not set
 # CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
 # CONFIG_I2C_DEBUG_CHIP is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
@@ -1215,12 +1163,22 @@ CONFIG_SSB_POSSIBLE=y
 # Multifunction device drivers
 #
 # CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
 
 #
 # Multimedia devices
 #
+
+#
+# Multimedia core support
+#
 # CONFIG_VIDEO_DEV is not set
 # CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
 # CONFIG_DAB is not set
 
 #
@@ -1240,8 +1198,8 @@ CONFIG_FB_CFB_IMAGEBLIT=y
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 # CONFIG_FB_SYS_FOPS is not set
-CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 CONFIG_FB_MACMODES=y
 CONFIG_FB_BACKLIGHT=y
@@ -1363,6 +1321,7 @@ CONFIG_SND_VERBOSE_PROCFS=y
 # CONFIG_SND_AU8810 is not set
 # CONFIG_SND_AU8820 is not set
 # CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AW2 is not set
 # CONFIG_SND_AZT3328 is not set
 # CONFIG_SND_BT87X is not set
 # CONFIG_SND_CA0106 is not set
@@ -1455,11 +1414,11 @@ CONFIG_SND_AOA_SOUNDBUS_I2S=m
 # CONFIG_SND_SOC is not set
 
 #
-# SoC Audio support for SuperH
+# ALSA SoC audio for Freescale SOCs
 #
 
 #
-# ALSA SoC audio for Freescale SOCs
+# SoC Audio for the Texas Instruments OMAP
 #
 
 #
@@ -1497,12 +1456,14 @@ CONFIG_USB_DEVICE_CLASS=y
 #
 # USB Host Controller Drivers
 #
+# CONFIG_USB_C67X00_HCD is not set
 CONFIG_USB_EHCI_HCD=y
 # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
 CONFIG_USB_EHCI_TT_NEWSCHED=y
 CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
 # CONFIG_USB_EHCI_HCD_PPC_OF is not set
 # CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_OHCI_HCD_PPC_OF is not set
 # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
@@ -1538,6 +1499,7 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_ALAUDA is not set
 # CONFIG_USB_STORAGE_ONETOUCH is not set
 # CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
 # CONFIG_USB_LIBUSUAL is not set
 
 #
@@ -1579,6 +1541,7 @@ CONFIG_USB_APPLEDISPLAY=m
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
 CONFIG_INFINIBAND=m
 # CONFIG_INFINIBAND_USER_MAD is not set
 # CONFIG_INFINIBAND_USER_ACCESS is not set
@@ -1607,10 +1570,6 @@ CONFIG_EDAC_PASEMI=y
 # CONFIG_EDAC_CELL is not set
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
-
-#
-# Conflicting RTC option has been selected, check GEN_RTC and RTC
-#
 CONFIG_RTC_HCTOSYS=y
 CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
 # CONFIG_RTC_DEBUG is not set
@@ -1659,10 +1618,6 @@ CONFIG_RTC_DRV_DS1307=y
 # on-CPU RTC drivers
 #
 # CONFIG_DMADEVICES is not set
-
-#
-# Userspace I/O
-#
 # CONFIG_UIO is not set
 
 #
@@ -1696,9 +1651,9 @@ CONFIG_JFS_SECURITY=y
 CONFIG_FS_POSIX_ACL=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
-CONFIG_XFS_SECURITY=y
 CONFIG_XFS_POSIX_ACL=y
 # CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
 # CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
 CONFIG_DNOTIFY=y
@@ -1764,13 +1719,11 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
-# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
-CONFIG_NFSD_TCP=y
 CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
@@ -1862,9 +1815,10 @@ CONFIG_NLS_UTF8=m
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 CONFIG_CRC_CCITT=m
 # CONFIG_CRC16 is not set
-# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC_ITU_T=m
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
 CONFIG_LIBCRC32C=m
@@ -1888,6 +1842,7 @@ CONFIG_HAVE_LMB=y
 # CONFIG_PRINTK_TIME is not set
 CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=2048
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_FS=y
@@ -1898,18 +1853,23 @@ CONFIG_DETECT_SOFTLOCKUP=y
 CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
 # CONFIG_SLUB_DEBUG_ON is not set
 # CONFIG_SLUB_STATS 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=y
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT 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_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
 # CONFIG_BOOT_PRINTK_DELAY is not set
@@ -1941,53 +1901,83 @@ CONFIG_ASYNC_CORE=y
 CONFIG_ASYNC_MEMCPY=y
 CONFIG_ASYNC_XOR=y
 CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_AEAD=m
 CONFIG_CRYPTO_BLKCIPHER=y
-CONFIG_CRYPTO_SEQIV=m
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_AUTHENC=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+CONFIG_CRYPTO_SEQIV=m
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_CTR=m
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
 CONFIG_CRYPTO_HMAC=y
 # CONFIG_CRYPTO_XCBC is not set
-CONFIG_CRYPTO_NULL=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_SHA1=m
 CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_SHA512=m
-CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_TGR192=m
-CONFIG_CRYPTO_GF128MUL=m
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=y
-CONFIG_CRYPTO_PCBC=m
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_XTS is not set
-CONFIG_CRYPTO_CTR=m
-CONFIG_CRYPTO_GCM=m
-CONFIG_CRYPTO_CCM=m
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_FCRYPT is not set
-CONFIG_CRYPTO_BLOWFISH=m
-CONFIG_CRYPTO_TWOFISH=m
-CONFIG_CRYPTO_TWOFISH_COMMON=m
-CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
 CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_BLOWFISH=m
+# CONFIG_CRYPTO_CAMELLIA is not set
 CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
-CONFIG_CRYPTO_TEA=m
-CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
 CONFIG_CRYPTO_KHAZAD=m
-CONFIG_CRYPTO_ANUBIS=m
-# CONFIG_CRYPTO_SEED is not set
 CONFIG_CRYPTO_SALSA20=m
+# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
 CONFIG_CRYPTO_DEFLATE=m
-CONFIG_CRYPTO_MICHAEL_MIC=m
-CONFIG_CRYPTO_CRC32C=m
-# CONFIG_CRYPTO_CAMELLIA is not set
-CONFIG_CRYPTO_TEST=m
-CONFIG_CRYPTO_AUTHENC=m
 CONFIG_CRYPTO_LZO=m
 # CONFIG_CRYPTO_HW is not set
 # CONFIG_PPC_CLOCK is not set
+# CONFIG_VIRTUALIZATION is not set
index 3e2593c..adaa05f 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.25-rc6
-# Thu Mar 27 13:56:28 2008
+# Linux kernel version: 2.6.26-rc3
+# Tue May 20 20:03:28 2008
 #
 CONFIG_PPC64=y
 
@@ -30,6 +30,9 @@ CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_HAVE_SETUP_PER_CPU_AREA=y
 CONFIG_IRQ_PER_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_ARCH_HAS_ILOG2_U32=y
 CONFIG_ARCH_HAS_ILOG2_U64=y
@@ -81,6 +84,7 @@ CONFIG_LOG_BUF_SHIFT=17
 CONFIG_CGROUPS=y
 # CONFIG_CGROUP_DEBUG is not set
 CONFIG_CGROUP_NS=y
+CONFIG_CGROUP_DEVICE=y
 CONFIG_CPUSETS=y
 # CONFIG_GROUP_SCHED is not set
 CONFIG_CGROUP_CPUACCT=y
@@ -100,6 +104,7 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
 CONFIG_SYSCTL_SYSCALL=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -107,6 +112,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
+CONFIG_PCSPKR_PLATFORM=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
@@ -129,12 +135,14 @@ CONFIG_KPROBES=y
 CONFIG_KRETPROBES=y
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
+# CONFIG_HAVE_DMA_ATTRS is not set
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 CONFIG_MODVERSIONS=y
@@ -178,11 +186,11 @@ CONFIG_LPARCFG=y
 # CONFIG_PPC_PMAC is not set
 # CONFIG_PPC_MAPLE is not set
 # CONFIG_PPC_PASEMI is not set
-# CONFIG_PPC_CELLEB is not set
 # CONFIG_PPC_PS3 is not set
 # CONFIG_PPC_CELL is not set
 # CONFIG_PPC_CELL_NATIVE is not set
 # CONFIG_PPC_IBM_CELL_BLADE is not set
+# CONFIG_PPC_CELLEB is not set
 # CONFIG_PQ2ADS is not set
 CONFIG_PPC_NATIVE=y
 # CONFIG_UDBG_RTAS_CONSOLE is not set
@@ -225,7 +233,6 @@ CONFIG_PREEMPT_NONE=y
 CONFIG_BINFMT_ELF=y
 CONFIG_COMPAT_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
-CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_HUGETLB_PAGE_SIZE_VARIABLE=y
 CONFIG_IOMMU_VMERGE=y
 CONFIG_IOMMU_HELPER=y
@@ -255,6 +262,7 @@ CONFIG_SPARSEMEM_EXTREME=y
 CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
 CONFIG_SPARSEMEM_VMEMMAP=y
 # CONFIG_MEMORY_HOTPLUG is not set
+CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
 CONFIG_RESOURCES_64BIT=y
@@ -263,6 +271,7 @@ CONFIG_BOUNCE=y
 CONFIG_NODES_SPAN_OTHER_NODES=y
 # CONFIG_PPC_HAS_HASH_64K is not set
 # CONFIG_PPC_64K_PAGES is not set
+CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_SCHED_SMT=y
 CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
@@ -291,7 +300,10 @@ CONFIG_HOTPLUG_PCI=m
 # CONFIG_HOTPLUG_PCI_SHPC is not set
 CONFIG_HOTPLUG_PCI_RPA=m
 CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
+# CONFIG_HAS_RAPIDIO is not set
+CONFIG_PAGE_OFFSET=0xc000000000000000
 CONFIG_KERNEL_START=0xc000000000000000
+CONFIG_PHYSICAL_START=0x00000000
 
 #
 # Networking
@@ -338,8 +350,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
@@ -355,6 +365,7 @@ CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CT_ACCT=y
 CONFIG_NF_CONNTRACK_MARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
+# CONFIG_NF_CT_PROTO_DCCP is not set
 # CONFIG_NF_CT_PROTO_SCTP is not set
 CONFIG_NF_CT_PROTO_UDPLITE=m
 # CONFIG_NF_CONNTRACK_AMANDA is not set
@@ -426,6 +437,7 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m
 CONFIG_IP_NF_TARGET_REDIRECT=m
 CONFIG_IP_NF_TARGET_NETMAP=m
 CONFIG_NF_NAT_SNMP_BASIC=m
+CONFIG_NF_NAT_PROTO_UDPLITE=m
 CONFIG_NF_NAT_FTP=m
 CONFIG_NF_NAT_IRC=m
 CONFIG_NF_NAT_TFTP=m
@@ -492,6 +504,7 @@ CONFIG_FW_LOADER=y
 # CONFIG_CONNECTOR is not set
 # CONFIG_MTD is not set
 CONFIG_OF_DEVICE=y
+CONFIG_OF_I2C=y
 CONFIG_PARPORT=m
 CONFIG_PARPORT_PC=m
 # CONFIG_PARPORT_SERIAL is not set
@@ -545,7 +558,6 @@ CONFIG_IDE_PROC_FS=y
 #
 # IDE chipset support/bugfixes
 #
-CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_PLATFORM is not set
 CONFIG_BLK_DEV_IDEDMA_SFF=y
 
@@ -584,7 +596,7 @@ CONFIG_BLK_DEV_AMD74XX=y
 # CONFIG_BLK_DEV_VIA82CXXX is not set
 # CONFIG_BLK_DEV_TC86C001 is not set
 CONFIG_BLK_DEV_IDEDMA=y
-CONFIG_IDE_ARCH_OBSOLETE_INIT=y
+# CONFIG_BLK_DEV_HD_ONLY is not set
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -671,61 +683,10 @@ CONFIG_SCSI_LPFC=m
 # CONFIG_SCSI_SRP is not set
 CONFIG_ATA=y
 # CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=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_SATA_INIC162X 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_CMD640_PCI is not set
-# CONFIG_PATA_CMD64X is not set
-# CONFIG_PATA_CS5520 is not set
-# CONFIG_PATA_CS5530 is not set
-# CONFIG_PATA_CYPRESS is not set
-# CONFIG_PATA_EFAR is not set
-# CONFIG_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_IT8213 is not set
-# CONFIG_PATA_JMICRON is not set
-# CONFIG_PATA_TRIFLEX is not set
-# CONFIG_PATA_MARVELL is not set
-# CONFIG_PATA_MPIIX is not set
-# CONFIG_PATA_OLDPIIX is not set
-# CONFIG_PATA_NETCELL is not set
-# CONFIG_PATA_NINJA32 is not set
-# CONFIG_PATA_NS87410 is not set
-# CONFIG_PATA_NS87415 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=y
-# CONFIG_PATA_PLATFORM is not set
+# CONFIG_ATA_SFF is not set
 CONFIG_MD=y
 CONFIG_BLK_DEV_MD=y
 CONFIG_MD_LINEAR=y
@@ -783,7 +744,6 @@ CONFIG_IBMVETH=y
 # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
 CONFIG_NET_PCI=y
 CONFIG_PCNET32=y
-# CONFIG_PCNET32_NAPI is not set
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
@@ -820,7 +780,6 @@ CONFIG_E1000=y
 # 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=y
 # CONFIG_BNX2 is not set
@@ -829,7 +788,6 @@ CONFIG_TIGON3=y
 CONFIG_NETDEV_10000=y
 # CONFIG_CHELSIO_T1 is not set
 # CONFIG_CHELSIO_T3 is not set
-CONFIG_EHEA=m
 # CONFIG_IXGBE is not set
 CONFIG_IXGB=m
 # CONFIG_IXGB_NAPI is not set
@@ -838,10 +796,10 @@ CONFIG_S2IO=m
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
 # CONFIG_NIU is not set
-# CONFIG_PASEMI_MAC is not set
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
 # CONFIG_BNX2X is not set
+# CONFIG_SFC is not set
 CONFIG_TR=y
 CONFIG_IBMOL=y
 # CONFIG_3C359 is not set
@@ -852,6 +810,7 @@ CONFIG_IBMOL=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
 
 #
 # USB Network Adapters
@@ -956,6 +915,7 @@ CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 # CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_NOZOMI is not set
 
@@ -1000,13 +960,7 @@ CONFIG_DEVPORT=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
 # CONFIG_I2C_CHARDEV is not set
-
-#
-# I2C Algorithms
-#
 CONFIG_I2C_ALGOBIT=y
-# CONFIG_I2C_ALGOPCF is not set
-# CONFIG_I2C_ALGOPCA is not set
 
 #
 # I2C Hardware Bus support
@@ -1035,6 +989,7 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_VIA is not set
 # CONFIG_I2C_VIAPRO is not set
 # CONFIG_I2C_VOODOO3 is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
 
 #
 # Miscellaneous I2C Chip support
@@ -1044,19 +999,13 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_TPS65010 is not set
 # CONFIG_SENSORS_MAX6875 is not set
 # CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
 # CONFIG_I2C_DEBUG_CHIP is not set
-
-#
-# SPI support
-#
 # CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
@@ -1073,12 +1022,22 @@ CONFIG_SSB_POSSIBLE=y
 # Multifunction device drivers
 #
 # CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
 
 #
 # Multimedia devices
 #
+
+#
+# Multimedia core support
+#
 # CONFIG_VIDEO_DEV is not set
 # CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
 # CONFIG_DAB is not set
 
 #
@@ -1098,8 +1057,8 @@ CONFIG_FB_CFB_IMAGEBLIT=y
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 # CONFIG_FB_SYS_FOPS is not set
-CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 CONFIG_FB_MACMODES=y
 CONFIG_FB_BACKLIGHT=y
@@ -1209,11 +1168,13 @@ CONFIG_USB_DEVICE_CLASS=y
 #
 # USB Host Controller Drivers
 #
+# CONFIG_USB_C67X00_HCD is not set
 CONFIG_USB_EHCI_HCD=y
 # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
 # CONFIG_USB_EHCI_TT_NEWSCHED is not set
 # CONFIG_USB_EHCI_HCD_PPC_OF is not set
 # CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_OHCI_HCD_PPC_OF is not set
 # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
@@ -1247,7 +1208,9 @@ CONFIG_USB_STORAGE=y
 # 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=y
 # CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
 # CONFIG_USB_LIBUSUAL is not set
 
 #
@@ -1290,6 +1253,7 @@ CONFIG_USB_MON=y
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
 CONFIG_INFINIBAND=m
 CONFIG_INFINIBAND_USER_MAD=m
 CONFIG_INFINIBAND_USER_ACCESS=m
@@ -1312,10 +1276,6 @@ CONFIG_INFINIBAND_SRP=m
 # CONFIG_RTC_CLASS is not set
 # CONFIG_DMADEVICES is not set
 # CONFIG_AUXDISPLAY is not set
-
-#
-# Userspace I/O
-#
 # CONFIG_UIO is not set
 
 #
@@ -1349,11 +1309,12 @@ CONFIG_JFS_SECURITY=y
 CONFIG_FS_POSIX_ACL=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_QUOTA is not set
-CONFIG_XFS_SECURITY=y
 CONFIG_XFS_POSIX_ACL=y
 # CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
 # CONFIG_GFS2_FS is not set
 CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_FS_O2CB=m
 CONFIG_OCFS2_DEBUG_MASKLOG=y
 # CONFIG_OCFS2_DEBUG_FS is not set
 CONFIG_DNOTIFY=y
@@ -1419,13 +1380,11 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
-# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=y
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NFSD_V4=y
-CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
@@ -1500,9 +1459,10 @@ CONFIG_NLS_ISO8859_1=y
 # Library routines
 #
 CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
 CONFIG_CRC_CCITT=m
 # CONFIG_CRC16 is not set
-# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC_ITU_T=m
 CONFIG_CRC32=y
 # CONFIG_CRC7 is not set
 CONFIG_LIBCRC32C=m
@@ -1526,6 +1486,7 @@ CONFIG_HAVE_LMB=y
 # CONFIG_PRINTK_TIME is not set
 CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=2048
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_FS=y
@@ -1536,18 +1497,23 @@ CONFIG_DETECT_SOFTLOCKUP=y
 CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
 # CONFIG_SLUB_DEBUG_ON is not set
 # CONFIG_SLUB_STATS 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_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT 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_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
 # CONFIG_BOOT_PRINTK_DELAY is not set
@@ -1577,53 +1543,83 @@ CONFIG_VIRQ_DEBUG=y
 # CONFIG_SECURITY is not set
 # CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_AEAD=m
 CONFIG_CRYPTO_BLKCIPHER=y
-CONFIG_CRYPTO_SEQIV=m
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_AUTHENC=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+CONFIG_CRYPTO_SEQIV=m
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_CTR=m
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
 CONFIG_CRYPTO_HMAC=y
 # CONFIG_CRYPTO_XCBC is not set
-CONFIG_CRYPTO_NULL=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_SHA1=m
 CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_SHA512=m
-CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_TGR192=m
-CONFIG_CRYPTO_GF128MUL=m
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_CBC=y
-CONFIG_CRYPTO_PCBC=m
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_XTS is not set
-CONFIG_CRYPTO_CTR=m
-CONFIG_CRYPTO_GCM=m
-CONFIG_CRYPTO_CCM=m
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_FCRYPT is not set
-CONFIG_CRYPTO_BLOWFISH=m
-CONFIG_CRYPTO_TWOFISH=m
-CONFIG_CRYPTO_TWOFISH_COMMON=m
-CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
 CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_BLOWFISH=m
+# CONFIG_CRYPTO_CAMELLIA is not set
 CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
-CONFIG_CRYPTO_TEA=m
-CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
 CONFIG_CRYPTO_KHAZAD=m
-CONFIG_CRYPTO_ANUBIS=m
-# CONFIG_CRYPTO_SEED is not set
 CONFIG_CRYPTO_SALSA20=m
+# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
 CONFIG_CRYPTO_DEFLATE=m
-CONFIG_CRYPTO_MICHAEL_MIC=m
-CONFIG_CRYPTO_CRC32C=m
-# CONFIG_CRYPTO_CAMELLIA is not set
-CONFIG_CRYPTO_TEST=m
-CONFIG_CRYPTO_AUTHENC=m
 CONFIG_CRYPTO_LZO=m
 # CONFIG_CRYPTO_HW is not set
 # CONFIG_PPC_CLOCK is not set
+# CONFIG_VIRTUALIZATION is not set
index 8e24fc1..31729a9 100644 (file)
@@ -20,7 +20,7 @@ WHITELIST="add_reloc_offset __bss_start __bss_stop copy_and_flush
 _end enter_prom memcpy memset reloc_offset __secondary_hold
 __secondary_hold_acknowledge __secondary_hold_spinloop __start
 strcmp strcpy strlcpy strlen strncmp strstr logo_linux_clut224
-reloc_got2"
+reloc_got2 kernstart_addr"
 
 NM="$1"
 OBJ="$2"
index ddeaf9e..b9ba7d9 100644 (file)
@@ -1,6 +1,4 @@
 /*
- *  $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $
- *
  *  PowerPC version
  *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
  *  Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
index 80d1bab..e0ff59f 100644 (file)
@@ -402,7 +402,7 @@ void __set_fixmap (enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags)
                return;
        }
 
-       map_page(address, phys, flags);
+       map_page(address, phys, pgprot_val(flags));
        fixmaps++;
 }
 
index 5b3fb2b..3a58ffa 100644 (file)
@@ -317,6 +317,9 @@ static int __init ps3_mm_add_memory(void)
                return result;
        }
 
+       lmb_add(start_addr, map.r1.size);
+       lmb_analyze();
+
        result = online_pages(start_pfn, nr_pages);
 
        if (result)
index 8619f2a..7680001 100644 (file)
@@ -1331,6 +1331,9 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
        unsigned long flags;
        u32 reg;
 
+       if (!mpic)
+               return;
+
        spin_lock_irqsave(&mpic_lock, flags);
        if (is_ipi) {
                reg = mpic_ipi_read(src - mpic->ipi_vecs[0]) &
@@ -1346,23 +1349,6 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
        spin_unlock_irqrestore(&mpic_lock, flags);
 }
 
-unsigned int mpic_irq_get_priority(unsigned int irq)
-{
-       unsigned int is_ipi;
-       struct mpic *mpic = mpic_find(irq, &is_ipi);
-       unsigned int src = mpic_irq_to_hw(irq);
-       unsigned long flags;
-       u32 reg;
-
-       spin_lock_irqsave(&mpic_lock, flags);
-       if (is_ipi)
-               reg = mpic_ipi_read(src = mpic->ipi_vecs[0]);
-       else
-               reg = mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI));
-       spin_unlock_irqrestore(&mpic_lock, flags);
-       return (reg & MPIC_VECPRI_PRIORITY_MASK) >> MPIC_VECPRI_PRIORITY_SHIFT;
-}
-
 void mpic_setup_this_cpu(void)
 {
 #ifdef CONFIG_SMP
index ab77b0e..938817e 100644 (file)
@@ -154,4 +154,4 @@ module_exit(heartbeat_exit);
 
 MODULE_VERSION(DRV_VERSION);
 MODULE_AUTHOR("Paul Mundt");
-MODULE_LICENSE("GPLv2");
+MODULE_LICENSE("GPL v2");
index dba8e05..6976812 100644 (file)
@@ -259,6 +259,8 @@ if BROKEN
        source "drivers/mtd/Kconfig"
 endif
 
+source "drivers/leds/Kconfig"
+
 #This is just to shut up some Kconfig warnings, so no prompt.
 config INPUT
        bool
index e980935..5f90358 100644 (file)
@@ -50,7 +50,7 @@ static int pcap_open(void *data)
                        return -EIO;
                }
 
-               pri->compiled = kmalloc(sizeof(struct bpf_program),
+               pri->compiled = uml_kmalloc(sizeof(struct bpf_program),
                                        UM_GFP_KERNEL);
                if (pri->compiled == NULL) {
                        printk(UM_KERN_ERR "pcap_open : kmalloc failed\n");
index 66e2a30..ccc02a6 100644 (file)
@@ -60,6 +60,11 @@ EXPORT_SYMBOL(os_rcv_fd);
 EXPORT_SYMBOL(run_helper);
 EXPORT_SYMBOL(start_thread);
 
+EXPORT_SYMBOL(add_sigio_fd);
+EXPORT_SYMBOL(ignore_sigio_fd);
+EXPORT_SYMBOL(deactivate_fd);
+EXPORT_SYMBOL(sigio_broken);
+
 #ifdef CONFIG_SMP
 
 /* required for SMP */
index c6183e7..b487cbe 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <errno.h>
+#include <sys/ptrace.h>
 #include <asm/user.h>
 #include "kern_constants.h"
 #include "longjmp.h"
index 4d7d1a8..6604673 100644 (file)
@@ -1,5 +1,7 @@
-#include "linux/module.h"
-#include "asm/string.h"
+#include <linux/module.h>
+#include <asm/string.h>
+#include <asm/checksum.h>
 
 /*XXX: we need them because they would be exported by x86_64 */
 EXPORT_SYMBOL(__memcpy);
+EXPORT_SYMBOL(csum_partial);
index fe361ae..dcbec34 100644 (file)
@@ -26,17 +26,10 @@ config X86
        select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
        select HAVE_ARCH_KGDB if !X86_VOYAGER
 
-config DEFCONFIG_LIST
+config ARCH_DEFCONFIG
        string
-       depends on X86_32
-       option defconfig_list
-       default "arch/x86/configs/i386_defconfig"
-
-config DEFCONFIG_LIST
-       string
-       depends on X86_64
-       option defconfig_list
-       default "arch/x86/configs/x86_64_defconfig"
+       default "arch/x86/configs/i386_defconfig" if X86_32
+       default "arch/x86/configs/x86_64_defconfig" if X86_64
 
 
 config GENERIC_LOCKBREAK
index c1d00c0..50e47cd 100644 (file)
@@ -56,7 +56,7 @@ static char *number(char *str, long num, int base, int size, int precision,
        if (type & LEFT)
                type &= ~ZEROPAD;
        if (base < 2 || base > 36)
-               return 0;
+               return NULL;
        c = (type & ZEROPAD) ? '0' : ' ';
        sign = 0;
        if (type & SIGN) {
index 5910020..0633cfd 100644 (file)
@@ -534,7 +534,7 @@ int setup_profiling_timer(unsigned int multiplier)
  */
 void clear_local_APIC(void)
 {
-       int maxlvt = lapic_get_maxlvt();
+       int maxlvt;
        u32 v;
 
        /* APIC hasn't been mapped yet */
index af4a867..777a7ff 100644 (file)
@@ -245,7 +245,7 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq,
        if ((ecx > 95) || (ecx == 0) || (eax < ebx))
                return -EIO;
 
-       edx = (eax - ebx) / (100 - ecx);
+       edx = ((eax - ebx) * 100) / (100 - ecx);
        *low_freq = edx * 1000; /* back to kHz */
 
        dprintk("low frequency is %u kHz\n", *low_freq);
index 46d4034..206791e 100644 (file)
@@ -1127,12 +1127,23 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
                 * an UP version, and is deprecated by AMD.
                 */
                if (num_online_cpus() != 1) {
-                       printk(KERN_ERR PFX "MP systems not supported by PSB BIOS structure\n");
+#ifndef CONFIG_ACPI_PROCESSOR
+                       printk(KERN_ERR PFX "ACPI Processor support is required "
+                              "for SMP systems but is absent. Please load the "
+                              "ACPI Processor module before starting this "
+                              "driver.\n");
+#else
+                       printk(KERN_ERR PFX "Your BIOS does not provide ACPI "
+                              "_PSS objects in a way that Linux understands. "
+                              "Please report this to the Linux ACPI maintainers"
+                              " and complain to your BIOS vendor.\n");
+#endif
                        kfree(data);
                        return -ENODEV;
                }
                if (pol->cpu != 0) {
-                       printk(KERN_ERR PFX "No _PSS objects for CPU other than CPU0\n");
+                       printk(KERN_ERR PFX "No ACPI _PSS objects for CPU other than "
+                              "CPU0. Complain to your BIOS vendor.\n");
                        kfree(data);
                        return -ENODEV;
                }
index 4bc1be5..08a3098 100644 (file)
@@ -53,7 +53,7 @@ static cycle_t kvm_clock_read(void);
  * have elapsed since the hypervisor wrote the data. So we try to account for
  * that with system time
  */
-unsigned long kvm_get_wallclock(void)
+static unsigned long kvm_get_wallclock(void)
 {
        u32 wc_sec, wc_nsec;
        u64 delta;
@@ -86,7 +86,7 @@ unsigned long kvm_get_wallclock(void)
        return ts.tv_sec + 1;
 }
 
-int kvm_set_wallclock(unsigned long now)
+static int kvm_set_wallclock(unsigned long now)
 {
        return 0;
 }
index e479072..068759d 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "mach_timer.h"
 
-static int tsc_enabled;
+static int tsc_disabled;
 
 /*
  * On some systems the TSC frequency does not
@@ -28,8 +28,8 @@ EXPORT_SYMBOL_GPL(tsc_khz);
 static int __init tsc_setup(char *str)
 {
        printk(KERN_WARNING "notsc: Kernel compiled with CONFIG_X86_TSC, "
-                               "cannot disable TSC completely.\n");
-       mark_tsc_unstable("user disabled TSC");
+              "cannot disable TSC completely.\n");
+       tsc_disabled = 1;
        return 1;
 }
 #else
@@ -120,7 +120,7 @@ unsigned long long native_sched_clock(void)
         *   very important for it to be as fast as the platform
         *   can achive it. )
         */
-       if (unlikely(!tsc_enabled && !tsc_unstable))
+       if (unlikely(tsc_disabled))
                /* No locking but a rare wrong value is not a big deal: */
                return (jiffies_64 - INITIAL_JIFFIES) * (1000000000 / HZ);
 
@@ -322,7 +322,6 @@ void mark_tsc_unstable(char *reason)
 {
        if (!tsc_unstable) {
                tsc_unstable = 1;
-               tsc_enabled = 0;
                printk("Marking TSC unstable due to: %s.\n", reason);
                /* Can be called before registration */
                if (clocksource_tsc.mult)
@@ -336,7 +335,7 @@ EXPORT_SYMBOL_GPL(mark_tsc_unstable);
 static int __init dmi_mark_tsc_unstable(const struct dmi_system_id *d)
 {
        printk(KERN_NOTICE "%s detected: marking TSC unstable.\n",
-                      d->ident);
+              d->ident);
        tsc_unstable = 1;
        return 0;
 }
@@ -403,14 +402,22 @@ void __init tsc_init(void)
 {
        int cpu;
 
-       if (!cpu_has_tsc)
+       if (!cpu_has_tsc || tsc_disabled) {
+               /* Disable the TSC in case of !cpu_has_tsc */
+               tsc_disabled = 1;
                return;
+       }
 
        cpu_khz = calculate_cpu_khz();
        tsc_khz = cpu_khz;
 
        if (!cpu_khz) {
                mark_tsc_unstable("could not calculate TSC khz");
+               /*
+                * We need to disable the TSC completely in this case
+                * to prevent sched_clock() from using it.
+                */
+               tsc_disabled = 1;
                return;
        }
 
@@ -441,8 +448,6 @@ void __init tsc_init(void)
        if (check_tsc_unstable()) {
                clocksource_tsc.rating = 0;
                clocksource_tsc.flags &= ~CLOCK_SOURCE_IS_CONTINUOUS;
-       } else
-               tsc_enabled = 1;
-
+       }
        clocksource_register(&clocksource_tsc);
 }
index fcc16e5..1784b80 100644 (file)
@@ -227,14 +227,14 @@ void __init tsc_calibrate(void)
        /* hpet or pmtimer available ? */
        if (!hpet && !pm1 && !pm2) {
                printk(KERN_INFO "TSC calibrated against PIT\n");
-               return;
+               goto out;
        }
 
        /* Check, whether the sampling was disturbed by an SMI */
        if (tsc1 == ULONG_MAX || tsc2 == ULONG_MAX) {
                printk(KERN_WARNING "TSC calibration disturbed by SMI, "
                       "using PIT calibration result\n");
-               return;
+               goto out;
        }
 
        tsc2 = (tsc2 - tsc1) * 1000000L;
@@ -255,6 +255,7 @@ void __init tsc_calibrate(void)
 
        tsc_khz = tsc2 / tsc1;
 
+out:
        for_each_possible_cpu(cpu)
                set_cyc2ns_scale(tsc_khz, cpu);
 }
index 36c5406..7246b60 100644 (file)
@@ -1996,7 +1996,7 @@ static struct shrinker mmu_shrinker = {
        .seeks = DEFAULT_SEEKS * 10,
 };
 
-void mmu_destroy_caches(void)
+static void mmu_destroy_caches(void)
 {
        if (pte_chain_cache)
                kmem_cache_destroy(pte_chain_cache);
index 8545c8a..6e64aaf 100644 (file)
@@ -302,18 +302,18 @@ static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
        },
        {
                .callback = set_bf_sort,
-               .ident = "HP ProLiant DL385 G2",
+               .ident = "HP ProLiant DL360",
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL385 G2"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL360"),
                },
        },
        {
                .callback = set_bf_sort,
-               .ident = "HP ProLiant DL585 G2",
+               .ident = "HP ProLiant DL380",
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL585 G2"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL380"),
                },
        },
 #ifdef __i386__
index 23476c2..efa2ba7 100644 (file)
@@ -106,9 +106,9 @@ int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz)
                do_realtime((struct timespec *)tv);
                tv->tv_usec /= 1000;
                if (unlikely(tz != NULL)) {
-                       /* This relies on gcc inlining the memcpy. We'll notice
-                          if it ever fails to do so. */
-                       memcpy(tz, &gtod->sys_tz, sizeof(struct timezone));
+                       /* Avoid memcpy. Some old compilers fail to inline it */
+                       tz->tz_minuteswest = gtod->sys_tz.tz_minuteswest;
+                       tz->tz_dsttime = gtod->sys_tz.tz_dsttime;
                }
                return 0;
        }
index 126766d..3525ef5 100644 (file)
@@ -60,7 +60,7 @@ xmaddr_t arbitrary_virt_to_machine(unsigned long address)
 {
        unsigned int level;
        pte_t *pte = lookup_address(address, &level);
-       unsigned offset = address & PAGE_MASK;
+       unsigned offset = address & ~PAGE_MASK;
 
        BUG_ON(pte == NULL);
 
index e48a3ea..2509809 100644 (file)
@@ -565,7 +565,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 
                                acpi_os_release_mutex(method_desc->method.
                                                      mutex->mutex.os_mutex);
-                               method_desc->method.mutex->mutex.thread_id = 0;
+                               method_desc->method.mutex->mutex.thread_id = NULL;
                        }
                }
 
index c873ab4..a8bf3d7 100644 (file)
@@ -326,7 +326,7 @@ acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc)
 
        /* Clear mutex info */
 
-       obj_desc->mutex.thread_id = 0;
+       obj_desc->mutex.thread_id = NULL;
        return_ACPI_STATUS(status);
 }
 
@@ -463,7 +463,7 @@ void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread)
                /* Mark mutex unowned */
 
                obj_desc->mutex.owner_thread = NULL;
-               obj_desc->mutex.thread_id = 0;
+               obj_desc->mutex.thread_id = NULL;
 
                /* Update Thread sync_level (Last mutex is the important one) */
 
index 183841c..8dd4aa7 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: fore200e.h,v 1.4 2000/04/14 10:10:34 davem Exp $ */
 #ifndef _FORE200E_H
 #define _FORE200E_H
 
index 2ebe1a1..520e14b 100644 (file)
@@ -1,6 +1,4 @@
 /*
-  $Id: fore200e_mkfirm.c,v 1.1 2000/02/21 16:04:32 davem Exp $
-
   mkfirm.c: generates a C readable file from a binary firmware image
 
   Christophe Lizzi (lizzi@{csti.fr, cnam.fr}), June 1999.
index 1dc2775..fe6cd15 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: he.h,v 1.4 2003/05/06 22:48:00 chas Exp $ */
-
 /*
 
   he.h
index 28d77b5..3a504e9 100644 (file)
@@ -1,8 +1,4 @@
 /******************************************************************* 
- * ident "$Id: idt77252.c,v 1.2 2001/11/11 08:13:54 ecd Exp $"
- *
- * $Author: ecd $
- * $Date: 2001/11/11 08:13:54 $
  *
  * Copyright (c) 2000 ATecoM GmbH 
  *
@@ -29,9 +25,6 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  *******************************************************************/
-static char const rcsid[] =
-"$Id: idt77252.c,v 1.2 2001/11/11 08:13:54 ecd Exp $";
-
 
 #include <linux/module.h>
 #include <linux/pci.h>
index 6f2b4a5..e83eaf1 100644 (file)
@@ -1,8 +1,4 @@
 /******************************************************************* 
- * ident "$Id: idt77252.h,v 1.2 2001/11/11 08:13:54 ecd Exp $"
- *
- * $Author: ecd $
- * $Date: 2001/11/11 08:13:54 $
  *
  * Copyright (c) 2000 ATecoM GmbH 
  *
index 133eefc..b2cd20f 100644 (file)
@@ -1025,7 +1025,8 @@ typedef struct iadev_t {
         spinlock_t rx_lock, misc_lock;
        struct atm_vcc **rx_open;       /* list of all open VCs */  
         u16 num_rx_desc, rx_buf_sz, rxing;
-        u32 rx_pkt_ram, rx_tmp_cnt, rx_tmp_jif;
+        u32 rx_pkt_ram, rx_tmp_cnt;
+        unsigned long rx_tmp_jif;
         void __iomem *RX_DESC_BASE_ADDR;
         u32 drop_rxpkt, drop_rxcell, rx_cell_cnt, rx_pkt_cnt;
        struct atm_dev *next_board;     /* other iphase devices */  
index 2e15b39..180531a 100644 (file)
@@ -13,7 +13,7 @@
  *
  *   Modified to work with the IDT7721 nicstar -- AAL5 (tested) only.
  *
- * R. D. Rechenmacher <ron@fnal.gov>, Aug. 6, 1997 $Revision: 1.1 $ $Date: 1999/08/20 11:00:11 $
+ * R. D. Rechenmacher <ron@fnal.gov>, Aug. 6, 1997
  *
  * Linux driver for the IDT77201 NICStAR PCI ATM controller.
  * PHY component is expected to be 155 Mbps S/UNI-Lite or IDT 77155;
index be288b5..72eccae 100644 (file)
@@ -1084,11 +1084,13 @@ static void device_create_release(struct device *dev)
 }
 
 /**
- * device_create - creates a device and registers it with sysfs
+ * device_create_vargs - creates a device and registers it with sysfs
  * @class: pointer to the struct class that this device should be registered to
  * @parent: pointer to the parent struct device of this new device, if any
  * @devt: the dev_t for the char device to be added
+ * @drvdata: the data to be added to the device for callbacks
  * @fmt: string for the device's name
+ * @args: va_list for the device's name
  *
  * This function can be used by char device classes.  A struct device
  * will be created in sysfs, registered to the specified class.
@@ -1104,10 +1106,10 @@ static void device_create_release(struct device *dev)
  * Note: the struct class passed to this function must have previously
  * been created with a call to class_create().
  */
-struct device *device_create(struct class *class, struct device *parent,
-                            dev_t devt, const char *fmt, ...)
+struct device *device_create_vargs(struct class *class, struct device *parent,
+                                  dev_t devt, void *drvdata, const char *fmt,
+                                  va_list args)
 {
-       va_list args;
        struct device *dev = NULL;
        int retval = -ENODEV;
 
@@ -1124,10 +1126,9 @@ struct device *device_create(struct class *class, struct device *parent,
        dev->class = class;
        dev->parent = parent;
        dev->release = device_create_release;
+       dev_set_drvdata(dev, drvdata);
 
-       va_start(args, fmt);
        vsnprintf(dev->bus_id, BUS_ID_SIZE, fmt, args);
-       va_end(args);
        retval = device_register(dev);
        if (retval)
                goto error;
@@ -1138,6 +1139,78 @@ error:
        kfree(dev);
        return ERR_PTR(retval);
 }
+EXPORT_SYMBOL_GPL(device_create_vargs);
+
+/**
+ * device_create_drvdata - creates a device and registers it with sysfs
+ * @class: pointer to the struct class that this device should be registered to
+ * @parent: pointer to the parent struct device of this new device, if any
+ * @devt: the dev_t for the char device to be added
+ * @drvdata: the data to be added to the device for callbacks
+ * @fmt: string for the device's name
+ *
+ * This function can be used by char device classes.  A struct device
+ * will be created in sysfs, registered to the specified class.
+ *
+ * A "dev" file will be created, showing the dev_t for the device, if
+ * the dev_t is not 0,0.
+ * If a pointer to a parent struct device is passed in, the newly created
+ * struct device will be a child of that device in sysfs.
+ * The pointer to the struct device will be returned from the call.
+ * Any further sysfs files that might be required can be created using this
+ * pointer.
+ *
+ * Note: the struct class passed to this function must have previously
+ * been created with a call to class_create().
+ */
+struct device *device_create_drvdata(struct class *class,
+                                    struct device *parent,
+                                    dev_t devt,
+                                    void *drvdata,
+                                    const char *fmt, ...)
+{
+       va_list vargs;
+       struct device *dev;
+
+       va_start(vargs, fmt);
+       dev = device_create_vargs(class, parent, devt, drvdata, fmt, vargs);
+       va_end(vargs);
+       return dev;
+}
+EXPORT_SYMBOL_GPL(device_create_drvdata);
+
+/**
+ * device_create - creates a device and registers it with sysfs
+ * @class: pointer to the struct class that this device should be registered to
+ * @parent: pointer to the parent struct device of this new device, if any
+ * @devt: the dev_t for the char device to be added
+ * @fmt: string for the device's name
+ *
+ * This function can be used by char device classes.  A struct device
+ * will be created in sysfs, registered to the specified class.
+ *
+ * A "dev" file will be created, showing the dev_t for the device, if
+ * the dev_t is not 0,0.
+ * If a pointer to a parent struct device is passed in, the newly created
+ * struct device will be a child of that device in sysfs.
+ * The pointer to the struct device will be returned from the call.
+ * Any further sysfs files that might be required can be created using this
+ * pointer.
+ *
+ * Note: the struct class passed to this function must have previously
+ * been created with a call to class_create().
+ */
+struct device *device_create(struct class *class, struct device *parent,
+                            dev_t devt, const char *fmt, ...)
+{
+       va_list vargs;
+       struct device *dev;
+
+       va_start(vargs, fmt);
+       dev = device_create_vargs(class, parent, devt, NULL, fmt, vargs);
+       va_end(vargs);
+       return dev;
+}
 EXPORT_SYMBOL_GPL(device_create);
 
 static int __match_devt(struct device *dev, void *data)
@@ -1218,13 +1291,11 @@ int device_rename(struct device *dev, char *new_name)
        }
 #else
        if (dev->class) {
-               sysfs_remove_link(&dev->class->subsys.kobj, old_device_name);
                error = sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj,
                                          dev->bus_id);
-               if (error) {
-                       dev_err(dev, "%s: sysfs_create_symlink failed (%d)\n",
-                               __func__, error);
-               }
+               if (error)
+                       goto out;
+               sysfs_remove_link(&dev->class->subsys.kobj, old_device_name);
        }
 #endif
 
index a196ef7..680cdfc 100644 (file)
@@ -447,6 +447,7 @@ static struct brd_device *brd_alloc(int i)
        disk->fops              = &brd_fops;
        disk->private_data      = brd;
        disk->queue             = brd->brd_queue;
+       disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
        sprintf(disk->disk_name, "ram%d", i);
        set_capacity(disk, rd_size * 2);
 
index ebfe038..f1c8feb 100644 (file)
@@ -3,7 +3,7 @@
  *  Authors: Dave Boutcher <boutcher@us.ibm.com>
  *           Ryan Arnold <ryanarn@us.ibm.com>
  *           Colin Devilbiss <devilbis@us.ibm.com>
- *           Stephen Rothwell <sfr@au1.ibm.com>
+ *           Stephen Rothwell
  *
  * (C) Copyright 2000-2004 IBM Corporation
  *
index 5245a4a..9d0dfe6 100644 (file)
@@ -6,7 +6,7 @@
  *  Authors: Dave Boutcher <boutcher@us.ibm.com>
  *           Ryan Arnold <ryanarn@us.ibm.com>
  *           Colin Devilbiss <devilbis@us.ibm.com>
- *           Stephen Rothwell <sfr@au1.ibm.com>
+ *           Stephen Rothwell
  *
  * (C) Copyright 2000-2004 IBM Corporation
  *
index 9a32169..af211a0 100644 (file)
@@ -34,8 +34,6 @@ static int drm_sysfs_suspend(struct device *dev, pm_message_t state)
        struct drm_minor *drm_minor = to_drm_minor(dev);
        struct drm_device *drm_dev = drm_minor->dev;
 
-       printk(KERN_ERR "%s\n", __func__);
-
        if (drm_dev->driver->suspend)
                return drm_dev->driver->suspend(drm_dev, state);
 
index 6bfe254..939618f 100644 (file)
@@ -2,7 +2,7 @@
 # Makefile for the Computone IntelliPort Plus Driver
 #
 
-obj-$(CONFIG_COMPUTONE)         += ip2.o ip2main.o
+obj-$(CONFIG_COMPUTONE)         += ip2.o
 
-ip2-objs                       := ip2base.o
+ip2-objs                       := ip2base.o ip2main.o
 
index 70957ac..c12cf8f 100644 (file)
@@ -346,27 +346,6 @@ have_requested_irq( char irq )
 }
 
 /******************************************************************************/
-/* Function:   init_module()                                                  */
-/* Parameters: None                                                           */
-/* Returns:    Success (0)                                                    */
-/*                                                                            */
-/* Description:                                                               */
-/* This is a required entry point for an installable module. It simply calls  */
-/* the driver initialisation function and returns what it returns.            */
-/******************************************************************************/
-#ifdef MODULE
-static int __init
-ip2_init_module(void)
-{
-#ifdef IP2DEBUG_INIT
-       printk (KERN_DEBUG "Loading module ...\n" );
-#endif
-    return 0;
-}
-module_init(ip2_init_module);
-#endif /* MODULE */
-
-/******************************************************************************/
 /* Function:   cleanup_module()                                               */
 /* Parameters: None                                                           */
 /* Returns:    Nothing                                                        */
@@ -779,8 +758,6 @@ out:
        return err;
 }
 
-EXPORT_SYMBOL(ip2_loadmain);
-
 /******************************************************************************/
 /* Function:   ip2_init_board()                                               */
 /* Parameters: Index of board in configuration structure                      */
index 3d3e1c2..65fb848 100644 (file)
@@ -7,7 +7,7 @@
  *  Authors: Dave Boutcher <boutcher@us.ibm.com>
  *           Ryan Arnold <ryanarn@us.ibm.com>
  *           Colin Devilbiss <devilbis@us.ibm.com>
- *           Stephen Rothwell <sfr@au1.ibm.com>
+ *           Stephen Rothwell
  *
  * (C) Copyright 2000, 2001, 2002, 2003, 2004 IBM Corporation
  *
index 58aad63..c39ddaf 100644 (file)
@@ -6,7 +6,7 @@
  *  Authors: Dave Boutcher <boutcher@us.ibm.com>
  *           Ryan Arnold <ryanarn@us.ibm.com>
  *           Colin Devilbiss <devilbis@us.ibm.com>
- *           Stephen Rothwell <sfr@au1.ibm.com>
+ *           Stephen Rothwell
  *
  * (C) Copyright 2000-2004 IBM Corporation
  *
index ae6cd60..b64c6bc 100644 (file)
@@ -2,6 +2,11 @@
  * linux/drivers/cpufreq/freq_table.c
  *
  * Copyright (C) 2002 - 2003 Dominik Brodowski
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
  */
 
 #include <linux/kernel.h>
index 762b729..0ec0f43 100644 (file)
@@ -821,10 +821,10 @@ static int __devinit iop_adma_memcpy_self_test(struct iop_adma_device *device)
 
        dev_dbg(device->common.dev, "%s\n", __func__);
 
-       src = kzalloc(sizeof(u8) * IOP_ADMA_TEST_SIZE, GFP_KERNEL);
+       src = kmalloc(IOP_ADMA_TEST_SIZE, GFP_KERNEL);
        if (!src)
                return -ENOMEM;
-       dest = kzalloc(sizeof(u8) * IOP_ADMA_TEST_SIZE, GFP_KERNEL);
+       dest = kzalloc(IOP_ADMA_TEST_SIZE, GFP_KERNEL);
        if (!dest) {
                kfree(src);
                return -ENOMEM;
@@ -834,8 +834,6 @@ static int __devinit iop_adma_memcpy_self_test(struct iop_adma_device *device)
        for (i = 0; i < IOP_ADMA_TEST_SIZE; i++)
                ((u8 *) src)[i] = (u8)i;
 
-       memset(dest, 0, IOP_ADMA_TEST_SIZE);
-
        /* Start copy, using first DMA channel */
        dma_chan = container_of(device->common.channels.next,
                                struct dma_chan,
index 065732d..d49361b 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <linux/of_platform.h>
 #include <linux/of_device.h>
-#include <asm/mpc85xx.h>
 #include "edac_module.h"
 #include "edac_core.h"
 #include "mpc85xx_edac.h"
@@ -43,8 +42,6 @@ static u32 orig_pci_err_en;
 static u32 orig_l2_err_disable;
 static u32 orig_hid1;
 
-static const char *mpc85xx_ctl_name = "MPC85xx";
-
 /************************ MC SYSFS parts ***********************************/
 
 static ssize_t mpc85xx_mc_inject_data_hi_show(struct mem_ctl_info *mci,
index 4a54192..dda1401 100644 (file)
@@ -113,6 +113,11 @@ static int fw_device_op_open(struct inode *inode, struct file *file)
        if (device == NULL)
                return -ENODEV;
 
+       if (fw_device_is_shutdown(device)) {
+               fw_device_put(device);
+               return -ENODEV;
+       }
+
        client = kzalloc(sizeof(*client), GFP_KERNEL);
        if (client == NULL) {
                fw_device_put(device);
@@ -901,6 +906,9 @@ fw_device_op_ioctl(struct file *file,
 {
        struct client *client = file->private_data;
 
+       if (fw_device_is_shutdown(client->device))
+               return -ENODEV;
+
        return dispatch_ioctl(client, cmd, (void __user *) arg);
 }
 
@@ -911,6 +919,9 @@ fw_device_op_compat_ioctl(struct file *file,
 {
        struct client *client = file->private_data;
 
+       if (fw_device_is_shutdown(client->device))
+               return -ENODEV;
+
        return dispatch_ioctl(client, cmd, compat_ptr(arg));
 }
 #endif
@@ -922,6 +933,9 @@ static int fw_device_op_mmap(struct file *file, struct vm_area_struct *vma)
        unsigned long size;
        int page_count, retval;
 
+       if (fw_device_is_shutdown(client->device))
+               return -ENODEV;
+
        /* FIXME: We could support multiple buffers, but we don't. */
        if (client->buffer.pages != NULL)
                return -EBUSY;
index 7f138c6..beaf6b3 100644 (file)
@@ -127,7 +127,7 @@ int __init gpiochip_reserve(int start, int ngpio)
        unsigned long flags;
        int i;
 
-       if (!gpio_is_valid(start) || !gpio_is_valid(start + ngpio))
+       if (!gpio_is_valid(start) || !gpio_is_valid(start + ngpio - 1))
                return -EINVAL;
 
        spin_lock_irqsave(&gpio_lock, flags);
@@ -170,7 +170,7 @@ int gpiochip_add(struct gpio_chip *chip)
        unsigned        id;
        int             base = chip->base;
 
-       if ((!gpio_is_valid(base) || !gpio_is_valid(base + chip->ngpio))
+       if ((!gpio_is_valid(base) || !gpio_is_valid(base + chip->ngpio - 1))
                        && base >= 0) {
                status = -EINVAL;
                goto fail;
@@ -207,7 +207,7 @@ fail:
        /* failures here can mean systems won't boot... */
        if (status)
                pr_err("gpiochip_add: gpios %d..%d (%s) not registered\n",
-                       chip->base, chip->base + chip->ngpio,
+                       chip->base, chip->base + chip->ngpio - 1,
                        chip->label ? : "generic");
        return status;
 }
index 7fb5b9d..7f92fdd 100644 (file)
@@ -168,7 +168,7 @@ static void mcp23s08_dbg_show(struct seq_file *s, struct gpio_chip *chip)
 {
        struct mcp23s08 *mcp;
        char            bank;
-       unsigned        t;
+       int             t;
        unsigned        mask;
 
        mcp = container_of(chip, struct mcp23s08, chip);
index 93f9167..7e40e8a 100644 (file)
@@ -30,6 +30,7 @@ static const struct i2c_device_id pca953x_id[] = {
        { "pca9537", 4, },
        { "pca9538", 8, },
        { "pca9539", 16, },
+       { "pca9554", 8, },
        { "pca9555", 16, },
        { "pca9557", 8, },
        /* REVISIT several pca955x parts should work here too */
index f88714b..47ac1a7 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: hid-debug.h,v 1.8 2001/09/25 09:37:57 vojtech Exp $
- *
  *  (c) 1999 Andreas Gal               <gal@cs.uni-magdeburg.de>
  *  (c) 2000-2001 Vojtech Pavlik       <vojtech@ucw.cz>
  *  (c) 2007 Jiri Kosina
index c3eb3f1..5c52a20 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: hid-input.c,v 1.2 2002/04/23 00:59:25 rdamazio Exp $
- *
  *  Copyright (c) 2000-2001 Vojtech Pavlik
  *  Copyright (c) 2006-2007 Jiri Kosina
  *
@@ -218,8 +216,9 @@ int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
                        }
                }
 
-               if (test_bit(usage->code, hid->pb_pressed_numlock) ||
-                               test_bit(LED_NUML, input->led)) {
+               if (hid->quirks & HID_QUIRK_APPLE_NUMLOCK_EMULATION && (
+                               test_bit(usage->code, hid->pb_pressed_numlock) ||
+                               test_bit(LED_NUML, input->led))) {
                        trans = find_translation(powerbook_numlock_keys, usage->code);
 
                        if (trans) {
index d3f8d91..1df832a 100644 (file)
 #define USB_DEVICE_ID_MGE_UPS          0xffff
 #define USB_DEVICE_ID_MGE_UPS1         0x0001
 
+#define USB_VENDOR_ID_MICROCHIP                0x04d8
+#define USB_DEVICE_ID_PICKIT1          0x0032
+#define USB_DEVICE_ID_PICKIT2          0x0033
+
 #define USB_VENDOR_ID_MICROSOFT                0x045e
 #define USB_DEVICE_ID_SIDEWINDER_GV    0x003b
 #define USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0 0x009d
 #define USB_VENDOR_ID_SONY                     0x054c
 #define USB_DEVICE_ID_SONY_PS3_CONTROLLER      0x0268
 
+#define USB_VENDOR_ID_SOUNDGRAPH       0x15c2
+#define USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD      0x0038
+
 #define USB_VENDOR_ID_SUN              0x0430
 #define USB_DEVICE_ID_RARITAN_KVM_DONGLE       0xcdab
 
@@ -567,6 +574,7 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_PANJIT, 0x0002, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_PANJIT, 0x0003, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_PANJIT, 0x0004, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_SOUNDGRAPH, USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP, HID_QUIRK_IGNORE },
@@ -580,6 +588,9 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_FLAIR, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_302, HID_QUIRK_IGNORE },
 
+       { USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT1, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT2, HID_QUIRK_IGNORE },
+
        { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_ELITE_KBD, HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL | HID_QUIRK_LOGITECH_EXPANDED_KEYMAP },
        { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500, HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL | HID_QUIRK_LOGITECH_EXPANDED_KEYMAP },
 
@@ -611,28 +622,28 @@ static const struct hid_blacklist {
 
        { USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
 
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD},
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ANSI, HID_QUIRK_APPLE_HAS_FN },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_JIS, HID_QUIRK_APPLE_HAS_FN },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, HID_QUIRK_APPLE_HAS_FN },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS, HID_QUIRK_APPLE_HAS_FN },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
 
        { USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_W7658, HID_QUIRK_RESET_LEDS },
        { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_KBD, HID_QUIRK_RESET_LEDS },
index 5d9dbb4..3cd46d2 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: usbkbd.c,v 1.27 2001/12/27 10:37:41 vojtech Exp $
- *
  *  Copyright (c) 1999-2001 Vojtech Pavlik
  *
  *  USB HIDBP Keyboard support
index df0d96d..703e9d0 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: usbmouse.c,v 1.15 2001/12/27 10:37:41 vojtech Exp $
- *
  *  Copyright (c) 1999-2001 Vojtech Pavlik
  *
  *  USB HIDBP Mouse support
index 4dc76bc..00ff533 100644 (file)
@@ -330,6 +330,20 @@ config SENSORS_CORETEMP
          sensor inside your CPU. Supported all are all known variants
          of Intel Core family.
 
+config SENSORS_IBMAEM
+       tristate "IBM Active Energy Manager temperature/power sensors and control"
+       select IPMI_SI
+       depends on IPMI_HANDLER
+       help
+         If you say yes here you get support for the temperature and
+         power sensors and capping hardware in various IBM System X
+         servers that support Active Energy Manager.  This includes
+         the x3350, x3550, x3650, x3655, x3755, x3850 M2, x3950 M2,
+         and certain HS2x/LS2x/QS2x blades.
+
+         This driver can also be built as a module.  If so, the module
+         will be called ibmaem.
+
 config SENSORS_IBMPEX
        tristate "IBM PowerExecutive temperature/power sensors"
        select IPMI_SI
index 3bdb05a..d098677 100644 (file)
@@ -41,6 +41,7 @@ obj-$(CONFIG_SENSORS_GL518SM) += gl518sm.o
 obj-$(CONFIG_SENSORS_GL520SM)  += gl520sm.o
 obj-$(CONFIG_SENSORS_HDAPS)    += hdaps.o
 obj-$(CONFIG_SENSORS_I5K_AMB)  += i5k_amb.o
+obj-$(CONFIG_SENSORS_IBMAEM)   += ibmaem.o
 obj-$(CONFIG_SENSORS_IBMPEX)   += ibmpex.o
 obj-$(CONFIG_SENSORS_IT87)     += it87.o
 obj-$(CONFIG_SENSORS_K8TEMP)   += k8temp.o
index bab5fd2..88e8965 100644 (file)
@@ -515,6 +515,7 @@ static struct dmi_system_id __initdata hdaps_whitelist[] = {
        HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R50"),
        HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R51"),
        HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R52"),
+       HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad R61i"),
        HDAPS_DMI_MATCH_INVERT("IBM", "ThinkPad T41p"),
        HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T41"),
        HDAPS_DMI_MATCH_INVERT("IBM", "ThinkPad T42p"),
index 6ac5c6f..f9e2ed6 100644 (file)
@@ -111,6 +111,7 @@ struct i5k_amb_data {
        void __iomem *amb_mmio;
        struct i5k_device_attribute *attrs;
        unsigned int num_attrs;
+       unsigned long chipset_id;
 };
 
 static ssize_t show_name(struct device *dev, struct device_attribute *devattr,
@@ -382,7 +383,8 @@ err:
        return res;
 }
 
-static int __devinit i5k_find_amb_registers(struct i5k_amb_data *data)
+static int __devinit i5k_find_amb_registers(struct i5k_amb_data *data,
+                                           unsigned long devid)
 {
        struct pci_dev *pcidev;
        u32 val32;
@@ -390,7 +392,7 @@ static int __devinit i5k_find_amb_registers(struct i5k_amb_data *data)
 
        /* Find AMB register memory space */
        pcidev = pci_get_device(PCI_VENDOR_ID_INTEL,
-                               PCI_DEVICE_ID_INTEL_5000_ERR,
+                               devid,
                                NULL);
        if (!pcidev)
                return -ENODEV;
@@ -409,6 +411,8 @@ static int __devinit i5k_find_amb_registers(struct i5k_amb_data *data)
                goto out;
        }
 
+       data->chipset_id = devid;
+
        res = 0;
 out:
        pci_dev_put(pcidev);
@@ -441,10 +445,30 @@ out:
        return res;
 }
 
+static unsigned long i5k_channel_pci_id(struct i5k_amb_data *data,
+                                       unsigned long channel)
+{
+       switch (data->chipset_id) {
+       case PCI_DEVICE_ID_INTEL_5000_ERR:
+               return PCI_DEVICE_ID_INTEL_5000_FBD0 + channel;
+       case PCI_DEVICE_ID_INTEL_5400_ERR:
+               return PCI_DEVICE_ID_INTEL_5400_FBD0 + channel;
+       default:
+               BUG();
+       }
+}
+
+static unsigned long chipset_ids[] = {
+       PCI_DEVICE_ID_INTEL_5000_ERR,
+       PCI_DEVICE_ID_INTEL_5400_ERR,
+       0
+};
+
 static int __devinit i5k_amb_probe(struct platform_device *pdev)
 {
        struct i5k_amb_data *data;
        struct resource *reso;
+       int i;
        int res = -ENODEV;
 
        data = kzalloc(sizeof(*data), GFP_KERNEL);
@@ -452,19 +476,24 @@ static int __devinit i5k_amb_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        /* Figure out where the AMB registers live */
-       res = i5k_find_amb_registers(data);
+       i = 0;
+       do {
+               res = i5k_find_amb_registers(data, chipset_ids[i]);
+               i++;
+       } while (res && chipset_ids[i]);
+
        if (res)
                goto err;
 
        /* Copy the DIMM presence map for the first two channels */
        res = i5k_channel_probe(&data->amb_present[0],
-                               PCI_DEVICE_ID_INTEL_5000_FBD0);
+                               i5k_channel_pci_id(data, 0));
        if (res)
                goto err;
 
        /* Copy the DIMM presence map for the optional second two channels */
        i5k_channel_probe(&data->amb_present[2],
-                         PCI_DEVICE_ID_INTEL_5000_FBD1);
+                         i5k_channel_pci_id(data, 1));
 
        /* Set up resource regions */
        reso = request_mem_region(data->amb_base, data->amb_len, DRVNAME);
diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c
new file mode 100644 (file)
index 0000000..5c006c9
--- /dev/null
@@ -0,0 +1,1111 @@
+/*
+ * A hwmon driver for the IBM Active Energy Manager temperature/power sensors
+ * and capping functionality.
+ * Copyright (C) 2008 IBM
+ *
+ * Author: Darrick J. Wong <djwong@us.ibm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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/ipmi.h>
+#include <linux/module.h>
+#include <linux/hwmon.h>
+#include <linux/hwmon-sysfs.h>
+#include <linux/jiffies.h>
+#include <linux/mutex.h>
+#include <linux/kdev_t.h>
+#include <linux/spinlock.h>
+#include <linux/idr.h>
+#include <linux/sched.h>
+#include <linux/platform_device.h>
+#include <linux/math64.h>
+#include <linux/time.h>
+
+#define REFRESH_INTERVAL       (HZ)
+#define IPMI_TIMEOUT           (30 * HZ)
+#define DRVNAME                        "aem"
+
+#define AEM_NETFN              0x2E
+
+#define AEM_FIND_FW_CMD                0x80
+#define AEM_ELEMENT_CMD                0x81
+#define AEM_FW_INSTANCE_CMD    0x82
+
+#define AEM_READ_ELEMENT_CFG   0x80
+#define AEM_READ_BUFFER                0x81
+#define AEM_READ_REGISTER      0x82
+#define AEM_WRITE_REGISTER     0x83
+#define AEM_SET_REG_MASK       0x84
+#define AEM_CLEAR_REG_MASK     0x85
+#define AEM_READ_ELEMENT_CFG2  0x86
+
+#define AEM_CONTROL_ELEMENT    0
+#define AEM_ENERGY_ELEMENT     1
+#define AEM_CLOCK_ELEMENT      4
+#define AEM_POWER_CAP_ELEMENT  7
+#define AEM_EXHAUST_ELEMENT    9
+#define AEM_POWER_ELEMENT      10
+
+#define AEM_MODULE_TYPE_ID     0x0001
+
+#define AEM2_NUM_ENERGY_REGS   2
+#define AEM2_NUM_PCAP_REGS     6
+#define AEM2_NUM_TEMP_REGS     2
+#define AEM2_NUM_SENSORS       14
+
+#define AEM1_NUM_ENERGY_REGS   1
+#define AEM1_NUM_SENSORS       3
+
+/* AEM 2.x has more energy registers */
+#define AEM_NUM_ENERGY_REGS    AEM2_NUM_ENERGY_REGS
+/* AEM 2.x needs more sensor files */
+#define AEM_NUM_SENSORS                AEM2_NUM_SENSORS
+
+#define POWER_CAP              0
+#define POWER_CAP_MAX_HOTPLUG  1
+#define POWER_CAP_MAX          2
+#define        POWER_CAP_MIN_WARNING   3
+#define POWER_CAP_MIN          4
+#define        POWER_AUX               5
+
+#define AEM_DEFAULT_POWER_INTERVAL 1000
+#define AEM_MIN_POWER_INTERVAL 200
+#define UJ_PER_MJ              1000L
+
+static DEFINE_IDR(aem_idr);
+static DEFINE_SPINLOCK(aem_idr_lock);
+
+static struct device_driver aem_driver = {
+       .name = DRVNAME,
+       .bus = &platform_bus_type,
+};
+
+struct aem_ipmi_data {
+       struct completion       read_complete;
+       struct ipmi_addr        address;
+       ipmi_user_t             user;
+       int                     interface;
+
+       struct kernel_ipmi_msg  tx_message;
+       long                    tx_msgid;
+
+       void                    *rx_msg_data;
+       unsigned short          rx_msg_len;
+       unsigned char           rx_result;
+       int                     rx_recv_type;
+
+       struct device           *bmc_device;
+};
+
+struct aem_ro_sensor_template {
+       char *label;
+       ssize_t (*show)(struct device *dev,
+                       struct device_attribute *devattr,
+                       char *buf);
+       int index;
+};
+
+struct aem_rw_sensor_template {
+       char *label;
+       ssize_t (*show)(struct device *dev,
+                       struct device_attribute *devattr,
+                       char *buf);
+       ssize_t (*set)(struct device *dev,
+                      struct device_attribute *devattr,
+                      const char *buf, size_t count);
+       int index;
+};
+
+struct aem_data {
+       struct list_head        list;
+
+       struct device           *hwmon_dev;
+       struct platform_device  *pdev;
+       struct mutex            lock;
+       char                    valid;
+       unsigned long           last_updated;   /* In jiffies */
+       u8                      ver_major;
+       u8                      ver_minor;
+       u8                      module_handle;
+       int                     id;
+       struct aem_ipmi_data    ipmi;
+
+       /* Function to update sensors */
+       void (*update)(struct aem_data *data);
+
+       /*
+        * AEM 1.x sensors:
+        * Available sensors:
+        * Energy meter
+        * Power meter
+        *
+        * AEM 2.x sensors:
+        * Two energy meters
+        * Two power meters
+        * Two temperature sensors
+        * Six power cap registers
+        */
+
+       /* sysfs attrs */
+       struct sensor_device_attribute  sensors[AEM_NUM_SENSORS];
+
+       /* energy use in mJ */
+       u64                     energy[AEM_NUM_ENERGY_REGS];
+
+       /* power sampling interval in ms */
+       unsigned long           power_period[AEM_NUM_ENERGY_REGS];
+
+       /* Everything past here is for AEM2 only */
+
+       /* power caps in dW */
+       u16                     pcap[AEM2_NUM_PCAP_REGS];
+
+       /* exhaust temperature in C */
+       u8                      temp[AEM2_NUM_TEMP_REGS];
+};
+
+/* Data structures returned by the AEM firmware */
+struct aem_iana_id {
+       u8                      bytes[3];
+};
+static struct aem_iana_id system_x_id = {
+       .bytes = {0x4D, 0x4F, 0x00}
+};
+
+/* These are used to find AEM1 instances */
+struct aem_find_firmware_req {
+       struct aem_iana_id      id;
+       u8                      rsvd;
+       u16                     index;
+       u16                     module_type_id;
+} __packed;
+
+struct aem_find_firmware_resp {
+       struct aem_iana_id      id;
+       u8                      num_instances;
+} __packed;
+
+/* These are used to find AEM2 instances */
+struct aem_find_instance_req {
+       struct aem_iana_id      id;
+       u8                      instance_number;
+       u16                     module_type_id;
+} __packed;
+
+struct aem_find_instance_resp {
+       struct aem_iana_id      id;
+       u8                      num_instances;
+       u8                      major;
+       u8                      minor;
+       u8                      module_handle;
+       u16                     record_id;
+} __packed;
+
+/* These are used to query sensors */
+struct aem_read_sensor_req {
+       struct aem_iana_id      id;
+       u8                      module_handle;
+       u8                      element;
+       u8                      subcommand;
+       u8                      reg;
+       u8                      rx_buf_size;
+} __packed;
+
+struct aem_read_sensor_resp {
+       struct aem_iana_id      id;
+       u8                      bytes[0];
+} __packed;
+
+/* Data structures to talk to the IPMI layer */
+struct aem_driver_data {
+       struct list_head        aem_devices;
+       struct ipmi_smi_watcher bmc_events;
+       struct ipmi_user_hndl   ipmi_hndlrs;
+};
+
+static void aem_register_bmc(int iface, struct device *dev);
+static void aem_bmc_gone(int iface);
+static void aem_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data);
+
+static void aem_remove_sensors(struct aem_data *data);
+static int aem_init_aem1(struct aem_ipmi_data *probe);
+static int aem_init_aem2(struct aem_ipmi_data *probe);
+static int aem1_find_sensors(struct aem_data *data);
+static int aem2_find_sensors(struct aem_data *data);
+static void update_aem1_sensors(struct aem_data *data);
+static void update_aem2_sensors(struct aem_data *data);
+
+static struct aem_driver_data driver_data = {
+       .aem_devices = LIST_HEAD_INIT(driver_data.aem_devices),
+       .bmc_events = {
+               .owner = THIS_MODULE,
+               .new_smi = aem_register_bmc,
+               .smi_gone = aem_bmc_gone,
+       },
+       .ipmi_hndlrs = {
+               .ipmi_recv_hndl = aem_msg_handler,
+       },
+};
+
+/* Functions to talk to the IPMI layer */
+
+/* Initialize IPMI address, message buffers and user data */
+static int aem_init_ipmi_data(struct aem_ipmi_data *data, int iface,
+                             struct device *bmc)
+{
+       int err;
+
+       init_completion(&data->read_complete);
+       data->bmc_device = bmc;
+
+       /* Initialize IPMI address */
+       data->address.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE;
+       data->address.channel = IPMI_BMC_CHANNEL;
+       data->address.data[0] = 0;
+       data->interface = iface;
+
+       /* Initialize message buffers */
+       data->tx_msgid = 0;
+       data->tx_message.netfn = AEM_NETFN;
+
+       /* Create IPMI messaging interface user */
+       err = ipmi_create_user(data->interface, &driver_data.ipmi_hndlrs,
+                              data, &data->user);
+       if (err < 0) {
+               dev_err(bmc, "Unable to register user with IPMI "
+                       "interface %d\n", data->interface);
+               return -EACCES;
+       }
+
+       return 0;
+}
+
+/* Send an IPMI command */
+static int aem_send_message(struct aem_ipmi_data *data)
+{
+       int err;
+
+       err = ipmi_validate_addr(&data->address, sizeof(data->address));
+       if (err)
+               goto out;
+
+       data->tx_msgid++;
+       err = ipmi_request_settime(data->user, &data->address, data->tx_msgid,
+                                  &data->tx_message, data, 0, 0, 0);
+       if (err)
+               goto out1;
+
+       return 0;
+out1:
+       dev_err(data->bmc_device, "request_settime=%x\n", err);
+       return err;
+out:
+       dev_err(data->bmc_device, "validate_addr=%x\n", err);
+       return err;
+}
+
+/* Dispatch IPMI messages to callers */
+static void aem_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data)
+{
+       unsigned short rx_len;
+       struct aem_ipmi_data *data = user_msg_data;
+
+       if (msg->msgid != data->tx_msgid) {
+               dev_err(data->bmc_device, "Mismatch between received msgid "
+                       "(%02x) and transmitted msgid (%02x)!\n",
+                       (int)msg->msgid,
+                       (int)data->tx_msgid);
+               ipmi_free_recv_msg(msg);
+               return;
+       }
+
+       data->rx_recv_type = msg->recv_type;
+       if (msg->msg.data_len > 0)
+               data->rx_result = msg->msg.data[0];
+       else
+               data->rx_result = IPMI_UNKNOWN_ERR_COMPLETION_CODE;
+
+       if (msg->msg.data_len > 1) {
+               rx_len = msg->msg.data_len - 1;
+               if (data->rx_msg_len < rx_len)
+                       rx_len = data->rx_msg_len;
+               data->rx_msg_len = rx_len;
+               memcpy(data->rx_msg_data, msg->msg.data + 1, data->rx_msg_len);
+       } else
+               data->rx_msg_len = 0;
+
+       ipmi_free_recv_msg(msg);
+       complete(&data->read_complete);
+}
+
+/* ID functions */
+
+/* Obtain an id */
+static int aem_idr_get(int *id)
+{
+       int i, err;
+
+again:
+       if (unlikely(!idr_pre_get(&aem_idr, GFP_KERNEL)))
+               return -ENOMEM;
+
+       spin_lock(&aem_idr_lock);
+       err = idr_get_new(&aem_idr, NULL, &i);
+       spin_unlock(&aem_idr_lock);
+
+       if (unlikely(err == -EAGAIN))
+               goto again;
+       else if (unlikely(err))
+               return err;
+
+       *id = i & MAX_ID_MASK;
+       return 0;
+}
+
+/* Release an object ID */
+static void aem_idr_put(int id)
+{
+       spin_lock(&aem_idr_lock);
+       idr_remove(&aem_idr, id);
+       spin_unlock(&aem_idr_lock);
+}
+
+/* Sensor support functions */
+
+/* Read a sensor value */
+static int aem_read_sensor(struct aem_data *data, u8 elt, u8 reg,
+                          void *buf, size_t size)
+{
+       int rs_size, res;
+       struct aem_read_sensor_req rs_req;
+       struct aem_read_sensor_resp *rs_resp;
+       struct aem_ipmi_data *ipmi = &data->ipmi;
+
+       /* AEM registers are 1, 2, 4 or 8 bytes */
+       switch (size) {
+       case 1:
+       case 2:
+       case 4:
+       case 8:
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       rs_req.id = system_x_id;
+       rs_req.module_handle = data->module_handle;
+       rs_req.element = elt;
+       rs_req.subcommand = AEM_READ_REGISTER;
+       rs_req.reg = reg;
+       rs_req.rx_buf_size = size;
+
+       ipmi->tx_message.cmd = AEM_ELEMENT_CMD;
+       ipmi->tx_message.data = (char *)&rs_req;
+       ipmi->tx_message.data_len = sizeof(rs_req);
+
+       rs_size = sizeof(*rs_resp) + size;
+       rs_resp = kzalloc(rs_size, GFP_KERNEL);
+       if (!rs_resp)
+               return -ENOMEM;
+
+       ipmi->rx_msg_data = rs_resp;
+       ipmi->rx_msg_len = rs_size;
+
+       aem_send_message(ipmi);
+
+       res = wait_for_completion_timeout(&ipmi->read_complete, IPMI_TIMEOUT);
+       if (!res)
+               return -ETIMEDOUT;
+
+       if (ipmi->rx_result || ipmi->rx_msg_len != rs_size ||
+           memcmp(&rs_resp->id, &system_x_id, sizeof(system_x_id))) {
+               kfree(rs_resp);
+               return -ENOENT;
+       }
+
+       switch (size) {
+       case 1: {
+               u8 *x = buf;
+               *x = rs_resp->bytes[0];
+               break;
+       }
+       case 2: {
+               u16 *x = buf;
+               *x = be16_to_cpup((u16 *)rs_resp->bytes);
+               break;
+       }
+       case 4: {
+               u32 *x = buf;
+               *x = be32_to_cpup((u32 *)rs_resp->bytes);
+               break;
+       }
+       case 8: {
+               u64 *x = buf;
+               *x = be64_to_cpup((u64 *)rs_resp->bytes);
+               break;
+       }
+       }
+
+       return 0;
+}
+
+/* Update AEM energy registers */
+static void update_aem_energy(struct aem_data *data)
+{
+       aem_read_sensor(data, AEM_ENERGY_ELEMENT, 0, &data->energy[0], 8);
+       if (data->ver_major < 2)
+               return;
+       aem_read_sensor(data, AEM_ENERGY_ELEMENT, 1, &data->energy[1], 8);
+}
+
+/* Update all AEM1 sensors */
+static void update_aem1_sensors(struct aem_data *data)
+{
+       mutex_lock(&data->lock);
+       if (time_before(jiffies, data->last_updated + REFRESH_INTERVAL) &&
+           data->valid)
+               goto out;
+
+       update_aem_energy(data);
+out:
+       mutex_unlock(&data->lock);
+}
+
+/* Update all AEM2 sensors */
+static void update_aem2_sensors(struct aem_data *data)
+{
+       int i;
+
+       mutex_lock(&data->lock);
+       if (time_before(jiffies, data->last_updated + REFRESH_INTERVAL) &&
+           data->valid)
+               goto out;
+
+       update_aem_energy(data);
+       aem_read_sensor(data, AEM_EXHAUST_ELEMENT, 0, &data->temp[0], 1);
+       aem_read_sensor(data, AEM_EXHAUST_ELEMENT, 1, &data->temp[1], 1);
+
+       for (i = POWER_CAP; i <= POWER_AUX; i++)
+               aem_read_sensor(data, AEM_POWER_CAP_ELEMENT, i,
+                               &data->pcap[i], 2);
+out:
+       mutex_unlock(&data->lock);
+}
+
+/* Delete an AEM instance */
+static void aem_delete(struct aem_data *data)
+{
+       list_del(&data->list);
+       aem_remove_sensors(data);
+       hwmon_device_unregister(data->hwmon_dev);
+       ipmi_destroy_user(data->ipmi.user);
+       dev_set_drvdata(&data->pdev->dev, NULL);
+       platform_device_unregister(data->pdev);
+       aem_idr_put(data->id);
+       kfree(data);
+}
+
+/* Probe functions for AEM1 devices */
+
+/* Retrieve version and module handle for an AEM1 instance */
+static int aem_find_aem1_count(struct aem_ipmi_data *data)
+{
+       int res;
+       struct aem_find_firmware_req    ff_req;
+       struct aem_find_firmware_resp   ff_resp;
+
+       ff_req.id = system_x_id;
+       ff_req.index = 0;
+       ff_req.module_type_id = cpu_to_be16(AEM_MODULE_TYPE_ID);
+
+       data->tx_message.cmd = AEM_FIND_FW_CMD;
+       data->tx_message.data = (char *)&ff_req;
+       data->tx_message.data_len = sizeof(ff_req);
+
+       data->rx_msg_data = &ff_resp;
+       data->rx_msg_len = sizeof(ff_resp);
+
+       aem_send_message(data);
+
+       res = wait_for_completion_timeout(&data->read_complete, IPMI_TIMEOUT);
+       if (!res)
+               return -ETIMEDOUT;
+
+       if (data->rx_result || data->rx_msg_len != sizeof(ff_resp) ||
+           memcmp(&ff_resp.id, &system_x_id, sizeof(system_x_id)))
+               return -ENOENT;
+
+       return ff_resp.num_instances;
+}
+
+/* Find and initialize one AEM1 instance */
+static int aem_init_aem1_inst(struct aem_ipmi_data *probe, u8 module_handle)
+{
+       struct aem_data *data;
+       int i;
+       int res = -ENOMEM;
+
+       data = kzalloc(sizeof(*data), GFP_KERNEL);
+       if (!data)
+               return res;
+       mutex_init(&data->lock);
+
+       /* Copy instance data */
+       data->ver_major = 1;
+       data->ver_minor = 0;
+       data->module_handle = module_handle;
+       for (i = 0; i < AEM1_NUM_ENERGY_REGS; i++)
+               data->power_period[i] = AEM_DEFAULT_POWER_INTERVAL;
+
+       /* Create sub-device for this fw instance */
+       if (aem_idr_get(&data->id))
+               goto id_err;
+
+       data->pdev = platform_device_alloc(DRVNAME, data->id);
+       if (!data->pdev)
+               goto dev_err;
+       data->pdev->dev.driver = &aem_driver;
+
+       res = platform_device_add(data->pdev);
+       if (res)
+               goto ipmi_err;
+
+       dev_set_drvdata(&data->pdev->dev, data);
+
+       /* Set up IPMI interface */
+       if (aem_init_ipmi_data(&data->ipmi, probe->interface,
+                              probe->bmc_device))
+               goto ipmi_err;
+
+       /* Register with hwmon */
+       data->hwmon_dev = hwmon_device_register(&data->pdev->dev);
+
+       if (IS_ERR(data->hwmon_dev)) {
+               dev_err(&data->pdev->dev, "Unable to register hwmon "
+                       "device for IPMI interface %d\n",
+                       probe->interface);
+               goto hwmon_reg_err;
+       }
+
+       data->update = update_aem1_sensors;
+
+       /* Find sensors */
+       if (aem1_find_sensors(data))
+               goto sensor_err;
+
+       /* Add to our list of AEM devices */
+       list_add_tail(&data->list, &driver_data.aem_devices);
+
+       dev_info(data->ipmi.bmc_device, "Found AEM v%d.%d at 0x%X\n",
+                data->ver_major, data->ver_minor,
+                data->module_handle);
+       return 0;
+
+sensor_err:
+       hwmon_device_unregister(data->hwmon_dev);
+hwmon_reg_err:
+       ipmi_destroy_user(data->ipmi.user);
+ipmi_err:
+       dev_set_drvdata(&data->pdev->dev, NULL);
+       platform_device_unregister(data->pdev);
+dev_err:
+       aem_idr_put(data->id);
+id_err:
+       kfree(data);
+
+       return res;
+}
+
+/* Find and initialize all AEM1 instances */
+static int aem_init_aem1(struct aem_ipmi_data *probe)
+{
+       int num, i, err;
+
+       num = aem_find_aem1_count(probe);
+       for (i = 0; i < num; i++) {
+               err = aem_init_aem1_inst(probe, i);
+               if (err) {
+                       dev_err(probe->bmc_device,
+                               "Error %d initializing AEM1 0x%X\n",
+                               err, i);
+                       return err;
+               }
+       }
+
+       return 0;
+}
+
+/* Probe functions for AEM2 devices */
+
+/* Retrieve version and module handle for an AEM2 instance */
+static int aem_find_aem2(struct aem_ipmi_data *data,
+                           struct aem_find_instance_resp *fi_resp,
+                           int instance_num)
+{
+       int res;
+       struct aem_find_instance_req fi_req;
+
+       fi_req.id = system_x_id;
+       fi_req.instance_number = instance_num;
+       fi_req.module_type_id = cpu_to_be16(AEM_MODULE_TYPE_ID);
+
+       data->tx_message.cmd = AEM_FW_INSTANCE_CMD;
+       data->tx_message.data = (char *)&fi_req;
+       data->tx_message.data_len = sizeof(fi_req);
+
+       data->rx_msg_data = fi_resp;
+       data->rx_msg_len = sizeof(*fi_resp);
+
+       aem_send_message(data);
+
+       res = wait_for_completion_timeout(&data->read_complete, IPMI_TIMEOUT);
+       if (!res)
+               return -ETIMEDOUT;
+
+       if (data->rx_result || data->rx_msg_len != sizeof(*fi_resp) ||
+           memcmp(&fi_resp->id, &system_x_id, sizeof(system_x_id)))
+               return -ENOENT;
+
+       return 0;
+}
+
+/* Find and initialize one AEM2 instance */
+static int aem_init_aem2_inst(struct aem_ipmi_data *probe,
+                             struct aem_find_instance_resp *fi_resp)
+{
+       struct aem_data *data;
+       int i;
+       int res = -ENOMEM;
+
+       data = kzalloc(sizeof(*data), GFP_KERNEL);
+       if (!data)
+               return res;
+       mutex_init(&data->lock);
+
+       /* Copy instance data */
+       data->ver_major = fi_resp->major;
+       data->ver_minor = fi_resp->minor;
+       data->module_handle = fi_resp->module_handle;
+       for (i = 0; i < AEM2_NUM_ENERGY_REGS; i++)
+               data->power_period[i] = AEM_DEFAULT_POWER_INTERVAL;
+
+       /* Create sub-device for this fw instance */
+       if (aem_idr_get(&data->id))
+               goto id_err;
+
+       data->pdev = platform_device_alloc(DRVNAME, data->id);
+       if (!data->pdev)
+               goto dev_err;
+       data->pdev->dev.driver = &aem_driver;
+
+       res = platform_device_add(data->pdev);
+       if (res)
+               goto ipmi_err;
+
+       dev_set_drvdata(&data->pdev->dev, data);
+
+       /* Set up IPMI interface */
+       if (aem_init_ipmi_data(&data->ipmi, probe->interface,
+                              probe->bmc_device))
+               goto ipmi_err;
+
+       /* Register with hwmon */
+       data->hwmon_dev = hwmon_device_register(&data->pdev->dev);
+
+       if (IS_ERR(data->hwmon_dev)) {
+               dev_err(&data->pdev->dev, "Unable to register hwmon "
+                       "device for IPMI interface %d\n",
+                       probe->interface);
+               goto hwmon_reg_err;
+       }
+
+       data->update = update_aem2_sensors;
+
+       /* Find sensors */
+       if (aem2_find_sensors(data))
+               goto sensor_err;
+
+       /* Add to our list of AEM devices */
+       list_add_tail(&data->list, &driver_data.aem_devices);
+
+       dev_info(data->ipmi.bmc_device, "Found AEM v%d.%d at 0x%X\n",
+                data->ver_major, data->ver_minor,
+                data->module_handle);
+       return 0;
+
+sensor_err:
+       hwmon_device_unregister(data->hwmon_dev);
+hwmon_reg_err:
+       ipmi_destroy_user(data->ipmi.user);
+ipmi_err:
+       dev_set_drvdata(&data->pdev->dev, NULL);
+       platform_device_unregister(data->pdev);
+dev_err:
+       aem_idr_put(data->id);
+id_err:
+       kfree(data);
+
+       return res;
+}
+
+/* Find and initialize all AEM2 instances */
+static int aem_init_aem2(struct aem_ipmi_data *probe)
+{
+       struct aem_find_instance_resp fi_resp;
+       int err;
+       int i = 0;
+
+       while (!aem_find_aem2(probe, &fi_resp, i)) {
+               if (fi_resp.major != 2) {
+                       dev_err(probe->bmc_device, "Unknown AEM v%d; please "
+                               "report this to the maintainer.\n",
+                               fi_resp.major);
+                       i++;
+                       continue;
+               }
+               err = aem_init_aem2_inst(probe, &fi_resp);
+               if (err) {
+                       dev_err(probe->bmc_device,
+                               "Error %d initializing AEM2 0x%X\n",
+                               err, fi_resp.module_handle);
+                       return err;
+               }
+               i++;
+       }
+
+       return 0;
+}
+
+/* Probe a BMC for AEM firmware instances */
+static void aem_register_bmc(int iface, struct device *dev)
+{
+       struct aem_ipmi_data probe;
+
+       if (aem_init_ipmi_data(&probe, iface, dev))
+               return;
+
+       /* Ignore probe errors; they won't cause problems */
+       aem_init_aem1(&probe);
+       aem_init_aem2(&probe);
+
+       ipmi_destroy_user(probe.user);
+}
+
+/* Handle BMC deletion */
+static void aem_bmc_gone(int iface)
+{
+       struct aem_data *p1, *next1;
+
+       list_for_each_entry_safe(p1, next1, &driver_data.aem_devices, list)
+               if (p1->ipmi.interface == iface)
+                       aem_delete(p1);
+}
+
+/* sysfs support functions */
+
+/* AEM device name */
+static ssize_t show_name(struct device *dev, struct device_attribute *devattr,
+                        char *buf)
+{
+       struct aem_data *data = dev_get_drvdata(dev);
+
+       return sprintf(buf, "%s%d\n", DRVNAME, data->ver_major);
+}
+static SENSOR_DEVICE_ATTR(name, S_IRUGO, show_name, NULL, 0);
+
+/* AEM device version */
+static ssize_t show_version(struct device *dev,
+                           struct device_attribute *devattr,
+                           char *buf)
+{
+       struct aem_data *data = dev_get_drvdata(dev);
+
+       return sprintf(buf, "%d.%d\n", data->ver_major, data->ver_minor);
+}
+static SENSOR_DEVICE_ATTR(version, S_IRUGO, show_version, NULL, 0);
+
+/* Display power use */
+static ssize_t aem_show_power(struct device *dev,
+                             struct device_attribute *devattr,
+                             char *buf)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct aem_data *data = dev_get_drvdata(dev);
+       u64 before, after, delta, time;
+       signed long leftover;
+       struct timespec b, a;
+
+       mutex_lock(&data->lock);
+       update_aem_energy(data);
+       getnstimeofday(&b);
+       before = data->energy[attr->index];
+
+       leftover = schedule_timeout_interruptible(
+                       msecs_to_jiffies(data->power_period[attr->index])
+                  );
+       if (leftover) {
+               mutex_unlock(&data->lock);
+               return 0;
+       }
+
+       update_aem_energy(data);
+       getnstimeofday(&a);
+       after = data->energy[attr->index];
+       mutex_unlock(&data->lock);
+
+       time = timespec_to_ns(&a) - timespec_to_ns(&b);
+       delta = (after - before) * UJ_PER_MJ;
+
+       return sprintf(buf, "%llu\n",
+               (unsigned long long)div64_u64(delta * NSEC_PER_SEC, time));
+}
+
+/* Display energy use */
+static ssize_t aem_show_energy(struct device *dev,
+                              struct device_attribute *devattr,
+                              char *buf)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct aem_data *a = dev_get_drvdata(dev);
+       a->update(a);
+
+       return sprintf(buf, "%llu\n",
+                       (unsigned long long)a->energy[attr->index] * 1000);
+}
+
+/* Display power interval registers */
+static ssize_t aem_show_power_period(struct device *dev,
+                                    struct device_attribute *devattr,
+                                    char *buf)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct aem_data *a = dev_get_drvdata(dev);
+       a->update(a);
+
+       return sprintf(buf, "%lu\n", a->power_period[attr->index]);
+}
+
+/* Set power interval registers */
+static ssize_t aem_set_power_period(struct device *dev,
+                                   struct device_attribute *devattr,
+                                   const char *buf, size_t count)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct aem_data *a = dev_get_drvdata(dev);
+       unsigned long temp;
+       int res;
+
+       res = strict_strtoul(buf, 10, &temp);
+       if (res)
+               return res;
+
+       if (temp < AEM_MIN_POWER_INTERVAL)
+               return -EINVAL;
+
+       mutex_lock(&a->lock);
+       a->power_period[attr->index] = temp;
+       mutex_unlock(&a->lock);
+
+       return count;
+}
+
+/* Discover sensors on an AEM device */
+static int aem_register_sensors(struct aem_data *data,
+                               struct aem_ro_sensor_template *ro,
+                               struct aem_rw_sensor_template *rw)
+{
+       struct device *dev = &data->pdev->dev;
+       struct sensor_device_attribute *sensors = data->sensors;
+       int err;
+
+       /* Set up read-only sensors */
+       while (ro->label) {
+               sensors->dev_attr.attr.name = ro->label;
+               sensors->dev_attr.attr.mode = S_IRUGO;
+               sensors->dev_attr.show = ro->show;
+               sensors->index = ro->index;
+
+               err = device_create_file(dev, &sensors->dev_attr);
+               if (err) {
+                       sensors->dev_attr.attr.name = NULL;
+                       goto error;
+               }
+               sensors++;
+               ro++;
+       }
+
+       /* Set up read-write sensors */
+       while (rw->label) {
+               sensors->dev_attr.attr.name = rw->label;
+               sensors->dev_attr.attr.mode = S_IRUGO | S_IWUSR;
+               sensors->dev_attr.show = rw->show;
+               sensors->dev_attr.store = rw->set;
+               sensors->index = rw->index;
+
+               err = device_create_file(dev, &sensors->dev_attr);
+               if (err) {
+                       sensors->dev_attr.attr.name = NULL;
+                       goto error;
+               }
+               sensors++;
+               rw++;
+       }
+
+       err = device_create_file(dev, &sensor_dev_attr_name.dev_attr);
+       if (err)
+               goto error;
+       err = device_create_file(dev, &sensor_dev_attr_version.dev_attr);
+       return err;
+
+error:
+       aem_remove_sensors(data);
+       return err;
+}
+
+/* sysfs support functions for AEM2 sensors */
+
+/* Display temperature use */
+static ssize_t aem2_show_temp(struct device *dev,
+                             struct device_attribute *devattr,
+                             char *buf)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct aem_data *a = dev_get_drvdata(dev);
+       a->update(a);
+
+       return sprintf(buf, "%u\n", a->temp[attr->index] * 1000);
+}
+
+/* Display power-capping registers */
+static ssize_t aem2_show_pcap_value(struct device *dev,
+                                   struct device_attribute *devattr,
+                                   char *buf)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct aem_data *a = dev_get_drvdata(dev);
+       a->update(a);
+
+       return sprintf(buf, "%u\n", a->pcap[attr->index] * 100000);
+}
+
+/* Remove sensors attached to an AEM device */
+static void aem_remove_sensors(struct aem_data *data)
+{
+       int i;
+
+       for (i = 0; i < AEM_NUM_SENSORS; i++) {
+               if (!data->sensors[i].dev_attr.attr.name)
+                       continue;
+               device_remove_file(&data->pdev->dev,
+                                  &data->sensors[i].dev_attr);
+       }
+
+       device_remove_file(&data->pdev->dev,
+                          &sensor_dev_attr_name.dev_attr);
+       device_remove_file(&data->pdev->dev,
+                          &sensor_dev_attr_version.dev_attr);
+}
+
+/* Sensor probe functions */
+
+/* Description of AEM1 sensors */
+static struct aem_ro_sensor_template aem1_ro_sensors[] = {
+{"energy1_input",  aem_show_energy, 0},
+{"power1_average", aem_show_power,  0},
+{NULL,            NULL,            0},
+};
+
+static struct aem_rw_sensor_template aem1_rw_sensors[] = {
+{"power1_average_interval", aem_show_power_period, aem_set_power_period, 0},
+{NULL,                     NULL,                  NULL,                 0},
+};
+
+/* Description of AEM2 sensors */
+static struct aem_ro_sensor_template aem2_ro_sensors[] = {
+{"energy1_input",        aem_show_energy,      0},
+{"energy2_input",        aem_show_energy,      1},
+{"power1_average",       aem_show_power,       0},
+{"power2_average",       aem_show_power,       1},
+{"temp1_input",                  aem2_show_temp,       0},
+{"temp2_input",                  aem2_show_temp,       1},
+
+{"power4_average",       aem2_show_pcap_value, POWER_CAP_MAX_HOTPLUG},
+{"power5_average",       aem2_show_pcap_value, POWER_CAP_MAX},
+{"power6_average",       aem2_show_pcap_value, POWER_CAP_MIN_WARNING},
+{"power7_average",       aem2_show_pcap_value, POWER_CAP_MIN},
+
+{"power3_average",       aem2_show_pcap_value, POWER_AUX},
+{"power_cap",            aem2_show_pcap_value, POWER_CAP},
+{NULL,                    NULL,                 0},
+};
+
+static struct aem_rw_sensor_template aem2_rw_sensors[] = {
+{"power1_average_interval", aem_show_power_period, aem_set_power_period, 0},
+{"power2_average_interval", aem_show_power_period, aem_set_power_period, 1},
+{NULL,                     NULL,                  NULL,                 0},
+};
+
+/* Set up AEM1 sensor attrs */
+static int aem1_find_sensors(struct aem_data *data)
+{
+       return aem_register_sensors(data, aem1_ro_sensors, aem1_rw_sensors);
+}
+
+/* Set up AEM2 sensor attrs */
+static int aem2_find_sensors(struct aem_data *data)
+{
+       return aem_register_sensors(data, aem2_ro_sensors, aem2_rw_sensors);
+}
+
+/* Module init/exit routines */
+
+static int __init aem_init(void)
+{
+       int res;
+
+       res = driver_register(&aem_driver);
+       if (res) {
+               printk(KERN_ERR "Can't register aem driver\n");
+               return res;
+       }
+
+       res = ipmi_smi_watcher_register(&driver_data.bmc_events);
+       if (res)
+               goto ipmi_reg_err;
+       return 0;
+
+ipmi_reg_err:
+       driver_unregister(&aem_driver);
+       return res;
+
+}
+
+static void __exit aem_exit(void)
+{
+       struct aem_data *p1, *next1;
+
+       ipmi_smi_watcher_unregister(&driver_data.bmc_events);
+       driver_unregister(&aem_driver);
+       list_for_each_entry_safe(p1, next1, &driver_data.aem_devices, list)
+               aem_delete(p1);
+}
+
+MODULE_AUTHOR("Darrick J. Wong <djwong@us.ibm.com>");
+MODULE_DESCRIPTION("IBM Active Energy Manager power/temp sensor driver");
+MODULE_LICENSE("GPL");
+
+module_init(aem_init);
+module_exit(aem_exit);
index 34b0d4f..655ec7e 100644 (file)
@@ -648,13 +648,12 @@ static int ide_register_port(ide_hwif_t *hwif)
 
        get_device(&hwif->gendev);
 
-       hwif->portdev = device_create(ide_port_class, &hwif->gendev,
-                                     MKDEV(0, 0), hwif->name);
+       hwif->portdev = device_create_drvdata(ide_port_class, &hwif->gendev,
+                                             MKDEV(0, 0), hwif, hwif->name);
        if (IS_ERR(hwif->portdev)) {
                ret = PTR_ERR(hwif->portdev);
                device_unregister(&hwif->gendev);
        }
-       dev_set_drvdata(hwif->portdev, hwif);
 out:
        return ret;
 }
index 16b9d0a..a5ceff2 100644 (file)
@@ -1539,15 +1539,13 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb,
 
 static void sbp2_create_command_orb(struct sbp2_lu *lu,
                                    struct sbp2_command_info *cmd,
-                                   unchar *scsi_cmd,
-                                   unsigned int scsi_use_sg,
-                                   unsigned int scsi_request_bufflen,
-                                   struct scatterlist *sg,
-                                   enum dma_data_direction dma_dir)
+                                   struct scsi_cmnd *SCpnt)
 {
        struct sbp2_fwhost_info *hi = lu->hi;
        struct sbp2_command_orb *orb = &cmd->command_orb;
        u32 orb_direction;
+       unsigned int scsi_request_bufflen = scsi_bufflen(SCpnt);
+       enum dma_data_direction dma_dir = SCpnt->sc_data_direction;
 
        /*
         * Set-up our command ORB.
@@ -1580,13 +1578,14 @@ static void sbp2_create_command_orb(struct sbp2_lu *lu,
                orb->data_descriptor_lo = 0x0;
                orb->misc |= ORB_SET_DIRECTION(1);
        } else
-               sbp2_prep_command_orb_sg(orb, hi, cmd, scsi_use_sg, sg,
+               sbp2_prep_command_orb_sg(orb, hi, cmd, scsi_sg_count(SCpnt),
+                                        scsi_sglist(SCpnt),
                                         orb_direction, dma_dir);
 
        sbp2util_cpu_to_be32_buffer(orb, sizeof(*orb));
 
-       memset(orb->cdb, 0, 12);
-       memcpy(orb->cdb, scsi_cmd, COMMAND_SIZE(*scsi_cmd));
+       memset(orb->cdb, 0, sizeof(orb->cdb));
+       memcpy(orb->cdb, SCpnt->cmnd, SCpnt->cmd_len);
 }
 
 static void sbp2_link_orb_command(struct sbp2_lu *lu,
@@ -1669,16 +1668,13 @@ static void sbp2_link_orb_command(struct sbp2_lu *lu,
 static int sbp2_send_command(struct sbp2_lu *lu, struct scsi_cmnd *SCpnt,
                             void (*done)(struct scsi_cmnd *))
 {
-       unchar *scsi_cmd = (unchar *)SCpnt->cmnd;
        struct sbp2_command_info *cmd;
 
        cmd = sbp2util_allocate_command_orb(lu, SCpnt, done);
        if (!cmd)
                return -EIO;
 
-       sbp2_create_command_orb(lu, cmd, scsi_cmd, scsi_sg_count(SCpnt),
-                               scsi_bufflen(SCpnt), scsi_sglist(SCpnt),
-                               SCpnt->sc_data_direction);
+       sbp2_create_command_orb(lu, cmd, SCpnt);
        sbp2_link_orb_command(lu, cmd);
 
        return 0;
index fbe16d5..1adf2ef 100644 (file)
@@ -747,7 +747,9 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
                break;
        case IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED:
                kmem_cache_free(ib_mad_cache, mad_priv);
-               break;
+               kfree(local);
+               ret = 1;
+               goto out;
        case IB_MAD_RESULT_SUCCESS:
                /* Treat like an incoming receive MAD */
                port_priv = ib_get_mad_port(mad_agent_priv->agent.device,
index 3aa2db5..840ede9 100644 (file)
@@ -1005,8 +1005,9 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
        if (cdev_add(port->cdev, base_dev + port->dev_num, 1))
                goto err_cdev;
 
-       port->dev = device_create(umad_class, device->dma_device,
-                                 port->cdev->dev, "umad%d", port->dev_num);
+       port->dev = device_create_drvdata(umad_class, device->dma_device,
+                                         port->cdev->dev, port,
+                                         "umad%d", port->dev_num);
        if (IS_ERR(port->dev))
                goto err_cdev;
 
@@ -1024,15 +1025,12 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
        if (cdev_add(port->sm_cdev, base_dev + port->dev_num + IB_UMAD_MAX_PORTS, 1))
                goto err_sm_cdev;
 
-       port->sm_dev = device_create(umad_class, device->dma_device,
-                                    port->sm_cdev->dev,
-                                    "issm%d", port->dev_num);
+       port->sm_dev = device_create_drvdata(umad_class, device->dma_device,
+                                            port->sm_cdev->dev, port,
+                                            "issm%d", port->dev_num);
        if (IS_ERR(port->sm_dev))
                goto err_sm_cdev;
 
-       dev_set_drvdata(port->dev,    port);
-       dev_set_drvdata(port->sm_dev, port);
-
        if (device_create_file(port->sm_dev, &dev_attr_ibdev))
                goto err_sm_dev;
        if (device_create_file(port->sm_dev, &dev_attr_port))
index cc1afa2..f806da1 100644 (file)
@@ -755,14 +755,15 @@ static void ib_uverbs_add_one(struct ib_device *device)
        if (cdev_add(uverbs_dev->cdev, IB_UVERBS_BASE_DEV + uverbs_dev->devnum, 1))
                goto err_cdev;
 
-       uverbs_dev->dev = device_create(uverbs_class, device->dma_device,
-                                       uverbs_dev->cdev->dev,
-                                       "uverbs%d", uverbs_dev->devnum);
+       uverbs_dev->dev = device_create_drvdata(uverbs_class,
+                                               device->dma_device,
+                                               uverbs_dev->cdev->dev,
+                                               uverbs_dev,
+                                               "uverbs%d",
+                                               uverbs_dev->devnum);
        if (IS_ERR(uverbs_dev->dev))
                goto err_cdev;
 
-       dev_set_drvdata(uverbs_dev->dev, uverbs_dev);
-
        if (device_create_file(uverbs_dev->dev, &dev_attr_ibdev))
                goto err_class;
        if (device_create_file(uverbs_dev->dev, &dev_attr_abi_version))
index 79dbe5b..9926137 100644 (file)
@@ -229,7 +229,7 @@ int iwch_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
                      struct ib_send_wr **bad_wr)
 {
        int err = 0;
-       u8 t3_wr_flit_cnt;
+       u8 uninitialized_var(t3_wr_flit_cnt);
        enum t3_wr_opcode t3_wr_opcode = 0;
        enum t3_wr_flags t3_wr_flags;
        struct iwch_qp *qhp;
index 3697449..0a8c1b8 100644 (file)
@@ -345,7 +345,7 @@ resched:
         * state change
         */
        if (jiffies > dd->ipath_sdma_abort_jiffies) {
-               ipath_dbg("looping with status 0x%016llx\n",
+               ipath_dbg("looping with status 0x%08lx\n",
                          dd->ipath_sdma_status);
                dd->ipath_sdma_abort_jiffies = jiffies + 5 * HZ;
        }
@@ -615,7 +615,7 @@ void ipath_restart_sdma(struct ipath_devdata *dd)
        }
        spin_unlock_irqrestore(&dd->ipath_sdma_lock, flags);
        if (!needed) {
-               ipath_dbg("invalid attempt to restart SDMA, status 0x%016llx\n",
+               ipath_dbg("invalid attempt to restart SDMA, status 0x%08lx\n",
                        dd->ipath_sdma_status);
                goto bail;
        }
index 7fd18e8..0596ec1 100644 (file)
@@ -407,12 +407,11 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                        dev->n_pkt_drops++;
                        goto done;
                }
-               /* XXX Need to free SGEs */
+               wc.opcode = IB_WC_RECV;
        last_imm:
                ipath_copy_sge(&qp->r_sge, data, tlen);
                wc.wr_id = qp->r_wr_id;
                wc.status = IB_WC_SUCCESS;
-               wc.opcode = IB_WC_RECV;
                wc.qp = &qp->ibqp;
                wc.src_qp = qp->remote_qpn;
                wc.slid = qp->remote_ah_attr.dlid;
@@ -514,6 +513,7 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
                        goto done;
                }
                wc.byte_len = qp->r_len;
+               wc.opcode = IB_WC_RECV_RDMA_WITH_IMM;
                goto last_imm;
 
        case OP(RDMA_WRITE_LAST):
index 8e02ecf..a80df22 100644 (file)
@@ -333,6 +333,9 @@ static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
                cap->max_inline_data + sizeof (struct mlx4_wqe_inline_seg)) +
                send_wqe_overhead(type, qp->flags);
 
+       if (s > dev->dev->caps.max_sq_desc_sz)
+               return -EINVAL;
+
        /*
         * Hermon supports shrinking WQEs, such that a single work
         * request can include multiple units of 1 << wqe_shift.  This
@@ -372,9 +375,6 @@ static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
                qp->sq.wqe_shift = ilog2(roundup_pow_of_two(s));
 
        for (;;) {
-               if (1 << qp->sq.wqe_shift > dev->dev->caps.max_sq_desc_sz)
-                       return -EINVAL;
-
                qp->sq_max_wqes_per_wr = DIV_ROUND_UP(s, 1U << qp->sq.wqe_shift);
 
                /*
@@ -395,7 +395,8 @@ static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
                ++qp->sq.wqe_shift;
        }
 
-       qp->sq.max_gs = ((qp->sq_max_wqes_per_wr << qp->sq.wqe_shift) -
+       qp->sq.max_gs = (min(dev->dev->caps.max_sq_desc_sz,
+                            (qp->sq_max_wqes_per_wr << qp->sq.wqe_shift)) -
                         send_wqe_overhead(type, qp->flags)) /
                sizeof (struct mlx4_wqe_data_seg);
 
@@ -411,7 +412,9 @@ static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
 
        cap->max_send_wr  = qp->sq.max_post =
                (qp->sq.wqe_cnt - qp->sq_spare_wqes) / qp->sq_max_wqes_per_wr;
-       cap->max_send_sge = qp->sq.max_gs;
+       cap->max_send_sge = min(qp->sq.max_gs,
+                               min(dev->dev->caps.max_sq_sg,
+                                   dev->dev->caps.max_rq_sg));
        /* We don't support inline sends for kernel QPs (yet) */
        cap->max_inline_data = 0;
 
@@ -1457,7 +1460,7 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
        unsigned ind;
        int uninitialized_var(stamp);
        int uninitialized_var(size);
-       unsigned seglen;
+       unsigned uninitialized_var(seglen);
        int i;
 
        spin_lock_irqsave(&qp->sq.lock, flags);
index 9ebadd6..200cf13 100644 (file)
@@ -45,6 +45,7 @@
 #include "mthca_cmd.h"
 #include "mthca_profile.h"
 #include "mthca_memfree.h"
+#include "mthca_wqe.h"
 
 MODULE_AUTHOR("Roland Dreier");
 MODULE_DESCRIPTION("Mellanox InfiniBand HCA low-level driver");
@@ -200,7 +201,18 @@ static int mthca_dev_lim(struct mthca_dev *mdev, struct mthca_dev_lim *dev_lim)
        mdev->limits.gid_table_len      = dev_lim->max_gids;
        mdev->limits.pkey_table_len     = dev_lim->max_pkeys;
        mdev->limits.local_ca_ack_delay = dev_lim->local_ca_ack_delay;
-       mdev->limits.max_sg             = dev_lim->max_sg;
+       /*
+        * Need to allow for worst case send WQE overhead and check
+        * whether max_desc_sz imposes a lower limit than max_sg; UD
+        * send has the biggest overhead.
+        */
+       mdev->limits.max_sg             = min_t(int, dev_lim->max_sg,
+                                             (dev_lim->max_desc_sz -
+                                              sizeof (struct mthca_next_seg) -
+                                              (mthca_is_memfree(mdev) ?
+                                               sizeof (struct mthca_arbel_ud_seg) :
+                                               sizeof (struct mthca_tavor_ud_seg))) /
+                                               sizeof (struct mthca_data_seg));
        mdev->limits.max_wqes           = dev_lim->max_qp_sz;
        mdev->limits.max_qp_init_rdma   = dev_lim->max_requester_per_qp;
        mdev->limits.reserved_qps       = dev_lim->reserved_qps;
index d00a2c1..3f663fb 100644 (file)
@@ -194,7 +194,13 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
        /* Set the cached Q_Key before we attach if it's the broadcast group */
        if (!memcmp(mcast->mcmember.mgid.raw, priv->dev->broadcast + 4,
                    sizeof (union ib_gid))) {
+               spin_lock_irq(&priv->lock);
+               if (!priv->broadcast) {
+                       spin_unlock_irq(&priv->lock);
+                       return -EAGAIN;
+               }
                priv->qkey = be32_to_cpu(priv->broadcast->mcmember.qkey);
+               spin_unlock_irq(&priv->lock);
                priv->tx_wr.wr.ud.remote_qkey = priv->qkey;
        }
 
index a293e8b..8a77bfc 100644 (file)
@@ -183,4 +183,4 @@ module_exit(aaedkbd_exit);
 
 MODULE_AUTHOR("Nicolas Bellido Y Ortega");
 MODULE_DESCRIPTION("AAED-2000 Keyboard Driver");
-MODULE_LICENSE("GPLv2");
+MODULE_LICENSE("GPL v2");
index 29fbec6..1aa46ae 100644 (file)
@@ -412,5 +412,5 @@ module_exit(corgikbd_exit);
 
 MODULE_AUTHOR("Richard Purdie <rpurdie@rpsys.net>");
 MODULE_DESCRIPTION("Corgi Keyboard Driver");
-MODULE_LICENSE("GPLv2");
+MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:corgi-keyboard");
index 9387da3..781fc61 100644 (file)
@@ -275,5 +275,5 @@ module_exit(jornada680kbd_exit);
 
 MODULE_AUTHOR("Kristoffer Ericson <kristoffer.ericson@gmail.com>");
 MODULE_DESCRIPTION("HP Jornada 620/660/680/690 Keyboard Driver");
-MODULE_LICENSE("GPLv2");
+MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:jornada680_kbd");
index a1164a0..ce650af 100644 (file)
@@ -29,7 +29,7 @@
 
 MODULE_AUTHOR("Kristoffer Ericson <Kristoffer.Ericson@gmail.com>");
 MODULE_DESCRIPTION("HP Jornada 710/720/728 keyboard driver");
-MODULE_LICENSE("GPLv2");
+MODULE_LICENSE("GPL v2");
 
 static unsigned short jornada_std_keymap[128] = {                                      /* ROW */
        0, KEY_ESC, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7,             /* #1  */
index 61e401b..1aa3718 100644 (file)
@@ -494,5 +494,5 @@ module_exit(spitzkbd_exit);
 
 MODULE_AUTHOR("Richard Purdie <rpurdie@rpsys.net>");
 MODULE_DESCRIPTION("Spitz Keyboard Driver");
-MODULE_LICENSE("GPLv2");
+MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:spitz-keyboard");
index 7422421..1aca108 100644 (file)
@@ -24,7 +24,7 @@
 
 MODULE_AUTHOR("Kristoffer Ericson <kristoffer.ericson@gmail.com>");
 MODULE_DESCRIPTION("HP Jornada 710/720/728 touchscreen driver");
-MODULE_LICENSE("GPLv2");
+MODULE_LICENSE("GPL v2");
 
 struct jornada_ts {
        struct input_dev *dev;
index ebef4ce..29419a8 100644 (file)
@@ -948,17 +948,17 @@ int __init cdebug_init(void)
 {
        g_cmsg= kmalloc(sizeof(_cmsg), GFP_KERNEL);
        if (!g_cmsg)
-               return ENOMEM;
+               return -ENOMEM;
        g_debbuf = kmalloc(sizeof(_cdebbuf), GFP_KERNEL);
        if (!g_debbuf) {
                kfree(g_cmsg);
-               return ENOMEM;
+               return -ENOMEM;
        }
        g_debbuf->buf = kmalloc(CDEBUG_GSIZE, GFP_KERNEL);
        if (!g_debbuf->buf) {
                kfree(g_cmsg);
                kfree(g_debbuf);
-               return ENOMEM;;
+               return -ENOMEM;;
        }
        g_debbuf->size = CDEBUG_GSIZE;
        g_debbuf->buf[0] = 0;
index c6d8a70..c9e4231 100644 (file)
@@ -3,7 +3,7 @@
 #
 config HYSDN
        tristate "Hypercope HYSDN cards (Champ, Ergo, Metro) support (module only)"
-       depends on m && PROC_FS && PCI && BROKEN_ON_SMP
+       depends on m && PROC_FS && PCI
        help
          Say Y here if you have one of Hypercope's active PCI ISDN cards
          Champ, Ergo and Metro. You will then get a module called hysdn.
index 6cdbad3..3eb096f 100644 (file)
@@ -64,10 +64,11 @@ ergo_interrupt(int intno, void *dev_id)
 }                              /* ergo_interrupt */
 
 /******************************************************************************/
-/* ergo_irq_bh is the function called by the immediate kernel task list after */
-/* being activated with queue_task and no interrupts active. This task is the */
-/* only one handling data transfer from or to the card after booting. The task */
-/* may be queued from everywhere (interrupts included).                       */
+/* ergo_irq_bh will be called as part of the kernel clearing its shared work  */
+/* queue sometime after a call to schedule_work has been made passing our     */
+/* work_struct. This task is the only one handling data transfer from or to   */
+/* the card after booting. The task may be queued from everywhere             */
+/* (interrupts included).                                                     */
 /******************************************************************************/
 static void
 ergo_irq_bh(struct work_struct *ugli_api)
@@ -90,7 +91,6 @@ ergo_irq_bh(struct work_struct *ugli_api)
        card->hw_lock = 1;      /* we now lock the hardware */
 
        do {
-               sti();          /* reenable other ints */
                again = 0;      /* assume loop not to be repeated */
 
                if (!dpr->ToHyFlag) {
@@ -110,7 +110,6 @@ ergo_irq_bh(struct work_struct *ugli_api)
                                again = 1;      /* restart loop */
                        }
                }               /* a message has arrived for us */
-               cli();          /* no further ints */
                if (again) {
                        dpr->ToHyInt = 1;
                        dpr->ToPcInt = 1;       /* interrupt to E1 for all cards */
@@ -242,7 +241,6 @@ ergo_writebootimg(struct HYSDN_CARD *card, unsigned char *buf,
                byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RUN);        /* start E1 processor */
                /* the interrupts are still masked */
 
-               sti();
                msleep_interruptible(20);               /* Timeout 20ms */
 
                if (((tDpramBootSpooler *) card->dpram)->Len != DPRAM_SPOOLER_DATA_SIZE) {
@@ -276,7 +274,6 @@ ergo_writebootseq(struct HYSDN_CARD *card, unsigned char *buf, int len)
        dst = sp->Data;         /* point to data in spool structure */
        buflen = sp->Len;       /* maximum len of spooled data */
        wr_mirror = sp->WrPtr;  /* only once read */
-       sti();
 
        /* try until all bytes written or error */
        i = 0x1000;             /* timeout value */
@@ -380,7 +377,6 @@ ergo_waitpofready(struct HYSDN_CARD *card)
 #endif /* CONFIG_HYSDN_CAPI */
                        return (0);     /* success */
                }               /* data has arrived */
-               sti();
                msleep_interruptible(50);               /* Timeout 50ms */
        }                       /* wait until timeout */
 
index d3999a8..53f6ad1 100644 (file)
@@ -462,11 +462,11 @@ static int hycapi_read_proc(char *page, char **start, off_t off,
                default: s = "???"; break;
        }
        len += sprintf(page+len, "%-16s %s\n", "type", s);
-       if ((s = cinfo->version[VER_DRIVER]) != 0)
+       if ((s = cinfo->version[VER_DRIVER]) != NULL)
                len += sprintf(page+len, "%-16s %s\n", "ver_driver", s);
-       if ((s = cinfo->version[VER_CARDTYPE]) != 0)
+       if ((s = cinfo->version[VER_CARDTYPE]) != NULL)
                len += sprintf(page+len, "%-16s %s\n", "ver_cardtype", s);
-       if ((s = cinfo->version[VER_SERIAL]) != 0)
+       if ((s = cinfo->version[VER_SERIAL]) != NULL)
                len += sprintf(page+len, "%-16s %s\n", "ver_serial", s);
     
        len += sprintf(page+len, "%-16s %s\n", "cardname", cinfo->cardname);
index b3c54be..559a408 100644 (file)
@@ -103,13 +103,11 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
 {
        int rc;
 
-       led_cdev->dev = device_create(leds_class, parent, 0, "%s",
-                                           led_cdev->name);
+       led_cdev->dev = device_create_drvdata(leds_class, parent, 0, led_cdev,
+                                             "%s", led_cdev->name);
        if (IS_ERR(led_cdev->dev))
                return PTR_ERR(led_cdev->dev);
 
-       dev_set_drvdata(led_cdev->dev, led_cdev);
-
        /* register the attributes */
        rc = device_create_file(led_cdev->dev, &dev_attr_brightness);
        if (rc)
index c14dacd..b26927c 100644 (file)
@@ -203,17 +203,6 @@ static void bitmap_checkfree(struct bitmap *bitmap, unsigned long page)
  * bitmap file handling - read and write the bitmap file and its superblock
  */
 
-/* copy the pathname of a file to a buffer */
-char *file_path(struct file *file, char *buf, int count)
-{
-       if (!buf)
-               return NULL;
-
-       buf = d_path(&file->f_path, buf, count);
-
-       return IS_ERR(buf) ? NULL : buf;
-}
-
 /*
  * basic page I/O operations
  */
@@ -721,11 +710,13 @@ static void bitmap_file_kick(struct bitmap *bitmap)
                if (bitmap->file) {
                        path = kmalloc(PAGE_SIZE, GFP_KERNEL);
                        if (path)
-                               ptr = file_path(bitmap->file, path, PAGE_SIZE);
+                               ptr = d_path(&bitmap->file->f_path, path,
+                                            PAGE_SIZE);
+
 
                        printk(KERN_ALERT
                              "%s: kicking failed bitmap file %s from array!\n",
-                             bmname(bitmap), ptr ? ptr : "");
+                             bmname(bitmap), IS_ERR(ptr) ? "" : ptr);
 
                        kfree(path);
                } else
index 83eb78b..51c19f8 100644 (file)
@@ -74,6 +74,8 @@ static DEFINE_SPINLOCK(pers_lock);
 
 static void md_print_devices(void);
 
+static DECLARE_WAIT_QUEUE_HEAD(resync_wait);
+
 #define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); }
 
 /*
@@ -3013,6 +3015,36 @@ degraded_show(mddev_t *mddev, char *page)
 static struct md_sysfs_entry md_degraded = __ATTR_RO(degraded);
 
 static ssize_t
+sync_force_parallel_show(mddev_t *mddev, char *page)
+{
+       return sprintf(page, "%d\n", mddev->parallel_resync);
+}
+
+static ssize_t
+sync_force_parallel_store(mddev_t *mddev, const char *buf, size_t len)
+{
+       long n;
+
+       if (strict_strtol(buf, 10, &n))
+               return -EINVAL;
+
+       if (n != 0 && n != 1)
+               return -EINVAL;
+
+       mddev->parallel_resync = n;
+
+       if (mddev->sync_thread)
+               wake_up(&resync_wait);
+
+       return len;
+}
+
+/* force parallel resync, even with shared block devices */
+static struct md_sysfs_entry md_sync_force_parallel =
+__ATTR(sync_force_parallel, S_IRUGO|S_IWUSR,
+       sync_force_parallel_show, sync_force_parallel_store);
+
+static ssize_t
 sync_speed_show(mddev_t *mddev, char *page)
 {
        unsigned long resync, dt, db;
@@ -3187,6 +3219,7 @@ static struct attribute *md_redundancy_attrs[] = {
        &md_sync_min.attr,
        &md_sync_max.attr,
        &md_sync_speed.attr,
+       &md_sync_force_parallel.attr,
        &md_sync_completed.attr,
        &md_max_sync.attr,
        &md_suspend_lo.attr,
@@ -3691,6 +3724,8 @@ static int do_md_stop(mddev_t * mddev, int mode)
 
                        module_put(mddev->pers->owner);
                        mddev->pers = NULL;
+                       /* tell userspace to handle 'inactive' */
+                       sysfs_notify(&mddev->kobj, NULL, "array_state");
 
                        set_capacity(disk, 0);
                        mddev->changed = 1;
@@ -3987,8 +4022,8 @@ static int get_bitmap_file(mddev_t * mddev, void __user * arg)
        if (!buf)
                goto out;
 
-       ptr = file_path(mddev->bitmap->file, buf, sizeof(file->pathname));
-       if (!ptr)
+       ptr = d_path(&mddev->bitmap->file->f_path, buf, sizeof(file->pathname));
+       if (IS_ERR(ptr))
                goto out;
 
        strcpy(file->pathname, ptr);
@@ -5399,7 +5434,7 @@ void md_done_sync(mddev_t *mddev, int blocks, int ok)
        atomic_sub(blocks, &mddev->recovery_active);
        wake_up(&mddev->recovery_wait);
        if (!ok) {
-               set_bit(MD_RECOVERY_ERR, &mddev->recovery);
+               set_bit(MD_RECOVERY_INTR, &mddev->recovery);
                md_wakeup_thread(mddev->thread);
                // stop recovery, signal do_sync ....
        }
@@ -5435,8 +5470,11 @@ void md_write_start(mddev_t *mddev, struct bio *bi)
                        md_wakeup_thread(mddev->thread);
                }
                spin_unlock_irq(&mddev->write_lock);
+               sysfs_notify(&mddev->kobj, NULL, "array_state");
        }
-       wait_event(mddev->sb_wait, mddev->flags==0);
+       wait_event(mddev->sb_wait,
+                  !test_bit(MD_CHANGE_CLEAN, &mddev->flags) &&
+                  !test_bit(MD_CHANGE_PENDING, &mddev->flags));
 }
 
 void md_write_end(mddev_t *mddev)
@@ -5471,13 +5509,17 @@ void md_allow_write(mddev_t *mddev)
                        mddev->safemode = 1;
                spin_unlock_irq(&mddev->write_lock);
                md_update_sb(mddev, 0);
+
+               sysfs_notify(&mddev->kobj, NULL, "array_state");
+               /* wait for the dirty state to be recorded in the metadata */
+               wait_event(mddev->sb_wait,
+                          !test_bit(MD_CHANGE_CLEAN, &mddev->flags) &&
+                          !test_bit(MD_CHANGE_PENDING, &mddev->flags));
        } else
                spin_unlock_irq(&mddev->write_lock);
 }
 EXPORT_SYMBOL_GPL(md_allow_write);
 
-static DECLARE_WAIT_QUEUE_HEAD(resync_wait);
-
 #define SYNC_MARKS     10
 #define        SYNC_MARK_STEP  (3*HZ)
 void md_do_sync(mddev_t *mddev)
@@ -5541,8 +5583,9 @@ void md_do_sync(mddev_t *mddev)
                for_each_mddev(mddev2, tmp) {
                        if (mddev2 == mddev)
                                continue;
-                       if (mddev2->curr_resync && 
-                           match_mddev_units(mddev,mddev2)) {
+                       if (!mddev->parallel_resync
+                       &&  mddev2->curr_resync
+                       &&  match_mddev_units(mddev, mddev2)) {
                                DEFINE_WAIT(wq);
                                if (mddev < mddev2 && mddev->curr_resync == 2) {
                                        /* arbitrarily yield */
@@ -5647,7 +5690,7 @@ void md_do_sync(mddev_t *mddev)
                sectors = mddev->pers->sync_request(mddev, j, &skipped,
                                                  currspeed < speed_min(mddev));
                if (sectors == 0) {
-                       set_bit(MD_RECOVERY_ERR, &mddev->recovery);
+                       set_bit(MD_RECOVERY_INTR, &mddev->recovery);
                        goto out;
                }
 
@@ -5670,8 +5713,7 @@ void md_do_sync(mddev_t *mddev)
 
                last_check = io_sectors;
 
-               if (test_bit(MD_RECOVERY_INTR, &mddev->recovery) ||
-                   test_bit(MD_RECOVERY_ERR, &mddev->recovery))
+               if (test_bit(MD_RECOVERY_INTR, &mddev->recovery))
                        break;
 
        repeat:
@@ -5725,8 +5767,7 @@ void md_do_sync(mddev_t *mddev)
        /* tell personality that we are finished */
        mddev->pers->sync_request(mddev, max_sectors, &skipped, 1);
 
-       if (!test_bit(MD_RECOVERY_ERR, &mddev->recovery) &&
-           !test_bit(MD_RECOVERY_CHECK, &mddev->recovery) &&
+       if (!test_bit(MD_RECOVERY_CHECK, &mddev->recovery) &&
            mddev->curr_resync > 2) {
                if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
                        if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
@@ -5795,7 +5836,10 @@ static int remove_and_add_spares(mddev_t *mddev)
                }
 
        if (mddev->degraded) {
-               rdev_for_each(rdev, rtmp, mddev)
+               rdev_for_each(rdev, rtmp, mddev) {
+                       if (rdev->raid_disk >= 0 &&
+                           !test_bit(In_sync, &rdev->flags))
+                               spares++;
                        if (rdev->raid_disk < 0
                            && !test_bit(Faulty, &rdev->flags)) {
                                rdev->recovery_offset = 0;
@@ -5813,6 +5857,7 @@ static int remove_and_add_spares(mddev_t *mddev)
                                } else
                                        break;
                        }
+               }
        }
        return spares;
 }
@@ -5826,7 +5871,7 @@ static int remove_and_add_spares(mddev_t *mddev)
  * to do that as needed.
  * When it is determined that resync is needed, we set MD_RECOVERY_RUNNING in
  * "->recovery" and create a thread at ->sync_thread.
- * When the thread finishes it sets MD_RECOVERY_DONE (and might set MD_RECOVERY_ERR)
+ * When the thread finishes it sets MD_RECOVERY_DONE
  * and wakeups up this thread which will reap the thread and finish up.
  * This thread also removes any faulty devices (with nr_pending == 0).
  *
@@ -5901,8 +5946,7 @@ void md_check_recovery(mddev_t *mddev)
                        /* resync has finished, collect result */
                        md_unregister_thread(mddev->sync_thread);
                        mddev->sync_thread = NULL;
-                       if (!test_bit(MD_RECOVERY_ERR, &mddev->recovery) &&
-                           !test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
+                       if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
                                /* success...*/
                                /* activate any spares */
                                mddev->pers->spare_active(mddev);
@@ -5926,7 +5970,6 @@ void md_check_recovery(mddev_t *mddev)
                 * might be left set
                 */
                clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
-               clear_bit(MD_RECOVERY_ERR, &mddev->recovery);
                clear_bit(MD_RECOVERY_INTR, &mddev->recovery);
                clear_bit(MD_RECOVERY_DONE, &mddev->recovery);
 
index 4f4d1f3..e968116 100644 (file)
@@ -327,7 +327,8 @@ static int multipath_remove_disk(mddev_t *mddev, int number)
        if (rdev) {
                if (test_bit(In_sync, &rdev->flags) ||
                    atomic_read(&rdev->nr_pending)) {
-                       printk(KERN_ERR "hot-remove-disk, slot %d is identified"                                " but is still operational!\n", number);
+                       printk(KERN_ERR "hot-remove-disk, slot %d is identified"
+                              " but is still operational!\n", number);
                        err = -EBUSY;
                        goto abort;
                }
index ac409b7..c610b94 100644 (file)
@@ -773,7 +773,7 @@ static int make_request(struct request_queue *q, struct bio * bio)
        r1bio_t *r1_bio;
        struct bio *read_bio;
        int i, targets = 0, disks;
-       struct bitmap *bitmap = mddev->bitmap;
+       struct bitmap *bitmap;
        unsigned long flags;
        struct bio_list bl;
        struct page **behind_pages = NULL;
@@ -802,6 +802,8 @@ static int make_request(struct request_queue *q, struct bio * bio)
 
        wait_barrier(conf);
 
+       bitmap = mddev->bitmap;
+
        disk_stat_inc(mddev->gendisk, ios[rw]);
        disk_stat_add(mddev->gendisk, sectors[rw], bio_sectors(bio));
 
@@ -1025,7 +1027,7 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
                /*
                 * if recovery is running, make sure it aborts.
                 */
-               set_bit(MD_RECOVERY_ERR, &mddev->recovery);
+               set_bit(MD_RECOVERY_INTR, &mddev->recovery);
        } else
                set_bit(Faulty, &rdev->flags);
        set_bit(MD_CHANGE_DEVS, &mddev->flags);
@@ -1146,6 +1148,14 @@ static int raid1_remove_disk(mddev_t *mddev, int number)
                        err = -EBUSY;
                        goto abort;
                }
+               /* Only remove non-faulty devices is recovery
+                * is not possible.
+                */
+               if (!test_bit(Faulty, &rdev->flags) &&
+                   mddev->degraded < conf->raid_disks) {
+                       err = -EBUSY;
+                       goto abort;
+               }
                p->rdev = NULL;
                synchronize_rcu();
                if (atomic_read(&rdev->nr_pending)) {
@@ -1282,6 +1292,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
                                        rdev_dec_pending(conf->mirrors[i].rdev, mddev);
                                } else {
                                        /* fixup the bio for reuse */
+                                       int size;
                                        sbio->bi_vcnt = vcnt;
                                        sbio->bi_size = r1_bio->sectors << 9;
                                        sbio->bi_idx = 0;
@@ -1295,10 +1306,20 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
                                        sbio->bi_sector = r1_bio->sector +
                                                conf->mirrors[i].rdev->data_offset;
                                        sbio->bi_bdev = conf->mirrors[i].rdev->bdev;
-                                       for (j = 0; j < vcnt ; j++)
-                                               memcpy(page_address(sbio->bi_io_vec[j].bv_page),
+                                       size = sbio->bi_size;
+                                       for (j = 0; j < vcnt ; j++) {
+                                               struct bio_vec *bi;
+                                               bi = &sbio->bi_io_vec[j];
+                                               bi->bv_offset = 0;
+                                               if (size > PAGE_SIZE)
+                                                       bi->bv_len = PAGE_SIZE;
+                                               else
+                                                       bi->bv_len = size;
+                                               size -= PAGE_SIZE;
+                                               memcpy(page_address(bi->bv_page),
                                                       page_address(pbio->bi_io_vec[j].bv_page),
                                                       PAGE_SIZE);
+                                       }
 
                                }
                        }
index 8536ede..1de17da 100644 (file)
@@ -1020,7 +1020,7 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
                /*
                 * if recovery is running, make sure it aborts.
                 */
-               set_bit(MD_RECOVERY_ERR, &mddev->recovery);
+               set_bit(MD_RECOVERY_INTR, &mddev->recovery);
        }
        set_bit(Faulty, &rdev->flags);
        set_bit(MD_CHANGE_DEVS, &mddev->flags);
@@ -1171,6 +1171,14 @@ static int raid10_remove_disk(mddev_t *mddev, int number)
                        err = -EBUSY;
                        goto abort;
                }
+               /* Only remove faulty devices in recovery
+                * is not possible.
+                */
+               if (!test_bit(Faulty, &rdev->flags) &&
+                   enough(conf)) {
+                       err = -EBUSY;
+                       goto abort;
+               }
                p->rdev = NULL;
                synchronize_rcu();
                if (atomic_read(&rdev->nr_pending)) {
@@ -1237,6 +1245,7 @@ static void end_sync_write(struct bio *bio, int error)
 
        if (!uptodate)
                md_error(mddev, conf->mirrors[d].rdev);
+
        update_head_pos(i, r10_bio);
 
        while (atomic_dec_and_test(&r10_bio->remaining)) {
@@ -1844,7 +1853,8 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
                                        if (rb2)
                                                atomic_dec(&rb2->remaining);
                                        r10_bio = rb2;
-                                       if (!test_and_set_bit(MD_RECOVERY_ERR, &mddev->recovery))
+                                       if (!test_and_set_bit(MD_RECOVERY_INTR,
+                                                             &mddev->recovery))
                                                printk(KERN_INFO "raid10: %s: insufficient working devices for recovery.\n",
                                                       mdname(mddev));
                                        break;
index 93fde48..425958a 100644 (file)
@@ -94,6 +94,8 @@
 #define __inline__
 #endif
 
+#define printk_rl(args...) ((void) (printk_ratelimit() && printk(args)))
+
 #if !RAID6_USE_EMPTY_ZERO_PAGE
 /* In .bss so it's zeroed */
 const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(256)));
@@ -1143,10 +1145,12 @@ static void raid5_end_read_request(struct bio * bi, int error)
                set_bit(R5_UPTODATE, &sh->dev[i].flags);
                if (test_bit(R5_ReadError, &sh->dev[i].flags)) {
                        rdev = conf->disks[i].rdev;
-                       printk(KERN_INFO "raid5:%s: read error corrected (%lu sectors at %llu on %s)\n",
-                              mdname(conf->mddev), STRIPE_SECTORS,
-                              (unsigned long long)(sh->sector + rdev->data_offset),
-                              bdevname(rdev->bdev, b));
+                       printk_rl(KERN_INFO "raid5:%s: read error corrected"
+                                 " (%lu sectors at %llu on %s)\n",
+                                 mdname(conf->mddev), STRIPE_SECTORS,
+                                 (unsigned long long)(sh->sector
+                                                      + rdev->data_offset),
+                                 bdevname(rdev->bdev, b));
                        clear_bit(R5_ReadError, &sh->dev[i].flags);
                        clear_bit(R5_ReWrite, &sh->dev[i].flags);
                }
@@ -1160,16 +1164,22 @@ static void raid5_end_read_request(struct bio * bi, int error)
                clear_bit(R5_UPTODATE, &sh->dev[i].flags);
                atomic_inc(&rdev->read_errors);
                if (conf->mddev->degraded)
-                       printk(KERN_WARNING "raid5:%s: read error not correctable (sector %llu on %s).\n",
-                              mdname(conf->mddev),
-                              (unsigned long long)(sh->sector + rdev->data_offset),
-                              bdn);
+                       printk_rl(KERN_WARNING
+                                 "raid5:%s: read error not correctable "
+                                 "(sector %llu on %s).\n",
+                                 mdname(conf->mddev),
+                                 (unsigned long long)(sh->sector
+                                                      + rdev->data_offset),
+                                 bdn);
                else if (test_bit(R5_ReWrite, &sh->dev[i].flags))
                        /* Oh, no!!! */
-                       printk(KERN_WARNING "raid5:%s: read error NOT corrected!! (sector %llu on %s).\n",
-                              mdname(conf->mddev),
-                              (unsigned long long)(sh->sector + rdev->data_offset),
-                              bdn);
+                       printk_rl(KERN_WARNING
+                                 "raid5:%s: read error NOT corrected!! "
+                                 "(sector %llu on %s).\n",
+                                 mdname(conf->mddev),
+                                 (unsigned long long)(sh->sector
+                                                      + rdev->data_offset),
+                                 bdn);
                else if (atomic_read(&rdev->read_errors)
                         > conf->max_nr_stripes)
                        printk(KERN_WARNING
@@ -1258,7 +1268,7 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
                        /*
                         * if recovery was running, make sure it aborts.
                         */
-                       set_bit(MD_RECOVERY_ERR, &mddev->recovery);
+                       set_bit(MD_RECOVERY_INTR, &mddev->recovery);
                }
                set_bit(Faulty, &rdev->flags);
                printk (KERN_ALERT
@@ -4564,6 +4574,14 @@ static int raid5_remove_disk(mddev_t *mddev, int number)
                        err = -EBUSY;
                        goto abort;
                }
+               /* Only remove non-faulty devices if recovery
+                * isn't possible.
+                */
+               if (!test_bit(Faulty, &rdev->flags) &&
+                   mddev->degraded <= conf->max_degraded) {
+                       err = -EBUSY;
+                       goto abort;
+               }
                p->rdev = NULL;
                synchronize_rcu();
                if (atomic_read(&rdev->nr_pending)) {
index 89d8d37..3b26fbd 100644 (file)
@@ -901,7 +901,7 @@ endif # V4L_USB_DRIVERS
 
 config SOC_CAMERA
        tristate "SoC camera support"
-       depends on VIDEO_V4L2
+       depends on VIDEO_V4L2 && HAS_DMA
        select VIDEOBUF_DMA_SG
        help
          SoC Camera is a common API to several cameras, not connecting
index 2ca3e9c..0165aac 100644 (file)
@@ -2613,7 +2613,7 @@ static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
        struct bttv_fh *fh = priv;
 
        mutex_lock(&fh->cap.vb_lock);
-       retval = videobuf_mmap_setup(&fh->cap, gbuffers, gbufsize,
+       retval = __videobuf_mmap_setup(&fh->cap, gbuffers, gbufsize,
                                     V4L2_MEMORY_MMAP);
        if (retval < 0) {
                mutex_unlock(&fh->cap.vb_lock);
index 982f446..0a88c44 100644 (file)
@@ -331,7 +331,7 @@ int videobuf_mmap_free(struct videobuf_queue *q)
 }
 
 /* Locking: Caller holds q->vb_lock */
-static int __videobuf_mmap_setup(struct videobuf_queue *q,
+int __videobuf_mmap_setup(struct videobuf_queue *q,
                        unsigned int bcount, unsigned int bsize,
                        enum v4l2_memory memory)
 {
@@ -1129,6 +1129,7 @@ EXPORT_SYMBOL_GPL(videobuf_read_stream);
 EXPORT_SYMBOL_GPL(videobuf_read_one);
 EXPORT_SYMBOL_GPL(videobuf_poll_stream);
 
+EXPORT_SYMBOL_GPL(__videobuf_mmap_setup);
 EXPORT_SYMBOL_GPL(videobuf_mmap_setup);
 EXPORT_SYMBOL_GPL(videobuf_mmap_free);
 EXPORT_SYMBOL_GPL(videobuf_mmap_mapper);
index 2566479..ae96bd6 100644 (file)
@@ -24,7 +24,7 @@ config MFD_ASIC3
 
 config HTC_EGPIO
        bool "HTC EGPIO support"
-       depends on GENERIC_HARDIRQS && HAVE_GPIO_LIB
+       depends on GENERIC_HARDIRQS && HAVE_GPIO_LIB && ARM
        help
            This driver supports the CPLD egpio chip present on
            several HTC phones.  It provides basic support for input
index 3b3cd0e..dead617 100644 (file)
@@ -119,7 +119,7 @@ config MMC_TIFM_SD
 
 config MMC_SPI
        tristate "MMC/SD over SPI"
-       depends on MMC && SPI_MASTER && !HIGHMEM
+       depends on MMC && SPI_MASTER && !HIGHMEM && HAS_DMA
        select CRC7
        select CRC_ITU_T
        help
index e6c545f..b9d097c 100644 (file)
@@ -413,7 +413,7 @@ static int __devinit el3_pnp_probe(struct pnp_dev *pdev,
 {
        short i;
        int ioaddr, irq, if_port;
-       u16 phys_addr[3];
+       __be16 phys_addr[3];
        struct net_device *dev = NULL;
        int err;
 
@@ -605,7 +605,7 @@ static int __init el3_mca_probe(struct device *device)
 
        short i;
        int ioaddr, irq, if_port;
-       u16 phys_addr[3];
+       __be16 phys_addr[3];
        struct net_device *dev = NULL;
        u_char pos4, pos5;
        struct mca_device *mdev = to_mca_device(device);
@@ -635,14 +635,13 @@ static int __init el3_mca_probe(struct device *device)
                        printk(KERN_DEBUG "3c529: irq %d  ioaddr 0x%x  ifport %d\n", irq, ioaddr, if_port);
        }
        EL3WINDOW(0);
-       for (i = 0; i < 3; i++) {
-                       phys_addr[i] = htons(read_eeprom(ioaddr, i));
-       }
+       for (i = 0; i < 3; i++)
+               phys_addr[i] = htons(read_eeprom(ioaddr, i));
 
        dev = alloc_etherdev(sizeof (struct el3_private));
        if (dev == NULL) {
-                       release_region(ioaddr, EL3_IO_EXTENT);
-                       return -ENOMEM;
+               release_region(ioaddr, EL3_IO_EXTENT);
+               return -ENOMEM;
        }
 
        netdev_boot_setup_check(dev);
@@ -668,7 +667,7 @@ static int __init el3_eisa_probe (struct device *device)
 {
        short i;
        int ioaddr, irq, if_port;
-       u16 phys_addr[3];
+       __be16 phys_addr[3];
        struct net_device *dev = NULL;
        struct eisa_device *edev;
        int err;
@@ -1063,7 +1062,6 @@ el3_rx(struct net_device *dev)
                        struct sk_buff *skb;
 
                        skb = dev_alloc_skb(pkt_len+5);
-                       dev->stats.rx_bytes += pkt_len;
                        if (el3_debug > 4)
                                printk("Receiving packet size %d status %4.4x.\n",
                                           pkt_len, rx_status);
@@ -1078,6 +1076,7 @@ el3_rx(struct net_device *dev)
                                skb->protocol = eth_type_trans(skb,dev);
                                netif_rx(skb);
                                dev->last_rx = jiffies;
+                               dev->stats.rx_bytes += pkt_len;
                                dev->stats.rx_packets++;
                                continue;
                        }
index 9f6cc8a..dd0ec9e 100644 (file)
@@ -1353,7 +1353,7 @@ config APRICOT
 
 config B44
        tristate "Broadcom 440x/47xx ethernet support"
-       depends on SSB_POSSIBLE
+       depends on SSB_POSSIBLE && HAS_DMA
        select SSB
        select MII
        help
index 9c2394d..6e4c80d 100644 (file)
@@ -2135,7 +2135,7 @@ static int atl1_tso(struct atl1_adapter *adapter, struct sk_buff *skb,
                                return -1;
                }
 
-               if (skb->protocol == ntohs(ETH_P_IP)) {
+               if (skb->protocol == htons(ETH_P_IP)) {
                        struct iphdr *iph = ip_hdr(skb);
 
                        real_len = (((unsigned char *)iph - skb->data) +
index 3634b5f..7023d77 100644 (file)
@@ -1239,12 +1239,7 @@ static int au1000_rx(struct net_device *dev)
  */
 static irqreturn_t au1000_interrupt(int irq, void *dev_id)
 {
-       struct net_device *dev = (struct net_device *) dev_id;
-
-       if (dev == NULL) {
-               printk(KERN_ERR "%s: isr: null dev ptr\n", dev->name);
-               return IRQ_RETVAL(1);
-       }
+       struct net_device *dev = dev_id;
 
        /* Handle RX interrupts first to minimize chance of overrun */
 
index 89c0018..4144343 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/crc32.h>
 #include <linux/device.h>
 #include <linux/spinlock.h>
-#include <linux/ethtool.h>
 #include <linux/mii.h>
 #include <linux/phy.h>
 #include <linux/netdevice.h>
index 68c41a0..08f3d39 100644 (file)
@@ -1437,8 +1437,16 @@ int bond_create_sysfs(void)
         * configure multiple bonding devices.
         */
        if (ret == -EEXIST) {
-               netdev_class = NULL;
-               return 0;
+               /* Is someone being kinky and naming a device bonding_master? */
+               if (__dev_get_by_name(&init_net,
+                                     class_attr_bonding_masters.attr.name))
+                       printk(KERN_ERR
+                              "network device named %s already exists in sysfs",
+                              class_attr_bonding_masters.attr.name);
+               else {
+                       netdev_class = NULL;
+                       return 0;
+               }
        }
 
        return ret;
index 93e1363..83768df 100644 (file)
 
 #define DRV_MODULE_NAME                "cassini"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "1.5"
-#define DRV_MODULE_RELDATE     "4 Jan 2008"
+#define DRV_MODULE_VERSION     "1.6"
+#define DRV_MODULE_RELDATE     "21 May 2008"
 
 #define CAS_DEF_MSG_ENABLE       \
        (NETIF_MSG_DRV          | \
@@ -2136,9 +2136,12 @@ end_copy_pkt:
                if (addr)
                        cas_page_unmap(addr);
        }
-       skb->csum = csum_unfold(~csum);
-       skb->ip_summed = CHECKSUM_COMPLETE;
        skb->protocol = eth_type_trans(skb, cp->dev);
+       if (skb->protocol == htons(ETH_P_IP)) {
+               skb->csum = csum_unfold(~csum);
+               skb->ip_summed = CHECKSUM_COMPLETE;
+       } else
+               skb->ip_summed = CHECKSUM_NONE;
        return len;
 }
 
index 2b5740b..7f3f62e 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <asm/gpio.h>
+#include <asm/atomic.h>
 
 MODULE_AUTHOR("Eugene Konev <ejka@imfi.kspu.ru>");
 MODULE_DESCRIPTION("TI AR7 ethernet driver (CPMAC)");
@@ -187,6 +188,7 @@ struct cpmac_desc {
 #define CPMAC_EOQ                      0x1000
        struct sk_buff *skb;
        struct cpmac_desc *next;
+       struct cpmac_desc *prev;
        dma_addr_t mapping;
        dma_addr_t data_mapping;
 };
@@ -208,6 +210,7 @@ struct cpmac_priv {
        struct work_struct reset_work;
        struct platform_device *pdev;
        struct napi_struct napi;
+       atomic_t reset_pending;
 };
 
 static irqreturn_t cpmac_irq(int, void *);
@@ -241,6 +244,16 @@ static void cpmac_dump_desc(struct net_device *dev, struct cpmac_desc *desc)
        printk("\n");
 }
 
+static void cpmac_dump_all_desc(struct net_device *dev)
+{
+       struct cpmac_priv *priv = netdev_priv(dev);
+       struct cpmac_desc *dump = priv->rx_head;
+       do {
+               cpmac_dump_desc(dev, dump);
+               dump = dump->next;
+       } while (dump != priv->rx_head);
+}
+
 static void cpmac_dump_skb(struct net_device *dev, struct sk_buff *skb)
 {
        int i;
@@ -412,21 +425,42 @@ static struct sk_buff *cpmac_rx_one(struct cpmac_priv *priv,
 static int cpmac_poll(struct napi_struct *napi, int budget)
 {
        struct sk_buff *skb;
-       struct cpmac_desc *desc;
-       int received = 0;
+       struct cpmac_desc *desc, *restart;
        struct cpmac_priv *priv = container_of(napi, struct cpmac_priv, napi);
+       int received = 0, processed = 0;
 
        spin_lock(&priv->rx_lock);
        if (unlikely(!priv->rx_head)) {
                if (netif_msg_rx_err(priv) && net_ratelimit())
                        printk(KERN_WARNING "%s: rx: polling, but no queue\n",
                               priv->dev->name);
+               spin_unlock(&priv->rx_lock);
                netif_rx_complete(priv->dev, napi);
                return 0;
        }
 
        desc = priv->rx_head;
+       restart = NULL;
        while (((desc->dataflags & CPMAC_OWN) == 0) && (received < budget)) {
+               processed++;
+
+               if ((desc->dataflags & CPMAC_EOQ) != 0) {
+                       /* The last update to eoq->hw_next didn't happen
+                       * soon enough, and the receiver stopped here.
+                       *Remember this descriptor so we can restart
+                       * the receiver after freeing some space.
+                       */
+                       if (unlikely(restart)) {
+                               if (netif_msg_rx_err(priv))
+                                       printk(KERN_ERR "%s: poll found a"
+                                               " duplicate EOQ: %p and %p\n",
+                                               priv->dev->name, restart, desc);
+                               goto fatal_error;
+                       }
+
+                       restart = desc->next;
+               }
+
                skb = cpmac_rx_one(priv, desc);
                if (likely(skb)) {
                        netif_receive_skb(skb);
@@ -435,19 +469,90 @@ static int cpmac_poll(struct napi_struct *napi, int budget)
                desc = desc->next;
        }
 
+       if (desc != priv->rx_head) {
+               /* We freed some buffers, but not the whole ring,
+                * add what we did free to the rx list */
+               desc->prev->hw_next = (u32)0;
+               priv->rx_head->prev->hw_next = priv->rx_head->mapping;
+       }
+
+       /* Optimization: If we did not actually process an EOQ (perhaps because
+        * of quota limits), check to see if the tail of the queue has EOQ set.
+       * We should immediately restart in that case so that the receiver can
+       * restart and run in parallel with more packet processing.
+       * This lets us handle slightly larger bursts before running
+       * out of ring space (assuming dev->weight < ring_size) */
+
+       if (!restart &&
+            (priv->rx_head->prev->dataflags & (CPMAC_OWN|CPMAC_EOQ))
+                   == CPMAC_EOQ &&
+            (priv->rx_head->dataflags & CPMAC_OWN) != 0) {
+               /* reset EOQ so the poll loop (above) doesn't try to
+               * restart this when it eventually gets to this descriptor.
+               */
+               priv->rx_head->prev->dataflags &= ~CPMAC_EOQ;
+               restart = priv->rx_head;
+       }
+
+       if (restart) {
+               priv->dev->stats.rx_errors++;
+               priv->dev->stats.rx_fifo_errors++;
+               if (netif_msg_rx_err(priv) && net_ratelimit())
+                       printk(KERN_WARNING "%s: rx dma ring overrun\n",
+                              priv->dev->name);
+
+               if (unlikely((restart->dataflags & CPMAC_OWN) == 0)) {
+                       if (netif_msg_drv(priv))
+                               printk(KERN_ERR "%s: cpmac_poll is trying to "
+                                       "restart rx from a descriptor that's "
+                                       "not free: %p\n",
+                                       priv->dev->name, restart);
+                               goto fatal_error;
+               }
+
+               cpmac_write(priv->regs, CPMAC_RX_PTR(0), restart->mapping);
+       }
+
        priv->rx_head = desc;
        spin_unlock(&priv->rx_lock);
        if (unlikely(netif_msg_rx_status(priv)))
                printk(KERN_DEBUG "%s: poll processed %d packets\n",
                       priv->dev->name, received);
-       if (desc->dataflags & CPMAC_OWN) {
+       if (processed == 0) {
+               /* we ran out of packets to read,
+                * revert to interrupt-driven mode */
                netif_rx_complete(priv->dev, napi);
-               cpmac_write(priv->regs, CPMAC_RX_PTR(0), (u32)desc->mapping);
                cpmac_write(priv->regs, CPMAC_RX_INT_ENABLE, 1);
                return 0;
        }
 
        return 1;
+
+fatal_error:
+       /* Something went horribly wrong.
+        * Reset hardware to try to recover rather than wedging. */
+
+       if (netif_msg_drv(priv)) {
+               printk(KERN_ERR "%s: cpmac_poll is confused. "
+                               "Resetting hardware\n", priv->dev->name);
+               cpmac_dump_all_desc(priv->dev);
+               printk(KERN_DEBUG "%s: RX_PTR(0)=0x%08x RX_ACK(0)=0x%08x\n",
+                       priv->dev->name,
+                       cpmac_read(priv->regs, CPMAC_RX_PTR(0)),
+                       cpmac_read(priv->regs, CPMAC_RX_ACK(0)));
+       }
+
+       spin_unlock(&priv->rx_lock);
+       netif_rx_complete(priv->dev, napi);
+       netif_stop_queue(priv->dev);
+       napi_disable(&priv->napi);
+
+       atomic_inc(&priv->reset_pending);
+       cpmac_hw_stop(priv->dev);
+       if (!schedule_work(&priv->reset_work))
+               atomic_dec(&priv->reset_pending);
+       return 0;
+
 }
 
 static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
@@ -456,6 +561,9 @@ static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
        struct cpmac_desc *desc;
        struct cpmac_priv *priv = netdev_priv(dev);
 
+       if (unlikely(atomic_read(&priv->reset_pending)))
+               return NETDEV_TX_BUSY;
+
        if (unlikely(skb_padto(skb, ETH_ZLEN)))
                return NETDEV_TX_OK;
 
@@ -621,8 +729,10 @@ static void cpmac_clear_rx(struct net_device *dev)
                        desc->dataflags = CPMAC_OWN;
                        dev->stats.rx_dropped++;
                }
+               desc->hw_next = desc->next->mapping;
                desc = desc->next;
        }
+       priv->rx_head->prev->hw_next = 0;
 }
 
 static void cpmac_clear_tx(struct net_device *dev)
@@ -635,14 +745,14 @@ static void cpmac_clear_tx(struct net_device *dev)
                priv->desc_ring[i].dataflags = 0;
                if (priv->desc_ring[i].skb) {
                        dev_kfree_skb_any(priv->desc_ring[i].skb);
-                       if (netif_subqueue_stopped(dev, i))
-                           netif_wake_subqueue(dev, i);
+                       priv->desc_ring[i].skb = NULL;
                }
        }
 }
 
 static void cpmac_hw_error(struct work_struct *work)
 {
+       int i;
        struct cpmac_priv *priv =
                container_of(work, struct cpmac_priv, reset_work);
 
@@ -651,8 +761,48 @@ static void cpmac_hw_error(struct work_struct *work)
        spin_unlock(&priv->rx_lock);
        cpmac_clear_tx(priv->dev);
        cpmac_hw_start(priv->dev);
-       napi_enable(&priv->napi);
-       netif_start_queue(priv->dev);
+       barrier();
+       atomic_dec(&priv->reset_pending);
+
+       for (i = 0; i < CPMAC_QUEUES; i++)
+               netif_wake_subqueue(priv->dev, i);
+       netif_wake_queue(priv->dev);
+       cpmac_write(priv->regs, CPMAC_MAC_INT_ENABLE, 3);
+}
+
+static void cpmac_check_status(struct net_device *dev)
+{
+       struct cpmac_priv *priv = netdev_priv(dev);
+
+       u32 macstatus = cpmac_read(priv->regs, CPMAC_MAC_STATUS);
+       int rx_channel = (macstatus >> 8) & 7;
+       int rx_code = (macstatus >> 12) & 15;
+       int tx_channel = (macstatus >> 16) & 7;
+       int tx_code = (macstatus >> 20) & 15;
+
+       if (rx_code || tx_code) {
+               if (netif_msg_drv(priv) && net_ratelimit()) {
+                       /* Can't find any documentation on what these
+                        *error codes actually are. So just log them and hope..
+                        */
+                       if (rx_code)
+                               printk(KERN_WARNING "%s: host error %d on rx "
+                                    "channel %d (macstatus %08x), resetting\n",
+                                    dev->name, rx_code, rx_channel, macstatus);
+                       if (tx_code)
+                               printk(KERN_WARNING "%s: host error %d on tx "
+                                    "channel %d (macstatus %08x), resetting\n",
+                                    dev->name, tx_code, tx_channel, macstatus);
+               }
+
+               netif_stop_queue(dev);
+               cpmac_hw_stop(dev);
+               if (schedule_work(&priv->reset_work))
+                       atomic_inc(&priv->reset_pending);
+               if (unlikely(netif_msg_hw(priv)))
+                       cpmac_dump_regs(dev);
+       }
+       cpmac_write(priv->regs, CPMAC_MAC_INT_CLEAR, 0xff);
 }
 
 static irqreturn_t cpmac_irq(int irq, void *dev_id)
@@ -683,49 +833,32 @@ static irqreturn_t cpmac_irq(int irq, void *dev_id)
 
        cpmac_write(priv->regs, CPMAC_MAC_EOI_VECTOR, 0);
 
-       if (unlikely(status & (MAC_INT_HOST | MAC_INT_STATUS))) {
-               if (netif_msg_drv(priv) && net_ratelimit())
-                       printk(KERN_ERR "%s: hw error, resetting...\n",
-                              dev->name);
-               netif_stop_queue(dev);
-               napi_disable(&priv->napi);
-               cpmac_hw_stop(dev);
-               schedule_work(&priv->reset_work);
-               if (unlikely(netif_msg_hw(priv)))
-                       cpmac_dump_regs(dev);
-       }
+       if (unlikely(status & (MAC_INT_HOST | MAC_INT_STATUS)))
+               cpmac_check_status(dev);
 
        return IRQ_HANDLED;
 }
 
 static void cpmac_tx_timeout(struct net_device *dev)
 {
-       struct cpmac_priv *priv = netdev_priv(dev);
        int i;
+       struct cpmac_priv *priv = netdev_priv(dev);
 
        spin_lock(&priv->lock);
        dev->stats.tx_errors++;
        spin_unlock(&priv->lock);
        if (netif_msg_tx_err(priv) && net_ratelimit())
                printk(KERN_WARNING "%s: transmit timeout\n", dev->name);
-       /* 
-        * FIXME: waking up random queue is not the best thing to
-        * do... on the other hand why we got here at all?
-        */
-#ifdef CONFIG_NETDEVICES_MULTIQUEUE
+
+       atomic_inc(&priv->reset_pending);
+       barrier();
+       cpmac_clear_tx(dev);
+       barrier();
+       atomic_dec(&priv->reset_pending);
+
+       netif_wake_queue(priv->dev);
        for (i = 0; i < CPMAC_QUEUES; i++)
-               if (priv->desc_ring[i].skb) {
-                       priv->desc_ring[i].dataflags = 0;
-                       dev_kfree_skb_any(priv->desc_ring[i].skb);
-                       netif_wake_subqueue(dev, i);
-                       break;
-               }
-#else
-       priv->desc_ring[0].dataflags = 0;
-       if (priv->desc_ring[0].skb)
-               dev_kfree_skb_any(priv->desc_ring[0].skb);
-       netif_wake_queue(dev);
-#endif
+               netif_wake_subqueue(dev, i);
 }
 
 static int cpmac_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
@@ -901,9 +1034,12 @@ static int cpmac_open(struct net_device *dev)
                desc->buflen = CPMAC_SKB_SIZE;
                desc->dataflags = CPMAC_OWN;
                desc->next = &priv->rx_head[(i + 1) % priv->ring_size];
+               desc->next->prev = desc;
                desc->hw_next = (u32)desc->next->mapping;
        }
 
+       priv->rx_head->prev->hw_next = (u32)0;
+
        if ((res = request_irq(dev->irq, cpmac_irq, IRQF_SHARED,
                               dev->name, dev))) {
                if (netif_msg_drv(priv))
@@ -912,6 +1048,7 @@ static int cpmac_open(struct net_device *dev)
                goto fail_irq;
        }
 
+       atomic_set(&priv->reset_pending, 0);
        INIT_WORK(&priv->reset_work, cpmac_hw_error);
        cpmac_hw_start(dev);
 
@@ -1007,21 +1144,10 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
 
        if (phy_id == PHY_MAX_ADDR) {
                if (external_switch || dumb_switch) {
-                       struct fixed_phy_status status = {};
-
-                       /*
-                        * FIXME: this should be in the platform code!
-                        * Since there is not platform code at all (that is,
-                        * no mainline users of that driver), place it here
-                        * for now.
-                        */
-                       phy_id = 0;
-                       status.link = 1;
-                       status.duplex = 1;
-                       status.speed = 100;
-                       fixed_phy_add(PHY_POLL, phy_id, &status);
+                       mdio_bus_id = 0; /* fixed phys bus */
+                       phy_id = pdev->id;
                } else {
-                       printk(KERN_ERR "cpmac: no PHY present\n");
+                       dev_err(&pdev->dev, "no PHY present\n");
                        return -ENODEV;
                }
        }
@@ -1064,10 +1190,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
        priv->msg_enable = netif_msg_init(debug_level, 0xff);
        memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr));
 
-       snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
-
-       priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0,
-                               PHY_INTERFACE_MODE_MII);
+       priv->phy = phy_connect(dev, cpmac_mii.phy_map[phy_id]->dev.bus_id,
+                               &cpmac_adjust_link, 0, PHY_INTERFACE_MODE_MII);
        if (IS_ERR(priv->phy)) {
                if (netif_msg_drv(priv))
                        printk(KERN_ERR "%s: Could not attach to PHY\n",
index d45bcd2..864295e 100644 (file)
@@ -903,7 +903,7 @@ dm9000_stop(struct net_device *ndev)
        if (netif_msg_ifdown(db))
                dev_dbg(db->dev, "shutting down %s\n", ndev->name);
 
-       cancel_delayed_work(&db->phy_poll);
+       cancel_delayed_work_sync(&db->phy_poll);
 
        netif_stop_queue(ndev);
        netif_carrier_off(ndev);
index 8cbb40f..cab1835 100644 (file)
@@ -4201,8 +4201,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
        struct e1000_adapter *adapter;
        struct e1000_hw *hw;
        const struct e1000_info *ei = e1000_info_tbl[ent->driver_data];
-       unsigned long mmio_start, mmio_len;
-       unsigned long flash_start, flash_len;
+       resource_size_t mmio_start, mmio_len;
+       resource_size_t flash_start, flash_len;
 
        static int cards_found;
        int i, err, pci_using_dac;
index d1b6d4e..287a619 100644 (file)
@@ -2213,8 +2213,6 @@ static void ehea_vlan_rx_register(struct net_device *dev,
                goto out;
        }
 
-       memset(cb1->vlan_filter, 0, sizeof(cb1->vlan_filter));
-
        hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
                                       H_PORT_CB1, H_PORT_CB1_ALL, cb1);
        if (hret != H_SUCCESS)
@@ -3178,11 +3176,12 @@ out_err:
 
 static void ehea_shutdown_single_port(struct ehea_port *port)
 {
+       struct ehea_adapter *adapter = port->adapter;
        unregister_netdev(port->netdev);
        ehea_unregister_port(port);
        kfree(port->mc_list);
        free_netdev(port->netdev);
-       port->adapter->active_ports--;
+       adapter->active_ports--;
 }
 
 static int ehea_setup_ports(struct ehea_adapter *adapter)
index 35f66d4..9eca97f 100644 (file)
@@ -5823,6 +5823,7 @@ static int nv_resume(struct pci_dev *pdev)
        writel(txreg, base + NvRegTransmitPoll);
 
        rc = nv_open(dev);
+       nv_set_multicast(dev);
 out:
        return rc;
 }
index 67b4b07..a5baaf5 100644 (file)
@@ -1093,7 +1093,7 @@ err:
                if (registered)
                        unregister_netdev(ndev);
 
-               if (fep != NULL) {
+               if (fep && fep->ops) {
                        (*fep->ops->free_bd)(ndev);
                        (*fep->ops->cleanup_data)(ndev);
                }
index f905159..45ae9d1 100644 (file)
@@ -1340,9 +1340,10 @@ static unsigned int scc_set_param(struct scc_channel *scc, unsigned int cmd, uns
                case PARAM_RTS: 
                        if ( !(scc->wreg[R5] & RTS) )
                        {
-                               if (arg != TX_OFF)
+                               if (arg != TX_OFF) {
                                        scc_key_trx(scc, TX_ON);
                                        scc_start_tx_timer(scc, t_txdelay, scc->kiss.txdelay);
+                               }
                        } else {
                                if (arg == TX_OFF)
                                {
index 9081234..6f50ed7 100644 (file)
@@ -1120,7 +1120,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self)
                 }
         }
 
-        if (self->usbdev->descriptor.bcdDevice == fw_version) {
+        if (self->usbdev->descriptor.bcdDevice == cpu_to_le16(fw_version)) {
                 /*
                 * If we're here, we've found a correct patch
                  * The actual image starts after the "STMP" keyword
index e846c38..a0ca9c1 100644 (file)
 struct irda_class_desc {
        __u8  bLength;
        __u8  bDescriptorType;
-       __u16 bcdSpecRevision;
+       __le16 bcdSpecRevision;
        __u8  bmDataSize;
        __u8  bmWindowSize;
        __u8  bmMinTurnaroundTime;
-       __u16 wBaudRate;
+       __le16 wBaudRate;
        __u8  bmAdditionalBOFs;
        __u8  bIrdaRateSniff;
        __u8  bMaxUnicastList;
index c91b12e..36be6ef 100644 (file)
@@ -631,7 +631,7 @@ static int myri10ge_adopt_running_firmware(struct myri10ge_priv *mgp)
        return status;
 }
 
-int myri10ge_get_firmware_capabilities(struct myri10ge_priv *mgp)
+static int myri10ge_get_firmware_capabilities(struct myri10ge_priv *mgp)
 {
        struct myri10ge_cmd cmd;
        int status;
index 8f328a0..a550c9b 100644 (file)
@@ -391,7 +391,9 @@ static int fmvj18x_config(struct pcmcia_device *link)
            cardtype = CONTEC;
            break;
        case MANFID_FUJITSU:
-           if (link->card_id == PRODID_FUJITSU_MBH10302)
+           if (link->conf.ConfigBase == 0x0fe0)
+               cardtype = MBH10302;
+           else if (link->card_id == PRODID_FUJITSU_MBH10302) 
                 /* RATOC REX-5588/9822/4886's PRODID are 0004(=MBH10302),
                    but these are MBH10304 based card. */ 
                cardtype = MBH10304;
index d041f83..f6c4698 100644 (file)
@@ -1461,22 +1461,25 @@ static void
 set_multicast_list(struct net_device *dev)
 {
     unsigned int ioaddr = dev->base_addr;
+    unsigned value;
 
     SelectPage(0x42);
+    value = GetByte(XIRCREG42_SWC1) & 0xC0;
+
     if (dev->flags & IFF_PROMISC) { /* snoop */
-       PutByte(XIRCREG42_SWC1, 0x06); /* set MPE and PME */
+       PutByte(XIRCREG42_SWC1, value | 0x06); /* set MPE and PME */
     } else if (dev->mc_count > 9 || (dev->flags & IFF_ALLMULTI)) {
-       PutByte(XIRCREG42_SWC1, 0x02); /* set MPE */
+       PutByte(XIRCREG42_SWC1, value | 0x02); /* set MPE */
     } else if (dev->mc_count) {
        /* the chip can filter 9 addresses perfectly */
-       PutByte(XIRCREG42_SWC1, 0x01);
+       PutByte(XIRCREG42_SWC1, value | 0x01);
        SelectPage(0x40);
        PutByte(XIRCREG40_CMD0, Offline);
        set_addresses(dev);
        SelectPage(0x40);
        PutByte(XIRCREG40_CMD0, EnableRecv | Online);
     } else { /* standard usage */
-       PutByte(XIRCREG42_SWC1, 0x00);
+       PutByte(XIRCREG42_SWC1, value | 0x00);
     }
     SelectPage(0);
 }
@@ -1722,6 +1725,7 @@ do_reset(struct net_device *dev, int full)
 
     /* enable receiver and put the mac online */
     if (full) {
+       set_multicast_list(dev);
        SelectPage(0x40);
        PutByte(XIRCREG40_CMD0, EnableRecv | Online);
     }
index a1c454d..1c89b97 100644 (file)
@@ -325,7 +325,7 @@ static int pcnet32_get_regs_len(struct net_device *dev);
 static void pcnet32_get_regs(struct net_device *dev, struct ethtool_regs *regs,
                             void *ptr);
 static void pcnet32_purge_tx_ring(struct net_device *dev);
-static int pcnet32_alloc_ring(struct net_device *dev, char *name);
+static int pcnet32_alloc_ring(struct net_device *dev, const char *name);
 static void pcnet32_free_ring(struct net_device *dev);
 static void pcnet32_check_media(struct net_device *dev, int verbose);
 
@@ -1983,7 +1983,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
 }
 
 /* if any allocation fails, caller must also call pcnet32_free_ring */
-static int pcnet32_alloc_ring(struct net_device *dev, char *name)
+static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
 {
        struct pcnet32_private *lp = netdev_priv(dev);
 
index 6bf9e76..6eb2d31 100644 (file)
@@ -5,7 +5,7 @@
 menuconfig PHYLIB
        tristate "PHY Device support and infrastructure"
        depends on !S390
-       depends on NET_ETHERNET && (BROKEN || !S390)
+       depends on NET_ETHERNET
        help
          Ethernet controllers are usually attached to PHY
          devices.  This option provides infrastructure for
index ac3c01d..16a0e7d 100644 (file)
@@ -207,6 +207,7 @@ int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id)
 
        return 0;
 }
+EXPORT_SYMBOL(get_phy_id);
 
 /**
  * get_phy_device - reads the specified PHY device and returns its @phy_device struct
index 7935991..8db342f 100644 (file)
@@ -980,6 +980,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
        __wsum csum = 0;
        struct udphdr *uh;
        unsigned int len;
+       int old_headroom;
+       int new_headroom;
 
        if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED))
                goto abort;
@@ -1001,16 +1003,18 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
 
        /* Check that there's enough headroom in the skb to insert IP,
         * UDP and L2TP and PPP headers. If not enough, expand it to
-        * make room. Note that a new skb (or a clone) is
-        * allocated. If we return an error from this point on, make
-        * sure we free the new skb but do not free the original skb
-        * since that is done by the caller for the error case.
+        * make room. Adjust truesize.
         */
        headroom = NET_SKB_PAD + sizeof(struct iphdr) +
                sizeof(struct udphdr) + hdr_len + sizeof(ppph);
+       old_headroom = skb_headroom(skb);
        if (skb_cow_head(skb, headroom))
                goto abort;
 
+       new_headroom = skb_headroom(skb);
+       skb_orphan(skb);
+       skb->truesize += new_headroom - old_headroom;
+
        /* Setup PPP header */
        __skb_push(skb, sizeof(ppph));
        skb->data[0] = ppph[0];
@@ -1065,7 +1069,6 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
        /* Get routing info from the tunnel socket */
        dst_release(skb->dst);
        skb->dst = dst_clone(__sk_dst_get(sk_tun));
-       skb_orphan(skb);
        skb->sk = sk_tun;
 
        /* Queue the packet to IP for output */
index 2109508..f8274f8 100644 (file)
@@ -250,7 +250,7 @@ struct XENA_dev_config {
        u64 tx_mat0_n[0x8];
 #define TX_MAT_SET(fifo, msi)                  vBIT(msi, (8 * fifo), 8)
 
-       u8 unused_1[0x8];
+       u64 xmsi_mask_reg;
        u64 stat_byte_cnt;
 #define STAT_BC(n)                              vBIT(n,4,12)
 
index 523478e..a20693e 100644 (file)
@@ -86,7 +86,7 @@
 #include "s2io.h"
 #include "s2io-regs.h"
 
-#define DRV_VERSION "2.0.26.23"
+#define DRV_VERSION "2.0.26.24"
 
 /* S2io Driver name & version. */
 static char s2io_driver_name[] = "Neterion";
@@ -1113,9 +1113,10 @@ static int s2io_on_nec_bridge(struct pci_dev *s2io_pdev)
        struct pci_dev *tdev = NULL;
        while ((tdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, tdev)) != NULL) {
                if (tdev->vendor == NEC_VENID && tdev->device == NEC_DEVID) {
-                       if (tdev->bus == s2io_pdev->bus->parent)
+                       if (tdev->bus == s2io_pdev->bus->parent) {
                                pci_dev_put(tdev);
                                return 1;
+                       }
                }
        }
        return 0;
@@ -1219,15 +1220,33 @@ static int init_tti(struct s2io_nic *nic, int link)
                                TTI_DATA1_MEM_TX_URNG_B(0x10) |
                                TTI_DATA1_MEM_TX_URNG_C(0x30) |
                                TTI_DATA1_MEM_TX_TIMER_AC_EN;
-
-               if (use_continuous_tx_intrs && (link == LINK_UP))
-                       val64 |= TTI_DATA1_MEM_TX_TIMER_CI_EN;
+               if (i == 0)
+                       if (use_continuous_tx_intrs && (link == LINK_UP))
+                               val64 |= TTI_DATA1_MEM_TX_TIMER_CI_EN;
                writeq(val64, &bar0->tti_data1_mem);
 
-               val64 = TTI_DATA2_MEM_TX_UFC_A(0x10) |
-                               TTI_DATA2_MEM_TX_UFC_B(0x20) |
-                               TTI_DATA2_MEM_TX_UFC_C(0x40) |
-                               TTI_DATA2_MEM_TX_UFC_D(0x80);
+               if (nic->config.intr_type == MSI_X) {
+                       val64 = TTI_DATA2_MEM_TX_UFC_A(0x10) |
+                               TTI_DATA2_MEM_TX_UFC_B(0x100) |
+                               TTI_DATA2_MEM_TX_UFC_C(0x200) |
+                               TTI_DATA2_MEM_TX_UFC_D(0x300);
+               } else {
+                       if ((nic->config.tx_steering_type ==
+                               TX_DEFAULT_STEERING) &&
+                               (config->tx_fifo_num > 1) &&
+                               (i >= nic->udp_fifo_idx) &&
+                               (i < (nic->udp_fifo_idx +
+                               nic->total_udp_fifos)))
+                               val64 = TTI_DATA2_MEM_TX_UFC_A(0x50) |
+                                       TTI_DATA2_MEM_TX_UFC_B(0x80) |
+                                       TTI_DATA2_MEM_TX_UFC_C(0x100) |
+                                       TTI_DATA2_MEM_TX_UFC_D(0x120);
+                       else
+                               val64 = TTI_DATA2_MEM_TX_UFC_A(0x10) |
+                                       TTI_DATA2_MEM_TX_UFC_B(0x20) |
+                                       TTI_DATA2_MEM_TX_UFC_C(0x40) |
+                                       TTI_DATA2_MEM_TX_UFC_D(0x80);
+               }
 
                writeq(val64, &bar0->tti_data2_mem);
 
@@ -2813,6 +2832,15 @@ static void free_rx_buffers(struct s2io_nic *sp)
        }
 }
 
+static int s2io_chk_rx_buffers(struct ring_info *ring)
+{
+       if (fill_rx_buffers(ring) == -ENOMEM) {
+               DBG_PRINT(INFO_DBG, "%s:Out of memory", ring->dev->name);
+               DBG_PRINT(INFO_DBG, " in Rx Intr!!\n");
+       }
+       return 0;
+}
+
 /**
  * s2io_poll - Rx interrupt handler for NAPI support
  * @napi : pointer to the napi structure.
@@ -2826,57 +2854,72 @@ static void free_rx_buffers(struct s2io_nic *sp)
  * 0 on success and 1 if there are No Rx packets to be processed.
  */
 
-static int s2io_poll(struct napi_struct *napi, int budget)
+static int s2io_poll_msix(struct napi_struct *napi, int budget)
 {
-       struct s2io_nic *nic = container_of(napi, struct s2io_nic, napi);
-       struct net_device *dev = nic->dev;
-       int pkt_cnt = 0, org_pkts_to_process;
-       struct mac_info *mac_control;
+       struct ring_info *ring = container_of(napi, struct ring_info, napi);
+       struct net_device *dev = ring->dev;
        struct config_param *config;
+       struct mac_info *mac_control;
+       int pkts_processed = 0;
+       u8 *addr = NULL, val8 = 0;
+       struct s2io_nic *nic = dev->priv;
        struct XENA_dev_config __iomem *bar0 = nic->bar0;
-       int i;
+       int budget_org = budget;
 
-       mac_control = &nic->mac_control;
        config = &nic->config;
+       mac_control = &nic->mac_control;
 
-       nic->pkts_to_process = budget;
-       org_pkts_to_process = nic->pkts_to_process;
+       if (unlikely(!is_s2io_card_up(nic)))
+               return 0;
 
-       writeq(S2IO_MINUS_ONE, &bar0->rx_traffic_int);
-       readl(&bar0->rx_traffic_int);
+       pkts_processed = rx_intr_handler(ring, budget);
+       s2io_chk_rx_buffers(ring);
 
-       for (i = 0; i < config->rx_ring_num; i++) {
-               rx_intr_handler(&mac_control->rings[i]);
-               pkt_cnt = org_pkts_to_process - nic->pkts_to_process;
-               if (!nic->pkts_to_process) {
-                       /* Quota for the current iteration has been met */
-                       goto no_rx;
-               }
+       if (pkts_processed < budget_org) {
+               netif_rx_complete(dev, napi);
+               /*Re Enable MSI-Rx Vector*/
+               addr = (u8 *)&bar0->xmsi_mask_reg;
+               addr += 7 - ring->ring_no;
+               val8 = (ring->ring_no == 0) ? 0x3f : 0xbf;
+               writeb(val8, addr);
+               val8 = readb(addr);
        }
+       return pkts_processed;
+}
+static int s2io_poll_inta(struct napi_struct *napi, int budget)
+{
+       struct s2io_nic *nic = container_of(napi, struct s2io_nic, napi);
+       struct ring_info *ring;
+       struct net_device *dev = nic->dev;
+       struct config_param *config;
+       struct mac_info *mac_control;
+       int pkts_processed = 0;
+       int ring_pkts_processed, i;
+       struct XENA_dev_config __iomem *bar0 = nic->bar0;
+       int budget_org = budget;
 
-       netif_rx_complete(dev, napi);
+       config = &nic->config;
+       mac_control = &nic->mac_control;
 
-       for (i = 0; i < config->rx_ring_num; i++) {
-               if (fill_rx_buffers(&mac_control->rings[i]) == -ENOMEM) {
-                       DBG_PRINT(INFO_DBG, "%s:Out of memory", dev->name);
-                       DBG_PRINT(INFO_DBG, " in Rx Poll!!\n");
-                       break;
-               }
-       }
-       /* Re enable the Rx interrupts. */
-       writeq(0x0, &bar0->rx_traffic_mask);
-       readl(&bar0->rx_traffic_mask);
-       return pkt_cnt;
+       if (unlikely(!is_s2io_card_up(nic)))
+               return 0;
 
-no_rx:
        for (i = 0; i < config->rx_ring_num; i++) {
-               if (fill_rx_buffers(&mac_control->rings[i]) == -ENOMEM) {
-                       DBG_PRINT(INFO_DBG, "%s:Out of memory", dev->name);
-                       DBG_PRINT(INFO_DBG, " in Rx Poll!!\n");
+               ring = &mac_control->rings[i];
+               ring_pkts_processed = rx_intr_handler(ring, budget);
+               s2io_chk_rx_buffers(ring);
+               pkts_processed += ring_pkts_processed;
+               budget -= ring_pkts_processed;
+               if (budget <= 0)
                        break;
-               }
        }
-       return pkt_cnt;
+       if (pkts_processed < budget_org) {
+               netif_rx_complete(dev, napi);
+               /* Re enable the Rx interrupts for the ring */
+               writeq(0, &bar0->rx_traffic_mask);
+               readl(&bar0->rx_traffic_mask);
+       }
+       return pkts_processed;
 }
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
@@ -2918,7 +2961,7 @@ static void s2io_netpoll(struct net_device *dev)
 
        /* check for received packet and indicate up to network */
        for (i = 0; i < config->rx_ring_num; i++)
-               rx_intr_handler(&mac_control->rings[i]);
+               rx_intr_handler(&mac_control->rings[i], 0);
 
        for (i = 0; i < config->rx_ring_num; i++) {
                if (fill_rx_buffers(&mac_control->rings[i]) == -ENOMEM) {
@@ -2934,7 +2977,8 @@ static void s2io_netpoll(struct net_device *dev)
 
 /**
  *  rx_intr_handler - Rx interrupt handler
- *  @nic: device private variable.
+ *  @ring_info: per ring structure.
+ *  @budget: budget for napi processing.
  *  Description:
  *  If the interrupt is because of a received frame or if the
  *  receive ring contains fresh as yet un-processed frames,this function is
@@ -2942,15 +2986,15 @@ static void s2io_netpoll(struct net_device *dev)
  *  stopped and sends the skb to the OSM's Rx handler and then increments
  *  the offset.
  *  Return Value:
- *  NONE.
+ *  No. of napi packets processed.
  */
-static void rx_intr_handler(struct ring_info *ring_data)
+static int rx_intr_handler(struct ring_info *ring_data, int budget)
 {
        int get_block, put_block;
        struct rx_curr_get_info get_info, put_info;
        struct RxD_t *rxdp;
        struct sk_buff *skb;
-       int pkt_cnt = 0;
+       int pkt_cnt = 0, napi_pkts = 0;
        int i;
        struct RxD1* rxdp1;
        struct RxD3* rxdp3;
@@ -2977,7 +3021,7 @@ static void rx_intr_handler(struct ring_info *ring_data)
                        DBG_PRINT(ERR_DBG, "%s: The skb is ",
                                  ring_data->dev->name);
                        DBG_PRINT(ERR_DBG, "Null in Rx Intr\n");
-                       return;
+                       return 0;
                }
                if (ring_data->rxd_mode == RXD_MODE_1) {
                        rxdp1 = (struct RxD1*)rxdp;
@@ -3014,9 +3058,10 @@ static void rx_intr_handler(struct ring_info *ring_data)
                        rxdp = ring_data->rx_blocks[get_block].block_virt_addr;
                }
 
-               if(ring_data->nic->config.napi){
-                       ring_data->nic->pkts_to_process -= 1;
-                       if (!ring_data->nic->pkts_to_process)
+               if (ring_data->nic->config.napi) {
+                       budget--;
+                       napi_pkts++;
+                       if (!budget)
                                break;
                }
                pkt_cnt++;
@@ -3034,6 +3079,7 @@ static void rx_intr_handler(struct ring_info *ring_data)
                        }
                }
        }
+       return(napi_pkts);
 }
 
 /**
@@ -3730,14 +3776,19 @@ static void restore_xmsi_data(struct s2io_nic *nic)
 {
        struct XENA_dev_config __iomem *bar0 = nic->bar0;
        u64 val64;
-       int i;
+       int i, msix_index;
+
+
+       if (nic->device_type == XFRAME_I_DEVICE)
+               return;
 
        for (i=0; i < MAX_REQUESTED_MSI_X; i++) {
+               msix_index = (i) ? ((i-1) * 8 + 1): 0;
                writeq(nic->msix_info[i].addr, &bar0->xmsi_address);
                writeq(nic->msix_info[i].data, &bar0->xmsi_data);
-               val64 = (s2BIT(7) | s2BIT(15) | vBIT(i, 26, 6));
+               val64 = (s2BIT(7) | s2BIT(15) | vBIT(msix_index, 26, 6));
                writeq(val64, &bar0->xmsi_access);
-               if (wait_for_msix_trans(nic, i)) {
+               if (wait_for_msix_trans(nic, msix_index)) {
                        DBG_PRINT(ERR_DBG, "failed in %s\n", __FUNCTION__);
                        continue;
                }
@@ -3748,13 +3799,17 @@ static void store_xmsi_data(struct s2io_nic *nic)
 {
        struct XENA_dev_config __iomem *bar0 = nic->bar0;
        u64 val64, addr, data;
-       int i;
+       int i, msix_index;
+
+       if (nic->device_type == XFRAME_I_DEVICE)
+               return;
 
        /* Store and display */
        for (i=0; i < MAX_REQUESTED_MSI_X; i++) {
-               val64 = (s2BIT(15) | vBIT(i, 26, 6));
+               msix_index = (i) ? ((i-1) * 8 + 1): 0;
+               val64 = (s2BIT(15) | vBIT(msix_index, 26, 6));
                writeq(val64, &bar0->xmsi_access);
-               if (wait_for_msix_trans(nic, i)) {
+               if (wait_for_msix_trans(nic, msix_index)) {
                        DBG_PRINT(ERR_DBG, "failed in %s\n", __FUNCTION__);
                        continue;
                }
@@ -3770,11 +3825,11 @@ static void store_xmsi_data(struct s2io_nic *nic)
 static int s2io_enable_msi_x(struct s2io_nic *nic)
 {
        struct XENA_dev_config __iomem *bar0 = nic->bar0;
-       u64 tx_mat, rx_mat;
+       u64 rx_mat;
        u16 msi_control; /* Temp variable */
        int ret, i, j, msix_indx = 1;
 
-       nic->entries = kcalloc(MAX_REQUESTED_MSI_X, sizeof(struct msix_entry),
+       nic->entries = kmalloc(nic->num_entries * sizeof(struct msix_entry),
                               GFP_KERNEL);
        if (!nic->entries) {
                DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n", \
@@ -3783,10 +3838,12 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
                return -ENOMEM;
        }
        nic->mac_control.stats_info->sw_stat.mem_allocated
-               += (MAX_REQUESTED_MSI_X * sizeof(struct msix_entry));
+               += (nic->num_entries * sizeof(struct msix_entry));
+
+       memset(nic->entries, 0, nic->num_entries * sizeof(struct msix_entry));
 
        nic->s2io_entries =
-               kcalloc(MAX_REQUESTED_MSI_X, sizeof(struct s2io_msix_entry),
+               kmalloc(nic->num_entries * sizeof(struct s2io_msix_entry),
                                   GFP_KERNEL);
        if (!nic->s2io_entries) {
                DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n",
@@ -3794,60 +3851,52 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
                nic->mac_control.stats_info->sw_stat.mem_alloc_fail_cnt++;
                kfree(nic->entries);
                nic->mac_control.stats_info->sw_stat.mem_freed
-                       += (MAX_REQUESTED_MSI_X * sizeof(struct msix_entry));
+                       += (nic->num_entries * sizeof(struct msix_entry));
                return -ENOMEM;
        }
         nic->mac_control.stats_info->sw_stat.mem_allocated
-               += (MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry));
-
-       for (i=0; i< MAX_REQUESTED_MSI_X; i++) {
-               nic->entries[i].entry = i;
-               nic->s2io_entries[i].entry = i;
+               += (nic->num_entries * sizeof(struct s2io_msix_entry));
+       memset(nic->s2io_entries, 0,
+               nic->num_entries * sizeof(struct s2io_msix_entry));
+
+       nic->entries[0].entry = 0;
+       nic->s2io_entries[0].entry = 0;
+       nic->s2io_entries[0].in_use = MSIX_FLG;
+       nic->s2io_entries[0].type = MSIX_ALARM_TYPE;
+       nic->s2io_entries[0].arg = &nic->mac_control.fifos;
+
+       for (i = 1; i < nic->num_entries; i++) {
+               nic->entries[i].entry = ((i - 1) * 8) + 1;
+               nic->s2io_entries[i].entry = ((i - 1) * 8) + 1;
                nic->s2io_entries[i].arg = NULL;
                nic->s2io_entries[i].in_use = 0;
        }
 
-       tx_mat = readq(&bar0->tx_mat0_n[0]);
-       for (i=0; i<nic->config.tx_fifo_num; i++, msix_indx++) {
-               tx_mat |= TX_MAT_SET(i, msix_indx);
-               nic->s2io_entries[msix_indx].arg = &nic->mac_control.fifos[i];
-               nic->s2io_entries[msix_indx].type = MSIX_FIFO_TYPE;
-               nic->s2io_entries[msix_indx].in_use = MSIX_FLG;
-       }
-       writeq(tx_mat, &bar0->tx_mat0_n[0]);
-
        rx_mat = readq(&bar0->rx_mat);
-       for (j = 0; j < nic->config.rx_ring_num; j++, msix_indx++) {
+       for (j = 0; j < nic->config.rx_ring_num; j++) {
                rx_mat |= RX_MAT_SET(j, msix_indx);
-               nic->s2io_entries[msix_indx].arg
-                       = &nic->mac_control.rings[j];
-               nic->s2io_entries[msix_indx].type = MSIX_RING_TYPE;
-               nic->s2io_entries[msix_indx].in_use = MSIX_FLG;
+               nic->s2io_entries[j+1].arg = &nic->mac_control.rings[j];
+               nic->s2io_entries[j+1].type = MSIX_RING_TYPE;
+               nic->s2io_entries[j+1].in_use = MSIX_FLG;
+               msix_indx += 8;
        }
        writeq(rx_mat, &bar0->rx_mat);
+       readq(&bar0->rx_mat);
 
-       nic->avail_msix_vectors = 0;
-       ret = pci_enable_msix(nic->pdev, nic->entries, MAX_REQUESTED_MSI_X);
+       ret = pci_enable_msix(nic->pdev, nic->entries, nic->num_entries);
        /* We fail init if error or we get less vectors than min required */
-       if (ret >= (nic->config.tx_fifo_num + nic->config.rx_ring_num + 1)) {
-               nic->avail_msix_vectors = ret;
-               ret = pci_enable_msix(nic->pdev, nic->entries, ret);
-       }
        if (ret) {
                DBG_PRINT(ERR_DBG, "%s: Enabling MSIX failed\n", nic->dev->name);
                kfree(nic->entries);
                nic->mac_control.stats_info->sw_stat.mem_freed
-                       += (MAX_REQUESTED_MSI_X * sizeof(struct msix_entry));
+                       += (nic->num_entries * sizeof(struct msix_entry));
                kfree(nic->s2io_entries);
                nic->mac_control.stats_info->sw_stat.mem_freed
-               += (MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry));
+                       += (nic->num_entries * sizeof(struct s2io_msix_entry));
                nic->entries = NULL;
                nic->s2io_entries = NULL;
-               nic->avail_msix_vectors = 0;
                return -ENOMEM;
        }
-       if (!nic->avail_msix_vectors)
-               nic->avail_msix_vectors = MAX_REQUESTED_MSI_X;
 
        /*
         * To enable MSI-X, MSI also needs to be enabled, due to a bug
@@ -3919,7 +3968,7 @@ static void remove_msix_isr(struct s2io_nic *sp)
        int i;
        u16 msi_control;
 
-       for (i = 0; i < MAX_REQUESTED_MSI_X; i++) {
+       for (i = 0; i < sp->num_entries; i++) {
                if (sp->s2io_entries[i].in_use ==
                        MSIX_REGISTERED_SUCCESS) {
                        int vector = sp->entries[i].vector;
@@ -3975,29 +4024,6 @@ static int s2io_open(struct net_device *dev)
        netif_carrier_off(dev);
        sp->last_link_state = 0;
 
-       if (sp->config.intr_type == MSI_X) {
-               int ret = s2io_enable_msi_x(sp);
-
-               if (!ret) {
-                       ret = s2io_test_msi(sp);
-                       /* rollback MSI-X, will re-enable during add_isr() */
-                       remove_msix_isr(sp);
-               }
-               if (ret) {
-
-                       DBG_PRINT(ERR_DBG,
-                         "%s: MSI-X requested but failed to enable\n",
-                         dev->name);
-                       sp->config.intr_type = INTA;
-               }
-       }
-
-       /* NAPI doesn't work well with MSI(X) */
-        if (sp->config.intr_type != INTA) {
-               if(sp->config.napi)
-                       sp->config.napi = 0;
-       }
-
        /* Initialize H/W and enable interrupts */
        err = s2io_card_up(sp);
        if (err) {
@@ -4020,12 +4046,12 @@ hw_init_failed:
                if (sp->entries) {
                        kfree(sp->entries);
                        sp->mac_control.stats_info->sw_stat.mem_freed
-                       += (MAX_REQUESTED_MSI_X * sizeof(struct msix_entry));
+                       += (sp->num_entries * sizeof(struct msix_entry));
                }
                if (sp->s2io_entries) {
                        kfree(sp->s2io_entries);
                        sp->mac_control.stats_info->sw_stat.mem_freed
-                       += (MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry));
+                       += (sp->num_entries * sizeof(struct s2io_msix_entry));
                }
        }
        return err;
@@ -4327,40 +4353,64 @@ s2io_alarm_handle(unsigned long data)
        mod_timer(&sp->alarm_timer, jiffies + HZ / 2);
 }
 
-static int s2io_chk_rx_buffers(struct ring_info *ring)
-{
-       if (fill_rx_buffers(ring) == -ENOMEM) {
-               DBG_PRINT(INFO_DBG, "%s:Out of memory", ring->dev->name);
-               DBG_PRINT(INFO_DBG, " in Rx Intr!!\n");
-       }
-       return 0;
-}
-
 static irqreturn_t s2io_msix_ring_handle(int irq, void *dev_id)
 {
        struct ring_info *ring = (struct ring_info *)dev_id;
        struct s2io_nic *sp = ring->nic;
+       struct XENA_dev_config __iomem *bar0 = sp->bar0;
+       struct net_device *dev = sp->dev;
 
-       if (!is_s2io_card_up(sp))
+       if (unlikely(!is_s2io_card_up(sp)))
                return IRQ_HANDLED;
 
-       rx_intr_handler(ring);
-       s2io_chk_rx_buffers(ring);
+       if (sp->config.napi) {
+               u8 *addr = NULL, val8 = 0;
+
+               addr = (u8 *)&bar0->xmsi_mask_reg;
+               addr += (7 - ring->ring_no);
+               val8 = (ring->ring_no == 0) ? 0x7f : 0xff;
+               writeb(val8, addr);
+               val8 = readb(addr);
+               netif_rx_schedule(dev, &ring->napi);
+       } else {
+               rx_intr_handler(ring, 0);
+               s2io_chk_rx_buffers(ring);
+       }
 
        return IRQ_HANDLED;
 }
 
 static irqreturn_t s2io_msix_fifo_handle(int irq, void *dev_id)
 {
-       struct fifo_info *fifo = (struct fifo_info *)dev_id;
-       struct s2io_nic *sp = fifo->nic;
+       int i;
+       struct fifo_info *fifos = (struct fifo_info *)dev_id;
+       struct s2io_nic *sp = fifos->nic;
+       struct XENA_dev_config __iomem *bar0 = sp->bar0;
+       struct config_param *config  = &sp->config;
+       u64 reason;
 
-       if (!is_s2io_card_up(sp))
+       if (unlikely(!is_s2io_card_up(sp)))
+               return IRQ_NONE;
+
+       reason = readq(&bar0->general_int_status);
+       if (unlikely(reason == S2IO_MINUS_ONE))
+               /* Nothing much can be done. Get out */
                return IRQ_HANDLED;
 
-       tx_intr_handler(fifo);
+       writeq(S2IO_MINUS_ONE, &bar0->general_int_mask);
+
+       if (reason & GEN_INTR_TXTRAFFIC)
+               writeq(S2IO_MINUS_ONE, &bar0->tx_traffic_int);
+
+       for (i = 0; i < config->tx_fifo_num; i++)
+               tx_intr_handler(&fifos[i]);
+
+       writeq(sp->general_int_mask, &bar0->general_int_mask);
+       readl(&bar0->general_int_status);
+
        return IRQ_HANDLED;
 }
+
 static void s2io_txpic_intr_handle(struct s2io_nic *sp)
 {
        struct XENA_dev_config __iomem *bar0 = sp->bar0;
@@ -4762,14 +4812,10 @@ static irqreturn_t s2io_isr(int irq, void *dev_id)
 
                if (config->napi) {
                        if (reason & GEN_INTR_RXTRAFFIC) {
-                               if (likely(netif_rx_schedule_prep(dev,
-                                                       &sp->napi))) {
-                                       __netif_rx_schedule(dev, &sp->napi);
-                                       writeq(S2IO_MINUS_ONE,
-                                              &bar0->rx_traffic_mask);
-                               } else
-                                       writeq(S2IO_MINUS_ONE,
-                                              &bar0->rx_traffic_int);
+                               netif_rx_schedule(dev, &sp->napi);
+                               writeq(S2IO_MINUS_ONE, &bar0->rx_traffic_mask);
+                               writeq(S2IO_MINUS_ONE, &bar0->rx_traffic_int);
+                               readl(&bar0->rx_traffic_int);
                        }
                } else {
                        /*
@@ -4781,7 +4827,7 @@ static irqreturn_t s2io_isr(int irq, void *dev_id)
                                writeq(S2IO_MINUS_ONE, &bar0->rx_traffic_int);
 
                        for (i = 0; i < config->rx_ring_num; i++)
-                               rx_intr_handler(&mac_control->rings[i]);
+                               rx_intr_handler(&mac_control->rings[i], 0);
                }
 
                /*
@@ -6984,62 +7030,62 @@ static int s2io_add_isr(struct s2io_nic * sp)
 
        /* After proper initialization of H/W, register ISR */
        if (sp->config.intr_type == MSI_X) {
-               int i, msix_tx_cnt=0,msix_rx_cnt=0;
-
-               for (i=1; (sp->s2io_entries[i].in_use == MSIX_FLG); i++) {
-                       if (sp->s2io_entries[i].type == MSIX_FIFO_TYPE) {
-                               sprintf(sp->desc[i], "%s:MSI-X-%d-TX",
+               int i, msix_rx_cnt = 0;
+
+               for (i = 0; i < sp->num_entries; i++) {
+                       if (sp->s2io_entries[i].in_use == MSIX_FLG) {
+                               if (sp->s2io_entries[i].type ==
+                                       MSIX_RING_TYPE) {
+                                       sprintf(sp->desc[i], "%s:MSI-X-%d-RX",
+                                               dev->name, i);
+                                       err = request_irq(sp->entries[i].vector,
+                                               s2io_msix_ring_handle, 0,
+                                               sp->desc[i],
+                                               sp->s2io_entries[i].arg);
+                               } else if (sp->s2io_entries[i].type ==
+                                       MSIX_ALARM_TYPE) {
+                                       sprintf(sp->desc[i], "%s:MSI-X-%d-TX",
                                        dev->name, i);
-                               err = request_irq(sp->entries[i].vector,
-                                         s2io_msix_fifo_handle, 0, sp->desc[i],
-                                                 sp->s2io_entries[i].arg);
-                               /* If either data or addr is zero print it */
-                               if(!(sp->msix_info[i].addr &&
-                                       sp->msix_info[i].data)) {
-                                       DBG_PRINT(ERR_DBG, "%s @ Addr:0x%llx "
-                                               "Data:0x%llx\n",sp->desc[i],
-                                               (unsigned long long)
-                                               sp->msix_info[i].addr,
-                                               (unsigned long long)
-                                               sp->msix_info[i].data);
-                               } else {
-                                       msix_tx_cnt++;
+                                       err = request_irq(sp->entries[i].vector,
+                                               s2io_msix_fifo_handle, 0,
+                                               sp->desc[i],
+                                               sp->s2io_entries[i].arg);
+
                                }
-                       } else {
-                               sprintf(sp->desc[i], "%s:MSI-X-%d-RX",
-                                       dev->name, i);
-                               err = request_irq(sp->entries[i].vector,
-                                         s2io_msix_ring_handle, 0, sp->desc[i],
-                                                 sp->s2io_entries[i].arg);
-                               /* If either data or addr is zero print it */
-                               if(!(sp->msix_info[i].addr &&
+                               /* if either data or addr is zero print it. */
+                               if (!(sp->msix_info[i].addr &&
                                        sp->msix_info[i].data)) {
-                                       DBG_PRINT(ERR_DBG, "%s @ Addr:0x%llx "
-                                               "Data:0x%llx\n",sp->desc[i],
+                                       DBG_PRINT(ERR_DBG,
+                                               "%s @Addr:0x%llx Data:0x%llx\n",
+                                               sp->desc[i],
                                                (unsigned long long)
                                                sp->msix_info[i].addr,
                                                (unsigned long long)
-                                               sp->msix_info[i].data);
-                               } else {
+                                               ntohl(sp->msix_info[i].data));
+                               } else
                                        msix_rx_cnt++;
+                               if (err) {
+                                       remove_msix_isr(sp);
+
+                                       DBG_PRINT(ERR_DBG,
+                                               "%s:MSI-X-%d registration "
+                                               "failed\n", dev->name, i);
+
+                                       DBG_PRINT(ERR_DBG,
+                                               "%s: Defaulting to INTA\n",
+                                               dev->name);
+                                       sp->config.intr_type = INTA;
+                                       break;
                                }
+                               sp->s2io_entries[i].in_use =
+                                       MSIX_REGISTERED_SUCCESS;
                        }
-                       if (err) {
-                               remove_msix_isr(sp);
-                               DBG_PRINT(ERR_DBG,"%s:MSI-X-%d registration "
-                                         "failed\n", dev->name, i);
-                               DBG_PRINT(ERR_DBG, "%s: defaulting to INTA\n",
-                                                dev->name);
-                               sp->config.intr_type = INTA;
-                               break;
-                       }
-                       sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS;
                }
                if (!err) {
-                       printk(KERN_INFO "MSI-X-TX %d entries enabled\n",
-                               msix_tx_cnt);
                        printk(KERN_INFO "MSI-X-RX %d entries enabled\n",
-                               msix_rx_cnt);
+                               --msix_rx_cnt);
+                       DBG_PRINT(INFO_DBG, "MSI-X-TX entries enabled"
+                                               " through alarm vector\n");
                }
        }
        if (sp->config.intr_type == INTA) {
@@ -7080,8 +7126,15 @@ static void do_s2io_card_down(struct s2io_nic * sp, int do_io)
        clear_bit(__S2IO_STATE_CARD_UP, &sp->state);
 
        /* Disable napi */
-       if (config->napi)
-               napi_disable(&sp->napi);
+       if (sp->config.napi) {
+               int off = 0;
+               if (config->intr_type ==  MSI_X) {
+                       for (; off < sp->config.rx_ring_num; off++)
+                               napi_disable(&sp->mac_control.rings[off].napi);
+                       }
+               else
+                       napi_disable(&sp->napi);
+       }
 
        /* disable Tx and Rx traffic on the NIC */
        if (do_io)
@@ -7173,8 +7226,15 @@ static int s2io_card_up(struct s2io_nic * sp)
        }
 
        /* Initialise napi */
-       if (config->napi)
-               napi_enable(&sp->napi);
+       if (config->napi) {
+               int i;
+               if (config->intr_type ==  MSI_X) {
+                       for (i = 0; i < sp->config.rx_ring_num; i++)
+                               napi_enable(&sp->mac_control.rings[i].napi);
+               } else {
+                       napi_enable(&sp->napi);
+               }
+       }
 
        /* Maintain the state prior to the open */
        if (sp->promisc_flg)
@@ -7217,7 +7277,7 @@ static int s2io_card_up(struct s2io_nic * sp)
        /*  Enable select interrupts */
        en_dis_err_alarms(sp, ENA_ALL_INTRS, ENABLE_INTRS);
        if (sp->config.intr_type != INTA)
-               en_dis_able_nic_intrs(sp, ENA_ALL_INTRS, DISABLE_INTRS);
+               en_dis_able_nic_intrs(sp, TX_TRAFFIC_INTR, ENABLE_INTRS);
        else {
                interruptible = TX_TRAFFIC_INTR | RX_TRAFFIC_INTR;
                interruptible |= TX_PIC_INTR;
@@ -7615,9 +7675,6 @@ static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type,
                rx_ring_num = MAX_RX_RINGS;
        }
 
-       if (*dev_intr_type != INTA)
-               napi = 0;
-
        if ((*dev_intr_type != INTA) && (*dev_intr_type != MSI_X)) {
                DBG_PRINT(ERR_DBG, "s2io: Wrong intr_type requested. "
                          "Defaulting to INTA\n");
@@ -7918,8 +7975,6 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
         * will use eth_mac_addr() for  dev->set_mac_address
         * mac address will be set every time dev->open() is called
         */
-       netif_napi_add(dev, &sp->napi, s2io_poll, 32);
-
 #ifdef CONFIG_NET_POLL_CONTROLLER
        dev->poll_controller = s2io_netpoll;
 #endif
@@ -7963,6 +8018,32 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
                }
        }
 
+       if (sp->config.intr_type == MSI_X) {
+               sp->num_entries = config->rx_ring_num + 1;
+               ret = s2io_enable_msi_x(sp);
+
+               if (!ret) {
+                       ret = s2io_test_msi(sp);
+                       /* rollback MSI-X, will re-enable during add_isr() */
+                       remove_msix_isr(sp);
+               }
+               if (ret) {
+
+                       DBG_PRINT(ERR_DBG,
+                         "%s: MSI-X requested but failed to enable\n",
+                         dev->name);
+                       sp->config.intr_type = INTA;
+               }
+       }
+
+       if (config->intr_type ==  MSI_X) {
+               for (i = 0; i < config->rx_ring_num ; i++)
+                       netif_napi_add(dev, &mac_control->rings[i].napi,
+                               s2io_poll_msix, 64);
+       } else {
+               netif_napi_add(dev, &sp->napi, s2io_poll_inta, 64);
+       }
+
        /* Not needed for Herc */
        if (sp->device_type & XFRAME_I_DEVICE) {
                /*
@@ -8013,6 +8094,11 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
        /* store mac addresses from CAM to s2io_nic structure */
        do_s2io_store_unicast_mc(sp);
 
+       /* Configure MSIX vector for number of rings configured plus one */
+       if ((sp->device_type == XFRAME_II_DEVICE) &&
+               (config->intr_type == MSI_X))
+               sp->num_entries = config->rx_ring_num + 1;
+
         /* Store the values of the MSIX table in the s2io_nic structure */
        store_xmsi_data(sp);
        /* reset Nic and bring it to known state */
@@ -8078,8 +8164,14 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
                    break;
        }
 
-       if (napi)
+       switch (sp->config.napi) {
+       case 0:
+               DBG_PRINT(ERR_DBG, "%s: NAPI disabled\n", dev->name);
+               break;
+       case 1:
                DBG_PRINT(ERR_DBG, "%s: NAPI enabled\n", dev->name);
+               break;
+       }
 
        DBG_PRINT(ERR_DBG, "%s: Using %d Tx fifo(s)\n", dev->name,
                sp->config.tx_fifo_num);
index 0709eba..4706f7f 100644 (file)
@@ -706,7 +706,7 @@ struct ring_info {
        /* per-ring buffer counter */
        u32 rx_bufs_left;
 
-       #define MAX_LRO_SESSIONS        32
+#define MAX_LRO_SESSIONS       32
        struct lro lro0_n[MAX_LRO_SESSIONS];
        u8              lro;
 
@@ -725,6 +725,11 @@ struct ring_info {
        /* copy of sp->pdev pointer */
        struct pci_dev *pdev;
 
+       /* Per ring napi struct */
+       struct napi_struct napi;
+
+       unsigned long interrupt_count;
+
        /*
         *  Place holders for the virtual and physical addresses of
         *  all the Rx Blocks
@@ -841,7 +846,7 @@ struct usr_addr {
  * Structure to keep track of the MSI-X vectors and the corresponding
  * argument registered against each vector
  */
-#define MAX_REQUESTED_MSI_X    17
+#define MAX_REQUESTED_MSI_X    9
 struct s2io_msix_entry
 {
        u16 vector;
@@ -849,8 +854,8 @@ struct s2io_msix_entry
        void *arg;
 
        u8 type;
-#define        MSIX_FIFO_TYPE  1
-#define        MSIX_RING_TYPE  2
+#define        MSIX_ALARM_TYPE         1
+#define        MSIX_RING_TYPE          2
 
        u8 in_use;
 #define MSIX_REGISTERED_SUCCESS        0xAA
@@ -877,7 +882,6 @@ struct s2io_nic {
         */
        int pkts_to_process;
        struct net_device *dev;
-       struct napi_struct napi;
        struct mac_info mac_control;
        struct config_param config;
        struct pci_dev *pdev;
@@ -948,6 +952,7 @@ struct s2io_nic {
        */
        u8 other_fifo_idx;
 
+       struct napi_struct napi;
        /*  after blink, the adapter must be restored with original
         *  values.
         */
@@ -962,6 +967,7 @@ struct s2io_nic {
        unsigned long long start_time;
        struct vlan_group *vlgrp;
 #define MSIX_FLG                0xA5
+       int num_entries;
        struct msix_entry *entries;
        int msi_detected;
        wait_queue_head_t msi_wait;
@@ -982,6 +988,7 @@ struct s2io_nic {
        u16             lro_max_aggr_per_sess;
        volatile unsigned long state;
        u64             general_int_mask;
+
 #define VPD_STRING_LEN 80
        u8  product_name[VPD_STRING_LEN];
        u8  serial_num[VPD_STRING_LEN];
@@ -1103,7 +1110,7 @@ static void __devexit s2io_rem_nic(struct pci_dev *pdev);
 static int init_shared_mem(struct s2io_nic *sp);
 static void free_shared_mem(struct s2io_nic *sp);
 static int init_nic(struct s2io_nic *nic);
-static void rx_intr_handler(struct ring_info *ring_data);
+static int rx_intr_handler(struct ring_info *ring_data, int budget);
 static void tx_intr_handler(struct fifo_info *fifo_data);
 static void s2io_handle_errors(void * dev_id);
 
@@ -1114,7 +1121,8 @@ static void s2io_set_multicast(struct net_device *dev);
 static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp);
 static void s2io_link(struct s2io_nic * sp, int link);
 static void s2io_reset(struct s2io_nic * sp);
-static int s2io_poll(struct napi_struct *napi, int budget);
+static int s2io_poll_msix(struct napi_struct *napi, int budget);
+static int s2io_poll_inta(struct napi_struct *napi, int budget);
 static void s2io_init_pci(struct s2io_nic * sp);
 static int do_s2io_prog_unicast(struct net_device *dev, u8 *addr);
 static void s2io_alarm_handle(unsigned long data);
index 888b7de..33bb18f 100644 (file)
@@ -179,8 +179,7 @@ enum sbmac_state {
 #define SBMAC_MAX_TXDESCR      256
 #define SBMAC_MAX_RXDESCR      256
 
-#define ETHER_ALIGN    2
-#define ETHER_ADDR_LEN 6
+#define ETHER_ADDR_LEN         6
 #define ENET_PACKET_SIZE       1518
 /*#define ENET_PACKET_SIZE     9216 */
 
@@ -262,8 +261,6 @@ struct sbmac_softc {
        spinlock_t              sbm_lock;       /* spin lock */
        int                     sbm_devflags;   /* current device flags */
 
-       int                     sbm_buffersize;
-
        /*
         * Controller-specific things
         */
@@ -305,10 +302,11 @@ struct sbmac_softc {
 static void sbdma_initctx(struct sbmacdma *d, struct sbmac_softc *s, int chan,
                          int txrx, int maxdescr);
 static void sbdma_channel_start(struct sbmacdma *d, int rxtx);
-static int sbdma_add_rcvbuffer(struct sbmacdma *d, struct sk_buff *m);
+static int sbdma_add_rcvbuffer(struct sbmac_softc *sc, struct sbmacdma *d,
+                              struct sk_buff *m);
 static int sbdma_add_txbuffer(struct sbmacdma *d, struct sk_buff *m);
 static void sbdma_emptyring(struct sbmacdma *d);
-static void sbdma_fillring(struct sbmacdma *d);
+static void sbdma_fillring(struct sbmac_softc *sc, struct sbmacdma *d);
 static int sbdma_rx_process(struct sbmac_softc *sc, struct sbmacdma *d,
                            int work_to_do, int poll);
 static void sbdma_tx_process(struct sbmac_softc *sc, struct sbmacdma *d,
@@ -777,16 +775,13 @@ static void sbdma_channel_stop(struct sbmacdma *d)
        d->sbdma_remptr = NULL;
 }
 
-static void sbdma_align_skb(struct sk_buff *skb,int power2,int offset)
+static inline void sbdma_align_skb(struct sk_buff *skb,
+                                  unsigned int power2, unsigned int offset)
 {
-       unsigned long addr;
-       unsigned long newaddr;
-
-       addr = (unsigned long) skb->data;
-
-       newaddr = (addr + power2 - 1) & ~(power2 - 1);
+       unsigned char *addr = skb->data;
+       unsigned char *newaddr = PTR_ALIGN(addr, power2);
 
-       skb_reserve(skb,newaddr-addr+offset);
+       skb_reserve(skb, newaddr - addr + offset);
 }
 
 
@@ -797,7 +792,8 @@ static void sbdma_align_skb(struct sk_buff *skb,int power2,int offset)
  *  this queues a buffer for inbound packets.
  *
  *  Input parameters:
- *        d - DMA channel descriptor
+ *        sc - softc structure
+ *         d - DMA channel descriptor
  *        sb - sk_buff to add, or NULL if we should allocate one
  *
  *  Return value:
@@ -806,8 +802,10 @@ static void sbdma_align_skb(struct sk_buff *skb,int power2,int offset)
  ********************************************************************* */
 
 
-static int sbdma_add_rcvbuffer(struct sbmacdma *d, struct sk_buff *sb)
+static int sbdma_add_rcvbuffer(struct sbmac_softc *sc, struct sbmacdma *d,
+                              struct sk_buff *sb)
 {
+       struct net_device *dev = sc->sbm_dev;
        struct sbdmadscr *dsc;
        struct sbdmadscr *nextdsc;
        struct sk_buff *sb_new = NULL;
@@ -848,14 +846,16 @@ static int sbdma_add_rcvbuffer(struct sbmacdma *d, struct sk_buff *sb)
         */
 
        if (sb == NULL) {
-               sb_new = dev_alloc_skb(ENET_PACKET_SIZE + SMP_CACHE_BYTES * 2 + ETHER_ALIGN);
+               sb_new = netdev_alloc_skb(dev, ENET_PACKET_SIZE +
+                                              SMP_CACHE_BYTES * 2 +
+                                              NET_IP_ALIGN);
                if (sb_new == NULL) {
                        pr_info("%s: sk_buff allocation failed\n",
                               d->sbdma_eth->sbm_dev->name);
                        return -ENOBUFS;
                }
 
-               sbdma_align_skb(sb_new, SMP_CACHE_BYTES, ETHER_ALIGN);
+               sbdma_align_skb(sb_new, SMP_CACHE_BYTES, NET_IP_ALIGN);
        }
        else {
                sb_new = sb;
@@ -874,10 +874,10 @@ static int sbdma_add_rcvbuffer(struct sbmacdma *d, struct sk_buff *sb)
         * Do not interrupt per DMA transfer.
         */
        dsc->dscr_a = virt_to_phys(sb_new->data) |
-               V_DMA_DSCRA_A_SIZE(NUMCACHEBLKS(pktsize+ETHER_ALIGN)) | 0;
+               V_DMA_DSCRA_A_SIZE(NUMCACHEBLKS(pktsize + NET_IP_ALIGN)) | 0;
 #else
        dsc->dscr_a = virt_to_phys(sb_new->data) |
-               V_DMA_DSCRA_A_SIZE(NUMCACHEBLKS(pktsize+ETHER_ALIGN)) |
+               V_DMA_DSCRA_A_SIZE(NUMCACHEBLKS(pktsize + NET_IP_ALIGN)) |
                M_DMA_DSCRA_INTERRUPT;
 #endif
 
@@ -1032,18 +1032,19 @@ static void sbdma_emptyring(struct sbmacdma *d)
  *  with sk_buffs
  *
  *  Input parameters:
- *        d - DMA channel
+ *        sc - softc structure
+ *         d - DMA channel
  *
  *  Return value:
  *        nothing
  ********************************************************************* */
 
-static void sbdma_fillring(struct sbmacdma *d)
+static void sbdma_fillring(struct sbmac_softc *sc, struct sbmacdma *d)
 {
        int idx;
 
-       for (idx = 0; idx < SBMAC_MAX_RXDESCR-1; idx++) {
-               if (sbdma_add_rcvbuffer(d,NULL) != 0)
+       for (idx = 0; idx < SBMAC_MAX_RXDESCR - 1; idx++) {
+               if (sbdma_add_rcvbuffer(sc, d, NULL) != 0)
                        break;
        }
 }
@@ -1159,10 +1160,11 @@ again:
                         * packet and put it right back on the receive ring.
                         */
 
-                       if (unlikely (sbdma_add_rcvbuffer(d,NULL) ==
-                                     -ENOBUFS)) {
+                       if (unlikely(sbdma_add_rcvbuffer(sc, d, NULL) ==
+                                    -ENOBUFS)) {
                                dev->stats.rx_dropped++;
-                               sbdma_add_rcvbuffer(d,sb); /* re-add old buffer */
+                               /* Re-add old buffer */
+                               sbdma_add_rcvbuffer(sc, d, sb);
                                /* No point in continuing at the moment */
                                printk(KERN_ERR "dropped packet (1)\n");
                                d->sbdma_remptr = SBDMA_NEXTBUF(d,sbdma_remptr);
@@ -1212,7 +1214,7 @@ again:
                         * put it back on the receive ring.
                         */
                        dev->stats.rx_errors++;
-                       sbdma_add_rcvbuffer(d,sb);
+                       sbdma_add_rcvbuffer(sc, d, sb);
                }
 
 
@@ -1570,7 +1572,7 @@ static void sbmac_channel_start(struct sbmac_softc *s)
         * Fill the receive ring
         */
 
-       sbdma_fillring(&(s->sbm_rxdma));
+       sbdma_fillring(s, &(s->sbm_rxdma));
 
        /*
         * Turn on the rest of the bits in the enable register
@@ -2312,13 +2314,6 @@ static int sbmac_init(struct platform_device *pldev, long long base)
                dev->dev_addr[i] = eaddr[i];
        }
 
-
-       /*
-        * Init packet size
-        */
-
-       sc->sbm_buffersize = ENET_PACKET_SIZE + SMP_CACHE_BYTES * 2 + ETHER_ALIGN;
-
        /*
         * Initialize context (get pointers to registers and stuff), then
         * allocate the memory for the descriptor tables.
index f64a860..b4b6380 100644 (file)
@@ -953,9 +953,6 @@ static int sc92031_start_xmit(struct sk_buff *skb, struct net_device *dev)
        unsigned entry;
        u32 tx_status;
 
-       if (skb_padto(skb, ETH_ZLEN))
-               return NETDEV_TX_OK;
-
        if (unlikely(skb->len > TX_BUF_SIZE)) {
                dev->stats.tx_dropped++;
                goto out;
@@ -975,6 +972,11 @@ static int sc92031_start_xmit(struct sk_buff *skb, struct net_device *dev)
        skb_copy_and_csum_dev(skb, priv->tx_bufs + entry * TX_BUF_SIZE);
 
        len = skb->len;
+       if (unlikely(len < ETH_ZLEN)) {
+               memset(priv->tx_bufs + entry * TX_BUF_SIZE + len,
+                               0, ETH_ZLEN - len);
+               len = ETH_ZLEN;
+       }
 
        wmb();
 
index 2806201..2c79d27 100644 (file)
@@ -483,7 +483,7 @@ typedef union efx_oword {
 #endif
 
 #define EFX_SET_OWORD_FIELD_VER(efx, oword, field, value) do { \
-       if (FALCON_REV(efx) >= FALCON_REV_B0) {                    \
+       if (falcon_rev(efx) >= FALCON_REV_B0) {                    \
                EFX_SET_OWORD_FIELD((oword), field##_B0, (value)); \
        } else { \
                EFX_SET_OWORD_FIELD((oword), field##_A1, (value)); \
@@ -491,7 +491,7 @@ typedef union efx_oword {
 } while (0)
 
 #define EFX_QWORD_FIELD_VER(efx, qword, field) \
-       (FALCON_REV(efx) >= FALCON_REV_B0 ?     \
+       (falcon_rev(efx) >= FALCON_REV_B0 ?     \
         EFX_QWORD_FIELD((qword), field##_B0) : \
         EFX_QWORD_FIELD((qword), field##_A1))
 
@@ -501,8 +501,5 @@ typedef union efx_oword {
 #define DMA_ADDR_T_WIDTH       (8 * sizeof(dma_addr_t))
 #define EFX_DMA_TYPE_WIDTH(width) \
        (((width) < DMA_ADDR_T_WIDTH) ? (width) : DMA_ADDR_T_WIDTH)
-#define EFX_DMA_MAX_MASK ((DMA_ADDR_T_WIDTH == 64) ? \
-                         ~((u64) 0) : ~((u32) 0))
-#define EFX_DMA_MASK(mask) ((mask) & EFX_DMA_MAX_MASK)
 
 #endif /* EFX_BITFIELD_H */
index eecaa6d..7fc0328 100644 (file)
@@ -27,10 +27,8 @@ static void blink_led_timer(unsigned long context)
        struct efx_blinker *bl = &efx->board_info.blinker;
        efx->board_info.set_fault_led(efx, bl->state);
        bl->state = !bl->state;
-       if (bl->resubmit) {
-               bl->timer.expires = jiffies + BLINK_INTERVAL;
-               add_timer(&bl->timer);
-       }
+       if (bl->resubmit)
+               mod_timer(&bl->timer, jiffies + BLINK_INTERVAL);
 }
 
 static void board_blink(struct efx_nic *efx, int blink)
@@ -44,8 +42,7 @@ static void board_blink(struct efx_nic *efx, int blink)
                blinker->state = 0;
                setup_timer(&blinker->timer, blink_led_timer,
                            (unsigned long)efx);
-               blinker->timer.expires = jiffies + BLINK_INTERVAL;
-               add_timer(&blinker->timer);
+               mod_timer(&blinker->timer, jiffies + BLINK_INTERVAL);
        } else {
                blinker->resubmit = 0;
                if (blinker->timer.function)
index 418f2e5..4497606 100644 (file)
@@ -199,11 +199,12 @@ static inline int efx_process_channel(struct efx_channel *channel, int rx_quota)
  */
 static inline void efx_channel_processed(struct efx_channel *channel)
 {
-       /* Write to EVQ_RPTR_REG.  If a new event arrived in a race
-        * with finishing processing, a new interrupt will be raised.
-        */
+       /* The interrupt handler for this channel may set work_pending
+        * as soon as we acknowledge the events we've seen.  Make sure
+        * it's cleared before then. */
        channel->work_pending = 0;
-       smp_wmb(); /* Ensure channel updated before any new interrupt. */
+       smp_wmb();
+
        falcon_eventq_read_ack(channel);
 }
 
@@ -265,7 +266,7 @@ void efx_process_channel_now(struct efx_channel *channel)
        napi_disable(&channel->napi_str);
 
        /* Poll the channel */
-       (void) efx_process_channel(channel, efx->type->evq_size);
+       efx_process_channel(channel, efx->type->evq_size);
 
        /* Ack the eventq. This may cause an interrupt to be generated
         * when they are reenabled */
@@ -317,26 +318,6 @@ static void efx_remove_eventq(struct efx_channel *channel)
  *
  *************************************************************************/
 
-/* Setup per-NIC RX buffer parameters.
- * Calculate the rx buffer allocation parameters required to support
- * the current MTU, including padding for header alignment and overruns.
- */
-static void efx_calc_rx_buffer_params(struct efx_nic *efx)
-{
-       unsigned int order, len;
-
-       len = (max(EFX_PAGE_IP_ALIGN, NET_IP_ALIGN) +
-              EFX_MAX_FRAME_LEN(efx->net_dev->mtu) +
-              efx->type->rx_buffer_padding);
-
-       /* Calculate page-order */
-       for (order = 0; ((1u << order) * PAGE_SIZE) < len; ++order)
-               ;
-
-       efx->rx_buffer_len = len;
-       efx->rx_buffer_order = order;
-}
-
 static int efx_probe_channel(struct efx_channel *channel)
 {
        struct efx_tx_queue *tx_queue;
@@ -387,7 +368,14 @@ static int efx_init_channels(struct efx_nic *efx)
        struct efx_channel *channel;
        int rc = 0;
 
-       efx_calc_rx_buffer_params(efx);
+       /* Calculate the rx buffer allocation parameters required to
+        * support the current MTU, including padding for header
+        * alignment and overruns.
+        */
+       efx->rx_buffer_len = (max(EFX_PAGE_IP_ALIGN, NET_IP_ALIGN) +
+                             EFX_MAX_FRAME_LEN(efx->net_dev->mtu) +
+                             efx->type->rx_buffer_padding);
+       efx->rx_buffer_order = get_order(efx->rx_buffer_len);
 
        /* Initialise the channels */
        efx_for_each_channel(channel, efx) {
@@ -440,9 +428,12 @@ static void efx_start_channel(struct efx_channel *channel)
                netif_napi_add(channel->napi_dev, &channel->napi_str,
                               efx_poll, napi_weight);
 
+       /* The interrupt handler for this channel may set work_pending
+        * as soon as we enable it.  Make sure it's cleared before
+        * then.  Similarly, make sure it sees the enabled flag set. */
        channel->work_pending = 0;
        channel->enabled = 1;
-       smp_wmb(); /* ensure channel updated before first interrupt */
+       smp_wmb();
 
        napi_enable(&channel->napi_str);
 
@@ -704,7 +695,7 @@ static void efx_stop_port(struct efx_nic *efx)
        mutex_unlock(&efx->mac_lock);
 
        /* Serialise against efx_set_multicast_list() */
-       if (NET_DEV_REGISTERED(efx)) {
+       if (efx_dev_registered(efx)) {
                netif_tx_lock_bh(efx->net_dev);
                netif_tx_unlock_bh(efx->net_dev);
        }
@@ -791,22 +782,23 @@ static int efx_init_io(struct efx_nic *efx)
        efx->membase = ioremap_nocache(efx->membase_phys,
                                       efx->type->mem_map_size);
        if (!efx->membase) {
-               EFX_ERR(efx, "could not map memory BAR %d at %lx+%x\n",
-                       efx->type->mem_bar, efx->membase_phys,
+               EFX_ERR(efx, "could not map memory BAR %d at %llx+%x\n",
+                       efx->type->mem_bar,
+                       (unsigned long long)efx->membase_phys,
                        efx->type->mem_map_size);
                rc = -ENOMEM;
                goto fail4;
        }
-       EFX_LOG(efx, "memory BAR %u at %lx+%x (virtual %p)\n",
-               efx->type->mem_bar, efx->membase_phys, efx->type->mem_map_size,
-               efx->membase);
+       EFX_LOG(efx, "memory BAR %u at %llx+%x (virtual %p)\n",
+               efx->type->mem_bar, (unsigned long long)efx->membase_phys,
+               efx->type->mem_map_size, efx->membase);
 
        return 0;
 
  fail4:
        release_mem_region(efx->membase_phys, efx->type->mem_map_size);
  fail3:
-       efx->membase_phys = 0UL;
+       efx->membase_phys = 0;
  fail2:
        pci_disable_device(efx->pci_dev);
  fail1:
@@ -824,7 +816,7 @@ static void efx_fini_io(struct efx_nic *efx)
 
        if (efx->membase_phys) {
                pci_release_region(efx->pci_dev, efx->type->mem_bar);
-               efx->membase_phys = 0UL;
+               efx->membase_phys = 0;
        }
 
        pci_disable_device(efx->pci_dev);
@@ -1043,7 +1035,7 @@ static void efx_start_all(struct efx_nic *efx)
                return;
        if ((efx->state != STATE_RUNNING) && (efx->state != STATE_INIT))
                return;
-       if (NET_DEV_REGISTERED(efx) && !netif_running(efx->net_dev))
+       if (efx_dev_registered(efx) && !netif_running(efx->net_dev))
                return;
 
        /* Mark the port as enabled so port reconfigurations can start, then
@@ -1073,9 +1065,8 @@ static void efx_flush_all(struct efx_nic *efx)
        cancel_delayed_work_sync(&efx->monitor_work);
 
        /* Ensure that all RX slow refills are complete. */
-       efx_for_each_rx_queue(rx_queue, efx) {
+       efx_for_each_rx_queue(rx_queue, efx)
                cancel_delayed_work_sync(&rx_queue->work);
-       }
 
        /* Stop scheduled port reconfigurations */
        cancel_work_sync(&efx->reconfigure_work);
@@ -1101,9 +1092,10 @@ static void efx_stop_all(struct efx_nic *efx)
        falcon_disable_interrupts(efx);
        if (efx->legacy_irq)
                synchronize_irq(efx->legacy_irq);
-       efx_for_each_channel_with_interrupt(channel, efx)
+       efx_for_each_channel_with_interrupt(channel, efx) {
                if (channel->irq)
                        synchronize_irq(channel->irq);
+       }
 
        /* Stop all NAPI processing and synchronous rx refills */
        efx_for_each_channel(channel, efx)
@@ -1125,7 +1117,7 @@ static void efx_stop_all(struct efx_nic *efx)
        /* Stop the kernel transmit interface late, so the watchdog
         * timer isn't ticking over the flush */
        efx_stop_queue(efx);
-       if (NET_DEV_REGISTERED(efx)) {
+       if (efx_dev_registered(efx)) {
                netif_tx_lock_bh(efx->net_dev);
                netif_tx_unlock_bh(efx->net_dev);
        }
@@ -1344,13 +1336,17 @@ static int efx_net_stop(struct net_device *net_dev)
        return 0;
 }
 
-/* Context: process, dev_base_lock held, non-blocking. */
+/* Context: process, dev_base_lock or RTNL held, non-blocking. */
 static struct net_device_stats *efx_net_stats(struct net_device *net_dev)
 {
        struct efx_nic *efx = net_dev->priv;
        struct efx_mac_stats *mac_stats = &efx->mac_stats;
        struct net_device_stats *stats = &net_dev->stats;
 
+       /* Update stats if possible, but do not wait if another thread
+        * is updating them (or resetting the NIC); slightly stale
+        * stats are acceptable.
+        */
        if (!spin_trylock(&efx->stats_lock))
                return stats;
        if (efx->state == STATE_RUNNING) {
@@ -1494,7 +1490,7 @@ static void efx_set_multicast_list(struct net_device *net_dev)
 static int efx_netdev_event(struct notifier_block *this,
                            unsigned long event, void *ptr)
 {
-       struct net_device *net_dev = (struct net_device *)ptr;
+       struct net_device *net_dev = ptr;
 
        if (net_dev->open == efx_net_open && event == NETDEV_CHANGENAME) {
                struct efx_nic *efx = net_dev->priv;
@@ -1563,7 +1559,7 @@ static void efx_unregister_netdev(struct efx_nic *efx)
        efx_for_each_tx_queue(tx_queue, efx)
                efx_release_tx_buffers(tx_queue);
 
-       if (NET_DEV_REGISTERED(efx)) {
+       if (efx_dev_registered(efx)) {
                strlcpy(efx->name, pci_name(efx->pci_dev), sizeof(efx->name));
                unregister_netdev(efx->net_dev);
        }
@@ -1688,7 +1684,7 @@ static int efx_reset(struct efx_nic *efx)
        if (method == RESET_TYPE_DISABLE) {
                /* Reinitialise the device anyway so the driver unload sequence
                 * can talk to the external SRAM */
-               (void) falcon_init_nic(efx);
+               falcon_init_nic(efx);
                rc = -EIO;
                goto fail4;
        }
index b57cc68..d3f749c 100644 (file)
@@ -116,17 +116,8 @@ MODULE_PARM_DESC(rx_xon_thresh_bytes, "RX fifo XON threshold");
  **************************************************************************
  */
 
-/* DMA address mask (up to 46-bit, avoiding compiler warnings)
- *
- * Note that it is possible to have a platform with 64-bit longs and
- * 32-bit DMA addresses, or vice versa.  EFX_DMA_MASK takes care of the
- * platform DMA mask.
- */
-#if BITS_PER_LONG == 64
-#define FALCON_DMA_MASK EFX_DMA_MASK(0x00003fffffffffffUL)
-#else
-#define FALCON_DMA_MASK EFX_DMA_MASK(0x00003fffffffffffULL)
-#endif
+/* DMA address mask */
+#define FALCON_DMA_MASK DMA_BIT_MASK(46)
 
 /* TX DMA length mask (13-bit) */
 #define FALCON_TX_DMA_MASK (4096 - 1)
@@ -145,7 +136,7 @@ MODULE_PARM_DESC(rx_xon_thresh_bytes, "RX fifo XON threshold");
 #define PCI_EXP_LNKSTA_LNK_WID_LBN     4
 
 #define FALCON_IS_DUAL_FUNC(efx)               \
-       (FALCON_REV(efx) < FALCON_REV_B0)
+       (falcon_rev(efx) < FALCON_REV_B0)
 
 /**************************************************************************
  *
@@ -465,7 +456,7 @@ int falcon_init_tx(struct efx_tx_queue *tx_queue)
                              TX_DESCQ_TYPE, 0,
                              TX_NON_IP_DROP_DIS_B0, 1);
 
-       if (FALCON_REV(efx) >= FALCON_REV_B0) {
+       if (falcon_rev(efx) >= FALCON_REV_B0) {
                int csum = !(efx->net_dev->features & NETIF_F_IP_CSUM);
                EFX_SET_OWORD_FIELD(tx_desc_ptr, TX_IP_CHKSM_DIS_B0, csum);
                EFX_SET_OWORD_FIELD(tx_desc_ptr, TX_TCP_CHKSM_DIS_B0, csum);
@@ -474,7 +465,7 @@ int falcon_init_tx(struct efx_tx_queue *tx_queue)
        falcon_write_table(efx, &tx_desc_ptr, efx->type->txd_ptr_tbl_base,
                           tx_queue->queue);
 
-       if (FALCON_REV(efx) < FALCON_REV_B0) {
+       if (falcon_rev(efx) < FALCON_REV_B0) {
                efx_oword_t reg;
 
                BUG_ON(tx_queue->queue >= 128); /* HW limit */
@@ -635,7 +626,7 @@ int falcon_init_rx(struct efx_rx_queue *rx_queue)
        efx_oword_t rx_desc_ptr;
        struct efx_nic *efx = rx_queue->efx;
        int rc;
-       int is_b0 = FALCON_REV(efx) >= FALCON_REV_B0;
+       int is_b0 = falcon_rev(efx) >= FALCON_REV_B0;
        int iscsi_digest_en = is_b0;
 
        EFX_LOG(efx, "RX queue %d ring in special buffers %d-%d\n",
@@ -822,10 +813,10 @@ static inline void falcon_handle_tx_event(struct efx_channel *channel,
                tx_ev_q_label = EFX_QWORD_FIELD(*event, TX_EV_Q_LABEL);
                tx_queue = &efx->tx_queue[tx_ev_q_label];
 
-               if (NET_DEV_REGISTERED(efx))
+               if (efx_dev_registered(efx))
                        netif_tx_lock(efx->net_dev);
                falcon_notify_tx_desc(tx_queue);
-               if (NET_DEV_REGISTERED(efx))
+               if (efx_dev_registered(efx))
                        netif_tx_unlock(efx->net_dev);
        } else if (EFX_QWORD_FIELD(*event, TX_EV_PKT_ERR) &&
                   EFX_WORKAROUND_10727(efx)) {
@@ -884,7 +875,7 @@ static void falcon_handle_rx_not_ok(struct efx_rx_queue *rx_queue,
                                                   RX_EV_TCP_UDP_CHKSUM_ERR);
        rx_ev_eth_crc_err = EFX_QWORD_FIELD(*event, RX_EV_ETH_CRC_ERR);
        rx_ev_frm_trunc = EFX_QWORD_FIELD(*event, RX_EV_FRM_TRUNC);
-       rx_ev_drib_nib = ((FALCON_REV(efx) >= FALCON_REV_B0) ?
+       rx_ev_drib_nib = ((falcon_rev(efx) >= FALCON_REV_B0) ?
                          0 : EFX_QWORD_FIELD(*event, RX_EV_DRIB_NIB));
        rx_ev_pause_frm = EFX_QWORD_FIELD(*event, RX_EV_PAUSE_FRM_ERR);
 
@@ -1065,7 +1056,7 @@ static void falcon_handle_global_event(struct efx_channel *channel,
            EFX_QWORD_FIELD(*event, XG_PHY_INTR))
                is_phy_event = 1;
 
-       if ((FALCON_REV(efx) >= FALCON_REV_B0) &&
+       if ((falcon_rev(efx) >= FALCON_REV_B0) &&
            EFX_OWORD_FIELD(*event, XG_MNT_INTR_B0))
                is_phy_event = 1;
 
@@ -1405,7 +1396,7 @@ static inline void falcon_irq_ack_a1(struct efx_nic *efx)
 static irqreturn_t falcon_fatal_interrupt(struct efx_nic *efx)
 {
        struct falcon_nic_data *nic_data = efx->nic_data;
-       efx_oword_t *int_ker = (efx_oword_t *) efx->irq_status.addr;
+       efx_oword_t *int_ker = efx->irq_status.addr;
        efx_oword_t fatal_intr;
        int error, mem_perr;
        static int n_int_errors;
@@ -1451,8 +1442,8 @@ out:
  */
 static irqreturn_t falcon_legacy_interrupt_b0(int irq, void *dev_id)
 {
-       struct efx_nic *efx = (struct efx_nic *)dev_id;
-       efx_oword_t *int_ker = (efx_oword_t *) efx->irq_status.addr;
+       struct efx_nic *efx = dev_id;
+       efx_oword_t *int_ker = efx->irq_status.addr;
        struct efx_channel *channel;
        efx_dword_t reg;
        u32 queues;
@@ -1489,8 +1480,8 @@ static irqreturn_t falcon_legacy_interrupt_b0(int irq, void *dev_id)
 
 static irqreturn_t falcon_legacy_interrupt_a1(int irq, void *dev_id)
 {
-       struct efx_nic *efx = (struct efx_nic *)dev_id;
-       efx_oword_t *int_ker = (efx_oword_t *) efx->irq_status.addr;
+       struct efx_nic *efx = dev_id;
+       efx_oword_t *int_ker = efx->irq_status.addr;
        struct efx_channel *channel;
        int syserr;
        int queues;
@@ -1542,9 +1533,9 @@ static irqreturn_t falcon_legacy_interrupt_a1(int irq, void *dev_id)
  */
 static irqreturn_t falcon_msi_interrupt(int irq, void *dev_id)
 {
-       struct efx_channel *channel = (struct efx_channel *)dev_id;
+       struct efx_channel *channel = dev_id;
        struct efx_nic *efx = channel->efx;
-       efx_oword_t *int_ker = (efx_oword_t *) efx->irq_status.addr;
+       efx_oword_t *int_ker = efx->irq_status.addr;
        int syserr;
 
        efx->last_irq_cpu = raw_smp_processor_id();
@@ -1572,7 +1563,7 @@ static void falcon_setup_rss_indir_table(struct efx_nic *efx)
        unsigned long offset;
        efx_dword_t dword;
 
-       if (FALCON_REV(efx) < FALCON_REV_B0)
+       if (falcon_rev(efx) < FALCON_REV_B0)
                return;
 
        for (offset = RX_RSS_INDIR_TBL_B0;
@@ -1595,7 +1586,7 @@ int falcon_init_interrupt(struct efx_nic *efx)
 
        if (!EFX_INT_MODE_USE_MSI(efx)) {
                irq_handler_t handler;
-               if (FALCON_REV(efx) >= FALCON_REV_B0)
+               if (falcon_rev(efx) >= FALCON_REV_B0)
                        handler = falcon_legacy_interrupt_b0;
                else
                        handler = falcon_legacy_interrupt_a1;
@@ -1636,12 +1627,13 @@ void falcon_fini_interrupt(struct efx_nic *efx)
        efx_oword_t reg;
 
        /* Disable MSI/MSI-X interrupts */
-       efx_for_each_channel_with_interrupt(channel, efx)
+       efx_for_each_channel_with_interrupt(channel, efx) {
                if (channel->irq)
                        free_irq(channel->irq, channel);
+       }
 
        /* ACK legacy interrupt */
-       if (FALCON_REV(efx) >= FALCON_REV_B0)
+       if (falcon_rev(efx) >= FALCON_REV_B0)
                falcon_read(efx, &reg, INT_ISR0_B0);
        else
                falcon_irq_ack_a1(efx);
@@ -1732,7 +1724,7 @@ void falcon_drain_tx_fifo(struct efx_nic *efx)
        efx_oword_t temp;
        int count;
 
-       if ((FALCON_REV(efx) < FALCON_REV_B0) ||
+       if ((falcon_rev(efx) < FALCON_REV_B0) ||
            (efx->loopback_mode != LOOPBACK_NONE))
                return;
 
@@ -1785,7 +1777,7 @@ void falcon_deconfigure_mac_wrapper(struct efx_nic *efx)
 {
        efx_oword_t temp;
 
-       if (FALCON_REV(efx) < FALCON_REV_B0)
+       if (falcon_rev(efx) < FALCON_REV_B0)
                return;
 
        /* Isolate the MAC -> RX */
@@ -1823,7 +1815,7 @@ void falcon_reconfigure_mac_wrapper(struct efx_nic *efx)
                             MAC_SPEED, link_speed);
        /* On B0, MAC backpressure can be disabled and packets get
         * discarded. */
-       if (FALCON_REV(efx) >= FALCON_REV_B0) {
+       if (falcon_rev(efx) >= FALCON_REV_B0) {
                EFX_SET_OWORD_FIELD(reg, TXFIFO_DRAIN_EN_B0,
                                    !efx->link_up);
        }
@@ -1841,7 +1833,7 @@ void falcon_reconfigure_mac_wrapper(struct efx_nic *efx)
        EFX_SET_OWORD_FIELD_VER(efx, reg, RX_XOFF_MAC_EN, tx_fc);
 
        /* Unisolate the MAC -> RX */
-       if (FALCON_REV(efx) >= FALCON_REV_B0)
+       if (falcon_rev(efx) >= FALCON_REV_B0)
                EFX_SET_OWORD_FIELD(reg, RX_INGR_EN_B0, 1);
        falcon_write(efx, &reg, RX_CFG_REG_KER);
 }
@@ -1856,7 +1848,7 @@ int falcon_dma_stats(struct efx_nic *efx, unsigned int done_offset)
                return 0;
 
        /* Statistics fetch will fail if the MAC is in TX drain */
-       if (FALCON_REV(efx) >= FALCON_REV_B0) {
+       if (falcon_rev(efx) >= FALCON_REV_B0) {
                efx_oword_t temp;
                falcon_read(efx, &temp, MAC0_CTRL_REG_KER);
                if (EFX_OWORD_FIELD(temp, TXFIFO_DRAIN_EN_B0))
@@ -1940,7 +1932,7 @@ static int falcon_gmii_wait(struct efx_nic *efx)
 static void falcon_mdio_write(struct net_device *net_dev, int phy_id,
                              int addr, int value)
 {
-       struct efx_nic *efx = (struct efx_nic *)net_dev->priv;
+       struct efx_nic *efx = net_dev->priv;
        unsigned int phy_id2 = phy_id & FALCON_PHY_ID_ID_MASK;
        efx_oword_t reg;
 
@@ -2008,7 +2000,7 @@ static void falcon_mdio_write(struct net_device *net_dev, int phy_id,
  * could be read, -1 will be returned. */
 static int falcon_mdio_read(struct net_device *net_dev, int phy_id, int addr)
 {
-       struct efx_nic *efx = (struct efx_nic *)net_dev->priv;
+       struct efx_nic *efx = net_dev->priv;
        unsigned int phy_addr = phy_id & FALCON_PHY_ID_ID_MASK;
        efx_oword_t reg;
        int value = -1;
@@ -2113,7 +2105,7 @@ int falcon_probe_port(struct efx_nic *efx)
        falcon_init_mdio(&efx->mii);
 
        /* Hardware flow ctrl. FalconA RX FIFO too small for pause generation */
-       if (FALCON_REV(efx) >= FALCON_REV_B0)
+       if (falcon_rev(efx) >= FALCON_REV_B0)
                efx->flow_control = EFX_FC_RX | EFX_FC_TX;
        else
                efx->flow_control = EFX_FC_RX;
@@ -2373,7 +2365,7 @@ static int falcon_probe_nic_variant(struct efx_nic *efx)
                return -ENODEV;
        }
 
-       switch (FALCON_REV(efx)) {
+       switch (falcon_rev(efx)) {
        case FALCON_REV_A0:
        case 0xff:
                EFX_ERR(efx, "Falcon rev A0 not supported\n");
@@ -2399,7 +2391,7 @@ static int falcon_probe_nic_variant(struct efx_nic *efx)
                break;
 
        default:
-               EFX_ERR(efx, "Unknown Falcon rev %d\n", FALCON_REV(efx));
+               EFX_ERR(efx, "Unknown Falcon rev %d\n", falcon_rev(efx));
                return -ENODEV;
        }
 
@@ -2419,7 +2411,7 @@ int falcon_probe_nic(struct efx_nic *efx)
 
        /* Allocate storage for hardware specific data */
        nic_data = kzalloc(sizeof(*nic_data), GFP_KERNEL);
-       efx->nic_data = (void *) nic_data;
+       efx->nic_data = nic_data;
 
        /* Determine number of ports etc. */
        rc = falcon_probe_nic_variant(efx);
@@ -2489,13 +2481,10 @@ int falcon_probe_nic(struct efx_nic *efx)
  */
 int falcon_init_nic(struct efx_nic *efx)
 {
-       struct falcon_nic_data *data;
        efx_oword_t temp;
        unsigned thresh;
        int rc;
 
-       data = (struct falcon_nic_data *)efx->nic_data;
-
        /* Set up the address region register. This is only needed
         * for the B0 FPGA, but since we are just pushing in the
         * reset defaults this may as well be unconditional. */
@@ -2562,7 +2551,7 @@ int falcon_init_nic(struct efx_nic *efx)
 
        /* Set number of RSS queues for receive path. */
        falcon_read(efx, &temp, RX_FILTER_CTL_REG);
-       if (FALCON_REV(efx) >= FALCON_REV_B0)
+       if (falcon_rev(efx) >= FALCON_REV_B0)
                EFX_SET_OWORD_FIELD(temp, NUM_KER, 0);
        else
                EFX_SET_OWORD_FIELD(temp, NUM_KER, efx->rss_queues - 1);
@@ -2600,7 +2589,7 @@ int falcon_init_nic(struct efx_nic *efx)
        /* Prefetch threshold 2 => fetch when descriptor cache half empty */
        EFX_SET_OWORD_FIELD(temp, TX_PREF_THRESHOLD, 2);
        /* Squash TX of packets of 16 bytes or less */
-       if (FALCON_REV(efx) >= FALCON_REV_B0 && EFX_WORKAROUND_9141(efx))
+       if (falcon_rev(efx) >= FALCON_REV_B0 && EFX_WORKAROUND_9141(efx))
                EFX_SET_OWORD_FIELD(temp, TX_FLUSH_MIN_LEN_EN_B0, 1);
        falcon_write(efx, &temp, TX_CFG2_REG_KER);
 
@@ -2617,7 +2606,7 @@ int falcon_init_nic(struct efx_nic *efx)
        if (EFX_WORKAROUND_7575(efx))
                EFX_SET_OWORD_FIELD_VER(efx, temp, RX_USR_BUF_SIZE,
                                        (3 * 4096) / 32);
-       if (FALCON_REV(efx) >= FALCON_REV_B0)
+       if (falcon_rev(efx) >= FALCON_REV_B0)
                EFX_SET_OWORD_FIELD(temp, RX_INGR_EN_B0, 1);
 
        /* RX FIFO flow control thresholds */
@@ -2633,7 +2622,7 @@ int falcon_init_nic(struct efx_nic *efx)
        falcon_write(efx, &temp, RX_CFG_REG_KER);
 
        /* Set destination of both TX and RX Flush events */
-       if (FALCON_REV(efx) >= FALCON_REV_B0) {
+       if (falcon_rev(efx) >= FALCON_REV_B0) {
                EFX_POPULATE_OWORD_1(temp, FLS_EVQ_ID, 0);
                falcon_write(efx, &temp, DP_CTRL_REG);
        }
@@ -2647,7 +2636,7 @@ void falcon_remove_nic(struct efx_nic *efx)
 
        falcon_free_buffer(efx, &efx->irq_status);
 
-       (void) falcon_reset_hw(efx, RESET_TYPE_ALL);
+       falcon_reset_hw(efx, RESET_TYPE_ALL);
 
        /* Release the second function after the reset */
        if (nic_data->pci_dev2) {
index 6117403..492f9bc 100644 (file)
@@ -23,7 +23,10 @@ enum falcon_revision {
        FALCON_REV_B0 = 2,
 };
 
-#define FALCON_REV(efx) ((efx)->pci_dev->revision)
+static inline int falcon_rev(struct efx_nic *efx)
+{
+       return efx->pci_dev->revision;
+}
 
 extern struct efx_nic_type falcon_a_nic_type;
 extern struct efx_nic_type falcon_b_nic_type;
index 06e2d68..6d00311 100644 (file)
@@ -1125,7 +1125,7 @@ struct falcon_nvconfig_board_v2 {
        u8 port1_phy_type;
        __le16 asic_sub_revision;
        __le16 board_revision;
-} __attribute__ ((packed));
+} __packed;
 
 #define NVCONFIG_BASE 0x300
 #define NVCONFIG_BOARD_MAGIC_NUM 0xFA1C
@@ -1144,6 +1144,6 @@ struct falcon_nvconfig {
        __le16 board_struct_ver;
        __le16 board_checksum;
        struct falcon_nvconfig_board_v2 board_v2;
-} __attribute__ ((packed));
+} __packed;
 
 #endif /* EFX_FALCON_HWDEFS_H */
index ea08184..6670cdf 100644 (file)
 #define FALCON_USE_QWORD_IO 1
 #endif
 
-#define _falcon_writeq(efx, value, reg) \
-       __raw_writeq((__force u64) (value), (efx)->membase + (reg))
-#define _falcon_writel(efx, value, reg) \
-       __raw_writel((__force u32) (value), (efx)->membase + (reg))
-#define _falcon_readq(efx, reg) \
-       ((__force __le64) __raw_readq((efx)->membase + (reg)))
-#define _falcon_readl(efx, reg) \
-       ((__force __le32) __raw_readl((efx)->membase + (reg)))
+#ifdef FALCON_USE_QWORD_IO
+static inline void _falcon_writeq(struct efx_nic *efx, __le64 value,
+                                 unsigned int reg)
+{
+       __raw_writeq((__force u64)value, efx->membase + reg);
+}
+static inline __le64 _falcon_readq(struct efx_nic *efx, unsigned int reg)
+{
+       return (__force __le64)__raw_readq(efx->membase + reg);
+}
+#endif
+
+static inline void _falcon_writel(struct efx_nic *efx, __le32 value,
+                                 unsigned int reg)
+{
+       __raw_writel((__force u32)value, efx->membase + reg);
+}
+static inline __le32 _falcon_readl(struct efx_nic *efx, unsigned int reg)
+{
+       return (__force __le32)__raw_readl(efx->membase + reg);
+}
 
 /* Writes to a normal 16-byte Falcon register, locking as appropriate. */
 static inline void falcon_write(struct efx_nic *efx, efx_oword_t *value,
index a74b793..dbdcee4 100644 (file)
@@ -221,7 +221,7 @@ static int falcon_xgmii_status(struct efx_nic *efx)
 {
        efx_dword_t reg;
 
-       if (FALCON_REV(efx) < FALCON_REV_B0)
+       if (falcon_rev(efx) < FALCON_REV_B0)
                return 1;
 
        /* The ISR latches, so clear it and re-read */
@@ -241,7 +241,7 @@ static void falcon_mask_status_intr(struct efx_nic *efx, int enable)
 {
        efx_dword_t reg;
 
-       if ((FALCON_REV(efx) < FALCON_REV_B0) || LOOPBACK_INTERNAL(efx))
+       if ((falcon_rev(efx) < FALCON_REV_B0) || LOOPBACK_INTERNAL(efx))
                return;
 
        /* Flush the ISR */
@@ -454,7 +454,7 @@ static int falcon_check_xaui_link_up(struct efx_nic *efx)
 
                EFX_LOG(efx, "%s Clobbering XAUI (%d tries left).\n",
                        __func__, tries);
-               (void) falcon_reset_xaui(efx);
+               falcon_reset_xaui(efx);
                udelay(200);
                tries--;
        }
@@ -572,7 +572,7 @@ int falcon_check_xmac(struct efx_nic *efx)
        xaui_link_ok = falcon_xaui_link_ok(efx);
 
        if (EFX_WORKAROUND_5147(efx) && !xaui_link_ok)
-               (void) falcon_reset_xaui(efx);
+               falcon_reset_xaui(efx);
 
        /* Call the PHY check_hw routine */
        rc = efx->phy_op->check_hw(efx);
@@ -639,7 +639,7 @@ int falcon_xmac_set_pause(struct efx_nic *efx, enum efx_fc_type flow_control)
        reset = ((flow_control & EFX_FC_TX) &&
                 !(efx->flow_control & EFX_FC_TX));
        if (EFX_WORKAROUND_11482(efx) && reset) {
-               if (FALCON_REV(efx) >= FALCON_REV_B0) {
+               if (falcon_rev(efx) >= FALCON_REV_B0) {
                        /* Recover by resetting the EM block */
                        if (efx->link_up)
                                falcon_drain_tx_fifo(efx);
index 59f261b..5e20e75 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef EFX_DRIVER_NAME
 #define EFX_DRIVER_NAME        "sfc"
 #endif
-#define EFX_DRIVER_VERSION     "2.2.0136"
+#define EFX_DRIVER_VERSION     "2.2"
 
 #ifdef EFX_ENABLE_DEBUG
 #define EFX_BUG_ON_PARANOID(x) BUG_ON(x)
 #define EFX_WARN_ON_PARANOID(x) do {} while (0)
 #endif
 
-#define NET_DEV_REGISTERED(efx)                                        \
-       ((efx)->net_dev->reg_state == NETREG_REGISTERED)
-
-/* Include net device name in log messages if it has been registered.
- * Use efx->name not efx->net_dev->name so that races with (un)registration
- * are harmless.
- */
-#define NET_DEV_NAME(efx) (NET_DEV_REGISTERED(efx) ? (efx)->name : "")
-
 /* Un-rate-limited logging */
 #define EFX_ERR(efx, fmt, args...) \
-dev_err(&((efx)->pci_dev->dev), "ERR: %s " fmt, NET_DEV_NAME(efx), ##args)
+dev_err(&((efx)->pci_dev->dev), "ERR: %s " fmt, efx_dev_name(efx), ##args)
 
 #define EFX_INFO(efx, fmt, args...) \
-dev_info(&((efx)->pci_dev->dev), "INFO: %s " fmt, NET_DEV_NAME(efx), ##args)
+dev_info(&((efx)->pci_dev->dev), "INFO: %s " fmt, efx_dev_name(efx), ##args)
 
 #ifdef EFX_ENABLE_DEBUG
 #define EFX_LOG(efx, fmt, args...) \
-dev_info(&((efx)->pci_dev->dev), "DBG: %s " fmt, NET_DEV_NAME(efx), ##args)
+dev_info(&((efx)->pci_dev->dev), "DBG: %s " fmt, efx_dev_name(efx), ##args)
 #else
 #define EFX_LOG(efx, fmt, args...) \
-dev_dbg(&((efx)->pci_dev->dev), "DBG: %s " fmt, NET_DEV_NAME(efx), ##args)
+dev_dbg(&((efx)->pci_dev->dev), "DBG: %s " fmt, efx_dev_name(efx), ##args)
 #endif
 
 #define EFX_TRACE(efx, fmt, args...) do {} while (0)
@@ -90,11 +81,6 @@ do {if (net_ratelimit()) EFX_INFO(efx, fmt, ##args); } while (0)
 #define EFX_LOG_RL(efx, fmt, args...) \
 do {if (net_ratelimit()) EFX_LOG(efx, fmt, ##args); } while (0)
 
-/* Kernel headers may redefine inline anyway */
-#ifndef inline
-#define inline inline __attribute__ ((always_inline))
-#endif
-
 /**************************************************************************
  *
  * Efx data structures
@@ -695,7 +681,7 @@ struct efx_nic {
        struct workqueue_struct *workqueue;
        struct work_struct reset_work;
        struct delayed_work monitor_work;
-       unsigned long membase_phys;
+       resource_size_t membase_phys;
        void __iomem *membase;
        spinlock_t biu_lock;
        enum efx_int_mode interrupt_mode;
@@ -719,7 +705,7 @@ struct efx_nic {
 
        unsigned n_rx_nodesc_drop_cnt;
 
-       void *nic_data;
+       struct falcon_nic_data *nic_data;
 
        struct mutex mac_lock;
        int port_enabled;
@@ -760,6 +746,20 @@ struct efx_nic {
        void *loopback_selftest;
 };
 
+static inline int efx_dev_registered(struct efx_nic *efx)
+{
+       return efx->net_dev->reg_state == NETREG_REGISTERED;
+}
+
+/* Net device name, for inclusion in log messages if it has been registered.
+ * Use efx->name not efx->net_dev->name so that races with (un)registration
+ * are harmless.
+ */
+static inline const char *efx_dev_name(struct efx_nic *efx)
+{
+       return efx_dev_registered(efx) ? efx->name : "";
+}
+
 /**
  * struct efx_nic_type - Efx device type definition
  * @mem_bar: Memory BAR number
@@ -795,7 +795,7 @@ struct efx_nic_type {
        unsigned int txd_ring_mask;
        unsigned int rxd_ring_mask;
        unsigned int evq_size;
-       dma_addr_t max_dma_mask;
+       u64 max_dma_mask;
        unsigned int tx_dma_mask;
        unsigned bug5391_mask;
 
index 6706223..601b001 100644 (file)
@@ -86,14 +86,17 @@ static unsigned int rx_refill_limit = 95;
  */
 #define EFX_RXD_HEAD_ROOM 2
 
-/* Macros for zero-order pages (potentially) containing multiple RX buffers */
-#define RX_DATA_OFFSET(_data)                          \
-       (((unsigned long) (_data)) & (PAGE_SIZE-1))
-#define RX_BUF_OFFSET(_rx_buf)                         \
-       RX_DATA_OFFSET((_rx_buf)->data)
-
-#define RX_PAGE_SIZE(_efx)                             \
-       (PAGE_SIZE * (1u << (_efx)->rx_buffer_order))
+static inline unsigned int efx_rx_buf_offset(struct efx_rx_buffer *buf)
+{
+       /* Offset is always within one page, so we don't need to consider
+        * the page order.
+        */
+       return (__force unsigned long) buf->data & (PAGE_SIZE - 1);
+}
+static inline unsigned int efx_rx_buf_size(struct efx_nic *efx)
+{
+       return PAGE_SIZE << efx->rx_buffer_order;
+}
 
 
 /**************************************************************************
@@ -106,7 +109,7 @@ static unsigned int rx_refill_limit = 95;
 static int efx_lro_get_skb_hdr(struct sk_buff *skb, void **ip_hdr,
                               void **tcpudp_hdr, u64 *hdr_flags, void *priv)
 {
-       struct efx_channel *channel = (struct efx_channel *)priv;
+       struct efx_channel *channel = priv;
        struct iphdr *iph;
        struct tcphdr *th;
 
@@ -131,12 +134,12 @@ static int efx_get_frag_hdr(struct skb_frag_struct *frag, void **mac_hdr,
                            void **ip_hdr, void **tcpudp_hdr, u64 *hdr_flags,
                            void *priv)
 {
-       struct efx_channel *channel = (struct efx_channel *)priv;
+       struct efx_channel *channel = priv;
        struct ethhdr *eh;
        struct iphdr *iph;
 
        /* We support EtherII and VLAN encapsulated IPv4 */
-       eh = (struct ethhdr *)(page_address(frag->page) + frag->page_offset);
+       eh = page_address(frag->page) + frag->page_offset;
        *mac_hdr = eh;
 
        if (eh->h_proto == htons(ETH_P_IP)) {
@@ -269,7 +272,7 @@ static inline int efx_init_rx_buffer_page(struct efx_rx_queue *rx_queue,
                        return -ENOMEM;
 
                dma_addr = pci_map_page(efx->pci_dev, rx_buf->page,
-                                       0, RX_PAGE_SIZE(efx),
+                                       0, efx_rx_buf_size(efx),
                                        PCI_DMA_FROMDEVICE);
 
                if (unlikely(pci_dma_mapping_error(dma_addr))) {
@@ -280,14 +283,14 @@ static inline int efx_init_rx_buffer_page(struct efx_rx_queue *rx_queue,
 
                rx_queue->buf_page = rx_buf->page;
                rx_queue->buf_dma_addr = dma_addr;
-               rx_queue->buf_data = ((char *) page_address(rx_buf->page) +
+               rx_queue->buf_data = (page_address(rx_buf->page) +
                                      EFX_PAGE_IP_ALIGN);
        }
 
-       offset = RX_DATA_OFFSET(rx_queue->buf_data);
        rx_buf->len = bytes;
-       rx_buf->dma_addr = rx_queue->buf_dma_addr + offset;
        rx_buf->data = rx_queue->buf_data;
+       offset = efx_rx_buf_offset(rx_buf);
+       rx_buf->dma_addr = rx_queue->buf_dma_addr + offset;
 
        /* Try to pack multiple buffers per page */
        if (efx->rx_buffer_order == 0) {
@@ -295,7 +298,7 @@ static inline int efx_init_rx_buffer_page(struct efx_rx_queue *rx_queue,
                rx_queue->buf_data += ((bytes + 0x1ff) & ~0x1ff);
                offset += ((bytes + 0x1ff) & ~0x1ff);
 
-               space = RX_PAGE_SIZE(efx) - offset;
+               space = efx_rx_buf_size(efx) - offset;
                if (space >= bytes) {
                        /* Refs dropped on kernel releasing each skb */
                        get_page(rx_queue->buf_page);
@@ -344,7 +347,8 @@ static inline void efx_unmap_rx_buffer(struct efx_nic *efx,
                EFX_BUG_ON_PARANOID(rx_buf->skb);
                if (rx_buf->unmap_addr) {
                        pci_unmap_page(efx->pci_dev, rx_buf->unmap_addr,
-                                      RX_PAGE_SIZE(efx), PCI_DMA_FROMDEVICE);
+                                      efx_rx_buf_size(efx),
+                                      PCI_DMA_FROMDEVICE);
                        rx_buf->unmap_addr = 0;
                }
        } else if (likely(rx_buf->skb)) {
@@ -400,9 +404,10 @@ static int __efx_fast_push_rx_descriptors(struct efx_rx_queue *rx_queue,
                return 0;
 
        /* Record minimum fill level */
-       if (unlikely(fill_level < rx_queue->min_fill))
+       if (unlikely(fill_level < rx_queue->min_fill)) {
                if (fill_level)
                        rx_queue->min_fill = fill_level;
+       }
 
        /* Acquire RX add lock.  If this lock is contended, then a fast
         * fill must already be in progress (e.g. in the refill
@@ -552,7 +557,7 @@ static inline void efx_rx_packet_lro(struct efx_channel *channel,
                struct skb_frag_struct frags;
 
                frags.page = rx_buf->page;
-               frags.page_offset = RX_BUF_OFFSET(rx_buf);
+               frags.page_offset = efx_rx_buf_offset(rx_buf);
                frags.size = rx_buf->len;
 
                lro_receive_frags(lro_mgr, &frags, rx_buf->len,
@@ -597,7 +602,7 @@ static inline struct sk_buff *efx_rx_mk_skb(struct efx_rx_buffer *rx_buf,
        if (unlikely(rx_buf->len > hdr_len)) {
                struct skb_frag_struct *frag = skb_shinfo(skb)->frags;
                frag->page = rx_buf->page;
-               frag->page_offset = RX_BUF_OFFSET(rx_buf) + hdr_len;
+               frag->page_offset = efx_rx_buf_offset(rx_buf) + hdr_len;
                frag->size = skb->len - hdr_len;
                skb_shinfo(skb)->nr_frags = 1;
                skb->data_len = frag->size;
@@ -851,7 +856,8 @@ void efx_fini_rx_queue(struct efx_rx_queue *rx_queue)
        /* For a page that is part-way through splitting into RX buffers */
        if (rx_queue->buf_page != NULL) {
                pci_unmap_page(rx_queue->efx->pci_dev, rx_queue->buf_dma_addr,
-                              RX_PAGE_SIZE(rx_queue->efx), PCI_DMA_FROMDEVICE);
+                              efx_rx_buf_size(rx_queue->efx),
+                              PCI_DMA_FROMDEVICE);
                __free_pages(rx_queue->buf_page,
                             rx_queue->efx->rx_buffer_order);
                rx_queue->buf_page = NULL;
index cbda159..3b2de9f 100644 (file)
@@ -290,7 +290,7 @@ void efx_loopback_rx_packet(struct efx_nic *efx,
 
        payload = &state->payload;
        
-       received = (struct efx_loopback_payload *)(char *) buf_ptr;
+       received = (struct efx_loopback_payload *) buf_ptr;
        received->ip.saddr = payload->ip.saddr;
        received->ip.check = payload->ip.check;
        
@@ -424,10 +424,10 @@ static int efx_tx_loopback(struct efx_tx_queue *tx_queue)
                 * interrupt handler. */
                smp_wmb();
 
-               if (NET_DEV_REGISTERED(efx))
+               if (efx_dev_registered(efx))
                        netif_tx_lock_bh(efx->net_dev);
                rc = efx_xmit(efx, tx_queue, skb);
-               if (NET_DEV_REGISTERED(efx))
+               if (efx_dev_registered(efx))
                        netif_tx_unlock_bh(efx->net_dev);
 
                if (rc != NETDEV_TX_OK) {
@@ -453,7 +453,7 @@ static int efx_rx_loopback(struct efx_tx_queue *tx_queue,
        int tx_done = 0, rx_good, rx_bad;
        int i, rc = 0;
 
-       if (NET_DEV_REGISTERED(efx))
+       if (efx_dev_registered(efx))
                netif_tx_lock_bh(efx->net_dev);
 
        /* Count the number of tx completions, and decrement the refcnt. Any
@@ -465,7 +465,7 @@ static int efx_rx_loopback(struct efx_tx_queue *tx_queue,
                dev_kfree_skb_any(skb);
        }
 
-       if (NET_DEV_REGISTERED(efx))
+       if (efx_dev_registered(efx))
                netif_tx_unlock_bh(efx->net_dev);
 
        /* Check TX completion and received packet counts */
@@ -517,6 +517,8 @@ efx_test_loopback(struct efx_tx_queue *tx_queue,
                state->packet_count = min(1 << (i << 2), state->packet_count);
                state->skbs = kzalloc(sizeof(state->skbs[0]) *
                                      state->packet_count, GFP_KERNEL);
+               if (!state->skbs)
+                       return -ENOMEM;
                state->flush = 0;
 
                EFX_LOG(efx, "TX queue %d testing %s loopback with %d "
@@ -700,7 +702,7 @@ int efx_offline_test(struct efx_nic *efx,
         * "flushing" so all inflight packets are dropped */
        BUG_ON(efx->loopback_selftest);
        state->flush = 1;
-       efx->loopback_selftest = (void *)state;
+       efx->loopback_selftest = state;
 
        rc = efx_test_loopbacks(efx, tests, loopback_modes);
 
index 725d1a5..66a0d14 100644 (file)
@@ -116,18 +116,18 @@ void sfe4001_poweroff(struct efx_nic *efx)
 
        /* Turn off all power rails */
        out = 0xff;
-       (void) efx_i2c_write(i2c, PCA9539, P0_OUT, &out, 1);
+       efx_i2c_write(i2c, PCA9539, P0_OUT, &out, 1);
 
        /* Disable port 1 outputs on IO expander */
        cfg = 0xff;
-       (void) efx_i2c_write(i2c, PCA9539, P1_CONFIG, &cfg, 1);
+       efx_i2c_write(i2c, PCA9539, P1_CONFIG, &cfg, 1);
 
        /* Disable port 0 outputs on IO expander */
        cfg = 0xff;
-       (void) efx_i2c_write(i2c, PCA9539, P0_CONFIG, &cfg, 1);
+       efx_i2c_write(i2c, PCA9539, P0_CONFIG, &cfg, 1);
 
        /* Clear any over-temperature alert */
-       (void) efx_i2c_read(i2c, MAX6647, RSL, &in, 1);
+       efx_i2c_read(i2c, MAX6647, RSL, &in, 1);
 }
 
 /* The P0_EN_3V3X line on SFE4001 boards (from A2 onward) is connected
@@ -253,14 +253,14 @@ done:
 fail3:
        /* Turn off all power rails */
        out = 0xff;
-       (void) efx_i2c_write(i2c, PCA9539, P0_OUT, &out, 1);
+       efx_i2c_write(i2c, PCA9539, P0_OUT, &out, 1);
        /* Disable port 1 outputs on IO expander */
        out = 0xff;
-       (void) efx_i2c_write(i2c, PCA9539, P1_CONFIG, &out, 1);
+       efx_i2c_write(i2c, PCA9539, P1_CONFIG, &out, 1);
 fail2:
        /* Disable port 0 outputs on IO expander */
        out = 0xff;
-       (void) efx_i2c_write(i2c, PCA9539, P0_CONFIG, &out, 1);
+       efx_i2c_write(i2c, PCA9539, P0_CONFIG, &out, 1);
 fail1:
        return rc;
 }
index b1cd6de..c014606 100644 (file)
@@ -211,6 +211,8 @@ static int tenxpress_phy_init(struct efx_nic *efx)
        int rc = 0;
 
        phy_data = kzalloc(sizeof(*phy_data), GFP_KERNEL);
+       if (!phy_data)
+               return -ENOMEM;
        efx->phy_data = phy_data;
 
        tenxpress_set_state(efx, TENXPRESS_STATUS_NORMAL);
@@ -376,7 +378,7 @@ static void tenxpress_phy_reconfigure(struct efx_nic *efx)
         * perform a special software reset */
        if ((phy_data->tx_disabled && !efx->tx_disabled) ||
            loop_change) {
-               (void) tenxpress_special_reset(efx);
+               tenxpress_special_reset(efx);
                falcon_reset_xaui(efx);
        }
 
index 9b436f5..5cdd082 100644 (file)
@@ -387,7 +387,7 @@ void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index)
        if (unlikely(tx_queue->stopped)) {
                fill_level = tx_queue->insert_count - tx_queue->read_count;
                if (fill_level < EFX_NETDEV_TX_THRESHOLD(tx_queue)) {
-                       EFX_BUG_ON_PARANOID(!NET_DEV_REGISTERED(efx));
+                       EFX_BUG_ON_PARANOID(!efx_dev_registered(efx));
 
                        /* Do this under netif_tx_lock(), to avoid racing
                         * with efx_xmit(). */
@@ -639,11 +639,12 @@ static void efx_tsoh_block_free(struct efx_tx_queue *tx_queue,
        base_dma = tsoh->dma_addr & PAGE_MASK;
 
        p = &tx_queue->tso_headers_free;
-       while (*p != NULL)
+       while (*p != NULL) {
                if (((unsigned long)*p & PAGE_MASK) == base_kva)
                        *p = (*p)->next;
                else
                        p = &(*p)->next;
+       }
 
        pci_free_consistent(pci_dev, PAGE_SIZE, (void *)base_kva, base_dma);
 }
@@ -939,9 +940,10 @@ static inline int tso_start_new_packet(struct efx_tx_queue *tx_queue,
 
        /* Allocate a DMA-mapped header buffer. */
        if (likely(TSOH_SIZE(st->p.header_length) <= TSOH_STD_SIZE)) {
-               if (tx_queue->tso_headers_free == NULL)
+               if (tx_queue->tso_headers_free == NULL) {
                        if (efx_tsoh_block_alloc(tx_queue))
                                return -1;
+               }
                EFX_BUG_ON_PARANOID(!tx_queue->tso_headers_free);
                tsoh = tx_queue->tso_headers_free;
                tx_queue->tso_headers_free = tsoh->next;
@@ -1106,9 +1108,10 @@ static void efx_fini_tso(struct efx_tx_queue *tx_queue)
 {
        unsigned i;
 
-       if (tx_queue->buffer)
+       if (tx_queue->buffer) {
                for (i = 0; i <= tx_queue->efx->type->txd_ring_mask; ++i)
                        efx_tsoh_free(tx_queue, &tx_queue->buffer[i]);
+       }
 
        while (tx_queue->tso_headers_free != NULL)
                efx_tsoh_block_free(tx_queue, tx_queue->tso_headers_free,
index dca62f1..35ab19c 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #define EFX_WORKAROUND_ALWAYS(efx) 1
-#define EFX_WORKAROUND_FALCON_A(efx) (FALCON_REV(efx) <= FALCON_REV_A1)
+#define EFX_WORKAROUND_FALCON_A(efx) (falcon_rev(efx) <= FALCON_REV_A1)
 
 /* XAUI resets if link not detected */
 #define EFX_WORKAROUND_5147 EFX_WORKAROUND_ALWAYS
index 3b9f9dd..f3684ad 100644 (file)
@@ -85,7 +85,9 @@ static int xfp_phy_init(struct efx_nic *efx)
        int rc;
 
        phy_data = kzalloc(sizeof(struct xfp_phy_data), GFP_KERNEL);
-       efx->phy_data = (void *) phy_data;
+       if (!phy_data)
+               return -ENOMEM;
+       efx->phy_data = phy_data;
 
        EFX_INFO(efx, "XFP: PHY ID reg %x (OUI %x model %x revision"
                 " %x)\n", devid, MDIO_ID_OUI(devid), MDIO_ID_MODEL(devid),
index f226bca..3bb6053 100644 (file)
@@ -1159,17 +1159,9 @@ static int sky2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 }
 
 #ifdef SKY2_VLAN_TAG_USED
-static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
+static void sky2_set_vlan_mode(struct sky2_hw *hw, u16 port, bool onoff)
 {
-       struct sky2_port *sky2 = netdev_priv(dev);
-       struct sky2_hw *hw = sky2->hw;
-       u16 port = sky2->port;
-
-       netif_tx_lock_bh(dev);
-       napi_disable(&hw->napi);
-
-       sky2->vlgrp = grp;
-       if (grp) {
+       if (onoff) {
                sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
                             RX_VLAN_STRIP_ON);
                sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
@@ -1180,6 +1172,19 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp
                sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
                             TX_VLAN_TAG_OFF);
        }
+}
+
+static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
+{
+       struct sky2_port *sky2 = netdev_priv(dev);
+       struct sky2_hw *hw = sky2->hw;
+       u16 port = sky2->port;
+
+       netif_tx_lock_bh(dev);
+       napi_disable(&hw->napi);
+
+       sky2->vlgrp = grp;
+       sky2_set_vlan_mode(hw, port, grp != NULL);
 
        sky2_read32(hw, B0_Y2_SP_LISR);
        napi_enable(&hw->napi);
@@ -1418,6 +1423,10 @@ static int sky2_up(struct net_device *dev)
        sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map,
                           TX_RING_SIZE - 1);
 
+#ifdef SKY2_VLAN_TAG_USED
+       sky2_set_vlan_mode(hw, port, sky2->vlgrp != NULL);
+#endif
+
        err = sky2_rx_start(sky2);
        if (err)
                goto err_out;
index b880cba..74cf8e1 100644 (file)
@@ -264,7 +264,7 @@ struct xl_private {
        u16 asb;
 
        u8 __iomem *xl_mmio;
-       char *xl_card_name;
+       const char *xl_card_name;
        struct pci_dev *pdev ; 
        
        spinlock_t xl_lock ; 
index c919563..10fbba0 100644 (file)
@@ -254,7 +254,7 @@ struct olympic_private {
        u8 __iomem *olympic_mmio;
        u8 __iomem *olympic_lap;
        struct pci_dev *pdev ; 
-       char *olympic_card_name ; 
+       const char *olympic_card_name;
 
        spinlock_t olympic_lock ; 
 
index 2511ca7..e9e6286 100644 (file)
@@ -225,6 +225,9 @@ static void uli526x_set_filter_mode(struct net_device *);
 static const struct ethtool_ops netdev_ethtool_ops;
 static u16 read_srom_word(long, int);
 static irqreturn_t uli526x_interrupt(int, void *);
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void uli526x_poll(struct net_device *dev);
+#endif
 static void uli526x_descriptor_init(struct uli526x_board_info *, unsigned long);
 static void allocate_rx_buffer(struct uli526x_board_info *);
 static void update_cr6(u32, unsigned long);
@@ -339,6 +342,9 @@ static int __devinit uli526x_init_one (struct pci_dev *pdev,
        dev->get_stats = &uli526x_get_stats;
        dev->set_multicast_list = &uli526x_set_filter_mode;
        dev->ethtool_ops = &netdev_ethtool_ops;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       dev->poll_controller = &uli526x_poll;
+#endif
        spin_lock_init(&db->lock);
 
 
@@ -681,8 +687,9 @@ static irqreturn_t uli526x_interrupt(int irq, void *dev_id)
        db->cr5_data = inl(ioaddr + DCR5);
        outl(db->cr5_data, ioaddr + DCR5);
        if ( !(db->cr5_data & 0x180c1) ) {
-               spin_unlock_irqrestore(&db->lock, flags);
+               /* Restore CR7 to enable interrupt mask */
                outl(db->cr7_data, ioaddr + DCR7);
+               spin_unlock_irqrestore(&db->lock, flags);
                return IRQ_HANDLED;
        }
 
@@ -715,6 +722,13 @@ static irqreturn_t uli526x_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void uli526x_poll(struct net_device *dev)
+{
+       /* ISR grabs the irqsave lock, so this should be safe */
+       uli526x_interrupt(dev->irq, dev);
+}
+#endif
 
 /*
  *     Free TX resource after TX complete
index ca0bdac..fb0b918 100644 (file)
@@ -237,7 +237,7 @@ static struct sk_buff *get_new_skb(struct ucc_geth_private *ugeth,
        skb->dev = ugeth->dev;
 
        out_be32(&((struct qe_bd __iomem *)bd)->buf,
-                     dma_map_single(NULL,
+                     dma_map_single(&ugeth->dev->dev,
                                     skb->data,
                                     ugeth->ug_info->uf_info.max_rx_buf_length +
                                     UCC_GETH_RX_DATA_BUF_ALIGNMENT,
@@ -2158,7 +2158,7 @@ static void ucc_geth_memclean(struct ucc_geth_private *ugeth)
                        continue;
                for (j = 0; j < ugeth->ug_info->bdRingLenTx[i]; j++) {
                        if (ugeth->tx_skbuff[i][j]) {
-                               dma_unmap_single(NULL,
+                               dma_unmap_single(&ugeth->dev->dev,
                                                 in_be32(&((struct qe_bd __iomem *)bd)->buf),
                                                 (in_be32((u32 __iomem *)bd) &
                                                  BD_LENGTH_MASK),
@@ -2186,7 +2186,7 @@ static void ucc_geth_memclean(struct ucc_geth_private *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,
+                                       dma_unmap_single(&ugeth->dev->dev,
                                                in_be32(&((struct qe_bd __iomem *)bd)->buf),
                                                ugeth->ug_info->
                                                uf_info.max_rx_buf_length +
@@ -3406,7 +3406,8 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        /* set up the buffer descriptor */
        out_be32(&((struct qe_bd __iomem *)bd)->buf,
-                     dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE));
+                     dma_map_single(&ugeth->dev->dev, skb->data,
+                             skb->len, DMA_TO_DEVICE));
 
        /* printk(KERN_DEBUG"skb->data is 0x%x\n",skb->data); */
 
index dc6f097..37ecf84 100644 (file)
@@ -1440,6 +1440,10 @@ static const struct usb_device_id        products [] = {
        // Belkin F5D5055
        USB_DEVICE(0x050d, 0x5055),
        .driver_info = (unsigned long) &ax88178_info,
+}, {
+       // Apple USB Ethernet Adapter
+       USB_DEVICE(0x05ac, 0x1402),
+       .driver_info = (unsigned long) &ax88772_info,
 },
        { },            // END
 };
index 76752d8..22c17bb 100644 (file)
@@ -423,7 +423,10 @@ static int catc_hard_start_xmit(struct sk_buff *skb, struct net_device *netdev)
 
        catc->tx_ptr = (((catc->tx_ptr - 1) >> 6) + 1) << 6;
        tx_buf = catc->tx_buf[catc->tx_idx] + catc->tx_ptr;
-       *((u16*)tx_buf) = (catc->is_f5u011) ? cpu_to_be16((u16)skb->len) : cpu_to_le16((u16)skb->len);
+       if (catc->is_f5u011)
+               *(__be16 *)tx_buf = cpu_to_be16(skb->len);
+       else
+               *(__le16 *)tx_buf = cpu_to_le16(skb->len);
        skb_copy_from_linear_data(skb, tx_buf + 2, skb->len);
        catc->tx_ptr += skb->len + 2;
 
index 0ec7936..c66b9c3 100644 (file)
@@ -218,7 +218,7 @@ static const struct driver_info     blob_info = {
 /*-------------------------------------------------------------------------*/
 
 #ifndef        HAVE_HARDWARE
-#error You need to configure some hardware for this driver
+#warning You need to configure some hardware for this driver
 #endif
 
 /*
index 21a7785..ae467f1 100644 (file)
@@ -194,7 +194,7 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf)
                        dev_dbg(&info->control->dev,
                                "rndis response error, code %d\n", retval);
                }
-               msleep(2);
+               msleep(20);
        }
        dev_dbg(&info->control->dev, "rndis response timeout\n");
        return -ETIMEDOUT;
@@ -283,8 +283,8 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
                struct rndis_set_c      *set_c;
                struct rndis_halt       *halt;
        } u;
-       u32                     tmp, phym_unspec;
-       __le32                  *phym;
+       u32                     tmp;
+       __le32                  phym_unspec, *phym;
        int                     reply_len;
        unsigned char           *bp;
 
index f926b5a..fe7cdf2 100644 (file)
@@ -470,8 +470,7 @@ static void virtnet_remove(struct virtio_device *vdev)
                kfree_skb(skb);
                vi->num--;
        }
-       while ((skb = __skb_dequeue(&vi->send)) != NULL)
-               kfree_skb(skb);
+       __skb_queue_purge(&vi->send);
 
        BUG_ON(vi->num != 0);
 
index 9a83c9d..7f98489 100644 (file)
@@ -43,8 +43,7 @@ static const char* version = "HDLC support module revision 1.22";
 
 #undef DEBUG_LINK
 
-static struct hdlc_proto *first_proto = NULL;
-
+static struct hdlc_proto *first_proto;
 
 static int hdlc_change_mtu(struct net_device *dev, int new_mtu)
 {
@@ -314,21 +313,25 @@ void detach_hdlc_protocol(struct net_device *dev)
 
 void register_hdlc_protocol(struct hdlc_proto *proto)
 {
+       rtnl_lock();
        proto->next = first_proto;
        first_proto = proto;
+       rtnl_unlock();
 }
 
 
 void unregister_hdlc_protocol(struct hdlc_proto *proto)
 {
-       struct hdlc_proto **p = &first_proto;
-       while (*p) {
-               if (*p == proto) {
-                       *p = proto->next;
-                       return;
-               }
+       struct hdlc_proto **p;
+
+       rtnl_lock();
+       p = &first_proto;
+       while (*p != proto) {
+               BUG_ON(!*p);
                p = &((*p)->next);
        }
+       *p = proto->next;
+       rtnl_unlock();
 }
 
 
index 7133c68..762d21c 100644 (file)
@@ -56,6 +56,7 @@ struct cisco_state {
        cisco_proto settings;
 
        struct timer_list timer;
+       spinlock_t lock;
        unsigned long last_poll;
        int up;
        int request_sent;
@@ -158,6 +159,7 @@ static int cisco_rx(struct sk_buff *skb)
 {
        struct net_device *dev = skb->dev;
        hdlc_device *hdlc = dev_to_hdlc(dev);
+       struct cisco_state *st = state(hdlc);
        struct hdlc_header *data = (struct hdlc_header*)skb->data;
        struct cisco_packet *cisco_data;
        struct in_device *in_dev;
@@ -220,11 +222,12 @@ static int cisco_rx(struct sk_buff *skb)
                        goto rx_error;
 
                case CISCO_KEEPALIVE_REQ:
-                       state(hdlc)->rxseq = ntohl(cisco_data->par1);
-                       if (state(hdlc)->request_sent &&
-                           ntohl(cisco_data->par2) == state(hdlc)->txseq) {
-                               state(hdlc)->last_poll = jiffies;
-                               if (!state(hdlc)->up) {
+                       spin_lock(&st->lock);
+                       st->rxseq = ntohl(cisco_data->par1);
+                       if (st->request_sent &&
+                           ntohl(cisco_data->par2) == st->txseq) {
+                               st->last_poll = jiffies;
+                               if (!st->up) {
                                        u32 sec, min, hrs, days;
                                        sec = ntohl(cisco_data->time) / 1000;
                                        min = sec / 60; sec -= min * 60;
@@ -232,12 +235,12 @@ static int cisco_rx(struct sk_buff *skb)
                                        days = hrs / 24; hrs -= days * 24;
                                        printk(KERN_INFO "%s: Link up (peer "
                                               "uptime %ud%uh%um%us)\n",
-                                              dev->name, days, hrs,
-                                              min, sec);
+                                              dev->name, days, hrs, min, sec);
                                        netif_dormant_off(dev);
-                                       state(hdlc)->up = 1;
+                                       st->up = 1;
                                }
                        }
+                       spin_unlock(&st->lock);
 
                        dev_kfree_skb_any(skb);
                        return NET_RX_SUCCESS;
@@ -261,24 +264,25 @@ static void cisco_timer(unsigned long arg)
 {
        struct net_device *dev = (struct net_device *)arg;
        hdlc_device *hdlc = dev_to_hdlc(dev);
+       struct cisco_state *st = state(hdlc);
 
-       if (state(hdlc)->up &&
-           time_after(jiffies, state(hdlc)->last_poll +
-                      state(hdlc)->settings.timeout * HZ)) {
-               state(hdlc)->up = 0;
+       spin_lock(&st->lock);
+       if (st->up &&
+           time_after(jiffies, st->last_poll + st->settings.timeout * HZ)) {
+               st->up = 0;
                printk(KERN_INFO "%s: Link down\n", dev->name);
                netif_dormant_on(dev);
        }
 
-       cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ,
-                            htonl(++state(hdlc)->txseq),
-                            htonl(state(hdlc)->rxseq));
-       state(hdlc)->request_sent = 1;
-       state(hdlc)->timer.expires = jiffies +
-               state(hdlc)->settings.interval * HZ;
-       state(hdlc)->timer.function = cisco_timer;
-       state(hdlc)->timer.data = arg;
-       add_timer(&state(hdlc)->timer);
+       cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ, htonl(++st->txseq),
+                            htonl(st->rxseq));
+       st->request_sent = 1;
+       spin_unlock(&st->lock);
+
+       st->timer.expires = jiffies + st->settings.interval * HZ;
+       st->timer.function = cisco_timer;
+       st->timer.data = arg;
+       add_timer(&st->timer);
 }
 
 
@@ -286,15 +290,20 @@ static void cisco_timer(unsigned long arg)
 static void cisco_start(struct net_device *dev)
 {
        hdlc_device *hdlc = dev_to_hdlc(dev);
-       state(hdlc)->up = 0;
-       state(hdlc)->request_sent = 0;
-       state(hdlc)->txseq = state(hdlc)->rxseq = 0;
-
-       init_timer(&state(hdlc)->timer);
-       state(hdlc)->timer.expires = jiffies + HZ; /*First poll after 1s*/
-       state(hdlc)->timer.function = cisco_timer;
-       state(hdlc)->timer.data = (unsigned long)dev;
-       add_timer(&state(hdlc)->timer);
+       struct cisco_state *st = state(hdlc);
+       unsigned long flags;
+
+       spin_lock_irqsave(&st->lock, flags);
+       st->up = 0;
+       st->request_sent = 0;
+       st->txseq = st->rxseq = 0;
+       spin_unlock_irqrestore(&st->lock, flags);
+
+       init_timer(&st->timer);
+       st->timer.expires = jiffies + HZ; /* First poll after 1 s */
+       st->timer.function = cisco_timer;
+       st->timer.data = (unsigned long)dev;
+       add_timer(&st->timer);
 }
 
 
@@ -302,10 +311,16 @@ static void cisco_start(struct net_device *dev)
 static void cisco_stop(struct net_device *dev)
 {
        hdlc_device *hdlc = dev_to_hdlc(dev);
-       del_timer_sync(&state(hdlc)->timer);
+       struct cisco_state *st = state(hdlc);
+       unsigned long flags;
+
+       del_timer_sync(&st->timer);
+
+       spin_lock_irqsave(&st->lock, flags);
        netif_dormant_on(dev);
-       state(hdlc)->up = 0;
-       state(hdlc)->request_sent = 0;
+       st->up = 0;
+       st->request_sent = 0;
+       spin_unlock_irqrestore(&st->lock, flags);
 }
 
 
@@ -367,6 +382,7 @@ static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
                        return result;
 
                memcpy(&state(hdlc)->settings, &new_settings, size);
+               spin_lock_init(&state(hdlc)->lock);
                dev->hard_start_xmit = hdlc->xmit;
                dev->header_ops = &cisco_header_ops;
                dev->type = ARPHRD_CISCO;
index 45f47c1..4e1c690 100644 (file)
@@ -2668,6 +2668,7 @@ static struct net_device *init_wifidev(struct airo_info *ai,
        dev->irq = ethdev->irq;
        dev->base_addr = ethdev->base_addr;
        dev->wireless_data = ethdev->wireless_data;
+       SET_NETDEV_DEV(dev, ethdev->dev.parent);
        memcpy(dev->dev_addr, ethdev->dev_addr, dev->addr_len);
        err = register_netdev(dev);
        if (err<0) {
@@ -2904,7 +2905,7 @@ EXPORT_SYMBOL(init_airo_card);
 
 static int waitbusy (struct airo_info *ai) {
        int delay = 0;
-       while ((IN4500 (ai, COMMAND) & COMMAND_BUSY) & (delay < 10000)) {
+       while ((IN4500 (ai, COMMAND) & COMMAND_BUSY) && (delay < 10000)) {
                udelay (10);
                if ((++delay % 20) == 0)
                        OUT4500(ai, EVACK, EV_CLEARCOMMANDBUSY);
index 4e5c8fc..635b9ac 100644 (file)
@@ -1787,6 +1787,8 @@ ath5k_tasklet_rx(unsigned long data)
 
        spin_lock(&sc->rxbuflock);
        do {
+               rxs.flag = 0;
+
                if (unlikely(list_empty(&sc->rxbuf))) {
                        ATH5K_WARN(sc, "empty rx buf pool\n");
                        break;
index 5fb1ae6..77990b5 100644 (file)
@@ -4119,6 +4119,7 @@ static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah,
        rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1,
                AR5K_5210_RX_DESC_STATUS1_RECEIVE_TIMESTAMP);
        rs->rs_status = 0;
+       rs->rs_phyerr = 0;
 
        /*
         * Key table status
@@ -4145,7 +4146,7 @@ static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah,
                if (rx_status->rx_status_1 &
                                AR5K_5210_RX_DESC_STATUS1_PHY_ERROR) {
                        rs->rs_status |= AR5K_RXERR_PHY;
-                       rs->rs_phyerr = AR5K_REG_MS(rx_status->rx_status_1,
+                       rs->rs_phyerr |= AR5K_REG_MS(rx_status->rx_status_1,
                                           AR5K_5210_RX_DESC_STATUS1_PHY_ERROR);
                }
 
@@ -4193,6 +4194,7 @@ static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *ah,
        rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1,
                AR5K_5212_RX_DESC_STATUS1_RECEIVE_TIMESTAMP);
        rs->rs_status = 0;
+       rs->rs_phyerr = 0;
 
        /*
         * Key table status
@@ -4215,7 +4217,7 @@ static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *ah,
                if (rx_status->rx_status_1 &
                                AR5K_5212_RX_DESC_STATUS1_PHY_ERROR) {
                        rs->rs_status |= AR5K_RXERR_PHY;
-                       rs->rs_phyerr = AR5K_REG_MS(rx_err->rx_error_1,
+                       rs->rs_phyerr |= AR5K_REG_MS(rx_err->rx_error_1,
                                           AR5K_RX_DESC_ERROR1_PHY_ERROR_CODE);
                }
 
index f51b2d9..1fa043d 100644 (file)
@@ -1,6 +1,6 @@
 config B43
        tristate "Broadcom 43xx wireless support (mac80211 stack)"
-       depends on SSB_POSSIBLE && MAC80211 && WLAN_80211
+       depends on SSB_POSSIBLE && MAC80211 && WLAN_80211 && HAS_DMA
        select SSB
        select FW_LOADER
        select HW_RANDOM
index 13c65fa..aef2298 100644 (file)
@@ -1,6 +1,6 @@
 config B43LEGACY
        tristate "Broadcom 43xx-legacy wireless support (mac80211 stack)"
-       depends on SSB_POSSIBLE && MAC80211 && WLAN_80211
+       depends on SSB_POSSIBLE && MAC80211 && WLAN_80211 && HAS_DMA
        select SSB
        select FW_LOADER
        select HW_RANDOM
index 437a9bc..ed4317a 100644 (file)
@@ -833,6 +833,7 @@ static struct pcmcia_device_id hostap_cs_ids[] = {
        PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x0001),
        PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300),
 /*     PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000),    conflict with pcnet_cs */
+       PCMCIA_DEVICE_MANF_CARD(0xc250, 0x0002),
        PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002),
        PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005),
        PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010),
index 7be68db..cdf90c4 100644 (file)
@@ -3276,11 +3276,6 @@ while (0)
        }
        printk(KERN_INFO "%s: Registered netdevice %s\n", dev_info, dev->name);
 
-#ifndef PRISM2_NO_PROCFS_DEBUG
-       create_proc_read_entry("registers", 0, local->proc,
-                              prism2_registers_proc_read, local);
-#endif /* PRISM2_NO_PROCFS_DEBUG */
-
        hostap_init_data(local);
        return dev;
 
@@ -3307,6 +3302,10 @@ static int hostap_hw_ready(struct net_device *dev)
                        netif_carrier_off(local->ddev);
                }
                hostap_init_proc(local);
+#ifndef PRISM2_NO_PROCFS_DEBUG
+               create_proc_read_entry("registers", 0, local->proc,
+                                      prism2_registers_proc_read, local);
+#endif /* PRISM2_NO_PROCFS_DEBUG */
                hostap_init_ap_proc(local);
                return 0;
        }
index fa87c5c..d74c061 100644 (file)
@@ -11584,6 +11584,7 @@ static int ipw_prom_alloc(struct ipw_priv *priv)
        priv->prom_net_dev->hard_start_xmit = ipw_prom_hard_start_xmit;
 
        priv->prom_priv->ieee->iw_mode = IW_MODE_MONITOR;
+       SET_NETDEV_DEV(priv->prom_net_dev, &priv->pci_dev->dev);
 
        rc = register_netdev(priv->prom_net_dev);
        if (rc) {
index dcfdb40..688d60d 100644 (file)
@@ -73,8 +73,8 @@ out:
         return ret;
 }
 
-static void lbs_ethtool_get_stats(struct net_device * dev,
-                               struct ethtool_stats * stats, u64 * data)
+static void lbs_ethtool_get_stats(struct net_device *dev,
+                                 struct ethtool_stats *stats, uint64_t *data)
 {
        struct lbs_private *priv = dev->priv;
        struct cmd_ds_mesh_access mesh_access;
@@ -83,12 +83,12 @@ static void lbs_ethtool_get_stats(struct net_device * dev,
        lbs_deb_enter(LBS_DEB_ETHTOOL);
 
        /* Get Mesh Statistics */
-       ret = lbs_prepare_and_send_command(priv,
-                       CMD_MESH_ACCESS, CMD_ACT_MESH_GET_STATS,
-                       CMD_OPTION_WAITFORRSP, 0, &mesh_access);
+       ret = lbs_mesh_access(priv, CMD_ACT_MESH_GET_STATS, &mesh_access);
 
-       if (ret)
+       if (ret) {
+               memset(data, 0, MESH_STATS_NUM*(sizeof(uint64_t)));
                return;
+       }
 
        priv->mstats.fwd_drop_rbt = le32_to_cpu(mesh_access.data[0]);
        priv->mstats.fwd_drop_ttl = le32_to_cpu(mesh_access.data[1]);
@@ -111,19 +111,18 @@ static void lbs_ethtool_get_stats(struct net_device * dev,
        lbs_deb_enter(LBS_DEB_ETHTOOL);
 }
 
-static int lbs_ethtool_get_sset_count(struct net_device * dev, int sset)
+static int lbs_ethtool_get_sset_count(struct net_device *dev, int sset)
 {
-       switch (sset) {
-       case ETH_SS_STATS:
+       struct lbs_private *priv = dev->priv;
+
+       if (sset == ETH_SS_STATS && dev == priv->mesh_dev)
                return MESH_STATS_NUM;
-       default:
-               return -EOPNOTSUPP;
-       }
+
+       return -EOPNOTSUPP;
 }
 
 static void lbs_ethtool_get_strings(struct net_device *dev,
-                                         u32 stringset,
-                                         u8 * s)
+                                   uint32_t stringset, uint8_t *s)
 {
        int i;
 
index 406f54d..e1f0660 100644 (file)
@@ -756,6 +756,7 @@ static int lbs_thread(void *data)
                                priv->nr_retries = 0;
                        } else {
                                priv->cur_cmd = NULL;
+                               priv->dnld_sent = DNLD_RES_RECEIVED;
                                lbs_pr_info("requeueing command %x due to timeout (#%d)\n",
                                            le16_to_cpu(cmdnode->cmdbuf->command), priv->nr_retries);
 
@@ -1564,6 +1565,7 @@ static int lbs_add_rtap(struct lbs_private *priv)
        rtap_dev->hard_start_xmit = lbs_rtap_hard_start_xmit;
        rtap_dev->set_multicast_list = lbs_set_multicast_list;
        rtap_dev->priv = priv;
+       SET_NETDEV_DEV(rtap_dev, priv->dev->dev.parent);
 
        ret = register_netdev(rtap_dev);
        if (ret) {
index 8b7f576..1c216e0 100644 (file)
@@ -461,6 +461,7 @@ static struct pcmcia_device_id orinoco_cs_ids[] = {
        PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0673), /* Linksys WCF12 Wireless CompactFlash Card */
        PCMCIA_DEVICE_MANF_CARD(0x02aa, 0x0002), /* ASUS SpaceLink WL-100 */
        PCMCIA_DEVICE_MANF_CARD(0x02ac, 0x0002), /* SpeedStream SS1021 Wireless Adapter */
+       PCMCIA_DEVICE_MANF_CARD(0x02ac, 0x3021), /* SpeedStream Wireless Adapter */
        PCMCIA_DEVICE_MANF_CARD(0x14ea, 0xb001), /* PLANEX RoadLannerWave GW-NS11H */
        PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300), /* Airvast WN-100 */
        PCMCIA_DEVICE_MANF_CARD(0x9005, 0x0021), /* Adaptec Ultra Wireless ANW-8030 */
index d5787b3..9223ada 100644 (file)
@@ -92,6 +92,7 @@ static void rtl8187_iowrite_async(struct rtl8187_priv *priv, __le16 addr,
                u8 data[4];
                struct usb_ctrlrequest dr;
        } *buf;
+       int rc;
 
        buf = kmalloc(sizeof(*buf), GFP_ATOMIC);
        if (!buf)
@@ -116,7 +117,11 @@ static void rtl8187_iowrite_async(struct rtl8187_priv *priv, __le16 addr,
        usb_fill_control_urb(urb, priv->udev, usb_sndctrlpipe(priv->udev, 0),
                             (unsigned char *)dr, buf, len,
                             rtl8187_iowrite_async_cb, buf);
-       usb_submit_urb(urb, GFP_ATOMIC);
+       rc = usb_submit_urb(urb, GFP_ATOMIC);
+       if (rc < 0) {
+               kfree(buf);
+               usb_free_urb(urb);
+       }
 }
 
 static inline void rtl818x_iowrite32_async(struct rtl8187_priv *priv,
@@ -169,6 +174,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
        struct urb *urb;
        __le16 rts_dur = 0;
        u32 flags;
+       int rc;
 
        urb = usb_alloc_urb(0, GFP_ATOMIC);
        if (!urb) {
@@ -208,7 +214,11 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
        info->dev = dev;
        usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, 2),
                          hdr, skb->len, rtl8187_tx_cb, skb);
-       usb_submit_urb(urb, GFP_ATOMIC);
+       rc = usb_submit_urb(urb, GFP_ATOMIC);
+       if (rc < 0) {
+               usb_free_urb(urb);
+               kfree_skb(skb);
+       }
 
        return 0;
 }
index 69c45ca..6424e5a 100644 (file)
@@ -805,7 +805,7 @@ void zd_process_intr(struct work_struct *work)
        u16 int_status;
        struct zd_mac *mac = container_of(work, struct zd_mac, process_intr);
 
-       int_status = le16_to_cpu(*(u16 *)(mac->intr_buffer+4));
+       int_status = le16_to_cpu(*(__le16 *)(mac->intr_buffer+4));
        if (int_status & INT_CFG_NEXT_BCN) {
                if (net_ratelimit())
                        dev_dbg_f(zd_mac_dev(mac), "INT_CFG_NEXT_BCN\n");
index 12e24f0..8941f5e 100644 (file)
@@ -342,7 +342,7 @@ static inline void handle_regs_int(struct urb *urb)
        ZD_ASSERT(in_interrupt());
        spin_lock(&intr->lock);
 
-       int_num = le16_to_cpu(*(u16 *)(urb->transfer_buffer+2));
+       int_num = le16_to_cpu(*(__le16 *)(urb->transfer_buffer+2));
        if (int_num == CR_INTERRUPT) {
                struct zd_mac *mac = zd_hw_mac(zd_usb_to_hw(urb->context));
                memcpy(&mac->intr_buffer, urb->transfer_buffer,
index 8bddff1..d26f69b 100644 (file)
@@ -946,8 +946,7 @@ err:
                work_done++;
        }
 
-       while ((skb = __skb_dequeue(&errq)))
-               kfree_skb(skb);
+       __skb_queue_purge(&errq);
 
        work_done -= handle_incoming_queue(dev, &rxq);
 
@@ -1079,8 +1078,7 @@ static void xennet_release_rx_bufs(struct netfront_info *np)
                }
        }
 
-       while ((skb = __skb_dequeue(&free_list)) != NULL)
-               dev_kfree_skb(skb);
+       __skb_queue_purge(&free_list);
 
        spin_unlock_bh(&np->rx_lock);
 }
index 138dd76..af1633e 100644 (file)
@@ -91,15 +91,13 @@ int power_supply_register(struct device *parent, struct power_supply *psy)
 {
        int rc = 0;
 
-       psy->dev = device_create(power_supply_class, parent, 0,
-                                "%s", psy->name);
+       psy->dev = device_create_drvdata(power_supply_class, parent, 0,
+                                        psy, "%s", psy->name);
        if (IS_ERR(psy->dev)) {
                rc = PTR_ERR(psy->dev);
                goto dev_create_failed;
        }
 
-       dev_set_drvdata(psy->dev, psy);
-
        INIT_WORK(&psy->changed_work, power_supply_changed_work);
 
        rc = power_supply_create_attrs(psy);
index e848734..2c2428c 100644 (file)
@@ -762,10 +762,10 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv)
                device_unregister(dev);
                return ret;
        }
-       priv->class_device = device_create(vmlogrdr_class, dev,
-                                          MKDEV(vmlogrdr_major,
-                                                priv->minor_num),
-                                          "%s", dev->bus_id);
+       priv->class_device = device_create_drvdata(vmlogrdr_class, dev,
+                                                  MKDEV(vmlogrdr_major,
+                                                        priv->minor_num),
+                                                  priv, "%s", dev->bus_id);
        if (IS_ERR(priv->class_device)) {
                ret = PTR_ERR(priv->class_device);
                priv->class_device=NULL;
@@ -773,7 +773,6 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv)
                device_unregister(dev);
                return ret;
        }
-       dev->driver_data = priv;
        priv->device = dev;
        return 0;
 }
index b87037e..03c9660 100644 (file)
@@ -869,7 +869,7 @@ static void probeLptPort(unsigned idx)
       instances[idx].mode = COMPATIBILITY;
       instances[idx].run_length = 0;
       instances[idx].run_flag = 0;
-      if (!request_region(lpAddr,3, dev_name)) return;
+      if (!request_region(lpAddr,3, bpp_dev_name)) return;
 
       /*
        * First, make sure the instance exists. Do this by writing to
@@ -1021,7 +1021,7 @@ static int __init bpp_init(void)
        if (rc == 0)
                return -ENODEV;
 
-       rc = register_chrdev(BPP_MAJOR, dev_name, &bpp_fops);
+       rc = register_chrdev(BPP_MAJOR, bpp_dev_name, &bpp_fops);
        if (rc < 0)
                return rc;
 
@@ -1037,7 +1037,7 @@ static void __exit bpp_cleanup(void)
 {
        unsigned idx;
 
-       unregister_chrdev(BPP_MAJOR, dev_name);
+       unregister_chrdev(BPP_MAJOR, bpp_dev_name);
 
        for (idx = 0;  idx < BPP_NO; idx++) {
                if (instances[idx].present)
index b31faec..867f6fd 100644 (file)
@@ -1278,7 +1278,7 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance)
                        error = 0;
                        /* Check for command packet errors */
                        if (full_command_packet->command.newcommand.status != 0) {
-                               if (tw_dev->srb[request_id] != 0) {
+                               if (tw_dev->srb[request_id] != NULL) {
                                        error = twa_fill_sense(tw_dev, request_id, 1, 1);
                                } else {
                                        /* Skip ioctl error prints */
@@ -1290,7 +1290,7 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance)
 
                        /* Check for correct state */
                        if (tw_dev->state[request_id] != TW_S_POSTED) {
-                               if (tw_dev->srb[request_id] != 0) {
+                               if (tw_dev->srb[request_id] != NULL) {
                                        TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1a, "Received a request id that wasn't posted");
                                        TW_CLEAR_ALL_INTERRUPTS(tw_dev);
                                        goto twa_interrupt_bail;
@@ -1298,7 +1298,7 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance)
                        }
 
                        /* Check for internal command completion */
-                       if (tw_dev->srb[request_id] == 0) {
+                       if (tw_dev->srb[request_id] == NULL) {
                                if (request_id != tw_dev->chrdev_request_id) {
                                        if (twa_aen_complete(tw_dev, request_id))
                                                TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1b, "Error completing AEN during attention interrupt");
index 1dca177..0899cb6 100644 (file)
@@ -3582,7 +3582,7 @@ static int checksetup(struct aha152x_setup *setup)
        if (i == ARRAY_SIZE(ports))
                return 0;
 
-       if ( request_region(setup->io_port, IO_RANGE, "aha152x")==0 ) {
+       if (!request_region(setup->io_port, IO_RANGE, "aha152x")) {
                printk(KERN_ERR "aha152x: io port 0x%x busy.\n", setup->io_port);
                return 0;
        }
@@ -3842,7 +3842,7 @@ static int __init aha152x_init(void)
                        if ((setup_count == 1) && (setup[0].io_port == ports[i]))
                                continue;
 
-                       if ( request_region(ports[i], IO_RANGE, "aha152x")==0 ) {
+                       if (!request_region(ports[i], IO_RANGE, "aha152x")) {
                                printk(KERN_ERR "aha152x: io port 0x%x busy.\n", ports[i]);
                                continue;
                        }
index db6de5e..7d31154 100644 (file)
@@ -747,7 +747,7 @@ static void send_s870(struct atp_unit *dev,unsigned char c)
                dev->quhd[c] = 0;
        }
        workreq = dev->quereq[c][dev->quhd[c]];
-       if (dev->id[c][scmd_id(workreq)].curr_req == 0) {       
+       if (dev->id[c][scmd_id(workreq)].curr_req == NULL) {
                dev->id[c][scmd_id(workreq)].curr_req = workreq;
                dev->last_cmd[c] = scmd_id(workreq);
                goto cmd_subp;
index 75c84d7..c4b938b 100644 (file)
@@ -910,9 +910,9 @@ static int ch_probe(struct device *dev)
        ch->minor = minor;
        sprintf(ch->name,"ch%d",ch->minor);
 
-       class_dev = device_create(ch_sysfs_class, dev,
-                                 MKDEV(SCSI_CHANGER_MAJOR,ch->minor),
-                                 "s%s", ch->name);
+       class_dev = device_create_drvdata(ch_sysfs_class, dev,
+                                         MKDEV(SCSI_CHANGER_MAJOR, ch->minor),
+                                         ch, "s%s", ch->name);
        if (IS_ERR(class_dev)) {
                printk(KERN_WARNING "ch%d: device_create failed\n",
                       ch->minor);
@@ -926,7 +926,6 @@ static int ch_probe(struct device *dev)
        if (init)
                ch_init_elem(ch);
 
-       dev_set_drvdata(dev, ch);
        sdev_printk(KERN_INFO, sd, "Attached scsi changer %s\n", ch->name);
 
        return 0;
index aaa48e0..da876d3 100644 (file)
@@ -444,7 +444,7 @@ static void __iomem *hptiop_map_pci_bar(struct hptiop_hba *hba, int index)
        if (!(pci_resource_flags(pcidev, index) & IORESOURCE_MEM)) {
                printk(KERN_ERR "scsi%d: pci resource invalid\n",
                                hba->host->host_no);
-               return 0;
+               return NULL;
        }
 
        mem_base_phy = pci_resource_start(pcidev, index);
@@ -454,7 +454,7 @@ static void __iomem *hptiop_map_pci_bar(struct hptiop_hba *hba, int index)
        if (!mem_base_virt) {
                printk(KERN_ERR "scsi%d: Fail to ioremap memory space\n",
                                hba->host->host_no);
-               return 0;
+               return NULL;
        }
        return mem_base_virt;
 }
@@ -476,11 +476,11 @@ static void hptiop_unmap_pci_bar_itl(struct hptiop_hba *hba)
 static int hptiop_map_pci_bar_mv(struct hptiop_hba *hba)
 {
        hba->u.mv.regs = hptiop_map_pci_bar(hba, 0);
-       if (hba->u.mv.regs == 0)
+       if (hba->u.mv.regs == NULL)
                return -1;
 
        hba->u.mv.mu = hptiop_map_pci_bar(hba, 2);
-       if (hba->u.mv.mu == 0) {
+       if (hba->u.mv.mu == NULL) {
                iounmap(hba->u.mv.regs);
                return -1;
        }
@@ -1210,8 +1210,8 @@ static void hptiop_remove(struct pci_dev *pcidev)
 
 static struct hptiop_adapter_ops hptiop_itl_ops = {
        .iop_wait_ready    = iop_wait_ready_itl,
-       .internal_memalloc = 0,
-       .internal_memfree  = 0,
+       .internal_memalloc = NULL,
+       .internal_memfree  = NULL,
        .map_pci_bar       = hptiop_map_pci_bar_itl,
        .unmap_pci_bar     = hptiop_unmap_pci_bar_itl,
        .enable_intr       = hptiop_enable_intr_itl,
index cd37bd6..887682a 100644 (file)
@@ -650,7 +650,7 @@ static void __exit mac_esp_exit(void)
 
 MODULE_DESCRIPTION("Mac ESP SCSI driver");
 MODULE_AUTHOR("Finn Thain <fthain@telegraphics.com.au>");
-MODULE_LICENSE("GPLv2");
+MODULE_LICENSE("GPL v2");
 MODULE_VERSION(DRV_VERSION);
 
 module_init(mac_esp_init);
index 31f7aec..243d8be 100644 (file)
@@ -5695,13 +5695,12 @@ static int osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape * S
        struct device *osst_member;
        int err;
 
-       osst_member = device_create(osst_sysfs_class, device, dev, "%s", name);
+       osst_member = device_create_drvdata(osst_sysfs_class, device, dev, STp, "%s", name);
        if (IS_ERR(osst_member)) {
                printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name);
                return PTR_ERR(osst_member);
        }
 
-       dev_set_drvdata(osst_member, STp);
        err = device_create_file(osst_member, &dev_attr_ADR_rev);
        if (err)
                goto err_out;
index 51e2f29..3754ab8 100644 (file)
@@ -2811,7 +2811,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
 
        /* Check for room in outstanding command list. */
        for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS &&
-                    ha->outstanding_cmds[cnt] != 0; cnt++);
+                    ha->outstanding_cmds[cnt] != NULL; cnt++);
 
        if (cnt >= MAX_OUTSTANDING_COMMANDS) {
                status = 1;
index c9d7f72..ea0edd1 100644 (file)
@@ -1441,17 +1441,18 @@ sg_add(struct device *cl_dev, struct class_interface *cl_intf)
        if (sg_sysfs_valid) {
                struct device *sg_class_member;
 
-               sg_class_member = device_create(sg_sysfs_class, cl_dev->parent,
-                                               MKDEV(SCSI_GENERIC_MAJOR,
-                                                     sdp->index),
-                                               "%s", disk->disk_name);
+               sg_class_member = device_create_drvdata(sg_sysfs_class,
+                                                       cl_dev->parent,
+                                                       MKDEV(SCSI_GENERIC_MAJOR,
+                                                             sdp->index),
+                                                       sdp,
+                                                       "%s", disk->disk_name);
                if (IS_ERR(sg_class_member)) {
                        printk(KERN_ERR "sg_add: "
                               "device_create failed\n");
                        error = PTR_ERR(sg_class_member);
                        goto cdev_add_err;
                }
-               dev_set_drvdata(sg_class_member, sdp);
                error = sysfs_create_link(&scsidp->sdev_gendev.kobj,
                                          &sg_class_member->kobj, "generic");
                if (error)
index e8db66a..6e5a5bb 100644 (file)
@@ -4424,17 +4424,19 @@ static int do_create_class_files(struct scsi_tape *STp, int dev_num, int mode)
                snprintf(name, 10, "%s%s%s", rew ? "n" : "",
                         STp->disk->disk_name, st_formats[i]);
                st_class_member =
-                       device_create(st_sysfs_class, &STp->device->sdev_gendev,
-                                     MKDEV(SCSI_TAPE_MAJOR,
-                                               TAPE_MINOR(dev_num, mode, rew)),
-                                     "%s", name);
+                       device_create_drvdata(st_sysfs_class,
+                                             &STp->device->sdev_gendev,
+                                             MKDEV(SCSI_TAPE_MAJOR,
+                                                   TAPE_MINOR(dev_num,
+                                                             mode, rew)),
+                                             &STp->modes[mode],
+                                             "%s", name);
                if (IS_ERR(st_class_member)) {
                        printk(KERN_WARNING "st%d: device_create failed\n",
                               dev_num);
                        error = PTR_ERR(st_class_member);
                        goto out;
                }
-               dev_set_drvdata(st_class_member, &STp->modes[mode]);
 
                error = device_create_file(st_class_member,
                                           &dev_attr_defined);
index 53fa19c..788c355 100644 (file)
@@ -2602,7 +2602,12 @@ static struct pci_device_id serial_pci_tbl[] = {
        {       PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS200,
                PCI_ANY_ID, PCI_ANY_ID, 0, 0,   /* 135a.0811 */
                pbn_b2_2_115200 },
-
+       /*
+        * IntaShield IS-400
+        */
+       {       PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS400,
+               PCI_ANY_ID, PCI_ANY_ID, 0, 0,    /* 135a.0dc0 */
+               pbn_b2_4_115200 },
        /*
         * Perle PCI-RAS cards
         */
index eab0327..53b03c6 100644 (file)
@@ -2054,6 +2054,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
 int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
 {
        struct uart_state *state = drv->state + port->line;
+       struct device *tty_dev;
+       struct uart_match match = {port, drv};
 
        mutex_lock(&state->mutex);
 
@@ -2063,7 +2065,8 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
                return 0;
        }
 
-       if (!port->suspended) {
+       tty_dev = device_find_child(port->dev, &match, serial_match_port);
+       if (!port->suspended && device_may_wakeup(tty_dev)) {
                disable_irq_wake(port->irq);
                mutex_unlock(&state->mutex);
                return 0;
index b3518ca..41620c0 100644 (file)
@@ -68,6 +68,7 @@ static unsigned long  minors[N_SPI_MINORS / BITS_PER_LONG];
 
 struct spidev_data {
        struct device           dev;
+       spinlock_t              spi_lock;
        struct spi_device       *spi;
        struct list_head        device_entry;
 
@@ -85,12 +86,75 @@ MODULE_PARM_DESC(bufsiz, "data bytes in biggest supported SPI message");
 
 /*-------------------------------------------------------------------------*/
 
+/*
+ * We can't use the standard synchronous wrappers for file I/O; we
+ * need to protect against async removal of the underlying spi_device.
+ */
+static void spidev_complete(void *arg)
+{
+       complete(arg);
+}
+
+static ssize_t
+spidev_sync(struct spidev_data *spidev, struct spi_message *message)
+{
+       DECLARE_COMPLETION_ONSTACK(done);
+       int status;
+
+       message->complete = spidev_complete;
+       message->context = &done;
+
+       spin_lock_irq(&spidev->spi_lock);
+       if (spidev->spi == NULL)
+               status = -ESHUTDOWN;
+       else
+               status = spi_async(spidev->spi, message);
+       spin_unlock_irq(&spidev->spi_lock);
+
+       if (status == 0) {
+               wait_for_completion(&done);
+               status = message->status;
+               if (status == 0)
+                       status = message->actual_length;
+       }
+       return status;
+}
+
+static inline ssize_t
+spidev_sync_write(struct spidev_data *spidev, size_t len)
+{
+       struct spi_transfer     t = {
+                       .tx_buf         = spidev->buffer,
+                       .len            = len,
+               };
+       struct spi_message      m;
+
+       spi_message_init(&m);
+       spi_message_add_tail(&t, &m);
+       return spidev_sync(spidev, &m);
+}
+
+static inline ssize_t
+spidev_sync_read(struct spidev_data *spidev, size_t len)
+{
+       struct spi_transfer     t = {
+                       .rx_buf         = spidev->buffer,
+                       .len            = len,
+               };
+       struct spi_message      m;
+
+       spi_message_init(&m);
+       spi_message_add_tail(&t, &m);
+       return spidev_sync(spidev, &m);
+}
+
+/*-------------------------------------------------------------------------*/
+
 /* Read-only message with current device setup */
 static ssize_t
 spidev_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
 {
        struct spidev_data      *spidev;
-       struct spi_device       *spi;
        ssize_t                 status = 0;
 
        /* chipselect only toggles at start or end of operation */
@@ -98,10 +162,9 @@ spidev_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
                return -EMSGSIZE;
 
        spidev = filp->private_data;
-       spi = spidev->spi;
 
        mutex_lock(&spidev->buf_lock);
-       status = spi_read(spi, spidev->buffer, count);
+       status = spidev_sync_read(spidev, count);
        if (status == 0) {
                unsigned long   missing;
 
@@ -122,7 +185,6 @@ spidev_write(struct file *filp, const char __user *buf,
                size_t count, loff_t *f_pos)
 {
        struct spidev_data      *spidev;
-       struct spi_device       *spi;
        ssize_t                 status = 0;
        unsigned long           missing;
 
@@ -131,12 +193,11 @@ spidev_write(struct file *filp, const char __user *buf,
                return -EMSGSIZE;
 
        spidev = filp->private_data;
-       spi = spidev->spi;
 
        mutex_lock(&spidev->buf_lock);
        missing = copy_from_user(spidev->buffer, buf, count);
        if (missing == 0) {
-               status = spi_write(spi, spidev->buffer, count);
+               status = spidev_sync_write(spidev, count);
                if (status == 0)
                        status = count;
        } else
@@ -153,7 +214,6 @@ static int spidev_message(struct spidev_data *spidev,
        struct spi_transfer     *k_xfers;
        struct spi_transfer     *k_tmp;
        struct spi_ioc_transfer *u_tmp;
-       struct spi_device       *spi = spidev->spi;
        unsigned                n, total;
        u8                      *buf;
        int                     status = -EFAULT;
@@ -215,7 +275,7 @@ static int spidev_message(struct spidev_data *spidev,
                spi_message_add_tail(k_tmp, &msg);
        }
 
-       status = spi_sync(spi, &msg);
+       status = spidev_sync(spidev, &msg);
        if (status < 0)
                goto done;
 
@@ -269,8 +329,16 @@ spidev_ioctl(struct inode *inode, struct file *filp,
        if (err)
                return -EFAULT;
 
+       /* guard against device removal before, or while,
+        * we issue this ioctl.
+        */
        spidev = filp->private_data;
-       spi = spidev->spi;
+       spin_lock_irq(&spidev->spi_lock);
+       spi = spi_dev_get(spidev->spi);
+       spin_unlock_irq(&spidev->spi_lock);
+
+       if (spi == NULL)
+               return -ESHUTDOWN;
 
        switch (cmd) {
        /* read requests */
@@ -356,8 +424,10 @@ spidev_ioctl(struct inode *inode, struct file *filp,
        default:
                /* segmented and/or full-duplex I/O request */
                if (_IOC_NR(cmd) != _IOC_NR(SPI_IOC_MESSAGE(0))
-                               || _IOC_DIR(cmd) != _IOC_WRITE)
-                       return -ENOTTY;
+                               || _IOC_DIR(cmd) != _IOC_WRITE) {
+                       retval = -ENOTTY;
+                       break;
+               }
 
                tmp = _IOC_SIZE(cmd);
                if ((tmp % sizeof(struct spi_ioc_transfer)) != 0) {
@@ -385,6 +455,7 @@ spidev_ioctl(struct inode *inode, struct file *filp,
                kfree(ioc);
                break;
        }
+       spi_dev_put(spi);
        return retval;
 }
 
@@ -488,6 +559,7 @@ static int spidev_probe(struct spi_device *spi)
 
        /* Initialize the driver data */
        spidev->spi = spi;
+       spin_lock_init(&spidev->spi_lock);
        mutex_init(&spidev->buf_lock);
 
        INIT_LIST_HEAD(&spidev->device_entry);
@@ -526,13 +598,17 @@ static int spidev_remove(struct spi_device *spi)
 {
        struct spidev_data      *spidev = dev_get_drvdata(&spi->dev);
 
-       mutex_lock(&device_list_lock);
+       /* make sure ops on existing fds can abort cleanly */
+       spin_lock_irq(&spidev->spi_lock);
+       spidev->spi = NULL;
+       spin_unlock_irq(&spidev->spi_lock);
 
+       /* prevent new opens */
+       mutex_lock(&device_list_lock);
        list_del(&spidev->device_entry);
        dev_set_drvdata(&spi->dev, NULL);
        clear_bit(MINOR(spidev->dev.devt), minors);
        device_unregister(&spidev->dev);
-
        mutex_unlock(&device_list_lock);
 
        return 0;
index 55cc7b8..0a12e90 100644 (file)
@@ -649,15 +649,14 @@ int __uio_register_device(struct module *owner,
        if (ret)
                goto err_get_minor;
 
-       idev->dev = device_create(uio_class->class, parent,
-                                 MKDEV(uio_major, idev->minor),
-                                 "uio%d", idev->minor);
+       idev->dev = device_create_drvdata(uio_class->class, parent,
+                                         MKDEV(uio_major, idev->minor), idev,
+                                         "uio%d", idev->minor);
        if (IS_ERR(idev->dev)) {
                printk(KERN_ERR "UIO: device register failed\n");
                ret = PTR_ERR(idev->dev);
                goto err_device_create;
        }
-       dev_set_drvdata(idev->dev, idev);
 
        ret = uio_dev_add_attributes(idev);
        if (ret)
index 3a9102d..66f17ed 100644 (file)
@@ -29,3 +29,14 @@ config USB_PRINTER
          To compile this driver as a module, choose M here: the
          module will be called usblp.
 
+config USB_WDM
+       tristate "USB Wireless Device Management support"
+       depends on USB
+       ---help---
+         This driver supports the WMC Device Management functionality
+         of cell phones compliant to the CDC WMC specification. You can use
+         AT commands over this device.
+
+         To compile this driver as a module, choose M here: the
+         module will be called cdc-wdm.
+
index cc391e6..535d59a 100644 (file)
@@ -5,3 +5,4 @@
 
 obj-$(CONFIG_USB_ACM)          += cdc-acm.o
 obj-$(CONFIG_USB_PRINTER)      += usblp.o
+obj-$(CONFIG_USB_WDM)          += cdc-wdm.o
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
new file mode 100644 (file)
index 0000000..107666d
--- /dev/null
@@ -0,0 +1,740 @@
+/*
+ * cdc-wdm.c
+ *
+ * This driver supports USB CDC WCM Device Management.
+ *
+ * Copyright (c) 2007-2008 Oliver Neukum
+ *
+ * Some code taken from cdc-acm.c
+ *
+ * Released under the GPLv2.
+ *
+ * Many thanks to Carl Nordbeck
+ */
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/slab.h>
+#include <linux/module.h>
+#include <linux/smp_lock.h>
+#include <linux/mutex.h>
+#include <linux/uaccess.h>
+#include <linux/bitops.h>
+#include <linux/poll.h>
+#include <linux/usb.h>
+#include <linux/usb/cdc.h>
+#include <asm/byteorder.h>
+#include <asm/unaligned.h>
+
+/*
+ * Version Information
+ */
+#define DRIVER_VERSION "v0.02"
+#define DRIVER_AUTHOR "Oliver Neukum"
+
+static struct usb_device_id wdm_ids[] = {
+       {
+               .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS |
+                                USB_DEVICE_ID_MATCH_INT_SUBCLASS,
+               .bInterfaceClass = USB_CLASS_COMM,
+               .bInterfaceSubClass = USB_CDC_SUBCLASS_DMM
+       },
+       { }
+};
+
+#define WDM_MINOR_BASE 176
+
+
+#define WDM_IN_USE             1
+#define WDM_DISCONNECTING      2
+#define WDM_RESULT             3
+#define WDM_READ               4
+#define WDM_INT_STALL          5
+#define WDM_POLL_RUNNING       6
+
+
+#define WDM_MAX                        16
+
+
+static DEFINE_MUTEX(wdm_mutex);
+
+/* --- method tables --- */
+
+struct wdm_device {
+       u8                      *inbuf; /* buffer for response */
+       u8                      *outbuf; /* buffer for command */
+       u8                      *sbuf; /* buffer for status */
+       u8                      *ubuf; /* buffer for copy to user space */
+
+       struct urb              *command;
+       struct urb              *response;
+       struct urb              *validity;
+       struct usb_interface    *intf;
+       struct usb_ctrlrequest  *orq;
+       struct usb_ctrlrequest  *irq;
+       spinlock_t              iuspin;
+
+       unsigned long           flags;
+       u16                     bufsize;
+       u16                     wMaxCommand;
+       u16                     wMaxPacketSize;
+       u16                     bMaxPacketSize0;
+       __le16                  inum;
+       int                     reslength;
+       int                     length;
+       int                     read;
+       int                     count;
+       dma_addr_t              shandle;
+       dma_addr_t              ihandle;
+       struct mutex            wlock;
+       struct mutex            rlock;
+       wait_queue_head_t       wait;
+       struct work_struct      rxwork;
+       int                     werr;
+       int                     rerr;
+};
+
+static struct usb_driver wdm_driver;
+
+/* --- callbacks --- */
+static void wdm_out_callback(struct urb *urb)
+{
+       struct wdm_device *desc;
+       desc = urb->context;
+       spin_lock(&desc->iuspin);
+       desc->werr = urb->status;
+       spin_unlock(&desc->iuspin);
+       clear_bit(WDM_IN_USE, &desc->flags);
+       kfree(desc->outbuf);
+       wake_up(&desc->wait);
+}
+
+static void wdm_in_callback(struct urb *urb)
+{
+       struct wdm_device *desc = urb->context;
+       int status = urb->status;
+
+       spin_lock(&desc->iuspin);
+
+       if (status) {
+               switch (status) {
+               case -ENOENT:
+                       dev_dbg(&desc->intf->dev,
+                               "nonzero urb status received: -ENOENT");
+                       break;
+               case -ECONNRESET:
+                       dev_dbg(&desc->intf->dev,
+                               "nonzero urb status received: -ECONNRESET");
+                       break;
+               case -ESHUTDOWN:
+                       dev_dbg(&desc->intf->dev,
+                               "nonzero urb status received: -ESHUTDOWN");
+                       break;
+               case -EPIPE:
+                       err("nonzero urb status received: -EPIPE");
+                       break;
+               default:
+                       err("Unexpected error %d", status);
+                       break;
+               }
+       }
+
+       desc->rerr = status;
+       desc->reslength = urb->actual_length;
+       memmove(desc->ubuf + desc->length, desc->inbuf, desc->reslength);
+       desc->length += desc->reslength;
+       wake_up(&desc->wait);
+
+       set_bit(WDM_READ, &desc->flags);
+       spin_unlock(&desc->iuspin);
+}
+
+static void wdm_int_callback(struct urb *urb)
+{
+       int rv = 0;
+       int status = urb->status;
+       struct wdm_device *desc;
+       struct usb_ctrlrequest *req;
+       struct usb_cdc_notification *dr;
+
+       desc = urb->context;
+       req = desc->irq;
+       dr = (struct usb_cdc_notification *)desc->sbuf;
+
+       if (status) {
+               switch (status) {
+               case -ESHUTDOWN:
+               case -ENOENT:
+               case -ECONNRESET:
+                       return; /* unplug */
+               case -EPIPE:
+                       set_bit(WDM_INT_STALL, &desc->flags);
+                       err("Stall on int endpoint");
+                       goto sw; /* halt is cleared in work */
+               default:
+                       err("nonzero urb status received: %d", status);
+                       break;
+               }
+       }
+
+       if (urb->actual_length < sizeof(struct usb_cdc_notification)) {
+               err("wdm_int_callback - %d bytes", urb->actual_length);
+               goto exit;
+       }
+
+       switch (dr->bNotificationType) {
+       case USB_CDC_NOTIFY_RESPONSE_AVAILABLE:
+               dev_dbg(&desc->intf->dev,
+                       "NOTIFY_RESPONSE_AVAILABLE received: index %d len %d",
+                       dr->wIndex, dr->wLength);
+               break;
+
+       case USB_CDC_NOTIFY_NETWORK_CONNECTION:
+
+               dev_dbg(&desc->intf->dev,
+                       "NOTIFY_NETWORK_CONNECTION %s network",
+                       dr->wValue ? "connected to" : "disconnected from");
+               goto exit;
+       default:
+               clear_bit(WDM_POLL_RUNNING, &desc->flags);
+               err("unknown notification %d received: index %d len %d",
+                       dr->bNotificationType, dr->wIndex, dr->wLength);
+               goto exit;
+       }
+
+       req->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE);
+       req->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE;
+       req->wValue = 0;
+       req->wIndex = desc->inum;
+       req->wLength = cpu_to_le16(desc->bMaxPacketSize0);
+
+       usb_fill_control_urb(
+               desc->response,
+               interface_to_usbdev(desc->intf),
+               /* using common endpoint 0 */
+               usb_rcvctrlpipe(interface_to_usbdev(desc->intf), 0),
+               (unsigned char *)req,
+               desc->inbuf,
+               desc->bMaxPacketSize0,
+               wdm_in_callback,
+               desc
+       );
+       desc->response->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+       spin_lock(&desc->iuspin);
+       clear_bit(WDM_READ, &desc->flags);
+       if (!test_bit(WDM_DISCONNECTING, &desc->flags)) {
+               rv = usb_submit_urb(desc->response, GFP_ATOMIC);
+               dev_dbg(&desc->intf->dev, "%s: usb_submit_urb %d",
+                       __func__, rv);
+       }
+       spin_unlock(&desc->iuspin);
+       if (rv < 0) {
+               if (rv == -EPERM)
+                       return;
+               if (rv == -ENOMEM) {
+sw:
+                       rv = schedule_work(&desc->rxwork);
+                       if (rv)
+                               err("Cannot schedule work");
+               }
+       }
+exit:
+       rv = usb_submit_urb(urb, GFP_ATOMIC);
+       if (rv)
+               err("%s - usb_submit_urb failed with result %d",
+                    __func__, rv);
+
+}
+
+static void kill_urbs(struct wdm_device *desc)
+{
+       usb_kill_urb(desc->command);
+       usb_kill_urb(desc->validity);
+       usb_kill_urb(desc->response);
+}
+
+static void free_urbs(struct wdm_device *desc)
+{
+       usb_free_urb(desc->validity);
+       usb_free_urb(desc->response);
+       usb_free_urb(desc->command);
+}
+
+static void cleanup(struct wdm_device *desc)
+{
+       usb_buffer_free(interface_to_usbdev(desc->intf),
+                       desc->wMaxPacketSize,
+                       desc->sbuf,
+                       desc->validity->transfer_dma);
+       usb_buffer_free(interface_to_usbdev(desc->intf),
+                       desc->wMaxPacketSize,
+                       desc->inbuf,
+                       desc->response->transfer_dma);
+       kfree(desc->orq);
+       kfree(desc->irq);
+       kfree(desc->ubuf);
+       free_urbs(desc);
+       kfree(desc);
+}
+
+static ssize_t wdm_write
+(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
+{
+       u8 *buf;
+       int rv = -EMSGSIZE, r, we;
+       struct wdm_device *desc = file->private_data;
+       struct usb_ctrlrequest *req;
+
+       if (count > desc->wMaxCommand)
+               count = desc->wMaxCommand;
+
+       spin_lock_irq(&desc->iuspin);
+       we = desc->werr;
+       desc->werr = 0;
+       spin_unlock_irq(&desc->iuspin);
+       if (we < 0)
+               return -EIO;
+
+       r = mutex_lock_interruptible(&desc->wlock); /* concurrent writes */
+       rv = -ERESTARTSYS;
+       if (r)
+               goto outnl;
+
+       r = wait_event_interruptible(desc->wait, !test_bit(WDM_IN_USE,
+                                                          &desc->flags));
+       if (r < 0)
+               goto out;
+
+       if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
+               rv = -ENODEV;
+               goto out;
+       }
+
+       desc->outbuf = buf = kmalloc(count, GFP_KERNEL);
+       if (!buf) {
+               rv = -ENOMEM;
+               goto out;
+       }
+
+       r = copy_from_user(buf, buffer, count);
+       if (r > 0) {
+               kfree(buf);
+               rv = -EFAULT;
+               goto out;
+       }
+
+       req = desc->orq;
+       usb_fill_control_urb(
+               desc->command,
+               interface_to_usbdev(desc->intf),
+               /* using common endpoint 0 */
+               usb_sndctrlpipe(interface_to_usbdev(desc->intf), 0),
+               (unsigned char *)req,
+               buf,
+               count,
+               wdm_out_callback,
+               desc
+       );
+
+       req->bRequestType = (USB_DIR_OUT | USB_TYPE_CLASS |
+                            USB_RECIP_INTERFACE);
+       req->bRequest = USB_CDC_SEND_ENCAPSULATED_COMMAND;
+       req->wValue = 0;
+       req->wIndex = desc->inum;
+       req->wLength = cpu_to_le16(count);
+       set_bit(WDM_IN_USE, &desc->flags);
+
+       rv = usb_submit_urb(desc->command, GFP_KERNEL);
+       if (rv < 0) {
+               kfree(buf);
+               clear_bit(WDM_IN_USE, &desc->flags);
+       } else {
+               dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d",
+                       req->wIndex);
+       }
+out:
+       mutex_unlock(&desc->wlock);
+outnl:
+       return rv < 0 ? rv : count;
+}
+
+static ssize_t wdm_read
+(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
+{
+       int rv, cntr;
+       int i = 0;
+       struct wdm_device *desc = file->private_data;
+
+
+       rv = mutex_lock_interruptible(&desc->rlock); /*concurrent reads */
+       if (rv < 0)
+               return -ERESTARTSYS;
+
+       if (desc->length == 0) {
+               desc->read = 0;
+retry:
+               i++;
+               rv = wait_event_interruptible(desc->wait,
+                                             test_bit(WDM_READ, &desc->flags));
+
+               if (rv < 0) {
+                       rv = -ERESTARTSYS;
+                       goto err;
+               }
+
+               spin_lock_irq(&desc->iuspin);
+
+               if (desc->rerr) { /* read completed, error happened */
+                       int t = desc->rerr;
+                       desc->rerr = 0;
+                       spin_unlock_irq(&desc->iuspin);
+                       err("reading had resulted in %d", t);
+                       rv = -EIO;
+                       goto err;
+               }
+               /*
+                * recheck whether we've lost the race
+                * against the completion handler
+                */
+               if (!test_bit(WDM_READ, &desc->flags)) { /* lost race */
+                       spin_unlock_irq(&desc->iuspin);
+                       goto retry;
+               }
+               if (!desc->reslength) { /* zero length read */
+                       spin_unlock_irq(&desc->iuspin);
+                       goto retry;
+               }
+               clear_bit(WDM_READ, &desc->flags);
+               spin_unlock_irq(&desc->iuspin);
+       }
+
+       cntr = count > desc->length ? desc->length : count;
+       rv = copy_to_user(buffer, desc->ubuf, cntr);
+       if (rv > 0) {
+               rv = -EFAULT;
+               goto err;
+       }
+
+       for (i = 0; i < desc->length - cntr; i++)
+               desc->ubuf[i] = desc->ubuf[i + cntr];
+
+       desc->length -= cntr;
+       rv = cntr;
+
+err:
+       mutex_unlock(&desc->rlock);
+       if (rv < 0)
+               err("wdm_read: exit error");
+       return rv;
+}
+
+static int wdm_flush(struct file *file, fl_owner_t id)
+{
+       struct wdm_device *desc = file->private_data;
+
+       wait_event(desc->wait, !test_bit(WDM_IN_USE, &desc->flags));
+       if (desc->werr < 0)
+               err("Error in flush path: %d", desc->werr);
+
+       return desc->werr;
+}
+
+static unsigned int wdm_poll(struct file *file, struct poll_table_struct *wait)
+{
+       struct wdm_device *desc = file->private_data;
+       unsigned long flags;
+       unsigned int mask = 0;
+
+       spin_lock_irqsave(&desc->iuspin, flags);
+       if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
+               mask = POLLERR;
+               spin_unlock_irqrestore(&desc->iuspin, flags);
+               goto desc_out;
+       }
+       if (test_bit(WDM_READ, &desc->flags))
+               mask = POLLIN | POLLRDNORM;
+       if (desc->rerr || desc->werr)
+               mask |= POLLERR;
+       if (!test_bit(WDM_IN_USE, &desc->flags))
+               mask |= POLLOUT | POLLWRNORM;
+       spin_unlock_irqrestore(&desc->iuspin, flags);
+
+       poll_wait(file, &desc->wait, wait);
+
+desc_out:
+       return mask;
+}
+
+static int wdm_open(struct inode *inode, struct file *file)
+{
+       int minor = iminor(inode);
+       int rv = -ENODEV;
+       struct usb_interface *intf;
+       struct wdm_device *desc;
+
+       mutex_lock(&wdm_mutex);
+       intf = usb_find_interface(&wdm_driver, minor);
+       if (!intf)
+               goto out;
+
+       desc = usb_get_intfdata(intf);
+       if (test_bit(WDM_DISCONNECTING, &desc->flags))
+               goto out;
+
+       desc->count++;
+       file->private_data = desc;
+
+       rv = usb_submit_urb(desc->validity, GFP_KERNEL);
+
+       if (rv < 0) {
+               desc->count--;
+               err("Error submitting int urb - %d", rv);
+               goto out;
+       }
+       rv = 0;
+
+out:
+       mutex_unlock(&wdm_mutex);
+       return rv;
+}
+
+static int wdm_release(struct inode *inode, struct file *file)
+{
+       struct wdm_device *desc = file->private_data;
+
+       mutex_lock(&wdm_mutex);
+       desc->count--;
+       if (!desc->count) {
+               dev_dbg(&desc->intf->dev, "wdm_release: cleanup");
+               kill_urbs(desc);
+       }
+       mutex_unlock(&wdm_mutex);
+       return 0;
+}
+
+static const struct file_operations wdm_fops = {
+       .owner =        THIS_MODULE,
+       .read =         wdm_read,
+       .write =        wdm_write,
+       .open =         wdm_open,
+       .flush =        wdm_flush,
+       .release =      wdm_release,
+       .poll =         wdm_poll
+};
+
+static struct usb_class_driver wdm_class = {
+       .name =         "cdc-wdm%d",
+       .fops =         &wdm_fops,
+       .minor_base =   WDM_MINOR_BASE,
+};
+
+/* --- error handling --- */
+static void wdm_rxwork(struct work_struct *work)
+{
+       struct wdm_device *desc = container_of(work, struct wdm_device, rxwork);
+       unsigned long flags;
+       int rv;
+
+       spin_lock_irqsave(&desc->iuspin, flags);
+       if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
+               spin_unlock_irqrestore(&desc->iuspin, flags);
+       } else {
+               spin_unlock_irqrestore(&desc->iuspin, flags);
+               rv = usb_submit_urb(desc->response, GFP_KERNEL);
+               if (rv < 0 && rv != -EPERM) {
+                       spin_lock_irqsave(&desc->iuspin, flags);
+                       if (!test_bit(WDM_DISCONNECTING, &desc->flags))
+                               schedule_work(&desc->rxwork);
+                       spin_unlock_irqrestore(&desc->iuspin, flags);
+               }
+       }
+}
+
+/* --- hotplug --- */
+
+static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
+{
+       int rv = -EINVAL;
+       struct usb_device *udev = interface_to_usbdev(intf);
+       struct wdm_device *desc;
+       struct usb_host_interface *iface;
+       struct usb_endpoint_descriptor *ep;
+       struct usb_cdc_dmm_desc *dmhd;
+       u8 *buffer = intf->altsetting->extra;
+       int buflen = intf->altsetting->extralen;
+       u16 maxcom = 0;
+
+       if (!buffer)
+               goto out;
+
+       while (buflen > 0) {
+               if (buffer [1] != USB_DT_CS_INTERFACE) {
+                       err("skipping garbage");
+                       goto next_desc;
+               }
+
+               switch (buffer [2]) {
+               case USB_CDC_HEADER_TYPE:
+                       break;
+               case USB_CDC_DMM_TYPE:
+                       dmhd = (struct usb_cdc_dmm_desc *)buffer;
+                       maxcom = le16_to_cpu(dmhd->wMaxCommand);
+                       dev_dbg(&intf->dev,
+                               "Finding maximum buffer length: %d", maxcom);
+                       break;
+               default:
+                       err("Ignoring extra header, type %d, length %d",
+                               buffer[2], buffer[0]);
+                       break;
+               }
+next_desc:
+               buflen -= buffer[0];
+               buffer += buffer[0];
+       }
+
+       rv = -ENOMEM;
+       desc = kzalloc(sizeof(struct wdm_device), GFP_KERNEL);
+       if (!desc)
+               goto out;
+       mutex_init(&desc->wlock);
+       mutex_init(&desc->rlock);
+       spin_lock_init(&desc->iuspin);
+       init_waitqueue_head(&desc->wait);
+       desc->wMaxCommand = maxcom;
+       desc->inum = cpu_to_le16((u16)intf->cur_altsetting->desc.bInterfaceNumber);
+       desc->intf = intf;
+       INIT_WORK(&desc->rxwork, wdm_rxwork);
+
+       iface = &intf->altsetting[0];
+       ep = &iface->endpoint[0].desc;
+       if (!usb_endpoint_is_int_in(ep)) {
+               rv = -EINVAL;
+               goto err;
+       }
+
+       desc->wMaxPacketSize = ep->wMaxPacketSize;
+       desc->bMaxPacketSize0 = cpu_to_le16(udev->descriptor.bMaxPacketSize0);
+
+       desc->orq = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL);
+       if (!desc->orq)
+               goto err;
+       desc->irq = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL);
+       if (!desc->irq)
+               goto err;
+
+       desc->validity = usb_alloc_urb(0, GFP_KERNEL);
+       if (!desc->validity)
+               goto err;
+
+       desc->response = usb_alloc_urb(0, GFP_KERNEL);
+       if (!desc->response)
+               goto err;
+
+       desc->command = usb_alloc_urb(0, GFP_KERNEL);
+       if (!desc->command)
+               goto err;
+
+       desc->ubuf = kmalloc(desc->wMaxCommand, GFP_KERNEL);
+       if (!desc->ubuf)
+               goto err;
+
+       desc->sbuf = usb_buffer_alloc(interface_to_usbdev(intf),
+                                       desc->wMaxPacketSize,
+                                       GFP_KERNEL,
+                                       &desc->validity->transfer_dma);
+       if (!desc->sbuf)
+               goto err;
+
+       desc->inbuf = usb_buffer_alloc(interface_to_usbdev(intf),
+                                       desc->bMaxPacketSize0,
+                                       GFP_KERNEL,
+                                       &desc->response->transfer_dma);
+       if (!desc->inbuf)
+               goto err2;
+
+       usb_fill_int_urb(
+               desc->validity,
+               interface_to_usbdev(intf),
+               usb_rcvintpipe(interface_to_usbdev(intf), ep->bEndpointAddress),
+               desc->sbuf,
+               desc->wMaxPacketSize,
+               wdm_int_callback,
+               desc,
+               ep->bInterval
+       );
+       desc->validity->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+
+       usb_set_intfdata(intf, desc);
+       rv = usb_register_dev(intf, &wdm_class);
+       dev_info(&intf->dev, "cdc-wdm%d: USB WDM device\n",
+                intf->minor - WDM_MINOR_BASE);
+       if (rv < 0)
+               goto err;
+out:
+       return rv;
+err2:
+       usb_buffer_free(interface_to_usbdev(desc->intf),
+                       desc->wMaxPacketSize,
+                       desc->sbuf,
+                       desc->validity->transfer_dma);
+err:
+       free_urbs(desc);
+       kfree(desc->ubuf);
+       kfree(desc->orq);
+       kfree(desc->irq);
+       kfree(desc);
+       return rv;
+}
+
+static void wdm_disconnect(struct usb_interface *intf)
+{
+       struct wdm_device *desc;
+       unsigned long flags;
+
+       usb_deregister_dev(intf, &wdm_class);
+       mutex_lock(&wdm_mutex);
+       desc = usb_get_intfdata(intf);
+
+       /* the spinlock makes sure no new urbs are generated in the callbacks */
+       spin_lock_irqsave(&desc->iuspin, flags);
+       set_bit(WDM_DISCONNECTING, &desc->flags);
+       set_bit(WDM_READ, &desc->flags);
+       clear_bit(WDM_IN_USE, &desc->flags);
+       spin_unlock_irqrestore(&desc->iuspin, flags);
+       cancel_work_sync(&desc->rxwork);
+       kill_urbs(desc);
+       wake_up_all(&desc->wait);
+       if (!desc->count)
+               cleanup(desc);
+       mutex_unlock(&wdm_mutex);
+}
+
+static struct usb_driver wdm_driver = {
+       .name =         "cdc_wdm",
+       .probe =        wdm_probe,
+       .disconnect =   wdm_disconnect,
+       .id_table =     wdm_ids,
+};
+
+/* --- low level module stuff --- */
+
+static int __init wdm_init(void)
+{
+       int rv;
+
+       rv = usb_register(&wdm_driver);
+
+       return rv;
+}
+
+static void __exit wdm_exit(void)
+{
+       usb_deregister(&wdm_driver);
+}
+
+module_init(wdm_init);
+module_exit(wdm_exit);
+
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION("USB Abstract Control Model driver for "
+                  "USB WCM Device Management");
+MODULE_LICENSE("GPL");
index bf10e9c..09a53e7 100644 (file)
@@ -818,12 +818,12 @@ static int usb_register_bus(struct usb_bus *bus)
        set_bit (busnum, busmap.busmap);
        bus->busnum = busnum;
 
-       bus->dev = device_create(usb_host_class, bus->controller, MKDEV(0, 0),
-                                "usb_host%d", busnum);
+       bus->dev = device_create_drvdata(usb_host_class, bus->controller,
+                                        MKDEV(0, 0), bus,
+                                        "usb_host%d", busnum);
        result = PTR_ERR(bus->dev);
        if (IS_ERR(bus->dev))
                goto error_create_class_dev;
-       dev_set_drvdata(bus->dev, bus);
 
        /* Add it to the local list of buses */
        list_add (&bus->bus_list, &usb_bus_list);
index 499b7a2..e02bfd4 100644 (file)
@@ -1526,7 +1526,8 @@ static void udc_disable(struct pxa_udc *udc)
 
        ep0_idle(udc);
        udc->gadget.speed = USB_SPEED_UNKNOWN;
-       udc->mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
+       if (udc->mach->udc_command)
+               udc->mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
 }
 
 /**
index d187d03..3adfda8 100644 (file)
@@ -115,6 +115,8 @@ static int ehci_orion_setup(struct usb_hcd *hcd)
        if (retval)
                return retval;
 
+       hcd->has_tt = 1;
+
        ehci_reset(ehci);
        ehci_port_power(ehci, 0);
 
index 24230c6..4cfa25b 100644 (file)
@@ -595,14 +595,14 @@ static int interfacekit_probe(struct usb_interface *intf, const struct usb_devic
         } while(value);
         kit->dev_no = bit;
 
-        kit->dev = device_create(phidget_class, &kit->udev->dev, 0,
-                               "interfacekit%d", kit->dev_no);
+       kit->dev = device_create_drvdata(phidget_class, &kit->udev->dev,
+                                       MKDEV(0, 0), kit,
+                                       "interfacekit%d", kit->dev_no);
         if (IS_ERR(kit->dev)) {
                 rc = PTR_ERR(kit->dev);
                 kit->dev = NULL;
                 goto out;
         }
-       dev_set_drvdata(kit->dev, kit);
 
        if (usb_submit_urb(kit->irq, GFP_KERNEL)) {
                rc = -EIO;
index f0113c1..9b4696f 100644 (file)
@@ -365,16 +365,15 @@ static int motorcontrol_probe(struct usb_interface *intf, const struct usb_devic
        } while(value);
        mc->dev_no = bit;
 
-       mc->dev = device_create(phidget_class, &mc->udev->dev, 0,
-                               "motorcontrol%d", mc->dev_no);
+       mc->dev = device_create_drvdata(phidget_class, &mc->udev->dev,
+                                       MKDEV(0, 0), mc,
+                                       "motorcontrol%d", mc->dev_no);
        if (IS_ERR(mc->dev)) {
                rc = PTR_ERR(mc->dev);
                mc->dev = NULL;
                goto out;
        }
 
-       dev_set_drvdata(mc->dev, mc);
-
        if (usb_submit_urb(mc->irq, GFP_KERNEL)) {
                rc = -EIO;
                goto out;
index 7d590c0..1ca7ddb 100644 (file)
@@ -275,14 +275,14 @@ servo_probe(struct usb_interface *interface, const struct usb_device_id *id)
         } while (value);
        dev->dev_no = bit;
 
-       dev->dev = device_create(phidget_class, &dev->udev->dev, 0,
-                                "servo%d", dev->dev_no);
+       dev->dev = device_create_drvdata(phidget_class, &dev->udev->dev,
+                                        MKDEV(0, 0), dev,
+                                        "servo%d", dev->dev_no);
        if (IS_ERR(dev->dev)) {
                rc = PTR_ERR(dev->dev);
                dev->dev = NULL;
                goto out;
        }
-       dev_set_drvdata(dev->dev, dev);
 
        servo_count = dev->type & SERVO_COUNT_QUAD ? 4 : 1;
 
index ba28fdc..1f7c86b 100644 (file)
@@ -28,6 +28,7 @@ static int debug;
 
 static struct usb_device_id id_table [] = {
        { USB_DEVICE(0x4348, 0x5523) },
+       { USB_DEVICE(0x1a86, 0x7523) },
        { },
 };
 MODULE_DEVICE_TABLE(usb, id_table);
index 5b349ec..3cee6fe 100644 (file)
@@ -374,6 +374,7 @@ static struct usb_device_id id_table_combined [] = {
                .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
        { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID),
                .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+       { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
        { },                                    /* Optional parameter entry */
        { }                                     /* Terminating entry */
 };
index 504edf8..a72f2c8 100644 (file)
 #define        FIC_NEO1973_DEBUG_PID   0x5118
 
 /*
+ * RATOC REX-USB60F
+ */
+#define RATOC_VENDOR_ID                0x0584
+#define RATOC_PRODUCT_ID_USB60F        0xb020
+
+/*
  *   BmRequestType:  1100 0000b
  *   bRequest:       FTDI_E2_READ
  *   wValue:         0
index e7e016e..6cecd2c 100644 (file)
@@ -183,6 +183,7 @@ static int  option_send_setup(struct usb_serial_port *port);
 #define AXESSTEL_PRODUCT_MV110H                        0x1000
 
 #define ONDA_VENDOR_ID                         0x19d2
+#define ONDA_PRODUCT_MSA501HS                  0x0001
 #define ONDA_PRODUCT_ET502HS                   0x0002
 
 #define BANDRICH_VENDOR_ID                     0x1A8D
@@ -196,6 +197,9 @@ static int  option_send_setup(struct usb_serial_port *port);
 
 #define MAXON_VENDOR_ID                                0x16d8
 
+#define TELIT_VENDOR_ID                                0x1bc7
+#define TELIT_PRODUCT_UC864E                   0x1003
+
 static struct usb_device_id option_ids[] = {
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -297,13 +301,14 @@ static struct usb_device_id option_ids[] = {
        { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) },
        { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
        { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) },
+       { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MSA501HS) },
        { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) },
        { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) },
        { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) },
        { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) },
        { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
        { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */
-       { USB_DEVICE(0x19d2, 0x0001) },         /* Telstra NextG CDMA */
+       { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) },
        { } /* Terminating entry */
 };
 MODULE_DEVICE_TABLE(usb, option_ids);
index c605fb6..234c5ee 100644 (file)
@@ -66,7 +66,6 @@ static struct usb_device_id id_table [] = {
        { USB_DEVICE(ITEGNO_VENDOR_ID, ITEGNO_PRODUCT_ID_2080) },
        { USB_DEVICE(MA620_VENDOR_ID, MA620_PRODUCT_ID) },
        { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID) },
-       { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
        { USB_DEVICE(TRIPP_VENDOR_ID, TRIPP_PRODUCT_ID) },
        { USB_DEVICE(RADIOSHACK_VENDOR_ID, RADIOSHACK_PRODUCT_ID) },
        { USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) },
index 10cf872..3bdefe0 100644 (file)
@@ -36,7 +36,6 @@
 
 #define RATOC_VENDOR_ID                0x0584
 #define RATOC_PRODUCT_ID       0xb000
-#define RATOC_PRODUCT_ID_USB60F        0xb020
 
 #define TRIPP_VENDOR_ID                0x2478
 #define TRIPP_PRODUCT_ID       0x2008
index e4bcf53..bd4ac0b 100644 (file)
@@ -3356,7 +3356,7 @@ static int __devinit atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *i
 
        info->fix.mmio_start = raddr;
        par->ati_regbase = ioremap(info->fix.mmio_start, 0x1000);
-       if (par->ati_regbase == 0)
+       if (par->ati_regbase == NULL)
                return -ENOMEM;
 
        info->fix.mmio_start += par->aux_start ? 0x400 : 0xc00;
index 72cd0d2..400e926 100644 (file)
@@ -2277,8 +2277,8 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
        do {
                rinfo->fb_base = ioremap (rinfo->fb_base_phys,
                                          rinfo->mapped_vram);
-       } while (   rinfo->fb_base == 0 &&
-                 ((rinfo->mapped_vram /=2) >= MIN_MAPPED_VRAM) );
+       } while (rinfo->fb_base == NULL &&
+                ((rinfo->mapped_vram /= 2) >= MIN_MAPPED_VRAM));
 
        if (rinfo->fb_base == NULL) {
                printk (KERN_ERR "radeonfb (%s): cannot map FB\n",
index 3547717..6ef800b 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/ctype.h>
 #include <linux/idr.h>
 #include <linux/err.h>
+#include <linux/kdev_t.h>
 
 static ssize_t display_show_name(struct device *dev,
                                struct device_attribute *attr, char *buf)
@@ -152,10 +153,13 @@ struct display_device *display_device_register(struct display_driver *driver,
                mutex_unlock(&allocated_dsp_lock);
 
                if (!ret) {
-                       new_dev->dev = device_create(display_class, parent, 0,
-                                               "display%d", new_dev->idx);
+                       new_dev->dev = device_create_drvdata(display_class,
+                                                            parent,
+                                                            MKDEV(0,0),
+                                                            new_dev,
+                                                            "display%d",
+                                                            new_dev->idx);
                        if (!IS_ERR(new_dev->dev)) {
-                               dev_set_drvdata(new_dev->dev, new_dev);
                                new_dev->parent = parent;
                                new_dev->driver = driver;
                                mutex_init(&new_dev->lock);
index f3107ad..9588323 100644 (file)
@@ -200,7 +200,7 @@ static inline int mga_ioremap(unsigned long phys, unsigned long size, int flags,
                virt->vaddr = ioremap_nocache(phys, size);
        else
                virt->vaddr = ioremap(phys, size);
-       return (virt->vaddr == 0); /* 0, !0... 0, error_code in future */
+       return (virt->vaddr == NULL); /* 0, !0... 0, error_code in future */
 }
 
 static inline void mga_iounmap(vaddr_t va) {
index 3ee314b..274bc93 100644 (file)
@@ -1351,7 +1351,6 @@ static struct pxafb_info * __init pxafb_init_fbinfo(struct device *dev)
        struct pxafb_info *fbi;
        void *addr;
        struct pxafb_mach_info *inf = dev->platform_data;
-       struct pxafb_mode_info *mode = inf->modes;
 
        /* Alloc the pxafb_info and pseudo_palette in one step */
        fbi = kmalloc(sizeof(struct pxafb_info) + sizeof(u32) * 16, GFP_KERNEL);
index 13b38cb..f059896 100644 (file)
@@ -1,75 +1,15 @@
-/*
- * linux/drivers/video/s3c2410fb.c
- *     Copyright (c) Arnaud Patard, Ben Dooks
+/* linux/drivers/video/s3c2410fb.c
+ *     Copyright (c) 2004,2005 Arnaud Patard
+ *     Copyright (c) 2004-2008 Ben Dooks
+ *
+ * S3C2410 LCD Framebuffer Driver
  *
  * 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.
  *
- *         S3C2410 LCD Controller Frame Buffer Driver
- *         based on skeletonfb.c, sa1100fb.c and others
- *
- * ChangeLog
- * 2005-04-07: Arnaud Patard <arnaud.patard@rtp-net.org>
- *      - u32 state -> pm_message_t state
- *      - S3C2410_{VA,SZ}_LCD -> S3C24XX
- *
- * 2005-03-15: Arnaud Patard <arnaud.patard@rtp-net.org>
- *      - Removed the ioctl
- *      - use readl/writel instead of __raw_writel/__raw_readl
- *
- * 2004-12-04: Arnaud Patard <arnaud.patard@rtp-net.org>
- *      - Added the possibility to set on or off the
- *      debugging messages
- *      - Replaced 0 and 1 by on or off when reading the
- *      /sys files
- *
- * 2005-03-23: Ben Dooks <ben-linux@fluff.org>
- *     - added non 16bpp modes
- *     - updated platform information for range of x/y/bpp
- *     - add code to ensure palette is written correctly
- *     - add pixel clock divisor control
- *
- * 2004-11-11: Arnaud Patard <arnaud.patard@rtp-net.org>
- *     - Removed the use of currcon as it no more exists
- *     - Added LCD power sysfs interface
- *
- * 2004-11-03: Ben Dooks <ben-linux@fluff.org>
- *     - minor cleanups
- *     - add suspend/resume support
- *     - s3c2410fb_setcolreg() not valid in >8bpp modes
- *     - removed last CONFIG_FB_S3C2410_FIXED
- *     - ensure lcd controller stopped before cleanup
- *     - added sysfs interface for backlight power
- *     - added mask for gpio configuration
- *     - ensured IRQs disabled during GPIO configuration
- *     - disable TPAL before enabling video
- *
- * 2004-09-20: Arnaud Patard <arnaud.patard@rtp-net.org>
- *      - Suppress command line options
- *
- * 2004-09-15: Arnaud Patard <arnaud.patard@rtp-net.org>
- *     - code cleanup
- *
- * 2004-09-07: Arnaud Patard <arnaud.patard@rtp-net.org>
- *     - Renamed from h1940fb.c to s3c2410fb.c
- *     - Add support for different devices
- *     - Backlight support
- *
- * 2004-09-05: Herbert Pötzl <herbert@13thfloor.at>
- *     - added clock (de-)allocation code
- *     - added fixem fbmem option
- *
- * 2004-07-27: Arnaud Patard <arnaud.patard@rtp-net.org>
- *     - code cleanup
- *     - added a forgotten return in h1940fb_init
- *
- * 2004-07-19: Herbert Pötzl <herbert@13thfloor.at>
- *     - code cleanup and extended debugging
- *
- * 2004-07-15: Arnaud Patard <arnaud.patard@rtp-net.org>
- *     - First version
- */
+ * Driver based on skeletonfb.c, sa1100fb.c and others.
+*/
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -580,6 +520,27 @@ static int s3c2410fb_setcolreg(unsigned regno,
        return 0;
 }
 
+/* s3c2410fb_lcd_enable
+ *
+ * shutdown the lcd controller
+ */
+static void s3c2410fb_lcd_enable(struct s3c2410fb_info *fbi, int enable)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+
+       if (enable)
+               fbi->regs.lcdcon1 |= S3C2410_LCDCON1_ENVID;
+       else
+               fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;
+
+       writel(fbi->regs.lcdcon1, fbi->io + S3C2410_LCDCON1);
+
+       local_irq_restore(flags);
+}
+
+
 /*
  *      s3c2410fb_blank
  *     @blank_mode: the blank mode we want.
@@ -589,9 +550,6 @@ static int s3c2410fb_setcolreg(unsigned regno,
  *     blanking succeeded, != 0 if un-/blanking failed due to e.g. a
  *     video mode which doesn't support it. Implements VESA suspend
  *     and powerdown modes on hardware that supports disabling hsync/vsync:
- *     blank_mode == 2: suspend vsync
- *     blank_mode == 3: suspend hsync
- *     blank_mode == 4: powerdown
  *
  *     Returns negative errno on error, or zero on success.
  *
@@ -605,6 +563,12 @@ static int s3c2410fb_blank(int blank_mode, struct fb_info *info)
 
        tpal_reg += is_s3c2412(fbi) ? S3C2412_TPAL : S3C2410_TPAL;
 
+       if (blank_mode == FB_BLANK_POWERDOWN) {
+               s3c2410fb_lcd_enable(fbi, 0);
+       } else {
+               s3c2410fb_lcd_enable(fbi, 1);
+       }
+
        if (blank_mode == FB_BLANK_UNBLANK)
                writel(0x0, tpal_reg);
        else {
@@ -948,7 +912,10 @@ static int __init s3c24xxfb_probe(struct platform_device *pdev,
        }
 
        /* create device files */
-       device_create_file(&pdev->dev, &dev_attr_debug);
+       ret = device_create_file(&pdev->dev, &dev_attr_debug);
+       if (ret) {
+               printk(KERN_ERR "failed to add debug attribute\n");
+       }
 
        printk(KERN_INFO "fb%d: %s frame buffer device\n",
                fbinfo->node, fbinfo->fix.id);
@@ -983,21 +950,6 @@ static int __init s3c2412fb_probe(struct platform_device *pdev)
        return s3c24xxfb_probe(pdev, DRV_S3C2412);
 }
 
-/* s3c2410fb_stop_lcd
- *
- * shutdown the lcd controller
- */
-static void s3c2410fb_stop_lcd(struct s3c2410fb_info *fbi)
-{
-       unsigned long flags;
-
-       local_irq_save(flags);
-
-       fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;
-       writel(fbi->regs.lcdcon1, fbi->io + S3C2410_LCDCON1);
-
-       local_irq_restore(flags);
-}
 
 /*
  *  Cleanup
@@ -1010,7 +962,7 @@ static int s3c2410fb_remove(struct platform_device *pdev)
 
        unregister_framebuffer(fbinfo);
 
-       s3c2410fb_stop_lcd(info);
+       s3c2410fb_lcd_enable(info, 0);
        msleep(1);
 
        s3c2410fb_unmap_video_memory(fbinfo);
@@ -1043,7 +995,7 @@ static int s3c2410fb_suspend(struct platform_device *dev, pm_message_t state)
        struct fb_info     *fbinfo = platform_get_drvdata(dev);
        struct s3c2410fb_info *info = fbinfo->par;
 
-       s3c2410fb_stop_lcd(info);
+       s3c2410fb_lcd_enable(info, 0);
 
        /* sleep before disabling the clock, we need to ensure
         * the LCD DMA engine is not going to get back on the bus
@@ -1118,3 +1070,5 @@ MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>, "
              "Ben Dooks <ben-linux@fluff.org>");
 MODULE_DESCRIPTION("Framebuffer driver for the s3c2410");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:s3c2410-lcd");
+MODULE_ALIAS("platform:s3c2412-lcd");
index dbb73b9..9a6ba3e 100644 (file)
@@ -1,26 +1,14 @@
 /*
  * linux/drivers/video/s3c2410fb.h
- * Copyright (c) Arnaud Patard
+ *     Copyright (c) 2004 Arnaud Patard
+ *
+ *  S3C2410 LCD Framebuffer Driver
  *
  * 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.
  *
- *         S3C2410 LCD Controller Frame Buffer Driver
- *         based on skeletonfb.c, sa1100fb.h
- *
- * ChangeLog
- *
- * 2004-12-04: Arnaud Patard <arnaud.patard@rtp-net.org>
- *      - Moved dprintk to s3c2410fb.c
- *
- * 2004-09-07: Arnaud Patard <arnaud.patard@rtp-net.org>
- *     - Renamed from h1940fb.h to s3c2410fb.h
- *     - Changed h1940 to s3c2410
- *
- * 2004-07-15: Arnaud Patard <arnaud.patard@rtp-net.org>
- *     - First version
- */
+*/
 
 #ifndef __S3C2410FB_H
 #define __S3C2410FB_H
index 7380362..b934384 100644 (file)
@@ -5787,7 +5787,7 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        } else {
                struct sis_video_info *countvideo = card_list;
                ivideo->cardnumber = 1;
-               while((countvideo = countvideo->next) != 0)
+               while((countvideo = countvideo->next) != NULL)
                        ivideo->cardnumber++;
        }
 
index 742b5c6..15d4a76 100644 (file)
@@ -663,14 +663,14 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
                sm501fb_sync_regs(fbi);
                mdelay(10);
 
-               if (pd->flags & SM501FB_FLAG_PANEL_USE_VBIASEN) {
+               if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) {
                        control |= SM501_DC_PANEL_CONTROL_BIAS; /* VBIASEN */
                        writel(control, ctrl_reg);
                        sm501fb_sync_regs(fbi);
                        mdelay(10);
                }
 
-               if (pd->flags & SM501FB_FLAG_PANEL_USE_FPEN) {
+               if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
                        control |= SM501_DC_PANEL_CONTROL_FPEN;
                        writel(control, ctrl_reg);
                        sm501fb_sync_regs(fbi);
@@ -678,14 +678,14 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
                }
        } else if (!to && (control & SM501_DC_PANEL_CONTROL_VDD) != 0) {
                /* disable panel power */
-               if (pd->flags & SM501FB_FLAG_PANEL_USE_FPEN) {
+               if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
                        control &= ~SM501_DC_PANEL_CONTROL_FPEN;
                        writel(control, ctrl_reg);
                        sm501fb_sync_regs(fbi);
                        mdelay(10);
                }
 
-               if (pd->flags & SM501FB_FLAG_PANEL_USE_VBIASEN) {
+               if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) {
                        control &= ~SM501_DC_PANEL_CONTROL_BIAS;
                        writel(control, ctrl_reg);
                        sm501fb_sync_regs(fbi);
index 254d115..ccb78f6 100644 (file)
@@ -295,6 +295,19 @@ config ALIM7101_WDT
 
          Most people will say N.
 
+config GEODE_WDT
+       tristate "AMD Geode CS5535/CS5536 Watchdog"
+       depends on MGEODE_LX
+       help
+         This driver enables a watchdog capability built into the
+         CS5535/CS5536 companion chips for the AMD Geode GX and LX
+         processors.  This watchdog watches your kernel to make sure
+         it doesn't freeze, and if it does, it reboots your computer after
+         a certain amount of time.
+
+         You can compile this driver directly into the kernel, or use
+         it as a module.  The module will be called geodewdt.
+
 config SC520_WDT
        tristate "AMD Elan SC520 processor Watchdog"
        depends on X86
index f3fb170..25b352b 100644 (file)
@@ -59,6 +59,7 @@ obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
 obj-$(CONFIG_ADVANTECH_WDT) += advantechwdt.o
 obj-$(CONFIG_ALIM1535_WDT) += alim1535_wdt.o
 obj-$(CONFIG_ALIM7101_WDT) += alim7101_wdt.o
+obj-$(CONFIG_GEODE_WDT) += geodewdt.o
 obj-$(CONFIG_SC520_WDT) += sc520_wdt.o
 obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o
 obj-$(CONFIG_IB700_WDT) += ib700wdt.o
index 1237113..03b3e3d 100644 (file)
@@ -29,7 +29,8 @@
 
 #define stamp(fmt, args...) pr_debug("%s:%i: " fmt "\n", __func__, __LINE__, ## args)
 #define stampit() stamp("here i am")
-#define pr_init(fmt, args...) ({ static const __initdata char __fmt[] = fmt; printk(__fmt, ## args); })
+#define pr_devinit(fmt, args...) ({ static const __devinitconst char __fmt[] = fmt; printk(__fmt, ## args); })
+#define pr_init(fmt, args...) ({ static const __initconst char __fmt[] = fmt; printk(__fmt, ## args); })
 
 #define WATCHDOG_NAME "bfin-wdt"
 #define PFX WATCHDOG_NAME ": "
@@ -377,20 +378,6 @@ static int bfin_wdt_resume(struct platform_device *pdev)
 # define bfin_wdt_resume NULL
 #endif
 
-static struct platform_device bfin_wdt_device = {
-       .name          = WATCHDOG_NAME,
-       .id            = -1,
-};
-
-static struct platform_driver bfin_wdt_driver = {
-       .driver    = {
-               .name  = WATCHDOG_NAME,
-               .owner = THIS_MODULE,
-       },
-       .suspend   = bfin_wdt_suspend,
-       .resume    = bfin_wdt_resume,
-};
-
 static const struct file_operations bfin_wdt_fops = {
        .owner    = THIS_MODULE,
        .llseek   = no_llseek,
@@ -418,11 +405,67 @@ static struct notifier_block bfin_wdt_notifier = {
 };
 
 /**
- *     bfin_wdt_init - Initialize module
+ *     bfin_wdt_probe - Initialize module
  *
- *     Registers the device and notifier handler. Actual device
+ *     Registers the misc device and notifier handler.  Actual device
  *     initialization is handled by bfin_wdt_open().
  */
+static int __devinit bfin_wdt_probe(struct platform_device *pdev)
+{
+       int ret;
+
+       ret = register_reboot_notifier(&bfin_wdt_notifier);
+       if (ret) {
+               pr_devinit(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", ret);
+               return ret;
+       }
+
+       ret = misc_register(&bfin_wdt_miscdev);
+       if (ret) {
+               pr_devinit(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                      WATCHDOG_MINOR, ret);
+               unregister_reboot_notifier(&bfin_wdt_notifier);
+               return ret;
+       }
+
+       pr_devinit(KERN_INFO PFX "initialized: timeout=%d sec (nowayout=%d)\n",
+              timeout, nowayout);
+
+       return 0;
+}
+
+/**
+ *     bfin_wdt_remove - Initialize module
+ *
+ *     Unregisters the misc device and notifier handler.  Actual device
+ *     deinitialization is handled by bfin_wdt_close().
+ */
+static int __devexit bfin_wdt_remove(struct platform_device *pdev)
+{
+       misc_deregister(&bfin_wdt_miscdev);
+       unregister_reboot_notifier(&bfin_wdt_notifier);
+       return 0;
+}
+
+static struct platform_device *bfin_wdt_device;
+
+static struct platform_driver bfin_wdt_driver = {
+       .probe     = bfin_wdt_probe,
+       .remove    = __devexit_p(bfin_wdt_remove),
+       .suspend   = bfin_wdt_suspend,
+       .resume    = bfin_wdt_resume,
+       .driver    = {
+               .name  = WATCHDOG_NAME,
+               .owner = THIS_MODULE,
+       },
+};
+
+/**
+ *     bfin_wdt_init - Initialize module
+ *
+ *     Checks the module params and registers the platform device & driver.
+ *     Real work is in the platform probe function.
+ */
 static int __init bfin_wdt_init(void)
 {
        int ret;
@@ -436,44 +479,32 @@ static int __init bfin_wdt_init(void)
        /* Since this is an on-chip device and needs no board-specific
         * resources, we'll handle all the platform device stuff here.
         */
-       ret = platform_device_register(&bfin_wdt_device);
-       if (ret)
-               return ret;
-
-       ret = platform_driver_probe(&bfin_wdt_driver, NULL);
-       if (ret)
-               return ret;
-
-       ret = register_reboot_notifier(&bfin_wdt_notifier);
+       ret = platform_driver_register(&bfin_wdt_driver);
        if (ret) {
-               pr_init(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", ret);
+               pr_init(KERN_ERR PFX "unable to register driver\n");
                return ret;
        }
 
-       ret = misc_register(&bfin_wdt_miscdev);
-       if (ret) {
-               pr_init(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                      WATCHDOG_MINOR, ret);
-               unregister_reboot_notifier(&bfin_wdt_notifier);
-               return ret;
+       bfin_wdt_device = platform_device_register_simple(WATCHDOG_NAME, -1, NULL, 0);
+       if (IS_ERR(bfin_wdt_device)) {
+               pr_init(KERN_ERR PFX "unable to register device\n");
+               platform_driver_unregister(&bfin_wdt_driver);
+               return PTR_ERR(bfin_wdt_device);
        }
 
-       pr_init(KERN_INFO PFX "initialized: timeout=%d sec (nowayout=%d)\n",
-              timeout, nowayout);
-
        return 0;
 }
 
 /**
  *     bfin_wdt_exit - Deinitialize module
  *
- *     Unregisters the device and notifier handler. Actual device
- *     deinitialization is handled by bfin_wdt_close().
+ *     Back out the platform device & driver steps.  Real work is in the
+ *     platform remove function.
  */
 static void __exit bfin_wdt_exit(void)
 {
-       misc_deregister(&bfin_wdt_miscdev);
-       unregister_reboot_notifier(&bfin_wdt_notifier);
+       platform_device_unregister(bfin_wdt_device);
+       platform_driver_unregister(&bfin_wdt_driver);
 }
 
 module_init(bfin_wdt_init);
index d362f5b..c1ba0db 100644 (file)
@@ -1,12 +1,10 @@
 /*
- * drivers/char/watchdog/booke_wdt.c
- *
  * Watchdog timer for PowerPC Book-E systems
  *
  * Author: Matthew McClintock
  * Maintainer: Kumar Gala <galak@kernel.crashing.org>
  *
- * Copyright 2005 Freescale Semiconductor Inc.
+ * Copyright 2005, 2008 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -16,6 +14,7 @@
 
 #include <linux/module.h>
 #include <linux/fs.h>
+#include <linux/smp.h>
 #include <linux/miscdevice.h>
 #include <linux/notifier.h>
 #include <linux/watchdog.h>
@@ -38,7 +37,7 @@
 #define WDT_PERIOD_DEFAULT 3   /* Refer to the PPC40x and PPC4xx manuals */
 #endif                         /* for timing information */
 
-u32 booke_wdt_enabled = 0;
+u32 booke_wdt_enabled;
 u32 booke_wdt_period = WDT_PERIOD_DEFAULT;
 
 #ifdef CONFIG_FSL_BOOKE
@@ -47,33 +46,31 @@ u32 booke_wdt_period = WDT_PERIOD_DEFAULT;
 #define WDTP(x)                (TCR_WP(x))
 #endif
 
-/*
- * booke_wdt_ping:
- */
-static __inline__ void booke_wdt_ping(void)
+static DEFINE_SPINLOCK(booke_wdt_lock);
+
+static void __booke_wdt_ping(void *data)
 {
        mtspr(SPRN_TSR, TSR_ENW|TSR_WIS);
 }
 
-/*
- * booke_wdt_enable:
- */
-static __inline__ void booke_wdt_enable(void)
+static void booke_wdt_ping(void)
+{
+       on_each_cpu(__booke_wdt_ping, NULL, 0, 0);
+}
+
+static void __booke_wdt_enable(void *data)
 {
        u32 val;
 
        /* clear status before enabling watchdog */
-       booke_wdt_ping();
+       __booke_wdt_ping(NULL);
        val = mfspr(SPRN_TCR);
        val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period));
 
        mtspr(SPRN_TCR, val);
 }
 
-/*
- * booke_wdt_write:
- */
-static ssize_t booke_wdt_write (struct file *file, const char __user *buf,
+static ssize_t booke_wdt_write(struct file *file, const char __user *buf,
                                size_t count, loff_t *ppos)
 {
        booke_wdt_ping();
@@ -81,15 +78,11 @@ static ssize_t booke_wdt_write (struct file *file, const char __user *buf,
 }
 
 static struct watchdog_info ident = {
-  .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
-  .firmware_version = 0,
-  .identity = "PowerPC Book-E Watchdog",
+       .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+       .identity = "PowerPC Book-E Watchdog",
 };
 
-/*
- * booke_wdt_ioctl:
- */
-static int booke_wdt_ioctl (struct inode *inode, struct file *file,
+static int booke_wdt_ioctl(struct inode *inode, struct file *file,
                            unsigned int cmd, unsigned long arg)
 {
        u32 tmp = 0;
@@ -97,7 +90,7 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file,
 
        switch (cmd) {
        case WDIOC_GETSUPPORT:
-               if (copy_to_user ((struct watchdog_info __user *) arg, &ident,
+               if (copy_to_user((struct watchdog_info __user *)arg, &ident,
                                sizeof(struct watchdog_info)))
                        return -EFAULT;
        case WDIOC_GETSTATUS:
@@ -132,33 +125,33 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file,
 
        return 0;
 }
-/*
- * booke_wdt_open:
- */
-static int booke_wdt_open (struct inode *inode, struct file *file)
+
+static int booke_wdt_open(struct inode *inode, struct file *file)
 {
+       spin_lock(&booke_wdt_lock);
        if (booke_wdt_enabled == 0) {
                booke_wdt_enabled = 1;
-               booke_wdt_enable();
-               printk (KERN_INFO "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n",
-                               booke_wdt_period);
+               on_each_cpu(__booke_wdt_enable, NULL, 0, 0);
+               printk(KERN_INFO "PowerPC Book-E Watchdog Timer Enabled "
+                               "(wdt_period=%d)\n", booke_wdt_period);
        }
+       spin_unlock(&booke_wdt_lock);
 
        return nonseekable_open(inode, file);
 }
 
 static const struct file_operations booke_wdt_fops = {
-  .owner = THIS_MODULE,
-  .llseek = no_llseek,
-  .write = booke_wdt_write,
-  .ioctl = booke_wdt_ioctl,
-  .open = booke_wdt_open,
+       .owner = THIS_MODULE,
+       .llseek = no_llseek,
+       .write = booke_wdt_write,
+       .ioctl = booke_wdt_ioctl,
+       .open = booke_wdt_open,
 };
 
 static struct miscdevice booke_wdt_miscdev = {
-  .minor = WATCHDOG_MINOR,
-  .name = "watchdog",
-  .fops = &booke_wdt_fops,
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &booke_wdt_fops,
 };
 
 static void __exit booke_wdt_exit(void)
@@ -166,28 +159,27 @@ static void __exit booke_wdt_exit(void)
        misc_deregister(&booke_wdt_miscdev);
 }
 
-/*
- * booke_wdt_init:
- */
 static int __init booke_wdt_init(void)
 {
        int ret = 0;
 
-       printk (KERN_INFO "PowerPC Book-E Watchdog Timer Loaded\n");
+       printk(KERN_INFO "PowerPC Book-E Watchdog Timer Loaded\n");
        ident.firmware_version = cur_cpu_spec->pvr_value;
 
        ret = misc_register(&booke_wdt_miscdev);
        if (ret) {
-               printk (KERN_CRIT "Cannot register miscdev on minor=%d (err=%d)\n",
+               printk(KERN_CRIT "Cannot register miscdev on minor=%d: %d\n",
                                WATCHDOG_MINOR, ret);
                return ret;
        }
 
+       spin_lock(&booke_wdt_lock);
        if (booke_wdt_enabled == 1) {
-               printk (KERN_INFO "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n",
-                               booke_wdt_period);
-               booke_wdt_enable();
+               printk(KERN_INFO "PowerPC Book-E Watchdog Timer Enabled "
+                               "(wdt_period=%d)\n", booke_wdt_period);
+               on_each_cpu(__booke_wdt_enable, NULL, 0, 0);
        }
+       spin_unlock(&booke_wdt_lock);
 
        return ret;
 }
diff --git a/drivers/watchdog/geodewdt.c b/drivers/watchdog/geodewdt.c
new file mode 100644 (file)
index 0000000..f85b196
--- /dev/null
@@ -0,0 +1,309 @@
+/* Watchdog timer for the Geode GX/LX with the CS5535/CS5536 companion chip
+ *
+ * Copyright (C) 2006-2007, Advanced Micro Devices, 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.
+ */
+
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/platform_device.h>
+#include <linux/reboot.h>
+
+#include <asm/uaccess.h>
+#include <asm/geode.h>
+
+#define GEODEWDT_HZ 500
+#define GEODEWDT_SCALE 6
+#define GEODEWDT_MAX_SECONDS 131
+
+#define WDT_FLAGS_OPEN 1
+#define WDT_FLAGS_ORPHAN 2
+
+#define DRV_NAME "geodewdt"
+#define WATCHDOG_NAME "Geode GX/LX WDT"
+#define WATCHDOG_TIMEOUT 60
+
+static int timeout = WATCHDOG_TIMEOUT;
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=131, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+static struct platform_device *geodewdt_platform_device;
+static unsigned long wdt_flags;
+static int wdt_timer;
+static int safe_close;
+
+static void geodewdt_ping(void)
+{
+       /* Stop the counter */
+       geode_mfgpt_write(wdt_timer, MFGPT_REG_SETUP, 0);
+
+       /* Reset the counter */
+       geode_mfgpt_write(wdt_timer, MFGPT_REG_COUNTER, 0);
+
+       /* Enable the counter */
+       geode_mfgpt_write(wdt_timer, MFGPT_REG_SETUP, MFGPT_SETUP_CNTEN);
+}
+
+static void geodewdt_disable(void)
+{
+       geode_mfgpt_write(wdt_timer, MFGPT_REG_SETUP, 0);
+       geode_mfgpt_write(wdt_timer, MFGPT_REG_COUNTER, 0);
+}
+
+static int geodewdt_set_heartbeat(int val)
+{
+       if (val < 1 || val > GEODEWDT_MAX_SECONDS)
+               return -EINVAL;
+
+       geode_mfgpt_write(wdt_timer, MFGPT_REG_SETUP, 0);
+       geode_mfgpt_write(wdt_timer, MFGPT_REG_CMP2, val * GEODEWDT_HZ);
+       geode_mfgpt_write(wdt_timer, MFGPT_REG_COUNTER, 0);
+       geode_mfgpt_write(wdt_timer, MFGPT_REG_SETUP, MFGPT_SETUP_CNTEN);
+
+       timeout = val;
+       return 0;
+}
+
+static int
+geodewdt_open(struct inode *inode, struct file *file)
+{
+        if (test_and_set_bit(WDT_FLAGS_OPEN, &wdt_flags))
+                return -EBUSY;
+
+        if (!test_and_clear_bit(WDT_FLAGS_ORPHAN, &wdt_flags))
+                __module_get(THIS_MODULE);
+
+       geodewdt_ping();
+        return nonseekable_open(inode, file);
+}
+
+static int
+geodewdt_release(struct inode *inode, struct file *file)
+{
+       if (safe_close) {
+               geodewdt_disable();
+               module_put(THIS_MODULE);
+       }
+       else {
+               printk(KERN_CRIT "Unexpected close - watchdog is not stopping.\n");
+               geodewdt_ping();
+
+               set_bit(WDT_FLAGS_ORPHAN, &wdt_flags);
+       }
+
+       clear_bit(WDT_FLAGS_OPEN, &wdt_flags);
+       safe_close = 0;
+       return 0;
+}
+
+static ssize_t
+geodewdt_write(struct file *file, const char __user *data, size_t len,
+              loff_t *ppos)
+{
+        if(len) {
+               if (!nowayout) {
+                       size_t i;
+                       safe_close = 0;
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+
+                               if (get_user(c, data + i))
+                                       return -EFAULT;
+
+                               if (c == 'V')
+                                       safe_close = 1;
+                       }
+               }
+
+               geodewdt_ping();
+       }
+       return len;
+}
+
+static int
+geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+              unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       int interval;
+
+       static struct watchdog_info ident = {
+               .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING
+               | WDIOF_MAGICCLOSE,
+               .firmware_version =     1,
+               .identity =             WATCHDOG_NAME,
+        };
+
+       switch(cmd) {
+       case WDIOC_GETSUPPORT:
+               return copy_to_user(argp, &ident,
+                                   sizeof(ident)) ? -EFAULT : 0;
+               break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
+
+       case WDIOC_KEEPALIVE:
+               geodewdt_ping();
+               return 0;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(interval, p))
+                       return -EFAULT;
+
+               if (geodewdt_set_heartbeat(interval))
+                       return -EINVAL;
+
+/* Fall through */
+
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, p);
+
+       case WDIOC_SETOPTIONS:
+       {
+               int options, ret = -EINVAL;
+
+               if (get_user(options, p))
+                       return -EFAULT;
+
+               if (options & WDIOS_DISABLECARD) {
+                       geodewdt_disable();
+                       ret = 0;
+               }
+
+               if (options & WDIOS_ENABLECARD) {
+                       geodewdt_ping();
+                       ret = 0;
+               }
+
+               return ret;
+       }
+       default:
+               return -ENOTTY;
+       }
+
+       return 0;
+}
+
+static const struct file_operations geodewdt_fops = {
+        .owner          = THIS_MODULE,
+        .llseek         = no_llseek,
+        .write          = geodewdt_write,
+        .ioctl          = geodewdt_ioctl,
+        .open           = geodewdt_open,
+        .release        = geodewdt_release,
+};
+
+static struct miscdevice geodewdt_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &geodewdt_fops
+};
+
+static int __devinit
+geodewdt_probe(struct platform_device *dev)
+{
+       int ret, timer;
+
+       timer = geode_mfgpt_alloc_timer(MFGPT_TIMER_ANY,
+                                       MFGPT_DOMAIN_WORKING, THIS_MODULE);
+
+       if (timer == -1) {
+               printk(KERN_ERR "geodewdt:  No timers were available\n");
+               return -ENODEV;
+       }
+
+       wdt_timer = timer;
+
+       /* Set up the timer */
+
+       geode_mfgpt_write(wdt_timer, MFGPT_REG_SETUP,
+                         GEODEWDT_SCALE | (3 << 8));
+
+       /* Set up comparator 2 to reset when the event fires */
+       geode_mfgpt_toggle_event(wdt_timer, MFGPT_CMP2, MFGPT_EVENT_RESET, 1);
+
+       /* Set up the initial timeout */
+
+       geode_mfgpt_write(wdt_timer, MFGPT_REG_CMP2,
+               timeout * GEODEWDT_HZ);
+
+       ret = misc_register(&geodewdt_miscdev);
+
+       return ret;
+}
+
+static int __devexit
+geodewdt_remove(struct platform_device *dev)
+{
+       misc_deregister(&geodewdt_miscdev);
+       return 0;
+}
+
+static void
+geodewdt_shutdown(struct platform_device *dev)
+{
+       geodewdt_disable();
+}
+
+static struct platform_driver geodewdt_driver = {
+       .probe          = geodewdt_probe,
+       .remove         = __devexit_p(geodewdt_remove),
+       .shutdown       = geodewdt_shutdown,
+       .driver         = {
+               .owner  = THIS_MODULE,
+               .name   = DRV_NAME,
+       },
+};
+
+static int __init
+geodewdt_init(void)
+{
+       int ret;
+
+       ret = platform_driver_register(&geodewdt_driver);
+       if (ret)
+               return ret;
+
+       geodewdt_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0);
+       if (IS_ERR(geodewdt_platform_device)) {
+               ret = PTR_ERR(geodewdt_platform_device);
+               goto err;
+       }
+
+       return 0;
+err:
+       platform_driver_unregister(&geodewdt_driver);
+       return ret;
+}
+
+static void __exit
+geodewdt_exit(void)
+{
+       platform_device_unregister(geodewdt_platform_device);
+       platform_driver_unregister(&geodewdt_driver);
+}
+
+module_init(geodewdt_init);
+module_exit(geodewdt_exit);
+
+MODULE_AUTHOR("Advanced Micro Devices, Inc");
+MODULE_DESCRIPTION("Geode GX/LX Watchdog Driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
index 6483d10..6a63535 100644 (file)
@@ -418,23 +418,20 @@ static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason,
        static unsigned long rom_pl;
        static int die_nmi_called;
 
-       if (ulReason != DIE_NMI && ulReason != DIE_NMI_IPI)
-               return NOTIFY_OK;
-
-       spin_lock_irqsave(&rom_lock, rom_pl);
-       if (!die_nmi_called)
-               asminline_call(&cmn_regs, cru_rom_addr);
-       die_nmi_called = 1;
-       spin_unlock_irqrestore(&rom_lock, rom_pl);
-       if (cmn_regs.u1.ral == 0) {
-               printk(KERN_WARNING "hpwdt: An NMI occurred, "
-                      "but unable to determine source.\n");
-       } else {
-               panic("An NMI occurred, please see the Integrated "
-                       "Management Log for details.\n");
+       if (ulReason == DIE_NMI || ulReason == DIE_NMI_IPI) {
+               spin_lock_irqsave(&rom_lock, rom_pl);
+               if (!die_nmi_called)
+                       asminline_call(&cmn_regs, cru_rom_addr);
+               die_nmi_called = 1;
+               spin_unlock_irqrestore(&rom_lock, rom_pl);
+               if (cmn_regs.u1.ral != 0) {
+                       panic("An NMI occurred, please see the Integrated "
+                             "Management Log for details.\n");
+               }
        }
 
-       return NOTIFY_STOP;
+       die_nmi_called = 0;
+       return NOTIFY_DONE;
 }
 
 /*
index a0e6809..95ba985 100644 (file)
  *     82801HH  (ICH8DH)    : document number 313056-003, 313057-009,
  *     82801HO  (ICH8DO)    : document number 313056-003, 313057-009,
  *     82801HEM (ICH8M-E)   : document number 313056-003, 313057-009,
- *     82801IB  (ICH9)      : document number 316972-001, 316973-001,
- *     82801IR  (ICH9R)     : document number 316972-001, 316973-001,
- *     82801IH  (ICH9DH)    : document number 316972-001, 316973-001,
+ *     82801IB  (ICH9)      : document number 316972-001, 316973-006,
+ *     82801IR  (ICH9R)     : document number 316972-001, 316973-006,
+ *     82801IH  (ICH9DH)    : document number 316972-001, 316973-006,
+ *     82801IO  (ICH9DO)    : document number 316972-001, 316973-006,
  *     6300ESB  (6300ESB)   : document number 300641-003, 300884-010,
  *     631xESB  (631xESB)   : document number 313082-001, 313075-005,
  *     632xESB  (632xESB)   : document number 313082-001, 313075-005
@@ -55,8 +56,8 @@
 
 /* Module and version information */
 #define DRV_NAME        "iTCO_wdt"
-#define DRV_VERSION     "1.02"
-#define DRV_RELDATE     "26-Jul-2007"
+#define DRV_VERSION     "1.03"
+#define DRV_RELDATE     "30-Apr-2008"
 #define PFX            DRV_NAME ": "
 
 /* Includes */
@@ -104,6 +105,7 @@ enum iTCO_chipsets {
        TCO_ICH9,       /* ICH9 */
        TCO_ICH9R,      /* ICH9R */
        TCO_ICH9DH,     /* ICH9DH */
+       TCO_ICH9DO,     /* ICH9DO */
        TCO_631XESB,    /* 631xESB/632xESB */
 };
 
@@ -136,6 +138,7 @@ static struct {
        {"ICH9", 2},
        {"ICH9R", 2},
        {"ICH9DH", 2},
+       {"ICH9DO", 2},
        {"631xESB/632xESB", 2},
        {NULL,0}
 };
@@ -181,6 +184,7 @@ static struct pci_device_id iTCO_wdt_pci_tbl[] = {
        { ITCO_PCI_DEVICE(0x2918,                               TCO_ICH9   )},
        { ITCO_PCI_DEVICE(0x2916,                               TCO_ICH9R  )},
        { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH9_2,           TCO_ICH9DH )},
+       { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH9_4,           TCO_ICH9DO )},
        { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ESB2_0,           TCO_631XESB)},
        { ITCO_PCI_DEVICE(0x2671,                               TCO_631XESB)},
        { ITCO_PCI_DEVICE(0x2672,                               TCO_631XESB)},
index c622a0e..528b882 100644 (file)
@@ -44,6 +44,7 @@
 #define WATCHDOG_NAME "w83697hf/hg WDT"
 #define PFX WATCHDOG_NAME ": "
 #define WATCHDOG_TIMEOUT 60            /* 60 sec default timeout */
+#define WATCHDOG_EARLY_DISABLE 1       /* Disable until userland kicks in */
 
 static unsigned long wdt_is_open;
 static char expect_close;
@@ -56,12 +57,16 @@ MODULE_PARM_DESC(wdt_io, "w83697hf/hg WDT io port (default 0x2e, 0 = autodetect)
 
 static int timeout = WATCHDOG_TIMEOUT; /* in seconds */
 module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255 (default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
 
 static int nowayout = WATCHDOG_NOWAYOUT;
 module_param(nowayout, int, 0);
 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 
+static int early_disable = WATCHDOG_EARLY_DISABLE;
+module_param(early_disable, int, 0);
+MODULE_PARM_DESC(early_disable, "Watchdog gets disabled at boot time (default=" __MODULE_STRING(WATCHDOG_EARLY_DISABLE) ")");
+
 /*
  *     Kernel methods.
  */
@@ -140,7 +145,7 @@ w83697hf_init(void)
        w83697hf_deselect_wdt();
 }
 
-static int
+static void
 wdt_ping(void)
 {
        spin_lock(&io_lock);
@@ -150,10 +155,9 @@ wdt_ping(void)
 
        w83697hf_deselect_wdt();
        spin_unlock(&io_lock);
-       return 0;
 }
 
-static int
+static void
 wdt_enable(void)
 {
        spin_lock(&io_lock);
@@ -164,10 +168,9 @@ wdt_enable(void)
 
        w83697hf_deselect_wdt();
        spin_unlock(&io_lock);
-       return 0;
 }
 
-static int
+static void
 wdt_disable(void)
 {
        spin_lock(&io_lock);
@@ -178,7 +181,22 @@ wdt_disable(void)
 
        w83697hf_deselect_wdt();
        spin_unlock(&io_lock);
-       return 0;
+}
+
+static unsigned char
+wdt_running(void)
+{
+       unsigned char t;
+
+       spin_lock(&io_lock);
+       w83697hf_select_wdt();
+
+       t = w83697hf_get_reg(0xF4);     /* Read timer */
+
+       w83697hf_deselect_wdt();
+       spin_unlock(&io_lock);
+
+       return t;
 }
 
 static int
@@ -397,7 +415,11 @@ wdt_init(void)
        }
 
        w83697hf_init();
-       wdt_disable();  /* Disable watchdog until first use */
+       if (early_disable) {
+               if (wdt_running())
+                       printk (KERN_WARNING PFX "Stopping previously enabled watchdog until userland kicks in\n");
+               wdt_disable();
+       }
 
        if (wdt_set_heartbeat(timeout)) {
                wdt_set_heartbeat(WATCHDOG_TIMEOUT);
index 8848e4d..9c136d7 100644 (file)
@@ -36,6 +36,7 @@ Miklos Szeredi
 Kazeon team for various fixes especially for 2.4 version.
 Asser Ferno (Change Notify support)
 Shaggy (Dave Kleikamp) for inumerable small fs suggestions and some good cleanup
+Igor Mammedov (DFS support)
 
 Test case and Bug Report contributors
 -------------------------------------
index 8355e91..28e3d5c 100644 (file)
@@ -1,5 +1,7 @@
 Version 1.53
 ------------
+DFS support added (Microsoft Distributed File System client support needed
+for referrals which enable a hierarchical name space among servers).
 
 Version 1.52
 ------------
@@ -12,7 +14,8 @@ Add ability to modify cifs acls for handling chmod (when mounted with
 cifsacl flag). Fix prefixpath path separator so we can handle mounts
 with prefixpaths longer than one directory (one path component) when
 mounted to Windows servers.  Fix slow file open when cifsacl
-enabled.
+enabled. Fix memory leak in FindNext when the SMB call returns -EBADF.
+
 
 Version 1.51
 ------------
index 621aa1a..2bd6fe5 100644 (file)
@@ -483,6 +483,11 @@ A partial list of the supported mount options follows:
  sign           Must use packet signing (helps avoid unwanted data modification
                by intermediate systems in the route).  Note that signing
                does not work with lanman or plaintext authentication.
+ seal           Must seal (encrypt) all data on this mounted share before
+               sending on the network.  Requires support for Unix Extensions.
+               Note that this differs from the sign mount option in that it
+               causes encryption of data sent over this mounted share but other
+               shares mounted to the same server are unaffected.
  sec            Security mode.  Allowed values are:
                        none    attempt to connection as a null user (no name)
                        krb5    Use Kerberos version 5 authentication
index 92c9fea..5aff46c 100644 (file)
@@ -1,4 +1,4 @@
-Version 1.52 January 3, 2008
+Version 1.53 May 20, 2008
 
 A Partial List of Missing Features
 ==================================
@@ -20,20 +20,21 @@ d) Cleanup now unneeded SessSetup code in
 fs/cifs/connect.c and add back in NTLMSSP code if any servers
 need it
 
-e) ms-dfs and ms-dfs host name resolution cleanup
-
-f) fix NTLMv2 signing when two mounts with different users to same
+e) fix NTLMv2 signing when two mounts with different users to same
 server.
 
-g) Directory entry caching relies on a 1 second timer, rather than 
+f) Directory entry caching relies on a 1 second timer, rather than 
 using FindNotify or equivalent.  - (started)
 
-h) quota support (needs minor kernel change since quota calls
+g) quota support (needs minor kernel change since quota calls
 to make it to network filesystems or deviceless filesystems)
 
-i) investigate sync behavior (including syncpage) and check  
+h) investigate sync behavior (including syncpage) and check  
 for proper behavior of intr/nointr
 
+i) improve support for very old servers (OS/2 and Win9x for example)
+Including support for changing the time remotely (utimes command).
+
 j) hook lower into the sockets api (as NFS/SunRPC does) to avoid the
 extra copy in/out of the socket buffers in some cases.
 
index f6fdecf..d82374c 100644 (file)
@@ -219,53 +219,6 @@ static struct vfsmount *cifs_dfs_do_refmount(const struct vfsmount *mnt_parent,
 
 }
 
-static char *build_full_dfs_path_from_dentry(struct dentry *dentry)
-{
-       char *full_path = NULL;
-       char *search_path;
-       char *tmp_path;
-       size_t l_max_len;
-       struct cifs_sb_info *cifs_sb;
-
-       if (dentry->d_inode == NULL)
-               return NULL;
-
-       cifs_sb = CIFS_SB(dentry->d_inode->i_sb);
-
-       if (cifs_sb->tcon == NULL)
-               return NULL;
-
-       search_path = build_path_from_dentry(dentry);
-       if (search_path == NULL)
-               return NULL;
-
-       if (cifs_sb->tcon->Flags & SMB_SHARE_IS_IN_DFS) {
-               int i;
-               /* we should use full path name for correct working with DFS */
-               l_max_len = strnlen(cifs_sb->tcon->treeName, MAX_TREE_SIZE+1) +
-                                       strnlen(search_path, MAX_PATHCONF) + 1;
-               tmp_path = kmalloc(l_max_len, GFP_KERNEL);
-               if (tmp_path == NULL) {
-                       kfree(search_path);
-                       return NULL;
-               }
-               strncpy(tmp_path, cifs_sb->tcon->treeName, l_max_len);
-               tmp_path[l_max_len-1] = 0;
-               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
-                       for (i = 0; i < l_max_len; i++) {
-                               if (tmp_path[i] == '\\')
-                                       tmp_path[i] = '/';
-                       }
-               strncat(tmp_path, search_path, l_max_len - strlen(tmp_path));
-
-               full_path = tmp_path;
-               kfree(search_path);
-       } else {
-               full_path = search_path;
-       }
-       return full_path;
-}
-
 static int add_mount_helper(struct vfsmount *newmnt, struct nameidata *nd,
                                struct list_head *mntlist)
 {
@@ -333,7 +286,7 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
                goto out_err;
        }
 
-       full_path = build_full_dfs_path_from_dentry(dentry);
+       full_path = build_path_from_dentry(dentry);
        if (full_path == NULL) {
                rc = -ENOMEM;
                goto out_err;
index 8ad2330..877c854 100644 (file)
@@ -30,6 +30,7 @@
 #define CIFS_MOUNT_CIFS_ACL     0x200 /* send ACL requests to non-POSIX srv   */
 #define CIFS_MOUNT_OVERR_UID    0x400 /* override uid returned from server    */
 #define CIFS_MOUNT_OVERR_GID    0x800 /* override gid returned from server    */
+#define CIFS_MOUNT_DYNPERM     0x1000 /* allow in-memory only mode setting */
 
 struct cifs_sb_info {
        struct cifsTconInfo *tcon;      /* primary mount */
index 6653e29..7013aaf 100644 (file)
@@ -119,6 +119,9 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
        dp = description + strlen(description);
        sprintf(dp, ";uid=0x%x", sesInfo->linux_uid);
 
+       dp = description + strlen(description);
+       sprintf(dp, ";user=%s", sesInfo->userName);
+
        cFYI(1, ("key description = %s", description));
        spnego_key = request_key(&cifs_spnego_key_type, description, "");
 
index 427a7c6..5df93fd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *   fs/cifs/cifsfs.c
  *
- *   Copyright (C) International Business Machines  Corp., 2002,2007
+ *   Copyright (C) International Business Machines  Corp., 2002,2008
  *   Author(s): Steve French (sfrench@us.ibm.com)
  *
  *   Common Internet FileSystem (CIFS) client
@@ -353,9 +353,41 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m)
                        if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) ||
                           !(cifs_sb->tcon->unix_ext))
                                seq_printf(s, ",gid=%d", cifs_sb->mnt_gid);
+                       if (!cifs_sb->tcon->unix_ext) {
+                               seq_printf(s, ",file_mode=0%o,dir_mode=0%o",
+                                          cifs_sb->mnt_file_mode,
+                                          cifs_sb->mnt_dir_mode);
+                       }
+                       if (cifs_sb->tcon->seal)
+                               seq_printf(s, ",seal");
+                       if (cifs_sb->tcon->nocase)
+                               seq_printf(s, ",nocase");
+                       if (cifs_sb->tcon->retry)
+                               seq_printf(s, ",hard");
                }
                if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
                        seq_printf(s, ",posixpaths");
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID)
+                       seq_printf(s, ",setuids");
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)
+                       seq_printf(s, ",serverino");
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO)
+                       seq_printf(s, ",directio");
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
+                       seq_printf(s, ",nouser_xattr");
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR)
+                       seq_printf(s, ",mapchars");
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
+                       seq_printf(s, ",sfu");
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
+                       seq_printf(s, ",nobrl");
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)
+                       seq_printf(s, ",cifsacl");
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)
+                       seq_printf(s, ",dynperm");
+               if (m->mnt_sb->s_flags & MS_POSIXACL)
+                       seq_printf(s, ",acl");
+
                seq_printf(s, ",rsize=%d", cifs_sb->rsize);
                seq_printf(s, ",wsize=%d", cifs_sb->wsize);
        }
@@ -657,7 +689,7 @@ const struct file_operations cifs_file_ops = {
        .splice_read = generic_file_splice_read,
        .llseek = cifs_llseek,
 #ifdef CONFIG_CIFS_POSIX
-       .ioctl  = cifs_ioctl,
+       .unlocked_ioctl = cifs_ioctl,
 #endif /* CONFIG_CIFS_POSIX */
 
 #ifdef CONFIG_CIFS_EXPERIMENTAL
@@ -677,7 +709,7 @@ const struct file_operations cifs_file_direct_ops = {
        .flush = cifs_flush,
        .splice_read = generic_file_splice_read,
 #ifdef CONFIG_CIFS_POSIX
-       .ioctl  = cifs_ioctl,
+       .unlocked_ioctl  = cifs_ioctl,
 #endif /* CONFIG_CIFS_POSIX */
        .llseek = cifs_llseek,
 #ifdef CONFIG_CIFS_EXPERIMENTAL
@@ -697,7 +729,7 @@ const struct file_operations cifs_file_nobrl_ops = {
        .splice_read = generic_file_splice_read,
        .llseek = cifs_llseek,
 #ifdef CONFIG_CIFS_POSIX
-       .ioctl  = cifs_ioctl,
+       .unlocked_ioctl = cifs_ioctl,
 #endif /* CONFIG_CIFS_POSIX */
 
 #ifdef CONFIG_CIFS_EXPERIMENTAL
@@ -716,7 +748,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
        .flush = cifs_flush,
        .splice_read = generic_file_splice_read,
 #ifdef CONFIG_CIFS_POSIX
-       .ioctl  = cifs_ioctl,
+       .unlocked_ioctl  = cifs_ioctl,
 #endif /* CONFIG_CIFS_POSIX */
        .llseek = cifs_llseek,
 #ifdef CONFIG_CIFS_EXPERIMENTAL
@@ -731,7 +763,7 @@ const struct file_operations cifs_dir_ops = {
 #ifdef CONFIG_CIFS_EXPERIMENTAL
        .dir_notify = cifs_dir_notify,
 #endif /* CONFIG_CIFS_EXPERIMENTAL */
-       .ioctl  = cifs_ioctl,
+       .unlocked_ioctl  = cifs_ioctl,
 };
 
 static void
index cd1301a..25a6cbd 100644 (file)
@@ -95,8 +95,7 @@ extern int    cifs_setxattr(struct dentry *, const char *, const void *,
                        size_t, int);
 extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t);
 extern ssize_t cifs_listxattr(struct dentry *, char *, size_t);
-extern int cifs_ioctl(struct inode *inode, struct file *filep,
-                      unsigned int command, unsigned long arg);
+extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
 
 #ifdef CONFIG_CIFS_EXPERIMENTAL
 extern const struct export_operations cifs_export_ops;
index b7d9f69..0891405 100644 (file)
@@ -281,6 +281,7 @@ struct cifsTconInfo {
        bool ipc:1;             /* set if connection to IPC$ eg for RPC/PIPES */
        bool retry:1;
        bool nocase:1;
+       bool seal:1;      /* transport encryption for this mounted share */
        bool unix_ext:1;  /* if false disable Linux extensions to CIFS protocol
                                for this mount even if server would support */
        /* BB add field for back pointer to sb struct(s)? */
index c43bf4b..65d58b4 100644 (file)
@@ -1904,19 +1904,26 @@ typedef struct smb_com_transaction2_get_dfs_refer_req {
        char RequestFileName[1];
 } __attribute__((packed)) TRANSACTION2_GET_DFS_REFER_REQ;
 
+#define DFS_VERSION cpu_to_le16(0x0003)
+
+/* DFS server target type */
+#define DFS_TYPE_LINK 0x0000  /* also for sysvol targets */
+#define DFS_TYPE_ROOT 0x0001
+/* Referral Entry Flags */
+#define DFS_NAME_LIST_REF 0x0200
+
 typedef struct dfs_referral_level_3 {
        __le16 VersionNumber;
-       __le16 ReferralSize;
-       __le16 ServerType;      /* 0x0001 = CIFS server */
-       __le16 ReferralFlags;   /* or proximity - not clear which since it is
-                                  always set to zero - SNIA spec says 0x01
-                                  means strip off PathConsumed chars before
-                                  submitting RequestFileName to remote node */
-       __le16 TimeToLive;
-       __le16 Proximity;
+       __le16 Size;
+       __le16 ServerType; /* 0x0001 = root targets; 0x0000 = link targets */
+       __le16 ReferralEntryFlags; /* 0x0200 bit set only for domain
+                                     or DC referral responce */
+       __le32 TimeToLive;
        __le16 DfsPathOffset;
        __le16 DfsAlternatePathOffset;
-       __le16 NetworkAddressOffset;
+       __le16 NetworkAddressOffset; /* offset of the link target */
+       __le16 ServiceSiteGuid;
 } __attribute__((packed)) REFERRAL3;
 
 typedef struct smb_com_transaction_get_dfs_refer_rsp {
index d481f6c..b9f5e93 100644 (file)
@@ -93,7 +93,7 @@ extern struct timespec cnvrtDosUnixTm(__u16 date, __u16 time);
 
 extern int cifs_get_inode_info(struct inode **pinode,
                        const unsigned char *search_path,
-                       FILE_ALL_INFO * pfile_info,
+                       FILE_ALL_INFO *pfile_info,
                        struct super_block *sb, int xid, const __u16 *pfid);
 extern int cifs_get_inode_info_unix(struct inode **pinode,
                        const unsigned char *search_path,
@@ -130,7 +130,7 @@ extern int CIFSFindClose(const int, struct cifsTconInfo *tcon,
 
 extern int CIFSSMBQPathInfo(const int xid, struct cifsTconInfo *tcon,
                        const unsigned char *searchName,
-                       FILE_ALL_INFO * findData,
+                       FILE_ALL_INFO *findData,
                        int legacy /* whether to use old info level */,
                        const struct nls_table *nls_codepage, int remap);
 extern int SMBQueryInformation(const int xid, struct cifsTconInfo *tcon,
@@ -141,18 +141,15 @@ extern int SMBQueryInformation(const int xid, struct cifsTconInfo *tcon,
 extern int CIFSSMBUnixQPathInfo(const int xid,
                        struct cifsTconInfo *tcon,
                        const unsigned char *searchName,
-                       FILE_UNIX_BASIC_INFO * pFindData,
+                       FILE_UNIX_BASIC_INFO *pFindData,
                        const struct nls_table *nls_codepage, int remap);
 
 extern int CIFSGetDFSRefer(const int xid, struct cifsSesInfo *ses,
                        const unsigned char *searchName,
-                       unsigned char **targetUNCs,
-                       unsigned int *number_of_UNC_in_array,
+                       struct dfs_info3_param **target_nodes,
+                       unsigned int *number_of_nodes_in_array,
                        const struct nls_table *nls_codepage, int remap);
 
-extern int connect_to_dfs_path(int xid, struct cifsSesInfo *pSesInfo,
-                       const char *old_path,
-                       const struct nls_table *nls_codepage, int remap);
 extern int get_dfs_path(int xid, struct cifsSesInfo *pSesInfo,
                        const char *old_path,
                        const struct nls_table *nls_codepage,
index 95fbba4..9b8b4cf 100644 (file)
@@ -81,6 +81,40 @@ static struct {
 #endif /* CONFIG_CIFS_WEAK_PW_HASH */
 #endif /* CIFS_POSIX */
 
+/* Allocates buffer into dst and copies smb string from src to it.
+ * caller is responsible for freeing dst if function returned 0.
+ * returns:
+ *     on success - 0
+ *     on failure - errno
+ */
+static int
+cifs_strncpy_to_host(char **dst, const char *src, const int maxlen,
+                const bool is_unicode, const struct nls_table *nls_codepage)
+{
+       int plen;
+
+       if (is_unicode) {
+               plen = UniStrnlen((wchar_t *)src, maxlen);
+               *dst = kmalloc(plen + 2, GFP_KERNEL);
+               if (!*dst)
+                       goto cifs_strncpy_to_host_ErrExit;
+               cifs_strfromUCS_le(*dst, (__le16 *)src, plen, nls_codepage);
+       } else {
+               plen = strnlen(src, maxlen);
+               *dst = kmalloc(plen + 2, GFP_KERNEL);
+               if (!*dst)
+                       goto cifs_strncpy_to_host_ErrExit;
+               strncpy(*dst, src, plen);
+       }
+       (*dst)[plen] = 0;
+       (*dst)[plen+1] = 0; /* harmless for ASCII case, needed for Unicode */
+       return 0;
+
+cifs_strncpy_to_host_ErrExit:
+       cERROR(1, ("Failed to allocate buffer for string\n"));
+       return -ENOMEM;
+}
+
 
 /* Mark as invalid, all open files on tree connections since they
    were closed when session to server was lost */
@@ -1166,6 +1200,20 @@ static __u16 convert_disposition(int disposition)
        return ofun;
 }
 
+static int
+access_flags_to_smbopen_mode(const int access_flags)
+{
+       int masked_flags = access_flags & (GENERIC_READ | GENERIC_WRITE);
+
+       if (masked_flags == GENERIC_READ)
+               return SMBOPEN_READ;
+       else if (masked_flags == GENERIC_WRITE)
+               return SMBOPEN_WRITE;
+
+       /* just go for read/write */
+       return SMBOPEN_READWRITE;
+}
+
 int
 SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon,
            const char *fileName, const int openDisposition,
@@ -1207,13 +1255,7 @@ OldOpenRetry:
                pSMB->OpenFlags = cpu_to_le16(REQ_BATCHOPLOCK);
 
        pSMB->OpenFlags |= cpu_to_le16(REQ_MORE_INFO);
-       /* BB fixme add conversion for access_flags to bits 0 - 2 of mode */
-       /* 0 = read
-          1 = write
-          2 = rw
-          3 = execute
-        */
-       pSMB->Mode = cpu_to_le16(2);
+       pSMB->Mode = cpu_to_le16(access_flags_to_smbopen_mode(access_flags));
        pSMB->Mode |= cpu_to_le16(0x40); /* deny none */
        /* set file as system file if special file such
           as fifo and server expecting SFU style and
@@ -1247,7 +1289,7 @@ OldOpenRetry:
        } else {
        /* BB verify if wct == 15 */
 
-/*             *pOplock = pSMBr->OplockLevel; */  /* BB take from action field BB */
+/*             *pOplock = pSMBr->OplockLevel; */ /* BB take from action field*/
 
                *netfid = pSMBr->Fid;   /* cifs fid stays in le */
                /* Let caller know file was created so we can set the mode. */
@@ -1767,7 +1809,7 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
        cFYI(1, ("Posix Lock"));
 
        if (pLockData == NULL)
-               return EINVAL;
+               return -EINVAL;
 
        rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
 
@@ -1944,7 +1986,7 @@ renameRetry:
        /* protocol requires ASCII signature byte on Unicode string */
                pSMB->OldFileName[name_len + 1] = 0x00;
                name_len2 =
-                   cifsConvertToUCS((__le16 *) &pSMB->OldFileName[name_len + 2],
+                   cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2],
                                     toName, PATH_MAX, nls_codepage, remap);
                name_len2 += 1 /* trailing null */  + 1 /* Signature word */ ;
                name_len2 *= 2; /* convert to bytes */
@@ -2117,8 +2159,7 @@ copyRetry:
                cFYI(1, ("Send error in copy = %d with %d files copied",
                        rc, le16_to_cpu(pSMBr->CopyCount)));
        }
-       if (pSMB)
-               cifs_buf_release(pSMB);
+       cifs_buf_release(pSMB);
 
        if (rc == -EAGAIN)
                goto copyRetry;
@@ -2207,8 +2248,7 @@ createSymLinkRetry:
        if (rc)
                cFYI(1, ("Send error in SetPathInfo create symlink = %d", rc));
 
-       if (pSMB)
-               cifs_buf_release(pSMB);
+       cifs_buf_release(pSMB);
 
        if (rc == -EAGAIN)
                goto createSymLinkRetry;
@@ -2925,7 +2965,8 @@ setAclRetry:
        }
        params = 6 + name_len;
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB size from sess */
+       /* BB find max SMB size from sess */
+       pSMB->MaxDataCount = cpu_to_le16(1000);
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;
@@ -3322,7 +3363,8 @@ QPathInfoRetry:
        params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */;
        pSMB->TotalDataCount = 0;
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(4000); /* BB find exact max SMB PDU from sess structure BB */
+       /* BB find exact max SMB PDU from sess structure BB */
+       pSMB->MaxDataCount = cpu_to_le16(4000);
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;
@@ -3388,7 +3430,7 @@ QPathInfoRetry:
 int
 CIFSSMBUnixQPathInfo(const int xid, struct cifsTconInfo *tcon,
                     const unsigned char *searchName,
-                    FILE_UNIX_BASIC_INFO * pFindData,
+                    FILE_UNIX_BASIC_INFO *pFindData,
                     const struct nls_table *nls_codepage, int remap)
 {
 /* SMB_QUERY_FILE_UNIX_BASIC */
@@ -3679,6 +3721,7 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon,
        if (rc) {
                if (rc == -EBADF) {
                        psrch_inf->endOfSearch = true;
+                       cifs_buf_release(pSMB);
                        rc = 0; /* search probably was closed at end of search*/
                } else
                        cFYI(1, ("FindNext returned = %d", rc));
@@ -3856,25 +3899,112 @@ GetInodeNumOut:
        return rc;
 }
 
+/* parses DFS refferal V3 structure
+ * caller is responsible for freeing target_nodes
+ * returns:
+ *     on success - 0
+ *     on failure - errno
+ */
+static int
+parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
+               unsigned int *num_of_nodes,
+               struct dfs_info3_param **target_nodes,
+               const struct nls_table *nls_codepage)
+{
+       int i, rc = 0;
+       char *data_end;
+       bool is_unicode;
+       struct dfs_referral_level_3 *ref;
+
+       is_unicode = pSMBr->hdr.Flags2 & SMBFLG2_UNICODE;
+       *num_of_nodes = le16_to_cpu(pSMBr->NumberOfReferrals);
+
+       if (*num_of_nodes < 1) {
+               cERROR(1, ("num_referrals: must be at least > 0,"
+                       "but we get num_referrals = %d\n", *num_of_nodes));
+               rc = -EINVAL;
+               goto parse_DFS_referrals_exit;
+       }
+
+       ref = (struct dfs_referral_level_3 *) &(pSMBr->referrals);
+       if (ref->VersionNumber != 3) {
+               cERROR(1, ("Referrals of V%d version are not supported,"
+                       "should be V3", ref->VersionNumber));
+               rc = -EINVAL;
+               goto parse_DFS_referrals_exit;
+       }
+
+       /* get the upper boundary of the resp buffer */
+       data_end = (char *)(&(pSMBr->PathConsumed)) +
+                               le16_to_cpu(pSMBr->t2.DataCount);
+
+       cFYI(1, ("num_referrals: %d dfs flags: 0x%x ... \n",
+                       *num_of_nodes,
+                       le16_to_cpu(pSMBr->DFSFlags)));
+
+       *target_nodes = kzalloc(sizeof(struct dfs_info3_param) *
+                       *num_of_nodes, GFP_KERNEL);
+       if (*target_nodes == NULL) {
+               cERROR(1, ("Failed to allocate buffer for target_nodes\n"));
+               rc = -ENOMEM;
+               goto parse_DFS_referrals_exit;
+       }
+
+       /* collect neccessary data from referrals */
+       for (i = 0; i < *num_of_nodes; i++) {
+               char *temp;
+               int max_len;
+               struct dfs_info3_param *node = (*target_nodes)+i;
+
+               node->flags = le16_to_cpu(pSMBr->DFSFlags);
+               node->path_consumed = le16_to_cpu(pSMBr->PathConsumed);
+               node->server_type = le16_to_cpu(ref->ServerType);
+               node->ref_flag = le16_to_cpu(ref->ReferralEntryFlags);
+
+               /* copy DfsPath */
+               temp = (char *)ref + le16_to_cpu(ref->DfsPathOffset);
+               max_len = data_end - temp;
+               rc = cifs_strncpy_to_host(&(node->path_name), temp,
+                                       max_len, is_unicode, nls_codepage);
+               if (rc)
+                       goto parse_DFS_referrals_exit;
+
+               /* copy link target UNC */
+               temp = (char *)ref + le16_to_cpu(ref->NetworkAddressOffset);
+               max_len = data_end - temp;
+               rc = cifs_strncpy_to_host(&(node->node_name), temp,
+                                       max_len, is_unicode, nls_codepage);
+               if (rc)
+                       goto parse_DFS_referrals_exit;
+
+               ref += ref->Size;
+       }
+
+parse_DFS_referrals_exit:
+       if (rc) {
+               free_dfs_info_array(*target_nodes, *num_of_nodes);
+               *target_nodes = NULL;
+               *num_of_nodes = 0;
+       }
+       return rc;
+}
+
 int
 CIFSGetDFSRefer(const int xid, struct cifsSesInfo *ses,
                const unsigned char *searchName,
-               unsigned char **targetUNCs,
-               unsigned int *number_of_UNC_in_array,
+               struct dfs_info3_param **target_nodes,
+               unsigned int *num_of_nodes,
                const struct nls_table *nls_codepage, int remap)
 {
 /* TRANS2_GET_DFS_REFERRAL */
        TRANSACTION2_GET_DFS_REFER_REQ *pSMB = NULL;
        TRANSACTION2_GET_DFS_REFER_RSP *pSMBr = NULL;
-       struct dfs_referral_level_3 *referrals = NULL;
        int rc = 0;
        int bytes_returned;
        int name_len;
-       unsigned int i;
-       char *temp;
        __u16 params, byte_count;
-       *number_of_UNC_in_array = 0;
-       *targetUNCs = NULL;
+       *num_of_nodes = 0;
+       *target_nodes = NULL;
 
        cFYI(1, ("In GetDFSRefer the path %s", searchName));
        if (ses == NULL)
@@ -3921,7 +4051,8 @@ getDFSRetry:
        pSMB->DataCount = 0;
        pSMB->DataOffset = 0;
        pSMB->MaxParameterCount = 0;
-       pSMB->MaxDataCount = cpu_to_le16(4000); /* BB find exact max SMB PDU from sess structure BB */
+       /* BB find exact max SMB PDU from sess structure BB */
+       pSMB->MaxDataCount = cpu_to_le16(4000);
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;
@@ -3943,103 +4074,26 @@ getDFSRetry:
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
        if (rc) {
                cFYI(1, ("Send error in GetDFSRefer = %d", rc));
-       } else {                /* decode response */
-/* BB Add logic to parse referrals here */
-               rc = validate_t2((struct smb_t2_rsp *)pSMBr);
+               goto GetDFSRefExit;
+       }
+       rc = validate_t2((struct smb_t2_rsp *)pSMBr);
 
-               /* BB Also check if enough total bytes returned? */
-               if (rc || (pSMBr->ByteCount < 17))
-                       rc = -EIO;      /* bad smb */
-               else {
-                       __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset);
-                       __u16 data_count = le16_to_cpu(pSMBr->t2.DataCount);
+       /* BB Also check if enough total bytes returned? */
+       if (rc || (pSMBr->ByteCount < 17)) {
+               rc = -EIO;      /* bad smb */
+               goto GetDFSRefExit;
+       }
 
-                       cFYI(1,
-                           ("Decoding GetDFSRefer response BCC: %d  Offset %d",
-                             pSMBr->ByteCount, data_offset));
-                       referrals =
-                           (struct dfs_referral_level_3 *)
-                                       (8 /* sizeof start of data block */ +
-                                       data_offset +
-                                       (char *) &pSMBr->hdr.Protocol);
-                       cFYI(1, ("num_referrals: %d dfs flags: 0x%x ... \n"
-                               "for referral one refer size: 0x%x srv "
-                               "type: 0x%x refer flags: 0x%x ttl: 0x%x",
-                               le16_to_cpu(pSMBr->NumberOfReferrals),
-                               le16_to_cpu(pSMBr->DFSFlags),
-                               le16_to_cpu(referrals->ReferralSize),
-                               le16_to_cpu(referrals->ServerType),
-                               le16_to_cpu(referrals->ReferralFlags),
-                               le16_to_cpu(referrals->TimeToLive)));
-                       /* BB This field is actually two bytes in from start of
-                          data block so we could do safety check that DataBlock
-                          begins at address of pSMBr->NumberOfReferrals */
-                       *number_of_UNC_in_array =
-                                       le16_to_cpu(pSMBr->NumberOfReferrals);
-
-                       /* BB Fix below so can return more than one referral */
-                       if (*number_of_UNC_in_array > 1)
-                               *number_of_UNC_in_array = 1;
-
-                       /* get the length of the strings describing refs */
-                       name_len = 0;
-                       for (i = 0; i < *number_of_UNC_in_array; i++) {
-                               /* make sure that DfsPathOffset not past end */
-                               __u16 offset =
-                                       le16_to_cpu(referrals->DfsPathOffset);
-                               if (offset > data_count) {
-                                       /* if invalid referral, stop here and do
-                                       not try to copy any more */
-                                       *number_of_UNC_in_array = i;
-                                       break;
-                               }
-                               temp = ((char *)referrals) + offset;
+       cFYI(1, ("Decoding GetDFSRefer response BCC: %d  Offset %d",
+                               pSMBr->ByteCount,
+                               le16_to_cpu(pSMBr->t2.DataOffset)));
 
-                               if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE) {
-                                       name_len += UniStrnlen((wchar_t *)temp,
-                                                               data_count);
-                               } else {
-                                       name_len += strnlen(temp, data_count);
-                               }
-                               referrals++;
-                               /* BB add check that referral pointer does
-                                  not fall off end PDU */
-                       }
-                       /* BB add check for name_len bigger than bcc */
-                       *targetUNCs =
-                               kmalloc(name_len+1+(*number_of_UNC_in_array),
-                                       GFP_KERNEL);
-                       if (*targetUNCs == NULL) {
-                               rc = -ENOMEM;
-                               goto GetDFSRefExit;
-                       }
-                       /* copy the ref strings */
-                       referrals = (struct dfs_referral_level_3 *)
-                                       (8 /* sizeof data hdr */ + data_offset +
-                                       (char *) &pSMBr->hdr.Protocol);
-
-                       for (i = 0; i < *number_of_UNC_in_array; i++) {
-                               temp = ((char *)referrals) +
-                                         le16_to_cpu(referrals->DfsPathOffset);
-                               if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE) {
-                                       cifs_strfromUCS_le(*targetUNCs,
-                                                         (__le16 *) temp,
-                                                         name_len,
-                                                         nls_codepage);
-                               } else {
-                                       strncpy(*targetUNCs, temp, name_len);
-                               }
-                               /*  BB update target_uncs pointers */
-                               referrals++;
-                       }
-                       temp = *targetUNCs;
-                       temp[name_len] = 0;
-               }
+       /* parse returned result into more usable form */
+       rc = parse_DFS_referrals(pSMBr, num_of_nodes,
+                                target_nodes, nls_codepage);
 
-       }
 GetDFSRefExit:
-       if (pSMB)
-               cifs_buf_release(pSMB);
+       cifs_buf_release(pSMB);
 
        if (rc == -EAGAIN)
                goto getDFSRetry;
@@ -4229,7 +4283,8 @@ QFSAttributeRetry:
        params = 2;     /* level */
        pSMB->TotalDataCount = 0;
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find exact max SMB PDU from sess structure BB */
+       /* BB find exact max SMB PDU from sess structure BB */
+       pSMB->MaxDataCount = cpu_to_le16(1000);
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;
@@ -4298,7 +4353,8 @@ QFSDeviceRetry:
        params = 2;     /* level */
        pSMB->TotalDataCount = 0;
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find exact max SMB PDU from sess structure BB */
+       /* BB find exact max SMB PDU from sess structure BB */
+       pSMB->MaxDataCount = cpu_to_le16(1000);
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;
@@ -4369,7 +4425,8 @@ QFSUnixRetry:
        pSMB->DataCount = 0;
        pSMB->DataOffset = 0;
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(100);  /* BB find exact max SMB PDU from sess structure BB */
+       /* BB find exact max SMB PDU from sess structure BB */
+       pSMB->MaxDataCount = cpu_to_le16(100);
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;
@@ -4444,7 +4501,8 @@ SETFSUnixRetry:
        offset = param_offset + params;
 
        pSMB->MaxParameterCount = cpu_to_le16(4);
-       pSMB->MaxDataCount = cpu_to_le16(100);  /* BB find exact max SMB PDU from sess structure BB */
+       /* BB find exact max SMB PDU from sess structure BB */
+       pSMB->MaxDataCount = cpu_to_le16(100);
        pSMB->SetupCount = 1;
        pSMB->Reserved3 = 0;
        pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FS_INFORMATION);
@@ -4512,7 +4570,8 @@ QFSPosixRetry:
        pSMB->DataCount = 0;
        pSMB->DataOffset = 0;
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(100);  /* BB find exact max SMB PDU from sess structure BB */
+       /* BB find exact max SMB PDU from sess structure BB */
+       pSMB->MaxDataCount = cpu_to_le16(100);
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;
@@ -4702,7 +4761,8 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size,
 
        count = sizeof(struct file_end_of_file_info);
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB PDU from sess */
+       /* BB find exact max SMB PDU from sess structure BB */
+       pSMB->MaxDataCount = cpu_to_le16(1000);
        pSMB->SetupCount = 1;
        pSMB->Reserved3 = 0;
        pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION);
@@ -4789,7 +4849,8 @@ CIFSSMBSetFileTimes(const int xid, struct cifsTconInfo *tcon,
 
        count = sizeof(FILE_BASIC_INFO);
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB PDU from sess */
+       /* BB find max SMB PDU from sess */
+       pSMB->MaxDataCount = cpu_to_le16(1000);
        pSMB->SetupCount = 1;
        pSMB->Reserved3 = 0;
        pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION);
@@ -4856,7 +4917,8 @@ SetTimesRetry:
        params = 6 + name_len;
        count = sizeof(FILE_BASIC_INFO);
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find exact max SMB PDU from sess structure BB */
+       /* BB find max SMB PDU from sess structure BB */
+       pSMB->MaxDataCount = cpu_to_le16(1000);
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;
@@ -4986,7 +5048,8 @@ setPermsRetry:
        params = 6 + name_len;
        count = sizeof(FILE_UNIX_BASIC_INFO);
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find exact max SMB PDU from sess structure BB */
+       /* BB find max SMB PDU from sess structure BB */
+       pSMB->MaxDataCount = cpu_to_le16(1000);
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;
@@ -5051,8 +5114,7 @@ setPermsRetry:
        if (rc)
                cFYI(1, ("SetPathInfo (perms) returned %d", rc));
 
-       if (pSMB)
-               cifs_buf_release(pSMB);
+       cifs_buf_release(pSMB);
        if (rc == -EAGAIN)
                goto setPermsRetry;
        return rc;
@@ -5169,7 +5231,8 @@ QAllEAsRetry:
        params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */;
        pSMB->TotalDataCount = 0;
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(4000); /* BB find exact max SMB PDU from sess structure BB */
+       /* BB find exact max SMB PDU from sess structure BB */
+       pSMB->MaxDataCount = cpu_to_le16(4000);
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;
@@ -5273,8 +5336,7 @@ QAllEAsRetry:
                        }
                }
        }
-       if (pSMB)
-               cifs_buf_release(pSMB);
+       cifs_buf_release(pSMB);
        if (rc == -EAGAIN)
                goto QAllEAsRetry;
 
@@ -5317,7 +5379,8 @@ QEARetry:
        params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */;
        pSMB->TotalDataCount = 0;
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(4000); /* BB find exact max SMB PDU from sess structure BB */
+       /* BB find exact max SMB PDU from sess structure BB */
+       pSMB->MaxDataCount = cpu_to_le16(4000);
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;
@@ -5422,8 +5485,7 @@ QEARetry:
                        }
                }
        }
-       if (pSMB)
-               cifs_buf_release(pSMB);
+       cifs_buf_release(pSMB);
        if (rc == -EAGAIN)
                goto QEARetry;
 
@@ -5475,7 +5537,8 @@ SetEARetry:
 
        count = sizeof(*parm_data) + ea_value_len + name_len;
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB size from sess */
+       /* BB find max SMB PDU from sess */
+       pSMB->MaxDataCount = cpu_to_le16(1000);
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;
index f428bf3..023434f 100644 (file)
@@ -60,7 +60,7 @@ struct smb_vol {
        char *domainname;
        char *UNC;
        char *UNCip;
-       char *in6_addr;  /* ipv6 address as human readable form of in6_addr */
+       char *in6_addr;   /* ipv6 address as human readable form of in6_addr */
        char *iocharset;  /* local code page for mapping to and from Unicode */
        char source_rfc1001_name[16]; /* netbios name of client */
        char target_rfc1001_name[16]; /* netbios name of server for Win9x/ME */
@@ -75,19 +75,21 @@ struct smb_vol {
        bool setuids:1;
        bool override_uid:1;
        bool override_gid:1;
+       bool dynperm:1;
        bool noperm:1;
        bool no_psx_acl:1; /* set if posix acl support should be disabled */
        bool cifs_acl:1;
        bool no_xattr:1;   /* set if xattr (EA) support should be disabled*/
        bool server_ino:1; /* use inode numbers from server ie UniqueId */
        bool direct_io:1;
-       bool remap:1;     /* set to remap seven reserved chars in filenames */
-       bool posix_paths:1;   /* unset to not ask for posix pathnames. */
+       bool remap:1;      /* set to remap seven reserved chars in filenames */
+       bool posix_paths:1; /* unset to not ask for posix pathnames. */
        bool no_linux_ext:1;
        bool sfu_emul:1;
-       bool nullauth:1; /* attempt to authenticate with null user */
-       unsigned nocase;     /* request case insensitive filenames */
-       unsigned nobrl;      /* disable sending byte range locks to srv */
+       bool nullauth:1;   /* attempt to authenticate with null user */
+       bool nocase:1;     /* request case insensitive filenames */
+       bool nobrl:1;      /* disable sending byte range locks to srv */
+       bool seal:1;       /* request transport encryption on share */
        unsigned int rsize;
        unsigned int wsize;
        unsigned int sockopt;
@@ -1246,6 +1248,10 @@ cifs_parse_mount_options(char *options, const char *devname,
                        vol->setuids = 1;
                } else if (strnicmp(data, "nosetuids", 9) == 0) {
                        vol->setuids = 0;
+               } else if (strnicmp(data, "dynperm", 7) == 0) {
+                       vol->dynperm = true;
+               } else if (strnicmp(data, "nodynperm", 9) == 0) {
+                       vol->dynperm = false;
                } else if (strnicmp(data, "nohard", 6) == 0) {
                        vol->retry = 0;
                } else if (strnicmp(data, "nosoft", 6) == 0) {
@@ -1268,8 +1274,12 @@ cifs_parse_mount_options(char *options, const char *devname,
                        vol->no_psx_acl = 1;
                } else if (strnicmp(data, "sign", 4) == 0) {
                        vol->secFlg |= CIFSSEC_MUST_SIGN;
-/*             } else if (strnicmp(data, "seal",4) == 0) {
-                       vol->secFlg |= CIFSSEC_MUST_SEAL; */
+               } else if (strnicmp(data, "seal", 4) == 0) {
+                       /* we do not do the following in secFlags because seal
+                          is a per tree connection (mount) not a per socket
+                          or per-smb connection option in the protocol */
+                       /* vol->secFlg |= CIFSSEC_MUST_SEAL; */
+                       vol->seal = 1;
                } else if (strnicmp(data, "direct", 6) == 0) {
                        vol->direct_io = 1;
                } else if (strnicmp(data, "forcedirectio", 13) == 0) {
@@ -1414,34 +1424,12 @@ find_unc(__be32 new_target_ip_addr, char *uncName, char *userName)
 }
 
 int
-connect_to_dfs_path(int xid, struct cifsSesInfo *pSesInfo,
-                   const char *old_path, const struct nls_table *nls_codepage,
-                   int remap)
-{
-       struct dfs_info3_param *referrals = NULL;
-       unsigned int num_referrals;
-       int rc = 0;
-
-       rc = get_dfs_path(xid, pSesInfo, old_path, nls_codepage,
-                       &num_referrals, &referrals, remap);
-
-       /* BB Add in code to: if valid refrl, if not ip address contact
-               the helper that resolves tcp names, mount to it, try to
-               tcon to it unmount it if fail */
-
-       kfree(referrals);
-
-       return rc;
-}
-
-int
 get_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path,
             const struct nls_table *nls_codepage, unsigned int *pnum_referrals,
             struct dfs_info3_param **preferrals, int remap)
 {
        char *temp_unc;
        int rc = 0;
-       unsigned char *targetUNCs;
 
        *pnum_referrals = 0;
        *preferrals = NULL;
@@ -1464,7 +1452,7 @@ get_dfs_path(int xid, struct cifsSesInfo *pSesInfo, const char *old_path,
                kfree(temp_unc);
        }
        if (rc == 0)
-               rc = CIFSGetDFSRefer(xid, pSesInfo, old_path, &targetUNCs,
+               rc = CIFSGetDFSRefer(xid, pSesInfo, old_path, preferrals,
                                     pnum_referrals, nls_codepage, remap);
        /* BB map targetUNCs to dfs_info3 structures, here or
                in CIFSGetDFSRefer BB */
@@ -1815,7 +1803,7 @@ convert_delimiter(char *path, char delim)
        if (path == NULL)
                return;
 
-       if (delim == '/') 
+       if (delim == '/')
                old_delim = '\\';
        else
                old_delim = '/';
@@ -2125,6 +2113,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                        cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_UID;
                if (volume_info.override_gid)
                        cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_GID;
+               if (volume_info.dynperm)
+                       cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM;
                if (volume_info.direct_io) {
                        cFYI(1, ("mounting share using direct i/o"));
                        cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO;
@@ -2141,6 +2131,9 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                           for the retry flag is used */
                        tcon->retry = volume_info.retry;
                        tcon->nocase = volume_info.nocase;
+                       if (tcon->seal != volume_info.seal)
+                               cERROR(1, ("transport encryption setting "
+                                          "conflicts with existing tid"));
                } else {
                        tcon = tconInfoAlloc();
                        if (tcon == NULL)
@@ -2154,10 +2147,11 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                                if ((strchr(volume_info.UNC + 3, '\\') == NULL)
                                    && (strchr(volume_info.UNC + 3, '/') ==
                                        NULL)) {
-                                       rc = connect_to_dfs_path(xid, pSesInfo,
+/*                                     rc = connect_to_dfs_path(xid, pSesInfo,
                                                "", cifs_sb->local_nls,
                                                cifs_sb->mnt_cifs_flags &
-                                                 CIFS_MOUNT_MAP_SPECIAL_CHR);
+                                                 CIFS_MOUNT_MAP_SPECIAL_CHR);*/
+                                       cFYI(1, ("DFS root not supported"));
                                        rc = -ENODEV;
                                        goto out;
                                } else {
@@ -2173,6 +2167,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                                        atomic_inc(&pSesInfo->inUse);
                                        tcon->retry = volume_info.retry;
                                        tcon->nocase = volume_info.nocase;
+                                       tcon->seal = volume_info.seal;
                                }
                        }
                }
@@ -2314,9 +2309,10 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
        user = ses->userName;
        domain = ses->domainName;
        smb_buffer = cifs_buf_get();
-       if (smb_buffer == NULL) {
+
+       if (smb_buffer == NULL)
                return -ENOMEM;
-       }
+
        smb_buffer_response = smb_buffer;
        pSMBr = pSMB = (SESSION_SETUP_ANDX *) smb_buffer;
 
index e4e0078..f0b5b5f 100644 (file)
@@ -49,18 +49,25 @@ build_path_from_dentry(struct dentry *direntry)
        struct dentry *temp;
        int namelen;
        int pplen;
+       int dfsplen;
        char *full_path;
        char dirsep;
+       struct cifs_sb_info *cifs_sb;
 
        if (direntry == NULL)
                return NULL;  /* not much we can do if dentry is freed and
                we need to reopen the file after it was closed implicitly
                when the server crashed */
 
-       dirsep = CIFS_DIR_SEP(CIFS_SB(direntry->d_sb));
-       pplen = CIFS_SB(direntry->d_sb)->prepathlen;
+       cifs_sb = CIFS_SB(direntry->d_sb);
+       dirsep = CIFS_DIR_SEP(cifs_sb);
+       pplen = cifs_sb->prepathlen;
+       if (cifs_sb->tcon && (cifs_sb->tcon->Flags & SMB_SHARE_IS_IN_DFS))
+               dfsplen = strnlen(cifs_sb->tcon->treeName, MAX_TREE_SIZE + 1);
+       else
+               dfsplen = 0;
 cifs_bp_rename_retry:
-       namelen = pplen;
+       namelen = pplen + dfsplen;
        for (temp = direntry; !IS_ROOT(temp);) {
                namelen += (1 + temp->d_name.len);
                temp = temp->d_parent;
@@ -91,7 +98,7 @@ cifs_bp_rename_retry:
                        return NULL;
                }
        }
-       if (namelen != pplen) {
+       if (namelen != pplen + dfsplen) {
                cERROR(1,
                       ("did not end path lookup where expected namelen is %d",
                        namelen));
@@ -107,7 +114,18 @@ cifs_bp_rename_retry:
           since the '\' is a valid posix character so we can not switch
           those safely to '/' if any are found in the middle of the prepath */
        /* BB test paths to Windows with '/' in the midst of prepath */
-       strncpy(full_path, CIFS_SB(direntry->d_sb)->prepath, pplen);
+
+       if (dfsplen) {
+               strncpy(full_path, cifs_sb->tcon->treeName, dfsplen);
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) {
+                       int i;
+                       for (i = 0; i < dfsplen; i++) {
+                               if (full_path[i] == '\\')
+                                       full_path[i] = '/';
+                       }
+               }
+       }
+       strncpy(full_path + dfsplen, CIFS_SB(direntry->d_sb)->prepath, pplen);
        return full_path;
 }
 
@@ -590,7 +608,7 @@ static int cifs_ci_compare(struct dentry *dentry, struct qstr *a,
                 * case take precedence.  If a is not a negative dentry, this
                 * should have no side effects
                 */
-               memcpy(a->name, b->name, a->len);
+               memcpy((void *)a->name, b->name, a->len);
                return 0;
        }
        return 1;
index 939e256..f730ef3 100644 (file)
@@ -134,10 +134,6 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
        rkey = request_key(&key_type_dns_resolver, name, "");
        if (!IS_ERR(rkey)) {
                data = rkey->payload.data;
-               cFYI(1, ("%s: resolved: %s to %s", __func__,
-                                       rkey->description,
-                                       *ip_addr
-                               ));
        } else {
                cERROR(1, ("%s: unable to resolve: %s", __func__, name));
                goto out;
@@ -150,6 +146,11 @@ skip_upcall:
                if (*ip_addr) {
                        memcpy(*ip_addr, data, len);
                        (*ip_addr)[len] = '\0';
+                       if (!IS_ERR(rkey))
+                               cFYI(1, ("%s: resolved: %s to %s", __func__,
+                                                       name,
+                                                       *ip_addr
+                                       ));
                        rc = 0;
                } else {
                        rc = -ENOMEM;
index 31a0a33..8636cec 100644 (file)
@@ -75,7 +75,11 @@ static inline int cifs_convert_flags(unsigned int flags)
                return (GENERIC_READ | GENERIC_WRITE);
        }
 
-       return 0x20197;
+       return (READ_CONTROL | FILE_WRITE_ATTRIBUTES | FILE_READ_ATTRIBUTES |
+               FILE_WRITE_EA | FILE_APPEND_DATA | FILE_WRITE_DATA |
+               FILE_READ_DATA);
+
+
 }
 
 static inline int cifs_get_disposition(unsigned int flags)
index fcbdbb6..129dbfe 100644 (file)
@@ -161,118 +161,115 @@ static void cifs_unix_info_to_inode(struct inode *inode,
        spin_unlock(&inode->i_lock);
 }
 
-static const unsigned char *cifs_get_search_path(struct cifs_sb_info *cifs_sb,
-                                               const char *search_path)
-{
-       int tree_len;
-       int path_len;
-       int i;
-       char *tmp_path;
-       struct cifsTconInfo *pTcon = cifs_sb->tcon;
-
-       if (!(pTcon->Flags & SMB_SHARE_IS_IN_DFS))
-               return search_path;
 
-       /* use full path name for working with DFS */
-       tree_len = strnlen(pTcon->treeName, MAX_TREE_SIZE + 1);
-       path_len = strnlen(search_path, MAX_PATHCONF);
-
-       tmp_path = kmalloc(tree_len+path_len+1, GFP_KERNEL);
-       if (tmp_path == NULL)
-               return search_path;
+/*
+ *     Needed to setup inode data for the directory which is the
+ *     junction to the new submount (ie to setup the fake directory
+ *      which represents a DFS referral)
+ */
+static void fill_fake_finddataunix(FILE_UNIX_BASIC_INFO *pfnd_dat,
+                              struct super_block *sb)
+{
+       struct inode *pinode = NULL;
+
+       memset(pfnd_dat, 0, sizeof(FILE_UNIX_BASIC_INFO));
+
+/*     __le64 pfnd_dat->EndOfFile = cpu_to_le64(0);
+       __le64 pfnd_dat->NumOfBytes = cpu_to_le64(0);
+       __u64 UniqueId = 0;  */
+       pfnd_dat->LastStatusChange =
+               cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
+       pfnd_dat->LastAccessTime =
+               cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
+       pfnd_dat->LastModificationTime =
+               cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
+       pfnd_dat->Type = cpu_to_le32(UNIX_DIR);
+       pfnd_dat->Permissions = cpu_to_le64(S_IXUGO | S_IRWXU);
+       pfnd_dat->Nlinks = cpu_to_le64(2);
+       if (sb->s_root)
+               pinode = sb->s_root->d_inode;
+       if (pinode == NULL)
+               return;
 
-       strncpy(tmp_path, pTcon->treeName, tree_len);
-       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
-               for (i = 0; i < tree_len; i++) {
-                       if (tmp_path[i] == '\\')
-                               tmp_path[i] = '/';
-               }
-       strncpy(tmp_path+tree_len, search_path, path_len);
-       tmp_path[tree_len+path_len] = 0;
-       return tmp_path;
+       /* fill in default values for the remaining based on root
+          inode since we can not query the server for this inode info */
+       pfnd_dat->DevMajor = cpu_to_le64(MAJOR(pinode->i_rdev));
+       pfnd_dat->DevMinor = cpu_to_le64(MINOR(pinode->i_rdev));
+       pfnd_dat->Uid = cpu_to_le64(pinode->i_uid);
+       pfnd_dat->Gid = cpu_to_le64(pinode->i_gid);
 }
 
 int cifs_get_inode_info_unix(struct inode **pinode,
-       const unsigned char *search_path, struct super_block *sb, int xid)
+       const unsigned char *full_path, struct super_block *sb, int xid)
 {
        int rc = 0;
-       FILE_UNIX_BASIC_INFO findData;
+       FILE_UNIX_BASIC_INFO find_data;
        struct cifsTconInfo *pTcon;
        struct inode *inode;
        struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
-       const unsigned char *full_path;
        bool is_dfs_referral = false;
+       struct cifsInodeInfo *cifsInfo;
+       __u64 num_of_bytes;
+       __u64 end_of_file;
 
        pTcon = cifs_sb->tcon;
-       cFYI(1, ("Getting info on %s", search_path));
+       cFYI(1, ("Getting info on %s", full_path));
 
-       full_path = cifs_get_search_path(cifs_sb, search_path);
-
-try_again_CIFSSMBUnixQPathInfo:
        /* could have done a find first instead but this returns more info */
-       rc = CIFSSMBUnixQPathInfo(xid, pTcon, full_path, &findData,
+       rc = CIFSSMBUnixQPathInfo(xid, pTcon, full_path, &find_data,
                                  cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
                                        CIFS_MOUNT_MAP_SPECIAL_CHR);
-/*     dump_mem("\nUnixQPathInfo return data", &findData,
-                sizeof(findData)); */
        if (rc) {
                if (rc == -EREMOTE && !is_dfs_referral) {
                        is_dfs_referral = true;
-                       if (full_path != search_path) {
-                               kfree(full_path);
-                               full_path = search_path;
-                       }
-                       goto try_again_CIFSSMBUnixQPathInfo;
+                       cFYI(DBG2, ("DFS ref"));
+                       /* for DFS, server does not give us real inode data */
+                       fill_fake_finddataunix(&find_data, sb);
+                       rc = 0;
                }
-               goto cgiiu_exit;
-       } else {
-               struct cifsInodeInfo *cifsInfo;
-               __u64 num_of_bytes = le64_to_cpu(findData.NumOfBytes);
-               __u64 end_of_file = le64_to_cpu(findData.EndOfFile);
+       }
+       num_of_bytes = le64_to_cpu(find_data.NumOfBytes);
+       end_of_file = le64_to_cpu(find_data.EndOfFile);
 
-               /* get new inode */
+       /* get new inode */
+       if (*pinode == NULL) {
+               *pinode = new_inode(sb);
                if (*pinode == NULL) {
-                       *pinode = new_inode(sb);
-                       if (*pinode == NULL) {
-                               rc = -ENOMEM;
-                               goto cgiiu_exit;
-                       }
-                       /* Is an i_ino of zero legal? */
-                       /* Are there sanity checks we can use to ensure that
-                          the server is really filling in that field? */
-                       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
-                               (*pinode)->i_ino =
-                                       (unsigned long)findData.UniqueId;
-                       } /* note ino incremented to unique num in new_inode */
-                       if (sb->s_flags & MS_NOATIME)
-                               (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME;
-
-                       insert_inode_hash(*pinode);
+                       rc = -ENOMEM;
+               goto cgiiu_exit;
                }
+               /* Is an i_ino of zero legal? */
+               /* note ino incremented to unique num in new_inode */
+               /* Are there sanity checks we can use to ensure that
+                  the server is really filling in that field? */
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)
+                       (*pinode)->i_ino = (unsigned long)find_data.UniqueId;
 
-               inode = *pinode;
-               cifsInfo = CIFS_I(inode);
+               if (sb->s_flags & MS_NOATIME)
+                       (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME;
 
-               cFYI(1, ("Old time %ld", cifsInfo->time));
-               cifsInfo->time = jiffies;
-               cFYI(1, ("New time %ld", cifsInfo->time));
-               /* this is ok to set on every inode revalidate */
-               atomic_set(&cifsInfo->inUse, 1);
+               insert_inode_hash(*pinode);
+       }
 
-               cifs_unix_info_to_inode(inode, &findData, 0);
+       inode = *pinode;
+       cifsInfo = CIFS_I(inode);
 
+       cFYI(1, ("Old time %ld", cifsInfo->time));
+       cifsInfo->time = jiffies;
+       cFYI(1, ("New time %ld", cifsInfo->time));
+       /* this is ok to set on every inode revalidate */
+       atomic_set(&cifsInfo->inUse, 1);
 
-               if (num_of_bytes < end_of_file)
-                       cFYI(1, ("allocation size less than end of file"));
-               cFYI(1, ("Size %ld and blocks %llu",
-                       (unsigned long) inode->i_size,
-                       (unsigned long long)inode->i_blocks));
+       cifs_unix_info_to_inode(inode, &find_data, 0);
 
-               cifs_set_ops(inode, is_dfs_referral);
-       }
+       if (num_of_bytes < end_of_file)
+               cFYI(1, ("allocation size less than end of file"));
+       cFYI(1, ("Size %ld and blocks %llu",
+               (unsigned long) inode->i_size,
+               (unsigned long long)inode->i_blocks));
+
+       cifs_set_ops(inode, is_dfs_referral);
 cgiiu_exit:
-       if (full_path != search_path)
-               kfree(full_path);
        return rc;
 }
 
@@ -379,21 +376,51 @@ static int get_sfu_mode(struct inode *inode,
 #endif
 }
 
+/*
+ *     Needed to setup inode data for the directory which is the
+ *     junction to the new submount (ie to setup the fake directory
+ *      which represents a DFS referral)
+ */
+static void fill_fake_finddata(FILE_ALL_INFO *pfnd_dat,
+                              struct super_block *sb)
+{
+       memset(pfnd_dat, 0, sizeof(FILE_ALL_INFO));
+
+/*     __le64 pfnd_dat->AllocationSize = cpu_to_le64(0);
+       __le64 pfnd_dat->EndOfFile = cpu_to_le64(0);
+       __u8 pfnd_dat->DeletePending = 0;
+       __u8 pfnd_data->Directory = 0;
+       __le32 pfnd_dat->EASize = 0;
+       __u64 pfnd_dat->IndexNumber = 0;
+       __u64 pfnd_dat->IndexNumber1 = 0;  */
+       pfnd_dat->CreationTime =
+               cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
+       pfnd_dat->LastAccessTime =
+               cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
+       pfnd_dat->LastWriteTime =
+               cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
+       pfnd_dat->ChangeTime =
+               cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
+       pfnd_dat->Attributes = cpu_to_le32(ATTR_DIRECTORY);
+       pfnd_dat->NumberOfLinks = cpu_to_le32(2);
+}
+
 int cifs_get_inode_info(struct inode **pinode,
-       const unsigned char *search_path, FILE_ALL_INFO *pfindData,
+       const unsigned char *full_path, FILE_ALL_INFO *pfindData,
        struct super_block *sb, int xid, const __u16 *pfid)
 {
        int rc = 0;
+       __u32 attr;
+       struct cifsInodeInfo *cifsInfo;
        struct cifsTconInfo *pTcon;
        struct inode *inode;
        struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
-       const unsigned char *full_path = NULL;
        char *buf = NULL;
        bool adjustTZ = false;
        bool is_dfs_referral = false;
 
        pTcon = cifs_sb->tcon;
-       cFYI(1, ("Getting info on %s", search_path));
+       cFYI(1, ("Getting info on %s", full_path));
 
        if ((pfindData == NULL) && (*pinode != NULL)) {
                if (CIFS_I(*pinode)->clientCanCacheRead) {
@@ -409,9 +436,6 @@ int cifs_get_inode_info(struct inode **pinode,
                        return -ENOMEM;
                pfindData = (FILE_ALL_INFO *)buf;
 
-               full_path = cifs_get_search_path(cifs_sb, search_path);
-
-try_again_CIFSSMBQPathInfo:
                /* could do find first instead but this returns more info */
                rc = CIFSSMBQPathInfo(xid, pTcon, full_path, pfindData,
                              0 /* not legacy */,
@@ -429,178 +453,168 @@ try_again_CIFSSMBQPathInfo:
                }
        }
        /* dump_mem("\nQPathInfo return data",&findData, sizeof(findData)); */
-       if (rc) {
-               if (rc == -EREMOTE && !is_dfs_referral) {
-                       is_dfs_referral = true;
-                       if (full_path != search_path) {
-                               kfree(full_path);
-                               full_path = search_path;
-                       }
-                       goto try_again_CIFSSMBQPathInfo;
-               }
+       if (rc == -EREMOTE) {
+               is_dfs_referral = true;
+               fill_fake_finddata(pfindData, sb);
+               rc = 0;
+       } else if (rc)
                goto cgii_exit;
-       } else {
-               struct cifsInodeInfo *cifsInfo;
-               __u32 attr = le32_to_cpu(pfindData->Attributes);
 
-               /* get new inode */
-               if (*pinode == NULL) {
-                       *pinode = new_inode(sb);
-                       if (*pinode == NULL) {
-                               rc = -ENOMEM;
-                               goto cgii_exit;
-                       }
-                       /* Is an i_ino of zero legal? Can we use that to check
-                          if the server supports returning inode numbers?  Are
-                          there other sanity checks we can use to ensure that
-                          the server is really filling in that field? */
+       attr = le32_to_cpu(pfindData->Attributes);
 
-                       /* We can not use the IndexNumber field by default from
-                          Windows or Samba (in ALL_INFO buf) but we can request
-                          it explicitly.  It may not be unique presumably if
-                          the server has multiple devices mounted under one
-                          share */
-
-                       /* There may be higher info levels that work but are
-                          there Windows server or network appliances for which
-                          IndexNumber field is not guaranteed unique? */
-
-                       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
-                               int rc1 = 0;
-                               __u64 inode_num;
-
-                               rc1 = CIFSGetSrvInodeNumber(xid, pTcon,
-                                       search_path, &inode_num,
+       /* get new inode */
+       if (*pinode == NULL) {
+               *pinode = new_inode(sb);
+               if (*pinode == NULL) {
+                       rc = -ENOMEM;
+                       goto cgii_exit;
+               }
+               /* Is an i_ino of zero legal? Can we use that to check
+                  if the server supports returning inode numbers?  Are
+                  there other sanity checks we can use to ensure that
+                  the server is really filling in that field? */
+
+               /* We can not use the IndexNumber field by default from
+                  Windows or Samba (in ALL_INFO buf) but we can request
+                  it explicitly.  It may not be unique presumably if
+                  the server has multiple devices mounted under one share */
+
+               /* There may be higher info levels that work but are
+                  there Windows server or network appliances for which
+                  IndexNumber field is not guaranteed unique? */
+
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
+                       int rc1 = 0;
+                       __u64 inode_num;
+
+                       rc1 = CIFSGetSrvInodeNumber(xid, pTcon,
+                                       full_path, &inode_num,
                                        cifs_sb->local_nls,
                                        cifs_sb->mnt_cifs_flags &
                                                CIFS_MOUNT_MAP_SPECIAL_CHR);
-                               if (rc1) {
-                                       cFYI(1, ("GetSrvInodeNum rc %d", rc1));
-                                       /* BB EOPNOSUPP disable SERVER_INUM? */
-                               } else /* do we need cast or hash to ino? */
-                                       (*pinode)->i_ino = inode_num;
-                       } /* else ino incremented to unique num in new_inode*/
-                       if (sb->s_flags & MS_NOATIME)
-                               (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME;
-                       insert_inode_hash(*pinode);
-               }
-               inode = *pinode;
-               cifsInfo = CIFS_I(inode);
-               cifsInfo->cifsAttrs = attr;
-               cFYI(1, ("Old time %ld", cifsInfo->time));
-               cifsInfo->time = jiffies;
-               cFYI(1, ("New time %ld", cifsInfo->time));
-
-               /* blksize needs to be multiple of two. So safer to default to
-               blksize and blkbits set in superblock so 2**blkbits and blksize
-               will match rather than setting to:
-               (pTcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE) & 0xFFFFFE00;*/
-
-               /* Linux can not store file creation time so ignore it */
-               if (pfindData->LastAccessTime)
-                       inode->i_atime = cifs_NTtimeToUnix
-                               (le64_to_cpu(pfindData->LastAccessTime));
-               else /* do not need to use current_fs_time - time not stored */
-                       inode->i_atime = CURRENT_TIME;
-               inode->i_mtime =
+                       if (rc1) {
+                               cFYI(1, ("GetSrvInodeNum rc %d", rc1));
+                               /* BB EOPNOSUPP disable SERVER_INUM? */
+                       } else /* do we need cast or hash to ino? */
+                               (*pinode)->i_ino = inode_num;
+               } /* else ino incremented to unique num in new_inode*/
+               if (sb->s_flags & MS_NOATIME)
+                       (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME;
+               insert_inode_hash(*pinode);
+       }
+       inode = *pinode;
+       cifsInfo = CIFS_I(inode);
+       cifsInfo->cifsAttrs = attr;
+       cFYI(1, ("Old time %ld", cifsInfo->time));
+       cifsInfo->time = jiffies;
+       cFYI(1, ("New time %ld", cifsInfo->time));
+
+       /* blksize needs to be multiple of two. So safer to default to
+       blksize and blkbits set in superblock so 2**blkbits and blksize
+       will match rather than setting to:
+       (pTcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE) & 0xFFFFFE00;*/
+
+       /* Linux can not store file creation time so ignore it */
+       if (pfindData->LastAccessTime)
+               inode->i_atime = cifs_NTtimeToUnix
+                       (le64_to_cpu(pfindData->LastAccessTime));
+       else /* do not need to use current_fs_time - time not stored */
+               inode->i_atime = CURRENT_TIME;
+       inode->i_mtime =
                    cifs_NTtimeToUnix(le64_to_cpu(pfindData->LastWriteTime));
-               inode->i_ctime =
-                   cifs_NTtimeToUnix(le64_to_cpu(pfindData->ChangeTime));
-               cFYI(0, ("Attributes came in as 0x%x", attr));
-               if (adjustTZ && (pTcon->ses) && (pTcon->ses->server)) {
-                       inode->i_ctime.tv_sec += pTcon->ses->server->timeAdj;
-                       inode->i_mtime.tv_sec += pTcon->ses->server->timeAdj;
-               }
+       inode->i_ctime =
+           cifs_NTtimeToUnix(le64_to_cpu(pfindData->ChangeTime));
+       cFYI(DBG2, ("Attributes came in as 0x%x", attr));
+       if (adjustTZ && (pTcon->ses) && (pTcon->ses->server)) {
+               inode->i_ctime.tv_sec += pTcon->ses->server->timeAdj;
+               inode->i_mtime.tv_sec += pTcon->ses->server->timeAdj;
+       }
 
-               /* set default mode. will override for dirs below */
-               if (atomic_read(&cifsInfo->inUse) == 0)
-                       /* new inode, can safely set these fields */
-                       inode->i_mode = cifs_sb->mnt_file_mode;
-               else /* since we set the inode type below we need to mask off
-                    to avoid strange results if type changes and both
-                    get orred in */
-                       inode->i_mode &= ~S_IFMT;
-/*             if (attr & ATTR_REPARSE)  */
-               /* We no longer handle these as symlinks because we could not
-                  follow them due to the absolute path with drive letter */
-               if (attr & ATTR_DIRECTORY) {
-               /* override default perms since we do not do byte range locking
-                  on dirs */
-                       inode->i_mode = cifs_sb->mnt_dir_mode;
-                       inode->i_mode |= S_IFDIR;
-               } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
-                          (cifsInfo->cifsAttrs & ATTR_SYSTEM) &&
-                          /* No need to le64 convert size of zero */
-                          (pfindData->EndOfFile == 0)) {
-                       inode->i_mode = cifs_sb->mnt_file_mode;
-                       inode->i_mode |= S_IFIFO;
+       /* set default mode. will override for dirs below */
+       if (atomic_read(&cifsInfo->inUse) == 0)
+               /* new inode, can safely set these fields */
+               inode->i_mode = cifs_sb->mnt_file_mode;
+       else /* since we set the inode type below we need to mask off
+            to avoid strange results if type changes and both
+            get orred in */
+               inode->i_mode &= ~S_IFMT;
+/*     if (attr & ATTR_REPARSE)  */
+       /* We no longer handle these as symlinks because we could not
+          follow them due to the absolute path with drive letter */
+       if (attr & ATTR_DIRECTORY) {
+       /* override default perms since we do not do byte range locking
+          on dirs */
+               inode->i_mode = cifs_sb->mnt_dir_mode;
+               inode->i_mode |= S_IFDIR;
+       } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
+                  (cifsInfo->cifsAttrs & ATTR_SYSTEM) &&
+                  /* No need to le64 convert size of zero */
+                  (pfindData->EndOfFile == 0)) {
+               inode->i_mode = cifs_sb->mnt_file_mode;
+               inode->i_mode |= S_IFIFO;
 /* BB Finish for SFU style symlinks and devices */
-               } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
-                          (cifsInfo->cifsAttrs & ATTR_SYSTEM)) {
-                       if (decode_sfu_inode(inode,
-                                        le64_to_cpu(pfindData->EndOfFile),
-                                        search_path,
-                                        cifs_sb, xid))
-                               cFYI(1, ("Unrecognized sfu inode type"));
-
-                       cFYI(1, ("sfu mode 0%o", inode->i_mode));
-               } else {
-                       inode->i_mode |= S_IFREG;
-                       /* treat the dos attribute of read-only as read-only
-                          mode e.g. 555 */
-                       if (cifsInfo->cifsAttrs & ATTR_READONLY)
-                               inode->i_mode &= ~(S_IWUGO);
-                       else if ((inode->i_mode & S_IWUGO) == 0)
-                               /* the ATTR_READONLY flag may have been */
-                               /* changed on server -- set any w bits  */
-                               /* allowed by mnt_file_mode             */
-                               inode->i_mode |= (S_IWUGO &
-                                                 cifs_sb->mnt_file_mode);
-               /* BB add code here -
-                  validate if device or weird share or device type? */
-               }
+       } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
+                  (cifsInfo->cifsAttrs & ATTR_SYSTEM)) {
+               if (decode_sfu_inode(inode, le64_to_cpu(pfindData->EndOfFile),
+                                    full_path, cifs_sb, xid))
+                       cFYI(1, ("Unrecognized sfu inode type"));
 
-               spin_lock(&inode->i_lock);
-               if (is_size_safe_to_change(cifsInfo,
-                                          le64_to_cpu(pfindData->EndOfFile))) {
-                       /* can not safely shrink the file size here if the
-                          client is writing to it due to potential races */
-                       i_size_write(inode, le64_to_cpu(pfindData->EndOfFile));
-
-                       /* 512 bytes (2**9) is the fake blocksize that must be
-                          used for this calculation */
-                       inode->i_blocks = (512 - 1 + le64_to_cpu(
-                                          pfindData->AllocationSize)) >> 9;
-               }
-               spin_unlock(&inode->i_lock);
+               cFYI(1, ("sfu mode 0%o", inode->i_mode));
+       } else {
+               inode->i_mode |= S_IFREG;
+               /* treat dos attribute of read-only as read-only mode eg 555 */
+               if (cifsInfo->cifsAttrs & ATTR_READONLY)
+                       inode->i_mode &= ~(S_IWUGO);
+               else if ((inode->i_mode & S_IWUGO) == 0)
+                       /* the ATTR_READONLY flag may have been */
+                       /* changed on server -- set any w bits  */
+                       /* allowed by mnt_file_mode             */
+                       inode->i_mode |= (S_IWUGO & cifs_sb->mnt_file_mode);
+       /* BB add code to validate if device or weird share or device type? */
+       }
+
+       spin_lock(&inode->i_lock);
+       if (is_size_safe_to_change(cifsInfo,
+                                  le64_to_cpu(pfindData->EndOfFile))) {
+               /* can not safely shrink the file size here if the
+                  client is writing to it due to potential races */
+               i_size_write(inode, le64_to_cpu(pfindData->EndOfFile));
+
+               /* 512 bytes (2**9) is the fake blocksize that must be
+                  used for this calculation */
+               inode->i_blocks = (512 - 1 + le64_to_cpu(
+                                  pfindData->AllocationSize)) >> 9;
+       }
+       spin_unlock(&inode->i_lock);
 
-               inode->i_nlink = le32_to_cpu(pfindData->NumberOfLinks);
+       inode->i_nlink = le32_to_cpu(pfindData->NumberOfLinks);
 
-               /* BB fill in uid and gid here? with help from winbind?
-                  or retrieve from NTFS stream extended attribute */
+       /* BB fill in uid and gid here? with help from winbind?
+          or retrieve from NTFS stream extended attribute */
 #ifdef CONFIG_CIFS_EXPERIMENTAL
-               /* fill in 0777 bits from ACL */
-               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
-                       cFYI(1, ("Getting mode bits from ACL"));
-                       acl_to_uid_mode(inode, search_path, pfid);
-               }
+       /* fill in 0777 bits from ACL */
+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
+               cFYI(1, ("Getting mode bits from ACL"));
+               acl_to_uid_mode(inode, full_path, pfid);
+       }
 #endif
-               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
-                       /* fill in remaining high mode bits e.g. SUID, VTX */
-                       get_sfu_mode(inode, search_path, cifs_sb, xid);
-               } else if (atomic_read(&cifsInfo->inUse) == 0) {
-                       inode->i_uid = cifs_sb->mnt_uid;
-                       inode->i_gid = cifs_sb->mnt_gid;
-                       /* set so we do not keep refreshing these fields with
-                          bad data after user has changed them in memory */
-                       atomic_set(&cifsInfo->inUse, 1);
-               }
-
-               cifs_set_ops(inode, is_dfs_referral);
+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
+               /* fill in remaining high mode bits e.g. SUID, VTX */
+               get_sfu_mode(inode, full_path, cifs_sb, xid);
+       } else if (atomic_read(&cifsInfo->inUse) == 0) {
+               inode->i_uid = cifs_sb->mnt_uid;
+               inode->i_gid = cifs_sb->mnt_gid;
+               /* set so we do not keep refreshing these fields with
+                  bad data after user has changed them in memory */
+               atomic_set(&cifsInfo->inUse, 1);
        }
+
+       cifs_set_ops(inode, is_dfs_referral);
+
+
+
+
 cgii_exit:
-       if (full_path != search_path)
-               kfree(full_path);
        kfree(buf);
        return rc;
 }
@@ -1502,8 +1516,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
                                int oplock = 0;
 
                                rc = SMBLegacyOpen(xid, pTcon, full_path,
-                                       FILE_OPEN,
-                                       SYNCHRONIZE | FILE_WRITE_ATTRIBUTES,
+                                       FILE_OPEN, GENERIC_WRITE,
                                        CREATE_NOT_DIR, &netfid, &oplock,
                                        NULL, cifs_sb->local_nls,
                                        cifs_sb->mnt_cifs_flags &
index 5c792df..0088a5b 100644 (file)
@@ -30,9 +30,9 @@
 
 #define CIFS_IOC_CHECKUMOUNT _IO(0xCF, 2)
 
-int cifs_ioctl(struct inode *inode, struct file *filep,
-               unsigned int command, unsigned long arg)
+long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
 {
+       struct inode *inode = filep->f_dentry->d_inode;
        int rc = -ENOTTY; /* strange error - but the precedent */
        int xid;
        struct cifs_sb_info *cifs_sb;
index 1c2c3ce..63f6440 100644 (file)
@@ -234,7 +234,6 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen)
        struct cifs_sb_info *cifs_sb;
        struct cifsTconInfo *pTcon;
        char *full_path = NULL;
-       char *tmp_path = NULL;
        char *tmpbuffer;
        int len;
        __u16 fid;
@@ -295,45 +294,9 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen)
                                cFYI(1, ("Error closing junction point "
                                         "(open for ioctl)"));
                        }
-                       /* BB unwind this long, nested function, or remove BB */
-                       if (rc == -EIO) {
-                               /* Query if DFS Junction */
-                               unsigned int num_referrals = 0;
-                               struct dfs_info3_param *refs = NULL;
-                               tmp_path =
-                                       kmalloc(MAX_TREE_SIZE + MAX_PATHCONF + 1,
-                                               GFP_KERNEL);
-                               if (tmp_path) {
-                                       strncpy(tmp_path, pTcon->treeName,
-                                               MAX_TREE_SIZE);
-                                       strncat(tmp_path, full_path,
-                                               MAX_PATHCONF);
-                                       rc = get_dfs_path(xid, pTcon->ses,
-                                               tmp_path,
-                                               cifs_sb->local_nls,
-                                               &num_referrals, &refs,
-                                               cifs_sb->mnt_cifs_flags &
-                                                   CIFS_MOUNT_MAP_SPECIAL_CHR);
-                                       cFYI(1, ("Get DFS for %s rc = %d ",
-                                               tmp_path, rc));
-                                       if ((num_referrals == 0) && (rc == 0))
-                                               rc = -EACCES;
-                                       else {
-                                               cFYI(1, ("num referral: %d",
-                                                       num_referrals));
-                                               if (refs && refs->path_name) {
-                                                       strncpy(tmpbuffer,
-                                                               refs->path_name,
-                                                               len-1);
-                                               }
-                                       }
-                                       kfree(refs);
-                                       kfree(tmp_path);
-}
-                               /* BB add code like else decode referrals
-                               then memcpy to tmpbuffer and free referrals
-                               string array BB */
-                       }
+                       /* If it is a DFS junction earlier we would have gotten
+                          PATH_NOT_COVERED returned from server so we do
+                          not need to request the DFS info here */
                }
        }
        /* BB Anything else to do to handle recursive links? */
index 00f4cff..8703d68 100644 (file)
@@ -141,11 +141,11 @@ cifs_inet_pton(const int address_family, const char *cp, void *dst)
        int ret = 0;
 
        /* calculate length by finding first slash or NULL */
-       if (address_family == AF_INET) {
+       if (address_family == AF_INET)
                ret = in4_pton(cp, -1 /* len */, dst, '\\', NULL);
-       } else if (address_family == AF_INET6) {
+       else if (address_family == AF_INET6)
                ret = in6_pton(cp, -1 /* len */, dst , '\\', NULL);
-       }
+
        cFYI(DBG2, ("address conversion returned %d for %s", ret, cp));
        if (ret > 0)
                ret = 1;
index 7170a9b..c377d80 100644 (file)
@@ -64,7 +64,7 @@ typedef struct _SECURITY_BUFFER {
 } __attribute__((packed)) SECURITY_BUFFER;
 
 typedef struct _NEGOTIATE_MESSAGE {
-       __u8 Signature[sizeof (NTLMSSP_SIGNATURE)];
+       __u8 Signature[sizeof(NTLMSSP_SIGNATURE)];
        __le32 MessageType;     /* 1 */
        __le32 NegotiateFlags;
        SECURITY_BUFFER DomainName;     /* RFC 1001 style and ASCII */
@@ -74,7 +74,7 @@ typedef struct _NEGOTIATE_MESSAGE {
 } __attribute__((packed)) NEGOTIATE_MESSAGE, *PNEGOTIATE_MESSAGE;
 
 typedef struct _CHALLENGE_MESSAGE {
-       __u8 Signature[sizeof (NTLMSSP_SIGNATURE)];
+       __u8 Signature[sizeof(NTLMSSP_SIGNATURE)];
        __le32 MessageType;   /* 2 */
        SECURITY_BUFFER TargetName;
        __le32 NegotiateFlags;
index 34ec321..713c251 100644 (file)
@@ -670,8 +670,11 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
           (index_to_find < first_entry_in_buffer)) {
                /* close and restart search */
                cFYI(1, ("search backing up - close and restart search"));
-               cifsFile->invalidHandle = true;
-               CIFSFindClose(xid, pTcon, cifsFile->netfid);
+               if (!cifsFile->srch_inf.endOfSearch &&
+                   !cifsFile->invalidHandle) {
+                       cifsFile->invalidHandle = true;
+                       CIFSFindClose(xid, pTcon, cifsFile->netfid);
+               }
                kfree(cifsFile->search_resume_name);
                cifsFile->search_resume_name = NULL;
                if (cifsFile->srch_inf.ntwrk_buf_start) {
index cd62d75..e2832bc 100644 (file)
@@ -1906,9 +1906,9 @@ int ecryptfs_get_tfm_and_mutex_for_cipher_name(struct crypto_blkcipher **tfm,
                        goto out;
                }
        }
-       mutex_unlock(&key_tfm_list_mutex);
        (*tfm) = key_tfm->key_tfm;
        (*tfm_mutex) = &key_tfm->key_tfm_mutex;
 out:
+       mutex_unlock(&key_tfm_list_mutex);
        return rc;
 }
index 6560da1..50c994a 100644 (file)
@@ -243,7 +243,6 @@ ecryptfs_miscdev_read(struct file *file, char __user *buf, size_t count,
        struct ecryptfs_daemon *daemon;
        struct ecryptfs_msg_ctx *msg_ctx;
        size_t packet_length_size;
-       u32 counter_nbo;
        char packet_length[3];
        size_t i;
        size_t total_length;
@@ -328,20 +327,18 @@ check_list:
                       "pending message\n", __func__, count, total_length);
                goto out_unlock_msg_ctx;
        }
-       i = 0;
-       buf[i++] = msg_ctx->type;
-       counter_nbo = cpu_to_be32(msg_ctx->counter);
-       memcpy(&buf[i], (char *)&counter_nbo, 4);
-       i += 4;
+       rc = -EFAULT;
+       if (put_user(msg_ctx->type, buf))
+               goto out_unlock_msg_ctx;
+       if (put_user(cpu_to_be32(msg_ctx->counter), (__be32 __user *)(buf + 1)))
+               goto out_unlock_msg_ctx;
+       i = 5;
        if (msg_ctx->msg) {
-               memcpy(&buf[i], packet_length, packet_length_size);
+               if (copy_to_user(&buf[i], packet_length, packet_length_size))
+                       goto out_unlock_msg_ctx;
                i += packet_length_size;
-               rc = copy_to_user(&buf[i], msg_ctx->msg, msg_ctx->msg_size);
-               if (rc) {
-                       printk(KERN_ERR "%s: copy_to_user returned error "
-                              "[%d]\n", __func__, rc);
+               if (copy_to_user(&buf[i], msg_ctx->msg, msg_ctx->msg_size))
                        goto out_unlock_msg_ctx;
-               }
                i += msg_ctx->msg_size;
        }
        rc = i;
@@ -452,7 +449,8 @@ static ssize_t
 ecryptfs_miscdev_write(struct file *file, const char __user *buf,
                       size_t count, loff_t *ppos)
 {
-       u32 counter_nbo, seq;
+       __be32 counter_nbo;
+       u32 seq;
        size_t packet_size, packet_size_length, i;
        ssize_t sz = 0;
        char *data;
@@ -485,7 +483,7 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf,
                               count);
                        goto out_free;
                }
-               memcpy((char *)&counter_nbo, &data[i], 4);
+               memcpy(&counter_nbo, &data[i], 4);
                seq = be32_to_cpu(counter_nbo);
                i += 4;
                rc = ecryptfs_parse_packet_length(&data[i], &packet_size,
index fb77e09..43e9951 100644 (file)
@@ -488,7 +488,12 @@ static struct fuse_conn *new_conn(struct super_block *sb)
                err = bdi_init(&fc->bdi);
                if (err)
                        goto error_kfree;
-               err = bdi_register_dev(&fc->bdi, fc->dev);
+               if (sb->s_bdev) {
+                       err = bdi_register(&fc->bdi, NULL, "%u:%u-fuseblk",
+                                          MAJOR(fc->dev), MINOR(fc->dev));
+               } else {
+                       err = bdi_register_dev(&fc->bdi, fc->dev);
+               }
                if (err)
                        goto error_bdi_destroy;
                /*
index d31bada..07d84d1 100644 (file)
@@ -249,7 +249,7 @@ static int inode_go_lock(struct gfs2_holder *gh)
        struct gfs2_inode *ip = gl->gl_object;
        int error = 0;
 
-       if (!ip)
+       if (!ip || (gh->gh_flags & GL_SKIP))
                return 0;
 
        if (test_bit(GIF_INVALID, &ip->i_flags)) {
index 9c2c0b9..eabe5ea 100644 (file)
@@ -236,6 +236,7 @@ enum {
        GIF_INVALID             = 0,
        GIF_QD_LOCKED           = 1,
        GIF_SW_PAGED            = 3,
+       GIF_USER                = 4, /* user inode, not metadata addr space */
 };
 
 struct gfs2_dinode_host {
index 3a9ef52..09453d0 100644 (file)
@@ -47,8 +47,7 @@ static int iget_test(struct inode *inode, void *opaque)
        struct gfs2_inode *ip = GFS2_I(inode);
        u64 *no_addr = opaque;
 
-       if (ip->i_no_addr == *no_addr &&
-           inode->i_private != NULL)
+       if (ip->i_no_addr == *no_addr && test_bit(GIF_USER, &ip->i_flags))
                return 1;
 
        return 0;
@@ -61,6 +60,7 @@ static int iget_set(struct inode *inode, void *opaque)
 
        inode->i_ino = (unsigned long)*no_addr;
        ip->i_no_addr = *no_addr;
+       set_bit(GIF_USER, &ip->i_flags);
        return 0;
 }
 
@@ -86,7 +86,7 @@ static int iget_skip_test(struct inode *inode, void *opaque)
        struct gfs2_inode *ip = GFS2_I(inode);
        struct gfs2_skip_data *data = opaque;
 
-       if (ip->i_no_addr == data->no_addr && inode->i_private != NULL){
+       if (ip->i_no_addr == data->no_addr && test_bit(GIF_USER, &ip->i_flags)){
                if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE)){
                        data->skipped = 1;
                        return 0;
@@ -105,6 +105,7 @@ static int iget_skip_set(struct inode *inode, void *opaque)
                return 1;
        inode->i_ino = (unsigned long)(data->no_addr);
        ip->i_no_addr = data->no_addr;
+       set_bit(GIF_USER, &ip->i_flags);
        return 0;
 }
 
@@ -166,7 +167,7 @@ void gfs2_set_iop(struct inode *inode)
  * Returns: A VFS inode, or an error
  */
 
-struct inode *gfs2_inode_lookup(struct super_block *sb, 
+struct inode *gfs2_inode_lookup(struct super_block *sb,
                                unsigned int type,
                                u64 no_addr,
                                u64 no_formal_ino, int skip_freeing)
@@ -187,7 +188,6 @@ struct inode *gfs2_inode_lookup(struct super_block *sb,
 
        if (inode->i_state & I_NEW) {
                struct gfs2_sbd *sdp = GFS2_SB(inode);
-               inode->i_private = ip;
                ip->i_no_formal_ino = no_formal_ino;
 
                error = gfs2_glock_get(sdp, no_addr, &gfs2_inode_glops, CREATE, &ip->i_gl);
index 85aea27..78d75f8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
- * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
+ * Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
  *
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
@@ -69,13 +69,15 @@ static const struct address_space_operations aspace_aops = {
 struct inode *gfs2_aspace_get(struct gfs2_sbd *sdp)
 {
        struct inode *aspace;
+       struct gfs2_inode *ip;
 
        aspace = new_inode(sdp->sd_vfs);
        if (aspace) {
                mapping_set_gfp_mask(aspace->i_mapping, GFP_NOFS);
                aspace->i_mapping->a_ops = &aspace_aops;
                aspace->i_size = ~0ULL;
-               aspace->i_private = NULL;
+               ip = GFS2_I(aspace);
+               clear_bit(GIF_USER, &ip->i_flags);
                insert_inode_hash(aspace);
        }
        return aspace;
index ef9c6c4..b2028c8 100644 (file)
@@ -142,8 +142,8 @@ static int init_names(struct gfs2_sbd *sdp, int silent)
        if (!table[0])
                table = sdp->sd_vfs->s_id;
 
-       snprintf(sdp->sd_proto_name, GFS2_FSNAME_LEN, "%s", proto);
-       snprintf(sdp->sd_table_name, GFS2_FSNAME_LEN, "%s", table);
+       strlcpy(sdp->sd_proto_name, proto, GFS2_FSNAME_LEN);
+       strlcpy(sdp->sd_table_name, table, GFS2_FSNAME_LEN);
 
        table = sdp->sd_table_name;
        while ((table = strchr(table, '/')))
index 2278c68..0b7cc92 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
- * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
+ * Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
  *
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
@@ -52,7 +52,7 @@ static int gfs2_write_inode(struct inode *inode, int sync)
        struct gfs2_inode *ip = GFS2_I(inode);
 
        /* Check this is a "normal" inode */
-       if (inode->i_private) {
+       if (test_bit(GIF_USER, &ip->i_flags)) {
                if (current->flags & PF_MEMALLOC)
                        return 0;
                if (sync)
@@ -297,8 +297,9 @@ static int gfs2_remount_fs(struct super_block *sb, int *flags, char *data)
  */
 static void gfs2_drop_inode(struct inode *inode)
 {
-       if (inode->i_private && inode->i_nlink) {
-               struct gfs2_inode *ip = GFS2_I(inode);
+       struct gfs2_inode *ip = GFS2_I(inode);
+
+       if (test_bit(GIF_USER, &ip->i_flags) && inode->i_nlink) {
                struct gfs2_glock *gl = ip->i_iopen_gh.gh_gl;
                if (gl && test_bit(GLF_DEMOTE, &gl->gl_flags))
                        clear_nlink(inode);
@@ -314,12 +315,13 @@ static void gfs2_drop_inode(struct inode *inode)
 
 static void gfs2_clear_inode(struct inode *inode)
 {
+       struct gfs2_inode *ip = GFS2_I(inode);
+
        /* This tells us its a "real" inode and not one which only
         * serves to contain an address space (see rgrp.c, meta_io.c)
         * which therefore doesn't have its own glocks.
         */
-       if (inode->i_private) {
-               struct gfs2_inode *ip = GFS2_I(inode);
+       if (test_bit(GIF_USER, &ip->i_flags)) {
                ip->i_gl->gl_object = NULL;
                gfs2_glock_schedule_for_reclaim(ip->i_gl);
                gfs2_glock_put(ip->i_gl);
@@ -419,7 +421,7 @@ static void gfs2_delete_inode(struct inode *inode)
        struct gfs2_holder gh;
        int error;
 
-       if (!inode->i_private)
+       if (!test_bit(GIF_USER, &ip->i_flags))
                goto out;
 
        error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
index 7e8f0b1..6387523 100644 (file)
@@ -1495,7 +1495,7 @@ u64 gfs2_alloc_block(struct gfs2_inode *ip, unsigned int *n)
 
        al->al_alloced += *n;
 
-       gfs2_statfs_change(sdp, 0, -*n, 0);
+       gfs2_statfs_change(sdp, 0, -(s64)*n, 0);
        gfs2_quota_change(ip, *n, ip->i_inode.i_uid, ip->i_inode.i_gid);
 
        spin_lock(&sdp->sd_rindex_spin);
index 8a1f503..3a982bd 100644 (file)
@@ -3,7 +3,4 @@
 # Licensed under the GPL
 #
 
-hppfs-objs := hppfs.o
-
-obj-y =
-obj-$(CONFIG_HPPFS) += $(hppfs-objs)
+obj-$(CONFIG_HPPFS) += hppfs.o
index 0b3ffa9..4d4760e 100644 (file)
@@ -419,9 +419,9 @@ static int do_probe_callback(void *data)
 out_release_client:
        rpc_shutdown_client(client);
 out_err:
-       put_nfs4_client(clp);
        dprintk("NFSD: warning: no callback path to client %.*s\n",
                (int)clp->cl_name.len, clp->cl_name.data);
+       put_nfs4_client(clp);
        return status;
 }
 
index 9101807..e2f72ca 100644 (file)
@@ -77,11 +77,10 @@ ntfschar *generate_default_upcase(void)
                uc[i] = cpu_to_le16(i);
        for (r = 0; uc_run_table[r][0]; r++)
                for (i = uc_run_table[r][0]; i < uc_run_table[r][1]; i++)
-                       uc[i] = cpu_to_le16(le16_to_cpu(uc[i]) +
-                                       uc_run_table[r][2]);
+                       le16_add_cpu(&uc[i], uc_run_table[r][2]);
        for (r = 0; uc_dup_table[r][0]; r++)
                for (i = uc_dup_table[r][0]; i < uc_dup_table[r][1]; i += 2)
-                       uc[i + 1] = cpu_to_le16(le16_to_cpu(uc[i + 1]) - 1);
+                       le16_add_cpu(&uc[i + 1], -1);
        for (r = 0; uc_word_table[r][0]; r++)
                uc[uc_word_table[r][0]] = cpu_to_le16(uc_word_table[r][1]);
        return uc;
index 41f84c9..10bfb46 100644 (file)
@@ -2788,7 +2788,7 @@ static int ocfs2_merge_rec_right(struct inode *inode,
        BUG_ON(index >= le16_to_cpu(el->l_next_free_rec));
        left_rec = &el->l_recs[index];
 
-       if (index == le16_to_cpu(el->l_next_free_rec - 1) &&
+       if (index == le16_to_cpu(el->l_next_free_rec) - 1 &&
            le16_to_cpu(el->l_next_free_rec) == le16_to_cpu(el->l_count)) {
                /* we meet with a cross extent block merge. */
                ret = ocfs2_get_right_path(inode, left_path, &right_path);
@@ -2802,7 +2802,7 @@ static int ocfs2_merge_rec_right(struct inode *inode,
                BUG_ON(next_free <= 0);
                right_rec = &right_el->l_recs[0];
                if (ocfs2_is_empty_extent(right_rec)) {
-                       BUG_ON(le16_to_cpu(next_free) <= 1);
+                       BUG_ON(next_free <= 1);
                        right_rec = &right_el->l_recs[1];
                }
 
index 6f4e8dc..b08d100 100644 (file)
@@ -425,7 +425,8 @@ struct inode *proc_get_inode(struct super_block *sb, unsigned int ino,
                        }
                }
                unlock_new_inode(inode);
-       }
+       } else
+              module_put(de->owner);
        return inode;
 
 out_ino:
index 74a323d..32dc14c 100644 (file)
@@ -139,7 +139,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
 #define K(x) ((x) << (PAGE_SHIFT - 10))
        si_meminfo(&i);
        si_swapinfo(&i);
-       committed = atomic_read(&vm_committed_space);
+       committed = atomic_long_read(&vm_committed_space);
        allowed = ((totalram_pages - hugetlb_total_pages())
                * sysctl_overcommit_ratio / 100) + total_swap_pages;
 
index a1c3a1f..8c0e4b9 100644 (file)
@@ -419,12 +419,8 @@ void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt,
  */
 int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd)
 {
-       if (sysfs_find_dirent(acxt->parent_sd, sd->s_name)) {
-               printk(KERN_WARNING "sysfs: duplicate filename '%s' "
-                      "can not be created\n", sd->s_name);
-               WARN_ON(1);
+       if (sysfs_find_dirent(acxt->parent_sd, sd->s_name))
                return -EEXIST;
-       }
 
        sd->s_parent = sysfs_get(acxt->parent_sd);
 
index 5105015..98e0e86 100644 (file)
@@ -387,6 +387,8 @@ _xfs_buf_lookup_pages(
                if (unlikely(page == NULL)) {
                        if (flags & XBF_READ_AHEAD) {
                                bp->b_page_count = i;
+                               for (i = 0; i < bp->b_page_count; i++)
+                                       unlock_page(bp->b_pages[i]);
                                return -ENOMEM;
                        }
 
@@ -416,17 +418,24 @@ _xfs_buf_lookup_pages(
                ASSERT(!PagePrivate(page));
                if (!PageUptodate(page)) {
                        page_count--;
-                       if (blocksize < PAGE_CACHE_SIZE && !PagePrivate(page)) {
+                       if (blocksize >= PAGE_CACHE_SIZE) {
+                               if (flags & XBF_READ)
+                                       bp->b_flags |= _XBF_PAGE_LOCKED;
+                       } else if (!PagePrivate(page)) {
                                if (test_page_region(page, offset, nbytes))
                                        page_count++;
                        }
                }
 
-               unlock_page(page);
                bp->b_pages[i] = page;
                offset = 0;
        }
 
+       if (!(bp->b_flags & _XBF_PAGE_LOCKED)) {
+               for (i = 0; i < bp->b_page_count; i++)
+                       unlock_page(bp->b_pages[i]);
+       }
+
        if (page_count == bp->b_page_count)
                bp->b_flags |= XBF_DONE;
 
@@ -746,6 +755,7 @@ xfs_buf_associate_memory(
        bp->b_count_desired = len;
        bp->b_buffer_length = buflen;
        bp->b_flags |= XBF_MAPPED;
+       bp->b_flags &= ~_XBF_PAGE_LOCKED;
 
        return 0;
 }
@@ -1093,8 +1103,10 @@ _xfs_buf_ioend(
        xfs_buf_t               *bp,
        int                     schedule)
 {
-       if (atomic_dec_and_test(&bp->b_io_remaining) == 1)
+       if (atomic_dec_and_test(&bp->b_io_remaining) == 1) {
+               bp->b_flags &= ~_XBF_PAGE_LOCKED;
                xfs_buf_ioend(bp, schedule);
+       }
 }
 
 STATIC void
@@ -1125,6 +1137,9 @@ xfs_buf_bio_end_io(
 
                if (--bvec >= bio->bi_io_vec)
                        prefetchw(&bvec->bv_page->flags);
+
+               if (bp->b_flags & _XBF_PAGE_LOCKED)
+                       unlock_page(page);
        } while (bvec >= bio->bi_io_vec);
 
        _xfs_buf_ioend(bp, 1);
@@ -1163,7 +1178,8 @@ _xfs_buf_ioapply(
         * filesystem block size is not smaller than the page size.
         */
        if ((bp->b_buffer_length < PAGE_CACHE_SIZE) &&
-           (bp->b_flags & XBF_READ) &&
+           ((bp->b_flags & (XBF_READ|_XBF_PAGE_LOCKED)) ==
+             (XBF_READ|_XBF_PAGE_LOCKED)) &&
            (blocksize >= PAGE_CACHE_SIZE)) {
                bio = bio_alloc(GFP_NOIO, 1);
 
index 841d788..f948ec7 100644 (file)
@@ -66,6 +66,25 @@ typedef enum {
        _XBF_PAGES = (1 << 18),     /* backed by refcounted pages          */
        _XBF_RUN_QUEUES = (1 << 19),/* run block device task queue         */
        _XBF_DELWRI_Q = (1 << 21),   /* buffer on delwri queue             */
+
+       /*
+        * Special flag for supporting metadata blocks smaller than a FSB.
+        *
+        * In this case we can have multiple xfs_buf_t on a single page and
+        * need to lock out concurrent xfs_buf_t readers as they only
+        * serialise access to the buffer.
+        *
+        * If the FSB size >= PAGE_CACHE_SIZE case, we have no serialisation
+        * between reads of the page. Hence we can have one thread read the
+        * page and modify it, but then race with another thread that thinks
+        * the page is not up-to-date and hence reads it again.
+        *
+        * The result is that the first modifcation to the page is lost.
+        * This sort of AGF/AGI reading race can happen when unlinking inodes
+        * that require truncation and results in the AGI unlinked list
+        * modifications being lost.
+        */
+       _XBF_PAGE_LOCKED = (1 << 22),
 } xfs_buf_flags_t;
 
 typedef enum {
index 65e78c1..5f60363 100644 (file)
@@ -184,19 +184,24 @@ xfs_file_release(
        return -xfs_release(XFS_I(inode));
 }
 
+/*
+ * We ignore the datasync flag here because a datasync is effectively
+ * identical to an fsync. That is, datasync implies that we need to write
+ * only the metadata needed to be able to access the data that is written
+ * if we crash after the call completes. Hence if we are writing beyond
+ * EOF we have to log the inode size change as well, which makes it a
+ * full fsync. If we don't write beyond EOF, the inode core will be
+ * clean in memory and so we don't need to log the inode, just like
+ * fsync.
+ */
 STATIC int
 xfs_file_fsync(
        struct file     *filp,
        struct dentry   *dentry,
        int             datasync)
 {
-       int             flags = FSYNC_WAIT;
-
-       if (datasync)
-               flags |= FSYNC_DATA;
        xfs_iflags_clear(XFS_I(dentry->d_inode), XFS_ITRUNCATED);
-       return -xfs_fsync(XFS_I(dentry->d_inode), flags,
-                       (xfs_off_t)0, (xfs_off_t)-1);
+       return -xfs_fsync(XFS_I(dentry->d_inode));
 }
 
 /*
index 9d73cb5..25eb2a9 100644 (file)
@@ -230,14 +230,6 @@ static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt)
 #define ATTR_NOSIZETOK 0x400   /* Don't get the SIZE token */
 
 /*
- * Flags to vop_fsync/reclaim.
- */
-#define FSYNC_NOWAIT   0       /* asynchronous flush */
-#define FSYNC_WAIT     0x1     /* synchronous fsync or forced reclaim */
-#define FSYNC_INVAL    0x2     /* flush and invalidate cached data */
-#define FSYNC_DATA     0x4     /* synchronous fsync of data only */
-
-/*
  * Tracking vnode activity.
  */
 #if defined(XFS_INODE_TRACE)
index cf0bb9c..e569bf5 100644 (file)
@@ -2974,6 +2974,7 @@ xfs_iflush_cluster(
        xfs_mount_t             *mp = ip->i_mount;
        xfs_perag_t             *pag = xfs_get_perag(mp, ip->i_ino);
        unsigned long           first_index, mask;
+       unsigned long           inodes_per_cluster;
        int                     ilist_size;
        xfs_inode_t             **ilist;
        xfs_inode_t             *iq;
@@ -2985,8 +2986,9 @@ xfs_iflush_cluster(
        ASSERT(pag->pagi_inodeok);
        ASSERT(pag->pag_ici_init);
 
-       ilist_size = XFS_INODE_CLUSTER_SIZE(mp) * sizeof(xfs_inode_t *);
-       ilist = kmem_alloc(ilist_size, KM_MAYFAIL);
+       inodes_per_cluster = XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog;
+       ilist_size = inodes_per_cluster * sizeof(xfs_inode_t *);
+       ilist = kmem_alloc(ilist_size, KM_MAYFAIL|KM_NOFS);
        if (!ilist)
                return 0;
 
@@ -2995,8 +2997,7 @@ xfs_iflush_cluster(
        read_lock(&pag->pag_ici_lock);
        /* really need a gang lookup range call here */
        nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, (void**)ilist,
-                                       first_index,
-                                       XFS_INODE_CLUSTER_SIZE(mp));
+                                       first_index, inodes_per_cluster);
        if (nr_found == 0)
                goto out_free;
 
index 70702a6..e475e37 100644 (file)
@@ -856,18 +856,14 @@ xfs_readlink(
 /*
  * xfs_fsync
  *
- * This is called to sync the inode and its data out to disk.
- * We need to hold the I/O lock while flushing the data, and
- * the inode lock while flushing the inode.  The inode lock CANNOT
- * be held while flushing the data, so acquire after we're done
- * with that.
+ * This is called to sync the inode and its data out to disk.  We need to hold
+ * the I/O lock while flushing the data, and the inode lock while flushing the
+ * inode.  The inode lock CANNOT be held while flushing the data, so acquire
+ * after we're done with that.
  */
 int
 xfs_fsync(
-       xfs_inode_t     *ip,
-       int             flag,
-       xfs_off_t       start,
-       xfs_off_t       stop)
+       xfs_inode_t     *ip)
 {
        xfs_trans_t     *tp;
        int             error;
@@ -875,103 +871,79 @@ xfs_fsync(
 
        xfs_itrace_entry(ip);
 
-       ASSERT(start >= 0 && stop >= -1);
-
        if (XFS_FORCED_SHUTDOWN(ip->i_mount))
                return XFS_ERROR(EIO);
 
-       if (flag & FSYNC_DATA)
-               filemap_fdatawait(vn_to_inode(XFS_ITOV(ip))->i_mapping);
+       /* capture size updates in I/O completion before writing the inode. */
+       error = filemap_fdatawait(vn_to_inode(XFS_ITOV(ip))->i_mapping);
+       if (error)
+               return XFS_ERROR(error);
 
        /*
-        * We always need to make sure that the required inode state
-        * is safe on disk.  The vnode might be clean but because
-        * of committed transactions that haven't hit the disk yet.
-        * Likewise, there could be unflushed non-transactional
-        * changes to the inode core that have to go to disk.
+        * We always need to make sure that the required inode state is safe on
+        * disk.  The vnode might be clean but we still might need to force the
+        * log because of committed transactions that haven't hit the disk yet.
+        * Likewise, there could be unflushed non-transactional changes to the
+        * inode core that have to go to disk and this requires us to issue
+        * a synchronous transaction to capture these changes correctly.
         *
-        * The following code depends on one assumption:  that
-        * any transaction that changes an inode logs the core
-        * because it has to change some field in the inode core
-        * (typically nextents or nblocks).  That assumption
-        * implies that any transactions against an inode will
-        * catch any non-transactional updates.  If inode-altering
-        * transactions exist that violate this assumption, the
-        * code breaks.  Right now, it figures that if the involved
-        * update_* field is clear and the inode is unpinned, the
-        * inode is clean.  Either it's been flushed or it's been
-        * committed and the commit has hit the disk unpinning the inode.
-        * (Note that xfs_inode_item_format() called at commit clears
-        * the update_* fields.)
+        * This code relies on the assumption that if the update_* fields
+        * of the inode are clear and the inode is unpinned then it is clean
+        * and no action is required.
         */
        xfs_ilock(ip, XFS_ILOCK_SHARED);
 
-       /* If we are flushing data then we care about update_size
-        * being set, otherwise we care about update_core
-        */
-       if ((flag & FSYNC_DATA) ?
-                       (ip->i_update_size == 0) :
-                       (ip->i_update_core == 0)) {
+       if (!(ip->i_update_size || ip->i_update_core)) {
                /*
-                * Timestamps/size haven't changed since last inode
-                * flush or inode transaction commit.  That means
-                * either nothing got written or a transaction
-                * committed which caught the updates.  If the
-                * latter happened and the transaction hasn't
-                * hit the disk yet, the inode will be still
-                * be pinned.  If it is, force the log.
+                * Timestamps/size haven't changed since last inode flush or
+                * inode transaction commit.  That means either nothing got
+                * written or a transaction committed which caught the updates.
+                * If the latter happened and the transaction hasn't hit the
+                * disk yet, the inode will be still be pinned.  If it is,
+                * force the log.
                 */
 
                xfs_iunlock(ip, XFS_ILOCK_SHARED);
 
                if (xfs_ipincount(ip)) {
-                       _xfs_log_force(ip->i_mount, (xfs_lsn_t)0,
-                                     XFS_LOG_FORCE |
-                                     ((flag & FSYNC_WAIT)
-                                      ? XFS_LOG_SYNC : 0),
+                       error = _xfs_log_force(ip->i_mount, (xfs_lsn_t)0,
+                                     XFS_LOG_FORCE | XFS_LOG_SYNC,
                                      &log_flushed);
                } else {
                        /*
-                        * If the inode is not pinned and nothing
-                        * has changed we don't need to flush the
-                        * cache.
+                        * If the inode is not pinned and nothing has changed
+                        * we don't need to flush the cache.
                         */
                        changed = 0;
                }
-               error = 0;
        } else  {
                /*
-                * Kick off a transaction to log the inode
-                * core to get the updates.  Make it
-                * sync if FSYNC_WAIT is passed in (which
-                * is done by everybody but specfs).  The
-                * sync transaction will also force the log.
+                * Kick off a transaction to log the inode core to get the
+                * updates.  The sync transaction will also force the log.
                 */
                xfs_iunlock(ip, XFS_ILOCK_SHARED);
                tp = xfs_trans_alloc(ip->i_mount, XFS_TRANS_FSYNC_TS);
-               if ((error = xfs_trans_reserve(tp, 0,
-                               XFS_FSYNC_TS_LOG_RES(ip->i_mount),
-                               0, 0, 0)))  {
+               error = xfs_trans_reserve(tp, 0,
+                               XFS_FSYNC_TS_LOG_RES(ip->i_mount), 0, 0, 0);
+               if (error) {
                        xfs_trans_cancel(tp, 0);
                        return error;
                }
                xfs_ilock(ip, XFS_ILOCK_EXCL);
 
                /*
-                * Note - it's possible that we might have pushed
-                * ourselves out of the way during trans_reserve
-                * which would flush the inode.  But there's no
-                * guarantee that the inode buffer has actually
-                * gone out yet (it's delwri).  Plus the buffer
-                * could be pinned anyway if it's part of an
-                * inode in another recent transaction.  So we
-                * play it safe and fire off the transaction anyway.
+                * Note - it's possible that we might have pushed ourselves out
+                * of the way during trans_reserve which would flush the inode.
+                * But there's no guarantee that the inode buffer has actually
+                * gone out yet (it's delwri).  Plus the buffer could be pinned
+                * anyway if it's part of an inode in another recent
+                * transaction.  So we play it safe and fire off the
+                * transaction anyway.
                 */
                xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
                xfs_trans_ihold(tp, ip);
                xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
-               if (flag & FSYNC_WAIT)
-                       xfs_trans_set_sync(tp);
+               xfs_trans_set_sync(tp);
                error = _xfs_trans_commit(tp, 0, &log_flushed);
 
                xfs_iunlock(ip, XFS_ILOCK_EXCL);
index 8abe8f1..57335ba 100644 (file)
@@ -18,8 +18,7 @@ int xfs_open(struct xfs_inode *ip);
 int xfs_setattr(struct xfs_inode *ip, struct bhv_vattr *vap, int flags,
                struct cred *credp);
 int xfs_readlink(struct xfs_inode *ip, char *link);
-int xfs_fsync(struct xfs_inode *ip, int flag, xfs_off_t start,
-               xfs_off_t stop);
+int xfs_fsync(struct xfs_inode *ip);
 int xfs_release(struct xfs_inode *ip);
 int xfs_inactive(struct xfs_inode *ip);
 int xfs_lookup(struct xfs_inode *dp, struct xfs_name *name,
index cd22035..6fac2c8 100644 (file)
@@ -14,8 +14,6 @@
 #ifndef __OMAP_BOARD_PALMTE_H
 #define __OMAP_BOARD_PALMTE_H
 
-#include <asm/arch/gpio.h>
-
 #define PALMTE_USBDETECT_GPIO  0
 #define PALMTE_USB_OR_DC_GPIO  1
 #define PALMTE_TSC_GPIO                4
index 57523bd..12a5e4d 100644 (file)
@@ -73,6 +73,8 @@ struct clk {
 #endif
 };
 
+struct cpufreq_frequency_table;
+
 struct clk_functions {
        int             (*clk_enable)(struct clk *clk);
        void            (*clk_disable)(struct clk *clk);
@@ -83,6 +85,9 @@ struct clk_functions {
        void            (*clk_allow_idle)(struct clk *clk);
        void            (*clk_deny_idle)(struct clk *clk);
        void            (*clk_disable_unused)(struct clk *clk);
+#ifdef CONFIG_CPU_FREQ
+       void            (*clk_init_cpufreq_table)(struct cpufreq_frequency_table **);
+#endif
 };
 
 extern unsigned int mpurate;
index 74cd572..369093a 100644 (file)
@@ -8,6 +8,7 @@
  * warranty of any kind, whether express or implied.
  */
 #include <asm/hardware.h>
+#include <asm/arch/io.h>
 #include <asm/arch/irqs.h>
 
 #if defined(CONFIG_ARCH_OMAP1)
index 86621a0..5ee6a49 100644 (file)
@@ -26,7 +26,6 @@
 #ifndef __ASM_ARCH_OMAP_GPIO_H
 #define __ASM_ARCH_OMAP_GPIO_H
 
-#include <asm/hardware.h>
 #include <asm/arch/irqs.h>
 #include <asm/io.h>
 
index da57209..91d85b3 100644 (file)
@@ -41,7 +41,6 @@
 #include <asm/types.h>
 #include <asm/arch/cpu.h>
 #endif
-#include <asm/arch/io.h>
 #include <asm/arch/serial.h>
 
 /*
index 14a344a..762eba5 100644 (file)
 
 #define COLLIE_GPIO_ON_KEY             GPIO_GPIO (0)
 #define COLLIE_GPIO_AC_IN              GPIO_GPIO (1)
+#define COLLIE_GPIO_SDIO_INT           GPIO_GPIO (11)
 #define COLLIE_GPIO_CF_IRQ             GPIO_GPIO (14)
 #define COLLIE_GPIO_nREMOCON_INT       GPIO_GPIO (15)
 #define COLLIE_GPIO_UCB1x00_RESET      GPIO_GPIO (16)
+#define COLLIE_GPIO_nMIC_ON            GPIO_GPIO (17)
+#define COLLIE_GPIO_nREMOCON_ON                GPIO_GPIO (18)
 #define COLLIE_GPIO_CO                 GPIO_GPIO (20)
 #define COLLIE_GPIO_MCP_CLK            GPIO_GPIO (21)
 #define COLLIE_GPIO_CF_CD              GPIO_GPIO (22)
@@ -49,6 +52,7 @@
 
 #define COLLIE_IRQ_GPIO_ON_KEY         IRQ_GPIO0
 #define COLLIE_IRQ_GPIO_AC_IN          IRQ_GPIO1
+#define COLLIE_IRQ_GPIO_SDIO_IRQ       IRQ_GPIO11
 #define COLLIE_IRQ_GPIO_CF_IRQ         IRQ_GPIO14
 #define COLLIE_IRQ_GPIO_nREMOCON_INT   IRQ_GPIO15
 #define COLLIE_IRQ_GPIO_CO             IRQ_GPIO20
index 5c22b01..8e05bdb 100644 (file)
@@ -179,10 +179,10 @@ typedef unsigned long pgprot_t;
 
 #endif /* STRICT_MM_TYPECHECKS */
 
-typedef struct page *pgtable_t;
-
 #endif /* CONFIG_MMU */
 
+typedef struct page *pgtable_t;
+
 #include <asm/memory.h>
 
 #endif /* !__ASSEMBLY__ */
index 6335de9..514af79 100644 (file)
 #define CPUID_TCM      2
 #define CPUID_TLBTYPE  3
 
-#ifdef CONFIG_CPU_CP15
-#define read_cpuid(reg)                                                        \
-       ({                                                              \
-               unsigned int __val;                                     \
-               asm("mrc        p15, 0, %0, c0, c0, " __stringify(reg)  \
-                   : "=r" (__val)                                      \
-                   :                                                   \
-                   : "cc");                                            \
-               __val;                                                  \
-       })
-#else
-#define read_cpuid(reg) (processor_id)
-#endif
-
 /*
  * This is used to ensure the compiler did actually allocate the register we
  * asked it for some inline assembly sequences.  Apparently we can't trust
 #include <linux/stringify.h>
 #include <linux/irqflags.h>
 
+#ifdef CONFIG_CPU_CP15
+#define read_cpuid(reg)                                                        \
+       ({                                                              \
+               unsigned int __val;                                     \
+               asm("mrc        p15, 0, %0, c0, c0, " __stringify(reg)  \
+                   : "=r" (__val)                                      \
+                   :                                                   \
+                   : "cc");                                            \
+               __val;                                                  \
+       })
+#else
+extern unsigned int processor_id;
+#define read_cpuid(reg) (processor_id)
+#endif
+
 /*
  * The CPU ID never changes at run time, so we might as well tell the
  * compiler that it's constant.  Use this function to read the CPU ID
index ecf675a..6be061d 100644 (file)
@@ -1,8 +1,12 @@
 #ifndef _ASM_GENERIC_GPIO_H
 #define _ASM_GENERIC_GPIO_H
 
+#include <linux/types.h>
+
 #ifdef CONFIG_HAVE_GPIO_LIB
 
+#include <linux/compiler.h>
+
 /* Platforms may implement their GPIO interface with library code,
  * at a small performance cost for non-inlined operations and some
  * extra memory (for code and for per-GPIO table entries).
@@ -74,7 +78,7 @@ struct gpio_chip {
 
 extern const char *gpiochip_is_requested(struct gpio_chip *chip,
                        unsigned offset);
-extern int __init __must_check gpiochip_reserve(int start, int ngpio);
+extern int __must_check gpiochip_reserve(int start, int ngpio);
 
 /* add/remove chips */
 extern int gpiochip_add(struct gpio_chip *chip);
index 01b2f92..3a492f2 100644 (file)
 
 #define GIC_SH_RMASK_OFS               0x0300
 #define GIC_CLR_INTR_MASK(intr, val) \
-       GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), ((val) << ((intr) % 32))
+       GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), ((val) << ((intr) % 32)))
 
 /* Register Map for Local Section */
 #define GIC_VPE_CTL_OFS                        0x0000
index 363a14e..1b5064d 100644 (file)
@@ -1036,7 +1036,7 @@ enum soc_au1200_ints {
 #define USBD_INTSTAT           0xB020001C
 #  define USBDEV_INT_SOF       (1 << 12)
 #  define USBDEV_INT_HF_BIT    6
-#  define USBDEV_INT_HF_MASK   0x3f << USBDEV_INT_HF_BIT)
+#  define USBDEV_INT_HF_MASK   (0x3f << USBDEV_INT_HF_BIT)
 #  define USBDEV_INT_CMPLT_BIT 0
 #  define USBDEV_INT_CMPLT_MASK (0x3f << USBDEV_INT_CMPLT_BIT)
 #define USBD_CONFIG            0xB0200020
index 943c5a3..a4d0f87 100644 (file)
@@ -428,12 +428,11 @@ extern void mpic_init(struct mpic *mpic);
  */
 
 
-/* Change/Read the priority of an interrupt. Default is 8 for irqs and
+/* Change the priority of an interrupt. Default is 8 for irqs and
  * 10 for IPIs. You can call this on both IPIs and IRQ numbers, but the
  * IPI number is then the offset'ed (linux irq number mapped to the IPI)
  */
 extern void mpic_irq_set_priority(unsigned int irq, unsigned int pri);
-extern unsigned int mpic_irq_get_priority(unsigned int irq);
 
 /* Setup a non-boot CPU */
 extern void mpic_setup_this_cpu(void);
index b381f4a..dc936dd 100644 (file)
 
 #ifdef __KERNEL__
 
-#define PHYSICAL_PAGE_MASK     (PAGE_MASK & __PHYSICAL_MASK)
-#define PTE_MASK               (_AT(long, PHYSICAL_PAGE_MASK))
+#define __PHYSICAL_MASK                ((phys_addr_t)(1ULL << __PHYSICAL_MASK_SHIFT) - 1)
+#define __VIRTUAL_MASK         ((1UL << __VIRTUAL_MASK_SHIFT) - 1)
+
+/* Cast PAGE_MASK to a signed type so that it is sign-extended if
+   virtual addresses are 32-bits but physical addresses are larger
+   (ie, 32-bit PAE). */
+#define PHYSICAL_PAGE_MASK     (((signed long)PAGE_MASK) & __PHYSICAL_MASK)
+
+/* PTE_MASK extracts the PFN from a (pte|pmd|pud|pgd)val_t */
+#define PTE_MASK               ((pteval_t)PHYSICAL_PAGE_MASK)
 
 #define PMD_PAGE_SIZE          (_AC(1, UL) << PMD_SHIFT)
 #define PMD_PAGE_MASK          (~(PMD_PAGE_SIZE-1))
@@ -24,9 +32,6 @@
 /* to align the pointer to the (next) page boundary */
 #define PAGE_ALIGN(addr)       (((addr)+PAGE_SIZE-1)&PAGE_MASK)
 
-#define __PHYSICAL_MASK                _AT(phys_addr_t, (_AC(1,ULL) << __PHYSICAL_MASK_SHIFT) - 1)
-#define __VIRTUAL_MASK         ((_AC(1,UL) << __VIRTUAL_MASK_SHIFT) - 1)
-
 #ifndef __ASSEMBLY__
 #include <linux/types.h>
 #endif
index 8b4a9d4..c93dbb6 100644 (file)
@@ -120,9 +120,9 @@ static inline void pud_clear(pud_t *pudp)
                write_cr3(pgd);
 }
 
-#define pud_page(pud) ((struct page *) __va(pud_val(pud) & PAGE_MASK))
+#define pud_page(pud) ((struct page *) __va(pud_val(pud) & PTE_MASK))
 
-#define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PAGE_MASK))
+#define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PTE_MASK))
 
 
 /* Find an entry in the second-level page table.. */
@@ -160,7 +160,7 @@ static inline int pte_none(pte_t pte)
 
 static inline unsigned long pte_pfn(pte_t pte)
 {
-       return (pte_val(pte) & ~_PAGE_NX) >> PAGE_SHIFT;
+       return (pte_val(pte) & PTE_MASK) >> PAGE_SHIFT;
 }
 
 /*
index 55c3a0e..97c271b 100644 (file)
@@ -57,6 +57,7 @@
 #define _KERNPG_TABLE  (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED |    \
                         _PAGE_DIRTY)
 
+/* Set of bits not changed in pte_modify */
 #define _PAGE_CHG_MASK (PTE_MASK | _PAGE_PCD | _PAGE_PWT |             \
                         _PAGE_ACCESSED | _PAGE_DIRTY)
 
@@ -304,7 +305,7 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
        return __pgprot(preservebits | addbits);
 }
 
-#define pte_pgprot(x) __pgprot(pte_val(x) & (0xfff | _PAGE_NX))
+#define pte_pgprot(x) __pgprot(pte_val(x) & ~PTE_MASK)
 
 #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask)
 
index d7f0403..32ca031 100644 (file)
@@ -88,7 +88,7 @@ extern unsigned long pg0[];
 /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */
 #define pmd_none(x)    (!(unsigned long)pmd_val((x)))
 #define pmd_present(x) (pmd_val((x)) & _PAGE_PRESENT)
-#define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
+#define pmd_bad(x) ((pmd_val(x) & (~PTE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
 
 #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
 
@@ -159,7 +159,7 @@ static inline int pud_large(pud_t pud) { return 0; }
 #define pmd_page(pmd) (pfn_to_page(pmd_val((pmd)) >> PAGE_SHIFT))
 
 #define pmd_page_vaddr(pmd)                                    \
-       ((unsigned long)__va(pmd_val((pmd)) & PAGE_MASK))
+       ((unsigned long)__va(pmd_val((pmd)) & PTE_MASK))
 
 #if defined(CONFIG_HIGHPTE)
 #define pte_offset_map(dir, address)                                   \
index efe83dc..1cc50d2 100644 (file)
@@ -151,19 +151,19 @@ static inline void native_pgd_clear(pgd_t *pgd)
 
 #ifndef __ASSEMBLY__
 
-static inline unsigned long pgd_bad(pgd_t pgd)
+static inline int pgd_bad(pgd_t pgd)
 {
-       return pgd_val(pgd) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER);
+       return (pgd_val(pgd) & ~(PTE_MASK | _PAGE_USER)) != _KERNPG_TABLE;
 }
 
-static inline unsigned long pud_bad(pud_t pud)
+static inline int pud_bad(pud_t pud)
 {
-       return pud_val(pud) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER);
+       return (pud_val(pud) & ~(PTE_MASK | _PAGE_USER)) != _KERNPG_TABLE;
 }
 
-static inline unsigned long pmd_bad(pmd_t pmd)
+static inline int pmd_bad(pmd_t pmd)
 {
-       return pmd_val(pmd) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER);
+       return (pmd_val(pmd) & ~(PTE_MASK | _PAGE_USER)) != _KERNPG_TABLE;
 }
 
 #define pte_none(x)    (!pte_val((x)))
index 0c0674d..35c76ce 100644 (file)
@@ -22,12 +22,23 @@ static inline void __native_flush_tlb(void)
 
 static inline void __native_flush_tlb_global(void)
 {
-       unsigned long cr4 = read_cr4();
+       unsigned long flags;
+       unsigned long cr4;
 
+       /*
+        * Read-modify-write to CR4 - protect it from preemption and
+        * from interrupts. (Use the raw variant because this code can
+        * be called from deep inside debugging code.)
+        */
+       raw_local_irq_save(flags);
+
+       cr4 = read_cr4();
        /* clear PGE */
        write_cr4(cr4 & ~X86_CR4_PGE);
        /* write old PGE again and flush TLBs */
        write_cr4(cr4);
+
+       raw_local_irq_restore(flags);
 }
 
 static inline void __native_flush_tlb_single(unsigned long addr)
index 0179930..baf3a4d 100644 (file)
@@ -127,7 +127,7 @@ static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn)
 
 static inline unsigned long pte_mfn(pte_t pte)
 {
-       return (pte.pte & ~_PAGE_NX) >> PAGE_SHIFT;
+       return (pte.pte & PTE_MASK) >> PAGE_SHIFT;
 }
 
 static inline pte_t mfn_pte(unsigned long page_nr, pgprot_t pgprot)
index 5dfa739..93b9885 100644 (file)
@@ -92,7 +92,6 @@ header-y += if_slip.h
 header-y += if_strip.h
 header-y += if_tun.h
 header-y += if_tunnel.h
-header-y += in6.h
 header-y += in_route.h
 header-y += ioctl.h
 header-y += ip6_tunnel.h
@@ -236,6 +235,7 @@ unifdef-y += if_vlan.h
 unifdef-y += igmp.h
 unifdef-y += inet_diag.h
 unifdef-y += in.h
+unifdef-y += in6.h
 unifdef-y += inotify.h
 unifdef-y += input.h
 unifdef-y += ip.h
index 6013668..c791ddd 100644 (file)
  * documentation. Do not change them.
  */
 
-#ifdef __KERNEL__
-#include <linux/socket.h>
-#include <linux/types.h>
-#endif
 #include <linux/compiler.h>
 #include <linux/atmapi.h>
 #include <linux/atmsap.h>
 #include <linux/atmioc.h>
+#include <linux/types.h>
 
 
 /* general ATM constants */
@@ -212,7 +209,7 @@ struct sockaddr_atmsvc {
         char           pub[ATM_E164_LEN+1]; /* public address (E.164) */
                                        /* unused addresses must be bzero'ed */
        char            lij_type;       /* role in LIJ call; one of ATM_LIJ* */
-       uint32_t        lij_id;         /* LIJ call identifier */
+       __u32   lij_id;         /* LIJ call identifier */
     } sas_addr __ATM_API_ALIGN;                /* SVC address */
 };
 
index 18787f9..375638f 100644 (file)
@@ -8,11 +8,9 @@
 #define LINUX_ATM_TCP_H
 
 #include <linux/atmapi.h>
-
-#ifdef __KERNEL__
-#include <linux/types.h>
-#endif
+#include <linux/atm.h>
 #include <linux/atmioc.h>
+#include <linux/types.h>
 
 
 /*
@@ -20,9 +18,9 @@
  */
 
 struct atmtcp_hdr {
-       uint16_t        vpi;
-       uint16_t        vci;
-       uint32_t        length;         /* ... of data part */
+       __u16   vpi;
+       __u16   vci;
+       __u32   length;         /* ... of data part */
 };
 
 /*
index 15e9fa3..14616e8 100644 (file)
@@ -449,9 +449,21 @@ extern int __must_check device_reprobe(struct device *dev);
 /*
  * Easy functions for dynamically creating devices on the fly
  */
+extern struct device *device_create_vargs(struct class *cls,
+                                         struct device *parent,
+                                         dev_t devt,
+                                         void *drvdata,
+                                         const char *fmt,
+                                         va_list vargs);
 extern struct device *device_create(struct class *cls, struct device *parent,
                                    dev_t devt, const char *fmt, ...)
                                    __attribute__((format(printf, 4, 5)));
+extern struct device *device_create_drvdata(struct class *cls,
+                                           struct device *parent,
+                                           dev_t devt,
+                                           void *drvdata,
+                                           const char *fmt, ...)
+                                   __attribute__((format(printf, 5, 6)));
 extern void device_destroy(struct class *cls, dev_t devt);
 
 /*
index 4987a84..98be6c5 100644 (file)
@@ -8,6 +8,9 @@
 
 #else
 
+#include <linux/types.h>
+#include <linux/errno.h>
+
 /*
  * Some platforms don't support the GPIO programming interface.
  *
index 4ce3b7a..fe56b86 100644 (file)
@@ -2,8 +2,6 @@
 #define __HID_H
 
 /*
- * $Id: hid.h,v 1.24 2001/12/27 10:37:41 vojtech Exp $
- *
  *  Copyright (c) 1999 Andreas Gal
  *  Copyright (c) 2000-2001 Vojtech Pavlik
  *  Copyright (c) 2006-2007 Jiri Kosina
@@ -285,6 +283,7 @@ struct hid_item {
 #define HID_QUIRK_HWHEEL_WHEEL_INVERT          0x04000000
 #define HID_QUIRK_MICROSOFT_KEYS               0x08000000
 #define HID_QUIRK_FULLSPEED_INTERVAL           0x10000000
+#define HID_QUIRK_APPLE_NUMLOCK_EMULATION      0x20000000
 
 /*
  * Separate quirks for runtime report descriptor fixup
index acbdae6..a416b90 100644 (file)
@@ -2,8 +2,6 @@
 #define _HIDDEV_H
 
 /*
- * $Id: hiddev.h,v 1.2 2001/04/26 11:26:09 vojtech Exp $
- *
  *  Copyright (c) 1999-2000 Vojtech Pavlik
  *
  *  Sponsored by SuSE
index 87920a0..dab8892 100644 (file)
 
 extern int sysctl_overcommit_memory;
 extern int sysctl_overcommit_ratio;
-extern atomic_t vm_committed_space;
+extern atomic_long_t vm_committed_space;
 
 #ifdef CONFIG_SMP
 extern void vm_acct_memory(long pages);
 #else
 static inline void vm_acct_memory(long pages)
 {
-       atomic_add(pages, &vm_committed_space);
+       atomic_long_add(pages, &vm_committed_space);
 }
 #endif
 
index c463cd8..443bc7c 100644 (file)
@@ -703,7 +703,7 @@ extern struct pglist_data *next_online_pgdat(struct pglist_data *pgdat);
 extern struct zone *next_zone(struct zone *zone);
 
 /**
- * for_each_pgdat - helper macro to iterate over all nodes
+ * for_each_online_pgdat - helper macro to iterate over all online nodes
  * @pgdat - pointer to a pg_data_t variable
  */
 #define for_each_online_pgdat(pgdat)                   \
index b11e6e1..f27fd20 100644 (file)
@@ -745,6 +745,9 @@ struct net_device
        /* rtnetlink link ops */
        const struct rtnl_link_ops *rtnl_link_ops;
 
+       /* VLAN feature mask */
+       unsigned long vlan_features;
+
        /* for setting kernel sock attribute on TCP connection setup */
 #define GSO_MAX_SIZE           65536
        unsigned int            gso_max_size;
index e4c6659..0c5eb7e 100644 (file)
@@ -3,7 +3,6 @@
 
 #ifdef __KERNEL__
 #include <linux/init.h>
-#include <linux/types.h>
 #include <linux/skbuff.h>
 #include <linux/net.h>
 #include <linux/netdevice.h>
@@ -14,6 +13,7 @@
 #include <linux/list.h>
 #include <net/net_namespace.h>
 #endif
+#include <linux/types.h>
 #include <linux/compiler.h>
 
 /* Responses from hook functions. */
index dd9c97f..590ac3d 100644 (file)
 
 #ifdef __KERNEL__
 #include <linux/if.h>
-#include <linux/types.h>
 #include <linux/in.h>
 #include <linux/if_arp.h>
 #include <linux/skbuff.h>
 #endif
+#include <linux/types.h>
 #include <linux/compiler.h>
 #include <linux/netfilter_arp.h>
 
index bfc889f..092bd50 100644 (file)
 
 #ifdef __KERNEL__
 #include <linux/if.h>
-#include <linux/types.h>
 #include <linux/in.h>
 #include <linux/ip.h>
 #include <linux/skbuff.h>
 #endif
+#include <linux/types.h>
 #include <linux/compiler.h>
 #include <linux/netfilter_ipv4.h>
 
index f2507dc..1089e33 100644 (file)
 
 #ifdef __KERNEL__
 #include <linux/if.h>
-#include <linux/types.h>
 #include <linux/in6.h>
 #include <linux/ipv6.h>
 #include <linux/skbuff.h>
 #endif
+#include <linux/types.h>
 #include <linux/compiler.h>
 #include <linux/netfilter_ipv6.h>
 
index cf6dbd7..9b940e6 100644 (file)
 
 #define PCI_VENDOR_ID_INTASHIELD       0x135a
 #define PCI_DEVICE_ID_INTASHIELD_IS200 0x0d80
+#define PCI_DEVICE_ID_INTASHIELD_IS400 0x0dc0
 
 #define PCI_VENDOR_ID_QUATECH          0x135C
 #define PCI_DEVICE_ID_QUATECH_QSC100   0x0010
 #define PCI_DEVICE_ID_INTEL_ICH10_4    0x3a30
 #define PCI_DEVICE_ID_INTEL_ICH10_5    0x3a60
 #define PCI_DEVICE_ID_INTEL_IOAT_SNB   0x402f
+#define PCI_DEVICE_ID_INTEL_5400_ERR   0x4030
+#define PCI_DEVICE_ID_INTEL_5400_FBD0  0x4035
+#define PCI_DEVICE_ID_INTEL_5400_FBD1  0x4036
 #define PCI_DEVICE_ID_INTEL_IOAT_SCNB  0x65ff
 #define PCI_DEVICE_ID_INTEL_TOLAPAI_0  0x5031
 #define PCI_DEVICE_ID_INTEL_TOLAPAI_1  0x5032
index 47fbcba..78bfdea 100644 (file)
@@ -262,7 +262,6 @@ int  bitmap_create(mddev_t *mddev);
 void bitmap_flush(mddev_t *mddev);
 void bitmap_destroy(mddev_t *mddev);
 
-char *file_path(struct file *file, char *buf, int count);
 void bitmap_print_sb(struct bitmap *bitmap);
 void bitmap_update_sb(struct bitmap *bitmap);
 
index 81a1a02..b7386ae 100644 (file)
@@ -72,6 +72,8 @@
  */
 #define MD_PATCHLEVEL_VERSION           3
 
+extern int mdp_major;
+
 extern int register_md_personality (struct mdk_personality *p);
 extern int unregister_md_personality (struct mdk_personality *p);
 extern mdk_thread_t * md_register_thread (void (*run) (mddev_t *mddev),
index 812ffa5..3dea9f5 100644 (file)
@@ -180,13 +180,15 @@ struct mddev_s
        int                             sync_speed_min;
        int                             sync_speed_max;
 
+       /* resync even though the same disks are shared among md-devices */
+       int                             parallel_resync;
+
        int                             ok_start_degraded;
        /* recovery/resync flags 
         * NEEDED:   we might need to start a resync/recover
         * RUNNING:  a thread is running, or about to be started
         * SYNC:     actually doing a resync, not a recovery
-        * ERR:      and IO error was detected - abort the resync/recovery
-        * INTR:     someone requested a (clean) early abort.
+        * INTR:     resync needs to be aborted for some reason
         * DONE:     thread is done and is waiting to be reaped
         * REQUEST:  user-space has requested a sync (used with SYNC)
         * CHECK:    user-space request for for check-only, no repair
@@ -196,7 +198,6 @@ struct mddev_s
         */
 #define        MD_RECOVERY_RUNNING     0
 #define        MD_RECOVERY_SYNC        1
-#define        MD_RECOVERY_ERR         2
 #define        MD_RECOVERY_INTR        3
 #define        MD_RECOVERY_DONE        4
 #define        MD_RECOVERY_NEEDED      5
index bca1345..95c1c39 100644 (file)
@@ -71,8 +71,8 @@ extern unsigned long sm501_gpio_get(struct device *dev,
 #define SM501FB_FLAG_DISABLE_AT_EXIT   (1<<1)
 #define SM501FB_FLAG_USE_HWCURSOR      (1<<2)
 #define SM501FB_FLAG_USE_HWACCEL       (1<<3)
-#define SM501FB_FLAG_PANEL_USE_FPEN    (1<<4)
-#define SM501FB_FLAG_PANEL_USE_VBIASEN (1<<5)
+#define SM501FB_FLAG_PANEL_NO_FPEN     (1<<4)
+#define SM501FB_FLAG_PANEL_NO_VBIASEN  (1<<5)
 
 struct sm501_platdata_fbsub {
        struct fb_videomode     *def_mode;
index c11bbcc..05eb466 100644 (file)
@@ -71,7 +71,8 @@ extern atomic_t rdma_stat_sq_prod;
  * completes.
  */
 struct svc_rdma_op_ctxt {
-       struct svc_rdma_op_ctxt *next;
+       struct svc_rdma_op_ctxt *read_hdr;
+       struct list_head free_list;
        struct xdr_buf arg;
        struct list_head dto_q;
        enum ib_wr_opcode wr_op;
@@ -85,7 +86,6 @@ struct svc_rdma_op_ctxt {
        struct page *pages[RPCSVC_MAXPAGES];
 };
 
-#define RDMACTXT_F_READ_DONE   1
 #define RDMACTXT_F_LAST_CTXT   2
 
 struct svcxprt_rdma {
@@ -104,7 +104,8 @@ struct svcxprt_rdma {
 
        struct ib_pd         *sc_pd;
 
-       struct svc_rdma_op_ctxt  *sc_ctxt_head;
+       atomic_t             sc_ctxt_used;
+       struct list_head     sc_ctxt_free;
        int                  sc_ctxt_cnt;
        int                  sc_ctxt_bump;
        int                  sc_ctxt_max;
@@ -123,6 +124,7 @@ struct svcxprt_rdma {
        struct list_head     sc_dto_q;          /* DTO tasklet I/O pending Q */
        struct list_head     sc_read_complete_q;
        spinlock_t           sc_read_complete_lock;
+       struct work_struct   sc_work;
 };
 /* sc_flags */
 #define RDMAXPRT_RQ_PENDING    1
@@ -164,8 +166,8 @@ extern int svc_rdma_sendto(struct svc_rqst *);
 
 /* svc_rdma_transport.c */
 extern int svc_rdma_send(struct svcxprt_rdma *, struct ib_send_wr *);
-extern int svc_rdma_send_error(struct svcxprt_rdma *, struct rpcrdma_msg *,
-                              enum rpcrdma_errcode);
+extern void svc_rdma_send_error(struct svcxprt_rdma *, struct rpcrdma_msg *,
+                               enum rpcrdma_errcode);
 struct page *svc_rdma_get_page(void);
 extern int svc_rdma_post_recv(struct svcxprt_rdma *);
 extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *);
index d96d9b1..18e62e3 100644 (file)
@@ -355,7 +355,7 @@ struct tcp_sock {
        u32     lost_retrans_low;       /* Sent seq after any rxmit (lowest) */
 
        u16     advmss;         /* Advertised MSS                       */
-       u16     prior_ssthresh; /* ssthresh saved at recovery start     */
+       u32     prior_ssthresh; /* ssthresh saved at recovery start     */
        u32     lost_out;       /* Lost packets                 */
        u32     sacked_out;     /* SACK'd packets                       */
        u32     fackets_out;    /* FACK'd packets                       */
index 9dc2346..d4a9ce6 100644 (file)
@@ -197,8 +197,6 @@ typedef u64 resource_size_t;
 typedef u32 resource_size_t;
 #endif
 
-#endif /* __KERNEL__ */
-
 struct ustat {
        __kernel_daddr_t        f_tfree;
        __kernel_ino_t          f_tinode;
@@ -206,4 +204,6 @@ struct ustat {
        char                    f_fpack[6];
 };
 
+#endif /* __KERNEL__ */
+
 #endif /* _LINUX_TYPES_H */
index 71e52f2..ca228bb 100644 (file)
@@ -130,6 +130,15 @@ struct usb_cdc_ether_desc {
        __u8    bNumberPowerFilters;
 } __attribute__ ((packed));
 
+/* "Telephone Control Model Functional Descriptor" from CDC WMC spec 6.3..3 */
+struct usb_cdc_dmm_desc {
+       __u8    bFunctionLength;
+       __u8    bDescriptorType;
+       __u8    bDescriptorSubtype;
+       __u16   bcdVersion;
+       __le16  wMaxCommand;
+} __attribute__ ((packed));
+
 /* "MDLM Functional Descriptor" from CDC WMC spec 6.7.2.3 */
 struct usb_cdc_mdlm_desc {
        __u8    bLength;
index 5b39a22..874f134 100644 (file)
@@ -237,6 +237,9 @@ unsigned int videobuf_poll_stream(struct file *file,
 int videobuf_mmap_setup(struct videobuf_queue *q,
                        unsigned int bcount, unsigned int bsize,
                        enum v4l2_memory memory);
+int __videobuf_mmap_setup(struct videobuf_queue *q,
+                       unsigned int bcount, unsigned int bsize,
+                       enum v4l2_memory memory);
 int videobuf_mmap_free(struct videobuf_queue *q);
 int videobuf_mmap_mapper(struct videobuf_queue *q,
                         struct vm_area_struct *vma);
index 4a80d74..dae3f9e 100644 (file)
@@ -1594,13 +1594,16 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw);
 void ieee80211_scan_completed(struct ieee80211_hw *hw);
 
 /**
- * ieee80211_iterate_active_interfaces - iterate active interfaces
+ * ieee80211_iterate_active_interfaces- iterate active interfaces
  *
  * This function iterates over the interfaces associated with a given
  * hardware that are currently active and calls the callback for them.
+ * This function allows the iterator function to sleep, when the iterator
+ * function is atomic @ieee80211_iterate_active_interfaces_atomic can
+ * be used.
  *
  * @hw: the hardware struct of which the interfaces should be iterated over
- * @iterator: the iterator function to call, cannot sleep
+ * @iterator: the iterator function to call
  * @data: first argument of the iterator function
  */
 void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
@@ -1609,6 +1612,24 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
                                         void *data);
 
 /**
+ * ieee80211_iterate_active_interfaces_atomic - iterate active interfaces
+ *
+ * This function iterates over the interfaces associated with a given
+ * hardware that are currently active and calls the callback for them.
+ * This function requires the iterator callback function to be atomic,
+ * if that is not desired, use @ieee80211_iterate_active_interfaces instead.
+ *
+ * @hw: the hardware struct of which the interfaces should be iterated over
+ * @iterator: the iterator function to call, cannot sleep
+ * @data: first argument of the iterator function
+ */
+void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw,
+                                               void (*iterator)(void *data,
+                                                   u8 *mac,
+                                                   struct ieee80211_vif *vif),
+                                               void *data);
+
+/**
  * ieee80211_start_tx_ba_session - Start a tx Block Ack session.
  * @hw: pointer as obtained from ieee80211_alloc_hw().
  * @ra: receiver address of the BA session recipient
index 9c451ff..a01b7c4 100644 (file)
@@ -129,6 +129,10 @@ extern int                         ndisc_ifinfo_sysctl_change(struct ctl_table *ctl,
                                                           void __user *buffer,
                                                           size_t *lenp,
                                                           loff_t *ppos);
+int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, int __user *name,
+                                int nlen, void __user *oldval,
+                                size_t __user *oldlenp,
+                                void __user *newval, size_t newlen);
 #endif
 
 extern void                    inet6_ifinfo_notify(int event,
index a5506c4..112dcdf 100644 (file)
@@ -772,12 +772,13 @@ static inline int __nla_parse_nested_compat(struct nlattr *tb[], int maxtype,
                                            const struct nla_policy *policy,
                                            int len)
 {
-       if (nla_len(nla) < len)
+       int nested_len = nla_len(nla) - NLA_ALIGN(len);
+
+       if (nested_len < 0)
                return -1;
-       if (nla_len(nla) >= NLA_ALIGN(len) + sizeof(struct nlattr))
-               return nla_parse_nested(tb, maxtype,
-                                       nla_data(nla) + NLA_ALIGN(len),
-                                       policy);
+       if (nested_len >= nla_attr_size(0))
+               return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len),
+                                nested_len, policy);
        memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
        return 0;
 }
index 6135d07..6199d11 100644 (file)
@@ -13,6 +13,7 @@ config DEFCONFIG_LIST
        default "/lib/modules/$UNAME_RELEASE/.config"
        default "/etc/kernel-config"
        default "/boot/config-$UNAME_RELEASE"
+       default "$ARCH_DEFCONFIG"
        default "arch/$ARCH/defconfig"
 
 menu "General setup"
index 7473b0c..693d246 100644 (file)
@@ -24,7 +24,6 @@ static struct {
 
 static int md_setup_ents __initdata;
 
-extern int mdp_major;
 /*
  * Parse the command-line parameters given our kernel, but do not
  * actually try to invoke the MD device now; that is handled by
index fbc6fc8..15ac0e1 100644 (file)
@@ -2903,7 +2903,7 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys)
        cg = tsk->cgroups;
        parent = task_cgroup(tsk, subsys->subsys_id);
 
-       snprintf(nodename, MAX_CGROUP_TYPE_NAMELEN, "node_%d", tsk->pid);
+       snprintf(nodename, MAX_CGROUP_TYPE_NAMELEN, "%d", tsk->pid);
 
        /* Pin the hierarchy */
        atomic_inc(&parent->root->sb->s_active);
index 1510f78..8f6185e 100644 (file)
@@ -126,6 +126,12 @@ static void __exit_signal(struct task_struct *tsk)
 
        __unhash_process(tsk);
 
+       /*
+        * Do this under ->siglock, we can race with another thread
+        * doing sigqueue_free() if we have SIGQUEUE_PREALLOC signals.
+        */
+       flush_sigqueue(&tsk->pending);
+
        tsk->signal = NULL;
        tsk->sighand = NULL;
        spin_unlock(&sighand->siglock);
@@ -133,7 +139,6 @@ static void __exit_signal(struct task_struct *tsk)
 
        __cleanup_sighand(sighand);
        clear_tsk_thread_flag(tsk,TIF_SIGPENDING);
-       flush_sigqueue(&tsk->pending);
        if (sig) {
                flush_sigqueue(&sig->shared_pending);
                taskstats_tgid_free(sig);
index f5e9491..5f80478 100644 (file)
@@ -1337,7 +1337,19 @@ out_unreg:
        kobject_put(&mod->mkobj.kobj);
        return err;
 }
-#endif
+
+static void mod_sysfs_fini(struct module *mod)
+{
+       kobject_put(&mod->mkobj.kobj);
+}
+
+#else /* CONFIG_SYSFS */
+
+static void mod_sysfs_fini(struct module *mod)
+{
+}
+
+#endif /* CONFIG_SYSFS */
 
 static void mod_kobject_remove(struct module *mod)
 {
@@ -1345,7 +1357,7 @@ static void mod_kobject_remove(struct module *mod)
        module_param_sysfs_remove(mod);
        kobject_put(mod->mkobj.drivers_dir);
        kobject_put(mod->holders_dir);
-       kobject_put(&mod->mkobj.kobj);
+       mod_sysfs_fini(mod);
 }
 
 /*
@@ -1780,7 +1792,7 @@ static struct module *load_module(void __user *umod,
 
        /* Sanity checks against insmoding binaries or wrong arch,
            weird elf version */
-       if (memcmp(hdr->e_ident, ELFMAG, 4) != 0
+       if (memcmp(hdr->e_ident, ELFMAG, SELFMAG) != 0
            || hdr->e_type != ET_REL
            || !elf_check_arch(hdr)
            || hdr->e_shentsize != sizeof(*sechdrs)) {
index 72bb4f5..12ffea7 100644 (file)
@@ -1242,7 +1242,8 @@ void sigqueue_free(struct sigqueue *q)
        /*
         * If the signal is still pending remove it from the
         * pending queue. We must hold ->siglock while testing
-        * q->list to serialize with collect_signal().
+        * q->list to serialize with collect_signal() or with
+        * __exit_signal()->flush_sigqueue().
         */
        spin_lock_irqsave(lock, flags);
        if (!list_empty(&q->list))
index 0101aee..b7350bb 100644 (file)
@@ -62,8 +62,7 @@ static int stopmachine(void *cpu)
                 * help our sisters onto their CPUs. */
                if (!prepared && !irqs_disabled)
                        yield();
-               else
-                       cpu_relax();
+               cpu_relax();
        }
 
        /* Ack: we are exiting. */
@@ -106,8 +105,10 @@ static int stop_machine(void)
        }
 
        /* Wait for them all to come to life. */
-       while (atomic_read(&stopmachine_thread_ack) != stopmachine_num_threads)
+       while (atomic_read(&stopmachine_thread_ack) != stopmachine_num_threads) {
                yield();
+               cpu_relax();
+       }
 
        /* If some failed, kill them all. */
        if (ret < 0) {
index 895d2d4..14e9728 100644 (file)
@@ -1652,7 +1652,7 @@ asmlinkage long sys_umask(int mask)
 asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
                          unsigned long arg4, unsigned long arg5)
 {
-       long uninitialized_var(error);
+       long error = 0;
 
        if (security_task_prctl(option, arg2, arg3, arg4, arg5, &error))
                return error;
@@ -1701,9 +1701,7 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
                        error = PR_TIMING_STATISTICAL;
                        break;
                case PR_SET_TIMING:
-                       if (arg2 == PR_TIMING_STATISTICAL)
-                               error = 0;
-                       else
+                       if (arg2 != PR_TIMING_STATISTICAL)
                                error = -EINVAL;
                        break;
 
index 867f7b5..5d7b928 100644 (file)
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -48,7 +48,8 @@ void lmb_dump_all(void)
        }
 
        pr_info("    reserved.cnt         = 0x%lx\n", lmb.reserved.cnt);
-       pr_info("    reserved.size        = 0x%lx\n", lmb.reserved.size);
+       pr_info("    reserved.size        = 0x%llx\n",
+           (unsigned long long)lmb.memory.size);
        for (i=0; i < lmb.reserved.cnt ;i++) {
                pr_info("    reserved.region[0x%lx].base       = 0x%llx\n",
                    i, (unsigned long long)lmb.reserved.region[i].base);
index 7c4f9e0..f2e574d 100644 (file)
@@ -172,30 +172,22 @@ postcore_initcall(bdi_class_init);
 int bdi_register(struct backing_dev_info *bdi, struct device *parent,
                const char *fmt, ...)
 {
-       char *name;
        va_list args;
        int ret = 0;
        struct device *dev;
 
        va_start(args, fmt);
-       name = kvasprintf(GFP_KERNEL, fmt, args);
+       dev = device_create_vargs(bdi_class, parent, MKDEV(0, 0), bdi, fmt, args);
        va_end(args);
-
-       if (!name)
-               return -ENOMEM;
-
-       dev = device_create(bdi_class, parent, MKDEV(0, 0), name);
        if (IS_ERR(dev)) {
                ret = PTR_ERR(dev);
                goto exit;
        }
 
        bdi->dev = dev;
-       dev_set_drvdata(bdi->dev, bdi);
-       bdi_debug_register(bdi, name);
+       bdi_debug_register(bdi, dev_name(dev));
 
 exit:
-       kfree(name);
        return ret;
 }
 EXPORT_SYMBOL(bdi_register);
index fb5608a..19e0ae9 100644 (file)
@@ -2295,8 +2295,6 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
        vmf.flags = flags;
        vmf.page = NULL;
 
-       BUG_ON(vma->vm_flags & VM_PFNMAP);
-
        ret = vma->vm_ops->fault(vma, &vmf);
        if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE)))
                return ret;
index fac6633..669499e 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -80,7 +80,7 @@ EXPORT_SYMBOL(vm_get_page_prot);
 int sysctl_overcommit_memory = OVERCOMMIT_GUESS;  /* heuristic overcommit */
 int sysctl_overcommit_ratio = 50;      /* default is 50% */
 int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT;
-atomic_t vm_committed_space = ATOMIC_INIT(0);
+atomic_long_t vm_committed_space = ATOMIC_LONG_INIT(0);
 
 /*
  * Check that a process has enough memory to allocate a new virtual
@@ -177,7 +177,7 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
         * cast `allowed' as a signed long because vm_committed_space
         * sometimes has a negative value
         */
-       if (atomic_read(&vm_committed_space) < (long)allowed)
+       if (atomic_long_read(&vm_committed_space) < (long)allowed)
                return 0;
 error:
        vm_unacct_memory(pages);
index ef8c62c..dca93fc 100644 (file)
@@ -39,7 +39,7 @@ struct page *mem_map;
 unsigned long max_mapnr;
 unsigned long num_physpages;
 unsigned long askedalloc, realalloc;
-atomic_t vm_committed_space = ATOMIC_INIT(0);
+atomic_long_t vm_committed_space = ATOMIC_LONG_INIT(0);
 int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
 int sysctl_overcommit_ratio = 50; /* default is 50% */
 int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT;
@@ -1410,7 +1410,7 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
         * cast `allowed' as a signed long because vm_committed_space
         * sometimes has a negative value
         */
-       if (atomic_read(&vm_committed_space) < (long)allowed)
+       if (atomic_long_read(&vm_committed_space) < (long)allowed)
                return 0;
 error:
        vm_unacct_memory(pages);
index 6383557..8e83f02 100644 (file)
@@ -1396,6 +1396,9 @@ get_page_from_freelist(gfp_t gfp_mask, nodemask_t *nodemask, unsigned int order,
 
        (void)first_zones_zonelist(zonelist, high_zoneidx, nodemask,
                                                        &preferred_zone);
+       if (!preferred_zone)
+               return NULL;
+
        classzone_idx = zone_idx(preferred_zone);
 
 zonelist_scan:
@@ -2804,7 +2807,7 @@ int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
        alloc_size = zone->wait_table_hash_nr_entries
                                        * sizeof(wait_queue_head_t);
 
-       if (system_state == SYSTEM_BOOTING) {
+       if (!slab_is_available()) {
                zone->wait_table = (wait_queue_head_t *)
                        alloc_bootmem_node(pgdat, alloc_size);
        } else {
@@ -3378,7 +3381,8 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat,
                 * is used by this zone for memmap. This affects the watermark
                 * and per-cpu initialisations
                 */
-               memmap_pages = (size * sizeof(struct page)) >> PAGE_SHIFT;
+               memmap_pages =
+                       PAGE_ALIGN(size * sizeof(struct page)) >> PAGE_SHIFT;
                if (realsize >= memmap_pages) {
                        realsize -= memmap_pages;
                        printk(KERN_DEBUG
index 91e1944..45c9f25 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -503,7 +503,7 @@ void vm_acct_memory(long pages)
        local = &__get_cpu_var(committed_space);
        *local += pages;
        if (*local > ACCT_THRESHOLD || *local < -ACCT_THRESHOLD) {
-               atomic_add(*local, &vm_committed_space);
+               atomic_long_add(*local, &vm_committed_space);
                *local = 0;
        }
        preempt_enable();
@@ -520,7 +520,7 @@ static int cpu_swap_callback(struct notifier_block *nfb,
 
        committed = &per_cpu(committed_space, (long)hcpu);
        if (action == CPU_DEAD || action == CPU_DEAD_FROZEN) {
-               atomic_add(*committed, &vm_committed_space);
+               atomic_long_add(*committed, &vm_committed_space);
                *committed = 0;
                drain_cpu_pagevecs((long)hcpu);
        }
index 2a739ad..ab2225d 100644 (file)
@@ -382,6 +382,18 @@ static void vlan_sync_address(struct net_device *dev,
        memcpy(vlan->real_dev_addr, dev->dev_addr, ETH_ALEN);
 }
 
+static void vlan_transfer_features(struct net_device *dev,
+                                  struct net_device *vlandev)
+{
+       unsigned long old_features = vlandev->features;
+
+       vlandev->features &= ~dev->vlan_features;
+       vlandev->features |= dev->features & dev->vlan_features;
+
+       if (old_features != vlandev->features)
+               netdev_features_change(vlandev);
+}
+
 static void __vlan_device_event(struct net_device *dev, unsigned long event)
 {
        switch (event) {
@@ -410,10 +422,8 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
        int i, flgs;
        struct net_device *vlandev;
 
-       if (is_vlan_dev(dev)) {
+       if (is_vlan_dev(dev))
                __vlan_device_event(dev, event);
-               goto out;
-       }
 
        grp = __vlan_find_group(dev);
        if (!grp)
@@ -450,6 +460,18 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
                }
                break;
 
+       case NETDEV_FEAT_CHANGE:
+               /* Propagate device features to underlying device */
+               for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
+                       vlandev = vlan_group_get_device(grp, i);
+                       if (!vlandev)
+                               continue;
+
+                       vlan_transfer_features(dev, vlandev);
+               }
+
+               break;
+
        case NETDEV_DOWN:
                /* Put all VLANs for this dev in the down state too.  */
                for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
index c961f08..5d055c2 100644 (file)
@@ -663,6 +663,8 @@ static int vlan_dev_init(struct net_device *dev)
                                          (1<<__LINK_STATE_DORMANT))) |
                      (1<<__LINK_STATE_PRESENT);
 
+       dev->features |= real_dev->features & real_dev->vlan_features;
+
        /* ipv6 shared card related stuff */
        dev->dev_id = real_dev->dev_id;
 
index a1607bc..5829630 100644 (file)
@@ -903,7 +903,11 @@ int dev_change_name(struct net_device *dev, char *newname)
                strlcpy(dev->name, newname, IFNAMSIZ);
 
 rollback:
-       device_rename(&dev->dev, dev->name);
+       err = device_rename(&dev->dev, dev->name);
+       if (err) {
+               memcpy(dev->name, oldname, IFNAMSIZ);
+               return err;
+       }
 
        write_lock_bh(&dev_base_lock);
        hlist_del(&dev->name_hlist);
@@ -3137,7 +3141,7 @@ int dev_change_flags(struct net_device *dev, unsigned flags)
         *      Load in the correct multicast list now the flags have changed.
         */
 
-       if (dev->change_rx_flags && (dev->flags ^ flags) & IFF_MULTICAST)
+       if (dev->change_rx_flags && (old_flags ^ flags) & IFF_MULTICAST)
                dev->change_rx_flags(dev, IFF_MULTICAST);
 
        dev_set_rx_mode(dev);
index 8dca211..fdf5377 100644 (file)
@@ -390,6 +390,7 @@ struct pktgen_thread {
        int cpu;
 
        wait_queue_head_t queue;
+       struct completion start_done;
 };
 
 #define REMOVE 1
@@ -3414,6 +3415,7 @@ static int pktgen_thread_worker(void *arg)
        BUG_ON(smp_processor_id() != cpu);
 
        init_waitqueue_head(&t->queue);
+       complete(&t->start_done);
 
        pr_debug("pktgen: starting pktgen/%d:  pid=%d\n", cpu, task_pid_nr(current));
 
@@ -3615,6 +3617,7 @@ static int __init pktgen_create_thread(int cpu)
        INIT_LIST_HEAD(&t->if_list);
 
        list_add_tail(&t->th_list, &pktgen_threads);
+       init_completion(&t->start_done);
 
        p = kthread_create(pktgen_thread_worker, t, "kpktgend_%d", cpu);
        if (IS_ERR(p)) {
@@ -3639,6 +3642,7 @@ static int __init pktgen_create_thread(int cpu)
        }
 
        wake_up_process(p);
+       wait_for_completion(&t->start_done);
 
        return 0;
 }
index 418862f..9b539fa 100644 (file)
@@ -1288,7 +1288,6 @@ static void arp_format_neigh_entry(struct seq_file *seq,
                                   struct neighbour *n)
 {
        char hbuffer[HBUFFERLEN];
-       const char hexbuf[] = "0123456789ABCDEF";
        int k, j;
        char tbuf[16];
        struct net_device *dev = n->dev;
@@ -1302,8 +1301,8 @@ static void arp_format_neigh_entry(struct seq_file *seq,
        else {
 #endif
        for (k = 0, j = 0; k < HBUFFERLEN - 3 && j < dev->addr_len; j++) {
-               hbuffer[k++] = hexbuf[(n->ha[j] >> 4) & 15];
-               hbuffer[k++] = hexbuf[n->ha[j] & 15];
+               hbuffer[k++] = hex_asc_hi(n->ha[j]);
+               hbuffer[k++] = hex_asc_lo(n->ha[j]);
                hbuffer[k++] = ':';
        }
        hbuffer[--k] = 0;
index 2ada033..4342cba 100644 (file)
@@ -313,9 +313,8 @@ static void ipgre_tunnel_uninit(struct net_device *dev)
 
 static void ipgre_err(struct sk_buff *skb, u32 info)
 {
-#ifndef I_WISH_WORLD_WERE_PERFECT
 
-/* It is not :-( All the routers (except for Linux) return only
+/* All the routers (except for Linux) return only
    8 bytes of packet payload. It means, that precise relaying of
    ICMP in the real Internet is absolutely infeasible.
 
@@ -398,149 +397,6 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
 out:
        read_unlock(&ipgre_lock);
        return;
-#else
-       struct iphdr *iph = (struct iphdr*)dp;
-       struct iphdr *eiph;
-       __be16       *p = (__be16*)(dp+(iph->ihl<<2));
-       const int type = icmp_hdr(skb)->type;
-       const int code = icmp_hdr(skb)->code;
-       int rel_type = 0;
-       int rel_code = 0;
-       __be32 rel_info = 0;
-       __u32 n = 0;
-       __be16 flags;
-       int grehlen = (iph->ihl<<2) + 4;
-       struct sk_buff *skb2;
-       struct flowi fl;
-       struct rtable *rt;
-
-       if (p[1] != htons(ETH_P_IP))
-               return;
-
-       flags = p[0];
-       if (flags&(GRE_CSUM|GRE_KEY|GRE_SEQ|GRE_ROUTING|GRE_VERSION)) {
-               if (flags&(GRE_VERSION|GRE_ROUTING))
-                       return;
-               if (flags&GRE_CSUM)
-                       grehlen += 4;
-               if (flags&GRE_KEY)
-                       grehlen += 4;
-               if (flags&GRE_SEQ)
-                       grehlen += 4;
-       }
-       if (len < grehlen + sizeof(struct iphdr))
-               return;
-       eiph = (struct iphdr*)(dp + grehlen);
-
-       switch (type) {
-       default:
-               return;
-       case ICMP_PARAMETERPROB:
-               n = ntohl(icmp_hdr(skb)->un.gateway) >> 24;
-               if (n < (iph->ihl<<2))
-                       return;
-
-               /* So... This guy found something strange INSIDE encapsulated
-                  packet. Well, he is fool, but what can we do ?
-                */
-               rel_type = ICMP_PARAMETERPROB;
-               n -= grehlen;
-               rel_info = htonl(n << 24);
-               break;
-
-       case ICMP_DEST_UNREACH:
-               switch (code) {
-               case ICMP_SR_FAILED:
-               case ICMP_PORT_UNREACH:
-                       /* Impossible event. */
-                       return;
-               case ICMP_FRAG_NEEDED:
-                       /* And it is the only really necessary thing :-) */
-                       n = ntohs(icmp_hdr(skb)->un.frag.mtu);
-                       if (n < grehlen+68)
-                               return;
-                       n -= grehlen;
-                       /* BSD 4.2 MORE DOES NOT EXIST IN NATURE. */
-                       if (n > ntohs(eiph->tot_len))
-                               return;
-                       rel_info = htonl(n);
-                       break;
-               default:
-                       /* All others are translated to HOST_UNREACH.
-                          rfc2003 contains "deep thoughts" about NET_UNREACH,
-                          I believe, it is just ether pollution. --ANK
-                        */
-                       rel_type = ICMP_DEST_UNREACH;
-                       rel_code = ICMP_HOST_UNREACH;
-                       break;
-               }
-               break;
-       case ICMP_TIME_EXCEEDED:
-               if (code != ICMP_EXC_TTL)
-                       return;
-               break;
-       }
-
-       /* Prepare fake skb to feed it to icmp_send */
-       skb2 = skb_clone(skb, GFP_ATOMIC);
-       if (skb2 == NULL)
-               return;
-       dst_release(skb2->dst);
-       skb2->dst = NULL;
-       skb_pull(skb2, skb->data - (u8*)eiph);
-       skb_reset_network_header(skb2);
-
-       /* Try to guess incoming interface */
-       memset(&fl, 0, sizeof(fl));
-       fl.fl4_dst = eiph->saddr;
-       fl.fl4_tos = RT_TOS(eiph->tos);
-       fl.proto = IPPROTO_GRE;
-       if (ip_route_output_key(dev_net(skb->dev), &rt, &fl)) {
-               kfree_skb(skb2);
-               return;
-       }
-       skb2->dev = rt->u.dst.dev;
-
-       /* route "incoming" packet */
-       if (rt->rt_flags&RTCF_LOCAL) {
-               ip_rt_put(rt);
-               rt = NULL;
-               fl.fl4_dst = eiph->daddr;
-               fl.fl4_src = eiph->saddr;
-               fl.fl4_tos = eiph->tos;
-               if (ip_route_output_key(dev_net(skb->dev), &rt, &fl) ||
-                   rt->u.dst.dev->type != ARPHRD_IPGRE) {
-                       ip_rt_put(rt);
-                       kfree_skb(skb2);
-                       return;
-               }
-       } else {
-               ip_rt_put(rt);
-               if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos, skb2->dev) ||
-                   skb2->dst->dev->type != ARPHRD_IPGRE) {
-                       kfree_skb(skb2);
-                       return;
-               }
-       }
-
-       /* change mtu on this route */
-       if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
-               if (n > dst_mtu(skb2->dst)) {
-                       kfree_skb(skb2);
-                       return;
-               }
-               skb2->dst->ops->update_pmtu(skb2->dst, n);
-       } else if (type == ICMP_TIME_EXCEEDED) {
-               struct ip_tunnel *t = netdev_priv(skb2->dev);
-               if (t->parms.iph.ttl) {
-                       rel_type = ICMP_DEST_UNREACH;
-                       rel_code = ICMP_HOST_UNREACH;
-               }
-       }
-
-       icmp_send(skb2, rel_type, rel_code, rel_info);
-       kfree_skb(skb2);
-#endif
 }
 
 static inline void ipgre_ecn_decapsulate(struct iphdr *iph, struct sk_buff *skb)
index 149111f..af5cb53 100644 (file)
@@ -278,9 +278,8 @@ static void ipip_tunnel_uninit(struct net_device *dev)
 
 static int ipip_err(struct sk_buff *skb, u32 info)
 {
-#ifndef I_WISH_WORLD_WERE_PERFECT
 
-/* It is not :-( All the routers (except for Linux) return only
+/* All the routers (except for Linux) return only
    8 bytes of packet payload. It means, that precise relaying of
    ICMP in the real Internet is absolutely infeasible.
  */
@@ -337,133 +336,6 @@ static int ipip_err(struct sk_buff *skb, u32 info)
 out:
        read_unlock(&ipip_lock);
        return err;
-#else
-       struct iphdr *iph = (struct iphdr*)dp;
-       int hlen = iph->ihl<<2;
-       struct iphdr *eiph;
-       const int type = icmp_hdr(skb)->type;
-       const int code = icmp_hdr(skb)->code;
-       int rel_type = 0;
-       int rel_code = 0;
-       __be32 rel_info = 0;
-       __u32 n = 0;
-       struct sk_buff *skb2;
-       struct flowi fl;
-       struct rtable *rt;
-
-       if (len < hlen + sizeof(struct iphdr))
-               return 0;
-       eiph = (struct iphdr*)(dp + hlen);
-
-       switch (type) {
-       default:
-               return 0;
-       case ICMP_PARAMETERPROB:
-               n = ntohl(icmp_hdr(skb)->un.gateway) >> 24;
-               if (n < hlen)
-                       return 0;
-
-               /* So... This guy found something strange INSIDE encapsulated
-                  packet. Well, he is fool, but what can we do ?
-                */
-               rel_type = ICMP_PARAMETERPROB;
-               rel_info = htonl((n - hlen) << 24);
-               break;
-
-       case ICMP_DEST_UNREACH:
-               switch (code) {
-               case ICMP_SR_FAILED:
-               case ICMP_PORT_UNREACH:
-                       /* Impossible event. */
-                       return 0;
-               case ICMP_FRAG_NEEDED:
-                       /* And it is the only really necessary thing :-) */
-                       n = ntohs(icmp_hdr(skb)->un.frag.mtu);
-                       if (n < hlen+68)
-                               return 0;
-                       n -= hlen;
-                       /* BSD 4.2 MORE DOES NOT EXIST IN NATURE. */
-                       if (n > ntohs(eiph->tot_len))
-                               return 0;
-                       rel_info = htonl(n);
-                       break;
-               default:
-                       /* All others are translated to HOST_UNREACH.
-                          rfc2003 contains "deep thoughts" about NET_UNREACH,
-                          I believe, it is just ether pollution. --ANK
-                        */
-                       rel_type = ICMP_DEST_UNREACH;
-                       rel_code = ICMP_HOST_UNREACH;
-                       break;
-               }
-               break;
-       case ICMP_TIME_EXCEEDED:
-               if (code != ICMP_EXC_TTL)
-                       return 0;
-               break;
-       }
-
-       /* Prepare fake skb to feed it to icmp_send */
-       skb2 = skb_clone(skb, GFP_ATOMIC);
-       if (skb2 == NULL)
-               return 0;
-       dst_release(skb2->dst);
-       skb2->dst = NULL;
-       skb_pull(skb2, skb->data - (u8*)eiph);
-       skb_reset_network_header(skb2);
-
-       /* Try to guess incoming interface */
-       memset(&fl, 0, sizeof(fl));
-       fl.fl4_daddr = eiph->saddr;
-       fl.fl4_tos = RT_TOS(eiph->tos);
-       fl.proto = IPPROTO_IPIP;
-       if (ip_route_output_key(dev_net(skb->dev), &rt, &key)) {
-               kfree_skb(skb2);
-               return 0;
-       }
-       skb2->dev = rt->u.dst.dev;
-
-       /* route "incoming" packet */
-       if (rt->rt_flags&RTCF_LOCAL) {
-               ip_rt_put(rt);
-               rt = NULL;
-               fl.fl4_daddr = eiph->daddr;
-               fl.fl4_src = eiph->saddr;
-               fl.fl4_tos = eiph->tos;
-               if (ip_route_output_key(dev_net(skb->dev), &rt, &fl) ||
-                   rt->u.dst.dev->type != ARPHRD_TUNNEL) {
-                       ip_rt_put(rt);
-                       kfree_skb(skb2);
-                       return 0;
-               }
-       } else {
-               ip_rt_put(rt);
-               if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos, skb2->dev) ||
-                   skb2->dst->dev->type != ARPHRD_TUNNEL) {
-                       kfree_skb(skb2);
-                       return 0;
-               }
-       }
-
-       /* change mtu on this route */
-       if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
-               if (n > dst_mtu(skb2->dst)) {
-                       kfree_skb(skb2);
-                       return 0;
-               }
-               skb2->dst->ops->update_pmtu(skb2->dst, n);
-       } else if (type == ICMP_TIME_EXCEEDED) {
-               struct ip_tunnel *t = netdev_priv(skb2->dev);
-               if (t->parms.iph.ttl) {
-                       rel_type = ICMP_DEST_UNREACH;
-                       rel_code = ICMP_HOST_UNREACH;
-               }
-       }
-
-       icmp_send(skb2, rel_type, rel_code, rel_info);
-       kfree_skb(skb2);
-       return 0;
-#endif
 }
 
 static inline void ipip_ecn_decapsulate(const struct iphdr *outer_iph,
index 92f90ae..df41026 100644 (file)
@@ -160,7 +160,7 @@ static struct dst_ops ipv4_dst_ops = {
        .negative_advice =      ipv4_negative_advice,
        .link_failure =         ipv4_link_failure,
        .update_pmtu =          ip_rt_update_pmtu,
-       .local_out =            ip_local_out,
+       .local_out =            __ip_local_out,
        .entry_size =           sizeof(struct rtable),
        .entries =              ATOMIC_INIT(0),
 };
index debf235..e399bde 100644 (file)
@@ -1836,7 +1836,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
 {
        struct tcp_sock *tp = tcp_sk(sk);
        struct inet_connection_sock *icsk = inet_csk(sk);
-       unsigned int cur_mss = tcp_current_mss(sk, 0);
+       unsigned int cur_mss;
        int err;
 
        /* Inconslusive MTU probe */
@@ -1858,6 +1858,11 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
                        return -ENOMEM;
        }
 
+       if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk))
+               return -EHOSTUNREACH; /* Routing failure or similar. */
+
+       cur_mss = tcp_current_mss(sk, 0);
+
        /* If receiver has shrunk his window, and skb is out of
         * new window, do not retransmit it. The exception is the
         * case, when window is shrunk to zero. In this case
@@ -1884,9 +1889,6 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
            (sysctl_tcp_retrans_collapse != 0))
                tcp_retrans_try_collapse(sk, skb, cur_mss);
 
-       if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk))
-               return -EHOSTUNREACH; /* Routing failure or similar. */
-
        /* Some Solaris stacks overoptimize and ignore the FIN on a
         * retransmit when old data is attached.  So strip it off
         * since it is cheap to do so and saves bytes on the network.
index e591e09..3a83557 100644 (file)
@@ -1764,14 +1764,16 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len)
         *      2) Configure prefixes with the auto flag set
         */
 
-       /* Avoid arithmetic overflow. Really, we could
-          save rt_expires in seconds, likely valid_lft,
-          but it would require division in fib gc, that it
-          not good.
-        */
-       if (valid_lft >= 0x7FFFFFFF/HZ)
+       if (valid_lft == INFINITY_LIFE_TIME)
+               rt_expires = ~0UL;
+       else if (valid_lft >= 0x7FFFFFFF/HZ) {
+               /* Avoid arithmetic overflow. Really, we could
+                * save rt_expires in seconds, likely valid_lft,
+                * but it would require division in fib gc, that it
+                * not good.
+                */
                rt_expires = 0x7FFFFFFF - (0x7FFFFFFF % HZ);
-       else
+       else
                rt_expires = valid_lft * HZ;
 
        /*
@@ -1779,7 +1781,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len)
         * Avoid arithmetic overflow there as well.
         * Overflow can happen only if HZ < USER_HZ.
         */
-       if (HZ < USER_HZ && rt_expires > 0x7FFFFFFF / USER_HZ)
+       if (HZ < USER_HZ && ~rt_expires && rt_expires > 0x7FFFFFFF / USER_HZ)
                rt_expires = 0x7FFFFFFF / USER_HZ;
 
        if (pinfo->onlink) {
@@ -1788,17 +1790,28 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len)
                                dev->ifindex, 1);
 
                if (rt && ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0)) {
-                       if (rt->rt6i_flags&RTF_EXPIRES) {
-                               if (valid_lft == 0) {
-                                       ip6_del_rt(rt);
-                                       rt = NULL;
-                               } else {
-                                       rt->rt6i_expires = jiffies + rt_expires;
-                               }
+                       /* Autoconf prefix route */
+                       if (valid_lft == 0) {
+                               ip6_del_rt(rt);
+                               rt = NULL;
+                       } else if (~rt_expires) {
+                               /* not infinity */
+                               rt->rt6i_expires = jiffies + rt_expires;
+                               rt->rt6i_flags |= RTF_EXPIRES;
+                       } else {
+                               rt->rt6i_flags &= ~RTF_EXPIRES;
+                               rt->rt6i_expires = 0;
                        }
                } else if (valid_lft) {
+                       int flags = RTF_ADDRCONF | RTF_PREFIX_RT;
+                       clock_t expires = 0;
+                       if (~rt_expires) {
+                               /* not infinity */
+                               flags |= RTF_EXPIRES;
+                               expires = jiffies_to_clock_t(rt_expires);
+                       }
                        addrconf_prefix_route(&pinfo->prefix, pinfo->prefix_len,
-                                             dev, jiffies_to_clock_t(rt_expires), RTF_ADDRCONF|RTF_EXPIRES|RTF_PREFIX_RT);
+                                             dev, expires, flags);
                }
                if (rt)
                        dst_release(&rt->u.dst);
@@ -2021,7 +2034,8 @@ static int inet6_addr_add(struct net *net, int ifindex, struct in6_addr *pfx,
        struct inet6_dev *idev;
        struct net_device *dev;
        int scope;
-       u32 flags = RTF_EXPIRES;
+       u32 flags;
+       clock_t expires;
 
        ASSERT_RTNL();
 
@@ -2041,8 +2055,13 @@ static int inet6_addr_add(struct net *net, int ifindex, struct in6_addr *pfx,
        if (valid_lft == INFINITY_LIFE_TIME) {
                ifa_flags |= IFA_F_PERMANENT;
                flags = 0;
-       } else if (valid_lft >= 0x7FFFFFFF/HZ)
-               valid_lft = 0x7FFFFFFF/HZ;
+               expires = 0;
+       } else {
+               if (valid_lft >= 0x7FFFFFFF/HZ)
+                       valid_lft = 0x7FFFFFFF/HZ;
+               flags = RTF_EXPIRES;
+               expires = jiffies_to_clock_t(valid_lft * HZ);
+       }
 
        if (prefered_lft == 0)
                ifa_flags |= IFA_F_DEPRECATED;
@@ -2060,7 +2079,7 @@ static int inet6_addr_add(struct net *net, int ifindex, struct in6_addr *pfx,
                spin_unlock_bh(&ifp->lock);
 
                addrconf_prefix_route(&ifp->addr, ifp->prefix_len, dev,
-                                     jiffies_to_clock_t(valid_lft * HZ), flags);
+                                     expires, flags);
                /*
                 * Note that section 3.1 of RFC 4429 indicates
                 * that the Optimistic flag should not be set for
@@ -3148,7 +3167,8 @@ inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
 static int inet6_addr_modify(struct inet6_ifaddr *ifp, u8 ifa_flags,
                             u32 prefered_lft, u32 valid_lft)
 {
-       u32 flags = RTF_EXPIRES;
+       u32 flags;
+       clock_t expires;
 
        if (!valid_lft || (prefered_lft > valid_lft))
                return -EINVAL;
@@ -3156,8 +3176,13 @@ static int inet6_addr_modify(struct inet6_ifaddr *ifp, u8 ifa_flags,
        if (valid_lft == INFINITY_LIFE_TIME) {
                ifa_flags |= IFA_F_PERMANENT;
                flags = 0;
-       } else if (valid_lft >= 0x7FFFFFFF/HZ)
-               valid_lft = 0x7FFFFFFF/HZ;
+               expires = 0;
+       } else {
+               if (valid_lft >= 0x7FFFFFFF/HZ)
+                       valid_lft = 0x7FFFFFFF/HZ;
+               flags = RTF_EXPIRES;
+               expires = jiffies_to_clock_t(valid_lft * HZ);
+       }
 
        if (prefered_lft == 0)
                ifa_flags |= IFA_F_DEPRECATED;
@@ -3176,7 +3201,7 @@ static int inet6_addr_modify(struct inet6_ifaddr *ifp, u8 ifa_flags,
                ipv6_ifa_notify(0, ifp);
 
        addrconf_prefix_route(&ifp->addr, ifp->prefix_len, ifp->idev->dev,
-                             jiffies_to_clock_t(valid_lft * HZ), flags);
+                             expires, flags);
        addrconf_verify(0);
 
        return 0;
@@ -4242,7 +4267,7 @@ static void addrconf_sysctl_register(struct inet6_dev *idev)
        neigh_sysctl_register(idev->dev, idev->nd_parms, NET_IPV6,
                              NET_IPV6_NEIGH, "ipv6",
                              &ndisc_ifinfo_sysctl_change,
-                             NULL);
+                             ndisc_ifinfo_sysctl_strategy);
        __addrconf_sysctl_register(dev_net(idev->dev), idev->dev->name,
                        idev->dev->ifindex, idev, &idev->cnf);
 }
index a55fc05..282fdb3 100644 (file)
@@ -1727,10 +1727,10 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * f
        return ret;
 }
 
-static int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, int __user *name,
-                                       int nlen, void __user *oldval,
-                                       size_t __user *oldlenp,
-                                       void __user *newval, size_t newlen)
+int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, int __user *name,
+                                int nlen, void __user *oldval,
+                                size_t __user *oldlenp,
+                                void __user *newval, size_t newlen)
 {
        struct net_device *dev = ctl->extra1;
        struct inet6_dev *idev;
index 12bba08..48534c6 100644 (file)
@@ -109,7 +109,7 @@ static struct dst_ops ip6_dst_ops_template = {
        .negative_advice        =       ip6_negative_advice,
        .link_failure           =       ip6_link_failure,
        .update_pmtu            =       ip6_rt_update_pmtu,
-       .local_out              =       ip6_local_out,
+       .local_out              =       __ip6_local_out,
        .entry_size             =       sizeof(struct rt6_info),
        .entries                =       ATOMIC_INIT(0),
 };
@@ -475,7 +475,7 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len,
        lifetime = ntohl(rinfo->lifetime);
        if (lifetime == 0xffffffff) {
                /* infinity */
-       } else if (lifetime > 0x7fffffff/HZ) {
+       } else if (lifetime > 0x7fffffff/HZ - 1) {
                /* Avoid arithmetic overflow */
                lifetime = 0x7fffffff/HZ - 1;
        }
@@ -1106,7 +1106,9 @@ int ip6_route_add(struct fib6_config *cfg)
        }
 
        rt->u.dst.obsolete = -1;
-       rt->rt6i_expires = jiffies + clock_t_to_jiffies(cfg->fc_expires);
+       rt->rt6i_expires = (cfg->fc_flags & RTF_EXPIRES) ?
+                               jiffies + clock_t_to_jiffies(cfg->fc_expires) :
+                               0;
 
        if (cfg->fc_protocol == RTPROT_UNSPEC)
                cfg->fc_protocol = RTPROT_BOOT;
@@ -2200,7 +2202,9 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt,
 
        NLA_PUT_U32(skb, RTA_PRIORITY, rt->rt6i_metric);
 
-       expires = rt->rt6i_expires ? rt->rt6i_expires - jiffies : 0;
+       expires = (rt->rt6i_flags & RTF_EXPIRES) ?
+                       rt->rt6i_expires - jiffies : 0;
+
        if (rtnl_put_cacheinfo(skb, &rt->u.dst, 0, 0, 0,
                               expires, rt->u.dst.error) < 0)
                goto nla_put_failure;
index 5a6fab9..3de6ffd 100644 (file)
@@ -403,9 +403,8 @@ static void ipip6_tunnel_uninit(struct net_device *dev)
 
 static int ipip6_err(struct sk_buff *skb, u32 info)
 {
-#ifndef I_WISH_WORLD_WERE_PERFECT
 
-/* It is not :-( All the routers (except for Linux) return only
+/* All the routers (except for Linux) return only
    8 bytes of packet payload. It means, that precise relaying of
    ICMP in the real Internet is absolutely infeasible.
  */
@@ -462,92 +461,6 @@ static int ipip6_err(struct sk_buff *skb, u32 info)
 out:
        read_unlock(&ipip6_lock);
        return err;
-#else
-       struct iphdr *iph = (struct iphdr*)dp;
-       int hlen = iph->ihl<<2;
-       struct ipv6hdr *iph6;
-       const int type = icmp_hdr(skb)->type;
-       const int code = icmp_hdr(skb)->code;
-       int rel_type = 0;
-       int rel_code = 0;
-       int rel_info = 0;
-       struct sk_buff *skb2;
-       struct rt6_info *rt6i;
-
-       if (len < hlen + sizeof(struct ipv6hdr))
-               return;
-       iph6 = (struct ipv6hdr*)(dp + hlen);
-
-       switch (type) {
-       default:
-               return;
-       case ICMP_PARAMETERPROB:
-               if (icmp_hdr(skb)->un.gateway < hlen)
-                       return;
-
-               /* So... This guy found something strange INSIDE encapsulated
-                  packet. Well, he is fool, but what can we do ?
-                */
-               rel_type = ICMPV6_PARAMPROB;
-               rel_info = icmp_hdr(skb)->un.gateway - hlen;
-               break;
-
-       case ICMP_DEST_UNREACH:
-               switch (code) {
-               case ICMP_SR_FAILED:
-               case ICMP_PORT_UNREACH:
-                       /* Impossible event. */
-                       return;
-               case ICMP_FRAG_NEEDED:
-                       /* Too complicated case ... */
-                       return;
-               default:
-                       /* All others are translated to HOST_UNREACH.
-                          rfc2003 contains "deep thoughts" about NET_UNREACH,
-                          I believe, it is just ether pollution. --ANK
-                        */
-                       rel_type = ICMPV6_DEST_UNREACH;
-                       rel_code = ICMPV6_ADDR_UNREACH;
-                       break;
-               }
-               break;
-       case ICMP_TIME_EXCEEDED:
-               if (code != ICMP_EXC_TTL)
-                       return;
-               rel_type = ICMPV6_TIME_EXCEED;
-               rel_code = ICMPV6_EXC_HOPLIMIT;
-               break;
-       }
-
-       /* Prepare fake skb to feed it to icmpv6_send */
-       skb2 = skb_clone(skb, GFP_ATOMIC);
-       if (skb2 == NULL)
-               return 0;
-       dst_release(skb2->dst);
-       skb2->dst = NULL;
-       skb_pull(skb2, skb->data - (u8*)iph6);
-       skb_reset_network_header(skb2);
-
-       /* Try to guess incoming interface */
-       rt6i = rt6_lookup(dev_net(skb->dev), &iph6->saddr, NULL, NULL, 0);
-       if (rt6i && rt6i->rt6i_dev) {
-               skb2->dev = rt6i->rt6i_dev;
-
-               rt6i = rt6_lookup(dev_net(skb->dev),
-                               &iph6->daddr, &iph6->saddr, NULL, 0);
-
-               if (rt6i && rt6i->rt6i_dev && rt6i->rt6i_dev->type == ARPHRD_SIT) {
-                       struct ip_tunnel *t = netdev_priv(rt6i->rt6i_dev);
-                       if (rel_type == ICMPV6_TIME_EXCEED && t->parms.iph.ttl) {
-                               rel_type = ICMPV6_DEST_UNREACH;
-                               rel_code = ICMPV6_ADDR_UNREACH;
-                       }
-                       icmpv6_send(skb2, rel_type, rel_code, rel_info, skb2->dev);
-               }
-       }
-       kfree_skb(skb2);
-       return 0;
-#endif
 }
 
 static inline void ipip6_ecn_decapsulate(struct iphdr *iph, struct sk_buff *skb)
index 9e7236f..9bba7ac 100644 (file)
@@ -1251,7 +1251,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct sadb_msg *hdr,
                x->sel.prefixlen_s = addr->sadb_address_prefixlen;
        }
 
-       if (x->props.mode == XFRM_MODE_TRANSPORT)
+       if (!x->sel.family)
                x->sel.family = x->props.family;
 
        if (ext_hdrs[SADB_X_EXT_NAT_T_TYPE-1]) {
index 4adba09..7cfd12e 100644 (file)
@@ -730,7 +730,17 @@ static void ieee80211_send_assoc(struct net_device *dev,
                if (bss->wmm_ie) {
                        wmm = 1;
                }
+
+               /* get all rates supported by the device and the AP as
+                * some APs don't like getting a superset of their rates
+                * in the association request (e.g. D-Link DAP 1353 in
+                * b-only mode) */
+               rates_len = ieee80211_compatible_rates(bss, sband, &rates);
+
                ieee80211_rx_bss_put(dev, bss);
+       } else {
+               rates = ~0;
+               rates_len = sband->n_bitrates;
        }
 
        mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
@@ -761,10 +771,7 @@ static void ieee80211_send_assoc(struct net_device *dev,
        *pos++ = ifsta->ssid_len;
        memcpy(pos, ifsta->ssid, ifsta->ssid_len);
 
-       /* all supported rates should be added here but some APs
-        * (e.g. D-Link DAP 1353 in b-only mode) don't like that
-        * Therefore only add rates the AP supports */
-       rates_len = ieee80211_compatible_rates(bss, sband, &rates);
+       /* add all rates which were marked to be used above */
        supp_rates_len = rates_len;
        if (supp_rates_len > 8)
                supp_rates_len = 8;
@@ -3446,21 +3453,17 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
        struct ieee80211_sta_bss *bss, *selected = NULL;
        int top_rssi = 0, freq;
 
-       if (!(ifsta->flags & (IEEE80211_STA_AUTO_SSID_SEL |
-           IEEE80211_STA_AUTO_BSSID_SEL | IEEE80211_STA_AUTO_CHANNEL_SEL))) {
-               ifsta->state = IEEE80211_AUTHENTICATE;
-               ieee80211_sta_reset_auth(dev, ifsta);
-               return 0;
-       }
-
        spin_lock_bh(&local->sta_bss_lock);
        freq = local->oper_channel->center_freq;
        list_for_each_entry(bss, &local->sta_bss_list, list) {
                if (!(bss->capability & WLAN_CAPABILITY_ESS))
                        continue;
 
-               if (!!(bss->capability & WLAN_CAPABILITY_PRIVACY) ^
-                   !!sdata->default_key)
+               if ((ifsta->flags & (IEEE80211_STA_AUTO_SSID_SEL |
+                       IEEE80211_STA_AUTO_BSSID_SEL |
+                       IEEE80211_STA_AUTO_CHANNEL_SEL)) &&
+                   (!!(bss->capability & WLAN_CAPABILITY_PRIVACY) ^
+                    !!sdata->default_key))
                        continue;
 
                if (!(ifsta->flags & IEEE80211_STA_AUTO_CHANNEL_SEL) &&
index 24a465c..131e9e6 100644 (file)
@@ -389,6 +389,41 @@ void ieee80211_iterate_active_interfaces(
        struct ieee80211_local *local = hw_to_local(hw);
        struct ieee80211_sub_if_data *sdata;
 
+       rtnl_lock();
+
+       list_for_each_entry(sdata, &local->interfaces, list) {
+               switch (sdata->vif.type) {
+               case IEEE80211_IF_TYPE_INVALID:
+               case IEEE80211_IF_TYPE_MNTR:
+               case IEEE80211_IF_TYPE_VLAN:
+                       continue;
+               case IEEE80211_IF_TYPE_AP:
+               case IEEE80211_IF_TYPE_STA:
+               case IEEE80211_IF_TYPE_IBSS:
+               case IEEE80211_IF_TYPE_WDS:
+               case IEEE80211_IF_TYPE_MESH_POINT:
+                       break;
+               }
+               if (sdata->dev == local->mdev)
+                       continue;
+               if (netif_running(sdata->dev))
+                       iterator(data, sdata->dev->dev_addr,
+                                &sdata->vif);
+       }
+
+       rtnl_unlock();
+}
+EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces);
+
+void ieee80211_iterate_active_interfaces_atomic(
+       struct ieee80211_hw *hw,
+       void (*iterator)(void *data, u8 *mac,
+                        struct ieee80211_vif *vif),
+       void *data)
+{
+       struct ieee80211_local *local = hw_to_local(hw);
+       struct ieee80211_sub_if_data *sdata;
+
        rcu_read_lock();
 
        list_for_each_entry_rcu(sdata, &local->interfaces, list) {
@@ -413,4 +448,4 @@ void ieee80211_iterate_active_interfaces(
 
        rcu_read_unlock();
 }
-EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces);
+EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic);
index 76e1de1..457ebf9 100644 (file)
@@ -209,7 +209,6 @@ static int ieee80211_ioctl_giwrange(struct net_device *dev,
        range->num_frequency = c;
 
        IW_EVENT_CAPA_SET_KERNEL(range->event_capa);
-       IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWTHRSPY);
        IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWAP);
        IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWSCAN);
 
index 1086df7..9360fc8 100644 (file)
@@ -220,7 +220,7 @@ replay:
                tp = kzalloc(sizeof(*tp), GFP_KERNEL);
                if (tp == NULL)
                        goto errout;
-               err = -EINVAL;
+               err = -ENOENT;
                tp_ops = tcf_proto_lookup_ops(tca[TCA_KIND]);
                if (tp_ops == NULL) {
 #ifdef CONFIG_KMOD
index d8e8d79..e46c825 100644 (file)
@@ -6,30 +6,9 @@
 
 #include <linux/sched.h>
 #include <linux/errno.h>
-#include <linux/fcntl.h>
-#include <linux/net.h>
-#include <linux/in.h>
-#include <linux/inet.h>
-#include <linux/udp.h>
-#include <linux/tcp.h>
-#include <linux/unistd.h>
-#include <linux/slab.h>
-#include <linux/netdevice.h>
-#include <linux/skbuff.h>
-#include <linux/file.h>
 #include <linux/freezer.h>
 #include <linux/kthread.h>
 #include <net/sock.h>
-#include <net/checksum.h>
-#include <net/ip.h>
-#include <net/ipv6.h>
-#include <net/tcp_states.h>
-#include <linux/uaccess.h>
-#include <asm/ioctls.h>
-
-#include <linux/sunrpc/types.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/xdr.h>
 #include <linux/sunrpc/stats.h>
 #include <linux/sunrpc/svc_xprt.h>
 
@@ -296,8 +275,6 @@ void svc_xprt_enqueue(struct svc_xprt *xprt)
        if (!(xprt->xpt_flags &
              ((1<<XPT_CONN)|(1<<XPT_DATA)|(1<<XPT_CLOSE)|(1<<XPT_DEFERRED))))
                return;
-       if (test_bit(XPT_DEAD, &xprt->xpt_flags))
-               return;
 
        cpu = get_cpu();
        pool = svc_pool_for_cpu(xprt->xpt_server, cpu);
index 3f30ee6..f24800f 100644 (file)
@@ -278,7 +278,7 @@ static int ip_map_show(struct seq_file *m,
                dom = im->m_client->h.name;
 
        if (ipv6_addr_v4mapped(&addr)) {
-               seq_printf(m, "%s" NIPQUAD_FMT "%s\n",
+               seq_printf(m, "%s " NIPQUAD_FMT " %s\n",
                        im->m_class,
                        ntohl(addr.s6_addr32[3]) >> 24 & 0xff,
                        ntohl(addr.s6_addr32[3]) >> 16 & 0xff,
@@ -286,7 +286,7 @@ static int ip_map_show(struct seq_file *m,
                        ntohl(addr.s6_addr32[3]) >>  0 & 0xff,
                        dom);
        } else {
-               seq_printf(m, "%s" NIP6_FMT "%s\n",
+               seq_printf(m, "%s " NIP6_FMT " %s\n",
                        im->m_class, NIP6(addr), dom);
        }
        return 0;
index c22d6b6..06ab484 100644 (file)
@@ -260,11 +260,16 @@ static int rdma_read_max_sge(struct svcxprt_rdma *xprt, int sge_count)
  * On our side, we need to read into a pagelist. The first page immediately
  * follows the RPC header.
  *
- * This function returns 1 to indicate success. The data is not yet in
+ * This function returns:
+ * 0 - No error and no read-list found.
+ *
+ * 1 - Successful read-list processing. The data is not yet in
  * the pagelist and therefore the RPC request must be deferred. The
  * I/O completion will enqueue the transport again and
  * svc_rdma_recvfrom will complete the request.
  *
+ * <0 - Error processing/posting read-list.
+ *
  * NOTE: The ctxt must not be touched after the last WR has been posted
  * because the I/O completion processing may occur on another
  * processor and free / modify the context. Ne touche pas!
@@ -284,7 +289,6 @@ static int rdma_read_xdr(struct svcxprt_rdma *xprt,
        u64 sgl_offset;
        struct rpcrdma_read_chunk *ch;
        struct svc_rdma_op_ctxt *ctxt = NULL;
-       struct svc_rdma_op_ctxt *head;
        struct svc_rdma_op_ctxt *tmp_sge_ctxt;
        struct svc_rdma_op_ctxt *tmp_ch_ctxt;
        struct chunk_sge *ch_sge_ary;
@@ -302,25 +306,19 @@ static int rdma_read_xdr(struct svcxprt_rdma *xprt,
        ch_sge_ary = (struct chunk_sge *)tmp_ch_ctxt->sge;
 
        svc_rdma_rcl_chunk_counts(ch, &ch_count, &byte_count);
+       if (ch_count > RPCSVC_MAXPAGES)
+               return -EINVAL;
        sge_count = rdma_rcl_to_sge(xprt, rqstp, hdr_ctxt, rmsgp,
                                    sge, ch_sge_ary,
                                    ch_count, byte_count);
-       head = svc_rdma_get_context(xprt);
        sgl_offset = 0;
        ch_no = 0;
 
        for (ch = (struct rpcrdma_read_chunk *)&rmsgp->rm_body.rm_chunks[0];
             ch->rc_discrim != 0; ch++, ch_no++) {
 next_sge:
-               if (!ctxt)
-                       ctxt = head;
-               else {
-                       ctxt->next = svc_rdma_get_context(xprt);
-                       ctxt = ctxt->next;
-               }
-               ctxt->next = NULL;
+               ctxt = svc_rdma_get_context(xprt);
                ctxt->direction = DMA_FROM_DEVICE;
-               clear_bit(RDMACTXT_F_READ_DONE, &ctxt->flags);
                clear_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags);
 
                /* Prepare READ WR */
@@ -347,20 +345,15 @@ next_sge:
                         * the client and the RPC needs to be enqueued.
                         */
                        set_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags);
-                       ctxt->next = hdr_ctxt;
-                       hdr_ctxt->next = head;
+                       ctxt->read_hdr = hdr_ctxt;
                }
                /* Post the read */
                err = svc_rdma_send(xprt, &read_wr);
                if (err) {
-                       printk(KERN_ERR "svcrdma: Error posting send = %d\n",
+                       printk(KERN_ERR "svcrdma: Error %d posting RDMA_READ\n",
                               err);
-                       /*
-                        * Break the circular list so free knows when
-                        * to stop if the error happened to occur on
-                        * the last read
-                        */
-                       ctxt->next = NULL;
+                       set_bit(XPT_CLOSE, &xprt->sc_xprt.xpt_flags);
+                       svc_rdma_put_context(ctxt, 0);
                        goto out;
                }
                atomic_inc(&rdma_stat_read);
@@ -371,7 +364,7 @@ next_sge:
                        goto next_sge;
                }
                sgl_offset = 0;
-               err = 0;
+               err = 1;
        }
 
  out:
@@ -389,25 +382,12 @@ next_sge:
        while (rqstp->rq_resused)
                rqstp->rq_respages[--rqstp->rq_resused] = NULL;
 
-       if (err) {
-               printk(KERN_ERR "svcrdma : RDMA_READ error = %d\n", err);
-               set_bit(XPT_CLOSE, &xprt->sc_xprt.xpt_flags);
-               /* Free the linked list of read contexts */
-               while (head != NULL) {
-                       ctxt = head->next;
-                       svc_rdma_put_context(head, 1);
-                       head = ctxt;
-               }
-               return 0;
-       }
-
-       return 1;
+       return err;
 }
 
 static int rdma_read_complete(struct svc_rqst *rqstp,
-                             struct svc_rdma_op_ctxt *data)
+                             struct svc_rdma_op_ctxt *head)
 {
-       struct svc_rdma_op_ctxt *head = data->next;
        int page_no;
        int ret;
 
@@ -433,21 +413,12 @@ static int rdma_read_complete(struct svc_rqst *rqstp,
        rqstp->rq_arg.len = head->arg.len;
        rqstp->rq_arg.buflen = head->arg.buflen;
 
+       /* Free the context */
+       svc_rdma_put_context(head, 0);
+
        /* XXX: What should this be? */
        rqstp->rq_prot = IPPROTO_MAX;
-
-       /*
-        * Free the contexts we used to build the RDMA_READ. We have
-        * to be careful here because the context list uses the same
-        * next pointer used to chain the contexts associated with the
-        * RDMA_READ
-        */
-       data->next = NULL;      /* terminate circular list */
-       do {
-               data = head->next;
-               svc_rdma_put_context(head, 0);
-               head = data;
-       } while (head != NULL);
+       svc_xprt_copy_addrs(rqstp, rqstp->rq_xprt);
 
        ret = rqstp->rq_arg.head[0].iov_len
                + rqstp->rq_arg.page_len
@@ -457,8 +428,6 @@ static int rdma_read_complete(struct svc_rqst *rqstp,
                ret, rqstp->rq_arg.len, rqstp->rq_arg.head[0].iov_base,
                rqstp->rq_arg.head[0].iov_len);
 
-       /* Indicate that we've consumed an RQ credit */
-       rqstp->rq_xprt_ctxt = rqstp->rq_xprt;
        svc_xprt_received(rqstp->rq_xprt);
        return ret;
 }
@@ -480,13 +449,6 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
 
        dprintk("svcrdma: rqstp=%p\n", rqstp);
 
-       /*
-        * The rq_xprt_ctxt indicates if we've consumed an RQ credit
-        * or not. It is used in the rdma xpo_release_rqst function to
-        * determine whether or not to return an RQ WQE to the RQ.
-        */
-       rqstp->rq_xprt_ctxt = NULL;
-
        spin_lock_bh(&rdma_xprt->sc_read_complete_lock);
        if (!list_empty(&rdma_xprt->sc_read_complete_q)) {
                ctxt = list_entry(rdma_xprt->sc_read_complete_q.next,
@@ -537,21 +499,22 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
        /* If the request is invalid, reply with an error */
        if (len < 0) {
                if (len == -ENOSYS)
-                       (void)svc_rdma_send_error(rdma_xprt, rmsgp, ERR_VERS);
+                       svc_rdma_send_error(rdma_xprt, rmsgp, ERR_VERS);
                goto close_out;
        }
 
-       /* Read read-list data. If we would need to wait, defer
-        * it. Not that in this case, we don't return the RQ credit
-        * until after the read completes.
-        */
-       if (rdma_read_xdr(rdma_xprt, rmsgp, rqstp, ctxt)) {
+       /* Read read-list data. */
+       ret = rdma_read_xdr(rdma_xprt, rmsgp, rqstp, ctxt);
+       if (ret > 0) {
+               /* read-list posted, defer until data received from client. */
                svc_xprt_received(xprt);
                return 0;
        }
-
-       /* Indicate we've consumed an RQ credit */
-       rqstp->rq_xprt_ctxt = rqstp->rq_xprt;
+       if (ret < 0) {
+               /* Post of read-list failed, free context. */
+               svc_rdma_put_context(ctxt, 1);
+               return 0;
+       }
 
        ret = rqstp->rq_arg.head[0].iov_len
                + rqstp->rq_arg.page_len
@@ -569,11 +532,8 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
        return ret;
 
  close_out:
-       if (ctxt) {
+       if (ctxt)
                svc_rdma_put_context(ctxt, 1);
-               /* Indicate we've consumed an RQ credit */
-               rqstp->rq_xprt_ctxt = rqstp->rq_xprt;
-       }
        dprintk("svcrdma: transport %p is closing\n", xprt);
        /*
         * Set the close bit and enqueue it. svc_recv will see the
index 981f190..fb82b1b 100644 (file)
@@ -389,6 +389,17 @@ static int send_reply(struct svcxprt_rdma *rdma,
        int page_no;
        int ret;
 
+       /* Post a recv buffer to handle another request. */
+       ret = svc_rdma_post_recv(rdma);
+       if (ret) {
+               printk(KERN_INFO
+                      "svcrdma: could not post a receive buffer, err=%d."
+                      "Closing transport %p.\n", ret, rdma);
+               set_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags);
+               svc_rdma_put_context(ctxt, 0);
+               return -ENOTCONN;
+       }
+
        /* Prepare the context */
        ctxt->pages[0] = page;
        ctxt->count = 1;
index af408fc..e132509 100644 (file)
@@ -103,8 +103,8 @@ static int rdma_bump_context_cache(struct svcxprt_rdma *xprt)
                spin_lock_bh(&xprt->sc_ctxt_lock);
                if (ctxt) {
                        at_least_one = 1;
-                       ctxt->next = xprt->sc_ctxt_head;
-                       xprt->sc_ctxt_head = ctxt;
+                       INIT_LIST_HEAD(&ctxt->free_list);
+                       list_add(&ctxt->free_list, &xprt->sc_ctxt_free);
                } else {
                        /* kmalloc failed...give up for now */
                        xprt->sc_ctxt_cnt--;
@@ -123,7 +123,7 @@ struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *xprt)
 
        while (1) {
                spin_lock_bh(&xprt->sc_ctxt_lock);
-               if (unlikely(xprt->sc_ctxt_head == NULL)) {
+               if (unlikely(list_empty(&xprt->sc_ctxt_free))) {
                        /* Try to bump my cache. */
                        spin_unlock_bh(&xprt->sc_ctxt_lock);
 
@@ -136,12 +136,15 @@ struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *xprt)
                        schedule_timeout_uninterruptible(msecs_to_jiffies(500));
                        continue;
                }
-               ctxt = xprt->sc_ctxt_head;
-               xprt->sc_ctxt_head = ctxt->next;
+               ctxt = list_entry(xprt->sc_ctxt_free.next,
+                                 struct svc_rdma_op_ctxt,
+                                 free_list);
+               list_del_init(&ctxt->free_list);
                spin_unlock_bh(&xprt->sc_ctxt_lock);
                ctxt->xprt = xprt;
                INIT_LIST_HEAD(&ctxt->dto_q);
                ctxt->count = 0;
+               atomic_inc(&xprt->sc_ctxt_used);
                break;
        }
        return ctxt;
@@ -159,14 +162,15 @@ void svc_rdma_put_context(struct svc_rdma_op_ctxt *ctxt, int free_pages)
                        put_page(ctxt->pages[i]);
 
        for (i = 0; i < ctxt->count; i++)
-               dma_unmap_single(xprt->sc_cm_id->device->dma_device,
-                                ctxt->sge[i].addr,
-                                ctxt->sge[i].length,
-                                ctxt->direction);
+               ib_dma_unmap_single(xprt->sc_cm_id->device,
+                                   ctxt->sge[i].addr,
+                                   ctxt->sge[i].length,
+                                   ctxt->direction);
+
        spin_lock_bh(&xprt->sc_ctxt_lock);
-       ctxt->next = xprt->sc_ctxt_head;
-       xprt->sc_ctxt_head = ctxt;
+       list_add(&ctxt->free_list, &xprt->sc_ctxt_free);
        spin_unlock_bh(&xprt->sc_ctxt_lock);
+       atomic_dec(&xprt->sc_ctxt_used);
 }
 
 /* ib_cq event handler */
@@ -228,23 +232,8 @@ static void dto_tasklet_func(unsigned long data)
                list_del_init(&xprt->sc_dto_q);
                spin_unlock_irqrestore(&dto_lock, flags);
 
-               if (test_and_clear_bit(RDMAXPRT_RQ_PENDING, &xprt->sc_flags)) {
-                       ib_req_notify_cq(xprt->sc_rq_cq, IB_CQ_NEXT_COMP);
-                       rq_cq_reap(xprt);
-                       set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags);
-                       /*
-                        * If data arrived before established event,
-                        * don't enqueue. This defers RPC I/O until the
-                        * RDMA connection is complete.
-                        */
-                       if (!test_bit(RDMAXPRT_CONN_PENDING, &xprt->sc_flags))
-                               svc_xprt_enqueue(&xprt->sc_xprt);
-               }
-
-               if (test_and_clear_bit(RDMAXPRT_SQ_PENDING, &xprt->sc_flags)) {
-                       ib_req_notify_cq(xprt->sc_sq_cq, IB_CQ_NEXT_COMP);
-                       sq_cq_reap(xprt);
-               }
+               rq_cq_reap(xprt);
+               sq_cq_reap(xprt);
 
                svc_xprt_put(&xprt->sc_xprt);
                spin_lock_irqsave(&dto_lock, flags);
@@ -263,11 +252,15 @@ static void rq_comp_handler(struct ib_cq *cq, void *cq_context)
        struct svcxprt_rdma *xprt = cq_context;
        unsigned long flags;
 
+       /* Guard against unconditional flush call for destroyed QP */
+       if (atomic_read(&xprt->sc_xprt.xpt_ref.refcount)==0)
+               return;
+
        /*
         * Set the bit regardless of whether or not it's on the list
         * because it may be on the list already due to an SQ
         * completion.
-       */
+        */
        set_bit(RDMAXPRT_RQ_PENDING, &xprt->sc_flags);
 
        /*
@@ -290,6 +283,8 @@ static void rq_comp_handler(struct ib_cq *cq, void *cq_context)
  *
  * Take all completing WC off the CQE and enqueue the associated DTO
  * context on the dto_q for the transport.
+ *
+ * Note that caller must hold a transport reference.
  */
 static void rq_cq_reap(struct svcxprt_rdma *xprt)
 {
@@ -297,29 +292,47 @@ static void rq_cq_reap(struct svcxprt_rdma *xprt)
        struct ib_wc wc;
        struct svc_rdma_op_ctxt *ctxt = NULL;
 
+       if (!test_and_clear_bit(RDMAXPRT_RQ_PENDING, &xprt->sc_flags))
+               return;
+
+       ib_req_notify_cq(xprt->sc_rq_cq, IB_CQ_NEXT_COMP);
        atomic_inc(&rdma_stat_rq_poll);
 
-       spin_lock_bh(&xprt->sc_rq_dto_lock);
        while ((ret = ib_poll_cq(xprt->sc_rq_cq, 1, &wc)) > 0) {
                ctxt = (struct svc_rdma_op_ctxt *)(unsigned long)wc.wr_id;
                ctxt->wc_status = wc.status;
                ctxt->byte_len = wc.byte_len;
                if (wc.status != IB_WC_SUCCESS) {
                        /* Close the transport */
+                       dprintk("svcrdma: transport closing putting ctxt %p\n", ctxt);
                        set_bit(XPT_CLOSE, &xprt->sc_xprt.xpt_flags);
                        svc_rdma_put_context(ctxt, 1);
+                       svc_xprt_put(&xprt->sc_xprt);
                        continue;
                }
+               spin_lock_bh(&xprt->sc_rq_dto_lock);
                list_add_tail(&ctxt->dto_q, &xprt->sc_rq_dto_q);
+               spin_unlock_bh(&xprt->sc_rq_dto_lock);
+               svc_xprt_put(&xprt->sc_xprt);
        }
-       spin_unlock_bh(&xprt->sc_rq_dto_lock);
 
        if (ctxt)
                atomic_inc(&rdma_stat_rq_prod);
+
+       set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags);
+       /*
+        * If data arrived before established event,
+        * don't enqueue. This defers RPC I/O until the
+        * RDMA connection is complete.
+        */
+       if (!test_bit(RDMAXPRT_CONN_PENDING, &xprt->sc_flags))
+               svc_xprt_enqueue(&xprt->sc_xprt);
 }
 
 /*
  * Send Queue Completion Handler - potentially called on interrupt context.
+ *
+ * Note that caller must hold a transport reference.
  */
 static void sq_cq_reap(struct svcxprt_rdma *xprt)
 {
@@ -328,6 +341,11 @@ static void sq_cq_reap(struct svcxprt_rdma *xprt)
        struct ib_cq *cq = xprt->sc_sq_cq;
        int ret;
 
+
+       if (!test_and_clear_bit(RDMAXPRT_SQ_PENDING, &xprt->sc_flags))
+               return;
+
+       ib_req_notify_cq(xprt->sc_sq_cq, IB_CQ_NEXT_COMP);
        atomic_inc(&rdma_stat_sq_poll);
        while ((ret = ib_poll_cq(cq, 1, &wc)) > 0) {
                ctxt = (struct svc_rdma_op_ctxt *)(unsigned long)wc.wr_id;
@@ -349,14 +367,16 @@ static void sq_cq_reap(struct svcxprt_rdma *xprt)
 
                case IB_WR_RDMA_READ:
                        if (test_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags)) {
+                               struct svc_rdma_op_ctxt *read_hdr = ctxt->read_hdr;
+                               BUG_ON(!read_hdr);
                                set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags);
-                               set_bit(RDMACTXT_F_READ_DONE, &ctxt->flags);
                                spin_lock_bh(&xprt->sc_read_complete_lock);
-                               list_add_tail(&ctxt->dto_q,
+                               list_add_tail(&read_hdr->dto_q,
                                              &xprt->sc_read_complete_q);
                                spin_unlock_bh(&xprt->sc_read_complete_lock);
                                svc_xprt_enqueue(&xprt->sc_xprt);
                        }
+                       svc_rdma_put_context(ctxt, 0);
                        break;
 
                default:
@@ -365,6 +385,7 @@ static void sq_cq_reap(struct svcxprt_rdma *xprt)
                               wc.opcode, wc.status);
                        break;
                }
+               svc_xprt_put(&xprt->sc_xprt);
        }
 
        if (ctxt)
@@ -376,11 +397,15 @@ static void sq_comp_handler(struct ib_cq *cq, void *cq_context)
        struct svcxprt_rdma *xprt = cq_context;
        unsigned long flags;
 
+       /* Guard against unconditional flush call for destroyed QP */
+       if (atomic_read(&xprt->sc_xprt.xpt_ref.refcount)==0)
+               return;
+
        /*
         * Set the bit regardless of whether or not it's on the list
         * because it may be on the list already due to an RQ
         * completion.
-       */
+        */
        set_bit(RDMAXPRT_SQ_PENDING, &xprt->sc_flags);
 
        /*
@@ -407,28 +432,29 @@ static void create_context_cache(struct svcxprt_rdma *xprt,
        xprt->sc_ctxt_max = ctxt_max;
        xprt->sc_ctxt_bump = ctxt_bump;
        xprt->sc_ctxt_cnt = 0;
-       xprt->sc_ctxt_head = NULL;
+       atomic_set(&xprt->sc_ctxt_used, 0);
+
+       INIT_LIST_HEAD(&xprt->sc_ctxt_free);
        for (i = 0; i < ctxt_count; i++) {
                ctxt = kmalloc(sizeof(*ctxt), GFP_KERNEL);
                if (ctxt) {
-                       ctxt->next = xprt->sc_ctxt_head;
-                       xprt->sc_ctxt_head = ctxt;
+                       INIT_LIST_HEAD(&ctxt->free_list);
+                       list_add(&ctxt->free_list, &xprt->sc_ctxt_free);
                        xprt->sc_ctxt_cnt++;
                }
        }
 }
 
-static void destroy_context_cache(struct svc_rdma_op_ctxt *ctxt)
+static void destroy_context_cache(struct svcxprt_rdma *xprt)
 {
-       struct svc_rdma_op_ctxt *next;
-       if (!ctxt)
-               return;
-
-       do {
-               next = ctxt->next;
+       while (!list_empty(&xprt->sc_ctxt_free)) {
+               struct svc_rdma_op_ctxt *ctxt;
+               ctxt = list_entry(xprt->sc_ctxt_free.next,
+                                 struct svc_rdma_op_ctxt,
+                                 free_list);
+               list_del_init(&ctxt->free_list);
                kfree(ctxt);
-               ctxt = next;
-       } while (next);
+       }
 }
 
 static struct svcxprt_rdma *rdma_create_xprt(struct svc_serv *serv,
@@ -465,7 +491,7 @@ static struct svcxprt_rdma *rdma_create_xprt(struct svc_serv *serv,
                                     reqs +
                                     cma_xprt->sc_sq_depth +
                                     RPCRDMA_MAX_THREADS + 1); /* max */
-               if (!cma_xprt->sc_ctxt_head) {
+               if (list_empty(&cma_xprt->sc_ctxt_free)) {
                        kfree(cma_xprt);
                        return NULL;
                }
@@ -520,7 +546,12 @@ int svc_rdma_post_recv(struct svcxprt_rdma *xprt)
        recv_wr.num_sge = ctxt->count;
        recv_wr.wr_id = (u64)(unsigned long)ctxt;
 
+       svc_xprt_get(&xprt->sc_xprt);
        ret = ib_post_recv(xprt->sc_qp, &recv_wr, &bad_recv_wr);
+       if (ret) {
+               svc_xprt_put(&xprt->sc_xprt);
+               svc_rdma_put_context(ctxt, 1);
+       }
        return ret;
 }
 
@@ -539,6 +570,7 @@ static void handle_connect_req(struct rdma_cm_id *new_cma_id)
 {
        struct svcxprt_rdma *listen_xprt = new_cma_id->context;
        struct svcxprt_rdma *newxprt;
+       struct sockaddr *sa;
 
        /* Create a new transport */
        newxprt = rdma_create_xprt(listen_xprt->sc_xprt.xpt_server, 0);
@@ -551,6 +583,12 @@ static void handle_connect_req(struct rdma_cm_id *new_cma_id)
        dprintk("svcrdma: Creating newxprt=%p, cm_id=%p, listenxprt=%p\n",
                newxprt, newxprt->sc_cm_id, listen_xprt);
 
+       /* Set the local and remote addresses in the transport */
+       sa = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.dst_addr;
+       svc_xprt_set_remote(&newxprt->sc_xprt, sa, svc_addr_len(sa));
+       sa = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.src_addr;
+       svc_xprt_set_local(&newxprt->sc_xprt, sa, svc_addr_len(sa));
+
        /*
         * Enqueue the new transport on the accept queue of the listening
         * transport
@@ -627,6 +665,7 @@ static int rdma_cma_handler(struct rdma_cm_id *cma_id,
                if (xprt) {
                        set_bit(XPT_CLOSE, &xprt->xpt_flags);
                        svc_xprt_enqueue(xprt);
+                       svc_xprt_put(xprt);
                }
                break;
        case RDMA_CM_EVENT_DEVICE_REMOVAL:
@@ -661,31 +700,27 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv *serv,
 
        cma_xprt = rdma_create_xprt(serv, 1);
        if (!cma_xprt)
-               return ERR_PTR(ENOMEM);
+               return ERR_PTR(-ENOMEM);
        xprt = &cma_xprt->sc_xprt;
 
        listen_id = rdma_create_id(rdma_listen_handler, cma_xprt, RDMA_PS_TCP);
        if (IS_ERR(listen_id)) {
-               svc_xprt_put(&cma_xprt->sc_xprt);
-               dprintk("svcrdma: rdma_create_id failed = %ld\n",
-                       PTR_ERR(listen_id));
-               return (void *)listen_id;
+               ret = PTR_ERR(listen_id);
+               dprintk("svcrdma: rdma_create_id failed = %d\n", ret);
+               goto err0;
        }
+
        ret = rdma_bind_addr(listen_id, sa);
        if (ret) {
-               rdma_destroy_id(listen_id);
-               svc_xprt_put(&cma_xprt->sc_xprt);
                dprintk("svcrdma: rdma_bind_addr failed = %d\n", ret);
-               return ERR_PTR(ret);
+               goto err1;
        }
        cma_xprt->sc_cm_id = listen_id;
 
        ret = rdma_listen(listen_id, RPCRDMA_LISTEN_BACKLOG);
        if (ret) {
-               rdma_destroy_id(listen_id);
-               svc_xprt_put(&cma_xprt->sc_xprt);
                dprintk("svcrdma: rdma_listen failed = %d\n", ret);
-               return ERR_PTR(ret);
+               goto err1;
        }
 
        /*
@@ -696,6 +731,12 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv *serv,
        svc_xprt_set_local(&cma_xprt->sc_xprt, sa, salen);
 
        return &cma_xprt->sc_xprt;
+
+ err1:
+       rdma_destroy_id(listen_id);
+ err0:
+       kfree(cma_xprt);
+       return ERR_PTR(ret);
 }
 
 /*
@@ -716,7 +757,6 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
        struct rdma_conn_param conn_param;
        struct ib_qp_init_attr qp_attr;
        struct ib_device_attr devattr;
-       struct sockaddr *sa;
        int ret;
        int i;
 
@@ -826,7 +866,6 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
                newxprt->sc_sq_depth = qp_attr.cap.max_send_wr;
                newxprt->sc_max_requests = qp_attr.cap.max_recv_wr;
        }
-       svc_xprt_get(&newxprt->sc_xprt);
        newxprt->sc_qp = newxprt->sc_cm_id->qp;
 
        /* Register all of physical memory */
@@ -850,6 +889,13 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
        /* Swap out the handler */
        newxprt->sc_cm_id->event_handler = rdma_cma_handler;
 
+       /*
+        * Arm the CQs for the SQ and RQ before accepting so we can't
+        * miss the first message
+        */
+       ib_req_notify_cq(newxprt->sc_sq_cq, IB_CQ_NEXT_COMP);
+       ib_req_notify_cq(newxprt->sc_rq_cq, IB_CQ_NEXT_COMP);
+
        /* Accept Connection */
        set_bit(RDMAXPRT_CONN_PENDING, &newxprt->sc_flags);
        memset(&conn_param, 0, sizeof conn_param);
@@ -886,58 +932,26 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
                newxprt->sc_max_requests,
                newxprt->sc_ord);
 
-       /* Set the local and remote addresses in the transport */
-       sa = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.dst_addr;
-       svc_xprt_set_remote(&newxprt->sc_xprt, sa, svc_addr_len(sa));
-       sa = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.src_addr;
-       svc_xprt_set_local(&newxprt->sc_xprt, sa, svc_addr_len(sa));
-
-       ib_req_notify_cq(newxprt->sc_sq_cq, IB_CQ_NEXT_COMP);
-       ib_req_notify_cq(newxprt->sc_rq_cq, IB_CQ_NEXT_COMP);
        return &newxprt->sc_xprt;
 
  errout:
        dprintk("svcrdma: failure accepting new connection rc=%d.\n", ret);
        /* Take a reference in case the DTO handler runs */
        svc_xprt_get(&newxprt->sc_xprt);
-       if (newxprt->sc_qp && !IS_ERR(newxprt->sc_qp)) {
+       if (newxprt->sc_qp && !IS_ERR(newxprt->sc_qp))
                ib_destroy_qp(newxprt->sc_qp);
-               svc_xprt_put(&newxprt->sc_xprt);
-       }
        rdma_destroy_id(newxprt->sc_cm_id);
        /* This call to put will destroy the transport */
        svc_xprt_put(&newxprt->sc_xprt);
        return NULL;
 }
 
-/*
- * Post an RQ WQE to the RQ when the rqst is being released. This
- * effectively returns an RQ credit to the client. The rq_xprt_ctxt
- * will be null if the request is deferred due to an RDMA_READ or the
- * transport had no data ready (EAGAIN). Note that an RPC deferred in
- * svc_process will still return the credit, this is because the data
- * is copied and no longer consume a WQE/WC.
- */
 static void svc_rdma_release_rqst(struct svc_rqst *rqstp)
 {
-       int err;
-       struct svcxprt_rdma *rdma =
-               container_of(rqstp->rq_xprt, struct svcxprt_rdma, sc_xprt);
-       if (rqstp->rq_xprt_ctxt) {
-               BUG_ON(rqstp->rq_xprt_ctxt != rdma);
-               err = svc_rdma_post_recv(rdma);
-               if (err)
-                       dprintk("svcrdma: failed to post an RQ WQE error=%d\n",
-                               err);
-       }
-       rqstp->rq_xprt_ctxt = NULL;
 }
 
 /*
- * When connected, an svc_xprt has at least three references:
- *
- * - A reference held by the QP. We still hold that here because this
- *   code deletes the QP and puts the reference.
+ * When connected, an svc_xprt has at least two references:
  *
  * - A reference held by the cm_id between the ESTABLISHED and
  *   DISCONNECTED events. If the remote peer disconnected first, this
@@ -946,7 +960,7 @@ static void svc_rdma_release_rqst(struct svc_rqst *rqstp)
  * - A reference held by the svc_recv code that called this function
  *   as part of close processing.
  *
- * At a minimum two references should still be held.
+ * At a minimum one references should still be held.
  */
 static void svc_rdma_detach(struct svc_xprt *xprt)
 {
@@ -956,23 +970,53 @@ static void svc_rdma_detach(struct svc_xprt *xprt)
 
        /* Disconnect and flush posted WQE */
        rdma_disconnect(rdma->sc_cm_id);
-
-       /* Destroy the QP if present (not a listener) */
-       if (rdma->sc_qp && !IS_ERR(rdma->sc_qp)) {
-               ib_destroy_qp(rdma->sc_qp);
-               svc_xprt_put(xprt);
-       }
-
-       /* Destroy the CM ID */
-       rdma_destroy_id(rdma->sc_cm_id);
 }
 
-static void svc_rdma_free(struct svc_xprt *xprt)
+static void __svc_rdma_free(struct work_struct *work)
 {
-       struct svcxprt_rdma *rdma = (struct svcxprt_rdma *)xprt;
+       struct svcxprt_rdma *rdma =
+               container_of(work, struct svcxprt_rdma, sc_work);
        dprintk("svcrdma: svc_rdma_free(%p)\n", rdma);
+
        /* We should only be called from kref_put */
-       BUG_ON(atomic_read(&xprt->xpt_ref.refcount) != 0);
+       BUG_ON(atomic_read(&rdma->sc_xprt.xpt_ref.refcount) != 0);
+
+       /*
+        * Destroy queued, but not processed read completions. Note
+        * that this cleanup has to be done before destroying the
+        * cm_id because the device ptr is needed to unmap the dma in
+        * svc_rdma_put_context.
+        */
+       spin_lock_bh(&rdma->sc_read_complete_lock);
+       while (!list_empty(&rdma->sc_read_complete_q)) {
+               struct svc_rdma_op_ctxt *ctxt;
+               ctxt = list_entry(rdma->sc_read_complete_q.next,
+                                 struct svc_rdma_op_ctxt,
+                                 dto_q);
+               list_del_init(&ctxt->dto_q);
+               svc_rdma_put_context(ctxt, 1);
+       }
+       spin_unlock_bh(&rdma->sc_read_complete_lock);
+
+       /* Destroy queued, but not processed recv completions */
+       spin_lock_bh(&rdma->sc_rq_dto_lock);
+       while (!list_empty(&rdma->sc_rq_dto_q)) {
+               struct svc_rdma_op_ctxt *ctxt;
+               ctxt = list_entry(rdma->sc_rq_dto_q.next,
+                                 struct svc_rdma_op_ctxt,
+                                 dto_q);
+               list_del_init(&ctxt->dto_q);
+               svc_rdma_put_context(ctxt, 1);
+       }
+       spin_unlock_bh(&rdma->sc_rq_dto_lock);
+
+       /* Warn if we leaked a resource or under-referenced */
+       WARN_ON(atomic_read(&rdma->sc_ctxt_used) != 0);
+
+       /* Destroy the QP if present (not a listener) */
+       if (rdma->sc_qp && !IS_ERR(rdma->sc_qp))
+               ib_destroy_qp(rdma->sc_qp);
+
        if (rdma->sc_sq_cq && !IS_ERR(rdma->sc_sq_cq))
                ib_destroy_cq(rdma->sc_sq_cq);
 
@@ -985,10 +1029,21 @@ static void svc_rdma_free(struct svc_xprt *xprt)
        if (rdma->sc_pd && !IS_ERR(rdma->sc_pd))
                ib_dealloc_pd(rdma->sc_pd);
 
-       destroy_context_cache(rdma->sc_ctxt_head);
+       /* Destroy the CM ID */
+       rdma_destroy_id(rdma->sc_cm_id);
+
+       destroy_context_cache(rdma);
        kfree(rdma);
 }
 
+static void svc_rdma_free(struct svc_xprt *xprt)
+{
+       struct svcxprt_rdma *rdma =
+               container_of(xprt, struct svcxprt_rdma, sc_xprt);
+       INIT_WORK(&rdma->sc_work, __svc_rdma_free);
+       schedule_work(&rdma->sc_work);
+}
+
 static int svc_rdma_has_wspace(struct svc_xprt *xprt)
 {
        struct svcxprt_rdma *rdma =
@@ -1018,7 +1073,7 @@ int svc_rdma_send(struct svcxprt_rdma *xprt, struct ib_send_wr *wr)
        int ret;
 
        if (test_bit(XPT_CLOSE, &xprt->sc_xprt.xpt_flags))
-               return 0;
+               return -ENOTCONN;
 
        BUG_ON(wr->send_flags != IB_SEND_SIGNALED);
        BUG_ON(((struct svc_rdma_op_ctxt *)(unsigned long)wr->wr_id)->wr_op !=
@@ -1029,7 +1084,8 @@ int svc_rdma_send(struct svcxprt_rdma *xprt, struct ib_send_wr *wr)
                if (xprt->sc_sq_depth == atomic_read(&xprt->sc_sq_count)) {
                        spin_unlock_bh(&xprt->sc_lock);
                        atomic_inc(&rdma_stat_sq_starve);
-                       /* See if we can reap some SQ WR */
+
+                       /* See if we can opportunistically reap SQ WR to make room */
                        sq_cq_reap(xprt);
 
                        /* Wait until SQ WR available if SQ still full */
@@ -1041,22 +1097,25 @@ int svc_rdma_send(struct svcxprt_rdma *xprt, struct ib_send_wr *wr)
                        continue;
                }
                /* Bumped used SQ WR count and post */
+               svc_xprt_get(&xprt->sc_xprt);
                ret = ib_post_send(xprt->sc_qp, wr, &bad_wr);
                if (!ret)
                        atomic_inc(&xprt->sc_sq_count);
-               else
+               else {
+                       svc_xprt_put(&xprt->sc_xprt);
                        dprintk("svcrdma: failed to post SQ WR rc=%d, "
                               "sc_sq_count=%d, sc_sq_depth=%d\n",
                               ret, atomic_read(&xprt->sc_sq_count),
                               xprt->sc_sq_depth);
+               }
                spin_unlock_bh(&xprt->sc_lock);
                break;
        }
        return ret;
 }
 
-int svc_rdma_send_error(struct svcxprt_rdma *xprt, struct rpcrdma_msg *rmsgp,
-                       enum rpcrdma_errcode err)
+void svc_rdma_send_error(struct svcxprt_rdma *xprt, struct rpcrdma_msg *rmsgp,
+                        enum rpcrdma_errcode err)
 {
        struct ib_send_wr err_wr;
        struct ib_sge sge;
@@ -1094,9 +1153,8 @@ int svc_rdma_send_error(struct svcxprt_rdma *xprt, struct rpcrdma_msg *rmsgp,
        /* Post It */
        ret = svc_rdma_send(xprt, &err_wr);
        if (ret) {
-               dprintk("svcrdma: Error posting send = %d\n", ret);
+               dprintk("svcrdma: Error %d posting send for protocol error\n",
+                       ret);
                svc_rdma_put_context(ctxt, 1);
        }
-
-       return ret;
 }
index a1b0fbe..b976d9e 100644 (file)
@@ -50,19 +50,8 @@ static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type)
 
        switch (type) {
        case XFRMA_ALG_AUTH:
-               if (!algp->alg_key_len &&
-                   strcmp(algp->alg_name, "digest_null") != 0)
-                       return -EINVAL;
-               break;
-
        case XFRMA_ALG_CRYPT:
-               if (!algp->alg_key_len &&
-                   strcmp(algp->alg_name, "cipher_null") != 0)
-                       return -EINVAL;
-               break;
-
        case XFRMA_ALG_COMP:
-               /* Zero length keys are legal.  */
                break;
 
        default:
index ab69ece..7ac0e30 100755 (executable)
@@ -12,12 +12,9 @@ echo ' '
 uname -a
 echo ' '
 
-gcc --version 2>&1| head -n 1 | grep -v gcc | awk \
+gcc -dumpversion 2>&1| awk \
 'NR==1{print "Gnu C                 ", $1}'
 
-gcc --version 2>&1| grep gcc | awk \
-'NR==1{print "Gnu C                 ", $3}'
-
 make --version 2>&1 | awk -F, '{print $1}' | awk \
       '/GNU Make/{print "Gnu make              ",$NF}'
 
index 812f91b..6c8ab48 100644 (file)
@@ -259,8 +259,9 @@ int snd_register_device_for_dev(int type, struct snd_card *card, int dev,
                return minor;
        }
        snd_minors[minor] = preg;
-       preg->dev = device_create(sound_class, device, MKDEV(major, minor),
-                                 "%s", name);
+       preg->dev = device_create_drvdata(sound_class, device,
+                                         MKDEV(major, minor),
+                                         private_data, "%s", name);
        if (IS_ERR(preg->dev)) {
                snd_minors[minor] = NULL;
                mutex_unlock(&sound_mutex);
@@ -269,9 +270,6 @@ int snd_register_device_for_dev(int type, struct snd_card *card, int dev,
                return minor;
        }
 
-       if (preg->dev)
-               dev_set_drvdata(preg->dev, private_data);
-
        mutex_unlock(&sound_mutex);
        return 0;
 }
index 54a1f90..1899cf0 100644 (file)
@@ -96,7 +96,7 @@ static int __devinit snd_card_pcsp_probe(int devnum, struct device *dev)
                return -EINVAL;
 
        hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       pcsp_chip.timer.cb_mode = HRTIMER_CB_IRQSAFE;
+       pcsp_chip.timer.cb_mode = HRTIMER_CB_SOFTIRQ;
        pcsp_chip.timer.function = pcsp_do_timer;
 
        card = snd_card_new(index, id, THIS_MODULE, 0);
index f07cc1e..1d661f7 100644 (file)
@@ -24,7 +24,8 @@ static DEFINE_SPINLOCK(i8253_lock);
 /* default timer freq for PC-Speaker: 18643 Hz */
 #define DIV_18KHZ 64
 #define MAX_DIV DIV_18KHZ
-#define CUR_DIV() (MAX_DIV >> chip->treble)
+#define CALC_DIV(d) (MAX_DIV >> (d))
+#define CUR_DIV() CALC_DIV(chip->treble)
 #define PCSP_MAX_TREBLE 1
 
 /* unfortunately, with hrtimers 37KHz does not work very well :( */
@@ -36,7 +37,8 @@ static DEFINE_SPINLOCK(i8253_lock);
 #define PCSP_DEFAULT_SDIV (DIV_18KHZ >> 1)
 #define PCSP_DEFAULT_SRATE (PIT_TICK_RATE / PCSP_DEFAULT_SDIV)
 #define PCSP_INDEX_INC() (1 << (PCSP_MAX_TREBLE - chip->treble))
-#define PCSP_RATE() (PIT_TICK_RATE / CUR_DIV())
+#define PCSP_CALC_RATE(i) (PIT_TICK_RATE / CALC_DIV(i))
+#define PCSP_RATE() PCSP_CALC_RATE(chip->treble)
 #define PCSP_MIN_RATE__1 MAX_DIV/PIT_TICK_RATE
 #define PCSP_MAX_RATE__1 MIN_DIV/PIT_TICK_RATE
 #define PCSP_MAX_PERIOD_NS (1000000000ULL * PCSP_MIN_RATE__1)
index 7ad4a15..e341f3f 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <sound/pcm.h>
-#include <linux/interrupt.h>
 #include <asm/io.h>
 #include "pcsp.h"
 
@@ -20,34 +19,8 @@ MODULE_PARM_DESC(nforce_wa, "Apply NForce chipset workaround "
 
 #define DMIX_WANTS_S16 1
 
-static void pcsp_start_timer(unsigned long dummy)
-{
-       hrtimer_start(&pcsp_chip.timer, ktime_set(0, 0), HRTIMER_MODE_REL);
-}
-
-/*
- * We need the hrtimer_start as a tasklet to avoid
- * the nasty locking problem. :(
- * The problem:
- * - The timer handler is called with the cpu_base->lock
- *   already held by hrtimer code.
- * - snd_pcm_period_elapsed() takes the
- *   substream->self_group.lock.
- * So far so good.
- * But the snd_pcsp_trigger() is called with the
- * substream->self_group.lock held, and it calls
- * hrtimer_start(), which takes the cpu_base->lock.
- * You see the problem. We have the code pathes
- * which take two locks in a reverse order. This
- * can deadlock and the lock validator complains.
- * The only solution I could find was to move the
- * hrtimer_start() into a tasklet. -stsp
- */
-static DECLARE_TASKLET(pcsp_start_timer_tasklet, pcsp_start_timer, 0);
-
 enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
 {
-       unsigned long flags;
        unsigned char timer_cnt, val;
        int fmt_size, periods_elapsed;
        u64 ns;
@@ -66,9 +39,7 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
                return HRTIMER_RESTART;
        }
 
-       /* hrtimer calls us from both hardirq and softirq contexts,
-        * so irqsave :( */
-       spin_lock_irqsave(&chip->substream_lock, flags);
+       spin_lock_irq(&chip->substream_lock);
        /* Takashi Iwai says regarding this extra lock:
 
        If the irq handler handles some data on the DMA buffer, it should
@@ -139,7 +110,7 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
                chip->period_ptr %= buffer_bytes;
        }
 
-       spin_unlock_irqrestore(&chip->substream_lock, flags);
+       spin_unlock_irq(&chip->substream_lock);
 
        if (!atomic_read(&chip->timer_active))
                return HRTIMER_NORESTART;
@@ -153,7 +124,7 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
 exit_nr_unlock2:
        snd_pcm_stream_unlock(substream);
 exit_nr_unlock1:
-       spin_unlock_irqrestore(&chip->substream_lock, flags);
+       spin_unlock_irq(&chip->substream_lock);
        return HRTIMER_NORESTART;
 }
 
@@ -174,7 +145,7 @@ static void pcsp_start_playing(struct snd_pcsp *chip)
        atomic_set(&chip->timer_active, 1);
        chip->thalf = 0;
 
-       tasklet_schedule(&pcsp_start_timer_tasklet);
+       hrtimer_start(&pcsp_chip.timer, ktime_set(0, 0), HRTIMER_MODE_REL);
 }
 
 static void pcsp_stop_playing(struct snd_pcsp *chip)
index 64a695f..caeb0f5 100644 (file)
@@ -50,7 +50,8 @@ static int pcsp_treble_info(struct snd_kcontrol *kcontrol,
        uinfo->value.enumerated.items = chip->max_treble + 1;
        if (uinfo->value.enumerated.item > chip->max_treble)
                uinfo->value.enumerated.item = chip->max_treble;
-       sprintf(uinfo->value.enumerated.name, "%d", PCSP_RATE());
+       sprintf(uinfo->value.enumerated.name, "%d",
+                       PCSP_CALC_RATE(uinfo->value.enumerated.item));
        return 0;
 }
 
index 857008b..3be2dc1 100644 (file)
@@ -79,7 +79,7 @@ config SOUND_TRIDENT
 
 config SOUND_MSNDCLAS
        tristate "Support for Turtle Beach MultiSound Classic, Tahiti, Monterey"
-       depends on SOUND_PRIME && (m || !STANDALONE)
+       depends on SOUND_PRIME && (m || !STANDALONE) && ISA
        help
          Say M here if you have a Turtle Beach MultiSound Classic, Tahiti or
          Monterey (not for the Pinnacle or Fiji).
@@ -143,7 +143,7 @@ config MSNDCLAS_IO
 
 config SOUND_MSNDPIN
        tristate "Support for Turtle Beach MultiSound Pinnacle, Fiji"
-       depends on SOUND_PRIME && (m || !STANDALONE)
+       depends on SOUND_PRIME && (m || !STANDALONE) && ISA
        help
          Say M here if you have a Turtle Beach MultiSound Pinnacle or Fiji.
          See <file:Documentation/sound/oss/MultiSound> for important information
index e0a605a..ff1b922 100644 (file)
@@ -2858,6 +2858,7 @@ static const char *ad1988_models[AD1988_MODEL_LAST] = {
 static struct snd_pci_quirk ad1988_cfg_tbl[] = {
        SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG),
        SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG),
+       SND_PCI_QUIRK(0x1043, 0x8277, "Asus P5K-E/WIFI-AP", AD1988_6STACK_DIG),
        {}
 };
 
index 6d4df45..8f31247 100644 (file)
@@ -853,6 +853,7 @@ do_sku:
                case 0x10ec0269:
                case 0x10ec0862:
                case 0x10ec0662:        
+               case 0x10ec0889:
                        snd_hda_codec_write(codec, 0x14, 0,
                                            AC_VERB_SET_EAPD_BTLENABLE, 2);
                        snd_hda_codec_write(codec, 0x15, 0,
@@ -877,6 +878,7 @@ do_sku:
                case 0x10ec0883:
                case 0x10ec0885:
                case 0x10ec0888:
+               case 0x10ec0889:
                        snd_hda_codec_write(codec, 0x20, 0,
                                            AC_VERB_SET_COEF_INDEX, 7);
                        tmp = snd_hda_codec_read(codec, 0x20, 0,
@@ -2981,7 +2983,7 @@ static struct snd_pci_quirk alc880_cfg_tbl[] = {
        /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
        SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG),
        SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG),
-       SND_PCI_QUIRK(0x1043, 0x814e, "ASUS", ALC880_ASUS),
+       SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG),
        SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG),
        SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST),
        SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST),
@@ -7743,6 +7745,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
        SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP),
        SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG),
        SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG),
+       SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG),
        SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC883_6ST_DIG),
        SND_PCI_QUIRK(0x1071, 0x8253, "Mitac 8252d", ALC883_MITAC),
        SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD),
@@ -8757,35 +8760,39 @@ static struct hda_input_mux alc262_HP_D7000_capture_source = {
        },
 };
 
-/* mute/unmute internal speaker according to the hp jack and mute state */
+/* mute/unmute internal speaker according to the hp jacks and mute state */
 static void alc262_fujitsu_automute(struct hda_codec *codec, int force)
 {
        struct alc_spec *spec = codec->spec;
        unsigned int mute;
 
        if (force || !spec->sense_updated) {
-               unsigned int present_int_hp, present_dock_hp;
+               unsigned int present;
                /* need to execute and sync at first */
                snd_hda_codec_read(codec, 0x14, 0, AC_VERB_SET_PIN_SENSE, 0);
-               present_int_hp = snd_hda_codec_read(codec, 0x14, 0,
-                                       AC_VERB_GET_PIN_SENSE, 0);
-               snd_hda_codec_read(codec, 0x1B, 0, AC_VERB_SET_PIN_SENSE, 0);
-               present_dock_hp = snd_hda_codec_read(codec, 0x1b, 0,
-                                       AC_VERB_GET_PIN_SENSE, 0);
-               spec->jack_present = (present_int_hp & 0x80000000) != 0;
-               spec->jack_present |= (present_dock_hp & 0x80000000) != 0;
+               /* check laptop HP jack */
+               present = snd_hda_codec_read(codec, 0x14, 0,
+                                            AC_VERB_GET_PIN_SENSE, 0);
+               /* need to execute and sync at first */
+               snd_hda_codec_read(codec, 0x1b, 0, AC_VERB_SET_PIN_SENSE, 0);
+               /* check docking HP jack */
+               present |= snd_hda_codec_read(codec, 0x1b, 0,
+                                             AC_VERB_GET_PIN_SENSE, 0);
+               if (present & AC_PINSENSE_PRESENCE)
+                       spec->jack_present = 1;
+               else
+                       spec->jack_present = 0;
                spec->sense_updated = 1;
        }
-       if (spec->jack_present) {
-               /* mute internal speaker */
-               snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
-                                        HDA_AMP_MUTE, HDA_AMP_MUTE);
-       } else {
-               /* unmute internal speaker if necessary */
+       /* unmute internal speaker only if both HPs are unplugged and
+        * master switch is on
+        */
+       if (spec->jack_present)
+               mute = HDA_AMP_MUTE;
+       else
                mute = snd_hda_codec_amp_read(codec, 0x14, 0, HDA_OUTPUT, 0);
-               snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
-                                        HDA_AMP_MUTE, mute);
-       }
+       snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
+                                HDA_AMP_MUTE, mute);
 }
 
 /* unsolicited event for HP jack sensing */
@@ -8797,6 +8804,11 @@ static void alc262_fujitsu_unsol_event(struct hda_codec *codec,
        alc262_fujitsu_automute(codec, 1);
 }
 
+static void alc262_fujitsu_init_hook(struct hda_codec *codec)
+{
+       alc262_fujitsu_automute(codec, 1);
+}
+
 /* bind volumes of both NID 0x0c and 0x0d */
 static struct hda_bind_ctls alc262_fujitsu_bind_master_vol = {
        .ops = &snd_hda_bind_vol,
@@ -9570,6 +9582,7 @@ static struct alc_config_preset alc262_presets[] = {
                .channel_mode = alc262_modes,
                .input_mux = &alc262_fujitsu_capture_source,
                .unsol_event = alc262_fujitsu_unsol_event,
+               .init_hook = alc262_fujitsu_init_hook,
        },
        [ALC262_HP_BPC] = {
                .mixers = { alc262_HP_BPC_mixer },
index 393f7fd..a4f44a0 100644 (file)
@@ -840,7 +840,7 @@ static struct snd_kcontrol_new stac92hd71bxx_mixer[] = {
 static struct snd_kcontrol_new stac925x_mixer[] = {
        STAC_INPUT_SOURCE(1),
        HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT),
-       HDA_CODEC_MUTE("Capture Switch", 0x09, 0, HDA_OUTPUT),
+       HDA_CODEC_MUTE("Capture Switch", 0x14, 0, HDA_OUTPUT),
        HDA_CODEC_VOLUME("Capture Mux Volume", 0x0f, 0, HDA_OUTPUT),
        { } /* end */
 };
index 52b1d81..e7e4352 100644 (file)
@@ -447,6 +447,23 @@ static struct hda_pcm_stream vt1708_pcm_analog_playback = {
        },
 };
 
+static struct hda_pcm_stream vt1708_pcm_analog_s16_playback = {
+       .substreams = 1,
+       .channels_min = 2,
+       .channels_max = 8,
+       .nid = 0x10, /* NID to query formats and rates */
+       /* We got noisy outputs on the right channel on VT1708 when
+        * 24bit samples are used.  Until any workaround is found,
+        * disable the 24bit format, so far.
+        */
+       .formats = SNDRV_PCM_FMTBIT_S16_LE,
+       .ops = {
+               .open = via_playback_pcm_open,
+               .prepare = via_playback_pcm_prepare,
+               .cleanup = via_playback_pcm_cleanup
+       },
+};
+
 static struct hda_pcm_stream vt1708_pcm_analog_capture = {
        .substreams = 2,
        .channels_min = 2,
@@ -899,6 +916,9 @@ static int patch_vt1708(struct hda_codec *codec)
        
        spec->stream_name_analog = "VT1708 Analog";
        spec->stream_analog_playback = &vt1708_pcm_analog_playback;
+       /* disable 32bit format on VT1708 */
+       if (codec->vendor_id == 0x11061708)
+               spec->stream_analog_playback = &vt1708_pcm_analog_s16_playback;
        spec->stream_analog_capture = &vt1708_pcm_analog_capture;
 
        spec->stream_name_digital = "VT1708 Digital";
index e97d8b2..a972f77 100644 (file)
@@ -351,8 +351,8 @@ static struct snd_card* create_card(struct usb_device* usb_dev)
        dev = caiaqdev(card);
        dev->chip.dev = usb_dev;
        dev->chip.card = card;
-       dev->chip.usb_id = USB_ID(usb_dev->descriptor.idVendor,
-                                       usb_dev->descriptor.idProduct);
+       dev->chip.usb_id = USB_ID(le16_to_cpu(usb_dev->descriptor.idVendor),
+                                 le16_to_cpu(usb_dev->descriptor.idProduct));
        spin_lock_init(&dev->spinlock);
        snd_card_set_dev(card, &usb_dev->dev);