aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-10-20 00:26:44 -0400
committerSteve French <sfrench@us.ibm.com>2007-10-20 00:26:44 -0400
commit748c5151deb56e4b7b5a9b07a884243764933831 (patch)
treee9dd45b8806d00b56503cfa55c46f3ebce0d151c /drivers
parent4879b44829d94a1f8facf90cced3c5f23c5a8c62 (diff)
parente8b8c977734193adedf2b0f607d6252c78e86394 (diff)
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/Kconfig2
-rw-r--r--drivers/acpi/processor_core.c8
-rw-r--r--drivers/ata/ahci.c2
-rw-r--r--drivers/ata/libata-core.c2
-rw-r--r--drivers/ata/libata-sff.c2
-rw-r--r--drivers/ata/pata_cmd64x.c2
-rw-r--r--drivers/ata/pata_cs5530.c2
-rw-r--r--drivers/ata/pata_cs5535.c2
-rw-r--r--drivers/ata/pata_cs5536.c4
-rw-r--r--drivers/ata/pata_it821x.c4
-rw-r--r--drivers/ata/pata_mpiix.c2
-rw-r--r--drivers/ata/pata_ns87410.c2
-rw-r--r--drivers/ata/pata_oldpiix.c2
-rw-r--r--drivers/ata/pata_radisys.c2
-rw-r--r--drivers/ata/pata_sc1200.c2
-rw-r--r--drivers/ata/pata_sil680.c2
-rw-r--r--drivers/ata/pata_via.c2
-rw-r--r--drivers/ata/sata_sis.c15
-rw-r--r--drivers/atm/firestream.c2
-rw-r--r--drivers/block/Kconfig21
-rw-r--r--drivers/block/loop.c2
-rw-r--r--drivers/block/nbd.c1
-rw-r--r--drivers/block/rd.c2
-rw-r--r--drivers/char/cyclades.c4
-rw-r--r--drivers/char/drm/drm_hashtab.c2
-rw-r--r--drivers/char/drm/drm_hashtab.h2
-rw-r--r--drivers/char/drm/drm_mm.c2
-rw-r--r--drivers/char/drm/drm_pci.c4
-rw-r--r--drivers/char/drm/drm_sarea.h2
-rw-r--r--drivers/char/drm/drm_sman.c2
-rw-r--r--drivers/char/drm/drm_sman.h2
-rw-r--r--drivers/char/drm/r128_drv.h2
-rw-r--r--drivers/char/drm/radeon_irq.c2
-rw-r--r--drivers/char/drm/radeon_state.c2
-rw-r--r--drivers/char/drm/sis_mm.c2
-rw-r--r--drivers/char/drm/via_mm.c2
-rw-r--r--drivers/char/drm/via_verifier.h2
-rw-r--r--drivers/char/esp.c2
-rw-r--r--drivers/char/hw_random/omap-rng.c2
-rw-r--r--drivers/char/i8k.c14
-rw-r--r--drivers/char/n_tty.c4
-rw-r--r--drivers/char/rocket.c2
-rw-r--r--drivers/char/sonypi.c2
-rw-r--r--drivers/char/tty_io.c8
-rw-r--r--drivers/char/tty_ioctl.c2
-rw-r--r--drivers/firewire/fw-transaction.c2
-rw-r--r--drivers/hid/usbhid/hid-ff.c2
-rw-r--r--drivers/hwmon/coretemp.c6
-rw-r--r--drivers/hwmon/gl520sm.c4
-rw-r--r--drivers/hwmon/hwmon-vid.c2
-rw-r--r--drivers/hwmon/sis5595.c2
-rw-r--r--drivers/hwmon/via686a.c4
-rw-r--r--drivers/i2c/algos/i2c-algo-bit.c2
-rw-r--r--drivers/i2c/algos/i2c-algo-pca.c2
-rw-r--r--drivers/i2c/algos/i2c-algo-pcf.c2
-rw-r--r--drivers/i2c/busses/Kconfig10
-rw-r--r--drivers/i2c/busses/i2c-elektor.c2
-rw-r--r--drivers/i2c/busses/i2c-hydra.c2
-rw-r--r--drivers/i2c/busses/i2c-ibm_iic.c2
-rw-r--r--drivers/i2c/busses/i2c-omap.c2
-rw-r--r--drivers/i2c/busses/i2c-parport-light.c2
-rw-r--r--drivers/i2c/busses/i2c-parport.c2
-rw-r--r--drivers/i2c/busses/i2c-via.c4
-rw-r--r--drivers/i2c/busses/i2c-viapro.c2
-rw-r--r--drivers/i2c/i2c-core.c2
-rw-r--r--drivers/ide/Kconfig3
-rw-r--r--drivers/ide/arm/bast-ide.c2
-rw-r--r--drivers/ide/arm/icside.c62
-rw-r--r--drivers/ide/arm/ide_arm.c2
-rw-r--r--drivers/ide/arm/rapide.c37
-rw-r--r--drivers/ide/cris/ide-cris.c2
-rw-r--r--drivers/ide/h8300/ide-h8300.c3
-rw-r--r--drivers/ide/ide-acpi.c2
-rw-r--r--drivers/ide/ide-cd.c6
-rw-r--r--drivers/ide/ide-disk.c24
-rw-r--r--drivers/ide/ide-dma.c32
-rw-r--r--drivers/ide/ide-io.c59
-rw-r--r--drivers/ide/ide-iops.c26
-rw-r--r--drivers/ide/ide-pnp.c3
-rw-r--r--drivers/ide/ide-probe.c87
-rw-r--r--drivers/ide/ide-proc.c2
-rw-r--r--drivers/ide/ide-tape.c3
-rw-r--r--drivers/ide/ide-taskfile.c37
-rw-r--r--drivers/ide/ide.c73
-rw-r--r--drivers/ide/legacy/ali14xx.c13
-rw-r--r--drivers/ide/legacy/buddha.c4
-rw-r--r--drivers/ide/legacy/dtc2278.c16
-rw-r--r--drivers/ide/legacy/falconide.c2
-rw-r--r--drivers/ide/legacy/gayle.c2
-rw-r--r--drivers/ide/legacy/ht6560b.c33
-rw-r--r--drivers/ide/legacy/ide-cs.c2
-rw-r--r--drivers/ide/legacy/ide_platform.c43
-rw-r--r--drivers/ide/legacy/macide.c6
-rw-r--r--drivers/ide/legacy/q40ide.c7
-rw-r--r--drivers/ide/legacy/qd65xx.c64
-rw-r--r--drivers/ide/legacy/umc8672.c9
-rw-r--r--drivers/ide/mips/au1xxx-ide.c19
-rw-r--r--drivers/ide/mips/swarm.c14
-rw-r--r--drivers/ide/pci/aec62xx.c25
-rw-r--r--drivers/ide/pci/alim15x3.c109
-rw-r--r--drivers/ide/pci/amd74xx.c29
-rw-r--r--drivers/ide/pci/atiixp.c3
-rw-r--r--drivers/ide/pci/cmd640.c42
-rw-r--r--drivers/ide/pci/cmd64x.c6
-rw-r--r--drivers/ide/pci/cs5520.c26
-rw-r--r--drivers/ide/pci/cs5530.c10
-rw-r--r--drivers/ide/pci/cs5535.c2
-rw-r--r--drivers/ide/pci/cy82c693.c4
-rw-r--r--drivers/ide/pci/delkin_cb.c2
-rw-r--r--drivers/ide/pci/generic.c31
-rw-r--r--drivers/ide/pci/hpt34x.c4
-rw-r--r--drivers/ide/pci/hpt366.c4
-rw-r--r--drivers/ide/pci/it8213.c2
-rw-r--r--drivers/ide/pci/it821x.c6
-rw-r--r--drivers/ide/pci/jmicron.c2
-rw-r--r--drivers/ide/pci/ns87415.c2
-rw-r--r--drivers/ide/pci/opti621.c10
-rw-r--r--drivers/ide/pci/pdc202xx_new.c4
-rw-r--r--drivers/ide/pci/pdc202xx_old.c22
-rw-r--r--drivers/ide/pci/piix.c6
-rw-r--r--drivers/ide/pci/rz1000.c7
-rw-r--r--drivers/ide/pci/sc1200.c2
-rw-r--r--drivers/ide/pci/scc_pata.c11
-rw-r--r--drivers/ide/pci/serverworks.c11
-rw-r--r--drivers/ide/pci/sgiioc4.c16
-rw-r--r--drivers/ide/pci/siimage.c94
-rw-r--r--drivers/ide/pci/sis5513.c4
-rw-r--r--drivers/ide/pci/sl82c105.c14
-rw-r--r--drivers/ide/pci/slc90e66.c10
-rw-r--r--drivers/ide/pci/tc86c001.c2
-rw-r--r--drivers/ide/pci/triflex.c2
-rw-r--r--drivers/ide/pci/trm290.c4
-rw-r--r--drivers/ide/pci/via82cxxx.c81
-rw-r--r--drivers/ide/ppc/mpc8xx.c4
-rw-r--r--drivers/ide/ppc/pmac.c12
-rw-r--r--drivers/ide/setup-pci.c202
-rw-r--r--drivers/input/fixp-arith.h2
-rw-r--r--drivers/input/gameport/gameport.c3
-rw-r--r--drivers/input/joystick/db9.c2
-rw-r--r--drivers/input/joystick/iforce/Makefile2
-rw-r--r--drivers/input/keyboard/omap-keypad.c4
-rw-r--r--drivers/input/misc/Kconfig4
-rw-r--r--drivers/input/mouse/psmouse-base.c2
-rw-r--r--drivers/input/mouse/vsxxxaa.c2
-rw-r--r--drivers/isdn/act2000/act2000_isa.c2
-rw-r--r--drivers/isdn/hardware/eicon/capifunc.c4
-rw-r--r--drivers/isdn/hisax/amd7930_fn.c2
-rw-r--r--drivers/isdn/hisax/enternow_pci.c18
-rw-r--r--drivers/isdn/hisax/hfc_pci.c2
-rw-r--r--drivers/isdn/hisax/isdnhdlc.c4
-rw-r--r--drivers/isdn/hisax/isdnhdlc.h2
-rw-r--r--drivers/isdn/hisax/jade.c2
-rw-r--r--drivers/isdn/pcbit/capi.c4
-rw-r--r--drivers/leds/leds-s3c24xx.c2
-rw-r--r--drivers/macintosh/mediabay.c2
-rw-r--r--drivers/macintosh/via-pmu.c2
-rw-r--r--drivers/md/Kconfig12
-rw-r--r--drivers/md/Makefile6
-rw-r--r--drivers/md/dm-bio-list.h5
-rw-r--r--drivers/md/dm-crypt.c172
-rw-r--r--drivers/md/dm-delay.c23
-rw-r--r--drivers/md/dm-emc.c8
-rw-r--r--drivers/md/dm-hw-handler.c6
-rw-r--r--drivers/md/dm-hw-handler.h1
-rw-r--r--drivers/md/dm-ioctl.c40
-rw-r--r--drivers/md/dm-log.c2
-rw-r--r--drivers/md/dm-log.h3
-rw-r--r--drivers/md/dm-mpath-hp-sw.c248
-rw-r--r--drivers/md/dm-mpath-rdac.c15
-rw-r--r--drivers/md/dm-mpath.c88
-rw-r--r--drivers/md/dm-path-selector.c6
-rw-r--r--drivers/md/dm-raid1.c35
-rw-r--r--drivers/md/dm-snap.c3
-rw-r--r--drivers/md/dm-stripe.c3
-rw-r--r--drivers/md/dm-table.c3
-rw-r--r--drivers/md/dm-target.c6
-rw-r--r--drivers/md/dm-uevent.c222
-rw-r--r--drivers/md/dm-uevent.h59
-rw-r--r--drivers/md/dm.c79
-rw-r--r--drivers/md/kcopyd.c8
-rw-r--r--drivers/md/raid1.c2
-rw-r--r--drivers/media/common/saa7146_hlp.c2
-rw-r--r--drivers/media/dvb/bt8xx/bt878.c2
-rw-r--r--drivers/media/dvb/cinergyT2/cinergyT2.c2
-rw-r--r--drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c2
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c26
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c2
-rw-r--r--drivers/media/video/meye.c2
-rw-r--r--drivers/media/video/meye.h2
-rw-r--r--drivers/media/video/saa5246a.c4
-rw-r--r--drivers/media/video/saa5249.c4
-rw-r--r--drivers/media/video/usbvideo/vicam.c2
-rw-r--r--drivers/media/video/v4l2-common.c2
-rw-r--r--drivers/message/i2o/README4
-rw-r--r--drivers/message/i2o/exec-osm.c4
-rw-r--r--drivers/message/i2o/i2o_config.c6
-rw-r--r--drivers/message/i2o/i2o_proc.c4
-rw-r--r--drivers/message/i2o/iop.c4
-rw-r--r--drivers/message/i2o/pci.c4
-rw-r--r--drivers/mfd/Kconfig4
-rw-r--r--drivers/misc/Kconfig4
-rw-r--r--drivers/misc/ibmasm/remote.c2
-rw-r--r--drivers/misc/sony-laptop.c4
-rw-r--r--drivers/mtd/maps/Kconfig10
-rw-r--r--drivers/net/8139too.c2
-rw-r--r--drivers/net/Kconfig43
-rw-r--r--drivers/net/amd8111e.c2
-rw-r--r--drivers/net/ariadne.c2
-rw-r--r--drivers/net/ariadne.h2
-rw-r--r--drivers/net/au1000_eth.c2
-rw-r--r--drivers/net/bonding/bond_sysfs.c2
-rw-r--r--drivers/net/dm9000.c6
-rw-r--r--drivers/net/e100.c2
-rw-r--r--drivers/net/e1000/e1000_main.c2
-rw-r--r--drivers/net/fealnx.c1
-rw-r--r--drivers/net/hamradio/6pack.c2
-rw-r--r--drivers/net/hamradio/Kconfig2
-rw-r--r--drivers/net/irda/actisys-sir.c2
-rw-r--r--drivers/net/irda/actisys.c2
-rw-r--r--drivers/net/irda/donauboe.c2
-rw-r--r--drivers/net/irda/girbil-sir.c2
-rw-r--r--drivers/net/irda/girbil.c2
-rw-r--r--drivers/net/irda/irport.h2
-rw-r--r--drivers/net/irda/irtty-sir.c2
-rw-r--r--drivers/net/irda/nsc-ircc.c2
-rw-r--r--drivers/net/irda/nsc-ircc.h2
-rw-r--r--drivers/net/irda/tekram-sir.c2
-rw-r--r--drivers/net/irda/tekram.c2
-rw-r--r--drivers/net/irda/w83977af_ir.h2
-rw-r--r--drivers/net/natsemi.c2
-rw-r--r--drivers/net/phy/mdio-bitbang.c2
-rw-r--r--drivers/net/smc911x.c2
-rw-r--r--drivers/net/spider_net.c2
-rw-r--r--drivers/net/tc35815.c4
-rw-r--r--drivers/net/tsi108_eth.c2
-rw-r--r--drivers/net/tulip/Kconfig14
-rw-r--r--drivers/net/tulip/winbond-840.c2
-rw-r--r--drivers/net/usb/Kconfig2
-rw-r--r--drivers/net/via-velocity.c2
-rw-r--r--drivers/net/wireless/b43/main.c5
-rw-r--r--drivers/net/wireless/b43legacy/main.c2
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_xmit.h2
-rw-r--r--drivers/net/wireless/ipw2100.c43
-rw-r--r--drivers/net/wireless/ipw2100.h4
-rw-r--r--drivers/net/wireless/ipw2200.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.c13
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c44
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c52
-rw-r--r--drivers/net/wireless/iwlwifi/iwlwifi.h7
-rw-r--r--drivers/net/wireless/netwave_cs.c8
-rw-r--r--drivers/net/wireless/p54common.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c1
-rw-r--r--drivers/net/wireless/rtl8187_dev.c35
-rw-r--r--drivers/net/wireless/zd1201.c4
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.c7
-rw-r--r--drivers/rtc/Kconfig2
-rw-r--r--drivers/s390/block/dasd_3990_erp.c4
-rw-r--r--drivers/s390/char/sclp_cpi.c2
-rw-r--r--drivers/s390/cio/cmf.c2
-rw-r--r--drivers/s390/net/ctcmain.c10
-rw-r--r--drivers/s390/net/qeth_main.c3
-rw-r--r--drivers/scsi/aacraid/aacraid.h2
-rw-r--r--drivers/scsi/aha152x.c6
-rw-r--r--drivers/scsi/aic7xxx/cam.h2
-rw-r--r--drivers/scsi/dc395x.c6
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.c2
-rw-r--r--drivers/scsi/qla4xxx/ql4_init.c2
-rw-r--r--drivers/scsi/sd.c2
-rw-r--r--drivers/scsi/sun3_NCR5380.c2
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_fw2.h2
-rw-r--r--drivers/scsi/wd33c93.h2
-rw-r--r--drivers/serial/Kconfig6
-rw-r--r--drivers/serial/s3c2410.c4
-rw-r--r--drivers/spi/mpc52xx_psc_spi.c2
-rw-r--r--drivers/usb/gadget/lh7a40x_udc.c2
-rw-r--r--drivers/usb/host/ehci-hub.c2
-rw-r--r--drivers/usb/host/sl811-hcd.c2
-rw-r--r--drivers/usb/image/Kconfig2
-rw-r--r--drivers/usb/misc/cytherm.c2
-rw-r--r--drivers/usb/misc/emi26.c4
-rw-r--r--drivers/usb/misc/emi62.c4
-rw-r--r--drivers/usb/serial/ChangeLog.history2
-rw-r--r--drivers/usb/serial/Kconfig2
-rw-r--r--drivers/usb/serial/ftdi_sio.c2
-rw-r--r--drivers/usb/serial/ftdi_sio.h6
-rw-r--r--drivers/usb/serial/ipaq.c4
-rw-r--r--drivers/usb/storage/isd200.c2
-rw-r--r--drivers/usb/storage/unusual_devs.h4
-rw-r--r--drivers/video/Kconfig6
-rw-r--r--drivers/video/amifb.c14
-rw-r--r--drivers/video/aty/atyfb_base.c2
-rw-r--r--drivers/video/console/Kconfig2
-rw-r--r--drivers/video/geode/video_gx.c2
-rw-r--r--drivers/video/intelfb/intelfbdrv.c2
-rw-r--r--drivers/video/intelfb/intelfbhw.c2
-rw-r--r--drivers/video/omap/Kconfig2
-rw-r--r--drivers/video/s3c2410fb.c4
-rw-r--r--drivers/video/vermilion/vermilion.c4
-rw-r--r--drivers/video/vermilion/vermilion.h2
-rw-r--r--drivers/watchdog/i6300esb.c6
-rw-r--r--drivers/watchdog/iTCO_vendor_support.c2
-rw-r--r--drivers/watchdog/w83697hf_wdt.c2
-rw-r--r--drivers/zorro/zorro.ids2
307 files changed, 1976 insertions, 1511 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index b83389145f2..5d0e26a5c34 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -52,7 +52,7 @@ config ACPI_PROCFS
52 depends on PROC_FS 52 depends on PROC_FS
53 ---help--- 53 ---help---
54 For backwards compatibility, this option allows 54 For backwards compatibility, this option allows
55 depricated /proc/acpi/ files to exist, even when 55 deprecated /proc/acpi/ files to exist, even when
56 they have been replaced by functions in /sys. 56 they have been replaced by functions in /sys.
57 The deprecated files (and their replacements) include: 57 The deprecated files (and their replacements) include:
58 58
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index a7351084f2f..235a51e328c 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -422,12 +422,6 @@ static int map_lsapic_id(struct acpi_subtable_header *entry,
422 return 0; 422 return 0;
423} 423}
424 424
425#ifdef CONFIG_IA64
426#define arch_cpu_to_apicid ia64_cpu_to_sapicid
427#else
428#define arch_cpu_to_apicid x86_cpu_to_apicid
429#endif
430
431static int map_madt_entry(u32 acpi_id) 425static int map_madt_entry(u32 acpi_id)
432{ 426{
433 unsigned long madt_end, entry; 427 unsigned long madt_end, entry;
@@ -501,7 +495,7 @@ static int get_cpu_id(acpi_handle handle, u32 acpi_id)
501 return apic_id; 495 return apic_id;
502 496
503 for (i = 0; i < NR_CPUS; ++i) { 497 for (i = 0; i < NR_CPUS; ++i) {
504 if (arch_cpu_to_apicid[i] == apic_id) 498 if (cpu_physical_id(i) == apic_id)
505 return i; 499 return i;
506 } 500 }
507 return -1; 501 return -1;
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 10bc3f64c45..47c80604052 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1479,7 +1479,7 @@ static void ahci_port_intr(struct ata_port *ap)
1479 return; 1479 return;
1480 } 1480 }
1481 1481
1482 /* hmmm... a spurious interupt */ 1482 /* hmmm... a spurious interrupt */
1483 1483
1484 /* if !NCQ, ignore. No modern ATA device has broken HSM 1484 /* if !NCQ, ignore. No modern ATA device has broken HSM
1485 * implementation for non-NCQ commands. 1485 * implementation for non-NCQ commands.
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index bbaa545ea99..629eadbd0ec 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1392,7 +1392,7 @@ static void ata_qc_complete_internal(struct ata_queued_cmd *qc)
1392 * @tf: Taskfile registers for the command and the result 1392 * @tf: Taskfile registers for the command and the result
1393 * @cdb: CDB for packet command 1393 * @cdb: CDB for packet command
1394 * @dma_dir: Data tranfer direction of the command 1394 * @dma_dir: Data tranfer direction of the command
1395 * @sg: sg list for the data buffer of the command 1395 * @sgl: sg list for the data buffer of the command
1396 * @n_elem: Number of sg entries 1396 * @n_elem: Number of sg entries
1397 * @timeout: Timeout in msecs (0 for default) 1397 * @timeout: Timeout in msecs (0 for default)
1398 * 1398 *
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index f9e4cd52794..8227c45109e 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -856,7 +856,7 @@ err_out:
856 * @pdev: PCI device 856 * @pdev: PCI device
857 * 857 *
858 * Some PCI ATA devices report simplex mode but in fact can be told to 858 * Some PCI ATA devices report simplex mode but in fact can be told to
859 * enter non simplex mode. This implements the neccessary logic to 859 * enter non simplex mode. This implements the necessary logic to
860 * perform the task on such devices. Calling it on other devices will 860 * perform the task on such devices. Calling it on other devices will
861 * have -undefined- behaviour. 861 * have -undefined- behaviour.
862 */ 862 */
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c
index 9e412c26b2a..7acbbd9ee46 100644
--- a/drivers/ata/pata_cmd64x.c
+++ b/drivers/ata/pata_cmd64x.c
@@ -215,7 +215,7 @@ static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev)
215 regU &= ~(0x05 << adev->devno); 215 regU &= ~(0x05 << adev->devno);
216 216
217 if (adev->dma_mode >= XFER_UDMA_0) { 217 if (adev->dma_mode >= XFER_UDMA_0) {
218 /* Merge thge timing value */ 218 /* Merge the timing value */
219 regU |= udma_data[adev->dma_mode - XFER_UDMA_0] << shift; 219 regU |= udma_data[adev->dma_mode - XFER_UDMA_0] << shift;
220 /* Merge the control bits */ 220 /* Merge the control bits */
221 regU |= 1 << adev->devno; /* UDMA on */ 221 regU |= 1 << adev->devno; /* UDMA on */
diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c
index 57e827e4109..e1818fdd915 100644
--- a/drivers/ata/pata_cs5530.c
+++ b/drivers/ata/pata_cs5530.c
@@ -138,7 +138,7 @@ static void cs5530_set_dmamode(struct ata_port *ap, struct ata_device *adev)
138 * 138 *
139 * Called when the libata layer is about to issue a command. We wrap 139 * Called when the libata layer is about to issue a command. We wrap
140 * this interface so that we can load the correct ATA timings if 140 * this interface so that we can load the correct ATA timings if
141 * neccessary. Specifically we have a problem that there is only 141 * necessary. Specifically we have a problem that there is only
142 * one MWDMA/UDMA bit. 142 * one MWDMA/UDMA bit.
143 */ 143 */
144 144
diff --git a/drivers/ata/pata_cs5535.c b/drivers/ata/pata_cs5535.c
index 3578593a882..01324530d05 100644
--- a/drivers/ata/pata_cs5535.c
+++ b/drivers/ata/pata_cs5535.c
@@ -25,7 +25,7 @@
25 * Documentation: 25 * Documentation:
26 * Available from AMD web site. 26 * Available from AMD web site.
27 * TODO 27 * TODO
28 * Review errata to see if serializing is neccessary 28 * Review errata to see if serializing is necessary
29 */ 29 */
30 30
31#include <linux/kernel.h> 31#include <linux/kernel.h>
diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c
index 53070f6b1fc..d753e568588 100644
--- a/drivers/ata/pata_cs5536.c
+++ b/drivers/ata/pata_cs5536.c
@@ -40,7 +40,7 @@
40#include <asm/msr.h> 40#include <asm/msr.h>
41 41
42#define DRV_NAME "pata_cs5536" 42#define DRV_NAME "pata_cs5536"
43#define DRV_VERSION "0.0.5" 43#define DRV_VERSION "0.0.6"
44 44
45enum { 45enum {
46 CFG = 0, 46 CFG = 0,
@@ -214,7 +214,7 @@ static void cs5536_set_dmamode(struct ata_port *ap, struct ata_device *adev)
214 cs5536_read(pdev, DTC, &dtc); 214 cs5536_read(pdev, DTC, &dtc);
215 215
216 dtc &= ~(IDE_DRV_MASK << dshift); 216 dtc &= ~(IDE_DRV_MASK << dshift);
217 dtc |= mwdma_timings[mode] << dshift; 217 dtc |= mwdma_timings[mode - XFER_MW_DMA_0] << dshift;
218 218
219 cs5536_write(pdev, DTC, dtc); 219 cs5536_write(pdev, DTC, dtc);
220 } 220 }
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index 988ef736b93..ca9aae09dae 100644
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -105,7 +105,7 @@ struct it821x_dev
105 105
106/* 106/*
107 * We allow users to force the card into non raid mode without 107 * We allow users to force the card into non raid mode without
108 * flashing the alternative BIOS. This is also neccessary right now 108 * flashing the alternative BIOS. This is also necessary right now
109 * for embedded platforms that cannot run a PC BIOS but are using this 109 * for embedded platforms that cannot run a PC BIOS but are using this
110 * device. 110 * device.
111 */ 111 */
@@ -383,7 +383,7 @@ static void it821x_passthru_bmdma_stop(struct ata_queued_cmd *qc)
383 * @ap: ATA port 383 * @ap: ATA port
384 * @device: Device number (not pointer) 384 * @device: Device number (not pointer)
385 * 385 *
386 * Device selection hook. If neccessary perform clock switching 386 * Device selection hook. If necessary perform clock switching
387 */ 387 */
388 388
389static void it821x_passthru_dev_select(struct ata_port *ap, 389static void it821x_passthru_dev_select(struct ata_port *ap,
diff --git a/drivers/ata/pata_mpiix.c b/drivers/ata/pata_mpiix.c
index d5483087a3f..c0d9e0cf208 100644
--- a/drivers/ata/pata_mpiix.c
+++ b/drivers/ata/pata_mpiix.c
@@ -129,7 +129,7 @@ static void mpiix_set_piomode(struct ata_port *ap, struct ata_device *adev)
129 * 129 *
130 * Called when the libata layer is about to issue a command. We wrap 130 * Called when the libata layer is about to issue a command. We wrap
131 * this interface so that we can load the correct ATA timings if 131 * this interface so that we can load the correct ATA timings if
132 * neccessary. Our logic also clears TIME0/TIME1 for the other device so 132 * necessary. Our logic also clears TIME0/TIME1 for the other device so
133 * that, even if we get this wrong, cycles to the other device will 133 * that, even if we get this wrong, cycles to the other device will
134 * be made PIO0. 134 * be made PIO0.
135 */ 135 */
diff --git a/drivers/ata/pata_ns87410.c b/drivers/ata/pata_ns87410.c
index 6e8e55745b7..9fe66fd7501 100644
--- a/drivers/ata/pata_ns87410.c
+++ b/drivers/ata/pata_ns87410.c
@@ -124,7 +124,7 @@ static void ns87410_set_piomode(struct ata_port *ap, struct ata_device *adev)
124 * 124 *
125 * Called when the libata layer is about to issue a command. We wrap 125 * Called when the libata layer is about to issue a command. We wrap
126 * this interface so that we can load the correct ATA timings if 126 * this interface so that we can load the correct ATA timings if
127 * neccessary. 127 * necessary.
128 */ 128 */
129 129
130static unsigned int ns87410_qc_issue_prot(struct ata_queued_cmd *qc) 130static unsigned int ns87410_qc_issue_prot(struct ata_queued_cmd *qc)
diff --git a/drivers/ata/pata_oldpiix.c b/drivers/ata/pata_oldpiix.c
index 3cd5eb2b6c9..44da09ace52 100644
--- a/drivers/ata/pata_oldpiix.c
+++ b/drivers/ata/pata_oldpiix.c
@@ -200,7 +200,7 @@ static void oldpiix_set_dmamode (struct ata_port *ap, struct ata_device *adev)
200 * 200 *
201 * Called when the libata layer is about to issue a command. We wrap 201 * Called when the libata layer is about to issue a command. We wrap
202 * this interface so that we can load the correct ATA timings if 202 * this interface so that we can load the correct ATA timings if
203 * neccessary. Our logic also clears TIME0/TIME1 for the other device so 203 * necessary. Our logic also clears TIME0/TIME1 for the other device so
204 * that, even if we get this wrong, cycles to the other device will 204 * that, even if we get this wrong, cycles to the other device will
205 * be made PIO0. 205 * be made PIO0.
206 */ 206 */
diff --git a/drivers/ata/pata_radisys.c b/drivers/ata/pata_radisys.c
index d5b76497f4a..8109b08fc02 100644
--- a/drivers/ata/pata_radisys.c
+++ b/drivers/ata/pata_radisys.c
@@ -161,7 +161,7 @@ static void radisys_set_dmamode (struct ata_port *ap, struct ata_device *adev)
161 * 161 *
162 * Called when the libata layer is about to issue a command. We wrap 162 * Called when the libata layer is about to issue a command. We wrap
163 * this interface so that we can load the correct ATA timings if 163 * this interface so that we can load the correct ATA timings if
164 * neccessary. Our logic also clears TIME0/TIME1 for the other device so 164 * necessary. Our logic also clears TIME0/TIME1 for the other device so
165 * that, even if we get this wrong, cycles to the other device will 165 * that, even if we get this wrong, cycles to the other device will
166 * be made PIO0. 166 * be made PIO0.
167 */ 167 */
diff --git a/drivers/ata/pata_sc1200.c b/drivers/ata/pata_sc1200.c
index 21ebc485ca4..725a8586cd6 100644
--- a/drivers/ata/pata_sc1200.c
+++ b/drivers/ata/pata_sc1200.c
@@ -156,7 +156,7 @@ static void sc1200_set_dmamode(struct ata_port *ap, struct ata_device *adev)
156 * 156 *
157 * Called when the libata layer is about to issue a command. We wrap 157 * Called when the libata layer is about to issue a command. We wrap
158 * this interface so that we can load the correct ATA timings if 158 * this interface so that we can load the correct ATA timings if
159 * neccessary. Specifically we have a problem that there is only 159 * necessary. Specifically we have a problem that there is only
160 * one MWDMA/UDMA bit. 160 * one MWDMA/UDMA bit.
161 */ 161 */
162 162
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index 4dc2e73298f..5c1e9cb59ec 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -16,7 +16,7 @@
16 * 16 *
17 * If you have strange problems with nVidia chipset systems please 17 * If you have strange problems with nVidia chipset systems please
18 * see the SI support documentation and update your system BIOS 18 * see the SI support documentation and update your system BIOS
19 * if neccessary 19 * if necessary
20 * 20 *
21 * TODO 21 * TODO
22 * If we know all our devices are LBA28 (or LBA28 sized) we could use 22 * If we know all our devices are LBA28 (or LBA28 sized) we could use
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index 5d41b6612d7..ea7a9a652e6 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -420,7 +420,7 @@ static struct ata_port_operations via_port_ops_noirq = {
420 * @pdev: PCI device 420 * @pdev: PCI device
421 * @flags: configuration flags 421 * @flags: configuration flags
422 * 422 *
423 * Set the FIFO properties for this device if neccessary. Used both on 423 * Set the FIFO properties for this device if necessary. Used both on
424 * set up and on and the resume path 424 * set up and on and the resume path
425 */ 425 */
426 426
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index 8d98a9fb0a4..f147dc7bf46 100644
--- a/drivers/ata/sata_sis.c
+++ b/drivers/ata/sata_sis.c
@@ -92,7 +92,7 @@ static struct scsi_host_template sis_sht = {
92 .queuecommand = ata_scsi_queuecmd, 92 .queuecommand = ata_scsi_queuecmd,
93 .can_queue = ATA_DEF_QUEUE, 93 .can_queue = ATA_DEF_QUEUE,
94 .this_id = ATA_SHT_THIS_ID, 94 .this_id = ATA_SHT_THIS_ID,
95 .sg_tablesize = ATA_MAX_PRD, 95 .sg_tablesize = LIBATA_MAX_PRD,
96 .cmd_per_lun = ATA_SHT_CMD_PER_LUN, 96 .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
97 .emulated = ATA_SHT_EMULATED, 97 .emulated = ATA_SHT_EMULATED,
98 .use_clustering = ATA_SHT_USE_CLUSTERING, 98 .use_clustering = ATA_SHT_USE_CLUSTERING,
@@ -166,11 +166,11 @@ static unsigned int get_scr_cfg_addr(struct ata_port *ap, unsigned int sc_reg)
166 return addr; 166 return addr;
167} 167}
168 168
169static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg) 169static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg, u32 *val)
170{ 170{
171 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 171 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
172 unsigned int cfg_addr = get_scr_cfg_addr(ap, sc_reg); 172 unsigned int cfg_addr = get_scr_cfg_addr(ap, sc_reg);
173 u32 val, val2 = 0; 173 u32 val2 = 0;
174 u8 pmr; 174 u8 pmr;
175 175
176 if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */ 176 if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */
@@ -178,13 +178,16 @@ static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg)
178 178
179 pci_read_config_byte(pdev, SIS_PMR, &pmr); 179 pci_read_config_byte(pdev, SIS_PMR, &pmr);
180 180
181 pci_read_config_dword(pdev, cfg_addr, &val); 181 pci_read_config_dword(pdev, cfg_addr, val);
182 182
183 if ((pdev->device == 0x0182) || (pdev->device == 0x0183) || 183 if ((pdev->device == 0x0182) || (pdev->device == 0x0183) ||
184 (pdev->device == 0x1182) || (pmr & SIS_PMR_COMBINED)) 184 (pdev->device == 0x1182) || (pmr & SIS_PMR_COMBINED))
185 pci_read_config_dword(pdev, cfg_addr+0x10, &val2); 185 pci_read_config_dword(pdev, cfg_addr+0x10, &val2);
186 186
187 return (val|val2) & 0xfffffffb; /* avoid problems with powerdowned ports */ 187 *val |= val2;
188 *val &= 0xfffffffb; /* avoid problems with powerdowned ports */
189
190 return 0;
188} 191}
189 192
190static void sis_scr_cfg_write (struct ata_port *ap, unsigned int sc_reg, u32 val) 193static void sis_scr_cfg_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
@@ -214,7 +217,7 @@ static int sis_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
214 return -EINVAL; 217 return -EINVAL;
215 218
216 if (ap->flags & SIS_FLAG_CFGSCR) 219 if (ap->flags & SIS_FLAG_CFGSCR)
217 return sis_scr_cfg_read(ap, sc_reg); 220 return sis_scr_cfg_read(ap, sc_reg, val);
218 221
219 pci_read_config_byte(pdev, SIS_PMR, &pmr); 222 pci_read_config_byte(pdev, SIS_PMR, &pmr);
220 223
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 94ebc9dc40f..f8f7139c07c 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -1596,7 +1596,7 @@ static irqreturn_t fs_irq (int irq, void *dev_id)
1596 1596
1597 /* print the bits in the ISR register. */ 1597 /* print the bits in the ISR register. */
1598 if (fs_debug & FS_DEBUG_IRQ) { 1598 if (fs_debug & FS_DEBUG_IRQ) {
1599 /* The FS_DEBUG things are unneccesary here. But this way it is 1599 /* The FS_DEBUG things are unnecessary here. But this way it is
1600 clear for grep that these are debug prints. */ 1600 clear for grep that these are debug prints. */
1601 fs_dprintk (FS_DEBUG_IRQ, "IRQ status:"); 1601 fs_dprintk (FS_DEBUG_IRQ, "IRQ status:");
1602 for (i=0;i<27;i++) 1602 for (i=0;i<27;i++)
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index ca4d7f0d09b..ce4b1e484e6 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -204,23 +204,6 @@ config BLK_DEV_COW_COMMON
204 bool 204 bool
205 default BLK_DEV_UBD 205 default BLK_DEV_UBD
206 206
207config MMAPPER
208 tristate "Example IO memory driver (BROKEN)"
209 depends on UML && BROKEN
210 ---help---
211 The User-Mode Linux port can provide support for IO Memory
212 emulation with this option. This allows a host file to be
213 specified as an I/O region on the kernel command line. That file
214 will be mapped into UML's kernel address space where a driver can
215 locate it and do whatever it wants with the memory, including
216 providing an interface to it for UML processes to use.
217
218 For more information, see
219 <http://user-mode-linux.sourceforge.net/iomem.html>.
220
221 If you'd like to be able to provide a simulated IO port space for
222 User-Mode Linux processes, say Y. If unsure, say N.
223
224config BLK_DEV_LOOP 207config BLK_DEV_LOOP
225 tristate "Loopback device support" 208 tristate "Loopback device support"
226 ---help--- 209 ---help---
@@ -351,7 +334,7 @@ config BLK_DEV_RAM_COUNT
351 default "16" 334 default "16"
352 depends on BLK_DEV_RAM 335 depends on BLK_DEV_RAM
353 help 336 help
354 The default value is 16 RAM disks. Change this if you know what 337 The default value is 16 RAM disks. Change this if you know what you
355 are doing. If you boot from a filesystem that needs to be extracted 338 are doing. If you boot from a filesystem that needs to be extracted
356 in memory, you will need at least one RAM disk (e.g. root on cramfs). 339 in memory, you will need at least one RAM disk (e.g. root on cramfs).
357 340
@@ -361,7 +344,7 @@ config BLK_DEV_RAM_SIZE
361 default "4096" 344 default "4096"
362 help 345 help
363 The default value is 4096 kilobytes. Only change this if you know 346 The default value is 4096 kilobytes. Only change this if you know
364 what are you doing. 347 what you are doing.
365 348
366config BLK_DEV_RAM_BLOCKSIZE 349config BLK_DEV_RAM_BLOCKSIZE
367 int "Default RAM disk block size (bytes)" 350 int "Default RAM disk block size (bytes)"
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 589cbbd9cd4..56e23042728 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -29,7 +29,7 @@
29 * 29 *
30 * Maximum number of loop devices when compiled-in now selectable by passing 30 * Maximum number of loop devices when compiled-in now selectable by passing
31 * max_loop=<1-255> to the kernel on boot. 31 * max_loop=<1-255> to the kernel on boot.
32 * Erik I. Bolsø, <eriki@himolde.no>, Oct 31, 1999 32 * Erik I. Bolsø, <eriki@himolde.no>, Oct 31, 1999
33 * 33 *
34 * Completely rewrite request handling to be make_request_fn style and 34 * Completely rewrite request handling to be make_request_fn style and
35 * non blocking, pushing work to a helper thread. Lots of fixes from 35 * non blocking, pushing work to a helper thread. Lots of fixes from
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index ac4a0cb217a..6332acad078 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -508,7 +508,6 @@ error_out:
508 nbd_end_request(req); 508 nbd_end_request(req);
509 spin_lock(q->queue_lock); 509 spin_lock(q->queue_lock);
510 } 510 }
511 return;
512} 511}
513 512
514static int nbd_ioctl(struct inode *inode, struct file *file, 513static int nbd_ioctl(struct inode *inode, struct file *file,
diff --git a/drivers/block/rd.c b/drivers/block/rd.c
index 08176d23a46..47f8ac6cce5 100644
--- a/drivers/block/rd.c
+++ b/drivers/block/rd.c
@@ -365,7 +365,7 @@ static int rd_open(struct inode *inode, struct file *filp)
365 /* 365 /*
366 * Deep badness. rd_blkdev_pagecache_IO() needs to allocate 366 * Deep badness. rd_blkdev_pagecache_IO() needs to allocate
367 * pagecache pages within a request_fn. We cannot recur back 367 * pagecache pages within a request_fn. We cannot recur back
368 * into the filesytem which is mounted atop the ramdisk, because 368 * into the filesystem which is mounted atop the ramdisk, because
369 * that would deadlock on fs locks. And we really don't want 369 * that would deadlock on fs locks. And we really don't want
370 * to reenter rd_blkdev_pagecache_IO when we're already within 370 * to reenter rd_blkdev_pagecache_IO when we're already within
371 * that function. 371 * that function.
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index d15234c5965..d1bd0f08a33 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -359,7 +359,7 @@
359 * 359 *
360 * Revision 1.36.3.8 1996/06/07 16:29:00 bentson 360 * Revision 1.36.3.8 1996/06/07 16:29:00 bentson
361 * starting minor number at zero; added missing verify_area 361 * starting minor number at zero; added missing verify_area
362 * as noted by Heiko Eissfeldt <heiko@colossus.escape.de> 362 * as noted by Heiko Eißfeldt <heiko@colossus.escape.de>
363 * 363 *
364 * Revision 1.36.3.7 1996/04/19 21:06:18 bentson 364 * Revision 1.36.3.7 1996/04/19 21:06:18 bentson
365 * remove unneeded boot message & fix CLOCAL hardware flow 365 * remove unneeded boot message & fix CLOCAL hardware flow
@@ -727,8 +727,6 @@ static struct tty_driver *cy_serial_driver;
727 driver to probe addresses at a different address, add it to 727 driver to probe addresses at a different address, add it to
728 this table. If the driver is probing some other board and 728 this table. If the driver is probing some other board and
729 causing problems, remove the offending address from this table. 729 causing problems, remove the offending address from this table.
730 The cy_setup function extracts additional addresses from the
731 boot options line. The form is "cyclades=address,address..."
732*/ 730*/
733 731
734static unsigned int cy_isa_addresses[] = { 732static unsigned int cy_isa_addresses[] = {
diff --git a/drivers/char/drm/drm_hashtab.c b/drivers/char/drm/drm_hashtab.c
index 3ad31907070..4b8e7db5a23 100644
--- a/drivers/char/drm/drm_hashtab.c
+++ b/drivers/char/drm/drm_hashtab.c
@@ -29,7 +29,7 @@
29 * Simple open hash tab implementation. 29 * Simple open hash tab implementation.
30 * 30 *
31 * Authors: 31 * Authors:
32 * Thomas Hellström <thomas-at-tungstengraphics-dot-com> 32 * Thomas Hellström <thomas-at-tungstengraphics-dot-com>
33 */ 33 */
34 34
35#include "drmP.h" 35#include "drmP.h"
diff --git a/drivers/char/drm/drm_hashtab.h b/drivers/char/drm/drm_hashtab.h
index 0f137677416..573e333ac45 100644
--- a/drivers/char/drm/drm_hashtab.h
+++ b/drivers/char/drm/drm_hashtab.h
@@ -29,7 +29,7 @@
29 * Simple open hash tab implementation. 29 * Simple open hash tab implementation.
30 * 30 *
31 * Authors: 31 * Authors:
32 * Thomas Hellström <thomas-at-tungstengraphics-dot-com> 32 * Thomas Hellström <thomas-at-tungstengraphics-dot-com>
33 */ 33 */
34 34
35#ifndef DRM_HASHTAB_H 35#ifndef DRM_HASHTAB_H
diff --git a/drivers/char/drm/drm_mm.c b/drivers/char/drm/drm_mm.c
index 3e6bc14f744..86f4eb61a6a 100644
--- a/drivers/char/drm/drm_mm.c
+++ b/drivers/char/drm/drm_mm.c
@@ -38,7 +38,7 @@
38 * Aligned allocations can also see improvement. 38 * Aligned allocations can also see improvement.
39 * 39 *
40 * Authors: 40 * Authors:
41 * Thomas Hellström <thomas-at-tungstengraphics-dot-com> 41 * Thomas Hellström <thomas-at-tungstengraphics-dot-com>
42 */ 42 */
43 43
44#include "drmP.h" 44#include "drmP.h"
diff --git a/drivers/char/drm/drm_pci.c b/drivers/char/drm/drm_pci.c
index e292bb0eaca..b55d5bc6ea6 100644
--- a/drivers/char/drm/drm_pci.c
+++ b/drivers/char/drm/drm_pci.c
@@ -8,12 +8,12 @@
8 * \todo Implement the remaining ioctl's for the PCI pools. 8 * \todo Implement the remaining ioctl's for the PCI pools.
9 * \todo The wrappers here are so thin that they would be better off inlined.. 9 * \todo The wrappers here are so thin that they would be better off inlined..
10 * 10 *
11 * \author Jose Fonseca <jrfonseca@tungstengraphics.com> 11 * \author José Fonseca <jrfonseca@tungstengraphics.com>
12 * \author Leif Delgass <ldelgass@retinalburn.net> 12 * \author Leif Delgass <ldelgass@retinalburn.net>
13 */ 13 */
14 14
15/* 15/*
16 * Copyright 2003 Jos�Fonseca. 16 * Copyright 2003 José Fonseca.
17 * Copyright 2003 Leif Delgass. 17 * Copyright 2003 Leif Delgass.
18 * All Rights Reserved. 18 * All Rights Reserved.
19 * 19 *
diff --git a/drivers/char/drm/drm_sarea.h b/drivers/char/drm/drm_sarea.h
index f5466966081..e040f47f369 100644
--- a/drivers/char/drm/drm_sarea.h
+++ b/drivers/char/drm/drm_sarea.h
@@ -2,7 +2,7 @@
2 * \file drm_sarea.h 2 * \file drm_sarea.h
3 * \brief SAREA definitions 3 * \brief SAREA definitions
4 * 4 *
5 * \author Michel Dänzer <michel@daenzer.net> 5 * \author Michel Dänzer <michel@daenzer.net>
6 */ 6 */
7 7
8/* 8/*
diff --git a/drivers/char/drm/drm_sman.c b/drivers/char/drm/drm_sman.c
index 8421a93946d..926f146390c 100644
--- a/drivers/char/drm/drm_sman.c
+++ b/drivers/char/drm/drm_sman.c
@@ -33,7 +33,7 @@
33 * struct or a context identifier. 33 * struct or a context identifier.
34 * 34 *
35 * Authors: 35 * Authors:
36 * Thomas Hellström <thomas-at-tungstengraphics-dot-com> 36 * Thomas Hellström <thomas-at-tungstengraphics-dot-com>
37 */ 37 */
38 38
39#include "drm_sman.h" 39#include "drm_sman.h"
diff --git a/drivers/char/drm/drm_sman.h b/drivers/char/drm/drm_sman.h
index 39a39fefeef..08ecf83ad5d 100644
--- a/drivers/char/drm/drm_sman.h
+++ b/drivers/char/drm/drm_sman.h
@@ -33,7 +33,7 @@
33 * struct or a context identifier. 33 * struct or a context identifier.
34 * 34 *
35 * Authors: 35 * Authors:
36 * Thomas Hellström <thomas-at-tungstengraphics-dot-com> 36 * Thomas Hellström <thomas-at-tungstengraphics-dot-com>
37 */ 37 */
38 38
39#ifndef DRM_SMAN_H 39#ifndef DRM_SMAN_H
diff --git a/drivers/char/drm/r128_drv.h b/drivers/char/drm/r128_drv.h
index 250d2aa4658..5041bd8dbed 100644
--- a/drivers/char/drm/r128_drv.h
+++ b/drivers/char/drm/r128_drv.h
@@ -29,7 +29,7 @@
29 * Rickard E. (Rik) Faith <faith@valinux.com> 29 * Rickard E. (Rik) Faith <faith@valinux.com>
30 * Kevin E. Martin <martin@valinux.com> 30 * Kevin E. Martin <martin@valinux.com>
31 * Gareth Hughes <gareth@valinux.com> 31 * Gareth Hughes <gareth@valinux.com>
32 * Michel D�zer <daenzerm@student.ethz.ch> 32 * Michel Dänzer <daenzerm@student.ethz.ch>
33 */ 33 */
34 34
35#ifndef __R128_DRV_H__ 35#ifndef __R128_DRV_H__
diff --git a/drivers/char/drm/radeon_irq.c b/drivers/char/drm/radeon_irq.c
index 2b2407ee490..84f5bc36252 100644
--- a/drivers/char/drm/radeon_irq.c
+++ b/drivers/char/drm/radeon_irq.c
@@ -27,7 +27,7 @@
27 * 27 *
28 * Authors: 28 * Authors:
29 * Keith Whitwell <keith@tungstengraphics.com> 29 * Keith Whitwell <keith@tungstengraphics.com>
30 * Michel D�zer <michel@daenzer.net> 30 * Michel Dänzer <michel@daenzer.net>
31 */ 31 */
32 32
33#include "drmP.h" 33#include "drmP.h"
diff --git a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c
index 69c9f2febf4..f824f2f5fdc 100644
--- a/drivers/char/drm/radeon_state.c
+++ b/drivers/char/drm/radeon_state.c
@@ -3005,7 +3005,7 @@ static int radeon_cp_getparam(struct drm_device *dev, void *data, struct drm_fil
3005 /* 3005 /*
3006 * This ioctl() doesn't work on 64-bit platforms because hw_lock is a 3006 * This ioctl() doesn't work on 64-bit platforms because hw_lock is a
3007 * pointer which can't fit into an int-sized variable. According to 3007 * pointer which can't fit into an int-sized variable. According to
3008 * Michel Dänzer, the ioctl() is only used on embedded platforms, so 3008 * Michel Dänzer, the ioctl() is only used on embedded platforms, so
3009 * not supporting it shouldn't be a problem. If the same functionality 3009 * not supporting it shouldn't be a problem. If the same functionality
3010 * is needed on 64-bit platforms, a new ioctl() would have to be added, 3010 * is needed on 64-bit platforms, a new ioctl() would have to be added,
3011 * so backwards-compatibility for the embedded platforms can be 3011 * so backwards-compatibility for the embedded platforms can be
diff --git a/drivers/char/drm/sis_mm.c b/drivers/char/drm/sis_mm.c
index 8c66838ff51..6be1c575758 100644
--- a/drivers/char/drm/sis_mm.c
+++ b/drivers/char/drm/sis_mm.c
@@ -28,7 +28,7 @@
28 28
29/* 29/*
30 * Authors: 30 * Authors:
31 * Thomas Hellström <thomas-at-tungstengraphics-dot-com> 31 * Thomas Hellström <thomas-at-tungstengraphics-dot-com>
32 */ 32 */
33 33
34#include "drmP.h" 34#include "drmP.h"
diff --git a/drivers/char/drm/via_mm.c b/drivers/char/drm/via_mm.c
index 9afc1684348..3ffbf864983 100644
--- a/drivers/char/drm/via_mm.c
+++ b/drivers/char/drm/via_mm.c
@@ -22,7 +22,7 @@
22 * DEALINGS IN THE SOFTWARE. 22 * DEALINGS IN THE SOFTWARE.
23 */ 23 */
24/* 24/*
25 * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com> 25 * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
26 */ 26 */
27 27
28#include "drmP.h" 28#include "drmP.h"
diff --git a/drivers/char/drm/via_verifier.h b/drivers/char/drm/via_verifier.h
index 28b50296a7b..d6f8214b69f 100644
--- a/drivers/char/drm/via_verifier.h
+++ b/drivers/char/drm/via_verifier.h
@@ -20,7 +20,7 @@
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE. 21 * DEALINGS IN THE SOFTWARE.
22 * 22 *
23 * Author: Thomas Hellström 2004. 23 * Author: Thomas Hellström 2004.
24 */ 24 */
25 25
26#ifndef _VIA_VERIFIER_H_ 26#ifndef _VIA_VERIFIER_H_
diff --git a/drivers/char/esp.c b/drivers/char/esp.c
index 0f8fb135da5..28607763ae6 100644
--- a/drivers/char/esp.c
+++ b/drivers/char/esp.c
@@ -19,7 +19,7 @@
19 * 19 *
20 * rs_set_termios fixed to look also for changes of the input 20 * rs_set_termios fixed to look also for changes of the input
21 * flags INPCK, BRKINT, PARMRK, IGNPAR and IGNBRK. 21 * flags INPCK, BRKINT, PARMRK, IGNPAR and IGNBRK.
22 * Bernd Anh�pl 05/17/96. 22 * Bernd Anhäupl 05/17/96.
23 * 23 *
24 * --- End of notices from serial.c --- 24 * --- End of notices from serial.c ---
25 * 25 *
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index e13dd1892bf..3f35a1c562b 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -10,7 +10,7 @@
10 * Mostly based on original driver: 10 * Mostly based on original driver:
11 * 11 *
12 * Copyright (C) 2005 Nokia Corporation 12 * Copyright (C) 2005 Nokia Corporation
13 * Author: Juha Yrj��<juha.yrjola@nokia.com> 13 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
14 * 14 *
15 * This file is licensed under the terms of the GNU General Public 15 * This file is licensed under the terms of the GNU General Public
16 * License version 2. This program is licensed "as is" without any 16 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
index cd406416eff..30e56451642 100644
--- a/drivers/char/i8k.c
+++ b/drivers/char/i8k.c
@@ -371,14 +371,14 @@ static int i8k_proc_show(struct seq_file *seq, void *offset)
371 int fn_key, cpu_temp, ac_power; 371 int fn_key, cpu_temp, ac_power;
372 int left_fan, right_fan, left_speed, right_speed; 372 int left_fan, right_fan, left_speed, right_speed;
373 373
374 cpu_temp = i8k_get_temp(0); /* 11100 µs */ 374 cpu_temp = i8k_get_temp(0); /* 11100 µs */
375 left_fan = i8k_get_fan_status(I8K_FAN_LEFT); /* 580 µs */ 375 left_fan = i8k_get_fan_status(I8K_FAN_LEFT); /* 580 µs */
376 right_fan = i8k_get_fan_status(I8K_FAN_RIGHT); /* 580 µs */ 376 right_fan = i8k_get_fan_status(I8K_FAN_RIGHT); /* 580 µs */
377 left_speed = i8k_get_fan_speed(I8K_FAN_LEFT); /* 580 µs */ 377 left_speed = i8k_get_fan_speed(I8K_FAN_LEFT); /* 580 µs */
378 right_speed = i8k_get_fan_speed(I8K_FAN_RIGHT); /* 580 µs */ 378 right_speed = i8k_get_fan_speed(I8K_FAN_RIGHT); /* 580 µs */
379 fn_key = i8k_get_fn_status(); /* 750 µs */ 379 fn_key = i8k_get_fn_status(); /* 750 µs */
380 if (power_status) 380 if (power_status)
381 ac_power = i8k_get_power_status(); /* 14700 µs */ 381 ac_power = i8k_get_power_status(); /* 14700 µs */
382 else 382 else
383 ac_power = -1; 383 ac_power = -1;
384 384
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 03805691193..596c7173997 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -437,7 +437,7 @@ static inline void finish_erasing(struct tty_struct *tty)
437 * @c: character input 437 * @c: character input
438 * @tty: terminal device 438 * @tty: terminal device
439 * 439 *
440 * Perform erase and neccessary output when an erase character is 440 * Perform erase and necessary output when an erase character is
441 * present in the stream from the driver layer. Handles the complexities 441 * present in the stream from the driver layer. Handles the complexities
442 * of UTF-8 multibyte symbols. 442 * of UTF-8 multibyte symbols.
443 */ 443 */
@@ -657,7 +657,7 @@ static inline void n_tty_receive_overrun(struct tty_struct *tty)
657 * @c: character 657 * @c: character
658 * 658 *
659 * Process a parity error and queue the right data to indicate 659 * Process a parity error and queue the right data to indicate
660 * the error case if neccessary. Locking as per n_tty_receive_buf. 660 * the error case if necessary. Locking as per n_tty_receive_buf.
661 */ 661 */
662static inline void n_tty_receive_parity_error(struct tty_struct *tty, 662static inline void n_tty_receive_parity_error(struct tty_struct *tty,
663 unsigned char c) 663 unsigned char c)
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index 7e6a3a413bb..d83419c3857 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -563,7 +563,7 @@ static void rp_do_poll(unsigned long dummy)
563 /* Get a ptr to the board's control struct */ 563 /* Get a ptr to the board's control struct */
564 ctlp = sCtlNumToCtlPtr(ctrl); 564 ctlp = sCtlNumToCtlPtr(ctrl);
565 565
566 /* Get the interupt status from the board */ 566 /* Get the interrupt status from the board */
567#ifdef CONFIG_PCI 567#ifdef CONFIG_PCI
568 if (ctlp->BusType == isPCI) 568 if (ctlp->BusType == isPCI)
569 CtlMask = sPCIGetControllerIntStatus(ctlp); 569 CtlMask = sPCIGetControllerIntStatus(ctlp);
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index 9782cb4d30d..877e53dcb99 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * Copyright (C) 2005 Narayanan R S <nars@kadamba.org> 8 * Copyright (C) 2005 Narayanan R S <nars@kadamba.org>
9 * 9 *
10 * Copyright (C) 2001-2002 Alcôve <www.alcove.com> 10 * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
11 * 11 *
12 * Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au> 12 * Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au>
13 * 13 *
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 13a53575a01..f36fecd3fd2 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -943,7 +943,7 @@ EXPORT_SYMBOL_GPL(tty_ldisc_deref);
943 * @tty: terminal to activate ldisc on 943 * @tty: terminal to activate ldisc on
944 * 944 *
945 * Set the TTY_LDISC flag when the line discipline can be called 945 * Set the TTY_LDISC flag when the line discipline can be called
946 * again. Do neccessary wakeups for existing sleepers. 946 * again. Do necessary wakeups for existing sleepers.
947 * 947 *
948 * Note: nobody should set this bit except via this function. Clearing 948 * Note: nobody should set this bit except via this function. Clearing
949 * directly is allowed. 949 * directly is allowed.
@@ -1504,7 +1504,7 @@ EXPORT_SYMBOL(tty_hangup);
1504 * 1504 *
1505 * The user has asked via system call for the terminal to be hung up. 1505 * The user has asked via system call for the terminal to be hung up.
1506 * We do this synchronously so that when the syscall returns the process 1506 * We do this synchronously so that when the syscall returns the process
1507 * is complete. That guarantee is neccessary for security reasons. 1507 * is complete. That guarantee is necessary for security reasons.
1508 */ 1508 */
1509 1509
1510void tty_vhangup(struct tty_struct * tty) 1510void tty_vhangup(struct tty_struct * tty)
@@ -1691,7 +1691,7 @@ EXPORT_SYMBOL(stop_tty);
1691 * @tty: tty to start 1691 * @tty: tty to start
1692 * 1692 *
1693 * Start a tty that has been stopped if at all possible. Perform 1693 * Start a tty that has been stopped if at all possible. Perform
1694 * any neccessary wakeups and propagate the TIOCPKT status. If this 1694 * any necessary wakeups and propagate the TIOCPKT status. If this
1695 * is the tty was previous stopped and is being started then the 1695 * is the tty was previous stopped and is being started then the
1696 * driver start method is invoked and the line discipline woken. 1696 * driver start method is invoked and the line discipline woken.
1697 * 1697 *
@@ -2877,7 +2877,7 @@ static int tty_fasync(int fd, struct file * filp, int on)
2877 * @tty: tty to fake input into 2877 * @tty: tty to fake input into
2878 * @p: pointer to character 2878 * @p: pointer to character
2879 * 2879 *
2880 * Fake input to a tty device. Does the neccessary locking and 2880 * Fake input to a tty device. Does the necessary locking and
2881 * input management. 2881 * input management.
2882 * 2882 *
2883 * FIXME: does not honour flow control ?? 2883 * FIXME: does not honour flow control ??
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index 0def089cc1f..7a003504c26 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -444,7 +444,7 @@ static void change_termios(struct tty_struct * tty, struct ktermios * new_termio
444 * @arg: user data 444 * @arg: user data
445 * @opt: option information 445 * @opt: option information
446 * 446 *
447 * Helper function to prepare termios data and run neccessary other 447 * Helper function to prepare termios data and run necessary other
448 * functions before using change_termios to do the actual changes. 448 * functions before using change_termios to do the actual changes.
449 * 449 *
450 * Locking: 450 * Locking:
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
index 9959b799dbe..c00d4a9b39e 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -228,7 +228,7 @@ fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
228 * 228 *
229 * @param card the card from which to send the request 229 * @param card the card from which to send the request
230 * @param tcode the tcode for this transaction. Do not use 230 * @param tcode the tcode for this transaction. Do not use
231 * TCODE_LOCK_REQUEST directly, insted use TCODE_LOCK_MASK_SWAP 231 * TCODE_LOCK_REQUEST directly, instead use TCODE_LOCK_MASK_SWAP
232 * etc. to specify tcode and ext_tcode. 232 * etc. to specify tcode and ext_tcode.
233 * @param node_id the destination node ID (bus ID and PHY ID concatenated) 233 * @param node_id the destination node ID (bus ID and PHY ID concatenated)
234 * @param generation the generation for which node_id is valid 234 * @param generation the generation for which node_id is valid
diff --git a/drivers/hid/usbhid/hid-ff.c b/drivers/hid/usbhid/hid-ff.c
index 22329feb3b5..4c210e16b1b 100644
--- a/drivers/hid/usbhid/hid-ff.c
+++ b/drivers/hid/usbhid/hid-ff.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * $Id: hid-ff.c,v 1.2 2002/04/18 22:02:47 jdeneux Exp $
3 *
4 * Force feedback support for hid devices. 2 * Force feedback support for hid devices.
5 * Not all hid devices use the same protocol. For example, some use PID, 3 * Not all hid devices use the same protocol. For example, some use PID,
6 * other use their own proprietary procotol. 4 * other use their own proprietary procotol.
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 6f66551d9e5..5c82ec7f8bb 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -150,7 +150,7 @@ static struct coretemp_data *coretemp_update_device(struct device *dev)
150static int __devinit coretemp_probe(struct platform_device *pdev) 150static int __devinit coretemp_probe(struct platform_device *pdev)
151{ 151{
152 struct coretemp_data *data; 152 struct coretemp_data *data;
153 struct cpuinfo_x86 *c = &(cpu_data)[pdev->id]; 153 struct cpuinfo_x86 *c = &cpu_data(pdev->id);
154 int err; 154 int err;
155 u32 eax, edx; 155 u32 eax, edx;
156 156
@@ -359,7 +359,7 @@ static int __init coretemp_init(void)
359 struct pdev_entry *p, *n; 359 struct pdev_entry *p, *n;
360 360
361 /* quick check if we run Intel */ 361 /* quick check if we run Intel */
362 if (cpu_data[0].x86_vendor != X86_VENDOR_INTEL) 362 if (cpu_data(0).x86_vendor != X86_VENDOR_INTEL)
363 goto exit; 363 goto exit;
364 364
365 err = platform_driver_register(&coretemp_driver); 365 err = platform_driver_register(&coretemp_driver);
@@ -367,7 +367,7 @@ static int __init coretemp_init(void)
367 goto exit; 367 goto exit;
368 368
369 for_each_online_cpu(i) { 369 for_each_online_cpu(i) {
370 struct cpuinfo_x86 *c = &(cpu_data)[i]; 370 struct cpuinfo_x86 *c = &cpu_data(i);
371 371
372 /* check if family 6, models e, f, 16 */ 372 /* check if family 6, models e, f, 16 */
373 if ((c->cpuid_level < 0) || (c->x86 != 0x6) || 373 if ((c->cpuid_level < 0) || (c->x86 != 0x6) ||
diff --git a/drivers/hwmon/gl520sm.c b/drivers/hwmon/gl520sm.c
index a3b56c816e1..2d39d8fc238 100644
--- a/drivers/hwmon/gl520sm.c
+++ b/drivers/hwmon/gl520sm.c
@@ -2,7 +2,7 @@
2 gl520sm.c - Part of lm_sensors, Linux kernel modules for hardware 2 gl520sm.c - Part of lm_sensors, Linux kernel modules for hardware
3 monitoring 3 monitoring
4 Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>, 4 Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>,
5 Kyösti Mälkki <kmalkki@cc.hut.fi> 5 Kyösti Mälkki <kmalkki@cc.hut.fi>
6 Copyright (c) 2005 Maarten Deprez <maartendeprez@users.sourceforge.net> 6 Copyright (c) 2005 Maarten Deprez <maartendeprez@users.sourceforge.net>
7 7
8 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
@@ -805,7 +805,7 @@ static void __exit sensors_gl520sm_exit(void)
805 805
806 806
807MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>, " 807MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>, "
808 "Kyösti Mälkki <kmalkki@cc.hut.fi>, " 808 "Kyösti Mälkki <kmalkki@cc.hut.fi>, "
809 "Maarten Deprez <maartendeprez@users.sourceforge.net>"); 809 "Maarten Deprez <maartendeprez@users.sourceforge.net>");
810MODULE_DESCRIPTION("GL520SM driver"); 810MODULE_DESCRIPTION("GL520SM driver");
811MODULE_LICENSE("GPL"); 811MODULE_LICENSE("GPL");
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c
index f17e771e42f..3330667280b 100644
--- a/drivers/hwmon/hwmon-vid.c
+++ b/drivers/hwmon/hwmon-vid.c
@@ -200,7 +200,7 @@ static u8 find_vrm(u8 eff_family, u8 eff_model, u8 eff_stepping, u8 vendor)
200 200
201u8 vid_which_vrm(void) 201u8 vid_which_vrm(void)
202{ 202{
203 struct cpuinfo_x86 *c = cpu_data; 203 struct cpuinfo_x86 *c = &cpu_data(0);
204 u32 eax; 204 u32 eax;
205 u8 eff_family, eff_model, eff_stepping, vrm_ret; 205 u8 eff_family, eff_model, eff_stepping, vrm_ret;
206 206
diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c
index 860b71ccbb8..7e2d9787bab 100644
--- a/drivers/hwmon/sis5595.c
+++ b/drivers/hwmon/sis5595.c
@@ -3,7 +3,7 @@
3 for hardware monitoring 3 for hardware monitoring
4 4
5 Copyright (C) 1998 - 2001 Frodo Looijaard <frodol@dds.nl>, 5 Copyright (C) 1998 - 2001 Frodo Looijaard <frodol@dds.nl>,
6 Kyösti Mälkki <kmalkki@cc.hut.fi>, and 6 Kyösti Mälkki <kmalkki@cc.hut.fi>, and
7 Mark D. Studebaker <mdsxyz123@yahoo.com> 7 Mark D. Studebaker <mdsxyz123@yahoo.com>
8 Ported to Linux 2.6 by Aurelien Jarno <aurelien@aurel32.net> with 8 Ported to Linux 2.6 by Aurelien Jarno <aurelien@aurel32.net> with
9 the help of Jean Delvare <khali@linux-fr.org> 9 the help of Jean Delvare <khali@linux-fr.org>
diff --git a/drivers/hwmon/via686a.c b/drivers/hwmon/via686a.c
index 8f63dada601..2635bba1e3f 100644
--- a/drivers/hwmon/via686a.c
+++ b/drivers/hwmon/via686a.c
@@ -3,7 +3,7 @@
3 for hardware monitoring 3 for hardware monitoring
4 4
5 Copyright (c) 1998 - 2002 Frodo Looijaard <frodol@dds.nl>, 5 Copyright (c) 1998 - 2002 Frodo Looijaard <frodol@dds.nl>,
6 Kyösti Mälkki <kmalkki@cc.hut.fi>, 6 Kyösti Mälkki <kmalkki@cc.hut.fi>,
7 Mark Studebaker <mdsxyz123@yahoo.com>, 7 Mark Studebaker <mdsxyz123@yahoo.com>,
8 and Bob Dougherty <bobd@stanford.edu> 8 and Bob Dougherty <bobd@stanford.edu>
9 (Some conversion-factor data were contributed by Jonathan Teh Soon Yew 9 (Some conversion-factor data were contributed by Jonathan Teh Soon Yew
@@ -866,7 +866,7 @@ static void __exit sm_via686a_exit(void)
866 } 866 }
867} 867}
868 868
869MODULE_AUTHOR("Kyösti Mälkki <kmalkki@cc.hut.fi>, " 869MODULE_AUTHOR("Kyösti Mälkki <kmalkki@cc.hut.fi>, "
870 "Mark Studebaker <mdsxyz123@yahoo.com> " 870 "Mark Studebaker <mdsxyz123@yahoo.com> "
871 "and Bob Dougherty <bobd@stanford.edu>"); 871 "and Bob Dougherty <bobd@stanford.edu>");
872MODULE_DESCRIPTION("VIA 686A Sensor device"); 872MODULE_DESCRIPTION("VIA 686A Sensor device");
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index 7f0a0a62cf6..a37cb6b8593 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -18,7 +18,7 @@
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ 18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19/* ------------------------------------------------------------------------- */ 19/* ------------------------------------------------------------------------- */
20 20
21/* With some changes from Frodo Looijaard <frodol@dds.nl>, Kyösti Mälkki 21/* With some changes from Frodo Looijaard <frodol@dds.nl>, Kyösti Mälkki
22 <kmalkki@cc.hut.fi> and Jean Delvare <khali@linux-fr.org> */ 22 <kmalkki@cc.hut.fi> and Jean Delvare <khali@linux-fr.org> */
23 23
24#include <linux/kernel.h> 24#include <linux/kernel.h>
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
index 36fdf971f08..2a16211f12e 100644
--- a/drivers/i2c/algos/i2c-algo-pca.c
+++ b/drivers/i2c/algos/i2c-algo-pca.c
@@ -350,7 +350,7 @@ static int pca_init(struct i2c_algo_pca_data *adap)
350 pca_outw(adap, I2C_PCA_ADR, own << 1); 350 pca_outw(adap, I2C_PCA_ADR, own << 1);
351 351
352 pca_set_con(adap, I2C_PCA_CON_ENSIO | clock); 352 pca_set_con(adap, I2C_PCA_CON_ENSIO | clock);
353 udelay(500); /* 500 µs for oscilator to stabilise */ 353 udelay(500); /* 500 µs for oscilator to stabilise */
354 354
355 return 0; 355 return 0;
356} 356}
diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c
index ecb2c2d7d54..ab2e6f3498b 100644
--- a/drivers/i2c/algos/i2c-algo-pcf.c
+++ b/drivers/i2c/algos/i2c-algo-pcf.c
@@ -19,7 +19,7 @@
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ 19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20/* ------------------------------------------------------------------------- */ 20/* ------------------------------------------------------------------------- */
21 21
22/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and 22/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
23 Frodo Looijaard <frodol@dds.nl> ,and also from Martin Bailey 23 Frodo Looijaard <frodol@dds.nl> ,and also from Martin Bailey
24 <mbailey@littlefeet-inc.com> */ 24 <mbailey@littlefeet-inc.com> */
25 25
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index de95c75efb4..c466c6cfc2e 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -278,7 +278,7 @@ config I2C_IXP2000
278 depends on ARCH_IXP2000 278 depends on ARCH_IXP2000
279 select I2C_ALGOBIT 279 select I2C_ALGOBIT
280 help 280 help
281 Say Y here if you have an Intel IXP2000(2400, 2800, 2850) based 281 Say Y here if you have an Intel IXP2000 (2400, 2800, 2850) based
282 system and are using GPIO lines for an I2C bus. 282 system and are using GPIO lines for an I2C bus.
283 283
284 This support is also available as a module. If so, the module 284 This support is also available as a module. If so, the module
@@ -293,8 +293,8 @@ config I2C_POWERMAC
293 default y 293 default y
294 help 294 help
295 This exposes the various PowerMac i2c interfaces to the linux i2c 295 This exposes the various PowerMac i2c interfaces to the linux i2c
296 layer and to userland. It is used by various drivers on the powemac 296 layer and to userland. It is used by various drivers on the PowerMac
297 platform, thus should generally be enabled. 297 platform, and should generally be enabled.
298 298
299 This support is also available as a module. If so, the module 299 This support is also available as a module. If so, the module
300 will be called i2c-powermac. 300 will be called i2c-powermac.
@@ -438,12 +438,12 @@ config I2C_SIMTEC
438 tristate "Simtec Generic I2C interface" 438 tristate "Simtec Generic I2C interface"
439 select I2C_ALGOBIT 439 select I2C_ALGOBIT
440 help 440 help
441 If you say yes to this option, support will be inclyded for 441 If you say yes to this option, support will be included for
442 the Simtec Generic I2C interface. This driver is for the 442 the Simtec Generic I2C interface. This driver is for the
443 simple I2C bus used on newer Simtec products for general 443 simple I2C bus used on newer Simtec products for general
444 I2C, such as DDC on the Simtec BBD2016A. 444 I2C, such as DDC on the Simtec BBD2016A.
445 445
446 This driver can also be build as a module. If so, the module 446 This driver can also be built as a module. If so, the module
447 will be called i2c-simtec. 447 will be called i2c-simtec.
448 448
449config SCx200_I2C 449config SCx200_I2C
diff --git a/drivers/i2c/busses/i2c-elektor.c b/drivers/i2c/busses/i2c-elektor.c
index 804f0a551c0..b7a9977b025 100644
--- a/drivers/i2c/busses/i2c-elektor.c
+++ b/drivers/i2c/busses/i2c-elektor.c
@@ -19,7 +19,7 @@
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ 19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20/* ------------------------------------------------------------------------- */ 20/* ------------------------------------------------------------------------- */
21 21
22/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even 22/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
23 Frodo Looijaard <frodol@dds.nl> */ 23 Frodo Looijaard <frodol@dds.nl> */
24 24
25/* Partialy rewriten by Oleg I. Vdovikin for mmapped support of 25/* Partialy rewriten by Oleg I. Vdovikin for mmapped support of
diff --git a/drivers/i2c/busses/i2c-hydra.c b/drivers/i2c/busses/i2c-hydra.c
index 9832f773651..f9972f9651e 100644
--- a/drivers/i2c/busses/i2c-hydra.c
+++ b/drivers/i2c/busses/i2c-hydra.c
@@ -7,7 +7,7 @@
7 Copyright (c) 1999-2004 Geert Uytterhoeven <geert@linux-m68k.org> 7 Copyright (c) 1999-2004 Geert Uytterhoeven <geert@linux-m68k.org>
8 8
9 Based on i2c Support for Via Technologies 82C586B South Bridge 9 Based on i2c Support for Via Technologies 82C586B South Bridge
10 Copyright (c) 1998, 1999 Kyösti Mälkki <kmalkki@cc.hut.fi> 10 Copyright (c) 1998, 1999 Kyösti Mälkki <kmalkki@cc.hut.fi>
11 11
12 This program is free software; you can redistribute it and/or modify 12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by 13 it under the terms of the GNU General Public License as published by
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index e08bacadd6b..9b43ff7270d 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -18,7 +18,7 @@
18 * Copyright 1995-97 Simon G. Vogl 18 * Copyright 1995-97 Simon G. Vogl
19 * 1998-99 Hans Berglund 19 * 1998-99 Hans Berglund
20 * 20 *
21 * With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> 21 * With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi>
22 * and even Frodo Looijaard <frodol@dds.nl> 22 * and even Frodo Looijaard <frodol@dds.nl>
23 * 23 *
24 * This program is free software; you can redistribute it and/or modify it 24 * This program is free software; you can redistribute it and/or modify it
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index e471e3bfdc1..89a30028ddb 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -8,7 +8,7 @@
8 * Tony Lindgren <tony@atomide.com> and Imre Deak <imre.deak@nokia.com> 8 * Tony Lindgren <tony@atomide.com> and Imre Deak <imre.deak@nokia.com>
9 * Copyright (C) 2005 Nokia Corporation 9 * Copyright (C) 2005 Nokia Corporation
10 * 10 *
11 * Cleaned up by Juha Yrjölä <juha.yrjola@nokia.com> 11 * Cleaned up by Juha Yrjölä <juha.yrjola@nokia.com>
12 * 12 *
13 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by 14 * it under the terms of the GNU General Public License as published by
diff --git a/drivers/i2c/busses/i2c-parport-light.c b/drivers/i2c/busses/i2c-parport-light.c
index 49a95e2887b..c6faf9bdad1 100644
--- a/drivers/i2c/busses/i2c-parport-light.c
+++ b/drivers/i2c/busses/i2c-parport-light.c
@@ -7,7 +7,7 @@
7 Copyright (C) 1995-2000 Simon G. Vogl 7 Copyright (C) 1995-2000 Simon G. Vogl
8 With some changes from: 8 With some changes from:
9 Frodo Looijaard <frodol@dds.nl> 9 Frodo Looijaard <frodol@dds.nl>
10 Kyösti Mälkki <kmalkki@cc.hut.fi> 10 Kyösti Mälkki <kmalkki@cc.hut.fi>
11 11
12 This program is free software; you can redistribute it and/or modify 12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by 13 it under the terms of the GNU General Public License as published by
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c
index 039a07fde90..59ba2086d2f 100644
--- a/drivers/i2c/busses/i2c-parport.c
+++ b/drivers/i2c/busses/i2c-parport.c
@@ -7,7 +7,7 @@
7 Copyright (C) 1995-2000 Simon G. Vogl 7 Copyright (C) 1995-2000 Simon G. Vogl
8 With some changes from: 8 With some changes from:
9 Frodo Looijaard <frodol@dds.nl> 9 Frodo Looijaard <frodol@dds.nl>
10 Kyösti Mälkki <kmalkki@cc.hut.fi> 10 Kyösti Mälkki <kmalkki@cc.hut.fi>
11 11
12 This program is free software; you can redistribute it and/or modify 12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by 13 it under the terms of the GNU General Public License as published by
diff --git a/drivers/i2c/busses/i2c-via.c b/drivers/i2c/busses/i2c-via.c
index 81520868797..61716f6b14d 100644
--- a/drivers/i2c/busses/i2c-via.c
+++ b/drivers/i2c/busses/i2c-via.c
@@ -4,7 +4,7 @@
4 4
5 i2c Support for Via Technologies 82C586B South Bridge 5 i2c Support for Via Technologies 82C586B South Bridge
6 6
7 Copyright (c) 1998, 1999 Kyösti Mälkki <kmalkki@cc.hut.fi> 7 Copyright (c) 1998, 1999 Kyösti Mälkki <kmalkki@cc.hut.fi>
8 8
9 This program is free software; you can redistribute it and/or modify 9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by 10 it under the terms of the GNU General Public License as published by
@@ -176,7 +176,7 @@ static void __exit i2c_vt586b_exit(void)
176} 176}
177 177
178 178
179MODULE_AUTHOR("Kyösti Mälkki <kmalkki@cc.hut.fi>"); 179MODULE_AUTHOR("Kyösti Mälkki <kmalkki@cc.hut.fi>");
180MODULE_DESCRIPTION("i2c for Via vt82c586b southbridge"); 180MODULE_DESCRIPTION("i2c for Via vt82c586b southbridge");
181MODULE_LICENSE("GPL"); 181MODULE_LICENSE("GPL");
182 182
diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c
index edc275002f8..c9ce77f13c0 100644
--- a/drivers/i2c/busses/i2c-viapro.c
+++ b/drivers/i2c/busses/i2c-viapro.c
@@ -2,7 +2,7 @@
2 i2c-viapro.c - Part of lm_sensors, Linux kernel modules for hardware 2 i2c-viapro.c - Part of lm_sensors, Linux kernel modules for hardware
3 monitoring 3 monitoring
4 Copyright (c) 1998 - 2002 Frodo Looijaard <frodol@dds.nl>, 4 Copyright (c) 1998 - 2002 Frodo Looijaard <frodol@dds.nl>,
5 Philip Edelbrock <phil@netroedge.com>, Kyösti Mälkki <kmalkki@cc.hut.fi>, 5 Philip Edelbrock <phil@netroedge.com>, Kyösti Mälkki <kmalkki@cc.hut.fi>,
6 Mark D. Studebaker <mdsxyz123@yahoo.com> 6 Mark D. Studebaker <mdsxyz123@yahoo.com>
7 Copyright (C) 2005 - 2007 Jean Delvare <khali@linux-fr.org> 7 Copyright (C) 2005 - 2007 Jean Delvare <khali@linux-fr.org>
8 8
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index e73d58c43f3..1a4e8dc03b3 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -17,7 +17,7 @@
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ 17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
18/* ------------------------------------------------------------------------- */ 18/* ------------------------------------------------------------------------- */
19 19
20/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi>. 20/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi>.
21 All SMBus-related things are written by Frodo Looijaard <frodol@dds.nl> 21 All SMBus-related things are written by Frodo Looijaard <frodol@dds.nl>
22 SMBus 2.0 support by Mark Studebaker <mdsxyz123@yahoo.com> and 22 SMBus 2.0 support by Mark Studebaker <mdsxyz123@yahoo.com> and
23 Jean Delvare <khali@linux-fr.org> */ 23 Jean Delvare <khali@linux-fr.org> */
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 6d9fd92763f..6eaece96524 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -1056,6 +1056,9 @@ endif
1056config BLK_DEV_IDEDMA 1056config BLK_DEV_IDEDMA
1057 def_bool BLK_DEV_IDEDMA_PCI || BLK_DEV_IDEDMA_PMAC || BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 1057 def_bool BLK_DEV_IDEDMA_PCI || BLK_DEV_IDEDMA_PMAC || BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
1058 1058
1059config IDE_ARCH_OBSOLETE_INIT
1060 def_bool ALPHA || (ARM && !ARCH_L7200) || BLACKFIN || X86 || IA64 || M32R || MIPS || PARISC || PPC || (SUPERH64 && BLK_DEV_IDEPCI) || SPARC
1061
1059endif 1062endif
1060 1063
1061config BLK_DEV_HD_ONLY 1064config BLK_DEV_HD_ONLY
diff --git a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c
index f7449d04114..48db6167bb9 100644
--- a/drivers/ide/arm/bast-ide.c
+++ b/drivers/ide/arm/bast-ide.c
@@ -45,7 +45,7 @@ bastide_register(unsigned int base, unsigned int aux, int irq,
45 hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20); 45 hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20);
46 hw.irq = irq; 46 hw.irq = irq;
47 47
48 ide_register_hw(&hw, 0, hwif); 48 ide_register_hw(&hw, NULL, 0, hwif);
49 49
50 return 0; 50 return 0;
51} 51}
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index 3af33fbf1f8..410a0d13e35 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -316,27 +316,29 @@ static int icside_dma_end(ide_drive_t *drive)
316 316
317 drive->waiting_for_dma = 0; 317 drive->waiting_for_dma = 0;
318 318
319 disable_dma(hwif->hw.dma); 319 disable_dma(state->dev->dma);
320 320
321 /* Teardown mappings after DMA has completed. */ 321 /* Teardown mappings after DMA has completed. */
322 dma_unmap_sg(state->dev, hwif->sg_table, hwif->sg_nents, 322 dma_unmap_sg(state->dev, hwif->sg_table, hwif->sg_nents,
323 hwif->sg_dma_direction); 323 hwif->sg_dma_direction);
324 324
325 return get_dma_residue(hwif->hw.dma) != 0; 325 return get_dma_residue(state->dev->dma) != 0;
326} 326}
327 327
328static void icside_dma_start(ide_drive_t *drive) 328static void icside_dma_start(ide_drive_t *drive)
329{ 329{
330 ide_hwif_t *hwif = HWIF(drive); 330 ide_hwif_t *hwif = HWIF(drive);
331 struct icside_state *state = hwif->hwif_data;
331 332
332 /* We can not enable DMA on both channels simultaneously. */ 333 /* We can not enable DMA on both channels simultaneously. */
333 BUG_ON(dma_channel_active(hwif->hw.dma)); 334 BUG_ON(dma_channel_active(state->dev->dma));
334 enable_dma(hwif->hw.dma); 335 enable_dma(state->dev->dma);
335} 336}
336 337
337static int icside_dma_setup(ide_drive_t *drive) 338static int icside_dma_setup(ide_drive_t *drive)
338{ 339{
339 ide_hwif_t *hwif = HWIF(drive); 340 ide_hwif_t *hwif = HWIF(drive);
341 struct icside_state *state = hwif->hwif_data;
340 struct request *rq = hwif->hwgroup->rq; 342 struct request *rq = hwif->hwgroup->rq;
341 unsigned int dma_mode; 343 unsigned int dma_mode;
342 344
@@ -348,7 +350,7 @@ static int icside_dma_setup(ide_drive_t *drive)
348 /* 350 /*
349 * We can not enable DMA on both channels. 351 * We can not enable DMA on both channels.
350 */ 352 */
351 BUG_ON(dma_channel_active(hwif->hw.dma)); 353 BUG_ON(dma_channel_active(state->dev->dma));
352 354
353 icside_build_sglist(drive, rq); 355 icside_build_sglist(drive, rq);
354 356
@@ -365,14 +367,14 @@ static int icside_dma_setup(ide_drive_t *drive)
365 /* 367 /*
366 * Select the correct timing for this drive. 368 * Select the correct timing for this drive.
367 */ 369 */
368 set_dma_speed(hwif->hw.dma, drive->drive_data); 370 set_dma_speed(state->dev->dma, drive->drive_data);
369 371
370 /* 372 /*
371 * Tell the DMA engine about the SG table and 373 * Tell the DMA engine about the SG table and
372 * data direction. 374 * data direction.
373 */ 375 */
374 set_dma_sg(hwif->hw.dma, hwif->sg_table, hwif->sg_nents); 376 set_dma_sg(state->dev->dma, hwif->sg_table, hwif->sg_nents);
375 set_dma_mode(hwif->hw.dma, dma_mode); 377 set_dma_mode(state->dev->dma, dma_mode);
376 378
377 drive->waiting_for_dma = 1; 379 drive->waiting_for_dma = 1;
378 380
@@ -438,40 +440,16 @@ static void icside_dma_init(ide_hwif_t *hwif)
438#define icside_dma_init(hwif) (0) 440#define icside_dma_init(hwif) (0)
439#endif 441#endif
440 442
441static ide_hwif_t *icside_find_hwif(unsigned long dataport)
442{
443 ide_hwif_t *hwif;
444 int index;
445
446 for (index = 0; index < MAX_HWIFS; ++index) {
447 hwif = &ide_hwifs[index];
448 if (hwif->io_ports[IDE_DATA_OFFSET] == dataport)
449 goto found;
450 }
451
452 for (index = 0; index < MAX_HWIFS; ++index) {
453 hwif = &ide_hwifs[index];
454 if (!hwif->io_ports[IDE_DATA_OFFSET])
455 goto found;
456 }
457
458 hwif = NULL;
459found:
460 return hwif;
461}
462
463static ide_hwif_t * 443static ide_hwif_t *
464icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *ec) 444icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *ec)
465{ 445{
466 unsigned long port = (unsigned long)base + info->dataoffset; 446 unsigned long port = (unsigned long)base + info->dataoffset;
467 ide_hwif_t *hwif; 447 ide_hwif_t *hwif;
468 448
469 hwif = icside_find_hwif(port); 449 hwif = ide_find_port(port);
470 if (hwif) { 450 if (hwif) {
471 int i; 451 int i;
472 452
473 memset(&hwif->hw, 0, sizeof(hw_regs_t));
474
475 /* 453 /*
476 * Ensure we're using MMIO 454 * Ensure we're using MMIO
477 */ 455 */
@@ -479,13 +457,10 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e
479 hwif->mmio = 1; 457 hwif->mmio = 1;
480 458
481 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { 459 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
482 hwif->hw.io_ports[i] = port;
483 hwif->io_ports[i] = port; 460 hwif->io_ports[i] = port;
484 port += 1 << info->stepping; 461 port += 1 << info->stepping;
485 } 462 }
486 hwif->hw.io_ports[IDE_CONTROL_OFFSET] = (unsigned long)base + info->ctrloffset;
487 hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)base + info->ctrloffset; 463 hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)base + info->ctrloffset;
488 hwif->hw.irq = ec->irq;
489 hwif->irq = ec->irq; 464 hwif->irq = ec->irq;
490 hwif->noprobe = 0; 465 hwif->noprobe = 0;
491 hwif->chipset = ide_acorn; 466 hwif->chipset = ide_acorn;
@@ -500,6 +475,7 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
500{ 475{
501 ide_hwif_t *hwif; 476 ide_hwif_t *hwif;
502 void __iomem *base; 477 void __iomem *base;
478 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
503 479
504 base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0); 480 base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0);
505 if (!base) 481 if (!base)
@@ -523,9 +499,9 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
523 499
524 state->hwif[0] = hwif; 500 state->hwif[0] = hwif;
525 501
526 probe_hwif_init(hwif); 502 idx[0] = hwif->index;
527 503
528 ide_proc_register_port(hwif); 504 ide_device_add(idx);
529 505
530 return 0; 506 return 0;
531} 507}
@@ -537,6 +513,7 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
537 void __iomem *ioc_base, *easi_base; 513 void __iomem *ioc_base, *easi_base;
538 unsigned int sel = 0; 514 unsigned int sel = 0;
539 int ret; 515 int ret;
516 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
540 517
541 ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0); 518 ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
542 if (!ioc_base) { 519 if (!ioc_base) {
@@ -592,7 +569,6 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
592 hwif->serialized = 1; 569 hwif->serialized = 1;
593 hwif->config_data = (unsigned long)ioc_base; 570 hwif->config_data = (unsigned long)ioc_base;
594 hwif->select_data = sel; 571 hwif->select_data = sel;
595 hwif->hw.dma = ec->dma;
596 572
597 mate->maskproc = icside_maskproc; 573 mate->maskproc = icside_maskproc;
598 mate->channel = 1; 574 mate->channel = 1;
@@ -601,18 +577,16 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
601 mate->serialized = 1; 577 mate->serialized = 1;
602 mate->config_data = (unsigned long)ioc_base; 578 mate->config_data = (unsigned long)ioc_base;
603 mate->select_data = sel | 1; 579 mate->select_data = sel | 1;
604 mate->hw.dma = ec->dma;
605 580
606 if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) { 581 if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) {
607 icside_dma_init(hwif); 582 icside_dma_init(hwif);
608 icside_dma_init(mate); 583 icside_dma_init(mate);
609 } 584 }
610 585
611 probe_hwif_init(hwif); 586 idx[0] = hwif->index;
612 probe_hwif_init(mate); 587 idx[1] = mate->index;
613 588
614 ide_proc_register_port(hwif); 589 ide_device_add(idx);
615 ide_proc_register_port(mate);
616 590
617 return 0; 591 return 0;
618 592
diff --git a/drivers/ide/arm/ide_arm.c b/drivers/ide/arm/ide_arm.c
index bce2bec8141..8957cbadf5c 100644
--- a/drivers/ide/arm/ide_arm.c
+++ b/drivers/ide/arm/ide_arm.c
@@ -31,5 +31,5 @@ void __init ide_arm_init(void)
31 memset(&hw, 0, sizeof(hw)); 31 memset(&hw, 0, sizeof(hw));
32 ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206); 32 ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
33 hw.irq = IDE_ARM_IRQ; 33 hw.irq = IDE_ARM_IRQ;
34 ide_register_hw(&hw, 1, NULL); 34 ide_register_hw(&hw, NULL, 1, NULL);
35} 35}
diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c
index 83811af1161..0775a3afef4 100644
--- a/drivers/ide/arm/rapide.c
+++ b/drivers/ide/arm/rapide.c
@@ -13,42 +13,25 @@
13 13
14#include <asm/ecard.h> 14#include <asm/ecard.h>
15 15
16/*
17 * Something like this really should be in generic code, but isn't.
18 */
19static ide_hwif_t * 16static ide_hwif_t *
20rapide_locate_hwif(void __iomem *base, void __iomem *ctrl, unsigned int sz, int irq) 17rapide_locate_hwif(void __iomem *base, void __iomem *ctrl, unsigned int sz, int irq)
21{ 18{
22 unsigned long port = (unsigned long)base; 19 unsigned long port = (unsigned long)base;
23 ide_hwif_t *hwif; 20 ide_hwif_t *hwif = ide_find_port(port);
24 int index, i; 21 int i;
25
26 for (index = 0; index < MAX_HWIFS; ++index) {
27 hwif = ide_hwifs + index;
28 if (hwif->io_ports[IDE_DATA_OFFSET] == port)
29 goto found;
30 }
31
32 for (index = 0; index < MAX_HWIFS; ++index) {
33 hwif = ide_hwifs + index;
34 if (hwif->io_ports[IDE_DATA_OFFSET] == 0)
35 goto found;
36 }
37 22
38 return NULL; 23 if (hwif == NULL)
24 goto out;
39 25
40 found:
41 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { 26 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
42 hwif->hw.io_ports[i] = port;
43 hwif->io_ports[i] = port; 27 hwif->io_ports[i] = port;
44 port += sz; 28 port += sz;
45 } 29 }
46 hwif->hw.io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl;
47 hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl; 30 hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl;
48 hwif->hw.irq = hwif->irq = irq; 31 hwif->irq = irq;
49 hwif->mmio = 1; 32 hwif->mmio = 1;
50 default_hwif_mmiops(hwif); 33 default_hwif_mmiops(hwif);
51 34out:
52 return hwif; 35 return hwif;
53} 36}
54 37
@@ -58,6 +41,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
58 ide_hwif_t *hwif; 41 ide_hwif_t *hwif;
59 void __iomem *base; 42 void __iomem *base;
60 int ret; 43 int ret;
44 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
61 45
62 ret = ecard_request_resources(ec); 46 ret = ecard_request_resources(ec);
63 if (ret) 47 if (ret)
@@ -74,8 +58,11 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
74 hwif->hwif_data = base; 58 hwif->hwif_data = base;
75 hwif->gendev.parent = &ec->dev; 59 hwif->gendev.parent = &ec->dev;
76 hwif->noprobe = 0; 60 hwif->noprobe = 0;
77 probe_hwif_init(hwif); 61
78 ide_proc_register_port(hwif); 62 idx[0] = hwif->index;
63
64 ide_device_add(idx);
65
79 ecard_set_drvdata(ec, hwif); 66 ecard_set_drvdata(ec, hwif);
80 goto out; 67 goto out;
81 } 68 }
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index 9a96a10ba9d..ff20377b4c8 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -782,7 +782,7 @@ init_e100_ide (void)
782 ide_offsets, 782 ide_offsets,
783 0, 0, cris_ide_ack_intr, 783 0, 0, cris_ide_ack_intr,
784 ide_default_irq(0)); 784 ide_default_irq(0));
785 ide_register_hw(&hw, 1, &hwif); 785 ide_register_hw(&hw, NULL, 1, &hwif);
786 hwif->mmio = 1; 786 hwif->mmio = 1;
787 hwif->chipset = ide_etrax100; 787 hwif->chipset = ide_etrax100;
788 hwif->set_pio_mode = &cris_set_pio_mode; 788 hwif->set_pio_mode = &cris_set_pio_mode;
diff --git a/drivers/ide/h8300/ide-h8300.c b/drivers/ide/h8300/ide-h8300.c
index 6d26ad7360d..4a49b5c59ac 100644
--- a/drivers/ide/h8300/ide-h8300.c
+++ b/drivers/ide/h8300/ide-h8300.c
@@ -68,7 +68,6 @@ static inline void hw_setup(hw_regs_t *hw)
68 hw->io_ports[i] = CONFIG_H8300_IDE_BASE + H8300_IDE_GAP*i; 68 hw->io_ports[i] = CONFIG_H8300_IDE_BASE + H8300_IDE_GAP*i;
69 hw->io_ports[IDE_CONTROL_OFFSET] = CONFIG_H8300_IDE_ALT; 69 hw->io_ports[IDE_CONTROL_OFFSET] = CONFIG_H8300_IDE_ALT;
70 hw->irq = EXT_IRQ0 + CONFIG_H8300_IDE_IRQ; 70 hw->irq = EXT_IRQ0 + CONFIG_H8300_IDE_IRQ;
71 hw->dma = NO_DMA;
72 hw->chipset = ide_generic; 71 hw->chipset = ide_generic;
73} 72}
74 73
@@ -101,7 +100,7 @@ void __init h8300_ide_init(void)
101 hw_setup(&hw); 100 hw_setup(&hw);
102 101
103 /* register if */ 102 /* register if */
104 idx = ide_register_hw(&hw, 1, &hwif); 103 idx = ide_register_hw(&hw, NULL, 1, &hwif);
105 if (idx == -1) { 104 if (idx == -1) {
106 printk(KERN_ERR "ide-h8300: IDE I/F register failed\n"); 105 printk(KERN_ERR "ide-h8300: IDE I/F register failed\n");
107 return; 106 return;
diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c
index 1d5f6823101..89df48fdc69 100644
--- a/drivers/ide/ide-acpi.c
+++ b/drivers/ide/ide-acpi.c
@@ -350,7 +350,7 @@ static int taskfile_load_raw(ide_drive_t *drive,
350 350
351 memset(&args, 0, sizeof(ide_task_t)); 351 memset(&args, 0, sizeof(ide_task_t));
352 args.command_type = IDE_DRIVE_TASK_NO_DATA; 352 args.command_type = IDE_DRIVE_TASK_NO_DATA;
353 args.data_phase = TASKFILE_IN; 353 args.data_phase = TASKFILE_NO_DATA;
354 args.handler = &task_no_data_intr; 354 args.handler = &task_no_data_intr;
355 355
356 /* convert gtf to IDE Taskfile */ 356 /* convert gtf to IDE Taskfile */
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index ca843522f91..57a5f63d6ae 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -120,7 +120,7 @@
120 * Reformat to match kernel tabbing style. 120 * Reformat to match kernel tabbing style.
121 * Add CDROM_GET_UPC ioctl. 121 * Add CDROM_GET_UPC ioctl.
122 * 3.10 Apr 10, 1996 -- Fix compilation error with STANDARD_ATAPI. 122 * 3.10 Apr 10, 1996 -- Fix compilation error with STANDARD_ATAPI.
123 * 3.11 Apr 29, 1996 -- Patch from Heiko Eissfeldt <heiko@colossus.escape.de> 123 * 3.11 Apr 29, 1996 -- Patch from Heiko Eißfeldt <heiko@colossus.escape.de>
124 * to remove redundant verify_area calls. 124 * to remove redundant verify_area calls.
125 * 3.12 May 7, 1996 -- Rudimentary changer support. Based on patches 125 * 3.12 May 7, 1996 -- Rudimentary changer support. Based on patches
126 * from Gerhard Zuber <zuber@berlin.snafu.de>. 126 * from Gerhard Zuber <zuber@berlin.snafu.de>.
@@ -256,7 +256,7 @@
256 * - Minimize the TOC reading - only do it when we 256 * - Minimize the TOC reading - only do it when we
257 * know a media change has occurred. 257 * know a media change has occurred.
258 * - Moved all the CDROMREADx ioctls to the Uniform layer. 258 * - Moved all the CDROMREADx ioctls to the Uniform layer.
259 * - Heiko Eissfeldt <heiko@colossus.escape.de> supplied 259 * - Heiko Eißfeldt <heiko@colossus.escape.de> supplied
260 * some fixes for CDI. 260 * some fixes for CDI.
261 * - CD-ROM leaving door locked fix from Andries 261 * - CD-ROM leaving door locked fix from Andries
262 * Brouwer <Andries.Brouwer@cwi.nl> 262 * Brouwer <Andries.Brouwer@cwi.nl>
@@ -2341,7 +2341,7 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense)
2341 If we get an error for the regular case, we assume 2341 If we get an error for the regular case, we assume
2342 a CDI without additional audio tracks. In this case 2342 a CDI without additional audio tracks. In this case
2343 the readable TOC is empty (CDI tracks are not included) 2343 the readable TOC is empty (CDI tracks are not included)
2344 and only holds the Leadout entry. Heiko Eißfeldt */ 2344 and only holds the Leadout entry. Heiko Eißfeldt */
2345 ntracks = 0; 2345 ntracks = 0;
2346 stat = cdrom_read_tocentry(drive, CDROM_LEADOUT, 1, 0, 2346 stat = cdrom_read_tocentry(drive, CDROM_LEADOUT, 1, 0,
2347 (char *)&toc->hdr, 2347 (char *)&toc->hdr,
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 2722d9165b6..00123d99527 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -593,28 +593,12 @@ static int smart_enable(ide_drive_t *drive)
593 return ide_raw_taskfile(drive, &args, NULL); 593 return ide_raw_taskfile(drive, &args, NULL);
594} 594}
595 595
596static int get_smart_values(ide_drive_t *drive, u8 *buf) 596static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd)
597{ 597{
598 ide_task_t args; 598 ide_task_t args;
599 599
600 memset(&args, 0, sizeof(ide_task_t)); 600 memset(&args, 0, sizeof(ide_task_t));
601 args.tfRegister[IDE_FEATURE_OFFSET] = SMART_READ_VALUES; 601 args.tfRegister[IDE_FEATURE_OFFSET] = sub_cmd;
602 args.tfRegister[IDE_NSECTOR_OFFSET] = 0x01;
603 args.tfRegister[IDE_LCYL_OFFSET] = SMART_LCYL_PASS;
604 args.tfRegister[IDE_HCYL_OFFSET] = SMART_HCYL_PASS;
605 args.tfRegister[IDE_COMMAND_OFFSET] = WIN_SMART;
606 args.command_type = IDE_DRIVE_TASK_IN;
607 args.data_phase = TASKFILE_IN;
608 args.handler = &task_in_intr;
609 (void) smart_enable(drive);
610 return ide_raw_taskfile(drive, &args, buf);
611}
612
613static int get_smart_thresholds(ide_drive_t *drive, u8 *buf)
614{
615 ide_task_t args;
616 memset(&args, 0, sizeof(ide_task_t));
617 args.tfRegister[IDE_FEATURE_OFFSET] = SMART_READ_THRESHOLDS;
618 args.tfRegister[IDE_NSECTOR_OFFSET] = 0x01; 602 args.tfRegister[IDE_NSECTOR_OFFSET] = 0x01;
619 args.tfRegister[IDE_LCYL_OFFSET] = SMART_LCYL_PASS; 603 args.tfRegister[IDE_LCYL_OFFSET] = SMART_LCYL_PASS;
620 args.tfRegister[IDE_HCYL_OFFSET] = SMART_HCYL_PASS; 604 args.tfRegister[IDE_HCYL_OFFSET] = SMART_HCYL_PASS;
@@ -656,7 +640,7 @@ static int proc_idedisk_read_smart_thresholds
656 ide_drive_t *drive = (ide_drive_t *)data; 640 ide_drive_t *drive = (ide_drive_t *)data;
657 int len = 0, i = 0; 641 int len = 0, i = 0;
658 642
659 if (!get_smart_thresholds(drive, page)) { 643 if (get_smart_data(drive, page, SMART_READ_THRESHOLDS) == 0) {
660 unsigned short *val = (unsigned short *) page; 644 unsigned short *val = (unsigned short *) page;
661 char *out = ((char *)val) + (SECTOR_WORDS * 4); 645 char *out = ((char *)val) + (SECTOR_WORDS * 4);
662 page = out; 646 page = out;
@@ -675,7 +659,7 @@ static int proc_idedisk_read_smart_values
675 ide_drive_t *drive = (ide_drive_t *)data; 659 ide_drive_t *drive = (ide_drive_t *)data;
676 int len = 0, i = 0; 660 int len = 0, i = 0;
677 661
678 if (!get_smart_values(drive, page)) { 662 if (get_smart_data(drive, page, SMART_READ_VALUES) == 0) {
679 unsigned short *val = (unsigned short *) page; 663 unsigned short *val = (unsigned short *) page;
680 char *out = ((char *)val) + (SECTOR_WORDS * 4); 664 char *out = ((char *)val) + (SECTOR_WORDS * 4);
681 page = out; 665 page = out;
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 80b4f17f394..428f7a8a00b 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -901,10 +901,7 @@ void ide_dma_timeout (ide_drive_t *drive)
901 901
902EXPORT_SYMBOL(ide_dma_timeout); 902EXPORT_SYMBOL(ide_dma_timeout);
903 903
904/* 904static void ide_release_dma_engine(ide_hwif_t *hwif)
905 * Needed for allowing full modular support of ide-driver
906 */
907static int ide_release_dma_engine(ide_hwif_t *hwif)
908{ 905{
909 if (hwif->dmatable_cpu) { 906 if (hwif->dmatable_cpu) {
910 pci_free_consistent(hwif->pci_dev, 907 pci_free_consistent(hwif->pci_dev,
@@ -913,7 +910,6 @@ static int ide_release_dma_engine(ide_hwif_t *hwif)
913 hwif->dmatable_dma); 910 hwif->dmatable_dma);
914 hwif->dmatable_cpu = NULL; 911 hwif->dmatable_cpu = NULL;
915 } 912 }
916 return 1;
917} 913}
918 914
919static int ide_release_iomio_dma(ide_hwif_t *hwif) 915static int ide_release_iomio_dma(ide_hwif_t *hwif)
@@ -956,12 +952,6 @@ static int ide_mapped_mmio_dma(ide_hwif_t *hwif, unsigned long base, unsigned in
956{ 952{
957 printk(KERN_INFO " %s: MMIO-DMA ", hwif->name); 953 printk(KERN_INFO " %s: MMIO-DMA ", hwif->name);
958 954
959 hwif->dma_base = base;
960
961 if(hwif->mate)
962 hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base : base;
963 else
964 hwif->dma_master = base;
965 return 0; 955 return 0;
966} 956}
967 957
@@ -975,8 +965,6 @@ static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base, unsigned int port
975 return 1; 965 return 1;
976 } 966 }
977 967
978 hwif->dma_base = base;
979
980 if (hwif->cds->extra) { 968 if (hwif->cds->extra) {
981 hwif->extra_base = base + (hwif->channel ? 8 : 16); 969 hwif->extra_base = base + (hwif->channel ? 8 : 16);
982 970
@@ -991,10 +979,6 @@ static int ide_iomio_dma(ide_hwif_t *hwif, unsigned long base, unsigned int port
991 } 979 }
992 } 980 }
993 981
994 if(hwif->mate)
995 hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base:base;
996 else
997 hwif->dma_master = base;
998 return 0; 982 return 0;
999} 983}
1000 984
@@ -1006,12 +990,9 @@ static int ide_dma_iobase(ide_hwif_t *hwif, unsigned long base, unsigned int por
1006 return ide_iomio_dma(hwif, base, ports); 990 return ide_iomio_dma(hwif, base, ports);
1007} 991}
1008 992
1009/* 993void ide_setup_dma(ide_hwif_t *hwif, unsigned long base, unsigned num_ports)
1010 * This can be called for a dynamically installed interface. Don't __init it
1011 */
1012void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_ports)
1013{ 994{
1014 if (ide_dma_iobase(hwif, dma_base, num_ports)) 995 if (ide_dma_iobase(hwif, base, num_ports))
1015 return; 996 return;
1016 997
1017 if (ide_allocate_dma_engine(hwif)) { 998 if (ide_allocate_dma_engine(hwif)) {
@@ -1019,6 +1000,13 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
1019 return; 1000 return;
1020 } 1001 }
1021 1002
1003 hwif->dma_base = base;
1004
1005 if (hwif->mate)
1006 hwif->dma_master = hwif->channel ? hwif->mate->dma_base : base;
1007 else
1008 hwif->dma_master = base;
1009
1022 if (!(hwif->dma_command)) 1010 if (!(hwif->dma_command))
1023 hwif->dma_command = hwif->dma_base; 1011 hwif->dma_command = hwif->dma_base;
1024 if (!(hwif->dma_vendor1)) 1012 if (!(hwif->dma_vendor1))
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 32eaa3f8051..c89f0d3058e 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -55,7 +55,7 @@
55#include <asm/io.h> 55#include <asm/io.h>
56 56
57static int __ide_end_request(ide_drive_t *drive, struct request *rq, 57static int __ide_end_request(ide_drive_t *drive, struct request *rq,
58 int uptodate, unsigned int nr_bytes) 58 int uptodate, unsigned int nr_bytes, int dequeue)
59{ 59{
60 int ret = 1; 60 int ret = 1;
61 61
@@ -80,9 +80,11 @@ static int __ide_end_request(ide_drive_t *drive, struct request *rq,
80 80
81 if (!end_that_request_chunk(rq, uptodate, nr_bytes)) { 81 if (!end_that_request_chunk(rq, uptodate, nr_bytes)) {
82 add_disk_randomness(rq->rq_disk); 82 add_disk_randomness(rq->rq_disk);
83 if (!list_empty(&rq->queuelist)) 83 if (dequeue) {
84 blkdev_dequeue_request(rq); 84 if (!list_empty(&rq->queuelist))
85 HWGROUP(drive)->rq = NULL; 85 blkdev_dequeue_request(rq);
86 HWGROUP(drive)->rq = NULL;
87 }
86 end_that_request_last(rq, uptodate); 88 end_that_request_last(rq, uptodate);
87 ret = 0; 89 ret = 0;
88 } 90 }
@@ -122,7 +124,7 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors)
122 nr_bytes = rq->hard_cur_sectors << 9; 124 nr_bytes = rq->hard_cur_sectors << 9;
123 } 125 }
124 126
125 ret = __ide_end_request(drive, rq, uptodate, nr_bytes); 127 ret = __ide_end_request(drive, rq, uptodate, nr_bytes, 1);
126 128
127 spin_unlock_irqrestore(&ide_lock, flags); 129 spin_unlock_irqrestore(&ide_lock, flags);
128 return ret; 130 return ret;
@@ -255,39 +257,13 @@ int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq,
255 int uptodate, int nr_sectors) 257 int uptodate, int nr_sectors)
256{ 258{
257 unsigned long flags; 259 unsigned long flags;
258 int ret = 1; 260 int ret;
259 261
260 spin_lock_irqsave(&ide_lock, flags); 262 spin_lock_irqsave(&ide_lock, flags);
261
262 BUG_ON(!blk_rq_started(rq)); 263 BUG_ON(!blk_rq_started(rq));
263 264 ret = __ide_end_request(drive, rq, uptodate, nr_sectors << 9, 0);
264 /*
265 * if failfast is set on a request, override number of sectors and
266 * complete the whole request right now
267 */
268 if (blk_noretry_request(rq) && end_io_error(uptodate))
269 nr_sectors = rq->hard_nr_sectors;
270
271 if (!blk_fs_request(rq) && end_io_error(uptodate) && !rq->errors)
272 rq->errors = -EIO;
273
274 /*
275 * decide whether to reenable DMA -- 3 is a random magic for now,
276 * if we DMA timeout more than 3 times, just stay in PIO
277 */
278 if (drive->state == DMA_PIO_RETRY && drive->retry_pio <= 3) {
279 drive->state = 0;
280 HWGROUP(drive)->hwif->ide_dma_on(drive);
281 }
282
283 if (!end_that_request_first(rq, uptodate, nr_sectors)) {
284 add_disk_randomness(rq->rq_disk);
285 if (blk_rq_tagged(rq))
286 blk_queue_end_tag(drive->queue, rq);
287 end_that_request_last(rq, uptodate);
288 ret = 0;
289 }
290 spin_unlock_irqrestore(&ide_lock, flags); 265 spin_unlock_irqrestore(&ide_lock, flags);
266
291 return ret; 267 return ret;
292} 268}
293EXPORT_SYMBOL_GPL(ide_end_dequeued_request); 269EXPORT_SYMBOL_GPL(ide_end_dequeued_request);
@@ -800,7 +776,20 @@ static ide_startstop_t do_special (ide_drive_t *drive)
800 s->b.set_tune = 0; 776 s->b.set_tune = 0;
801 777
802 if (set_pio_mode_abuse(drive->hwif, req_pio)) { 778 if (set_pio_mode_abuse(drive->hwif, req_pio)) {
803 if (hwif->set_pio_mode) 779
780 if (hwif->set_pio_mode == NULL)
781 return ide_stopped;
782
783 /*
784 * take ide_lock for drive->[no_]unmask/[no_]io_32bit
785 */
786 if (req_pio == 8 || req_pio == 9) {
787 unsigned long flags;
788
789 spin_lock_irqsave(&ide_lock, flags);
790 hwif->set_pio_mode(drive, req_pio);
791 spin_unlock_irqrestore(&ide_lock, flags);
792 } else
804 hwif->set_pio_mode(drive, req_pio); 793 hwif->set_pio_mode(drive, req_pio);
805 } else { 794 } else {
806 int keep_dma = drive->using_dma; 795 int keep_dma = drive->using_dma;
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index d4d790f91f9..95168833d06 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -693,35 +693,16 @@ static u8 ide_auto_reduce_xfer (ide_drive_t *drive)
693} 693}
694#endif /* CONFIG_BLK_DEV_IDEDMA */ 694#endif /* CONFIG_BLK_DEV_IDEDMA */
695 695
696/* 696int ide_driveid_update(ide_drive_t *drive)
697 * Update the
698 */
699int ide_driveid_update (ide_drive_t *drive)
700{ 697{
701 ide_hwif_t *hwif = HWIF(drive); 698 ide_hwif_t *hwif = drive->hwif;
702 struct hd_driveid *id; 699 struct hd_driveid *id;
703#if 0 700 unsigned long timeout, flags;
704 id = kmalloc(SECTOR_WORDS*4, GFP_ATOMIC);
705 if (!id)
706 return 0;
707
708 taskfile_lib_get_identify(drive, (char *)&id);
709 701
710 ide_fix_driveid(id);
711 if (id) {
712 drive->id->dma_ultra = id->dma_ultra;
713 drive->id->dma_mword = id->dma_mword;
714 drive->id->dma_1word = id->dma_1word;
715 /* anything more ? */
716 kfree(id);
717 }
718 return 1;
719#else
720 /* 702 /*
721 * Re-read drive->id for possible DMA mode 703 * Re-read drive->id for possible DMA mode
722 * change (copied from ide-probe.c) 704 * change (copied from ide-probe.c)
723 */ 705 */
724 unsigned long timeout, flags;
725 706
726 SELECT_MASK(drive, 1); 707 SELECT_MASK(drive, 1);
727 if (IDE_CONTROL_REG) 708 if (IDE_CONTROL_REG)
@@ -763,7 +744,6 @@ int ide_driveid_update (ide_drive_t *drive)
763 } 744 }
764 745
765 return 1; 746 return 1;
766#endif
767} 747}
768 748
769int ide_config_drive_speed(ide_drive_t *drive, u8 speed) 749int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c
index 2b8009c50e9..e245521af7b 100644
--- a/drivers/ide/ide-pnp.c
+++ b/drivers/ide/ide-pnp.c
@@ -40,9 +40,8 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id
40 ide_std_init_ports(&hw, pnp_port_start(dev, 0), 40 ide_std_init_ports(&hw, pnp_port_start(dev, 0),
41 pnp_port_start(dev, 1)); 41 pnp_port_start(dev, 1));
42 hw.irq = pnp_irq(dev, 0); 42 hw.irq = pnp_irq(dev, 0);
43 hw.dma = NO_DMA;
44 43
45 index = ide_register_hw(&hw, 1, &hwif); 44 index = ide_register_hw(&hw, NULL, 1, &hwif);
46 45
47 if (index != -1) { 46 if (index != -1) {
48 printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index); 47 printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index);
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index e294c7415c2..d5146c57e5b 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -717,7 +717,7 @@ EXPORT_SYMBOL_GPL(ide_undecoded_slave);
717 * This routine only knows how to look for drive units 0 and 1 717 * This routine only knows how to look for drive units 0 and 1
718 * on an interface, so any setting of MAX_DRIVES > 2 won't work here. 718 * on an interface, so any setting of MAX_DRIVES > 2 won't work here.
719 */ 719 */
720static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)) 720static void probe_hwif(ide_hwif_t *hwif)
721{ 721{
722 unsigned long flags; 722 unsigned long flags;
723 unsigned int irqd; 723 unsigned int irqd;
@@ -819,8 +819,8 @@ static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
819 return; 819 return;
820 } 820 }
821 821
822 if (fixup) 822 if (hwif->fixup)
823 fixup(hwif); 823 hwif->fixup(hwif);
824 824
825 for (unit = 0; unit < MAX_DRIVES; ++unit) { 825 for (unit = 0; unit < MAX_DRIVES; ++unit) {
826 ide_drive_t *drive = &hwif->drives[unit]; 826 ide_drive_t *drive = &hwif->drives[unit];
@@ -859,10 +859,11 @@ static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
859} 859}
860 860
861static int hwif_init(ide_hwif_t *hwif); 861static int hwif_init(ide_hwif_t *hwif);
862static void hwif_register_devices(ide_hwif_t *hwif);
862 863
863int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)) 864static int probe_hwif_init(ide_hwif_t *hwif)
864{ 865{
865 probe_hwif(hwif, fixup); 866 probe_hwif(hwif);
866 867
867 if (!hwif_init(hwif)) { 868 if (!hwif_init(hwif)) {
868 printk(KERN_INFO "%s: failed to initialize IDE interface\n", 869 printk(KERN_INFO "%s: failed to initialize IDE interface\n",
@@ -870,34 +871,12 @@ int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)
870 return -1; 871 return -1;
871 } 872 }
872 873
873 if (hwif->present) { 874 if (hwif->present)
874 u16 unit = 0; 875 hwif_register_devices(hwif);
875 int ret;
876 876
877 for (unit = 0; unit < MAX_DRIVES; ++unit) {
878 ide_drive_t *drive = &hwif->drives[unit];
879 /* For now don't attach absent drives, we may
880 want them on default or a new "empty" class
881 for hotplug reprobing ? */
882 if (drive->present) {
883 ret = device_register(&drive->gendev);
884 if (ret < 0)
885 printk(KERN_WARNING "IDE: %s: "
886 "device_register error: %d\n",
887 __FUNCTION__, ret);
888 }
889 }
890 }
891 return 0; 877 return 0;
892} 878}
893 879
894int probe_hwif_init(ide_hwif_t *hwif)
895{
896 return probe_hwif_init_with_fixup(hwif, NULL);
897}
898
899EXPORT_SYMBOL(probe_hwif_init);
900
901#if MAX_HWIFS > 1 880#if MAX_HWIFS > 1
902/* 881/*
903 * save_match() is used to simplify logic in init_irq() below. 882 * save_match() is used to simplify logic in init_irq() below.
@@ -1379,6 +1358,24 @@ out:
1379 return 0; 1358 return 0;
1380} 1359}
1381 1360
1361static void hwif_register_devices(ide_hwif_t *hwif)
1362{
1363 unsigned int i;
1364
1365 for (i = 0; i < MAX_DRIVES; i++) {
1366 ide_drive_t *drive = &hwif->drives[i];
1367
1368 if (drive->present) {
1369 int ret = device_register(&drive->gendev);
1370
1371 if (ret < 0)
1372 printk(KERN_WARNING "IDE: %s: "
1373 "device_register error: %d\n",
1374 __FUNCTION__, ret);
1375 }
1376 }
1377}
1378
1382int ideprobe_init (void) 1379int ideprobe_init (void)
1383{ 1380{
1384 unsigned int index; 1381 unsigned int index;
@@ -1390,27 +1387,18 @@ int ideprobe_init (void)
1390 1387
1391 for (index = 0; index < MAX_HWIFS; ++index) 1388 for (index = 0; index < MAX_HWIFS; ++index)
1392 if (probe[index]) 1389 if (probe[index])
1393 probe_hwif(&ide_hwifs[index], NULL); 1390 probe_hwif(&ide_hwifs[index]);
1394 for (index = 0; index < MAX_HWIFS; ++index) 1391 for (index = 0; index < MAX_HWIFS; ++index)
1395 if (probe[index]) 1392 if (probe[index])
1396 hwif_init(&ide_hwifs[index]); 1393 hwif_init(&ide_hwifs[index]);
1397 for (index = 0; index < MAX_HWIFS; ++index) { 1394 for (index = 0; index < MAX_HWIFS; ++index) {
1398 if (probe[index]) { 1395 if (probe[index]) {
1399 ide_hwif_t *hwif = &ide_hwifs[index]; 1396 ide_hwif_t *hwif = &ide_hwifs[index];
1400 int unit;
1401 if (!hwif->present) 1397 if (!hwif->present)
1402 continue; 1398 continue;
1403 if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced) 1399 if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced)
1404 hwif->chipset = ide_generic; 1400 hwif->chipset = ide_generic;
1405 for (unit = 0; unit < MAX_DRIVES; ++unit) 1401 hwif_register_devices(hwif);
1406 if (hwif->drives[unit].present) {
1407 int ret = device_register(
1408 &hwif->drives[unit].gendev);
1409 if (ret < 0)
1410 printk(KERN_WARNING "IDE: %s: "
1411 "device_register error: %d\n",
1412 __FUNCTION__, ret);
1413 }
1414 } 1402 }
1415 } 1403 }
1416 for (index = 0; index < MAX_HWIFS; ++index) 1404 for (index = 0; index < MAX_HWIFS; ++index)
@@ -1420,3 +1408,22 @@ int ideprobe_init (void)
1420} 1408}
1421 1409
1422EXPORT_SYMBOL_GPL(ideprobe_init); 1410EXPORT_SYMBOL_GPL(ideprobe_init);
1411
1412int ide_device_add(u8 idx[4])
1413{
1414 int i, rc = 0;
1415
1416 for (i = 0; i < 4; i++) {
1417 if (idx[i] != 0xff)
1418 rc |= probe_hwif_init(&ide_hwifs[idx[i]]);
1419 }
1420
1421 for (i = 0; i < 4; i++) {
1422 if (idx[i] != 0xff)
1423 ide_proc_register_port(&ide_hwifs[idx[i]]);
1424 }
1425
1426 return rc;
1427}
1428
1429EXPORT_SYMBOL_GPL(ide_device_add);
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
index fc1d8ae6a80..a4007d30da5 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -804,8 +804,6 @@ void ide_proc_register_port(ide_hwif_t *hwif)
804 create_proc_ide_drives(hwif); 804 create_proc_ide_drives(hwif);
805} 805}
806 806
807EXPORT_SYMBOL_GPL(ide_proc_register_port);
808
809#ifdef CONFIG_BLK_DEV_IDEPCI 807#ifdef CONFIG_BLK_DEV_IDEPCI
810void ide_pci_create_host_proc(const char *name, get_info_t *get_info) 808void ide_pci_create_host_proc(const char *name, get_info_t *get_info)
811{ 809{
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 1fa57947bca..7b9181b5469 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -565,7 +565,7 @@ typedef struct os_dat_s {
565 * The following parameter is used to select the point in the internal 565 * The following parameter is used to select the point in the internal
566 * tape fifo in which we will start to refill the buffer. Decreasing 566 * tape fifo in which we will start to refill the buffer. Decreasing
567 * the following parameter will improve the system's latency and 567 * the following parameter will improve the system's latency and
568 * interactive response, while using a high value might improve sytem 568 * interactive response, while using a high value might improve system
569 * throughput. 569 * throughput.
570 */ 570 */
571#define IDETAPE_FIFO_THRESHOLD 2 571#define IDETAPE_FIFO_THRESHOLD 2
@@ -621,7 +621,6 @@ typedef struct os_dat_s {
621 */ 621 */
622#define USE_IOTRACE 0 622#define USE_IOTRACE 0
623#if USE_IOTRACE 623#if USE_IOTRACE
624#include <linux/io_trace.h>
625#define IO_IDETAPE_FIFO 500 624#define IO_IDETAPE_FIFO 500
626#endif 625#endif
627 626
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 2a3c8d49834..73ef6bf5fbc 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -8,23 +8,6 @@
8 * Copyright (C) 2003-2004 Bartlomiej Zolnierkiewicz 8 * Copyright (C) 2003-2004 Bartlomiej Zolnierkiewicz
9 * 9 *
10 * The big the bad and the ugly. 10 * The big the bad and the ugly.
11 *
12 * Problems to be fixed because of BH interface or the lack therefore.
13 *
14 * Fill me in stupid !!!
15 *
16 * HOST:
17 * General refers to the Controller and Driver "pair".
18 * DATA HANDLER:
19 * Under the context of Linux it generally refers to an interrupt handler.
20 * However, it correctly describes the 'HOST'
21 * DATA BLOCK:
22 * The amount of data needed to be transfered as predefined in the
23 * setup of the device.
24 * STORAGE ATOMIC:
25 * The 'DATA BLOCK' associated to the 'DATA HANDLER', and can be as
26 * small as a single sector or as large as the entire command block
27 * request.
28 */ 11 */
29 12
30#include <linux/module.h> 13#include <linux/module.h>
@@ -695,9 +678,6 @@ int ide_wait_cmd (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 sectors,
695 return ide_do_drive_cmd(drive, &rq, ide_wait); 678 return ide_do_drive_cmd(drive, &rq, ide_wait);
696} 679}
697 680
698/*
699 * FIXME : this needs to map into at taskfile. <andre@linux-ide.org>
700 */
701int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) 681int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
702{ 682{
703 int err = 0; 683 int err = 0;
@@ -761,9 +741,6 @@ static int ide_wait_cmd_task(ide_drive_t *drive, u8 *buf)
761 return ide_do_drive_cmd(drive, &rq, ide_wait); 741 return ide_do_drive_cmd(drive, &rq, ide_wait);
762} 742}
763 743
764/*
765 * FIXME : this needs to map into at taskfile. <andre@linux-ide.org>
766 */
767int ide_task_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) 744int ide_task_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
768{ 745{
769 void __user *p = (void __user *)arg; 746 void __user *p = (void __user *)arg;
@@ -860,9 +837,14 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task)
860 case TASKFILE_OUT_DMA: 837 case TASKFILE_OUT_DMA:
861 case TASKFILE_IN_DMAQ: 838 case TASKFILE_IN_DMAQ:
862 case TASKFILE_IN_DMA: 839 case TASKFILE_IN_DMA:
863 hwif->dma_setup(drive); 840 if (!drive->using_dma)
864 hwif->dma_exec_cmd(drive, taskfile->command); 841 break;
865 hwif->dma_start(drive); 842
843 if (!hwif->dma_setup(drive)) {
844 hwif->dma_exec_cmd(drive, taskfile->command);
845 hwif->dma_start(drive);
846 return ide_started;
847 }
866 break; 848 break;
867 849
868 default: 850 default:
@@ -876,7 +858,8 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task)
876 return task->prehandler(drive, task->rq); 858 return task->prehandler(drive, task->rq);
877 } 859 }
878 ide_execute_command(drive, taskfile->command, task->handler, WAIT_WORSTCASE, NULL); 860 ide_execute_command(drive, taskfile->command, task->handler, WAIT_WORSTCASE, NULL);
861 return ide_started;
879 } 862 }
880 863
881 return ide_started; 864 return ide_stopped;
882} 865}
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 961e6c89728..674a65c1a13 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -168,7 +168,6 @@ static void init_hwif_default(ide_hwif_t *hwif, unsigned int index)
168 168
169 ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, &hwif->irq); 169 ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, &hwif->irq);
170 170
171 memcpy(&hwif->hw, &hw, sizeof(hw));
172 memcpy(hwif->io_ports, hw.io_ports, sizeof(hw.io_ports)); 171 memcpy(hwif->io_ports, hw.io_ports, sizeof(hw.io_ports));
173 172
174 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; 173 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
@@ -214,7 +213,7 @@ static void __init init_ide_data (void)
214 init_hwif_data(hwif, index); 213 init_hwif_data(hwif, index);
215 init_hwif_default(hwif, index); 214 init_hwif_default(hwif, index);
216#if !defined(CONFIG_PPC32) || !defined(CONFIG_PCI) 215#if !defined(CONFIG_PPC32) || !defined(CONFIG_PCI)
217 hwif->irq = hwif->hw.irq = 216 hwif->irq =
218 ide_init_default_irq(hwif->io_ports[IDE_DATA_OFFSET]); 217 ide_init_default_irq(hwif->io_ports[IDE_DATA_OFFSET]);
219#endif 218#endif
220 } 219 }
@@ -265,6 +264,30 @@ static int ide_system_bus_speed(void)
265 return system_bus_speed; 264 return system_bus_speed;
266} 265}
267 266
267ide_hwif_t * ide_find_port(unsigned long base)
268{
269 ide_hwif_t *hwif;
270 int i;
271
272 for (i = 0; i < MAX_HWIFS; i++) {
273 hwif = &ide_hwifs[i];
274 if (hwif->io_ports[IDE_DATA_OFFSET] == base)
275 goto found;
276 }
277
278 for (i = 0; i < MAX_HWIFS; i++) {
279 hwif = &ide_hwifs[i];
280 if (hwif->io_ports[IDE_DATA_OFFSET] == 0)
281 goto found;
282 }
283
284 hwif = NULL;
285found:
286 return hwif;
287}
288
289EXPORT_SYMBOL_GPL(ide_find_port);
290
268static struct resource* hwif_request_region(ide_hwif_t *hwif, 291static struct resource* hwif_request_region(ide_hwif_t *hwif,
269 unsigned long addr, int num) 292 unsigned long addr, int num)
270{ 293{
@@ -391,6 +414,8 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
391 hwif->cds = tmp_hwif->cds; 414 hwif->cds = tmp_hwif->cds;
392#endif 415#endif
393 416
417 hwif->fixup = tmp_hwif->fixup;
418
394 hwif->set_pio_mode = tmp_hwif->set_pio_mode; 419 hwif->set_pio_mode = tmp_hwif->set_pio_mode;
395 hwif->set_dma_mode = tmp_hwif->set_dma_mode; 420 hwif->set_dma_mode = tmp_hwif->set_dma_mode;
396 hwif->mdma_filter = tmp_hwif->mdma_filter; 421 hwif->mdma_filter = tmp_hwif->mdma_filter;
@@ -652,7 +677,6 @@ void ide_setup_ports ( hw_regs_t *hw,
652 } 677 }
653 } 678 }
654 hw->irq = irq; 679 hw->irq = irq;
655 hw->dma = NO_DMA;
656 hw->ack_intr = ack_intr; 680 hw->ack_intr = ack_intr;
657/* 681/*
658 * hw->iops = iops; 682 * hw->iops = iops;
@@ -660,11 +684,11 @@ void ide_setup_ports ( hw_regs_t *hw,
660} 684}
661 685
662/** 686/**
663 * ide_register_hw_with_fixup - register IDE interface 687 * ide_register_hw - register IDE interface
664 * @hw: hardware registers 688 * @hw: hardware registers
689 * @fixup: fixup function
665 * @initializing: set while initializing built-in drivers 690 * @initializing: set while initializing built-in drivers
666 * @hwifp: pointer to returned hwif 691 * @hwifp: pointer to returned hwif
667 * @fixup: fixup function
668 * 692 *
669 * Register an IDE interface, specifying exactly the registers etc. 693 * Register an IDE interface, specifying exactly the registers etc.
670 * Set init=1 iff calling before probes have taken place. 694 * Set init=1 iff calling before probes have taken place.
@@ -672,9 +696,8 @@ void ide_setup_ports ( hw_regs_t *hw,
672 * Returns -1 on error. 696 * Returns -1 on error.
673 */ 697 */
674 698
675int ide_register_hw_with_fixup(hw_regs_t *hw, int initializing, 699int ide_register_hw(hw_regs_t *hw, void (*fixup)(ide_hwif_t *),
676 ide_hwif_t **hwifp, 700 int initializing, ide_hwif_t **hwifp)
677 void(*fixup)(ide_hwif_t *hwif))
678{ 701{
679 int index, retry = 1; 702 int index, retry = 1;
680 ide_hwif_t *hwif; 703 ide_hwif_t *hwif;
@@ -682,7 +705,7 @@ int ide_register_hw_with_fixup(hw_regs_t *hw, int initializing,
682 do { 705 do {
683 for (index = 0; index < MAX_HWIFS; ++index) { 706 for (index = 0; index < MAX_HWIFS; ++index) {
684 hwif = &ide_hwifs[index]; 707 hwif = &ide_hwifs[index];
685 if (hwif->hw.io_ports[IDE_DATA_OFFSET] == hw->io_ports[IDE_DATA_OFFSET]) 708 if (hwif->io_ports[IDE_DATA_OFFSET] == hw->io_ports[IDE_DATA_OFFSET])
686 goto found; 709 goto found;
687 } 710 }
688 for (index = 0; index < MAX_HWIFS; ++index) { 711 for (index = 0; index < MAX_HWIFS; ++index) {
@@ -690,7 +713,7 @@ int ide_register_hw_with_fixup(hw_regs_t *hw, int initializing,
690 if (hwif->hold) 713 if (hwif->hold)
691 continue; 714 continue;
692 if ((!hwif->present && !hwif->mate && !initializing) || 715 if ((!hwif->present && !hwif->mate && !initializing) ||
693 (!hwif->hw.io_ports[IDE_DATA_OFFSET] && initializing)) 716 (!hwif->io_ports[IDE_DATA_OFFSET] && initializing))
694 goto found; 717 goto found;
695 } 718 }
696 for (index = 0; index < MAX_HWIFS; index++) 719 for (index = 0; index < MAX_HWIFS; index++)
@@ -706,16 +729,18 @@ found:
706 } 729 }
707 if (hwif->present) 730 if (hwif->present)
708 return -1; 731 return -1;
709 memcpy(&hwif->hw, hw, sizeof(*hw)); 732 memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports));
710 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports));
711 hwif->irq = hw->irq; 733 hwif->irq = hw->irq;
712 hwif->noprobe = 0; 734 hwif->noprobe = 0;
735 hwif->fixup = fixup;
713 hwif->chipset = hw->chipset; 736 hwif->chipset = hw->chipset;
714 hwif->gendev.parent = hw->dev; 737 hwif->gendev.parent = hw->dev;
738 hwif->ack_intr = hw->ack_intr;
739
740 if (initializing == 0) {
741 u8 idx[4] = { index, 0xff, 0xff, 0xff };
715 742
716 if (!initializing) { 743 ide_device_add(idx);
717 probe_hwif_init_with_fixup(hwif, fixup);
718 ide_proc_register_port(hwif);
719 } 744 }
720 745
721 if (hwifp) 746 if (hwifp)
@@ -724,13 +749,6 @@ found:
724 return (initializing || hwif->present) ? index : -1; 749 return (initializing || hwif->present) ? index : -1;
725} 750}
726 751
727EXPORT_SYMBOL(ide_register_hw_with_fixup);
728
729int ide_register_hw(hw_regs_t *hw, int initializing, ide_hwif_t **hwifp)
730{
731 return ide_register_hw_with_fixup(hw, initializing, hwifp, NULL);
732}
733
734EXPORT_SYMBOL(ide_register_hw); 752EXPORT_SYMBOL(ide_register_hw);
735 753
736/* 754/*
@@ -1046,7 +1064,7 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
1046 ide_init_hwif_ports(&hw, (unsigned long) args[0], 1064 ide_init_hwif_ports(&hw, (unsigned long) args[0],
1047 (unsigned long) args[1], NULL); 1065 (unsigned long) args[1], NULL);
1048 hw.irq = args[2]; 1066 hw.irq = args[2];
1049 if (ide_register_hw(&hw, 0, NULL) == -1) 1067 if (ide_register_hw(&hw, NULL, 0, NULL) == -1)
1050 return -EIO; 1068 return -EIO;
1051 return 0; 1069 return 0;
1052 } 1070 }
@@ -1397,6 +1415,9 @@ static int __init ide_setup(char *s)
1397 "reset", "minus6", "ata66", "minus8", "minus9", 1415 "reset", "minus6", "ata66", "minus8", "minus9",
1398 "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb", 1416 "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb",
1399 "dtc2278", "umc8672", "ali14xx", NULL }; 1417 "dtc2278", "umc8672", "ali14xx", NULL };
1418
1419 hw_regs_t hwregs;
1420
1400 hw = s[3] - '0'; 1421 hw = s[3] - '0';
1401 hwif = &ide_hwifs[hw]; 1422 hwif = &ide_hwifs[hw];
1402 i = match_parm(&s[4], ide_words, vals, 3); 1423 i = match_parm(&s[4], ide_words, vals, 3);
@@ -1506,9 +1527,9 @@ static int __init ide_setup(char *s)
1506 case 2: /* base,ctl */ 1527 case 2: /* base,ctl */
1507 vals[2] = 0; /* default irq = probe for it */ 1528 vals[2] = 0; /* default irq = probe for it */
1508 case 3: /* base,ctl,irq */ 1529 case 3: /* base,ctl,irq */
1509 hwif->hw.irq = vals[2]; 1530 memset(&hwregs, 0, sizeof(hwregs));
1510 ide_init_hwif_ports(&hwif->hw, (unsigned long) vals[0], (unsigned long) vals[1], &hwif->irq); 1531 ide_init_hwif_ports(&hwregs, vals[0], vals[1], &hwif->irq);
1511 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); 1532 memcpy(hwif->io_ports, hwregs.io_ports, sizeof(hwif->io_ports));
1512 hwif->irq = vals[2]; 1533 hwif->irq = vals[2];
1513 hwif->noprobe = 0; 1534 hwif->noprobe = 0;
1514 hwif->chipset = ide_forced; 1535 hwif->chipset = ide_forced;
diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c
index 2f0ef9b4403..10311ecc674 100644
--- a/drivers/ide/legacy/ali14xx.c
+++ b/drivers/ide/legacy/ali14xx.c
@@ -102,6 +102,8 @@ static void outReg (u8 data, u8 reg)
102 outb_p(data, dataPort); 102 outb_p(data, dataPort);
103} 103}
104 104
105static DEFINE_SPINLOCK(ali14xx_lock);
106
105/* 107/*
106 * Set PIO mode for the specified drive. 108 * Set PIO mode for the specified drive.
107 * This function computes timing parameters 109 * This function computes timing parameters
@@ -129,14 +131,14 @@ static void ali14xx_set_pio_mode(ide_drive_t *drive, const u8 pio)
129 131
130 /* stuff timing parameters into controller registers */ 132 /* stuff timing parameters into controller registers */
131 driveNum = (HWIF(drive)->index << 1) + drive->select.b.unit; 133 driveNum = (HWIF(drive)->index << 1) + drive->select.b.unit;
132 spin_lock_irqsave(&ide_lock, flags); 134 spin_lock_irqsave(&ali14xx_lock, flags);
133 outb_p(regOn, basePort); 135 outb_p(regOn, basePort);
134 outReg(param1, regTab[driveNum].reg1); 136 outReg(param1, regTab[driveNum].reg1);
135 outReg(param2, regTab[driveNum].reg2); 137 outReg(param2, regTab[driveNum].reg2);
136 outReg(param3, regTab[driveNum].reg3); 138 outReg(param3, regTab[driveNum].reg3);
137 outReg(param4, regTab[driveNum].reg4); 139 outReg(param4, regTab[driveNum].reg4);
138 outb_p(regOff, basePort); 140 outb_p(regOff, basePort);
139 spin_unlock_irqrestore(&ide_lock, flags); 141 spin_unlock_irqrestore(&ali14xx_lock, flags);
140} 142}
141 143
142/* 144/*
@@ -193,6 +195,7 @@ static int __init initRegisters (void) {
193static int __init ali14xx_probe(void) 195static int __init ali14xx_probe(void)
194{ 196{
195 ide_hwif_t *hwif, *mate; 197 ide_hwif_t *hwif, *mate;
198 static u8 idx[4] = { 0, 1, 0xff, 0xff };
196 199
197 printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n", 200 printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n",
198 basePort, regOn); 201 basePort, regOn);
@@ -217,11 +220,7 @@ static int __init ali14xx_probe(void)
217 mate->mate = hwif; 220 mate->mate = hwif;
218 mate->channel = 1; 221 mate->channel = 1;
219 222
220 probe_hwif_init(hwif); 223 ide_device_add(idx);
221 probe_hwif_init(mate);
222
223 ide_proc_register_port(hwif);
224 ide_proc_register_port(mate);
225 224
226 return 0; 225 return 0;
227} 226}
diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c
index 101aee1711c..4a0be251a05 100644
--- a/drivers/ide/legacy/buddha.c
+++ b/drivers/ide/legacy/buddha.c
@@ -212,8 +212,8 @@ fail_base2:
212// xsurf_iops, 212// xsurf_iops,
213 IRQ_AMIGA_PORTS); 213 IRQ_AMIGA_PORTS);
214 } 214 }
215 215
216 index = ide_register_hw(&hw, 1, &hwif); 216 index = ide_register_hw(&hw, NULL, 1, &hwif);
217 if (index != -1) { 217 if (index != -1) {
218 hwif->mmio = 1; 218 hwif->mmio = 1;
219 printk("ide%d: ", index); 219 printk("ide%d: ", index);
diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c
index f1652125486..24a845d45bd 100644
--- a/drivers/ide/legacy/dtc2278.c
+++ b/drivers/ide/legacy/dtc2278.c
@@ -67,20 +67,24 @@ static void sub22 (char b, char c)
67 } 67 }
68} 68}
69 69
70static DEFINE_SPINLOCK(dtc2278_lock);
71
70static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio) 72static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
71{ 73{
72 unsigned long flags; 74 unsigned long flags;
73 75
74 if (pio >= 3) { 76 if (pio >= 3) {
75 spin_lock_irqsave(&ide_lock, flags); 77 spin_lock_irqsave(&dtc2278_lock, flags);
76 /* 78 /*
77 * This enables PIO mode4 (3?) on the first interface 79 * This enables PIO mode4 (3?) on the first interface
78 */ 80 */
79 sub22(1,0xc3); 81 sub22(1,0xc3);
80 sub22(0,0xa0); 82 sub22(0,0xa0);
81 spin_unlock_irqrestore(&ide_lock, flags); 83 spin_unlock_irqrestore(&dtc2278_lock, flags);
82 } else { 84 } else {
83 /* we don't know how to set it back again.. */ 85 /* we don't know how to set it back again.. */
86 /* Actually we do - there is a data sheet available for the
87 Winbond but does anyone actually care */
84 } 88 }
85 89
86 /* 90 /*
@@ -94,6 +98,7 @@ static int __init dtc2278_probe(void)
94{ 98{
95 unsigned long flags; 99 unsigned long flags;
96 ide_hwif_t *hwif, *mate; 100 ide_hwif_t *hwif, *mate;
101 static u8 idx[4] = { 0, 1, 0xff, 0xff };
97 102
98 hwif = &ide_hwifs[0]; 103 hwif = &ide_hwifs[0];
99 mate = &ide_hwifs[1]; 104 mate = &ide_hwifs[1];
@@ -129,16 +134,13 @@ static int __init dtc2278_probe(void)
129 134
130 mate->serialized = 1; 135 mate->serialized = 1;
131 mate->chipset = ide_dtc2278; 136 mate->chipset = ide_dtc2278;
137 mate->pio_mask = ATA_PIO4;
132 mate->drives[0].no_unmask = 1; 138 mate->drives[0].no_unmask = 1;
133 mate->drives[1].no_unmask = 1; 139 mate->drives[1].no_unmask = 1;
134 mate->mate = hwif; 140 mate->mate = hwif;
135 mate->channel = 1; 141 mate->channel = 1;
136 142
137 probe_hwif_init(hwif); 143 ide_device_add(idx);
138 probe_hwif_init(mate);
139
140 ide_proc_register_port(hwif);
141 ide_proc_register_port(mate);
142 144
143 return 0; 145 return 0;
144} 146}
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c
index f0829b83e97..7d7936f1b90 100644
--- a/drivers/ide/legacy/falconide.c
+++ b/drivers/ide/legacy/falconide.c
@@ -72,7 +72,7 @@ void __init falconide_init(void)
72 0, 0, NULL, 72 0, 0, NULL,
73// falconide_iops, 73// falconide_iops,
74 IRQ_MFP_IDE); 74 IRQ_MFP_IDE);
75 index = ide_register_hw(&hw, 1, NULL); 75 index = ide_register_hw(&hw, NULL, 1, NULL);
76 76
77 if (index != -1) 77 if (index != -1)
78 printk("ide%d: Falcon IDE interface\n", index); 78 printk("ide%d: Falcon IDE interface\n", index);
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index 0830a021bbb..53331ee1e95 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -165,7 +165,7 @@ found:
165// &gayle_iops, 165// &gayle_iops,
166 IRQ_AMIGA_PORTS); 166 IRQ_AMIGA_PORTS);
167 167
168 index = ide_register_hw(&hw, 1, &hwif); 168 index = ide_register_hw(&hw, NULL, 1, &hwif);
169 if (index != -1) { 169 if (index != -1) {
170 hwif->mmio = 1; 170 hwif->mmio = 1;
171 switch (i) { 171 switch (i) {
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index 2e5a9cc5c0f..a4245d13f11 100644
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -247,6 +247,8 @@ static u8 ht_pio2timings(ide_drive_t *drive, const u8 pio)
247 } 247 }
248} 248}
249 249
250static DEFINE_SPINLOCK(ht6560b_lock);
251
250/* 252/*
251 * Enable/Disable so called prefetch mode 253 * Enable/Disable so called prefetch mode
252 */ 254 */
@@ -254,9 +256,9 @@ static void ht_set_prefetch(ide_drive_t *drive, u8 state)
254{ 256{
255 unsigned long flags; 257 unsigned long flags;
256 int t = HT_PREFETCH_MODE << 8; 258 int t = HT_PREFETCH_MODE << 8;
257 259
258 spin_lock_irqsave(&ide_lock, flags); 260 spin_lock_irqsave(&ht6560b_lock, flags);
259 261
260 /* 262 /*
261 * Prefetch mode and unmask irq seems to conflict 263 * Prefetch mode and unmask irq seems to conflict
262 */ 264 */
@@ -268,9 +270,9 @@ static void ht_set_prefetch(ide_drive_t *drive, u8 state)
268 drive->drive_data &= ~t; /* disable prefetch mode */ 270 drive->drive_data &= ~t; /* disable prefetch mode */
269 drive->no_unmask = 0; 271 drive->no_unmask = 0;
270 } 272 }
271 273
272 spin_unlock_irqrestore(&ide_lock, flags); 274 spin_unlock_irqrestore(&ht6560b_lock, flags);
273 275
274#ifdef DEBUG 276#ifdef DEBUG
275 printk("ht6560b: drive %s prefetch mode %sabled\n", drive->name, (state ? "en" : "dis")); 277 printk("ht6560b: drive %s prefetch mode %sabled\n", drive->name, (state ? "en" : "dis"));
276#endif 278#endif
@@ -287,16 +289,14 @@ static void ht6560b_set_pio_mode(ide_drive_t *drive, const u8 pio)
287 ht_set_prefetch(drive, pio & 1); 289 ht_set_prefetch(drive, pio & 1);
288 return; 290 return;
289 } 291 }
290 292
291 timing = ht_pio2timings(drive, pio); 293 timing = ht_pio2timings(drive, pio);
292 294
293 spin_lock_irqsave(&ide_lock, flags); 295 spin_lock_irqsave(&ht6560b_lock, flags);
294
295 drive->drive_data &= 0xff00; 296 drive->drive_data &= 0xff00;
296 drive->drive_data |= timing; 297 drive->drive_data |= timing;
297 298 spin_unlock_irqrestore(&ht6560b_lock, flags);
298 spin_unlock_irqrestore(&ide_lock, flags); 299
299
300#ifdef DEBUG 300#ifdef DEBUG
301 printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive->name, pio, timing); 301 printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive->name, pio, timing);
302#endif 302#endif
@@ -311,6 +311,7 @@ MODULE_PARM_DESC(probe, "probe for HT6560B chipset");
311int __init ht6560b_init(void) 311int __init ht6560b_init(void)
312{ 312{
313 ide_hwif_t *hwif, *mate; 313 ide_hwif_t *hwif, *mate;
314 static u8 idx[4] = { 0, 1, 0xff, 0xff };
314 int t; 315 int t;
315 316
316 if (probe_ht6560b == 0) 317 if (probe_ht6560b == 0)
@@ -359,11 +360,7 @@ int __init ht6560b_init(void)
359 mate->drives[0].drive_data = t; 360 mate->drives[0].drive_data = t;
360 mate->drives[1].drive_data = t; 361 mate->drives[1].drive_data = t;
361 362
362 probe_hwif_init(hwif); 363 ide_device_add(idx);
363 probe_hwif_init(mate);
364
365 ide_proc_register_port(hwif);
366 ide_proc_register_port(mate);
367 364
368 return 0; 365 return 0;
369 366
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index e8e360c2619..03715c05866 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -153,7 +153,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
153 hw.irq = irq; 153 hw.irq = irq;
154 hw.chipset = ide_pci; 154 hw.chipset = ide_pci;
155 hw.dev = &handle->dev; 155 hw.dev = &handle->dev;
156 return ide_register_hw_with_fixup(&hw, 0, NULL, ide_undecoded_slave); 156 return ide_register_hw(&hw, &ide_undecoded_slave, 0, NULL);
157} 157}
158 158
159/*====================================================================== 159/*======================================================================
diff --git a/drivers/ide/legacy/ide_platform.c b/drivers/ide/legacy/ide_platform.c
index b992b2b91fe..7bb79f53dac 100644
--- a/drivers/ide/legacy/ide_platform.c
+++ b/drivers/ide/legacy/ide_platform.c
@@ -33,39 +33,24 @@ static ide_hwif_t *__devinit plat_ide_locate_hwif(void __iomem *base,
33 int mmio) 33 int mmio)
34{ 34{
35 unsigned long port = (unsigned long)base; 35 unsigned long port = (unsigned long)base;
36 ide_hwif_t *hwif; 36 ide_hwif_t *hwif = ide_find_port(port);
37 int index, i; 37 int i;
38
39 for (index = 0; index < MAX_HWIFS; ++index) {
40 hwif = ide_hwifs + index;
41 if (hwif->io_ports[IDE_DATA_OFFSET] == port)
42 goto found;
43 }
44
45 for (index = 0; index < MAX_HWIFS; ++index) {
46 hwif = ide_hwifs + index;
47 if (hwif->io_ports[IDE_DATA_OFFSET] == 0)
48 goto found;
49 }
50 38
51 return NULL; 39 if (hwif == NULL)
52 40 goto out;
53found:
54 41
55 hwif->hw.io_ports[IDE_DATA_OFFSET] = port; 42 hwif->io_ports[IDE_DATA_OFFSET] = port;
56 43
57 port += (1 << pdata->ioport_shift); 44 port += (1 << pdata->ioport_shift);
58 for (i = IDE_ERROR_OFFSET; i <= IDE_STATUS_OFFSET; 45 for (i = IDE_ERROR_OFFSET; i <= IDE_STATUS_OFFSET;
59 i++, port += (1 << pdata->ioport_shift)) 46 i++, port += (1 << pdata->ioport_shift))
60 hwif->hw.io_ports[i] = port; 47 hwif->io_ports[i] = port;
61 48
62 hwif->hw.io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl; 49 hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl;
63 50
64 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports)); 51 hwif->irq = irq;
65 hwif->hw.irq = hwif->irq = irq;
66 52
67 hwif->hw.dma = NO_DMA; 53 hwif->chipset = ide_generic;
68 hwif->chipset = hwif->hw.chipset = ide_generic;
69 54
70 if (mmio) { 55 if (mmio) {
71 hwif->mmio = 1; 56 hwif->mmio = 1;
@@ -73,8 +58,8 @@ found:
73 } 58 }
74 59
75 hwif_prop.hwif = hwif; 60 hwif_prop.hwif = hwif;
76 hwif_prop.index = index; 61 hwif_prop.index = hwif->index;
77 62out:
78 return hwif; 63 return hwif;
79} 64}
80 65
@@ -83,6 +68,7 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
83 struct resource *res_base, *res_alt, *res_irq; 68 struct resource *res_base, *res_alt, *res_irq;
84 ide_hwif_t *hwif; 69 ide_hwif_t *hwif;
85 struct pata_platform_info *pdata; 70 struct pata_platform_info *pdata;
71 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
86 int ret = 0; 72 int ret = 0;
87 int mmio = 0; 73 int mmio = 0;
88 74
@@ -130,10 +116,11 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
130 hwif->gendev.parent = &pdev->dev; 116 hwif->gendev.parent = &pdev->dev;
131 hwif->noprobe = 0; 117 hwif->noprobe = 0;
132 118
133 probe_hwif_init(hwif); 119 idx[0] = hwif->index;
120
121 ide_device_add(idx);
134 122
135 platform_set_drvdata(pdev, hwif); 123 platform_set_drvdata(pdev, hwif);
136 ide_proc_register_port(hwif);
137 124
138 return 0; 125 return 0;
139 126
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c
index b557c45a5a9..e87cd2f1643 100644
--- a/drivers/ide/legacy/macide.c
+++ b/drivers/ide/legacy/macide.c
@@ -93,21 +93,21 @@ void macide_init(void)
93 0, 0, macide_ack_intr, 93 0, 0, macide_ack_intr,
94// quadra_ide_iops, 94// quadra_ide_iops,
95 IRQ_NUBUS_F); 95 IRQ_NUBUS_F);
96 index = ide_register_hw(&hw, 1, &hwif); 96 index = ide_register_hw(&hw, NULL, 1, &hwif);
97 break; 97 break;
98 case MAC_IDE_PB: 98 case MAC_IDE_PB:
99 ide_setup_ports(&hw, IDE_BASE, macide_offsets, 99 ide_setup_ports(&hw, IDE_BASE, macide_offsets,
100 0, 0, macide_ack_intr, 100 0, 0, macide_ack_intr,
101// macide_pb_iops, 101// macide_pb_iops,
102 IRQ_NUBUS_C); 102 IRQ_NUBUS_C);
103 index = ide_register_hw(&hw, 1, &hwif); 103 index = ide_register_hw(&hw, NULL, 1, &hwif);
104 break; 104 break;
105 case MAC_IDE_BABOON: 105 case MAC_IDE_BABOON:
106 ide_setup_ports(&hw, BABOON_BASE, macide_offsets, 106 ide_setup_ports(&hw, BABOON_BASE, macide_offsets,
107 0, 0, NULL, 107 0, 0, NULL,
108// macide_baboon_iops, 108// macide_baboon_iops,
109 IRQ_BABOON_1); 109 IRQ_BABOON_1);
110 index = ide_register_hw(&hw, 1, &hwif); 110 index = ide_register_hw(&hw, NULL, 1, &hwif);
111 if (index == -1) break; 111 if (index == -1) break;
112 if (macintosh_config->ident == MAC_MODEL_PB190) { 112 if (macintosh_config->ident == MAC_MODEL_PB190) {
113 113
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c
index e628a983ce3..a73db1bd482 100644
--- a/drivers/ide/legacy/q40ide.c
+++ b/drivers/ide/legacy/q40ide.c
@@ -89,9 +89,8 @@ void q40_ide_setup_ports ( hw_regs_t *hw,
89 else 89 else
90 hw->io_ports[i] = Q40_ISA_IO_B(base + offsets[i]); 90 hw->io_ports[i] = Q40_ISA_IO_B(base + offsets[i]);
91 } 91 }
92 92
93 hw->irq = irq; 93 hw->irq = irq;
94 hw->dma = NO_DMA;
95 hw->ack_intr = ack_intr; 94 hw->ack_intr = ack_intr;
96/* 95/*
97 * hw->iops = iops; 96 * hw->iops = iops;
@@ -102,7 +101,7 @@ void q40_ide_setup_ports ( hw_regs_t *hw,
102 101
103/* 102/*
104 * the static array is needed to have the name reported in /proc/ioports, 103 * the static array is needed to have the name reported in /proc/ioports,
105 * hwif->name unfortunately isn´t available yet 104 * hwif->name unfortunately isn't available yet
106 */ 105 */
107static const char *q40_ide_names[Q40IDE_NUM_HWIFS]={ 106static const char *q40_ide_names[Q40IDE_NUM_HWIFS]={
108 "ide0", "ide1" 107 "ide0", "ide1"
@@ -142,7 +141,7 @@ void q40ide_init(void)
142 0, NULL, 141 0, NULL,
143// m68kide_iops, 142// m68kide_iops,
144 q40ide_default_irq(pcide_bases[i])); 143 q40ide_default_irq(pcide_bases[i]));
145 index = ide_register_hw(&hw, 1, &hwif); 144 index = ide_register_hw(&hw, NULL, 1, &hwif);
146 // **FIXME** 145 // **FIXME**
147 if (index != -1) 146 if (index != -1)
148 hwif->mmio = 1; 147 hwif->mmio = 1;
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c
index 0c81d2d0b94..912e73853fa 100644
--- a/drivers/ide/legacy/qd65xx.c
+++ b/drivers/ide/legacy/qd65xx.c
@@ -89,26 +89,6 @@
89 89
90static int timings[4]={-1,-1,-1,-1}; /* stores current timing for each timer */ 90static int timings[4]={-1,-1,-1,-1}; /* stores current timing for each timer */
91 91
92static void qd_write_reg (u8 content, unsigned long reg)
93{
94 unsigned long flags;
95
96 spin_lock_irqsave(&ide_lock, flags);
97 outb(content,reg);
98 spin_unlock_irqrestore(&ide_lock, flags);
99}
100
101static u8 __init qd_read_reg (unsigned long reg)
102{
103 unsigned long flags;
104 u8 read;
105
106 spin_lock_irqsave(&ide_lock, flags);
107 read = inb(reg);
108 spin_unlock_irqrestore(&ide_lock, flags);
109 return read;
110}
111
112/* 92/*
113 * qd_select: 93 * qd_select:
114 * 94 *
@@ -121,7 +101,7 @@ static void qd_select (ide_drive_t *drive)
121 (QD_TIMREG(drive) & 0x02); 101 (QD_TIMREG(drive) & 0x02);
122 102
123 if (timings[index] != QD_TIMING(drive)) 103 if (timings[index] != QD_TIMING(drive))
124 qd_write_reg(timings[index] = QD_TIMING(drive), QD_TIMREG(drive)); 104 outb(timings[index] = QD_TIMING(drive), QD_TIMREG(drive));
125} 105}
126 106
127/* 107/*
@@ -284,7 +264,7 @@ static void qd6580_set_pio_mode(ide_drive_t *drive, const u8 pio)
284 } 264 }
285 265
286 if (!HWIF(drive)->channel && drive->media != ide_disk) { 266 if (!HWIF(drive)->channel && drive->media != ide_disk) {
287 qd_write_reg(0x5f, QD_CONTROL_PORT); 267 outb(0x5f, QD_CONTROL_PORT);
288 printk(KERN_WARNING "%s: ATAPI: disabled read-ahead FIFO " 268 printk(KERN_WARNING "%s: ATAPI: disabled read-ahead FIFO "
289 "and post-write buffer on %s.\n", 269 "and post-write buffer on %s.\n",
290 drive->name, HWIF(drive)->name); 270 drive->name, HWIF(drive)->name);
@@ -301,16 +281,15 @@ static void qd6580_set_pio_mode(ide_drive_t *drive, const u8 pio)
301 281
302static int __init qd_testreg(int port) 282static int __init qd_testreg(int port)
303{ 283{
304 u8 savereg;
305 u8 readreg;
306 unsigned long flags; 284 unsigned long flags;
285 u8 savereg, readreg;
307 286
308 spin_lock_irqsave(&ide_lock, flags); 287 local_irq_save(flags);
309 savereg = inb_p(port); 288 savereg = inb_p(port);
310 outb_p(QD_TESTVAL, port); /* safe value */ 289 outb_p(QD_TESTVAL, port); /* safe value */
311 readreg = inb_p(port); 290 readreg = inb_p(port);
312 outb(savereg, port); 291 outb(savereg, port);
313 spin_unlock_irqrestore(&ide_lock, flags); 292 local_irq_restore(flags);
314 293
315 if (savereg == QD_TESTVAL) { 294 if (savereg == QD_TESTVAL) {
316 printk(KERN_ERR "Outch ! the probe for qd65xx isn't reliable !\n"); 295 printk(KERN_ERR "Outch ! the probe for qd65xx isn't reliable !\n");
@@ -364,13 +343,13 @@ static void __exit qd_unsetup(ide_hwif_t *hwif)
364 343
365 if (set_pio_mode == (void *)qd6500_set_pio_mode) { 344 if (set_pio_mode == (void *)qd6500_set_pio_mode) {
366 // will do it for both 345 // will do it for both
367 qd_write_reg(QD6500_DEF_DATA, QD_TIMREG(&hwif->drives[0])); 346 outb(QD6500_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
368 } else if (set_pio_mode == (void *)qd6580_set_pio_mode) { 347 } else if (set_pio_mode == (void *)qd6580_set_pio_mode) {
369 if (QD_CONTROL(hwif) & QD_CONTR_SEC_DISABLED) { 348 if (QD_CONTROL(hwif) & QD_CONTR_SEC_DISABLED) {
370 qd_write_reg(QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0])); 349 outb(QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
371 qd_write_reg(QD6580_DEF_DATA2, QD_TIMREG(&hwif->drives[1])); 350 outb(QD6580_DEF_DATA2, QD_TIMREG(&hwif->drives[1]));
372 } else { 351 } else {
373 qd_write_reg(hwif->channel ? QD6580_DEF_DATA2 : QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0])); 352 outb(hwif->channel ? QD6580_DEF_DATA2 : QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0]));
374 } 353 }
375 } else { 354 } else {
376 printk(KERN_WARNING "Unknown qd65xx tuning fonction !\n"); 355 printk(KERN_WARNING "Unknown qd65xx tuning fonction !\n");
@@ -389,10 +368,11 @@ static void __exit qd_unsetup(ide_hwif_t *hwif)
389static int __init qd_probe(int base) 368static int __init qd_probe(int base)
390{ 369{
391 ide_hwif_t *hwif; 370 ide_hwif_t *hwif;
371 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
392 u8 config; 372 u8 config;
393 u8 unit; 373 u8 unit;
394 374
395 config = qd_read_reg(QD_CONFIG_PORT); 375 config = inb(QD_CONFIG_PORT);
396 376
397 if (! ((config & QD_CONFIG_BASEPORT) >> 1 == (base == 0xb0)) ) 377 if (! ((config & QD_CONFIG_BASEPORT) >> 1 == (base == 0xb0)) )
398 return 1; 378 return 1;
@@ -419,9 +399,9 @@ static int __init qd_probe(int base)
419 399
420 hwif->set_pio_mode = &qd6500_set_pio_mode; 400 hwif->set_pio_mode = &qd6500_set_pio_mode;
421 401
422 probe_hwif_init(hwif); 402 idx[0] = unit;
423 403
424 ide_proc_register_port(hwif); 404 ide_device_add(idx);
425 405
426 return 1; 406 return 1;
427 } 407 }
@@ -436,7 +416,7 @@ static int __init qd_probe(int base)
436 416
437 /* qd6580 found */ 417 /* qd6580 found */
438 418
439 control = qd_read_reg(QD_CONTROL_PORT); 419 control = inb(QD_CONTROL_PORT);
440 420
441 printk(KERN_NOTICE "qd6580 at %#x\n", base); 421 printk(KERN_NOTICE "qd6580 at %#x\n", base);
442 printk(KERN_DEBUG "qd6580: config=%#x, control=%#x, ID3=%u\n", 422 printk(KERN_DEBUG "qd6580: config=%#x, control=%#x, ID3=%u\n",
@@ -453,11 +433,11 @@ static int __init qd_probe(int base)
453 433
454 hwif->set_pio_mode = &qd6580_set_pio_mode; 434 hwif->set_pio_mode = &qd6580_set_pio_mode;
455 435
456 probe_hwif_init(hwif); 436 idx[0] = unit;
457 437
458 qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); 438 ide_device_add(idx);
459 439
460 ide_proc_register_port(hwif); 440 outb(QD_DEF_CONTR, QD_CONTROL_PORT);
461 441
462 return 1; 442 return 1;
463 } else { 443 } else {
@@ -474,19 +454,17 @@ static int __init qd_probe(int base)
474 454
475 hwif->set_pio_mode = &qd6580_set_pio_mode; 455 hwif->set_pio_mode = &qd6580_set_pio_mode;
476 456
477 probe_hwif_init(hwif);
478
479 qd_setup(mate, base, config | (control << 8), 457 qd_setup(mate, base, config | (control << 8),
480 QD6580_DEF_DATA2, QD6580_DEF_DATA2); 458 QD6580_DEF_DATA2, QD6580_DEF_DATA2);
481 459
482 mate->set_pio_mode = &qd6580_set_pio_mode; 460 mate->set_pio_mode = &qd6580_set_pio_mode;
483 461
484 probe_hwif_init(mate); 462 idx[0] = 0;
463 idx[1] = 1;
485 464
486 qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); 465 ide_device_add(idx);
487 466
488 ide_proc_register_port(hwif); 467 outb(QD_DEF_CONTR, QD_CONTROL_PORT);
489 ide_proc_register_port(mate);
490 468
491 return 0; /* no other qd65xx possible */ 469 return 0; /* no other qd65xx possible */
492 } 470 }
diff --git a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c
index 1151c92dd53..79577b91687 100644
--- a/drivers/ide/legacy/umc8672.c
+++ b/drivers/ide/legacy/umc8672.c
@@ -124,8 +124,9 @@ static void umc_set_pio_mode(ide_drive_t *drive, const u8 pio)
124 124
125static int __init umc8672_probe(void) 125static int __init umc8672_probe(void)
126{ 126{
127 unsigned long flags;
128 ide_hwif_t *hwif, *mate; 127 ide_hwif_t *hwif, *mate;
128 unsigned long flags;
129 static u8 idx[4] = { 0, 1, 0xff, 0xff };
129 130
130 if (!request_region(0x108, 2, "umc8672")) { 131 if (!request_region(0x108, 2, "umc8672")) {
131 printk(KERN_ERR "umc8672: ports 0x108-0x109 already in use.\n"); 132 printk(KERN_ERR "umc8672: ports 0x108-0x109 already in use.\n");
@@ -158,11 +159,7 @@ static int __init umc8672_probe(void)
158 mate->mate = hwif; 159 mate->mate = hwif;
159 mate->channel = 1; 160 mate->channel = 1;
160 161
161 probe_hwif_init(hwif); 162 ide_device_add(idx);
162 probe_hwif_init(mate);
163
164 ide_proc_register_port(hwif);
165 ide_proc_register_port(mate);
166 163
167 return 0; 164 return 0;
168} 165}
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index 2f322d7e881..1de58566e5b 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -601,8 +601,9 @@ static int au_ide_probe(struct device *dev)
601 _auide_hwif *ahwif = &auide_hwif; 601 _auide_hwif *ahwif = &auide_hwif;
602 ide_hwif_t *hwif; 602 ide_hwif_t *hwif;
603 struct resource *res; 603 struct resource *res;
604 hw_regs_t *hw;
605 int ret = 0; 604 int ret = 0;
605 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
606 hw_regs_t hw;
606 607
607#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) 608#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)
608 char *mode = "MWDMA2"; 609 char *mode = "MWDMA2";
@@ -644,12 +645,12 @@ static int au_ide_probe(struct device *dev)
644 /* FIXME: This might possibly break PCMCIA IDE devices */ 645 /* FIXME: This might possibly break PCMCIA IDE devices */
645 646
646 hwif = &ide_hwifs[pdev->id]; 647 hwif = &ide_hwifs[pdev->id];
647 hw = &hwif->hw; 648 hwif->irq = ahwif->irq;
648 hwif->irq = hw->irq = ahwif->irq;
649 hwif->chipset = ide_au1xxx; 649 hwif->chipset = ide_au1xxx;
650 650
651 auide_setup_ports(hw, ahwif); 651 memset(&hw, 0, sizeof(hw));
652 memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports)); 652 auide_setup_ports(&hw, ahwif);
653 memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
653 654
654 hwif->ultra_mask = 0x0; /* Disable Ultra DMA */ 655 hwif->ultra_mask = 0x0; /* Disable Ultra DMA */
655#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 656#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
@@ -706,8 +707,10 @@ static int au_ide_probe(struct device *dev)
706 hwif->config_data = 0; /* no chipset-specific code */ 707 hwif->config_data = 0; /* no chipset-specific code */
707 708
708 hwif->drives[0].autotune = 1; /* 1=autotune, 2=noautotune, 0=default */ 709 hwif->drives[0].autotune = 1; /* 1=autotune, 2=noautotune, 0=default */
710 hwif->drives[1].autotune = 1;
709#endif 711#endif
710 hwif->drives[0].no_io_32bit = 1; 712 hwif->drives[0].no_io_32bit = 1;
713 hwif->drives[1].no_io_32bit = 1;
711 714
712 auide_hwif.hwif = hwif; 715 auide_hwif.hwif = hwif;
713 hwif->hwif_data = &auide_hwif; 716 hwif->hwif_data = &auide_hwif;
@@ -717,9 +720,9 @@ static int au_ide_probe(struct device *dev)
717 dbdma_init_done = 1; 720 dbdma_init_done = 1;
718#endif 721#endif
719 722
720 probe_hwif_init(hwif); 723 idx[0] = hwif->index;
721 724
722 ide_proc_register_port(hwif); 725 ide_device_add(idx);
723 726
724 dev_set_drvdata(dev, hwif); 727 dev_set_drvdata(dev, hwif);
725 728
diff --git a/drivers/ide/mips/swarm.c b/drivers/ide/mips/swarm.c
index c2e29571b00..521edd41b57 100644
--- a/drivers/ide/mips/swarm.c
+++ b/drivers/ide/mips/swarm.c
@@ -71,6 +71,7 @@ static int __devinit swarm_ide_probe(struct device *dev)
71 u8 __iomem *base; 71 u8 __iomem *base;
72 phys_t offset, size; 72 phys_t offset, size;
73 int i; 73 int i;
74 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
74 75
75 if (!SIBYTE_HAVE_IDE) 76 if (!SIBYTE_HAVE_IDE)
76 return -ENODEV; 77 return -ENODEV;
@@ -119,18 +120,15 @@ static int __devinit swarm_ide_probe(struct device *dev)
119 hwif->noprobe = 0; 120 hwif->noprobe = 0;
120 121
121 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) 122 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++)
122 hwif->hw.io_ports[i] = 123 hwif->io_ports[i] =
123 (unsigned long)(base + ((0x1f0 + i) << 5)); 124 (unsigned long)(base + ((0x1f0 + i) << 5));
124 hwif->hw.io_ports[IDE_CONTROL_OFFSET] = 125 hwif->io_ports[IDE_CONTROL_OFFSET] =
125 (unsigned long)(base + (0x3f6 << 5)); 126 (unsigned long)(base + (0x3f6 << 5));
126 hwif->hw.irq = K_INT_GB_IDE; 127 hwif->irq = K_INT_GB_IDE;
127 128
128 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); 129 idx[0] = hwif->index;
129 hwif->irq = hwif->hw.irq;
130 130
131 probe_hwif_init(hwif); 131 ide_device_add(idx);
132
133 ide_proc_register_port(hwif);
134 132
135 dev_set_drvdata(dev, hwif); 133 dev_set_drvdata(dev, hwif);
136 134
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index b3dc12a70d5..19ec421f7b9 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/aec62xx.c Version 0.26 Sep 1, 2007 2 * linux/drivers/ide/pci/aec62xx.c Version 0.27 Sep 16, 2007
3 * 3 *
4 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org>
5 * Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com> 5 * Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com>
@@ -141,19 +141,6 @@ static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio)
141 drive->hwif->set_dma_mode(drive, pio + XFER_PIO_0); 141 drive->hwif->set_dma_mode(drive, pio + XFER_PIO_0);
142} 142}
143 143
144static void aec62xx_dma_lost_irq (ide_drive_t *drive)
145{
146 switch (HWIF(drive)->pci_dev->device) {
147 case PCI_DEVICE_ID_ARTOP_ATP860:
148 case PCI_DEVICE_ID_ARTOP_ATP860R:
149 case PCI_DEVICE_ID_ARTOP_ATP865:
150 case PCI_DEVICE_ID_ARTOP_ATP865R:
151 printk(" AEC62XX time out ");
152 default:
153 break;
154 }
155}
156
157static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const char *name) 144static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const char *name)
158{ 145{
159 int bus_speed = system_bus_clock(); 146 int bus_speed = system_bus_clock();
@@ -195,8 +182,6 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
195 if (hwif->dma_base == 0) 182 if (hwif->dma_base == 0)
196 return; 183 return;
197 184
198 hwif->dma_lost_irq = &aec62xx_dma_lost_irq;
199
200 if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) 185 if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF)
201 return; 186 return;
202 187
@@ -209,7 +194,7 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
209 } 194 }
210} 195}
211 196
212static ide_pci_device_t aec62xx_chipsets[] __devinitdata = { 197static const struct ide_port_info aec62xx_chipsets[] __devinitdata = {
213 { /* 0 */ 198 { /* 0 */
214 .name = "AEC6210", 199 .name = "AEC6210",
215 .init_chipset = init_chipset_aec62xx, 200 .init_chipset = init_chipset_aec62xx,
@@ -268,12 +253,12 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
268 * finds a device matching our IDE device tables. 253 * finds a device matching our IDE device tables.
269 * 254 *
270 * NOTE: since we're going to modify the 'name' field for AEC-6[26]80[R] 255 * NOTE: since we're going to modify the 'name' field for AEC-6[26]80[R]
271 * chips, pass a local copy of 'struct pci_device_id' down the call chain. 256 * chips, pass a local copy of 'struct ide_port_info' down the call chain.
272 */ 257 */
273 258
274static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) 259static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
275{ 260{
276 ide_pci_device_t d; 261 struct ide_port_info d;
277 u8 idx = id->driver_data; 262 u8 idx = id->driver_data;
278 263
279 d = aec62xx_chipsets[idx]; 264 d = aec62xx_chipsets[idx];
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index 8ee2b48d105..a607dd31a64 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/alim15x3.c Version 0.27 Aug 27 2007 2 * linux/drivers/ide/pci/alim15x3.c Version 0.29 Sep 16 2007
3 * 3 *
4 * Copyright (C) 1998-2000 Michel Aubry, Maintainer 4 * Copyright (C) 1998-2000 Michel Aubry, Maintainer
5 * Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer 5 * Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer
@@ -492,6 +492,13 @@ static unsigned int __devinit init_chipset_ali15x3 (struct pci_dev *dev, const c
492 * clear bit 7 492 * clear bit 7
493 */ 493 */
494 pci_write_config_byte(dev, 0x4b, tmpbyte & 0x7F); 494 pci_write_config_byte(dev, 0x4b, tmpbyte & 0x7F);
495 /*
496 * check m1533, 0x5e, bit 1~4 == 1001 => & 00011110 = 00010010
497 */
498 if (m5229_revision >= 0x20 && isa_dev) {
499 pci_read_config_byte(isa_dev, 0x5e, &tmpbyte);
500 chip_is_1543c_e = ((tmpbyte & 0x1e) == 0x12) ? 1: 0;
501 }
495 goto out; 502 goto out;
496 } 503 }
497 504
@@ -537,7 +544,30 @@ static unsigned int __devinit init_chipset_ali15x3 (struct pci_dev *dev, const c
537 pci_write_config_byte(isa_dev, 0x79, tmpbyte | 0x02); 544 pci_write_config_byte(isa_dev, 0x79, tmpbyte | 0x02);
538 } 545 }
539 } 546 }
547
540out: 548out:
549 /*
550 * CD_ROM DMA on (m5229, 0x53, bit0)
551 * Enable this bit even if we want to use PIO.
552 * PIO FIFO off (m5229, 0x53, bit1)
553 * The hardware will use 0x54h and 0x55h to control PIO FIFO.
554 * (Not on later devices it seems)
555 *
556 * 0x53 changes meaning on later revs - we must no touch
557 * bit 1 on them. Need to check if 0x20 is the right break.
558 */
559 if (m5229_revision >= 0x20) {
560 pci_read_config_byte(dev, 0x53, &tmpbyte);
561
562 if (m5229_revision <= 0x20)
563 tmpbyte = (tmpbyte & (~0x02)) | 0x01;
564 else if (m5229_revision == 0xc7 || m5229_revision == 0xc8)
565 tmpbyte |= 0x03;
566 else
567 tmpbyte |= 0x01;
568
569 pci_write_config_byte(dev, 0x53, tmpbyte);
570 }
541 pci_dev_put(north); 571 pci_dev_put(north);
542 pci_dev_put(isa_dev); 572 pci_dev_put(isa_dev);
543 local_irq_restore(flags); 573 local_irq_restore(flags);
@@ -616,36 +646,8 @@ static u8 __devinit ata66_ali15x3(ide_hwif_t *hwif)
616 if ((tmpbyte & (1 << hwif->channel)) == 0) 646 if ((tmpbyte & (1 << hwif->channel)) == 0)
617 cbl = ATA_CBL_PATA80; 647 cbl = ATA_CBL_PATA80;
618 } 648 }
619 } else {
620 /*
621 * check m1533, 0x5e, bit 1~4 == 1001 => & 00011110 = 00010010
622 */
623 pci_read_config_byte(isa_dev, 0x5e, &tmpbyte);
624 chip_is_1543c_e = ((tmpbyte & 0x1e) == 0x12) ? 1: 0;
625 } 649 }
626 650
627 /*
628 * CD_ROM DMA on (m5229, 0x53, bit0)
629 * Enable this bit even if we want to use PIO
630 * PIO FIFO off (m5229, 0x53, bit1)
631 * The hardware will use 0x54h and 0x55h to control PIO FIFO
632 * (Not on later devices it seems)
633 *
634 * 0x53 changes meaning on later revs - we must no touch
635 * bit 1 on them. Need to check if 0x20 is the right break
636 */
637
638 pci_read_config_byte(dev, 0x53, &tmpbyte);
639
640 if(m5229_revision <= 0x20)
641 tmpbyte = (tmpbyte & (~0x02)) | 0x01;
642 else if (m5229_revision == 0xc7 || m5229_revision == 0xc8)
643 tmpbyte |= 0x03;
644 else
645 tmpbyte |= 0x01;
646
647 pci_write_config_byte(dev, 0x53, tmpbyte);
648
649 local_irq_restore(flags); 651 local_irq_restore(flags);
650 652
651 return cbl; 653 return cbl;
@@ -664,31 +666,9 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
664 hwif->set_dma_mode = &ali_set_dma_mode; 666 hwif->set_dma_mode = &ali_set_dma_mode;
665 hwif->udma_filter = &ali_udma_filter; 667 hwif->udma_filter = &ali_udma_filter;
666 668
667 /* don't use LBA48 DMA on ALi devices before rev 0xC5 */
668 if (m5229_revision <= 0xC4)
669 hwif->host_flags |= IDE_HFLAG_NO_LBA48_DMA;
670
671 if (hwif->dma_base == 0) 669 if (hwif->dma_base == 0)
672 return; 670 return;
673 671
674 /*
675 * check in ->init_dma guarantees m5229_revision >= 0x20 here
676 */
677
678 if (m5229_revision == 0x20)
679 hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
680
681 if (m5229_revision <= 0x20)
682 hwif->ultra_mask = 0x00; /* no udma */
683 else if (m5229_revision < 0xC2)
684 hwif->ultra_mask = ATA_UDMA2;
685 else if (m5229_revision == 0xC2 || m5229_revision == 0xC3)
686 hwif->ultra_mask = ATA_UDMA4;
687 else if (m5229_revision == 0xC4)
688 hwif->ultra_mask = ATA_UDMA5;
689 else
690 hwif->ultra_mask = ATA_UDMA6;
691
692 hwif->dma_setup = &ali15x3_dma_setup; 672 hwif->dma_setup = &ali15x3_dma_setup;
693 673
694 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 674 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
@@ -766,7 +746,7 @@ static void __devinit init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase)
766 ide_setup_dma(hwif, dmabase, 8); 746 ide_setup_dma(hwif, dmabase, 8);
767} 747}
768 748
769static ide_pci_device_t ali15x3_chipset __devinitdata = { 749static const struct ide_port_info ali15x3_chipset __devinitdata = {
770 .name = "ALI15X3", 750 .name = "ALI15X3",
771 .init_chipset = init_chipset_ali15x3, 751 .init_chipset = init_chipset_ali15x3,
772 .init_hwif = init_hwif_ali15x3, 752 .init_hwif = init_hwif_ali15x3,
@@ -792,15 +772,34 @@ static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_dev
792 { }, 772 { },
793 }; 773 };
794 774
795 ide_pci_device_t *d = &ali15x3_chipset; 775 struct ide_port_info d = ali15x3_chipset;
776 u8 rev = dev->revision;
796 777
797 if (pci_dev_present(ati_rs100)) 778 if (pci_dev_present(ati_rs100))
798 printk(KERN_WARNING "alim15x3: ATI Radeon IGP Northbridge is not yet fully tested.\n"); 779 printk(KERN_WARNING "alim15x3: ATI Radeon IGP Northbridge is not yet fully tested.\n");
799 780
781 /* don't use LBA48 DMA on ALi devices before rev 0xC5 */
782 if (rev <= 0xC4)
783 d.host_flags |= IDE_HFLAG_NO_LBA48_DMA;
784
785 if (rev >= 0x20) {
786 if (rev == 0x20)
787 d.host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
788
789 if (rev < 0xC2)
790 d.udma_mask = ATA_UDMA2;
791 else if (rev == 0xC2 || rev == 0xC3)
792 d.udma_mask = ATA_UDMA4;
793 else if (rev == 0xC4)
794 d.udma_mask = ATA_UDMA5;
795 else
796 d.udma_mask = ATA_UDMA6;
797 }
798
800#if defined(CONFIG_SPARC64) 799#if defined(CONFIG_SPARC64)
801 d->init_hwif = init_hwif_common_ali15x3; 800 d.init_hwif = init_hwif_common_ali15x3;
802#endif /* CONFIG_SPARC64 */ 801#endif /* CONFIG_SPARC64 */
803 return ide_setup_pci_device(dev, d); 802 return ide_setup_pci_device(dev, &d);
804} 803}
805 804
806 805
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index 7cafefbf6c1..8d4125ec252 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -77,7 +77,7 @@ static struct amd_ide_chip {
77}; 77};
78 78
79static struct amd_ide_chip *amd_config; 79static struct amd_ide_chip *amd_config;
80static ide_pci_device_t *amd_chipset; 80static const struct ide_port_info *amd_chipset;
81static unsigned int amd_80w; 81static unsigned int amd_80w;
82static unsigned int amd_clock; 82static unsigned int amd_clock;
83 83
@@ -242,19 +242,12 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const ch
242 242
243static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif) 243static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
244{ 244{
245 int i;
246
247 if (hwif->irq == 0) /* 0 is bogus but will do for now */ 245 if (hwif->irq == 0) /* 0 is bogus but will do for now */
248 hwif->irq = pci_get_legacy_ide_irq(hwif->pci_dev, hwif->channel); 246 hwif->irq = pci_get_legacy_ide_irq(hwif->pci_dev, hwif->channel);
249 247
250 hwif->set_pio_mode = &amd_set_pio_mode; 248 hwif->set_pio_mode = &amd_set_pio_mode;
251 hwif->set_dma_mode = &amd_set_drive; 249 hwif->set_dma_mode = &amd_set_drive;
252 250
253 for (i = 0; i < 2; i++) {
254 hwif->drives[i].io_32bit = 1;
255 hwif->drives[i].unmask = 1;
256 }
257
258 if (!hwif->dma_base) 251 if (!hwif->dma_base)
259 return; 252 return;
260 253
@@ -270,16 +263,21 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
270 } 263 }
271} 264}
272 265
266#define IDE_HFLAGS_AMD \
267 (IDE_HFLAG_PIO_NO_BLACKLIST | \
268 IDE_HFLAG_PIO_NO_DOWNGRADE | \
269 IDE_HFLAG_POST_SET_MODE | \
270 IDE_HFLAG_IO_32BIT | \
271 IDE_HFLAG_UNMASK_IRQS | \
272 IDE_HFLAG_BOOTABLE)
273
273#define DECLARE_AMD_DEV(name_str) \ 274#define DECLARE_AMD_DEV(name_str) \
274 { \ 275 { \
275 .name = name_str, \ 276 .name = name_str, \
276 .init_chipset = init_chipset_amd74xx, \ 277 .init_chipset = init_chipset_amd74xx, \
277 .init_hwif = init_hwif_amd74xx, \ 278 .init_hwif = init_hwif_amd74xx, \
278 .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \ 279 .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \
279 .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST | \ 280 .host_flags = IDE_HFLAGS_AMD, \
280 IDE_HFLAG_PIO_NO_DOWNGRADE | \
281 IDE_HFLAG_POST_SET_MODE | \
282 IDE_HFLAG_BOOTABLE, \
283 .pio_mask = ATA_PIO5, \ 281 .pio_mask = ATA_PIO5, \
284 .swdma_mask = ATA_SWDMA2, \ 282 .swdma_mask = ATA_SWDMA2, \
285 .mwdma_mask = ATA_MWDMA2, \ 283 .mwdma_mask = ATA_MWDMA2, \
@@ -291,16 +289,13 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
291 .init_chipset = init_chipset_amd74xx, \ 289 .init_chipset = init_chipset_amd74xx, \
292 .init_hwif = init_hwif_amd74xx, \ 290 .init_hwif = init_hwif_amd74xx, \
293 .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \ 291 .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \
294 .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST | \ 292 .host_flags = IDE_HFLAGS_AMD, \
295 IDE_HFLAG_PIO_NO_DOWNGRADE | \
296 IDE_HFLAG_POST_SET_MODE | \
297 IDE_HFLAG_BOOTABLE, \
298 .pio_mask = ATA_PIO5, \ 293 .pio_mask = ATA_PIO5, \
299 .swdma_mask = ATA_SWDMA2, \ 294 .swdma_mask = ATA_SWDMA2, \
300 .mwdma_mask = ATA_MWDMA2, \ 295 .mwdma_mask = ATA_MWDMA2, \
301 } 296 }
302 297
303static ide_pci_device_t amd74xx_chipsets[] __devinitdata = { 298static const struct ide_port_info amd74xx_chipsets[] __devinitdata = {
304 /* 0 */ DECLARE_AMD_DEV("AMD7401"), 299 /* 0 */ DECLARE_AMD_DEV("AMD7401"),
305 /* 1 */ DECLARE_AMD_DEV("AMD7409"), 300 /* 1 */ DECLARE_AMD_DEV("AMD7409"),
306 /* 2 */ DECLARE_AMD_DEV("AMD7411"), 301 /* 2 */ DECLARE_AMD_DEV("AMD7411"),
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index 30784305307..ef8e0164ef7 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -189,8 +189,7 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
189 hwif->dma_host_off = &atiixp_dma_host_off; 189 hwif->dma_host_off = &atiixp_dma_host_off;
190} 190}
191 191
192 192static const struct ide_port_info atiixp_pci_info[] __devinitdata = {
193static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
194 { /* 0 */ 193 { /* 0 */
195 .name = "ATIIXP", 194 .name = "ATIIXP",
196 .init_hwif = init_hwif_atiixp, 195 .init_hwif = init_hwif_atiixp,
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
index f369645e4d1..4aa48104e0c 100644
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -185,6 +185,8 @@ static u8 recovery_counts[4] = {16, 16, 16, 16}; /* Recovery count (encoded) */
185 185
186#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ 186#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
187 187
188static DEFINE_SPINLOCK(cmd640_lock);
189
188/* 190/*
189 * These are initialized to point at the devices we control 191 * These are initialized to point at the devices we control
190 */ 192 */
@@ -258,12 +260,12 @@ static u8 get_cmd640_reg_vlb (u16 reg)
258 260
259static u8 get_cmd640_reg(u16 reg) 261static u8 get_cmd640_reg(u16 reg)
260{ 262{
261 u8 b;
262 unsigned long flags; 263 unsigned long flags;
264 u8 b;
263 265
264 spin_lock_irqsave(&ide_lock, flags); 266 spin_lock_irqsave(&cmd640_lock, flags);
265 b = __get_cmd640_reg(reg); 267 b = __get_cmd640_reg(reg);
266 spin_unlock_irqrestore(&ide_lock, flags); 268 spin_unlock_irqrestore(&cmd640_lock, flags);
267 return b; 269 return b;
268} 270}
269 271
@@ -271,9 +273,9 @@ static void put_cmd640_reg(u16 reg, u8 val)
271{ 273{
272 unsigned long flags; 274 unsigned long flags;
273 275
274 spin_lock_irqsave(&ide_lock, flags); 276 spin_lock_irqsave(&cmd640_lock, flags);
275 __put_cmd640_reg(reg,val); 277 __put_cmd640_reg(reg,val);
276 spin_unlock_irqrestore(&ide_lock, flags); 278 spin_unlock_irqrestore(&cmd640_lock, flags);
277} 279}
278 280
279static int __init match_pci_cmd640_device (void) 281static int __init match_pci_cmd640_device (void)
@@ -351,7 +353,7 @@ static int __init secondary_port_responding (void)
351{ 353{
352 unsigned long flags; 354 unsigned long flags;
353 355
354 spin_lock_irqsave(&ide_lock, flags); 356 spin_lock_irqsave(&cmd640_lock, flags);
355 357
356 outb_p(0x0a, 0x170 + IDE_SELECT_OFFSET); /* select drive0 */ 358 outb_p(0x0a, 0x170 + IDE_SELECT_OFFSET); /* select drive0 */
357 udelay(100); 359 udelay(100);
@@ -359,11 +361,11 @@ static int __init secondary_port_responding (void)
359 outb_p(0x1a, 0x170 + IDE_SELECT_OFFSET); /* select drive1 */ 361 outb_p(0x1a, 0x170 + IDE_SELECT_OFFSET); /* select drive1 */
360 udelay(100); 362 udelay(100);
361 if ((inb_p(0x170 + IDE_SELECT_OFFSET) & 0x1f) != 0x1a) { 363 if ((inb_p(0x170 + IDE_SELECT_OFFSET) & 0x1f) != 0x1a) {
362 spin_unlock_irqrestore(&ide_lock, flags); 364 spin_unlock_irqrestore(&cmd640_lock, flags);
363 return 0; /* nothing responded */ 365 return 0; /* nothing responded */
364 } 366 }
365 } 367 }
366 spin_unlock_irqrestore(&ide_lock, flags); 368 spin_unlock_irqrestore(&cmd640_lock, flags);
367 return 1; /* success */ 369 return 1; /* success */
368} 370}
369 371
@@ -440,11 +442,11 @@ static void __init setup_device_ptrs (void)
440static void set_prefetch_mode (unsigned int index, int mode) 442static void set_prefetch_mode (unsigned int index, int mode)
441{ 443{
442 ide_drive_t *drive = cmd_drives[index]; 444 ide_drive_t *drive = cmd_drives[index];
445 unsigned long flags;
443 int reg = prefetch_regs[index]; 446 int reg = prefetch_regs[index];
444 u8 b; 447 u8 b;
445 unsigned long flags;
446 448
447 spin_lock_irqsave(&ide_lock, flags); 449 spin_lock_irqsave(&cmd640_lock, flags);
448 b = __get_cmd640_reg(reg); 450 b = __get_cmd640_reg(reg);
449 if (mode) { /* want prefetch on? */ 451 if (mode) { /* want prefetch on? */
450#if CMD640_PREFETCH_MASKS 452#if CMD640_PREFETCH_MASKS
@@ -460,7 +462,7 @@ static void set_prefetch_mode (unsigned int index, int mode)
460 b |= prefetch_masks[index]; /* disable prefetch */ 462 b |= prefetch_masks[index]; /* disable prefetch */
461 } 463 }
462 __put_cmd640_reg(reg, b); 464 __put_cmd640_reg(reg, b);
463 spin_unlock_irqrestore(&ide_lock, flags); 465 spin_unlock_irqrestore(&cmd640_lock, flags);
464} 466}
465 467
466/* 468/*
@@ -561,7 +563,7 @@ static void program_drive_counts (unsigned int index)
561 /* 563 /*
562 * Now that everything is ready, program the new timings 564 * Now that everything is ready, program the new timings
563 */ 565 */
564 spin_lock_irqsave(&ide_lock, flags); 566 spin_lock_irqsave(&cmd640_lock, flags);
565 /* 567 /*
566 * Program the address_setup clocks into ARTTIM reg, 568 * Program the address_setup clocks into ARTTIM reg,
567 * and then the active/recovery counts into the DRWTIM reg 569 * and then the active/recovery counts into the DRWTIM reg
@@ -570,7 +572,7 @@ static void program_drive_counts (unsigned int index)
570 setup_count |= __get_cmd640_reg(arttim_regs[index]) & 0x3f; 572 setup_count |= __get_cmd640_reg(arttim_regs[index]) & 0x3f;
571 __put_cmd640_reg(arttim_regs[index], setup_count); 573 __put_cmd640_reg(arttim_regs[index], setup_count);
572 __put_cmd640_reg(drwtim_regs[index], pack_nibbles(active_count, recovery_count)); 574 __put_cmd640_reg(drwtim_regs[index], pack_nibbles(active_count, recovery_count));
573 spin_unlock_irqrestore(&ide_lock, flags); 575 spin_unlock_irqrestore(&cmd640_lock, flags);
574} 576}
575 577
576/* 578/*
@@ -670,20 +672,20 @@ static void cmd640_set_pio_mode(ide_drive_t *drive, const u8 pio)
670 672
671static int pci_conf1(void) 673static int pci_conf1(void)
672{ 674{
673 u32 tmp;
674 unsigned long flags; 675 unsigned long flags;
676 u32 tmp;
675 677
676 spin_lock_irqsave(&ide_lock, flags); 678 spin_lock_irqsave(&cmd640_lock, flags);
677 outb(0x01, 0xCFB); 679 outb(0x01, 0xCFB);
678 tmp = inl(0xCF8); 680 tmp = inl(0xCF8);
679 outl(0x80000000, 0xCF8); 681 outl(0x80000000, 0xCF8);
680 if (inl(0xCF8) == 0x80000000) { 682 if (inl(0xCF8) == 0x80000000) {
681 outl(tmp, 0xCF8); 683 outl(tmp, 0xCF8);
682 spin_unlock_irqrestore(&ide_lock, flags); 684 spin_unlock_irqrestore(&cmd640_lock, flags);
683 return 1; 685 return 1;
684 } 686 }
685 outl(tmp, 0xCF8); 687 outl(tmp, 0xCF8);
686 spin_unlock_irqrestore(&ide_lock, flags); 688 spin_unlock_irqrestore(&cmd640_lock, flags);
687 return 0; 689 return 0;
688} 690}
689 691
@@ -691,15 +693,15 @@ static int pci_conf2(void)
691{ 693{
692 unsigned long flags; 694 unsigned long flags;
693 695
694 spin_lock_irqsave(&ide_lock, flags); 696 spin_lock_irqsave(&cmd640_lock, flags);
695 outb(0x00, 0xCFB); 697 outb(0x00, 0xCFB);
696 outb(0x00, 0xCF8); 698 outb(0x00, 0xCF8);
697 outb(0x00, 0xCFA); 699 outb(0x00, 0xCFA);
698 if (inb(0xCF8) == 0x00 && inb(0xCF8) == 0x00) { 700 if (inb(0xCF8) == 0x00 && inb(0xCF8) == 0x00) {
699 spin_unlock_irqrestore(&ide_lock, flags); 701 spin_unlock_irqrestore(&cmd640_lock, flags);
700 return 1; 702 return 1;
701 } 703 }
702 spin_unlock_irqrestore(&ide_lock, flags); 704 spin_unlock_irqrestore(&cmd640_lock, flags);
703 return 0; 705 return 0;
704} 706}
705 707
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index adee2ef6fd7..ea0143ef5fe 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -535,7 +535,6 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
535 hwif->ide_dma_test_irq = &cmd648_ide_dma_test_irq; 535 hwif->ide_dma_test_irq = &cmd648_ide_dma_test_irq;
536 break; 536 break;
537 case PCI_DEVICE_ID_CMD_646: 537 case PCI_DEVICE_ID_CMD_646:
538 hwif->chipset = ide_cmd646;
539 if (dev->revision == 0x01) { 538 if (dev->revision == 0x01) {
540 hwif->ide_dma_end = &cmd646_1_ide_dma_end; 539 hwif->ide_dma_end = &cmd646_1_ide_dma_end;
541 break; 540 break;
@@ -549,7 +548,7 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
549 } 548 }
550} 549}
551 550
552static ide_pci_device_t cmd64x_chipsets[] __devinitdata = { 551static const struct ide_port_info cmd64x_chipsets[] __devinitdata = {
553 { /* 0 */ 552 { /* 0 */
554 .name = "CMD643", 553 .name = "CMD643",
555 .init_chipset = init_chipset_cmd64x, 554 .init_chipset = init_chipset_cmd64x,
@@ -573,6 +572,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
573 .init_chipset = init_chipset_cmd64x, 572 .init_chipset = init_chipset_cmd64x,
574 .init_hwif = init_hwif_cmd64x, 573 .init_hwif = init_hwif_cmd64x,
575 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, 574 .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
575 .chipset = ide_cmd646,
576 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE, 576 .host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
577 .pio_mask = ATA_PIO5, 577 .pio_mask = ATA_PIO5,
578 .mwdma_mask = ATA_MWDMA2, 578 .mwdma_mask = ATA_MWDMA2,
@@ -591,7 +591,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
591 591
592static int __devinit cmd64x_init_one(struct pci_dev *dev, const struct pci_device_id *id) 592static int __devinit cmd64x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
593{ 593{
594 ide_pci_device_t d; 594 struct ide_port_info d;
595 u8 idx = id->driver_data; 595 u8 idx = id->driver_data;
596 596
597 d = cmd64x_chipsets[idx]; 597 d = cmd64x_chipsets[idx];
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index aa98e817d38..0466462fd21 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -141,7 +141,7 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
141 .pio_mask = ATA_PIO4, \ 141 .pio_mask = ATA_PIO4, \
142 } 142 }
143 143
144static ide_pci_device_t cyrix_chipsets[] __devinitdata = { 144static const struct ide_port_info cyrix_chipsets[] __devinitdata = {
145 /* 0 */ DECLARE_CS_DEV("Cyrix 5510"), 145 /* 0 */ DECLARE_CS_DEV("Cyrix 5510"),
146 /* 1 */ DECLARE_CS_DEV("Cyrix 5520") 146 /* 1 */ DECLARE_CS_DEV("Cyrix 5520")
147}; 147};
@@ -154,9 +154,8 @@ static ide_pci_device_t cyrix_chipsets[] __devinitdata = {
154 154
155static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id) 155static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id)
156{ 156{
157 ide_hwif_t *hwif = NULL, *mate = NULL; 157 const struct ide_port_info *d = &cyrix_chipsets[id->driver_data];
158 ata_index_t index; 158 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
159 ide_pci_device_t *d = &cyrix_chipsets[id->driver_data];
160 159
161 ide_setup_pci_noise(dev, d); 160 ide_setup_pci_noise(dev, d);
162 161
@@ -172,29 +171,14 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
172 return -ENODEV; 171 return -ENODEV;
173 } 172 }
174 173
175 index.all = 0xf0f0;
176
177 /* 174 /*
178 * Now the chipset is configured we can let the core 175 * Now the chipset is configured we can let the core
179 * do all the device setup for us 176 * do all the device setup for us
180 */ 177 */
181 178
182 ide_pci_setup_ports(dev, d, 14, &index); 179 ide_pci_setup_ports(dev, d, 14, &idx[0]);
183
184 if ((index.b.low & 0xf0) != 0xf0)
185 hwif = &ide_hwifs[index.b.low];
186 if ((index.b.high & 0xf0) != 0xf0)
187 mate = &ide_hwifs[index.b.high];
188
189 if (hwif)
190 probe_hwif_init(hwif);
191 if (mate)
192 probe_hwif_init(mate);
193 180
194 if (hwif) 181 ide_device_add(idx);
195 ide_proc_register_port(hwif);
196 if (mate)
197 ide_proc_register_port(mate);
198 182
199 return 0; 183 return 0;
200} 184}
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index ba0c6eba024..599408952bd 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/cs5530.c Version 0.76 Aug 3 2007 2 * linux/drivers/ide/pci/cs5530.c Version 0.77 Sep 24 2007
3 * 3 *
4 * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org>
5 * Copyright (C) 2000 Mark Lord <mlord@pobox.com> 5 * Copyright (C) 2000 Mark Lord <mlord@pobox.com>
@@ -146,7 +146,6 @@ static void cs5530_set_dma_mode(ide_drive_t *drive, const u8 mode)
146static unsigned int __devinit init_chipset_cs5530 (struct pci_dev *dev, const char *name) 146static unsigned int __devinit init_chipset_cs5530 (struct pci_dev *dev, const char *name)
147{ 147{
148 struct pci_dev *master_0 = NULL, *cs5530_0 = NULL; 148 struct pci_dev *master_0 = NULL, *cs5530_0 = NULL;
149 unsigned long flags;
150 149
151 if (pci_resource_start(dev, 4) == 0) 150 if (pci_resource_start(dev, 4) == 0)
152 return -EFAULT; 151 return -EFAULT;
@@ -171,9 +170,6 @@ static unsigned int __devinit init_chipset_cs5530 (struct pci_dev *dev, const ch
171 goto out; 170 goto out;
172 } 171 }
173 172
174 spin_lock_irqsave(&ide_lock, flags);
175 /* all CPUs (there should only be one CPU with this chipset) */
176
177 /* 173 /*
178 * Enable BusMaster and MemoryWriteAndInvalidate for the cs5530: 174 * Enable BusMaster and MemoryWriteAndInvalidate for the cs5530:
179 * --> OR 0x14 into 16-bit PCI COMMAND reg of function 0 of the cs5530 175 * --> OR 0x14 into 16-bit PCI COMMAND reg of function 0 of the cs5530
@@ -224,8 +220,6 @@ static unsigned int __devinit init_chipset_cs5530 (struct pci_dev *dev, const ch
224 pci_write_config_byte(master_0, 0x42, 0x00); 220 pci_write_config_byte(master_0, 0x42, 0x00);
225 pci_write_config_byte(master_0, 0x43, 0xc1); 221 pci_write_config_byte(master_0, 0x43, 0xc1);
226 222
227 spin_unlock_irqrestore(&ide_lock, flags);
228
229out: 223out:
230 pci_dev_put(master_0); 224 pci_dev_put(master_0);
231 pci_dev_put(cs5530_0); 225 pci_dev_put(cs5530_0);
@@ -261,7 +255,7 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif)
261 hwif->udma_filter = cs5530_udma_filter; 255 hwif->udma_filter = cs5530_udma_filter;
262} 256}
263 257
264static ide_pci_device_t cs5530_chipset __devinitdata = { 258static const struct ide_port_info cs5530_chipset __devinitdata = {
265 .name = "CS5530", 259 .name = "CS5530",
266 .init_chipset = init_chipset_cs5530, 260 .init_chipset = init_chipset_cs5530,
267 .init_hwif = init_hwif_cs5530, 261 .init_hwif = init_hwif_cs5530,
diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c
index 5ac82ffa5c0..9094916e378 100644
--- a/drivers/ide/pci/cs5535.c
+++ b/drivers/ide/pci/cs5535.c
@@ -186,7 +186,7 @@ static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
186 hwif->cbl = cs5535_cable_detect(hwif->pci_dev); 186 hwif->cbl = cs5535_cable_detect(hwif->pci_dev);
187} 187}
188 188
189static ide_pci_device_t cs5535_chipset __devinitdata = { 189static const struct ide_port_info cs5535_chipset __devinitdata = {
190 .name = "CS5535", 190 .name = "CS5535",
191 .init_hwif = init_hwif_cs5535, 191 .init_hwif = init_hwif_cs5535,
192 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_POST_SET_MODE | 192 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_POST_SET_MODE |
diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c
index efc20bd97fd..3ef4fc10fe2 100644
--- a/drivers/ide/pci/cy82c693.c
+++ b/drivers/ide/pci/cy82c693.c
@@ -428,7 +428,6 @@ static unsigned int __devinit init_chipset_cy82c693(struct pci_dev *dev, const c
428 */ 428 */
429static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif) 429static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
430{ 430{
431 hwif->chipset = ide_cy82c693;
432 hwif->set_pio_mode = &cy82c693_set_pio_mode; 431 hwif->set_pio_mode = &cy82c693_set_pio_mode;
433 432
434 if (hwif->dma_base == 0) 433 if (hwif->dma_base == 0)
@@ -449,11 +448,12 @@ static void __devinit init_iops_cy82c693(ide_hwif_t *hwif)
449 } 448 }
450} 449}
451 450
452static ide_pci_device_t cy82c693_chipset __devinitdata = { 451static const struct ide_port_info cy82c693_chipset __devinitdata = {
453 .name = "CY82C693", 452 .name = "CY82C693",
454 .init_chipset = init_chipset_cy82c693, 453 .init_chipset = init_chipset_cy82c693,
455 .init_iops = init_iops_cy82c693, 454 .init_iops = init_iops_cy82c693,
456 .init_hwif = init_hwif_cy82c693, 455 .init_hwif = init_hwif_cy82c693,
456 .chipset = ide_cy82c693,
457 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_TRUST_BIOS_FOR_DMA | 457 .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_TRUST_BIOS_FOR_DMA |
458 IDE_HFLAG_BOOTABLE, 458 IDE_HFLAG_BOOTABLE,
459 .pio_mask = ATA_PIO4, 459 .pio_mask = ATA_PIO4,
diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c
index 46f4a888c03..83829081640 100644
--- a/drivers/ide/pci/delkin_cb.c
+++ b/drivers/ide/pci/delkin_cb.c
@@ -80,7 +80,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
80 hw.irq = dev->irq; 80 hw.irq = dev->irq;
81 hw.chipset = ide_pci; /* this enables IRQ sharing */ 81 hw.chipset = ide_pci; /* this enables IRQ sharing */
82 82
83 rc = ide_register_hw_with_fixup(&hw, 0, &hwif, ide_undecoded_slave); 83 rc = ide_register_hw(&hw, &ide_undecoded_slave, 0, &hwif);
84 if (rc < 0) { 84 if (rc < 0) {
85 printk(KERN_ERR "delkin_cb: ide_register_hw failed (%d)\n", rc); 85 printk(KERN_ERR "delkin_cb: ide_register_hw failed (%d)\n", rc);
86 pci_disable_device(dev); 86 pci_disable_device(dev);
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c
index 51165832e7f..f44d70852c3 100644
--- a/drivers/ide/pci/generic.c
+++ b/drivers/ide/pci/generic.c
@@ -54,37 +54,24 @@ __setup("all-generic-ide", ide_generic_all_on);
54module_param_named(all_generic_ide, ide_generic_all, bool, 0444); 54module_param_named(all_generic_ide, ide_generic_all, bool, 0444);
55MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers."); 55MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers.");
56 56
57static void __devinit init_hwif_generic (ide_hwif_t *hwif) 57#define IDE_HFLAGS_UMC (IDE_HFLAG_NO_DMA | IDE_HFLAG_FORCE_LEGACY_IRQS)
58{
59 switch(hwif->pci_dev->device) {
60 case PCI_DEVICE_ID_UMC_UM8673F:
61 case PCI_DEVICE_ID_UMC_UM8886A:
62 case PCI_DEVICE_ID_UMC_UM8886BF:
63 hwif->irq = hwif->channel ? 15 : 14;
64 break;
65 default:
66 break;
67 }
68}
69 58
70#define DECLARE_GENERIC_PCI_DEV(name_str, dma_setting) \ 59#define DECLARE_GENERIC_PCI_DEV(name_str, extra_flags) \
71 { \ 60 { \
72 .name = name_str, \ 61 .name = name_str, \
73 .init_hwif = init_hwif_generic, \
74 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | \ 62 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | \
75 dma_setting | \ 63 extra_flags | \
76 IDE_HFLAG_BOOTABLE, \ 64 IDE_HFLAG_BOOTABLE, \
77 .swdma_mask = ATA_SWDMA2, \ 65 .swdma_mask = ATA_SWDMA2, \
78 .mwdma_mask = ATA_MWDMA2, \ 66 .mwdma_mask = ATA_MWDMA2, \
79 .udma_mask = ATA_UDMA6, \ 67 .udma_mask = ATA_UDMA6, \
80 } 68 }
81 69
82static ide_pci_device_t generic_chipsets[] __devinitdata = { 70static const struct ide_port_info generic_chipsets[] __devinitdata = {
83 /* 0 */ DECLARE_GENERIC_PCI_DEV("Unknown", 0), 71 /* 0 */ DECLARE_GENERIC_PCI_DEV("Unknown", 0),
84 72
85 { /* 1 */ 73 { /* 1 */
86 .name = "NS87410", 74 .name = "NS87410",
87 .init_hwif = init_hwif_generic,
88 .enablebits = {{0x43,0x08,0x08}, {0x47,0x08,0x08}}, 75 .enablebits = {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
89 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | 76 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
90 IDE_HFLAG_BOOTABLE, 77 IDE_HFLAG_BOOTABLE,
@@ -95,16 +82,15 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
95 82
96 /* 2 */ DECLARE_GENERIC_PCI_DEV("SAMURAI", 0), 83 /* 2 */ DECLARE_GENERIC_PCI_DEV("SAMURAI", 0),
97 /* 3 */ DECLARE_GENERIC_PCI_DEV("HT6565", 0), 84 /* 3 */ DECLARE_GENERIC_PCI_DEV("HT6565", 0),
98 /* 4 */ DECLARE_GENERIC_PCI_DEV("UM8673F", IDE_HFLAG_NO_DMA), 85 /* 4 */ DECLARE_GENERIC_PCI_DEV("UM8673F", IDE_HFLAGS_UMC),
99 /* 5 */ DECLARE_GENERIC_PCI_DEV("UM8886A", IDE_HFLAG_NO_DMA), 86 /* 5 */ DECLARE_GENERIC_PCI_DEV("UM8886A", IDE_HFLAGS_UMC),
100 /* 6 */ DECLARE_GENERIC_PCI_DEV("UM8886BF", IDE_HFLAG_NO_DMA), 87 /* 6 */ DECLARE_GENERIC_PCI_DEV("UM8886BF", IDE_HFLAGS_UMC),
101 /* 7 */ DECLARE_GENERIC_PCI_DEV("HINT_IDE", 0), 88 /* 7 */ DECLARE_GENERIC_PCI_DEV("HINT_IDE", 0),
102 /* 8 */ DECLARE_GENERIC_PCI_DEV("VIA_IDE", IDE_HFLAG_NO_AUTODMA), 89 /* 8 */ DECLARE_GENERIC_PCI_DEV("VIA_IDE", IDE_HFLAG_NO_AUTODMA),
103 /* 9 */ DECLARE_GENERIC_PCI_DEV("OPTI621V", IDE_HFLAG_NO_AUTODMA), 90 /* 9 */ DECLARE_GENERIC_PCI_DEV("OPTI621V", IDE_HFLAG_NO_AUTODMA),
104 91
105 { /* 10 */ 92 { /* 10 */
106 .name = "VIA8237SATA", 93 .name = "VIA8237SATA",
107 .init_hwif = init_hwif_generic,
108 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | 94 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
109 IDE_HFLAG_OFF_BOARD, 95 IDE_HFLAG_OFF_BOARD,
110 .swdma_mask = ATA_SWDMA2, 96 .swdma_mask = ATA_SWDMA2,
@@ -118,7 +104,6 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
118 104
119 { /* 14 */ 105 { /* 14 */
120 .name = "Revolution", 106 .name = "Revolution",
121 .init_hwif = init_hwif_generic,
122 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | 107 .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
123 IDE_HFLAG_OFF_BOARD, 108 IDE_HFLAG_OFF_BOARD,
124 .swdma_mask = ATA_SWDMA2, 109 .swdma_mask = ATA_SWDMA2,
@@ -138,7 +123,7 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
138 123
139static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_device_id *id) 124static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_device_id *id)
140{ 125{
141 ide_pci_device_t *d = &generic_chipsets[id->driver_data]; 126 const struct ide_port_info *d = &generic_chipsets[id->driver_data];
142 int ret = -ENODEV; 127 int ret = -ENODEV;
143 128
144 /* Don't use the generic entry unless instructed to do so */ 129 /* Don't use the generic entry unless instructed to do so */
diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c
index 67af1a7dde3..ae6307fae4f 100644
--- a/drivers/ide/pci/hpt34x.c
+++ b/drivers/ide/pci/hpt34x.c
@@ -129,7 +129,7 @@ static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
129 hwif->set_dma_mode = &hpt34x_set_mode; 129 hwif->set_dma_mode = &hpt34x_set_mode;
130} 130}
131 131
132static ide_pci_device_t hpt34x_chipsets[] __devinitdata = { 132static const struct ide_port_info hpt34x_chipsets[] __devinitdata = {
133 { /* 0 */ 133 { /* 0 */
134 .name = "HPT343", 134 .name = "HPT343",
135 .init_chipset = init_chipset_hpt34x, 135 .init_chipset = init_chipset_hpt34x,
@@ -158,7 +158,7 @@ static ide_pci_device_t hpt34x_chipsets[] __devinitdata = {
158 158
159static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id) 159static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
160{ 160{
161 ide_pci_device_t *d; 161 const struct ide_port_info *d;
162 u16 pcicmd = 0; 162 u16 pcicmd = 0;
163 163
164 pci_read_config_word(dev, PCI_COMMAND, &pcicmd); 164 pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index 18f5b7ddaee..612b795241b 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1425,7 +1425,7 @@ static int __devinit hpt36x_init(struct pci_dev *dev, struct pci_dev *dev2)
1425 return 0; 1425 return 0;
1426} 1426}
1427 1427
1428static ide_pci_device_t hpt366_chipsets[] __devinitdata = { 1428static const struct ide_port_info hpt366_chipsets[] __devinitdata = {
1429 { /* 0 */ 1429 { /* 0 */
1430 .name = "HPT36x", 1430 .name = "HPT36x",
1431 .init_chipset = init_chipset_hpt366, 1431 .init_chipset = init_chipset_hpt366,
@@ -1510,7 +1510,7 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
1510{ 1510{
1511 struct hpt_info *info = NULL; 1511 struct hpt_info *info = NULL;
1512 struct pci_dev *dev2 = NULL; 1512 struct pci_dev *dev2 = NULL;
1513 ide_pci_device_t d; 1513 struct ide_port_info d;
1514 u8 idx = id->driver_data; 1514 u8 idx = id->driver_data;
1515 u8 rev = dev->revision; 1515 u8 rev = dev->revision;
1516 1516
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c
index dfbe605120c..90b52ed37bf 100644
--- a/drivers/ide/pci/it8213.c
+++ b/drivers/ide/pci/it8213.c
@@ -193,7 +193,7 @@ static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
193 .udma_mask = ATA_UDMA6, \ 193 .udma_mask = ATA_UDMA6, \
194 } 194 }
195 195
196static ide_pci_device_t it8213_chipsets[] __devinitdata = { 196static const struct ide_port_info it8213_chipsets[] __devinitdata = {
197 /* 0 */ DECLARE_ITE_DEV("IT8213"), 197 /* 0 */ DECLARE_ITE_DEV("IT8213"),
198}; 198};
199 199
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index ec45b724720..5c997543531 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -95,7 +95,7 @@ struct it821x_dev
95 95
96/* 96/*
97 * We allow users to force the card into non raid mode without 97 * We allow users to force the card into non raid mode without
98 * flashing the alternative BIOS. This is also neccessary right now 98 * flashing the alternative BIOS. This is also necessary right now
99 * for embedded platforms that cannot run a PC BIOS but are using this 99 * for embedded platforms that cannot run a PC BIOS but are using this
100 * device. 100 * device.
101 */ 101 */
@@ -564,7 +564,7 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
564 564
565 /* 565 /*
566 * Not in the docs but according to the reference driver 566 * Not in the docs but according to the reference driver
567 * this is neccessary. 567 * this is necessary.
568 */ 568 */
569 569
570 pci_read_config_byte(hwif->pci_dev, 0x08, &conf); 570 pci_read_config_byte(hwif->pci_dev, 0x08, &conf);
@@ -638,7 +638,7 @@ static unsigned int __devinit init_chipset_it821x(struct pci_dev *dev, const cha
638 .pio_mask = ATA_PIO4, \ 638 .pio_mask = ATA_PIO4, \
639 } 639 }
640 640
641static ide_pci_device_t it821x_chipsets[] __devinitdata = { 641static const struct ide_port_info it821x_chipsets[] __devinitdata = {
642 /* 0 */ DECLARE_ITE_DEV("IT8212"), 642 /* 0 */ DECLARE_ITE_DEV("IT8212"),
643}; 643};
644 644
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c
index 2eeff670d9a..bdf64d99770 100644
--- a/drivers/ide/pci/jmicron.c
+++ b/drivers/ide/pci/jmicron.c
@@ -118,7 +118,7 @@ static void __devinit init_hwif_jmicron(ide_hwif_t *hwif)
118 hwif->cbl = ata66_jmicron(hwif); 118 hwif->cbl = ata66_jmicron(hwif);
119} 119}
120 120
121static ide_pci_device_t jmicron_chipset __devinitdata = { 121static const struct ide_port_info jmicron_chipset __devinitdata = {
122 .name = "JMB", 122 .name = "JMB",
123 .init_hwif = init_hwif_jmicron, 123 .init_hwif = init_hwif_jmicron,
124 .host_flags = IDE_HFLAG_BOOTABLE, 124 .host_flags = IDE_HFLAG_BOOTABLE,
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c
index d21b5892382..d4df4642dbb 100644
--- a/drivers/ide/pci/ns87415.c
+++ b/drivers/ide/pci/ns87415.c
@@ -260,7 +260,7 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
260 hwif->ide_dma_end = &ns87415_ide_dma_end; 260 hwif->ide_dma_end = &ns87415_ide_dma_end;
261} 261}
262 262
263static ide_pci_device_t ns87415_chipset __devinitdata = { 263static const struct ide_port_info ns87415_chipset __devinitdata = {
264 .name = "NS87415", 264 .name = "NS87415",
265#ifdef CONFIG_SUPERIO 265#ifdef CONFIG_SUPERIO
266 .init_iops = init_iops_ns87415, 266 .init_iops = init_iops_ns87415,
diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c
index 3573ffeaaa3..8953d9c3926 100644
--- a/drivers/ide/pci/opti621.c
+++ b/drivers/ide/pci/opti621.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/opti621.c Version 0.8 Aug 27, 2007 2 * linux/drivers/ide/pci/opti621.c Version 0.9 Sep 24, 2007
3 * 3 *
4 * Copyright (C) 1996-1998 Linus Torvalds & authors (see below) 4 * Copyright (C) 1996-1998 Linus Torvalds & authors (see below)
5 */ 5 */
@@ -133,6 +133,8 @@ static int reg_base;
133#define PIO_NOT_EXIST 254 133#define PIO_NOT_EXIST 254
134#define PIO_DONT_KNOW 255 134#define PIO_DONT_KNOW 255
135 135
136static DEFINE_SPINLOCK(opti621_lock);
137
136/* there are stored pio numbers from other calls of opti621_set_pio_mode */ 138/* there are stored pio numbers from other calls of opti621_set_pio_mode */
137static void compute_pios(ide_drive_t *drive, const u8 pio) 139static void compute_pios(ide_drive_t *drive, const u8 pio)
138/* Store values into drive->drive_data 140/* Store values into drive->drive_data
@@ -278,7 +280,7 @@ static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio)
278 second.recovery_time, drdy); 280 second.recovery_time, drdy);
279#endif 281#endif
280 282
281 spin_lock_irqsave(&ide_lock, flags); 283 spin_lock_irqsave(&opti621_lock, flags);
282 284
283 reg_base = hwif->io_ports[IDE_DATA_OFFSET]; 285 reg_base = hwif->io_ports[IDE_DATA_OFFSET];
284 286
@@ -317,7 +319,7 @@ static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio)
317 /* and read prefetch for both drives */ 319 /* and read prefetch for both drives */
318 write_reg(misc, MISC_REG); 320 write_reg(misc, MISC_REG);
319 321
320 spin_unlock_irqrestore(&ide_lock, flags); 322 spin_unlock_irqrestore(&opti621_lock, flags);
321} 323}
322 324
323/* 325/*
@@ -331,7 +333,7 @@ static void __devinit init_hwif_opti621 (ide_hwif_t *hwif)
331 hwif->set_pio_mode = &opti621_set_pio_mode; 333 hwif->set_pio_mode = &opti621_set_pio_mode;
332} 334}
333 335
334static ide_pci_device_t opti621_chipsets[] __devinitdata = { 336static const struct ide_port_info opti621_chipsets[] __devinitdata = {
335 { /* 0 */ 337 { /* 0 */
336 .name = "OPTI621", 338 .name = "OPTI621",
337 .init_hwif = init_hwif_opti621, 339 .init_hwif = init_hwif_opti621,
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index d1e7823454f..4234efeba60 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -513,7 +513,7 @@ static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev)
513 .udma_mask = udma, \ 513 .udma_mask = udma, \
514 } 514 }
515 515
516static ide_pci_device_t pdcnew_chipsets[] __devinitdata = { 516static const struct ide_port_info pdcnew_chipsets[] __devinitdata = {
517 /* 0 */ DECLARE_PDCNEW_DEV("PDC20268", ATA_UDMA5), 517 /* 0 */ DECLARE_PDCNEW_DEV("PDC20268", ATA_UDMA5),
518 /* 1 */ DECLARE_PDCNEW_DEV("PDC20269", ATA_UDMA6), 518 /* 1 */ DECLARE_PDCNEW_DEV("PDC20269", ATA_UDMA6),
519 /* 2 */ DECLARE_PDCNEW_DEV("PDC20270", ATA_UDMA5), 519 /* 2 */ DECLARE_PDCNEW_DEV("PDC20270", ATA_UDMA5),
@@ -534,7 +534,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
534 534
535static int __devinit pdc202new_init_one(struct pci_dev *dev, const struct pci_device_id *id) 535static int __devinit pdc202new_init_one(struct pci_dev *dev, const struct pci_device_id *id)
536{ 536{
537 ide_pci_device_t *d; 537 const struct ide_port_info *d;
538 struct pci_dev *bridge = dev->bus->self; 538 struct pci_dev *bridge = dev->bus->self;
539 u8 idx = id->driver_data; 539 u8 idx = id->driver_data;
540 540
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 29306121dc4..e09742e2ba5 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -302,13 +302,6 @@ static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev,
302 302
303static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif) 303static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
304{ 304{
305 struct pci_dev *dev = hwif->pci_dev;
306
307 /* PDC20265 has problems with large LBA48 requests */
308 if ((dev->device == PCI_DEVICE_ID_PROMISE_20267) ||
309 (dev->device == PCI_DEVICE_ID_PROMISE_20265))
310 hwif->rqsize = 256;
311
312 hwif->set_pio_mode = &pdc202xx_set_pio_mode; 305 hwif->set_pio_mode = &pdc202xx_set_pio_mode;
313 hwif->set_dma_mode = &pdc202xx_set_mode; 306 hwif->set_dma_mode = &pdc202xx_set_mode;
314 307
@@ -382,7 +375,7 @@ static void __devinit pdc202ata4_fixup_irq(struct pci_dev *dev,
382 } 375 }
383} 376}
384 377
385#define DECLARE_PDC2026X_DEV(name_str, udma) \ 378#define DECLARE_PDC2026X_DEV(name_str, udma, extra_flags) \
386 { \ 379 { \
387 .name = name_str, \ 380 .name = name_str, \
388 .init_chipset = init_chipset_pdc202xx, \ 381 .init_chipset = init_chipset_pdc202xx, \
@@ -390,13 +383,14 @@ static void __devinit pdc202ata4_fixup_irq(struct pci_dev *dev,
390 .init_dma = init_dma_pdc202xx, \ 383 .init_dma = init_dma_pdc202xx, \
391 .extra = 48, \ 384 .extra = 48, \
392 .host_flags = IDE_HFLAG_ERROR_STOPS_FIFO | \ 385 .host_flags = IDE_HFLAG_ERROR_STOPS_FIFO | \
386 extra_flags | \
393 IDE_HFLAG_OFF_BOARD, \ 387 IDE_HFLAG_OFF_BOARD, \
394 .pio_mask = ATA_PIO4, \ 388 .pio_mask = ATA_PIO4, \
395 .mwdma_mask = ATA_MWDMA2, \ 389 .mwdma_mask = ATA_MWDMA2, \
396 .udma_mask = udma, \ 390 .udma_mask = udma, \
397 } 391 }
398 392
399static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { 393static const struct ide_port_info pdc202xx_chipsets[] __devinitdata = {
400 { /* 0 */ 394 { /* 0 */
401 .name = "PDC20246", 395 .name = "PDC20246",
402 .init_chipset = init_chipset_pdc202xx, 396 .init_chipset = init_chipset_pdc202xx,
@@ -410,10 +404,10 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
410 .udma_mask = ATA_UDMA2, 404 .udma_mask = ATA_UDMA2,
411 }, 405 },
412 406
413 /* 1 */ DECLARE_PDC2026X_DEV("PDC20262", ATA_UDMA4), 407 /* 1 */ DECLARE_PDC2026X_DEV("PDC20262", ATA_UDMA4, 0),
414 /* 2 */ DECLARE_PDC2026X_DEV("PDC20263", ATA_UDMA4), 408 /* 2 */ DECLARE_PDC2026X_DEV("PDC20263", ATA_UDMA4, 0),
415 /* 3 */ DECLARE_PDC2026X_DEV("PDC20265", ATA_UDMA5), 409 /* 3 */ DECLARE_PDC2026X_DEV("PDC20265", ATA_UDMA5, IDE_HFLAG_RQSIZE_256),
416 /* 4 */ DECLARE_PDC2026X_DEV("PDC20267", ATA_UDMA5), 410 /* 4 */ DECLARE_PDC2026X_DEV("PDC20267", ATA_UDMA5, IDE_HFLAG_RQSIZE_256),
417}; 411};
418 412
419/** 413/**
@@ -427,7 +421,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
427 421
428static int __devinit pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) 422static int __devinit pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
429{ 423{
430 ide_pci_device_t *d; 424 const struct ide_port_info *d;
431 u8 idx = id->driver_data; 425 u8 idx = id->driver_data;
432 426
433 d = &pdc202xx_chipsets[idx]; 427 d = &pdc202xx_chipsets[idx];
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index ec0c6e96a21..9329d4a810e 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -396,7 +396,7 @@ static void __devinit init_hwif_ich(ide_hwif_t *hwif)
396 .udma_mask = udma, \ 396 .udma_mask = udma, \
397 } 397 }
398 398
399static ide_pci_device_t piix_pci_info[] __devinitdata = { 399static const struct ide_port_info piix_pci_info[] __devinitdata = {
400 /* 0 */ DECLARE_PIIX_DEV("PIIXa", 0x00), /* no udma */ 400 /* 0 */ DECLARE_PIIX_DEV("PIIXa", 0x00), /* no udma */
401 /* 1 */ DECLARE_PIIX_DEV("PIIXb", 0x00), /* no udma */ 401 /* 1 */ DECLARE_PIIX_DEV("PIIXb", 0x00), /* no udma */
402 402
@@ -449,9 +449,7 @@ static ide_pci_device_t piix_pci_info[] __devinitdata = {
449 449
450static int __devinit piix_init_one(struct pci_dev *dev, const struct pci_device_id *id) 450static int __devinit piix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
451{ 451{
452 ide_pci_device_t *d = &piix_pci_info[id->driver_data]; 452 return ide_setup_pci_device(dev, &piix_pci_info[id->driver_data]);
453
454 return ide_setup_pci_device(dev, d);
455} 453}
456 454
457/** 455/**
diff --git a/drivers/ide/pci/rz1000.c b/drivers/ide/pci/rz1000.c
index dd2583ef1ad..6b10ae260fa 100644
--- a/drivers/ide/pci/rz1000.c
+++ b/drivers/ide/pci/rz1000.c
@@ -35,13 +35,13 @@ static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif)
35 u16 reg; 35 u16 reg;
36 struct pci_dev *dev = hwif->pci_dev; 36 struct pci_dev *dev = hwif->pci_dev;
37 37
38 hwif->chipset = ide_rz1000;
39 if (!pci_read_config_word (dev, 0x40, &reg) && 38 if (!pci_read_config_word (dev, 0x40, &reg) &&
40 !pci_write_config_word(dev, 0x40, reg & 0xdfff)) { 39 !pci_write_config_word(dev, 0x40, reg & 0xdfff)) {
41 printk(KERN_INFO "%s: disabled chipset read-ahead " 40 printk(KERN_INFO "%s: disabled chipset read-ahead "
42 "(buggy RZ1000/RZ1001)\n", hwif->name); 41 "(buggy RZ1000/RZ1001)\n", hwif->name);
43 } else { 42 } else {
44 hwif->serialized = 1; 43 if (hwif->mate)
44 hwif->mate->serialized = hwif->serialized = 1;
45 hwif->drives[0].no_unmask = 1; 45 hwif->drives[0].no_unmask = 1;
46 hwif->drives[1].no_unmask = 1; 46 hwif->drives[1].no_unmask = 1;
47 printk(KERN_INFO "%s: serialized, disabled unmasking " 47 printk(KERN_INFO "%s: serialized, disabled unmasking "
@@ -49,9 +49,10 @@ static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif)
49 } 49 }
50} 50}
51 51
52static ide_pci_device_t rz1000_chipset __devinitdata = { 52static const struct ide_port_info rz1000_chipset __devinitdata = {
53 .name = "RZ100x", 53 .name = "RZ100x",
54 .init_hwif = init_hwif_rz1000, 54 .init_hwif = init_hwif_rz1000,
55 .chipset = ide_rz1000,
55 .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_BOOTABLE, 56 .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_BOOTABLE,
56}; 57};
57 58
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index b2423e03bf3..d2c8b5524f2 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -372,7 +372,7 @@ static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
372 hwif->ide_dma_end = &sc1200_ide_dma_end; 372 hwif->ide_dma_end = &sc1200_ide_dma_end;
373} 373}
374 374
375static ide_pci_device_t sc1200_chipset __devinitdata = { 375static const struct ide_port_info sc1200_chipset __devinitdata = {
376 .name = "SC1200", 376 .name = "SC1200",
377 .init_hwif = init_hwif_sc1200, 377 .init_hwif = init_hwif_sc1200,
378 .host_flags = IDE_HFLAG_SERIALIZE | 378 .host_flags = IDE_HFLAG_SERIALIZE |
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c
index ae9b50331d2..ebb7132b9b8 100644
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -538,12 +538,13 @@ static int setup_mmio_scc (struct pci_dev *dev, const char *name)
538/** 538/**
539 * init_setup_scc - set up an SCC PATA Controller 539 * init_setup_scc - set up an SCC PATA Controller
540 * @dev: PCI device 540 * @dev: PCI device
541 * @d: IDE PCI device 541 * @d: IDE port info
542 * 542 *
543 * Perform the initial set up for this device. 543 * Perform the initial set up for this device.
544 */ 544 */
545 545
546static int __devinit init_setup_scc(struct pci_dev *dev, ide_pci_device_t *d) 546static int __devinit init_setup_scc(struct pci_dev *dev,
547 const struct ide_port_info *d)
547{ 548{
548 unsigned long ctl_base; 549 unsigned long ctl_base;
549 unsigned long dma_base; 550 unsigned long dma_base;
@@ -702,7 +703,7 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif)
702 .pio_mask = ATA_PIO4, \ 703 .pio_mask = ATA_PIO4, \
703 } 704 }
704 705
705static ide_pci_device_t scc_chipsets[] __devinitdata = { 706static const struct ide_port_info scc_chipsets[] __devinitdata = {
706 /* 0 */ DECLARE_SCC_DEV("sccIDE"), 707 /* 0 */ DECLARE_SCC_DEV("sccIDE"),
707}; 708};
708 709
@@ -717,9 +718,7 @@ static ide_pci_device_t scc_chipsets[] __devinitdata = {
717 718
718static int __devinit scc_init_one(struct pci_dev *dev, const struct pci_device_id *id) 719static int __devinit scc_init_one(struct pci_dev *dev, const struct pci_device_id *id)
719{ 720{
720 ide_pci_device_t *d = &scc_chipsets[id->driver_data]; 721 return init_setup_scc(dev, &scc_chipsets[id->driver_data]);
721
722 return init_setup_scc(dev, d);
723} 722}
724 723
725/** 724/**
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index a3d880e21d0..a7280311357 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -158,13 +158,6 @@ static void svwks_set_dma_mode(ide_drive_t *drive, const u8 speed)
158 158
159 u8 ultra_enable = 0, ultra_timing = 0, dma_timing = 0; 159 u8 ultra_enable = 0, ultra_timing = 0, dma_timing = 0;
160 160
161 /* If we are about to put a disk into UDMA mode we screwed up.
162 Our code assumes we never _ever_ do this on an OSB4 */
163
164 if(dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4 &&
165 drive->media == ide_disk && speed >= XFER_UDMA_0)
166 BUG();
167
168 pci_read_config_byte(dev, (0x56|hwif->channel), &ultra_timing); 161 pci_read_config_byte(dev, (0x56|hwif->channel), &ultra_timing);
169 pci_read_config_byte(dev, 0x54, &ultra_enable); 162 pci_read_config_byte(dev, 0x54, &ultra_enable);
170 163
@@ -373,7 +366,7 @@ static void __devinit init_hwif_svwks (ide_hwif_t *hwif)
373 } 366 }
374} 367}
375 368
376static ide_pci_device_t serverworks_chipsets[] __devinitdata = { 369static const struct ide_port_info serverworks_chipsets[] __devinitdata = {
377 { /* 0 */ 370 { /* 0 */
378 .name = "SvrWks OSB4", 371 .name = "SvrWks OSB4",
379 .init_chipset = init_chipset_svwks, 372 .init_chipset = init_chipset_svwks,
@@ -430,7 +423,7 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
430 423
431static int __devinit svwks_init_one(struct pci_dev *dev, const struct pci_device_id *id) 424static int __devinit svwks_init_one(struct pci_dev *dev, const struct pci_device_id *id)
432{ 425{
433 ide_pci_device_t d; 426 struct ide_port_info d;
434 u8 idx = id->driver_data; 427 u8 idx = id->driver_data;
435 428
436 d = serverworks_chipsets[idx]; 429 d = serverworks_chipsets[idx];
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 5af74ea1d46..de820aa58cd 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -614,6 +614,7 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
614 void __iomem *virt_base; 614 void __iomem *virt_base;
615 ide_hwif_t *hwif; 615 ide_hwif_t *hwif;
616 int h; 616 int h;
617 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
617 618
618 /* 619 /*
619 * Find an empty HWIF; if none available, return -ENOMEM. 620 * Find an empty HWIF; if none available, return -ENOMEM.
@@ -654,10 +655,12 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
654 } 655 }
655 656
656 if (hwif->io_ports[IDE_DATA_OFFSET] != cmd_base) { 657 if (hwif->io_ports[IDE_DATA_OFFSET] != cmd_base) {
658 hw_regs_t hw;
659
657 /* Initialize the IO registers */ 660 /* Initialize the IO registers */
658 sgiioc4_init_hwif_ports(&hwif->hw, cmd_base, ctl, irqport); 661 memset(&hw, 0, sizeof(hw));
659 memcpy(hwif->io_ports, hwif->hw.io_ports, 662 sgiioc4_init_hwif_ports(&hw, cmd_base, ctl, irqport);
660 sizeof (hwif->io_ports)); 663 memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
661 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; 664 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
662 } 665 }
663 666
@@ -679,11 +682,10 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
679 682
680 ide_init_sgiioc4(hwif); 683 ide_init_sgiioc4(hwif);
681 684
682 if (probe_hwif_init(hwif)) 685 idx[0] = hwif->index;
683 return -EIO;
684 686
685 /* Create /proc/ide entries */ 687 if (ide_device_add(idx))
686 ide_proc_register_port(hwif); 688 return -EIO;
687 689
688 return 0; 690 return 0;
689} 691}
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 689786df1ed..6d99441c605 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/siimage.c Version 1.17 Oct 18 2007 2 * linux/drivers/ide/pci/siimage.c Version 1.18 Oct 18 2007
3 * 3 *
4 * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org>
5 * Copyright (C) 2003 Red Hat <alan@redhat.com> 5 * Copyright (C) 2003 Red Hat <alan@redhat.com>
@@ -26,7 +26,7 @@
26 * 26 *
27 * If you have strange problems with nVidia chipset systems please 27 * If you have strange problems with nVidia chipset systems please
28 * see the SI support documentation and update your system BIOS 28 * see the SI support documentation and update your system BIOS
29 * if neccessary 29 * if necessary
30 * 30 *
31 * The Dell DRAC4 has some interesting features including effectively hot 31 * The Dell DRAC4 has some interesting features including effectively hot
32 * unplugging/replugging the virtual CD interface when the DRAC is reset. 32 * unplugging/replugging the virtual CD interface when the DRAC is reset.
@@ -57,8 +57,8 @@
57 57
58static int pdev_is_sata(struct pci_dev *pdev) 58static int pdev_is_sata(struct pci_dev *pdev)
59{ 59{
60 switch(pdev->device) 60#ifdef CONFIG_BLK_DEV_IDE_SATA
61 { 61 switch(pdev->device) {
62 case PCI_DEVICE_ID_SII_3112: 62 case PCI_DEVICE_ID_SII_3112:
63 case PCI_DEVICE_ID_SII_1210SA: 63 case PCI_DEVICE_ID_SII_1210SA:
64 return 1; 64 return 1;
@@ -66,9 +66,10 @@ static int pdev_is_sata(struct pci_dev *pdev)
66 return 0; 66 return 0;
67 } 67 }
68 BUG(); 68 BUG();
69#endif
69 return 0; 70 return 0;
70} 71}
71 72
72/** 73/**
73 * is_sata - check if hwif is SATA 74 * is_sata - check if hwif is SATA
74 * @hwif: interface to check 75 * @hwif: interface to check
@@ -136,7 +137,7 @@ static inline unsigned long siimage_seldev(ide_drive_t *drive, int r)
136 * SI3112 SATA controller life is a bit simpler. 137 * SI3112 SATA controller life is a bit simpler.
137 */ 138 */
138 139
139static u8 sil_udma_filter(ide_drive_t *drive) 140static u8 sil_pata_udma_filter(ide_drive_t *drive)
140{ 141{
141 ide_hwif_t *hwif = drive->hwif; 142 ide_hwif_t *hwif = drive->hwif;
142 unsigned long base = (unsigned long) hwif->hwif_data; 143 unsigned long base = (unsigned long) hwif->hwif_data;
@@ -147,23 +148,23 @@ static u8 sil_udma_filter(ide_drive_t *drive)
147 else 148 else
148 pci_read_config_byte(hwif->pci_dev, 0x8A, &scsc); 149 pci_read_config_byte(hwif->pci_dev, 0x8A, &scsc);
149 150
150 if (is_sata(hwif)) {
151 mask = strstr(drive->id->model, "Maxtor") ? 0x3f : 0x7f;
152 goto out;
153 }
154
155 if ((scsc & 0x30) == 0x10) /* 133 */ 151 if ((scsc & 0x30) == 0x10) /* 133 */
156 mask = 0x7f; 152 mask = ATA_UDMA6;
157 else if ((scsc & 0x30) == 0x20) /* 2xPCI */ 153 else if ((scsc & 0x30) == 0x20) /* 2xPCI */
158 mask = 0x7f; 154 mask = ATA_UDMA6;
159 else if ((scsc & 0x30) == 0x00) /* 100 */ 155 else if ((scsc & 0x30) == 0x00) /* 100 */
160 mask = 0x3f; 156 mask = ATA_UDMA5;
161 else /* Disabled ? */ 157 else /* Disabled ? */
162 BUG(); 158 BUG();
163out: 159
164 return mask; 160 return mask;
165} 161}
166 162
163static u8 sil_sata_udma_filter(ide_drive_t *drive)
164{
165 return strstr(drive->id->model, "Maxtor") ? ATA_UDMA5 : ATA_UDMA6;
166}
167
167/** 168/**
168 * sil_set_pio_mode - set host controller for PIO mode 169 * sil_set_pio_mode - set host controller for PIO mode
169 * @drive: drive 170 * @drive: drive
@@ -340,10 +341,11 @@ static int siimage_io_ide_dma_test_irq (ide_drive_t *drive)
340static int siimage_mmio_ide_dma_test_irq (ide_drive_t *drive) 341static int siimage_mmio_ide_dma_test_irq (ide_drive_t *drive)
341{ 342{
342 ide_hwif_t *hwif = HWIF(drive); 343 ide_hwif_t *hwif = HWIF(drive);
343 unsigned long base = (unsigned long)hwif->hwif_data;
344 unsigned long addr = siimage_selreg(hwif, 0x1); 344 unsigned long addr = siimage_selreg(hwif, 0x1);
345 345
346 if (SATA_ERROR_REG) { 346 if (SATA_ERROR_REG) {
347 unsigned long base = (unsigned long)hwif->hwif_data;
348
347 u32 ext_stat = readl((void __iomem *)(base + 0x10)); 349 u32 ext_stat = readl((void __iomem *)(base + 0x10));
348 u8 watchdog = 0; 350 u8 watchdog = 0;
349 if (ext_stat & ((hwif->channel) ? 0x40 : 0x10)) { 351 if (ext_stat & ((hwif->channel) ? 0x40 : 0x10)) {
@@ -376,7 +378,7 @@ static int siimage_mmio_ide_dma_test_irq (ide_drive_t *drive)
376} 378}
377 379
378/** 380/**
379 * siimage_busproc - bus isolation ioctl 381 * sil_sata_busproc - bus isolation IOCTL
380 * @drive: drive to isolate/restore 382 * @drive: drive to isolate/restore
381 * @state: bus state to set 383 * @state: bus state to set
382 * 384 *
@@ -384,8 +386,8 @@ static int siimage_mmio_ide_dma_test_irq (ide_drive_t *drive)
384 * SATA controller the work required is quite limited, we 386 * SATA controller the work required is quite limited, we
385 * just have to clean up the statistics 387 * just have to clean up the statistics
386 */ 388 */
387 389
388static int siimage_busproc (ide_drive_t * drive, int state) 390static int sil_sata_busproc(ide_drive_t * drive, int state)
389{ 391{
390 ide_hwif_t *hwif = HWIF(drive); 392 ide_hwif_t *hwif = HWIF(drive);
391 u32 stat_config = 0; 393 u32 stat_config = 0;
@@ -417,14 +419,14 @@ static int siimage_busproc (ide_drive_t * drive, int state)
417} 419}
418 420
419/** 421/**
420 * siimage_reset_poll - wait for sata reset 422 * sil_sata_reset_poll - wait for SATA reset
421 * @drive: drive we are resetting 423 * @drive: drive we are resetting
422 * 424 *
423 * Poll the SATA phy and see whether it has come back from the dead 425 * Poll the SATA phy and see whether it has come back from the dead
424 * yet. 426 * yet.
425 */ 427 */
426 428
427static int siimage_reset_poll (ide_drive_t *drive) 429static int sil_sata_reset_poll(ide_drive_t *drive)
428{ 430{
429 if (SATA_STATUS_REG) { 431 if (SATA_STATUS_REG) {
430 ide_hwif_t *hwif = HWIF(drive); 432 ide_hwif_t *hwif = HWIF(drive);
@@ -436,27 +438,22 @@ static int siimage_reset_poll (ide_drive_t *drive)
436 HWGROUP(drive)->polling = 0; 438 HWGROUP(drive)->polling = 0;
437 return ide_started; 439 return ide_started;
438 } 440 }
439 return 0;
440 } else {
441 return 0;
442 } 441 }
442
443 return 0;
443} 444}
444 445
445/** 446/**
446 * siimage_pre_reset - reset hook 447 * sil_sata_pre_reset - reset hook
447 * @drive: IDE device being reset 448 * @drive: IDE device being reset
448 * 449 *
449 * For the SATA devices we need to handle recalibration/geometry 450 * For the SATA devices we need to handle recalibration/geometry
450 * differently 451 * differently
451 */ 452 */
452
453static void siimage_pre_reset (ide_drive_t *drive)
454{
455 if (drive->media != ide_disk)
456 return;
457 453
458 if (is_sata(HWIF(drive))) 454static void sil_sata_pre_reset(ide_drive_t *drive)
459 { 455{
456 if (drive->media == ide_disk) {
460 drive->special.b.set_geometry = 0; 457 drive->special.b.set_geometry = 0;
461 drive->special.b.recalibrate = 0; 458 drive->special.b.recalibrate = 0;
462 } 459 }
@@ -502,7 +499,6 @@ static void siimage_reset (ide_drive_t *drive)
502 drive->failures++; 499 drive->failures++;
503 } 500 }
504 } 501 }
505
506} 502}
507 503
508/** 504/**
@@ -758,16 +754,11 @@ static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif)
758 hwif->sata_misc[SATA_IEN_OFFSET] = base + 0x148; 754 hwif->sata_misc[SATA_IEN_OFFSET] = base + 0x148;
759 } 755 }
760 756
761 hw.irq = hwif->pci_dev->irq; 757 memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
762 758
763 memcpy(&hwif->hw, &hw, sizeof(hw)); 759 hwif->irq = dev->irq;
764 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports));
765 760
766 hwif->irq = hw.irq; 761 hwif->dma_base = (unsigned long)addr + (ch ? 0x08 : 0x00);
767
768 base = (unsigned long) addr;
769
770 hwif->dma_base = base + (ch ? 0x08 : 0x00);
771 762
772 hwif->mmio = 1; 763 hwif->mmio = 1;
773} 764}
@@ -864,28 +855,31 @@ static u8 __devinit ata66_siimage(ide_hwif_t *hwif)
864 855
865static void __devinit init_hwif_siimage(ide_hwif_t *hwif) 856static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
866{ 857{
858 u8 sata = is_sata(hwif);
859
867 hwif->resetproc = &siimage_reset; 860 hwif->resetproc = &siimage_reset;
868 hwif->set_pio_mode = &sil_set_pio_mode; 861 hwif->set_pio_mode = &sil_set_pio_mode;
869 hwif->set_dma_mode = &sil_set_dma_mode; 862 hwif->set_dma_mode = &sil_set_dma_mode;
870 hwif->reset_poll = &siimage_reset_poll;
871 hwif->pre_reset = &siimage_pre_reset;
872 hwif->udma_filter = &sil_udma_filter;
873 863
874 if(is_sata(hwif)) { 864 if (sata) {
875 static int first = 1; 865 static int first = 1;
876 866
877 hwif->busproc = &siimage_busproc; 867 hwif->busproc = &sil_sata_busproc;
868 hwif->reset_poll = &sil_sata_reset_poll;
869 hwif->pre_reset = &sil_sata_pre_reset;
870 hwif->udma_filter = &sil_sata_udma_filter;
878 871
879 if (first) { 872 if (first) {
880 printk(KERN_INFO "siimage: For full SATA support you should use the libata sata_sil module.\n"); 873 printk(KERN_INFO "siimage: For full SATA support you should use the libata sata_sil module.\n");
881 first = 0; 874 first = 0;
882 } 875 }
883 } 876 } else
877 hwif->udma_filter = &sil_pata_udma_filter;
884 878
885 if (hwif->dma_base == 0) 879 if (hwif->dma_base == 0)
886 return; 880 return;
887 881
888 if (is_sata(hwif)) 882 if (sata)
889 hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; 883 hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
890 884
891 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 885 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
@@ -911,7 +905,7 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
911 .udma_mask = ATA_UDMA6, \ 905 .udma_mask = ATA_UDMA6, \
912 } 906 }
913 907
914static ide_pci_device_t siimage_chipsets[] __devinitdata = { 908static const struct ide_port_info siimage_chipsets[] __devinitdata = {
915 /* 0 */ DECLARE_SII_DEV("SiI680"), 909 /* 0 */ DECLARE_SII_DEV("SiI680"),
916 /* 1 */ DECLARE_SII_DEV("SiI3112 Serial ATA"), 910 /* 1 */ DECLARE_SII_DEV("SiI3112 Serial ATA"),
917 /* 2 */ DECLARE_SII_DEV("Adaptec AAR-1210SA") 911 /* 2 */ DECLARE_SII_DEV("Adaptec AAR-1210SA")
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
index c1d280b0639..6b7bb53acef 100644
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -264,7 +264,7 @@ static void sis_ata133_program_timings(ide_drive_t *drive, const u8 mode)
264 if (mode >= XFER_MW_DMA_0) { 264 if (mode >= XFER_MW_DMA_0) {
265 t1 &= ~0x04; /* disable UDMA */ 265 t1 &= ~0x04; /* disable UDMA */
266 idx = mode - XFER_MW_DMA_0 + 5; 266 idx = mode - XFER_MW_DMA_0 + 5;
267 } 267 } else
268 idx = mode - XFER_PIO_0; 268 idx = mode - XFER_PIO_0;
269 t1 |= ini_time_value[clk][idx] << 12; 269 t1 |= ini_time_value[clk][idx] << 12;
270 t1 |= act_time_value[clk][idx] << 16; 270 t1 |= act_time_value[clk][idx] << 16;
@@ -579,7 +579,7 @@ static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif)
579 hwif->cbl = ata66_sis5513(hwif); 579 hwif->cbl = ata66_sis5513(hwif);
580} 580}
581 581
582static ide_pci_device_t sis5513_chipset __devinitdata = { 582static const struct ide_port_info sis5513_chipset __devinitdata = {
583 .name = "SIS5513", 583 .name = "SIS5513",
584 .init_chipset = init_chipset_sis5513, 584 .init_chipset = init_chipset_sis5513,
585 .init_hwif = init_hwif_sis5513, 585 .init_hwif = init_hwif_sis5513,
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index 0dce459b126..147d783f752 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -361,13 +361,6 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
361 hwif->selectproc = &sl82c105_selectproc; 361 hwif->selectproc = &sl82c105_selectproc;
362 hwif->resetproc = &sl82c105_resetproc; 362 hwif->resetproc = &sl82c105_resetproc;
363 363
364 /*
365 * We support 32-bit I/O on this interface, and
366 * it doesn't have problems with interrupts.
367 */
368 hwif->drives[0].io_32bit = hwif->drives[1].io_32bit = 1;
369 hwif->drives[0].unmask = hwif->drives[1].unmask = 1;
370
371 if (!hwif->dma_base) 364 if (!hwif->dma_base)
372 return; 365 return;
373 366
@@ -394,12 +387,15 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
394 hwif->serialized = hwif->mate->serialized = 1; 387 hwif->serialized = hwif->mate->serialized = 1;
395} 388}
396 389
397static ide_pci_device_t sl82c105_chipset __devinitdata = { 390static const struct ide_port_info sl82c105_chipset __devinitdata = {
398 .name = "W82C105", 391 .name = "W82C105",
399 .init_chipset = init_chipset_sl82c105, 392 .init_chipset = init_chipset_sl82c105,
400 .init_hwif = init_hwif_sl82c105, 393 .init_hwif = init_hwif_sl82c105,
401 .enablebits = {{0x40,0x01,0x01}, {0x40,0x10,0x10}}, 394 .enablebits = {{0x40,0x01,0x01}, {0x40,0x10,0x10}},
402 .host_flags = IDE_HFLAG_NO_AUTODMA | IDE_HFLAG_BOOTABLE, 395 .host_flags = IDE_HFLAG_IO_32BIT |
396 IDE_HFLAG_UNMASK_IRQS |
397 IDE_HFLAG_NO_AUTODMA |
398 IDE_HFLAG_BOOTABLE,
403 .pio_mask = ATA_PIO5, 399 .pio_mask = ATA_PIO5,
404}; 400};
405 401
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index 4f22dffdf8e..eb4445b229e 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/slc90e66.c Version 0.18 Aug 9, 2007 2 * linux/drivers/ide/pci/slc90e66.c Version 0.19 Sep 24, 2007
3 * 3 *
4 * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org>
5 * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com> 5 * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com>
@@ -21,6 +21,8 @@
21 21
22#include <asm/io.h> 22#include <asm/io.h>
23 23
24static DEFINE_SPINLOCK(slc90e66_lock);
25
24static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio) 26static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio)
25{ 27{
26 ide_hwif_t *hwif = HWIF(drive); 28 ide_hwif_t *hwif = HWIF(drive);
@@ -40,7 +42,7 @@ static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio)
40 { 2, 1 }, 42 { 2, 1 },
41 { 2, 3 }, }; 43 { 2, 3 }, };
42 44
43 spin_lock_irqsave(&ide_lock, flags); 45 spin_lock_irqsave(&slc90e66_lock, flags);
44 pci_read_config_word(dev, master_port, &master_data); 46 pci_read_config_word(dev, master_port, &master_data);
45 47
46 if (pio > 1) 48 if (pio > 1)
@@ -71,7 +73,7 @@ static void slc90e66_set_pio_mode(ide_drive_t *drive, const u8 pio)
71 pci_write_config_word(dev, master_port, master_data); 73 pci_write_config_word(dev, master_port, master_data);
72 if (is_slave) 74 if (is_slave)
73 pci_write_config_byte(dev, slave_port, slave_data); 75 pci_write_config_byte(dev, slave_port, slave_data);
74 spin_unlock_irqrestore(&ide_lock, flags); 76 spin_unlock_irqrestore(&slc90e66_lock, flags);
75} 77}
76 78
77static void slc90e66_set_dma_mode(ide_drive_t *drive, const u8 speed) 79static void slc90e66_set_dma_mode(ide_drive_t *drive, const u8 speed)
@@ -146,7 +148,7 @@ static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
146 hwif->cbl = (reg47 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 148 hwif->cbl = (reg47 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
147} 149}
148 150
149static ide_pci_device_t slc90e66_chipset __devinitdata = { 151static const struct ide_port_info slc90e66_chipset __devinitdata = {
150 .name = "SLC90E66", 152 .name = "SLC90E66",
151 .init_hwif = init_hwif_slc90e66, 153 .init_hwif = init_hwif_slc90e66,
152 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, 154 .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c
index 631506e9b5d..a66ebd14664 100644
--- a/drivers/ide/pci/tc86c001.c
+++ b/drivers/ide/pci/tc86c001.c
@@ -218,7 +218,7 @@ static unsigned int __devinit init_chipset_tc86c001(struct pci_dev *dev,
218 return err; 218 return err;
219} 219}
220 220
221static ide_pci_device_t tc86c001_chipset __devinitdata = { 221static const struct ide_port_info tc86c001_chipset __devinitdata = {
222 .name = "TC86C001", 222 .name = "TC86C001",
223 .init_chipset = init_chipset_tc86c001, 223 .init_chipset = init_chipset_tc86c001,
224 .init_hwif = init_hwif_tc86c001, 224 .init_hwif = init_hwif_tc86c001,
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c
index 30b52f62699..a227c41d23a 100644
--- a/drivers/ide/pci/triflex.c
+++ b/drivers/ide/pci/triflex.c
@@ -102,7 +102,7 @@ static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
102 hwif->set_dma_mode = &triflex_set_mode; 102 hwif->set_dma_mode = &triflex_set_mode;
103} 103}
104 104
105static ide_pci_device_t triflex_device __devinitdata = { 105static const struct ide_port_info triflex_device __devinitdata = {
106 .name = "TRIFLEX", 106 .name = "TRIFLEX",
107 .init_hwif = init_hwif_triflex, 107 .init_hwif = init_hwif_triflex,
108 .enablebits = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}}, 108 .enablebits = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}},
diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c
index 140d486f623..5011ba22e36 100644
--- a/drivers/ide/pci/trm290.c
+++ b/drivers/ide/pci/trm290.c
@@ -250,7 +250,6 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
250 u8 reg = 0; 250 u8 reg = 0;
251 struct pci_dev *dev = hwif->pci_dev; 251 struct pci_dev *dev = hwif->pci_dev;
252 252
253 hwif->chipset = ide_trm290;
254 cfgbase = pci_resource_start(dev, 4); 253 cfgbase = pci_resource_start(dev, 4);
255 if ((dev->class & 5) && cfgbase) { 254 if ((dev->class & 5) && cfgbase) {
256 hwif->config_data = cfgbase; 255 hwif->config_data = cfgbase;
@@ -320,9 +319,10 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
320#endif 319#endif
321} 320}
322 321
323static ide_pci_device_t trm290_chipset __devinitdata = { 322static const struct ide_port_info trm290_chipset __devinitdata = {
324 .name = "TRM290", 323 .name = "TRM290",
325 .init_hwif = init_hwif_trm290, 324 .init_hwif = init_hwif_trm290,
325 .chipset = ide_trm290,
326 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | 326 .host_flags = IDE_HFLAG_NO_ATAPI_DMA |
327#if 0 /* play it safe for now */ 327#if 0 /* play it safe for now */
328 IDE_HFLAG_TRUST_BIOS_FOR_DMA | 328 IDE_HFLAG_TRUST_BIOS_FOR_DMA |
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index c8022a92a0e..a0d3c16b68e 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * Version 3.49 3 * Version 3.50
4 * 4 *
5 * VIA IDE driver for Linux. Supported southbridges: 5 * VIA IDE driver for Linux. Supported southbridges:
6 * 6 *
@@ -422,65 +422,40 @@ static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif)
422 422
423static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) 423static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
424{ 424{
425 struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev);
426 int i;
427
428 hwif->set_pio_mode = &via_set_pio_mode; 425 hwif->set_pio_mode = &via_set_pio_mode;
429 hwif->set_dma_mode = &via_set_drive; 426 hwif->set_dma_mode = &via_set_drive;
430 427
431#ifdef CONFIG_PPC_CHRP
432 if(machine_is(chrp) && _chrp_type == _CHRP_Pegasos) {
433 hwif->irq = hwif->channel ? 15 : 14;
434 }
435#endif
436
437 for (i = 0; i < 2; i++) {
438 hwif->drives[i].io_32bit = 1;
439 hwif->drives[i].unmask = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1;
440 }
441
442 if (!hwif->dma_base) 428 if (!hwif->dma_base)
443 return; 429 return;
444 430
445 hwif->ultra_mask = vdev->via_config->udma_mask;
446
447 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 431 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
448 hwif->cbl = via82cxxx_cable_detect(hwif); 432 hwif->cbl = via82cxxx_cable_detect(hwif);
449} 433}
450 434
451static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = { 435static const struct ide_port_info via82cxxx_chipset __devinitdata = {
452 { /* 0 */ 436 .name = "VP_IDE",
453 .name = "VP_IDE", 437 .init_chipset = init_chipset_via82cxxx,
454 .init_chipset = init_chipset_via82cxxx, 438 .init_hwif = init_hwif_via82cxxx,
455 .init_hwif = init_hwif_via82cxxx, 439 .enablebits = { { 0x40, 0x02, 0x02 }, { 0x40, 0x01, 0x01 } },
456 .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, 440 .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST |
457 .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST | 441 IDE_HFLAG_PIO_NO_DOWNGRADE |
458 IDE_HFLAG_PIO_NO_DOWNGRADE | 442 IDE_HFLAG_POST_SET_MODE |
459 IDE_HFLAG_POST_SET_MODE | 443 IDE_HFLAG_IO_32BIT |
460 IDE_HFLAG_NO_AUTODMA | 444 IDE_HFLAG_BOOTABLE,
461 IDE_HFLAG_BOOTABLE, 445 .pio_mask = ATA_PIO5,
462 .pio_mask = ATA_PIO5, 446 .swdma_mask = ATA_SWDMA2,
463 .swdma_mask = ATA_SWDMA2, 447 .mwdma_mask = ATA_MWDMA2,
464 .mwdma_mask = ATA_MWDMA2,
465 },{ /* 1 */
466 .name = "VP_IDE",
467 .init_chipset = init_chipset_via82cxxx,
468 .init_hwif = init_hwif_via82cxxx,
469 .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
470 .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST |
471 IDE_HFLAG_PIO_NO_DOWNGRADE |
472 IDE_HFLAG_POST_SET_MODE |
473 IDE_HFLAG_BOOTABLE,
474 .pio_mask = ATA_PIO5,
475 .swdma_mask = ATA_SWDMA2,
476 .mwdma_mask = ATA_MWDMA2,
477 }
478}; 448};
479 449
480static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id) 450static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id)
481{ 451{
482 struct pci_dev *isa = NULL; 452 struct pci_dev *isa = NULL;
483 struct via_isa_bridge *via_config; 453 struct via_isa_bridge *via_config;
454 u8 idx = id->driver_data;
455 struct ide_port_info d;
456
457 d = via82cxxx_chipset;
458
484 /* 459 /*
485 * Find the ISA bridge and check we know what it is. 460 * Find the ISA bridge and check we know what it is.
486 */ 461 */
@@ -490,7 +465,23 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i
490 printk(KERN_WARNING "VP_IDE: Unknown VIA SouthBridge, disabling DMA.\n"); 465 printk(KERN_WARNING "VP_IDE: Unknown VIA SouthBridge, disabling DMA.\n");
491 return -ENODEV; 466 return -ENODEV;
492 } 467 }
493 return ide_setup_pci_device(dev, &via82cxxx_chipsets[id->driver_data]); 468
469 if (idx == 0)
470 d.host_flags |= IDE_HFLAG_NO_AUTODMA;
471 else
472 d.enablebits[1].reg = d.enablebits[0].reg = 0;
473
474 if ((via_config->flags & VIA_NO_UNMASK) == 0)
475 d.host_flags |= IDE_HFLAG_UNMASK_IRQS;
476
477#ifdef CONFIG_PPC_CHRP
478 if (machine_is(chrp) && _chrp_type == _CHRP_Pegasos)
479 d.host_flags |= IDE_HFLAG_FORCE_LEGACY_IRQS;
480#endif
481
482 d.udma_mask = via_config->udma_mask;
483
484 return ide_setup_pci_device(dev, &d);
494} 485}
495 486
496static const struct pci_device_id via_pci_tbl[] = { 487static const struct pci_device_id via_pci_tbl[] = {
diff --git a/drivers/ide/ppc/mpc8xx.c b/drivers/ide/ppc/mpc8xx.c
index df2e92034f5..5f0da35ab5a 100644
--- a/drivers/ide/ppc/mpc8xx.c
+++ b/drivers/ide/ppc/mpc8xx.c
@@ -316,8 +316,8 @@ m8xx_ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
316 316
317 ide_hwifs[data_port].pio_mask = ATA_PIO4; 317 ide_hwifs[data_port].pio_mask = ATA_PIO4;
318 ide_hwifs[data_port].set_pio_mode = m8xx_ide_set_pio_mode; 318 ide_hwifs[data_port].set_pio_mode = m8xx_ide_set_pio_mode;
319 ide_hwifs[data_port].ack_intr = (ide_ack_intr_t *)ide_interrupt_ack;
319 320
320 hw->ack_intr = (ide_ack_intr_t *) ide_interrupt_ack;
321 /* Enable Harddisk Interrupt, 321 /* Enable Harddisk Interrupt,
322 * and make it edge sensitive 322 * and make it edge sensitive
323 */ 323 */
@@ -402,8 +402,8 @@ void m8xx_ide_init_hwif_ports (hw_regs_t *hw,
402 402
403 ide_hwifs[data_port].pio_mask = ATA_PIO4; 403 ide_hwifs[data_port].pio_mask = ATA_PIO4;
404 ide_hwifs[data_port].set_pio_mode = m8xx_ide_set_pio_mode; 404 ide_hwifs[data_port].set_pio_mode = m8xx_ide_set_pio_mode;
405 ide_hwifs[data_port].ack_intr = (ide_ack_intr_t *)ide_interrupt_ack;
405 406
406 hw->ack_intr = (ide_ack_intr_t *) ide_interrupt_ack;
407 /* Enable Harddisk Interrupt, 407 /* Enable Harddisk Interrupt,
408 * and make it edge sensitive 408 * and make it edge sensitive
409 */ 409 */
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index c5547935676..816b5311dad 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1039,6 +1039,8 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
1039{ 1039{
1040 struct device_node *np = pmif->node; 1040 struct device_node *np = pmif->node;
1041 const int *bidp; 1041 const int *bidp;
1042 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
1043 hw_regs_t hw;
1042 1044
1043 pmif->cable_80 = 0; 1045 pmif->cable_80 = 0;
1044 pmif->broken_dma = pmif->broken_dma_warn = 0; 1046 pmif->broken_dma = pmif->broken_dma_warn = 0;
@@ -1124,8 +1126,9 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
1124 /* Tell common code _not_ to mess with resources */ 1126 /* Tell common code _not_ to mess with resources */
1125 hwif->mmio = 1; 1127 hwif->mmio = 1;
1126 hwif->hwif_data = pmif; 1128 hwif->hwif_data = pmif;
1127 pmac_ide_init_hwif_ports(&hwif->hw, pmif->regbase, 0, &hwif->irq); 1129 memset(&hw, 0, sizeof(hw));
1128 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); 1130 pmac_ide_init_hwif_ports(&hw, pmif->regbase, 0, &hwif->irq);
1131 memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
1129 hwif->chipset = ide_pmac; 1132 hwif->chipset = ide_pmac;
1130 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET] || pmif->mediabay; 1133 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET] || pmif->mediabay;
1131 hwif->hold = pmif->mediabay; 1134 hwif->hold = pmif->mediabay;
@@ -1163,10 +1166,9 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
1163 pmac_ide_setup_dma(pmif, hwif); 1166 pmac_ide_setup_dma(pmif, hwif);
1164#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ 1167#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
1165 1168
1166 /* We probe the hwif now */ 1169 idx[0] = hwif->index;
1167 probe_hwif_init(hwif);
1168 1170
1169 ide_proc_register_port(hwif); 1171 ide_device_add(idx);
1170 1172
1171 return 0; 1173 return 0;
1172} 1174}
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index fff567bcedb..02d14bf85ab 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -147,15 +147,15 @@ static int ide_setup_pci_baseregs (struct pci_dev *dev, const char *name)
147#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 147#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
148/** 148/**
149 * ide_get_or_set_dma_base - setup BMIBA 149 * ide_get_or_set_dma_base - setup BMIBA
150 * @d: IDE pci device data 150 * @d: IDE port info
151 * @hwif: Interface 151 * @hwif: IDE interface
152 * 152 *
153 * Fetch the DMA Bus-Master-I/O-Base-Address (BMIBA) from PCI space. 153 * Fetch the DMA Bus-Master-I/O-Base-Address (BMIBA) from PCI space.
154 * Where a device has a partner that is already in DMA mode we check 154 * Where a device has a partner that is already in DMA mode we check
155 * and enforce IDE simplex rules. 155 * and enforce IDE simplex rules.
156 */ 156 */
157 157
158static unsigned long ide_get_or_set_dma_base(ide_pci_device_t *d, ide_hwif_t *hwif) 158static unsigned long ide_get_or_set_dma_base(const struct ide_port_info *d, ide_hwif_t *hwif)
159{ 159{
160 unsigned long dma_base = 0; 160 unsigned long dma_base = 0;
161 struct pci_dev *dev = hwif->pci_dev; 161 struct pci_dev *dev = hwif->pci_dev;
@@ -225,10 +225,11 @@ static unsigned long ide_get_or_set_dma_base(ide_pci_device_t *d, ide_hwif_t *hw
225} 225}
226#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 226#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
227 227
228void ide_setup_pci_noise (struct pci_dev *dev, ide_pci_device_t *d) 228void ide_setup_pci_noise(struct pci_dev *dev, const struct ide_port_info *d)
229{ 229{
230 printk(KERN_INFO "%s: IDE controller at PCI slot %s\n", 230 printk(KERN_INFO "%s: IDE controller (0x%04x:0x%04x rev 0x%02x) at "
231 d->name, pci_name(dev)); 231 " PCI slot %s\n", d->name, dev->vendor, dev->device,
232 dev->revision, pci_name(dev));
232} 233}
233 234
234EXPORT_SYMBOL_GPL(ide_setup_pci_noise); 235EXPORT_SYMBOL_GPL(ide_setup_pci_noise);
@@ -237,15 +238,15 @@ EXPORT_SYMBOL_GPL(ide_setup_pci_noise);
237/** 238/**
238 * ide_pci_enable - do PCI enables 239 * ide_pci_enable - do PCI enables
239 * @dev: PCI device 240 * @dev: PCI device
240 * @d: IDE pci device data 241 * @d: IDE port info
241 * 242 *
242 * Enable the IDE PCI device. We attempt to enable the device in full 243 * Enable the IDE PCI device. We attempt to enable the device in full
243 * but if that fails then we only need BAR4 so we will enable that. 244 * but if that fails then we only need BAR4 so we will enable that.
244 * 245 *
245 * Returns zero on success or an error code 246 * Returns zero on success or an error code
246 */ 247 */
247 248
248static int ide_pci_enable(struct pci_dev *dev, ide_pci_device_t *d) 249static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d)
249{ 250{
250 int ret; 251 int ret;
251 252
@@ -260,9 +261,9 @@ static int ide_pci_enable(struct pci_dev *dev, ide_pci_device_t *d)
260 } 261 }
261 262
262 /* 263 /*
263 * assume all devices can do 32-bit dma for now. we can add a 264 * assume all devices can do 32-bit DMA for now, we can add
264 * dma mask field to the ide_pci_device_t if we need it (or let 265 * a DMA mask field to the struct ide_port_info if we need it
265 * lower level driver set the dma mask) 266 * (or let lower level driver set the DMA mask)
266 */ 267 */
267 ret = pci_set_dma_mask(dev, DMA_32BIT_MASK); 268 ret = pci_set_dma_mask(dev, DMA_32BIT_MASK);
268 if (ret < 0) { 269 if (ret < 0) {
@@ -284,13 +285,13 @@ out:
284/** 285/**
285 * ide_pci_configure - configure an unconfigured device 286 * ide_pci_configure - configure an unconfigured device
286 * @dev: PCI device 287 * @dev: PCI device
287 * @d: IDE pci device data 288 * @d: IDE port info
288 * 289 *
289 * Enable and configure the PCI device we have been passed. 290 * Enable and configure the PCI device we have been passed.
290 * Returns zero on success or an error code. 291 * Returns zero on success or an error code.
291 */ 292 */
292 293
293static int ide_pci_configure(struct pci_dev *dev, ide_pci_device_t *d) 294static int ide_pci_configure(struct pci_dev *dev, const struct ide_port_info *d)
294{ 295{
295 u16 pcicmd = 0; 296 u16 pcicmd = 0;
296 /* 297 /*
@@ -318,15 +319,15 @@ static int ide_pci_configure(struct pci_dev *dev, ide_pci_device_t *d)
318 319
319/** 320/**
320 * ide_pci_check_iomem - check a register is I/O 321 * ide_pci_check_iomem - check a register is I/O
321 * @dev: pci device 322 * @dev: PCI device
322 * @d: ide_pci_device 323 * @d: IDE port info
323 * @bar: bar number 324 * @bar: BAR number
324 * 325 *
325 * Checks if a BAR is configured and points to MMIO space. If so 326 * Checks if a BAR is configured and points to MMIO space. If so
326 * print an error and return an error code. Otherwise return 0 327 * print an error and return an error code. Otherwise return 0
327 */ 328 */
328 329
329static int ide_pci_check_iomem(struct pci_dev *dev, ide_pci_device_t *d, int bar) 330static int ide_pci_check_iomem(struct pci_dev *dev, const struct ide_port_info *d, int bar)
330{ 331{
331 ulong flags = pci_resource_flags(dev, bar); 332 ulong flags = pci_resource_flags(dev, bar);
332 333
@@ -348,7 +349,7 @@ static int ide_pci_check_iomem(struct pci_dev *dev, ide_pci_device_t *d, int bar
348/** 349/**
349 * ide_hwif_configure - configure an IDE interface 350 * ide_hwif_configure - configure an IDE interface
350 * @dev: PCI device holding interface 351 * @dev: PCI device holding interface
351 * @d: IDE pci data 352 * @d: IDE port info
352 * @mate: Paired interface if any 353 * @mate: Paired interface if any
353 * 354 *
354 * Perform the initial set up for the hardware interface structure. This 355 * Perform the initial set up for the hardware interface structure. This
@@ -357,8 +358,8 @@ static int ide_pci_check_iomem(struct pci_dev *dev, ide_pci_device_t *d, int bar
357 * 358 *
358 * Returns the new hardware interface structure, or NULL on a failure 359 * Returns the new hardware interface structure, or NULL on a failure
359 */ 360 */
360 361
361static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d, ide_hwif_t *mate, int port, int irq) 362static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, const struct ide_port_info *d, ide_hwif_t *mate, int port, int irq)
362{ 363{
363 unsigned long ctl = 0, base = 0; 364 unsigned long ctl = 0, base = 0;
364 ide_hwif_t *hwif; 365 ide_hwif_t *hwif;
@@ -387,19 +388,20 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d,
387 return NULL; /* no room in ide_hwifs[] */ 388 return NULL; /* no room in ide_hwifs[] */
388 if (hwif->io_ports[IDE_DATA_OFFSET] != base || 389 if (hwif->io_ports[IDE_DATA_OFFSET] != base ||
389 hwif->io_ports[IDE_CONTROL_OFFSET] != (ctl | 2)) { 390 hwif->io_ports[IDE_CONTROL_OFFSET] != (ctl | 2)) {
390 memset(&hwif->hw, 0, sizeof(hwif->hw)); 391 hw_regs_t hw;
391#ifndef IDE_ARCH_OBSOLETE_INIT 392
392 ide_std_init_ports(&hwif->hw, base, (ctl | 2)); 393 memset(&hw, 0, sizeof(hw));
393 hwif->hw.io_ports[IDE_IRQ_OFFSET] = 0; 394#ifndef CONFIG_IDE_ARCH_OBSOLETE_INIT
395 ide_std_init_ports(&hw, base, ctl | 2);
394#else 396#else
395 ide_init_hwif_ports(&hwif->hw, base, (ctl | 2), NULL); 397 ide_init_hwif_ports(&hw, base, ctl | 2, NULL);
396#endif 398#endif
397 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); 399 memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
398 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; 400 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
399 } 401 }
400 hwif->chipset = ide_pci; 402 hwif->chipset = d->chipset ? d->chipset : ide_pci;
401 hwif->pci_dev = dev; 403 hwif->pci_dev = dev;
402 hwif->cds = (struct ide_pci_device_s *) d; 404 hwif->cds = d;
403 hwif->channel = port; 405 hwif->channel = port;
404 406
405 if (!hwif->irq) 407 if (!hwif->irq)
@@ -414,21 +416,17 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d,
414/** 416/**
415 * ide_hwif_setup_dma - configure DMA interface 417 * ide_hwif_setup_dma - configure DMA interface
416 * @dev: PCI device 418 * @dev: PCI device
417 * @d: IDE pci data 419 * @d: IDE port info
418 * @hwif: Hardware interface we are configuring 420 * @hwif: IDE interface
419 * 421 *
420 * Set up the DMA base for the interface. Enable the master bits as 422 * Set up the DMA base for the interface. Enable the master bits as
421 * necessary and attempt to bring the device DMA into a ready to use 423 * necessary and attempt to bring the device DMA into a ready to use
422 * state 424 * state
423 */ 425 */
424 426
425#ifndef CONFIG_BLK_DEV_IDEDMA_PCI 427static void ide_hwif_setup_dma(struct pci_dev *dev, const struct ide_port_info *d, ide_hwif_t *hwif)
426static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwif_t *hwif)
427{
428}
429#else
430static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwif_t *hwif)
431{ 428{
429#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
432 u16 pcicmd; 430 u16 pcicmd;
433 431
434 pci_read_config_word(dev, PCI_COMMAND, &pcicmd); 432 pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
@@ -460,13 +458,13 @@ static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwi
460 "(BIOS)\n", hwif->name, d->name); 458 "(BIOS)\n", hwif->name, d->name);
461 } 459 }
462 } 460 }
463}
464#endif /* CONFIG_BLK_DEV_IDEDMA_PCI*/ 461#endif /* CONFIG_BLK_DEV_IDEDMA_PCI*/
462}
465 463
466/** 464/**
467 * ide_setup_pci_controller - set up IDE PCI 465 * ide_setup_pci_controller - set up IDE PCI
468 * @dev: PCI device 466 * @dev: PCI device
469 * @d: IDE PCI data 467 * @d: IDE port info
470 * @noisy: verbose flag 468 * @noisy: verbose flag
471 * @config: returned as 1 if we configured the hardware 469 * @config: returned as 1 if we configured the hardware
472 * 470 *
@@ -474,8 +472,8 @@ static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwi
474 * up the PCI side of the device, checks that the device is enabled 472 * up the PCI side of the device, checks that the device is enabled
475 * and enables it if need be 473 * and enables it if need be
476 */ 474 */
477 475
478static int ide_setup_pci_controller(struct pci_dev *dev, ide_pci_device_t *d, int noisy, int *config) 476static int ide_setup_pci_controller(struct pci_dev *dev, const struct ide_port_info *d, int noisy, int *config)
479{ 477{
480 int ret; 478 int ret;
481 u16 pcicmd; 479 u16 pcicmd;
@@ -500,9 +498,6 @@ static int ide_setup_pci_controller(struct pci_dev *dev, ide_pci_device_t *d, in
500 printk(KERN_INFO "%s: device enabled (Linux)\n", d->name); 498 printk(KERN_INFO "%s: device enabled (Linux)\n", d->name);
501 } 499 }
502 500
503 if (noisy)
504 printk(KERN_INFO "%s: chipset revision %d\n",
505 d->name, dev->revision);
506out: 501out:
507 return ret; 502 return ret;
508} 503}
@@ -510,9 +505,9 @@ out:
510/** 505/**
511 * ide_pci_setup_ports - configure ports/devices on PCI IDE 506 * ide_pci_setup_ports - configure ports/devices on PCI IDE
512 * @dev: PCI device 507 * @dev: PCI device
513 * @d: IDE pci device info 508 * @d: IDE port info
514 * @pciirq: IRQ line 509 * @pciirq: IRQ line
515 * @index: ata index to update 510 * @idx: ATA index table to update
516 * 511 *
517 * Scan the interfaces attached to this device and do any 512 * Scan the interfaces attached to this device and do any
518 * necessary per port setup. Attach the devices and ask the 513 * necessary per port setup. Attach the devices and ask the
@@ -522,26 +517,25 @@ out:
522 * but is also used directly as a helper function by some controllers 517 * but is also used directly as a helper function by some controllers
523 * where the chipset setup is not the default PCI IDE one. 518 * where the chipset setup is not the default PCI IDE one.
524 */ 519 */
525 520
526void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, ata_index_t *index) 521void ide_pci_setup_ports(struct pci_dev *dev, const struct ide_port_info *d, int pciirq, u8 *idx)
527{ 522{
528 int channels = (d->host_flags & IDE_HFLAG_SINGLE) ? 1 : 2, port; 523 int channels = (d->host_flags & IDE_HFLAG_SINGLE) ? 1 : 2, port;
529 int at_least_one_hwif_enabled = 0;
530 ide_hwif_t *hwif, *mate = NULL; 524 ide_hwif_t *hwif, *mate = NULL;
531 u8 tmp; 525 u8 tmp;
532 526
533 index->all = 0xf0f0;
534
535 /* 527 /*
536 * Set up the IDE ports 528 * Set up the IDE ports
537 */ 529 */
538 530
539 for (port = 0; port < channels; ++port) { 531 for (port = 0; port < channels; ++port) {
540 ide_pci_enablebit_t *e = &(d->enablebits[port]); 532 const ide_pci_enablebit_t *e = &(d->enablebits[port]);
541 533
542 if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || 534 if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) ||
543 (tmp & e->mask) != e->val)) 535 (tmp & e->mask) != e->val)) {
536 printk(KERN_INFO "%s: IDE port disabled\n", d->name);
544 continue; /* port not enabled */ 537 continue; /* port not enabled */
538 }
545 539
546 if ((hwif = ide_hwif_configure(dev, d, mate, port, pciirq)) == NULL) 540 if ((hwif = ide_hwif_configure(dev, d, mate, port, pciirq)) == NULL)
547 continue; 541 continue;
@@ -549,11 +543,7 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
549 /* setup proper ancestral information */ 543 /* setup proper ancestral information */
550 hwif->gendev.parent = &dev->dev; 544 hwif->gendev.parent = &dev->dev;
551 545
552 if (hwif->channel) { 546 *(idx + port) = hwif->index;
553 index->b.high = hwif->index;
554 } else {
555 index->b.low = hwif->index;
556 }
557 547
558 548
559 if (d->init_iops) 549 if (d->init_iops)
@@ -562,15 +552,28 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
562 if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0) 552 if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0)
563 ide_hwif_setup_dma(dev, d, hwif); 553 ide_hwif_setup_dma(dev, d, hwif);
564 554
565 if ((d->host_flags & IDE_HFLAG_LEGACY_IRQS) && hwif->irq == 0) 555 if ((!hwif->irq && (d->host_flags & IDE_HFLAG_LEGACY_IRQS)) ||
556 (d->host_flags & IDE_HFLAG_FORCE_LEGACY_IRQS))
566 hwif->irq = port ? 15 : 14; 557 hwif->irq = port ? 15 : 14;
567 558
559 hwif->fixup = d->fixup;
560
568 hwif->host_flags = d->host_flags; 561 hwif->host_flags = d->host_flags;
569 hwif->pio_mask = d->pio_mask; 562 hwif->pio_mask = d->pio_mask;
570 563
571 if ((d->host_flags & IDE_HFLAG_SERIALIZE) && hwif->mate) 564 if ((d->host_flags & IDE_HFLAG_SERIALIZE) && hwif->mate)
572 hwif->mate->serialized = hwif->serialized = 1; 565 hwif->mate->serialized = hwif->serialized = 1;
573 566
567 if (d->host_flags & IDE_HFLAG_IO_32BIT) {
568 hwif->drives[0].io_32bit = 1;
569 hwif->drives[1].io_32bit = 1;
570 }
571
572 if (d->host_flags & IDE_HFLAG_UNMASK_IRQS) {
573 hwif->drives[0].unmask = 1;
574 hwif->drives[1].unmask = 1;
575 }
576
574 if (hwif->dma_base) { 577 if (hwif->dma_base) {
575 hwif->swdma_mask = d->swdma_mask; 578 hwif->swdma_mask = d->swdma_mask;
576 hwif->mwdma_mask = d->mwdma_mask; 579 hwif->mwdma_mask = d->mwdma_mask;
@@ -580,6 +583,9 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
580 hwif->drives[0].autotune = 1; 583 hwif->drives[0].autotune = 1;
581 hwif->drives[1].autotune = 1; 584 hwif->drives[1].autotune = 1;
582 585
586 if (d->host_flags & IDE_HFLAG_RQSIZE_256)
587 hwif->rqsize = 256;
588
583 if (d->init_hwif) 589 if (d->init_hwif)
584 /* Call chipset-specific routine 590 /* Call chipset-specific routine
585 * for each enabled hwif 591 * for each enabled hwif
@@ -587,10 +593,7 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
587 d->init_hwif(hwif); 593 d->init_hwif(hwif);
588 594
589 mate = hwif; 595 mate = hwif;
590 at_least_one_hwif_enabled = 1;
591 } 596 }
592 if (!at_least_one_hwif_enabled)
593 printk(KERN_INFO "%s: neither IDE port enabled (BIOS)\n", d->name);
594} 597}
595 598
596EXPORT_SYMBOL_GPL(ide_pci_setup_ports); 599EXPORT_SYMBOL_GPL(ide_pci_setup_ports);
@@ -602,13 +605,13 @@ EXPORT_SYMBOL_GPL(ide_pci_setup_ports);
602 * 605 *
603 * One thing that is not standardized is the location of the 606 * One thing that is not standardized is the location of the
604 * primary/secondary interface "enable/disable" bits. For chipsets that 607 * primary/secondary interface "enable/disable" bits. For chipsets that
605 * we "know" about, this information is in the ide_pci_device_t struct; 608 * we "know" about, this information is in the struct ide_port_info;
606 * for all other chipsets, we just assume both interfaces are enabled. 609 * for all other chipsets, we just assume both interfaces are enabled.
607 */ 610 */
608static int do_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d, 611static int do_ide_setup_pci_device(struct pci_dev *dev,
609 ata_index_t *index, u8 noisy) 612 const struct ide_port_info *d,
613 u8 *idx, u8 noisy)
610{ 614{
611 static ata_index_t ata_index = { .b = { .low = 0xff, .high = 0xff } };
612 int tried_config = 0; 615 int tried_config = 0;
613 int pciirq, ret; 616 int pciirq, ret;
614 617
@@ -658,51 +661,35 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d,
658 661
659 /* FIXME: silent failure can happen */ 662 /* FIXME: silent failure can happen */
660 663
661 *index = ata_index; 664 ide_pci_setup_ports(dev, d, pciirq, idx);
662 ide_pci_setup_ports(dev, d, pciirq, index);
663out: 665out:
664 return ret; 666 return ret;
665} 667}
666 668
667int ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d) 669int ide_setup_pci_device(struct pci_dev *dev, const struct ide_port_info *d)
668{ 670{
669 ide_hwif_t *hwif = NULL, *mate = NULL; 671 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
670 ata_index_t index_list;
671 int ret; 672 int ret;
672 673
673 ret = do_ide_setup_pci_device(dev, d, &index_list, 1); 674 ret = do_ide_setup_pci_device(dev, d, &idx[0], 1);
674 if (ret < 0)
675 goto out;
676 675
677 if ((index_list.b.low & 0xf0) != 0xf0) 676 if (ret >= 0)
678 hwif = &ide_hwifs[index_list.b.low]; 677 ide_device_add(idx);
679 if ((index_list.b.high & 0xf0) != 0xf0)
680 mate = &ide_hwifs[index_list.b.high];
681 678
682 if (hwif)
683 probe_hwif_init_with_fixup(hwif, d->fixup);
684 if (mate)
685 probe_hwif_init_with_fixup(mate, d->fixup);
686
687 if (hwif)
688 ide_proc_register_port(hwif);
689 if (mate)
690 ide_proc_register_port(mate);
691out:
692 return ret; 679 return ret;
693} 680}
694 681
695EXPORT_SYMBOL_GPL(ide_setup_pci_device); 682EXPORT_SYMBOL_GPL(ide_setup_pci_device);
696 683
697int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2, 684int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2,
698 ide_pci_device_t *d) 685 const struct ide_port_info *d)
699{ 686{
700 struct pci_dev *pdev[] = { dev1, dev2 }; 687 struct pci_dev *pdev[] = { dev1, dev2 };
701 ata_index_t index_list[2];
702 int ret, i; 688 int ret, i;
689 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
703 690
704 for (i = 0; i < 2; i++) { 691 for (i = 0; i < 2; i++) {
705 ret = do_ide_setup_pci_device(pdev[i], d, index_list + i, !i); 692 ret = do_ide_setup_pci_device(pdev[i], d, &idx[i*2], !i);
706 /* 693 /*
707 * FIXME: Mom, mom, they stole me the helper function to undo 694 * FIXME: Mom, mom, they stole me the helper function to undo
708 * do_ide_setup_pci_device() on the first device! 695 * do_ide_setup_pci_device() on the first device!
@@ -711,25 +698,7 @@ int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2,
711 goto out; 698 goto out;
712 } 699 }
713 700
714 for (i = 0; i < 2; i++) { 701 ide_device_add(idx);
715 u8 idx[2] = { index_list[i].b.low, index_list[i].b.high };
716 int j;
717
718 for (j = 0; j < 2; j++) {
719 if ((idx[j] & 0xf0) != 0xf0)
720 probe_hwif_init(ide_hwifs + idx[j]);
721 }
722 }
723
724 for (i = 0; i < 2; i++) {
725 u8 idx[2] = { index_list[i].b.low, index_list[i].b.high };
726 int j;
727
728 for (j = 0; j < 2; j++) {
729 if ((idx[j] & 0xf0) != 0xf0)
730 ide_proc_register_port(ide_hwifs + idx[j]);
731 }
732 }
733out: 702out:
734 return ret; 703 return ret;
735} 704}
@@ -754,9 +723,6 @@ static LIST_HEAD(ide_pci_drivers);
754 * hands the controllers off to the core PCI code to do the rest of 723 * hands the controllers off to the core PCI code to do the rest of
755 * the work. 724 * the work.
756 * 725 *
757 * The driver_data of the driver table must point to an ide_pci_device_t
758 * describing the interface.
759 *
760 * Returns are the same as for pci_register_driver 726 * Returns are the same as for pci_register_driver
761 */ 727 */
762 728
diff --git a/drivers/input/fixp-arith.h b/drivers/input/fixp-arith.h
index ed3d2da0c48..3089d738232 100644
--- a/drivers/input/fixp-arith.h
+++ b/drivers/input/fixp-arith.h
@@ -24,7 +24,7 @@
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * 25 *
26 * Should you need to contact me, the author, you can do so by 26 * Should you need to contact me, the author, you can do so by
27 * e-mail - mail your message to <deneux@ifrance.com> 27 * e-mail - mail your message to <johann.deneux@gmail.com>
28 */ 28 */
29 29
30#include <linux/types.h> 30#include <linux/types.h>
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index ec1b6cfefcd..bfc6061f155 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -136,7 +136,8 @@ static int gameport_measure_speed(struct gameport *gameport)
136 } 136 }
137 137
138 gameport_close(gameport); 138 gameport_close(gameport);
139 return (cpu_data[raw_smp_processor_id()].loops_per_jiffy * (unsigned long)HZ / (1000 / 50)) / (tx < 1 ? 1 : tx); 139 return (cpu_data(raw_smp_processor_id()).loops_per_jiffy *
140 (unsigned long)HZ / (1000 / 50)) / (tx < 1 ? 1 : tx);
140 141
141#else 142#else
142 143
diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c
index 27fc475bd3a..a6ca9d5e252 100644
--- a/drivers/input/joystick/db9.c
+++ b/drivers/input/joystick/db9.c
@@ -4,7 +4,7 @@
4 * Copyright (c) 1999-2001 Vojtech Pavlik 4 * Copyright (c) 1999-2001 Vojtech Pavlik
5 * 5 *
6 * Based on the work of: 6 * Based on the work of:
7 * Andree Borrmann Mats Sjövall 7 * Andree Borrmann Mats Sjövall
8 */ 8 */
9 9
10/* 10/*
diff --git a/drivers/input/joystick/iforce/Makefile b/drivers/input/joystick/iforce/Makefile
index 17ae42bf9ff..74daff49ab6 100644
--- a/drivers/input/joystick/iforce/Makefile
+++ b/drivers/input/joystick/iforce/Makefile
@@ -1,7 +1,7 @@
1# 1#
2# Makefile for the I-Force driver 2# Makefile for the I-Force driver
3# 3#
4# By Johann Deneux <deneux@ifrance.com> 4# By Johann Deneux <johann.deneux@gmail.com>
5# 5#
6 6
7# Goal definition 7# Goal definition
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c
index 76f1969552c..babc913d549 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -4,7 +4,7 @@
4 * OMAP Keypad Driver 4 * OMAP Keypad Driver
5 * 5 *
6 * Copyright (C) 2003 Nokia Corporation 6 * Copyright (C) 2003 Nokia Corporation
7 * Written by Timo Teräs <ext-timo.teras@nokia.com> 7 * Written by Timo Teräs <ext-timo.teras@nokia.com>
8 * 8 *
9 * Added support for H2 & H3 Keypad 9 * Added support for H2 & H3 Keypad
10 * Copyright (C) 2004 Texas Instruments 10 * Copyright (C) 2004 Texas Instruments
@@ -481,6 +481,6 @@ static void __exit omap_kp_exit(void)
481module_init(omap_kp_init); 481module_init(omap_kp_init);
482module_exit(omap_kp_exit); 482module_exit(omap_kp_exit);
483 483
484MODULE_AUTHOR("Timo Teräs"); 484MODULE_AUTHOR("Timo Teräs");
485MODULE_DESCRIPTION("OMAP Keypad Driver"); 485MODULE_DESCRIPTION("OMAP Keypad Driver");
486MODULE_LICENSE("GPL"); 486MODULE_LICENSE("GPL");
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 7acc6351bb4..8f5c7b90187 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -70,9 +70,9 @@ config INPUT_WISTRON_BTNS
70 select LEDS_CLASS 70 select LEDS_CLASS
71 select CHECK_SIGNATURE 71 select CHECK_SIGNATURE
72 help 72 help
73 Say Y here for support of Winstron laptop button interface, used on 73 Say Y here for support of Wistron laptop button interfaces, used on
74 laptops of various brands, including Acer and Fujitsu-Siemens. If 74 laptops of various brands, including Acer and Fujitsu-Siemens. If
75 available, mail and wifi leds will be controlable via /sys/class/leds. 75 available, mail and wifi LEDs will be controllable via /sys/class/leds.
76 76
77 To compile this driver as a module, choose M here: the module will 77 To compile this driver as a module, choose M here: the module will
78 be called wistron_btns. 78 be called wistron_btns.
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index da316d13d7f..21a9c0b69a1 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -906,7 +906,7 @@ static void psmouse_activate(struct psmouse *psmouse)
906 906
907/* 907/*
908 * psmouse_deactivate() puts the mouse into poll mode so that we don't get motion 908 * psmouse_deactivate() puts the mouse into poll mode so that we don't get motion
909 * reports from it unless we explicitely request it. 909 * reports from it unless we explicitly request it.
910 */ 910 */
911 911
912static void psmouse_deactivate(struct psmouse *psmouse) 912static void psmouse_deactivate(struct psmouse *psmouse)
diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c
index 4a321576f34..404eedd5ffa 100644
--- a/drivers/input/mouse/vsxxxaa.c
+++ b/drivers/input/mouse/vsxxxaa.c
@@ -330,7 +330,7 @@ vsxxxaa_handle_POR_packet (struct vsxxxaa *mouse)
330 330
331 /* 331 /*
332 * Check for Power-On-Reset packets. These are sent out 332 * Check for Power-On-Reset packets. These are sent out
333 * after plugging the mouse in, or when explicitely 333 * after plugging the mouse in, or when explicitly
334 * requested by sending 'T'. 334 * requested by sending 'T'.
335 * 335 *
336 * [0]: 1 0 1 0 R3 R2 R1 R0 336 * [0]: 1 0 1 0 R3 R2 R1 R0
diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c
index 09ea50dd345..819ea85576a 100644
--- a/drivers/isdn/act2000/act2000_isa.c
+++ b/drivers/isdn/act2000/act2000_isa.c
@@ -126,7 +126,7 @@ act2000_isa_enable_irq(act2000_card * card)
126 126
127/* 127/*
128 * Install interrupt handler, enable irq on card. 128 * Install interrupt handler, enable irq on card.
129 * If irq is -1, choose next free irq, else irq is given explicitely. 129 * If irq is -1, choose next free irq, else irq is given explicitly.
130 */ 130 */
131int 131int
132act2000_isa_config_irq(act2000_card * card, short irq) 132act2000_isa_config_irq(act2000_card * card, short irq)
diff --git a/drivers/isdn/hardware/eicon/capifunc.c b/drivers/isdn/hardware/eicon/capifunc.c
index 82edc1c1db7..4d425c644d4 100644
--- a/drivers/isdn/hardware/eicon/capifunc.c
+++ b/drivers/isdn/hardware/eicon/capifunc.c
@@ -321,7 +321,7 @@ void sendf(APPL * appl, word command, dword Id, word Number, byte * format, ...)
321 DBG_BLK((((char *)(long)GET_DWORD(&msg.info.data_b3_ind.Data)) + i, 321 DBG_BLK((((char *)(long)GET_DWORD(&msg.info.data_b3_ind.Data)) + i,
322 ((dlength - i) < 256) ? (dlength - i) : 256)) 322 ((dlength - i) < 256) ? (dlength - i) : 256))
323 if (!(myDriverDebugHandle.dbgMask & DL_PRV0)) 323 if (!(myDriverDebugHandle.dbgMask & DL_PRV0))
324 break; /* not more if not explicitely requested */ 324 break; /* not more if not explicitly requested */
325 } 325 }
326 } 326 }
327 break; 327 break;
@@ -965,7 +965,7 @@ static u16 diva_send_message(struct capi_ctr *ctrl,
965 ((GET_WORD(&msg->info.data_b3_req.Data_Length) - j) < 965 ((GET_WORD(&msg->info.data_b3_req.Data_Length) - j) <
966 256) ? (GET_WORD(&msg->info.data_b3_req.Data_Length) - j) : 256)) 966 256) ? (GET_WORD(&msg->info.data_b3_req.Data_Length) - j) : 256))
967 if (!(myDriverDebugHandle.dbgMask & DL_PRV0)) 967 if (!(myDriverDebugHandle.dbgMask & DL_PRV0))
968 break; /* not more if not explicitely requested */ 968 break; /* not more if not explicitly requested */
969 } 969 }
970 } 970 }
971#endif 971#endif
diff --git a/drivers/isdn/hisax/amd7930_fn.c b/drivers/isdn/hisax/amd7930_fn.c
index 3b19caeba25..c0d7036404a 100644
--- a/drivers/isdn/hisax/amd7930_fn.c
+++ b/drivers/isdn/hisax/amd7930_fn.c
@@ -767,7 +767,7 @@ Amd7930_init(struct IsdnCardState *cs)
767 /* read */ 767 /* read */
768 if (*ptr++ >= 0x100) { 768 if (*ptr++ >= 0x100) {
769 if (cmd < 8) 769 if (cmd < 8)
770 /* setzt Register zurück */ 770 /* reset register */
771 rByteAMD(cs, cmd); 771 rByteAMD(cs, cmd);
772 else { 772 else {
773 wByteAMD(cs, 0x00, cmd); 773 wByteAMD(cs, 0x00, cmd);
diff --git a/drivers/isdn/hisax/enternow_pci.c b/drivers/isdn/hisax/enternow_pci.c
index b73027ff50e..39f421ed8de 100644
--- a/drivers/isdn/hisax/enternow_pci.c
+++ b/drivers/isdn/hisax/enternow_pci.c
@@ -75,16 +75,16 @@
75static const char *enternow_pci_rev = "$Revision: 1.1.4.5 $"; 75static const char *enternow_pci_rev = "$Revision: 1.1.4.5 $";
76 76
77 77
78/* für PowerISDN PCI */ 78/* for PowerISDN PCI */
79#define TJ_AMD_IRQ 0x20 79#define TJ_AMD_IRQ 0x20
80#define TJ_LED1 0x40 80#define TJ_LED1 0x40
81#define TJ_LED2 0x80 81#define TJ_LED2 0x80
82 82
83 83
84/* Das Fenster zum AMD... 84/* The window to [the] AMD [chip]...
85 * Ab Adresse hw.njet.base + TJ_AMD_PORT werden vom AMD jeweils 8 Bit in 85 * From address hw.njet.base + TJ_AMD_PORT onwards, the AMD
86 * den TigerJet i/o-Raum gemappt 86 * maps [consecutive/multiple] 8 bits into the TigerJet I/O space
87 * -> 0x01 des AMD bei hw.njet.base + 0C4 */ 87 * -> 0x01 of the AMD at hw.njet.base + 0C4 */
88#define TJ_AMD_PORT 0xC0 88#define TJ_AMD_PORT 0xC0
89 89
90 90
@@ -96,11 +96,11 @@ static const char *enternow_pci_rev = "$Revision: 1.1.4.5 $";
96static unsigned char 96static unsigned char
97ReadByteAmd7930(struct IsdnCardState *cs, unsigned char offset) 97ReadByteAmd7930(struct IsdnCardState *cs, unsigned char offset)
98{ 98{
99 /* direktes Register */ 99 /* direct register */
100 if(offset < 8) 100 if(offset < 8)
101 return (inb(cs->hw.njet.isac + 4*offset)); 101 return (inb(cs->hw.njet.isac + 4*offset));
102 102
103 /* indirektes Register */ 103 /* indirect register */
104 else { 104 else {
105 outb(offset, cs->hw.njet.isac + 4*AMD_CR); 105 outb(offset, cs->hw.njet.isac + 4*AMD_CR);
106 return(inb(cs->hw.njet.isac + 4*AMD_DR)); 106 return(inb(cs->hw.njet.isac + 4*AMD_DR));
@@ -111,11 +111,11 @@ ReadByteAmd7930(struct IsdnCardState *cs, unsigned char offset)
111static void 111static void
112WriteByteAmd7930(struct IsdnCardState *cs, unsigned char offset, unsigned char value) 112WriteByteAmd7930(struct IsdnCardState *cs, unsigned char offset, unsigned char value)
113{ 113{
114 /* direktes Register */ 114 /* direct register */
115 if(offset < 8) 115 if(offset < 8)
116 outb(value, cs->hw.njet.isac + 4*offset); 116 outb(value, cs->hw.njet.isac + 4*offset);
117 117
118 /* indirektes Register */ 118 /* indirect register */
119 else { 119 else {
120 outb(offset, cs->hw.njet.isac + 4*AMD_CR); 120 outb(offset, cs->hw.njet.isac + 4*AMD_CR);
121 outb(value, cs->hw.njet.isac + 4*AMD_DR); 121 outb(value, cs->hw.njet.isac + 4*AMD_DR);
diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
index 077080aca79..fba8b624ffc 100644
--- a/drivers/isdn/hisax/hfc_pci.c
+++ b/drivers/isdn/hisax/hfc_pci.c
@@ -1,6 +1,6 @@
1/* $Id: hfc_pci.c,v 1.48.2.4 2004/02/11 13:21:33 keil Exp $ 1/* $Id: hfc_pci.c,v 1.48.2.4 2004/02/11 13:21:33 keil Exp $
2 * 2 *
3 * low level driver for CCD´s hfc-pci based cards 3 * low level driver for CCD's hfc-pci based cards
4 * 4 *
5 * Author Werner Cornelius 5 * Author Werner Cornelius
6 * based on existing driver for CCD hfc ISA cards 6 * based on existing driver for CCD hfc ISA cards
diff --git a/drivers/isdn/hisax/isdnhdlc.c b/drivers/isdn/hisax/isdnhdlc.c
index 268dced6c34..c69a77a8006 100644
--- a/drivers/isdn/hisax/isdnhdlc.c
+++ b/drivers/isdn/hisax/isdnhdlc.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * isdnhdlc.c -- General purpose ISDN HDLC decoder. 2 * isdnhdlc.c -- General purpose ISDN HDLC decoder.
3 * 3 *
4 *Copyright (C) 2002 Wolfgang Mües <wolfgang@iksw-muees.de> 4 *Copyright (C) 2002 Wolfgang Mües <wolfgang@iksw-muees.de>
5 * 2001 Frode Isaksen <fisaksen@bewan.com> 5 * 2001 Frode Isaksen <fisaksen@bewan.com>
6 * 2001 Kai Germaschewski <kai.germaschewski@gmx.de> 6 * 2001 Kai Germaschewski <kai.germaschewski@gmx.de>
7 * 7 *
@@ -27,7 +27,7 @@
27 27
28/*-------------------------------------------------------------------*/ 28/*-------------------------------------------------------------------*/
29 29
30MODULE_AUTHOR("Wolfgang Mües <wolfgang@iksw-muees.de>, " 30MODULE_AUTHOR("Wolfgang Mües <wolfgang@iksw-muees.de>, "
31 "Frode Isaksen <fisaksen@bewan.com>, " 31 "Frode Isaksen <fisaksen@bewan.com>, "
32 "Kai Germaschewski <kai.germaschewski@gmx.de>"); 32 "Kai Germaschewski <kai.germaschewski@gmx.de>");
33MODULE_DESCRIPTION("General purpose ISDN HDLC decoder"); 33MODULE_DESCRIPTION("General purpose ISDN HDLC decoder");
diff --git a/drivers/isdn/hisax/isdnhdlc.h b/drivers/isdn/hisax/isdnhdlc.h
index 45167d2f8fb..cf0a95a2401 100644
--- a/drivers/isdn/hisax/isdnhdlc.h
+++ b/drivers/isdn/hisax/isdnhdlc.h
@@ -5,7 +5,7 @@
5 * Neccessary because some ISDN devices don't have HDLC 5 * Neccessary because some ISDN devices don't have HDLC
6 * controllers. Also included: a bit reversal table. 6 * controllers. Also included: a bit reversal table.
7 * 7 *
8 *Copyright (C) 2002 Wolfgang Mües <wolfgang@iksw-muees.de> 8 *Copyright (C) 2002 Wolfgang Mües <wolfgang@iksw-muees.de>
9 * 2001 Frode Isaksen <fisaksen@bewan.com> 9 * 2001 Frode Isaksen <fisaksen@bewan.com>
10 * 2001 Kai Germaschewski <kai.germaschewski@gmx.de> 10 * 2001 Kai Germaschewski <kai.germaschewski@gmx.de>
11 * 11 *
diff --git a/drivers/isdn/hisax/jade.c b/drivers/isdn/hisax/jade.c
index 43d61d1bc5b..70840a710ac 100644
--- a/drivers/isdn/hisax/jade.c
+++ b/drivers/isdn/hisax/jade.c
@@ -304,7 +304,7 @@ initjade(struct IsdnCardState *cs)
304 cs->BC_Write_Reg(cs, 1, jade_HDLC_IMR, 0x00); 304 cs->BC_Write_Reg(cs, 1, jade_HDLC_IMR, 0x00);
305 /* Setup host access to hdlc controller */ 305 /* Setup host access to hdlc controller */
306 jade_write_indirect(cs, jade_HDLCCNTRACCESS, (jadeINDIRECT_HAH1|jadeINDIRECT_HAH2)); 306 jade_write_indirect(cs, jade_HDLCCNTRACCESS, (jadeINDIRECT_HAH1|jadeINDIRECT_HAH2));
307 /* Unmask HDLC int (don´t forget DSP int later on)*/ 307 /* Unmask HDLC int (don't forget DSP int later on)*/
308 cs->BC_Write_Reg(cs, -1,jade_INT, (jadeINT_HDLC1|jadeINT_HDLC2)); 308 cs->BC_Write_Reg(cs, -1,jade_INT, (jadeINT_HDLC1|jadeINT_HDLC2));
309 309
310 /* once again TRANSPARENT */ 310 /* once again TRANSPARENT */
diff --git a/drivers/isdn/pcbit/capi.c b/drivers/isdn/pcbit/capi.c
index 7b55e151f1b..ac5a91ccde8 100644
--- a/drivers/isdn/pcbit/capi.c
+++ b/drivers/isdn/pcbit/capi.c
@@ -15,9 +15,9 @@
15 15
16/* 16/*
17 * Documentation: 17 * Documentation:
18 * - "Common ISDN API - Perfil Português - Versão 2.1", 18 * - "Common ISDN API - Perfil Português - Versão 2.1",
19 * Telecom Portugal, Fev 1992. 19 * Telecom Portugal, Fev 1992.
20 * - "Common ISDN API - Especificação de protocolos para 20 * - "Common ISDN API - Especificação de protocolos para
21 * acesso aos canais B", Inesc, Jan 1994. 21 * acesso aos canais B", Inesc, Jan 1994.
22 */ 22 */
23 23
diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
index 50914439d86..0fd64075129 100644
--- a/drivers/leds/leds-s3c24xx.c
+++ b/drivers/leds/leds-s3c24xx.c
@@ -43,7 +43,7 @@ static void s3c24xx_led_set(struct led_classdev *led_cdev,
43 struct s3c24xx_gpio_led *led = to_gpio(led_cdev); 43 struct s3c24xx_gpio_led *led = to_gpio(led_cdev);
44 struct s3c24xx_led_platdata *pd = led->pdata; 44 struct s3c24xx_led_platdata *pd = led->pdata;
45 45
46 /* there will be a sort delay between setting the output and 46 /* there will be a short delay between setting the output and
47 * going from output to input when using tristate. */ 47 * going from output to input when using tristate. */
48 48
49 s3c2410_gpio_setpin(pd->gpio, (value ? 1 : 0) ^ 49 s3c2410_gpio_setpin(pd->gpio, (value ? 1 : 0) ^
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c
index c803d2bba65..48d647abea4 100644
--- a/drivers/macintosh/mediabay.c
+++ b/drivers/macintosh/mediabay.c
@@ -563,7 +563,7 @@ static void media_bay_step(int i)
563 ide_init_hwif_ports(&hw, (unsigned long) bay->cd_base, (unsigned long) 0, NULL); 563 ide_init_hwif_ports(&hw, (unsigned long) bay->cd_base, (unsigned long) 0, NULL);
564 hw.irq = bay->cd_irq; 564 hw.irq = bay->cd_irq;
565 hw.chipset = ide_pmac; 565 hw.chipset = ide_pmac;
566 bay->cd_index = ide_register_hw(&hw, 0, NULL); 566 bay->cd_index = ide_register_hw(&hw, NULL, 0, NULL);
567 pmu_resume(); 567 pmu_resume();
568 } 568 }
569 if (bay->cd_index == -1) { 569 if (bay->cd_index == -1) {
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index f7c509b7a8e..dc741d3a453 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -1521,7 +1521,7 @@ pmu_sr_intr(void)
1521 req = current_req; 1521 req = current_req;
1522 /* 1522 /*
1523 * For PMU sleep and freq change requests, we lock the 1523 * For PMU sleep and freq change requests, we lock the
1524 * PMU until it's explicitely unlocked. This avoids any 1524 * PMU until it's explicitly unlocked. This avoids any
1525 * spurrious event polling getting in 1525 * spurrious event polling getting in
1526 */ 1526 */
1527 current_req = req->next; 1527 current_req = req->next;
diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig
index 34a8c60a254..9b6fbf044fd 100644
--- a/drivers/md/Kconfig
+++ b/drivers/md/Kconfig
@@ -267,6 +267,12 @@ config DM_MULTIPATH_RDAC
267 ---help--- 267 ---help---
268 Multipath support for LSI/Engenio RDAC. 268 Multipath support for LSI/Engenio RDAC.
269 269
270config DM_MULTIPATH_HP
271 tristate "HP MSA multipath support (EXPERIMENTAL)"
272 depends on DM_MULTIPATH && BLK_DEV_DM && EXPERIMENTAL
273 ---help---
274 Multipath support for HP MSA (Active/Passive) series hardware.
275
270config DM_DELAY 276config DM_DELAY
271 tristate "I/O delaying target (EXPERIMENTAL)" 277 tristate "I/O delaying target (EXPERIMENTAL)"
272 depends on BLK_DEV_DM && EXPERIMENTAL 278 depends on BLK_DEV_DM && EXPERIMENTAL
@@ -276,4 +282,10 @@ config DM_DELAY
276 282
277 If unsure, say N. 283 If unsure, say N.
278 284
285config DM_UEVENT
286 bool "DM uevents (EXPERIMENTAL)"
287 depends on BLK_DEV_DM && EXPERIMENTAL
288 ---help---
289 Generate udev events for DM events.
290
279endif # MD 291endif # MD
diff --git a/drivers/md/Makefile b/drivers/md/Makefile
index c49366cdc05..d9aa7edb878 100644
--- a/drivers/md/Makefile
+++ b/drivers/md/Makefile
@@ -8,6 +8,7 @@ dm-multipath-objs := dm-hw-handler.o dm-path-selector.o dm-mpath.o
8dm-snapshot-objs := dm-snap.o dm-exception-store.o 8dm-snapshot-objs := dm-snap.o dm-exception-store.o
9dm-mirror-objs := dm-log.o dm-raid1.o 9dm-mirror-objs := dm-log.o dm-raid1.o
10dm-rdac-objs := dm-mpath-rdac.o 10dm-rdac-objs := dm-mpath-rdac.o
11dm-hp-sw-objs := dm-mpath-hp-sw.o
11md-mod-objs := md.o bitmap.o 12md-mod-objs := md.o bitmap.o
12raid456-objs := raid5.o raid6algos.o raid6recov.o raid6tables.o \ 13raid456-objs := raid5.o raid6algos.o raid6recov.o raid6tables.o \
13 raid6int1.o raid6int2.o raid6int4.o \ 14 raid6int1.o raid6int2.o raid6int4.o \
@@ -35,6 +36,7 @@ obj-$(CONFIG_DM_CRYPT) += dm-crypt.o
35obj-$(CONFIG_DM_DELAY) += dm-delay.o 36obj-$(CONFIG_DM_DELAY) += dm-delay.o
36obj-$(CONFIG_DM_MULTIPATH) += dm-multipath.o dm-round-robin.o 37obj-$(CONFIG_DM_MULTIPATH) += dm-multipath.o dm-round-robin.o
37obj-$(CONFIG_DM_MULTIPATH_EMC) += dm-emc.o 38obj-$(CONFIG_DM_MULTIPATH_EMC) += dm-emc.o
39obj-$(CONFIG_DM_MULTIPATH_HP) += dm-hp-sw.o
38obj-$(CONFIG_DM_MULTIPATH_RDAC) += dm-rdac.o 40obj-$(CONFIG_DM_MULTIPATH_RDAC) += dm-rdac.o
39obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o 41obj-$(CONFIG_DM_SNAPSHOT) += dm-snapshot.o
40obj-$(CONFIG_DM_MIRROR) += dm-mirror.o 42obj-$(CONFIG_DM_MIRROR) += dm-mirror.o
@@ -48,6 +50,10 @@ ifeq ($(CONFIG_ALTIVEC),y)
48altivec_flags := -maltivec -mabi=altivec 50altivec_flags := -maltivec -mabi=altivec
49endif 51endif
50 52
53ifeq ($(CONFIG_DM_UEVENT),y)
54dm-mod-objs += dm-uevent.o
55endif
56
51targets += raid6int1.c 57targets += raid6int1.c
52$(obj)/raid6int1.c: UNROLL := 1 58$(obj)/raid6int1.c: UNROLL := 1
53$(obj)/raid6int1.c: $(src)/raid6int.uc $(src)/unroll.pl FORCE 59$(obj)/raid6int1.c: $(src)/raid6int.uc $(src)/unroll.pl FORCE
diff --git a/drivers/md/dm-bio-list.h b/drivers/md/dm-bio-list.h
index 3f7b827649e..d4509be0fe6 100644
--- a/drivers/md/dm-bio-list.h
+++ b/drivers/md/dm-bio-list.h
@@ -21,11 +21,6 @@ static inline int bio_list_empty(const struct bio_list *bl)
21 return bl->head == NULL; 21 return bl->head == NULL;
22} 22}
23 23
24#define BIO_LIST_INIT { .head = NULL, .tail = NULL }
25
26#define BIO_LIST(bl) \
27 struct bio_list bl = BIO_LIST_INIT
28
29static inline void bio_list_init(struct bio_list *bl) 24static inline void bio_list_init(struct bio_list *bl)
30{ 25{
31 bl->head = bl->tail = NULL; 26 bl->head = bl->tail = NULL;
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 64fee90bb68..0eb5416798b 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -36,7 +36,6 @@ struct dm_crypt_io {
36 struct work_struct work; 36 struct work_struct work;
37 atomic_t pending; 37 atomic_t pending;
38 int error; 38 int error;
39 int post_process;
40}; 39};
41 40
42/* 41/*
@@ -57,7 +56,7 @@ struct crypt_config;
57 56
58struct crypt_iv_operations { 57struct crypt_iv_operations {
59 int (*ctr)(struct crypt_config *cc, struct dm_target *ti, 58 int (*ctr)(struct crypt_config *cc, struct dm_target *ti,
60 const char *opts); 59 const char *opts);
61 void (*dtr)(struct crypt_config *cc); 60 void (*dtr)(struct crypt_config *cc);
62 const char *(*status)(struct crypt_config *cc); 61 const char *(*status)(struct crypt_config *cc);
63 int (*generator)(struct crypt_config *cc, u8 *iv, sector_t sector); 62 int (*generator)(struct crypt_config *cc, u8 *iv, sector_t sector);
@@ -80,6 +79,8 @@ struct crypt_config {
80 mempool_t *page_pool; 79 mempool_t *page_pool;
81 struct bio_set *bs; 80 struct bio_set *bs;
82 81
82 struct workqueue_struct *io_queue;
83 struct workqueue_struct *crypt_queue;
83 /* 84 /*
84 * crypto related data 85 * crypto related data
85 */ 86 */
@@ -112,7 +113,7 @@ static void clone_init(struct dm_crypt_io *, struct bio *);
112 * Different IV generation algorithms: 113 * Different IV generation algorithms:
113 * 114 *
114 * plain: the initial vector is the 32-bit little-endian version of the sector 115 * plain: the initial vector is the 32-bit little-endian version of the sector
115 * number, padded with zeros if neccessary. 116 * number, padded with zeros if necessary.
116 * 117 *
117 * essiv: "encrypted sector|salt initial vector", the sector number is 118 * essiv: "encrypted sector|salt initial vector", the sector number is
118 * encrypted with the bulk cipher using a salt as key. The salt 119 * encrypted with the bulk cipher using a salt as key. The salt
@@ -137,7 +138,7 @@ static int crypt_iv_plain_gen(struct crypt_config *cc, u8 *iv, sector_t sector)
137} 138}
138 139
139static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti, 140static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti,
140 const char *opts) 141 const char *opts)
141{ 142{
142 struct crypto_cipher *essiv_tfm; 143 struct crypto_cipher *essiv_tfm;
143 struct crypto_hash *hash_tfm; 144 struct crypto_hash *hash_tfm;
@@ -175,6 +176,7 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti,
175 176
176 if (err) { 177 if (err) {
177 ti->error = "Error calculating hash in ESSIV"; 178 ti->error = "Error calculating hash in ESSIV";
179 kfree(salt);
178 return err; 180 return err;
179 } 181 }
180 182
@@ -188,7 +190,7 @@ static int crypt_iv_essiv_ctr(struct crypt_config *cc, struct dm_target *ti,
188 if (crypto_cipher_blocksize(essiv_tfm) != 190 if (crypto_cipher_blocksize(essiv_tfm) !=
189 crypto_blkcipher_ivsize(cc->tfm)) { 191 crypto_blkcipher_ivsize(cc->tfm)) {
190 ti->error = "Block size of ESSIV cipher does " 192 ti->error = "Block size of ESSIV cipher does "
191 "not match IV size of block cipher"; 193 "not match IV size of block cipher";
192 crypto_free_cipher(essiv_tfm); 194 crypto_free_cipher(essiv_tfm);
193 kfree(salt); 195 kfree(salt);
194 return -EINVAL; 196 return -EINVAL;
@@ -319,10 +321,10 @@ crypt_convert_scatterlist(struct crypt_config *cc, struct scatterlist *out,
319 return r; 321 return r;
320} 322}
321 323
322static void 324static void crypt_convert_init(struct crypt_config *cc,
323crypt_convert_init(struct crypt_config *cc, struct convert_context *ctx, 325 struct convert_context *ctx,
324 struct bio *bio_out, struct bio *bio_in, 326 struct bio *bio_out, struct bio *bio_in,
325 sector_t sector, int write) 327 sector_t sector, int write)
326{ 328{
327 ctx->bio_in = bio_in; 329 ctx->bio_in = bio_in;
328 ctx->bio_out = bio_out; 330 ctx->bio_out = bio_out;
@@ -338,7 +340,7 @@ crypt_convert_init(struct crypt_config *cc, struct convert_context *ctx,
338 * Encrypt / decrypt data from one bio to another one (can be the same one) 340 * Encrypt / decrypt data from one bio to another one (can be the same one)
339 */ 341 */
340static int crypt_convert(struct crypt_config *cc, 342static int crypt_convert(struct crypt_config *cc,
341 struct convert_context *ctx) 343 struct convert_context *ctx)
342{ 344{
343 int r = 0; 345 int r = 0;
344 346
@@ -370,7 +372,7 @@ static int crypt_convert(struct crypt_config *cc,
370 } 372 }
371 373
372 r = crypt_convert_scatterlist(cc, &sg_out, &sg_in, sg_in.length, 374 r = crypt_convert_scatterlist(cc, &sg_out, &sg_in, sg_in.length,
373 ctx->write, ctx->sector); 375 ctx->write, ctx->sector);
374 if (r < 0) 376 if (r < 0)
375 break; 377 break;
376 378
@@ -380,13 +382,13 @@ static int crypt_convert(struct crypt_config *cc,
380 return r; 382 return r;
381} 383}
382 384
383 static void dm_crypt_bio_destructor(struct bio *bio) 385static void dm_crypt_bio_destructor(struct bio *bio)
384 { 386{
385 struct dm_crypt_io *io = bio->bi_private; 387 struct dm_crypt_io *io = bio->bi_private;
386 struct crypt_config *cc = io->target->private; 388 struct crypt_config *cc = io->target->private;
387 389
388 bio_free(bio, cc->bs); 390 bio_free(bio, cc->bs);
389 } 391}
390 392
391/* 393/*
392 * Generate a new unfragmented bio with the given size 394 * Generate a new unfragmented bio with the given size
@@ -458,7 +460,7 @@ static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone)
458 * One of the bios was finished. Check for completion of 460 * One of the bios was finished. Check for completion of
459 * the whole request and correctly clean up the buffer. 461 * the whole request and correctly clean up the buffer.
460 */ 462 */
461static void dec_pending(struct dm_crypt_io *io, int error) 463static void crypt_dec_pending(struct dm_crypt_io *io, int error)
462{ 464{
463 struct crypt_config *cc = (struct crypt_config *) io->target->private; 465 struct crypt_config *cc = (struct crypt_config *) io->target->private;
464 466
@@ -474,18 +476,36 @@ static void dec_pending(struct dm_crypt_io *io, int error)
474} 476}
475 477
476/* 478/*
477 * kcryptd: 479 * kcryptd/kcryptd_io:
478 * 480 *
479 * Needed because it would be very unwise to do decryption in an 481 * Needed because it would be very unwise to do decryption in an
480 * interrupt context. 482 * interrupt context.
483 *
484 * kcryptd performs the actual encryption or decryption.
485 *
486 * kcryptd_io performs the IO submission.
487 *
488 * They must be separated as otherwise the final stages could be
489 * starved by new requests which can block in the first stages due
490 * to memory allocation.
481 */ 491 */
482static struct workqueue_struct *_kcryptd_workqueue;
483static void kcryptd_do_work(struct work_struct *work); 492static void kcryptd_do_work(struct work_struct *work);
493static void kcryptd_do_crypt(struct work_struct *work);
484 494
485static void kcryptd_queue_io(struct dm_crypt_io *io) 495static void kcryptd_queue_io(struct dm_crypt_io *io)
486{ 496{
497 struct crypt_config *cc = io->target->private;
498
487 INIT_WORK(&io->work, kcryptd_do_work); 499 INIT_WORK(&io->work, kcryptd_do_work);
488 queue_work(_kcryptd_workqueue, &io->work); 500 queue_work(cc->io_queue, &io->work);
501}
502
503static void kcryptd_queue_crypt(struct dm_crypt_io *io)
504{
505 struct crypt_config *cc = io->target->private;
506
507 INIT_WORK(&io->work, kcryptd_do_crypt);
508 queue_work(cc->crypt_queue, &io->work);
489} 509}
490 510
491static void crypt_endio(struct bio *clone, int error) 511static void crypt_endio(struct bio *clone, int error)
@@ -508,13 +528,12 @@ static void crypt_endio(struct bio *clone, int error)
508 } 528 }
509 529
510 bio_put(clone); 530 bio_put(clone);
511 io->post_process = 1; 531 kcryptd_queue_crypt(io);
512 kcryptd_queue_io(io);
513 return; 532 return;
514 533
515out: 534out:
516 bio_put(clone); 535 bio_put(clone);
517 dec_pending(io, error); 536 crypt_dec_pending(io, error);
518} 537}
519 538
520static void clone_init(struct dm_crypt_io *io, struct bio *clone) 539static void clone_init(struct dm_crypt_io *io, struct bio *clone)
@@ -544,7 +563,7 @@ static void process_read(struct dm_crypt_io *io)
544 */ 563 */
545 clone = bio_alloc_bioset(GFP_NOIO, bio_segments(base_bio), cc->bs); 564 clone = bio_alloc_bioset(GFP_NOIO, bio_segments(base_bio), cc->bs);
546 if (unlikely(!clone)) { 565 if (unlikely(!clone)) {
547 dec_pending(io, -ENOMEM); 566 crypt_dec_pending(io, -ENOMEM);
548 return; 567 return;
549 } 568 }
550 569
@@ -579,7 +598,7 @@ static void process_write(struct dm_crypt_io *io)
579 while (remaining) { 598 while (remaining) {
580 clone = crypt_alloc_buffer(io, remaining); 599 clone = crypt_alloc_buffer(io, remaining);
581 if (unlikely(!clone)) { 600 if (unlikely(!clone)) {
582 dec_pending(io, -ENOMEM); 601 crypt_dec_pending(io, -ENOMEM);
583 return; 602 return;
584 } 603 }
585 604
@@ -589,7 +608,7 @@ static void process_write(struct dm_crypt_io *io)
589 if (unlikely(crypt_convert(cc, &ctx) < 0)) { 608 if (unlikely(crypt_convert(cc, &ctx) < 0)) {
590 crypt_free_buffer_pages(cc, clone); 609 crypt_free_buffer_pages(cc, clone);
591 bio_put(clone); 610 bio_put(clone);
592 dec_pending(io, -EIO); 611 crypt_dec_pending(io, -EIO);
593 return; 612 return;
594 } 613 }
595 614
@@ -624,17 +643,23 @@ static void process_read_endio(struct dm_crypt_io *io)
624 crypt_convert_init(cc, &ctx, io->base_bio, io->base_bio, 643 crypt_convert_init(cc, &ctx, io->base_bio, io->base_bio,
625 io->base_bio->bi_sector - io->target->begin, 0); 644 io->base_bio->bi_sector - io->target->begin, 0);
626 645
627 dec_pending(io, crypt_convert(cc, &ctx)); 646 crypt_dec_pending(io, crypt_convert(cc, &ctx));
628} 647}
629 648
630static void kcryptd_do_work(struct work_struct *work) 649static void kcryptd_do_work(struct work_struct *work)
631{ 650{
632 struct dm_crypt_io *io = container_of(work, struct dm_crypt_io, work); 651 struct dm_crypt_io *io = container_of(work, struct dm_crypt_io, work);
633 652
634 if (io->post_process) 653 if (bio_data_dir(io->base_bio) == READ)
635 process_read_endio(io);
636 else if (bio_data_dir(io->base_bio) == READ)
637 process_read(io); 654 process_read(io);
655}
656
657static void kcryptd_do_crypt(struct work_struct *work)
658{
659 struct dm_crypt_io *io = container_of(work, struct dm_crypt_io, work);
660
661 if (bio_data_dir(io->base_bio) == READ)
662 process_read_endio(io);
638 else 663 else
639 process_write(io); 664 process_write(io);
640} 665}
@@ -690,7 +715,7 @@ static int crypt_set_key(struct crypt_config *cc, char *key)
690 cc->key_size = key_size; /* initial settings */ 715 cc->key_size = key_size; /* initial settings */
691 716
692 if ((!key_size && strcmp(key, "-")) || 717 if ((!key_size && strcmp(key, "-")) ||
693 (key_size && crypt_decode_key(cc->key, key, key_size) < 0)) 718 (key_size && crypt_decode_key(cc->key, key, key_size) < 0))
694 return -EINVAL; 719 return -EINVAL;
695 720
696 set_bit(DM_CRYPT_KEY_VALID, &cc->flags); 721 set_bit(DM_CRYPT_KEY_VALID, &cc->flags);
@@ -746,7 +771,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
746 771
747 if (crypt_set_key(cc, argv[1])) { 772 if (crypt_set_key(cc, argv[1])) {
748 ti->error = "Error decoding key"; 773 ti->error = "Error decoding key";
749 goto bad1; 774 goto bad_cipher;
750 } 775 }
751 776
752 /* Compatiblity mode for old dm-crypt cipher strings */ 777 /* Compatiblity mode for old dm-crypt cipher strings */
@@ -757,19 +782,19 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
757 782
758 if (strcmp(chainmode, "ecb") && !ivmode) { 783 if (strcmp(chainmode, "ecb") && !ivmode) {
759 ti->error = "This chaining mode requires an IV mechanism"; 784 ti->error = "This chaining mode requires an IV mechanism";
760 goto bad1; 785 goto bad_cipher;
761 } 786 }
762 787
763 if (snprintf(cc->cipher, CRYPTO_MAX_ALG_NAME, "%s(%s)", chainmode, 788 if (snprintf(cc->cipher, CRYPTO_MAX_ALG_NAME, "%s(%s)",
764 cipher) >= CRYPTO_MAX_ALG_NAME) { 789 chainmode, cipher) >= CRYPTO_MAX_ALG_NAME) {
765 ti->error = "Chain mode + cipher name is too long"; 790 ti->error = "Chain mode + cipher name is too long";
766 goto bad1; 791 goto bad_cipher;
767 } 792 }
768 793
769 tfm = crypto_alloc_blkcipher(cc->cipher, 0, CRYPTO_ALG_ASYNC); 794 tfm = crypto_alloc_blkcipher(cc->cipher, 0, CRYPTO_ALG_ASYNC);
770 if (IS_ERR(tfm)) { 795 if (IS_ERR(tfm)) {
771 ti->error = "Error allocating crypto tfm"; 796 ti->error = "Error allocating crypto tfm";
772 goto bad1; 797 goto bad_cipher;
773 } 798 }
774 799
775 strcpy(cc->cipher, cipher); 800 strcpy(cc->cipher, cipher);
@@ -793,18 +818,18 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
793 cc->iv_gen_ops = &crypt_iv_null_ops; 818 cc->iv_gen_ops = &crypt_iv_null_ops;
794 else { 819 else {
795 ti->error = "Invalid IV mode"; 820 ti->error = "Invalid IV mode";
796 goto bad2; 821 goto bad_ivmode;
797 } 822 }
798 823
799 if (cc->iv_gen_ops && cc->iv_gen_ops->ctr && 824 if (cc->iv_gen_ops && cc->iv_gen_ops->ctr &&
800 cc->iv_gen_ops->ctr(cc, ti, ivopts) < 0) 825 cc->iv_gen_ops->ctr(cc, ti, ivopts) < 0)
801 goto bad2; 826 goto bad_ivmode;
802 827
803 cc->iv_size = crypto_blkcipher_ivsize(tfm); 828 cc->iv_size = crypto_blkcipher_ivsize(tfm);
804 if (cc->iv_size) 829 if (cc->iv_size)
805 /* at least a 64 bit sector number should fit in our buffer */ 830 /* at least a 64 bit sector number should fit in our buffer */
806 cc->iv_size = max(cc->iv_size, 831 cc->iv_size = max(cc->iv_size,
807 (unsigned int)(sizeof(u64) / sizeof(u8))); 832 (unsigned int)(sizeof(u64) / sizeof(u8)));
808 else { 833 else {
809 if (cc->iv_gen_ops) { 834 if (cc->iv_gen_ops) {
810 DMWARN("Selected cipher does not support IVs"); 835 DMWARN("Selected cipher does not support IVs");
@@ -817,13 +842,13 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
817 cc->io_pool = mempool_create_slab_pool(MIN_IOS, _crypt_io_pool); 842 cc->io_pool = mempool_create_slab_pool(MIN_IOS, _crypt_io_pool);
818 if (!cc->io_pool) { 843 if (!cc->io_pool) {
819 ti->error = "Cannot allocate crypt io mempool"; 844 ti->error = "Cannot allocate crypt io mempool";
820 goto bad3; 845 goto bad_slab_pool;
821 } 846 }
822 847
823 cc->page_pool = mempool_create_page_pool(MIN_POOL_PAGES, 0); 848 cc->page_pool = mempool_create_page_pool(MIN_POOL_PAGES, 0);
824 if (!cc->page_pool) { 849 if (!cc->page_pool) {
825 ti->error = "Cannot allocate page mempool"; 850 ti->error = "Cannot allocate page mempool";
826 goto bad4; 851 goto bad_page_pool;
827 } 852 }
828 853
829 cc->bs = bioset_create(MIN_IOS, MIN_IOS); 854 cc->bs = bioset_create(MIN_IOS, MIN_IOS);
@@ -834,25 +859,25 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
834 859
835 if (crypto_blkcipher_setkey(tfm, cc->key, key_size) < 0) { 860 if (crypto_blkcipher_setkey(tfm, cc->key, key_size) < 0) {
836 ti->error = "Error setting key"; 861 ti->error = "Error setting key";
837 goto bad5; 862 goto bad_device;
838 } 863 }
839 864
840 if (sscanf(argv[2], "%llu", &tmpll) != 1) { 865 if (sscanf(argv[2], "%llu", &tmpll) != 1) {
841 ti->error = "Invalid iv_offset sector"; 866 ti->error = "Invalid iv_offset sector";
842 goto bad5; 867 goto bad_device;
843 } 868 }
844 cc->iv_offset = tmpll; 869 cc->iv_offset = tmpll;
845 870
846 if (sscanf(argv[4], "%llu", &tmpll) != 1) { 871 if (sscanf(argv[4], "%llu", &tmpll) != 1) {
847 ti->error = "Invalid device sector"; 872 ti->error = "Invalid device sector";
848 goto bad5; 873 goto bad_device;
849 } 874 }
850 cc->start = tmpll; 875 cc->start = tmpll;
851 876
852 if (dm_get_device(ti, argv[3], cc->start, ti->len, 877 if (dm_get_device(ti, argv[3], cc->start, ti->len,
853 dm_table_get_mode(ti->table), &cc->dev)) { 878 dm_table_get_mode(ti->table), &cc->dev)) {
854 ti->error = "Device lookup failed"; 879 ti->error = "Device lookup failed";
855 goto bad5; 880 goto bad_device;
856 } 881 }
857 882
858 if (ivmode && cc->iv_gen_ops) { 883 if (ivmode && cc->iv_gen_ops) {
@@ -861,27 +886,45 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
861 cc->iv_mode = kmalloc(strlen(ivmode) + 1, GFP_KERNEL); 886 cc->iv_mode = kmalloc(strlen(ivmode) + 1, GFP_KERNEL);
862 if (!cc->iv_mode) { 887 if (!cc->iv_mode) {
863 ti->error = "Error kmallocing iv_mode string"; 888 ti->error = "Error kmallocing iv_mode string";
864 goto bad5; 889 goto bad_ivmode_string;
865 } 890 }
866 strcpy(cc->iv_mode, ivmode); 891 strcpy(cc->iv_mode, ivmode);
867 } else 892 } else
868 cc->iv_mode = NULL; 893 cc->iv_mode = NULL;
869 894
895 cc->io_queue = create_singlethread_workqueue("kcryptd_io");
896 if (!cc->io_queue) {
897 ti->error = "Couldn't create kcryptd io queue";
898 goto bad_io_queue;
899 }
900
901 cc->crypt_queue = create_singlethread_workqueue("kcryptd");
902 if (!cc->crypt_queue) {
903 ti->error = "Couldn't create kcryptd queue";
904 goto bad_crypt_queue;
905 }
906
870 ti->private = cc; 907 ti->private = cc;
871 return 0; 908 return 0;
872 909
873bad5: 910bad_crypt_queue:
911 destroy_workqueue(cc->io_queue);
912bad_io_queue:
913 kfree(cc->iv_mode);
914bad_ivmode_string:
915 dm_put_device(ti, cc->dev);
916bad_device:
874 bioset_free(cc->bs); 917 bioset_free(cc->bs);
875bad_bs: 918bad_bs:
876 mempool_destroy(cc->page_pool); 919 mempool_destroy(cc->page_pool);
877bad4: 920bad_page_pool:
878 mempool_destroy(cc->io_pool); 921 mempool_destroy(cc->io_pool);
879bad3: 922bad_slab_pool:
880 if (cc->iv_gen_ops && cc->iv_gen_ops->dtr) 923 if (cc->iv_gen_ops && cc->iv_gen_ops->dtr)
881 cc->iv_gen_ops->dtr(cc); 924 cc->iv_gen_ops->dtr(cc);
882bad2: 925bad_ivmode:
883 crypto_free_blkcipher(tfm); 926 crypto_free_blkcipher(tfm);
884bad1: 927bad_cipher:
885 /* Must zero key material before freeing */ 928 /* Must zero key material before freeing */
886 memset(cc, 0, sizeof(*cc) + cc->key_size * sizeof(u8)); 929 memset(cc, 0, sizeof(*cc) + cc->key_size * sizeof(u8));
887 kfree(cc); 930 kfree(cc);
@@ -892,7 +935,8 @@ static void crypt_dtr(struct dm_target *ti)
892{ 935{
893 struct crypt_config *cc = (struct crypt_config *) ti->private; 936 struct crypt_config *cc = (struct crypt_config *) ti->private;
894 937
895 flush_workqueue(_kcryptd_workqueue); 938 destroy_workqueue(cc->io_queue);
939 destroy_workqueue(cc->crypt_queue);
896 940
897 bioset_free(cc->bs); 941 bioset_free(cc->bs);
898 mempool_destroy(cc->page_pool); 942 mempool_destroy(cc->page_pool);
@@ -918,9 +962,13 @@ static int crypt_map(struct dm_target *ti, struct bio *bio,
918 io = mempool_alloc(cc->io_pool, GFP_NOIO); 962 io = mempool_alloc(cc->io_pool, GFP_NOIO);
919 io->target = ti; 963 io->target = ti;
920 io->base_bio = bio; 964 io->base_bio = bio;
921 io->error = io->post_process = 0; 965 io->error = 0;
922 atomic_set(&io->pending, 0); 966 atomic_set(&io->pending, 0);
923 kcryptd_queue_io(io); 967
968 if (bio_data_dir(io->base_bio) == READ)
969 kcryptd_queue_io(io);
970 else
971 kcryptd_queue_crypt(io);
924 972
925 return DM_MAPIO_SUBMITTED; 973 return DM_MAPIO_SUBMITTED;
926} 974}
@@ -1037,25 +1085,12 @@ static int __init dm_crypt_init(void)
1037 if (!_crypt_io_pool) 1085 if (!_crypt_io_pool)
1038 return -ENOMEM; 1086 return -ENOMEM;
1039 1087
1040 _kcryptd_workqueue = create_workqueue("kcryptd");
1041 if (!_kcryptd_workqueue) {
1042 r = -ENOMEM;
1043 DMERR("couldn't create kcryptd");
1044 goto bad1;
1045 }
1046
1047 r = dm_register_target(&crypt_target); 1088 r = dm_register_target(&crypt_target);
1048 if (r < 0) { 1089 if (r < 0) {
1049 DMERR("register failed %d", r); 1090 DMERR("register failed %d", r);
1050 goto bad2; 1091 kmem_cache_destroy(_crypt_io_pool);
1051 } 1092 }
1052 1093
1053 return 0;
1054
1055bad2:
1056 destroy_workqueue(_kcryptd_workqueue);
1057bad1:
1058 kmem_cache_destroy(_crypt_io_pool);
1059 return r; 1094 return r;
1060} 1095}
1061 1096
@@ -1066,7 +1101,6 @@ static void __exit dm_crypt_exit(void)
1066 if (r < 0) 1101 if (r < 0)
1067 DMERR("unregister failed %d", r); 1102 DMERR("unregister failed %d", r);
1068 1103
1069 destroy_workqueue(_kcryptd_workqueue);
1070 kmem_cache_destroy(_crypt_io_pool); 1104 kmem_cache_destroy(_crypt_io_pool);
1071} 1105}
1072 1106
diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c
index 6928c136d3c..bdd37f881c4 100644
--- a/drivers/md/dm-delay.c
+++ b/drivers/md/dm-delay.c
@@ -83,7 +83,7 @@ static struct bio *flush_delayed_bios(struct delay_c *dc, int flush_all)
83 struct dm_delay_info *delayed, *next; 83 struct dm_delay_info *delayed, *next;
84 unsigned long next_expires = 0; 84 unsigned long next_expires = 0;
85 int start_timer = 0; 85 int start_timer = 0;
86 BIO_LIST(flush_bios); 86 struct bio_list flush_bios = { };
87 87
88 mutex_lock(&delayed_bios_lock); 88 mutex_lock(&delayed_bios_lock);
89 list_for_each_entry_safe(delayed, next, &dc->delayed_bios, list) { 89 list_for_each_entry_safe(delayed, next, &dc->delayed_bios, list) {
@@ -163,34 +163,32 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)
163 goto bad; 163 goto bad;
164 } 164 }
165 165
166 if (argc == 3) { 166 dc->dev_write = NULL;
167 dc->dev_write = NULL; 167 if (argc == 3)
168 goto out; 168 goto out;
169 }
170 169
171 if (sscanf(argv[4], "%llu", &tmpll) != 1) { 170 if (sscanf(argv[4], "%llu", &tmpll) != 1) {
172 ti->error = "Invalid write device sector"; 171 ti->error = "Invalid write device sector";
173 goto bad; 172 goto bad_dev_read;
174 } 173 }
175 dc->start_write = tmpll; 174 dc->start_write = tmpll;
176 175
177 if (sscanf(argv[5], "%u", &dc->write_delay) != 1) { 176 if (sscanf(argv[5], "%u", &dc->write_delay) != 1) {
178 ti->error = "Invalid write delay"; 177 ti->error = "Invalid write delay";
179 goto bad; 178 goto bad_dev_read;
180 } 179 }
181 180
182 if (dm_get_device(ti, argv[3], dc->start_write, ti->len, 181 if (dm_get_device(ti, argv[3], dc->start_write, ti->len,
183 dm_table_get_mode(ti->table), &dc->dev_write)) { 182 dm_table_get_mode(ti->table), &dc->dev_write)) {
184 ti->error = "Write device lookup failed"; 183 ti->error = "Write device lookup failed";
185 dm_put_device(ti, dc->dev_read); 184 goto bad_dev_read;
186 goto bad;
187 } 185 }
188 186
189out: 187out:
190 dc->delayed_pool = mempool_create_slab_pool(128, delayed_cache); 188 dc->delayed_pool = mempool_create_slab_pool(128, delayed_cache);
191 if (!dc->delayed_pool) { 189 if (!dc->delayed_pool) {
192 DMERR("Couldn't create delayed bio pool."); 190 DMERR("Couldn't create delayed bio pool.");
193 goto bad; 191 goto bad_dev_write;
194 } 192 }
195 193
196 setup_timer(&dc->delay_timer, handle_delayed_timer, (unsigned long)dc); 194 setup_timer(&dc->delay_timer, handle_delayed_timer, (unsigned long)dc);
@@ -203,6 +201,11 @@ out:
203 ti->private = dc; 201 ti->private = dc;
204 return 0; 202 return 0;
205 203
204bad_dev_write:
205 if (dc->dev_write)
206 dm_put_device(ti, dc->dev_write);
207bad_dev_read:
208 dm_put_device(ti, dc->dev_read);
206bad: 209bad:
207 kfree(dc); 210 kfree(dc);
208 return -EINVAL; 211 return -EINVAL;
@@ -305,7 +308,7 @@ static int delay_status(struct dm_target *ti, status_type_t type,
305 (unsigned long long) dc->start_read, 308 (unsigned long long) dc->start_read,
306 dc->read_delay); 309 dc->read_delay);
307 if (dc->dev_write) 310 if (dc->dev_write)
308 DMEMIT("%s %llu %u", dc->dev_write->name, 311 DMEMIT(" %s %llu %u", dc->dev_write->name,
309 (unsigned long long) dc->start_write, 312 (unsigned long long) dc->start_write,
310 dc->write_delay); 313 dc->write_delay);
311 break; 314 break;
diff --git a/drivers/md/dm-emc.c b/drivers/md/dm-emc.c
index 342517261ec..6b91b9ab1d4 100644
--- a/drivers/md/dm-emc.c
+++ b/drivers/md/dm-emc.c
@@ -81,7 +81,7 @@ static struct bio *get_failover_bio(struct dm_path *path, unsigned data_size)
81 } 81 }
82 82
83 if (bio_add_page(bio, page, data_size, 0) != data_size) { 83 if (bio_add_page(bio, page, data_size, 0) != data_size) {
84 DMERR("get_failover_bio: alloc_page() failed."); 84 DMERR("get_failover_bio: bio_add_page() failed.");
85 __free_page(page); 85 __free_page(page);
86 bio_put(bio); 86 bio_put(bio);
87 return NULL; 87 return NULL;
@@ -211,12 +211,10 @@ fail_path:
211 211
212static struct emc_handler *alloc_emc_handler(void) 212static struct emc_handler *alloc_emc_handler(void)
213{ 213{
214 struct emc_handler *h = kmalloc(sizeof(*h), GFP_KERNEL); 214 struct emc_handler *h = kzalloc(sizeof(*h), GFP_KERNEL);
215 215
216 if (h) { 216 if (h)
217 memset(h, 0, sizeof(*h));
218 spin_lock_init(&h->lock); 217 spin_lock_init(&h->lock);
219 }
220 218
221 return h; 219 return h;
222} 220}
diff --git a/drivers/md/dm-hw-handler.c b/drivers/md/dm-hw-handler.c
index baafaaba4d4..2ee84d8aa0b 100644
--- a/drivers/md/dm-hw-handler.c
+++ b/drivers/md/dm-hw-handler.c
@@ -91,12 +91,10 @@ void dm_put_hw_handler(struct hw_handler_type *hwht)
91 91
92static struct hwh_internal *_alloc_hw_handler(struct hw_handler_type *hwht) 92static struct hwh_internal *_alloc_hw_handler(struct hw_handler_type *hwht)
93{ 93{
94 struct hwh_internal *hwhi = kmalloc(sizeof(*hwhi), GFP_KERNEL); 94 struct hwh_internal *hwhi = kzalloc(sizeof(*hwhi), GFP_KERNEL);
95 95
96 if (hwhi) { 96 if (hwhi)
97 memset(hwhi, 0, sizeof(*hwhi));
98 hwhi->hwht = *hwht; 97 hwhi->hwht = *hwht;
99 }
100 98
101 return hwhi; 99 return hwhi;
102} 100}
diff --git a/drivers/md/dm-hw-handler.h b/drivers/md/dm-hw-handler.h
index e0832e6fcf3..46809dcb121 100644
--- a/drivers/md/dm-hw-handler.h
+++ b/drivers/md/dm-hw-handler.h
@@ -58,5 +58,6 @@ unsigned dm_scsi_err_handler(struct hw_handler *hwh, struct bio *bio);
58#define MP_FAIL_PATH 1 58#define MP_FAIL_PATH 1
59#define MP_BYPASS_PG 2 59#define MP_BYPASS_PG 2
60#define MP_ERROR_IO 4 /* Don't retry this I/O */ 60#define MP_ERROR_IO 4 /* Don't retry this I/O */
61#define MP_RETRY 8
61 62
62#endif 63#endif
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index b441d82c338..138200bf5e0 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -700,7 +700,7 @@ static int dev_rename(struct dm_ioctl *param, size_t param_size)
700 int r; 700 int r;
701 char *new_name = (char *) param + param->data_start; 701 char *new_name = (char *) param + param->data_start;
702 702
703 if (new_name < (char *) (param + 1) || 703 if (new_name < (char *) param->data ||
704 invalid_str(new_name, (void *) param + param_size)) { 704 invalid_str(new_name, (void *) param + param_size)) {
705 DMWARN("Invalid new logical volume name supplied."); 705 DMWARN("Invalid new logical volume name supplied.");
706 return -EINVAL; 706 return -EINVAL;
@@ -726,7 +726,7 @@ static int dev_set_geometry(struct dm_ioctl *param, size_t param_size)
726 if (!md) 726 if (!md)
727 return -ENXIO; 727 return -ENXIO;
728 728
729 if (geostr < (char *) (param + 1) || 729 if (geostr < (char *) param->data ||
730 invalid_str(geostr, (void *) param + param_size)) { 730 invalid_str(geostr, (void *) param + param_size)) {
731 DMWARN("Invalid geometry supplied."); 731 DMWARN("Invalid geometry supplied.");
732 goto out; 732 goto out;
@@ -1233,7 +1233,7 @@ static int target_message(struct dm_ioctl *param, size_t param_size)
1233 if (r) 1233 if (r)
1234 goto out; 1234 goto out;
1235 1235
1236 if (tmsg < (struct dm_target_msg *) (param + 1) || 1236 if (tmsg < (struct dm_target_msg *) param->data ||
1237 invalid_str(tmsg->message, (void *) param + param_size)) { 1237 invalid_str(tmsg->message, (void *) param + param_size)) {
1238 DMWARN("Invalid target message parameters."); 1238 DMWARN("Invalid target message parameters.");
1239 r = -EINVAL; 1239 r = -EINVAL;
@@ -1358,7 +1358,7 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl **param)
1358 if (tmp.data_size < sizeof(tmp)) 1358 if (tmp.data_size < sizeof(tmp))
1359 return -EINVAL; 1359 return -EINVAL;
1360 1360
1361 dmi = (struct dm_ioctl *) vmalloc(tmp.data_size); 1361 dmi = vmalloc(tmp.data_size);
1362 if (!dmi) 1362 if (!dmi)
1363 return -ENOMEM; 1363 return -ENOMEM;
1364 1364
@@ -1515,3 +1515,35 @@ void dm_interface_exit(void)
1515 1515
1516 dm_hash_exit(); 1516 dm_hash_exit();
1517} 1517}
1518
1519/**
1520 * dm_copy_name_and_uuid - Copy mapped device name & uuid into supplied buffers
1521 * @md: Pointer to mapped_device
1522 * @name: Buffer (size DM_NAME_LEN) for name
1523 * @uuid: Buffer (size DM_UUID_LEN) for uuid or empty string if uuid not defined
1524 */
1525int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid)
1526{
1527 int r = 0;
1528 struct hash_cell *hc;
1529
1530 if (!md)
1531 return -ENXIO;
1532
1533 dm_get(md);
1534 down_read(&_hash_lock);
1535 hc = dm_get_mdptr(md);
1536 if (!hc || hc->md != md) {
1537 r = -ENXIO;
1538 goto out;
1539 }
1540
1541 strcpy(name, hc->name);
1542 strcpy(uuid, hc->uuid ? : "");
1543
1544out:
1545 up_read(&_hash_lock);
1546 dm_put(md);
1547
1548 return r;
1549}
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index a66428d860f..072ee4353ea 100644
--- a/drivers/md/dm-log.c
+++ b/drivers/md/dm-log.c
@@ -696,7 +696,7 @@ static struct dirty_log_type _disk_type = {
696 .module = THIS_MODULE, 696 .module = THIS_MODULE,
697 .ctr = disk_ctr, 697 .ctr = disk_ctr,
698 .dtr = disk_dtr, 698 .dtr = disk_dtr,
699 .suspend = disk_flush, 699 .postsuspend = disk_flush,
700 .resume = disk_resume, 700 .resume = disk_resume,
701 .get_region_size = core_get_region_size, 701 .get_region_size = core_get_region_size,
702 .is_clean = core_is_clean, 702 .is_clean = core_is_clean,
diff --git a/drivers/md/dm-log.h b/drivers/md/dm-log.h
index 86a301c8daf..3fae87eb596 100644
--- a/drivers/md/dm-log.h
+++ b/drivers/md/dm-log.h
@@ -32,7 +32,8 @@ struct dirty_log_type {
32 * There are times when we don't want the log to touch 32 * There are times when we don't want the log to touch
33 * the disk. 33 * the disk.
34 */ 34 */
35 int (*suspend)(struct dirty_log *log); 35 int (*presuspend)(struct dirty_log *log);
36 int (*postsuspend)(struct dirty_log *log);
36 int (*resume)(struct dirty_log *log); 37 int (*resume)(struct dirty_log *log);
37 38
38 /* 39 /*
diff --git a/drivers/md/dm-mpath-hp-sw.c b/drivers/md/dm-mpath-hp-sw.c
new file mode 100644
index 00000000000..204bf42c944
--- /dev/null
+++ b/drivers/md/dm-mpath-hp-sw.c
@@ -0,0 +1,248 @@
1/*
2 * Copyright (C) 2005 Mike Christie, All rights reserved.
3 * Copyright (C) 2007 Red Hat, Inc. All rights reserved.
4 * Authors: Mike Christie
5 * Dave Wysochanski
6 *
7 * This file is released under the GPL.
8 *
9 * This module implements the specific path activation code for
10 * HP StorageWorks and FSC FibreCat Asymmetric (Active/Passive)
11 * storage arrays.
12 * These storage arrays have controller-based failover, not
13 * LUN-based failover. However, LUN-based failover is the design
14 * of dm-multipath. Thus, this module is written for LUN-based failover.
15 */
16#include <linux/blkdev.h>
17#include <linux/list.h>
18#include <linux/types.h>
19#include <scsi/scsi.h>
20#include <scsi/scsi_cmnd.h>
21#include <scsi/scsi_dbg.h>
22
23#include "dm.h"
24#include "dm-hw-handler.h"
25
26#define DM_MSG_PREFIX "multipath hp-sw"
27#define DM_HP_HWH_NAME "hp-sw"
28#define DM_HP_HWH_VER "1.0.0"
29
30struct hp_sw_context {
31 unsigned char sense[SCSI_SENSE_BUFFERSIZE];
32};
33
34/*
35 * hp_sw_error_is_retryable - Is an HP-specific check condition retryable?
36 * @req: path activation request
37 *
38 * Examine error codes of request and determine whether the error is retryable.
39 * Some error codes are already retried by scsi-ml (see
40 * scsi_decide_disposition), but some HP specific codes are not.
41 * The intent of this routine is to supply the logic for the HP specific
42 * check conditions.
43 *
44 * Returns:
45 * 1 - command completed with retryable error
46 * 0 - command completed with non-retryable error
47 *
48 * Possible optimizations
49 * 1. More hardware-specific error codes
50 */
51static int hp_sw_error_is_retryable(struct request *req)
52{
53 /*
54 * NOT_READY is known to be retryable
55 * For now we just dump out the sense data and call it retryable
56 */
57 if (status_byte(req->errors) == CHECK_CONDITION)
58 __scsi_print_sense(DM_HP_HWH_NAME, req->sense, req->sense_len);
59
60 /*
61 * At this point we don't have complete information about all the error
62 * codes from this hardware, so we are just conservative and retry
63 * when in doubt.
64 */
65 return 1;
66}
67
68/*
69 * hp_sw_end_io - Completion handler for HP path activation.
70 * @req: path activation request
71 * @error: scsi-ml error
72 *
73 * Check sense data, free request structure, and notify dm that
74 * pg initialization has completed.
75 *
76 * Context: scsi-ml softirq
77 *
78 */
79static void hp_sw_end_io(struct request *req, int error)
80{
81 struct dm_path *path = req->end_io_data;
82 unsigned err_flags = 0;
83
84 if (!error) {
85 DMDEBUG("%s path activation command - success",
86 path->dev->name);
87 goto out;
88 }
89
90 if (hp_sw_error_is_retryable(req)) {
91 DMDEBUG("%s path activation command - retry",
92 path->dev->name);
93 err_flags = MP_RETRY;
94 goto out;
95 }
96
97 DMWARN("%s path activation fail - error=0x%x",
98 path->dev->name, error);
99 err_flags = MP_FAIL_PATH;
100
101out:
102 req->end_io_data = NULL;
103 __blk_put_request(req->q, req);
104 dm_pg_init_complete(path, err_flags);
105}
106
107/*
108 * hp_sw_get_request - Allocate an HP specific path activation request
109 * @path: path on which request will be sent (needed for request queue)
110 *
111 * The START command is used for path activation request.
112 * These arrays are controller-based failover, not LUN based.
113 * One START command issued to a single path will fail over all
114 * LUNs for the same controller.
115 *
116 * Possible optimizations
117 * 1. Make timeout configurable
118 * 2. Preallocate request
119 */
120static struct request *hp_sw_get_request(struct dm_path *path)
121{
122 struct request *req;
123 struct block_device *bdev = path->dev->bdev;
124 struct request_queue *q = bdev_get_queue(bdev);
125 struct hp_sw_context *h = path->hwhcontext;
126
127 req = blk_get_request(q, WRITE, GFP_NOIO);
128 if (!req)
129 goto out;
130
131 req->timeout = 60 * HZ;
132
133 req->errors = 0;
134 req->cmd_type = REQ_TYPE_BLOCK_PC;
135 req->cmd_flags |= REQ_FAILFAST | REQ_NOMERGE;
136 req->end_io_data = path;
137 req->sense = h->sense;
138 memset(req->sense, 0, SCSI_SENSE_BUFFERSIZE);
139
140 memset(&req->cmd, 0, BLK_MAX_CDB);
141 req->cmd[0] = START_STOP;
142 req->cmd[4] = 1;
143 req->cmd_len = COMMAND_SIZE(req->cmd[0]);
144
145out:
146 return req;
147}
148
149/*
150 * hp_sw_pg_init - HP path activation implementation.
151 * @hwh: hardware handler specific data
152 * @bypassed: unused; is the path group bypassed? (see dm-mpath.c)
153 * @path: path to send initialization command
154 *
155 * Send an HP-specific path activation command on 'path'.
156 * Do not try to optimize in any way, just send the activation command.
157 * More than one path activation command may be sent to the same controller.
158 * This seems to work fine for basic failover support.
159 *
160 * Possible optimizations
161 * 1. Detect an in-progress activation request and avoid submitting another one
162 * 2. Model the controller and only send a single activation request at a time
163 * 3. Determine the state of a path before sending an activation request
164 *
165 * Context: kmpathd (see process_queued_ios() in dm-mpath.c)
166 */
167static void hp_sw_pg_init(struct hw_handler *hwh, unsigned bypassed,
168 struct dm_path *path)
169{
170 struct request *req;
171 struct hp_sw_context *h;
172
173 path->hwhcontext = hwh->context;
174 h = hwh->context;
175
176 req = hp_sw_get_request(path);
177 if (!req) {
178 DMERR("%s path activation command - allocation fail",
179 path->dev->name);
180 goto retry;
181 }
182
183 DMDEBUG("%s path activation command - sent", path->dev->name);
184
185 blk_execute_rq_nowait(req->q, NULL, req, 1, hp_sw_end_io);
186 return;
187
188retry:
189 dm_pg_init_complete(path, MP_RETRY);
190}
191
192static int hp_sw_create(struct hw_handler *hwh, unsigned argc, char **argv)
193{
194 struct hp_sw_context *h;
195
196 h = kmalloc(sizeof(*h), GFP_KERNEL);
197 if (!h)
198 return -ENOMEM;
199
200 hwh->context = h;
201
202 return 0;
203}
204
205static void hp_sw_destroy(struct hw_handler *hwh)
206{
207 struct hp_sw_context *h = hwh->context;
208
209 kfree(h);
210}
211
212static struct hw_handler_type hp_sw_hwh = {
213 .name = DM_HP_HWH_NAME,
214 .module = THIS_MODULE,
215 .create = hp_sw_create,
216 .destroy = hp_sw_destroy,
217 .pg_init = hp_sw_pg_init,
218};
219
220static int __init hp_sw_init(void)
221{
222 int r;
223
224 r = dm_register_hw_handler(&hp_sw_hwh);
225 if (r < 0)
226 DMERR("register failed %d", r);
227 else
228 DMINFO("version " DM_HP_HWH_VER " loaded");
229
230 return r;
231}
232
233static void __exit hp_sw_exit(void)
234{
235 int r;
236
237 r = dm_unregister_hw_handler(&hp_sw_hwh);
238 if (r < 0)
239 DMERR("unregister failed %d", r);
240}
241
242module_init(hp_sw_init);
243module_exit(hp_sw_exit);
244
245MODULE_DESCRIPTION("DM Multipath HP StorageWorks / FSC FibreCat (A/P) support");
246MODULE_AUTHOR("Mike Christie, Dave Wysochanski <dm-devel@redhat.com>");
247MODULE_LICENSE("GPL");
248MODULE_VERSION(DM_HP_HWH_VER);
diff --git a/drivers/md/dm-mpath-rdac.c b/drivers/md/dm-mpath-rdac.c
index 16b16134577..e04eb5c697f 100644
--- a/drivers/md/dm-mpath-rdac.c
+++ b/drivers/md/dm-mpath-rdac.c
@@ -664,20 +664,21 @@ static struct hw_handler_type rdac_handler = {
664 664
665static int __init rdac_init(void) 665static int __init rdac_init(void)
666{ 666{
667 int r = dm_register_hw_handler(&rdac_handler); 667 int r;
668
669 if (r < 0) {
670 DMERR("%s: register failed %d", RDAC_DM_HWH_NAME, r);
671 return r;
672 }
673 668
674 rdac_wkqd = create_singlethread_workqueue("rdac_wkqd"); 669 rdac_wkqd = create_singlethread_workqueue("rdac_wkqd");
675 if (!rdac_wkqd) { 670 if (!rdac_wkqd) {
676 DMERR("Failed to create workqueue rdac_wkqd."); 671 DMERR("Failed to create workqueue rdac_wkqd.");
677 dm_unregister_hw_handler(&rdac_handler);
678 return -ENOMEM; 672 return -ENOMEM;
679 } 673 }
680 674
675 r = dm_register_hw_handler(&rdac_handler);
676 if (r < 0) {
677 DMERR("%s: register failed %d", RDAC_DM_HWH_NAME, r);
678 destroy_workqueue(rdac_wkqd);
679 return r;
680 }
681
681 DMINFO("%s: version %s loaded", RDAC_DM_HWH_NAME, RDAC_DM_HWH_VER); 682 DMINFO("%s: version %s loaded", RDAC_DM_HWH_NAME, RDAC_DM_HWH_VER);
682 return 0; 683 return 0;
683} 684}
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 31056abca89..24b2b1e32fa 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -10,6 +10,7 @@
10#include "dm-hw-handler.h" 10#include "dm-hw-handler.h"
11#include "dm-bio-list.h" 11#include "dm-bio-list.h"
12#include "dm-bio-record.h" 12#include "dm-bio-record.h"
13#include "dm-uevent.h"
13 14
14#include <linux/ctype.h> 15#include <linux/ctype.h>
15#include <linux/init.h> 16#include <linux/init.h>
@@ -75,6 +76,8 @@ struct multipath {
75 unsigned queue_io; /* Must we queue all I/O? */ 76 unsigned queue_io; /* Must we queue all I/O? */
76 unsigned queue_if_no_path; /* Queue I/O if last path fails? */ 77 unsigned queue_if_no_path; /* Queue I/O if last path fails? */
77 unsigned saved_queue_if_no_path;/* Saved state during suspension */ 78 unsigned saved_queue_if_no_path;/* Saved state during suspension */
79 unsigned pg_init_retries; /* Number of times to retry pg_init */
80 unsigned pg_init_count; /* Number of times pg_init called */
78 81
79 struct work_struct process_queued_ios; 82 struct work_struct process_queued_ios;
80 struct bio_list queued_ios; 83 struct bio_list queued_ios;
@@ -225,6 +228,8 @@ static void __switch_pg(struct multipath *m, struct pgpath *pgpath)
225 m->pg_init_required = 0; 228 m->pg_init_required = 0;
226 m->queue_io = 0; 229 m->queue_io = 0;
227 } 230 }
231
232 m->pg_init_count = 0;
228} 233}
229 234
230static int __choose_path_in_pg(struct multipath *m, struct priority_group *pg) 235static int __choose_path_in_pg(struct multipath *m, struct priority_group *pg)
@@ -424,6 +429,7 @@ static void process_queued_ios(struct work_struct *work)
424 must_queue = 0; 429 must_queue = 0;
425 430
426 if (m->pg_init_required && !m->pg_init_in_progress) { 431 if (m->pg_init_required && !m->pg_init_in_progress) {
432 m->pg_init_count++;
427 m->pg_init_required = 0; 433 m->pg_init_required = 0;
428 m->pg_init_in_progress = 1; 434 m->pg_init_in_progress = 1;
429 init_required = 1; 435 init_required = 1;
@@ -689,9 +695,11 @@ static int parse_features(struct arg_set *as, struct multipath *m)
689 int r; 695 int r;
690 unsigned argc; 696 unsigned argc;
691 struct dm_target *ti = m->ti; 697 struct dm_target *ti = m->ti;
698 const char *param_name;
692 699
693 static struct param _params[] = { 700 static struct param _params[] = {
694 {0, 1, "invalid number of feature args"}, 701 {0, 3, "invalid number of feature args"},
702 {1, 50, "pg_init_retries must be between 1 and 50"},
695 }; 703 };
696 704
697 r = read_param(_params, shift(as), &argc, &ti->error); 705 r = read_param(_params, shift(as), &argc, &ti->error);
@@ -701,12 +709,28 @@ static int parse_features(struct arg_set *as, struct multipath *m)
701 if (!argc) 709 if (!argc)
702 return 0; 710 return 0;
703 711
704 if (!strnicmp(shift(as), MESG_STR("queue_if_no_path"))) 712 do {
705 return queue_if_no_path(m, 1, 0); 713 param_name = shift(as);
706 else { 714 argc--;
715
716 if (!strnicmp(param_name, MESG_STR("queue_if_no_path"))) {
717 r = queue_if_no_path(m, 1, 0);
718 continue;
719 }
720
721 if (!strnicmp(param_name, MESG_STR("pg_init_retries")) &&
722 (argc >= 1)) {
723 r = read_param(_params + 1, shift(as),
724 &m->pg_init_retries, &ti->error);
725 argc--;
726 continue;
727 }
728
707 ti->error = "Unrecognised multipath feature request"; 729 ti->error = "Unrecognised multipath feature request";
708 return -EINVAL; 730 r = -EINVAL;
709 } 731 } while (argc && !r);
732
733 return r;
710} 734}
711 735
712static int multipath_ctr(struct dm_target *ti, unsigned int argc, 736static int multipath_ctr(struct dm_target *ti, unsigned int argc,
@@ -834,6 +858,9 @@ static int fail_path(struct pgpath *pgpath)
834 if (pgpath == m->current_pgpath) 858 if (pgpath == m->current_pgpath)
835 m->current_pgpath = NULL; 859 m->current_pgpath = NULL;
836 860
861 dm_path_uevent(DM_UEVENT_PATH_FAILED, m->ti,
862 pgpath->path.dev->name, m->nr_valid_paths);
863
837 queue_work(kmultipathd, &m->trigger_event); 864 queue_work(kmultipathd, &m->trigger_event);
838 865
839out: 866out:
@@ -873,6 +900,9 @@ static int reinstate_path(struct pgpath *pgpath)
873 if (!m->nr_valid_paths++ && m->queue_size) 900 if (!m->nr_valid_paths++ && m->queue_size)
874 queue_work(kmultipathd, &m->process_queued_ios); 901 queue_work(kmultipathd, &m->process_queued_ios);
875 902
903 dm_path_uevent(DM_UEVENT_PATH_REINSTATED, m->ti,
904 pgpath->path.dev->name, m->nr_valid_paths);
905
876 queue_work(kmultipathd, &m->trigger_event); 906 queue_work(kmultipathd, &m->trigger_event);
877 907
878out: 908out:
@@ -976,6 +1006,26 @@ static int bypass_pg_num(struct multipath *m, const char *pgstr, int bypassed)
976} 1006}
977 1007
978/* 1008/*
1009 * Should we retry pg_init immediately?
1010 */
1011static int pg_init_limit_reached(struct multipath *m, struct pgpath *pgpath)
1012{
1013 unsigned long flags;
1014 int limit_reached = 0;
1015
1016 spin_lock_irqsave(&m->lock, flags);
1017
1018 if (m->pg_init_count <= m->pg_init_retries)
1019 m->pg_init_required = 1;
1020 else
1021 limit_reached = 1;
1022
1023 spin_unlock_irqrestore(&m->lock, flags);
1024
1025 return limit_reached;
1026}
1027
1028/*
979 * pg_init must call this when it has completed its initialisation 1029 * pg_init must call this when it has completed its initialisation
980 */ 1030 */
981void dm_pg_init_complete(struct dm_path *path, unsigned err_flags) 1031void dm_pg_init_complete(struct dm_path *path, unsigned err_flags)
@@ -985,8 +1035,14 @@ void dm_pg_init_complete(struct dm_path *path, unsigned err_flags)
985 struct multipath *m = pg->m; 1035 struct multipath *m = pg->m;
986 unsigned long flags; 1036 unsigned long flags;
987 1037
988 /* We insist on failing the path if the PG is already bypassed. */ 1038 /*
989 if (err_flags && pg->bypassed) 1039 * If requested, retry pg_init until maximum number of retries exceeded.
1040 * If retry not requested and PG already bypassed, always fail the path.
1041 */
1042 if (err_flags & MP_RETRY) {
1043 if (pg_init_limit_reached(m, pgpath))
1044 err_flags |= MP_FAIL_PATH;
1045 } else if (err_flags && pg->bypassed)
990 err_flags |= MP_FAIL_PATH; 1046 err_flags |= MP_FAIL_PATH;
991 1047
992 if (err_flags & MP_FAIL_PATH) 1048 if (err_flags & MP_FAIL_PATH)
@@ -996,7 +1052,7 @@ void dm_pg_init_complete(struct dm_path *path, unsigned err_flags)
996 bypass_pg(m, pg, 1); 1052 bypass_pg(m, pg, 1);
997 1053
998 spin_lock_irqsave(&m->lock, flags); 1054 spin_lock_irqsave(&m->lock, flags);
999 if (err_flags) { 1055 if (err_flags & ~MP_RETRY) {
1000 m->current_pgpath = NULL; 1056 m->current_pgpath = NULL;
1001 m->current_pg = NULL; 1057 m->current_pg = NULL;
1002 } else if (!m->pg_init_required) 1058 } else if (!m->pg_init_required)
@@ -1148,11 +1204,15 @@ static int multipath_status(struct dm_target *ti, status_type_t type,
1148 1204
1149 /* Features */ 1205 /* Features */
1150 if (type == STATUSTYPE_INFO) 1206 if (type == STATUSTYPE_INFO)
1151 DMEMIT("1 %u ", m->queue_size); 1207 DMEMIT("2 %u %u ", m->queue_size, m->pg_init_count);
1152 else if (m->queue_if_no_path) 1208 else {
1153 DMEMIT("1 queue_if_no_path "); 1209 DMEMIT("%u ", m->queue_if_no_path +
1154 else 1210 (m->pg_init_retries > 0) * 2);
1155 DMEMIT("0 "); 1211 if (m->queue_if_no_path)
1212 DMEMIT("queue_if_no_path ");
1213 if (m->pg_init_retries)
1214 DMEMIT("pg_init_retries %u ", m->pg_init_retries);
1215 }
1156 1216
1157 if (hwh->type && hwh->type->status) 1217 if (hwh->type && hwh->type->status)
1158 sz += hwh->type->status(hwh, type, result + sz, maxlen - sz); 1218 sz += hwh->type->status(hwh, type, result + sz, maxlen - sz);
diff --git a/drivers/md/dm-path-selector.c b/drivers/md/dm-path-selector.c
index f10a0c89b3f..ca1bb636a3e 100644
--- a/drivers/md/dm-path-selector.c
+++ b/drivers/md/dm-path-selector.c
@@ -94,12 +94,10 @@ out:
94 94
95static struct ps_internal *_alloc_path_selector(struct path_selector_type *pst) 95static struct ps_internal *_alloc_path_selector(struct path_selector_type *pst)
96{ 96{
97 struct ps_internal *psi = kmalloc(sizeof(*psi), GFP_KERNEL); 97 struct ps_internal *psi = kzalloc(sizeof(*psi), GFP_KERNEL);
98 98
99 if (psi) { 99 if (psi)
100 memset(psi, 0, sizeof(*psi));
101 psi->pst = *pst; 100 psi->pst = *pst;
102 }
103 101
104 return psi; 102 return psi;
105} 103}
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index d09ff15490a..31123d4a6b9 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -19,6 +19,7 @@
19#include <linux/time.h> 19#include <linux/time.h>
20#include <linux/vmalloc.h> 20#include <linux/vmalloc.h>
21#include <linux/workqueue.h> 21#include <linux/workqueue.h>
22#include <linux/log2.h>
22 23
23#define DM_MSG_PREFIX "raid1" 24#define DM_MSG_PREFIX "raid1"
24#define DM_IO_PAGES 64 25#define DM_IO_PAGES 64
@@ -113,6 +114,7 @@ struct region {
113 * Mirror set structures. 114 * Mirror set structures.
114 *---------------------------------------------------------------*/ 115 *---------------------------------------------------------------*/
115struct mirror { 116struct mirror {
117 struct mirror_set *ms;
116 atomic_t error_count; 118 atomic_t error_count;
117 struct dm_dev *dev; 119 struct dm_dev *dev;
118 sector_t offset; 120 sector_t offset;
@@ -974,6 +976,7 @@ static struct mirror_set *alloc_context(unsigned int nr_mirrors,
974 976
975 if (rh_init(&ms->rh, ms, dl, region_size, ms->nr_regions)) { 977 if (rh_init(&ms->rh, ms, dl, region_size, ms->nr_regions)) {
976 ti->error = "Error creating dirty region hash"; 978 ti->error = "Error creating dirty region hash";
979 dm_io_client_destroy(ms->io_client);
977 kfree(ms); 980 kfree(ms);
978 return NULL; 981 return NULL;
979 } 982 }
@@ -994,7 +997,7 @@ static void free_context(struct mirror_set *ms, struct dm_target *ti,
994 997
995static inline int _check_region_size(struct dm_target *ti, uint32_t size) 998static inline int _check_region_size(struct dm_target *ti, uint32_t size)
996{ 999{
997 return !(size % (PAGE_SIZE >> 9) || (size & (size - 1)) || 1000 return !(size % (PAGE_SIZE >> 9) || !is_power_of_2(size) ||
998 size > ti->len); 1001 size > ti->len);
999} 1002}
1000 1003
@@ -1015,6 +1018,7 @@ static int get_mirror(struct mirror_set *ms, struct dm_target *ti,
1015 return -ENXIO; 1018 return -ENXIO;
1016 } 1019 }
1017 1020
1021 ms->mirror[mirror].ms = ms;
1018 ms->mirror[mirror].offset = offset; 1022 ms->mirror[mirror].offset = offset;
1019 1023
1020 return 0; 1024 return 0;
@@ -1163,16 +1167,14 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
1163 ms->kmirrord_wq = create_singlethread_workqueue("kmirrord"); 1167 ms->kmirrord_wq = create_singlethread_workqueue("kmirrord");
1164 if (!ms->kmirrord_wq) { 1168 if (!ms->kmirrord_wq) {
1165 DMERR("couldn't start kmirrord"); 1169 DMERR("couldn't start kmirrord");
1166 free_context(ms, ti, m); 1170 r = -ENOMEM;
1167 return -ENOMEM; 1171 goto err_free_context;
1168 } 1172 }
1169 INIT_WORK(&ms->kmirrord_work, do_mirror); 1173 INIT_WORK(&ms->kmirrord_work, do_mirror);
1170 1174
1171 r = parse_features(ms, argc, argv, &args_used); 1175 r = parse_features(ms, argc, argv, &args_used);
1172 if (r) { 1176 if (r)
1173 free_context(ms, ti, ms->nr_mirrors); 1177 goto err_destroy_wq;
1174 return r;
1175 }
1176 1178
1177 argv += args_used; 1179 argv += args_used;
1178 argc -= args_used; 1180 argc -= args_used;
@@ -1188,19 +1190,22 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
1188 1190
1189 if (argc) { 1191 if (argc) {
1190 ti->error = "Too many mirror arguments"; 1192 ti->error = "Too many mirror arguments";
1191 free_context(ms, ti, ms->nr_mirrors); 1193 r = -EINVAL;
1192 return -EINVAL; 1194 goto err_destroy_wq;
1193 } 1195 }
1194 1196
1195 r = kcopyd_client_create(DM_IO_PAGES, &ms->kcopyd_client); 1197 r = kcopyd_client_create(DM_IO_PAGES, &ms->kcopyd_client);
1196 if (r) { 1198 if (r)
1197 destroy_workqueue(ms->kmirrord_wq); 1199 goto err_destroy_wq;
1198 free_context(ms, ti, ms->nr_mirrors);
1199 return r;
1200 }
1201 1200
1202 wake(ms); 1201 wake(ms);
1203 return 0; 1202 return 0;
1203
1204err_destroy_wq:
1205 destroy_workqueue(ms->kmirrord_wq);
1206err_free_context:
1207 free_context(ms, ti, ms->nr_mirrors);
1208 return r;
1204} 1209}
1205 1210
1206static void mirror_dtr(struct dm_target *ti) 1211static void mirror_dtr(struct dm_target *ti)
@@ -1302,7 +1307,7 @@ static void mirror_postsuspend(struct dm_target *ti)
1302 wait_event(_kmirrord_recovery_stopped, 1307 wait_event(_kmirrord_recovery_stopped,
1303 !atomic_read(&ms->rh.recovery_in_flight)); 1308 !atomic_read(&ms->rh.recovery_in_flight));
1304 1309
1305 if (log->type->suspend && log->type->suspend(log)) 1310 if (log->type->postsuspend && log->type->postsuspend(log))
1306 /* FIXME: need better error handling */ 1311 /* FIXME: need better error handling */
1307 DMWARN("log suspend failed"); 1312 DMWARN("log suspend failed");
1308} 1313}
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 98a633f3d6b..cee16fadd9e 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -17,6 +17,7 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
20#include <linux/log2.h>
20 21
21#include "dm-snap.h" 22#include "dm-snap.h"
22#include "dm-bio-list.h" 23#include "dm-bio-list.h"
@@ -415,7 +416,7 @@ static int set_chunk_size(struct dm_snapshot *s, const char *chunk_size_arg,
415 chunk_size = round_up(chunk_size, PAGE_SIZE >> 9); 416 chunk_size = round_up(chunk_size, PAGE_SIZE >> 9);
416 417
417 /* Check chunk_size is a power of 2 */ 418 /* Check chunk_size is a power of 2 */
418 if (chunk_size & (chunk_size - 1)) { 419 if (!is_power_of_2(chunk_size)) {
419 *error = "Chunk size is not a power of 2"; 420 *error = "Chunk size is not a power of 2";
420 return -EINVAL; 421 return -EINVAL;
421 } 422 }
diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
index 51f5e076001..969944a8aba 100644
--- a/drivers/md/dm-stripe.c
+++ b/drivers/md/dm-stripe.c
@@ -11,6 +11,7 @@
11#include <linux/blkdev.h> 11#include <linux/blkdev.h>
12#include <linux/bio.h> 12#include <linux/bio.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/log2.h>
14 15
15#define DM_MSG_PREFIX "striped" 16#define DM_MSG_PREFIX "striped"
16 17
@@ -99,7 +100,7 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
99 /* 100 /*
100 * chunk_size is a power of two 101 * chunk_size is a power of two
101 */ 102 */
102 if (!chunk_size || (chunk_size & (chunk_size - 1)) || 103 if (!is_power_of_2(chunk_size) ||
103 (chunk_size < (PAGE_SIZE >> SECTOR_SHIFT))) { 104 (chunk_size < (PAGE_SIZE >> SECTOR_SHIFT))) {
104 ti->error = "Invalid chunk size"; 105 ti->error = "Invalid chunk size";
105 return -EINVAL; 106 return -EINVAL;
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index fbe477bb2c6..8939e610508 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -213,12 +213,11 @@ static int alloc_targets(struct dm_table *t, unsigned int num)
213int dm_table_create(struct dm_table **result, int mode, 213int dm_table_create(struct dm_table **result, int mode,
214 unsigned num_targets, struct mapped_device *md) 214 unsigned num_targets, struct mapped_device *md)
215{ 215{
216 struct dm_table *t = kmalloc(sizeof(*t), GFP_KERNEL); 216 struct dm_table *t = kzalloc(sizeof(*t), GFP_KERNEL);
217 217
218 if (!t) 218 if (!t)
219 return -ENOMEM; 219 return -ENOMEM;
220 220
221 memset(t, 0, sizeof(*t));
222 INIT_LIST_HEAD(&t->devices); 221 INIT_LIST_HEAD(&t->devices);
223 atomic_set(&t->holders, 1); 222 atomic_set(&t->holders, 1);
224 223
diff --git a/drivers/md/dm-target.c b/drivers/md/dm-target.c
index 477a041a41c..835cf95b857 100644
--- a/drivers/md/dm-target.c
+++ b/drivers/md/dm-target.c
@@ -88,12 +88,10 @@ void dm_put_target_type(struct target_type *t)
88 88
89static struct tt_internal *alloc_target(struct target_type *t) 89static struct tt_internal *alloc_target(struct target_type *t)
90{ 90{
91 struct tt_internal *ti = kmalloc(sizeof(*ti), GFP_KERNEL); 91 struct tt_internal *ti = kzalloc(sizeof(*ti), GFP_KERNEL);
92 92
93 if (ti) { 93 if (ti)
94 memset(ti, 0, sizeof(*ti));
95 ti->tt = *t; 94 ti->tt = *t;
96 }
97 95
98 return ti; 96 return ti;
99} 97}
diff --git a/drivers/md/dm-uevent.c b/drivers/md/dm-uevent.c
new file mode 100644
index 00000000000..50377e5dc2a
--- /dev/null
+++ b/drivers/md/dm-uevent.c
@@ -0,0 +1,222 @@
1/*
2 * Device Mapper Uevent Support (dm-uevent)
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Copyright IBM Corporation, 2007
19 * Author: Mike Anderson <andmike@linux.vnet.ibm.com>
20 */
21#include <linux/list.h>
22#include <linux/slab.h>
23#include <linux/kobject.h>
24#include <linux/dm-ioctl.h>
25
26#include "dm.h"
27#include "dm-uevent.h"
28
29#define DM_MSG_PREFIX "uevent"
30
31static const struct {
32 enum dm_uevent_type type;
33 enum kobject_action action;
34 char *name;
35} _dm_uevent_type_names[] = {
36 {DM_UEVENT_PATH_FAILED, KOBJ_CHANGE, "PATH_FAILED"},
37 {DM_UEVENT_PATH_REINSTATED, KOBJ_CHANGE, "PATH_REINSTATED"},
38};
39
40static struct kmem_cache *_dm_event_cache;
41
42struct dm_uevent {
43 struct mapped_device *md;
44 enum kobject_action action;
45 struct kobj_uevent_env ku_env;
46 struct list_head elist;
47 char name[DM_NAME_LEN];
48 char uuid[DM_UUID_LEN];
49};
50
51static void dm_uevent_free(struct dm_uevent *event)
52{
53 kmem_cache_free(_dm_event_cache, event);
54}
55
56static struct dm_uevent *dm_uevent_alloc(struct mapped_device *md)
57{
58 struct dm_uevent *event;
59
60 event = kmem_cache_zalloc(_dm_event_cache, GFP_ATOMIC);
61 if (!event)
62 return NULL;
63
64 INIT_LIST_HEAD(&event->elist);
65 event->md = md;
66
67 return event;
68}
69
70static struct dm_uevent *dm_build_path_uevent(struct mapped_device *md,
71 struct dm_target *ti,
72 enum kobject_action action,
73 const char *dm_action,
74 const char *path,
75 unsigned nr_valid_paths)
76{
77 struct dm_uevent *event;
78
79 event = dm_uevent_alloc(md);
80 if (!event) {
81 DMERR("%s: dm_uevent_alloc() failed", __FUNCTION__);
82 goto err_nomem;
83 }
84
85 event->action = action;
86
87 if (add_uevent_var(&event->ku_env, "DM_TARGET=%s", ti->type->name)) {
88 DMERR("%s: add_uevent_var() for DM_TARGET failed",
89 __FUNCTION__);
90 goto err_add;
91 }
92
93 if (add_uevent_var(&event->ku_env, "DM_ACTION=%s", dm_action)) {
94 DMERR("%s: add_uevent_var() for DM_ACTION failed",
95 __FUNCTION__);
96 goto err_add;
97 }
98
99 if (add_uevent_var(&event->ku_env, "DM_SEQNUM=%u",
100 dm_next_uevent_seq(md))) {
101 DMERR("%s: add_uevent_var() for DM_SEQNUM failed",
102 __FUNCTION__);
103 goto err_add;
104 }
105
106 if (add_uevent_var(&event->ku_env, "DM_PATH=%s", path)) {
107 DMERR("%s: add_uevent_var() for DM_PATH failed", __FUNCTION__);
108 goto err_add;
109 }
110
111 if (add_uevent_var(&event->ku_env, "DM_NR_VALID_PATHS=%d",
112 nr_valid_paths)) {
113 DMERR("%s: add_uevent_var() for DM_NR_VALID_PATHS failed",
114 __FUNCTION__);
115 goto err_add;
116 }
117
118 return event;
119
120err_add:
121 dm_uevent_free(event);
122err_nomem:
123 return ERR_PTR(-ENOMEM);
124}
125
126/**
127 * dm_send_uevents - send uevents for given list
128 *
129 * @events: list of events to send
130 * @kobj: kobject generating event
131 *
132 */
133void dm_send_uevents(struct list_head *events, struct kobject *kobj)
134{
135 int r;
136 struct dm_uevent *event, *next;
137
138 list_for_each_entry_safe(event, next, events, elist) {
139 list_del_init(&event->elist);
140
141 /*
142 * Need to call dm_copy_name_and_uuid from here for now.
143 * Context of previous var adds and locking used for
144 * hash_cell not compatable.
145 */
146 if (dm_copy_name_and_uuid(event->md, event->name,
147 event->uuid)) {
148 DMERR("%s: dm_copy_name_and_uuid() failed",
149 __FUNCTION__);
150 goto uevent_free;
151 }
152
153 if (add_uevent_var(&event->ku_env, "DM_NAME=%s", event->name)) {
154 DMERR("%s: add_uevent_var() for DM_NAME failed",
155 __FUNCTION__);
156 goto uevent_free;
157 }
158
159 if (add_uevent_var(&event->ku_env, "DM_UUID=%s", event->uuid)) {
160 DMERR("%s: add_uevent_var() for DM_UUID failed",
161 __FUNCTION__);
162 goto uevent_free;
163 }
164
165 r = kobject_uevent_env(kobj, event->action, event->ku_env.envp);
166 if (r)
167 DMERR("%s: kobject_uevent_env failed", __FUNCTION__);
168uevent_free:
169 dm_uevent_free(event);
170 }
171}
172EXPORT_SYMBOL_GPL(dm_send_uevents);
173
174/**
175 * dm_path_uevent - called to create a new path event and queue it
176 *
177 * @event_type: path event type enum
178 * @ti: pointer to a dm_target
179 * @path: string containing pathname
180 * @nr_valid_paths: number of valid paths remaining
181 *
182 */
183void dm_path_uevent(enum dm_uevent_type event_type, struct dm_target *ti,
184 const char *path, unsigned nr_valid_paths)
185{
186 struct mapped_device *md = dm_table_get_md(ti->table);
187 struct dm_uevent *event;
188
189 if (event_type >= ARRAY_SIZE(_dm_uevent_type_names)) {
190 DMERR("%s: Invalid event_type %d", __FUNCTION__, event_type);
191 goto out;
192 }
193
194 event = dm_build_path_uevent(md, ti,
195 _dm_uevent_type_names[event_type].action,
196 _dm_uevent_type_names[event_type].name,
197 path, nr_valid_paths);
198 if (IS_ERR(event))
199 goto out;
200
201 dm_uevent_add(md, &event->elist);
202
203out:
204 dm_put(md);
205}
206EXPORT_SYMBOL_GPL(dm_path_uevent);
207
208int dm_uevent_init(void)
209{
210 _dm_event_cache = KMEM_CACHE(dm_uevent, 0);
211 if (!_dm_event_cache)
212 return -ENOMEM;
213
214 DMINFO("version 1.0.3");
215
216 return 0;
217}
218
219void dm_uevent_exit(void)
220{
221 kmem_cache_destroy(_dm_event_cache);
222}
diff --git a/drivers/md/dm-uevent.h b/drivers/md/dm-uevent.h
new file mode 100644
index 00000000000..2eccc8bd671
--- /dev/null
+++ b/drivers/md/dm-uevent.h
@@ -0,0 +1,59 @@
1/*
2 * Device Mapper Uevent Support
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Copyright IBM Corporation, 2007
19 * Author: Mike Anderson <andmike@linux.vnet.ibm.com>
20 */
21#ifndef DM_UEVENT_H
22#define DM_UEVENT_H
23
24enum dm_uevent_type {
25 DM_UEVENT_PATH_FAILED,
26 DM_UEVENT_PATH_REINSTATED,
27};
28
29#ifdef CONFIG_DM_UEVENT
30
31extern int dm_uevent_init(void);
32extern void dm_uevent_exit(void);
33extern void dm_send_uevents(struct list_head *events, struct kobject *kobj);
34extern void dm_path_uevent(enum dm_uevent_type event_type,
35 struct dm_target *ti, const char *path,
36 unsigned nr_valid_paths);
37
38#else
39
40static inline int dm_uevent_init(void)
41{
42 return 0;
43}
44static inline void dm_uevent_exit(void)
45{
46}
47static inline void dm_send_uevents(struct list_head *events,
48 struct kobject *kobj)
49{
50}
51static inline void dm_path_uevent(enum dm_uevent_type event_type,
52 struct dm_target *ti, const char *path,
53 unsigned nr_valid_paths)
54{
55}
56
57#endif /* CONFIG_DM_UEVENT */
58
59#endif /* DM_UEVENT_H */
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index d837d37f620..07cbbb8eb3e 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -7,6 +7,7 @@
7 7
8#include "dm.h" 8#include "dm.h"
9#include "dm-bio-list.h" 9#include "dm-bio-list.h"
10#include "dm-uevent.h"
10 11
11#include <linux/init.h> 12#include <linux/init.h>
12#include <linux/module.h> 13#include <linux/module.h>
@@ -112,6 +113,9 @@ struct mapped_device {
112 */ 113 */
113 atomic_t event_nr; 114 atomic_t event_nr;
114 wait_queue_head_t eventq; 115 wait_queue_head_t eventq;
116 atomic_t uevent_seq;
117 struct list_head uevent_list;
118 spinlock_t uevent_lock; /* Protect access to uevent_list */
115 119
116 /* 120 /*
117 * freeze/thaw support require holding onto a super block 121 * freeze/thaw support require holding onto a super block
@@ -143,11 +147,19 @@ static int __init local_init(void)
143 return -ENOMEM; 147 return -ENOMEM;
144 } 148 }
145 149
150 r = dm_uevent_init();
151 if (r) {
152 kmem_cache_destroy(_tio_cache);
153 kmem_cache_destroy(_io_cache);
154 return r;
155 }
156
146 _major = major; 157 _major = major;
147 r = register_blkdev(_major, _name); 158 r = register_blkdev(_major, _name);
148 if (r < 0) { 159 if (r < 0) {
149 kmem_cache_destroy(_tio_cache); 160 kmem_cache_destroy(_tio_cache);
150 kmem_cache_destroy(_io_cache); 161 kmem_cache_destroy(_io_cache);
162 dm_uevent_exit();
151 return r; 163 return r;
152 } 164 }
153 165
@@ -162,6 +174,7 @@ static void local_exit(void)
162 kmem_cache_destroy(_tio_cache); 174 kmem_cache_destroy(_tio_cache);
163 kmem_cache_destroy(_io_cache); 175 kmem_cache_destroy(_io_cache);
164 unregister_blkdev(_major, _name); 176 unregister_blkdev(_major, _name);
177 dm_uevent_exit();
165 178
166 _major = 0; 179 _major = 0;
167 180
@@ -751,15 +764,13 @@ static void __clone_and_map(struct clone_info *ci)
751/* 764/*
752 * Split the bio into several clones. 765 * Split the bio into several clones.
753 */ 766 */
754static void __split_bio(struct mapped_device *md, struct bio *bio) 767static int __split_bio(struct mapped_device *md, struct bio *bio)
755{ 768{
756 struct clone_info ci; 769 struct clone_info ci;
757 770
758 ci.map = dm_get_table(md); 771 ci.map = dm_get_table(md);
759 if (!ci.map) { 772 if (unlikely(!ci.map))
760 bio_io_error(bio); 773 return -EIO;
761 return;
762 }
763 774
764 ci.md = md; 775 ci.md = md;
765 ci.bio = bio; 776 ci.bio = bio;
@@ -779,6 +790,8 @@ static void __split_bio(struct mapped_device *md, struct bio *bio)
779 /* drop the extra reference count */ 790 /* drop the extra reference count */
780 dec_pending(ci.io, 0); 791 dec_pending(ci.io, 0);
781 dm_table_put(ci.map); 792 dm_table_put(ci.map);
793
794 return 0;
782} 795}
783/*----------------------------------------------------------------- 796/*-----------------------------------------------------------------
784 * CRUD END 797 * CRUD END
@@ -790,7 +803,7 @@ static void __split_bio(struct mapped_device *md, struct bio *bio)
790 */ 803 */
791static int dm_request(struct request_queue *q, struct bio *bio) 804static int dm_request(struct request_queue *q, struct bio *bio)
792{ 805{
793 int r; 806 int r = -EIO;
794 int rw = bio_data_dir(bio); 807 int rw = bio_data_dir(bio);
795 struct mapped_device *md = q->queuedata; 808 struct mapped_device *md = q->queuedata;
796 809
@@ -815,18 +828,11 @@ static int dm_request(struct request_queue *q, struct bio *bio)
815 while (test_bit(DMF_BLOCK_IO, &md->flags)) { 828 while (test_bit(DMF_BLOCK_IO, &md->flags)) {
816 up_read(&md->io_lock); 829 up_read(&md->io_lock);
817 830
818 if (bio_rw(bio) == READA) { 831 if (bio_rw(bio) != READA)
819 bio_io_error(bio); 832 r = queue_io(md, bio);
820 return 0;
821 }
822
823 r = queue_io(md, bio);
824 if (r < 0) {
825 bio_io_error(bio);
826 return 0;
827 833
828 } else if (r == 0) 834 if (r <= 0)
829 return 0; /* deferred successfully */ 835 goto out_req;
830 836
831 /* 837 /*
832 * We're in a while loop, because someone could suspend 838 * We're in a while loop, because someone could suspend
@@ -835,8 +841,13 @@ static int dm_request(struct request_queue *q, struct bio *bio)
835 down_read(&md->io_lock); 841 down_read(&md->io_lock);
836 } 842 }
837 843
838 __split_bio(md, bio); 844 r = __split_bio(md, bio);
839 up_read(&md->io_lock); 845 up_read(&md->io_lock);
846
847out_req:
848 if (r < 0)
849 bio_io_error(bio);
850
840 return 0; 851 return 0;
841} 852}
842 853
@@ -977,6 +988,9 @@ static struct mapped_device *alloc_dev(int minor)
977 atomic_set(&md->holders, 1); 988 atomic_set(&md->holders, 1);
978 atomic_set(&md->open_count, 0); 989 atomic_set(&md->open_count, 0);
979 atomic_set(&md->event_nr, 0); 990 atomic_set(&md->event_nr, 0);
991 atomic_set(&md->uevent_seq, 0);
992 INIT_LIST_HEAD(&md->uevent_list);
993 spin_lock_init(&md->uevent_lock);
980 994
981 md->queue = blk_alloc_queue(GFP_KERNEL); 995 md->queue = blk_alloc_queue(GFP_KERNEL);
982 if (!md->queue) 996 if (!md->queue)
@@ -1044,12 +1058,14 @@ static struct mapped_device *alloc_dev(int minor)
1044 return NULL; 1058 return NULL;
1045} 1059}
1046 1060
1061static void unlock_fs(struct mapped_device *md);
1062
1047static void free_dev(struct mapped_device *md) 1063static void free_dev(struct mapped_device *md)
1048{ 1064{
1049 int minor = md->disk->first_minor; 1065 int minor = md->disk->first_minor;
1050 1066
1051 if (md->suspended_bdev) { 1067 if (md->suspended_bdev) {
1052 thaw_bdev(md->suspended_bdev, NULL); 1068 unlock_fs(md);
1053 bdput(md->suspended_bdev); 1069 bdput(md->suspended_bdev);
1054 } 1070 }
1055 mempool_destroy(md->tio_pool); 1071 mempool_destroy(md->tio_pool);
@@ -1073,8 +1089,16 @@ static void free_dev(struct mapped_device *md)
1073 */ 1089 */
1074static void event_callback(void *context) 1090static void event_callback(void *context)
1075{ 1091{
1092 unsigned long flags;
1093 LIST_HEAD(uevents);
1076 struct mapped_device *md = (struct mapped_device *) context; 1094 struct mapped_device *md = (struct mapped_device *) context;
1077 1095
1096 spin_lock_irqsave(&md->uevent_lock, flags);
1097 list_splice_init(&md->uevent_list, &uevents);
1098 spin_unlock_irqrestore(&md->uevent_lock, flags);
1099
1100 dm_send_uevents(&uevents, &md->disk->kobj);
1101
1078 atomic_inc(&md->event_nr); 1102 atomic_inc(&md->event_nr);
1079 wake_up(&md->eventq); 1103 wake_up(&md->eventq);
1080} 1104}
@@ -1233,7 +1257,8 @@ static void __flush_deferred_io(struct mapped_device *md, struct bio *c)
1233 while (c) { 1257 while (c) {
1234 n = c->bi_next; 1258 n = c->bi_next;
1235 c->bi_next = NULL; 1259 c->bi_next = NULL;
1236 __split_bio(md, c); 1260 if (__split_bio(md, c))
1261 bio_io_error(c);
1237 c = n; 1262 c = n;
1238 } 1263 }
1239} 1264}
@@ -1491,6 +1516,11 @@ out:
1491/*----------------------------------------------------------------- 1516/*-----------------------------------------------------------------
1492 * Event notification. 1517 * Event notification.
1493 *---------------------------------------------------------------*/ 1518 *---------------------------------------------------------------*/
1519uint32_t dm_next_uevent_seq(struct mapped_device *md)
1520{
1521 return atomic_add_return(1, &md->uevent_seq);
1522}
1523
1494uint32_t dm_get_event_nr(struct mapped_device *md) 1524uint32_t dm_get_event_nr(struct mapped_device *md)
1495{ 1525{
1496 return atomic_read(&md->event_nr); 1526 return atomic_read(&md->event_nr);
@@ -1502,6 +1532,15 @@ int dm_wait_event(struct mapped_device *md, int event_nr)
1502 (event_nr != atomic_read(&md->event_nr))); 1532 (event_nr != atomic_read(&md->event_nr)));
1503} 1533}
1504 1534
1535void dm_uevent_add(struct mapped_device *md, struct list_head *elist)
1536{
1537 unsigned long flags;
1538
1539 spin_lock_irqsave(&md->uevent_lock, flags);
1540 list_add(elist, &md->uevent_list);
1541 spin_unlock_irqrestore(&md->uevent_lock, flags);
1542}
1543
1505/* 1544/*
1506 * The gendisk is only valid as long as you have a reference 1545 * The gendisk is only valid as long as you have a reference
1507 * count on 'md'. 1546 * count on 'md'.
diff --git a/drivers/md/kcopyd.c b/drivers/md/kcopyd.c
index 7e052378c47..f3831f31223 100644
--- a/drivers/md/kcopyd.c
+++ b/drivers/md/kcopyd.c
@@ -198,7 +198,7 @@ struct kcopyd_job {
198 * These fields are only used if the job has been split 198 * These fields are only used if the job has been split
199 * into more manageable parts. 199 * into more manageable parts.
200 */ 200 */
201 struct semaphore lock; 201 struct mutex lock;
202 atomic_t sub_jobs; 202 atomic_t sub_jobs;
203 sector_t progress; 203 sector_t progress;
204}; 204};
@@ -456,7 +456,7 @@ static void segment_complete(int read_err,
456 sector_t count = 0; 456 sector_t count = 0;
457 struct kcopyd_job *job = (struct kcopyd_job *) context; 457 struct kcopyd_job *job = (struct kcopyd_job *) context;
458 458
459 down(&job->lock); 459 mutex_lock(&job->lock);
460 460
461 /* update the error */ 461 /* update the error */
462 if (read_err) 462 if (read_err)
@@ -480,7 +480,7 @@ static void segment_complete(int read_err,
480 job->progress += count; 480 job->progress += count;
481 } 481 }
482 } 482 }
483 up(&job->lock); 483 mutex_unlock(&job->lock);
484 484
485 if (count) { 485 if (count) {
486 int i; 486 int i;
@@ -562,7 +562,7 @@ int kcopyd_copy(struct kcopyd_client *kc, struct io_region *from,
562 dispatch_job(job); 562 dispatch_job(job);
563 563
564 else { 564 else {
565 init_MUTEX(&job->lock); 565 mutex_init(&job->lock);
566 job->progress = 0; 566 job->progress = 0;
567 split_job(job); 567 split_job(job);
568 } 568 }
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 16775a0df7f..85478d6a9c1 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -9,7 +9,7 @@
9 * 9 *
10 * Better read-balancing code written by Mika Kuoppala <miku@iki.fi>, 2000 10 * Better read-balancing code written by Mika Kuoppala <miku@iki.fi>, 2000
11 * 11 *
12 * Fixes to reconstruction by Jakob Østergaard" <jakob@ostenfeld.dk> 12 * Fixes to reconstruction by Jakob Østergaard" <jakob@ostenfeld.dk>
13 * Various fixes by Neil Brown <neilb@cse.unsw.edu.au> 13 * Various fixes by Neil Brown <neilb@cse.unsw.edu.au>
14 * 14 *
15 * Changes by Peter T. Breuer <ptb@it.uc3m.es> 31/1/2003 to support 15 * Changes by Peter T. Breuer <ptb@it.uc3m.es> 31/1/2003 to support
diff --git a/drivers/media/common/saa7146_hlp.c b/drivers/media/common/saa7146_hlp.c
index d2905720eb7..9c905399a23 100644
--- a/drivers/media/common/saa7146_hlp.c
+++ b/drivers/media/common/saa7146_hlp.c
@@ -312,7 +312,7 @@ static int sort_and_eliminate(u32* values, int* count)
312 return -EINVAL; 312 return -EINVAL;
313 } 313 }
314 314
315 /* bubble sort the first ´count´ items of the array ´values´ */ 315 /* bubble sort the first @count items of the array @values */
316 for( top = *count; top > 0; top--) { 316 for( top = *count; top > 0; top--) {
317 for( low = 0, high = 1; high < top; low++, high++) { 317 for( low = 0, high = 1; high < top; low++, high++) {
318 if( values[low] > values[high] ) { 318 if( values[low] > values[high] ) {
diff --git a/drivers/media/dvb/bt8xx/bt878.c b/drivers/media/dvb/bt8xx/bt878.c
index eca602d9b3d..85e36a1d6d7 100644
--- a/drivers/media/dvb/bt8xx/bt878.c
+++ b/drivers/media/dvb/bt8xx/bt878.c
@@ -280,7 +280,7 @@ static irqreturn_t bt878_irq(int irq, void *dev_id)
280 if (!(astat = (stat & mask))) 280 if (!(astat = (stat & mask)))
281 return IRQ_NONE; /* this interrupt is not for me */ 281 return IRQ_NONE; /* this interrupt is not for me */
282/* dprintk("bt878(%d) debug: irq count %d, stat 0x%8.8x, mask 0x%8.8x\n",bt->nr,count,stat,mask); */ 282/* dprintk("bt878(%d) debug: irq count %d, stat 0x%8.8x, mask 0x%8.8x\n",bt->nr,count,stat,mask); */
283 btwrite(astat, BT878_AINT_STAT); /* try to clear interupt condition */ 283 btwrite(astat, BT878_AINT_STAT); /* try to clear interrupt condition */
284 284
285 285
286 if (astat & (BT878_ASCERR | BT878_AOCERR)) { 286 if (astat & (BT878_ASCERR | BT878_AOCERR)) {
diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c
index 154a7ce7cb8..a05e5c18228 100644
--- a/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * TerraTec Cinergy T²/qanu USB2 DVB-T adapter. 2 * TerraTec Cinergy T²/qanu USB2 DVB-T adapter.
3 * 3 *
4 * Copyright (C) 2004 Daniel Mack <daniel@qanu.de> and 4 * Copyright (C) 2004 Daniel Mack <daniel@qanu.de> and
5 * Holger Waechtler <holger@qanu.de> 5 * Holger Waechtler <holger@qanu.de>
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 288e79f2cb0..7902ae1d9a1 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -128,7 +128,7 @@ struct ttusb {
128 struct dvb_frontend* fe; 128 struct dvb_frontend* fe;
129}; 129};
130 130
131/* ugly workaround ... don't know why it's neccessary to read */ 131/* ugly workaround ... don't know why it's necessary to read */
132/* all result codes. */ 132/* all result codes. */
133 133
134#define DEBUG 0 134#define DEBUG 0
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index dd6a7d68b07..3abd9fa54d2 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -1259,7 +1259,7 @@ struct tvcard bttv_tvcards[] = {
1259 .has_radio = 1, 1259 .has_radio = 1,
1260 }, 1260 },
1261 [BTTV_BOARD_LIFETEC_9415] = { 1261 [BTTV_BOARD_LIFETEC_9415] = {
1262 /* Tim Röstermundt <rosterm@uni-muenster.de> 1262 /* Tim Röstermundt <rosterm@uni-muenster.de>
1263 in de.comp.os.unix.linux.hardware: 1263 in de.comp.os.unix.linux.hardware:
1264 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0 1264 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1265 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff 1265 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
@@ -2824,7 +2824,7 @@ struct tvcard bttv_tvcards[] = {
2824 }, 2824 },
2825 /* ---- card 0x8b ---------------------------------- */ 2825 /* ---- card 0x8b ---------------------------------- */
2826 [BTTV_BOARD_PV_M4900] = { 2826 [BTTV_BOARD_PV_M4900] = {
2827 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */ 2827 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2828 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900", 2828 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2829 .video_inputs = 3, 2829 .video_inputs = 3,
2830 .audio_inputs = 1, 2830 .audio_inputs = 1,
@@ -4709,18 +4709,18 @@ adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4709 * 4709 *
4710 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin. 4710 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4711 * GPIO pins are wired as: 4711 * GPIO pins are wired as:
4712 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler) 4712 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroller)
4713 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler) 4713 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroller)
4714 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler) 4714 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroller)
4715 * GPIO[8] - - P3[5] (microcontroler) 4715 * GPIO[8] - - P3[5] (microcontroller)
4716 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler) 4716 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroller)
4717 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler) 4717 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroller)
4718 * GPINTR - - P3[4] (microcontroler) 4718 * GPINTR - - P3[4] (microcontroller)
4719 * 4719 *
4720 * The microcontroler is a 80C32 like. It should be possible to change xpoint 4720 * The microcontroller is a 80C32 like. It should be possible to change xpoint
4721 * configuration either directly (as we are doing) or using the microcontroler 4721 * configuration either directly (as we are doing) or using the microcontroller
4722 * which is also wired to I2C interface. I have no further info on the 4722 * which is also wired to I2C interface. I have no further info on the
4723 * microcontroler features, one would need to disassembly the firmware. 4723 * microcontroller features, one would need to disassembly the firmware.
4724 * note: the vendor refused to give any information on this product, all 4724 * note: the vendor refused to give any information on this product, all
4725 * that stuff was found using a multimeter! :) 4725 * that stuff was found using a multimeter! :)
4726 */ 4726 */
@@ -4788,7 +4788,7 @@ static void tibetCS16_init(struct bttv *btv)
4788 * The analog switch is controlled by the "master", but the detection order 4788 * The analog switch is controlled by the "master", but the detection order
4789 * of the four BT878A chips is in an order which I just don't understand. 4789 * of the four BT878A chips is in an order which I just don't understand.
4790 * The "master" is actually the second controller to be detected. The 4790 * The "master" is actually the second controller to be detected. The
4791 * logic on the board uses logical numbers for the 4 controlers, but 4791 * logic on the board uses logical numbers for the 4 controllers, but
4792 * those numbers are different from the detection sequence. When working 4792 * those numbers are different from the detection sequence. When working
4793 * with the analog switch, we need to "map" from the detection sequence 4793 * with the analog switch, we need to "map" from the detection sequence
4794 * over to the board's logical controller number. This mapping sequence 4794 * over to the board's logical controller number. This mapping sequence
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index b8d5327c438..e467682aabd 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -907,7 +907,7 @@ static int em28xx_set_fmt(struct em28xx *dev, unsigned int cmd, struct v4l2_form
907 907
908 /* stop io in case it is already in progress */ 908 /* stop io in case it is already in progress */
909 if (dev->stream == STREAM_ON) { 909 if (dev->stream == STREAM_ON) {
910 em28xx_videodbg("VIDIOC_SET_FMT: interupting stream\n"); 910 em28xx_videodbg("VIDIOC_SET_FMT: interrupting stream\n");
911 if ((ret = em28xx_stream_interrupt(dev))) 911 if ((ret = em28xx_stream_interrupt(dev)))
912 return ret; 912 return ret;
913 } 913 }
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c
index 7533fc20331..69283926a8d 100644
--- a/drivers/media/video/meye.c
+++ b/drivers/media/video/meye.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net> 4 * Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net>
5 * 5 *
6 * Copyright (C) 2001-2002 Alcôve <www.alcove.com> 6 * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
7 * 7 *
8 * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com> 8 * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com>
9 * 9 *
diff --git a/drivers/media/video/meye.h b/drivers/media/video/meye.h
index 323d0074120..d535748df44 100644
--- a/drivers/media/video/meye.h
+++ b/drivers/media/video/meye.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net> 4 * Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net>
5 * 5 *
6 * Copyright (C) 2001-2002 Alcôve <www.alcove.com> 6 * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
7 * 7 *
8 * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com> 8 * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com>
9 * 9 *
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index e20aa3612a7..ad0232935df 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -196,10 +196,10 @@ static int i2c_senddata(struct saa5246a_device *t, ...)
196 return i2c_sendbuf(t, buf[0], ct-1, buf+1); 196 return i2c_sendbuf(t, buf[0], ct-1, buf+1);
197} 197}
198 198
199/* Get count number of bytes from I²C-device at address adr, store them in buf. 199/* Get count number of bytes from I²C-device at address adr, store them in buf.
200 * Start & stop handshaking is done by this routine, ack will be sent after the 200 * Start & stop handshaking is done by this routine, ack will be sent after the
201 * last byte to inhibit further sending of data. If uaccess is 'true', data is 201 * last byte to inhibit further sending of data. If uaccess is 'true', data is
202 * written to user-space with put_user. Returns -1 if I²C-device didn't send 202 * written to user-space with put_user. Returns -1 if I²C-device didn't send
203 * acknowledge, 0 otherwise 203 * acknowledge, 0 otherwise
204 */ 204 */
205static int i2c_getdata(struct saa5246a_device *t, int count, u8 *buf) 205static int i2c_getdata(struct saa5246a_device *t, int count, u8 *buf)
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
index 17f1e2e9a66..94bb59a32b1 100644
--- a/drivers/media/video/saa5249.c
+++ b/drivers/media/video/saa5249.c
@@ -291,10 +291,10 @@ static int i2c_senddata(struct saa5249_device *t, ...)
291 return i2c_sendbuf(t, buf[0], ct-1, buf+1); 291 return i2c_sendbuf(t, buf[0], ct-1, buf+1);
292} 292}
293 293
294/* Get count number of bytes from I²C-device at address adr, store them in buf. Start & stop 294/* Get count number of bytes from I²C-device at address adr, store them in buf. Start & stop
295 * handshaking is done by this routine, ack will be sent after the last byte to inhibit further 295 * handshaking is done by this routine, ack will be sent after the last byte to inhibit further
296 * sending of data. If uaccess is 'true', data is written to user-space with put_user. 296 * sending of data. If uaccess is 'true', data is written to user-space with put_user.
297 * Returns -1 if I²C-device didn't send acknowledge, 0 otherwise 297 * Returns -1 if I²C-device didn't send acknowledge, 0 otherwise
298 */ 298 */
299 299
300static int i2c_getdata(struct saa5249_device *t, int count, u8 *buf) 300static int i2c_getdata(struct saa5249_device *t, int count, u8 *buf)
diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c
index ff555129c82..db3c9e3deb2 100644
--- a/drivers/media/video/usbvideo/vicam.c
+++ b/drivers/media/video/usbvideo/vicam.c
@@ -955,7 +955,7 @@ read_frame(struct vicam_camera *cam, int framenum)
955 request[7] = realShutter >> 8; 955 request[7] = realShutter >> 8;
956 } 956 }
957 957
958 // Per John Markus Bjørndalen, byte at index 8 causes problems if it isn't 0 958 // Per John Markus Bjørndalen, byte at index 8 causes problems if it isn't 0
959 request[8] = 0; 959 request[8] = 0;
960 // bytes 9-15 do not seem to affect exposure or image quality 960 // bytes 9-15 do not seem to affect exposure or image quality
961 961
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index c3440b280d2..321249240d0 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -37,7 +37,7 @@
37 * Video4linux 1/2 integration by Justin Schoeman 37 * Video4linux 1/2 integration by Justin Schoeman
38 * <justin@suntiger.ee.up.ac.za> 38 * <justin@suntiger.ee.up.ac.za>
39 * 2.4 PROCFS support ported from 2.4 kernels by 39 * 2.4 PROCFS support ported from 2.4 kernels by
40 * Iñaki García Etxebarria <garetxe@euskalnet.net> 40 * Iñaki García Etxebarria <garetxe@euskalnet.net>
41 * Makefile fix by "W. Michael Petullo" <mike@flyn.org> 41 * Makefile fix by "W. Michael Petullo" <mike@flyn.org>
42 * 2.4 devfs support ported from 2.4 kernels by 42 * 2.4 devfs support ported from 2.4 kernels by
43 * Dan Merillat <dan@merillat.org> 43 * Dan Merillat <dan@merillat.org>
diff --git a/drivers/message/i2o/README b/drivers/message/i2o/README
index a81f851f7b5..911fc3021e3 100644
--- a/drivers/message/i2o/README
+++ b/drivers/message/i2o/README
@@ -30,13 +30,13 @@ Juha Sievanen, University of Helsinki Finland
30 Bug fixes 30 Bug fixes
31 Core code extensions 31 Core code extensions
32 32
33Auvo Häkkinen, University of Helsinki Finland 33Auvo Häkkinen, University of Helsinki Finland
34 LAN OSM code 34 LAN OSM code
35 /Proc interface to LAN class 35 /Proc interface to LAN class
36 Bug fixes 36 Bug fixes
37 Core code extensions 37 Core code extensions
38 38
39Taneli Vähäkangas, University of Helsinki Finland 39Taneli Vähäkangas, University of Helsinki Finland
40 Fixes to i2o_config 40 Fixes to i2o_config
41 41
42CREDITS 42CREDITS
diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c
index ce8f1a34ed2..6cbcc21de51 100644
--- a/drivers/message/i2o/exec-osm.c
+++ b/drivers/message/i2o/exec-osm.c
@@ -15,8 +15,8 @@
15 * 15 *
16 * Fixes/additions: 16 * Fixes/additions:
17 * Philipp Rumpf 17 * Philipp Rumpf
18 * Juha Sievänen <Juha.Sievanen@cs.Helsinki.FI> 18 * Juha Sievänen <Juha.Sievanen@cs.Helsinki.FI>
19 * Auvo Häkkinen <Auvo.Hakkinen@cs.Helsinki.FI> 19 * Auvo Häkkinen <Auvo.Hakkinen@cs.Helsinki.FI>
20 * Deepak Saxena <deepak@plexity.net> 20 * Deepak Saxena <deepak@plexity.net>
21 * Boji T Kannanthanam <boji.t.kannanthanam@intel.com> 21 * Boji T Kannanthanam <boji.t.kannanthanam@intel.com>
22 * Alan Cox <alan@redhat.com>: 22 * Alan Cox <alan@redhat.com>:
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index 84e046e94f5..c0fb77dc19b 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -10,12 +10,12 @@
10 * Added basic ioctl() support 10 * Added basic ioctl() support
11 * Deepak Saxena (06/07/1999): 11 * Deepak Saxena (06/07/1999):
12 * Added software download ioctl (still testing) 12 * Added software download ioctl (still testing)
13 * Auvo Häkkinen (09/10/1999): 13 * Auvo Häkkinen (09/10/1999):
14 * Changes to i2o_cfg_reply(), ioctl_parms() 14 * Changes to i2o_cfg_reply(), ioctl_parms()
15 * Added ioct_validate() 15 * Added ioct_validate()
16 * Taneli Vähäkangas (09/30/1999): 16 * Taneli Vähäkangas (09/30/1999):
17 * Fixed ioctl_swdl() 17 * Fixed ioctl_swdl()
18 * Taneli Vähäkangas (10/04/1999): 18 * Taneli Vähäkangas (10/04/1999):
19 * Changed ioctl_swdl(), implemented ioctl_swul() and ioctl_swdel() 19 * Changed ioctl_swdl(), implemented ioctl_swul() and ioctl_swdel()
20 * Deepak Saxena (11/18/1999): 20 * Deepak Saxena (11/18/1999):
21 * Added event managmenet support 21 * Added event managmenet support
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
index 06892ac2286..6fdd072201f 100644
--- a/drivers/message/i2o/i2o_proc.c
+++ b/drivers/message/i2o/i2o_proc.c
@@ -19,8 +19,8 @@
19 * 19 *
20 * 20 *
21 * Fixes/additions: 21 * Fixes/additions:
22 * Juha Sievänen (Juha.Sievanen@cs.Helsinki.FI), 22 * Juha Sievänen (Juha.Sievanen@cs.Helsinki.FI),
23 * Auvo Häkkinen (Auvo.Hakkinen@cs.Helsinki.FI) 23 * Auvo Häkkinen (Auvo.Hakkinen@cs.Helsinki.FI)
24 * University of Helsinki, Department of Computer Science 24 * University of Helsinki, Department of Computer Science
25 * LAN entries 25 * LAN entries
26 * Markus Lidel <Markus.Lidel@shadowconnect.com> 26 * Markus Lidel <Markus.Lidel@shadowconnect.com>
diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c
index a1ec16a075c..7814a06ae97 100644
--- a/drivers/message/i2o/iop.c
+++ b/drivers/message/i2o/iop.c
@@ -15,8 +15,8 @@
15 * 15 *
16 * Fixes/additions: 16 * Fixes/additions:
17 * Philipp Rumpf 17 * Philipp Rumpf
18 * Juha Sievänen <Juha.Sievanen@cs.Helsinki.FI> 18 * Juha Sievänen <Juha.Sievanen@cs.Helsinki.FI>
19 * Auvo Häkkinen <Auvo.Hakkinen@cs.Helsinki.FI> 19 * Auvo Häkkinen <Auvo.Hakkinen@cs.Helsinki.FI>
20 * Deepak Saxena <deepak@plexity.net> 20 * Deepak Saxena <deepak@plexity.net>
21 * Boji T Kannanthanam <boji.t.kannanthanam@intel.com> 21 * Boji T Kannanthanam <boji.t.kannanthanam@intel.com>
22 * Alan Cox <alan@redhat.com>: 22 * Alan Cox <alan@redhat.com>:
diff --git a/drivers/message/i2o/pci.c b/drivers/message/i2o/pci.c
index 3661e6e065d..685a89547a5 100644
--- a/drivers/message/i2o/pci.c
+++ b/drivers/message/i2o/pci.c
@@ -15,8 +15,8 @@
15 * 15 *
16 * Fixes/additions: 16 * Fixes/additions:
17 * Philipp Rumpf 17 * Philipp Rumpf
18 * Juha Sievänen <Juha.Sievanen@cs.Helsinki.FI> 18 * Juha Sievänen <Juha.Sievanen@cs.Helsinki.FI>
19 * Auvo Häkkinen <Auvo.Hakkinen@cs.Helsinki.FI> 19 * Auvo Häkkinen <Auvo.Hakkinen@cs.Helsinki.FI>
20 * Deepak Saxena <deepak@plexity.net> 20 * Deepak Saxena <deepak@plexity.net>
21 * Boji T Kannanthanam <boji.t.kannanthanam@intel.com> 21 * Boji T Kannanthanam <boji.t.kannanthanam@intel.com>
22 * Alan Cox <alan@redhat.com>: 22 * Alan Cox <alan@redhat.com>:
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index a20a51efe11..25716193a53 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -10,8 +10,8 @@ config MFD_SM501
10 ---help--- 10 ---help---
11 This is the core driver for the Silicon Motion SM501 multimedia 11 This is the core driver for the Silicon Motion SM501 multimedia
12 companion chip. This device is a multifunction device which may 12 companion chip. This device is a multifunction device which may
13 provide numerous interfaces including USB host controller USB gadget, 13 provide numerous interfaces including USB host controller, USB gadget,
14 Asyncronous Serial ports, Audio functions and a dual display video 14 asynchronous serial ports, audio functions, and a dual display video
15 interface. The device may be connected by PCI or local bus with 15 interface. The device may be connected by PCI or local bus with
16 varying functions enabled. 16 varying functions enabled.
17 17
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index cf02ddc3436..b5e67c0ff43 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -180,7 +180,7 @@ config THINKPAD_ACPI
180 For more information about this driver see 180 For more information about this driver see
181 <file:Documentation/thinkpad-acpi.txt> and <http://ibm-acpi.sf.net/> . 181 <file:Documentation/thinkpad-acpi.txt> and <http://ibm-acpi.sf.net/> .
182 182
183 This driver was formely known as ibm-acpi. 183 This driver was formerly known as ibm-acpi.
184 184
185 If you have an IBM or Lenovo ThinkPad laptop, say Y or M here. 185 If you have an IBM or Lenovo ThinkPad laptop, say Y or M here.
186 186
@@ -214,7 +214,7 @@ config THINKPAD_ACPI_BAY
214 default y 214 default y
215 ---help--- 215 ---help---
216 Allows the thinkpad_acpi driver to handle removable bays. It will 216 Allows the thinkpad_acpi driver to handle removable bays. It will
217 eletrically disable the device in the bay, and also generate 217 electrically disable the device in the bay, and also generate
218 notifications when the bay lever is ejected or inserted. 218 notifications when the bay lever is ejected or inserted.
219 219
220 If you are not sure, say Y here. 220 If you are not sure, say Y here.
diff --git a/drivers/misc/ibmasm/remote.c b/drivers/misc/ibmasm/remote.c
index 1d9defb1a10..477bb43c899 100644
--- a/drivers/misc/ibmasm/remote.c
+++ b/drivers/misc/ibmasm/remote.c
@@ -17,7 +17,7 @@
17 * 17 *
18 * Copyright (C) IBM Corporation, 2004 18 * Copyright (C) IBM Corporation, 2004
19 * 19 *
20 * Authors: Max Asböck <amax@us.ibm.com> 20 * Authors: Max Asböck <amax@us.ibm.com>
21 * Vernon Mauery <vernux@us.ibm.com> 21 * Vernon Mauery <vernux@us.ibm.com>
22 * 22 *
23 */ 23 */
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index 1bfbb87e579..bb13858f60a 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -14,7 +14,7 @@
14 * 14 *
15 * Copyright (C) 2005 Narayanan R S <nars@kadamba.org> 15 * Copyright (C) 2005 Narayanan R S <nars@kadamba.org>
16 * 16 *
17 * Copyright (C) 2001-2002 Alcôve <www.alcove.com> 17 * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
18 * 18 *
19 * Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au> 19 * Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au>
20 * 20 *
@@ -277,7 +277,7 @@ static void do_sony_laptop_release_key(struct work_struct *work)
277static DECLARE_WORK(sony_laptop_release_key_work, 277static DECLARE_WORK(sony_laptop_release_key_work,
278 do_sony_laptop_release_key); 278 do_sony_laptop_release_key);
279 279
280/* forward event to the input subsytem */ 280/* forward event to the input subsystem */
281static void sony_laptop_report_input_event(u8 event) 281static void sony_laptop_report_input_event(u8 event)
282{ 282{
283 struct input_dev *jog_dev = sony_laptop_input.jog_dev; 283 struct input_dev *jog_dev = sony_laptop_input.jog_dev;
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index 2a2a125b0c7..a592fc04cf7 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -54,7 +54,7 @@ config MTD_PHYSMAP_BANKWIDTH
54 help 54 help
55 This is the total width of the data bus of the flash devices 55 This is the total width of the data bus of the flash devices
56 in octets. For example, if you have a data bus width of 32 56 in octets. For example, if you have a data bus width of 32
57 bits, you would set the bus width octect value to 4. This is 57 bits, you would set the bus width octet value to 4. This is
58 used internally by the CFI drivers. 58 used internally by the CFI drivers.
59 Ignore this option if you use run-time physmap configuration 59 Ignore this option if you use run-time physmap configuration
60 (i.e., run-time calling physmap_configure()). 60 (i.e., run-time calling physmap_configure()).
@@ -73,12 +73,12 @@ config MTD_PMC_MSP_EVM
73 depends on PMC_MSP && MTD_CFI 73 depends on PMC_MSP && MTD_CFI
74 select MTD_PARTITIONS 74 select MTD_PARTITIONS
75 help 75 help
76 This provides a 'mapping' driver which support the way 76 This provides a 'mapping' driver which supports the way
77 in which user-programmable flash chips are connected on the 77 in which user-programmable flash chips are connected on the
78 PMC-Sierra MSP eval/demo boards 78 PMC-Sierra MSP eval/demo boards.
79 79
80choice 80choice
81 prompt "Maximum mappable memory avialable for flash IO" 81 prompt "Maximum mappable memory available for flash IO"
82 depends on MTD_PMC_MSP_EVM 82 depends on MTD_PMC_MSP_EVM
83 default MSP_FLASH_MAP_LIMIT_32M 83 default MSP_FLASH_MAP_LIMIT_32M
84 84
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 973b684c11e..eef6fecfff2 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -73,7 +73,7 @@
73 73
74 Jean-Jacques Michel - bug fix 74 Jean-Jacques Michel - bug fix
75 75
76 Tobias Ringström - Rx interrupt status checking suggestion 76 Tobias Ringström - Rx interrupt status checking suggestion
77 77
78 Andrew Morton - Clear blocked signals, avoid 78 Andrew Morton - Clear blocked signals, avoid
79 buffer overrun setting current->comm. 79 buffer overrun setting current->comm.
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 83d52c8acab..ce34b539bf3 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -855,7 +855,7 @@ config BFIN_MAC_USE_L1
855 depends on BFIN_MAC && BF537 855 depends on BFIN_MAC && BF537
856 default y 856 default y
857 help 857 help
858 To get maximum network performace, you should use L1 memory as rx/tx buffers. 858 To get maximum network performance, you should use L1 memory as rx/tx buffers.
859 Say N here if you want to reserve L1 memory for other uses. 859 Say N here if you want to reserve L1 memory for other uses.
860 860
861config BFIN_TX_DESC_NUM 861config BFIN_TX_DESC_NUM
@@ -1293,9 +1293,6 @@ config PCNET32_NAPI
1293 deployed on potentially unfriendly networks (e.g. in a firewall), 1293 deployed on potentially unfriendly networks (e.g. in a firewall),
1294 then say Y here. 1294 then say Y here.
1295 1295
1296 See <file:Documentation/networking/NAPI_HOWTO.txt> for more
1297 information.
1298
1299 If in doubt, say N. 1296 If in doubt, say N.
1300 1297
1301config AMD8111_ETH 1298config AMD8111_ETH
@@ -1313,7 +1310,7 @@ config AMD8111_ETH
1313 will be called amd8111e. 1310 will be called amd8111e.
1314 1311
1315config AMD8111E_NAPI 1312config AMD8111E_NAPI
1316 bool "Enable NAPI support" 1313 bool "Use RX polling (NAPI)"
1317 depends on AMD8111_ETH 1314 depends on AMD8111_ETH
1318 help 1315 help
1319 NAPI is a new driver API designed to reduce CPU and interrupt load 1316 NAPI is a new driver API designed to reduce CPU and interrupt load
@@ -1324,9 +1321,6 @@ config AMD8111E_NAPI
1324 deployed on potentially unfriendly networks (e.g. in a firewall), 1321 deployed on potentially unfriendly networks (e.g. in a firewall),
1325 then say Y here. 1322 then say Y here.
1326 1323
1327 See <file:Documentation/networking/NAPI_HOWTO.txt> for more
1328 information.
1329
1330 If in doubt, say N. 1324 If in doubt, say N.
1331 1325
1332config ADAPTEC_STARFIRE 1326config ADAPTEC_STARFIRE
@@ -1355,9 +1349,6 @@ config ADAPTEC_STARFIRE_NAPI
1355 deployed on potentially unfriendly networks (e.g. in a firewall), 1349 deployed on potentially unfriendly networks (e.g. in a firewall),
1356 then say Y here. 1350 then say Y here.
1357 1351
1358 See <file:Documentation/networking/NAPI_HOWTO.txt> for more
1359 information.
1360
1361 If in doubt, say N. 1352 If in doubt, say N.
1362 1353
1363config AC3200 1354config AC3200
@@ -1431,7 +1422,7 @@ config FORCEDETH
1431 called forcedeth. 1422 called forcedeth.
1432 1423
1433config FORCEDETH_NAPI 1424config FORCEDETH_NAPI
1434 bool "Use Rx and Tx Polling (NAPI) (EXPERIMENTAL)" 1425 bool "Use Rx Polling (NAPI) (EXPERIMENTAL)"
1435 depends on FORCEDETH && EXPERIMENTAL 1426 depends on FORCEDETH && EXPERIMENTAL
1436 help 1427 help
1437 NAPI is a new driver API designed to reduce CPU and interrupt load 1428 NAPI is a new driver API designed to reduce CPU and interrupt load
@@ -1442,9 +1433,6 @@ config FORCEDETH_NAPI
1442 deployed on potentially unfriendly networks (e.g. in a firewall), 1433 deployed on potentially unfriendly networks (e.g. in a firewall),
1443 then say Y here. 1434 then say Y here.
1444 1435
1445 See <file:Documentation/networking/NAPI_HOWTO.txt> for more
1446 information.
1447
1448 If in doubt, say N. 1436 If in doubt, say N.
1449 1437
1450config CS89x0 1438config CS89x0
@@ -1756,9 +1744,6 @@ config VIA_RHINE_NAPI
1756 deployed on potentially unfriendly networks (e.g. in a firewall), 1744 deployed on potentially unfriendly networks (e.g. in a firewall),
1757 then say Y here. 1745 then say Y here.
1758 1746
1759 See <file:Documentation/networking/NAPI_HOWTO.txt> for more
1760 information.
1761
1762config LAN_SAA9730 1747config LAN_SAA9730
1763 bool "Philips SAA9730 Ethernet support" 1748 bool "Philips SAA9730 Ethernet support"
1764 depends on NET_PCI && PCI && MIPS_ATLAS 1749 depends on NET_PCI && PCI && MIPS_ATLAS
@@ -2003,9 +1988,6 @@ config E1000_NAPI
2003 deployed on potentially unfriendly networks (e.g. in a firewall), 1988 deployed on potentially unfriendly networks (e.g. in a firewall),
2004 then say Y here. 1989 then say Y here.
2005 1990
2006 See <file:Documentation/networking/NAPI_HOWTO.txt> for more
2007 information.
2008
2009 If in doubt, say N. 1991 If in doubt, say N.
2010 1992
2011config E1000_DISABLE_PACKET_SPLIT 1993config E1000_DISABLE_PACKET_SPLIT
@@ -2099,7 +2081,7 @@ config R8169
2099 will be called r8169. This is recommended. 2081 will be called r8169. This is recommended.
2100 2082
2101config R8169_NAPI 2083config R8169_NAPI
2102 bool "Use Rx and Tx Polling (NAPI) (EXPERIMENTAL)" 2084 bool "Use Rx Polling (NAPI) (EXPERIMENTAL)"
2103 depends on R8169 && EXPERIMENTAL 2085 depends on R8169 && EXPERIMENTAL
2104 help 2086 help
2105 NAPI is a new driver API designed to reduce CPU and interrupt load 2087 NAPI is a new driver API designed to reduce CPU and interrupt load
@@ -2110,9 +2092,6 @@ config R8169_NAPI
2110 deployed on potentially unfriendly networks (e.g. in a firewall), 2092 deployed on potentially unfriendly networks (e.g. in a firewall),
2111 then say Y here. 2093 then say Y here.
2112 2094
2113 See <file:Documentation/networking/NAPI_HOWTO.txt> for more
2114 information.
2115
2116 If in doubt, say N. 2095 If in doubt, say N.
2117 2096
2118config R8169_VLAN 2097config R8169_VLAN
@@ -2364,7 +2343,7 @@ config GIANFAR
2364 and MPC86xx family of chips, and the FEC on the 8540. 2343 and MPC86xx family of chips, and the FEC on the 8540.
2365 2344
2366config GFAR_NAPI 2345config GFAR_NAPI
2367 bool "NAPI Support" 2346 bool "Use Rx Polling (NAPI)"
2368 depends on GIANFAR 2347 depends on GIANFAR
2369 2348
2370config UCC_GETH 2349config UCC_GETH
@@ -2376,7 +2355,7 @@ config UCC_GETH
2376 which is available on some Freescale SOCs. 2355 which is available on some Freescale SOCs.
2377 2356
2378config UGETH_NAPI 2357config UGETH_NAPI
2379 bool "NAPI Support" 2358 bool "Use Rx Polling (NAPI)"
2380 depends on UCC_GETH 2359 depends on UCC_GETH
2381 2360
2382config UGETH_MAGIC_PACKET 2361config UGETH_MAGIC_PACKET
@@ -2494,7 +2473,7 @@ config CHELSIO_T3
2494 2473
2495config EHEA 2474config EHEA
2496 tristate "eHEA Ethernet support" 2475 tristate "eHEA Ethernet support"
2497 depends on IBMEBUS 2476 depends on IBMEBUS && INET
2498 select INET_LRO 2477 select INET_LRO
2499 ---help--- 2478 ---help---
2500 This driver supports the IBM pSeries eHEA ethernet adapter. 2479 This driver supports the IBM pSeries eHEA ethernet adapter.
@@ -2559,9 +2538,6 @@ config IXGB_NAPI
2559 deployed on potentially unfriendly networks (e.g. in a firewall), 2538 deployed on potentially unfriendly networks (e.g. in a firewall),
2560 then say Y here. 2539 then say Y here.
2561 2540
2562 See <file:Documentation/networking/NAPI_HOWTO.txt> for more
2563 information.
2564
2565 If in doubt, say N. 2541 If in doubt, say N.
2566 2542
2567config S2IO 2543config S2IO
@@ -2584,14 +2560,11 @@ config S2IO_NAPI
2584 deployed on potentially unfriendly networks (e.g. in a firewall), 2560 deployed on potentially unfriendly networks (e.g. in a firewall),
2585 then say Y here. 2561 then say Y here.
2586 2562
2587 See <file:Documentation/networking/NAPI_HOWTO.txt> for more
2588 information.
2589
2590 If in doubt, say N. 2563 If in doubt, say N.
2591 2564
2592config MYRI10GE 2565config MYRI10GE
2593 tristate "Myricom Myri-10G Ethernet support" 2566 tristate "Myricom Myri-10G Ethernet support"
2594 depends on PCI 2567 depends on PCI && INET
2595 select FW_LOADER 2568 select FW_LOADER
2596 select CRC32 2569 select CRC32
2597 select INET_LRO 2570 select INET_LRO
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index 1cc74ec88a5..eebf5bb2b03 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -1111,7 +1111,7 @@ static struct net_device_stats *amd8111e_get_stats(struct net_device * dev)
1111 1111
1112 return new_stats; 1112 return new_stats;
1113} 1113}
1114/* This function recalculate the interupt coalescing mode on every interrupt 1114/* This function recalculate the interrupt coalescing mode on every interrupt
1115according to the datarate and the packet rate. 1115according to the datarate and the packet rate.
1116*/ 1116*/
1117static int amd8111e_calc_coalesce(struct net_device *dev) 1117static int amd8111e_calc_coalesce(struct net_device *dev)
diff --git a/drivers/net/ariadne.c b/drivers/net/ariadne.c
index 3fa3bccd1ad..10f3a196be3 100644
--- a/drivers/net/ariadne.c
+++ b/drivers/net/ariadne.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Amiga Linux/m68k Ariadne Ethernet Driver 2 * Amiga Linux/m68k Ariadne Ethernet Driver
3 * 3 *
4 * © Copyright 1995-2003 by Geert Uytterhoeven (geert@linux-m68k.org) 4 * © Copyright 1995-2003 by Geert Uytterhoeven (geert@linux-m68k.org)
5 * Peter De Schrijver (p2@mind.be) 5 * Peter De Schrijver (p2@mind.be)
6 * 6 *
7 * --------------------------------------------------------------------------- 7 * ---------------------------------------------------------------------------
diff --git a/drivers/net/ariadne.h b/drivers/net/ariadne.h
index f7913d5a39f..bb613f292e0 100644
--- a/drivers/net/ariadne.h
+++ b/drivers/net/ariadne.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Amiga Linux/m68k Ariadne Ethernet Driver 2 * Amiga Linux/m68k Ariadne Ethernet Driver
3 * 3 *
4 * © Copyright 1995 by Geert Uytterhoeven (geert@linux-m68k.org) 4 * © Copyright 1995 by Geert Uytterhoeven (geert@linux-m68k.org)
5 * Peter De Schrijver 5 * Peter De Schrijver
6 * (Peter.DeSchrijver@linux.cc.kuleuven.ac.be) 6 * (Peter.DeSchrijver@linux.cc.kuleuven.ac.be)
7 * 7 *
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 185f98e3964..504b7ce2747 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -542,7 +542,7 @@ static struct {
542static int num_ifs; 542static int num_ifs;
543 543
544/* 544/*
545 * Setup the base address and interupt of the Au1xxx ethernet macs 545 * Setup the base address and interrupt of the Au1xxx ethernet macs
546 * based on cpu type and whether the interface is enabled in sys_pinfunc 546 * based on cpu type and whether the interface is enabled in sys_pinfunc
547 * register. The last interface is enabled if SYS_PF_NI2 (bit 4) is 0. 547 * register. The last interface is enabled if SYS_PF_NI2 (bit 4) is 0.
548 */ 548 */
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 80c0c8c415e..855dc10ffa1 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -55,7 +55,7 @@ static int expected_refcount = -1;
55static struct class *netdev_class; 55static struct class *netdev_class;
56/*--------------------------- Data Structures -----------------------------*/ 56/*--------------------------- Data Structures -----------------------------*/
57 57
58/* Bonding sysfs lock. Why can't we just use the subsytem lock? 58/* Bonding sysfs lock. Why can't we just use the subsystem lock?
59 * Because kobject_register tries to acquire the subsystem lock. If 59 * Because kobject_register tries to acquire the subsystem lock. If
60 * we already hold the lock (which we would if the user was creating 60 * we already hold the lock (which we would if the user was creating
61 * a new bond through the sysfs interface), we deadlock. 61 * a new bond through the sysfs interface), we deadlock.
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 27ac010900a..3286d2a0a87 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -542,7 +542,8 @@ dm9000_probe(struct platform_device *pdev)
542 542
543 if (id_val != DM9000_ID) { 543 if (id_val != DM9000_ID) {
544 printk("%s: wrong id: 0x%08x\n", CARDNAME, id_val); 544 printk("%s: wrong id: 0x%08x\n", CARDNAME, id_val);
545 goto release; 545 ret = -ENODEV;
546 goto out;
546 } 547 }
547 548
548 /* from this point we assume that we have found a DM9000 */ 549 /* from this point we assume that we have found a DM9000 */
@@ -602,8 +603,7 @@ dm9000_probe(struct platform_device *pdev)
602 } 603 }
603 return 0; 604 return 0;
604 605
605 release: 606out:
606 out:
607 printk("%s: not found (%d).\n", CARDNAME, ret); 607 printk("%s: not found (%d).\n", CARDNAME, ret);
608 608
609 dm9000_release_board(pdev, db); 609 dm9000_release_board(pdev, db);
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 64f35e20fd4..3dbaec680b4 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1324,7 +1324,7 @@ static inline int e100_exec_cb_wait(struct nic *nic, struct sk_buff *skb,
1324 if (!--counter) break; 1324 if (!--counter) break;
1325 } 1325 }
1326 1326
1327 /* ack any interupts, something could have been set */ 1327 /* ack any interrupts, something could have been set */
1328 iowrite8(~0, &nic->csr->scb.stat_ack); 1328 iowrite8(~0, &nic->csr->scb.stat_ack);
1329 1329
1330 /* if the command failed, or is not OK, notify and return */ 1330 /* if the command failed, or is not OK, notify and return */
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 047263830e6..f1ce348470c 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3590,7 +3590,7 @@ e1000_update_stats(struct e1000_adapter *adapter)
3590 3590
3591 spin_lock_irqsave(&adapter->stats_lock, flags); 3591 spin_lock_irqsave(&adapter->stats_lock, flags);
3592 3592
3593 /* these counters are modified from e1000_adjust_tbi_stats, 3593 /* these counters are modified from e1000_tbi_adjust_stats,
3594 * called from the interrupt context, so they must only 3594 * called from the interrupt context, so they must only
3595 * be written while holding adapter->stats_lock 3595 * be written while holding adapter->stats_lock
3596 */ 3596 */
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index 43f7647ff24..7bb9c728a1d 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -111,7 +111,6 @@ MODULE_AUTHOR("Myson or whoever");
111MODULE_DESCRIPTION("Myson MTD-8xx 100/10M Ethernet PCI Adapter Driver"); 111MODULE_DESCRIPTION("Myson MTD-8xx 100/10M Ethernet PCI Adapter Driver");
112MODULE_LICENSE("GPL"); 112MODULE_LICENSE("GPL");
113module_param(max_interrupt_work, int, 0); 113module_param(max_interrupt_work, int, 0);
114//MODULE_PARM(min_pci_latency, "i");
115module_param(debug, int, 0); 114module_param(debug, int, 0);
116module_param(rx_copybreak, int, 0); 115module_param(rx_copybreak, int, 0);
117module_param(multicast_filter_limit, int, 0); 116module_param(multicast_filter_limit, int, 0);
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index ad9e327c3b0..e0119f6a331 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -3,7 +3,7 @@
3 * devices like TTY. It interfaces between a raw TTY and the 3 * devices like TTY. It interfaces between a raw TTY and the
4 * kernel's AX.25 protocol layers. 4 * kernel's AX.25 protocol layers.
5 * 5 *
6 * Authors: Andreas Könsgen <ajk@iehk.rwth-aachen.de> 6 * Authors: Andreas Könsgen <ajk@iehk.rwth-aachen.de>
7 * Ralf Baechle DL5RB <ralf@linux-mips.org> 7 * Ralf Baechle DL5RB <ralf@linux-mips.org>
8 * 8 *
9 * Quite a lot of stuff "stolen" by Joerg Reuter from slip.c, written by 9 * Quite a lot of stuff "stolen" by Joerg Reuter from slip.c, written by
diff --git a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig
index 36d2c7d4f4d..62d5d5cfd6a 100644
--- a/drivers/net/hamradio/Kconfig
+++ b/drivers/net/hamradio/Kconfig
@@ -64,7 +64,7 @@ config DMASCC
64 dmascc. If you don't pass any parameter to the driver, all 64 dmascc. If you don't pass any parameter to the driver, all
65 possible I/O addresses are probed. This could irritate other devices 65 possible I/O addresses are probed. This could irritate other devices
66 that are currently not in use. You may specify the list of addresses 66 that are currently not in use. You may specify the list of addresses
67 to be probed by "dmascc=addr1,addr2,..." (when compiled into the 67 to be probed by "dmascc.io=addr1,addr2,..." (when compiled into the
68 kernel image) or "io=addr1,addr2,..." (when loaded as a module). The 68 kernel image) or "io=addr1,addr2,..." (when loaded as a module). The
69 network interfaces will be called dmascc0 and dmascc1 for the board 69 network interfaces will be called dmascc0 and dmascc1 for the board
70 detected first, dmascc2 and dmascc3 for the second one, and so on. 70 detected first, dmascc2 and dmascc3 for the second one, and so on.
diff --git a/drivers/net/irda/actisys-sir.c b/drivers/net/irda/actisys-sir.c
index ccf6ec548a6..736d2473b7e 100644
--- a/drivers/net/irda/actisys-sir.c
+++ b/drivers/net/irda/actisys-sir.c
@@ -21,7 +21,7 @@
21 * published by the Free Software Foundation; either version 2 of 21 * published by the Free Software Foundation; either version 2 of
22 * the License, or (at your option) any later version. 22 * the License, or (at your option) any later version.
23 * 23 *
24 * Neither Dag Brattli nor University of Tromsø admit liability nor 24 * Neither Dag Brattli nor University of Tromsø admit liability nor
25 * provide warranty for any of this software. This material is 25 * provide warranty for any of this software. This material is
26 * provided "AS-IS" and at no charge. 26 * provided "AS-IS" and at no charge.
27 * 27 *
diff --git a/drivers/net/irda/actisys.c b/drivers/net/irda/actisys.c
index b2e31f4a384..ae0b80a5680 100644
--- a/drivers/net/irda/actisys.c
+++ b/drivers/net/irda/actisys.c
@@ -19,7 +19,7 @@
19 * published by the Free Software Foundation; either version 2 of 19 * published by the Free Software Foundation; either version 2 of
20 * the License, or (at your option) any later version. 20 * the License, or (at your option) any later version.
21 * 21 *
22 * Neither Dag Brattli nor University of Tromsø admit liability nor 22 * Neither Dag Brattli nor University of Tromsø admit liability nor
23 * provide warranty for any of this software. This material is 23 * provide warranty for any of this software. This material is
24 * provided "AS-IS" and at no charge. 24 * provided "AS-IS" and at no charge.
25 * 25 *
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index a82d8f98383..1257e1a7e81 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -595,7 +595,7 @@ toshoboe_startchip (struct toshoboe_cb *self)
595 OUTB ((physaddr >> 18) & 0xff, OBOE_RING_BASE1); 595 OUTB ((physaddr >> 18) & 0xff, OBOE_RING_BASE1);
596 OUTB ((physaddr >> 26) & 0x3f, OBOE_RING_BASE2); 596 OUTB ((physaddr >> 26) & 0x3f, OBOE_RING_BASE2);
597 597
598 /*Enable DMA controler in byte mode and RX */ 598 /*Enable DMA controller in byte mode and RX */
599 OUTB (CONFIG0H_DMA_ON, OBOE_CONFIG0H); 599 OUTB (CONFIG0H_DMA_ON, OBOE_CONFIG0H);
600 600
601 /* Start up the clocks */ 601 /* Start up the clocks */
diff --git a/drivers/net/irda/girbil-sir.c b/drivers/net/irda/girbil-sir.c
index 0d2fe87fb9b..738531b16bd 100644
--- a/drivers/net/irda/girbil-sir.c
+++ b/drivers/net/irda/girbil-sir.c
@@ -16,7 +16,7 @@
16 * published by the Free Software Foundation; either version 2 of 16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version. 17 * the License, or (at your option) any later version.
18 * 18 *
19 * Neither Dag Brattli nor University of Tromsø admit liability nor 19 * Neither Dag Brattli nor University of Tromsø admit liability nor
20 * provide warranty for any of this software. This material is 20 * provide warranty for any of this software. This material is
21 * provided "AS-IS" and at no charge. 21 * provided "AS-IS" and at no charge.
22 * 22 *
diff --git a/drivers/net/irda/girbil.c b/drivers/net/irda/girbil.c
index 248aeb0c726..1f57391a618 100644
--- a/drivers/net/irda/girbil.c
+++ b/drivers/net/irda/girbil.c
@@ -16,7 +16,7 @@
16 * published by the Free Software Foundation; either version 2 of 16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version. 17 * the License, or (at your option) any later version.
18 * 18 *
19 * Neither Dag Brattli nor University of Tromsø admit liability nor 19 * Neither Dag Brattli nor University of Tromsø admit liability nor
20 * provide warranty for any of this software. This material is 20 * provide warranty for any of this software. This material is
21 * provided "AS-IS" and at no charge. 21 * provided "AS-IS" and at no charge.
22 * 22 *
diff --git a/drivers/net/irda/irport.h b/drivers/net/irda/irport.h
index 3f46b84c6c8..66fc2433e97 100644
--- a/drivers/net/irda/irport.h
+++ b/drivers/net/irda/irport.h
@@ -17,7 +17,7 @@
17 * published by the Free Software Foundation; either version 2 of 17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version. 18 * the License, or (at your option) any later version.
19 * 19 *
20 * Neither Dag Brattli nor University of Tromsø admit liability nor 20 * Neither Dag Brattli nor University of Tromsø admit liability nor
21 * provide warranty for any of this software. This material is 21 * provide warranty for any of this software. This material is
22 * provided "AS-IS" and at no charge. 22 * provided "AS-IS" and at no charge.
23 * 23 *
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c
index 6f5f697ec9f..2c6f7be36e8 100644
--- a/drivers/net/irda/irtty-sir.c
+++ b/drivers/net/irda/irtty-sir.c
@@ -20,7 +20,7 @@
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * Neither Dag Brattli nor University of Tromsø admit liability nor 23 * Neither Dag Brattli nor University of Tromsø admit liability nor
24 * provide warranty for any of this software. This material is 24 * provide warranty for any of this software. This material is
25 * provided "AS-IS" and at no charge. 25 * provided "AS-IS" and at no charge.
26 * 26 *
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index 12b9378c587..a873d2b315c 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -20,7 +20,7 @@
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * Neither Dag Brattli nor University of Tromsø admit liability nor 23 * Neither Dag Brattli nor University of Tromsø admit liability nor
24 * provide warranty for any of this software. This material is 24 * provide warranty for any of this software. This material is
25 * provided "AS-IS" and at no charge. 25 * provided "AS-IS" and at no charge.
26 * 26 *
diff --git a/drivers/net/irda/nsc-ircc.h b/drivers/net/irda/nsc-ircc.h
index dacf671abcd..bbdc97ff83c 100644
--- a/drivers/net/irda/nsc-ircc.h
+++ b/drivers/net/irda/nsc-ircc.h
@@ -19,7 +19,7 @@
19 * published by the Free Software Foundation; either version 2 of 19 * published by the Free Software Foundation; either version 2 of
20 * the License, or (at your option) any later version. 20 * the License, or (at your option) any later version.
21 * 21 *
22 * Neither Dag Brattli nor University of Tromsø admit liability nor 22 * Neither Dag Brattli nor University of Tromsø admit liability nor
23 * provide warranty for any of this software. This material is 23 * provide warranty for any of this software. This material is
24 * provided "AS-IS" and at no charge. 24 * provided "AS-IS" and at no charge.
25 * 25 *
diff --git a/drivers/net/irda/tekram-sir.c b/drivers/net/irda/tekram-sir.c
index 0dd6bc7af3f..d1ce5ae6a17 100644
--- a/drivers/net/irda/tekram-sir.c
+++ b/drivers/net/irda/tekram-sir.c
@@ -18,7 +18,7 @@
18 * published by the Free Software Foundation; either version 2 of 18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) any later version. 19 * the License, or (at your option) any later version.
20 * 20 *
21 * Neither Dag Brattli nor University of Tromsø admit liability nor 21 * Neither Dag Brattli nor University of Tromsø admit liability nor
22 * provide warranty for any of this software. This material is 22 * provide warranty for any of this software. This material is
23 * provided "AS-IS" and at no charge. 23 * provided "AS-IS" and at no charge.
24 * 24 *
diff --git a/drivers/net/irda/tekram.c b/drivers/net/irda/tekram.c
index 8f6258221cb..9bfd2441adb 100644
--- a/drivers/net/irda/tekram.c
+++ b/drivers/net/irda/tekram.c
@@ -16,7 +16,7 @@
16 * published by the Free Software Foundation; either version 2 of 16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version. 17 * the License, or (at your option) any later version.
18 * 18 *
19 * Neither Dag Brattli nor University of Tromsø admit liability nor 19 * Neither Dag Brattli nor University of Tromsø admit liability nor
20 * provide warranty for any of this software. This material is 20 * provide warranty for any of this software. This material is
21 * provided "AS-IS" and at no charge. 21 * provided "AS-IS" and at no charge.
22 * 22 *
diff --git a/drivers/net/irda/w83977af_ir.h b/drivers/net/irda/w83977af_ir.h
index 0b7661deafe..87c3975baf6 100644
--- a/drivers/net/irda/w83977af_ir.h
+++ b/drivers/net/irda/w83977af_ir.h
@@ -16,7 +16,7 @@
16 * published by the Free Software Foundation; either version 2 of 16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version. 17 * the License, or (at your option) any later version.
18 * 18 *
19 * Neither Dag Brattli nor University of Tromsø admit liability nor 19 * Neither Dag Brattli nor University of Tromsø admit liability nor
20 * provide warranty for any of this software. This material is 20 * provide warranty for any of this software. This material is
21 * provided "AS-IS" and at no charge. 21 * provided "AS-IS" and at no charge.
22 * 22 *
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 50e1ec67ef9..953117152bb 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -996,7 +996,7 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
996 a delay. Note that pre-2.0.34 kernels had a cache-alignment bug that 996 a delay. Note that pre-2.0.34 kernels had a cache-alignment bug that
997 made udelay() unreliable. 997 made udelay() unreliable.
998 The old method of using an ISA access as a delay, __SLOW_DOWN_IO__, is 998 The old method of using an ISA access as a delay, __SLOW_DOWN_IO__, is
999 depricated. 999 deprecated.
1000*/ 1000*/
1001#define eeprom_delay(ee_addr) readl(ee_addr) 1001#define eeprom_delay(ee_addr) readl(ee_addr)
1002 1002
diff --git a/drivers/net/phy/mdio-bitbang.c b/drivers/net/phy/mdio-bitbang.c
index 8cd243d92af..2747b1f89ff 100644
--- a/drivers/net/phy/mdio-bitbang.c
+++ b/drivers/net/phy/mdio-bitbang.c
@@ -185,3 +185,5 @@ void free_mdio_bitbang(struct mii_bus *bus)
185 module_put(ctrl->ops->owner); 185 module_put(ctrl->ops->owner);
186 kfree(bus); 186 kfree(bus);
187} 187}
188
189MODULE_LICENSE("GPL");
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 7c60df46fc6..dd18af0ce67 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -1223,7 +1223,7 @@ static irqreturn_t smc911x_interrupt(int irq, void *dev_id)
1223 } 1223 }
1224#endif 1224#endif
1225 1225
1226 /* Handle PHY interupt condition */ 1226 /* Handle PHY interrupt condition */
1227 if (status & INT_STS_PHY_INT_) { 1227 if (status & INT_STS_PHY_INT_) {
1228 DBG(SMC_DEBUG_MISC, "%s: PHY irq\n", dev->name); 1228 DBG(SMC_DEBUG_MISC, "%s: PHY irq\n", dev->name);
1229 smc911x_phy_interrupt(dev); 1229 smc911x_phy_interrupt(dev);
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 571060a3c91..bccae7e5c6a 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -1639,7 +1639,7 @@ spider_net_handle_error_irq(struct spider_net_card *card, u32 status_reg)
1639 1639
1640/** 1640/**
1641 * spider_net_interrupt - interrupt handler for spider_net 1641 * spider_net_interrupt - interrupt handler for spider_net
1642 * @irq: interupt number 1642 * @irq: interrupt number
1643 * @ptr: pointer to net_device 1643 * @ptr: pointer to net_device
1644 * @regs: PU registers 1644 * @regs: PU registers
1645 * 1645 *
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index 8038f2882c9..d887c05588d 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -1654,7 +1654,7 @@ tc35815_rx(struct net_device *dev)
1654 panic_queues(dev); 1654 panic_queues(dev);
1655 } 1655 }
1656#endif 1656#endif
1657 /* pass BD to controler */ 1657 /* pass BD to controller */
1658#ifndef TC35815_USE_PACKEDBUFFER 1658#ifndef TC35815_USE_PACKEDBUFFER
1659 if (!lp->rx_skbs[curid].skb) { 1659 if (!lp->rx_skbs[curid].skb) {
1660 lp->rx_skbs[curid].skb = 1660 lp->rx_skbs[curid].skb =
@@ -1694,7 +1694,7 @@ tc35815_rx(struct net_device *dev)
1694 } 1694 }
1695#endif 1695#endif
1696 for (i = 0; i < (bd_count + 1) / 2 + 1; i++) { 1696 for (i = 0; i < (bd_count + 1) / 2 + 1; i++) {
1697 /* pass FD to controler */ 1697 /* pass FD to controller */
1698#ifdef DEBUG 1698#ifdef DEBUG
1699 lp->rfd_cur->fd.FDNext = cpu_to_le32(0xdeaddead); 1699 lp->rfd_cur->fd.FDNext = cpu_to_le32(0xdeaddead);
1700#else 1700#else
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c
index df10af7df7b..35d15e85007 100644
--- a/drivers/net/tsi108_eth.c
+++ b/drivers/net/tsi108_eth.c
@@ -1629,7 +1629,7 @@ tsi108_init_one(struct platform_device *pdev)
1629 goto register_fail; 1629 goto register_fail;
1630 } 1630 }
1631 1631
1632 printk(KERN_INFO "%s: Tsi108 Gigabit Ethernet, MAC: %s\n" 1632 printk(KERN_INFO "%s: Tsi108 Gigabit Ethernet, MAC: %s\n",
1633 dev->name, print_mac(mac, dev->dev_addr)); 1633 dev->name, print_mac(mac, dev->dev_addr));
1634#ifdef DEBUG 1634#ifdef DEBUG
1635 data->msg_enable = DEBUG; 1635 data->msg_enable = DEBUG;
diff --git a/drivers/net/tulip/Kconfig b/drivers/net/tulip/Kconfig
index 1c537d5a306..49d7a290dbb 100644
--- a/drivers/net/tulip/Kconfig
+++ b/drivers/net/tulip/Kconfig
@@ -67,7 +67,7 @@ config TULIP_MMIO
67 If in doubt, say N. 67 If in doubt, say N.
68 68
69config TULIP_NAPI 69config TULIP_NAPI
70 bool "Use NAPI RX polling " 70 bool "Use RX polling (NAPI)"
71 depends on TULIP 71 depends on TULIP
72 help 72 help
73 NAPI is a new driver API designed to reduce CPU and interrupt load 73 NAPI is a new driver API designed to reduce CPU and interrupt load
@@ -78,18 +78,16 @@ config TULIP_NAPI
78 deployed on potentially unfriendly networks (e.g. in a firewall), 78 deployed on potentially unfriendly networks (e.g. in a firewall),
79 then say Y here. 79 then say Y here.
80 80
81 See <file:Documentation/networking/NAPI_HOWTO.txt> for more
82 information.
83
84 If in doubt, say N. 81 If in doubt, say N.
85 82
86config TULIP_NAPI_HW_MITIGATION 83config TULIP_NAPI_HW_MITIGATION
87 bool "Use Interrupt Mitigation " 84 bool "Use Interrupt Mitigation"
88 depends on TULIP_NAPI 85 depends on TULIP_NAPI
89 ---help--- 86 ---help---
90 Use HW to reduce RX interrupts. Not strict necessary since NAPI reduces 87 Use HW to reduce RX interrupts. Not strictly necessary since NAPI
91 RX interrupts but itself. Although this reduces RX interrupts even at 88 reduces RX interrupts by itself. Interrupt mitigation reduces RX
92 low levels traffic at the cost of a small latency. 89 interrupts even at low levels of traffic at the cost of a small
90 latency.
93 91
94 If in doubt, say Y. 92 If in doubt, say Y.
95 93
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index 3c8e3b63be0..35d0cfcf8c4 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -483,7 +483,7 @@ err_out_netdev:
483 a delay. Note that pre-2.0.34 kernels had a cache-alignment bug that 483 a delay. Note that pre-2.0.34 kernels had a cache-alignment bug that
484 made udelay() unreliable. 484 made udelay() unreliable.
485 The old method of using an ISA access as a delay, __SLOW_DOWN_IO__, is 485 The old method of using an ISA access as a delay, __SLOW_DOWN_IO__, is
486 depricated. 486 deprecated.
487*/ 487*/
488#define eeprom_delay(ee_addr) ioread32(ee_addr) 488#define eeprom_delay(ee_addr) ioread32(ee_addr)
489 489
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig
index 8dc09a3790c..5a96d74e4ce 100644
--- a/drivers/net/usb/Kconfig
+++ b/drivers/net/usb/Kconfig
@@ -71,7 +71,7 @@ config USB_PEGASUS
71 select MII 71 select MII
72 ---help--- 72 ---help---
73 Say Y here if you know you have Pegasus or Pegasus-II based adapter. 73 Say Y here if you know you have Pegasus or Pegasus-II based adapter.
74 If in doubt then look at <file:drivers/usb/net/pegasus.h> for the 74 If in doubt then look at <file:drivers/net/usb/pegasus.h> for the
75 complete list of supported devices. 75 complete list of supported devices.
76 76
77 If your particular adapter is not in the list and you are _sure_ it 77 If your particular adapter is not in the list and you are _sure_ it
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 4ae05799ac4..5c4a92de9a0 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -1648,7 +1648,7 @@ static int velocity_alloc_rx_buf(struct velocity_info *vptr, int idx)
1648 * 1648 *
1649 * Scan the queues looking for transmitted packets that 1649 * Scan the queues looking for transmitted packets that
1650 * we can complete and clean up. Update any statistics as 1650 * we can complete and clean up. Update any statistics as
1651 * neccessary/ 1651 * necessary/
1652 */ 1652 */
1653 1653
1654static int velocity_tx_srv(struct velocity_info *vptr, u32 status) 1654static int velocity_tx_srv(struct velocity_info *vptr, u32 status)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index c141a264ac4..9d9ff76a9bc 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -49,7 +49,6 @@
49#include "pio.h" 49#include "pio.h"
50#include "sysfs.h" 50#include "sysfs.h"
51#include "xmit.h" 51#include "xmit.h"
52#include "sysfs.h"
53#include "lo.h" 52#include "lo.h"
54#include "pcmcia.h" 53#include "pcmcia.h"
55 54
@@ -3495,7 +3494,7 @@ static int b43_start(struct ieee80211_hw *hw)
3495 struct b43_wl *wl = hw_to_b43_wl(hw); 3494 struct b43_wl *wl = hw_to_b43_wl(hw);
3496 struct b43_wldev *dev = wl->current_dev; 3495 struct b43_wldev *dev = wl->current_dev;
3497 int did_init = 0; 3496 int did_init = 0;
3498 int err; 3497 int err = 0;
3499 3498
3500 mutex_lock(&wl->mutex); 3499 mutex_lock(&wl->mutex);
3501 3500
@@ -3521,7 +3520,7 @@ static int b43_start(struct ieee80211_hw *hw)
3521 return err; 3520 return err;
3522} 3521}
3523 3522
3524void b43_stop(struct ieee80211_hw *hw) 3523static void b43_stop(struct ieee80211_hw *hw)
3525{ 3524{
3526 struct b43_wl *wl = hw_to_b43_wl(hw); 3525 struct b43_wl *wl = hw_to_b43_wl(hw);
3527 struct b43_wldev *dev = wl->current_dev; 3526 struct b43_wldev *dev = wl->current_dev;
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index f0749510bcd..d09479e816c 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -3306,7 +3306,7 @@ static int b43legacy_start(struct ieee80211_hw *hw)
3306 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); 3306 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
3307 struct b43legacy_wldev *dev = wl->current_dev; 3307 struct b43legacy_wldev *dev = wl->current_dev;
3308 int did_init = 0; 3308 int did_init = 0;
3309 int err; 3309 int err = 0;
3310 3310
3311 mutex_lock(&wl->mutex); 3311 mutex_lock(&wl->mutex);
3312 3312
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_xmit.h b/drivers/net/wireless/bcm43xx/bcm43xx_xmit.h
index 9ecf2bf0d25..47c135a7f4d 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_xmit.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_xmit.h
@@ -87,7 +87,7 @@ void bcm43xx_generate_txhdr(struct bcm43xx_private *bcm,
87 87
88/* RX header as received from the hardware. */ 88/* RX header as received from the hardware. */
89struct bcm43xx_rxhdr { 89struct bcm43xx_rxhdr {
90 /* Frame Length. Must be generated explicitely in PIO mode. */ 90 /* Frame Length. Must be generated explicitly in PIO mode. */
91 __le16 frame_length; 91 __le16 frame_length;
92 PAD_BYTES(2); 92 PAD_BYTES(2);
93 /* Flags field 1 */ 93 /* Flags field 1 */
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index c144e3cdb89..a6c7904de28 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -2089,12 +2089,46 @@ static void isr_indicate_rf_kill(struct ipw2100_priv *priv, u32 status)
2089 queue_delayed_work(priv->workqueue, &priv->rf_kill, round_jiffies(HZ)); 2089 queue_delayed_work(priv->workqueue, &priv->rf_kill, round_jiffies(HZ));
2090} 2090}
2091 2091
2092static void send_scan_event(void *data)
2093{
2094 struct ipw2100_priv *priv = data;
2095 union iwreq_data wrqu;
2096
2097 wrqu.data.length = 0;
2098 wrqu.data.flags = 0;
2099 wireless_send_event(priv->net_dev, SIOCGIWSCAN, &wrqu, NULL);
2100}
2101
2102static void ipw2100_scan_event_later(struct work_struct *work)
2103{
2104 send_scan_event(container_of(work, struct ipw2100_priv,
2105 scan_event_later.work));
2106}
2107
2108static void ipw2100_scan_event_now(struct work_struct *work)
2109{
2110 send_scan_event(container_of(work, struct ipw2100_priv,
2111 scan_event_now));
2112}
2113
2092static void isr_scan_complete(struct ipw2100_priv *priv, u32 status) 2114static void isr_scan_complete(struct ipw2100_priv *priv, u32 status)
2093{ 2115{
2094 IPW_DEBUG_SCAN("scan complete\n"); 2116 IPW_DEBUG_SCAN("scan complete\n");
2095 /* Age the scan results... */ 2117 /* Age the scan results... */
2096 priv->ieee->scans++; 2118 priv->ieee->scans++;
2097 priv->status &= ~STATUS_SCANNING; 2119 priv->status &= ~STATUS_SCANNING;
2120
2121 /* Only userspace-requested scan completion events go out immediately */
2122 if (!priv->user_requested_scan) {
2123 if (!delayed_work_pending(&priv->scan_event_later))
2124 queue_delayed_work(priv->workqueue,
2125 &priv->scan_event_later,
2126 round_jiffies(msecs_to_jiffies(4000)));
2127 } else {
2128 priv->user_requested_scan = 0;
2129 cancel_delayed_work(&priv->scan_event_later);
2130 queue_work(priv->workqueue, &priv->scan_event_now);
2131 }
2098} 2132}
2099 2133
2100#ifdef CONFIG_IPW2100_DEBUG 2134#ifdef CONFIG_IPW2100_DEBUG
@@ -4349,6 +4383,7 @@ static void ipw2100_kill_workqueue(struct ipw2100_priv *priv)
4349 cancel_delayed_work(&priv->wx_event_work); 4383 cancel_delayed_work(&priv->wx_event_work);
4350 cancel_delayed_work(&priv->hang_check); 4384 cancel_delayed_work(&priv->hang_check);
4351 cancel_delayed_work(&priv->rf_kill); 4385 cancel_delayed_work(&priv->rf_kill);
4386 cancel_delayed_work(&priv->scan_event_later);
4352 destroy_workqueue(priv->workqueue); 4387 destroy_workqueue(priv->workqueue);
4353 priv->workqueue = NULL; 4388 priv->workqueue = NULL;
4354 } 4389 }
@@ -6012,7 +6047,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
6012 * ends up causing problems. So, we just handle 6047 * ends up causing problems. So, we just handle
6013 * the WX extensions through the ipw2100_ioctl interface */ 6048 * the WX extensions through the ipw2100_ioctl interface */
6014 6049
6015 /* memset() puts everything to 0, so we only have explicitely set 6050 /* memset() puts everything to 0, so we only have explicitly set
6016 * those values that need to be something else */ 6051 * those values that need to be something else */
6017 6052
6018 /* If power management is turned on, default to AUTO mode */ 6053 /* If power management is turned on, default to AUTO mode */
@@ -6092,6 +6127,8 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
6092 INIT_DELAYED_WORK(&priv->wx_event_work, ipw2100_wx_event_work); 6127 INIT_DELAYED_WORK(&priv->wx_event_work, ipw2100_wx_event_work);
6093 INIT_DELAYED_WORK(&priv->hang_check, ipw2100_hang_check); 6128 INIT_DELAYED_WORK(&priv->hang_check, ipw2100_hang_check);
6094 INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill); 6129 INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill);
6130 INIT_WORK(&priv->scan_event_now, ipw2100_scan_event_now);
6131 INIT_DELAYED_WORK(&priv->scan_event_later, ipw2100_scan_event_later);
6095 6132
6096 tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) 6133 tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
6097 ipw2100_irq_tasklet, (unsigned long)priv); 6134 ipw2100_irq_tasklet, (unsigned long)priv);
@@ -7396,6 +7433,8 @@ static int ipw2100_wx_set_scan(struct net_device *dev,
7396 } 7433 }
7397 7434
7398 IPW_DEBUG_WX("Initiating scan...\n"); 7435 IPW_DEBUG_WX("Initiating scan...\n");
7436
7437 priv->user_requested_scan = 1;
7399 if (ipw2100_set_scan_options(priv) || ipw2100_start_scan(priv)) { 7438 if (ipw2100_set_scan_options(priv) || ipw2100_start_scan(priv)) {
7400 IPW_DEBUG_WX("Start scan failed.\n"); 7439 IPW_DEBUG_WX("Start scan failed.\n");
7401 7440
@@ -7470,7 +7509,7 @@ static int ipw2100_wx_set_power(struct net_device *dev,
7470 switch (wrqu->power.flags & IW_POWER_MODE) { 7509 switch (wrqu->power.flags & IW_POWER_MODE) {
7471 case IW_POWER_ON: /* If not specified */ 7510 case IW_POWER_ON: /* If not specified */
7472 case IW_POWER_MODE: /* If set all mask */ 7511 case IW_POWER_MODE: /* If set all mask */
7473 case IW_POWER_ALL_R: /* If explicitely state all */ 7512 case IW_POWER_ALL_R: /* If explicitly state all */
7474 break; 7513 break;
7475 default: /* Otherwise we don't support it */ 7514 default: /* Otherwise we don't support it */
7476 IPW_DEBUG_WX("SET PM Mode: %X not supported.\n", 7515 IPW_DEBUG_WX("SET PM Mode: %X not supported.\n",
diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h
index 2b8be2418fa..bbf1ddcafba 100644
--- a/drivers/net/wireless/ipw2100.h
+++ b/drivers/net/wireless/ipw2100.h
@@ -586,6 +586,10 @@ struct ipw2100_priv {
586 struct delayed_work wx_event_work; 586 struct delayed_work wx_event_work;
587 struct delayed_work hang_check; 587 struct delayed_work hang_check;
588 struct delayed_work rf_kill; 588 struct delayed_work rf_kill;
589 struct work_struct scan_event_now;
590 struct delayed_work scan_event_later;
591
592 int user_requested_scan;
589 593
590 u32 interrupts; 594 u32 interrupts;
591 int tx_interrupts; 595 int tx_interrupts;
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index feb8fcbab2d..e3c828401b9 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -9603,7 +9603,7 @@ static int ipw_wx_set_power(struct net_device *dev,
9603 switch (wrqu->power.flags & IW_POWER_MODE) { 9603 switch (wrqu->power.flags & IW_POWER_MODE) {
9604 case IW_POWER_ON: /* If not specified */ 9604 case IW_POWER_ON: /* If not specified */
9605 case IW_POWER_MODE: /* If set all mask */ 9605 case IW_POWER_MODE: /* If set all mask */
9606 case IW_POWER_ALL_R: /* If explicitely state all */ 9606 case IW_POWER_ALL_R: /* If explicitly state all */
9607 break; 9607 break;
9608 default: /* Otherwise we don't support it */ 9608 default: /* Otherwise we don't support it */
9609 IPW_DEBUG_WX("SET PM Mode: %X not supported.\n", 9609 IPW_DEBUG_WX("SET PM Mode: %X not supported.\n",
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index f4aabcf480e..262ab0b5582 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -37,9 +37,6 @@
37 37
38#include <linux/workqueue.h> 38#include <linux/workqueue.h>
39 39
40#include <net/mac80211.h>
41#include <linux/wireless.h>
42
43#define IWL 3945 40#define IWL 3945
44 41
45#include "../net/mac80211/ieee80211_rate.h" 42#include "../net/mac80211/ieee80211_rate.h"
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index acb38750535..19bcb01e278 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -38,7 +38,6 @@
38#include <net/mac80211.h> 38#include <net/mac80211.h>
39 39
40#include <linux/etherdevice.h> 40#include <linux/etherdevice.h>
41#include <linux/delay.h>
42 41
43#define IWL 3945 42#define IWL 3945
44 43
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index 287c75705c4..8dc78c0bf1f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -36,9 +36,6 @@
36 36
37#include <linux/workqueue.h> 37#include <linux/workqueue.h>
38 38
39#include <net/mac80211.h>
40#include <linux/wireless.h>
41
42#define IWL 4965 39#define IWL 4965
43 40
44#include "../net/mac80211/ieee80211_rate.h" 41#include "../net/mac80211/ieee80211_rate.h"
@@ -2024,12 +2021,18 @@ static int open_file_generic(struct inode *inode, struct file *file)
2024static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv, 2021static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
2025 struct iwl_rate *mcs, int index) 2022 struct iwl_rate *mcs, int index)
2026{ 2023{
2027 const u32 cck_rate = 0x820A; 2024 u32 base_rate;
2025
2026 if (rs_priv->phymode == (u8) MODE_IEEE80211A)
2027 base_rate = 0x800D;
2028 else
2029 base_rate = 0x820A;
2030
2028 if (rs_priv->dbg_fixed.rate_n_flags) { 2031 if (rs_priv->dbg_fixed.rate_n_flags) {
2029 if (index < 12) 2032 if (index < 12)
2030 mcs->rate_n_flags = rs_priv->dbg_fixed.rate_n_flags; 2033 mcs->rate_n_flags = rs_priv->dbg_fixed.rate_n_flags;
2031 else 2034 else
2032 mcs->rate_n_flags = cck_rate; 2035 mcs->rate_n_flags = base_rate;
2033 IWL_DEBUG_RATE("Fixed rate ON\n"); 2036 IWL_DEBUG_RATE("Fixed rate ON\n");
2034 return; 2037 return;
2035 } 2038 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index b50d20267c8..557deebca1b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -35,9 +35,7 @@
35#include <linux/netdevice.h> 35#include <linux/netdevice.h>
36#include <linux/wireless.h> 36#include <linux/wireless.h>
37#include <net/mac80211.h> 37#include <net/mac80211.h>
38#include <linux/netdevice.h>
39#include <linux/etherdevice.h> 38#include <linux/etherdevice.h>
40#include <linux/delay.h>
41 39
42#define IWL 4965 40#define IWL 4965
43 41
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 75e3b5c3f15..83019d1d7cc 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -48,8 +48,6 @@
48#include <linux/netdevice.h> 48#include <linux/netdevice.h>
49#include <linux/wireless.h> 49#include <linux/wireless.h>
50#include <linux/firmware.h> 50#include <linux/firmware.h>
51#include <linux/skbuff.h>
52#include <linux/netdevice.h>
53#include <linux/etherdevice.h> 51#include <linux/etherdevice.h>
54#include <linux/if_arp.h> 52#include <linux/if_arp.h>
55 53
@@ -1749,21 +1747,22 @@ static void iwl_unset_hw_setting(struct iwl_priv *priv)
1749 * return : set the bit for each supported rate insert in ie 1747 * return : set the bit for each supported rate insert in ie
1750 */ 1748 */
1751static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate, 1749static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate,
1752 u16 basic_rate, int max_count) 1750 u16 basic_rate, int *left)
1753{ 1751{
1754 u16 ret_rates = 0, bit; 1752 u16 ret_rates = 0, bit;
1755 int i; 1753 int i;
1756 u8 *rates; 1754 u8 *cnt = ie;
1757 1755 u8 *rates = ie + 1;
1758 rates = &(ie[1]);
1759 1756
1760 for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) { 1757 for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) {
1761 if (bit & supported_rate) { 1758 if (bit & supported_rate) {
1762 ret_rates |= bit; 1759 ret_rates |= bit;
1763 rates[*ie] = iwl_rates[i].ieee | 1760 rates[*cnt] = iwl_rates[i].ieee |
1764 ((bit & basic_rate) ? 0x80 : 0x00); 1761 ((bit & basic_rate) ? 0x80 : 0x00);
1765 *ie = *ie + 1; 1762 (*cnt)++;
1766 if (*ie >= max_count) 1763 (*left)--;
1764 if ((*left <= 0) ||
1765 (*cnt >= IWL_SUPPORTED_RATES_IE_LEN))
1767 break; 1766 break;
1768 } 1767 }
1769 } 1768 }
@@ -1780,7 +1779,7 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
1780{ 1779{
1781 int len = 0; 1780 int len = 0;
1782 u8 *pos = NULL; 1781 u8 *pos = NULL;
1783 u16 ret_rates; 1782 u16 active_rates, ret_rates, cck_rates;
1784 1783
1785 /* Make sure there is enough space for the probe request, 1784 /* Make sure there is enough space for the probe request,
1786 * two mandatory IEs and the data */ 1785 * two mandatory IEs and the data */
@@ -1825,19 +1824,27 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
1825 left -= 2; 1824 left -= 2;
1826 if (left < 0) 1825 if (left < 0)
1827 return 0; 1826 return 0;
1827
1828 /* ... fill it in... */ 1828 /* ... fill it in... */
1829 *pos++ = WLAN_EID_SUPP_RATES; 1829 *pos++ = WLAN_EID_SUPP_RATES;
1830 *pos = 0; 1830 *pos = 0;
1831 ret_rates = priv->active_rate = priv->rates_mask; 1831
1832 priv->active_rate = priv->rates_mask;
1833 active_rates = priv->active_rate;
1832 priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK; 1834 priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
1833 1835
1834 iwl_supported_rate_to_ie(pos, priv->active_rate, 1836 cck_rates = IWL_CCK_RATES_MASK & active_rates;
1835 priv->active_rate_basic, left); 1837 ret_rates = iwl_supported_rate_to_ie(pos, cck_rates,
1838 priv->active_rate_basic, &left);
1839 active_rates &= ~ret_rates;
1840
1841 ret_rates = iwl_supported_rate_to_ie(pos, active_rates,
1842 priv->active_rate_basic, &left);
1843 active_rates &= ~ret_rates;
1844
1836 len += 2 + *pos; 1845 len += 2 + *pos;
1837 pos += (*pos) + 1; 1846 pos += (*pos) + 1;
1838 ret_rates = ~ret_rates & priv->active_rate; 1847 if (active_rates == 0)
1839
1840 if (ret_rates == 0)
1841 goto fill_end; 1848 goto fill_end;
1842 1849
1843 /* fill in supported extended rate */ 1850 /* fill in supported extended rate */
@@ -1848,7 +1855,8 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
1848 /* ... fill it in... */ 1855 /* ... fill it in... */
1849 *pos++ = WLAN_EID_EXT_SUPP_RATES; 1856 *pos++ = WLAN_EID_EXT_SUPP_RATES;
1850 *pos = 0; 1857 *pos = 0;
1851 iwl_supported_rate_to_ie(pos, ret_rates, priv->active_rate_basic, left); 1858 iwl_supported_rate_to_ie(pos, active_rates,
1859 priv->active_rate_basic, &left);
1852 if (*pos > 0) 1860 if (*pos > 0)
1853 len += 2 + *pos; 1861 len += 2 + *pos;
1854 1862
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index b1a6e39f782..5e1279263b2 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -48,8 +48,6 @@
48#include <linux/netdevice.h> 48#include <linux/netdevice.h>
49#include <linux/wireless.h> 49#include <linux/wireless.h>
50#include <linux/firmware.h> 50#include <linux/firmware.h>
51#include <linux/skbuff.h>
52#include <linux/netdevice.h>
53#include <linux/etherdevice.h> 51#include <linux/etherdevice.h>
54#include <linux/if_arp.h> 52#include <linux/if_arp.h>
55 53
@@ -1802,21 +1800,22 @@ static void iwl_unset_hw_setting(struct iwl_priv *priv)
1802 * return : set the bit for each supported rate insert in ie 1800 * return : set the bit for each supported rate insert in ie
1803 */ 1801 */
1804static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate, 1802static u16 iwl_supported_rate_to_ie(u8 *ie, u16 supported_rate,
1805 u16 basic_rate, int max_count) 1803 u16 basic_rate, int *left)
1806{ 1804{
1807 u16 ret_rates = 0, bit; 1805 u16 ret_rates = 0, bit;
1808 int i; 1806 int i;
1809 u8 *rates; 1807 u8 *cnt = ie;
1810 1808 u8 *rates = ie + 1;
1811 rates = &(ie[1]);
1812 1809
1813 for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) { 1810 for (bit = 1, i = 0; i < IWL_RATE_COUNT; i++, bit <<= 1) {
1814 if (bit & supported_rate) { 1811 if (bit & supported_rate) {
1815 ret_rates |= bit; 1812 ret_rates |= bit;
1816 rates[*ie] = iwl_rates[i].ieee | 1813 rates[*cnt] = iwl_rates[i].ieee |
1817 ((bit & basic_rate) ? 0x80 : 0x00); 1814 ((bit & basic_rate) ? 0x80 : 0x00);
1818 *ie = *ie + 1; 1815 (*cnt)++;
1819 if (*ie >= max_count) 1816 (*left)--;
1817 if ((*left <= 0) ||
1818 (*cnt >= IWL_SUPPORTED_RATES_IE_LEN))
1820 break; 1819 break;
1821 } 1820 }
1822 } 1821 }
@@ -1839,7 +1838,7 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
1839{ 1838{
1840 int len = 0; 1839 int len = 0;
1841 u8 *pos = NULL; 1840 u8 *pos = NULL;
1842 u16 ret_rates; 1841 u16 active_rates, ret_rates, cck_rates;
1843 1842
1844 /* Make sure there is enough space for the probe request, 1843 /* Make sure there is enough space for the probe request,
1845 * two mandatory IEs and the data */ 1844 * two mandatory IEs and the data */
@@ -1884,19 +1883,27 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
1884 left -= 2; 1883 left -= 2;
1885 if (left < 0) 1884 if (left < 0)
1886 return 0; 1885 return 0;
1886
1887 /* ... fill it in... */ 1887 /* ... fill it in... */
1888 *pos++ = WLAN_EID_SUPP_RATES; 1888 *pos++ = WLAN_EID_SUPP_RATES;
1889 *pos = 0; 1889 *pos = 0;
1890 ret_rates = priv->active_rate = priv->rates_mask; 1890
1891 priv->active_rate = priv->rates_mask;
1892 active_rates = priv->active_rate;
1891 priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK; 1893 priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
1892 1894
1893 iwl_supported_rate_to_ie(pos, priv->active_rate, 1895 cck_rates = IWL_CCK_RATES_MASK & active_rates;
1894 priv->active_rate_basic, left); 1896 ret_rates = iwl_supported_rate_to_ie(pos, cck_rates,
1897 priv->active_rate_basic, &left);
1898 active_rates &= ~ret_rates;
1899
1900 ret_rates = iwl_supported_rate_to_ie(pos, active_rates,
1901 priv->active_rate_basic, &left);
1902 active_rates &= ~ret_rates;
1903
1895 len += 2 + *pos; 1904 len += 2 + *pos;
1896 pos += (*pos) + 1; 1905 pos += (*pos) + 1;
1897 ret_rates = ~ret_rates & priv->active_rate; 1906 if (active_rates == 0)
1898
1899 if (ret_rates == 0)
1900 goto fill_end; 1907 goto fill_end;
1901 1908
1902 /* fill in supported extended rate */ 1909 /* fill in supported extended rate */
@@ -1907,7 +1914,8 @@ static u16 iwl_fill_probe_req(struct iwl_priv *priv,
1907 /* ... fill it in... */ 1914 /* ... fill it in... */
1908 *pos++ = WLAN_EID_EXT_SUPP_RATES; 1915 *pos++ = WLAN_EID_EXT_SUPP_RATES;
1909 *pos = 0; 1916 *pos = 0;
1910 iwl_supported_rate_to_ie(pos, ret_rates, priv->active_rate_basic, left); 1917 iwl_supported_rate_to_ie(pos, active_rates,
1918 priv->active_rate_basic, &left);
1911 if (*pos > 0) 1919 if (*pos > 0)
1912 len += 2 + *pos; 1920 len += 2 + *pos;
1913 1921
@@ -4494,13 +4502,13 @@ static u8 ratio2dB[100] = {
4494 * Conversion assumes that levels are voltages (20*log), not powers (10*log). */ 4502 * Conversion assumes that levels are voltages (20*log), not powers (10*log). */
4495int iwl_calc_db_from_ratio(int sig_ratio) 4503int iwl_calc_db_from_ratio(int sig_ratio)
4496{ 4504{
4497 /* Anything above 1000:1 just report as 60 dB */ 4505 /* 1000:1 or higher just report as 60 dB */
4498 if (sig_ratio > 1000) 4506 if (sig_ratio >= 1000)
4499 return 60; 4507 return 60;
4500 4508
4501 /* Above 100:1, divide by 10 and use table, 4509 /* 100:1 or higher, divide by 10 and use table,
4502 * add 20 dB to make up for divide by 10 */ 4510 * add 20 dB to make up for divide by 10 */
4503 if (sig_ratio > 100) 4511 if (sig_ratio >= 100)
4504 return (20 + (int)ratio2dB[sig_ratio/10]); 4512 return (20 + (int)ratio2dB[sig_ratio/10]);
4505 4513
4506 /* We shouldn't see this */ 4514 /* We shouldn't see this */
diff --git a/drivers/net/wireless/iwlwifi/iwlwifi.h b/drivers/net/wireless/iwlwifi/iwlwifi.h
index e0b97c34121..432ce887807 100644
--- a/drivers/net/wireless/iwlwifi/iwlwifi.h
+++ b/drivers/net/wireless/iwlwifi/iwlwifi.h
@@ -39,18 +39,13 @@ struct iwl_priv;
39/* Hardware specific file defines the PCI IDs table for that hardware module */ 39/* Hardware specific file defines the PCI IDs table for that hardware module */
40extern struct pci_device_id iwl_hw_card_ids[]; 40extern struct pci_device_id iwl_hw_card_ids[];
41 41
42#include "iwl-hw.h"
42#if IWL == 3945 43#if IWL == 3945
43
44#define DRV_NAME "iwl3945" 44#define DRV_NAME "iwl3945"
45#include "iwl-hw.h"
46#include "iwl-3945-hw.h" 45#include "iwl-3945-hw.h"
47
48#elif IWL == 4965 46#elif IWL == 4965
49
50#define DRV_NAME "iwl4965" 47#define DRV_NAME "iwl4965"
51#include "iwl-hw.h"
52#include "iwl-4965-hw.h" 48#include "iwl-4965-hw.h"
53
54#endif 49#endif
55 50
56#include "iwl-prph.h" 51#include "iwl-prph.h"
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
index c2d71afd57e..2402cb8dd32 100644
--- a/drivers/net/wireless/netwave_cs.c
+++ b/drivers/net/wireless/netwave_cs.c
@@ -4,18 +4,18 @@
4 * Version: 0.4.1 4 * Version: 0.4.1
5 * Description: Netwave AirSurfer Wireless LAN PC Card driver 5 * Description: Netwave AirSurfer Wireless LAN PC Card driver
6 * Status: Experimental. 6 * Status: Experimental.
7 * Authors: John Markus Bjørndalen <johnm@cs.uit.no> 7 * Authors: John Markus Bjørndalen <johnm@cs.uit.no>
8 * Dag Brattli <dagb@cs.uit.no> 8 * Dag Brattli <dagb@cs.uit.no>
9 * David Hinds <dahinds@users.sourceforge.net> 9 * David Hinds <dahinds@users.sourceforge.net>
10 * Created at: A long time ago! 10 * Created at: A long time ago!
11 * Modified at: Mon Nov 10 11:54:37 1997 11 * Modified at: Mon Nov 10 11:54:37 1997
12 * Modified by: Dag Brattli <dagb@cs.uit.no> 12 * Modified by: Dag Brattli <dagb@cs.uit.no>
13 * 13 *
14 * Copyright (c) 1997 University of Tromsø, Norway 14 * Copyright (c) 1997 University of Tromsø, Norway
15 * 15 *
16 * Revision History: 16 * Revision History:
17 * 17 *
18 * 08-Nov-97 15:14:47 John Markus Bjørndalen <johnm@cs.uit.no> 18 * 08-Nov-97 15:14:47 John Markus Bjørndalen <johnm@cs.uit.no>
19 * - Fixed some bugs in netwave_rx and cleaned it up a bit. 19 * - Fixed some bugs in netwave_rx and cleaned it up a bit.
20 * (One of the bugs would have destroyed packets when receiving 20 * (One of the bugs would have destroyed packets when receiving
21 * multiple packets per interrupt). 21 * multiple packets per interrupt).
@@ -158,7 +158,7 @@ static int pc_debug = PCMCIA_DEBUG;
158module_param(pc_debug, int, 0); 158module_param(pc_debug, int, 0);
159#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) 159#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
160static char *version = 160static char *version =
161"netwave_cs.c 0.3.0 Thu Jul 17 14:36:02 1997 (John Markus Bjørndalen)\n"; 161"netwave_cs.c 0.3.0 Thu Jul 17 14:36:02 1997 (John Markus Bjørndalen)\n";
162#else 162#else
163#define DEBUG(n, args...) 163#define DEBUG(n, args...)
164#endif 164#endif
diff --git a/drivers/net/wireless/p54common.c b/drivers/net/wireless/p54common.c
index 2c63cf0ad2c..1437db0cf4b 100644
--- a/drivers/net/wireless/p54common.c
+++ b/drivers/net/wireless/p54common.c
@@ -577,7 +577,7 @@ static int p54_set_filter(struct ieee80211_hw *dev, u16 filter_type,
577 struct p54_tx_control_filter *filter; 577 struct p54_tx_control_filter *filter;
578 578
579 hdr = kzalloc(sizeof(*hdr) + sizeof(*filter) + 579 hdr = kzalloc(sizeof(*hdr) + sizeof(*filter) +
580 priv->tx_hdr_len, GFP_KERNEL); 580 priv->tx_hdr_len, GFP_ATOMIC);
581 if (!hdr) 581 if (!hdr)
582 return -ENOMEM; 582 return -ENOMEM;
583 583
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index bb6f46cfbb9..ff399f8083e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -550,7 +550,7 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
550 /* 550 /*
551 * Check if we need to set the Length Extension 551 * Check if we need to set the Length Extension
552 */ 552 */
553 if (bitrate == 110 && residual <= 3) 553 if (bitrate == 110 && residual <= 30)
554 desc.service |= 0x80; 554 desc.service |= 0x80;
555 } 555 }
556 556
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 3e42759473c..46c8c0840a6 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2029,6 +2029,7 @@ static struct usb_device_id rt73usb_device_table[] = {
2029 { USB_DEVICE(0x050d, 0x7050), USB_DEVICE_DATA(&rt73usb_ops) }, 2029 { USB_DEVICE(0x050d, 0x7050), USB_DEVICE_DATA(&rt73usb_ops) },
2030 { USB_DEVICE(0x050d, 0x705a), USB_DEVICE_DATA(&rt73usb_ops) }, 2030 { USB_DEVICE(0x050d, 0x705a), USB_DEVICE_DATA(&rt73usb_ops) },
2031 { USB_DEVICE(0x050d, 0x905b), USB_DEVICE_DATA(&rt73usb_ops) }, 2031 { USB_DEVICE(0x050d, 0x905b), USB_DEVICE_DATA(&rt73usb_ops) },
2032 { USB_DEVICE(0x050d, 0x905c), USB_DEVICE_DATA(&rt73usb_ops) },
2032 /* Billionton */ 2033 /* Billionton */
2033 { USB_DEVICE(0x1631, 0xc019), USB_DEVICE_DATA(&rt73usb_ops) }, 2034 { USB_DEVICE(0x1631, 0xc019), USB_DEVICE_DATA(&rt73usb_ops) },
2034 /* Buffalo */ 2035 /* Buffalo */
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index 0ef887dd286..de61c8fe649 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -131,7 +131,8 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
131 struct rtl8187_tx_hdr *hdr; 131 struct rtl8187_tx_hdr *hdr;
132 struct rtl8187_tx_info *info; 132 struct rtl8187_tx_info *info;
133 struct urb *urb; 133 struct urb *urb;
134 u32 tmp; 134 __le16 rts_dur = 0;
135 u32 flags;
135 136
136 urb = usb_alloc_urb(0, GFP_ATOMIC); 137 urb = usb_alloc_urb(0, GFP_ATOMIC);
137 if (!urb) { 138 if (!urb) {
@@ -139,24 +140,24 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
139 return 0; 140 return 0;
140 } 141 }
141 142
142 hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr)); 143 flags = skb->len;
143 tmp = skb->len - sizeof(*hdr); 144 flags |= RTL8187_TX_FLAG_NO_ENCRYPT;
144 tmp |= RTL8187_TX_FLAG_NO_ENCRYPT; 145 flags |= control->rts_cts_rate << 19;
145 tmp |= control->rts_cts_rate << 19; 146 flags |= control->tx_rate << 24;
146 tmp |= control->tx_rate << 24; 147 if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data))
147 if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb)) 148 flags |= RTL8187_TX_FLAG_MORE_FRAG;
148 tmp |= RTL8187_TX_FLAG_MORE_FRAG;
149 if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) { 149 if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) {
150 tmp |= RTL8187_TX_FLAG_RTS; 150 flags |= RTL8187_TX_FLAG_RTS;
151 hdr->rts_duration = 151 rts_dur = ieee80211_rts_duration(dev, priv->if_id, skb->len, control);
152 ieee80211_rts_duration(dev, priv->if_id, skb->len, control);
153 } 152 }
154 if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) 153 if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT)
155 tmp |= RTL8187_TX_FLAG_CTS; 154 flags |= RTL8187_TX_FLAG_CTS;
156 hdr->flags = cpu_to_le32(tmp); 155
156 hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr));
157 hdr->flags = cpu_to_le32(flags);
157 hdr->len = 0; 158 hdr->len = 0;
158 tmp = control->retry_limit << 8; 159 hdr->rts_duration = rts_dur;
159 hdr->retry = cpu_to_le32(tmp); 160 hdr->retry = cpu_to_le32(control->retry_limit << 8);
160 161
161 info = (struct rtl8187_tx_info *)skb->cb; 162 info = (struct rtl8187_tx_info *)skb->cb;
162 info->control = kmemdup(control, sizeof(*control), GFP_ATOMIC); 163 info->control = kmemdup(control, sizeof(*control), GFP_ATOMIC);
@@ -587,8 +588,6 @@ static void rtl8187_configure_filter(struct ieee80211_hw *dev,
587 588
588 *total_flags = 0; 589 *total_flags = 0;
589 590
590 if (changed_flags & FIF_PROMISC_IN_BSS)
591 priv->rx_conf ^= RTL818X_RX_CONF_NICMAC;
592 if (changed_flags & FIF_ALLMULTI) 591 if (changed_flags & FIF_ALLMULTI)
593 priv->rx_conf ^= RTL818X_RX_CONF_MULTICAST; 592 priv->rx_conf ^= RTL818X_RX_CONF_MULTICAST;
594 if (changed_flags & FIF_FCSFAIL) 593 if (changed_flags & FIF_FCSFAIL)
@@ -601,8 +600,6 @@ static void rtl8187_configure_filter(struct ieee80211_hw *dev,
601 if (mc_count > 0) 600 if (mc_count > 0)
602 priv->rx_conf |= RTL818X_RX_CONF_MULTICAST; 601 priv->rx_conf |= RTL818X_RX_CONF_MULTICAST;
603 602
604 if (priv->rx_conf & RTL818X_RX_CONF_NICMAC)
605 *total_flags |= FIF_PROMISC_IN_BSS;
606 if (priv->rx_conf & RTL818X_RX_CONF_MULTICAST) 603 if (priv->rx_conf & RTL818X_RX_CONF_MULTICAST)
607 *total_flags |= FIF_ALLMULTI; 604 *total_flags |= FIF_ALLMULTI;
608 if (priv->rx_conf & RTL818X_RX_CONF_FCS) 605 if (priv->rx_conf & RTL818X_RX_CONF_FCS)
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c
index 935b144d9b5..d5c0c66188c 100644
--- a/drivers/net/wireless/zd1201.c
+++ b/drivers/net/wireless/zd1201.c
@@ -327,8 +327,8 @@ static void zd1201_usbrx(struct urb *urb)
327 memcpy(skb_put(skb, 6), &data[datalen-8], 6); 327 memcpy(skb_put(skb, 6), &data[datalen-8], 6);
328 memcpy(skb_put(skb, 2), &data[datalen-24], 2); 328 memcpy(skb_put(skb, 2), &data[datalen-24], 2);
329 memcpy(skb_put(skb, len), data, len); 329 memcpy(skb_put(skb, len), data, len);
330 skb->dev->last_rx = jiffies;
331 skb->protocol = eth_type_trans(skb, zd->dev); 330 skb->protocol = eth_type_trans(skb, zd->dev);
331 skb->dev->last_rx = jiffies;
332 zd->stats.rx_packets++; 332 zd->stats.rx_packets++;
333 zd->stats.rx_bytes += skb->len; 333 zd->stats.rx_bytes += skb->len;
334 netif_rx(skb); 334 netif_rx(skb);
@@ -384,8 +384,8 @@ static void zd1201_usbrx(struct urb *urb)
384 memcpy(skb_put(skb, 2), &data[6], 2); 384 memcpy(skb_put(skb, 2), &data[6], 2);
385 memcpy(skb_put(skb, len), data+8, len); 385 memcpy(skb_put(skb, len), data+8, len);
386 } 386 }
387 skb->dev->last_rx = jiffies;
388 skb->protocol = eth_type_trans(skb, zd->dev); 387 skb->protocol = eth_type_trans(skb, zd->dev);
388 skb->dev->last_rx = jiffies;
389 zd->stats.rx_packets++; 389 zd->stats.rx_packets++;
390 zd->stats.rx_bytes += skb->len; 390 zd->stats.rx_bytes += skb->len;
391 netif_rx(skb); 391 netif_rx(skb);
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index b0684f96576..c755b692381 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -1044,14 +1044,17 @@ error:
1044static void disconnect(struct usb_interface *intf) 1044static void disconnect(struct usb_interface *intf)
1045{ 1045{
1046 struct net_device *netdev = zd_intf_to_netdev(intf); 1046 struct net_device *netdev = zd_intf_to_netdev(intf);
1047 struct zd_mac *mac = zd_netdev_mac(netdev); 1047 struct zd_mac *mac;
1048 struct zd_usb *usb = &mac->chip.usb; 1048 struct zd_usb *usb;
1049 1049
1050 /* Either something really bad happened, or we're just dealing with 1050 /* Either something really bad happened, or we're just dealing with
1051 * a DEVICE_INSTALLER. */ 1051 * a DEVICE_INSTALLER. */
1052 if (netdev == NULL) 1052 if (netdev == NULL)
1053 return; 1053 return;
1054 1054
1055 mac = zd_netdev_mac(netdev);
1056 usb = &mac->chip.usb;
1057
1055 dev_dbg_f(zd_usb_dev(usb), "\n"); 1058 dev_dbg_f(zd_usb_dev(usb), "\n");
1056 1059
1057 zd_netdev_disconnect(netdev); 1060 zd_netdev_disconnect(netdev);
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 6420a90a4a9..cbde770eb12 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -240,7 +240,7 @@ config RTC_DRV_TWL92330
240 depends on MENELAUS 240 depends on MENELAUS
241 help 241 help
242 If you say yes here you get support for the RTC on the 242 If you say yes here you get support for the RTC on the
243 TWL92330 "Menelaus" power mangement chip, used with OMAP2 243 TWL92330 "Menelaus" power management chip, used with OMAP2
244 platforms. The support is integrated with the rest of 244 platforms. The support is integrated with the rest of
245 the Menelaus driver; it's not separate module. 245 the Menelaus driver; it's not separate module.
246 246
diff --git a/drivers/s390/block/dasd_3990_erp.c b/drivers/s390/block/dasd_3990_erp.c
index 8b9d68f6e01..5b7385e430e 100644
--- a/drivers/s390/block/dasd_3990_erp.c
+++ b/drivers/s390/block/dasd_3990_erp.c
@@ -40,7 +40,7 @@ struct DCTL_data {
40 * 40 *
41 * Each bit configuration leading to an action code 2 (Exit with 41 * Each bit configuration leading to an action code 2 (Exit with
42 * programming error or unusual condition indication) 42 * programming error or unusual condition indication)
43 * are handled as fatal error´s. 43 * are handled as fatal errors.
44 * 44 *
45 * All other configurations are handled as recoverable errors. 45 * All other configurations are handled as recoverable errors.
46 * 46 *
@@ -2001,7 +2001,7 @@ dasd_3990_erp_compound_code(struct dasd_ccw_req * erp, char *sense)
2001 switch (sense[28]) { 2001 switch (sense[28]) {
2002 case 0x17: 2002 case 0x17:
2003 /* issue a Diagnostic Control command with an 2003 /* issue a Diagnostic Control command with an
2004 * Inhibit Write subcommand and controler modifier */ 2004 * Inhibit Write subcommand and controller modifier */
2005 erp = dasd_3990_erp_DCTL(erp, 0x20); 2005 erp = dasd_3990_erp_DCTL(erp, 0x20);
2006 break; 2006 break;
2007 2007
diff --git a/drivers/s390/char/sclp_cpi.c b/drivers/s390/char/sclp_cpi.c
index 29fe2a5ec2f..82a13d9fdfe 100644
--- a/drivers/s390/char/sclp_cpi.c
+++ b/drivers/s390/char/sclp_cpi.c
@@ -157,7 +157,7 @@ cpi_prepare_req(void)
157 sclp_ascebc_str(evb->system_name, CPI_LENGTH_SYSTEM_NAME); 157 sclp_ascebc_str(evb->system_name, CPI_LENGTH_SYSTEM_NAME);
158 EBC_TOUPPER(evb->system_name, CPI_LENGTH_SYSTEM_NAME); 158 EBC_TOUPPER(evb->system_name, CPI_LENGTH_SYSTEM_NAME);
159 159
160 /* set sytem level */ 160 /* set system level */
161 evb->system_level = LINUX_VERSION_CODE; 161 evb->system_level = LINUX_VERSION_CODE;
162 162
163 /* set sysplex name */ 163 /* set sysplex name */
diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c
index b960f66843e..725b0dd1426 100644
--- a/drivers/s390/cio/cmf.c
+++ b/drivers/s390/cio/cmf.c
@@ -158,7 +158,7 @@ static inline u64 time_to_avg_nsec(u32 value, u32 count)
158 if (count == 0) 158 if (count == 0)
159 return 0; 159 return 0;
160 160
161 /* value comes in units of 128 µsec */ 161 /* value comes in units of 128 µsec */
162 ret = time_to_nsec(value); 162 ret = time_to_nsec(value);
163 do_div(ret, count); 163 do_div(ret, count);
164 164
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c
index 44993723373..6bf3ebbe985 100644
--- a/drivers/s390/net/ctcmain.c
+++ b/drivers/s390/net/ctcmain.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation 4 * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation
5 * Author(s): Fritz Elfert (elfert@de.ibm.com, felfert@millenux.com) 5 * Author(s): Fritz Elfert (elfert@de.ibm.com, felfert@millenux.com)
6 * Fixes by : Jochen Röhrig (roehrig@de.ibm.com) 6 * Fixes by : Jochen Röhrig (roehrig@de.ibm.com)
7 * Arnaldo Carvalho de Melo <acme@conectiva.com.br> 7 * Arnaldo Carvalho de Melo <acme@conectiva.com.br>
8 Peter Tiedemann (ptiedem@de.ibm.com) 8 Peter Tiedemann (ptiedem@de.ibm.com)
9 * Driver Model stuff by : Cornelia Huck <cornelia.huck@de.ibm.com> 9 * Driver Model stuff by : Cornelia Huck <cornelia.huck@de.ibm.com>
@@ -19,7 +19,7 @@
19 * Dieter Wellerdiek (wel@de.ibm.com) 19 * Dieter Wellerdiek (wel@de.ibm.com)
20 * Martin Schwidefsky (schwidefsky@de.ibm.com) 20 * Martin Schwidefsky (schwidefsky@de.ibm.com)
21 * Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) 21 * Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
22 * Jochen Röhrig (roehrig@de.ibm.com) 22 * Jochen Röhrig (roehrig@de.ibm.com)
23 * 23 *
24 * This program is free software; you can redistribute it and/or modify 24 * This program is free software; you can redistribute it and/or modify
25 * it under the terms of the GNU General Public License as published by 25 * it under the terms of the GNU General Public License as published by
@@ -885,7 +885,7 @@ ch_action_firstio(fsm_instance * fi, int event, void *arg)
885 } 885 }
886 886
887 /** 887 /**
888 * Don´t setup a timer for receiving the initial RX frame 888 * Don't setup a timer for receiving the initial RX frame
889 * if in compatibility mode, since VM TCP delays the initial 889 * if in compatibility mode, since VM TCP delays the initial
890 * frame until it has some data to send. 890 * frame until it has some data to send.
891 */ 891 */
@@ -905,10 +905,10 @@ ch_action_firstio(fsm_instance * fi, int event, void *arg)
905 ccw_check_return_code(ch, rc, "init IO"); 905 ccw_check_return_code(ch, rc, "init IO");
906 } 906 }
907 /** 907 /**
908 * If in compatibility mode since we don´t setup a timer, we 908 * If in compatibility mode since we don't setup a timer, we
909 * also signal RX channel up immediately. This enables us 909 * also signal RX channel up immediately. This enables us
910 * to send packets early which in turn usually triggers some 910 * to send packets early which in turn usually triggers some
911 * reply from VM TCP which brings up the RX channel to it´s 911 * reply from VM TCP which brings up the RX channel to it's
912 * final state. 912 * final state.
913 */ 913 */
914 if ((CHANNEL_DIRECTION(ch->flags) == READ) && 914 if ((CHANNEL_DIRECTION(ch->flags) == READ) &&
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index a2d08c9ba3c..ff999ff0b62 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -6643,7 +6643,8 @@ qeth_netdev_init(struct net_device *dev)
6643 dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid; 6643 dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid;
6644 dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid; 6644 dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid;
6645#endif 6645#endif
6646 dev->header_ops = &qeth_null_ops; 6646 if (qeth_get_netdev_flags(card) & IFF_NOARP)
6647 dev->header_ops = &qeth_null_ops;
6647 6648
6648#ifdef CONFIG_QETH_IPV6 6649#ifdef CONFIG_QETH_IPV6
6649 /*IPv6 address autoconfiguration stuff*/ 6650 /*IPv6 address autoconfiguration stuff*/
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 03b51025a8f..9abba8b90f7 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -1526,7 +1526,7 @@ struct aac_mntent {
1526 __le32 capacityhigh; 1526 __le32 capacityhigh;
1527}; 1527};
1528 1528
1529#define FSCS_NOTCLEAN 0x0001 /* fsck is neccessary before mounting */ 1529#define FSCS_NOTCLEAN 0x0001 /* fsck is necessary before mounting */
1530#define FSCS_READONLY 0x0002 /* possible result of broken mirror */ 1530#define FSCS_READONLY 0x0002 /* possible result of broken mirror */
1531#define FSCS_HIDDEN 0x0004 /* should be ignored - set during a clear */ 1531#define FSCS_HIDDEN 0x0004 /* should be ignored - set during a clear */
1532 1532
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index f08e71e0205..a58c265dc8a 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -1,6 +1,6 @@
1/* aha152x.c -- Adaptec AHA-152x driver 1/* aha152x.c -- Adaptec AHA-152x driver
2 * Author: Jürgen E. Fischer, fischer@norbit.de 2 * Author: Jürgen E. Fischer, fischer@norbit.de
3 * Copyright 1993-2004 Jürgen E. Fischer 3 * Copyright 1993-2004 Jürgen E. Fischer
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the 6 * under the terms of the GNU General Public License as published by the
@@ -357,7 +357,7 @@ enum {
357 check_condition = 0x0800, /* requesting sense after CHECK CONDITION */ 357 check_condition = 0x0800, /* requesting sense after CHECK CONDITION */
358}; 358};
359 359
360MODULE_AUTHOR("Jürgen Fischer"); 360MODULE_AUTHOR("Jürgen Fischer");
361MODULE_DESCRIPTION(AHA152X_REVID); 361MODULE_DESCRIPTION(AHA152X_REVID);
362MODULE_LICENSE("GPL"); 362MODULE_LICENSE("GPL");
363 363
diff --git a/drivers/scsi/aic7xxx/cam.h b/drivers/scsi/aic7xxx/cam.h
index 26f17e3fc45..687aef6ef18 100644
--- a/drivers/scsi/aic7xxx/cam.h
+++ b/drivers/scsi/aic7xxx/cam.h
@@ -48,7 +48,7 @@ typedef enum {
48 CAM_REQ_ABORTED, /* CCB request aborted by the host */ 48 CAM_REQ_ABORTED, /* CCB request aborted by the host */
49 CAM_UA_ABORT, /* Unable to abort CCB request */ 49 CAM_UA_ABORT, /* Unable to abort CCB request */
50 CAM_REQ_CMP_ERR, /* CCB request completed with an error */ 50 CAM_REQ_CMP_ERR, /* CCB request completed with an error */
51 CAM_BUSY, /* CAM subsytem is busy */ 51 CAM_BUSY, /* CAM subsystem is busy */
52 CAM_REQ_INVALID, /* CCB request was invalid */ 52 CAM_REQ_INVALID, /* CCB request was invalid */
53 CAM_PATH_INVALID, /* Supplied Path ID is invalid */ 53 CAM_PATH_INVALID, /* Supplied Path ID is invalid */
54 CAM_SEL_TIMEOUT, /* Target Selection Timeout */ 54 CAM_SEL_TIMEOUT, /* Target Selection Timeout */
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index fd42d478920..a9def6e1d30 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -1808,12 +1808,12 @@ static irqreturn_t dc395x_interrupt(int irq, void *dev_id)
1808 irqreturn_t handled = IRQ_NONE; 1808 irqreturn_t handled = IRQ_NONE;
1809 1809
1810 /* 1810 /*
1811 * Check for pending interupt 1811 * Check for pending interrupt
1812 */ 1812 */
1813 scsi_status = DC395x_read16(acb, TRM_S1040_SCSI_STATUS); 1813 scsi_status = DC395x_read16(acb, TRM_S1040_SCSI_STATUS);
1814 dma_status = DC395x_read8(acb, TRM_S1040_DMA_STATUS); 1814 dma_status = DC395x_read8(acb, TRM_S1040_DMA_STATUS);
1815 if (scsi_status & SCSIINTERRUPT) { 1815 if (scsi_status & SCSIINTERRUPT) {
1816 /* interupt pending - let's process it! */ 1816 /* interrupt pending - let's process it! */
1817 dc395x_handle_interrupt(acb, scsi_status); 1817 dc395x_handle_interrupt(acb, scsi_status);
1818 handled = IRQ_HANDLED; 1818 handled = IRQ_HANDLED;
1819 } 1819 }
@@ -4579,7 +4579,7 @@ static void adapter_uninit_chip(struct AdapterCtlBlk *acb)
4579 if (acb->config & HCC_SCSI_RESET) 4579 if (acb->config & HCC_SCSI_RESET)
4580 reset_scsi_bus(acb); 4580 reset_scsi_bus(acb);
4581 4581
4582 /* clear any pending interupt state */ 4582 /* clear any pending interrupt state */
4583 DC395x_read8(acb, TRM_S1040_SCSI_INTSTATUS); 4583 DC395x_read8(acb, TRM_S1040_SCSI_INTSTATUS);
4584} 4584}
4585 4585
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index e4e4c6a39ed..78779209ac8 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -427,7 +427,7 @@ megaraid_exit(void)
427 * @id : pci device id of the class of controllers 427 * @id : pci device id of the class of controllers
428 * 428 *
429 * This routine should be called whenever a new adapter is detected by the 429 * This routine should be called whenever a new adapter is detected by the
430 * PCI hotplug susbsytem. 430 * PCI hotplug susbsystem.
431 */ 431 */
432static int __devinit 432static int __devinit
433megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) 433megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c
index 1e29f51d596..d692c713416 100644
--- a/drivers/scsi/qla4xxx/ql4_init.c
+++ b/drivers/scsi/qla4xxx/ql4_init.c
@@ -1006,7 +1006,7 @@ int ql4xxx_lock_drvr_wait(struct scsi_qla_host *a)
1006 * qla4xxx_start_firmware - starts qla4xxx firmware 1006 * qla4xxx_start_firmware - starts qla4xxx firmware
1007 * @ha: Pointer to host adapter structure. 1007 * @ha: Pointer to host adapter structure.
1008 * 1008 *
1009 * This routine performs the neccessary steps to start the firmware for 1009 * This routine performs the necessary steps to start the firmware for
1010 * the QLA4010 adapter. 1010 * the QLA4010 adapter.
1011 **/ 1011 **/
1012static int qla4xxx_start_firmware(struct scsi_qla_host *ha) 1012static int qla4xxx_start_firmware(struct scsi_qla_host *ha)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 69f542c4923..a69b155f39a 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -676,7 +676,7 @@ static int sd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
676 * success as well). Returns a negated errno value in case of error. 676 * success as well). Returns a negated errno value in case of error.
677 * 677 *
678 * Note: most ioctls are forward onto the block subsystem or further 678 * Note: most ioctls are forward onto the block subsystem or further
679 * down in the scsi subsytem. 679 * down in the scsi subsystem.
680 **/ 680 **/
681static int sd_ioctl(struct inode * inode, struct file * filp, 681static int sd_ioctl(struct inode * inode, struct file * filp,
682 unsigned int cmd, unsigned long arg) 682 unsigned int cmd, unsigned long arg)
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c
index dc15a22105f..4aafe89b557 100644
--- a/drivers/scsi/sun3_NCR5380.c
+++ b/drivers/scsi/sun3_NCR5380.c
@@ -1596,7 +1596,7 @@ static int NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd,
1596 * IO while SEL is true. But again, there are some disks out the in the 1596 * IO while SEL is true. But again, there are some disks out the in the
1597 * world that do that nevertheless. (Somebody claimed that this announces 1597 * world that do that nevertheless. (Somebody claimed that this announces
1598 * reselection capability of the target.) So we better skip that test and 1598 * reselection capability of the target.) So we better skip that test and
1599 * only wait for BSY... (Famous german words: Der Klügere gibt nach :-) 1599 * only wait for BSY... (Famous german words: Der Klügere gibt nach :-)
1600 */ 1600 */
1601 1601
1602 while (time_before(jiffies, timeout) && !(NCR5380_read(STATUS_REG) & 1602 while (time_before(jiffies, timeout) && !(NCR5380_read(STATUS_REG) &
diff --git a/drivers/scsi/sym53c8xx_2/sym_fw2.h b/drivers/scsi/sym53c8xx_2/sym_fw2.h
index 6e5b952312e..ae1fb179b88 100644
--- a/drivers/scsi/sym53c8xx_2/sym_fw2.h
+++ b/drivers/scsi/sym53c8xx_2/sym_fw2.h
@@ -1781,7 +1781,7 @@ static struct SYM_FWB_SCR SYM_FWB_SCR = {
1781 * While testing with bogus QUANTUM drives, the C1010 1781 * While testing with bogus QUANTUM drives, the C1010
1782 * sometimes raised a spurious phase mismatch with 1782 * sometimes raised a spurious phase mismatch with
1783 * WSR and the CHMOV(1) triggered another PM. 1783 * WSR and the CHMOV(1) triggered another PM.
1784 * Waiting explicitely for the PHASE seemed to avoid 1784 * Waiting explicitly for the PHASE seemed to avoid
1785 * the nested phase mismatch. Btw, this didn't happen 1785 * the nested phase mismatch. Btw, this didn't happen
1786 * using my IBM drives. 1786 * using my IBM drives.
1787 */ 1787 */
diff --git a/drivers/scsi/wd33c93.h b/drivers/scsi/wd33c93.h
index 61ffb860dac..00123f2383d 100644
--- a/drivers/scsi/wd33c93.h
+++ b/drivers/scsi/wd33c93.h
@@ -155,7 +155,7 @@
155#define WD33C93_FS_12_15 OWNID_FS_12 155#define WD33C93_FS_12_15 OWNID_FS_12
156#define WD33C93_FS_16_20 OWNID_FS_16 156#define WD33C93_FS_16_20 OWNID_FS_16
157 157
158 /* pass input-clock explicitely. accepted mhz values are 8-10,12-20 */ 158 /* pass input-clock explicitly. accepted mhz values are 8-10,12-20 */
159#define WD33C93_FS_MHZ(mhz) (mhz) 159#define WD33C93_FS_MHZ(mhz) (mhz)
160 160
161 /* Control register */ 161 /* Control register */
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index d6ae38e55d0..87665d7df6f 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -62,11 +62,11 @@ config SERIAL_8250_CONSOLE
62 kernel will automatically use the first serial line, /dev/ttyS0, as 62 kernel will automatically use the first serial line, /dev/ttyS0, as
63 system console. 63 system console.
64 64
65 you can set that using a kernel command line option such as 65 You can set that using a kernel command line option such as
66 "console=uart8250,io,0x3f8,9600n8" 66 "console=uart8250,io,0x3f8,9600n8"
67 "console=uart8250,mmio,0xff5e0000,115200n8". 67 "console=uart8250,mmio,0xff5e0000,115200n8".
68 and it will switch to normal serial console when correponding port is 68 and it will switch to normal serial console when the corresponding
69 ready. 69 port is ready.
70 "earlycon=uart8250,io,0x3f8,9600n8" 70 "earlycon=uart8250,io,0x3f8,9600n8"
71 "earlycon=uart8250,mmio,0xff5e0000,115200n8". 71 "earlycon=uart8250,mmio,0xff5e0000,115200n8".
72 it will not only setup early console. 72 it will not only setup early console.
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 3f26c4b2f32..e773c8e1496 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -20,8 +20,8 @@
20 * - S3C2410 and S3C2440 serial support 20 * - S3C2410 and S3C2440 serial support
21 * - Power Management support 21 * - Power Management support
22 * - Fix console via IrDA devices 22 * - Fix console via IrDA devices
23 * - SysReq (Herbert Pötzl) 23 * - SysReq (Herbert Pötzl)
24 * - Break character handling (Herbert Pötzl) 24 * - Break character handling (Herbert Pötzl)
25 * - spin-lock initialisation (Dimitry Andric) 25 * - spin-lock initialisation (Dimitry Andric)
26 * - added clock control 26 * - added clock control
27 * - updated init code to use platform_device info 27 * - updated init code to use platform_device info
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
index e9aba932f21..7051e6c5edc 100644
--- a/drivers/spi/mpc52xx_psc_spi.c
+++ b/drivers/spi/mpc52xx_psc_spi.c
@@ -181,7 +181,7 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
181 } 181 }
182 182
183 183
184 /* enable interupts and wait for wake up 184 /* enable interrupts and wait for wake up
185 * if just one byte is expected the Rx FIFO genererates no 185 * if just one byte is expected the Rx FIFO genererates no
186 * FFULL interrupt, so activate the RxRDY interrupt 186 * FFULL interrupt, so activate the RxRDY interrupt
187 */ 187 */
diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c
index e78c2ddc1f8..367b75c0b25 100644
--- a/drivers/usb/gadget/lh7a40x_udc.c
+++ b/drivers/usb/gadget/lh7a40x_udc.c
@@ -1272,7 +1272,7 @@ static int lh7a40x_set_halt(struct usb_ep *_ep, int value)
1272 /* 1272 /*
1273 * Attempts to halt IN endpoints will fail (returning -EAGAIN) 1273 * Attempts to halt IN endpoints will fail (returning -EAGAIN)
1274 * if any transfer requests are still queued, or if the controller 1274 * if any transfer requests are still queued, or if the controller
1275 * FIFO still holds bytes that the host hasnt collected. 1275 * FIFO still holds bytes that the host hasn't collected.
1276 */ 1276 */
1277 spin_unlock_irqrestore(&ep->dev->lock, flags); 1277 spin_unlock_irqrestore(&ep->dev->lock, flags);
1278 DEBUG 1278 DEBUG
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 0dcb4164dc8..735db4aec83 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -451,7 +451,7 @@ ehci_hub_status_data (struct usb_hcd *hcd, char *buf)
451 451
452 /* Some boards (mostly VIA?) report bogus overcurrent indications, 452 /* Some boards (mostly VIA?) report bogus overcurrent indications,
453 * causing massive log spam unless we completely ignore them. It 453 * causing massive log spam unless we completely ignore them. It
454 * may be relevant that VIA VT8235 controlers, where PORT_POWER is 454 * may be relevant that VIA VT8235 controllers, where PORT_POWER is
455 * always set, seem to clear PORT_OCC and PORT_CSC when writing to 455 * always set, seem to clear PORT_OCC and PORT_CSC when writing to
456 * PORT_POWER; that's surprising, but maybe within-spec. 456 * PORT_POWER; that's surprising, but maybe within-spec.
457 */ 457 */
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 94d859aa73f..ba370c56172 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -1556,7 +1556,7 @@ sl811h_start(struct usb_hcd *hcd)
1556 hcd->power_budget = sl811->board->power * 2; 1556 hcd->power_budget = sl811->board->power * 2;
1557 } 1557 }
1558 1558
1559 /* enable power and interupts */ 1559 /* enable power and interrupts */
1560 port_power(sl811, 1); 1560 port_power(sl811, 1);
1561 1561
1562 return 0; 1562 return 0;
diff --git a/drivers/usb/image/Kconfig b/drivers/usb/image/Kconfig
index 95ce703110d..7595dfb38e3 100644
--- a/drivers/usb/image/Kconfig
+++ b/drivers/usb/image/Kconfig
@@ -1,5 +1,5 @@
1# 1#
2# USB Imageing devices configuration 2# USB Imaging devices configuration
3# 3#
4comment "USB Imaging devices" 4comment "USB Imaging devices"
5 depends on USB 5 depends on USB
diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c
index 04e87acd6e4..2677fea147d 100644
--- a/drivers/usb/misc/cytherm.c
+++ b/drivers/usb/misc/cytherm.c
@@ -118,7 +118,7 @@ static ssize_t set_brightness(struct device *dev, struct device_attribute *attr,
118 cytherm->brightness, buffer, 8); 118 cytherm->brightness, buffer, 8);
119 if (retval) 119 if (retval)
120 dev_dbg(&cytherm->udev->dev, "retval = %d\n", retval); 120 dev_dbg(&cytherm->udev->dev, "retval = %d\n", retval);
121 /* Inform µC that we have changed the brightness setting */ 121 /* Inform µC that we have changed the brightness setting */
122 retval = vendor_command(cytherm->udev, WRITE_RAM, BRIGHTNESS_SEM, 122 retval = vendor_command(cytherm->udev, WRITE_RAM, BRIGHTNESS_SEM,
123 0x01, buffer, 8); 123 0x01, buffer, 8);
124 if (retval) 124 if (retval)
diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
index 5c0a26cbd12..cd137577bb2 100644
--- a/drivers/usb/misc/emi26.c
+++ b/drivers/usb/misc/emi26.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Emagic EMI 2|6 usb audio interface firmware loader. 2 * Emagic EMI 2|6 usb audio interface firmware loader.
3 * Copyright (C) 2002 3 * Copyright (C) 2002
4 * Tapio Laxström (tapio.laxstrom@iptime.fi) 4 * Tapio Laxström (tapio.laxstrom@iptime.fi)
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, as published by 7 * it under the terms of the GNU General Public License, as published by
@@ -249,7 +249,7 @@ static void __exit emi26_exit (void)
249module_init(emi26_init); 249module_init(emi26_init);
250module_exit(emi26_exit); 250module_exit(emi26_exit);
251 251
252MODULE_AUTHOR("tapio laxström"); 252MODULE_AUTHOR("Tapio Laxström");
253MODULE_DESCRIPTION("Emagic EMI 2|6 firmware loader."); 253MODULE_DESCRIPTION("Emagic EMI 2|6 firmware loader.");
254MODULE_LICENSE("GPL"); 254MODULE_LICENSE("GPL");
255 255
diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c
index 23153eac0df..4758cc5cceb 100644
--- a/drivers/usb/misc/emi62.c
+++ b/drivers/usb/misc/emi62.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Emagic EMI 2|6 usb audio interface firmware loader. 2 * Emagic EMI 2|6 usb audio interface firmware loader.
3 * Copyright (C) 2002 3 * Copyright (C) 2002
4 * Tapio Laxström (tapio.laxstrom@iptime.fi) 4 * Tapio Laxström (tapio.laxstrom@iptime.fi)
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, as published by 7 * it under the terms of the GNU General Public License, as published by
@@ -292,7 +292,7 @@ static void __exit emi62_exit (void)
292module_init(emi62_init); 292module_init(emi62_init);
293module_exit(emi62_exit); 293module_exit(emi62_exit);
294 294
295MODULE_AUTHOR("tapio laxström"); 295MODULE_AUTHOR("Tapio Laxström");
296MODULE_DESCRIPTION("Emagic EMI 6|2m firmware loader."); 296MODULE_DESCRIPTION("Emagic EMI 6|2m firmware loader.");
297MODULE_LICENSE("GPL"); 297MODULE_LICENSE("GPL");
298 298
diff --git a/drivers/usb/serial/ChangeLog.history b/drivers/usb/serial/ChangeLog.history
index 52c4f7bd7a8..c1b279939bb 100644
--- a/drivers/usb/serial/ChangeLog.history
+++ b/drivers/usb/serial/ChangeLog.history
@@ -400,7 +400,7 @@ visor.c Change Log comments:
400 400
401 (11/11/2001) gkh 401 (11/11/2001) gkh
402 Added support for the m125 devices, and added check to prevent oopses 402 Added support for the m125 devices, and added check to prevent oopses
403 for Clié devices that lie about the number of ports they have. 403 for Clié devices that lie about the number of ports they have.
404 404
405 (08/30/2001) gkh 405 (08/30/2001) gkh
406 Added support for the Clie devices, both the 3.5 and 4.0 os versions. 406 Added support for the Clie devices, both the 3.5 and 4.0 os versions.
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index 99fefed7791..4a86696e6c7 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -527,7 +527,7 @@ config USB_SERIAL_CYBERJACK
527 depends on USB_SERIAL && EXPERIMENTAL 527 depends on USB_SERIAL && EXPERIMENTAL
528 ---help--- 528 ---help---
529 Say Y here if you want to use a cyberJack pinpad/e-com USB chipcard 529 Say Y here if you want to use a cyberJack pinpad/e-com USB chipcard
530 reader. This is an interface to ISO 7816 compatible contactbased 530 reader. This is an interface to ISO 7816 compatible contact-based
531 chipcards, e.g. GSM SIMs. 531 chipcards, e.g. GSM SIMs.
532 532
533 To compile this driver as a module, choose M here: the 533 To compile this driver as a module, choose M here: the
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 65257867b34..8a8a6b9fb05 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -83,7 +83,7 @@
83 * 83 *
84 * (18/Jun/2003) Ian Abbott 84 * (18/Jun/2003) Ian Abbott
85 * Added Device ID of the USB relais from Rudolf Gugler (backported from 85 * Added Device ID of the USB relais from Rudolf Gugler (backported from
86 * Philipp Gühring's patch for 2.5.x kernel). 86 * Philipp Gühring's patch for 2.5.x kernel).
87 * Moved read transfer buffer reallocation into startup function. 87 * Moved read transfer buffer reallocation into startup function.
88 * Free existing write urb and transfer buffer in startup function. 88 * Free existing write urb and transfer buffer in startup function.
89 * Only use urbs in write urb pool that were successfully allocated. 89 * Only use urbs in write urb pool that were successfully allocated.
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index b57b90ae9f9..b51cbb0eaa0 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -17,7 +17,7 @@
17 * Bill Ryder - bryder@sgi.com formerly of Silicon Graphics, Inc.- wrote the 17 * Bill Ryder - bryder@sgi.com formerly of Silicon Graphics, Inc.- wrote the
18 * FTDI_SIO implementation. 18 * FTDI_SIO implementation.
19 * 19 *
20 * Philipp Gühring - pg@futureware.at - added the Device ID of the USB relais 20 * Philipp Gühring - pg@futureware.at - added the Device ID of the USB relais
21 * from Rudolf Gugler 21 * from Rudolf Gugler
22 * 22 *
23 */ 23 */
@@ -44,7 +44,7 @@
44#define FTDI_ACTZWAVE_PID 0xF2D0 44#define FTDI_ACTZWAVE_PID 0xF2D0
45 45
46 46
47/* www.starting-point-systems.com µChameleon device */ 47/* www.starting-point-systems.com µChameleon device */
48#define FTDI_MICRO_CHAMELEON_PID 0xCAA0 /* Product Id */ 48#define FTDI_MICRO_CHAMELEON_PID 0xCAA0 /* Product Id */
49 49
50/* www.irtrans.de device */ 50/* www.irtrans.de device */
@@ -419,7 +419,7 @@
419 419
420/* 420/*
421 * Teratronik product ids. 421 * Teratronik product ids.
422 * Submitted by O. Wölfelschneider. 422 * Submitted by O. Wölfelschneider.
423 */ 423 */
424#define FTDI_TERATRONIK_VCP_PID 0xEC88 /* Teratronik device (preferring VCP driver on windows) */ 424#define FTDI_TERATRONIK_VCP_PID 0xEC88 /* Teratronik device (preferring VCP driver on windows) */
425#define FTDI_TERATRONIK_D2XX_PID 0xEC89 /* Teratronik device (preferring D2XX driver on windows) */ 425#define FTDI_TERATRONIK_D2XX_PID 0xEC89 /* Teratronik device (preferring D2XX driver on windows) */
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index e836ad07fdb..9b38a08ac83 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -306,7 +306,7 @@ static struct usb_device_id ipaq_id_table [] = {
306 { USB_DEVICE(0x0930, 0x0705) }, /* TOSHIBA Pocket PC e310 */ 306 { USB_DEVICE(0x0930, 0x0705) }, /* TOSHIBA Pocket PC e310 */
307 { USB_DEVICE(0x0930, 0x0706) }, /* TOSHIBA Pocket PC e740 */ 307 { USB_DEVICE(0x0930, 0x0706) }, /* TOSHIBA Pocket PC e740 */
308 { USB_DEVICE(0x0930, 0x0707) }, /* TOSHIBA Pocket PC e330 Series */ 308 { USB_DEVICE(0x0930, 0x0707) }, /* TOSHIBA Pocket PC e330 Series */
309 { USB_DEVICE(0x0930, 0x0708) }, /* TOSHIBA Pocket PC e350 Series */ 309 { USB_DEVICE(0x0930, 0x0708) }, /* TOSHIBA Pocket PC e350 Series */
310 { USB_DEVICE(0x0930, 0x0709) }, /* TOSHIBA Pocket PC e750 Series */ 310 { USB_DEVICE(0x0930, 0x0709) }, /* TOSHIBA Pocket PC e750 Series */
311 { USB_DEVICE(0x0930, 0x070A) }, /* TOSHIBA Pocket PC e400 Series */ 311 { USB_DEVICE(0x0930, 0x070A) }, /* TOSHIBA Pocket PC e400 Series */
312 { USB_DEVICE(0x0930, 0x070B) }, /* TOSHIBA Pocket PC e800 Series */ 312 { USB_DEVICE(0x0930, 0x070B) }, /* TOSHIBA Pocket PC e800 Series */
@@ -488,7 +488,7 @@ static struct usb_device_id ipaq_id_table [] = {
488 { USB_DEVICE(0x0BF8, 0x1001) }, /* Fujitsu Siemens Computers USB Sync */ 488 { USB_DEVICE(0x0BF8, 0x1001) }, /* Fujitsu Siemens Computers USB Sync */
489 { USB_DEVICE(0x0C44, 0x03A2) }, /* Motorola iDEN Smartphone */ 489 { USB_DEVICE(0x0C44, 0x03A2) }, /* Motorola iDEN Smartphone */
490 { USB_DEVICE(0x0C8E, 0x6000) }, /* Cesscom Luxian Series */ 490 { USB_DEVICE(0x0C8E, 0x6000) }, /* Cesscom Luxian Series */
491 { USB_DEVICE(0x0CAD, 0x9001) }, /* Motorola PowerPad Pocket PC Device */ 491 { USB_DEVICE(0x0CAD, 0x9001) }, /* Motorola PowerPad Pocket PC Device */
492 { USB_DEVICE(0x0F4E, 0x0200) }, /* Freedom Scientific USB Sync */ 492 { USB_DEVICE(0x0F4E, 0x0200) }, /* Freedom Scientific USB Sync */
493 { USB_DEVICE(0x0F98, 0x0201) }, /* Cyberbank USB Sync */ 493 { USB_DEVICE(0x0F98, 0x0201) }, /* Cyberbank USB Sync */
494 { USB_DEVICE(0x0FB8, 0x3001) }, /* Wistron USB Sync */ 494 { USB_DEVICE(0x0FB8, 0x3001) }, /* Wistron USB Sync */
diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
index 6831dca93c1..93a7724e167 100644
--- a/drivers/usb/storage/isd200.c
+++ b/drivers/usb/storage/isd200.c
@@ -3,7 +3,7 @@
3 * $Id: isd200.c,v 1.16 2002/04/22 03:39:43 mdharm Exp $ 3 * $Id: isd200.c,v 1.16 2002/04/22 03:39:43 mdharm Exp $
4 * 4 *
5 * Current development and maintenance: 5 * Current development and maintenance:
6 * (C) 2001-2002 Björn Stenberg (bjorn@haxx.se) 6 * (C) 2001-2002 Björn Stenberg (bjorn@haxx.se)
7 * 7 *
8 * Developed with the assistance of: 8 * Developed with the assistance of:
9 * (C) 2002 Alan Stern <stern@rowland.org> 9 * (C) 2002 Alan Stern <stern@rowland.org>
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 9b656ec427d..22ab2380367 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -407,7 +407,7 @@ UNUSUAL_DEV( 0x04cb, 0x0100, 0x0000, 0x2210,
407 "FinePix 1400Zoom", 407 "FinePix 1400Zoom",
408 US_SC_UFI, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY | US_FL_SINGLE_LUN), 408 US_SC_UFI, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY | US_FL_SINGLE_LUN),
409 409
410/* Reported by Peter Wächtler <pwaechtler@loewe-komp.de> 410/* Reported by Peter Wächtler <pwaechtler@loewe-komp.de>
411 * The device needs the flags only. 411 * The device needs the flags only.
412 */ 412 */
413UNUSUAL_DEV( 0x04ce, 0x0002, 0x0074, 0x0074, 413UNUSUAL_DEV( 0x04ce, 0x0002, 0x0074, 0x0074,
@@ -1551,7 +1551,7 @@ UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999,
1551 US_FL_GO_SLOW ), 1551 US_FL_GO_SLOW ),
1552 1552
1553/* 1553/*
1554 * David Härdeman <david@2gen.com> 1554 * David Härdeman <david@2gen.com>
1555 * The key makes the SCSI stack print confusing (but harmless) messages 1555 * The key makes the SCSI stack print confusing (but harmless) messages
1556 */ 1556 */
1557UNUSUAL_DEV( 0x4146, 0xba01, 0x0100, 0x0100, 1557UNUSUAL_DEV( 0x4146, 0xba01, 0x0100, 0x0100,
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index b3bf4ecc983..fb9d8d0b2c0 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -661,7 +661,7 @@ config FB_HECUBA
661 help 661 help
662 This enables support for the Hecuba board. This driver was tested 662 This enables support for the Hecuba board. This driver was tested
663 with an E-Ink 800x600 display and x86 SBCs through a 16 bit GPIO 663 with an E-Ink 800x600 display and x86 SBCs through a 16 bit GPIO
664 interface (8 bit data, 4 bit control). If you anticpate using 664 interface (8 bit data, 4 bit control). If you anticipate using
665 this driver, say Y or M; otherwise say N. You must specify the 665 this driver, say Y or M; otherwise say N. You must specify the
666 GPIO IO address to be used for setting control and data. 666 GPIO IO address to be used for setting control and data.
667 667
@@ -815,7 +815,7 @@ config FB_XVR500
815 help 815 help
816 This is the framebuffer device for the Sun XVR-500 and similar 816 This is the framebuffer device for the Sun XVR-500 and similar
817 graphics cards based upon the 3DLABS Wildcat chipset. The driver 817 graphics cards based upon the 3DLABS Wildcat chipset. The driver
818 only works on sparc64 systems where the system firwmare has 818 only works on sparc64 systems where the system firmware has
819 mostly initialized the card already. It is treated as a 819 mostly initialized the card already. It is treated as a
820 completely dumb framebuffer device. 820 completely dumb framebuffer device.
821 821
@@ -828,7 +828,7 @@ config FB_XVR2500
828 help 828 help
829 This is the framebuffer device for the Sun XVR-2500 and similar 829 This is the framebuffer device for the Sun XVR-2500 and similar
830 graphics cards based upon the 3DLABS Wildcat chipset. The driver 830 graphics cards based upon the 3DLABS Wildcat chipset. The driver
831 only works on sparc64 systems where the system firwmare has 831 only works on sparc64 systems where the system firmware has
832 mostly initialized the card already. It is treated as a 832 mostly initialized the card already. It is treated as a
833 completely dumb framebuffer device. 833 completely dumb framebuffer device.
834 834
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c
index f2e243c353f..4c9ec3f58c5 100644
--- a/drivers/video/amifb.c
+++ b/drivers/video/amifb.c
@@ -112,7 +112,7 @@
112 +----------+---------------------------------------------+----------+-------+ 112 +----------+---------------------------------------------+----------+-------+
113 | | ^ | | | 113 | | ^ | | |
114 | | |upper_margin | | | 114 | | |upper_margin | | |
115 | | ¥ | | | 115 | | v | | |
116 +----------###############################################----------+-------+ 116 +----------###############################################----------+-------+
117 | # ^ # | | 117 | # ^ # | |
118 | # | # | | 118 | # | # | |
@@ -133,15 +133,15 @@
133 | # | # | | 133 | # | # | |
134 | # | # | | 134 | # | # | |
135 | # | # | | 135 | # | # | |
136 | # ¥ # | | 136 | # v # | |
137 +----------###############################################----------+-------+ 137 +----------###############################################----------+-------+
138 | | ^ | | | 138 | | ^ | | |
139 | | |lower_margin | | | 139 | | |lower_margin | | |
140 | | ¥ | | | 140 | | v | | |
141 +----------+---------------------------------------------+----------+-------+ 141 +----------+---------------------------------------------+----------+-------+
142 | | ^ | | | 142 | | ^ | | |
143 | | |vsync_len | | | 143 | | |vsync_len | | |
144 | | ¥ | | | 144 | | v | | |
145 +----------+---------------------------------------------+----------+-------+ 145 +----------+---------------------------------------------+----------+-------+
146 146
147 147
@@ -325,7 +325,7 @@
325 CCIR -> PAL 325 CCIR -> PAL
326 ----------- 326 -----------
327 327
328 - a scanline is 64 µs long, of which 52.48 µs are visible. This is about 328 - a scanline is 64 µs long, of which 52.48 µs are visible. This is about
329 736 visible 70 ns pixels per line. 329 736 visible 70 ns pixels per line.
330 - we have 625 scanlines, of which 575 are visible (interlaced); after 330 - we have 625 scanlines, of which 575 are visible (interlaced); after
331 rounding this becomes 576. 331 rounding this becomes 576.
@@ -333,7 +333,7 @@
333 RETMA -> NTSC 333 RETMA -> NTSC
334 ------------- 334 -------------
335 335
336 - a scanline is 63.5 µs long, of which 53.5 µs are visible. This is about 336 - a scanline is 63.5 µs long, of which 53.5 µs are visible. This is about
337 736 visible 70 ns pixels per line. 337 736 visible 70 ns pixels per line.
338 - we have 525 scanlines, of which 485 are visible (interlaced); after 338 - we have 525 scanlines, of which 485 are visible (interlaced); after
339 rounding this becomes 484. 339 rounding this becomes 484.
@@ -802,7 +802,7 @@ static u_short ecs_palette[32];
802 802
803static u_short do_vmode_full = 0; /* Change the Video Mode */ 803static u_short do_vmode_full = 0; /* Change the Video Mode */
804static u_short do_vmode_pan = 0; /* Update the Video Mode */ 804static u_short do_vmode_pan = 0; /* Update the Video Mode */
805static short do_blank = 0; /* (Un)Blank the Screen (±1) */ 805static short do_blank = 0; /* (Un)Blank the Screen (±1) */
806static u_short do_cursor = 0; /* Move the Cursor */ 806static u_short do_cursor = 0; /* Move the Cursor */
807 807
808 808
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index abe0c435a66..d775eb6590b 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -26,7 +26,7 @@
26 * Anthony Tong <atong@uiuc.edu> 26 * Anthony Tong <atong@uiuc.edu>
27 * 27 *
28 * Generic LCD support written by Daniel Mantione, ported from 2.4.20 by Alex Kern 28 * Generic LCD support written by Daniel Mantione, ported from 2.4.20 by Alex Kern
29 * Many Thanks to Ville Syrjälä for patches and fixing nasting 16 bit color bug. 29 * Many Thanks to Ville Syrjälä for patches and fixing nasting 16 bit color bug.
30 * 30 *
31 * This file is subject to the terms and conditions of the GNU General Public 31 * This file is subject to the terms and conditions of the GNU General Public
32 * License. See the file COPYING in the main directory of this archive for 32 * License. See the file COPYING in the main directory of this archive for
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index a22ccf9485a..267422f6625 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -27,7 +27,7 @@ config VGACON_SOFT_SCROLLBACK
27 The scrollback buffer of the standard VGA console is located in 27 The scrollback buffer of the standard VGA console is located in
28 the VGA RAM. The size of this RAM is fixed and is quite small. 28 the VGA RAM. The size of this RAM is fixed and is quite small.
29 If you require a larger scrollback buffer, this can be placed in 29 If you require a larger scrollback buffer, this can be placed in
30 System RAM which is dynamically allocated during intialization. 30 System RAM which is dynamically allocated during initialization.
31 Placing the scrollback buffer in System RAM will slightly slow 31 Placing the scrollback buffer in System RAM will slightly slow
32 down the console. 32 down the console.
33 33
diff --git a/drivers/video/geode/video_gx.c b/drivers/video/geode/video_gx.c
index 7f3f18d0671..febf09c6349 100644
--- a/drivers/video/geode/video_gx.c
+++ b/drivers/video/geode/video_gx.c
@@ -127,7 +127,7 @@ static void gx_set_dclk_frequency(struct fb_info *info)
127 int timeout = 1000; 127 int timeout = 1000;
128 128
129 /* Rev. 1 Geode GXs use a 14 MHz reference clock instead of 48 MHz. */ 129 /* Rev. 1 Geode GXs use a 14 MHz reference clock instead of 48 MHz. */
130 if (cpu_data->x86_mask == 1) { 130 if (cpu_data(0).x86_mask == 1) {
131 pll_table = gx_pll_table_14MHz; 131 pll_table = gx_pll_table_14MHz;
132 pll_table_len = ARRAY_SIZE(gx_pll_table_14MHz); 132 pll_table_len = ARRAY_SIZE(gx_pll_table_14MHz);
133 } else { 133 } else {
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index e8e38edb9b5..481d58f7535 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -4,7 +4,7 @@
4 * Linux framebuffer driver for Intel(R) 830M/845G/852GM/855GM/865G/915G/915GM/ 4 * Linux framebuffer driver for Intel(R) 830M/845G/852GM/855GM/865G/915G/915GM/
5 * 945G/945GM integrated graphics chips. 5 * 945G/945GM integrated graphics chips.
6 * 6 *
7 * Copyright © 2002, 2003 David Dawes <dawes@xfree86.org> 7 * Copyright © 2002, 2003 David Dawes <dawes@xfree86.org>
8 * 2004 Sylvain Meyer 8 * 2004 Sylvain Meyer
9 * 2006 David Airlie 9 * 2006 David Airlie
10 * 10 *
diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c
index 2a0e32074f7..5f6fb7d2c40 100644
--- a/drivers/video/intelfb/intelfbhw.c
+++ b/drivers/video/intelfb/intelfbhw.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Linux framebuffer driver for Intel(R) 865G integrated graphics chips. 4 * Linux framebuffer driver for Intel(R) 865G integrated graphics chips.
5 * 5 *
6 * Copyright © 2002, 2003 David Dawes <dawes@xfree86.org> 6 * Copyright © 2002, 2003 David Dawes <dawes@xfree86.org>
7 * 2004 Sylvain Meyer 7 * 2004 Sylvain Meyer
8 * 8 *
9 * This driver consists of two parts. The first part (intelfbdrv.c) provides 9 * This driver consists of two parts. The first part (intelfbdrv.c) provides
diff --git a/drivers/video/omap/Kconfig b/drivers/video/omap/Kconfig
index 7f4d25b8a18..f4fcf11b290 100644
--- a/drivers/video/omap/Kconfig
+++ b/drivers/video/omap/Kconfig
@@ -8,7 +8,7 @@ config FB_OMAP
8 Frame buffer driver for OMAP based boards. 8 Frame buffer driver for OMAP based boards.
9 9
10config FB_OMAP_BOOTLOADER_INIT 10config FB_OMAP_BOOTLOADER_INIT
11 bool "Check bootloader initializaion" 11 bool "Check bootloader initialization"
12 depends on FB_OMAP 12 depends on FB_OMAP
13 help 13 help
14 Say Y here if you want to enable checking if the bootloader has 14 Say Y here if you want to enable checking if the bootloader has
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index ae08d458709..5857ccf5f6b 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -56,7 +56,7 @@
56 * - Add support for different devices 56 * - Add support for different devices
57 * - Backlight support 57 * - Backlight support
58 * 58 *
59 * 2004-09-05: Herbert Pötzl <herbert@13thfloor.at> 59 * 2004-09-05: Herbert Pötzl <herbert@13thfloor.at>
60 * - added clock (de-)allocation code 60 * - added clock (de-)allocation code
61 * - added fixem fbmem option 61 * - added fixem fbmem option
62 * 62 *
@@ -64,7 +64,7 @@
64 * - code cleanup 64 * - code cleanup
65 * - added a forgotten return in h1940fb_init 65 * - added a forgotten return in h1940fb_init
66 * 66 *
67 * 2004-07-19: Herbert Pötzl <herbert@13thfloor.at> 67 * 2004-07-19: Herbert Pötzl <herbert@13thfloor.at>
68 * - code cleanup and extended debugging 68 * - code cleanup and extended debugging
69 * 69 *
70 * 2004-07-15: Arnaud Patard <arnaud.patard@rtp-net.org> 70 * 2004-07-15: Arnaud Patard <arnaud.patard@rtp-net.org>
diff --git a/drivers/video/vermilion/vermilion.c b/drivers/video/vermilion/vermilion.c
index ff9e805c43b..c31f549ebea 100644
--- a/drivers/video/vermilion/vermilion.c
+++ b/drivers/video/vermilion/vermilion.c
@@ -23,8 +23,8 @@
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 * 24 *
25 * Authors: 25 * Authors:
26 * Thomas Hellström <thomas-at-tungstengraphics-dot-com> 26 * Thomas Hellström <thomas-at-tungstengraphics-dot-com>
27 * Michel Dänzer <michel-at-tungstengraphics-dot-com> 27 * Michel Dänzer <michel-at-tungstengraphics-dot-com>
28 * Alan Hourihane <alanh-at-tungstengraphics-dot-com> 28 * Alan Hourihane <alanh-at-tungstengraphics-dot-com>
29 */ 29 */
30 30
diff --git a/drivers/video/vermilion/vermilion.h b/drivers/video/vermilion/vermilion.h
index 1fc6695a49d..c4aba59d480 100644
--- a/drivers/video/vermilion/vermilion.h
+++ b/drivers/video/vermilion/vermilion.h
@@ -23,7 +23,7 @@
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 * 24 *
25 * Authors: 25 * Authors:
26 * Thomas Hellström <thomas-at-tungstengraphics-dot-com> 26 * Thomas Hellström <thomas-at-tungstengraphics-dot-com>
27 */ 27 */
28 28
29#ifndef _VERMILION_H_ 29#ifndef _VERMILION_H_
diff --git a/drivers/watchdog/i6300esb.c b/drivers/watchdog/i6300esb.c
index c5982502c03..f236954d253 100644
--- a/drivers/watchdog/i6300esb.c
+++ b/drivers/watchdog/i6300esb.c
@@ -2,7 +2,7 @@
2 * i6300esb: Watchdog timer driver for Intel 6300ESB chipset 2 * i6300esb: Watchdog timer driver for Intel 6300ESB chipset
3 * 3 *
4 * (c) Copyright 2004 Google Inc. 4 * (c) Copyright 2004 Google Inc.
5 * (c) Copyright 2005 David Härdeman <david@2gen.com> 5 * (c) Copyright 2005 David Härdeman <david@2gen.com>
6 * 6 *
7 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License 8 * modify it under the terms of the GNU General Public License
@@ -19,7 +19,7 @@
19 * Initial version 0.01 19 * Initial version 0.01
20 * 2004YYZZ Ross Biro 20 * 2004YYZZ Ross Biro
21 * Version 0.02 21 * Version 0.02
22 * 20050210 David Härdeman <david@2gen.com> 22 * 20050210 David Härdeman <david@2gen.com>
23 * Ported driver to kernel 2.6 23 * Ported driver to kernel 2.6
24 */ 24 */
25 25
@@ -521,7 +521,7 @@ static void __exit watchdog_cleanup (void)
521module_init(watchdog_init); 521module_init(watchdog_init);
522module_exit(watchdog_cleanup); 522module_exit(watchdog_cleanup);
523 523
524MODULE_AUTHOR("Ross Biro and David Härdeman"); 524MODULE_AUTHOR("Ross Biro and David Härdeman");
525MODULE_DESCRIPTION("Watchdog driver for Intel 6300ESB chipsets"); 525MODULE_DESCRIPTION("Watchdog driver for Intel 6300ESB chipsets");
526MODULE_LICENSE("GPL"); 526MODULE_LICENSE("GPL");
527MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 527MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/iTCO_vendor_support.c b/drivers/watchdog/iTCO_vendor_support.c
index 41508399009..cafc465f2ae 100644
--- a/drivers/watchdog/iTCO_vendor_support.c
+++ b/drivers/watchdog/iTCO_vendor_support.c
@@ -115,7 +115,7 @@ static void supermicro_old_pre_keepalive(unsigned long acpibase)
115 * For P4DPx: 115 * For P4DPx:
116 * BIOS setup -> Advanced -> I/O Device Configuration -> Watch Dog 116 * BIOS setup -> Advanced -> I/O Device Configuration -> Watch Dog
117 * This setting enables or disables Watchdog function. When enabled, the 117 * This setting enables or disables Watchdog function. When enabled, the
118 * default watchdog timer is set to be 5 minutes (about 4’35â€). It is 118 * default watchdog timer is set to be 5 minutes (about 4m35s). It is
119 * enough to load and run the OS. The application (service or driver) has 119 * enough to load and run the OS. The application (service or driver) has
120 * to take over the control once OS is running up and before watchdog 120 * to take over the control once OS is running up and before watchdog
121 * expires. 121 * expires.
diff --git a/drivers/watchdog/w83697hf_wdt.c b/drivers/watchdog/w83697hf_wdt.c
index d9e821d08de..51826c216d6 100644
--- a/drivers/watchdog/w83697hf_wdt.c
+++ b/drivers/watchdog/w83697hf_wdt.c
@@ -8,7 +8,7 @@
8 * which is based on wdt.c. 8 * which is based on wdt.c.
9 * Original copyright messages: 9 * Original copyright messages:
10 * 10 *
11 * (c) Copyright 2003 Pádraig Brady <P@draigBrady.com> 11 * (c) Copyright 2003 Pádraig Brady <P@draigBrady.com>
12 * 12 *
13 * (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl> 13 * (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
14 * 14 *
diff --git a/drivers/zorro/zorro.ids b/drivers/zorro/zorro.ids
index 5bd4b05d4c4..560fef2a7b1 100644
--- a/drivers/zorro/zorro.ids
+++ b/drivers/zorro/zorro.ids
@@ -295,7 +295,7 @@
295 0100 RH 800C [HD Controller] 295 0100 RH 800C [HD Controller]
296 0200 RH 800C [RAM Expansion] 296 0200 RH 800C [RAM Expansion]
2970861 Kato 2970861 Kato
298# The Rainbow II and III are actually made by Ingenieurbüro Helfrich 298# The Rainbow II and III are actually made by Ingenieurbüro Helfrich
299 2000 Rainbow II [Graphics Card] 299 2000 Rainbow II [Graphics Card]
300 2100 Rainbow III [Graphics Card] 300 2100 Rainbow III [Graphics Card]
301 8000 Melody MPEG [Audio Card] 301 8000 Melody MPEG [Audio Card]