Automatic merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2...
authorLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 5 May 2005 02:52:45 +0000 (19:52 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 5 May 2005 02:52:45 +0000 (19:52 -0700)
195 files changed:
Documentation/aoe/aoe.txt
Documentation/aoe/status.sh
Documentation/pci.txt
Documentation/power/pci.txt
arch/alpha/Kconfig
arch/arm/Kconfig
arch/arm/boot/compressed/head.S
arch/arm/mach-imx/generic.c
arch/arm/mach-integrator/core.c
arch/arm/mach-integrator/leds.c
arch/arm/mach-ixp4xx/common-pci.c
arch/arm/mm/Kconfig
arch/arm26/Kconfig
arch/i386/Kconfig
arch/m68knommu/Kconfig
arch/mips/Kconfig
arch/parisc/Kconfig
arch/ppc/Kconfig
arch/ppc64/Kconfig
arch/ppc64/Makefile
arch/sh/Kconfig
arch/sparc/prom/memory.c
arch/sparc/prom/sun4prom.c
arch/sparc64/kernel/irq.c
arch/x86_64/Kconfig
drivers/block/Kconfig
drivers/block/aoe/aoe.h
drivers/block/aoe/aoeblk.c
drivers/block/aoe/aoedev.c
drivers/block/aoe/aoenet.c
drivers/char/Kconfig
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/ipmi/ipmi_si_sm.h
drivers/char/mbcs.c
drivers/char/mbcs.h
drivers/char/sonypi.c
drivers/mmc/Kconfig
drivers/net/Kconfig
drivers/net/appletalk/Kconfig
drivers/net/hamradio/Kconfig
drivers/net/irda/Kconfig
drivers/net/ppp_deflate.c
drivers/net/ppp_generic.c
drivers/net/wan/Kconfig
drivers/net/wan/cycx_x25.c
drivers/net/wan/pc300_tty.c
drivers/net/wan/sdla_chdlc.c
drivers/net/wan/x25_asy.c
drivers/parport/Kconfig
drivers/parport/parport_pc.c
drivers/pci/hotplug/ibmphp.h
drivers/pci/hotplug/ibmphp_hpc.c
drivers/pci/hotplug/ibmphp_pci.c
drivers/pci/hotplug/pci_hotplug.h
drivers/pci/hotplug/pciehp_core.c
drivers/pci/hotplug/pcihp_skeleton.c
drivers/pci/msi.c
drivers/pci/pci-acpi.c
drivers/pci/pci-driver.c
drivers/pci/pci-sysfs.c
drivers/pci/pci.c
drivers/pci/probe.c
drivers/pci/proc.c
drivers/pci/quirks.c
drivers/scsi/Kconfig
drivers/usb/core/message.c
drivers/usb/core/urb.c
drivers/usb/gadget/ether.c
drivers/usb/gadget/inode.c
drivers/usb/gadget/lh7a40x_udc.c
drivers/usb/gadget/serial.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-hub.c
drivers/usb/host/ehci.h
drivers/usb/host/hc_crisv10.c
drivers/usb/host/sl811-hcd.c
drivers/usb/image/mdc800.c
drivers/usb/input/aiptek.c
drivers/usb/input/mtouchusb.c
drivers/usb/media/ov511.c
drivers/usb/media/pwc/pwc-ctrl.c
drivers/usb/media/pwc/pwc-if.c
drivers/usb/media/pwc/pwc-ioctl.h
drivers/usb/misc/legousbtower.c
drivers/usb/net/usbnet.c
drivers/usb/net/zd1201.c
drivers/usb/serial/Kconfig
drivers/usb/serial/Makefile
drivers/usb/serial/airprime.c [new file with mode: 0644]
drivers/usb/serial/cypress_m8.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio.h
drivers/usb/serial/io_usbvend.h
drivers/usb/serial/keyspan_usa90msg.h
drivers/usb/storage/debug.c
drivers/usb/storage/shuttle_usbat.c
drivers/usb/storage/unusual_devs.h
drivers/video/cyber2000fb.c
drivers/video/i810/i810_main.c
fs/jfs/inode.c
fs/jfs/jfs_dmap.c
fs/jfs/jfs_dtree.c
fs/jfs/jfs_imap.c
fs/jfs/jfs_incore.h
fs/jfs/jfs_logmgr.c
fs/jfs/jfs_logmgr.h
fs/jfs/jfs_metapage.c
fs/jfs/jfs_metapage.h
fs/jfs/jfs_mount.c
fs/jfs/jfs_txnmgr.c
fs/jfs/jfs_umount.c
fs/jfs/jfs_xtree.c
fs/jfs/resize.c
fs/jfs/super.c
include/asm-alpha/signal.h
include/asm-arm/arch-cl7500/vmalloc.h
include/asm-arm/arch-clps711x/vmalloc.h
include/asm-arm/arch-ebsa110/vmalloc.h
include/asm-arm/arch-ebsa285/vmalloc.h
include/asm-arm/arch-epxa10db/vmalloc.h
include/asm-arm/arch-h720x/vmalloc.h
include/asm-arm/arch-imx/vmalloc.h
include/asm-arm/arch-integrator/platform.h
include/asm-arm/arch-integrator/vmalloc.h
include/asm-arm/arch-iop3xx/vmalloc.h
include/asm-arm/arch-ixp2000/vmalloc.h
include/asm-arm/arch-ixp4xx/vmalloc.h
include/asm-arm/arch-l7200/vmalloc.h
include/asm-arm/arch-lh7a40x/vmalloc.h
include/asm-arm/arch-omap/vmalloc.h
include/asm-arm/arch-pxa/vmalloc.h
include/asm-arm/arch-rpc/vmalloc.h
include/asm-arm/arch-s3c2410/vmalloc.h
include/asm-arm/arch-sa1100/vmalloc.h
include/asm-arm/arch-shark/vmalloc.h
include/asm-arm/arch-versatile/vmalloc.h
include/asm-arm/pgtable.h
include/asm-arm/signal.h
include/asm-arm26/signal.h
include/asm-cris/signal.h
include/asm-frv/signal.h
include/asm-generic/signal.h [new file with mode: 0644]
include/asm-h8300/signal.h
include/asm-i386/signal.h
include/asm-ia64/signal.h
include/asm-m32r/signal.h
include/asm-m68k/signal.h
include/asm-m68knommu/signal.h
include/asm-mips/signal.h
include/asm-ppc/signal.h
include/asm-ppc64/signal.h
include/asm-s390/signal.h
include/asm-sh/signal.h
include/asm-sh64/signal.h
include/asm-sparc/floppy.h
include/asm-sparc/signal.h
include/asm-sparc64/parport.h
include/asm-sparc64/signal.h
include/asm-v850/signal.h
include/asm-x86_64/signal.h
include/linux/pci.h
include/linux/rtnetlink.h
include/linux/xfrm.h
include/net/addrconf.h
include/net/pkt_sched.h
include/net/xfrm.h
kernel/audit.c
net/core/link_watch.c
net/core/netfilter.c
net/core/rtnetlink.c
net/decnet/dn_dev.c
net/decnet/netfilter/dn_rtmsg.c
net/ipv4/devinet.c
net/ipv4/ip_output.c
net/ipv4/netfilter/ip_conntrack_proto_tcp.c
net/ipv4/netfilter/ip_queue.c
net/ipv4/netfilter/iptable_raw.c
net/ipv4/tcp_diag.c
net/ipv4/tcp_ipv4.c
net/ipv4/xfrm4_policy.c
net/ipv6/addrconf.c
net/ipv6/netfilter/ip6_queue.c
net/ipv6/raw.c
net/ipv6/tcp_ipv6.c
net/ipv6/xfrm6_policy.c
net/irda/irda_device.c
net/netlink/af_netlink.c
net/sched/Kconfig
net/sched/act_api.c
net/sched/sch_api.c
net/sched/sch_generic.c
net/sched/sch_htb.c
net/sched/sch_netem.c
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_user.c

index 43e50108d0e21c56ec5bcd873916c9f547a765c8..3a4dbe4663c9556f15fd062cfafcd1f6e3dddd1d 100644 (file)
@@ -4,6 +4,16 @@ The EtherDrive (R) HOWTO for users of 2.6 kernels is found at ...
 
   It has many tips and hints!
 
+The aoetools are userland programs that are designed to work with this
+driver.  The aoetools are on sourceforge.
+
+  http://aoetools.sourceforge.net/
+
+The scripts in this Documentation/aoe directory are intended to
+document the use of the driver and are not necessary if you install
+the aoetools.
+
+
 CREATING DEVICE NODES
 
   Users of udev should find the block device nodes created
@@ -35,14 +45,15 @@ USING DEVICE NODES
 
   "echo eth2 eth4 > /dev/etherd/interfaces" tells the aoe driver to
   limit ATA over Ethernet traffic to eth2 and eth4.  AoE traffic from
-  untrusted networks should be ignored as a matter of security.
+  untrusted networks should be ignored as a matter of security.  See
+  also the aoe_iflist driver option described below.
 
   "echo > /dev/etherd/discover" tells the driver to find out what AoE
   devices are available.
 
   These character devices may disappear and be replaced by sysfs
-  counterparts, so distribution maintainers are encouraged to create
-  scripts that use these devices.
+  counterparts.  Using the commands in aoetools insulates users from
+  these implementation details.
 
   The block devices are named like this:
 
@@ -66,7 +77,8 @@ USING SYSFS
   through which we are communicating with the remote AoE device.
 
   There is a script in this directory that formats this information
-  in a convenient way.
+  in a convenient way.  Users with aoetools can use the aoe-stat
+  command.
 
   root@makki root# sh Documentation/aoe/status.sh 
      e10.0            eth3              up
@@ -89,3 +101,23 @@ USING SYSFS
       e4.7            eth1              up
       e4.8            eth1              up
       e4.9            eth1              up
+
+  Use /sys/module/aoe/parameters/aoe_iflist (or better, the driver
+  option discussed below) instead of /dev/etherd/interfaces to limit
+  AoE traffic to the network interfaces in the given
+  whitespace-separated list.  Unlike the old character device, the
+  sysfs entry can be read from as well as written to.
+
+  It's helpful to trigger discovery after setting the list of allowed
+  interfaces.  The aoetools package provides an aoe-discover script
+  for this purpose.  You can also directly use the
+  /dev/etherd/discover special file described above.
+
+DRIVER OPTIONS
+
+  There is a boot option for the built-in aoe driver and a
+  corresponding module parameter, aoe_iflist.  Without this option,
+  all network interfaces may be used for ATA over Ethernet.  Here is a
+  usage example for the module parameter.
+
+    modprobe aoe_iflist="eth1 eth3"
index 6628116d4a9f7b4da22a8991cf5426c6e92b8d22..751f3be514b831296b038fd343443c15d0aa5b32 100644 (file)
@@ -14,10 +14,6 @@ test ! -d "$sysd/block" && {
        echo "$me Error: sysfs is not mounted" 1>&2
        exit 1
 }
-test -z "`lsmod | grep '^aoe'`" && {
-       echo  "$me Error: aoe module is not loaded" 1>&2
-       exit 1
-}
 
 for d in `ls -d $sysd/block/etherd* 2>/dev/null | grep -v p` end; do
        # maybe ls comes up empty, so we use "end"
index 67514bf87ccde2db27f138fc52348899bf8ec351..62b1dc5d97e2e90523e8010b93054f81ef3ffe58 100644 (file)
@@ -279,6 +279,7 @@ pci_for_each_dev_reverse()  Superseded by pci_find_device_reverse()
 pci_for_each_bus()             Superseded by pci_find_next_bus()
 pci_find_device()              Superseded by pci_get_device()
 pci_find_subsys()              Superseded by pci_get_subsys()
+pci_find_slot()                        Superseded by pci_get_slot()
 pcibios_find_class()           Superseded by pci_get_class()
 pci_find_class()               Superseded by pci_get_class()
 pci_(read|write)_*_nodev()     Superseded by pci_bus_(read|write)_*()
index c85428e7ad9263487bf2ef6816e2bdd1379e2097..35b1a7dae34253751ade84ca7f0eda948fac11dd 100644 (file)
@@ -165,40 +165,9 @@ Description:
 These functions are intended for use by individual drivers, and are defined in 
 struct pci_driver:
 
-        int  (*save_state) (struct pci_dev *dev, u32 state);
-        int  (*suspend) (struct pci_dev *dev, u32 state);
+        int  (*suspend) (struct pci_dev *dev, pm_message_t state);
         int  (*resume) (struct pci_dev *dev);
-        int  (*enable_wake) (struct pci_dev *dev, u32 state, int enable);
-
-
-save_state
-----------
-
-Usage:
-
-if (dev->driver && dev->driver->save_state)
-       dev->driver->save_state(dev,state);
-
-The driver should use this callback to save device state. It should take into
-account the current state of the device and the requested state in order to
-avoid any unnecessary operations.
-
-For example, a video card that supports all 4 states (D0-D3), all controller
-context is preserved when entering D1, but the screen is placed into a low power
-state (blanked). 
-
-The driver can also interpret this function as a notification that it may be
-entering a sleep state in the near future. If it knows that the device cannot
-enter the requested state, either because of lack of support for it, or because
-the device is middle of some critical operation, then it should fail.
-
-This function should not be used to set any state in the device or the driver
-because the device may not actually enter the sleep state (e.g. another driver
-later causes causes a global state transition to fail).
-
-Note that in intermediate low power states, a device's I/O and memory spaces may
-be disabled and may not be available in subsequent transitions to lower power
-states.
+        int  (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable);
 
 
 suspend
index 0c79b9d95f74ee4383ed16dd11048ecdf37b3920..f7c96635d3b4fe7cf6d482b8d351e1c4f42095b4 100644 (file)
@@ -280,6 +280,10 @@ config ISA
          (MCA) or VESA.  ISA is an older system, now being displaced by PCI;
          newer boards don't support it.  If you have ISA, say Y, otherwise N.
 
+config ISA_DMA_API
+       bool
+       default y
+
 config PCI
        bool
        depends on !ALPHA_JENSEN
index 4055115ae0e285f88d319be0369765a7d54b8409..8bfcb37460fa8a4b380753cd306ac48afc3dc05c 100644 (file)
@@ -266,6 +266,10 @@ config ISA_DMA
        depends on FOOTBRIDGE_HOST || ARCH_SHARK
        default y
 
+config ISA_DMA_API
+       bool
+       default y
+
 config PCI
        bool "PCI support" if ARCH_INTEGRATOR_AP
        default y if ARCH_SHARK || FOOTBRIDGE_HOST || ARCH_IOP3XX || ARCH_IXP4XX || ARCH_IXP2000
index c0e7aff3dec2254272cedd5009a183532940708b..7c7f475e213ea3f85779165679e06feb1aea7109 100644 (file)
  * Please select one of the following when turning on debugging.
  */
 #ifdef DEBUG
-#if defined(CONFIG_DEBUG_DC21285_PORT)
-               .macro  loadsp, rb
-               mov     \rb, #0x42000000
-               .endm
-               .macro  writeb, rb
-               str     \rb, [r3, #0x160]
-               .endm
-#elif defined(CONFIG_DEBUG_ICEDCC)
+
+#include <asm/arch/debug-macro.S>
+
+#if defined(CONFIG_DEBUG_ICEDCC)
                .macro  loadsp, rb
                .endm
-               .macro writeb, rb
-               mcr     p14, 0, \rb, c0, c1, 0
-               .endm
-#elif defined(CONFIG_FOOTBRIDGE)
-               .macro  loadsp, rb
-               mov     \rb, #0x7c000000
+               .macro writeb, ch, rb
+               mcr     p14, 0, \ch, c0, c1, 0
                .endm
-               .macro  writeb, rb
-               strb    \rb, [r3, #0x3f8]
+#else
+               .macro  writeb, ch, rb
+               senduart \ch, \rb
                .endm
-#elif defined(CONFIG_ARCH_RPC)
+
+#if defined(CONFIG_FOOTBRIDGE) || \
+    defined(CONFIG_ARCH_RPC) || \
+    defined(CONFIG_ARCH_INTEGRATOR) || \
+    defined(CONFIG_ARCH_PXA) || \
+    defined(CONFIG_ARCH_IXP4XX) || \
+    defined(CONFIG_ARCH_IXP2000) || \
+    defined(CONFIG_ARCH_LH7A40X) || \
+    defined(CONFIG_ARCH_OMAP)
                .macro  loadsp, rb
-               mov     \rb, #0x03000000
-               orr     \rb, \rb, #0x00010000
-               .endm
-               .macro  writeb, rb
-               strb    \rb, [r3, #0x3f8 << 2]
-               .endm
-#elif defined(CONFIG_ARCH_INTEGRATOR)
-               .macro  loadsp, rb
-               mov     \rb, #0x16000000
-               .endm
-               .macro  writeb, rb
-               strb    \rb, [r3, #0]
-               .endm
-#elif defined(CONFIG_ARCH_PXA) /* Xscale-type */
-               .macro  loadsp, rb
-               mov     \rb, #0x40000000
-               orr     \rb, \rb, #0x00100000
-               .endm
-               .macro  writeb, rb
-               strb    \rb, [r3, #0]
+               addruart \rb
                .endm
 #elif defined(CONFIG_ARCH_SA1100)
                .macro  loadsp, rb
                add     \rb, \rb, #0x00010000   @ Ser1
 #  endif
                .endm
-               .macro  writeb, rb
-               str     \rb, [r3, #0x14]        @ UTDR
-               .endm
-#elif defined(CONFIG_ARCH_IXP4XX)
-               .macro  loadsp, rb
-               mov     \rb, #0xc8000000
-               .endm
-               .macro  writeb, rb
-               str     \rb, [r3, #0]
-#elif defined(CONFIG_ARCH_IXP2000)
-               .macro  loadsp, rb
-               mov     \rb, #0xc0000000
-               orr     \rb, \rb, #0x00030000
-               .endm
-               .macro  writeb, rb
-               str     \rb, [r3, #0]
-               .endm
-#elif defined(CONFIG_ARCH_LH7A40X)
-               .macro  loadsp, rb
-               ldr     \rb, =0x80000700        @ UART2 UARTBASE
-               .endm
-               .macro  writeb, rb
-               strb    \rb, [r3, #0]
-               .endm
-#elif defined(CONFIG_ARCH_OMAP)
-               .macro  loadsp, rb
-               mov     \rb, #0xff000000        @ physical base address
-               add     \rb, \rb, #0x00fb0000
-#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
-               add     \rb, \rb, #0x00000800
-#endif
-#ifdef CONFIG_OMAP_LL_DEBUG_UART3
-               add     \rb, \rb, #0x00009000
-#endif
-               .endm
-               .macro  writeb, rb
-               strb    \rb, [r3]
-               .endm
 #elif defined(CONFIG_ARCH_IOP331)
                .macro loadsp, rb
                 mov    \rb, #0xff000000
                 orr     \rb, \rb, #0x00ff0000
                 orr     \rb, \rb, #0x0000f700   @ location of the UART
                .endm
-               .macro  writeb, rb
-               str     \rb, [r3, #0]
-               .endm
 #elif defined(CONFIG_ARCH_S3C2410)
-                       .macro loadsp, rb
+               .macro loadsp, rb
                mov     \rb, #0x50000000
                add     \rb, \rb, #0x4000 * CONFIG_S3C2410_LOWLEVEL_UART_PORT
                .endm
-               .macro  writeb, rb
-               strb    \rb, [r3, #0x20]
-               .endm
 #else
 #error no serial architecture defined
 #endif
+#endif
 #endif
 
                .macro  kputc,val
@@ -734,7 +673,7 @@ puts:               loadsp  r3
 1:             ldrb    r2, [r0], #1
                teq     r2, #0
                moveq   pc, lr
-2:             writeb  r2
+2:             writeb  r2, r3
                mov     r1, #0x00020000
 3:             subs    r1, r1, #1
                bne     3b
index 54377d0f578c38c85950c91e061a3e7ebafe01d0..41e5849ae8dab7a4bee66186a29cadadcc49be22 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <asm/arch/imxfb.h>
 #include <asm/hardware.h>
 
 #include <asm/mach/map.h>
@@ -228,6 +229,14 @@ static struct platform_device imx_uart2_device = {
        .resource       = imx_uart2_resources,
 };
 
+static struct imxfb_mach_info imx_fb_info;
+
+void __init set_imx_fb_info(struct imxfb_mach_info *hard_imx_fb_info)
+{
+       memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imxfb_mach_info));
+}
+EXPORT_SYMBOL(set_imx_fb_info);
+
 static struct resource imxfb_resources[] = {
        [0] = {
                .start  = 0x00205000,
@@ -241,9 +250,16 @@ static struct resource imxfb_resources[] = {
        },
 };
 
+static u64 fb_dma_mask = ~(u64)0;
+
 static struct platform_device imxfb_device = {
        .name           = "imx-fb",
        .id             = 0,
+       .dev            = {
+               .platform_data  = &imx_fb_info,
+               .dma_mask       = &fb_dma_mask,
+               .coherent_dma_mask = 0xffffffff,
+       },
        .num_resources  = ARRAY_SIZE(imxfb_resources),
        .resource       = imxfb_resources,
 };
index 86c50c3889b78ef7591f994241ea3e331e1742e3..bd17b5154311f4a1a8540f0dc105ba9996eec862 100644 (file)
@@ -216,7 +216,9 @@ integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
        write_seqlock(&xtime_lock);
 
-       // ...clear the interrupt
+       /*
+        * clear the interrupt
+        */
        timer1->TimerClear = 1;
 
        timer_tick(regs);
@@ -264,7 +266,7 @@ void __init integrator_time_init(unsigned long reload, unsigned int ctrl)
        timer1->TimerValue   = timer_reload;
        timer1->TimerControl = timer_ctrl;
 
-       /* 
+       /*
         * Make irqs happen for the system timer
         */
        setup_irq(IRQ_TIMERINT1, &integrator_timer_irq);
index 9d182b77b31269e8e18aa40b9b95fc8fe1a36b31..d2c0ab21150c1cbedd3397d4b3b9854b258f2aaf 100644 (file)
@@ -37,7 +37,7 @@ static void integrator_leds_event(led_event_t ledevt)
        unsigned long flags;
        const unsigned int dbg_base = IO_ADDRESS(INTEGRATOR_DBG_BASE);
        unsigned int update_alpha_leds;
-       
+
        // yup, change the LEDs
        local_irq_save(flags);
        update_alpha_leds = 0;
index 94bcdb933e41f1f0065b12154f9d1a5f3f7c7e36..aa92e3708838ed31fadbead7b073cfc7a3894578 100644 (file)
@@ -501,15 +501,6 @@ pci_set_dma_mask(struct pci_dev *dev, u64 mask)
        return -EIO;
 }
     
-int
-pci_dac_set_dma_mask(struct pci_dev *dev, u64 mask)
-{
-       if (mask >= SZ_64M - 1 )
-               return 0;
-
-       return -EIO;
-}
-
 int
 pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
 {
@@ -520,7 +511,6 @@ pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
 }
 
 EXPORT_SYMBOL(pci_set_dma_mask);
-EXPORT_SYMBOL(pci_dac_set_dma_mask);
 EXPORT_SYMBOL(pci_set_consistent_dma_mask);
 EXPORT_SYMBOL(ixp4xx_pci_read);
 EXPORT_SYMBOL(ixp4xx_pci_write);
index 007766a0644cc20bbf0a0f17b8f921608b246712..27892e34b060345dde82c4c5d8e0484b63eaee10 100644 (file)
@@ -413,6 +413,7 @@ config CPU_BPREDICT_DISABLE
 config HAS_TLS_REG
        bool
        depends on CPU_32v6 && !CPU_32v5 && !CPU_32v4 && !CPU_32v3
+       default y
        help
          This selects support for the CP15 thread register.
          It is defined to be available on ARMv6 or later.  However
index 3955de5af4c0a89accfa724fe288b81fd94bc64b..6caed90661fc8dcafbecdb6e15a92f95e142273d 100644 (file)
@@ -89,6 +89,10 @@ config PAGESIZE_16
           machine with 4MB of memory.
 endmenu
 
+config ISA_DMA_API
+       bool
+       default y
+
 menu "General setup"
 
 # Compressed boot loader in ROM.  Yes, we really want to ask about
index 99b4f294a52d981fbc30aef0ec47348b0d5cd385..fee5891196066c05efa082b31ed7740df5a69949 100644 (file)
@@ -1173,6 +1173,10 @@ source "drivers/pci/pcie/Kconfig"
 
 source "drivers/pci/Kconfig"
 
+config ISA_DMA_API
+       bool
+       default y
+
 config ISA
        bool "ISA support"
        depends on !(X86_VOYAGER || X86_VISWS)
index fc4615b6d3a960ecc055c43a0589741e9128d714..e729bd280623d4f6ac7fe4790fcbcfd61cf4f709 100644 (file)
@@ -534,6 +534,11 @@ endchoice
 
 endmenu
 
+config ISA_DMA_API
+       bool
+       depends on !M5272
+       default y
+
 menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)"
 
 config PCI
index 5e666aad88152e0287dd4b628f92e2d5c6e87c91..ab9944693f1f38c40852d7dafa45e75b040e907a 100644 (file)
@@ -1656,3 +1656,7 @@ config GENERIC_HARDIRQS
 config GENERIC_IRQ_PROBE
        bool
        default y
+
+config ISA_DMA_API
+       bool
+       default y
index 5b5cd00d98ca11650140e79625dd4626cf5e77cc..e7e7c56fc212bd3a5099ca06b75c8f0867101db3 100644 (file)
@@ -45,6 +45,10 @@ config GENERIC_IRQ_PROBE
 config PM
        bool
 
+config ISA_DMA_API
+       bool
+       default y
+
 source "init/Kconfig"
 
 
index c3d941345e3dc427f07b1613713618e66424b00c..ff04dcd3020043791d5c4923196bef02785c46f5 100644 (file)
@@ -1079,6 +1079,10 @@ source kernel/power/Kconfig
 
 endmenu
 
+config ISA_DMA_API
+       bool
+       default y
+
 menu "Bus options"
 
 config ISA
index ef1f05e437c4dc9d908076a82a22f5364a471198..f5508abf1188a866e6c8b549b2548defcfbee010 100644 (file)
@@ -293,6 +293,9 @@ config SECCOMP
 
 endmenu
 
+config ISA_DMA_API
+       bool
+       default y
 
 menu "General setup"
 
index d33e20bcc52f6da5c4ee54665d07b5046117b3f5..691f3008e69870d474fd45934edebc2b1a5eab11 100644 (file)
@@ -56,12 +56,19 @@ LDFLAGS_vmlinux     := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
 CFLAGS         += -msoft-float -pipe -mminimal-toc -mtraceback=none \
                   -mcall-aixdesc
 
+GCC_VERSION     := $(call cc-version)
+GCC_BROKEN_VEC := $(shell if [ $(GCC_VERSION) -lt 0400 ] ; then echo "y"; fi ;)
+
 ifeq ($(CONFIG_POWER4_ONLY),y)
 ifeq ($(CONFIG_ALTIVEC),y)
+ifeq ($(GCC_BROKEN_VEC),y)
        CFLAGS += $(call cc-option,-mcpu=970)
 else
        CFLAGS += $(call cc-option,-mcpu=power4)
 endif
+else
+       CFLAGS += $(call cc-option,-mcpu=power4)
+endif
 else
        CFLAGS += $(call cc-option,-mtune=power4)
 endif
index 722ea1d63c9433f463287b65faa853993aaa6b2e..3468d5127223b7f5422b4b3e838e0d87b8ee3921 100644 (file)
@@ -693,6 +693,10 @@ config RTC_9701JE
 
 endmenu
 
+config ISA_DMA_API
+       bool
+       depends on MPC1211
+       default y
 
 menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)"
 
index 46aa51afec149ef51582bb0014b2012c0df77cdb..c20e5309f8aa6dd1726f1f6835cb461e7d968be6 100644 (file)
@@ -47,9 +47,9 @@ prom_sortmemlist(struct linux_mlist_v0 *thislist)
        char *tmpaddr;
        char *lowest;
 
-       for(i=0; thislist[i].theres_more != 0; i++) {
+       for(i=0; thislist[i].theres_more; i++) {
                lowest = thislist[i].start_adr;
-               for(mitr = i+1; thislist[mitr-1].theres_more != 0; mitr++)
+               for(mitr = i+1; thislist[mitr-1].theres_more; mitr++)
                        if(thislist[mitr].start_adr < lowest) {
                                lowest = thislist[mitr].start_adr;
                                swapi = mitr;
@@ -85,7 +85,7 @@ void __init prom_meminit(void)
                        prom_phys_total[iter].num_bytes = mptr->num_bytes;
                        prom_phys_total[iter].theres_more = &prom_phys_total[iter+1];
                }
-               prom_phys_total[iter-1].theres_more = 0x0;
+               prom_phys_total[iter-1].theres_more = NULL;
                /* Second, the total prom taken descriptors. */
                for(mptr = (*(romvec->pv_v0mem.v0_prommap)), iter=0;
                    mptr; mptr=mptr->theres_more, iter++) {
@@ -93,7 +93,7 @@ void __init prom_meminit(void)
                        prom_prom_taken[iter].num_bytes = mptr->num_bytes;
                        prom_prom_taken[iter].theres_more = &prom_prom_taken[iter+1];
                }
-               prom_prom_taken[iter-1].theres_more = 0x0;
+               prom_prom_taken[iter-1].theres_more = NULL;
                /* Last, the available physical descriptors. */
                for(mptr = (*(romvec->pv_v0mem.v0_available)), iter=0;
                    mptr; mptr=mptr->theres_more, iter++) {
@@ -101,7 +101,7 @@ void __init prom_meminit(void)
                        prom_phys_avail[iter].num_bytes = mptr->num_bytes;
                        prom_phys_avail[iter].theres_more = &prom_phys_avail[iter+1];
                }
-               prom_phys_avail[iter-1].theres_more = 0x0;
+               prom_phys_avail[iter-1].theres_more = NULL;
                /* Sort all the lists. */
                prom_sortmemlist(prom_phys_total);
                prom_sortmemlist(prom_prom_taken);
@@ -124,7 +124,7 @@ void __init prom_meminit(void)
                        prom_phys_avail[iter].theres_more =
                                &prom_phys_avail[iter+1];
                }
-               prom_phys_avail[iter-1].theres_more = 0x0;
+               prom_phys_avail[iter-1].theres_more = NULL;
 
                num_regs = prom_getproperty(node, "reg",
                                            (char *) prom_reg_memlist,
@@ -138,7 +138,7 @@ void __init prom_meminit(void)
                        prom_phys_total[iter].theres_more =
                                &prom_phys_total[iter+1];
                }
-               prom_phys_total[iter-1].theres_more = 0x0;
+               prom_phys_total[iter-1].theres_more = NULL;
 
                node = prom_getchild(prom_root_node);
                node = prom_searchsiblings(node, "virtual-memory");
@@ -158,7 +158,7 @@ void __init prom_meminit(void)
                        prom_prom_taken[iter].theres_more =
                                &prom_prom_taken[iter+1];
                }
-               prom_prom_taken[iter-1].theres_more = 0x0;
+               prom_prom_taken[iter-1].theres_more = NULL;
 
                prom_sortmemlist(prom_prom_taken);
 
@@ -182,15 +182,15 @@ void __init prom_meminit(void)
        case PROM_SUN4:
 #ifdef CONFIG_SUN4     
                /* how simple :) */
-               prom_phys_total[0].start_adr = 0x0;
+               prom_phys_total[0].start_adr = NULL;
                prom_phys_total[0].num_bytes = *(sun4_romvec->memorysize);
-               prom_phys_total[0].theres_more = 0x0;
-               prom_prom_taken[0].start_adr = 0x0
+               prom_phys_total[0].theres_more = NULL;
+               prom_prom_taken[0].start_adr = NULL
                prom_prom_taken[0].num_bytes = 0x0;
-               prom_prom_taken[0].theres_more = 0x0;
-               prom_phys_avail[0].start_adr = 0x0;
+               prom_prom_taken[0].theres_more = NULL;
+               prom_phys_avail[0].start_adr = NULL;
                prom_phys_avail[0].num_bytes = *(sun4_romvec->memoryavail);
-               prom_phys_avail[0].theres_more = 0x0;
+               prom_phys_avail[0].theres_more = NULL;
 #endif
                break;
 
index 69ca735f0d4e76b7aa6352fb16f2d1b07ff72a65..00390a2652aa16191514d199eb4653481c6d5d1b 100644 (file)
@@ -151,7 +151,7 @@ struct linux_romvec * __init sun4_prom_init(void)
         * have more time, we can teach the penguin to say "By your
         * command" or "Activating turbo boost, Michael". :-)
         */
-       sun4_romvec->setLEDs(0x0);
+       sun4_romvec->setLEDs(NULL);
        
        printk("PROMLIB: Old Sun4 boot PROM monitor %s, romvec version %d\n",
                sun4_romvec->monid,
index a38cb5036df06283848d4a5b2a059ef4be1c88b5..4dcb8af94090cfc490da271877561d988b3a2aea 100644 (file)
@@ -756,7 +756,7 @@ void handler_irq(int irq, struct pt_regs *regs)
                clear_softint(clr_mask);
        }
 #else
-       int should_forward = 1;
+       int should_forward = 0;
 
        clear_softint(1 << irq);
 #endif
@@ -1007,10 +1007,10 @@ static int retarget_one_irq(struct irqaction *p, int goal_cpu)
        }
        upa_writel(tid | IMAP_VALID, imap);
 
-       while (!cpu_online(goal_cpu)) {
+       do {
                if (++goal_cpu >= NR_CPUS)
                        goal_cpu = 0;
-       }
+       } while (!cpu_online(goal_cpu));
 
        return goal_cpu;
 }
index 80c38c5d71fe44f591753d7bcb174cfa37168a82..44ee7f6acf7b521ac9e291eb949e0257ecb5d7fd 100644 (file)
@@ -379,6 +379,11 @@ config GENERIC_IRQ_PROBE
        bool
        default y
 
+# we have no ISA slots, but we do have ISA-style DMA.
+config ISA_DMA_API
+       bool
+       default y
+
 menu "Power management options"
 
 source kernel/power/Kconfig
index e43e02328968728a5f9da232f69ea1ed2edc5770..b594768b0241f3d198d802ada4d192b356677310 100644 (file)
@@ -105,7 +105,7 @@ config ATARI_SLM
 
 config BLK_DEV_XD
        tristate "XT hard disk support"
-       depends on ISA
+       depends on ISA && ISA_DMA_API
        help
          Very old 8 bit hard disk controllers used in the IBM XT computer
          will be supported if you say Y here.
index aa8b547ffafa669f7cd3d547e4ac025203d799af..721ba8086043bd714c06e5353f60a348e7989f50 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 2004 Coraid, Inc.  See COPYING for GPL terms. */
-#define VERSION "6"
+#define VERSION "10"
 #define AOE_MAJOR 152
 #define DEVICE_NAME "aoe"
 
index 4780f7926d4292bc8150e2712ea18d8a11204ec2..0e97fcb9f3a15b3bbe5b4a0bb8bd085c20e05b2b 100644 (file)
@@ -37,6 +37,13 @@ static ssize_t aoedisk_show_netif(struct gendisk * disk, char *page)
 
        return snprintf(page, PAGE_SIZE, "%s\n", d->ifp->name);
 }
+/* firmware version */
+static ssize_t aoedisk_show_fwver(struct gendisk * disk, char *page)
+{
+       struct aoedev *d = disk->private_data;
+
+       return snprintf(page, PAGE_SIZE, "0x%04x\n", (unsigned int) d->fw_ver);
+}
 
 static struct disk_attribute disk_attr_state = {
        .attr = {.name = "state", .mode = S_IRUGO },
@@ -50,6 +57,10 @@ static struct disk_attribute disk_attr_netif = {
        .attr = {.name = "netif", .mode = S_IRUGO },
        .show = aoedisk_show_netif
 };
+static struct disk_attribute disk_attr_fwver = {
+       .attr = {.name = "firmware-version", .mode = S_IRUGO },
+       .show = aoedisk_show_fwver
+};
 
 static void
 aoedisk_add_sysfs(struct aoedev *d)
@@ -57,6 +68,7 @@ aoedisk_add_sysfs(struct aoedev *d)
        sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr);
        sysfs_create_file(&d->gd->kobj, &disk_attr_mac.attr);
        sysfs_create_file(&d->gd->kobj, &disk_attr_netif.attr);
+       sysfs_create_file(&d->gd->kobj, &disk_attr_fwver.attr);
 }
 void
 aoedisk_rm_sysfs(struct aoedev *d)
@@ -64,6 +76,7 @@ aoedisk_rm_sysfs(struct aoedev *d)
        sysfs_remove_link(&d->gd->kobj, "state");
        sysfs_remove_link(&d->gd->kobj, "mac");
        sysfs_remove_link(&d->gd->kobj, "netif");
+       sysfs_remove_link(&d->gd->kobj, "firmware-version");
 }
 
 static int
index ec16c64dd114c37b30f2f97bb5e8f895c0a6e9bb..6e231c5a119958dd3549e5d825f4706f9d04f9ec 100644 (file)
@@ -109,25 +109,22 @@ aoedev_set(ulong sysminor, unsigned char *addr, struct net_device *ifp, ulong bu
        spin_lock_irqsave(&devlist_lock, flags);
 
        for (d=devlist; d; d=d->next)
-               if (d->sysminor == sysminor
-               || memcmp(d->addr, addr, sizeof d->addr) == 0)
+               if (d->sysminor == sysminor)
                        break;
 
        if (d == NULL && (d = aoedev_newdev(bufcnt)) == NULL) {
                spin_unlock_irqrestore(&devlist_lock, flags);
                printk(KERN_INFO "aoe: aoedev_set: aoedev_newdev failure.\n");
                return NULL;
-       }
+       } /* if newdev, (d->flags & DEVFL_UP) == 0 for below */
 
        spin_unlock_irqrestore(&devlist_lock, flags);
        spin_lock_irqsave(&d->lock, flags);
 
        d->ifp = ifp;
-
-       if (d->sysminor != sysminor
-       || (d->flags & DEVFL_UP) == 0) {
+       memcpy(d->addr, addr, sizeof d->addr);
+       if ((d->flags & DEVFL_UP) == 0) {
                aoedev_downdev(d); /* flushes outstanding frames */
-               memcpy(d->addr, addr, sizeof d->addr);
                d->sysminor = sysminor;
                d->aoemajor = AOEMAJOR(sysminor);
                d->aoeminor = AOEMINOR(sysminor);
index bc92aacb6dadad9f2bff4145d237acd35856526d..9e6f51c528b094684c2b709c55be738c3d361225 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/hdreg.h>
 #include <linux/blkdev.h>
 #include <linux/netdevice.h>
+#include <linux/moduleparam.h>
 #include "aoe.h"
 
 #define NECODES 5
@@ -26,6 +27,19 @@ enum {
 };
 
 static char aoe_iflist[IFLISTSZ];
+module_param_string(aoe_iflist, aoe_iflist, IFLISTSZ, 0600);
+MODULE_PARM_DESC(aoe_iflist, "aoe_iflist=\"dev1 [dev2 ...]\"\n");
+
+#ifndef MODULE
+static int __init aoe_iflist_setup(char *str)
+{
+       strncpy(aoe_iflist, str, IFLISTSZ);
+       aoe_iflist[IFLISTSZ - 1] = '\0';
+       return 1;
+}
+
+__setup("aoe_iflist=", aoe_iflist_setup);
+#endif
 
 int
 is_aoe_netif(struct net_device *ifp)
@@ -36,7 +50,8 @@ is_aoe_netif(struct net_device *ifp)
        if (aoe_iflist[0] == '\0')
                return 1;
 
-       for (p = aoe_iflist; *p; p = q + strspn(q, WHITESPACE)) {
+       p = aoe_iflist + strspn(aoe_iflist, WHITESPACE);
+       for (; *p; p = q + strspn(q, WHITESPACE)) {
                q = p + strcspn(p, WHITESPACE);
                if (q != p)
                        len = q - p;
index a70e6b99fc9acff9f722c83e7d0c24fe802dca4b..5ed6515ae01fe0fee127d23fa18717b688a7eb24 100644 (file)
@@ -153,7 +153,7 @@ config DIGIEPCA
 
 config ESPSERIAL
        tristate "Hayes ESP serial port support"
-       depends on SERIAL_NONSTANDARD && ISA && BROKEN_ON_SMP
+       depends on SERIAL_NONSTANDARD && ISA && BROKEN_ON_SMP && ISA_DMA_API
        help
          This is a driver which supports Hayes ESP serial ports.  Both single
          port cards and multiport cards are supported.  Make sure to read
@@ -195,7 +195,7 @@ config ISI
 
 config SYNCLINK
        tristate "Microgate SyncLink card support"
-       depends on SERIAL_NONSTANDARD && PCI
+       depends on SERIAL_NONSTANDARD && PCI && ISA_DMA_API
        help
          Provides support for the SyncLink ISA and PCI multiprotocol serial
          adapters. These adapters support asynchronous and HDLC bit
index 5419440087fd6844c923da80d790bd3ca91acbcc..298574e160613e67191472bf147e141546573957 100644 (file)
@@ -1617,15 +1617,15 @@ typedef struct dmi_header
        u16     handle;
 } dmi_header_t;
 
-static int decode_dmi(dmi_header_t *dm, int intf_num)
+static int decode_dmi(dmi_header_t __iomem *dm, int intf_num)
 {
-       u8              *data = (u8 *)dm;
+       u8              __iomem *data = (u8 __iomem *)dm;
        unsigned long   base_addr;
        u8              reg_spacing;
-       u8              len = dm->length;
+       u8              len = readb(&dm->length);
        dmi_ipmi_data_t *ipmi_data = dmi_data+intf_num;
 
-       ipmi_data->type = data[4];
+       ipmi_data->type = readb(&data[4]);
 
        memcpy(&base_addr, data+8, sizeof(unsigned long));
        if (len >= 0x11) {
@@ -1640,12 +1640,12 @@ static int decode_dmi(dmi_header_t *dm, int intf_num)
                }
                /* If bit 4 of byte 0x10 is set, then the lsb for the address
                   is odd. */
-               ipmi_data->base_addr = base_addr | ((data[0x10] & 0x10) >> 4);
+               ipmi_data->base_addr = base_addr | ((readb(&data[0x10]) & 0x10) >> 4);
 
-               ipmi_data->irq = data[0x11];
+               ipmi_data->irq = readb(&data[0x11]);
 
                /* The top two bits of byte 0x10 hold the register spacing. */
-               reg_spacing = (data[0x10] & 0xC0) >> 6;
+               reg_spacing = (readb(&data[0x10]) & 0xC0) >> 6;
                switch(reg_spacing){
                case 0x00: /* Byte boundaries */
                    ipmi_data->offset = 1;
@@ -1673,7 +1673,7 @@ static int decode_dmi(dmi_header_t *dm, int intf_num)
                ipmi_data->offset = 1;
        }
 
-       ipmi_data->slave_addr = data[6];
+       ipmi_data->slave_addr = readb(&data[6]);
 
        if (is_new_interface(-1, ipmi_data->addr_space,ipmi_data->base_addr)) {
                dmi_data_entries++;
@@ -1687,9 +1687,9 @@ static int decode_dmi(dmi_header_t *dm, int intf_num)
 
 static int dmi_table(u32 base, int len, int num)
 {
-       u8                *buf;
-       struct dmi_header *dm;
-       u8                *data;
+       u8                __iomem *buf;
+       struct dmi_header __iomem *dm;
+       u8                __iomem *data;
        int               i=1;
        int               status=-1;
        int               intf_num = 0;
@@ -1702,12 +1702,12 @@ static int dmi_table(u32 base, int len, int num)
 
        while(i<num && (data - buf) < len)
        {
-               dm=(dmi_header_t *)data;
+               dm=(dmi_header_t __iomem *)data;
 
-               if((data-buf+dm->length) >= len)
+               if((data-buf+readb(&dm->length)) >= len)
                        break;
 
-               if (dm->type == 38) {
+               if (readb(&dm->type) == 38) {
                        if (decode_dmi(dm, intf_num) == 0) {
                                intf_num++;
                                if (intf_num >= SI_MAX_DRIVERS)
@@ -1715,8 +1715,8 @@ static int dmi_table(u32 base, int len, int num)
                        }
                }
 
-               data+=dm->length;
-               while((data-buf) < len && (*data || data[1]))
+               data+=readb(&dm->length);
+               while((data-buf) < len && (readb(data)||readb(data+1)))
                        data++;
                data+=2;
                i++;
index a0212b004016ab3547562f2bb7ec46a8dabed2e0..62791dd429856d3755fe4898e83791b25dabaca3 100644 (file)
@@ -51,7 +51,7 @@ struct si_sm_io
        /* Generic info used by the actual handling routines, the
            state machine shouldn't touch these. */
        void *info;
-       void *addr;
+       void __iomem *addr;
        int  regspacing;
        int  regsize;
        int  regshift;
index ec7100556c50bbe19a0de2aec439cf78362f5bec..ac9cfa9701ea9003d0f440ec572e0eecaec7a1a3 100644 (file)
@@ -394,7 +394,7 @@ int mbcs_open(struct inode *ip, struct file *fp)
        return -ENODEV;
 }
 
-ssize_t mbcs_sram_read(struct file * fp, char *buf, size_t len, loff_t * off)
+ssize_t mbcs_sram_read(struct file * fp, char __user *buf, size_t len, loff_t * off)
 {
        struct cx_dev *cx_dev = fp->private_data;
        struct mbcs_soft *soft = cx_dev->soft;
@@ -419,7 +419,7 @@ ssize_t mbcs_sram_read(struct file * fp, char *buf, size_t len, loff_t * off)
 }
 
 ssize_t
-mbcs_sram_write(struct file * fp, const char *buf, size_t len, loff_t * off)
+mbcs_sram_write(struct file * fp, const char __user *buf, size_t len, loff_t * off)
 {
        struct cx_dev *cx_dev = fp->private_data;
        struct mbcs_soft *soft = cx_dev->soft;
index 844644d201c5c427a6d11866aecb67ae94e8dce0..e7fd47e43257396bd899fab5d1748045ef1590cc 100644 (file)
@@ -543,9 +543,9 @@ struct mbcs_soft {
 };
 
 extern int mbcs_open(struct inode *ip, struct file *fp);
-extern ssize_t mbcs_sram_read(struct file *fp, char *buf, size_t len,
+extern ssize_t mbcs_sram_read(struct file *fp, char __user *buf, size_t len,
                              loff_t * off);
-extern ssize_t mbcs_sram_write(struct file *fp, const char *buf, size_t len,
+extern ssize_t mbcs_sram_write(struct file *fp, const char __user *buf, size_t len,
                               loff_t * off);
 extern loff_t mbcs_sram_llseek(struct file *filp, loff_t off, int whence);
 extern int mbcs_gscr_mmap(struct file *fp, struct vm_area_struct *vma);
index c812191417c36aac6190f7e94e997ca7f6c3beac..fd042060809a3b5572183f6874219d890261a09b 100644 (file)
@@ -1021,11 +1021,11 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
                        ret = -EIO;
                        break;
                }
-               if (copy_to_user((u8 *)arg, &val8, sizeof(val8)))
+               if (copy_to_user(argp, &val8, sizeof(val8)))
                        ret = -EFAULT;
                break;
        case SONYPI_IOCSFAN:
-               if (copy_from_user(&val8, (u8 *)arg, sizeof(val8))) {
+               if (copy_from_user(&val8, argp, sizeof(val8))) {
                        ret = -EFAULT;
                        break;
                }
@@ -1038,7 +1038,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
                        ret = -EIO;
                        break;
                }
-               if (copy_to_user((u8 *)arg, &val8, sizeof(val8)))
+               if (copy_to_user(argp, &val8, sizeof(val8)))
                        ret = -EFAULT;
                break;
        default:
index 72f2b466b8167a0b35f35d2a1e00897d3c029a21..2e70d74fbdee2d8bffa3a7a4d01de57061d317a1 100644 (file)
@@ -51,7 +51,7 @@ config MMC_PXA
 
 config MMC_WBSD
        tristate "Winbond W83L51xD SD/MMC Card Interface support"
-       depends on MMC && ISA
+       depends on MMC && ISA && ISA_DMA_API
        help
          This selects the Winbond(R) W83L51xD Secure digital and
           Multimedia card Interface.
index 68242bda4b9cd2dabd292dc393078b7fc615d7bf..3a0a55b62aaff83280434ee5a493f4fc1b5a2a36 100644 (file)
@@ -589,7 +589,7 @@ config EL2
 
 config ELPLUS
        tristate "3c505 \"EtherLink Plus\" support"
-       depends on NET_VENDOR_3COM && ISA
+       depends on NET_VENDOR_3COM && ISA && ISA_DMA_API
        ---help---
          Information about this network (Ethernet) card can be found in
          <file:Documentation/networking/3c505.txt>.  If you have a card of
@@ -630,7 +630,7 @@ config EL3
 
 config 3C515
        tristate "3c515 ISA \"Fast EtherLink\""
-       depends on NET_VENDOR_3COM && (ISA || EISA)
+       depends on NET_VENDOR_3COM && (ISA || EISA) && ISA_DMA_API
        help
          If you have a 3Com ISA EtherLink XL "Corkscrew" 3c515 Fast Ethernet
          network card, say Y and read the Ethernet-HOWTO, available from
@@ -708,7 +708,7 @@ config TYPHOON
 
 config LANCE
        tristate "AMD LANCE and PCnet (AT1500 and NE2100) support"
-       depends on NET_ETHERNET && ISA
+       depends on NET_ETHERNET && ISA && ISA_DMA_API
        help
          If you have a network (Ethernet) card of this type, say Y and read
          the Ethernet-HOWTO, available from
@@ -864,7 +864,7 @@ config NI52
 
 config NI65
        tristate "NI6510 support"
-       depends on NET_VENDOR_RACAL && ISA
+       depends on NET_VENDOR_RACAL && ISA && ISA_DMA_API
        help
          If you have a network (Ethernet) card of this type, say Y and read
          the Ethernet-HOWTO, available from
@@ -1072,7 +1072,7 @@ config NE2000
 
 config ZNET
        tristate "Zenith Z-Note support (EXPERIMENTAL)"
-       depends on NET_ISA && EXPERIMENTAL
+       depends on NET_ISA && EXPERIMENTAL && ISA_DMA_API
        help
          The Zenith Z-Note notebook computer has a built-in network
          (Ethernet) card, and this is the Linux driver for it. Note that the
index 60b19679ca5c7b8a0db1a73f3e2d342dac43a2f5..69c488d933a2bb799d8e5c9853cb262358a75e9f 100644 (file)
@@ -13,7 +13,7 @@ config DEV_APPLETALK
 
 config LTPC
        tristate "Apple/Farallon LocalTalk PC support"
-       depends on DEV_APPLETALK && (ISA || EISA)
+       depends on DEV_APPLETALK && (ISA || EISA) && ISA_DMA_API
        help
          This allows you to use the AppleTalk PC card to connect to LocalTalk
          networks. The card is also known as the Farallon PhoneNet PC card.
index 34068f81d45ef1c2d200ed77b661b7b341118046..7cdebe1a0b6198264f06cbb13020132d41ca40d4 100644 (file)
@@ -45,7 +45,7 @@ config BPQETHER
 
 config DMASCC
        tristate "High-speed (DMA) SCC driver for AX.25"
-       depends on ISA && AX25 && BROKEN_ON_SMP
+       depends on ISA && AX25 && BROKEN_ON_SMP && ISA_DMA_API
        ---help---
          This is a driver for high-speed SCC boards, i.e. those supporting
          DMA on one port. You usually use those boards to connect your
@@ -78,7 +78,7 @@ config DMASCC
 
 config SCC
        tristate "Z8530 SCC driver"
-       depends on ISA && AX25
+       depends on ISA && AX25 && ISA_DMA_API
        ---help---
          These cards are used to connect your Linux box to an amateur radio
          in order to communicate with other computers. If you want to use
index 6bf76a444d483a375dede2ba44b04a952d79ed2b..1c553d7efdd9f42b2874f37b08428d96cb4be8a8 100644 (file)
@@ -310,7 +310,7 @@ config SIGMATEL_FIR
 
 config NSC_FIR
        tristate "NSC PC87108/PC87338"
-       depends on IRDA
+       depends on IRDA && ISA_DMA_API
        help
          Say Y here if you want to build support for the NSC PC87108 and
          PC87338 IrDA chipsets.  This driver supports SIR,
@@ -321,7 +321,7 @@ config NSC_FIR
 
 config WINBOND_FIR
        tristate "Winbond W83977AF (IR)"
-       depends on IRDA
+       depends on IRDA && ISA_DMA_API
        help
          Say Y here if you want to build IrDA support for the Winbond
          W83977AF super-io chipset.  This driver should be used for the IrDA
@@ -347,7 +347,7 @@ config AU1000_FIR
 
 config SMC_IRCC_FIR
        tristate "SMSC IrCC (EXPERIMENTAL)"
-       depends on EXPERIMENTAL && IRDA
+       depends on EXPERIMENTAL && IRDA && ISA_DMA_API
        help
          Say Y here if you want to build support for the SMC Infrared
          Communications Controller.  It is used in a wide variety of
@@ -357,7 +357,7 @@ config SMC_IRCC_FIR
 
 config ALI_FIR
        tristate "ALi M5123 FIR (EXPERIMENTAL)"
-       depends on EXPERIMENTAL && IRDA
+       depends on EXPERIMENTAL && IRDA && ISA_DMA_API
        help
          Say Y here if you want to build support for the ALi M5123 FIR
          Controller.  The ALi M5123 FIR Controller is embedded in ALi M1543C,
@@ -385,7 +385,7 @@ config SA1100_FIR
 
 config VIA_FIR
        tristate "VIA VT8231/VT1211 SIR/MIR/FIR"
-       depends on IRDA
+       depends on IRDA && ISA_DMA_API
        help
          Say Y here if you want to build support for the VIA VT8231
          and VIA VT1211 IrDA controllers, found on the motherboards using
index 507d6328d4eb00743c4b04a91586812f83b357b3..3872088fdd10cc4dafb1c37bfaea89736d671d6c 100644 (file)
@@ -87,8 +87,7 @@ static void z_comp_free(void *arg)
 
        if (state) {
                zlib_deflateEnd(&state->strm);
-               if (state->strm.workspace)
-                       vfree(state->strm.workspace);
+               vfree(state->strm.workspace);
                kfree(state);
        }
 }
@@ -308,8 +307,7 @@ static void z_decomp_free(void *arg)
 
        if (state) {
                zlib_inflateEnd(&state->strm);
-               if (state->strm.workspace)
-                       kfree(state->strm.workspace);
+               kfree(state->strm.workspace);
                kfree(state);
        }
 }
index c456dc81b8730f694ed9f22d54a48bddc2c2bf39..3b377f6cd4a0bff915d75d46cef3d66eb16cbf20 100644 (file)
@@ -2467,14 +2467,10 @@ static void ppp_destroy_interface(struct ppp *ppp)
        skb_queue_purge(&ppp->mrq);
 #endif /* CONFIG_PPP_MULTILINK */
 #ifdef CONFIG_PPP_FILTER
-       if (ppp->pass_filter) {
-               kfree(ppp->pass_filter);
-               ppp->pass_filter = NULL;
-       }
-       if (ppp->active_filter) {
-               kfree(ppp->active_filter);
-               ppp->active_filter = NULL;
-       }
+       kfree(ppp->pass_filter);
+       ppp->pass_filter = NULL;
+       kfree(ppp->active_filter);
+       ppp->active_filter = NULL;
 #endif /* CONFIG_PPP_FILTER */
 
        kfree(ppp);
index 35791934a602e3f2dd9371fe3b7548c2f38f6920..66b94668ddd8a69241d2535ce4726cc74f4d92f2 100644 (file)
@@ -26,7 +26,7 @@ config WAN
 # There is no way to detect a comtrol sv11 - force it modular for now.
 config HOSTESS_SV11
        tristate "Comtrol Hostess SV-11 support"
-       depends on WAN && ISA && m
+       depends on WAN && ISA && m && ISA_DMA_API
        help
          Driver for Comtrol Hostess SV-11 network card which
          operates on low speed synchronous serial links at up to
@@ -38,7 +38,7 @@ config HOSTESS_SV11
 # The COSA/SRP driver has not been tested as non-modular yet.
 config COSA
        tristate "COSA/SRP sync serial boards support"
-       depends on WAN && ISA && m
+       depends on WAN && ISA && m && ISA_DMA_API
        ---help---
          Driver for COSA and SRP synchronous serial boards.
 
@@ -127,7 +127,7 @@ config LANMEDIA
 # There is no way to detect a Sealevel board. Force it modular
 config SEALEVEL_4021
        tristate "Sealevel Systems 4021 support"
-       depends on WAN && ISA && m
+       depends on WAN && ISA && m && ISA_DMA_API
        help
          This is a driver for the Sealevel Systems ACB 56 serial I/O adapter.
 
index 5b48cd8568f51bd757913cae533d9239f6fa8e86..02d57c0b4243ac8ab61e4db9a3eb3e6e90d66d82 100644 (file)
@@ -436,9 +436,7 @@ static int cycx_wan_new_if(struct wan_device *wandev, struct net_device *dev,
        }
 
        if (err) {
-               if (chan->local_addr)
-                       kfree(chan->local_addr);
-
+               kfree(chan->local_addr);
                kfree(chan);
                return err;
        }
@@ -458,9 +456,7 @@ static int cycx_wan_del_if(struct wan_device *wandev, struct net_device *dev)
                struct cycx_x25_channel *chan = dev->priv;
 
                if (chan->svc) {
-                       if (chan->local_addr)
-                               kfree(chan->local_addr);
-
+                       kfree(chan->local_addr);
                        if (chan->state == WAN_CONNECTED)
                                del_timer(&chan->timer);
                }
index 29f84ad087303ee5eb7beaee32a80825b673062d..8454bf6caaa70136f6106869a30a8f61899c0002 100644 (file)
@@ -400,10 +400,8 @@ static void cpc_tty_close(struct tty_struct *tty, struct file *flip)
                cpc_tty->buf_rx.last = NULL;
        }
        
-       if (cpc_tty->buf_tx) {
-               kfree(cpc_tty->buf_tx);
-               cpc_tty->buf_tx = NULL;
-       }
+       kfree(cpc_tty->buf_tx);
+       cpc_tty->buf_tx = NULL;
 
        CPC_TTY_DBG("%s: TTY closed\n",cpc_tty->name);
        
@@ -666,7 +664,7 @@ static void cpc_tty_rx_work(void * data)
        unsigned long port;
        int i, j;
        st_cpc_tty_area *cpc_tty; 
-       volatile st_cpc_rx_buf * buf;
+       volatile st_cpc_rx_buf *buf;
        char flags=0,flg_rx=1; 
        struct tty_ldisc *ld;
 
@@ -680,9 +678,9 @@ static void cpc_tty_rx_work(void * data)
                        cpc_tty = &cpc_tty_area[port];
                
                        if ((buf=cpc_tty->buf_rx.first) != 0) {
-                               if(cpc_tty->tty) {
+                               if (cpc_tty->tty) {
                                        ld = tty_ldisc_ref(cpc_tty->tty);
-                                       if(ld) {
+                                       if (ld) {
                                                if (ld->receive_buf) {
                                                        CPC_TTY_DBG("%s: call line disc. receive_buf\n",cpc_tty->name);
                                                        ld->receive_buf(cpc_tty->tty, (char *)(buf->data), &flags, buf->size);
@@ -691,7 +689,7 @@ static void cpc_tty_rx_work(void * data)
                                        }
                                }       
                                cpc_tty->buf_rx.first = cpc_tty->buf_rx.first->next;
-                               kfree((unsigned char *)buf);
+                               kfree(buf);
                                buf = cpc_tty->buf_rx.first;
                                flg_rx = 1;
                        }
@@ -733,7 +731,7 @@ static void cpc_tty_rx_disc_frame(pc300ch_t *pc300chan)
 
 void cpc_tty_receive(pc300dev_t *pc300dev)
 {
-       st_cpc_tty_area    *cpc_tty; 
+       st_cpc_tty_area *cpc_tty; 
        pc300ch_t *pc300chan = (pc300ch_t *)pc300dev->chan; 
        pc300_t *card = (pc300_t *)pc300chan->card; 
        int ch = pc300chan->channel; 
@@ -742,7 +740,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
        int rx_len, rx_aux; 
        volatile unsigned char status; 
        unsigned short first_bd = pc300chan->rx_first_bd;
-       st_cpc_rx_buf   *new=NULL;
+       st_cpc_rx_buf *new = NULL;
        unsigned char dsr_rx;
 
        if (pc300dev->cpc_tty == NULL) { 
@@ -762,7 +760,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
                        if (status & DST_EOM) {
                                break;
                        }
-                       ptdescr=(pcsca_bd_t __iomem *)(card->hw.rambase+cpc_readl(&ptdescr->next));
+                       ptdescr = (pcsca_bd_t __iomem *)(card->hw.rambase+cpc_readl(&ptdescr->next));
                }
                        
                if (!rx_len) { 
@@ -771,10 +769,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
                                cpc_writel(card->hw.scabase + DRX_REG(EDAL, ch), 
                                                RX_BD_ADDR(ch, pc300chan->rx_last_bd)); 
                        }
-                       if (new) {
-                               kfree(new);
-                               new = NULL;
-                       }
+                       kfree(new);
                        return; 
                }
                
@@ -787,7 +782,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
                        continue;
                } 
                
-               new = (st_cpc_rx_buf *) kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC);
+               new = (st_cpc_rx_buf *)kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC);
                if (new == 0) {
                        cpc_tty_rx_disc_frame(pc300chan);
                        continue;
index afbe0024e3e15f84b5b25d498af252e64e5d9b28..496d29237e92750bb0ad090d6e7d3b12c7a14e4b 100644 (file)
@@ -3664,15 +3664,10 @@ static void wanpipe_tty_close(struct tty_struct *tty, struct file * filp)
                chdlc_disable_comm_shutdown(card);
                unlock_adapter_irq(&card->wandev.lock,&smp_flags);
 
-               if (card->tty_buf){
-                       kfree(card->tty_buf);
-                       card->tty_buf=NULL;                     
-               }
-
-               if (card->tty_rx){
-                       kfree(card->tty_rx);
-                       card->tty_rx=NULL;
-               }
+               kfree(card->tty_buf);
+               card->tty_buf = NULL;                   
+               kfree(card->tty_rx);
+               card->tty_rx = NULL;
        }
        return;
 }
index 8c5cfcb55826b522244947ac6cd2f373ae6d1c90..1c540d825551f6c0194d30e19a5cb51ffcaec5b4 100644 (file)
@@ -107,13 +107,9 @@ static struct x25_asy *x25_asy_alloc(void)
 static void x25_asy_free(struct x25_asy *sl)
 {
        /* Free all X.25 frame buffers. */
-       if (sl->rbuff)  {
-               kfree(sl->rbuff);
-       }
+       kfree(sl->rbuff);
        sl->rbuff = NULL;
-       if (sl->xbuff)  {
-               kfree(sl->xbuff);
-       }
+       kfree(sl->xbuff);
        sl->xbuff = NULL;
 
        if (!test_and_clear_bit(SLF_INUSE, &sl->flags)) {
@@ -134,10 +130,8 @@ static int x25_asy_change_mtu(struct net_device *dev, int newmtu)
        {
                printk("%s: unable to grow X.25 buffers, MTU change cancelled.\n",
                       dev->name);
-               if (xbuff != NULL)  
-                       kfree(xbuff);
-               if (rbuff != NULL)  
-                       kfree(rbuff);
+               kfree(xbuff);
+               kfree(rbuff);
                return -ENOMEM;
        }
 
@@ -169,10 +163,8 @@ static int x25_asy_change_mtu(struct net_device *dev, int newmtu)
 
        spin_unlock_bh(&sl->lock);
 
-       if (xbuff != NULL) 
-               kfree(xbuff);
-       if (rbuff != NULL)
-               kfree(rbuff);
+       kfree(xbuff);
+       kfree(rbuff);
        return 0;
 }
 
index 731010e0e6f6aea8fc063c105138fc9ce756c36c..16a2e6ae37f4b579bad45b50617d0ab62f524e4f 100644 (file)
@@ -34,7 +34,7 @@ config PARPORT
 
 config PARPORT_PC
        tristate "PC-style hardware"
-       depends on PARPORT && (!SPARC64 || PCI) && (!SPARC32 || BROKEN)
+       depends on PARPORT && (!SPARC64 || PCI) && !SPARC32
        ---help---
          You should say Y here if you have a PC-style parallel port. All
          IBM PC compatible computers and some Alphas have PC-style
index c5774e7855d0362acbea8c7c5eb32049e0332612..e7f3bcb790006417c5567712cca71930274fa26d 100644 (file)
 
 #define PARPORT_PC_MAX_PORTS PARPORT_MAX
 
+#ifdef CONFIG_ISA_DMA_API
+#define HAS_DMA
+#endif
+
 /* ECR modes */
 #define ECR_SPP 00
 #define ECR_PS2 01
@@ -610,6 +614,7 @@ dump_parport_state ("leave fifo_write_block_pio", port);
        return length - left;
 }
 
+#ifdef HAS_DMA
 static size_t parport_pc_fifo_write_block_dma (struct parport *port,
                                               const void *buf, size_t length)
 {
@@ -732,6 +737,17 @@ dump_parport_state ("enter fifo_write_block_dma", port);
 dump_parport_state ("leave fifo_write_block_dma", port);
        return length - left;
 }
+#endif
+
+static inline size_t parport_pc_fifo_write_block(struct parport *port,
+                                              const void *buf, size_t length)
+{
+#ifdef HAS_DMA
+       if (port->dma != PARPORT_DMA_NONE)
+               return parport_pc_fifo_write_block_dma (port, buf, length);
+#endif
+       return parport_pc_fifo_write_block_pio (port, buf, length);
+}
 
 /* Parallel Port FIFO mode (ECP chipsets) */
 static size_t parport_pc_compat_write_block_pio (struct parport *port,
@@ -758,10 +774,7 @@ static size_t parport_pc_compat_write_block_pio (struct parport *port,
        port->physport->ieee1284.phase = IEEE1284_PH_FWD_DATA;
 
        /* Write the data to the FIFO. */
-       if (port->dma != PARPORT_DMA_NONE)
-               written = parport_pc_fifo_write_block_dma (port, buf, length);
-       else
-               written = parport_pc_fifo_write_block_pio (port, buf, length);
+       written = parport_pc_fifo_write_block(port, buf, length);
 
        /* Finish up. */
        /* For some hardware we don't want to touch the mode until
@@ -856,10 +869,7 @@ static size_t parport_pc_ecp_write_block_pio (struct parport *port,
        port->physport->ieee1284.phase = IEEE1284_PH_FWD_DATA;
 
        /* Write the data to the FIFO. */
-       if (port->dma != PARPORT_DMA_NONE)
-               written = parport_pc_fifo_write_block_dma (port, buf, length);
-       else
-               written = parport_pc_fifo_write_block_pio (port, buf, length);
+       written = parport_pc_fifo_write_block(port, buf, length);
 
        /* Finish up. */
        /* For some hardware we don't want to touch the mode until
@@ -2285,6 +2295,7 @@ struct parport *parport_pc_probe_port (unsigned long int base,
                }
 
 #ifdef CONFIG_PARPORT_PC_FIFO
+#ifdef HAS_DMA
                if (p->dma != PARPORT_DMA_NONE) {
                        if (request_dma (p->dma, p->name)) {
                                printk (KERN_WARNING "%s: dma %d in use, "
@@ -2306,7 +2317,8 @@ struct parport *parport_pc_probe_port (unsigned long int base,
                                }
                        }
                }
-#endif /* CONFIG_PARPORT_PC_FIFO */
+#endif
+#endif
        }
 
        /* Done probing.  Now put the port into a sensible start-up state. */
@@ -2367,11 +2379,13 @@ void parport_pc_unregister_port (struct parport *p)
        if (p->modes & PARPORT_MODE_ECP)
                release_region(p->base_hi, 3);
 #ifdef CONFIG_PARPORT_PC_FIFO
+#ifdef HAS_DMA
        if (priv->dma_buf)
                pci_free_consistent(priv->dev, PAGE_SIZE,
                                    priv->dma_buf,
                                    priv->dma_handle);
-#endif /* CONFIG_PARPORT_PC_FIFO */
+#endif
+#endif
        kfree (p->private_data);
        parport_put_port(p);
        kfree (ops); /* hope no-one cached it */
index 5bc039da647f1e36f6d450a2bb7f8ecb07ab7e96..c22e0284d7b143fb9588182e15010788b9142ebe 100644 (file)
@@ -196,7 +196,7 @@ struct ebda_hpc_bus {
 
 
 /********************************************************************
-*   THREE TYPE OF HOT PLUG CONTROLER                                *
+*   THREE TYPE OF HOT PLUG CONTROLLER                                *
 ********************************************************************/
 
 struct isa_ctlr_access {
index 6894b548c8cab0a0a9847cee6f6b03fd5808b2a6..1a3eb8d3d4cbd8b5bbeeb277a14124a992e5c7f2 100644 (file)
@@ -64,7 +64,7 @@ static int to_debug = FALSE;
 #define WPG_I2C_OR             0x2000  // I2C OR operation
 
 //----------------------------------------------------------------------------
-// Command set for I2C Master Operation Setup Regisetr
+// Command set for I2C Master Operation Setup Register
 //----------------------------------------------------------------------------
 #define WPG_READATADDR_MASK    0x00010000      // read,bytes,I2C shifted,index
 #define WPG_WRITEATADDR_MASK   0x40010000      // write,bytes,I2C shifted,index
@@ -835,7 +835,7 @@ static void poll_hpc (void)
                if (ibmphp_shutdown) 
                        break;
                
-               /* try to get the lock to do some kind of harware access */
+               /* try to get the lock to do some kind of hardware access */
                down (&semOperations);
 
                switch (poll_state) {
@@ -906,7 +906,7 @@ static void poll_hpc (void)
                                poll_state = POLL_LATCH_REGISTER;
                        break;
                }       
-               /* give up the harware semaphore */
+               /* give up the hardware semaphore */
                up (&semOperations);
                /* sleep for a short time just for good measure */
                msleep(100);
index 2335fac65fb4eee0456837e97d9cd99e5adec341..8122fe734aa78d40cd23ea6bd236dcbb040a0bcb 100644 (file)
@@ -1308,10 +1308,10 @@ static int unconfigure_boot_device (u8 busno, u8 device, u8 function)
                        /* ????????? DO WE NEED TO WRITE ANYTHING INTO THE PCI CONFIG SPACE BACK ?????????? */
                } else {
                        /* This is Memory */
-                       start_address &= PCI_BASE_ADDRESS_MEM_MASK;
                        if (start_address & PCI_BASE_ADDRESS_MEM_PREFETCH) {
                                /* pfmem */
                                debug ("start address of pfmem is %x\n", start_address);
+                               start_address &= PCI_BASE_ADDRESS_MEM_MASK;
 
                                if (ibmphp_find_resource (bus, start_address, &pfmem, PFMEM) < 0) {
                                        err ("cannot find corresponding PFMEM resource to remove\n");
@@ -1325,6 +1325,8 @@ static int unconfigure_boot_device (u8 busno, u8 device, u8 function)
                        } else {
                                /* regular memory */
                                debug ("start address of mem is %x\n", start_address);
+                               start_address &= PCI_BASE_ADDRESS_MEM_MASK;
+
                                if (ibmphp_find_resource (bus, start_address, &mem, MEM) < 0) {
                                        err ("cannot find corresponding MEM resource to remove\n");
                                        return -EIO;
@@ -1422,9 +1424,9 @@ static int unconfigure_boot_bridge (u8 busno, u8 device, u8 function)
                        /* ????????? DO WE NEED TO WRITE ANYTHING INTO THE PCI CONFIG SPACE BACK ?????????? */
                } else {
                        /* This is Memory */
-                       start_address &= PCI_BASE_ADDRESS_MEM_MASK;
                        if (start_address & PCI_BASE_ADDRESS_MEM_PREFETCH) {
                                /* pfmem */
+                               start_address &= PCI_BASE_ADDRESS_MEM_MASK;
                                if (ibmphp_find_resource (bus, start_address, &pfmem, PFMEM) < 0) {
                                        err ("cannot find corresponding PFMEM resource to remove\n");
                                        return -EINVAL;
@@ -1436,6 +1438,7 @@ static int unconfigure_boot_bridge (u8 busno, u8 device, u8 function)
                                }
                        } else {
                                /* regular memory */
+                               start_address &= PCI_BASE_ADDRESS_MEM_MASK;
                                if (ibmphp_find_resource (bus, start_address, &mem, MEM) < 0) {
                                        err ("cannot find corresponding MEM resource to remove\n");
                                        return -EINVAL;
index 57ace325168dfd5fc569a2a18b7a2b3cc16f3ed4..88d44f7fef2908424ca87d67793d1cf78a9c9d4f 100644 (file)
@@ -150,7 +150,7 @@ struct hotplug_slot_info {
  * @name: the name of the slot being registered.  This string must
  * be unique amoung slots registered on this system.
  * @ops: pointer to the &struct hotplug_slot_ops to be used for this slot
- * @info: pointer to the &struct hotplug_slot_info for the inital values for
+ * @info: pointer to the &struct hotplug_slot_info for the initial values for
  * this slot.
  * @release: called during pci_hp_deregister to free memory allocated in a
  * hotplug_slot structure.
index 72baf749e65ef812d8e7f6ed69fba0b44cfc7d58..ed1fd8d6178d7f7418d840f93db0ef6e04142c67 100644 (file)
@@ -90,6 +90,22 @@ static struct hotplug_slot_ops pciehp_hotplug_slot_ops = {
        .get_cur_bus_speed =    get_cur_bus_speed,
 };
 
+/**
+ * release_slot - free up the memory used by a slot
+ * @hotplug_slot: slot to free
+ */
+static void release_slot(struct hotplug_slot *hotplug_slot)
+{
+       struct slot *slot = hotplug_slot->private;
+
+       dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
+
+       kfree(slot->hotplug_slot->info);
+       kfree(slot->hotplug_slot->name);
+       kfree(slot->hotplug_slot);
+       kfree(slot);
+}
+
 static int init_slots(struct controller *ctrl)
 {
        struct slot *new_slot;
@@ -139,7 +155,8 @@ static int init_slots(struct controller *ctrl)
 
                /* register this slot with the hotplug pci core */
                new_slot->hotplug_slot->private = new_slot;
-               make_slot_name (new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot);
+               new_slot->hotplug_slot->release = &release_slot;
+               make_slot_name(new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot);
                new_slot->hotplug_slot->ops = &pciehp_hotplug_slot_ops;
 
                new_slot->hpc_ops->get_power_status(new_slot, &(new_slot->hotplug_slot->info->power_status));
@@ -188,10 +205,6 @@ static int cleanup_slots (struct controller * ctrl)
        while (old_slot) {
                next_slot = old_slot->next;
                pci_hp_deregister (old_slot->hotplug_slot);
-               kfree(old_slot->hotplug_slot->info);
-               kfree(old_slot->hotplug_slot->name);
-               kfree(old_slot->hotplug_slot);
-               kfree(old_slot);
                old_slot = next_slot;
        }
 
index 6605d6bda5291a525fdf6da450b689e8ea3d8ae5..3194d51c6ec9c6109b20a4eb7c5821d7010f2d3c 100644 (file)
@@ -297,7 +297,7 @@ static int __init init_slots(void)
                hotplug_slot->ops = &skel_hotplug_slot_ops;
                
                /*
-                * Initilize the slot info structure with some known
+                * Initialize the slot info structure with some known
                 * good values.
                 */
                info->power_status = get_power_status(slot);
index 22ecd3b058be176a76683a87ae33eb1269ece88a..30206ac43c443c68eb6d89c8fc3146a6f0f307d7 100644 (file)
@@ -522,7 +522,7 @@ void pci_scan_msi_device(struct pci_dev *dev)
  * msi_capability_init - configure device's MSI capability structure
  * @dev: pointer to the pci_dev data structure of MSI device function
  *
- * Setup the MSI capability structure of device funtion with a single
+ * Setup the MSI capability structure of device function with a single
  * MSI vector, regardless of device function is capable of handling
  * multiple messages. A return of zero indicates the successful setup
  * of an entry zero with the new MSI vector or non-zero for otherwise.
@@ -599,7 +599,7 @@ static int msi_capability_init(struct pci_dev *dev)
  * msix_capability_init - configure device's MSI-X capability
  * @dev: pointer to the pci_dev data structure of MSI-X device function
  *
- * Setup the MSI-X capability structure of device funtion with a
+ * Setup the MSI-X capability structure of device function with a
  * single MSI-X vector. A return of zero indicates the successful setup of
  * requested MSI-X entries with allocated vectors or non-zero for otherwise.
  **/
@@ -1074,7 +1074,7 @@ void pci_disable_msix(struct pci_dev* dev)
  * msi_remove_pci_irq_vectors - reclaim MSI(X) vectors to unused state
  * @dev: pointer to the pci_dev data structure of MSI(X) device function
  *
- * Being called during hotplug remove, from which the device funciton
+ * Being called during hotplug remove, from which the device function
  * is hot-removed. All previous assigned MSI/MSI-X vectors, if
  * allocated for this device function, are reclaimed to unused state,
  * which may be used later on.
index 968eb32f292d7e075bb982359d9d7332a5f93f15..bc01d34e2634ca12b582e8b42c8dab7aee01da79 100644 (file)
@@ -19,7 +19,7 @@
 
 static u32 ctrlset_buf[3] = {0, 0, 0};
 static u32 global_ctrlsets = 0;
-u8 OSC_UUID[16] = {0x5B, 0x4D, 0xDB, 0x33, 0xF7, 0x1F, 0x1C, 0x40, 0x96, 0x57, 0x74, 0x41, 0xC0, 0x3D, 0xD7, 0x66};
+static u8 OSC_UUID[16] = {0x5B, 0x4D, 0xDB, 0x33, 0xF7, 0x1F, 0x1C, 0x40, 0x96, 0x57, 0x74, 0x41, 0xC0, 0x3D, 0xD7, 0x66};
 
 static acpi_status  
 acpi_query_osc (
index 37b7961efc44a93fff15ee41c125be1e71c5d9e5..fe98553c978f335dae47646cee5df32c8f69b42e 100644 (file)
@@ -318,6 +318,14 @@ static int pci_device_resume(struct device * dev)
        return 0;
 }
 
+static void pci_device_shutdown(struct device *dev)
+{
+       struct pci_dev *pci_dev = to_pci_dev(dev);
+       struct pci_driver *drv = pci_dev->driver;
+
+       if (drv && drv->shutdown)
+               drv->shutdown(pci_dev);
+}
 
 #define kobj_to_pci_driver(obj) container_of(obj, struct device_driver, kobj)
 #define attr_to_driver_attribute(obj) container_of(obj, struct driver_attribute, attr)
@@ -373,7 +381,7 @@ pci_populate_driver_dir(struct pci_driver *drv)
  * 
  * Adds the driver structure to the list of registered drivers.
  * Returns a negative value on error, otherwise 0. 
- * If no error occured, the driver remains registered even if 
+ * If no error occurred, the driver remains registered even if 
  * no device was claimed during registration.
  */
 int pci_register_driver(struct pci_driver *drv)
@@ -385,6 +393,7 @@ int pci_register_driver(struct pci_driver *drv)
        drv->driver.bus = &pci_bus_type;
        drv->driver.probe = pci_device_probe;
        drv->driver.remove = pci_device_remove;
+       drv->driver.shutdown = pci_device_shutdown,
        drv->driver.owner = drv->owner;
        drv->driver.kobj.ktype = &pci_driver_kobj_type;
        pci_init_dynids(&drv->dynids);
index d57ae71d32b1dd42a77689498e691263d263c3e4..8568b207f18927f4d4cc23006ff2edf07dc932be 100644 (file)
@@ -91,6 +91,7 @@ pci_read_config(struct kobject *kobj, char *buf, loff_t off, size_t count)
        struct pci_dev *dev = to_pci_dev(container_of(kobj,struct device,kobj));
        unsigned int size = 64;
        loff_t init_off = off;
+       u8 *data = (u8*) buf;
 
        /* Several chips lock up trying to read undefined config space */
        if (capable(CAP_SYS_ADMIN)) {
@@ -108,30 +109,47 @@ pci_read_config(struct kobject *kobj, char *buf, loff_t off, size_t count)
                size = count;
        }
 
-       while (off & 3) {
-               unsigned char val;
+       if ((off & 1) && size) {
+               u8 val;
                pci_read_config_byte(dev, off, &val);
-               buf[off - init_off] = val;
+               data[off - init_off] = val;
                off++;
-               if (--size == 0)
-                       break;
+               size--;
+       }
+
+       if ((off & 3) && size > 2) {
+               u16 val;
+               pci_read_config_word(dev, off, &val);
+               data[off - init_off] = val & 0xff;
+               data[off - init_off + 1] = (val >> 8) & 0xff;
+               off += 2;
+               size -= 2;
        }
 
        while (size > 3) {
-               unsigned int val;
+               u32 val;
                pci_read_config_dword(dev, off, &val);
-               buf[off - init_off] = val & 0xff;
-               buf[off - init_off + 1] = (val >> 8) & 0xff;
-               buf[off - init_off + 2] = (val >> 16) & 0xff;
-               buf[off - init_off + 3] = (val >> 24) & 0xff;
+               data[off - init_off] = val & 0xff;
+               data[off - init_off + 1] = (val >> 8) & 0xff;
+               data[off - init_off + 2] = (val >> 16) & 0xff;
+               data[off - init_off + 3] = (val >> 24) & 0xff;
                off += 4;
                size -= 4;
        }
 
-       while (size > 0) {
-               unsigned char val;
+       if (size >= 2) {
+               u16 val;
+               pci_read_config_word(dev, off, &val);
+               data[off - init_off] = val & 0xff;
+               data[off - init_off + 1] = (val >> 8) & 0xff;
+               off += 2;
+               size -= 2;
+       }
+
+       if (size > 0) {
+               u8 val;
                pci_read_config_byte(dev, off, &val);
-               buf[off - init_off] = val;
+               data[off - init_off] = val;
                off++;
                --size;
        }
@@ -145,6 +163,7 @@ pci_write_config(struct kobject *kobj, char *buf, loff_t off, size_t count)
        struct pci_dev *dev = to_pci_dev(container_of(kobj,struct device,kobj));
        unsigned int size = count;
        loff_t init_off = off;
+       u8 *data = (u8*) buf;
 
        if (off > dev->cfg_size)
                return 0;
@@ -152,26 +171,41 @@ pci_write_config(struct kobject *kobj, char *buf, loff_t off, size_t count)
                size = dev->cfg_size - off;
                count = size;
        }
-
-       while (off & 3) {
-               pci_write_config_byte(dev, off, buf[off - init_off]);
+       
+       if ((off & 1) && size) {
+               pci_write_config_byte(dev, off, data[off - init_off]);
                off++;
-               if (--size == 0)
-                       break;
+               size--;
        }
+       
+       if ((off & 3) && size > 2) {
+               u16 val = data[off - init_off];
+               val |= (u16) data[off - init_off + 1] << 8;
+                pci_write_config_word(dev, off, val);
+                off += 2;
+                size -= 2;
+        }
 
        while (size > 3) {
-               unsigned int val = buf[off - init_off];
-               val |= (unsigned int) buf[off - init_off + 1] << 8;
-               val |= (unsigned int) buf[off - init_off + 2] << 16;
-               val |= (unsigned int) buf[off - init_off + 3] << 24;
+               u32 val = data[off - init_off];
+               val |= (u32) data[off - init_off + 1] << 8;
+               val |= (u32) data[off - init_off + 2] << 16;
+               val |= (u32) data[off - init_off + 3] << 24;
                pci_write_config_dword(dev, off, val);
                off += 4;
                size -= 4;
        }
+       
+       if (size >= 2) {
+               u16 val = data[off - init_off];
+               val |= (u16) data[off - init_off + 1] << 8;
+               pci_write_config_word(dev, off, val);
+               off += 2;
+               size -= 2;
+       }
 
-       while (size > 0) {
-               pci_write_config_byte(dev, off, buf[off - init_off]);
+       if (size) {
+               pci_write_config_byte(dev, off, data[off - init_off]);
                off++;
                --size;
        }
index bfbff83352688dc99776706033e1bb80b8282946..f04b9ffe41539a1a2a1acafa6ea5d16b15fbd64b 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <asm/dma.h>   /* isa_dma_bridge_buggy */
+#include "pci.h"
 
 
 /**
@@ -398,10 +399,10 @@ pci_enable_device(struct pci_dev *dev)
 {
        int err;
 
-       dev->is_enabled = 1;
        if ((err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1)))
                return err;
        pci_fixup_device(pci_fixup_enable, dev);
+       dev->is_enabled = 1;
        return 0;
 }
 
@@ -427,16 +428,15 @@ pci_disable_device(struct pci_dev *dev)
 {
        u16 pci_command;
        
-       dev->is_enabled = 0;
-       dev->is_busmaster = 0;
-
        pci_read_config_word(dev, PCI_COMMAND, &pci_command);
        if (pci_command & PCI_COMMAND_MASTER) {
                pci_command &= ~PCI_COMMAND_MASTER;
                pci_write_config_word(dev, PCI_COMMAND, pci_command);
        }
+       dev->is_busmaster = 0;
 
        pcibios_disable_device(dev);
+       dev->is_enabled = 0;
 }
 
 /**
@@ -748,17 +748,6 @@ pci_set_dma_mask(struct pci_dev *dev, u64 mask)
        return 0;
 }
     
-int
-pci_dac_set_dma_mask(struct pci_dev *dev, u64 mask)
-{
-       if (!pci_dac_dma_supported(dev, mask))
-               return -EIO;
-
-       dev->dma_mask = mask;
-
-       return 0;
-}
-
 int
 pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
 {
@@ -821,7 +810,6 @@ EXPORT_SYMBOL(pci_set_master);
 EXPORT_SYMBOL(pci_set_mwi);
 EXPORT_SYMBOL(pci_clear_mwi);
 EXPORT_SYMBOL(pci_set_dma_mask);
-EXPORT_SYMBOL(pci_dac_set_dma_mask);
 EXPORT_SYMBOL(pci_set_consistent_dma_mask);
 EXPORT_SYMBOL(pci_assign_resource);
 EXPORT_SYMBOL(pci_find_parent_resource);
index 6f0edadd132cfeee9f8327a4af8d178b7ad16353..b7ae87823c69777f772717947b6911ffdeac6b2b 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/cpumask.h>
+#include "pci.h"
 
 #define CARDBUS_LATENCY_TIMER  176     /* secondary latency timer */
 #define CARDBUS_RESERVE_BUSNR  3
index 84cc4f620d8d4807db5830d4aa37f376bfa74463..e68bbfb1e7c318d0c34c11e3c76774ae17f3c60a 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <asm/uaccess.h>
 #include <asm/byteorder.h>
+#include "pci.h"
 
 static int proc_initialized;   /* = 0 */
 
index 15a398051682ae19334a358600ecee9b85f1a434..026aa04669a29467559af822be1ad69d06f61ef0 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/delay.h>
+#include "pci.h"
 
 /* Deal with broken BIOS'es that neglect to enable passive release,
    which can cause problems in combination with the 82441FX/PPro MTRRs */
@@ -328,6 +329,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801CA_12,
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801DB_0,                quirk_ich4_lpc_acpi );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801DB_12,       quirk_ich4_lpc_acpi );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801EB_0,                quirk_ich4_lpc_acpi );
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_ESB_1,            quirk_ich4_lpc_acpi );
 
 /*
  * VIA ACPI: One IO region pointed to by longword at
index 750b11cefd934349480d6237f6df564edf6d297b..1811cb240315a33c8aea5ddf9d6ccd24c5c51060 100644 (file)
@@ -260,7 +260,7 @@ config SCSI_3W_9XXX
 
 config SCSI_7000FASST
        tristate "7000FASST SCSI support"
-       depends on ISA && SCSI
+       depends on ISA && SCSI && ISA_DMA_API
        help
          This driver supports the Western Digital 7000 SCSI host adapter
          family.  Some information is in the source:
@@ -295,7 +295,7 @@ config SCSI_AHA152X
 
 config SCSI_AHA1542
        tristate "Adaptec AHA1542 support"
-       depends on ISA && SCSI
+       depends on ISA && SCSI && ISA_DMA_API
        ---help---
          This is support for a SCSI host adapter.  It is explained in section
          3.4 of the SCSI-HOWTO, available from
@@ -515,7 +515,7 @@ config SCSI_SATA_VITESSE
 
 config SCSI_BUSLOGIC
        tristate "BusLogic SCSI support"
-       depends on (PCI || ISA || MCA) && SCSI && (BROKEN || !SPARC64)
+       depends on (PCI || ISA || MCA) && SCSI && ISA_DMA_API
        ---help---
          This is support for BusLogic MultiMaster and FlashPoint SCSI Host
          Adapters. Consult the SCSI-HOWTO, available from
@@ -571,7 +571,7 @@ config SCSI_DTC3280
 
 config SCSI_EATA
        tristate "EATA ISA/EISA/PCI (DPT and generic EATA/DMA-compliant boards) support"
-       depends on (ISA || EISA || PCI) && SCSI && (BROKEN || !SPARC64)
+       depends on (ISA || EISA || PCI) && SCSI && ISA_DMA_API
        ---help---
          This driver supports all EATA/DMA-compliant SCSI host adapters.  DPT
          ISA and all EISA I/O addresses are probed looking for the "EATA"
@@ -665,7 +665,7 @@ config SCSI_FD_MCS
 
 config SCSI_GDTH
        tristate "Intel/ICP (former GDT SCSI Disk Array) RAID Controller support"
-       depends on (ISA || EISA || PCI) && SCSI && (BROKEN || !SPARC64)
+       depends on (ISA || EISA || PCI) && SCSI && ISA_DMA_API
        ---help---
          Formerly called GDT SCSI Disk Array Controller Support.
 
@@ -1416,7 +1416,7 @@ config SCSI_T128
 
 config SCSI_U14_34F
        tristate "UltraStor 14F/34F support"
-       depends on ISA && SCSI
+       depends on ISA && SCSI && ISA_DMA_API
        ---help---
          This is support for the UltraStor 14F and 34F SCSI-2 host adapters.
          The source at <file:drivers/scsi/u14-34f.c> contains some
index e12c5be1e0a345f12f430b17c17669ba32ba57f6..f50aaf25c98e309f08148f60d9045eb05bc9ba54 100644 (file)
@@ -431,7 +431,7 @@ nomem:
  * (2) error, where io->status is a negative errno value.  The number
  *     of io->bytes transferred before the error is usually less
  *     than requested, and can be nonzero.
- * (3) cancelation, a type of error with status -ECONNRESET that
+ * (3) cancellation, a type of error with status -ECONNRESET that
  *     is initiated by usb_sg_cancel().
  *
  * When this function returns, all memory allocated through usb_sg_init() or
@@ -1282,7 +1282,7 @@ static void release_interface(struct device *dev)
  * bus rwsem; usb device driver probe() methods cannot use this routine.
  *
  * Returns zero on success, or else the status code returned by the
- * underlying call that failed.  On succesful completion, each interface
+ * underlying call that failed.  On successful completion, each interface
  * in the original device configuration has been destroyed, and each one
  * in the new configuration has been probed by all relevant usb device
  * drivers currently known to the kernel.
index 16972159a57ad855485f61e1e1a9421e88a95b0f..0faf18d511de607f4d665a3ed1075ab6238dc7f7 100644 (file)
@@ -121,7 +121,7 @@ struct urb * usb_get_urb(struct urb *urb)
  * describing that request to the USB subsystem.  Request completion will
  * be indicated later, asynchronously, by calling the completion handler.
  * The three types of completion are success, error, and unlink
- * (a software-induced fault, also called "request cancelation").  
+ * (a software-induced fault, also called "request cancellation").  
  *
  * URBs may be submitted in interrupt context.
  *
@@ -170,7 +170,7 @@ struct urb * usb_get_urb(struct urb *urb)
  * As of Linux 2.6, all USB endpoint transfer queues support depths greater
  * than one.  This was previously a HCD-specific behavior, except for ISO
  * transfers.  Non-isochronous endpoint queues are inactive during cleanup
- * after faults (transfer errors or cancelation).
+ * after faults (transfer errors or cancellation).
  *
  * Reserved Bandwidth Transfers:
  *
@@ -395,7 +395,7 @@ int usb_submit_urb(struct urb *urb, int mem_flags)
  *
  * This routine cancels an in-progress request.  URBs complete only
  * once per submission, and may be canceled only once per submission.
- * Successful cancelation means the requests's completion handler will
+ * Successful cancellation means the requests's completion handler will
  * be called with a status code indicating that the request has been
  * canceled (rather than any other code) and will quickly be removed
  * from host controller data structures.
index 3993156c2e826ce8d95a8717338d151e805a8104..3f783cbdc7c3e18345af9f36308e90ade3a81bc1 100644 (file)
@@ -569,7 +569,7 @@ static const struct usb_cdc_ether_desc ether_desc = {
 
 /* include the status endpoint if we can, even where it's optional.
  * use wMaxPacketSize big enough to fit CDC_NOTIFY_SPEED_CHANGE in one
- * packet, to simplify cancelation; and a big transfer interval, to
+ * packet, to simplify cancellation; and a big transfer interval, to
  * waste less bandwidth.
  *
  * some drivers (like Linux 2.4 cdc-ether!) "need" it to exist even
index 2cff67ccce452619850516efaade9d99a1624755..1e5e6ddef787443564071325af3d6e1945c4d50e 100644 (file)
@@ -275,7 +275,7 @@ static const char *CHIP;
  *
  * After opening, configure non-control endpoints.  Then use normal
  * stream read() and write() requests; and maybe ioctl() to get more
- * precise FIFO status when recovering from cancelation.
+ * precise FIFO status when recovering from cancellation.
  */
 
 static void epio_complete (struct usb_ep *ep, struct usb_request *req)
index 0def9f70e88920863b9f2a6380fdf42c33b4205a..df75ab65a5ec1adb235a7d68bfe4002ac7f3a98f 100644 (file)
@@ -705,7 +705,7 @@ void nuke(struct lh7a40x_ep *ep, int status)
                done(ep, req, status);
        }
 
-       /* Disable IRQ if EP is enabled (has decriptor) */
+       /* Disable IRQ if EP is enabled (has descriptor) */
        if (ep->desc)
                pio_irq_disable(ep_index(ep));
 }
index f1762ed6db6394aefd5340ddabc8692f56d89fbc..4d591c764e382640257e7bc569d13d58216f6a75 100644 (file)
@@ -240,7 +240,7 @@ struct gs_dev {
        struct usb_ep           *dev_notify_ep; /* address of notify endpoint */
        struct usb_ep           *dev_in_ep;     /* address of in endpoint */
        struct usb_ep           *dev_out_ep;    /* address of out endpoint */
-       struct usb_endpoint_descriptor          /* desciptor of notify ep */
+       struct usb_endpoint_descriptor          /* descriptor of notify ep */
                                *dev_notify_ep_desc;
        struct usb_endpoint_descriptor          /* descriptor of in endpoint */
                                *dev_in_ep_desc;
index 84d2b93aca37d51a7e13f9db9072ce76b8105372..bc69bd7acebe6b4849ea7797bb992348816b3c29 100644 (file)
@@ -346,6 +346,22 @@ ehci_reboot (struct notifier_block *self, unsigned long code, void *null)
        return 0;
 }
 
+static void ehci_port_power (struct ehci_hcd *ehci, int is_on)
+{
+       unsigned port;
+
+       if (!HCS_PPC (ehci->hcs_params))
+               return;
+
+       ehci_dbg (ehci, "...power%s ports...\n", is_on ? "up" : "down");
+       for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; )
+               (void) ehci_hub_control(ehci_to_hcd(ehci),
+                               is_on ? SetPortFeature : ClearPortFeature,
+                               USB_PORT_FEAT_POWER,
+                               port--, NULL, 0);
+       msleep(20);
+}
+
 
 /* called by khubd or root hub init threads */
 
@@ -362,8 +378,10 @@ static int ehci_hc_reset (struct usb_hcd *hcd)
        dbg_hcs_params (ehci, "reset");
        dbg_hcc_params (ehci, "reset");
 
+       /* cache this readonly data; minimize chip reads */
+       ehci->hcs_params = readl (&ehci->caps->hcs_params);
+
 #ifdef CONFIG_PCI
-       /* EHCI 0.96 and later may have "extended capabilities" */
        if (hcd->self.controller->bus == &pci_bus_type) {
                struct pci_dev  *pdev = to_pci_dev(hcd->self.controller);
 
@@ -383,9 +401,30 @@ static int ehci_hc_reset (struct usb_hcd *hcd)
                        break;
                }
 
+               /* optional debug port, normally in the first BAR */
+               temp = pci_find_capability (pdev, 0x0a);
+               if (temp) {
+                       pci_read_config_dword(pdev, temp, &temp);
+                       temp >>= 16;
+                       if ((temp & (3 << 13)) == (1 << 13)) {
+                               temp &= 0x1fff;
+                               ehci->debug = hcd->regs + temp;
+                               temp = readl (&ehci->debug->control);
+                               ehci_info (ehci, "debug port %d%s\n",
+                                       HCS_DEBUG_PORT(ehci->hcs_params),
+                                       (temp & DBGP_ENABLED)
+                                               ? " IN USE"
+                                               : "");
+                               if (!(temp & DBGP_ENABLED))
+                                       ehci->debug = NULL;
+                       }
+               }
+
                temp = HCC_EXT_CAPS (readl (&ehci->caps->hcc_params));
        } else
                temp = 0;
+
+       /* EHCI 0.96 and later may have "extended capabilities" */
        while (temp && count--) {
                u32             cap;
 
@@ -414,8 +453,7 @@ static int ehci_hc_reset (struct usb_hcd *hcd)
                ehci_reset (ehci);
 #endif
 
-       /* cache this readonly data; minimize PCI reads */
-       ehci->hcs_params = readl (&ehci->caps->hcs_params);
+       ehci_port_power (ehci, 0);
 
        /* at least the Genesys GL880S needs fixup here */
        temp = HCS_N_CC(ehci->hcs_params) * HCS_N_PCC(ehci->hcs_params);
@@ -657,16 +695,11 @@ done2:
 static void ehci_stop (struct usb_hcd *hcd)
 {
        struct ehci_hcd         *ehci = hcd_to_ehci (hcd);
-       u8                      rh_ports, port;
 
        ehci_dbg (ehci, "stop\n");
 
        /* Turn off port power on all root hub ports. */
-       rh_ports = HCS_N_PORTS (ehci->hcs_params);
-       for (port = 1; port <= rh_ports; port++)
-               (void) ehci_hub_control(hcd,
-                       ClearPortFeature, USB_PORT_FEAT_POWER,
-                       port, NULL, 0);
+       ehci_port_power (ehci, 0);
 
        /* no more interrupts ... */
        del_timer_sync (&ehci->watchdog);
@@ -748,7 +781,6 @@ static int ehci_resume (struct usb_hcd *hcd)
        unsigned                port;
        struct usb_device       *root = hcd->self.root_hub;
        int                     retval = -EINVAL;
-       int                     powerup = 0;
 
        // maybe restore (PCI) FLADJ
 
@@ -766,8 +798,6 @@ static int ehci_resume (struct usb_hcd *hcd)
                        up (&hcd->self.root_hub->serialize);
                        break;
                }
-               if ((status & PORT_POWER) == 0)
-                       powerup = 1;
                if (!root->children [port])
                        continue;
                dbg_port (ehci, __FUNCTION__, port + 1, status);
@@ -794,16 +824,9 @@ static int ehci_resume (struct usb_hcd *hcd)
                retval = ehci_start (hcd);
 
                /* here we "know" root ports should always stay powered;
-                * but some controllers may lost all power.
+                * but some controllers may lose all power.
                 */
-               if (powerup) {
-                       ehci_dbg (ehci, "...powerup ports...\n");
-                       for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; )
-                               (void) ehci_hub_control(hcd,
-                                       SetPortFeature, USB_PORT_FEAT_POWER,
-                                               port--, NULL, 0);
-                       msleep(20);
-               }
+               ehci_port_power (ehci, 1);
        }
 
        return retval;
index 2373537fabed3eeaa7083c9d9b4577292287acd1..02fefab3501e78faceb9148da521f4d0142df32a 100644 (file)
@@ -281,6 +281,8 @@ ehci_hub_descriptor (
        temp = 0x0008;                  /* per-port overcurrent reporting */
        if (HCS_PPC (ehci->hcs_params))
                temp |= 0x0001;         /* per-port power control */
+       else
+               temp |= 0x0002;         /* no power switching */
 #if 0
 // re-enable when we support USB_PORT_FEAT_INDICATOR below.
        if (HCS_INDICATOR (ehci->hcs_params))
index e763a8399a7522ee627db7c37779c4cb4c4d1c5f..4df498231752812afd20b67c4f995a4ee50fbddd 100644 (file)
@@ -47,6 +47,12 @@ struct ehci_stats {
 #define        EHCI_MAX_ROOT_PORTS     15              /* see HCS_N_PORTS */
 
 struct ehci_hcd {                      /* one per controller */
+       /* glue to PCI and HCD framework */
+       struct ehci_caps __iomem *caps;
+       struct ehci_regs __iomem *regs;
+       struct ehci_dbg_port __iomem *debug;
+
+       __u32                   hcs_params;     /* cached register copy */
        spinlock_t              lock;
 
        /* async schedule support */
@@ -84,11 +90,6 @@ struct ehci_hcd {                    /* one per controller */
 
        unsigned                is_tdi_rh_tt:1; /* TDI roothub with TT */
 
-       /* glue to PCI and HCD framework */
-       struct ehci_caps __iomem *caps;
-       struct ehci_regs __iomem *regs;
-       __u32                   hcs_params;     /* cached register copy */
-
        /* irq statistics */
 #ifdef EHCI_STATS
        struct ehci_stats       stats;
@@ -165,7 +166,7 @@ struct ehci_caps {
        /* these fields are specified as 8 and 16 bit registers,
         * but some hosts can't perform 8 or 16 bit PCI accesses.
         */
-       u32     hc_capbase;
+       u32             hc_capbase;
 #define HC_LENGTH(p)           (((p)>>00)&0x00ff)      /* bits 7:0 */
 #define HC_VERSION(p)          (((p)>>16)&0xffff)      /* bits 31:16 */
        u32             hcs_params;     /* HCSPARAMS - offset 0x4 */
@@ -273,7 +274,7 @@ struct ehci_dbg_port {
 #define DBGP_ENABLED   (1<<28)
 #define DBGP_DONE      (1<<16)
 #define DBGP_INUSE     (1<<10)
-#define DBGP_ERRCODE(x)        (((x)>>7)&0x0f)
+#define DBGP_ERRCODE(x)        (((x)>>7)&0x07)
 #      define DBGP_ERR_BAD     1
 #      define DBGP_ERR_SIGNAL  2
 #define DBGP_ERROR     (1<<6)
@@ -282,11 +283,11 @@ struct ehci_dbg_port {
 #define DBGP_LEN(x)    (((x)>>0)&0x0f)
        u32     pids;
 #define DBGP_PID_GET(x)                (((x)>>16)&0xff)
-#define DBGP_PID_SET(data,tok) (((data)<<8)|(tok));
+#define DBGP_PID_SET(data,tok) (((data)<<8)|(tok))
        u32     data03;
        u32     data47;
        u32     address;
-#define DBGP_EPADDR(dev,ep)    (((dev)<<8)|(ep));
+#define DBGP_EPADDR(dev,ep)    (((dev)<<8)|(ep))
 } __attribute__ ((packed));
 
 /*-------------------------------------------------------------------------*/
index 376f8a034f658856b91be40d79ed6f8a7ad108da..d9883d774d3a4a8ab02807a628df41ac2767fcff 100644 (file)
@@ -4329,7 +4329,7 @@ static int __init etrax_usb_hc_init(void)
        bus->bus_name="ETRAX 100LX";
        bus->hcpriv = hc;
 
-       /* Initalize RH to the default address.
+       /* Initialize RH to the default address.
           And make sure that we have no status change indication */
        hc->rh.numports = 2;  /* The RH has two ports */
        hc->rh.devnum = 1;
index d309e292198ed2d068c121d91eeabb243f2279a5..a374b7692073596e2679812fa26b807744234ef1 100644 (file)
@@ -134,7 +134,7 @@ static void port_power(struct sl811 *sl811, int is_on)
 
 /* This is a PIO-only HCD.  Queueing appends URBs to the endpoint's queue,
  * and may start I/O.  Endpoint queues are scanned during completion irq
- * handlers (one per packet: ACK, NAK, faults, etc) and urb cancelation.
+ * handlers (one per packet: ACK, NAK, faults, etc) and urb cancellation.
  *
  * Using an external DMA engine to copy a packet at a time could work,
  * though setup/teardown costs may be too big to make it worthwhile.
@@ -738,7 +738,7 @@ retry:
                }
 #endif
 
-               /* port status seems wierd until after reset, so
+               /* port status seems weird until after reset, so
                 * force the reset and make khubd clean up later.
                 */
                sl811->port1 |= (1 << USB_PORT_FEAT_C_CONNECTION)
index 5791723e6083bbccd8d268aad6834a7f9e3cf678..a330a4b50e1672402743685102a3f1f38618f37e 100644 (file)
@@ -23,7 +23,7 @@
  *
  *
  * The driver brings the USB functions of the MDC800 to Linux.
- * To use the Camera you must support the USB Protocoll of the camera
+ * To use the Camera you must support the USB Protocol of the camera
  * to the Kernel Node.
  * The Driver uses a misc device Node. Create it with :
  * mknod /dev/mustek c 180 32
index 2d76be62f4e0f2e040c89c11047e423246d2d9fd..94ce2a9ad50f5e9b71b5abdf49f862b3745a0a24 100644 (file)
@@ -386,7 +386,7 @@ static int aiptek_convert_from_2s_complement(unsigned char c)
  * convention above.) I therefore have taken over REL_MISC and ABS_MISC
  * (for relative and absolute reports, respectively) for communicating
  * Proximity. Why two events? I thought it interesting to know if the
- * Proximity event occured while the tablet was in absolute or relative
+ * Proximity event occurred while the tablet was in absolute or relative
  * mode.
  *
  * Other tablets use the notion of a certain minimum stylus pressure
index 6b45a66d58c157fee46a7b10c165cde5d380a6a1..ab1a2a30ce7ca273c683533826fc859965767119 100644 (file)
@@ -32,7 +32,7 @@
  *    Changed reset from standard USB dev reset to vendor reset
  *    Changed data sent to host from compensated to raw coordinates
  *    Eliminated vendor/product module params
- *    Performed multiple successfull tests with an EXII-5010UC
+ *    Performed multiple successful tests with an EXII-5010UC
  *
  *  1.5 02/27/2005 ddstreet@ieee.org
  *    Added module parameter to select raw or hw-calibrated coordinate reporting
index d6051822416e0a4601828e41545125fe25f9819b..036c485d1d1eeb6ef582930f9f9356cc858f943e 100644 (file)
@@ -5041,7 +5041,7 @@ ov6xx0_configure(struct usb_ov511 *ov)
                { OV511_I2C_BUS, 0x2a, 0x04 }, /* Disable framerate adjust */
 //             { OV511_I2C_BUS, 0x2b, 0xac }, /* Framerate; Set 2a[7] first */
                { OV511_I2C_BUS, 0x2d, 0x99 },
-               { OV511_I2C_BUS, 0x33, 0xa0 }, /* Color Procesing Parameter */
+               { OV511_I2C_BUS, 0x33, 0xa0 }, /* Color Processing Parameter */
                { OV511_I2C_BUS, 0x34, 0xd2 }, /* Max A/D range */
                { OV511_I2C_BUS, 0x38, 0x8b },
                { OV511_I2C_BUS, 0x39, 0x40 },
index 42352f531bc0a8debe64ac3de12b632bcd70d06b..42ec468d52d6c8770a2dd4b6270f34ab455b1d8b 100644 (file)
@@ -1100,7 +1100,7 @@ static inline int pwc_mpt_set_angle(struct pwc_device *pdev, int pan, int tilt)
        unsigned char buf[4];
        
        /* set new relative angle; angles are expressed in degrees * 100,
-          but cam as .5 degree resolution, hence devide by 200. Also
+          but cam as .5 degree resolution, hence divide by 200. Also
           the angle must be multiplied by 64 before it's send to
           the cam (??)
         */
index c53e2263b7fbe09c3f70adeee1631b7adcf30dd9..cca47f480a8be536199a1db409a1fb5eb99c10d1 100644 (file)
@@ -272,7 +272,7 @@ static int pwc_allocate_buffers(struct pwc_device *pdev)
                return -ENXIO;
        }
 #endif 
-       /* Allocate Isochronuous pipe buffers */
+       /* Allocate Isochronous pipe buffers */
        for (i = 0; i < MAX_ISO_BUFS; i++) {
                if (pdev->sbuf[i].data == NULL) {
                        kbuf = kmalloc(ISO_BUFFER_SIZE, GFP_KERNEL);
@@ -850,7 +850,7 @@ static int pwc_isoc_init(struct pwc_device *pdev)
        
        if (pdev->vmax_packet_size < 0 || pdev->vmax_packet_size > ISO_MAX_FRAME_SIZE) {
                Err("Failed to find packet size for video endpoint in current alternate setting.\n");
-               return -ENFILE; /* Odd error, that should be noticable */
+               return -ENFILE; /* Odd error, that should be noticeable */
        }
 
        /* Set alternate interface */
@@ -2128,7 +2128,7 @@ static int __init usb_pwc_init(void)
        if (leds[1] >= 0)
                led_off = leds[1];
 
-       /* Big device node whoopla. Basicly, it allows you to assign a
+       /* Big device node whoopla. Basically, it allows you to assign a
           device node (/dev/videoX) to a camera, based on its type
           & serial number. The format is [type[.serialnumber]:]node.
 
index 65805eaa9a1c879bbd01648b680dc80476594d4e..5f9cb08bc02e5de6d578f9f150742f99622aa184 100644 (file)
@@ -75,7 +75,7 @@
 #define PWC_FPS_SNAPSHOT       0x00400000
 
 
-/* structure for transfering x & y coordinates */
+/* structure for transferring x & y coordinates */
 struct pwc_coord
 {
        int x, y;               /* guess what */
index dd4580cb57e0d6624e530da5f20c06a2fd7dd704..7d06105763d4cca2b039bbdefcd8deaae2e0b181 100644 (file)
@@ -859,7 +859,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
                info ("udev is NULL.");
        }
 
-       /* allocate memory for our device state and intialize it */
+       /* allocate memory for our device state and initialize it */
 
        dev = kmalloc (sizeof(struct lego_usb_tower), GFP_KERNEL);
 
index a45ea7c97356eed90b8d6595f639ae7c3c809811..f6bc6b3b333ca8a8f0f032ddf86d1cf86ed3df19 100644 (file)
@@ -4070,6 +4070,9 @@ static const struct usb_device_id products [] = {
 }, {
        USB_DEVICE (0x8086, 0x07d3),    // "blob" bootloader
        .driver_info =  (unsigned long) &blob_info,
+}, {
+       USB_DEVICE (0x22b8, 0x600c),    // USBNET Motorola E680
+       .driver_info =  (unsigned long) &linuxdev_info,
 }, {
        // Linux Ethernet/RNDIS gadget on pxa210/25x/26x
        // e.g. Gumstix, current OpenZaurus, ...
index f98cb2af024e1ac4bbbbc36a589752d261de3499..341ae5f732ddf3de18492c17342a97c4a3442360 100644 (file)
@@ -183,7 +183,7 @@ static void zd1201_usbtx(struct urb *urb, struct pt_regs *regs)
        return;
 }
 
-/* Incomming data */
+/* Incoming data */
 static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs)
 {
        struct zd1201 *zd = urb->context;
@@ -772,7 +772,7 @@ static int zd1201_net_stop(struct net_device *dev)
 /*
        RFC 1042 encapsulates Ethernet frames in 802.11 frames
        by prefixing them with 0xaa, 0xaa, 0x03) followed by a SNAP OID of 0
-       (0x00, 0x00, 0x00). Zd requires an additionnal padding, copy
+       (0x00, 0x00, 0x00). Zd requires an additional padding, copy
        of ethernet addresses, length of the standard RFC 1042 packet
        and a command byte (which is nul for tx).
        
@@ -1098,7 +1098,7 @@ static int zd1201_get_range(struct net_device *dev,
 
 /*     Little bit of magic here: we only get the quality if we poll
  *     for it, and we never get an actual request to trigger such
- *     a poll. Therefore we 'asume' that the user will soon ask for
+ *     a poll. Therefore we 'assume' that the user will soon ask for
  *     the stats after asking the bssid.
  */
 static int zd1201_get_wap(struct net_device *dev,
@@ -1108,7 +1108,7 @@ static int zd1201_get_wap(struct net_device *dev,
        unsigned char buffer[6];
 
        if (!zd1201_getconfig(zd, ZD1201_RID_COMMSQUALITY, buffer, 6)) {
-               /* Unfortunatly the quality and noise reported is useless.
+               /* Unfortunately the quality and noise reported is useless.
                   they seem to be accumulators that increase until you
                   read them, unless we poll on a fixed interval we can't
                   use them
index 0c4aa00bb39d3dea51a7b9f393ddc9b9bb147780..bc798edf0358828f83ab486bde704d52f9ee1fbf 100644 (file)
@@ -53,6 +53,15 @@ config USB_SERIAL_GENERIC
          support" be compiled as a module for this driver to be used
          properly.
 
+config USB_SERIAL_AIRPRIME
+       tristate "USB AirPrime CDMA Wireless Driver"
+       depends on USB_SERIAL
+       help
+         Say Y here if you want to use a AirPrime CDMA Wireless PC card.
+
+         To compile this driver as a module, choose M here: the
+         module will be called airprime.
+
 config USB_SERIAL_BELKIN
        tristate "USB Belkin and Peracom Single Port Serial Driver"
        depends on USB_SERIAL
index b0aac47d1959a1cead78236b611e0ee7c43f342f..d56ff6d86cce220860ae63ca7bfbab532956847b 100644 (file)
@@ -11,6 +11,7 @@ usbserial-obj-$(CONFIG_USB_EZUSB)             += ezusb.o
 
 usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y)
 
+obj-$(CONFIG_USB_SERIAL_AIRPRIME)              += airprime.o
 obj-$(CONFIG_USB_SERIAL_BELKIN)                        += belkin_sa.o
 obj-$(CONFIG_USB_SERIAL_CP2101)                        += cp2101.o
 obj-$(CONFIG_USB_SERIAL_CYBERJACK)             += cyberjack.o
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c
new file mode 100644 (file)
index 0000000..a4ce000
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * AirPrime CDMA Wireless Serial USB driver
+ *
+ * Copyright (C) 2005 Greg Kroah-Hartman <gregkh@suse.de>
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License version
+ *     2 as published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/tty.h>
+#include <linux/module.h>
+#include <linux/usb.h>
+#include "usb-serial.h"
+
+static struct usb_device_id id_table [] = {
+       { USB_DEVICE(0xf3d, 0x0112) },
+       { },
+};
+MODULE_DEVICE_TABLE(usb, id_table);
+
+static struct usb_driver airprime_driver = {
+       .owner =        THIS_MODULE,
+       .name =         "airprime",
+       .probe =        usb_serial_probe,
+       .disconnect =   usb_serial_disconnect,
+       .id_table =     id_table,
+};
+
+static struct usb_serial_device_type airprime_device = {
+       .owner =                THIS_MODULE,
+       .name =                 "airprime",
+       .id_table =             id_table,
+       .num_interrupt_in =     NUM_DONT_CARE,
+       .num_bulk_in =          NUM_DONT_CARE,
+       .num_bulk_out =         NUM_DONT_CARE,
+       .num_ports =            1,
+};
+
+static int __init airprime_init(void)
+{
+       int retval;
+
+       retval = usb_serial_register(&airprime_device);
+       if (retval)
+               return retval;
+       retval = usb_register(&airprime_driver);
+       if (retval)
+               usb_serial_deregister(&airprime_device);
+       return retval;
+}
+
+static void __exit airprime_exit(void)
+{
+       usb_deregister(&airprime_driver);
+       usb_serial_deregister(&airprime_device);
+}
+
+module_init(airprime_init);
+module_exit(airprime_exit);
+MODULE_LICENSE("GPL");
index d165f42d560d6282751c6f81075eced95994341c..f34a9bb6a219a9b9ad0024e2ed57e0a5063aa0f0 100644 (file)
  * See http://geocities.com/i0xox0i for information on this driver and the
  * earthmate usb device.
  *
+ *  Lonnie Mendez <dignome@gmail.com>
+ *  4-29-2005
+ *     Fixed problem where setting or retreiving the serial config would fail with
+ *     EPIPE.  Removed CRTS toggling so the driver behaves more like other usbserial
+ *     adapters.  Issued new interval of 1ms instead of the default 10ms.  As a
+ *     result, transfer speed has been substantially increased.  From avg. 850bps to
+ *     avg. 3300bps.  initial termios has also been modified.  Cleaned up code and
+ *     formatting issues so it is more readable.  Replaced the C++ style comments.
  *
  *  Lonnie Mendez <dignome@gmail.com>
  *  12-15-2004
  *  10-2003
  *     Driver first released.
  *
- *
- * Long Term TODO:
- *     Improve transfer speeds - both read/write are somewhat slow
- *   at this point.
- *      Improve debugging.  Show modem line status with debug output and
- *   implement filtering for certain data as a module parameter.
  */
 
 /* Thanks to Neil Whelchel for writing the first cypress m8 implementation for linux. */
        static int debug;
 #endif
 static int stats;
+static int interval;
 
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v1.08"
+#define DRIVER_VERSION "v1.09"
 #define DRIVER_AUTHOR "Lonnie Mendez <dignome@gmail.com>, Neil Whelchel <koyama@firstlight.net>"
 #define DRIVER_DESC "Cypress USB to Serial Driver"
 
@@ -130,7 +133,6 @@ struct cypress_private {
        char prev_status, diff_status;     /* used for TIOCMIWAIT */
        /* we pass a pointer to this as the arguement sent to cypress_set_termios old_termios */
        struct termios tmp_termios;        /* stores the old termios settings */
-       char calledfromopen;               /* used when issuing lines on open - fixes rts drop bug */
 };
 
 /* write buffer structure */
@@ -168,10 +170,8 @@ static void                  cypress_buf_free(struct cypress_buf *cb);
 static void              cypress_buf_clear(struct cypress_buf *cb);
 static unsigned int      cypress_buf_data_avail(struct cypress_buf *cb);
 static unsigned int      cypress_buf_space_avail(struct cypress_buf *cb);
-static unsigned int      cypress_buf_put(struct cypress_buf *cb, const char *buf,
-                                         unsigned int count);
-static unsigned int      cypress_buf_get(struct cypress_buf *cb, char *buf,
-                                         unsigned int count);
+static unsigned int      cypress_buf_put(struct cypress_buf *cb, const char *buf, unsigned int count);
+static unsigned int      cypress_buf_get(struct cypress_buf *cb, char *buf, unsigned int count);
 
 
 static struct usb_serial_device_type cypress_earthmate_device = {
@@ -234,14 +234,13 @@ static struct usb_serial_device_type cypress_hidcom_device = {
  *****************************************************************************/
 
 
-/* This function can either set or retreive the current serial line settings */
+/* This function can either set or retrieve the current serial line settings */
 static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_mask, int data_bits, int stop_bits,
                                   int parity_enable, int parity_type, int reset, int cypress_request_type)
 {
-       int i, n_baud_rate = 0, retval = 0;
+       int new_baudrate = 0, retval = 0, tries = 0;
        struct cypress_private *priv;
-       __u8 feature_buffer[5];
-       __u8 config;
+       __u8 feature_buffer[8];
        unsigned long flags;
 
        dbg("%s", __FUNCTION__);
@@ -256,7 +255,8 @@ static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_m
                         * of 57600bps (I have no idea whether DeLorme chose to use the general purpose
                         * firmware or not), if you need to modify this speed setting for your own
                         * project please add your own chiptype and modify the code likewise.  The
-                        * Cypress HID->COM device will work successfully up to 115200bps.
+                        * Cypress HID->COM device will work successfully up to 115200bps (but the
+                        * actual throughput is around 3kBps).
                         */
                        if (baud_mask != priv->cbr_mask) {
                                dbg("%s - baud rate is changing", __FUNCTION__);
@@ -265,109 +265,114 @@ static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_m
                                         * but are not used with NMEA and SiRF protocols */
                                        
                                        if ( (baud_mask == B300) || (baud_mask == B600) ) {
-                                               err("%s - failed setting baud rate, unsupported speed (default to 4800)",
+                                               err("%s - failed setting baud rate, unsupported speed",
                                                    __FUNCTION__);
-                                               n_baud_rate = 4800;
-                                       } else if ( (n_baud_rate = mask_to_rate(baud_mask)) == -1) {
-                                               err("%s - failed setting baud rate, unsupported speed (default to 4800)",
+                                               new_baudrate = priv->baud_rate;
+                                       } else if ( (new_baudrate = mask_to_rate(baud_mask)) == -1) {
+                                               err("%s - failed setting baud rate, unsupported speed",
                                                    __FUNCTION__);
-                                               n_baud_rate = 4800;
+                                               new_baudrate = priv->baud_rate;
                                        }
                                } else if (priv->chiptype == CT_CYPHIDCOM) {
-                                       if ( (n_baud_rate = mask_to_rate(baud_mask)) == -1) {
-                                               err("%s - failed setting baud rate, unsupported speed (default to 4800)",
+                                       if ( (new_baudrate = mask_to_rate(baud_mask)) == -1) {
+                                               err("%s - failed setting baud rate, unsupported speed",
                                                    __FUNCTION__);
-                                               n_baud_rate = 4800;
+                                               new_baudrate = priv->baud_rate;
                                        }
                                } else if (priv->chiptype == CT_GENERIC) {
-                                       if ( (n_baud_rate = mask_to_rate(baud_mask)) == -1) {
-                                               err("%s - failed setting baud rate, unsupported speed (default to 4800)",
+                                       if ( (new_baudrate = mask_to_rate(baud_mask)) == -1) {
+                                               err("%s - failed setting baud rate, unsupported speed",
                                                    __FUNCTION__);
-                                               n_baud_rate = 4800;
+                                               new_baudrate = priv->baud_rate;
                                        }
                                } else {
-                                       info("%s - please define your chiptype, using 4800bps default", __FUNCTION__);
-                                       n_baud_rate = 4800;
+                                       info("%s - please define your chiptype", __FUNCTION__);
+                                       new_baudrate = priv->baud_rate;
                                }
                        } else {  /* baud rate not changing, keep the old */
-                               n_baud_rate = priv->baud_rate;
+                               new_baudrate = priv->baud_rate;
                        }
-                       dbg("%s - baud rate is being sent as %d", __FUNCTION__, n_baud_rate);
-
+                       dbg("%s - baud rate is being sent as %d", __FUNCTION__, new_baudrate);
                        
-                       /*
-                        * This algorithm accredited to Jiang Jay Zhang... thanks for all the help!
-                        */
-                       for (i = 0; i < 4; ++i) {
-                               feature_buffer[i] = ( n_baud_rate >> (i*8) & 0xFF );
-                       }
+                       memset(feature_buffer, 0, 8);
+                       /* fill the feature_buffer with new configuration */
+                       *((u_int32_t *)feature_buffer) = new_baudrate;
 
-                       config = 0;                      // reset config byte
-                       config |= data_bits;             // assign data bits in 2 bit space ( max 3 )
+                       feature_buffer[4] |= data_bits;   /* assign data bits in 2 bit space ( max 3 ) */
                        /* 1 bit gap */
-                       config |= (stop_bits << 3);      // assign stop bits in 1 bit space
-                       config |= (parity_enable << 4);  // assign parity flag in 1 bit space
-                       config |= (parity_type << 5);    // assign parity type in 1 bit space
+                       feature_buffer[4] |= (stop_bits << 3);   /* assign stop bits in 1 bit space */
+                       feature_buffer[4] |= (parity_enable << 4);   /* assign parity flag in 1 bit space */
+                       feature_buffer[4] |= (parity_type << 5);   /* assign parity type in 1 bit space */
                        /* 1 bit gap */
-                       config |= (reset << 7);          // assign reset at end of byte, 1 bit space
-
-                       feature_buffer[4] = config;
+                       feature_buffer[4] |= (reset << 7);   /* assign reset at end of byte, 1 bit space */
                                
                        dbg("%s - device is being sent this feature report:", __FUNCTION__);
                        dbg("%s - %02X - %02X - %02X - %02X - %02X", __FUNCTION__, feature_buffer[0], feature_buffer[1],
                            feature_buffer[2], feature_buffer[3], feature_buffer[4]);
                        
+                       do {
                        retval = usb_control_msg (port->serial->dev, usb_sndctrlpipe(port->serial->dev, 0),
                                                  HID_REQ_SET_REPORT, USB_DIR_OUT | USB_RECIP_INTERFACE | USB_TYPE_CLASS,
-                                                 0x0300, 0, feature_buffer, 5, 500);
+                                                         0x0300, 0, feature_buffer, 8, 500);
+
+                               if (tries++ >= 3)
+                                       break;
 
-                       if (retval != 5)
+                               if (retval == EPIPE)
+                                       usb_clear_halt(port->serial->dev, 0x00);
+                       } while (retval != 8 && retval != ENODEV);
+
+                       if (retval != 8)
                                err("%s - failed sending serial line settings - %d", __FUNCTION__, retval);
                        else {
                                spin_lock_irqsave(&priv->lock, flags);
-                               priv->baud_rate = n_baud_rate;
+                               priv->baud_rate = new_baudrate;
                                priv->cbr_mask = baud_mask;
-                               priv->current_config = config;
-                               ++priv->cmd_count;
+                               priv->current_config = feature_buffer[4];
                                spin_unlock_irqrestore(&priv->lock, flags);
                        }
                break;
                case CYPRESS_GET_CONFIG:
                        dbg("%s - retreiving serial line settings", __FUNCTION__);
-                       /* reset values in feature buffer */
-                       memset(feature_buffer, 0, 5);
+                       /* set initial values in feature buffer */
+                       memset(feature_buffer, 0, 8);
 
+                       do {
                        retval = usb_control_msg (port->serial->dev, usb_rcvctrlpipe(port->serial->dev, 0),
                                                  HID_REQ_GET_REPORT, USB_DIR_IN | USB_RECIP_INTERFACE | USB_TYPE_CLASS,
-                                                 0x0300, 0, feature_buffer, 5, 500);
+                                                         0x0300, 0, feature_buffer, 8, 500);
+                               
+                               if (tries++ >= 3)
+                                       break;
+
+                               if (retval == EPIPE)
+                                       usb_clear_halt(port->serial->dev, 0x00);
+                       } while (retval != 5 && retval != ENODEV);
+
                        if (retval != 5) {
                                err("%s - failed to retreive serial line settings - %d", __FUNCTION__, retval);
                                return retval;
                        } else {
                                spin_lock_irqsave(&priv->lock, flags);
+
                                /* store the config in one byte, and later use bit masks to check values */
                                priv->current_config = feature_buffer[4];
-                               /* reverse the process above to get the baud_mask value */
-                               n_baud_rate = 0; // reset bits
-                               for (i = 0; i < 4; ++i) {
-                                       n_baud_rate |= ( feature_buffer[i] << (i*8) );
-                               }
+                               priv->baud_rate = *((u_int32_t *)feature_buffer);
                                
-                               priv->baud_rate = n_baud_rate;
-                               if ( (priv->cbr_mask = rate_to_mask(n_baud_rate)) == 0x40)
+                               if ( (priv->cbr_mask = rate_to_mask(priv->baud_rate)) == 0x40)
                                        dbg("%s - failed setting the baud mask (not defined)", __FUNCTION__);
-                               ++priv->cmd_count;
                                spin_unlock_irqrestore(&priv->lock, flags);
                        }
-                       break;
-               default:
-                       err("%s - unsupported serial control command issued", __FUNCTION__);
        }
+       spin_lock_irqsave(&priv->lock, flags);
+       ++priv->cmd_count;
+       spin_unlock_irqrestore(&priv->lock, flags);
+
        return retval;
 } /* cypress_serial_control */
 
 
-/* given a baud mask, it will return speed on success */
+/* given a baud mask, it will return integer baud on success */
 static int mask_to_rate (unsigned mask)
 {
        int rate;
@@ -438,11 +443,12 @@ static int generic_startup (struct usb_serial *serial)
        
        usb_reset_configuration (serial->dev);
        
+       interval = 1;
        priv->cmd_ctrl = 0;
        priv->line_control = 0;
        priv->termios_initialized = 0;
-       priv->calledfromopen = 0;
        priv->rx_flags = 0;
+       priv->cbr_mask = B300;
        usb_set_serial_port_data(serial->port[0], priv);
        
        return (0);     
@@ -513,7 +519,6 @@ static int cypress_open (struct usb_serial_port *port, struct file *filp)
        dbg("%s - port %d", __FUNCTION__, port->number);
 
        /* clear halts before open */
-       usb_clear_halt(serial->dev, 0x00);
        usb_clear_halt(serial->dev, 0x81);
        usb_clear_halt(serial->dev, 0x02);
 
@@ -531,7 +536,6 @@ static int cypress_open (struct usb_serial_port *port, struct file *filp)
        /* raise both lines and set termios */
        spin_lock_irqsave(&priv->lock, flags);
        priv->line_control = CONTROL_DTR | CONTROL_RTS;
-       priv->calledfromopen = 1;
        priv->cmd_ctrl = 1;
        spin_unlock_irqrestore(&priv->lock, flags);
        result = cypress_write(port, NULL, 0);
@@ -553,7 +557,7 @@ static int cypress_open (struct usb_serial_port *port, struct file *filp)
        usb_fill_int_urb(port->interrupt_in_urb, serial->dev,
                usb_rcvintpipe(serial->dev, port->interrupt_in_endpointAddress),
                port->interrupt_in_urb->transfer_buffer, port->interrupt_in_urb->transfer_buffer_length,
-               cypress_read_int_callback, port, port->interrupt_in_urb->interval);
+               cypress_read_int_callback, port, interval);
        result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
 
        if (result){
@@ -680,12 +684,12 @@ static void cypress_send(struct usb_serial_port *port)
        spin_lock_irqsave(&priv->lock, flags);
        switch (port->interrupt_out_size) {
                case 32:
-                       // this is for the CY7C64013...
+                       /* this is for the CY7C64013... */
                        offset = 2;
                        port->interrupt_out_buffer[0] = priv->line_control;
                        break;
                case 8:
-                       // this is for the CY7C63743...
+                       /* this is for the CY7C63743... */
                        offset = 1;
                        port->interrupt_out_buffer[0] = priv->line_control;
                        break;
@@ -738,6 +742,7 @@ send:
 
        port->interrupt_out_urb->transfer_buffer_length = actual_size;
        port->interrupt_out_urb->dev = port->serial->dev;
+       port->interrupt_out_urb->interval = interval;
        result = usb_submit_urb (port->interrupt_out_urb, GFP_ATOMIC);
        if (result) {
                dev_err(&port->dev, "%s - failed submitting write urb, error %d\n", __FUNCTION__,
@@ -910,7 +915,7 @@ static void cypress_set_termios (struct usb_serial_port *port, struct termios *o
        unsigned cflag, iflag, baud_mask;
        unsigned long flags;
        __u8 oldlines;
-       int linechange;
+       int linechange = 0;
        
        dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -996,15 +1001,7 @@ static void cypress_set_termios (struct usb_serial_port *port, struct termios *o
                        case B115200: dbg("%s - setting baud 115200bps", __FUNCTION__); break;
                        default: dbg("%s - unknown masked baud rate", __FUNCTION__);
                }
-               priv->line_control |= CONTROL_DTR;
-               
-               /* toggle CRTSCTS? - don't do this if being called from cypress_open */
-               if (!priv->calledfromopen) {
-                       if (cflag & CRTSCTS)
-                               priv->line_control |= CONTROL_RTS;
-                       else
-                               priv->line_control &= ~CONTROL_RTS;
-               }
+               priv->line_control = (CONTROL_DTR | CONTROL_RTS);
        }
        spin_unlock_irqrestore(&priv->lock, flags);
        
@@ -1014,8 +1011,6 @@ static void cypress_set_termios (struct usb_serial_port *port, struct termios *o
        cypress_serial_control(port, baud_mask, data_bits, stop_bits, parity_enable,
                               parity_type, 0, CYPRESS_SET_CONFIG);
 
-       msleep(50);                     /* give some time between change and read (50ms) */
-
        /* we perform a CYPRESS_GET_CONFIG so that the current settings are filled into the private structure
          * this should confirm that all is working if it returns what we just set */
        cypress_serial_control(port, 0, 0, 0, 0, 0, 0, CYPRESS_GET_CONFIG);
@@ -1031,7 +1026,6 @@ static void cypress_set_termios (struct usb_serial_port *port, struct termios *o
                dbg("Using custom termios settings for a baud rate of 4800bps.");
                /* define custom termios settings for NMEA protocol */
 
-               
                tty->termios->c_iflag /* input modes - */
                        &= ~(IGNBRK             /* disable ignore break */
                        | BRKINT                /* disable break causes interrupt */
@@ -1052,23 +1046,16 @@ static void cypress_set_termios (struct usb_serial_port *port, struct termios *o
                        | ISIG                  /* disable interrupt, quit, and suspend special characters */
                        | IEXTEN);              /* disable non-POSIX special characters */
 
-       } else if (priv->chiptype == CT_CYPHIDCOM) {
-
-               // Software app handling it for device...       
+       } /* CT_CYPHIDCOM: Application should handle this for device */
 
-       }
        linechange = (priv->line_control != oldlines);
        spin_unlock_irqrestore(&priv->lock, flags);
 
        /* if necessary, set lines */
-       if (!priv->calledfromopen && linechange) {
+       if (linechange) {
                priv->cmd_ctrl = 1;
                cypress_write(port, NULL, 0);
        }
-
-       if (priv->calledfromopen)
-               priv->calledfromopen = 0;
-       
 } /* cypress_set_termios */
 
  
@@ -1164,7 +1151,7 @@ static void cypress_read_int_callback(struct urb *urb, struct pt_regs *regs)
        spin_lock_irqsave(&priv->lock, flags);
        switch(urb->actual_length) {
                case 32:
-                       // This is for the CY7C64013...
+                       /* This is for the CY7C64013... */
                        priv->current_status = data[0] & 0xF8;
                        bytes = data[1]+2;
                        i=2;
@@ -1172,7 +1159,7 @@ static void cypress_read_int_callback(struct urb *urb, struct pt_regs *regs)
                                havedata = 1;
                        break;
                case 8:
-                       // This is for the CY7C63743...
+                       /* This is for the CY7C63743... */
                        priv->current_status = data[0] & 0xF8;
                        bytes = (data[0] & 0x07)+1;
                        i=1;
@@ -1245,7 +1232,7 @@ continue_read:
                port->interrupt_in_urb->transfer_buffer,
                port->interrupt_in_urb->transfer_buffer_length,
                cypress_read_int_callback, port,
-               port->interrupt_in_urb->interval);
+               interval);
        result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
        if (result)
                dev_err(&urb->dev->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
@@ -1274,6 +1261,8 @@ static void cypress_write_int_callback(struct urb *urb, struct pt_regs *regs)
                        dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status);
                        priv->write_urb_in_use = 0;
                        return;
+               case -EPIPE: /* no break needed */
+                       usb_clear_halt(port->serial->dev, 0x02);
                default:
                        /* error in the urb, so we have to resubmit it */
                        dbg("%s - Overflow in write", __FUNCTION__);
@@ -1535,3 +1524,5 @@ module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
 module_param(stats, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(stats, "Enable statistics or not");
+module_param(interval, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(interval, "Overrides interrupt interval");
index 4c788c767a97f890df4f24741f4d47518bc1a6ee..52394f08a9474b1b90a41814601f4379313d2ec9 100644 (file)
@@ -76,7 +76,7 @@
  *      Defererence pointers after any paranoid checks, not before.
  *
  * (21/Jun/2003) Erik Nygren
- *      Added support for Home Electronics Tira-1 IR tranceiver using FT232BM chip.
+ *      Added support for Home Electronics Tira-1 IR transceiver using FT232BM chip.
  *      See <http://www.home-electro.com/tira1.htm>.  Only operates properly 
  *      at 100000 and RTS-CTS, so set custom divisor mode on startup.
  *      Also force the Tira-1 and USB-UIRT to only use their custom baud rates.
@@ -91,7 +91,7 @@
  *      Minor whitespace and comment changes.
  *
  * (12/Jun/2003) David Norwood
- *      Added support for USB-UIRT IR tranceiver using 8U232AM chip.
+ *      Added support for USB-UIRT IR transceiver using 8U232AM chip.
  *      See <http://home.earthlink.net/~jrhees/USBUIRT/index.htm>.  Only
  *      operates properly at 312500, so set custom divisor mode on startup.
  *
@@ -272,6 +272,7 @@ static int debug;
 
 static struct usb_device_id id_table_sio [] = {
        { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) },
+       { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) },
        { }                                             /* Terminating entry */
 };
 
@@ -296,7 +297,6 @@ static struct usb_device_id id_table_8U232AM [] = {
        { USB_DEVICE_VER(FTDI_VID, FTDI_IRTRANS_PID, 0, 0x3ff) },
        { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_PID, 0, 0x3ff) },
        { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_ALT_PID, 0, 0x3ff) },
-       { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_ALT_ALT_PID, 0, 0x3ff) },
        { USB_DEVICE_VER(FTDI_VID, FTDI_RELAIS_PID, 0, 0x3ff) },
        { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
        { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
@@ -369,11 +369,14 @@ static struct usb_device_id id_table_8U232AM [] = {
        { USB_DEVICE_VER(INTREPID_VID, INTREPID_NEOVI_PID, 0, 0x3ff) },
        { USB_DEVICE_VER(FALCOM_VID, FALCOM_TWIST_PID, 0, 0x3ff) },
        { USB_DEVICE_VER(FTDI_VID, FTDI_SUUNTO_SPORTS_PID, 0, 0x3ff) },
-       { USB_DEVICE_VER(FTDI_RM_VID, FTDI_RMCANVIEW_PID, 0, 0x3ff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_RM_CANVIEW_PID, 0, 0x3ff) },
        { USB_DEVICE_VER(BANDB_VID, BANDB_USOTL4_PID, 0, 0x3ff) },
        { USB_DEVICE_VER(BANDB_VID, BANDB_USTL4_PID, 0, 0x3ff) },
        { USB_DEVICE_VER(BANDB_VID, BANDB_USO9ML2_PID, 0, 0x3ff) },
        { USB_DEVICE_VER(FTDI_VID, EVER_ECO_PRO_CDS, 0, 0x3ff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_0_PID, 0, 0x3ff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID, 0, 0x3ff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID, 0, 0x3ff) },
        { }                                             /* Terminating entry */
 };
 
@@ -382,7 +385,6 @@ static struct usb_device_id id_table_FT232BM [] = {
        { USB_DEVICE_VER(FTDI_VID, FTDI_IRTRANS_PID, 0x400, 0xffff) },
        { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_PID, 0x400, 0xffff) },
        { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_ALT_PID, 0x400, 0xffff) },
-       { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_ALT_ALT_PID, 0x400, 0xffff) },
        { USB_DEVICE_VER(FTDI_VID, FTDI_RELAIS_PID, 0x400, 0xffff) },
        { USB_DEVICE_VER(FTDI_NF_RIC_VID, FTDI_NF_RIC_PID, 0x400, 0xffff) },
        { USB_DEVICE_VER(FTDI_VID, FTDI_XF_632_PID, 0x400, 0xffff) },
@@ -485,11 +487,15 @@ static struct usb_device_id id_table_FT232BM [] = {
        { USB_DEVICE_VER(INTREPID_VID, INTREPID_NEOVI_PID, 0x400, 0xffff) },
        { USB_DEVICE_VER(FALCOM_VID, FALCOM_TWIST_PID, 0x400, 0xffff) },
        { USB_DEVICE_VER(FTDI_VID, FTDI_SUUNTO_SPORTS_PID, 0x400, 0xffff) },
-       { USB_DEVICE_VER(FTDI_RM_VID, FTDI_RMCANVIEW_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_RM_CANVIEW_PID, 0x400, 0xffff) },
        { USB_DEVICE_VER(BANDB_VID, BANDB_USOTL4_PID, 0x400, 0xffff) },
        { USB_DEVICE_VER(BANDB_VID, BANDB_USTL4_PID, 0x400, 0xffff) },
        { USB_DEVICE_VER(BANDB_VID, BANDB_USO9ML2_PID, 0x400, 0xffff) },
        { USB_DEVICE_VER(FTDI_VID, EVER_ECO_PRO_CDS, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_0_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID, 0x400, 0xffff) },
        { }                                             /* Terminating entry */
 };
 
@@ -517,7 +523,6 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) },
-       { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_ALT_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) },
        { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
@@ -596,6 +601,22 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, PROTEGO_R2X0) },
        { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_3) },
        { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_4) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E808_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E809_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80A_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80B_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80C_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80D_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80E_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80F_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E888_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E889_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88A_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88B_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88C_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88D_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88E_PID, 0x400, 0xffff) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88F_PID, 0x400, 0xffff) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_UO100_PID) },
        { USB_DEVICE_VER(FTDI_VID, LINX_SDMUSBQSS_PID, 0x400, 0xffff) },
        { USB_DEVICE_VER(FTDI_VID, LINX_MASTERDEVEL2_PID, 0x400, 0xffff) },
@@ -609,11 +630,16 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(INTREPID_VID, INTREPID_NEOVI_PID) },
        { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) },
-       { USB_DEVICE(FTDI_RM_VID, FTDI_RMCANVIEW_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) },
        { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) },
        { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) },
        { USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) },
        { USB_DEVICE(FTDI_VID, EVER_ECO_PRO_CDS) },
+       { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_0_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) },
+       { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) },
+       { USB_DEVICE_VER(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID, 0x400, 0xffff) },
        { }                                             /* Terminating entry */
 };
 
@@ -1457,10 +1483,10 @@ static int ftdi_FT2232C_startup (struct usb_serial *serial)
        inter = serial->interface->altsetting->desc.bInterfaceNumber;
 
        if (inter) {
-               priv->interface = INTERFACE_B;
+               priv->interface = PIT_SIOB;
        }
        else  {
-               priv->interface = INTERFACE_A;
+               priv->interface = PIT_SIOA;
        }
        priv->baud_base = 48000000 / 2; /* Would be / 16, but FT2232C supports multiple of 0.125 divisor fractions! */
        
index be5d60bf90b903b1d1a16f25a23c9e37d8317017..a52bb13a9ce4bda03f6ea616e8985735dcafd75f 100644 (file)
@@ -26,7 +26,6 @@
 #define FTDI_SIO_PID   0x8372  /* Product Id SIO application of 8U100AX  */
 #define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */
 #define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */
-#define FTDI_8U232AM_ALT_ALT_PID 0xf3c0 /* FTDI's second alternate PID for above */
 #define FTDI_8U2232C_PID 0x6010 /* Dual channel device */
 #define FTDI_RELAIS_PID        0xFA10  /* Relais device from Rudolf Gugler */
 #define FTDI_NF_RIC_VID        0x0DCD  /* Vendor Id */
 /*
  * Home Electronics (www.home-electro.com) USB gadgets
  */
-#define FTDI_HE_TIRA1_PID      0xFA78  /* Tira-1 IR tranceiver */
+#define FTDI_HE_TIRA1_PID      0xFA78  /* Tira-1 IR transceiver */
 
 /* USB-UIRT - An infrared receiver and transmitter using the 8U232AM chip */
 /* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */
  */
 #define OCT_VID                        0x0B39  /* OCT vendor ID */
 /* Note: OCT US101 is also rebadged as Dick Smith Electronics (NZ) XH6381 */
-/* Also rebadged as SIIG Inc. model US2308 */
+/* Also rebadged as Dick Smith Electronics (Aus) XH6451 */
+/* Also rebadged as SIIG Inc. model US2308 hardware version 1 */
 #define OCT_US101_PID          0x0421  /* OCT US101 USB to RS-232 */
 
 /* an infrared receiver for user access control with IR tags */
 
 /*
  * RM Michaelides CANview USB (http://www.rmcan.com)
- * CAN filedbus interface adapter, addad by port GmbH www.port.de)
+ * CAN fieldbus interface adapter, added by port GmbH www.port.de)
+ * Ian Abbott changed the macro names for consistency.
  */
-#define FTDI_RM_VID            0x0403  /* Vendor  Id */
-#define FTDI_RMCANVIEW_PID     0xfd60  /* Product Id */
+#define FTDI_RM_CANVIEW_PID    0xfd60  /* Product Id */
 
 /*
  * EVER Eco Pro UPS (http://www.ever.com.pl/)
 
 #define        EVER_ECO_PRO_CDS        0xe520  /* RS-232 converter */
 
+/*
+ * 4N-GALAXY.DE PIDs for CAN-USB, USB-RS232, USB-RS422, USB-RS485,
+ * USB-TTY activ, USB-TTY passiv.  Some PIDs are used by several devices
+ * and I'm not entirely sure which are used by which.
+ */
+#define FTDI_4N_GALAXY_DE_0_PID        0x8372
+#define FTDI_4N_GALAXY_DE_1_PID        0xF3C0
+#define FTDI_4N_GALAXY_DE_2_PID        0xF3C1
+
+/*
+ * Mobility Electronics products.
+ */
+#define MOBILITY_VID                   0x1342
+#define MOBILITY_USB_SERIAL_PID                0x0202  /* EasiDock USB 200 serial */
+
+/*
+ * Active Robots product ids.
+ */
+#define FTDI_ACTIVE_ROBOTS_PID 0xE548  /* USB comms board */
+
 /* Commands */
 #define FTDI_SIO_RESET                 0 /* Reset the port */
 #define FTDI_SIO_MODEM_CTRL    1 /* Set the modem control register */
 #define FTDI_SIO_SET_LATENCY_TIMER     9 /* Set the latency timer */
 #define FTDI_SIO_GET_LATENCY_TIMER     10 /* Get the latency timer */
 
-/* Port interface code for FT2232C */
-#define INTERFACE_A            1
-#define INTERFACE_B            2
-
 
 /*
  *   BmRequestType:  1100 0000b
index 8c1fa5e722b1a86785b6e537cd50bb45d62e4651..f1804fd5a3ddcada93cfd65b2c6a3f52525330b3 100644 (file)
 //
 
 //
-// Edgeport Compatiblity Descriptor
+// Edgeport Compatibility Descriptor
 //
 // This descriptor is only returned by Edgeport-compatible devices
 // supporting the EPiC spec. True ION devices do not return this
index dd935b62c1a82e072628250fa958fd780f952ddf..86708ecd87357095629d6f670938b2da30e456ac 100644 (file)
@@ -19,7 +19,7 @@
 
                This file is available under a BSD-style copyright
 
-       2. The name of InnoSys Incorprated may not be used to endorse or promote
+       2. The name of InnoSys Incorporated may not be used to endorse or promote
        products derived from this software without specific prior written
        permission.
 
index d76483706bc955e9f1c86f36a69749d7c46af319..5a9321705a7426000e1197813c35b54123c85f70 100644 (file)
@@ -47,6 +47,7 @@
 #include <linux/cdrom.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_dbg.h>
 
 #include "debug.h"
 #include "scsi.h"
index 7eff03d9b041c0de75a5161912acc1649e28a1b6..f3b60288696cfbc1162418368892773959562dbe 100644 (file)
@@ -786,7 +786,7 @@ static int usbat_flash_check_media(struct us_data *us,
        if (rc != USB_STOR_XFER_GOOD)
                return USB_STOR_TRANSPORT_ERROR;
 
-       // Check for media existance
+       // Check for media existence
        rc = usbat_flash_check_media_present(uio);
        if (rc == USBAT_FLASH_MEDIA_NONE) {
                info->sense_key = 0x02;
index bbda63c24c4d686d27723db866f0c439a5542246..d2891f475793678078ce6fffa3326d5bbe6bfaa3 100644 (file)
@@ -1,5 +1,5 @@
 /* Driver for USB Mass Storage compliant devices
- * Ununsual Devices File
+ * Unusual Devices File
  *
  * $Id: unusual_devs.h,v 1.32 2002/02/25 02:41:24 mdharm Exp $
  *
  * USB development list <linux-usb-devel@lists.sourceforge.net>.
  */
 
+/* patch submitted by Vivian Bregier <Vivian.Bregier@imag.fr>
+ */
+UNUSUAL_DEV(  0x03eb, 0x2002, 0x0100, 0x0100,
+                "ATMEL",
+                "SND1 Storage",
+                US_SC_DEVICE, US_PR_DEVICE, NULL,
+                US_FL_IGNORE_RESIDUE),
+
 UNUSUAL_DEV(  0x03ee, 0x6901, 0x0000, 0x0100,
                "Mitsumi",
                "USB FDD",
@@ -994,6 +1002,13 @@ UNUSUAL_DEV(  0x1019, 0x0c55, 0x0000, 0x9999,
                US_SC_DEVICE, US_PR_DEVICE, usb_stor_ucr61s2b_init,
                0 ),
 
+/* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */
+UNUSUAL_DEV(  0x132b, 0x000b, 0x0001, 0x0001,
+               "Minolta",
+               "Dimage Z10",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               0 ),
+
 /* Reported by Kotrla Vitezslav <kotrla@ceb.cz> */
 UNUSUAL_DEV(  0x1370, 0x6828, 0x0110, 0x0110,
                "SWISSBIT",
index 8b1b7c687a991a828fae1261bdcf0ff1a982266d..3894b2a501d6e7a4636e5f5382c22741cd75ca6c 100644 (file)
@@ -90,6 +90,8 @@ struct cfb_info {
         */
        u_char                  ramdac_ctrl;
        u_char                  ramdac_powerdown;
+
+       u32                     pseudo_palette[16];
 };
 
 static char *default_font = "Acorn8x8";
@@ -1223,9 +1225,7 @@ cyberpro_alloc_fb_info(unsigned int id, char *name)
 {
        struct cfb_info *cfb;
 
-       cfb = kmalloc(sizeof(struct cfb_info) +
-                      sizeof(u32) * 16, GFP_KERNEL);
-
+       cfb = kmalloc(sizeof(struct cfb_info), GFP_KERNEL);
        if (!cfb)
                return NULL;
 
@@ -1281,7 +1281,7 @@ cyberpro_alloc_fb_info(unsigned int id, char *name)
 
        cfb->fb.fbops           = &cyber2000fb_ops;
        cfb->fb.flags           = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
-       cfb->fb.pseudo_palette  = (void *)(cfb + 1);
+       cfb->fb.pseudo_palette  = cfb->pseudo_palette;
 
        fb_alloc_cmap(&cfb->fb.cmap, NR_PALETTE, 0);
 
index e04d3e8b254967084683b949d2bf1abbac2492db..a9a618f2aa6a25316522c16f8649d13ba52eec34 100644 (file)
@@ -1000,8 +1000,10 @@ static int i810_check_params(struct fb_var_screeninfo *var,
 
        if (fb_validate_mode(var, info)) {
                if (fb_get_mode(FB_MAXTIMINGS, 0, var, info)) {
-                       int default_sync = (hsync1-HFMIN)|(hsync2-HFMAX)
-                                           |(vsync1-VFMIN)|(vsync2-VFMAX);
+                       int default_sync = (info->monspecs.hfmin-HFMIN)
+                                               |(info->monspecs.hfmax-HFMAX)
+                                               |(info->monspecs.vfmin-VFMIN)
+                                               |(info->monspecs.vfmax-VFMAX);
                        printk("i810fb: invalid video mode%s\n",
                            default_sync ? "" :
                            ". Specifying vsyncN/hsyncN parameters may help");
index 7bc906677b0d5e2addc76b84789b74ff48afc3b3..24a689179af27e2e8e619022ca6905546aa43bbb 100644 (file)
@@ -175,31 +175,22 @@ jfs_get_blocks(struct inode *ip, sector_t lblock, unsigned long max_blocks,
 {
        s64 lblock64 = lblock;
        int rc = 0;
-       int take_locks;
        xad_t xad;
        s64 xaddr;
        int xflag;
-       s32 xlen;
-
-       /*
-        * If this is a special inode (imap, dmap)
-        * the lock should already be taken
-        */
-       take_locks = (JFS_IP(ip)->fileset != AGGREGATE_I);
+       s32 xlen = max_blocks;
 
        /*
         * Take appropriate lock on inode
         */
-       if (take_locks) {
-               if (create)
-                       IWRITE_LOCK(ip);
-               else
-                       IREAD_LOCK(ip);
-       }
+       if (create)
+               IWRITE_LOCK(ip);
+       else
+               IREAD_LOCK(ip);
 
        if (((lblock64 << ip->i_sb->s_blocksize_bits) < ip->i_size) &&
-           (xtLookup(ip, lblock64, max_blocks, &xflag, &xaddr, &xlen, 0)
-            == 0) && xlen) {
+           (!xtLookup(ip, lblock64, max_blocks, &xflag, &xaddr, &xlen, 0)) &&
+           xaddr) {
                if (xflag & XAD_NOTRECORDED) {
                        if (!create)
                                /*
@@ -238,7 +229,7 @@ jfs_get_blocks(struct inode *ip, sector_t lblock, unsigned long max_blocks,
 #ifdef _JFS_4K
        if ((rc = extHint(ip, lblock64 << ip->i_sb->s_blocksize_bits, &xad)))
                goto unlock;
-       rc = extAlloc(ip, max_blocks, lblock64, &xad, FALSE);
+       rc = extAlloc(ip, xlen, lblock64, &xad, FALSE);
        if (rc)
                goto unlock;
 
@@ -258,12 +249,10 @@ jfs_get_blocks(struct inode *ip, sector_t lblock, unsigned long max_blocks,
        /*
         * Release lock on inode
         */
-       if (take_locks) {
-               if (create)
-                       IWRITE_UNLOCK(ip);
-               else
-                       IREAD_UNLOCK(ip);
-       }
+       if (create)
+               IWRITE_UNLOCK(ip);
+       else
+               IREAD_UNLOCK(ip);
        return rc;
 }
 
index d86e467c6e421628a2f845668b5da630581bdf7e..69007fd546efc01ffa08a5855cbc818f0a8ac202 100644 (file)
@@ -471,6 +471,7 @@ dbUpdatePMap(struct inode *ipbmap,
        struct metapage *mp;
        struct jfs_log *log;
        int lsn, difft, diffp;
+       unsigned long flags;
 
        /* the blocks better be within the mapsize. */
        if (blkno + nblocks > bmp->db_mapsize) {
@@ -504,6 +505,7 @@ dbUpdatePMap(struct inode *ipbmap,
                                           0);
                        if (mp == NULL)
                                return -EIO;
+                       metapage_wait_for_io(mp);
                }
                dp = (struct dmap *) mp->data;
 
@@ -578,34 +580,32 @@ dbUpdatePMap(struct inode *ipbmap,
                if (mp->lsn != 0) {
                        /* inherit older/smaller lsn */
                        logdiff(diffp, mp->lsn, log);
+                       LOGSYNC_LOCK(log, flags);
                        if (difft < diffp) {
                                mp->lsn = lsn;
 
                                /* move bp after tblock in logsync list */
-                               LOGSYNC_LOCK(log);
                                list_move(&mp->synclist, &tblk->synclist);
-                               LOGSYNC_UNLOCK(log);
                        }
 
                        /* inherit younger/larger clsn */
-                       LOGSYNC_LOCK(log);
                        logdiff(difft, tblk->clsn, log);
                        logdiff(diffp, mp->clsn, log);
                        if (difft > diffp)
                                mp->clsn = tblk->clsn;
-                       LOGSYNC_UNLOCK(log);
+                       LOGSYNC_UNLOCK(log, flags);
                } else {
                        mp->log = log;
                        mp->lsn = lsn;
 
                        /* insert bp after tblock in logsync list */
-                       LOGSYNC_LOCK(log);
+                       LOGSYNC_LOCK(log, flags);
 
                        log->count++;
                        list_add(&mp->synclist, &tblk->synclist);
 
                        mp->clsn = tblk->clsn;
-                       LOGSYNC_UNLOCK(log);
+                       LOGSYNC_UNLOCK(log, flags);
                }
        }
 
index e357890adfb2b4d22683628624e323af20d8a909..ac41f72d6d502fd22bcba1181a84b1c90a9d4584 100644 (file)
@@ -212,7 +212,7 @@ static struct metapage *read_index_page(struct inode *inode, s64 blkno)
        s32 xlen;
 
        rc = xtLookup(inode, blkno, 1, &xflag, &xaddr, &xlen, 1);
-       if (rc || (xlen == 0))
+       if (rc || (xaddr == 0))
                return NULL;
 
        return read_metapage(inode, xaddr, PSIZE, 1);
@@ -231,7 +231,7 @@ static struct metapage *get_index_page(struct inode *inode, s64 blkno)
        s32 xlen;
 
        rc = xtLookup(inode, blkno, 1, &xflag, &xaddr, &xlen, 1);
-       if (rc || (xlen == 0))
+       if (rc || (xaddr == 0))
                return NULL;
 
        return get_metapage(inode, xaddr, PSIZE, 1);
@@ -3181,7 +3181,7 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
                        d = (struct ldtentry *) & p->slot[stbl[i]];
 
                        if (((long) jfs_dirent + d->namlen + 1) >
-                           (dirent_buf + PSIZE)) {
+                           (dirent_buf + PAGE_SIZE)) {
                                /* DBCS codepages could overrun dirent_buf */
                                index = i;
                                overflow = 1;
index 783831301625ad828f417b34ddce23284373b450..7acff2ce3c80f44fee086bef667ae86c12eac463 100644 (file)
@@ -502,7 +502,7 @@ struct inode *diReadSpecial(struct super_block *sb, ino_t inum, int secondary)
 
        }
 
-       ip->i_mapping->a_ops = &jfs_aops;
+       ip->i_mapping->a_ops = &jfs_metapage_aops;
        mapping_set_gfp_mask(ip->i_mapping, GFP_NOFS);
 
        /* Allocations to metadata inodes should not affect quotas */
@@ -2573,9 +2573,18 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
                        goto out;
                }
 
-               /* assign a buffer for the page */
-               mp = get_metapage(ipimap, xaddr, PSIZE, 1);
-               if (!mp) {
+               /*
+                * start transaction of update of the inode map
+                * addressing structure pointing to the new iag page;
+                */
+               tid = txBegin(sb, COMMIT_FORCE);
+               down(&JFS_IP(ipimap)->commit_sem);
+
+               /* update the inode map addressing structure to point to it */
+               if ((rc =
+                    xtInsert(tid, ipimap, 0, blkno, xlen, &xaddr, 0))) {
+                       txEnd(tid);
+                       up(&JFS_IP(ipimap)->commit_sem);
                        /* Free the blocks allocated for the iag since it was
                         * not successfully added to the inode map
                         */
@@ -2584,6 +2593,29 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
                        /* release the inode map lock */
                        IWRITE_UNLOCK(ipimap);
 
+                       goto out;
+               }
+
+               /* update the inode map's inode to reflect the extension */
+               ipimap->i_size += PSIZE;
+               inode_add_bytes(ipimap, PSIZE);
+
+               /* assign a buffer for the page */
+               mp = get_metapage(ipimap, blkno, PSIZE, 0);
+               if (!mp) {
+                       /*
+                        * This is very unlikely since we just created the
+                        * extent, but let's try to handle it correctly
+                        */
+                       xtTruncate(tid, ipimap, ipimap->i_size - PSIZE,
+                                  COMMIT_PWMAP);
+
+                       txAbort(tid, 0);
+                       txEnd(tid);
+
+                       /* release the inode map lock */
+                       IWRITE_UNLOCK(ipimap);
+
                        rc = -EIO;
                        goto out;
                }
@@ -2605,40 +2637,10 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
                        iagp->inosmap[i] = cpu_to_le32(ONES);
 
                /*
-                * Invalidate the page after writing and syncing it.
-                * After it's initialized, we access it in a different
-                * address space
+                * Write and sync the metapage
                 */
-               set_bit(META_discard, &mp->flag);
                flush_metapage(mp);
 
-               /*
-                * start tyransaction of update of the inode map
-                * addressing structure pointing to the new iag page;
-                */
-               tid = txBegin(sb, COMMIT_FORCE);
-               down(&JFS_IP(ipimap)->commit_sem);
-
-               /* update the inode map addressing structure to point to it */
-               if ((rc =
-                    xtInsert(tid, ipimap, 0, blkno, xlen, &xaddr, 0))) {
-                       txEnd(tid);
-                       up(&JFS_IP(ipimap)->commit_sem);
-                       /* Free the blocks allocated for the iag since it was
-                        * not successfully added to the inode map
-                        */
-                       dbFree(ipimap, xaddr, (s64) xlen);
-
-                       /* release the inode map lock */
-                       IWRITE_UNLOCK(ipimap);
-
-                       goto out;
-               }
-
-               /* update the inode map's inode to reflect the extension */
-               ipimap->i_size += PSIZE;
-               inode_add_bytes(ipimap, PSIZE);
-
                /*
                 * txCommit(COMMIT_FORCE) will synchronously write address 
                 * index pages and inode after commit in careful update order 
@@ -2789,6 +2791,7 @@ diUpdatePMap(struct inode *ipimap,
        u32 mask;
        struct jfs_log *log;
        int lsn, difft, diffp;
+       unsigned long flags;
 
        imap = JFS_IP(ipimap)->i_imap;
        /* get the iag number containing the inode */
@@ -2805,6 +2808,7 @@ diUpdatePMap(struct inode *ipimap,
        IREAD_UNLOCK(ipimap);
        if (rc)
                return (rc);
+       metapage_wait_for_io(mp);
        iagp = (struct iag *) mp->data;
        /* get the inode number and extent number of the inode within
         * the iag and the inode number within the extent.
@@ -2868,30 +2872,28 @@ diUpdatePMap(struct inode *ipimap,
                /* inherit older/smaller lsn */
                logdiff(difft, lsn, log);
                logdiff(diffp, mp->lsn, log);
+               LOGSYNC_LOCK(log, flags);
                if (difft < diffp) {
                        mp->lsn = lsn;
                        /* move mp after tblock in logsync list */
-                       LOGSYNC_LOCK(log);
                        list_move(&mp->synclist, &tblk->synclist);
-                       LOGSYNC_UNLOCK(log);
                }
                /* inherit younger/larger clsn */
-               LOGSYNC_LOCK(log);
                assert(mp->clsn);
                logdiff(difft, tblk->clsn, log);
                logdiff(diffp, mp->clsn, log);
                if (difft > diffp)
                        mp->clsn = tblk->clsn;
-               LOGSYNC_UNLOCK(log);
+               LOGSYNC_UNLOCK(log, flags);
        } else {
                mp->log = log;
                mp->lsn = lsn;
                /* insert mp after tblock in logsync list */
-               LOGSYNC_LOCK(log);
+               LOGSYNC_LOCK(log, flags);
                log->count++;
                list_add(&mp->synclist, &tblk->synclist);
                mp->clsn = tblk->clsn;
-               LOGSYNC_UNLOCK(log);
+               LOGSYNC_UNLOCK(log, flags);
        }
        write_metapage(mp);
        return (0);
index ebd77c1bed663d0ed73231f2c70b2c064389d135..c0fd7b3eadc63a4336b4760db6e80f879f6d66b3 100644 (file)
@@ -165,6 +165,7 @@ struct jfs_sb_info {
         /* Formerly in ipbmap */
        struct bmap     *bmap;          /* incore bmap descriptor       */
        struct nls_table *nls_tab;      /* current codepage             */
+       struct inode *direct_inode;     /* metadata inode */
        uint            state;          /* mount/recovery state */
        unsigned long   flag;           /* mount time flags */
        uint            p_state;        /* state prior to going no integrity */
index b6a6869ebb4f5a01992e1a4935e07add784aa832..dfa1200daa61c22f6b96bdff1130d88090a25006 100644 (file)
@@ -234,6 +234,7 @@ int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
        int lsn;
        int diffp, difft;
        struct metapage *mp = NULL;
+       unsigned long flags;
 
        jfs_info("lmLog: log:0x%p tblk:0x%p, lrd:0x%p tlck:0x%p",
                 log, tblk, lrd, tlck);
@@ -254,7 +255,7 @@ int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
         */
        lsn = log->lsn;
 
-       LOGSYNC_LOCK(log);
+       LOGSYNC_LOCK(log, flags);
 
        /*
         * initialize page lsn if first log write of the page
@@ -310,7 +311,7 @@ int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
                }
        }
 
-       LOGSYNC_UNLOCK(log);
+       LOGSYNC_UNLOCK(log, flags);
 
        /*
         *      write the log record
@@ -334,7 +335,6 @@ int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
        return lsn;
 }
 
-
 /*
  * NAME:       lmWriteRecord()
  *
@@ -927,9 +927,8 @@ static void lmPostGC(struct lbuf * bp)
  *     calculate new value of i_nextsync which determines when
  *     this code is called again.
  *
- *     this is called only from lmLog().
- *
- * PARAMETER:  ip      - pointer to logs inode.
+ * PARAMETERS: log     - log structure
+ *             nosyncwait - 1 if called asynchronously
  *
  * RETURN:     0
  *                     
@@ -945,6 +944,15 @@ static int lmLogSync(struct jfs_log * log, int nosyncwait)
        struct lrd lrd;
        int lsn;
        struct logsyncblk *lp;
+       struct jfs_sb_info *sbi;
+       unsigned long flags;
+
+       /* push dirty metapages out to disk */
+       list_for_each_entry(sbi, &log->sb_list, log_list) {
+               filemap_flush(sbi->ipbmap->i_mapping);
+               filemap_flush(sbi->ipimap->i_mapping);
+               filemap_flush(sbi->direct_inode->i_mapping);
+       }
 
        /*
         *      forward syncpt
@@ -954,10 +962,7 @@ static int lmLogSync(struct jfs_log * log, int nosyncwait)
         */
 
        if (log->sync == log->syncpt) {
-               LOGSYNC_LOCK(log);
-               /* ToDo: push dirty metapages out to disk */
-//              bmLogSync(log);
-
+               LOGSYNC_LOCK(log, flags);
                if (list_empty(&log->synclist))
                        log->sync = log->lsn;
                else {
@@ -965,7 +970,7 @@ static int lmLogSync(struct jfs_log * log, int nosyncwait)
                                        struct logsyncblk, synclist);
                        log->sync = lp->lsn;
                }
-               LOGSYNC_UNLOCK(log);
+               LOGSYNC_UNLOCK(log, flags);
 
        }
 
@@ -974,27 +979,6 @@ static int lmLogSync(struct jfs_log * log, int nosyncwait)
         * reset syncpt = sync
         */
        if (log->sync != log->syncpt) {
-               struct jfs_sb_info *sbi;
-
-               /*
-                * We need to make sure all of the "written" metapages
-                * actually make it to disk
-                */
-               list_for_each_entry(sbi, &log->sb_list, log_list) {
-                       if (sbi->flag & JFS_NOINTEGRITY)
-                               continue;
-                       filemap_fdatawrite(sbi->ipbmap->i_mapping);
-                       filemap_fdatawrite(sbi->ipimap->i_mapping);
-                       filemap_fdatawrite(sbi->sb->s_bdev->bd_inode->i_mapping);
-               }
-               list_for_each_entry(sbi, &log->sb_list, log_list) {
-                       if (sbi->flag & JFS_NOINTEGRITY)
-                               continue;
-                       filemap_fdatawait(sbi->ipbmap->i_mapping);
-                       filemap_fdatawait(sbi->ipimap->i_mapping);
-                       filemap_fdatawait(sbi->sb->s_bdev->bd_inode->i_mapping);
-               }
-
                lrd.logtid = 0;
                lrd.backchain = 0;
                lrd.type = cpu_to_le16(LOG_SYNCPT);
@@ -1066,6 +1050,18 @@ static int lmLogSync(struct jfs_log * log, int nosyncwait)
        return lsn;
 }
 
+/*
+ * NAME:       jfs_syncpt
+ *
+ * FUNCTION:   write log SYNCPT record for specified log
+ *
+ * PARAMETERS: log     - log structure
+ */
+void jfs_syncpt(struct jfs_log *log)
+{      LOG_LOCK(log);
+       lmLogSync(log, 1);
+       LOG_UNLOCK(log);
+}
 
 /*
  * NAME:       lmLogOpen()
@@ -1547,6 +1543,7 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
 {
        int i;
        struct tblock *target = NULL;
+       struct jfs_sb_info *sbi;
 
        /* jfs_write_inode may call us during read-only mount */
        if (!log)
@@ -1608,12 +1605,18 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
        if (wait < 2)
                return;
 
+       list_for_each_entry(sbi, &log->sb_list, log_list) {
+               filemap_fdatawrite(sbi->ipbmap->i_mapping);
+               filemap_fdatawrite(sbi->ipimap->i_mapping);
+               filemap_fdatawrite(sbi->direct_inode->i_mapping);
+       }
+
        /*
         * If there was recent activity, we may need to wait
         * for the lazycommit thread to catch up
         */
        if ((!list_empty(&log->cqueue)) || !list_empty(&log->synclist)) {
-               for (i = 0; i < 800; i++) {     /* Too much? */
+               for (i = 0; i < 200; i++) {     /* Too much? */
                        msleep(250);
                        if (list_empty(&log->cqueue) &&
                            list_empty(&log->synclist))
@@ -1621,7 +1624,24 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
                }
        }
        assert(list_empty(&log->cqueue));
-       assert(list_empty(&log->synclist));
+       if (!list_empty(&log->synclist)) {
+               struct logsyncblk *lp;
+
+               list_for_each_entry(lp, &log->synclist, synclist) {
+                       if (lp->xflag & COMMIT_PAGE) {
+                               struct metapage *mp = (struct metapage *)lp;
+                               dump_mem("orphan metapage", lp,
+                                        sizeof(struct metapage));
+                               dump_mem("page", mp->page, sizeof(struct page));
+                       }
+                       else
+                               dump_mem("orphan tblock", lp,
+                                        sizeof(struct tblock));
+               }
+//             current->state = TASK_INTERRUPTIBLE;
+//             schedule();
+       }
+       //assert(list_empty(&log->synclist));
        clear_bit(log_FLUSH, &log->flag);
 }
 
@@ -1669,6 +1689,7 @@ int lmLogShutdown(struct jfs_log * log)
        lp->h.eor = lp->t.eor = cpu_to_le16(bp->l_eor);
        lbmWrite(log, log->bp, lbmWRITE | lbmRELEASE | lbmSYNC, 0);
        lbmIOWait(log->bp, lbmFREE);
+       log->bp = NULL;
 
        /*
         * synchronous update log superblock
@@ -1819,20 +1840,34 @@ static int lbmLogInit(struct jfs_log * log)
 
        log->lbuf_free = NULL;
 
-       for (i = 0; i < LOGPAGES; i++) {
-               lbuf = kmalloc(sizeof(struct lbuf), GFP_KERNEL);
-               if (lbuf == 0)
-                       goto error;
-               lbuf->l_ldata = (char *) get_zeroed_page(GFP_KERNEL);
-               if (lbuf->l_ldata == 0) {
-                       kfree(lbuf);
+       for (i = 0; i < LOGPAGES;) {
+               char *buffer;
+               uint offset;
+               struct page *page;
+
+               buffer = (char *) get_zeroed_page(GFP_KERNEL);
+               if (buffer == NULL)
                        goto error;
+               page = virt_to_page(buffer);
+               for (offset = 0; offset < PAGE_SIZE; offset += LOGPSIZE) {
+                       lbuf = kmalloc(sizeof(struct lbuf), GFP_KERNEL);
+                       if (lbuf == NULL) {
+                               if (offset == 0)
+                                       free_page((unsigned long) buffer);
+                               goto error;
+                       }
+                       if (offset) /* we already have one reference */
+                               get_page(page);
+                       lbuf->l_offset = offset;
+                       lbuf->l_ldata = buffer + offset;
+                       lbuf->l_page = page;
+                       lbuf->l_log = log;
+                       init_waitqueue_head(&lbuf->l_ioevent);
+
+                       lbuf->l_freelist = log->lbuf_free;
+                       log->lbuf_free = lbuf;
+                       i++;
                }
-               lbuf->l_log = log;
-               init_waitqueue_head(&lbuf->l_ioevent);
-
-               lbuf->l_freelist = log->lbuf_free;
-               log->lbuf_free = lbuf;
        }
 
        return (0);
@@ -1857,12 +1892,10 @@ static void lbmLogShutdown(struct jfs_log * log)
        lbuf = log->lbuf_free;
        while (lbuf) {
                struct lbuf *next = lbuf->l_freelist;
-               free_page((unsigned long) lbuf->l_ldata);
+               __free_page(lbuf->l_page);
                kfree(lbuf);
                lbuf = next;
        }
-
-       log->bp = NULL;
 }
 
 
@@ -1974,9 +2007,9 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp)
 
        bio->bi_sector = bp->l_blkno << (log->l2bsize - 9);
        bio->bi_bdev = log->bdev;
-       bio->bi_io_vec[0].bv_page = virt_to_page(bp->l_ldata);
+       bio->bi_io_vec[0].bv_page = bp->l_page;
        bio->bi_io_vec[0].bv_len = LOGPSIZE;
-       bio->bi_io_vec[0].bv_offset = 0;
+       bio->bi_io_vec[0].bv_offset = bp->l_offset;
 
        bio->bi_vcnt = 1;
        bio->bi_idx = 0;
@@ -2115,9 +2148,9 @@ static void lbmStartIO(struct lbuf * bp)
        bio = bio_alloc(GFP_NOFS, 1);
        bio->bi_sector = bp->l_blkno << (log->l2bsize - 9);
        bio->bi_bdev = log->bdev;
-       bio->bi_io_vec[0].bv_page = virt_to_page(bp->l_ldata);
+       bio->bi_io_vec[0].bv_page = bp->l_page;
        bio->bi_io_vec[0].bv_len = LOGPSIZE;
-       bio->bi_io_vec[0].bv_offset = 0;
+       bio->bi_io_vec[0].bv_offset = bp->l_offset;
 
        bio->bi_vcnt = 1;
        bio->bi_idx = 0;
@@ -2127,16 +2160,13 @@ static void lbmStartIO(struct lbuf * bp)
        bio->bi_private = bp;
 
        /* check if journaling to disk has been disabled */
-       if (!log->no_integrity) {
+       if (log->no_integrity) {
+               bio->bi_size = 0;
+               lbmIODone(bio, 0, 0);
+       } else {
                submit_bio(WRITE_SYNC, bio);
                INCREMENT(lmStat.submitted);
        }
-       else {
-               bio->bi_size = 0;
-               lbmIODone(bio, 0, 0); /* 2nd argument appears to not be used => 0
-                                      *  3rd argument appears to not be used => 0
-                                      */
-       }
 }
 
 
index 141ad74010c9df6eeb55c25ed9b271c11cfaa6e3..51291fbc420c6c1b73cecd20edeeb526ea0fd4d1 100644 (file)
@@ -463,9 +463,10 @@ struct lbuf {
 
        s64 l_blkno;            /* 8: log page block number */
        caddr_t l_ldata;        /* 4: data page */
+       struct page *l_page;    /* The page itself */
+       uint l_offset;          /* Offset of l_ldata within the page */ 
 
        wait_queue_head_t l_ioevent;    /* 4: i/o done event */
-       struct page *l_page;    /* The page itself */
 };
 
 /* Reuse l_freelist for redrive list */
@@ -489,8 +490,9 @@ struct logsyncblk {
  */
 
 #define LOGSYNC_LOCK_INIT(log) spin_lock_init(&(log)->synclock)
-#define LOGSYNC_LOCK(log) spin_lock(&(log)->synclock)
-#define LOGSYNC_UNLOCK(log) spin_unlock(&(log)->synclock)
+#define LOGSYNC_LOCK(log, flags) spin_lock_irqsave(&(log)->synclock, flags)
+#define LOGSYNC_UNLOCK(log, flags) \
+       spin_unlock_irqrestore(&(log)->synclock, flags)
 
 /* compute the difference in bytes of lsn from sync point */
 #define logdiff(diff, lsn, log)\
@@ -506,5 +508,6 @@ extern int lmLogShutdown(struct jfs_log * log);
 extern int lmLogInit(struct jfs_log * log);
 extern int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize);
 extern void jfs_flush_journal(struct jfs_log * log, int wait);
+extern void jfs_syncpt(struct jfs_log *log);
 
 #endif                         /* _H_JFS_LOGMGR */
index 4c0a3ac75c0816e6791d58da03d449fc9c7c8a75..41bf078dce05992e40db30af7cd5e86fd249bc5d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *   Copyright (C) International Business Machines Corp., 2000-2003
+ *   Copyright (C) International Business Machines Corp., 2000-2005
  *   Portions Copyright (C) Christoph Hellwig, 2001-2002
  *
  *   This program is free software;  you can redistribute it and/or modify
  */
 
 #include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/bio.h>
 #include <linux/init.h>
 #include <linux/buffer_head.h>
 #include <linux/mempool.h>
-#include <linux/delay.h>
 #include "jfs_incore.h"
 #include "jfs_superblock.h"
 #include "jfs_filsys.h"
@@ -29,8 +30,6 @@
 #include "jfs_txnmgr.h"
 #include "jfs_debug.h"
 
-static DEFINE_SPINLOCK(meta_lock);
-
 #ifdef CONFIG_JFS_STATISTICS
 static struct {
        uint    pagealloc;      /* # of page allocations */
@@ -39,22 +38,8 @@ static struct {
 } mpStat;
 #endif
 
-
-#define HASH_BITS 10           /* This makes hash_table 1 4K page */
-#define HASH_SIZE (1 << HASH_BITS)
-static struct metapage **hash_table = NULL;
-static unsigned long hash_order;
-
-
-static inline int metapage_locked(struct metapage *mp)
-{
-       return test_bit(META_locked, &mp->flag);
-}
-
-static inline int trylock_metapage(struct metapage *mp)
-{
-       return test_and_set_bit(META_locked, &mp->flag);
-}
+#define metapage_locked(mp) test_bit(META_locked, &(mp)->flag)
+#define trylock_metapage(mp) test_and_set_bit(META_locked, &(mp)->flag)
 
 static inline void unlock_metapage(struct metapage *mp)
 {
@@ -62,26 +47,26 @@ static inline void unlock_metapage(struct metapage *mp)
        wake_up(&mp->wait);
 }
 
-static void __lock_metapage(struct metapage *mp)
+static inline void __lock_metapage(struct metapage *mp)
 {
        DECLARE_WAITQUEUE(wait, current);
-
        INCREMENT(mpStat.lockwait);
-
        add_wait_queue_exclusive(&mp->wait, &wait);
        do {
                set_current_state(TASK_UNINTERRUPTIBLE);
                if (metapage_locked(mp)) {
-                       spin_unlock(&meta_lock);
+                       unlock_page(mp->page);
                        schedule();
-                       spin_lock(&meta_lock);
+                       lock_page(mp->page);
                }
        } while (trylock_metapage(mp));
        __set_current_state(TASK_RUNNING);
        remove_wait_queue(&mp->wait, &wait);
 }
 
-/* needs meta_lock */
+/*
+ * Must have mp->page locked
+ */
 static inline void lock_metapage(struct metapage *mp)
 {
        if (trylock_metapage(mp))
@@ -92,6 +77,110 @@ static inline void lock_metapage(struct metapage *mp)
 static kmem_cache_t *metapage_cache;
 static mempool_t *metapage_mempool;
 
+#define MPS_PER_PAGE (PAGE_CACHE_SIZE >> L2PSIZE)
+
+#if MPS_PER_PAGE > 1
+
+struct meta_anchor {
+       int mp_count;
+       atomic_t io_count;
+       struct metapage *mp[MPS_PER_PAGE];
+};
+#define mp_anchor(page) ((struct meta_anchor *)page->private)
+
+static inline struct metapage *page_to_mp(struct page *page, uint offset)
+{
+       if (!PagePrivate(page))
+               return NULL;
+       return mp_anchor(page)->mp[offset >> L2PSIZE];
+}
+
+static inline int insert_metapage(struct page *page, struct metapage *mp)
+{
+       struct meta_anchor *a;
+       int index;
+       int l2mp_blocks;        /* log2 blocks per metapage */
+
+       if (PagePrivate(page))
+               a = mp_anchor(page);
+       else {
+               a = kmalloc(sizeof(struct meta_anchor), GFP_NOFS);
+               if (!a)
+                       return -ENOMEM;
+               memset(a, 0, sizeof(struct meta_anchor));
+               page->private = (unsigned long)a;
+               SetPagePrivate(page);
+               kmap(page);
+       }
+
+       if (mp) {
+               l2mp_blocks = L2PSIZE - page->mapping->host->i_blkbits;
+               index = (mp->index >> l2mp_blocks) & (MPS_PER_PAGE - 1);
+               a->mp_count++;
+               a->mp[index] = mp;
+       }
+
+       return 0;
+}
+
+static inline void remove_metapage(struct page *page, struct metapage *mp)
+{
+       struct meta_anchor *a = mp_anchor(page);
+       int l2mp_blocks = L2PSIZE - page->mapping->host->i_blkbits;
+       int index;
+
+       index = (mp->index >> l2mp_blocks) & (MPS_PER_PAGE - 1);
+
+       BUG_ON(a->mp[index] != mp);
+
+       a->mp[index] = NULL;
+       if (--a->mp_count == 0) {
+               kfree(a);
+               page->private = 0;
+               ClearPagePrivate(page);
+               kunmap(page);
+       }
+}
+
+static inline void inc_io(struct page *page)
+{
+       atomic_inc(&mp_anchor(page)->io_count);
+}
+
+static inline void dec_io(struct page *page, void (*handler) (struct page *))
+{
+       if (atomic_dec_and_test(&mp_anchor(page)->io_count))
+               handler(page);
+}
+
+#else
+static inline struct metapage *page_to_mp(struct page *page, uint offset)
+{
+       return PagePrivate(page) ? (struct metapage *)page->private : NULL;
+}
+
+static inline int insert_metapage(struct page *page, struct metapage *mp)
+{
+       if (mp) {
+               page->private = (unsigned long)mp;
+               SetPagePrivate(page);
+               kmap(page);
+       }
+       return 0;
+}
+
+static inline void remove_metapage(struct page *page, struct metapage *mp)
+{
+       page->private = 0;
+       ClearPagePrivate(page);
+       kunmap(page);
+}
+
+#define inc_io(page) do {} while(0)
+#define dec_io(page, handler) handler(page)
+
+#endif
+
 static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
 {
        struct metapage *mp = (struct metapage *)foo;
@@ -139,16 +228,6 @@ int __init metapage_init(void)
                kmem_cache_destroy(metapage_cache);
                return -ENOMEM;
        }
-       /*
-        * Now the hash list
-        */
-       for (hash_order = 0;
-            ((PAGE_SIZE << hash_order) / sizeof(void *)) < HASH_SIZE;
-            hash_order++);
-       hash_table =
-           (struct metapage **) __get_free_pages(GFP_KERNEL, hash_order);
-       assert(hash_table);
-       memset(hash_table, 0, PAGE_SIZE << hash_order);
 
        return 0;
 }
@@ -159,73 +238,388 @@ void metapage_exit(void)
        kmem_cache_destroy(metapage_cache);
 }
 
+static inline void drop_metapage(struct page *page, struct metapage *mp)
+{
+       if (mp->count || mp->nohomeok || test_bit(META_dirty, &mp->flag) ||
+           test_bit(META_io, &mp->flag))
+               return;
+       remove_metapage(page, mp);
+       INCREMENT(mpStat.pagefree);
+       free_metapage(mp);
+}
+
 /*
- * Basically same hash as in pagemap.h, but using our hash table
+ * Metapage address space operations
  */
-static struct metapage **meta_hash(struct address_space *mapping,
-                                  unsigned long index)
+
+static sector_t metapage_get_blocks(struct inode *inode, sector_t lblock,
+                                   unsigned int *len)
 {
-#define i (((unsigned long)mapping)/ \
-          (sizeof(struct inode) & ~(sizeof(struct inode) -1 )))
-#define s(x) ((x) + ((x) >> HASH_BITS))
-       return hash_table + (s(i + index) & (HASH_SIZE - 1));
-#undef i
-#undef s
+       int rc = 0;
+       int xflag;
+       s64 xaddr;
+       sector_t file_blocks = (inode->i_size + inode->i_blksize - 1) >>
+                              inode->i_blkbits;
+
+       if (lblock >= file_blocks)
+               return 0;
+       if (lblock + *len > file_blocks)
+               *len = file_blocks - lblock;
+
+       if (inode->i_ino) {
+               rc = xtLookup(inode, (s64)lblock, *len, &xflag, &xaddr, len, 0);
+               if ((rc == 0) && *len)
+                       lblock = (sector_t)xaddr;
+               else
+                       lblock = 0;
+       } /* else no mapping */
+
+       return lblock;
 }
 
-static struct metapage *search_hash(struct metapage ** hash_ptr,
-                                   struct address_space *mapping,
-                              unsigned long index)
+static void last_read_complete(struct page *page)
 {
-       struct metapage *ptr;
+       if (!PageError(page))
+               SetPageUptodate(page);
+       unlock_page(page);
+}
+
+static int metapage_read_end_io(struct bio *bio, unsigned int bytes_done,
+                               int err)
+{
+       struct page *page = bio->bi_private;
+
+       if (bio->bi_size)
+               return 1;
 
-       for (ptr = *hash_ptr; ptr; ptr = ptr->hash_next) {
-               if ((ptr->mapping == mapping) && (ptr->index == index))
-                       return ptr;
+       if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) {
+               printk(KERN_ERR "metapage_read_end_io: I/O error\n");
+               SetPageError(page);
        }
 
-       return NULL;
+       dec_io(page, last_read_complete);
+       bio_put(bio);
+
+       return 0;
 }
 
-static void add_to_hash(struct metapage * mp, struct metapage ** hash_ptr)
+static void remove_from_logsync(struct metapage *mp)
 {
-       if (*hash_ptr)
-               (*hash_ptr)->hash_prev = mp;
+       struct jfs_log *log = mp->log;
+       unsigned long flags;
+/*
+ * This can race.  Recheck that log hasn't been set to null, and after
+ * acquiring logsync lock, recheck lsn
+ */
+       if (!log)
+               return;
+
+       LOGSYNC_LOCK(log, flags);
+       if (mp->lsn) {
+               mp->log = NULL;
+               mp->lsn = 0;
+               mp->clsn = 0;
+               log->count--;
+               list_del(&mp->synclist);
+       }
+       LOGSYNC_UNLOCK(log, flags);
+}
 
-       mp->hash_prev = NULL;
-       mp->hash_next = *hash_ptr;
-       *hash_ptr = mp;
+static void last_write_complete(struct page *page)
+{
+       struct metapage *mp;
+       unsigned int offset;
+
+       for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) {
+               mp = page_to_mp(page, offset);
+               if (mp && test_bit(META_io, &mp->flag)) {
+                       if (mp->lsn)
+                               remove_from_logsync(mp);
+                       clear_bit(META_io, &mp->flag);
+               }
+               /*
+                * I'd like to call drop_metapage here, but I don't think it's
+                * safe unless I have the page locked
+                */
+       }
+       end_page_writeback(page);
 }
 
-static void remove_from_hash(struct metapage * mp, struct metapage ** hash_ptr)
+static int metapage_write_end_io(struct bio *bio, unsigned int bytes_done,
+                                int err)
 {
-       if (mp->hash_prev)
-               mp->hash_prev->hash_next = mp->hash_next;
-       else {
-               assert(*hash_ptr == mp);
-               *hash_ptr = mp->hash_next;
+       struct page *page = bio->bi_private;
+
+       BUG_ON(!PagePrivate(page));
+
+       if (bio->bi_size)
+               return 1;
+
+       if (! test_bit(BIO_UPTODATE, &bio->bi_flags)) {
+               printk(KERN_ERR "metapage_write_end_io: I/O error\n");
+               SetPageError(page);
+       }
+       dec_io(page, last_write_complete);
+       bio_put(bio);
+       return 0;
+}
+
+static int metapage_writepage(struct page *page, struct writeback_control *wbc)
+{
+       struct bio *bio = NULL;
+       unsigned int block_offset;      /* block offset of mp within page */
+       struct inode *inode = page->mapping->host;
+       unsigned int blocks_per_mp = JFS_SBI(inode->i_sb)->nbperpage;
+       unsigned int len;
+       unsigned int xlen;
+       struct metapage *mp;
+       int redirty = 0;
+       sector_t lblock;
+       sector_t pblock;
+       sector_t next_block = 0;
+       sector_t page_start;
+       unsigned long bio_bytes = 0;
+       unsigned long bio_offset = 0;
+       unsigned int offset;
+
+       page_start = (sector_t)page->index <<
+                    (PAGE_CACHE_SHIFT - inode->i_blkbits);
+       BUG_ON(!PageLocked(page));
+       BUG_ON(PageWriteback(page));
+
+       for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) {
+               mp = page_to_mp(page, offset);
+
+               if (!mp || !test_bit(META_dirty, &mp->flag))
+                       continue;
+
+               if (mp->nohomeok && !test_bit(META_forcewrite, &mp->flag)) {
+                       redirty = 1;
+                       continue;
+               }
+
+               clear_bit(META_dirty, &mp->flag);
+               block_offset = offset >> inode->i_blkbits;
+               lblock = page_start + block_offset;
+               if (bio) {
+                       if (xlen && lblock == next_block) {
+                               /* Contiguous, in memory & on disk */
+                               len = min(xlen, blocks_per_mp);
+                               xlen -= len;
+                               bio_bytes += len << inode->i_blkbits;
+                               set_bit(META_io, &mp->flag);
+                               continue;
+                       }
+                       /* Not contiguous */
+                       if (bio_add_page(bio, page, bio_bytes, bio_offset) <
+                           bio_bytes)
+                               goto add_failed;
+                       /*
+                        * Increment counter before submitting i/o to keep
+                        * count from hitting zero before we're through
+                        */
+                       inc_io(page);
+                       if (!bio->bi_size)
+                               goto dump_bio;
+                       submit_bio(WRITE, bio);
+                       bio = NULL;
+               } else {
+                       set_page_writeback(page);
+                       inc_io(page);
+               }
+               xlen = (PAGE_CACHE_SIZE - offset) >> inode->i_blkbits;
+               pblock = metapage_get_blocks(inode, lblock, &xlen);
+               if (!pblock) {
+                       /* Need better error handling */
+                       printk(KERN_ERR "JFS: metapage_get_blocks failed\n");
+                       dec_io(page, last_write_complete);
+                       continue;
+               }
+               set_bit(META_io, &mp->flag);
+               len = min(xlen, (uint) JFS_SBI(inode->i_sb)->nbperpage);
+
+               bio = bio_alloc(GFP_NOFS, 1);
+               bio->bi_bdev = inode->i_sb->s_bdev;
+               bio->bi_sector = pblock << (inode->i_blkbits - 9);
+               bio->bi_end_io = metapage_write_end_io;
+               bio->bi_private = page;
+
+               /* Don't call bio_add_page yet, we may add to this vec */
+               bio_offset = offset;
+               bio_bytes = len << inode->i_blkbits;
+
+               xlen -= len;
+               next_block = lblock + len;
+       }
+       if (bio) {
+               if (bio_add_page(bio, page, bio_bytes, bio_offset) < bio_bytes)
+                               goto add_failed;
+               if (!bio->bi_size)
+                       goto dump_bio;
+               
+               submit_bio(WRITE, bio);
+       }
+       if (redirty)
+               redirty_page_for_writepage(wbc, page);
+
+       unlock_page(page);
+
+       return 0;
+add_failed:
+       /* We should never reach here, since we're only adding one vec */
+       printk(KERN_ERR "JFS: bio_add_page failed unexpectedly\n");
+       goto skip;
+dump_bio:
+       dump_mem("bio", bio, sizeof(*bio));
+skip:
+       bio_put(bio);
+       unlock_page(page);
+       dec_io(page, last_write_complete);
+
+       return -EIO;
+}
+
+static int metapage_readpage(struct file *fp, struct page *page)
+{
+       struct inode *inode = page->mapping->host;
+       struct bio *bio = NULL;
+       unsigned int block_offset;
+       unsigned int blocks_per_page = PAGE_CACHE_SIZE >> inode->i_blkbits;
+       sector_t page_start;    /* address of page in fs blocks */
+       sector_t pblock;
+       unsigned int xlen;
+       unsigned int len;
+       unsigned int offset;
+
+       BUG_ON(!PageLocked(page));
+       page_start = (sector_t)page->index <<
+                    (PAGE_CACHE_SHIFT - inode->i_blkbits);
+
+       block_offset = 0;
+       while (block_offset < blocks_per_page) {
+               xlen = blocks_per_page - block_offset;
+               pblock = metapage_get_blocks(inode, page_start + block_offset,
+                                            &xlen);
+               if (pblock) {
+                       if (!PagePrivate(page))
+                               insert_metapage(page, NULL);
+                       inc_io(page);
+                       if (bio)
+                               submit_bio(READ, bio);
+
+                       bio = bio_alloc(GFP_NOFS, 1);
+                       bio->bi_bdev = inode->i_sb->s_bdev;
+                       bio->bi_sector = pblock << (inode->i_blkbits - 9);
+                       bio->bi_end_io = metapage_read_end_io;
+                       bio->bi_private = page;
+                       len = xlen << inode->i_blkbits;
+                       offset = block_offset << inode->i_blkbits;
+                       if (bio_add_page(bio, page, len, offset) < len)
+                               goto add_failed;
+                       block_offset += xlen;
+               } else
+                       block_offset++;
        }
+       if (bio)
+               submit_bio(READ, bio);
+       else
+               unlock_page(page);
+
+       return 0;
 
-       if (mp->hash_next)
-               mp->hash_next->hash_prev = mp->hash_prev;
+add_failed:
+       printk(KERN_ERR "JFS: bio_add_page failed unexpectedly\n");
+       bio_put(bio);
+       dec_io(page, last_read_complete);
+       return -EIO;
 }
 
+static int metapage_releasepage(struct page *page, int gfp_mask)
+{
+       struct metapage *mp;
+       int busy = 0;
+       unsigned int offset;
+
+       for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) {
+               mp = page_to_mp(page, offset);
+
+               if (!mp)
+                       continue;
+
+               jfs_info("metapage_releasepage: mp = 0x%p", mp);
+               if (mp->count || mp->nohomeok) {
+                       jfs_info("count = %ld, nohomeok = %d", mp->count,
+                                mp->nohomeok);
+                       busy = 1;
+                       continue;
+               }
+               wait_on_page_writeback(page);
+               //WARN_ON(test_bit(META_dirty, &mp->flag));
+               if (test_bit(META_dirty, &mp->flag)) {
+                       dump_mem("dirty mp in metapage_releasepage", mp,
+                                sizeof(struct metapage));
+                       dump_mem("page", page, sizeof(struct page));
+                       dump_stack();
+               }
+               WARN_ON(mp->lsn);
+               if (mp->lsn)
+                       remove_from_logsync(mp);
+               remove_metapage(page, mp);
+               INCREMENT(mpStat.pagefree);
+               free_metapage(mp);
+       }
+       if (busy)
+               return -1;
+
+       return 0;
+}
+
+static int metapage_invalidatepage(struct page *page, unsigned long offset)
+{
+       BUG_ON(offset);
+
+       if (PageWriteback(page))
+               return 0;
+
+       return metapage_releasepage(page, 0);
+}
+
+struct address_space_operations jfs_metapage_aops = {
+       .readpage       = metapage_readpage,
+       .writepage      = metapage_writepage,
+       .sync_page      = block_sync_page,
+       .releasepage    = metapage_releasepage,
+       .invalidatepage = metapage_invalidatepage,
+       .set_page_dirty = __set_page_dirty_nobuffers,
+};
+
 struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
                                unsigned int size, int absolute,
                                unsigned long new)
 {
-       struct metapage **hash_ptr;
        int l2BlocksPerPage;
        int l2bsize;
        struct address_space *mapping;
-       struct metapage *mp;
+       struct metapage *mp = NULL;
+       struct page *page;
        unsigned long page_index;
        unsigned long page_offset;
 
-       jfs_info("__get_metapage: inode = 0x%p, lblock = 0x%lx", inode, lblock);
-
+       jfs_info("__get_metapage: ino = %ld, lblock = 0x%lx, abs=%d",
+                inode->i_ino, lblock, absolute);
+
+       l2bsize = inode->i_blkbits;
+       l2BlocksPerPage = PAGE_CACHE_SHIFT - l2bsize;
+       page_index = lblock >> l2BlocksPerPage;
+       page_offset = (lblock - (page_index << l2BlocksPerPage)) << l2bsize;
+       if ((page_offset + size) > PAGE_CACHE_SIZE) {
+               jfs_err("MetaData crosses page boundary!!");
+               jfs_err("lblock = %lx, size  = %d", lblock, size);
+               dump_stack();
+               return NULL;
+       }
        if (absolute)
-               mapping = inode->i_sb->s_bdev->bd_inode->i_mapping;
+               mapping = JFS_SBI(inode->i_sb)->direct_inode->i_mapping;
        else {
                /*
                 * If an nfs client tries to read an inode that is larger
@@ -237,312 +631,212 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
                mapping = inode->i_mapping;
        }
 
-       hash_ptr = meta_hash(mapping, lblock);
-again:
-       spin_lock(&meta_lock);
-       mp = search_hash(hash_ptr, mapping, lblock);
+       if (new && (PSIZE == PAGE_CACHE_SIZE)) {
+               page = grab_cache_page(mapping, page_index);
+               if (!page) {
+                       jfs_err("grab_cache_page failed!");
+                       return NULL;
+               }
+               SetPageUptodate(page);
+       } else {
+               page = read_cache_page(mapping, page_index,
+                           (filler_t *)mapping->a_ops->readpage, NULL);
+               if (IS_ERR(page)) {
+                       jfs_err("read_cache_page failed!");
+                       return NULL;
+               }
+               lock_page(page);
+       }
+
+       mp = page_to_mp(page, page_offset);
        if (mp) {
-             page_found:
-               if (test_bit(META_stale, &mp->flag)) {
-                       spin_unlock(&meta_lock);
-                       msleep(1);
-                       goto again;
+               if (mp->logical_size != size) {
+                       jfs_error(inode->i_sb,
+                                 "__get_metapage: mp->logical_size != size");
+                       jfs_err("logical_size = %d, size = %d",
+                               mp->logical_size, size);
+                       dump_stack();
+                       goto unlock; 
                }
                mp->count++;
                lock_metapage(mp);
-               spin_unlock(&meta_lock);
                if (test_bit(META_discard, &mp->flag)) {
                        if (!new) {
                                jfs_error(inode->i_sb,
                                          "__get_metapage: using a "
                                          "discarded metapage");
-                               release_metapage(mp);
-                               return NULL;
+                               discard_metapage(mp);
+                               goto unlock; 
                        }
                        clear_bit(META_discard, &mp->flag);
                }
-               jfs_info("__get_metapage: found 0x%p, in hash", mp);
-               if (mp->logical_size != size) {
-                       jfs_error(inode->i_sb,
-                                 "__get_metapage: mp->logical_size != size");
-                       release_metapage(mp);
-                       return NULL;
-               }
        } else {
-               l2bsize = inode->i_blkbits;
-               l2BlocksPerPage = PAGE_CACHE_SHIFT - l2bsize;
-               page_index = lblock >> l2BlocksPerPage;
-               page_offset = (lblock - (page_index << l2BlocksPerPage)) <<
-                   l2bsize;
-               if ((page_offset + size) > PAGE_CACHE_SIZE) {
-                       spin_unlock(&meta_lock);
-                       jfs_err("MetaData crosses page boundary!!");
-                       return NULL;
-               }
-               
-               /*
-                * Locks held on aggregate inode pages are usually
-                * not held long, and they are taken in critical code
-                * paths (committing dirty inodes, txCommit thread) 
-                * 
-                * Attempt to get metapage without blocking, tapping into
-                * reserves if necessary.
-                */
-               mp = NULL;
-               if (JFS_IP(inode)->fileset == AGGREGATE_I) {
-                       mp = alloc_metapage(GFP_ATOMIC);
-                       if (!mp) {
-                               /*
-                                * mempool is supposed to protect us from
-                                * failing here.  We will try a blocking
-                                * call, but a deadlock is possible here
-                                */
-                               printk(KERN_WARNING
-                                      "__get_metapage: atomic call to mempool_alloc failed.\n");
-                               printk(KERN_WARNING
-                                      "Will attempt blocking call\n");
-                       }
-               }
-               if (!mp) {
-                       struct metapage *mp2;
-
-                       spin_unlock(&meta_lock);
-                       mp = alloc_metapage(GFP_NOFS);
-                       spin_lock(&meta_lock);
-
-                       /* we dropped the meta_lock, we need to search the
-                        * hash again.
-                        */
-                       mp2 = search_hash(hash_ptr, mapping, lblock);
-                       if (mp2) {
-                               free_metapage(mp);
-                               mp = mp2;
-                               goto page_found;
-                       }
-               }
+               INCREMENT(mpStat.pagealloc);
+               mp = alloc_metapage(GFP_NOFS);
+               mp->page = page;
                mp->flag = 0;
-               lock_metapage(mp);
-               if (absolute)
-                       set_bit(META_absolute, &mp->flag);
                mp->xflag = COMMIT_PAGE;
                mp->count = 1;
-               atomic_set(&mp->nohomeok,0);
-               mp->mapping = mapping;
-               mp->index = lblock;
-               mp->page = NULL;
+               mp->nohomeok = 0;
                mp->logical_size = size;
-               add_to_hash(mp, hash_ptr);
-               spin_unlock(&meta_lock);
-
-               if (new) {
-                       jfs_info("__get_metapage: Calling grab_cache_page");
-                       mp->page = grab_cache_page(mapping, page_index);
-                       if (!mp->page) {
-                               jfs_err("grab_cache_page failed!");
-                               goto freeit;
-                       } else {
-                               INCREMENT(mpStat.pagealloc);
-                               unlock_page(mp->page);
-                       }
-               } else {
-                       jfs_info("__get_metapage: Calling read_cache_page");
-                       mp->page = read_cache_page(mapping, lblock,
-                                   (filler_t *)mapping->a_ops->readpage, NULL);
-                       if (IS_ERR(mp->page)) {
-                               jfs_err("read_cache_page failed!");
-                               goto freeit;
-                       } else
-                               INCREMENT(mpStat.pagealloc);
+               mp->data = page_address(page) + page_offset;
+               mp->index = lblock;
+               if (unlikely(insert_metapage(page, mp))) {
+                       free_metapage(mp);
+                       goto unlock;
                }
-               mp->data = kmap(mp->page) + page_offset;
+               lock_metapage(mp);
        }
 
-       if (new)
+       if (new) {
+               jfs_info("zeroing mp = 0x%p", mp);
                memset(mp->data, 0, PSIZE);
+       }
 
-       jfs_info("__get_metapage: returning = 0x%p", mp);
+       unlock_page(page);
+       jfs_info("__get_metapage: returning = 0x%p data = 0x%p", mp, mp->data);
        return mp;
 
-freeit:
-       spin_lock(&meta_lock);
-       remove_from_hash(mp, hash_ptr);
-       free_metapage(mp);
-       spin_unlock(&meta_lock);
+unlock:
+       unlock_page(page);
        return NULL;
 }
 
-void hold_metapage(struct metapage * mp, int force)
+void grab_metapage(struct metapage * mp)
 {
-       spin_lock(&meta_lock);
-
+       jfs_info("grab_metapage: mp = 0x%p", mp);
+       page_cache_get(mp->page);
+       lock_page(mp->page);
        mp->count++;
-
-       if (force) {
-               ASSERT (!(test_bit(META_forced, &mp->flag)));
-               if (trylock_metapage(mp))
-                       set_bit(META_forced, &mp->flag);
-       } else
-               lock_metapage(mp);
-
-       spin_unlock(&meta_lock);
+       lock_metapage(mp);
+       unlock_page(mp->page);
 }
 
-static void __write_metapage(struct metapage * mp)
+void force_metapage(struct metapage *mp)
 {
-       int l2bsize = mp->mapping->host->i_blkbits;
-       int l2BlocksPerPage = PAGE_CACHE_SHIFT - l2bsize;
-       unsigned long page_index;
-       unsigned long page_offset;
-       int rc;
-
-       jfs_info("__write_metapage: mp = 0x%p", mp);
-
-       page_index = mp->page->index;
-       page_offset =
-           (mp->index - (page_index << l2BlocksPerPage)) << l2bsize;
+       struct page *page = mp->page;
+       jfs_info("force_metapage: mp = 0x%p", mp);
+       set_bit(META_forcewrite, &mp->flag);
+       clear_bit(META_sync, &mp->flag);
+       page_cache_get(page);
+       lock_page(page);
+       set_page_dirty(page);
+       write_one_page(page, 1);
+       clear_bit(META_forcewrite, &mp->flag);
+       page_cache_release(page);
+}
 
+extern void hold_metapage(struct metapage *mp)
+{
        lock_page(mp->page);
-       rc = mp->mapping->a_ops->prepare_write(NULL, mp->page, page_offset,
-                                              page_offset +
-                                              mp->logical_size);
-       if (rc) {
-               jfs_err("prepare_write return %d!", rc);
-               ClearPageUptodate(mp->page);
+}
+
+extern void put_metapage(struct metapage *mp)
+{
+       if (mp->count || mp->nohomeok) {
+               /* Someone else will release this */
                unlock_page(mp->page);
-               clear_bit(META_dirty, &mp->flag);
                return;
        }
-       rc = mp->mapping->a_ops->commit_write(NULL, mp->page, page_offset,
-                                             page_offset +
-                                             mp->logical_size);
-       if (rc) {
-               jfs_err("commit_write returned %d", rc);
-       }
-
+       page_cache_get(mp->page);
+       mp->count++;
+       lock_metapage(mp);
        unlock_page(mp->page);
-       clear_bit(META_dirty, &mp->flag);
-
-       jfs_info("__write_metapage done");
-}
-
-static inline void sync_metapage(struct metapage *mp)
-{
-       struct page *page = mp->page;
-
-       page_cache_get(page);
-       lock_page(page);
-
-       /* we're done with this page - no need to check for errors */
-       if (page_has_buffers(page))
-               write_one_page(page, 1);
-       else
-               unlock_page(page);
-       page_cache_release(page);
+       release_metapage(mp);
 }
 
 void release_metapage(struct metapage * mp)
 {
-       struct jfs_log *log;
-
+       struct page *page = mp->page;
        jfs_info("release_metapage: mp = 0x%p, flag = 0x%lx", mp, mp->flag);
 
-       spin_lock(&meta_lock);
-       if (test_bit(META_forced, &mp->flag)) {
-               clear_bit(META_forced, &mp->flag);
-               mp->count--;
-               spin_unlock(&meta_lock);
-               return;
-       }
+       BUG_ON(!page);
+
+       lock_page(page);
+       unlock_metapage(mp);
 
        assert(mp->count);
-       if (--mp->count || atomic_read(&mp->nohomeok)) {
-               unlock_metapage(mp);
-    &n