]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge master.kernel.org:/home/rmk/linux-2.6-arm
authorLinus Torvalds <torvalds@g5.osdl.org>
Thu, 13 Jul 2006 23:37:29 +0000 (16:37 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 13 Jul 2006 23:37:29 +0000 (16:37 -0700)
* master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] arch/arm/kernel/bios32.c: no need to set isa_bridge
  [ARM] 3729/3: EABI padding rules necessitate the packed attribute of floatx80
  [ARM] 3725/1: sharpsl_pm: warn about wrong temperature
  [ARM] 3723/1: collie charging
  [ARM] 3728/1: Restore missing CPU Hotplug irq helper
  [ARM] 3727/1: fix ucb initialization on collie
  [ARM] Allow Versatile to be built for AB and PB
  [ARM] 3726/1: update {ep93xx,ixp2000,ixp23xx,lpd270,onearm} defconfigs to 2.6.18-rc1
  [ARM] 3721/1: Small cleanup for locomo.c

304 files changed:
Documentation/feature-removal-schedule.txt
Documentation/hwmon/abituguru
Documentation/i2c/busses/i2c-sis96x
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
Documentation/usb/usb-serial.txt
MAINTAINERS
arch/i386/pci/common.c
arch/i386/pci/pci.h
arch/s390/hypfs/hypfs_diag.c
arch/s390/kernel/compat_linux.c
arch/s390/kernel/machine_kexec.c
arch/s390/kernel/module.c
arch/s390/kernel/process.c
arch/s390/kernel/profile.c
arch/s390/kernel/s390_ext.c
arch/s390/kernel/time.c
arch/s390/kernel/traps.c
arch/s390/lib/string.c
arch/s390/mm/cmm.c
arch/s390/mm/fault.c
arch/sparc/kernel/of_device.c
arch/sparc64/defconfig
arch/sparc64/kernel/of_device.c
arch/sparc64/kernel/prom.c
drivers/acpi/osl.c
drivers/base/bus.c
drivers/base/core.c
drivers/bluetooth/hci_ldisc.c
drivers/char/rtc.c
drivers/hwmon/abituguru.c
drivers/i2c/algos/i2c-algo-bit.c
drivers/i2c/algos/i2c-algo-ite.c
drivers/i2c/algos/i2c-algo-pca.c
drivers/i2c/algos/i2c-algo-pcf.c
drivers/i2c/algos/i2c-algo-sibyte.c
drivers/i2c/busses/i2c-iop3xx.c
drivers/i2c/busses/i2c-iop3xx.h
drivers/i2c/busses/i2c-powermac.c
drivers/i2c/busses/scx200_acb.c
drivers/i2c/chips/pca9539.c
drivers/i2c/i2c-core.c
drivers/ide/legacy/ide-cs.c
drivers/ide/pci/generic.c
drivers/net/8139cp.c
drivers/net/e1000/e1000_main.c
drivers/net/forcedeth.c
drivers/net/irda/smsc-ircc2.c
drivers/net/ixgb/ixgb_main.c
drivers/net/myri10ge/myri10ge.c
drivers/net/s2io.c
drivers/net/s2io.h
drivers/net/sk98lin/h/xmac_ii.h
drivers/net/skge.h
drivers/net/sky2.c
drivers/net/sky2.h
drivers/net/smc91x.h
drivers/net/wan/c101.c
drivers/net/wan/hd6457x.c
drivers/net/wan/hdlc_cisco.c
drivers/net/wan/hdlc_fr.c
drivers/net/wan/hdlc_generic.c
drivers/net/wan/wanxl.c
drivers/net/wireless/bcm43xx/bcm43xx_main.c
drivers/net/wireless/zd1211rw/zd_usb.c
drivers/pci/msi.c
drivers/pci/pci.c
drivers/pci/pci.h
drivers/pci/quirks.c
drivers/s390/block/dasd_devmap.c
drivers/s390/block/dasd_eckd.c
drivers/s390/block/dasd_fba.c
drivers/s390/block/dasd_genhd.c
drivers/s390/block/dasd_ioctl.c
drivers/s390/block/xpram.c
drivers/s390/char/con3215.c
drivers/s390/char/ctrlchar.c
drivers/s390/char/defkeymap.c
drivers/s390/char/fs3270.c
drivers/s390/char/keyboard.c
drivers/s390/char/raw3270.c
drivers/s390/char/raw3270.h
drivers/s390/char/tape_34xx.c
drivers/s390/char/tty3270.c
drivers/s390/char/vmlogrdr.c
drivers/s390/char/vmwatchdog.c
drivers/s390/cio/ccwgroup.c
drivers/s390/cio/chsc.c
drivers/s390/cio/cio.c
drivers/s390/cio/cio.h
drivers/s390/cio/cmf.c
drivers/s390/cio/css.c
drivers/s390/cio/css.h
drivers/s390/cio/device.c
drivers/s390/cio/device_fsm.c
drivers/s390/cio/device_pgid.c
drivers/s390/cio/device_status.c
drivers/s390/cio/qdio.c
drivers/s390/net/iucv.c
drivers/s390/net/qeth_main.c
drivers/s390/net/qeth_sys.c
drivers/s390/net/smsgiucv.c
drivers/s390/s390mach.c
drivers/s390/scsi/zfcp_fsf.c
drivers/s390/scsi/zfcp_scsi.c
drivers/serial/sunsu.c
drivers/usb/Kconfig
drivers/usb/Makefile
drivers/usb/class/cdc-acm.c
drivers/usb/core/Kconfig
drivers/usb/core/hub.c
drivers/usb/core/inode.c
drivers/usb/gadget/epautoconf.c
drivers/usb/gadget/ether.c
drivers/usb/gadget/file_storage.c
drivers/usb/gadget/rndis.c
drivers/usb/gadget/rndis.h
drivers/usb/gadget/serial.c
drivers/usb/gadget/zero.c
drivers/usb/host/ehci-au1xxx.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ohci-au1xxx.c
drivers/usb/host/ohci-ep93xx.c [new file with mode: 0644]
drivers/usb/host/ohci-hcd.c
drivers/usb/host/ohci-hub.c
drivers/usb/host/pci-quirks.c
drivers/usb/input/hid-core.c
drivers/usb/misc/Kconfig
drivers/usb/misc/Makefile
drivers/usb/misc/cy7c63.c [deleted file]
drivers/usb/misc/cypress_cy7c63.c [new file with mode: 0644]
drivers/usb/misc/usblcd.c
drivers/usb/mon/mon_text.c
drivers/usb/net/rtl8150.c
drivers/usb/serial/Kconfig
drivers/usb/serial/Makefile
drivers/usb/serial/airprime.c
drivers/usb/serial/anydata.c
drivers/usb/serial/ark3116.c
drivers/usb/serial/belkin_sa.c
drivers/usb/serial/bus.c
drivers/usb/serial/console.c
drivers/usb/serial/cp2101.c
drivers/usb/serial/cyberjack.c
drivers/usb/serial/cypress_m8.c
drivers/usb/serial/digi_acceleport.c
drivers/usb/serial/empeg.c
drivers/usb/serial/ezusb.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio.h
drivers/usb/serial/funsoft.c
drivers/usb/serial/garmin_gps.c
drivers/usb/serial/generic.c
drivers/usb/serial/hp4x.c
drivers/usb/serial/io_edgeport.c
drivers/usb/serial/io_ti.c
drivers/usb/serial/ipaq.c
drivers/usb/serial/ipw.c
drivers/usb/serial/ir-usb.c
drivers/usb/serial/keyspan.c
drivers/usb/serial/keyspan_pda.c
drivers/usb/serial/kl5kusb105.c
drivers/usb/serial/kobil_sct.c
drivers/usb/serial/mct_u232.c
drivers/usb/serial/navman.c
drivers/usb/serial/omninet.c
drivers/usb/serial/option.c
drivers/usb/serial/pl2303.c
drivers/usb/serial/pl2303.h
drivers/usb/serial/safe_serial.c
drivers/usb/serial/sierra.c [new file with mode: 0644]
drivers/usb/serial/ti_usb_3410_5052.c
drivers/usb/serial/usb-serial.c
drivers/usb/serial/visor.c
drivers/usb/serial/whiteheat.c
drivers/usb/storage/scsiglue.c
drivers/usb/storage/unusual_devs.h
drivers/usb/storage/usb.c
drivers/usb/storage/usb.h
drivers/w1/masters/ds2482.c
drivers/w1/w1_io.h [deleted file]
fs/file.c
fs/proc/kcore.c
fs/splice.c
fs/sysfs/inode.c
include/asm-frv/processor.h
include/asm-h8300/processor.h
include/asm-i386/system.h
include/asm-m68knommu/processor.h
include/asm-m68knommu/uaccess.h
include/asm-s390/bug.h
include/asm-s390/ccwdev.h
include/asm-s390/cio.h
include/asm-s390/futex.h
include/asm-s390/irqflags.h
include/asm-s390/pgalloc.h
include/asm-s390/processor.h
include/asm-s390/setup.h
include/asm-sh/processor.h
include/asm-sh64/processor.h
include/asm-sparc64/Kbuild
include/asm-v850/processor.h
include/asm-xtensa/processor.h
include/linux/hdlc.h
include/linux/i2c.h
include/linux/ioport.h
include/linux/pci.h
include/linux/pci_regs.h
include/linux/pm_legacy.h
include/linux/root_dev.h
include/linux/usb.h
include/linux/usb/serial.h [moved from drivers/usb/serial/usb-serial.h with 99% similarity]
include/linux/usb_ch9.h
include/linux/usb_gadget.h
include/linux/usb_usual.h
include/sound/core.h
include/sound/cs46xx.h
kernel/power/pm.c
kernel/resource.c
kernel/sys.c
mm/slab.c
net/ax25/af_ax25.c
net/ax25/ax25_ds_subr.c
net/ax25/ax25_ds_timer.c
net/ax25/ax25_iface.c
net/bluetooth/cmtp/capi.c
net/bluetooth/cmtp/core.c
net/bluetooth/hci_core.c
net/bluetooth/hidp/Kconfig
net/bluetooth/hidp/core.c
net/bluetooth/l2cap.c
net/bluetooth/rfcomm/core.c
net/bluetooth/rfcomm/tty.c
net/bluetooth/sco.c
net/core/stream.c
net/ipv4/fib_trie.c
net/ipv4/ipcomp.c
net/ipv4/tcp_highspeed.c
net/ipv6/addrconf.c
net/ipv6/ipcomp6.c
net/netrom/af_netrom.c
net/netrom/nr_timer.c
net/rose/af_rose.c
net/sched/act_api.c
sound/core/sound.c
sound/core/timer.c
sound/i2c/cs8427.c
sound/isa/cs423x/Makefile
sound/isa/gus/gusextreme.c
sound/isa/wavefront/wavefront_fx.c
sound/isa/wavefront/wavefront_midi.c
sound/isa/wavefront/wavefront_synth.c
sound/pci/Kconfig
sound/pci/ad1889.c
sound/pci/ali5451/ali5451.c
sound/pci/als300.c
sound/pci/als4000.c
sound/pci/atiixp.c
sound/pci/atiixp_modem.c
sound/pci/au88x0/au8810.c
sound/pci/au88x0/au8820.c
sound/pci/au88x0/au8830.c
sound/pci/au88x0/au88x0.h
sound/pci/au88x0/au88x0_a3d.c
sound/pci/au88x0/au88x0_core.c
sound/pci/azt3328.c
sound/pci/bt87x.c
sound/pci/ca0106/ca0106_main.c
sound/pci/cmipci.c
sound/pci/cs4281.c
sound/pci/cs46xx/cs46xx.c
sound/pci/cs46xx/cs46xx_lib.c
sound/pci/cs5535audio/cs5535audio.c
sound/pci/emu10k1/emu10k1.c
sound/pci/emu10k1/emu10k1_main.c
sound/pci/emu10k1/emu10k1x.c
sound/pci/emu10k1/emumpu401.c
sound/pci/ens1370.c
sound/pci/es1938.c
sound/pci/es1968.c
sound/pci/fm801.c
sound/pci/hda/hda_intel.c
sound/pci/hda/patch_analog.c
sound/pci/ice1712/aureon.c
sound/pci/ice1712/ice1712.c
sound/pci/ice1712/ice1724.c
sound/pci/intel8x0.c
sound/pci/intel8x0m.c
sound/pci/korg1212/korg1212.c
sound/pci/maestro3.c
sound/pci/mixart/mixart.c
sound/pci/nm256/nm256.c
sound/pci/pcxhr/pcxhr.c
sound/pci/riptide/riptide.c
sound/pci/rme32.c
sound/pci/rme96.c
sound/pci/rme9652/hdsp.c
sound/pci/rme9652/rme9652.c
sound/pci/sonicvibes.c
sound/pci/trident/trident.c
sound/pci/via82xx.c
sound/pci/via82xx_modem.c
sound/pci/vx222/vx222.c
sound/pci/ymfpci/ymfpci.c
sound/pcmcia/pdaudiocf/pdaudiocf.c

index ee287988934e25f7628496b013465acd22c79209..9d3a0775a11df394f3504dbd13ee60af75db4c3b 100644 (file)
@@ -55,14 +55,6 @@ Who: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
 
 ---------------------------
 
-What:  remove EXPORT_SYMBOL(insert_resource)
-When:  April 2006
-Files: kernel/resource.c
-Why:   No modular usage in the kernel.
-Who:   Adrian Bunk <bunk@stusta.de>
-
----------------------------
-
 What:  PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl])
 When:  November 2005
 Files: drivers/pcmcia/: pcmcia_ioctl.c
@@ -255,3 +247,14 @@ Why:       The interrupt related SA_* flags are replaced by IRQF_* to move them
 Who:   Thomas Gleixner <tglx@linutronix.de>
 
 ---------------------------
+
+What:  i2c-ite and i2c-algo-ite drivers
+When:  September 2006
+Why:   These drivers never compiled since they were added to the kernel
+       tree 5 years ago. This feature removal can be reevaluated if
+       someone shows interest in the drivers, fixes them and takes over
+       maintenance.
+       http://marc.theaimsgroup.com/?l=linux-mips&m=115040510817448
+Who:   Jean Delvare <khali@linux-fr.org>
+
+---------------------------
index 69cdb527d58fbad1d846f549c053e422025f09a1..b2c0d61b39a2efd7efcfe95b3808059e2ad83ebf 100644 (file)
@@ -2,13 +2,36 @@ Kernel driver abituguru
 =======================
 
 Supported chips:
-  * Abit uGuru (Hardware Monitor part only)
+  * Abit uGuru revision 1-3 (Hardware Monitor part only)
     Prefix: 'abituguru'
     Addresses scanned: ISA 0x0E0
     Datasheet: Not available, this driver is based on reverse engineering.
        A "Datasheet" has been written based on the reverse engineering it
        should be available in the same dir as this file under the name
        abituguru-datasheet.
+    Note:
+       The uGuru is a microcontroller with onboard firmware which programs
+       it to behave as a hwmon IC. There are many different revisions of the
+       firmware and thus effectivly many different revisions of the uGuru.
+       Below is an incomplete list with which revisions are used for which
+       Motherboards:
+       uGuru 1.00    ~ 1.24    (AI7, KV8-MAX3, AN7) (1)
+       uGuru 2.0.0.0 ~ 2.0.4.2 (KV8-PRO)
+       uGuru 2.1.0.0 ~ 2.1.2.8 (AS8, AV8, AA8, AG8, AA8XE, AX8)
+       uGuru 2.2.0.0 ~ 2.2.0.6 (AA8 Fatal1ty)
+       uGuru 2.3.0.0 ~ 2.3.0.9 (AN8)
+       uGuru 3.0.0.0 ~ 3.0.1.2 (AW8, AL8, NI8)
+       uGuru 4.xxxxx?          (AT8 32X) (2)
+       1) For revisions 2 and 3 uGuru's the driver can autodetect the
+          sensortype (Volt or Temp) for bank1 sensors, for revision 1 uGuru's
+          this doesnot always work. For these uGuru's the autodection can
+          be overriden with the bank1_types module param. For all 3 known
+          revison 1 motherboards the correct use of this param is:
+          bank1_types=1,1,0,0,0,0,0,2,0,0,0,0,2,0,0,1
+          You may also need to specify the fan_sensors option for these boards
+          fan_sensors=5
+       2) The current version of the abituguru driver is known to NOT work
+          on these Motherboards
 
 Authors:
        Hans de Goede <j.w.r.degoede@hhs.nl>,
@@ -22,6 +45,11 @@ Module Parameters
 * force: bool          Force detection. Note this parameter only causes the
                        detection to be skipped, if the uGuru can't be read
                        the module initialization (insmod) will still fail.
+* bank1_types: int[]   Bank1 sensortype autodetection override:
+                         -1 autodetect (default)
+                          0 volt sensor
+                          1 temp sensor
+                          2 not connected
 * fan_sensors: int     Tell the driver how many fan speed sensors there are
                        on your motherboard. Default: 0 (autodetect).
 * pwms: int            Tell the driver how many fan speed controls (fan
@@ -29,7 +57,7 @@ Module Parameters
 * verbose: int         How verbose should the driver be? (0-3):
                           0 normal output
                           1 + verbose error reporting
-                          2 + sensors type probing info\n"
+                          2 + sensors type probing info (default)
                           3 + retryable error reporting
                        Default: 2 (the driver is still in the testing phase)
 
index 00a009b977e92b1a942d1138afdccf1b725df956..08d7b2dac69af0dd016e5799402c190e626293ae 100644 (file)
@@ -42,8 +42,8 @@ I suspect that this driver could be made to work for the following SiS
 chipsets as well: 635, and 635T. If anyone owns a board with those chips
 AND is willing to risk crashing & burning an otherwise well-behaved kernel
 in the name of progress... please contact me at <mhoffman@lightlink.com> or
-via the project's mailing list: <lm-sensors@lm-sensors.org>.  Please
-send bug reports and/or success stories as well.
+via the project's mailing list: <i2c@lm-sensors.org>.  Please send bug
+reports and/or success stories as well.
 
 
 TO DOs
index 69866d5997a45ab472e1da5a0e15394f0e2e8a6c..b8dc51ca776c84b9e4eae4edf1c8477dc337e19a 100644 (file)
   }        
 
   /* PCI IDs */
-  static struct pci_device_id snd_mychip_ids[] __devinitdata = {
+  static struct pci_device_id snd_mychip_ids[] = {
           { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,
             PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
           ....
         <informalexample>
           <programlisting>
 <![CDATA[
-  static struct pci_device_id snd_mychip_ids[] __devinitdata = {
+  static struct pci_device_id snd_mychip_ids[] = {
           { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,
             PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
           ....
index f001cd93b79b68d62ae1803936c506e2733057a8..02b0f7beb6d1623e542d7610e91971eeca2ce614 100644 (file)
@@ -399,10 +399,10 @@ REINER SCT cyberJack pinpad/e-com USB chipcard reader
 
 Prolific PL2303 Driver
 
-  This driver support any device that has the PL2303 chip from Prolific
+  This driver supports any device that has the PL2303 chip from Prolific
   in it.  This includes a number of single port USB to serial
   converters and USB GPS devices.  Devices from Aten (the UC-232) and
-  IO-Data work with this driver.
+  IO-Data work with this driver, as does the DCU-11 mobile-phone cable.
 
   For any questions or problems with this driver, please contact Greg
   Kroah-Hartman at greg@kroah.com
index 645a9f85f33f73d29f3f081971cc022a0da21e46..a3462c3414cdf07f99bf99135c248723323b42d5 100644 (file)
@@ -274,7 +274,7 @@ S:  Maintained
 ALI1563 I2C DRIVER
 P:     Rudolf Marek
 M:     r.marek@sh.cvut.cz
-L:     lm-sensors@lm-sensors.org
+L:     i2c@lm-sensors.org
 S:     Maintained
 
 ALPHA PORT
@@ -1249,7 +1249,7 @@ S:        Maintained
 I2C SUBSYSTEM
 P:     Jean Delvare
 M:     khali@linux-fr.org
-L:     lm-sensors@lm-sensors.org
+L:     i2c@lm-sensors.org
 W:     http://www.lm-sensors.nu/
 T:     quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
 S:     Maintained
@@ -2093,7 +2093,7 @@ S:      Maintained
 OPENCORES I2C BUS DRIVER
 P:     Peter Korsgaard
 M:     jacmet@sunsite.dk
-L:     lm-sensors@lm-sensors.org
+L:     i2c@lm-sensors.org
 S:     Maintained
 
 ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
@@ -2752,6 +2752,12 @@ P:       Christoph Hellwig
 M:     hch@infradead.org
 S:     Maintained
 
+TC CLASSIFIER
+P:     Jamal Hadi Salim
+M:     hadi@cyberus.ca
+L:     netdev@vger.kernel.org
+S:     Maintained
+
 TI OMAP RANDOM NUMBER GENERATOR SUPPORT
 P:     Deepak Saxena
 M:     dsaxena@plexity.net
@@ -3132,7 +3138,7 @@ S:        Maintained
 VIAPRO SMBUS DRIVER
 P:     Jean Delvare
 M:     khali@linux-fr.org
-L:     lm-sensors@lm-sensors.org
+L:     i2c@lm-sensors.org
 S:     Maintained
 
 UCLINUX (AND M68KNOMMU)
@@ -3180,6 +3186,11 @@ S:       Maintained
 W1 DALLAS'S 1-WIRE BUS
 P:     Evgeniy Polyakov
 M:     johnpol@2ka.mipt.ru
+S:     Maintained
+
+W83791D HARDWARE MONITORING DRIVER
+P:     Charles Spirakis
+M:     bezaur@gmail.com
 L:     lm-sensors@lm-sensors.org
 S:     Maintained
 
index c624b61e110455e746ac021c8f7430d1f58251cc..0a362e3aeac55aba443e5901a71bbe7e465e841a 100644 (file)
 
 #include "pci.h"
 
-#ifdef CONFIG_PCI_BIOS
-extern  void pcibios_sort(void);
-#endif
-
 unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 |
                                PCI_PROBE_MMCONF;
 
index 12bf3d8dda297e3f68f39dc06e996dfafedac58d..bf4e79335388b533b6149dcf403533b6ce687c7e 100644 (file)
@@ -84,4 +84,4 @@ extern int pci_conf1_read(unsigned int seg, unsigned int bus,
 extern void pci_direct_init(void);
 extern void pci_pcbios_init(void);
 extern void pci_mmcfg_init(void);
-
+extern void pcibios_sort(void);
index efa74af7f04ac1470971616e87dd8ad0cc4034be..1785bce2b9196445e89748858fe9570e2786339e 100644 (file)
@@ -403,7 +403,7 @@ static void *diag204_get_buffer(enum diag204_format fmt, int *pages)
                *pages = 1;
                return diag204_alloc_rbuf();
        } else {/* INFO_EXT */
-               *pages = diag204(SUBC_RSI | INFO_EXT, 0, 0);
+               *pages = diag204(SUBC_RSI | INFO_EXT, 0, NULL);
                if (*pages <= 0)
                        return ERR_PTR(-ENOSYS);
                else
index cabb4ff54cd7d85abeba0984167a4514b623bb16..785c9f70ac980b328360560ffa8858191a60c382 100644 (file)
@@ -409,7 +409,7 @@ asmlinkage long sys32_sysinfo(struct sysinfo32 __user *info)
        mm_segment_t old_fs = get_fs ();
        
        set_fs (KERNEL_DS);
-       ret = sys_sysinfo(&s);
+       ret = sys_sysinfo((struct sysinfo __user *) &s);
        set_fs (old_fs);
        err = put_user (s.uptime, &info->uptime);
        err |= __put_user (s.loads[0], &info->loads[0]);
@@ -438,7 +438,7 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid,
        mm_segment_t old_fs = get_fs ();
        
        set_fs (KERNEL_DS);
-       ret = sys_sched_rr_get_interval(pid, &t);
+       ret = sys_sched_rr_get_interval(pid, (struct timespec __user *) &t);
        set_fs (old_fs);
        if (put_compat_timespec(&t, interval))
                return -EFAULT;
@@ -464,7 +464,10 @@ asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
                }
        }
        set_fs (KERNEL_DS);
-       ret = sys_rt_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL, sigsetsize);
+       ret = sys_rt_sigprocmask(how,
+                                set ? (sigset_t __user *) &s : NULL,
+                                oset ? (sigset_t __user *) &s : NULL,
+                                sigsetsize);
        set_fs (old_fs);
        if (ret) return ret;
        if (oset) {
@@ -489,7 +492,7 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set,
        mm_segment_t old_fs = get_fs();
                
        set_fs (KERNEL_DS);
-       ret = sys_rt_sigpending(&s, sigsetsize);
+       ret = sys_rt_sigpending((sigset_t __user *) &s, sigsetsize);
        set_fs (old_fs);
        if (!ret) {
                switch (_NSIG_WORDS) {
@@ -514,7 +517,7 @@ sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo)
        if (copy_siginfo_from_user32(&info, uinfo))
                return -EFAULT;
        set_fs (KERNEL_DS);
-       ret = sys_rt_sigqueueinfo(pid, sig, &info);
+       ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *) &info);
        set_fs (old_fs);
        return ret;
 }
@@ -674,7 +677,8 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offse
                return -EFAULT;
                
        set_fs(KERNEL_DS);
-       ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count);
+       ret = sys_sendfile(out_fd, in_fd,
+                          offset ? (off_t __user *) &of : NULL, count);
        set_fs(old_fs);
        
        if (offset && put_user(of, offset))
@@ -694,7 +698,8 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd,
                return -EFAULT;
                
        set_fs(KERNEL_DS);
-       ret = sys_sendfile64(out_fd, in_fd, offset ? &lof : NULL, count);
+       ret = sys_sendfile64(out_fd, in_fd,
+                            offset ? (loff_t __user *) &lof : NULL, count);
        set_fs(old_fs);
        
        if (offset && put_user(lof, offset))
index fbde6a91526481e96a9acf3b50f3c892d027e54f..60b1ea9f946beb137b33573a76483c189488cb5c 100644 (file)
@@ -63,6 +63,7 @@ NORET_TYPE void
 machine_kexec(struct kimage *image)
 {
        clear_all_subchannels();
+       cio_reset_channel_paths();
 
        /* Disable lowcore protection */
        ctl_clear_bit(0,28);
index c271cdab58e2051728c154882ee94881a3dd53fb..d989ed45a7aafedc9bb2715671d052ebd909a102 100644 (file)
@@ -119,7 +119,7 @@ module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
        int nrela, i, j;
 
        /* Find symbol table and string table. */
-       symtab = 0;
+       symtab = NULL;
        for (i = 0; i < hdr->e_shnum; i++)
                switch (sechdrs[i].sh_type) {
                case SHT_SYMTAB:
index 78c8e5548caf8f4117c99460d3bb8adac27ff91d..d3cbfa3005eca0017fb63ca6ddfe88d979659bcc 100644 (file)
@@ -172,7 +172,7 @@ void show_regs(struct pt_regs *regs)
        show_registers(regs);
        /* Show stack backtrace if pt_regs is from kernel mode */
        if (!(regs->psw.mask & PSW_MASK_PSTATE))
-               show_trace(0,(unsigned long *) regs->gprs[15]);
+               show_trace(NULL, (unsigned long *) regs->gprs[15]);
 }
 
 extern void kernel_thread_starter(void);
index 7ba777eec1a8d404ffd7de2793119c31f752431d..b81aa1f569ca88637635f3e86e1945af67f1350b 100644 (file)
@@ -13,7 +13,7 @@ static struct proc_dir_entry * root_irq_dir;
 void init_irq_proc(void)
 {
        /* create /proc/irq */
-       root_irq_dir = proc_mkdir("irq", 0);
+       root_irq_dir = proc_mkdir("irq", NULL);
 
        /* create /proc/irq/prof_cpu_mask */
        create_prof_cpu_mask(root_irq_dir);
index 207bc511a6e31949e9394e8d7ecf4335d15eb4cb..c1b383537fec2cbb3c0f4431c6a7faa80b83a73f 100644 (file)
@@ -24,7 +24,7 @@
  * (0x1202 external call, 0x1004 cpu timer, 0x2401 hwc console, 0x4000
  * iucv and 0x2603 pfault) this is always the first element. 
  */
-ext_int_info_t *ext_int_hash[256] = { 0, };
+ext_int_info_t *ext_int_hash[256] = { NULL, };
 
 static inline int ext_hash(__u16 code)
 {
index f7fe9bc43397414f58767132a96c261405f92b16..74e6178fbaf25c11ee55e9b320c38a5437cd571a 100644 (file)
@@ -379,7 +379,7 @@ void __init time_init(void)
                                 -xtime.tv_sec, -xtime.tv_nsec);
 
        /* request the clock comparator external interrupt */
-        if (register_early_external_interrupt(0x1004, 0,
+       if (register_early_external_interrupt(0x1004, NULL,
                                              &ext_int_info_cc) != 0)
                 panic("Couldn't request external interrupt 0x1004");
 
index 12240c03a6dd5122583ae1ff8d2acfcb176e15ab..bde1d1d598586cc483bcb84ca0211008d3a70711 100644 (file)
@@ -170,7 +170,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
  */
 void dump_stack(void)
 {
-       show_stack(0, 0);
+       show_stack(NULL, NULL);
 }
 
 EXPORT_SYMBOL(dump_stack);
@@ -331,9 +331,9 @@ static void inline do_trap(long interruption_code, int signr, char *str,
         }
 }
 
-static inline void *get_check_address(struct pt_regs *regs)
+static inline void __user *get_check_address(struct pt_regs *regs)
 {
-       return (void *)((regs->psw.addr-S390_lowcore.pgm_ilc) & PSW_ADDR_INSN);
+       return (void __user *)((regs->psw.addr-S390_lowcore.pgm_ilc) & PSW_ADDR_INSN);
 }
 
 void do_single_step(struct pt_regs *regs)
@@ -360,7 +360,7 @@ asmlinkage void name(struct pt_regs * regs, long interruption_code) \
         info.si_signo = signr; \
         info.si_errno = 0; \
         info.si_code = sicode; \
-        info.si_addr = (void *)siaddr; \
+       info.si_addr = siaddr; \
         do_trap(interruption_code, signr, str, regs, &info); \
 }
 
@@ -392,7 +392,7 @@ DO_ERROR_INFO(SIGILL,  "translation exception", translation_exception,
              ILL_ILLOPN, get_check_address(regs))
 
 static inline void
-do_fp_trap(struct pt_regs *regs, void *location,
+do_fp_trap(struct pt_regs *regs, void __user *location,
            int fpc, long interruption_code)
 {
        siginfo_t si;
@@ -424,10 +424,10 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code)
 {
        siginfo_t info;
         __u8 opcode[6];
-       __u16 *location;
+       __u16 __user *location;
        int signal = 0;
 
-       location = (__u16 *) get_check_address(regs);
+       location = get_check_address(regs);
 
        /*
         * We got all needed information from the lowcore and can
@@ -559,10 +559,10 @@ DO_ERROR_INFO(SIGILL, "specification exception", specification_exception,
 
 asmlinkage void data_exception(struct pt_regs * regs, long interruption_code)
 {
-       __u16 *location;
+       __u16 __user *location;
        int signal = 0;
 
-       location = (__u16 *) get_check_address(regs);
+       location = get_check_address(regs);
 
        /*
         * We got all needed information from the lowcore and can
index 8240cc77e06e2339694bebf40ed598026774fb18..ae5cf5d03d4165b7c98134830a8138b1b1ffe61b 100644 (file)
@@ -233,7 +233,7 @@ char * strrchr(const char * s, int c)
                       if (s[len] == (char) c)
                               return (char *) s + len;
               } while (--len > 0);
-       return 0;
+       return NULL;
 }
 EXPORT_SYMBOL(strrchr);
 
@@ -267,7 +267,7 @@ char * strstr(const char * s1,const char * s2)
                        return (char *) s1;
                s1++;
        }
-       return 0;
+       return NULL;
 }
 EXPORT_SYMBOL(strstr);
 
index 81be2fec7dc565b8f3e87518a73fa3e9eddda807..ceea51cff03befcbe4f0f537de7dee7cf83d9cdf 100644 (file)
@@ -161,7 +161,7 @@ cmm_thread(void *dummy)
 static void
 cmm_start_thread(void)
 {
-       kernel_thread(cmm_thread, 0, 0);
+       kernel_thread(cmm_thread, NULL, 0);
 }
 
 static void
index 833d5941746a12fa78f1a83357b1c21c4ff6f24c..7cd82575813d1c7be34a85b109f75e1ff787b482 100644 (file)
@@ -144,7 +144,7 @@ static void do_sigsegv(struct pt_regs *regs, unsigned long error_code,
 #endif
        si.si_signo = SIGSEGV;
        si.si_code = si_code;
-       si.si_addr = (void *) address;
+       si.si_addr = (void __user *) address;
        force_sig_info(SIGSEGV, &si, current);
 }
 
index bc956c5303764ccc1d4bdd87d271d4044aedff77..5a2faad5d043eb2f4f2fcdb3a8ebf80f484a96fc 100644 (file)
@@ -183,7 +183,7 @@ struct bus_type of_bus_type = {
 };
 EXPORT_SYMBOL(of_bus_type);
 
-static inline u64 of_read_addr(u32 *cell, int size)
+static inline u64 of_read_addr(const u32 *cell, int size)
 {
        u64 r = 0;
        while (size--)
@@ -209,8 +209,8 @@ struct of_bus {
        int             (*match)(struct device_node *parent);
        void            (*count_cells)(struct device_node *child,
                                       int *addrc, int *sizec);
-       u64             (*map)(u32 *addr, u32 *range, int na, int ns, int pna);
-       int             (*translate)(u32 *addr, u64 offset, int na);
+       int             (*map)(u32 *addr, const u32 *range,
+                              int na, int ns, int pna);
        unsigned int    (*get_flags)(u32 *addr);
 };
 
@@ -224,27 +224,49 @@ static void of_bus_default_count_cells(struct device_node *dev,
        get_cells(dev, addrc, sizec);
 }
 
-static u64 of_bus_default_map(u32 *addr, u32 *range, int na, int ns, int pna)
+/* Make sure the least significant 64-bits are in-range.  Even
+ * for 3 or 4 cell values it is a good enough approximation.
+ */
+static int of_out_of_range(const u32 *addr, const u32 *base,
+                          const u32 *size, int na, int ns)
 {
-       u64 cp, s, da;
+       u64 a = of_read_addr(addr, na);
+       u64 b = of_read_addr(base, na);
+
+       if (a < b)
+               return 1;
 
-       cp = of_read_addr(range, na);
-       s  = of_read_addr(range + na + pna, ns);
-       da = of_read_addr(addr, na);
+       b += of_read_addr(size, ns);
+       if (a >= b)
+               return 1;
 
-       if (da < cp || da >= (cp + s))
-               return OF_BAD_ADDR;
-       return da - cp;
+       return 0;
 }
 
-static int of_bus_default_translate(u32 *addr, u64 offset, int na)
+static int of_bus_default_map(u32 *addr, const u32 *range,
+                             int na, int ns, int pna)
 {
-       u64 a = of_read_addr(addr, na);
-       memset(addr, 0, na * 4);
-       a += offset;
-       if (na > 1)
-               addr[na - 2] = a >> 32;
-       addr[na - 1] = a & 0xffffffffu;
+       u32 result[OF_MAX_ADDR_CELLS];
+       int i;
+
+       if (ns > 2) {
+               printk("of_device: Cannot handle size cells (%d) > 2.", ns);
+               return -EINVAL;
+       }
+
+       if (of_out_of_range(addr, range, range + na + pna, na, ns))
+               return -EINVAL;
+
+       /* Start with the parent range base.  */
+       memcpy(result, range + na, pna * 4);
+
+       /* Add in the child address offset.  */
+       for (i = 0; i < na; i++)
+               result[pna - 1 - i] +=
+                       (addr[na - 1 - i] -
+                        range[na - 1 - i]);
+
+       memcpy(addr, result, pna * 4);
 
        return 0;
 }
@@ -254,14 +276,26 @@ static unsigned int of_bus_default_get_flags(u32 *addr)
        return IORESOURCE_MEM;
 }
 
-
 /*
  * PCI bus specific translator
  */
 
 static int of_bus_pci_match(struct device_node *np)
 {
-       return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex");
+       if (!strcmp(np->type, "pci") || !strcmp(np->type, "pciex")) {
+               /* Do not do PCI specific frobbing if the
+                * PCI bridge lacks a ranges property.  We
+                * want to pass it through up to the next
+                * parent as-is, not with the PCI translate
+                * method which chops off the top address cell.
+                */
+               if (!of_find_property(np, "ranges", NULL))
+                       return 0;
+
+               return 1;
+       }
+
+       return 0;
 }
 
 static void of_bus_pci_count_cells(struct device_node *np,
@@ -273,27 +307,32 @@ static void of_bus_pci_count_cells(struct device_node *np,
                *sizec = 2;
 }
 
-static u64 of_bus_pci_map(u32 *addr, u32 *range, int na, int ns, int pna)
+static int of_bus_pci_map(u32 *addr, const u32 *range,
+                         int na, int ns, int pna)
 {
-       u64 cp, s, da;
+       u32 result[OF_MAX_ADDR_CELLS];
+       int i;
 
        /* Check address type match */
        if ((addr[0] ^ range[0]) & 0x03000000)
-               return OF_BAD_ADDR;
+               return -EINVAL;
 
-       /* Read address values, skipping high cell */
-       cp = of_read_addr(range + 1, na - 1);
-       s  = of_read_addr(range + na + pna, ns);
-       da = of_read_addr(addr + 1, na - 1);
+       if (of_out_of_range(addr + 1, range + 1, range + na + pna,
+                           na - 1, ns))
+               return -EINVAL;
 
-       if (da < cp || da >= (cp + s))
-               return OF_BAD_ADDR;
-       return da - cp;
-}
+       /* Start with the parent range base.  */
+       memcpy(result, range + na, pna * 4);
 
-static int of_bus_pci_translate(u32 *addr, u64 offset, int na)
-{
-       return of_bus_default_translate(addr + 1, offset, na - 1);
+       /* Add in the child address offset, skipping high cell.  */
+       for (i = 0; i < na - 1; i++)
+               result[pna - 1 - i] +=
+                       (addr[na - 1 - i] -
+                        range[na - 1 - i]);
+
+       memcpy(addr, result, pna * 4);
+
+       return 0;
 }
 
 static unsigned int of_bus_pci_get_flags(u32 *addr)
@@ -332,16 +371,11 @@ static void of_bus_sbus_count_cells(struct device_node *child,
                *sizec = 1;
 }
 
-static u64 of_bus_sbus_map(u32 *addr, u32 *range, int na, int ns, int pna)
+static int of_bus_sbus_map(u32 *addr, const u32 *range, int na, int ns, int pna)
 {
        return of_bus_default_map(addr, range, na, ns, pna);
 }
 
-static int of_bus_sbus_translate(u32 *addr, u64 offset, int na)
-{
-       return of_bus_default_translate(addr, offset, na);
-}
-
 static unsigned int of_bus_sbus_get_flags(u32 *addr)
 {
        return IORESOURCE_MEM;
@@ -360,7 +394,6 @@ static struct of_bus of_busses[] = {
                .match = of_bus_pci_match,
                .count_cells = of_bus_pci_count_cells,
                .map = of_bus_pci_map,
-               .translate = of_bus_pci_translate,
                .get_flags = of_bus_pci_get_flags,
        },
        /* SBUS */
@@ -370,7 +403,6 @@ static struct of_bus of_busses[] = {
                .match = of_bus_sbus_match,
                .count_cells = of_bus_sbus_count_cells,
                .map = of_bus_sbus_map,
-               .translate = of_bus_sbus_translate,
                .get_flags = of_bus_sbus_get_flags,
        },
        /* Default */
@@ -380,7 +412,6 @@ static struct of_bus of_busses[] = {
                .match = NULL,
                .count_cells = of_bus_default_count_cells,
                .map = of_bus_default_map,
-               .translate = of_bus_default_translate,
                .get_flags = of_bus_default_get_flags,
        },
 };
@@ -405,33 +436,34 @@ static int __init build_one_resource(struct device_node *parent,
        u32 *ranges;
        unsigned int rlen;
        int rone;
-       u64 offset = OF_BAD_ADDR;
 
        ranges = of_get_property(parent, "ranges", &rlen);
        if (ranges == NULL || rlen == 0) {
-               offset = of_read_addr(addr, na);
-               memset(addr, 0, pna * 4);
-               goto finish;
+               u32 result[OF_MAX_ADDR_CELLS];
+               int i;
+
+               memset(result, 0, pna * 4);
+               for (i = 0; i < na; i++)
+                       result[pna - 1 - i] =
+                               addr[na - 1 - i];
+
+               memcpy(addr, result, pna * 4);
+               return 0;
        }
 
        /* Now walk through the ranges */
        rlen /= 4;
        rone = na + pna + ns;
        for (; rlen >= rone; rlen -= rone, ranges += rone) {
-               offset = bus->map(addr, ranges, na, ns, pna);
-               if (offset != OF_BAD_ADDR)
-                       break;
+               if (!bus->map(addr, ranges, na, ns, pna))
+                       return 0;
        }
-       if (offset == OF_BAD_ADDR)
-               return 1;
 
-       memcpy(addr, ranges + na, 4 * pna);
-
-finish:
-       /* Translate it into parent bus space */
-       return pbus->translate(addr, offset, pna);
+       return 1;
 }
 
+static int of_resource_verbose;
+
 static void __init build_device_resources(struct of_device *op,
                                          struct device *parent)
 {
@@ -497,7 +529,8 @@ static void __init build_device_resources(struct of_device *op,
                        pbus = of_match_bus(pp);
                        pbus->count_cells(dp, &pna, &pns);
 
-                       if (build_one_resource(dp, bus, pbus, addr, dna, dns, pna))
+                       if (build_one_resource(dp, bus, pbus, addr,
+                                              dna, dns, pna))
                                break;
 
                        dna = pna;
@@ -507,6 +540,12 @@ static void __init build_device_resources(struct of_device *op,
 
        build_res:
                memset(r, 0, sizeof(*r));
+
+               if (of_resource_verbose)
+                       printk("%s reg[%d] -> %llx\n",
+                              op->node->full_name, index,
+                              result);
+
                if (result != OF_BAD_ADDR) {
                        r->start = result & 0xffffffff;
                        r->end = result + size - 1;
@@ -643,6 +682,18 @@ static int __init of_bus_driver_init(void)
 
 postcore_initcall(of_bus_driver_init);
 
+static int __init of_debug(char *str)
+{
+       int val = 0;
+
+       get_option(&str, &val);
+       if (val & 1)
+               of_resource_verbose = 1;
+       return 1;
+}
+
+__setup("of_debug=", of_debug);
+
 int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
 {
        /* initialize common driver fields */
@@ -695,9 +746,11 @@ int of_device_register(struct of_device *ofdev)
        if (rc)
                return rc;
 
-       device_create_file(&ofdev->dev, &dev_attr_devspec);
+       rc = device_create_file(&ofdev->dev, &dev_attr_devspec);
+       if (rc)
+               device_unregister(&ofdev->dev);
 
-       return 0;
+       return rc;
 }
 
 void of_device_unregister(struct of_device *ofdev)
index b2f41147d0e49c3a361e4ec833898031274cdf73..38353621069e03ee9f3dfe02ad7ee8a675d637dd 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.17
-# Fri Jun 23 23:17:09 2006
+# Linux kernel version: 2.6.18-rc1
+# Wed Jul 12 14:00:58 2006
 #
 CONFIG_SPARC=y
 CONFIG_SPARC64=y
@@ -18,6 +18,7 @@ CONFIG_SECCOMP=y
 CONFIG_HZ_250=y
 # CONFIG_HZ_1000 is not set
 CONFIG_HZ=250
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
 # Code maturity level options
@@ -51,10 +52,12 @@ CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
+CONFIG_RT_MUTEXES=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
 CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 # CONFIG_SLOB is not set
@@ -127,8 +130,8 @@ CONFIG_SPARSEMEM=y
 CONFIG_HAVE_MEMORY_PRESENT=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPARSEMEM_EXTREME=y
-CONFIG_MEMORY_HOTPLUG=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
 CONFIG_GENERIC_ISA_DMA=y
 CONFIG_SBUS=y
 CONFIG_SBUSCHAR=y
@@ -203,7 +206,6 @@ CONFIG_TCP_CONG_VEGAS=m
 CONFIG_TCP_CONG_SCALABLE=m
 CONFIG_TCP_CONG_LP=m
 CONFIG_TCP_CONG_VENO=m
-CONFIG_TCP_CONG_COMPOUND=m
 CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
@@ -461,9 +463,8 @@ CONFIG_MD_LINEAR=m
 CONFIG_MD_RAID0=m
 CONFIG_MD_RAID1=m
 CONFIG_MD_RAID10=m
-CONFIG_MD_RAID5=m
+CONFIG_MD_RAID456=m
 # CONFIG_MD_RAID5_RESHAPE is not set
-CONFIG_MD_RAID6=m
 CONFIG_MD_MULTIPATH=m
 # CONFIG_MD_FAULTY is not set
 CONFIG_BLK_DEV_DM=m
@@ -663,6 +664,7 @@ CONFIG_SERIO_RAW=m
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -693,6 +695,7 @@ CONFIG_UNIX98_PTYS=y
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
 CONFIG_RTC=y
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
@@ -839,12 +842,13 @@ CONFIG_VIDEO_V4L2=y
 #
 # Graphics support
 #
+# CONFIG_FIRMWARE_EDID is not set
 CONFIG_FB=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
 # CONFIG_FB_MACMODES is not set
-# CONFIG_FB_FIRMWARE_EDID is not set
+# CONFIG_FB_BACKLIGHT is not set
 CONFIG_FB_MODE_HELPERS=y
 CONFIG_FB_TILEBLITTING=y
 # CONFIG_FB_CIRRUS is not set
@@ -954,6 +958,18 @@ CONFIG_SND_ALI5451=m
 # CONFIG_SND_CMIPCI is not set
 # CONFIG_SND_CS4281 is not set
 # CONFIG_SND_CS46XX is not set
+# CONFIG_SND_DARLA20 is not set
+# CONFIG_SND_GINA20 is not set
+# CONFIG_SND_LAYLA20 is not set
+# CONFIG_SND_DARLA24 is not set
+# CONFIG_SND_GINA24 is not set
+# CONFIG_SND_LAYLA24 is not set
+# CONFIG_SND_MONA is not set
+# CONFIG_SND_MIA is not set
+# CONFIG_SND_ECHO3G is not set
+# CONFIG_SND_INDIGO is not set
+# CONFIG_SND_INDIGOIO is not set
+# CONFIG_SND_INDIGODJ is not set
 # CONFIG_SND_EMU10K1 is not set
 # CONFIG_SND_EMU10K1X is not set
 # CONFIG_SND_ENS1370 is not set
@@ -1263,6 +1279,7 @@ CONFIG_RAMFS=y
 # CONFIG_NFSD is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
+# CONFIG_CIFS_DEBUG2 is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
@@ -1331,14 +1348,19 @@ CONFIG_KPROBES=y
 #
 CONFIG_PRINTK_TIME=y
 CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=18
 CONFIG_DETECT_SOFTLOCKUP=y
 CONFIG_SCHEDSTATS=y
 # CONFIG_DEBUG_SLAB is not set
-# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_RWSEMS is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
@@ -1402,3 +1424,4 @@ CONFIG_CRC32=y
 CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
+CONFIG_PLIST=y
index 169b017eec0b6c393f17096206db914dbff21ac2..7064cee290ae15d78b8888429660fc9caba9d399 100644 (file)
@@ -210,7 +210,7 @@ struct bus_type of_bus_type = {
 };
 EXPORT_SYMBOL(of_bus_type);
 
-static inline u64 of_read_addr(u32 *cell, int size)
+static inline u64 of_read_addr(const u32 *cell, int size)
 {
        u64 r = 0;
        while (size--)
@@ -236,8 +236,8 @@ struct of_bus {
        int             (*match)(struct device_node *parent);
        void            (*count_cells)(struct device_node *child,
                                       int *addrc, int *sizec);
-       u64             (*map)(u32 *addr, u32 *range, int na, int ns, int pna);
-       int             (*translate)(u32 *addr, u64 offset, int na);
+       int             (*map)(u32 *addr, const u32 *range,
+                              int na, int ns, int pna);
        unsigned int    (*get_flags)(u32 *addr);
 };
 
@@ -251,27 +251,49 @@ static void of_bus_default_count_cells(struct device_node *dev,
        get_cells(dev, addrc, sizec);
 }
 
-static u64 of_bus_default_map(u32 *addr, u32 *range, int na, int ns, int pna)
+/* Make sure the least significant 64-bits are in-range.  Even
+ * for 3 or 4 cell values it is a good enough approximation.
+ */
+static int of_out_of_range(const u32 *addr, const u32 *base,
+                          const u32 *size, int na, int ns)
 {
-       u64 cp, s, da;
+       u64 a = of_read_addr(addr, na);
+       u64 b = of_read_addr(base, na);
 
-       cp = of_read_addr(range, na);
-       s  = of_read_addr(range + na + pna, ns);
-       da = of_read_addr(addr, na);
+       if (a < b)
+               return 1;
 
-       if (da < cp || da >= (cp + s))
-               return OF_BAD_ADDR;
-       return da - cp;
+       b += of_read_addr(size, ns);
+       if (a >= b)
+               return 1;
+
+       return 0;
 }
 
-static int of_bus_default_translate(u32 *addr, u64 offset, int na)
+static int of_bus_default_map(u32 *addr, const u32 *range,
+                             int na, int ns, int pna)
 {
-       u64 a = of_read_addr(addr, na);
-       memset(addr, 0, na * 4);
-       a += offset;
-       if (na > 1)
-               addr[na - 2] = a >> 32;
-       addr[na - 1] = a & 0xffffffffu;
+       u32 result[OF_MAX_ADDR_CELLS];
+       int i;
+
+       if (ns > 2) {
+               printk("of_device: Cannot handle size cells (%d) > 2.", ns);
+               return -EINVAL;
+       }
+
+       if (of_out_of_range(addr, range, range + na + pna, na, ns))
+               return -EINVAL;
+
+       /* Start with the parent range base.  */
+       memcpy(result, range + na, pna * 4);
+
+       /* Add in the child address offset.  */
+       for (i = 0; i < na; i++)
+               result[pna - 1 - i] +=
+                       (addr[na - 1 - i] -
+                        range[na - 1 - i]);
+
+       memcpy(addr, result, pna * 4);
 
        return 0;
 }
@@ -287,7 +309,20 @@ static unsigned int of_bus_default_get_flags(u32 *addr)
 
 static int of_bus_pci_match(struct device_node *np)
 {
-       return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex");
+       if (!strcmp(np->type, "pci") || !strcmp(np->type, "pciex")) {
+               /* Do not do PCI specific frobbing if the
+                * PCI bridge lacks a ranges property.  We
+                * want to pass it through up to the next
+                * parent as-is, not with the PCI translate
+                * method which chops off the top address cell.
+                */
+               if (!of_find_property(np, "ranges", NULL))
+                       return 0;
+
+               return 1;
+       }
+
+       return 0;
 }
 
 static void of_bus_pci_count_cells(struct device_node *np,
@@ -299,27 +334,32 @@ static void of_bus_pci_count_cells(struct device_node *np,
                *sizec = 2;
 }
 
-static u64 of_bus_pci_map(u32 *addr, u32 *range, int na, int ns, int pna)
+static int of_bus_pci_map(u32 *addr, const u32 *range,
+                         int na, int ns, int pna)
 {
-       u64 cp, s, da;
+       u32 result[OF_MAX_ADDR_CELLS];
+       int i;
 
        /* Check address type match */
        if ((addr[0] ^ range[0]) & 0x03000000)
-               return OF_BAD_ADDR;
+               return -EINVAL;
 
-       /* Read address values, skipping high cell */
-       cp = of_read_addr(range + 1, na - 1);
-       s  = of_read_addr(range + na + pna, ns);
-       da = of_read_addr(addr + 1, na - 1);
+       if (of_out_of_range(addr + 1, range + 1, range + na + pna,
+                           na - 1, ns))
+               return -EINVAL;
 
-       if (da < cp || da >= (cp + s))
-               return OF_BAD_ADDR;
-       return da - cp;
-}
+       /* Start with the parent range base.  */
+       memcpy(result, range + na, pna * 4);
 
-static int of_bus_pci_translate(u32 *addr, u64 offset, int na)
-{
-       return of_bus_default_translate(addr + 1, offset, na - 1);
+       /* Add in the child address offset, skipping high cell.  */
+       for (i = 0; i < na - 1; i++)
+               result[pna - 1 - i] +=
+                       (addr[na - 1 - i] -
+                        range[na - 1 - i]);
+
+       memcpy(addr, result, pna * 4);
+
+       return 0;
 }
 
 static unsigned int of_bus_pci_get_flags(u32 *addr)
@@ -339,59 +379,6 @@ static unsigned int of_bus_pci_get_flags(u32 *addr)
        return flags;
 }
 
-/*
- * ISA bus specific translator
- */
-
-static int of_bus_isa_match(struct device_node *np)
-{
-       return !strcmp(np->name, "isa");
-}
-
-static void of_bus_isa_count_cells(struct device_node *child,
-                                  int *addrc, int *sizec)
-{
-       if (addrc)
-               *addrc = 2;
-       if (sizec)
-               *sizec = 1;
-}
-
-static u64 of_bus_isa_map(u32 *addr, u32 *range, int na, int ns, int pna)
-{
-       u64 cp, s, da;
-
-       /* Check address type match */
-       if ((addr[0] ^ range[0]) & 0x00000001)
-               return OF_BAD_ADDR;
-
-       /* Read address values, skipping high cell */
-       cp = of_read_addr(range + 1, na - 1);
-       s  = of_read_addr(range + na + pna, ns);
-       da = of_read_addr(addr + 1, na - 1);
-
-       if (da < cp || da >= (cp + s))
-               return OF_BAD_ADDR;
-       return da - cp;
-}
-
-static int of_bus_isa_translate(u32 *addr, u64 offset, int na)
-{
-       return of_bus_default_translate(addr + 1, offset, na - 1);
-}
-
-static unsigned int of_bus_isa_get_flags(u32 *addr)
-{
-       unsigned int flags = 0;
-       u32 w = addr[0];
-
-       if (w & 1)
-               flags |= IORESOURCE_IO;
-       else
-               flags |= IORESOURCE_MEM;
-       return flags;
-}
-
 /*
  * SBUS bus specific translator
  */
@@ -411,16 +398,11 @@ static void of_bus_sbus_count_cells(struct device_node *child,
                *sizec = 1;
 }
 
-static u64 of_bus_sbus_map(u32 *addr, u32 *range, int na, int ns, int pna)
+static int of_bus_sbus_map(u32 *addr, const u32 *range, int na, int ns, int pna)
 {
        return of_bus_default_map(addr, range, na, ns, pna);
 }
 
-static int of_bus_sbus_translate(u32 *addr, u64 offset, int na)
-{
-       return of_bus_default_translate(addr, offset, na);
-}
-
 static unsigned int of_bus_sbus_get_flags(u32 *addr)
 {
        return IORESOURCE_MEM;
@@ -439,19 +421,8 @@ static struct of_bus of_busses[] = {
                .match = of_bus_pci_match,
                .count_cells = of_bus_pci_count_cells,
                .map = of_bus_pci_map,
-               .translate = of_bus_pci_translate,
                .get_flags = of_bus_pci_get_flags,
        },
-       /* ISA */
-       {
-               .name = "isa",
-               .addr_prop_name = "reg",
-               .match = of_bus_isa_match,
-               .count_cells = of_bus_isa_count_cells,
-               .map = of_bus_isa_map,
-               .translate = of_bus_isa_translate,
-               .get_flags = of_bus_isa_get_flags,
-       },
        /* SBUS */
        {
                .name = "sbus",
@@ -459,7 +430,6 @@ static struct of_bus of_busses[] = {
                .match = of_bus_sbus_match,
                .count_cells = of_bus_sbus_count_cells,
                .map = of_bus_sbus_map,
-               .translate = of_bus_sbus_translate,
                .get_flags = of_bus_sbus_get_flags,
        },
        /* Default */
@@ -469,7 +439,6 @@ static struct of_bus of_busses[] = {
                .match = NULL,
                .count_cells = of_bus_default_count_cells,
                .map = of_bus_default_map,
-               .translate = of_bus_default_translate,
                .get_flags = of_bus_default_get_flags,
        },
 };
@@ -494,33 +463,62 @@ static int __init build_one_resource(struct device_node *parent,
        u32 *ranges;
        unsigned int rlen;
        int rone;
-       u64 offset = OF_BAD_ADDR;
 
        ranges = of_get_property(parent, "ranges", &rlen);
        if (ranges == NULL || rlen == 0) {
-               offset = of_read_addr(addr, na);
-               memset(addr, 0, pna * 4);
-               goto finish;
+               u32 result[OF_MAX_ADDR_CELLS];
+               int i;
+
+               memset(result, 0, pna * 4);
+               for (i = 0; i < na; i++)
+                       result[pna - 1 - i] =
+                               addr[na - 1 - i];
+
+               memcpy(addr, result, pna * 4);
+               return 0;
        }
 
        /* Now walk through the ranges */
        rlen /= 4;
        rone = na + pna + ns;
        for (; rlen >= rone; rlen -= rone, ranges += rone) {
-               offset = bus->map(addr, ranges, na, ns, pna);
-               if (offset != OF_BAD_ADDR)
-                       break;
+               if (!bus->map(addr, ranges, na, ns, pna))
+                       return 0;
        }
-       if (offset == OF_BAD_ADDR)
+
+       return 1;
+}
+
+static int __init use_1to1_mapping(struct device_node *pp)
+{
+       char *model;
+
+       /* If this is on the PMU bus, don't try to translate it even
+        * if a ranges property exists.
+        */
+       if (!strcmp(pp->name, "pmu"))
                return 1;
 
-       memcpy(addr, ranges + na, 4 * pna);
+       /* If we have a ranges property in the parent, use it.  */
+       if (of_find_property(pp, "ranges", NULL) != NULL)
+               return 0;
+
+       /* If the parent is the dma node of an ISA bus, pass
+        * the translation up to the root.
+        */
+       if (!strcmp(pp->name, "dma"))
+               return 0;
+
+       /* Similarly for Simba PCI bridges.  */
+       model = of_get_property(pp, "model", NULL);
+       if (model && !strcmp(model, "SUNW,simba"))
+               return 0;
 
-finish:
-       /* Translate it into parent bus space */
-       return pbus->translate(addr, offset, pna);
+       return 1;
 }
 
+static int of_resource_verbose;
+
 static void __init build_device_resources(struct of_device *op,
                                          struct device *parent)
 {
@@ -564,15 +562,7 @@ static void __init build_device_resources(struct of_device *op,
 
                memcpy(addr, reg, na * 4);
 
-               /* If the immediate parent has no ranges property to apply,
-                * just use a 1<->1 mapping.  Unless it is the 'dma' child
-                * of an isa bus, which must be passed up towards the root.
-                *
-                * Also, don't try to translate PMU bus device registers.
-                */
-               if ((of_find_property(pp, "ranges", NULL) == NULL &&
-                    strcmp(pp->name, "dma") != 0) ||
-                   !strcmp(pp->name, "pmu")) {
+               if (use_1to1_mapping(pp)) {
                        result = of_read_addr(addr, na);
                        goto build_res;
                }
@@ -591,7 +581,8 @@ static void __init build_device_resources(struct of_device *op,
                        pbus = of_match_bus(pp);
                        pbus->count_cells(dp, &pna, &pns);
 
-                       if (build_one_resource(dp, bus, pbus, addr, dna, dns, pna))
+                       if (build_one_resource(dp, bus, pbus, addr,
+                                              dna, dns, pna))
                                break;
 
                        dna = pna;
@@ -601,6 +592,12 @@ static void __init build_device_resources(struct of_device *op,
 
        build_res:
                memset(r, 0, sizeof(*r));
+
+               if (of_resource_verbose)
+                       printk("%s reg[%d] -> %lx\n",
+                              op->node->full_name, index,
+                              result);
+
                if (result != OF_BAD_ADDR) {
                        if (tlb_type == hypervisor)
                                result &= 0x0fffffffffffffffUL;
@@ -684,6 +681,8 @@ static unsigned int __init pci_irq_swizzle(struct device_node *dp,
        return ret;
 }
 
+static int of_irq_verbose;
+
 static unsigned int __init build_one_device_irq(struct of_device *op,
                                                struct device *parent,
                                                unsigned int irq)
@@ -698,10 +697,11 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
        if (dp->irq_trans) {
                irq = dp->irq_trans->irq_build(dp, irq,
                                               dp->irq_trans->data);
-#if 1
-               printk("%s: direct translate %x --> %x\n",
-                      dp->full_name, orig_irq, irq);
-#endif
+
+               if (of_irq_verbose)
+                       printk("%s: direct translate %x --> %x\n",
+                              dp->full_name, orig_irq, irq);
+
                return irq;
        }
 
@@ -728,12 +728,13 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
                        iret = apply_interrupt_map(dp, pp,
                                                   imap, imlen, imsk,
                                                   &irq);
-#if 1
-                       printk("%s: Apply [%s:%x] imap --> [%s:%x]\n",
-                              op->node->full_name,
-                              pp->full_name, this_orig_irq,
-                              (iret ? iret->full_name : "NULL"), irq);
-#endif
+
+                       if (of_irq_verbose)
+                               printk("%s: Apply [%s:%x] imap --> [%s:%x]\n",
+                                      op->node->full_name,
+                                      pp->full_name, this_orig_irq,
+                                      (iret ? iret->full_name : "NULL"), irq);
+
                        if (!iret)
                                break;
 
@@ -747,11 +748,13 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
                                unsigned int this_orig_irq = irq;
 
                                irq = pci_irq_swizzle(dp, pp, irq);
-#if 1
-                               printk("%s: PCI swizzle [%s] %x --> %x\n",
-                                      op->node->full_name,
-                                      pp->full_name, this_orig_irq, irq);
-#endif
+                               if (of_irq_verbose)
+                                       printk("%s: PCI swizzle [%s] "
+                                              "%x --> %x\n",
+                                              op->node->full_name,
+                                              pp->full_name, this_orig_irq,
+                                              irq);
+
                        }
 
                        if (pp->irq_trans) {
@@ -767,10 +770,9 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
 
        irq = ip->irq_trans->irq_build(op->node, irq,
                                       ip->irq_trans->data);
-#if 1
-       printk("%s: Apply IRQ trans [%s] %x --> %x\n",
-              op->node->full_name, ip->full_name, orig_irq, irq);
-#endif
+       if (of_irq_verbose)
+               printk("%s: Apply IRQ trans [%s] %x --> %x\n",
+                      op->node->full_name, ip->full_name, orig_irq, irq);
 
        return irq;
 }
@@ -870,6 +872,20 @@ static int __init of_bus_driver_init(void)
 
 postcore_initcall(of_bus_driver_init);
 
+static int __init of_debug(char *str)
+{
+       int val = 0;
+
+       get_option(&str, &val);
+       if (val & 1)
+               of_resource_verbose = 1;
+       if (val & 2)
+               of_irq_verbose = 1;
+       return 1;
+}
+
+__setup("of_debug=", of_debug);
+
 int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
 {
        /* initialize common driver fields */
@@ -922,9 +938,11 @@ int of_device_register(struct of_device *ofdev)
        if (rc)
                return rc;
 
-       device_create_file(&ofdev->dev, &dev_attr_devspec);
+       rc = device_create_file(&ofdev->dev, &dev_attr_devspec);
+       if (rc)
+               device_unregister(&ofdev->dev);
 
-       return 0;
+       return rc;
 }
 
 void of_device_unregister(struct of_device *ofdev)
index 99daeee4209d610891ad17c52bd182e431ad9955..c86007a2aa3f251493606edb38a37edea7298b0d 100644 (file)
@@ -539,6 +539,45 @@ static unsigned long __sabre_onboard_imap_off[] = {
        ((ino & 0x20) ? (SABRE_ICLR_SCSI + (((ino) & 0x1f) << 3)) :  \
                        (SABRE_ICLR_A_SLOT0 + (((ino) & 0x1f)<<3)))
 
+static int sabre_device_needs_wsync(struct device_node *dp)
+{
+       struct device_node *parent = dp->parent;
+       char *parent_model, *parent_compat;
+
+       /* This traversal up towards the root is meant to
+        * handle two cases:
+        *
+        * 1) non-PCI bus sitting under PCI, such as 'ebus'
+        * 2) the PCI controller interrupts themselves, which
+        *    will use the sabre_irq_build but do not need
+        *    the DMA synchronization handling
+        */
+       while (parent) {
+               if (!strcmp(parent->type, "pci"))
+                       break;
+               parent = parent->parent;
+       }
+
+       if (!parent)
+               return 0;
+
+       parent_model = of_get_property(parent,
+                                      "model", NULL);
+       if (parent_model &&
+           (!strcmp(parent_model, "SUNW,sabre") ||
+            !strcmp(parent_model, "SUNW,simba")))
+               return 0;
+
+       parent_compat = of_get_property(parent,
+                                       "compatible", NULL);
+       if (parent_compat &&
+           (!strcmp(parent_compat, "pci108e,a000") ||
+            !strcmp(parent_compat, "pci108e,a001")))
+               return 0;
+
+       return 1;
+}
+
 static unsigned int sabre_irq_build(struct device_node *dp,
                                    unsigned int ino,
                                    void *_data)
@@ -577,15 +616,17 @@ static unsigned int sabre_irq_build(struct device_node *dp,
 
        virt_irq = build_irq(inofixup, iclr, imap);
 
+       /* If the parent device is a PCI<->PCI bridge other than
+        * APB, we have to install a pre-handler to ensure that
+        * all pending DMA is drained before the interrupt handler
+        * is run.
+        */
        regs = of_get_property(dp, "reg", NULL);
-       if (regs &&
-           ((regs->phys_hi >> 16) & 0xff) != irq_data->pci_first_busno) {
+       if (regs && sabre_device_needs_wsync(dp)) {
                irq_install_pre_handler(virt_irq,
                                        sabre_wsync_handler,
                                        (void *) (long) regs->phys_hi,
-                                       (void *)
-                                       controller_regs +
-                                       SABRE_WRSYNC);
+                                       (void *) irq_data);
        }
 
        return virt_irq;
index 47dfde95b8f8272caf3281afb91e2c3186a9f19c..b7d1514cd199c834558a416f74dc29a0ab2d88eb 100644 (file)
@@ -36,7 +36,6 @@
 #include <linux/delay.h>
 #include <linux/workqueue.h>
 #include <linux/nmi.h>
-#include <linux/kthread.h>
 #include <acpi/acpi.h>
 #include <asm/io.h>
 #include <acpi/acpi_bus.h>
@@ -583,16 +582,6 @@ static void acpi_os_execute_deferred(void *context)
        return;
 }
 
-static int acpi_os_execute_thread(void *context)
-{
-       struct acpi_os_dpc *dpc = (struct acpi_os_dpc *)context;
-       if (dpc) {
-               dpc->function(dpc->context);
-               kfree(dpc);
-       }
-       do_exit(0);
-}
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_os_execute
@@ -614,10 +603,16 @@ acpi_status acpi_os_execute(acpi_execute_type type,
        acpi_status status = AE_OK;
        struct acpi_os_dpc *dpc;
        struct work_struct *task;
-       struct task_struct *p;
+
+       ACPI_FUNCTION_TRACE("os_queue_for_execution");
+
+       ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+                         "Scheduling function [%p(%p)] for deferred execution.\n",
+                         function, context));
 
        if (!function)
-               return AE_BAD_PARAMETER;
+               return_ACPI_STATUS(AE_BAD_PARAMETER);
+
        /*
         * Allocate/initialize DPC structure.  Note that this memory will be
         * freed by the callee.  The kernel handles the tq_struct list  in a
@@ -628,34 +623,27 @@ acpi_status acpi_os_execute(acpi_execute_type type,
         * We can save time and code by allocating the DPC and tq_structs
         * from the same memory.
         */
-       if (type == OSL_NOTIFY_HANDLER) {
-               dpc = kmalloc(sizeof(struct acpi_os_dpc), GFP_KERNEL);
-       } else {
-               dpc = kmalloc(sizeof(struct acpi_os_dpc) +
-                               sizeof(struct work_struct), GFP_ATOMIC);
-       }
+
+       dpc =
+           kmalloc(sizeof(struct acpi_os_dpc) + sizeof(struct work_struct),
+                   GFP_ATOMIC);
        if (!dpc)
-               return AE_NO_MEMORY;
+               return_ACPI_STATUS(AE_NO_MEMORY);
+
        dpc->function = function;
        dpc->context = context;
 
-       if (type == OSL_NOTIFY_HANDLER) {
-               p = kthread_create(acpi_os_execute_thread, dpc, "kacpid_notify");
-               if (!IS_ERR(p)) {
-                       wake_up_process(p);
-               } else {
-                       status = AE_NO_MEMORY;
-                       kfree(dpc);
-               }
-       } else {
-               task = (void *)(dpc + 1);
-               INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc);
-               if (!queue_work(kacpid_wq, task)) {
-                       status = AE_ERROR;
-                       kfree(dpc);
-               }
+       task = (void *)(dpc + 1);
+       INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc);
+
+       if (!queue_work(kacpid_wq, task)) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "Call to queue_work() failed.\n"));
+               kfree(dpc);
+               status = AE_ERROR;
        }
-       return status;
+
+       return_ACPI_STATUS(status);
 }
 
 EXPORT_SYMBOL(acpi_os_execute);
index 83fa8b291a59ebdbcdf036cb331d86a9fe564a85..2e954d07175a5c6d067531ac23d155c1a24d2d8d 100644 (file)
@@ -129,7 +129,7 @@ static struct kobj_type ktype_bus = {
 
 };
 
-decl_subsys(bus, &ktype_bus, NULL);
+static decl_subsys(bus, &ktype_bus, NULL);
 
 
 #ifdef CONFIG_HOTPLUG
@@ -598,12 +598,13 @@ void put_bus(struct bus_type * bus)
  *
  *     Note that kset_find_obj increments bus' reference count.
  */
-
+#if 0
 struct bus_type * find_bus(char * name)
 {
        struct kobject * k = kset_find_obj(&bus_subsys.kset, name);
        return k ? to_bus(k) : NULL;
 }
+#endif  /*  0  */
 
 
 /**
index b21f864c9ce8810a6c16f0e091395dfffb1e545a..be6b5bc0677d545c0f79efd659f98d268fffb200 100644 (file)
@@ -559,20 +559,20 @@ static void device_create_release(struct device *dev)
 
 /**
  * device_create - creates a device and registers it with sysfs
- * @cs: pointer to the struct class that this device should be registered to.
- * @parent: pointer to the parent struct device of this new device, if any.
- * @dev: the dev_t for the char device to be added.
- * @fmt: string for the class device's name
+ * @class: pointer to the struct class that this device should be registered to
+ * @parent: pointer to the parent struct device of this new device, if any
+ * @devt: the dev_t for the char device to be added
+ * @fmt: string for the device's name
+ *
+ * This function can be used by char device classes.  A struct device
+ * will be created in sysfs, registered to the specified class.
  *
- * This function can be used by char device classes.  A struct
- * device will be created in sysfs, registered to the specified
- * class.
  * A "dev" file will be created, showing the dev_t for the device, if
  * the dev_t is not 0,0.
- * If a pointer to a parent struct device is passed in, the newly
- * created struct device will be a child of that device in sysfs.  The
- * pointer to the struct device will be returned from the call.  Any
- * further sysfs files that might be required can be created using this
+ * If a pointer to a parent struct device is passed in, the newly created
+ * struct device will be a child of that device in sysfs.
+ * The pointer to the struct device will be returned from the call.
+ * Any further sysfs files that might be required can be created using this
  * pointer.
  *
  * Note: the struct class passed to this function must have previously
@@ -620,11 +620,11 @@ EXPORT_SYMBOL_GPL(device_create);
 
 /**
  * device_destroy - removes a device that was created with device_create()
- * @class: the pointer to the struct class that this device was registered * with.
- * @dev: the dev_t of the device that was previously registered.
+ * @class: pointer to the struct class that this device was registered with
+ * @devt: the dev_t of the device that was previously registered
  *
- * This call unregisters and cleans up a class device that was created with a
- * call to class_device_create()
+ * This call unregisters and cleans up a device that was created with a
+ * call to device_create().
  */
 void device_destroy(struct class *class, dev_t devt)
 {
index 1994270c16e1992536380b620ef70afcf33c28bb..93ba25b7ea328303fad462372ddb575e69ea207e 100644 (file)
@@ -191,7 +191,7 @@ static int hci_uart_flush(struct hci_dev *hdev)
 
        /* Flush any pending characters in the driver and discipline. */
        tty_ldisc_flush(tty);
-       if (tty->driver->flush_buffer)
+       if (tty->driver && tty->driver->flush_buffer)
                tty->driver->flush_buffer(tty);
 
        if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
@@ -290,7 +290,7 @@ static int hci_uart_tty_open(struct tty_struct *tty)
        if (tty->ldisc.flush_buffer)
                tty->ldisc.flush_buffer(tty);
 
-       if (tty->driver->flush_buffer)
+       if (tty->driver && tty->driver->flush_buffer)
                tty->driver->flush_buffer(tty);
 
        return 0;
index 6ccc364c08df58076402a482232d4819708b6fac..6e6a7c7a7eff191bc56f1d634afed8bdd85f9304 100644 (file)
@@ -1245,7 +1245,7 @@ static int rtc_proc_open(struct inode *inode, struct file *file)
 
 void rtc_get_rtc_time(struct rtc_time *rtc_tm)
 {
-       unsigned long uip_watchdog = jiffies;
+       unsigned long uip_watchdog = jiffies, flags;
        unsigned char ctrl;
 #ifdef CONFIG_MACH_DECSTATION
        unsigned int real_year;
@@ -1272,7 +1272,7 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm)
         * RTC has RTC_DAY_OF_WEEK, we should usually ignore it, as it is
         * only updated by the RTC when initially set to a non-zero value.
         */
-       spin_lock_irq(&rtc_lock);
+       spin_lock_irqsave(&rtc_lock, flags);
        rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS);
        rtc_tm->tm_min = CMOS_READ(RTC_MINUTES);
        rtc_tm->tm_hour = CMOS_READ(RTC_HOURS);
@@ -1286,7 +1286,7 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm)
        real_year = CMOS_READ(RTC_DEC_YEAR);
 #endif
        ctrl = CMOS_READ(RTC_CONTROL);
-       spin_unlock_irq(&rtc_lock);
+       spin_unlock_irqrestore(&rtc_lock, flags);
 
        if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
        {
index 59122cc0a50a1b39740970ab00adfb840a08c01d..cc15c4f2e9ecd28595e5f80c4bc5712e46d7f817 100644 (file)
@@ -142,6 +142,14 @@ static const u8 abituguru_pwm_max[5] = { 0, 255, 255, 75, 75 };
 static int force;
 module_param(force, bool, 0);
 MODULE_PARM_DESC(force, "Set to one to force detection.");
+static int bank1_types[ABIT_UGURU_MAX_BANK1_SENSORS] = { -1, -1, -1, -1, -1,
+       -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
+module_param_array(bank1_types, int, NULL, 0);
+MODULE_PARM_DESC(bank1_types, "Bank1 sensortype autodetection override:\n"
+       "   -1 autodetect\n"
+       "    0 volt sensor\n"
+       "    1 temp sensor\n"
+       "    2 not connected");
 static int fan_sensors;
 module_param(fan_sensors, int, 0);
 MODULE_PARM_DESC(fan_sensors, "Number of fan sensors on the uGuru "
@@ -397,6 +405,15 @@ abituguru_detect_bank1_sensor_type(struct abituguru_data *data,
        u8 val, buf[3];
        int ret = ABIT_UGURU_NC;
 
+       /* If overriden by the user return the user selected type */
+       if (bank1_types[sensor_addr] >= ABIT_UGURU_IN_SENSOR &&
+                       bank1_types[sensor_addr] <= ABIT_UGURU_NC) {
+               ABIT_UGURU_DEBUG(2, "assuming sensor type %d for bank1 sensor "
+                       "%d because of \"bank1_types\" module param\n",
+                       bank1_types[sensor_addr], (int)sensor_addr);
+               return bank1_types[sensor_addr];
+       }
+
        /* First read the sensor and the current settings */
        if (abituguru_read(data, ABIT_UGURU_SENSOR_BANK1, sensor_addr, &val,
                        1, ABIT_UGURU_MAX_RETRIES) != 1)
@@ -514,7 +531,7 @@ abituguru_detect_no_bank2_sensors(struct abituguru_data *data)
 {
        int i;
 
-       if (fan_sensors) {
+       if (fan_sensors > 0 && fan_sensors <= ABIT_UGURU_MAX_BANK2_SENSORS) {
                data->bank2_sensors = fan_sensors;
                ABIT_UGURU_DEBUG(2, "assuming %d fan sensors because of "
                        "\"fan_sensors\" module param\n",
@@ -568,7 +585,7 @@ abituguru_detect_no_pwms(struct abituguru_data *data)
 {
        int i, j;
 
-       if (pwms) {
+       if (pwms > 0 && pwms <= ABIT_UGURU_MAX_PWMS) {
                data->pwms = pwms;
                ABIT_UGURU_DEBUG(2, "assuming %d PWM outputs because of "
                        "\"pwms\" module param\n", (int)data->pwms);
index df05df1a0ef61f20de8239e36bb3202ac7ae6ae5..ab230c033f9930ce293cf7ae1057db559f60b80e 100644 (file)
@@ -372,7 +372,6 @@ static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
 
        while (count > 0) {
                inval = i2c_inb(i2c_adap);
-/*printk("%#02x ",inval); if ( ! (count % 16) ) printk("\n"); */
                if (inval>=0) {
                        *temp = inval;
                        rdcount++;
@@ -544,8 +543,7 @@ int i2c_bit_add_bus(struct i2c_adapter *adap)
        adap->timeout = 100;    /* default values, should       */
        adap->retries = 3;      /* be replaced by defines       */
 
-       i2c_add_adapter(adap);
-       return 0;
+       return i2c_add_adapter(adap);
 }
 
 
index 2db7bfc852252dbf1b74c29ede26071b522a92e1..70d8eefb5efcc44639b86bda6525fb084b76f04f 100644 (file)
@@ -742,10 +742,8 @@ int i2c_iic_add_bus(struct i2c_adapter *adap)
        adap->retries = 3;              /* be replaced by defines       */
        adap->flags = 0;
 
-       i2c_add_adapter(adap);
        iic_init(iic_adap);
-
-       return 0;
+       return i2c_add_adapter(adap);
 }
 
 
index 82946acab4c759ddeac4e2b235dd56eacf39fa3a..b88a6fcf7bd094abf75c67ba940cefe0fbd9ce58 100644 (file)
@@ -374,10 +374,10 @@ int i2c_pca_add_bus(struct i2c_adapter *adap)
        adap->timeout = 100;            /* default values, should       */
        adap->retries = 3;              /* be replaced by defines       */
 
-       rval = pca_init(pca_adap);
+       if ((rval = pca_init(pca_adap)))
+               return rval;
 
-       if (!rval)
-               i2c_add_adapter(adap);
+       rval = i2c_add_adapter(adap);
 
        return rval;
 }
index 6e498df1f717aea6f238b6ce91d990b9a7cbedfa..5b24930adb5a7b9e23721f47aca79daa7b450d04 100644 (file)
@@ -479,9 +479,11 @@ int i2c_pcf_add_bus(struct i2c_adapter *adap)
        adap->timeout = 100;            /* default values, should       */
        adap->retries = 3;              /* be replaced by defines       */
 
-       rval = pcf_init_8584(pcf_adap);
-       if (!rval)
-               i2c_add_adapter(adap);
+       if ((rval = pcf_init_8584(pcf_adap)))
+               return rval;
+
+       rval = i2c_add_adapter(adap);
+
        return rval;
 }
 
index 3df3f09995c254806ed8c265eb3dfcb4c8cd08df..32d41c6fac0fccf0583bd53cb60b40b72c47632b 100644 (file)
@@ -173,9 +173,7 @@ int i2c_sibyte_add_bus(struct i2c_adapter *i2c_adap, int speed)
                printk("\n");
        }
 
-       i2c_add_adapter(i2c_adap);
-
-       return 0;
+       return i2c_add_adapter(i2c_adap);
 }
 
 
index aca7e166860546174c59557aead82d7d90c25428..48c56939c8619abaae4e6289fb86cd2856d03921 100644 (file)
@@ -21,6 +21,9 @@
  * - Make it work with IXP46x chips
  * - Cleanup function names, coding style, etc
  *
+ * - writing to slave address causes latchup on iop331.
+ *     fix: driver refuses to address self.
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, version 2.
@@ -72,12 +75,6 @@ iop3xx_i2c_reset(struct i2c_algo_iop3xx_data *iop3xx_adap)
        __raw_writel(0, iop3xx_adap->ioaddr + CR_OFFSET);
 } 
 
-static void 
-iop3xx_i2c_set_slave_addr(struct i2c_algo_iop3xx_data *iop3xx_adap)
-{
-       __raw_writel(MYSAR, iop3xx_adap->ioaddr + SAR_OFFSET);
-}
-
 static void 
 iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap)
 {
@@ -248,6 +245,13 @@ iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap,
        int status;
        int rc;
 
+       /* avoid writing to my slave address (hangs on 80331),
+        * forbidden in Intel developer manual
+        */
+       if (msg->addr == MYSAR) {
+               return -EBUSY;
+       }
+
        __raw_writel(iic_cook_addr(msg), iop3xx_adap->ioaddr + DBR_OFFSET);
        
        cr &= ~(IOP3XX_ICR_MSTOP | IOP3XX_ICR_NACK);
@@ -498,7 +502,6 @@ iop3xx_i2c_probe(struct platform_device *pdev)
        spin_lock_init(&adapter_data->lock);
 
        iop3xx_i2c_reset(adapter_data);
-       iop3xx_i2c_set_slave_addr(adapter_data);
        iop3xx_i2c_enable(adapter_data);
 
        platform_set_drvdata(pdev, new_adapter);
index e46ebaea7b1edba4cfa6f8a0e904977cd7cc320c..8485861f6a36dd01a9d30c86d1414fe1def11dbc 100644 (file)
@@ -80,7 +80,7 @@
 #define IOP3XX_GPOD_I2C0       0x00c0  /* clear these bits to enable ch0 */
 #define IOP3XX_GPOD_I2C1       0x0030  /* clear these bits to enable ch1 */
 
-#define MYSAR                  0x02    /* SWAG a suitable slave address */
+#define MYSAR                  0       /* default slave address */
 
 #define I2C_ERR                        321
 #define I2C_ERR_BERR           (I2C_ERR+0)
index 2a0b3be7cdd0824d910d90f5ddec5e312202abf9..53bb4359386399149ca6d130aad56459846749ed 100644 (file)
@@ -148,8 +148,6 @@ static int i2c_powermac_master_xfer(        struct i2c_adapter *adap,
        int                     read;
        int                     addrdir;
 
-       if (num != 1)
-               return -EINVAL;
        if (msgs->flags & I2C_M_TEN)
                return -EINVAL;
        read = (msgs->flags & I2C_M_RD) != 0;
@@ -166,7 +164,7 @@ static int i2c_powermac_master_xfer(        struct i2c_adapter *adap,
        rc = pmac_i2c_xfer(bus, addrdir, 0, 0, msgs->buf, msgs->len);
  bail:
        pmac_i2c_close(bus);
-       return rc < 0 ? rc : msgs->len;
+       return rc < 0 ? rc : 1;
 }
 
 static u32 i2c_powermac_func(struct i2c_adapter * adapter)
index 22a3eda04166e3b7841d0fd5c897aa16851b20fa..ced309ff056fa123d3a0022dfcc7d7530b60d491 100644 (file)
@@ -184,21 +184,21 @@ static void scx200_acb_machine(struct scx200_acb_iface *iface, u8 status)
                break;
 
        case state_read:
-               /* Set ACK if receiving the last byte */
-               if (iface->len == 1)
+               /* Set ACK if _next_ byte will be the last one */
+               if (iface->len == 2)
                        outb(inb(ACBCTL1) | ACBCTL1_ACK, ACBCTL1);
                else
                        outb(inb(ACBCTL1) & ~ACBCTL1_ACK, ACBCTL1);
 
-               *iface->ptr++ = inb(ACBSDA);
-               --iface->len;
-
-               if (iface->len == 0) {
+               if (iface->len == 1) {
                        iface->result = 0;
                        iface->state = state_idle;
                        outb(inb(ACBCTL1) | ACBCTL1_STOP, ACBCTL1);
                }
 
+               *iface->ptr++ = inb(ACBSDA);
+               --iface->len;
+
                break;
 
        case state_write:
@@ -307,8 +307,12 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter,
                buffer = (u8 *)&cur_word;
                break;
 
-       case I2C_SMBUS_BLOCK_DATA:
+       case I2C_SMBUS_I2C_BLOCK_DATA:
+               if (rw == I2C_SMBUS_READ)
+                       data->block[0] = I2C_SMBUS_BLOCK_MAX; /* For now */
                len = data->block[0];
+               if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
+                       return -EINVAL;
                buffer = &data->block[1];
                break;
 
@@ -372,7 +376,7 @@ static u32 scx200_acb_func(struct i2c_adapter *adapter)
 {
        return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
               I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
-              I2C_FUNC_SMBUS_BLOCK_DATA;
+              I2C_FUNC_SMBUS_I2C_BLOCK;
 }
 
 /* For now, we only handle combined mode (smbus) */
index 54b6e6a4beedcd5c9e8288caab01acfb90f8c0bb..cb22280cdd277cb08c738abcc4064588413226a8 100644 (file)
@@ -134,11 +134,13 @@ static int pca9539_detect(struct i2c_adapter *adapter, int address, int kind)
        new_client->driver = &pca9539_driver;
        new_client->flags = 0;
 
-       /* Detection: the pca9539 only has 8 registers (0-7).
-          A read of 7 should succeed, but a read of 8 should fail. */
-       if ((i2c_smbus_read_byte_data(new_client, 7) < 0) ||
-           (i2c_smbus_read_byte_data(new_client, 8) >= 0))
-               goto exit_kfree;
+       if (kind < 0) {
+               /* Detection: the pca9539 only has 8 registers (0-7).
+                  A read of 7 should succeed, but a read of 8 should fail. */
+               if ((i2c_smbus_read_byte_data(new_client, 7) < 0) ||
+                   (i2c_smbus_read_byte_data(new_client, 8) >= 0))
+                       goto exit_kfree;
+       }
 
        strlcpy(new_client->name, "pca9539", I2C_NAME_SIZE);
 
index a45155f799d4405dae2d67ca06d7168f64fe9d3d..9cb277d6aa48bbff97dc6582051e5ab03e912850 100644 (file)
@@ -756,9 +756,9 @@ int i2c_probe(struct i2c_adapter *adapter,
                                        "parameter for adapter %d, "
                                        "addr 0x%02x\n", adap_id,
                                        address_data->ignore[j + 1]);
+                               ignore = 1;
+                               break;
                        }
-                       ignore = 1;
-                       break;
                }
                if (ignore)
                        continue;
index b7e459e4f284af88a00b26a50b40ffed734f531d..602797a4420877f6fc74e659a05b4c50be8d54d6 100644 (file)
@@ -146,16 +146,7 @@ static void ide_detach(struct pcmcia_device *link)
     kfree(link->priv);
 } /* ide_detach */
 
-static void idecs_mmio_fixup(ide_hwif_t *hwif)
-{
-       default_hwif_mmiops(hwif);
-       hwif->mmio = 2;
-
-       ide_undecoded_slave(hwif);
-}
-
-static int idecs_register(unsigned long io, unsigned long ctl,
-       unsigned long irq, struct pcmcia_device *handle, int is_mmio)
+static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle)
 {
     hw_regs_t hw;
     memset(&hw, 0, sizeof(hw));
@@ -163,19 +154,7 @@ static int idecs_register(unsigned long io, unsigned long ctl,
     hw.irq = irq;
     hw.chipset = ide_pci;
     hw.dev = &handle->dev;
-
-    if(is_mmio)
-       return ide_register_hw_with_fixup(&hw, NULL, idecs_mmio_fixup);
-    else
-        return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
-}
-
-void outb_io(unsigned char value, unsigned long port) {
-       outb(value, port);
-}
-
-void outb_mem(unsigned char value, unsigned long port) {
-       writeb(value, (void __iomem *) port);
+    return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
 }
 
 /*======================================================================
@@ -201,8 +180,7 @@ static int ide_config(struct pcmcia_device *link)
     } *stk = NULL;
     cistpl_cftable_entry_t *cfg;
     int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0;
-    unsigned long io_base, ctl_base, is_mmio, try_slave;
-    void (*my_outb)(unsigned char, unsigned long);
+    unsigned long io_base, ctl_base;
 
     DEBUG(0, "ide_config(0x%p)\n", link);
 
@@ -232,7 +210,7 @@ static int ide_config(struct pcmcia_device *link)
     /* Not sure if this is right... look up the current Vcc */
     CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf));
 
-    pass = io_base = ctl_base = is_mmio = try_slave = 0;
+    pass = io_base = ctl_base = 0;
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
     tuple.Attributes = 0;
     CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
@@ -280,45 +258,11 @@ static int ide_config(struct pcmcia_device *link)
                        goto next_entry;
                io_base = link->io.BasePort1;
                ctl_base = link->io.BasePort1 + 0x0e;
-
-               if (io->win[0].len >= 0x20)
-                       try_slave = 1;
-
            } else goto next_entry;
            /* If we've got this far, we're done */
            break;
        }
 
-       if ((cfg->mem.nwin > 0) || (stk->dflt.mem.nwin > 0)) {
-           win_req_t req;
-           memreq_t map;
-           cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &stk->dflt.mem;
-
-           if (mem->win[0].len < 16)
-               goto next_entry;
-
-           req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
-           req.Attributes |= WIN_ENABLE;
-           req.Base = mem->win[0].host_addr;
-           req.Size = 0;
-
-           req.AccessSpeed = 0;
-           if (pcmcia_request_window(&link, &req, &link->win) != 0)
-               goto next_entry;
-           map.Page = 0; map.CardOffset = mem->win[0].card_addr;
-           if (pcmcia_map_mem_page(link->win, &map) != 0)
-               goto next_entry;
-
-           io_base = (unsigned long) ioremap(req.Base, req.Size);
-           ctl_base = io_base + 0x0e;
-           is_mmio = 1;
-
-           if (mem->win[0].len >= 0x20)
-               try_slave = 1;
-
-           break;
-       }
-
     next_entry:
        if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
            memcpy(&stk->dflt, cfg, sizeof(stk->dflt));
@@ -334,26 +278,21 @@ static int ide_config(struct pcmcia_device *link)
     CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
     CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
 
-    if(is_mmio)
-       my_outb = outb_mem;
-    else
-       my_outb = outb_io;
-
     /* disable drive interrupts during IDE probe */
-    my_outb(0x02, ctl_base);
+    outb(0x02, ctl_base);
 
     /* special setup for KXLC005 card */
     if (is_kme)
-       my_outb(0x81, ctl_base+1);
+       outb(0x81, ctl_base+1);
 
     /* retry registration in case device is still spinning up */
     for (hd = -1, i = 0; i < 10; i++) {
-       hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link, is_mmio);
+       hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link);
        if (hd >= 0) break;
-       if (try_slave) {
-           my_outb(0x02, ctl_base + 0x10);
+       if (link->io.NumPorts1 == 0x20) {
+           outb(0x02, ctl_base + 0x10);
            hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
-                               link->irq.AssignedIRQ, link, is_mmio);
+                               link->irq.AssignedIRQ, link);
            if (hd >= 0) {
                io_base += 0x10;
                ctl_base += 0x10;
index f82e82109728fa0e79a5fa31987266406120d19c..2f962cfa3f7f0f2e4a38af238cce287bd6d19f9a 100644 (file)
@@ -212,6 +212,9 @@ static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_devi
            (!(PCI_FUNC(dev->devfn) & 1)))
                goto out;
 
+       if (dev->vendor == PCI_VENDOR_ID_JMICRON && PCI_FUNC(dev->devfn) != 1)
+               goto out;
+
        pci_read_config_word(dev, PCI_COMMAND, &command);
        if (!(command & PCI_COMMAND_IO)) {
                printk(KERN_INFO "Skipping disabled %s IDE controller.\n", d->name);
@@ -239,6 +242,11 @@ static struct pci_device_id generic_pci_tbl[] = {
        { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12},
        { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13},
        { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION,          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19},
        /* Must come last. If you add entries adjust this table appropriately and the init_one code */
        { PCI_ANY_ID,           PCI_ANY_ID,                        PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0},
        { 0, },
index d2150baa7e351eb48ffc5a86c54d62c060a06161..1428bb7715afd16a04fb6132cd560b420636d111 100644 (file)
@@ -1916,7 +1916,7 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        regs = ioremap(pciaddr, CP_REGS_SIZE);
        if (!regs) {
                rc = -EIO;
-               dev_err(&pdev->dev, "Cannot map PCI MMIO (%lx@%lx)\n",
+               dev_err(&pdev->dev, "Cannot map PCI MMIO (%Lx@%Lx)\n",
                       (unsigned long long)pci_resource_len(pdev, 1),
                       (unsigned long long)pciaddr);
                goto err_out_res;
index 6e7d31bacf4d0ee751fee5cfc9196b1fa1b39b64..6d3d41934503811332657ad6ee27e02f394e8c5a 100644 (file)
@@ -283,7 +283,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
                }
        }
        if (adapter->have_msi)
-               flags &= ~SA_SHIRQ;
+               flags &= ~IRQF_SHARED;
 #endif
        if ((err = request_irq(adapter->pdev->irq, &e1000_intr, flags,
                               netdev->name, netdev)))
index ad81ec68f8870cdeb96c23b8c1a2718dda7d3dfa..11b8f1b43dd5994a255c1b6613d0cfa868a4bdeb 100644 (file)
@@ -240,10 +240,12 @@ enum {
 #define NVREG_RNDSEED_FORCE2   0x2d00
 #define NVREG_RNDSEED_FORCE3   0x7400
 
-       NvRegUnknownSetupReg1 = 0xA0,
-#define NVREG_UNKSETUP1_VAL    0x16070f
-       NvRegUnknownSetupReg2 = 0xA4,
-#define NVREG_UNKSETUP2_VAL    0x16
+       NvRegTxDeferral = 0xA0,
+#define NVREG_TX_DEFERRAL_DEFAULT      0x15050f
+#define NVREG_TX_DEFERRAL_RGMII_10_100 0x16070f
+#define NVREG_TX_DEFERRAL_RGMII_1000   0x14050f
+       NvRegRxDeferral = 0xA4,
+#define NVREG_RX_DEFERRAL_DEFAULT      0x16
        NvRegMacAddrA = 0xA8,
        NvRegMacAddrB = 0xAC,
        NvRegMulticastAddrA = 0xB0,
@@ -269,8 +271,10 @@ enum {
 #define NVREG_LINKSPEED_MASK   (0xFFF)
        NvRegUnknownSetupReg5 = 0x130,
 #define NVREG_UNKSETUP5_BIT31  (1<<31)
-       NvRegUnknownSetupReg3 = 0x13c,
-#define NVREG_UNKSETUP3_VAL1   0x200010
+       NvRegTxWatermark = 0x13c,
+#define NVREG_TX_WM_DESC1_DEFAULT      0x0200010
+#define NVREG_TX_WM_DESC2_3_DEFAULT    0x1e08000
+#define NVREG_TX_WM_DESC2_3_1000       0xfe08000
        NvRegTxRxControl = 0x144,
 #define NVREG_TXRXCTL_KICK     0x0001
 #define NVREG_TXRXCTL_BIT1     0x0002
@@ -658,7 +662,7 @@ static const struct register_test nv_registers_test[] = {
        { NvRegMisc1, 0x03c },
        { NvRegOffloadConfig, 0x03ff },
        { NvRegMulticastAddrA, 0xffffffff },
-       { NvRegUnknownSetupReg3, 0x0ff },
+       { NvRegTxWatermark, 0x0ff },
        { NvRegWakeUpFlags, 0x07777 },
        { 0,0 }
 };
@@ -2127,7 +2131,7 @@ static int nv_update_linkspeed(struct net_device *dev)
        int newdup = np->duplex;
        int mii_status;
        int retval = 0;
-       u32 control_1000, status_1000, phyreg, pause_flags;
+       u32 control_1000, status_1000, phyreg, pause_flags, txreg;
 
        /* BMSR_LSTATUS is latched, read it twice:
         * we want the current value.
@@ -2245,6 +2249,26 @@ set_speed:
                phyreg |= PHY_1000;
        writel(phyreg, base + NvRegPhyInterface);
 
+       if (phyreg & PHY_RGMII) {
+               if ((np->linkspeed & NVREG_LINKSPEED_MASK) == NVREG_LINKSPEED_1000)
+                       txreg = NVREG_TX_DEFERRAL_RGMII_1000;
+               else
+                       txreg = NVREG_TX_DEFERRAL_RGMII_10_100;
+       } else {
+               txreg = NVREG_TX_DEFERRAL_DEFAULT;
+       }
+       writel(txreg, base + NvRegTxDeferral);
+
+       if (np->desc_ver == DESC_VER_1) {
+               txreg = NVREG_TX_WM_DESC1_DEFAULT;
+       } else {
+               if ((np->linkspeed & NVREG_LINKSPEED_MASK) == NVREG_LINKSPEED_1000)
+                       txreg = NVREG_TX_WM_DESC2_3_1000;
+               else
+                       txreg = NVREG_TX_WM_DESC2_3_DEFAULT;
+       }
+       writel(txreg, base + NvRegTxWatermark);
+
        writel(NVREG_MISC1_FORCE | ( np->duplex ? 0 : NVREG_MISC1_HD),
                base + NvRegMisc1);
        pci_push(base);
@@ -3910,7 +3934,10 @@ static int nv_open(struct net_device *dev)
 
        /* 5) continue setup */
        writel(np->linkspeed, base + NvRegLinkSpeed);
-       writel(NVREG_UNKSETUP3_VAL1, base + NvRegUnknownSetupReg3);
+       if (np->desc_ver == DESC_VER_1)
+               writel(NVREG_TX_WM_DESC1_DEFAULT, base + NvRegTxWatermark);
+       else
+               writel(NVREG_TX_WM_DESC2_3_DEFAULT, base + NvRegTxWatermark);
        writel(np->txrxctl_bits, base + NvRegTxRxControl);
        writel(np->vlanctl_bits, base + NvRegVlanControl);
        pci_push(base);
@@ -3932,8 +3959,8 @@ static int nv_open(struct net_device *dev)
        writel(readl(base + NvRegReceiverStatus), base + NvRegReceiverStatus);
        get_random_bytes(&i, sizeof(i));
        writel(NVREG_RNDSEED_FORCE | (i&NVREG_RNDSEED_MASK), base + NvRegRandomSeed);
-       writel(NVREG_UNKSETUP1_VAL, base + NvRegUnknownSetupReg1);
-       writel(NVREG_UNKSETUP2_VAL, base + NvRegUnknownSetupReg2);
+       writel(NVREG_TX_DEFERRAL_DEFAULT, base + NvRegTxDeferral);
+       writel(NVREG_RX_DEFERRAL_DEFAULT, base + NvRegRxDeferral);
        if (poll_interval == -1) {
                if (optimization_mode == NV_OPTIMIZATION_MODE_THROUGHPUT)
                        writel(NVREG_POLL_DEFAULT_THROUGHPUT, base + NvRegPollingInterval);
index a4674044bd6f3c536b7abf195c7d4b480268ec97..2eff45bedc7cbc28a0f819fe44e43feece707bfe 100644 (file)
@@ -2353,7 +2353,7 @@ static int __init smsc_superio_lpc(unsigned short cfg_base)
 #ifdef CONFIG_PCI
 #define PCIID_VENDOR_INTEL 0x8086
 #define PCIID_VENDOR_ALI 0x10b9
-static struct smsc_ircc_subsystem_configuration subsystem_configurations[] __devinitdata = {
+static struct smsc_ircc_subsystem_configuration subsystem_configurations[] __initdata = {
        {
                .vendor = PCIID_VENDOR_INTEL, /* Intel 82801DBM LPC bridge */
                .device = 0x24cc,
index 7eb08d929139de2b8ce901f687de87c350978783..7bbd447289b58df7906c396d6948701770ff2c6e 100644 (file)
@@ -1281,7 +1281,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
 
        while(len) {
                buffer_info = &tx_ring->buffer_info[i];
-               size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE);
+               size = min(len, IXGB_MAX_DATA_PER_TXD);
                buffer_info->length = size;
                buffer_info->dma =
                        pci_map_single(adapter->pdev,
@@ -1306,7 +1306,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
 
                while(len) {
                        buffer_info = &tx_ring->buffer_info[i];
-                       size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE);
+                       size = min(len, IXGB_MAX_DATA_PER_TXD);
                        buffer_info->length = size;
                        buffer_info->dma =
                                pci_map_page(adapter->pdev,
index ee1de971a71243993e7502a64cc49d73619ce384..07ca9480a6fe7fc892b32b87e49d9065aac9a695 100644 (file)
@@ -2412,14 +2412,20 @@ static int myri10ge_resume(struct pci_dev *pdev)
                return -EIO;
        }
        myri10ge_restore_state(mgp);
-       pci_enable_device(pdev);
+
+       status = pci_enable_device(pdev);
+       if (status < 0) {
+               dev_err(&pdev->dev, "failed to enable device\n");
+               return -EIO;
+       }
+
        pci_set_master(pdev);
 
        status = request_irq(pdev->irq, myri10ge_intr, IRQF_SHARED,
                             netdev->name, mgp);
        if (status != 0) {
                dev_err(&pdev->dev, "failed to allocate IRQ\n");
-               goto abort_with_msi;
+               goto abort_with_enabled;
        }
 
        myri10ge_reset(mgp);
@@ -2438,7 +2444,8 @@ static int myri10ge_resume(struct pci_dev *pdev)
 
        return 0;
 
-abort_with_msi:
+abort_with_enabled:
+       pci_disable_device(pdev);
        return -EIO;
 
 }
index c6b77acb35ef88ace82eb594e96adc6394cb1b4e..e1fe3a0a7b0be740237491f4a5eaf523793c5683 100644 (file)
@@ -1976,7 +1976,6 @@ static int start_nic(struct s2io_nic *nic)
        XENA_dev_config_t __iomem *bar0 = nic->bar0;
        struct net_device *dev = nic->dev;
        register u64 val64 = 0;
-       u16 interruptible;
        u16 subid, i;
        mac_info_t *mac_control;
        struct config_param *config;
@@ -2047,16 +2046,6 @@ static int start_nic(struct s2io_nic *nic)
                return FAILURE;
        }
 
-       /*  Enable select interrupts */
-       if (nic->intr_type != INTA)
-               en_dis_able_nic_intrs(nic, ENA_ALL_INTRS, DISABLE_INTRS);
-       else {
-               interruptible = TX_TRAFFIC_INTR | RX_TRAFFIC_INTR;
-               interruptible |= TX_PIC_INTR | RX_PIC_INTR;
-               interruptible |= TX_MAC_INTR | RX_MAC_INTR;
-               en_dis_able_nic_intrs(nic, interruptible, ENABLE_INTRS);
-       }
-
        /*
         * With some switches, link might be already up at this point.
         * Because of this weird behavior, when we enable laser,
@@ -3749,101 +3738,19 @@ static int s2io_open(struct net_device *dev)
        if (err) {
                DBG_PRINT(ERR_DBG, "%s: H/W initialization failed\n",
                          dev->name);
-               if (err == -ENODEV)
-                       goto hw_init_failed;
-               else
-                       goto hw_enable_failed;
-       }
-
-       /* Store the values of the MSIX table in the nic_t structure */
-       store_xmsi_data(sp);
-
-       /* After proper initialization of H/W, register ISR */
-       if (sp->intr_type == MSI) {
-               err = request_irq((int) sp->pdev->irq, s2io_msi_handle, 
-                       IRQF_SHARED, sp->name, dev);
-               if (err) {
-                       DBG_PRINT(ERR_DBG, "%s: MSI registration \
-failed\n", dev->name);
-                       goto isr_registration_failed;
-               }
-       }
-       if (sp->intr_type == MSI_X) {
-               int i;
-
-               for (i=1; (sp->s2io_entries[i].in_use == MSIX_FLG); i++) {
-                       if (sp->s2io_entries[i].type == MSIX_FIFO_TYPE) {
-                               sprintf(sp->desc1, "%s:MSI-X-%d-TX",
-                                       dev->name, i);
-                               err = request_irq(sp->entries[i].vector,
-                                         s2io_msix_fifo_handle, 0, sp->desc1,
-                                         sp->s2io_entries[i].arg);
-                               DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc1, 
-                                   (unsigned long long)sp->msix_info[i].addr);
-                       } else {
-                               sprintf(sp->desc2, "%s:MSI-X-%d-RX",
-                                       dev->name, i);
-                               err = request_irq(sp->entries[i].vector,
-                                         s2io_msix_ring_handle, 0, sp->desc2,
-                                         sp->s2io_entries[i].arg);
-                               DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc2, 
-                                    (unsigned long long)sp->msix_info[i].addr);
-                       }
-                       if (err) {
-                               DBG_PRINT(ERR_DBG, "%s: MSI-X-%d registration \
-failed\n", dev->name, i);
-                               DBG_PRINT(ERR_DBG, "Returned: %d\n", err);
-                               goto isr_registration_failed;
-                       }
-                       sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS;
-               }
-       }
-       if (sp->intr_type == INTA) {
-               err = request_irq((int) sp->pdev->irq, s2io_isr, IRQF_SHARED,
-                               sp->name, dev);
-               if (err) {
-                       DBG_PRINT(ERR_DBG, "%s: ISR registration failed\n",
-                                 dev->name);
-                       goto isr_registration_failed;
-               }
+               goto hw_init_failed;
        }
 
        if (s2io_set_mac_addr(dev, dev->dev_addr) == FAILURE) {
                DBG_PRINT(ERR_DBG, "Set Mac Address Failed\n");
+               s2io_card_down(sp);
                err = -ENODEV;
-               goto setting_mac_address_failed;
+               goto hw_init_failed;
        }
 
        netif_start_queue(dev);
        return 0;
 
-setting_mac_address_failed:
-       if (sp->intr_type != MSI_X)
-               free_irq(sp->pdev->irq, dev);
-isr_registration_failed:
-       del_timer_sync(&sp->alarm_timer);
-       if (sp->intr_type == MSI_X) {
-               int i;
-               u16 msi_control; /* Temp variable */
-
-               for (i=1; (sp->s2io_entries[i].in_use == 
-                               MSIX_REGISTERED_SUCCESS); i++) {
-                       int vector = sp->entries[i].vector;
-                       void *arg = sp->s2io_entries[i].arg;
-
-                       free_irq(vector, arg);
-               }
-               pci_disable_msix(sp->pdev);
-
-               /* Temp */
-               pci_read_config_word(sp->pdev, 0x42, &msi_control);
-               msi_control &= 0xFFFE; /* Disable MSI */
-               pci_write_config_word(sp->pdev, 0x42, msi_control);
-       }
-       else if (sp->intr_type == MSI)
-               pci_disable_msi(sp->pdev);
-hw_enable_failed:
-       s2io_reset(sp);
 hw_init_failed:
        if (sp->intr_type == MSI_X) {
                if (sp->entries)
@@ -3874,7 +3781,7 @@ static int s2io_close(struct net_device *dev)
        flush_scheduled_work();
        netif_stop_queue(dev);
        /* Reset card, kill tasklet and free Tx and Rx buffers. */
-       s2io_card_down(sp, 1);
+       s2io_card_down(sp);
 
        sp->device_close_flag = TRUE;   /* Device is shut down. */
        return 0;
@@ -5919,7 +5826,7 @@ static int s2io_change_mtu(struct net_device *dev, int new_mtu)
 
        dev->mtu = new_mtu;
        if (netif_running(dev)) {
-               s2io_card_down(sp, 0);
+               s2io_card_down(sp);
                netif_stop_queue(dev);
                if (s2io_card_up(sp)) {
                        DBG_PRINT(ERR_DBG, "%s: Device bring up failed\n",
@@ -6216,43 +6123,106 @@ static  int rxd_owner_bit_reset(nic_t *sp)
 
 }
 
-static void s2io_card_down(nic_t * sp, int flag)
+static int s2io_add_isr(nic_t * sp)
 {
-       int cnt = 0;
-       XENA_dev_config_t __iomem *bar0 = sp->bar0;
-       unsigned long flags;
-       register u64 val64 = 0;
+       int ret = 0;
        struct net_device *dev = sp->dev;
+       int err = 0;
 
-       del_timer_sync(&sp->alarm_timer);
-       /* If s2io_set_link task is executing, wait till it completes. */
-       while (test_and_set_bit(0, &(sp->link_state))) {
-               msleep(50);
+       if (sp->intr_type == MSI)
+               ret = s2io_enable_msi(sp);
+       else if (sp->intr_type == MSI_X)
+               ret = s2io_enable_msi_x(sp);
+       if (ret) {
+               DBG_PRINT(ERR_DBG, "%s: Defaulting to INTA\n", dev->name);
+               sp->intr_type = INTA;
        }
-       atomic_set(&sp->card_state, CARD_DOWN);
 
-       /* disable Tx and Rx traffic on the NIC */
-       stop_nic(sp);
-       if (flag) {
-               if (sp->intr_type == MSI_X) {
-                       int i;
-                       u16 msi_control;
+       /* Store the values of the MSIX table in the nic_t structure */
+       store_xmsi_data(sp);
 
-                       for (i=1; (sp->s2io_entries[i].in_use ==
-                               MSIX_REGISTERED_SUCCESS); i++) {
-                               int vector = sp->entries[i].vector;
-                               void *arg = sp->s2io_entries[i].arg;
+       /* After proper initialization of H/W, register ISR */
+       if (sp->intr_type == MSI) {
+               err = request_irq((int) sp->pdev->irq, s2io_msi_handle,
+                       IRQF_SHARED, sp->name, dev);
+               if (err) {
+                       pci_disable_msi(sp->pdev);
+                       DBG_PRINT(ERR_DBG, "%s: MSI registration failed\n",
+                                 dev->name);
+                       return -1;
+               }
+       }
+       if (sp->intr_type == MSI_X) {
+               int i;
 
-                               free_irq(vector, arg);
+               for (i=1; (sp->s2io_entries[i].in_use == MSIX_FLG); i++) {
+                       if (sp->s2io_entries[i].type == MSIX_FIFO_TYPE) {
+                               sprintf(sp->desc[i], "%s:MSI-X-%d-TX",
+                                       dev->name, i);
+                               err = request_irq(sp->entries[i].vector,
+                                         s2io_msix_fifo_handle, 0, sp->desc[i],
+                                                 sp->s2io_entries[i].arg);
+                               DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc[i],
+                               (unsigned long long)sp->msix_info[i].addr);
+                       } else {
+                               sprintf(sp->desc[i], "%s:MSI-X-%d-RX",
+                                       dev->name, i);
+                               err = request_irq(sp->entries[i].vector,
+                                         s2io_msix_ring_handle, 0, sp->desc[i],
+                                                 sp->s2io_entries[i].arg);
+                               DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc[i],
+                               (unsigned long long)sp->msix_info[i].addr);
                        }
-                       pci_read_config_word(sp->pdev, 0x42, &msi_control);
-                       msi_control &= 0xFFFE; /* Disable MSI */
-                       pci_write_config_word(sp->pdev, 0x42, msi_control);
-                       pci_disable_msix(sp->pdev);
-               } else {
-                       free_irq(sp->pdev->irq, dev);
-                       if (sp->intr_type == MSI)
-                               pci_disable_msi(sp->pdev);
+                       if (err) {
+                               DBG_PRINT(ERR_DBG,"%s:MSI-X-%d registration "
+                                         "failed\n", dev->name, i);
+                               DBG_PRINT(ERR_DBG, "Returned: %d\n", err);
+                               return -1;
+                       }
+                       sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS;
+               }
+       }
+       if (sp->intr_type == INTA) {
+               err = request_irq((int) sp->pdev->irq, s2io_isr, IRQF_SHARED,
+                               sp->name, dev);
+               if (err) {
+                       DBG_PRINT(ERR_DBG, "%s: ISR registration failed\n",
+                                 dev->name);
+                       return -1;
+               }
+       }
+       return 0;
+}
+static void s2io_rem_isr(nic_t * sp)
+{
+       int cnt = 0;
+       struct net_device *dev = sp->dev;
+
+       if (sp->intr_type == MSI_X) {
+               int i;
+               u16 msi_control;
+
+               for (i=1; (sp->s2io_entries[i].in_use ==
+                       MSIX_REGISTERED_SUCCESS); i++) {
+                       int vector = sp->entries[i].vector;
+                       void *arg = sp->s2io_entries[i].arg;
+
+                       free_irq(vector, arg);
+               }
+               pci_read_config_word(sp->pdev, 0x42, &msi_control);
+               msi_control &= 0xFFFE; /* Disable MSI */
+               pci_write_config_word(sp->pdev, 0x42, msi_control);
+
+               pci_disable_msix(sp->pdev);
+       } else {
+               free_irq(sp->pdev->irq, dev);
+               if (sp->intr_type == MSI) {
+                       u16 val;
+
+                       pci_disable_msi(sp->pdev);
+                       pci_read_config_word(sp->pdev, 0x4c, &val);
+                       val ^= 0x1;
+                       pci_write_config_word(sp->pdev, 0x4c, val);
                }
        }
        /* Waiting till all Interrupt handlers are complete */
@@ -6263,6 +6233,26 @@ static void s2io_card_down(nic_t * sp, int flag)
                        break;
                cnt++;
        } while(cnt < 5);
+}
+
+static void s2io_card_down(nic_t * sp)
+{
+       int cnt = 0;
+       XENA_dev_config_t __iomem *bar0 = sp->bar0;
+       unsigned long flags;
+       register u64 val64 = 0;
+
+       del_timer_sync(&sp->alarm_timer);
+       /* If s2io_set_link task is executing, wait till it completes. */
+       while (test_and_set_bit(0, &(sp->link_state))) {
+               msleep(50);
+       }
+       atomic_set(&sp->card_state, CARD_DOWN);
+
+       /* disable Tx and Rx traffic on the NIC */
+       stop_nic(sp);
+
+       s2io_rem_isr(sp);
 
        /* Kill tasklet. */
        tasklet_kill(&sp->task);
@@ -6314,23 +6304,16 @@ static int s2io_card_up(nic_t * sp)
        mac_info_t *mac_control;
        struct config_param *config;
        struct net_device *dev = (struct net_device *) sp->dev;
+       u16 interruptible;
 
        /* Initialize the H/W I/O registers */
        if (init_nic(sp) != 0) {
                DBG_PRINT(ERR_DBG, "%s: H/W initialization failed\n",
                          dev->name);
+               s2io_reset(sp);
                return -ENODEV;
        }
 
-       if (sp->intr_type == MSI)
-               ret = s2io_enable_msi(sp);
-       else if (sp->intr_type == MSI_X)
-               ret = s2io_enable_msi_x(sp);
-       if (ret) {
-               DBG_PRINT(ERR_DBG, "%s: Defaulting to INTA\n", dev->name);
-               sp->intr_type = INTA;
-       }
-
        /*
         * Initializing the Rx buffers. For now we are considering only 1
         * Rx ring and initializing buffers into 30 Rx blocks
@@ -6361,21 +6344,39 @@ static int s2io_card_up(nic_t * sp)
                        sp->lro_max_aggr_per_sess = lro_max_pkts;
        }
 
-       /* Enable tasklet for the device */
-       tasklet_init(&sp->task, s2io_tasklet, (unsigned long) dev);
-
        /* Enable Rx Traffic and interrupts on the NIC */
        if (start_nic(sp)) {
                DBG_PRINT(ERR_DBG, "%s: Starting NIC failed\n", dev->name);
-               tasklet_kill(&sp->task);
                s2io_reset(sp);
-               free_irq(dev->irq, dev);
+               free_rx_buffers(sp);
+               return -ENODEV;
+       }
+
+       /* Add interrupt service routine */
+       if (s2io_add_isr(sp) != 0) {
+               if (sp->intr_type == MSI_X)
+                       s2io_rem_isr(sp);
+               s2io_reset(sp);
                free_rx_buffers(sp);
                return -ENODEV;
        }
 
        S2IO_TIMER_CONF(sp->alarm_timer, s2io_alarm_handle, sp, (HZ/2));
 
+       /* Enable tasklet for the device */
+       tasklet_init(&sp->task, s2io_tasklet, (unsigned long) dev);
+
+       /*  Enable select interrupts */
+       if (sp->intr_type != INTA)
+               en_dis_able_nic_intrs(sp, ENA_ALL_INTRS, DISABLE_INTRS);
+       else {
+               interruptible = TX_TRAFFIC_INTR | RX_TRAFFIC_INTR;
+               interruptible |= TX_PIC_INTR | RX_PIC_INTR;
+               interruptible |= TX_MAC_INTR | RX_MAC_INTR;
+               en_dis_able_nic_intrs(sp, interruptible, ENABLE_INTRS);
+       }
+
+
        atomic_set(&sp->card_state, CARD_UP);
        return 0;
 }
@@ -6395,7 +6396,7 @@ static void s2io_restart_nic(unsigned long data)
        struct net_device *dev = (struct net_device *) data;
        nic_t *sp = dev->priv;
 
-       s2io_card_down(sp, 0);
+       s2io_card_down(sp);
        if (s2io_card_up(sp)) {
                DBG_PRINT(ERR_DBG, "%s: Device bring up failed\n",
                          dev->name);
index c43f5217970833278ce36f80894fff52cf6cd2c3..217097bc22f159970e3a24fc05b3b43f1fd35374 100644 (file)
@@ -829,8 +829,7 @@ struct s2io_nic {
 #define MSIX_FLG                0xA5
        struct msix_entry *entries;
        struct s2io_msix_entry *s2io_entries;
-       char desc1[35];
-       char desc2[35];
+       char desc[MAX_REQUESTED_MSI_X][25];
 
        int avail_msix_vectors; /* No. of MSI-X vectors granted by system */
 
@@ -1002,7 +1001,7 @@ static int verify_xena_quiescence(nic_t *sp, u64 val64, int flag);
 static struct ethtool_ops netdev_ethtool_ops;
 static void s2io_set_link(unsigned long data);
 static int s2io_set_swapper(nic_t * sp);
-static void s2io_card_down(nic_t *nic, int flag);
+static void s2io_card_down(nic_t *nic);
 static int s2io_card_up(nic_t *nic);
 static int get_xena_rev_id(struct pci_dev *pdev);
 static void restore_xmsi_data(nic_t *nic);
index 2b19f8ad03185919e5478d1ee049a7f1d2da8701..7f8e6d0084c7a1b7503ad40f2c160af954d5a902 100644 (file)
@@ -1473,7 +1473,7 @@ extern "C" {
 #define GM_TXCR_FORCE_JAM      (1<<15) /* Bit 15:      Force Jam / Flow-Control */
 #define GM_TXCR_CRC_DIS                (1<<14) /* Bit 14:      Disable insertion of CRC */
 #define GM_TXCR_PAD_DIS                (1<<13) /* Bit 13:      Disable padding of packets */
-#define GM_TXCR_COL_THR_MSK    (1<<10) /* Bit 12..10:  Collision Threshold */
+#define GM_TXCR_COL_THR_MSK    (7<<10) /* Bit 12..10:  Collision Threshold */
 
 #define TX_COL_THR(x)          (SHIFT10(x) & GM_TXCR_COL_THR_MSK)
 
index ed19ff47ce1108dc0f6a3ac89935391f7c7fa961..593387b3c0dd039d9c44c33e29d5a471ce7769c6 100644 (file)
@@ -1734,11 +1734,11 @@ enum {
        GM_TXCR_FORCE_JAM       = 1<<15, /* Bit 15:     Force Jam / Flow-Control */
        GM_TXCR_CRC_DIS         = 1<<14, /* Bit 14:     Disable insertion of CRC */
        GM_TXCR_PAD_DIS         = 1<<13, /* Bit 13:     Disable padding of packets */
-       GM_TXCR_COL_THR_MSK     = 1<<10, /* Bit 12..10: Collision Threshold */
+       GM_TXCR_COL_THR_MSK     = 7<<10, /* Bit 12..10: Collision Threshold */
 };
 
 #define TX_COL_THR(x)          (((x)<<10) & GM_TXCR_COL_THR_MSK)
-#define TX_COL_DEF             0x04
+#define TX_COL_DEF             0x04    /* late collision after 64 byte */
 
 /*     GM_RX_CTRL                      16 bit r/w      Receive Control Register */
 enum {
index 31093760aa1e9534270e2d5a9c8746ce3ce46b14..d98f28c34e5cf1cdd23f6d6805ce430d8b5a72ae 100644 (file)
@@ -65,6 +65,7 @@
 #define RX_MAX_PENDING         (RX_LE_SIZE/2 - 2)
 #define RX_DEF_PENDING         RX_MAX_PENDING
 #define RX_SKB_ALIGN           8
+#define RX_BUF_WRITE           16
 
 #define TX_RING_SIZE           512
 #define TX_DEF_PENDING         (TX_RING_SIZE - 1)
@@ -234,7 +235,6 @@ static void sky2_set_power_state(struct sky2_hw *hw, pci_power_t state)
                }
 
                if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
-                       sky2_write16(hw, B0_CTST, Y2_HW_WOL_ON);
                        sky2_pci_write32(hw, PCI_DEV_REG3, 0);
                        reg1 = sky2_pci_read32(hw, PCI_DEV_REG4);
                        reg1 &= P_ASPM_CONTROL_MSK;
@@ -243,6 +243,7 @@ static void sky2_set_power_state(struct sky2_hw *hw, pci_power_t state)
                }
 
                sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
+               udelay(100);
 
                break;
 
@@ -255,6 +256,7 @@ static void sky2_set_power_state(struct sky2_hw *hw, pci_power_t state)
                else
                        reg1 |= (PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD);
                sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
+               udelay(100);
 
                if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1)
                        sky2_write8(hw, B2_Y2_CLK_GATE, 0);
@@ -1389,7 +1391,7 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
        }
 
        sky2->tx_cons = put;
-       if (tx_avail(sky2) > MAX_SKB_TX_LE)
+       if (tx_avail(sky2) > MAX_SKB_TX_LE + 4)
                netif_wake_queue(dev);
 }
 
@@ -1888,9 +1890,6 @@ resubmit:
        re->skb->ip_summed = CHECKSUM_NONE;
        sky2_rx_add(sky2, re->mapaddr);
 
-       /* Tell receiver about new buffers. */
-       sky2_put_idx(sky2->hw, rxqaddr[sky2->port], sky2->rx_put);
-
        return skb;
 
 oversize:
@@ -1937,7 +1936,9 @@ static inline int sky2_more_work(const struct sky2_hw *hw)
 /* Process status response ring */
 static int sky2_status_intr(struct sky2_hw *hw, int to_do)
 {
+       struct sky2_port *sky2;
        int work_done = 0;
+       unsigned buf_write[2] = { 0, 0 };
        u16 hwidx = sky2_read16(hw, STAT_PUT_IDX);
 
        rmb();
@@ -1945,7 +1946,6 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
        while (hw->st_idx != hwidx) {
                struct sky2_status_le *le  = hw->st_le + hw->st_idx;
                struct net_device *dev;
-               struct sky2_port *sky2;
                struct sk_buff *skb;
                u32 status;
                u16 length;
@@ -1978,6 +1978,14 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
 #endif
                                netif_receive_skb(skb);
 
+                       /* Update receiver after 16 frames */
+                       if (++buf_write[le->link] == RX_BUF_WRITE) {
+                               sky2_put_idx(hw, rxqaddr[le->link],
+                                            sky2->rx_put);
+                               buf_write[le->link] = 0;
+                       }
+
+                       /* Stop after net poll weight */
                        if (++work_done >= to_do)
                                goto exit_loop;
                        break;
@@ -2016,6 +2024,16 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
        }
 
 exit_loop:
+       if (buf_write[0]) {
+               sky2 = netdev_priv(hw->dev[0]);
+               sky2_put_idx(hw, Q_R1, sky2->rx_put);
+       }
+
+       if (buf_write[1]) {
+               sky2 = netdev_priv(hw->dev[1]);
+               sky2_put_idx(hw, Q_R2, sky2->rx_put);
+       }
+
        return work_done;
 }
 
@@ -2286,7 +2304,7 @@ static inline u32 sky2_clk2us(const struct sky2_hw *hw, u32 clk)
 }
 
 
-static int __devinit sky2_reset(struct sky2_hw *hw)
+static int sky2_reset(struct sky2_hw *hw)
 {
        u16 status;
        u8 t8, pmd_type;
@@ -3437,17 +3455,14 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
                return -EINVAL;
 
        del_timer_sync(&hw->idle_timer);
+       netif_poll_disable(hw->dev[0]);
 
        for (i = 0; i < hw->ports; i++) {
                struct net_device *dev = hw->dev[i];
 
-               if (dev) {
-                       if (!netif_running(dev))
-                               continue;
-
+               if (netif_running(dev)) {
                        sky2_down(dev);
                        netif_device_detach(dev);
-                       netif_poll_disable(dev);
                }
        }
 
@@ -3474,9 +3489,8 @@ static int sky2_resume(struct pci_dev *pdev)
 
        for (i = 0; i < hw->ports; i++) {
                struct net_device *dev = hw->dev[i];
-               if (dev && netif_running(dev)) {
+               if (netif_running(dev)) {
                        netif_device_attach(dev);
-                       netif_poll_enable(dev);
 
                        err = sky2_up(dev);
                        if (err) {
@@ -3488,6 +3502,7 @@ static int sky2_resume(struct pci_dev *pdev)
                }
        }
 
+       netif_poll_enable(hw->dev[0]);
        sky2_idle_start(hw);
 out:
        return err;
index 8a0bc5525f0a64e8024b58d550ed29c4357fc6f4..2db8d19b22d10e25ac33dc53a7b52dacb84cbe44 100644 (file)
@@ -1480,7 +1480,7 @@ enum {
        GM_TXCR_FORCE_JAM       = 1<<15, /* Bit 15:     Force Jam / Flow-Control */
        GM_TXCR_CRC_DIS         = 1<<14, /* Bit 14:     Disable insertion of CRC */
        GM_TXCR_PAD_DIS         = 1<<13, /* Bit 13:     Disable padding of packets */
-       GM_TXCR_COL_THR_MSK     = 1<<10, /* Bit 12..10: Collision Threshold */
+       GM_TXCR_COL_THR_MSK     = 7<<10, /* Bit 12..10: Collision Threshold */
 };
 
 #define TX_COL_THR(x)          (((x)<<10) & GM_TXCR_COL_THR_MSK)
index b4028049ed764215b07255f40d111e61ae49f6c4..4ec4b4d23ae5edc867113b8d27e4e638e1db25d4 100644 (file)
@@ -354,6 +354,24 @@ static inline void LPD7_SMC_outsw (unsigned char* a, int r,
 
 #define SMC_IRQ_FLAGS          (0)
 
+#elif  defined(CONFIG_ARCH_VERSATILE)
+
+#define SMC_CAN_USE_8BIT       1
+#define SMC_CAN_USE_16BIT      1
+#define SMC_CAN_USE_32BIT      1
+#define SMC_NOWAIT             1
+
+#define SMC_inb(a, r)          readb((a) + (r))
+#define SMC_inw(a, r)          readw((a) + (r))
+#define SMC_inl(a, r)          readl((a) + (r))
+#define SMC_outb(v, a, r)      writeb(v, (a) + (r))
+#define SMC_outw(v, a, r)      writew(v, (a) + (r))
+#define SMC_outl(v, a, r)      writel(v, (a) + (r))
+#define SMC_insl(a, r, p, l)   readsl((a) + (r), p, l)
+#define SMC_outsl(a, r, p, l)  writesl((a) + (r), p, l)
+
+#define SMC_IRQ_FLAGS          (0)
+
 #else
 
 #define SMC_CAN_USE_8BIT       1
index c92ac9fde0831ff6175f17bc45bfdb1876c158e3..2c09ec908a3fa94390df7db514cd9fa05a0ef593 100644 (file)
@@ -116,27 +116,33 @@ static inline void openwin(card_t *card, u8 page)
 #include "hd6457x.c"
 
 
+static inline void set_carrier(port_t *port)
+{
+       if (!sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD)
+               netif_carrier_on(port_to_dev(port));
+       else
+               netif_carrier_off(port_to_dev(port));
+}
+
+
 static void sca_msci_intr(port_t *port)
 {
-       struct net_device *dev = port_to_dev(port);
-       card_t* card = port_to_card(port);
-       u8 stat = sca_in(MSCI1_OFFSET + ST1, card); /* read MSCI ST1 status */
+       u8 stat = sca_in(MSCI1_OFFSET + ST1, port); /* read MSCI ST1 status */
 
        /* Reset MSCI TX underrun status bit */
-       sca_out(stat & ST1_UDRN, MSCI0_OFFSET + ST1, card);
+       sca_out(stat & ST1_UDRN, MSCI0_OFFSET + ST1, port);
 
        if (stat & ST1_UDRN) {
-               struct net_device_stats *stats = hdlc_stats(dev);
+               struct net_device_stats *stats = hdlc_stats(port_to_dev(port));
                stats->tx_errors++; /* TX Underrun error detected */
                stats->tx_fifo_errors++;
        }
 
        /* Reset MSCI CDCD status bit - uses ch#2 DCD input */
-       sca_out(stat & ST1_CDCD, MSCI1_OFFSET + ST1, card);
+       sca_out(stat & ST1_CDCD, MSCI1_OFFSET + ST1, port);
 
        if (stat & ST1_CDCD)
-               hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD),
-                                dev);
+               set_carrier(port);
 }
 
 
@@ -190,7 +196,7 @@ static int c101_open(struct net_device *dev)
        sca_out(IE1_UDRN, MSCI0_OFFSET + IE1, port);
        sca_out(IE0_TXINT, MSCI0_OFFSET + IE0, port);
 
-       hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD), dev);
+       set_carrier(port);
        printk(KERN_DEBUG "0x%X\n", sca_in(MSCI1_OFFSET + ST3, port));
 
        /* enable MSCI1 CDCD interrupt */
@@ -378,7 +384,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
        }
 
        sca_init_sync_port(card); /* Set up C101 memory */
-       hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD), dev);
+       set_carrier(card);
 
        printk(KERN_INFO "%s: Moxa C101 on IRQ%u,"
               " using %u TX + %u RX packets rings\n",
index d3743321a9777ccf7e4d50aa09db9bc2d1d36f00..dce2bb317b82bad854f880996c74345d3076a853 100644 (file)
@@ -168,6 +168,23 @@ static inline u32 buffer_offset(port_t *port, u16 desc, int transmit)
 }
 
 
+static inline void sca_set_carrier(port_t *port)
+{
+       if (!(sca_in(get_msci(port) + ST3, port_to_card(port)) & ST3_DCD)) {
+#ifdef DEBUG_LINK
+               printk(KERN_DEBUG "%s: sca_set_carrier on\n",
+                      port_to_dev(port)->name);
+#endif
+               netif_carrier_on(port_to_dev(port));
+       } else {
+#ifdef DEBUG_LINK
+               printk(KERN_DEBUG "%s: sca_set_carrier off\n",
+                      port_to_dev(port)->name);
+#endif
+               netif_carrier_off(port_to_dev(port));
+       }
+}
+
 
 static void sca_init_sync_port(port_t *port)
 {
@@ -237,9 +254,7 @@ static void sca_init_sync_port(port_t *port)
                        sca_out(DIR_BOFE, DIR_TX(phy_node(port)), card);
                }
        }
-
-       hdlc_set_carrier(!(sca_in(get_msci(port) + ST3, card) & ST3_DCD),
-                        port_to_dev(port));
+       sca_set_carrier(port);
 }
 
 
@@ -262,8 +277,7 @@ static inline void sca_msci_intr(port_t *port)
        }
 
        if (stat & ST1_CDCD)
-               hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD),
-                                port_to_dev(port));
+               sca_set_carrier(port);
 }
 #endif
 
@@ -566,7 +580,7 @@ static void sca_open(struct net_device *dev)
    - all DMA interrupts
 */
 
-       hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD), dev);
+       sca_set_carrier(port);
 
 #ifdef __HD64570_H
        /* MSCI TX INT and RX INT A IRQ enable */
index 1fd04662c4fce290534991bee6c8476dc8a7efcd..f289daba0c7b308408d84ea209054859973e5773 100644 (file)
@@ -192,9 +192,7 @@ static int cisco_rx(struct sk_buff *skb)
                                               "uptime %ud%uh%um%us)\n",
                                               dev->name, days, hrs,
                                               min, sec);
-#if 0
-                                       netif_carrier_on(dev);
-#endif
+                                       netif_dormant_off(dev);
                                        hdlc->state.cisco.up = 1;
                                }
                        }
@@ -227,9 +225,7 @@ static void cisco_timer(unsigned long arg)
                       hdlc->state.cisco.settings.timeout * HZ)) {
                hdlc->state.cisco.up = 0;
                printk(KERN_INFO "%s: Link down\n", dev->name);
-#if 0
-               netif_carrier_off(dev);
-#endif
+               netif_dormant_on(dev);
        }
 
        cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ,
@@ -265,10 +261,7 @@ static void cisco_stop(struct net_device *dev)
 {
        hdlc_device *hdlc = dev_to_hdlc(dev);
        del_timer_sync(&hdlc->state.cisco.timer);
-#if 0
-       if (netif_carrier_ok(dev))
-               netif_carrier_off(dev);
-#endif
+       netif_dormant_on(dev);
        hdlc->state.cisco.up = 0;
        hdlc->state.cisco.request_sent = 0;
 }
@@ -328,6 +321,7 @@ int hdlc_cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
                dev->type = ARPHRD_CISCO;
                dev->flags = IFF_POINTOPOINT | IFF_NOARP;
                dev->addr_len = 0;
+               netif_dormant_on(dev);
                return 0;
        }
 
index 523afe17564e20f1c728b98a9d148ec9d309aced..7bb737bbdeb96cf09b1628e31b51c50c58f25372 100644 (file)
@@ -301,7 +301,7 @@ static int pvc_open(struct net_device *dev)
        if (pvc->open_count++ == 0) {
                hdlc_device *hdlc = dev_to_hdlc(pvc->master);
                if (hdlc->state.fr.settings.lmi == LMI_NONE)
-                       pvc->state.active = hdlc->carrier;
+                       pvc->state.active = netif_carrier_ok(pvc->master);
 
                pvc_carrier(pvc->state.active, pvc);
                hdlc->state.fr.dce_changed = 1;
@@ -545,11 +545,7 @@ static void fr_set_link_state(int reliable, struct net_device *dev)
 
        hdlc->state.fr.reliable = reliable;
        if (reliable) {
-#if 0
-               if (!netif_carrier_ok(dev))
-                       netif_carrier_on(dev);
-#endif
-
+               netif_dormant_off(dev);
                hdlc->state.fr.n391cnt = 0; /* Request full status */
                hdlc->state.fr.dce_changed = 1;
 
@@ -562,11 +558,7 @@ static void fr_set_link_state(int reliable, struct net_device *dev)
                        }
                }
        } else {
-#if 0
-               if (netif_carrier_ok(dev))
-                       netif_carrier_off(dev);
-#endif
-
+               netif_dormant_on(dev);
                while (pvc) {           /* Deactivate all PVCs */
                        pvc_carrier(0, pvc);
                        pvc->state.exist = pvc->state.active = 0;
index b7da55140fbd854b54568cb84add8c1420fd7e8a..04ca1f7b64247c2a2b2c09c9182ba6ab728a88cc 100644 (file)
 #include <linux/inetdevice.h>
 #include <linux/lapb.h>
 #include <linux/rtnetlink.h>
+#include <linux/notifier.h>
 #include <linux/hdlc.h>
 
 
-static const char* version = "HDLC support module revision 1.18";
+static const char* version = "HDLC support module revision 1.19";
 
 #undef DEBUG_LINK
 
@@ -73,57 +74,51 @@ static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev,
 
 
 
-static void __hdlc_set_carrier_on(struct net_device *dev)
+static inline void hdlc_proto_start(struct net_device *dev)
 {
        hdlc_device *hdlc = dev_to_hdlc(dev);
        if (hdlc->proto.start)
                return hdlc->proto.start(dev);
-#if 0
-#ifdef DEBUG_LINK
-       if (netif_carrier_ok(dev))
-               printk(KERN_ERR "hdlc_set_carrier_on(): already on\n");
-#endif
-       netif_carrier_on(dev);
-#endif
 }
 
 
 
-static void __hdlc_set_carrier_off(struct net_device *dev)
+static inline void hdlc_proto_stop(struct net_device *dev)
 {
        hdlc_device *hdlc = dev_to_hdlc(dev);
        if (hdlc->proto.stop)
                return hdlc->proto.stop(dev);
-
-#if 0
-#ifdef DEBUG_LINK
-       if (!netif_carrier_ok(dev))
-               printk(KERN_ERR "hdlc_set_carrier_off(): already off\n");
-#endif
-       netif_carrier_off(dev);
-#endif
 }
 
 
 
-void hdlc_set_carrier(int on, struct net_device *dev)
+static int hdlc_device_event(struct notifier_block *this, unsigned long event,
+                            void *ptr)
 {
-       hdlc_device *hdlc = dev_to_hdlc(dev);
+       struct net_device *dev = ptr;
+       hdlc_device *hdlc;
        unsigned long flags;
-       on = on ? 1 : 0;
+       int on;
+       if (dev->get_stats != hdlc_get_stats)
+               return NOTIFY_DONE; /* not an HDLC device */
+       if (event != NETDEV_CHANGE)
+               return NOTIFY_DONE; /* Only interrested in carrier changes */
+
+       on = netif_carrier_ok(dev);
 
 #ifdef DEBUG_LINK
-       printk(KERN_DEBUG "hdlc_set_carrier %i\n", on);
+       printk(KERN_DEBUG "%s: hdlc_device_event NETDEV_CHANGE, carrier %i\n",
+              dev->name, on);
 #endif
 
+       hdlc = dev_to_hdlc(dev);
        spin_lock_irqsave(&hdlc->state_lock, flags);
 
        if (hdlc->carrier == on)
                goto carrier_exit; /* no change in DCD line level */
 
-#ifdef DEBUG_LINK
-       printk(KERN_INFO "%s: carrier %s\n", dev->name, on ? "ON" : "off");
-#endif
        hdlc->carrier = on;
 
        if (!hdlc->open)
@@ -131,14 +126,15 @@ void hdlc_set_carrier(int on, struct net_device *dev)
 
        if (hdlc->carrier) {
                printk(KERN_INFO "%s: Carrier detected\n", dev->name);
-               __hdlc_set_carrier_on(dev);
+               hdlc_proto_start(dev);
        } else {
                printk(KERN_INFO "%s: Carrier lost\n", dev->name);
-               __hdlc_set_carrier_off(dev);
+               hdlc_proto_stop(dev);
        }
 
 carrier_exit:
        spin_unlock_irqrestore(&hdlc->state_lock, flags);
+       return NOTIFY_DONE;
 }
 
 
@@ -165,7 +161,7 @@ int hdlc_open(struct net_device *dev)
 
        if (hdlc->carrier) {
                printk(KERN_INFO "%s: Carrier detected\n", dev->name);
-               __hdlc_set_carrier_on(dev);
+               hdlc_proto_start(dev);
        } else
                printk(KERN_INFO "%s: No carrier\n", dev->name);
 
@@ -190,7 +186,7 @@ void hdlc_close(struct net_device *dev)
 
        hdlc->open = 0;
        if (hdlc->carrier)
-               __hdlc_set_carrier_off(dev);
+               hdlc_proto_stop(dev);
 
        spin_unlock_irq(&hdlc->state_lock);
 
@@ -303,7 +299,6 @@ MODULE_LICENSE("GPL v2");
 
 EXPORT_SYMBOL(hdlc_open);
 EXPORT_SYMBOL(hdlc_close);
-EXPORT_SYMBOL(hdlc_set_carrier);
 EXPORT_SYMBOL(hdlc_ioctl);
 EXPORT_SYMBOL(hdlc_setup);
 EXPORT_SYMBOL(alloc_hdlcdev);
@@ -315,9 +310,18 @@ static struct packet_type hdlc_packet_type = {
 };
 
 
+static struct notifier_block hdlc_notifier = {
+        .notifier_call = hdlc_device_event,
+};
+
+
 static int __init hdlc_module_init(void)
 {
+       int result;
+
        printk(KERN_INFO "%s\n", version);
+       if ((result = register_netdevice_notifier(&hdlc_notifier)) != 0)
+                return result;
         dev_add_pack(&hdlc_packet_type);
        return 0;
 }
@@ -327,6 +331,7 @@ static int __init hdlc_module_init(void)
 static void __exit hdlc_module_exit(void)
 {
        dev_remove_pack(&hdlc_packet_type);
+       unregister_netdevice_notifier(&hdlc_notifier);
 }
 
 
index d564224cdca90494046fda6e51a95a9f6c99e25c..b2031dfc4bb1076426d9c0d45ebc1472eda449b3 100644 (file)
@@ -149,7 +149,10 @@ static inline void wanxl_cable_intr(port_t *port)
        printk(KERN_INFO "%s: %s%s module, %s cable%s%s\n",
               port->dev->name, pm, dte, cable, dsr, dcd);
 
-       hdlc_set_carrier(value & STATUS_CABLE_DCD, port->dev);
+       if (value & STATUS_CABLE_DCD)
+               netif_carrier_on(port->dev);
+       else
+               netif_carrier_off(port->dev);
 }
 
 
index e1c5a939bca40cef9e54d9d51ac447c612b41937..3889f79e7128b1e5ab0bc1566d3d936c9c394395 100644 (file)
@@ -1547,7 +1547,7 @@ static void handle_irq_noise(struct bcm43xx_private *bcm)
                goto generate_new;
 
        /* Get the noise samples. */
-       assert(bcm->noisecalc.nr_samples <= 8);
+       assert(bcm->noisecalc.nr_samples < 8);
        i = bcm->noisecalc.nr_samples;
        noise[0] = limit_value(noise[0], 0, ARRAY_SIZE(radio->nrssi_lt) - 1);
        noise[1] = limit_value(noise[1], 0, ARRAY_SIZE(radio->nrssi_lt) - 1);
index ce1cb2c6aa8d3833567593860b22c6598f879feb..72f90525bf681a00b724ed171ee0ba708dc2e9c9 100644 (file)
@@ -375,10 +375,8 @@ static void int_urb_complete(struct urb *urb, struct pt_regs *pt_regs)
        case -ENODEV:
        case -ENOENT:
        case -ECONNRESET:
-               goto kfree;
        case -EPIPE:
-               usb_clear_halt(urb->dev, EP_INT_IN);
-               /* FALL-THROUGH */
+               goto kfree;
        default:
                goto resubmit;
        }
@@ -580,10 +578,8 @@ static void rx_urb_complete(struct urb *urb, struct pt_regs *pt_regs)
        case -ENODEV:
        case -ENOENT:
        case -ECONNRESET:
-               return;
        case -EPIPE:
-               usb_clear_halt(urb->dev, EP_DATA_IN);
-               /* FALL-THROUGH */
+               return;
        default:
                dev_dbg_f(urb_dev(urb), "urb %p error %d\n", urb, urb->status);
                goto resubmit;
@@ -749,11 +745,9 @@ static void tx_urb_complete(struct urb *urb, struct pt_regs *pt_regs)
        case -ENODEV:
        case -ENOENT:
        case -ECONNRESET:
+       case -EPIPE:
                dev_dbg_f(urb_dev(urb), "urb %p error %d\n", urb, urb->status);
                break;
-       case -EPIPE:
-               usb_clear_halt(urb->dev, EP_DATA_OUT);
-               /* FALL-THROUGH */
        default:
                dev_dbg_f(urb_dev(urb), "urb %p error %d\n", urb, urb->status);
                goto resubmit;
index 36bc7c415af7a8dfe8b0d394dc64913577d6ad96..a83c1f5735d69bc05418e5963dbbcbc975a06a11 100644 (file)
@@ -47,13 +47,13 @@ msi_register(struct msi_ops *ops)
 
 static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags)
 {
-       memset(p, 0, NR_IRQS * sizeof(struct msi_desc));
+       memset(p, 0, sizeof(struct msi_desc));
 }
 
 static int msi_cache_init(void)
 {
        msi_cachep = kmem_cache_create("msi_cache",
-                       NR_IRQS * sizeof(struct msi_desc),
+                       sizeof(struct msi_desc),
                        0, SLAB_HWCACHE_ALIGN, msi_cache_ctor, NULL);
        if (!msi_cachep)
                return -ENOMEM;
index cf57d7de3765fcceb37216501c0ace480cc95fa2..9f79dd6d51ab7b8b0fbe18ab77f20fd0630e81ee 100644 (file)
@@ -19,6 +19,7 @@
 #include <asm/dma.h>   /* isa_dma_bridge_buggy */
 #include "pci.h"
 
+unsigned int pci_pm_d3_delay = 10;
 
 /**
  * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children
@@ -313,6 +314,14 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
        } else if (dev->current_state == state)
                return 0;        /* we're already there */
 
+       /*
+        * If the device or the parent bridge can't support PCI PM, ignore
+        * the request if we're doing anything besides putting it into D0
+        * (which would only happen on boot).
+        */
+       if ((state == PCI_D1 || state == PCI_D2) && pci_no_d1d2(dev))
+               return 0;
+
        /* find PCI PM capability in list */
        pm = pci_find_capability(dev, PCI_CAP_ID_PM);
        
@@ -363,7 +372,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
        /* Mandatory power management transition delays */
        /* see PCI PM 1.1 5.6.1 table 18 */
        if (state == PCI_D3hot || dev->current_state == PCI_D3hot)
-               msleep(10);
+               msleep(pci_pm_d3_delay);
        else if (state == PCI_D2 || dev->current_state == PCI_D2)
                udelay(200);
 
index 9cc842b666eb1d1d43fc24f9b06b2a3dd3a2f491..08d58fc78ee1cafc522702fd26618e4b43d66a4f 100644 (file)
@@ -47,7 +47,7 @@ extern int pci_msi_quirk;
 #else
 #define pci_msi_quirk 0
 #endif
-
+extern unsigned int pci_pm_d3_delay;
 #ifdef CONFIG_PCI_MSI
 void disable_msi_mode(struct pci_dev *dev, int pos, int type);
 void pci_no_msi(void);
@@ -66,7 +66,15 @@ static inline int pci_save_msix_state(struct pci_dev *dev) { return 0; }
 static inline void pci_restore_msi_state(struct pci_dev *dev) {}
 static inline void pci_restore_msix_state(struct pci_dev *dev) {}
 #endif
+static inline int pci_no_d1d2(struct pci_dev *dev)
+{
+       unsigned int parent_dstates = 0;
 
+       if (dev->bus->self)
+               parent_dstates = dev->bus->self->no_d1d2;
+       return (dev->no_d1d2 || parent_dstates);
+
+}
 extern int pcie_mch_quirk;
 extern struct device_attribute pci_dev_attrs[];
 extern struct class_device_attribute class_device_attr_cpuaffinity;
index d1d7333bb71bf17502c0ffd9f0aa2491f2f504ec..e3c78c39b7e49236377bc6b3f25dde5413731d9d 100644 (file)
@@ -400,6 +400,7 @@ static void __devinit quirk_piix4_acpi(struct pci_dev *dev)
        piix4_io_quirk(dev, "PIIX4 devres J", 0x7c, 1 << 20);
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82371AB_3,  quirk_piix4_acpi );
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82443MX_3,  quirk_piix4_acpi );
 
 /*
  * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at
@@ -682,6 +683,33 @@ static void __devinit quirk_vt82c598_id(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,    PCI_DEVICE_ID_VIA_82C597_0,     quirk_vt82c598_id );
 
+#ifdef CONFIG_ACPI_SLEEP
+
+/*
+ * Some VIA systems boot with the abnormal status flag set. This can cause
+ * the BIOS to re-POST the system on resume rather than passing control
+ * back to the OS.  Clear the flag on boot
+ */
+static void __devinit quirk_via_abnormal_poweroff(struct pci_dev *dev)
+{
+       u32 reg;
+
+       acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS,
+                               &reg);
+
+       if (reg & 0x800) {
+               printk("Clearing abnormal poweroff flag\n");
+               acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
+                                       ACPI_REGISTER_PM1_STATUS,
+                                       (u16)0x800);
+       }
+}
+
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_via_abnormal_poweroff);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_abnormal_poweroff);
+
+#endif
+
 /*
  * CardBus controllers have a legacy base address that enables them
  * to respond as i82365 pcmcia controllers.  We don't want them to
@@ -1174,6 +1202,55 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI,       PCI_DEVICE_ID_SI_962,           quirk_sis_96x_
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI,     PCI_DEVICE_ID_SI_963,           quirk_sis_96x_smbus );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI,     PCI_DEVICE_ID_SI_LPC,           quirk_sis_96x_smbus );
 
+#if defined(CONFIG_SCSI_SATA) || defined(CONFIG_SCSI_SATA_MODULE)
+
+/*
+ *     If we are using libata we can drive this chip properly but must
+ *     do this early on to make the additional device appear during
+ *     the PCI scanning.
+ */
+
+static void __devinit quirk_jmicron_dualfn(struct pci_dev *pdev)
+{
+       u32 conf;
+       u8 hdr;
+
+       /* Only poke fn 0 */
+       if (PCI_FUNC(pdev->devfn))
+               return;
+
+       switch(pdev->device) {
+               case PCI_DEVICE_ID_JMICRON_JMB365:
+               case PCI_DEVICE_ID_JMICRON_JMB366:
+                       /* Redirect IDE second PATA port to the right spot */
+                       pci_read_config_dword(pdev, 0x80, &conf);
+                       conf |= (1 << 24);
+                       /* Fall through */
+                       pci_write_config_dword(pdev, 0x80, conf);
+               case PCI_DEVICE_ID_JMICRON_JMB361:
+               case PCI_DEVICE_ID_JMICRON_JMB363:
+                       pci_read_config_dword(pdev, 0x40, &conf);
+                       /* Enable dual function mode, AHCI on fn 0, IDE fn1 */
+                       /* Set the class codes correctly and then direct IDE 0 */
+                       conf &= ~0x000F0200;    /* Clear bit 9 and 16-19 */
+                       conf |=  0x00C20002;    /* Set bit 1, 17, 22, 23 */
+                       pci_write_config_dword(pdev, 0x40, conf);
+
+                       /* Reconfigure so that the PCI scanner discovers the
+                          device is now multifunction */
+
+                       pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr);
+                       pdev->hdr_type = hdr & 0x7f;
+                       pdev->multifunction = !!(hdr & 0x80);
+
+                       break;
+       }
+}
+
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, quirk_jmicron_dualfn);
+
+#endif
+
 #ifdef CONFIG_X86_IO_APIC
 static void __init quirk_alder_ioapic(struct pci_dev *pdev)
 {
@@ -1341,6 +1418,37 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL,     PCI_DEVICE_ID_INTEL_PXH_0,      quirk_pc
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_PXH_1,      quirk_pcie_pxh);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_PXHV,       quirk_pcie_pxh);
 
+/*
+ * Some Intel PCI Express chipsets have trouble with downstream
+ * device power management.
+ */
+static void quirk_intel_pcie_pm(struct pci_dev * dev)
+{
+       pci_pm_d3_delay = 120;
+       dev->no_d1d2 = 1;
+}
+
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x25e2, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x25e3, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x25e4, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x25e5, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x25e6, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x25e7, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x25f7, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x25f8, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x25f9, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x25fa, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x2601, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x2602, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x2603, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x2604, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x2605, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x2606, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x2607, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x2608, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x2609, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x260a, quirk_intel_pcie_pm);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   0x260b, quirk_intel_pcie_pm);
 
 /*
  * Fixup the cardbus bridges on the IBM Dock II docking station
index d7295386821cb39884811519a1262c47c9b1c345..7f6fdac747068c84a22014b34ffa619643041d4e 100644 (file)
@@ -394,7 +394,7 @@ dasd_add_busid(char *bus_id, int features)
        if (!new)
                return ERR_PTR(-ENOMEM);
        spin_lock(&dasd_devmap_lock);
-       devmap = 0;
+       devmap = NULL;
        hash = dasd_hash_busid(bus_id);
        list_for_each_entry(tmp, &dasd_hashlists[hash], list)
                if (strncmp(tmp->bus_id, bus_id, BUS_ID_SIZE) == 0) {
@@ -406,10 +406,10 @@ dasd_add_busid(char *bus_id, int features)
                new->devindex = dasd_max_devindex++;
                strncpy(new->bus_id, bus_id, BUS_ID_SIZE);
                new->features = features;
-               new->device = 0;
+               new->device = NULL;
                list_add(&new->list, &dasd_hashlists[hash]);
                devmap = new;
-               new = 0;
+               new = NULL;
        }
        spin_unlock(&dasd_devmap_lock);
        kfree(new);
@@ -479,7 +479,7 @@ dasd_device_from_devindex(int devindex)
        int i;
 
        spin_lock(&dasd_devmap_lock);
-       devmap = 0;
+       devmap = NULL;
        for (i = 0; (i < 256) && !devmap; i++)
                list_for_each_entry(tmp, &dasd_hashlists[i], list)
                        if (tmp->devindex == devindex) {
index 2e655f466743e32c5f7f1b72f6e48a016215440d..39c2281371b5e75a1d7f15272e1de9ecf89f9a18 100644 (file)
@@ -65,16 +65,16 @@ struct dasd_eckd_private {
 /* The ccw bus type uses this table to find devices that it sends to
  * dasd_eckd_probe */
 static struct ccw_device_id dasd_eckd_ids[] = {
-       { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3390, 0), driver_info: 0x1},
-       { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3390, 0), driver_info: 0x2},
-       { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3390, 0), driver_info: 0x3},
-       { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3380, 0), driver_info: 0x4},
-       { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3380, 0), driver_info: 0x5},
-       { CCW_DEVICE_DEVTYPE (0x9343, 0, 0x9345, 0), driver_info: 0x6},
-       { CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3390, 0), driver_info: 0x7},
-       { CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3380, 0), driver_info: 0x8},
-       { CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3390, 0), driver_info: 0x9},
-       { CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3380, 0), driver_info: 0xa},
+       { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3390, 0), .driver_info = 0x1},
+       { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3390, 0), .driver_info = 0x2},
+       { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3390, 0), .driver_info = 0x3},
+       { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3380, 0), .driver_info = 0x4},
+       { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3380, 0), .driver_info = 0x5},
+       { CCW_DEVICE_DEVTYPE (0x9343, 0, 0x9345, 0), .driver_info = 0x6},
+       { CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3390, 0), .driver_info = 0x7},
+       { CCW_DEVICE_DEVTYPE (0x2107, 0, 0x3380, 0), .driver_info = 0x8},
+       { CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3390, 0), .driver_info = 0x9},
+       { CCW_DEVICE_DEVTYPE (0x1750, 0, 0x3380, 0), .driver_info = 0xa},
        { /* end of list */ },
 };
 
index 808434d38526a6b30504ee48ff060b6defdb08f1..e85015be109bb918366a62c83fec616512a6bb30 100644 (file)
@@ -44,8 +44,8 @@ struct dasd_fba_private {
 };
 
 static struct ccw_device_id dasd_fba_ids[] = {
-       { CCW_DEVICE_DEVTYPE (0x6310, 0, 0x9336, 0), driver_info: 0x1},
-       { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3370, 0), driver_info: 0x2},
+       { CCW_DEVICE_DEVTYPE (0x6310, 0, 0x9336, 0), .driver_info = 0x1},
+       { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3370, 0), .driver_info = 0x2},
        { /* end of list */ },
 };
 
index 12c7d296eaa8a6bcbb9268d4b38494e1e5a68535..4c272b70f41a130ba1325511c309c44dc2dd1921 100644 (file)
@@ -84,9 +84,9 @@ void
 dasd_gendisk_free(struct dasd_device *device)
 {
        del_gendisk(device->gdp);
-       device->gdp->queue = 0;
+       device->gdp->queue = NULL;
        put_disk(device->gdp);
-       device->gdp = 0;
+       device->gdp = NULL;
 }
 
 /*
@@ -136,7 +136,7 @@ dasd_destroy_partitions(struct dasd_device * device)
         * device->bdev to lower the offline open_count limit again.
         */
        bdev = device->bdev;
-       device->bdev = 0;
+       device->bdev = NULL;
 
        /*
         * See fs/partition/check.c:delete_partition
@@ -145,7 +145,7 @@ dasd_destroy_partitions(struct dasd_device * device)
         */
        memset(&bpart, 0, sizeof(struct blkpg_partition));
        memset(&barg, 0, sizeof(struct blkpg_ioctl_arg));
-       barg.data = &bpart;
+       barg.data = (void __user *) &bpart;
        barg.op = BLKPG_DEL_PARTITION;
        for (bpart.pno = device->gdp->minors - 1; bpart.pno > 0; bpart.pno--)
                ioctl_by_bdev(bdev, BLKPG, (unsigned long) &barg);
index e97f5316ad2d5629c7986c87bd17051d9c0d0d2b..8fed3603e9eac2afe7163b76011e3e18b0084855 100644 (file)
@@ -345,7 +345,7 @@ dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp)
        if (bdev != bdev->bd_contains)
                // ro setting is not allowed for partitions
                return -EINVAL;
-       if (get_user(intval, (int *)argp))
+       if (get_user(intval, (int __user *)argp))
                return -EFAULT;
 
        set_disk_ro(bdev->bd_disk, intval);
index 4c1e56b9b98dbaafa5b85cc6d74138489112248f..4cd879cb9bdd86fa1c5b3031a13bdc2e26a21928 100644 (file)
@@ -71,11 +71,11 @@ static int xpram_devs;
 /*
  * Parameter parsing functions.
  */
-static int devs = XPRAM_DEVS;
-static unsigned int sizes[XPRAM_MAX_DEVS];
+static int __initdata devs = XPRAM_DEVS;
+static char __initdata *sizes[XPRAM_MAX_DEVS];
 
 module_param(devs, int, 0);
-module_param_array(sizes, int, NULL, 0);
+module_param_array(sizes, charp, NULL, 0);
 
 MODULE_PARM_DESC(devs, "number of devices (\"partitions\"), " \
                 "the default is " __MODULE_STRING(XPRAM_DEVS) "\n");
@@ -86,59 +86,6 @@ MODULE_PARM_DESC(sizes, "list of device (partition) sizes " \
                 "claimed by explicit sizes\n");
 MODULE_LICENSE("GPL");
 
-#ifndef MODULE
-/*
- * Parses the kernel parameters given in the kernel parameter line.
- * The expected format is
- *           <number_of_partitions>[","<partition_size>]*
- * where
- *           devices is a positive integer that initializes xpram_devs
- *           each size is a non-negative integer possibly followed by a
- *           magnitude (k,K,m,M,g,G), the list of sizes initialises
- *           xpram_sizes
- *
- * Arguments
- *           str: substring of kernel parameter line that contains xprams
- *                kernel parameters.
- *
- * Result    0 on success, -EINVAL else -- only for Version > 2.3
- *
- * Side effects
- *           the global variabls devs is set to the value of
- *           <number_of_partitions> and sizes[i] is set to the i-th
- *           partition size (if provided). A parsing error of a value
- *           results in this value being set to -EINVAL.
- */
-static int __init xpram_setup (char *str)
-{
-       char *cp;
-       int i;
-
-       devs = simple_strtoul(str, &cp, 10);
-       if (cp <= str || devs > XPRAM_MAX_DEVS)
-               return 0;
-       for (i = 0; (i < devs) && (*cp++ == ','); i++) {
-               sizes[i] = simple_strtoul(cp, &cp, 10);
-               if (*cp == 'g' || *cp == 'G') {
-                       sizes[i] <<= 20;
-                       cp++;
-               } else if (*cp == 'm' || *cp == 'M') {
-                       sizes[i] <<= 10;
-                       cp++;
-               } else if (*cp == 'k' || *cp == 'K')
-                       cp++;
-               while (isspace(*cp)) cp++;
-       }
-       if (*cp == ',' && i >= devs)
-               PRINT_WARN("partition sizes list has too many entries.\n");
-       else if (*cp != 0)
-               PRINT_WARN("ignored '%s' at end of parameter string.\n", cp);
-       return 1;
-}
-
-__setup("xpram_parts=", xpram_setup);
-#endif
-
 /*
  * Copy expanded memory page (4kB) into main memory                  
  * Arguments                                                         
@@ -374,7 +321,9 @@ static int __init xpram_setup_sizes(unsigned long pages)
        mem_needed = 0;
        mem_auto_no = 0;
        for (i = 0; i < xpram_devs; i++) {
-               xpram_sizes[i] = (sizes[i] + 3) & -4UL;
+               if (sizes[i])
+                       xpram_sizes[i] =
+                               (memparse(sizes[i], &sizes[i]) + 3) & -4UL;
                if (xpram_sizes[i])
                        mem_needed += xpram_sizes[i];
                else
index f25c6d116f6f6f8a130d84501c5e4ea348e560f2..2fa566fa6da4e287488fda979f2d3b72fe552f38 100644 (file)
@@ -693,7 +693,7 @@ raw3215_probe (struct ccw_device *cdev)
                                       GFP_KERNEL|GFP_DMA);
        if (raw->buffer == NULL) {
                spin_lock(&raw3215_device_lock);
-               raw3215[line] = 0;
+               raw3215[line] = NULL;
                spin_unlock(&raw3215_device_lock);
                kfree(raw);
                return -ENOMEM;
index 0ea6f36a25277862234b3045f35fa6d70689baa6..d83eb6358bac503f6a12d30ec533e9023dc458ba 100644 (file)
@@ -23,7 +23,7 @@ ctrlchar_handle_sysrq(void *tty)
        handle_sysrq(ctrlchar_sysrq_key, NULL, (struct tty_struct *) tty);
 }
 
-static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq, 0);
+static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq, NULL);
 #endif
 
 
index ca15adb140d1a3752b063eddfd07a4dbf95f3cda..17027d918cf78e435821b3fe56f5ebb4d002f9ab 100644 (file)
@@ -83,8 +83,8 @@ static u_short shift_ctrl_map[NR_KEYS] = {
 };
 
 ushort *key_maps[MAX_NR_KEYMAPS] = {
-       plain_map, shift_map, 0, 0,
-       ctrl_map, shift_ctrl_map,       0
+       plain_map, shift_map, NULL, NULL,
+       ctrl_map, shift_ctrl_map, NULL,
 };
 
 unsigned int keymap_count = 4;
@@ -145,7 +145,7 @@ char *func_table[MAX_NR_FUNC] = {
        func_buf + 97,
        func_buf + 103,
        func_buf + 109,
-       0,
+       NULL,
 };
 
 struct kbdiacr accent_table[MAX_DIACR] = {
index 6099c14de42910319141ec492b6ada8bc1b8da9f..ef004d089712bc8a0420e204fc3d597fbfb05343 100644 (file)
@@ -236,7 +236,7 @@ fs3270_irq(struct fs3270 *fp, struct raw3270_request *rq, struct irb *irb)
  * Process reads from fullscreen 3270.
  */
 static ssize_t
-fs3270_read(struct file *filp, char *data, size_t count, loff_t *off)
+fs3270_read(struct file *filp, char __user *data, size_t count, loff_t *off)
 {
        struct fs3270 *fp;
        struct raw3270_request *rq;
@@ -281,7 +281,7 @@ fs3270_read(struct file *filp, char *data, size_t count, loff_t *off)
  * Process writes to fullscreen 3270.
  */
 static ssize_t
-fs3270_write(struct file *filp, const char *data, size_t count, loff_t *off)
+fs3270_write(struct file *filp, const char __user *data, size_t count, loff_t *off)
 {
        struct fs3270 *fp;
        struct raw3270_request *rq;
@@ -338,10 +338,10 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                fp->write_command = arg;
                break;
        case TUBGETI:
-               rc = put_user(fp->read_command, (char *) arg);
+               rc = put_user(fp->read_command, (char __user *) arg);
                break;
        case TUBGETO:
-               rc = put_user(fp->write_command,(char *) arg);
+               rc = put_user(fp->write_command,(char __user *) arg);
                break;
        case TUBGETMOD:
                iocb.model = fp->view.model;
@@ -350,7 +350,7 @@ fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                iocb.pf_cnt = 24;
                iocb.re_cnt = 20;
                iocb.map = 0;
-               if (copy_to_user((char *) arg, &iocb,
+               if (copy_to_user((char __user *) arg, &iocb,
                                 sizeof(struct raw3270_iocb)))
                        rc = -EFAULT;
                break;
@@ -479,7 +479,7 @@ fs3270_close(struct inode *inode, struct file *filp)
        struct fs3270 *fp;
 
        fp = filp->private_data;
-       filp->private_data = 0;
+       filp->private_data = NULL;
        if (fp) {
                fp->fs_pid = 0;
                raw3270_reset(&fp->view);
index 547ef906ae2c7839c7751c4d54ed3317b6f2880e..3be06569180de398d936796111a07d49753a48ca 100644 (file)
@@ -103,7 +103,7 @@ out_maps:
 out_kbd:
        kfree(kbd);
 out:
-       return 0;
+       return NULL;
 }
 
 void
@@ -304,7 +304,7 @@ kbd_keycode(struct kbd_data *kbd, unsigned int keycode)
                if (kbd->sysrq) {
                        if (kbd->sysrq == K(KT_LATIN, '-')) {
                                kbd->sysrq = 0;
-                               handle_sysrq(value, 0, kbd->tty);
+                               handle_sysrq(value, NULL, kbd->tty);
                                return;
                        }
                        if (value == '-') {
@@ -363,7 +363,7 @@ do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry __user *user_kbe,
                        /* disallocate map */
                        key_map = kbd->key_maps[tmp.kb_table];
                        if (key_map) {
-                           kbd->key_maps[tmp.kb_table] = 0;
+                           kbd->key_maps[tmp.kb_table] = NULL;
                            kfree(key_map);
                        }
                        break;
index e95b56f810dbb25e1e4aea8730e6fa271c1bbcd3..95e285b2e25c704653a1d3d4f9f307185ee4151c 100644 (file)
@@ -555,7 +555,7 @@ raw3270_start_init(struct raw3270 *rp, struct raw3270_view *view,
 #ifdef CONFIG_TN3270_CONSOLE
        if (raw3270_registered == 0) {
                spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags);
-               rq->callback = 0;
+               rq->callback = NULL;
                rc = __raw3270_start(rp, view, rq);
                if (rc == 0)
                        while (!raw3270_request_final(rq)) {
@@ -719,8 +719,8 @@ raw3270_size_device(struct raw3270 *rp)
                rc = __raw3270_size_device_vm(rp);
        else
                rc = __raw3270_size_device(rp);
-       raw3270_init_view.dev = 0;
-       rp->view = 0;
+       raw3270_init_view.dev = NULL;
+       rp->view = NULL;
        up(&raw3270_init_sem);
        if (rc == 0) {  /* Found something. */
                /* Try to find a model. */
@@ -761,8 +761,8 @@ raw3270_reset_device(struct raw3270 *rp)
        rp->view = &raw3270_init_view;
        raw3270_init_view.dev = rp;
        rc = raw3270_start_init(rp, &raw3270_init_view, &rp->init_request);
-       raw3270_init_view.dev = 0;
-       rp->view = 0;
+       raw3270_init_view.dev = NULL;
+       rp->view = NULL;
        up(&raw3270_init_sem);
        return rc;
 }
@@ -934,7 +934,7 @@ raw3270_activate_view(struct raw3270_view *view)
        else if (!test_bit(RAW3270_FLAGS_READY, &rp->flags))
                rc = -ENODEV;
        else {
-               oldview = 0;
+               oldview = NULL;
                if (rp->view) {
                        oldview = rp->view;
                        oldview->fn->deactivate(oldview);
@@ -951,7 +951,7 @@ raw3270_activate_view(struct raw3270_view *view)
                                                rp->view = nv;
                                                if (nv->fn->activate(nv) == 0)
                                                        break;
-                                               rp->view = 0;
+                                               rp->view = NULL;
                                        }
                        }
                }
@@ -975,7 +975,7 @@ raw3270_deactivate_view(struct raw3270_view *view)
        spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
        if (rp->view == view) {
                view->fn->deactivate(view);
-               rp->view = 0;
+               rp->view = NULL;
                /* Move deactivated view to end of list. */
                list_del_init(&view->list);
                list_add_tail(&view->list, &rp->view_list);
@@ -985,7 +985,7 @@ raw3270_deactivate_view(struct raw3270_view *view)
                                rp->view = view;
                                if (view->fn->activate(view) == 0)
                                        break;
-                               rp->view = 0;
+                               rp->view = NULL;
                        }
                }
        }
@@ -1076,7 +1076,7 @@ raw3270_del_view(struct raw3270_view *view)
        spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
        if (rp->view == view) {
                view->fn->deactivate(view);
-               rp->view = 0;
+               rp->view = NULL;
        }
        list_del_init(&view->list);
        if (!rp->view && test_bit(RAW3270_FLAGS_READY, &rp->flags)) {
@@ -1117,9 +1117,9 @@ raw3270_delete_device(struct raw3270 *rp)
 
        /* Disconnect from ccw_device. */
        cdev = rp->cdev;
-       rp->cdev = 0;
-       cdev->dev.driver_data = 0;
-       cdev->handler = 0;
+       rp->cdev = NULL;
+       cdev->dev.driver_data = NULL;
+       cdev->handler = NULL;
 
        /* Put ccw_device structure. */
        put_device(&cdev->dev);
@@ -1144,7 +1144,7 @@ raw3270_model_show(struct device *dev, struct device_attribute *attr, char *buf)
        return snprintf(buf, PAGE_SIZE, "%i\n",
                        ((struct raw3270 *) dev->driver_data)->model);
 }
-static DEVICE_ATTR(model, 0444, raw3270_model_show, 0);
+static DEVICE_ATTR(model, 0444, raw3270_model_show, NULL);
 
 static ssize_t
 raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf)
@@ -1152,7 +1152,7 @@ raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf)
        return snprintf(buf, PAGE_SIZE, "%i\n",
                        ((struct raw3270 *) dev->driver_data)->rows);
 }
-static DEVICE_ATTR(rows, 0444, raw3270_rows_show, 0);
+static DEVICE_ATTR(rows, 0444, raw3270_rows_show, NULL);
 
 static ssize_t
 raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *buf)
@@ -1160,7 +1160,7 @@ raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *bu
        return snprintf(buf, PAGE_SIZE, "%i\n",
                        ((struct raw3270 *) dev->driver_data)->cols);
 }
-static DEVICE_ATTR(columns, 0444, raw3270_columns_show, 0);
+static DEVICE_ATTR(columns, 0444, raw3270_columns_show, NULL);
 
 static struct attribute * raw3270_attrs[] = {
        &dev_attr_model.attr,
@@ -1296,7 +1296,7 @@ raw3270_remove (struct ccw_device *cdev)
        spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
        if (rp->view) {
                rp->view->fn->deactivate(rp->view);
-               rp->view = 0;
+               rp->view = NULL;
        }
        while (!list_empty(&rp->view_list)) {
                v = list_entry(rp->view_list.next, struct raw3270_view, list);
index b635bf8e777524525c38df6032cb41d2b2e1a627..90beaa80a78229d94368e3e170274158bf2a9f55 100644 (file)
@@ -231,7 +231,7 @@ alloc_string(struct list_head *free_list, unsigned long len)
                INIT_LIST_HEAD(&cs->update);
                return cs;
        }
-       return 0;
+       return NULL;
 }
 
 static inline unsigned long
index 48b4d30a725612fedef6af60ba58d0bff4a792cf..7b95dab913d0240847abe36830373595ba551aa8 100644 (file)
@@ -1309,9 +1309,9 @@ static struct tape_discipline tape_discipline_34xx = {
 };
 
 static struct ccw_device_id tape_34xx_ids[] = {
-       { CCW_DEVICE_DEVTYPE(0x3480, 0, 0x3480, 0), driver_info: tape_3480},
-       { CCW_DEVICE_DEVTYPE(0x3490, 0, 0x3490, 0), driver_info: tape_3490},
-       { /* end of list */ }
+       { CCW_DEVICE_DEVTYPE(0x3480, 0, 0x3480, 0), .driver_info = tape_3480},
+       { CCW_DEVICE_DEVTYPE(0x3490, 0, 0x3490, 0), .driver_info = tape_3490},
+       { /* end of list */ },
 };
 
 static int
index f496f236b9c06c3954ea9e885f49ed0c6c5b9ed1..29718042c6c9a669da34d828e046fb636a6f64d1 100644 (file)
@@ -437,7 +437,7 @@ tty3270_rcl_add(struct tty3270 *tp, char *input, int len)
 {
        struct string *s;
 
-       tp->rcl_walk = 0;
+       tp->rcl_walk = NULL;
        if (len <= 0)
                return;
        if (tp->rcl_nr >= tp->rcl_max) {
@@ -466,12 +466,12 @@ tty3270_rcl_backward(struct kbd_data *kbd)
                else if (!list_empty(&tp->rcl_lines))
                        tp->rcl_walk = tp->rcl_lines.prev;
                s = tp->rcl_walk ? 
-                       list_entry(tp->rcl_walk, struct string, list) : 0;
+                       list_entry(tp->rcl_walk, struct string, list) : NULL;
                if (tp->rcl_walk) {
                        s = list_entry(tp->rcl_walk, struct string, list);
                        tty3270_update_prompt(tp, s->string, s->len);
                } else
-                       tty3270_update_prompt(tp, 0, 0);
+                       tty3270_update_prompt(tp, NULL, 0);
                tty3270_set_timer(tp, 1);
        }
        spin_unlock_bh(&tp->view.lock);
@@ -553,7 +553,7 @@ tty3270_read_tasklet(struct raw3270_request *rrq)
         * has to be emitted to the tty and for 0x6d the screen
         * needs to be redrawn.
         */
-       input = 0;
+       input = NULL;
        len = 0;
        if (tp->input->string[0] == 0x7d) {
                /* Enter: write input to tty. */
@@ -567,7 +567,7 @@ tty3270_read_tasklet(struct raw3270_request *rrq)
                        tty3270_update_status(tp);
                }
                /* Clear input area. */
-               tty3270_update_prompt(tp, 0, 0);
+               tty3270_update_prompt(tp, NULL, 0);
                tty3270_set_timer(tp, 1);
        } else if (tp->input->string[0] == 0x6d) {
                /* Display has been cleared. Redraw. */
@@ -808,8 +808,8 @@ tty3270_release(struct raw3270_view *view)
        tp = (struct tty3270 *) view;
        tty = tp->tty;
        if (tty) {
-               tty->driver_data = 0;
-               tp->tty = tp->kbd->tty = 0;
+               tty->driver_data = NULL;
+               tp->tty = tp->kbd->tty = NULL;
                tty_hangup(tty);
                raw3270_put_view(&tp->view);
        }
@@ -948,8 +948,8 @@ tty3270_close(struct tty_struct *tty, struct file * filp)
                return;
        tp = (struct tty3270 *) tty->driver_data;
        if (tp) {
-               tty->driver_data = 0;
-               tp->tty = tp->kbd->tty = 0;
+               tty->driver_data = NULL;
+               tp->tty = tp->kbd->tty = NULL;
                raw3270_put_view(&tp->view);
        }
 }
@@ -1673,7 +1673,7 @@ tty3270_set_termios(struct tty_struct *tty, struct termios *old)
                new = L_ECHO(tty) ? TF_INPUT: TF_INPUTN;
                if (new != tp->inattr) {
                        tp->inattr = new;
-                       tty3270_update_prompt(tp, 0, 0);
+                       tty3270_update_prompt(tp, NULL, 0);
                        tty3270_set_timer(tp, 1);
                }
        }
@@ -1759,7 +1759,7 @@ void
 tty3270_notifier(int index, int active)
 {
        if (active)
-               tty_register_device(tty3270_driver, index, 0);
+               tty_register_device(tty3270_driver, index, NULL);
        else
                tty_unregister_device(tty3270_driver, index);
 }
@@ -1818,7 +1818,7 @@ tty3270_exit(void)
 
        raw3270_unregister_notifier(tty3270_notifier);
        driver = tty3270_driver;
-       tty3270_driver = 0;
+       tty3270_driver = NULL;
        tty_unregister_driver(driver);
        tty3270_del_views();
 }
index c625b69ebd1983b7ab7216c0a68b3fe79c83cc98..6cb23040954b4778de47f299a0ffc8c6d50cb9ce 100644 (file)
@@ -86,8 +86,8 @@ struct vmlogrdr_priv_t {
  */
 static int vmlogrdr_open(struct inode *, struct file *);
 static int vmlogrdr_release(struct inode *, struct file *);
-static ssize_t vmlogrdr_read (struct file *filp, char *data, size_t count,
-                              loff_t * ppos);
+static ssize_t vmlogrdr_read (struct file *filp, char __user *data,
+                             size_t count, loff_t * ppos);
 
 static struct file_operations vmlogrdr_fops = {
        .owner   = THIS_MODULE,
@@ -515,7 +515,7 @@ vmlogrdr_receive_data(struct vmlogrdr_priv_t *priv) {
 
 
 static ssize_t
-vmlogrdr_read (struct file *filp, char *data, size_t count, loff_t * ppos)
+vmlogrdr_read(struct file *filp, char __user *data, size_t count, loff_t * ppos)
 {
        int rc;
        struct vmlogrdr_priv_t * priv = filp->private_data;
index 5acc0ace3d7d571f5a0a14ad994a7a7f191f2dad..807320a41fa40f5ab1ed0b426e9831d2bb109b97 100644 (file)
@@ -193,7 +193,7 @@ static int vmwdt_ioctl(struct inode *i, struct file *f,
                return 0;
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
-               return put_user(0, (int *)arg);
+               return put_user(0, (int __user *)arg);
        case WDIOC_GETTEMP:
                return -EINVAL;
        case WDIOC_SETOPTIONS:
index c7319a07ba35161fde79dac21de10332d0387736..f26a2ee3aad8de4a3fe7d94daf23e3e42cdc8ca7 100644 (file)
@@ -319,7 +319,7 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const
        if (!try_module_get(gdrv->owner))
                return -EINVAL;
 
-       value = simple_strtoul(buf, 0, 0);
+       value = simple_strtoul(buf, NULL, 0);
        ret = count;
        if (value == 1)
                ccwgroup_set_online(gdev);
index a01f3bba4a7b094d81edf8d128371e350e666093..61ce3f1d522852adc7d0b0b2cc5ec795590865f7 100644 (file)
@@ -1464,6 +1464,40 @@ chsc_get_chp_desc(struct subchannel *sch, int chp_no)
        return desc;
 }
 
+static int reset_channel_path(struct channel_path *chp)
+{
+       int cc;
+
+       cc = rchp(chp->id);
+       switch (cc) {
+       case 0:
+               return 0;
+       case 2:
+               return -EBUSY;
+       default:
+               return -ENODEV;
+       }
+}
+
+static void reset_channel_paths_css(struct channel_subsystem *css)
+{
+       int i;
+
+       for (i = 0; i <= __MAX_CHPID; i++) {
+               if (css->chps[i])
+                       reset_channel_path(css->chps[i]);
+       }
+}
+
+void cio_reset_channel_paths(void)
+{
+       int i;
+
+       for (i = 0; i <= __MAX_CSSID; i++) {
+               if (css[i] && css[i]->valid)
+                       reset_channel_paths_css(css[i]);
+       }
+}
 
 static int __init
 chsc_alloc_sei_area(void)
index 6fec90eab00e82031b9634897c148080b62f5fd1..89320c1ad8251b575ec4530718e145b69e4f9017 100644 (file)
@@ -519,6 +519,7 @@ cio_validate_subchannel (struct subchannel *sch, struct subchannel_id schid)
        memset(sch, 0, sizeof(struct subchannel));
 
        spin_lock_init(&sch->lock);
+       mutex_init(&sch->reg_mutex);
 
        /* Set a name for the subchannel */
        snprintf (sch->dev.bus_id, BUS_ID_SIZE, "0.%x.%04x", schid.ssid,
@@ -797,7 +798,7 @@ struct subchannel *
 cio_get_console_subchannel(void)
 {
        if (!console_subchannel_in_use)
-               return 0;
+               return NULL;
        return &console_subchannel;
 }
 
@@ -875,5 +876,6 @@ void
 reipl(unsigned long devno)
 {
        clear_all_subchannels();
+       cio_reset_channel_paths();
        do_reipl(devno);
 }
index 0ca987344e07183f6b1d9bbbae5c040dc924bed9..4541c1af4b666aac7152bcbf9ef593a46074a0ef 100644 (file)
@@ -2,6 +2,7 @@
 #define S390_CIO_H
 
 #include "schid.h"
+#include <linux/mutex.h>
 
 /*
  * where we put the ssd info
@@ -87,7 +88,7 @@ struct orb {
 struct subchannel {
        struct subchannel_id schid;
        spinlock_t lock;        /* subchannel lock */
-
+       struct mutex reg_mutex;
        enum {
                SUBCHANNEL_TYPE_IO = 0,
                SUBCHANNEL_TYPE_CHSC = 1,
index 1c3e8e9012b08c3553c1b5b7de806a87598f2fc0..0df3af1f08ded68b7beaceea80affc1a50978e4f 100644 (file)
@@ -1140,7 +1140,7 @@ static struct attribute *cmf_attributes[] = {
        &dev_attr_avg_device_disconnect_time.attr,
        &dev_attr_avg_control_unit_queuing_time.attr,
        &dev_attr_avg_device_active_only_time.attr,
-       0,
+       NULL,
 };
 
 static struct attribute_group cmf_attr_group = {
@@ -1160,7 +1160,7 @@ static struct attribute *cmf_attributes_ext[] = {
        &dev_attr_avg_device_active_only_time.attr,
        &dev_attr_avg_device_busy_time.attr,
        &dev_attr_avg_initial_command_response_time.attr,
-       0,
+       NULL,
 };
 
 static struct attribute_group cmf_attr_group_ext = {
index 1d3be80797f81e1ed119a08394f872cc20700236..13eeea3d547f2be83a1c8b9e8ca6139d6c858c9f 100644 (file)
@@ -108,6 +108,24 @@ css_subchannel_release(struct device *dev)
 
 extern int css_get_ssd_info(struct subchannel *sch);
 
+
+int css_sch_device_register(struct subchannel *sch)
+{
+       int ret;
+
+       mutex_lock(&sch->reg_mutex);
+       ret = device_register(&sch->dev);
+       mutex_unlock(&sch->reg_mutex);
+       return ret;
+}
+
+void css_sch_device_unregister(struct subchannel *sch)
+{
+       mutex_lock(&sch->reg_mutex);
+       device_unregister(&sch->dev);
+       mutex_unlock(&sch->reg_mutex);
+}
+
 static int
 css_register_subchannel(struct subchannel *sch)
 {
@@ -119,7 +137,7 @@ css_register_subchannel(struct subchannel *sch)
        sch->dev.release = &css_subchannel_release;
        
        /* make it known to the system */
-       ret = device_register(&sch->dev);
+       ret = css_sch_device_register(sch);
        if (ret)
                printk (KERN_WARNING "%s: could not register %s\n",
                        __func__, sch->dev.bus_id);
@@ -250,7 +268,7 @@ css_evaluate_subchannel(struct subchannel_id schid, int slow)
                 * The device will be killed automatically.
                 */
                cio_disable_subchannel(sch);
-               device_unregister(&sch->dev);
+               css_sch_device_unregister(sch);
                /* Reset intparm to zeroes. */
                sch->schib.pmcw.intparm = 0;
                cio_modify(sch);
@@ -264,7 +282,7 @@ css_evaluate_subchannel(struct subchannel_id schid, int slow)
                 * away in any case.
                 */
                if (!disc) {
-                       device_unregister(&sch->dev);
+                       css_sch_device_unregister(sch);
                        /* Reset intparm to zeroes. */
                        sch->schib.pmcw.intparm = 0;
                        cio_modify(sch);
@@ -605,9 +623,13 @@ init_channel_subsystem (void)
                ret = device_register(&css[i]->device);
                if (ret)
                        goto out_free;
-               if (css_characteristics_avail && css_chsc_characteristics.secm)
-                       device_create_file(&css[i]->device,
-                                          &dev_attr_cm_enable);
+               if (css_characteristics_avail &&
+                   css_chsc_characteristics.secm) {
+                       ret = device_create_file(&css[i]->device,
+                                                &dev_attr_cm_enable);
+                       if (ret)
+                               goto out_device;
+               }
        }
        css_init_done = 1;
 
@@ -615,6 +637,8 @@ init_channel_subsystem (void)
 
        for_each_subchannel(__init_channel_subsystem, NULL);
        return 0;
+out_device:
+       device_unregister(&css[i]->device);
 out_free:
        kfree(css[i]);
 out_unregister:
index e210f89a24499c65f9bedea44df54d3e299c96d4..8aabb4adeb5f08eb79ad7642005985f257e78815 100644 (file)
@@ -100,7 +100,7 @@ struct ccw_device_private {
        struct qdio_irq *qdio_data;
        struct irb irb;         /* device status */
        struct senseid senseid; /* SenseID info */
-       struct pgid pgid;       /* path group ID */
+       struct pgid pgid[8];    /* path group IDs per chpid*/
        struct ccw1 iccws[2];   /* ccws for SNID/SID/SPGID commands */
        struct work_struct kick_work;
        wait_queue_head_t wait_q;
@@ -136,6 +136,8 @@ extern struct bus_type css_bus_type;
 extern struct css_driver io_subchannel_driver;
 
 extern int css_probe_device(struct subchannel_id);
+extern int css_sch_device_register(struct subchannel *);
+extern void css_sch_device_unregister(struct subchannel *);
 extern struct subchannel * get_subchannel_by_schid(struct subchannel_id);
 extern int css_init_done;
 extern int for_each_subchannel(int(*fn)(struct subchannel_id, void *), void *);
index 67f0de6aed33942ba078887e272287cdfca9ae7d..585fa04233c34f0325c064af7dc55ce183f696be 100644 (file)
@@ -100,7 +100,7 @@ ccw_uevent (struct device *dev, char **envp, int num_envp,
        if ((buffer_size - length <= 0) || (i >= num_envp))
                return -ENOMEM;
 
-       envp[i] = 0;
+       envp[i] = NULL;
 
        return 0;
 }
@@ -280,7 +280,7 @@ ccw_device_remove_disconnected(struct ccw_device *cdev)
         * 'throw away device'.
         */
        sch = to_subchannel(cdev->dev.parent);
-       device_unregister(&sch->dev);
+       css_sch_device_unregister(sch);
        /* Reset intparm to zeroes. */
        sch->schib.pmcw.intparm = 0;
        cio_modify(sch);
@@ -625,7 +625,7 @@ ccw_device_do_unreg_rereg(void *data)
                                        other_sch->schib.pmcw.intparm = 0;
                                        cio_modify(other_sch);
                                }
-                               device_unregister(&other_sch->dev);
+                               css_sch_device_unregister(other_sch);
                        }
                }
                /* Update ssd info here. */
@@ -709,7 +709,7 @@ ccw_device_call_sch_unregister(void *data)
        struct subchannel *sch;
 
        sch = to_subchannel(cdev->dev.parent);
-       device_unregister(&sch->dev);
+       css_sch_device_unregister(sch);
        /* Reset intparm to zeroes. */
        sch->schib.pmcw.intparm = 0;
        cio_modify(sch);
@@ -1057,7 +1057,7 @@ get_ccwdev_by_busid(struct ccw_driver *cdrv, const char *bus_id)
                                 __ccwdev_check_busid);
        put_driver(drv);
 
-       return dev ? to_ccwdev(dev) : 0;
+       return dev ? to_ccwdev(dev) : NULL;
 }
 
 /************************** device driver handling ************************/
@@ -1082,7 +1082,7 @@ ccw_device_probe (struct device *dev)
        ret = cdrv->probe ? cdrv->probe(cdev) : -ENODEV;
 
        if (ret) {
-               cdev->drv = 0;
+               cdev->drv = NULL;
                return ret;
        }
 
@@ -1113,7 +1113,7 @@ ccw_device_remove (struct device *dev)
                                 ret, cdev->dev.bus_id);
        }
        ccw_device_set_timeout(cdev, 0);
-       cdev->drv = 0;
+       cdev->drv = NULL;
        return 0;
 }
 
index cb1af0b6f033c4b43e057f29e9ddf2ef2d4596b0..ac6e0c7e43d9587805e820e8d2e6eb633989d58d 100644 (file)
@@ -378,6 +378,56 @@ ccw_device_done(struct ccw_device *cdev, int state)
                put_device (&cdev->dev);
 }
 
+static inline int cmp_pgid(struct pgid *p1, struct pgid *p2)
+{
+       char *c1;
+       char *c2;
+
+       c1 = (char *)p1;
+       c2 = (char *)p2;
+
+       return memcmp(c1 + 1, c2 + 1, sizeof(struct pgid) - 1);
+}
+
+static void __ccw_device_get_common_pgid(struct ccw_device *cdev)
+{
+       int i;
+       int last;
+
+       last = 0;
+       for (i = 0; i < 8; i++) {
+               if (cdev->private->pgid[i].inf.ps.state1 == SNID_STATE1_RESET)
+                       /* No PGID yet */
+                       continue;
+               if (cdev->private->pgid[last].inf.ps.state1 ==
+                   SNID_STATE1_RESET) {
+                       /* First non-zero PGID */
+                       last = i;
+                       continue;
+               }
+               if (cmp_pgid(&cdev->private->pgid[i],
+                            &cdev->private->pgid[last]) == 0)
+                       /* Non-conflicting PGIDs */
+                       continue;
+
+               /* PGID mismatch, can't pathgroup. */
+               CIO_MSG_EVENT(0, "SNID - pgid mismatch for device "
+                             "0.%x.%04x, can't pathgroup\n",
+                             cdev->private->ssid, cdev->private->devno);
+               cdev->private->options.pgroup = 0;
+               return;
+       }
+       if (cdev->private->pgid[last].inf.ps.state1 ==
+           SNID_STATE1_RESET)
+               /* No previous pgid found */
+               memcpy(&cdev->private->pgid[0], &css[0]->global_pgid,
+                      sizeof(struct pgid));
+       else
+               /* Use existing pgid */
+               memcpy(&cdev->private->pgid[0], &cdev->private->pgid[last],
+                      sizeof(struct pgid));
+}
+
 /*
  * Function called from device_pgid.c after sense path ground has completed.
  */
@@ -388,24 +438,26 @@ ccw_device_sense_pgid_done(struct ccw_device *cdev, int err)
 
        sch = to_subchannel(cdev->dev.parent);
        switch (err) {
-       case 0:
-               /* Start Path Group verification. */
-               sch->vpm = 0;   /* Start with no path groups set. */
-               cdev->private->state = DEV_STATE_VERIFY;
-               ccw_device_verify_start(cdev);
+       case -EOPNOTSUPP: /* path grouping not supported, use nop instead. */
+               cdev->private->options.pgroup = 0;
+               break;
+       case 0: /* success */
+       case -EACCES: /* partial success, some paths not operational */
+               /* Check if all pgids are equal or 0. */
+               __ccw_device_get_common_pgid(cdev);
                break;
        case -ETIME:            /* Sense path group id stopped by timeout. */
        case -EUSERS:           /* device is reserved for someone else. */
                ccw_device_done(cdev, DEV_STATE_BOXED);
-               break;
-       case -EOPNOTSUPP: /* path grouping not supported, just set online. */
-               cdev->private->options.pgroup = 0;
-               ccw_device_done(cdev, DEV_STATE_ONLINE);
-               break;
+               return;
        default:
                ccw_device_done(cdev, DEV_STATE_NOT_OPER);
-               break;
+               return;
        }
+       /* Start Path Group verification. */
+       sch->vpm = 0;   /* Start with no path groups set. */
+       cdev->private->state = DEV_STATE_VERIFY;
+       ccw_device_verify_start(cdev);
 }
 
 /*
@@ -562,8 +614,9 @@ ccw_device_online(struct ccw_device *cdev)
        }
        /* Do we want to do path grouping? */
        if (!cdev->private->options.pgroup) {
-               /* No, set state online immediately. */
-               ccw_device_done(cdev, DEV_STATE_ONLINE);
+               /* Start initial path verification. */
+               cdev->private->state = DEV_STATE_VERIFY;
+               ccw_device_verify_start(cdev);
                return 0;
        }
        /* Do a SensePGID first. */
@@ -609,6 +662,7 @@ ccw_device_offline(struct ccw_device *cdev)
        /* Are we doing path grouping? */
        if (!cdev->private->options.pgroup) {
                /* No, set state offline immediately. */
+               sch->vpm = 0;
                ccw_device_done(cdev, DEV_STATE_OFFLINE);
                return 0;
        }
@@ -705,8 +759,6 @@ ccw_device_online_verify(struct ccw_device *cdev, enum dev_event dev_event)
 {
        struct subchannel *sch;
 
-       if (!cdev->private->options.pgroup)
-               return;
        if (cdev->private->state == DEV_STATE_W4SENSE) {
                cdev->private->flags.doverify = 1;
                return;
@@ -995,8 +1047,7 @@ static void
 ccw_device_wait4io_verify(struct ccw_device *cdev, enum dev_event dev_event)
 {
        /* When the I/O has terminated, we have to start verification. */
-       if (cdev->private->options.pgroup)
-               cdev->private->flags.doverify = 1;
+       cdev->private->flags.doverify = 1;
 }
 
 static void
index 54cb64ed0786dc469957f7b2089bff7f6402d40e..32610fd8868e97b6978a0d15160bad466eb31a89 100644 (file)
@@ -33,12 +33,17 @@ __ccw_device_sense_pgid_start(struct ccw_device *cdev)
        struct subchannel *sch;
        struct ccw1 *ccw;
        int ret;
+       int i;
 
        sch = to_subchannel(cdev->dev.parent);
+       /* Return if we already checked on all paths. */
+       if (cdev->private->imask == 0)
+               return (sch->lpm == 0) ? -ENODEV : -EACCES;
+       i = 8 - ffs(cdev->private->imask);
+
        /* Setup sense path group id channel program. */
        ccw = cdev->private->iccws;
        ccw->cmd_code = CCW_CMD_SENSE_PGID;
-       ccw->cda = (__u32) __pa (&cdev->private->pgid);
        ccw->count = sizeof (struct pgid);
        ccw->flags = CCW_FLAG_SLI;
 
@@ -48,6 +53,7 @@ __ccw_device_sense_pgid_start(struct ccw_device *cdev)
        ret = -ENODEV;
        while (cdev->private->imask != 0) {
                /* Try every path multiple times. */
+               ccw->cda = (__u32) __pa (&cdev->private->pgid[i]);
                if (cdev->private->iretry > 0) {
                        cdev->private->iretry--;
                        ret = cio_start (sch, cdev->private->iccws, 
@@ -64,7 +70,9 @@ __ccw_device_sense_pgid_start(struct ccw_device *cdev)
                }
                cdev->private->imask >>= 1;
                cdev->private->iretry = 5;
+               i++;
        }
+
        return ret;
 }
 
@@ -76,7 +84,7 @@ ccw_device_sense_pgid_start(struct ccw_device *cdev)
        cdev->private->state = DEV_STATE_SENSE_PGID;
        cdev->private->imask = 0x80;
        cdev->private->iretry = 5;
-       memset (&cdev->private->pgid, 0, sizeof (struct pgid));
+       memset (&cdev->private->pgid, 0, sizeof (cdev->private->pgid));
        ret = __ccw_device_sense_pgid_start(cdev);
        if (ret && ret != -EBUSY)
                ccw_device_sense_pgid_done(cdev, ret);
@@ -91,6 +99,7 @@ __ccw_device_check_sense_pgid(struct ccw_device *cdev)
 {
        struct subchannel *sch;
        struct irb *irb;
+       int i;
 
        sch = to_subchannel(cdev->dev.parent);
        irb = &cdev->private->irb;
@@ -124,7 +133,8 @@ __ccw_device_check_sense_pgid(struct ccw_device *cdev)
                              sch->schid.sch_no, sch->orb.lpm);
                return -EACCES;
        }
-       if (cdev->private->pgid.inf.ps.state2 == SNID_STATE2_RESVD_ELSE) {
+       i = 8 - ffs(cdev->private->imask);
+       if (cdev->private->pgid[i].inf.ps.state2 == SNID_STATE2_RESVD_ELSE) {
                CIO_MSG_EVENT(2, "SNID - Device %04x on Subchannel 0.%x.%04x "
                              "is reserved by someone else\n",
                              cdev->private->devno, sch->schid.ssid,
@@ -162,12 +172,6 @@ ccw_device_sense_pgid_irq(struct ccw_device *cdev, enum dev_event dev_event)
        memset(&cdev->private->irb, 0, sizeof(struct irb));
        switch (ret) {
        /* 0, -ETIME, -EOPNOTSUPP, -EAGAIN, -EACCES or -EUSERS */
-       case 0:                 /* Sense Path Group ID successful. */
-               if (cdev->private->pgid.inf.ps.state1 == SNID_STATE1_RESET)
-                       memcpy(&cdev->private->pgid, &css[0]->global_pgid,
-                              sizeof(struct pgid));
-               ccw_device_sense_pgid_done(cdev, 0);
-               break;
        case -EOPNOTSUPP:       /* Sense Path Group ID not supported */
                ccw_device_sense_pgid_done(cdev, -EOPNOTSUPP);
                break;
@@ -176,13 +180,15 @@ ccw_device_sense_pgid_irq(struct ccw_device *cdev, enum dev_event dev_event)
                break;
        case -EACCES:           /* channel is not operational. */
                sch->lpm &= ~cdev->private->imask;
+               /* Fall through. */
+       case 0:                 /* Sense Path Group ID successful. */
                cdev->private->imask >>= 1;
                cdev->private->iretry = 5;
                /* Fall through. */
        case -EAGAIN:           /* Try again. */
                ret = __ccw_device_sense_pgid_start(cdev);
                if (ret != 0 && ret != -EBUSY)
-                       ccw_device_sense_pgid_done(cdev, -ENODEV);
+                       ccw_device_sense_pgid_done(cdev, ret);
                break;
        case -EUSERS:           /* device is reserved for someone else. */
                ccw_device_sense_pgid_done(cdev, -EUSERS);
@@ -203,20 +209,20 @@ __ccw_device_do_pgid(struct ccw_device *cdev, __u8 func)
        sch = to_subchannel(cdev->dev.parent);
 
        /* Setup sense path group id channel program. */
-       cdev->private->pgid.inf.fc = func;
+       cdev->private->pgid[0].inf.fc = func;
        ccw = cdev->private->iccws;
        if (!cdev->private->flags.pgid_single) {
-               cdev->private->pgid.inf.fc |= SPID_FUNC_MULTI_PATH;
+               cdev->private->pgid[0].inf.fc |= SPID_FUNC_MULTI_PATH;
                ccw->cmd_code = CCW_CMD_SUSPEND_RECONN;
                ccw->cda = 0;
                ccw->count = 0;
                ccw->flags = CCW_FLAG_SLI | CCW_FLAG_CC;
                ccw++;
        } else
-               cdev->private->pgid.inf.fc |= SPID_FUNC_SINGLE_PATH;
+               cdev->private->pgid[0].inf.fc |= SPID_FUNC_SINGLE_PATH;
 
        ccw->cmd_code = CCW_CMD_SET_PGID;
-       ccw->cda = (__u32) __pa (&cdev->private->pgid);
+       ccw->cda = (__u32) __pa (&cdev->private->pgid[0]);
        ccw->count = sizeof (struct pgid);
        ccw->flags = CCW_FLAG_SLI;
 
@@ -243,6 +249,48 @@ __ccw_device_do_pgid(struct ccw_device *cdev, __u8 func)
        return ret;
 }
 
+/*
+ * Helper function to send a nop ccw down a path.
+ */
+static int __ccw_device_do_nop(struct ccw_device *cdev)
+{
+       struct subchannel *sch;
+       struct ccw1 *ccw;
+       int ret;
+
+       sch = to_subchannel(cdev->dev.parent);
+
+       /* Setup nop channel program. */
+       ccw = cdev->private->iccws;
+       ccw->cmd_code = CCW_CMD_NOOP;
+       ccw->cda = 0;
+       ccw->count = 0;
+       ccw->flags = CCW_FLAG_SLI;
+
+       /* Reset device status. */
+       memset(&cdev->private->irb, 0, sizeof(struct irb));
+
+       /* Try multiple times. */
+       ret = -ENODEV;
+       if (cdev->private->iretry > 0) {
+               cdev->private->iretry--;
+               ret = cio_start (sch, cdev->private->iccws,
+                                cdev->private->imask);
+               /* ret is 0, -EBUSY, -EACCES or -ENODEV */
+               if ((ret != -EACCES) && (ret != -ENODEV))
+                       return ret;
+       }
+       /* nop command failed on this path. Switch it off. */
+       sch->lpm &= ~cdev->private->imask;
+       sch->vpm &= ~cdev->private->imask;
+       CIO_MSG_EVENT(2, "NOP - Device %04x on Subchannel "
+                     "0.%x.%04x, lpm %02X, became 'not operational'\n",
+                     cdev->private->devno, sch->schid.ssid,
+                     sch->schid.sch_no, cdev->private->imask);
+       return ret;
+}
+
+
 /*
  * Called from interrupt context to check if a valid answer
  * to Set Path Group ID was received.
@@ -282,6 +330,29 @@ __ccw_device_check_pgid(struct ccw_device *cdev)
        return 0;
 }
 
+/*
+ * Called from interrupt context to check the path status after a nop has
+ * been send.
+ */
+static int __ccw_device_check_nop(struct ccw_device *cdev)
+{
+       struct subchannel *sch;
+       struct irb *irb;
+
+       sch = to_subchannel(cdev->dev.parent);
+       irb = &cdev->private->irb;
+       if (irb->scsw.fctl & (SCSW_FCTL_HALT_FUNC | SCSW_FCTL_CLEAR_FUNC))
+               return -ETIME;
+       if (irb->scsw.cc == 3) {
+               CIO_MSG_EVENT(2, "NOP - Device %04x on Subchannel 0.%x.%04x,"
+                             " lpm %02X, became 'not operational'\n",
+                             cdev->private->devno, sch->schid.ssid,
+                             sch->schid.sch_no, cdev->private->imask);
+               return -EACCES;
+       }
+       return 0;
+}
+
 static void
 __ccw_device_verify_start(struct ccw_device *cdev)
 {
@@ -296,9 +367,12 @@ __ccw_device_verify_start(struct ccw_device *cdev)
                        if ((sch->vpm & imask) != (sch->lpm & imask))
                                break;
                cdev->private->imask = imask;
-               func = (sch->vpm & imask) ?
-                       SPID_FUNC_RESIGN : SPID_FUNC_ESTABLISH;
-               ret = __ccw_device_do_pgid(cdev, func);
+               if (cdev->private->options.pgroup) {
+                       func = (sch->vpm & imask) ?
+                               SPID_FUNC_RESIGN : SPID_FUNC_ESTABLISH;
+                       ret = __ccw_device_do_pgid(cdev, func);
+               } else
+                       ret = __ccw_device_do_nop(cdev);
                if (ret == 0 || ret == -EBUSY)
                        return;
                cdev->private->iretry = 5;
@@ -327,7 +401,10 @@ ccw_device_verify_irq(struct ccw_device *cdev, enum dev_event dev_event)
        if (ccw_device_accumulate_and_sense(cdev, irb) != 0)
                return;
        sch = to_subchannel(cdev->dev.parent);
-       ret = __ccw_device_check_pgid(cdev);
+       if (cdev->private->options.pgroup)
+               ret = __ccw_device_check_pgid(cdev);
+       else
+               ret = __ccw_device_check_nop(cdev);
        memset(&cdev->private->irb, 0, sizeof(struct irb));
        switch (ret) {
        /* 0, -ETIME, -EAGAIN, -EOPNOTSUPP or -EACCES */
@@ -345,11 +422,10 @@ ccw_device_verify_irq(struct ccw_device *cdev, enum dev_event dev_event)
                 * One of those strange devices which claim to be able
                 * to do multipathing but not for Set Path Group ID.
                 */
-               if (cdev->private->flags.pgid_single) {
-                       ccw_device_verify_done(cdev, -EOPNOTSUPP);
-                       break;
-               }
-               cdev->private->flags.pgid_single = 1;
+               if (cdev->private->flags.pgid_single)
+                       cdev->private->options.pgroup = 0;
+               else
+                       cdev->private->flags.pgid_single = 1;
                /* fall through. */
        case -EAGAIN:           /* Try again. */
                __ccw_device_verify_start(cdev);
index 14bef2c179bf383f7eecb4f1506710b6bb0991ad..caf148d5caadb55ec6eab663168ebc8180b908ea 100644 (file)
@@ -67,8 +67,7 @@ ccw_device_path_notoper(struct ccw_device *cdev)
                      sch->schib.pmcw.pnom);
 
        sch->lpm &= ~sch->schib.pmcw.pnom;
-       if (cdev->private->options.pgroup)
-               cdev->private->flags.doverify = 1;
+       cdev->private->flags.doverify = 1;
 }
 
 /*
@@ -180,7 +179,7 @@ ccw_device_accumulate_esw(struct ccw_device *cdev, struct irb *irb)
        cdev_irb->esw.esw0.erw.auth = irb->esw.esw0.erw.auth;
        /* Copy path verification required flag. */
        cdev_irb->esw.esw0.erw.pvrf = irb->esw.esw0.erw.pvrf;
-       if (irb->esw.esw0.erw.pvrf && cdev->private->options.pgroup)
+       if (irb->esw.esw0.erw.pvrf)
                cdev->private->flags.doverify = 1;
        /* Copy concurrent sense bit. */
        cdev_irb->esw.esw0.erw.cons = irb->esw.esw0.erw.cons;
@@ -354,7 +353,7 @@ ccw_device_accumulate_basic_sense(struct ccw_device *cdev, struct irb *irb)
        }
        /* Check if path verification is required. */
        if (ccw_device_accumulate_esw_valid(irb) &&
-           irb->esw.esw0.erw.pvrf && cdev->private->options.pgroup) 
+           irb->esw.esw0.erw.pvrf)
                cdev->private->flags.doverify = 1;
 }
 
index b70039af70d6204062850f8b3089f6e9765084e5..7c93a8798d234c89160138571489562c7ef14bd5 100644 (file)
@@ -2735,7 +2735,7 @@ qdio_free(struct ccw_device *cdev)
        QDIO_DBF_TEXT1(0,trace,dbf_text);
        QDIO_DBF_TEXT0(0,setup,dbf_text);
 
-       cdev->private->qdio_data = 0;
+       cdev->private->qdio_data = NULL;
 
        up(&irq_ptr->setting_up_sema);
 
index 189a49275433879f1935685c8a51b05d8ab6158e..0e863df4027a2d18cfaabd576ee9aa61df4194a6 100644 (file)
@@ -692,7 +692,7 @@ iucv_retrieve_buffer (void)
        iucv_debug(1, "entering");
        if (iucv_cpuid != -1) {
                smp_call_function_on(iucv_retrieve_buffer_cpuid,
-                                    0, 0, 1, iucv_cpuid);
+                                    NULL, 0, 1, iucv_cpuid);
                /* Release the cpu reserved by iucv_declare_buffer. */
                smp_put_cpu(iucv_cpuid);
                iucv_cpuid = -1;
index 4caced21ac8c59d054d132c93f7801cfccefa1a9..103c41470bd246caeac18d08d29dc641537f6798 100644 (file)
@@ -4804,7 +4804,7 @@ static struct qeth_cmd_buffer *
 qeth_get_setassparms_cmd(struct qeth_card *, enum qeth_ipa_funcs,
                         __u16, __u16, enum qeth_prot_versions);
 static int
-qeth_arp_query(struct qeth_card *card, char *udata)
+qeth_arp_query(struct qeth_card *card, char __user *udata)
 {
        struct qeth_cmd_buffer *iob;
        struct qeth_arp_query_info qinfo = {0, };
@@ -4937,7 +4937,7 @@ qeth_get_adapter_cmd(struct qeth_card *card, __u32 command, __u32 cmdlen)
  * function to send SNMP commands to OSA-E card
  */
 static int
-qeth_snmp_command(struct qeth_card *card, char *udata)
+qeth_snmp_command(struct qeth_card *card, char __user *udata)
 {
        struct qeth_cmd_buffer *iob;
        struct qeth_ipa_cmd *cmd;
@@ -7909,9 +7909,9 @@ qeth_set_online(struct ccwgroup_device *gdev)
 }
 
 static struct ccw_device_id qeth_ids[] = {
-       {CCW_DEVICE(0x1731, 0x01), driver_info:QETH_CARD_TYPE_OSAE},
-       {CCW_DEVICE(0x1731, 0x05), driver_info:QETH_CARD_TYPE_IQD},
-       {CCW_DEVICE(0x1731, 0x06), driver_info:QETH_CARD_TYPE_OSN},
+       {CCW_DEVICE(0x1731, 0x01), .driver_info = QETH_CARD_TYPE_OSAE},
+       {CCW_DEVICE(0x1731, 0x05), .driver_info = QETH_CARD_TYPE_IQD},
+       {CCW_DEVICE(0x1731, 0x06), .driver_info = QETH_CARD_TYPE_OSN},
        {},
 };
 MODULE_DEVICE_TABLE(ccw, qeth_ids);
@@ -8380,7 +8380,7 @@ out:
 
 static struct notifier_block qeth_ip_notifier = {
        qeth_ip_event,
-       0
+       NULL,
 };
 
 #ifdef CONFIG_QETH_IPV6
@@ -8433,7 +8433,7 @@ out:
 
 static struct notifier_block qeth_ip6_notifier = {
        qeth_ip6_event,
-       0
+       NULL,
 };
 #endif
 
@@ -8460,7 +8460,7 @@ qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr)
 
 static struct notifier_block qeth_reboot_notifier = {
        qeth_reboot_event,
-       0
+       NULL,
 };
 
 static int
index 185a9cfbcbdc76cff6128a60f1be96fb4bf6d743..001497bbea167c7b70e51bf4c3e80d1c4ce021a9 100644 (file)
@@ -1755,7 +1755,7 @@ qeth_driver_group_store(struct device_driver *ddrv, const char *buf,
 }
 
 
-static DRIVER_ATTR(group, 0200, 0, qeth_driver_group_store);
+static DRIVER_ATTR(group, 0200, NULL, qeth_driver_group_store);
 
 static ssize_t
 qeth_driver_notifier_register_store(struct device_driver *ddrv, const char *buf,
@@ -1783,7 +1783,7 @@ qeth_driver_notifier_register_store(struct device_driver *ddrv, const char *buf,
        return count;
 }
 
-static DRIVER_ATTR(notifier_register, 0200, 0,
+static DRIVER_ATTR(notifier_register, 0200, NULL,
                   qeth_driver_notifier_register_store);
 
 int
index 72118ee689549a3bdb499fcfc9b11d3feda2e753..b8179c27ceb6e1971bb78568ef82707cec64c8a1 100644 (file)
@@ -66,7 +66,7 @@ smsg_message_pending(iucv_MessagePending *eib, void *pgm_data)
                return;
        }
        rc = iucv_receive(eib->ippathid, eib->ipmsgid, eib->iptrgcls,
-                         msg, len, 0, 0, 0);
+                         msg, len, NULL, NULL, NULL);
        if (rc == 0) {
                msg[len] = 0;
                EBCASC(msg, len);
@@ -122,7 +122,7 @@ smsg_unregister_callback(char *prefix, void (*callback)(char *from, char *str))
        struct smsg_callback *cb, *tmp;
 
        spin_lock(&smsg_list_lock);
-       cb = 0;
+       cb = NULL;
        list_for_each_entry(tmp, &smsg_list, list)
                if (tmp->callback == callback &&
                    strcmp(tmp->prefix, prefix) == 0) {
@@ -139,7 +139,7 @@ smsg_exit(void)
 {
        if (smsg_handle > 0) {
                cpcmd("SET SMSG OFF", NULL, 0, NULL);
-               iucv_sever(smsg_pathid, 0);
+               iucv_sever(smsg_pathid, NULL);
                iucv_unregister_program(smsg_handle);
                driver_unregister(&smsg_driver);
        }
@@ -162,19 +162,19 @@ smsg_init(void)
                return rc;
        }
        smsg_handle = iucv_register_program("SMSGIUCV        ", "*MSG    ",
-                                           pgmmask, &smsg_ops, 0);
+                                           pgmmask, &smsg_ops, NULL);
        if (!smsg_handle) {
                printk(KERN_ERR "SMSGIUCV: failed to register to iucv");
                driver_unregister(&smsg_driver);
                return -EIO;    /* better errno ? */
        }
-       rc = iucv_connect (&smsg_pathid, 255, 0, "*MSG    ", 0, 0, 0, 0,
-                          smsg_handle, 0);
+       rc = iucv_connect (&smsg_pathid, 255, NULL, "*MSG    ", NULL, 0,
+                          NULL, NULL, smsg_handle, NULL);
        if (rc) {
                printk(KERN_ERR "SMSGIUCV: failed to connect to *MSG");
                iucv_unregister_program(smsg_handle);
                driver_unregister(&smsg_driver);
-               smsg_handle = 0;
+               smsg_handle = NULL;
                return -EIO;
        }
        cpcmd("SET SMSG IUCV", NULL, 0, NULL);
index ffb3677e354fe9c1a7d0848453d91353fb33cc7e..5399c5d99b81e0b5bc8f56949d4ec937711b6e67 100644 (file)
@@ -111,6 +111,16 @@ repeat:
                        break;
                case CRW_RSC_CPATH:
                        pr_debug("source is channel path %02X\n", crw[0].rsid);
+                       /*
+                        * Check for solicited machine checks. These are
+                        * created by reset channel path and need not be
+                        * reported to the common I/O layer.
+                        */
+                       if (crw[chain].slct) {
+                               DBG(KERN_INFO"solicited machine check for "
+                                   "channel path %02X\n", crw[0].rsid);
+                               break;
+                       }
                        switch (crw[0].erc) {
                        case CRW_ERC_IPARM: /* Path has come. */
                                ret = chp_process_crw(crw[0].rsid, 1);
index 6335f9229184004d1fd92194af65addb6e746355..31db2b06faba2922bc28130e937848de6c8ebf8b 100644 (file)
@@ -2227,7 +2227,7 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action,
        /* setup new FSF request */
        retval = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA,
                                     erp_action ? ZFCP_REQ_AUTO_CLEANUP : 0,
-                                    0, &lock_flags, &fsf_req);
+                                    NULL, &lock_flags, &fsf_req);
        if (retval < 0) {
                ZFCP_LOG_INFO("error: Out of resources. Could not create an "
                               "exchange port data request for"
index 46e14f22ec18fd004b2af2aece837cdba54e73e8..671f4a6a5d181cea8c5f73ebf8f6758072f186ec 100644 (file)
@@ -44,30 +44,29 @@ struct scsi_transport_template *zfcp_transport_template;
 
 struct zfcp_data zfcp_data = {
        .scsi_host_template = {
-             name:                    ZFCP_NAME,
-             proc_name:               "zfcp",
-             proc_info:               NULL,
-             detect:                  NULL,
-             slave_alloc:             zfcp_scsi_slave_alloc,
-             slave_configure:         zfcp_scsi_slave_configure,
-             slave_destroy:           zfcp_scsi_slave_destroy,
-             queuecommand:            zfcp_scsi_queuecommand,
-             eh_abort_handler:        zfcp_scsi_eh_abort_handler,
-             eh_device_reset_handler: zfcp_scsi_eh_device_reset_handler,
-             eh_bus_reset_handler:    zfcp_scsi_eh_bus_reset_handler,
-             eh_host_reset_handler:   zfcp_scsi_eh_host_reset_handler,
-                                      /* FIXME(openfcp): Tune */
-             can_queue:               4096,
-             this_id:                 -1,
-             /*
-              * FIXME:
-              * one less? can zfcp_create_sbale cope with it?
-              */
-             sg_tablesize:            ZFCP_MAX_SBALES_PER_REQ,
-             cmd_per_lun:             1,
-             unchecked_isa_dma:       0,
-             use_clustering:          1,
-             sdev_attrs:              zfcp_sysfs_sdev_attrs,
+               .name                   = ZFCP_NAME,
+               .proc_name              = "zfcp",
+               .proc_info              = NULL,
+               .detect                 = NULL,
+               .slave_alloc            = zfcp_scsi_slave_alloc,
+               .slave_configure        = zfcp_scsi_slave_configure,
+               .slave_destroy          = zfcp_scsi_slave_destroy,
+               .queuecommand           = zfcp_scsi_queuecommand,
+               .eh_abort_handler       = zfcp_scsi_eh_abort_handler,
+               .eh_device_reset_handler = zfcp_scsi_eh_device_reset_handler,
+               .eh_bus_reset_handler   = zfcp_scsi_eh_bus_reset_handler,
+               .eh_host_reset_handler  = zfcp_scsi_eh_host_reset_handler,
+               .can_queue              = 4096,
+               .this_id                = -1,
+               /*
+                * FIXME:
+                * one less? can zfcp_create_sbale cope with it?
+                */
+               .sg_tablesize           = ZFCP_MAX_SBALES_PER_REQ,
+               .cmd_per_lun            = 1,
+               .unchecked_isa_dma      = 0,
+               .use_clustering         = 1,
+               .sdev_attrs             = zfcp_sysfs_sdev_attrs,
        },
        .driver_version = ZFCP_VERSION,
        /* rest initialised with zeros */
index f9013baba05b4f09f6bb1b06e038e9db9b39f907..93bdaa3169fcc1a17bd32bf905db7c1bfd877c15 100644 (file)
@@ -1406,25 +1406,35 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m
        struct device_node *dp = op->node;
        struct uart_sunsu_port *up;
        struct resource *rp;
+       enum su_type type;
        int err;
 
-       if (inst >= UART_NR)
-               return -EINVAL;
+       type = su_get_type(dp);
+       if (type == SU_PORT_PORT) {
+               if (inst >= UART_NR)
+                       return -EINVAL;
+               up = &sunsu_ports[inst];
+       } else {
+               up = kzalloc(sizeof(*up), GFP_KERNEL);
+               if (!up)
+                       return -ENOMEM;
+       }
 
-       up = &sunsu_ports[inst];
        up->port.line = inst;
 
        spin_lock_init(&up->port.lock);
 
-       up->su_type = su_get_type(dp);
+       up->su_type = type;
 
        rp = &op->resource[0];
-       up->port.mapbase = op->resource[0].start;
-
+       up->port.mapbase = rp->start;
        up->reg_size = (rp->end - rp->start) + 1;
        up->port.membase = of_ioremap(rp, 0, up->reg_size, "su");
-       if (!up->port.membase)
+       if (!up->port.membase) {
+               if (type != SU_PORT_PORT)
+                       kfree(up);
                return -ENOMEM;
+       }
 
        up->port.irq = op->irqs[0];
 
@@ -1436,8 +1446,11 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m
        err = 0;
        if (up->su_type == SU_PORT_KBD || up->su_type == SU_PORT_MS) {
                err = sunsu_kbd_ms_init(up);
-               if (err)
+               if (err) {
+                       kfree(up);
                        goto out_unmap;
+               }
+               dev_set_drvdata(&op->dev, up);
 
                return 0;
        }
@@ -1476,8 +1489,12 @@ static int __devexit su_remove(struct of_device *dev)
 #ifdef CONFIG_SERIO
                serio_unregister_port(&up->serio);
 #endif
-       } else if (up->port.type != PORT_UNKNOWN)
+               kfree(up);
+       } else if (up->port.type != PORT_UNKNOWN) {
                uart_remove_one_port(&sunsu_reg, &up->port);
+       }
+
+       dev_set_drvdata(&dev->dev, NULL);
 
        return 0;
 }
index 7fdbc5dad5fd9d364a62fa95793c93b8a73734cf..2ee742d40c43e3708ea7c8fbce9e4096f6181a77 100644 (file)
@@ -23,6 +23,7 @@ config USB_ARCH_HAS_OHCI
        default y if ARCH_LH7A404
        default y if ARCH_S3C2410
        default y if PXA27x
+       default y if ARCH_EP93XX
        default y if ARCH_AT91RM9200
        # PPC:
        default y if STB03xxx
index c7123bf71c582bb1627ddc5116ce7723cab4eb1a..4710eb02ed640b7b572c223e2792759e2ff0a76d 100644 (file)
@@ -48,7 +48,7 @@ obj-$(CONFIG_USB_MICROTEK)    += image/
 obj-$(CONFIG_USB_SERIAL)       += serial/
 
 obj-$(CONFIG_USB_AUERSWALD)    += misc/
-obj-$(CONFIG_USB_CY7C63)       += misc/
+obj-$(CONFIG_USB_CYPRESS_CY7C63)+= misc/
 obj-$(CONFIG_USB_CYTHERM)      += misc/
 obj-$(CONFIG_USB_EMI26)                += misc/
 obj-$(CONFIG_USB_EMI62)                += misc/
index 3670d77e912ca4a068a3dc46e93ae8696aeca242..ca90326f2f5c6983ad6a6cd44f6980251ea11ca9 100644 (file)
@@ -291,13 +291,13 @@ static void acm_read_bulk(struct urb *urb, struct pt_regs *regs)
        struct acm_ru *rcv = urb->context;
        struct acm *acm = rcv->instance;
        int status = urb->status;
-       dbg("Entering acm_read_bulk with status %d\n", urb->status);
+       dbg("Entering acm_read_bulk with status %d", urb->status);
 
        if (!ACM_READY(acm))
                return;
 
        if (status)
-               dev_dbg(&acm->data->dev, "bulk rx status %d\n", status);
+               dev_dbg(&acm->data->dev, "bulk rx status %d", status);
 
        buf = rcv->buffer;
        buf->size = urb->actual_length;
@@ -343,7 +343,7 @@ next_buffer:
        list_del(&buf->list);
        spin_unlock(&acm->read_lock);
 
-       dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d\n", buf, buf->size);
+       dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size);
 
        tty_buffer_request_room(tty, buf->size);
        if (!acm->throttle)
@@ -394,7 +394,7 @@ urbs:
                rcv->urb->transfer_dma = buf->dma;
                rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 
-               dbg("acm_rx_tasklet: sending urb 0x%p, rcv 0x%p, buf 0x%p\n", rcv->urb, rcv, buf);
+               dbg("acm_rx_tasklet: sending urb 0x%p, rcv 0x%p, buf 0x%p", rcv->urb, rcv, buf);
 
                /* This shouldn't kill the driver as unsuccessful URBs are returned to the
                   free-urbs-pool and resubmited ASAP */
@@ -413,7 +413,7 @@ static void acm_write_bulk(struct urb *urb, struct pt_regs *regs)
 {
        struct acm *acm = (struct acm *)urb->context;
 
-       dbg("Entering acm_write_bulk with status %d\n", urb->status);
+       dbg("Entering acm_write_bulk with status %d", urb->status);
 
        acm_write_done(acm);
        acm_write_start(acm);
@@ -424,7 +424,7 @@ static void acm_write_bulk(struct urb *urb, struct pt_regs *regs)
 static void acm_softint(void *private)
 {
        struct acm *acm = private;
-       dbg("Entering acm_softint.\n");
+       dbg("Entering acm_softint.");
        
        if (!ACM_READY(acm))
                return;
@@ -440,7 +440,7 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
        struct acm *acm;
        int rv = -EINVAL;
        int i;
-       dbg("Entering acm_tty_open.\n");
+       dbg("Entering acm_tty_open.");
 
        mutex_lock(&open_mutex);
 
@@ -541,7 +541,7 @@ static int acm_tty_write(struct tty_struct *tty, const unsigned char *buf, int c
        int wbn;
        struct acm_wb *wb;
 
-       dbg("Entering acm_tty_write to write %d bytes,\n", count);
+       dbg("Entering acm_tty_write to write %d bytes,", count);
 
        if (!ACM_READY(acm))
                return -EINVAL;
@@ -793,7 +793,7 @@ static int acm_probe (struct usb_interface *intf,
 
        if (!buflen) {
                if (intf->cur_altsetting->endpoint->extralen && intf->cur_altsetting->endpoint->extra) {
-                       dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint\n");
+                       dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint");
                        buflen = intf->cur_altsetting->endpoint->extralen;
                        buffer = intf->cur_altsetting->endpoint->extra;
                } else {
@@ -842,24 +842,24 @@ next_desc:
 
        if (!union_header) {
                if (call_interface_num > 0) {
-                       dev_dbg(&intf->dev,"No union descriptor, using call management descriptor\n");
+                       dev_dbg(&intf->dev,"No union descriptor, using call management descriptor");
                        data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = call_interface_num));
                        control_interface = intf;
                } else {
-                       dev_dbg(&intf->dev,"No union descriptor, giving up\n");
+                       dev_dbg(&intf->dev,"No union descriptor, giving up");
                        return -ENODEV;
                }
        } else {
                control_interface = usb_ifnum_to_if(usb_dev, union_header->bMasterInterface0);
                data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = union_header->bSlaveInterface0));
                if (!control_interface || !data_interface) {
-                       dev_dbg(&intf->dev,"no interfaces\n");
+                       dev_dbg(&intf->dev,"no interfaces");
                        return -ENODEV;
                }
        }
        
        if (data_interface_num != call_interface_num)
-               dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.\n");
+               dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.");
 
 skip_normal_probe:
 
@@ -867,7 +867,7 @@ skip_normal_probe:
        if (data_interface->cur_altsetting->desc.bInterfaceClass != CDC_DATA_INTERFACE_TYPE) {
                if (control_interface->cur_altsetting->desc.bInterfaceClass == CDC_DATA_INTERFACE_TYPE) {
                        struct usb_interface *t;
-                       dev_dbg(&intf->dev,"Your device has switched interfaces.\n");
+                       dev_dbg(&intf->dev,"Your device has switched interfaces.");
 
                        t = control_interface;
                        control_interface = data_interface;
@@ -878,7 +878,7 @@ skip_normal_probe:
        }
        
        if (usb_interface_claimed(data_interface)) { /* valid in this context */
-               dev_dbg(&intf->dev,"The data interface isn't available\n");
+               dev_dbg(&intf->dev,"The data interface isn't available");
                return -EBUSY;
        }
 
@@ -895,7 +895,7 @@ skip_normal_probe:
        if ((epread->bEndpointAddress & USB_DIR_IN) != USB_DIR_IN) {
                /* descriptors are swapped */
                struct usb_endpoint_descriptor *t;
-               dev_dbg(&intf->dev,"The data interface has switched endpoints\n");
+               dev_dbg(&intf->dev,"The data interface has switched endpoints");
                
                t = epread;
                epread = epwrite;
@@ -910,7 +910,7 @@ skip_normal_probe:
        }
 
        if (!(acm = kzalloc(sizeof(struct acm), GFP_KERNEL))) {
-               dev_dbg(&intf->dev, "out of memory (acm kzalloc)\n");
+               dev_dbg(&intf->dev, "out of memory (acm kzalloc)");
                goto alloc_fail;
        }
 
@@ -936,26 +936,26 @@ skip_normal_probe:
 
        buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
        if (!buf) {
-               dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n");
+               dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)");
                goto alloc_fail2;
        }
        acm->ctrl_buffer = buf;
 
        if (acm_write_buffers_alloc(acm) < 0) {
-               dev_dbg(&intf->dev, "out of memory (write buffer alloc)\n");
+               dev_dbg(&intf->dev, "out of memory (write buffer alloc)");
                goto alloc_fail4;
        }
 
        acm->ctrlurb = usb_alloc_urb(0, GFP_KERNEL);
        if (!acm->ctrlurb) {
-               dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)\n");
+               dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)");
                goto alloc_fail5;
        }
        for (i = 0; i < num_rx_buf; i++) {
                struct acm_ru *rcv = &(acm->ru[i]);
 
                if (!(rcv->urb = usb_alloc_urb(0, GFP_KERNEL))) {
-                       dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)\n");
+                       dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)");
                        goto alloc_fail7;
                }
 
@@ -966,13 +966,13 @@ skip_normal_probe:
                struct acm_rb *buf = &(acm->rb[i]);
 
                if (!(buf->base = usb_buffer_alloc(acm->dev, readsize, GFP_KERNEL, &buf->dma))) {
-                       dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)\n");
+                       dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)");
                        goto alloc_fail7;
                }
        }
        acm->writeurb = usb_alloc_urb(0, GFP_KERNEL);
        if (!acm->writeurb) {
-               dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)\n");
+               dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)");
                goto alloc_fail7;
        }
 
@@ -1086,6 +1086,9 @@ static struct usb_device_id acm_ids[] = {
        { USB_DEVICE(0x0ace, 0x1608), /* ZyDAS 56K USB MODEM */
        .driver_info = SINGLE_RX_URB, /* firmware bug */
        },
+       { USB_DEVICE(0x0ace, 0x1611), /* ZyDAS 56K USB MODEM - new version */
+       .driver_info = SINGLE_RX_URB, /* firmware bug */
+       },
        /* control interfaces with various AT-command sets */
        { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
                USB_CDC_ACM_PROTO_AT_V25TER) },
index a08787e253aaa17176cf786621765a39fced7c4e..6e3b5358a760453338ce796e6dd07fb0c3981263 100644 (file)
@@ -31,9 +31,6 @@ config USB_DEVICEFS
          For the format of the various /proc/bus/usb/ files, please read
          <file:Documentation/usb/proc_usb_info.txt>.
 
-         Please note that this code is completely unrelated to devfs, the
-         "/dev file system support".
-
          Most users want to say Y here.
 
 config USB_BANDWIDTH
index 875596e98e422de1c18bbdadf37db2886193d0f4..26c8cb5f3e6722467379204762fb5d8a89b938a0 100644 (file)
@@ -1790,7 +1790,10 @@ static int finish_device_resume(struct usb_device *udev)
         * and device drivers will know about any resume quirks.
         */
        status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus);
-       if (status < 2)
+       if (status >= 0)
+               status = (status == 2 ? 0 : -ENODEV);
+
+       if (status)
                dev_dbg(&udev->dev,
                        "gone after usb resume? status %d\n",
                        status);
@@ -1879,7 +1882,12 @@ hub_port_resume(struct usb_hub *hub, int port1, struct usb_device *udev)
                        dev_dbg(hub->intfdev,
                                "port %d status %04x.%04x after resume, %d\n",
                                port1, portchange, devstatus, status);
+                       if (status >= 0)
+                               status = -ENODEV;
                } else {
+                       if (portchange & USB_PORT_STAT_C_SUSPEND)
+                               clear_port_feature(hub->hdev, port1,
+                                               USB_PORT_FEAT_C_SUSPEND);
                        /* TRSMRCY = 10 msec */
                        msleep(10);
                        if (udev)
index f48c3dbc367ae4e97aa7919c15439a5c0207a9ed..3182c2224ba24f79c428242e431eaff03bbeba51 100644 (file)
@@ -695,7 +695,7 @@ static void usbfs_remove_device(struct usb_device *dev)
                wake_up_all(&ds->wait);
                list_del_init(&ds->list);
                if (ds->discsignr) {
-                       sinfo.si_signo = SIGPIPE;
+                       sinfo.si_signo = ds->discsignr;
                        sinfo.si_errno = EPIPE;
                        sinfo.si_code = SI_ASYNCIO;
                        sinfo.si_addr = ds->disccontext;
index f7c6d758e1b00d0cfb953991ca745bdf53fc8727..53d584589c267abe0519b5c57f177ab20b7d758d 100644 (file)
 
 
 /* we must assign addresses for configurable endpoints (like net2280) */
-static __initdata unsigned epnum;
+static __devinitdata unsigned epnum;
 
 // #define MANY_ENDPOINTS
 #ifdef MANY_ENDPOINTS
 /* more than 15 configurable endpoints */
-static __initdata unsigned in_epnum;
+static __devinitdata unsigned in_epnum;
 #endif
 
 
@@ -59,7 +59,7 @@ static __initdata unsigned in_epnum;
  * NOTE:  each endpoint is unidirectional, as specified by its USB
  * descriptor; and isn't specific to a configuration or altsetting.
  */
-static int __init
+static int __devinit
 ep_matches (
        struct usb_gadget               *gadget,
        struct usb_ep                   *ep,
@@ -73,7 +73,7 @@ ep_matches (
        /* endpoint already claimed? */
        if (0 != ep->driver_data)
                return 0;
-               
+
        /* only support ep0 for portable CONTROL traffic */
        type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
        if (USB_ENDPOINT_XFER_CONTROL == type)
@@ -186,7 +186,7 @@ ep_matches (
        return 1;
 }
 
-static struct usb_ep * __init
+static struct usb_ep * __devinit
 find_ep (struct usb_gadget *gadget, const char *name)
 {
        struct usb_ep   *ep;
@@ -228,7 +228,7 @@ find_ep (struct usb_gadget *gadget, const char *name)
  *
  * On failure, this returns a null endpoint descriptor.
  */
-struct usb_ep * __init usb_ep_autoconfig (
+struct usb_ep * __devinit usb_ep_autoconfig (
        struct usb_gadget               *gadget,
        struct usb_endpoint_descriptor  *desc
 )
@@ -276,7 +276,7 @@ struct usb_ep * __init usb_ep_autoconfig (
                        return ep;
        }
 
-       /* Second, look at endpoints until an unclaimed one looks usable */ 
+       /* Second, look at endpoints until an unclaimed one looks usable */
        list_for_each_entry (ep, &gadget->ep_list, ep_list) {
                if (ep_matches (gadget, ep, desc))
                        return ep;
@@ -295,7 +295,7 @@ struct usb_ep * __init usb_ep_autoconfig (
  * state such as ep->driver_data and the record of assigned endpoints
  * used by usb_ep_autoconfig().
  */
-void __init usb_ep_autoconfig_reset (struct usb_gadget *gadget)
+void __devinit usb_ep_autoconfig_reset (struct usb_gadget *gadget)
 {
        struct usb_ep   *ep;
 
index 8320fcef04256f642cfa3830bfe8ba20043dcd9d..4fe1bec1c25559127e0570cb9ad60e65cf986869 100644 (file)
@@ -2131,7 +2131,7 @@ eth_req_free (struct usb_ep *ep, struct usb_request *req)
 }
 
 
-static void __exit
+static void /* __init_or_exit */
 eth_unbind (struct usb_gadget *gadget)
 {
        struct eth_dev          *dev = get_gadget_data (gadget);
@@ -2158,7 +2158,7 @@ eth_unbind (struct usb_gadget *gadget)
        set_gadget_data (gadget, NULL);
 }
 
-static u8 __init nibble (unsigned char c)
+static u8 __devinit nibble (unsigned char c)
 {
        if (likely (isdigit (c)))
                return c - '0';
@@ -2168,7 +2168,7 @@ static u8 __init nibble (unsigned char c)
        return 0;
 }
 
-static int __init get_ether_addr(const char *str, u8 *dev_addr)
+static int __devinit get_ether_addr(const char *str, u8 *dev_addr)
 {
        if (str) {
                unsigned        i;
@@ -2189,7 +2189,7 @@ static int __init get_ether_addr(const char *str, u8 *dev_addr)
        return 1;
 }
 
-static int __init
+static int __devinit
 eth_bind (struct usb_gadget *gadget)
 {
        struct eth_dev          *dev;
index b1a9cf06f3e67efe3f0baf87d7dd834d265aaa8d..8d7f1e84cd7b048eadc36df840c383ff7c7bfab8 100644 (file)
@@ -3691,7 +3691,7 @@ static void lun_release(struct device *dev)
        kref_put(&fsg->ref, fsg_release);
 }
 
-static void __exit fsg_unbind(struct usb_gadget *gadget)
+static void /* __init_or_exit */ fsg_unbind(struct usb_gadget *gadget)
 {
        struct fsg_dev          *fsg = get_gadget_data(gadget);
        int                     i;
index 354670d123080c4f244e387409feeb8e0f847cb2..408c3380d60203254b510c43a728da6214a42c7c 100644 (file)
@@ -1398,7 +1398,7 @@ static struct proc_dir_entry *rndis_connect_state [RNDIS_MAX_CONFIGS];
 #endif /* CONFIG_USB_GADGET_DEBUG_FILES */
 
 
-int __init rndis_init (void)
+int __devinit rndis_init (void)
 {
        u8 i;
 
index 2956608be751f70095bfb8ff8d2890b05060ecee..4c3c7259f019bd072c3d205db4d563157b6a576c 100644 (file)
@@ -264,7 +264,7 @@ int  rndis_signal_disconnect (int configNr);
 int  rndis_state (int configNr);
 extern void rndis_set_host_mac (int configNr, const u8 *addr);
 
-int __init rndis_init (void);
+int __devinit rndis_init (void);
 void rndis_exit (void);
 
 #endif  /* _LINUX_RNDIS_H */
index 30d7664d449d7d34340efbd06813461f517d4fa0..e762aa19ab0a1c9fef4a87a105b0221b95e3ddad 100644 (file)
@@ -1473,7 +1473,7 @@ autoconf_fail:
  * Called on module unload.  Frees the control request and device
  * structure.
  */
-static void __exit gs_unbind(struct usb_gadget *gadget)
+static void /* __init_or_exit */ gs_unbind(struct usb_gadget *gadget)
 {
        struct gs_dev *dev = get_gadget_data(gadget);
 
index 3a08a7ab4ce062b83039b98b94c121a955b4dc60..b7018ee487ea51fbe60ed42455410a4cb40feeaf 100644 (file)
@@ -1121,7 +1121,7 @@ zero_autoresume (unsigned long _dev)
 
 /*-------------------------------------------------------------------------*/
 
-static void __exit
+static void /* __init_or_exit */
 zero_unbind (struct usb_gadget *gadget)
 {
        struct zero_dev         *dev = get_gadget_data (gadget);
index d66867aa527e5630144cd879d40717fe68778a62..26ed757d22a66139ea500eaddc1130f4eeb2baf4 100644 (file)
@@ -41,8 +41,6 @@
 #endif
 #define USBH_DISABLE      (USB_MCFG_EBMEN | USB_MCFG_EMEMEN)
 
-#endif                         /* Au1200 */
-
 extern int usb_disabled(void);
 
 /*-------------------------------------------------------------------------*/
@@ -107,9 +105,9 @@ int usb_ehci_au1xxx_probe(const struct hc_driver *driver,
 
        /* Au1200 AB USB does not support coherent memory */
        if (!(read_c0_prid() & 0xff)) {
-               pr_info("%s: this is chip revision AB!\n", dev->dev.name);
+               pr_info("%s: this is chip revision AB!\n", dev->name);
                pr_info("%s: update your board or re-configure the kernel\n",
-                       dev->dev.name);
+                       dev->name);
                return -ENODEV;
        }
 #endif
@@ -228,9 +226,8 @@ static const struct hc_driver ehci_au1xxx_hc_driver = {
 
 /*-------------------------------------------------------------------------*/
 
-static int ehci_hcd_au1xxx_drv_probe(struct device *dev)
+static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
        struct usb_hcd *hcd = NULL;
        int ret;
 
@@ -243,10 +240,9 @@ static int ehci_hcd_au1xxx_drv_probe(struct device *dev)
        return ret;
 }
 
-static int ehci_hcd_au1xxx_drv_remove(struct device *dev)
+static int ehci_hcd_au1xxx_drv_remove(struct platform_device *pdev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct usb_hcd *hcd = dev_get_drvdata(dev);
+       struct usb_hcd *hcd = platform_get_drvdata(pdev);
 
        usb_ehci_au1xxx_remove(hcd, pdev);
        return 0;
@@ -269,12 +265,13 @@ static int ehci_hcd_au1xxx_drv_resume(struct device *dev)
 }
 */
 MODULE_ALIAS("au1xxx-ehci");
-/* FIXME use "struct platform_driver" */
-static struct device_driver ehci_hcd_au1xxx_driver = {
-       .name = "au1xxx-ehci",
-       .bus = &platform_bus_type,
+static struct platform_driver ehci_hcd_au1xxx_driver = {
        .probe = ehci_hcd_au1xxx_drv_probe,
        .remove = ehci_hcd_au1xxx_drv_remove,
        /*.suspend      = ehci_hcd_au1xxx_drv_suspend, */
        /*.resume       = ehci_hcd_au1xxx_drv_resume, */
+       .driver = {
+               .name = "au1xxx-ehci",
+               .bus = &platform_bus_type
+       }
 };
index cee6f538de0a2760abc086edbe5eb549003fd5d2..85b0b4ad4c16ec58de1ebf8016ad25f6b3829e1a 100644 (file)
@@ -625,10 +625,11 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs)
                        writel (status | CMD_RUN, &ehci->regs->command);
 
                while (i--) {
-                       status = readl (&ehci->regs->port_status [i]);
-                       if (status & PORT_OWNER)
+                       int pstatus = readl (&ehci->regs->port_status [i]);
+
+                       if (pstatus & PORT_OWNER)
                                continue;
-                       if (!(status & PORT_RESUME)
+                       if (!(pstatus & PORT_RESUME)
                                        || ehci->reset_done [i] != 0)
                                continue;
 
index 689261e44018e128566569498556687ce68a2360..822914e2f43bbbe80a31616da47f40d3dfc06a4a 100644 (file)
@@ -101,13 +101,16 @@ static void au1xxx_start_ohc(struct platform_device *dev)
 
 #endif  /* Au1200 */
 
+#ifndef CONFIG_SOC_AU1200
        /* wait for reset complete (read register twice; see au1500 errata) */
        while (au_readl(USB_HOST_CONFIG),
                !(au_readl(USB_HOST_CONFIG) & USBH_ENABLE_RD))
+#endif
                udelay(1000);
 
        printk(KERN_DEBUG __FILE__
        ": Clock to USB host has been enabled \n");
+#endif
 }
 
 static void au1xxx_stop_ohc(struct platform_device *dev)
@@ -157,9 +160,9 @@ static int usb_ohci_au1xxx_probe(const struct hc_driver *driver,
        /* Au1200 AB USB does not support coherent memory */
        if (!(read_c0_prid() & 0xff)) {
                pr_info("%s: this is chip revision AB !!\n",
-                       dev->dev.name);
+                       dev->name);
                pr_info("%s: update your board or re-configure the kernel\n",
-                       dev->dev.name);
+                       dev->name);
                return -ENODEV;
        }
 #endif
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c
new file mode 100644 (file)
index 0000000..6531c4d
--- /dev/null
@@ -0,0 +1,225 @@
+/*
+ * OHCI HCD (Host Controller Driver) for USB.
+ *
+ * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
+ * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
+ * (C) Copyright 2002 Hewlett-Packard Company
+ *
+ * Bus Glue for ep93xx.
+ *
+ * Written by Christopher Hoover <ch@hpl.hp.com>
+ * Based on fragments of previous driver by Russell King et al.
+ *
+ * Modified for LH7A404 from ohci-sa1111.c
+ *  by Durgesh Pattamatta <pattamattad@sharpsec.com>
+ *
+ * Modified for pxa27x from ohci-lh7a404.c
+ *  by Nick Bane <nick@cecomputing.co.uk> 26-8-2004
+ *
+ * Modified for ep93xx from ohci-pxa27x.c
+ *  by Lennert Buytenhek <buytenh@wantstofly.org> 28-2-2006
+ *  Based on an earlier driver by Ray Lehtiniemi
+ *
+ * This file is licenced under the GPL.
+ */
+
+#include <linux/clk.h>
+#include <linux/device.h>
+#include <linux/signal.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+
+static struct clk *usb_host_clock;
+
+static void ep93xx_start_hc(struct device *dev)
+{
+       clk_enable(usb_host_clock);
+}
+
+static void ep93xx_stop_hc(struct device *dev)
+{
+       clk_disable(usb_host_clock);
+}
+
+static int usb_hcd_ep93xx_probe(const struct hc_driver *driver,
+                        struct platform_device *pdev)
+{
+       int retval;
+       struct usb_hcd *hcd;
+
+       if (pdev->resource[1].flags != IORESOURCE_IRQ) {
+               pr_debug("resource[1] is not IORESOURCE_IRQ");
+               return -ENOMEM;
+       }
+
+       hcd = usb_create_hcd(driver, &pdev->dev, "ep93xx");
+       if (hcd == NULL)
+               return -ENOMEM;
+
+       hcd->rsrc_start = pdev->resource[0].start;
+       hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1;
+       if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
+               usb_put_hcd(hcd);
+               retval = -EBUSY;
+               goto err1;
+       }
+
+       hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
+       if (hcd->regs == NULL) {
+               pr_debug("ioremap failed");
+               retval = -ENOMEM;
+               goto err2;
+       }
+
+       usb_host_clock = clk_get(&pdev->dev, "usb_host");
+       ep93xx_start_hc(&pdev->dev);
+
+       ohci_hcd_init(hcd_to_ohci(hcd));
+
+       retval = usb_add_hcd(hcd, pdev->resource[1].start, SA_INTERRUPT);
+       if (retval == 0)
+               return retval;
+
+       ep93xx_stop_hc(&pdev->dev);
+       iounmap(hcd->regs);
+err2:
+       release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+err1:
+       usb_put_hcd(hcd);
+
+       return retval;
+}
+
+static void usb_hcd_ep93xx_remove(struct usb_hcd *hcd,
+                       struct platform_device *pdev)
+{
+       usb_remove_hcd(hcd);
+       ep93xx_stop_hc(&pdev->dev);
+       clk_put(usb_host_clock);
+       iounmap(hcd->regs);
+       release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+       usb_put_hcd(hcd);
+}
+
+static int __devinit ohci_ep93xx_start(struct usb_hcd *hcd)
+{
+       struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+       int ret;
+
+       if ((ret = ohci_init(ohci)) < 0)
+               return ret;
+
+       if ((ret = ohci_run(ohci)) < 0) {
+               err("can't start %s", hcd->self.bus_name);
+               ohci_stop(hcd);
+               return ret;
+       }
+
+       return 0;
+}
+
+static struct hc_driver ohci_ep93xx_hc_driver = {
+       .description            = hcd_name,
+       .product_desc           = "EP93xx OHCI",
+       .hcd_priv_size          = sizeof(struct ohci_hcd),
+       .irq                    = ohci_irq,
+       .flags                  = HCD_USB11 | HCD_MEMORY,
+       .start                  = ohci_ep93xx_start,
+       .stop                   = ohci_stop,
+       .urb_enqueue            = ohci_urb_enqueue,
+       .urb_dequeue            = ohci_urb_dequeue,
+       .endpoint_disable       = ohci_endpoint_disable,
+       .get_frame_number       = ohci_get_frame,
+       .hub_status_data        = ohci_hub_status_data,
+       .hub_control            = ohci_hub_control,
+#ifdef CONFIG_PM
+       .bus_suspend            = ohci_bus_suspend,
+       .bus_resume             = ohci_bus_resume,
+#endif
+       .start_port_reset       = ohci_start_port_reset,
+};
+
+extern int usb_disabled(void);
+
+static int ohci_hcd_ep93xx_drv_probe(struct platform_device *pdev)
+{
+       int ret;
+
+       ret = -ENODEV;
+       if (!usb_disabled())
+               ret = usb_hcd_ep93xx_probe(&ohci_ep93xx_hc_driver, pdev);
+
+       return ret;
+}
+
+static int ohci_hcd_ep93xx_drv_remove(struct platform_device *pdev)
+{
+       struct usb_hcd *hcd = platform_get_drvdata(pdev);
+
+       usb_hcd_ep93xx_remove(hcd, pdev);
+
+       return 0;
+}
+
+#ifdef CONFIG_PM
+static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_t state)
+{
+       struct usb_hcd *hcd = platform_get_drvdata(pdev);
+       struct ochi_hcd *ohci = hcd_to_ohci(hcd);
+
+       if (time_before(jiffies, ohci->next_statechange))
+               msleep(5);
+       ohci->next_statechange = jiffies;
+
+       ep93xx_stop_hc(&pdev->dev);
+       hcd->state = HC_STATE_SUSPENDED;
+       pdev->dev.power.power_state = PMSG_SUSPEND;
+
+       return 0;
+}
+
+static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)
+{
+       struct usb_hcd *hcd = platform_get_drvdata(pdev);
+       struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+       int status;
+
+       if (time_before(jiffies, ohci->next_statechange))
+               msleep(5);
+       ohci->next_statechange = jiffies;
+
+       ep93xx_start_hc(&pdev->dev);
+       pdev->dev.power.power_state = PMSG_ON;
+       usb_hcd_resume_root_hub(hcd);
+
+       return 0;
+}
+#endif
+
+
+static struct platform_driver ohci_hcd_ep93xx_driver = {
+       .probe          = ohci_hcd_ep93xx_drv_probe,
+       .remove         = ohci_hcd_ep93xx_drv_remove,
+#ifdef CONFIG_PM
+       .suspend        = ohci_hcd_ep93xx_drv_suspend,
+       .resume         = ohci_hcd_ep93xx_drv_resume,
+#endif
+       .driver         = {
+               .name   = "ep93xx-ohci",
+       },
+};
+
+static int __init ohci_hcd_ep93xx_init(void)
+{
+       return platform_driver_register(&ohci_hcd_ep93xx_driver);
+}
+
+static void __exit ohci_hcd_ep93xx_cleanup(void)
+{
+       platform_driver_unregister(&ohci_hcd_ep93xx_driver);
+}
+
+module_init(ohci_hcd_ep93xx_init);
+module_exit(ohci_hcd_ep93xx_cleanup);
index 8fb842ed5f6e1ef0f58d8e3d0a4b953f94fdee33..afef5ac35b4af79d3137532898930a8bbea40c86 100644 (file)
@@ -901,6 +901,10 @@ MODULE_LICENSE ("GPL");
 #include "ohci-pxa27x.c"
 #endif
 
+#ifdef CONFIG_ARCH_EP93XX
+#include "ohci-ep93xx.c"
+#endif
+
 #ifdef CONFIG_SOC_AU1X00
 #include "ohci-au1xxx.c"
 #endif
@@ -919,6 +923,7 @@ MODULE_LICENSE ("GPL");
       || defined(CONFIG_ARCH_OMAP) \
       || defined (CONFIG_ARCH_LH7A404) \
       || defined (CONFIG_PXA27x) \
+      || defined (CONFIG_ARCH_EP93XX) \
       || defined (CONFIG_SOC_AU1X00) \
       || defined (CONFIG_USB_OHCI_HCD_PPC_SOC) \
       || defined (CONFIG_ARCH_AT91RM9200) \
index 0bb972b58336c5f01ad1fbe18f99a3dafb640a82..5b0a23fd798bb46294885432878e4c6429a660ed 100644 (file)
@@ -581,14 +581,14 @@ static int ohci_hub_control (
                break;
        case GetHubStatus:
                temp = roothub_status (ohci) & ~(RH_HS_CRWE | RH_HS_DRWE);
-               *(__le32 *) buf = cpu_to_le32 (temp);
+               put_unaligned(cpu_to_le32 (temp), (__le32 *) buf);
                break;
        case GetPortStatus:
                if (!wIndex || wIndex > ports)
                        goto error;
                wIndex--;
                temp = roothub_portstatus (ohci, wIndex);
-               *(__le32 *) buf = cpu_to_le32 (temp);
+               put_unaligned(cpu_to_le32 (temp), (__le32 *) buf);
 
 #ifndef        OHCI_VERBOSE_DEBUG
        if (*(u16*)(buf+2))     /* only if wPortChange is interesting */
index dff60568b4a147cb2e1875c4659bf8cb3a2db164..20861650905e63606955056b5169581a0b92463c 100644 (file)
@@ -167,8 +167,6 @@ static int __devinit mmio_resource_enabled(struct pci_dev *pdev, int idx)
 static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
 {
        void __iomem *base;
-       int wait_time;
-       u32 control;
 
        if (!mmio_resource_enabled(pdev, 0))
                return;
@@ -179,9 +177,10 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
 
 /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */
 #ifndef __hppa__
-       control = readl(base + OHCI_CONTROL);
+{
+       u32 control = readl(base + OHCI_CONTROL);
        if (control & OHCI_CTRL_IR) {
-               wait_time = 500; /* arbitrary; 5 seconds */
+               int wait_time = 500; /* arbitrary; 5 seconds */
                writel(OHCI_INTR_OC, base + OHCI_INTRENABLE);
                writel(OHCI_OCR, base + OHCI_CMDSTATUS);
                while (wait_time > 0 &&
@@ -198,6 +197,7 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
                /* reset controller, preserving RWC */
                writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL);
        }
+}
 #endif
 
        /*
index b9fb9687f9266f287addecae037dd5045b7034a6..8ea9c915fbf9722eea1e6b74a6ba3c4384d5801b 100644 (file)
@@ -1507,6 +1507,9 @@ void hid_init_reports(struct hid_device *hid)
 #define USB_DEVICE_ID_4_PHIDGETSERVO_20        0x8104
 #define USB_DEVICE_ID_DUAL_USB_JOYPAD   0x8866
 
+#define USB_VENDOR_ID_WISEGROUP_LTD    0x6677
+#define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802
+
 #define USB_VENDOR_ID_CODEMERCS                0x07c0
 #define USB_DEVICE_ID_CODEMERCS_IOW40  0x1500
 #define USB_DEVICE_ID_CODEMERCS_IOW24  0x1501
@@ -1670,6 +1673,7 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
+       { USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
 
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL },
        { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 },
index daa486dde8cfe665ef1bed16d2dae0ea1ed07f1c..88928a4be8057e9c286218ecacfecb17334db45e 100644 (file)
@@ -88,19 +88,19 @@ config USB_LED
          To compile this driver as a module, choose M here: the
          module will be called usbled.
 
-config USB_CY7C63
+config USB_CYPRESS_CY7C63
        tristate "Cypress CY7C63xxx USB driver support"
        depends on USB
        help
          Say Y here if you want to connect a Cypress CY7C63xxx
-         micro controller to your computer's USB port. This driver
-         supports the pre-programmed devices (incl. firmware) by
-         AK Modul-Bus Computer GmbH.
+         micro controller to your computer's USB port. Currently this
+         driver supports the pre-programmed devices (incl. firmware)
+         by AK Modul-Bus Computer GmbH.
 
          Please see: http://www.ak-modul-bus.de/stat/mikrocontroller.html
 
          To compile this driver as a module, choose M here: the
-         module will be called cy7c63.
+         module will be called cypress_cy7c63.
 
 config USB_CYTHERM
        tristate "Cypress USB thermometer driver support"
index f25a972272973b563ccc5677171e45d06d5467df..2927260c5812eed54c2ad21cb001762430d3f4cf 100644 (file)
@@ -4,7 +4,7 @@
 #
 
 obj-$(CONFIG_USB_AUERSWALD)    += auerswald.o
-obj-$(CONFIG_USB_CY7C63)       += cy7c63.o
+obj-$(CONFIG_USB_CYPRESS_CY7C63)+= cypress_cy7c63.o
 obj-$(CONFIG_USB_CYTHERM)      += cytherm.o
 obj-$(CONFIG_USB_EMI26)                += emi26.o
 obj-$(CONFIG_USB_EMI62)                += emi62.o
diff --git a/drivers/usb/misc/cy7c63.c b/drivers/usb/misc/cy7c63.c
deleted file mode 100644 (file)
index 8a1c10b..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
-* cy7c63.c
-*
-* Copyright (c) 2006 Oliver Bock (bock@fh-wolfenbuettel.de)
-*
-*      This driver is based on the Cypress Thermometer USB Driver by
-*      Marcus Maul and the 2.0 version of Greg Kroah-Hartman's
-*      USB Skeleton driver.
-*
-*      Is is a generic driver for the Cypress CY7C63000 family.
-*      For the time being it enables you to toggle the single I/O ports
-*      of the device.
-*
-*      Supported vendors:      AK Modul-Bus Computer GmbH
-*      Supported devices:      CY7C63001A-PC (to be continued...)
-*      Supported functions:    Read/Write Ports (to be continued...)
-*
-*      Chipsets families:      CY7C63000, CY7C63001, CY7C63100, CY7C63101
-*
-*
-*      This program is free software; you can redistribute it and/or
-*      modify it under the terms of the GNU General Public License as
-*      published by the Free Software Foundation, version 2.
-*/
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/usb.h>
-
-#define DRIVER_AUTHOR          "Oliver Bock (bock@fh-wolfenbuettel.de)"
-#define DRIVER_DESC            "Cypress CY7C63xxx USB driver"
-
-#define CY7C63_VENDOR_ID       0xa2c
-#define CY7C63_PRODUCT_ID      0x8
-
-#define CY7C63_READ_PORT       0x4
-#define CY7C63_WRITE_PORT      0x5
-#define CY7C63_READ_RAM                0x2
-#define CY7C63_WRITE_RAM       0x3
-#define CY7C63_READ_ROM                0x1
-
-#define CY7C63_READ_PORT_ID0   0
-#define CY7C63_WRITE_PORT_ID0  0
-#define CY7C63_READ_PORT_ID1   0x2
-#define CY7C63_WRITE_PORT_ID1  1
-
-#define CY7C63_MAX_REQSIZE     8
-
-
-/* table of devices that work with this driver */
-static struct usb_device_id cy7c63_table [] = {
-       { USB_DEVICE(CY7C63_VENDOR_ID, CY7C63_PRODUCT_ID) },
-       { }
-};
-MODULE_DEVICE_TABLE(usb, cy7c63_table);
-
-/* structure to hold all of our device specific stuff */
-struct cy7c63 {
-       struct usb_device *     udev;
-       char                    port0;
-       char                    port1;
-};
-
-/* used to send usb control messages to device */
-int vendor_command(struct cy7c63 *dev, unsigned char request,
-                        unsigned char address, unsigned char data) {
-
-       int retval = 0;
-       unsigned int pipe;
-       unsigned char *iobuf;
-
-       /* allocate some memory for the i/o buffer*/
-       iobuf = kzalloc(CY7C63_MAX_REQSIZE, GFP_KERNEL);
-       if (!iobuf) {
-               dev_err(&dev->udev->dev, "Out of memory!\n");
-               retval = -ENOMEM;
-               goto error;
-       }
-
-       dev_dbg(&dev->udev->dev, "Sending usb_control_msg (data: %d)\n", data);
-
-       /* prepare usb control message and send it upstream */
-       pipe = usb_rcvctrlpipe(dev->udev, 0);
-       retval = usb_control_msg(dev->udev, pipe, request,
-                               USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER,
-                               address, data, iobuf, CY7C63_MAX_REQSIZE,
-                               USB_CTRL_GET_TIMEOUT);
-
-       /* store returned data (more READs to be added!) */
-       switch (request) {
-               case CY7C63_READ_PORT:
-                       if (address == CY7C63_READ_PORT_ID0) {
-                               dev->port0 = iobuf[1];
-                               dev_dbg(&dev->udev->dev,
-                                       "READ_PORT0 returned: %d\n",dev->port0);
-                       }
-                       else if (address == CY7C63_READ_PORT_ID1) {
-                               dev->port1 = iobuf[1];
-                               dev_dbg(&dev->udev->dev,
-                                       "READ_PORT1 returned: %d\n",dev->port1);
-                       }
-                       break;
-       }
-
-       kfree(iobuf);
-error:
-       return retval;
-}
-
-#define get_set_port(num,read_id,write_id) \
-static ssize_t set_port##num(struct device *dev, struct device_attribute *attr,        \
-                                       const char *buf, size_t count) {        \
-                                                                               \
-       int value;                                                              \
-       int result = 0;                                                         \
-                                                                               \
-       struct usb_interface *intf = to_usb_interface(dev);                     \
-       struct cy7c63 *cyp = usb_get_intfdata(intf);                            \
-                                                                               \
-       dev_dbg(&cyp->udev->dev, "WRITE_PORT%d called\n", num);                 \
-                                                                               \
-       /* validate input data */                                               \
-       if (sscanf(buf, "%d", &value) < 1) {                                    \
-               result = -EINVAL;                                               \
-               goto error;                                                     \
-       }                                                                       \
-       if (value>255 || value<0) {                                             \
-               result = -EINVAL;                                               \
-               goto error;                                                     \
-       }                                                                       \
-                                                                               \
-       result = vendor_command(cyp, CY7C63_WRITE_PORT, write_id,               \
-                                        (unsigned char)value);                 \
-                                                                               \
-       dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n",result);    \
-error:                                                                         \
-       return result < 0 ? result : count;                                     \
-}                                                                              \
-                                                                               \
-static ssize_t get_port##num(struct device *dev,                               \
-                                struct device_attribute *attr, char *buf) {    \
-                                                                               \
-       int result = 0;                                                         \
-                                                                               \
-       struct usb_interface *intf = to_usb_interface(dev);                     \
-       struct cy7c63 *cyp = usb_get_intfdata(intf);                            \
-                                                                               \
-       dev_dbg(&cyp->udev->dev, "READ_PORT%d called\n", num);                  \
-                                                                               \
-       result = vendor_command(cyp, CY7C63_READ_PORT, read_id, 0);             \
-                                                                               \
-       dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n", result);   \
-                                                                               \
-       return sprintf(buf, "%d", cyp->port##num);                              \
-}                                                                              \
-static DEVICE_ATTR(port##num, S_IWUGO | S_IRUGO, get_port##num, set_port##num);
-
-get_set_port(0, CY7C63_READ_PORT_ID0, CY7C63_WRITE_PORT_ID0);
-get_set_port(1, CY7C63_READ_PORT_ID1, CY7C63_WRITE_PORT_ID1);
-
-static int cy7c63_probe(struct usb_interface *interface,
-                       const struct usb_device_id *id) {
-
-       struct cy7c63 *dev = NULL;
-       int retval = -ENOMEM;
-
-       /* allocate memory for our device state and initialize it */
-       dev = kzalloc(sizeof(*dev), GFP_KERNEL);
-       if (dev == NULL) {
-               dev_err(&dev->udev->dev, "Out of memory!\n");
-               goto error;
-       }
-
-       dev->udev = usb_get_dev(interface_to_usbdev(interface));
-
-       /* save our data pointer in this interface device */
-       usb_set_intfdata(interface, dev);
-
-       /* create device attribute files */
-       device_create_file(&interface->dev, &dev_attr_port0);
-       device_create_file(&interface->dev, &dev_attr_port1);
-
-       /* let the user know what node this device is now attached to */
-       dev_info(&interface->dev,
-               "Cypress CY7C63xxx device now attached\n");
-
-       retval = 0;
-error:
-       return retval;
-}
-
-static void cy7c63_disconnect(struct usb_interface *interface) {
-
-       struct cy7c63 *dev;
-
-       dev = usb_get_intfdata(interface);
-       usb_set_intfdata(interface, NULL);
-
-       /* remove device attribute files */
-       device_remove_file(&interface->dev, &dev_attr_port0);
-       device_remove_file(&interface->dev, &dev_attr_port1);
-
-       usb_put_dev(dev->udev);
-
-       dev_info(&interface->dev,
-               "Cypress CY7C63xxx device now disconnected\n");
-
-       kfree(dev);
-}
-
-static struct usb_driver cy7c63_driver = {
-       .name = "cy7c63",
-       .probe = cy7c63_probe,
-       .disconnect = cy7c63_disconnect,
-       .id_table = cy7c63_table,
-};
-
-static int __init cy7c63_init(void) {
-
-       int result;
-
-       /* register this driver with the USB subsystem */
-       result = usb_register(&cy7c63_driver);
-       if (result) {
-               err("Function usb_register failed! Error number: %d\n", result);
-       }
-
-       return result;
-}
-
-static void __exit cy7c63_exit(void) {
-
-       /* deregister this driver with the USB subsystem */
-       usb_deregister(&cy7c63_driver);
-}
-
-module_init(cy7c63_init);
-module_exit(cy7c63_exit);
-
-MODULE_AUTHOR(DRIVER_AUTHOR);
-MODULE_DESCRIPTION(DRIVER_DESC);
-
-MODULE_LICENSE("GPL");
diff --git a/drivers/usb/misc/cypress_cy7c63.c b/drivers/usb/misc/cypress_cy7c63.c
new file mode 100644 (file)
index 0000000..e091d32
--- /dev/null
@@ -0,0 +1,279 @@
+/*
+* cypress_cy7c63.c
+*
+* Copyright (c) 2006 Oliver Bock (o.bock@fh-wolfenbuettel.de)
+*
+*      This driver is based on the Cypress USB Driver by Marcus Maul
+*      (cyport) and the 2.0 version of Greg Kroah-Hartman's
+*      USB Skeleton driver.
+*
+*      This is a generic driver for the Cypress CY7C63xxx family.
+*      For the time being it enables you to read from and write to
+*      the single I/O ports of the device.
+*
+*      Supported vendors:      AK Modul-Bus Computer GmbH
+*      Supported devices:      CY7C63001A-PC (to be continued...)
+*      Supported functions:    Read/Write Ports (to be continued...)
+*
+*
+*      This program is free software; you can redistribute it and/or
+*      modify it under the terms of the GNU General Public License as
+*      published by the Free Software Foundation, version 2.
+*/
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/usb.h>
+
+#define DRIVER_AUTHOR          "Oliver Bock (o.bock@fh-wolfenbuettel.de)"
+#define DRIVER_DESC            "Cypress CY7C63xxx USB driver"
+
+#define CYPRESS_VENDOR_ID      0xa2c
+#define CYPRESS_PRODUCT_ID     0x8
+
+#define CYPRESS_READ_PORT      0x4
+#define CYPRESS_WRITE_PORT     0x5
+
+#define CYPRESS_READ_RAM       0x2
+#define CYPRESS_WRITE_RAM      0x3
+#define CYPRESS_READ_ROM       0x1
+
+#define CYPRESS_READ_PORT_ID0  0
+#define CYPRESS_WRITE_PORT_ID0 0
+#define CYPRESS_READ_PORT_ID1  0x2
+#define CYPRESS_WRITE_PORT_ID1 1
+
+#define CYPRESS_MAX_REQSIZE    8
+
+
+/* table of devices that work with this driver */
+static struct usb_device_id cypress_table [] = {
+       { USB_DEVICE(CYPRESS_VENDOR_ID, CYPRESS_PRODUCT_ID) },
+       { }
+};
+MODULE_DEVICE_TABLE(usb, cypress_table);
+
+/* structure to hold all of our device specific stuff */
+struct cypress {
+       struct usb_device *     udev;
+       unsigned char           port[2];
+};
+
+/* used to send usb control messages to device */
+static int vendor_command(struct cypress *dev, unsigned char request,
+                         unsigned char address, unsigned char data)
+{
+       int retval = 0;
+       unsigned int pipe;
+       unsigned char *iobuf;
+
+       /* allocate some memory for the i/o buffer*/
+       iobuf = kzalloc(CYPRESS_MAX_REQSIZE, GFP_KERNEL);
+       if (!iobuf) {
+               dev_err(&dev->udev->dev, "Out of memory!\n");
+               retval = -ENOMEM;
+               goto error;
+       }
+
+       dev_dbg(&dev->udev->dev, "Sending usb_control_msg (data: %d)\n", data);
+
+       /* prepare usb control message and send it upstream */
+       pipe = usb_rcvctrlpipe(dev->udev, 0);
+       retval = usb_control_msg(dev->udev, pipe, request,
+                                USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER,
+                                address, data, iobuf, CYPRESS_MAX_REQSIZE,
+                                USB_CTRL_GET_TIMEOUT);
+
+       /* store returned data (more READs to be added) */
+       switch (request) {
+               case CYPRESS_READ_PORT:
+                       if (address == CYPRESS_READ_PORT_ID0) {
+                               dev->port[0] = iobuf[1];
+                               dev_dbg(&dev->udev->dev,
+                                       "READ_PORT0 returned: %d\n",
+                                       dev->port[0]);
+                       }
+                       else if (address == CYPRESS_READ_PORT_ID1) {
+                               dev->port[1] = iobuf[1];
+                               dev_dbg(&dev->udev->dev,
+                                       "READ_PORT1 returned: %d\n",
+                                       dev->port[1]);
+                       }
+                       break;
+       }
+
+       kfree(iobuf);
+error:
+       return retval;
+}
+
+/* write port value */
+static ssize_t write_port(struct device *dev, struct device_attribute *attr,
+                         const char *buf, size_t count,
+                         int port_num, int write_id)
+{
+       int value = -1;
+       int result = 0;
+
+       struct usb_interface *intf = to_usb_interface(dev);
+       struct cypress *cyp = usb_get_intfdata(intf);
+
+       dev_dbg(&cyp->udev->dev, "WRITE_PORT%d called\n", port_num);
+
+       /* validate input data */
+       if (sscanf(buf, "%d", &value) < 1) {
+               result = -EINVAL;
+               goto error;
+       }
+       if (value < 0 || value > 255) {
+               result = -EINVAL;
+               goto error;
+       }
+
+       result = vendor_command(cyp, CYPRESS_WRITE_PORT, write_id,
+                               (unsigned char)value);
+
+       dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n", result);
+error:
+       return result < 0 ? result : count;
+}
+
+/* attribute callback handler (write) */
+static ssize_t set_port0_handler(struct device *dev,
+                                struct device_attribute *attr,
+                                const char *buf, size_t count)
+{
+       return write_port(dev, attr, buf, count, 0, CYPRESS_WRITE_PORT_ID0);
+}
+
+/* attribute callback handler (write) */
+static ssize_t set_port1_handler(struct device *dev,
+                                struct device_attribute *attr,
+                                const char *buf, size_t count)
+{
+       return write_port(dev, attr, buf, count, 1, CYPRESS_WRITE_PORT_ID1);
+}
+
+/* read port value */
+static ssize_t read_port(struct device *dev, struct device_attribute *attr,
+                        char *buf, int port_num, int read_id)
+{
+       int result = 0;
+
+       struct usb_interface *intf = to_usb_interface(dev);
+       struct cypress *cyp = usb_get_intfdata(intf);
+
+       dev_dbg(&cyp->udev->dev, "READ_PORT%d called\n", port_num);
+
+       result = vendor_command(cyp, CYPRESS_READ_PORT, read_id, 0);
+
+       dev_dbg(&cyp->udev->dev, "Result of vendor_command: %d\n\n", result);
+
+       return sprintf(buf, "%d", cyp->port[port_num]);
+}
+
+/* attribute callback handler (read) */
+static ssize_t get_port0_handler(struct device *dev,
+                                struct device_attribute *attr, char *buf)
+{
+       return read_port(dev, attr, buf, 0, CYPRESS_READ_PORT_ID0);
+}
+
+/* attribute callback handler (read) */
+static ssize_t get_port1_handler(struct device *dev,
+                                struct device_attribute *attr, char *buf)
+{
+       return read_port(dev, attr, buf, 1, CYPRESS_READ_PORT_ID1);
+}
+
+static DEVICE_ATTR(port0, S_IWUGO | S_IRUGO,
+                  get_port0_handler, set_port0_handler);
+
+static DEVICE_ATTR(port1, S_IWUGO | S_IRUGO,
+                  get_port1_handler, set_port1_handler);
+
+
+static int cypress_probe(struct usb_interface *interface,
+                        const struct usb_device_id *id)
+{
+       struct cypress *dev = NULL;
+       int retval = -ENOMEM;
+
+       /* allocate memory for our device state and initialize it */
+       dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+       if (dev == NULL) {
+               dev_err(&dev->udev->dev, "Out of memory!\n");
+               goto error;
+       }
+
+       dev->udev = usb_get_dev(interface_to_usbdev(interface));
+
+       /* save our data pointer in this interface device */
+       usb_set_intfdata(interface, dev);
+
+       /* create device attribute files */
+       device_create_file(&interface->dev, &dev_attr_port0);
+       device_create_file(&interface->dev, &dev_attr_port1);
+
+       /* let the user know that the device is now attached */
+       dev_info(&interface->dev,
+                "Cypress CY7C63xxx device now attached\n");
+
+       retval = 0;
+error:
+       return retval;
+}
+
+static void cypress_disconnect(struct usb_interface *interface)
+{
+       struct cypress *dev;
+
+       dev = usb_get_intfdata(interface);
+       usb_set_intfdata(interface, NULL);
+
+       /* remove device attribute files */
+       device_remove_file(&interface->dev, &dev_attr_port0);
+       device_remove_file(&interface->dev, &dev_attr_port1);
+
+       usb_put_dev(dev->udev);
+
+       dev_info(&interface->dev,
+                "Cypress CY7C63xxx device now disconnected\n");
+
+       kfree(dev);
+}
+
+static struct usb_driver cypress_driver = {
+       .name = "cypress_cy7c63",
+       .probe = cypress_probe,
+       .disconnect = cypress_disconnect,
+       .id_table = cypress_table,
+};
+
+static int __init cypress_init(void)
+{
+       int result;
+
+       /* register this driver with the USB subsystem */
+       result = usb_register(&cypress_driver);
+       if (result) {
+               err("Function usb_register failed! Error number: %d\n", result);
+       }
+
+       return result;
+}
+
+static void __exit cypress_exit(void)
+{
+       /* deregister this driver with the USB subsystem */
+       usb_deregister(&cypress_driver);
+}
+
+module_init(cypress_init);
+module_exit(cypress_exit);
+
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESC);
+
+MODULE_LICENSE("GPL");
index c82c402285a0d42ced463dcd87084ca5f4d540cf..e095772dd8e9eebc2887afc835b105d72af09d03 100644 (file)
@@ -200,10 +200,8 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, siz
 
        /* create a urb, and a buffer for it, and copy the data to the urb */
        urb = usb_alloc_urb(0, GFP_KERNEL);
-       if (!urb) {
-               retval = -ENOMEM;
-               goto error;
-       }
+       if (!urb)
+               return -ENOMEM;
        
        buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
        if (!buf) {
index e02c1a30c4cd4d65d852ce010d522c05e594c256..f961a770cee2ea2a24d2ef01e39fd7d73fc99b0e 100644 (file)
@@ -64,7 +64,6 @@ struct mon_reader_text {
 };
 
 static void mon_text_ctor(void *, kmem_cache_t *, unsigned long);
-static void mon_text_dtor(void *, kmem_cache_t *, unsigned long);
 
 /*
  * mon_text_submit
@@ -268,7 +267,7 @@ static int mon_text_open(struct inode *inode, struct file *file)
            (long)rp);
        rp->e_slab = kmem_cache_create(rp->slab_name,
            sizeof(struct mon_event_text), sizeof(long), 0,
-           mon_text_ctor, mon_text_dtor);
+           mon_text_ctor, NULL);
        if (rp->e_slab == NULL) {
                rc = -ENOMEM;
                goto err_slab;
@@ -459,7 +458,3 @@ static void mon_text_ctor(void *mem, kmem_cache_t *slab, unsigned long sflags)
        memset(mem, 0xe5, sizeof(struct mon_event_text));
 }
 
-static void mon_text_dtor(void *mem, kmem_cache_t *slab, unsigned long sflags)
-{
-       ;
-}
index 718f8e2b552b008d8c5285e147eca5c364d2ba96..e5e6e4f3ef874e5128bfd52f8202e78d7d4edc54 100644 (file)
 #define        VENDOR_ID_MELCO                 0x0411
 #define VENDOR_ID_MICRONET             0x3980
 #define        VENDOR_ID_LONGSHINE             0x07b8
+#define        VENDOR_ID_ZYXEL                 0x0586
 
 #define PRODUCT_ID_RTL8150             0x8150
 #define        PRODUCT_ID_LUAKTX               0x0012
 #define        PRODUCT_ID_LCS8138TX            0x401a
 #define PRODUCT_ID_SP128AR             0x0003
+#define        PRODUCT_ID_PRESTIGE             0x401a
 
 #undef EEPROM_WRITE
 
@@ -142,6 +144,7 @@ static struct usb_device_id rtl8150_table[] = {
        {USB_DEVICE(VENDOR_ID_MELCO, PRODUCT_ID_LUAKTX)},
        {USB_DEVICE(VENDOR_ID_MICRONET, PRODUCT_ID_SP128AR)},
        {USB_DEVICE(VENDOR_ID_LONGSHINE, PRODUCT_ID_LCS8138TX)},
+       {USB_DEVICE(VENDOR_ID_ZYXEL, PRODUCT_ID_PRESTIGE)},
        {}
 };
 
index 8bd44fda5eafb18a16dab40885cefa4ae900385c..ac33bd47cfce8746ac009e8fa64927538ec68612 100644 (file)
@@ -456,6 +456,17 @@ config USB_SERIAL_SAFE_PADDED
        bool "USB Secure Encapsulated Driver - Padded"
        depends on USB_SERIAL_SAFE
 
+config USB_SERIAL_SIERRAWIRELESS
+       tristate "USB Sierra Wireless Driver"
+       depends on USB_SERIAL
+       help
+         Say M here if you want to use a Sierra Wireless device (if
+         using an PC 5220 or AC580 please use the Airprime driver
+         instead).
+
+         To compile this driver as a module, choose M here: the
+         module will be called sierra.
+
 config USB_SERIAL_TI
        tristate "USB TI 3410/5052 Serial Driver"
        depends on USB_SERIAL
index 5a0960fc9d3e3facbfce9e90a0175e0fa25e4e46..35d4acc7f1d3276d9eea7ef119ef372aaae60c0c 100644 (file)
@@ -39,6 +39,7 @@ obj-$(CONFIG_USB_SERIAL_OMNINET)              += omninet.o
 obj-$(CONFIG_USB_SERIAL_OPTION)                        += option.o
 obj-$(CONFIG_USB_SERIAL_PL2303)                        += pl2303.o
 obj-$(CONFIG_USB_SERIAL_SAFE)                  += safe_serial.o
+obj-$(CONFIG_USB_SERIAL_SIERRAWIRELESS)                += sierra.o
 obj-$(CONFIG_USB_SERIAL_TI)                    += ti_usb_3410_5052.o
 obj-$(CONFIG_USB_SERIAL_VISOR)                 += visor.o
 obj-$(CONFIG_USB_SERIAL_WHITEHEAT)             += whiteheat.o
index 94b9ba0ff8755f479192573d7971af8462cc8ecd..62082532a8b346359899b2291c59a69a3b7bcfad 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 static struct usb_device_id id_table [] = {
        { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */
index 343f6f22822043c954cdeca1915d0b746152049a..01843ef8c11edbc57dd42c729f9844566e59510a 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 static struct usb_device_id id_table [] = {
        { USB_DEVICE(0x16d5, 0x6501) }, /* AirData CDMA device */
@@ -71,7 +71,7 @@ static int anydata_open(struct usb_serial_port *port, struct file *filp)
                                          port->bulk_in_endpointAddress),
                          port->read_urb->transfer_buffer,
                          port->read_urb->transfer_buffer_length,
-                         usb_serial_generic_write_bulk_callback, port);
+                         usb_serial_generic_read_bulk_callback, port);
        result = usb_submit_urb(port->read_urb, GFP_KERNEL);
        if (result)
                dev_err(&port->dev,
index 8dec796222a0ac8fe8210b125a45227dc9ead4ad..970d9ef0a7a5cce77eadc5b9d09a5ec6c2cc798f 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 
 static int debug;
index 3faa7aa0111afa4826f2f551312fb171b243ead8..70ece9e01ce4a9372f48947889237a0e42891468 100644 (file)
@@ -74,7 +74,7 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 #include "belkin_sa.h"
 
 static int debug;
index f2d993b70c18250cf51a8e87f7dfe4670f8d900b..6542f220468f7d0e1207caeb883f8f8c06fa3a7f 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 static int usb_serial_device_match (struct device *dev, struct device_driver *drv)
 {
index 3d456b32c3166e5e02d756b64c8564f8b713eb9e..3a9073dbfe6a40c4363f792a8534787e0495bdda 100644 (file)
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/usb.h>
+#include <linux/usb/serial.h>
 
 static int debug;
 
-#include "usb-serial.h"
-
 struct usbcons_info {
        int                     magic;
        int                     break_flag;
index df0a4f98b4ae6487ede58b83eb14d17b6927a3b1..486c7411b9a7572f3e573e494d2f903cd935e342 100644 (file)
@@ -26,7 +26,7 @@
 #include <linux/moduleparam.h>
 #include <linux/usb.h>
 #include <asm/uaccess.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 /*
  * Version Information
index 49b51ab0d4cbae9f8d3a2ab5c36885885b0eb612..6286aba86fae2340beaed87c5f2a970050053939 100644 (file)
@@ -39,7 +39,7 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 #define CYBERJACK_LOCAL_BUF_SIZE 32
 
index 4ff2dfb299bd9a1281b8fb70179ecf13a76f5984..ee70fddcab6031a8f1c045da4e71c09b3c4d1f9b 100644 (file)
 #include <linux/moduleparam.h>
 #include <linux/spinlock.h>
 #include <linux/usb.h>
+#include <linux/usb/serial.h>
 #include <linux/serial.h>
 #include <linux/delay.h>
 #include <asm/uaccess.h>
 
-#include "usb-serial.h"
 #include "cypress_m8.h"
 
 
index 6953d3ef5738069aea3ab3ae35caabab0c549b0b..9b225183fc7a4ccc091b2b463a514b4a3b89baf7 100644 (file)
 #include <asm/uaccess.h>
 #include <linux/usb.h>
 #include <linux/wait.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 /* Defines */
 
index 1e2b31eeb4973fc9433d51519cd215769d4766ef..daafe405d86d628a956836c288b4bf8bd67f2c37 100644 (file)
@@ -62,7 +62,7 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 static int debug;
 
index debc3b0f96629c28c6eb9ed05f09f04215d116c5..5169c2d154abff4e3fd1dc5438a65980df1919a3 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 /* EZ-USB Control and Status Register.  Bit 0 controls 8051 reset */
 #define CPUCS_REG    0x7F92
index 8a74b19f1283f08860c49f0a75d521eb2dfdc322..b458aedc5fb6ae541166fc8f66da7cc91f5cb22f 100644 (file)
 #include <asm/uaccess.h>
 #include <linux/usb.h>
 #include <linux/serial.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 #include "ftdi_sio.h"
 
 /*
@@ -313,6 +313,7 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) },
        { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
        { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
@@ -500,6 +501,8 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) },
+       { USB_DEVICE(TESTO_VID, TESTO_USB_INTERFACE_PID) },
        { },                                    /* Optional parameter entry */
        { }                                     /* Terminating entry */
 };
@@ -548,11 +551,17 @@ struct ftdi_private {
        spinlock_t rx_lock;     /* spinlock for receive state */
        struct work_struct rx_work;
        int rx_processed;
+       unsigned long rx_bytes;
 
        __u16 interface;        /* FT2232C port interface (0 for FT232/245) */
 
        int force_baud;         /* if non-zero, force the baud rate to this value */
        int force_rtscts;       /* if non-zero, force RTS-CTS to always be enabled */
+
+       spinlock_t tx_lock;     /* spinlock for transmit state */
+       unsigned long tx_bytes;
+       unsigned long tx_outstanding_bytes;
+       unsigned long tx_outstanding_urbs;
 };
 
 /* Used for TIOCMIWAIT */
@@ -626,6 +635,9 @@ static struct usb_serial_driver ftdi_sio_device = {
 #define HIGH 1
 #define LOW 0
 
+/* number of outstanding urbs to prevent userspace DoS from happening */
+#define URB_UPPER_LIMIT        42
+
 /*
  * ***************************************************************************
  * Utlity functions
@@ -1156,6 +1168,7 @@ static int ftdi_sio_attach (struct usb_serial *serial)
        }
 
        spin_lock_init(&priv->rx_lock);
+       spin_lock_init(&priv->tx_lock);
         init_waitqueue_head(&priv->delta_msr_wait);
        /* This will push the characters through immediately rather
           than queue a task to deliver them */
@@ -1270,6 +1283,13 @@ static int  ftdi_open (struct usb_serial_port *port, struct file *filp)
 
        dbg("%s", __FUNCTION__);
 
+       spin_lock_irqsave(&priv->tx_lock, flags);
+       priv->tx_bytes = 0;
+       spin_unlock_irqrestore(&priv->tx_lock, flags);
+       spin_lock_irqsave(&priv->rx_lock, flags);
+       priv->rx_bytes = 0;
+       spin_unlock_irqrestore(&priv->rx_lock, flags);
+
        if (port->tty)
                port->tty->low_latency = (priv->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
 
@@ -1372,6 +1392,7 @@ static int ftdi_write (struct usb_serial_port *port,
        int data_offset ;       /* will be 1 for the SIO and 0 otherwise */
        int status;
        int transfer_size;
+       unsigned long flags;
 
        dbg("%s port %d, %d bytes", __FUNCTION__, port->number, count);
 
@@ -1379,6 +1400,13 @@ static int ftdi_write (struct usb_serial_port *port,
                dbg("write request of 0 bytes");
                return 0;
        }
+       spin_lock_irqsave(&priv->tx_lock, flags);
+       if (priv->tx_outstanding_urbs > URB_UPPER_LIMIT) {
+               spin_unlock_irqrestore(&priv->tx_lock, flags);
+               dbg("%s - write limit hit\n", __FUNCTION__);
+               return 0;
+       }
+       spin_unlock_irqrestore(&priv->tx_lock, flags);
        
        data_offset = priv->write_offset;
         dbg("data_offset set to %d",data_offset);
@@ -1445,6 +1473,12 @@ static int ftdi_write (struct usb_serial_port *port,
                err("%s - failed submitting write urb, error %d", __FUNCTION__, status);
                count = status;
                kfree (buffer);
+       } else {
+               spin_lock_irqsave(&priv->tx_lock, flags);
+               ++priv->tx_outstanding_urbs;
+               priv->tx_outstanding_bytes += count;
+               priv->tx_bytes += count;
+               spin_unlock_irqrestore(&priv->tx_lock, flags);
        }
 
        /* we are done with this urb, so let the host driver
@@ -1460,7 +1494,11 @@ static int ftdi_write (struct usb_serial_port *port,
 
 static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
+       unsigned long flags;
        struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
+       struct ftdi_private *priv;
+       int data_offset;       /* will be 1 for the SIO and 0 otherwise */
+       unsigned long countback;
 
        /* free up the transfer buffer, as usb_free_urb() does not do this */
        kfree (urb->transfer_buffer);
@@ -1472,34 +1510,67 @@ static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
                return;
        }
 
+       priv = usb_get_serial_port_data(port);
+       if (!priv) {
+               dbg("%s - bad port private data pointer - exiting", __FUNCTION__);
+               return;
+       }
+       /* account for transferred data */
+       countback = urb->actual_length;
+       data_offset = priv->write_offset;
+       if (data_offset > 0) {
+               /* Subtract the control bytes */
+               countback -= (data_offset * ((countback + (PKTSZ - 1)) / PKTSZ));
+       }
+       spin_lock_irqsave(&priv->tx_lock, flags);
+       --priv->tx_outstanding_urbs;
+       priv->tx_outstanding_bytes -= countback;
+       spin_unlock_irqrestore(&priv->tx_lock, flags);
+
        usb_serial_port_softint(port);
 } /* ftdi_write_bulk_callback */
 
 
 static int ftdi_write_room( struct usb_serial_port *port )
 {
+       struct ftdi_private *priv = usb_get_serial_port_data(port);
+       int room;
+       unsigned long flags;
+
        dbg("%s - port %d", __FUNCTION__, port->number);
 
-       /*
-        * We really can take anything the user throws at us
-        * but let's pick a nice big number to tell the tty
-        * layer that we have lots of free space
-        */
-       return 2048;
+       spin_lock_irqsave(&priv->tx_lock, flags);
+       if (priv->tx_outstanding_urbs < URB_UPPER_LIMIT) {
+               /*
+                * We really can take anything the user throws at us
+                * but let's pick a nice big number to tell the tty
+                * layer that we have lots of free space
+                */
+               room = 2048;
+       } else {
+               room = 0;
+       }
+       spin_unlock_irqrestore(&priv->tx_lock, flags);
+       return room;
 } /* ftdi_write_room */
 
 
 static int ftdi_chars_in_buffer (struct usb_serial_port *port)
 { /* ftdi_chars_in_buffer */
+       struct ftdi_private *priv = usb_get_serial_port_data(port);
+       int buffered;
+       unsigned long flags;
+
        dbg("%s - port %d", __FUNCTION__, port->number);
 
-       /* 
-        * We can't really account for how much data we
-        * have sent out, but hasn't made it through to the
-        * device, so just tell the tty layer that everything
-        * is flushed.
-        */
-       return 0;
+       spin_lock_irqsave(&priv->tx_lock, flags);
+       buffered = (int)priv->tx_outstanding_bytes;
+       spin_unlock_irqrestore(&priv->tx_lock, flags);
+       if (buffered < 0) {
+               err("%s outstanding tx bytes is negative!", __FUNCTION__);
+               buffered = 0;
+       }
+       return buffered;
 } /* ftdi_chars_in_buffer */
 
 
@@ -1509,6 +1580,8 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
        struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
        struct tty_struct *tty;
        struct ftdi_private *priv;
+       unsigned long countread;
+       unsigned long flags;
 
        if (urb->number_of_packets > 0) {
                err("%s transfer_buffer_length %d actual_length %d number of packets %d",__FUNCTION__,
@@ -1543,6 +1616,13 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
                return;
        }
 
+       /* count data bytes, but not status bytes */
+       countread = urb->actual_length;
+       countread -= 2 * ((countread + (PKTSZ - 1)) / PKTSZ);
+       spin_lock_irqsave(&priv->rx_lock, flags);
+       priv->rx_bytes += countread;
+       spin_unlock_irqrestore(&priv->rx_lock, flags);
+
        ftdi_process_read(port);
 
 } /* ftdi_read_bulk_callback */
index 6ab2ac845bd7a861c7d456ab94607160fe692030..04ef90fcb8766d3adffa2f345a178e55a5f7c12b 100644 (file)
@@ -36,6 +36,9 @@
 #define FTDI_ACTZWAVE_PID      0xF2D0
 
 
+/* www.starting-point-systems.com ÂµChameleon device */
+#define FTDI_MICRO_CHAMELEON_PID       0xCAA0  /* Product Id */
+
 /* www.irtrans.de device */
 #define FTDI_IRTRANS_PID 0xFC60 /* Product Id */
 
  */
 #define FTDI_YEI_SERVOCENTER31_PID     0xE050  /* YEI ServoCenter3.1 USB */
 
+/*
+ * ThorLabs USB motor drivers
+ */
+#define FTDI_THORLABS_PID              0xfaf0 /* ThorLabs USB motor drivers */
+
+/*
+ * Testo products (http://www.testo.com/)
+ * Submitted by Colin Leroy
+ */
+#define TESTO_VID                      0x128D
+#define TESTO_USB_INTERFACE_PID                0x0001
+
 /* Commands */
 #define FTDI_SIO_RESET                 0 /* Reset the port */
 #define FTDI_SIO_MODEM_CTRL    1 /* Set the modem control register */
index 803721b97e2e0746079b87f2536f66d3d2e902b2..77b977206a8c09186d1d8e42203e40c4774ad790 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 static struct usb_device_id id_table [] = {
        { USB_DEVICE(0x1404, 0xcddc) },
index 1f5d1620baa12180b55d1ddea0131333ec2c8cce..727852634be9c91526419fe243b6b009382d69fc 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
+#include <linux/usb/serial.h>
 
 /* the mode to be set when the port ist opened */
 static int initial_mode = 1;
@@ -42,8 +43,6 @@ static int initial_mode = 1;
 /* debug flag */
 static int debug = 0;
 
-#include "usb-serial.h"
-
 #define GARMIN_VENDOR_ID             0x091E
 
 /*
index 945b8bb38c92ec4f422d645644dca8adfff292fd..17271355639397be219a44c2e3c4fe75f13bd7f2 100644 (file)
@@ -17,8 +17,8 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/usb.h>
+#include <linux/usb/serial.h>
 #include <asm/uaccess.h>
-#include "usb-serial.h"
 
 static int debug;
 
@@ -285,6 +285,7 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *reg
        if (result)
                dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
 }
+EXPORT_SYMBOL_GPL(usb_serial_generic_read_bulk_callback);
 
 void usb_serial_generic_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 {
index 7e06358b03109015baf2adb080aff6ad0623521d..ebcac701b069a36bb94558379f8d8c390bba78b0 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 /*
  * Version Information
index bd2c05dac2a92953884644dc2717536093213f1d..c49976c3ad52cf7924aaf07ac3f208a5005dfc98 100644 (file)
@@ -44,7 +44,7 @@
 #include <linux/wait.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 #include "io_edgeport.h"
 #include "io_ionsp.h"          /* info for the iosp messages */
 #include "io_16654.h"          /* 16654 UART defines */
index 723a12ae87b5db65e048d36c6efce4826897bd6d..17c5b1d2311a83e22cc09f30ef4d5b60d3c25244 100644 (file)
@@ -39,8 +39,8 @@
 #include <asm/uaccess.h>
 #include <asm/semaphore.h>
 #include <linux/usb.h>
+#include <linux/usb/serial.h>
 
-#include "usb-serial.h"
 #include "io_16654.h"
 #include "io_usbvend.h"
 #include "io_ti.h"
index dbcfe172a5cc954ac406abf3fbdb63feaed6cfa4..59c5d999009abfbbe31b2c58d3715355c9066d71 100644 (file)
@@ -55,7 +55,7 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 #include "ipaq.h"
 
 #define KP_RETRIES     100
@@ -70,6 +70,8 @@
 
 static __u16 product, vendor;
 static int debug;
+static int connect_retries = KP_RETRIES;
+static int initial_wait;
 
 /* Function prototypes for an ipaq */
 static int  ipaq_open (struct usb_serial_port *port, struct file *filp);
@@ -582,7 +584,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
        struct ipaq_private     *priv;
        struct ipaq_packet      *pkt;
        int                     i, result = 0;
-       int                     retries = KP_RETRIES;
+       int                     retries = connect_retries;
 
        dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -646,16 +648,12 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
        port->read_urb->transfer_buffer_length = URBDATA_SIZE;
        port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE;
        
+       msleep(1000*initial_wait);
        /* Start reading from the device */
        usb_fill_bulk_urb(port->read_urb, serial->dev, 
                      usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
                      port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
                      ipaq_read_bulk_callback, port);
-       result = usb_submit_urb(port->read_urb, GFP_KERNEL);
-       if (result) {
-               err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
-               goto error;
-       }
 
        /*
         * Send out control message observed in win98 sniffs. Not sure what
@@ -670,8 +668,14 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
                                usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21,
                                0x1, 0, NULL, 0, 100);
                if (result == 0) {
+                       result = usb_submit_urb(port->read_urb, GFP_KERNEL);
+                       if (result) {
+                               err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
+                               goto error;
+                       }
                        return 0;
                }
+               msleep(1000);
        }
        err("%s - failed doing control urb, error %d", __FUNCTION__, result);
        goto error;
@@ -854,6 +858,7 @@ static void ipaq_write_bulk_callback(struct urb *urb, struct pt_regs *regs)
        
        if (urb->status) {
                dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
+               return;
        }
 
        spin_lock_irqsave(&write_list_lock, flags);
@@ -966,3 +971,9 @@ MODULE_PARM_DESC(vendor, "User specified USB idVendor");
 
 module_param(product, ushort, 0);
 MODULE_PARM_DESC(product, "User specified USB idProduct");
+
+module_param(connect_retries, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(connect_retries, "Maximum number of connect retries (one second each)");
+
+module_param(initial_wait, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(initial_wait, "Time to wait before attempting a connection (in seconds)");
index a4a0bfeaab00ba88a4f31d35da5dd4d5cb566c56..87306cb6f9f5a065c6ead79b10e60b77b76a6f2a 100644 (file)
@@ -46,8 +46,8 @@
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/usb.h>
+#include <linux/usb/serial.h>
 #include <asm/uaccess.h>
-#include "usb-serial.h"
 
 /*
  * Version Information
@@ -373,6 +373,8 @@ static void ipw_write_bulk_callback(struct urb *urb, struct pt_regs *regs)
 
        dbg("%s", __FUNCTION__);
 
+       port->write_urb_busy = 0;
+
        if (urb->status)
                dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
 
index 2cf1fed3de43eb8a48d594e71624d4cd14d63692..1738b0b6a376dd90e41a1fadf8a3486eff6f0fac 100644 (file)
@@ -57,7 +57,7 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 /*
  * Version Information
index d7c58f1bc960ddb364b8a967bc7f47dbaecea726..015ad6cc1bbb6418613d8fed60992bf49e8157c4 100644 (file)
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 #include "keyspan.h"
 
 static int debug;
index 03ab3c0f3cce26e3f70293d37ab1ba123ff3bcfd..49b8dc039d1fef8f68aca71fee6efdb02082f458 100644 (file)
@@ -78,6 +78,7 @@
 #include <linux/workqueue.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
+#include <linux/usb/serial.h>
 
 static int debug;
 
@@ -107,8 +108,6 @@ struct ezusb_hex_record {
 #include "xircom_pgs_fw.h"
 #endif
 
-#include "usb-serial.h"
-
 /*
  * Version Information
  */
index b45ff3e7ab40f9fcca0d7216d033984ed91787aa..2a2f3e2da0553a3b3488fcb0a196a3a13953efb8 100644 (file)
@@ -55,7 +55,7 @@
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 #include "kl5kusb105.h"
 
 static int debug;
index 4577333747729576672ac2028216bc46f6f30671..d50dce03495819f4280f815285a89214be2a3e88 100644 (file)
@@ -46,8 +46,8 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
+#include <linux/usb/serial.h>
 #include <linux/ioctl.h>
-#include "usb-serial.h"
 #include "kobil_sct.h"
 
 static int debug;
index ca05d3275f3e01170692dd18736c99bcf98d52c3..f4d4305c2c026fa2099faaef26c5ae80d30a8884 100644 (file)
@@ -75,7 +75,7 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 #include "mct_u232.h"
 
 /*
index 7f544081032e8832de68109613ed9386ad21a4fd..ac3f8b5d2c495f931739eee3ee9d3509c694f44a 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/tty_flip.h>
 #include <linux/module.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 static int debug;
 
index cfb711a21a45e61f0bae25c4223ac88d26b7f6e2..e49f40913c27550e0c121c8d01bdf8ef909d0ae7 100644 (file)
@@ -46,7 +46,7 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 static int debug;
 
index 78ad4b3126a646a7311a8255bac4d9d821c050e5..f0530c1d7b7a274ca7a2c69bc8a33df199a9f6c1 100644 (file)
@@ -35,6 +35,7 @@
   2006-06-01  v0.6.2 add backwards-compatibility stuff
   2006-06-01  v0.6.3 add Novatel Wireless
   2006-06-01  v0.7   Option => GSM
+  2006-06-01  v0.7.1 add COBRA2
 
   Work sponsored by: Sigos GmbH, Germany <info@sigos.de>
 
@@ -53,7 +54,7 @@
   device features.
 */
 
-#define DRIVER_VERSION "v0.7.0"
+#define DRIVER_VERSION "v0.7.1"
 #define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>"
 #define DRIVER_DESC "USB Driver for GSM modems"
 
@@ -64,7 +65,7 @@
 #include <linux/tty_flip.h>
 #include <linux/module.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 /* Function prototypes */
 static int  option_open(struct usb_serial_port *port, struct file *filp);
@@ -102,6 +103,7 @@ static int  option_send_setup(struct usb_serial_port *port);
 #define OPTION_PRODUCT_FUSION           0x6000
 #define OPTION_PRODUCT_FUSION2          0x6300
 #define OPTION_PRODUCT_COBRA            0x6500
+#define OPTION_PRODUCT_COBRA2           0x6600
 #define HUAWEI_PRODUCT_E600             0x1001
 #define AUDIOVOX_PRODUCT_AIRCARD        0x0112
 #define SIERRAWIRELESS_PRODUCT_MC8755   0x6802
@@ -112,6 +114,7 @@ static struct usb_device_id option_ids[] = {
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION) },
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) },
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) },
+       { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) },
        { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
        { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },
        { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) },
@@ -124,6 +127,7 @@ static struct usb_device_id option_ids1[] = {
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION) },
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) },
        { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) },
+       { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) },
        { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
        { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },
        { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) },
index de93a2b909e78b72fb303fa4ff0702a1c206115d..259db31b65c194b6a2e4a19d76fdb47845b3e517 100644 (file)
@@ -27,7 +27,7 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 #include "pl2303.h"
 
 /*
@@ -52,6 +52,7 @@ struct pl2303_buf {
 static struct usb_device_id id_table [] = {
        { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID) },
        { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ2) },
+       { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_DCU11) },
        { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ3) },
        { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) },
        { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) },
@@ -79,6 +80,7 @@ static struct usb_device_id id_table [] = {
        { USB_DEVICE(LEADTEK_VENDOR_ID, LEADTEK_9531_PRODUCT_ID) },
        { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) },
        { USB_DEVICE(OTI_VENDOR_ID, OTI_PRODUCT_ID) },
+       { USB_DEVICE(DATAPILOT_U2_VENDOR_ID, DATAPILOT_U2_PRODUCT_ID) },
        { }                                     /* Terminating entry */
 };
 
index 7f29e81d3e35fdd5ba99b0eeb319997d332eda59..d9c1e6e0b4b3427c926983e4ad8bf8c47257ac0d 100644 (file)
@@ -10,6 +10,7 @@
 #define PL2303_VENDOR_ID       0x067b
 #define PL2303_PRODUCT_ID      0x2303
 #define PL2303_PRODUCT_ID_RSAQ2                0x04bb
+#define PL2303_PRODUCT_ID_DCU11                0x1234
 #define PL2303_PRODUCT_ID_PHAROS       0xaaa0
 #define PL2303_PRODUCT_ID_RSAQ3                0xaaa2
 
@@ -84,3 +85,7 @@
 /* Ours Technology Inc DKU-5 clone, chipset: Prolific Technology Inc */
 #define OTI_VENDOR_ID  0x0ea0
 #define OTI_PRODUCT_ID 0x6858
+
+/* DATAPILOT Universal-2 Phone Cable */
+#define DATAPILOT_U2_VENDOR_ID 0x0731
+#define DATAPILOT_U2_PRODUCT_ID        0x2003
index 897d8447252b522c77c8dc741a02f191d3b2ad38..789771ecdb11013a168ffc5fa0157474ab4538dc 100644 (file)
@@ -71,7 +71,7 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 
 
 #ifndef CONFIG_USB_SAFE_PADDED
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
new file mode 100644 (file)
index 0000000..d29638d
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Sierra Wireless CDMA Wireless Serial USB driver
+ *
+ * Current Copy modified by: Kevin Lloyd <linux@sierrawireless.com>
+ * Original Copyright (C) 2005-2006 Greg Kroah-Hartman <gregkh@suse.de>
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License version
+ *     2 as published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/tty.h>
+#include <linux/module.h>
+#include <linux/usb.h>
+#include <linux/usb/serial.h>
+
+static struct usb_device_id id_table [] = {
+       { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
+       { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
+       { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
+       { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
+       { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
+       { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
+       { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 */
+       { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
+       /* Following devices are supported in the airprime.c driver */
+       /* { USB_DEVICE(0x1199, 0x0112) }, */   /* Sierra Wireless AirCard 580 */
+       /* { USB_DEVICE(0x0F3D, 0x0112) }, */   /* AirPrime/Sierra PC 5220 */
+       { }
+};
+MODULE_DEVICE_TABLE(usb, id_table);
+
+static struct usb_driver sierra_driver = {
+       .name =         "sierra_wireless",
+       .probe =        usb_serial_probe,
+       .disconnect =   usb_serial_disconnect,
+       .id_table =     id_table,
+};
+
+static struct usb_serial_driver sierra_device = {
+       .driver = {
+       .owner =                THIS_MODULE,
+       .name =                 "Sierra_Wireless",
+       },
+       .id_table =             id_table,
+       .num_interrupt_in =     NUM_DONT_CARE,
+       .num_bulk_in =          NUM_DONT_CARE,
+       .num_bulk_out =         NUM_DONT_CARE,
+       .num_ports =            3,
+};
+
+static int __init sierra_init(void)
+{
+       int retval;
+
+       retval = usb_serial_register(&sierra_device);
+       if (retval)
+               return retval;
+       retval = usb_register(&sierra_driver);
+       if (retval)
+               usb_serial_deregister(&sierra_device);
+       return retval;
+}
+
+static void __exit sierra_exit(void)
+{
+       usb_deregister(&sierra_driver);
+       usb_serial_deregister(&sierra_device);
+}
+
+module_init(sierra_init);
+module_exit(sierra_exit);
+MODULE_LICENSE("GPL");
index a9afff31a9210b2dd6e8c512c0f485a130e30d7c..ac9b8ee52d4406b67761be94bff26efaa9d4ab87 100644 (file)
@@ -83,8 +83,8 @@
 #include <asm/uaccess.h>
 #include <asm/semaphore.h>
 #include <linux/usb.h>
+#include <linux/usb/serial.h>
 
-#include "usb-serial.h"
 #include "ti_usb_3410_5052.h"
 #include "ti_fw_3410.h"                /* firmware image for 3410 */
 #include "ti_fw_5052.h"                /* firmware image for 5052 */
index b59a0536ea5c98a2952ef9c4075986dc43445ba7..12c1694d322ef3fa55650a0950c97779df1f68d4 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/smp_lock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 #include "pl2303.h"
 
 /*
@@ -40,6 +40,8 @@
 #define DRIVER_AUTHOR "Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/"
 #define DRIVER_DESC "USB Serial Driver core"
 
+static void port_free(struct usb_serial_port *port);
+
 /* Driver structure we register with the USB core */
 static struct usb_driver usb_serial_driver = {
        .name =         "usbserial",
@@ -146,23 +148,10 @@ static void destroy_serial(struct kref *kref)
                        port = serial->port[i];
                        if (!port)
                                continue;
-                       usb_kill_urb(port->read_urb);
-                       usb_free_urb(port->read_urb);
-                       usb_kill_urb(port->write_urb);
-                       usb_free_urb(port->write_urb);
-                       usb_kill_urb(port->interrupt_in_urb);
-                       usb_free_urb(port->interrupt_in_urb);
-                       usb_kill_urb(port->interrupt_out_urb);
-                       usb_free_urb(port->interrupt_out_urb);
-                       kfree(port->bulk_in_buffer);
-                       kfree(port->bulk_out_buffer);
-                       kfree(port->interrupt_in_buffer);
-                       kfree(port->interrupt_out_buffer);
+                       port_free(port);
                }
        }
 
-       flush_scheduled_work();         /* port->work */
-
        usb_put_dev(serial->dev);
 
        /* free up any memory that we allocated */
@@ -564,6 +553,11 @@ static void port_release(struct device *dev)
        struct usb_serial_port *port = to_usb_serial_port(dev);
 
        dbg ("%s - %s", __FUNCTION__, dev->bus_id);
+       port_free(port);
+}
+
+static void port_free(struct usb_serial_port *port)
+{
        usb_kill_urb(port->read_urb);
        usb_free_urb(port->read_urb);
        usb_kill_urb(port->write_urb);
@@ -576,6 +570,7 @@ static void port_release(struct device *dev)
        kfree(port->bulk_out_buffer);
        kfree(port->interrupt_in_buffer);
        kfree(port->interrupt_out_buffer);
+       flush_scheduled_work();         /* port->work */
        kfree(port);
 }
 
index 95a2936e902e22a00c4360ec819292d0c531e73d..88949f7884ca112ded81315d1e11cda8dcb261f2 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 #include "visor.h"
 
 /*
@@ -302,7 +302,6 @@ static int visor_open (struct usb_serial_port *port, struct file *filp)
        spin_lock_irqsave(&priv->lock, flags);
        priv->bytes_in = 0;
        priv->bytes_out = 0;
-       priv->outstanding_urbs = 0;
        priv->throttled = 0;
        spin_unlock_irqrestore(&priv->lock, flags);
 
@@ -435,13 +434,25 @@ static int visor_write (struct usb_serial_port *port, const unsigned char *buf,
 
 static int visor_write_room (struct usb_serial_port *port)
 {
+       struct visor_private *priv = usb_get_serial_port_data(port);
+       unsigned long flags;
+
        dbg("%s - port %d", __FUNCTION__, port->number);
 
        /*
         * We really can take anything the user throws at us
         * but let's pick a nice big number to tell the tty
-        * layer that we have lots of free space
+        * layer that we have lots of free space, unless we don't.
         */
+
+       spin_lock_irqsave(&priv->lock, flags);
+       if (priv->outstanding_urbs > URB_UPPER_LIMIT * 2 / 3) {
+               spin_unlock_irqrestore(&priv->lock, flags);
+               dbg("%s - write limit hit\n", __FUNCTION__);
+               return 0;
+       }
+       spin_unlock_irqrestore(&priv->lock, flags);
+
        return 2048;
 }
 
@@ -758,15 +769,22 @@ static int visor_calc_num_ports (struct usb_serial *serial)
 
 static int generic_startup(struct usb_serial *serial)
 {
+       struct usb_serial_port **ports = serial->port;
        struct visor_private *priv;
        int i;
 
        for (i = 0; i < serial->num_ports; ++i) {
                priv = kzalloc (sizeof(*priv), GFP_KERNEL);
-               if (!priv)
+               if (!priv) {
+                       while (i-- != 0) {
+                               priv = usb_get_serial_port_data(ports[i]);
+                               usb_set_serial_port_data(ports[i], NULL);
+                               kfree(priv);
+                       }
                        return -ENOMEM;
+               }
                spin_lock_init(&priv->lock);
-               usb_set_serial_port_data(serial->port[i], priv);
+               usb_set_serial_port_data(ports[i], priv);
        }
        return 0;
 }
@@ -876,7 +894,18 @@ static int clie_5_attach (struct usb_serial *serial)
 
 static void visor_shutdown (struct usb_serial *serial)
 {
+       struct visor_private *priv;
+       int i;
+
        dbg("%s", __FUNCTION__);
+
+       for (i = 0; i < serial->num_ports; i++) {
+               priv = usb_get_serial_port_data(serial->port[i]);
+               if (priv) {
+                       usb_set_serial_port_data(serial->port[i], NULL);
+                       kfree(priv);
+               }
+       }
 }
 
 static int visor_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg)
index 540438c3f381ad7d69ae2f5044150277ae86a73e..6e6c7934be32f819a08286e474e5ec31bd98fd4e 100644 (file)
@@ -79,7 +79,7 @@
 #include <linux/usb.h>
 #include <linux/serial_reg.h>
 #include <linux/serial.h>
-#include "usb-serial.h"
+#include <linux/usb/serial.h>
 #include "whiteheat_fw.h"              /* firmware for the ConnectTech WhiteHEAT device */
 #include "whiteheat.h"                 /* WhiteHEAT specific commands */
 
index 5715291ba5400d784ccb59841ef956a881dfb1e0..a4b7df9ff8c165fd3067f7c8e8ff5ead4becf2a4 100644 (file)
@@ -112,13 +112,11 @@ static int slave_configure(struct scsi_device *sdev)
        if (sdev->scsi_level < SCSI_2)
                sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2;
 
-       /* According to the technical support people at Genesys Logic,
-        * devices using their chips have problems transferring more than
-        * 32 KB at a time.  In practice people have found that 64 KB
-        * works okay and that's what Windows does.  But we'll be
-        * conservative; people can always use the sysfs interface to
-        * increase max_sectors. */
-       if (le16_to_cpu(us->pusb_dev->descriptor.idVendor) == USB_VENDOR_ID_GENESYS &&
+       /* Many devices have trouble transfering more than 32KB at a time,
+        * while others have trouble with more than 64K. At this time we
+        * are limiting both to 32K (64 sectores).
+        */
+       if ((us->flags & US_FL_MAX_SECTORS_64) &&
                        sdev->request_queue->max_sectors > 64)
                blk_queue_max_sectors(sdev->request_queue, 64);
 
index c7e84e653df9a38a548b954cf4d3a2fc51703577..a5ca449f6e645e811022371cdbca9125f4cf18d7 100644 (file)
@@ -112,6 +112,19 @@ UNUSUAL_DEV(  0x0411, 0x001c, 0x0113, 0x0113,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_FIX_INQUIRY ),
 
+/* Submitted by Ernestas Vaiciukevicius <ernisv@gmail.com> */
+UNUSUAL_DEV(  0x0419, 0x0100, 0x0100, 0x0100,
+                "Samsung Info. Systems America, Inc.",
+                "MP3 Player",
+                US_SC_DEVICE, US_PR_DEVICE, NULL,
+                US_FL_IGNORE_RESIDUE ),
+
+/* Reported by Orgad Shaneh <orgads@gmail.com> */
+UNUSUAL_DEV(  0x0419, 0xaace, 0x0100, 0x0100,
+               "Samsung", "MP3 Player",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_IGNORE_RESIDUE ),
+
 /* Reported by Christian Leber <christian@leber.de> */
 UNUSUAL_DEV(  0x0419, 0xaaf5, 0x0100, 0x0100,
                "TrekStor",
@@ -132,6 +145,14 @@ UNUSUAL_DEV(  0x0420, 0x0001, 0x0100, 0x0100,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_IGNORE_RESIDUE ),
 
+/* Reported by Sumedha Swamy <sumedhaswamy@gmail.com> and
+ * Einar Th. Einarsson <einarthered@gmail.com> */
+UNUSUAL_DEV(  0x0421, 0x0444, 0x0100, 0x0100,
+               "Nokia",
+               "N91",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ),
+
 /* Reported by Jiri Slaby <jirislaby@gmail.com> and
  * Rene C. Castberg <Rene@Castberg.org> */
 UNUSUAL_DEV(  0x0421, 0x0446, 0x0100, 0x0100,
@@ -140,6 +161,13 @@ UNUSUAL_DEV(  0x0421, 0x0446, 0x0100, 0x0100,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ),
 
+/* Reported by Matthew Bloch <matthew@bytemark.co.uk> */
+UNUSUAL_DEV(  0x0421, 0x044e, 0x0100, 0x0100,
+               "Nokia",
+               "E61",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ),
+
 /* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */
 UNUSUAL_DEV(  0x0424, 0x0fdc, 0x0210, 0x0210,
                "SMSC",
@@ -473,10 +501,11 @@ UNUSUAL_DEV(  0x054c, 0x0010, 0x0106, 0x0450,
                US_SC_SCSI, US_PR_DEVICE, NULL,
                US_FL_SINGLE_LUN | US_FL_NOT_LOCKABLE | US_FL_NO_WP_DETECT ),
 
-/* This entry is needed because the device reports Sub=ff */
-UNUSUAL_DEV(  0x054c, 0x0010, 0x0500, 0x0600,
+/* Submitted by Lars Jacob <jacob.lars@googlemail.com>
+ * This entry is needed because the device reports Sub=ff */
+UNUSUAL_DEV(  0x054c, 0x0010, 0x0500, 0x0610,
                "Sony",
-               "DSC-T1/T5",
+               "DSC-T1/T5/H5",
                US_SC_8070, US_PR_DEVICE, NULL,
                US_FL_SINGLE_LUN ),
 
@@ -708,18 +737,22 @@ UNUSUAL_DEV(  0x05dc, 0xb002, 0x0000, 0x0113,
  * They were originally reported by Alexander Oltu
  * <alexander@all-2.com> and Peter Marks <peter.marks@turner.com>
  * respectively.
+ *
+ * US_FL_GO_SLOW and US_FL_MAX_SECTORS_64 added by Phil Dibowitz
+ * <phil@ipom.com> as these flags were made and hard-coded
+ * special-cases were pulled from scsiglue.c.
  */
 UNUSUAL_DEV(  0x05e3, 0x0701, 0x0000, 0xffff,
                "Genesys Logic",
                "USB to IDE Optical",
                US_SC_DEVICE, US_PR_DEVICE, NULL,
-               US_FL_GO_SLOW ),
+               US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ),
 
 UNUSUAL_DEV(  0x05e3, 0x0702, 0x0000, 0xffff,
                "Genesys Logic",
                "USB to IDE Disk",
                US_SC_DEVICE, US_PR_DEVICE, NULL,
-               US_FL_GO_SLOW ),
+               US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ),
 
 /* Reported by Hanno Boeck <hanno@gmx.de>
  * Taken from the Lycoris Kernel */
@@ -1196,6 +1229,14 @@ UNUSUAL_DEV(  0x0ea0, 0x6828, 0x0110, 0x0110,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_IGNORE_RESIDUE ),
 
+/* Reported by Benjamin Schiller <sbenni@gmx.de>
+ * It is also sold by Easylite as DJ 20 */
+UNUSUAL_DEV(  0x0ed1, 0x7636, 0x0103, 0x0103,
+               "Typhoon",
+               "My DJ 1820",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_IGNORE_RESIDUE | US_FL_GO_SLOW | US_FL_MAX_SECTORS_64),
+
 /* Reported by Michael Stattmann <michael@stattmann.com> */
 UNUSUAL_DEV(  0x0fce, 0xd008, 0x0000, 0x0000,
                "Sony Ericsson",
@@ -1227,6 +1268,15 @@ UNUSUAL_DEV(  0x1370, 0x6828, 0x0110, 0x0110,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_IGNORE_RESIDUE ),
 
+/* patch submitted by Davide Perini <perini.davide@dpsoftware.org>
+ * and Renato Perini <rperini@email.it>
+ */
+UNUSUAL_DEV(  0x22b8, 0x3010, 0x0001, 0x0001,
+               "Motorola",
+               "RAZR V3x",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ),
+
 /* Reported by Radovan Garabik <garabik@kassiopeia.juls.savba.sk> */
 UNUSUAL_DEV(  0x2735, 0x100b, 0x0000, 0x9999,
                "MPIO",
index 1185acac4b216ec9fb1e2a59967474d0bcb07a74..5ee19be52f6510bd2efea0ca6ac81d0f70082b38 100644 (file)
@@ -55,6 +55,7 @@
 #include <linux/slab.h>
 #include <linux/kthread.h>
 #include <linux/mutex.h>
+#include <linux/utsrelease.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
@@ -373,8 +374,12 @@ static int usb_stor_control_thread(void * __us)
                /* lock access to the state */
                scsi_lock(host);
 
+               /* did the command already complete because of a disconnect? */
+               if (!us->srb)
+                       ;               /* nothing to do */
+
                /* indicate that the command is done */
-               if (us->srb->result != DID_ABORT << 16) {
+               else if (us->srb->result != DID_ABORT << 16) {
                        US_DEBUGP("scsi cmd done, result=0x%x\n", 
                                   us->srb->result);
                        us->srb->scsi_done(us->srb);
@@ -524,7 +529,8 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id)
                if (msg >= 0 && !(us->flags & US_FL_NEED_OVERRIDE))
                        printk(KERN_NOTICE USB_STORAGE "This device "
                                "(%04x,%04x,%04x S %02x P %02x)"
-                               " has %s in unusual_devs.h\n"
+                               " has %s in unusual_devs.h (kernel"
+                               " %s)\n"
                                "   Please send a copy of this message to "
                                "<linux-usb-devel@lists.sourceforge.net>\n",
                                le16_to_cpu(ddesc->idVendor),
@@ -532,7 +538,8 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id)
                                le16_to_cpu(ddesc->bcdDevice),
                                idesc->bInterfaceSubClass,
                                idesc->bInterfaceProtocol,
-                               msgs[msg]);
+                               msgs[msg],
+                               UTS_RELEASE);
        }
 }
 
@@ -836,32 +843,34 @@ static void dissociate_dev(struct us_data *us)
  * the host */
 static void quiesce_and_remove_host(struct us_data *us)
 {
+       struct Scsi_Host *host = us_to_host(us);
+
        /* Prevent new USB transfers, stop the current command, and
         * interrupt a SCSI-scan or device-reset delay */
+       scsi_lock(host);
        set_bit(US_FLIDX_DISCONNECTING, &us->flags);
+       scsi_unlock(host);
        usb_stor_stop_transport(us);
        wake_up(&us->delay_wait);
 
        /* It doesn't matter if the SCSI-scanning thread is still running.
         * The thread will exit when it sees the DISCONNECTING flag. */
 
-       /* Wait for the current command to finish, then remove the host */
-       mutex_lock(&us->dev_mutex);
-       mutex_unlock(&us->dev_mutex);
-
        /* queuecommand won't accept any new commands and the control
         * thread won't execute a previously-queued command.  If there
         * is such a command pending, complete it with an error. */
+       mutex_lock(&us->dev_mutex);
        if (us->srb) {
                us->srb->result = DID_NO_CONNECT << 16;
-               scsi_lock(us_to_host(us));
+               scsi_lock(host);
                us->srb->scsi_done(us->srb);
                us->srb = NULL;
-               scsi_unlock(us_to_host(us));
+               scsi_unlock(host);
        }
+       mutex_unlock(&us->dev_mutex);
 
        /* Now we own no commands so it's safe to remove the SCSI host */
-       scsi_remove_host(us_to_host(us));
+       scsi_remove_host(host);
 }
 
 /* Second stage of disconnect processing: deallocate all resources */
index 5284abe1b5eb02528635463f59a345d30e8d9deb..21f3ddbc90805ca6f93f58c514d00fc49e63e320 100644 (file)
@@ -176,8 +176,4 @@ extern void fill_inquiry_response(struct us_data *us,
 #define scsi_unlock(host)      spin_unlock_irq(host->host_lock)
 #define scsi_lock(host)                spin_lock_irq(host->host_lock)
 
-
-/* Vendor ID list for devices that require special handling */
-#define USB_VENDOR_ID_GENESYS          0x05e3  /* Genesys Logic */
-
 #endif
index af492cc48db2ced37cc1cd3432feb070b35fa408..d93eb626b2f0ecbb070e5a0302d8c7a774690c3c 100644 (file)
@@ -218,7 +218,7 @@ static int ds2482_wait_1wire_idle(struct ds2482_data *pdev)
                do {
                        temp = i2c_smbus_read_byte(&pdev->client);
                } while ((temp >= 0) && (temp & DS2482_REG_STS_1WB) &&
-                        (++retries > DS2482_WAIT_IDLE_TIMEOUT));
+                        (++retries < DS2482_WAIT_IDLE_TIMEOUT));
        }
 
        if (retries > DS2482_WAIT_IDLE_TIMEOUT)
diff --git a/drivers/w1/w1_io.h b/drivers/w1/w1_io.h
deleted file mode 100644 (file)
index 9a76d2a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *     w1_io.h
- *
- * Copyright (c) 2004 Evgeniy Polyakov <johnpol@2ka.mipt.ru>
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __W1_IO_H
-#define __W1_IO_H
-
-#include "w1.h"
-
-u8 w1_triplet(struct w1_master *dev, int bdir);
-void w1_write_8(struct w1_master *, u8);
-int w1_reset_bus(struct w1_master *);
-u8 w1_calc_crc8(u8 *, int);
-void w1_write_block(struct w1_master *, const u8 *, int);
-u8 w1_read_block(struct w1_master *, u8 *, int);
-void w1_search_devices(struct w1_master *dev, w1_slave_found_callback cb);
-int w1_reset_select_slave(struct w1_slave *sl);
-
-#endif /* __W1_IO_H */
index 3f356086061d7076a379b76e265295a5fe3750fe..b3c6b82e6a9d8629446e77268a83a2c5c4eb1b62 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -240,7 +240,7 @@ static struct fdtable *alloc_fdtable(int nr)
        if (!fdt)
                goto out;
 
-       nfds = max_t(int, 8 * L1_CACHE_BYTES, roundup_pow_of_two(nfds));
+       nfds = max_t(int, 8 * L1_CACHE_BYTES, roundup_pow_of_two(nr + 1));
        if (nfds > NR_OPEN)
                nfds = NR_OPEN;
 
@@ -273,11 +273,13 @@ static struct fdtable *alloc_fdtable(int nr)
        } while (nfds <= nr);
        new_fds = alloc_fd_array(nfds);
        if (!new_fds)
-               goto out;
+               goto out2;
        fdt->fd = new_fds;
        fdt->max_fds = nfds;
        fdt->free_files = NULL;
        return fdt;
+out2:
+       nfds = fdt->max_fdset;
 out:
        if (new_openset)
                free_fdset(new_openset, nfds);
index 8d6d85d7400f829c44444fa5143858eedd193735..6a984f64edd7179893887528f07a63f90bf7b15c 100644 (file)
@@ -382,7 +382,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
                                 */
                                if (n) { 
                                        if (clear_user(buffer + tsz - n,
-                                                               tsz - n))
+                                                               n))
                                                return -EFAULT;
                                }
                        } else {
index 05fd2787be989831e25c61dcce966360f534c544..684bca3d3a107c021715f8394a1f1d23a1913aaa 100644 (file)
@@ -1306,6 +1306,85 @@ asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
        return error;
 }
 
+/*
+ * Make sure there's data to read. Wait for input if we can, otherwise
+ * return an appropriate error.
+ */
+static int link_ipipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
+{
+       int ret;
+
+       /*
+        * Check ->nrbufs without the inode lock first. This function
+        * is speculative anyways, so missing one is ok.
+        */
+       if (pipe->nrbufs)
+               return 0;
+
+       ret = 0;
+       mutex_lock(&pipe->inode->i_mutex);
+
+       while (!pipe->nrbufs) {
+               if (signal_pending(current)) {
+                       ret = -ERESTARTSYS;
+                       break;
+               }
+               if (!pipe->writers)
+                       break;
+               if (!pipe->waiting_writers) {
+                       if (flags & SPLICE_F_NONBLOCK) {
+                               ret = -EAGAIN;
+                               break;
+                       }
+               }
+               pipe_wait(pipe);
+       }
+
+       mutex_unlock(&pipe->inode->i_mutex);
+       return ret;
+}
+
+/*
+ * Make sure there's writeable room. Wait for room if we can, otherwise
+ * return an appropriate error.
+ */
+static int link_opipe_prep(struct pipe_inode_info *pipe, unsigned int flags)
+{
+       int ret;
+
+       /*
+        * Check ->nrbufs without the inode lock first. This function
+        * is speculative anyways, so missing one is ok.
+        */
+       if (pipe->nrbufs < PIPE_BUFFERS)
+               return 0;
+
+       ret = 0;
+       mutex_lock(&pipe->inode->i_mutex);
+
+       while (pipe->nrbufs >= PIPE_BUFFERS) {
+               if (!pipe->readers) {
+                       send_sig(SIGPIPE, current, 0);
+                       ret = -EPIPE;
+                       break;
+               }
+               if (flags & SPLICE_F_NONBLOCK) {
+                       ret = -EAGAIN;
+                       break;
+               }
+               if (signal_pending(current)) {
+                       ret = -ERESTARTSYS;
+                       break;
+               }
+               pipe->waiting_writers++;
+               pipe_wait(pipe);
+               pipe->waiting_writers--;
+       }
+
+       mutex_unlock(&pipe->inode->i_mutex);
+       return ret;
+}
+
 /*
  * Link contents of ipipe to opipe.
  */
@@ -1314,9 +1393,7 @@ static int link_pipe(struct pipe_inode_info *ipipe,
                     size_t len, unsigned int flags)
 {
        struct pipe_buffer *ibuf, *obuf;
-       int ret, do_wakeup, i, ipipe_first;
-
-       ret = do_wakeup = ipipe_first = 0;
+       int ret = 0, i = 0, nbuf;
 
        /*
         * Potential ABBA deadlock, work around it by ordering lock
@@ -1324,126 +1401,62 @@ static int link_pipe(struct pipe_inode_info *ipipe,
         * could deadlock (one doing tee from A -> B, the other from B -> A).
         */
        if (ipipe->inode < opipe->inode) {
-               ipipe_first = 1;
-               mutex_lock(&ipipe->inode->i_mutex);
-               mutex_lock(&opipe->inode->i_mutex);
+               mutex_lock_nested(&ipipe->inode->i_mutex, I_MUTEX_PARENT);
+               mutex_lock_nested(&opipe->inode->i_mutex, I_MUTEX_CHILD);
        } else {
-               mutex_lock(&opipe->inode->i_mutex);
-               mutex_lock(&ipipe->inode->i_mutex);
+               mutex_lock_nested(&opipe->inode->i_mutex, I_MUTEX_PARENT);
+               mutex_lock_nested(&ipipe->inode->i_mutex, I_MUTEX_CHILD);
        }
 
-       for (i = 0;; i++) {
+       do {
                if (!opipe->readers) {
                        send_sig(SIGPIPE, current, 0);
                        if (!ret)
                                ret = -EPIPE;
                        break;
                }
-               if (ipipe->nrbufs - i) {
-                       ibuf = ipipe->bufs + ((ipipe->curbuf + i) & (PIPE_BUFFERS - 1));
 
-                       /*
-                        * If we have room, fill this buffer
-                        */
-                       if (opipe->nrbufs < PIPE_BUFFERS) {
-                               int nbuf = (opipe->curbuf + opipe->nrbufs) & (PIPE_BUFFERS - 1);
-
-                               /*
-                                * Get a reference to this pipe buffer,
-                                * so we can copy the contents over.
-                                */
-                               ibuf->ops->get(ipipe, ibuf);
-
-                               obuf = opipe->bufs + nbuf;
-                               *obuf = *ibuf;
-
-                               /*
-                                * Don't inherit the gift flag, we need to
-                                * prevent multiple steals of this page.
-                                */
-                               obuf->flags &= ~PIPE_BUF_FLAG_GIFT;
-
-                               if (obuf->len > len)
-                                       obuf->len = len;
-
-                               opipe->nrbufs++;
-                               do_wakeup = 1;
-                               ret += obuf->len;
-                               len -= obuf->len;
-
-                               if (!len)
-                                       break;
-                               if (opipe->nrbufs < PIPE_BUFFERS)
-                                       continue;
-                       }
-
-                       /*
-                        * We have input available, but no output room.
-                        * If we already copied data, return that. If we
-                        * need to drop the opipe lock, it must be ordered
-                        * last to avoid deadlocks.
-                        */
-                       if ((flags & SPLICE_F_NONBLOCK) || !ipipe_first) {
-                               if (!ret)
-                                       ret = -EAGAIN;
-                               break;
-                       }
-                       if (signal_pending(current)) {
-                               if (!ret)
-                                       ret = -ERESTARTSYS;
-                               break;
-                       }
-                       if (do_wakeup) {
-                               smp_mb();
-                               if (waitqueue_active(&opipe->wait))
-                                       wake_up_interruptible(&opipe->wait);
-                               kill_fasync(&opipe->fasync_readers, SIGIO, POLL_IN);
-                               do_wakeup = 0;
-                       }
+               /*
+                * If we have iterated all input buffers or ran out of
+                * output room, break.
+                */
+               if (i >= ipipe->nrbufs || opipe->nrbufs >= PIPE_BUFFERS)
+                       break;
 
-                       opipe->waiting_writers++;
-                       pipe_wait(opipe);
-                       opipe->waiting_writers--;
-                       continue;
-               }
+               ibuf = ipipe->bufs + ((ipipe->curbuf + i) & (PIPE_BUFFERS - 1));
+               nbuf = (opipe->curbuf + opipe->nrbufs) & (PIPE_BUFFERS - 1);
 
                /*
-                * No input buffers, do the usual checks for available
-                * writers and blocking and wait if necessary
+                * Get a reference to this pipe buffer,
+                * so we can copy the contents over.
                 */
-               if (!ipipe->writers)
-                       break;
-               if (!ipipe->waiting_writers) {
-                       if (ret)
-                               break;
-               }
+               ibuf->ops->get(ipipe, ibuf);
+
+               obuf = opipe->bufs + nbuf;
+               *obuf = *ibuf;
+
                /*
-                * pipe_wait() drops the ipipe mutex. To avoid deadlocks
-                * with another process, we can only safely do that if
-                * the ipipe lock is ordered last.
+                * Don't inherit the gift flag, we need to
+                * prevent multiple steals of this page.
                 */
-               if ((flags & SPLICE_F_NONBLOCK) || ipipe_first) {
-                       if (!ret)
-                               ret = -EAGAIN;
-                       break;
-               }
-               if (signal_pending(current)) {
-                       if (!ret)
-                               ret = -ERESTARTSYS;
-                       break;
-               }
+               obuf->flags &= ~PIPE_BUF_FLAG_GIFT;
 
-               if (waitqueue_active(&ipipe->wait))
-                       wake_up_interruptible_sync(&ipipe->wait);
-               kill_fasync(&ipipe->fasync_writers, SIGIO, POLL_OUT);
+               if (obuf->len > len)
+                       obuf->len = len;
 
-               pipe_wait(ipipe);
-       }
+               opipe->nrbufs++;
+               ret += obuf->len;
+               len -= obuf->len;
+               i++;
+       } while (len);
 
        mutex_unlock(&ipipe->inode->i_mutex);
        mutex_unlock(&opipe->inode->i_mutex);
 
-       if (do_wakeup) {
+       /*
+        * If we put data in the output pipe, wakeup any potential readers.
+        */
+       if (ret > 0) {
                smp_mb();
                if (waitqueue_active(&opipe->wait))
                        wake_up_interruptible(&opipe->wait);
@@ -1464,14 +1477,29 @@ static long do_tee(struct file *in, struct file *out, size_t len,
 {
        struct pipe_inode_info *ipipe = in->f_dentry->d_inode->i_pipe;
        struct pipe_inode_info *opipe = out->f_dentry->d_inode->i_pipe;
+       int ret = -EINVAL;
 
        /*
-        * Link ipipe to the two output pipes, consuming as we go along.
+        * Duplicate the contents of ipipe to opipe without actually
+        * copying the data.
         */
-       if (ipipe && opipe)
-               return link_pipe(ipipe, opipe, len, flags);
+       if (ipipe && opipe && ipipe != opipe) {
+               /*
+                * Keep going, unless we encounter an error. The ipipe/opipe
+                * ordering doesn't really matter.
+                */
+               ret = link_ipipe_prep(ipipe, flags);
+               if (!ret) {
+                       ret = link_opipe_prep(opipe, flags);
+                       if (!ret) {
+                               ret = link_pipe(ipipe, opipe, len, flags);
+                               if (!ret && (flags & SPLICE_F_NONBLOCK))
+                                       ret = -EAGAIN;
+                       }
+               }
+       }
 
-       return -EINVAL;
+       return ret;
 }
 
 asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags)
index 5e0e31cc46f5e269ebb8ed5c2fddec10f240e512..9889e54e1f13632e967423458cb83b4d5d590047 100644 (file)
@@ -109,6 +109,17 @@ static inline void set_inode_attr(struct inode * inode, struct iattr * iattr)
        inode->i_ctime = iattr->ia_ctime;
 }
 
+
+/*
+ * sysfs has a different i_mutex lock order behavior for i_mutex than other
+ * filesystems; sysfs i_mutex is called in many places with subsystem locks
+ * held. At the same time, many of the VFS locking rules do not apply to
+ * sysfs at all (cross directory rename for example). To untangle this mess
+ * (which gives false positives in lockdep), we're giving sysfs inodes their
+ * own class for i_mutex.
+ */
+static struct lock_class_key sysfs_inode_imutex_key;
+
 struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent * sd)
 {
        struct inode * inode = new_inode(sysfs_sb);
@@ -118,6 +129,7 @@ struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent * sd)
                inode->i_mapping->a_ops = &sysfs_aops;
                inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info;
                inode->i_op = &sysfs_inode_operations;
+               lockdep_set_class(&inode->i_mutex, &sysfs_inode_imutex_key);
 
                if (sd->s_iattr) {
                        /* sysfs_dirent has non-default attributes
index 1c4dba1c5f57168eb70954b0bc75138485d71a0c..3744f2e47f48fcd92fe03e9e89b550b841736e6d 100644 (file)
@@ -21,6 +21,7 @@
  */
 #define current_text_addr() ({ __label__ _l; _l: &&_l;})
 
+#include <linux/compiler.h>
 #include <linux/linkage.h>
 #include <asm/sections.h>
 #include <asm/segment.h>
@@ -139,7 +140,7 @@ unsigned long get_wchan(struct task_struct *p);
 extern struct task_struct *alloc_task_struct(void);
 extern void free_task_struct(struct task_struct *p);
 
-#define cpu_relax()    do { } while (0)
+#define cpu_relax()    barrier()
 
 /* data cache prefetch */
 #define ARCH_HAS_PREFETCH
index c7e2f454b83a570b5a445b061f028705166637bb..99b664aa20837e3f1d674800bc9377932267802e 100644 (file)
@@ -17,6 +17,7 @@
  */
 #define current_text_addr() ({ __label__ _l; _l: &&_l;})
 
+#include <linux/compiler.h>
 #include <asm/segment.h>
 #include <asm/fpu.h>
 #include <asm/ptrace.h>
@@ -129,6 +130,6 @@ unsigned long get_wchan(struct task_struct *p);
        eip; })
 #define        KSTK_ESP(tsk)   ((tsk) == current ? rdusp() : (tsk)->thread.usp)
 
-#define cpu_relax()    do { } while (0)
+#define cpu_relax()    barrier()
 
 #endif
index db398d88b1d950eaad4ae4296dd14169b4faf826..2db168ef949f4ba4a86c3cb4a3028542e0d95bf4 100644 (file)
@@ -82,10 +82,6 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
 #define savesegment(seg, value) \
        asm volatile("mov %%" #seg ",%0":"=rm" (value))
 
-/*
- * Clear and set 'TS' bit respectively
- */
-#define clts() __asm__ __volatile__ ("clts")
 #define read_cr0() ({ \
        unsigned int __dummy; \
        __asm__ __volatile__( \
@@ -94,7 +90,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
        __dummy; \
 })
 #define write_cr0(x) \
-       __asm__ __volatile__("movl %0,%%cr0": :"r" (x));
+       __asm__ __volatile__("movl %0,%%cr0": :"r" (x))
 
 #define read_cr2() ({ \
        unsigned int __dummy; \
@@ -104,7 +100,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
        __dummy; \
 })
 #define write_cr2(x) \
-       __asm__ __volatile__("movl %0,%%cr2": :"r" (x));
+       __asm__ __volatile__("movl %0,%%cr2": :"r" (x))
 
 #define read_cr3() ({ \
        unsigned int __dummy; \
@@ -114,7 +110,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
        __dummy; \
 })
 #define write_cr3(x) \
-       __asm__ __volatile__("movl %0,%%cr3": :"r" (x));
+       __asm__ __volatile__("movl %0,%%cr3": :"r" (x))
 
 #define read_cr4() ({ \
        unsigned int __dummy; \
@@ -123,7 +119,6 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
                :"=r" (__dummy)); \
        __dummy; \
 })
-
 #define read_cr4_safe() ({                           \
        unsigned int __dummy;                         \
        /* This could fault if %cr4 does not exist */ \
@@ -135,15 +130,19 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
                : "=r" (__dummy): "0" (0));           \
        __dummy;                                      \
 })
-
 #define write_cr4(x) \
-       __asm__ __volatile__("movl %0,%%cr4": :"r" (x));
+       __asm__ __volatile__("movl %0,%%cr4": :"r" (x))
+
+/*
+ * Clear and set 'TS' bit respectively
+ */
+#define clts() __asm__ __volatile__ ("clts")
 #define stts() write_cr0(8 | read_cr0())
 
 #endif /* __KERNEL__ */
 
 #define wbinvd() \
-       __asm__ __volatile__ ("wbinvd": : :"memory");
+       __asm__ __volatile__ ("wbinvd": : :"memory")
 
 static inline unsigned long get_limit(unsigned long segment)
 {
index 0ee158e09abb3f259f7fb9f6572893748850ac62..9d3a1bf412312b1f09847c515b485b179f6ccafe 100644 (file)
@@ -13,6 +13,7 @@
  */
 #define current_text_addr() ({ __label__ _l; _l: &&_l;})
 
+#include <linux/compiler.h>
 #include <linux/threads.h>
 #include <asm/types.h>
 #include <asm/segment.h>
@@ -137,6 +138,6 @@ unsigned long get_wchan(struct task_struct *p);
        eip; })
 #define        KSTK_ESP(tsk)   ((tsk) == current ? rdusp() : (tsk)->thread.usp)
 
-#define cpu_relax()    do { } while (0)
+#define cpu_relax()    barrier()
 
 #endif
index 05be9515a2d2e8509cdac90753c3903435b24b70..62b29b10bc6dbca19ba2635bdb3dd247db82c120 100644 (file)
@@ -93,7 +93,7 @@ extern int __put_user_bad(void);
 #define get_user(x, ptr)                                       \
 ({                                                             \
     int __gu_err = 0;                                          \
-    typeof(*(ptr)) __gu_val = 0;                               \
+    typeof(x) __gu_val = 0;                                    \
     switch (sizeof(*(ptr))) {                                  \
     case 1:                                                    \
        __get_user_asm(__gu_err, __gu_val, ptr, b, "=d");       \
@@ -105,23 +105,23 @@ extern int __put_user_bad(void);
        __get_user_asm(__gu_err, __gu_val, ptr, l, "=r");       \
        break;                                                  \
     case 8:                                                    \
-       memcpy(&__gu_val, ptr, sizeof (*(ptr))); \
+       memcpy((void *) &__gu_val, ptr, sizeof (*(ptr)));       \
        break;                                                  \
     default:                                                   \
        __gu_val = 0;                                           \
        __gu_err = __get_user_bad();                            \
        break;                                                  \
     }                                                          \
-    (x) = __gu_val;                                            \
+    (x) = (typeof(*(ptr))) __gu_val;                           \
     __gu_err;                                                  \
 })
 #define __get_user(x, ptr) get_user(x, ptr)
 
 extern int __get_user_bad(void);
 
-#define __get_user_asm(err,x,ptr,bwl,reg)      \
-       __asm__ ("move" #bwl " %1,%0"                   \
-                : "=d" (x)                                                     \
+#define __get_user_asm(err,x,ptr,bwl,reg)                      \
+       __asm__ ("move" #bwl " %1,%0"                           \
+                : "=d" (x)                                     \
                 : "m" (*__ptr(ptr)))
 
 #define copy_from_user(to, from, n)            (memcpy(to, from, n), 0)
index 7ddaa05b98d8406b9988921b5275179083bd8e94..87689836394442804ce094da6358dd898c272081 100644 (file)
@@ -5,9 +5,18 @@
 
 #ifdef CONFIG_BUG
 
+static inline __attribute__((noreturn)) void __do_illegal_op(void)
+{
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
+       __builtin_trap();
+#else
+       asm volatile(".long 0");
+#endif
+}
+
 #define BUG() do { \
        printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
-       __builtin_trap(); \
+       __do_illegal_op(); \
 } while (0)
 
 #define HAVE_ARCH_BUG
index 12456cb2f882c10f95f77b97740c4bc32c532e4a..58c70acffc73cc91dc24c8532a3d320ace6d9708 100644 (file)
@@ -63,7 +63,7 @@ ccw_device_id_match(const struct ccw_device_id *array,
                return id;
        }
 
-       return 0;
+       return NULL;
 }
 
 /* The struct ccw device is our replacement for the globally accessible
index 2b16193063513003e49e7327e8e5add0690f48a9..28fdd6e2b8badf73baa7b53c502f1d2b12e30c51 100644 (file)
@@ -276,6 +276,8 @@ extern void wait_cons_dev(void);
 
 extern void clear_all_subchannels(void);
 
+extern void cio_reset_channel_paths(void);
+
 extern void css_schedule_reprobe(void);
 
 #endif
index 1802775568b9904a6c8b5eddd811b908d3f4f0a3..ffedf14f89f68077696c29cffe1df2dc43ec15db 100644 (file)
@@ -98,9 +98,10 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
 
        if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
                return -EFAULT;
-       asm volatile("   cs   %1,%4,0(%5)\n"
+       asm volatile("   sacf 256\n"
+                    "   cs   %1,%4,0(%5)\n"
                     "0: lr   %0,%1\n"
-                    "1:\n"
+                    "1: sacf 0\n"
 #ifndef __s390x__
                     ".section __ex_table,\"a\"\n"
                     "   .align 4\n"
index 65f4db627e7a21def4574b3afdccd90c539d6be2..3b566a5b3cc73e19d2487931283da12a0b008d65 100644 (file)
        __flags; \
        })
 
-#define raw_local_save_flags(x) \
-       __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) )
-
-#define raw_local_irq_restore(x) \
-       __asm__ __volatile__("ssm   0(%0)" : : "a" (&x), "m" (x) : "memory")
+#define raw_local_save_flags(x)                                                        \
+do {                                                                           \
+       typecheck(unsigned long, x);                                            \
+       __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) );  \
+} while (0)
+
+#define raw_local_irq_restore(x)                                               \
+do {                                                                           \
+       typecheck(unsigned long, x);                                            \
+       __asm__ __volatile__("ssm   0(%0)" : : "a" (&x), "m" (x) : "memory");   \
+} while (0)
 
 #define raw_irqs_disabled()            \
 ({                                     \
        unsigned long flags;            \
-       local_save_flags(flags);        \
+       raw_local_save_flags(flags);    \
        !((flags >> __FLAG_SHIFT) & 3); \
 })
 
index 3002fda89d33272e6b7f4f2c9f24e7091efa3f90..a78e853e0dd521097f978dc1db725450d2dea86f 100644 (file)
@@ -142,7 +142,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
        pte_t *pte = pte_alloc_one_kernel(mm, vmaddr);
        if (pte)
                return virt_to_page(pte);
-       return 0;
+       return NULL;
 }
 
 static inline void pte_free_kernel(pte_t *pte)
index c5cbc4bd8414e12c571982cb5c5d0f85bec31406..5b71d37317239b94c38eef11eae89a34048b79d6 100644 (file)
@@ -199,15 +199,13 @@ unsigned long get_wchan(struct task_struct *p);
 /*
  * Give up the time slice of the virtual PU.
  */
-#ifndef __s390x__
-# define cpu_relax()   asm volatile ("diag 0,0,68" : : : "memory")
-#else /* __s390x__ */
-# define cpu_relax() \
-       do { \
-               if (MACHINE_HAS_DIAG44) \
-                       asm volatile ("diag 0,0,68" : : : "memory"); \
-       } while (0)
-#endif /* __s390x__ */
+static inline void cpu_relax(void)
+{
+       if (MACHINE_HAS_DIAG44)
+               asm volatile ("diag 0,0,68" : : : "memory");
+       else
+               barrier();
+}
 
 /*
  * Set PSW to specified value.
index da3fd4a7bb3257f75b0e6be92d7c13c1879b7c4d..19e31979309a14ce713333b540127cedefeb4ce9 100644 (file)
@@ -40,15 +40,16 @@ extern unsigned long machine_flags;
 #define MACHINE_IS_VM          (machine_flags & 1)
 #define MACHINE_IS_P390                (machine_flags & 4)
 #define MACHINE_HAS_MVPG       (machine_flags & 16)
-#define MACHINE_HAS_DIAG44     (machine_flags & 32)
 #define MACHINE_HAS_IDTE       (machine_flags & 128)
 
 #ifndef __s390x__
 #define MACHINE_HAS_IEEE       (machine_flags & 2)
 #define MACHINE_HAS_CSP                (machine_flags & 8)
+#define MACHINE_HAS_DIAG44     (1)
 #else /* __s390x__ */
 #define MACHINE_HAS_IEEE       (1)
 #define MACHINE_HAS_CSP                (1)
+#define MACHINE_HAS_DIAG44     (machine_flags & 32)
 #endif /* __s390x__ */
 
 
index fa5bd2d8803e4d612abe73ba0c0de9011aa895cc..eeb0f48bb99ead4f5b8d71d92d22df7f7a1d0fbb 100644 (file)
@@ -9,6 +9,7 @@
 #define __ASM_SH_PROCESSOR_H
 #ifdef __KERNEL__
 
+#include <linux/compiler.h>
 #include <asm/page.h>
 #include <asm/types.h>
 #include <asm/cache.h>
@@ -263,7 +264,7 @@ extern unsigned long get_wchan(struct task_struct *p);
 #define KSTK_ESP(tsk)  ((tsk)->thread.sp)
 
 #define cpu_sleep()    __asm__ __volatile__ ("sleep" : : : "memory")
-#define cpu_relax()    do { } while (0)
+#define cpu_relax()    barrier()
 
 #endif /* __KERNEL__ */
 #endif /* __ASM_SH_PROCESSOR_H */
index 1bf252dad8249e5d7f3078dde23f440729d59fad..eb2bee4b47b95e341389ad6cc48845945e0ad28f 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/cache.h>
 #include <asm/registers.h>
 #include <linux/threads.h>
+#include <linux/compiler.h>
 
 /*
  * Default implementation of macro that returns current
@@ -279,7 +280,7 @@ extern unsigned long get_wchan(struct task_struct *p);
 #define KSTK_EIP(tsk)  ((tsk)->thread.pc)
 #define KSTK_ESP(tsk)  ((tsk)->thread.sp)
 
-#define cpu_relax()    do { } while (0)
+#define cpu_relax()    barrier()
 
 #endif /* __ASSEMBLY__ */
 #endif /* __ASM_SH64_PROCESSOR_H */
index c78d44bb195fcc832503adf7ee3325038a945f47..9284c3cb27ec3c41aaf0a2bbb4c14f28d87e1336 100644 (file)
@@ -4,7 +4,7 @@ ALTARCH := sparc
 ARCHDEF := defined __sparc__ && defined __arch64__
 ALTARCHDEF := defined __sparc__ && !defined __arch64__
 
-unifdef-y := fbio.h perfctr.h
+unifdef-y += fbio.h perfctr.h
 header-y += apb.h asi.h bbc.h bpp.h display7seg.h envctrl.h floppy.h   \
        ipc.h kdebug.h mostek.h openprom.h openpromio.h parport.h       \
        pconf.h psrcompat.h pstate.h reg.h uctx.h utrap.h watchdog.h
index 6965b66ccaed89ff828bd331bece3a5a5c6ceefa..979e3467f9afc14b2a9e1db9eb33ec400c693371 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/thread_info.h>
 #endif
 
+#include <linux/compiler.h>
 #include <asm/ptrace.h>
 #include <asm/entry.h>
 
@@ -106,7 +107,7 @@ unsigned long get_wchan (struct task_struct *p);
 #define KSTK_ESP(task) task_sp (task)
 
 
-#define cpu_relax()    ((void)0)
+#define cpu_relax()    barrier()
 
 
 #else /* __ASSEMBLY__ */
index d1d72ad36f08e4506460b7e1aeaeb6b1b75d337b..8b96e77c9d829c6c2bd92fbe2c15b1616ade29f2 100644 (file)
@@ -20,6 +20,7 @@
 #include <xtensa/config/tie.h>
 #include <xtensa/config/system.h>
 
+#include <linux/compiler.h>
 #include <asm/ptrace.h>
 #include <asm/types.h>
 #include <asm/coprocessor.h>
@@ -191,7 +192,7 @@ extern unsigned long get_wchan(struct task_struct *p);
 #define KSTK_EIP(tsk)          (task_pt_regs(tsk)->pc)
 #define KSTK_ESP(tsk)          (task_pt_regs(tsk)->areg[1])
 
-#define cpu_relax()  do { } while (0)
+#define cpu_relax()  barrier()
 
 /* Special register access. */
 
index 4513f9e40937cd0d8383f89105934b258b6bc8fd..d5ebbb29aeaebc339fe893456bc2dba507f80453 100644 (file)
@@ -224,8 +224,6 @@ static __inline__ void debug_frame(const struct sk_buff *skb)
 int hdlc_open(struct net_device *dev);
 /* Must be called by hardware driver when HDLC device is being closed */
 void hdlc_close(struct net_device *dev);
-/* Called by hardware driver when DCD line level changes */
-void hdlc_set_carrier(int on, struct net_device *dev);
 
 /* May be used by hardware driver to gain control over HDLC device */
 static __inline__ void hdlc_proto_detach(hdlc_device *hdlc)
index 526ddc8eecfbf899b67ad0587fcf573e152d9021..eb0628a7ecc637ec71e18714105ac814f679f718 100644 (file)
@@ -193,6 +193,8 @@ struct i2c_algorithm {
           to NULL. If an adapter algorithm can do SMBus access, set 
           smbus_xfer. If set to NULL, the SMBus protocol is simulated
           using common I2C messages */
+       /* master_xfer should return the number of messages successfully
+          processed, or a negative value on error */
        int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, 
                           int num);
        int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, 
index 5612dfeeae5055c5305bb6512325b9a5ca98ad5e..d42c83399071fd61600a48eecbf67bc59c42d681 100644 (file)
@@ -97,7 +97,7 @@ extern struct resource iomem_resource;
 extern int request_resource(struct resource *root, struct resource *new);
 extern struct resource * ____request_resource(struct resource *root, struct resource *new);
 extern int release_resource(struct resource *new);
-extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new);
+extern int insert_resource(struct resource *parent, struct resource *new);
 extern int allocate_resource(struct resource *root, struct resource *new,
                             resource_size_t size, resource_size_t min,
                             resource_size_t max, resource_size_t align,
index 983fca251b25c67bfc23c738d282eb09a411602b..8565b81d7fbcd9b440c88e1a6fdaabb7d99d1b67 100644 (file)
@@ -161,6 +161,7 @@ struct pci_dev {
        unsigned int    is_enabled:1;   /* pci_enable_device has been called */
        unsigned int    is_busmaster:1; /* device is busmaster */
        unsigned int    no_msi:1;       /* device may not use msi */
+       unsigned int    no_d1d2:1;   /* only allow d0 or d3 */
        unsigned int    block_ucfg_access:1;    /* userspace config space access is blocked */
        unsigned int    broken_parity_status:1; /* Device generates false positive parity */
        unsigned int    msi_enabled:1;
index 6bce4a2403643058bcc35649654622af2ba65966..96930cb5927cddbf04852baca5c7aed50afd04ac 100644 (file)
 #define  PCI_ERR_CAP_ECRC_CHKE 0x00000100      /* ECRC Check Enable */
 #define PCI_ERR_HEADER_LOG     28      /* Header Log Register (16 bytes) */
 #define PCI_ERR_ROOT_COMMAND   44      /* Root Error Command */
+/* Correctable Err Reporting Enable */
+#define PCI_ERR_ROOT_CMD_COR_EN                0x00000001
+/* Non-fatal Err Reporting Enable */
+#define PCI_ERR_ROOT_CMD_NONFATAL_EN   0x00000002
+/* Fatal Err Reporting Enable */
+#define PCI_ERR_ROOT_CMD_FATAL_EN      0x00000004
 #define PCI_ERR_ROOT_STATUS    48
+#define PCI_ERR_ROOT_COR_RCV           0x00000001      /* ERR_COR Received */
+/* Multi ERR_COR Received */
+#define PCI_ERR_ROOT_MULTI_COR_RCV     0x00000002
+/* ERR_FATAL/NONFATAL Recevied */
+#define PCI_ERR_ROOT_UNCOR_RCV         0x00000004
+/* Multi ERR_FATAL/NONFATAL Recevied */
+#define PCI_ERR_ROOT_MULTI_UNCOR_RCV   0x00000008
+#define PCI_ERR_ROOT_FIRST_FATAL       0x00000010      /* First Fatal */
+#define PCI_ERR_ROOT_NONFATAL_RCV      0x00000020      /* Non-Fatal Received */
+#define PCI_ERR_ROOT_FATAL_RCV         0x00000040      /* Fatal Received */
 #define PCI_ERR_ROOT_COR_SRC   52
 #define PCI_ERR_ROOT_SRC       54
 
index 78027c533b94678fce8b685da41dc11fda656234..514729a446888e21dee4289db2ea4e71f80f6eaa 100644 (file)
@@ -14,11 +14,6 @@ extern int pm_active;
 struct pm_dev __deprecated *
 pm_register(pm_dev_t type, unsigned long id, pm_callback callback);
 
-/*
- * Unregister all devices with matching callback
- */
-void __deprecated pm_unregister_all(pm_callback callback);
-
 /*
  * Send a request to all devices
  */
@@ -35,8 +30,6 @@ static inline struct pm_dev *pm_register(pm_dev_t type,
        return NULL;
 }
 
-static inline void pm_unregister_all(pm_callback callback) {}
-
 static inline int pm_send_all(pm_request_t rqst, void *data)
 {
        return 0;
index ea4bc9d13735bdc3c71ea42952461c3ac3343e6a..ed241aad7c17a8c8375bce2728bca6c7018759fb 100644 (file)
@@ -2,6 +2,8 @@
 #define _ROOT_DEV_H_
 
 #include <linux/major.h>
+#include <linux/types.h>
+#include <linux/kdev_t.h>
 
 enum {
        Root_NFS = MKDEV(UNNAMED_MAJOR, 255),
index 8dead32e7ebf1065b1268f6b2d25ad781f35bd15..c944e8f06a4a2a3ce7519f82565c1780fc359d57 100644 (file)
@@ -48,7 +48,7 @@ struct ep_device;
  * @urb_list: urbs queued to this endpoint; maintained by usbcore
  * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH)
  *     with one or more transfer descriptors (TDs) per urb
- * @kobj: kobject for sysfs info
+ * @ep_dev: ep_device for sysfs info
  * @extra: descriptors following this endpoint in the configuration
  * @extralen: how many bytes of "extra" are valid
  *
similarity index 99%
rename from drivers/usb/serial/usb-serial.h
rename to include/linux/usb/serial.h
index 0f2802a60194a8d347baee83583a1c41e722ba3a..91c983eef899a6cbd78242b93da9b0923cdbbf88 100644 (file)
@@ -1,12 +1,12 @@
 /*
- * USB Serial Converter driver
+ * USB Serial Converter stuff
  *
  *     Copyright (C) 1999 - 2005
  *         Greg Kroah-Hartman (greg@kroah.com)
  *
  *     This program is free software; you can redistribute it and/or modify
  *     it under the terms of the GNU General Public License as published by
- *     the Free Software Foundation; either version 2 of the License.
+ *     the Free Software Foundation; version 2 of the License.
  *
  */
 
@@ -171,7 +171,7 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
  *     but before the device has been fully initialized by the usb_serial
  *     subsystem.  Use this function to download any firmware to the device,
  *     or any other early initialization that might be needed.
- *     Return 0 to continue on with the initialization sequence.  Anything 
+ *     Return 0 to continue on with the initialization sequence.  Anything
  *     else will abort it.
  * @attach: pointer to the driver's attach function.
  *     This will be called when the struct usb_serial structure is fully set
index a2aacfc7af2f968ac6b16cb0fc31845f97dcd4d9..c720d107ff29b4fbf29e17e2e3a90eff08b7988c 100644 (file)
@@ -51,6 +51,9 @@
 #define USB_RECIP_INTERFACE            0x01
 #define USB_RECIP_ENDPOINT             0x02
 #define USB_RECIP_OTHER                        0x03
+/* From Wireless USB 1.0 */
+#define USB_RECIP_PORT                         0x04
+#define USB_RECIP_RPIPE                0x05
 
 /*
  * Standard requests, for the bRequest field of a SETUP packet.
@@ -73,7 +76,9 @@
 
 #define USB_REQ_SET_ENCRYPTION         0x0D    /* Wireless USB */
 #define USB_REQ_GET_ENCRYPTION         0x0E
+#define USB_REQ_RPIPE_ABORT            0x0E
 #define USB_REQ_SET_HANDSHAKE          0x0F
+#define USB_REQ_RPIPE_RESET            0x0F
 #define USB_REQ_GET_HANDSHAKE          0x10
 #define USB_REQ_SET_CONNECTION         0x11
 #define USB_REQ_SET_SECURITY_DATA      0x12
@@ -159,6 +164,8 @@ struct usb_ctrlrequest {
 #define USB_DT_BOS                     0x0f
 #define USB_DT_DEVICE_CAPABILITY       0x10
 #define USB_DT_WIRELESS_ENDPOINT_COMP  0x11
+#define USB_DT_WIRE_ADAPTER            0x21
+#define USB_DT_RPIPE                   0x22
 
 /* conventional codes for class-specific descriptors */
 #define USB_DT_CS_DEVICE               0x21
index 1d78870ed8af5e465d15ce85b190a81b1bf5d405..e17186dbcdcabfbcbe32a02917e46c9eea270ac3 100644 (file)
@@ -872,9 +872,9 @@ int usb_gadget_config_buf(const struct usb_config_descriptor *config,
 /* utility wrapping a simple endpoint selection policy */
 
 extern struct usb_ep *usb_ep_autoconfig (struct usb_gadget *,
-                       struct usb_endpoint_descriptor *) __init;
+                       struct usb_endpoint_descriptor *) __devinit;
 
-extern void usb_ep_autoconfig_reset (struct usb_gadget *) __init;
+extern void usb_ep_autoconfig_reset (struct usb_gadget *) __devinit;
 
 #endif  /* __KERNEL__ */
 
index 608487a62c98f8e1f129350db0a3c70e3e766dd5..f38f43f20faea4eefb94a1c84c71eb0e302e931a 100644 (file)
@@ -43,6 +43,8 @@
                /* Need delay after Command phase */            \
        US_FLAG(NO_WP_DETECT,   0x00000200)                     \
                /* Don't check for write-protect */             \
+       US_FLAG(MAX_SECTORS_64, 0x00000400)                     \
+               /* Sets max_sectors to 64    */
 
 #define US_FLAG(name, value)   US_FL_##name = value ,
 enum { US_DO_ALL_FLAGS };
index 5d184be0ff728d5a0ce7b47d525d9594179d23f5..bab3ff457e40cfa00e21b40f2d9e14fee12f8e07 100644 (file)
@@ -188,8 +188,6 @@ struct snd_minor {
        int device;                     /* device number */
        const struct file_operations *f_ops;    /* file operations */
        void *private_data;             /* private data for f_ops->open */
-       char name[0];                   /* device name (keep at the end of
-                                                               structure) */
 };
 
 /* sound.c */
index 80b2979c0cba94c01945faf452d5523ee3c245ed..685928e6f65a52d90d622f2c17127736d63de551 100644 (file)
@@ -1704,6 +1704,7 @@ struct snd_cs46xx {
        int acpi_port;
        struct snd_kcontrol *eapd_switch; /* for amplifier hack */
        int accept_valid;       /* accept mmap valid (for OSS) */
+       int in_suspend;
 
        struct gameport *gameport;
 
index 84063ac8fcfc95bd15d56dc6778ec45bb503aa43..c50d15266c1096d42d61e296ea4da13d34cb57ec 100644 (file)
@@ -75,42 +75,6 @@ struct pm_dev *pm_register(pm_dev_t type,
        return dev;
 }
 
-static void __pm_unregister(struct pm_dev *dev)
-{
-       if (dev) {
-               list_del(&dev->entry);
-               kfree(dev);
-       }
-}
-
-/**
- *     pm_unregister_all - unregister all devices with matching callback
- *     @callback: callback function pointer
- *
- *     Unregister every device that would call the callback passed. This
- *     is primarily meant as a helper function for loadable modules. It
- *     enables a module to give up all its managed devices without keeping
- *     its own private list.
- */
-void pm_unregister_all(pm_callback callback)
-{
-       struct list_head *entry;
-
-       if (!callback)
-               return;
-
-       mutex_lock(&pm_devs_lock);
-       entry = pm_devs.next;
-       while (entry != &pm_devs) {
-               struct pm_dev *dev = list_entry(entry, struct pm_dev, entry);
-               entry = entry->next;
-               if (dev->callback == callback)
-                       __pm_unregister(dev);
-       }
-       mutex_unlock(&pm_devs_lock);
-}
-
 /**
  *     pm_send - send request to a single device
  *     @dev: device to send to
@@ -239,7 +203,6 @@ int pm_send_all(pm_request_t rqst, void *data)
 }
 
 EXPORT_SYMBOL(pm_register);
-EXPORT_SYMBOL(pm_unregister_all);
 EXPORT_SYMBOL(pm_send_all);
 EXPORT_SYMBOL(pm_active);
 
index 129cf046e56173d16201bcc089eff410bd530eca..0dd3a857579e4fe1b9aae9463aac4717e149eaa9 100644 (file)
@@ -404,8 +404,6 @@ int insert_resource(struct resource *parent, struct resource *new)
        return result;
 }
 
-EXPORT_SYMBOL(insert_resource);
-
 /*
  * Given an existing resource, change its start and size to match the
  * arguments.  Returns -EBUSY if it can't fit.  Existing children of
index dbb3b9c7ea64b17cf6aa7b96dcd007469e18f5d5..e236f98f7ec5d5460fa5eda7d97155bfb712df61 100644 (file)
@@ -1983,7 +1983,7 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
                        error = current->mm->dumpable;
                        break;
                case PR_SET_DUMPABLE:
-                       if (arg2 < 0 || arg2 > 2) {
+                       if (arg2 < 0 || arg2 > 1) {
                                error = -EINVAL;
                                break;
                        }
index 85c2e03098a7fcf60f9c2f250b0af5a72a0330cf..0f20843beffdb504574dc471bfaacf12abfd902d 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -674,6 +674,37 @@ static struct kmem_cache cache_cache = {
 #endif
 };
 
+#ifdef CONFIG_LOCKDEP
+
+/*
+ * Slab sometimes uses the kmalloc slabs to store the slab headers
+ * for other slabs "off slab".
+ * The locking for this is tricky in that it nests within the locks
+ * of all other slabs in a few places; to deal with this special
+ * locking we put on-slab caches into a separate lock-class.
+ */
+static struct lock_class_key on_slab_key;
+
+static inline void init_lock_keys(struct cache_sizes *s)
+{
+       int q;
+
+       for (q = 0; q < MAX_NUMNODES; q++) {
+               if (!s->cs_cachep->nodelists[q] || OFF_SLAB(s->cs_cachep))
+                       continue;
+               lockdep_set_class(&s->cs_cachep->nodelists[q]->list_lock,
+                                 &on_slab_key);
+       }
+}
+
+#else
+static inline void init_lock_keys(struct cache_sizes *s)
+{
+}
+#endif
+
+
+
 /* Guard access to the cache-chain. */
 static DEFINE_MUTEX(cache_chain_mutex);
 static struct list_head cache_chain;
@@ -1021,8 +1052,7 @@ static void drain_alien_cache(struct kmem_cache *cachep,
        }
 }
 
-static inline int cache_free_alien(struct kmem_cache *cachep, void *objp,
-                                  int nesting)
+static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
 {
        struct slab *slabp = virt_to_slab(objp);
        int nodeid = slabp->nodeid;
@@ -1040,7 +1070,7 @@ static inline int cache_free_alien(struct kmem_cache *cachep, void *objp,
        STATS_INC_NODEFREES(cachep);
        if (l3->alien && l3->alien[nodeid]) {
                alien = l3->alien[nodeid];
-               spin_lock_nested(&alien->lock, nesting);
+               spin_lock(&alien->lock);
                if (unlikely(alien->avail == alien->limit)) {
                        STATS_INC_ACOVERFLOW(cachep);
                        __drain_alien_cache(cachep, alien, nodeid);
@@ -1069,8 +1099,7 @@ static inline void free_alien_cache(struct array_cache **ac_ptr)
 {
 }
 
-static inline int cache_free_alien(struct kmem_cache *cachep, void *objp,
-                                  int nesting)
+static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
 {
        return 0;
 }
@@ -1393,6 +1422,7 @@ void __init kmem_cache_init(void)
                                        ARCH_KMALLOC_FLAGS|SLAB_PANIC,
                                        NULL, NULL);
                }
+               init_lock_keys(sizes);
 
                sizes->cs_dmacachep = kmem_cache_create(names->name_dma,
                                        sizes->cs_size,
@@ -1760,8 +1790,6 @@ static void slab_destroy_objs(struct kmem_cache *cachep, struct slab *slabp)
 }
 #endif
 
-static void __cache_free(struct kmem_cache *cachep, void *objp, int nesting);
-
 /**
  * slab_destroy - destroy and release all objects in a slab
  * @cachep: cache pointer being destroyed
@@ -1785,17 +1813,8 @@ static void slab_destroy(struct kmem_cache *cachep, struct slab *slabp)
                call_rcu(&slab_rcu->head, kmem_rcu_free);
        } else {
                kmem_freepages(cachep, addr);
-               if (OFF_SLAB(cachep)) {
-                       unsigned long flags;
-
-                       /*
-                        * lockdep: we may nest inside an already held
-                        * ac->lock, so pass in a nesting flag:
-                        */
-                       local_irq_save(flags);
-                       __cache_free(cachep->slabp_cache, slabp, 1);
-                       local_irq_restore(flags);
-               }
+               if (OFF_SLAB(cachep))
+                       kmem_cache_free(cachep->slabp_cache, slabp);
        }
 }
 
@@ -3100,16 +3119,7 @@ static void free_block(struct kmem_cache *cachep, void **objpp, int nr_objects,
                if (slabp->inuse == 0) {
                        if (l3->free_objects > l3->free_limit) {
                                l3->free_objects -= cachep->num;
-                               /*
-                                * It is safe to drop the lock. The slab is
-                                * no longer linked to the cache. cachep
-                                * cannot disappear - we are using it and
-                                * all destruction of caches must be
-                                * serialized properly by the user.
-                                */
-                               spin_unlock(&l3->list_lock);
                                slab_destroy(cachep, slabp);
-                               spin_lock(&l3->list_lock);
                        } else {
                                list_add(&slabp->list, &l3->slabs_free);
                        }
@@ -3135,7 +3145,7 @@ static void cache_flusharray(struct kmem_cache *cachep, struct array_cache *ac)
 #endif
        check_irq_off();
        l3 = cachep->nodelists[node];
-       spin_lock_nested(&l3->list_lock, SINGLE_DEPTH_NESTING);
+       spin_lock(&l3->list_lock);
        if (l3->shared) {
                struct array_cache *shared_array = l3->shared;
                int max = shared_array->limit - shared_array->avail;
@@ -3178,14 +3188,14 @@ free_done:
  * Release an obj back to its cache. If the obj has a constructed state, it must
  * be in this state _before_ it is released.  Called with disabled ints.
  */
-static void __cache_free(struct kmem_cache *cachep, void *objp, int nesting)
+static inline void __cache_free(struct kmem_cache *cachep, void *objp)
 {
        struct array_cache *ac = cpu_cache_get(cachep);
 
        check_irq_off();
        objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0));
 
-       if (cache_free_alien(cachep, objp, nesting))
+       if (cache_free_alien(cachep, objp))
                return;
 
        if (likely(ac->avail < ac->limit)) {
@@ -3424,7 +3434,7 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp)
        BUG_ON(virt_to_cache(objp) != cachep);
 
        local_irq_save(flags);
-       __cache_free(cachep, objp, 0);
+       __cache_free(cachep, objp);
        local_irq_restore(flags);
 }
 EXPORT_SYMBOL(kmem_cache_free);
@@ -3449,7 +3459,7 @@ void kfree(const void *objp)
        kfree_debugcheck(objp);
        c = virt_to_cache(objp);
        debug_check_no_locks_freed(objp, obj_size(c));
-       __cache_free(c, (void *)objp, 0);
+       __cache_free(c, (void *)objp);
        local_irq_restore(flags);
 }
 EXPORT_SYMBOL(kfree);
index f12be2acf9bc315b3aff2aa7f554800763e2bf61..000695c48583c07d2005fd9446a58671f8f8455f 100644 (file)
@@ -145,7 +145,7 @@ struct sock *ax25_find_listener(ax25_address *addr, int digi,
        ax25_cb *s;
        struct hlist_node *node;
 
-       spin_lock_bh(&ax25_list_lock);
+       spin_lock(&ax25_list_lock);
        ax25_for_each(s, node, &ax25_list) {
                if ((s->iamdigi && !digi) || (!s->iamdigi && digi))
                        continue;
@@ -154,12 +154,12 @@ struct sock *ax25_find_listener(ax25_address *addr, int digi,
                        /* If device is null we match any device */
                        if (s->ax25_dev == NULL || s->ax25_dev->dev == dev) {
                                sock_hold(s->sk);
-                               spin_unlock_bh(&ax25_list_lock);
+                               spin_unlock(&ax25_list_lock);
                                return s->sk;
                        }
                }
        }
-       spin_unlock_bh(&ax25_list_lock);
+       spin_unlock(&ax25_list_lock);
 
        return NULL;
 }
@@ -174,7 +174,7 @@ struct sock *ax25_get_socket(ax25_address *my_addr, ax25_address *dest_addr,
        ax25_cb *s;
        struct hlist_node *node;
 
-       spin_lock_bh(&ax25_list_lock);
+       spin_lock(&ax25_list_lock);
        ax25_for_each(s, node, &ax25_list) {
                if (s->sk && !ax25cmp(&s->source_addr, my_addr) &&
                    !ax25cmp(&s->dest_addr, dest_addr) &&
@@ -185,7 +185,7 @@ struct sock *ax25_get_socket(ax25_address *my_addr, ax25_address *dest_addr,
                }
        }
 
-       spin_unlock_bh(&ax25_list_lock);
+       spin_unlock(&ax25_list_lock);
 
        return sk;
 }
@@ -235,7 +235,7 @@ void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto)
        struct sk_buff *copy;
        struct hlist_node *node;
 
-       spin_lock_bh(&ax25_list_lock);
+       spin_lock(&ax25_list_lock);
        ax25_for_each(s, node, &ax25_list) {
                if (s->sk != NULL && ax25cmp(&s->source_addr, addr) == 0 &&
                    s->sk->sk_type == SOCK_RAW &&
@@ -248,7 +248,7 @@ void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto)
                                kfree_skb(copy);
                }
        }
-       spin_unlock_bh(&ax25_list_lock);
+       spin_unlock(&ax25_list_lock);
 }
 
 /*
index 1d4ab641f82be6094255f9046983a3b33fa9e570..4d22d4430ec8a85128484685c4886ca4adc73cfa 100644 (file)
@@ -80,7 +80,7 @@ void ax25_ds_enquiry_response(ax25_cb *ax25)
        ax25_start_t3timer(ax25);
        ax25_ds_set_timer(ax25->ax25_dev);
 
-       spin_lock_bh(&ax25_list_lock);
+       spin_lock(&ax25_list_lock);
        ax25_for_each(ax25o, node, &ax25_list) {
                if (ax25o == ax25)
                        continue;
@@ -106,7 +106,7 @@ void ax25_ds_enquiry_response(ax25_cb *ax25)
                if (ax25o->state != AX25_STATE_0)
                        ax25_start_t3timer(ax25o);
        }
-       spin_unlock_bh(&ax25_list_lock);
+       spin_unlock(&ax25_list_lock);
 }
 
 void ax25_ds_establish_data_link(ax25_cb *ax25)
@@ -162,13 +162,13 @@ static int ax25_check_dama_slave(ax25_dev *ax25_dev)
        int res = 0;
        struct hlist_node *node;
 
-       spin_lock_bh(&ax25_list_lock);
+       spin_lock(&ax25_list_lock);
        ax25_for_each(ax25, node, &ax25_list)
                if (ax25->ax25_dev == ax25_dev && (ax25->condition & AX25_COND_DAMA_MODE) && ax25->state > AX25_STATE_1) {
                        res = 1;
                        break;
                }
-       spin_unlock_bh(&ax25_list_lock);
+       spin_unlock(&ax25_list_lock);
 
        return res;
 }
index 5961459935eb4f0d13497b4b6b0ecda79f7ca6dc..4f44185955c790403435227d598d7c575d4880ea 100644 (file)
@@ -85,7 +85,7 @@ static void ax25_ds_timeout(unsigned long arg)
                return;
        }
 
-       spin_lock_bh(&ax25_list_lock);
+       spin_lock(&ax25_list_lock);
        ax25_for_each(ax25, node, &ax25_list) {
                if (ax25->ax25_dev != ax25_dev || !(ax25->condition & AX25_COND_DAMA_MODE))
                        continue;
@@ -93,7 +93,7 @@ static void ax25_ds_timeout(unsigned long arg)
                ax25_send_control(ax25, AX25_DISC, AX25_POLLON, AX25_COMMAND);
                ax25_disconnect(ax25, ETIMEDOUT);
        }
-       spin_unlock_bh(&ax25_list_lock);
+       spin_unlock(&ax25_list_lock);
 
        ax25_dev_dama_off(ax25_dev);
 }
index 77ba07c67682670f8d4a4035c98f6e166b9242e8..07ac0207eb69b0c2ea42f1b2b6b3b05cc7ab104f 100644 (file)
@@ -66,10 +66,10 @@ int ax25_protocol_register(unsigned int pid,
        protocol->pid  = pid;
        protocol->func = func;
 
-       write_lock(&protocol_list_lock);
+       write_lock_bh(&protocol_list_lock);
        protocol->next = protocol_list;
        protocol_list  = protocol;
-       write_unlock(&protocol_list_lock);
+       write_unlock_bh(&protocol_list_lock);
 
        return 1;
 }
@@ -80,16 +80,16 @@ void ax25_protocol_release(unsigned int pid)
 {
        struct protocol_struct *s, *protocol;
 
-       write_lock(&protocol_list_lock);
+       write_lock_bh(&protocol_list_lock);
        protocol = protocol_list;
        if (protocol == NULL) {
-               write_unlock(&protocol_list_lock);
+               write_unlock_bh(&protocol_list_lock);
                return;
        }
 
        if (protocol->pid == pid) {
                protocol_list = protocol->next;
-               write_unlock(&protocol_list_lock);
+               write_unlock_bh(&protocol_list_lock);
                kfree(protocol);
                return;
        }
@@ -98,14 +98,14 @@ void ax25_protocol_release(unsigned int pid)
                if (protocol->next->pid == pid) {
                        s = protocol->next;
                        protocol->next = protocol->next->next;
-                       write_unlock(&protocol_list_lock);
+                       write_unlock_bh(&protocol_list_lock);
                        kfree(s);
                        return;
                }
 
                protocol = protocol->next;
        }
-       write_unlock(&protocol_list_lock);
+       write_unlock_bh(&protocol_list_lock);
 }
 
 EXPORT_SYMBOL(ax25_protocol_release);
@@ -266,13 +266,13 @@ int ax25_protocol_is_registered(unsigned int pid)
        struct protocol_struct *protocol;
        int res = 0;
 
-       read_lock(&protocol_list_lock);
+       read_lock_bh(&protocol_list_lock);
        for (protocol = protocol_list; protocol != NULL; protocol = protocol->next)
                if (protocol->pid == pid) {
                        res = 1;
                        break;
                }
-       read_unlock(&protocol_list_lock);
+       read_unlock_bh(&protocol_list_lock);
 
        return res;
 }
index 6fb47e00e188bb2c292f3d7e94a7689651b832f8..be04e9fb11f604639f92e447451098902a9977d6 100644 (file)
 
 static struct cmtp_application *cmtp_application_add(struct cmtp_session *session, __u16 appl)
 {
-       struct cmtp_application *app = kmalloc(sizeof(*app), GFP_KERNEL);
+       struct cmtp_application *app = kzalloc(sizeof(*app), GFP_KERNEL);
 
        BT_DBG("session %p application %p appl %d", session, app, appl);
 
        if (!app)
                return NULL;
 
-       memset(app, 0, sizeof(*app));
-
        app->state = BT_OPEN;
        app->appl = appl;
 
index 182254a580e26e504294ae22d4e042195cecfe58..b81a01c64aeae8b35e601aec9029a98f4c1ecc86 100644 (file)
@@ -335,10 +335,9 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock)
        baswap(&src, &bt_sk(sock->sk)->src);
        baswap(&dst, &bt_sk(sock->sk)->dst);
 
-       session = kmalloc(sizeof(struct cmtp_session), GFP_KERNEL);
+       session = kzalloc(sizeof(struct cmtp_session), GFP_KERNEL);
        if (!session) 
                return -ENOMEM;
-       memset(session, 0, sizeof(struct cmtp_session));
 
        down_write(&cmtp_session_sem);
 
index 54e8e5ea21542ef47d87dcb84e47ae9917a581b1..5ed47427790385fc335168857d02082deb2ab498 100644 (file)
@@ -336,9 +336,8 @@ void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data)
 
        if (!(e = hci_inquiry_cache_lookup(hdev, &data->bdaddr))) {
                /* Entry not in the cache. Add new one. */
-               if (!(e = kmalloc(sizeof(struct inquiry_entry), GFP_ATOMIC)))
+               if (!(e = kzalloc(sizeof(struct inquiry_entry), GFP_ATOMIC)))
                        return;
-               memset(e, 0, sizeof(struct inquiry_entry));
                e->next     = cache->list;
                cache->list = e;
        }
@@ -800,12 +799,10 @@ struct hci_dev *hci_alloc_dev(void)
 {
        struct hci_dev *hdev;
 
-       hdev = kmalloc(sizeof(struct hci_dev), GFP_KERNEL);
+       hdev = kzalloc(sizeof(struct hci_dev), GFP_KERNEL);
        if (!hdev)
                return NULL;
 
-       memset(hdev, 0, sizeof(struct hci_dev));
-
        skb_queue_head_init(&hdev->driver_init);
 
        return hdev;
index edfea772fb6765c1d00f1e5cf8d6d33284e80b9b..c6abf2a5a9326e5a704a8ec5c8c647843033a891 100644 (file)
@@ -1,7 +1,6 @@
 config BT_HIDP
        tristate "HIDP protocol support"
-       depends on BT && BT_L2CAP && (BROKEN || !S390)
-       select INPUT
+       depends on BT && BT_L2CAP && INPUT
        help
          HIDP (Human Interface Device Protocol) is a transport layer
          for HID reports.  HIDP is required for the Bluetooth Human
index b9c24a55425c90205baa23dcc7f9fe2b2bd0bb00..c6e3a2c27c6ecc864dfa85153b1b42f557957f69 100644 (file)
@@ -582,10 +582,9 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
                        bacmp(&bt_sk(ctrl_sock->sk)->dst, &bt_sk(intr_sock->sk)->dst))
                return -ENOTUNIQ;
 
-       session = kmalloc(sizeof(struct hidp_session), GFP_KERNEL);
+       session = kzalloc(sizeof(struct hidp_session), GFP_KERNEL);
        if (!session)
                return -ENOMEM;
-       memset(session, 0, sizeof(struct hidp_session));
 
        session->input = input_allocate_device();
        if (!session->input) {
index eaaad658d11dcd34db3e606d6c2e58d5929cd73c..d56f60b392ac512b36a736f928844208ec88847a 100644 (file)
@@ -185,7 +185,7 @@ static inline void l2cap_chan_unlink(struct l2cap_chan_list *l, struct sock *sk)
 {
        struct sock *next = l2cap_pi(sk)->next_c, *prev = l2cap_pi(sk)->prev_c;
 
-       write_lock(&l->lock);
+       write_lock_bh(&l->lock);
        if (sk == l->head)
                l->head = next;
 
@@ -193,7 +193,7 @@ static inline void l2cap_chan_unlink(struct l2cap_chan_list *l, struct sock *sk)
                l2cap_pi(next)->prev_c = prev;
        if (prev)
                l2cap_pi(prev)->next_c = next;
-       write_unlock(&l->lock);
+       write_unlock_bh(&l->lock);
 
        __sock_put(sk);
 }
@@ -313,9 +313,9 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
 static inline void l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct sock *parent)
 {
        struct l2cap_chan_list *l = &conn->chan_list;
-       write_lock(&l->lock);
+       write_lock_bh(&l->lock);
        __l2cap_chan_add(conn, sk, parent);
-       write_unlock(&l->lock);
+       write_unlock_bh(&l->lock);
 }
 
 static inline u8 l2cap_get_ident(struct l2cap_conn *conn)
@@ -328,14 +328,14 @@ static inline u8 l2cap_get_ident(struct l2cap_conn *conn)
         *  200 - 254 are used by utilities like l2ping, etc.
         */
 
-       spin_lock(&conn->lock);
+       spin_lock_bh(&conn->lock);
 
        if (++conn->tx_ident > 128)
                conn->tx_ident = 1;
 
        id = conn->tx_ident;
 
-       spin_unlock(&conn->lock);
+       spin_unlock_bh(&conn->lock);
 
        return id;
 }
@@ -1416,11 +1416,11 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
        if (!sk)
                goto response;
 
-       write_lock(&list->lock);
+       write_lock_bh(&list->lock);
 
        /* Check if we already have channel with that dcid */
        if (__l2cap_get_chan_by_dcid(list, scid)) {
-               write_unlock(&list->lock);
+               write_unlock_bh(&list->lock);
                sock_set_flag(sk, SOCK_ZAPPED);
                l2cap_sock_kill(sk);
                goto response;
@@ -1458,7 +1458,7 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
        result = status = 0;
 
 done:
-       write_unlock(&list->lock);
+       write_unlock_bh(&list->lock);
 
 response:
        bh_unlock_sock(parent);
index 155a2b93760e0ccf0fdcc5a74adbee4cc2255c2a..77eab8f4c7fda87b7a03b410dca32dbb70335781 100644 (file)
@@ -273,10 +273,10 @@ static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d)
 
 struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio)
 {
-       struct rfcomm_dlc *d = kmalloc(sizeof(*d), prio);
+       struct rfcomm_dlc *d = kzalloc(sizeof(*d), prio);
+
        if (!d)
                return NULL;
-       memset(d, 0, sizeof(*d));
 
        init_timer(&d->timer);
        d->timer.function = rfcomm_dlc_timeout;
@@ -289,6 +289,7 @@ struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio)
        rfcomm_dlc_clear_state(d);
        
        BT_DBG("%p", d);
+
        return d;
 }
 
@@ -522,10 +523,10 @@ int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig)
 /* ---- RFCOMM sessions ---- */
 static struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state)
 {
-       struct rfcomm_session *s = kmalloc(sizeof(*s), GFP_KERNEL);
+       struct rfcomm_session *s = kzalloc(sizeof(*s), GFP_KERNEL);
+
        if (!s)
                return NULL;
-       memset(s, 0, sizeof(*s));
 
        BT_DBG("session %p sock %p", s, sock);
 
index 2ff2d5b87c933ce92207400de962f5edba04f4ea..bd8d671a0ba6f1622ee54e463c2d393b0a6a8943 100644 (file)
@@ -169,10 +169,9 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
 
        BT_DBG("id %d channel %d", req->dev_id, req->channel);
        
-       dev = kmalloc(sizeof(struct rfcomm_dev), GFP_KERNEL);
+       dev = kzalloc(sizeof(struct rfcomm_dev), GFP_KERNEL);
        if (!dev)
                return -ENOMEM;
-       memset(dev, 0, sizeof(struct rfcomm_dev));
 
        write_lock_bh(&rfcomm_dev_lock);
 
index 85defccc028791bc7cde5f0b37de5c3dc7b5fa11..7714a2ec3854d032ed0038ebcc8aea5e39494de7 100644 (file)
@@ -108,17 +108,14 @@ static void sco_sock_init_timer(struct sock *sk)
 static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status)
 {
        struct hci_dev *hdev = hcon->hdev;
-       struct sco_conn *conn;
-
-       if ((conn = hcon->sco_data))
-               return conn;
+       struct sco_conn *conn = hcon->sco_data;
 
-       if (status)
+       if (conn || status)
                return conn;
 
-       if (!(conn = kmalloc(sizeof(struct sco_conn), GFP_ATOMIC)))
+       conn = kzalloc(sizeof(struct sco_conn), GFP_ATOMIC);
+       if (!conn)
                return NULL;
-       memset(conn, 0, sizeof(struct sco_conn));
 
        spin_lock_init(&conn->lock);
 
@@ -134,6 +131,7 @@ static struct sco_conn *sco_conn_add(struct hci_conn *hcon, __u8 status)
                conn->mtu = 60;
 
        BT_DBG("hcon %p conn %p", hcon, conn);
+
        return conn;
 }
 
index e9489696f694540bfb90d12aba6e1cd3c5dd1d57..d1d7decf70b0087af2de9358049e5e43ed46d326 100644 (file)
@@ -196,15 +196,13 @@ EXPORT_SYMBOL(sk_stream_error);
 
 void __sk_stream_mem_reclaim(struct sock *sk)
 {
-       if (sk->sk_forward_alloc >= SK_STREAM_MEM_QUANTUM) {
-               atomic_sub(sk->sk_forward_alloc / SK_STREAM_MEM_QUANTUM,
-                          sk->sk_prot->memory_allocated);
-               sk->sk_forward_alloc &= SK_STREAM_MEM_QUANTUM - 1;
-               if (*sk->sk_prot->memory_pressure &&
-                   (atomic_read(sk->sk_prot->memory_allocated) <
-                    sk->sk_prot->sysctl_mem[0]))
-                       *sk->sk_prot->memory_pressure = 0;
-       }
+       atomic_sub(sk->sk_forward_alloc / SK_STREAM_MEM_QUANTUM,
+                  sk->sk_prot->memory_allocated);
+       sk->sk_forward_alloc &= SK_STREAM_MEM_QUANTUM - 1;
+       if (*sk->sk_prot->memory_pressure &&
+           (atomic_read(sk->sk_prot->memory_allocated) <
+            sk->sk_prot->sysctl_mem[0]))
+               *sk->sk_prot->memory_pressure = 0;
 }
 
 EXPORT_SYMBOL(__sk_stream_mem_reclaim);
index 1cb65305e1029b9bd47de0f041a469f098cb550f..23fb9d9768e369ecc0093805add00cf3f251a158 100644 (file)
@@ -1252,8 +1252,8 @@ fn_trie_insert(struct fib_table *tb, struct rtmsg *r, struct kern_rta *rta,
         */
 
        if (!fa_head) {
-               fa_head = fib_insert_node(t, &err, key, plen);
                err = 0;
+               fa_head = fib_insert_node(t, &err, key, plen);
                if (err)
                        goto out_free_new_fa;
        }
index 8e0374847532970b502609fbfecb9d75332a8896..8a8b5cf2f7fe68c805cec0de2ac2c23e5d944898 100644 (file)
@@ -70,7 +70,8 @@ static int ipcomp_decompress(struct xfrm_state *x, struct sk_buff *skb)
        if (err)
                goto out;
                
-       skb_put(skb, dlen - plen);
+       skb->truesize += dlen - plen;
+       __skb_put(skb, dlen - plen);
        memcpy(skb->data, scratch, dlen);
 out:   
        put_cpu();
index aaa1538c0692c2d842b244106e1f859817f28177..fa3e1aad660cf0ebe6c10ec34b653aab5e2aeef2 100644 (file)
@@ -139,14 +139,19 @@ static void hstcp_cong_avoid(struct sock *sk, u32 adk, u32 rtt,
                                tp->snd_cwnd++;
                }
        } else {
-               /* Update AIMD parameters */
+               /* Update AIMD parameters.
+                *
+                * We want to guarantee that:
+                *     hstcp_aimd_vals[ca->ai-1].cwnd <
+                *     snd_cwnd <=
+                *     hstcp_aimd_vals[ca->ai].cwnd
+                */
                if (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd) {
                        while (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd &&
                               ca->ai < HSTCP_AIMD_MAX - 1)
                                ca->ai++;
-               } else if (tp->snd_cwnd < hstcp_aimd_vals[ca->ai].cwnd) {
-                       while (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd &&
-                              ca->ai > 0)
+               } else if (ca->ai && tp->snd_cwnd <= hstcp_aimd_vals[ca->ai-1].cwnd) {
+                       while (ca->ai && tp->snd_cwnd <= hstcp_aimd_vals[ca->ai-1].cwnd)
                                ca->ai--;
                }
 
index c250d0af10d77c3fc76f90a842da7414d1b2ed1e..2316a4315a1800f7d750f9237eb8e29d7b5e77ac 100644 (file)
@@ -508,6 +508,26 @@ void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp)
        kfree(ifp);
 }
 
+static void
+ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp)
+{
+       struct inet6_ifaddr *ifa, **ifap;
+       int ifp_scope = ipv6_addr_src_scope(&ifp->addr);
+
+       /*
+        * Each device address list is sorted in order of scope -
+        * global before linklocal.
+        */
+       for (ifap = &idev->addr_list; (ifa = *ifap) != NULL;
+            ifap = &ifa->if_next) {
+               if (ifp_scope >= ipv6_addr_src_scope(&ifa->addr))
+                       break;
+       }
+
+       ifp->if_next = *ifap;
+       *ifap = ifp;
+}
+
 /* On success it returns ifp with increased reference count */
 
 static struct inet6_ifaddr *
@@ -573,8 +593,7 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr, int pfxlen,
 
        write_lock(&idev->lock);
        /* Add to inet6_dev unicast addr list. */
-       ifa->if_next = idev->addr_list;
-       idev->addr_list = ifa;
+       ipv6_link_dev_addr(idev, ifa);
 
 #ifdef CONFIG_IPV6_PRIVACY
        if (ifa->flags&IFA_F_TEMPORARY) {
@@ -987,7 +1006,7 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
                                        continue;
                        } else if (score.scope < hiscore.scope) {
                                if (score.scope < daddr_scope)
-                                       continue;
+                                       break; /* addresses sorted by scope */
                                else {
                                        score.rule = 2;
                                        goto record_it;
index b285b0357084adac5a81679d8a8e577863dd233d..7e4d1c17bfbc1295e00805b0808c6ec770bf4f8c 100644 (file)
@@ -109,7 +109,8 @@ static int ipcomp6_input(struct xfrm_state *x, struct sk_buff *skb)
                goto out_put_cpu;
        }
 
-       skb_put(skb, dlen - plen);
+       skb->truesize += dlen - plen;
+       __skb_put(skb, dlen - plen);
        memcpy(skb->data, scratch, dlen);
        err = ipch->nexthdr;
 
index ecc796878f38cf5ba9bca426c7cc47e941aefaa7..1d50f801f181f4e1c4962a09d6acb81e23c7577a 100644 (file)
@@ -65,6 +65,14 @@ static DEFINE_SPINLOCK(nr_list_lock);
 
 static const struct proto_ops nr_proto_ops;
 
+/*
+ * NETROM network devices are virtual network devices encapsulating NETROM
+ * frames into AX.25 which will be sent through an AX.25 device, so form a
+ * special "super class" of normal net devices; split their locks off into a
+ * separate class since they always nest.
+ */
+static struct lock_class_key nr_netdev_xmit_lock_key;
+
 /*
  *     Socket removal during an interrupt is now safe.
  */
@@ -986,18 +994,18 @@ int nr_rx_frame(struct sk_buff *skb, struct net_device *dev)
        nr_make->vl        = 0;
        nr_make->state     = NR_STATE_3;
        sk_acceptq_added(sk);
-
-       nr_insert_socket(make);
-
        skb_queue_head(&sk->sk_receive_queue, skb);
 
-       nr_start_heartbeat(make);
-       nr_start_idletimer(make);
-
        if (!sock_flag(sk, SOCK_DEAD))
                sk->sk_data_ready(sk, skb->len);
 
        bh_unlock_sock(sk);
+
+       nr_insert_socket(make);
+
+       nr_start_heartbeat(make);
+       nr_start_idletimer(make);
+
        return 1;
 }
 
@@ -1405,6 +1413,7 @@ static int __init nr_proto_init(void)
                        free_netdev(dev);
                        goto fail;
                }
+               lockdep_set_class(&dev->_xmit_lock, &nr_netdev_xmit_lock_key);
                dev_nr[i] = dev;
        }
 
index 75b72d389ba95283b4c0f1e9adfc69eb8d3ed2a5..ddba1c144260d4b6adfe1b288c9a68739d551b31 100644 (file)
@@ -138,8 +138,8 @@ static void nr_heartbeat_expiry(unsigned long param)
                if (sock_flag(sk, SOCK_DESTROY) ||
                    (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) {
                        sock_hold(sk);
-                       nr_destroy_socket(sk);
                        bh_unlock_sock(sk);
+                       nr_destroy_socket(sk);
                        sock_put(sk);
                        return;
                }
index c115295ab431e1a7c0c3652829e25b04b05a8e9e..08a542855654fb8981717faeb9a73ab52d3531b7 100644 (file)
@@ -66,6 +66,14 @@ static struct proto_ops rose_proto_ops;
 
 ax25_address rose_callsign;
 
+/*
+ * ROSE network devices are virtual network devices encapsulating ROSE
+ * frames into AX.25 which will be sent through an AX.25 device, so form a
+ * special "super class" of normal net devices; split their locks off into a
+ * separate class since they always nest.
+ */
+static struct lock_class_key rose_netdev_xmit_lock_key;
+
 /*
  *     Convert a ROSE address into text.
  */
@@ -1515,6 +1523,7 @@ static int __init rose_proto_init(void)
                        free_netdev(dev);
                        goto fail;
                }
+               lockdep_set_class(&dev->_xmit_lock, &rose_netdev_xmit_lock_key);
                dev_rose[i] = dev;
        }
 
index 0972247a839c7b239a7202de5d3293970eae7bd1..9affeeedf1070372650677711f0ccb97578e7cfa 100644 (file)
@@ -884,8 +884,6 @@ static int __init tc_action_init(void)
                link_p[RTM_GETACTION-RTM_BASE].dumpit = tc_dump_action;
        }
 
-       printk("TC classifier action (bugs to netdev@vger.kernel.org cc "
-              "hadi@cyberus.ca)\n");
        return 0;
 }
 
index 264f2efd1af88ffc26b3b333d08e88a0dd6e19e1..7edd1fc58b1747c20c7f8c65b7815053899949d5 100644 (file)
@@ -244,7 +244,7 @@ int snd_register_device(int type, struct snd_card *card, int dev,
        struct device *device = NULL;
 
        snd_assert(name, return -EINVAL);
-       preg = kmalloc(sizeof(struct snd_minor) + strlen(name) + 1, GFP_KERNEL);
+       preg = kmalloc(sizeof *preg, GFP_KERNEL);
        if (preg == NULL)
                return -ENOMEM;
        preg->type = type;
@@ -252,7 +252,6 @@ int snd_register_device(int type, struct snd_card *card, int dev,
        preg->device = dev;
        preg->f_ops = f_ops;
        preg->private_data = private_data;
-       strcpy(preg->name, name);
        mutex_lock(&sound_mutex);
 #ifdef CONFIG_SND_DYNAMIC_MINORS
        minor = snd_find_free_minor();
index 78199f58b93a7daf6fc9a53e5f7b1190d977b71a..0a984e881c1089ee68ac4ca11c8ad98a82d0902e 100644 (file)
@@ -628,8 +628,9 @@ static void snd_timer_tasklet(unsigned long arg)
        struct snd_timer_instance *ti;
        struct list_head *p;
        unsigned long resolution, ticks;
+       unsigned long flags;
 
-       spin_lock(&timer->lock);
+       spin_lock_irqsave(&timer->lock, flags);
        /* now process all callbacks */
        while (!list_empty(&timer->sack_list_head)) {
                p = timer->sack_list_head.next;         /* get first item */
@@ -649,7 +650,7 @@ static void snd_timer_tasklet(unsigned long arg)
                spin_lock(&timer->lock);
                ti->flags &= ~SNDRV_TIMER_IFLG_CALLBACK;
        }
-       spin_unlock(&timer->lock);
+       spin_unlock_irqrestore(&timer->lock, flags);
 }
 
 /*
index cb89f7eb9236dfee53a2870f8f0622a8d4f9f98a..64388cb8d6e508b9b5f24942cac2ee84285e1a8e 100644 (file)
@@ -76,23 +76,28 @@ int snd_cs8427_reg_write(struct snd_i2c_device *device, unsigned char reg,
        buf[0] = reg & 0x7f;
        buf[1] = val;
        if ((err = snd_i2c_sendbytes(device, buf, 2)) != 2) {
-               snd_printk(KERN_ERR "unable to send bytes 0x%02x:0x%02x to CS8427 (%i)\n", buf[0], buf[1], err);
+               snd_printk(KERN_ERR "unable to send bytes 0x%02x:0x%02x "
+                          "to CS8427 (%i)\n", buf[0], buf[1], err);
                return err < 0 ? err : -EIO;
        }
        return 0;
 }
 
+EXPORT_SYMBOL(snd_cs8427_reg_write);
+
 static int snd_cs8427_reg_read(struct snd_i2c_device *device, unsigned char reg)
 {
        int err;
        unsigned char buf;
 
        if ((err = snd_i2c_sendbytes(device, &reg, 1)) != 1) {
-               snd_printk(KERN_ERR "unable to send register 0x%x byte to CS8427\n", reg);
+               snd_printk(KERN_ERR "unable to send register 0x%x byte "
+                          "to CS8427\n", reg);
                return err < 0 ? err : -EIO;
        }
        if ((err = snd_i2c_readbytes(device, &buf, 1)) != 1) {
-               snd_printk(KERN_ERR "unable to read register 0x%x byte from CS8427\n", reg);
+               snd_printk(KERN_ERR "unable to read register 0x%x byte "
+                          "from CS8427\n", reg);
                return err < 0 ? err : -EIO;
        }
        return buf;
@@ -121,7 +126,8 @@ static int snd_cs8427_send_corudata(struct snd_i2c_device *device,
                                    int count)
 {
        struct cs8427 *chip = device->private_data;
-       char *hw_data = udata ? chip->playback.hw_udata : chip->playback.hw_status;
+       char *hw_data = udata ?
+               chip->playback.hw_udata : chip->playback.hw_status;
        char data[32];
        int err, idx;
 
@@ -134,11 +140,11 @@ static int snd_cs8427_send_corudata(struct snd_i2c_device *device,
                memset(data, 0, sizeof(data));
                if (memcmp(hw_data, data, count) == 0) {
                        chip->regmap[CS8427_REG_UDATABUF] &= ~CS8427_UBMMASK;
-                       chip->regmap[CS8427_REG_UDATABUF] |= CS8427_UBMZEROS | CS8427_EFTUI;
-                       if ((err = snd_cs8427_reg_write(device, CS8427_REG_UDATABUF,
-                                                       chip->regmap[CS8427_REG_UDATABUF])) < 0)
-                               return err;
-                       return 0;
+                       chip->regmap[CS8427_REG_UDATABUF] |= CS8427_UBMZEROS |
+                               CS8427_EFTUI;
+                       err = snd_cs8427_reg_write(device, CS8427_REG_UDATABUF,
+                                                  chip->regmap[CS8427_REG_UDATABUF]);
+                       return err < 0 ? err : 0;
                }
        }
        data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF;
@@ -161,24 +167,32 @@ int snd_cs8427_create(struct snd_i2c_bus *bus,
 {
        static unsigned char initvals1[] = {
          CS8427_REG_CONTROL1 | CS8427_REG_AUTOINC,
-         /* CS8427_REG_CONTROL1: RMCK to OMCK, valid PCM audio, disable mutes, TCBL=output */
+         /* CS8427_REG_CONTROL1: RMCK to OMCK, valid PCM audio, disable mutes,
+            TCBL=output */
          CS8427_SWCLK | CS8427_TCBLDIR,
-         /* CS8427_REG_CONTROL2: hold last valid audio sample, RMCK=256*Fs, normal stereo operation */
+         /* CS8427_REG_CONTROL2: hold last valid audio sample, RMCK=256*Fs,
+            normal stereo operation */
          0x00,
-         /* CS8427_REG_DATAFLOW: output drivers normal operation, Tx<=serial, Rx=>serial */
+         /* CS8427_REG_DATAFLOW: output drivers normal operation, Tx<=serial,
+            Rx=>serial */
          CS8427_TXDSERIAL | CS8427_SPDAES3RECEIVER,
-         /* CS8427_REG_CLOCKSOURCE: Run off, CMCK=256*Fs, output time base = OMCK, input time base =
-            recovered input clock, recovered input clock source is ILRCK changed to AES3INPUT (workaround, see snd_cs8427_reset) */
+         /* CS8427_REG_CLOCKSOURCE: Run off, CMCK=256*Fs,
+            output time base = OMCK, input time base = recovered input clock,
+            recovered input clock source is ILRCK changed to AES3INPUT
+            (workaround, see snd_cs8427_reset) */
          CS8427_RXDILRCK,
-         /* CS8427_REG_SERIALINPUT: Serial audio input port data format = I2S, 24-bit, 64*Fsi */
+         /* CS8427_REG_SERIALINPUT: Serial audio input port data format = I2S,
+            24-bit, 64*Fsi */
          CS8427_SIDEL | CS8427_SILRPOL,
-         /* CS8427_REG_SERIALOUTPUT: Serial audio output port data format = I2S, 24-bit, 64*Fsi */
+         /* CS8427_REG_SERIALOUTPUT: Serial audio output port data format
+            = I2S, 24-bit, 64*Fsi */
          CS8427_SODEL | CS8427_SOLRPOL,
        };
        static unsigned char initvals2[] = {
          CS8427_REG_RECVERRMASK | CS8427_REG_AUTOINC,
-         /* CS8427_REG_RECVERRMASK: unmask the input PLL clock, V, confidence, biphase, parity status bits */
-         /* CS8427_UNLOCK | CS8427_V | CS8427_CONF | CS8427_BIP | CS8427_PAR, */
+         /* CS8427_REG_RECVERRMASK: unmask the input PLL clock, V, confidence,
+            biphase, parity status bits */
+         /* CS8427_UNLOCK | CS8427_V | CS8427_CONF | CS8427_BIP | CS8427_PAR,*/
          0xff, /* set everything */
          /* CS8427_REG_CSDATABUF:
             Registers 32-55 window to CS buffer
@@ -201,7 +215,8 @@ int snd_cs8427_create(struct snd_i2c_bus *bus,
        struct snd_i2c_device *device;
        unsigned char buf[24];
 
-       if ((err = snd_i2c_device_create(bus, "CS8427", CS8427_ADDR | (addr & 7),
+       if ((err = snd_i2c_device_create(bus, "CS8427",
+                                        CS8427_ADDR | (addr & 7),
                                         &device)) < 0)
                return err;
        chip = device->private_data = kzalloc(sizeof(*chip), GFP_KERNEL);
@@ -212,8 +227,8 @@ int snd_cs8427_create(struct snd_i2c_bus *bus,
        device->private_free = snd_cs8427_free;
        
        snd_i2c_lock(bus);
-       if ((err = snd_cs8427_reg_read(device, CS8427_REG_ID_AND_VER)) !=
-           CS8427_VER8427A) {
+       err = snd_cs8427_reg_read(device, CS8427_REG_ID_AND_VER);
+       if (err != CS8427_VER8427A) {
                snd_i2c_unlock(bus);
                snd_printk(KERN_ERR "unable to find CS8427 signature "
                           "(expected 0x%x, read 0x%x),\n",
@@ -222,7 +237,8 @@ int snd_cs8427_create(struct snd_i2c_bus *bus,
                return -EFAULT;
        }
        /* turn off run bit while making changes to configuration */
-       if ((err = snd_cs8427_reg_write(device, CS8427_REG_CLOCKSOURCE, 0x00)) < 0)
+       err = snd_cs8427_reg_write(device, CS8427_REG_CLOCKSOURCE, 0x00);
+       if (err < 0)
                goto __fail;
        /* send initial values */
        memcpy(chip->regmap + (initvals1[0] & 0x7f), initvals1 + 1, 6);
@@ -282,6 +298,8 @@ int snd_cs8427_create(struct snd_i2c_bus *bus,
        return err < 0 ? err : -EIO;
 }
 
+EXPORT_SYMBOL(snd_cs8427_create);
+
 /*
  * Reset the chip using run bit, also lock PLL using ILRCK and
  * put back AES3INPUT. This workaround is described in latest
@@ -296,7 +314,8 @@ static void snd_cs8427_reset(struct snd_i2c_device *cs8427)
        snd_assert(cs8427, return);
        chip = cs8427->private_data;
        snd_i2c_lock(cs8427->bus);
-       if ((chip->regmap[CS8427_REG_CLOCKSOURCE] & CS8427_RXDAES3INPUT) == CS8427_RXDAES3INPUT)  /* AES3 bit is set */
+       if ((chip->regmap[CS8427_REG_CLOCKSOURCE] & CS8427_RXDAES3INPUT) ==
+           CS8427_RXDAES3INPUT)  /* AES3 bit is set */
                aes3input = 1;
        chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~(CS8427_RUN | CS8427_RXDMASK);
        snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE,
@@ -367,12 +386,15 @@ static int snd_cs8427_qsubcode_get(struct snd_kcontrol *kcontrol,
 
        snd_i2c_lock(device->bus);
        if ((err = snd_i2c_sendbytes(device, &reg, 1)) != 1) {
-               snd_printk(KERN_ERR "unable to send register 0x%x byte to CS8427\n", reg);
+               snd_printk(KERN_ERR "unable to send register 0x%x byte "
+                          "to CS8427\n", reg);
                snd_i2c_unlock(device->bus);
                return err < 0 ? err : -EIO;
        }
-       if ((err = snd_i2c_readbytes(device, ucontrol->value.bytes.data, 10)) != 10) {
-               snd_printk(KERN_ERR "unable to read Q-subcode bytes from CS8427\n");
+       err = snd_i2c_readbytes(device, ucontrol->value.bytes.data, 10);
+       if (err != 10) {
+               snd_printk(KERN_ERR "unable to read Q-subcode bytes "
+                          "from CS8427\n");
                snd_i2c_unlock(device->bus);
                return err < 0 ? err : -EIO;
        }
@@ -380,7 +402,8 @@ static int snd_cs8427_qsubcode_get(struct snd_kcontrol *kcontrol,
        return 0;
 }
 
-static int snd_cs8427_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
+static int snd_cs8427_spdif_info(struct snd_kcontrol *kcontrol,
+                                struct snd_ctl_elem_info *uinfo)
 {
        uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
        uinfo->count = 1;
@@ -413,7 +436,8 @@ static int snd_cs8427_spdif_put(struct snd_kcontrol *kcontrol,
        snd_i2c_lock(device->bus);
        change = memcmp(ucontrol->value.iec958.status, status, 24) != 0;
        memcpy(status, ucontrol->value.iec958.status, 24);
-       if (change && (kcontrol->private_value ? runtime != NULL : runtime == NULL)) {
+       if (change && (kcontrol->private_value ?
+                      runtime != NULL : runtime == NULL)) {
                err = snd_cs8427_send_corudata(device, 0, status, 24);
                if (err < 0)
                        change = err;
@@ -442,7 +466,8 @@ static struct snd_kcontrol_new snd_cs8427_iec958_controls[] = {
        .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
        .info =         snd_cs8427_in_status_info,
        .name =         "IEC958 CS8427 Input Status",
-       .access =       SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
+       .access =       (SNDRV_CTL_ELEM_ACCESS_READ |
+                        SNDRV_CTL_ELEM_ACCESS_VOLATILE),
        .get =          snd_cs8427_in_status_get,
        .private_value = 15,
 },
@@ -450,7 +475,8 @@ static struct snd_kcontrol_new snd_cs8427_iec958_controls[] = {
        .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
        .info =         snd_cs8427_in_status_info,
        .name =         "IEC958 CS8427 Error Status",
-       .access =       SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
+       .access =       (SNDRV_CTL_ELEM_ACCESS_READ |
+                        SNDRV_CTL_ELEM_ACCESS_VOLATILE),
        .get =          snd_cs8427_in_status_get,
        .private_value = 16,
 },
@@ -470,7 +496,8 @@ static struct snd_kcontrol_new snd_cs8427_iec958_controls[] = {
        .private_value = 0
 },
 {
-       .access =       SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
+       .access =       (SNDRV_CTL_ELEM_ACCESS_READWRITE |
+                        SNDRV_CTL_ELEM_ACCESS_INACTIVE),
        .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
        .name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),
        .info =         snd_cs8427_spdif_info,
@@ -482,7 +509,8 @@ static struct snd_kcontrol_new snd_cs8427_iec958_controls[] = {
        .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
        .info =         snd_cs8427_qsubcode_info,
        .name =         "IEC958 Q-subcode Capture Default",
-       .access =       SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
+       .access =       (SNDRV_CTL_ELEM_ACCESS_READ |
+                        SNDRV_CTL_ELEM_ACCESS_VOLATILE),
        .get =          snd_cs8427_qsubcode_get
 }};
 
@@ -505,7 +533,8 @@ int snd_cs8427_iec958_build(struct snd_i2c_device *cs8427,
                err = snd_ctl_add(cs8427->bus->card, kctl);
                if (err < 0)
                        return err;
-               if (!strcmp(kctl->id.name, SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM)))
+               if (! strcmp(kctl->id.name,
+                            SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM)))
                        chip->playback.pcm_ctl = kctl;
        }
 
@@ -515,6 +544,8 @@ int snd_cs8427_iec958_build(struct snd_i2c_device *cs8427,
        return 0;
 }
 
+EXPORT_SYMBOL(snd_cs8427_iec958_build);
+
 int snd_cs8427_iec958_active(struct snd_i2c_device *cs8427, int active)
 {
        struct cs8427 *chip;
@@ -522,13 +553,17 @@ int snd_cs8427_iec958_active(struct snd_i2c_device *cs8427, int active)
        snd_assert(cs8427, return -ENXIO);
        chip = cs8427->private_data;
        if (active)
-               memcpy(chip->playback.pcm_status, chip->playback.def_status, 24);
+               memcpy(chip->playback.pcm_status,
+                      chip->playback.def_status, 24);
        chip->playback.pcm_ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
-       snd_ctl_notify(cs8427->bus->card, SNDRV_CTL_EVENT_MASK_VALUE |
-                                         SNDRV_CTL_EVENT_MASK_INFO, &chip->playback.pcm_ctl->id);
+       snd_ctl_notify(cs8427->bus->card,
+                      SNDRV_CTL_EVENT_MASK_VALUE | SNDRV_CTL_EVENT_MASK_INFO,
+                      &chip->playback.pcm_ctl->id);
        return 0;
 }
 
+EXPORT_SYMBOL(snd_cs8427_iec958_active);
+
 int snd_cs8427_iec958_pcm(struct snd_i2c_device *cs8427, unsigned int rate)
 {
        struct cs8427 *chip;
@@ -568,6 +603,8 @@ int snd_cs8427_iec958_pcm(struct snd_i2c_device *cs8427, unsigned int rate)
        return err < 0 ? err : 0;
 }
 
+EXPORT_SYMBOL(snd_cs8427_iec958_pcm);
+
 static int __init alsa_cs8427_module_init(void)
 {
        return 0;
@@ -579,10 +616,3 @@ static void __exit alsa_cs8427_module_exit(void)
 
 module_init(alsa_cs8427_module_init)
 module_exit(alsa_cs8427_module_exit)
-
-EXPORT_SYMBOL(snd_cs8427_create);
-EXPORT_SYMBOL(snd_cs8427_reset);
-EXPORT_SYMBOL(snd_cs8427_reg_write);
-EXPORT_SYMBOL(snd_cs8427_iec958_build);
-EXPORT_SYMBOL(snd_cs8427_iec958_active);
-EXPORT_SYMBOL(snd_cs8427_iec958_pcm);
index d2afaea30cbcf2db9e8f25c4f5e24f20a1289460..2fb4f7409d7c132a9d131ad6018f59d7ef9b8ed0 100644 (file)
@@ -11,6 +11,7 @@ snd-cs4236-objs := cs4236.o
 
 # Toplevel Module Dependency
 obj-$(CONFIG_SND_AZT2320) += snd-cs4231-lib.o
+obj-$(CONFIG_SND_MIRO) += snd-cs4231-lib.o
 obj-$(CONFIG_SND_OPL3SA2) += snd-cs4231-lib.o
 obj-$(CONFIG_SND_CS4231) += snd-cs4231.o snd-cs4231-lib.o
 obj-$(CONFIG_SND_CS4232) += snd-cs4232.o snd-cs4231-lib.o
index 22cdddbfd8247088ad8d63b4bcb5f52cb29c3404..532c56e35ca496fd7a28c3252ce2823b840452e5 100644 (file)
@@ -87,7 +87,7 @@ MODULE_PARM_DESC(channels, "GF1 channels for GUS Extreme driver.");
 module_param_array(pcm_channels, int, NULL, 0444);
 MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Extreme driver.");
 
-struct platform_device *devices[SNDRV_CARDS];
+static struct platform_device *devices[SNDRV_CARDS];
 
 
 #define PFX    "gusextreme: "
index 180661c5ffdc916df766ce4320c2e86f79d0231b..4f0846feb73f1eb8218e014b399b176596ffd2da 100644 (file)
@@ -34,7 +34,7 @@
 
 /* weird stuff, derived from port I/O tracing with dosemu */
 
-static unsigned char page_zero[] __initdata = {
+static unsigned char page_zero[] __devinitdata = {
 0x01, 0x7c, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0x00,
 0x11, 0x00, 0x20, 0x00, 0x32, 0x00, 0x40, 0x00, 0x13, 0x00, 0x00,
 0x00, 0x14, 0x02, 0x76, 0x00, 0x60, 0x00, 0x80, 0x02, 0x00, 0x00,
@@ -61,7 +61,7 @@ static unsigned char page_zero[] __initdata = {
 0x1d, 0x02, 0xdf
 };
 
-static unsigned char page_one[] __initdata = {
+static unsigned char page_one[] __devinitdata = {
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00,
 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xd8, 0x00, 0x00,
 0x02, 0x20, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x01,
@@ -88,7 +88,7 @@ static unsigned char page_one[] __initdata = {
 0x60, 0x00, 0x1b
 };
 
-static unsigned char page_two[] __initdata = {
+static unsigned char page_two[] __devinitdata = {
 0xc4, 0x00, 0x44, 0x07, 0x44, 0x00, 0x40, 0x25, 0x01, 0x06, 0xc4,
 0x07, 0x40, 0x25, 0x01, 0x00, 0x46, 0x46, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -103,7 +103,7 @@ static unsigned char page_two[] __initdata = {
 0x46, 0x05, 0x46, 0x07, 0x46, 0x07, 0x44
 };
 
-static unsigned char page_three[] __initdata = {
+static unsigned char page_three[] __devinitdata = {
 0x07, 0x40, 0x00, 0x00, 0x00, 0x47, 0x00, 0x40, 0x00, 0x40, 0x06,
 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -118,7 +118,7 @@ static unsigned char page_three[] __initdata = {
 0x02, 0x00, 0x42, 0x00, 0xc0, 0x00, 0x40
 };
 
-static unsigned char page_four[] __initdata = {
+static unsigned char page_four[] __devinitdata = {
 0x63, 0x03, 0x26, 0x02, 0x2c, 0x00, 0x24, 0x00, 0x2e, 0x02, 0x02,
 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -133,7 +133,7 @@ static unsigned char page_four[] __initdata = {
 0x02, 0x62, 0x02, 0x20, 0x01, 0x21, 0x01
 };
 
-static unsigned char page_six[] __initdata = {
+static unsigned char page_six[] __devinitdata = {
 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x00,
 0x00, 0x08, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0e,
 0x00, 0x00, 0x10, 0x00, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x00,
@@ -154,7 +154,7 @@ static unsigned char page_six[] __initdata = {
 0x80, 0x00, 0x7e, 0x80, 0x80
 };
 
-static unsigned char page_seven[] __initdata = {
+static unsigned char page_seven[] __devinitdata = {
 0x0f, 0xff, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
 0x08, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f,
@@ -181,7 +181,7 @@ static unsigned char page_seven[] __initdata = {
 0x00, 0x02, 0x00
 };
 
-static unsigned char page_zero_v2[] __initdata = {
+static unsigned char page_zero_v2[] __devinitdata = {
 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -193,7 +193,7 @@ static unsigned char page_zero_v2[] __initdata = {
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
-static unsigned char page_one_v2[] __initdata = {
+static unsigned char page_one_v2[] __devinitdata = {
 0x01, 0xc0, 0x01, 0xfa, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -205,21 +205,21 @@ static unsigned char page_one_v2[] __initdata = {
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
-static unsigned char page_two_v2[] __initdata = {
+static unsigned char page_two_v2[] __devinitdata = {
 0x46, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00
 };
-static unsigned char page_three_v2[] __initdata = {
+static unsigned char page_three_v2[] __devinitdata = {
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00
 };
-static unsigned char page_four_v2[] __initdata = {
+static unsigned char page_four_v2[] __devinitdata = {
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -227,7 +227,7 @@ static unsigned char page_four_v2[] __initdata = {
 0x00, 0x00, 0x00, 0x00
 };
 
-static unsigned char page_seven_v2[] __initdata = {
+static unsigned char page_seven_v2[] __devinitdata = {
 0x0f, 0xff, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -239,7 +239,7 @@ static unsigned char page_seven_v2[] __initdata = {
 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
-static unsigned char mod_v2[] __initdata = {
+static unsigned char mod_v2[] __devinitdata = {
 0x01, 0x00, 0x02, 0x00, 0x01, 0x01, 0x02, 0x00, 0x01, 0x02, 0x02,
 0x00, 0x01, 0x03, 0x02, 0x00, 0x01, 0x04, 0x02, 0x00, 0x01, 0x05,
 0x02, 0x00, 0x01, 0x06, 0x02, 0x00, 0x01, 0x07, 0x02, 0x00, 0xb0,
@@ -269,7 +269,7 @@ static unsigned char mod_v2[] __initdata = {
 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x05, 0x02, 0x01, 0x01,
 0x06, 0x02, 0x01, 0x01, 0x07, 0x02, 0x01
 };
-static unsigned char coefficients[] __initdata = {
+static unsigned char coefficients[] __devinitdata = {
 0x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x00, 0x4b, 0x03,
 0x11, 0x00, 0x4d, 0x01, 0x32, 0x07, 0x46, 0x00, 0x00, 0x07, 0x49,
 0x00, 0x00, 0x07, 0x40, 0x00, 0x00, 0x07, 0x41, 0x00, 0x00, 0x01,
@@ -305,14 +305,14 @@ static unsigned char coefficients[] __initdata = {
 0x06, 0x6c, 0x4c, 0x6c, 0x06, 0x50, 0x52, 0xe2, 0x06, 0x42, 0x02,
 0xba
 };
-static unsigned char coefficients2[] __initdata = {
+static unsigned char coefficients2[] __devinitdata = {
 0x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x07, 0x45, 0x0f,
 0xff, 0x07, 0x48, 0x0f, 0xff, 0x07, 0x7b, 0x04, 0xcc, 0x07, 0x7d,
 0x04, 0xcc, 0x07, 0x7c, 0x00, 0x00, 0x07, 0x7e, 0x00, 0x00, 0x07,
 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x07, 0x47, 0x00, 0x00,
 0x07, 0x4a, 0x00, 0x00, 0x07, 0x4c, 0x00, 0x00, 0x07, 0x4e, 0x00, 0x00
 };
-static unsigned char coefficients3[] __initdata = {
+static unsigned char coefficients3[] __devinitdata = {
 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28, 0x00, 0x51, 0x00,
 0x51, 0x00, 0x7a, 0x00, 0x7a, 0x00, 0xa3, 0x00, 0xa3, 0x00, 0xcc,
 0x00, 0xcc, 0x00, 0xf5, 0x00, 0xf5, 0x01, 0x1e, 0x01, 0x1e, 0x01,
@@ -563,7 +563,7 @@ snd_wavefront_fx_ioctl (struct snd_hwdep *sdev, struct file *file,
 */
 
 
-int __init
+int __devinit
 snd_wavefront_fx_start (snd_wavefront_t *dev)
 
 {
index 15888ba2169bcb0fcce7c5b593cfa0a0e60970a8..cb3460094324db8f34069fc18485148a54232b39 100644 (file)
@@ -474,7 +474,7 @@ snd_wavefront_midi_disable_virtual (snd_wavefront_card_t *card)
        spin_unlock_irqrestore (&card->wavefront.midi.virtual, flags);
 }
 
-int __init
+int __devinit
 snd_wavefront_midi_start (snd_wavefront_card_t *card)
 
 {
index 68aa091e89617b9d6bb8915d96fda8810138c669..bed329edbdd7a357f2a9bd4a65aa91ab327d2261 100644 (file)
@@ -1738,7 +1738,7 @@ snd_wavefront_internal_interrupt (snd_wavefront_card_t *card)
 7 Unused
 */
 
-static int __init
+static int __devinit
 snd_wavefront_interrupt_bits (int irq)
 
 {
@@ -1766,7 +1766,7 @@ snd_wavefront_interrupt_bits (int irq)
        return bits;
 }
 
-static void __init
+static void __devinit
 wavefront_should_cause_interrupt (snd_wavefront_t *dev, 
                                  int val, int port, int timeout)
 
@@ -1787,7 +1787,7 @@ wavefront_should_cause_interrupt (snd_wavefront_t *dev,
        }
 }
 
-static int __init
+static int __devinit
 wavefront_reset_to_cleanliness (snd_wavefront_t *dev)
 
 {
@@ -1946,7 +1946,7 @@ wavefront_reset_to_cleanliness (snd_wavefront_t *dev)
 #include <asm/uaccess.h>
 
 
-static int __init
+static int __devinit
 wavefront_download_firmware (snd_wavefront_t *dev, char *path)
 
 {
@@ -2047,7 +2047,7 @@ wavefront_download_firmware (snd_wavefront_t *dev, char *path)
 }
 
 
-static int __init
+static int __devinit
 wavefront_do_reset (snd_wavefront_t *dev)
 
 {
@@ -2136,7 +2136,7 @@ wavefront_do_reset (snd_wavefront_t *dev)
        return 1;
 }
 
-int __init
+int __devinit
 snd_wavefront_start (snd_wavefront_t *dev)
 
 {
@@ -2178,7 +2178,7 @@ snd_wavefront_start (snd_wavefront_t *dev)
        return (0);
 }
 
-int __init
+int __devinit
 snd_wavefront_detect (snd_wavefront_card_t *card)
 
 {
index 23e54cedfd4a19c8c49915aa24f41e531535a68a..d7ad32f514da5f20f38f159fd96d40cc47d1c86a 100644 (file)
@@ -460,17 +460,19 @@ config SND_FM801
          To compile this driver as a module, choose M here: the module
          will be called snd-fm801.
 
-config SND_FM801_TEA575X
-       tristate "ForteMedia FM801 + TEA5757 tuner"
+config SND_FM801_TEA575X_BOOL
+       bool "ForteMedia FM801 + TEA5757 tuner"
        depends on SND_FM801
-        select VIDEO_DEV
        help
          Say Y here to include support for soundcards based on the ForteMedia
          FM801 chip with a TEA5757 tuner connected to GPIO1-3 pins (Media
-         Forte SF256-PCS-02).
+         Forte SF256-PCS-02) into the snd-fm801 driver.
 
-         To compile this driver as a module, choose M here: the module
-         will be called snd-fm801-tea575x.
+config SND_FM801_TEA575X
+       tristate
+       depends on SND_FM801_TEA575X_BOOL
+       default SND_FM801
+       select VIDEO_DEV
 
 config SND_HDA_INTEL
        tristate "Intel HD Audio"
index f7aef8c9cf439d1c6678461132476b1330eff782..0786d0edaca5aef42a26c28c11915200f1a3bc98 100644 (file)
@@ -241,14 +241,14 @@ ad1889_channel_reset(struct snd_ad1889 *chip, unsigned int channel)
        }
 }
 
-static inline u16
+static u16
 snd_ad1889_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
 {
        struct snd_ad1889 *chip = ac97->private_data;
        return ad1889_readw(chip, AD_AC97_BASE + reg);
 }
 
-static inline void
+static void
 snd_ad1889_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val)
 {
        struct snd_ad1889 *chip = ac97->private_data;
@@ -873,7 +873,7 @@ skip_hw:
        return 0;
 }
 
-static inline int
+static int
 snd_ad1889_dev_free(struct snd_device *device) 
 {
        struct snd_ad1889 *chip = device->device_data;
@@ -1051,7 +1051,7 @@ snd_ad1889_remove(struct pci_dev *pci)
        pci_set_drvdata(pci, NULL);
 }
 
-static struct pci_device_id snd_ad1889_ids[] __devinitdata = {
+static struct pci_device_id snd_ad1889_ids[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_ANALOG_DEVICES, PCI_DEVICE_ID_AD1889JS) },
        { 0, },
 };
index e0a815e53d1ce940eb3c5c989c93e86a433ea62d..74668398eac5da125b790cf5fe3cf5d7325f9ab0 100644 (file)
@@ -279,7 +279,7 @@ struct snd_ali {
 #endif
 };
 
-static struct pci_device_id snd_ali_ids[] __devinitdata = {
+static struct pci_device_id snd_ali_ids[] = {
        {PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5451), 0, 0, 0},
        {0, }
 };
index a9c38963188a2551f5bdd596e4c093469537de47..96cfb8ae5055441020e6a81cf4ce5336d4131e1b 100644 (file)
@@ -146,7 +146,7 @@ struct snd_als300_substream_data {
        int block_counter_register;
 };
 
-static struct pci_device_id snd_als300_ids[] __devinitdata = {
+static struct pci_device_id snd_als300_ids[] = {
        { 0x4005, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300 },
        { 0x4005, 0x0308, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300_PLUS },
        { 0, }
index a9f08066459a9122cb8170e04efa026ac49e0f22..9e596f750cbd1825c8ebd47ed94aff597daf9604 100644 (file)
@@ -116,7 +116,7 @@ struct snd_card_als4000 {
 #endif
 };
 
-static struct pci_device_id snd_als4000_ids[] __devinitdata = {
+static struct pci_device_id snd_als4000_ids[] = {
        { 0x4005, 0x4000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },   /* ALS4000 */
        { 0, }
 };
index 9fbb065a810b2c8cea503c68d9122f358f9eb719..347e25ff073dba9e5af492908f2a9190f1473413 100644 (file)
@@ -284,7 +284,7 @@ struct atiixp {
 
 /*
  */
-static struct pci_device_id snd_atiixp_ids[] __devinitdata = {
+static struct pci_device_id snd_atiixp_ids[] = {
        { 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */
        { 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */
        { 0x1002, 0x4370, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */
index 7dcf4941dce24fcc0669dee7982b763c344a791e..a89d67c4598ba410d6bcf3a0ef94dbf76624e332 100644 (file)
@@ -262,7 +262,7 @@ struct atiixp_modem {
 
 /*
  */
-static struct pci_device_id snd_atiixp_ids[] __devinitdata = {
+static struct pci_device_id snd_atiixp_ids[] = {
        { 0x1002, 0x434d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */
        { 0x1002, 0x4378, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */
        { 0, }
index bd3352998ad0be5bf58c13eaf68eb2ce6c2b5d89..fce22c7af0ea2a7d8c57af9910ae000d8f41db11 100644 (file)
@@ -1,6 +1,6 @@
 #include "au8810.h"
 #include "au88x0.h"
-static struct pci_device_id snd_vortex_ids[] __devinitdata = {
+static struct pci_device_id snd_vortex_ids[] = {
        {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_ADVANTAGE,
         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1,},
        {0,}
index 7e3fd8372d8d5217e034bf1e64d29320d654ce81..d1fbcce0725731cc46d35b3946a17299acbf68ce 100644 (file)
@@ -1,6 +1,6 @@
 #include "au8820.h"
 #include "au88x0.h"
-static struct pci_device_id snd_vortex_ids[] __devinitdata = {
+static struct pci_device_id snd_vortex_ids[] = {
        {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_1,
         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
        {0,}
index b840f6608a61bae4e2408509c6b938bbe9f3b94c..d4f2717c14fb07a896c13cfd943c78b5a107bb32 100644 (file)
@@ -1,6 +1,6 @@
 #include "au8830.h"
 #include "au88x0.h"
-static struct pci_device_id snd_vortex_ids[] __devinitdata = {
+static struct pci_device_id snd_vortex_ids[] = {
        {PCI_VENDOR_ID_AUREAL, PCI_DEVICE_ID_AUREAL_VORTEX_2,
         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
        {0,}
index f078b716d2b05e2b06f7180437cf465ac7b2e80b..b1cfc3c79d07e6ad4bc8a2cf12dcc3136afeb3ce 100644 (file)
@@ -270,7 +270,8 @@ static void vortex_mix_setvolumebyte(vortex_t * vortex, unsigned char mix,
 
 /* A3D functions. */
 #ifndef CHIP_AU8820
-static void vortex_Vort3D(vortex_t * v, int en);
+static void vortex_Vort3D_enable(vortex_t * v);
+static void vortex_Vort3D_disable(vortex_t * v);
 static void vortex_Vort3D_connect(vortex_t * vortex, int en);
 static void vortex_Vort3D_InitializeSource(a3dsrc_t * a, int en);
 #endif
index d215f393ea6460deaf620f9521cff016b21bb766..649849e540d3893484e61b3c6aa6c6dcb50a22e9 100644 (file)
@@ -593,24 +593,23 @@ static int Vort3DRend_Initialize(vortex_t * v, unsigned short mode)
 static int vortex_a3d_register_controls(vortex_t * vortex);
 static void vortex_a3d_unregister_controls(vortex_t * vortex);
 /* A3D base support init/shudown */
-static void vortex_Vort3D(vortex_t * v, int en)
+static void __devinit vortex_Vort3D_enable(vortex_t * v)
 {
        int i;
-       if (en) {
-               Vort3DRend_Initialize(v, XT_HEADPHONE);
-               for (i = 0; i < NR_A3D; i++) {
-                       vortex_A3dSourceHw_Initialize(v, i % 4, i >> 2);
-                       a3dsrc_ZeroStateA3D(&(v->a3d[0]));
-               }
-       } else {
-               vortex_XtalkHw_Disable(v);
+
+       Vort3DRend_Initialize(v, XT_HEADPHONE);
+       for (i = 0; i < NR_A3D; i++) {
+               vortex_A3dSourceHw_Initialize(v, i % 4, i >> 2);
+               a3dsrc_ZeroStateA3D(&(v->a3d[0]));
        }
        /* Register ALSA controls */
-       if (en) {
-               vortex_a3d_register_controls(v);
-       } else {
-               vortex_a3d_unregister_controls(v);
-       }
+       vortex_a3d_register_controls(v);
+}
+
+static void vortex_Vort3D_disable(vortex_t * v)
+{
+       vortex_XtalkHw_Disable(v);
+       vortex_a3d_unregister_controls(v);
 }
 
 /* Make A3D subsystem connections. */
@@ -855,7 +854,7 @@ static struct snd_kcontrol_new vortex_a3d_kcontrol __devinitdata = {
 };
 
 /* Control (un)registration. */
-static int vortex_a3d_register_controls(vortex_t * vortex)
+static int __devinit vortex_a3d_register_controls(vortex_t * vortex)
 {
        struct snd_kcontrol *kcontrol;
        int err, i;
index 4347e6abc1d5402765ebb6bf93b8243801efbfe0..5299cce583d357a18aca34f832cfa56011bf46ce 100644 (file)
@@ -2690,7 +2690,7 @@ static int __devinit vortex_core_init(vortex_t * vortex)
 #ifndef CHIP_AU8820
        vortex_eq_init(vortex);
        vortex_spdif_init(vortex, 48000, 1);
-       vortex_Vort3D(vortex, 1);
+       vortex_Vort3D_enable(vortex);
 #endif
 #ifndef CHIP_AU8810
        vortex_wt_init(vortex);
@@ -2718,7 +2718,7 @@ static int vortex_core_shutdown(vortex_t * vortex)
        printk(KERN_INFO "Vortex: shutdown...");
 #ifndef CHIP_AU8820
        vortex_eq_free(vortex);
-       vortex_Vort3D(vortex, 0);
+       vortex_Vort3D_disable(vortex);
 #endif
        //vortex_disable_timer_int(vortex);
        vortex_disable_int(vortex);
index 15447a3216dd70bea11ed95b3e92e3d168e59337..bac8e9cfd9218c3856f22021726eae1833959d22 100644 (file)
@@ -238,7 +238,7 @@ struct snd_azf3328 {
 #endif
 };
 
-static const struct pci_device_id snd_azf3328_ids[] __devinitdata = {
+static const struct pci_device_id snd_azf3328_ids[] = {
        { 0x122D, 0x50DC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },   /* PCI168/3328 */
        { 0x122D, 0x80DA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },   /* 3328 */
        { 0, }
index 4d4277d045aac5e5d5a646a94d386dd2a6530c79..97a280a246cb57002fa9028317c0660add7d7ac8 100644 (file)
@@ -774,7 +774,7 @@ static int __devinit snd_bt87x_create(struct snd_card *card,
          .driver_data = rate }
 
 /* driver_data is the default digital_rate value for that device */
-static struct pci_device_id snd_bt87x_ids[] __devinitdata = {
+static struct pci_device_id snd_bt87x_ids[] = {
        /* Hauppauge WinTV series */
        BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x0070, 0x13eb, 32000),
        /* Hauppauge WinTV series */
index a30c019bab64d353c86a1595611e3b2f618c3bb4..12bbbb6afd2df348df3526cf88a3da8a0a6bd7c0 100644 (file)
@@ -1602,7 +1602,7 @@ static void __devexit snd_ca0106_remove(struct pci_dev *pci)
 }
 
 // PCI IDs
-static struct pci_device_id snd_ca0106_ids[] __devinitdata = {
+static struct pci_device_id snd_ca0106_ids[] = {
        { 0x1102, 0x0007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },    /* Audigy LS or Live 24bit */
        { 0, }
 };
index 03766ad74998e1e731ce6fd922f2ba4dc18ab3e0..876b64464b6f2a6562aa5daecfedb355f0f96938 100644 (file)
@@ -2609,7 +2609,7 @@ static inline void snd_cmipci_proc_init(struct cmipci *cm) {}
 #endif
 
 
-static struct pci_device_id snd_cmipci_ids[] __devinitdata = {
+static struct pci_device_id snd_cmipci_ids[] = {
        {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8338B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        {PCI_VENDOR_ID_CMEDIA, PCI_DEVICE_ID_CMEDIA_CM8738, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
index d1802487f5beecea8a53655e3f2d3c9002f6d447..9631456ec3de84d5e278bc38daf17d99825abaf6 100644 (file)
@@ -494,7 +494,7 @@ struct cs4281 {
 
 static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
-static struct pci_device_id snd_cs4281_ids[] __devinitdata = {
+static struct pci_device_id snd_cs4281_ids[] = {
        { 0x1013, 0x6005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },   /* CS4281 */
        { 0, }
 };
index 772dc52bfeb270a858c256ac8b013d4632e4d6a1..8b6cd144d101c6cdc200e0d308f0540907b154a6 100644 (file)
@@ -65,7 +65,7 @@ MODULE_PARM_DESC(thinkpad, "Force to enable Thinkpad's CLKRUN control.");
 module_param_array(mmap_valid, bool, NULL, 0444);
 MODULE_PARM_DESC(mmap_valid, "Support OSS mmap.");
 
-static struct pci_device_id snd_cs46xx_ids[] __devinitdata = {
+static struct pci_device_id snd_cs46xx_ids[] = {
         { 0x1013, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },   /* CS4280 */
         { 0x1013, 0x6003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },   /* CS4612 */
         { 0x1013, 0x6004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },   /* CS4615 */
index 894545ea41fd2b6f534a833a313302e348d4f5aa..4851847180d24c3bb33041b7d3df2b1d34b9dd9c 100644 (file)
@@ -2317,7 +2317,7 @@ static struct snd_kcontrol_new snd_cs46xx_front_dup_ctl = {
 
 #ifdef CONFIG_SND_CS46XX_NEW_DSP
 /* Only available on the Hercules Game Theater XP soundcard */
-static struct snd_kcontrol_new snd_hercules_controls[] __devinitdata = {
+static struct snd_kcontrol_new snd_hercules_controls[] = {
 {
        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
        .name = "Optical/Coaxial SPDIF Input Switch",
@@ -3458,6 +3458,9 @@ static void hercules_mixer_init (struct snd_cs46xx *chip)
        snd_printdd ("initializing Hercules mixer\n");
 
 #ifdef CONFIG_SND_CS46XX_NEW_DSP
+       if (chip->in_suspend)
+               return;
+
        for (idx = 0 ; idx < ARRAY_SIZE(snd_hercules_controls); idx++) {
                struct snd_kcontrol *kctl;
 
@@ -3669,6 +3672,7 @@ int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state)
        int amp_saved;
 
        snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
+       chip->in_suspend = 1;
        snd_pcm_suspend_all(chip->pcm);
        // chip->ac97_powerdown = snd_cs46xx_codec_read(chip, AC97_POWER_CONTROL);
        // chip->ac97_general_purpose = snd_cs46xx_codec_read(chip, BA0_AC97_GENERAL_PURPOSE);
@@ -3722,6 +3726,7 @@ int snd_cs46xx_resume(struct pci_dev *pci)
        else
                chip->active_ctrl(chip, -1); /* disable CLKRUN */
        chip->amplifier = amp_saved;
+       chip->in_suspend = 0;
        snd_power_change_state(card, SNDRV_CTL_POWER_D0);
        return 0;
 }
index c12b24c679f2e1402150449d597c75c47a30b6de..64c7826e8b8c694899f9fbfeb474a4da383b8d17 100644 (file)
@@ -67,7 +67,7 @@ MODULE_PARM_DESC(id, "ID string for " DRIVER_NAME);
 module_param_array(enable, bool, NULL, 0444);
 MODULE_PARM_DESC(enable, "Enable " DRIVER_NAME);
 
-static struct pci_device_id snd_cs5535audio_ids[] __devinitdata = {
+static struct pci_device_id snd_cs5535audio_ids[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_AUDIO) },
        {}
index 549673ea14a9ae48cd2eda5b4eebc9c99041223f..289bcd99c19c8e14cae065cff776768dc6f4296c 100644 (file)
@@ -77,7 +77,7 @@ MODULE_PARM_DESC(subsystem, "Force card subsystem model.");
 /*
  * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value  Model:SB0400
  */
-static struct pci_device_id snd_emu10k1_ids[] __devinitdata = {
+static struct pci_device_id snd_emu10k1_ids[] = {
        { 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },    /* EMU10K1 */
        { 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },    /* Audigy */
        { 0x1102, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },    /* Audigy 2 Value SB0400 */
index d6f135fe29584b099bb172e69ca3a3807d402735..f9b5c3dc3b346ac51bb5f9e0543d85268475fd50 100644 (file)
@@ -531,7 +531,7 @@ static void snd_emu10k1_ecard_setadcgain(struct snd_emu10k1 * emu,
        snd_emu10k1_ecard_write(emu, emu->ecard_ctrl);
 }
 
-static int __devinit snd_emu10k1_ecard_init(struct snd_emu10k1 * emu)
+static int snd_emu10k1_ecard_init(struct snd_emu10k1 * emu)
 {
        unsigned int hc_value;
 
@@ -571,7 +571,7 @@ static int __devinit snd_emu10k1_ecard_init(struct snd_emu10k1 * emu)
        return 0;
 }
 
-static int __devinit snd_emu10k1_cardbus_init(struct snd_emu10k1 * emu)
+static int snd_emu10k1_cardbus_init(struct snd_emu10k1 * emu)
 {
        unsigned long special_port;
        unsigned int value;
@@ -633,7 +633,7 @@ static int snd_emu1212m_fpga_netlist_write(struct snd_emu10k1 * emu, int reg, in
        return 0;
 }
 
-static int __devinit snd_emu10k1_emu1212m_init(struct snd_emu10k1 * emu)
+static int snd_emu10k1_emu1212m_init(struct snd_emu10k1 * emu)
 {
        unsigned int i;
        int tmp;
@@ -1430,6 +1430,10 @@ void snd_emu10k1_resume_init(struct snd_emu10k1 *emu)
 {
        if (emu->card_capabilities->ecard)
                snd_emu10k1_ecard_init(emu);
+       else if (emu->card_capabilities->ca_cardbus_chip)
+               snd_emu10k1_cardbus_init(emu);
+       else if (emu->card_capabilities->emu1212m)
+               snd_emu10k1_emu1212m_init(emu);
        else
                snd_emu10k1_ptr_write(emu, AC97SLOT, 0, AC97SLOT_CNTR|AC97SLOT_LFE);
        snd_emu10k1_init(emu, emu->enable_ir, 1);
index 2167279429b8382da8e8373573283787ff6553f4..bda8bdf59935b367988aa692c14c69951fbe7916 100644 (file)
@@ -1286,7 +1286,7 @@ static void snd_emu10k1x_midi_interrupt(struct emu10k1x *emu, unsigned int statu
        do_emu10k1x_midi_interrupt(emu, &emu->midi, status);
 }
 
-static void snd_emu10k1x_midi_cmd(struct emu10k1x * emu,
+static int snd_emu10k1x_midi_cmd(struct emu10k1x * emu,
                                  struct emu10k1x_midi *midi, unsigned char cmd, int ack)
 {
        unsigned long flags;
@@ -1312,11 +1312,14 @@ static void snd_emu10k1x_midi_cmd(struct emu10k1x * emu,
                ok = 1;
        }
        spin_unlock_irqrestore(&midi->input_lock, flags);
-       if (!ok)
+       if (!ok) {
                snd_printk(KERN_ERR "midi_cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)!!!\n",
                           cmd, emu->port,
                           mpu401_read_stat(emu, midi),
                           mpu401_read_data(emu, midi));
+               return 1;
+       }
+       return 0;
 }
 
 static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream)
@@ -1332,12 +1335,17 @@ static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream)
        midi->substream_input = substream;
        if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_OUTPUT)) {
                spin_unlock_irqrestore(&midi->open_lock, flags);
-               snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1);
-               snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1);
+               if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1))
+                       goto error_out;
+               if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1))
+                       goto error_out;
        } else {
                spin_unlock_irqrestore(&midi->open_lock, flags);
        }
        return 0;
+
+error_out:
+       return -EIO;
 }
 
 static int snd_emu10k1x_midi_output_open(struct snd_rawmidi_substream *substream)
@@ -1353,12 +1361,17 @@ static int snd_emu10k1x_midi_output_open(struct snd_rawmidi_substream *substream
        midi->substream_output = substream;
        if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_INPUT)) {
                spin_unlock_irqrestore(&midi->open_lock, flags);
-               snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1);
-               snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1);
+               if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1))
+                       goto error_out;
+               if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1))
+                       goto error_out;
        } else {
                spin_unlock_irqrestore(&midi->open_lock, flags);
        }
        return 0;
+
+error_out:
+       return -EIO;
 }
 
 static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream)
@@ -1366,6 +1379,7 @@ static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream
        struct emu10k1x *emu;
        struct emu10k1x_midi *midi = substream->rmidi->private_data;
        unsigned long flags;
+       int err = 0;
 
        emu = midi->emu;
        snd_assert(emu, return -ENXIO);
@@ -1375,11 +1389,11 @@ static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream
        midi->substream_input = NULL;
        if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_OUTPUT)) {
                spin_unlock_irqrestore(&midi->open_lock, flags);
-               snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0);
+               err = snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0);
        } else {
                spin_unlock_irqrestore(&midi->open_lock, flags);
        }
-       return 0;
+       return err;
 }
 
 static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substream)
@@ -1387,6 +1401,7 @@ static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substrea
        struct emu10k1x *emu;
        struct emu10k1x_midi *midi = substream->rmidi->private_data;
        unsigned long flags;
+       int err = 0;
 
        emu = midi->emu;
        snd_assert(emu, return -ENXIO);
@@ -1396,11 +1411,11 @@ static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substrea
        midi->substream_output = NULL;
        if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_INPUT)) {
                spin_unlock_irqrestore(&midi->open_lock, flags);
-               snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0);
+               err = snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0);
        } else {
                spin_unlock_irqrestore(&midi->open_lock, flags);
        }
-       return 0;
+       return err;
 }
 
 static void snd_emu10k1x_midi_input_trigger(struct snd_rawmidi_substream *substream, int up)
@@ -1594,7 +1609,7 @@ static void __devexit snd_emu10k1x_remove(struct pci_dev *pci)
 }
 
 // PCI IDs
-static struct pci_device_id snd_emu10k1x_ids[] __devinitdata = {
+static struct pci_device_id snd_emu10k1x_ids[] = {
        { 0x1102, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },    /* Dell OEM version (EMU10K1) */
        { 0, }
 };
index d96eb455103f9c599d1432cd0689a66b00c8e63c..950c6bcd6b7d9945775cfdefb9bfb9958ca56d5c 100644 (file)
@@ -116,7 +116,7 @@ static void snd_emu10k1_midi_interrupt2(struct snd_emu10k1 *emu, unsigned int st
        do_emu10k1_midi_interrupt(emu, &emu->midi2, status);
 }
 
-static void snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_midi *midi, unsigned char cmd, int ack)
+static int snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_midi *midi, unsigned char cmd, int ack)
 {
        unsigned long flags;
        int timeout, ok;
@@ -141,11 +141,14 @@ static void snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_mi
                ok = 1;
        }
        spin_unlock_irqrestore(&midi->input_lock, flags);
-       if (!ok)
+       if (!ok) {
                snd_printk(KERN_ERR "midi_cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)!!!\n",
                           cmd, emu->port,
                           mpu401_read_stat(emu, midi),
                           mpu401_read_data(emu, midi));
+               return 1;
+       }
+       return 0;
 }
 
 static int snd_emu10k1_midi_input_open(struct snd_rawmidi_substream *substream)
@@ -161,12 +164,17 @@ static int snd_emu10k1_midi_input_open(struct snd_rawmidi_substream *substream)
        midi->substream_input = substream;
        if (!(midi->midi_mode & EMU10K1_MIDI_MODE_OUTPUT)) {
                spin_unlock_irqrestore(&midi->open_lock, flags);
-               snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1);
-               snd_emu10k1_midi_cmd(emu, midi, MPU401_ENTER_UART, 1);
+               if (snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1))
+                       goto error_out;
+               if (snd_emu10k1_midi_cmd(emu, midi, MPU401_ENTER_UART, 1))
+                       goto error_out;
        } else {
                spin_unlock_irqrestore(&midi->open_lock, flags);
        }
        return 0;
+
+error_out:
+       return -EIO;
 }
 
 static int snd_emu10k1_midi_output_open(struct snd_rawmidi_substream *substream)
@@ -182,12 +190,17 @@ static int snd_emu10k1_midi_output_open(struct snd_rawmidi_substream *substream)
        midi->substream_output = substream;
        if (!(midi->midi_mode & EMU10K1_MIDI_MODE_INPUT)) {
                spin_unlock_irqrestore(&midi->open_lock, flags);
-               snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1);
-               snd_emu10k1_midi_cmd(emu, midi, MPU401_ENTER_UART, 1);
+               if (snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1))
+                       goto error_out;
+               if (snd_emu10k1_midi_cmd(emu, midi, MPU401_ENTER_UART, 1))
+                       goto error_out;
        } else {
                spin_unlock_irqrestore(&midi->open_lock, flags);
        }
        return 0;
+
+error_out:
+       return -EIO;
 }
 
 static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream)
@@ -195,6 +208,7 @@ static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream)
        struct snd_emu10k1 *emu;
        struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
        unsigned long flags;
+       int err = 0;
 
        emu = midi->emu;
        snd_assert(emu, return -ENXIO);
@@ -204,11 +218,11 @@ static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream)
        midi->substream_input = NULL;
        if (!(midi->midi_mode & EMU10K1_MIDI_MODE_OUTPUT)) {
                spin_unlock_irqrestore(&midi->open_lock, flags);
-               snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0);
+               err = snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0);
        } else {
                spin_unlock_irqrestore(&midi->open_lock, flags);
        }
-       return 0;
+       return err;
 }
 
 static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream)
@@ -216,6 +230,7 @@ static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream
        struct snd_emu10k1 *emu;
        struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
        unsigned long flags;
+       int err = 0;
 
        emu = midi->emu;
        snd_assert(emu, return -ENXIO);
@@ -225,11 +240,11 @@ static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream
        midi->substream_output = NULL;
        if (!(midi->midi_mode & EMU10K1_MIDI_MODE_INPUT)) {
                spin_unlock_irqrestore(&midi->open_lock, flags);
-               snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0);
+               err = snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0);
        } else {
                spin_unlock_irqrestore(&midi->open_lock, flags);
        }
-       return 0;
+       return err;
 }
 
 static void snd_emu10k1_midi_input_trigger(struct snd_rawmidi_substream *substream, int up)
index 7a985c868007ade18693cfaee3a8eaaae266b752..a8a601fc781f9ca44b10a036ae9a3d48bb550487 100644 (file)
@@ -446,7 +446,7 @@ struct ensoniq {
 
 static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
-static struct pci_device_id snd_audiopci_ids[] __devinitdata = {
+static struct pci_device_id snd_audiopci_ids[] = {
 #ifdef CHIP1370
        { 0x1274, 0x5000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },   /* ES1370 */
 #endif
index 1113b10259cf196e7a8341b3f14dec0fc1b9a714..cc0f34f68185d16f568caf4e3a24c69f08e5d5dd 100644 (file)
@@ -242,7 +242,7 @@ struct es1938 {
 
 static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
-static struct pci_device_id snd_es1938_ids[] __devinitdata = {
+static struct pci_device_id snd_es1938_ids[] = {
         { 0x125d, 0x1969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },   /* Solo-1 */
        { 0, }
 };
index a491c8f8a6a880346fd0bf1011a54b2ba64bb249..3c5ab7c2e72df73deb2ad544958e4e06acbe5711 100644 (file)
@@ -592,7 +592,7 @@ struct es1968 {
 
 static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
-static struct pci_device_id snd_es1968_ids[] __devinitdata = {
+static struct pci_device_id snd_es1968_ids[] = {
        /* Maestro 1 */
         { 0x1285, 0x0100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, TYPE_MAESTRO },
        /* Maestro 2 */
index 3aed27eace2c74e2e90fd1edeb4ec30327bacce2..13868c9851268cd5c983754b6d40cc64d5ef4554 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <asm/io.h>
 
-#if (defined(CONFIG_SND_FM801_TEA575X) || defined(CONFIG_SND_FM801_TEA575X_MODULE)) && (defined(CONFIG_VIDEO_DEV) || defined(CONFIG_VIDEO_DEV_MODULE))
+#ifdef CONFIG_SND_FM801_TEA575X_BOOL
 #include <sound/tea575x-tuner.h>
 #define TEA575X_RADIO 1
 #endif
@@ -199,7 +199,7 @@ struct fm801 {
 #endif
 };
 
-static struct pci_device_id snd_fm801_ids[] __devinitdata = {
+static struct pci_device_id snd_fm801_ids[] = {
        { 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, },   /* FM801 */
        { 0x5213, 0x0510, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0, },   /* Gallant Odyssey Sound 4 */
        { 0, }
index 025af7c0c6e1439e9fa9125e92e316bd6caa5cf5..79d63c99f09245d58a5f339d262cb24d68718e73 100644 (file)
@@ -1629,7 +1629,7 @@ static void __devexit azx_remove(struct pci_dev *pci)
 }
 
 /* PCI IDs */
-static struct pci_device_id azx_ids[] __devinitdata = {
+static struct pci_device_id azx_ids[] = {
        { 0x8086, 0x2668, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH6 */
        { 0x8086, 0x27d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH7 */
        { 0x8086, 0x269a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ESB2 */
index 33b7d580646923f91a3892b8803cfa585ff2846e..6823f2bc10b3b6a49fa443a7fdaeb4bd25f4dd2b 100644 (file)
@@ -1545,6 +1545,9 @@ enum {
 /* reivision id to check workarounds */
 #define AD1988A_REV2           0x100200
 
+#define is_rev2(codec) \
+       ((codec)->vendor_id == 0x11d41988 && \
+        (codec)->revision_id == AD1988A_REV2)
 
 /*
  * mixers
@@ -1636,6 +1639,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers1[] = {
        HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT),
        HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x05, 2, 0x0, HDA_OUTPUT),
        HDA_CODEC_VOLUME("Side Playback Volume", 0x0a, 0x0, HDA_OUTPUT),
+       { } /* end */
 };
 
 static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = {
@@ -1644,6 +1648,7 @@ static struct snd_kcontrol_new ad1988_6stack_mixers1_rev2[] = {
        HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0a, 1, 0x0, HDA_OUTPUT),
        HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0a, 2, 0x0, HDA_OUTPUT),
        HDA_CODEC_VOLUME("Side Playback Volume", 0x06, 0x0, HDA_OUTPUT),
+       { } /* end */
 };
 
 static struct snd_kcontrol_new ad1988_6stack_mixers2[] = {
@@ -1682,6 +1687,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers1[] = {
        HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT),
        HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x05, 1, 0x0, HDA_OUTPUT),
        HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x05, 2, 0x0, HDA_OUTPUT),
+       { } /* end */
 };
 
 static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = {
@@ -1689,6 +1695,7 @@ static struct snd_kcontrol_new ad1988_3stack_mixers1_rev2[] = {
        HDA_CODEC_VOLUME("Surround Playback Volume", 0x0a, 0x0, HDA_OUTPUT),
        HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x06, 1, 0x0, HDA_OUTPUT),
        HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x06, 2, 0x0, HDA_OUTPUT),
+       { } /* end */
 };
 
 static struct snd_kcontrol_new ad1988_3stack_mixers2[] = {
@@ -2195,7 +2202,7 @@ static inline hda_nid_t ad1988_idx_to_dac(struct hda_codec *codec, int idx)
                /* A     B     C     D     E     F     G     H */
                0x04, 0x05, 0x0a, 0x04, 0x06, 0x05, 0x0a, 0x06
        };
-       if (codec->revision_id == AD1988A_REV2)
+       if (is_rev2(codec))
                return idx_to_dac_rev2[idx];
        else
                return idx_to_dac[idx];
@@ -2564,7 +2571,7 @@ static int patch_ad1988(struct hda_codec *codec)
        mutex_init(&spec->amp_mutex);
        codec->spec = spec;
 
-       if (codec->revision_id == AD1988A_REV2)
+       if (is_rev2(codec))
                snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n");
 
        board_config = snd_hda_check_board_config(codec, ad1988_cfg_tbl);
@@ -2590,13 +2597,13 @@ static int patch_ad1988(struct hda_codec *codec)
        case AD1988_6STACK_DIG:
                spec->multiout.max_channels = 8;
                spec->multiout.num_dacs = 4;
-               if (codec->revision_id == AD1988A_REV2)
+               if (is_rev2(codec))
                        spec->multiout.dac_nids = ad1988_6stack_dac_nids_rev2;
                else
                        spec->multiout.dac_nids = ad1988_6stack_dac_nids;
                spec->input_mux = &ad1988_6stack_capture_source;
                spec->num_mixers = 2;
-               if (codec->revision_id == AD1988A_REV2)
+               if (is_rev2(codec))
                        spec->mixers[0] = ad1988_6stack_mixers1_rev2;
                else
                        spec->mixers[0] = ad1988_6stack_mixers1;
@@ -2612,7 +2619,7 @@ static int patch_ad1988(struct hda_codec *codec)
        case AD1988_3STACK_DIG:
                spec->multiout.max_channels = 6;
                spec->multiout.num_dacs = 3;
-               if (codec->revision_id == AD1988A_REV2)
+               if (is_rev2(codec))
                        spec->multiout.dac_nids = ad1988_3stack_dac_nids_rev2;
                else
                        spec->multiout.dac_nids = ad1988_3stack_dac_nids;
@@ -2620,7 +2627,7 @@ static int patch_ad1988(struct hda_codec *codec)
                spec->channel_mode = ad1988_3stack_modes;
                spec->num_channel_mode = ARRAY_SIZE(ad1988_3stack_modes);
                spec->num_mixers = 2;
-               if (codec->revision_id == AD1988A_REV2)
+               if (is_rev2(codec))
                        spec->mixers[0] = ad1988_3stack_mixers1_rev2;
                else
                        spec->mixers[0] = ad1988_3stack_mixers1;
index ca74f5b85f42070dd611967e5ae3b01034058a7f..9492f3d2455b4aee6d6d6f8b84c02ec239e95582 100644 (file)
@@ -2131,7 +2131,7 @@ struct snd_ice1712_card_info snd_vt1724_aureon_cards[] __devinitdata = {
                .build_controls = aureon_add_controls,
                .eeprom_size = sizeof(aureon71_eeprom),
                .eeprom_data = aureon71_eeprom,
-               .driver = "Aureon71Universe",
+               .driver = "Aureon71Univ", /* keep in 15 letters */
        },
        {
                .subvendor = VT1724_SUBDEVICE_PRODIGY71,
index 89a06dec436529cb2a6bfd7ab25aa2aa8050bcf1..bf20858d9f193b92db0c84b91c2d3abf1c15e9b8 100644 (file)
@@ -106,7 +106,7 @@ module_param_array(dxr_enable, int, NULL, 0444);
 MODULE_PARM_DESC(dxr_enable, "Enable DXR support for Terratec DMX6FIRE.");
 
 
-static struct pci_device_id snd_ice1712_ids[] __devinitdata = {
+static struct pci_device_id snd_ice1712_ids[] = {
        { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_ICE_1712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },   /* ICE1712 */
        { 0, }
 };
index ad69ed7c1b814230c6e019368b657a537c173763..71d6aedc07496c4de7ddd68907b804036f37e440 100644 (file)
@@ -86,7 +86,7 @@ MODULE_PARM_DESC(model, "Use the given board model.");
 
 
 /* Both VT1720 and VT1724 have the same PCI IDs */
-static struct pci_device_id snd_vt1724_ids[] __devinitdata = {
+static struct pci_device_id snd_vt1724_ids[] = {
        { PCI_VENDOR_ID_ICE, PCI_DEVICE_ID_VT1724, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
        { 0, }
 };
index 5634bc349257021d83cc2aefed9ccb740256e55a..6874263f1681f0dd01475ee8871b363e9a0713e4 100644 (file)
@@ -413,7 +413,7 @@ struct intel8x0 {
        u32 int_sta_mask;               /* interrupt status mask */
 };
 
-static struct pci_device_id snd_intel8x0_ids[] __devinitdata = {
+static struct pci_device_id snd_intel8x0_ids[] = {
        { 0x8086, 0x2415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */
        { 0x8086, 0x2425, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */
        { 0x8086, 0x2445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */
@@ -1955,6 +1955,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
                .name = "AMD64 Mobo",   /* ALC650 */
                .type = AC97_TUNE_HP_ONLY
        },
+       {
+               .subvendor = 0x10f1,
+               .subdevice = 0x2895,
+               .name = "Tyan Thunder K8WE",
+               .type = AC97_TUNE_HP_ONLY
+       },
        {
                .subvendor = 0x110a,
                .subdevice = 0x0056,
index f28e273ae276061f8de292f2585ade7d8422cdf7..91850281f89b16a7ad3afa9e8487f9d194f9e9b9 100644 (file)
@@ -224,7 +224,7 @@ struct intel8x0m {
        unsigned int pcm_pos_shift;
 };
 
-static struct pci_device_id snd_intel8x0m_ids[] __devinitdata = {
+static struct pci_device_id snd_intel8x0m_ids[] = {
        { 0x8086, 0x2416, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */
        { 0x8086, 0x2426, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */
        { 0x8086, 0x2446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */
index 2b4ce002794a1bb4eb5f320c0341045eea955aa6..cfea51f447848d10d75d31b92e72cf1bf13d0c37 100644 (file)
@@ -424,7 +424,7 @@ module_param_array(enable, bool, NULL, 0444);
 MODULE_PARM_DESC(enable, "Enable Korg 1212 soundcard.");
 MODULE_AUTHOR("Haroldo Gamal <gamal@alternex.com.br>");
 
-static struct pci_device_id snd_korg1212_ids[] __devinitdata = {
+static struct pci_device_id snd_korg1212_ids[] = {
        {
                .vendor    = 0x10b5,
                .device    = 0x906d,
index 828eab59253a98d5e5d2fe2930f79548c67f6300..45214b3b81bedfc4b2afa70f4b297025f83a5e56 100644 (file)
@@ -869,7 +869,7 @@ struct snd_m3 {
 /*
  * pci ids
  */
-static struct pci_device_id snd_m3_ids[] __devinitdata = {
+static struct pci_device_id snd_m3_ids[] = {
        {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO_1, PCI_ANY_ID, PCI_ANY_ID,
         PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0},
        {PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_ALLEGRO, PCI_ANY_ID, PCI_ANY_ID,
@@ -2137,7 +2137,7 @@ static int __devinit snd_m3_mixer(struct snd_m3 *chip)
  * DSP Code images
  */
 
-static const u16 assp_kernel_image[] __devinitdata = {
+static const u16 assp_kernel_image[] = {
     0x7980, 0x0030, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x00FB, 0x7980, 0x00DD, 0x7980, 0x03B4, 
     0x7980, 0x0332, 0x7980, 0x0287, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x03B4, 
     0x7980, 0x031A, 0x7980, 0x03B4, 0x7980, 0x022F, 0x7980, 0x03B4, 0x7980, 0x03B4, 0x7980, 0x03B4, 
@@ -2224,7 +2224,7 @@ static const u16 assp_kernel_image[] __devinitdata = {
  * Mini sample rate converter code image
  * that is to be loaded at 0x400 on the DSP.
  */
-static const u16 assp_minisrc_image[] __devinitdata = {
+static const u16 assp_minisrc_image[] = {
 
     0xBF80, 0x101E, 0x906E, 0x006E, 0x8B88, 0x6980, 0xEF88, 0x906F, 0x0D6F, 0x6900, 0xEB08, 0x0412, 
     0xBC20, 0x696E, 0xB801, 0x906E, 0x7980, 0x0403, 0xB90E, 0x8807, 0xBE43, 0xBF01, 0xBE47, 0xBE41, 
@@ -2267,12 +2267,12 @@ static const u16 assp_minisrc_image[] __devinitdata = {
  */
 
 #define MINISRC_LPF_LEN 10
-static const u16 minisrc_lpf[MINISRC_LPF_LEN] __devinitdata = {
+static const u16 minisrc_lpf[MINISRC_LPF_LEN] = {
        0X0743, 0X1104, 0X0A4C, 0XF88D, 0X242C,
        0X1023, 0X1AA9, 0X0B60, 0XEFDD, 0X186F
 };
 
-static void __devinit snd_m3_assp_init(struct snd_m3 *chip)
+static void snd_m3_assp_init(struct snd_m3 *chip)
 {
        unsigned int i;
 
index a4aaa7b9a231d0de96551af5f33b359b69be91cc..cc43ecd679061686aa2ed20fbc89f5dc571baecb 100644 (file)
@@ -61,7 +61,7 @@ MODULE_PARM_DESC(enable, "Enable Digigram " CARD_NAME " soundcard.");
 /*
  */
 
-static struct pci_device_id snd_mixart_ids[] __devinitdata = {
+static struct pci_device_id snd_mixart_ids[] = {
        { 0x1057, 0x0003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* MC8240 */
        { 0, }
 };
index 56d7282e66512e9a7bb05072fe20494fe2088b45..101eee0aa018a3152777b82ae43ea56c33a988a2 100644 (file)
@@ -263,7 +263,7 @@ struct nm256 {
 /*
  * PCI ids
  */
-static struct pci_device_id snd_nm256_ids[] __devinitdata = {
+static struct pci_device_id snd_nm256_ids[] = {
        {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        {PCI_VENDOR_ID_NEOMAGIC, PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
index ae980e11827f4154ebdc8c962bcacb6e45827204..533c672ae8f3fd395b4d96b0c0041917b5654d71 100644 (file)
@@ -73,7 +73,7 @@ enum {
        PCI_ID_LAST
 };
 
-static struct pci_device_id pcxhr_ids[] __devinitdata = {
+static struct pci_device_id pcxhr_ids[] = {
        { 0x10b5, 0x9656, 0x1369, 0xb001, 0, 0, PCI_ID_VX882HR, },   /* VX882HR */
        { 0x10b5, 0x9656, 0x1369, 0xb101, 0, 0, PCI_ID_PCX882HR, },  /* PCX882HR */
        { 0x10b5, 0x9656, 0x1369, 0xb201, 0, 0, PCI_ID_VX881HR, },   /* VX881HR */
index 5501a08ca23a3443ccd31c270c5aba905dfb0a8b..f435fcd6dca99b7922a4c44a139b6551b4965bb6 100644 (file)
@@ -506,7 +506,7 @@ static int riptide_reset(struct cmdif *cif, struct snd_riptide *chip);
 /*
  */
 
-static struct pci_device_id snd_riptide_ids[] __devinitdata = {
+static struct pci_device_id snd_riptide_ids[] = {
        {
         .vendor = 0x127a,.device = 0x4310,
         .subvendor = PCI_ANY_ID,.subdevice = PCI_ANY_ID,
index 2e24b68d07aa47f4cf33d4522c0e48f2c240b79c..2a71499242fa6f626cb6b3bb30bffcfbe0aaf87c 100644 (file)
@@ -227,7 +227,7 @@ struct rme32 {
        struct snd_kcontrol *spdif_ctl;
 };
 
-static struct pci_device_id snd_rme32_ids[] __devinitdata = {
+static struct pci_device_id snd_rme32_ids[] = {
        {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32,
         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,},
        {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_8,
index fde0f3e205304e1f3cc89c4420f89f607a371529..f8de7c9970179d52bfb22b64753e0904efb73179 100644 (file)
@@ -232,7 +232,7 @@ struct rme96 {
        struct snd_kcontrol   *spdif_ctl;
 };
 
-static struct pci_device_id snd_rme96_ids[] __devinitdata = {
+static struct pci_device_id snd_rme96_ids[] = {
        { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96,
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
        { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8,
index 99cf86244acbb17f02ec30bca3e6027490df9fe2..e5a52da77b85d89669cb2cc0c559579e36a9439f 100644 (file)
@@ -568,7 +568,7 @@ static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_d
 }
 
 
-static struct pci_device_id snd_hdsp_ids[] __devinitdata = {
+static struct pci_device_id snd_hdsp_ids[] = {
        {
                .vendor = PCI_VENDOR_ID_XILINX,
                .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP, 
@@ -1356,7 +1356,7 @@ static struct snd_rawmidi_ops snd_hdsp_midi_input =
        .trigger =      snd_hdsp_midi_input_trigger,
 };
 
-static int __devinit snd_hdsp_create_midi (struct snd_card *card, struct hdsp *hdsp, int id)
+static int snd_hdsp_create_midi (struct snd_card *card, struct hdsp *hdsp, int id)
 {
        char buf[32];
 
index 9534e183413881c715d5263f111c25acc4bf8805..fc15f61ad5d19b5ff14398f3a838b8ea650addf3 100644 (file)
@@ -315,7 +315,7 @@ static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_d
 }
 
 
-static struct pci_device_id snd_rme9652_ids[] __devinitdata = {
+static struct pci_device_id snd_rme9652_ids[] = {
        {
                .vendor    = 0x10ee,
                .device    = 0x3fc4,
index c4303418668bae581ab5b832a94d43583bb8ae01..e5d4def1aa6fe095fb874fc79620354ffb3cd2b0 100644 (file)
@@ -243,7 +243,7 @@ struct sonicvibes {
 #endif
 };
 
-static struct pci_device_id snd_sonic_ids[] __devinitdata = {
+static struct pci_device_id snd_sonic_ids[] = {
        { 0x5333, 0xca00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
         { 0, }
 };
index 5629b7eba96d3845f2aa05a9ff7bc22db78d4fa9..9145f7c57fb0389cd81a219135351de779ba2aac 100644 (file)
@@ -63,7 +63,7 @@ MODULE_PARM_DESC(pcm_channels, "Number of hardware channels assigned for PCM.");
 module_param_array(wavetable_size, int, NULL, 0444);
 MODULE_PARM_DESC(wavetable_size, "Maximum memory size in kB for wavetable synth.");
 
-static struct pci_device_id snd_trident_ids[] __devinitdata = {
+static struct pci_device_id snd_trident_ids[] = {
        {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX), 
                PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0},
        {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX), 
index 37bd5eb7a380d8deb10851c374adc15cf437f1d2..08da9234efb38e9981c3183536403dc74f0a3058 100644 (file)
@@ -396,7 +396,7 @@ struct via82xx {
 #endif
 };
 
-static struct pci_device_id snd_via82xx_ids[] __devinitdata = {
+static struct pci_device_id snd_via82xx_ids[] = {
        /* 0x1106, 0x3058 */
        { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA686, },     /* 686A */
        /* 0x1106, 0x3059 */
index c1ede6c2a6d485369530d0f5a9eb226bd137e427..016f9dac253f13d2b4d016ec07f7d4308f3dae69 100644 (file)
@@ -261,7 +261,7 @@ struct via82xx_modem {
        struct snd_info_entry *proc_entry;
 };
 
-static struct pci_device_id snd_via82xx_modem_ids[] __devinitdata = {
+static struct pci_device_id snd_via82xx_modem_ids[] = {
        { 0x1106, 0x3068, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA82XX_MODEM, },
        { 0, }
 };
index 7deda25f7adc8499125a78aadf7e03541451ff56..9c03c6b4e49009f8f93b3cf8ffb7f35d51c3a189 100644 (file)
@@ -60,7 +60,7 @@ enum {
        VX_PCI_VX222_NEW
 };
 
-static struct pci_device_id snd_vx222_ids[] __devinitdata = {
+static struct pci_device_id snd_vx222_ids[] = {
        { 0x10b5, 0x9050, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_OLD, },   /* PLX */
        { 0x10b5, 0x9030, 0x1369, PCI_ANY_ID, 0, 0, VX_PCI_VX222_NEW, },   /* PLX */
        { 0, }
index 26aa775b7b69d17cddc05bd852fa350d4256fd7d..186453f7abe700a818df68f32d1a9b73bb055798 100644 (file)
@@ -70,7 +70,7 @@ MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch");
 module_param_array(rear_swap, bool, NULL, 0444);
 MODULE_PARM_DESC(rear_swap, "Swap rear channels (must be enabled for correct IEC958 (S/PDIF)) output");
 
-static struct pci_device_id snd_ymfpci_ids[] __devinitdata = {
+static struct pci_device_id snd_ymfpci_ids[] = {
         { 0x1073, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },   /* YMF724 */
         { 0x1073, 0x000d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },   /* YMF724F */
         { 0x1073, 0x000a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },   /* YMF740 */
index adfdce7499d1c40418e05b025de9bf4f6ef32b93..1c09e5f49da8b3e1accf94cccfe8ae08259fc30f 100644 (file)
@@ -241,12 +241,13 @@ static int pdacf_config(struct pcmcia_device *link)
        CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse));
        link->conf.ConfigBase = parse->config.base;
        link->conf.ConfigIndex = 0x5;
-       kfree(parse);
 
        CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
        CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
        CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
 
+       kfree(parse);
+
        if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
                goto failed;
 
@@ -254,6 +255,7 @@ static int pdacf_config(struct pcmcia_device *link)
        return 0;
 
 cs_failed:
+       kfree(parse);
        cs_error(link, last_fn, last_ret);
 failed:
        pcmcia_disable_device(link);