aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-11-12 22:53:33 -0500
committerSteve French <sfrench@us.ibm.com>2005-11-12 22:53:33 -0500
commit1b98a8221e3c9c86ae7e292ba7542d2dd6f10eb9 (patch)
tree2e0051ccb147b0553d50c14681c50881098859d6 /drivers
parente89dc9209692293434da45ec31826a55becb91c0 (diff)
parent9e6c67fd2716720d9029d38ea25884efcfdedeb6 (diff)
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/platform.c73
-rw-r--r--drivers/block/acsi.c1
-rw-r--r--drivers/block/cciss.c188
-rw-r--r--drivers/block/cciss.h11
-rw-r--r--drivers/block/cciss_scsi.c82
-rw-r--r--drivers/block/floppy.c8
-rw-r--r--drivers/char/ftape/lowlevel/ftape-buffer.c1
-rw-r--r--drivers/char/i8k.c6
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c6
-rw-r--r--drivers/char/s3c2410-rtc.c50
-rw-r--r--drivers/char/sonypi.c19
-rw-r--r--drivers/char/tb0219.c15
-rw-r--r--drivers/char/vr41xx_giu.c15
-rw-r--r--drivers/char/vr41xx_rtc.c17
-rw-r--r--drivers/char/watchdog/mpcore_wdt.c30
-rw-r--r--drivers/char/watchdog/mv64x60_wdt.c20
-rw-r--r--drivers/char/watchdog/s3c2410_wdt.c30
-rw-r--r--drivers/hwmon/hdaps.c62
-rw-r--r--drivers/i2c/busses/i2c-iop3xx.c27
-rw-r--r--drivers/i2c/busses/i2c-ixp2000.c25
-rw-r--r--drivers/i2c/busses/i2c-ixp4xx.c25
-rw-r--r--drivers/i2c/busses/i2c-mpc.c24
-rw-r--r--drivers/i2c/busses/i2c-mv64xxx.c24
-rw-r--r--drivers/i2c/busses/i2c-pxa.c25
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c71
-rw-r--r--drivers/i2c/chips/isp1301_omap.c21
-rw-r--r--drivers/input/keyboard/corgikbd.c29
-rw-r--r--drivers/input/keyboard/spitzkbd.c29
-rw-r--r--drivers/input/serio/i8042.c19
-rw-r--r--drivers/input/serio/rpckbd.c21
-rw-r--r--drivers/input/touchscreen/corgi_ts.c32
-rw-r--r--drivers/media/dvb/b2c2/Kconfig1
-rw-r--r--drivers/mfd/mcp-sa11x0.c32
-rw-r--r--drivers/misc/hdpuftrs/hdpu_cpustate.c20
-rw-r--r--drivers/misc/hdpuftrs/hdpu_nexus.c20
-rw-r--r--drivers/mmc/pxamci.c42
-rw-r--r--drivers/mmc/wbsd.c34
-rw-r--r--drivers/mtd/maps/bast-flash.c33
-rw-r--r--drivers/mtd/maps/integrator-flash.c23
-rw-r--r--drivers/mtd/maps/ixp2000.c25
-rw-r--r--drivers/mtd/maps/ixp4xx.c25
-rw-r--r--drivers/mtd/maps/omap_nor.c23
-rw-r--r--drivers/mtd/maps/plat-ram.c68
-rw-r--r--drivers/mtd/maps/sa1100-flash.c36
-rw-r--r--drivers/mtd/nand/s3c2410.c77
-rw-r--r--drivers/net/Kconfig2
-rw-r--r--drivers/net/depca.c26
-rw-r--r--drivers/net/dm9000.c35
-rw-r--r--drivers/net/forcedeth.c231
-rw-r--r--drivers/net/gianfar.c28
-rw-r--r--drivers/net/gianfar_mii.c2
-rw-r--r--drivers/net/gt96100eth.c10
-rw-r--r--drivers/net/ibmveth.c2
-rw-r--r--drivers/net/irda/sa1100_ir.c28
-rw-r--r--drivers/net/irda/smsc-ircc2.c27
-rw-r--r--drivers/net/jazzsonic.c21
-rw-r--r--drivers/net/macsonic.c21
-rw-r--r--drivers/net/mv643xx_eth.c40
-rw-r--r--drivers/net/saa9730.c613
-rw-r--r--drivers/net/smc91x.c38
-rw-r--r--drivers/net/smc91x.h32
-rw-r--r--drivers/net/tokenring/proteon.c17
-rw-r--r--drivers/net/tokenring/skisa.c17
-rw-r--r--drivers/net/wireless/Kconfig2
-rw-r--r--drivers/net/wireless/atmel.c88
-rw-r--r--drivers/net/wireless/atmel.h4
-rw-r--r--drivers/net/wireless/atmel_cs.c176
-rw-r--r--drivers/net/wireless/atmel_pci.c2
-rw-r--r--drivers/s390/net/lcs.c4
-rw-r--r--drivers/s390/net/qeth.h77
-rw-r--r--drivers/s390/net/qeth_main.c261
-rw-r--r--drivers/s390/net/qeth_mpc.c2
-rw-r--r--drivers/s390/net/qeth_mpc.h13
-rw-r--r--drivers/s390/net/qeth_sys.c8
-rw-r--r--drivers/s390/net/qeth_tso.h2
-rw-r--r--drivers/sbus/char/display7seg.c2
-rw-r--r--drivers/sbus/char/rtc.c22
-rw-r--r--drivers/scsi/53c7xx.c6
-rw-r--r--drivers/scsi/53c7xx.h2
-rw-r--r--drivers/scsi/Kconfig29
-rw-r--r--drivers/scsi/Makefile1
-rw-r--r--drivers/scsi/NCR53C9x.c10
-rw-r--r--drivers/scsi/NCR53C9x.h6
-rw-r--r--drivers/scsi/NCR53c406a.c4
-rw-r--r--drivers/scsi/a2091.c4
-rw-r--r--drivers/scsi/a2091.h2
-rw-r--r--drivers/scsi/a3000.c4
-rw-r--r--drivers/scsi/a3000.h2
-rw-r--r--drivers/scsi/aacraid/aachba.c23
-rw-r--r--drivers/scsi/aacraid/commsup.c4
-rw-r--r--drivers/scsi/advansys.c6
-rw-r--r--drivers/scsi/advansys.h2
-rw-r--r--drivers/scsi/aha152x.c4
-rw-r--r--drivers/scsi/aha1542.c4
-rw-r--r--drivers/scsi/aha1542.h2
-rw-r--r--drivers/scsi/aha1740.c2
-rw-r--r--drivers/scsi/ahci.c34
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.c37
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.c39
-rw-r--r--drivers/scsi/aic7xxx_old.c18
-rw-r--r--drivers/scsi/amiga7xx.c8
-rw-r--r--drivers/scsi/amiga7xx.h2
-rw-r--r--drivers/scsi/arm/acornscsi.c6
-rw-r--r--drivers/scsi/arm/acornscsi.h2
-rw-r--r--drivers/scsi/arm/arxescsi.c8
-rw-r--r--drivers/scsi/arm/cumana_1.c2
-rw-r--r--drivers/scsi/arm/cumana_2.c8
-rw-r--r--drivers/scsi/arm/ecoscsi.c2
-rw-r--r--drivers/scsi/arm/eesox.c8
-rw-r--r--drivers/scsi/arm/fas216.c10
-rw-r--r--drivers/scsi/arm/fas216.h8
-rw-r--r--drivers/scsi/arm/oak.c2
-rw-r--r--drivers/scsi/arm/powertec.c6
-rw-r--r--drivers/scsi/arm/scsi.h8
-rw-r--r--drivers/scsi/ata_piix.c2
-rw-r--r--drivers/scsi/atari_NCR5380.c2
-rw-r--r--drivers/scsi/atari_scsi.c4
-rw-r--r--drivers/scsi/atari_scsi.h2
-rw-r--r--drivers/scsi/blz1230.c4
-rw-r--r--drivers/scsi/blz2060.c4
-rw-r--r--drivers/scsi/bvme6000.c4
-rw-r--r--drivers/scsi/bvme6000.h2
-rw-r--r--drivers/scsi/cyberstorm.c4
-rw-r--r--drivers/scsi/cyberstormII.c4
-rw-r--r--drivers/scsi/dec_esp.c2
-rw-r--r--drivers/scsi/dpti.h2
-rw-r--r--drivers/scsi/dtc.c6
-rw-r--r--drivers/scsi/dtc.h2
-rw-r--r--drivers/scsi/fastlane.c4
-rw-r--r--drivers/scsi/fcal.c8
-rw-r--r--drivers/scsi/fcal.h4
-rw-r--r--drivers/scsi/fd_mcs.c4
-rw-r--r--drivers/scsi/g_NCR5380.c6
-rw-r--r--drivers/scsi/g_NCR5380.h2
-rw-r--r--drivers/scsi/gdth.c12
-rw-r--r--drivers/scsi/gdth.h4
-rw-r--r--drivers/scsi/gdth_proc.c10
-rw-r--r--drivers/scsi/gvp11.c4
-rw-r--r--drivers/scsi/gvp11.h2
-rw-r--r--drivers/scsi/ibmmca.c8
-rw-r--r--drivers/scsi/ibmmca.h2
-rw-r--r--drivers/scsi/ide-scsi.c2
-rw-r--r--drivers/scsi/in2000.c4
-rw-r--r--drivers/scsi/in2000.h2
-rw-r--r--drivers/scsi/ipr.c904
-rw-r--r--drivers/scsi/ipr.h243
-rw-r--r--drivers/scsi/ips.c150
-rw-r--r--drivers/scsi/ips.h4
-rw-r--r--drivers/scsi/jazz_esp.c4
-rw-r--r--drivers/scsi/libata-core.c2
-rw-r--r--drivers/scsi/libata-scsi.c42
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c1
-rw-r--r--drivers/scsi/mac_esp.c4
-rw-r--r--drivers/scsi/mac_scsi.c6
-rw-r--r--drivers/scsi/mca_53c9x.c4
-rw-r--r--drivers/scsi/megaraid.c34
-rw-r--r--drivers/scsi/megaraid.h10
-rw-r--r--drivers/scsi/megaraid/mega_common.h2
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.c81
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.c5
-rw-r--r--drivers/scsi/mvme147.c4
-rw-r--r--drivers/scsi/mvme147.h2
-rw-r--r--drivers/scsi/mvme16x.c4
-rw-r--r--drivers/scsi/mvme16x.h2
-rw-r--r--drivers/scsi/nsp32.c6
-rw-r--r--drivers/scsi/oktagon_esp.c4
-rw-r--r--drivers/scsi/pas16.c6
-rw-r--r--drivers/scsi/pas16.h2
-rw-r--r--drivers/scsi/pci2000.h2
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c8
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.h6
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c4
-rw-r--r--drivers/scsi/pdc_adma.c2
-rw-r--r--drivers/scsi/pluto.c8
-rw-r--r--drivers/scsi/pluto.h4
-rw-r--r--drivers/scsi/psi240i.c4
-rw-r--r--drivers/scsi/qla1280.c8
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.c8
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c28
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c10
-rw-r--r--drivers/scsi/qla2xxx/qla_sup.c5
-rw-r--r--drivers/scsi/qla2xxx/qla_version.h4
-rw-r--r--drivers/scsi/qlogicfas.c6
-rw-r--r--drivers/scsi/qlogicfc.c4
-rw-r--r--drivers/scsi/qlogicisp.c1934
-rw-r--r--drivers/scsi/qlogicisp_asm.c2034
-rw-r--r--drivers/scsi/raid_class.c96
-rw-r--r--drivers/scsi/sata_mv.c4
-rw-r--r--drivers/scsi/sata_nv.c2
-rw-r--r--drivers/scsi/sata_promise.c2
-rw-r--r--drivers/scsi/sata_qstor.c11
-rw-r--r--drivers/scsi/sata_sil.c2
-rw-r--r--drivers/scsi/sata_sil24.c2
-rw-r--r--drivers/scsi/sata_sis.c2
-rw-r--r--drivers/scsi/sata_svw.c2
-rw-r--r--drivers/scsi/sata_sx4.c2
-rw-r--r--drivers/scsi/sata_uli.c2
-rw-r--r--drivers/scsi/sata_via.c2
-rw-r--r--drivers/scsi/sata_vsc.c2
-rw-r--r--drivers/scsi/scsi_debug.c2
-rw-r--r--drivers/scsi/scsi_error.c157
-rw-r--r--drivers/scsi/scsi_lib.c58
-rw-r--r--drivers/scsi/scsi_priv.h1
-rw-r--r--drivers/scsi/scsi_scan.c54
-rw-r--r--drivers/scsi/scsi_sysfs.c9
-rw-r--r--drivers/scsi/scsi_typedefs.h3
-rw-r--r--drivers/scsi/sd.c22
-rw-r--r--drivers/scsi/seagate.c4
-rw-r--r--drivers/scsi/seagate.h2
-rw-r--r--drivers/scsi/sgiwd93.c6
-rw-r--r--drivers/scsi/sun3_NCR5380.c2
-rw-r--r--drivers/scsi/sun3_scsi.c6
-rw-r--r--drivers/scsi/sun3_scsi.h2
-rw-r--r--drivers/scsi/sun3_scsi_vme.c6
-rw-r--r--drivers/scsi/sun3x_esp.c4
-rw-r--r--drivers/scsi/sym53c416.c4
-rw-r--r--drivers/scsi/sym53c416.h2
-rw-r--r--drivers/scsi/t128.c6
-rw-r--r--drivers/scsi/t128.h2
-rw-r--r--drivers/scsi/u14-34f.c2
-rw-r--r--drivers/scsi/ultrastor.c8
-rw-r--r--drivers/scsi/ultrastor.h2
-rw-r--r--drivers/serial/8250.c31
-rw-r--r--drivers/serial/imx.c31
-rw-r--r--drivers/serial/mpc52xx_uart.c32
-rw-r--r--drivers/serial/mpsc.c65
-rw-r--r--drivers/serial/pxa.c33
-rw-r--r--drivers/serial/s3c2410.c62
-rw-r--r--drivers/serial/sa1100.c32
-rw-r--r--drivers/serial/vr41xx_siu.c27
-rw-r--r--drivers/usb/gadget/dummy_hcd.c76
-rw-r--r--drivers/usb/gadget/lh7a40x_udc.c31
-rw-r--r--drivers/usb/gadget/omap_udc.c61
-rw-r--r--drivers/usb/gadget/pxa2xx_udc.c41
-rw-r--r--drivers/usb/host/isp116x-hcd.c37
-rw-r--r--drivers/usb/host/ohci-au1xxx.c31
-rw-r--r--drivers/usb/host/ohci-lh7a404.c31
-rw-r--r--drivers/usb/host/ohci-omap.c35
-rw-r--r--drivers/usb/host/ohci-ppc-soc.c21
-rw-r--r--drivers/usb/host/ohci-pxa27x.c31
-rw-r--r--drivers/usb/host/ohci-s3c2410.c21
-rw-r--r--drivers/usb/host/sl811-hcd.c61
-rw-r--r--drivers/usb/image/microtek.c2
-rw-r--r--drivers/video/acornfb.c13
-rw-r--r--drivers/video/arcfb.c22
-rw-r--r--drivers/video/backlight/corgi_bl.c21
-rw-r--r--drivers/video/bw2.c3
-rw-r--r--drivers/video/cg14.c3
-rw-r--r--drivers/video/cg3.c3
-rw-r--r--drivers/video/cg6.c3
-rw-r--r--drivers/video/console/Kconfig7
-rw-r--r--drivers/video/console/Makefile1
-rw-r--r--drivers/video/console/font_rl.c4374
-rw-r--r--drivers/video/console/fonts.c4
-rw-r--r--drivers/video/dnfb.c16
-rw-r--r--drivers/video/epson1355fb.c24
-rw-r--r--drivers/video/ffb.c3
-rw-r--r--drivers/video/gbefb.c25
-rw-r--r--drivers/video/imxfb.c45
-rw-r--r--drivers/video/leo.c3
-rw-r--r--drivers/video/p9100.c3
-rw-r--r--drivers/video/pxafb.c51
-rw-r--r--drivers/video/q40fb.c14
-rw-r--r--drivers/video/s1d13xxxfb.c49
-rw-r--r--drivers/video/s3c2410fb.c47
-rw-r--r--drivers/video/sa1100fb.c25
-rw-r--r--drivers/video/sbuslib.c107
-rw-r--r--drivers/video/sbuslib.h2
-rw-r--r--drivers/video/sgivwfb.c22
-rw-r--r--drivers/video/tcx.c3
-rw-r--r--drivers/video/vesafb.c14
-rw-r--r--drivers/video/vfb.c22
-rw-r--r--drivers/video/w100fb.c46
273 files changed, 4114 insertions, 11518 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 6d4736e89f1a..8827dafba945 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -20,6 +20,8 @@
20 20
21#include "base.h" 21#include "base.h"
22 22
23#define to_platform_driver(drv) (container_of((drv), struct platform_driver, driver))
24
23struct device platform_bus = { 25struct device platform_bus = {
24 .bus_id = "platform", 26 .bus_id = "platform",
25}; 27};
@@ -354,6 +356,77 @@ error:
354 return ERR_PTR(retval); 356 return ERR_PTR(retval);
355} 357}
356 358
359static int platform_drv_probe(struct device *_dev)
360{
361 struct platform_driver *drv = to_platform_driver(_dev->driver);
362 struct platform_device *dev = to_platform_device(_dev);
363
364 return drv->probe(dev);
365}
366
367static int platform_drv_remove(struct device *_dev)
368{
369 struct platform_driver *drv = to_platform_driver(_dev->driver);
370 struct platform_device *dev = to_platform_device(_dev);
371
372 return drv->remove(dev);
373}
374
375static void platform_drv_shutdown(struct device *_dev)
376{
377 struct platform_driver *drv = to_platform_driver(_dev->driver);
378 struct platform_device *dev = to_platform_device(_dev);
379
380 drv->shutdown(dev);
381}
382
383static int platform_drv_suspend(struct device *_dev, pm_message_t state)
384{
385 struct platform_driver *drv = to_platform_driver(_dev->driver);
386 struct platform_device *dev = to_platform_device(_dev);
387
388 return drv->suspend(dev, state);
389}
390
391static int platform_drv_resume(struct device *_dev)
392{
393 struct platform_driver *drv = to_platform_driver(_dev->driver);
394 struct platform_device *dev = to_platform_device(_dev);
395
396 return drv->resume(dev);
397}
398
399/**
400 * platform_driver_register
401 * @drv: platform driver structure
402 */
403int platform_driver_register(struct platform_driver *drv)
404{
405 drv->driver.bus = &platform_bus_type;
406 if (drv->probe)
407 drv->driver.probe = platform_drv_probe;
408 if (drv->remove)
409 drv->driver.remove = platform_drv_remove;
410 if (drv->shutdown)
411 drv->driver.shutdown = platform_drv_shutdown;
412 if (drv->suspend)
413 drv->driver.suspend = platform_drv_suspend;
414 if (drv->resume)
415 drv->driver.resume = platform_drv_resume;
416 return driver_register(&drv->driver);
417}
418EXPORT_SYMBOL_GPL(platform_driver_register);
419
420/**
421 * platform_driver_unregister
422 * @drv: platform driver structure
423 */
424void platform_driver_unregister(struct platform_driver *drv)
425{
426 driver_unregister(&drv->driver);
427}
428EXPORT_SYMBOL_GPL(platform_driver_unregister);
429
357 430
358/** 431/**
359 * platform_match - bind platform device to platform driver. 432 * platform_match - bind platform device to platform driver.
diff --git a/drivers/block/acsi.c b/drivers/block/acsi.c
index 0e1f34fef0c8..5d2d649f7e8d 100644
--- a/drivers/block/acsi.c
+++ b/drivers/block/acsi.c
@@ -58,7 +58,6 @@
58#include <linux/slab.h> 58#include <linux/slab.h>
59#include <linux/interrupt.h> 59#include <linux/interrupt.h>
60#include <scsi/scsi.h> /* for SCSI_IOCTL_GET_IDLUN */ 60#include <scsi/scsi.h> /* for SCSI_IOCTL_GET_IDLUN */
61typedef void Scsi_Device; /* hack to avoid including scsi.h */
62#include <scsi/scsi_ioctl.h> 61#include <scsi/scsi_ioctl.h>
63#include <linux/hdreg.h> /* for HDIO_GETGEO */ 62#include <linux/hdreg.h> /* for HDIO_GETGEO */
64#include <linux/blkpg.h> 63#include <linux/blkpg.h>
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index a97c80b57737..e239a6c29230 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -148,6 +148,7 @@ static struct board_type products[] = {
148static ctlr_info_t *hba[MAX_CTLR]; 148static ctlr_info_t *hba[MAX_CTLR];
149 149
150static void do_cciss_request(request_queue_t *q); 150static void do_cciss_request(request_queue_t *q);
151static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs);
151static int cciss_open(struct inode *inode, struct file *filep); 152static int cciss_open(struct inode *inode, struct file *filep);
152static int cciss_release(struct inode *inode, struct file *filep); 153static int cciss_release(struct inode *inode, struct file *filep);
153static int cciss_ioctl(struct inode *inode, struct file *filep, 154static int cciss_ioctl(struct inode *inode, struct file *filep,
@@ -1583,6 +1584,24 @@ static int fill_cmd(CommandList_struct *c, __u8 cmd, int ctlr, void *buff,
1583 } 1584 }
1584 } else if (cmd_type == TYPE_MSG) { 1585 } else if (cmd_type == TYPE_MSG) {
1585 switch (cmd) { 1586 switch (cmd) {
1587 case 0: /* ABORT message */
1588 c->Request.CDBLen = 12;
1589 c->Request.Type.Attribute = ATTR_SIMPLE;
1590 c->Request.Type.Direction = XFER_WRITE;
1591 c->Request.Timeout = 0;
1592 c->Request.CDB[0] = cmd; /* abort */
1593 c->Request.CDB[1] = 0; /* abort a command */
1594 /* buff contains the tag of the command to abort */
1595 memcpy(&c->Request.CDB[4], buff, 8);
1596 break;
1597 case 1: /* RESET message */
1598 c->Request.CDBLen = 12;
1599 c->Request.Type.Attribute = ATTR_SIMPLE;
1600 c->Request.Type.Direction = XFER_WRITE;
1601 c->Request.Timeout = 0;
1602 memset(&c->Request.CDB[0], 0, sizeof(c->Request.CDB));
1603 c->Request.CDB[0] = cmd; /* reset */
1604 c->Request.CDB[1] = 0x04; /* reset a LUN */
1586 case 3: /* No-Op message */ 1605 case 3: /* No-Op message */
1587 c->Request.CDBLen = 1; 1606 c->Request.CDBLen = 1;
1588 c->Request.Type.Attribute = ATTR_SIMPLE; 1607 c->Request.Type.Attribute = ATTR_SIMPLE;
@@ -1869,6 +1888,52 @@ static unsigned long pollcomplete(int ctlr)
1869 /* Invalid address to tell caller we ran out of time */ 1888 /* Invalid address to tell caller we ran out of time */
1870 return 1; 1889 return 1;
1871} 1890}
1891
1892static int add_sendcmd_reject(__u8 cmd, int ctlr, unsigned long complete)
1893{
1894 /* We get in here if sendcmd() is polling for completions
1895 and gets some command back that it wasn't expecting --
1896 something other than that which it just sent down.
1897 Ordinarily, that shouldn't happen, but it can happen when
1898 the scsi tape stuff gets into error handling mode, and
1899 starts using sendcmd() to try to abort commands and
1900 reset tape drives. In that case, sendcmd may pick up
1901 completions of commands that were sent to logical drives
1902 through the block i/o system, or cciss ioctls completing, etc.
1903 In that case, we need to save those completions for later
1904 processing by the interrupt handler.
1905 */
1906
1907#ifdef CONFIG_CISS_SCSI_TAPE
1908 struct sendcmd_reject_list *srl = &hba[ctlr]->scsi_rejects;
1909
1910 /* If it's not the scsi tape stuff doing error handling, (abort */
1911 /* or reset) then we don't expect anything weird. */
1912 if (cmd != CCISS_RESET_MSG && cmd != CCISS_ABORT_MSG) {
1913#endif
1914 printk( KERN_WARNING "cciss cciss%d: SendCmd "
1915 "Invalid command list address returned! (%lx)\n",
1916 ctlr, complete);
1917 /* not much we can do. */
1918#ifdef CONFIG_CISS_SCSI_TAPE
1919 return 1;
1920 }
1921
1922 /* We've sent down an abort or reset, but something else
1923 has completed */
1924 if (srl->ncompletions >= (NR_CMDS + 2)) {
1925 /* Uh oh. No room to save it for later... */
1926 printk(KERN_WARNING "cciss%d: Sendcmd: Invalid command addr, "
1927 "reject list overflow, command lost!\n", ctlr);
1928 return 1;
1929 }
1930 /* Save it for later */
1931 srl->complete[srl->ncompletions] = complete;
1932 srl->ncompletions++;
1933#endif
1934 return 0;
1935}
1936
1872/* 1937/*
1873 * Send a command to the controller, and wait for it to complete. 1938 * Send a command to the controller, and wait for it to complete.
1874 * Only used at init time. 1939 * Only used at init time.
@@ -1891,7 +1956,7 @@ static int sendcmd(
1891 unsigned long complete; 1956 unsigned long complete;
1892 ctlr_info_t *info_p= hba[ctlr]; 1957 ctlr_info_t *info_p= hba[ctlr];
1893 u64bit buff_dma_handle; 1958 u64bit buff_dma_handle;
1894 int status; 1959 int status, done = 0;
1895 1960
1896 if ((c = cmd_alloc(info_p, 1)) == NULL) { 1961 if ((c = cmd_alloc(info_p, 1)) == NULL) {
1897 printk(KERN_WARNING "cciss: unable to get memory"); 1962 printk(KERN_WARNING "cciss: unable to get memory");
@@ -1913,7 +1978,9 @@ resend_cmd1:
1913 info_p->access.set_intr_mask(info_p, CCISS_INTR_OFF); 1978 info_p->access.set_intr_mask(info_p, CCISS_INTR_OFF);
1914 1979
1915 /* Make sure there is room in the command FIFO */ 1980 /* Make sure there is room in the command FIFO */
1916 /* Actually it should be completely empty at this time. */ 1981 /* Actually it should be completely empty at this time */
1982 /* unless we are in here doing error handling for the scsi */
1983 /* tape side of the driver. */
1917 for (i = 200000; i > 0; i--) 1984 for (i = 200000; i > 0; i--)
1918 { 1985 {
1919 /* if fifo isn't full go */ 1986 /* if fifo isn't full go */
@@ -1930,13 +1997,25 @@ resend_cmd1:
1930 * Send the cmd 1997 * Send the cmd
1931 */ 1998 */
1932 info_p->access.submit_command(info_p, c); 1999 info_p->access.submit_command(info_p, c);
1933 complete = pollcomplete(ctlr); 2000 done = 0;
2001 do {
2002 complete = pollcomplete(ctlr);
1934 2003
1935#ifdef CCISS_DEBUG 2004#ifdef CCISS_DEBUG
1936 printk(KERN_DEBUG "cciss: command completed\n"); 2005 printk(KERN_DEBUG "cciss: command completed\n");
1937#endif /* CCISS_DEBUG */ 2006#endif /* CCISS_DEBUG */
1938 2007
1939 if (complete != 1) { 2008 if (complete == 1) {
2009 printk( KERN_WARNING
2010 "cciss cciss%d: SendCmd Timeout out, "
2011 "No command list address returned!\n",
2012 ctlr);
2013 status = IO_ERROR;
2014 done = 1;
2015 break;
2016 }
2017
2018 /* This will need to change for direct lookup completions */
1940 if ( (complete & CISS_ERROR_BIT) 2019 if ( (complete & CISS_ERROR_BIT)
1941 && (complete & ~CISS_ERROR_BIT) == c->busaddr) 2020 && (complete & ~CISS_ERROR_BIT) == c->busaddr)
1942 { 2021 {
@@ -1976,6 +2055,10 @@ resend_cmd1:
1976 status = IO_ERROR; 2055 status = IO_ERROR;
1977 goto cleanup1; 2056 goto cleanup1;
1978 } 2057 }
2058 } else if (c->err_info->CommandStatus == CMD_UNABORTABLE) {
2059 printk(KERN_WARNING "cciss%d: command could not be aborted.\n", ctlr);
2060 status = IO_ERROR;
2061 goto cleanup1;
1979 } 2062 }
1980 printk(KERN_WARNING "ciss ciss%d: sendcmd" 2063 printk(KERN_WARNING "ciss ciss%d: sendcmd"
1981 " Error %x \n", ctlr, 2064 " Error %x \n", ctlr,
@@ -1990,20 +2073,15 @@ resend_cmd1:
1990 goto cleanup1; 2073 goto cleanup1;
1991 } 2074 }
1992 } 2075 }
2076 /* This will need changing for direct lookup completions */
1993 if (complete != c->busaddr) { 2077 if (complete != c->busaddr) {
1994 printk( KERN_WARNING "cciss cciss%d: SendCmd " 2078 if (add_sendcmd_reject(cmd, ctlr, complete) != 0) {
1995 "Invalid command list address returned! (%lx)\n", 2079 BUG(); /* we are pretty much hosed if we get here. */
1996 ctlr, complete); 2080 }
1997 status = IO_ERROR; 2081 continue;
1998 goto cleanup1; 2082 } else
1999 } 2083 done = 1;
2000 } else { 2084 } while (!done);
2001 printk( KERN_WARNING
2002 "cciss cciss%d: SendCmd Timeout out, "
2003 "No command list address returned!\n",
2004 ctlr);
2005 status = IO_ERROR;
2006 }
2007 2085
2008cleanup1: 2086cleanup1:
2009 /* unlock the data buffer from DMA */ 2087 /* unlock the data buffer from DMA */
@@ -2011,6 +2089,11 @@ cleanup1:
2011 buff_dma_handle.val32.upper = c->SG[0].Addr.upper; 2089 buff_dma_handle.val32.upper = c->SG[0].Addr.upper;
2012 pci_unmap_single(info_p->pdev, (dma_addr_t) buff_dma_handle.val, 2090 pci_unmap_single(info_p->pdev, (dma_addr_t) buff_dma_handle.val,
2013 c->SG[0].Len, PCI_DMA_BIDIRECTIONAL); 2091 c->SG[0].Len, PCI_DMA_BIDIRECTIONAL);
2092#ifdef CONFIG_CISS_SCSI_TAPE
2093 /* if we saved some commands for later, process them now. */
2094 if (info_p->scsi_rejects.ncompletions > 0)
2095 do_cciss_intr(0, info_p, NULL);
2096#endif
2014 cmd_free(info_p, c, 1); 2097 cmd_free(info_p, c, 1);
2015 return (status); 2098 return (status);
2016} 2099}
@@ -2335,6 +2418,48 @@ startio:
2335 start_io(h); 2418 start_io(h);
2336} 2419}
2337 2420
2421static inline unsigned long get_next_completion(ctlr_info_t *h)
2422{
2423#ifdef CONFIG_CISS_SCSI_TAPE
2424 /* Any rejects from sendcmd() lying around? Process them first */
2425 if (h->scsi_rejects.ncompletions == 0)
2426 return h->access.command_completed(h);
2427 else {
2428 struct sendcmd_reject_list *srl;
2429 int n;
2430 srl = &h->scsi_rejects;
2431 n = --srl->ncompletions;
2432 /* printk("cciss%d: processing saved reject\n", h->ctlr); */
2433 printk("p");
2434 return srl->complete[n];
2435 }
2436#else
2437 return h->access.command_completed(h);
2438#endif
2439}
2440
2441static inline int interrupt_pending(ctlr_info_t *h)
2442{
2443#ifdef CONFIG_CISS_SCSI_TAPE
2444 return ( h->access.intr_pending(h)
2445 || (h->scsi_rejects.ncompletions > 0));
2446#else
2447 return h->access.intr_pending(h);
2448#endif
2449}
2450
2451static inline long interrupt_not_for_us(ctlr_info_t *h)
2452{
2453#ifdef CONFIG_CISS_SCSI_TAPE
2454 return (((h->access.intr_pending(h) == 0) ||
2455 (h->interrupts_enabled == 0))
2456 && (h->scsi_rejects.ncompletions == 0));
2457#else
2458 return (((h->access.intr_pending(h) == 0) ||
2459 (h->interrupts_enabled == 0)));
2460#endif
2461}
2462
2338static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs) 2463static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs)
2339{ 2464{
2340 ctlr_info_t *h = dev_id; 2465 ctlr_info_t *h = dev_id;
@@ -2344,19 +2469,15 @@ static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs)
2344 int j; 2469 int j;
2345 int start_queue = h->next_to_run; 2470 int start_queue = h->next_to_run;
2346 2471
2347 /* Is this interrupt for us? */ 2472 if (interrupt_not_for_us(h))
2348 if (( h->access.intr_pending(h) == 0) || (h->interrupts_enabled == 0))
2349 return IRQ_NONE; 2473 return IRQ_NONE;
2350
2351 /* 2474 /*
2352 * If there are completed commands in the completion queue, 2475 * If there are completed commands in the completion queue,
2353 * we had better do something about it. 2476 * we had better do something about it.
2354 */ 2477 */
2355 spin_lock_irqsave(CCISS_LOCK(h->ctlr), flags); 2478 spin_lock_irqsave(CCISS_LOCK(h->ctlr), flags);
2356 while( h->access.intr_pending(h)) 2479 while (interrupt_pending(h)) {
2357 { 2480 while((a = get_next_completion(h)) != FIFO_EMPTY) {
2358 while((a = h->access.command_completed(h)) != FIFO_EMPTY)
2359 {
2360 a1 = a; 2481 a1 = a;
2361 if ((a & 0x04)) { 2482 if ((a & 0x04)) {
2362 a2 = (a >> 3); 2483 a2 = (a >> 3);
@@ -2963,7 +3084,15 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
2963 printk( KERN_ERR "cciss: out of memory"); 3084 printk( KERN_ERR "cciss: out of memory");
2964 goto clean4; 3085 goto clean4;
2965 } 3086 }
2966 3087#ifdef CONFIG_CISS_SCSI_TAPE
3088 hba[i]->scsi_rejects.complete =
3089 kmalloc(sizeof(hba[i]->scsi_rejects.complete[0]) *
3090 (NR_CMDS + 5), GFP_KERNEL);
3091 if (hba[i]->scsi_rejects.complete == NULL) {
3092 printk( KERN_ERR "cciss: out of memory");
3093 goto clean4;
3094 }
3095#endif
2967 spin_lock_init(&hba[i]->lock); 3096 spin_lock_init(&hba[i]->lock);
2968 3097
2969 /* Initialize the pdev driver private data. 3098 /* Initialize the pdev driver private data.
@@ -3031,6 +3160,10 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
3031 return(1); 3160 return(1);
3032 3161
3033clean4: 3162clean4:
3163#ifdef CONFIG_CISS_SCSI_TAPE
3164 if(hba[i]->scsi_rejects.complete)
3165 kfree(hba[i]->scsi_rejects.complete);
3166#endif
3034 kfree(hba[i]->cmd_pool_bits); 3167 kfree(hba[i]->cmd_pool_bits);
3035 if(hba[i]->cmd_pool) 3168 if(hba[i]->cmd_pool)
3036 pci_free_consistent(hba[i]->pdev, 3169 pci_free_consistent(hba[i]->pdev,
@@ -3103,6 +3236,9 @@ static void __devexit cciss_remove_one (struct pci_dev *pdev)
3103 pci_free_consistent(hba[i]->pdev, NR_CMDS * sizeof( ErrorInfo_struct), 3236 pci_free_consistent(hba[i]->pdev, NR_CMDS * sizeof( ErrorInfo_struct),
3104 hba[i]->errinfo_pool, hba[i]->errinfo_pool_dhandle); 3237 hba[i]->errinfo_pool, hba[i]->errinfo_pool_dhandle);
3105 kfree(hba[i]->cmd_pool_bits); 3238 kfree(hba[i]->cmd_pool_bits);
3239#ifdef CONFIG_CISS_SCSI_TAPE
3240 kfree(hba[i]->scsi_rejects.complete);
3241#endif
3106 release_io_mem(hba[i]); 3242 release_io_mem(hba[i]);
3107 free_hba(i); 3243 free_hba(i);
3108} 3244}
diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
index ef277baee9fd..3b0858c83897 100644
--- a/drivers/block/cciss.h
+++ b/drivers/block/cciss.h
@@ -44,6 +44,14 @@ typedef struct _drive_info_struct
44 */ 44 */
45} drive_info_struct; 45} drive_info_struct;
46 46
47#ifdef CONFIG_CISS_SCSI_TAPE
48
49struct sendcmd_reject_list {
50 int ncompletions;
51 unsigned long *complete; /* array of NR_CMDS tags */
52};
53
54#endif
47struct ctlr_info 55struct ctlr_info
48{ 56{
49 int ctlr; 57 int ctlr;
@@ -100,6 +108,9 @@ struct ctlr_info
100 struct gendisk *gendisk[NWD]; 108 struct gendisk *gendisk[NWD];
101#ifdef CONFIG_CISS_SCSI_TAPE 109#ifdef CONFIG_CISS_SCSI_TAPE
102 void *scsi_ctlr; /* ptr to structure containing scsi related stuff */ 110 void *scsi_ctlr; /* ptr to structure containing scsi related stuff */
111 /* list of block side commands the scsi error handling sucked up */
112 /* and saved for later processing */
113 struct sendcmd_reject_list scsi_rejects;
103#endif 114#endif
104 unsigned char alive; 115 unsigned char alive;
105}; 116};
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
index ec27976a57da..3226aa11c6ef 100644
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -42,6 +42,9 @@
42 42
43#include "cciss_scsi.h" 43#include "cciss_scsi.h"
44 44
45#define CCISS_ABORT_MSG 0x00
46#define CCISS_RESET_MSG 0x01
47
45/* some prototypes... */ 48/* some prototypes... */
46static int sendcmd( 49static int sendcmd(
47 __u8 cmd, 50 __u8 cmd,
@@ -67,6 +70,8 @@ static int cciss_scsi_proc_info(
67 70
68static int cciss_scsi_queue_command (struct scsi_cmnd *cmd, 71static int cciss_scsi_queue_command (struct scsi_cmnd *cmd,
69 void (* done)(struct scsi_cmnd *)); 72 void (* done)(struct scsi_cmnd *));
73static int cciss_eh_device_reset_handler(struct scsi_cmnd *);
74static int cciss_eh_abort_handler(struct scsi_cmnd *);
70 75
71static struct cciss_scsi_hba_t ccissscsi[MAX_CTLR] = { 76static struct cciss_scsi_hba_t ccissscsi[MAX_CTLR] = {
72 { .name = "cciss0", .ndevices = 0 }, 77 { .name = "cciss0", .ndevices = 0 },
@@ -90,6 +95,9 @@ static struct scsi_host_template cciss_driver_template = {
90 .sg_tablesize = MAXSGENTRIES, 95 .sg_tablesize = MAXSGENTRIES,
91 .cmd_per_lun = 1, 96 .cmd_per_lun = 1,
92 .use_clustering = DISABLE_CLUSTERING, 97 .use_clustering = DISABLE_CLUSTERING,
98 /* Can't have eh_bus_reset_handler or eh_host_reset_handler for cciss */
99 .eh_device_reset_handler= cciss_eh_device_reset_handler,
100 .eh_abort_handler = cciss_eh_abort_handler,
93}; 101};
94 102
95#pragma pack(1) 103#pragma pack(1)
@@ -247,7 +255,7 @@ scsi_cmd_stack_free(int ctlr)
247#define DEVICETYPE(n) (n<0 || n>MAX_SCSI_DEVICE_CODE) ? \ 255#define DEVICETYPE(n) (n<0 || n>MAX_SCSI_DEVICE_CODE) ? \
248 "Unknown" : scsi_device_types[n] 256 "Unknown" : scsi_device_types[n]
249 257
250#if 0 258#if 1
251static int xmargin=8; 259static int xmargin=8;
252static int amargin=60; 260static int amargin=60;
253 261
@@ -1448,6 +1456,78 @@ cciss_proc_tape_report(int ctlr, unsigned char *buffer, off_t *pos, off_t *len)
1448 *pos += size; *len += size; 1456 *pos += size; *len += size;
1449} 1457}
1450 1458
1459/* Need at least one of these error handlers to keep ../scsi/hosts.c from
1460 * complaining. Doing a host- or bus-reset can't do anything good here.
1461 * Despite what it might say in scsi_error.c, there may well be commands
1462 * on the controller, as the cciss driver registers twice, once as a block
1463 * device for the logical drives, and once as a scsi device, for any tape
1464 * drives. So we know there are no commands out on the tape drives, but we
1465 * don't know there are no commands on the controller, and it is likely
1466 * that there probably are, as the cciss block device is most commonly used
1467 * as a boot device (embedded controller on HP/Compaq systems.)
1468*/
1469
1470static int cciss_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
1471{
1472 int rc;
1473 CommandList_struct *cmd_in_trouble;
1474 ctlr_info_t **c;
1475 int ctlr;
1476
1477 /* find the controller to which the command to be aborted was sent */
1478 c = (ctlr_info_t **) &scsicmd->device->host->hostdata[0];
1479 if (c == NULL) /* paranoia */
1480 return FAILED;
1481 ctlr = (*c)->ctlr;
1482 printk(KERN_WARNING "cciss%d: resetting tape drive or medium changer.\n", ctlr);
1483
1484 /* find the command that's giving us trouble */
1485 cmd_in_trouble = (CommandList_struct *) scsicmd->host_scribble;
1486 if (cmd_in_trouble == NULL) { /* paranoia */
1487 return FAILED;
1488 }
1489 /* send a reset to the SCSI LUN which the command was sent to */
1490 rc = sendcmd(CCISS_RESET_MSG, ctlr, NULL, 0, 2, 0, 0,
1491 (unsigned char *) &cmd_in_trouble->Header.LUN.LunAddrBytes[0],
1492 TYPE_MSG);
1493 /* sendcmd turned off interrputs on the board, turn 'em back on. */
1494 (*c)->access.set_intr_mask(*c, CCISS_INTR_ON);
1495 if (rc == 0)
1496 return SUCCESS;
1497 printk(KERN_WARNING "cciss%d: resetting device failed.\n", ctlr);
1498 return FAILED;
1499}
1500
1501static int cciss_eh_abort_handler(struct scsi_cmnd *scsicmd)
1502{
1503 int rc;
1504 CommandList_struct *cmd_to_abort;
1505 ctlr_info_t **c;
1506 int ctlr;
1507
1508 /* find the controller to which the command to be aborted was sent */
1509 c = (ctlr_info_t **) &scsicmd->device->host->hostdata[0];
1510 if (c == NULL) /* paranoia */
1511 return FAILED;
1512 ctlr = (*c)->ctlr;
1513 printk(KERN_WARNING "cciss%d: aborting tardy SCSI cmd\n", ctlr);
1514
1515 /* find the command to be aborted */
1516 cmd_to_abort = (CommandList_struct *) scsicmd->host_scribble;
1517 if (cmd_to_abort == NULL) /* paranoia */
1518 return FAILED;
1519 rc = sendcmd(CCISS_ABORT_MSG, ctlr, &cmd_to_abort->Header.Tag,
1520 0, 2, 0, 0,
1521 (unsigned char *) &cmd_to_abort->Header.LUN.LunAddrBytes[0],
1522 TYPE_MSG);
1523 /* sendcmd turned off interrputs on the board, turn 'em back on. */
1524 (*c)->access.set_intr_mask(*c, CCISS_INTR_ON);
1525 if (rc == 0)
1526 return SUCCESS;
1527 return FAILED;
1528
1529}
1530
1451#else /* no CONFIG_CISS_SCSI_TAPE */ 1531#else /* no CONFIG_CISS_SCSI_TAPE */
1452 1532
1453/* If no tape support, then these become defined out of existence */ 1533/* If no tape support, then these become defined out of existence */
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 28002de783b6..13b8a9bed66e 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -98,6 +98,10 @@
98 */ 98 */
99 99
100/* 100/*
101 * 1998/1/21 -- Richard Gooch <rgooch@atnf.csiro.au> -- devfs support
102 */
103
104/*
101 * 1998/05/07 -- Russell King -- More portability cleanups; moved definition of 105 * 1998/05/07 -- Russell King -- More portability cleanups; moved definition of
102 * interrupt and dma channel to asm/floppy.h. Cleaned up some formatting & 106 * interrupt and dma channel to asm/floppy.h. Cleaned up some formatting &
103 * use of '0' for NULL. 107 * use of '0' for NULL.
@@ -158,10 +162,6 @@ static int print_unex = 1;
158#define FDPATCHES 162#define FDPATCHES
159#include <linux/fdreg.h> 163#include <linux/fdreg.h>
160 164
161/*
162 * 1998/1/21 -- Richard Gooch <rgooch@atnf.csiro.au> -- devfs support
163 */
164
165#include <linux/fd.h> 165#include <linux/fd.h>
166#include <linux/hdreg.h> 166#include <linux/hdreg.h>
167 167
diff --git a/drivers/char/ftape/lowlevel/ftape-buffer.c b/drivers/char/ftape/lowlevel/ftape-buffer.c
index 54af20cd9a2c..c706ff162771 100644
--- a/drivers/char/ftape/lowlevel/ftape-buffer.c
+++ b/drivers/char/ftape/lowlevel/ftape-buffer.c
@@ -33,6 +33,7 @@
33#include "../lowlevel/ftape-rw.h" 33#include "../lowlevel/ftape-rw.h"
34#include "../lowlevel/ftape-read.h" 34#include "../lowlevel/ftape-read.h"
35#include "../lowlevel/ftape-tracing.h" 35#include "../lowlevel/ftape-tracing.h"
36#include "../lowlevel/ftape-buffer.h"
36 37
37/* DMA'able memory allocation stuff. 38/* DMA'able memory allocation stuff.
38 */ 39 */
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
index 6c4b3f986d0c..f3c3aaf4560e 100644
--- a/drivers/char/i8k.c
+++ b/drivers/char/i8k.c
@@ -99,7 +99,9 @@ struct smm_regs {
99 99
100static inline char *i8k_get_dmi_data(int field) 100static inline char *i8k_get_dmi_data(int field)
101{ 101{
102 return dmi_get_system_info(field) ? : "N/A"; 102 char *dmi_data = dmi_get_system_info(field);
103
104 return dmi_data && *dmi_data ? dmi_data : "?";
103} 105}
104 106
105/* 107/*
@@ -396,7 +398,7 @@ static int i8k_proc_show(struct seq_file *seq, void *offset)
396 return seq_printf(seq, "%s %s %s %d %d %d %d %d %d %d\n", 398 return seq_printf(seq, "%s %s %s %d %d %d %d %d %d %d\n",
397 I8K_PROC_FMT, 399 I8K_PROC_FMT,
398 bios_version, 400 bios_version,
399 dmi_get_system_info(DMI_PRODUCT_SERIAL) ? : "N/A", 401 i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
400 cpu_temp, 402 cpu_temp,
401 left_fan, right_fan, left_speed, right_speed, 403 left_fan, right_fan, left_speed, right_speed,
402 ac_power, fn_key); 404 ac_power, fn_key);
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index c1d06ba449b6..d16bd4b5c117 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -2648,7 +2648,7 @@ void ipmi_smi_msg_received(ipmi_smi_t intf,
2648 spin_lock_irqsave(&intf->waiting_msgs_lock, flags); 2648 spin_lock_irqsave(&intf->waiting_msgs_lock, flags);
2649 if (!list_empty(&intf->waiting_msgs)) { 2649 if (!list_empty(&intf->waiting_msgs)) {
2650 list_add_tail(&msg->link, &intf->waiting_msgs); 2650 list_add_tail(&msg->link, &intf->waiting_msgs);
2651 spin_unlock(&intf->waiting_msgs_lock); 2651 spin_unlock_irqrestore(&intf->waiting_msgs_lock, flags);
2652 goto out; 2652 goto out;
2653 } 2653 }
2654 spin_unlock_irqrestore(&intf->waiting_msgs_lock, flags); 2654 spin_unlock_irqrestore(&intf->waiting_msgs_lock, flags);
@@ -2657,9 +2657,9 @@ void ipmi_smi_msg_received(ipmi_smi_t intf,
2657 if (rv > 0) { 2657 if (rv > 0) {
2658 /* Could not handle the message now, just add it to a 2658 /* Could not handle the message now, just add it to a
2659 list to handle later. */ 2659 list to handle later. */
2660 spin_lock(&intf->waiting_msgs_lock); 2660 spin_lock_irqsave(&intf->waiting_msgs_lock, flags);
2661 list_add_tail(&msg->link, &intf->waiting_msgs); 2661 list_add_tail(&msg->link, &intf->waiting_msgs);
2662 spin_unlock(&intf->waiting_msgs_lock); 2662 spin_unlock_irqrestore(&intf->waiting_msgs_lock, flags);
2663 } else if (rv == 0) { 2663 } else if (rv == 0) {
2664 ipmi_free_smi_msg(msg); 2664 ipmi_free_smi_msg(msg);
2665 } 2665 }
diff --git a/drivers/char/s3c2410-rtc.c b/drivers/char/s3c2410-rtc.c
index d724c0de4f28..3df7a574267b 100644
--- a/drivers/char/s3c2410-rtc.c
+++ b/drivers/char/s3c2410-rtc.c
@@ -382,7 +382,7 @@ static struct rtc_ops s3c2410_rtcops = {
382 .proc = s3c2410_rtc_proc, 382 .proc = s3c2410_rtc_proc,
383}; 383};
384 384
385static void s3c2410_rtc_enable(struct device *dev, int en) 385static void s3c2410_rtc_enable(struct platform_device *pdev, int en)
386{ 386{
387 unsigned int tmp; 387 unsigned int tmp;
388 388
@@ -399,21 +399,21 @@ static void s3c2410_rtc_enable(struct device *dev, int en)
399 /* re-enable the device, and check it is ok */ 399 /* re-enable the device, and check it is ok */
400 400
401 if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_RTCEN) == 0){ 401 if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_RTCEN) == 0){
402 dev_info(dev, "rtc disabled, re-enabling\n"); 402 dev_info(&pdev->dev, "rtc disabled, re-enabling\n");
403 403
404 tmp = readb(S3C2410_RTCCON); 404 tmp = readb(S3C2410_RTCCON);
405 writeb(tmp | S3C2410_RTCCON_RTCEN , S3C2410_RTCCON); 405 writeb(tmp | S3C2410_RTCCON_RTCEN , S3C2410_RTCCON);
406 } 406 }
407 407
408 if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_CNTSEL)){ 408 if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_CNTSEL)){
409 dev_info(dev, "removing S3C2410_RTCCON_CNTSEL\n"); 409 dev_info(&pdev->dev, "removing S3C2410_RTCCON_CNTSEL\n");
410 410
411 tmp = readb(S3C2410_RTCCON); 411 tmp = readb(S3C2410_RTCCON);
412 writeb(tmp& ~S3C2410_RTCCON_CNTSEL , S3C2410_RTCCON); 412 writeb(tmp& ~S3C2410_RTCCON_CNTSEL , S3C2410_RTCCON);
413 } 413 }
414 414
415 if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_CLKRST)){ 415 if ((readb(S3C2410_RTCCON) & S3C2410_RTCCON_CLKRST)){
416 dev_info(dev, "removing S3C2410_RTCCON_CLKRST\n"); 416 dev_info(&pdev->dev, "removing S3C2410_RTCCON_CLKRST\n");
417 417
418 tmp = readb(S3C2410_RTCCON); 418 tmp = readb(S3C2410_RTCCON);
419 writeb(tmp & ~S3C2410_RTCCON_CLKRST, S3C2410_RTCCON); 419 writeb(tmp & ~S3C2410_RTCCON_CLKRST, S3C2410_RTCCON);
@@ -421,7 +421,7 @@ static void s3c2410_rtc_enable(struct device *dev, int en)
421 } 421 }
422} 422}
423 423
424static int s3c2410_rtc_remove(struct device *dev) 424static int s3c2410_rtc_remove(struct platform_device *dev)
425{ 425{
426 unregister_rtc(&s3c2410_rtcops); 426 unregister_rtc(&s3c2410_rtcops);
427 427
@@ -438,25 +438,24 @@ static int s3c2410_rtc_remove(struct device *dev)
438 return 0; 438 return 0;
439} 439}
440 440
441static int s3c2410_rtc_probe(struct device *dev) 441static int s3c2410_rtc_probe(struct platform_device *pdev)
442{ 442{
443 struct platform_device *pdev = to_platform_device(dev);
444 struct resource *res; 443 struct resource *res;
445 int ret; 444 int ret;
446 445
447 pr_debug("%s: probe=%p, device=%p\n", __FUNCTION__, pdev, dev); 446 pr_debug("%s: probe=%p\n", __FUNCTION__, pdev);
448 447
449 /* find the IRQs */ 448 /* find the IRQs */
450 449
451 s3c2410_rtc_tickno = platform_get_irq(pdev, 1); 450 s3c2410_rtc_tickno = platform_get_irq(pdev, 1);
452 if (s3c2410_rtc_tickno <= 0) { 451 if (s3c2410_rtc_tickno <= 0) {
453 dev_err(dev, "no irq for rtc tick\n"); 452 dev_err(&pdev->dev, "no irq for rtc tick\n");
454 return -ENOENT; 453 return -ENOENT;
455 } 454 }
456 455
457 s3c2410_rtc_alarmno = platform_get_irq(pdev, 0); 456 s3c2410_rtc_alarmno = platform_get_irq(pdev, 0);
458 if (s3c2410_rtc_alarmno <= 0) { 457 if (s3c2410_rtc_alarmno <= 0) {
459 dev_err(dev, "no irq for alarm\n"); 458 dev_err(&pdev->dev, "no irq for alarm\n");
460 return -ENOENT; 459 return -ENOENT;
461 } 460 }
462 461
@@ -467,7 +466,7 @@ static int s3c2410_rtc_probe(struct device *dev)
467 466
468 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 467 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
469 if (res == NULL) { 468 if (res == NULL) {
470 dev_err(dev, "failed to get memory region resource\n"); 469 dev_err(&pdev->dev, "failed to get memory region resource\n");
471 return -ENOENT; 470 return -ENOENT;
472 } 471 }
473 472
@@ -475,14 +474,14 @@ static int s3c2410_rtc_probe(struct device *dev)
475 pdev->name); 474 pdev->name);
476 475
477 if (s3c2410_rtc_mem == NULL) { 476 if (s3c2410_rtc_mem == NULL) {
478 dev_err(dev, "failed to reserve memory region\n"); 477 dev_err(&pdev->dev, "failed to reserve memory region\n");
479 ret = -ENOENT; 478 ret = -ENOENT;
480 goto exit_err; 479 goto exit_err;
481 } 480 }
482 481
483 s3c2410_rtc_base = ioremap(res->start, res->end - res->start + 1); 482 s3c2410_rtc_base = ioremap(res->start, res->end - res->start + 1);
484 if (s3c2410_rtc_base == NULL) { 483 if (s3c2410_rtc_base == NULL) {
485 dev_err(dev, "failed ioremap()\n"); 484 dev_err(&pdev->dev, "failed ioremap()\n");
486 ret = -EINVAL; 485 ret = -EINVAL;
487 goto exit_err; 486 goto exit_err;
488 } 487 }
@@ -494,7 +493,7 @@ static int s3c2410_rtc_probe(struct device *dev)
494 493
495 /* check to see if everything is setup correctly */ 494 /* check to see if everything is setup correctly */
496 495
497 s3c2410_rtc_enable(dev, 1); 496 s3c2410_rtc_enable(pdev, 1);
498 497
499 pr_debug("s3c2410_rtc: RTCCON=%02x\n", readb(S3C2410_RTCCON)); 498 pr_debug("s3c2410_rtc: RTCCON=%02x\n", readb(S3C2410_RTCCON));
500 499
@@ -506,7 +505,7 @@ static int s3c2410_rtc_probe(struct device *dev)
506 return 0; 505 return 0;
507 506
508 exit_err: 507 exit_err:
509 dev_err(dev, "error %d during initialisation\n", ret); 508 dev_err(&pdev->dev, "error %d during initialisation\n", ret);
510 509
511 return ret; 510 return ret;
512} 511}
@@ -519,7 +518,7 @@ static struct timespec s3c2410_rtc_delta;
519 518
520static int ticnt_save; 519static int ticnt_save;
521 520
522static int s3c2410_rtc_suspend(struct device *dev, pm_message_t state) 521static int s3c2410_rtc_suspend(struct platform_device *pdev, pm_message_t state)
523{ 522{
524 struct rtc_time tm; 523 struct rtc_time tm;
525 struct timespec time; 524 struct timespec time;
@@ -535,19 +534,19 @@ static int s3c2410_rtc_suspend(struct device *dev, pm_message_t state)
535 s3c2410_rtc_gettime(&tm); 534 s3c2410_rtc_gettime(&tm);
536 rtc_tm_to_time(&tm, &time.tv_sec); 535 rtc_tm_to_time(&tm, &time.tv_sec);
537 save_time_delta(&s3c2410_rtc_delta, &time); 536 save_time_delta(&s3c2410_rtc_delta, &time);
538 s3c2410_rtc_enable(dev, 0); 537 s3c2410_rtc_enable(pdev, 0);
539 538
540 return 0; 539 return 0;
541} 540}
542 541
543static int s3c2410_rtc_resume(struct device *dev) 542static int s3c2410_rtc_resume(struct platform_device *pdev)
544{ 543{
545 struct rtc_time tm; 544 struct rtc_time tm;
546 struct timespec time; 545 struct timespec time;
547 546
548 time.tv_nsec = 0; 547 time.tv_nsec = 0;
549 548
550 s3c2410_rtc_enable(dev, 1); 549 s3c2410_rtc_enable(pdev, 1);
551 s3c2410_rtc_gettime(&tm); 550 s3c2410_rtc_gettime(&tm);
552 rtc_tm_to_time(&tm, &time.tv_sec); 551 rtc_tm_to_time(&tm, &time.tv_sec);
553 restore_time_delta(&s3c2410_rtc_delta, &time); 552 restore_time_delta(&s3c2410_rtc_delta, &time);
@@ -560,14 +559,15 @@ static int s3c2410_rtc_resume(struct device *dev)
560#define s3c2410_rtc_resume NULL 559#define s3c2410_rtc_resume NULL
561#endif 560#endif
562 561
563static struct device_driver s3c2410_rtcdrv = { 562static struct platform_driver s3c2410_rtcdrv = {
564 .name = "s3c2410-rtc",
565 .owner = THIS_MODULE,
566 .bus = &platform_bus_type,
567 .probe = s3c2410_rtc_probe, 563 .probe = s3c2410_rtc_probe,
568 .remove = s3c2410_rtc_remove, 564 .remove = s3c2410_rtc_remove,
569 .suspend = s3c2410_rtc_suspend, 565 .suspend = s3c2410_rtc_suspend,
570 .resume = s3c2410_rtc_resume, 566 .resume = s3c2410_rtc_resume,
567 .driver = {
568 .name = "s3c2410-rtc",
569 .owner = THIS_MODULE,
570 },
571}; 571};
572 572
573static char __initdata banner[] = "S3C2410 RTC, (c) 2004 Simtec Electronics\n"; 573static char __initdata banner[] = "S3C2410 RTC, (c) 2004 Simtec Electronics\n";
@@ -575,12 +575,12 @@ static char __initdata banner[] = "S3C2410 RTC, (c) 2004 Simtec Electronics\n";
575static int __init s3c2410_rtc_init(void) 575static int __init s3c2410_rtc_init(void)
576{ 576{
577 printk(banner); 577 printk(banner);
578 return driver_register(&s3c2410_rtcdrv); 578 return platform_driver_register(&s3c2410_rtcdrv);
579} 579}
580 580
581static void __exit s3c2410_rtc_exit(void) 581static void __exit s3c2410_rtc_exit(void)
582{ 582{
583 driver_unregister(&s3c2410_rtcdrv); 583 platform_driver_unregister(&s3c2410_rtcdrv);
584} 584}
585 585
586module_init(s3c2410_rtc_init); 586module_init(s3c2410_rtc_init);
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index d05067dcea01..51a07370e636 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -1168,7 +1168,7 @@ static int sonypi_disable(void)
1168#ifdef CONFIG_PM 1168#ifdef CONFIG_PM
1169static int old_camera_power; 1169static int old_camera_power;
1170 1170
1171static int sonypi_suspend(struct device *dev, pm_message_t state) 1171static int sonypi_suspend(struct platform_device *dev, pm_message_t state)
1172{ 1172{
1173 old_camera_power = sonypi_device.camera_power; 1173 old_camera_power = sonypi_device.camera_power;
1174 sonypi_disable(); 1174 sonypi_disable();
@@ -1176,26 +1176,27 @@ static int sonypi_suspend(struct device *dev, pm_message_t state)
1176 return 0; 1176 return 0;
1177} 1177}
1178 1178
1179static int sonypi_resume(struct device *dev) 1179static int sonypi_resume(struct platform_device *dev)
1180{ 1180{
1181 sonypi_enable(old_camera_power); 1181 sonypi_enable(old_camera_power);
1182 return 0; 1182 return 0;
1183} 1183}
1184#endif 1184#endif
1185 1185
1186static void sonypi_shutdown(struct device *dev) 1186static void sonypi_shutdown(struct platform_device *dev)
1187{ 1187{
1188 sonypi_disable(); 1188 sonypi_disable();
1189} 1189}
1190 1190
1191static struct device_driver sonypi_driver = { 1191static struct platform_driver sonypi_driver = {
1192 .name = "sonypi",
1193 .bus = &platform_bus_type,
1194#ifdef CONFIG_PM 1192#ifdef CONFIG_PM
1195 .suspend = sonypi_suspend, 1193 .suspend = sonypi_suspend,
1196 .resume = sonypi_resume, 1194 .resume = sonypi_resume,
1197#endif 1195#endif
1198 .shutdown = sonypi_shutdown, 1196 .shutdown = sonypi_shutdown,
1197 .driver = {
1198 .name = "sonypi",
1199 },
1199}; 1200};
1200 1201
1201static int __devinit sonypi_create_input_devices(void) 1202static int __devinit sonypi_create_input_devices(void)
@@ -1455,20 +1456,20 @@ static int __init sonypi_init(void)
1455 if (!dmi_check_system(sonypi_dmi_table)) 1456 if (!dmi_check_system(sonypi_dmi_table))
1456 return -ENODEV; 1457 return -ENODEV;
1457 1458
1458 ret = driver_register(&sonypi_driver); 1459 ret = platform_driver_register(&sonypi_driver);
1459 if (ret) 1460 if (ret)
1460 return ret; 1461 return ret;
1461 1462
1462 ret = sonypi_probe(); 1463 ret = sonypi_probe();
1463 if (ret) 1464 if (ret)
1464 driver_unregister(&sonypi_driver); 1465 platform_driver_unregister(&sonypi_driver);
1465 1466
1466 return ret; 1467 return ret;
1467} 1468}
1468 1469
1469static void __exit sonypi_exit(void) 1470static void __exit sonypi_exit(void)
1470{ 1471{
1471 driver_unregister(&sonypi_driver); 1472 platform_driver_unregister(&sonypi_driver);
1472 sonypi_remove(); 1473 sonypi_remove();
1473} 1474}
1474 1475
diff --git a/drivers/char/tb0219.c b/drivers/char/tb0219.c
index 24355b23b2ca..b3d411a756fe 100644
--- a/drivers/char/tb0219.c
+++ b/drivers/char/tb0219.c
@@ -283,7 +283,7 @@ static void tb0219_pci_irq_init(void)
283 vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW); 283 vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW);
284} 284}
285 285
286static int tb0219_probe(struct device *dev) 286static int tb0219_probe(struct platform_device *dev)
287{ 287{
288 int retval; 288 int retval;
289 289
@@ -319,7 +319,7 @@ static int tb0219_probe(struct device *dev)
319 return 0; 319 return 0;
320} 320}
321 321
322static int tb0219_remove(struct device *dev) 322static int tb0219_remove(struct platform_device *dev)
323{ 323{
324 _machine_restart = old_machine_restart; 324 _machine_restart = old_machine_restart;
325 325
@@ -333,11 +333,12 @@ static int tb0219_remove(struct device *dev)
333 333
334static struct platform_device *tb0219_platform_device; 334static struct platform_device *tb0219_platform_device;
335 335
336static struct device_driver tb0219_device_driver = { 336static struct platform_driver tb0219_device_driver = {
337 .name = "TB0219",
338 .bus = &platform_bus_type,
339 .probe = tb0219_probe, 337 .probe = tb0219_probe,
340 .remove = tb0219_remove, 338 .remove = tb0219_remove,
339 .driver = {
340 .name = "TB0219",
341 },
341}; 342};
342 343
343static int __devinit tanbac_tb0219_init(void) 344static int __devinit tanbac_tb0219_init(void)
@@ -348,7 +349,7 @@ static int __devinit tanbac_tb0219_init(void)
348 if (IS_ERR(tb0219_platform_device)) 349 if (IS_ERR(tb0219_platform_device))
349 return PTR_ERR(tb0219_platform_device); 350 return PTR_ERR(tb0219_platform_device);
350 351
351 retval = driver_register(&tb0219_device_driver); 352 retval = platform_driver_register(&tb0219_device_driver);
352 if (retval < 0) 353 if (retval < 0)
353 platform_device_unregister(tb0219_platform_device); 354 platform_device_unregister(tb0219_platform_device);
354 355
@@ -357,7 +358,7 @@ static int __devinit tanbac_tb0219_init(void)
357 358
358static void __devexit tanbac_tb0219_exit(void) 359static void __devexit tanbac_tb0219_exit(void)
359{ 360{
360 driver_unregister(&tb0219_device_driver); 361 platform_driver_unregister(&tb0219_device_driver);
361 362
362 platform_device_unregister(tb0219_platform_device); 363 platform_device_unregister(tb0219_platform_device);
363} 364}
diff --git a/drivers/char/vr41xx_giu.c b/drivers/char/vr41xx_giu.c
index 94641085faf8..9ac6d43437b3 100644
--- a/drivers/char/vr41xx_giu.c
+++ b/drivers/char/vr41xx_giu.c
@@ -613,7 +613,7 @@ static struct file_operations gpio_fops = {
613 .release = gpio_release, 613 .release = gpio_release,
614}; 614};
615 615
616static int giu_probe(struct device *dev) 616static int giu_probe(struct platform_device *dev)
617{ 617{
618 unsigned long start, size, flags = 0; 618 unsigned long start, size, flags = 0;
619 unsigned int nr_pins = 0; 619 unsigned int nr_pins = 0;
@@ -697,7 +697,7 @@ static int giu_probe(struct device *dev)
697 return cascade_irq(GIUINT_IRQ, giu_get_irq); 697 return cascade_irq(GIUINT_IRQ, giu_get_irq);
698} 698}
699 699
700static int giu_remove(struct device *dev) 700static int giu_remove(struct platform_device *dev)
701{ 701{
702 iounmap(giu_base); 702 iounmap(giu_base);
703 703
@@ -710,11 +710,12 @@ static int giu_remove(struct device *dev)
710 710
711static struct platform_device *giu_platform_device; 711static struct platform_device *giu_platform_device;
712 712
713static struct device_driver giu_device_driver = { 713static struct platform_driver giu_device_driver = {
714 .name = "GIU",
715 .bus = &platform_bus_type,
716 .probe = giu_probe, 714 .probe = giu_probe,
717 .remove = giu_remove, 715 .remove = giu_remove,
716 .driver = {
717 .name = "GIU",
718 },
718}; 719};
719 720
720static int __devinit vr41xx_giu_init(void) 721static int __devinit vr41xx_giu_init(void)
@@ -725,7 +726,7 @@ static int __devinit vr41xx_giu_init(void)
725 if (IS_ERR(giu_platform_device)) 726 if (IS_ERR(giu_platform_device))
726 return PTR_ERR(giu_platform_device); 727 return PTR_ERR(giu_platform_device);
727 728
728 retval = driver_register(&giu_device_driver); 729 retval = platform_driver_register(&giu_device_driver);
729 if (retval < 0) 730 if (retval < 0)
730 platform_device_unregister(giu_platform_device); 731 platform_device_unregister(giu_platform_device);
731 732
@@ -734,7 +735,7 @@ static int __devinit vr41xx_giu_init(void)
734 735
735static void __devexit vr41xx_giu_exit(void) 736static void __devexit vr41xx_giu_exit(void)
736{ 737{
737 driver_unregister(&giu_device_driver); 738 platform_driver_unregister(&giu_device_driver);
738 739
739 platform_device_unregister(giu_platform_device); 740 platform_device_unregister(giu_platform_device);
740} 741}
diff --git a/drivers/char/vr41xx_rtc.c b/drivers/char/vr41xx_rtc.c
index 5e3292df69d8..435b30748e23 100644
--- a/drivers/char/vr41xx_rtc.c
+++ b/drivers/char/vr41xx_rtc.c
@@ -560,13 +560,11 @@ static struct miscdevice rtc_miscdevice = {
560 .fops = &rtc_fops, 560 .fops = &rtc_fops,
561}; 561};
562 562
563static int rtc_probe(struct device *dev) 563static int rtc_probe(struct platform_device *pdev)
564{ 564{
565 struct platform_device *pdev;
566 unsigned int irq; 565 unsigned int irq;
567 int retval; 566 int retval;
568 567
569 pdev = to_platform_device(dev);
570 if (pdev->num_resources != 2) 568 if (pdev->num_resources != 2)
571 return -EBUSY; 569 return -EBUSY;
572 570
@@ -635,7 +633,7 @@ static int rtc_probe(struct device *dev)
635 return 0; 633 return 0;
636} 634}
637 635
638static int rtc_remove(struct device *dev) 636static int rtc_remove(struct platform_device *dev)
639{ 637{
640 int retval; 638 int retval;
641 639
@@ -655,11 +653,12 @@ static int rtc_remove(struct device *dev)
655 653
656static struct platform_device *rtc_platform_device; 654static struct platform_device *rtc_platform_device;
657 655
658static struct device_driver rtc_device_driver = { 656static struct platform_driver rtc_device_driver = {
659 .name = rtc_name,
660 .bus = &platform_bus_type,
661 .probe = rtc_probe, 657 .probe = rtc_probe,
662 .remove = rtc_remove, 658 .remove = rtc_remove,
659 .driver = {
660 .name = rtc_name,
661 },
663}; 662};
664 663
665static int __devinit vr41xx_rtc_init(void) 664static int __devinit vr41xx_rtc_init(void)
@@ -691,7 +690,7 @@ static int __devinit vr41xx_rtc_init(void)
691 if (IS_ERR(rtc_platform_device)) 690 if (IS_ERR(rtc_platform_device))
692 return PTR_ERR(rtc_platform_device); 691 return PTR_ERR(rtc_platform_device);
693 692
694 retval = driver_register(&rtc_device_driver); 693 retval = platform_driver_register(&rtc_device_driver);
695 if (retval < 0) 694 if (retval < 0)
696 platform_device_unregister(rtc_platform_device); 695 platform_device_unregister(rtc_platform_device);
697 696
@@ -700,7 +699,7 @@ static int __devinit vr41xx_rtc_init(void)
700 699
701static void __devexit vr41xx_rtc_exit(void) 700static void __devexit vr41xx_rtc_exit(void)
702{ 701{
703 driver_unregister(&rtc_device_driver); 702 platform_driver_unregister(&rtc_device_driver);
704 703
705 platform_device_unregister(rtc_platform_device); 704 platform_device_unregister(rtc_platform_device);
706} 705}
diff --git a/drivers/char/watchdog/mpcore_wdt.c b/drivers/char/watchdog/mpcore_wdt.c
index da631c114fd1..9defcf861b67 100644
--- a/drivers/char/watchdog/mpcore_wdt.c
+++ b/drivers/char/watchdog/mpcore_wdt.c
@@ -139,7 +139,7 @@ static int mpcore_wdt_set_heartbeat(int t)
139 */ 139 */
140static int mpcore_wdt_open(struct inode *inode, struct file *file) 140static int mpcore_wdt_open(struct inode *inode, struct file *file)
141{ 141{
142 struct mpcore_wdt *wdt = dev_get_drvdata(&mpcore_wdt_dev->dev); 142 struct mpcore_wdt *wdt = platform_get_drvdata(mpcore_wdt_dev);
143 143
144 if (test_and_set_bit(0, &wdt->timer_alive)) 144 if (test_and_set_bit(0, &wdt->timer_alive))
145 return -EBUSY; 145 return -EBUSY;
@@ -291,9 +291,9 @@ static int mpcore_wdt_ioctl(struct inode *inode, struct file *file,
291 * System shutdown handler. Turn off the watchdog if we're 291 * System shutdown handler. Turn off the watchdog if we're
292 * restarting or halting the system. 292 * restarting or halting the system.
293 */ 293 */
294static void mpcore_wdt_shutdown(struct device *_dev) 294static void mpcore_wdt_shutdown(struct platform_device *dev)
295{ 295{
296 struct mpcore_wdt *wdt = dev_get_drvdata(_dev); 296 struct mpcore_wdt *wdt = platform_get_drvdata(dev);
297 297
298 if (system_state == SYSTEM_RESTART || system_state == SYSTEM_HALT) 298 if (system_state == SYSTEM_RESTART || system_state == SYSTEM_HALT)
299 mpcore_wdt_stop(wdt); 299 mpcore_wdt_stop(wdt);
@@ -317,9 +317,8 @@ static struct miscdevice mpcore_wdt_miscdev = {
317 .fops = &mpcore_wdt_fops, 317 .fops = &mpcore_wdt_fops,
318}; 318};
319 319
320static int __devinit mpcore_wdt_probe(struct device *_dev) 320static int __devinit mpcore_wdt_probe(struct platform_device *dev)
321{ 321{
322 struct platform_device *dev = to_platform_device(_dev);
323 struct mpcore_wdt *wdt; 322 struct mpcore_wdt *wdt;
324 struct resource *res; 323 struct resource *res;
325 int ret; 324 int ret;
@@ -364,7 +363,7 @@ static int __devinit mpcore_wdt_probe(struct device *_dev)
364 } 363 }
365 364
366 mpcore_wdt_stop(wdt); 365 mpcore_wdt_stop(wdt);
367 dev_set_drvdata(&dev->dev, wdt); 366 platform_set_drvdata(&dev->dev, wdt);
368 mpcore_wdt_dev = dev; 367 mpcore_wdt_dev = dev;
369 368
370 return 0; 369 return 0;
@@ -379,11 +378,11 @@ static int __devinit mpcore_wdt_probe(struct device *_dev)
379 return ret; 378 return ret;
380} 379}
381 380
382static int __devexit mpcore_wdt_remove(struct device *dev) 381static int __devexit mpcore_wdt_remove(struct platform_device *dev)
383{ 382{
384 struct mpcore_wdt *wdt = dev_get_drvdata(dev); 383 struct mpcore_wdt *wdt = platform_get_drvdata(dev);
385 384
386 dev_set_drvdata(dev, NULL); 385 platform_set_drvdata(dev, NULL);
387 386
388 misc_deregister(&mpcore_wdt_miscdev); 387 misc_deregister(&mpcore_wdt_miscdev);
389 388
@@ -395,13 +394,14 @@ static int __devexit mpcore_wdt_remove(struct device *dev)
395 return 0; 394 return 0;
396} 395}
397 396
398static struct device_driver mpcore_wdt_driver = { 397static struct platform_driver mpcore_wdt_driver = {
399 .owner = THIS_MODULE,
400 .name = "mpcore_wdt",
401 .bus = &platform_bus_type,
402 .probe = mpcore_wdt_probe, 398 .probe = mpcore_wdt_probe,
403 .remove = __devexit_p(mpcore_wdt_remove), 399 .remove = __devexit_p(mpcore_wdt_remove),
404 .shutdown = mpcore_wdt_shutdown, 400 .shutdown = mpcore_wdt_shutdown,
401 .driver = {
402 .owner = THIS_MODULE,
403 .name = "mpcore_wdt",
404 },
405}; 405};
406 406
407static char banner[] __initdata = KERN_INFO "MPcore Watchdog Timer: 0.1. mpcore_noboot=%d mpcore_margin=%d sec (nowayout= %d)\n"; 407static char banner[] __initdata = KERN_INFO "MPcore Watchdog Timer: 0.1. mpcore_noboot=%d mpcore_margin=%d sec (nowayout= %d)\n";
@@ -420,12 +420,12 @@ static int __init mpcore_wdt_init(void)
420 420
421 printk(banner, mpcore_noboot, mpcore_margin, nowayout); 421 printk(banner, mpcore_noboot, mpcore_margin, nowayout);
422 422
423 return driver_register(&mpcore_wdt_driver); 423 return platform_driver_register(&mpcore_wdt_driver);
424} 424}
425 425
426static void __exit mpcore_wdt_exit(void) 426static void __exit mpcore_wdt_exit(void)
427{ 427{
428 driver_unregister(&mpcore_wdt_driver); 428 platform_driver_unregister(&mpcore_wdt_driver);
429} 429}
430 430
431module_init(mpcore_wdt_init); 431module_init(mpcore_wdt_init);
diff --git a/drivers/char/watchdog/mv64x60_wdt.c b/drivers/char/watchdog/mv64x60_wdt.c
index 119b3c541d95..00d9ef04a369 100644
--- a/drivers/char/watchdog/mv64x60_wdt.c
+++ b/drivers/char/watchdog/mv64x60_wdt.c
@@ -182,10 +182,9 @@ static struct miscdevice mv64x60_wdt_miscdev = {
182 .fops = &mv64x60_wdt_fops, 182 .fops = &mv64x60_wdt_fops,
183}; 183};
184 184
185static int __devinit mv64x60_wdt_probe(struct device *dev) 185static int __devinit mv64x60_wdt_probe(struct platform_device *dev)
186{ 186{
187 struct platform_device *pd = to_platform_device(dev); 187 struct mv64x60_wdt_pdata *pdata = dev->dev.platform_data;
188 struct mv64x60_wdt_pdata *pdata = pd->dev.platform_data;
189 int bus_clk = 133; 188 int bus_clk = 133;
190 189
191 mv64x60_wdt_timeout = 10; 190 mv64x60_wdt_timeout = 10;
@@ -202,7 +201,7 @@ static int __devinit mv64x60_wdt_probe(struct device *dev)
202 return misc_register(&mv64x60_wdt_miscdev); 201 return misc_register(&mv64x60_wdt_miscdev);
203} 202}
204 203
205static int __devexit mv64x60_wdt_remove(struct device *dev) 204static int __devexit mv64x60_wdt_remove(struct platform_device *dev)
206{ 205{
207 misc_deregister(&mv64x60_wdt_miscdev); 206 misc_deregister(&mv64x60_wdt_miscdev);
208 207
@@ -212,12 +211,13 @@ static int __devexit mv64x60_wdt_remove(struct device *dev)
212 return 0; 211 return 0;
213} 212}
214 213
215static struct device_driver mv64x60_wdt_driver = { 214static struct platform_driver mv64x60_wdt_driver = {
216 .owner = THIS_MODULE,
217 .name = MV64x60_WDT_NAME,
218 .bus = &platform_bus_type,
219 .probe = mv64x60_wdt_probe, 215 .probe = mv64x60_wdt_probe,
220 .remove = __devexit_p(mv64x60_wdt_remove), 216 .remove = __devexit_p(mv64x60_wdt_remove),
217 .driver = {
218 .owner = THIS_MODULE,
219 .name = MV64x60_WDT_NAME,
220 },
221}; 221};
222 222
223static struct platform_device *mv64x60_wdt_dev; 223static struct platform_device *mv64x60_wdt_dev;
@@ -235,14 +235,14 @@ static int __init mv64x60_wdt_init(void)
235 goto out; 235 goto out;
236 } 236 }
237 237
238 ret = driver_register(&mv64x60_wdt_driver); 238 ret = platform_driver_register(&mv64x60_wdt_driver);
239 out: 239 out:
240 return ret; 240 return ret;
241} 241}
242 242
243static void __exit mv64x60_wdt_exit(void) 243static void __exit mv64x60_wdt_exit(void)
244{ 244{
245 driver_unregister(&mv64x60_wdt_driver); 245 platform_driver_unregister(&mv64x60_wdt_driver);
246 platform_device_unregister(mv64x60_wdt_dev); 246 platform_device_unregister(mv64x60_wdt_dev);
247} 247}
248 248
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c
index 751cb77b0715..eb667daee19b 100644
--- a/drivers/char/watchdog/s3c2410_wdt.c
+++ b/drivers/char/watchdog/s3c2410_wdt.c
@@ -347,15 +347,14 @@ static irqreturn_t s3c2410wdt_irq(int irqno, void *param,
347} 347}
348/* device interface */ 348/* device interface */
349 349
350static int s3c2410wdt_probe(struct device *dev) 350static int s3c2410wdt_probe(struct platform_device *pdev)
351{ 351{
352 struct platform_device *pdev = to_platform_device(dev);
353 struct resource *res; 352 struct resource *res;
354 int started = 0; 353 int started = 0;
355 int ret; 354 int ret;
356 int size; 355 int size;
357 356
358 DBG("%s: probe=%p, device=%p\n", __FUNCTION__, pdev, dev); 357 DBG("%s: probe=%p\n", __FUNCTION__, pdev);
359 358
360 /* get the memory region for the watchdog timer */ 359 /* get the memory region for the watchdog timer */
361 360
@@ -386,13 +385,13 @@ static int s3c2410wdt_probe(struct device *dev)
386 return -ENOENT; 385 return -ENOENT;
387 } 386 }
388 387
389 ret = request_irq(res->start, s3c2410wdt_irq, 0, pdev->name, dev); 388 ret = request_irq(res->start, s3c2410wdt_irq, 0, pdev->name, pdev);
390 if (ret != 0) { 389 if (ret != 0) {
391 printk(KERN_INFO PFX "failed to install irq (%d)\n", ret); 390 printk(KERN_INFO PFX "failed to install irq (%d)\n", ret);
392 return ret; 391 return ret;
393 } 392 }
394 393
395 wdt_clock = clk_get(dev, "watchdog"); 394 wdt_clock = clk_get(&pdev->dev, "watchdog");
396 if (wdt_clock == NULL) { 395 if (wdt_clock == NULL) {
397 printk(KERN_INFO PFX "failed to find watchdog clock source\n"); 396 printk(KERN_INFO PFX "failed to find watchdog clock source\n");
398 return -ENOENT; 397 return -ENOENT;
@@ -430,7 +429,7 @@ static int s3c2410wdt_probe(struct device *dev)
430 return 0; 429 return 0;
431} 430}
432 431
433static int s3c2410wdt_remove(struct device *dev) 432static int s3c2410wdt_remove(struct platform_device *dev)
434{ 433{
435 if (wdt_mem != NULL) { 434 if (wdt_mem != NULL) {
436 release_resource(wdt_mem); 435 release_resource(wdt_mem);
@@ -454,7 +453,7 @@ static int s3c2410wdt_remove(struct device *dev)
454 return 0; 453 return 0;
455} 454}
456 455
457static void s3c2410wdt_shutdown(struct device *dev) 456static void s3c2410wdt_shutdown(struct platform_device *dev)
458{ 457{
459 s3c2410wdt_stop(); 458 s3c2410wdt_stop();
460} 459}
@@ -464,7 +463,7 @@ static void s3c2410wdt_shutdown(struct device *dev)
464static unsigned long wtcon_save; 463static unsigned long wtcon_save;
465static unsigned long wtdat_save; 464static unsigned long wtdat_save;
466 465
467static int s3c2410wdt_suspend(struct device *dev, pm_message_t state) 466static int s3c2410wdt_suspend(struct platform_device *dev, pm_message_t state)
468{ 467{
469 /* Save watchdog state, and turn it off. */ 468 /* Save watchdog state, and turn it off. */
470 wtcon_save = readl(wdt_base + S3C2410_WTCON); 469 wtcon_save = readl(wdt_base + S3C2410_WTCON);
@@ -476,7 +475,7 @@ static int s3c2410wdt_suspend(struct device *dev, pm_message_t state)
476 return 0; 475 return 0;
477} 476}
478 477
479static int s3c2410wdt_resume(struct device *dev) 478static int s3c2410wdt_resume(struct platform_device *dev)
480{ 479{
481 /* Restore watchdog state. */ 480 /* Restore watchdog state. */
482 481
@@ -496,15 +495,16 @@ static int s3c2410wdt_resume(struct device *dev)
496#endif /* CONFIG_PM */ 495#endif /* CONFIG_PM */
497 496
498 497
499static struct device_driver s3c2410wdt_driver = { 498static struct platform_driver s3c2410wdt_driver = {
500 .owner = THIS_MODULE,
501 .name = "s3c2410-wdt",
502 .bus = &platform_bus_type,
503 .probe = s3c2410wdt_probe, 499 .probe = s3c2410wdt_probe,
504 .remove = s3c2410wdt_remove, 500 .remove = s3c2410wdt_remove,
505 .shutdown = s3c2410wdt_shutdown, 501 .shutdown = s3c2410wdt_shutdown,
506 .suspend = s3c2410wdt_suspend, 502 .suspend = s3c2410wdt_suspend,
507 .resume = s3c2410wdt_resume, 503 .resume = s3c2410wdt_resume,
504 .driver = {
505 .owner = THIS_MODULE,
506 .name = "s3c2410-wdt",
507 },
508}; 508};
509 509
510 510
@@ -513,12 +513,12 @@ static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Si
513static int __init watchdog_init(void) 513static int __init watchdog_init(void)
514{ 514{
515 printk(banner); 515 printk(banner);
516 return driver_register(&s3c2410wdt_driver); 516 return platform_driver_register(&s3c2410wdt_driver);
517} 517}
518 518
519static void __exit watchdog_exit(void) 519static void __exit watchdog_exit(void)
520{ 520{
521 driver_unregister(&s3c2410wdt_driver); 521 platform_driver_unregister(&s3c2410wdt_driver);
522} 522}
523 523
524module_init(watchdog_init); 524module_init(watchdog_init);
diff --git a/drivers/hwmon/hdaps.c b/drivers/hwmon/hdaps.c
index 1e5dfc7805e2..c81bd4bce1b8 100644
--- a/drivers/hwmon/hdaps.c
+++ b/drivers/hwmon/hdaps.c
@@ -60,9 +60,11 @@
60 60
61#define HDAPS_POLL_PERIOD (HZ/20) /* poll for input every 1/20s */ 61#define HDAPS_POLL_PERIOD (HZ/20) /* poll for input every 1/20s */
62#define HDAPS_INPUT_FUZZ 4 /* input event threshold */ 62#define HDAPS_INPUT_FUZZ 4 /* input event threshold */
63#define HDAPS_INPUT_FLAT 4
63 64
64static struct timer_list hdaps_timer; 65static struct timer_list hdaps_timer;
65static struct platform_device *pdev; 66static struct platform_device *pdev;
67static struct input_dev *hdaps_idev;
66static unsigned int hdaps_invert; 68static unsigned int hdaps_invert;
67static u8 km_activity; 69static u8 km_activity;
68static int rest_x; 70static int rest_x;
@@ -284,7 +286,7 @@ out:
284 286
285/* Device model stuff */ 287/* Device model stuff */
286 288
287static int hdaps_probe(struct device *dev) 289static int hdaps_probe(struct platform_device *dev)
288{ 290{
289 int ret; 291 int ret;
290 292
@@ -296,29 +298,18 @@ static int hdaps_probe(struct device *dev)
296 return 0; 298 return 0;
297} 299}
298 300
299static int hdaps_resume(struct device *dev) 301static int hdaps_resume(struct platform_device *dev)
300{ 302{
301 return hdaps_device_init(); 303 return hdaps_device_init();
302} 304}
303 305
304static struct device_driver hdaps_driver = { 306static struct platform_driver hdaps_driver = {
305 .name = "hdaps",
306 .bus = &platform_bus_type,
307 .owner = THIS_MODULE,
308 .probe = hdaps_probe, 307 .probe = hdaps_probe,
309 .resume = hdaps_resume 308 .resume = hdaps_resume,
310}; 309 .driver = {
311 310 .name = "hdaps",
312/* Input class stuff */ 311 .owner = THIS_MODULE,
313 312 },
314static struct input_dev hdaps_idev = {
315 .name = "hdaps",
316 .evbit = { BIT(EV_ABS) },
317 .absbit = { BIT(ABS_X) | BIT(ABS_Y) },
318 .absmin = { [ABS_X] = -256, [ABS_Y] = -256 },
319 .absmax = { [ABS_X] = 256, [ABS_Y] = 256 },
320 .absfuzz = { [ABS_X] = HDAPS_INPUT_FUZZ, [ABS_Y] = HDAPS_INPUT_FUZZ },
321 .absflat = { [ABS_X] = HDAPS_INPUT_FUZZ, [ABS_Y] = HDAPS_INPUT_FUZZ },
322}; 313};
323 314
324/* 315/*
@@ -342,9 +333,9 @@ static void hdaps_mousedev_poll(unsigned long unused)
342 if (__hdaps_read_pair(HDAPS_PORT_XPOS, HDAPS_PORT_YPOS, &x, &y)) 333 if (__hdaps_read_pair(HDAPS_PORT_XPOS, HDAPS_PORT_YPOS, &x, &y))
343 goto out; 334 goto out;
344 335
345 input_report_abs(&hdaps_idev, ABS_X, x - rest_x); 336 input_report_abs(hdaps_idev, ABS_X, x - rest_x);
346 input_report_abs(&hdaps_idev, ABS_Y, y - rest_y); 337 input_report_abs(hdaps_idev, ABS_Y, y - rest_y);
347 input_sync(&hdaps_idev); 338 input_sync(hdaps_idev);
348 339
349 mod_timer(&hdaps_timer, jiffies + HDAPS_POLL_PERIOD); 340 mod_timer(&hdaps_timer, jiffies + HDAPS_POLL_PERIOD);
350 341
@@ -550,7 +541,7 @@ static int __init hdaps_init(void)
550 goto out; 541 goto out;
551 } 542 }
552 543
553 ret = driver_register(&hdaps_driver); 544 ret = platform_driver_register(&hdaps_driver);
554 if (ret) 545 if (ret)
555 goto out_region; 546 goto out_region;
556 547
@@ -564,12 +555,25 @@ static int __init hdaps_init(void)
564 if (ret) 555 if (ret)
565 goto out_device; 556 goto out_device;
566 557
558 hdaps_idev = input_allocate_device();
559 if (!hdaps_idev) {
560 ret = -ENOMEM;
561 goto out_group;
562 }
563
567 /* initial calibrate for the input device */ 564 /* initial calibrate for the input device */
568 hdaps_calibrate(); 565 hdaps_calibrate();
569 566
570 /* initialize the input class */ 567 /* initialize the input class */
571 hdaps_idev.dev = &pdev->dev; 568 hdaps_idev->name = "hdaps";
572 input_register_device(&hdaps_idev); 569 hdaps_idev->cdev.dev = &pdev->dev;
570 hdaps_idev->evbit[0] = BIT(EV_ABS);
571 input_set_abs_params(hdaps_idev, ABS_X,
572 -256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT);
573 input_set_abs_params(hdaps_idev, ABS_X,
574 -256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT);
575
576 input_register_device(hdaps_idev);
573 577
574 /* start up our timer for the input device */ 578 /* start up our timer for the input device */
575 init_timer(&hdaps_timer); 579 init_timer(&hdaps_timer);
@@ -580,10 +584,12 @@ static int __init hdaps_init(void)
580 printk(KERN_INFO "hdaps: driver successfully loaded.\n"); 584 printk(KERN_INFO "hdaps: driver successfully loaded.\n");
581 return 0; 585 return 0;
582 586
587out_group:
588 sysfs_remove_group(&pdev->dev.kobj, &hdaps_attribute_group);
583out_device: 589out_device:
584 platform_device_unregister(pdev); 590 platform_device_unregister(pdev);
585out_driver: 591out_driver:
586 driver_unregister(&hdaps_driver); 592 platform_driver_unregister(&hdaps_driver);
587out_region: 593out_region:
588 release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS); 594 release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS);
589out: 595out:
@@ -594,10 +600,10 @@ out:
594static void __exit hdaps_exit(void) 600static void __exit hdaps_exit(void)
595{ 601{
596 del_timer_sync(&hdaps_timer); 602 del_timer_sync(&hdaps_timer);
597 input_unregister_device(&hdaps_idev); 603 input_unregister_device(hdaps_idev);
598 sysfs_remove_group(&pdev->dev.kobj, &hdaps_attribute_group); 604 sysfs_remove_group(&pdev->dev.kobj, &hdaps_attribute_group);
599 platform_device_unregister(pdev); 605 platform_device_unregister(pdev);
600 driver_unregister(&hdaps_driver); 606 platform_driver_unregister(&hdaps_driver);
601 release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS); 607 release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS);
602 608
603 printk(KERN_INFO "hdaps: driver unloaded.\n"); 609 printk(KERN_INFO "hdaps: driver unloaded.\n");
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
index cfae4ad00fae..1414851a17b8 100644
--- a/drivers/i2c/busses/i2c-iop3xx.c
+++ b/drivers/i2c/busses/i2c-iop3xx.c
@@ -405,10 +405,9 @@ static struct i2c_algorithm iop3xx_i2c_algo = {
405}; 405};
406 406
407static int 407static int
408iop3xx_i2c_remove(struct device *device) 408iop3xx_i2c_remove(struct platform_device *pdev)
409{ 409{
410 struct platform_device *pdev = to_platform_device(device); 410 struct i2c_adapter *padapter = platform_get_drvdata(pdev);
411 struct i2c_adapter *padapter = dev_get_drvdata(&pdev->dev);
412 struct i2c_algo_iop3xx_data *adapter_data = 411 struct i2c_algo_iop3xx_data *adapter_data =
413 (struct i2c_algo_iop3xx_data *)padapter->algo_data; 412 (struct i2c_algo_iop3xx_data *)padapter->algo_data;
414 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 413 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -426,15 +425,14 @@ iop3xx_i2c_remove(struct device *device)
426 kfree(adapter_data); 425 kfree(adapter_data);
427 kfree(padapter); 426 kfree(padapter);
428 427
429 dev_set_drvdata(&pdev->dev, NULL); 428 platform_set_drvdata(pdev, NULL);
430 429
431 return 0; 430 return 0;
432} 431}
433 432
434static int 433static int
435iop3xx_i2c_probe(struct device *dev) 434iop3xx_i2c_probe(struct platform_device *pdev)
436{ 435{
437 struct platform_device *pdev = to_platform_device(dev);
438 struct resource *res; 436 struct resource *res;
439 int ret; 437 int ret;
440 struct i2c_adapter *new_adapter; 438 struct i2c_adapter *new_adapter;
@@ -499,7 +497,7 @@ iop3xx_i2c_probe(struct device *dev)
499 iop3xx_i2c_set_slave_addr(adapter_data); 497 iop3xx_i2c_set_slave_addr(adapter_data);
500 iop3xx_i2c_enable(adapter_data); 498 iop3xx_i2c_enable(adapter_data);
501 499
502 dev_set_drvdata(&pdev->dev, new_adapter); 500 platform_set_drvdata(pdev, new_adapter);
503 new_adapter->algo_data = adapter_data; 501 new_adapter->algo_data = adapter_data;
504 502
505 i2c_add_adapter(new_adapter); 503 i2c_add_adapter(new_adapter);
@@ -523,24 +521,25 @@ out:
523} 521}
524 522
525 523
526static struct device_driver iop3xx_i2c_driver = { 524static struct platform_driver iop3xx_i2c_driver = {
527 .owner = THIS_MODULE,
528 .name = "IOP3xx-I2C",
529 .bus = &platform_bus_type,
530 .probe = iop3xx_i2c_probe, 525 .probe = iop3xx_i2c_probe,
531 .remove = iop3xx_i2c_remove 526 .remove = iop3xx_i2c_remove,
527 .driver = {
528 .owner = THIS_MODULE,
529 .name = "IOP3xx-I2C",
530 },
532}; 531};
533 532
534static int __init 533static int __init
535i2c_iop3xx_init (void) 534i2c_iop3xx_init (void)
536{ 535{
537 return driver_register(&iop3xx_i2c_driver); 536 return platform_driver_register(&iop3xx_i2c_driver);
538} 537}
539 538
540static void __exit 539static void __exit
541i2c_iop3xx_exit (void) 540i2c_iop3xx_exit (void)
542{ 541{
543 driver_unregister(&iop3xx_i2c_driver); 542 platform_driver_unregister(&iop3xx_i2c_driver);
544 return; 543 return;
545} 544}
546 545
diff --git a/drivers/i2c/busses/i2c-ixp2000.c b/drivers/i2c/busses/i2c-ixp2000.c
index 64552a376f2d..cef024a7d048 100644
--- a/drivers/i2c/busses/i2c-ixp2000.c
+++ b/drivers/i2c/busses/i2c-ixp2000.c
@@ -86,12 +86,11 @@ struct ixp2000_i2c_data {
86 struct i2c_algo_bit_data algo_data; 86 struct i2c_algo_bit_data algo_data;
87}; 87};
88 88
89static int ixp2000_i2c_remove(struct device *dev) 89static int ixp2000_i2c_remove(struct platform_device *plat_dev)
90{ 90{
91 struct platform_device *plat_dev = to_platform_device(dev); 91 struct ixp2000_i2c_data *drv_data = platform_get_drvdata(plat_dev);
92 struct ixp2000_i2c_data *drv_data = dev_get_drvdata(&plat_dev->dev);
93 92
94 dev_set_drvdata(&plat_dev->dev, NULL); 93 platform_set_drvdata(plat_dev, NULL);
95 94
96 i2c_bit_del_bus(&drv_data->adapter); 95 i2c_bit_del_bus(&drv_data->adapter);
97 96
@@ -100,10 +99,9 @@ static int ixp2000_i2c_remove(struct device *dev)
100 return 0; 99 return 0;
101} 100}
102 101
103static int ixp2000_i2c_probe(struct device *dev) 102static int ixp2000_i2c_probe(struct platform_device *plat_dev)
104{ 103{
105 int err; 104 int err;
106 struct platform_device *plat_dev = to_platform_device(dev);
107 struct ixp2000_i2c_pins *gpio = plat_dev->dev.platform_data; 105 struct ixp2000_i2c_pins *gpio = plat_dev->dev.platform_data;
108 struct ixp2000_i2c_data *drv_data = 106 struct ixp2000_i2c_data *drv_data =
109 kzalloc(sizeof(struct ixp2000_i2c_data), GFP_KERNEL); 107 kzalloc(sizeof(struct ixp2000_i2c_data), GFP_KERNEL);
@@ -139,27 +137,28 @@ static int ixp2000_i2c_probe(struct device *dev)
139 return err; 137 return err;
140 } 138 }
141 139
142 dev_set_drvdata(&plat_dev->dev, drv_data); 140 platform_set_drvdata(plat_dev, drv_data);
143 141
144 return 0; 142 return 0;
145} 143}
146 144
147static struct device_driver ixp2000_i2c_driver = { 145static struct platform_driver ixp2000_i2c_driver = {
148 .owner = THIS_MODULE,
149 .name = "IXP2000-I2C",
150 .bus = &platform_bus_type,
151 .probe = ixp2000_i2c_probe, 146 .probe = ixp2000_i2c_probe,
152 .remove = ixp2000_i2c_remove, 147 .remove = ixp2000_i2c_remove,
148 .driver = {
149 .name = "IXP2000-I2C",
150 .owner = THIS_MODULE,
151 },
153}; 152};
154 153
155static int __init ixp2000_i2c_init(void) 154static int __init ixp2000_i2c_init(void)
156{ 155{
157 return driver_register(&ixp2000_i2c_driver); 156 return platform_driver_register(&ixp2000_i2c_driver);
158} 157}
159 158
160static void __exit ixp2000_i2c_exit(void) 159static void __exit ixp2000_i2c_exit(void)
161{ 160{
162 driver_unregister(&ixp2000_i2c_driver); 161 platform_driver_unregister(&ixp2000_i2c_driver);
163} 162}
164 163
165module_init(ixp2000_i2c_init); 164module_init(ixp2000_i2c_init);
diff --git a/drivers/i2c/busses/i2c-ixp4xx.c b/drivers/i2c/busses/i2c-ixp4xx.c
index cc652c350814..aa36855fa995 100644
--- a/drivers/i2c/busses/i2c-ixp4xx.c
+++ b/drivers/i2c/busses/i2c-ixp4xx.c
@@ -87,12 +87,11 @@ struct ixp4xx_i2c_data {
87 struct i2c_algo_bit_data algo_data; 87 struct i2c_algo_bit_data algo_data;
88}; 88};
89 89
90static int ixp4xx_i2c_remove(struct device *dev) 90static int ixp4xx_i2c_remove(struct platform_device *plat_dev)
91{ 91{
92 struct platform_device *plat_dev = to_platform_device(dev); 92 struct ixp4xx_i2c_data *drv_data = platform_get_drvdata(plat_dev);
93 struct ixp4xx_i2c_data *drv_data = dev_get_drvdata(&plat_dev->dev);
94 93
95 dev_set_drvdata(&plat_dev->dev, NULL); 94 platform_set_drvdata(plat_dev, NULL);
96 95
97 i2c_bit_del_bus(&drv_data->adapter); 96 i2c_bit_del_bus(&drv_data->adapter);
98 97
@@ -101,10 +100,9 @@ static int ixp4xx_i2c_remove(struct device *dev)
101 return 0; 100 return 0;
102} 101}
103 102
104static int ixp4xx_i2c_probe(struct device *dev) 103static int ixp4xx_i2c_probe(struct platform_device *plat_dev)
105{ 104{
106 int err; 105 int err;
107 struct platform_device *plat_dev = to_platform_device(dev);
108 struct ixp4xx_i2c_pins *gpio = plat_dev->dev.platform_data; 106 struct ixp4xx_i2c_pins *gpio = plat_dev->dev.platform_data;
109 struct ixp4xx_i2c_data *drv_data = 107 struct ixp4xx_i2c_data *drv_data =
110 kzalloc(sizeof(struct ixp4xx_i2c_data), GFP_KERNEL); 108 kzalloc(sizeof(struct ixp4xx_i2c_data), GFP_KERNEL);
@@ -148,27 +146,28 @@ static int ixp4xx_i2c_probe(struct device *dev)
148 return err; 146 return err;
149 } 147 }
150 148
151 dev_set_drvdata(&plat_dev->dev, drv_data); 149 platform_set_drvdata(plat_dev, drv_data);
152 150
153 return 0; 151 return 0;
154} 152}
155 153
156static struct device_driver ixp4xx_i2c_driver = { 154static struct platform_driver ixp4xx_i2c_driver = {
157 .owner = THIS_MODULE,
158 .name = "IXP4XX-I2C",
159 .bus = &platform_bus_type,
160 .probe = ixp4xx_i2c_probe, 155 .probe = ixp4xx_i2c_probe,
161 .remove = ixp4xx_i2c_remove, 156 .remove = ixp4xx_i2c_remove,
157 .driver = {
158 .name = "IXP4XX-I2C",
159 .owner = THIS_MODULE,
160 },
162}; 161};
163 162
164static int __init ixp4xx_i2c_init(void) 163static int __init ixp4xx_i2c_init(void)
165{ 164{
166 return driver_register(&ixp4xx_i2c_driver); 165 return platform_driver_register(&ixp4xx_i2c_driver);
167} 166}
168 167
169static void __exit ixp4xx_i2c_exit(void) 168static void __exit ixp4xx_i2c_exit(void)
170{ 169{
171 driver_unregister(&ixp4xx_i2c_driver); 170 platform_driver_unregister(&ixp4xx_i2c_driver);
172} 171}
173 172
174module_init(ixp4xx_i2c_init); 173module_init(ixp4xx_i2c_init);
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index 65b939a059e9..5ccd338a9dc9 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -288,11 +288,10 @@ static struct i2c_adapter mpc_ops = {
288 .retries = 1 288 .retries = 1
289}; 289};
290 290
291static int fsl_i2c_probe(struct device *device) 291static int fsl_i2c_probe(struct platform_device *pdev)
292{ 292{
293 int result = 0; 293 int result = 0;
294 struct mpc_i2c *i2c; 294 struct mpc_i2c *i2c;
295 struct platform_device *pdev = to_platform_device(device);
296 struct fsl_i2c_platform_data *pdata; 295 struct fsl_i2c_platform_data *pdata;
297 struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 296 struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
298 297
@@ -323,7 +322,7 @@ static int fsl_i2c_probe(struct device *device)
323 } 322 }
324 323
325 mpc_i2c_setclock(i2c); 324 mpc_i2c_setclock(i2c);
326 dev_set_drvdata(device, i2c); 325 platform_set_drvdata(pdev, i2c);
327 326
328 i2c->adap = mpc_ops; 327 i2c->adap = mpc_ops;
329 i2c_set_adapdata(&i2c->adap, i2c); 328 i2c_set_adapdata(&i2c->adap, i2c);
@@ -345,12 +344,12 @@ static int fsl_i2c_probe(struct device *device)
345 return result; 344 return result;
346}; 345};
347 346
348static int fsl_i2c_remove(struct device *device) 347static int fsl_i2c_remove(struct platform_device *pdev)
349{ 348{
350 struct mpc_i2c *i2c = dev_get_drvdata(device); 349 struct mpc_i2c *i2c = platform_get_drvdata(pdev);
351 350
352 i2c_del_adapter(&i2c->adap); 351 i2c_del_adapter(&i2c->adap);
353 dev_set_drvdata(device, NULL); 352 platform_set_drvdata(pdev, NULL);
354 353
355 if (i2c->irq != 0) 354 if (i2c->irq != 0)
356 free_irq(i2c->irq, i2c); 355 free_irq(i2c->irq, i2c);
@@ -361,22 +360,23 @@ static int fsl_i2c_remove(struct device *device)
361}; 360};
362 361
363/* Structure for a device driver */ 362/* Structure for a device driver */
364static struct device_driver fsl_i2c_driver = { 363static struct platform_driver fsl_i2c_driver = {
365 .owner = THIS_MODULE,
366 .name = "fsl-i2c",
367 .bus = &platform_bus_type,
368 .probe = fsl_i2c_probe, 364 .probe = fsl_i2c_probe,
369 .remove = fsl_i2c_remove, 365 .remove = fsl_i2c_remove,
366 .driver = {
367 .owner = THIS_MODULE,
368 .name = "fsl-i2c",
369 },
370}; 370};
371 371
372static int __init fsl_i2c_init(void) 372static int __init fsl_i2c_init(void)
373{ 373{
374 return driver_register(&fsl_i2c_driver); 374 return platform_driver_register(&fsl_i2c_driver);
375} 375}
376 376
377static void __exit fsl_i2c_exit(void) 377static void __exit fsl_i2c_exit(void)
378{ 378{
379 driver_unregister(&fsl_i2c_driver); 379 platform_driver_unregister(&fsl_i2c_driver);
380} 380}
381 381
382module_init(fsl_i2c_init); 382module_init(fsl_i2c_init);
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 6b48027b2ee3..afd7634e5cc9 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -492,11 +492,10 @@ mv64xxx_i2c_unmap_regs(struct mv64xxx_i2c_data *drv_data)
492} 492}
493 493
494static int __devinit 494static int __devinit
495mv64xxx_i2c_probe(struct device *dev) 495mv64xxx_i2c_probe(struct platform_device *pd)
496{ 496{
497 struct platform_device *pd = to_platform_device(dev);
498 struct mv64xxx_i2c_data *drv_data; 497 struct mv64xxx_i2c_data *drv_data;
499 struct mv64xxx_i2c_pdata *pdata = dev->platform_data; 498 struct mv64xxx_i2c_pdata *pdata = pd->dev.platform_data;
500 int rc; 499 int rc;
501 500
502 if ((pd->id != 0) || !pdata) 501 if ((pd->id != 0) || !pdata)
@@ -526,7 +525,7 @@ mv64xxx_i2c_probe(struct device *dev)
526 drv_data->adapter.class = I2C_CLASS_HWMON; 525 drv_data->adapter.class = I2C_CLASS_HWMON;
527 drv_data->adapter.timeout = pdata->timeout; 526 drv_data->adapter.timeout = pdata->timeout;
528 drv_data->adapter.retries = pdata->retries; 527 drv_data->adapter.retries = pdata->retries;
529 dev_set_drvdata(dev, drv_data); 528 platform_set_drvdata(pd, drv_data);
530 i2c_set_adapdata(&drv_data->adapter, drv_data); 529 i2c_set_adapdata(&drv_data->adapter, drv_data);
531 530
532 if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0, 531 if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0,
@@ -555,9 +554,9 @@ mv64xxx_i2c_probe(struct device *dev)
555} 554}
556 555
557static int __devexit 556static int __devexit
558mv64xxx_i2c_remove(struct device *dev) 557mv64xxx_i2c_remove(struct platform_device *dev)
559{ 558{
560 struct mv64xxx_i2c_data *drv_data = dev_get_drvdata(dev); 559 struct mv64xxx_i2c_data *drv_data = platform_get_drvdata(dev);
561 int rc; 560 int rc;
562 561
563 rc = i2c_del_adapter(&drv_data->adapter); 562 rc = i2c_del_adapter(&drv_data->adapter);
@@ -568,24 +567,25 @@ mv64xxx_i2c_remove(struct device *dev)
568 return rc; 567 return rc;
569} 568}
570 569
571static struct device_driver mv64xxx_i2c_driver = { 570static struct platform_driver mv64xxx_i2c_driver = {
572 .owner = THIS_MODULE,
573 .name = MV64XXX_I2C_CTLR_NAME,
574 .bus = &platform_bus_type,
575 .probe = mv64xxx_i2c_probe, 571 .probe = mv64xxx_i2c_probe,
576 .remove = mv64xxx_i2c_remove, 572 .remove = mv64xxx_i2c_remove,
573 .driver = {
574 .owner = THIS_MODULE,
575 .name = MV64XXX_I2C_CTLR_NAME,
576 },
577}; 577};
578 578
579static int __init 579static int __init
580mv64xxx_i2c_init(void) 580mv64xxx_i2c_init(void)
581{ 581{
582 return driver_register(&mv64xxx_i2c_driver); 582 return platform_driver_register(&mv64xxx_i2c_driver);
583} 583}
584 584
585static void __exit 585static void __exit
586mv64xxx_i2c_exit(void) 586mv64xxx_i2c_exit(void)
587{ 587{
588 driver_unregister(&mv64xxx_i2c_driver); 588 platform_driver_unregister(&mv64xxx_i2c_driver);
589} 589}
590 590
591module_init(mv64xxx_i2c_init); 591module_init(mv64xxx_i2c_init);
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 67ccbea24ba4..70f7ab829d36 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -936,10 +936,10 @@ static struct pxa_i2c i2c_pxa = {
936 }, 936 },
937}; 937};
938 938
939static int i2c_pxa_probe(struct device *dev) 939static int i2c_pxa_probe(struct platform_device *dev)
940{ 940{
941 struct pxa_i2c *i2c = &i2c_pxa; 941 struct pxa_i2c *i2c = &i2c_pxa;
942 struct i2c_pxa_platform_data *plat = dev->platform_data; 942 struct i2c_pxa_platform_data *plat = dev->dev.platform_data;
943 int ret; 943 int ret;
944 944
945#ifdef CONFIG_PXA27x 945#ifdef CONFIG_PXA27x
@@ -968,7 +968,7 @@ static int i2c_pxa_probe(struct device *dev)
968 i2c_pxa_reset(i2c); 968 i2c_pxa_reset(i2c);
969 969
970 i2c->adap.algo_data = i2c; 970 i2c->adap.algo_data = i2c;
971 i2c->adap.dev.parent = dev; 971 i2c->adap.dev.parent = &dev->dev;
972 972
973 ret = i2c_add_adapter(&i2c->adap); 973 ret = i2c_add_adapter(&i2c->adap);
974 if (ret < 0) { 974 if (ret < 0) {
@@ -976,7 +976,7 @@ static int i2c_pxa_probe(struct device *dev)
976 goto err_irq; 976 goto err_irq;
977 } 977 }
978 978
979 dev_set_drvdata(dev, i2c); 979 platform_set_drvdata(dev, i2c);
980 980
981#ifdef CONFIG_I2C_PXA_SLAVE 981#ifdef CONFIG_I2C_PXA_SLAVE
982 printk(KERN_INFO "I2C: %s: PXA I2C adapter, slave address %d\n", 982 printk(KERN_INFO "I2C: %s: PXA I2C adapter, slave address %d\n",
@@ -993,11 +993,11 @@ static int i2c_pxa_probe(struct device *dev)
993 return ret; 993 return ret;
994} 994}
995 995
996static int i2c_pxa_remove(struct device *dev) 996static int i2c_pxa_remove(struct platform_device *dev)
997{ 997{
998 struct pxa_i2c *i2c = dev_get_drvdata(dev); 998 struct pxa_i2c *i2c = platform_get_drvdata(dev);
999 999
1000 dev_set_drvdata(dev, NULL); 1000 platform_set_drvdata(dev, NULL);
1001 1001
1002 i2c_del_adapter(&i2c->adap); 1002 i2c_del_adapter(&i2c->adap);
1003 free_irq(IRQ_I2C, i2c); 1003 free_irq(IRQ_I2C, i2c);
@@ -1006,21 +1006,22 @@ static int i2c_pxa_remove(struct device *dev)
1006 return 0; 1006 return 0;
1007} 1007}
1008 1008
1009static struct device_driver i2c_pxa_driver = { 1009static struct platform_driver i2c_pxa_driver = {
1010 .name = "pxa2xx-i2c",
1011 .bus = &platform_bus_type,
1012 .probe = i2c_pxa_probe, 1010 .probe = i2c_pxa_probe,
1013 .remove = i2c_pxa_remove, 1011 .remove = i2c_pxa_remove,
1012 .driver = {
1013 .name = "pxa2xx-i2c",
1014 },
1014}; 1015};
1015 1016
1016static int __init i2c_adap_pxa_init(void) 1017static int __init i2c_adap_pxa_init(void)
1017{ 1018{
1018 return driver_register(&i2c_pxa_driver); 1019 return platform_driver_register(&i2c_pxa_driver);
1019} 1020}
1020 1021
1021static void i2c_adap_pxa_exit(void) 1022static void i2c_adap_pxa_exit(void)
1022{ 1023{
1023 return driver_unregister(&i2c_pxa_driver); 1024 return platform_driver_unregister(&i2c_pxa_driver);
1024} 1025}
1025 1026
1026module_init(i2c_adap_pxa_init); 1027module_init(i2c_adap_pxa_init);
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 1b582262e677..58cfd3111ef6 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -760,24 +760,23 @@ static void s3c24xx_i2c_free(struct s3c24xx_i2c *i2c)
760 * called by the bus driver when a suitable device is found 760 * called by the bus driver when a suitable device is found
761*/ 761*/
762 762
763static int s3c24xx_i2c_probe(struct device *dev) 763static int s3c24xx_i2c_probe(struct platform_device *pdev)
764{ 764{
765 struct platform_device *pdev = to_platform_device(dev);
766 struct s3c24xx_i2c *i2c = &s3c24xx_i2c; 765 struct s3c24xx_i2c *i2c = &s3c24xx_i2c;
767 struct resource *res; 766 struct resource *res;
768 int ret; 767 int ret;
769 768
770 /* find the clock and enable it */ 769 /* find the clock and enable it */
771 770
772 i2c->dev = dev; 771 i2c->dev = &pdev->dev;
773 i2c->clk = clk_get(dev, "i2c"); 772 i2c->clk = clk_get(&pdev->dev, "i2c");
774 if (IS_ERR(i2c->clk)) { 773 if (IS_ERR(i2c->clk)) {
775 dev_err(dev, "cannot get clock\n"); 774 dev_err(&pdev->dev, "cannot get clock\n");
776 ret = -ENOENT; 775 ret = -ENOENT;
777 goto out; 776 goto out;
778 } 777 }
779 778
780 dev_dbg(dev, "clock source %p\n", i2c->clk); 779 dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk);
781 780
782 clk_use(i2c->clk); 781 clk_use(i2c->clk);
783 clk_enable(i2c->clk); 782 clk_enable(i2c->clk);
@@ -786,7 +785,7 @@ static int s3c24xx_i2c_probe(struct device *dev)
786 785
787 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 786 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
788 if (res == NULL) { 787 if (res == NULL) {
789 dev_err(dev, "cannot find IO resource\n"); 788 dev_err(&pdev->dev, "cannot find IO resource\n");
790 ret = -ENOENT; 789 ret = -ENOENT;
791 goto out; 790 goto out;
792 } 791 }
@@ -795,7 +794,7 @@ static int s3c24xx_i2c_probe(struct device *dev)
795 pdev->name); 794 pdev->name);
796 795
797 if (i2c->ioarea == NULL) { 796 if (i2c->ioarea == NULL) {
798 dev_err(dev, "cannot request IO\n"); 797 dev_err(&pdev->dev, "cannot request IO\n");
799 ret = -ENXIO; 798 ret = -ENXIO;
800 goto out; 799 goto out;
801 } 800 }
@@ -803,17 +802,17 @@ static int s3c24xx_i2c_probe(struct device *dev)
803 i2c->regs = ioremap(res->start, (res->end-res->start)+1); 802 i2c->regs = ioremap(res->start, (res->end-res->start)+1);
804 803
805 if (i2c->regs == NULL) { 804 if (i2c->regs == NULL) {
806 dev_err(dev, "cannot map IO\n"); 805 dev_err(&pdev->dev, "cannot map IO\n");
807 ret = -ENXIO; 806 ret = -ENXIO;
808 goto out; 807 goto out;
809 } 808 }
810 809
811 dev_dbg(dev, "registers %p (%p, %p)\n", i2c->regs, i2c->ioarea, res); 810 dev_dbg(&pdev->dev, "registers %p (%p, %p)\n", i2c->regs, i2c->ioarea, res);
812 811
813 /* setup info block for the i2c core */ 812 /* setup info block for the i2c core */
814 813
815 i2c->adap.algo_data = i2c; 814 i2c->adap.algo_data = i2c;
816 i2c->adap.dev.parent = dev; 815 i2c->adap.dev.parent = &pdev->dev;
817 816
818 /* initialise the i2c controller */ 817 /* initialise the i2c controller */
819 818
@@ -827,7 +826,7 @@ static int s3c24xx_i2c_probe(struct device *dev)
827 826
828 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 827 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
829 if (res == NULL) { 828 if (res == NULL) {
830 dev_err(dev, "cannot find IRQ\n"); 829 dev_err(&pdev->dev, "cannot find IRQ\n");
831 ret = -ENOENT; 830 ret = -ENOENT;
832 goto out; 831 goto out;
833 } 832 }
@@ -836,23 +835,23 @@ static int s3c24xx_i2c_probe(struct device *dev)
836 pdev->name, i2c); 835 pdev->name, i2c);
837 836
838 if (ret != 0) { 837 if (ret != 0) {
839 dev_err(dev, "cannot claim IRQ\n"); 838 dev_err(&pdev->dev, "cannot claim IRQ\n");
840 goto out; 839 goto out;
841 } 840 }
842 841
843 i2c->irq = res; 842 i2c->irq = res;
844 843
845 dev_dbg(dev, "irq resource %p (%ld)\n", res, res->start); 844 dev_dbg(&pdev->dev, "irq resource %p (%ld)\n", res, res->start);
846 845
847 ret = i2c_add_adapter(&i2c->adap); 846 ret = i2c_add_adapter(&i2c->adap);
848 if (ret < 0) { 847 if (ret < 0) {
849 dev_err(dev, "failed to add bus to i2c core\n"); 848 dev_err(&pdev->dev, "failed to add bus to i2c core\n");
850 goto out; 849 goto out;
851 } 850 }
852 851
853 dev_set_drvdata(dev, i2c); 852 platform_set_drvdata(pdev, i2c);
854 853
855 dev_info(dev, "%s: S3C I2C adapter\n", i2c->adap.dev.bus_id); 854 dev_info(&pdev->dev, "%s: S3C I2C adapter\n", i2c->adap.dev.bus_id);
856 855
857 out: 856 out:
858 if (ret < 0) 857 if (ret < 0)
@@ -866,22 +865,22 @@ static int s3c24xx_i2c_probe(struct device *dev)
866 * called when device is removed from the bus 865 * called when device is removed from the bus
867*/ 866*/
868 867
869static int s3c24xx_i2c_remove(struct device *dev) 868static int s3c24xx_i2c_remove(struct platform_device *pdev)
870{ 869{
871 struct s3c24xx_i2c *i2c = dev_get_drvdata(dev); 870 struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
872 871
873 if (i2c != NULL) { 872 if (i2c != NULL) {
874 s3c24xx_i2c_free(i2c); 873 s3c24xx_i2c_free(i2c);
875 dev_set_drvdata(dev, NULL); 874 platform_set_drvdata(pdev, NULL);
876 } 875 }
877 876
878 return 0; 877 return 0;
879} 878}
880 879
881#ifdef CONFIG_PM 880#ifdef CONFIG_PM
882static int s3c24xx_i2c_resume(struct device *dev) 881static int s3c24xx_i2c_resume(struct platform_device *dev)
883{ 882{
884 struct s3c24xx_i2c *i2c = dev_get_drvdata(dev); 883 struct s3c24xx_i2c *i2c = platform_get_drvdata(dev);
885 884
886 if (i2c != NULL) 885 if (i2c != NULL)
887 s3c24xx_i2c_init(i2c); 886 s3c24xx_i2c_init(i2c);
@@ -895,33 +894,35 @@ static int s3c24xx_i2c_resume(struct device *dev)
895 894
896/* device driver for platform bus bits */ 895/* device driver for platform bus bits */
897 896
898static struct device_driver s3c2410_i2c_driver = { 897static struct platform_driver s3c2410_i2c_driver = {
899 .owner = THIS_MODULE,
900 .name = "s3c2410-i2c",
901 .bus = &platform_bus_type,
902 .probe = s3c24xx_i2c_probe, 898 .probe = s3c24xx_i2c_probe,
903 .remove = s3c24xx_i2c_remove, 899 .remove = s3c24xx_i2c_remove,
904 .resume = s3c24xx_i2c_resume, 900 .resume = s3c24xx_i2c_resume,
901 .driver = {
902 .owner = THIS_MODULE,
903 .name = "s3c2410-i2c",
904 },
905}; 905};
906 906
907static struct device_driver s3c2440_i2c_driver = { 907static struct platform_driver s3c2440_i2c_driver = {
908 .owner = THIS_MODULE,
909 .name = "s3c2440-i2c",
910 .bus = &platform_bus_type,
911 .probe = s3c24xx_i2c_probe, 908 .probe = s3c24xx_i2c_probe,
912 .remove = s3c24xx_i2c_remove, 909 .remove = s3c24xx_i2c_remove,
913 .resume = s3c24xx_i2c_resume, 910 .resume = s3c24xx_i2c_resume,
911 .driver = {
912 .owner = THIS_MODULE,
913 .name = "s3c2440-i2c",
914 },
914}; 915};
915 916
916static int __init i2c_adap_s3c_init(void) 917static int __init i2c_adap_s3c_init(void)
917{ 918{
918 int ret; 919 int ret;
919 920
920 ret = driver_register(&s3c2410_i2c_driver); 921 ret = platform_driver_register(&s3c2410_i2c_driver);
921 if (ret == 0) { 922 if (ret == 0) {
922 ret = driver_register(&s3c2440_i2c_driver); 923 ret = platform_driver_register(&s3c2440_i2c_driver);
923 if (ret) 924 if (ret)
924 driver_unregister(&s3c2410_i2c_driver); 925 platform_driver_unregister(&s3c2410_i2c_driver);
925 } 926 }
926 927
927 return ret; 928 return ret;
@@ -929,8 +930,8 @@ static int __init i2c_adap_s3c_init(void)
929 930
930static void __exit i2c_adap_s3c_exit(void) 931static void __exit i2c_adap_s3c_exit(void)
931{ 932{
932 driver_unregister(&s3c2410_i2c_driver); 933 platform_driver_unregister(&s3c2410_i2c_driver);
933 driver_unregister(&s3c2440_i2c_driver); 934 platform_driver_unregister(&s3c2440_i2c_driver);
934} 935}
935 936
936module_init(i2c_adap_s3c_init); 937module_init(i2c_adap_s3c_init);
diff --git a/drivers/i2c/chips/isp1301_omap.c b/drivers/i2c/chips/isp1301_omap.c
index 9dbb72fffbe2..d2a100d77839 100644
--- a/drivers/i2c/chips/isp1301_omap.c
+++ b/drivers/i2c/chips/isp1301_omap.c
@@ -873,26 +873,27 @@ static int otg_init(struct isp1301 *isp)
873 return 0; 873 return 0;
874} 874}
875 875
876static int otg_probe(struct device *dev) 876static int otg_probe(struct platform_device *dev)
877{ 877{
878 // struct omap_usb_config *config = dev->platform_data; 878 // struct omap_usb_config *config = dev->platform_data;
879 879
880 otg_dev = to_platform_device(dev); 880 otg_dev = dev;
881 return 0; 881 return 0;
882} 882}
883 883
884static int otg_remove(struct device *dev) 884static int otg_remove(struct platform_device *dev)
885{ 885{
886 otg_dev = 0; 886 otg_dev = 0;
887 return 0; 887 return 0;
888} 888}
889 889
890struct device_driver omap_otg_driver = { 890struct platform_driver omap_otg_driver = {
891 .owner = THIS_MODULE,
892 .name = "omap_otg",
893 .bus = &platform_bus_type,
894 .probe = otg_probe, 891 .probe = otg_probe,
895 .remove = otg_remove, 892 .remove = otg_remove,
893 .driver = {
894 .owner = THIS_MODULE,
895 .name = "omap_otg",
896 },
896}; 897};
897 898
898static int otg_bind(struct isp1301 *isp) 899static int otg_bind(struct isp1301 *isp)
@@ -902,7 +903,7 @@ static int otg_bind(struct isp1301 *isp)
902 if (otg_dev) 903 if (otg_dev)
903 return -EBUSY; 904 return -EBUSY;
904 905
905 status = driver_register(&omap_otg_driver); 906 status = platform_driver_register(&omap_otg_driver);
906 if (status < 0) 907 if (status < 0)
907 return status; 908 return status;
908 909
@@ -913,7 +914,7 @@ static int otg_bind(struct isp1301 *isp)
913 status = -ENODEV; 914 status = -ENODEV;
914 915
915 if (status < 0) 916 if (status < 0)
916 driver_unregister(&omap_otg_driver); 917 platform_driver_unregister(&omap_otg_driver);
917 return status; 918 return status;
918} 919}
919 920
diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c
index d00d14bb637a..64672d491222 100644
--- a/drivers/input/keyboard/corgikbd.c
+++ b/drivers/input/keyboard/corgikbd.c
@@ -259,17 +259,17 @@ static void corgikbd_hinge_timer(unsigned long data)
259} 259}
260 260
261#ifdef CONFIG_PM 261#ifdef CONFIG_PM
262static int corgikbd_suspend(struct device *dev, pm_message_t state) 262static int corgikbd_suspend(struct platform_device *dev, pm_message_t state)
263{ 263{
264 struct corgikbd *corgikbd = dev_get_drvdata(dev); 264 struct corgikbd *corgikbd = platform_get_drvdata(dev);
265 corgikbd->suspended = 1; 265 corgikbd->suspended = 1;
266 266
267 return 0; 267 return 0;
268} 268}
269 269
270static int corgikbd_resume(struct device *dev) 270static int corgikbd_resume(struct platform_device *dev)
271{ 271{
272 struct corgikbd *corgikbd = dev_get_drvdata(dev); 272 struct corgikbd *corgikbd = platform_get_drvdata(dev);
273 273
274 /* Upon resume, ignore the suspend key for a short while */ 274 /* Upon resume, ignore the suspend key for a short while */
275 corgikbd->suspend_jiffies=jiffies; 275 corgikbd->suspend_jiffies=jiffies;
@@ -282,7 +282,7 @@ static int corgikbd_resume(struct device *dev)
282#define corgikbd_resume NULL 282#define corgikbd_resume NULL
283#endif 283#endif
284 284
285static int __init corgikbd_probe(struct device *dev) 285static int __init corgikbd_probe(struct platform_device *pdev)
286{ 286{
287 struct corgikbd *corgikbd; 287 struct corgikbd *corgikbd;
288 struct input_dev *input_dev; 288 struct input_dev *input_dev;
@@ -296,7 +296,7 @@ static int __init corgikbd_probe(struct device *dev)
296 return -ENOMEM; 296 return -ENOMEM;
297 } 297 }
298 298
299 dev_set_drvdata(dev, corgikbd); 299 platform_set_drvdata(pdev, corgikbd);
300 300
301 corgikbd->input = input_dev; 301 corgikbd->input = input_dev;
302 spin_lock_init(&corgikbd->lock); 302 spin_lock_init(&corgikbd->lock);
@@ -321,7 +321,7 @@ static int __init corgikbd_probe(struct device *dev)
321 input_dev->id.vendor = 0x0001; 321 input_dev->id.vendor = 0x0001;
322 input_dev->id.product = 0x0001; 322 input_dev->id.product = 0x0001;
323 input_dev->id.version = 0x0100; 323 input_dev->id.version = 0x0100;
324 input_dev->cdev.dev = dev; 324 input_dev->cdev.dev = &pdev->dev;
325 input_dev->private = corgikbd; 325 input_dev->private = corgikbd;
326 326
327 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW); 327 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW);
@@ -356,10 +356,10 @@ static int __init corgikbd_probe(struct device *dev)
356 return 0; 356 return 0;
357} 357}
358 358
359static int corgikbd_remove(struct device *dev) 359static int corgikbd_remove(struct platform_device *pdev)
360{ 360{
361 int i; 361 int i;
362 struct corgikbd *corgikbd = dev_get_drvdata(dev); 362 struct corgikbd *corgikbd = platform_get_drvdata(pdev);
363 363
364 for (i = 0; i < CORGI_KEY_SENSE_NUM; i++) 364 for (i = 0; i < CORGI_KEY_SENSE_NUM; i++)
365 free_irq(CORGI_IRQ_GPIO_KEY_SENSE(i), corgikbd); 365 free_irq(CORGI_IRQ_GPIO_KEY_SENSE(i), corgikbd);
@@ -374,23 +374,24 @@ static int corgikbd_remove(struct device *dev)
374 return 0; 374 return 0;
375} 375}
376 376
377static struct device_driver corgikbd_driver = { 377static struct platform_driver corgikbd_driver = {
378 .name = "corgi-keyboard",
379 .bus = &platform_bus_type,
380 .probe = corgikbd_probe, 378 .probe = corgikbd_probe,
381 .remove = corgikbd_remove, 379 .remove = corgikbd_remove,
382 .suspend = corgikbd_suspend, 380 .suspend = corgikbd_suspend,
383 .resume = corgikbd_resume, 381 .resume = corgikbd_resume,
382 .driver = {
383 .name = "corgi-keyboard",
384 },
384}; 385};
385 386
386static int __devinit corgikbd_init(void) 387static int __devinit corgikbd_init(void)
387{ 388{
388 return driver_register(&corgikbd_driver); 389 return platform_driver_register(&corgikbd_driver);
389} 390}
390 391
391static void __exit corgikbd_exit(void) 392static void __exit corgikbd_exit(void)
392{ 393{
393 driver_unregister(&corgikbd_driver); 394 platform_driver_unregister(&corgikbd_driver);
394} 395}
395 396
396module_init(corgikbd_init); 397module_init(corgikbd_init);
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c
index 0fa38a559cdf..6a15fe3bc527 100644
--- a/drivers/input/keyboard/spitzkbd.c
+++ b/drivers/input/keyboard/spitzkbd.c
@@ -309,10 +309,10 @@ static void spitzkbd_hinge_timer(unsigned long data)
309} 309}
310 310
311#ifdef CONFIG_PM 311#ifdef CONFIG_PM
312static int spitzkbd_suspend(struct device *dev, pm_message_t state) 312static int spitzkbd_suspend(struct platform_device *dev, pm_message_t state)
313{ 313{
314 int i; 314 int i;
315 struct spitzkbd *spitzkbd = dev_get_drvdata(dev); 315 struct spitzkbd *spitzkbd = platform_get_drvdata(dev);
316 spitzkbd->suspended = 1; 316 spitzkbd->suspended = 1;
317 317
318 /* Set Strobe lines as inputs - *except* strobe line 0 leave this 318 /* Set Strobe lines as inputs - *except* strobe line 0 leave this
@@ -323,10 +323,10 @@ static int spitzkbd_suspend(struct device *dev, pm_message_t state)
323 return 0; 323 return 0;
324} 324}
325 325
326static int spitzkbd_resume(struct device *dev) 326static int spitzkbd_resume(struct platform_device *dev)
327{ 327{
328 int i; 328 int i;
329 struct spitzkbd *spitzkbd = dev_get_drvdata(dev); 329 struct spitzkbd *spitzkbd = platform_get_drvdata(dev);
330 330
331 for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++) 331 for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++)
332 pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH); 332 pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH);
@@ -342,7 +342,7 @@ static int spitzkbd_resume(struct device *dev)
342#define spitzkbd_resume NULL 342#define spitzkbd_resume NULL
343#endif 343#endif
344 344
345static int __init spitzkbd_probe(struct device *dev) 345static int __init spitzkbd_probe(struct platform_device *dev)
346{ 346{
347 struct spitzkbd *spitzkbd; 347 struct spitzkbd *spitzkbd;
348 struct input_dev *input_dev; 348 struct input_dev *input_dev;
@@ -358,7 +358,7 @@ static int __init spitzkbd_probe(struct device *dev)
358 return -ENOMEM; 358 return -ENOMEM;
359 } 359 }
360 360
361 dev_set_drvdata(dev, spitzkbd); 361 platform_set_drvdata(dev, spitzkbd);
362 strcpy(spitzkbd->phys, "spitzkbd/input0"); 362 strcpy(spitzkbd->phys, "spitzkbd/input0");
363 363
364 spin_lock_init(&spitzkbd->lock); 364 spin_lock_init(&spitzkbd->lock);
@@ -380,7 +380,7 @@ static int __init spitzkbd_probe(struct device *dev)
380 input_dev->private = spitzkbd; 380 input_dev->private = spitzkbd;
381 input_dev->name = "Spitz Keyboard"; 381 input_dev->name = "Spitz Keyboard";
382 input_dev->phys = spitzkbd->phys; 382 input_dev->phys = spitzkbd->phys;
383 input_dev->cdev.dev = dev; 383 input_dev->cdev.dev = &dev->dev;
384 384
385 input_dev->id.bustype = BUS_HOST; 385 input_dev->id.bustype = BUS_HOST;
386 input_dev->id.vendor = 0x0001; 386 input_dev->id.vendor = 0x0001;
@@ -437,10 +437,10 @@ static int __init spitzkbd_probe(struct device *dev)
437 return 0; 437 return 0;
438} 438}
439 439
440static int spitzkbd_remove(struct device *dev) 440static int spitzkbd_remove(struct platform_device *dev)
441{ 441{
442 int i; 442 int i;
443 struct spitzkbd *spitzkbd = dev_get_drvdata(dev); 443 struct spitzkbd *spitzkbd = platform_get_drvdata(dev);
444 444
445 for (i = 0; i < SPITZ_KEY_SENSE_NUM; i++) 445 for (i = 0; i < SPITZ_KEY_SENSE_NUM; i++)
446 free_irq(IRQ_GPIO(spitz_senses[i]), spitzkbd); 446 free_irq(IRQ_GPIO(spitz_senses[i]), spitzkbd);
@@ -460,23 +460,24 @@ static int spitzkbd_remove(struct device *dev)
460 return 0; 460 return 0;
461} 461}
462 462
463static struct device_driver spitzkbd_driver = { 463static struct platform_driver spitzkbd_driver = {
464 .name = "spitz-keyboard",
465 .bus = &platform_bus_type,
466 .probe = spitzkbd_probe, 464 .probe = spitzkbd_probe,
467 .remove = spitzkbd_remove, 465 .remove = spitzkbd_remove,
468 .suspend = spitzkbd_suspend, 466 .suspend = spitzkbd_suspend,
469 .resume = spitzkbd_resume, 467 .resume = spitzkbd_resume,
468 .driver = {
469 .name = "spitz-keyboard",
470 },
470}; 471};
471 472
472static int __devinit spitzkbd_init(void) 473static int __devinit spitzkbd_init(void)
473{ 474{
474 return driver_register(&spitzkbd_driver); 475 return platform_driver_register(&spitzkbd_driver);
475} 476}
476 477
477static void __exit spitzkbd_exit(void) 478static void __exit spitzkbd_exit(void)
478{ 479{
479 driver_unregister(&spitzkbd_driver); 480 platform_driver_unregister(&spitzkbd_driver);
480} 481}
481 482
482module_init(spitzkbd_init); 483module_init(spitzkbd_init);
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 01e186422021..ac86c1d1d83e 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -912,7 +912,7 @@ static long i8042_panic_blink(long count)
912 * Here we try to restore the original BIOS settings 912 * Here we try to restore the original BIOS settings
913 */ 913 */
914 914
915static int i8042_suspend(struct device *dev, pm_message_t state) 915static int i8042_suspend(struct platform_device *dev, pm_message_t state)
916{ 916{
917 del_timer_sync(&i8042_timer); 917 del_timer_sync(&i8042_timer);
918 i8042_controller_reset(); 918 i8042_controller_reset();
@@ -925,7 +925,7 @@ static int i8042_suspend(struct device *dev, pm_message_t state)
925 * Here we try to reset everything back to a state in which suspended 925 * Here we try to reset everything back to a state in which suspended
926 */ 926 */
927 927
928static int i8042_resume(struct device *dev) 928static int i8042_resume(struct platform_device *dev)
929{ 929{
930 int i; 930 int i;
931 931
@@ -964,17 +964,18 @@ static int i8042_resume(struct device *dev)
964 * because otherwise BIOSes will be confused. 964 * because otherwise BIOSes will be confused.
965 */ 965 */
966 966
967static void i8042_shutdown(struct device *dev) 967static void i8042_shutdown(struct platform_device *dev)
968{ 968{
969 i8042_controller_cleanup(); 969 i8042_controller_cleanup();
970} 970}
971 971
972static struct device_driver i8042_driver = { 972static struct platform_driver i8042_driver = {
973 .name = "i8042",
974 .bus = &platform_bus_type,
975 .suspend = i8042_suspend, 973 .suspend = i8042_suspend,
976 .resume = i8042_resume, 974 .resume = i8042_resume,
977 .shutdown = i8042_shutdown, 975 .shutdown = i8042_shutdown,
976 .driver = {
977 .name = "i8042",
978 },
978}; 979};
979 980
980static int __init i8042_create_kbd_port(void) 981static int __init i8042_create_kbd_port(void)
@@ -1078,7 +1079,7 @@ static int __init i8042_init(void)
1078 goto err_platform_exit; 1079 goto err_platform_exit;
1079 } 1080 }
1080 1081
1081 err = driver_register(&i8042_driver); 1082 err = platform_driver_register(&i8042_driver);
1082 if (err) 1083 if (err)
1083 goto err_controller_cleanup; 1084 goto err_controller_cleanup;
1084 1085
@@ -1126,7 +1127,7 @@ static int __init i8042_init(void)
1126 err_unregister_device: 1127 err_unregister_device:
1127 platform_device_unregister(i8042_platform_device); 1128 platform_device_unregister(i8042_platform_device);
1128 err_unregister_driver: 1129 err_unregister_driver:
1129 driver_unregister(&i8042_driver); 1130 platform_driver_unregister(&i8042_driver);
1130 err_controller_cleanup: 1131 err_controller_cleanup:
1131 i8042_controller_cleanup(); 1132 i8042_controller_cleanup();
1132 err_platform_exit: 1133 err_platform_exit:
@@ -1148,7 +1149,7 @@ static void __exit i8042_exit(void)
1148 del_timer_sync(&i8042_timer); 1149 del_timer_sync(&i8042_timer);
1149 1150
1150 platform_device_unregister(i8042_platform_device); 1151 platform_device_unregister(i8042_platform_device);
1151 driver_unregister(&i8042_driver); 1152 platform_driver_unregister(&i8042_driver);
1152 1153
1153 i8042_platform_exit(); 1154 i8042_platform_exit();
1154 1155
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index 52c49258f8a4..a3bd11589bc3 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -107,7 +107,7 @@ static void rpckbd_close(struct serio *port)
107 * Allocate and initialize serio structure for subsequent registration 107 * Allocate and initialize serio structure for subsequent registration
108 * with serio core. 108 * with serio core.
109 */ 109 */
110static int __devinit rpckbd_probe(struct device *dev) 110static int __devinit rpckbd_probe(struct platform_device *dev)
111{ 111{
112 struct serio *serio; 112 struct serio *serio;
113 113
@@ -120,37 +120,38 @@ static int __devinit rpckbd_probe(struct device *dev)
120 serio->write = rpckbd_write; 120 serio->write = rpckbd_write;
121 serio->open = rpckbd_open; 121 serio->open = rpckbd_open;
122 serio->close = rpckbd_close; 122 serio->close = rpckbd_close;
123 serio->dev.parent = dev; 123 serio->dev.parent = &dev->dev;
124 strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name)); 124 strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name));
125 strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys)); 125 strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys));
126 126
127 dev_set_drvdata(dev, serio); 127 platform_set_drvdata(dev, serio);
128 serio_register_port(serio); 128 serio_register_port(serio);
129 return 0; 129 return 0;
130} 130}
131 131
132static int __devexit rpckbd_remove(struct device *dev) 132static int __devexit rpckbd_remove(struct platform_device *dev)
133{ 133{
134 struct serio *serio = dev_get_drvdata(dev); 134 struct serio *serio = platform_get_drvdata(dev);
135 serio_unregister_port(serio); 135 serio_unregister_port(serio);
136 return 0; 136 return 0;
137} 137}
138 138
139static struct device_driver rpckbd_driver = { 139static struct platform_driver rpckbd_driver = {
140 .name = "kart",
141 .bus = &platform_bus_type,
142 .probe = rpckbd_probe, 140 .probe = rpckbd_probe,
143 .remove = __devexit_p(rpckbd_remove), 141 .remove = __devexit_p(rpckbd_remove),
142 .driver = {
143 .name = "kart",
144 },
144}; 145};
145 146
146static int __init rpckbd_init(void) 147static int __init rpckbd_init(void)
147{ 148{
148 return driver_register(&rpckbd_driver); 149 return platform_driver_register(&rpckbd_driver);
149} 150}
150 151
151static void __exit rpckbd_exit(void) 152static void __exit rpckbd_exit(void)
152{ 153{
153 driver_unregister(&rpckbd_driver); 154 platform_driver_unregister(&rpckbd_driver);
154} 155}
155 156
156module_init(rpckbd_init); 157module_init(rpckbd_init);
diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c
index 15e88eeae8d6..1042987856f7 100644
--- a/drivers/input/touchscreen/corgi_ts.c
+++ b/drivers/input/touchscreen/corgi_ts.c
@@ -231,9 +231,9 @@ static irqreturn_t ts_interrupt(int irq, void *dev_id, struct pt_regs *regs)
231} 231}
232 232
233#ifdef CONFIG_PM 233#ifdef CONFIG_PM
234static int corgits_suspend(struct device *dev, pm_message_t state) 234static int corgits_suspend(struct platform_device *dev, pm_message_t state)
235{ 235{
236 struct corgi_ts *corgi_ts = dev_get_drvdata(dev); 236 struct corgi_ts *corgi_ts = platform_get_drvdata(dev);
237 237
238 if (corgi_ts->pendown) { 238 if (corgi_ts->pendown) {
239 del_timer_sync(&corgi_ts->timer); 239 del_timer_sync(&corgi_ts->timer);
@@ -248,9 +248,9 @@ static int corgits_suspend(struct device *dev, pm_message_t state)
248 return 0; 248 return 0;
249} 249}
250 250
251static int corgits_resume(struct device *dev) 251static int corgits_resume(struct platform_device *dev)
252{ 252{
253 struct corgi_ts *corgi_ts = dev_get_drvdata(dev); 253 struct corgi_ts *corgi_ts = platform_get_drvdata(dev);
254 254
255 corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS); 255 corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS);
256 /* Enable Falling Edge */ 256 /* Enable Falling Edge */
@@ -264,10 +264,9 @@ static int corgits_resume(struct device *dev)
264#define corgits_resume NULL 264#define corgits_resume NULL
265#endif 265#endif
266 266
267static int __init corgits_probe(struct device *dev) 267static int __init corgits_probe(struct platform_device *pdev)
268{ 268{
269 struct corgi_ts *corgi_ts; 269 struct corgi_ts *corgi_ts;
270 struct platform_device *pdev = to_platform_device(dev);
271 struct input_dev *input_dev; 270 struct input_dev *input_dev;
272 int err = -ENOMEM; 271 int err = -ENOMEM;
273 272
@@ -276,9 +275,9 @@ static int __init corgits_probe(struct device *dev)
276 if (!corgi_ts || !input_dev) 275 if (!corgi_ts || !input_dev)
277 goto fail; 276 goto fail;
278 277
279 dev_set_drvdata(dev, corgi_ts); 278 platform_set_drvdata(pdev, corgi_ts);
280 279
281 corgi_ts->machinfo = dev->platform_data; 280 corgi_ts->machinfo = pdev->dev.platform_data;
282 corgi_ts->irq_gpio = platform_get_irq(pdev, 0); 281 corgi_ts->irq_gpio = platform_get_irq(pdev, 0);
283 282
284 if (corgi_ts->irq_gpio < 0) { 283 if (corgi_ts->irq_gpio < 0) {
@@ -298,7 +297,7 @@ static int __init corgits_probe(struct device *dev)
298 input_dev->id.vendor = 0x0001; 297 input_dev->id.vendor = 0x0001;
299 input_dev->id.product = 0x0002; 298 input_dev->id.product = 0x0002;
300 input_dev->id.version = 0x0100; 299 input_dev->id.version = 0x0100;
301 input_dev->cdev.dev = dev; 300 input_dev->cdev.dev = &pdev->dev;
302 input_dev->private = corgi_ts; 301 input_dev->private = corgi_ts;
303 302
304 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); 303 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
@@ -339,9 +338,9 @@ static int __init corgits_probe(struct device *dev)
339 338
340} 339}
341 340
342static int corgits_remove(struct device *dev) 341static int corgits_remove(struct platform_device *pdev)
343{ 342{
344 struct corgi_ts *corgi_ts = dev_get_drvdata(dev); 343 struct corgi_ts *corgi_ts = platform_get_drvdata(pdev);
345 344
346 free_irq(corgi_ts->irq_gpio, NULL); 345 free_irq(corgi_ts->irq_gpio, NULL);
347 del_timer_sync(&corgi_ts->timer); 346 del_timer_sync(&corgi_ts->timer);
@@ -351,23 +350,24 @@ static int corgits_remove(struct device *dev)
351 return 0; 350 return 0;
352} 351}
353 352
354static struct device_driver corgits_driver = { 353static struct platform_driver corgits_driver = {
355 .name = "corgi-ts",
356 .bus = &platform_bus_type,
357 .probe = corgits_probe, 354 .probe = corgits_probe,
358 .remove = corgits_remove, 355 .remove = corgits_remove,
359 .suspend = corgits_suspend, 356 .suspend = corgits_suspend,
360 .resume = corgits_resume, 357 .resume = corgits_resume,
358 .driver = {
359 .name = "corgi-ts",
360 },
361}; 361};
362 362
363static int __devinit corgits_init(void) 363static int __devinit corgits_init(void)
364{ 364{
365 return driver_register(&corgits_driver); 365 return platform_driver_register(&corgits_driver);
366} 366}
367 367
368static void __exit corgits_exit(void) 368static void __exit corgits_exit(void)
369{ 369{
370 driver_unregister(&corgits_driver); 370 platform_driver_unregister(&corgits_driver);
371} 371}
372 372
373module_init(corgits_init); 373module_init(corgits_init);
diff --git a/drivers/media/dvb/b2c2/Kconfig b/drivers/media/dvb/b2c2/Kconfig
index d7417eac2aba..2583a865a58e 100644
--- a/drivers/media/dvb/b2c2/Kconfig
+++ b/drivers/media/dvb/b2c2/Kconfig
@@ -7,6 +7,7 @@ config DVB_B2C2_FLEXCOP
7 select DVB_NXT2002 7 select DVB_NXT2002
8 select DVB_STV0297 8 select DVB_STV0297
9 select DVB_BCM3510 9 select DVB_BCM3510
10 select DVB_LGDT330X
10 help 11 help
11 Support for the digital TV receiver chip made by B2C2 Inc. included in 12 Support for the digital TV receiver chip made by B2C2 Inc. included in
12 Technisats PCI cards and USB boxes. 13 Technisats PCI cards and USB boxes.
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c
index 7daa0ed7331c..1eab7cffceaa 100644
--- a/drivers/mfd/mcp-sa11x0.c
+++ b/drivers/mfd/mcp-sa11x0.c
@@ -138,9 +138,8 @@ static struct mcp_ops mcp_sa11x0 = {
138 .disable = mcp_sa11x0_disable, 138 .disable = mcp_sa11x0_disable,
139}; 139};
140 140
141static int mcp_sa11x0_probe(struct device *dev) 141static int mcp_sa11x0_probe(struct platform_device *pdev)
142{ 142{
143 struct platform_device *pdev = to_platform_device(dev);
144 struct mcp_plat_data *data = pdev->dev.platform_data; 143 struct mcp_plat_data *data = pdev->dev.platform_data;
145 struct mcp *mcp; 144 struct mcp *mcp;
146 int ret; 145 int ret;
@@ -165,7 +164,7 @@ static int mcp_sa11x0_probe(struct device *dev)
165 mcp->dma_telco_rd = DMA_Ser4MCP1Rd; 164 mcp->dma_telco_rd = DMA_Ser4MCP1Rd;
166 mcp->dma_telco_wr = DMA_Ser4MCP1Wr; 165 mcp->dma_telco_wr = DMA_Ser4MCP1Wr;
167 166
168 dev_set_drvdata(dev, mcp); 167 platform_set_drvdata(pdev, mcp);
169 168
170 if (machine_is_assabet()) { 169 if (machine_is_assabet()) {
171 ASSABET_BCR_set(ASSABET_BCR_CODEC_RST); 170 ASSABET_BCR_set(ASSABET_BCR_CODEC_RST);
@@ -202,26 +201,26 @@ static int mcp_sa11x0_probe(struct device *dev)
202 201
203 release: 202 release:
204 release_mem_region(0x80060000, 0x60); 203 release_mem_region(0x80060000, 0x60);
205 dev_set_drvdata(dev, NULL); 204 platform_set_drvdata(pdev, NULL);
206 205
207 out: 206 out:
208 return ret; 207 return ret;
209} 208}
210 209
211static int mcp_sa11x0_remove(struct device *dev) 210static int mcp_sa11x0_remove(struct platform_device *dev)
212{ 211{
213 struct mcp *mcp = dev_get_drvdata(dev); 212 struct mcp *mcp = platform_get_drvdata(dev);
214 213
215 dev_set_drvdata(dev, NULL); 214 platform_set_drvdata(dev, NULL);
216 mcp_host_unregister(mcp); 215 mcp_host_unregister(mcp);
217 release_mem_region(0x80060000, 0x60); 216 release_mem_region(0x80060000, 0x60);
218 217
219 return 0; 218 return 0;
220} 219}
221 220
222static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state) 221static int mcp_sa11x0_suspend(struct platform_device *dev, pm_message_t state)
223{ 222{
224 struct mcp *mcp = dev_get_drvdata(dev); 223 struct mcp *mcp = platform_get_drvdata(dev);
225 224
226 priv(mcp)->mccr0 = Ser4MCCR0; 225 priv(mcp)->mccr0 = Ser4MCCR0;
227 priv(mcp)->mccr1 = Ser4MCCR1; 226 priv(mcp)->mccr1 = Ser4MCCR1;
@@ -230,9 +229,9 @@ static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state)
230 return 0; 229 return 0;
231} 230}
232 231
233static int mcp_sa11x0_resume(struct device *dev) 232static int mcp_sa11x0_resume(struct platform_device *dev)
234{ 233{
235 struct mcp *mcp = dev_get_drvdata(dev); 234 struct mcp *mcp = platform_get_drvdata(dev);
236 235
237 Ser4MCCR1 = priv(mcp)->mccr1; 236 Ser4MCCR1 = priv(mcp)->mccr1;
238 Ser4MCCR0 = priv(mcp)->mccr0; 237 Ser4MCCR0 = priv(mcp)->mccr0;
@@ -243,13 +242,14 @@ static int mcp_sa11x0_resume(struct device *dev)
243/* 242/*
244 * The driver for the SA11x0 MCP port. 243 * The driver for the SA11x0 MCP port.
245 */ 244 */
246static struct device_driver mcp_sa11x0_driver = { 245static struct platform_driver mcp_sa11x0_driver = {
247 .name = "sa11x0-mcp",
248 .bus = &platform_bus_type,
249 .probe = mcp_sa11x0_probe, 246 .probe = mcp_sa11x0_probe,
250 .remove = mcp_sa11x0_remove, 247 .remove = mcp_sa11x0_remove,
251 .suspend = mcp_sa11x0_suspend, 248 .suspend = mcp_sa11x0_suspend,
252 .resume = mcp_sa11x0_resume, 249 .resume = mcp_sa11x0_resume,
250 .driver = {
251 .name = "sa11x0-mcp",
252 },
253}; 253};
254 254
255/* 255/*
@@ -257,12 +257,12 @@ static struct device_driver mcp_sa11x0_driver = {
257 */ 257 */
258static int __init mcp_sa11x0_init(void) 258static int __init mcp_sa11x0_init(void)
259{ 259{
260 return driver_register(&mcp_sa11x0_driver); 260 return platform_driver_register(&mcp_sa11x0_driver);
261} 261}
262 262
263static void __exit mcp_sa11x0_exit(void) 263static void __exit mcp_sa11x0_exit(void)
264{ 264{
265 driver_unregister(&mcp_sa11x0_driver); 265 platform_driver_unregister(&mcp_sa11x0_driver);
266} 266}
267 267
268module_init(mcp_sa11x0_init); 268module_init(mcp_sa11x0_init);
diff --git a/drivers/misc/hdpuftrs/hdpu_cpustate.c b/drivers/misc/hdpuftrs/hdpu_cpustate.c
index bc2b72b32905..11a801be71c8 100644
--- a/drivers/misc/hdpuftrs/hdpu_cpustate.c
+++ b/drivers/misc/hdpuftrs/hdpu_cpustate.c
@@ -26,8 +26,8 @@
26 26
27#define SKY_CPUSTATE_VERSION "1.1" 27#define SKY_CPUSTATE_VERSION "1.1"
28 28
29static int hdpu_cpustate_probe(struct device *ddev); 29static int hdpu_cpustate_probe(struct platform_device *pdev);
30static int hdpu_cpustate_remove(struct device *ddev); 30static int hdpu_cpustate_remove(struct platform_device *pdev);
31 31
32struct cpustate_t cpustate; 32struct cpustate_t cpustate;
33 33
@@ -158,11 +158,12 @@ static int cpustate_read_proc(char *page, char **start, off_t off,
158 return len; 158 return len;
159} 159}
160 160
161static struct device_driver hdpu_cpustate_driver = { 161static struct platform_driver hdpu_cpustate_driver = {
162 .name = HDPU_CPUSTATE_NAME,
163 .bus = &platform_bus_type,
164 .probe = hdpu_cpustate_probe, 162 .probe = hdpu_cpustate_probe,
165 .remove = hdpu_cpustate_remove, 163 .remove = hdpu_cpustate_remove,
164 .driver = {
165 .name = HDPU_CPUSTATE_NAME,
166 },
166}; 167};
167 168
168/* 169/*
@@ -187,9 +188,8 @@ static struct miscdevice cpustate_dev = {
187 &cpustate_fops 188 &cpustate_fops
188}; 189};
189 190
190static int hdpu_cpustate_probe(struct device *ddev) 191static int hdpu_cpustate_probe(struct platform_device *pdev)
191{ 192{
192 struct platform_device *pdev = to_platform_device(ddev);
193 struct resource *res; 193 struct resource *res;
194 struct proc_dir_entry *proc_de; 194 struct proc_dir_entry *proc_de;
195 int ret; 195 int ret;
@@ -217,7 +217,7 @@ static int hdpu_cpustate_probe(struct device *ddev)
217 return 0; 217 return 0;
218} 218}
219 219
220static int hdpu_cpustate_remove(struct device *ddev) 220static int hdpu_cpustate_remove(struct platform_device *pdev)
221{ 221{
222 222
223 cpustate.set_addr = NULL; 223 cpustate.set_addr = NULL;
@@ -232,13 +232,13 @@ static int hdpu_cpustate_remove(struct device *ddev)
232static int __init cpustate_init(void) 232static int __init cpustate_init(void)
233{ 233{
234 int rc; 234 int rc;
235 rc = driver_register(&hdpu_cpustate_driver); 235 rc = platform_driver_register(&hdpu_cpustate_driver);
236 return rc; 236 return rc;
237} 237}
238 238
239static void __exit cpustate_exit(void) 239static void __exit cpustate_exit(void)
240{ 240{
241 driver_unregister(&hdpu_cpustate_driver); 241 platform_driver_unregister(&hdpu_cpustate_driver);
242} 242}
243 243
244module_init(cpustate_init); 244module_init(cpustate_init);
diff --git a/drivers/misc/hdpuftrs/hdpu_nexus.c b/drivers/misc/hdpuftrs/hdpu_nexus.c
index 4bb461793851..ea9d5f233c83 100644
--- a/drivers/misc/hdpuftrs/hdpu_nexus.c
+++ b/drivers/misc/hdpuftrs/hdpu_nexus.c
@@ -22,19 +22,20 @@
22 22
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24 24
25static int hdpu_nexus_probe(struct device *ddev); 25static int hdpu_nexus_probe(struct platform_device *pdev);
26static int hdpu_nexus_remove(struct device *ddev); 26static int hdpu_nexus_remove(struct platform_device *pdev);
27 27
28static struct proc_dir_entry *hdpu_slot_id; 28static struct proc_dir_entry *hdpu_slot_id;
29static struct proc_dir_entry *hdpu_chassis_id; 29static struct proc_dir_entry *hdpu_chassis_id;
30static int slot_id = -1; 30static int slot_id = -1;
31static int chassis_id = -1; 31static int chassis_id = -1;
32 32
33static struct device_driver hdpu_nexus_driver = { 33static struct platform_driver hdpu_nexus_driver = {
34 .name = HDPU_NEXUS_NAME,
35 .bus = &platform_bus_type,
36 .probe = hdpu_nexus_probe, 34 .probe = hdpu_nexus_probe,
37 .remove = hdpu_nexus_remove, 35 .remove = hdpu_nexus_remove,
36 .driver = {
37 .name = HDPU_NEXUS_NAME,
38 },
38}; 39};
39 40
40int hdpu_slot_id_read(char *buffer, char **buffer_location, off_t offset, 41int hdpu_slot_id_read(char *buffer, char **buffer_location, off_t offset,
@@ -55,9 +56,8 @@ int hdpu_chassis_id_read(char *buffer, char **buffer_location, off_t offset,
55 return sprintf(buffer, "%d\n", chassis_id); 56 return sprintf(buffer, "%d\n", chassis_id);
56} 57}
57 58
58static int hdpu_nexus_probe(struct device *ddev) 59static int hdpu_nexus_probe(struct platform_device *pdev)
59{ 60{
60 struct platform_device *pdev = to_platform_device(ddev);
61 struct resource *res; 61 struct resource *res;
62 62
63 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 63 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -80,7 +80,7 @@ static int hdpu_nexus_probe(struct device *ddev)
80 return 0; 80 return 0;
81} 81}
82 82
83static int hdpu_nexus_remove(struct device *ddev) 83static int hdpu_nexus_remove(struct platform_device *pdev)
84{ 84{
85 slot_id = -1; 85 slot_id = -1;
86 chassis_id = -1; 86 chassis_id = -1;
@@ -94,13 +94,13 @@ static int hdpu_nexus_remove(struct device *ddev)
94static int __init nexus_init(void) 94static int __init nexus_init(void)
95{ 95{
96 int rc; 96 int rc;
97 rc = driver_register(&hdpu_nexus_driver); 97 rc = platform_driver_register(&hdpu_nexus_driver);
98 return rc; 98 return rc;
99} 99}
100 100
101static void __exit nexus_exit(void) 101static void __exit nexus_exit(void)
102{ 102{
103 driver_unregister(&hdpu_nexus_driver); 103 platform_driver_unregister(&hdpu_nexus_driver);
104} 104}
105 105
106module_init(nexus_init); 106module_init(nexus_init);
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c
index f31e247b2cbe..ee8f8a0420d1 100644
--- a/drivers/mmc/pxamci.c
+++ b/drivers/mmc/pxamci.c
@@ -428,9 +428,8 @@ static irqreturn_t pxamci_detect_irq(int irq, void *devid, struct pt_regs *regs)
428 return IRQ_HANDLED; 428 return IRQ_HANDLED;
429} 429}
430 430
431static int pxamci_probe(struct device *dev) 431static int pxamci_probe(struct platform_device *pdev)
432{ 432{
433 struct platform_device *pdev = to_platform_device(dev);
434 struct mmc_host *mmc; 433 struct mmc_host *mmc;
435 struct pxamci_host *host = NULL; 434 struct pxamci_host *host = NULL;
436 struct resource *r; 435 struct resource *r;
@@ -445,7 +444,7 @@ static int pxamci_probe(struct device *dev)
445 if (!r) 444 if (!r)
446 return -EBUSY; 445 return -EBUSY;
447 446
448 mmc = mmc_alloc_host(sizeof(struct pxamci_host), dev); 447 mmc = mmc_alloc_host(sizeof(struct pxamci_host), &pdev->dev);
449 if (!mmc) { 448 if (!mmc) {
450 ret = -ENOMEM; 449 ret = -ENOMEM;
451 goto out; 450 goto out;
@@ -474,7 +473,7 @@ static int pxamci_probe(struct device *dev)
474 host->pdata->ocr_mask : 473 host->pdata->ocr_mask :
475 MMC_VDD_32_33|MMC_VDD_33_34; 474 MMC_VDD_32_33|MMC_VDD_33_34;
476 475
477 host->sg_cpu = dma_alloc_coherent(dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL); 476 host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL);
478 if (!host->sg_cpu) { 477 if (!host->sg_cpu) {
479 ret = -ENOMEM; 478 ret = -ENOMEM;
480 goto out; 479 goto out;
@@ -511,10 +510,10 @@ static int pxamci_probe(struct device *dev)
511 if (ret) 510 if (ret)
512 goto out; 511 goto out;
513 512
514 dev_set_drvdata(dev, mmc); 513 platform_set_drvdata(pdev, mmc);
515 514
516 if (host->pdata && host->pdata->init) 515 if (host->pdata && host->pdata->init)
517 host->pdata->init(dev, pxamci_detect_irq, mmc); 516 host->pdata->init(&pdev->dev, pxamci_detect_irq, mmc);
518 517
519 mmc_add_host(mmc); 518 mmc_add_host(mmc);
520 519
@@ -527,7 +526,7 @@ static int pxamci_probe(struct device *dev)
527 if (host->base) 526 if (host->base)
528 iounmap(host->base); 527 iounmap(host->base);
529 if (host->sg_cpu) 528 if (host->sg_cpu)
530 dma_free_coherent(dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); 529 dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
531 } 530 }
532 if (mmc) 531 if (mmc)
533 mmc_free_host(mmc); 532 mmc_free_host(mmc);
@@ -535,17 +534,17 @@ static int pxamci_probe(struct device *dev)
535 return ret; 534 return ret;
536} 535}
537 536
538static int pxamci_remove(struct device *dev) 537static int pxamci_remove(struct platform_device *pdev)
539{ 538{
540 struct mmc_host *mmc = dev_get_drvdata(dev); 539 struct mmc_host *mmc = platform_get_drvdata(pdev);
541 540
542 dev_set_drvdata(dev, NULL); 541 platform_set_drvdata(pdev, NULL);
543 542
544 if (mmc) { 543 if (mmc) {
545 struct pxamci_host *host = mmc_priv(mmc); 544 struct pxamci_host *host = mmc_priv(mmc);
546 545
547 if (host->pdata && host->pdata->exit) 546 if (host->pdata && host->pdata->exit)
548 host->pdata->exit(dev, mmc); 547 host->pdata->exit(&pdev->dev, mmc);
549 548
550 mmc_remove_host(mmc); 549 mmc_remove_host(mmc);
551 550
@@ -560,7 +559,7 @@ static int pxamci_remove(struct device *dev)
560 free_irq(host->irq, host); 559 free_irq(host->irq, host);
561 pxa_free_dma(host->dma); 560 pxa_free_dma(host->dma);
562 iounmap(host->base); 561 iounmap(host->base);
563 dma_free_coherent(dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); 562 dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
564 563
565 release_resource(host->res); 564 release_resource(host->res);
566 565
@@ -570,9 +569,9 @@ static int pxamci_remove(struct device *dev)
570} 569}
571 570
572#ifdef CONFIG_PM 571#ifdef CONFIG_PM
573static int pxamci_suspend(struct device *dev, pm_message_t state) 572static int pxamci_suspend(struct platform_device *dev, pm_message_t state)
574{ 573{
575 struct mmc_host *mmc = dev_get_drvdata(dev); 574 struct mmc_host *mmc = platform_get_drvdata(dev);
576 int ret = 0; 575 int ret = 0;
577 576
578 if (mmc) 577 if (mmc)
@@ -581,9 +580,9 @@ static int pxamci_suspend(struct device *dev, pm_message_t state)
581 return ret; 580 return ret;
582} 581}
583 582
584static int pxamci_resume(struct device *dev) 583static int pxamci_resume(struct platform_device *dev)
585{ 584{
586 struct mmc_host *mmc = dev_get_drvdata(dev); 585 struct mmc_host *mmc = platform_get_drvdata(dev);
587 int ret = 0; 586 int ret = 0;
588 587
589 if (mmc) 588 if (mmc)
@@ -596,23 +595,24 @@ static int pxamci_resume(struct device *dev)
596#define pxamci_resume NULL 595#define pxamci_resume NULL
597#endif 596#endif
598 597
599static struct device_driver pxamci_driver = { 598static struct platform_driver pxamci_driver = {
600 .name = DRIVER_NAME,
601 .bus = &platform_bus_type,
602 .probe = pxamci_probe, 599 .probe = pxamci_probe,
603 .remove = pxamci_remove, 600 .remove = pxamci_remove,
604 .suspend = pxamci_suspend, 601 .suspend = pxamci_suspend,
605 .resume = pxamci_resume, 602 .resume = pxamci_resume,
603 .driver = {
604 .name = DRIVER_NAME,
605 },
606}; 606};
607 607
608static int __init pxamci_init(void) 608static int __init pxamci_init(void)
609{ 609{
610 return driver_register(&pxamci_driver); 610 return platform_driver_register(&pxamci_driver);
611} 611}
612 612
613static void __exit pxamci_exit(void) 613static void __exit pxamci_exit(void)
614{ 614{
615 driver_unregister(&pxamci_driver); 615 platform_driver_unregister(&pxamci_driver);
616} 616}
617 617
618module_init(pxamci_init); 618module_init(pxamci_init);
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c
index e954b8354fef..c7eb7c269081 100644
--- a/drivers/mmc/wbsd.c
+++ b/drivers/mmc/wbsd.c
@@ -42,7 +42,7 @@
42#include "wbsd.h" 42#include "wbsd.h"
43 43
44#define DRIVER_NAME "wbsd" 44#define DRIVER_NAME "wbsd"
45#define DRIVER_VERSION "1.4" 45#define DRIVER_VERSION "1.5"
46 46
47#ifdef CONFIG_MMC_DEBUG 47#ifdef CONFIG_MMC_DEBUG
48#define DBG(x...) \ 48#define DBG(x...) \
@@ -1932,14 +1932,14 @@ static void __devexit wbsd_shutdown(struct device* dev, int pnp)
1932 * Non-PnP 1932 * Non-PnP
1933 */ 1933 */
1934 1934
1935static int __devinit wbsd_probe(struct device* dev) 1935static int __devinit wbsd_probe(struct platform_device* dev)
1936{ 1936{
1937 return wbsd_init(dev, io, irq, dma, 0); 1937 return wbsd_init(&dev->dev, io, irq, dma, 0);
1938} 1938}
1939 1939
1940static int __devexit wbsd_remove(struct device* dev) 1940static int __devexit wbsd_remove(struct platform_device* dev)
1941{ 1941{
1942 wbsd_shutdown(dev, 0); 1942 wbsd_shutdown(&dev->dev, 0);
1943 1943
1944 return 0; 1944 return 0;
1945} 1945}
@@ -1983,9 +1983,9 @@ static void __devexit wbsd_pnp_remove(struct pnp_dev * dev)
1983 1983
1984#ifdef CONFIG_PM 1984#ifdef CONFIG_PM
1985 1985
1986static int wbsd_suspend(struct device *dev, pm_message_t state) 1986static int wbsd_suspend(struct platform_device *dev, pm_message_t state)
1987{ 1987{
1988 struct mmc_host *mmc = dev_get_drvdata(dev); 1988 struct mmc_host *mmc = platform_get_drvdata(dev);
1989 struct wbsd_host *host; 1989 struct wbsd_host *host;
1990 int ret; 1990 int ret;
1991 1991
@@ -2005,9 +2005,9 @@ static int wbsd_suspend(struct device *dev, pm_message_t state)
2005 return 0; 2005 return 0;
2006} 2006}
2007 2007
2008static int wbsd_resume(struct device *dev) 2008static int wbsd_resume(struct platform_device *dev)
2009{ 2009{
2010 struct mmc_host *mmc = dev_get_drvdata(dev); 2010 struct mmc_host *mmc = platform_get_drvdata(dev);
2011 struct wbsd_host *host; 2011 struct wbsd_host *host;
2012 2012
2013 if (!mmc) 2013 if (!mmc)
@@ -2038,14 +2038,15 @@ static int wbsd_resume(struct device *dev)
2038 2038
2039static struct platform_device *wbsd_device; 2039static struct platform_device *wbsd_device;
2040 2040
2041static struct device_driver wbsd_driver = { 2041static struct platform_driver wbsd_driver = {
2042 .name = DRIVER_NAME,
2043 .bus = &platform_bus_type,
2044 .probe = wbsd_probe, 2042 .probe = wbsd_probe,
2045 .remove = wbsd_remove, 2043 .remove = __devexit_p(wbsd_remove),
2046 2044
2047 .suspend = wbsd_suspend, 2045 .suspend = wbsd_suspend,
2048 .resume = wbsd_resume, 2046 .resume = wbsd_resume,
2047 .driver = {
2048 .name = DRIVER_NAME,
2049 },
2049}; 2050};
2050 2051
2051#ifdef CONFIG_PNP 2052#ifdef CONFIG_PNP
@@ -2054,7 +2055,7 @@ static struct pnp_driver wbsd_pnp_driver = {
2054 .name = DRIVER_NAME, 2055 .name = DRIVER_NAME,
2055 .id_table = pnp_dev_table, 2056 .id_table = pnp_dev_table,
2056 .probe = wbsd_pnp_probe, 2057 .probe = wbsd_pnp_probe,
2057 .remove = wbsd_pnp_remove, 2058 .remove = __devexit_p(wbsd_pnp_remove),
2058}; 2059};
2059 2060
2060#endif /* CONFIG_PNP */ 2061#endif /* CONFIG_PNP */
@@ -2085,7 +2086,7 @@ static int __init wbsd_drv_init(void)
2085 2086
2086 if (nopnp) 2087 if (nopnp)
2087 { 2088 {
2088 result = driver_register(&wbsd_driver); 2089 result = platform_driver_register(&wbsd_driver);
2089 if (result < 0) 2090 if (result < 0)
2090 return result; 2091 return result;
2091 2092
@@ -2111,7 +2112,7 @@ static void __exit wbsd_drv_exit(void)
2111 { 2112 {
2112 platform_device_unregister(wbsd_device); 2113 platform_device_unregister(wbsd_device);
2113 2114
2114 driver_unregister(&wbsd_driver); 2115 platform_driver_unregister(&wbsd_driver);
2115 } 2116 }
2116 2117
2117 DBG("unloaded\n"); 2118 DBG("unloaded\n");
@@ -2127,6 +2128,7 @@ module_param(irq, uint, 0444);
2127module_param(dma, int, 0444); 2128module_param(dma, int, 0444);
2128 2129
2129MODULE_LICENSE("GPL"); 2130MODULE_LICENSE("GPL");
2131MODULE_AUTHOR("Pierre Ossman <drzeus@drzeus.cx>");
2130MODULE_DESCRIPTION("Winbond W83L51xD SD/MMC card interface driver"); 2132MODULE_DESCRIPTION("Winbond W83L51xD SD/MMC card interface driver");
2131MODULE_VERSION(DRIVER_VERSION); 2133MODULE_VERSION(DRIVER_VERSION);
2132 2134
diff --git a/drivers/mtd/maps/bast-flash.c b/drivers/mtd/maps/bast-flash.c
index b7858eb93534..51f962dd7e31 100644
--- a/drivers/mtd/maps/bast-flash.c
+++ b/drivers/mtd/maps/bast-flash.c
@@ -63,11 +63,6 @@ struct bast_flash_info {
63 63
64static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; 64static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
65 65
66static struct bast_flash_info *to_bast_info(struct device *dev)
67{
68 return (struct bast_flash_info *)dev_get_drvdata(dev);
69}
70
71static void bast_flash_setrw(int to) 66static void bast_flash_setrw(int to)
72{ 67{
73 unsigned int val; 68 unsigned int val;
@@ -87,11 +82,11 @@ static void bast_flash_setrw(int to)
87 local_irq_restore(flags); 82 local_irq_restore(flags);
88} 83}
89 84
90static int bast_flash_remove(struct device *dev) 85static int bast_flash_remove(struct platform_device *pdev)
91{ 86{
92 struct bast_flash_info *info = to_bast_info(dev); 87 struct bast_flash_info *info = platform_get_drvdata(pdev);
93 88
94 dev_set_drvdata(dev, NULL); 89 platform_set_drvdata(pdev, NULL);
95 90
96 if (info == NULL) 91 if (info == NULL)
97 return 0; 92 return 0;
@@ -116,9 +111,8 @@ static int bast_flash_remove(struct device *dev)
116 return 0; 111 return 0;
117} 112}
118 113
119static int bast_flash_probe(struct device *dev) 114static int bast_flash_probe(struct platform_device *pdev)
120{ 115{
121 struct platform_device *pdev = to_platform_device(dev);
122 struct bast_flash_info *info; 116 struct bast_flash_info *info;
123 struct resource *res; 117 struct resource *res;
124 int err = 0; 118 int err = 0;
@@ -131,13 +125,13 @@ static int bast_flash_probe(struct device *dev)
131 } 125 }
132 126
133 memzero(info, sizeof(*info)); 127 memzero(info, sizeof(*info));
134 dev_set_drvdata(dev, info); 128 platform_set_drvdata(pdev, info);
135 129
136 res = pdev->resource; /* assume that the flash has one resource */ 130 res = pdev->resource; /* assume that the flash has one resource */
137 131
138 info->map.phys = res->start; 132 info->map.phys = res->start;
139 info->map.size = res->end - res->start + 1; 133 info->map.size = res->end - res->start + 1;
140 info->map.name = dev->bus_id; 134 info->map.name = pdev->dev.bus_id;
141 info->map.bankwidth = 2; 135 info->map.bankwidth = 2;
142 136
143 if (info->map.size > AREA_MAXSIZE) 137 if (info->map.size > AREA_MAXSIZE)
@@ -199,27 +193,28 @@ static int bast_flash_probe(struct device *dev)
199 /* fall through to exit error */ 193 /* fall through to exit error */
200 194
201 exit_error: 195 exit_error:
202 bast_flash_remove(dev); 196 bast_flash_remove(pdev);
203 return err; 197 return err;
204} 198}
205 199
206static struct device_driver bast_flash_driver = { 200static struct platform_driver bast_flash_driver = {
207 .name = "bast-nor",
208 .owner = THIS_MODULE,
209 .bus = &platform_bus_type,
210 .probe = bast_flash_probe, 201 .probe = bast_flash_probe,
211 .remove = bast_flash_remove, 202 .remove = bast_flash_remove,
203 .driver = {
204 .name = "bast-nor",
205 .owner = THIS_MODULE,
206 },
212}; 207};
213 208
214static int __init bast_flash_init(void) 209static int __init bast_flash_init(void)
215{ 210{
216 printk("BAST NOR-Flash Driver, (c) 2004 Simtec Electronics\n"); 211 printk("BAST NOR-Flash Driver, (c) 2004 Simtec Electronics\n");
217 return driver_register(&bast_flash_driver); 212 return platform_driver_register(&bast_flash_driver);
218} 213}
219 214
220static void __exit bast_flash_exit(void) 215static void __exit bast_flash_exit(void)
221{ 216{
222 driver_unregister(&bast_flash_driver); 217 platform_driver_unregister(&bast_flash_driver);
223} 218}
224 219
225module_init(bast_flash_init); 220module_init(bast_flash_init);
diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c
index fe738fd8d6f8..a3ba52fbd868 100644
--- a/drivers/mtd/maps/integrator-flash.c
+++ b/drivers/mtd/maps/integrator-flash.c
@@ -67,9 +67,8 @@ static void armflash_set_vpp(struct map_info *map, int on)
67 67
68static const char *probes[] = { "cmdlinepart", "RedBoot", "afs", NULL }; 68static const char *probes[] = { "cmdlinepart", "RedBoot", "afs", NULL };
69 69
70static int armflash_probe(struct device *_dev) 70static int armflash_probe(struct platform_device *dev)
71{ 71{
72 struct platform_device *dev = to_platform_device(_dev);
73 struct flash_platform_data *plat = dev->dev.platform_data; 72 struct flash_platform_data *plat = dev->dev.platform_data;
74 struct resource *res = dev->resource; 73 struct resource *res = dev->resource;
75 unsigned int size = res->end - res->start + 1; 74 unsigned int size = res->end - res->start + 1;
@@ -138,7 +137,7 @@ static int armflash_probe(struct device *_dev)
138 } 137 }
139 138
140 if (err == 0) 139 if (err == 0)
141 dev_set_drvdata(&dev->dev, info); 140 platform_set_drvdata(dev, info);
142 141
143 /* 142 /*
144 * If we got an error, free all resources. 143 * If we got an error, free all resources.
@@ -163,12 +162,11 @@ static int armflash_probe(struct device *_dev)
163 return err; 162 return err;
164} 163}
165 164
166static int armflash_remove(struct device *_dev) 165static int armflash_remove(struct platform_device *dev)
167{ 166{
168 struct platform_device *dev = to_platform_device(_dev); 167 struct armflash_info *info = platform_get_drvdata(dev);
169 struct armflash_info *info = dev_get_drvdata(&dev->dev);
170 168
171 dev_set_drvdata(&dev->dev, NULL); 169 platform_set_drvdata(dev, NULL);
172 170
173 if (info) { 171 if (info) {
174 if (info->mtd) { 172 if (info->mtd) {
@@ -190,21 +188,22 @@ static int armflash_remove(struct device *_dev)
190 return 0; 188 return 0;
191} 189}
192 190
193static struct device_driver armflash_driver = { 191static struct platform_driver armflash_driver = {
194 .name = "armflash",
195 .bus = &platform_bus_type,
196 .probe = armflash_probe, 192 .probe = armflash_probe,
197 .remove = armflash_remove, 193 .remove = armflash_remove,
194 .driver = {
195 .name = "armflash",
196 },
198}; 197};
199 198
200static int __init armflash_init(void) 199static int __init armflash_init(void)
201{ 200{
202 return driver_register(&armflash_driver); 201 return platform_driver_register(&armflash_driver);
203} 202}
204 203
205static void __exit armflash_exit(void) 204static void __exit armflash_exit(void)
206{ 205{
207 driver_unregister(&armflash_driver); 206 platform_driver_unregister(&armflash_driver);
208} 207}
209 208
210module_init(armflash_init); 209module_init(armflash_init);
diff --git a/drivers/mtd/maps/ixp2000.c b/drivers/mtd/maps/ixp2000.c
index 641eb2b55e9f..fc7a78e31735 100644
--- a/drivers/mtd/maps/ixp2000.c
+++ b/drivers/mtd/maps/ixp2000.c
@@ -111,13 +111,12 @@ static void ixp2000_flash_copy_to(struct map_info *map, unsigned long to,
111} 111}
112 112
113 113
114static int ixp2000_flash_remove(struct device *_dev) 114static int ixp2000_flash_remove(struct platform_device *dev)
115{ 115{
116 struct platform_device *dev = to_platform_device(_dev);
117 struct flash_platform_data *plat = dev->dev.platform_data; 116 struct flash_platform_data *plat = dev->dev.platform_data;
118 struct ixp2000_flash_info *info = dev_get_drvdata(&dev->dev); 117 struct ixp2000_flash_info *info = platform_get_drvdata(dev);
119 118
120 dev_set_drvdata(&dev->dev, NULL); 119 platform_set_drvdata(dev, NULL);
121 120
122 if(!info) 121 if(!info)
123 return 0; 122 return 0;
@@ -143,10 +142,9 @@ static int ixp2000_flash_remove(struct device *_dev)
143} 142}
144 143
145 144
146static int ixp2000_flash_probe(struct device *_dev) 145static int ixp2000_flash_probe(struct platform_device *dev)
147{ 146{
148 static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; 147 static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
149 struct platform_device *dev = to_platform_device(_dev);
150 struct ixp2000_flash_data *ixp_data = dev->dev.platform_data; 148 struct ixp2000_flash_data *ixp_data = dev->dev.platform_data;
151 struct flash_platform_data *plat; 149 struct flash_platform_data *plat;
152 struct ixp2000_flash_info *info; 150 struct ixp2000_flash_info *info;
@@ -177,7 +175,7 @@ static int ixp2000_flash_probe(struct device *_dev)
177 } 175 }
178 memzero(info, sizeof(struct ixp2000_flash_info)); 176 memzero(info, sizeof(struct ixp2000_flash_info));
179 177
180 dev_set_drvdata(&dev->dev, info); 178 platform_set_drvdata(dev, info);
181 179
182 /* 180 /*
183 * Tell the MTD layer we're not 1:1 mapped so that it does 181 * Tell the MTD layer we're not 1:1 mapped so that it does
@@ -248,25 +246,26 @@ static int ixp2000_flash_probe(struct device *_dev)
248 return 0; 246 return 0;
249 247
250Error: 248Error:
251 ixp2000_flash_remove(_dev); 249 ixp2000_flash_remove(dev);
252 return err; 250 return err;
253} 251}
254 252
255static struct device_driver ixp2000_flash_driver = { 253static struct platform_driver ixp2000_flash_driver = {
256 .name = "IXP2000-Flash",
257 .bus = &platform_bus_type,
258 .probe = &ixp2000_flash_probe, 254 .probe = &ixp2000_flash_probe,
259 .remove = &ixp2000_flash_remove 255 .remove = &ixp2000_flash_remove
256 .driver = {
257 .name = "IXP2000-Flash",
258 },
260}; 259};
261 260
262static int __init ixp2000_flash_init(void) 261static int __init ixp2000_flash_init(void)
263{ 262{
264 return driver_register(&ixp2000_flash_driver); 263 return platform_driver_register(&ixp2000_flash_driver);
265} 264}
266 265
267static void __exit ixp2000_flash_exit(void) 266static void __exit ixp2000_flash_exit(void)
268{ 267{
269 driver_unregister(&ixp2000_flash_driver); 268 platform_driver_unregister(&ixp2000_flash_driver);
270} 269}
271 270
272module_init(ixp2000_flash_init); 271module_init(ixp2000_flash_init);
diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c
index 56b3a355bf7b..a59f8027903c 100644
--- a/drivers/mtd/maps/ixp4xx.c
+++ b/drivers/mtd/maps/ixp4xx.c
@@ -99,13 +99,12 @@ struct ixp4xx_flash_info {
99 99
100static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; 100static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
101 101
102static int ixp4xx_flash_remove(struct device *_dev) 102static int ixp4xx_flash_remove(struct platform_device *dev)
103{ 103{
104 struct platform_device *dev = to_platform_device(_dev);
105 struct flash_platform_data *plat = dev->dev.platform_data; 104 struct flash_platform_data *plat = dev->dev.platform_data;
106 struct ixp4xx_flash_info *info = dev_get_drvdata(&dev->dev); 105 struct ixp4xx_flash_info *info = platform_get_drvdata(dev);
107 106
108 dev_set_drvdata(&dev->dev, NULL); 107 platform_set_drvdata(dev, NULL);
109 108
110 if(!info) 109 if(!info)
111 return 0; 110 return 0;
@@ -130,9 +129,8 @@ static int ixp4xx_flash_remove(struct device *_dev)
130 return 0; 129 return 0;
131} 130}
132 131
133static int ixp4xx_flash_probe(struct device *_dev) 132static int ixp4xx_flash_probe(struct platform_device *dev)
134{ 133{
135 struct platform_device *dev = to_platform_device(_dev);
136 struct flash_platform_data *plat = dev->dev.platform_data; 134 struct flash_platform_data *plat = dev->dev.platform_data;
137 struct ixp4xx_flash_info *info; 135 struct ixp4xx_flash_info *info;
138 int err = -1; 136 int err = -1;
@@ -153,7 +151,7 @@ static int ixp4xx_flash_probe(struct device *_dev)
153 } 151 }
154 memzero(info, sizeof(struct ixp4xx_flash_info)); 152 memzero(info, sizeof(struct ixp4xx_flash_info));
155 153
156 dev_set_drvdata(&dev->dev, info); 154 platform_set_drvdata(dev, info);
157 155
158 /* 156 /*
159 * Tell the MTD layer we're not 1:1 mapped so that it does 157 * Tell the MTD layer we're not 1:1 mapped so that it does
@@ -214,25 +212,26 @@ static int ixp4xx_flash_probe(struct device *_dev)
214 return 0; 212 return 0;
215 213
216Error: 214Error:
217 ixp4xx_flash_remove(_dev); 215 ixp4xx_flash_remove(dev);
218 return err; 216 return err;
219} 217}
220 218
221static struct device_driver ixp4xx_flash_driver = { 219static struct platform_driver ixp4xx_flash_driver = {
222 .name = "IXP4XX-Flash",
223 .bus = &platform_bus_type,
224 .probe = ixp4xx_flash_probe, 220 .probe = ixp4xx_flash_probe,
225 .remove = ixp4xx_flash_remove, 221 .remove = ixp4xx_flash_remove,
222 .driver = {
223 .name = "IXP4XX-Flash",
224 },
226}; 225};
227 226
228static int __init ixp4xx_flash_init(void) 227static int __init ixp4xx_flash_init(void)
229{ 228{
230 return driver_register(&ixp4xx_flash_driver); 229 return platform_driver_register(&ixp4xx_flash_driver);
231} 230}
232 231
233static void __exit ixp4xx_flash_exit(void) 232static void __exit ixp4xx_flash_exit(void)
234{ 233{
235 driver_unregister(&ixp4xx_flash_driver); 234 platform_driver_unregister(&ixp4xx_flash_driver);
236} 235}
237 236
238 237
diff --git a/drivers/mtd/maps/omap_nor.c b/drivers/mtd/maps/omap_nor.c
index fd3b4a5fc207..418afffb2d80 100644
--- a/drivers/mtd/maps/omap_nor.c
+++ b/drivers/mtd/maps/omap_nor.c
@@ -70,11 +70,10 @@ static void omap_set_vpp(struct map_info *map, int enable)
70 } 70 }
71} 71}
72 72
73static int __devinit omapflash_probe(struct device *dev) 73static int __devinit omapflash_probe(struct platform_device *pdev)
74{ 74{
75 int err; 75 int err;
76 struct omapflash_info *info; 76 struct omapflash_info *info;
77 struct platform_device *pdev = to_platform_device(dev);
78 struct flash_platform_data *pdata = pdev->dev.platform_data; 77 struct flash_platform_data *pdata = pdev->dev.platform_data;
79 struct resource *res = pdev->resource; 78 struct resource *res = pdev->resource;
80 unsigned long size = res->end - res->start + 1; 79 unsigned long size = res->end - res->start + 1;
@@ -119,7 +118,7 @@ static int __devinit omapflash_probe(struct device *dev)
119#endif 118#endif
120 add_mtd_device(info->mtd); 119 add_mtd_device(info->mtd);
121 120
122 dev_set_drvdata(&pdev->dev, info); 121 platform_set_drvdata(pdev, info);
123 122
124 return 0; 123 return 0;
125 124
@@ -133,12 +132,11 @@ out_free_info:
133 return err; 132 return err;
134} 133}
135 134
136static int __devexit omapflash_remove(struct device *dev) 135static int __devexit omapflash_remove(struct platform_device *pdev)
137{ 136{
138 struct platform_device *pdev = to_platform_device(dev); 137 struct omapflash_info *info = platform_get_drvdata(pdev);
139 struct omapflash_info *info = dev_get_drvdata(&pdev->dev);
140 138
141 dev_set_drvdata(&pdev->dev, NULL); 139 platform_set_drvdata(pdev, NULL);
142 140
143 if (info) { 141 if (info) {
144 if (info->parts) { 142 if (info->parts) {
@@ -155,21 +153,22 @@ static int __devexit omapflash_remove(struct device *dev)
155 return 0; 153 return 0;
156} 154}
157 155
158static struct device_driver omapflash_driver = { 156static struct platform_driver omapflash_driver = {
159 .name = "omapflash",
160 .bus = &platform_bus_type,
161 .probe = omapflash_probe, 157 .probe = omapflash_probe,
162 .remove = __devexit_p(omapflash_remove), 158 .remove = __devexit_p(omapflash_remove),
159 .driver = {
160 .name = "omapflash",
161 },
163}; 162};
164 163
165static int __init omapflash_init(void) 164static int __init omapflash_init(void)
166{ 165{
167 return driver_register(&omapflash_driver); 166 return platform_driver_register(&omapflash_driver);
168} 167}
169 168
170static void __exit omapflash_exit(void) 169static void __exit omapflash_exit(void)
171{ 170{
172 driver_unregister(&omapflash_driver); 171 platform_driver_unregister(&omapflash_driver);
173} 172}
174 173
175module_init(omapflash_init); 174module_init(omapflash_init);
diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c
index a02eed94a231..5d3c75451ca2 100644
--- a/drivers/mtd/maps/plat-ram.c
+++ b/drivers/mtd/maps/plat-ram.c
@@ -56,9 +56,9 @@ struct platram_info {
56 * device private data to struct platram_info conversion 56 * device private data to struct platram_info conversion
57*/ 57*/
58 58
59static inline struct platram_info *to_platram_info(struct device *dev) 59static inline struct platram_info *to_platram_info(struct platform_device *dev)
60{ 60{
61 return (struct platram_info *)dev_get_drvdata(dev); 61 return (struct platram_info *)platform_get_drvdata(dev);
62} 62}
63 63
64/* platram_setrw 64/* platram_setrw
@@ -83,13 +83,13 @@ static inline void platram_setrw(struct platram_info *info, int to)
83 * called to remove the device from the driver's control 83 * called to remove the device from the driver's control
84*/ 84*/
85 85
86static int platram_remove(struct device *dev) 86static int platram_remove(struct platform_device *pdev)
87{ 87{
88 struct platram_info *info = to_platram_info(dev); 88 struct platram_info *info = to_platram_info(pdev);
89 89
90 dev_set_drvdata(dev, NULL); 90 platform_set_drvdata(pdev, NULL);
91 91
92 dev_dbg(dev, "removing device\n"); 92 dev_dbg(&pdev->dev, "removing device\n");
93 93
94 if (info == NULL) 94 if (info == NULL)
95 return 0; 95 return 0;
@@ -130,61 +130,60 @@ static int platram_remove(struct device *dev)
130 * driver is found. 130 * driver is found.
131*/ 131*/
132 132
133static int platram_probe(struct device *dev) 133static int platram_probe(struct platform_device *pdev)
134{ 134{
135 struct platform_device *pd = to_platform_device(dev);
136 struct platdata_mtd_ram *pdata; 135 struct platdata_mtd_ram *pdata;
137 struct platram_info *info; 136 struct platram_info *info;
138 struct resource *res; 137 struct resource *res;
139 int err = 0; 138 int err = 0;
140 139
141 dev_dbg(dev, "probe entered\n"); 140 dev_dbg(&pdev->dev, "probe entered\n");
142 141
143 if (dev->platform_data == NULL) { 142 if (pdev->dev.platform_data == NULL) {
144 dev_err(dev, "no platform data supplied\n"); 143 dev_err(&pdev->dev, "no platform data supplied\n");
145 err = -ENOENT; 144 err = -ENOENT;
146 goto exit_error; 145 goto exit_error;
147 } 146 }
148 147
149 pdata = dev->platform_data; 148 pdata = pdev->dev.platform_data;
150 149
151 info = kmalloc(sizeof(*info), GFP_KERNEL); 150 info = kmalloc(sizeof(*info), GFP_KERNEL);
152 if (info == NULL) { 151 if (info == NULL) {
153 dev_err(dev, "no memory for flash info\n"); 152 dev_err(&pdev->dev, "no memory for flash info\n");
154 err = -ENOMEM; 153 err = -ENOMEM;
155 goto exit_error; 154 goto exit_error;
156 } 155 }
157 156
158 memset(info, 0, sizeof(*info)); 157 memset(info, 0, sizeof(*info));
159 dev_set_drvdata(dev, info); 158 platform_set_drvdata(pdev, info);
160 159
161 info->dev = dev; 160 info->dev = &pdev->dev;
162 info->pdata = pdata; 161 info->pdata = pdata;
163 162
164 /* get the resource for the memory mapping */ 163 /* get the resource for the memory mapping */
165 164
166 res = platform_get_resource(pd, IORESOURCE_MEM, 0); 165 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
167 166
168 if (res == NULL) { 167 if (res == NULL) {
169 dev_err(dev, "no memory resource specified\n"); 168 dev_err(&pdev->dev, "no memory resource specified\n");
170 err = -ENOENT; 169 err = -ENOENT;
171 goto exit_free; 170 goto exit_free;
172 } 171 }
173 172
174 dev_dbg(dev, "got platform resource %p (0x%lx)\n", res, res->start); 173 dev_dbg(&pdev->dev, "got platform resource %p (0x%lx)\n", res, res->start);
175 174
176 /* setup map parameters */ 175 /* setup map parameters */
177 176
178 info->map.phys = res->start; 177 info->map.phys = res->start;
179 info->map.size = (res->end - res->start) + 1; 178 info->map.size = (res->end - res->start) + 1;
180 info->map.name = pdata->mapname != NULL ? pdata->mapname : (char *)pd->name; 179 info->map.name = pdata->mapname != NULL ? pdata->mapname : (char *)pdev->name;
181 info->map.bankwidth = pdata->bankwidth; 180 info->map.bankwidth = pdata->bankwidth;
182 181
183 /* register our usage of the memory area */ 182 /* register our usage of the memory area */
184 183
185 info->area = request_mem_region(res->start, info->map.size, pd->name); 184 info->area = request_mem_region(res->start, info->map.size, pdev->name);
186 if (info->area == NULL) { 185 if (info->area == NULL) {
187 dev_err(dev, "failed to request memory region\n"); 186 dev_err(&pdev->dev, "failed to request memory region\n");
188 err = -EIO; 187 err = -EIO;
189 goto exit_free; 188 goto exit_free;
190 } 189 }
@@ -192,23 +191,23 @@ static int platram_probe(struct device *dev)
192 /* remap the memory area */ 191 /* remap the memory area */
193 192
194 info->map.virt = ioremap(res->start, info->map.size); 193 info->map.virt = ioremap(res->start, info->map.size);
195 dev_dbg(dev, "virt %p, %lu bytes\n", info->map.virt, info->map.size); 194 dev_dbg(&pdev->dev, "virt %p, %lu bytes\n", info->map.virt, info->map.size);
196 195
197 if (info->map.virt == NULL) { 196 if (info->map.virt == NULL) {
198 dev_err(dev, "failed to ioremap() region\n"); 197 dev_err(&pdev->dev, "failed to ioremap() region\n");
199 err = -EIO; 198 err = -EIO;
200 goto exit_free; 199 goto exit_free;
201 } 200 }
202 201
203 simple_map_init(&info->map); 202 simple_map_init(&info->map);
204 203
205 dev_dbg(dev, "initialised map, probing for mtd\n"); 204 dev_dbg(&pdev->dev, "initialised map, probing for mtd\n");
206 205
207 /* probe for the right mtd map driver */ 206 /* probe for the right mtd map driver */
208 207
209 info->mtd = do_map_probe("map_ram" , &info->map); 208 info->mtd = do_map_probe("map_ram" , &info->map);
210 if (info->mtd == NULL) { 209 if (info->mtd == NULL) {
211 dev_err(dev, "failed to probe for map_ram\n"); 210 dev_err(&pdev->dev, "failed to probe for map_ram\n");
212 err = -ENOMEM; 211 err = -ENOMEM;
213 goto exit_free; 212 goto exit_free;
214 } 213 }
@@ -237,27 +236,28 @@ static int platram_probe(struct device *dev)
237#endif /* CONFIG_MTD_PARTITIONS */ 236#endif /* CONFIG_MTD_PARTITIONS */
238 237
239 if (add_mtd_device(info->mtd)) { 238 if (add_mtd_device(info->mtd)) {
240 dev_err(dev, "add_mtd_device() failed\n"); 239 dev_err(&pdev->dev, "add_mtd_device() failed\n");
241 err = -ENOMEM; 240 err = -ENOMEM;
242 } 241 }
243 242
244 dev_info(dev, "registered mtd device\n"); 243 dev_info(&pdev->dev, "registered mtd device\n");
245 return err; 244 return err;
246 245
247 exit_free: 246 exit_free:
248 platram_remove(dev); 247 platram_remove(pdev);
249 exit_error: 248 exit_error:
250 return err; 249 return err;
251} 250}
252 251
253/* device driver info */ 252/* device driver info */
254 253
255static struct device_driver platram_driver = { 254static struct platform_driver platram_driver = {
256 .name = "mtd-ram",
257 .owner = THIS_MODULE,
258 .bus = &platform_bus_type,
259 .probe = platram_probe, 255 .probe = platram_probe,
260 .remove = platram_remove, 256 .remove = platram_remove,
257 .driver = {
258 .name = "mtd-ram",
259 .owner = THIS_MODULE,
260 },
261}; 261};
262 262
263/* module init/exit */ 263/* module init/exit */
@@ -265,12 +265,12 @@ static struct device_driver platram_driver = {
265static int __init platram_init(void) 265static int __init platram_init(void)
266{ 266{
267 printk("Generic platform RAM MTD, (c) 2004 Simtec Electronics\n"); 267 printk("Generic platform RAM MTD, (c) 2004 Simtec Electronics\n");
268 return driver_register(&platram_driver); 268 return platform_driver_register(&platram_driver);
269} 269}
270 270
271static void __exit platram_exit(void) 271static void __exit platram_exit(void)
272{ 272{
273 driver_unregister(&platram_driver); 273 platform_driver_unregister(&platram_driver);
274} 274}
275 275
276module_init(platram_init); 276module_init(platram_init);
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c
index 9e8bb1782be0..5cefb015633c 100644
--- a/drivers/mtd/maps/sa1100-flash.c
+++ b/drivers/mtd/maps/sa1100-flash.c
@@ -356,9 +356,8 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *plat)
356 356
357static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL }; 357static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
358 358
359static int __init sa1100_mtd_probe(struct device *dev) 359static int __init sa1100_mtd_probe(struct platform_device *pdev)
360{ 360{
361 struct platform_device *pdev = to_platform_device(dev);
362 struct flash_platform_data *plat = pdev->dev.platform_data; 361 struct flash_platform_data *plat = pdev->dev.platform_data;
363 struct mtd_partition *parts; 362 struct mtd_partition *parts;
364 const char *part_type = NULL; 363 const char *part_type = NULL;
@@ -402,28 +401,28 @@ static int __init sa1100_mtd_probe(struct device *dev)
402 401
403 info->nr_parts = nr_parts; 402 info->nr_parts = nr_parts;
404 403
405 dev_set_drvdata(dev, info); 404 platform_set_drvdata(pdev, info);
406 err = 0; 405 err = 0;
407 406
408 out: 407 out:
409 return err; 408 return err;
410} 409}
411 410
412static int __exit sa1100_mtd_remove(struct device *dev) 411static int __exit sa1100_mtd_remove(struct platform_device *pdev)
413{ 412{
414 struct sa_info *info = dev_get_drvdata(dev); 413 struct sa_info *info = platform_get_drvdata(pdev);
415 struct flash_platform_data *plat = dev->platform_data; 414 struct flash_platform_data *plat = pdev->dev.platform_data;
416 415
417 dev_set_drvdata(dev, NULL); 416 platform_set_drvdata(pdev, NULL);
418 sa1100_destroy(info, plat); 417 sa1100_destroy(info, plat);
419 418
420 return 0; 419 return 0;
421} 420}
422 421
423#ifdef CONFIG_PM 422#ifdef CONFIG_PM
424static int sa1100_mtd_suspend(struct device *dev, pm_message_t state) 423static int sa1100_mtd_suspend(struct platform_device *dev, pm_message_t state)
425{ 424{
426 struct sa_info *info = dev_get_drvdata(dev); 425 struct sa_info *info = platform_get_drvdata(dev);
427 int ret = 0; 426 int ret = 0;
428 427
429 if (info) 428 if (info)
@@ -432,17 +431,17 @@ static int sa1100_mtd_suspend(struct device *dev, pm_message_t state)
432 return ret; 431 return ret;
433} 432}
434 433
435static int sa1100_mtd_resume(struct device *dev) 434static int sa1100_mtd_resume(struct platform_device *dev)
436{ 435{
437 struct sa_info *info = dev_get_drvdata(dev); 436 struct sa_info *info = platform_get_drvdata(dev);
438 if (info) 437 if (info)
439 info->mtd->resume(info->mtd); 438 info->mtd->resume(info->mtd);
440 return 0; 439 return 0;
441} 440}
442 441
443static void sa1100_mtd_shutdown(struct device *dev) 442static void sa1100_mtd_shutdown(struct platform_device *dev)
444{ 443{
445 struct sa_info *info = dev_get_drvdata(dev); 444 struct sa_info *info = platform_get_drvdata(dev);
446 if (info && info->mtd->suspend(info->mtd) == 0) 445 if (info && info->mtd->suspend(info->mtd) == 0)
447 info->mtd->resume(info->mtd); 446 info->mtd->resume(info->mtd);
448} 447}
@@ -452,24 +451,25 @@ static void sa1100_mtd_shutdown(struct device *dev)
452#define sa1100_mtd_shutdown NULL 451#define sa1100_mtd_shutdown NULL
453#endif 452#endif
454 453
455static struct device_driver sa1100_mtd_driver = { 454static struct platform_driver sa1100_mtd_driver = {
456 .name = "flash",
457 .bus = &platform_bus_type,
458 .probe = sa1100_mtd_probe, 455 .probe = sa1100_mtd_probe,
459 .remove = __exit_p(sa1100_mtd_remove), 456 .remove = __exit_p(sa1100_mtd_remove),
460 .suspend = sa1100_mtd_suspend, 457 .suspend = sa1100_mtd_suspend,
461 .resume = sa1100_mtd_resume, 458 .resume = sa1100_mtd_resume,
462 .shutdown = sa1100_mtd_shutdown, 459 .shutdown = sa1100_mtd_shutdown,
460 .driver = {
461 .name = "flash",
462 },
463}; 463};
464 464
465static int __init sa1100_mtd_init(void) 465static int __init sa1100_mtd_init(void)
466{ 466{
467 return driver_register(&sa1100_mtd_driver); 467 return platform_driver_register(&sa1100_mtd_driver);
468} 468}
469 469
470static void __exit sa1100_mtd_exit(void) 470static void __exit sa1100_mtd_exit(void)
471{ 471{
472 driver_unregister(&sa1100_mtd_driver); 472 platform_driver_unregister(&sa1100_mtd_driver);
473} 473}
474 474
475module_init(sa1100_mtd_init); 475module_init(sa1100_mtd_init);
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 97e9b7892d29..d209214b1318 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -125,14 +125,14 @@ static struct s3c2410_nand_info *s3c2410_nand_mtd_toinfo(struct mtd_info *mtd)
125 return s3c2410_nand_mtd_toours(mtd)->info; 125 return s3c2410_nand_mtd_toours(mtd)->info;
126} 126}
127 127
128static struct s3c2410_nand_info *to_nand_info(struct device *dev) 128static struct s3c2410_nand_info *to_nand_info(struct platform_device *dev)
129{ 129{
130 return dev_get_drvdata(dev); 130 return platform_get_drvdata(dev);
131} 131}
132 132
133static struct s3c2410_platform_nand *to_nand_plat(struct device *dev) 133static struct s3c2410_platform_nand *to_nand_plat(struct platform_device *dev)
134{ 134{
135 return dev->platform_data; 135 return dev->dev.platform_data;
136} 136}
137 137
138/* timing calculations */ 138/* timing calculations */
@@ -165,9 +165,9 @@ static int s3c2410_nand_calc_rate(int wanted, unsigned long clk, int max)
165/* controller setup */ 165/* controller setup */
166 166
167static int s3c2410_nand_inithw(struct s3c2410_nand_info *info, 167static int s3c2410_nand_inithw(struct s3c2410_nand_info *info,
168 struct device *dev) 168 struct platform_device *pdev)
169{ 169{
170 struct s3c2410_platform_nand *plat = to_nand_plat(dev); 170 struct s3c2410_platform_nand *plat = to_nand_plat(pdev);
171 unsigned long clkrate = clk_get_rate(info->clk); 171 unsigned long clkrate = clk_get_rate(info->clk);
172 int tacls, twrph0, twrph1; 172 int tacls, twrph0, twrph1;
173 unsigned long cfg; 173 unsigned long cfg;
@@ -430,11 +430,11 @@ static void s3c2410_nand_write_buf(struct mtd_info *mtd,
430 430
431/* device management functions */ 431/* device management functions */
432 432
433static int s3c2410_nand_remove(struct device *dev) 433static int s3c2410_nand_remove(struct platform_device *pdev)
434{ 434{
435 struct s3c2410_nand_info *info = to_nand_info(dev); 435 struct s3c2410_nand_info *info = to_nand_info(pdev);
436 436
437 dev_set_drvdata(dev, NULL); 437 platform_set_drvdata(pdev, NULL);
438 438
439 if (info == NULL) 439 if (info == NULL)
440 return 0; 440 return 0;
@@ -562,10 +562,9 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,
562 * nand layer to look for devices 562 * nand layer to look for devices
563*/ 563*/
564 564
565static int s3c24xx_nand_probe(struct device *dev, int is_s3c2440) 565static int s3c24xx_nand_probe(struct platform_device *pdev, int is_s3c2440)
566{ 566{
567 struct platform_device *pdev = to_platform_device(dev); 567 struct s3c2410_platform_nand *plat = to_nand_plat(pdev);
568 struct s3c2410_platform_nand *plat = to_nand_plat(dev);
569 struct s3c2410_nand_info *info; 568 struct s3c2410_nand_info *info;
570 struct s3c2410_nand_mtd *nmtd; 569 struct s3c2410_nand_mtd *nmtd;
571 struct s3c2410_nand_set *sets; 570 struct s3c2410_nand_set *sets;
@@ -575,26 +574,26 @@ static int s3c24xx_nand_probe(struct device *dev, int is_s3c2440)
575 int nr_sets; 574 int nr_sets;
576 int setno; 575 int setno;
577 576
578 pr_debug("s3c2410_nand_probe(%p)\n", dev); 577 pr_debug("s3c2410_nand_probe(%p)\n", pdev);
579 578
580 info = kmalloc(sizeof(*info), GFP_KERNEL); 579 info = kmalloc(sizeof(*info), GFP_KERNEL);
581 if (info == NULL) { 580 if (info == NULL) {
582 dev_err(dev, "no memory for flash info\n"); 581 dev_err(&pdev->dev, "no memory for flash info\n");
583 err = -ENOMEM; 582 err = -ENOMEM;
584 goto exit_error; 583 goto exit_error;
585 } 584 }
586 585
587 memzero(info, sizeof(*info)); 586 memzero(info, sizeof(*info));
588 dev_set_drvdata(dev, info); 587 platform_set_drvdata(pdev, info);
589 588
590 spin_lock_init(&info->controller.lock); 589 spin_lock_init(&info->controller.lock);
591 init_waitqueue_head(&info->controller.wq); 590 init_waitqueue_head(&info->controller.wq);
592 591
593 /* get the clock source and enable it */ 592 /* get the clock source and enable it */
594 593
595 info->clk = clk_get(dev, "nand"); 594 info->clk = clk_get(&pdev->dev, "nand");
596 if (IS_ERR(info->clk)) { 595 if (IS_ERR(info->clk)) {
597 dev_err(dev, "failed to get clock"); 596 dev_err(&pdev->dev, "failed to get clock");
598 err = -ENOENT; 597 err = -ENOENT;
599 goto exit_error; 598 goto exit_error;
600 } 599 }
@@ -611,27 +610,27 @@ static int s3c24xx_nand_probe(struct device *dev, int is_s3c2440)
611 info->area = request_mem_region(res->start, size, pdev->name); 610 info->area = request_mem_region(res->start, size, pdev->name);
612 611
613 if (info->area == NULL) { 612 if (info->area == NULL) {
614 dev_err(dev, "cannot reserve register region\n"); 613 dev_err(&pdev->dev, "cannot reserve register region\n");
615 err = -ENOENT; 614 err = -ENOENT;
616 goto exit_error; 615 goto exit_error;
617 } 616 }
618 617
619 info->device = dev; 618 info->device = &pdev->dev;
620 info->platform = plat; 619 info->platform = plat;
621 info->regs = ioremap(res->start, size); 620 info->regs = ioremap(res->start, size);
622 info->is_s3c2440 = is_s3c2440; 621 info->is_s3c2440 = is_s3c2440;
623 622
624 if (info->regs == NULL) { 623 if (info->regs == NULL) {
625 dev_err(dev, "cannot reserve register region\n"); 624 dev_err(&pdev->dev, "cannot reserve register region\n");
626 err = -EIO; 625 err = -EIO;
627 goto exit_error; 626 goto exit_error;
628 } 627 }
629 628
630 dev_dbg(dev, "mapped registers at %p\n", info->regs); 629 dev_dbg(&pdev->dev, "mapped registers at %p\n", info->regs);
631 630
632 /* initialise the hardware */ 631 /* initialise the hardware */
633 632
634 err = s3c2410_nand_inithw(info, dev); 633 err = s3c2410_nand_inithw(info, pdev);
635 if (err != 0) 634 if (err != 0)
636 goto exit_error; 635 goto exit_error;
637 636
@@ -645,7 +644,7 @@ static int s3c24xx_nand_probe(struct device *dev, int is_s3c2440)
645 size = nr_sets * sizeof(*info->mtds); 644 size = nr_sets * sizeof(*info->mtds);
646 info->mtds = kmalloc(size, GFP_KERNEL); 645 info->mtds = kmalloc(size, GFP_KERNEL);
647 if (info->mtds == NULL) { 646 if (info->mtds == NULL) {
648 dev_err(dev, "failed to allocate mtd storage\n"); 647 dev_err(&pdev->dev, "failed to allocate mtd storage\n");
649 err = -ENOMEM; 648 err = -ENOMEM;
650 goto exit_error; 649 goto exit_error;
651 } 650 }
@@ -677,7 +676,7 @@ static int s3c24xx_nand_probe(struct device *dev, int is_s3c2440)
677 return 0; 676 return 0;
678 677
679 exit_error: 678 exit_error:
680 s3c2410_nand_remove(dev); 679 s3c2410_nand_remove(pdev);
681 680
682 if (err == 0) 681 if (err == 0)
683 err = -EINVAL; 682 err = -EINVAL;
@@ -686,44 +685,46 @@ static int s3c24xx_nand_probe(struct device *dev, int is_s3c2440)
686 685
687/* driver device registration */ 686/* driver device registration */
688 687
689static int s3c2410_nand_probe(struct device *dev) 688static int s3c2410_nand_probe(struct platform_device *dev)
690{ 689{
691 return s3c24xx_nand_probe(dev, 0); 690 return s3c24xx_nand_probe(dev, 0);
692} 691}
693 692
694static int s3c2440_nand_probe(struct device *dev) 693static int s3c2440_nand_probe(struct platform_device *dev)
695{ 694{
696 return s3c24xx_nand_probe(dev, 1); 695 return s3c24xx_nand_probe(dev, 1);
697} 696}
698 697
699static struct device_driver s3c2410_nand_driver = { 698static struct platform_driver s3c2410_nand_driver = {
700 .name = "s3c2410-nand",
701 .owner = THIS_MODULE,
702 .bus = &platform_bus_type,
703 .probe = s3c2410_nand_probe, 699 .probe = s3c2410_nand_probe,
704 .remove = s3c2410_nand_remove, 700 .remove = s3c2410_nand_remove,
701 .driver = {
702 .name = "s3c2410-nand",
703 .owner = THIS_MODULE,
704 },
705}; 705};
706 706
707static struct device_driver s3c2440_nand_driver = { 707static struct platform_driver s3c2440_nand_driver = {
708 .name = "s3c2440-nand",
709 .owner = THIS_MODULE,
710 .bus = &platform_bus_type,
711 .probe = s3c2440_nand_probe, 708 .probe = s3c2440_nand_probe,
712 .remove = s3c2410_nand_remove, 709 .remove = s3c2410_nand_remove,
710 .driver = {
711 .name = "s3c2440-nand",
712 .owner = THIS_MODULE,
713 },
713}; 714};
714 715
715static int __init s3c2410_nand_init(void) 716static int __init s3c2410_nand_init(void)
716{ 717{
717 printk("S3C24XX NAND Driver, (c) 2004 Simtec Electronics\n"); 718 printk("S3C24XX NAND Driver, (c) 2004 Simtec Electronics\n");
718 719
719 driver_register(&s3c2440_nand_driver); 720 platform_driver_register(&s3c2440_nand_driver);
720 return driver_register(&s3c2410_nand_driver); 721 return platform_driver_register(&s3c2410_nand_driver);
721} 722}
722 723
723static void __exit s3c2410_nand_exit(void) 724static void __exit s3c2410_nand_exit(void)
724{ 725{
725 driver_unregister(&s3c2440_nand_driver); 726 platform_driver_unregister(&s3c2440_nand_driver);
726 driver_unregister(&s3c2410_nand_driver); 727 platform_driver_unregister(&s3c2410_nand_driver);
727} 728}
728 729
729module_init(s3c2410_nand_init); 730module_init(s3c2410_nand_init);
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 5c69d57f8548..ebd7313d7fc1 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -812,7 +812,7 @@ config SMC91X
812 tristate "SMC 91C9x/91C1xxx support" 812 tristate "SMC 91C9x/91C1xxx support"
813 select CRC32 813 select CRC32
814 select MII 814 select MII
815 depends on NET_ETHERNET && (ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH) 815 depends on NET_ETHERNET && (ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || SOC_AU1X00)
816 help 816 help
817 This is a driver for SMC's 91x series of Ethernet chipsets, 817 This is a driver for SMC's 91x series of Ethernet chipsets,
818 including the SMC91C94 and the SMC91C111. Say Y if you want it 818 including the SMC91C94 and the SMC91C111. Say Y if you want it
diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index 0d33a93df96b..03804cc38be0 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -398,13 +398,19 @@ static struct mca_driver depca_mca_driver = {
398}; 398};
399#endif 399#endif
400 400
401static int depca_isa_probe (struct device *); 401static int depca_isa_probe (struct platform_device *);
402 402
403static struct device_driver depca_isa_driver = { 403static int __devexit depca_isa_remove(struct platform_device *pdev)
404 .name = depca_string, 404{
405 .bus = &platform_bus_type, 405 return depca_device_remove(&pdev->dev);
406}
407
408static struct platform_driver depca_isa_driver = {
406 .probe = depca_isa_probe, 409 .probe = depca_isa_probe,
407 .remove = __devexit_p(depca_device_remove), 410 .remove = __devexit_p(depca_isa_remove),
411 .driver = {
412 .name = depca_string,
413 },
408}; 414};
409 415
410/* 416/*
@@ -1525,7 +1531,7 @@ static enum depca_type __init depca_shmem_probe (ulong *mem_start)
1525 return adapter; 1531 return adapter;
1526} 1532}
1527 1533
1528static int __init depca_isa_probe (struct device *device) 1534static int __init depca_isa_probe (struct platform_device *device)
1529{ 1535{
1530 struct net_device *dev; 1536 struct net_device *dev;
1531 struct depca_private *lp; 1537 struct depca_private *lp;
@@ -1533,7 +1539,7 @@ static int __init depca_isa_probe (struct device *device)
1533 enum depca_type adapter = unknown; 1539 enum depca_type adapter = unknown;
1534 int status = 0; 1540 int status = 0;
1535 1541
1536 ioaddr = (u_long) device->platform_data; 1542 ioaddr = (u_long) device->dev.platform_data;
1537 1543
1538 if ((status = depca_common_init (ioaddr, &dev))) 1544 if ((status = depca_common_init (ioaddr, &dev)))
1539 goto out; 1545 goto out;
@@ -1553,7 +1559,7 @@ static int __init depca_isa_probe (struct device *device)
1553 lp->adapter = adapter; 1559 lp->adapter = adapter;
1554 lp->mem_start = mem_start; 1560 lp->mem_start = mem_start;
1555 1561
1556 if ((status = depca_hw_init(dev, device))) 1562 if ((status = depca_hw_init(dev, &device->dev)))
1557 goto out_free; 1563 goto out_free;
1558 1564
1559 return 0; 1565 return 0;
@@ -2082,7 +2088,7 @@ static int __init depca_module_init (void)
2082#ifdef CONFIG_EISA 2088#ifdef CONFIG_EISA
2083 err |= eisa_driver_register (&depca_eisa_driver); 2089 err |= eisa_driver_register (&depca_eisa_driver);
2084#endif 2090#endif
2085 err |= driver_register (&depca_isa_driver); 2091 err |= platform_driver_register (&depca_isa_driver);
2086 depca_platform_probe (); 2092 depca_platform_probe ();
2087 2093
2088 return err; 2094 return err;
@@ -2097,7 +2103,7 @@ static void __exit depca_module_exit (void)
2097#ifdef CONFIG_EISA 2103#ifdef CONFIG_EISA
2098 eisa_driver_unregister (&depca_eisa_driver); 2104 eisa_driver_unregister (&depca_eisa_driver);
2099#endif 2105#endif
2100 driver_unregister (&depca_isa_driver); 2106 platform_driver_unregister (&depca_isa_driver);
2101 2107
2102 for (i = 0; depca_io_ports[i].iobase; i++) { 2108 for (i = 0; depca_io_ports[i].iobase; i++) {
2103 if (depca_io_ports[i].device) { 2109 if (depca_io_ports[i].device) {
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index f8c9bcdab68b..24996da4c1c4 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -148,7 +148,7 @@ typedef struct board_info {
148} board_info_t; 148} board_info_t;
149 149
150/* function declaration ------------------------------------- */ 150/* function declaration ------------------------------------- */
151static int dm9000_probe(struct device *); 151static int dm9000_probe(struct platform_device *);
152static int dm9000_open(struct net_device *); 152static int dm9000_open(struct net_device *);
153static int dm9000_start_xmit(struct sk_buff *, struct net_device *); 153static int dm9000_start_xmit(struct sk_buff *, struct net_device *);
154static int dm9000_stop(struct net_device *); 154static int dm9000_stop(struct net_device *);
@@ -378,9 +378,8 @@ dm9000_release_board(struct platform_device *pdev, struct board_info *db)
378 * Search DM9000 board, allocate space and register it 378 * Search DM9000 board, allocate space and register it
379 */ 379 */
380static int 380static int
381dm9000_probe(struct device *dev) 381dm9000_probe(struct platform_device *pdev)
382{ 382{
383 struct platform_device *pdev = to_platform_device(dev);
384 struct dm9000_plat_data *pdata = pdev->dev.platform_data; 383 struct dm9000_plat_data *pdata = pdev->dev.platform_data;
385 struct board_info *db; /* Point a board information structure */ 384 struct board_info *db; /* Point a board information structure */
386 struct net_device *ndev; 385 struct net_device *ndev;
@@ -398,7 +397,7 @@ dm9000_probe(struct device *dev)
398 } 397 }
399 398
400 SET_MODULE_OWNER(ndev); 399 SET_MODULE_OWNER(ndev);
401 SET_NETDEV_DEV(ndev, dev); 400 SET_NETDEV_DEV(ndev, &pdev->dev);
402 401
403 PRINTK2("dm9000_probe()"); 402 PRINTK2("dm9000_probe()");
404 403
@@ -569,7 +568,7 @@ dm9000_probe(struct device *dev)
569 printk("%s: Invalid ethernet MAC address. Please " 568 printk("%s: Invalid ethernet MAC address. Please "
570 "set using ifconfig\n", ndev->name); 569 "set using ifconfig\n", ndev->name);
571 570
572 dev_set_drvdata(dev, ndev); 571 platform_set_drvdata(pdev, ndev);
573 ret = register_netdev(ndev); 572 ret = register_netdev(ndev);
574 573
575 if (ret == 0) { 574 if (ret == 0) {
@@ -1140,9 +1139,9 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value)
1140} 1139}
1141 1140
1142static int 1141static int
1143dm9000_drv_suspend(struct device *dev, pm_message_t state) 1142dm9000_drv_suspend(struct platform_device *dev, pm_message_t state)
1144{ 1143{
1145 struct net_device *ndev = dev_get_drvdata(dev); 1144 struct net_device *ndev = platform_get_drvdata(dev);
1146 1145
1147 if (ndev) { 1146 if (ndev) {
1148 if (netif_running(ndev)) { 1147 if (netif_running(ndev)) {
@@ -1154,9 +1153,9 @@ dm9000_drv_suspend(struct device *dev, pm_message_t state)
1154} 1153}
1155 1154
1156static int 1155static int
1157dm9000_drv_resume(struct device *dev) 1156dm9000_drv_resume(struct platform_device *dev)
1158{ 1157{
1159 struct net_device *ndev = dev_get_drvdata(dev); 1158 struct net_device *ndev = platform_get_drvdata(dev);
1160 board_info_t *db = (board_info_t *) ndev->priv; 1159 board_info_t *db = (board_info_t *) ndev->priv;
1161 1160
1162 if (ndev) { 1161 if (ndev) {
@@ -1172,12 +1171,11 @@ dm9000_drv_resume(struct device *dev)
1172} 1171}
1173 1172
1174static int 1173static int
1175dm9000_drv_remove(struct device *dev) 1174dm9000_drv_remove(struct platform_device *pdev)
1176{ 1175{
1177 struct platform_device *pdev = to_platform_device(dev); 1176 struct net_device *ndev = platform_get_drvdata(pdev);
1178 struct net_device *ndev = dev_get_drvdata(dev);
1179 1177
1180 dev_set_drvdata(dev, NULL); 1178 platform_set_drvdata(pdev, NULL);
1181 1179
1182 unregister_netdev(ndev); 1180 unregister_netdev(ndev);
1183 dm9000_release_board(pdev, (board_info_t *) ndev->priv); 1181 dm9000_release_board(pdev, (board_info_t *) ndev->priv);
@@ -1188,13 +1186,14 @@ dm9000_drv_remove(struct device *dev)
1188 return 0; 1186 return 0;
1189} 1187}
1190 1188
1191static struct device_driver dm9000_driver = { 1189static struct platform_driver dm9000_driver = {
1192 .name = "dm9000",
1193 .bus = &platform_bus_type,
1194 .probe = dm9000_probe, 1190 .probe = dm9000_probe,
1195 .remove = dm9000_drv_remove, 1191 .remove = dm9000_drv_remove,
1196 .suspend = dm9000_drv_suspend, 1192 .suspend = dm9000_drv_suspend,
1197 .resume = dm9000_drv_resume, 1193 .resume = dm9000_drv_resume,
1194 .driver = {
1195 .name = "dm9000",
1196 },
1198}; 1197};
1199 1198
1200static int __init 1199static int __init
@@ -1202,13 +1201,13 @@ dm9000_init(void)
1202{ 1201{
1203 printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME); 1202 printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME);
1204 1203
1205 return driver_register(&dm9000_driver); /* search board and register */ 1204 return platform_driver_register(&dm9000_driver); /* search board and register */
1206} 1205}
1207 1206
1208static void __exit 1207static void __exit
1209dm9000_cleanup(void) 1208dm9000_cleanup(void)
1210{ 1209{
1211 driver_unregister(&dm9000_driver); 1210 platform_driver_unregister(&dm9000_driver);
1212} 1211}
1213 1212
1214module_init(dm9000_init); 1213module_init(dm9000_init);
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 22aec6ed80f5..525624fc03b4 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -80,7 +80,7 @@
80 * into nv_close, otherwise reenabling for wol can 80 * into nv_close, otherwise reenabling for wol can
81 * cause DMA to kfree'd memory. 81 * cause DMA to kfree'd memory.
82 * 0.31: 14 Nov 2004: ethtool support for getting/setting link 82 * 0.31: 14 Nov 2004: ethtool support for getting/setting link
83 * capabilities. 83 * capabilities.
84 * 0.32: 16 Apr 2005: RX_ERROR4 handling added. 84 * 0.32: 16 Apr 2005: RX_ERROR4 handling added.
85 * 0.33: 16 May 2005: Support for MCP51 added. 85 * 0.33: 16 May 2005: Support for MCP51 added.
86 * 0.34: 18 Jun 2005: Add DEV_NEED_LINKTIMER to all nForce nics. 86 * 0.34: 18 Jun 2005: Add DEV_NEED_LINKTIMER to all nForce nics.
@@ -89,14 +89,17 @@
89 * 0.37: 10 Jul 2005: Additional ethtool support, cleanup of pci id list 89 * 0.37: 10 Jul 2005: Additional ethtool support, cleanup of pci id list
90 * 0.38: 16 Jul 2005: tx irq rewrite: Use global flags instead of 90 * 0.38: 16 Jul 2005: tx irq rewrite: Use global flags instead of
91 * per-packet flags. 91 * per-packet flags.
92 * 0.39: 18 Jul 2005: Add 64bit descriptor support. 92 * 0.39: 18 Jul 2005: Add 64bit descriptor support.
93 * 0.40: 19 Jul 2005: Add support for mac address change. 93 * 0.40: 19 Jul 2005: Add support for mac address change.
94 * 0.41: 30 Jul 2005: Write back original MAC in nv_close instead 94 * 0.41: 30 Jul 2005: Write back original MAC in nv_close instead
95 * of nv_remove 95 * of nv_remove
96 * 0.42: 06 Aug 2005: Fix lack of link speed initialization 96 * 0.42: 06 Aug 2005: Fix lack of link speed initialization
97 * in the second (and later) nv_open call 97 * in the second (and later) nv_open call
98 * 0.43: 10 Aug 2005: Add support for tx checksum. 98 * 0.43: 10 Aug 2005: Add support for tx checksum.
99 * 0.44: 20 Aug 2005: Add support for scatter gather and segmentation. 99 * 0.44: 20 Aug 2005: Add support for scatter gather and segmentation.
100 * 0.45: 18 Sep 2005: Remove nv_stop/start_rx from every link check
101 * 0.46: 20 Oct 2005: Add irq optimization modes.
102 * 0.47: 26 Oct 2005: Add phyaddr 0 in phy scan.
100 * 103 *
101 * Known bugs: 104 * Known bugs:
102 * We suspect that on some hardware no TX done interrupts are generated. 105 * We suspect that on some hardware no TX done interrupts are generated.
@@ -108,7 +111,7 @@
108 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few 111 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
109 * superfluous timer interrupts from the nic. 112 * superfluous timer interrupts from the nic.
110 */ 113 */
111#define FORCEDETH_VERSION "0.44" 114#define FORCEDETH_VERSION "0.47"
112#define DRV_NAME "forcedeth" 115#define DRV_NAME "forcedeth"
113 116
114#include <linux/module.h> 117#include <linux/module.h>
@@ -163,7 +166,8 @@ enum {
163#define NVREG_IRQ_LINK 0x0040 166#define NVREG_IRQ_LINK 0x0040
164#define NVREG_IRQ_TX_ERROR 0x0080 167#define NVREG_IRQ_TX_ERROR 0x0080
165#define NVREG_IRQ_TX1 0x0100 168#define NVREG_IRQ_TX1 0x0100
166#define NVREG_IRQMASK_WANTED 0x00df 169#define NVREG_IRQMASK_THROUGHPUT 0x00df
170#define NVREG_IRQMASK_CPU 0x0040
167 171
168#define NVREG_IRQ_UNKNOWN (~(NVREG_IRQ_RX_ERROR|NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_TX_ERR| \ 172#define NVREG_IRQ_UNKNOWN (~(NVREG_IRQ_RX_ERROR|NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_TX_ERR| \
169 NVREG_IRQ_TX_OK|NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_TX_ERROR| \ 173 NVREG_IRQ_TX_OK|NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_TX_ERROR| \
@@ -177,7 +181,8 @@ enum {
177 * NVREG_POLL_DEFAULT=97 would result in an interval length of 1 ms 181 * NVREG_POLL_DEFAULT=97 would result in an interval length of 1 ms
178 */ 182 */
179 NvRegPollingInterval = 0x00c, 183 NvRegPollingInterval = 0x00c,
180#define NVREG_POLL_DEFAULT 970 184#define NVREG_POLL_DEFAULT_THROUGHPUT 970
185#define NVREG_POLL_DEFAULT_CPU 13
181 NvRegMisc1 = 0x080, 186 NvRegMisc1 = 0x080,
182#define NVREG_MISC1_HD 0x02 187#define NVREG_MISC1_HD 0x02
183#define NVREG_MISC1_FORCE 0x3b0f3c 188#define NVREG_MISC1_FORCE 0x3b0f3c
@@ -538,6 +543,25 @@ struct fe_priv {
538 */ 543 */
539static int max_interrupt_work = 5; 544static int max_interrupt_work = 5;
540 545
546/*
547 * Optimization can be either throuput mode or cpu mode
548 *
549 * Throughput Mode: Every tx and rx packet will generate an interrupt.
550 * CPU Mode: Interrupts are controlled by a timer.
551 */
552#define NV_OPTIMIZATION_MODE_THROUGHPUT 0
553#define NV_OPTIMIZATION_MODE_CPU 1
554static int optimization_mode = NV_OPTIMIZATION_MODE_THROUGHPUT;
555
556/*
557 * Poll interval for timer irq
558 *
559 * This interval determines how frequent an interrupt is generated.
560 * The is value is determined by [(time_in_micro_secs * 100) / (2^10)]
561 * Min = 0, and Max = 65535
562 */
563static int poll_interval = -1;
564
541static inline struct fe_priv *get_nvpriv(struct net_device *dev) 565static inline struct fe_priv *get_nvpriv(struct net_device *dev)
542{ 566{
543 return netdev_priv(dev); 567 return netdev_priv(dev);
@@ -1328,67 +1352,71 @@ static void nv_rx_process(struct net_device *dev)
1328 if (!(Flags & NV_RX_DESCRIPTORVALID)) 1352 if (!(Flags & NV_RX_DESCRIPTORVALID))
1329 goto next_pkt; 1353 goto next_pkt;
1330 1354
1331 if (Flags & NV_RX_MISSEDFRAME) { 1355 if (Flags & NV_RX_ERROR) {
1332 np->stats.rx_missed_errors++; 1356 if (Flags & NV_RX_MISSEDFRAME) {
1333 np->stats.rx_errors++; 1357 np->stats.rx_missed_errors++;
1334 goto next_pkt;
1335 }
1336 if (Flags & (NV_RX_ERROR1|NV_RX_ERROR2|NV_RX_ERROR3)) {
1337 np->stats.rx_errors++;
1338 goto next_pkt;
1339 }
1340 if (Flags & NV_RX_CRCERR) {
1341 np->stats.rx_crc_errors++;
1342 np->stats.rx_errors++;
1343 goto next_pkt;
1344 }
1345 if (Flags & NV_RX_OVERFLOW) {
1346 np->stats.rx_over_errors++;
1347 np->stats.rx_errors++;
1348 goto next_pkt;
1349 }
1350 if (Flags & NV_RX_ERROR4) {
1351 len = nv_getlen(dev, np->rx_skbuff[i]->data, len);
1352 if (len < 0) {
1353 np->stats.rx_errors++; 1358 np->stats.rx_errors++;
1354 goto next_pkt; 1359 goto next_pkt;
1355 } 1360 }
1356 } 1361 if (Flags & (NV_RX_ERROR1|NV_RX_ERROR2|NV_RX_ERROR3)) {
1357 /* framing errors are soft errors. */ 1362 np->stats.rx_errors++;
1358 if (Flags & NV_RX_FRAMINGERR) { 1363 goto next_pkt;
1359 if (Flags & NV_RX_SUBSTRACT1) { 1364 }
1360 len--; 1365 if (Flags & NV_RX_CRCERR) {
1366 np->stats.rx_crc_errors++;
1367 np->stats.rx_errors++;
1368 goto next_pkt;
1369 }
1370 if (Flags & NV_RX_OVERFLOW) {
1371 np->stats.rx_over_errors++;
1372 np->stats.rx_errors++;
1373 goto next_pkt;
1374 }
1375 if (Flags & NV_RX_ERROR4) {
1376 len = nv_getlen(dev, np->rx_skbuff[i]->data, len);
1377 if (len < 0) {
1378 np->stats.rx_errors++;
1379 goto next_pkt;
1380 }
1381 }
1382 /* framing errors are soft errors. */
1383 if (Flags & NV_RX_FRAMINGERR) {
1384 if (Flags & NV_RX_SUBSTRACT1) {
1385 len--;
1386 }
1361 } 1387 }
1362 } 1388 }
1363 } else { 1389 } else {
1364 if (!(Flags & NV_RX2_DESCRIPTORVALID)) 1390 if (!(Flags & NV_RX2_DESCRIPTORVALID))
1365 goto next_pkt; 1391 goto next_pkt;
1366 1392
1367 if (Flags & (NV_RX2_ERROR1|NV_RX2_ERROR2|NV_RX2_ERROR3)) { 1393 if (Flags & NV_RX2_ERROR) {
1368 np->stats.rx_errors++; 1394 if (Flags & (NV_RX2_ERROR1|NV_RX2_ERROR2|NV_RX2_ERROR3)) {
1369 goto next_pkt;
1370 }
1371 if (Flags & NV_RX2_CRCERR) {
1372 np->stats.rx_crc_errors++;
1373 np->stats.rx_errors++;
1374 goto next_pkt;
1375 }
1376 if (Flags & NV_RX2_OVERFLOW) {
1377 np->stats.rx_over_errors++;
1378 np->stats.rx_errors++;
1379 goto next_pkt;
1380 }
1381 if (Flags & NV_RX2_ERROR4) {
1382 len = nv_getlen(dev, np->rx_skbuff[i]->data, len);
1383 if (len < 0) {
1384 np->stats.rx_errors++; 1395 np->stats.rx_errors++;
1385 goto next_pkt; 1396 goto next_pkt;
1386 } 1397 }
1387 } 1398 if (Flags & NV_RX2_CRCERR) {
1388 /* framing errors are soft errors */ 1399 np->stats.rx_crc_errors++;
1389 if (Flags & NV_RX2_FRAMINGERR) { 1400 np->stats.rx_errors++;
1390 if (Flags & NV_RX2_SUBSTRACT1) { 1401 goto next_pkt;
1391 len--; 1402 }
1403 if (Flags & NV_RX2_OVERFLOW) {
1404 np->stats.rx_over_errors++;
1405 np->stats.rx_errors++;
1406 goto next_pkt;
1407 }
1408 if (Flags & NV_RX2_ERROR4) {
1409 len = nv_getlen(dev, np->rx_skbuff[i]->data, len);
1410 if (len < 0) {
1411 np->stats.rx_errors++;
1412 goto next_pkt;
1413 }
1414 }
1415 /* framing errors are soft errors */
1416 if (Flags & NV_RX2_FRAMINGERR) {
1417 if (Flags & NV_RX2_SUBSTRACT1) {
1418 len--;
1419 }
1392 } 1420 }
1393 } 1421 }
1394 Flags &= NV_RX2_CHECKSUMMASK; 1422 Flags &= NV_RX2_CHECKSUMMASK;
@@ -1612,6 +1640,17 @@ static void nv_set_multicast(struct net_device *dev)
1612 spin_unlock_irq(&np->lock); 1640 spin_unlock_irq(&np->lock);
1613} 1641}
1614 1642
1643/**
1644 * nv_update_linkspeed: Setup the MAC according to the link partner
1645 * @dev: Network device to be configured
1646 *
1647 * The function queries the PHY and checks if there is a link partner.
1648 * If yes, then it sets up the MAC accordingly. Otherwise, the MAC is
1649 * set to 10 MBit HD.
1650 *
1651 * The function returns 0 if there is no link partner and 1 if there is
1652 * a good link partner.
1653 */
1615static int nv_update_linkspeed(struct net_device *dev) 1654static int nv_update_linkspeed(struct net_device *dev)
1616{ 1655{
1617 struct fe_priv *np = netdev_priv(dev); 1656 struct fe_priv *np = netdev_priv(dev);
@@ -1751,13 +1790,11 @@ set_speed:
1751static void nv_linkchange(struct net_device *dev) 1790static void nv_linkchange(struct net_device *dev)
1752{ 1791{
1753 if (nv_update_linkspeed(dev)) { 1792 if (nv_update_linkspeed(dev)) {
1754 if (netif_carrier_ok(dev)) { 1793 if (!netif_carrier_ok(dev)) {
1755 nv_stop_rx(dev);
1756 } else {
1757 netif_carrier_on(dev); 1794 netif_carrier_on(dev);
1758 printk(KERN_INFO "%s: link up.\n", dev->name); 1795 printk(KERN_INFO "%s: link up.\n", dev->name);
1796 nv_start_rx(dev);
1759 } 1797 }
1760 nv_start_rx(dev);
1761 } else { 1798 } else {
1762 if (netif_carrier_ok(dev)) { 1799 if (netif_carrier_ok(dev)) {
1763 netif_carrier_off(dev); 1800 netif_carrier_off(dev);
@@ -1799,22 +1836,18 @@ static irqreturn_t nv_nic_irq(int foo, void *data, struct pt_regs *regs)
1799 if (!(events & np->irqmask)) 1836 if (!(events & np->irqmask))
1800 break; 1837 break;
1801 1838
1802 if (events & (NVREG_IRQ_TX1|NVREG_IRQ_TX_OK|NVREG_IRQ_TX_ERROR|NVREG_IRQ_TX_ERR)) { 1839 spin_lock(&np->lock);
1840 nv_tx_done(dev);
1841 spin_unlock(&np->lock);
1842
1843 nv_rx_process(dev);
1844 if (nv_alloc_rx(dev)) {
1803 spin_lock(&np->lock); 1845 spin_lock(&np->lock);
1804 nv_tx_done(dev); 1846 if (!np->in_shutdown)
1847 mod_timer(&np->oom_kick, jiffies + OOM_REFILL);
1805 spin_unlock(&np->lock); 1848 spin_unlock(&np->lock);
1806 } 1849 }
1807 1850
1808 if (events & (NVREG_IRQ_RX_ERROR|NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF)) {
1809 nv_rx_process(dev);
1810 if (nv_alloc_rx(dev)) {
1811 spin_lock(&np->lock);
1812 if (!np->in_shutdown)
1813 mod_timer(&np->oom_kick, jiffies + OOM_REFILL);
1814 spin_unlock(&np->lock);
1815 }
1816 }
1817
1818 if (events & NVREG_IRQ_LINK) { 1851 if (events & NVREG_IRQ_LINK) {
1819 spin_lock(&np->lock); 1852 spin_lock(&np->lock);
1820 nv_link_irq(dev); 1853 nv_link_irq(dev);
@@ -2216,7 +2249,14 @@ static int nv_open(struct net_device *dev)
2216 writel(NVREG_RNDSEED_FORCE | (i&NVREG_RNDSEED_MASK), base + NvRegRandomSeed); 2249 writel(NVREG_RNDSEED_FORCE | (i&NVREG_RNDSEED_MASK), base + NvRegRandomSeed);
2217 writel(NVREG_UNKSETUP1_VAL, base + NvRegUnknownSetupReg1); 2250 writel(NVREG_UNKSETUP1_VAL, base + NvRegUnknownSetupReg1);
2218 writel(NVREG_UNKSETUP2_VAL, base + NvRegUnknownSetupReg2); 2251 writel(NVREG_UNKSETUP2_VAL, base + NvRegUnknownSetupReg2);
2219 writel(NVREG_POLL_DEFAULT, base + NvRegPollingInterval); 2252 if (poll_interval == -1) {
2253 if (optimization_mode == NV_OPTIMIZATION_MODE_THROUGHPUT)
2254 writel(NVREG_POLL_DEFAULT_THROUGHPUT, base + NvRegPollingInterval);
2255 else
2256 writel(NVREG_POLL_DEFAULT_CPU, base + NvRegPollingInterval);
2257 }
2258 else
2259 writel(poll_interval & 0xFFFF, base + NvRegPollingInterval);
2220 writel(NVREG_UNKSETUP6_VAL, base + NvRegUnknownSetupReg6); 2260 writel(NVREG_UNKSETUP6_VAL, base + NvRegUnknownSetupReg6);
2221 writel((np->phyaddr << NVREG_ADAPTCTL_PHYSHIFT)|NVREG_ADAPTCTL_PHYVALID|NVREG_ADAPTCTL_RUNNING, 2261 writel((np->phyaddr << NVREG_ADAPTCTL_PHYSHIFT)|NVREG_ADAPTCTL_PHYVALID|NVREG_ADAPTCTL_RUNNING,
2222 base + NvRegAdapterControl); 2262 base + NvRegAdapterControl);
@@ -2501,7 +2541,11 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2501 } else { 2541 } else {
2502 np->tx_flags = NV_TX2_VALID; 2542 np->tx_flags = NV_TX2_VALID;
2503 } 2543 }
2504 np->irqmask = NVREG_IRQMASK_WANTED; 2544 if (optimization_mode == NV_OPTIMIZATION_MODE_THROUGHPUT)
2545 np->irqmask = NVREG_IRQMASK_THROUGHPUT;
2546 else
2547 np->irqmask = NVREG_IRQMASK_CPU;
2548
2505 if (id->driver_data & DEV_NEED_TIMERIRQ) 2549 if (id->driver_data & DEV_NEED_TIMERIRQ)
2506 np->irqmask |= NVREG_IRQ_TIMER; 2550 np->irqmask |= NVREG_IRQ_TIMER;
2507 if (id->driver_data & DEV_NEED_LINKTIMER) { 2551 if (id->driver_data & DEV_NEED_LINKTIMER) {
@@ -2514,16 +2558,17 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2514 } 2558 }
2515 2559
2516 /* find a suitable phy */ 2560 /* find a suitable phy */
2517 for (i = 1; i < 32; i++) { 2561 for (i = 1; i <= 32; i++) {
2518 int id1, id2; 2562 int id1, id2;
2563 int phyaddr = i & 0x1F;
2519 2564
2520 spin_lock_irq(&np->lock); 2565 spin_lock_irq(&np->lock);
2521 id1 = mii_rw(dev, i, MII_PHYSID1, MII_READ); 2566 id1 = mii_rw(dev, phyaddr, MII_PHYSID1, MII_READ);
2522 spin_unlock_irq(&np->lock); 2567 spin_unlock_irq(&np->lock);
2523 if (id1 < 0 || id1 == 0xffff) 2568 if (id1 < 0 || id1 == 0xffff)
2524 continue; 2569 continue;
2525 spin_lock_irq(&np->lock); 2570 spin_lock_irq(&np->lock);
2526 id2 = mii_rw(dev, i, MII_PHYSID2, MII_READ); 2571 id2 = mii_rw(dev, phyaddr, MII_PHYSID2, MII_READ);
2527 spin_unlock_irq(&np->lock); 2572 spin_unlock_irq(&np->lock);
2528 if (id2 < 0 || id2 == 0xffff) 2573 if (id2 < 0 || id2 == 0xffff)
2529 continue; 2574 continue;
@@ -2531,23 +2576,19 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2531 id1 = (id1 & PHYID1_OUI_MASK) << PHYID1_OUI_SHFT; 2576 id1 = (id1 & PHYID1_OUI_MASK) << PHYID1_OUI_SHFT;
2532 id2 = (id2 & PHYID2_OUI_MASK) >> PHYID2_OUI_SHFT; 2577 id2 = (id2 & PHYID2_OUI_MASK) >> PHYID2_OUI_SHFT;
2533 dprintk(KERN_DEBUG "%s: open: Found PHY %04x:%04x at address %d.\n", 2578 dprintk(KERN_DEBUG "%s: open: Found PHY %04x:%04x at address %d.\n",
2534 pci_name(pci_dev), id1, id2, i); 2579 pci_name(pci_dev), id1, id2, phyaddr);
2535 np->phyaddr = i; 2580 np->phyaddr = phyaddr;
2536 np->phy_oui = id1 | id2; 2581 np->phy_oui = id1 | id2;
2537 break; 2582 break;
2538 } 2583 }
2539 if (i == 32) { 2584 if (i == 33) {
2540 /* PHY in isolate mode? No phy attached and user wants to
2541 * test loopback? Very odd, but can be correct.
2542 */
2543 printk(KERN_INFO "%s: open: Could not find a valid PHY.\n", 2585 printk(KERN_INFO "%s: open: Could not find a valid PHY.\n",
2544 pci_name(pci_dev)); 2586 pci_name(pci_dev));
2545 } 2587 goto out_freering;
2546
2547 if (i != 32) {
2548 /* reset it */
2549 phy_init(dev);
2550 } 2588 }
2589
2590 /* reset it */
2591 phy_init(dev);
2551 2592
2552 /* set default link speed settings */ 2593 /* set default link speed settings */
2553 np->linkspeed = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; 2594 np->linkspeed = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
@@ -2689,6 +2730,10 @@ static void __exit exit_nic(void)
2689 2730
2690module_param(max_interrupt_work, int, 0); 2731module_param(max_interrupt_work, int, 0);
2691MODULE_PARM_DESC(max_interrupt_work, "forcedeth maximum events handled per interrupt"); 2732MODULE_PARM_DESC(max_interrupt_work, "forcedeth maximum events handled per interrupt");
2733module_param(optimization_mode, int, 0);
2734MODULE_PARM_DESC(optimization_mode, "In throughput mode (0), every tx & rx packet will generate an interrupt. In CPU mode (1), interrupts are controlled by a timer.");
2735module_param(poll_interval, int, 0);
2736MODULE_PARM_DESC(poll_interval, "Interval determines how frequent timer interrupt is generated by [(time_in_micro_secs * 100) / (2^10)]. Min is 0 and Max is 65535.");
2692 2737
2693MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>"); 2738MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>");
2694MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver"); 2739MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver");
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 54d294ad6df5..e3a329539f1c 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -126,8 +126,8 @@ static irqreturn_t gfar_interrupt(int irq, void *dev_id, struct pt_regs *regs);
126static void adjust_link(struct net_device *dev); 126static void adjust_link(struct net_device *dev);
127static void init_registers(struct net_device *dev); 127static void init_registers(struct net_device *dev);
128static int init_phy(struct net_device *dev); 128static int init_phy(struct net_device *dev);
129static int gfar_probe(struct device *device); 129static int gfar_probe(struct platform_device *pdev);
130static int gfar_remove(struct device *device); 130static int gfar_remove(struct platform_device *pdev);
131static void free_skb_resources(struct gfar_private *priv); 131static void free_skb_resources(struct gfar_private *priv);
132static void gfar_set_multi(struct net_device *dev); 132static void gfar_set_multi(struct net_device *dev);
133static void gfar_set_hash_for_addr(struct net_device *dev, u8 *addr); 133static void gfar_set_hash_for_addr(struct net_device *dev, u8 *addr);
@@ -156,12 +156,11 @@ int gfar_uses_fcb(struct gfar_private *priv)
156 156
157/* Set up the ethernet device structure, private data, 157/* Set up the ethernet device structure, private data,
158 * and anything else we need before we start */ 158 * and anything else we need before we start */
159static int gfar_probe(struct device *device) 159static int gfar_probe(struct platform_device *pdev)
160{ 160{
161 u32 tempval; 161 u32 tempval;
162 struct net_device *dev = NULL; 162 struct net_device *dev = NULL;
163 struct gfar_private *priv = NULL; 163 struct gfar_private *priv = NULL;
164 struct platform_device *pdev = to_platform_device(device);
165 struct gianfar_platform_data *einfo; 164 struct gianfar_platform_data *einfo;
166 struct resource *r; 165 struct resource *r;
167 int idx; 166 int idx;
@@ -208,7 +207,7 @@ static int gfar_probe(struct device *device)
208 207
209 spin_lock_init(&priv->lock); 208 spin_lock_init(&priv->lock);
210 209
211 dev_set_drvdata(device, dev); 210 platform_set_drvdata(pdev, dev);
212 211
213 /* Stop the DMA engine now, in case it was running before */ 212 /* Stop the DMA engine now, in case it was running before */
214 /* (The firmware could have used it, and left it running). */ 213 /* (The firmware could have used it, and left it running). */
@@ -245,7 +244,7 @@ static int gfar_probe(struct device *device)
245 dev->base_addr = (unsigned long) (priv->regs); 244 dev->base_addr = (unsigned long) (priv->regs);
246 245
247 SET_MODULE_OWNER(dev); 246 SET_MODULE_OWNER(dev);
248 SET_NETDEV_DEV(dev, device); 247 SET_NETDEV_DEV(dev, &pdev->dev);
249 248
250 /* Fill in the dev structure */ 249 /* Fill in the dev structure */
251 dev->open = gfar_enet_open; 250 dev->open = gfar_enet_open;
@@ -377,12 +376,12 @@ regs_fail:
377 return err; 376 return err;
378} 377}
379 378
380static int gfar_remove(struct device *device) 379static int gfar_remove(struct platform_device *pdev)
381{ 380{
382 struct net_device *dev = dev_get_drvdata(device); 381 struct net_device *dev = platform_get_drvdata(pdev);
383 struct gfar_private *priv = netdev_priv(dev); 382 struct gfar_private *priv = netdev_priv(dev);
384 383
385 dev_set_drvdata(device, NULL); 384 platform_set_drvdata(pdev, NULL);
386 385
387 iounmap((void *) priv->regs); 386 iounmap((void *) priv->regs);
388 free_netdev(dev); 387 free_netdev(dev);
@@ -1861,11 +1860,12 @@ static irqreturn_t gfar_error(int irq, void *dev_id, struct pt_regs *regs)
1861} 1860}
1862 1861
1863/* Structure for a device driver */ 1862/* Structure for a device driver */
1864static struct device_driver gfar_driver = { 1863static struct platform_driver gfar_driver = {
1865 .name = "fsl-gianfar",
1866 .bus = &platform_bus_type,
1867 .probe = gfar_probe, 1864 .probe = gfar_probe,
1868 .remove = gfar_remove, 1865 .remove = gfar_remove,
1866 .driver = {
1867 .name = "fsl-gianfar",
1868 },
1869}; 1869};
1870 1870
1871static int __init gfar_init(void) 1871static int __init gfar_init(void)
@@ -1875,7 +1875,7 @@ static int __init gfar_init(void)
1875 if (err) 1875 if (err)
1876 return err; 1876 return err;
1877 1877
1878 err = driver_register(&gfar_driver); 1878 err = platform_driver_register(&gfar_driver);
1879 1879
1880 if (err) 1880 if (err)
1881 gfar_mdio_exit(); 1881 gfar_mdio_exit();
@@ -1885,7 +1885,7 @@ static int __init gfar_init(void)
1885 1885
1886static void __exit gfar_exit(void) 1886static void __exit gfar_exit(void)
1887{ 1887{
1888 driver_unregister(&gfar_driver); 1888 platform_driver_unregister(&gfar_driver);
1889 gfar_mdio_exit(); 1889 gfar_mdio_exit();
1890} 1890}
1891 1891
diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c
index 7263395d78bb..9544279e8bcd 100644
--- a/drivers/net/gianfar_mii.c
+++ b/drivers/net/gianfar_mii.c
@@ -133,7 +133,7 @@ int gfar_mdio_probe(struct device *dev)
133 if (NULL == dev) 133 if (NULL == dev)
134 return -EINVAL; 134 return -EINVAL;
135 135
136 new_bus = kmalloc(sizeof(struct mii_bus), GFP_KERNEL); 136 new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
137 137
138 if (NULL == new_bus) 138 if (NULL == new_bus)
139 return -ENOMEM; 139 return -ENOMEM;
diff --git a/drivers/net/gt96100eth.c b/drivers/net/gt96100eth.c
index 666cfbbcf6d9..5958a6314723 100644
--- a/drivers/net/gt96100eth.c
+++ b/drivers/net/gt96100eth.c
@@ -72,8 +72,6 @@ static void dump_tx_desc(int dbg_lvl, struct net_device *dev, int i);
72static void dump_rx_desc(int dbg_lvl, struct net_device *dev, int i); 72static void dump_rx_desc(int dbg_lvl, struct net_device *dev, int i);
73static void dump_skb(int dbg_lvl, struct net_device *dev, 73static void dump_skb(int dbg_lvl, struct net_device *dev,
74 struct sk_buff *skb); 74 struct sk_buff *skb);
75static void dump_hw_addr(int dbg_lvl, struct net_device *dev,
76 const char* pfx, unsigned char* addr_str);
77static void update_stats(struct gt96100_private *gp); 75static void update_stats(struct gt96100_private *gp);
78static void abort(struct net_device *dev, u32 abort_bits); 76static void abort(struct net_device *dev, u32 abort_bits);
79static void hard_stop(struct net_device *dev); 77static void hard_stop(struct net_device *dev);
@@ -334,13 +332,13 @@ dump_MII(int dbg_lvl, struct net_device *dev)
334 332
335static void 333static void
336dump_hw_addr(int dbg_lvl, struct net_device *dev, const char* pfx, 334dump_hw_addr(int dbg_lvl, struct net_device *dev, const char* pfx,
337 unsigned char* addr_str) 335 const char* func, unsigned char* addr_str)
338{ 336{
339 int i; 337 int i;
340 char buf[100], octet[5]; 338 char buf[100], octet[5];
341 339
342 if (dbg_lvl <= GT96100_DEBUG) { 340 if (dbg_lvl <= GT96100_DEBUG) {
343 strcpy(buf, pfx); 341 sprintf(buf, pfx, func);
344 for (i = 0; i < 6; i++) { 342 for (i = 0; i < 6; i++) {
345 sprintf(octet, "%2.2x%s", 343 sprintf(octet, "%2.2x%s",
346 addr_str[i], i<5 ? ":" : "\n"); 344 addr_str[i], i<5 ? ":" : "\n");
@@ -708,7 +706,7 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num)
708 706
709 info("%s found at 0x%x, irq %d\n", 707 info("%s found at 0x%x, irq %d\n",
710 chip_name(gp->chip_rev), gtif->iobase, gtif->irq); 708 chip_name(gp->chip_rev), gtif->iobase, gtif->irq);
711 dump_hw_addr(0, dev, "HW Address ", dev->dev_addr); 709 dump_hw_addr(0, dev, "%s: HW Address ", __FUNCTION__, dev->dev_addr);
712 info("%s chip revision=%d\n", chip_name(gp->chip_rev), gp->chip_rev); 710 info("%s chip revision=%d\n", chip_name(gp->chip_rev), gp->chip_rev);
713 info("%s ethernet port %d\n", chip_name(gp->chip_rev), gp->port_num); 711 info("%s ethernet port %d\n", chip_name(gp->chip_rev), gp->port_num);
714 info("external PHY ID1=0x%04x, ID2=0x%04x\n", phy_id1, phy_id2); 712 info("external PHY ID1=0x%04x, ID2=0x%04x\n", phy_id1, phy_id2);
@@ -1488,7 +1486,7 @@ gt96100_set_rx_mode(struct net_device *dev)
1488 gt96100_add_hash_entry(dev, dev->dev_addr); 1486 gt96100_add_hash_entry(dev, dev->dev_addr);
1489 1487
1490 for (mcptr = dev->mc_list; mcptr; mcptr = mcptr->next) { 1488 for (mcptr = dev->mc_list; mcptr; mcptr = mcptr->next) {
1491 dump_hw_addr(2, dev, __FUNCTION__ ": addr=", 1489 dump_hw_addr(2, dev, "%s: addr=", __FUNCTION__,
1492 mcptr->dmi_addr); 1490 mcptr->dmi_addr);
1493 gt96100_add_hash_entry(dev, mcptr->dmi_addr); 1491 gt96100_add_hash_entry(dev, mcptr->dmi_addr);
1494 } 1492 }
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index be191d80ef9c..ceb98fd398af 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -58,7 +58,7 @@
58 58
59#include "ibmveth.h" 59#include "ibmveth.h"
60 60
61#define DEBUG 1 61#undef DEBUG
62 62
63#define ibmveth_printk(fmt, args...) \ 63#define ibmveth_printk(fmt, args...) \
64 printk(KERN_INFO "%s: " fmt, __FILE__, ## args) 64 printk(KERN_INFO "%s: " fmt, __FILE__, ## args)
diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c
index 76e0b9fb5e96..63d38fbbd04e 100644
--- a/drivers/net/irda/sa1100_ir.c
+++ b/drivers/net/irda/sa1100_ir.c
@@ -291,9 +291,9 @@ static void sa1100_irda_shutdown(struct sa1100_irda *si)
291/* 291/*
292 * Suspend the IrDA interface. 292 * Suspend the IrDA interface.
293 */ 293 */
294static int sa1100_irda_suspend(struct device *_dev, pm_message_t state) 294static int sa1100_irda_suspend(struct platform_device *pdev, pm_message_t state)
295{ 295{
296 struct net_device *dev = dev_get_drvdata(_dev); 296 struct net_device *dev = platform_get_drvdata(pdev);
297 struct sa1100_irda *si; 297 struct sa1100_irda *si;
298 298
299 if (!dev) 299 if (!dev)
@@ -316,9 +316,9 @@ static int sa1100_irda_suspend(struct device *_dev, pm_message_t state)
316/* 316/*
317 * Resume the IrDA interface. 317 * Resume the IrDA interface.
318 */ 318 */
319static int sa1100_irda_resume(struct device *_dev) 319static int sa1100_irda_resume(struct platform_device *pdev)
320{ 320{
321 struct net_device *dev = dev_get_drvdata(_dev); 321 struct net_device *dev = platform_get_drvdata(pdev);
322 struct sa1100_irda *si; 322 struct sa1100_irda *si;
323 323
324 if (!dev) 324 if (!dev)
@@ -886,9 +886,8 @@ static int sa1100_irda_init_iobuf(iobuff_t *io, int size)
886 return io->head ? 0 : -ENOMEM; 886 return io->head ? 0 : -ENOMEM;
887} 887}
888 888
889static int sa1100_irda_probe(struct device *_dev) 889static int sa1100_irda_probe(struct platform_device *pdev)
890{ 890{
891 struct platform_device *pdev = to_platform_device(_dev);
892 struct net_device *dev; 891 struct net_device *dev;
893 struct sa1100_irda *si; 892 struct sa1100_irda *si;
894 unsigned int baudrate_mask; 893 unsigned int baudrate_mask;
@@ -967,7 +966,7 @@ static int sa1100_irda_probe(struct device *_dev)
967 966
968 err = register_netdev(dev); 967 err = register_netdev(dev);
969 if (err == 0) 968 if (err == 0)
970 dev_set_drvdata(&pdev->dev, dev); 969 platform_set_drvdata(pdev, dev);
971 970
972 if (err) { 971 if (err) {
973 err_mem_5: 972 err_mem_5:
@@ -985,9 +984,9 @@ static int sa1100_irda_probe(struct device *_dev)
985 return err; 984 return err;
986} 985}
987 986
988static int sa1100_irda_remove(struct device *_dev) 987static int sa1100_irda_remove(struct platform_device *pdev)
989{ 988{
990 struct net_device *dev = dev_get_drvdata(_dev); 989 struct net_device *dev = platform_get_drvdata(pdev);
991 990
992 if (dev) { 991 if (dev) {
993 struct sa1100_irda *si = dev->priv; 992 struct sa1100_irda *si = dev->priv;
@@ -1004,13 +1003,14 @@ static int sa1100_irda_remove(struct device *_dev)
1004 return 0; 1003 return 0;
1005} 1004}
1006 1005
1007static struct device_driver sa1100ir_driver = { 1006static struct platform_driver sa1100ir_driver = {
1008 .name = "sa11x0-ir",
1009 .bus = &platform_bus_type,
1010 .probe = sa1100_irda_probe, 1007 .probe = sa1100_irda_probe,
1011 .remove = sa1100_irda_remove, 1008 .remove = sa1100_irda_remove,
1012 .suspend = sa1100_irda_suspend, 1009 .suspend = sa1100_irda_suspend,
1013 .resume = sa1100_irda_resume, 1010 .resume = sa1100_irda_resume,
1011 .driver = {
1012 .name = "sa11x0-ir",
1013 },
1014}; 1014};
1015 1015
1016static int __init sa1100_irda_init(void) 1016static int __init sa1100_irda_init(void)
@@ -1023,12 +1023,12 @@ static int __init sa1100_irda_init(void)
1023 if (power_level > 3) 1023 if (power_level > 3)
1024 power_level = 3; 1024 power_level = 3;
1025 1025
1026 return driver_register(&sa1100ir_driver); 1026 return platform_driver_register(&sa1100ir_driver);
1027} 1027}
1028 1028
1029static void __exit sa1100_irda_exit(void) 1029static void __exit sa1100_irda_exit(void)
1030{ 1030{
1031 driver_unregister(&sa1100ir_driver); 1031 platform_driver_unregister(&sa1100ir_driver);
1032} 1032}
1033 1033
1034module_init(sa1100_irda_init); 1034module_init(sa1100_irda_init);
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index a1d207f2fa68..ec94ecdb103d 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -214,14 +214,15 @@ static int smsc_ircc_probe_transceiver_smsc_ircc_atc(int fir_base);
214 214
215/* Power Management */ 215/* Power Management */
216 216
217static int smsc_ircc_suspend(struct device *dev, pm_message_t state); 217static int smsc_ircc_suspend(struct platform_device *dev, pm_message_t state);
218static int smsc_ircc_resume(struct device *dev); 218static int smsc_ircc_resume(struct platform_device *dev);
219 219
220static struct device_driver smsc_ircc_driver = { 220static struct platform_driver smsc_ircc_driver = {
221 .name = SMSC_IRCC2_DRIVER_NAME,
222 .bus = &platform_bus_type,
223 .suspend = smsc_ircc_suspend, 221 .suspend = smsc_ircc_suspend,
224 .resume = smsc_ircc_resume, 222 .resume = smsc_ircc_resume,
223 .driver = {
224 .name = SMSC_IRCC2_DRIVER_NAME,
225 },
225}; 226};
226 227
227/* Transceivers for SMSC-ircc */ 228/* Transceivers for SMSC-ircc */
@@ -346,7 +347,7 @@ static int __init smsc_ircc_init(void)
346 347
347 IRDA_DEBUG(1, "%s\n", __FUNCTION__); 348 IRDA_DEBUG(1, "%s\n", __FUNCTION__);
348 349
349 ret = driver_register(&smsc_ircc_driver); 350 ret = platform_driver_register(&smsc_ircc_driver);
350 if (ret) { 351 if (ret) {
351 IRDA_ERROR("%s, Can't register driver!\n", driver_name); 352 IRDA_ERROR("%s, Can't register driver!\n", driver_name);
352 return ret; 353 return ret;
@@ -378,7 +379,7 @@ static int __init smsc_ircc_init(void)
378 } 379 }
379 380
380 if (ret) 381 if (ret)
381 driver_unregister(&smsc_ircc_driver); 382 platform_driver_unregister(&smsc_ircc_driver);
382 383
383 return ret; 384 return ret;
384} 385}
@@ -491,7 +492,7 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u
491 err = PTR_ERR(self->pldev); 492 err = PTR_ERR(self->pldev);
492 goto err_out5; 493 goto err_out5;
493 } 494 }
494 dev_set_drvdata(&self->pldev->dev, self); 495 platform_set_drvdata(self->pldev, self);
495 496
496 IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); 497 IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name);
497 dev_count++; 498 dev_count++;
@@ -1685,9 +1686,9 @@ static int smsc_ircc_net_close(struct net_device *dev)
1685 return 0; 1686 return 0;
1686} 1687}
1687 1688
1688static int smsc_ircc_suspend(struct device *dev, pm_message_t state) 1689static int smsc_ircc_suspend(struct platform_device *dev, pm_message_t state)
1689{ 1690{
1690 struct smsc_ircc_cb *self = dev_get_drvdata(dev); 1691 struct smsc_ircc_cb *self = platform_get_drvdata(dev);
1691 1692
1692 if (!self->io.suspended) { 1693 if (!self->io.suspended) {
1693 IRDA_DEBUG(1, "%s, Suspending\n", driver_name); 1694 IRDA_DEBUG(1, "%s, Suspending\n", driver_name);
@@ -1706,9 +1707,9 @@ static int smsc_ircc_suspend(struct device *dev, pm_message_t state)
1706 return 0; 1707 return 0;
1707} 1708}
1708 1709
1709static int smsc_ircc_resume(struct device *dev) 1710static int smsc_ircc_resume(struct platform_device *dev)
1710{ 1711{
1711 struct smsc_ircc_cb *self = dev_get_drvdata(dev); 1712 struct smsc_ircc_cb *self = platform_get_drvdata(dev);
1712 1713
1713 if (self->io.suspended) { 1714 if (self->io.suspended) {
1714 IRDA_DEBUG(1, "%s, Waking up\n", driver_name); 1715 IRDA_DEBUG(1, "%s, Waking up\n", driver_name);
@@ -1788,7 +1789,7 @@ static void __exit smsc_ircc_cleanup(void)
1788 smsc_ircc_close(dev_self[i]); 1789 smsc_ircc_close(dev_self[i]);
1789 } 1790 }
1790 1791
1791 driver_unregister(&smsc_ircc_driver); 1792 platform_driver_unregister(&smsc_ircc_driver);
1792} 1793}
1793 1794
1794/* 1795/*
diff --git a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c
index 2fb3101cb33e..b039bd89ceb9 100644
--- a/drivers/net/jazzsonic.c
+++ b/drivers/net/jazzsonic.c
@@ -194,7 +194,7 @@ out:
194 * Probe for a SONIC ethernet controller on a Mips Jazz board. 194 * Probe for a SONIC ethernet controller on a Mips Jazz board.
195 * Actually probing is superfluous but we're paranoid. 195 * Actually probing is superfluous but we're paranoid.
196 */ 196 */
197static int __init jazz_sonic_probe(struct device *device) 197static int __init jazz_sonic_probe(struct platform_device *pdev)
198{ 198{
199 struct net_device *dev; 199 struct net_device *dev;
200 struct sonic_local *lp; 200 struct sonic_local *lp;
@@ -212,8 +212,8 @@ static int __init jazz_sonic_probe(struct device *device)
212 return -ENOMEM; 212 return -ENOMEM;
213 213
214 lp = netdev_priv(dev); 214 lp = netdev_priv(dev);
215 lp->device = device; 215 lp->device = &pdev->dev;
216 SET_NETDEV_DEV(dev, device); 216 SET_NETDEV_DEV(dev, &pdev->dev);
217 SET_MODULE_OWNER(dev); 217 SET_MODULE_OWNER(dev);
218 218
219 netdev_boot_setup_check(dev); 219 netdev_boot_setup_check(dev);
@@ -264,9 +264,9 @@ MODULE_PARM_DESC(sonic_debug, "jazzsonic debug level (1-4)");
264 264
265#include "sonic.c" 265#include "sonic.c"
266 266
267static int __devexit jazz_sonic_device_remove (struct device *device) 267static int __devexit jazz_sonic_device_remove (struct platform_device *pdev)
268{ 268{
269 struct net_device *dev = device->driver_data; 269 struct net_device *dev = platform_get_drvdata(pdev);
270 struct sonic_local* lp = netdev_priv(dev); 270 struct sonic_local* lp = netdev_priv(dev);
271 271
272 unregister_netdev (dev); 272 unregister_netdev (dev);
@@ -278,18 +278,19 @@ static int __devexit jazz_sonic_device_remove (struct device *device)
278 return 0; 278 return 0;
279} 279}
280 280
281static struct device_driver jazz_sonic_driver = { 281static struct platform_driver jazz_sonic_driver = {
282 .name = jazz_sonic_string,
283 .bus = &platform_bus_type,
284 .probe = jazz_sonic_probe, 282 .probe = jazz_sonic_probe,
285 .remove = __devexit_p(jazz_sonic_device_remove), 283 .remove = __devexit_p(jazz_sonic_device_remove),
284 .driver = {
285 .name = jazz_sonic_string,
286 },
286}; 287};
287 288
288static int __init jazz_sonic_init_module(void) 289static int __init jazz_sonic_init_module(void)
289{ 290{
290 int err; 291 int err;
291 292
292 if ((err = driver_register(&jazz_sonic_driver))) { 293 if ((err = platform_driver_register(&jazz_sonic_driver))) {
293 printk(KERN_ERR "Driver registration failed\n"); 294 printk(KERN_ERR "Driver registration failed\n");
294 return err; 295 return err;
295 } 296 }
@@ -313,7 +314,7 @@ out_unregister:
313 314
314static void __exit jazz_sonic_cleanup_module(void) 315static void __exit jazz_sonic_cleanup_module(void)
315{ 316{
316 driver_unregister(&jazz_sonic_driver); 317 platform_driver_unregister(&jazz_sonic_driver);
317 318
318 if (jazz_sonic_device) { 319 if (jazz_sonic_device) {
319 platform_device_unregister(jazz_sonic_device); 320 platform_device_unregister(jazz_sonic_device);
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index 9ef4592aca03..02d5c6822733 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -525,7 +525,7 @@ int __init mac_nubus_sonic_probe(struct net_device* dev)
525 return macsonic_init(dev); 525 return macsonic_init(dev);
526} 526}
527 527
528static int __init mac_sonic_probe(struct device *device) 528static int __init mac_sonic_probe(struct platform_device *device)
529{ 529{
530 struct net_device *dev; 530 struct net_device *dev;
531 struct sonic_local *lp; 531 struct sonic_local *lp;
@@ -537,8 +537,8 @@ static int __init mac_sonic_probe(struct device *device)
537 return -ENOMEM; 537 return -ENOMEM;
538 538
539 lp = netdev_priv(dev); 539 lp = netdev_priv(dev);
540 lp->device = device; 540 lp->device = &device->dev;
541 SET_NETDEV_DEV(dev, device); 541 SET_NETDEV_DEV(dev, &device->dev);
542 SET_MODULE_OWNER(dev); 542 SET_MODULE_OWNER(dev);
543 543
544 /* This will catch fatal stuff like -ENOMEM as well as success */ 544 /* This will catch fatal stuff like -ENOMEM as well as success */
@@ -579,9 +579,9 @@ MODULE_PARM_DESC(sonic_debug, "macsonic debug level (1-4)");
579 579
580#include "sonic.c" 580#include "sonic.c"
581 581
582static int __devexit mac_sonic_device_remove (struct device *device) 582static int __devexit mac_sonic_device_remove (struct platform_device *device)
583{ 583{
584 struct net_device *dev = device->driver_data; 584 struct net_device *dev = platform_get_drvdata(device);
585 struct sonic_local* lp = netdev_priv(dev); 585 struct sonic_local* lp = netdev_priv(dev);
586 586
587 unregister_netdev (dev); 587 unregister_netdev (dev);
@@ -592,18 +592,19 @@ static int __devexit mac_sonic_device_remove (struct device *device)
592 return 0; 592 return 0;
593} 593}
594 594
595static struct device_driver mac_sonic_driver = { 595static struct platform_driver mac_sonic_driver = {
596 .name = mac_sonic_string,
597 .bus = &platform_bus_type,
598 .probe = mac_sonic_probe, 596 .probe = mac_sonic_probe,
599 .remove = __devexit_p(mac_sonic_device_remove), 597 .remove = __devexit_p(mac_sonic_device_remove),
598 .driver = {
599 .name = mac_sonic_string,
600 },
600}; 601};
601 602
602static int __init mac_sonic_init_module(void) 603static int __init mac_sonic_init_module(void)
603{ 604{
604 int err; 605 int err;
605 606
606 if ((err = driver_register(&mac_sonic_driver))) { 607 if ((err = platform_driver_register(&mac_sonic_driver))) {
607 printk(KERN_ERR "Driver registration failed\n"); 608 printk(KERN_ERR "Driver registration failed\n");
608 return err; 609 return err;
609 } 610 }
@@ -628,7 +629,7 @@ out_unregister:
628 629
629static void __exit mac_sonic_cleanup_module(void) 630static void __exit mac_sonic_cleanup_module(void)
630{ 631{
631 driver_unregister(&mac_sonic_driver); 632 platform_driver_unregister(&mac_sonic_driver);
632 633
633 if (mac_sonic_device) { 634 if (mac_sonic_device) {
634 platform_device_unregister(mac_sonic_device); 635 platform_device_unregister(mac_sonic_device);
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 71f2c6705bc3..3cb9b3fe0cf1 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1387,9 +1387,8 @@ static void mv643xx_netpoll(struct net_device *netdev)
1387 * Input : struct device * 1387 * Input : struct device *
1388 * Output : -ENOMEM if failed , 0 if success 1388 * Output : -ENOMEM if failed , 0 if success
1389 */ 1389 */
1390static int mv643xx_eth_probe(struct device *ddev) 1390static int mv643xx_eth_probe(struct platform_device *pdev)
1391{ 1391{
1392 struct platform_device *pdev = to_platform_device(ddev);
1393 struct mv643xx_eth_platform_data *pd; 1392 struct mv643xx_eth_platform_data *pd;
1394 int port_num = pdev->id; 1393 int port_num = pdev->id;
1395 struct mv643xx_private *mp; 1394 struct mv643xx_private *mp;
@@ -1402,7 +1401,7 @@ static int mv643xx_eth_probe(struct device *ddev)
1402 if (!dev) 1401 if (!dev)
1403 return -ENOMEM; 1402 return -ENOMEM;
1404 1403
1405 dev_set_drvdata(ddev, dev); 1404 platform_set_drvdata(pdev, dev);
1406 1405
1407 mp = netdev_priv(dev); 1406 mp = netdev_priv(dev);
1408 1407
@@ -1546,21 +1545,20 @@ out:
1546 return err; 1545 return err;
1547} 1546}
1548 1547
1549static int mv643xx_eth_remove(struct device *ddev) 1548static int mv643xx_eth_remove(struct platform_device *pdev)
1550{ 1549{
1551 struct net_device *dev = dev_get_drvdata(ddev); 1550 struct net_device *dev = platform_get_drvdata(pdev);
1552 1551
1553 unregister_netdev(dev); 1552 unregister_netdev(dev);
1554 flush_scheduled_work(); 1553 flush_scheduled_work();
1555 1554
1556 free_netdev(dev); 1555 free_netdev(dev);
1557 dev_set_drvdata(ddev, NULL); 1556 platform_set_drvdata(pdev, NULL);
1558 return 0; 1557 return 0;
1559} 1558}
1560 1559
1561static int mv643xx_eth_shared_probe(struct device *ddev) 1560static int mv643xx_eth_shared_probe(struct platform_device *pdev)
1562{ 1561{
1563 struct platform_device *pdev = to_platform_device(ddev);
1564 struct resource *res; 1562 struct resource *res;
1565 1563
1566 printk(KERN_NOTICE "MV-643xx 10/100/1000 Ethernet Driver\n"); 1564 printk(KERN_NOTICE "MV-643xx 10/100/1000 Ethernet Driver\n");
@@ -1578,7 +1576,7 @@ static int mv643xx_eth_shared_probe(struct device *ddev)
1578 1576
1579} 1577}
1580 1578
1581static int mv643xx_eth_shared_remove(struct device *ddev) 1579static int mv643xx_eth_shared_remove(struct platform_device *pdev)
1582{ 1580{
1583 iounmap(mv643xx_eth_shared_base); 1581 iounmap(mv643xx_eth_shared_base);
1584 mv643xx_eth_shared_base = NULL; 1582 mv643xx_eth_shared_base = NULL;
@@ -1586,18 +1584,20 @@ static int mv643xx_eth_shared_remove(struct device *ddev)
1586 return 0; 1584 return 0;
1587} 1585}
1588 1586
1589static struct device_driver mv643xx_eth_driver = { 1587static struct platform_driver mv643xx_eth_driver = {
1590 .name = MV643XX_ETH_NAME,
1591 .bus = &platform_bus_type,
1592 .probe = mv643xx_eth_probe, 1588 .probe = mv643xx_eth_probe,
1593 .remove = mv643xx_eth_remove, 1589 .remove = mv643xx_eth_remove,
1590 .driver = {
1591 .name = MV643XX_ETH_NAME,
1592 },
1594}; 1593};
1595 1594
1596static struct device_driver mv643xx_eth_shared_driver = { 1595static struct platform_driver mv643xx_eth_shared_driver = {
1597 .name = MV643XX_ETH_SHARED_NAME,
1598 .bus = &platform_bus_type,
1599 .probe = mv643xx_eth_shared_probe, 1596 .probe = mv643xx_eth_shared_probe,
1600 .remove = mv643xx_eth_shared_remove, 1597 .remove = mv643xx_eth_shared_remove,
1598 .driver = {
1599 .name = MV643XX_ETH_SHARED_NAME,
1600 },
1601}; 1601};
1602 1602
1603/* 1603/*
@@ -1613,11 +1613,11 @@ static int __init mv643xx_init_module(void)
1613{ 1613{
1614 int rc; 1614 int rc;
1615 1615
1616 rc = driver_register(&mv643xx_eth_shared_driver); 1616 rc = platform_driver_register(&mv643xx_eth_shared_driver);
1617 if (!rc) { 1617 if (!rc) {
1618 rc = driver_register(&mv643xx_eth_driver); 1618 rc = platform_driver_register(&mv643xx_eth_driver);
1619 if (rc) 1619 if (rc)
1620 driver_unregister(&mv643xx_eth_shared_driver); 1620 platform_driver_unregister(&mv643xx_eth_shared_driver);
1621 } 1621 }
1622 return rc; 1622 return rc;
1623} 1623}
@@ -1633,8 +1633,8 @@ static int __init mv643xx_init_module(void)
1633 */ 1633 */
1634static void __exit mv643xx_cleanup_module(void) 1634static void __exit mv643xx_cleanup_module(void)
1635{ 1635{
1636 driver_unregister(&mv643xx_eth_driver); 1636 platform_driver_unregister(&mv643xx_eth_driver);
1637 driver_unregister(&mv643xx_eth_shared_driver); 1637 platform_driver_unregister(&mv643xx_eth_shared_driver);
1638} 1638}
1639 1639
1640module_init(mv643xx_init_module); 1640module_init(mv643xx_init_module);
diff --git a/drivers/net/saa9730.c b/drivers/net/saa9730.c
index 110e777f206e..b2acedbefa8f 100644
--- a/drivers/net/saa9730.c
+++ b/drivers/net/saa9730.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * Carsten Langgaard, carstenl@mips.com 2 * Copyright (C) 2000, 2005 MIPS Technologies, Inc. All rights reserved.
3 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. 3 * Authors: Carsten Langgaard <carstenl@mips.com>
4 * 4 * Maciej W. Rozycki <macro@mips.com>
5 * ######################################################################## 5 * Copyright (C) 2004 Ralf Baechle <ralf@linux-mips.org>
6 * 6 *
7 * This program is free software; you can distribute it and/or modify it 7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as 8 * under the terms of the GNU General Public License (Version 2) as
@@ -17,15 +17,13 @@
17 * with this program; if not, write to the Free Software Foundation, Inc., 17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 * 19 *
20 * ########################################################################
21 *
22 * SAA9730 ethernet driver. 20 * SAA9730 ethernet driver.
23 * 21 *
24 * Changes: 22 * Changes:
25 * Angelo Dell'Aera <buffer@antifork.org> : Conversion to the new PCI API (pci_driver). 23 * Angelo Dell'Aera <buffer@antifork.org> : Conversion to the new PCI API
26 * Conversion to spinlocks. 24 * (pci_driver).
27 * Error handling fixes. 25 * Conversion to spinlocks.
28 * 26 * Error handling fixes.
29 */ 27 */
30 28
31#include <linux/init.h> 29#include <linux/init.h>
@@ -36,8 +34,11 @@
36#include <linux/skbuff.h> 34#include <linux/skbuff.h>
37#include <linux/pci.h> 35#include <linux/pci.h>
38#include <linux/spinlock.h> 36#include <linux/spinlock.h>
37#include <linux/types.h>
39 38
40#include <asm/addrspace.h> 39#include <asm/addrspace.h>
40#include <asm/io.h>
41
41#include <asm/mips-boards/prom.h> 42#include <asm/mips-boards/prom.h>
42 43
43#include "saa9730.h" 44#include "saa9730.h"
@@ -51,8 +52,8 @@ int lan_saa9730_debug;
51#define DRV_MODULE_NAME "saa9730" 52#define DRV_MODULE_NAME "saa9730"
52 53
53static struct pci_device_id saa9730_pci_tbl[] = { 54static struct pci_device_id saa9730_pci_tbl[] = {
54 { PCI_VENDOR_ID_PHILIPS, PCI_DEVICE_ID_PHILIPS_SAA9370, 55 { PCI_VENDOR_ID_PHILIPS, PCI_DEVICE_ID_PHILIPS_SAA9730,
55 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, 56 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
56 { 0, } 57 { 0, }
57}; 58};
58 59
@@ -61,50 +62,48 @@ MODULE_DEVICE_TABLE(pci, saa9730_pci_tbl);
61/* Non-zero only if the current card is a PCI with BIOS-set IRQ. */ 62/* Non-zero only if the current card is a PCI with BIOS-set IRQ. */
62static unsigned int pci_irq_line; 63static unsigned int pci_irq_line;
63 64
64#define INL(a) inl((unsigned long)a)
65#define OUTL(x,a) outl(x,(unsigned long)a)
66
67static void evm_saa9730_enable_lan_int(struct lan_saa9730_private *lp) 65static void evm_saa9730_enable_lan_int(struct lan_saa9730_private *lp)
68{ 66{
69 OUTL(INL(&lp->evm_saa9730_regs->InterruptBlock1) | EVM_LAN_INT, 67 outl(readl(&lp->evm_saa9730_regs->InterruptBlock1) | EVM_LAN_INT,
70 &lp->evm_saa9730_regs->InterruptBlock1); 68 &lp->evm_saa9730_regs->InterruptBlock1);
71 OUTL(INL(&lp->evm_saa9730_regs->InterruptStatus1) | EVM_LAN_INT, 69 outl(readl(&lp->evm_saa9730_regs->InterruptStatus1) | EVM_LAN_INT,
72 &lp->evm_saa9730_regs->InterruptStatus1); 70 &lp->evm_saa9730_regs->InterruptStatus1);
73 OUTL(INL(&lp->evm_saa9730_regs->InterruptEnable1) | EVM_LAN_INT | 71 outl(readl(&lp->evm_saa9730_regs->InterruptEnable1) | EVM_LAN_INT |
74 EVM_MASTER_EN, &lp->evm_saa9730_regs->InterruptEnable1); 72 EVM_MASTER_EN, &lp->evm_saa9730_regs->InterruptEnable1);
75} 73}
74
76static void evm_saa9730_disable_lan_int(struct lan_saa9730_private *lp) 75static void evm_saa9730_disable_lan_int(struct lan_saa9730_private *lp)
77{ 76{
78 OUTL(INL(&lp->evm_saa9730_regs->InterruptBlock1) & ~EVM_LAN_INT, 77 outl(readl(&lp->evm_saa9730_regs->InterruptBlock1) & ~EVM_LAN_INT,
79 &lp->evm_saa9730_regs->InterruptBlock1); 78 &lp->evm_saa9730_regs->InterruptBlock1);
80 OUTL(INL(&lp->evm_saa9730_regs->InterruptEnable1) & ~EVM_LAN_INT, 79 outl(readl(&lp->evm_saa9730_regs->InterruptEnable1) & ~EVM_LAN_INT,
81 &lp->evm_saa9730_regs->InterruptEnable1); 80 &lp->evm_saa9730_regs->InterruptEnable1);
82} 81}
83 82
84static void evm_saa9730_clear_lan_int(struct lan_saa9730_private *lp) 83static void evm_saa9730_clear_lan_int(struct lan_saa9730_private *lp)
85{ 84{
86 OUTL(EVM_LAN_INT, &lp->evm_saa9730_regs->InterruptStatus1); 85 outl(EVM_LAN_INT, &lp->evm_saa9730_regs->InterruptStatus1);
87} 86}
88 87
89static void evm_saa9730_block_lan_int(struct lan_saa9730_private *lp) 88static void evm_saa9730_block_lan_int(struct lan_saa9730_private *lp)
90{ 89{
91 OUTL(INL(&lp->evm_saa9730_regs->InterruptBlock1) & ~EVM_LAN_INT, 90 outl(readl(&lp->evm_saa9730_regs->InterruptBlock1) & ~EVM_LAN_INT,
92 &lp->evm_saa9730_regs->InterruptBlock1); 91 &lp->evm_saa9730_regs->InterruptBlock1);
93} 92}
94 93
95static void evm_saa9730_unblock_lan_int(struct lan_saa9730_private *lp) 94static void evm_saa9730_unblock_lan_int(struct lan_saa9730_private *lp)
96{ 95{
97 OUTL(INL(&lp->evm_saa9730_regs->InterruptBlock1) | EVM_LAN_INT, 96 outl(readl(&lp->evm_saa9730_regs->InterruptBlock1) | EVM_LAN_INT,
98 &lp->evm_saa9730_regs->InterruptBlock1); 97 &lp->evm_saa9730_regs->InterruptBlock1);
99} 98}
100 99
101static void show_saa9730_regs(struct lan_saa9730_private *lp) 100static void __attribute_used__ show_saa9730_regs(struct lan_saa9730_private *lp)
102{ 101{
103 int i, j; 102 int i, j;
104 printk("TxmBufferA = %x\n", lp->TxmBuffer[0][0]); 103 printk("TxmBufferA = %p\n", lp->TxmBuffer[0][0]);
105 printk("TxmBufferB = %x\n", lp->TxmBuffer[1][0]); 104 printk("TxmBufferB = %p\n", lp->TxmBuffer[1][0]);
106 printk("RcvBufferA = %x\n", lp->RcvBuffer[0][0]); 105 printk("RcvBufferA = %p\n", lp->RcvBuffer[0][0]);
107 printk("RcvBufferB = %x\n", lp->RcvBuffer[1][0]); 106 printk("RcvBufferB = %p\n", lp->RcvBuffer[1][0]);
108 for (i = 0; i < LAN_SAA9730_BUFFERS; i++) { 107 for (i = 0; i < LAN_SAA9730_BUFFERS; i++) {
109 for (j = 0; j < LAN_SAA9730_TXM_Q_SIZE; j++) { 108 for (j = 0; j < LAN_SAA9730_TXM_Q_SIZE; j++) {
110 printk("TxmBuffer[%d][%d] = %x\n", i, j, 109 printk("TxmBuffer[%d][%d] = %x\n", i, j,
@@ -120,13 +119,13 @@ static void show_saa9730_regs(struct lan_saa9730_private *lp)
120 } 119 }
121 } 120 }
122 printk("lp->evm_saa9730_regs->InterruptBlock1 = %x\n", 121 printk("lp->evm_saa9730_regs->InterruptBlock1 = %x\n",
123 INL(&lp->evm_saa9730_regs->InterruptBlock1)); 122 readl(&lp->evm_saa9730_regs->InterruptBlock1));
124 printk("lp->evm_saa9730_regs->InterruptStatus1 = %x\n", 123 printk("lp->evm_saa9730_regs->InterruptStatus1 = %x\n",
125 INL(&lp->evm_saa9730_regs->InterruptStatus1)); 124 readl(&lp->evm_saa9730_regs->InterruptStatus1));
126 printk("lp->evm_saa9730_regs->InterruptEnable1 = %x\n", 125 printk("lp->evm_saa9730_regs->InterruptEnable1 = %x\n",
127 INL(&lp->evm_saa9730_regs->InterruptEnable1)); 126 readl(&lp->evm_saa9730_regs->InterruptEnable1));
128 printk("lp->lan_saa9730_regs->Ok2Use = %x\n", 127 printk("lp->lan_saa9730_regs->Ok2Use = %x\n",
129 INL(&lp->lan_saa9730_regs->Ok2Use)); 128 readl(&lp->lan_saa9730_regs->Ok2Use));
130 printk("lp->NextTxmBufferIndex = %x\n", lp->NextTxmBufferIndex); 129 printk("lp->NextTxmBufferIndex = %x\n", lp->NextTxmBufferIndex);
131 printk("lp->NextTxmPacketIndex = %x\n", lp->NextTxmPacketIndex); 130 printk("lp->NextTxmPacketIndex = %x\n", lp->NextTxmPacketIndex);
132 printk("lp->PendingTxmBufferIndex = %x\n", 131 printk("lp->PendingTxmBufferIndex = %x\n",
@@ -134,23 +133,23 @@ static void show_saa9730_regs(struct lan_saa9730_private *lp)
134 printk("lp->PendingTxmPacketIndex = %x\n", 133 printk("lp->PendingTxmPacketIndex = %x\n",
135 lp->PendingTxmPacketIndex); 134 lp->PendingTxmPacketIndex);
136 printk("lp->lan_saa9730_regs->LanDmaCtl = %x\n", 135 printk("lp->lan_saa9730_regs->LanDmaCtl = %x\n",
137 INL(&lp->lan_saa9730_regs->LanDmaCtl)); 136 readl(&lp->lan_saa9730_regs->LanDmaCtl));
138 printk("lp->lan_saa9730_regs->DmaStatus = %x\n", 137 printk("lp->lan_saa9730_regs->DmaStatus = %x\n",
139 INL(&lp->lan_saa9730_regs->DmaStatus)); 138 readl(&lp->lan_saa9730_regs->DmaStatus));
140 printk("lp->lan_saa9730_regs->CamCtl = %x\n", 139 printk("lp->lan_saa9730_regs->CamCtl = %x\n",
141 INL(&lp->lan_saa9730_regs->CamCtl)); 140 readl(&lp->lan_saa9730_regs->CamCtl));
142 printk("lp->lan_saa9730_regs->TxCtl = %x\n", 141 printk("lp->lan_saa9730_regs->TxCtl = %x\n",
143 INL(&lp->lan_saa9730_regs->TxCtl)); 142 readl(&lp->lan_saa9730_regs->TxCtl));
144 printk("lp->lan_saa9730_regs->TxStatus = %x\n", 143 printk("lp->lan_saa9730_regs->TxStatus = %x\n",
145 INL(&lp->lan_saa9730_regs->TxStatus)); 144 readl(&lp->lan_saa9730_regs->TxStatus));
146 printk("lp->lan_saa9730_regs->RxCtl = %x\n", 145 printk("lp->lan_saa9730_regs->RxCtl = %x\n",
147 INL(&lp->lan_saa9730_regs->RxCtl)); 146 readl(&lp->lan_saa9730_regs->RxCtl));
148 printk("lp->lan_saa9730_regs->RxStatus = %x\n", 147 printk("lp->lan_saa9730_regs->RxStatus = %x\n",
149 INL(&lp->lan_saa9730_regs->RxStatus)); 148 readl(&lp->lan_saa9730_regs->RxStatus));
150 for (i = 0; i < LAN_SAA9730_CAM_DWORDS; i++) { 149 for (i = 0; i < LAN_SAA9730_CAM_DWORDS; i++) {
151 OUTL(i, &lp->lan_saa9730_regs->CamAddress); 150 outl(i, &lp->lan_saa9730_regs->CamAddress);
152 printk("lp->lan_saa9730_regs->CamData = %x\n", 151 printk("lp->lan_saa9730_regs->CamData = %x\n",
153 INL(&lp->lan_saa9730_regs->CamData)); 152 readl(&lp->lan_saa9730_regs->CamData));
154 } 153 }
155 printk("lp->stats.tx_packets = %lx\n", lp->stats.tx_packets); 154 printk("lp->stats.tx_packets = %lx\n", lp->stats.tx_packets);
156 printk("lp->stats.tx_errors = %lx\n", lp->stats.tx_errors); 155 printk("lp->stats.tx_errors = %lx\n", lp->stats.tx_errors);
@@ -178,17 +177,17 @@ static void show_saa9730_regs(struct lan_saa9730_private *lp)
178 lp->stats.rx_length_errors); 177 lp->stats.rx_length_errors);
179 178
180 printk("lp->lan_saa9730_regs->DebugPCIMasterAddr = %x\n", 179 printk("lp->lan_saa9730_regs->DebugPCIMasterAddr = %x\n",
181 INL(&lp->lan_saa9730_regs->DebugPCIMasterAddr)); 180 readl(&lp->lan_saa9730_regs->DebugPCIMasterAddr));
182 printk("lp->lan_saa9730_regs->DebugLanTxStateMachine = %x\n", 181 printk("lp->lan_saa9730_regs->DebugLanTxStateMachine = %x\n",
183 INL(&lp->lan_saa9730_regs->DebugLanTxStateMachine)); 182 readl(&lp->lan_saa9730_regs->DebugLanTxStateMachine));
184 printk("lp->lan_saa9730_regs->DebugLanRxStateMachine = %x\n", 183 printk("lp->lan_saa9730_regs->DebugLanRxStateMachine = %x\n",
185 INL(&lp->lan_saa9730_regs->DebugLanRxStateMachine)); 184 readl(&lp->lan_saa9730_regs->DebugLanRxStateMachine));
186 printk("lp->lan_saa9730_regs->DebugLanTxFifoPointers = %x\n", 185 printk("lp->lan_saa9730_regs->DebugLanTxFifoPointers = %x\n",
187 INL(&lp->lan_saa9730_regs->DebugLanTxFifoPointers)); 186 readl(&lp->lan_saa9730_regs->DebugLanTxFifoPointers));
188 printk("lp->lan_saa9730_regs->DebugLanRxFifoPointers = %x\n", 187 printk("lp->lan_saa9730_regs->DebugLanRxFifoPointers = %x\n",
189 INL(&lp->lan_saa9730_regs->DebugLanRxFifoPointers)); 188 readl(&lp->lan_saa9730_regs->DebugLanRxFifoPointers));
190 printk("lp->lan_saa9730_regs->DebugLanCtlStateMachine = %x\n", 189 printk("lp->lan_saa9730_regs->DebugLanCtlStateMachine = %x\n",
191 INL(&lp->lan_saa9730_regs->DebugLanCtlStateMachine)); 190 readl(&lp->lan_saa9730_regs->DebugLanCtlStateMachine));
192} 191}
193 192
194static void lan_saa9730_buffer_init(struct lan_saa9730_private *lp) 193static void lan_saa9730_buffer_init(struct lan_saa9730_private *lp)
@@ -214,98 +213,108 @@ static void lan_saa9730_buffer_init(struct lan_saa9730_private *lp)
214 } 213 }
215} 214}
216 215
217static int lan_saa9730_allocate_buffers(struct lan_saa9730_private *lp) 216static void lan_saa9730_free_buffers(struct pci_dev *pdev,
217 struct lan_saa9730_private *lp)
218{ 218{
219 unsigned int mem_size; 219 pci_free_consistent(pdev, lp->buffer_size, lp->buffer_start,
220 void *Pa; 220 lp->dma_addr);
221 unsigned int i, j, RcvBufferSize, TxmBufferSize; 221}
222 unsigned int buffer_start;
223 222
224 /* 223static int lan_saa9730_allocate_buffers(struct pci_dev *pdev,
225 * Allocate all RX and TX packets in one chunk. 224 struct lan_saa9730_private *lp)
226 * The Rx and Tx packets must be PACKET_SIZE aligned. 225{
227 */ 226 void *Pa;
228 mem_size = ((LAN_SAA9730_RCV_Q_SIZE + LAN_SAA9730_TXM_Q_SIZE) * 227 unsigned int i, j, rxoffset, txoffset;
229 LAN_SAA9730_PACKET_SIZE * LAN_SAA9730_BUFFERS) + 228 int ret;
230 LAN_SAA9730_PACKET_SIZE;
231 buffer_start =
232 (unsigned int) kmalloc(mem_size, GFP_DMA | GFP_KERNEL);
233
234 if (!buffer_start)
235 return -ENOMEM;
236
237 /*
238 * Set DMA buffer to kseg1 (uncached).
239 * Make sure to flush before using it uncached.
240 */
241 Pa = (void *) KSEG1ADDR((buffer_start + LAN_SAA9730_PACKET_SIZE) &
242 ~(LAN_SAA9730_PACKET_SIZE - 1));
243 dma_cache_wback_inv((unsigned long) Pa, mem_size);
244 229
245 /* Initialize buffer space */ 230 /* Initialize buffer space */
246 RcvBufferSize = LAN_SAA9730_PACKET_SIZE;
247 TxmBufferSize = LAN_SAA9730_PACKET_SIZE;
248 lp->DmaRcvPackets = LAN_SAA9730_RCV_Q_SIZE; 231 lp->DmaRcvPackets = LAN_SAA9730_RCV_Q_SIZE;
249 lp->DmaTxmPackets = LAN_SAA9730_TXM_Q_SIZE; 232 lp->DmaTxmPackets = LAN_SAA9730_TXM_Q_SIZE;
250 233
234 /* Initialize Rx Buffer Index */
235 lp->NextRcvPacketIndex = 0;
236 lp->NextRcvBufferIndex = 0;
237
238 /* Set current buffer index & next available packet index */
239 lp->NextTxmPacketIndex = 0;
240 lp->NextTxmBufferIndex = 0;
241 lp->PendingTxmPacketIndex = 0;
242 lp->PendingTxmBufferIndex = 0;
243
244 /*
245 * Allocate all RX and TX packets in one chunk.
246 * The Rx and Tx packets must be PACKET_SIZE aligned.
247 */
248 lp->buffer_size = ((LAN_SAA9730_RCV_Q_SIZE + LAN_SAA9730_TXM_Q_SIZE) *
249 LAN_SAA9730_PACKET_SIZE * LAN_SAA9730_BUFFERS) +
250 LAN_SAA9730_PACKET_SIZE;
251 lp->buffer_start = pci_alloc_consistent(pdev, lp->buffer_size,
252 &lp->dma_addr);
253 if (!lp->buffer_start) {
254 ret = -ENOMEM;
255 goto out;
256 }
257
258 Pa = (void *)ALIGN((unsigned long)lp->buffer_start,
259 LAN_SAA9730_PACKET_SIZE);
260
261 rxoffset = Pa - lp->buffer_start;
262
251 /* Init RX buffers */ 263 /* Init RX buffers */
252 for (i = 0; i < LAN_SAA9730_BUFFERS; i++) { 264 for (i = 0; i < LAN_SAA9730_BUFFERS; i++) {
253 for (j = 0; j < LAN_SAA9730_RCV_Q_SIZE; j++) { 265 for (j = 0; j < LAN_SAA9730_RCV_Q_SIZE; j++) {
254 *(unsigned int *) Pa = 266 *(unsigned int *) Pa =
255 cpu_to_le32(RXSF_READY << 267 cpu_to_le32(RXSF_READY <<
256 RX_STAT_CTL_OWNER_SHF); 268 RX_STAT_CTL_OWNER_SHF);
257 lp->RcvBuffer[i][j] = (unsigned int) Pa; 269 lp->RcvBuffer[i][j] = Pa;
258 Pa += RcvBufferSize; 270 Pa += LAN_SAA9730_PACKET_SIZE;
259 } 271 }
260 } 272 }
261 273
274 txoffset = Pa - lp->buffer_start;
275
262 /* Init TX buffers */ 276 /* Init TX buffers */
263 for (i = 0; i < LAN_SAA9730_BUFFERS; i++) { 277 for (i = 0; i < LAN_SAA9730_BUFFERS; i++) {
264 for (j = 0; j < LAN_SAA9730_TXM_Q_SIZE; j++) { 278 for (j = 0; j < LAN_SAA9730_TXM_Q_SIZE; j++) {
265 *(unsigned int *) Pa = 279 *(unsigned int *) Pa =
266 cpu_to_le32(TXSF_EMPTY << 280 cpu_to_le32(TXSF_EMPTY <<
267 TX_STAT_CTL_OWNER_SHF); 281 TX_STAT_CTL_OWNER_SHF);
268 lp->TxmBuffer[i][j] = (unsigned int) Pa; 282 lp->TxmBuffer[i][j] = Pa;
269 Pa += TxmBufferSize; 283 Pa += LAN_SAA9730_PACKET_SIZE;
270 } 284 }
271 } 285 }
272 286
273 /* 287 /*
274 * Set rx buffer A and rx buffer B to point to the first two buffer 288 * Set rx buffer A and rx buffer B to point to the first two buffer
275 * spaces. 289 * spaces.
276 */ 290 */
277 OUTL(PHYSADDR(lp->RcvBuffer[0][0]), 291 outl(lp->dma_addr + rxoffset,
278 &lp->lan_saa9730_regs->RxBuffA); 292 &lp->lan_saa9730_regs->RxBuffA);
279 OUTL(PHYSADDR(lp->RcvBuffer[1][0]), 293 outl(lp->dma_addr + rxoffset +
294 LAN_SAA9730_PACKET_SIZE * LAN_SAA9730_RCV_Q_SIZE,
280 &lp->lan_saa9730_regs->RxBuffB); 295 &lp->lan_saa9730_regs->RxBuffB);
281 296
282 /* Initialize Buffer Index */ 297 /*
283 lp->NextRcvPacketIndex = 0;
284 lp->NextRcvToUseIsA = 1;
285
286 /* Set current buffer index & next availble packet index */
287 lp->NextTxmPacketIndex = 0;
288 lp->NextTxmBufferIndex = 0;
289 lp->PendingTxmPacketIndex = 0;
290 lp->PendingTxmBufferIndex = 0;
291
292 /*
293 * Set txm_buf_a and txm_buf_b to point to the first two buffer 298 * Set txm_buf_a and txm_buf_b to point to the first two buffer
294 * space 299 * space
295 */ 300 */
296 OUTL(PHYSADDR(lp->TxmBuffer[0][0]), 301 outl(lp->dma_addr + txoffset,
297 &lp->lan_saa9730_regs->TxBuffA); 302 &lp->lan_saa9730_regs->TxBuffA);
298 OUTL(PHYSADDR(lp->TxmBuffer[1][0]), 303 outl(lp->dma_addr + txoffset +
304 LAN_SAA9730_PACKET_SIZE * LAN_SAA9730_TXM_Q_SIZE,
299 &lp->lan_saa9730_regs->TxBuffB); 305 &lp->lan_saa9730_regs->TxBuffB);
300 306
301 /* Set packet number */ 307 /* Set packet number */
302 OUTL((lp->DmaRcvPackets << PK_COUNT_RX_A_SHF) | 308 outl((lp->DmaRcvPackets << PK_COUNT_RX_A_SHF) |
303 (lp->DmaRcvPackets << PK_COUNT_RX_B_SHF) | 309 (lp->DmaRcvPackets << PK_COUNT_RX_B_SHF) |
304 (lp->DmaTxmPackets << PK_COUNT_TX_A_SHF) | 310 (lp->DmaTxmPackets << PK_COUNT_TX_A_SHF) |
305 (lp->DmaTxmPackets << PK_COUNT_TX_B_SHF), 311 (lp->DmaTxmPackets << PK_COUNT_TX_B_SHF),
306 &lp->lan_saa9730_regs->PacketCount); 312 &lp->lan_saa9730_regs->PacketCount);
307 313
308 return 0; 314 return 0;
315
316out:
317 return ret;
309} 318}
310 319
311static int lan_saa9730_cam_load(struct lan_saa9730_private *lp) 320static int lan_saa9730_cam_load(struct lan_saa9730_private *lp)
@@ -317,8 +326,8 @@ static int lan_saa9730_cam_load(struct lan_saa9730_private *lp)
317 326
318 for (i = 0; i < LAN_SAA9730_CAM_DWORDS; i++) { 327 for (i = 0; i < LAN_SAA9730_CAM_DWORDS; i++) {
319 /* First set address to where data is written */ 328 /* First set address to where data is written */
320 OUTL(i, &lp->lan_saa9730_regs->CamAddress); 329 outl(i, &lp->lan_saa9730_regs->CamAddress);
321 OUTL((NetworkAddress[0] << 24) | (NetworkAddress[1] << 16) 330 outl((NetworkAddress[0] << 24) | (NetworkAddress[1] << 16)
322 | (NetworkAddress[2] << 8) | NetworkAddress[3], 331 | (NetworkAddress[2] << 8) | NetworkAddress[3],
323 &lp->lan_saa9730_regs->CamData); 332 &lp->lan_saa9730_regs->CamData);
324 NetworkAddress += 4; 333 NetworkAddress += 4;
@@ -328,8 +337,7 @@ static int lan_saa9730_cam_load(struct lan_saa9730_private *lp)
328 337
329static int lan_saa9730_cam_init(struct net_device *dev) 338static int lan_saa9730_cam_init(struct net_device *dev)
330{ 339{
331 struct lan_saa9730_private *lp = 340 struct lan_saa9730_private *lp = netdev_priv(dev);
332 (struct lan_saa9730_private *) dev->priv;
333 unsigned int i; 341 unsigned int i;
334 342
335 /* Copy MAC-address into all entries. */ 343 /* Copy MAC-address into all entries. */
@@ -347,7 +355,7 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
347 355
348 /* Check link status, spin here till station is not busy. */ 356 /* Check link status, spin here till station is not busy. */
349 i = 0; 357 i = 0;
350 while (INL(&lp->lan_saa9730_regs->StationMgmtCtl) & MD_CA_BUSY) { 358 while (readl(&lp->lan_saa9730_regs->StationMgmtCtl) & MD_CA_BUSY) {
351 i++; 359 i++;
352 if (i > 100) { 360 if (i > 100) {
353 printk("Error: lan_saa9730_mii_init: timeout\n"); 361 printk("Error: lan_saa9730_mii_init: timeout\n");
@@ -357,12 +365,12 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
357 } 365 }
358 366
359 /* Now set the control and address register. */ 367 /* Now set the control and address register. */
360 OUTL(MD_CA_BUSY | PHY_STATUS | PHY_ADDRESS << MD_CA_PHY_SHF, 368 outl(MD_CA_BUSY | PHY_STATUS | PHY_ADDRESS << MD_CA_PHY_SHF,
361 &lp->lan_saa9730_regs->StationMgmtCtl); 369 &lp->lan_saa9730_regs->StationMgmtCtl);
362 370
363 /* check link status, spin here till station is not busy */ 371 /* check link status, spin here till station is not busy */
364 i = 0; 372 i = 0;
365 while (INL(&lp->lan_saa9730_regs->StationMgmtCtl) & MD_CA_BUSY) { 373 while (readl(&lp->lan_saa9730_regs->StationMgmtCtl) & MD_CA_BUSY) {
366 i++; 374 i++;
367 if (i > 100) { 375 if (i > 100) {
368 printk("Error: lan_saa9730_mii_init: timeout\n"); 376 printk("Error: lan_saa9730_mii_init: timeout\n");
@@ -375,7 +383,7 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
375 mdelay(1); 383 mdelay(1);
376 384
377 /* Check the link status. */ 385 /* Check the link status. */
378 if (INL(&lp->lan_saa9730_regs->StationMgmtData) & 386 if (readl(&lp->lan_saa9730_regs->StationMgmtData) &
379 PHY_STATUS_LINK_UP) { 387 PHY_STATUS_LINK_UP) {
380 /* Link is up. */ 388 /* Link is up. */
381 return 0; 389 return 0;
@@ -383,14 +391,14 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
383 /* Link is down, reset the PHY first. */ 391 /* Link is down, reset the PHY first. */
384 392
385 /* set PHY address = 'CONTROL' */ 393 /* set PHY address = 'CONTROL' */
386 OUTL(PHY_ADDRESS << MD_CA_PHY_SHF | MD_CA_WR | PHY_CONTROL, 394 outl(PHY_ADDRESS << MD_CA_PHY_SHF | MD_CA_WR | PHY_CONTROL,
387 &lp->lan_saa9730_regs->StationMgmtCtl); 395 &lp->lan_saa9730_regs->StationMgmtCtl);
388 396
389 /* Wait for 1 ms. */ 397 /* Wait for 1 ms. */
390 mdelay(1); 398 mdelay(1);
391 399
392 /* set 'CONTROL' = force reset and renegotiate */ 400 /* set 'CONTROL' = force reset and renegotiate */
393 OUTL(PHY_CONTROL_RESET | PHY_CONTROL_AUTO_NEG | 401 outl(PHY_CONTROL_RESET | PHY_CONTROL_AUTO_NEG |
394 PHY_CONTROL_RESTART_AUTO_NEG, 402 PHY_CONTROL_RESTART_AUTO_NEG,
395 &lp->lan_saa9730_regs->StationMgmtData); 403 &lp->lan_saa9730_regs->StationMgmtData);
396 404
@@ -398,12 +406,12 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
398 mdelay(50); 406 mdelay(50);
399 407
400 /* set 'BUSY' to start operation */ 408 /* set 'BUSY' to start operation */
401 OUTL(MD_CA_BUSY | PHY_ADDRESS << MD_CA_PHY_SHF | MD_CA_WR | 409 outl(MD_CA_BUSY | PHY_ADDRESS << MD_CA_PHY_SHF | MD_CA_WR |
402 PHY_CONTROL, &lp->lan_saa9730_regs->StationMgmtCtl); 410 PHY_CONTROL, &lp->lan_saa9730_regs->StationMgmtCtl);
403 411
404 /* await completion */ 412 /* await completion */
405 i = 0; 413 i = 0;
406 while (INL(&lp->lan_saa9730_regs->StationMgmtCtl) & 414 while (readl(&lp->lan_saa9730_regs->StationMgmtCtl) &
407 MD_CA_BUSY) { 415 MD_CA_BUSY) {
408 i++; 416 i++;
409 if (i > 100) { 417 if (i > 100) {
@@ -419,13 +427,13 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
419 427
420 for (l = 0; l < 2; l++) { 428 for (l = 0; l < 2; l++) {
421 /* set PHY address = 'STATUS' */ 429 /* set PHY address = 'STATUS' */
422 OUTL(MD_CA_BUSY | PHY_ADDRESS << MD_CA_PHY_SHF | 430 outl(MD_CA_BUSY | PHY_ADDRESS << MD_CA_PHY_SHF |
423 PHY_STATUS, 431 PHY_STATUS,
424 &lp->lan_saa9730_regs->StationMgmtCtl); 432 &lp->lan_saa9730_regs->StationMgmtCtl);
425 433
426 /* await completion */ 434 /* await completion */
427 i = 0; 435 i = 0;
428 while (INL(&lp->lan_saa9730_regs->StationMgmtCtl) & 436 while (readl(&lp->lan_saa9730_regs->StationMgmtCtl) &
429 MD_CA_BUSY) { 437 MD_CA_BUSY) {
430 i++; 438 i++;
431 if (i > 100) { 439 if (i > 100) {
@@ -440,7 +448,7 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
440 mdelay(3000); 448 mdelay(3000);
441 449
442 /* check the link status */ 450 /* check the link status */
443 if (INL(&lp->lan_saa9730_regs->StationMgmtData) & 451 if (readl(&lp->lan_saa9730_regs->StationMgmtData) &
444 PHY_STATUS_LINK_UP) { 452 PHY_STATUS_LINK_UP) {
445 /* link is up */ 453 /* link is up */
446 break; 454 break;
@@ -454,7 +462,7 @@ static int lan_saa9730_mii_init(struct lan_saa9730_private *lp)
454static int lan_saa9730_control_init(struct lan_saa9730_private *lp) 462static int lan_saa9730_control_init(struct lan_saa9730_private *lp)
455{ 463{
456 /* Initialize DMA control register. */ 464 /* Initialize DMA control register. */
457 OUTL((LANMB_ANY << DMA_CTL_MAX_XFER_SHF) | 465 outl((LANMB_ANY << DMA_CTL_MAX_XFER_SHF) |
458 (LANEND_LITTLE << DMA_CTL_ENDIAN_SHF) | 466 (LANEND_LITTLE << DMA_CTL_ENDIAN_SHF) |
459 (LAN_SAA9730_RCV_Q_INT_THRESHOLD << DMA_CTL_RX_INT_COUNT_SHF) 467 (LAN_SAA9730_RCV_Q_INT_THRESHOLD << DMA_CTL_RX_INT_COUNT_SHF)
460 | DMA_CTL_RX_INT_TO_EN | DMA_CTL_RX_INT_EN | 468 | DMA_CTL_RX_INT_TO_EN | DMA_CTL_RX_INT_EN |
@@ -462,27 +470,27 @@ static int lan_saa9730_control_init(struct lan_saa9730_private *lp)
462 &lp->lan_saa9730_regs->LanDmaCtl); 470 &lp->lan_saa9730_regs->LanDmaCtl);
463 471
464 /* Initial MAC control register. */ 472 /* Initial MAC control register. */
465 OUTL((MACCM_MII << MAC_CONTROL_CONN_SHF) | MAC_CONTROL_FULL_DUP, 473 outl((MACCM_MII << MAC_CONTROL_CONN_SHF) | MAC_CONTROL_FULL_DUP,
466 &lp->lan_saa9730_regs->MacCtl); 474 &lp->lan_saa9730_regs->MacCtl);
467 475
468 /* Initialize CAM control register. */ 476 /* Initialize CAM control register. */
469 OUTL(CAM_CONTROL_COMP_EN | CAM_CONTROL_BROAD_ACC, 477 outl(CAM_CONTROL_COMP_EN | CAM_CONTROL_BROAD_ACC,
470 &lp->lan_saa9730_regs->CamCtl); 478 &lp->lan_saa9730_regs->CamCtl);
471 479
472 /* 480 /*
473 * Initialize CAM enable register, only turn on first entry, should 481 * Initialize CAM enable register, only turn on first entry, should
474 * contain own addr. 482 * contain own addr.
475 */ 483 */
476 OUTL(0x0001, &lp->lan_saa9730_regs->CamEnable); 484 outl(0x0001, &lp->lan_saa9730_regs->CamEnable);
477 485
478 /* Initialize Tx control register */ 486 /* Initialize Tx control register */
479 OUTL(TX_CTL_EN_COMP, &lp->lan_saa9730_regs->TxCtl); 487 outl(TX_CTL_EN_COMP, &lp->lan_saa9730_regs->TxCtl);
480 488
481 /* Initialize Rcv control register */ 489 /* Initialize Rcv control register */
482 OUTL(RX_CTL_STRIP_CRC, &lp->lan_saa9730_regs->RxCtl); 490 outl(RX_CTL_STRIP_CRC, &lp->lan_saa9730_regs->RxCtl);
483 491
484 /* Reset DMA engine */ 492 /* Reset DMA engine */
485 OUTL(DMA_TEST_SW_RESET, &lp->lan_saa9730_regs->DmaTest); 493 outl(DMA_TEST_SW_RESET, &lp->lan_saa9730_regs->DmaTest);
486 494
487 return 0; 495 return 0;
488} 496}
@@ -492,21 +500,21 @@ static int lan_saa9730_stop(struct lan_saa9730_private *lp)
492 int i; 500 int i;
493 501
494 /* Stop DMA first */ 502 /* Stop DMA first */
495 OUTL(INL(&lp->lan_saa9730_regs->LanDmaCtl) & 503 outl(readl(&lp->lan_saa9730_regs->LanDmaCtl) &
496 ~(DMA_CTL_EN_TX_DMA | DMA_CTL_EN_RX_DMA), 504 ~(DMA_CTL_EN_TX_DMA | DMA_CTL_EN_RX_DMA),
497 &lp->lan_saa9730_regs->LanDmaCtl); 505 &lp->lan_saa9730_regs->LanDmaCtl);
498 506
499 /* Set the SW Reset bits in DMA and MAC control registers */ 507 /* Set the SW Reset bits in DMA and MAC control registers */
500 OUTL(DMA_TEST_SW_RESET, &lp->lan_saa9730_regs->DmaTest); 508 outl(DMA_TEST_SW_RESET, &lp->lan_saa9730_regs->DmaTest);
501 OUTL(INL(&lp->lan_saa9730_regs->MacCtl) | MAC_CONTROL_RESET, 509 outl(readl(&lp->lan_saa9730_regs->MacCtl) | MAC_CONTROL_RESET,
502 &lp->lan_saa9730_regs->MacCtl); 510 &lp->lan_saa9730_regs->MacCtl);
503 511
504 /* 512 /*
505 * Wait for MAC reset to have finished. The reset bit is auto cleared 513 * Wait for MAC reset to have finished. The reset bit is auto cleared
506 * when the reset is done. 514 * when the reset is done.
507 */ 515 */
508 i = 0; 516 i = 0;
509 while (INL(&lp->lan_saa9730_regs->MacCtl) & MAC_CONTROL_RESET) { 517 while (readl(&lp->lan_saa9730_regs->MacCtl) & MAC_CONTROL_RESET) {
510 i++; 518 i++;
511 if (i > 100) { 519 if (i > 100) {
512 printk 520 printk
@@ -524,7 +532,7 @@ static int lan_saa9730_dma_init(struct lan_saa9730_private *lp)
524 /* Stop lan controller. */ 532 /* Stop lan controller. */
525 lan_saa9730_stop(lp); 533 lan_saa9730_stop(lp);
526 534
527 OUTL(LAN_SAA9730_DEFAULT_TIME_OUT_CNT, 535 outl(LAN_SAA9730_DEFAULT_TIME_OUT_CNT,
528 &lp->lan_saa9730_regs->Timeout); 536 &lp->lan_saa9730_regs->Timeout);
529 537
530 return 0; 538 return 0;
@@ -536,28 +544,27 @@ static int lan_saa9730_start(struct lan_saa9730_private *lp)
536 544
537 /* Initialize Rx Buffer Index */ 545 /* Initialize Rx Buffer Index */
538 lp->NextRcvPacketIndex = 0; 546 lp->NextRcvPacketIndex = 0;
539 lp->NextRcvToUseIsA = 1; 547 lp->NextRcvBufferIndex = 0;
540 548
541 /* Set current buffer index & next availble packet index */ 549 /* Set current buffer index & next available packet index */
542 lp->NextTxmPacketIndex = 0; 550 lp->NextTxmPacketIndex = 0;
543 lp->NextTxmBufferIndex = 0; 551 lp->NextTxmBufferIndex = 0;
544 lp->PendingTxmPacketIndex = 0; 552 lp->PendingTxmPacketIndex = 0;
545 lp->PendingTxmBufferIndex = 0; 553 lp->PendingTxmBufferIndex = 0;
546 554
547 OUTL(INL(&lp->lan_saa9730_regs->LanDmaCtl) | DMA_CTL_EN_TX_DMA | 555 outl(readl(&lp->lan_saa9730_regs->LanDmaCtl) | DMA_CTL_EN_TX_DMA |
548 DMA_CTL_EN_RX_DMA, &lp->lan_saa9730_regs->LanDmaCtl); 556 DMA_CTL_EN_RX_DMA, &lp->lan_saa9730_regs->LanDmaCtl);
549 557
550 /* For Tx, turn on MAC then DMA */ 558 /* For Tx, turn on MAC then DMA */
551 OUTL(INL(&lp->lan_saa9730_regs->TxCtl) | TX_CTL_TX_EN, 559 outl(readl(&lp->lan_saa9730_regs->TxCtl) | TX_CTL_TX_EN,
552 &lp->lan_saa9730_regs->TxCtl); 560 &lp->lan_saa9730_regs->TxCtl);
553 561
554 /* For Rx, turn on DMA then MAC */ 562 /* For Rx, turn on DMA then MAC */
555 OUTL(INL(&lp->lan_saa9730_regs->RxCtl) | RX_CTL_RX_EN, 563 outl(readl(&lp->lan_saa9730_regs->RxCtl) | RX_CTL_RX_EN,
556 &lp->lan_saa9730_regs->RxCtl); 564 &lp->lan_saa9730_regs->RxCtl);
557 565
558 /* Set Ok2Use to let hardware owns the buffers */ 566 /* Set Ok2Use to let hardware own the buffers. */
559 OUTL(OK2USE_RX_A | OK2USE_RX_B | OK2USE_TX_A | OK2USE_TX_B, 567 outl(OK2USE_RX_A | OK2USE_RX_B, &lp->lan_saa9730_regs->Ok2Use);
560 &lp->lan_saa9730_regs->Ok2Use);
561 568
562 return 0; 569 return 0;
563} 570}
@@ -572,8 +579,7 @@ static int lan_saa9730_restart(struct lan_saa9730_private *lp)
572 579
573static int lan_saa9730_tx(struct net_device *dev) 580static int lan_saa9730_tx(struct net_device *dev)
574{ 581{
575 struct lan_saa9730_private *lp = 582 struct lan_saa9730_private *lp = netdev_priv(dev);
576 (struct lan_saa9730_private *) dev->priv;
577 unsigned int *pPacket; 583 unsigned int *pPacket;
578 unsigned int tx_status; 584 unsigned int tx_status;
579 585
@@ -581,13 +587,11 @@ static int lan_saa9730_tx(struct net_device *dev)
581 printk("lan_saa9730_tx interrupt\n"); 587 printk("lan_saa9730_tx interrupt\n");
582 588
583 /* Clear interrupt. */ 589 /* Clear interrupt. */
584 OUTL(DMA_STATUS_MAC_TX_INT, &lp->lan_saa9730_regs->DmaStatus); 590 outl(DMA_STATUS_MAC_TX_INT, &lp->lan_saa9730_regs->DmaStatus);
585 591
586 while (1) { 592 while (1) {
587 pPacket = 593 pPacket = lp->TxmBuffer[lp->PendingTxmBufferIndex]
588 (unsigned int *) lp->TxmBuffer[lp-> 594 [lp->PendingTxmPacketIndex];
589 PendingTxmBufferIndex]
590 [lp->PendingTxmPacketIndex];
591 595
592 /* Get status of first packet transmitted. */ 596 /* Get status of first packet transmitted. */
593 tx_status = le32_to_cpu(*pPacket); 597 tx_status = le32_to_cpu(*pPacket);
@@ -605,23 +609,22 @@ static int lan_saa9730_tx(struct net_device *dev)
605 lp->stats.tx_errors++; 609 lp->stats.tx_errors++;
606 if (tx_status & 610 if (tx_status &
607 (TX_STATUS_EX_COLL << TX_STAT_CTL_STATUS_SHF)) 611 (TX_STATUS_EX_COLL << TX_STAT_CTL_STATUS_SHF))
608 lp->stats.tx_aborted_errors++; 612 lp->stats.tx_aborted_errors++;
609 if (tx_status & 613 if (tx_status &
610 (TX_STATUS_LATE_COLL << 614 (TX_STATUS_LATE_COLL << TX_STAT_CTL_STATUS_SHF))
611 TX_STAT_CTL_STATUS_SHF)) lp->stats. 615 lp->stats.tx_window_errors++;
612 tx_window_errors++;
613 if (tx_status & 616 if (tx_status &
614 (TX_STATUS_L_CARR << TX_STAT_CTL_STATUS_SHF)) 617 (TX_STATUS_L_CARR << TX_STAT_CTL_STATUS_SHF))
615 lp->stats.tx_carrier_errors++; 618 lp->stats.tx_carrier_errors++;
616 if (tx_status & 619 if (tx_status &
617 (TX_STATUS_UNDER << TX_STAT_CTL_STATUS_SHF)) 620 (TX_STATUS_UNDER << TX_STAT_CTL_STATUS_SHF))
618 lp->stats.tx_fifo_errors++; 621 lp->stats.tx_fifo_errors++;
619 if (tx_status & 622 if (tx_status &
620 (TX_STATUS_SQ_ERR << TX_STAT_CTL_STATUS_SHF)) 623 (TX_STATUS_SQ_ERR << TX_STAT_CTL_STATUS_SHF))
621 lp->stats.tx_heartbeat_errors++; 624 lp->stats.tx_heartbeat_errors++;
622 625
623 lp->stats.collisions += 626 lp->stats.collisions +=
624 tx_status & TX_STATUS_TX_COLL_MSK; 627 tx_status & TX_STATUS_TX_COLL_MSK;
625 } 628 }
626 629
627 /* Free buffer. */ 630 /* Free buffer. */
@@ -636,21 +639,15 @@ static int lan_saa9730_tx(struct net_device *dev)
636 } 639 }
637 } 640 }
638 641
639 /* Make sure A and B are available to hardware. */ 642 /* The tx buffer is no longer full. */
640 OUTL(OK2USE_TX_A | OK2USE_TX_B, &lp->lan_saa9730_regs->Ok2Use); 643 netif_wake_queue(dev);
641
642 if (netif_queue_stopped(dev)) {
643 /* The tx buffer is no longer full. */
644 netif_wake_queue(dev);
645 }
646 644
647 return 0; 645 return 0;
648} 646}
649 647
650static int lan_saa9730_rx(struct net_device *dev) 648static int lan_saa9730_rx(struct net_device *dev)
651{ 649{
652 struct lan_saa9730_private *lp = 650 struct lan_saa9730_private *lp = netdev_priv(dev);
653 (struct lan_saa9730_private *) dev->priv;
654 int len = 0; 651 int len = 0;
655 struct sk_buff *skb = 0; 652 struct sk_buff *skb = 0;
656 unsigned int rx_status; 653 unsigned int rx_status;
@@ -663,16 +660,13 @@ static int lan_saa9730_rx(struct net_device *dev)
663 printk("lan_saa9730_rx interrupt\n"); 660 printk("lan_saa9730_rx interrupt\n");
664 661
665 /* Clear receive interrupts. */ 662 /* Clear receive interrupts. */
666 OUTL(DMA_STATUS_MAC_RX_INT | DMA_STATUS_RX_INT | 663 outl(DMA_STATUS_MAC_RX_INT | DMA_STATUS_RX_INT |
667 DMA_STATUS_RX_TO_INT, &lp->lan_saa9730_regs->DmaStatus); 664 DMA_STATUS_RX_TO_INT, &lp->lan_saa9730_regs->DmaStatus);
668 665
669 /* Address next packet */ 666 /* Address next packet */
670 if (lp->NextRcvToUseIsA) 667 BufferIndex = lp->NextRcvBufferIndex;
671 BufferIndex = 0;
672 else
673 BufferIndex = 1;
674 PacketIndex = lp->NextRcvPacketIndex; 668 PacketIndex = lp->NextRcvPacketIndex;
675 pPacket = (unsigned int *) lp->RcvBuffer[BufferIndex][PacketIndex]; 669 pPacket = lp->RcvBuffer[BufferIndex][PacketIndex];
676 rx_status = le32_to_cpu(*pPacket); 670 rx_status = le32_to_cpu(*pPacket);
677 671
678 /* Process each packet. */ 672 /* Process each packet. */
@@ -715,51 +709,39 @@ static int lan_saa9730_rx(struct net_device *dev)
715 lp->stats.rx_errors++; 709 lp->stats.rx_errors++;
716 if (rx_status & 710 if (rx_status &
717 (RX_STATUS_CRC_ERR << RX_STAT_CTL_STATUS_SHF)) 711 (RX_STATUS_CRC_ERR << RX_STAT_CTL_STATUS_SHF))
718 lp->stats.rx_crc_errors++; 712 lp->stats.rx_crc_errors++;
719 if (rx_status & 713 if (rx_status &
720 (RX_STATUS_ALIGN_ERR << 714 (RX_STATUS_ALIGN_ERR << RX_STAT_CTL_STATUS_SHF))
721 RX_STAT_CTL_STATUS_SHF)) lp->stats. 715 lp->stats.rx_frame_errors++;
722 rx_frame_errors++;
723 if (rx_status & 716 if (rx_status &
724 (RX_STATUS_OVERFLOW << RX_STAT_CTL_STATUS_SHF)) 717 (RX_STATUS_OVERFLOW << RX_STAT_CTL_STATUS_SHF))
725 lp->stats.rx_fifo_errors++; 718 lp->stats.rx_fifo_errors++;
726 if (rx_status & 719 if (rx_status &
727 (RX_STATUS_LONG_ERR << RX_STAT_CTL_STATUS_SHF)) 720 (RX_STATUS_LONG_ERR << RX_STAT_CTL_STATUS_SHF))
728 lp->stats.rx_length_errors++; 721 lp->stats.rx_length_errors++;
729 } 722 }
730 723
731 /* Indicate we have processed the buffer. */ 724 /* Indicate we have processed the buffer. */
732 *pPacket = 725 *pPacket = cpu_to_le32(RXSF_READY << RX_STAT_CTL_OWNER_SHF);
733 cpu_to_le32(RXSF_READY << RX_STAT_CTL_OWNER_SHF); 726
727 /* Make sure A or B is available to hardware as appropriate. */
728 outl(BufferIndex ? OK2USE_RX_B : OK2USE_RX_A,
729 &lp->lan_saa9730_regs->Ok2Use);
734 730
735 /* Go to next packet in sequence. */ 731 /* Go to next packet in sequence. */
736 lp->NextRcvPacketIndex++; 732 lp->NextRcvPacketIndex++;
737 if (lp->NextRcvPacketIndex >= LAN_SAA9730_RCV_Q_SIZE) { 733 if (lp->NextRcvPacketIndex >= LAN_SAA9730_RCV_Q_SIZE) {
738 lp->NextRcvPacketIndex = 0; 734 lp->NextRcvPacketIndex = 0;
739 if (BufferIndex) { 735 lp->NextRcvBufferIndex ^= 1;
740 lp->NextRcvToUseIsA = 1;
741 } else {
742 lp->NextRcvToUseIsA = 0;
743 }
744 } 736 }
745 OUTL(OK2USE_RX_A | OK2USE_RX_B,
746 &lp->lan_saa9730_regs->Ok2Use);
747 737
748 /* Address next packet */ 738 /* Address next packet */
749 if (lp->NextRcvToUseIsA) 739 BufferIndex = lp->NextRcvBufferIndex;
750 BufferIndex = 0;
751 else
752 BufferIndex = 1;
753 PacketIndex = lp->NextRcvPacketIndex; 740 PacketIndex = lp->NextRcvPacketIndex;
754 pPacket = 741 pPacket = lp->RcvBuffer[BufferIndex][PacketIndex];
755 (unsigned int *) lp->
756 RcvBuffer[BufferIndex][PacketIndex];
757 rx_status = le32_to_cpu(*pPacket); 742 rx_status = le32_to_cpu(*pPacket);
758 } 743 }
759 744
760 /* Make sure A and B are available to hardware. */
761 OUTL(OK2USE_RX_A | OK2USE_RX_B, &lp->lan_saa9730_regs->Ok2Use);
762
763 return 0; 745 return 0;
764} 746}
765 747
@@ -767,8 +749,7 @@ static irqreturn_t lan_saa9730_interrupt(const int irq, void *dev_id,
767 struct pt_regs *regs) 749 struct pt_regs *regs)
768{ 750{
769 struct net_device *dev = (struct net_device *) dev_id; 751 struct net_device *dev = (struct net_device *) dev_id;
770 struct lan_saa9730_private *lp = 752 struct lan_saa9730_private *lp = netdev_priv(dev);
771 (struct lan_saa9730_private *) dev->priv;
772 753
773 if (lan_saa9730_debug > 5) 754 if (lan_saa9730_debug > 5)
774 printk("lan_saa9730_interrupt\n"); 755 printk("lan_saa9730_interrupt\n");
@@ -780,11 +761,11 @@ static irqreturn_t lan_saa9730_interrupt(const int irq, void *dev_id,
780 evm_saa9730_clear_lan_int(lp); 761 evm_saa9730_clear_lan_int(lp);
781 762
782 /* Service pending transmit interrupts. */ 763 /* Service pending transmit interrupts. */
783 if (INL(&lp->lan_saa9730_regs->DmaStatus) & DMA_STATUS_MAC_TX_INT) 764 if (readl(&lp->lan_saa9730_regs->DmaStatus) & DMA_STATUS_MAC_TX_INT)
784 lan_saa9730_tx(dev); 765 lan_saa9730_tx(dev);
785 766
786 /* Service pending receive interrupts. */ 767 /* Service pending receive interrupts. */
787 if (INL(&lp->lan_saa9730_regs->DmaStatus) & 768 if (readl(&lp->lan_saa9730_regs->DmaStatus) &
788 (DMA_STATUS_MAC_RX_INT | DMA_STATUS_RX_INT | 769 (DMA_STATUS_MAC_RX_INT | DMA_STATUS_RX_INT |
789 DMA_STATUS_RX_TO_INT)) lan_saa9730_rx(dev); 770 DMA_STATUS_RX_TO_INT)) lan_saa9730_rx(dev);
790 771
@@ -794,15 +775,9 @@ static irqreturn_t lan_saa9730_interrupt(const int irq, void *dev_id,
794 return IRQ_HANDLED; 775 return IRQ_HANDLED;
795} 776}
796 777
797static int lan_saa9730_open_fail(struct net_device *dev)
798{
799 return -ENODEV;
800}
801
802static int lan_saa9730_open(struct net_device *dev) 778static int lan_saa9730_open(struct net_device *dev)
803{ 779{
804 struct lan_saa9730_private *lp = 780 struct lan_saa9730_private *lp = netdev_priv(dev);
805 (struct lan_saa9730_private *) dev->priv;
806 781
807 /* Associate IRQ with lan_saa9730_interrupt */ 782 /* Associate IRQ with lan_saa9730_interrupt */
808 if (request_irq(dev->irq, &lan_saa9730_interrupt, 0, "SAA9730 Eth", 783 if (request_irq(dev->irq, &lan_saa9730_interrupt, 0, "SAA9730 Eth",
@@ -834,15 +809,13 @@ static int lan_saa9730_write(struct lan_saa9730_private *lp,
834 int PacketIndex; 809 int PacketIndex;
835 810
836 if (lan_saa9730_debug > 5) 811 if (lan_saa9730_debug > 5)
837 printk("lan_saa9730_write: skb=%08x\n", 812 printk("lan_saa9730_write: skb=%p\n", skb);
838 (unsigned int) skb);
839 813
840 BufferIndex = lp->NextTxmBufferIndex; 814 BufferIndex = lp->NextTxmBufferIndex;
841 PacketIndex = lp->NextTxmPacketIndex; 815 PacketIndex = lp->NextTxmPacketIndex;
842 816
843 tx_status = 817 tx_status = le32_to_cpu(*(unsigned int *)lp->TxmBuffer[BufferIndex]
844 le32_to_cpu(*(unsigned int *) lp-> 818 [PacketIndex]);
845 TxmBuffer[BufferIndex][PacketIndex]);
846 if ((tx_status & TX_STAT_CTL_OWNER_MSK) != 819 if ((tx_status & TX_STAT_CTL_OWNER_MSK) !=
847 (TXSF_EMPTY << TX_STAT_CTL_OWNER_SHF)) { 820 (TXSF_EMPTY << TX_STAT_CTL_OWNER_SHF)) {
848 if (lan_saa9730_debug > 4) 821 if (lan_saa9730_debug > 4)
@@ -858,29 +831,29 @@ static int lan_saa9730_write(struct lan_saa9730_private *lp,
858 lp->NextTxmBufferIndex ^= 1; 831 lp->NextTxmBufferIndex ^= 1;
859 } 832 }
860 833
861 pbPacketData = 834 pbPacketData = lp->TxmBuffer[BufferIndex][PacketIndex];
862 (unsigned char *) lp->TxmBuffer[BufferIndex][PacketIndex];
863 pbPacketData += 4; 835 pbPacketData += 4;
864 836
865 /* copy the bits */ 837 /* copy the bits */
866 memcpy(pbPacketData, pbData, len); 838 memcpy(pbPacketData, pbData, len);
867 839
868 /* Set transmit status for hardware */ 840 /* Set transmit status for hardware */
869 *(unsigned int *) lp->TxmBuffer[BufferIndex][PacketIndex] = 841 *(unsigned int *)lp->TxmBuffer[BufferIndex][PacketIndex] =
870 cpu_to_le32((TXSF_READY << TX_STAT_CTL_OWNER_SHF) | 842 cpu_to_le32((TXSF_READY << TX_STAT_CTL_OWNER_SHF) |
871 (TX_STAT_CTL_INT_AFTER_TX << TX_STAT_CTL_FRAME_SHF) 843 (TX_STAT_CTL_INT_AFTER_TX <<
872 | (len << TX_STAT_CTL_LENGTH_SHF)); 844 TX_STAT_CTL_FRAME_SHF) |
873 845 (len << TX_STAT_CTL_LENGTH_SHF));
874 /* Set hardware tx buffer. */ 846
875 OUTL(OK2USE_TX_A | OK2USE_TX_B, &lp->lan_saa9730_regs->Ok2Use); 847 /* Make sure A or B is available to hardware as appropriate. */
848 outl(BufferIndex ? OK2USE_TX_B : OK2USE_TX_A,
849 &lp->lan_saa9730_regs->Ok2Use);
876 850
877 return 0; 851 return 0;
878} 852}
879 853
880static void lan_saa9730_tx_timeout(struct net_device *dev) 854static void lan_saa9730_tx_timeout(struct net_device *dev)
881{ 855{
882 struct lan_saa9730_private *lp = 856 struct lan_saa9730_private *lp = netdev_priv(dev);
883 (struct lan_saa9730_private *) dev->priv;
884 857
885 /* Transmitter timeout, serious problems */ 858 /* Transmitter timeout, serious problems */
886 lp->stats.tx_errors++; 859 lp->stats.tx_errors++;
@@ -889,20 +862,19 @@ static void lan_saa9730_tx_timeout(struct net_device *dev)
889 lan_saa9730_restart(lp); 862 lan_saa9730_restart(lp);
890 863
891 dev->trans_start = jiffies; 864 dev->trans_start = jiffies;
892 netif_start_queue(dev); 865 netif_wake_queue(dev);
893} 866}
894 867
895static int lan_saa9730_start_xmit(struct sk_buff *skb, 868static int lan_saa9730_start_xmit(struct sk_buff *skb,
896 struct net_device *dev) 869 struct net_device *dev)
897{ 870{
898 struct lan_saa9730_private *lp = 871 struct lan_saa9730_private *lp = netdev_priv(dev);
899 (struct lan_saa9730_private *) dev->priv;
900 unsigned long flags; 872 unsigned long flags;
901 int skblen; 873 int skblen;
902 int len; 874 int len;
903 875
904 if (lan_saa9730_debug > 4) 876 if (lan_saa9730_debug > 4)
905 printk("Send packet: skb=%08x\n", (unsigned int) skb); 877 printk("Send packet: skb=%p\n", skb);
906 878
907 skblen = skb->len; 879 skblen = skb->len;
908 880
@@ -912,8 +884,7 @@ static int lan_saa9730_start_xmit(struct sk_buff *skb,
912 884
913 if (lan_saa9730_write(lp, skb, skblen)) { 885 if (lan_saa9730_write(lp, skb, skblen)) {
914 spin_unlock_irqrestore(&lp->lock, flags); 886 spin_unlock_irqrestore(&lp->lock, flags);
915 printk("Error when writing packet to controller: skb=%08x\n", 887 printk("Error when writing packet to controller: skb=%p\n", skb);
916 (unsigned int) skb);
917 netif_stop_queue(dev); 888 netif_stop_queue(dev);
918 return -1; 889 return -1;
919 } 890 }
@@ -922,7 +893,7 @@ static int lan_saa9730_start_xmit(struct sk_buff *skb,
922 lp->stats.tx_packets++; 893 lp->stats.tx_packets++;
923 894
924 dev->trans_start = jiffies; 895 dev->trans_start = jiffies;
925 netif_start_queue(dev); 896 netif_wake_queue(dev);
926 dev_kfree_skb(skb); 897 dev_kfree_skb(skb);
927 898
928 spin_unlock_irqrestore(&lp->lock, flags); 899 spin_unlock_irqrestore(&lp->lock, flags);
@@ -932,8 +903,7 @@ static int lan_saa9730_start_xmit(struct sk_buff *skb,
932 903
933static int lan_saa9730_close(struct net_device *dev) 904static int lan_saa9730_close(struct net_device *dev)
934{ 905{
935 struct lan_saa9730_private *lp = 906 struct lan_saa9730_private *lp = netdev_priv(dev);
936 (struct lan_saa9730_private *) dev->priv;
937 907
938 if (lan_saa9730_debug > 1) 908 if (lan_saa9730_debug > 1)
939 printk("lan_saa9730_close:\n"); 909 printk("lan_saa9730_close:\n");
@@ -955,33 +925,31 @@ static int lan_saa9730_close(struct net_device *dev)
955static struct net_device_stats *lan_saa9730_get_stats(struct net_device 925static struct net_device_stats *lan_saa9730_get_stats(struct net_device
956 *dev) 926 *dev)
957{ 927{
958 struct lan_saa9730_private *lp = 928 struct lan_saa9730_private *lp = netdev_priv(dev);
959 (struct lan_saa9730_private *) dev->priv;
960 929
961 return &lp->stats; 930 return &lp->stats;
962} 931}
963 932
964static void lan_saa9730_set_multicast(struct net_device *dev) 933static void lan_saa9730_set_multicast(struct net_device *dev)
965{ 934{
966 struct lan_saa9730_private *lp = 935 struct lan_saa9730_private *lp = netdev_priv(dev);
967 (struct lan_saa9730_private *) dev->priv;
968 936
969 /* Stop the controller */ 937 /* Stop the controller */
970 lan_saa9730_stop(lp); 938 lan_saa9730_stop(lp);
971 939
972 if (dev->flags & IFF_PROMISC) { 940 if (dev->flags & IFF_PROMISC) {
973 /* accept all packets */ 941 /* accept all packets */
974 OUTL(CAM_CONTROL_COMP_EN | CAM_CONTROL_STATION_ACC | 942 outl(CAM_CONTROL_COMP_EN | CAM_CONTROL_STATION_ACC |
975 CAM_CONTROL_GROUP_ACC | CAM_CONTROL_BROAD_ACC, 943 CAM_CONTROL_GROUP_ACC | CAM_CONTROL_BROAD_ACC,
976 &lp->lan_saa9730_regs->CamCtl); 944 &lp->lan_saa9730_regs->CamCtl);
977 } else { 945 } else {
978 if (dev->flags & IFF_ALLMULTI) { 946 if (dev->flags & IFF_ALLMULTI) {
979 /* accept all multicast packets */ 947 /* accept all multicast packets */
980 OUTL(CAM_CONTROL_COMP_EN | CAM_CONTROL_GROUP_ACC | 948 outl(CAM_CONTROL_COMP_EN | CAM_CONTROL_GROUP_ACC |
981 CAM_CONTROL_BROAD_ACC, 949 CAM_CONTROL_BROAD_ACC,
982 &lp->lan_saa9730_regs->CamCtl); 950 &lp->lan_saa9730_regs->CamCtl);
983 } else { 951 } else {
984 /* 952 /*
985 * Will handle the multicast stuff later. -carstenl 953 * Will handle the multicast stuff later. -carstenl
986 */ 954 */
987 } 955 }
@@ -993,91 +961,86 @@ static void lan_saa9730_set_multicast(struct net_device *dev)
993 961
994static void __devexit saa9730_remove_one(struct pci_dev *pdev) 962static void __devexit saa9730_remove_one(struct pci_dev *pdev)
995{ 963{
996 struct net_device *dev = pci_get_drvdata(pdev); 964 struct net_device *dev = pci_get_drvdata(pdev);
997 965 struct lan_saa9730_private *lp = netdev_priv(dev);
998 if (dev) { 966
999 unregister_netdev(dev); 967 if (dev) {
1000 kfree(dev->priv); 968 unregister_netdev(dev);
1001 free_netdev(dev); 969 lan_saa9730_free_buffers(pdev, lp);
1002 pci_release_regions(pdev); 970 iounmap(lp->lan_saa9730_regs);
1003 pci_disable_device(pdev); 971 iounmap(lp->evm_saa9730_regs);
1004 pci_set_drvdata(pdev, NULL); 972 free_netdev(dev);
1005 } 973 pci_release_regions(pdev);
974 pci_disable_device(pdev);
975 pci_set_drvdata(pdev, NULL);
976 }
1006} 977}
1007 978
1008 979
1009static int lan_saa9730_init(struct net_device *dev, int ioaddr, int irq) 980static int lan_saa9730_init(struct net_device *dev, struct pci_dev *pdev,
981 unsigned long ioaddr, int irq)
1010{ 982{
1011 struct lan_saa9730_private *lp; 983 struct lan_saa9730_private *lp = netdev_priv(dev);
1012 unsigned char ethernet_addr[6]; 984 unsigned char ethernet_addr[6];
1013 int ret = 0; 985 int ret;
1014 986
1015 dev->open = lan_saa9730_open_fail; 987 if (get_ethernet_addr(ethernet_addr)) {
988 ret = -ENODEV;
989 goto out;
990 }
1016 991
1017 if (get_ethernet_addr(ethernet_addr))
1018 return -ENODEV;
1019
1020 memcpy(dev->dev_addr, ethernet_addr, 6); 992 memcpy(dev->dev_addr, ethernet_addr, 6);
1021 dev->base_addr = ioaddr; 993 dev->base_addr = ioaddr;
1022 dev->irq = irq; 994 dev->irq = irq;
1023
1024 /*
1025 * Make certain the data structures used by the controller are aligned
1026 * and DMAble.
1027 */
1028 /*
1029 * XXX: that is obviously broken - kfree() won't be happy with us.
1030 */
1031 lp = (struct lan_saa9730_private *) (((unsigned long)
1032 kmalloc(sizeof(*lp) + 7,
1033 GFP_DMA | GFP_KERNEL)
1034 + 7) & ~7);
1035 995
1036 if (!lp) 996 lp->pci_dev = pdev;
1037 return -ENOMEM;
1038
1039 dev->priv = lp;
1040 memset(lp, 0, sizeof(*lp));
1041 997
1042 /* Set SAA9730 LAN base address. */ 998 /* Set SAA9730 LAN base address. */
1043 lp->lan_saa9730_regs = (t_lan_saa9730_regmap *) (ioaddr + 999 lp->lan_saa9730_regs = ioremap(ioaddr + SAA9730_LAN_REGS_ADDR,
1044 SAA9730_LAN_REGS_ADDR); 1000 SAA9730_LAN_REGS_SIZE);
1001 if (!lp->lan_saa9730_regs) {
1002 ret = -ENOMEM;
1003 goto out;
1004 }
1045 1005
1046 /* Set SAA9730 EVM base address. */ 1006 /* Set SAA9730 EVM base address. */
1047 lp->evm_saa9730_regs = (t_evm_saa9730_regmap *) (ioaddr + 1007 lp->evm_saa9730_regs = ioremap(ioaddr + SAA9730_EVM_REGS_ADDR,
1048 SAA9730_EVM_REGS_ADDR); 1008 SAA9730_EVM_REGS_SIZE);
1009 if (!lp->evm_saa9730_regs) {
1010 ret = -ENOMEM;
1011 goto out_iounmap_lan;
1012 }
1049 1013
1050 /* Allocate LAN RX/TX frame buffer space. */ 1014 /* Allocate LAN RX/TX frame buffer space. */
1051 /* FIXME: a leak */ 1015 if ((ret = lan_saa9730_allocate_buffers(pdev, lp)))
1052 if ((ret = lan_saa9730_allocate_buffers(lp))) 1016 goto out_iounmap;
1053 goto out;
1054 1017
1055 /* Stop LAN controller. */ 1018 /* Stop LAN controller. */
1056 if ((ret = lan_saa9730_stop(lp))) 1019 if ((ret = lan_saa9730_stop(lp)))
1057 goto out; 1020 goto out_free_consistent;
1058 1021
1059 /* Initialize CAM registers. */ 1022 /* Initialize CAM registers. */
1060 if ((ret = lan_saa9730_cam_init(dev))) 1023 if ((ret = lan_saa9730_cam_init(dev)))
1061 goto out; 1024 goto out_free_consistent;
1062 1025
1063 /* Initialize MII registers. */ 1026 /* Initialize MII registers. */
1064 if ((ret = lan_saa9730_mii_init(lp))) 1027 if ((ret = lan_saa9730_mii_init(lp)))
1065 goto out; 1028 goto out_free_consistent;
1066 1029
1067 /* Initialize control registers. */ 1030 /* Initialize control registers. */
1068 if ((ret = lan_saa9730_control_init(lp))) 1031 if ((ret = lan_saa9730_control_init(lp)))
1069 goto out; 1032 goto out_free_consistent;
1070 1033
1071 /* Load CAM registers. */ 1034 /* Load CAM registers. */
1072 if ((ret = lan_saa9730_cam_load(lp))) 1035 if ((ret = lan_saa9730_cam_load(lp)))
1073 goto out; 1036 goto out_free_consistent;
1074 1037
1075 /* Initialize DMA context registers. */ 1038 /* Initialize DMA context registers. */
1076 if ((ret = lan_saa9730_dma_init(lp))) 1039 if ((ret = lan_saa9730_dma_init(lp)))
1077 goto out; 1040 goto out_free_consistent;
1078 1041
1079 spin_lock_init(&lp->lock); 1042 spin_lock_init(&lp->lock);
1080 1043
1081 dev->open = lan_saa9730_open; 1044 dev->open = lan_saa9730_open;
1082 dev->hard_start_xmit = lan_saa9730_start_xmit; 1045 dev->hard_start_xmit = lan_saa9730_start_xmit;
1083 dev->stop = lan_saa9730_close; 1046 dev->stop = lan_saa9730_close;
@@ -1086,44 +1049,43 @@ static int lan_saa9730_init(struct net_device *dev, int ioaddr, int irq)
1086 dev->tx_timeout = lan_saa9730_tx_timeout; 1049 dev->tx_timeout = lan_saa9730_tx_timeout;
1087 dev->watchdog_timeo = (HZ >> 1); 1050 dev->watchdog_timeo = (HZ >> 1);
1088 dev->dma = 0; 1051 dev->dma = 0;
1089 1052
1090 ret = register_netdev(dev); 1053 ret = register_netdev (dev);
1091 if (ret) 1054 if (ret)
1092 goto out; 1055 goto out_free_consistent;
1056
1093 return 0; 1057 return 0;
1094 1058
1095 out: 1059out_free_consistent:
1096 kfree(dev->priv); 1060 lan_saa9730_free_buffers(pdev, lp);
1061out_iounmap:
1062 iounmap(lp->evm_saa9730_regs);
1063out_iounmap_lan:
1064 iounmap(lp->lan_saa9730_regs);
1065out:
1097 return ret; 1066 return ret;
1098} 1067}
1099 1068
1100 1069
1101static int __devinit saa9730_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 1070static int __devinit saa9730_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1102{ 1071{
1103 struct net_device *dev; 1072 struct net_device *dev = NULL;
1104 unsigned int pci_ioaddr; 1073 unsigned long pci_ioaddr;
1105 int err; 1074 int err;
1106 1075
1107 if (lan_saa9730_debug > 1) 1076 if (lan_saa9730_debug > 1)
1108 printk("saa9730.c: PCI bios is present, checking for devices...\n"); 1077 printk("saa9730.c: PCI bios is present, checking for devices...\n");
1109 1078
1110 err = -ENOMEM;
1111 dev = alloc_etherdev(0);
1112 if (!dev)
1113 goto out;
1114
1115 SET_MODULE_OWNER(dev);
1116
1117 err = pci_enable_device(pdev); 1079 err = pci_enable_device(pdev);
1118 if (err) { 1080 if (err) {
1119 printk(KERN_ERR "Cannot enable PCI device, aborting.\n"); 1081 printk(KERN_ERR "Cannot enable PCI device, aborting.\n");
1120 goto out1; 1082 goto out;
1121 } 1083 }
1122 1084
1123 err = pci_request_regions(pdev, DRV_MODULE_NAME); 1085 err = pci_request_regions(pdev, DRV_MODULE_NAME);
1124 if (err) { 1086 if (err) {
1125 printk(KERN_ERR "Cannot obtain PCI resources, aborting.\n"); 1087 printk(KERN_ERR "Cannot obtain PCI resources, aborting.\n");
1126 goto out2; 1088 goto out_disable_pdev;
1127 } 1089 }
1128 1090
1129 pci_irq_line = pdev->irq; 1091 pci_irq_line = pdev->irq;
@@ -1132,49 +1094,54 @@ static int __devinit saa9730_init_one(struct pci_dev *pdev, const struct pci_dev
1132 pci_ioaddr = pci_resource_start(pdev, 1); 1094 pci_ioaddr = pci_resource_start(pdev, 1);
1133 pci_set_master(pdev); 1095 pci_set_master(pdev);
1134 1096
1135 printk("Found SAA9730 (PCI) at %#x, irq %d.\n", 1097 printk("Found SAA9730 (PCI) at %lx, irq %d.\n",
1136 pci_ioaddr, pci_irq_line); 1098 pci_ioaddr, pci_irq_line);
1137 1099
1138 err = lan_saa9730_init(dev, pci_ioaddr, pci_irq_line); 1100 dev = alloc_etherdev(sizeof(struct lan_saa9730_private));
1101 if (!dev)
1102 goto out_disable_pdev;
1103
1104 err = lan_saa9730_init(dev, pdev, pci_ioaddr, pci_irq_line);
1139 if (err) { 1105 if (err) {
1140 printk("Lan init failed"); 1106 printk("LAN init failed");
1141 goto out2; 1107 goto out_free_netdev;
1142 } 1108 }
1143 1109
1144 pci_set_drvdata(pdev, dev); 1110 pci_set_drvdata(pdev, dev);
1145 SET_NETDEV_DEV(dev, &pdev->dev); 1111 SET_NETDEV_DEV(dev, &pdev->dev);
1146 return 0; 1112 return 0;
1147 1113
1148out2: 1114out_free_netdev:
1149 pci_disable_device(pdev);
1150out1:
1151 free_netdev(dev); 1115 free_netdev(dev);
1116out_disable_pdev:
1117 pci_disable_device(pdev);
1152out: 1118out:
1119 pci_set_drvdata(pdev, NULL);
1153 return err; 1120 return err;
1154} 1121}
1155 1122
1156 1123
1157static struct pci_driver saa9730_driver = { 1124static struct pci_driver saa9730_driver = {
1158 .name = DRV_MODULE_NAME, 1125 .name = DRV_MODULE_NAME,
1159 .id_table = saa9730_pci_tbl, 1126 .id_table = saa9730_pci_tbl,
1160 .probe = saa9730_init_one, 1127 .probe = saa9730_init_one,
1161 .remove = __devexit_p(saa9730_remove_one), 1128 .remove = __devexit_p(saa9730_remove_one),
1162}; 1129};
1163 1130
1164 1131
1165static int __init saa9730_init(void) 1132static int __init saa9730_init(void)
1166{ 1133{
1167 return pci_module_init(&saa9730_driver); 1134 return pci_module_init(&saa9730_driver);
1168} 1135}
1169 1136
1170static void __exit saa9730_cleanup(void) 1137static void __exit saa9730_cleanup(void)
1171{ 1138{
1172 pci_unregister_driver(&saa9730_driver); 1139 pci_unregister_driver(&saa9730_driver);
1173} 1140}
1174 1141
1175module_init(saa9730_init); 1142module_init(saa9730_init);
1176module_exit(saa9730_cleanup); 1143module_exit(saa9730_cleanup);
1177 1144
1178 1145MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>");
1179 1146MODULE_DESCRIPTION("Philips SAA9730 ethernet driver");
1180MODULE_LICENSE("GPL"); 1147MODULE_LICENSE("GPL");
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 74d5f1a6fdea..c91e2e81f131 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -2183,9 +2183,8 @@ static void smc_release_datacs(struct platform_device *pdev, struct net_device *
2183 * 0 --> there is a device 2183 * 0 --> there is a device
2184 * anything else, error 2184 * anything else, error
2185 */ 2185 */
2186static int smc_drv_probe(struct device *dev) 2186static int smc_drv_probe(struct platform_device *pdev)
2187{ 2187{
2188 struct platform_device *pdev = to_platform_device(dev);
2189 struct net_device *ndev; 2188 struct net_device *ndev;
2190 struct resource *res; 2189 struct resource *res;
2191 unsigned int __iomem *addr; 2190 unsigned int __iomem *addr;
@@ -2212,7 +2211,7 @@ static int smc_drv_probe(struct device *dev)
2212 goto out_release_io; 2211 goto out_release_io;
2213 } 2212 }
2214 SET_MODULE_OWNER(ndev); 2213 SET_MODULE_OWNER(ndev);
2215 SET_NETDEV_DEV(ndev, dev); 2214 SET_NETDEV_DEV(ndev, &pdev->dev);
2216 2215
2217 ndev->dma = (unsigned char)-1; 2216 ndev->dma = (unsigned char)-1;
2218 ndev->irq = platform_get_irq(pdev, 0); 2217 ndev->irq = platform_get_irq(pdev, 0);
@@ -2233,7 +2232,7 @@ static int smc_drv_probe(struct device *dev)
2233 goto out_release_attrib; 2232 goto out_release_attrib;
2234 } 2233 }
2235 2234
2236 dev_set_drvdata(dev, ndev); 2235 platform_set_drvdata(pdev, ndev);
2237 ret = smc_probe(ndev, addr); 2236 ret = smc_probe(ndev, addr);
2238 if (ret != 0) 2237 if (ret != 0)
2239 goto out_iounmap; 2238 goto out_iounmap;
@@ -2249,7 +2248,7 @@ static int smc_drv_probe(struct device *dev)
2249 return 0; 2248 return 0;
2250 2249
2251 out_iounmap: 2250 out_iounmap:
2252 dev_set_drvdata(dev, NULL); 2251 platform_set_drvdata(pdev, NULL);
2253 iounmap(addr); 2252 iounmap(addr);
2254 out_release_attrib: 2253 out_release_attrib:
2255 smc_release_attrib(pdev); 2254 smc_release_attrib(pdev);
@@ -2263,14 +2262,13 @@ static int smc_drv_probe(struct device *dev)
2263 return ret; 2262 return ret;
2264} 2263}
2265 2264
2266static int smc_drv_remove(struct device *dev) 2265static int smc_drv_remove(struct platform_device *pdev)
2267{ 2266{
2268 struct platform_device *pdev = to_platform_device(dev); 2267 struct net_device *ndev = platform_get_drvdata(pdev);
2269 struct net_device *ndev = dev_get_drvdata(dev);
2270 struct smc_local *lp = netdev_priv(ndev); 2268 struct smc_local *lp = netdev_priv(ndev);
2271 struct resource *res; 2269 struct resource *res;
2272 2270
2273 dev_set_drvdata(dev, NULL); 2271 platform_set_drvdata(pdev, NULL);
2274 2272
2275 unregister_netdev(ndev); 2273 unregister_netdev(ndev);
2276 2274
@@ -2295,9 +2293,9 @@ static int smc_drv_remove(struct device *dev)
2295 return 0; 2293 return 0;
2296} 2294}
2297 2295
2298static int smc_drv_suspend(struct device *dev, pm_message_t state) 2296static int smc_drv_suspend(struct platform_device *dev, pm_message_t state)
2299{ 2297{
2300 struct net_device *ndev = dev_get_drvdata(dev); 2298 struct net_device *ndev = platform_get_drvdata(dev);
2301 2299
2302 if (ndev) { 2300 if (ndev) {
2303 if (netif_running(ndev)) { 2301 if (netif_running(ndev)) {
@@ -2309,14 +2307,13 @@ static int smc_drv_suspend(struct device *dev, pm_message_t state)
2309 return 0; 2307 return 0;
2310} 2308}
2311 2309
2312static int smc_drv_resume(struct device *dev) 2310static int smc_drv_resume(struct platform_device *dev)
2313{ 2311{
2314 struct platform_device *pdev = to_platform_device(dev); 2312 struct net_device *ndev = platform_get_drvdata(dev);
2315 struct net_device *ndev = dev_get_drvdata(dev);
2316 2313
2317 if (ndev) { 2314 if (ndev) {
2318 struct smc_local *lp = netdev_priv(ndev); 2315 struct smc_local *lp = netdev_priv(ndev);
2319 smc_enable_device(pdev); 2316 smc_enable_device(dev);
2320 if (netif_running(ndev)) { 2317 if (netif_running(ndev)) {
2321 smc_reset(ndev); 2318 smc_reset(ndev);
2322 smc_enable(ndev); 2319 smc_enable(ndev);
@@ -2328,13 +2325,14 @@ static int smc_drv_resume(struct device *dev)
2328 return 0; 2325 return 0;
2329} 2326}
2330 2327
2331static struct device_driver smc_driver = { 2328static struct platform_driver smc_driver = {
2332 .name = CARDNAME,
2333 .bus = &platform_bus_type,
2334 .probe = smc_drv_probe, 2329 .probe = smc_drv_probe,
2335 .remove = smc_drv_remove, 2330 .remove = smc_drv_remove,
2336 .suspend = smc_drv_suspend, 2331 .suspend = smc_drv_suspend,
2337 .resume = smc_drv_resume, 2332 .resume = smc_drv_resume,
2333 .driver = {
2334 .name = CARDNAME,
2335 },
2338}; 2336};
2339 2337
2340static int __init smc_init(void) 2338static int __init smc_init(void)
@@ -2348,12 +2346,12 @@ static int __init smc_init(void)
2348#endif 2346#endif
2349#endif 2347#endif
2350 2348
2351 return driver_register(&smc_driver); 2349 return platform_driver_register(&smc_driver);
2352} 2350}
2353 2351
2354static void __exit smc_cleanup(void) 2352static void __exit smc_cleanup(void)
2355{ 2353{
2356 driver_unregister(&smc_driver); 2354 platform_driver_unregister(&smc_driver);
2357} 2355}
2358 2356
2359module_init(smc_init); 2357module_init(smc_init);
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index 817f200742c3..a10cd184d597 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -289,6 +289,38 @@ static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l)
289#define RPC_LSA_DEFAULT RPC_LED_TX_RX 289#define RPC_LSA_DEFAULT RPC_LED_TX_RX
290#define RPC_LSB_DEFAULT RPC_LED_100_10 290#define RPC_LSB_DEFAULT RPC_LED_100_10
291 291
292#elif defined(CONFIG_SOC_AU1X00)
293
294#include <au1xxx.h>
295
296/* We can only do 16-bit reads and writes in the static memory space. */
297#define SMC_CAN_USE_8BIT 0
298#define SMC_CAN_USE_16BIT 1
299#define SMC_CAN_USE_32BIT 0
300#define SMC_IO_SHIFT 0
301#define SMC_NOWAIT 1
302
303#define SMC_inw(a, r) au_readw((unsigned long)((a) + (r)))
304#define SMC_insw(a, r, p, l) \
305 do { \
306 unsigned long _a = (unsigned long)((a) + (r)); \
307 int _l = (l); \
308 u16 *_p = (u16 *)(p); \
309 while (_l-- > 0) \
310 *_p++ = au_readw(_a); \
311 } while(0)
312#define SMC_outw(v, a, r) au_writew(v, (unsigned long)((a) + (r)))
313#define SMC_outsw(a, r, p, l) \
314 do { \
315 unsigned long _a = (unsigned long)((a) + (r)); \
316 int _l = (l); \
317 const u16 *_p = (const u16 *)(p); \
318 while (_l-- > 0) \
319 au_writew(*_p++ , _a); \
320 } while(0)
321
322#define set_irq_type(irq, type) do {} while (0)
323
292#else 324#else
293 325
294#define SMC_CAN_USE_8BIT 1 326#define SMC_CAN_USE_8BIT 1
diff --git a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c
index d04c918ebef8..4f756960db2a 100644
--- a/drivers/net/tokenring/proteon.c
+++ b/drivers/net/tokenring/proteon.c
@@ -344,9 +344,10 @@ module_param_array(dma, int, NULL, 0);
344 344
345static struct platform_device *proteon_dev[ISATR_MAX_ADAPTERS]; 345static struct platform_device *proteon_dev[ISATR_MAX_ADAPTERS];
346 346
347static struct device_driver proteon_driver = { 347static struct platform_driver proteon_driver = {
348 .name = "proteon", 348 .driver = {
349 .bus = &platform_bus_type, 349 .name = "proteon",
350 },
350}; 351};
351 352
352static int __init proteon_init(void) 353static int __init proteon_init(void)
@@ -355,7 +356,7 @@ static int __init proteon_init(void)
355 struct platform_device *pdev; 356 struct platform_device *pdev;
356 int i, num = 0, err = 0; 357 int i, num = 0, err = 0;
357 358
358 err = driver_register(&proteon_driver); 359 err = platform_driver_register(&proteon_driver);
359 if (err) 360 if (err)
360 return err; 361 return err;
361 362
@@ -372,7 +373,7 @@ static int __init proteon_init(void)
372 err = setup_card(dev, &pdev->dev); 373 err = setup_card(dev, &pdev->dev);
373 if (!err) { 374 if (!err) {
374 proteon_dev[i] = pdev; 375 proteon_dev[i] = pdev;
375 dev_set_drvdata(&pdev->dev, dev); 376 platform_set_drvdata(pdev, dev);
376 ++num; 377 ++num;
377 } else { 378 } else {
378 platform_device_unregister(pdev); 379 platform_device_unregister(pdev);
@@ -399,17 +400,17 @@ static void __exit proteon_cleanup(void)
399 400
400 if (!pdev) 401 if (!pdev)
401 continue; 402 continue;
402 dev = dev_get_drvdata(&pdev->dev); 403 dev = platform_get_drvdata(pdev);
403 unregister_netdev(dev); 404 unregister_netdev(dev);
404 release_region(dev->base_addr, PROTEON_IO_EXTENT); 405 release_region(dev->base_addr, PROTEON_IO_EXTENT);
405 free_irq(dev->irq, dev); 406 free_irq(dev->irq, dev);
406 free_dma(dev->dma); 407 free_dma(dev->dma);
407 tmsdev_term(dev); 408 tmsdev_term(dev);
408 free_netdev(dev); 409 free_netdev(dev);
409 dev_set_drvdata(&pdev->dev, NULL); 410 platform_set_drvdata(pdev, NULL);
410 platform_device_unregister(pdev); 411 platform_device_unregister(pdev);
411 } 412 }
412 driver_unregister(&proteon_driver); 413 platform_driver_unregister(&proteon_driver);
413} 414}
414 415
415module_init(proteon_init); 416module_init(proteon_init);
diff --git a/drivers/net/tokenring/skisa.c b/drivers/net/tokenring/skisa.c
index 72cf708396be..d6ba41cf3110 100644
--- a/drivers/net/tokenring/skisa.c
+++ b/drivers/net/tokenring/skisa.c
@@ -354,9 +354,10 @@ module_param_array(dma, int, NULL, 0);
354 354
355static struct platform_device *sk_isa_dev[ISATR_MAX_ADAPTERS]; 355static struct platform_device *sk_isa_dev[ISATR_MAX_ADAPTERS];
356 356
357static struct device_driver sk_isa_driver = { 357static struct platform_driver sk_isa_driver = {
358 .name = "skisa", 358 .driver = {
359 .bus = &platform_bus_type, 359 .name = "skisa",
360 },
360}; 361};
361 362
362static int __init sk_isa_init(void) 363static int __init sk_isa_init(void)
@@ -365,7 +366,7 @@ static int __init sk_isa_init(void)
365 struct platform_device *pdev; 366 struct platform_device *pdev;
366 int i, num = 0, err = 0; 367 int i, num = 0, err = 0;
367 368
368 err = driver_register(&sk_isa_driver); 369 err = platform_driver_register(&sk_isa_driver);
369 if (err) 370 if (err)
370 return err; 371 return err;
371 372
@@ -382,7 +383,7 @@ static int __init sk_isa_init(void)
382 err = setup_card(dev, &pdev->dev); 383 err = setup_card(dev, &pdev->dev);
383 if (!err) { 384 if (!err) {
384 sk_isa_dev[i] = pdev; 385 sk_isa_dev[i] = pdev;
385 dev_set_drvdata(&sk_isa_dev[i]->dev, dev); 386 platform_set_drvdata(sk_isa_dev[i], dev);
386 ++num; 387 ++num;
387 } else { 388 } else {
388 platform_device_unregister(pdev); 389 platform_device_unregister(pdev);
@@ -409,17 +410,17 @@ static void __exit sk_isa_cleanup(void)
409 410
410 if (!pdev) 411 if (!pdev)
411 continue; 412 continue;
412 dev = dev_get_drvdata(&pdev->dev); 413 dev = platform_get_drvdata(pdev);
413 unregister_netdev(dev); 414 unregister_netdev(dev);
414 release_region(dev->base_addr, SK_ISA_IO_EXTENT); 415 release_region(dev->base_addr, SK_ISA_IO_EXTENT);
415 free_irq(dev->irq, dev); 416 free_irq(dev->irq, dev);
416 free_dma(dev->dma); 417 free_dma(dev->dma);
417 tmsdev_term(dev); 418 tmsdev_term(dev);
418 free_netdev(dev); 419 free_netdev(dev);
419 dev_set_drvdata(&pdev->dev, NULL); 420 platform_set_drvdata(pdev, NULL);
420 platform_device_unregister(pdev); 421 platform_device_unregister(pdev);
421 } 422 }
422 driver_unregister(&sk_isa_driver); 423 platform_driver_unregister(&sk_isa_driver);
423} 424}
424 425
425module_init(sk_isa_init); 426module_init(sk_isa_init);
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index 7187958e40ca..00e55165b760 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -330,7 +330,7 @@ config PCI_HERMES
330 330
331config ATMEL 331config ATMEL
332 tristate "Atmel at76c50x chipset 802.11b support" 332 tristate "Atmel at76c50x chipset 802.11b support"
333 depends on NET_RADIO && EXPERIMENTAL 333 depends on NET_RADIO
334 select FW_LOADER 334 select FW_LOADER
335 select CRC32 335 select CRC32
336 ---help--- 336 ---help---
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index a3e23527fe7f..5e53c5258a33 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -72,7 +72,7 @@
72#include "atmel.h" 72#include "atmel.h"
73 73
74#define DRIVER_MAJOR 0 74#define DRIVER_MAJOR 0
75#define DRIVER_MINOR 96 75#define DRIVER_MINOR 98
76 76
77MODULE_AUTHOR("Simon Kelley"); 77MODULE_AUTHOR("Simon Kelley");
78MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards."); 78MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");
@@ -1504,7 +1504,7 @@ static int atmel_read_proc(char *page, char **start, off_t off,
1504 return len; 1504 return len;
1505} 1505}
1506 1506
1507struct net_device *init_atmel_card( unsigned short irq, int port, const AtmelFWType fw_type, 1507struct net_device *init_atmel_card( unsigned short irq, unsigned long port, const AtmelFWType fw_type,
1508 struct device *sys_dev, int (*card_present)(void *), void *card) 1508 struct device *sys_dev, int (*card_present)(void *), void *card)
1509{ 1509{
1510 struct net_device *dev; 1510 struct net_device *dev;
@@ -1605,8 +1605,8 @@ struct net_device *init_atmel_card( unsigned short irq, int port, const AtmelFWT
1605 goto err_out_free; 1605 goto err_out_free;
1606 } 1606 }
1607 1607
1608 if (priv->bus_type == BUS_TYPE_PCI && 1608 if (!request_region(dev->base_addr, 32,
1609 !request_region( dev->base_addr, 64, dev->name )) { 1609 priv->bus_type == BUS_TYPE_PCCARD ? "atmel_cs" : "atmel_pci")) {
1610 goto err_out_irq; 1610 goto err_out_irq;
1611 } 1611 }
1612 1612
@@ -1622,15 +1622,16 @@ struct net_device *init_atmel_card( unsigned short irq, int port, const AtmelFWT
1622 1622
1623 create_proc_read_entry ("driver/atmel", 0, NULL, atmel_read_proc, priv); 1623 create_proc_read_entry ("driver/atmel", 0, NULL, atmel_read_proc, priv);
1624 1624
1625 printk(KERN_INFO "%s: Atmel at76c50x wireless. Version %d.%d simon@thekelleys.org.uk\n", 1625 printk(KERN_INFO "%s: Atmel at76c50x. Version %d.%d. MAC %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
1626 dev->name, DRIVER_MAJOR, DRIVER_MINOR); 1626 dev->name, DRIVER_MAJOR, DRIVER_MINOR,
1627 dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
1628 dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5] );
1627 1629
1628 SET_MODULE_OWNER(dev); 1630 SET_MODULE_OWNER(dev);
1629 return dev; 1631 return dev;
1630 1632
1631 err_out_res: 1633 err_out_res:
1632 if (priv->bus_type == BUS_TYPE_PCI) 1634 release_region( dev->base_addr, 32);
1633 release_region( dev->base_addr, 64 );
1634 err_out_irq: 1635 err_out_irq:
1635 free_irq(dev->irq, dev); 1636 free_irq(dev->irq, dev);
1636 err_out_free: 1637 err_out_free:
@@ -1640,7 +1641,7 @@ struct net_device *init_atmel_card( unsigned short irq, int port, const AtmelFWT
1640 1641
1641EXPORT_SYMBOL(init_atmel_card); 1642EXPORT_SYMBOL(init_atmel_card);
1642 1643
1643void stop_atmel_card(struct net_device *dev, int freeres) 1644void stop_atmel_card(struct net_device *dev)
1644{ 1645{
1645 struct atmel_private *priv = netdev_priv(dev); 1646 struct atmel_private *priv = netdev_priv(dev);
1646 1647
@@ -1654,10 +1655,7 @@ void stop_atmel_card(struct net_device *dev, int freeres)
1654 remove_proc_entry("driver/atmel", NULL); 1655 remove_proc_entry("driver/atmel", NULL);
1655 free_irq(dev->irq, dev); 1656 free_irq(dev->irq, dev);
1656 kfree(priv->firmware); 1657 kfree(priv->firmware);
1657 if (freeres) { 1658 release_region(dev->base_addr, 32);
1658 /* PCMCIA frees this stuff, so only for PCI */
1659 release_region(dev->base_addr, 64);
1660 }
1661 free_netdev(dev); 1659 free_netdev(dev);
1662} 1660}
1663 1661
@@ -1810,9 +1808,9 @@ static int atmel_set_encode(struct net_device *dev,
1810 } 1808 }
1811 if(dwrq->flags & IW_ENCODE_RESTRICTED) 1809 if(dwrq->flags & IW_ENCODE_RESTRICTED)
1812 priv->exclude_unencrypted = 1; 1810 priv->exclude_unencrypted = 1;
1813 if(dwrq->flags & IW_ENCODE_OPEN) 1811 if(dwrq->flags & IW_ENCODE_OPEN)
1814 priv->exclude_unencrypted = 0; 1812 priv->exclude_unencrypted = 0;
1815 1813
1816 return -EINPROGRESS; /* Call commit handler */ 1814 return -EINPROGRESS; /* Call commit handler */
1817} 1815}
1818 1816
@@ -1827,11 +1825,12 @@ static int atmel_get_encode(struct net_device *dev,
1827 1825
1828 if (!priv->wep_is_on) 1826 if (!priv->wep_is_on)
1829 dwrq->flags = IW_ENCODE_DISABLED; 1827 dwrq->flags = IW_ENCODE_DISABLED;
1830 else if (priv->exclude_unencrypted) 1828 else {
1831 dwrq->flags = IW_ENCODE_RESTRICTED; 1829 if (priv->exclude_unencrypted)
1832 else 1830 dwrq->flags = IW_ENCODE_RESTRICTED;
1833 dwrq->flags = IW_ENCODE_OPEN; 1831 else
1834 1832 dwrq->flags = IW_ENCODE_OPEN;
1833 }
1835 /* Which key do we want ? -1 -> tx index */ 1834 /* Which key do we want ? -1 -> tx index */
1836 if (index < 0 || index >= 4) 1835 if (index < 0 || index >= 4)
1837 index = priv->default_key; 1836 index = priv->default_key;
@@ -2645,8 +2644,8 @@ static void handle_beacon_probe(struct atmel_private *priv, u16 capability, u8 c
2645 } 2644 }
2646} 2645}
2647 2646
2648 2647
2649static void send_authentication_request(struct atmel_private *priv, u8 *challenge, int challenge_len) 2648static void send_authentication_request(struct atmel_private *priv, u16 system, u8 *challenge, int challenge_len)
2650{ 2649{
2651 struct ieee80211_hdr_4addr header; 2650 struct ieee80211_hdr_4addr header;
2652 struct auth_body auth; 2651 struct auth_body auth;
@@ -2658,14 +2657,11 @@ static void send_authentication_request(struct atmel_private *priv, u8 *challeng
2658 memcpy(header.addr2, priv->dev->dev_addr, 6); 2657 memcpy(header.addr2, priv->dev->dev_addr, 6);
2659 memcpy(header.addr3, priv->CurrentBSSID, 6); 2658 memcpy(header.addr3, priv->CurrentBSSID, 6);
2660 2659
2661 if (priv->wep_is_on) { 2660 if (priv->wep_is_on && priv->CurrentAuthentTransactionSeqNum != 1)
2662 auth.alg = cpu_to_le16(C80211_MGMT_AAN_SHAREDKEY);
2663 /* no WEP for authentication frames with TrSeqNo 1 */ 2661 /* no WEP for authentication frames with TrSeqNo 1 */
2664 if (priv->CurrentAuthentTransactionSeqNum != 1) 2662 header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
2665 header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); 2663
2666 } else { 2664 auth.alg = cpu_to_le16(system);
2667 auth.alg = cpu_to_le16(C80211_MGMT_AAN_OPENSYSTEM);
2668 }
2669 2665
2670 auth.status = 0; 2666 auth.status = 0;
2671 auth.trans_seq = cpu_to_le16(priv->CurrentAuthentTransactionSeqNum); 2667 auth.trans_seq = cpu_to_le16(priv->CurrentAuthentTransactionSeqNum);
@@ -2834,6 +2830,7 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
2834 struct auth_body *auth = (struct auth_body *)priv->rx_buf; 2830 struct auth_body *auth = (struct auth_body *)priv->rx_buf;
2835 u16 status = le16_to_cpu(auth->status); 2831 u16 status = le16_to_cpu(auth->status);
2836 u16 trans_seq_no = le16_to_cpu(auth->trans_seq); 2832 u16 trans_seq_no = le16_to_cpu(auth->trans_seq);
2833 u16 system = le16_to_cpu(auth->alg);
2837 2834
2838 if (status == C80211_MGMT_SC_Success && !priv->wep_is_on) { 2835 if (status == C80211_MGMT_SC_Success && !priv->wep_is_on) {
2839 /* no WEP */ 2836 /* no WEP */
@@ -2855,7 +2852,7 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
2855 2852
2856 if (trans_seq_no == 0x0002 && 2853 if (trans_seq_no == 0x0002 &&
2857 auth->el_id == C80211_MGMT_ElementID_ChallengeText) { 2854 auth->el_id == C80211_MGMT_ElementID_ChallengeText) {
2858 send_authentication_request(priv, auth->chall_text, auth->chall_text_len); 2855 send_authentication_request(priv, system, auth->chall_text, auth->chall_text_len);
2859 return; 2856 return;
2860 } 2857 }
2861 2858
@@ -2872,14 +2869,20 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
2872 } 2869 }
2873 } 2870 }
2874 2871
2875 if (status == C80211_MGMT_SC_AuthAlgNotSupported && priv->connect_to_any_BSS) { 2872 if (status == C80211_MGMT_SC_AuthAlgNotSupported) {
2876 int bss_index; 2873 /* Do opensystem first, then try sharedkey */
2877 2874 if (system == C80211_MGMT_AAN_OPENSYSTEM) {
2878 priv->BSSinfo[(int)(priv->current_BSS)].channel |= 0x80; 2875 priv->CurrentAuthentTransactionSeqNum = 0x001;
2879 2876 send_authentication_request(priv, C80211_MGMT_AAN_SHAREDKEY, NULL, 0);
2880 if ((bss_index = retrieve_bss(priv)) != -1) { 2877 } else if (priv->connect_to_any_BSS) {
2881 atmel_join_bss(priv, bss_index); 2878 int bss_index;
2882 return; 2879
2880 priv->BSSinfo[(int)(priv->current_BSS)].channel |= 0x80;
2881
2882 if ((bss_index = retrieve_bss(priv)) != -1) {
2883 atmel_join_bss(priv, bss_index);
2884 return;
2885 }
2883 } 2886 }
2884 } 2887 }
2885 2888
@@ -3205,7 +3208,7 @@ static void atmel_management_timer(u_long a)
3205 priv->AuthenticationRequestRetryCnt++; 3208 priv->AuthenticationRequestRetryCnt++;
3206 priv->CurrentAuthentTransactionSeqNum = 0x0001; 3209 priv->CurrentAuthentTransactionSeqNum = 0x0001;
3207 mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); 3210 mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES);
3208 send_authentication_request(priv, NULL, 0); 3211 send_authentication_request(priv, C80211_MGMT_AAN_OPENSYSTEM, NULL, 0);
3209 } 3212 }
3210 3213
3211 break; 3214 break;
@@ -3312,7 +3315,7 @@ static void atmel_command_irq(struct atmel_private *priv)
3312 3315
3313 mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); 3316 mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES);
3314 priv->CurrentAuthentTransactionSeqNum = 0x0001; 3317 priv->CurrentAuthentTransactionSeqNum = 0x0001;
3315 send_authentication_request(priv, NULL, 0); 3318 send_authentication_request(priv, C80211_MGMT_AAN_SHAREDKEY, NULL, 0);
3316 } 3319 }
3317 return; 3320 return;
3318 } 3321 }
@@ -3482,11 +3485,6 @@ static int probe_atmel_card(struct net_device *dev)
3482 printk(KERN_ALERT "%s: *** Invalid MAC address. UPGRADE Firmware ****\n", dev->name); 3485 printk(KERN_ALERT "%s: *** Invalid MAC address. UPGRADE Firmware ****\n", dev->name);
3483 memcpy(dev->dev_addr, default_mac, 6); 3486 memcpy(dev->dev_addr, default_mac, 6);
3484 } 3487 }
3485 printk(KERN_INFO "%s: MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
3486 dev->name,
3487 dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
3488 dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5] );
3489
3490 } 3488 }
3491 3489
3492 return rc; 3490 return rc;
diff --git a/drivers/net/wireless/atmel.h b/drivers/net/wireless/atmel.h
index 825000edfc2c..b9b3e5b76544 100644
--- a/drivers/net/wireless/atmel.h
+++ b/drivers/net/wireless/atmel.h
@@ -35,9 +35,9 @@ typedef enum {
35 ATMEL_FW_TYPE_506 35 ATMEL_FW_TYPE_506
36} AtmelFWType; 36} AtmelFWType;
37 37
38struct net_device *init_atmel_card(unsigned short, int, const AtmelFWType, struct device *, 38struct net_device *init_atmel_card(unsigned short, unsigned long, const AtmelFWType, struct device *,
39 int (*present_func)(void *), void * ); 39 int (*present_func)(void *), void * );
40void stop_atmel_card( struct net_device *, int ); 40void stop_atmel_card( struct net_device *);
41int atmel_open( struct net_device * ); 41int atmel_open( struct net_device * );
42 42
43#endif 43#endif
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index 1bd13146c644..17d1fd90f832 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -63,6 +63,7 @@
63 be present but disabled -- but it can then be enabled for specific 63 be present but disabled -- but it can then be enabled for specific
64 modules at load time with a 'pc_debug=#' option to insmod. 64 modules at load time with a 'pc_debug=#' option to insmod.
65*/ 65*/
66
66#ifdef PCMCIA_DEBUG 67#ifdef PCMCIA_DEBUG
67static int pc_debug = PCMCIA_DEBUG; 68static int pc_debug = PCMCIA_DEBUG;
68module_param(pc_debug, int, 0); 69module_param(pc_debug, int, 0);
@@ -285,41 +286,6 @@ static int card_present(void *arg)
285 return 0; 286 return 0;
286} 287}
287 288
288/* list of cards we know about and their firmware requirements.
289 Go either by Manfid or version strings.
290 Cards not in this list will need a firmware parameter to the module
291 in all probability. Note that the SMC 2632 V2 and V3 have the same
292 manfids, so we ignore those and use the version1 strings. */
293
294static struct {
295 int manf, card;
296 char *ver1;
297 AtmelFWType firmware;
298 char *name;
299} card_table[] = {
300 { 0, 0, "WLAN/802.11b PC CARD", ATMEL_FW_TYPE_502D, "Actiontec 802CAT1" },
301 { 0, 0, "ATMEL/AT76C502AR", ATMEL_FW_TYPE_502, "NoName-RFMD" },
302 { 0, 0, "ATMEL/AT76C502AR_D", ATMEL_FW_TYPE_502D, "NoName-revD" },
303 { 0, 0, "ATMEL/AT76C502AR_E", ATMEL_FW_TYPE_502E, "NoName-revE" },
304 { 0, 0, "ATMEL/AT76C504", ATMEL_FW_TYPE_504, "NoName-504" },
305 { 0, 0, "ATMEL/AT76C504A", ATMEL_FW_TYPE_504A_2958, "NoName-504a-2958" },
306 { 0, 0, "ATMEL/AT76C504_R", ATMEL_FW_TYPE_504_2958, "NoName-504-2958" },
307 { MANFID_3COM, 0x0620, NULL, ATMEL_FW_TYPE_502_3COM, "3com 3CRWE62092B" },
308 { MANFID_3COM, 0x0696, NULL, ATMEL_FW_TYPE_502_3COM, "3com 3CRSHPW196" },
309 { 0, 0, "SMC/2632W-V2", ATMEL_FW_TYPE_502, "SMC 2632W-V2" },
310 { 0, 0, "SMC/2632W", ATMEL_FW_TYPE_502D, "SMC 2632W-V3" },
311 { 0xd601, 0x0007, NULL, ATMEL_FW_TYPE_502, "Sitecom WLAN-011" },
312 { 0x01bf, 0x3302, NULL, ATMEL_FW_TYPE_502E, "Belkin F5D6020-V2" },
313 { 0, 0, "BT/Voyager 1020 Laptop Adapter", ATMEL_FW_TYPE_502, "BT Voyager 1020" },
314 { 0, 0, "IEEE 802.11b/Wireless LAN PC Card", ATMEL_FW_TYPE_502, "Siemens Gigaset PC Card II" },
315 { 0, 0, "IEEE 802.11b/Wireless LAN Card S", ATMEL_FW_TYPE_504_2958, "Siemens Gigaset PC Card II" },
316 { 0, 0, "CNet/CNWLC 11Mbps Wireless PC Card V-5", ATMEL_FW_TYPE_502E, "CNet CNWLC-811ARL" },
317 { 0, 0, "Wireless/PC_CARD", ATMEL_FW_TYPE_502D, "Planet WL-3552" },
318 { 0, 0, "OEM/11Mbps Wireless LAN PC Card V-3", ATMEL_FW_TYPE_502, "OEM 11Mbps WLAN PCMCIA Card" },
319 { 0, 0, "11WAVE/11WP611AL-E", ATMEL_FW_TYPE_502E, "11WAVE WaveBuddy" },
320 { 0, 0, "LG/LW2100N", ATMEL_FW_TYPE_502E, "LG LW2100N 11Mbps WLAN PCMCIA Card" },
321};
322
323static void atmel_config(dev_link_t *link) 289static void atmel_config(dev_link_t *link)
324{ 290{
325 client_handle_t handle; 291 client_handle_t handle;
@@ -328,10 +294,11 @@ static void atmel_config(dev_link_t *link)
328 local_info_t *dev; 294 local_info_t *dev;
329 int last_fn, last_ret; 295 int last_fn, last_ret;
330 u_char buf[64]; 296 u_char buf[64];
331 int card_index = -1, done = 0; 297 struct pcmcia_device_id *did;
332 298
333 handle = link->handle; 299 handle = link->handle;
334 dev = link->priv; 300 dev = link->priv;
301 did = handle_to_dev(handle).driver_data;
335 302
336 DEBUG(0, "atmel_config(0x%p)\n", link); 303 DEBUG(0, "atmel_config(0x%p)\n", link);
337 304
@@ -340,59 +307,6 @@ static void atmel_config(dev_link_t *link)
340 tuple.TupleDataMax = sizeof(buf); 307 tuple.TupleDataMax = sizeof(buf);
341 tuple.TupleOffset = 0; 308 tuple.TupleOffset = 0;
342 309
343 tuple.DesiredTuple = CISTPL_MANFID;
344 if (pcmcia_get_first_tuple(handle, &tuple) == 0) {
345 int i;
346 cistpl_manfid_t *manfid;
347 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
348 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
349 manfid = &(parse.manfid);
350 for (i = 0; i < sizeof(card_table)/sizeof(card_table[0]); i++) {
351 if (!card_table[i].ver1 &&
352 manfid->manf == card_table[i].manf &&
353 manfid->card == card_table[i].card) {
354 card_index = i;
355 done = 1;
356 }
357 }
358 }
359
360 tuple.DesiredTuple = CISTPL_VERS_1;
361 if (!done && (pcmcia_get_first_tuple(handle, &tuple) == 0)) {
362 int i, j, k;
363 cistpl_vers_1_t *ver1;
364 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
365 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
366 ver1 = &(parse.version_1);
367
368 for (i = 0; i < sizeof(card_table)/sizeof(card_table[0]); i++) {
369 for (j = 0; j < ver1->ns; j++) {
370 char *p = card_table[i].ver1;
371 char *q = &ver1->str[ver1->ofs[j]];
372 if (!p)
373 goto mismatch;
374 for (k = 0; k < j; k++) {
375 while ((*p != '\0') && (*p != '/')) p++;
376 if (*p == '\0') {
377 if (*q != '\0')
378 goto mismatch;
379 } else {
380 p++;
381 }
382 }
383 while((*q != '\0') && (*p != '\0') &&
384 (*p != '/') && (*p == *q)) p++, q++;
385 if (((*p != '\0') && *p != '/') || *q != '\0')
386 goto mismatch;
387 }
388 card_index = i;
389 break; /* done */
390
391 mismatch:
392 j = 0; /* dummy stmt to shut up compiler */
393 }
394 }
395
396 /* 310 /*
397 This reads the card's CONFIG tuple to find its configuration 311 This reads the card's CONFIG tuple to find its configuration
398 registers. 312 registers.
@@ -509,12 +423,13 @@ static void atmel_config(dev_link_t *link)
509 ((local_info_t*)link->priv)->eth_dev = 423 ((local_info_t*)link->priv)->eth_dev =
510 init_atmel_card(link->irq.AssignedIRQ, 424 init_atmel_card(link->irq.AssignedIRQ,
511 link->io.BasePort1, 425 link->io.BasePort1,
512 card_index == -1 ? ATMEL_FW_TYPE_NONE : card_table[card_index].firmware, 426 did ? did->driver_info : ATMEL_FW_TYPE_NONE,
513 &handle_to_dev(handle), 427 &handle_to_dev(handle),
514 card_present, 428 card_present,
515 link); 429 link);
516 if (!((local_info_t*)link->priv)->eth_dev) 430 if (!((local_info_t*)link->priv)->eth_dev)
517 goto cs_failed; 431 goto cs_failed;
432
518 433
519 /* 434 /*
520 At this point, the dev_node_t structure(s) need to be 435 At this point, the dev_node_t structure(s) need to be
@@ -523,26 +438,7 @@ static void atmel_config(dev_link_t *link)
523 strcpy(dev->node.dev_name, ((local_info_t*)link->priv)->eth_dev->name ); 438 strcpy(dev->node.dev_name, ((local_info_t*)link->priv)->eth_dev->name );
524 dev->node.major = dev->node.minor = 0; 439 dev->node.major = dev->node.minor = 0;
525 link->dev = &dev->node; 440 link->dev = &dev->node;
526 441
527 /* Finally, report what we've done */
528 printk(KERN_INFO "%s: %s%sindex 0x%02x: Vcc %d.%d",
529 dev->node.dev_name,
530 card_index == -1 ? "" : card_table[card_index].name,
531 card_index == -1 ? "" : " ",
532 link->conf.ConfigIndex,
533 link->conf.Vcc/10, link->conf.Vcc%10);
534 if (link->conf.Vpp1)
535 printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10);
536 if (link->conf.Attributes & CONF_ENABLE_IRQ)
537 printk(", irq %d", link->irq.AssignedIRQ);
538 if (link->io.NumPorts1)
539 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
540 link->io.BasePort1+link->io.NumPorts1-1);
541 if (link->io.NumPorts2)
542 printk(" & 0x%04x-0x%04x", link->io.BasePort2,
543 link->io.BasePort2+link->io.NumPorts2-1);
544 printk("\n");
545
546 link->state &= ~DEV_CONFIG_PENDING; 442 link->state &= ~DEV_CONFIG_PENDING;
547 return; 443 return;
548 444
@@ -569,7 +465,7 @@ static void atmel_release(dev_link_t *link)
569 link->dev = NULL; 465 link->dev = NULL;
570 466
571 if (dev) 467 if (dev)
572 stop_atmel_card(dev, 0); 468 stop_atmel_card(dev);
573 ((local_info_t*)link->priv)->eth_dev = NULL; 469 ((local_info_t*)link->priv)->eth_dev = NULL;
574 470
575 /* Don't bother checking to see if these succeed or not */ 471 /* Don't bother checking to see if these succeed or not */
@@ -637,25 +533,47 @@ static int atmel_event(event_t event, int priority,
637} /* atmel_event */ 533} /* atmel_event */
638 534
639/*====================================================================*/ 535/*====================================================================*/
536/* We use the driver_info field to store the correct firmware type for a card. */
537
538#define PCMCIA_DEVICE_MANF_CARD_INFO(manf, card, info) { \
539 .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
540 PCMCIA_DEV_ID_MATCH_CARD_ID, \
541 .manf_id = (manf), \
542 .card_id = (card), \
543 .driver_info = (kernel_ulong_t)(info), }
544
545#define PCMCIA_DEVICE_PROD_ID12_INFO(v1, v2, vh1, vh2, info) { \
546 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
547 PCMCIA_DEV_ID_MATCH_PROD_ID2, \
548 .prod_id = { (v1), (v2), NULL, NULL }, \
549 .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
550 .driver_info = (kernel_ulong_t)(info), }
551
640static struct pcmcia_device_id atmel_ids[] = { 552static struct pcmcia_device_id atmel_ids[] = {
641 PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0620), 553 PCMCIA_DEVICE_MANF_CARD_INFO(0x0101, 0x0620, ATMEL_FW_TYPE_502_3COM),
642 PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0696), 554 PCMCIA_DEVICE_MANF_CARD_INFO(0x0101, 0x0696, ATMEL_FW_TYPE_502_3COM),
643 PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x3302), 555 PCMCIA_DEVICE_MANF_CARD_INFO(0x01bf, 0x3302, ATMEL_FW_TYPE_502E),
644 PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0007), 556 PCMCIA_DEVICE_MANF_CARD_INFO(0xd601, 0x0007, ATMEL_FW_TYPE_502),
645 PCMCIA_DEVICE_PROD_ID12("11WAVE", "11WP611AL-E", 0x9eb2da1f, 0xc9a0d3f9), 557 PCMCIA_DEVICE_PROD_ID12_INFO("11WAVE", "11WP611AL-E", 0x9eb2da1f, 0xc9a0d3f9, ATMEL_FW_TYPE_502E),
646 PCMCIA_DEVICE_PROD_ID12("ATMEL", "AT76C502AR", 0xabda4164, 0x41b37e1f), 558 PCMCIA_DEVICE_PROD_ID12_INFO("ATMEL", "AT76C502AR", 0xabda4164, 0x41b37e1f, ATMEL_FW_TYPE_502),
647 PCMCIA_DEVICE_PROD_ID12("ATMEL", "AT76C504", 0xabda4164, 0x5040670a), 559 PCMCIA_DEVICE_PROD_ID12_INFO("ATMEL", "AT76C502AR_D", 0xabda4164, 0x3675d704, ATMEL_FW_TYPE_502D),
648 PCMCIA_DEVICE_PROD_ID12("ATMEL", "AT76C504A", 0xabda4164, 0xe15ed87f), 560 PCMCIA_DEVICE_PROD_ID12_INFO("ATMEL", "AT76C502AR_E", 0xabda4164, 0x4172e792, ATMEL_FW_TYPE_502E),
649 PCMCIA_DEVICE_PROD_ID12("BT", "Voyager 1020 Laptop Adapter", 0xae49b86a, 0x1e957cd5), 561 PCMCIA_DEVICE_PROD_ID12_INFO("ATMEL", "AT76C504_R", 0xabda4164, 0x917f3d72, ATMEL_FW_TYPE_504_2958),
650 PCMCIA_DEVICE_PROD_ID12("CNet", "CNWLC 11Mbps Wireless PC Card V-5", 0xbc477dde, 0x502fae6b), 562 PCMCIA_DEVICE_PROD_ID12_INFO("ATMEL", "AT76C504", 0xabda4164, 0x5040670a, ATMEL_FW_TYPE_504),
651 PCMCIA_DEVICE_PROD_ID12("IEEE 802.11b", "Wireless LAN PC Card", 0x5b878724, 0x122f1df6), 563 PCMCIA_DEVICE_PROD_ID12_INFO("ATMEL", "AT76C504A", 0xabda4164, 0xe15ed87f, ATMEL_FW_TYPE_504A_2958),
652 PCMCIA_DEVICE_PROD_ID12("OEM", "11Mbps Wireless LAN PC Card V-3", 0xfea54c90, 0x1c5b0f68), 564 PCMCIA_DEVICE_PROD_ID12_INFO("BT", "Voyager 1020 Laptop Adapter", 0xae49b86a, 0x1e957cd5, ATMEL_FW_TYPE_502),
653 PCMCIA_DEVICE_PROD_ID12("SMC", "2632W", 0xc4f8b18b, 0x30f38774), 565 PCMCIA_DEVICE_PROD_ID12_INFO("CNet", "CNWLC 11Mbps Wireless PC Card V-5", 0xbc477dde, 0x502fae6b, ATMEL_FW_TYPE_502E),
654 PCMCIA_DEVICE_PROD_ID12("SMC", "2632W-V2", 0xc4f8b18b, 0x172d1377), 566 PCMCIA_DEVICE_PROD_ID12_INFO("IEEE 802.11b", "Wireless LAN PC Card", 0x5b878724, 0x122f1df6, ATMEL_FW_TYPE_502),
655 PCMCIA_DEVICE_PROD_ID12("Wireless", "PC", 0xa407ecdd, 0x556e4d7e), 567 PCMCIA_DEVICE_PROD_ID12_INFO("IEEE 802.11b", "Wireless LAN Card S", 0x5b878724, 0x5fba533a, ATMEL_FW_TYPE_504_2958),
656 PCMCIA_DEVICE_PROD_ID12("WLAN", "802.11b PC CARD", 0x575c516c, 0xb1f6dbc4), 568 PCMCIA_DEVICE_PROD_ID12_INFO("OEM", "11Mbps Wireless LAN PC Card V-3", 0xfea54c90, 0x1c5b0f68, ATMEL_FW_TYPE_502),
569 PCMCIA_DEVICE_PROD_ID12_INFO("SMC", "2632W", 0xc4f8b18b, 0x30f38774, ATMEL_FW_TYPE_502D),
570 PCMCIA_DEVICE_PROD_ID12_INFO("SMC", "2632W-V2", 0xc4f8b18b, 0x172d1377, ATMEL_FW_TYPE_502),
571 PCMCIA_DEVICE_PROD_ID12_INFO("Wireless", "PC_CARD", 0xa407ecdd, 0x119f6314, ATMEL_FW_TYPE_502D),
572 PCMCIA_DEVICE_PROD_ID12_INFO("WLAN", "802.11b PC CARD", 0x575c516c, 0xb1f6dbc4, ATMEL_FW_TYPE_502D),
573 PCMCIA_DEVICE_PROD_ID12_INFO("LG", "LW2100N", 0xb474d43a, 0x6b1fec94, ATMEL_FW_TYPE_502E),
657 PCMCIA_DEVICE_NULL 574 PCMCIA_DEVICE_NULL
658}; 575};
576
659MODULE_DEVICE_TABLE(pcmcia, atmel_ids); 577MODULE_DEVICE_TABLE(pcmcia, atmel_ids);
660 578
661static struct pcmcia_driver atmel_driver = { 579static struct pcmcia_driver atmel_driver = {
diff --git a/drivers/net/wireless/atmel_pci.c b/drivers/net/wireless/atmel_pci.c
index 2eb00a957bbe..a61b3bc6cccf 100644
--- a/drivers/net/wireless/atmel_pci.c
+++ b/drivers/net/wireless/atmel_pci.c
@@ -72,7 +72,7 @@ static int __devinit atmel_pci_probe(struct pci_dev *pdev,
72 72
73static void __devexit atmel_pci_remove(struct pci_dev *pdev) 73static void __devexit atmel_pci_remove(struct pci_dev *pdev)
74{ 74{
75 stop_atmel_card(pci_get_drvdata(pdev), 1); 75 stop_atmel_card(pci_get_drvdata(pdev));
76} 76}
77 77
78static int __init atmel_init_module(void) 78static int __init atmel_init_module(void)
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 1c8ad2fcad8a..da8c515743e8 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -8,7 +8,7 @@
8 * Author(s): Original Code written by 8 * Author(s): Original Code written by
9 * DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) 9 * DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
10 * Rewritten by 10 * Rewritten by
11 * Frank Pavlic (pavlic@de.ibm.com) and 11 * Frank Pavlic (fpavlic@de.ibm.com) and
12 * Martin Schwidefsky <schwidefsky@de.ibm.com> 12 * Martin Schwidefsky <schwidefsky@de.ibm.com>
13 * 13 *
14 * $Revision: 1.99 $ $Date: 2005/05/11 08:10:17 $ 14 * $Revision: 1.99 $ $Date: 2005/05/11 08:10:17 $
@@ -2342,6 +2342,6 @@ __exit lcs_cleanup_module(void)
2342module_init(lcs_init_module); 2342module_init(lcs_init_module);
2343module_exit(lcs_cleanup_module); 2343module_exit(lcs_cleanup_module);
2344 2344
2345MODULE_AUTHOR("Frank Pavlic <pavlic@de.ibm.com>"); 2345MODULE_AUTHOR("Frank Pavlic <fpavlic@de.ibm.com>");
2346MODULE_LICENSE("GPL"); 2346MODULE_LICENSE("GPL");
2347 2347
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index 38a2441564d7..d238c7ed103b 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -8,6 +8,7 @@
8#include <linux/trdevice.h> 8#include <linux/trdevice.h>
9#include <linux/etherdevice.h> 9#include <linux/etherdevice.h>
10#include <linux/if_vlan.h> 10#include <linux/if_vlan.h>
11#include <linux/ctype.h>
11 12
12#include <net/ipv6.h> 13#include <net/ipv6.h>
13#include <linux/in6.h> 14#include <linux/in6.h>
@@ -24,7 +25,7 @@
24 25
25#include "qeth_mpc.h" 26#include "qeth_mpc.h"
26 27
27#define VERSION_QETH_H "$Revision: 1.142 $" 28#define VERSION_QETH_H "$Revision: 1.152 $"
28 29
29#ifdef CONFIG_QETH_IPV6 30#ifdef CONFIG_QETH_IPV6
30#define QETH_VERSION_IPV6 ":IPv6" 31#define QETH_VERSION_IPV6 ":IPv6"
@@ -718,8 +719,6 @@ struct qeth_reply {
718 atomic_t refcnt; 719 atomic_t refcnt;
719}; 720};
720 721
721#define QETH_BROADCAST_WITH_ECHO 1
722#define QETH_BROADCAST_WITHOUT_ECHO 2
723 722
724struct qeth_card_blkt { 723struct qeth_card_blkt {
725 int time_total; 724 int time_total;
@@ -727,8 +726,10 @@ struct qeth_card_blkt {
727 int inter_packet_jumbo; 726 int inter_packet_jumbo;
728}; 727};
729 728
730 729#define QETH_BROADCAST_WITH_ECHO 0x01
731 730#define QETH_BROADCAST_WITHOUT_ECHO 0x02
731#define QETH_LAYER2_MAC_READ 0x01
732#define QETH_LAYER2_MAC_REGISTERED 0x02
732struct qeth_card_info { 733struct qeth_card_info {
733 unsigned short unit_addr2; 734 unsigned short unit_addr2;
734 unsigned short cula; 735 unsigned short cula;
@@ -736,7 +737,7 @@ struct qeth_card_info {
736 __u16 func_level; 737 __u16 func_level;
737 char mcl_level[QETH_MCL_LENGTH + 1]; 738 char mcl_level[QETH_MCL_LENGTH + 1];
738 int guestlan; 739 int guestlan;
739 int layer2_mac_registered; 740 int mac_bits;
740 int portname_required; 741 int portname_required;
741 int portno; 742 int portno;
742 char portname[9]; 743 char portname[9];
@@ -749,6 +750,7 @@ struct qeth_card_info {
749 int unique_id; 750 int unique_id;
750 struct qeth_card_blkt blkt; 751 struct qeth_card_blkt blkt;
751 __u32 csum_mask; 752 __u32 csum_mask;
753 enum qeth_ipa_promisc_modes promisc_mode;
752}; 754};
753 755
754struct qeth_card_options { 756struct qeth_card_options {
@@ -775,6 +777,7 @@ struct qeth_card_options {
775enum qeth_threads { 777enum qeth_threads {
776 QETH_SET_IP_THREAD = 1, 778 QETH_SET_IP_THREAD = 1,
777 QETH_RECOVER_THREAD = 2, 779 QETH_RECOVER_THREAD = 2,
780 QETH_SET_PROMISC_MODE_THREAD = 4,
778}; 781};
779 782
780struct qeth_osn_info { 783struct qeth_osn_info {
@@ -1074,6 +1077,26 @@ qeth_get_qdio_q_format(struct qeth_card *card)
1074 } 1077 }
1075} 1078}
1076 1079
1080static inline int
1081qeth_isdigit(char * buf)
1082{
1083 while (*buf) {
1084 if (!isdigit(*buf++))
1085 return 0;
1086 }
1087 return 1;
1088}
1089
1090static inline int
1091qeth_isxdigit(char * buf)
1092{
1093 while (*buf) {
1094 if (!isxdigit(*buf++))
1095 return 0;
1096 }
1097 return 1;
1098}
1099
1077static inline void 1100static inline void
1078qeth_ipaddr4_to_string(const __u8 *addr, char *buf) 1101qeth_ipaddr4_to_string(const __u8 *addr, char *buf)
1079{ 1102{
@@ -1090,18 +1113,27 @@ qeth_string_to_ipaddr4(const char *buf, __u8 *addr)
1090 int i; 1113 int i;
1091 1114
1092 start = buf; 1115 start = buf;
1093 for (i = 0; i < 3; i++) { 1116 for (i = 0; i < 4; i++) {
1094 if (!(end = strchr(start, '.'))) 1117 if (i == 3) {
1118 end = strchr(start,0xa);
1119 if (end)
1120 len = end - start;
1121 else
1122 len = strlen(start);
1123 }
1124 else {
1125 end = strchr(start, '.');
1126 len = end - start;
1127 }
1128 if ((len <= 0) || (len > 3))
1095 return -EINVAL; 1129 return -EINVAL;
1096 len = end - start;
1097 memset(abuf, 0, 4); 1130 memset(abuf, 0, 4);
1098 strncpy(abuf, start, len); 1131 strncpy(abuf, start, len);
1132 if (!qeth_isdigit(abuf))
1133 return -EINVAL;
1099 addr[i] = simple_strtoul(abuf, &tmp, 10); 1134 addr[i] = simple_strtoul(abuf, &tmp, 10);
1100 start = end + 1; 1135 start = end + 1;
1101 } 1136 }
1102 memset(abuf, 0, 4);
1103 strcpy(abuf, start);
1104 addr[3] = simple_strtoul(abuf, &tmp, 10);
1105 return 0; 1137 return 0;
1106} 1138}
1107 1139
@@ -1128,18 +1160,27 @@ qeth_string_to_ipaddr6(const char *buf, __u8 *addr)
1128 1160
1129 tmp_addr = (u16 *)addr; 1161 tmp_addr = (u16 *)addr;
1130 start = buf; 1162 start = buf;
1131 for (i = 0; i < 7; i++) { 1163 for (i = 0; i < 8; i++) {
1132 if (!(end = strchr(start, ':'))) 1164 if (i == 7) {
1165 end = strchr(start,0xa);
1166 if (end)
1167 len = end - start;
1168 else
1169 len = strlen(start);
1170 }
1171 else {
1172 end = strchr(start, ':');
1173 len = end - start;
1174 }
1175 if ((len <= 0) || (len > 4))
1133 return -EINVAL; 1176 return -EINVAL;
1134 len = end - start;
1135 memset(abuf, 0, 5); 1177 memset(abuf, 0, 5);
1136 strncpy(abuf, start, len); 1178 strncpy(abuf, start, len);
1179 if (!qeth_isxdigit(abuf))
1180 return -EINVAL;
1137 tmp_addr[i] = simple_strtoul(abuf, &tmp, 16); 1181 tmp_addr[i] = simple_strtoul(abuf, &tmp, 16);
1138 start = end + 1; 1182 start = end + 1;
1139 } 1183 }
1140 memset(abuf, 0, 5);
1141 strcpy(abuf, start);
1142 tmp_addr[7] = simple_strtoul(abuf, &tmp, 16);
1143 return 0; 1184 return 0;
1144} 1185}
1145 1186
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index 692003c9f896..99cceb242ec4 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * linux/drivers/s390/net/qeth_main.c ($Revision: 1.224 $) 3 * linux/drivers/s390/net/qeth_main.c ($Revision: 1.242 $)
4 * 4 *
5 * Linux on zSeries OSA Express and HiperSockets support 5 * Linux on zSeries OSA Express and HiperSockets support
6 * 6 *
@@ -9,10 +9,10 @@
9 * Author(s): Original Code written by 9 * Author(s): Original Code written by
10 * Utz Bacher (utz.bacher@de.ibm.com) 10 * Utz Bacher (utz.bacher@de.ibm.com)
11 * Rewritten by 11 * Rewritten by
12 * Frank Pavlic (pavlic@de.ibm.com) and 12 * Frank Pavlic (fpavlic@de.ibm.com) and
13 * Thomas Spatzier <tspat@de.ibm.com> 13 * Thomas Spatzier <tspat@de.ibm.com>
14 * 14 *
15 * $Revision: 1.224 $ $Date: 2005/05/04 20:19:18 $ 15 * $Revision: 1.242 $ $Date: 2005/05/04 20:19:18 $
16 * 16 *
17 * This program is free software; you can redistribute it and/or modify 17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by 18 * it under the terms of the GNU General Public License as published by
@@ -72,7 +72,7 @@
72#include "qeth_eddp.h" 72#include "qeth_eddp.h"
73#include "qeth_tso.h" 73#include "qeth_tso.h"
74 74
75#define VERSION_QETH_C "$Revision: 1.224 $" 75#define VERSION_QETH_C "$Revision: 1.242 $"
76static const char *version = "qeth S/390 OSA-Express driver"; 76static const char *version = "qeth S/390 OSA-Express driver";
77 77
78/** 78/**
@@ -160,6 +160,9 @@ static void
160qeth_set_multicast_list(struct net_device *); 160qeth_set_multicast_list(struct net_device *);
161 161
162static void 162static void
163qeth_setadp_promisc_mode(struct qeth_card *);
164
165static void
163qeth_notify_processes(void) 166qeth_notify_processes(void)
164{ 167{
165 /*notify all registered processes */ 168 /*notify all registered processes */
@@ -602,11 +605,20 @@ __qeth_ref_ip_on_card(struct qeth_card *card, struct qeth_ipaddr *todo,
602 int found = 0; 605 int found = 0;
603 606
604 list_for_each_entry(addr, &card->ip_list, entry) { 607 list_for_each_entry(addr, &card->ip_list, entry) {
608 if (card->options.layer2) {
609 if ((addr->type == todo->type) &&
610 (memcmp(&addr->mac, &todo->mac,
611 OSA_ADDR_LEN) == 0)) {
612 found = 1;
613 break;
614 }
615 continue;
616 }
605 if ((addr->proto == QETH_PROT_IPV4) && 617 if ((addr->proto == QETH_PROT_IPV4) &&
606 (todo->proto == QETH_PROT_IPV4) && 618 (todo->proto == QETH_PROT_IPV4) &&
607 (addr->type == todo->type) && 619 (addr->type == todo->type) &&
608 (addr->u.a4.addr == todo->u.a4.addr) && 620 (addr->u.a4.addr == todo->u.a4.addr) &&
609 (addr->u.a4.mask == todo->u.a4.mask) ){ 621 (addr->u.a4.mask == todo->u.a4.mask)) {
610 found = 1; 622 found = 1;
611 break; 623 break;
612 } 624 }
@@ -615,12 +627,12 @@ __qeth_ref_ip_on_card(struct qeth_card *card, struct qeth_ipaddr *todo,
615 (addr->type == todo->type) && 627 (addr->type == todo->type) &&
616 (addr->u.a6.pfxlen == todo->u.a6.pfxlen) && 628 (addr->u.a6.pfxlen == todo->u.a6.pfxlen) &&
617 (memcmp(&addr->u.a6.addr, &todo->u.a6.addr, 629 (memcmp(&addr->u.a6.addr, &todo->u.a6.addr,
618 sizeof(struct in6_addr)) == 0)) { 630 sizeof(struct in6_addr)) == 0)) {
619 found = 1; 631 found = 1;
620 break; 632 break;
621 } 633 }
622 } 634 }
623 if (found){ 635 if (found) {
624 addr->users += todo->users; 636 addr->users += todo->users;
625 if (addr->users <= 0){ 637 if (addr->users <= 0){
626 *__addr = addr; 638 *__addr = addr;
@@ -632,7 +644,7 @@ __qeth_ref_ip_on_card(struct qeth_card *card, struct qeth_ipaddr *todo,
632 return 0; 644 return 0;
633 } 645 }
634 } 646 }
635 if (todo->users > 0){ 647 if (todo->users > 0) {
636 /* for VIPA and RXIP limit refcount to 1 */ 648 /* for VIPA and RXIP limit refcount to 1 */
637 if (todo->type != QETH_IP_TYPE_NORMAL) 649 if (todo->type != QETH_IP_TYPE_NORMAL)
638 todo->users = 1; 650 todo->users = 1;
@@ -682,12 +694,22 @@ __qeth_insert_ip_todo(struct qeth_card *card, struct qeth_ipaddr *addr, int add)
682 if ((addr->type == QETH_IP_TYPE_DEL_ALL_MC) && 694 if ((addr->type == QETH_IP_TYPE_DEL_ALL_MC) &&
683 (tmp->type == QETH_IP_TYPE_DEL_ALL_MC)) 695 (tmp->type == QETH_IP_TYPE_DEL_ALL_MC))
684 return 0; 696 return 0;
697 if (card->options.layer2) {
698 if ((tmp->type == addr->type) &&
699 (tmp->is_multicast == addr->is_multicast) &&
700 (memcmp(&tmp->mac, &addr->mac,
701 OSA_ADDR_LEN) == 0)) {
702 found = 1;
703 break;
704 }
705 continue;
706 }
685 if ((tmp->proto == QETH_PROT_IPV4) && 707 if ((tmp->proto == QETH_PROT_IPV4) &&
686 (addr->proto == QETH_PROT_IPV4) && 708 (addr->proto == QETH_PROT_IPV4) &&
687 (tmp->type == addr->type) && 709 (tmp->type == addr->type) &&
688 (tmp->is_multicast == addr->is_multicast) && 710 (tmp->is_multicast == addr->is_multicast) &&
689 (tmp->u.a4.addr == addr->u.a4.addr) && 711 (tmp->u.a4.addr == addr->u.a4.addr) &&
690 (tmp->u.a4.mask == addr->u.a4.mask) ){ 712 (tmp->u.a4.mask == addr->u.a4.mask)) {
691 found = 1; 713 found = 1;
692 break; 714 break;
693 } 715 }
@@ -697,7 +719,7 @@ __qeth_insert_ip_todo(struct qeth_card *card, struct qeth_ipaddr *addr, int add)
697 (tmp->is_multicast == addr->is_multicast) && 719 (tmp->is_multicast == addr->is_multicast) &&
698 (tmp->u.a6.pfxlen == addr->u.a6.pfxlen) && 720 (tmp->u.a6.pfxlen == addr->u.a6.pfxlen) &&
699 (memcmp(&tmp->u.a6.addr, &addr->u.a6.addr, 721 (memcmp(&tmp->u.a6.addr, &addr->u.a6.addr,
700 sizeof(struct in6_addr)) == 0) ){ 722 sizeof(struct in6_addr)) == 0)) {
701 found = 1; 723 found = 1;
702 break; 724 break;
703 } 725 }
@@ -707,7 +729,7 @@ __qeth_insert_ip_todo(struct qeth_card *card, struct qeth_ipaddr *addr, int add)
707 tmp->users += addr->users; 729 tmp->users += addr->users;
708 else 730 else
709 tmp->users += add? 1:-1; 731 tmp->users += add? 1:-1;
710 if (tmp->users == 0){ 732 if (tmp->users == 0) {
711 list_del(&tmp->entry); 733 list_del(&tmp->entry);
712 kfree(tmp); 734 kfree(tmp);
713 } 735 }
@@ -738,12 +760,15 @@ qeth_delete_ip(struct qeth_card *card, struct qeth_ipaddr *addr)
738 unsigned long flags; 760 unsigned long flags;
739 int rc = 0; 761 int rc = 0;
740 762
741 QETH_DBF_TEXT(trace,4,"delip"); 763 QETH_DBF_TEXT(trace, 4, "delip");
742 if (addr->proto == QETH_PROT_IPV4) 764
743 QETH_DBF_HEX(trace,4,&addr->u.a4.addr,4); 765 if (card->options.layer2)
766 QETH_DBF_HEX(trace, 4, &addr->mac, 6);
767 else if (addr->proto == QETH_PROT_IPV4)
768 QETH_DBF_HEX(trace, 4, &addr->u.a4.addr, 4);
744 else { 769 else {
745 QETH_DBF_HEX(trace,4,&addr->u.a6.addr,8); 770 QETH_DBF_HEX(trace, 4, &addr->u.a6.addr, 8);
746 QETH_DBF_HEX(trace,4,((char *)&addr->u.a6.addr)+8,8); 771 QETH_DBF_HEX(trace, 4, ((char *)&addr->u.a6.addr) + 8, 8);
747 } 772 }
748 spin_lock_irqsave(&card->ip_lock, flags); 773 spin_lock_irqsave(&card->ip_lock, flags);
749 rc = __qeth_insert_ip_todo(card, addr, 0); 774 rc = __qeth_insert_ip_todo(card, addr, 0);
@@ -757,12 +782,14 @@ qeth_add_ip(struct qeth_card *card, struct qeth_ipaddr *addr)
757 unsigned long flags; 782 unsigned long flags;
758 int rc = 0; 783 int rc = 0;
759 784
760 QETH_DBF_TEXT(trace,4,"addip"); 785 QETH_DBF_TEXT(trace, 4, "addip");
761 if (addr->proto == QETH_PROT_IPV4) 786 if (card->options.layer2)
762 QETH_DBF_HEX(trace,4,&addr->u.a4.addr,4); 787 QETH_DBF_HEX(trace, 4, &addr->mac, 6);
788 else if (addr->proto == QETH_PROT_IPV4)
789 QETH_DBF_HEX(trace, 4, &addr->u.a4.addr, 4);
763 else { 790 else {
764 QETH_DBF_HEX(trace,4,&addr->u.a6.addr,8); 791 QETH_DBF_HEX(trace, 4, &addr->u.a6.addr, 8);
765 QETH_DBF_HEX(trace,4,((char *)&addr->u.a6.addr)+8,8); 792 QETH_DBF_HEX(trace, 4, ((char *)&addr->u.a6.addr) + 8, 8);
766 } 793 }
767 spin_lock_irqsave(&card->ip_lock, flags); 794 spin_lock_irqsave(&card->ip_lock, flags);
768 rc = __qeth_insert_ip_todo(card, addr, 1); 795 rc = __qeth_insert_ip_todo(card, addr, 1);
@@ -775,7 +802,7 @@ __qeth_delete_all_mc(struct qeth_card *card, unsigned long *flags)
775{ 802{
776 struct qeth_ipaddr *addr, *tmp; 803 struct qeth_ipaddr *addr, *tmp;
777 int rc; 804 int rc;
778 805again:
779 list_for_each_entry_safe(addr, tmp, &card->ip_list, entry) { 806 list_for_each_entry_safe(addr, tmp, &card->ip_list, entry) {
780 if (addr->is_multicast) { 807 if (addr->is_multicast) {
781 spin_unlock_irqrestore(&card->ip_lock, *flags); 808 spin_unlock_irqrestore(&card->ip_lock, *flags);
@@ -784,6 +811,7 @@ __qeth_delete_all_mc(struct qeth_card *card, unsigned long *flags)
784 if (!rc) { 811 if (!rc) {
785 list_del(&addr->entry); 812 list_del(&addr->entry);
786 kfree(addr); 813 kfree(addr);
814 goto again;
787 } 815 }
788 } 816 }
789 } 817 }
@@ -851,6 +879,7 @@ qeth_set_ip_addr_list(struct qeth_card *card)
851 879
852static void qeth_delete_mc_addresses(struct qeth_card *); 880static void qeth_delete_mc_addresses(struct qeth_card *);
853static void qeth_add_multicast_ipv4(struct qeth_card *); 881static void qeth_add_multicast_ipv4(struct qeth_card *);
882static void qeth_layer2_add_multicast(struct qeth_card *);
854#ifdef CONFIG_QETH_IPV6 883#ifdef CONFIG_QETH_IPV6
855static void qeth_add_multicast_ipv6(struct qeth_card *); 884static void qeth_add_multicast_ipv6(struct qeth_card *);
856#endif 885#endif
@@ -939,6 +968,24 @@ qeth_register_ip_addresses(void *ptr)
939 return 0; 968 return 0;
940} 969}
941 970
971/*
972 * Drive the SET_PROMISC_MODE thread
973 */
974static int
975qeth_set_promisc_mode(void *ptr)
976{
977 struct qeth_card *card = (struct qeth_card *) ptr;
978
979 daemonize("qeth_setprm");
980 QETH_DBF_TEXT(trace,4,"setprm1");
981 if (!qeth_do_run_thread(card, QETH_SET_PROMISC_MODE_THREAD))
982 return 0;
983 QETH_DBF_TEXT(trace,4,"setprm2");
984 qeth_setadp_promisc_mode(card);
985 qeth_clear_thread_running_bit(card, QETH_SET_PROMISC_MODE_THREAD);
986 return 0;
987}
988
942static int 989static int
943qeth_recover(void *ptr) 990qeth_recover(void *ptr)
944{ 991{
@@ -1005,6 +1052,8 @@ qeth_start_kernel_thread(struct qeth_card *card)
1005 1052
1006 if (qeth_do_start_thread(card, QETH_SET_IP_THREAD)) 1053 if (qeth_do_start_thread(card, QETH_SET_IP_THREAD))
1007 kernel_thread(qeth_register_ip_addresses, (void *)card,SIGCHLD); 1054 kernel_thread(qeth_register_ip_addresses, (void *)card,SIGCHLD);
1055 if (qeth_do_start_thread(card, QETH_SET_PROMISC_MODE_THREAD))
1056 kernel_thread(qeth_set_promisc_mode, (void *)card, SIGCHLD);
1008 if (qeth_do_start_thread(card, QETH_RECOVER_THREAD)) 1057 if (qeth_do_start_thread(card, QETH_RECOVER_THREAD))
1009 kernel_thread(qeth_recover, (void *) card, SIGCHLD); 1058 kernel_thread(qeth_recover, (void *) card, SIGCHLD);
1010} 1059}
@@ -3749,7 +3798,7 @@ qeth_open(struct net_device *dev)
3749 3798
3750 if ( (card->info.type != QETH_CARD_TYPE_OSN) && 3799 if ( (card->info.type != QETH_CARD_TYPE_OSN) &&
3751 (card->options.layer2) && 3800 (card->options.layer2) &&
3752 (!card->info.layer2_mac_registered)) { 3801 (!(card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED))) {
3753 QETH_DBF_TEXT(trace,4,"nomacadr"); 3802 QETH_DBF_TEXT(trace,4,"nomacadr");
3754 return -EPERM; 3803 return -EPERM;
3755 } 3804 }
@@ -4311,6 +4360,8 @@ qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
4311out: 4360out:
4312 if (flush_count) 4361 if (flush_count)
4313 qeth_flush_buffers(queue, 0, start_index, flush_count); 4362 qeth_flush_buffers(queue, 0, start_index, flush_count);
4363 else if (!atomic_read(&queue->set_pci_flags_count))
4364 atomic_swap(&queue->state, QETH_OUT_Q_LOCKED_FLUSH);
4314 /* 4365 /*
4315 * queue->state will go from LOCKED -> UNLOCKED or from 4366 * queue->state will go from LOCKED -> UNLOCKED or from
4316 * LOCKED_FLUSH -> LOCKED if output_handler wanted to 'notify' us 4367 * LOCKED_FLUSH -> LOCKED if output_handler wanted to 'notify' us
@@ -4975,6 +5026,10 @@ qeth_default_setassparms_cb(struct qeth_card *, struct qeth_reply *,
4975 unsigned long); 5026 unsigned long);
4976 5027
4977static int 5028static int
5029qeth_default_setadapterparms_cb(struct qeth_card *card,
5030 struct qeth_reply *reply,
5031 unsigned long data);
5032static int
4978qeth_send_setassparms(struct qeth_card *, struct qeth_cmd_buffer *, 5033qeth_send_setassparms(struct qeth_card *, struct qeth_cmd_buffer *,
4979 __u16, long, 5034 __u16, long,
4980 int (*reply_cb) 5035 int (*reply_cb)
@@ -5301,8 +5356,7 @@ qeth_free_vlan_addresses4(struct qeth_card *card, unsigned short vid)
5301 struct qeth_ipaddr *addr; 5356 struct qeth_ipaddr *addr;
5302 5357
5303 QETH_DBF_TEXT(trace, 4, "frvaddr4"); 5358 QETH_DBF_TEXT(trace, 4, "frvaddr4");
5304 if (!card->vlangrp) 5359
5305 return;
5306 rcu_read_lock(); 5360 rcu_read_lock();
5307 in_dev = __in_dev_get_rcu(card->vlangrp->vlan_devices[vid]); 5361 in_dev = __in_dev_get_rcu(card->vlangrp->vlan_devices[vid]);
5308 if (!in_dev) 5362 if (!in_dev)
@@ -5330,8 +5384,7 @@ qeth_free_vlan_addresses6(struct qeth_card *card, unsigned short vid)
5330 struct qeth_ipaddr *addr; 5384 struct qeth_ipaddr *addr;
5331 5385
5332 QETH_DBF_TEXT(trace, 4, "frvaddr6"); 5386 QETH_DBF_TEXT(trace, 4, "frvaddr6");
5333 if (!card->vlangrp) 5387
5334 return;
5335 in6_dev = in6_dev_get(card->vlangrp->vlan_devices[vid]); 5388 in6_dev = in6_dev_get(card->vlangrp->vlan_devices[vid]);
5336 if (!in6_dev) 5389 if (!in6_dev)
5337 return; 5390 return;
@@ -5351,10 +5404,38 @@ qeth_free_vlan_addresses6(struct qeth_card *card, unsigned short vid)
5351} 5404}
5352 5405
5353static void 5406static void
5407qeth_free_vlan_addresses(struct qeth_card *card, unsigned short vid)
5408{
5409 if (card->options.layer2 || !card->vlangrp)
5410 return;
5411 qeth_free_vlan_addresses4(card, vid);
5412 qeth_free_vlan_addresses6(card, vid);
5413}
5414
5415static int
5416qeth_layer2_send_setdelvlan_cb(struct qeth_card *card,
5417 struct qeth_reply *reply,
5418 unsigned long data)
5419{
5420 struct qeth_ipa_cmd *cmd;
5421
5422 QETH_DBF_TEXT(trace, 2, "L2sdvcb");
5423 cmd = (struct qeth_ipa_cmd *) data;
5424 if (cmd->hdr.return_code) {
5425 PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. "
5426 "Continuing\n",cmd->data.setdelvlan.vlan_id,
5427 QETH_CARD_IFNAME(card), cmd->hdr.return_code);
5428 QETH_DBF_TEXT_(trace, 2, "L2VL%4x", cmd->hdr.command);
5429 QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card));
5430 QETH_DBF_TEXT_(trace, 2, "err%d", cmd->hdr.return_code);
5431 }
5432 return 0;
5433}
5434
5435static int
5354qeth_layer2_send_setdelvlan(struct qeth_card *card, __u16 i, 5436qeth_layer2_send_setdelvlan(struct qeth_card *card, __u16 i,
5355 enum qeth_ipa_cmds ipacmd) 5437 enum qeth_ipa_cmds ipacmd)
5356{ 5438{
5357 int rc;
5358 struct qeth_ipa_cmd *cmd; 5439 struct qeth_ipa_cmd *cmd;
5359 struct qeth_cmd_buffer *iob; 5440 struct qeth_cmd_buffer *iob;
5360 5441
@@ -5362,15 +5443,8 @@ qeth_layer2_send_setdelvlan(struct qeth_card *card, __u16 i,
5362 iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4); 5443 iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4);
5363 cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); 5444 cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
5364 cmd->data.setdelvlan.vlan_id = i; 5445 cmd->data.setdelvlan.vlan_id = i;
5365 5446 return qeth_send_ipa_cmd(card, iob,
5366 rc = qeth_send_ipa_cmd(card, iob, NULL, NULL); 5447 qeth_layer2_send_setdelvlan_cb, NULL);
5367 if (rc) {
5368 PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. "
5369 "Continuing\n",i, QETH_CARD_IFNAME(card), rc);
5370 QETH_DBF_TEXT_(trace, 2, "L2VL%4x", ipacmd);
5371 QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card));
5372 QETH_DBF_TEXT_(trace, 2, "err%d", rc);
5373 }
5374} 5448}
5375 5449
5376static void 5450static void
@@ -5420,8 +5494,7 @@ qeth_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
5420 qeth_free_vlan_skbs(card, vid); 5494 qeth_free_vlan_skbs(card, vid);
5421 spin_lock_irqsave(&card->vlanlock, flags); 5495 spin_lock_irqsave(&card->vlanlock, flags);
5422 /* unregister IP addresses of vlan device */ 5496 /* unregister IP addresses of vlan device */
5423 qeth_free_vlan_addresses4(card, vid); 5497 qeth_free_vlan_addresses(card, vid);
5424 qeth_free_vlan_addresses6(card, vid);
5425 if (card->vlangrp) 5498 if (card->vlangrp)
5426 card->vlangrp->vlan_devices[vid] = NULL; 5499 card->vlangrp->vlan_devices[vid] = NULL;
5427 spin_unlock_irqrestore(&card->vlanlock, flags); 5500 spin_unlock_irqrestore(&card->vlanlock, flags);
@@ -5430,6 +5503,59 @@ qeth_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
5430 qeth_set_multicast_list(card->dev); 5503 qeth_set_multicast_list(card->dev);
5431} 5504}
5432#endif 5505#endif
5506/**
5507 * Examine hardware response to SET_PROMISC_MODE
5508 */
5509static int
5510qeth_setadp_promisc_mode_cb(struct qeth_card *card,
5511 struct qeth_reply *reply,
5512 unsigned long data)
5513{
5514 struct qeth_ipa_cmd *cmd;
5515 struct qeth_ipacmd_setadpparms *setparms;
5516
5517 QETH_DBF_TEXT(trace,4,"prmadpcb");
5518
5519 cmd = (struct qeth_ipa_cmd *) data;
5520 setparms = &(cmd->data.setadapterparms);
5521
5522 qeth_default_setadapterparms_cb(card, reply, (unsigned long)cmd);
5523 if (cmd->hdr.return_code) {
5524 QETH_DBF_TEXT_(trace,4,"prmrc%2.2x",cmd->hdr.return_code);
5525 setparms->data.mode = SET_PROMISC_MODE_OFF;
5526 }
5527 card->info.promisc_mode = setparms->data.mode;
5528 return 0;
5529}
5530/*
5531 * Set promiscuous mode (on or off) (SET_PROMISC_MODE command)
5532 */
5533static void
5534qeth_setadp_promisc_mode(struct qeth_card *card)
5535{
5536 enum qeth_ipa_promisc_modes mode;
5537 struct net_device *dev = card->dev;
5538 struct qeth_cmd_buffer *iob;
5539 struct qeth_ipa_cmd *cmd;
5540
5541 QETH_DBF_TEXT(trace, 4, "setprom");
5542
5543 if (((dev->flags & IFF_PROMISC) &&
5544 (card->info.promisc_mode == SET_PROMISC_MODE_ON)) ||
5545 (!(dev->flags & IFF_PROMISC) &&
5546 (card->info.promisc_mode == SET_PROMISC_MODE_OFF)))
5547 return;
5548 mode = SET_PROMISC_MODE_OFF;
5549 if (dev->flags & IFF_PROMISC)
5550 mode = SET_PROMISC_MODE_ON;
5551 QETH_DBF_TEXT_(trace, 4, "mode:%x", mode);
5552
5553 iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_PROMISC_MODE,
5554 sizeof(struct qeth_ipacmd_setadpparms));
5555 cmd = (struct qeth_ipa_cmd *)(iob->data + IPA_PDU_HEADER_SIZE);
5556 cmd->data.setadapterparms.data.mode = mode;
5557 qeth_send_ipa_cmd(card, iob, qeth_setadp_promisc_mode_cb, NULL);
5558}
5433 5559
5434/** 5560/**
5435 * set multicast address on card 5561 * set multicast address on card
@@ -5444,12 +5570,22 @@ qeth_set_multicast_list(struct net_device *dev)
5444 5570
5445 QETH_DBF_TEXT(trace,3,"setmulti"); 5571 QETH_DBF_TEXT(trace,3,"setmulti");
5446 qeth_delete_mc_addresses(card); 5572 qeth_delete_mc_addresses(card);
5573 if (card->options.layer2) {
5574 qeth_layer2_add_multicast(card);
5575 goto out;
5576 }
5447 qeth_add_multicast_ipv4(card); 5577 qeth_add_multicast_ipv4(card);
5448#ifdef CONFIG_QETH_IPV6 5578#ifdef CONFIG_QETH_IPV6
5449 qeth_add_multicast_ipv6(card); 5579 qeth_add_multicast_ipv6(card);
5450#endif 5580#endif
5581out:
5451 if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0) 5582 if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0)
5452 schedule_work(&card->kernel_thread_starter); 5583 schedule_work(&card->kernel_thread_starter);
5584 if (!qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE))
5585 return;
5586 if (qeth_set_thread_start_bit(card, QETH_SET_PROMISC_MODE_THREAD)==0)
5587 schedule_work(&card->kernel_thread_starter);
5588
5453} 5589}
5454 5590
5455static int 5591static int
@@ -5657,6 +5793,24 @@ qeth_add_multicast_ipv4(struct qeth_card *card)
5657 in_dev_put(in4_dev); 5793 in_dev_put(in4_dev);
5658} 5794}
5659 5795
5796static void
5797qeth_layer2_add_multicast(struct qeth_card *card)
5798{
5799 struct qeth_ipaddr *ipm;
5800 struct dev_mc_list *dm;
5801
5802 QETH_DBF_TEXT(trace,4,"L2addmc");
5803 for (dm = card->dev->mc_list; dm; dm = dm->next) {
5804 ipm = qeth_get_addr_buffer(QETH_PROT_IPV4);
5805 if (!ipm)
5806 continue;
5807 memcpy(ipm->mac,dm->dmi_addr,MAX_ADDR_LEN);
5808 ipm->is_multicast = 1;
5809 if (!qeth_add_ip(card, ipm))
5810 kfree(ipm);
5811 }
5812}
5813
5660#ifdef CONFIG_QETH_IPV6 5814#ifdef CONFIG_QETH_IPV6
5661static inline void 5815static inline void
5662qeth_add_mc6(struct qeth_card *card, struct inet6_dev *in6_dev) 5816qeth_add_mc6(struct qeth_card *card, struct inet6_dev *in6_dev)
@@ -5825,10 +5979,10 @@ qeth_layer2_send_setmac_cb(struct qeth_card *card,
5825 PRINT_WARN("Error in registering MAC address on " \ 5979 PRINT_WARN("Error in registering MAC address on " \
5826 "device %s: x%x\n", CARD_BUS_ID(card), 5980 "device %s: x%x\n", CARD_BUS_ID(card),
5827 cmd->hdr.return_code); 5981 cmd->hdr.return_code);
5828 card->info.layer2_mac_registered = 0; 5982 card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED;
5829 cmd->hdr.return_code = -EIO; 5983 cmd->hdr.return_code = -EIO;
5830 } else { 5984 } else {
5831 card->info.layer2_mac_registered = 1; 5985 card->info.mac_bits |= QETH_LAYER2_MAC_REGISTERED;
5832 memcpy(card->dev->dev_addr,cmd->data.setdelmac.mac, 5986 memcpy(card->dev->dev_addr,cmd->data.setdelmac.mac,
5833 OSA_ADDR_LEN); 5987 OSA_ADDR_LEN);
5834 PRINT_INFO("MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x " 5988 PRINT_INFO("MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x "
@@ -5866,7 +6020,7 @@ qeth_layer2_send_delmac_cb(struct qeth_card *card,
5866 cmd->hdr.return_code = -EIO; 6020 cmd->hdr.return_code = -EIO;
5867 return 0; 6021 return 0;
5868 } 6022 }
5869 card->info.layer2_mac_registered = 0; 6023 card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED;
5870 6024
5871 return 0; 6025 return 0;
5872} 6026}
@@ -5874,7 +6028,7 @@ static int
5874qeth_layer2_send_delmac(struct qeth_card *card, __u8 *mac) 6028qeth_layer2_send_delmac(struct qeth_card *card, __u8 *mac)
5875{ 6029{
5876 QETH_DBF_TEXT(trace, 2, "L2Delmac"); 6030 QETH_DBF_TEXT(trace, 2, "L2Delmac");
5877 if (!card->info.layer2_mac_registered) 6031 if (!(card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED))
5878 return 0; 6032 return 0;
5879 return qeth_layer2_send_setdelmac(card, mac, IPA_CMD_DELVMAC, 6033 return qeth_layer2_send_setdelmac(card, mac, IPA_CMD_DELVMAC,
5880 qeth_layer2_send_delmac_cb); 6034 qeth_layer2_send_delmac_cb);
@@ -5896,7 +6050,7 @@ qeth_layer2_set_mac_address(struct net_device *dev, void *p)
5896 card = (struct qeth_card *) dev->priv; 6050 card = (struct qeth_card *) dev->priv;
5897 6051
5898 if (!card->options.layer2) { 6052 if (!card->options.layer2) {
5899 PRINT_WARN("Setting MAC address on %s is not supported" 6053 PRINT_WARN("Setting MAC address on %s is not supported "
5900 "in Layer 3 mode.\n", dev->name); 6054 "in Layer 3 mode.\n", dev->name);
5901 QETH_DBF_TEXT(trace, 3, "setmcLY3"); 6055 QETH_DBF_TEXT(trace, 3, "setmcLY3");
5902 return -EOPNOTSUPP; 6056 return -EOPNOTSUPP;
@@ -6441,6 +6595,8 @@ qeth_default_setadapterparms_cb(struct qeth_card *card,
6441 return 0; 6595 return 0;
6442} 6596}
6443 6597
6598
6599
6444static int 6600static int
6445qeth_query_setadapterparms_cb(struct qeth_card *card, struct qeth_reply *reply, 6601qeth_query_setadapterparms_cb(struct qeth_card *card, struct qeth_reply *reply,
6446 unsigned long data) 6602 unsigned long data)
@@ -6481,8 +6637,13 @@ qeth_setadpparms_change_macaddr_cb(struct qeth_card *card,
6481 QETH_DBF_TEXT(trace,4,"chgmaccb"); 6637 QETH_DBF_TEXT(trace,4,"chgmaccb");
6482 6638
6483 cmd = (struct qeth_ipa_cmd *) data; 6639 cmd = (struct qeth_ipa_cmd *) data;
6484 memcpy(card->dev->dev_addr, 6640 if (!card->options.layer2 || card->info.guestlan ||
6485 &cmd->data.setadapterparms.data.change_addr.addr,OSA_ADDR_LEN); 6641 !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) {
6642 memcpy(card->dev->dev_addr,
6643 &cmd->data.setadapterparms.data.change_addr.addr,
6644 OSA_ADDR_LEN);
6645 card->info.mac_bits |= QETH_LAYER2_MAC_READ;
6646 }
6486 qeth_default_setadapterparms_cb(card, reply, (unsigned long) cmd); 6647 qeth_default_setadapterparms_cb(card, reply, (unsigned long) cmd);
6487 return 0; 6648 return 0;
6488} 6649}
@@ -6602,6 +6763,12 @@ qeth_layer2_initialize(struct qeth_card *card)
6602 QETH_DBF_TEXT(setup, 2, "doL2init"); 6763 QETH_DBF_TEXT(setup, 2, "doL2init");
6603 QETH_DBF_TEXT_(setup, 2, "doL2%s", CARD_BUS_ID(card)); 6764 QETH_DBF_TEXT_(setup, 2, "doL2%s", CARD_BUS_ID(card));
6604 6765
6766 rc = qeth_query_setadapterparms(card);
6767 if (rc) {
6768 PRINT_WARN("could not query adapter parameters on device %s: "
6769 "x%x\n", CARD_BUS_ID(card), rc);
6770 }
6771
6605 rc = qeth_setadpparms_change_macaddr(card); 6772 rc = qeth_setadpparms_change_macaddr(card);
6606 if (rc) { 6773 if (rc) {
6607 PRINT_WARN("couldn't get MAC address on " 6774 PRINT_WARN("couldn't get MAC address on "
@@ -8548,7 +8715,7 @@ EXPORT_SYMBOL(qeth_osn_deregister);
8548EXPORT_SYMBOL(qeth_osn_assist); 8715EXPORT_SYMBOL(qeth_osn_assist);
8549module_init(qeth_init); 8716module_init(qeth_init);
8550module_exit(qeth_exit); 8717module_exit(qeth_exit);
8551MODULE_AUTHOR("Frank Pavlic <pavlic@de.ibm.com>"); 8718MODULE_AUTHOR("Frank Pavlic <fpavlic@de.ibm.com>");
8552MODULE_DESCRIPTION("Linux on zSeries OSA Express and HiperSockets support\n" \ 8719MODULE_DESCRIPTION("Linux on zSeries OSA Express and HiperSockets support\n" \
8553 "Copyright 2000,2003 IBM Corporation\n"); 8720 "Copyright 2000,2003 IBM Corporation\n");
8554 8721
diff --git a/drivers/s390/net/qeth_mpc.c b/drivers/s390/net/qeth_mpc.c
index 30e053d3cac2..f0a080a9e515 100644
--- a/drivers/s390/net/qeth_mpc.c
+++ b/drivers/s390/net/qeth_mpc.c
@@ -4,7 +4,7 @@
4 * Linux on zSeries OSA Express and HiperSockets support 4 * Linux on zSeries OSA Express and HiperSockets support
5 * 5 *
6 * Copyright 2000,2003 IBM Corporation 6 * Copyright 2000,2003 IBM Corporation
7 * Author(s): Frank Pavlic <pavlic@de.ibm.com> 7 * Author(s): Frank Pavlic <fpavlic@de.ibm.com>
8 * Thomas Spatzier <tspat@de.ibm.com> 8 * Thomas Spatzier <tspat@de.ibm.com>
9 * 9 *
10 */ 10 */
diff --git a/drivers/s390/net/qeth_mpc.h b/drivers/s390/net/qeth_mpc.h
index 7edc5f1fc0d2..5f71486e708c 100644
--- a/drivers/s390/net/qeth_mpc.h
+++ b/drivers/s390/net/qeth_mpc.h
@@ -6,7 +6,7 @@
6 * Copyright 2000,2003 IBM Corporation 6 * Copyright 2000,2003 IBM Corporation
7 * Author(s): Utz Bacher <utz.bacher@de.ibm.com> 7 * Author(s): Utz Bacher <utz.bacher@de.ibm.com>
8 * Thomas Spatzier <tspat@de.ibm.com> 8 * Thomas Spatzier <tspat@de.ibm.com>
9 * Frank Pavlic <pavlic@de.ibm.com> 9 * Frank Pavlic <fpavlic@de.ibm.com>
10 * 10 *
11 */ 11 */
12#ifndef __QETH_MPC_H__ 12#ifndef __QETH_MPC_H__
@@ -14,7 +14,7 @@
14 14
15#include <asm/qeth.h> 15#include <asm/qeth.h>
16 16
17#define VERSION_QETH_MPC_H "$Revision: 1.43 $" 17#define VERSION_QETH_MPC_H "$Revision: 1.44 $"
18 18
19extern const char *VERSION_QETH_MPC_C; 19extern const char *VERSION_QETH_MPC_C;
20 20
@@ -217,7 +217,7 @@ enum qeth_ipa_setadp_cmd {
217 IPA_SETADP_SEND_OSA_MESSAGE = 0x0100, 217 IPA_SETADP_SEND_OSA_MESSAGE = 0x0100,
218 IPA_SETADP_SET_SNMP_CONTROL = 0x0200, 218 IPA_SETADP_SET_SNMP_CONTROL = 0x0200,
219 IPA_SETADP_READ_SNMP_PARMS = 0x0400, 219 IPA_SETADP_READ_SNMP_PARMS = 0x0400,
220 IPA_SETADP_WRITE_SNMP_PARMS = 0x0800, 220 IPA_SETADP_SET_PROMISC_MODE = 0x0800,
221 IPA_SETADP_QUERY_CARD_INFO = 0x1000, 221 IPA_SETADP_QUERY_CARD_INFO = 0x1000,
222}; 222};
223enum qeth_ipa_mac_ops { 223enum qeth_ipa_mac_ops {
@@ -232,9 +232,12 @@ enum qeth_ipa_addr_ops {
232 CHANGE_ADDR_ADD_ADDR = 1, 232 CHANGE_ADDR_ADD_ADDR = 1,
233 CHANGE_ADDR_DEL_ADDR = 2, 233 CHANGE_ADDR_DEL_ADDR = 2,
234 CHANGE_ADDR_FLUSH_ADDR_TABLE = 4, 234 CHANGE_ADDR_FLUSH_ADDR_TABLE = 4,
235
236
237}; 235};
236enum qeth_ipa_promisc_modes {
237 SET_PROMISC_MODE_OFF = 0,
238 SET_PROMISC_MODE_ON = 1,
239};
240
238/* (SET)DELIP(M) IPA stuff ***************************************************/ 241/* (SET)DELIP(M) IPA stuff ***************************************************/
239struct qeth_ipacmd_setdelip4 { 242struct qeth_ipacmd_setdelip4 {
240 __u8 ip_addr[4]; 243 __u8 ip_addr[4];
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c
index f91a02db5743..ddd6019ba092 100644
--- a/drivers/s390/net/qeth_sys.c
+++ b/drivers/s390/net/qeth_sys.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.55 $) 3 * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.58 $)
4 * 4 *
5 * Linux on zSeries OSA Express and HiperSockets support 5 * Linux on zSeries OSA Express and HiperSockets support
6 * This file contains code related to sysfs. 6 * This file contains code related to sysfs.
@@ -8,7 +8,7 @@
8 * Copyright 2000,2003 IBM Corporation 8 * Copyright 2000,2003 IBM Corporation
9 * 9 *
10 * Author(s): Thomas Spatzier <tspat@de.ibm.com> 10 * Author(s): Thomas Spatzier <tspat@de.ibm.com>
11 * Frank Pavlic <pavlic@de.ibm.com> 11 * Frank Pavlic <fpavlic@de.ibm.com>
12 * 12 *
13 */ 13 */
14#include <linux/list.h> 14#include <linux/list.h>
@@ -20,7 +20,7 @@
20#include "qeth_mpc.h" 20#include "qeth_mpc.h"
21#include "qeth_fs.h" 21#include "qeth_fs.h"
22 22
23const char *VERSION_QETH_SYS_C = "$Revision: 1.55 $"; 23const char *VERSION_QETH_SYS_C = "$Revision: 1.58 $";
24 24
25/*****************************************************************************/ 25/*****************************************************************************/
26/* */ 26/* */
@@ -1117,7 +1117,7 @@ qeth_parse_ipatoe(const char* buf, enum qeth_prot_versions proto,
1117 start = buf; 1117 start = buf;
1118 /* get address string */ 1118 /* get address string */
1119 end = strchr(start, '/'); 1119 end = strchr(start, '/');
1120 if (!end){ 1120 if (!end || (end-start >= 49)){
1121 PRINT_WARN("Invalid format for ipato_addx/delx. " 1121 PRINT_WARN("Invalid format for ipato_addx/delx. "
1122 "Use <ip addr>/<mask bits>\n"); 1122 "Use <ip addr>/<mask bits>\n");
1123 return -EINVAL; 1123 return -EINVAL;
diff --git a/drivers/s390/net/qeth_tso.h b/drivers/s390/net/qeth_tso.h
index ad33e6f466f1..e245af3c4cbd 100644
--- a/drivers/s390/net/qeth_tso.h
+++ b/drivers/s390/net/qeth_tso.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright 2004 IBM Corporation 6 * Copyright 2004 IBM Corporation
7 * 7 *
8 * Author(s): Frank Pavlic <pavlic@de.ibm.com> 8 * Author(s): Frank Pavlic <fpavlic@de.ibm.com>
9 * 9 *
10 * $Revision: 1.7 $ $Date: 2005/05/04 20:19:18 $ 10 * $Revision: 1.7 $ $Date: 2005/05/04 20:19:18 $
11 * 11 *
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c
index 2c86a4b809cd..c3a51d1fae5d 100644
--- a/drivers/sbus/char/display7seg.c
+++ b/drivers/sbus/char/display7seg.c
@@ -119,7 +119,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
119{ 119{
120 __u8 regs = readb(d7s_regs); 120 __u8 regs = readb(d7s_regs);
121 __u8 ireg = 0; 121 __u8 ireg = 0;
122 int error = 0 122 int error = 0;
123 123
124 if (D7S_MINOR != iminor(file->f_dentry->d_inode)) 124 if (D7S_MINOR != iminor(file->f_dentry->d_inode))
125 return -ENODEV; 125 return -ENODEV;
diff --git a/drivers/sbus/char/rtc.c b/drivers/sbus/char/rtc.c
index 5774bdd0e26f..9b988baf0b51 100644
--- a/drivers/sbus/char/rtc.c
+++ b/drivers/sbus/char/rtc.c
@@ -210,27 +210,6 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
210 } 210 }
211} 211}
212 212
213static long rtc_compat_ioctl(struct file *file, unsigned int cmd,
214 unsigned long arg)
215{
216 int rval = -ENOIOCTLCMD;
217
218 switch (cmd) {
219 /*
220 * These two are specific to this driver, the generic rtc ioctls
221 * are hanlded elsewhere.
222 */
223 case RTCGET:
224 case RTCSET:
225 lock_kernel();
226 rval = rtc_ioctl(file->f_dentry->d_inode, file, cmd, arg);
227 unlock_kernel();
228 break;
229 }
230
231 return rval;
232}
233
234static int rtc_open(struct inode *inode, struct file *file) 213static int rtc_open(struct inode *inode, struct file *file)
235{ 214{
236 int ret; 215 int ret;
@@ -258,7 +237,6 @@ static struct file_operations rtc_fops = {
258 .owner = THIS_MODULE, 237 .owner = THIS_MODULE,
259 .llseek = no_llseek, 238 .llseek = no_llseek,
260 .ioctl = rtc_ioctl, 239 .ioctl = rtc_ioctl,
261 .compat_ioctl = rtc_compat_ioctl,
262 .open = rtc_open, 240 .open = rtc_open,
263 .release = rtc_release, 241 .release = rtc_release,
264}; 242};
diff --git a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c
index 7a33c708f5b3..9cb5dd48383f 100644
--- a/drivers/scsi/53c7xx.c
+++ b/drivers/scsi/53c7xx.c
@@ -343,7 +343,7 @@ static void NCR53c7x0_soft_reset (struct Scsi_Host *host);
343/* Size of event list (per host adapter) */ 343/* Size of event list (per host adapter) */
344static int track_events = 0; 344static int track_events = 0;
345static struct Scsi_Host *first_host = NULL; /* Head of list of NCR boards */ 345static struct Scsi_Host *first_host = NULL; /* Head of list of NCR boards */
346static Scsi_Host_Template *the_template = NULL; 346static struct scsi_host_template *the_template = NULL;
347 347
348/* NCR53c710 script handling code */ 348/* NCR53c710 script handling code */
349 349
@@ -1103,7 +1103,7 @@ NCR53c7x0_init (struct Scsi_Host *host) {
1103} 1103}
1104 1104
1105/* 1105/*
1106 * Function : int ncr53c7xx_init(Scsi_Host_Template *tpnt, int board, int chip, 1106 * Function : int ncr53c7xx_init(struct scsi_host_template *tpnt, int board, int chip,
1107 * unsigned long base, int io_port, int irq, int dma, long long options, 1107 * unsigned long base, int io_port, int irq, int dma, long long options,
1108 * int clock); 1108 * int clock);
1109 * 1109 *
@@ -1118,7 +1118,7 @@ NCR53c7x0_init (struct Scsi_Host *host) {
1118 */ 1118 */
1119 1119
1120int 1120int
1121ncr53c7xx_init (Scsi_Host_Template *tpnt, int board, int chip, 1121ncr53c7xx_init (struct scsi_host_template *tpnt, int board, int chip,
1122 unsigned long base, int io_port, int irq, int dma, 1122 unsigned long base, int io_port, int irq, int dma,
1123 long long options, int clock) 1123 long long options, int clock)
1124{ 1124{
diff --git a/drivers/scsi/53c7xx.h b/drivers/scsi/53c7xx.h
index d9098bdace05..218f3b901537 100644
--- a/drivers/scsi/53c7xx.h
+++ b/drivers/scsi/53c7xx.h
@@ -1600,7 +1600,7 @@ struct NCR53c7x0_hostdata {
1600/* Paranoid people could use panic() here. */ 1600/* Paranoid people could use panic() here. */
1601#define FATAL(host) shutdown((host)); 1601#define FATAL(host) shutdown((host));
1602 1602
1603extern int ncr53c7xx_init(Scsi_Host_Template *tpnt, int board, int chip, 1603extern int ncr53c7xx_init(struct scsi_host_template *tpnt, int board, int chip,
1604 unsigned long base, int io_port, int irq, int dma, 1604 unsigned long base, int io_port, int irq, int dma,
1605 long long options, int clock); 1605 long long options, int clock);
1606 1606
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index afeca325b4dc..84c42c44e04d 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1295,27 +1295,6 @@ config SCSI_QLOGIC_FAS
1295 To compile this driver as a module, choose M here: the 1295 To compile this driver as a module, choose M here: the
1296 module will be called qlogicfas. 1296 module will be called qlogicfas.
1297 1297
1298config SCSI_QLOGIC_ISP
1299 tristate "Qlogic ISP SCSI support (old driver)"
1300 depends on PCI && SCSI && BROKEN
1301 ---help---
1302 This driver works for all QLogic PCI SCSI host adapters (IQ-PCI,
1303 IQ-PCI-10, IQ_PCI-D) except for the PCI-basic card. (This latter
1304 card is supported by the "AM53/79C974 PCI SCSI" driver.)
1305
1306 If you say Y here, make sure to choose "BIOS" at the question "PCI
1307 access mode".
1308
1309 Please read the file <file:Documentation/scsi/qlogicisp.txt>. You
1310 should also read the SCSI-HOWTO, available from
1311 <http://www.tldp.org/docs.html#howto>.
1312
1313 To compile this driver as a module, choose M here: the
1314 module will be called qlogicisp.
1315
1316 These days the hardware is also supported by the more modern qla1280
1317 driver. In doubt use that one instead of qlogicisp.
1318
1319config SCSI_QLOGIC_FC 1298config SCSI_QLOGIC_FC
1320 tristate "Qlogic ISP FC SCSI support" 1299 tristate "Qlogic ISP FC SCSI support"
1321 depends on PCI && SCSI 1300 depends on PCI && SCSI
@@ -1342,14 +1321,6 @@ config SCSI_QLOGIC_1280
1342 To compile this driver as a module, choose M here: the 1321 To compile this driver as a module, choose M here: the
1343 module will be called qla1280. 1322 module will be called qla1280.
1344 1323
1345config SCSI_QLOGIC_1280_1040
1346 bool "Qlogic QLA 1020/1040 SCSI support"
1347 depends on SCSI_QLOGIC_1280 && SCSI_QLOGIC_ISP!=y
1348 help
1349 Say Y here if you have a QLogic ISP1020/1040 SCSI host adapter and
1350 do not want to use the old driver. This option enables support in
1351 the qla1280 driver for those host adapters.
1352
1353config SCSI_QLOGICPTI 1324config SCSI_QLOGICPTI
1354 tristate "PTI Qlogic, ISP Driver" 1325 tristate "PTI Qlogic, ISP Driver"
1355 depends on SBUS && SCSI 1326 depends on SBUS && SCSI
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index b88b8c455598..f062ea0f813a 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -78,7 +78,6 @@ obj-$(CONFIG_SCSI_NCR_Q720) += NCR_Q720_mod.o
78obj-$(CONFIG_SCSI_SYM53C416) += sym53c416.o 78obj-$(CONFIG_SCSI_SYM53C416) += sym53c416.o
79obj-$(CONFIG_SCSI_QLOGIC_FAS) += qlogicfas408.o qlogicfas.o 79obj-$(CONFIG_SCSI_QLOGIC_FAS) += qlogicfas408.o qlogicfas.o
80obj-$(CONFIG_PCMCIA_QLOGIC) += qlogicfas408.o 80obj-$(CONFIG_PCMCIA_QLOGIC) += qlogicfas408.o
81obj-$(CONFIG_SCSI_QLOGIC_ISP) += qlogicisp.o
82obj-$(CONFIG_SCSI_QLOGIC_FC) += qlogicfc.o 81obj-$(CONFIG_SCSI_QLOGIC_FC) += qlogicfc.o
83obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o 82obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o
84obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx/ 83obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx/
diff --git a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c
index 26146a4b67b8..640590bd014a 100644
--- a/drivers/scsi/NCR53C9x.c
+++ b/drivers/scsi/NCR53C9x.c
@@ -529,7 +529,7 @@ void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs)
529/* Allocate structure and insert basic data such as SCSI chip frequency 529/* Allocate structure and insert basic data such as SCSI chip frequency
530 * data and a pointer to the device 530 * data and a pointer to the device
531 */ 531 */
532struct NCR_ESP* esp_allocate(Scsi_Host_Template *tpnt, void *esp_dev) 532struct NCR_ESP* esp_allocate(struct scsi_host_template *tpnt, void *esp_dev)
533{ 533{
534 struct NCR_ESP *esp, *elink; 534 struct NCR_ESP *esp, *elink;
535 struct Scsi_Host *esp_host; 535 struct Scsi_Host *esp_host;
@@ -1006,7 +1006,7 @@ static void esp_exec_cmd(struct NCR_ESP *esp)
1006 struct ESP_regs *eregs = esp->eregs; 1006 struct ESP_regs *eregs = esp->eregs;
1007 struct esp_device *esp_dev; 1007 struct esp_device *esp_dev;
1008 Scsi_Cmnd *SCptr; 1008 Scsi_Cmnd *SCptr;
1009 Scsi_Device *SDptr; 1009 struct scsi_device *SDptr;
1010 volatile unchar *cmdp = esp->esp_command; 1010 volatile unchar *cmdp = esp->esp_command;
1011 unsigned char the_esp_command; 1011 unsigned char the_esp_command;
1012 int lun, target; 1012 int lun, target;
@@ -1687,7 +1687,7 @@ static inline int reconnect_lun(struct NCR_ESP *esp, struct ESP_regs *eregs)
1687static inline void esp_connect(struct NCR_ESP *esp, struct ESP_regs *eregs, 1687static inline void esp_connect(struct NCR_ESP *esp, struct ESP_regs *eregs,
1688 Scsi_Cmnd *sp) 1688 Scsi_Cmnd *sp)
1689{ 1689{
1690 Scsi_Device *dp = sp->device; 1690 struct scsi_device *dp = sp->device;
1691 struct esp_device *esp_dev = dp->hostdata; 1691 struct esp_device *esp_dev = dp->hostdata;
1692 1692
1693 if(esp->prev_soff != esp_dev->sync_max_offset || 1693 if(esp->prev_soff != esp_dev->sync_max_offset ||
@@ -3605,7 +3605,7 @@ out:
3605} 3605}
3606#endif 3606#endif
3607 3607
3608int esp_slave_alloc(Scsi_Device *SDptr) 3608int esp_slave_alloc(struct scsi_device *SDptr)
3609{ 3609{
3610 struct esp_device *esp_dev = 3610 struct esp_device *esp_dev =
3611 kmalloc(sizeof(struct esp_device), GFP_ATOMIC); 3611 kmalloc(sizeof(struct esp_device), GFP_ATOMIC);
@@ -3617,7 +3617,7 @@ int esp_slave_alloc(Scsi_Device *SDptr)
3617 return 0; 3617 return 0;
3618} 3618}
3619 3619
3620void esp_slave_destroy(Scsi_Device *SDptr) 3620void esp_slave_destroy(struct scsi_device *SDptr)
3621{ 3621{
3622 struct NCR_ESP *esp = (struct NCR_ESP *) SDptr->host->hostdata; 3622 struct NCR_ESP *esp = (struct NCR_ESP *) SDptr->host->hostdata;
3623 3623
diff --git a/drivers/scsi/NCR53C9x.h b/drivers/scsi/NCR53C9x.h
index 06e7edf23326..65a9b377a410 100644
--- a/drivers/scsi/NCR53C9x.h
+++ b/drivers/scsi/NCR53C9x.h
@@ -653,7 +653,7 @@ extern int nesps, esps_in_use, esps_running;
653 653
654/* External functions */ 654/* External functions */
655extern void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs); 655extern void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs);
656extern struct NCR_ESP *esp_allocate(Scsi_Host_Template *, void *); 656extern struct NCR_ESP *esp_allocate(struct scsi_host_template *, void *);
657extern void esp_deallocate(struct NCR_ESP *); 657extern void esp_deallocate(struct NCR_ESP *);
658extern void esp_release(void); 658extern void esp_release(void);
659extern void esp_initialize(struct NCR_ESP *); 659extern void esp_initialize(struct NCR_ESP *);
@@ -664,6 +664,6 @@ extern int esp_abort(Scsi_Cmnd *);
664extern int esp_reset(Scsi_Cmnd *); 664extern int esp_reset(Scsi_Cmnd *);
665extern int esp_proc_info(struct Scsi_Host *shost, char *buffer, char **start, off_t offset, int length, 665extern int esp_proc_info(struct Scsi_Host *shost, char *buffer, char **start, off_t offset, int length,
666 int inout); 666 int inout);
667extern int esp_slave_alloc(Scsi_Device *); 667extern int esp_slave_alloc(struct scsi_device *);
668extern void esp_slave_destroy(Scsi_Device *); 668extern void esp_slave_destroy(struct scsi_device *);
669#endif /* !(NCR53C9X_H) */ 669#endif /* !(NCR53C9X_H) */
diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c
index 135376992a57..ae37d3ab9c4a 100644
--- a/drivers/scsi/NCR53c406a.c
+++ b/drivers/scsi/NCR53c406a.c
@@ -447,7 +447,7 @@ static __inline__ int NCR53c406a_pio_write(unsigned char *request, unsigned int
447} 447}
448#endif /* USE_PIO */ 448#endif /* USE_PIO */
449 449
450static int __init NCR53c406a_detect(Scsi_Host_Template * tpnt) 450static int __init NCR53c406a_detect(struct scsi_host_template * tpnt)
451{ 451{
452 int present = 0; 452 int present = 0;
453 struct Scsi_Host *shpnt = NULL; 453 struct Scsi_Host *shpnt = NULL;
@@ -1057,7 +1057,7 @@ MODULE_LICENSE("GPL");
1057 * Use SG_NONE if DMA mode is enabled! 1057 * Use SG_NONE if DMA mode is enabled!
1058 */ 1058 */
1059 1059
1060static Scsi_Host_Template driver_template = 1060static struct scsi_host_template driver_template =
1061{ 1061{
1062 .proc_name = "NCR53c406a" /* proc_name */, 1062 .proc_name = "NCR53c406a" /* proc_name */,
1063 .name = "NCR53c406a" /* name */, 1063 .name = "NCR53c406a" /* name */,
diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c
index 30a14ba77a6a..54996eaae979 100644
--- a/drivers/scsi/a2091.c
+++ b/drivers/scsi/a2091.c
@@ -172,7 +172,7 @@ static void dma_stop (struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
172 } 172 }
173} 173}
174 174
175int __init a2091_detect(Scsi_Host_Template *tpnt) 175int __init a2091_detect(struct scsi_host_template *tpnt)
176{ 176{
177 static unsigned char called = 0; 177 static unsigned char called = 0;
178 struct Scsi_Host *instance; 178 struct Scsi_Host *instance;
@@ -233,7 +233,7 @@ static int a2091_bus_reset(Scsi_Cmnd *cmd)
233 233
234#define HOSTS_C 234#define HOSTS_C
235 235
236static Scsi_Host_Template driver_template = { 236static struct scsi_host_template driver_template = {
237 .proc_name = "A2901", 237 .proc_name = "A2901",
238 .name = "Commodore A2091/A590 SCSI", 238 .name = "Commodore A2091/A590 SCSI",
239 .detect = a2091_detect, 239 .detect = a2091_detect,
diff --git a/drivers/scsi/a2091.h b/drivers/scsi/a2091.h
index 54993972dcc6..22d6a13dd8be 100644
--- a/drivers/scsi/a2091.h
+++ b/drivers/scsi/a2091.h
@@ -11,7 +11,7 @@
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13 13
14int a2091_detect(Scsi_Host_Template *); 14int a2091_detect(struct scsi_host_template *);
15int a2091_release(struct Scsi_Host *); 15int a2091_release(struct Scsi_Host *);
16const char *wd33c93_info(void); 16const char *wd33c93_info(void);
17int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 17int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c
index 306caf56f3d9..f425d424bf08 100644
--- a/drivers/scsi/a3000.c
+++ b/drivers/scsi/a3000.c
@@ -168,7 +168,7 @@ static void dma_stop (struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
168 } 168 }
169} 169}
170 170
171int __init a3000_detect(Scsi_Host_Template *tpnt) 171int __init a3000_detect(struct scsi_host_template *tpnt)
172{ 172{
173 wd33c93_regs regs; 173 wd33c93_regs regs;
174 174
@@ -221,7 +221,7 @@ static int a3000_bus_reset(Scsi_Cmnd *cmd)
221 221
222#define HOSTS_C 222#define HOSTS_C
223 223
224static Scsi_Host_Template driver_template = { 224static struct scsi_host_template driver_template = {
225 .proc_name = "A3000", 225 .proc_name = "A3000",
226 .name = "Amiga 3000 built-in SCSI", 226 .name = "Amiga 3000 built-in SCSI",
227 .detect = a3000_detect, 227 .detect = a3000_detect,
diff --git a/drivers/scsi/a3000.h b/drivers/scsi/a3000.h
index b1eda731877d..5535a65150a4 100644
--- a/drivers/scsi/a3000.h
+++ b/drivers/scsi/a3000.h
@@ -11,7 +11,7 @@
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13 13
14int a3000_detect(Scsi_Host_Template *); 14int a3000_detect(struct scsi_host_template *);
15int a3000_release(struct Scsi_Host *); 15int a3000_release(struct Scsi_Host *);
16const char *wd33c93_info(void); 16const char *wd33c93_info(void);
17int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 17int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 2a128a156aa1..7139659dd952 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -1579,18 +1579,10 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1579 break; 1579 break;
1580 { 1580 {
1581 u64 capacity; 1581 u64 capacity;
1582 char cp[12]; 1582 char cp[13];
1583 unsigned int offset = 0;
1584 1583
1585 dprintk((KERN_DEBUG "READ CAPACITY_16 command.\n")); 1584 dprintk((KERN_DEBUG "READ CAPACITY_16 command.\n"));
1586 capacity = fsa_dev_ptr[cid].size - 1; 1585 capacity = fsa_dev_ptr[cid].size - 1;
1587 if (scsicmd->cmnd[13] > 12) {
1588 offset = scsicmd->cmnd[13] - 12;
1589 if (offset > sizeof(cp))
1590 break;
1591 memset(cp, 0, offset);
1592 aac_internal_transfer(scsicmd, cp, 0, offset);
1593 }
1594 cp[0] = (capacity >> 56) & 0xff; 1586 cp[0] = (capacity >> 56) & 0xff;
1595 cp[1] = (capacity >> 48) & 0xff; 1587 cp[1] = (capacity >> 48) & 0xff;
1596 cp[2] = (capacity >> 40) & 0xff; 1588 cp[2] = (capacity >> 40) & 0xff;
@@ -1603,7 +1595,18 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1603 cp[9] = 0; 1595 cp[9] = 0;
1604 cp[10] = 2; 1596 cp[10] = 2;
1605 cp[11] = 0; 1597 cp[11] = 0;
1606 aac_internal_transfer(scsicmd, cp, offset, sizeof(cp)); 1598 cp[12] = 0;
1599 aac_internal_transfer(scsicmd, cp, 0,
1600 min((unsigned int)scsicmd->cmnd[13], sizeof(cp)));
1601 if (sizeof(cp) < scsicmd->cmnd[13]) {
1602 unsigned int len, offset = sizeof(cp);
1603
1604 memset(cp, 0, offset);
1605 do {
1606 len = min(scsicmd->cmnd[13]-offset, sizeof(cp));
1607 aac_internal_transfer(scsicmd, cp, offset, len);
1608 } while ((offset += len) < scsicmd->cmnd[13]);
1609 }
1607 1610
1608 /* Do not cache partition table for arrays */ 1611 /* Do not cache partition table for arrays */
1609 scsicmd->device->removable = 1; 1612 scsicmd->device->removable = 1;
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 723c0cea7c04..38d6d00fb0fc 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -820,7 +820,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
820 break; 820 break;
821 821
822 /* 822 /*
823 * Find the Scsi_Device associated with the SCSI 823 * Find the scsi_device associated with the SCSI
824 * address. Make sure we have the right array, and if 824 * address. Make sure we have the right array, and if
825 * so set the flag to initiate a new re-config once we 825 * so set the flag to initiate a new re-config once we
826 * see an AifEnConfigChange AIF come through. 826 * see an AifEnConfigChange AIF come through.
@@ -987,7 +987,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
987 987
988 988
989 /* 989 /*
990 * Find the Scsi_Device associated with the SCSI address, 990 * Find the scsi_device associated with the SCSI address,
991 * and mark it as changed, invalidating the cache. This deals 991 * and mark it as changed, invalidating the cache. This deals
992 * with changes to existing device IDs. 992 * with changes to existing device IDs.
993 */ 993 */
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index f4cfb8f29620..28b93057b607 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -114,7 +114,7 @@
114 #include "advansys.h" 114 #include "advansys.h"
115 #endif 115 #endif
116 116
117 and after "static Scsi_Host_Template builtin_scsi_hosts[] =": 117 and after "static struct scsi_host_template builtin_scsi_hosts[] =":
118 118
119 #ifdef CONFIG_SCSI_ADVANSYS 119 #ifdef CONFIG_SCSI_ADVANSYS
120 ADVANSYS, 120 ADVANSYS,
@@ -160,7 +160,7 @@
160 --- Driver Structures 160 --- Driver Structures
161 --- Driver Data 161 --- Driver Data
162 --- Driver Function Prototypes 162 --- Driver Function Prototypes
163 --- Linux 'Scsi_Host_Template' and advansys_setup() Functions 163 --- Linux 'struct scsi_host_template' and advansys_setup() Functions
164 --- Loadable Driver Support 164 --- Loadable Driver Support
165 --- Miscellaneous Driver Functions 165 --- Miscellaneous Driver Functions
166 --- Functions Required by the Asc Library 166 --- Functions Required by the Asc Library
@@ -4068,7 +4068,7 @@ STATIC void asc_prt_hex(char *f, uchar *, int);
4068 4068
4069 4069
4070/* 4070/*
4071 * --- Linux 'Scsi_Host_Template' and advansys_setup() Functions 4071 * --- Linux 'struct scsi_host_template' and advansys_setup() Functions
4072 */ 4072 */
4073 4073
4074#ifdef CONFIG_PROC_FS 4074#ifdef CONFIG_PROC_FS
diff --git a/drivers/scsi/advansys.h b/drivers/scsi/advansys.h
index 3f4bde02302e..8ee7fb16a725 100644
--- a/drivers/scsi/advansys.h
+++ b/drivers/scsi/advansys.h
@@ -19,7 +19,7 @@
19#define _ADVANSYS_H 19#define _ADVANSYS_H
20 20
21/* 21/*
22 * Scsi_Host_Template function prototypes. 22 * struct scsi_host_template function prototypes.
23 */ 23 */
24int advansys_detect(struct scsi_host_template *); 24int advansys_detect(struct scsi_host_template *);
25int advansys_release(struct Scsi_Host *); 25int advansys_release(struct Scsi_Host *);
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index 9b7caf504a56..9df23b654cec 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -424,7 +424,7 @@ MODULE_DEVICE_TABLE(isapnp, id_table);
424 424
425static int registered_count=0; 425static int registered_count=0;
426static struct Scsi_Host *aha152x_host[2]; 426static struct Scsi_Host *aha152x_host[2];
427static Scsi_Host_Template aha152x_driver_template; 427static struct scsi_host_template aha152x_driver_template;
428 428
429/* 429/*
430 * internal states of the host 430 * internal states of the host
@@ -3464,7 +3464,7 @@ static int aha152x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start
3464 return thislength < length ? thislength : length; 3464 return thislength < length ? thislength : length;
3465} 3465}
3466 3466
3467static Scsi_Host_Template aha152x_driver_template = { 3467static struct scsi_host_template aha152x_driver_template = {
3468 .module = THIS_MODULE, 3468 .module = THIS_MODULE,
3469 .name = AHA152X_REVID, 3469 .name = AHA152X_REVID,
3470 .proc_name = "aha152x", 3470 .proc_name = "aha152x",
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 1b1adfb384cb..51bad7a1e773 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -1021,7 +1021,7 @@ __setup("aha1542=",do_setup);
1021#endif 1021#endif
1022 1022
1023/* return non-zero on detection */ 1023/* return non-zero on detection */
1024static int __init aha1542_detect(Scsi_Host_Template * tpnt) 1024static int __init aha1542_detect(struct scsi_host_template * tpnt)
1025{ 1025{
1026 unsigned char dma_chan; 1026 unsigned char dma_chan;
1027 unsigned char irq_level; 1027 unsigned char irq_level;
@@ -1789,7 +1789,7 @@ static int aha1542_biosparam(struct scsi_device *sdev,
1789MODULE_LICENSE("GPL"); 1789MODULE_LICENSE("GPL");
1790 1790
1791 1791
1792static Scsi_Host_Template driver_template = { 1792static struct scsi_host_template driver_template = {
1793 .proc_name = "aha1542", 1793 .proc_name = "aha1542",
1794 .name = "Adaptec 1542", 1794 .name = "Adaptec 1542",
1795 .detect = aha1542_detect, 1795 .detect = aha1542_detect,
diff --git a/drivers/scsi/aha1542.h b/drivers/scsi/aha1542.h
index 3821ee17f471..1db538552d56 100644
--- a/drivers/scsi/aha1542.h
+++ b/drivers/scsi/aha1542.h
@@ -131,7 +131,7 @@ struct ccb { /* Command Control Block 5.3 */
131 /* REQUEST SENSE */ 131 /* REQUEST SENSE */
132}; 132};
133 133
134static int aha1542_detect(Scsi_Host_Template *); 134static int aha1542_detect(struct scsi_host_template *);
135static int aha1542_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 135static int aha1542_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
136static int aha1542_bus_reset(Scsi_Cmnd * SCpnt); 136static int aha1542_bus_reset(Scsi_Cmnd * SCpnt);
137static int aha1542_dev_reset(Scsi_Cmnd * SCpnt); 137static int aha1542_dev_reset(Scsi_Cmnd * SCpnt);
diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c
index 8f85dcc0e7fa..4b8c6a543925 100644
--- a/drivers/scsi/aha1740.c
+++ b/drivers/scsi/aha1740.c
@@ -570,7 +570,7 @@ static int aha1740_eh_abort_handler (Scsi_Cmnd *dummy)
570 return 0; 570 return 0;
571} 571}
572 572
573static Scsi_Host_Template aha1740_template = { 573static struct scsi_host_template aha1740_template = {
574 .module = THIS_MODULE, 574 .module = THIS_MODULE,
575 .proc_name = "aha1740", 575 .proc_name = "aha1740",
576 .proc_info = aha1740_proc_info, 576 .proc_info = aha1740_proc_info,
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c
index 10c470e7d316..4e96ec5f2ff9 100644
--- a/drivers/scsi/ahci.c
+++ b/drivers/scsi/ahci.c
@@ -134,6 +134,7 @@ enum {
134 PORT_IRQ_D2H_REG_FIS, 134 PORT_IRQ_D2H_REG_FIS,
135 135
136 /* PORT_CMD bits */ 136 /* PORT_CMD bits */
137 PORT_CMD_ATAPI = (1 << 24), /* Device is ATAPI */
137 PORT_CMD_LIST_ON = (1 << 15), /* cmd list DMA engine running */ 138 PORT_CMD_LIST_ON = (1 << 15), /* cmd list DMA engine running */
138 PORT_CMD_FIS_ON = (1 << 14), /* FIS DMA engine running */ 139 PORT_CMD_FIS_ON = (1 << 14), /* FIS DMA engine running */
139 PORT_CMD_FIS_RX = (1 << 4), /* Enable FIS receive DMA engine */ 140 PORT_CMD_FIS_RX = (1 << 4), /* Enable FIS receive DMA engine */
@@ -255,7 +256,7 @@ static struct ata_port_info ahci_port_info[] = {
255 }, 256 },
256}; 257};
257 258
258static struct pci_device_id ahci_pci_tbl[] = { 259static const struct pci_device_id ahci_pci_tbl[] = {
259 { PCI_VENDOR_ID_INTEL, 0x2652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 260 { PCI_VENDOR_ID_INTEL, 0x2652, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
260 board_ahci }, /* ICH6 */ 261 board_ahci }, /* ICH6 */
261 { PCI_VENDOR_ID_INTEL, 0x2653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 262 { PCI_VENDOR_ID_INTEL, 0x2653, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
@@ -441,7 +442,7 @@ static void ahci_phy_reset(struct ata_port *ap)
441 void __iomem *port_mmio = (void __iomem *) ap->ioaddr.cmd_addr; 442 void __iomem *port_mmio = (void __iomem *) ap->ioaddr.cmd_addr;
442 struct ata_taskfile tf; 443 struct ata_taskfile tf;
443 struct ata_device *dev = &ap->device[0]; 444 struct ata_device *dev = &ap->device[0];
444 u32 tmp; 445 u32 new_tmp, tmp;
445 446
446 __sata_phy_reset(ap); 447 __sata_phy_reset(ap);
447 448
@@ -455,8 +456,21 @@ static void ahci_phy_reset(struct ata_port *ap)
455 tf.nsect = (tmp) & 0xff; 456 tf.nsect = (tmp) & 0xff;
456 457
457 dev->class = ata_dev_classify(&tf); 458 dev->class = ata_dev_classify(&tf);
458 if (!ata_dev_present(dev)) 459 if (!ata_dev_present(dev)) {
459 ata_port_disable(ap); 460 ata_port_disable(ap);
461 return;
462 }
463
464 /* Make sure port's ATAPI bit is set appropriately */
465 new_tmp = tmp = readl(port_mmio + PORT_CMD);
466 if (dev->class == ATA_DEV_ATAPI)
467 new_tmp |= PORT_CMD_ATAPI;
468 else
469 new_tmp &= ~PORT_CMD_ATAPI;
470 if (new_tmp != tmp) {
471 writel(new_tmp, port_mmio + PORT_CMD);
472 readl(port_mmio + PORT_CMD); /* flush */
473 }
460} 474}
461 475
462static u8 ahci_check_status(struct ata_port *ap) 476static u8 ahci_check_status(struct ata_port *ap)
@@ -474,11 +488,12 @@ static void ahci_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
474 ata_tf_from_fis(d2h_fis, tf); 488 ata_tf_from_fis(d2h_fis, tf);
475} 489}
476 490
477static void ahci_fill_sg(struct ata_queued_cmd *qc) 491static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc)
478{ 492{
479 struct ahci_port_priv *pp = qc->ap->private_data; 493 struct ahci_port_priv *pp = qc->ap->private_data;
480 struct scatterlist *sg; 494 struct scatterlist *sg;
481 struct ahci_sg *ahci_sg; 495 struct ahci_sg *ahci_sg;
496 unsigned int n_sg = 0;
482 497
483 VPRINTK("ENTER\n"); 498 VPRINTK("ENTER\n");
484 499
@@ -493,8 +508,12 @@ static void ahci_fill_sg(struct ata_queued_cmd *qc)
493 ahci_sg->addr = cpu_to_le32(addr & 0xffffffff); 508 ahci_sg->addr = cpu_to_le32(addr & 0xffffffff);
494 ahci_sg->addr_hi = cpu_to_le32((addr >> 16) >> 16); 509 ahci_sg->addr_hi = cpu_to_le32((addr >> 16) >> 16);
495 ahci_sg->flags_size = cpu_to_le32(sg_len - 1); 510 ahci_sg->flags_size = cpu_to_le32(sg_len - 1);
511
496 ahci_sg++; 512 ahci_sg++;
513 n_sg++;
497 } 514 }
515
516 return n_sg;
498} 517}
499 518
500static void ahci_qc_prep(struct ata_queued_cmd *qc) 519static void ahci_qc_prep(struct ata_queued_cmd *qc)
@@ -503,13 +522,14 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc)
503 struct ahci_port_priv *pp = ap->private_data; 522 struct ahci_port_priv *pp = ap->private_data;
504 u32 opts; 523 u32 opts;
505 const u32 cmd_fis_len = 5; /* five dwords */ 524 const u32 cmd_fis_len = 5; /* five dwords */
525 unsigned int n_elem;
506 526
507 /* 527 /*
508 * Fill in command slot information (currently only one slot, 528 * Fill in command slot information (currently only one slot,
509 * slot 0, is currently since we don't do queueing) 529 * slot 0, is currently since we don't do queueing)
510 */ 530 */
511 531
512 opts = (qc->n_elem << 16) | cmd_fis_len; 532 opts = cmd_fis_len;
513 if (qc->tf.flags & ATA_TFLAG_WRITE) 533 if (qc->tf.flags & ATA_TFLAG_WRITE)
514 opts |= AHCI_CMD_WRITE; 534 opts |= AHCI_CMD_WRITE;
515 if (is_atapi_taskfile(&qc->tf)) 535 if (is_atapi_taskfile(&qc->tf))
@@ -533,7 +553,9 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc)
533 if (!(qc->flags & ATA_QCFLAG_DMAMAP)) 553 if (!(qc->flags & ATA_QCFLAG_DMAMAP))
534 return; 554 return;
535 555
536 ahci_fill_sg(qc); 556 n_elem = ahci_fill_sg(qc);
557
558 pp->cmd_slot[0].opts |= cpu_to_le32(n_elem << 16);
537} 559}
538 560
539static void ahci_intr_error(struct ata_port *ap, u32 irq_stat) 561static void ahci_intr_error(struct ata_port *ap, u32 irq_stat)
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index cfb46c241b38..31e9f40e79a2 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -436,29 +436,20 @@ ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
436{ 436{
437 struct ahd_softc *ahd; 437 struct ahd_softc *ahd;
438 struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); 438 struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device);
439 int rtn = SCSI_MLQUEUE_HOST_BUSY;
440 unsigned long flags;
439 441
440 ahd = *(struct ahd_softc **)cmd->device->host->hostdata; 442 ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
441 443
442 /* 444 ahd_lock(ahd, &flags);
443 * Close the race of a command that was in the process of 445 if (ahd->platform_data->qfrozen == 0) {
444 * being queued to us just as our simq was frozen. Let 446 cmd->scsi_done = scsi_done;
445 * DV commands through so long as we are only frozen to 447 cmd->result = CAM_REQ_INPROG << 16;
446 * perform DV. 448 rtn = ahd_linux_run_command(ahd, dev, cmd);
447 */
448 if (ahd->platform_data->qfrozen != 0) {
449 printf("%s: queue frozen\n", ahd_name(ahd));
450 449
451 return SCSI_MLQUEUE_HOST_BUSY;
452 } 450 }
453 451 ahd_unlock(ahd, &flags);
454 /* 452 return rtn;
455 * Save the callback on completion function.
456 */
457 cmd->scsi_done = scsi_done;
458
459 cmd->result = CAM_REQ_INPROG << 16;
460
461 return ahd_linux_run_command(ahd, dev, cmd);
462} 453}
463 454
464static inline struct scsi_target ** 455static inline struct scsi_target **
@@ -1081,7 +1072,6 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa
1081 1072
1082 *((struct ahd_softc **)host->hostdata) = ahd; 1073 *((struct ahd_softc **)host->hostdata) = ahd;
1083 ahd_lock(ahd, &s); 1074 ahd_lock(ahd, &s);
1084 scsi_assign_lock(host, &ahd->platform_data->spin_lock);
1085 ahd->platform_data->host = host; 1075 ahd->platform_data->host = host;
1086 host->can_queue = AHD_MAX_QUEUE; 1076 host->can_queue = AHD_MAX_QUEUE;
1087 host->cmd_per_lun = 2; 1077 host->cmd_per_lun = 2;
@@ -2062,6 +2052,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2062 int wait; 2052 int wait;
2063 int disconnected; 2053 int disconnected;
2064 ahd_mode_state saved_modes; 2054 ahd_mode_state saved_modes;
2055 unsigned long flags;
2065 2056
2066 pending_scb = NULL; 2057 pending_scb = NULL;
2067 paused = FALSE; 2058 paused = FALSE;
@@ -2077,7 +2068,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2077 printf(" 0x%x", cmd->cmnd[cdb_byte]); 2068 printf(" 0x%x", cmd->cmnd[cdb_byte]);
2078 printf("\n"); 2069 printf("\n");
2079 2070
2080 spin_lock_irq(&ahd->platform_data->spin_lock); 2071 ahd_lock(ahd, &flags);
2081 2072
2082 /* 2073 /*
2083 * First determine if we currently own this command. 2074 * First determine if we currently own this command.
@@ -2291,7 +2282,8 @@ done:
2291 int ret; 2282 int ret;
2292 2283
2293 ahd->platform_data->flags |= AHD_SCB_UP_EH_SEM; 2284 ahd->platform_data->flags |= AHD_SCB_UP_EH_SEM;
2294 spin_unlock_irq(&ahd->platform_data->spin_lock); 2285 ahd_unlock(ahd, &flags);
2286
2295 init_timer(&timer); 2287 init_timer(&timer);
2296 timer.data = (u_long)ahd; 2288 timer.data = (u_long)ahd;
2297 timer.expires = jiffies + (5 * HZ); 2289 timer.expires = jiffies + (5 * HZ);
@@ -2305,9 +2297,8 @@ done:
2305 printf("Timer Expired\n"); 2297 printf("Timer Expired\n");
2306 retval = FAILED; 2298 retval = FAILED;
2307 } 2299 }
2308 spin_lock_irq(&ahd->platform_data->spin_lock);
2309 } 2300 }
2310 spin_unlock_irq(&ahd->platform_data->spin_lock); 2301 ahd_unlock(ahd, &flags);
2311 return (retval); 2302 return (retval);
2312} 2303}
2313 2304
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index 1861407422e4..7fc6454068e4 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -476,26 +476,20 @@ ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
476{ 476{
477 struct ahc_softc *ahc; 477 struct ahc_softc *ahc;
478 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device); 478 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device);
479 int rtn = SCSI_MLQUEUE_HOST_BUSY;
480 unsigned long flags;
479 481
480 ahc = *(struct ahc_softc **)cmd->device->host->hostdata; 482 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
481 483
482 /* 484 ahc_lock(ahc, &flags);
483 * Save the callback on completion function. 485 if (ahc->platform_data->qfrozen == 0) {
484 */ 486 cmd->scsi_done = scsi_done;
485 cmd->scsi_done = scsi_done; 487 cmd->result = CAM_REQ_INPROG << 16;
486 488 rtn = ahc_linux_run_command(ahc, dev, cmd);
487 /* 489 }
488 * Close the race of a command that was in the process of 490 ahc_unlock(ahc, &flags);
489 * being queued to us just as our simq was frozen. Let
490 * DV commands through so long as we are only frozen to
491 * perform DV.
492 */
493 if (ahc->platform_data->qfrozen != 0)
494 return SCSI_MLQUEUE_HOST_BUSY;
495
496 cmd->result = CAM_REQ_INPROG << 16;
497 491
498 return ahc_linux_run_command(ahc, dev, cmd); 492 return rtn;
499} 493}
500 494
501static inline struct scsi_target ** 495static inline struct scsi_target **
@@ -1079,7 +1073,6 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa
1079 1073
1080 *((struct ahc_softc **)host->hostdata) = ahc; 1074 *((struct ahc_softc **)host->hostdata) = ahc;
1081 ahc_lock(ahc, &s); 1075 ahc_lock(ahc, &s);
1082 scsi_assign_lock(host, &ahc->platform_data->spin_lock);
1083 ahc->platform_data->host = host; 1076 ahc->platform_data->host = host;
1084 host->can_queue = AHC_MAX_QUEUE; 1077 host->can_queue = AHC_MAX_QUEUE;
1085 host->cmd_per_lun = 2; 1078 host->cmd_per_lun = 2;
@@ -2111,6 +2104,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2111 int paused; 2104 int paused;
2112 int wait; 2105 int wait;
2113 int disconnected; 2106 int disconnected;
2107 unsigned long flags;
2114 2108
2115 pending_scb = NULL; 2109 pending_scb = NULL;
2116 paused = FALSE; 2110 paused = FALSE;
@@ -2125,7 +2119,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2125 printf(" 0x%x", cmd->cmnd[cdb_byte]); 2119 printf(" 0x%x", cmd->cmnd[cdb_byte]);
2126 printf("\n"); 2120 printf("\n");
2127 2121
2128 spin_lock_irq(&ahc->platform_data->spin_lock); 2122 ahc_lock(ahc, &flags);
2129 2123
2130 /* 2124 /*
2131 * First determine if we currently own this command. 2125 * First determine if we currently own this command.
@@ -2357,7 +2351,8 @@ done:
2357 int ret; 2351 int ret;
2358 2352
2359 ahc->platform_data->flags |= AHC_UP_EH_SEMAPHORE; 2353 ahc->platform_data->flags |= AHC_UP_EH_SEMAPHORE;
2360 spin_unlock_irq(&ahc->platform_data->spin_lock); 2354 ahc_unlock(ahc, &flags);
2355
2361 init_timer(&timer); 2356 init_timer(&timer);
2362 timer.data = (u_long)ahc; 2357 timer.data = (u_long)ahc;
2363 timer.expires = jiffies + (5 * HZ); 2358 timer.expires = jiffies + (5 * HZ);
@@ -2371,10 +2366,8 @@ done:
2371 printf("Timer Expired\n"); 2366 printf("Timer Expired\n");
2372 retval = FAILED; 2367 retval = FAILED;
2373 } 2368 }
2374 spin_lock_irq(&ahc->platform_data->spin_lock); 2369 } else
2375 } 2370 ahc_unlock(ahc, &flags);
2376
2377 spin_unlock_irq(&ahc->platform_data->spin_lock);
2378 return (retval); 2371 return (retval);
2379} 2372}
2380 2373
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
index 880e2d9ffe9b..33d56c344944 100644
--- a/drivers/scsi/aic7xxx_old.c
+++ b/drivers/scsi/aic7xxx_old.c
@@ -6514,7 +6514,7 @@ do_aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
6514static void 6514static void
6515aic7xxx_init_transinfo(struct aic7xxx_host *p, struct aic_dev_data *aic_dev) 6515aic7xxx_init_transinfo(struct aic7xxx_host *p, struct aic_dev_data *aic_dev)
6516{ 6516{
6517 Scsi_Device *sdpnt = aic_dev->SDptr; 6517 struct scsi_device *sdpnt = aic_dev->SDptr;
6518 unsigned char tindex; 6518 unsigned char tindex;
6519 6519
6520 tindex = sdpnt->id | (sdpnt->channel << 3); 6520 tindex = sdpnt->id | (sdpnt->channel << 3);
@@ -6581,7 +6581,7 @@ aic7xxx_init_transinfo(struct aic7xxx_host *p, struct aic_dev_data *aic_dev)
6581 * Set up the initial aic_dev struct pointers 6581 * Set up the initial aic_dev struct pointers
6582 *-F*************************************************************************/ 6582 *-F*************************************************************************/
6583static int 6583static int
6584aic7xxx_slave_alloc(Scsi_Device *SDptr) 6584aic7xxx_slave_alloc(struct scsi_device *SDptr)
6585{ 6585{
6586 struct aic7xxx_host *p = (struct aic7xxx_host *)SDptr->host->hostdata; 6586 struct aic7xxx_host *p = (struct aic7xxx_host *)SDptr->host->hostdata;
6587 struct aic_dev_data *aic_dev; 6587 struct aic_dev_data *aic_dev;
@@ -6644,7 +6644,7 @@ aic7xxx_slave_alloc(Scsi_Device *SDptr)
6644 * queueing to be [en|dis]abled for a specific adapter. 6644 * queueing to be [en|dis]abled for a specific adapter.
6645 *-F*************************************************************************/ 6645 *-F*************************************************************************/
6646static void 6646static void
6647aic7xxx_device_queue_depth(struct aic7xxx_host *p, Scsi_Device *device) 6647aic7xxx_device_queue_depth(struct aic7xxx_host *p, struct scsi_device *device)
6648{ 6648{
6649 int tag_enabled = FALSE; 6649 int tag_enabled = FALSE;
6650 struct aic_dev_data *aic_dev = device->hostdata; 6650 struct aic_dev_data *aic_dev = device->hostdata;
@@ -6734,7 +6734,7 @@ aic7xxx_device_queue_depth(struct aic7xxx_host *p, Scsi_Device *device)
6734 * prepare for this device to go away 6734 * prepare for this device to go away
6735 *-F*************************************************************************/ 6735 *-F*************************************************************************/
6736static void 6736static void
6737aic7xxx_slave_destroy(Scsi_Device *SDptr) 6737aic7xxx_slave_destroy(struct scsi_device *SDptr)
6738{ 6738{
6739 struct aic_dev_data *aic_dev = SDptr->hostdata; 6739 struct aic_dev_data *aic_dev = SDptr->hostdata;
6740 6740
@@ -6754,7 +6754,7 @@ aic7xxx_slave_destroy(Scsi_Device *SDptr)
6754 * depths, allocate command structs, etc. 6754 * depths, allocate command structs, etc.
6755 *-F*************************************************************************/ 6755 *-F*************************************************************************/
6756static int 6756static int
6757aic7xxx_slave_configure(Scsi_Device *SDptr) 6757aic7xxx_slave_configure(struct scsi_device *SDptr)
6758{ 6758{
6759 struct aic7xxx_host *p = (struct aic7xxx_host *) SDptr->host->hostdata; 6759 struct aic7xxx_host *p = (struct aic7xxx_host *) SDptr->host->hostdata;
6760 struct aic_dev_data *aic_dev; 6760 struct aic_dev_data *aic_dev;
@@ -7865,7 +7865,7 @@ detect_maxscb(struct aic7xxx_host *p)
7865 * Register a Adaptec aic7xxx chip SCSI controller with the kernel. 7865 * Register a Adaptec aic7xxx chip SCSI controller with the kernel.
7866 *-F*************************************************************************/ 7866 *-F*************************************************************************/
7867static int 7867static int
7868aic7xxx_register(Scsi_Host_Template *template, struct aic7xxx_host *p, 7868aic7xxx_register(struct scsi_host_template *template, struct aic7xxx_host *p,
7869 int reset_delay) 7869 int reset_delay)
7870{ 7870{
7871 int i, result; 7871 int i, result;
@@ -8412,7 +8412,7 @@ aic7xxx_chip_reset(struct aic7xxx_host *p)
8412 * and a pointer to a aic7xxx_host struct upon success. 8412 * and a pointer to a aic7xxx_host struct upon success.
8413 *-F*************************************************************************/ 8413 *-F*************************************************************************/
8414static struct aic7xxx_host * 8414static struct aic7xxx_host *
8415aic7xxx_alloc(Scsi_Host_Template *sht, struct aic7xxx_host *temp) 8415aic7xxx_alloc(struct scsi_host_template *sht, struct aic7xxx_host *temp)
8416{ 8416{
8417 struct aic7xxx_host *p = NULL; 8417 struct aic7xxx_host *p = NULL;
8418 struct Scsi_Host *host; 8418 struct Scsi_Host *host;
@@ -8991,7 +8991,7 @@ aic7xxx_configure_bugs(struct aic7xxx_host *p)
8991 * mid-level SCSI code is overhauled. 8991 * mid-level SCSI code is overhauled.
8992 *-F*************************************************************************/ 8992 *-F*************************************************************************/
8993static int 8993static int
8994aic7xxx_detect(Scsi_Host_Template *template) 8994aic7xxx_detect(struct scsi_host_template *template)
8995{ 8995{
8996 struct aic7xxx_host *temp_p = NULL; 8996 struct aic7xxx_host *temp_p = NULL;
8997 struct aic7xxx_host *current_p = NULL; 8997 struct aic7xxx_host *current_p = NULL;
@@ -11161,7 +11161,7 @@ MODULE_LICENSE("Dual BSD/GPL");
11161MODULE_VERSION(AIC7XXX_H_VERSION); 11161MODULE_VERSION(AIC7XXX_H_VERSION);
11162 11162
11163 11163
11164static Scsi_Host_Template driver_template = { 11164static struct scsi_host_template driver_template = {
11165 .proc_info = aic7xxx_proc_info, 11165 .proc_info = aic7xxx_proc_info,
11166 .detect = aic7xxx_detect, 11166 .detect = aic7xxx_detect,
11167 .release = aic7xxx_release, 11167 .release = aic7xxx_release,
diff --git a/drivers/scsi/amiga7xx.c b/drivers/scsi/amiga7xx.c
index dea8446f5360..c0844fa32c5d 100644
--- a/drivers/scsi/amiga7xx.c
+++ b/drivers/scsi/amiga7xx.c
@@ -29,7 +29,7 @@
29#include "amiga7xx.h" 29#include "amiga7xx.h"
30 30
31 31
32static int amiga7xx_register_one(Scsi_Host_Template *tpnt, 32static int amiga7xx_register_one(struct scsi_host_template *tpnt,
33 unsigned long address) 33 unsigned long address)
34{ 34{
35 long long options; 35 long long options;
@@ -65,7 +65,7 @@ static struct {
65 { 0 } 65 { 0 }
66}; 66};
67 67
68static int __init amiga7xx_zorro_detect(Scsi_Host_Template *tpnt) 68static int __init amiga7xx_zorro_detect(struct scsi_host_template *tpnt)
69{ 69{
70 int num = 0, i; 70 int num = 0, i;
71 struct zorro_dev *z = NULL; 71 struct zorro_dev *z = NULL;
@@ -89,7 +89,7 @@ static int __init amiga7xx_zorro_detect(Scsi_Host_Template *tpnt)
89#endif /* CONFIG_ZORRO */ 89#endif /* CONFIG_ZORRO */
90 90
91 91
92int __init amiga7xx_detect(Scsi_Host_Template *tpnt) 92int __init amiga7xx_detect(struct scsi_host_template *tpnt)
93{ 93{
94 static unsigned char called = 0; 94 static unsigned char called = 0;
95 int num = 0; 95 int num = 0;
@@ -122,7 +122,7 @@ static int amiga7xx_release(struct Scsi_Host *shost)
122 return 0; 122 return 0;
123} 123}
124 124
125static Scsi_Host_Template driver_template = { 125static struct scsi_host_template driver_template = {
126 .name = "Amiga NCR53c710 SCSI", 126 .name = "Amiga NCR53c710 SCSI",
127 .detect = amiga7xx_detect, 127 .detect = amiga7xx_detect,
128 .release = amiga7xx_release, 128 .release = amiga7xx_release,
diff --git a/drivers/scsi/amiga7xx.h b/drivers/scsi/amiga7xx.h
index 8cc54a5b889e..1b637592d5ae 100644
--- a/drivers/scsi/amiga7xx.h
+++ b/drivers/scsi/amiga7xx.h
@@ -2,7 +2,7 @@
2 2
3#include <linux/types.h> 3#include <linux/types.h>
4 4
5int amiga7xx_detect(Scsi_Host_Template *); 5int amiga7xx_detect(struct scsi_host_template *);
6const char *NCR53c7x0_info(void); 6const char *NCR53c7x0_info(void);
7int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 7int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
8int NCR53c7xx_abort(Scsi_Cmnd *); 8int NCR53c7xx_abort(Scsi_Cmnd *);
diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c
index be2caecbbdd9..b7b20c689c24 100644
--- a/drivers/scsi/arm/acornscsi.c
+++ b/drivers/scsi/arm/acornscsi.c
@@ -896,7 +896,7 @@ void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result)
896 * Notes : this will only be one SG entry or less 896 * Notes : this will only be one SG entry or less
897 */ 897 */
898static 898static
899void acornscsi_data_updateptr(AS_Host *host, Scsi_Pointer *SCp, unsigned int length) 899void acornscsi_data_updateptr(AS_Host *host, struct scsi_pointer *SCp, unsigned int length)
900{ 900{
901 SCp->ptr += length; 901 SCp->ptr += length;
902 SCp->this_residual -= length; 902 SCp->this_residual -= length;
@@ -2862,7 +2862,7 @@ int acornscsi_proc_info(struct Scsi_Host *instance, char *buffer, char **start,
2862 int length, int inout) 2862 int length, int inout)
2863{ 2863{
2864 int pos, begin = 0, devidx; 2864 int pos, begin = 0, devidx;
2865 Scsi_Device *scd; 2865 struct scsi_device *scd;
2866 AS_Host *host; 2866 AS_Host *host;
2867 char *p = buffer; 2867 char *p = buffer;
2868 2868
@@ -2971,7 +2971,7 @@ int acornscsi_proc_info(struct Scsi_Host *instance, char *buffer, char **start,
2971 return pos; 2971 return pos;
2972} 2972}
2973 2973
2974static Scsi_Host_Template acornscsi_template = { 2974static struct scsi_host_template acornscsi_template = {
2975 .module = THIS_MODULE, 2975 .module = THIS_MODULE,
2976 .proc_info = acornscsi_proc_info, 2976 .proc_info = acornscsi_proc_info,
2977 .name = "AcornSCSI", 2977 .name = "AcornSCSI",
diff --git a/drivers/scsi/arm/acornscsi.h b/drivers/scsi/arm/acornscsi.h
index 03881f091645..2142290f8404 100644
--- a/drivers/scsi/arm/acornscsi.h
+++ b/drivers/scsi/arm/acornscsi.h
@@ -292,7 +292,7 @@ typedef struct acornscsi_hostdata {
292 unsigned char tag; /* reconnected tag */ 292 unsigned char tag; /* reconnected tag */
293 } reconnected; 293 } reconnected;
294 294
295 Scsi_Pointer SCp; /* current commands data pointer */ 295 struct scsi_pointer SCp; /* current commands data pointer */
296 296
297 MsgQueue_t msgs; 297 MsgQueue_t msgs;
298 298
diff --git a/drivers/scsi/arm/arxescsi.c b/drivers/scsi/arm/arxescsi.c
index 29811f5891ee..804125e35fc3 100644
--- a/drivers/scsi/arm/arxescsi.c
+++ b/drivers/scsi/arm/arxescsi.c
@@ -65,7 +65,7 @@ struct arxescsi_info {
65 * Returns : 0 if we should not set CMD_WITHDMA for transfer info command 65 * Returns : 0 if we should not set CMD_WITHDMA for transfer info command
66 */ 66 */
67static fasdmatype_t 67static fasdmatype_t
68arxescsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, 68arxescsi_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
69 fasdmadir_t direction, fasdmatype_t min_type) 69 fasdmadir_t direction, fasdmatype_t min_type)
70{ 70{
71 /* 71 /*
@@ -111,7 +111,7 @@ static void arxescsi_pseudo_dma_write(unsigned char *addr, void __iomem *base)
111 * transfer - minimum number of bytes we expect to transfer 111 * transfer - minimum number of bytes we expect to transfer
112 */ 112 */
113static void 113static void
114arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, 114arxescsi_dma_pseudo(struct Scsi_Host *host, struct scsi_pointer *SCp,
115 fasdmadir_t direction, int transfer) 115 fasdmadir_t direction, int transfer)
116{ 116{
117 struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata; 117 struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata;
@@ -197,7 +197,7 @@ arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
197 * Params : host - host 197 * Params : host - host
198 * SCpnt - command 198 * SCpnt - command
199 */ 199 */
200static void arxescsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) 200static void arxescsi_dma_stop(struct Scsi_Host *host, struct scsi_pointer *SCp)
201{ 201{
202 /* 202 /*
203 * no DMA to stop 203 * no DMA to stop
@@ -261,7 +261,7 @@ arxescsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t off
261 return pos; 261 return pos;
262} 262}
263 263
264static Scsi_Host_Template arxescsi_template = { 264static struct scsi_host_template arxescsi_template = {
265 .proc_info = arxescsi_proc_info, 265 .proc_info = arxescsi_proc_info,
266 .name = "ARXE SCSI card", 266 .name = "ARXE SCSI card",
267 .info = arxescsi_info, 267 .info = arxescsi_info,
diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c
index 26498553a7cc..81e266be26d0 100644
--- a/drivers/scsi/arm/cumana_1.c
+++ b/drivers/scsi/arm/cumana_1.c
@@ -238,7 +238,7 @@ static void cumanascsi_write(struct Scsi_Host *instance, int reg, int value)
238 238
239#include "../NCR5380.c" 239#include "../NCR5380.c"
240 240
241static Scsi_Host_Template cumanascsi_template = { 241static struct scsi_host_template cumanascsi_template = {
242 .module = THIS_MODULE, 242 .module = THIS_MODULE,
243 .name = "Cumana 16-bit SCSI", 243 .name = "Cumana 16-bit SCSI",
244 .info = cumanascsi_info, 244 .info = cumanascsi_info,
diff --git a/drivers/scsi/arm/cumana_2.c b/drivers/scsi/arm/cumana_2.c
index 0ef0644eeb29..3a7a46b0dc41 100644
--- a/drivers/scsi/arm/cumana_2.c
+++ b/drivers/scsi/arm/cumana_2.c
@@ -157,7 +157,7 @@ cumanascsi_2_intr(int irq, void *dev_id, struct pt_regs *regs)
157 * Returns : type of transfer to be performed 157 * Returns : type of transfer to be performed
158 */ 158 */
159static fasdmatype_t 159static fasdmatype_t
160cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, 160cumanascsi_2_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
161 fasdmadir_t direction, fasdmatype_t min_type) 161 fasdmadir_t direction, fasdmatype_t min_type)
162{ 162{
163 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; 163 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
@@ -209,7 +209,7 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
209 * transfer - minimum number of bytes we expect to transfer 209 * transfer - minimum number of bytes we expect to transfer
210 */ 210 */
211static void 211static void
212cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, 212cumanascsi_2_dma_pseudo(struct Scsi_Host *host, struct scsi_pointer *SCp,
213 fasdmadir_t direction, int transfer) 213 fasdmadir_t direction, int transfer)
214{ 214{
215 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; 215 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
@@ -283,7 +283,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
283 * SCpnt - command 283 * SCpnt - command
284 */ 284 */
285static void 285static void
286cumanascsi_2_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) 286cumanascsi_2_dma_stop(struct Scsi_Host *host, struct scsi_pointer *SCp)
287{ 287{
288 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; 288 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
289 if (info->info.scsi.dma != NO_DMA) { 289 if (info->info.scsi.dma != NO_DMA) {
@@ -381,7 +381,7 @@ int cumanascsi_2_proc_info (struct Scsi_Host *host, char *buffer, char **start,
381 return pos; 381 return pos;
382} 382}
383 383
384static Scsi_Host_Template cumanascsi2_template = { 384static struct scsi_host_template cumanascsi2_template = {
385 .module = THIS_MODULE, 385 .module = THIS_MODULE,
386 .proc_info = cumanascsi_2_proc_info, 386 .proc_info = cumanascsi_2_proc_info,
387 .name = "Cumana SCSI II", 387 .name = "Cumana SCSI II",
diff --git a/drivers/scsi/arm/ecoscsi.c b/drivers/scsi/arm/ecoscsi.c
index f8a7fdd3c465..6adcccbf444b 100644
--- a/drivers/scsi/arm/ecoscsi.c
+++ b/drivers/scsi/arm/ecoscsi.c
@@ -155,7 +155,7 @@ printk("reading %p len %d\n",addr, len);
155 155
156#include "../NCR5380.c" 156#include "../NCR5380.c"
157 157
158static Scsi_Host_Template ecoscsi_template = { 158static struct scsi_host_template ecoscsi_template = {
159 .module = THIS_MODULE, 159 .module = THIS_MODULE,
160 .name = "Serial Port EcoSCSI NCR5380", 160 .name = "Serial Port EcoSCSI NCR5380",
161 .proc_name = "ecoscsi", 161 .proc_name = "ecoscsi",
diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c
index ce711f166cfb..4d1e8f52c924 100644
--- a/drivers/scsi/arm/eesox.c
+++ b/drivers/scsi/arm/eesox.c
@@ -158,7 +158,7 @@ eesoxscsi_intr(int irq, void *dev_id, struct pt_regs *regs)
158 * Returns : type of transfer to be performed 158 * Returns : type of transfer to be performed
159 */ 159 */
160static fasdmatype_t 160static fasdmatype_t
161eesoxscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, 161eesoxscsi_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
162 fasdmadir_t direction, fasdmatype_t min_type) 162 fasdmadir_t direction, fasdmatype_t min_type)
163{ 163{
164 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; 164 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
@@ -353,7 +353,7 @@ static void eesoxscsi_buffer_out(void *buf, int length, void __iomem *base)
353} 353}
354 354
355static void 355static void
356eesoxscsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, 356eesoxscsi_dma_pseudo(struct Scsi_Host *host, struct scsi_pointer *SCp,
357 fasdmadir_t dir, int transfer_size) 357 fasdmadir_t dir, int transfer_size)
358{ 358{
359 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; 359 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
@@ -370,7 +370,7 @@ eesoxscsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
370 * SCpnt - command 370 * SCpnt - command
371 */ 371 */
372static void 372static void
373eesoxscsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) 373eesoxscsi_dma_stop(struct Scsi_Host *host, struct scsi_pointer *SCp)
374{ 374{
375 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; 375 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
376 if (info->info.scsi.dma != NO_DMA) 376 if (info->info.scsi.dma != NO_DMA)
@@ -499,7 +499,7 @@ static ssize_t eesoxscsi_store_term(struct device *dev, struct device_attribute
499static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR, 499static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR,
500 eesoxscsi_show_term, eesoxscsi_store_term); 500 eesoxscsi_show_term, eesoxscsi_store_term);
501 501
502static Scsi_Host_Template eesox_template = { 502static struct scsi_host_template eesox_template = {
503 .module = THIS_MODULE, 503 .module = THIS_MODULE,
504 .proc_info = eesoxscsi_proc_info, 504 .proc_info = eesoxscsi_proc_info,
505 .name = "EESOX SCSI", 505 .name = "EESOX SCSI",
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index 4772fb317f3e..3e1053f111dc 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -173,7 +173,7 @@ static void fas216_dumpstate(FAS216_Info *info)
173 fas216_readb(info, REG_CTCH)); 173 fas216_readb(info, REG_CTCH));
174} 174}
175 175
176static void print_SCp(Scsi_Pointer *SCp, const char *prefix, const char *suffix) 176static void print_SCp(struct scsi_pointer *SCp, const char *prefix, const char *suffix)
177{ 177{
178 printk("%sptr %p this_residual 0x%x buffer %p buffers_residual 0x%x%s", 178 printk("%sptr %p this_residual 0x%x buffer %p buffers_residual 0x%x%s",
179 prefix, SCp->ptr, SCp->this_residual, SCp->buffer, 179 prefix, SCp->ptr, SCp->this_residual, SCp->buffer,
@@ -628,7 +628,7 @@ static void fas216_handlesync(FAS216_Info *info, char *msg)
628 */ 628 */
629static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred) 629static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred)
630{ 630{
631 Scsi_Pointer *SCp = &info->scsi.SCp; 631 struct scsi_pointer *SCp = &info->scsi.SCp;
632 632
633 fas216_checkmagic(info); 633 fas216_checkmagic(info);
634 634
@@ -668,7 +668,7 @@ static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred)
668 */ 668 */
669static void fas216_pio(FAS216_Info *info, fasdmadir_t direction) 669static void fas216_pio(FAS216_Info *info, fasdmadir_t direction)
670{ 670{
671 Scsi_Pointer *SCp = &info->scsi.SCp; 671 struct scsi_pointer *SCp = &info->scsi.SCp;
672 672
673 fas216_checkmagic(info); 673 fas216_checkmagic(info);
674 674
@@ -2559,7 +2559,7 @@ int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt)
2559{ 2559{
2560 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2560 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
2561 unsigned long flags; 2561 unsigned long flags;
2562 Scsi_Device *SDpnt; 2562 struct scsi_device *SDpnt;
2563 2563
2564 fas216_checkmagic(info); 2564 fas216_checkmagic(info);
2565 fas216_log(info, LOG_ERROR, "resetting bus"); 2565 fas216_log(info, LOG_ERROR, "resetting bus");
@@ -3000,7 +3000,7 @@ int fas216_print_stats(FAS216_Info *info, char *buffer)
3000int fas216_print_devices(FAS216_Info *info, char *buffer) 3000int fas216_print_devices(FAS216_Info *info, char *buffer)
3001{ 3001{
3002 struct fas216_device *dev; 3002 struct fas216_device *dev;
3003 Scsi_Device *scd; 3003 struct scsi_device *scd;
3004 char *p = buffer; 3004 char *p = buffer;
3005 3005
3006 p += sprintf(p, "Device/Lun TaggedQ Parity Sync\n"); 3006 p += sprintf(p, "Device/Lun TaggedQ Parity Sync\n");
diff --git a/drivers/scsi/arm/fas216.h b/drivers/scsi/arm/fas216.h
index 60a2a120205b..540914d6fd32 100644
--- a/drivers/scsi/arm/fas216.h
+++ b/drivers/scsi/arm/fas216.h
@@ -243,7 +243,7 @@ typedef struct {
243 unsigned int irq; /* interrupt */ 243 unsigned int irq; /* interrupt */
244 int dma; /* dma channel */ 244 int dma; /* dma channel */
245 245
246 Scsi_Pointer SCp; /* current commands data pointer */ 246 struct scsi_pointer SCp; /* current commands data pointer */
247 247
248 MsgQueue_t msgs; /* message queue for connected device */ 248 MsgQueue_t msgs; /* message queue for connected device */
249 249
@@ -304,9 +304,9 @@ typedef struct {
304 /* dma */ 304 /* dma */
305 struct { 305 struct {
306 fasdmatype_t transfer_type; /* current type of DMA transfer */ 306 fasdmatype_t transfer_type; /* current type of DMA transfer */
307 fasdmatype_t (*setup) (struct Scsi_Host *host, Scsi_Pointer *SCp, fasdmadir_t direction, fasdmatype_t min_dma); 307 fasdmatype_t (*setup) (struct Scsi_Host *host, struct scsi_pointer *SCp, fasdmadir_t direction, fasdmatype_t min_dma);
308 void (*pseudo)(struct Scsi_Host *host, Scsi_Pointer *SCp, fasdmadir_t direction, int transfer); 308 void (*pseudo)(struct Scsi_Host *host, struct scsi_pointer *SCp, fasdmadir_t direction, int transfer);
309 void (*stop) (struct Scsi_Host *host, Scsi_Pointer *SCp); 309 void (*stop) (struct Scsi_Host *host, struct scsi_pointer *SCp);
310 } dma; 310 } dma;
311 311
312 /* miscellaneous */ 312 /* miscellaneous */
diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c
index de24bb991f1d..d806b024c3bd 100644
--- a/drivers/scsi/arm/oak.c
+++ b/drivers/scsi/arm/oak.c
@@ -111,7 +111,7 @@ printk("reading %p len %d\n", addr, len);
111 111
112#include "../NCR5380.c" 112#include "../NCR5380.c"
113 113
114static Scsi_Host_Template oakscsi_template = { 114static struct scsi_host_template oakscsi_template = {
115 .module = THIS_MODULE, 115 .module = THIS_MODULE,
116 .proc_info = oakscsi_proc_info, 116 .proc_info = oakscsi_proc_info,
117 .name = "Oak 16-bit SCSI", 117 .name = "Oak 16-bit SCSI",
diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c
index abda216113f1..3333d7b39139 100644
--- a/drivers/scsi/arm/powertec.c
+++ b/drivers/scsi/arm/powertec.c
@@ -132,7 +132,7 @@ powertecscsi_intr(int irq, void *dev_id, struct pt_regs *regs)
132 * Returns : type of transfer to be performed 132 * Returns : type of transfer to be performed
133 */ 133 */
134static fasdmatype_t 134static fasdmatype_t
135powertecscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, 135powertecscsi_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
136 fasdmadir_t direction, fasdmatype_t min_type) 136 fasdmadir_t direction, fasdmatype_t min_type)
137{ 137{
138 struct powertec_info *info = (struct powertec_info *)host->hostdata; 138 struct powertec_info *info = (struct powertec_info *)host->hostdata;
@@ -174,7 +174,7 @@ powertecscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
174 * SCpnt - command 174 * SCpnt - command
175 */ 175 */
176static void 176static void
177powertecscsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) 177powertecscsi_dma_stop(struct Scsi_Host *host, struct scsi_pointer *SCp)
178{ 178{
179 struct powertec_info *info = (struct powertec_info *)host->hostdata; 179 struct powertec_info *info = (struct powertec_info *)host->hostdata;
180 if (info->info.scsi.dma != NO_DMA) 180 if (info->info.scsi.dma != NO_DMA)
@@ -293,7 +293,7 @@ powertecscsi_store_term(struct device *dev, struct device_attribute *attr, const
293static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR, 293static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR,
294 powertecscsi_show_term, powertecscsi_store_term); 294 powertecscsi_show_term, powertecscsi_store_term);
295 295
296static Scsi_Host_Template powertecscsi_template = { 296static struct scsi_host_template powertecscsi_template = {
297 .module = THIS_MODULE, 297 .module = THIS_MODULE,
298 .proc_info = powertecscsi_proc_info, 298 .proc_info = powertecscsi_proc_info,
299 .name = "PowerTec SCSI", 299 .name = "PowerTec SCSI",
diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
index 19937640e2e7..6dd544a5eb56 100644
--- a/drivers/scsi/arm/scsi.h
+++ b/drivers/scsi/arm/scsi.h
@@ -18,7 +18,7 @@
18 * The scatter-gather list handling. This contains all 18 * The scatter-gather list handling. This contains all
19 * the yucky stuff that needs to be fixed properly. 19 * the yucky stuff that needs to be fixed properly.
20 */ 20 */
21static inline int copy_SCp_to_sg(struct scatterlist *sg, Scsi_Pointer *SCp, int max) 21static inline int copy_SCp_to_sg(struct scatterlist *sg, struct scsi_pointer *SCp, int max)
22{ 22{
23 int bufs = SCp->buffers_residual; 23 int bufs = SCp->buffers_residual;
24 24
@@ -32,7 +32,7 @@ static inline int copy_SCp_to_sg(struct scatterlist *sg, Scsi_Pointer *SCp, int
32 return bufs + 1; 32 return bufs + 1;
33} 33}
34 34
35static inline int next_SCp(Scsi_Pointer *SCp) 35static inline int next_SCp(struct scsi_pointer *SCp)
36{ 36{
37 int ret = SCp->buffers_residual; 37 int ret = SCp->buffers_residual;
38 if (ret) { 38 if (ret) {
@@ -49,7 +49,7 @@ static inline int next_SCp(Scsi_Pointer *SCp)
49 return ret; 49 return ret;
50} 50}
51 51
52static inline unsigned char get_next_SCp_byte(Scsi_Pointer *SCp) 52static inline unsigned char get_next_SCp_byte(struct scsi_pointer *SCp)
53{ 53{
54 char c = *SCp->ptr; 54 char c = *SCp->ptr;
55 55
@@ -59,7 +59,7 @@ static inline unsigned char get_next_SCp_byte(Scsi_Pointer *SCp)
59 return c; 59 return c;
60} 60}
61 61
62static inline void put_next_SCp_byte(Scsi_Pointer *SCp, unsigned char c) 62static inline void put_next_SCp_byte(struct scsi_pointer *SCp, unsigned char c)
63{ 63{
64 *SCp->ptr = c; 64 *SCp->ptr = c;
65 SCp->ptr += 1; 65 SCp->ptr += 1;
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index a1bd8d95623c..855428ff37e9 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -95,7 +95,7 @@ static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev);
95 95
96static unsigned int in_module_init = 1; 96static unsigned int in_module_init = 1;
97 97
98static struct pci_device_id piix_pci_tbl[] = { 98static const struct pci_device_id piix_pci_tbl[] = {
99#ifdef ATA_ENABLE_PATA 99#ifdef ATA_ENABLE_PATA
100 { 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix4_pata }, 100 { 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix4_pata },
101 { 0x8086, 0x24db, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich5_pata }, 101 { 0x8086, 0x24db, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich5_pata },
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index 2c12be72c4c6..2ae31ceb32a8 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -255,7 +255,7 @@
255 */ 255 */
256 256
257static struct Scsi_Host *first_instance = NULL; 257static struct Scsi_Host *first_instance = NULL;
258static Scsi_Host_Template *the_template = NULL; 258static struct scsi_host_template *the_template = NULL;
259 259
260/* Macros ease life... :-) */ 260/* Macros ease life... :-) */
261#define SETUP_HOSTDATA(in) \ 261#define SETUP_HOSTDATA(in) \
diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c
index af8adb629b33..f4c1ca7c1572 100644
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -600,7 +600,7 @@ int atari_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
600#endif 600#endif
601 601
602 602
603int atari_scsi_detect (Scsi_Host_Template *host) 603int atari_scsi_detect (struct scsi_host_template *host)
604{ 604{
605 static int called = 0; 605 static int called = 0;
606 struct Scsi_Host *instance; 606 struct Scsi_Host *instance;
@@ -1141,7 +1141,7 @@ static void atari_scsi_falcon_reg_write( unsigned char reg, unsigned char value
1141 1141
1142#include "atari_NCR5380.c" 1142#include "atari_NCR5380.c"
1143 1143
1144static Scsi_Host_Template driver_template = { 1144static struct scsi_host_template driver_template = {
1145 .proc_info = atari_scsi_proc_info, 1145 .proc_info = atari_scsi_proc_info,
1146 .name = "Atari native SCSI", 1146 .name = "Atari native SCSI",
1147 .detect = atari_scsi_detect, 1147 .detect = atari_scsi_detect,
diff --git a/drivers/scsi/atari_scsi.h b/drivers/scsi/atari_scsi.h
index cc1256988841..f917bdd09b41 100644
--- a/drivers/scsi/atari_scsi.h
+++ b/drivers/scsi/atari_scsi.h
@@ -18,7 +18,7 @@
18/* (I_HAVE_OVERRUNS stuff removed) */ 18/* (I_HAVE_OVERRUNS stuff removed) */
19 19
20#ifndef ASM 20#ifndef ASM
21int atari_scsi_detect (Scsi_Host_Template *); 21int atari_scsi_detect (struct scsi_host_template *);
22const char *atari_scsi_info (struct Scsi_Host *); 22const char *atari_scsi_info (struct Scsi_Host *);
23int atari_scsi_reset (Scsi_Cmnd *, unsigned int); 23int atari_scsi_reset (Scsi_Cmnd *, unsigned int);
24#ifdef MODULE 24#ifdef MODULE
diff --git a/drivers/scsi/blz1230.c b/drivers/scsi/blz1230.c
index 4cd9fcf4dc50..763e409a1ff3 100644
--- a/drivers/scsi/blz1230.c
+++ b/drivers/scsi/blz1230.c
@@ -94,7 +94,7 @@ static volatile unsigned char cmd_buffer[16];
94 */ 94 */
95 95
96/***************************************************************** Detection */ 96/***************************************************************** Detection */
97int __init blz1230_esp_detect(Scsi_Host_Template *tpnt) 97int __init blz1230_esp_detect(struct scsi_host_template *tpnt)
98{ 98{
99 struct NCR_ESP *esp; 99 struct NCR_ESP *esp;
100 struct zorro_dev *z = NULL; 100 struct zorro_dev *z = NULL;
@@ -328,7 +328,7 @@ int blz1230_esp_release(struct Scsi_Host *instance)
328} 328}
329 329
330 330
331static Scsi_Host_Template driver_template = { 331static struct scsi_host_template driver_template = {
332 .proc_name = "esp-blz1230", 332 .proc_name = "esp-blz1230",
333 .proc_info = esp_proc_info, 333 .proc_info = esp_proc_info,
334 .name = "Blizzard1230 SCSI IV", 334 .name = "Blizzard1230 SCSI IV",
diff --git a/drivers/scsi/blz2060.c b/drivers/scsi/blz2060.c
index c5221d0de5ca..d72d05fffdfa 100644
--- a/drivers/scsi/blz2060.c
+++ b/drivers/scsi/blz2060.c
@@ -90,7 +90,7 @@ static volatile unsigned char cmd_buffer[16];
90 */ 90 */
91 91
92/***************************************************************** Detection */ 92/***************************************************************** Detection */
93int __init blz2060_esp_detect(Scsi_Host_Template *tpnt) 93int __init blz2060_esp_detect(struct scsi_host_template *tpnt)
94{ 94{
95 struct NCR_ESP *esp; 95 struct NCR_ESP *esp;
96 struct zorro_dev *z = NULL; 96 struct zorro_dev *z = NULL;
@@ -282,7 +282,7 @@ int blz2060_esp_release(struct Scsi_Host *instance)
282} 282}
283 283
284 284
285static Scsi_Host_Template driver_template = { 285static struct scsi_host_template driver_template = {
286 .proc_name = "esp-blz2060", 286 .proc_name = "esp-blz2060",
287 .proc_info = esp_proc_info, 287 .proc_info = esp_proc_info,
288 .name = "Blizzard2060 SCSI", 288 .name = "Blizzard2060 SCSI",
diff --git a/drivers/scsi/bvme6000.c b/drivers/scsi/bvme6000.c
index 130f30f51a9b..2958b8c2bfb7 100644
--- a/drivers/scsi/bvme6000.c
+++ b/drivers/scsi/bvme6000.c
@@ -23,7 +23,7 @@
23#include<linux/stat.h> 23#include<linux/stat.h>
24 24
25 25
26int bvme6000_scsi_detect(Scsi_Host_Template *tpnt) 26int bvme6000_scsi_detect(struct scsi_host_template *tpnt)
27{ 27{
28 static unsigned char called = 0; 28 static unsigned char called = 0;
29 int clock; 29 int clock;
@@ -59,7 +59,7 @@ static int bvme6000_scsi_release(struct Scsi_Host *shost)
59 return 0; 59 return 0;
60} 60}
61 61
62static Scsi_Host_Template driver_template = { 62static struct scsi_host_template driver_template = {
63 .name = "BVME6000 NCR53c710 SCSI", 63 .name = "BVME6000 NCR53c710 SCSI",
64 .detect = bvme6000_scsi_detect, 64 .detect = bvme6000_scsi_detect,
65 .release = bvme6000_scsi_release, 65 .release = bvme6000_scsi_release,
diff --git a/drivers/scsi/bvme6000.h b/drivers/scsi/bvme6000.h
index 49b6bbb0978e..7c9c0366cc08 100644
--- a/drivers/scsi/bvme6000.h
+++ b/drivers/scsi/bvme6000.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6int bvme6000_scsi_detect(Scsi_Host_Template *); 6int bvme6000_scsi_detect(struct scsi_host_template *);
7const char *NCR53c7x0_info(void); 7const char *NCR53c7x0_info(void);
8int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 8int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
9int NCR53c7xx_abort(Scsi_Cmnd *); 9int NCR53c7xx_abort(Scsi_Cmnd *);
diff --git a/drivers/scsi/cyberstorm.c b/drivers/scsi/cyberstorm.c
index bdbca85d1675..f9b940e56430 100644
--- a/drivers/scsi/cyberstorm.c
+++ b/drivers/scsi/cyberstorm.c
@@ -104,7 +104,7 @@ static volatile unsigned char cmd_buffer[16];
104 */ 104 */
105 105
106/***************************************************************** Detection */ 106/***************************************************************** Detection */
107int __init cyber_esp_detect(Scsi_Host_Template *tpnt) 107int __init cyber_esp_detect(struct scsi_host_template *tpnt)
108{ 108{
109 struct NCR_ESP *esp; 109 struct NCR_ESP *esp;
110 struct zorro_dev *z = NULL; 110 struct zorro_dev *z = NULL;
@@ -353,7 +353,7 @@ int cyber_esp_release(struct Scsi_Host *instance)
353} 353}
354 354
355 355
356static Scsi_Host_Template driver_template = { 356static struct scsi_host_template driver_template = {
357 .proc_name = "esp-cyberstorm", 357 .proc_name = "esp-cyberstorm",
358 .proc_info = esp_proc_info, 358 .proc_info = esp_proc_info,
359 .name = "CyberStorm SCSI", 359 .name = "CyberStorm SCSI",
diff --git a/drivers/scsi/cyberstormII.c b/drivers/scsi/cyberstormII.c
index 845d9259821e..a3caabfd7557 100644
--- a/drivers/scsi/cyberstormII.c
+++ b/drivers/scsi/cyberstormII.c
@@ -81,7 +81,7 @@ static volatile unsigned char cmd_buffer[16];
81 */ 81 */
82 82
83/***************************************************************** Detection */ 83/***************************************************************** Detection */
84int __init cyberII_esp_detect(Scsi_Host_Template *tpnt) 84int __init cyberII_esp_detect(struct scsi_host_template *tpnt)
85{ 85{
86 struct NCR_ESP *esp; 86 struct NCR_ESP *esp;
87 struct zorro_dev *z = NULL; 87 struct zorro_dev *z = NULL;
@@ -290,7 +290,7 @@ int cyberII_esp_release(struct Scsi_Host *instance)
290} 290}
291 291
292 292
293static Scsi_Host_Template driver_template = { 293static struct scsi_host_template driver_template = {
294 .proc_name = "esp-cyberstormII", 294 .proc_name = "esp-cyberstormII",
295 .proc_info = esp_proc_info, 295 .proc_info = esp_proc_info,
296 .name = "CyberStorm Mk II SCSI", 296 .name = "CyberStorm Mk II SCSI",
diff --git a/drivers/scsi/dec_esp.c b/drivers/scsi/dec_esp.c
index 256d6baf8df3..a35ee43a48df 100644
--- a/drivers/scsi/dec_esp.c
+++ b/drivers/scsi/dec_esp.c
@@ -133,7 +133,7 @@ static struct scsi_host_template driver_template = {
133#include "scsi_module.c" 133#include "scsi_module.c"
134 134
135/***************************************************************** Detection */ 135/***************************************************************** Detection */
136static int dec_esp_detect(Scsi_Host_Template * tpnt) 136static int dec_esp_detect(struct scsi_host_template * tpnt)
137{ 137{
138 struct NCR_ESP *esp; 138 struct NCR_ESP *esp;
139 struct ConfigDev *esp_dev; 139 struct ConfigDev *esp_dev;
diff --git a/drivers/scsi/dpti.h b/drivers/scsi/dpti.h
index 489194af43d0..2ad2a89b5db4 100644
--- a/drivers/scsi/dpti.h
+++ b/drivers/scsi/dpti.h
@@ -44,7 +44,7 @@ static int adpt_device_reset(struct scsi_cmnd* cmd);
44 44
45 45
46/* 46/*
47 * Scsi_Host_Template (see hosts.h) 47 * struct scsi_host_template (see hosts.h)
48 */ 48 */
49 49
50#define DPT_DRIVER_NAME "Adaptec I2O RAID" 50#define DPT_DRIVER_NAME "Adaptec I2O RAID"
diff --git a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c
index 897743b23342..310d2f488668 100644
--- a/drivers/scsi/dtc.c
+++ b/drivers/scsi/dtc.c
@@ -199,7 +199,7 @@ static void __init dtc_setup(char *str, int *ints)
199#endif 199#endif
200 200
201/* 201/*
202 * Function : int dtc_detect(Scsi_Host_Template * tpnt) 202 * Function : int dtc_detect(struct scsi_host_template * tpnt)
203 * 203 *
204 * Purpose : detects and initializes DTC 3180/3280 controllers 204 * Purpose : detects and initializes DTC 3180/3280 controllers
205 * that were autoprobed, overridden on the LILO command line, 205 * that were autoprobed, overridden on the LILO command line,
@@ -211,7 +211,7 @@ static void __init dtc_setup(char *str, int *ints)
211 * 211 *
212*/ 212*/
213 213
214static int __init dtc_detect(Scsi_Host_Template * tpnt) 214static int __init dtc_detect(struct scsi_host_template * tpnt)
215{ 215{
216 static int current_override = 0, current_base = 0; 216 static int current_override = 0, current_base = 0;
217 struct Scsi_Host *instance; 217 struct Scsi_Host *instance;
@@ -471,7 +471,7 @@ static int dtc_release(struct Scsi_Host *shost)
471 return 0; 471 return 0;
472} 472}
473 473
474static Scsi_Host_Template driver_template = { 474static struct scsi_host_template driver_template = {
475 .name = "DTC 3180/3280 ", 475 .name = "DTC 3180/3280 ",
476 .detect = dtc_detect, 476 .detect = dtc_detect,
477 .release = dtc_release, 477 .release = dtc_release,
diff --git a/drivers/scsi/dtc.h b/drivers/scsi/dtc.h
index 277cd015ee4e..0b205f8c7326 100644
--- a/drivers/scsi/dtc.h
+++ b/drivers/scsi/dtc.h
@@ -35,7 +35,7 @@
35static int dtc_abort(Scsi_Cmnd *); 35static int dtc_abort(Scsi_Cmnd *);
36static int dtc_biosparam(struct scsi_device *, struct block_device *, 36static int dtc_biosparam(struct scsi_device *, struct block_device *,
37 sector_t, int*); 37 sector_t, int*);
38static int dtc_detect(Scsi_Host_Template *); 38static int dtc_detect(struct scsi_host_template *);
39static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 39static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
40static int dtc_bus_reset(Scsi_Cmnd *); 40static int dtc_bus_reset(Scsi_Cmnd *);
41 41
diff --git a/drivers/scsi/fastlane.c b/drivers/scsi/fastlane.c
index ae47612b3614..ccee68b52f7e 100644
--- a/drivers/scsi/fastlane.c
+++ b/drivers/scsi/fastlane.c
@@ -125,7 +125,7 @@ static inline void dma_clear(struct NCR_ESP *esp)
125} 125}
126 126
127/***************************************************************** Detection */ 127/***************************************************************** Detection */
128int __init fastlane_esp_detect(Scsi_Host_Template *tpnt) 128int __init fastlane_esp_detect(struct scsi_host_template *tpnt)
129{ 129{
130 struct NCR_ESP *esp; 130 struct NCR_ESP *esp;
131 struct zorro_dev *z = NULL; 131 struct zorro_dev *z = NULL;
@@ -398,7 +398,7 @@ int fastlane_esp_release(struct Scsi_Host *instance)
398} 398}
399 399
400 400
401static Scsi_Host_Template driver_template = { 401static struct scsi_host_template driver_template = {
402 .proc_name = "esp-fastlane", 402 .proc_name = "esp-fastlane",
403 .proc_info = esp_proc_info, 403 .proc_info = esp_proc_info,
404 .name = "Fastlane SCSI", 404 .name = "Fastlane SCSI",
diff --git a/drivers/scsi/fcal.c b/drivers/scsi/fcal.c
index a6f120dcdfc3..03416548f20c 100644
--- a/drivers/scsi/fcal.c
+++ b/drivers/scsi/fcal.c
@@ -70,7 +70,7 @@ static unsigned char target2alpa[] = {
70 70
71static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd); 71static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd);
72 72
73int fcal_slave_configure(Scsi_Device *device) 73int fcal_slave_configure(struct scsi_device *device)
74{ 74{
75 int depth_to_use; 75 int depth_to_use;
76 76
@@ -89,7 +89,7 @@ int fcal_slave_configure(Scsi_Device *device)
89 89
90/* Detect all FC Arbitrated Loops attached to the machine. 90/* Detect all FC Arbitrated Loops attached to the machine.
91 fc4 module has done all the work for us... */ 91 fc4 module has done all the work for us... */
92int __init fcal_detect(Scsi_Host_Template *tpnt) 92int __init fcal_detect(struct scsi_host_template *tpnt)
93{ 93{
94 int nfcals = 0; 94 int nfcals = 0;
95 fc_channel *fc; 95 fc_channel *fc;
@@ -244,7 +244,7 @@ int fcal_proc_info (struct Scsi_Host *host, char *buffer, char **start, off_t of
244 SPRINTF (" [AL-PA: %02x, Port WWN: %08x%08x, Node WWN: %08x%08x] Not responded to PRLI\n", 244 SPRINTF (" [AL-PA: %02x, Port WWN: %08x%08x, Node WWN: %08x%08x] Not responded to PRLI\n",
245 alpa, u1[0], u1[1], u2[0], u2[1]); 245 alpa, u1[0], u1[1], u2[0], u2[1]);
246 } else { 246 } else {
247 Scsi_Device *scd; 247 struct scsi_device *scd;
248 shost_for_each_device(scd, host) 248 shost_for_each_device(scd, host)
249 if (scd->id == target) { 249 if (scd->id == target) {
250 SPRINTF (" [AL-PA: %02x, Id: %02d, Port WWN: %08x%08x, Node WWN: %08x%08x] ", 250 SPRINTF (" [AL-PA: %02x, Id: %02d, Port WWN: %08x%08x, Node WWN: %08x%08x] ",
@@ -297,7 +297,7 @@ static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmn
297 return 0; 297 return 0;
298} 298}
299 299
300static Scsi_Host_Template driver_template = { 300static struct scsi_host_template driver_template = {
301 .name = "Fibre Channel Arbitrated Loop", 301 .name = "Fibre Channel Arbitrated Loop",
302 .detect = fcal_detect, 302 .detect = fcal_detect,
303 .release = fcal_release, 303 .release = fcal_release,
diff --git a/drivers/scsi/fcal.h b/drivers/scsi/fcal.h
index 21aa32ef9134..7ff2c3494f9e 100644
--- a/drivers/scsi/fcal.h
+++ b/drivers/scsi/fcal.h
@@ -20,8 +20,8 @@ struct fcal {
20 for a particular channel */ 20 for a particular channel */
21#define FCAL_CAN_QUEUE 512 21#define FCAL_CAN_QUEUE 512
22 22
23int fcal_detect(Scsi_Host_Template *); 23int fcal_detect(struct scsi_host_template *);
24int fcal_release(struct Scsi_Host *); 24int fcal_release(struct Scsi_Host *);
25int fcal_slave_configure(Scsi_Device *); 25int fcal_slave_configure(struct scsi_device *);
26 26
27#endif /* !(_FCAL_H) */ 27#endif /* !(_FCAL_H) */
diff --git a/drivers/scsi/fd_mcs.c b/drivers/scsi/fd_mcs.c
index 6d44602aae78..cca485a2b438 100644
--- a/drivers/scsi/fd_mcs.c
+++ b/drivers/scsi/fd_mcs.c
@@ -343,7 +343,7 @@ static void fd_mcs_make_bus_idle(struct Scsi_Host *shpnt)
343 outb(0x01 | PARITY_MASK, TMC_Cntl_port); 343 outb(0x01 | PARITY_MASK, TMC_Cntl_port);
344} 344}
345 345
346static int fd_mcs_detect(Scsi_Host_Template * tpnt) 346static int fd_mcs_detect(struct scsi_host_template * tpnt)
347{ 347{
348 int loop; 348 int loop;
349 struct Scsi_Host *shpnt; 349 struct Scsi_Host *shpnt;
@@ -1343,7 +1343,7 @@ static int fd_mcs_biosparam(struct scsi_device * disk, struct block_device *bdev
1343 return 0; 1343 return 0;
1344} 1344}
1345 1345
1346static Scsi_Host_Template driver_template = { 1346static struct scsi_host_template driver_template = {
1347 .proc_name = "fd_mcs", 1347 .proc_name = "fd_mcs",
1348 .proc_info = fd_mcs_proc_info, 1348 .proc_info = fd_mcs_proc_info,
1349 .detect = fd_mcs_detect, 1349 .detect = fd_mcs_detect,
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index a3aa729b9d3c..45756fa90777 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -285,7 +285,7 @@ static int __init do_DTC3181E_setup(char *str)
285 * Locks: none 285 * Locks: none
286 */ 286 */
287 287
288int __init generic_NCR5380_detect(Scsi_Host_Template * tpnt) 288int __init generic_NCR5380_detect(struct scsi_host_template * tpnt)
289{ 289{
290 static int current_override = 0; 290 static int current_override = 0;
291 int count, i; 291 int count, i;
@@ -798,7 +798,7 @@ static int generic_NCR5380_proc_info(struct Scsi_Host *scsi_ptr, char *buffer, c
798 Scsi_Cmnd *ptr; 798 Scsi_Cmnd *ptr;
799 struct NCR5380_hostdata *hostdata; 799 struct NCR5380_hostdata *hostdata;
800#ifdef NCR5380_STATS 800#ifdef NCR5380_STATS
801 Scsi_Device *dev; 801 struct scsi_device *dev;
802 extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; 802 extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
803#endif 803#endif
804 804
@@ -899,7 +899,7 @@ static int generic_NCR5380_proc_info(struct Scsi_Host *scsi_ptr, char *buffer, c
899#undef PRINTP 899#undef PRINTP
900#undef ANDP 900#undef ANDP
901 901
902static Scsi_Host_Template driver_template = { 902static struct scsi_host_template driver_template = {
903 .proc_info = generic_NCR5380_proc_info, 903 .proc_info = generic_NCR5380_proc_info,
904 .name = "Generic NCR5380/NCR53C400 Scsi Driver", 904 .name = "Generic NCR5380/NCR53C400 Scsi Driver",
905 .detect = generic_NCR5380_detect, 905 .detect = generic_NCR5380_detect,
diff --git a/drivers/scsi/g_NCR5380.h b/drivers/scsi/g_NCR5380.h
index c8adc5a94884..656fbe2f91f6 100644
--- a/drivers/scsi/g_NCR5380.h
+++ b/drivers/scsi/g_NCR5380.h
@@ -45,7 +45,7 @@
45 45
46#ifndef ASM 46#ifndef ASM
47static int generic_NCR5380_abort(Scsi_Cmnd *); 47static int generic_NCR5380_abort(Scsi_Cmnd *);
48static int generic_NCR5380_detect(Scsi_Host_Template *); 48static int generic_NCR5380_detect(struct scsi_host_template *);
49static int generic_NCR5380_release_resources(struct Scsi_Host *); 49static int generic_NCR5380_release_resources(struct Scsi_Host *);
50static int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 50static int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
51static int generic_NCR5380_bus_reset(Scsi_Cmnd *); 51static int generic_NCR5380_bus_reset(Scsi_Cmnd *);
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index af682301beac..a6deb016584c 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -94,7 +94,7 @@
94 * Bugfix free_irq() 94 * Bugfix free_irq()
95 * 95 *
96 * Revision 1.56 2001/08/09 11:19:39 achim 96 * Revision 1.56 2001/08/09 11:19:39 achim
97 * Scsi_Host_Template changes 97 * struct scsi_host_template changes
98 * 98 *
99 * Revision 1.55 2001/08/09 10:11:28 achim 99 * Revision 1.55 2001/08/09 10:11:28 achim
100 * Command HOST_UNFREEZE_IO before cache service init. 100 * Command HOST_UNFREEZE_IO before cache service init.
@@ -4153,7 +4153,7 @@ int __init option_setup(char *str)
4153 return 1; 4153 return 1;
4154} 4154}
4155 4155
4156static int __init gdth_detect(Scsi_Host_Template *shtp) 4156static int __init gdth_detect(struct scsi_host_template *shtp)
4157{ 4157{
4158 struct Scsi_Host *shp; 4158 struct Scsi_Host *shp;
4159 gdth_pci_str pcistr[MAXHA]; 4159 gdth_pci_str pcistr[MAXHA];
@@ -5562,7 +5562,7 @@ static void gdth_flush(int hanum)
5562#else 5562#else
5563 Scsi_Cmnd *scp; 5563 Scsi_Cmnd *scp;
5564#endif 5564#endif
5565 Scsi_Device *sdev; 5565 struct scsi_device *sdev;
5566 char cmnd[MAX_COMMAND_SIZE]; 5566 char cmnd[MAX_COMMAND_SIZE];
5567 memset(cmnd, 0xff, MAX_COMMAND_SIZE); 5567 memset(cmnd, 0xff, MAX_COMMAND_SIZE);
5568 5568
@@ -5624,10 +5624,10 @@ static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
5624 gdth_cmd_str gdtcmd; 5624 gdth_cmd_str gdtcmd;
5625#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 5625#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
5626 Scsi_Request *srp; 5626 Scsi_Request *srp;
5627 Scsi_Device *sdev; 5627 struct scsi_device *sdev;
5628#else 5628#else
5629 Scsi_Cmnd *scp; 5629 Scsi_Cmnd *scp;
5630 Scsi_Device *sdev; 5630 struct scsi_device *sdev;
5631#endif 5631#endif
5632 char cmnd[MAX_COMMAND_SIZE]; 5632 char cmnd[MAX_COMMAND_SIZE];
5633#endif 5633#endif
@@ -5683,7 +5683,7 @@ static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
5683 return NOTIFY_OK; 5683 return NOTIFY_OK;
5684} 5684}
5685 5685
5686static Scsi_Host_Template driver_template = { 5686static struct scsi_host_template driver_template = {
5687 .proc_name = "gdth", 5687 .proc_name = "gdth",
5688 .proc_info = gdth_proc_info, 5688 .proc_info = gdth_proc_info,
5689 .name = "GDT SCSI Disk Array Controller", 5689 .name = "GDT SCSI Disk Array Controller",
diff --git a/drivers/scsi/gdth.h b/drivers/scsi/gdth.h
index c0f1e3411524..cc4882fb97ad 100644
--- a/drivers/scsi/gdth.h
+++ b/drivers/scsi/gdth.h
@@ -944,9 +944,9 @@ typedef struct {
944 ulong dma32_cnt, dma64_cnt; /* statistics: DMA buffer */ 944 ulong dma32_cnt, dma64_cnt; /* statistics: DMA buffer */
945#endif 945#endif
946#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) 946#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
947 Scsi_Device *sdev; 947 struct scsi_device *sdev;
948#else 948#else
949 Scsi_Device sdev; 949 struct scsi_device sdev;
950#endif 950#endif
951} gdth_ha_str; 951} gdth_ha_str;
952 952
diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c
index 1bd02f8d1e6a..5e8657f9cdf6 100644
--- a/drivers/scsi/gdth_proc.c
+++ b/drivers/scsi/gdth_proc.c
@@ -54,10 +54,10 @@ static int gdth_set_info(char *buffer,int length,struct Scsi_Host *host,
54 int ret_val = -EINVAL; 54 int ret_val = -EINVAL;
55#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 55#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
56 Scsi_Request *scp; 56 Scsi_Request *scp;
57 Scsi_Device *sdev; 57 struct scsi_device *sdev;
58#else 58#else
59 Scsi_Cmnd *scp; 59 Scsi_Cmnd *scp;
60 Scsi_Device *sdev; 60 struct scsi_device *sdev;
61#endif 61#endif
62 TRACE2(("gdth_set_info() ha %d bus %d\n",hanum,busnum)); 62 TRACE2(("gdth_set_info() ha %d bus %d\n",hanum,busnum));
63 63
@@ -232,10 +232,10 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
232 gdth_evt_str *estr; 232 gdth_evt_str *estr;
233#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 233#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
234 Scsi_Request *scp; 234 Scsi_Request *scp;
235 Scsi_Device *sdev; 235 struct scsi_device *sdev;
236#else 236#else
237 Scsi_Cmnd *scp; 237 Scsi_Cmnd *scp;
238 Scsi_Device *sdev; 238 struct scsi_device *sdev;
239#endif 239#endif
240 char hrec[161]; 240 char hrec[161];
241 struct timeval tv; 241 struct timeval tv;
@@ -275,7 +275,7 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
275 scp->cmd_len = 12; 275 scp->cmd_len = 12;
276 scp->use_sg = 0; 276 scp->use_sg = 0;
277#else 277#else
278 memset(&sdev,0,sizeof(Scsi_Device)); 278 memset(&sdev,0,sizeof(struct scsi_device));
279 memset(&scp, 0,sizeof(Scsi_Cmnd)); 279 memset(&scp, 0,sizeof(Scsi_Cmnd));
280 sdev.host = scp.host = host; 280 sdev.host = scp.host = host;
281 sdev.id = scp.target = sdev.host->this_id; 281 sdev.id = scp.target = sdev.host->this_id;
diff --git a/drivers/scsi/gvp11.c b/drivers/scsi/gvp11.c
index ab22387c9df1..5b154498056d 100644
--- a/drivers/scsi/gvp11.c
+++ b/drivers/scsi/gvp11.c
@@ -169,7 +169,7 @@ static void dma_stop (struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
169 169
170#define CHECK_WD33C93 170#define CHECK_WD33C93
171 171
172int __init gvp11_detect(Scsi_Host_Template *tpnt) 172int __init gvp11_detect(struct scsi_host_template *tpnt)
173{ 173{
174 static unsigned char called = 0; 174 static unsigned char called = 0;
175 struct Scsi_Host *instance; 175 struct Scsi_Host *instance;
@@ -361,7 +361,7 @@ static int gvp11_bus_reset(Scsi_Cmnd *cmd)
361 361
362#include "gvp11.h" 362#include "gvp11.h"
363 363
364static Scsi_Host_Template driver_template = { 364static struct scsi_host_template driver_template = {
365 .proc_name = "GVP11", 365 .proc_name = "GVP11",
366 .name = "GVP Series II SCSI", 366 .name = "GVP Series II SCSI",
367 .detect = gvp11_detect, 367 .detect = gvp11_detect,
diff --git a/drivers/scsi/gvp11.h b/drivers/scsi/gvp11.h
index 5148d9fada19..575d219d14ba 100644
--- a/drivers/scsi/gvp11.h
+++ b/drivers/scsi/gvp11.h
@@ -11,7 +11,7 @@
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13 13
14int gvp11_detect(Scsi_Host_Template *); 14int gvp11_detect(struct scsi_host_template *);
15int gvp11_release(struct Scsi_Host *); 15int gvp11_release(struct Scsi_Host *);
16const char *wd33c93_info(void); 16const char *wd33c93_info(void);
17int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 17int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c
index 8d97999db60e..b60c1b9270f1 100644
--- a/drivers/scsi/ibmmca.c
+++ b/drivers/scsi/ibmmca.c
@@ -492,7 +492,7 @@ static char *ibmrate(unsigned int, int);
492static int probe_display(int); 492static int probe_display(int);
493static int probe_bus_mode(int); 493static int probe_bus_mode(int);
494static int device_exists(int, int, int *, int *); 494static int device_exists(int, int, int *, int *);
495static struct Scsi_Host *ibmmca_register(Scsi_Host_Template *, int, int, int, char *); 495static struct Scsi_Host *ibmmca_register(struct scsi_host_template *, int, int, int, char *);
496static int option_setup(char *); 496static int option_setup(char *);
497/* local functions needed for proc_info */ 497/* local functions needed for proc_info */
498static int ldn_access_load(int, int); 498static int ldn_access_load(int, int);
@@ -1483,7 +1483,7 @@ static int ibmmca_getinfo(char *buf, int slot, void *dev_id)
1483 return len; 1483 return len;
1484} 1484}
1485 1485
1486int ibmmca_detect(Scsi_Host_Template * scsi_template) 1486int ibmmca_detect(struct scsi_host_template * scsi_template)
1487{ 1487{
1488 struct Scsi_Host *shpnt; 1488 struct Scsi_Host *shpnt;
1489 int port, id, i, j, k, list_size, slot; 1489 int port, id, i, j, k, list_size, slot;
@@ -1736,7 +1736,7 @@ int ibmmca_detect(Scsi_Host_Template * scsi_template)
1736 return found; /* return the number of found SCSI hosts. Should be 1 or 0. */ 1736 return found; /* return the number of found SCSI hosts. Should be 1 or 0. */
1737} 1737}
1738 1738
1739static struct Scsi_Host *ibmmca_register(Scsi_Host_Template * scsi_template, int port, int id, int adaptertype, char *hostname) 1739static struct Scsi_Host *ibmmca_register(struct scsi_host_template * scsi_template, int port, int id, int adaptertype, char *hostname)
1740{ 1740{
1741 struct Scsi_Host *shpnt; 1741 struct Scsi_Host *shpnt;
1742 int i, j; 1742 int i, j;
@@ -2494,7 +2494,7 @@ static int option_setup(char *str)
2494 2494
2495__setup("ibmmcascsi=", option_setup); 2495__setup("ibmmcascsi=", option_setup);
2496 2496
2497static Scsi_Host_Template driver_template = { 2497static struct scsi_host_template driver_template = {
2498 .proc_name = "ibmmca", 2498 .proc_name = "ibmmca",
2499 .proc_info = ibmmca_proc_info, 2499 .proc_info = ibmmca_proc_info,
2500 .name = "IBM SCSI-Subsystem", 2500 .name = "IBM SCSI-Subsystem",
diff --git a/drivers/scsi/ibmmca.h b/drivers/scsi/ibmmca.h
index 6d68f603e9b8..017ee2fa6d63 100644
--- a/drivers/scsi/ibmmca.h
+++ b/drivers/scsi/ibmmca.h
@@ -11,7 +11,7 @@
11/* Common forward declarations for all Linux-versions: */ 11/* Common forward declarations for all Linux-versions: */
12 12
13/* Interfaces to the midlevel Linux SCSI driver */ 13/* Interfaces to the midlevel Linux SCSI driver */
14static int ibmmca_detect (Scsi_Host_Template *); 14static int ibmmca_detect (struct scsi_host_template *);
15static int ibmmca_release (struct Scsi_Host *); 15static int ibmmca_release (struct Scsi_Host *);
16static int ibmmca_queuecommand (Scsi_Cmnd *, void (*done) (Scsi_Cmnd *)); 16static int ibmmca_queuecommand (Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
17static int ibmmca_abort (Scsi_Cmnd *); 17static int ibmmca_abort (Scsi_Cmnd *);
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 3553da0e1cd5..e1960d69fb90 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -882,7 +882,7 @@ static inline int should_transform(ide_drive_t *drive, struct scsi_cmnd *cmd)
882 struct gendisk *disk = cmd->request->rq_disk; 882 struct gendisk *disk = cmd->request->rq_disk;
883 883
884 if (disk) { 884 if (disk) {
885 struct Scsi_Device_Template **p = disk->private_data; 885 struct struct scsi_device_Template **p = disk->private_data;
886 if (strcmp((*p)->scsi_driverfs_driver.name, "sg") == 0) 886 if (strcmp((*p)->scsi_driverfs_driver.name, "sg") == 0)
887 return test_bit(IDESCSI_SG_TRANSFORM, &scsi->transform); 887 return test_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
888 } 888 }
diff --git a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c
index fe387b5ce8bd..34daa3e068de 100644
--- a/drivers/scsi/in2000.c
+++ b/drivers/scsi/in2000.c
@@ -1899,7 +1899,7 @@ static int int_tab[] in2000__INITDATA = {
1899}; 1899};
1900 1900
1901 1901
1902static int __init in2000_detect(Scsi_Host_Template * tpnt) 1902static int __init in2000_detect(struct scsi_host_template * tpnt)
1903{ 1903{
1904 struct Scsi_Host *instance; 1904 struct Scsi_Host *instance;
1905 struct IN2000_hostdata *hostdata; 1905 struct IN2000_hostdata *hostdata;
@@ -2305,7 +2305,7 @@ static int in2000_proc_info(struct Scsi_Host *instance, char *buf, char **start,
2305MODULE_LICENSE("GPL"); 2305MODULE_LICENSE("GPL");
2306 2306
2307 2307
2308static Scsi_Host_Template driver_template = { 2308static struct scsi_host_template driver_template = {
2309 .proc_name = "in2000", 2309 .proc_name = "in2000",
2310 .proc_info = in2000_proc_info, 2310 .proc_info = in2000_proc_info,
2311 .name = "Always IN2000", 2311 .name = "Always IN2000",
diff --git a/drivers/scsi/in2000.h b/drivers/scsi/in2000.h
index a240b52554d8..0fb8b06b8392 100644
--- a/drivers/scsi/in2000.h
+++ b/drivers/scsi/in2000.h
@@ -395,7 +395,7 @@ struct IN2000_hostdata {
395# define CLISPIN_UNLOCK(host,flags) spin_unlock_irqrestore(host->host_lock, \ 395# define CLISPIN_UNLOCK(host,flags) spin_unlock_irqrestore(host->host_lock, \
396 flags) 396 flags)
397 397
398static int in2000_detect(Scsi_Host_Template *) in2000__INIT; 398static int in2000_detect(struct scsi_host_template *) in2000__INIT;
399static int in2000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 399static int in2000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
400static int in2000_abort(Scsi_Cmnd *); 400static int in2000_abort(Scsi_Cmnd *);
401static void in2000_setup(char *, int *) in2000__INIT; 401static void in2000_setup(char *, int *) in2000__INIT;
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index e0039dfae8e5..fa2cb3582cfa 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -91,11 +91,14 @@ static unsigned int ipr_max_speed = 1;
91static int ipr_testmode = 0; 91static int ipr_testmode = 0;
92static unsigned int ipr_fastfail = 0; 92static unsigned int ipr_fastfail = 0;
93static unsigned int ipr_transop_timeout = IPR_OPERATIONAL_TIMEOUT; 93static unsigned int ipr_transop_timeout = IPR_OPERATIONAL_TIMEOUT;
94static unsigned int ipr_enable_cache = 1;
95static unsigned int ipr_debug = 0;
96static int ipr_auto_create = 1;
94static DEFINE_SPINLOCK(ipr_driver_lock); 97static DEFINE_SPINLOCK(ipr_driver_lock);
95 98
96/* This table describes the differences between DMA controller chips */ 99/* This table describes the differences between DMA controller chips */
97static const struct ipr_chip_cfg_t ipr_chip_cfg[] = { 100static const struct ipr_chip_cfg_t ipr_chip_cfg[] = {
98 { /* Gemstone and Citrine */ 101 { /* Gemstone, Citrine, and Obsidian */
99 .mailbox = 0x0042C, 102 .mailbox = 0x0042C,
100 .cache_line_size = 0x20, 103 .cache_line_size = 0x20,
101 { 104 {
@@ -130,6 +133,8 @@ static const struct ipr_chip_cfg_t ipr_chip_cfg[] = {
130static const struct ipr_chip_t ipr_chip[] = { 133static const struct ipr_chip_t ipr_chip[] = {
131 { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, &ipr_chip_cfg[0] }, 134 { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, &ipr_chip_cfg[0] },
132 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, &ipr_chip_cfg[0] }, 135 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, &ipr_chip_cfg[0] },
136 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN, &ipr_chip_cfg[0] },
137 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN, &ipr_chip_cfg[0] },
133 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE, &ipr_chip_cfg[1] }, 138 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE, &ipr_chip_cfg[1] },
134 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, &ipr_chip_cfg[1] } 139 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, &ipr_chip_cfg[1] }
135}; 140};
@@ -150,6 +155,12 @@ module_param_named(fastfail, ipr_fastfail, int, 0);
150MODULE_PARM_DESC(fastfail, "Reduce timeouts and retries"); 155MODULE_PARM_DESC(fastfail, "Reduce timeouts and retries");
151module_param_named(transop_timeout, ipr_transop_timeout, int, 0); 156module_param_named(transop_timeout, ipr_transop_timeout, int, 0);
152MODULE_PARM_DESC(transop_timeout, "Time in seconds to wait for adapter to come operational (default: 300)"); 157MODULE_PARM_DESC(transop_timeout, "Time in seconds to wait for adapter to come operational (default: 300)");
158module_param_named(enable_cache, ipr_enable_cache, int, 0);
159MODULE_PARM_DESC(enable_cache, "Enable adapter's non-volatile write cache (default: 1)");
160module_param_named(debug, ipr_debug, int, 0);
161MODULE_PARM_DESC(debug, "Enable device driver debugging logging. Set to 1 to enable. (default: 0)");
162module_param_named(auto_create, ipr_auto_create, int, 0);
163MODULE_PARM_DESC(auto_create, "Auto-create single device RAID 0 arrays when initialized (default: 1)");
153MODULE_LICENSE("GPL"); 164MODULE_LICENSE("GPL");
154MODULE_VERSION(IPR_DRIVER_VERSION); 165MODULE_VERSION(IPR_DRIVER_VERSION);
155 166
@@ -285,12 +296,18 @@ struct ipr_error_table_t ipr_error_table[] = {
285 "3110: Device bus error, message or command phase"}, 296 "3110: Device bus error, message or command phase"},
286 {0x04670400, 0, 1, 297 {0x04670400, 0, 1,
287 "9091: Incorrect hardware configuration change has been detected"}, 298 "9091: Incorrect hardware configuration change has been detected"},
299 {0x04678000, 0, 1,
300 "9073: Invalid multi-adapter configuration"},
288 {0x046E0000, 0, 1, 301 {0x046E0000, 0, 1,
289 "FFF4: Command to logical unit failed"}, 302 "FFF4: Command to logical unit failed"},
290 {0x05240000, 1, 0, 303 {0x05240000, 1, 0,
291 "Illegal request, invalid request type or request packet"}, 304 "Illegal request, invalid request type or request packet"},
292 {0x05250000, 0, 0, 305 {0x05250000, 0, 0,
293 "Illegal request, invalid resource handle"}, 306 "Illegal request, invalid resource handle"},
307 {0x05258000, 0, 0,
308 "Illegal request, commands not allowed to this device"},
309 {0x05258100, 0, 0,
310 "Illegal request, command not allowed to a secondary adapter"},
294 {0x05260000, 0, 0, 311 {0x05260000, 0, 0,
295 "Illegal request, invalid field in parameter list"}, 312 "Illegal request, invalid field in parameter list"},
296 {0x05260100, 0, 0, 313 {0x05260100, 0, 0,
@@ -299,6 +316,8 @@ struct ipr_error_table_t ipr_error_table[] = {
299 "Illegal request, parameter value invalid"}, 316 "Illegal request, parameter value invalid"},
300 {0x052C0000, 0, 0, 317 {0x052C0000, 0, 0,
301 "Illegal request, command sequence error"}, 318 "Illegal request, command sequence error"},
319 {0x052C8000, 1, 0,
320 "Illegal request, dual adapter support not enabled"},
302 {0x06040500, 0, 1, 321 {0x06040500, 0, 1,
303 "9031: Array protection temporarily suspended, protection resuming"}, 322 "9031: Array protection temporarily suspended, protection resuming"},
304 {0x06040600, 0, 1, 323 {0x06040600, 0, 1,
@@ -315,18 +334,26 @@ struct ipr_error_table_t ipr_error_table[] = {
315 "3029: A device replacement has occurred"}, 334 "3029: A device replacement has occurred"},
316 {0x064C8000, 0, 1, 335 {0x064C8000, 0, 1,
317 "9051: IOA cache data exists for a missing or failed device"}, 336 "9051: IOA cache data exists for a missing or failed device"},
337 {0x064C8100, 0, 1,
338 "9055: Auxiliary cache IOA contains cache data needed by the primary IOA"},
318 {0x06670100, 0, 1, 339 {0x06670100, 0, 1,
319 "9025: Disk unit is not supported at its physical location"}, 340 "9025: Disk unit is not supported at its physical location"},
320 {0x06670600, 0, 1, 341 {0x06670600, 0, 1,
321 "3020: IOA detected a SCSI bus configuration error"}, 342 "3020: IOA detected a SCSI bus configuration error"},
322 {0x06678000, 0, 1, 343 {0x06678000, 0, 1,
323 "3150: SCSI bus configuration error"}, 344 "3150: SCSI bus configuration error"},
345 {0x06678100, 0, 1,
346 "9074: Asymmetric advanced function disk configuration"},
324 {0x06690200, 0, 1, 347 {0x06690200, 0, 1,
325 "9041: Array protection temporarily suspended"}, 348 "9041: Array protection temporarily suspended"},
326 {0x06698200, 0, 1, 349 {0x06698200, 0, 1,
327 "9042: Corrupt array parity detected on specified device"}, 350 "9042: Corrupt array parity detected on specified device"},
328 {0x066B0200, 0, 1, 351 {0x066B0200, 0, 1,
329 "9030: Array no longer protected due to missing or failed disk unit"}, 352 "9030: Array no longer protected due to missing or failed disk unit"},
353 {0x066B8000, 0, 1,
354 "9071: Link operational transition"},
355 {0x066B8100, 0, 1,
356 "9072: Link not operational transition"},
330 {0x066B8200, 0, 1, 357 {0x066B8200, 0, 1,
331 "9032: Array exposed but still protected"}, 358 "9032: Array exposed but still protected"},
332 {0x07270000, 0, 0, 359 {0x07270000, 0, 0,
@@ -789,7 +816,7 @@ static void ipr_send_hcam(struct ipr_ioa_cfg *ioa_cfg, u8 type,
789 **/ 816 **/
790static void ipr_init_res_entry(struct ipr_resource_entry *res) 817static void ipr_init_res_entry(struct ipr_resource_entry *res)
791{ 818{
792 res->needs_sync_complete = 1; 819 res->needs_sync_complete = 0;
793 res->in_erp = 0; 820 res->in_erp = 0;
794 res->add_to_ml = 0; 821 res->add_to_ml = 0;
795 res->del_from_ml = 0; 822 res->del_from_ml = 0;
@@ -889,29 +916,74 @@ static void ipr_process_ccn(struct ipr_cmnd *ipr_cmd)
889 916
890/** 917/**
891 * ipr_log_vpd - Log the passed VPD to the error log. 918 * ipr_log_vpd - Log the passed VPD to the error log.
892 * @vpids: vendor/product id struct 919 * @vpd: vendor/product id/sn struct
893 * @serial_num: serial number string
894 * 920 *
895 * Return value: 921 * Return value:
896 * none 922 * none
897 **/ 923 **/
898static void ipr_log_vpd(struct ipr_std_inq_vpids *vpids, u8 *serial_num) 924static void ipr_log_vpd(struct ipr_vpd *vpd)
899{ 925{
900 char buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN 926 char buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN
901 + IPR_SERIAL_NUM_LEN]; 927 + IPR_SERIAL_NUM_LEN];
902 928
903 memcpy(buffer, vpids->vendor_id, IPR_VENDOR_ID_LEN); 929 memcpy(buffer, vpd->vpids.vendor_id, IPR_VENDOR_ID_LEN);
904 memcpy(buffer + IPR_VENDOR_ID_LEN, vpids->product_id, 930 memcpy(buffer + IPR_VENDOR_ID_LEN, vpd->vpids.product_id,
905 IPR_PROD_ID_LEN); 931 IPR_PROD_ID_LEN);
906 buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN] = '\0'; 932 buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN] = '\0';
907 ipr_err("Vendor/Product ID: %s\n", buffer); 933 ipr_err("Vendor/Product ID: %s\n", buffer);
908 934
909 memcpy(buffer, serial_num, IPR_SERIAL_NUM_LEN); 935 memcpy(buffer, vpd->sn, IPR_SERIAL_NUM_LEN);
910 buffer[IPR_SERIAL_NUM_LEN] = '\0'; 936 buffer[IPR_SERIAL_NUM_LEN] = '\0';
911 ipr_err(" Serial Number: %s\n", buffer); 937 ipr_err(" Serial Number: %s\n", buffer);
912} 938}
913 939
914/** 940/**
941 * ipr_log_ext_vpd - Log the passed extended VPD to the error log.
942 * @vpd: vendor/product id/sn/wwn struct
943 *
944 * Return value:
945 * none
946 **/
947static void ipr_log_ext_vpd(struct ipr_ext_vpd *vpd)
948{
949 ipr_log_vpd(&vpd->vpd);
950 ipr_err(" WWN: %08X%08X\n", be32_to_cpu(vpd->wwid[0]),
951 be32_to_cpu(vpd->wwid[1]));
952}
953
954/**
955 * ipr_log_enhanced_cache_error - Log a cache error.
956 * @ioa_cfg: ioa config struct
957 * @hostrcb: hostrcb struct
958 *
959 * Return value:
960 * none
961 **/
962static void ipr_log_enhanced_cache_error(struct ipr_ioa_cfg *ioa_cfg,
963 struct ipr_hostrcb *hostrcb)
964{
965 struct ipr_hostrcb_type_12_error *error =
966 &hostrcb->hcam.u.error.u.type_12_error;
967
968 ipr_err("-----Current Configuration-----\n");
969 ipr_err("Cache Directory Card Information:\n");
970 ipr_log_ext_vpd(&error->ioa_vpd);
971 ipr_err("Adapter Card Information:\n");
972 ipr_log_ext_vpd(&error->cfc_vpd);
973
974 ipr_err("-----Expected Configuration-----\n");
975 ipr_err("Cache Directory Card Information:\n");
976 ipr_log_ext_vpd(&error->ioa_last_attached_to_cfc_vpd);
977 ipr_err("Adapter Card Information:\n");
978 ipr_log_ext_vpd(&error->cfc_last_attached_to_ioa_vpd);
979
980 ipr_err("Additional IOA Data: %08X %08X %08X\n",
981 be32_to_cpu(error->ioa_data[0]),
982 be32_to_cpu(error->ioa_data[1]),
983 be32_to_cpu(error->ioa_data[2]));
984}
985
986/**
915 * ipr_log_cache_error - Log a cache error. 987 * ipr_log_cache_error - Log a cache error.
916 * @ioa_cfg: ioa config struct 988 * @ioa_cfg: ioa config struct
917 * @hostrcb: hostrcb struct 989 * @hostrcb: hostrcb struct
@@ -927,17 +999,15 @@ static void ipr_log_cache_error(struct ipr_ioa_cfg *ioa_cfg,
927 999
928 ipr_err("-----Current Configuration-----\n"); 1000 ipr_err("-----Current Configuration-----\n");
929 ipr_err("Cache Directory Card Information:\n"); 1001 ipr_err("Cache Directory Card Information:\n");
930 ipr_log_vpd(&error->ioa_vpids, error->ioa_sn); 1002 ipr_log_vpd(&error->ioa_vpd);
931 ipr_err("Adapter Card Information:\n"); 1003 ipr_err("Adapter Card Information:\n");
932 ipr_log_vpd(&error->cfc_vpids, error->cfc_sn); 1004 ipr_log_vpd(&error->cfc_vpd);
933 1005
934 ipr_err("-----Expected Configuration-----\n"); 1006 ipr_err("-----Expected Configuration-----\n");
935 ipr_err("Cache Directory Card Information:\n"); 1007 ipr_err("Cache Directory Card Information:\n");
936 ipr_log_vpd(&error->ioa_last_attached_to_cfc_vpids, 1008 ipr_log_vpd(&error->ioa_last_attached_to_cfc_vpd);
937 error->ioa_last_attached_to_cfc_sn);
938 ipr_err("Adapter Card Information:\n"); 1009 ipr_err("Adapter Card Information:\n");
939 ipr_log_vpd(&error->cfc_last_attached_to_ioa_vpids, 1010 ipr_log_vpd(&error->cfc_last_attached_to_ioa_vpd);
940 error->cfc_last_attached_to_ioa_sn);
941 1011
942 ipr_err("Additional IOA Data: %08X %08X %08X\n", 1012 ipr_err("Additional IOA Data: %08X %08X %08X\n",
943 be32_to_cpu(error->ioa_data[0]), 1013 be32_to_cpu(error->ioa_data[0]),
@@ -946,6 +1016,46 @@ static void ipr_log_cache_error(struct ipr_ioa_cfg *ioa_cfg,
946} 1016}
947 1017
948/** 1018/**
1019 * ipr_log_enhanced_config_error - Log a configuration error.
1020 * @ioa_cfg: ioa config struct
1021 * @hostrcb: hostrcb struct
1022 *
1023 * Return value:
1024 * none
1025 **/
1026static void ipr_log_enhanced_config_error(struct ipr_ioa_cfg *ioa_cfg,
1027 struct ipr_hostrcb *hostrcb)
1028{
1029 int errors_logged, i;
1030 struct ipr_hostrcb_device_data_entry_enhanced *dev_entry;
1031 struct ipr_hostrcb_type_13_error *error;
1032
1033 error = &hostrcb->hcam.u.error.u.type_13_error;
1034 errors_logged = be32_to_cpu(error->errors_logged);
1035
1036 ipr_err("Device Errors Detected/Logged: %d/%d\n",
1037 be32_to_cpu(error->errors_detected), errors_logged);
1038
1039 dev_entry = error->dev;
1040
1041 for (i = 0; i < errors_logged; i++, dev_entry++) {
1042 ipr_err_separator;
1043
1044 ipr_phys_res_err(ioa_cfg, dev_entry->dev_res_addr, "Device %d", i + 1);
1045 ipr_log_ext_vpd(&dev_entry->vpd);
1046
1047 ipr_err("-----New Device Information-----\n");
1048 ipr_log_ext_vpd(&dev_entry->new_vpd);
1049
1050 ipr_err("Cache Directory Card Information:\n");
1051 ipr_log_ext_vpd(&dev_entry->ioa_last_with_dev_vpd);
1052
1053 ipr_err("Adapter Card Information:\n");
1054 ipr_log_ext_vpd(&dev_entry->cfc_last_with_dev_vpd);
1055 }
1056}
1057
1058/**
949 * ipr_log_config_error - Log a configuration error. 1059 * ipr_log_config_error - Log a configuration error.
950 * @ioa_cfg: ioa config struct 1060 * @ioa_cfg: ioa config struct
951 * @hostrcb: hostrcb struct 1061 * @hostrcb: hostrcb struct
@@ -966,30 +1076,22 @@ static void ipr_log_config_error(struct ipr_ioa_cfg *ioa_cfg,
966 ipr_err("Device Errors Detected/Logged: %d/%d\n", 1076 ipr_err("Device Errors Detected/Logged: %d/%d\n",
967 be32_to_cpu(error->errors_detected), errors_logged); 1077 be32_to_cpu(error->errors_detected), errors_logged);
968 1078
969 dev_entry = error->dev_entry; 1079 dev_entry = error->dev;
970 1080
971 for (i = 0; i < errors_logged; i++, dev_entry++) { 1081 for (i = 0; i < errors_logged; i++, dev_entry++) {
972 ipr_err_separator; 1082 ipr_err_separator;
973 1083
974 if (dev_entry->dev_res_addr.bus >= IPR_MAX_NUM_BUSES) { 1084 ipr_phys_res_err(ioa_cfg, dev_entry->dev_res_addr, "Device %d", i + 1);
975 ipr_err("Device %d: missing\n", i + 1); 1085 ipr_log_vpd(&dev_entry->vpd);
976 } else {
977 ipr_err("Device %d: %d:%d:%d:%d\n", i + 1,
978 ioa_cfg->host->host_no, dev_entry->dev_res_addr.bus,
979 dev_entry->dev_res_addr.target, dev_entry->dev_res_addr.lun);
980 }
981 ipr_log_vpd(&dev_entry->dev_vpids, dev_entry->dev_sn);
982 1086
983 ipr_err("-----New Device Information-----\n"); 1087 ipr_err("-----New Device Information-----\n");
984 ipr_log_vpd(&dev_entry->new_dev_vpids, dev_entry->new_dev_sn); 1088 ipr_log_vpd(&dev_entry->new_vpd);
985 1089
986 ipr_err("Cache Directory Card Information:\n"); 1090 ipr_err("Cache Directory Card Information:\n");
987 ipr_log_vpd(&dev_entry->ioa_last_with_dev_vpids, 1091 ipr_log_vpd(&dev_entry->ioa_last_with_dev_vpd);
988 dev_entry->ioa_last_with_dev_sn);
989 1092
990 ipr_err("Adapter Card Information:\n"); 1093 ipr_err("Adapter Card Information:\n");
991 ipr_log_vpd(&dev_entry->cfc_last_with_dev_vpids, 1094 ipr_log_vpd(&dev_entry->cfc_last_with_dev_vpd);
992 dev_entry->cfc_last_with_dev_sn);
993 1095
994 ipr_err("Additional IOA Data: %08X %08X %08X %08X %08X\n", 1096 ipr_err("Additional IOA Data: %08X %08X %08X %08X %08X\n",
995 be32_to_cpu(dev_entry->ioa_data[0]), 1097 be32_to_cpu(dev_entry->ioa_data[0]),
@@ -1001,6 +1103,57 @@ static void ipr_log_config_error(struct ipr_ioa_cfg *ioa_cfg,
1001} 1103}
1002 1104
1003/** 1105/**
1106 * ipr_log_enhanced_array_error - Log an array configuration error.
1107 * @ioa_cfg: ioa config struct
1108 * @hostrcb: hostrcb struct
1109 *
1110 * Return value:
1111 * none
1112 **/
1113static void ipr_log_enhanced_array_error(struct ipr_ioa_cfg *ioa_cfg,
1114 struct ipr_hostrcb *hostrcb)
1115{
1116 int i, num_entries;
1117 struct ipr_hostrcb_type_14_error *error;
1118 struct ipr_hostrcb_array_data_entry_enhanced *array_entry;
1119 const u8 zero_sn[IPR_SERIAL_NUM_LEN] = { [0 ... IPR_SERIAL_NUM_LEN-1] = '0' };
1120
1121 error = &hostrcb->hcam.u.error.u.type_14_error;
1122
1123 ipr_err_separator;
1124
1125 ipr_err("RAID %s Array Configuration: %d:%d:%d:%d\n",
1126 error->protection_level,
1127 ioa_cfg->host->host_no,
1128 error->last_func_vset_res_addr.bus,
1129 error->last_func_vset_res_addr.target,
1130 error->last_func_vset_res_addr.lun);
1131
1132 ipr_err_separator;
1133
1134 array_entry = error->array_member;
1135 num_entries = min_t(u32, be32_to_cpu(error->num_entries),
1136 sizeof(error->array_member));
1137
1138 for (i = 0; i < num_entries; i++, array_entry++) {
1139 if (!memcmp(array_entry->vpd.vpd.sn, zero_sn, IPR_SERIAL_NUM_LEN))
1140 continue;
1141
1142 if (be32_to_cpu(error->exposed_mode_adn) == i)
1143 ipr_err("Exposed Array Member %d:\n", i);
1144 else
1145 ipr_err("Array Member %d:\n", i);
1146
1147 ipr_log_ext_vpd(&array_entry->vpd);
1148 ipr_phys_res_err(ioa_cfg, array_entry->dev_res_addr, "Current Location");
1149 ipr_phys_res_err(ioa_cfg, array_entry->expected_dev_res_addr,
1150 "Expected Location");
1151
1152 ipr_err_separator;
1153 }
1154}
1155
1156/**
1004 * ipr_log_array_error - Log an array configuration error. 1157 * ipr_log_array_error - Log an array configuration error.
1005 * @ioa_cfg: ioa config struct 1158 * @ioa_cfg: ioa config struct
1006 * @hostrcb: hostrcb struct 1159 * @hostrcb: hostrcb struct
@@ -1032,36 +1185,19 @@ static void ipr_log_array_error(struct ipr_ioa_cfg *ioa_cfg,
1032 array_entry = error->array_member; 1185 array_entry = error->array_member;
1033 1186
1034 for (i = 0; i < 18; i++) { 1187 for (i = 0; i < 18; i++) {
1035 if (!memcmp(array_entry->serial_num, zero_sn, IPR_SERIAL_NUM_LEN)) 1188 if (!memcmp(array_entry->vpd.sn, zero_sn, IPR_SERIAL_NUM_LEN))
1036 continue; 1189 continue;
1037 1190
1038 if (be32_to_cpu(error->exposed_mode_adn) == i) { 1191 if (be32_to_cpu(error->exposed_mode_adn) == i)
1039 ipr_err("Exposed Array Member %d:\n", i); 1192 ipr_err("Exposed Array Member %d:\n", i);
1040 } else { 1193 else
1041 ipr_err("Array Member %d:\n", i); 1194 ipr_err("Array Member %d:\n", i);
1042 }
1043 1195
1044 ipr_log_vpd(&array_entry->vpids, array_entry->serial_num); 1196 ipr_log_vpd(&array_entry->vpd);
1045
1046 if (array_entry->dev_res_addr.bus >= IPR_MAX_NUM_BUSES) {
1047 ipr_err("Current Location: unknown\n");
1048 } else {
1049 ipr_err("Current Location: %d:%d:%d:%d\n",
1050 ioa_cfg->host->host_no,
1051 array_entry->dev_res_addr.bus,
1052 array_entry->dev_res_addr.target,
1053 array_entry->dev_res_addr.lun);
1054 }
1055 1197
1056 if (array_entry->expected_dev_res_addr.bus >= IPR_MAX_NUM_BUSES) { 1198 ipr_phys_res_err(ioa_cfg, array_entry->dev_res_addr, "Current Location");
1057 ipr_err("Expected Location: unknown\n"); 1199 ipr_phys_res_err(ioa_cfg, array_entry->expected_dev_res_addr,
1058 } else { 1200 "Expected Location");
1059 ipr_err("Expected Location: %d:%d:%d:%d\n",
1060 ioa_cfg->host->host_no,
1061 array_entry->expected_dev_res_addr.bus,
1062 array_entry->expected_dev_res_addr.target,
1063 array_entry->expected_dev_res_addr.lun);
1064 }
1065 1201
1066 ipr_err_separator; 1202 ipr_err_separator;
1067 1203
@@ -1073,35 +1209,95 @@ static void ipr_log_array_error(struct ipr_ioa_cfg *ioa_cfg,
1073} 1209}
1074 1210
1075/** 1211/**
1076 * ipr_log_generic_error - Log an adapter error. 1212 * ipr_log_hex_data - Log additional hex IOA error data.
1077 * @ioa_cfg: ioa config struct 1213 * @data: IOA error data
1078 * @hostrcb: hostrcb struct 1214 * @len: data length
1079 * 1215 *
1080 * Return value: 1216 * Return value:
1081 * none 1217 * none
1082 **/ 1218 **/
1083static void ipr_log_generic_error(struct ipr_ioa_cfg *ioa_cfg, 1219static void ipr_log_hex_data(u32 *data, int len)
1084 struct ipr_hostrcb *hostrcb)
1085{ 1220{
1086 int i; 1221 int i;
1087 int ioa_data_len = be32_to_cpu(hostrcb->hcam.length);
1088 1222
1089 if (ioa_data_len == 0) 1223 if (len == 0)
1090 return; 1224 return;
1091 1225
1092 ipr_err("IOA Error Data:\n"); 1226 for (i = 0; i < len / 4; i += 4) {
1093 ipr_err("Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F\n");
1094
1095 for (i = 0; i < ioa_data_len / 4; i += 4) {
1096 ipr_err("%08X: %08X %08X %08X %08X\n", i*4, 1227 ipr_err("%08X: %08X %08X %08X %08X\n", i*4,
1097 be32_to_cpu(hostrcb->hcam.u.raw.data[i]), 1228 be32_to_cpu(data[i]),
1098 be32_to_cpu(hostrcb->hcam.u.raw.data[i+1]), 1229 be32_to_cpu(data[i+1]),
1099 be32_to_cpu(hostrcb->hcam.u.raw.data[i+2]), 1230 be32_to_cpu(data[i+2]),
1100 be32_to_cpu(hostrcb->hcam.u.raw.data[i+3])); 1231 be32_to_cpu(data[i+3]));
1101 } 1232 }
1102} 1233}
1103 1234
1104/** 1235/**
1236 * ipr_log_enhanced_dual_ioa_error - Log an enhanced dual adapter error.
1237 * @ioa_cfg: ioa config struct
1238 * @hostrcb: hostrcb struct
1239 *
1240 * Return value:
1241 * none
1242 **/
1243static void ipr_log_enhanced_dual_ioa_error(struct ipr_ioa_cfg *ioa_cfg,
1244 struct ipr_hostrcb *hostrcb)
1245{
1246 struct ipr_hostrcb_type_17_error *error;
1247
1248 error = &hostrcb->hcam.u.error.u.type_17_error;
1249 error->failure_reason[sizeof(error->failure_reason) - 1] = '\0';
1250
1251 ipr_err("%s\n", error->failure_reason);
1252 ipr_err("Remote Adapter VPD:\n");
1253 ipr_log_ext_vpd(&error->vpd);
1254 ipr_log_hex_data(error->data,
1255 be32_to_cpu(hostrcb->hcam.length) -
1256 (offsetof(struct ipr_hostrcb_error, u) +
1257 offsetof(struct ipr_hostrcb_type_17_error, data)));
1258}
1259
1260/**
1261 * ipr_log_dual_ioa_error - Log a dual adapter error.
1262 * @ioa_cfg: ioa config struct
1263 * @hostrcb: hostrcb struct
1264 *
1265 * Return value:
1266 * none
1267 **/
1268static void ipr_log_dual_ioa_error(struct ipr_ioa_cfg *ioa_cfg,
1269 struct ipr_hostrcb *hostrcb)
1270{
1271 struct ipr_hostrcb_type_07_error *error;
1272
1273 error = &hostrcb->hcam.u.error.u.type_07_error;
1274 error->failure_reason[sizeof(error->failure_reason) - 1] = '\0';
1275
1276 ipr_err("%s\n", error->failure_reason);
1277 ipr_err("Remote Adapter VPD:\n");
1278 ipr_log_vpd(&error->vpd);
1279 ipr_log_hex_data(error->data,
1280 be32_to_cpu(hostrcb->hcam.length) -
1281 (offsetof(struct ipr_hostrcb_error, u) +
1282 offsetof(struct ipr_hostrcb_type_07_error, data)));
1283}
1284
1285/**
1286 * ipr_log_generic_error - Log an adapter error.
1287 * @ioa_cfg: ioa config struct
1288 * @hostrcb: hostrcb struct
1289 *
1290 * Return value:
1291 * none
1292 **/
1293static void ipr_log_generic_error(struct ipr_ioa_cfg *ioa_cfg,
1294 struct ipr_hostrcb *hostrcb)
1295{
1296 ipr_log_hex_data(hostrcb->hcam.u.raw.data,
1297 be32_to_cpu(hostrcb->hcam.length));
1298}
1299
1300/**
1105 * ipr_get_error - Find the specfied IOASC in the ipr_error_table. 1301 * ipr_get_error - Find the specfied IOASC in the ipr_error_table.
1106 * @ioasc: IOASC 1302 * @ioasc: IOASC
1107 * 1303 *
@@ -1172,11 +1368,10 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
1172 1368
1173 if (ioa_cfg->log_level < IPR_DEFAULT_LOG_LEVEL) 1369 if (ioa_cfg->log_level < IPR_DEFAULT_LOG_LEVEL)
1174 return; 1370 return;
1371 if (be32_to_cpu(hostrcb->hcam.length) > sizeof(hostrcb->hcam.u.raw))
1372 hostrcb->hcam.length = cpu_to_be32(sizeof(hostrcb->hcam.u.raw));
1175 1373
1176 switch (hostrcb->hcam.overlay_id) { 1374 switch (hostrcb->hcam.overlay_id) {
1177 case IPR_HOST_RCB_OVERLAY_ID_1:
1178 ipr_log_generic_error(ioa_cfg, hostrcb);
1179 break;
1180 case IPR_HOST_RCB_OVERLAY_ID_2: 1375 case IPR_HOST_RCB_OVERLAY_ID_2:
1181 ipr_log_cache_error(ioa_cfg, hostrcb); 1376 ipr_log_cache_error(ioa_cfg, hostrcb);
1182 break; 1377 break;
@@ -1187,13 +1382,26 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
1187 case IPR_HOST_RCB_OVERLAY_ID_6: 1382 case IPR_HOST_RCB_OVERLAY_ID_6:
1188 ipr_log_array_error(ioa_cfg, hostrcb); 1383 ipr_log_array_error(ioa_cfg, hostrcb);
1189 break; 1384 break;
1190 case IPR_HOST_RCB_OVERLAY_ID_DEFAULT: 1385 case IPR_HOST_RCB_OVERLAY_ID_7:
1191 ipr_log_generic_error(ioa_cfg, hostrcb); 1386 ipr_log_dual_ioa_error(ioa_cfg, hostrcb);
1387 break;
1388 case IPR_HOST_RCB_OVERLAY_ID_12:
1389 ipr_log_enhanced_cache_error(ioa_cfg, hostrcb);
1390 break;
1391 case IPR_HOST_RCB_OVERLAY_ID_13:
1392 ipr_log_enhanced_config_error(ioa_cfg, hostrcb);
1393 break;
1394 case IPR_HOST_RCB_OVERLAY_ID_14:
1395 case IPR_HOST_RCB_OVERLAY_ID_16:
1396 ipr_log_enhanced_array_error(ioa_cfg, hostrcb);
1192 break; 1397 break;
1398 case IPR_HOST_RCB_OVERLAY_ID_17:
1399 ipr_log_enhanced_dual_ioa_error(ioa_cfg, hostrcb);
1400 break;
1401 case IPR_HOST_RCB_OVERLAY_ID_1:
1402 case IPR_HOST_RCB_OVERLAY_ID_DEFAULT:
1193 default: 1403 default:
1194 dev_err(&ioa_cfg->pdev->dev, 1404 ipr_log_generic_error(ioa_cfg, hostrcb);
1195 "Unknown error received. Overlay ID: %d\n",
1196 hostrcb->hcam.overlay_id);
1197 break; 1405 break;
1198 } 1406 }
1199} 1407}
@@ -1972,6 +2180,103 @@ static struct bin_attribute ipr_trace_attr = {
1972}; 2180};
1973#endif 2181#endif
1974 2182
2183static const struct {
2184 enum ipr_cache_state state;
2185 char *name;
2186} cache_state [] = {
2187 { CACHE_NONE, "none" },
2188 { CACHE_DISABLED, "disabled" },
2189 { CACHE_ENABLED, "enabled" }
2190};
2191
2192/**
2193 * ipr_show_write_caching - Show the write caching attribute
2194 * @class_dev: class device struct
2195 * @buf: buffer
2196 *
2197 * Return value:
2198 * number of bytes printed to buffer
2199 **/
2200static ssize_t ipr_show_write_caching(struct class_device *class_dev, char *buf)
2201{
2202 struct Scsi_Host *shost = class_to_shost(class_dev);
2203 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
2204 unsigned long lock_flags = 0;
2205 int i, len = 0;
2206
2207 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2208 for (i = 0; i < ARRAY_SIZE(cache_state); i++) {
2209 if (cache_state[i].state == ioa_cfg->cache_state) {
2210 len = snprintf(buf, PAGE_SIZE, "%s\n", cache_state[i].name);
2211 break;
2212 }
2213 }
2214 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2215 return len;
2216}
2217
2218
2219/**
2220 * ipr_store_write_caching - Enable/disable adapter write cache
2221 * @class_dev: class_device struct
2222 * @buf: buffer
2223 * @count: buffer size
2224 *
2225 * This function will enable/disable adapter write cache.
2226 *
2227 * Return value:
2228 * count on success / other on failure
2229 **/
2230static ssize_t ipr_store_write_caching(struct class_device *class_dev,
2231 const char *buf, size_t count)
2232{
2233 struct Scsi_Host *shost = class_to_shost(class_dev);
2234 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
2235 unsigned long lock_flags = 0;
2236 enum ipr_cache_state new_state = CACHE_INVALID;
2237 int i;
2238
2239 if (!capable(CAP_SYS_ADMIN))
2240 return -EACCES;
2241 if (ioa_cfg->cache_state == CACHE_NONE)
2242 return -EINVAL;
2243
2244 for (i = 0; i < ARRAY_SIZE(cache_state); i++) {
2245 if (!strncmp(cache_state[i].name, buf, strlen(cache_state[i].name))) {
2246 new_state = cache_state[i].state;
2247 break;
2248 }
2249 }
2250
2251 if (new_state != CACHE_DISABLED && new_state != CACHE_ENABLED)
2252 return -EINVAL;
2253
2254 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2255 if (ioa_cfg->cache_state == new_state) {
2256 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2257 return count;
2258 }
2259
2260 ioa_cfg->cache_state = new_state;
2261 dev_info(&ioa_cfg->pdev->dev, "%s adapter write cache.\n",
2262 new_state == CACHE_ENABLED ? "Enabling" : "Disabling");
2263 if (!ioa_cfg->in_reset_reload)
2264 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NORMAL);
2265 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2266 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
2267
2268 return count;
2269}
2270
2271static struct class_device_attribute ipr_ioa_cache_attr = {
2272 .attr = {
2273 .name = "write_cache",
2274 .mode = S_IRUGO | S_IWUSR,
2275 },
2276 .show = ipr_show_write_caching,
2277 .store = ipr_store_write_caching
2278};
2279
1975/** 2280/**
1976 * ipr_show_fw_version - Show the firmware version 2281 * ipr_show_fw_version - Show the firmware version
1977 * @class_dev: class device struct 2282 * @class_dev: class device struct
@@ -2112,6 +2417,74 @@ static struct class_device_attribute ipr_diagnostics_attr = {
2112}; 2417};
2113 2418
2114/** 2419/**
2420 * ipr_show_adapter_state - Show the adapter's state
2421 * @class_dev: class device struct
2422 * @buf: buffer
2423 *
2424 * Return value:
2425 * number of bytes printed to buffer
2426 **/
2427static ssize_t ipr_show_adapter_state(struct class_device *class_dev, char *buf)
2428{
2429 struct Scsi_Host *shost = class_to_shost(class_dev);
2430 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
2431 unsigned long lock_flags = 0;
2432 int len;
2433
2434 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2435 if (ioa_cfg->ioa_is_dead)
2436 len = snprintf(buf, PAGE_SIZE, "offline\n");
2437 else
2438 len = snprintf(buf, PAGE_SIZE, "online\n");
2439 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2440 return len;
2441}
2442
2443/**
2444 * ipr_store_adapter_state - Change adapter state
2445 * @class_dev: class_device struct
2446 * @buf: buffer
2447 * @count: buffer size
2448 *
2449 * This function will change the adapter's state.
2450 *
2451 * Return value:
2452 * count on success / other on failure
2453 **/
2454static ssize_t ipr_store_adapter_state(struct class_device *class_dev,
2455 const char *buf, size_t count)
2456{
2457 struct Scsi_Host *shost = class_to_shost(class_dev);
2458 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
2459 unsigned long lock_flags;
2460 int result = count;
2461
2462 if (!capable(CAP_SYS_ADMIN))
2463 return -EACCES;
2464
2465 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2466 if (ioa_cfg->ioa_is_dead && !strncmp(buf, "online", 6)) {
2467 ioa_cfg->ioa_is_dead = 0;
2468 ioa_cfg->reset_retries = 0;
2469 ioa_cfg->in_ioa_bringdown = 0;
2470 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NONE);
2471 }
2472 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2473 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
2474
2475 return result;
2476}
2477
2478static struct class_device_attribute ipr_ioa_state_attr = {
2479 .attr = {
2480 .name = "state",
2481 .mode = S_IRUGO | S_IWUSR,
2482 },
2483 .show = ipr_show_adapter_state,
2484 .store = ipr_store_adapter_state
2485};
2486
2487/**
2115 * ipr_store_reset_adapter - Reset the adapter 2488 * ipr_store_reset_adapter - Reset the adapter
2116 * @class_dev: class_device struct 2489 * @class_dev: class_device struct
2117 * @buf: buffer 2490 * @buf: buffer
@@ -2183,7 +2556,7 @@ static struct ipr_sglist *ipr_alloc_ucode_buffer(int buf_len)
2183 num_elem = buf_len / bsize_elem; 2556 num_elem = buf_len / bsize_elem;
2184 2557
2185 /* Allocate a scatter/gather list for the DMA */ 2558 /* Allocate a scatter/gather list for the DMA */
2186 sglist = kmalloc(sizeof(struct ipr_sglist) + 2559 sglist = kzalloc(sizeof(struct ipr_sglist) +
2187 (sizeof(struct scatterlist) * (num_elem - 1)), 2560 (sizeof(struct scatterlist) * (num_elem - 1)),
2188 GFP_KERNEL); 2561 GFP_KERNEL);
2189 2562
@@ -2192,9 +2565,6 @@ static struct ipr_sglist *ipr_alloc_ucode_buffer(int buf_len)
2192 return NULL; 2565 return NULL;
2193 } 2566 }
2194 2567
2195 memset(sglist, 0, sizeof(struct ipr_sglist) +
2196 (sizeof(struct scatterlist) * (num_elem - 1)));
2197
2198 scatterlist = sglist->scatterlist; 2568 scatterlist = sglist->scatterlist;
2199 2569
2200 sglist->order = order; 2570 sglist->order = order;
@@ -2289,31 +2659,24 @@ static int ipr_copy_ucode_buffer(struct ipr_sglist *sglist,
2289} 2659}
2290 2660
2291/** 2661/**
2292 * ipr_map_ucode_buffer - Map a microcode download buffer 2662 * ipr_build_ucode_ioadl - Build a microcode download IOADL
2293 * @ipr_cmd: ipr command struct 2663 * @ipr_cmd: ipr command struct
2294 * @sglist: scatter/gather list 2664 * @sglist: scatter/gather list
2295 * @len: total length of download buffer
2296 * 2665 *
2297 * Maps a microcode download scatter/gather list for DMA and 2666 * Builds a microcode download IOA data list (IOADL).
2298 * builds the IOADL.
2299 * 2667 *
2300 * Return value:
2301 * 0 on success / -EIO on failure
2302 **/ 2668 **/
2303static int ipr_map_ucode_buffer(struct ipr_cmnd *ipr_cmd, 2669static void ipr_build_ucode_ioadl(struct ipr_cmnd *ipr_cmd,
2304 struct ipr_sglist *sglist, int len) 2670 struct ipr_sglist *sglist)
2305{ 2671{
2306 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
2307 struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb; 2672 struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb;
2308 struct ipr_ioadl_desc *ioadl = ipr_cmd->ioadl; 2673 struct ipr_ioadl_desc *ioadl = ipr_cmd->ioadl;
2309 struct scatterlist *scatterlist = sglist->scatterlist; 2674 struct scatterlist *scatterlist = sglist->scatterlist;
2310 int i; 2675 int i;
2311 2676
2312 ipr_cmd->dma_use_sg = pci_map_sg(ioa_cfg->pdev, scatterlist, 2677 ipr_cmd->dma_use_sg = sglist->num_dma_sg;
2313 sglist->num_sg, DMA_TO_DEVICE);
2314
2315 ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_WRITE_NOT_READ; 2678 ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_WRITE_NOT_READ;
2316 ioarcb->write_data_transfer_length = cpu_to_be32(len); 2679 ioarcb->write_data_transfer_length = cpu_to_be32(sglist->buffer_len);
2317 ioarcb->write_ioadl_len = 2680 ioarcb->write_ioadl_len =
2318 cpu_to_be32(sizeof(struct ipr_ioadl_desc) * ipr_cmd->dma_use_sg); 2681 cpu_to_be32(sizeof(struct ipr_ioadl_desc) * ipr_cmd->dma_use_sg);
2319 2682
@@ -2324,15 +2687,52 @@ static int ipr_map_ucode_buffer(struct ipr_cmnd *ipr_cmd,
2324 cpu_to_be32(sg_dma_address(&scatterlist[i])); 2687 cpu_to_be32(sg_dma_address(&scatterlist[i]));
2325 } 2688 }
2326 2689
2327 if (likely(ipr_cmd->dma_use_sg)) { 2690 ioadl[i-1].flags_and_data_len |=
2328 ioadl[i-1].flags_and_data_len |= 2691 cpu_to_be32(IPR_IOADL_FLAGS_LAST);
2329 cpu_to_be32(IPR_IOADL_FLAGS_LAST); 2692}
2693
2694/**
2695 * ipr_update_ioa_ucode - Update IOA's microcode
2696 * @ioa_cfg: ioa config struct
2697 * @sglist: scatter/gather list
2698 *
2699 * Initiate an adapter reset to update the IOA's microcode
2700 *
2701 * Return value:
2702 * 0 on success / -EIO on failure
2703 **/
2704static int ipr_update_ioa_ucode(struct ipr_ioa_cfg *ioa_cfg,
2705 struct ipr_sglist *sglist)
2706{
2707 unsigned long lock_flags;
2708
2709 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2710
2711 if (ioa_cfg->ucode_sglist) {
2712 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2713 dev_err(&ioa_cfg->pdev->dev,
2714 "Microcode download already in progress\n");
2715 return -EIO;
2330 } 2716 }
2331 else { 2717
2332 dev_err(&ioa_cfg->pdev->dev, "pci_map_sg failed!\n"); 2718 sglist->num_dma_sg = pci_map_sg(ioa_cfg->pdev, sglist->scatterlist,
2719 sglist->num_sg, DMA_TO_DEVICE);
2720
2721 if (!sglist->num_dma_sg) {
2722 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2723 dev_err(&ioa_cfg->pdev->dev,
2724 "Failed to map microcode download buffer!\n");
2333 return -EIO; 2725 return -EIO;
2334 } 2726 }
2335 2727
2728 ioa_cfg->ucode_sglist = sglist;
2729 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NORMAL);
2730 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2731 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
2732
2733 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2734 ioa_cfg->ucode_sglist = NULL;
2735 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2336 return 0; 2736 return 0;
2337} 2737}
2338 2738
@@ -2355,7 +2755,6 @@ static ssize_t ipr_store_update_fw(struct class_device *class_dev,
2355 struct ipr_ucode_image_header *image_hdr; 2755 struct ipr_ucode_image_header *image_hdr;
2356 const struct firmware *fw_entry; 2756 const struct firmware *fw_entry;
2357 struct ipr_sglist *sglist; 2757 struct ipr_sglist *sglist;
2358 unsigned long lock_flags;
2359 char fname[100]; 2758 char fname[100];
2360 char *src; 2759 char *src;
2361 int len, result, dnld_size; 2760 int len, result, dnld_size;
@@ -2396,35 +2795,17 @@ static ssize_t ipr_store_update_fw(struct class_device *class_dev,
2396 if (result) { 2795 if (result) {
2397 dev_err(&ioa_cfg->pdev->dev, 2796 dev_err(&ioa_cfg->pdev->dev,
2398 "Microcode buffer copy to DMA buffer failed\n"); 2797 "Microcode buffer copy to DMA buffer failed\n");
2399 ipr_free_ucode_buffer(sglist); 2798 goto out;
2400 release_firmware(fw_entry);
2401 return result;
2402 }
2403
2404 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2405
2406 if (ioa_cfg->ucode_sglist) {
2407 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2408 dev_err(&ioa_cfg->pdev->dev,
2409 "Microcode download already in progress\n");
2410 ipr_free_ucode_buffer(sglist);
2411 release_firmware(fw_entry);
2412 return -EIO;
2413 } 2799 }
2414 2800
2415 ioa_cfg->ucode_sglist = sglist; 2801 result = ipr_update_ioa_ucode(ioa_cfg, sglist);
2416 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NORMAL);
2417 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2418 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
2419
2420 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2421 ioa_cfg->ucode_sglist = NULL;
2422 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2423 2802
2803 if (!result)
2804 result = count;
2805out:
2424 ipr_free_ucode_buffer(sglist); 2806 ipr_free_ucode_buffer(sglist);
2425 release_firmware(fw_entry); 2807 release_firmware(fw_entry);
2426 2808 return result;
2427 return count;
2428} 2809}
2429 2810
2430static struct class_device_attribute ipr_update_fw_attr = { 2811static struct class_device_attribute ipr_update_fw_attr = {
@@ -2439,8 +2820,10 @@ static struct class_device_attribute *ipr_ioa_attrs[] = {
2439 &ipr_fw_version_attr, 2820 &ipr_fw_version_attr,
2440 &ipr_log_level_attr, 2821 &ipr_log_level_attr,
2441 &ipr_diagnostics_attr, 2822 &ipr_diagnostics_attr,
2823 &ipr_ioa_state_attr,
2442 &ipr_ioa_reset_attr, 2824 &ipr_ioa_reset_attr,
2443 &ipr_update_fw_attr, 2825 &ipr_update_fw_attr,
2826 &ipr_ioa_cache_attr,
2444 NULL, 2827 NULL,
2445}; 2828};
2446 2829
@@ -2548,14 +2931,13 @@ static int ipr_alloc_dump(struct ipr_ioa_cfg *ioa_cfg)
2548 unsigned long lock_flags = 0; 2931 unsigned long lock_flags = 0;
2549 2932
2550 ENTER; 2933 ENTER;
2551 dump = kmalloc(sizeof(struct ipr_dump), GFP_KERNEL); 2934 dump = kzalloc(sizeof(struct ipr_dump), GFP_KERNEL);
2552 2935
2553 if (!dump) { 2936 if (!dump) {
2554 ipr_err("Dump memory allocation failed\n"); 2937 ipr_err("Dump memory allocation failed\n");
2555 return -ENOMEM; 2938 return -ENOMEM;
2556 } 2939 }
2557 2940
2558 memset(dump, 0, sizeof(struct ipr_dump));
2559 kref_init(&dump->kref); 2941 kref_init(&dump->kref);
2560 dump->ioa_cfg = ioa_cfg; 2942 dump->ioa_cfg = ioa_cfg;
2561 2943
@@ -2824,8 +3206,10 @@ static int ipr_slave_configure(struct scsi_device *sdev)
2824 if (res) { 3206 if (res) {
2825 if (ipr_is_af_dasd_device(res)) 3207 if (ipr_is_af_dasd_device(res))
2826 sdev->type = TYPE_RAID; 3208 sdev->type = TYPE_RAID;
2827 if (ipr_is_af_dasd_device(res) || ipr_is_ioa_resource(res)) 3209 if (ipr_is_af_dasd_device(res) || ipr_is_ioa_resource(res)) {
2828 sdev->scsi_level = 4; 3210 sdev->scsi_level = 4;
3211 sdev->no_uld_attach = 1;
3212 }
2829 if (ipr_is_vset_device(res)) { 3213 if (ipr_is_vset_device(res)) {
2830 sdev->timeout = IPR_VSET_RW_TIMEOUT; 3214 sdev->timeout = IPR_VSET_RW_TIMEOUT;
2831 blk_queue_max_sectors(sdev->request_queue, IPR_VSET_MAX_SECTORS); 3215 blk_queue_max_sectors(sdev->request_queue, IPR_VSET_MAX_SECTORS);
@@ -2848,13 +3232,14 @@ static int ipr_slave_configure(struct scsi_device *sdev)
2848 * handling new commands. 3232 * handling new commands.
2849 * 3233 *
2850 * Return value: 3234 * Return value:
2851 * 0 on success 3235 * 0 on success / -ENXIO if device does not exist
2852 **/ 3236 **/
2853static int ipr_slave_alloc(struct scsi_device *sdev) 3237static int ipr_slave_alloc(struct scsi_device *sdev)
2854{ 3238{
2855 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata; 3239 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata;
2856 struct ipr_resource_entry *res; 3240 struct ipr_resource_entry *res;
2857 unsigned long lock_flags; 3241 unsigned long lock_flags;
3242 int rc = -ENXIO;
2858 3243
2859 sdev->hostdata = NULL; 3244 sdev->hostdata = NULL;
2860 3245
@@ -2868,14 +3253,16 @@ static int ipr_slave_alloc(struct scsi_device *sdev)
2868 res->add_to_ml = 0; 3253 res->add_to_ml = 0;
2869 res->in_erp = 0; 3254 res->in_erp = 0;
2870 sdev->hostdata = res; 3255 sdev->hostdata = res;
2871 res->needs_sync_complete = 1; 3256 if (!ipr_is_naca_model(res))
3257 res->needs_sync_complete = 1;
3258 rc = 0;
2872 break; 3259 break;
2873 } 3260 }
2874 } 3261 }
2875 3262
2876 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 3263 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2877 3264
2878 return 0; 3265 return rc;
2879} 3266}
2880 3267
2881/** 3268/**
@@ -2939,7 +3326,7 @@ static int __ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd)
2939 ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata; 3326 ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata;
2940 res = scsi_cmd->device->hostdata; 3327 res = scsi_cmd->device->hostdata;
2941 3328
2942 if (!res || (!ipr_is_gscsi(res) && !ipr_is_vset_device(res))) 3329 if (!res)
2943 return FAILED; 3330 return FAILED;
2944 3331
2945 /* 3332 /*
@@ -3131,7 +3518,8 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd)
3131 } 3518 }
3132 3519
3133 list_add_tail(&ipr_cmd->queue, &ioa_cfg->free_q); 3520 list_add_tail(&ipr_cmd->queue, &ioa_cfg->free_q);
3134 res->needs_sync_complete = 1; 3521 if (!ipr_is_naca_model(res))
3522 res->needs_sync_complete = 1;
3135 3523
3136 LEAVE; 3524 LEAVE;
3137 return (IPR_IOASC_SENSE_KEY(ioasc) ? FAILED : SUCCESS); 3525 return (IPR_IOASC_SENSE_KEY(ioasc) ? FAILED : SUCCESS);
@@ -3435,7 +3823,8 @@ static void ipr_erp_done(struct ipr_cmnd *ipr_cmd)
3435 } 3823 }
3436 3824
3437 if (res) { 3825 if (res) {
3438 res->needs_sync_complete = 1; 3826 if (!ipr_is_naca_model(res))
3827 res->needs_sync_complete = 1;
3439 res->in_erp = 0; 3828 res->in_erp = 0;
3440 } 3829 }
3441 ipr_unmap_sglist(ioa_cfg, ipr_cmd); 3830 ipr_unmap_sglist(ioa_cfg, ipr_cmd);
@@ -3705,6 +4094,30 @@ static void ipr_gen_sense(struct ipr_cmnd *ipr_cmd)
3705} 4094}
3706 4095
3707/** 4096/**
4097 * ipr_get_autosense - Copy autosense data to sense buffer
4098 * @ipr_cmd: ipr command struct
4099 *
4100 * This function copies the autosense buffer to the buffer
4101 * in the scsi_cmd, if there is autosense available.
4102 *
4103 * Return value:
4104 * 1 if autosense was available / 0 if not
4105 **/
4106static int ipr_get_autosense(struct ipr_cmnd *ipr_cmd)
4107{
4108 struct ipr_ioasa *ioasa = &ipr_cmd->ioasa;
4109
4110 if ((be32_to_cpu(ioasa->ioasc_specific) &
4111 (IPR_ADDITIONAL_STATUS_FMT | IPR_AUTOSENSE_VALID)) == 0)
4112 return 0;
4113
4114 memcpy(ipr_cmd->scsi_cmd->sense_buffer, ioasa->auto_sense.data,
4115 min_t(u16, be16_to_cpu(ioasa->auto_sense.auto_sense_len),
4116 SCSI_SENSE_BUFFERSIZE));
4117 return 1;
4118}
4119
4120/**
3708 * ipr_erp_start - Process an error response for a SCSI op 4121 * ipr_erp_start - Process an error response for a SCSI op
3709 * @ioa_cfg: ioa config struct 4122 * @ioa_cfg: ioa config struct
3710 * @ipr_cmd: ipr command struct 4123 * @ipr_cmd: ipr command struct
@@ -3734,14 +4147,19 @@ static void ipr_erp_start(struct ipr_ioa_cfg *ioa_cfg,
3734 4147
3735 switch (ioasc & IPR_IOASC_IOASC_MASK) { 4148 switch (ioasc & IPR_IOASC_IOASC_MASK) {
3736 case IPR_IOASC_ABORTED_CMD_TERM_BY_HOST: 4149 case IPR_IOASC_ABORTED_CMD_TERM_BY_HOST:
3737 scsi_cmd->result |= (DID_IMM_RETRY << 16); 4150 if (ipr_is_naca_model(res))
4151 scsi_cmd->result |= (DID_ABORT << 16);
4152 else
4153 scsi_cmd->result |= (DID_IMM_RETRY << 16);
3738 break; 4154 break;
3739 case IPR_IOASC_IR_RESOURCE_HANDLE: 4155 case IPR_IOASC_IR_RESOURCE_HANDLE:
4156 case IPR_IOASC_IR_NO_CMDS_TO_2ND_IOA:
3740 scsi_cmd->result |= (DID_NO_CONNECT << 16); 4157 scsi_cmd->result |= (DID_NO_CONNECT << 16);
3741 break; 4158 break;
3742 case IPR_IOASC_HW_SEL_TIMEOUT: 4159 case IPR_IOASC_HW_SEL_TIMEOUT:
3743 scsi_cmd->result |= (DID_NO_CONNECT << 16); 4160 scsi_cmd->result |= (DID_NO_CONNECT << 16);
3744 res->needs_sync_complete = 1; 4161 if (!ipr_is_naca_model(res))
4162 res->needs_sync_complete = 1;
3745 break; 4163 break;
3746 case IPR_IOASC_SYNC_REQUIRED: 4164 case IPR_IOASC_SYNC_REQUIRED:
3747 if (!res->in_erp) 4165 if (!res->in_erp)
@@ -3749,6 +4167,7 @@ static void ipr_erp_start(struct ipr_ioa_cfg *ioa_cfg,
3749 scsi_cmd->result |= (DID_IMM_RETRY << 16); 4167 scsi_cmd->result |= (DID_IMM_RETRY << 16);
3750 break; 4168 break;
3751 case IPR_IOASC_MED_DO_NOT_REALLOC: /* prevent retries */ 4169 case IPR_IOASC_MED_DO_NOT_REALLOC: /* prevent retries */
4170 case IPR_IOASA_IR_DUAL_IOA_DISABLED:
3752 scsi_cmd->result |= (DID_PASSTHROUGH << 16); 4171 scsi_cmd->result |= (DID_PASSTHROUGH << 16);
3753 break; 4172 break;
3754 case IPR_IOASC_BUS_WAS_RESET: 4173 case IPR_IOASC_BUS_WAS_RESET:
@@ -3760,21 +4179,27 @@ static void ipr_erp_start(struct ipr_ioa_cfg *ioa_cfg,
3760 if (!res->resetting_device) 4179 if (!res->resetting_device)
3761 scsi_report_bus_reset(ioa_cfg->host, scsi_cmd->device->channel); 4180 scsi_report_bus_reset(ioa_cfg->host, scsi_cmd->device->channel);
3762 scsi_cmd->result |= (DID_ERROR << 16); 4181 scsi_cmd->result |= (DID_ERROR << 16);
3763 res->needs_sync_complete = 1; 4182 if (!ipr_is_naca_model(res))
4183 res->needs_sync_complete = 1;
3764 break; 4184 break;
3765 case IPR_IOASC_HW_DEV_BUS_STATUS: 4185 case IPR_IOASC_HW_DEV_BUS_STATUS:
3766 scsi_cmd->result |= IPR_IOASC_SENSE_STATUS(ioasc); 4186 scsi_cmd->result |= IPR_IOASC_SENSE_STATUS(ioasc);
3767 if (IPR_IOASC_SENSE_STATUS(ioasc) == SAM_STAT_CHECK_CONDITION) { 4187 if (IPR_IOASC_SENSE_STATUS(ioasc) == SAM_STAT_CHECK_CONDITION) {
3768 ipr_erp_cancel_all(ipr_cmd); 4188 if (!ipr_get_autosense(ipr_cmd)) {
3769 return; 4189 if (!ipr_is_naca_model(res)) {
4190 ipr_erp_cancel_all(ipr_cmd);
4191 return;
4192 }
4193 }
3770 } 4194 }
3771 res->needs_sync_complete = 1; 4195 if (!ipr_is_naca_model(res))
4196 res->needs_sync_complete = 1;
3772 break; 4197 break;
3773 case IPR_IOASC_NR_INIT_CMD_REQUIRED: 4198 case IPR_IOASC_NR_INIT_CMD_REQUIRED:
3774 break; 4199 break;
3775 default: 4200 default:
3776 scsi_cmd->result |= (DID_ERROR << 16); 4201 scsi_cmd->result |= (DID_ERROR << 16);
3777 if (!ipr_is_vset_device(res)) 4202 if (!ipr_is_vset_device(res) && !ipr_is_naca_model(res))
3778 res->needs_sync_complete = 1; 4203 res->needs_sync_complete = 1;
3779 break; 4204 break;
3780 } 4205 }
@@ -4073,6 +4498,7 @@ static int ipr_ioa_reset_done(struct ipr_cmnd *ipr_cmd)
4073 ioa_cfg->in_reset_reload = 0; 4498 ioa_cfg->in_reset_reload = 0;
4074 ioa_cfg->allow_cmds = 1; 4499 ioa_cfg->allow_cmds = 1;
4075 ioa_cfg->reset_cmd = NULL; 4500 ioa_cfg->reset_cmd = NULL;
4501 ioa_cfg->doorbell |= IPR_RUNTIME_RESET;
4076 4502
4077 list_for_each_entry(res, &ioa_cfg->used_res_q, queue) { 4503 list_for_each_entry(res, &ioa_cfg->used_res_q, queue) {
4078 if (ioa_cfg->allow_ml_add_del && (res->add_to_ml || res->del_from_ml)) { 4504 if (ioa_cfg->allow_ml_add_del && (res->add_to_ml || res->del_from_ml)) {
@@ -4146,7 +4572,7 @@ static int ipr_set_supported_devs(struct ipr_cmnd *ipr_cmd)
4146 ipr_cmd->job_step = ipr_ioa_reset_done; 4572 ipr_cmd->job_step = ipr_ioa_reset_done;
4147 4573
4148 list_for_each_entry_continue(res, &ioa_cfg->used_res_q, queue) { 4574 list_for_each_entry_continue(res, &ioa_cfg->used_res_q, queue) {
4149 if (!ipr_is_af_dasd_device(res)) 4575 if (!IPR_IS_DASD_DEVICE(res->cfgte.std_inq_data))
4150 continue; 4576 continue;
4151 4577
4152 ipr_cmd->u.res = res; 4578 ipr_cmd->u.res = res;
@@ -4179,6 +4605,36 @@ static int ipr_set_supported_devs(struct ipr_cmnd *ipr_cmd)
4179} 4605}
4180 4606
4181/** 4607/**
4608 * ipr_setup_write_cache - Disable write cache if needed
4609 * @ipr_cmd: ipr command struct
4610 *
4611 * This function sets up adapters write cache to desired setting
4612 *
4613 * Return value:
4614 * IPR_RC_JOB_CONTINUE / IPR_RC_JOB_RETURN
4615 **/
4616static int ipr_setup_write_cache(struct ipr_cmnd *ipr_cmd)
4617{
4618 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
4619
4620 ipr_cmd->job_step = ipr_set_supported_devs;
4621 ipr_cmd->u.res = list_entry(ioa_cfg->used_res_q.next,
4622 struct ipr_resource_entry, queue);
4623
4624 if (ioa_cfg->cache_state != CACHE_DISABLED)
4625 return IPR_RC_JOB_CONTINUE;
4626
4627 ipr_cmd->ioarcb.res_handle = cpu_to_be32(IPR_IOA_RES_HANDLE);
4628 ipr_cmd->ioarcb.cmd_pkt.request_type = IPR_RQTYPE_IOACMD;
4629 ipr_cmd->ioarcb.cmd_pkt.cdb[0] = IPR_IOA_SHUTDOWN;
4630 ipr_cmd->ioarcb.cmd_pkt.cdb[1] = IPR_SHUTDOWN_PREPARE_FOR_NORMAL;
4631
4632 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout, IPR_INTERNAL_TIMEOUT);
4633
4634 return IPR_RC_JOB_RETURN;
4635}
4636
4637/**
4182 * ipr_get_mode_page - Locate specified mode page 4638 * ipr_get_mode_page - Locate specified mode page
4183 * @mode_pages: mode page buffer 4639 * @mode_pages: mode page buffer
4184 * @page_code: page code to find 4640 * @page_code: page code to find
@@ -4389,10 +4845,7 @@ static int ipr_ioafp_mode_select_page28(struct ipr_cmnd *ipr_cmd)
4389 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, mode_pages), 4845 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, mode_pages),
4390 length); 4846 length);
4391 4847
4392 ipr_cmd->job_step = ipr_set_supported_devs; 4848 ipr_cmd->job_step = ipr_setup_write_cache;
4393 ipr_cmd->u.res = list_entry(ioa_cfg->used_res_q.next,
4394 struct ipr_resource_entry, queue);
4395
4396 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout, IPR_INTERNAL_TIMEOUT); 4849 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout, IPR_INTERNAL_TIMEOUT);
4397 4850
4398 LEAVE; 4851 LEAVE;
@@ -4431,6 +4884,51 @@ static void ipr_build_mode_sense(struct ipr_cmnd *ipr_cmd,
4431} 4884}
4432 4885
4433/** 4886/**
4887 * ipr_reset_cmd_failed - Handle failure of IOA reset command
4888 * @ipr_cmd: ipr command struct
4889 *
4890 * This function handles the failure of an IOA bringup command.
4891 *
4892 * Return value:
4893 * IPR_RC_JOB_RETURN
4894 **/
4895static int ipr_reset_cmd_failed(struct ipr_cmnd *ipr_cmd)
4896{
4897 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
4898 u32 ioasc = be32_to_cpu(ipr_cmd->ioasa.ioasc);
4899
4900 dev_err(&ioa_cfg->pdev->dev,
4901 "0x%02X failed with IOASC: 0x%08X\n",
4902 ipr_cmd->ioarcb.cmd_pkt.cdb[0], ioasc);
4903
4904 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NONE);
4905 list_add_tail(&ipr_cmd->queue, &ioa_cfg->free_q);
4906 return IPR_RC_JOB_RETURN;
4907}
4908
4909/**
4910 * ipr_reset_mode_sense_failed - Handle failure of IOAFP mode sense
4911 * @ipr_cmd: ipr command struct
4912 *
4913 * This function handles the failure of a Mode Sense to the IOAFP.
4914 * Some adapters do not handle all mode pages.
4915 *
4916 * Return value:
4917 * IPR_RC_JOB_CONTINUE / IPR_RC_JOB_RETURN
4918 **/
4919static int ipr_reset_mode_sense_failed(struct ipr_cmnd *ipr_cmd)
4920{
4921 u32 ioasc = be32_to_cpu(ipr_cmd->ioasa.ioasc);
4922
4923 if (ioasc == IPR_IOASC_IR_INVALID_REQ_TYPE_OR_PKT) {
4924 ipr_cmd->job_step = ipr_setup_write_cache;
4925 return IPR_RC_JOB_CONTINUE;
4926 }
4927
4928 return ipr_reset_cmd_failed(ipr_cmd);
4929}
4930
4931/**
4434 * ipr_ioafp_mode_sense_page28 - Issue Mode Sense Page 28 to IOA 4932 * ipr_ioafp_mode_sense_page28 - Issue Mode Sense Page 28 to IOA
4435 * @ipr_cmd: ipr command struct 4933 * @ipr_cmd: ipr command struct
4436 * 4934 *
@@ -4451,6 +4949,7 @@ static int ipr_ioafp_mode_sense_page28(struct ipr_cmnd *ipr_cmd)
4451 sizeof(struct ipr_mode_pages)); 4949 sizeof(struct ipr_mode_pages));
4452 4950
4453 ipr_cmd->job_step = ipr_ioafp_mode_select_page28; 4951 ipr_cmd->job_step = ipr_ioafp_mode_select_page28;
4952 ipr_cmd->job_step_failed = ipr_reset_mode_sense_failed;
4454 4953
4455 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout, IPR_INTERNAL_TIMEOUT); 4954 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout, IPR_INTERNAL_TIMEOUT);
4456 4955
@@ -4612,6 +5111,27 @@ static void ipr_ioafp_inquiry(struct ipr_cmnd *ipr_cmd, u8 flags, u8 page,
4612} 5111}
4613 5112
4614/** 5113/**
5114 * ipr_inquiry_page_supported - Is the given inquiry page supported
5115 * @page0: inquiry page 0 buffer
5116 * @page: page code.
5117 *
5118 * This function determines if the specified inquiry page is supported.
5119 *
5120 * Return value:
5121 * 1 if page is supported / 0 if not
5122 **/
5123static int ipr_inquiry_page_supported(struct ipr_inquiry_page0 *page0, u8 page)
5124{
5125 int i;
5126
5127 for (i = 0; i < min_t(u8, page0->len, IPR_INQUIRY_PAGE0_ENTRIES); i++)
5128 if (page0->page[i] == page)
5129 return 1;
5130
5131 return 0;
5132}
5133
5134/**
4615 * ipr_ioafp_page3_inquiry - Send a Page 3 Inquiry to the adapter. 5135 * ipr_ioafp_page3_inquiry - Send a Page 3 Inquiry to the adapter.
4616 * @ipr_cmd: ipr command struct 5136 * @ipr_cmd: ipr command struct
4617 * 5137 *
@@ -4624,6 +5144,36 @@ static void ipr_ioafp_inquiry(struct ipr_cmnd *ipr_cmd, u8 flags, u8 page,
4624static int ipr_ioafp_page3_inquiry(struct ipr_cmnd *ipr_cmd) 5144static int ipr_ioafp_page3_inquiry(struct ipr_cmnd *ipr_cmd)
4625{ 5145{
4626 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; 5146 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
5147 struct ipr_inquiry_page0 *page0 = &ioa_cfg->vpd_cbs->page0_data;
5148
5149 ENTER;
5150
5151 if (!ipr_inquiry_page_supported(page0, 1))
5152 ioa_cfg->cache_state = CACHE_NONE;
5153
5154 ipr_cmd->job_step = ipr_ioafp_query_ioa_cfg;
5155
5156 ipr_ioafp_inquiry(ipr_cmd, 1, 3,
5157 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, page3_data),
5158 sizeof(struct ipr_inquiry_page3));
5159
5160 LEAVE;
5161 return IPR_RC_JOB_RETURN;
5162}
5163
5164/**
5165 * ipr_ioafp_page0_inquiry - Send a Page 0 Inquiry to the adapter.
5166 * @ipr_cmd: ipr command struct
5167 *
5168 * This function sends a Page 0 inquiry to the adapter
5169 * to retrieve supported inquiry pages.
5170 *
5171 * Return value:
5172 * IPR_RC_JOB_CONTINUE / IPR_RC_JOB_RETURN
5173 **/
5174static int ipr_ioafp_page0_inquiry(struct ipr_cmnd *ipr_cmd)
5175{
5176 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
4627 char type[5]; 5177 char type[5];
4628 5178
4629 ENTER; 5179 ENTER;
@@ -4633,11 +5183,11 @@ static int ipr_ioafp_page3_inquiry(struct ipr_cmnd *ipr_cmd)
4633 type[4] = '\0'; 5183 type[4] = '\0';
4634 ioa_cfg->type = simple_strtoul((char *)type, NULL, 16); 5184 ioa_cfg->type = simple_strtoul((char *)type, NULL, 16);
4635 5185
4636 ipr_cmd->job_step = ipr_ioafp_query_ioa_cfg; 5186 ipr_cmd->job_step = ipr_ioafp_page3_inquiry;
4637 5187
4638 ipr_ioafp_inquiry(ipr_cmd, 1, 3, 5188 ipr_ioafp_inquiry(ipr_cmd, 1, 0,
4639 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, page3_data), 5189 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, page0_data),
4640 sizeof(struct ipr_inquiry_page3)); 5190 sizeof(struct ipr_inquiry_page0));
4641 5191
4642 LEAVE; 5192 LEAVE;
4643 return IPR_RC_JOB_RETURN; 5193 return IPR_RC_JOB_RETURN;
@@ -4657,7 +5207,7 @@ static int ipr_ioafp_std_inquiry(struct ipr_cmnd *ipr_cmd)
4657 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; 5207 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
4658 5208
4659 ENTER; 5209 ENTER;
4660 ipr_cmd->job_step = ipr_ioafp_page3_inquiry; 5210 ipr_cmd->job_step = ipr_ioafp_page0_inquiry;
4661 5211
4662 ipr_ioafp_inquiry(ipr_cmd, 0, 0, 5212 ipr_ioafp_inquiry(ipr_cmd, 0, 0,
4663 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, ioa_vpd), 5213 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, ioa_vpd),
@@ -4815,7 +5365,7 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd)
4815 } 5365 }
4816 5366
4817 /* Enable destructive diagnostics on IOA */ 5367 /* Enable destructive diagnostics on IOA */
4818 writel(IPR_DOORBELL, ioa_cfg->regs.set_uproc_interrupt_reg); 5368 writel(ioa_cfg->doorbell, ioa_cfg->regs.set_uproc_interrupt_reg);
4819 5369
4820 writel(IPR_PCII_OPER_INTERRUPTS, ioa_cfg->regs.clr_interrupt_mask_reg); 5370 writel(IPR_PCII_OPER_INTERRUPTS, ioa_cfg->regs.clr_interrupt_mask_reg);
4821 int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg); 5371 int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg);
@@ -5147,12 +5697,7 @@ static int ipr_reset_ucode_download(struct ipr_cmnd *ipr_cmd)
5147 ipr_cmd->ioarcb.cmd_pkt.cdb[7] = (sglist->buffer_len & 0x00ff00) >> 8; 5697 ipr_cmd->ioarcb.cmd_pkt.cdb[7] = (sglist->buffer_len & 0x00ff00) >> 8;
5148 ipr_cmd->ioarcb.cmd_pkt.cdb[8] = sglist->buffer_len & 0x0000ff; 5698 ipr_cmd->ioarcb.cmd_pkt.cdb[8] = sglist->buffer_len & 0x0000ff;
5149 5699
5150 if (ipr_map_ucode_buffer(ipr_cmd, sglist, sglist->buffer_len)) { 5700 ipr_build_ucode_ioadl(ipr_cmd, sglist);
5151 dev_err(&ioa_cfg->pdev->dev,
5152 "Failed to map microcode download buffer\n");
5153 return IPR_RC_JOB_CONTINUE;
5154 }
5155
5156 ipr_cmd->job_step = ipr_reset_ucode_download_done; 5701 ipr_cmd->job_step = ipr_reset_ucode_download_done;
5157 5702
5158 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout, 5703 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout,
@@ -5217,7 +5762,6 @@ static int ipr_reset_shutdown_ioa(struct ipr_cmnd *ipr_cmd)
5217static void ipr_reset_ioa_job(struct ipr_cmnd *ipr_cmd) 5762static void ipr_reset_ioa_job(struct ipr_cmnd *ipr_cmd)
5218{ 5763{
5219 u32 rc, ioasc; 5764 u32 rc, ioasc;
5220 unsigned long scratch = ipr_cmd->u.scratch;
5221 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; 5765 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
5222 5766
5223 do { 5767 do {
@@ -5233,17 +5777,13 @@ static void ipr_reset_ioa_job(struct ipr_cmnd *ipr_cmd)
5233 } 5777 }
5234 5778
5235 if (IPR_IOASC_SENSE_KEY(ioasc)) { 5779 if (IPR_IOASC_SENSE_KEY(ioasc)) {
5236 dev_err(&ioa_cfg->pdev->dev, 5780 rc = ipr_cmd->job_step_failed(ipr_cmd);
5237 "0x%02X failed with IOASC: 0x%08X\n", 5781 if (rc == IPR_RC_JOB_RETURN)
5238 ipr_cmd->ioarcb.cmd_pkt.cdb[0], ioasc); 5782 return;
5239
5240 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NONE);
5241 list_add_tail(&ipr_cmd->queue, &ioa_cfg->free_q);
5242 return;
5243 } 5783 }
5244 5784
5245 ipr_reinit_ipr_cmnd(ipr_cmd); 5785 ipr_reinit_ipr_cmnd(ipr_cmd);
5246 ipr_cmd->u.scratch = scratch; 5786 ipr_cmd->job_step_failed = ipr_reset_cmd_failed;
5247 rc = ipr_cmd->job_step(ipr_cmd); 5787 rc = ipr_cmd->job_step(ipr_cmd);
5248 } while(rc == IPR_RC_JOB_CONTINUE); 5788 } while(rc == IPR_RC_JOB_CONTINUE);
5249} 5789}
@@ -5517,15 +6057,12 @@ static int __devinit ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
5517 int i, rc = -ENOMEM; 6057 int i, rc = -ENOMEM;
5518 6058
5519 ENTER; 6059 ENTER;
5520 ioa_cfg->res_entries = kmalloc(sizeof(struct ipr_resource_entry) * 6060 ioa_cfg->res_entries = kzalloc(sizeof(struct ipr_resource_entry) *
5521 IPR_MAX_PHYSICAL_DEVS, GFP_KERNEL); 6061 IPR_MAX_PHYSICAL_DEVS, GFP_KERNEL);
5522 6062
5523 if (!ioa_cfg->res_entries) 6063 if (!ioa_cfg->res_entries)
5524 goto out; 6064 goto out;
5525 6065
5526 memset(ioa_cfg->res_entries, 0,
5527 sizeof(struct ipr_resource_entry) * IPR_MAX_PHYSICAL_DEVS);
5528
5529 for (i = 0; i < IPR_MAX_PHYSICAL_DEVS; i++) 6066 for (i = 0; i < IPR_MAX_PHYSICAL_DEVS; i++)
5530 list_add_tail(&ioa_cfg->res_entries[i].queue, &ioa_cfg->free_res_q); 6067 list_add_tail(&ioa_cfg->res_entries[i].queue, &ioa_cfg->free_res_q);
5531 6068
@@ -5566,15 +6103,12 @@ static int __devinit ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
5566 list_add_tail(&ioa_cfg->hostrcb[i]->queue, &ioa_cfg->hostrcb_free_q); 6103 list_add_tail(&ioa_cfg->hostrcb[i]->queue, &ioa_cfg->hostrcb_free_q);
5567 } 6104 }
5568 6105
5569 ioa_cfg->trace = kmalloc(sizeof(struct ipr_trace_entry) * 6106 ioa_cfg->trace = kzalloc(sizeof(struct ipr_trace_entry) *
5570 IPR_NUM_TRACE_ENTRIES, GFP_KERNEL); 6107 IPR_NUM_TRACE_ENTRIES, GFP_KERNEL);
5571 6108
5572 if (!ioa_cfg->trace) 6109 if (!ioa_cfg->trace)
5573 goto out_free_hostrcb_dma; 6110 goto out_free_hostrcb_dma;
5574 6111
5575 memset(ioa_cfg->trace, 0,
5576 sizeof(struct ipr_trace_entry) * IPR_NUM_TRACE_ENTRIES);
5577
5578 rc = 0; 6112 rc = 0;
5579out: 6113out:
5580 LEAVE; 6114 LEAVE;
@@ -5642,6 +6176,9 @@ static void __devinit ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg,
5642 ioa_cfg->host = host; 6176 ioa_cfg->host = host;
5643 ioa_cfg->pdev = pdev; 6177 ioa_cfg->pdev = pdev;
5644 ioa_cfg->log_level = ipr_log_level; 6178 ioa_cfg->log_level = ipr_log_level;
6179 ioa_cfg->doorbell = IPR_DOORBELL;
6180 if (!ipr_auto_create)
6181 ioa_cfg->doorbell |= IPR_RUNTIME_RESET;
5645 sprintf(ioa_cfg->eye_catcher, IPR_EYECATCHER); 6182 sprintf(ioa_cfg->eye_catcher, IPR_EYECATCHER);
5646 sprintf(ioa_cfg->trace_start, IPR_TRACE_START_LABEL); 6183 sprintf(ioa_cfg->trace_start, IPR_TRACE_START_LABEL);
5647 sprintf(ioa_cfg->ipr_free_label, IPR_FREEQ_LABEL); 6184 sprintf(ioa_cfg->ipr_free_label, IPR_FREEQ_LABEL);
@@ -5660,6 +6197,10 @@ static void __devinit ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg,
5660 INIT_WORK(&ioa_cfg->work_q, ipr_worker_thread, ioa_cfg); 6197 INIT_WORK(&ioa_cfg->work_q, ipr_worker_thread, ioa_cfg);
5661 init_waitqueue_head(&ioa_cfg->reset_wait_q); 6198 init_waitqueue_head(&ioa_cfg->reset_wait_q);
5662 ioa_cfg->sdt_state = INACTIVE; 6199 ioa_cfg->sdt_state = INACTIVE;
6200 if (ipr_enable_cache)
6201 ioa_cfg->cache_state = CACHE_ENABLED;
6202 else
6203 ioa_cfg->cache_state = CACHE_DISABLED;
5663 6204
5664 ipr_initialize_bus_attr(ioa_cfg); 6205 ipr_initialize_bus_attr(ioa_cfg);
5665 6206
@@ -6008,6 +6549,7 @@ static int __devinit ipr_probe(struct pci_dev *pdev,
6008 ipr_scan_vsets(ioa_cfg); 6549 ipr_scan_vsets(ioa_cfg);
6009 scsi_add_device(ioa_cfg->host, IPR_IOA_BUS, IPR_IOA_TARGET, IPR_IOA_LUN); 6550 scsi_add_device(ioa_cfg->host, IPR_IOA_BUS, IPR_IOA_TARGET, IPR_IOA_LUN);
6010 ioa_cfg->allow_ml_add_del = 1; 6551 ioa_cfg->allow_ml_add_del = 1;
6552 ioa_cfg->host->max_channel = IPR_VSET_BUS;
6011 schedule_work(&ioa_cfg->work_q); 6553 schedule_work(&ioa_cfg->work_q);
6012 return 0; 6554 return 0;
6013} 6555}
@@ -6055,12 +6597,30 @@ static struct pci_device_id ipr_pci_table[] __devinitdata = {
6055 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, 6597 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE,
6056 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571A, 6598 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571A,
6057 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, 6599 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] },
6600 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE,
6601 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575B,
6602 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] },
6603 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN,
6604 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A,
6605 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] },
6606 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN,
6607 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B,
6608 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] },
6609 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN,
6610 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A,
6611 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] },
6612 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN,
6613 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B,
6614 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] },
6058 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE, 6615 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE,
6059 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_2780, 6616 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_2780,
6060 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] }, 6617 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] },
6061 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, 6618 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP,
6062 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571E, 6619 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571E,
6063 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] }, 6620 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] },
6621 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP,
6622 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571F,
6623 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] },
6064 { } 6624 { }
6065}; 6625};
6066MODULE_DEVICE_TABLE(pci, ipr_pci_table); 6626MODULE_DEVICE_TABLE(pci, ipr_pci_table);
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 8cf967108500..6bec673c925c 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -36,23 +36,8 @@
36/* 36/*
37 * Literals 37 * Literals
38 */ 38 */
39#define IPR_DRIVER_VERSION "2.0.14" 39#define IPR_DRIVER_VERSION "2.1.0"
40#define IPR_DRIVER_DATE "(May 2, 2005)" 40#define IPR_DRIVER_DATE "(October 31, 2005)"
41
42/*
43 * IPR_DBG_TRACE: Setting this to 1 will turn on some general function tracing
44 * resulting in a bunch of extra debugging printks to the console
45 *
46 * IPR_DEBUG: Setting this to 1 will turn on some error path tracing.
47 * Enables the ipr_trace macro.
48 */
49#ifdef IPR_DEBUG_ALL
50#define IPR_DEBUG 1
51#define IPR_DBG_TRACE 1
52#else
53#define IPR_DEBUG 0
54#define IPR_DBG_TRACE 0
55#endif
56 41
57/* 42/*
58 * IPR_MAX_CMD_PER_LUN: This defines the maximum number of outstanding 43 * IPR_MAX_CMD_PER_LUN: This defines the maximum number of outstanding
@@ -76,6 +61,10 @@
76#define IPR_SUBS_DEV_ID_571A 0x02C0 61#define IPR_SUBS_DEV_ID_571A 0x02C0
77#define IPR_SUBS_DEV_ID_571B 0x02BE 62#define IPR_SUBS_DEV_ID_571B 0x02BE
78#define IPR_SUBS_DEV_ID_571E 0x02BF 63#define IPR_SUBS_DEV_ID_571E 0x02BF
64#define IPR_SUBS_DEV_ID_571F 0x02D5
65#define IPR_SUBS_DEV_ID_572A 0x02C1
66#define IPR_SUBS_DEV_ID_572B 0x02C2
67#define IPR_SUBS_DEV_ID_575B 0x030D
79 68
80#define IPR_NAME "ipr" 69#define IPR_NAME "ipr"
81 70
@@ -95,7 +84,10 @@
95#define IPR_IOASC_HW_DEV_BUS_STATUS 0x04448500 84#define IPR_IOASC_HW_DEV_BUS_STATUS 0x04448500
96#define IPR_IOASC_IOASC_MASK 0xFFFFFF00 85#define IPR_IOASC_IOASC_MASK 0xFFFFFF00
97#define IPR_IOASC_SCSI_STATUS_MASK 0x000000FF 86#define IPR_IOASC_SCSI_STATUS_MASK 0x000000FF
87#define IPR_IOASC_IR_INVALID_REQ_TYPE_OR_PKT 0x05240000
98#define IPR_IOASC_IR_RESOURCE_HANDLE 0x05250000 88#define IPR_IOASC_IR_RESOURCE_HANDLE 0x05250000
89#define IPR_IOASC_IR_NO_CMDS_TO_2ND_IOA 0x05258100
90#define IPR_IOASA_IR_DUAL_IOA_DISABLED 0x052C8000
99#define IPR_IOASC_BUS_WAS_RESET 0x06290000 91#define IPR_IOASC_BUS_WAS_RESET 0x06290000
100#define IPR_IOASC_BUS_WAS_RESET_BY_OTHER 0x06298000 92#define IPR_IOASC_BUS_WAS_RESET_BY_OTHER 0x06298000
101#define IPR_IOASC_ABORTED_CMD_TERM_BY_HOST 0x0B5A0000 93#define IPR_IOASC_ABORTED_CMD_TERM_BY_HOST 0x0B5A0000
@@ -107,14 +99,14 @@
107#define IPR_NUM_LOG_HCAMS 2 99#define IPR_NUM_LOG_HCAMS 2
108#define IPR_NUM_CFG_CHG_HCAMS 2 100#define IPR_NUM_CFG_CHG_HCAMS 2
109#define IPR_NUM_HCAMS (IPR_NUM_LOG_HCAMS + IPR_NUM_CFG_CHG_HCAMS) 101#define IPR_NUM_HCAMS (IPR_NUM_LOG_HCAMS + IPR_NUM_CFG_CHG_HCAMS)
110#define IPR_MAX_NUM_TARGETS_PER_BUS 0x10 102#define IPR_MAX_NUM_TARGETS_PER_BUS 256
111#define IPR_MAX_NUM_LUNS_PER_TARGET 256 103#define IPR_MAX_NUM_LUNS_PER_TARGET 256
112#define IPR_MAX_NUM_VSET_LUNS_PER_TARGET 8 104#define IPR_MAX_NUM_VSET_LUNS_PER_TARGET 8
113#define IPR_VSET_BUS 0xff 105#define IPR_VSET_BUS 0xff
114#define IPR_IOA_BUS 0xff 106#define IPR_IOA_BUS 0xff
115#define IPR_IOA_TARGET 0xff 107#define IPR_IOA_TARGET 0xff
116#define IPR_IOA_LUN 0xff 108#define IPR_IOA_LUN 0xff
117#define IPR_MAX_NUM_BUSES 4 109#define IPR_MAX_NUM_BUSES 8
118#define IPR_MAX_BUS_TO_SCAN IPR_MAX_NUM_BUSES 110#define IPR_MAX_BUS_TO_SCAN IPR_MAX_NUM_BUSES
119 111
120#define IPR_NUM_RESET_RELOAD_RETRIES 3 112#define IPR_NUM_RESET_RELOAD_RETRIES 3
@@ -205,6 +197,7 @@
205#define IPR_SDT_FMT2_EXP_ROM_SEL 0x8 197#define IPR_SDT_FMT2_EXP_ROM_SEL 0x8
206#define IPR_FMT2_SDT_READY_TO_USE 0xC4D4E3F2 198#define IPR_FMT2_SDT_READY_TO_USE 0xC4D4E3F2
207#define IPR_DOORBELL 0x82800000 199#define IPR_DOORBELL 0x82800000
200#define IPR_RUNTIME_RESET 0x40000000
208 201
209#define IPR_PCII_IOA_TRANS_TO_OPER (0x80000000 >> 0) 202#define IPR_PCII_IOA_TRANS_TO_OPER (0x80000000 >> 0)
210#define IPR_PCII_IOARCB_XFER_FAILED (0x80000000 >> 3) 203#define IPR_PCII_IOARCB_XFER_FAILED (0x80000000 >> 3)
@@ -261,6 +254,16 @@ struct ipr_std_inq_vpids {
261 u8 product_id[IPR_PROD_ID_LEN]; 254 u8 product_id[IPR_PROD_ID_LEN];
262}__attribute__((packed)); 255}__attribute__((packed));
263 256
257struct ipr_vpd {
258 struct ipr_std_inq_vpids vpids;
259 u8 sn[IPR_SERIAL_NUM_LEN];
260}__attribute__((packed));
261
262struct ipr_ext_vpd {
263 struct ipr_vpd vpd;
264 __be32 wwid[2];
265}__attribute__((packed));
266
264struct ipr_std_inq_data { 267struct ipr_std_inq_data {
265 u8 peri_qual_dev_type; 268 u8 peri_qual_dev_type;
266#define IPR_STD_INQ_PERI_QUAL(peri) ((peri) >> 5) 269#define IPR_STD_INQ_PERI_QUAL(peri) ((peri) >> 5)
@@ -304,6 +307,10 @@ struct ipr_config_table_entry {
304#define IPR_SUBTYPE_GENERIC_SCSI 1 307#define IPR_SUBTYPE_GENERIC_SCSI 1
305#define IPR_SUBTYPE_VOLUME_SET 2 308#define IPR_SUBTYPE_VOLUME_SET 2
306 309
310#define IPR_QUEUEING_MODEL(res) ((((res)->cfgte.flags) & 0x70) >> 4)
311#define IPR_QUEUE_FROZEN_MODEL 0
312#define IPR_QUEUE_NACA_MODEL 1
313
307 struct ipr_res_addr res_addr; 314 struct ipr_res_addr res_addr;
308 __be32 res_handle; 315 __be32 res_handle;
309 __be32 reserved4[2]; 316 __be32 reserved4[2];
@@ -410,23 +417,26 @@ struct ipr_ioadl_desc {
410struct ipr_ioasa_vset { 417struct ipr_ioasa_vset {
411 __be32 failing_lba_hi; 418 __be32 failing_lba_hi;
412 __be32 failing_lba_lo; 419 __be32 failing_lba_lo;
413 __be32 ioa_data[22]; 420 __be32 reserved;
414}__attribute__((packed, aligned (4))); 421}__attribute__((packed, aligned (4)));
415 422
416struct ipr_ioasa_af_dasd { 423struct ipr_ioasa_af_dasd {
417 __be32 failing_lba; 424 __be32 failing_lba;
425 __be32 reserved[2];
418}__attribute__((packed, aligned (4))); 426}__attribute__((packed, aligned (4)));
419 427
420struct ipr_ioasa_gpdd { 428struct ipr_ioasa_gpdd {
421 u8 end_state; 429 u8 end_state;
422 u8 bus_phase; 430 u8 bus_phase;
423 __be16 reserved; 431 __be16 reserved;
424 __be32 ioa_data[23]; 432 __be32 ioa_data[2];
425}__attribute__((packed, aligned (4))); 433}__attribute__((packed, aligned (4)));
426 434
427struct ipr_ioasa_raw { 435struct ipr_auto_sense {
428 __be32 ioa_data[24]; 436 __be16 auto_sense_len;
429}__attribute__((packed, aligned (4))); 437 __be16 ioa_data_len;
438 __be32 data[SCSI_SENSE_BUFFERSIZE/sizeof(__be32)];
439};
430 440
431struct ipr_ioasa { 441struct ipr_ioasa {
432 __be32 ioasc; 442 __be32 ioasc;
@@ -453,6 +463,8 @@ struct ipr_ioasa {
453 __be32 fd_res_handle; 463 __be32 fd_res_handle;
454 464
455 __be32 ioasc_specific; /* status code specific field */ 465 __be32 ioasc_specific; /* status code specific field */
466#define IPR_ADDITIONAL_STATUS_FMT 0x80000000
467#define IPR_AUTOSENSE_VALID 0x40000000
456#define IPR_IOASC_SPECIFIC_MASK 0x00ffffff 468#define IPR_IOASC_SPECIFIC_MASK 0x00ffffff
457#define IPR_FIELD_POINTER_VALID (0x80000000 >> 8) 469#define IPR_FIELD_POINTER_VALID (0x80000000 >> 8)
458#define IPR_FIELD_POINTER_MASK 0x0000ffff 470#define IPR_FIELD_POINTER_MASK 0x0000ffff
@@ -461,8 +473,9 @@ struct ipr_ioasa {
461 struct ipr_ioasa_vset vset; 473 struct ipr_ioasa_vset vset;
462 struct ipr_ioasa_af_dasd dasd; 474 struct ipr_ioasa_af_dasd dasd;
463 struct ipr_ioasa_gpdd gpdd; 475 struct ipr_ioasa_gpdd gpdd;
464 struct ipr_ioasa_raw raw;
465 } u; 476 } u;
477
478 struct ipr_auto_sense auto_sense;
466}__attribute__((packed, aligned (4))); 479}__attribute__((packed, aligned (4)));
467 480
468struct ipr_mode_parm_hdr { 481struct ipr_mode_parm_hdr {
@@ -536,28 +549,49 @@ struct ipr_inquiry_page3 {
536 u8 patch_number[4]; 549 u8 patch_number[4];
537}__attribute__((packed)); 550}__attribute__((packed));
538 551
552#define IPR_INQUIRY_PAGE0_ENTRIES 20
553struct ipr_inquiry_page0 {
554 u8 peri_qual_dev_type;
555 u8 page_code;
556 u8 reserved1;
557 u8 len;
558 u8 page[IPR_INQUIRY_PAGE0_ENTRIES];
559}__attribute__((packed));
560
539struct ipr_hostrcb_device_data_entry { 561struct ipr_hostrcb_device_data_entry {
540 struct ipr_std_inq_vpids dev_vpids; 562 struct ipr_vpd vpd;
541 u8 dev_sn[IPR_SERIAL_NUM_LEN];
542 struct ipr_res_addr dev_res_addr; 563 struct ipr_res_addr dev_res_addr;
543 struct ipr_std_inq_vpids new_dev_vpids; 564 struct ipr_vpd new_vpd;
544 u8 new_dev_sn[IPR_SERIAL_NUM_LEN]; 565 struct ipr_vpd ioa_last_with_dev_vpd;
545 struct ipr_std_inq_vpids ioa_last_with_dev_vpids; 566 struct ipr_vpd cfc_last_with_dev_vpd;
546 u8 ioa_last_with_dev_sn[IPR_SERIAL_NUM_LEN];
547 struct ipr_std_inq_vpids cfc_last_with_dev_vpids;
548 u8 cfc_last_with_dev_sn[IPR_SERIAL_NUM_LEN];
549 __be32 ioa_data[5]; 567 __be32 ioa_data[5];
550}__attribute__((packed, aligned (4))); 568}__attribute__((packed, aligned (4)));
551 569
570struct ipr_hostrcb_device_data_entry_enhanced {
571 struct ipr_ext_vpd vpd;
572 u8 ccin[4];
573 struct ipr_res_addr dev_res_addr;
574 struct ipr_ext_vpd new_vpd;
575 u8 new_ccin[4];
576 struct ipr_ext_vpd ioa_last_with_dev_vpd;
577 struct ipr_ext_vpd cfc_last_with_dev_vpd;
578}__attribute__((packed, aligned (4)));
579
552struct ipr_hostrcb_array_data_entry { 580struct ipr_hostrcb_array_data_entry {
553 struct ipr_std_inq_vpids vpids; 581 struct ipr_vpd vpd;
554 u8 serial_num[IPR_SERIAL_NUM_LEN]; 582 struct ipr_res_addr expected_dev_res_addr;
583 struct ipr_res_addr dev_res_addr;
584}__attribute__((packed, aligned (4)));
585
586struct ipr_hostrcb_array_data_entry_enhanced {
587 struct ipr_ext_vpd vpd;
588 u8 ccin[4];
555 struct ipr_res_addr expected_dev_res_addr; 589 struct ipr_res_addr expected_dev_res_addr;
556 struct ipr_res_addr dev_res_addr; 590 struct ipr_res_addr dev_res_addr;
557}__attribute__((packed, aligned (4))); 591}__attribute__((packed, aligned (4)));
558 592
559struct ipr_hostrcb_type_ff_error { 593struct ipr_hostrcb_type_ff_error {
560 __be32 ioa_data[246]; 594 __be32 ioa_data[502];
561}__attribute__((packed, aligned (4))); 595}__attribute__((packed, aligned (4)));
562 596
563struct ipr_hostrcb_type_01_error { 597struct ipr_hostrcb_type_01_error {
@@ -568,47 +602,75 @@ struct ipr_hostrcb_type_01_error {
568}__attribute__((packed, aligned (4))); 602}__attribute__((packed, aligned (4)));
569 603
570struct ipr_hostrcb_type_02_error { 604struct ipr_hostrcb_type_02_error {
571 struct ipr_std_inq_vpids ioa_vpids; 605 struct ipr_vpd ioa_vpd;
572 u8 ioa_sn[IPR_SERIAL_NUM_LEN]; 606 struct ipr_vpd cfc_vpd;
573 struct ipr_std_inq_vpids cfc_vpids; 607 struct ipr_vpd ioa_last_attached_to_cfc_vpd;
574 u8 cfc_sn[IPR_SERIAL_NUM_LEN]; 608 struct ipr_vpd cfc_last_attached_to_ioa_vpd;
575 struct ipr_std_inq_vpids ioa_last_attached_to_cfc_vpids; 609 __be32 ioa_data[3];
576 u8 ioa_last_attached_to_cfc_sn[IPR_SERIAL_NUM_LEN]; 610}__attribute__((packed, aligned (4)));
577 struct ipr_std_inq_vpids cfc_last_attached_to_ioa_vpids; 611
578 u8 cfc_last_attached_to_ioa_sn[IPR_SERIAL_NUM_LEN]; 612struct ipr_hostrcb_type_12_error {
613 struct ipr_ext_vpd ioa_vpd;
614 struct ipr_ext_vpd cfc_vpd;
615 struct ipr_ext_vpd ioa_last_attached_to_cfc_vpd;
616 struct ipr_ext_vpd cfc_last_attached_to_ioa_vpd;
579 __be32 ioa_data[3]; 617 __be32 ioa_data[3];
580 u8 reserved[844];
581}__attribute__((packed, aligned (4))); 618}__attribute__((packed, aligned (4)));
582 619
583struct ipr_hostrcb_type_03_error { 620struct ipr_hostrcb_type_03_error {
584 struct ipr_std_inq_vpids ioa_vpids; 621 struct ipr_vpd ioa_vpd;
585 u8 ioa_sn[IPR_SERIAL_NUM_LEN]; 622 struct ipr_vpd cfc_vpd;
586 struct ipr_std_inq_vpids cfc_vpids;
587 u8 cfc_sn[IPR_SERIAL_NUM_LEN];
588 __be32 errors_detected; 623 __be32 errors_detected;
589 __be32 errors_logged; 624 __be32 errors_logged;
590 u8 ioa_data[12]; 625 u8 ioa_data[12];
591 struct ipr_hostrcb_device_data_entry dev_entry[3]; 626 struct ipr_hostrcb_device_data_entry dev[3];
592 u8 reserved[444]; 627}__attribute__((packed, aligned (4)));
628
629struct ipr_hostrcb_type_13_error {
630 struct ipr_ext_vpd ioa_vpd;
631 struct ipr_ext_vpd cfc_vpd;
632 __be32 errors_detected;
633 __be32 errors_logged;
634 struct ipr_hostrcb_device_data_entry_enhanced dev[3];
593}__attribute__((packed, aligned (4))); 635}__attribute__((packed, aligned (4)));
594 636
595struct ipr_hostrcb_type_04_error { 637struct ipr_hostrcb_type_04_error {
596 struct ipr_std_inq_vpids ioa_vpids; 638 struct ipr_vpd ioa_vpd;
597 u8 ioa_sn[IPR_SERIAL_NUM_LEN]; 639 struct ipr_vpd cfc_vpd;
598 struct ipr_std_inq_vpids cfc_vpids;
599 u8 cfc_sn[IPR_SERIAL_NUM_LEN];
600 u8 ioa_data[12]; 640 u8 ioa_data[12];
601 struct ipr_hostrcb_array_data_entry array_member[10]; 641 struct ipr_hostrcb_array_data_entry array_member[10];
602 __be32 exposed_mode_adn; 642 __be32 exposed_mode_adn;
603 __be32 array_id; 643 __be32 array_id;
604 struct ipr_std_inq_vpids incomp_dev_vpids; 644 struct ipr_vpd incomp_dev_vpd;
605 u8 incomp_dev_sn[IPR_SERIAL_NUM_LEN];
606 __be32 ioa_data2; 645 __be32 ioa_data2;
607 struct ipr_hostrcb_array_data_entry array_member2[8]; 646 struct ipr_hostrcb_array_data_entry array_member2[8];
608 struct ipr_res_addr last_func_vset_res_addr; 647 struct ipr_res_addr last_func_vset_res_addr;
609 u8 vset_serial_num[IPR_SERIAL_NUM_LEN]; 648 u8 vset_serial_num[IPR_SERIAL_NUM_LEN];
610 u8 protection_level[8]; 649 u8 protection_level[8];
611 u8 reserved[124]; 650}__attribute__((packed, aligned (4)));
651
652struct ipr_hostrcb_type_14_error {
653 struct ipr_ext_vpd ioa_vpd;
654 struct ipr_ext_vpd cfc_vpd;
655 __be32 exposed_mode_adn;
656 __be32 array_id;
657 struct ipr_res_addr last_func_vset_res_addr;
658 u8 vset_serial_num[IPR_SERIAL_NUM_LEN];
659 u8 protection_level[8];
660 __be32 num_entries;
661 struct ipr_hostrcb_array_data_entry_enhanced array_member[18];
662}__attribute__((packed, aligned (4)));
663
664struct ipr_hostrcb_type_07_error {
665 u8 failure_reason[64];
666 struct ipr_vpd vpd;
667 u32 data[222];
668}__attribute__((packed, aligned (4)));
669
670struct ipr_hostrcb_type_17_error {
671 u8 failure_reason[64];
672 struct ipr_ext_vpd vpd;
673 u32 data[476];
612}__attribute__((packed, aligned (4))); 674}__attribute__((packed, aligned (4)));
613 675
614struct ipr_hostrcb_error { 676struct ipr_hostrcb_error {
@@ -622,6 +684,11 @@ struct ipr_hostrcb_error {
622 struct ipr_hostrcb_type_02_error type_02_error; 684 struct ipr_hostrcb_type_02_error type_02_error;
623 struct ipr_hostrcb_type_03_error type_03_error; 685 struct ipr_hostrcb_type_03_error type_03_error;
624 struct ipr_hostrcb_type_04_error type_04_error; 686 struct ipr_hostrcb_type_04_error type_04_error;
687 struct ipr_hostrcb_type_07_error type_07_error;
688 struct ipr_hostrcb_type_12_error type_12_error;
689 struct ipr_hostrcb_type_13_error type_13_error;
690 struct ipr_hostrcb_type_14_error type_14_error;
691 struct ipr_hostrcb_type_17_error type_17_error;
625 } u; 692 } u;
626}__attribute__((packed, aligned (4))); 693}__attribute__((packed, aligned (4)));
627 694
@@ -655,6 +722,12 @@ struct ipr_hcam {
655#define IPR_HOST_RCB_OVERLAY_ID_3 0x03 722#define IPR_HOST_RCB_OVERLAY_ID_3 0x03
656#define IPR_HOST_RCB_OVERLAY_ID_4 0x04 723#define IPR_HOST_RCB_OVERLAY_ID_4 0x04
657#define IPR_HOST_RCB_OVERLAY_ID_6 0x06 724#define IPR_HOST_RCB_OVERLAY_ID_6 0x06
725#define IPR_HOST_RCB_OVERLAY_ID_7 0x07
726#define IPR_HOST_RCB_OVERLAY_ID_12 0x12
727#define IPR_HOST_RCB_OVERLAY_ID_13 0x13
728#define IPR_HOST_RCB_OVERLAY_ID_14 0x14
729#define IPR_HOST_RCB_OVERLAY_ID_16 0x16
730#define IPR_HOST_RCB_OVERLAY_ID_17 0x17
658#define IPR_HOST_RCB_OVERLAY_ID_DEFAULT 0xFF 731#define IPR_HOST_RCB_OVERLAY_ID_DEFAULT 0xFF
659 732
660 u8 reserved1[3]; 733 u8 reserved1[3];
@@ -743,6 +816,7 @@ struct ipr_resource_table {
743 816
744struct ipr_misc_cbs { 817struct ipr_misc_cbs {
745 struct ipr_ioa_vpd ioa_vpd; 818 struct ipr_ioa_vpd ioa_vpd;
819 struct ipr_inquiry_page0 page0_data;
746 struct ipr_inquiry_page3 page3_data; 820 struct ipr_inquiry_page3 page3_data;
747 struct ipr_mode_pages mode_pages; 821 struct ipr_mode_pages mode_pages;
748 struct ipr_supported_device supp_dev; 822 struct ipr_supported_device supp_dev;
@@ -813,6 +887,7 @@ struct ipr_trace_entry {
813struct ipr_sglist { 887struct ipr_sglist {
814 u32 order; 888 u32 order;
815 u32 num_sg; 889 u32 num_sg;
890 u32 num_dma_sg;
816 u32 buffer_len; 891 u32 buffer_len;
817 struct scatterlist scatterlist[1]; 892 struct scatterlist scatterlist[1];
818}; 893};
@@ -825,6 +900,13 @@ enum ipr_sdt_state {
825 DUMP_OBTAINED 900 DUMP_OBTAINED
826}; 901};
827 902
903enum ipr_cache_state {
904 CACHE_NONE,
905 CACHE_DISABLED,
906 CACHE_ENABLED,
907 CACHE_INVALID
908};
909
828/* Per-controller data */ 910/* Per-controller data */
829struct ipr_ioa_cfg { 911struct ipr_ioa_cfg {
830 char eye_catcher[8]; 912 char eye_catcher[8];
@@ -841,6 +923,7 @@ struct ipr_ioa_cfg {
841 u8 allow_cmds:1; 923 u8 allow_cmds:1;
842 u8 allow_ml_add_del:1; 924 u8 allow_ml_add_del:1;
843 925
926 enum ipr_cache_state cache_state;
844 u16 type; /* CCIN of the card */ 927 u16 type; /* CCIN of the card */
845 928
846 u8 log_level; 929 u8 log_level;
@@ -911,6 +994,7 @@ struct ipr_ioa_cfg {
911 u16 reset_retries; 994 u16 reset_retries;
912 995
913 u32 errors_logged; 996 u32 errors_logged;
997 u32 doorbell;
914 998
915 struct Scsi_Host *host; 999 struct Scsi_Host *host;
916 struct pci_dev *pdev; 1000 struct pci_dev *pdev;
@@ -948,6 +1032,7 @@ struct ipr_cmnd {
948 struct timer_list timer; 1032 struct timer_list timer;
949 void (*done) (struct ipr_cmnd *); 1033 void (*done) (struct ipr_cmnd *);
950 int (*job_step) (struct ipr_cmnd *); 1034 int (*job_step) (struct ipr_cmnd *);
1035 int (*job_step_failed) (struct ipr_cmnd *);
951 u16 cmd_index; 1036 u16 cmd_index;
952 u8 sense_buffer[SCSI_SENSE_BUFFERSIZE]; 1037 u8 sense_buffer[SCSI_SENSE_BUFFERSIZE];
953 dma_addr_t sense_buffer_dma; 1038 dma_addr_t sense_buffer_dma;
@@ -1083,11 +1168,7 @@ struct ipr_ucode_image_header {
1083/* 1168/*
1084 * Macros 1169 * Macros
1085 */ 1170 */
1086#if IPR_DEBUG 1171#define IPR_DBG_CMD(CMD) if (ipr_debug) { CMD; }
1087#define IPR_DBG_CMD(CMD) do { CMD; } while (0)
1088#else
1089#define IPR_DBG_CMD(CMD)
1090#endif
1091 1172
1092#ifdef CONFIG_SCSI_IPR_TRACE 1173#ifdef CONFIG_SCSI_IPR_TRACE
1093#define ipr_create_trace_file(kobj, attr) sysfs_create_bin_file(kobj, attr) 1174#define ipr_create_trace_file(kobj, attr) sysfs_create_bin_file(kobj, attr)
@@ -1135,16 +1216,22 @@ struct ipr_ucode_image_header {
1135#define ipr_res_dbg(ioa_cfg, res, fmt, ...) \ 1216#define ipr_res_dbg(ioa_cfg, res, fmt, ...) \
1136 IPR_DBG_CMD(ipr_res_printk(KERN_INFO, ioa_cfg, res, fmt, ##__VA_ARGS__)) 1217 IPR_DBG_CMD(ipr_res_printk(KERN_INFO, ioa_cfg, res, fmt, ##__VA_ARGS__))
1137 1218
1219#define ipr_phys_res_err(ioa_cfg, res, fmt, ...) \
1220{ \
1221 if ((res).bus >= IPR_MAX_NUM_BUSES) { \
1222 ipr_err(fmt": unknown\n", ##__VA_ARGS__); \
1223 } else { \
1224 ipr_err(fmt": %d:%d:%d:%d\n", \
1225 ##__VA_ARGS__, (ioa_cfg)->host->host_no, \
1226 (res).bus, (res).target, (res).lun); \
1227 } \
1228}
1229
1138#define ipr_trace ipr_dbg("%s: %s: Line: %d\n",\ 1230#define ipr_trace ipr_dbg("%s: %s: Line: %d\n",\
1139 __FILE__, __FUNCTION__, __LINE__) 1231 __FILE__, __FUNCTION__, __LINE__)
1140 1232
1141#if IPR_DBG_TRACE 1233#define ENTER IPR_DBG_CMD(printk(KERN_INFO IPR_NAME": Entering %s\n", __FUNCTION__))
1142#define ENTER printk(KERN_INFO IPR_NAME": Entering %s\n", __FUNCTION__) 1234#define LEAVE IPR_DBG_CMD(printk(KERN_INFO IPR_NAME": Leaving %s\n", __FUNCTION__))
1143#define LEAVE printk(KERN_INFO IPR_NAME": Leaving %s\n", __FUNCTION__)
1144#else
1145#define ENTER
1146#define LEAVE
1147#endif
1148 1235
1149#define ipr_err_separator \ 1236#define ipr_err_separator \
1150ipr_err("----------------------------------------------------------\n") 1237ipr_err("----------------------------------------------------------\n")
@@ -1217,6 +1304,20 @@ static inline int ipr_is_gscsi(struct ipr_resource_entry *res)
1217} 1304}
1218 1305
1219/** 1306/**
1307 * ipr_is_naca_model - Determine if a resource is using NACA queueing model
1308 * @res: resource entry struct
1309 *
1310 * Return value:
1311 * 1 if NACA queueing model / 0 if not NACA queueing model
1312 **/
1313static inline int ipr_is_naca_model(struct ipr_resource_entry *res)
1314{
1315 if (ipr_is_gscsi(res) && IPR_QUEUEING_MODEL(res) == IPR_QUEUE_NACA_MODEL)
1316 return 1;
1317 return 0;
1318}
1319
1320/**
1220 * ipr_is_device - Determine if resource address is that of a device 1321 * ipr_is_device - Determine if resource address is that of a device
1221 * @res_addr: resource address struct 1322 * @res_addr: resource address struct
1222 * 1323 *
@@ -1226,7 +1327,7 @@ static inline int ipr_is_gscsi(struct ipr_resource_entry *res)
1226static inline int ipr_is_device(struct ipr_res_addr *res_addr) 1327static inline int ipr_is_device(struct ipr_res_addr *res_addr)
1227{ 1328{
1228 if ((res_addr->bus < IPR_MAX_NUM_BUSES) && 1329 if ((res_addr->bus < IPR_MAX_NUM_BUSES) &&
1229 (res_addr->target < IPR_MAX_NUM_TARGETS_PER_BUS)) 1330 (res_addr->target < (IPR_MAX_NUM_TARGETS_PER_BUS - 1)))
1230 return 1; 1331 return 1;
1231 1332
1232 return 0; 1333 return 0;
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index cd9b95db5a7d..3882d48a42bf 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -139,6 +139,7 @@
139/* - Remove 3 unused "inline" functions */ 139/* - Remove 3 unused "inline" functions */
140/* 7.12.xx - Use STATIC functions whereever possible */ 140/* 7.12.xx - Use STATIC functions whereever possible */
141/* - Clean up deprecated MODULE_PARM calls */ 141/* - Clean up deprecated MODULE_PARM calls */
142/* 7.12.05 - Remove Version Matching per IBM request */
142/*****************************************************************************/ 143/*****************************************************************************/
143 144
144/* 145/*
@@ -210,7 +211,7 @@ module_param(ips, charp, 0);
210 * DRIVER_VER 211 * DRIVER_VER
211 */ 212 */
212#define IPS_VERSION_HIGH "7.12" 213#define IPS_VERSION_HIGH "7.12"
213#define IPS_VERSION_LOW ".02 " 214#define IPS_VERSION_LOW ".05 "
214 215
215#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__) 216#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__)
216#warning "This driver has only been tested on the x86/ia64/x86_64 platforms" 217#warning "This driver has only been tested on the x86/ia64/x86_64 platforms"
@@ -247,7 +248,7 @@ module_param(ips, charp, 0);
247/* 248/*
248 * Function prototypes 249 * Function prototypes
249 */ 250 */
250static int ips_detect(Scsi_Host_Template *); 251static int ips_detect(struct scsi_host_template *);
251static int ips_release(struct Scsi_Host *); 252static int ips_release(struct Scsi_Host *);
252static int ips_eh_abort(Scsi_Cmnd *); 253static int ips_eh_abort(Scsi_Cmnd *);
253static int ips_eh_reset(Scsi_Cmnd *); 254static int ips_eh_reset(Scsi_Cmnd *);
@@ -347,8 +348,6 @@ static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
347static int ips_host_info(ips_ha_t *, char *, off_t, int); 348static int ips_host_info(ips_ha_t *, char *, off_t, int);
348static void copy_mem_info(IPS_INFOSTR *, char *, int); 349static void copy_mem_info(IPS_INFOSTR *, char *, int);
349static int copy_info(IPS_INFOSTR *, char *, ...); 350static int copy_info(IPS_INFOSTR *, char *, ...);
350static int ips_get_version_info(ips_ha_t * ha, dma_addr_t, int intr);
351static void ips_version_check(ips_ha_t * ha, int intr);
352static int ips_abort_init(ips_ha_t * ha, int index); 351static int ips_abort_init(ips_ha_t * ha, int index);
353static int ips_init_phase2(int index); 352static int ips_init_phase2(int index);
354 353
@@ -378,7 +377,7 @@ static char *ips_FlashData = NULL; /* CD Boot - Flash Data Buffer */
378static dma_addr_t ips_flashbusaddr; 377static dma_addr_t ips_flashbusaddr;
379static long ips_FlashDataInUse; /* CD Boot - Flash Data In Use Flag */ 378static long ips_FlashDataInUse; /* CD Boot - Flash Data In Use Flag */
380static uint32_t MaxLiteCmds = 32; /* Max Active Cmds for a Lite Adapter */ 379static uint32_t MaxLiteCmds = 32; /* Max Active Cmds for a Lite Adapter */
381static Scsi_Host_Template ips_driver_template = { 380static struct scsi_host_template ips_driver_template = {
382 .detect = ips_detect, 381 .detect = ips_detect,
383 .release = ips_release, 382 .release = ips_release,
384 .info = ips_info, 383 .info = ips_info,
@@ -406,8 +405,6 @@ static Scsi_Host_Template ips_driver_template = {
406#endif 405#endif
407}; 406};
408 407
409static IPS_DEFINE_COMPAT_TABLE( Compatable ); /* Version Compatability Table */
410
411 408
412/* This table describes all ServeRAID Adapters */ 409/* This table describes all ServeRAID Adapters */
413static struct pci_device_id ips_pci_table[] = { 410static struct pci_device_id ips_pci_table[] = {
@@ -590,7 +587,7 @@ __setup("ips=", ips_setup);
590/* */ 587/* */
591/****************************************************************************/ 588/****************************************************************************/
592static int 589static int
593ips_detect(Scsi_Host_Template * SHT) 590ips_detect(struct scsi_host_template * SHT)
594{ 591{
595 int i; 592 int i;
596 593
@@ -1265,9 +1262,9 @@ ips_proc24_info(char *buffer, char **start, off_t offset, int length,
1265/* */ 1262/* */
1266/****************************************************************************/ 1263/****************************************************************************/
1267static void 1264static void
1268ips_select_queue_depth(struct Scsi_Host *host, Scsi_Device * scsi_devs) 1265ips_select_queue_depth(struct Scsi_Host *host, struct scsi_device * scsi_devs)
1269{ 1266{
1270 Scsi_Device *device; 1267 struct scsi_device *device;
1271 ips_ha_t *ha; 1268 ips_ha_t *ha;
1272 int count = 0; 1269 int count = 0;
1273 int min; 1270 int min;
@@ -1310,7 +1307,7 @@ ips_select_queue_depth(struct Scsi_Host *host, Scsi_Device * scsi_devs)
1310/* */ 1307/* */
1311/****************************************************************************/ 1308/****************************************************************************/
1312static int 1309static int
1313ips_slave_configure(Scsi_Device * SDptr) 1310ips_slave_configure(struct scsi_device * SDptr)
1314{ 1311{
1315 ips_ha_t *ha; 1312 ips_ha_t *ha;
1316 int min; 1313 int min;
@@ -5930,7 +5927,7 @@ ips_write_driver_status(ips_ha_t * ha, int intr)
5930 strncpy((char *) ha->nvram->bios_high, ha->bios_version, 4); 5927 strncpy((char *) ha->nvram->bios_high, ha->bios_version, 4);
5931 strncpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4); 5928 strncpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4);
5932 5929
5933 ips_version_check(ha, intr); /* Check BIOS/FW/Driver Versions */ 5930 ha->nvram->versioning = 0; /* Indicate the Driver Does Not Support Versioning */
5934 5931
5935 /* now update the page */ 5932 /* now update the page */
5936 if (!ips_readwrite_page5(ha, TRUE, intr)) { 5933 if (!ips_readwrite_page5(ha, TRUE, intr)) {
@@ -6847,135 +6844,6 @@ ips_verify_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize,
6847 return (0); 6844 return (0);
6848} 6845}
6849 6846
6850/*---------------------------------------------------------------------------*/
6851/* Routine Name: ips_version_check */
6852/* */
6853/* Dependencies: */
6854/* Assumes that ips_read_adapter_status() is called first filling in */
6855/* the data for SubSystem Parameters. */
6856/* Called from ips_write_driver_status() so it also assumes NVRAM Page 5 */
6857/* Data is available. */
6858/* */
6859/*---------------------------------------------------------------------------*/
6860static void
6861ips_version_check(ips_ha_t * ha, int intr)
6862{
6863 IPS_VERSION_DATA *VersionInfo;
6864 uint8_t FirmwareVersion[IPS_COMPAT_ID_LENGTH + 1];
6865 uint8_t BiosVersion[IPS_COMPAT_ID_LENGTH + 1];
6866 int MatchError;
6867 int rc;
6868 char BiosString[10];
6869 char FirmwareString[10];
6870
6871 METHOD_TRACE("ips_version_check", 1);
6872
6873 VersionInfo = ( IPS_VERSION_DATA * ) ha->ioctl_data;
6874
6875 memset(FirmwareVersion, 0, IPS_COMPAT_ID_LENGTH + 1);
6876 memset(BiosVersion, 0, IPS_COMPAT_ID_LENGTH + 1);
6877
6878 /* Get the Compatible BIOS Version from NVRAM Page 5 */
6879 memcpy(BiosVersion, ha->nvram->BiosCompatibilityID,
6880 IPS_COMPAT_ID_LENGTH);
6881
6882 rc = IPS_FAILURE;
6883 if (ha->subsys->param[4] & IPS_GET_VERSION_SUPPORT) { /* If Versioning is Supported */
6884 /* Get the Version Info with a Get Version Command */
6885 memset( VersionInfo, 0, sizeof (IPS_VERSION_DATA));
6886 rc = ips_get_version_info(ha, ha->ioctl_busaddr, intr);
6887 if (rc == IPS_SUCCESS)
6888 memcpy(FirmwareVersion, VersionInfo->compatibilityId,
6889 IPS_COMPAT_ID_LENGTH);
6890 }
6891
6892 if (rc != IPS_SUCCESS) { /* If Data Not Obtainable from a GetVersion Command */
6893 /* Get the Firmware Version from Enquiry Data */
6894 memcpy(FirmwareVersion, ha->enq->CodeBlkVersion,
6895 IPS_COMPAT_ID_LENGTH);
6896 }
6897
6898 /* printk(KERN_WARNING "Adapter's BIOS Version = %s\n", BiosVersion); */
6899 /* printk(KERN_WARNING "BIOS Compatible Version = %s\n", IPS_COMPAT_BIOS); */
6900 /* printk(KERN_WARNING "Adapter's Firmware Version = %s\n", FirmwareVersion); */
6901 /* printk(KERN_WARNING "Firmware Compatible Version = %s \n", Compatable[ ha->nvram->adapter_type ]); */
6902
6903 MatchError = 0;
6904
6905 if (strncmp
6906 (FirmwareVersion, Compatable[ha->nvram->adapter_type],
6907 IPS_COMPAT_ID_LENGTH) != 0)
6908 MatchError = 1;
6909
6910 if (strncmp(BiosVersion, IPS_COMPAT_BIOS, IPS_COMPAT_ID_LENGTH) != 0)
6911 MatchError = 1;
6912
6913 ha->nvram->versioning = 1; /* Indicate the Driver Supports Versioning */
6914
6915 if (MatchError) {
6916 ha->nvram->version_mismatch = 1;
6917 if (ips_cd_boot == 0) {
6918 strncpy(&BiosString[0], ha->nvram->bios_high, 4);
6919 strncpy(&BiosString[4], ha->nvram->bios_low, 4);
6920 BiosString[8] = 0;
6921
6922 strncpy(&FirmwareString[0], ha->enq->CodeBlkVersion, 8);
6923 FirmwareString[8] = 0;
6924
6925 IPS_PRINTK(KERN_WARNING, ha->pcidev,
6926 "Warning ! ! ! ServeRAID Version Mismatch\n");
6927 IPS_PRINTK(KERN_WARNING, ha->pcidev,
6928 "Bios = %s, Firmware = %s, Device Driver = %s%s\n",
6929 BiosString, FirmwareString, IPS_VERSION_HIGH,
6930 IPS_VERSION_LOW);
6931 IPS_PRINTK(KERN_WARNING, ha->pcidev,
6932 "These levels should match to avoid possible compatibility problems.\n");
6933 }
6934 } else {
6935 ha->nvram->version_mismatch = 0;
6936 }
6937
6938 return;
6939}
6940
6941/*---------------------------------------------------------------------------*/
6942/* Routine Name: ips_get_version_info */
6943/* */
6944/* Routine Description: */
6945/* Issue an internal GETVERSION Command */
6946/* */
6947/* Return Value: */
6948/* 0 if Successful, else non-zero */
6949/*---------------------------------------------------------------------------*/
6950static int
6951ips_get_version_info(ips_ha_t * ha, dma_addr_t Buffer, int intr)
6952{
6953 ips_scb_t *scb;
6954 int rc;
6955
6956 METHOD_TRACE("ips_get_version_info", 1);
6957
6958 scb = &ha->scbs[ha->max_cmds - 1];
6959
6960 ips_init_scb(ha, scb);
6961
6962 scb->timeout = ips_cmd_timeout;
6963 scb->cdb[0] = IPS_CMD_GET_VERSION_INFO;
6964 scb->cmd.version_info.op_code = IPS_CMD_GET_VERSION_INFO;
6965 scb->cmd.version_info.command_id = IPS_COMMAND_ID(ha, scb);
6966 scb->cmd.version_info.reserved = 0;
6967 scb->cmd.version_info.count = sizeof (IPS_VERSION_DATA);
6968 scb->cmd.version_info.reserved2 = 0;
6969 scb->data_len = sizeof (IPS_VERSION_DATA);
6970 scb->data_busaddr = Buffer;
6971 scb->cmd.version_info.buffer_addr = Buffer;
6972 scb->flags = 0;
6973
6974 /* issue command */
6975 rc = ips_send_wait(ha, scb, ips_cmd_timeout, intr);
6976 return (rc);
6977}
6978
6979/****************************************************************************/ 6847/****************************************************************************/
6980/* */ 6848/* */
6981/* Routine Name: ips_abort_init */ 6849/* Routine Name: ips_abort_init */
diff --git a/drivers/scsi/ips.h b/drivers/scsi/ips.h
index adc6eabbf610..f46c382e5599 100644
--- a/drivers/scsi/ips.h
+++ b/drivers/scsi/ips.h
@@ -450,13 +450,13 @@
450 */ 450 */
451#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 451#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
452 static int ips_proc24_info(char *, char **, off_t, int, int, int); 452 static int ips_proc24_info(char *, char **, off_t, int, int, int);
453 static void ips_select_queue_depth(struct Scsi_Host *, Scsi_Device *); 453 static void ips_select_queue_depth(struct Scsi_Host *, struct scsi_device *);
454 static int ips_biosparam(Disk *disk, kdev_t dev, int geom[]); 454 static int ips_biosparam(Disk *disk, kdev_t dev, int geom[]);
455#else 455#else
456 static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); 456 static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
457 static int ips_biosparam(struct scsi_device *sdev, struct block_device *bdev, 457 static int ips_biosparam(struct scsi_device *sdev, struct block_device *bdev,
458 sector_t capacity, int geom[]); 458 sector_t capacity, int geom[]);
459 static int ips_slave_configure(Scsi_Device *SDptr); 459 static int ips_slave_configure(struct scsi_device *SDptr);
460#endif 460#endif
461 461
462/* 462/*
diff --git a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c
index a642f736cf85..23728d1c980c 100644
--- a/drivers/scsi/jazz_esp.c
+++ b/drivers/scsi/jazz_esp.c
@@ -52,7 +52,7 @@ static volatile unsigned char cmd_buffer[16];
52 * via PIO. 52 * via PIO.
53 */ 53 */
54 54
55int jazz_esp_detect(Scsi_Host_Template *tpnt); 55int jazz_esp_detect(struct scsi_host_template *tpnt);
56static int jazz_esp_release(struct Scsi_Host *shost) 56static int jazz_esp_release(struct Scsi_Host *shost)
57{ 57{
58 if (shost->irq) 58 if (shost->irq)
@@ -65,7 +65,7 @@ static int jazz_esp_release(struct Scsi_Host *shost)
65 return 0; 65 return 0;
66} 66}
67 67
68static Scsi_Host_Template driver_template = { 68static struct scsi_host_template driver_template = {
69 .proc_name = "jazz_esp", 69 .proc_name = "jazz_esp",
70 .proc_info = &esp_proc_info, 70 .proc_info = &esp_proc_info,
71 .name = "ESP 100/100a/200", 71 .name = "ESP 100/100a/200",
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index a74b4071a662..e51d9a8a2796 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4563,6 +4563,7 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int
4563 4563
4564 probe_ent->irq = pdev->irq; 4564 probe_ent->irq = pdev->irq;
4565 probe_ent->irq_flags = SA_SHIRQ; 4565 probe_ent->irq_flags = SA_SHIRQ;
4566 probe_ent->private_data = port[0]->private_data;
4566 4567
4567 if (ports & ATA_PORT_PRIMARY) { 4568 if (ports & ATA_PORT_PRIMARY) {
4568 probe_ent->port[p].cmd_addr = pci_resource_start(pdev, 0); 4569 probe_ent->port[p].cmd_addr = pci_resource_start(pdev, 0);
@@ -4599,6 +4600,7 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, stru
4599 probe_ent->legacy_mode = 1; 4600 probe_ent->legacy_mode = 1;
4600 probe_ent->n_ports = 1; 4601 probe_ent->n_ports = 1;
4601 probe_ent->hard_port_no = port_num; 4602 probe_ent->hard_port_no = port_num;
4603 probe_ent->private_data = port->private_data;
4602 4604
4603 switch(port_num) 4605 switch(port_num)
4604 { 4606 {
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index bb30fcdc9297..261be24e1df3 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -38,6 +38,7 @@
38#include <linux/spinlock.h> 38#include <linux/spinlock.h>
39#include <scsi/scsi.h> 39#include <scsi/scsi.h>
40#include <scsi/scsi_host.h> 40#include <scsi/scsi_host.h>
41#include <scsi/scsi_eh.h>
41#include <scsi/scsi_device.h> 42#include <scsi/scsi_device.h>
42#include <scsi/scsi_request.h> 43#include <scsi/scsi_request.h>
43#include <linux/libata.h> 44#include <linux/libata.h>
@@ -147,7 +148,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)
147 u8 scsi_cmd[MAX_COMMAND_SIZE]; 148 u8 scsi_cmd[MAX_COMMAND_SIZE];
148 u8 args[4], *argbuf = NULL; 149 u8 args[4], *argbuf = NULL;
149 int argsize = 0; 150 int argsize = 0;
150 struct scsi_request *sreq; 151 struct scsi_sense_hdr sshdr;
152 enum dma_data_direction data_dir;
151 153
152 if (NULL == (void *)arg) 154 if (NULL == (void *)arg)
153 return -EINVAL; 155 return -EINVAL;
@@ -155,10 +157,6 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)
155 if (copy_from_user(args, arg, sizeof(args))) 157 if (copy_from_user(args, arg, sizeof(args)))
156 return -EFAULT; 158 return -EFAULT;
157 159
158 sreq = scsi_allocate_request(scsidev, GFP_KERNEL);
159 if (!sreq)
160 return -EINTR;
161
162 memset(scsi_cmd, 0, sizeof(scsi_cmd)); 160 memset(scsi_cmd, 0, sizeof(scsi_cmd));
163 161
164 if (args[3]) { 162 if (args[3]) {
@@ -172,11 +170,11 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)
172 scsi_cmd[1] = (4 << 1); /* PIO Data-in */ 170 scsi_cmd[1] = (4 << 1); /* PIO Data-in */
173 scsi_cmd[2] = 0x0e; /* no off.line or cc, read from dev, 171 scsi_cmd[2] = 0x0e; /* no off.line or cc, read from dev,
174 block count in sector count field */ 172 block count in sector count field */
175 sreq->sr_data_direction = DMA_FROM_DEVICE; 173 data_dir = DMA_FROM_DEVICE;
176 } else { 174 } else {
177 scsi_cmd[1] = (3 << 1); /* Non-data */ 175 scsi_cmd[1] = (3 << 1); /* Non-data */
178 /* scsi_cmd[2] is already 0 -- no off.line, cc, or data xfer */ 176 /* scsi_cmd[2] is already 0 -- no off.line, cc, or data xfer */
179 sreq->sr_data_direction = DMA_NONE; 177 data_dir = DMA_NONE;
180 } 178 }
181 179
182 scsi_cmd[0] = ATA_16; 180 scsi_cmd[0] = ATA_16;
@@ -194,9 +192,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)
194 192
195 /* Good values for timeout and retries? Values below 193 /* Good values for timeout and retries? Values below
196 from scsi_ioctl_send_command() for default case... */ 194 from scsi_ioctl_send_command() for default case... */
197 scsi_wait_req(sreq, scsi_cmd, argbuf, argsize, (10*HZ), 5); 195 if (scsi_execute_req(scsidev, scsi_cmd, data_dir, argbuf, argsize,
198 196 &sshdr, (10*HZ), 5)) {
199 if (sreq->sr_result) {
200 rc = -EIO; 197 rc = -EIO;
201 goto error; 198 goto error;
202 } 199 }
@@ -207,8 +204,6 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)
207 && copy_to_user((void *)(arg + sizeof(args)), argbuf, argsize)) 204 && copy_to_user((void *)(arg + sizeof(args)), argbuf, argsize))
208 rc = -EFAULT; 205 rc = -EFAULT;
209error: 206error:
210 scsi_release_request(sreq);
211
212 if (argbuf) 207 if (argbuf)
213 kfree(argbuf); 208 kfree(argbuf);
214 209
@@ -231,7 +226,7 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)
231 int rc = 0; 226 int rc = 0;
232 u8 scsi_cmd[MAX_COMMAND_SIZE]; 227 u8 scsi_cmd[MAX_COMMAND_SIZE];
233 u8 args[7]; 228 u8 args[7];
234 struct scsi_request *sreq; 229 struct scsi_sense_hdr sshdr;
235 230
236 if (NULL == (void *)arg) 231 if (NULL == (void *)arg)
237 return -EINVAL; 232 return -EINVAL;
@@ -250,26 +245,13 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)
250 scsi_cmd[12] = args[5]; 245 scsi_cmd[12] = args[5];
251 scsi_cmd[14] = args[0]; 246 scsi_cmd[14] = args[0];
252 247
253 sreq = scsi_allocate_request(scsidev, GFP_KERNEL);
254 if (!sreq) {
255 rc = -EINTR;
256 goto error;
257 }
258
259 sreq->sr_data_direction = DMA_NONE;
260 /* Good values for timeout and retries? Values below 248 /* Good values for timeout and retries? Values below
261 from scsi_ioctl_send_command() for default case... */ 249 from scsi_ioctl_send_command() for default case... */
262 scsi_wait_req(sreq, scsi_cmd, NULL, 0, (10*HZ), 5); 250 if (scsi_execute_req(scsidev, scsi_cmd, DMA_NONE, NULL, 0, &sshdr,
263 251 (10*HZ), 5))
264 if (sreq->sr_result) {
265 rc = -EIO; 252 rc = -EIO;
266 goto error;
267 }
268 253
269 /* Need code to retrieve data from check condition? */ 254 /* Need code to retrieve data from check condition? */
270
271error:
272 scsi_release_request(sreq);
273 return rc; 255 return rc;
274} 256}
275 257
@@ -1129,6 +1111,8 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, const u8 *scsicm
1129 * length 0 means transfer 0 block of data. 1111 * length 0 means transfer 0 block of data.
1130 * However, for ATA R/W commands, sector count 0 means 1112 * However, for ATA R/W commands, sector count 0 means
1131 * 256 or 65536 sectors, not 0 sectors as in SCSI. 1113 * 256 or 65536 sectors, not 0 sectors as in SCSI.
1114 *
1115 * WARNING: one or two older ATA drives treat 0 as 0...
1132 */ 1116 */
1133 goto nothing_to_do; 1117 goto nothing_to_do;
1134 1118
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index c90723860a04..07498118359d 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -1704,7 +1704,6 @@ MODULE_DEVICE_TABLE(pci, lpfc_id_table);
1704 1704
1705static struct pci_driver lpfc_driver = { 1705static struct pci_driver lpfc_driver = {
1706 .name = LPFC_DRIVER_NAME, 1706 .name = LPFC_DRIVER_NAME,
1707 .owner = THIS_MODULE,
1708 .id_table = lpfc_id_table, 1707 .id_table = lpfc_id_table,
1709 .probe = lpfc_pci_probe_one, 1708 .probe = lpfc_pci_probe_one,
1710 .remove = __devexit_p(lpfc_pci_remove_one), 1709 .remove = __devexit_p(lpfc_pci_remove_one),
diff --git a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c
index c94c8db84651..e31fadd61904 100644
--- a/drivers/scsi/mac_esp.c
+++ b/drivers/scsi/mac_esp.c
@@ -300,7 +300,7 @@ unsigned long get_base(int chip_num)
300 * Model dependent ESP setup 300 * Model dependent ESP setup
301 */ 301 */
302 302
303int mac_esp_detect(Scsi_Host_Template * tpnt) 303int mac_esp_detect(struct scsi_host_template * tpnt)
304{ 304{
305 int quick = 0; 305 int quick = 0;
306 int chipnum, chipspresent = 0; 306 int chipnum, chipspresent = 0;
@@ -730,7 +730,7 @@ static void dma_setup_quick(struct NCR_ESP * esp, __u32 addr, int count, int wri
730#endif 730#endif
731} 731}
732 732
733static Scsi_Host_Template driver_template = { 733static struct scsi_host_template driver_template = {
734 .proc_name = "mac_esp", 734 .proc_name = "mac_esp",
735 .name = "Mac 53C9x SCSI", 735 .name = "Mac 53C9x SCSI",
736 .detect = mac_esp_detect, 736 .detect = mac_esp_detect,
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index 92d2c8379abf..777f9bcd1179 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -222,7 +222,7 @@ static struct Scsi_Host *default_instance;
222#endif 222#endif
223 223
224/* 224/*
225 * Function : int macscsi_detect(Scsi_Host_Template * tpnt) 225 * Function : int macscsi_detect(struct scsi_host_template * tpnt)
226 * 226 *
227 * Purpose : initializes mac NCR5380 driver based on the 227 * Purpose : initializes mac NCR5380 driver based on the
228 * command line / compile time port and irq definitions. 228 * command line / compile time port and irq definitions.
@@ -233,7 +233,7 @@ static struct Scsi_Host *default_instance;
233 * 233 *
234 */ 234 */
235 235
236int macscsi_detect(Scsi_Host_Template * tpnt) 236int macscsi_detect(struct scsi_host_template * tpnt)
237{ 237{
238 static int called = 0; 238 static int called = 0;
239 int flags = 0; 239 int flags = 0;
@@ -581,7 +581,7 @@ static int macscsi_pwrite (struct Scsi_Host *instance,
581 581
582#include "NCR5380.c" 582#include "NCR5380.c"
583 583
584static Scsi_Host_Template driver_template = { 584static struct scsi_host_template driver_template = {
585 .proc_name = "Mac5380", 585 .proc_name = "Mac5380",
586 .proc_info = macscsi_proc_info, 586 .proc_info = macscsi_proc_info,
587 .name = "Macintosh NCR5380 SCSI", 587 .name = "Macintosh NCR5380 SCSI",
diff --git a/drivers/scsi/mca_53c9x.c b/drivers/scsi/mca_53c9x.c
index 194c75451faf..998a8bbc1a4b 100644
--- a/drivers/scsi/mca_53c9x.c
+++ b/drivers/scsi/mca_53c9x.c
@@ -103,7 +103,7 @@ static volatile unsigned char cmd_buffer[16];
103static struct ESP_regs eregs; 103static struct ESP_regs eregs;
104 104
105/***************************************************************** Detection */ 105/***************************************************************** Detection */
106static int mca_esp_detect(Scsi_Host_Template *tpnt) 106static int mca_esp_detect(struct scsi_host_template *tpnt)
107{ 107{
108 struct NCR_ESP *esp; 108 struct NCR_ESP *esp;
109 static int io_port_by_pos[] = MCA_53C9X_IO_PORTS; 109 static int io_port_by_pos[] = MCA_53C9X_IO_PORTS;
@@ -444,7 +444,7 @@ static void dma_led_off(struct NCR_ESP *esp)
444 outb(inb(PS2_SYS_CTR) & 0x3f, PS2_SYS_CTR); 444 outb(inb(PS2_SYS_CTR) & 0x3f, PS2_SYS_CTR);
445} 445}
446 446
447static Scsi_Host_Template driver_template = { 447static struct scsi_host_template driver_template = {
448 .proc_name = "mca_53c9x", 448 .proc_name = "mca_53c9x",
449 .name = "NCR 53c9x SCSI", 449 .name = "NCR 53c9x SCSI",
450 .detect = mca_esp_detect, 450 .detect = mca_esp_detect,
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 61a6fd810bb4..dfea346b00a5 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -362,6 +362,7 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
362 adapter_t *adapter; 362 adapter_t *adapter;
363 scb_t *scb; 363 scb_t *scb;
364 int busy=0; 364 int busy=0;
365 unsigned long flags;
365 366
366 adapter = (adapter_t *)scmd->device->host->hostdata; 367 adapter = (adapter_t *)scmd->device->host->hostdata;
367 368
@@ -377,6 +378,7 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
377 * return 0 in that case. 378 * return 0 in that case.
378 */ 379 */
379 380
381 spin_lock_irqsave(&adapter->lock, flags);
380 scb = mega_build_cmd(adapter, scmd, &busy); 382 scb = mega_build_cmd(adapter, scmd, &busy);
381 383
382 if(scb) { 384 if(scb) {
@@ -393,6 +395,7 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
393 } 395 }
394 return 0; 396 return 0;
395 } 397 }
398 spin_unlock_irqrestore(&adapter->lock, flags);
396 399
397 return busy; 400 return busy;
398} 401}
@@ -1683,7 +1686,7 @@ mega_rundoneq (adapter_t *adapter)
1683 1686
1684 list_for_each(pos, &adapter->completed_list) { 1687 list_for_each(pos, &adapter->completed_list) {
1685 1688
1686 Scsi_Pointer* spos = (Scsi_Pointer *)pos; 1689 struct scsi_pointer* spos = (struct scsi_pointer *)pos;
1687 1690
1688 cmd = list_entry(spos, Scsi_Cmnd, SCp); 1691 cmd = list_entry(spos, Scsi_Cmnd, SCp);
1689 cmd->scsi_done(cmd); 1692 cmd->scsi_done(cmd);
@@ -1981,7 +1984,7 @@ megaraid_reset(struct scsi_cmnd *cmd)
1981 mc.cmd = MEGA_CLUSTER_CMD; 1984 mc.cmd = MEGA_CLUSTER_CMD;
1982 mc.opcode = MEGA_RESET_RESERVATIONS; 1985 mc.opcode = MEGA_RESET_RESERVATIONS;
1983 1986
1984 if( mega_internal_command(adapter, LOCK_INT, &mc, NULL) != 0 ) { 1987 if( mega_internal_command(adapter, &mc, NULL) != 0 ) {
1985 printk(KERN_WARNING 1988 printk(KERN_WARNING
1986 "megaraid: reservation reset failed.\n"); 1989 "megaraid: reservation reset failed.\n");
1987 } 1990 }
@@ -3011,7 +3014,7 @@ proc_rdrv(adapter_t *adapter, char *page, int start, int end )
3011 mc.cmd = FC_NEW_CONFIG; 3014 mc.cmd = FC_NEW_CONFIG;
3012 mc.opcode = OP_DCMD_READ_CONFIG; 3015 mc.opcode = OP_DCMD_READ_CONFIG;
3013 3016
3014 if( mega_internal_command(adapter, LOCK_INT, &mc, NULL) ) { 3017 if( mega_internal_command(adapter, &mc, NULL) ) {
3015 3018
3016 len = sprintf(page, "40LD read config failed.\n"); 3019 len = sprintf(page, "40LD read config failed.\n");
3017 3020
@@ -3029,11 +3032,11 @@ proc_rdrv(adapter_t *adapter, char *page, int start, int end )
3029 else { 3032 else {
3030 mc.cmd = NEW_READ_CONFIG_8LD; 3033 mc.cmd = NEW_READ_CONFIG_8LD;
3031 3034
3032 if( mega_internal_command(adapter, LOCK_INT, &mc, NULL) ) { 3035 if( mega_internal_command(adapter, &mc, NULL) ) {
3033 3036
3034 mc.cmd = READ_CONFIG_8LD; 3037 mc.cmd = READ_CONFIG_8LD;
3035 3038
3036 if( mega_internal_command(adapter, LOCK_INT, &mc, 3039 if( mega_internal_command(adapter, &mc,
3037 NULL) ){ 3040 NULL) ){
3038 3041
3039 len = sprintf(page, 3042 len = sprintf(page,
@@ -3632,7 +3635,7 @@ megadev_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
3632 /* 3635 /*
3633 * Issue the command 3636 * Issue the command
3634 */ 3637 */
3635 mega_internal_command(adapter, LOCK_INT, &mc, pthru); 3638 mega_internal_command(adapter, &mc, pthru);
3636 3639
3637 rval = mega_n_to_m((void __user *)arg, &mc); 3640 rval = mega_n_to_m((void __user *)arg, &mc);
3638 3641
@@ -3715,7 +3718,7 @@ freemem_and_return:
3715 /* 3718 /*
3716 * Issue the command 3719 * Issue the command
3717 */ 3720 */
3718 mega_internal_command(adapter, LOCK_INT, &mc, NULL); 3721 mega_internal_command(adapter, &mc, NULL);
3719 3722
3720 rval = mega_n_to_m((void __user *)arg, &mc); 3723 rval = mega_n_to_m((void __user *)arg, &mc);
3721 3724
@@ -4234,7 +4237,7 @@ mega_do_del_logdrv(adapter_t *adapter, int logdrv)
4234 mc.opcode = OP_DEL_LOGDRV; 4237 mc.opcode = OP_DEL_LOGDRV;
4235 mc.subopcode = logdrv; 4238 mc.subopcode = logdrv;
4236 4239
4237 rval = mega_internal_command(adapter, LOCK_INT, &mc, NULL); 4240 rval = mega_internal_command(adapter, &mc, NULL);
4238 4241
4239 /* log this event */ 4242 /* log this event */
4240 if(rval) { 4243 if(rval) {
@@ -4367,7 +4370,7 @@ mega_adapinq(adapter_t *adapter, dma_addr_t dma_handle)
4367 4370
4368 mc.xferaddr = (u32)dma_handle; 4371 mc.xferaddr = (u32)dma_handle;
4369 4372
4370 if ( mega_internal_command(adapter, LOCK_INT, &mc, NULL) != 0 ) { 4373 if ( mega_internal_command(adapter, &mc, NULL) != 0 ) {
4371 return -1; 4374 return -1;
4372 } 4375 }
4373 4376
@@ -4435,7 +4438,7 @@ mega_internal_dev_inquiry(adapter_t *adapter, u8 ch, u8 tgt,
4435 mc.cmd = MEGA_MBOXCMD_PASSTHRU; 4438 mc.cmd = MEGA_MBOXCMD_PASSTHRU;
4436 mc.xferaddr = (u32)pthru_dma_handle; 4439 mc.xferaddr = (u32)pthru_dma_handle;
4437 4440
4438 rval = mega_internal_command(adapter, LOCK_INT, &mc, pthru); 4441 rval = mega_internal_command(adapter, &mc, pthru);
4439 4442
4440 pci_free_consistent(pdev, sizeof(mega_passthru), pthru, 4443 pci_free_consistent(pdev, sizeof(mega_passthru), pthru,
4441 pthru_dma_handle); 4444 pthru_dma_handle);
@@ -4449,7 +4452,6 @@ mega_internal_dev_inquiry(adapter_t *adapter, u8 ch, u8 tgt,
4449/** 4452/**
4450 * mega_internal_command() 4453 * mega_internal_command()
4451 * @adapter - pointer to our soft state 4454 * @adapter - pointer to our soft state
4452 * @ls - the scope of the exclusion lock.
4453 * @mc - the mailbox command 4455 * @mc - the mailbox command
4454 * @pthru - Passthru structure for DCDB commands 4456 * @pthru - Passthru structure for DCDB commands
4455 * 4457 *
@@ -4463,8 +4465,7 @@ mega_internal_dev_inquiry(adapter_t *adapter, u8 ch, u8 tgt,
4463 * Note: parameter 'pthru' is null for non-passthru commands. 4465 * Note: parameter 'pthru' is null for non-passthru commands.
4464 */ 4466 */
4465static int 4467static int
4466mega_internal_command(adapter_t *adapter, lockscope_t ls, megacmd_t *mc, 4468mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru)
4467 mega_passthru *pthru )
4468{ 4469{
4469 Scsi_Cmnd *scmd; 4470 Scsi_Cmnd *scmd;
4470 struct scsi_device *sdev; 4471 struct scsi_device *sdev;
@@ -4508,15 +4509,8 @@ mega_internal_command(adapter_t *adapter, lockscope_t ls, megacmd_t *mc,
4508 4509
4509 scb->idx = CMDID_INT_CMDS; 4510 scb->idx = CMDID_INT_CMDS;
4510 4511
4511 /*
4512 * Get the lock only if the caller has not acquired it already
4513 */
4514 if( ls == LOCK_INT ) spin_lock_irqsave(&adapter->lock, flags);
4515
4516 megaraid_queue(scmd, mega_internal_done); 4512 megaraid_queue(scmd, mega_internal_done);
4517 4513
4518 if( ls == LOCK_INT ) spin_unlock_irqrestore(&adapter->lock, flags);
4519
4520 wait_for_completion(&adapter->int_waitq); 4514 wait_for_completion(&adapter->int_waitq);
4521 4515
4522 rval = scmd->result; 4516 rval = scmd->result;
diff --git a/drivers/scsi/megaraid.h b/drivers/scsi/megaraid.h
index 4facf557cd19..6f9078025748 100644
--- a/drivers/scsi/megaraid.h
+++ b/drivers/scsi/megaraid.h
@@ -926,13 +926,6 @@ struct mega_hbas {
926#define MEGA_SGLIST 0x0002 926#define MEGA_SGLIST 0x0002
927 927
928/* 928/*
929 * lockscope definitions, callers can specify the lock scope with this data
930 * type. LOCK_INT would mean the caller has not acquired the lock before
931 * making the call and LOCK_EXT would mean otherwise.
932 */
933typedef enum { LOCK_INT, LOCK_EXT } lockscope_t;
934
935/*
936 * Parameters for the io-mapped controllers 929 * Parameters for the io-mapped controllers
937 */ 930 */
938 931
@@ -1062,8 +1055,7 @@ static int mega_support_random_del(adapter_t *);
1062static int mega_del_logdrv(adapter_t *, int); 1055static int mega_del_logdrv(adapter_t *, int);
1063static int mega_do_del_logdrv(adapter_t *, int); 1056static int mega_do_del_logdrv(adapter_t *, int);
1064static void mega_get_max_sgl(adapter_t *); 1057static void mega_get_max_sgl(adapter_t *);
1065static int mega_internal_command(adapter_t *, lockscope_t, megacmd_t *, 1058static int mega_internal_command(adapter_t *, megacmd_t *, mega_passthru *);
1066 mega_passthru *);
1067static void mega_internal_done(Scsi_Cmnd *); 1059static void mega_internal_done(Scsi_Cmnd *);
1068static int mega_support_cluster(adapter_t *); 1060static int mega_support_cluster(adapter_t *);
1069#endif 1061#endif
diff --git a/drivers/scsi/megaraid/mega_common.h b/drivers/scsi/megaraid/mega_common.h
index 8e547130e97d..4675343228ad 100644
--- a/drivers/scsi/megaraid/mega_common.h
+++ b/drivers/scsi/megaraid/mega_common.h
@@ -96,7 +96,6 @@ typedef struct {
96 * @param dpc_h : tasklet handle 96 * @param dpc_h : tasklet handle
97 * @param pdev : pci configuration pointer for kernel 97 * @param pdev : pci configuration pointer for kernel
98 * @param host : pointer to host structure of mid-layer 98 * @param host : pointer to host structure of mid-layer
99 * @param host_lock : pointer to appropriate lock
100 * @param lock : synchronization lock for mid-layer and driver 99 * @param lock : synchronization lock for mid-layer and driver
101 * @param quiescent : driver is quiescent for now. 100 * @param quiescent : driver is quiescent for now.
102 * @param outstanding_cmds : number of commands pending in the driver 101 * @param outstanding_cmds : number of commands pending in the driver
@@ -151,7 +150,6 @@ typedef struct {
151 struct tasklet_struct dpc_h; 150 struct tasklet_struct dpc_h;
152 struct pci_dev *pdev; 151 struct pci_dev *pdev;
153 struct Scsi_Host *host; 152 struct Scsi_Host *host;
154 spinlock_t *host_lock;
155 spinlock_t lock; 153 spinlock_t lock;
156 uint8_t quiescent; 154 uint8_t quiescent;
157 int outstanding_cmds; 155 int outstanding_cmds;
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index 1a3d195a2d36..4b5d420d2f4d 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -533,8 +533,6 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
533 533
534 // Initialize the synchronization lock for kernel and LLD 534 // Initialize the synchronization lock for kernel and LLD
535 spin_lock_init(&adapter->lock); 535 spin_lock_init(&adapter->lock);
536 adapter->host_lock = &adapter->lock;
537
538 536
539 // Initialize the command queues: the list of free SCBs and the list 537 // Initialize the command queues: the list of free SCBs and the list
540 // of pending SCBs. 538 // of pending SCBs.
@@ -715,9 +713,6 @@ megaraid_io_attach(adapter_t *adapter)
715 SCSIHOST2ADAP(host) = (caddr_t)adapter; 713 SCSIHOST2ADAP(host) = (caddr_t)adapter;
716 adapter->host = host; 714 adapter->host = host;
717 715
718 // export the parameters required by the mid-layer
719 scsi_assign_lock(host, adapter->host_lock);
720
721 host->irq = adapter->irq; 716 host->irq = adapter->irq;
722 host->unique_id = adapter->unique_id; 717 host->unique_id = adapter->unique_id;
723 host->can_queue = adapter->max_cmds; 718 host->can_queue = adapter->max_cmds;
@@ -1560,10 +1555,6 @@ megaraid_queue_command(struct scsi_cmnd *scp, void (* done)(struct scsi_cmnd *))
1560 scp->scsi_done = done; 1555 scp->scsi_done = done;
1561 scp->result = 0; 1556 scp->result = 0;
1562 1557
1563 assert_spin_locked(adapter->host_lock);
1564
1565 spin_unlock(adapter->host_lock);
1566
1567 /* 1558 /*
1568 * Allocate and build a SCB request 1559 * Allocate and build a SCB request
1569 * if_busy flag will be set if megaraid_mbox_build_cmd() command could 1560 * if_busy flag will be set if megaraid_mbox_build_cmd() command could
@@ -1573,23 +1564,16 @@ megaraid_queue_command(struct scsi_cmnd *scp, void (* done)(struct scsi_cmnd *))
1573 * return 0 in that case, and we would do the callback right away. 1564 * return 0 in that case, and we would do the callback right away.
1574 */ 1565 */
1575 if_busy = 0; 1566 if_busy = 0;
1576 scb = megaraid_mbox_build_cmd(adapter, scp, &if_busy); 1567 scb = megaraid_mbox_build_cmd(adapter, scp, &if_busy);
1577
1578 if (scb) {
1579 megaraid_mbox_runpendq(adapter, scb);
1580 }
1581
1582 spin_lock(adapter->host_lock);
1583
1584 if (!scb) { // command already completed 1568 if (!scb) { // command already completed
1585 done(scp); 1569 done(scp);
1586 return 0; 1570 return 0;
1587 } 1571 }
1588 1572
1573 megaraid_mbox_runpendq(adapter, scb);
1589 return if_busy; 1574 return if_busy;
1590} 1575}
1591 1576
1592
1593/** 1577/**
1594 * megaraid_mbox_build_cmd - transform the mid-layer scsi command to megaraid 1578 * megaraid_mbox_build_cmd - transform the mid-layer scsi command to megaraid
1595 * firmware lingua 1579 * firmware lingua
@@ -2546,9 +2530,7 @@ megaraid_mbox_dpc(unsigned long devp)
2546 megaraid_dealloc_scb(adapter, scb); 2530 megaraid_dealloc_scb(adapter, scb);
2547 2531
2548 // send the scsi packet back to kernel 2532 // send the scsi packet back to kernel
2549 spin_lock(adapter->host_lock);
2550 scp->scsi_done(scp); 2533 scp->scsi_done(scp);
2551 spin_unlock(adapter->host_lock);
2552 } 2534 }
2553 2535
2554 return; 2536 return;
@@ -2563,7 +2545,7 @@ megaraid_mbox_dpc(unsigned long devp)
2563 * aborted. All the commands issued to the F/W must complete. 2545 * aborted. All the commands issued to the F/W must complete.
2564 **/ 2546 **/
2565static int 2547static int
2566__megaraid_abort_handler(struct scsi_cmnd *scp) 2548megaraid_abort_handler(struct scsi_cmnd *scp)
2567{ 2549{
2568 adapter_t *adapter; 2550 adapter_t *adapter;
2569 mraid_device_t *raid_dev; 2551 mraid_device_t *raid_dev;
@@ -2577,8 +2559,6 @@ __megaraid_abort_handler(struct scsi_cmnd *scp)
2577 adapter = SCP2ADAPTER(scp); 2559 adapter = SCP2ADAPTER(scp);
2578 raid_dev = ADAP2RAIDDEV(adapter); 2560 raid_dev = ADAP2RAIDDEV(adapter);
2579 2561
2580 assert_spin_locked(adapter->host_lock);
2581
2582 con_log(CL_ANN, (KERN_WARNING 2562 con_log(CL_ANN, (KERN_WARNING
2583 "megaraid: aborting-%ld cmd=%x <c=%d t=%d l=%d>\n", 2563 "megaraid: aborting-%ld cmd=%x <c=%d t=%d l=%d>\n",
2584 scp->serial_number, scp->cmnd[0], SCP2CHANNEL(scp), 2564 scp->serial_number, scp->cmnd[0], SCP2CHANNEL(scp),
@@ -2658,6 +2638,7 @@ __megaraid_abort_handler(struct scsi_cmnd *scp)
2658 // traverse through the list of all SCB, since driver does not 2638 // traverse through the list of all SCB, since driver does not
2659 // maintain these SCBs on any list 2639 // maintain these SCBs on any list
2660 found = 0; 2640 found = 0;
2641 spin_lock_irq(&adapter->lock);
2661 for (i = 0; i < MBOX_MAX_SCSI_CMDS; i++) { 2642 for (i = 0; i < MBOX_MAX_SCSI_CMDS; i++) {
2662 scb = adapter->kscb_list + i; 2643 scb = adapter->kscb_list + i;
2663 2644
@@ -2680,6 +2661,7 @@ __megaraid_abort_handler(struct scsi_cmnd *scp)
2680 } 2661 }
2681 } 2662 }
2682 } 2663 }
2664 spin_unlock_irq(&adapter->lock);
2683 2665
2684 if (!found) { 2666 if (!found) {
2685 con_log(CL_ANN, (KERN_WARNING 2667 con_log(CL_ANN, (KERN_WARNING
@@ -2696,22 +2678,6 @@ __megaraid_abort_handler(struct scsi_cmnd *scp)
2696 return FAILED; 2678 return FAILED;
2697} 2679}
2698 2680
2699static int
2700megaraid_abort_handler(struct scsi_cmnd *scp)
2701{
2702 adapter_t *adapter;
2703 int rc;
2704
2705 adapter = SCP2ADAPTER(scp);
2706
2707 spin_lock_irq(adapter->host_lock);
2708 rc = __megaraid_abort_handler(scp);
2709 spin_unlock_irq(adapter->host_lock);
2710
2711 return rc;
2712}
2713
2714
2715/** 2681/**
2716 * megaraid_reset_handler - device reset hadler for mailbox based driver 2682 * megaraid_reset_handler - device reset hadler for mailbox based driver
2717 * @scp : reference command 2683 * @scp : reference command
@@ -2723,7 +2689,7 @@ megaraid_abort_handler(struct scsi_cmnd *scp)
2723 * host 2689 * host
2724 **/ 2690 **/
2725static int 2691static int
2726__megaraid_reset_handler(struct scsi_cmnd *scp) 2692megaraid_reset_handler(struct scsi_cmnd *scp)
2727{ 2693{
2728 adapter_t *adapter; 2694 adapter_t *adapter;
2729 scb_t *scb; 2695 scb_t *scb;
@@ -2739,10 +2705,6 @@ __megaraid_reset_handler(struct scsi_cmnd *scp)
2739 adapter = SCP2ADAPTER(scp); 2705 adapter = SCP2ADAPTER(scp);
2740 raid_dev = ADAP2RAIDDEV(adapter); 2706 raid_dev = ADAP2RAIDDEV(adapter);
2741 2707
2742 assert_spin_locked(adapter->host_lock);
2743
2744 con_log(CL_ANN, (KERN_WARNING "megaraid: reseting the host...\n"));
2745
2746 // return failure if adapter is not responding 2708 // return failure if adapter is not responding
2747 if (raid_dev->hw_error) { 2709 if (raid_dev->hw_error) {
2748 con_log(CL_ANN, (KERN_NOTICE 2710 con_log(CL_ANN, (KERN_NOTICE
@@ -2779,8 +2741,6 @@ __megaraid_reset_handler(struct scsi_cmnd *scp)
2779 adapter->outstanding_cmds, MBOX_RESET_WAIT)); 2741 adapter->outstanding_cmds, MBOX_RESET_WAIT));
2780 } 2742 }
2781 2743
2782 spin_unlock(adapter->host_lock);
2783
2784 recovery_window = MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT; 2744 recovery_window = MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT;
2785 2745
2786 recovering = adapter->outstanding_cmds; 2746 recovering = adapter->outstanding_cmds;
@@ -2806,7 +2766,7 @@ __megaraid_reset_handler(struct scsi_cmnd *scp)
2806 msleep(1000); 2766 msleep(1000);
2807 } 2767 }
2808 2768
2809 spin_lock(adapter->host_lock); 2769 spin_lock(&adapter->lock);
2810 2770
2811 // If still outstanding commands, bail out 2771 // If still outstanding commands, bail out
2812 if (adapter->outstanding_cmds) { 2772 if (adapter->outstanding_cmds) {
@@ -2815,7 +2775,8 @@ __megaraid_reset_handler(struct scsi_cmnd *scp)
2815 2775
2816 raid_dev->hw_error = 1; 2776 raid_dev->hw_error = 1;
2817 2777
2818 return FAILED; 2778 rval = FAILED;
2779 goto out;
2819 } 2780 }
2820 else { 2781 else {
2821 con_log(CL_ANN, (KERN_NOTICE 2782 con_log(CL_ANN, (KERN_NOTICE
@@ -2824,7 +2785,10 @@ __megaraid_reset_handler(struct scsi_cmnd *scp)
2824 2785
2825 2786
2826 // If the controller supports clustering, reset reservations 2787 // If the controller supports clustering, reset reservations
2827 if (!adapter->ha) return SUCCESS; 2788 if (!adapter->ha) {
2789 rval = SUCCESS;
2790 goto out;
2791 }
2828 2792
2829 // clear reservations if any 2793 // clear reservations if any
2830 raw_mbox[0] = CLUSTER_CMD; 2794 raw_mbox[0] = CLUSTER_CMD;
@@ -2841,22 +2805,11 @@ __megaraid_reset_handler(struct scsi_cmnd *scp)
2841 "megaraid: reservation reset failed\n")); 2805 "megaraid: reservation reset failed\n"));
2842 } 2806 }
2843 2807
2808 out:
2809 spin_unlock_irq(&adapter->lock);
2844 return rval; 2810 return rval;
2845} 2811}
2846 2812
2847static int
2848megaraid_reset_handler(struct scsi_cmnd *cmd)
2849{
2850 int rc;
2851
2852 spin_lock_irq(cmd->device->host->host_lock);
2853 rc = __megaraid_reset_handler(cmd);
2854 spin_unlock_irq(cmd->device->host->host_lock);
2855
2856 return rc;
2857}
2858
2859
2860/* 2813/*
2861 * START: internal commands library 2814 * START: internal commands library
2862 * 2815 *
@@ -3776,9 +3729,9 @@ wait_till_fw_empty(adapter_t *adapter)
3776 /* 3729 /*
3777 * Set the quiescent flag to stop issuing cmds to FW. 3730 * Set the quiescent flag to stop issuing cmds to FW.
3778 */ 3731 */
3779 spin_lock_irqsave(adapter->host_lock, flags); 3732 spin_lock_irqsave(&adapter->lock, flags);
3780 adapter->quiescent++; 3733 adapter->quiescent++;
3781 spin_unlock_irqrestore(adapter->host_lock, flags); 3734 spin_unlock_irqrestore(&adapter->lock, flags);
3782 3735
3783 /* 3736 /*
3784 * Wait till there are no more cmds outstanding at FW. Try for at most 3737 * Wait till there are no more cmds outstanding at FW. Try for at most
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index 801a63bea8a5..3c32e69afcd9 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -766,17 +766,12 @@ static int megasas_generic_reset(struct scsi_cmnd *scmd)
766 return FAILED; 766 return FAILED;
767 } 767 }
768 768
769 spin_unlock(scmd->device->host->host_lock);
770
771 ret_val = megasas_wait_for_outstanding(instance); 769 ret_val = megasas_wait_for_outstanding(instance);
772
773 if (ret_val == SUCCESS) 770 if (ret_val == SUCCESS)
774 printk(KERN_NOTICE "megasas: reset successful \n"); 771 printk(KERN_NOTICE "megasas: reset successful \n");
775 else 772 else
776 printk(KERN_ERR "megasas: failed to do reset\n"); 773 printk(KERN_ERR "megasas: failed to do reset\n");
777 774
778 spin_lock(scmd->device->host->host_lock);
779
780 return ret_val; 775 return ret_val;
781} 776}
782 777
diff --git a/drivers/scsi/mvme147.c b/drivers/scsi/mvme147.c
index 33380cee9b77..cb367c2c5c78 100644
--- a/drivers/scsi/mvme147.c
+++ b/drivers/scsi/mvme147.c
@@ -63,7 +63,7 @@ static void dma_stop (struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
63 m147_pcc->dma_cntrl = 0; 63 m147_pcc->dma_cntrl = 0;
64} 64}
65 65
66int mvme147_detect(Scsi_Host_Template *tpnt) 66int mvme147_detect(struct scsi_host_template *tpnt)
67{ 67{
68 static unsigned char called = 0; 68 static unsigned char called = 0;
69 wd33c93_regs regs; 69 wd33c93_regs regs;
@@ -130,7 +130,7 @@ static int mvme147_bus_reset(Scsi_Cmnd *cmd)
130 130
131#include "mvme147.h" 131#include "mvme147.h"
132 132
133static Scsi_Host_Template driver_template = { 133static struct scsi_host_template driver_template = {
134 .proc_name = "MVME147", 134 .proc_name = "MVME147",
135 .name = "MVME147 built-in SCSI", 135 .name = "MVME147 built-in SCSI",
136 .detect = mvme147_detect, 136 .detect = mvme147_detect,
diff --git a/drivers/scsi/mvme147.h b/drivers/scsi/mvme147.h
index d8903f096182..2f56d69bd180 100644
--- a/drivers/scsi/mvme147.h
+++ b/drivers/scsi/mvme147.h
@@ -10,7 +10,7 @@
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12 12
13int mvme147_detect(Scsi_Host_Template *); 13int mvme147_detect(struct scsi_host_template *);
14int mvme147_release(struct Scsi_Host *); 14int mvme147_release(struct Scsi_Host *);
15const char *wd33c93_info(void); 15const char *wd33c93_info(void);
16int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 16int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
diff --git a/drivers/scsi/mvme16x.c b/drivers/scsi/mvme16x.c
index 29ec699e0e4d..890e9e232dab 100644
--- a/drivers/scsi/mvme16x.c
+++ b/drivers/scsi/mvme16x.c
@@ -21,7 +21,7 @@
21#include<linux/stat.h> 21#include<linux/stat.h>
22 22
23 23
24int mvme16x_scsi_detect(Scsi_Host_Template *tpnt) 24int mvme16x_scsi_detect(struct scsi_host_template *tpnt)
25{ 25{
26 static unsigned char called = 0; 26 static unsigned char called = 0;
27 int clock; 27 int clock;
@@ -61,7 +61,7 @@ static int mvme16x_scsi_release(struct Scsi_Host *shost)
61 return 0; 61 return 0;
62} 62}
63 63
64static Scsi_Host_Template driver_template = { 64static struct scsi_host_template driver_template = {
65 .name = "MVME16x NCR53c710 SCSI", 65 .name = "MVME16x NCR53c710 SCSI",
66 .detect = mvme16x_scsi_detect, 66 .detect = mvme16x_scsi_detect,
67 .release = mvme16x_scsi_release, 67 .release = mvme16x_scsi_release,
diff --git a/drivers/scsi/mvme16x.h b/drivers/scsi/mvme16x.h
index 25173c891d3c..c7a12533fb2c 100644
--- a/drivers/scsi/mvme16x.h
+++ b/drivers/scsi/mvme16x.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6int mvme16x_scsi_detect(Scsi_Host_Template *); 6int mvme16x_scsi_detect(struct scsi_host_template *);
7const char *NCR53c7x0_info(void); 7const char *NCR53c7x0_info(void);
8int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 8int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
9int NCR53c7xx_abort(Scsi_Cmnd *); 9int NCR53c7xx_abort(Scsi_Cmnd *);
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index e4ff4f00676d..a279ebb61447 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -198,7 +198,7 @@ static void __devexit nsp32_remove(struct pci_dev *);
198static int __init init_nsp32 (void); 198static int __init init_nsp32 (void);
199static void __exit exit_nsp32 (void); 199static void __exit exit_nsp32 (void);
200 200
201/* struct Scsi_Host_Template */ 201/* struct struct scsi_host_template */
202#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) 202#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73))
203static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int); 203static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int);
204#else 204#else
@@ -208,7 +208,7 @@ static int nsp32_proc_info (char *, char **, off_t, int, int, int);
208#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) 208#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73))
209static int nsp32_detect (struct pci_dev *pdev); 209static int nsp32_detect (struct pci_dev *pdev);
210#else 210#else
211static int nsp32_detect (Scsi_Host_Template *); 211static int nsp32_detect (struct scsi_host_template *);
212#endif 212#endif
213static int nsp32_queuecommand(struct scsi_cmnd *, 213static int nsp32_queuecommand(struct scsi_cmnd *,
214 void (*done)(struct scsi_cmnd *)); 214 void (*done)(struct scsi_cmnd *));
@@ -2683,7 +2683,7 @@ static int nsp32_detect(struct pci_dev *pdev)
2683#define DETECT_OK 1 2683#define DETECT_OK 1
2684#define DETECT_NG 0 2684#define DETECT_NG 0
2685#define PCIDEV (data->Pci) 2685#define PCIDEV (data->Pci)
2686static int nsp32_detect(Scsi_Host_Template *sht) 2686static int nsp32_detect(struct scsi_host_template *sht)
2687#endif 2687#endif
2688{ 2688{
2689 struct Scsi_Host *host; /* registered host structure */ 2689 struct Scsi_Host *host; /* registered host structure */
diff --git a/drivers/scsi/oktagon_esp.c b/drivers/scsi/oktagon_esp.c
index 573d7ef93f08..5d9c9ada814f 100644
--- a/drivers/scsi/oktagon_esp.c
+++ b/drivers/scsi/oktagon_esp.c
@@ -114,7 +114,7 @@ static volatile unsigned char cmd_buffer[16];
114 */ 114 */
115 115
116/***************************************************************** Detection */ 116/***************************************************************** Detection */
117int oktagon_esp_detect(Scsi_Host_Template *tpnt) 117int oktagon_esp_detect(struct scsi_host_template *tpnt)
118{ 118{
119 struct NCR_ESP *esp; 119 struct NCR_ESP *esp;
120 struct zorro_dev *z = NULL; 120 struct zorro_dev *z = NULL;
@@ -585,7 +585,7 @@ int oktagon_esp_release(struct Scsi_Host *instance)
585} 585}
586 586
587 587
588static Scsi_Host_Template driver_template = { 588static struct scsi_host_template driver_template = {
589 .proc_name = "esp-oktagon", 589 .proc_name = "esp-oktagon",
590 .proc_info = &esp_proc_info, 590 .proc_info = &esp_proc_info,
591 .name = "BSC Oktagon SCSI", 591 .name = "BSC Oktagon SCSI",
diff --git a/drivers/scsi/pas16.c b/drivers/scsi/pas16.c
index 72bc947e45b6..f09e94af9ade 100644
--- a/drivers/scsi/pas16.c
+++ b/drivers/scsi/pas16.c
@@ -369,7 +369,7 @@ void __init pas16_setup(char *str, int *ints)
369} 369}
370 370
371/* 371/*
372 * Function : int pas16_detect(Scsi_Host_Template * tpnt) 372 * Function : int pas16_detect(struct scsi_host_template * tpnt)
373 * 373 *
374 * Purpose : detects and initializes PAS16 controllers 374 * Purpose : detects and initializes PAS16 controllers
375 * that were autoprobed, overridden on the LILO command line, 375 * that were autoprobed, overridden on the LILO command line,
@@ -381,7 +381,7 @@ void __init pas16_setup(char *str, int *ints)
381 * 381 *
382 */ 382 */
383 383
384int __init pas16_detect(Scsi_Host_Template * tpnt) 384int __init pas16_detect(struct scsi_host_template * tpnt)
385{ 385{
386 static int current_override = 0; 386 static int current_override = 0;
387 static unsigned short current_base = 0; 387 static unsigned short current_base = 0;
@@ -615,7 +615,7 @@ static int pas16_release(struct Scsi_Host *shost)
615 return 0; 615 return 0;
616} 616}
617 617
618static Scsi_Host_Template driver_template = { 618static struct scsi_host_template driver_template = {
619 .name = "Pro Audio Spectrum-16 SCSI", 619 .name = "Pro Audio Spectrum-16 SCSI",
620 .detect = pas16_detect, 620 .detect = pas16_detect,
621 .release = pas16_release, 621 .release = pas16_release,
diff --git a/drivers/scsi/pas16.h b/drivers/scsi/pas16.h
index 65ce1cc40d9a..8dc5b1a5f5da 100644
--- a/drivers/scsi/pas16.h
+++ b/drivers/scsi/pas16.h
@@ -117,7 +117,7 @@
117static int pas16_abort(Scsi_Cmnd *); 117static int pas16_abort(Scsi_Cmnd *);
118static int pas16_biosparam(struct scsi_device *, struct block_device *, 118static int pas16_biosparam(struct scsi_device *, struct block_device *,
119 sector_t, int*); 119 sector_t, int*);
120static int pas16_detect(Scsi_Host_Template *); 120static int pas16_detect(struct scsi_host_template *);
121static int pas16_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 121static int pas16_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
122static int pas16_bus_reset(Scsi_Cmnd *); 122static int pas16_bus_reset(Scsi_Cmnd *);
123 123
diff --git a/drivers/scsi/pci2000.h b/drivers/scsi/pci2000.h
index 6c962d7dca47..0ebd8ce9e1de 100644
--- a/drivers/scsi/pci2000.h
+++ b/drivers/scsi/pci2000.h
@@ -184,7 +184,7 @@ typedef struct _INQUIRYDATA
184#endif 184#endif
185 185
186// function prototypes 186// function prototypes
187int Pci2000_Detect (Scsi_Host_Template *tpnt); 187int Pci2000_Detect (struct scsi_host_template *tpnt);
188int Pci2000_Command (Scsi_Cmnd *SCpnt); 188int Pci2000_Command (Scsi_Cmnd *SCpnt);
189int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)); 189int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *));
190int Pci2000_Abort (Scsi_Cmnd *SCpnt); 190int Pci2000_Abort (Scsi_Cmnd *SCpnt);
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 3d2f71051fe5..050ea13ff80b 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -81,7 +81,7 @@ module_param(free_ports, bool, 0);
81MODULE_PARM_DESC(free_ports, "Release IO ports after configuration? (default: 0 (=no))"); 81MODULE_PARM_DESC(free_ports, "Release IO ports after configuration? (default: 0 (=no))");
82 82
83/* /usr/src/linux/drivers/scsi/hosts.h */ 83/* /usr/src/linux/drivers/scsi/hosts.h */
84static Scsi_Host_Template nsp_driver_template = { 84static struct scsi_host_template nsp_driver_template = {
85 .proc_name = "nsp_cs", 85 .proc_name = "nsp_cs",
86 .proc_info = nsp_proc_info, 86 .proc_info = nsp_proc_info,
87 .name = "WorkBit NinjaSCSI-3/32Bi(16bit)", 87 .name = "WorkBit NinjaSCSI-3/32Bi(16bit)",
@@ -1310,7 +1310,7 @@ timer_out:
1310/*----------------------------------------------------------------*/ 1310/*----------------------------------------------------------------*/
1311/* look for ninja3 card and init if found */ 1311/* look for ninja3 card and init if found */
1312/*----------------------------------------------------------------*/ 1312/*----------------------------------------------------------------*/
1313static struct Scsi_Host *nsp_detect(Scsi_Host_Template *sht) 1313static struct Scsi_Host *nsp_detect(struct scsi_host_template *sht)
1314{ 1314{
1315 struct Scsi_Host *host; /* registered host structure */ 1315 struct Scsi_Host *host; /* registered host structure */
1316 nsp_hw_data *data_b = &nsp_data_base, *data; 1316 nsp_hw_data *data_b = &nsp_data_base, *data;
@@ -1358,7 +1358,7 @@ static struct Scsi_Host *nsp_detect(Scsi_Host_Template *sht)
1358} 1358}
1359 1359
1360#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 1360#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
1361static int nsp_detect_old(Scsi_Host_Template *sht) 1361static int nsp_detect_old(struct scsi_host_template *sht)
1362{ 1362{
1363 if (nsp_detect(sht) == NULL) { 1363 if (nsp_detect(sht) == NULL) {
1364 return 0; 1364 return 0;
@@ -1717,7 +1717,7 @@ static void nsp_cs_config(dev_link_t *link)
1717 struct Scsi_Host *host; 1717 struct Scsi_Host *host;
1718 nsp_hw_data *data = &nsp_data_base; 1718 nsp_hw_data *data = &nsp_data_base;
1719#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,74)) 1719#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,74))
1720 Scsi_Device *dev; 1720 struct scsi_device *dev;
1721 dev_node_t **tail, *node; 1721 dev_node_t **tail, *node;
1722#endif 1722#endif
1723 1723
diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h
index c201b52e063a..f8b943082717 100644
--- a/drivers/scsi/pcmcia/nsp_cs.h
+++ b/drivers/scsi/pcmcia/nsp_cs.h
@@ -303,9 +303,9 @@ static void nsp_cs_config (dev_link_t *link);
303static int nsp_cs_event (event_t event, int priority, event_callback_args_t *args); 303static int nsp_cs_event (event_t event, int priority, event_callback_args_t *args);
304 304
305/* Linux SCSI subsystem specific functions */ 305/* Linux SCSI subsystem specific functions */
306static struct Scsi_Host *nsp_detect (Scsi_Host_Template *sht); 306static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht);
307#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 307#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
308static int nsp_detect_old (Scsi_Host_Template *sht); 308static int nsp_detect_old (struct scsi_host_template *sht);
309static int nsp_release_old(struct Scsi_Host *shpnt); 309static int nsp_release_old(struct Scsi_Host *shpnt);
310#endif 310#endif
311static const char *nsp_info (struct Scsi_Host *shpnt); 311static const char *nsp_info (struct Scsi_Host *shpnt);
@@ -345,7 +345,7 @@ static int nsp_expect_signal (Scsi_Cmnd *SCpnt, unsigned char current_phase,
345static int nsp_xfer (Scsi_Cmnd *SCpnt, int phase); 345static int nsp_xfer (Scsi_Cmnd *SCpnt, int phase);
346static int nsp_dataphase_bypass (Scsi_Cmnd *SCpnt); 346static int nsp_dataphase_bypass (Scsi_Cmnd *SCpnt);
347static int nsp_reselected (Scsi_Cmnd *SCpnt); 347static int nsp_reselected (Scsi_Cmnd *SCpnt);
348static struct Scsi_Host *nsp_detect(Scsi_Host_Template *sht); 348static struct Scsi_Host *nsp_detect(struct scsi_host_template *sht);
349 349
350/* Interrupt handler */ 350/* Interrupt handler */
351//static irqreturn_t nspintr(int irq, void *dev_id, struct pt_regs *regs); 351//static irqreturn_t nspintr(int irq, void *dev_id, struct pt_regs *regs);
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 7a516f35834e..bb091a45a880 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -72,7 +72,7 @@ static char *version = "qlogic_cs.c 1.79-ac 2002/10/26 (David Hinds)";
72#define DEBUG(n, args...) 72#define DEBUG(n, args...)
73#endif 73#endif
74 74
75static Scsi_Host_Template qlogicfas_driver_template = { 75static struct scsi_host_template qlogicfas_driver_template = {
76 .module = THIS_MODULE, 76 .module = THIS_MODULE,
77 .name = qlogic_name, 77 .name = qlogic_name,
78 .proc_name = qlogic_name, 78 .proc_name = qlogic_name,
@@ -108,7 +108,7 @@ static dev_link_t *dev_list = NULL;
108 108
109static dev_info_t dev_info = "qlogic_cs"; 109static dev_info_t dev_info = "qlogic_cs";
110 110
111static struct Scsi_Host *qlogic_detect(Scsi_Host_Template *host, 111static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host,
112 dev_link_t *link, int qbase, int qlirq) 112 dev_link_t *link, int qbase, int qlirq)
113{ 113{
114 int qltyp; /* type of chip */ 114 int qltyp; /* type of chip */
diff --git a/drivers/scsi/pdc_adma.c b/drivers/scsi/pdc_adma.c
index 78b4ff117af6..f557f17ca00c 100644
--- a/drivers/scsi/pdc_adma.c
+++ b/drivers/scsi/pdc_adma.c
@@ -190,7 +190,7 @@ static struct ata_port_info adma_port_info[] = {
190 }, 190 },
191}; 191};
192 192
193static struct pci_device_id adma_ata_pci_tbl[] = { 193static const struct pci_device_id adma_ata_pci_tbl[] = {
194 { PCI_VENDOR_ID_PDC, 0x1841, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 194 { PCI_VENDOR_ID_PDC, 0x1841, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
195 board_1841_idx }, 195 board_1841_idx },
196 196
diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c
index c89da7d5b6df..46624ab9c3d2 100644
--- a/drivers/scsi/pluto.c
+++ b/drivers/scsi/pluto.c
@@ -71,7 +71,7 @@ static void __init pluto_detect_scsi_done(Scsi_Cmnd *SCpnt)
71 up(&fc_sem); 71 up(&fc_sem);
72} 72}
73 73
74int pluto_slave_configure(Scsi_Device *device) 74int pluto_slave_configure(struct scsi_device *device)
75{ 75{
76 int depth_to_use; 76 int depth_to_use;
77 77
@@ -90,11 +90,11 @@ int pluto_slave_configure(Scsi_Device *device)
90 90
91/* Detect all SSAs attached to the machine. 91/* Detect all SSAs attached to the machine.
92 To be fast, do it on all online FC channels at the same time. */ 92 To be fast, do it on all online FC channels at the same time. */
93int __init pluto_detect(Scsi_Host_Template *tpnt) 93int __init pluto_detect(struct scsi_host_template *tpnt)
94{ 94{
95 int i, retry, nplutos; 95 int i, retry, nplutos;
96 fc_channel *fc; 96 fc_channel *fc;
97 Scsi_Device dev; 97 struct scsi_device dev;
98 DEFINE_TIMER(fc_timer, pluto_detect_timeout, 0, 0); 98 DEFINE_TIMER(fc_timer, pluto_detect_timeout, 0, 0);
99 99
100 tpnt->proc_name = "pluto"; 100 tpnt->proc_name = "pluto";
@@ -339,7 +339,7 @@ static int pluto_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cm
339 return 0; 339 return 0;
340} 340}
341 341
342static Scsi_Host_Template driver_template = { 342static struct scsi_host_template driver_template = {
343 .name = "Sparc Storage Array 100/200", 343 .name = "Sparc Storage Array 100/200",
344 .detect = pluto_detect, 344 .detect = pluto_detect,
345 .release = pluto_release, 345 .release = pluto_release,
diff --git a/drivers/scsi/pluto.h b/drivers/scsi/pluto.h
index beb844aafccd..5da20616ac36 100644
--- a/drivers/scsi/pluto.h
+++ b/drivers/scsi/pluto.h
@@ -38,10 +38,10 @@ struct pluto_inquiry {
38/* This is the max number of outstanding SCSI commands per pluto */ 38/* This is the max number of outstanding SCSI commands per pluto */
39#define PLUTO_CAN_QUEUE 254 39#define PLUTO_CAN_QUEUE 254
40 40
41int pluto_detect(Scsi_Host_Template *); 41int pluto_detect(struct scsi_host_template *);
42int pluto_release(struct Scsi_Host *); 42int pluto_release(struct Scsi_Host *);
43const char * pluto_info(struct Scsi_Host *); 43const char * pluto_info(struct Scsi_Host *);
44int pluto_slave_configure(Scsi_Device *); 44int pluto_slave_configure(struct scsi_device *);
45 45
46#endif /* !(_PLUTO_H) */ 46#endif /* !(_PLUTO_H) */
47 47
diff --git a/drivers/scsi/psi240i.c b/drivers/scsi/psi240i.c
index 4322c95c995c..5c2cdf523c3b 100644
--- a/drivers/scsi/psi240i.c
+++ b/drivers/scsi/psi240i.c
@@ -538,7 +538,7 @@ static void ReadChipMemory (void *pdata, USHORT base, USHORT length, USHORT port
538 * Returns: Number of adapters found. 538 * Returns: Number of adapters found.
539 * 539 *
540 ****************************************************************/ 540 ****************************************************************/
541static int Psi240i_Detect (Scsi_Host_Template *tpnt) 541static int Psi240i_Detect (struct scsi_host_template *tpnt)
542 { 542 {
543 int board; 543 int board;
544 int count = 0; 544 int count = 0;
@@ -669,7 +669,7 @@ static int Psi240i_BiosParam (struct scsi_device *sdev, struct block_device *dev
669 669
670MODULE_LICENSE("GPL"); 670MODULE_LICENSE("GPL");
671 671
672static Scsi_Host_Template driver_template = { 672static struct scsi_host_template driver_template = {
673 .proc_name = "psi240i", 673 .proc_name = "psi240i",
674 .name = "PSI-240I EIDE Disk Controller", 674 .name = "PSI-240I EIDE Disk Controller",
675 .detect = Psi240i_Detect, 675 .detect = Psi240i_Detect,
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 637fb6565d28..0878f95b5449 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -465,7 +465,7 @@ scsi_adjust_queue_depth(struct scsi_device *device, int tag, int depth)
465 } 465 }
466 device->queue_depth = depth; 466 device->queue_depth = depth;
467} 467}
468static inline struct Scsi_Host *scsi_host_alloc(Scsi_Host_Template *t, size_t s) 468static inline struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *t, size_t s)
469{ 469{
470 return scsi_register(t, s); 470 return scsi_register(t, s);
471} 471}
@@ -639,10 +639,8 @@ struct qla_boards {
639static struct pci_device_id qla1280_pci_tbl[] = { 639static struct pci_device_id qla1280_pci_tbl[] = {
640 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP12160, 640 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP12160,
641 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 641 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
642#ifdef CONFIG_SCSI_QLOGIC_1280_1040
643 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1020, 642 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1020,
644 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 643 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
645#endif
646 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1080, 644 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1080,
647 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, 645 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
648 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1240, 646 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1240,
@@ -1177,7 +1175,7 @@ qla1280_biosparam(struct scsi_device *sdev, struct block_device *bdev,
1177 1175
1178#if LINUX_VERSION_CODE < 0x020600 1176#if LINUX_VERSION_CODE < 0x020600
1179static int 1177static int
1180qla1280_detect(Scsi_Host_Template *template) 1178qla1280_detect(struct scsi_host_template *template)
1181{ 1179{
1182 struct pci_device_id *id = &qla1280_pci_tbl[0]; 1180 struct pci_device_id *id = &qla1280_pci_tbl[0];
1183 struct pci_dev *pdev = NULL; 1181 struct pci_dev *pdev = NULL;
@@ -4507,7 +4505,7 @@ static struct scsi_host_template qla1280_driver_template = {
4507 .use_clustering = ENABLE_CLUSTERING, 4505 .use_clustering = ENABLE_CLUSTERING,
4508}; 4506};
4509#else 4507#else
4510static Scsi_Host_Template qla1280_driver_template = { 4508static struct scsi_host_template qla1280_driver_template = {
4511 .proc_name = "qla1280", 4509 .proc_name = "qla1280",
4512 .name = "Qlogic ISP 1280/12160", 4510 .name = "Qlogic ISP 1280/12160",
4513 .detect = qla1280_detect, 4511 .detect = qla1280_detect,
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 89793c1c06b1..5c5d2315cfab 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -970,7 +970,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
970 int rval; 970 int rval;
971 uint32_t cnt, timer; 971 uint32_t cnt, timer;
972 uint32_t risc_address; 972 uint32_t risc_address;
973 uint16_t mb[4]; 973 uint16_t mb[4], wd;
974 974
975 uint32_t stat; 975 uint32_t stat;
976 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 976 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
@@ -1514,10 +1514,10 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
1514 1514
1515 WRT_REG_DWORD(&reg->ctrl_status, 1515 WRT_REG_DWORD(&reg->ctrl_status,
1516 CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES); 1516 CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES);
1517 RD_REG_DWORD(&reg->ctrl_status); 1517 pci_read_config_word(ha->pdev, PCI_COMMAND, &wd);
1518 1518
1519 udelay(100);
1519 /* Wait for firmware to complete NVRAM accesses. */ 1520 /* Wait for firmware to complete NVRAM accesses. */
1520 udelay(5);
1521 mb[0] = (uint32_t) RD_REG_WORD(&reg->mailbox0); 1521 mb[0] = (uint32_t) RD_REG_WORD(&reg->mailbox0);
1522 for (cnt = 10000 ; cnt && mb[0]; cnt--) { 1522 for (cnt = 10000 ; cnt && mb[0]; cnt--) {
1523 udelay(5); 1523 udelay(5);
@@ -1525,7 +1525,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
1525 barrier(); 1525 barrier();
1526 } 1526 }
1527 1527
1528 udelay(20); 1528 /* Wait for soft-reset to complete. */
1529 for (cnt = 0; cnt < 30000; cnt++) { 1529 for (cnt = 0; cnt < 30000; cnt++) {
1530 if ((RD_REG_DWORD(&reg->ctrl_status) & 1530 if ((RD_REG_DWORD(&reg->ctrl_status) &
1531 CSRX_ISP_SOFT_RESET) == 0) 1531 CSRX_ISP_SOFT_RESET) == 0)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 72d9090df3df..2d720121a0d3 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -147,8 +147,8 @@ check_fw_ready_again:
147 * LIP to complete 147 * LIP to complete
148 */ 148 */
149 149
150 if (atomic_read(&ha->loop_state) == 150 if (atomic_read(&ha->loop_state) !=
151 LOOP_DOWN && retry--) { 151 LOOP_READY && retry--) {
152 goto check_fw_ready_again; 152 goto check_fw_ready_again;
153 } 153 }
154 wait_time--; 154 wait_time--;
@@ -567,6 +567,7 @@ qla24xx_reset_risc(scsi_qla_host_t *ha)
567 unsigned long flags = 0; 567 unsigned long flags = 0;
568 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 568 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
569 uint32_t cnt, d2; 569 uint32_t cnt, d2;
570 uint16_t wd;
570 571
571 spin_lock_irqsave(&ha->hardware_lock, flags); 572 spin_lock_irqsave(&ha->hardware_lock, flags);
572 573
@@ -581,10 +582,10 @@ qla24xx_reset_risc(scsi_qla_host_t *ha)
581 582
582 WRT_REG_DWORD(&reg->ctrl_status, 583 WRT_REG_DWORD(&reg->ctrl_status,
583 CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES); 584 CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES);
584 RD_REG_DWORD(&reg->ctrl_status); 585 pci_read_config_word(ha->pdev, PCI_COMMAND, &wd);
585 586
587 udelay(100);
586 /* Wait for firmware to complete NVRAM accesses. */ 588 /* Wait for firmware to complete NVRAM accesses. */
587 udelay(5);
588 d2 = (uint32_t) RD_REG_WORD(&reg->mailbox0); 589 d2 = (uint32_t) RD_REG_WORD(&reg->mailbox0);
589 for (cnt = 10000 ; cnt && d2; cnt--) { 590 for (cnt = 10000 ; cnt && d2; cnt--) {
590 udelay(5); 591 udelay(5);
@@ -592,7 +593,7 @@ qla24xx_reset_risc(scsi_qla_host_t *ha)
592 barrier(); 593 barrier();
593 } 594 }
594 595
595 udelay(20); 596 /* Wait for soft-reset to complete. */
596 d2 = RD_REG_DWORD(&reg->ctrl_status); 597 d2 = RD_REG_DWORD(&reg->ctrl_status);
597 for (cnt = 6000000 ; cnt && (d2 & CSRX_ISP_SOFT_RESET); cnt--) { 598 for (cnt = 6000000 ; cnt && (d2 & CSRX_ISP_SOFT_RESET); cnt--) {
598 udelay(5); 599 udelay(5);
@@ -1258,9 +1259,15 @@ qla2x00_configure_hba(scsi_qla_host_t *ha)
1258 rval = qla2x00_get_adapter_id(ha, 1259 rval = qla2x00_get_adapter_id(ha,
1259 &loop_id, &al_pa, &area, &domain, &topo); 1260 &loop_id, &al_pa, &area, &domain, &topo);
1260 if (rval != QLA_SUCCESS) { 1261 if (rval != QLA_SUCCESS) {
1261 qla_printk(KERN_WARNING, ha, 1262 if (LOOP_NOT_READY(ha) || atomic_read(&ha->loop_down_timer) ||
1262 "ERROR -- Unable to get host loop ID.\n"); 1263 (rval == QLA_COMMAND_ERROR && loop_id == 0x7)) {
1263 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); 1264 DEBUG2(printk("%s(%ld) Loop is in a transition state\n",
1265 __func__, ha->host_no));
1266 } else {
1267 qla_printk(KERN_WARNING, ha,
1268 "ERROR -- Unable to get host loop ID.\n");
1269 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
1270 }
1264 return (rval); 1271 return (rval);
1265 } 1272 }
1266 1273
@@ -1789,7 +1796,7 @@ qla2x00_configure_loop(scsi_qla_host_t *ha)
1789 } 1796 }
1790 1797
1791 if (rval == QLA_SUCCESS && test_bit(RSCN_UPDATE, &flags)) { 1798 if (rval == QLA_SUCCESS && test_bit(RSCN_UPDATE, &flags)) {
1792 if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) { 1799 if (LOOP_NOT_READY(ha)) {
1793 rval = QLA_FUNCTION_FAILED; 1800 rval = QLA_FUNCTION_FAILED;
1794 } else { 1801 } else {
1795 rval = qla2x00_configure_fabric(ha); 1802 rval = qla2x00_configure_fabric(ha);
@@ -2362,8 +2369,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
2362 if (qla2x00_is_reserved_id(ha, loop_id)) 2369 if (qla2x00_is_reserved_id(ha, loop_id))
2363 continue; 2370 continue;
2364 2371
2365 if (atomic_read(&ha->loop_down_timer) || 2372 if (atomic_read(&ha->loop_down_timer) || LOOP_NOT_READY(ha))
2366 test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))
2367 break; 2373 break;
2368 2374
2369 if (swl != NULL) { 2375 if (swl != NULL) {
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index ad3cacb9192d..9746cd1e664b 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -868,10 +868,6 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp)
868 DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no);) 868 DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no);)
869 869
870 fcport = sp->fcport; 870 fcport = sp->fcport;
871 if (atomic_read(&ha->loop_state) == LOOP_DOWN ||
872 atomic_read(&fcport->state) == FCS_DEVICE_LOST) {
873 return 1;
874 }
875 871
876 spin_lock_irqsave(&ha->hardware_lock, flags); 872 spin_lock_irqsave(&ha->hardware_lock, flags);
877 for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { 873 for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) {
@@ -1008,6 +1004,8 @@ qla2x00_get_adapter_id(scsi_qla_host_t *ha, uint16_t *id, uint8_t *al_pa,
1008 mcp->tov = 30; 1004 mcp->tov = 30;
1009 mcp->flags = 0; 1005 mcp->flags = 0;
1010 rval = qla2x00_mailbox_command(ha, mcp); 1006 rval = qla2x00_mailbox_command(ha, mcp);
1007 if (mcp->mb[0] == MBS_COMMAND_ERROR)
1008 rval = QLA_COMMAND_ERROR;
1011 1009
1012 /* Return data. */ 1010 /* Return data. */
1013 *id = mcp->mb[1]; 1011 *id = mcp->mb[1];
@@ -2179,10 +2177,6 @@ qla24xx_abort_command(scsi_qla_host_t *ha, srb_t *sp)
2179 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) 2177 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
2180 2178
2181 fcport = sp->fcport; 2179 fcport = sp->fcport;
2182 if (atomic_read(&ha->loop_state) == LOOP_DOWN ||
2183 atomic_read(&fcport->state) == FCS_DEVICE_LOST) {
2184 return QLA_FUNCTION_FAILED;
2185 }
2186 2180
2187 spin_lock_irqsave(&ha->hardware_lock, flags); 2181 spin_lock_irqsave(&ha->hardware_lock, flags);
2188 for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { 2182 for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) {
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index 4bec0b4fb6b4..d54d2a99c3d3 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -126,6 +126,7 @@ qla2x00_write_nvram_word(scsi_qla_host_t *ha, uint32_t addr, uint16_t data)
126 126
127 /* Wait for NVRAM to become ready */ 127 /* Wait for NVRAM to become ready */
128 WRT_REG_WORD(&reg->nvram, NVR_SELECT); 128 WRT_REG_WORD(&reg->nvram, NVR_SELECT);
129 RD_REG_WORD(&reg->nvram); /* PCI Posting. */
129 do { 130 do {
130 NVRAM_DELAY(); 131 NVRAM_DELAY();
131 word = RD_REG_WORD(&reg->nvram); 132 word = RD_REG_WORD(&reg->nvram);
@@ -178,6 +179,7 @@ qla2x00_write_nvram_word_tmo(scsi_qla_host_t *ha, uint32_t addr, uint16_t data,
178 179
179 /* Wait for NVRAM to become ready */ 180 /* Wait for NVRAM to become ready */
180 WRT_REG_WORD(&reg->nvram, NVR_SELECT); 181 WRT_REG_WORD(&reg->nvram, NVR_SELECT);
182 RD_REG_WORD(&reg->nvram); /* PCI Posting. */
181 do { 183 do {
182 NVRAM_DELAY(); 184 NVRAM_DELAY();
183 word = RD_REG_WORD(&reg->nvram); 185 word = RD_REG_WORD(&reg->nvram);
@@ -235,6 +237,7 @@ qla2x00_nvram_request(scsi_qla_host_t *ha, uint32_t nv_cmd)
235 /* Read data from NVRAM. */ 237 /* Read data from NVRAM. */
236 for (cnt = 0; cnt < 16; cnt++) { 238 for (cnt = 0; cnt < 16; cnt++) {
237 WRT_REG_WORD(&reg->nvram, NVR_SELECT | NVR_CLOCK); 239 WRT_REG_WORD(&reg->nvram, NVR_SELECT | NVR_CLOCK);
240 RD_REG_WORD(&reg->nvram); /* PCI Posting. */
238 NVRAM_DELAY(); 241 NVRAM_DELAY();
239 data <<= 1; 242 data <<= 1;
240 reg_data = RD_REG_WORD(&reg->nvram); 243 reg_data = RD_REG_WORD(&reg->nvram);
@@ -337,6 +340,7 @@ qla2x00_clear_nvram_protection(scsi_qla_host_t *ha)
337 340
338 /* Wait for NVRAM to become ready. */ 341 /* Wait for NVRAM to become ready. */
339 WRT_REG_WORD(&reg->nvram, NVR_SELECT); 342 WRT_REG_WORD(&reg->nvram, NVR_SELECT);
343 RD_REG_WORD(&reg->nvram); /* PCI Posting. */
340 do { 344 do {
341 NVRAM_DELAY(); 345 NVRAM_DELAY();
342 word = RD_REG_WORD(&reg->nvram); 346 word = RD_REG_WORD(&reg->nvram);
@@ -388,6 +392,7 @@ qla2x00_set_nvram_protection(scsi_qla_host_t *ha, int stat)
388 392
389 /* Wait for NVRAM to become ready. */ 393 /* Wait for NVRAM to become ready. */
390 WRT_REG_WORD(&reg->nvram, NVR_SELECT); 394 WRT_REG_WORD(&reg->nvram, NVR_SELECT);
395 RD_REG_WORD(&reg->nvram); /* PCI Posting. */
391 do { 396 do {
392 NVRAM_DELAY(); 397 NVRAM_DELAY();
393 word = RD_REG_WORD(&reg->nvram); 398 word = RD_REG_WORD(&reg->nvram);
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index 0d5472f2f59b..f7937f7f9c68 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -7,9 +7,9 @@
7/* 7/*
8 * Driver version 8 * Driver version
9 */ 9 */
10#define QLA2XXX_VERSION "8.01.00-k" 10#define QLA2XXX_VERSION "8.01.03-k"
11 11
12#define QLA_DRIVER_MAJOR_VER 8 12#define QLA_DRIVER_MAJOR_VER 8
13#define QLA_DRIVER_MINOR_VER 1 13#define QLA_DRIVER_MINOR_VER 1
14#define QLA_DRIVER_PATCH_VER 0 14#define QLA_DRIVER_PATCH_VER 3
15#define QLA_DRIVER_BETA_VER 0 15#define QLA_DRIVER_BETA_VER 0
diff --git a/drivers/scsi/qlogicfas.c b/drivers/scsi/qlogicfas.c
index 55e698b651d6..94baca840efe 100644
--- a/drivers/scsi/qlogicfas.c
+++ b/drivers/scsi/qlogicfas.c
@@ -47,7 +47,7 @@ static char qlogicfas_name[] = "qlogicfas";
47 * Look for qlogic card and init if found 47 * Look for qlogic card and init if found
48 */ 48 */
49 49
50static struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host, 50static struct Scsi_Host *__qlogicfas_detect(struct scsi_host_template *host,
51 int qbase, 51 int qbase,
52 int qlirq) 52 int qlirq)
53{ 53{
@@ -142,7 +142,7 @@ module_param_array(irq, int, NULL, 0);
142MODULE_PARM_DESC(iobase, "I/O address"); 142MODULE_PARM_DESC(iobase, "I/O address");
143MODULE_PARM_DESC(irq, "IRQ"); 143MODULE_PARM_DESC(irq, "IRQ");
144 144
145static int __devinit qlogicfas_detect(Scsi_Host_Template *sht) 145static int __devinit qlogicfas_detect(struct scsi_host_template *sht)
146{ 146{
147 struct Scsi_Host *shost; 147 struct Scsi_Host *shost;
148 struct qlogicfas408_priv *priv; 148 struct qlogicfas408_priv *priv;
@@ -183,7 +183,7 @@ static int qlogicfas_release(struct Scsi_Host *shost)
183/* 183/*
184 * The driver template is also needed for PCMCIA 184 * The driver template is also needed for PCMCIA
185 */ 185 */
186static Scsi_Host_Template qlogicfas_driver_template = { 186static struct scsi_host_template qlogicfas_driver_template = {
187 .module = THIS_MODULE, 187 .module = THIS_MODULE,
188 .name = qlogicfas_name, 188 .name = qlogicfas_name,
189 .proc_name = qlogicfas_name, 189 .proc_name = qlogicfas_name,
diff --git a/drivers/scsi/qlogicfc.c b/drivers/scsi/qlogicfc.c
index a4b3b3fd4815..94ef3f08d378 100644
--- a/drivers/scsi/qlogicfc.c
+++ b/drivers/scsi/qlogicfc.c
@@ -711,7 +711,7 @@ static inline void isp2x00_disable_irqs(struct Scsi_Host *host)
711} 711}
712 712
713 713
714static int isp2x00_detect(Scsi_Host_Template * tmpt) 714static int isp2x00_detect(struct scsi_host_template * tmpt)
715{ 715{
716 int hosts = 0; 716 int hosts = 0;
717 unsigned long wait_time; 717 unsigned long wait_time;
@@ -2210,7 +2210,7 @@ void isp2x00_print_scsi_cmd(Scsi_Cmnd * cmd)
2210 2210
2211MODULE_LICENSE("GPL"); 2211MODULE_LICENSE("GPL");
2212 2212
2213static Scsi_Host_Template driver_template = { 2213static struct scsi_host_template driver_template = {
2214 .detect = isp2x00_detect, 2214 .detect = isp2x00_detect,
2215 .release = isp2x00_release, 2215 .release = isp2x00_release,
2216 .info = isp2x00_info, 2216 .info = isp2x00_info,
diff --git a/drivers/scsi/qlogicisp.c b/drivers/scsi/qlogicisp.c
deleted file mode 100644
index 6c9266b8ffdf..000000000000
--- a/drivers/scsi/qlogicisp.c
+++ /dev/null
@@ -1,1934 +0,0 @@
1/*
2 * QLogic ISP1020 Intelligent SCSI Processor Driver (PCI)
3 * Written by Erik H. Moe, ehm@cris.com
4 * Copyright 1995, Erik H. Moe
5 * Copyright 1996, 1997 Michael A. Griffith <grif@acm.org>
6 * Copyright 2000, Jayson C. Vantuyl <vantuyl@csc.smsu.edu>
7 * and Bryon W. Roche <bryon@csc.smsu.edu>
8 *
9 * 64-bit addressing added by Kanoj Sarcar <kanoj@sgi.com>
10 * and Leo Dagum <dagum@sgi.com>
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2, or (at your option) any
15 * later version.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 */
22
23#include <linux/blkdev.h>
24#include <linux/config.h>
25#include <linux/kernel.h>
26#include <linux/string.h>
27#include <linux/ioport.h>
28#include <linux/sched.h>
29#include <linux/types.h>
30#include <linux/pci.h>
31#include <linux/delay.h>
32#include <linux/unistd.h>
33#include <linux/spinlock.h>
34#include <linux/interrupt.h>
35#include <asm/io.h>
36#include <asm/irq.h>
37#include <asm/byteorder.h>
38#include "scsi.h"
39#include <scsi/scsi_host.h>
40
41/*
42 * With the qlogic interface, every queue slot can hold a SCSI
43 * command with up to 4 scatter/gather entries. If we need more
44 * than 4 entries, continuation entries can be used that hold
45 * another 7 entries each. Unlike for other drivers, this means
46 * that the maximum number of scatter/gather entries we can
47 * support at any given time is a function of the number of queue
48 * slots available. That is, host->can_queue and host->sg_tablesize
49 * are dynamic and _not_ independent. This all works fine because
50 * requests are queued serially and the scatter/gather limit is
51 * determined for each queue request anew.
52 */
53#define QLOGICISP_REQ_QUEUE_LEN 63 /* must be power of two - 1 */
54#define QLOGICISP_MAX_SG(ql) (4 + ((ql) > 0) ? 7*((ql) - 1) : 0)
55
56/* Configuration section *****************************************************/
57
58/* Set the following macro to 1 to reload the ISP1020's firmware. This is
59 the latest firmware provided by QLogic. This may be an earlier/later
60 revision than supplied by your board. */
61
62#define RELOAD_FIRMWARE 1
63
64/* Set the following macro to 1 to reload the ISP1020's defaults from nvram.
65 If you are not sure of your settings, leave this alone, the driver will
66 use a set of 'safe' defaults */
67
68#define USE_NVRAM_DEFAULTS 0
69
70/* Macros used for debugging */
71
72#define DEBUG_ISP1020 0
73#define DEBUG_ISP1020_INTR 0
74#define DEBUG_ISP1020_SETUP 0
75#define TRACE_ISP 0
76
77#define DEFAULT_LOOP_COUNT 1000000
78
79/* End Configuration section *************************************************/
80
81#include <linux/module.h>
82
83#if TRACE_ISP
84
85# define TRACE_BUF_LEN (32*1024)
86
87struct {
88 u_long next;
89 struct {
90 u_long time;
91 u_int index;
92 u_int addr;
93 u_char * name;
94 } buf[TRACE_BUF_LEN];
95} trace;
96
97#define TRACE(w, i, a) \
98{ \
99 unsigned long flags; \
100 \
101 trace.buf[trace.next].name = (w); \
102 trace.buf[trace.next].time = jiffies; \
103 trace.buf[trace.next].index = (i); \
104 trace.buf[trace.next].addr = (long) (a); \
105 trace.next = (trace.next + 1) & (TRACE_BUF_LEN - 1); \
106}
107
108#else
109# define TRACE(w, i, a)
110#endif
111
112#if DEBUG_ISP1020
113#define ENTER(x) printk("isp1020 : entering %s()\n", x);
114#define LEAVE(x) printk("isp1020 : leaving %s()\n", x);
115#define DEBUG(x) x
116#else
117#define ENTER(x)
118#define LEAVE(x)
119#define DEBUG(x)
120#endif /* DEBUG_ISP1020 */
121
122#if DEBUG_ISP1020_INTR
123#define ENTER_INTR(x) printk("isp1020 : entering %s()\n", x);
124#define LEAVE_INTR(x) printk("isp1020 : leaving %s()\n", x);
125#define DEBUG_INTR(x) x
126#else
127#define ENTER_INTR(x)
128#define LEAVE_INTR(x)
129#define DEBUG_INTR(x)
130#endif /* DEBUG ISP1020_INTR */
131
132#define ISP1020_REV_ID 1
133
134#define MAX_TARGETS 16
135#define MAX_LUNS 8
136
137/* host configuration and control registers */
138#define HOST_HCCR 0xc0 /* host command and control */
139
140/* pci bus interface registers */
141#define PCI_ID_LOW 0x00 /* vendor id */
142#define PCI_ID_HIGH 0x02 /* device id */
143#define ISP_CFG0 0x04 /* configuration register #0 */
144#define ISP_CFG0_HWMSK 0x000f /* Hardware revision mask */
145#define ISP_CFG0_1020 0x0001 /* ISP1020 */
146#define ISP_CFG0_1020A 0x0002 /* ISP1020A */
147#define ISP_CFG0_1040 0x0003 /* ISP1040 */
148#define ISP_CFG0_1040A 0x0004 /* ISP1040A */
149#define ISP_CFG0_1040B 0x0005 /* ISP1040B */
150#define ISP_CFG0_1040C 0x0006 /* ISP1040C */
151#define ISP_CFG1 0x06 /* configuration register #1 */
152#define ISP_CFG1_F128 0x0040 /* 128-byte FIFO threshold */
153#define ISP_CFG1_F64 0x0030 /* 128-byte FIFO threshold */
154#define ISP_CFG1_F32 0x0020 /* 128-byte FIFO threshold */
155#define ISP_CFG1_F16 0x0010 /* 128-byte FIFO threshold */
156#define ISP_CFG1_BENAB 0x0004 /* Global Bus burst enable */
157#define ISP_CFG1_SXP 0x0001 /* SXP register select */
158#define PCI_INTF_CTL 0x08 /* pci interface control */
159#define PCI_INTF_STS 0x0a /* pci interface status */
160#define PCI_SEMAPHORE 0x0c /* pci semaphore */
161#define PCI_NVRAM 0x0e /* pci nvram interface */
162#define CDMA_CONF 0x20 /* Command DMA Config */
163#define DDMA_CONF 0x40 /* Data DMA Config */
164#define DMA_CONF_SENAB 0x0008 /* SXP to DMA Data enable */
165#define DMA_CONF_RIRQ 0x0004 /* RISC interrupt enable */
166#define DMA_CONF_BENAB 0x0002 /* Bus burst enable */
167#define DMA_CONF_DIR 0x0001 /* DMA direction (0=fifo->host 1=host->fifo) */
168
169/* mailbox registers */
170#define MBOX0 0x70 /* mailbox 0 */
171#define MBOX1 0x72 /* mailbox 1 */
172#define MBOX2 0x74 /* mailbox 2 */
173#define MBOX3 0x76 /* mailbox 3 */
174#define MBOX4 0x78 /* mailbox 4 */
175#define MBOX5 0x7a /* mailbox 5 */
176#define MBOX6 0x7c /* mailbox 6 */
177#define MBOX7 0x7e /* mailbox 7 */
178
179/* mailbox command complete status codes */
180#define MBOX_COMMAND_COMPLETE 0x4000
181#define INVALID_COMMAND 0x4001
182#define HOST_INTERFACE_ERROR 0x4002
183#define TEST_FAILED 0x4003
184#define COMMAND_ERROR 0x4005
185#define COMMAND_PARAM_ERROR 0x4006
186
187/* async event status codes */
188#define ASYNC_SCSI_BUS_RESET 0x8001
189#define SYSTEM_ERROR 0x8002
190#define REQUEST_TRANSFER_ERROR 0x8003
191#define RESPONSE_TRANSFER_ERROR 0x8004
192#define REQUEST_QUEUE_WAKEUP 0x8005
193#define EXECUTION_TIMEOUT_RESET 0x8006
194
195#ifdef CONFIG_QL_ISP_A64
196#define IOCB_SEGS 2
197#define CONTINUATION_SEGS 5
198#define MAX_CONTINUATION_ENTRIES 254
199#else
200#define IOCB_SEGS 4
201#define CONTINUATION_SEGS 7
202#endif /* CONFIG_QL_ISP_A64 */
203
204struct Entry_header {
205 u_char entry_type;
206 u_char entry_cnt;
207 u_char sys_def_1;
208 u_char flags;
209};
210
211/* entry header type commands */
212#ifdef CONFIG_QL_ISP_A64
213#define ENTRY_COMMAND 9
214#define ENTRY_CONTINUATION 0xa
215#else
216#define ENTRY_COMMAND 1
217#define ENTRY_CONTINUATION 2
218#endif /* CONFIG_QL_ISP_A64 */
219
220#define ENTRY_STATUS 3
221#define ENTRY_MARKER 4
222#define ENTRY_EXTENDED_COMMAND 5
223
224/* entry header flag definitions */
225#define EFLAG_CONTINUATION 1
226#define EFLAG_BUSY 2
227#define EFLAG_BAD_HEADER 4
228#define EFLAG_BAD_PAYLOAD 8
229
230struct dataseg {
231 u_int d_base;
232#ifdef CONFIG_QL_ISP_A64
233 u_int d_base_hi;
234#endif
235 u_int d_count;
236};
237
238struct Command_Entry {
239 struct Entry_header hdr;
240 u_int handle;
241 u_char target_lun;
242 u_char target_id;
243 u_short cdb_length;
244 u_short control_flags;
245 u_short rsvd;
246 u_short time_out;
247 u_short segment_cnt;
248 u_char cdb[12];
249#ifdef CONFIG_QL_ISP_A64
250 u_int rsvd1;
251 u_int rsvd2;
252#endif
253 struct dataseg dataseg[IOCB_SEGS];
254};
255
256/* command entry control flag definitions */
257#define CFLAG_NODISC 0x01
258#define CFLAG_HEAD_TAG 0x02
259#define CFLAG_ORDERED_TAG 0x04
260#define CFLAG_SIMPLE_TAG 0x08
261#define CFLAG_TAR_RTN 0x10
262#define CFLAG_READ 0x20
263#define CFLAG_WRITE 0x40
264
265struct Ext_Command_Entry {
266 struct Entry_header hdr;
267 u_int handle;
268 u_char target_lun;
269 u_char target_id;
270 u_short cdb_length;
271 u_short control_flags;
272 u_short rsvd;
273 u_short time_out;
274 u_short segment_cnt;
275 u_char cdb[44];
276};
277
278struct Continuation_Entry {
279 struct Entry_header hdr;
280#ifndef CONFIG_QL_ISP_A64
281 u_int reserved;
282#endif
283 struct dataseg dataseg[CONTINUATION_SEGS];
284};
285
286struct Marker_Entry {
287 struct Entry_header hdr;
288 u_int reserved;
289 u_char target_lun;
290 u_char target_id;
291 u_char modifier;
292 u_char rsvd;
293 u_char rsvds[52];
294};
295
296/* marker entry modifier definitions */
297#define SYNC_DEVICE 0
298#define SYNC_TARGET 1
299#define SYNC_ALL 2
300
301struct Status_Entry {
302 struct Entry_header hdr;
303 u_int handle;
304 u_short scsi_status;
305 u_short completion_status;
306 u_short state_flags;
307 u_short status_flags;
308 u_short time;
309 u_short req_sense_len;
310 u_int residual;
311 u_char rsvd[8];
312 u_char req_sense_data[32];
313};
314
315/* status entry completion status definitions */
316#define CS_COMPLETE 0x0000
317#define CS_INCOMPLETE 0x0001
318#define CS_DMA_ERROR 0x0002
319#define CS_TRANSPORT_ERROR 0x0003
320#define CS_RESET_OCCURRED 0x0004
321#define CS_ABORTED 0x0005
322#define CS_TIMEOUT 0x0006
323#define CS_DATA_OVERRUN 0x0007
324#define CS_COMMAND_OVERRUN 0x0008
325#define CS_STATUS_OVERRUN 0x0009
326#define CS_BAD_MESSAGE 0x000a
327#define CS_NO_MESSAGE_OUT 0x000b
328#define CS_EXT_ID_FAILED 0x000c
329#define CS_IDE_MSG_FAILED 0x000d
330#define CS_ABORT_MSG_FAILED 0x000e
331#define CS_REJECT_MSG_FAILED 0x000f
332#define CS_NOP_MSG_FAILED 0x0010
333#define CS_PARITY_ERROR_MSG_FAILED 0x0011
334#define CS_DEVICE_RESET_MSG_FAILED 0x0012
335#define CS_ID_MSG_FAILED 0x0013
336#define CS_UNEXP_BUS_FREE 0x0014
337#define CS_DATA_UNDERRUN 0x0015
338
339/* status entry state flag definitions */
340#define SF_GOT_BUS 0x0100
341#define SF_GOT_TARGET 0x0200
342#define SF_SENT_CDB 0x0400
343#define SF_TRANSFERRED_DATA 0x0800
344#define SF_GOT_STATUS 0x1000
345#define SF_GOT_SENSE 0x2000
346
347/* status entry status flag definitions */
348#define STF_DISCONNECT 0x0001
349#define STF_SYNCHRONOUS 0x0002
350#define STF_PARITY_ERROR 0x0004
351#define STF_BUS_RESET 0x0008
352#define STF_DEVICE_RESET 0x0010
353#define STF_ABORTED 0x0020
354#define STF_TIMEOUT 0x0040
355#define STF_NEGOTIATION 0x0080
356
357/* interface control commands */
358#define ISP_RESET 0x0001
359#define ISP_EN_INT 0x0002
360#define ISP_EN_RISC 0x0004
361
362/* host control commands */
363#define HCCR_NOP 0x0000
364#define HCCR_RESET 0x1000
365#define HCCR_PAUSE 0x2000
366#define HCCR_RELEASE 0x3000
367#define HCCR_SINGLE_STEP 0x4000
368#define HCCR_SET_HOST_INTR 0x5000
369#define HCCR_CLEAR_HOST_INTR 0x6000
370#define HCCR_CLEAR_RISC_INTR 0x7000
371#define HCCR_BP_ENABLE 0x8000
372#define HCCR_BIOS_DISABLE 0x9000
373#define HCCR_TEST_MODE 0xf000
374
375#define RISC_BUSY 0x0004
376
377/* mailbox commands */
378#define MBOX_NO_OP 0x0000
379#define MBOX_LOAD_RAM 0x0001
380#define MBOX_EXEC_FIRMWARE 0x0002
381#define MBOX_DUMP_RAM 0x0003
382#define MBOX_WRITE_RAM_WORD 0x0004
383#define MBOX_READ_RAM_WORD 0x0005
384#define MBOX_MAILBOX_REG_TEST 0x0006
385#define MBOX_VERIFY_CHECKSUM 0x0007
386#define MBOX_ABOUT_FIRMWARE 0x0008
387#define MBOX_CHECK_FIRMWARE 0x000e
388#define MBOX_INIT_REQ_QUEUE 0x0010
389#define MBOX_INIT_RES_QUEUE 0x0011
390#define MBOX_EXECUTE_IOCB 0x0012
391#define MBOX_WAKE_UP 0x0013
392#define MBOX_STOP_FIRMWARE 0x0014
393#define MBOX_ABORT 0x0015
394#define MBOX_ABORT_DEVICE 0x0016
395#define MBOX_ABORT_TARGET 0x0017
396#define MBOX_BUS_RESET 0x0018
397#define MBOX_STOP_QUEUE 0x0019
398#define MBOX_START_QUEUE 0x001a
399#define MBOX_SINGLE_STEP_QUEUE 0x001b
400#define MBOX_ABORT_QUEUE 0x001c
401#define MBOX_GET_DEV_QUEUE_STATUS 0x001d
402#define MBOX_GET_FIRMWARE_STATUS 0x001f
403#define MBOX_GET_INIT_SCSI_ID 0x0020
404#define MBOX_GET_SELECT_TIMEOUT 0x0021
405#define MBOX_GET_RETRY_COUNT 0x0022
406#define MBOX_GET_TAG_AGE_LIMIT 0x0023
407#define MBOX_GET_CLOCK_RATE 0x0024
408#define MBOX_GET_ACT_NEG_STATE 0x0025
409#define MBOX_GET_ASYNC_DATA_SETUP_TIME 0x0026
410#define MBOX_GET_PCI_PARAMS 0x0027
411#define MBOX_GET_TARGET_PARAMS 0x0028
412#define MBOX_GET_DEV_QUEUE_PARAMS 0x0029
413#define MBOX_SET_INIT_SCSI_ID 0x0030
414#define MBOX_SET_SELECT_TIMEOUT 0x0031
415#define MBOX_SET_RETRY_COUNT 0x0032
416#define MBOX_SET_TAG_AGE_LIMIT 0x0033
417#define MBOX_SET_CLOCK_RATE 0x0034
418#define MBOX_SET_ACTIVE_NEG_STATE 0x0035
419#define MBOX_SET_ASYNC_DATA_SETUP_TIME 0x0036
420#define MBOX_SET_PCI_CONTROL_PARAMS 0x0037
421#define MBOX_SET_TARGET_PARAMS 0x0038
422#define MBOX_SET_DEV_QUEUE_PARAMS 0x0039
423#define MBOX_RETURN_BIOS_BLOCK_ADDR 0x0040
424#define MBOX_WRITE_FOUR_RAM_WORDS 0x0041
425#define MBOX_EXEC_BIOS_IOCB 0x0042
426
427#ifdef CONFIG_QL_ISP_A64
428#define MBOX_CMD_INIT_REQUEST_QUEUE_64 0x0052
429#define MBOX_CMD_INIT_RESPONSE_QUEUE_64 0x0053
430#endif /* CONFIG_QL_ISP_A64 */
431
432#include "qlogicisp_asm.c"
433
434#define PACKB(a, b) (((a)<<4)|(b))
435
436static const u_char mbox_param[] = {
437 PACKB(1, 1), /* MBOX_NO_OP */
438 PACKB(5, 5), /* MBOX_LOAD_RAM */
439 PACKB(2, 0), /* MBOX_EXEC_FIRMWARE */
440 PACKB(5, 5), /* MBOX_DUMP_RAM */
441 PACKB(3, 3), /* MBOX_WRITE_RAM_WORD */
442 PACKB(2, 3), /* MBOX_READ_RAM_WORD */
443 PACKB(6, 6), /* MBOX_MAILBOX_REG_TEST */
444 PACKB(2, 3), /* MBOX_VERIFY_CHECKSUM */
445 PACKB(1, 3), /* MBOX_ABOUT_FIRMWARE */
446 PACKB(0, 0), /* 0x0009 */
447 PACKB(0, 0), /* 0x000a */
448 PACKB(0, 0), /* 0x000b */
449 PACKB(0, 0), /* 0x000c */
450 PACKB(0, 0), /* 0x000d */
451 PACKB(1, 2), /* MBOX_CHECK_FIRMWARE */
452 PACKB(0, 0), /* 0x000f */
453 PACKB(5, 5), /* MBOX_INIT_REQ_QUEUE */
454 PACKB(6, 6), /* MBOX_INIT_RES_QUEUE */
455 PACKB(4, 4), /* MBOX_EXECUTE_IOCB */
456 PACKB(2, 2), /* MBOX_WAKE_UP */
457 PACKB(1, 6), /* MBOX_STOP_FIRMWARE */
458 PACKB(4, 4), /* MBOX_ABORT */
459 PACKB(2, 2), /* MBOX_ABORT_DEVICE */
460 PACKB(3, 3), /* MBOX_ABORT_TARGET */
461 PACKB(2, 2), /* MBOX_BUS_RESET */
462 PACKB(2, 3), /* MBOX_STOP_QUEUE */
463 PACKB(2, 3), /* MBOX_START_QUEUE */
464 PACKB(2, 3), /* MBOX_SINGLE_STEP_QUEUE */
465 PACKB(2, 3), /* MBOX_ABORT_QUEUE */
466 PACKB(2, 4), /* MBOX_GET_DEV_QUEUE_STATUS */
467 PACKB(0, 0), /* 0x001e */
468 PACKB(1, 3), /* MBOX_GET_FIRMWARE_STATUS */
469 PACKB(1, 2), /* MBOX_GET_INIT_SCSI_ID */
470 PACKB(1, 2), /* MBOX_GET_SELECT_TIMEOUT */
471 PACKB(1, 3), /* MBOX_GET_RETRY_COUNT */
472 PACKB(1, 2), /* MBOX_GET_TAG_AGE_LIMIT */
473 PACKB(1, 2), /* MBOX_GET_CLOCK_RATE */
474 PACKB(1, 2), /* MBOX_GET_ACT_NEG_STATE */
475 PACKB(1, 2), /* MBOX_GET_ASYNC_DATA_SETUP_TIME */
476 PACKB(1, 3), /* MBOX_GET_PCI_PARAMS */
477 PACKB(2, 4), /* MBOX_GET_TARGET_PARAMS */
478 PACKB(2, 4), /* MBOX_GET_DEV_QUEUE_PARAMS */
479 PACKB(0, 0), /* 0x002a */
480 PACKB(0, 0), /* 0x002b */
481 PACKB(0, 0), /* 0x002c */
482 PACKB(0, 0), /* 0x002d */
483 PACKB(0, 0), /* 0x002e */
484 PACKB(0, 0), /* 0x002f */
485 PACKB(2, 2), /* MBOX_SET_INIT_SCSI_ID */
486 PACKB(2, 2), /* MBOX_SET_SELECT_TIMEOUT */
487 PACKB(3, 3), /* MBOX_SET_RETRY_COUNT */
488 PACKB(2, 2), /* MBOX_SET_TAG_AGE_LIMIT */
489 PACKB(2, 2), /* MBOX_SET_CLOCK_RATE */
490 PACKB(2, 2), /* MBOX_SET_ACTIVE_NEG_STATE */
491 PACKB(2, 2), /* MBOX_SET_ASYNC_DATA_SETUP_TIME */
492 PACKB(3, 3), /* MBOX_SET_PCI_CONTROL_PARAMS */
493 PACKB(4, 4), /* MBOX_SET_TARGET_PARAMS */
494 PACKB(4, 4), /* MBOX_SET_DEV_QUEUE_PARAMS */
495 PACKB(0, 0), /* 0x003a */
496 PACKB(0, 0), /* 0x003b */
497 PACKB(0, 0), /* 0x003c */
498 PACKB(0, 0), /* 0x003d */
499 PACKB(0, 0), /* 0x003e */
500 PACKB(0, 0), /* 0x003f */
501 PACKB(1, 2), /* MBOX_RETURN_BIOS_BLOCK_ADDR */
502 PACKB(6, 1), /* MBOX_WRITE_FOUR_RAM_WORDS */
503 PACKB(2, 3) /* MBOX_EXEC_BIOS_IOCB */
504#ifdef CONFIG_QL_ISP_A64
505 ,PACKB(0, 0), /* 0x0043 */
506 PACKB(0, 0), /* 0x0044 */
507 PACKB(0, 0), /* 0x0045 */
508 PACKB(0, 0), /* 0x0046 */
509 PACKB(0, 0), /* 0x0047 */
510 PACKB(0, 0), /* 0x0048 */
511 PACKB(0, 0), /* 0x0049 */
512 PACKB(0, 0), /* 0x004a */
513 PACKB(0, 0), /* 0x004b */
514 PACKB(0, 0), /* 0x004c */
515 PACKB(0, 0), /* 0x004d */
516 PACKB(0, 0), /* 0x004e */
517 PACKB(0, 0), /* 0x004f */
518 PACKB(0, 0), /* 0x0050 */
519 PACKB(0, 0), /* 0x0051 */
520 PACKB(8, 8), /* MBOX_CMD_INIT_REQUEST_QUEUE_64 (0x0052) */
521 PACKB(8, 8) /* MBOX_CMD_INIT_RESPONSE_QUEUE_64 (0x0053) */
522#endif /* CONFIG_QL_ISP_A64 */
523};
524
525#define MAX_MBOX_COMMAND (sizeof(mbox_param)/sizeof(u_short))
526
527struct host_param {
528 u_short fifo_threshold;
529 u_short host_adapter_enable;
530 u_short initiator_scsi_id;
531 u_short bus_reset_delay;
532 u_short retry_count;
533 u_short retry_delay;
534 u_short async_data_setup_time;
535 u_short req_ack_active_negation;
536 u_short data_line_active_negation;
537 u_short data_dma_burst_enable;
538 u_short command_dma_burst_enable;
539 u_short tag_aging;
540 u_short selection_timeout;
541 u_short max_queue_depth;
542};
543
544/*
545 * Device Flags:
546 *
547 * Bit Name
548 * ---------
549 * 7 Disconnect Privilege
550 * 6 Parity Checking
551 * 5 Wide Data Transfers
552 * 4 Synchronous Data Transfers
553 * 3 Tagged Queuing
554 * 2 Automatic Request Sense
555 * 1 Stop Queue on Check Condition
556 * 0 Renegotiate on Error
557 */
558
559struct dev_param {
560 u_short device_flags;
561 u_short execution_throttle;
562 u_short synchronous_period;
563 u_short synchronous_offset;
564 u_short device_enable;
565 u_short reserved; /* pad */
566};
567
568/*
569 * The result queue can be quite a bit smaller since continuation entries
570 * do not show up there:
571 */
572#define RES_QUEUE_LEN ((QLOGICISP_REQ_QUEUE_LEN + 1) / 8 - 1)
573#define QUEUE_ENTRY_LEN 64
574#define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN)
575
576struct isp_queue_entry {
577 char __opaque[QUEUE_ENTRY_LEN];
578};
579
580struct isp1020_hostdata {
581 void __iomem *memaddr;
582 u_char revision;
583 struct host_param host_param;
584 struct dev_param dev_param[MAX_TARGETS];
585 struct pci_dev *pci_dev;
586
587 struct isp_queue_entry *res_cpu; /* CPU-side address of response queue. */
588 struct isp_queue_entry *req_cpu; /* CPU-size address of request queue. */
589
590 /* result and request queues (shared with isp1020): */
591 u_int req_in_ptr; /* index of next request slot */
592 u_int res_out_ptr; /* index of next result slot */
593
594 /* this is here so the queues are nicely aligned */
595 long send_marker; /* do we need to send a marker? */
596
597 /* The cmd->handle has a fixed size, and is only 32-bits. We
598 * need to take care to handle 64-bit systems correctly thus what
599 * we actually place in cmd->handle is an index to the following
600 * table. Kudos to Matt Jacob for the technique. -DaveM
601 */
602 Scsi_Cmnd *cmd_slots[QLOGICISP_REQ_QUEUE_LEN + 1];
603
604 dma_addr_t res_dma; /* PCI side view of response queue */
605 dma_addr_t req_dma; /* PCI side view of request queue */
606};
607
608/* queue length's _must_ be power of two: */
609#define QUEUE_DEPTH(in, out, ql) ((in - out) & (ql))
610#define REQ_QUEUE_DEPTH(in, out) QUEUE_DEPTH(in, out, \
611 QLOGICISP_REQ_QUEUE_LEN)
612#define RES_QUEUE_DEPTH(in, out) QUEUE_DEPTH(in, out, RES_QUEUE_LEN)
613
614static void isp1020_enable_irqs(struct Scsi_Host *);
615static void isp1020_disable_irqs(struct Scsi_Host *);
616static int isp1020_init(struct Scsi_Host *);
617static int isp1020_reset_hardware(struct Scsi_Host *);
618static int isp1020_set_defaults(struct Scsi_Host *);
619static int isp1020_load_parameters(struct Scsi_Host *);
620static int isp1020_mbox_command(struct Scsi_Host *, u_short []);
621static int isp1020_return_status(struct Status_Entry *);
622static void isp1020_intr_handler(int, void *, struct pt_regs *);
623static irqreturn_t do_isp1020_intr_handler(int, void *, struct pt_regs *);
624
625#if USE_NVRAM_DEFAULTS
626static int isp1020_get_defaults(struct Scsi_Host *);
627static int isp1020_verify_nvram(struct Scsi_Host *);
628static u_short isp1020_read_nvram_word(struct Scsi_Host *, u_short);
629#endif
630
631#if DEBUG_ISP1020
632static void isp1020_print_scsi_cmd(Scsi_Cmnd *);
633#endif
634#if DEBUG_ISP1020_INTR
635static void isp1020_print_status_entry(struct Status_Entry *);
636#endif
637
638/* memaddr should be used to determine if memmapped port i/o is being used
639 * non-null memaddr == mmap'd
640 * JV 7-Jan-2000
641 */
642static inline u_short isp_inw(struct Scsi_Host *host, long offset)
643{
644 struct isp1020_hostdata *h = (struct isp1020_hostdata *)host->hostdata;
645 if (h->memaddr)
646 return readw(h->memaddr + offset);
647 else
648 return inw(host->io_port + offset);
649}
650
651static inline void isp_outw(u_short val, struct Scsi_Host *host, long offset)
652{
653 struct isp1020_hostdata *h = (struct isp1020_hostdata *)host->hostdata;
654 if (h->memaddr)
655 writew(val, h->memaddr + offset);
656 else
657 outw(val, host->io_port + offset);
658}
659
660static inline void isp1020_enable_irqs(struct Scsi_Host *host)
661{
662 isp_outw(ISP_EN_INT|ISP_EN_RISC, host, PCI_INTF_CTL);
663}
664
665
666static inline void isp1020_disable_irqs(struct Scsi_Host *host)
667{
668 isp_outw(0x0, host, PCI_INTF_CTL);
669}
670
671
672static int isp1020_detect(Scsi_Host_Template *tmpt)
673{
674 int hosts = 0;
675 struct Scsi_Host *host;
676 struct isp1020_hostdata *hostdata;
677 struct pci_dev *pdev = NULL;
678
679 ENTER("isp1020_detect");
680
681 tmpt->proc_name = "isp1020";
682
683 while ((pdev = pci_find_device(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1020, pdev)))
684 {
685 if (pci_enable_device(pdev))
686 continue;
687
688 host = scsi_register(tmpt, sizeof(struct isp1020_hostdata));
689 if (!host)
690 continue;
691
692 hostdata = (struct isp1020_hostdata *) host->hostdata;
693
694 memset(hostdata, 0, sizeof(struct isp1020_hostdata));
695
696 hostdata->pci_dev = pdev;
697
698 if (isp1020_init(host))
699 goto fail_and_unregister;
700
701 if (isp1020_reset_hardware(host)
702#if USE_NVRAM_DEFAULTS
703 || isp1020_get_defaults(host)
704#else
705 || isp1020_set_defaults(host)
706#endif /* USE_NVRAM_DEFAULTS */
707 || isp1020_load_parameters(host)) {
708 goto fail_uninit;
709 }
710
711 host->this_id = hostdata->host_param.initiator_scsi_id;
712 host->max_sectors = 64;
713
714 if (request_irq(host->irq, do_isp1020_intr_handler, SA_INTERRUPT | SA_SHIRQ,
715 "qlogicisp", host))
716 {
717 printk("qlogicisp : interrupt %d already in use\n",
718 host->irq);
719 goto fail_uninit;
720 }
721
722 isp_outw(0x0, host, PCI_SEMAPHORE);
723 isp_outw(HCCR_CLEAR_RISC_INTR, host, HOST_HCCR);
724 isp1020_enable_irqs(host);
725
726 hosts++;
727 continue;
728
729 fail_uninit:
730 iounmap(hostdata->memaddr);
731 release_region(host->io_port, 0xff);
732 fail_and_unregister:
733 if (hostdata->res_cpu)
734 pci_free_consistent(hostdata->pci_dev,
735 QSIZE(RES_QUEUE_LEN),
736 hostdata->res_cpu,
737 hostdata->res_dma);
738 if (hostdata->req_cpu)
739 pci_free_consistent(hostdata->pci_dev,
740 QSIZE(QLOGICISP_REQ_QUEUE_LEN),
741 hostdata->req_cpu,
742 hostdata->req_dma);
743 scsi_unregister(host);
744 }
745
746 LEAVE("isp1020_detect");
747
748 return hosts;
749}
750
751
752static int isp1020_release(struct Scsi_Host *host)
753{
754 struct isp1020_hostdata *hostdata;
755
756 ENTER("isp1020_release");
757
758 hostdata = (struct isp1020_hostdata *) host->hostdata;
759
760 isp_outw(0x0, host, PCI_INTF_CTL);
761 free_irq(host->irq, host);
762
763 iounmap(hostdata->memaddr);
764
765 release_region(host->io_port, 0xff);
766
767 LEAVE("isp1020_release");
768
769 return 0;
770}
771
772
773static const char *isp1020_info(struct Scsi_Host *host)
774{
775 static char buf[80];
776 struct isp1020_hostdata *hostdata;
777
778 ENTER("isp1020_info");
779
780 hostdata = (struct isp1020_hostdata *) host->hostdata;
781 sprintf(buf,
782 "QLogic ISP1020 SCSI on PCI bus %02x device %02x irq %d %s base 0x%lx",
783 hostdata->pci_dev->bus->number, hostdata->pci_dev->devfn, host->irq,
784 (hostdata->memaddr ? "MEM" : "I/O"),
785 (hostdata->memaddr ? (unsigned long)hostdata->memaddr : host->io_port));
786
787 LEAVE("isp1020_info");
788
789 return buf;
790}
791
792
793/*
794 * The middle SCSI layer ensures that queuecommand never gets invoked
795 * concurrently with itself or the interrupt handler (though the
796 * interrupt handler may call this routine as part of
797 * request-completion handling).
798 */
799static int isp1020_queuecommand(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *))
800{
801 int i, n, num_free;
802 u_int in_ptr, out_ptr;
803 struct dataseg * ds;
804 struct scatterlist *sg;
805 struct Command_Entry *cmd;
806 struct Continuation_Entry *cont;
807 struct Scsi_Host *host;
808 struct isp1020_hostdata *hostdata;
809 dma_addr_t dma_addr;
810
811 ENTER("isp1020_queuecommand");
812
813 host = Cmnd->device->host;
814 hostdata = (struct isp1020_hostdata *) host->hostdata;
815 Cmnd->scsi_done = done;
816
817 DEBUG(isp1020_print_scsi_cmd(Cmnd));
818
819 out_ptr = isp_inw(host, + MBOX4);
820 in_ptr = hostdata->req_in_ptr;
821
822 DEBUG(printk("qlogicisp : request queue depth %d\n",
823 REQ_QUEUE_DEPTH(in_ptr, out_ptr)));
824
825 cmd = (struct Command_Entry *) &hostdata->req_cpu[in_ptr];
826 in_ptr = (in_ptr + 1) & QLOGICISP_REQ_QUEUE_LEN;
827 if (in_ptr == out_ptr) {
828 printk("qlogicisp : request queue overflow\n");
829 return 1;
830 }
831
832 if (hostdata->send_marker) {
833 struct Marker_Entry *marker;
834
835 TRACE("queue marker", in_ptr, 0);
836
837 DEBUG(printk("qlogicisp : adding marker entry\n"));
838 marker = (struct Marker_Entry *) cmd;
839 memset(marker, 0, sizeof(struct Marker_Entry));
840
841 marker->hdr.entry_type = ENTRY_MARKER;
842 marker->hdr.entry_cnt = 1;
843 marker->modifier = SYNC_ALL;
844
845 hostdata->send_marker = 0;
846
847 if (((in_ptr + 1) & QLOGICISP_REQ_QUEUE_LEN) == out_ptr) {
848 isp_outw(in_ptr, host, MBOX4);
849 hostdata->req_in_ptr = in_ptr;
850 printk("qlogicisp : request queue overflow\n");
851 return 1;
852 }
853 cmd = (struct Command_Entry *) &hostdata->req_cpu[in_ptr];
854 in_ptr = (in_ptr + 1) & QLOGICISP_REQ_QUEUE_LEN;
855 }
856
857 TRACE("queue command", in_ptr, Cmnd);
858
859 memset(cmd, 0, sizeof(struct Command_Entry));
860
861 cmd->hdr.entry_type = ENTRY_COMMAND;
862 cmd->hdr.entry_cnt = 1;
863
864 cmd->target_lun = Cmnd->device->lun;
865 cmd->target_id = Cmnd->device->id;
866 cmd->cdb_length = cpu_to_le16(Cmnd->cmd_len);
867 cmd->control_flags = cpu_to_le16(CFLAG_READ | CFLAG_WRITE);
868 cmd->time_out = cpu_to_le16(30);
869
870 memcpy(cmd->cdb, Cmnd->cmnd, Cmnd->cmd_len);
871
872 if (Cmnd->use_sg) {
873 int sg_count;
874
875 sg = (struct scatterlist *) Cmnd->request_buffer;
876 ds = cmd->dataseg;
877
878 sg_count = pci_map_sg(hostdata->pci_dev, sg, Cmnd->use_sg,
879 Cmnd->sc_data_direction);
880
881 cmd->segment_cnt = cpu_to_le16(sg_count);
882
883 /* fill in first four sg entries: */
884 n = sg_count;
885 if (n > IOCB_SEGS)
886 n = IOCB_SEGS;
887 for (i = 0; i < n; i++) {
888 dma_addr = sg_dma_address(sg);
889 ds[i].d_base = cpu_to_le32((u32) dma_addr);
890#ifdef CONFIG_QL_ISP_A64
891 ds[i].d_base_hi = cpu_to_le32((u32) (dma_addr>>32));
892#endif /* CONFIG_QL_ISP_A64 */
893 ds[i].d_count = cpu_to_le32(sg_dma_len(sg));
894 ++sg;
895 }
896 sg_count -= IOCB_SEGS;
897
898 while (sg_count > 0) {
899 ++cmd->hdr.entry_cnt;
900 cont = (struct Continuation_Entry *)
901 &hostdata->req_cpu[in_ptr];
902 in_ptr = (in_ptr + 1) & QLOGICISP_REQ_QUEUE_LEN;
903 if (in_ptr == out_ptr) {
904 printk("isp1020: unexpected request queue "
905 "overflow\n");
906 return 1;
907 }
908 TRACE("queue continuation", in_ptr, 0);
909 cont->hdr.entry_type = ENTRY_CONTINUATION;
910 cont->hdr.entry_cnt = 0;
911 cont->hdr.sys_def_1 = 0;
912 cont->hdr.flags = 0;
913#ifndef CONFIG_QL_ISP_A64
914 cont->reserved = 0;
915#endif
916 ds = cont->dataseg;
917 n = sg_count;
918 if (n > CONTINUATION_SEGS)
919 n = CONTINUATION_SEGS;
920 for (i = 0; i < n; ++i) {
921 dma_addr = sg_dma_address(sg);
922 ds[i].d_base = cpu_to_le32((u32) dma_addr);
923#ifdef CONFIG_QL_ISP_A64
924 ds[i].d_base_hi = cpu_to_le32((u32)(dma_addr>>32));
925#endif /* CONFIG_QL_ISP_A64 */
926 ds[i].d_count = cpu_to_le32(sg_dma_len(sg));
927 ++sg;
928 }
929 sg_count -= n;
930 }
931 } else if (Cmnd->request_bufflen) {
932 /*Cmnd->SCp.ptr = (char *)(unsigned long)*/
933 dma_addr = pci_map_single(hostdata->pci_dev,
934 Cmnd->request_buffer,
935 Cmnd->request_bufflen,
936 Cmnd->sc_data_direction);
937 Cmnd->SCp.ptr = (char *)(unsigned long) dma_addr;
938
939 cmd->dataseg[0].d_base =
940 cpu_to_le32((u32) dma_addr);
941#ifdef CONFIG_QL_ISP_A64
942 cmd->dataseg[0].d_base_hi =
943 cpu_to_le32((u32) (dma_addr>>32));
944#endif /* CONFIG_QL_ISP_A64 */
945 cmd->dataseg[0].d_count =
946 cpu_to_le32((u32)Cmnd->request_bufflen);
947 cmd->segment_cnt = cpu_to_le16(1);
948 } else {
949 cmd->dataseg[0].d_base = 0;
950#ifdef CONFIG_QL_ISP_A64
951 cmd->dataseg[0].d_base_hi = 0;
952#endif /* CONFIG_QL_ISP_A64 */
953 cmd->dataseg[0].d_count = 0;
954 cmd->segment_cnt = cpu_to_le16(1); /* Shouldn't this be 0? */
955 }
956
957 /* Committed, record Scsi_Cmd so we can find it later. */
958 cmd->handle = in_ptr;
959 hostdata->cmd_slots[in_ptr] = Cmnd;
960
961 isp_outw(in_ptr, host, MBOX4);
962 hostdata->req_in_ptr = in_ptr;
963
964 num_free = QLOGICISP_REQ_QUEUE_LEN - REQ_QUEUE_DEPTH(in_ptr, out_ptr);
965 host->can_queue = host->host_busy + num_free;
966 host->sg_tablesize = QLOGICISP_MAX_SG(num_free);
967
968 LEAVE("isp1020_queuecommand");
969
970 return 0;
971}
972
973
974#define ASYNC_EVENT_INTERRUPT 0x01
975
976irqreturn_t do_isp1020_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
977{
978 struct Scsi_Host *host = dev_id;
979 unsigned long flags;
980
981 spin_lock_irqsave(host->host_lock, flags);
982 isp1020_intr_handler(irq, dev_id, regs);
983 spin_unlock_irqrestore(host->host_lock, flags);
984
985 return IRQ_HANDLED;
986}
987
988void isp1020_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
989{
990 Scsi_Cmnd *Cmnd;
991 struct Status_Entry *sts;
992 struct Scsi_Host *host = dev_id;
993 struct isp1020_hostdata *hostdata;
994 u_int in_ptr, out_ptr;
995 u_short status;
996
997 ENTER_INTR("isp1020_intr_handler");
998
999 hostdata = (struct isp1020_hostdata *) host->hostdata;
1000
1001 DEBUG_INTR(printk("qlogicisp : interrupt on line %d\n", irq));
1002
1003 if (!(isp_inw(host, PCI_INTF_STS) & 0x04)) {
1004 /* spurious interrupts can happen legally */
1005 DEBUG_INTR(printk("qlogicisp: got spurious interrupt\n"));
1006 return;
1007 }
1008 in_ptr = isp_inw(host, MBOX5);
1009 isp_outw(HCCR_CLEAR_RISC_INTR, host, HOST_HCCR);
1010
1011 if ((isp_inw(host, PCI_SEMAPHORE) & ASYNC_EVENT_INTERRUPT)) {
1012 status = isp_inw(host, MBOX0);
1013
1014 DEBUG_INTR(printk("qlogicisp : mbox completion status: %x\n",
1015 status));
1016
1017 switch (status) {
1018 case ASYNC_SCSI_BUS_RESET:
1019 case EXECUTION_TIMEOUT_RESET:
1020 hostdata->send_marker = 1;
1021 break;
1022 case INVALID_COMMAND:
1023 case HOST_INTERFACE_ERROR:
1024 case COMMAND_ERROR:
1025 case COMMAND_PARAM_ERROR:
1026 printk("qlogicisp : bad mailbox return status\n");
1027 break;
1028 }
1029 isp_outw(0x0, host, PCI_SEMAPHORE);
1030 }
1031 out_ptr = hostdata->res_out_ptr;
1032
1033 DEBUG_INTR(printk("qlogicisp : response queue update\n"));
1034 DEBUG_INTR(printk("qlogicisp : response queue depth %d\n",
1035 QUEUE_DEPTH(in_ptr, out_ptr, RES_QUEUE_LEN)));
1036
1037 while (out_ptr != in_ptr) {
1038 u_int cmd_slot;
1039
1040 sts = (struct Status_Entry *) &hostdata->res_cpu[out_ptr];
1041 out_ptr = (out_ptr + 1) & RES_QUEUE_LEN;
1042
1043 cmd_slot = sts->handle;
1044 Cmnd = hostdata->cmd_slots[cmd_slot];
1045 hostdata->cmd_slots[cmd_slot] = NULL;
1046
1047 TRACE("done", out_ptr, Cmnd);
1048
1049 if (le16_to_cpu(sts->completion_status) == CS_RESET_OCCURRED
1050 || le16_to_cpu(sts->completion_status) == CS_ABORTED
1051 || (le16_to_cpu(sts->status_flags) & STF_BUS_RESET))
1052 hostdata->send_marker = 1;
1053
1054 if (le16_to_cpu(sts->state_flags) & SF_GOT_SENSE)
1055 memcpy(Cmnd->sense_buffer, sts->req_sense_data,
1056 sizeof(Cmnd->sense_buffer));
1057
1058 DEBUG_INTR(isp1020_print_status_entry(sts));
1059
1060 if (sts->hdr.entry_type == ENTRY_STATUS)
1061 Cmnd->result = isp1020_return_status(sts);
1062 else
1063 Cmnd->result = DID_ERROR << 16;
1064
1065 if (Cmnd->use_sg)
1066 pci_unmap_sg(hostdata->pci_dev,
1067 (struct scatterlist *)Cmnd->buffer,
1068 Cmnd->use_sg,
1069 Cmnd->sc_data_direction);
1070 else if (Cmnd->request_bufflen)
1071 pci_unmap_single(hostdata->pci_dev,
1072#ifdef CONFIG_QL_ISP_A64
1073 (dma_addr_t)((long)Cmnd->SCp.ptr),
1074#else
1075 (u32)((long)Cmnd->SCp.ptr),
1076#endif
1077 Cmnd->request_bufflen,
1078 Cmnd->sc_data_direction);
1079
1080 isp_outw(out_ptr, host, MBOX5);
1081 (*Cmnd->scsi_done)(Cmnd);
1082 }
1083 hostdata->res_out_ptr = out_ptr;
1084
1085 LEAVE_INTR("isp1020_intr_handler");
1086}
1087
1088
1089static int isp1020_return_status(struct Status_Entry *sts)
1090{
1091 int host_status = DID_ERROR;
1092#if DEBUG_ISP1020_INTR
1093 static char *reason[] = {
1094 "DID_OK",
1095 "DID_NO_CONNECT",
1096 "DID_BUS_BUSY",
1097 "DID_TIME_OUT",
1098 "DID_BAD_TARGET",
1099 "DID_ABORT",
1100 "DID_PARITY",
1101 "DID_ERROR",
1102 "DID_RESET",
1103 "DID_BAD_INTR"
1104 };
1105#endif /* DEBUG_ISP1020_INTR */
1106
1107 ENTER("isp1020_return_status");
1108
1109 DEBUG(printk("qlogicisp : completion status = 0x%04x\n",
1110 le16_to_cpu(sts->completion_status)));
1111
1112 switch(le16_to_cpu(sts->completion_status)) {
1113 case CS_COMPLETE:
1114 host_status = DID_OK;
1115 break;
1116 case CS_INCOMPLETE:
1117 if (!(le16_to_cpu(sts->state_flags) & SF_GOT_BUS))
1118 host_status = DID_NO_CONNECT;
1119 else if (!(le16_to_cpu(sts->state_flags) & SF_GOT_TARGET))
1120 host_status = DID_BAD_TARGET;
1121 else if (!(le16_to_cpu(sts->state_flags) & SF_SENT_CDB))
1122 host_status = DID_ERROR;
1123 else if (!(le16_to_cpu(sts->state_flags) & SF_TRANSFERRED_DATA))
1124 host_status = DID_ERROR;
1125 else if (!(le16_to_cpu(sts->state_flags) & SF_GOT_STATUS))
1126 host_status = DID_ERROR;
1127 else if (!(le16_to_cpu(sts->state_flags) & SF_GOT_SENSE))
1128 host_status = DID_ERROR;
1129 break;
1130 case CS_DMA_ERROR:
1131 case CS_TRANSPORT_ERROR:
1132 host_status = DID_ERROR;
1133 break;
1134 case CS_RESET_OCCURRED:
1135 host_status = DID_RESET;
1136 break;
1137 case CS_ABORTED:
1138 host_status = DID_ABORT;
1139 break;
1140 case CS_TIMEOUT:
1141 host_status = DID_TIME_OUT;
1142 break;
1143 case CS_DATA_OVERRUN:
1144 case CS_COMMAND_OVERRUN:
1145 case CS_STATUS_OVERRUN:
1146 case CS_BAD_MESSAGE:
1147 case CS_NO_MESSAGE_OUT:
1148 case CS_EXT_ID_FAILED:
1149 case CS_IDE_MSG_FAILED:
1150 case CS_ABORT_MSG_FAILED:
1151 case CS_NOP_MSG_FAILED:
1152 case CS_PARITY_ERROR_MSG_FAILED:
1153 case CS_DEVICE_RESET_MSG_FAILED:
1154 case CS_ID_MSG_FAILED:
1155 case CS_UNEXP_BUS_FREE:
1156 host_status = DID_ERROR;
1157 break;
1158 case CS_DATA_UNDERRUN:
1159 host_status = DID_OK;
1160 break;
1161 default:
1162 printk("qlogicisp : unknown completion status 0x%04x\n",
1163 le16_to_cpu(sts->completion_status));
1164 host_status = DID_ERROR;
1165 break;
1166 }
1167
1168 DEBUG_INTR(printk("qlogicisp : host status (%s) scsi status %x\n",
1169 reason[host_status], le16_to_cpu(sts->scsi_status)));
1170
1171 LEAVE("isp1020_return_status");
1172
1173 return (le16_to_cpu(sts->scsi_status) & STATUS_MASK) | (host_status << 16);
1174}
1175
1176
1177static int isp1020_biosparam(struct scsi_device *sdev, struct block_device *n,
1178 sector_t capacity, int ip[])
1179{
1180 int size = capacity;
1181
1182 ENTER("isp1020_biosparam");
1183
1184 ip[0] = 64;
1185 ip[1] = 32;
1186 ip[2] = size >> 11;
1187 if (ip[2] > 1024) {
1188 ip[0] = 255;
1189 ip[1] = 63;
1190 ip[2] = size / (ip[0] * ip[1]);
1191#if 0
1192 if (ip[2] > 1023)
1193 ip[2] = 1023;
1194#endif
1195 }
1196
1197 LEAVE("isp1020_biosparam");
1198
1199 return 0;
1200}
1201
1202
1203static int isp1020_reset_hardware(struct Scsi_Host *host)
1204{
1205 u_short param[6];
1206 int loop_count;
1207
1208 ENTER("isp1020_reset_hardware");
1209
1210 isp_outw(ISP_RESET, host, PCI_INTF_CTL);
1211 udelay(100);
1212 isp_outw(HCCR_RESET, host, HOST_HCCR);
1213 udelay(100);
1214 isp_outw(HCCR_RELEASE, host, HOST_HCCR);
1215 isp_outw(HCCR_BIOS_DISABLE, host, HOST_HCCR);
1216
1217 loop_count = DEFAULT_LOOP_COUNT;
1218 while (--loop_count && isp_inw(host, HOST_HCCR) == RISC_BUSY) {
1219 barrier();
1220 cpu_relax();
1221 }
1222 if (!loop_count)
1223 printk("qlogicisp: reset_hardware loop timeout\n");
1224
1225 isp_outw(0, host, ISP_CFG1);
1226
1227#if DEBUG_ISP1020
1228 printk("qlogicisp : mbox 0 0x%04x \n", isp_inw(host, MBOX0));
1229 printk("qlogicisp : mbox 1 0x%04x \n", isp_inw(host, MBOX1));
1230 printk("qlogicisp : mbox 2 0x%04x \n", isp_inw(host, MBOX2));
1231 printk("qlogicisp : mbox 3 0x%04x \n", isp_inw(host, MBOX3));
1232 printk("qlogicisp : mbox 4 0x%04x \n", isp_inw(host, MBOX4));
1233 printk("qlogicisp : mbox 5 0x%04x \n", isp_inw(host, MBOX5));
1234#endif /* DEBUG_ISP1020 */
1235
1236 param[0] = MBOX_NO_OP;
1237 isp1020_mbox_command(host, param);
1238 if (param[0] != MBOX_COMMAND_COMPLETE) {
1239 printk("qlogicisp : NOP test failed\n");
1240 return 1;
1241 }
1242
1243 DEBUG(printk("qlogicisp : loading risc ram\n"));
1244
1245#if RELOAD_FIRMWARE
1246 for (loop_count = 0; loop_count < risc_code_length01; loop_count++) {
1247 param[0] = MBOX_WRITE_RAM_WORD;
1248 param[1] = risc_code_addr01 + loop_count;
1249 param[2] = risc_code01[loop_count];
1250 isp1020_mbox_command(host, param);
1251 if (param[0] != MBOX_COMMAND_COMPLETE) {
1252 printk("qlogicisp : firmware load failure at %d\n",
1253 loop_count);
1254 return 1;
1255 }
1256 }
1257#endif /* RELOAD_FIRMWARE */
1258
1259 DEBUG(printk("qlogicisp : verifying checksum\n"));
1260
1261 param[0] = MBOX_VERIFY_CHECKSUM;
1262 param[1] = risc_code_addr01;
1263
1264 isp1020_mbox_command(host, param);
1265
1266 if (param[0] != MBOX_COMMAND_COMPLETE) {
1267 printk("qlogicisp : ram checksum failure\n");
1268 return 1;
1269 }
1270
1271 DEBUG(printk("qlogicisp : executing firmware\n"));
1272
1273 param[0] = MBOX_EXEC_FIRMWARE;
1274 param[1] = risc_code_addr01;
1275
1276 isp1020_mbox_command(host, param);
1277
1278 param[0] = MBOX_ABOUT_FIRMWARE;
1279
1280 isp1020_mbox_command(host, param);
1281
1282 if (param[0] != MBOX_COMMAND_COMPLETE) {
1283 printk("qlogicisp : about firmware failure\n");
1284 return 1;
1285 }
1286
1287 DEBUG(printk("qlogicisp : firmware major revision %d\n", param[1]));
1288 DEBUG(printk("qlogicisp : firmware minor revision %d\n", param[2]));
1289
1290 LEAVE("isp1020_reset_hardware");
1291
1292 return 0;
1293}
1294
1295
1296static int isp1020_init(struct Scsi_Host *sh)
1297{
1298 u_long io_base, mem_base, io_flags, mem_flags;
1299 struct isp1020_hostdata *hostdata;
1300 u_char revision;
1301 u_int irq;
1302 u_short command;
1303 struct pci_dev *pdev;
1304
1305 ENTER("isp1020_init");
1306
1307 hostdata = (struct isp1020_hostdata *) sh->hostdata;
1308 pdev = hostdata->pci_dev;
1309
1310 if (pci_read_config_word(pdev, PCI_COMMAND, &command)
1311 || pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision))
1312 {
1313 printk("qlogicisp : error reading PCI configuration\n");
1314 return 1;
1315 }
1316
1317 io_base = pci_resource_start(pdev, 0);
1318 mem_base = pci_resource_start(pdev, 1);
1319 io_flags = pci_resource_flags(pdev, 0);
1320 mem_flags = pci_resource_flags(pdev, 1);
1321 irq = pdev->irq;
1322
1323 if (pdev->vendor != PCI_VENDOR_ID_QLOGIC) {
1324 printk("qlogicisp : 0x%04x is not QLogic vendor ID\n",
1325 pdev->vendor);
1326 return 1;
1327 }
1328
1329 if (pdev->device != PCI_DEVICE_ID_QLOGIC_ISP1020) {
1330 printk("qlogicisp : 0x%04x does not match ISP1020 device id\n",
1331 pdev->device);
1332 return 1;
1333 }
1334
1335#ifdef __alpha__
1336 /* Force ALPHA to use bus I/O and not bus MEM.
1337 This is to avoid having to use HAE_MEM registers,
1338 which is broken on some platforms and with SMP. */
1339 command &= ~PCI_COMMAND_MEMORY;
1340#endif
1341
1342 sh->io_port = io_base;
1343
1344 if (!request_region(sh->io_port, 0xff, "qlogicisp")) {
1345 printk("qlogicisp : i/o region 0x%lx-0x%lx already "
1346 "in use\n",
1347 sh->io_port, sh->io_port + 0xff);
1348 return 1;
1349 }
1350
1351 if ((command & PCI_COMMAND_MEMORY) &&
1352 ((mem_flags & 1) == 0)) {
1353 hostdata->memaddr = ioremap(mem_base, PAGE_SIZE);
1354 if (!hostdata->memaddr) {
1355 printk("qlogicisp : i/o remapping failed.\n");
1356 goto out_release;
1357 }
1358 } else {
1359 if (command & PCI_COMMAND_IO && (io_flags & 3) != 1) {
1360 printk("qlogicisp : i/o mapping is disabled\n");
1361 goto out_release;
1362 }
1363 hostdata->memaddr = NULL; /* zero to signify no i/o mapping */
1364 mem_base = 0;
1365 }
1366
1367 if (revision != ISP1020_REV_ID)
1368 printk("qlogicisp : new isp1020 revision ID (%d)\n", revision);
1369
1370 if (isp_inw(sh, PCI_ID_LOW) != PCI_VENDOR_ID_QLOGIC
1371 || isp_inw(sh, PCI_ID_HIGH) != PCI_DEVICE_ID_QLOGIC_ISP1020)
1372 {
1373 printk("qlogicisp : can't decode %s address space 0x%lx\n",
1374 (io_base ? "I/O" : "MEM"),
1375 (io_base ? io_base : mem_base));
1376 goto out_unmap;
1377 }
1378
1379 hostdata->revision = revision;
1380
1381 sh->irq = irq;
1382 sh->max_id = MAX_TARGETS;
1383 sh->max_lun = MAX_LUNS;
1384
1385 hostdata->res_cpu = pci_alloc_consistent(hostdata->pci_dev,
1386 QSIZE(RES_QUEUE_LEN),
1387 &hostdata->res_dma);
1388 if (hostdata->res_cpu == NULL) {
1389 printk("qlogicisp : can't allocate response queue\n");
1390 goto out_unmap;
1391 }
1392
1393 hostdata->req_cpu = pci_alloc_consistent(hostdata->pci_dev,
1394 QSIZE(QLOGICISP_REQ_QUEUE_LEN),
1395 &hostdata->req_dma);
1396 if (hostdata->req_cpu == NULL) {
1397 pci_free_consistent(hostdata->pci_dev,
1398 QSIZE(RES_QUEUE_LEN),
1399 hostdata->res_cpu,
1400 hostdata->res_dma);
1401 printk("qlogicisp : can't allocate request queue\n");
1402 goto out_unmap;
1403 }
1404
1405 pci_set_master(pdev);
1406
1407 LEAVE("isp1020_init");
1408
1409 return 0;
1410
1411out_unmap:
1412 iounmap(hostdata->memaddr);
1413out_release:
1414 release_region(sh->io_port, 0xff);
1415 return 1;
1416}
1417
1418
1419#if USE_NVRAM_DEFAULTS
1420
1421static int isp1020_get_defaults(struct Scsi_Host *host)
1422{
1423 int i;
1424 u_short value;
1425 struct isp1020_hostdata *hostdata =
1426 (struct isp1020_hostdata *) host->hostdata;
1427
1428 ENTER("isp1020_get_defaults");
1429
1430 if (!isp1020_verify_nvram(host)) {
1431 printk("qlogicisp : nvram checksum failure\n");
1432 printk("qlogicisp : attempting to use default parameters\n");
1433 return isp1020_set_defaults(host);
1434 }
1435
1436 value = isp1020_read_nvram_word(host, 2);
1437 hostdata->host_param.fifo_threshold = (value >> 8) & 0x03;
1438 hostdata->host_param.host_adapter_enable = (value >> 11) & 0x01;
1439 hostdata->host_param.initiator_scsi_id = (value >> 12) & 0x0f;
1440
1441 value = isp1020_read_nvram_word(host, 3);
1442 hostdata->host_param.bus_reset_delay = value & 0xff;
1443 hostdata->host_param.retry_count = value >> 8;
1444
1445 value = isp1020_read_nvram_word(host, 4);
1446 hostdata->host_param.retry_delay = value & 0xff;
1447 hostdata->host_param.async_data_setup_time = (value >> 8) & 0x0f;
1448 hostdata->host_param.req_ack_active_negation = (value >> 12) & 0x01;
1449 hostdata->host_param.data_line_active_negation = (value >> 13) & 0x01;
1450 hostdata->host_param.data_dma_burst_enable = (value >> 14) & 0x01;
1451 hostdata->host_param.command_dma_burst_enable = (value >> 15);
1452
1453 value = isp1020_read_nvram_word(host, 5);
1454 hostdata->host_param.tag_aging = value & 0xff;
1455
1456 value = isp1020_read_nvram_word(host, 6);
1457 hostdata->host_param.selection_timeout = value & 0xffff;
1458
1459 value = isp1020_read_nvram_word(host, 7);
1460 hostdata->host_param.max_queue_depth = value & 0xffff;
1461
1462#if DEBUG_ISP1020_SETUP
1463 printk("qlogicisp : fifo threshold=%d\n",
1464 hostdata->host_param.fifo_threshold);
1465 printk("qlogicisp : initiator scsi id=%d\n",
1466 hostdata->host_param.initiator_scsi_id);
1467 printk("qlogicisp : bus reset delay=%d\n",
1468 hostdata->host_param.bus_reset_delay);
1469 printk("qlogicisp : retry count=%d\n",
1470 hostdata->host_param.retry_count);
1471 printk("qlogicisp : retry delay=%d\n",
1472 hostdata->host_param.retry_delay);
1473 printk("qlogicisp : async data setup time=%d\n",
1474 hostdata->host_param.async_data_setup_time);
1475 printk("qlogicisp : req/ack active negation=%d\n",
1476 hostdata->host_param.req_ack_active_negation);
1477 printk("qlogicisp : data line active negation=%d\n",
1478 hostdata->host_param.data_line_active_negation);
1479 printk("qlogicisp : data DMA burst enable=%d\n",
1480 hostdata->host_param.data_dma_burst_enable);
1481 printk("qlogicisp : command DMA burst enable=%d\n",
1482 hostdata->host_param.command_dma_burst_enable);
1483 printk("qlogicisp : tag age limit=%d\n",
1484 hostdata->host_param.tag_aging);
1485 printk("qlogicisp : selection timeout limit=%d\n",
1486 hostdata->host_param.selection_timeout);
1487 printk("qlogicisp : max queue depth=%d\n",
1488 hostdata->host_param.max_queue_depth);
1489#endif /* DEBUG_ISP1020_SETUP */
1490
1491 for (i = 0; i < MAX_TARGETS; i++) {
1492
1493 value = isp1020_read_nvram_word(host, 14 + i * 3);
1494 hostdata->dev_param[i].device_flags = value & 0xff;
1495 hostdata->dev_param[i].execution_throttle = value >> 8;
1496
1497 value = isp1020_read_nvram_word(host, 15 + i * 3);
1498 hostdata->dev_param[i].synchronous_period = value & 0xff;
1499 hostdata->dev_param[i].synchronous_offset = (value >> 8) & 0x0f;
1500 hostdata->dev_param[i].device_enable = (value >> 12) & 0x01;
1501
1502#if DEBUG_ISP1020_SETUP
1503 printk("qlogicisp : target 0x%02x\n", i);
1504 printk("qlogicisp : device flags=0x%02x\n",
1505 hostdata->dev_param[i].device_flags);
1506 printk("qlogicisp : execution throttle=%d\n",
1507 hostdata->dev_param[i].execution_throttle);
1508 printk("qlogicisp : synchronous period=%d\n",
1509 hostdata->dev_param[i].synchronous_period);
1510 printk("qlogicisp : synchronous offset=%d\n",
1511 hostdata->dev_param[i].synchronous_offset);
1512 printk("qlogicisp : device enable=%d\n",
1513 hostdata->dev_param[i].device_enable);
1514#endif /* DEBUG_ISP1020_SETUP */
1515 }
1516
1517 LEAVE("isp1020_get_defaults");
1518
1519 return 0;
1520}
1521
1522
1523#define ISP1020_NVRAM_LEN 0x40
1524#define ISP1020_NVRAM_SIG1 0x5349
1525#define ISP1020_NVRAM_SIG2 0x2050
1526
1527static int isp1020_verify_nvram(struct Scsi_Host *host)
1528{
1529 int i;
1530 u_short value;
1531 u_char checksum = 0;
1532
1533 for (i = 0; i < ISP1020_NVRAM_LEN; i++) {
1534 value = isp1020_read_nvram_word(host, i);
1535
1536 switch (i) {
1537 case 0:
1538 if (value != ISP1020_NVRAM_SIG1) return 0;
1539 break;
1540 case 1:
1541 if (value != ISP1020_NVRAM_SIG2) return 0;
1542 break;
1543 case 2:
1544 if ((value & 0xff) != 0x02) return 0;
1545 break;
1546 }
1547 checksum += value & 0xff;
1548 checksum += value >> 8;
1549 }
1550
1551 return (checksum == 0);
1552}
1553
1554#define NVRAM_DELAY() udelay(2) /* 2 microsecond delay */
1555
1556
1557u_short isp1020_read_nvram_word(struct Scsi_Host *host, u_short byte)
1558{
1559 int i;
1560 u_short value, output, input;
1561
1562 byte &= 0x3f; byte |= 0x0180;
1563
1564 for (i = 8; i >= 0; i--) {
1565 output = ((byte >> i) & 0x1) ? 0x4 : 0x0;
1566 isp_outw(output | 0x2, host, PCI_NVRAM); NVRAM_DELAY();
1567 isp_outw(output | 0x3, host, PCI_NVRAM); NVRAM_DELAY();
1568 isp_outw(output | 0x2, host, PCI_NVRAM); NVRAM_DELAY();
1569 }
1570
1571 for (i = 0xf, value = 0; i >= 0; i--) {
1572 value <<= 1;
1573 isp_outw(0x3, host, PCI_NVRAM); NVRAM_DELAY();
1574 input = isp_inw(host, PCI_NVRAM); NVRAM_DELAY();
1575 isp_outw(0x2, host, PCI_NVRAM); NVRAM_DELAY();
1576 if (input & 0x8) value |= 1;
1577 }
1578
1579 isp_outw(0x0, host, PCI_NVRAM); NVRAM_DELAY();
1580
1581 return value;
1582}
1583
1584#endif /* USE_NVRAM_DEFAULTS */
1585
1586
1587static int isp1020_set_defaults(struct Scsi_Host *host)
1588{
1589 struct isp1020_hostdata *hostdata =
1590 (struct isp1020_hostdata *) host->hostdata;
1591 int i;
1592
1593 ENTER("isp1020_set_defaults");
1594
1595 hostdata->host_param.fifo_threshold = 2;
1596 hostdata->host_param.host_adapter_enable = 1;
1597 hostdata->host_param.initiator_scsi_id = 7;
1598 hostdata->host_param.bus_reset_delay = 3;
1599 hostdata->host_param.retry_count = 0;
1600 hostdata->host_param.retry_delay = 1;
1601 hostdata->host_param.async_data_setup_time = 6;
1602 hostdata->host_param.req_ack_active_negation = 1;
1603 hostdata->host_param.data_line_active_negation = 1;
1604 hostdata->host_param.data_dma_burst_enable = 1;
1605 hostdata->host_param.command_dma_burst_enable = 1;
1606 hostdata->host_param.tag_aging = 8;
1607 hostdata->host_param.selection_timeout = 250;
1608 hostdata->host_param.max_queue_depth = 256;
1609
1610 for (i = 0; i < MAX_TARGETS; i++) {
1611 hostdata->dev_param[i].device_flags = 0xfd;
1612 hostdata->dev_param[i].execution_throttle = 16;
1613 hostdata->dev_param[i].synchronous_period = 25;
1614 hostdata->dev_param[i].synchronous_offset = 12;
1615 hostdata->dev_param[i].device_enable = 1;
1616 }
1617
1618 LEAVE("isp1020_set_defaults");
1619
1620 return 0;
1621}
1622
1623
1624static int isp1020_load_parameters(struct Scsi_Host *host)
1625{
1626 int i, k;
1627#ifdef CONFIG_QL_ISP_A64
1628 u_long queue_addr;
1629 u_short param[8];
1630#else
1631 u_int queue_addr;
1632 u_short param[6];
1633#endif
1634 u_short isp_cfg1, hwrev;
1635 struct isp1020_hostdata *hostdata =
1636 (struct isp1020_hostdata *) host->hostdata;
1637
1638 ENTER("isp1020_load_parameters");
1639
1640 hwrev = isp_inw(host, ISP_CFG0) & ISP_CFG0_HWMSK;
1641 isp_cfg1 = ISP_CFG1_F64 | ISP_CFG1_BENAB;
1642 if (hwrev == ISP_CFG0_1040A) {
1643 /* Busted fifo, says mjacob. */
1644 isp_cfg1 &= ISP_CFG1_BENAB;
1645 }
1646
1647 isp_outw(isp_inw(host, ISP_CFG1) | isp_cfg1, host, ISP_CFG1);
1648 isp_outw(isp_inw(host, CDMA_CONF) | DMA_CONF_BENAB, host, CDMA_CONF);
1649 isp_outw(isp_inw(host, DDMA_CONF) | DMA_CONF_BENAB, host, DDMA_CONF);
1650
1651 param[0] = MBOX_SET_INIT_SCSI_ID;
1652 param[1] = hostdata->host_param.initiator_scsi_id;
1653
1654 isp1020_mbox_command(host, param);
1655
1656 if (param[0] != MBOX_COMMAND_COMPLETE) {
1657 printk("qlogicisp : set initiator id failure\n");
1658 return 1;
1659 }
1660
1661 param[0] = MBOX_SET_RETRY_COUNT;
1662 param[1] = hostdata->host_param.retry_count;
1663 param[2] = hostdata->host_param.retry_delay;
1664
1665 isp1020_mbox_command(host, param);
1666
1667 if (param[0] != MBOX_COMMAND_COMPLETE) {
1668 printk("qlogicisp : set retry count failure\n");
1669 return 1;
1670 }
1671
1672 param[0] = MBOX_SET_ASYNC_DATA_SETUP_TIME;
1673 param[1] = hostdata->host_param.async_data_setup_time;
1674
1675 isp1020_mbox_command(host, param);
1676
1677 if (param[0] != MBOX_COMMAND_COMPLETE) {
1678 printk("qlogicisp : async data setup time failure\n");
1679 return 1;
1680 }
1681
1682 param[0] = MBOX_SET_ACTIVE_NEG_STATE;
1683 param[1] = (hostdata->host_param.req_ack_active_negation << 4)
1684 | (hostdata->host_param.data_line_active_negation << 5);
1685
1686 isp1020_mbox_command(host, param);
1687
1688 if (param[0] != MBOX_COMMAND_COMPLETE) {
1689 printk("qlogicisp : set active negation state failure\n");
1690 return 1;
1691 }
1692
1693 param[0] = MBOX_SET_PCI_CONTROL_PARAMS;
1694 param[1] = hostdata->host_param.data_dma_burst_enable << 1;
1695 param[2] = hostdata->host_param.command_dma_burst_enable << 1;
1696
1697 isp1020_mbox_command(host, param);
1698
1699 if (param[0] != MBOX_COMMAND_COMPLETE) {
1700 printk("qlogicisp : set pci control parameter failure\n");
1701 return 1;
1702 }
1703
1704 param[0] = MBOX_SET_TAG_AGE_LIMIT;
1705 param[1] = hostdata->host_param.tag_aging;
1706
1707 isp1020_mbox_command(host, param);
1708
1709 if (param[0] != MBOX_COMMAND_COMPLETE) {
1710 printk("qlogicisp : set tag age limit failure\n");
1711 return 1;
1712 }
1713
1714 param[0] = MBOX_SET_SELECT_TIMEOUT;
1715 param[1] = hostdata->host_param.selection_timeout;
1716
1717 isp1020_mbox_command(host, param);
1718
1719 if (param[0] != MBOX_COMMAND_COMPLETE) {
1720 printk("qlogicisp : set selection timeout failure\n");
1721 return 1;
1722 }
1723
1724 for (i = 0; i < MAX_TARGETS; i++) {
1725
1726 if (!hostdata->dev_param[i].device_enable)
1727 continue;
1728
1729 param[0] = MBOX_SET_TARGET_PARAMS;
1730 param[1] = i << 8;
1731 param[2] = hostdata->dev_param[i].device_flags << 8;
1732 param[3] = (hostdata->dev_param[i].synchronous_offset << 8)
1733 | hostdata->dev_param[i].synchronous_period;
1734
1735 isp1020_mbox_command(host, param);
1736
1737 if (param[0] != MBOX_COMMAND_COMPLETE) {
1738 printk("qlogicisp : set target parameter failure\n");
1739 return 1;
1740 }
1741
1742 for (k = 0; k < MAX_LUNS; k++) {
1743
1744 param[0] = MBOX_SET_DEV_QUEUE_PARAMS;
1745 param[1] = (i << 8) | k;
1746 param[2] = hostdata->host_param.max_queue_depth;
1747 param[3] = hostdata->dev_param[i].execution_throttle;
1748
1749 isp1020_mbox_command(host, param);
1750
1751 if (param[0] != MBOX_COMMAND_COMPLETE) {
1752 printk("qlogicisp : set device queue "
1753 "parameter failure\n");
1754 return 1;
1755 }
1756 }
1757 }
1758
1759 queue_addr = hostdata->res_dma;
1760#ifdef CONFIG_QL_ISP_A64
1761 param[0] = MBOX_CMD_INIT_RESPONSE_QUEUE_64;
1762#else
1763 param[0] = MBOX_INIT_RES_QUEUE;
1764#endif
1765 param[1] = RES_QUEUE_LEN + 1;
1766 param[2] = (u_short) (queue_addr >> 16);
1767 param[3] = (u_short) (queue_addr & 0xffff);
1768 param[4] = 0;
1769 param[5] = 0;
1770#ifdef CONFIG_QL_ISP_A64
1771 param[6] = (u_short) (queue_addr >> 48);
1772 param[7] = (u_short) (queue_addr >> 32);
1773#endif
1774
1775 isp1020_mbox_command(host, param);
1776
1777 if (param[0] != MBOX_COMMAND_COMPLETE) {
1778 printk("qlogicisp : set response queue failure\n");
1779 return 1;
1780 }
1781
1782 queue_addr = hostdata->req_dma;
1783#ifdef CONFIG_QL_ISP_A64
1784 param[0] = MBOX_CMD_INIT_REQUEST_QUEUE_64;
1785#else
1786 param[0] = MBOX_INIT_REQ_QUEUE;
1787#endif
1788 param[1] = QLOGICISP_REQ_QUEUE_LEN + 1;
1789 param[2] = (u_short) (queue_addr >> 16);
1790 param[3] = (u_short) (queue_addr & 0xffff);
1791 param[4] = 0;
1792
1793#ifdef CONFIG_QL_ISP_A64
1794 param[5] = 0;
1795 param[6] = (u_short) (queue_addr >> 48);
1796 param[7] = (u_short) (queue_addr >> 32);
1797#endif
1798
1799 isp1020_mbox_command(host, param);
1800
1801 if (param[0] != MBOX_COMMAND_COMPLETE) {
1802 printk("qlogicisp : set request queue failure\n");
1803 return 1;
1804 }
1805
1806 LEAVE("isp1020_load_parameters");
1807
1808 return 0;
1809}
1810
1811
1812/*
1813 * currently, this is only called during initialization or abort/reset,
1814 * at which times interrupts are disabled, so polling is OK, I guess...
1815 */
1816static int isp1020_mbox_command(struct Scsi_Host *host, u_short param[])
1817{
1818 int loop_count;
1819
1820 if (mbox_param[param[0]] == 0)
1821 return 1;
1822
1823 loop_count = DEFAULT_LOOP_COUNT;
1824 while (--loop_count && isp_inw(host, HOST_HCCR) & 0x0080) {
1825 barrier();
1826 cpu_relax();
1827 }
1828 if (!loop_count)
1829 printk("qlogicisp: mbox_command loop timeout #1\n");
1830
1831 switch(mbox_param[param[0]] >> 4) {
1832 case 8: isp_outw(param[7], host, MBOX7);
1833 case 7: isp_outw(param[6], host, MBOX6);
1834 case 6: isp_outw(param[5], host, MBOX5);
1835 case 5: isp_outw(param[4], host, MBOX4);
1836 case 4: isp_outw(param[3], host, MBOX3);
1837 case 3: isp_outw(param[2], host, MBOX2);
1838 case 2: isp_outw(param[1], host, MBOX1);
1839 case 1: isp_outw(param[0], host, MBOX0);
1840 }
1841
1842 isp_outw(0x0, host, PCI_SEMAPHORE);
1843 isp_outw(HCCR_CLEAR_RISC_INTR, host, HOST_HCCR);
1844 isp_outw(HCCR_SET_HOST_INTR, host, HOST_HCCR);
1845
1846 loop_count = DEFAULT_LOOP_COUNT;
1847 while (--loop_count && !(isp_inw(host, PCI_INTF_STS) & 0x04)) {
1848 barrier();
1849 cpu_relax();
1850 }
1851 if (!loop_count)
1852 printk("qlogicisp: mbox_command loop timeout #2\n");
1853
1854 loop_count = DEFAULT_LOOP_COUNT;
1855 while (--loop_count && isp_inw(host, MBOX0) == 0x04) {
1856 barrier();
1857 cpu_relax();
1858 }
1859 if (!loop_count)
1860 printk("qlogicisp: mbox_command loop timeout #3\n");
1861
1862 switch(mbox_param[param[0]] & 0xf) {
1863 case 8: param[7] = isp_inw(host, MBOX7);
1864 case 7: param[6] = isp_inw(host, MBOX6);
1865 case 6: param[5] = isp_inw(host, MBOX5);
1866 case 5: param[4] = isp_inw(host, MBOX4);
1867 case 4: param[3] = isp_inw(host, MBOX3);
1868 case 3: param[2] = isp_inw(host, MBOX2);
1869 case 2: param[1] = isp_inw(host, MBOX1);
1870 case 1: param[0] = isp_inw(host, MBOX0);
1871 }
1872
1873 isp_outw(0x0, host, PCI_SEMAPHORE);
1874 isp_outw(HCCR_CLEAR_RISC_INTR, host, HOST_HCCR);
1875
1876 return 0;
1877}
1878
1879
1880#if DEBUG_ISP1020_INTR
1881
1882void isp1020_print_status_entry(struct Status_Entry *status)
1883{
1884 int i;
1885
1886 printk("qlogicisp : entry count = 0x%02x, type = 0x%02x, flags = 0x%02x\n",
1887 status->hdr.entry_cnt, status->hdr.entry_type, status->hdr.flags);
1888 printk("qlogicisp : scsi status = 0x%04x, completion status = 0x%04x\n",
1889 le16_to_cpu(status->scsi_status), le16_to_cpu(status->completion_status));
1890 printk("qlogicisp : state flags = 0x%04x, status flags = 0x%04x\n",
1891 le16_to_cpu(status->state_flags), le16_to_cpu(status->status_flags));
1892 printk("qlogicisp : time = 0x%04x, request sense length = 0x%04x\n",
1893 le16_to_cpu(status->time), le16_to_cpu(status->req_sense_len));
1894 printk("qlogicisp : residual transfer length = 0x%08x\n",
1895 le32_to_cpu(status->residual));
1896
1897 for (i = 0; i < le16_to_cpu(status->req_sense_len); i++)
1898 printk("qlogicisp : sense data = 0x%02x\n", status->req_sense_data[i]);
1899}
1900
1901#endif /* DEBUG_ISP1020_INTR */
1902
1903
1904#if DEBUG_ISP1020
1905
1906void isp1020_print_scsi_cmd(Scsi_Cmnd *cmd)
1907{
1908 int i;
1909
1910 printk("qlogicisp : target = 0x%02x, lun = 0x%02x, cmd_len = 0x%02x\n",
1911 cmd->target, cmd->lun, cmd->cmd_len);
1912 printk("qlogicisp : command = ");
1913 for (i = 0; i < cmd->cmd_len; i++)
1914 printk("0x%02x ", cmd->cmnd[i]);
1915 printk("\n");
1916}
1917
1918#endif /* DEBUG_ISP1020 */
1919
1920MODULE_LICENSE("GPL");
1921
1922static Scsi_Host_Template driver_template = {
1923 .detect = isp1020_detect,
1924 .release = isp1020_release,
1925 .info = isp1020_info,
1926 .queuecommand = isp1020_queuecommand,
1927 .bios_param = isp1020_biosparam,
1928 .can_queue = QLOGICISP_REQ_QUEUE_LEN,
1929 .this_id = -1,
1930 .sg_tablesize = QLOGICISP_MAX_SG(QLOGICISP_REQ_QUEUE_LEN),
1931 .cmd_per_lun = 1,
1932 .use_clustering = DISABLE_CLUSTERING,
1933};
1934#include "scsi_module.c"
diff --git a/drivers/scsi/qlogicisp_asm.c b/drivers/scsi/qlogicisp_asm.c
deleted file mode 100644
index 9ea4beca4ac5..000000000000
--- a/drivers/scsi/qlogicisp_asm.c
+++ /dev/null
@@ -1,2034 +0,0 @@
1/*
2 * Firmware Version 7.63.00 (12:07 Jan 27, 1999)
3 */
4static const unsigned short risc_code_version = 7*1024+63;
5
6static const unsigned short risc_code_addr01 = 0x1000 ;
7
8#if RELOAD_FIRMWARE
9
10static const unsigned short risc_code01[] = {
11 0x0078, 0x103a, 0x0000, 0x3f14, 0x0000, 0x2043, 0x4f50, 0x5952,
12 0x4947, 0x4854, 0x2031, 0x3939, 0x3520, 0x514c, 0x4f47, 0x4943,
13 0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
14 0x3130, 0x3230, 0x2049, 0x2f54, 0x2046, 0x6972, 0x6d77, 0x6172,
15 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030, 0x372e, 0x3633,
16 0x2020, 0x2043, 0x7573, 0x746f, 0x6d65, 0x7220, 0x4e6f, 0x2e20,
17 0x3030, 0x2050, 0x726f, 0x6475, 0x6374, 0x204e, 0x6f2e, 0x2020,
18 0x3031, 0x2024, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x0048,
19 0x1045, 0x0038, 0x104b, 0x0078, 0x1047, 0x0028, 0x104b, 0x20b9,
20 0x1212, 0x0078, 0x104d, 0x20b9, 0x2222, 0x20c1, 0x0008, 0x2071,
21 0x0010, 0x70c3, 0x0004, 0x20c9, 0x76ff, 0x2089, 0x1186, 0x70c7,
22 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 0x0007, 0x3f00,
23 0x70d6, 0x20c1, 0x0008, 0x2019, 0x0000, 0x2009, 0xfeff, 0x2100,
24 0x200b, 0xa5a5, 0xa1ec, 0x7fff, 0x2d64, 0x206b, 0x0a0a, 0xaddc,
25 0x3fff, 0x2b54, 0x205b, 0x5050, 0x2114, 0xa286, 0xa5a5, 0x0040,
26 0x10bf, 0xa386, 0x000f, 0x0040, 0x1085, 0x2c6a, 0x2a5a, 0x20c1,
27 0x0000, 0x2019, 0x000f, 0x0078, 0x1065, 0x2c6a, 0x2a5a, 0x20c1,
28 0x0008, 0x2009, 0x7fff, 0x2148, 0x2944, 0x204b, 0x0a0a, 0xa9bc,
29 0x3fff, 0x2734, 0x203b, 0x5050, 0x2114, 0xa286, 0x0a0a, 0x0040,
30 0x10a9, 0x284a, 0x263a, 0x20c1, 0x0004, 0x2009, 0x3fff, 0x2134,
31 0x200b, 0x5050, 0x2114, 0xa286, 0x5050, 0x0040, 0x10aa, 0x0078,
32 0x118e, 0x284a, 0x263a, 0x98c0, 0xa188, 0x1000, 0x212c, 0x200b,
33 0xa5a5, 0x2114, 0xa286, 0xa5a5, 0x0040, 0x10bc, 0x250a, 0xa18a,
34 0x1000, 0x98c1, 0x0078, 0x10c1, 0x250a, 0x0078, 0x10c1, 0x2c6a,
35 0x2a5a, 0x2130, 0xa18a, 0x0040, 0x2128, 0xa1a2, 0x5000, 0x8424,
36 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 0xa192, 0x7700, 0x2009,
37 0x0000, 0x2001, 0x0031, 0x1078, 0x1c9d, 0x2218, 0x2079, 0x5000,
38 0x2fa0, 0x2408, 0x2011, 0x0000, 0x20a9, 0x0040, 0x42a4, 0x8109,
39 0x00c0, 0x10dc, 0x7ef2, 0x8528, 0x7de6, 0x7cea, 0x7bee, 0x7883,
40 0x0000, 0x2031, 0x0030, 0x78cf, 0x0101, 0x780b, 0x0002, 0x780f,
41 0x0002, 0x784f, 0x0003, 0x2069, 0x5040, 0x2001, 0x04fd, 0x2004,
42 0xa082, 0x0005, 0x0048, 0x1104, 0x0038, 0x1100, 0x0078, 0x1108,
43 0x681b, 0x003c, 0x0078, 0x110a, 0x00a8, 0x1108, 0x681b, 0x003c,
44 0x681b, 0x0028, 0x6807, 0x0007, 0x680b, 0x00fa, 0x680f, 0x0008,
45 0x6813, 0x0005, 0x6823, 0x0000, 0x6827, 0x0006, 0x6817, 0x0008,
46 0x682b, 0x0000, 0x681f, 0x0019, 0x2069, 0x5280, 0x2011, 0x0020,
47 0x2009, 0x0010, 0x680b, 0x080c, 0x680f, 0x0019, 0x6803, 0xfd00,
48 0x6807, 0x0018, 0x6a1a, 0x2d00, 0xa0e8, 0x0008, 0xa290, 0x0004,
49 0x8109, 0x00c0, 0x1122, 0x2069, 0x5300, 0x2009, 0x0002, 0x20a9,
50 0x0100, 0x6837, 0x0000, 0x680b, 0x0040, 0x7bf0, 0xa386, 0xfeff,
51 0x00c0, 0x1148, 0x6817, 0x0100, 0x681f, 0x0064, 0x0078, 0x114c,
52 0x6817, 0x0064, 0x681f, 0x0002, 0xade8, 0x0010, 0x0070, 0x1152,
53 0x0078, 0x1139, 0x8109, 0x00c0, 0x1137, 0x1078, 0x21e9, 0x1078,
54 0x46e9, 0x1078, 0x1946, 0x1078, 0x4bdf, 0x3200, 0xa085, 0x000d,
55 0x2090, 0x70c3, 0x0000, 0x0090, 0x116c, 0x70c0, 0xa086, 0x0002,
56 0x00c0, 0x116c, 0x1078, 0x1284, 0x1078, 0x1196, 0x78cc, 0xa005,
57 0x00c0, 0x117a, 0x1078, 0x1cc6, 0x0010, 0x1180, 0x0068, 0x1180,
58 0x1078, 0x20c8, 0x0010, 0x1180, 0x0068, 0x1180, 0x1078, 0x1a2b,
59 0x00e0, 0x116c, 0x1078, 0x4a66, 0x0078, 0x116c, 0x118e, 0x1190,
60 0x23ea, 0x23ea, 0x476a, 0x476a, 0x23ea, 0x23ea, 0x0078, 0x118e,
61 0x0078, 0x1190, 0x0078, 0x1192, 0x0078, 0x1194, 0x0068, 0x1201,
62 0x2061, 0x0000, 0x6018, 0xa084, 0x0001, 0x00c0, 0x1201, 0x7814,
63 0xa005, 0x00c0, 0x11a7, 0x0010, 0x1202, 0x0078, 0x1201, 0x2009,
64 0x505b, 0x2104, 0xa005, 0x00c0, 0x1201, 0x2009, 0x5064, 0x200b,
65 0x0000, 0x7914, 0xa186, 0x0042, 0x00c0, 0x11cc, 0x7816, 0x2009,
66 0x5062, 0x2164, 0x200b, 0x0000, 0x6018, 0x70c6, 0x6014, 0x70ca,
67 0x611c, 0xa18c, 0xff00, 0x6020, 0xa084, 0x00ff, 0xa105, 0x70ce,
68 0x1078, 0x192b, 0x0078, 0x11ff, 0x7814, 0xa086, 0x0018, 0x00c0,
69 0x11d3, 0x1078, 0x165a, 0x7817, 0x0000, 0x2009, 0x5062, 0x2104,
70 0xa065, 0x0040, 0x11ef, 0x0c7e, 0x609c, 0x2060, 0x1078, 0x1996,
71 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1730, 0x2009, 0x000c, 0x6007,
72 0x0103, 0x1078, 0x1907, 0x00c0, 0x11fb, 0x1078, 0x192b, 0x2009,
73 0x5062, 0x200b, 0x0000, 0x2009, 0x505c, 0x2104, 0x200b, 0x0000,
74 0xa005, 0x0040, 0x11ff, 0x2001, 0x4005, 0x0078, 0x1286, 0x0078,
75 0x1284, 0x007c, 0x70c3, 0x0000, 0x70c7, 0x0000, 0x70cb, 0x0000,
76 0x70cf, 0x0000, 0x70c0, 0xa0bc, 0xffc0, 0x00c0, 0x1252, 0x2038,
77 0x0079, 0x1212, 0x1284, 0x12e5, 0x12a9, 0x12fe, 0x130d, 0x1313,
78 0x12a0, 0x1748, 0x1317, 0x1298, 0x12ad, 0x12af, 0x12b1, 0x12b3,
79 0x174d, 0x1298, 0x1329, 0x1360, 0x1672, 0x1742, 0x12b5, 0x1591,
80 0x15ad, 0x15c9, 0x15f4, 0x154a, 0x1558, 0x156c, 0x1580, 0x13df,
81 0x1298, 0x138d, 0x1393, 0x1398, 0x139d, 0x13a3, 0x13a8, 0x13ad,
82 0x13b2, 0x13b7, 0x13bb, 0x13d0, 0x13dc, 0x1298, 0x1298, 0x1298,
83 0x1298, 0x13eb, 0x13f4, 0x1403, 0x1429, 0x1433, 0x143a, 0x1480,
84 0x148f, 0x149e, 0x14b0, 0x152a, 0x153a, 0x1298, 0x1298, 0x1298,
85 0x1298, 0x153f, 0xa0bc, 0xffa0, 0x00c0, 0x1298, 0x2038, 0xa084,
86 0x001f, 0x0079, 0x125b, 0x1786, 0x1789, 0x1799, 0x1298, 0x1298,
87 0x18d8, 0x18f5, 0x1298, 0x1298, 0x1298, 0x18f9, 0x1901, 0x1298,
88 0x1298, 0x1298, 0x1298, 0x12db, 0x12f4, 0x131f, 0x1356, 0x1668,
89 0x1764, 0x1778, 0x1298, 0x1829, 0x1298, 0x18b4, 0x18be, 0x18c2,
90 0x18d0, 0x1298, 0x1298, 0x72ca, 0x71c6, 0x2001, 0x4006, 0x0078,
91 0x1286, 0x73ce, 0x72ca, 0x71c6, 0x2001, 0x4000, 0x70c2, 0x0068,
92 0x1287, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x5000, 0x00e0,
93 0x128f, 0x00e0, 0x1291, 0x0068, 0x1291, 0x2091, 0x4080, 0x007c,
94 0x70c3, 0x4001, 0x0078, 0x1287, 0x70c3, 0x4006, 0x0078, 0x1287,
95 0x2099, 0x0041, 0x20a1, 0x0041, 0x20a9, 0x0005, 0x53a3, 0x0078,
96 0x1284, 0x70c4, 0x70c3, 0x0004, 0x007a, 0x0078, 0x1284, 0x0078,
97 0x1284, 0x0078, 0x1284, 0x0078, 0x1284, 0x2091, 0x8000, 0x70c3,
98 0x0000, 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3,
99 0x0007, 0x3f00, 0x70d6, 0x2079, 0x0000, 0x781b, 0x0001, 0x2031,
100 0x0030, 0x2059, 0x1000, 0x2029, 0x0457, 0x2051, 0x0470, 0x2061,
101 0x0472, 0x20b9, 0xffff, 0x20c1, 0x0000, 0x2091, 0x5000, 0x2091,
102 0x4080, 0x0078, 0x0455, 0x1078, 0x1b36, 0x00c0, 0x129c, 0x75d8,
103 0x74dc, 0x75da, 0x74de, 0x0078, 0x12e8, 0x2029, 0x0000, 0x2520,
104 0x71d0, 0x73c8, 0x72cc, 0x70c4, 0x1078, 0x1a70, 0x0040, 0x1284,
105 0x70c3, 0x4002, 0x0078, 0x1284, 0x1078, 0x1b36, 0x00c0, 0x129c,
106 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x1301, 0x2029, 0x0000,
107 0x2520, 0x71d0, 0x73c8, 0x72cc, 0x70c4, 0x1078, 0x1ad0, 0x0040,
108 0x1284, 0x70c3, 0x4002, 0x0078, 0x1284, 0x71c4, 0x70c8, 0x2114,
109 0x200a, 0x0078, 0x1282, 0x71c4, 0x2114, 0x0078, 0x1282, 0x70c7,
110 0x0007, 0x70cb, 0x003f, 0x70cf, 0x0000, 0x0078, 0x1284, 0x1078,
111 0x1b36, 0x00c0, 0x129c, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078,
112 0x132c, 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d0,
113 0x70c6, 0x72ca, 0x73ce, 0x74d2, 0xa005, 0x0040, 0x1350, 0x8001,
114 0x7892, 0xa084, 0xfc00, 0x0040, 0x1345, 0x78cc, 0xa085, 0x0001,
115 0x78ce, 0x2001, 0x4005, 0x0078, 0x1286, 0x7a9a, 0x7b9e, 0x7da2,
116 0x7ea6, 0x7c96, 0x78cc, 0xa084, 0xfffc, 0x78ce, 0x0078, 0x1354,
117 0x78cc, 0xa085, 0x0001, 0x78ce, 0x0078, 0x1284, 0x1078, 0x1b36,
118 0x00c0, 0x129c, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078, 0x1363,
119 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d4, 0x70c6,
120 0x72ca, 0x73ce, 0x74d6, 0xa005, 0x0040, 0x1387, 0x8001, 0x78ae,
121 0xa084, 0xfc00, 0x0040, 0x137c, 0x78cc, 0xa085, 0x0100, 0x78ce,
122 0x2001, 0x4005, 0x0078, 0x1286, 0x7ab6, 0x7bba, 0x7dbe, 0x7ec2,
123 0x7cb2, 0x78cc, 0xa084, 0xfcff, 0x78ce, 0x0078, 0x138b, 0x78cc,
124 0xa085, 0x0100, 0x78ce, 0x0078, 0x1284, 0x2009, 0x5061, 0x210c,
125 0x7aec, 0x0078, 0x1282, 0x2009, 0x5041, 0x210c, 0x0078, 0x1283,
126 0x2009, 0x5042, 0x210c, 0x0078, 0x1283, 0x2061, 0x5040, 0x610c,
127 0x6210, 0x0078, 0x1282, 0x2009, 0x5045, 0x210c, 0x0078, 0x1283,
128 0x2009, 0x5046, 0x210c, 0x0078, 0x1283, 0x2009, 0x5048, 0x210c,
129 0x0078, 0x1283, 0x2009, 0x5049, 0x210c, 0x0078, 0x1283, 0x7908,
130 0x7a0c, 0x0078, 0x1282, 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003,
131 0x8003, 0x8003, 0xa0e8, 0x5280, 0x6a00, 0x6804, 0xa084, 0x0008,
132 0x0040, 0x13cd, 0x6b08, 0x0078, 0x13ce, 0x6b0c, 0x0078, 0x1281,
133 0x77c4, 0x1078, 0x1956, 0x2091, 0x8000, 0x6b1c, 0x6a14, 0x2091,
134 0x8001, 0x2708, 0x0078, 0x1281, 0x794c, 0x0078, 0x1283, 0x77c4,
135 0x1078, 0x1956, 0x2091, 0x8000, 0x6908, 0x6a18, 0x6b10, 0x2091,
136 0x8001, 0x0078, 0x1281, 0x71c4, 0xa182, 0x0010, 0x00c8, 0x127c,
137 0x1078, 0x22c1, 0x0078, 0x1281, 0x71c4, 0xa182, 0x0010, 0x00c8,
138 0x127c, 0x2011, 0x5041, 0x2204, 0x007e, 0x2112, 0x1078, 0x227a,
139 0x017f, 0x0078, 0x1283, 0x71c4, 0x2011, 0x1421, 0x20a9, 0x0008,
140 0x2204, 0xa106, 0x0040, 0x1413, 0x8210, 0x0070, 0x1411, 0x0078,
141 0x1408, 0x0078, 0x127c, 0xa292, 0x1421, 0x027e, 0x2011, 0x5042,
142 0x2204, 0x2112, 0x017f, 0x007e, 0x1078, 0x2286, 0x017f, 0x0078,
143 0x1283, 0x03e8, 0x00fa, 0x01f4, 0x02ee, 0x0064, 0x0019, 0x0032,
144 0x004b, 0x2061, 0x5040, 0x610c, 0x6210, 0x70c4, 0x600e, 0x70c8,
145 0x6012, 0x0078, 0x1282, 0x2061, 0x5040, 0x6114, 0x70c4, 0x6016,
146 0x0078, 0x1283, 0x2061, 0x5040, 0x71c4, 0x2011, 0x0004, 0x601f,
147 0x0019, 0x2019, 0x1212, 0xa186, 0x0028, 0x0040, 0x145b, 0x2011,
148 0x0005, 0x601f, 0x0019, 0x2019, 0x1212, 0xa186, 0x0032, 0x0040,
149 0x145b, 0x2011, 0x0006, 0x601f, 0x000c, 0x2019, 0x2222, 0xa186,
150 0x003c, 0x00c0, 0x127c, 0x6018, 0x007e, 0x611a, 0x7800, 0xa084,
151 0x0001, 0x00c0, 0x1476, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005,
152 0x0048, 0x146e, 0x0038, 0x1472, 0x0078, 0x1476, 0x0028, 0x1472,
153 0x0078, 0x1476, 0x2019, 0x2222, 0x0078, 0x1478, 0x2019, 0x1212,
154 0x23b8, 0x1078, 0x2297, 0x1078, 0x4bdf, 0x017f, 0x0078, 0x1283,
155 0x71c4, 0xa184, 0xffcf, 0x00c0, 0x127c, 0x2011, 0x5048, 0x2204,
156 0x2112, 0x007e, 0x1078, 0x22b9, 0x017f, 0x0078, 0x1283, 0x71c4,
157 0xa182, 0x0010, 0x00c8, 0x127c, 0x2011, 0x5049, 0x2204, 0x007e,
158 0x2112, 0x1078, 0x22a8, 0x017f, 0x0078, 0x1283, 0x71c4, 0x72c8,
159 0xa184, 0xfffd, 0x00c0, 0x127b, 0xa284, 0xfffd, 0x00c0, 0x127b,
160 0x2100, 0x7908, 0x780a, 0x2200, 0x7a0c, 0x780e, 0x0078, 0x1282,
161 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e8,
162 0x5280, 0x2019, 0x0000, 0x72c8, 0xa284, 0x0080, 0x0040, 0x14c6,
163 0x6c14, 0x84ff, 0x00c0, 0x14c6, 0x6817, 0x0040, 0xa284, 0x0040,
164 0x0040, 0x14d0, 0x6c10, 0x84ff, 0x00c0, 0x14d0, 0x6813, 0x0001,
165 0x6800, 0x007e, 0xa226, 0x0040, 0x14f3, 0x6a02, 0xa484, 0x2000,
166 0x0040, 0x14dc, 0xa39d, 0x0010, 0xa484, 0x1000, 0x0040, 0x14e2,
167 0xa39d, 0x0008, 0xa484, 0x4000, 0x0040, 0x14f3, 0x810f, 0xa284,
168 0x4000, 0x0040, 0x14ef, 0x1078, 0x22db, 0x0078, 0x14f3, 0x1078,
169 0x22cd, 0x0078, 0x14f3, 0x72cc, 0x6808, 0xa206, 0x0040, 0x1522,
170 0xa2a4, 0x00ff, 0x2061, 0x5040, 0x6118, 0xa186, 0x0028, 0x0040,
171 0x1509, 0xa186, 0x0032, 0x0040, 0x150f, 0xa186, 0x003c, 0x0040,
172 0x1515, 0xa482, 0x0064, 0x0048, 0x151f, 0x0078, 0x1519, 0xa482,
173 0x0050, 0x0048, 0x151f, 0x0078, 0x1519, 0xa482, 0x0043, 0x0048,
174 0x151f, 0x71c4, 0x71c6, 0x027f, 0x72ca, 0x0078, 0x127d, 0x6a0a,
175 0xa39d, 0x000a, 0x6804, 0xa305, 0x6806, 0x027f, 0x6b0c, 0x71c4,
176 0x0078, 0x1281, 0x77c4, 0x1078, 0x1956, 0x2091, 0x8000, 0x6a14,
177 0x6b1c, 0x2091, 0x8001, 0x70c8, 0x6816, 0x70cc, 0x681e, 0x2708,
178 0x0078, 0x1281, 0x70c4, 0x794c, 0x784e, 0x0078, 0x1283, 0x71c4,
179 0x72c8, 0x73cc, 0xa182, 0x0010, 0x00c8, 0x127c, 0x1078, 0x22e9,
180 0x0078, 0x1281, 0x77c4, 0x1078, 0x1956, 0x2091, 0x8000, 0x6a08,
181 0xa295, 0x0002, 0x6a0a, 0x2091, 0x8001, 0x2708, 0x0078, 0x1282,
182 0x77c4, 0x1078, 0x1956, 0x2091, 0x8000, 0x6a08, 0xa294, 0xfff9,
183 0x6a0a, 0x6804, 0xa005, 0x0040, 0x1567, 0x1078, 0x21b1, 0x2091,
184 0x8001, 0x2708, 0x0078, 0x1282, 0x77c4, 0x1078, 0x1956, 0x2091,
185 0x8000, 0x6a08, 0xa295, 0x0004, 0x6a0a, 0x6804, 0xa005, 0x0040,
186 0x157b, 0x1078, 0x21b1, 0x2091, 0x8001, 0x2708, 0x0078, 0x1282,
187 0x77c4, 0x2041, 0x0001, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091,
188 0x8000, 0x1078, 0x1963, 0x2091, 0x8001, 0x2708, 0x6a08, 0x0078,
189 0x1282, 0x77c4, 0x72c8, 0x73cc, 0x77c6, 0x72ca, 0x73ce, 0x1078,
190 0x19c4, 0x00c0, 0x15a9, 0x6818, 0xa005, 0x0040, 0x15a9, 0x2708,
191 0x1078, 0x22f9, 0x00c0, 0x15a9, 0x7817, 0x0015, 0x2091, 0x8001,
192 0x007c, 0x2091, 0x8001, 0x0078, 0x1284, 0x77c4, 0x77c6, 0x2041,
193 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 0x1078,
194 0x1963, 0x2061, 0x5040, 0x606f, 0x0003, 0x6782, 0x6093, 0x000f,
195 0x6073, 0x0000, 0x7817, 0x0016, 0x1078, 0x21b1, 0x2091, 0x8001,
196 0x007c, 0x77c8, 0x77ca, 0x77c4, 0x77c6, 0xa7bc, 0xff00, 0x2091,
197 0x8000, 0x2061, 0x5040, 0x606f, 0x0002, 0x6073, 0x0000, 0x6782,
198 0x6093, 0x000f, 0x7817, 0x0017, 0x1078, 0x21b1, 0x2091, 0x8001,
199 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0010, 0x2091, 0x8000,
200 0x1078, 0x1963, 0x70c8, 0x6836, 0x8738, 0xa784, 0x001f, 0x00c0,
201 0x15e8, 0x2091, 0x8001, 0x007c, 0x78cc, 0xa084, 0x0003, 0x00c0,
202 0x1618, 0x2039, 0x0000, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051,
203 0x0008, 0x1078, 0x1956, 0x2091, 0x8000, 0x6808, 0xa80d, 0x690a,
204 0x2091, 0x8001, 0x8738, 0xa784, 0x001f, 0x00c0, 0x1601, 0xa7bc,
205 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0, 0x1601,
206 0x2091, 0x8000, 0x2069, 0x0100, 0x6830, 0xa084, 0x0040, 0x0040,
207 0x1641, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0004,
208 0x0040, 0x162e, 0x0070, 0x162e, 0x0078, 0x1625, 0x684b, 0x0009,
209 0x20a9, 0x0014, 0x6848, 0xa084, 0x0001, 0x0040, 0x163b, 0x0070,
210 0x163b, 0x0078, 0x1632, 0x20a9, 0x00fa, 0x0070, 0x1641, 0x0078,
211 0x163d, 0x2079, 0x5000, 0x7817, 0x0018, 0x2061, 0x5040, 0x606f,
212 0x0001, 0x6073, 0x0000, 0x6093, 0x000f, 0x78cc, 0xa085, 0x0002,
213 0x78ce, 0x6808, 0xa084, 0xfffd, 0x680a, 0x681b, 0x0048, 0x2091,
214 0x8001, 0x007c, 0x78cc, 0xa084, 0xfffd, 0x78ce, 0xa084, 0x0001,
215 0x00c0, 0x1664, 0x1078, 0x1a0e, 0x71c4, 0x71c6, 0x794a, 0x007c,
216 0x1078, 0x1b36, 0x00c0, 0x129c, 0x75d8, 0x74dc, 0x75da, 0x74de,
217 0x0078, 0x1675, 0x2029, 0x0000, 0x2520, 0x71c4, 0x73c8, 0x72cc,
218 0x71c6, 0x73ca, 0x72ce, 0x2079, 0x5000, 0x2091, 0x8000, 0x1078,
219 0x1911, 0x2091, 0x8001, 0x0040, 0x172c, 0x20a9, 0x0005, 0x20a1,
220 0x5018, 0x2091, 0x8000, 0x41a1, 0x2091, 0x8001, 0x2009, 0x0020,
221 0x1078, 0x190c, 0x0040, 0x1698, 0x1078, 0x192b, 0x0078, 0x172c,
222 0x6004, 0xa084, 0xff00, 0x8007, 0x8009, 0x0040, 0x16fb, 0x0c7e,
223 0x2c68, 0x2091, 0x8000, 0x1078, 0x1911, 0x2091, 0x8001, 0x0040,
224 0x16cc, 0x2c00, 0x689e, 0x8109, 0x00c0, 0x16a0, 0x609f, 0x0000,
225 0x0c7f, 0x0c7e, 0x7218, 0x731c, 0x7420, 0x7524, 0x2c68, 0x689c,
226 0xa065, 0x0040, 0x16fa, 0x2009, 0x0020, 0x1078, 0x190c, 0x00c0,
227 0x16e3, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0002, 0x00c0, 0x16cc,
228 0x2d00, 0x6002, 0x0078, 0x16b2, 0x0c7f, 0x0c7e, 0x609c, 0x2060,
229 0x1078, 0x1996, 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1730, 0x2009,
230 0x000c, 0x6008, 0xa085, 0x0200, 0x600a, 0x1078, 0x1907, 0x1078,
231 0x192b, 0x0078, 0x172c, 0x0c7f, 0x0c7e, 0x609c, 0x2060, 0x1078,
232 0x1996, 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1730, 0x2009, 0x000c,
233 0x6007, 0x0103, 0x601b, 0x0003, 0x1078, 0x1907, 0x1078, 0x192b,
234 0x0078, 0x172c, 0x0c7f, 0x74c4, 0x73c8, 0x72cc, 0x6014, 0x2091,
235 0x8000, 0x7817, 0x0012, 0x0e7e, 0x2071, 0x5040, 0x706f, 0x0005,
236 0x7073, 0x0000, 0x7376, 0x727a, 0x747e, 0x7082, 0x7087, 0x0000,
237 0x2c00, 0x708a, 0x708f, 0x0000, 0xa02e, 0x2530, 0x611c, 0x61a2,
238 0xa184, 0x0060, 0x0040, 0x171e, 0x1078, 0x467f, 0x0e7f, 0x6596,
239 0x65a6, 0x669a, 0x66aa, 0x60af, 0x0000, 0x60b3, 0x0000, 0x1078,
240 0x21b1, 0x2091, 0x8001, 0x007c, 0x70c3, 0x4005, 0x0078, 0x1287,
241 0x20a9, 0x0005, 0x2099, 0x5018, 0x2091, 0x8000, 0x530a, 0x2091,
242 0x8001, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9,
243 0x0000, 0x007c, 0x71c4, 0x70c7, 0x0000, 0x7906, 0x0078, 0x1284,
244 0x71c4, 0x71c6, 0x2168, 0x0078, 0x174f, 0x2069, 0x1000, 0x690c,
245 0xa016, 0x2d04, 0xa210, 0x8d68, 0x8109, 0x00c0, 0x1751, 0xa285,
246 0x0000, 0x00c0, 0x175f, 0x70c3, 0x4000, 0x0078, 0x1761, 0x70c3,
247 0x4003, 0x70ca, 0x0078, 0x1287, 0x2011, 0x5067, 0x220c, 0x70c4,
248 0x8003, 0x0048, 0x1771, 0x1078, 0x3b49, 0xa184, 0x7fff, 0x0078,
249 0x1775, 0x1078, 0x3b3c, 0xa185, 0x8000, 0x2012, 0x0078, 0x1283,
250 0x71c4, 0x1078, 0x3b33, 0x6100, 0x2001, 0x5067, 0x2004, 0xa084,
251 0x8000, 0xa10d, 0x6204, 0x6308, 0x0078, 0x1281, 0x79e4, 0x0078,
252 0x1283, 0x71c4, 0x71c6, 0x2198, 0x20a1, 0x0042, 0x20a9, 0x0004,
253 0x53a3, 0x21a0, 0x2099, 0x0042, 0x20a9, 0x0004, 0x53a3, 0x0078,
254 0x1284, 0x70c4, 0x2068, 0x2079, 0x5000, 0x2091, 0x8000, 0x1078,
255 0x1911, 0x2091, 0x8001, 0x0040, 0x1825, 0x6007, 0x0001, 0x600b,
256 0x0000, 0x602b, 0x0000, 0x601b, 0x0006, 0x6a10, 0xa28c, 0x000f,
257 0xa284, 0x00f0, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0x6016,
258 0xa284, 0x0800, 0x0040, 0x17c0, 0x601b, 0x000a, 0x0078, 0x17c6,
259 0xa284, 0x1000, 0x0040, 0x17c6, 0x601b, 0x000c, 0xa284, 0x0300,
260 0x0040, 0x17cf, 0x602b, 0x0001, 0x8004, 0x8004, 0x8004, 0xa085,
261 0x0001, 0x601e, 0x6023, 0x0000, 0x6027, 0x0000, 0xa284, 0x0400,
262 0x0040, 0x17dc, 0x602b, 0x0000, 0x20a9, 0x0006, 0xac80, 0x000b,
263 0x20a0, 0xad80, 0x0005, 0x2098, 0x53a3, 0xa284, 0x0300, 0x00c0,
264 0x17f1, 0x6046, 0x604a, 0x604e, 0x6052, 0x6096, 0x609a, 0x0078,
265 0x17fb, 0x6800, 0x6046, 0x6804, 0x604a, 0x6e08, 0x664e, 0x6d0c,
266 0x6552, 0x6596, 0x669a, 0x6014, 0x2091, 0x8000, 0x7817, 0x0042,
267 0x2c08, 0x2061, 0x5040, 0x606f, 0x0005, 0x6073, 0x0000, 0x6077,
268 0x0000, 0x607b, 0x0000, 0x607f, 0x0000, 0x6082, 0x618a, 0xa284,
269 0x0400, 0x608e, 0x2091, 0x8001, 0x0e7e, 0x2071, 0x0020, 0x7007,
270 0x000a, 0x7007, 0x0002, 0x7003, 0x0000, 0x0e7f, 0x2091, 0x8000,
271 0x1078, 0x21b1, 0x2091, 0x8001, 0x007c, 0x70c3, 0x4005, 0x0078,
272 0x1287, 0x0c7e, 0x0d7e, 0x0e7e, 0x0f7e, 0x2091, 0x8000, 0x2071,
273 0x5040, 0x2079, 0x0100, 0x2061, 0x0010, 0x70a0, 0xa06d, 0x0040,
274 0x18aa, 0x6a04, 0xa294, 0x00ff, 0xa286, 0x0007, 0x0040, 0x1844,
275 0xa286, 0x000f, 0x00c0, 0x18aa, 0x691c, 0xa184, 0x0080, 0x00c0,
276 0x18aa, 0x6824, 0xa18c, 0xff00, 0xa085, 0x0019, 0x6826, 0x71b0,
277 0x81ff, 0x0040, 0x1865, 0x0d7e, 0x2069, 0x0020, 0x6908, 0x6808,
278 0xa106, 0x00c0, 0x1856, 0x690c, 0x680c, 0xa106, 0x00c0, 0x185b,
279 0xa184, 0x00ff, 0x00c0, 0x185b, 0x0d7f, 0x78b8, 0xa084, 0x801f,
280 0x00c0, 0x1865, 0x7848, 0xa085, 0x000c, 0x784a, 0x71b0, 0x81ff,
281 0x0040, 0x1888, 0x70b3, 0x0000, 0x0d7e, 0x2069, 0x0020, 0x6807,
282 0x0008, 0x6804, 0xa084, 0x0008, 0x00c0, 0x1879, 0x6807, 0x0008,
283 0x6804, 0xa084, 0x0008, 0x00c0, 0x1880, 0x6807, 0x0002, 0x0d7f,
284 0x61c4, 0x62c8, 0x63cc, 0x61c6, 0x62ca, 0x63ce, 0x0e7e, 0x2071,
285 0x5000, 0x7266, 0x736a, 0xae80, 0x0019, 0x0e7f, 0x1078, 0x4598,
286 0x78a3, 0x0000, 0x7858, 0xa084, 0xedff, 0x785a, 0x70b4, 0xa080,
287 0x00da, 0x781a, 0x0f7f, 0x0e7f, 0x0d7f, 0x0c7f, 0x2091, 0x8001,
288 0x0078, 0x1284, 0x0f7f, 0x0e7f, 0x0d7f, 0x0c7f, 0x2091, 0x8001,
289 0x2001, 0x4005, 0x0078, 0x1286, 0x7980, 0x71c6, 0x71c4, 0xa182,
290 0x0003, 0x00c8, 0x127c, 0x7982, 0x0078, 0x1284, 0x7980, 0x71c6,
291 0x0078, 0x1284, 0x7974, 0x71c6, 0x71c4, 0x7976, 0x7978, 0x71ca,
292 0x71c8, 0x797a, 0x797c, 0x71ce, 0x71cc, 0x797e, 0x0078, 0x1284,
293 0x7974, 0x71c6, 0x7978, 0x71ca, 0x797c, 0x71ce, 0x0078, 0x1284,
294 0x7900, 0x71c6, 0x71c4, 0x7902, 0x2001, 0x04fd, 0x2004, 0xa082,
295 0x0005, 0x0048, 0x18e7, 0x0038, 0x18e9, 0x0078, 0x18f3, 0x00a8,
296 0x18f3, 0xa18c, 0x0001, 0x00c0, 0x18f1, 0x20b9, 0x2222, 0x0078,
297 0x18f3, 0x20b9, 0x1212, 0x0078, 0x1284, 0x7900, 0x71c6, 0x0078,
298 0x1284, 0x2009, 0x5074, 0x2104, 0x70c6, 0x70c4, 0x200a, 0x0078,
299 0x1284, 0x2009, 0x5074, 0x2104, 0x70c6, 0x0078, 0x1284, 0xac80,
300 0x0001, 0x1078, 0x1af2, 0x007c, 0xac80, 0x0001, 0x1078, 0x1a92,
301 0x007c, 0x7850, 0xa065, 0x0040, 0x1919, 0x2c04, 0x7852, 0x2063,
302 0x0000, 0x007c, 0x0f7e, 0x2079, 0x5000, 0x7850, 0xa06d, 0x0040,
303 0x1929, 0x2d04, 0x7852, 0x6803, 0x0000, 0x6807, 0x0000, 0x680b,
304 0x0000, 0x0f7f, 0x007c, 0x2091, 0x8000, 0x0f7e, 0x2079, 0x5000,
305 0x7850, 0x2062, 0x2c00, 0xa005, 0x00c0, 0x1938, 0x1078, 0x23ca,
306 0x7852, 0x0f7f, 0x2091, 0x8001, 0x007c, 0x0f7e, 0x2079, 0x5000,
307 0x7850, 0x206a, 0x2d00, 0x7852, 0x0f7f, 0x007c, 0x2011, 0x7700,
308 0x7a52, 0x7bec, 0x8319, 0x0040, 0x1953, 0xa280, 0x0031, 0x2012,
309 0x2010, 0x0078, 0x194a, 0x2013, 0x0000, 0x007c, 0xa784, 0x0f00,
310 0x800b, 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105,
311 0xa0e8, 0x5300, 0x007c, 0x1078, 0x1956, 0x2900, 0x682a, 0x2a00,
312 0x682e, 0x6808, 0xa084, 0xffef, 0xa80d, 0x690a, 0x2009, 0x5052,
313 0x210c, 0x6804, 0xa005, 0x0040, 0x1995, 0xa116, 0x00c0, 0x1980,
314 0x2060, 0x6000, 0x6806, 0x017e, 0x200b, 0x0000, 0x0078, 0x1983,
315 0x2009, 0x0000, 0x017e, 0x6804, 0xa065, 0x0040, 0x1992, 0x6000,
316 0x6806, 0x1078, 0x19a3, 0x1078, 0x1c42, 0x6810, 0x8001, 0x6812,
317 0x00c0, 0x1983, 0x017f, 0x6902, 0x6906, 0x007c, 0xa065, 0x0040,
318 0x19a2, 0x609c, 0x609f, 0x0000, 0x2008, 0x1078, 0x192b, 0x2100,
319 0x0078, 0x1996, 0x007c, 0x6007, 0x0103, 0x608f, 0x0000, 0x20a9,
320 0x001c, 0xac80, 0x0005, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x6828,
321 0x601a, 0x682c, 0x6022, 0x007c, 0x0e7e, 0x2071, 0x5040, 0x704c,
322 0xa08c, 0x0200, 0x00c0, 0x19c2, 0xa088, 0x5080, 0x2d0a, 0x8000,
323 0x704e, 0xa006, 0x0e7f, 0x007c, 0x1078, 0x1956, 0x2091, 0x8000,
324 0x6804, 0x781e, 0xa065, 0x0040, 0x1a0d, 0x0078, 0x19d5, 0x2c00,
325 0x781e, 0x6000, 0xa065, 0x0040, 0x1a0d, 0x600c, 0xa306, 0x00c0,
326 0x19cf, 0x6010, 0xa206, 0x00c0, 0x19cf, 0x2c28, 0x2001, 0x5052,
327 0x2004, 0xac06, 0x00c0, 0x19e6, 0x0078, 0x1a0b, 0x6804, 0xac06,
328 0x00c0, 0x19f3, 0x6000, 0xa065, 0x6806, 0x00c0, 0x19fd, 0x6803,
329 0x0000, 0x0078, 0x19fd, 0x6400, 0x781c, 0x2060, 0x6402, 0xa486,
330 0x0000, 0x00c0, 0x19fd, 0x2c00, 0x6802, 0x2560, 0x1078, 0x19a3,
331 0x601b, 0x0005, 0x6023, 0x0020, 0x1078, 0x1c42, 0x6810, 0x8001,
332 0x1050, 0x23ca, 0x6812, 0xa085, 0xffff, 0x007c, 0x2039, 0x0000,
333 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 0x2091, 0x8000,
334 0x1078, 0x1963, 0x8738, 0xa784, 0x001f, 0x00c0, 0x1a18, 0xa7bc,
335 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0, 0x1a18,
336 0x2091, 0x8001, 0x007c, 0x2061, 0x0000, 0x6018, 0xa084, 0x0001,
337 0x00c0, 0x1a3c, 0x2091, 0x8000, 0x78e0, 0x78e3, 0x0000, 0x2091,
338 0x8001, 0xa005, 0x00c0, 0x1a3d, 0x007c, 0xa08c, 0xfff0, 0x0040,
339 0x1a43, 0x1078, 0x23ca, 0x0079, 0x1a45, 0x1a55, 0x1a58, 0x1a5e,
340 0x1a62, 0x1a56, 0x1a66, 0x1a6c, 0x1a56, 0x1a56, 0x1c0c, 0x1c30,
341 0x1c34, 0x1a56, 0x1a56, 0x1a56, 0x1a56, 0x007c, 0x1078, 0x23ca,
342 0x1078, 0x1a0e, 0x2001, 0x8001, 0x0078, 0x1c3a, 0x2001, 0x8003,
343 0x0078, 0x1c3a, 0x2001, 0x8004, 0x0078, 0x1c3a, 0x1078, 0x1a0e,
344 0x2001, 0x8006, 0x0078, 0x1c3a, 0x2001, 0x8007, 0x0078, 0x1c3a,
345 0x2030, 0x2138, 0xa782, 0x0021, 0x0048, 0x1a78, 0x2009, 0x0020,
346 0x2600, 0x1078, 0x1a92, 0x00c0, 0x1a91, 0xa7ba, 0x0020, 0x0048,
347 0x1a90, 0x0040, 0x1a90, 0x2708, 0xa6b0, 0x0020, 0xa290, 0x0040,
348 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x0078, 0x1a72,
349 0xa006, 0x007c, 0x81ff, 0x0040, 0x1acd, 0x2099, 0x0030, 0x20a0,
350 0x700c, 0xa084, 0x00ff, 0x0040, 0x1aa4, 0x7007, 0x0004, 0x7004,
351 0xa084, 0x0004, 0x00c0, 0x1a9f, 0x21a8, 0x7017, 0x0000, 0x810b,
352 0x7112, 0x721a, 0x731e, 0x7422, 0x7526, 0x780c, 0xa085, 0x0001,
353 0x7002, 0x7007, 0x0001, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005,
354 0x00c8, 0x1ac1, 0x2009, 0x0022, 0x2104, 0xa084, 0x4000, 0x00c0,
355 0x1ab3, 0x7008, 0x800b, 0x00c8, 0x1ab3, 0x7007, 0x0002, 0xa08c,
356 0x01e0, 0x00c0, 0x1acd, 0x53a5, 0xa006, 0x7003, 0x0000, 0x007c,
357 0x2030, 0x2138, 0xa782, 0x0021, 0x0048, 0x1ad8, 0x2009, 0x0020,
358 0x2600, 0x1078, 0x1af2, 0x00c0, 0x1af1, 0xa7ba, 0x0020, 0x0048,
359 0x1af0, 0x0040, 0x1af0, 0x2708, 0xa6b0, 0x0020, 0xa290, 0x0040,
360 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x0078, 0x1ad2,
361 0xa006, 0x007c, 0x81ff, 0x0040, 0x1b33, 0x2098, 0x20a1, 0x0030,
362 0x700c, 0xa084, 0x00ff, 0x0040, 0x1b04, 0x7007, 0x0004, 0x7004,
363 0xa084, 0x0004, 0x00c0, 0x1aff, 0x21a8, 0x7017, 0x0000, 0x810b,
364 0x7112, 0x721a, 0x731e, 0x7422, 0x7526, 0x780c, 0xa085, 0x0000,
365 0x7002, 0x53a6, 0x7007, 0x0001, 0x2001, 0x04fd, 0x2004, 0xa082,
366 0x0005, 0x00c8, 0x1b22, 0x2009, 0x0022, 0x2104, 0xa084, 0x4000,
367 0x00c0, 0x1b14, 0x7010, 0xa084, 0xf000, 0x0040, 0x1b2b, 0x7007,
368 0x0008, 0x0078, 0x1b2f, 0x7108, 0x8103, 0x00c8, 0x1b14, 0x7007,
369 0x0002, 0xa184, 0x01e0, 0x7003, 0x0000, 0x007c, 0x2001, 0x04fd,
370 0x2004, 0xa082, 0x0004, 0x00c8, 0x1b3f, 0x0078, 0x1b42, 0xa006,
371 0x0078, 0x1b44, 0xa085, 0x0001, 0x007c, 0x0e7e, 0x2071, 0x5000,
372 0x2d08, 0x7058, 0x6802, 0xa005, 0x00c0, 0x1b4f, 0x715e, 0x715a,
373 0x0e7f, 0x007c, 0x2c08, 0x7858, 0x6002, 0xa005, 0x00c0, 0x1b59,
374 0x795e, 0x795a, 0x007c, 0x2091, 0x8000, 0x6003, 0x0000, 0x2c08,
375 0x785c, 0xa065, 0x00c0, 0x1b67, 0x795a, 0x0078, 0x1b68, 0x6102,
376 0x795e, 0x2091, 0x8001, 0x1078, 0x21ce, 0x007c, 0x0e7e, 0x2071,
377 0x5000, 0x7058, 0xa06d, 0x0040, 0x1b7c, 0x6800, 0x705a, 0xa005,
378 0x00c0, 0x1b7b, 0x705e, 0x8dff, 0x0e7f, 0x007c, 0x0d7e, 0x0c7e,
379 0x0f7e, 0x2079, 0x5000, 0xaf80, 0x0016, 0x2060, 0x6000, 0xa005,
380 0x0040, 0x1bac, 0x2068, 0x6814, 0xa306, 0x00c0, 0x1b95, 0x6828,
381 0xa084, 0x00ff, 0xa406, 0x0040, 0x1b98, 0x2d60, 0x0078, 0x1b86,
382 0x6800, 0xa005, 0x6002, 0x00c0, 0x1ba4, 0xaf80, 0x0016, 0xac06,
383 0x0040, 0x1ba3, 0x2c00, 0x785e, 0x0d7e, 0x689c, 0xa005, 0x0040,
384 0x1bab, 0x1078, 0x1996, 0x007f, 0x0f7f, 0x0c7f, 0x0d7f, 0xa005,
385 0x007c, 0x0d7e, 0x0c7e, 0x0f7e, 0x2079, 0x5000, 0xaf80, 0x0016,
386 0x2060, 0x6000, 0xa005, 0x0040, 0x1bdb, 0x2068, 0x6814, 0xa084,
387 0x00ff, 0xa306, 0x0040, 0x1bc7, 0x2d60, 0x0078, 0x1bb9, 0x6800,
388 0xa005, 0x6002, 0x00c0, 0x1bd3, 0xaf80, 0x0016, 0xac06, 0x0040,
389 0x1bd2, 0x2c00, 0x785e, 0x0d7e, 0x689c, 0xa005, 0x0040, 0x1bda,
390 0x1078, 0x1996, 0x007f, 0x0f7f, 0x0c7f, 0x0d7f, 0xa005, 0x007c,
391 0x0d7e, 0x0c7e, 0x0f7e, 0x2079, 0x5000, 0xaf80, 0x0016, 0x2060,
392 0x6000, 0xa06d, 0x0040, 0x1c07, 0x6814, 0xa306, 0x0040, 0x1bf3,
393 0x2d60, 0x0078, 0x1be8, 0x6800, 0xa005, 0x6002, 0x00c0, 0x1bff,
394 0xaf80, 0x0016, 0xac06, 0x0040, 0x1bfe, 0x2c00, 0x785e, 0x0d7e,
395 0x689c, 0xa005, 0x0040, 0x1c06, 0x1078, 0x1996, 0x007f, 0x0f7f,
396 0x0c7f, 0x0d7f, 0xa005, 0x007c, 0x2091, 0x8000, 0x2069, 0x5040,
397 0x6800, 0xa086, 0x0000, 0x0040, 0x1c1a, 0x2091, 0x8001, 0x78e3,
398 0x0009, 0x007c, 0x6880, 0xa0bc, 0xff00, 0x2041, 0x0021, 0x2049,
399 0x0004, 0x2051, 0x0010, 0x1078, 0x1963, 0x8738, 0xa784, 0x001f,
400 0x00c0, 0x1c23, 0x2091, 0x8001, 0x2001, 0x800a, 0x0078, 0x1c3a,
401 0x2001, 0x800c, 0x0078, 0x1c3a, 0x1078, 0x1a0e, 0x2001, 0x800d,
402 0x0078, 0x1c3a, 0x70c2, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091,
403 0x4080, 0x007c, 0x6004, 0x2c08, 0x2063, 0x0000, 0x7884, 0x8000,
404 0x7886, 0x7888, 0xa005, 0x798a, 0x0040, 0x1c51, 0x2c02, 0x0078,
405 0x1c52, 0x798e, 0x007c, 0x6807, 0x0103, 0x0c7e, 0x2061, 0x5000,
406 0x2d08, 0x206b, 0x0000, 0x6084, 0x8000, 0x6086, 0x6088, 0xa005,
407 0x618a, 0x0040, 0x1c66, 0x2d02, 0x0078, 0x1c67, 0x618e, 0x0c7f,
408 0x007c, 0x1078, 0x1c7a, 0x0040, 0x1c79, 0x0c7e, 0x609c, 0xa065,
409 0x0040, 0x1c74, 0x1078, 0x1996, 0x0c7f, 0x609f, 0x0000, 0x1078,
410 0x192b, 0x007c, 0x788c, 0xa065, 0x0040, 0x1c8c, 0x2091, 0x8000,
411 0x7884, 0x8001, 0x7886, 0x2c04, 0x788e, 0xa005, 0x00c0, 0x1c8a,
412 0x788a, 0x8000, 0x2091, 0x8001, 0x007c, 0x20a9, 0x0010, 0xa006,
413 0x8004, 0x8086, 0x818e, 0x00c8, 0x1c96, 0xa200, 0x0070, 0x1c9a,
414 0x0078, 0x1c91, 0x8086, 0x818e, 0x007c, 0x157e, 0x20a9, 0x0010,
415 0xa005, 0x0040, 0x1cc0, 0xa11a, 0x00c8, 0x1cc0, 0x8213, 0x818d,
416 0x0048, 0x1cb1, 0xa11a, 0x00c8, 0x1cb2, 0x0070, 0x1cb8, 0x0078,
417 0x1ca6, 0xa11a, 0x2308, 0x8210, 0x0070, 0x1cb8, 0x0078, 0x1ca6,
418 0x007e, 0x3200, 0xa084, 0xf7ff, 0x2080, 0x007f, 0x157f, 0x007c,
419 0x007e, 0x3200, 0xa085, 0x0800, 0x0078, 0x1cbc, 0x7994, 0x70d0,
420 0xa106, 0x0040, 0x1d34, 0x2091, 0x8000, 0x2071, 0x0020, 0x7004,
421 0xa005, 0x00c0, 0x1d34, 0x7008, 0x7208, 0xa206, 0x00c0, 0x1d34,
422 0xa286, 0x0008, 0x00c0, 0x1d34, 0x2071, 0x0010, 0x1078, 0x1911,
423 0x0040, 0x1d34, 0x7a9c, 0x7b98, 0x7ca4, 0x7da0, 0xa184, 0xff00,
424 0x0040, 0x1d02, 0x2031, 0x0000, 0x810b, 0x86b5, 0x810b, 0x86b5,
425 0x810b, 0x86b5, 0x810b, 0x86b5, 0x810b, 0x86b5, 0x810b, 0x86b5,
426 0x2100, 0xa210, 0x2600, 0xa319, 0xa4a1, 0x0000, 0xa5a9, 0x0000,
427 0x0078, 0x1d0c, 0x8107, 0x8004, 0x8004, 0xa210, 0xa399, 0x0000,
428 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x2009, 0x0020, 0x1078, 0x190c,
429 0x2091, 0x8001, 0x0040, 0x1d2b, 0x1078, 0x192b, 0x78a8, 0x8000,
430 0x78aa, 0xa086, 0x0002, 0x00c0, 0x1d34, 0x2091, 0x8000, 0x78e3,
431 0x0002, 0x78ab, 0x0000, 0x78cc, 0xa085, 0x0003, 0x78ce, 0x2091,
432 0x8001, 0x0078, 0x1d34, 0x78ab, 0x0000, 0x1078, 0x208b, 0x6004,
433 0xa084, 0x000f, 0x0079, 0x1d39, 0x2071, 0x0010, 0x2091, 0x8001,
434 0x007c, 0x1d49, 0x1d6b, 0x1d91, 0x1d49, 0x1dae, 0x1d58, 0x1f0d,
435 0x1f28, 0x1d49, 0x1d65, 0x1d8b, 0x1df6, 0x1e63, 0x1eb3, 0x1ec5,
436 0x1f24, 0x2039, 0x0400, 0x78dc, 0xa705, 0x78de, 0x6008, 0xa705,
437 0x600a, 0x1078, 0x1fa6, 0x609c, 0x78da, 0x1078, 0x2073, 0x007c,
438 0x78dc, 0xa084, 0x0100, 0x0040, 0x1d5f, 0x0078, 0x1d49, 0x601c,
439 0xa085, 0x0080, 0x601e, 0x0078, 0x1d72, 0x1078, 0x1b36, 0x00c0,
440 0x1d49, 0x1078, 0x20a5, 0x78dc, 0xa084, 0x0100, 0x0040, 0x1d72,
441 0x0078, 0x1d49, 0x78df, 0x0000, 0x6004, 0x8007, 0xa084, 0x00ff,
442 0x78d2, 0x8001, 0x609f, 0x0000, 0x0040, 0x1d88, 0x1078, 0x1fa6,
443 0x0040, 0x1d88, 0x78dc, 0xa085, 0x0100, 0x78de, 0x0078, 0x1d8a,
444 0x1078, 0x1fca, 0x007c, 0x1078, 0x1b36, 0x00c0, 0x1d49, 0x1078,
445 0x20a1, 0x78dc, 0xa08c, 0x0e00, 0x00c0, 0x1d9a, 0xa084, 0x0100,
446 0x00c0, 0x1d9c, 0x0078, 0x1d49, 0x1078, 0x1fa6, 0x00c0, 0x1dad,
447 0x6104, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x1f63, 0xa186,
448 0x000f, 0x0040, 0x1f63, 0x1078, 0x1fca, 0x007c, 0x78dc, 0xa084,
449 0x0100, 0x0040, 0x1db5, 0x0078, 0x1d49, 0x78df, 0x0000, 0x6714,
450 0x2011, 0x0001, 0x20a9, 0x0001, 0x6018, 0xa084, 0x00ff, 0xa005,
451 0x0040, 0x1dd8, 0x2011, 0x0001, 0xa7bc, 0xff00, 0x20a9, 0x0020,
452 0xa08e, 0x0001, 0x0040, 0x1dd8, 0x2039, 0x0000, 0x2011, 0x0002,
453 0x20a9, 0x0100, 0xa08e, 0x0002, 0x0040, 0x1dd8, 0x0078, 0x1df3,
454 0x1078, 0x1956, 0x2091, 0x8000, 0x682b, 0x0000, 0x682f, 0x0000,
455 0x6808, 0xa084, 0xffde, 0x680a, 0xade8, 0x0010, 0x2091, 0x8001,
456 0x0070, 0x1dec, 0x0078, 0x1dda, 0x8211, 0x0040, 0x1df3, 0x20a9,
457 0x0100, 0x0078, 0x1dda, 0x1078, 0x192b, 0x007c, 0x2001, 0x5067,
458 0x2004, 0xa084, 0x8000, 0x0040, 0x1f8b, 0x6114, 0x1078, 0x20c2,
459 0x6900, 0xa184, 0x0001, 0x0040, 0x1e17, 0x6028, 0xa084, 0x00ff,
460 0x00c0, 0x1f83, 0x6800, 0xa084, 0x0001, 0x0040, 0x1f8b, 0x6803,
461 0x0000, 0x680b, 0x0000, 0x6807, 0x0000, 0x0078, 0x1f93, 0x2011,
462 0x0001, 0x6020, 0xa084, 0x4000, 0x0040, 0x1e20, 0xa295, 0x0002,
463 0x6020, 0xa084, 0x0100, 0x0040, 0x1e27, 0xa295, 0x0008, 0x601c,
464 0xa084, 0x0002, 0x0040, 0x1e2e, 0xa295, 0x0004, 0x602c, 0xa08c,
465 0x00ff, 0xa182, 0x0002, 0x0048, 0x1f8f, 0xa182, 0x001b, 0x00c8,
466 0x1f8f, 0x0040, 0x1f8f, 0x690e, 0x602c, 0x8007, 0xa08c, 0x00ff,
467 0xa182, 0x0002, 0x0048, 0x1f8f, 0xa182, 0x001b, 0x00c8, 0x1f8f,
468 0x0040, 0x1f8f, 0x6912, 0x6030, 0xa005, 0x00c0, 0x1e51, 0x2001,
469 0x001e, 0x8000, 0x6816, 0x6028, 0xa084, 0x00ff, 0x0040, 0x1f8b,
470 0x6806, 0x6028, 0x8007, 0xa084, 0x00ff, 0x0040, 0x1f8b, 0x680a,
471 0x6a02, 0x0078, 0x1f93, 0x2001, 0x5067, 0x2004, 0xa084, 0x8000,
472 0x0040, 0x1f8b, 0x6114, 0x1078, 0x20c2, 0x2091, 0x8000, 0x6a04,
473 0x6b08, 0x6418, 0xa484, 0x0003, 0x0040, 0x1e89, 0x6128, 0xa18c,
474 0x00ff, 0x8001, 0x00c0, 0x1e82, 0x2100, 0xa210, 0x0048, 0x1eaf,
475 0x0078, 0x1e89, 0x8001, 0x00c0, 0x1eaf, 0x2100, 0xa212, 0x0048,
476 0x1eaf, 0xa484, 0x000c, 0x0040, 0x1ea3, 0x6128, 0x810f, 0xa18c,
477 0x00ff, 0xa082, 0x0004, 0x00c0, 0x1e9b, 0x2100, 0xa318, 0x0048,
478 0x1eaf, 0x0078, 0x1ea3, 0xa082, 0x0004, 0x00c0, 0x1eaf, 0x2100,
479 0xa31a, 0x0048, 0x1eaf, 0x6030, 0xa005, 0x0040, 0x1ea9, 0x8000,
480 0x6816, 0x6a06, 0x6b0a, 0x2091, 0x8001, 0x0078, 0x1f93, 0x2091,
481 0x8001, 0x0078, 0x1f8f, 0x6114, 0x1078, 0x20c2, 0x2091, 0x8000,
482 0x6b08, 0x8318, 0x0048, 0x1ec1, 0x6b0a, 0x2091, 0x8001, 0x0078,
483 0x1fa2, 0x2091, 0x8001, 0x0078, 0x1f8f, 0x6024, 0x8007, 0xa084,
484 0x00ff, 0x0040, 0x1ee3, 0xa086, 0x0080, 0x00c0, 0x1f0b, 0x20a9,
485 0x0008, 0x2069, 0x7410, 0x2091, 0x8000, 0x6800, 0xa084, 0xfcff,
486 0x6802, 0xade8, 0x0008, 0x0070, 0x1edf, 0x0078, 0x1ed5, 0x2091,
487 0x8001, 0x0078, 0x1f93, 0x6028, 0xa015, 0x0040, 0x1f0b, 0x6114,
488 0x1078, 0x20c2, 0x0d7e, 0xade8, 0x0007, 0x2091, 0x8000, 0x6800,
489 0xa00d, 0x0040, 0x1f08, 0xa206, 0x0040, 0x1ef9, 0x2168, 0x0078,
490 0x1eef, 0x0c7e, 0x2160, 0x6000, 0x6802, 0x1078, 0x192b, 0x0c7f,
491 0x0d7f, 0x6808, 0x8000, 0x680a, 0x2091, 0x8001, 0x0078, 0x1fa2,
492 0x2091, 0x8001, 0x0d7f, 0x0078, 0x1f8b, 0x6114, 0x1078, 0x20c2,
493 0x6800, 0xa084, 0x0001, 0x0040, 0x1f7b, 0x2091, 0x8000, 0x6a04,
494 0x8210, 0x0048, 0x1f20, 0x6a06, 0x2091, 0x8001, 0x0078, 0x1fa2,
495 0x2091, 0x8001, 0x0078, 0x1f8f, 0x1078, 0x1b36, 0x00c0, 0x1d49,
496 0x6114, 0x1078, 0x20c2, 0x60be, 0x6900, 0xa184, 0x0008, 0x0040,
497 0x1f35, 0x6020, 0xa085, 0x0100, 0x6022, 0xa184, 0x0001, 0x0040,
498 0x1f8b, 0xa184, 0x0100, 0x00c0, 0x1f77, 0xa184, 0x0200, 0x00c0,
499 0x1f73, 0x681c, 0xa005, 0x00c0, 0x1f7f, 0x6004, 0xa084, 0x00ff,
500 0xa086, 0x000f, 0x00c0, 0x1f4e, 0x1078, 0x20a5, 0x78df, 0x0000,
501 0x6004, 0x8007, 0xa084, 0x00ff, 0x78d2, 0x8001, 0x609f, 0x0000,
502 0x0040, 0x1f63, 0x1078, 0x1fa6, 0x0040, 0x1f63, 0x78dc, 0xa085,
503 0x0100, 0x78de, 0x007c, 0x78d7, 0x0000, 0x78db, 0x0000, 0x6024,
504 0xa084, 0xff00, 0x6026, 0x1078, 0x39aa, 0x0040, 0x1cc6, 0x1078,
505 0x1b5b, 0x0078, 0x1cc6, 0x2009, 0x0017, 0x0078, 0x1f95, 0x2009,
506 0x000e, 0x0078, 0x1f95, 0x2009, 0x0007, 0x0078, 0x1f95, 0x2009,
507 0x0035, 0x0078, 0x1f95, 0x2009, 0x003e, 0x0078, 0x1f95, 0x2009,
508 0x0004, 0x0078, 0x1f95, 0x2009, 0x0006, 0x0078, 0x1f95, 0x2009,
509 0x0016, 0x0078, 0x1f95, 0x2009, 0x0001, 0x6024, 0xa084, 0xff00,
510 0xa105, 0x6026, 0x2091, 0x8000, 0x1078, 0x1c42, 0x2091, 0x8001,
511 0x0078, 0x1cc6, 0x1078, 0x192b, 0x0078, 0x1cc6, 0x78d4, 0xa06d,
512 0x00c0, 0x1fb1, 0x2c00, 0x78d6, 0x78da, 0x609f, 0x0000, 0x0078,
513 0x1fbd, 0x2c00, 0x689e, 0x609f, 0x0000, 0x78d6, 0x2d00, 0x6002,
514 0x78d8, 0xad06, 0x00c0, 0x1fbd, 0x6002, 0x78d0, 0x8001, 0x78d2,
515 0x00c0, 0x1fc9, 0x78dc, 0xa084, 0xfeff, 0x78de, 0x78d8, 0x2060,
516 0xa006, 0x007c, 0xa02e, 0x2530, 0x611c, 0x61a2, 0xa184, 0xe1ff,
517 0x601e, 0xa184, 0x0060, 0x0040, 0x1fd9, 0x0e7e, 0x1078, 0x467f,
518 0x0e7f, 0x6596, 0x65a6, 0x669a, 0x66aa, 0x60af, 0x0000, 0x60b3,
519 0x0000, 0x6714, 0x1078, 0x1956, 0x2091, 0x8000, 0x60a0, 0xa084,
520 0x8000, 0x00c0, 0x2000, 0x6808, 0xa084, 0x0001, 0x0040, 0x2000,
521 0x2091, 0x8001, 0x1078, 0x19a3, 0x2091, 0x8000, 0x1078, 0x1c42,
522 0x2091, 0x8001, 0x78d7, 0x0000, 0x78db, 0x0000, 0x0078, 0x2072,
523 0x6024, 0xa096, 0x0001, 0x00c0, 0x2007, 0x8000, 0x6026, 0x6a10,
524 0x6814, 0x2091, 0x8001, 0xa202, 0x0048, 0x2016, 0x0040, 0x2016,
525 0x2039, 0x0200, 0x1078, 0x2073, 0x0078, 0x2072, 0x2c08, 0x2091,
526 0x8000, 0x60a0, 0xa084, 0x8000, 0x0040, 0x2043, 0x6800, 0xa065,
527 0x0040, 0x2048, 0x6a04, 0x0e7e, 0x2071, 0x5040, 0x7000, 0xa084,
528 0x0001, 0x0040, 0x203d, 0x7048, 0xa206, 0x00c0, 0x203d, 0x6b04,
529 0x231c, 0x2160, 0x6302, 0x2300, 0xa005, 0x00c0, 0x2038, 0x6902,
530 0x2260, 0x6102, 0x0e7f, 0x0078, 0x204f, 0x2160, 0x6202, 0x6906,
531 0x0e7f, 0x0078, 0x204f, 0x6800, 0xa065, 0x0040, 0x2048, 0x6102,
532 0x6902, 0x00c0, 0x204c, 0x6906, 0x2160, 0x6003, 0x0000, 0x2160,
533 0x60a0, 0xa084, 0x8000, 0x0040, 0x2059, 0x6808, 0xa084, 0xfffc,
534 0x680a, 0x6810, 0x8000, 0x6812, 0x2091, 0x8001, 0x6808, 0xa08c,
535 0x0040, 0x0040, 0x2068, 0xa086, 0x0040, 0x680a, 0x1078, 0x19b4,
536 0x2091, 0x8000, 0x1078, 0x21b1, 0x2091, 0x8001, 0x78db, 0x0000,
537 0x78d7, 0x0000, 0x007c, 0x6008, 0xa705, 0x600a, 0x2091, 0x8000,
538 0x1078, 0x1c42, 0x2091, 0x8001, 0x78d8, 0xa065, 0x0040, 0x2086,
539 0x609c, 0x78da, 0x609f, 0x0000, 0x0078, 0x2076, 0x78d7, 0x0000,
540 0x78db, 0x0000, 0x007c, 0x7990, 0x7894, 0x8000, 0xa10a, 0x00c8,
541 0x2092, 0xa006, 0x7896, 0x70d2, 0x7804, 0xa005, 0x0040, 0x20a0,
542 0x8001, 0x7806, 0x00c0, 0x20a0, 0x0068, 0x20a0, 0x2091, 0x4080,
543 0x007c, 0x2039, 0x20b9, 0x0078, 0x20a7, 0x2039, 0x20bf, 0x2704,
544 0xa005, 0x0040, 0x20b8, 0xac00, 0x2068, 0x6b08, 0x6c0c, 0x6910,
545 0x6a14, 0x690a, 0x6a0e, 0x6b12, 0x6c16, 0x8738, 0x0078, 0x20a7,
546 0x007c, 0x0003, 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0015,
547 0x001b, 0x0000, 0x0c7e, 0x1078, 0x3b33, 0x2c68, 0x0c7f, 0x007c,
548 0x0010, 0x2139, 0x0068, 0x2139, 0x2029, 0x0000, 0x78cb, 0x0000,
549 0x788c, 0xa065, 0x0040, 0x2132, 0x2009, 0x5074, 0x2104, 0xa084,
550 0x0001, 0x0040, 0x2100, 0x6004, 0xa086, 0x0103, 0x00c0, 0x2100,
551 0x6018, 0xa005, 0x00c0, 0x2100, 0x6014, 0xa005, 0x00c0, 0x2100,
552 0x0d7e, 0x2069, 0x0000, 0x6818, 0xa084, 0x0001, 0x00c0, 0x20ff,
553 0x600c, 0x70c6, 0x6010, 0x70ca, 0x70c3, 0x8020, 0x681b, 0x0001,
554 0x2091, 0x4080, 0x0d7f, 0x1078, 0x1c69, 0x0078, 0x2137, 0x0d7f,
555 0x1078, 0x213a, 0x0040, 0x2132, 0x6204, 0xa294, 0x00ff, 0xa296,
556 0x0003, 0x0040, 0x2112, 0x6204, 0xa296, 0x0110, 0x00c0, 0x2120,
557 0x78cb, 0x0001, 0x6204, 0xa294, 0xff00, 0x8217, 0x8211, 0x0040,
558 0x2120, 0x85ff, 0x00c0, 0x2132, 0x8210, 0xa202, 0x00c8, 0x2132,
559 0x057e, 0x1078, 0x2149, 0x057f, 0x0040, 0x212d, 0x78e0, 0xa086,
560 0x0003, 0x0040, 0x2132, 0x0078, 0x2120, 0x8528, 0x78c8, 0xa005,
561 0x0040, 0x20d0, 0x85ff, 0x0040, 0x2139, 0x2091, 0x4080, 0x78b0,
562 0x70d6, 0x007c, 0x7bac, 0x79b0, 0x70d4, 0xa102, 0x00c0, 0x2143,
563 0x2300, 0xa005, 0x007c, 0x0048, 0x2147, 0xa302, 0x007c, 0x8002,
564 0x007c, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x00c8, 0x2163,
565 0x2091, 0x8000, 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0, 0x2198,
566 0x7008, 0x7208, 0xa206, 0x00c0, 0x2198, 0xa286, 0x0008, 0x00c0,
567 0x2198, 0x2071, 0x0010, 0x1078, 0x219d, 0x2009, 0x0020, 0x6004,
568 0xa086, 0x0103, 0x00c0, 0x2172, 0x6028, 0xa005, 0x00c0, 0x2172,
569 0x2009, 0x000c, 0x1078, 0x1907, 0x0040, 0x218b, 0x78c4, 0x8000,
570 0x78c6, 0xa086, 0x0002, 0x00c0, 0x2198, 0x2091, 0x8000, 0x78e3,
571 0x0003, 0x78c7, 0x0000, 0x78cc, 0xa085, 0x0300, 0x78ce, 0x2091,
572 0x8001, 0x0078, 0x2198, 0x78c7, 0x0000, 0x1078, 0x1c69, 0x79ac,
573 0x78b0, 0x8000, 0xa10a, 0x00c8, 0x2196, 0xa006, 0x78b2, 0xa006,
574 0x2071, 0x0010, 0x2091, 0x8001, 0x007c, 0x8107, 0x8004, 0x8004,
575 0x7ab8, 0x7bb4, 0x7cc0, 0x7dbc, 0xa210, 0xa399, 0x0000, 0xa4a1,
576 0x0000, 0xa5a9, 0x0000, 0x007c, 0x2009, 0x505b, 0x2091, 0x8000,
577 0x200a, 0x0f7e, 0x0e7e, 0x2071, 0x5040, 0x7000, 0xa086, 0x0000,
578 0x00c0, 0x21cb, 0x2009, 0x5012, 0x2104, 0xa005, 0x00c0, 0x21cb,
579 0x2079, 0x0100, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x21cb, 0x0018,
580 0x21cb, 0x781b, 0x004b, 0x0e7f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e,
581 0x2071, 0x5040, 0x2091, 0x8000, 0x7000, 0xa086, 0x0000, 0x00c0,
582 0x21e4, 0x2079, 0x0100, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x21e4,
583 0x0018, 0x21e4, 0x781b, 0x004d, 0x2091, 0x8001, 0x0e7f, 0x0f7f,
584 0x007c, 0x127e, 0x2091, 0x2300, 0x2071, 0x5040, 0x2079, 0x0100,
585 0x784b, 0x000f, 0x0098, 0x21f7, 0x7838, 0x0078, 0x21f0, 0x20a9,
586 0x0040, 0x7800, 0xa082, 0x0004, 0x0048, 0x2200, 0x20a9, 0x0060,
587 0x789b, 0x0000, 0x78af, 0x0000, 0x78af, 0x0000, 0x0070, 0x220a,
588 0x0078, 0x2202, 0x7800, 0xa082, 0x0004, 0x0048, 0x2219, 0x70b7,
589 0x009b, 0x2019, 0x4da4, 0x1078, 0x2255, 0x702f, 0x8001, 0x0078,
590 0x2225, 0x70b7, 0x0000, 0x2019, 0x4c1c, 0x1078, 0x2255, 0x2019,
591 0x4c5b, 0x1078, 0x2255, 0x702f, 0x8000, 0x7003, 0x0000, 0x1078,
592 0x235e, 0x7004, 0xa084, 0x000f, 0x017e, 0x2009, 0x04fd, 0x210c,
593 0xa18a, 0x0005, 0x0048, 0x223a, 0x0038, 0x2240, 0xa085, 0x6280,
594 0x0078, 0x2242, 0x0028, 0x2240, 0xa085, 0x6280, 0x0078, 0x2242,
595 0xa085, 0x62c0, 0x017f, 0x7806, 0x780f, 0xb204, 0x7843, 0x00d8,
596 0x7853, 0x0080, 0x780b, 0x0008, 0x7047, 0x0008, 0x7053, 0x507f,
597 0x704f, 0x0000, 0x127f, 0x2000, 0x007c, 0x137e, 0x147e, 0x157e,
598 0x047e, 0x20a1, 0x012b, 0x2304, 0xa005, 0x789a, 0x0040, 0x2275,
599 0x8318, 0x2324, 0x8318, 0x2398, 0x24a8, 0xa484, 0xff00, 0x0040,
600 0x226d, 0xa482, 0x0100, 0x20a9, 0x0100, 0x2020, 0x53a6, 0xa005,
601 0x00c0, 0x2264, 0x3318, 0x0078, 0x225b, 0x047f, 0x157f, 0x147f,
602 0x137f, 0x007c, 0xa18c, 0x000f, 0x2011, 0x0101, 0x2204, 0xa084,
603 0xfff0, 0xa105, 0x2012, 0x1078, 0x235e, 0x007c, 0x2011, 0x0101,
604 0x20a9, 0x0009, 0x810b, 0x0070, 0x228f, 0x0078, 0x228a, 0xa18c,
605 0x0e00, 0x2204, 0xa084, 0xf1ff, 0xa105, 0x2012, 0x007c, 0x2009,
606 0x0101, 0x20a9, 0x0005, 0x8213, 0x0070, 0x22a0, 0x0078, 0x229b,
607 0xa294, 0x00e0, 0x2104, 0xa084, 0xff1f, 0xa205, 0x200a, 0x007c,
608 0x2011, 0x0101, 0x20a9, 0x000c, 0x810b, 0x0070, 0x22b1, 0x0078,
609 0x22ac, 0xa18c, 0xf000, 0x2204, 0xa084, 0x0fff, 0xa105, 0x2012,
610 0x007c, 0x2011, 0x0102, 0x2204, 0xa084, 0xffcf, 0xa105, 0x2012,
611 0x007c, 0x8103, 0x8003, 0xa080, 0x0020, 0x0c7e, 0x2061, 0x0100,
612 0x609a, 0x62ac, 0x63ac, 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080,
613 0x0022, 0x0c7e, 0x2061, 0x0100, 0x609a, 0x60a4, 0xa084, 0xffdf,
614 0x60ae, 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080, 0x0022, 0x0c7e,
615 0x2061, 0x0100, 0x609a, 0x60a4, 0xa085, 0x0020, 0x60ae, 0x0c7f,
616 0x007c, 0x8103, 0x8003, 0xa080, 0x0020, 0x0c7e, 0x2061, 0x0100,
617 0x609a, 0x60a4, 0x62ae, 0x2010, 0x60a4, 0x63ae, 0x2018, 0x0c7f,
618 0x007c, 0x2091, 0x8000, 0x0c7e, 0x0e7e, 0x6818, 0xa005, 0x0040,
619 0x233c, 0x2061, 0x7400, 0x1078, 0x2344, 0x0040, 0x2328, 0x20a9,
620 0x0000, 0x2061, 0x7300, 0x0c7e, 0x1078, 0x2344, 0x0040, 0x2318,
621 0x0c7f, 0x8c60, 0x0070, 0x2316, 0x0078, 0x230b, 0x0078, 0x233c,
622 0x007f, 0xa082, 0x7300, 0x2071, 0x5040, 0x7086, 0x7182, 0x2001,
623 0x0004, 0x706e, 0x7093, 0x000f, 0x1078, 0x21ac, 0x0078, 0x2338,
624 0x60c0, 0xa005, 0x00c0, 0x233c, 0x2071, 0x5040, 0x7182, 0x2c00,
625 0x708a, 0x2001, 0x0006, 0x706e, 0x7093, 0x000f, 0x1078, 0x21ac,
626 0x2001, 0x0000, 0x0078, 0x233e, 0x2001, 0x0001, 0x2091, 0x8001,
627 0xa005, 0x0e7f, 0x0c7f, 0x007c, 0x2c04, 0xa005, 0x0040, 0x235b,
628 0x2060, 0x600c, 0xa306, 0x00c0, 0x2358, 0x6010, 0xa206, 0x00c0,
629 0x2358, 0x6014, 0xa106, 0x00c0, 0x2358, 0xa006, 0x0078, 0x235d,
630 0x6000, 0x0078, 0x2345, 0xa085, 0x0001, 0x007c, 0x2011, 0x5041,
631 0x220c, 0xa18c, 0x000f, 0x2011, 0x013b, 0x2204, 0xa084, 0x0100,
632 0x0040, 0x2374, 0x2021, 0xff04, 0x2122, 0x810b, 0x810b, 0x810b,
633 0x810b, 0xa18d, 0x0f00, 0x2104, 0x007c, 0x0e7e, 0x68e4, 0xa08c,
634 0x0020, 0x0040, 0x23c8, 0xa084, 0x0006, 0x00c0, 0x23c8, 0x6014,
635 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0f0, 0x5280,
636 0x7004, 0xa084, 0x000a, 0x00c0, 0x23c8, 0x7108, 0xa194, 0xff00,
637 0x0040, 0x23c8, 0xa18c, 0x00ff, 0x2001, 0x000c, 0xa106, 0x0040,
638 0x23af, 0x2001, 0x0012, 0xa106, 0x0040, 0x23b3, 0x2001, 0x0014,
639 0xa106, 0x0040, 0x23b7, 0x2001, 0x0019, 0xa106, 0x0040, 0x23bb,
640 0x2001, 0x0032, 0xa106, 0x0040, 0x23bf, 0x0078, 0x23c3, 0x2009,
641 0x0012, 0x0078, 0x23c5, 0x2009, 0x0014, 0x0078, 0x23c5, 0x2009,
642 0x0019, 0x0078, 0x23c5, 0x2009, 0x0020, 0x0078, 0x23c5, 0x2009,
643 0x003f, 0x0078, 0x23c5, 0x2011, 0x0000, 0x2100, 0xa205, 0x700a,
644 0x0e7f, 0x007c, 0x0068, 0x23ca, 0x2091, 0x8000, 0x2071, 0x0000,
645 0x007e, 0x7018, 0xa084, 0x0001, 0x00c0, 0x23d1, 0x007f, 0x2071,
646 0x0010, 0x70ca, 0x007f, 0x70c6, 0x70c3, 0x8002, 0x70db, 0x073f,
647 0x70df, 0x0000, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080,
648 0x0078, 0x23e8, 0x107e, 0x007e, 0x127e, 0x2091, 0x2300, 0x7f3c,
649 0x7e58, 0x7c30, 0x7d38, 0x77c2, 0x74c6, 0x76ca, 0x75ce, 0xa594,
650 0x003f, 0xa49c, 0x0003, 0xa484, 0x000f, 0x0079, 0x23ff, 0x2411,
651 0x2411, 0x2411, 0x274b, 0x3907, 0x240f, 0x2440, 0x244a, 0x240f,
652 0x240f, 0x240f, 0x240f, 0x240f, 0x240f, 0x240f, 0x240f, 0x1078,
653 0x23ca, 0x8507, 0xa084, 0x001f, 0x0079, 0x2416, 0x2454, 0x274b,
654 0x2905, 0x2a02, 0x2a2a, 0x2cc3, 0x2f6e, 0x2fb1, 0x2ffc, 0x3081,
655 0x3139, 0x31e2, 0x2440, 0x2827, 0x2f43, 0x2436, 0x3c78, 0x3c98,
656 0x3e5e, 0x3e6a, 0x3f3f, 0x2436, 0x2436, 0x4012, 0x4016, 0x3c76,
657 0x2436, 0x3dc9, 0x2436, 0x3b56, 0x244a, 0x2436, 0x1078, 0x23ca,
658 0x0018, 0x23ef, 0x127f, 0x2091, 0x8001, 0x007f, 0x107f, 0x007c,
659 0x2019, 0x4cfd, 0x1078, 0x2255, 0x702f, 0x0001, 0x781b, 0x004f,
660 0x0078, 0x2438, 0x2019, 0x4c5b, 0x1078, 0x2255, 0x702f, 0x8000,
661 0x781b, 0x00d5, 0x0078, 0x2438, 0x7242, 0x2009, 0x500f, 0x200b,
662 0x0000, 0xa584, 0x0001, 0x00c0, 0x3b6a, 0x0040, 0x2471, 0x1078,
663 0x23ca, 0x7003, 0x0000, 0x704b, 0x0000, 0x7043, 0x0000, 0x7037,
664 0x0000, 0x1078, 0x38de, 0x0018, 0x23ef, 0x2009, 0x500f, 0x200b,
665 0x0000, 0x7068, 0xa005, 0x00c0, 0x253c, 0x706c, 0xa084, 0x0007,
666 0x0079, 0x247a, 0x2573, 0x2482, 0x248e, 0x24ab, 0x24cd, 0x251a,
667 0x24f3, 0x2482, 0x1078, 0x38c6, 0x2009, 0x0048, 0x1078, 0x2e0f,
668 0x00c0, 0x248c, 0x7003, 0x0004, 0x0078, 0x2438, 0x1078, 0x38c6,
669 0x00c0, 0x24a9, 0x7080, 0x8007, 0x7882, 0x789b, 0x0010, 0x78ab,
670 0x000c, 0x789b, 0x0060, 0x78ab, 0x0001, 0x785b, 0x0004, 0x2009,
671 0x00e5, 0x1078, 0x2e03, 0x00c0, 0x24a9, 0x7003, 0x0004, 0x7093,
672 0x000f, 0x0078, 0x2438, 0x1078, 0x38c6, 0x00c0, 0x24cb, 0x7180,
673 0x8107, 0x7882, 0x789b, 0x0010, 0xa18c, 0x001f, 0xa18d, 0x00c0,
674 0x79aa, 0x78ab, 0x0006, 0x789b, 0x0060, 0x78ab, 0x0002, 0x785b,
675 0x0004, 0x2009, 0x00e5, 0x1078, 0x2e03, 0x00c0, 0x24cb, 0x7003,
676 0x0004, 0x7093, 0x000f, 0x0078, 0x2438, 0x1078, 0x38c6, 0x00c0,
677 0x24f1, 0x7180, 0x8107, 0x7882, 0x789b, 0x0010, 0xa18c, 0x001f,
678 0xa18d, 0x00c0, 0x79aa, 0x78ab, 0x0020, 0x7184, 0x79aa, 0x78ab,
679 0x000d, 0x789b, 0x0060, 0x78ab, 0x0004, 0x785b, 0x0004, 0x2009,
680 0x00e5, 0x1078, 0x2e03, 0x00c0, 0x24f1, 0x7003, 0x0004, 0x7093,
681 0x000f, 0x0078, 0x2438, 0x1078, 0x38c6, 0x00c0, 0x2518, 0x7180,
682 0x8107, 0x7882, 0x789b, 0x0010, 0xa18c, 0x001f, 0xa18d, 0x00c0,
683 0x79aa, 0x78ab, 0x0006, 0x789b, 0x0060, 0x78ab, 0x0002, 0x785b,
684 0x0004, 0x2009, 0x00e5, 0x1078, 0x2e03, 0x00c0, 0x2518, 0x7088,
685 0x708b, 0x0000, 0x2068, 0x704a, 0x7003, 0x0002, 0x7093, 0x000f,
686 0x0078, 0x2438, 0x1078, 0x38c6, 0x00c0, 0x2438, 0x7088, 0x2068,
687 0x6f14, 0x1078, 0x37bd, 0x2c50, 0x1078, 0x3978, 0x789b, 0x0010,
688 0x6814, 0xa084, 0x001f, 0xa085, 0x0080, 0x78aa, 0x6e1c, 0x2041,
689 0x0001, 0x708c, 0xa084, 0x0400, 0x2001, 0x0004, 0x0040, 0x253a,
690 0x2001, 0x0006, 0x0078, 0x265b, 0x1078, 0x38c6, 0x00c0, 0x2438,
691 0x789b, 0x0010, 0x7068, 0x2068, 0x6f14, 0x1078, 0x37bd, 0x2c50,
692 0x1078, 0x3978, 0x6008, 0xa085, 0x0010, 0x600a, 0x6824, 0xa005,
693 0x0040, 0x255a, 0xa082, 0x0006, 0x0048, 0x2558, 0x0078, 0x255a,
694 0x6827, 0x0005, 0x6b14, 0xa39c, 0x001f, 0xa39d, 0x00c0, 0x7058,
695 0xa084, 0x8000, 0x0040, 0x2568, 0xa684, 0x0001, 0x0040, 0x256a,
696 0xa39c, 0xffbf, 0x7baa, 0x2031, 0x0020, 0x2041, 0x0001, 0x2001,
697 0x0003, 0x0078, 0x265b, 0x0018, 0x23ef, 0x744c, 0xa485, 0x0000,
698 0x0040, 0x258d, 0xa080, 0x5080, 0x2030, 0x7150, 0x8108, 0xa12a,
699 0x0048, 0x2584, 0x2009, 0x5080, 0x2164, 0x6504, 0x85ff, 0x00c0,
700 0x259e, 0x8421, 0x00c0, 0x257e, 0x7152, 0x7003, 0x0000, 0x704b,
701 0x0000, 0x7040, 0xa005, 0x0040, 0x3b6a, 0x0078, 0x2438, 0x764c,
702 0xa6b0, 0x5080, 0x7150, 0x2600, 0x0078, 0x2589, 0x7152, 0x2568,
703 0x2558, 0x754a, 0x2c50, 0x6034, 0xa085, 0x0000, 0x00c0, 0x259b,
704 0x6708, 0x773a, 0xa784, 0x033f, 0x0040, 0x25d4, 0xa784, 0x0021,
705 0x00c0, 0x259b, 0xa784, 0x0002, 0x0040, 0x25bd, 0xa784, 0x0004,
706 0x0040, 0x259b, 0xa7bc, 0xfffb, 0x670a, 0xa784, 0x0008, 0x00c0,
707 0x259b, 0xa784, 0x0010, 0x00c0, 0x259b, 0xa784, 0x0200, 0x00c0,
708 0x259b, 0xa784, 0x0100, 0x0040, 0x25d4, 0x6018, 0xa005, 0x00c0,
709 0x259b, 0xa7bc, 0xfeff, 0x670a, 0x6823, 0x0000, 0x6e1c, 0xa684,
710 0x000e, 0x6118, 0x0040, 0x25e4, 0x601c, 0xa102, 0x0048, 0x25e7,
711 0x0040, 0x25e7, 0x0078, 0x2597, 0x81ff, 0x00c0, 0x2597, 0x68c3,
712 0x0000, 0xa784, 0x0080, 0x00c0, 0x25ef, 0x700c, 0x6022, 0xa7bc,
713 0xff7f, 0x670a, 0x1078, 0x3978, 0x0018, 0x23ef, 0x789b, 0x0010,
714 0xa046, 0x1078, 0x38c6, 0x00c0, 0x2438, 0x6b14, 0xa39c, 0x001f,
715 0xa39d, 0x00c0, 0x7058, 0xa084, 0x8000, 0x0040, 0x260b, 0xa684,
716 0x0001, 0x0040, 0x260d, 0xa39c, 0xffbf, 0xa684, 0x0010, 0x0040,
717 0x2613, 0xa39d, 0x0020, 0x7baa, 0x8840, 0xa684, 0x000e, 0x00c0,
718 0x261e, 0xa7bd, 0x0010, 0x670a, 0x0078, 0x2659, 0x7158, 0xa18c,
719 0x0800, 0x0040, 0x33d7, 0x2011, 0x0020, 0xa684, 0x0008, 0x00c0,
720 0x262f, 0x8210, 0xa684, 0x0002, 0x00c0, 0x262f, 0x8210, 0x7aaa,
721 0x8840, 0x1078, 0x38de, 0x6a14, 0x610c, 0x8108, 0xa18c, 0x00ff,
722 0xa1e0, 0x7300, 0x2c64, 0x8cff, 0x0040, 0x2650, 0x6014, 0xa206,
723 0x00c0, 0x263a, 0x60b8, 0x8001, 0x60ba, 0x00c0, 0x2635, 0x0c7e,
724 0x2a60, 0x6008, 0xa085, 0x0100, 0x600a, 0x0c7f, 0x0078, 0x2573,
725 0x1078, 0x38c6, 0x00c0, 0x2438, 0x2a60, 0x610e, 0x79aa, 0x8840,
726 0x7132, 0x2001, 0x0001, 0x007e, 0x715c, 0xa184, 0x0018, 0x0040,
727 0x2676, 0xa184, 0x0010, 0x0040, 0x2669, 0x1078, 0x35d6, 0x00c0,
728 0x2699, 0xa184, 0x0008, 0x0040, 0x2676, 0x69a0, 0xa184, 0x0600,
729 0x00c0, 0x2676, 0x1078, 0x34c7, 0x0078, 0x2699, 0x69a0, 0xa184,
730 0x0800, 0x0040, 0x268d, 0x0c7e, 0x027e, 0x2960, 0x6000, 0xa085,
731 0x2000, 0x6002, 0x6104, 0xa18d, 0x0010, 0x6106, 0x027f, 0x0c7f,
732 0x1078, 0x35d6, 0x00c0, 0x2699, 0x69a0, 0xa184, 0x0200, 0x0040,
733 0x2695, 0x1078, 0x3516, 0x0078, 0x2699, 0xa184, 0x0400, 0x00c0,
734 0x2672, 0x69a0, 0xa184, 0x1000, 0x0040, 0x26a4, 0x6914, 0xa18c,
735 0xff00, 0x810f, 0x1078, 0x22cd, 0x007f, 0x7002, 0xa68c, 0x00e0,
736 0xa684, 0x0060, 0x0040, 0x26b2, 0xa086, 0x0060, 0x00c0, 0x26b2,
737 0xa18d, 0x4000, 0x88ff, 0x0040, 0x26b7, 0xa18d, 0x0004, 0x795a,
738 0x69b6, 0x789b, 0x0060, 0x2800, 0x78aa, 0x789b, 0x0061, 0x6818,
739 0xa08d, 0x8000, 0xa084, 0x7fff, 0x691a, 0xa68c, 0x0080, 0x0040,
740 0x26d6, 0x7097, 0x0000, 0xa08a, 0x000d, 0x0050, 0x26d4, 0xa08a,
741 0x000c, 0x7196, 0x2001, 0x000c, 0x800c, 0x719a, 0x78aa, 0x8008,
742 0x810c, 0x0040, 0x33dd, 0xa18c, 0x00f8, 0x00c0, 0x33dd, 0x157e,
743 0x137e, 0x147e, 0x20a1, 0x012b, 0x789b, 0x0000, 0x8000, 0x80ac,
744 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 0x6814,
745 0x8007, 0x7882, 0x6d94, 0x7dd6, 0x7dde, 0x6e98, 0x7ed2, 0x7eda,
746 0x1078, 0x38c6, 0x00c0, 0x270d, 0x702c, 0x8003, 0x0048, 0x2706,
747 0x2019, 0x4c5b, 0x1078, 0x2255, 0x702f, 0x8000, 0x7830, 0xa084,
748 0x00c0, 0x00c0, 0x270d, 0x0098, 0x2715, 0x6008, 0xa084, 0xffef,
749 0x600a, 0x1078, 0x38de, 0x0078, 0x2461, 0x7200, 0xa284, 0x0007,
750 0xa086, 0x0001, 0x00c0, 0x2722, 0x781b, 0x004f, 0x1078, 0x38de,
751 0x0078, 0x2733, 0x6ab4, 0xa295, 0x2000, 0x7a5a, 0x781b, 0x004f,
752 0x1078, 0x38de, 0x7200, 0x2500, 0xa605, 0x0040, 0x2733, 0xa284,
753 0x0007, 0x1079, 0x2741, 0xad80, 0x0009, 0x7036, 0xa284, 0x0007,
754 0xa086, 0x0001, 0x00c0, 0x2438, 0x6018, 0x8000, 0x601a, 0x0078,
755 0x2438, 0x2749, 0x48f7, 0x48f7, 0x48e6, 0x48f7, 0x2749, 0x48e6,
756 0x2749, 0x1078, 0x23ca, 0x1078, 0x38c6, 0x0f7e, 0x2079, 0x5000,
757 0x78cc, 0x0f7f, 0xa084, 0x0001, 0x0040, 0x276f, 0x706c, 0xa086,
758 0x0001, 0x00c0, 0x275e, 0x706e, 0x0078, 0x2802, 0x706c, 0xa086,
759 0x0005, 0x00c0, 0x276d, 0x7088, 0x2068, 0x681b, 0x0004, 0x6817,
760 0x0000, 0x6820, 0xa085, 0x0008, 0x6822, 0x706f, 0x0000, 0x2011,
761 0x0004, 0x716c, 0xa186, 0x0001, 0x0040, 0x2790, 0xa186, 0x0007,
762 0x00c0, 0x2780, 0x2009, 0x5038, 0x200b, 0x0005, 0x0078, 0x2790,
763 0x2009, 0x5013, 0x2104, 0x2009, 0x5012, 0x200a, 0x2009, 0x5038,
764 0x200b, 0x0001, 0x706f, 0x0000, 0x7073, 0x0001, 0x0078, 0x2792,
765 0x706f, 0x0000, 0x1078, 0x4633, 0x157e, 0x20a9, 0x0010, 0x2039,
766 0x0000, 0x1078, 0x36b0, 0xa7b8, 0x0100, 0x0070, 0x27a1, 0x0078,
767 0x2799, 0x157f, 0x7000, 0x0079, 0x27a5, 0x27d3, 0x27ba, 0x27ba,
768 0x27ad, 0x27d3, 0x27d3, 0x27d3, 0x27d3, 0x2021, 0x505a, 0x2404,
769 0xa005, 0x0040, 0x27d3, 0xad06, 0x00c0, 0x27ba, 0x6800, 0x2022,
770 0x0078, 0x27ca, 0x6820, 0xa084, 0x0001, 0x00c0, 0x27c6, 0x6f14,
771 0x1078, 0x37bd, 0x1078, 0x33ae, 0x0078, 0x27ca, 0x7060, 0x2060,
772 0x6800, 0x6002, 0x6a1a, 0x6817, 0x0000, 0x6820, 0xa085, 0x0008,
773 0x6822, 0x1078, 0x1c53, 0x2021, 0x7400, 0x1078, 0x280f, 0x2021,
774 0x505a, 0x1078, 0x280f, 0x157e, 0x20a9, 0x0000, 0x2021, 0x7300,
775 0x1078, 0x280f, 0x8420, 0x0070, 0x27e7, 0x0078, 0x27e0, 0x2061,
776 0x5300, 0x2021, 0x0002, 0x20a9, 0x0100, 0x6018, 0x6110, 0x81ff,
777 0x0040, 0x27f6, 0xa102, 0x0050, 0x27f6, 0x6012, 0x601b, 0x0000,
778 0xace0, 0x0010, 0x0070, 0x27fe, 0x0078, 0x27ed, 0x8421, 0x00c0,
779 0x27eb, 0x157f, 0x709c, 0xa084, 0x8000, 0x0040, 0x2809, 0x1078,
780 0x39cc, 0x7003, 0x0000, 0x704b, 0x0000, 0x0078, 0x2438, 0x047e,
781 0x2404, 0xa005, 0x0040, 0x2823, 0x2068, 0x6800, 0x007e, 0x6a1a,
782 0x6817, 0x0000, 0x6820, 0xa085, 0x0008, 0x6822, 0x1078, 0x1c53,
783 0x007f, 0x0078, 0x2811, 0x047f, 0x2023, 0x0000, 0x007c, 0xa282,
784 0x0003, 0x0050, 0x282d, 0x1078, 0x23ca, 0x2300, 0x0079, 0x2830,
785 0x2833, 0x28a6, 0x28c3, 0xa282, 0x0002, 0x0040, 0x2839, 0x1078,
786 0x23ca, 0x706c, 0x706f, 0x0000, 0x7093, 0x0000, 0x0079, 0x2840,
787 0x2848, 0x2848, 0x284a, 0x287e, 0x33e3, 0x2848, 0x287e, 0x2848,
788 0x1078, 0x23ca, 0x7780, 0x1078, 0x36b0, 0x7780, 0xa7bc, 0x0f00,
789 0x1078, 0x37bd, 0x6018, 0xa005, 0x0040, 0x2875, 0x2021, 0x7400,
790 0x2009, 0x0004, 0x2011, 0x0010, 0x1078, 0x28de, 0x0040, 0x2875,
791 0x157e, 0x20a9, 0x0000, 0x2021, 0x7300, 0x047e, 0x2009, 0x0004,
792 0x2011, 0x0010, 0x1078, 0x28de, 0x047f, 0x0040, 0x2874, 0x8420,
793 0x0070, 0x2874, 0x0078, 0x2865, 0x157f, 0x8738, 0xa784, 0x001f,
794 0x00c0, 0x2850, 0x0078, 0x2461, 0x0078, 0x2461, 0x7780, 0x1078,
795 0x37bd, 0x6018, 0xa005, 0x0040, 0x28a4, 0x2021, 0x7400, 0x2009,
796 0x0005, 0x2011, 0x0020, 0x1078, 0x28de, 0x0040, 0x28a4, 0x157e,
797 0x20a9, 0x0000, 0x2021, 0x7300, 0x047e, 0x2009, 0x0005, 0x2011,
798 0x0020, 0x1078, 0x28de, 0x047f, 0x0040, 0x28a3, 0x8420, 0x0070,
799 0x28a3, 0x0078, 0x2894, 0x157f, 0x0078, 0x2461, 0x2200, 0x0079,
800 0x28a9, 0x28ac, 0x28ae, 0x28ae, 0x1078, 0x23ca, 0x2009, 0x0012,
801 0x706c, 0xa086, 0x0002, 0x0040, 0x28b7, 0x2009, 0x000e, 0x6818,
802 0xa084, 0x8000, 0x0040, 0x28bd, 0x691a, 0x706f, 0x0000, 0x7073,
803 0x0001, 0x0078, 0x3854, 0x2200, 0x0079, 0x28c6, 0x28cb, 0x28ae,
804 0x28c9, 0x1078, 0x23ca, 0x1078, 0x4633, 0x7000, 0xa086, 0x0001,
805 0x00c0, 0x3373, 0x1078, 0x33c4, 0x6008, 0xa084, 0xffef, 0x600a,
806 0x1078, 0x3366, 0x0040, 0x3373, 0x0078, 0x2573, 0x2404, 0xa005,
807 0x0040, 0x2901, 0x2068, 0x2d04, 0x007e, 0x6814, 0xa706, 0x0040,
808 0x28ed, 0x2d20, 0x007f, 0x0078, 0x28df, 0x007f, 0x2022, 0x691a,
809 0x6817, 0x0000, 0x6820, 0xa205, 0x6822, 0x1078, 0x1c53, 0x6010,
810 0x8001, 0x6012, 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x33c4,
811 0x007c, 0xa085, 0x0001, 0x0078, 0x2900, 0x2300, 0x0079, 0x2908,
812 0x290d, 0x290b, 0x29a6, 0x1078, 0x23ca, 0x78ec, 0xa084, 0x0001,
813 0x00c0, 0x2921, 0x7000, 0xa086, 0x0004, 0x00c0, 0x2919, 0x0078,
814 0x2944, 0x1078, 0x33c4, 0x6008, 0xa084, 0xffef, 0x600a, 0x0078,
815 0x3373, 0x78e4, 0xa005, 0x00d0, 0x2944, 0x0018, 0x2438, 0x2008,
816 0xa084, 0x0030, 0x00c0, 0x2930, 0x781b, 0x004f, 0x0078, 0x2438,
817 0x78ec, 0xa084, 0x0003, 0x0040, 0x292c, 0x2100, 0xa084, 0x0007,
818 0x0079, 0x293a, 0x297d, 0x2988, 0x296e, 0x2942, 0x38b9, 0x38b9,
819 0x2942, 0x2997, 0x1078, 0x23ca, 0x7000, 0xa086, 0x0004, 0x00c0,
820 0x295e, 0x706c, 0xa086, 0x0002, 0x00c0, 0x2954, 0x2011, 0x0002,
821 0x2019, 0x0000, 0x0078, 0x2827, 0x706c, 0xa086, 0x0006, 0x0040,
822 0x294e, 0x706c, 0xa086, 0x0004, 0x0040, 0x294e, 0x79e4, 0xa184,
823 0x0030, 0x0040, 0x2968, 0x78ec, 0xa084, 0x0003, 0x00c0, 0x296a,
824 0x0078, 0x2f43, 0x2001, 0x0003, 0x0078, 0x2cd7, 0x6818, 0xa084,
825 0x8000, 0x0040, 0x2975, 0x681b, 0x001d, 0x1078, 0x368f, 0x782b,
826 0x3008, 0x781b, 0x0056, 0x0078, 0x2438, 0x6818, 0xa084, 0x8000,
827 0x0040, 0x2984, 0x681b, 0x001d, 0x1078, 0x368f, 0x0078, 0x3884,
828 0x6818, 0xa084, 0x8000, 0x0040, 0x298f, 0x681b, 0x001d, 0x1078,
829 0x368f, 0x782b, 0x3008, 0x781b, 0x00d2, 0x0078, 0x2438, 0x6818,
830 0xa084, 0x8000, 0x0040, 0x299e, 0x681b, 0x001d, 0x1078, 0x368f,
831 0x782b, 0x3008, 0x781b, 0x0093, 0x0078, 0x2438, 0xa584, 0x000f,
832 0x00c0, 0x29c3, 0x7000, 0x0079, 0x29ad, 0x2461, 0x29b7, 0x29b5,
833 0x3373, 0x3373, 0x3373, 0x3373, 0x29b5, 0x1078, 0x23ca, 0x1078,
834 0x33c4, 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x3366, 0x0040,
835 0x3373, 0x0078, 0x2573, 0x78e4, 0xa005, 0x00d0, 0x2944, 0x0018,
836 0x2944, 0x2008, 0xa084, 0x0030, 0x00c0, 0x29d2, 0x781b, 0x004f,
837 0x0078, 0x2438, 0x78ec, 0xa084, 0x0003, 0x0040, 0x29ce, 0x2100,
838 0xa184, 0x0007, 0x0079, 0x29dc, 0x29ee, 0x29f2, 0x29e6, 0x29e4,
839 0x38b9, 0x38b9, 0x29e4, 0x38af, 0x1078, 0x23ca, 0x1078, 0x3697,
840 0x782b, 0x3008, 0x781b, 0x0056, 0x0078, 0x2438, 0x1078, 0x3697,
841 0x0078, 0x3884, 0x1078, 0x3697, 0x782b, 0x3008, 0x781b, 0x00d2,
842 0x0078, 0x2438, 0x1078, 0x3697, 0x782b, 0x3008, 0x781b, 0x0093,
843 0x0078, 0x2438, 0x2300, 0x0079, 0x2a05, 0x2a0a, 0x2a08, 0x2a0c,
844 0x1078, 0x23ca, 0x0078, 0x3081, 0x681b, 0x0008, 0x78a3, 0x0000,
845 0x79e4, 0xa184, 0x0030, 0x0040, 0x3081, 0x78ec, 0xa084, 0x0003,
846 0x0040, 0x3081, 0xa184, 0x0007, 0x0079, 0x2a1e, 0x2a26, 0x29f2,
847 0x296e, 0x3854, 0x38b9, 0x38b9, 0x2a26, 0x38af, 0x1078, 0x3868,
848 0x0078, 0x2438, 0xa282, 0x0005, 0x0050, 0x2a30, 0x1078, 0x23ca,
849 0x2300, 0x0079, 0x2a33, 0x2a36, 0x2c84, 0x2c92, 0x2200, 0x0079,
850 0x2a39, 0x2a53, 0x2a40, 0x2a53, 0x2a3e, 0x2c69, 0x1078, 0x23ca,
851 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa082, 0x0020, 0x0048,
852 0x366b, 0xa08a, 0x0004, 0x00c8, 0x366b, 0x0079, 0x2a4f, 0x366b,
853 0x366b, 0x366b, 0x3619, 0x789b, 0x0018, 0x79a8, 0xa184, 0x0080,
854 0x0040, 0x2a64, 0x0078, 0x366b, 0x7000, 0xa005, 0x00c0, 0x2a5a,
855 0x2011, 0x0004, 0x0078, 0x31f5, 0xa184, 0x00ff, 0xa08a, 0x0010,
856 0x00c8, 0x366b, 0x0079, 0x2a6c, 0x2a7e, 0x2a7c, 0x2a96, 0x2a9a,
857 0x2b55, 0x366b, 0x366b, 0x2b57, 0x366b, 0x366b, 0x2c65, 0x2c65,
858 0x366b, 0x366b, 0x366b, 0x2c67, 0x1078, 0x23ca, 0xa684, 0x1000,
859 0x0040, 0x2a8b, 0x2001, 0x0500, 0x8000, 0x8000, 0x783a, 0x781b,
860 0x0091, 0x0078, 0x2438, 0x6818, 0xa084, 0x8000, 0x0040, 0x2a94,
861 0x681b, 0x001d, 0x0078, 0x2a82, 0x0078, 0x3854, 0x681b, 0x001d,
862 0x0078, 0x367b, 0x6920, 0x6922, 0xa684, 0x1800, 0x00c0, 0x2adb,
863 0x6820, 0xa084, 0x0001, 0x00c0, 0x2ae1, 0x6818, 0xa086, 0x0008,
864 0x00c0, 0x2aac, 0x681b, 0x0000, 0xa684, 0x0400, 0x0040, 0x2b51,
865 0xa684, 0x0080, 0x0040, 0x2ad7, 0x7097, 0x0000, 0x6818, 0xa084,
866 0x003f, 0xa08a, 0x000d, 0x0050, 0x2ad7, 0xa08a, 0x000c, 0x7196,
867 0x2001, 0x000c, 0x800c, 0x719a, 0x789b, 0x0061, 0x78aa, 0x157e,
868 0x137e, 0x147e, 0x20a1, 0x012b, 0x789b, 0x0000, 0x8000, 0x80ac,
869 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 0x781b,
870 0x0058, 0x0078, 0x2438, 0xa684, 0x1000, 0x0040, 0x2ae1, 0x0078,
871 0x2438, 0xa684, 0x0060, 0x0040, 0x2b4d, 0xa684, 0x0800, 0x0040,
872 0x2b4d, 0xa684, 0x8000, 0x00c0, 0x2aef, 0x0078, 0x2b09, 0xa6b4,
873 0x7fff, 0x7e5a, 0x6eb6, 0x789b, 0x0076, 0x7aac, 0x79ac, 0x78ac,
874 0x801b, 0x00c8, 0x2afc, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291,
875 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303,
876 0x68ae, 0xa684, 0x4000, 0x0040, 0x2b11, 0xa6b4, 0xbfff, 0x7e5a,
877 0x6eb6, 0x7000, 0xa086, 0x0003, 0x00c0, 0x2b1e, 0x1078, 0x46e9,
878 0x1078, 0x48e6, 0x781b, 0x0064, 0x0078, 0x2438, 0xa006, 0x1078,
879 0x49ed, 0x6ab0, 0x69ac, 0x6c98, 0x6b94, 0x2200, 0xa105, 0x0040,
880 0x2b2d, 0x2200, 0xa422, 0x2100, 0xa31b, 0x6caa, 0x7cd2, 0x7cda,
881 0x6ba6, 0x7bd6, 0x7bde, 0x2300, 0xa405, 0x00c0, 0x2b3f, 0xa6b5,
882 0x4000, 0x7e5a, 0x6eb6, 0x781b, 0x0064, 0x0078, 0x2438, 0x781b,
883 0x0064, 0x2200, 0xa115, 0x00c0, 0x2b49, 0x1078, 0x48f7, 0x0078,
884 0x2438, 0x1078, 0x4942, 0x0078, 0x2438, 0x781b, 0x0065, 0x0078,
885 0x2438, 0x781b, 0x0058, 0x0078, 0x2438, 0x1078, 0x23ca, 0x0078,
886 0x2bb8, 0x6920, 0xa184, 0x0100, 0x0040, 0x2b6f, 0xa18c, 0xfeff,
887 0x6922, 0x0c7e, 0x7054, 0x2060, 0x6000, 0xa084, 0xefff, 0x6002,
888 0x6004, 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x0078, 0x2ba7, 0xa184,
889 0x0200, 0x0040, 0x2ba7, 0xa18c, 0xfdff, 0x6922, 0x0c7e, 0x7054,
890 0x2060, 0x6000, 0xa084, 0xdfff, 0x6002, 0x6004, 0xa084, 0xffef,
891 0x6006, 0x2008, 0x2c48, 0x0c7f, 0xa184, 0x0008, 0x0040, 0x2ba7,
892 0x1078, 0x37b9, 0x1078, 0x34c7, 0x88ff, 0x0040, 0x2ba7, 0x789b,
893 0x0060, 0x2800, 0x78aa, 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684,
894 0x0400, 0x00c0, 0x2ba1, 0x782b, 0x3008, 0x781b, 0x0056, 0x0078,
895 0x2438, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x7e58,
896 0xa684, 0x0400, 0x00c0, 0x2bb0, 0x781b, 0x0058, 0x0078, 0x2438,
897 0x781b, 0x0065, 0x0078, 0x2438, 0x0078, 0x3673, 0x0078, 0x3673,
898 0x2019, 0x0000, 0x7990, 0xa18c, 0x0007, 0x0040, 0x2bb6, 0x789b,
899 0x0010, 0x78a8, 0xa094, 0x00ff, 0xa286, 0x0001, 0x00c0, 0x2bf6,
900 0x2300, 0x7ca8, 0xa400, 0x2018, 0xa102, 0x0040, 0x2bee, 0x0048,
901 0x2bd3, 0x0078, 0x2bf0, 0xa380, 0x0002, 0xa102, 0x00c8, 0x2bee,
902 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0c7e, 0x7054, 0x2060, 0x6000,
903 0xa084, 0xefef, 0x6002, 0x6004, 0xa084, 0xffe5, 0x6006, 0x0c7f,
904 0x7e58, 0xa6b4, 0xfffb, 0x7e5a, 0x0078, 0x2ba8, 0x0078, 0x2b59,
905 0x24a8, 0x7aa8, 0x00f0, 0x2bf0, 0x0078, 0x2bc1, 0xa284, 0x00f0,
906 0xa086, 0x0020, 0x00c0, 0x2c56, 0x8318, 0x8318, 0x2300, 0xa102,
907 0x0040, 0x2c06, 0x0048, 0x2c06, 0x0078, 0x2c53, 0xa286, 0x0023,
908 0x0040, 0x2bb6, 0x681c, 0xa084, 0xfff1, 0x681e, 0x7e58, 0xa684,
909 0xfff1, 0xa085, 0x0010, 0x2030, 0x7e5a, 0x6008, 0xa085, 0x0010,
910 0x600a, 0x0c7e, 0x7054, 0x2060, 0x6004, 0x2008, 0x2c48, 0x0c7f,
911 0xa184, 0x0010, 0x0040, 0x2c2a, 0x1078, 0x37b9, 0x1078, 0x35d6,
912 0x0078, 0x2c39, 0x0c7e, 0x7054, 0x2060, 0x6004, 0x2008, 0x2c48,
913 0x0c7f, 0xa184, 0x0008, 0x0040, 0x2ba7, 0x1078, 0x37b9, 0x1078,
914 0x34c7, 0x88ff, 0x0040, 0x2ba7, 0x789b, 0x0060, 0x2800, 0x78aa,
915 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x2c4d, 0x782b,
916 0x3008, 0x781b, 0x0056, 0x0078, 0x2438, 0x782b, 0x3008, 0x781b,
917 0x0065, 0x0078, 0x2438, 0x7aa8, 0x0078, 0x2bc1, 0x8318, 0x2300,
918 0xa102, 0x0040, 0x2c5f, 0x0048, 0x2c5f, 0x0078, 0x2bc1, 0xa284,
919 0x0080, 0x00c0, 0x367b, 0x0078, 0x3673, 0x0078, 0x367b, 0x0078,
920 0x366b, 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa08e, 0x0001,
921 0x0040, 0x2c74, 0x1078, 0x23ca, 0x7aa8, 0xa294, 0x00ff, 0x78a8,
922 0xa084, 0x00ff, 0xa08a, 0x0004, 0x00c8, 0x366b, 0x0079, 0x2c80,
923 0x366b, 0x3414, 0x366b, 0x356b, 0xa282, 0x0000, 0x00c0, 0x2c8a,
924 0x1078, 0x23ca, 0x1078, 0x368f, 0x782b, 0x3008, 0x781b, 0x0065,
925 0x0078, 0x2438, 0xa282, 0x0003, 0x00c0, 0x2c98, 0x1078, 0x23ca,
926 0xa484, 0x8000, 0x00c0, 0x2cbb, 0x706c, 0xa005, 0x0040, 0x2ca2,
927 0x1078, 0x23ca, 0x6f14, 0x7782, 0xa7bc, 0x0f00, 0x1078, 0x37bd,
928 0x6008, 0xa085, 0x0021, 0x600a, 0x8738, 0xa784, 0x001f, 0x00c0,
929 0x2ca6, 0x1078, 0x3693, 0x706f, 0x0002, 0x2009, 0x5038, 0x200b,
930 0x0009, 0x0078, 0x2cbd, 0x1078, 0x369f, 0x782b, 0x3008, 0x781b,
931 0x0065, 0x0078, 0x2438, 0xa282, 0x0004, 0x0050, 0x2cc9, 0x1078,
932 0x23ca, 0x2300, 0x0079, 0x2ccc, 0x2ccf, 0x2db8, 0x2deb, 0xa286,
933 0x0003, 0x0040, 0x2cd5, 0x1078, 0x23ca, 0x2001, 0x0000, 0x007e,
934 0x68c0, 0xa005, 0x0040, 0x2cde, 0x7003, 0x0003, 0x68a0, 0xa084,
935 0x2000, 0x0040, 0x2ce7, 0x6008, 0xa085, 0x0002, 0x600a, 0x007f,
936 0x703e, 0x7000, 0xa084, 0x0007, 0x0079, 0x2cee, 0x2461, 0x2cf8,
937 0x2cf8, 0x2eed, 0x2f29, 0x2461, 0x2f29, 0x2cf6, 0x1078, 0x23ca,
938 0xa684, 0x1000, 0x00c0, 0x2d00, 0x1078, 0x4633, 0x0040, 0x2d92,
939 0x7868, 0xa08c, 0x00ff, 0x0040, 0x2d48, 0xa186, 0x0008, 0x00c0,
940 0x2d17, 0x1078, 0x33c4, 0x6008, 0xa084, 0xffef, 0x600a, 0x1078,
941 0x3366, 0x0040, 0x2d48, 0x1078, 0x4633, 0x0078, 0x2d2f, 0xa186,
942 0x0028, 0x00c0, 0x2d48, 0x1078, 0x4633, 0x6008, 0xa084, 0xffef,
943 0x600a, 0x6018, 0xa005, 0x0040, 0x2d2f, 0x8001, 0x601a, 0xa005,
944 0x0040, 0x2d2f, 0x8001, 0xa005, 0x0040, 0x2d2f, 0x601e, 0x6820,
945 0xa084, 0x0001, 0x0040, 0x2461, 0x6820, 0xa084, 0xfffe, 0x6822,
946 0x7060, 0x0c7e, 0x2060, 0x6800, 0x6002, 0x0c7f, 0x6004, 0x6802,
947 0xa005, 0x2d00, 0x00c0, 0x2d45, 0x6002, 0x6006, 0x0078, 0x2461,
948 0x017e, 0x1078, 0x2e1c, 0x017f, 0xa684, 0xdf00, 0x681e, 0x682b,
949 0x0000, 0x6f14, 0x81ff, 0x0040, 0x2d92, 0xa186, 0x0002, 0x00c0,
950 0x2d92, 0xa684, 0x0800, 0x00c0, 0x2d65, 0xa684, 0x0060, 0x0040,
951 0x2d65, 0x78d8, 0x7adc, 0x682e, 0x6a32, 0x6820, 0xa084, 0x0800,
952 0x00c0, 0x2d92, 0x8717, 0xa294, 0x000f, 0x8213, 0x8213, 0x8213,
953 0xa290, 0x5280, 0xa290, 0x0000, 0x221c, 0xa384, 0x0100, 0x00c0,
954 0x2d7b, 0x0078, 0x2d81, 0x8210, 0x2204, 0xa085, 0x0018, 0x2012,
955 0x8211, 0xa384, 0x0400, 0x0040, 0x2d8e, 0x68a0, 0xa084, 0x0100,
956 0x00c0, 0x2d8e, 0x1078, 0x2ea0, 0x0078, 0x2461, 0x6008, 0xa085,
957 0x0002, 0x600a, 0x6916, 0x6818, 0xa084, 0x8000, 0x0040, 0x2d9a,
958 0x703c, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x1078, 0x33b5, 0x1078,
959 0x33c4, 0x00c0, 0x2da7, 0x6008, 0xa084, 0xffef, 0x600a, 0x6820,
960 0xa084, 0x0001, 0x00c0, 0x2db0, 0x1078, 0x33ae, 0x0078, 0x2db4,
961 0x7060, 0x2060, 0x6800, 0x6002, 0x1078, 0x1c53, 0x0078, 0x2461,
962 0xa282, 0x0004, 0x0048, 0x2dbe, 0x1078, 0x23ca, 0x2200, 0x0079,
963 0x2dc1, 0x2dbc, 0x2dc5, 0x2dd2, 0x2dc5, 0x7000, 0xa086, 0x0005,
964 0x0040, 0x2dce, 0x1078, 0x368f, 0x782b, 0x3008, 0x781b, 0x0065,
965 0x0078, 0x2438, 0x7890, 0x8007, 0x8001, 0xa084, 0x0007, 0xa080,
966 0x0018, 0x789a, 0x79a8, 0xa18c, 0x00ff, 0xa186, 0x0003, 0x0040,
967 0x2de7, 0xa186, 0x0000, 0x0040, 0x2de7, 0x0078, 0x366b, 0x781b,
968 0x0065, 0x0078, 0x2438, 0x6820, 0xa085, 0x0004, 0x6822, 0x82ff,
969 0x00c0, 0x2df6, 0x1078, 0x368f, 0x0078, 0x2dfd, 0x8211, 0x0040,
970 0x2dfb, 0x1078, 0x23ca, 0x1078, 0x369f, 0x782b, 0x3008, 0x781b,
971 0x0065, 0x0078, 0x2438, 0x702c, 0x8003, 0x0048, 0x2e0d, 0x2019,
972 0x4c5b, 0x1078, 0x2255, 0x702f, 0x8000, 0x1078, 0x38de, 0x7830,
973 0xa084, 0x00c0, 0x00c0, 0x2e19, 0x0018, 0x2e19, 0x791a, 0xa006,
974 0x007c, 0xa085, 0x0001, 0x007c, 0xa684, 0x0060, 0x00c0, 0x2e26,
975 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x2e9f, 0xa684, 0x0800,
976 0x00c0, 0x2e48, 0x68b4, 0xa084, 0x4800, 0xa635, 0xa684, 0x0800,
977 0x00c0, 0x2e48, 0x6998, 0x6a94, 0x692e, 0x6a32, 0x703c, 0xa005,
978 0x00c0, 0x2e40, 0x2200, 0xa105, 0x0040, 0x2e47, 0x703f, 0x0015,
979 0x7000, 0xa086, 0x0006, 0x0040, 0x2e47, 0x1078, 0x4633, 0x007c,
980 0xa684, 0x0020, 0x0040, 0x2e6a, 0xa684, 0x4000, 0x0040, 0x2e56,
981 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x2e40, 0x68b4, 0xa084,
982 0x4800, 0xa635, 0xa684, 0x4000, 0x00c0, 0x2e50, 0x703c, 0xa005,
983 0x00c0, 0x2e64, 0x703f, 0x0015, 0x79d8, 0x7adc, 0x692e, 0x6a32,
984 0x0078, 0x2e40, 0xa684, 0x4000, 0x0040, 0x2e74, 0x682f, 0x0000,
985 0x6833, 0x0000, 0x0078, 0x2e40, 0x68b4, 0xa084, 0x4800, 0xa635,
986 0xa684, 0x4000, 0x00c0, 0x2e6e, 0x703c, 0xa005, 0x00c0, 0x2e82,
987 0x703f, 0x0015, 0x79d8, 0x7adc, 0x78d0, 0x80fb, 0x00c8, 0x2e89,
988 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x692e, 0x6a32,
989 0x2100, 0xa205, 0x00c0, 0x2e96, 0x0078, 0x2e40, 0x7000, 0xa086,
990 0x0006, 0x0040, 0x2e9f, 0x1078, 0x49ed, 0x0078, 0x2e40, 0x007c,
991 0x6008, 0xa085, 0x0200, 0x600a, 0xa384, 0x0200, 0x0040, 0x2eac,
992 0x6008, 0xa085, 0x0002, 0x600a, 0x681b, 0x0006, 0x688f, 0x0000,
993 0x6893, 0x0000, 0x6a30, 0x692c, 0x6a3e, 0x6942, 0x682f, 0x0003,
994 0x6833, 0x0000, 0x6837, 0x0020, 0x6897, 0x0000, 0x689b, 0x0020,
995 0x68b3, 0x0000, 0x68af, 0x0000, 0x7000, 0x0079, 0x2ec7, 0x2461,
996 0x2ed1, 0x2eda, 0x2ecf, 0x2ecf, 0x2ecf, 0x2ecf, 0x2ecf, 0x1078,
997 0x23ca, 0x6820, 0xa084, 0x0001, 0x00c0, 0x2eda, 0x1078, 0x33ae,
998 0x0078, 0x2ee0, 0x7060, 0x2c50, 0x2060, 0x6800, 0x6002, 0x2a60,
999 0x2021, 0x505a, 0x2404, 0xa005, 0x0040, 0x2ee9, 0x2020, 0x0078,
1000 0x2ee2, 0x2d22, 0x206b, 0x0000, 0x007c, 0x1078, 0x33b5, 0x1078,
1001 0x33c4, 0x6008, 0xa084, 0xfdff, 0x600a, 0x682b, 0x0000, 0x789b,
1002 0x000e, 0x6f14, 0x6817, 0x0002, 0x1078, 0x4a35, 0xa684, 0x0800,
1003 0x0040, 0x2f06, 0x691c, 0xa18d, 0x2000, 0x691e, 0x6818, 0xa084,
1004 0x8000, 0x0040, 0x2f16, 0x7868, 0xa08c, 0x00ff, 0x0040, 0x2f14,
1005 0x681b, 0x001e, 0x0078, 0x2f16, 0x681b, 0x0000, 0x2021, 0x505a,
1006 0x2404, 0xad06, 0x0040, 0x2f1d, 0x7460, 0x6800, 0x2022, 0x68c3,
1007 0x0000, 0x6a3c, 0x6940, 0x6a32, 0x692e, 0x1078, 0x1c53, 0x0078,
1008 0x2461, 0x1078, 0x2e1c, 0x682b, 0x0000, 0x2001, 0x000e, 0x6f14,
1009 0x1078, 0x38e4, 0xa08c, 0x00ff, 0x6916, 0x6818, 0xa084, 0x8000,
1010 0x0040, 0x2f3c, 0x703c, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x706f,
1011 0x0000, 0x0078, 0x2461, 0x7000, 0xa005, 0x00c0, 0x2f49, 0x0078,
1012 0x2461, 0xa006, 0x1078, 0x4633, 0x6817, 0x0000, 0x681b, 0x0014,
1013 0xa68c, 0xdf00, 0x691e, 0x682b, 0x0000, 0x6820, 0xa085, 0x00ff,
1014 0x6822, 0x7000, 0x0079, 0x2f5c, 0x2461, 0x2f66, 0x2f66, 0x2f68,
1015 0x2f68, 0x2f68, 0x2f68, 0x2f64, 0x1078, 0x23ca, 0x1078, 0x33c4,
1016 0x6008, 0xa084, 0xffef, 0x600a, 0x0078, 0x337e, 0x2300, 0x0079,
1017 0x2f71, 0x2f74, 0x2f76, 0x2faf, 0x1078, 0x23ca, 0x7000, 0x0079,
1018 0x2f79, 0x2461, 0x2f83, 0x2f83, 0x2f9e, 0x2f83, 0x2fab, 0x2f9e,
1019 0x2f81, 0x1078, 0x23ca, 0xa684, 0x0060, 0xa086, 0x0060, 0x00c0,
1020 0x2f9a, 0xa6b4, 0xffdf, 0xa6b4, 0xbfff, 0xa6b5, 0x2000, 0x7e5a,
1021 0x681c, 0xa084, 0xffdf, 0x681e, 0x1078, 0x4633, 0x1078, 0x48f7,
1022 0x0078, 0x3854, 0xa684, 0x2000, 0x0040, 0x2f8d, 0x6818, 0xa084,
1023 0x8000, 0x0040, 0x2fab, 0x681b, 0x0015, 0xa684, 0x4000, 0x0040,
1024 0x2fab, 0x681b, 0x0007, 0x1078, 0x3868, 0x0078, 0x2438, 0x1078,
1025 0x23ca, 0x2300, 0x0079, 0x2fb4, 0x2fb7, 0x2fb9, 0x2fec, 0x1078,
1026 0x23ca, 0x7000, 0x0079, 0x2fbc, 0x2461, 0x2fc6, 0x2fc6, 0x2fe1,
1027 0x2fc6, 0x2fe8, 0x2fe1, 0x2fc4, 0x1078, 0x23ca, 0xa684, 0x0060,
1028 0xa086, 0x0060, 0x00c0, 0x2fdd, 0xa6b4, 0xffbf, 0xa6b4, 0xbfff,
1029 0xa6b5, 0x2000, 0x7e5a, 0x681c, 0xa084, 0xffbf, 0x681e, 0x1078,
1030 0x4633, 0x1078, 0x48f7, 0x0078, 0x3854, 0xa684, 0x2000, 0x0040,
1031 0x2fd0, 0x6818, 0xa084, 0x8000, 0x0040, 0x2fe8, 0x681b, 0x0007,
1032 0x781b, 0x00d2, 0x0078, 0x2438, 0x6820, 0xa085, 0x0004, 0x6822,
1033 0x1078, 0x381f, 0xa6b5, 0x0800, 0x1078, 0x368f, 0x782b, 0x3008,
1034 0x781b, 0x0065, 0x0078, 0x2438, 0x2300, 0x0079, 0x2fff, 0x3002,
1035 0x3004, 0x3006, 0x1078, 0x23ca, 0x0078, 0x367b, 0xa684, 0x0400,
1036 0x00c0, 0x302f, 0x79e4, 0xa184, 0x0020, 0x0040, 0x3016, 0x78ec,
1037 0xa084, 0x0003, 0x0040, 0x3016, 0x782b, 0x3009, 0x789b, 0x0060,
1038 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, 0x79e4, 0xa184, 0x0020,
1039 0x0040, 0x3027, 0x78ec, 0xa084, 0x0003, 0x00c0, 0x302b, 0x2001,
1040 0x0014, 0x0078, 0x2cd7, 0xa184, 0x0007, 0x0079, 0x3067, 0x7a90,
1041 0xa294, 0x0007, 0x789b, 0x0060, 0x79a8, 0x81ff, 0x0040, 0x3065,
1042 0x789b, 0x0010, 0x7ba8, 0xa384, 0x0001, 0x00c0, 0x3056, 0x7ba8,
1043 0x7ba8, 0xa386, 0x0001, 0x00c0, 0x3049, 0x2009, 0xfff7, 0x0078,
1044 0x304f, 0xa386, 0x0003, 0x00c0, 0x3056, 0x2009, 0xffef, 0x0c7e,
1045 0x7054, 0x2060, 0x6004, 0xa104, 0x6006, 0x0c7f, 0x789b, 0x0060,
1046 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, 0x782b, 0x3009, 0x6920,
1047 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x6922, 0x0078, 0x3854, 0x297d,
1048 0x2988, 0x3071, 0x3079, 0x306f, 0x306f, 0x3854, 0x3854, 0x1078,
1049 0x23ca, 0x6920, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x6922, 0x0078,
1050 0x385e, 0x6920, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x6922, 0x0078,
1051 0x3854, 0x79e4, 0xa184, 0x0030, 0x0040, 0x308b, 0x78ec, 0xa084,
1052 0x0003, 0x00c0, 0x30b2, 0x7000, 0xa086, 0x0004, 0x00c0, 0x30a5,
1053 0x706c, 0xa086, 0x0002, 0x00c0, 0x309b, 0x2011, 0x0002, 0x2019,
1054 0x0000, 0x0078, 0x2827, 0x706c, 0xa086, 0x0006, 0x0040, 0x3095,
1055 0x706c, 0xa086, 0x0004, 0x0040, 0x3095, 0x7000, 0xa086, 0x0000,
1056 0x0040, 0x2438, 0x6818, 0xa085, 0x8000, 0x681a, 0x2001, 0x0014,
1057 0x0078, 0x2cd7, 0xa184, 0x0007, 0x0079, 0x30b6, 0x3854, 0x3854,
1058 0x30be, 0x3854, 0x38b9, 0x38b9, 0x3854, 0x3854, 0xa684, 0x0080,
1059 0x0040, 0x30ed, 0x7194, 0x81ff, 0x0040, 0x30ed, 0xa182, 0x000d,
1060 0x00d0, 0x30ce, 0x7097, 0x0000, 0x0078, 0x30d3, 0xa182, 0x000c,
1061 0x7096, 0x2009, 0x000c, 0x789b, 0x0061, 0x79aa, 0x157e, 0x137e,
1062 0x147e, 0x7098, 0x8114, 0xa210, 0x729a, 0xa080, 0x000b, 0xad00,
1063 0x2098, 0x20a1, 0x012b, 0x789b, 0x0000, 0x8108, 0x81ac, 0x53a6,
1064 0x147f, 0x137f, 0x157f, 0x0078, 0x385e, 0xa684, 0x0400, 0x00c0,
1065 0x312e, 0x6820, 0xa084, 0x0001, 0x0040, 0x385e, 0xa68c, 0x0060,
1066 0xa684, 0x0060, 0x0040, 0x3102, 0xa086, 0x0060, 0x00c0, 0x3102,
1067 0xa18d, 0x4000, 0xa18c, 0xfffb, 0x795a, 0x69b6, 0x789b, 0x0060,
1068 0x78ab, 0x0000, 0x789b, 0x0061, 0x6818, 0xa085, 0x8000, 0x681a,
1069 0x78aa, 0x8008, 0x810c, 0x0040, 0x33dd, 0xa18c, 0x00f8, 0x00c0,
1070 0x33dd, 0x157e, 0x137e, 0x147e, 0x20a1, 0x012b, 0x789b, 0x0000,
1071 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f,
1072 0x157f, 0x6814, 0x8007, 0x7882, 0x0078, 0x385e, 0x6818, 0xa084,
1073 0x8000, 0x0040, 0x3135, 0x681b, 0x0008, 0x781b, 0x00c8, 0x0078,
1074 0x2438, 0x2300, 0x0079, 0x313c, 0x3141, 0x31e0, 0x313f, 0x1078,
1075 0x23ca, 0x7000, 0xa084, 0x0007, 0x0079, 0x3146, 0x2461, 0x3150,
1076 0x3185, 0x315b, 0x314e, 0x2461, 0x314e, 0x314e, 0x1078, 0x23ca,
1077 0x681c, 0xa084, 0x2000, 0x0040, 0x3169, 0x6008, 0xa085, 0x0002,
1078 0x600a, 0x0078, 0x3169, 0x68c0, 0xa005, 0x00c0, 0x3185, 0x6920,
1079 0xa18d, 0x0001, 0x6922, 0x68c3, 0x0001, 0x6800, 0x706a, 0x0078,
1080 0x317f, 0x6920, 0xa18d, 0x0001, 0x6922, 0x6800, 0x6006, 0xa005,
1081 0x00c0, 0x3173, 0x6002, 0x681c, 0xa084, 0x000e, 0x0040, 0x317f,
1082 0x7014, 0x68ba, 0x7130, 0xa188, 0x7300, 0x0078, 0x3181, 0x2009,
1083 0x7400, 0x2104, 0x6802, 0x2d0a, 0x7162, 0x6eb6, 0xa684, 0x0060,
1084 0x0040, 0x31de, 0xa684, 0x0800, 0x00c0, 0x3199, 0xa684, 0x7fff,
1085 0x68b6, 0x6894, 0x68a6, 0x6898, 0x68aa, 0x1078, 0x4633, 0x0078,
1086 0x31de, 0xa684, 0x0020, 0x0040, 0x31ae, 0x68c0, 0xa005, 0x0040,
1087 0x31a5, 0x1078, 0x4a35, 0x0078, 0x31a8, 0xa006, 0x1078, 0x49ed,
1088 0x79d8, 0x7adc, 0x69aa, 0x6aa6, 0x0078, 0x31b4, 0x1078, 0x37ca,
1089 0x69aa, 0x6aa6, 0x1078, 0x49ed, 0xa684, 0x8000, 0x0040, 0x31de,
1090 0xa684, 0x7fff, 0x68b6, 0x2001, 0x0076, 0x1078, 0x38e4, 0x2010,
1091 0x2001, 0x0078, 0x1078, 0x38e4, 0x2008, 0xa684, 0x0020, 0x00c0,
1092 0x31d6, 0x2001, 0x007a, 0x1078, 0x38e4, 0x801b, 0x00c8, 0x31d1,
1093 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100,
1094 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x0078, 0x2461,
1095 0x0078, 0x367b, 0x7037, 0x0000, 0xa282, 0x0006, 0x0050, 0x31ea,
1096 0x1078, 0x23ca, 0x7000, 0xa084, 0x0007, 0x10c0, 0x398a, 0x2300,
1097 0x0079, 0x31f2, 0x31f5, 0x321e, 0x3232, 0x2200, 0x0079, 0x31f8,
1098 0x321c, 0x367b, 0x31fe, 0x321c, 0x324e, 0x3290, 0x7003, 0x0005,
1099 0x2001, 0x7510, 0x2068, 0x704a, 0x157e, 0x20a9, 0x0031, 0x2003,
1100 0x0000, 0x8000, 0x0070, 0x320e, 0x0078, 0x3207, 0x157f, 0xad80,
1101 0x0009, 0x7036, 0x6817, 0x0000, 0x68b7, 0x0700, 0x6823, 0x0800,
1102 0x6827, 0x0003, 0x0078, 0x366b, 0x1078, 0x23ca, 0x7003, 0x0005,
1103 0x2001, 0x7510, 0x2068, 0x704a, 0xad80, 0x0009, 0x7036, 0x2200,
1104 0x0079, 0x322a, 0x367b, 0x3230, 0x3230, 0x324e, 0x3230, 0x367b,
1105 0x1078, 0x23ca, 0x7003, 0x0005, 0x2001, 0x7510, 0x2068, 0x704a,
1106 0xad80, 0x0009, 0x7036, 0x2200, 0x0079, 0x323e, 0x3246, 0x3244,
1107 0x3244, 0x3246, 0x3244, 0x3246, 0x1078, 0x23ca, 0x1078, 0x369f,
1108 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x7003, 0x0002,
1109 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, 0x001f,
1110 0xa215, 0x2069, 0x7400, 0x2d04, 0x2d08, 0x7162, 0x2068, 0xa005,
1111 0x0040, 0x3269, 0x6814, 0xa206, 0x0040, 0x3285, 0x6800, 0x0078,
1112 0x325c, 0x7003, 0x0005, 0x2001, 0x7510, 0x2068, 0x704a, 0x7036,
1113 0x157e, 0x20a9, 0x0031, 0x2003, 0x0000, 0x8000, 0x0070, 0x327a,
1114 0x0078, 0x3273, 0x157f, 0xad80, 0x0009, 0x7036, 0x6a16, 0x68b7,
1115 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, 0x6eb4, 0x7e5a, 0x6820,
1116 0xa084, 0x0c00, 0x0040, 0x32df, 0x1078, 0x3697, 0x0078, 0x32df,
1117 0x7003, 0x0002, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8,
1118 0xa484, 0x001f, 0xa215, 0x79a8, 0x79a8, 0xa18c, 0x00ff, 0xa1e8,
1119 0x7300, 0x2d04, 0x2d08, 0x7162, 0x2068, 0xa005, 0x0040, 0x32af,
1120 0x6814, 0xa206, 0x0040, 0x32ca, 0x6800, 0x0078, 0x32a2, 0x7003,
1121 0x0005, 0x2001, 0x7510, 0x2068, 0x704a, 0x157e, 0x20a9, 0x0031,
1122 0x2003, 0x0000, 0x8000, 0x0070, 0x32bf, 0x0078, 0x32b8, 0x157f,
1123 0xad80, 0x0009, 0x7036, 0x6a16, 0x68b7, 0x0700, 0x6823, 0x0800,
1124 0x6827, 0x0003, 0x6eb4, 0x7e5a, 0x6820, 0xa084, 0x0c00, 0x0040,
1125 0x32df, 0xa084, 0x0800, 0x0040, 0x32d9, 0x1078, 0x369b, 0x0078,
1126 0x32df, 0x1078, 0x3697, 0x708b, 0x0000, 0x0078, 0x32df, 0x027e,
1127 0x8207, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x5280,
1128 0x2060, 0x7056, 0x6000, 0x705a, 0x6004, 0x705e, 0xa684, 0x0060,
1129 0x0040, 0x3337, 0x6b98, 0x6c94, 0x69ac, 0x68b0, 0xa105, 0x00c0,
1130 0x3319, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0xa6b4, 0xb7ff, 0x7e5a,
1131 0xa684, 0x0060, 0xa086, 0x0060, 0x0040, 0x3337, 0x68c0, 0xa005,
1132 0x0040, 0x3312, 0x7003, 0x0003, 0x682b, 0x0000, 0x1078, 0x48e6,
1133 0x0078, 0x3314, 0x1078, 0x48f7, 0xa6b5, 0x2000, 0x7e5a, 0x0078,
1134 0x3337, 0x68b0, 0xa31a, 0x2100, 0xa423, 0x2400, 0xa305, 0x0040,
1135 0x3337, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0x68b0, 0xa6b4, 0xbfff,
1136 0x7e5a, 0x007e, 0x68c0, 0xa005, 0x007f, 0x0040, 0x3335, 0x7003,
1137 0x0003, 0x1078, 0x48e6, 0x0078, 0x3337, 0x1078, 0x4942, 0x077f,
1138 0x1078, 0x37bd, 0x2009, 0x0065, 0xa684, 0x0004, 0x0040, 0x3358,
1139 0x78e4, 0xa084, 0x0030, 0x0040, 0x3350, 0x78ec, 0xa084, 0x0003,
1140 0x0040, 0x3350, 0x782b, 0x3008, 0x2009, 0x0065, 0x0078, 0x3358,
1141 0x0f7e, 0x2079, 0x5000, 0x1078, 0x4633, 0x0f7f, 0x0040, 0x2461,
1142 0x791a, 0x2d00, 0x704a, 0x8207, 0xa084, 0x000f, 0x8003, 0x8003,
1143 0x8003, 0xa080, 0x5280, 0x2048, 0x0078, 0x2438, 0x6020, 0xa005,
1144 0x0040, 0x3372, 0x8001, 0x6022, 0x6008, 0xa085, 0x0008, 0x600a,
1145 0x7010, 0x6026, 0x007c, 0xa006, 0x1078, 0x4633, 0x6817, 0x0000,
1146 0x681b, 0x0001, 0x6823, 0x0040, 0x681f, 0x0100, 0x7000, 0xa084,
1147 0x0007, 0x0079, 0x3383, 0x2461, 0x338d, 0x338d, 0x33aa, 0x3395,
1148 0x3393, 0x3395, 0x338b, 0x1078, 0x23ca, 0x1078, 0x33b5, 0x1078,
1149 0x33ae, 0x1078, 0x1c53, 0x0078, 0x2461, 0x706c, 0x706f, 0x0000,
1150 0x7093, 0x0000, 0x0079, 0x339c, 0x33a6, 0x33a6, 0x33a4, 0x33a4,
1151 0x33a4, 0x33a6, 0x33a4, 0x33a6, 0x0079, 0x2840, 0x706f, 0x0000,
1152 0x0078, 0x2461, 0x681b, 0x0000, 0x0078, 0x2eed, 0x6800, 0xa005,
1153 0x00c0, 0x33b3, 0x6002, 0x6006, 0x007c, 0x6010, 0xa005, 0x0040,
1154 0x33be, 0x8001, 0x00d0, 0x33be, 0x1078, 0x23ca, 0x6012, 0x6008,
1155 0xa084, 0xffef, 0x600a, 0x007c, 0x6018, 0xa005, 0x0040, 0x33ca,
1156 0x8001, 0x601a, 0x007c, 0x1078, 0x38de, 0x681b, 0x0018, 0x0078,
1157 0x3401, 0x1078, 0x38de, 0x681b, 0x0019, 0x0078, 0x3401, 0x1078,
1158 0x38de, 0x681b, 0x001a, 0x0078, 0x3401, 0x1078, 0x38de, 0x681b,
1159 0x0003, 0x0078, 0x3401, 0x7780, 0x1078, 0x37bd, 0x7184, 0xa18c,
1160 0x00ff, 0xa1e8, 0x7300, 0x2d04, 0x2d08, 0x2068, 0xa005, 0x00c0,
1161 0x33f3, 0x0078, 0x2461, 0x6814, 0x7280, 0xa206, 0x0040, 0x33fb,
1162 0x6800, 0x0078, 0x33ec, 0x6800, 0x200a, 0x681b, 0x0005, 0x708b,
1163 0x0000, 0x1078, 0x33b5, 0x6820, 0xa084, 0x0001, 0x00c0, 0x340a,
1164 0x1078, 0x33ae, 0x1078, 0x33c4, 0x681f, 0x0000, 0x6823, 0x0020,
1165 0x1078, 0x1c53, 0x0078, 0x2461, 0xa282, 0x0003, 0x00c0, 0x366b,
1166 0x7da8, 0xa5ac, 0x00ff, 0x7ca8, 0xa4a4, 0x00ff, 0x6920, 0xa18d,
1167 0x0080, 0x6922, 0xa184, 0x0100, 0x0040, 0x3478, 0xa18c, 0xfeff,
1168 0x6922, 0xa4a4, 0x00ff, 0x0040, 0x3462, 0xa482, 0x000c, 0x0048,
1169 0x3435, 0x0040, 0x3435, 0x2021, 0x000c, 0x852b, 0x852b, 0x1078,
1170 0x372e, 0x0040, 0x343f, 0x1078, 0x3531, 0x0078, 0x346b, 0x1078,
1171 0x36e9, 0x0c7e, 0x2960, 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078,
1172 0x3558, 0x0c7f, 0x6920, 0xa18d, 0x0100, 0x6922, 0x7e58, 0xa6b5,
1173 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x345c, 0x782b, 0x3008,
1174 0x781b, 0x0056, 0x0078, 0x2438, 0x782b, 0x3008, 0x781b, 0x0065,
1175 0x0078, 0x2438, 0x0c7e, 0x2960, 0x6004, 0xa084, 0xfff5, 0x6006,
1176 0x1078, 0x3558, 0x0c7f, 0x7e58, 0xa684, 0x0400, 0x00c0, 0x3474,
1177 0x781b, 0x0058, 0x0078, 0x2438, 0x781b, 0x0065, 0x0078, 0x2438,
1178 0x0c7e, 0x7054, 0x2060, 0x6100, 0xa18c, 0x1000, 0x0040, 0x34b8,
1179 0x6208, 0x8217, 0xa294, 0x00ff, 0xa282, 0x000c, 0x0048, 0x348c,
1180 0x0040, 0x348c, 0x2011, 0x000c, 0x2400, 0xa202, 0x00c8, 0x3491,
1181 0x2220, 0x6208, 0xa294, 0x00ff, 0x7018, 0xa086, 0x0028, 0x00c0,
1182 0x34a1, 0xa282, 0x0019, 0x00c8, 0x34a7, 0x2011, 0x0019, 0x0078,
1183 0x34a7, 0xa282, 0x000c, 0x00c8, 0x34a7, 0x2011, 0x000c, 0x2200,
1184 0xa502, 0x00c8, 0x34ac, 0x2228, 0x1078, 0x36ed, 0x852b, 0x852b,
1185 0x1078, 0x372e, 0x0040, 0x34b8, 0x1078, 0x3531, 0x0078, 0x34bc,
1186 0x1078, 0x36e9, 0x1078, 0x3558, 0x7858, 0xa085, 0x0004, 0x785a,
1187 0x0c7f, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x0c7e,
1188 0x2960, 0x6000, 0xa084, 0x1000, 0x00c0, 0x34df, 0x6010, 0xa084,
1189 0x000f, 0x00c0, 0x34d9, 0x6104, 0xa18c, 0xfff5, 0x6106, 0x0c7f,
1190 0x007c, 0x2011, 0x0032, 0x2019, 0x0000, 0x0078, 0x3506, 0x68a0,
1191 0xa084, 0x0200, 0x00c0, 0x34d9, 0x6208, 0xa294, 0x00ff, 0x7018,
1192 0xa086, 0x0028, 0x00c0, 0x34f4, 0xa282, 0x0019, 0x00c8, 0x34fa,
1193 0x2011, 0x0019, 0x0078, 0x34fa, 0xa282, 0x000c, 0x00c8, 0x34fa,
1194 0x2011, 0x000c, 0x6308, 0x831f, 0xa39c, 0x00ff, 0xa382, 0x000c,
1195 0x0048, 0x3506, 0x0040, 0x3506, 0x2019, 0x000c, 0x78ab, 0x0001,
1196 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005,
1197 0x6820, 0xa085, 0x0100, 0x6822, 0x0c7f, 0x007c, 0x0c7e, 0x2960,
1198 0xa18c, 0xfff5, 0x6106, 0x2011, 0x0032, 0x2019, 0x0000, 0x0078,
1199 0x3521, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa,
1200 0x7baa, 0xa8c0, 0x0005, 0x6820, 0xa085, 0x0100, 0x6822, 0x0c7f,
1201 0x007c, 0x0c7e, 0x7154, 0x2160, 0x1078, 0x3538, 0x0c7f, 0x007c,
1202 0x2008, 0xa084, 0xfff0, 0xa425, 0x7c86, 0x6018, 0x789a, 0x7cae,
1203 0x6412, 0x78a4, 0xa084, 0xfff8, 0xa18c, 0x0007, 0xa105, 0x78a6,
1204 0x6016, 0x788a, 0xa4a4, 0x000f, 0x8427, 0x8204, 0x8004, 0xa084,
1205 0x00ff, 0xa405, 0x600e, 0x6004, 0xa084, 0xfff5, 0x6006, 0x007c,
1206 0x0c7e, 0x7054, 0x2060, 0x1078, 0x355f, 0x0c7f, 0x007c, 0x6018,
1207 0x789a, 0x78a4, 0xa084, 0xfff0, 0x78a6, 0x6012, 0x7884, 0xa084,
1208 0xfff0, 0x7886, 0x007c, 0xa282, 0x0002, 0x00c0, 0x366b, 0x7aa8,
1209 0x6920, 0xa18d, 0x0080, 0x6922, 0xa184, 0x0200, 0x0040, 0x35b4,
1210 0xa18c, 0xfdff, 0x6922, 0xa294, 0x00ff, 0xa282, 0x0002, 0x00c8,
1211 0x366b, 0x1078, 0x35fd, 0x1078, 0x3558, 0xa980, 0x0001, 0x200c,
1212 0x1078, 0x37b9, 0x1078, 0x34c7, 0x88ff, 0x0040, 0x35a7, 0x789b,
1213 0x0060, 0x2800, 0x78aa, 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684,
1214 0x0400, 0x00c0, 0x35a1, 0x782b, 0x3008, 0x781b, 0x0056, 0x0078,
1215 0x2438, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x7e58,
1216 0xa684, 0x0400, 0x00c0, 0x35b0, 0x781b, 0x0058, 0x0078, 0x2438,
1217 0x781b, 0x0065, 0x0078, 0x2438, 0xa282, 0x0002, 0x00c8, 0x35bc,
1218 0xa284, 0x0001, 0x0040, 0x35c6, 0x7154, 0xa188, 0x0000, 0x210c,
1219 0xa18c, 0x2000, 0x00c0, 0x35c6, 0x2011, 0x0000, 0x1078, 0x36db,
1220 0x1078, 0x35fd, 0x1078, 0x3558, 0x7858, 0xa085, 0x0004, 0x785a,
1221 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x0c7e, 0x027e,
1222 0x2960, 0x6000, 0x2011, 0x0001, 0xa084, 0x2000, 0x00c0, 0x35ed,
1223 0x6014, 0xa084, 0x0040, 0x00c0, 0x35eb, 0xa18c, 0xffef, 0x6106,
1224 0xa006, 0x0078, 0x35fa, 0x2011, 0x0000, 0x78ab, 0x0001, 0x78ab,
1225 0x0002, 0x78ab, 0x0003, 0x7aaa, 0xa8c0, 0x0004, 0x6820, 0xa085,
1226 0x0200, 0x6822, 0x027f, 0x0c7f, 0x007c, 0x0c7e, 0x7054, 0x2060,
1227 0x1078, 0x3604, 0x0c7f, 0x007c, 0x82ff, 0x0040, 0x3609, 0x2011,
1228 0x0040, 0x6018, 0xa080, 0x0002, 0x789a, 0x78a4, 0xa084, 0xffbf,
1229 0xa205, 0x78a6, 0x788a, 0x6016, 0x6004, 0xa084, 0xffef, 0x6006,
1230 0x007c, 0x007e, 0x7000, 0xa086, 0x0003, 0x0040, 0x3622, 0x007f,
1231 0x0078, 0x3625, 0x007f, 0x0078, 0x3667, 0xa684, 0x0020, 0x0040,
1232 0x3667, 0x7888, 0xa084, 0x0040, 0x0040, 0x3667, 0x7bb8, 0xa384,
1233 0x003f, 0x831b, 0x00c8, 0x3635, 0x8000, 0xa005, 0x0040, 0x364b,
1234 0x831b, 0x00c8, 0x363e, 0x8001, 0x0040, 0x3663, 0xa684, 0x4000,
1235 0x0040, 0x364b, 0x78b8, 0x801b, 0x00c8, 0x3647, 0x8000, 0xa084,
1236 0x003f, 0x00c0, 0x3663, 0xa6b4, 0xbfff, 0x7e5a, 0x79d8, 0x7adc,
1237 0x2001, 0x0001, 0xa108, 0x00c8, 0x3657, 0xa291, 0x0000, 0x79d2,
1238 0x79da, 0x7ad6, 0x7ade, 0x1078, 0x49ed, 0x781b, 0x0064, 0x1078,
1239 0x4872, 0x0078, 0x2438, 0x781b, 0x0064, 0x0078, 0x2438, 0x781b,
1240 0x0065, 0x0078, 0x2438, 0x1078, 0x36a3, 0x782b, 0x3008, 0x781b,
1241 0x0065, 0x0078, 0x2438, 0x1078, 0x368f, 0x782b, 0x3008, 0x781b,
1242 0x0065, 0x0078, 0x2438, 0x6827, 0x0002, 0x1078, 0x3697, 0x78e4,
1243 0xa084, 0x0030, 0x0040, 0x2461, 0x78ec, 0xa084, 0x0003, 0x0040,
1244 0x2461, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x2001,
1245 0x0005, 0x0078, 0x36a5, 0x2001, 0x000c, 0x0078, 0x36a5, 0x2001,
1246 0x0006, 0x0078, 0x36a5, 0x2001, 0x000d, 0x0078, 0x36a5, 0x2001,
1247 0x0009, 0x0078, 0x36a5, 0x2001, 0x0007, 0x789b, 0x0010, 0x78aa,
1248 0x789b, 0x0060, 0x78ab, 0x0001, 0xa6b5, 0x0004, 0x7e5a, 0x007c,
1249 0x077e, 0x873f, 0xa7bc, 0x000f, 0x873b, 0x873b, 0x8703, 0xa0e0,
1250 0x5280, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, 0xa184, 0x000f, 0x0040,
1251 0x36c9, 0xa184, 0xfff0, 0x78a6, 0x6012, 0x6004, 0xa085, 0x0008,
1252 0x6006, 0x8738, 0x8738, 0x7f9a, 0x79a4, 0xa184, 0x0040, 0x0040,
1253 0x36d9, 0xa184, 0xffbf, 0x78a6, 0x6016, 0x6004, 0xa085, 0x0010,
1254 0x6006, 0x077f, 0x007c, 0x789b, 0x0010, 0x78ab, 0x0001, 0x78ab,
1255 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0060, 0x78ab, 0x0004,
1256 0x007c, 0x2021, 0x0000, 0x2029, 0x0032, 0x789b, 0x0010, 0x78ab,
1257 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa, 0x7caa, 0x789b,
1258 0x0060, 0x78ab, 0x0005, 0x007c, 0x157e, 0x8007, 0xa084, 0x00ff,
1259 0x8003, 0x8003, 0xa080, 0x0020, 0x789a, 0x79a4, 0xa18c, 0xfff0,
1260 0x2001, 0x5046, 0x2004, 0xa082, 0x0028, 0x0040, 0x3717, 0x2021,
1261 0x37a0, 0x2019, 0x0014, 0x20a9, 0x000c, 0x0078, 0x371d, 0x2021,
1262 0x37ac, 0x2019, 0x0019, 0x20a9, 0x000d, 0x2011, 0x0064, 0x2404,
1263 0xa084, 0xfff0, 0xa106, 0x0040, 0x372c, 0x8420, 0x2300, 0xa210,
1264 0x0070, 0x372c, 0x0078, 0x371f, 0x157f, 0x007c, 0x157e, 0x2009,
1265 0x5046, 0x210c, 0xa182, 0x0032, 0x0048, 0x3742, 0x0040, 0x3746,
1266 0x2009, 0x3792, 0x2019, 0x0011, 0x20a9, 0x000e, 0x2011, 0x0032,
1267 0x0078, 0x3758, 0xa182, 0x0028, 0x0040, 0x3750, 0x2009, 0x37a0,
1268 0x2019, 0x0014, 0x20a9, 0x000c, 0x2011, 0x0064, 0x0078, 0x3758,
1269 0x2009, 0x37ac, 0x2019, 0x0019, 0x20a9, 0x000d, 0x2011, 0x0064,
1270 0x2200, 0xa502, 0x0040, 0x3768, 0x0048, 0x3768, 0x8108, 0x2300,
1271 0xa210, 0x0070, 0x3765, 0x0078, 0x3758, 0x157f, 0xa006, 0x007c,
1272 0x157f, 0xa582, 0x0064, 0x00c8, 0x3777, 0x7808, 0xa085, 0x0070,
1273 0x780a, 0x7044, 0xa085, 0x0070, 0x7046, 0x0078, 0x3777, 0x78ec,
1274 0xa084, 0x0300, 0x0040, 0x377f, 0x2104, 0x0078, 0x3790, 0x2104,
1275 0xa09e, 0x1102, 0x00c0, 0x3790, 0x2001, 0x04fd, 0x2004, 0xa082,
1276 0x0005, 0x0048, 0x378f, 0x2001, 0x1201, 0x0078, 0x3790, 0x2104,
1277 0xa005, 0x007c, 0x1102, 0x3002, 0x3202, 0x4203, 0x4403, 0x5404,
1278 0x5604, 0x6605, 0x6805, 0x7806, 0x7a06, 0x0c07, 0x0c07, 0x0e07,
1279 0x3202, 0x4202, 0x5202, 0x6202, 0x7202, 0x6605, 0x7605, 0x7805,
1280 0x7a05, 0x7c05, 0x7e05, 0x7f05, 0x2202, 0x3202, 0x4202, 0x5202,
1281 0x5404, 0x6404, 0x7404, 0x7604, 0x7804, 0x7a04, 0x7c04, 0x7e04,
1282 0x7f04, 0x789b, 0x0010, 0xa046, 0x007c, 0xa784, 0x0f00, 0x800b,
1283 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xa0e0,
1284 0x5300, 0x007c, 0x79d8, 0x7adc, 0x78d0, 0x801b, 0x00c8, 0x37d1,
1285 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x007c, 0x0f7e,
1286 0x2079, 0x0100, 0x2009, 0x5040, 0x2091, 0x8000, 0x2104, 0x0079,
1287 0x37e1, 0x3817, 0x37eb, 0x37eb, 0x37eb, 0x37eb, 0x37eb, 0x37eb,
1288 0x381b, 0x1078, 0x23ca, 0x784b, 0x0004, 0x7848, 0xa084, 0x0004,
1289 0x00c0, 0x37ed, 0x784b, 0x0008, 0x7848, 0xa084, 0x0008, 0x00c0,
1290 0x37f4, 0x68b4, 0xa085, 0x4000, 0x68b6, 0x7858, 0xa085, 0x4000,
1291 0x785a, 0x7830, 0xa084, 0x0080, 0x00c0, 0x3817, 0x0018, 0x3817,
1292 0x681c, 0xa084, 0x0020, 0x00c0, 0x3815, 0x0e7e, 0x2071, 0x5040,
1293 0x1078, 0x3868, 0x0e7f, 0x0078, 0x3817, 0x781b, 0x00d2, 0x2091,
1294 0x8001, 0x0f7f, 0x007c, 0x1078, 0x3a42, 0x0078, 0x3817, 0x0c7e,
1295 0x6814, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e0,
1296 0x5280, 0x6004, 0xa084, 0x000a, 0x00c0, 0x3852, 0x6108, 0xa194,
1297 0xff00, 0x0040, 0x3852, 0xa18c, 0x00ff, 0x2001, 0x0019, 0xa106,
1298 0x0040, 0x3841, 0x2001, 0x0032, 0xa106, 0x0040, 0x3845, 0x0078,
1299 0x3849, 0x2009, 0x0020, 0x0078, 0x384b, 0x2009, 0x003f, 0x0078,
1300 0x384b, 0x2011, 0x0000, 0x2100, 0xa205, 0x600a, 0x6004, 0xa085,
1301 0x0002, 0x6006, 0x0c7f, 0x007c, 0x781b, 0x0065, 0x0078, 0x2438,
1302 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x781b, 0x0058,
1303 0x0078, 0x2438, 0x782b, 0x3008, 0x781b, 0x0056, 0x0078, 0x2438,
1304 0x2009, 0x5020, 0x210c, 0xa186, 0x0000, 0x0040, 0x387c, 0xa186,
1305 0x0001, 0x0040, 0x387f, 0x2009, 0x5038, 0x200b, 0x000b, 0x706f,
1306 0x0001, 0x781b, 0x0048, 0x007c, 0x781b, 0x00cc, 0x007c, 0x2009,
1307 0x5038, 0x200b, 0x000a, 0x007c, 0x2009, 0x5020, 0x210c, 0xa186,
1308 0x0000, 0x0040, 0x389f, 0xa186, 0x0001, 0x0040, 0x3899, 0x2009,
1309 0x5038, 0x200b, 0x000b, 0x706f, 0x0001, 0x781b, 0x0048, 0x0078,
1310 0x2438, 0x2009, 0x5038, 0x200b, 0x000a, 0x0078, 0x2438, 0x782b,
1311 0x3008, 0x781b, 0x00cc, 0x0078, 0x2438, 0x781b, 0x00d2, 0x0078,
1312 0x2438, 0x782b, 0x3008, 0x781b, 0x00d2, 0x0078, 0x2438, 0x781b,
1313 0x0093, 0x0078, 0x2438, 0x782b, 0x3008, 0x781b, 0x0093, 0x0078,
1314 0x2438, 0x6818, 0xa084, 0x8000, 0x0040, 0x38c0, 0x681b, 0x001d,
1315 0x706f, 0x0001, 0x781b, 0x0048, 0x0078, 0x2438, 0x007e, 0x7830,
1316 0xa084, 0x00c0, 0x00c0, 0x38dc, 0x7808, 0xa084, 0xfffc, 0x780a,
1317 0x0005, 0x0005, 0x0005, 0x0005, 0x78ec, 0xa084, 0x0021, 0x0040,
1318 0x38dc, 0x7044, 0x780a, 0xa005, 0x007f, 0x007c, 0x7044, 0xa085,
1319 0x0002, 0x7046, 0x780a, 0x007c, 0x007e, 0x7830, 0xa084, 0x0040,
1320 0x00c0, 0x38e5, 0x0098, 0x38f0, 0x007f, 0x789a, 0x78ac, 0x007c,
1321 0x7808, 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005,
1322 0x78ec, 0xa084, 0x0021, 0x0040, 0x38ff, 0x0098, 0x38fd, 0x007f,
1323 0x789a, 0x78ac, 0x007e, 0x7044, 0x780a, 0x007f, 0x007c, 0x78ec,
1324 0xa084, 0x0002, 0x00c0, 0x461d, 0xa784, 0x007d, 0x00c0, 0x3913,
1325 0x2700, 0x1078, 0x23ca, 0xa784, 0x0001, 0x00c0, 0x2f43, 0xa784,
1326 0x0070, 0x0040, 0x3923, 0x0c7e, 0x2d60, 0x2f68, 0x1078, 0x2375,
1327 0x2d78, 0x2c68, 0x0c7f, 0xa784, 0x0008, 0x0040, 0x3930, 0x784b,
1328 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x2461, 0x0078, 0x3854,
1329 0xa784, 0x0004, 0x0040, 0x3963, 0x78b8, 0xa084, 0x4001, 0x0040,
1330 0x3963, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x2461,
1331 0x78e4, 0xa084, 0x0007, 0xa086, 0x0001, 0x00c0, 0x3963, 0x78c0,
1332 0xa085, 0x4800, 0x2030, 0x7e5a, 0x781b, 0x00d2, 0x0078, 0x2438,
1333 0x784b, 0x0008, 0x6818, 0xa084, 0x8000, 0x0040, 0x395f, 0x681b,
1334 0x0015, 0xa684, 0x4000, 0x0040, 0x395f, 0x681b, 0x0007, 0x1078,
1335 0x3868, 0x0078, 0x2438, 0x681b, 0x0003, 0x7858, 0xa084, 0x3f00,
1336 0x681e, 0x682f, 0x0000, 0x6833, 0x0000, 0x784b, 0x0008, 0x78ec,
1337 0xa084, 0x0003, 0x0040, 0x2944, 0x0018, 0x2438, 0x0078, 0x3673,
1338 0x6b14, 0x8307, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080,
1339 0x5280, 0x2060, 0x2048, 0x7056, 0x6000, 0x705a, 0x6004, 0x705e,
1340 0x2a60, 0x007c, 0x0079, 0x398c, 0x3994, 0x3995, 0x3994, 0x3997,
1341 0x3994, 0x3994, 0x3994, 0x399c, 0x007c, 0x1078, 0x33c4, 0x1078,
1342 0x4633, 0x7038, 0x600a, 0x007c, 0x70a0, 0xa005, 0x0040, 0x39a9,
1343 0x2068, 0x1078, 0x1b45, 0x1078, 0x45b5, 0x1078, 0x45bc, 0x70a3,
1344 0x0000, 0x007c, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x5040, 0x7000,
1345 0xa086, 0x0007, 0x00c0, 0x39c0, 0x6110, 0x70bc, 0xa106, 0x00c0,
1346 0x39c0, 0x0e7f, 0x1078, 0x1b52, 0x1078, 0x39c6, 0xa006, 0x007c,
1347 0x2091, 0x8001, 0x0e7f, 0xa085, 0x0001, 0x007c, 0x0f7e, 0x0e7e,
1348 0x2071, 0x5040, 0x0078, 0x21d9, 0x785b, 0x0000, 0x70af, 0x000e,
1349 0x2009, 0x0100, 0x017e, 0x70a0, 0xa06d, 0x0040, 0x39db, 0x70a3,
1350 0x0000, 0x0078, 0x39e1, 0x70b3, 0x0000, 0x1078, 0x1b6e, 0x0040,
1351 0x39e7, 0x70ac, 0x6826, 0x1078, 0x3ac2, 0x0078, 0x39db, 0x017f,
1352 0x157e, 0x0c7e, 0x0d7e, 0x20a9, 0x0008, 0x2061, 0x7410, 0x6000,
1353 0xa105, 0x6002, 0x601c, 0xa06d, 0x0040, 0x39ff, 0x6800, 0x601e,
1354 0x1078, 0x193d, 0x6008, 0x8000, 0x600a, 0x0078, 0x39f2, 0x6018,
1355 0xa06d, 0x0040, 0x3a09, 0x6800, 0x601a, 0x1078, 0x193d, 0x0078,
1356 0x39ff, 0xace0, 0x0008, 0x0070, 0x3a0f, 0x0078, 0x39ef, 0x709c,
1357 0xa084, 0x8000, 0x0040, 0x3a16, 0x1078, 0x3b3c, 0x0d7f, 0x0c7f,
1358 0x157f, 0x007c, 0x127e, 0x2091, 0x2300, 0x6804, 0xa084, 0x000f,
1359 0x0079, 0x3a22, 0x3a32, 0x3a32, 0x3a32, 0x3a32, 0x3a32, 0x3a32,
1360 0x3a34, 0x3a3a, 0x3a32, 0x3a32, 0x3a32, 0x3a32, 0x3a32, 0x3a3c,
1361 0x3a32, 0x3a34, 0x1078, 0x23ca, 0x1078, 0x4466, 0x1078, 0x193d,
1362 0x0078, 0x3a40, 0x6827, 0x000b, 0x1078, 0x4466, 0x1078, 0x3ac2,
1363 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x0098, 0x3a5e, 0x7830,
1364 0xa084, 0x00c0, 0x00c0, 0x3a5e, 0x0d7e, 0x1078, 0x45c5, 0x2d00,
1365 0x682e, 0x2009, 0x0004, 0x2001, 0x0000, 0x6827, 0x0084, 0x1078,
1366 0x457e, 0x1078, 0x3ac2, 0x0d7f, 0x0078, 0x3a90, 0x7948, 0xa185,
1367 0x4000, 0x784a, 0x0098, 0x3a67, 0x794a, 0x0078, 0x3a4c, 0x7828,
1368 0xa086, 0x1834, 0x00c0, 0x3a70, 0xa185, 0x0004, 0x0078, 0x3a77,
1369 0x7828, 0xa186, 0x1814, 0x00c0, 0x3a64, 0xa185, 0x000c, 0x784a,
1370 0x789b, 0x000e, 0x78ab, 0x0002, 0x7858, 0xa084, 0x00ff, 0xa085,
1371 0x0400, 0x785a, 0x70b4, 0xa080, 0x0091, 0x781a, 0x6827, 0x0002,
1372 0x6827, 0x0084, 0x2009, 0x0004, 0x2001, 0x0000, 0x1078, 0x457e,
1373 0x127f, 0x007c, 0x0d7e, 0x6b14, 0x1078, 0x1be0, 0x0040, 0x3a9f,
1374 0x2068, 0x6827, 0x0002, 0x1078, 0x3ac2, 0x0078, 0x3a94, 0x0d7f,
1375 0x007c, 0x0d7e, 0x6b14, 0x6c28, 0xa4a4, 0x00ff, 0x1078, 0x1b7e,
1376 0x0040, 0x3aaf, 0x2068, 0x6827, 0x0002, 0x1078, 0x3ac2, 0x0d7f,
1377 0x007c, 0x0d7e, 0x6b14, 0xa39c, 0x00ff, 0x1078, 0x1bb1, 0x0040,
1378 0x3ac0, 0x2068, 0x6827, 0x0002, 0x1078, 0x3ac2, 0x0078, 0x3ab5,
1379 0x0d7f, 0x007c, 0x0c7e, 0x6914, 0x1078, 0x3b33, 0x6904, 0xa18c,
1380 0x00ff, 0xa186, 0x0006, 0x0040, 0x3add, 0xa186, 0x000d, 0x0040,
1381 0x3afc, 0xa186, 0x0017, 0x00c0, 0x3ad9, 0x1078, 0x193d, 0x0078,
1382 0x3adb, 0x1078, 0x1c55, 0x0c7f, 0x007c, 0x6004, 0x8001, 0x0048,
1383 0x3afa, 0x6006, 0x2009, 0x0000, 0xa684, 0x0001, 0x00c0, 0x3aea,
1384 0xa18d, 0x8000, 0xa684, 0x0004, 0x0040, 0x3af0, 0xa18d, 0x0002,
1385 0x691e, 0x6823, 0x0000, 0x7104, 0x810f, 0x6818, 0xa105, 0x681a,
1386 0x0078, 0x3ad9, 0x1078, 0x23ca, 0x6018, 0xa005, 0x00c0, 0x3b0b,
1387 0x6008, 0x8001, 0x0048, 0x3b0b, 0x600a, 0x601c, 0x6802, 0x2d00,
1388 0x601e, 0x0078, 0x3b21, 0xac88, 0x0006, 0x2104, 0xa005, 0x0040,
1389 0x3b14, 0x2008, 0x0078, 0x3b0d, 0x6802, 0x2d0a, 0x6008, 0x8001,
1390 0x0048, 0x3adb, 0x600a, 0x6018, 0x2068, 0x6800, 0x601a, 0x0078,
1391 0x3b05, 0x157e, 0x137e, 0x147e, 0x0c7e, 0x0d7e, 0x1078, 0x191a,
1392 0x2da0, 0x137f, 0x20a9, 0x0031, 0x53a3, 0x0c7f, 0x147f, 0x137f,
1393 0x157f, 0x0078, 0x3ad9, 0xa184, 0x001f, 0x8003, 0x8003, 0x8003,
1394 0xa080, 0x7410, 0x2060, 0x007c, 0x2019, 0x5051, 0x2304, 0xa085,
1395 0x0001, 0x201a, 0x2019, 0x0102, 0x2304, 0xa085, 0x0001, 0x201a,
1396 0x007c, 0x2019, 0x5051, 0x2304, 0xa084, 0xfffe, 0x201a, 0x2019,
1397 0x0102, 0x2304, 0xa084, 0xfffe, 0x201a, 0x007c, 0x7990, 0xa18c,
1398 0xfff8, 0x7992, 0x70b4, 0xa080, 0x00d8, 0x781a, 0x0078, 0x2438,
1399 0x70a3, 0x0000, 0x7003, 0x0000, 0x7043, 0x0001, 0x7037, 0x0000,
1400 0x0018, 0x23ef, 0x1078, 0x1b6e, 0x0040, 0x3b91, 0x2009, 0x500f,
1401 0x200b, 0x0000, 0x68bc, 0x2060, 0x6100, 0xa184, 0x0300, 0x0040,
1402 0x3b85, 0x6827, 0x000e, 0xa084, 0x0200, 0x0040, 0x3b81, 0x6827,
1403 0x0017, 0x1078, 0x3ac2, 0x0078, 0x3b60, 0x7000, 0xa086, 0x0007,
1404 0x00c0, 0x3be3, 0x2d00, 0x70a2, 0xad80, 0x000f, 0x7036, 0x0078,
1405 0x3b98, 0x7040, 0xa086, 0x0001, 0x0040, 0x2471, 0x0078, 0x2438,
1406 0x2031, 0x0000, 0x691c, 0xa184, 0x0002, 0x0040, 0x3ba1, 0xa6b5,
1407 0x0004, 0xa184, 0x00c0, 0x8003, 0x8003, 0x8007, 0xa080, 0x3c72,
1408 0x2004, 0xa635, 0x6820, 0xa084, 0x0400, 0x0040, 0x3bb9, 0x789b,
1409 0x0018, 0x78ab, 0x0003, 0x789b, 0x0081, 0x78ab, 0x0001, 0xa6b5,
1410 0x1000, 0x6820, 0xa084, 0x8000, 0x0040, 0x3bc5, 0xa6b5, 0x0400,
1411 0x789b, 0x000e, 0x6824, 0x8007, 0x78aa, 0xa684, 0x0200, 0x0040,
1412 0x3bdf, 0x682c, 0x78d2, 0x6830, 0x78d6, 0xa684, 0x0100, 0x0040,
1413 0x3bdd, 0x682c, 0xa084, 0x0001, 0x0040, 0x3bdd, 0x7888, 0xa084,
1414 0x0040, 0x0040, 0x3bdd, 0xa6b5, 0x8000, 0x1078, 0x45ad, 0x7e5a,
1415 0x6eb6, 0x0078, 0x45e4, 0x1078, 0x38c6, 0x00c0, 0x3c6c, 0x702c,
1416 0x8004, 0x0048, 0x3bf1, 0x2019, 0x4cfd, 0x1078, 0x2255, 0x702f,
1417 0x0001, 0x2011, 0x0001, 0x2031, 0x1000, 0x789b, 0x0018, 0x6814,
1418 0xa084, 0x001f, 0xa085, 0x0080, 0x78aa, 0x691c, 0xa184, 0x0002,
1419 0x0040, 0x3c0a, 0xa6b5, 0x0004, 0x78ab, 0x0020, 0x6828, 0x78aa,
1420 0xa290, 0x0002, 0x6820, 0xa084, 0x8000, 0x0040, 0x3c18, 0xa6b5,
1421 0x0400, 0x789b, 0x000e, 0x6824, 0x8007, 0x78aa, 0x0078, 0x3c26,
1422 0x681c, 0xa084, 0x8000, 0x00c0, 0x3c26, 0xa6b5, 0x0800, 0x6820,
1423 0xa084, 0x0100, 0x0040, 0x3c26, 0xa6b5, 0x4000, 0x681c, 0xa084,
1424 0x00c0, 0x8003, 0x8003, 0x8007, 0xa080, 0x3c72, 0x2004, 0xa635,
1425 0xa684, 0x0100, 0x0040, 0x3c40, 0x682c, 0xa084, 0x0001, 0x0040,
1426 0x3c40, 0x7888, 0xa084, 0x0040, 0x0040, 0x3c40, 0xa6b5, 0x8000,
1427 0x789b, 0x007e, 0x7eae, 0x6eb6, 0x6814, 0x8007, 0x78aa, 0x7882,
1428 0x7aaa, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x3c6c, 0x0018, 0x3c6c,
1429 0x70b4, 0xa080, 0x00dd, 0x781a, 0x1078, 0x38de, 0xa684, 0x0200,
1430 0x0040, 0x3c60, 0x682c, 0x78d2, 0x6830, 0x78d6, 0x1078, 0x45ad,
1431 0x2d00, 0x70a2, 0x704a, 0x6810, 0x70be, 0x7003, 0x0007, 0xad80,
1432 0x000f, 0x7036, 0x0078, 0x2438, 0x1078, 0x1b45, 0x1078, 0x38de,
1433 0x0078, 0x2438, 0x0000, 0x0300, 0x0200, 0x0000, 0x1078, 0x23ca,
1434 0x2300, 0x0079, 0x3c7b, 0x3c7e, 0x3c7e, 0x3c80, 0x1078, 0x23ca,
1435 0x1078, 0x45bc, 0x6924, 0xa184, 0x00ff, 0xa086, 0x000a, 0x0040,
1436 0x3c92, 0xa184, 0xff00, 0xa085, 0x000a, 0x6826, 0x1078, 0x1b45,
1437 0x0078, 0x3b60, 0x2001, 0x000a, 0x1078, 0x454c, 0x0078, 0x3b60,
1438 0xa282, 0x0005, 0x0050, 0x3c9e, 0x1078, 0x23ca, 0x7000, 0xa084,
1439 0x0007, 0x10c0, 0x398a, 0x1078, 0x191a, 0x00c0, 0x3cbd, 0xa684,
1440 0x0004, 0x0040, 0x3caf, 0x2001, 0x2800, 0x0078, 0x3cb1, 0x2001,
1441 0x0800, 0x71b4, 0xa188, 0x0091, 0x789b, 0x000e, 0x78aa, 0x2031,
1442 0x0400, 0x7e5a, 0x791a, 0x0078, 0x2438, 0x6807, 0x0106, 0x680b,
1443 0x0000, 0x689f, 0x0000, 0x6827, 0x0000, 0xa386, 0x0002, 0x00c0,
1444 0x3cde, 0xa286, 0x0002, 0x00c0, 0x3cde, 0x78a0, 0xa005, 0x00c0,
1445 0x3cde, 0xa484, 0x8000, 0x00c0, 0x3cde, 0x78e4, 0xa084, 0x0008,
1446 0x0040, 0x3cde, 0xa6b5, 0x0008, 0x2019, 0x0000, 0x1078, 0x40d3,
1447 0x2d00, 0x70a2, 0x704a, 0x7003, 0x0007, 0x7037, 0x0000, 0x6824,
1448 0xa084, 0x0080, 0x0040, 0x3cf0, 0x1078, 0x4180, 0x0078, 0x2438,
1449 0x2300, 0x0079, 0x3cf3, 0x3cf6, 0x3d77, 0x3d96, 0x2200, 0x0079,
1450 0x3cf9, 0x3cfe, 0x3d0e, 0x3d34, 0x3d40, 0x3d63, 0x2029, 0x0001,
1451 0xa026, 0x2011, 0x0000, 0x1078, 0x428d, 0x0079, 0x3d07, 0x3d0c,
1452 0x2438, 0x3b60, 0x3d0c, 0x3d0c, 0x1078, 0x23ca, 0x7990, 0xa18c,
1453 0x0007, 0x00c0, 0x3d15, 0x2009, 0x0008, 0x2011, 0x0001, 0xa684,
1454 0x0004, 0x0040, 0x3d1d, 0x2011, 0x0003, 0x2220, 0xa12a, 0x2011,
1455 0x0001, 0x1078, 0x428d, 0x0079, 0x3d25, 0x3d2a, 0x2438, 0x3b60,
1456 0x3d32, 0x3d2c, 0x0078, 0x45ea, 0x70ab, 0x3d30, 0x0078, 0x2438,
1457 0x0078, 0x3d2a, 0x1078, 0x23ca, 0xa684, 0x0010, 0x0040, 0x3d3e,
1458 0x1078, 0x414f, 0x0040, 0x3d3e, 0x0078, 0x2438, 0x0078, 0x41bc,
1459 0x6000, 0xa084, 0x0002, 0x0040, 0x3d5d, 0x70b4, 0xa080, 0x00cd,
1460 0x781a, 0x0d7e, 0x1078, 0x45c5, 0x2d00, 0x682e, 0x6827, 0x0000,
1461 0x1078, 0x3ac2, 0x0d7f, 0x1078, 0x193d, 0x7003, 0x0000, 0x7037,
1462 0x0000, 0x704b, 0x0000, 0x0078, 0x3b60, 0xa684, 0x0004, 0x00c0,
1463 0x3d63, 0x0078, 0x45ea, 0x6000, 0xa084, 0x0004, 0x00c0, 0x3d75,
1464 0x6000, 0xa084, 0x0001, 0x0040, 0x3d75, 0x70ab, 0x3d75, 0x2001,
1465 0x0007, 0x1078, 0x4544, 0x0078, 0x45f0, 0x0078, 0x45ea, 0x2200,
1466 0x0079, 0x3d7a, 0x3d7f, 0x3d7f, 0x3d7f, 0x3d81, 0x3d7f, 0x1078,
1467 0x23ca, 0x70a7, 0x3d85, 0x0078, 0x45f6, 0x2011, 0x0018, 0x1078,
1468 0x4287, 0x0079, 0x3d8b, 0x3d90, 0x2438, 0x3b60, 0x3d92, 0x3d94,
1469 0x1078, 0x23ca, 0x1078, 0x23ca, 0x1078, 0x23ca, 0x2200, 0x0079,
1470 0x3d99, 0x3d9e, 0x3da0, 0x3da0, 0x3d9e, 0x3d9e, 0x1078, 0x23ca,
1471 0x78e4, 0xa084, 0x0008, 0x0040, 0x3db5, 0x70a7, 0x3da9, 0x0078,
1472 0x45f6, 0x2011, 0x0004, 0x1078, 0x4287, 0x0079, 0x3daf, 0x3db5,
1473 0x2438, 0x3b60, 0x3db5, 0x3dbf, 0x3dc3, 0x70ab, 0x3dbd, 0x2001,
1474 0x0003, 0x1078, 0x4544, 0x0078, 0x45f0, 0x0078, 0x45ea, 0x70ab,
1475 0x3db5, 0x0078, 0x2438, 0x70ab, 0x3dc7, 0x0078, 0x2438, 0x0078,
1476 0x3dbd, 0xa282, 0x0003, 0x0050, 0x3dcf, 0x1078, 0x23ca, 0xa386,
1477 0x0002, 0x00c0, 0x3de8, 0xa286, 0x0002, 0x00c0, 0x3dee, 0x78a0,
1478 0xa005, 0x00c0, 0x3dee, 0xa484, 0x8000, 0x00c0, 0x3dee, 0x78e4,
1479 0xa084, 0x0008, 0x0040, 0x3de8, 0xa6b5, 0x0008, 0x2019, 0x0000,
1480 0xa684, 0x0008, 0x0040, 0x3dee, 0x1078, 0x412c, 0x6810, 0x70be,
1481 0x7003, 0x0007, 0x2300, 0x0079, 0x3df5, 0x3df8, 0x3e25, 0x3e2d,
1482 0x2200, 0x0079, 0x3dfb, 0x3e00, 0x3dfe, 0x3e19, 0x1078, 0x23ca,
1483 0x7990, 0xa1ac, 0x0007, 0xa026, 0x2011, 0x0001, 0x1078, 0x428d,
1484 0x0079, 0x3e0a, 0x3e0f, 0x2438, 0x3b60, 0x3e17, 0x3e11, 0x0078,
1485 0x45ea, 0x70ab, 0x3e15, 0x0078, 0x2438, 0x0078, 0x3e0f, 0x1078,
1486 0x23ca, 0xa684, 0x0010, 0x0040, 0x3e23, 0x1078, 0x414f, 0x0040,
1487 0x3e23, 0x0078, 0x2438, 0x0078, 0x41bc, 0x2200, 0x0079, 0x3e28,
1488 0x3e2b, 0x3e2b, 0x3e2b, 0x1078, 0x23ca, 0x2200, 0x0079, 0x3e30,
1489 0x3e33, 0x3e35, 0x3e35, 0x1078, 0x23ca, 0x78e4, 0xa084, 0x0008,
1490 0x0040, 0x3e4a, 0x70a7, 0x3e3e, 0x0078, 0x45f6, 0x2011, 0x0004,
1491 0x1078, 0x4287, 0x0079, 0x3e44, 0x3e4a, 0x2438, 0x3b60, 0x3e4a,
1492 0x3e54, 0x3e58, 0x70ab, 0x3e52, 0x2001, 0x0003, 0x1078, 0x4544,
1493 0x0078, 0x45f0, 0x0078, 0x45ea, 0x70ab, 0x3e4a, 0x0078, 0x2438,
1494 0x70ab, 0x3e5c, 0x0078, 0x2438, 0x0078, 0x3e52, 0x2300, 0x0079,
1495 0x3e61, 0x3e66, 0x3e68, 0x3e64, 0x1078, 0x23ca, 0x70a4, 0x007a,
1496 0x70a4, 0x007a, 0xa282, 0x0002, 0x0050, 0x3e70, 0x1078, 0x23ca,
1497 0xa684, 0x0200, 0x0040, 0x3e7a, 0x1078, 0x45b5, 0x1078, 0x426f,
1498 0x1078, 0x45bc, 0x2300, 0x0079, 0x3e7d, 0x3e80, 0x3ea4, 0x3f0a,
1499 0xa286, 0x0001, 0x0040, 0x3e86, 0x1078, 0x23ca, 0xa684, 0x0200,
1500 0x0040, 0x3e8e, 0x1078, 0x45b5, 0x1078, 0x45bc, 0x2001, 0x0001,
1501 0x1078, 0x454c, 0x78b8, 0xa084, 0xc001, 0x0040, 0x3ea0, 0x7848,
1502 0xa085, 0x0008, 0x784a, 0x7848, 0xa084, 0x0008, 0x00c0, 0x3e9b,
1503 0x7003, 0x0000, 0x0078, 0x3b60, 0x2200, 0x0079, 0x3ea7, 0x3ea9,
1504 0x3eda, 0x70a7, 0x3ead, 0x0078, 0x45f6, 0x2011, 0x000d, 0x1078,
1505 0x4287, 0x0079, 0x3eb3, 0x3eba, 0x2438, 0x3b60, 0x3ec2, 0x3eca,
1506 0x3ed0, 0x3ed2, 0xa6b4, 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a,
1507 0x0078, 0x45e4, 0xa6b4, 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a,
1508 0x0078, 0x45e4, 0x70ab, 0x3ece, 0x0078, 0x2438, 0x0078, 0x3eba,
1509 0x1078, 0x23ca, 0x70ab, 0x3ed6, 0x0078, 0x2438, 0x1078, 0x45fc,
1510 0x0078, 0x2438, 0x70a7, 0x3ede, 0x0078, 0x45f6, 0x2011, 0x0012,
1511 0x1078, 0x4287, 0x0079, 0x3ee4, 0x3eea, 0x2438, 0x3b60, 0x3ef6,
1512 0x3efe, 0x3f04, 0xa6b4, 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a,
1513 0x70b4, 0xa080, 0x00a5, 0x781a, 0x0078, 0x2438, 0xa6b4, 0x00ff,
1514 0xa6b5, 0x0400, 0x6eb6, 0x7e5a, 0x0078, 0x45e4, 0x70ab, 0x3f02,
1515 0x0078, 0x2438, 0x0078, 0x3eea, 0x70ab, 0x3f08, 0x0078, 0x2438,
1516 0x0078, 0x3ef6, 0xa286, 0x0001, 0x0040, 0x3f10, 0x1078, 0x23ca,
1517 0x70a7, 0x3f14, 0x0078, 0x45f6, 0x2011, 0x0015, 0x1078, 0x4287,
1518 0x0079, 0x3f1a, 0x3f1f, 0x2438, 0x3b60, 0x3f2d, 0x3f39, 0xa6b4,
1519 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a, 0x783b, 0x1301, 0x70b4,
1520 0xa080, 0x00b5, 0x781a, 0x0078, 0x2438, 0xa6b4, 0x00ff, 0xa6b5,
1521 0x0400, 0x6eb6, 0x7e5a, 0x70b4, 0xa080, 0x00a5, 0x781a, 0x0078,
1522 0x2438, 0x70ab, 0x3f3d, 0x0078, 0x2438, 0x0078, 0x3f1f, 0xa282,
1523 0x0003, 0x0050, 0x3f45, 0x1078, 0x23ca, 0x2300, 0x0079, 0x3f48,
1524 0x3f4b, 0x3f82, 0x3fdd, 0xa286, 0x0001, 0x0040, 0x3f51, 0x1078,
1525 0x23ca, 0x6804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x3f5e,
1526 0x1078, 0x3ac2, 0x7003, 0x0000, 0x0078, 0x3b60, 0x683b, 0x0000,
1527 0x6837, 0x0000, 0xa684, 0x0200, 0x0040, 0x3f6c, 0x1078, 0x45b5,
1528 0x1078, 0x426f, 0x1078, 0x45bc, 0x2001, 0x0001, 0x1078, 0x454c,
1529 0x78b8, 0xa084, 0xc001, 0x0040, 0x3f7e, 0x7848, 0xa085, 0x0008,
1530 0x784a, 0x7848, 0xa084, 0x0008, 0x00c0, 0x3f79, 0x7003, 0x0000,
1531 0x0078, 0x3b60, 0x2200, 0x0079, 0x3f85, 0x3f87, 0x3fb8, 0x70a7,
1532 0x3f8b, 0x0078, 0x45f6, 0x2011, 0x000d, 0x1078, 0x4287, 0x0079,
1533 0x3f91, 0x3f98, 0x2438, 0x3b60, 0x3fa0, 0x3fa8, 0x3fae, 0x3fb0,
1534 0xa6b4, 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x45e4,
1535 0xa6b4, 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x45e4,
1536 0x70ab, 0x3fac, 0x0078, 0x2438, 0x0078, 0x3f98, 0x1078, 0x23ca,
1537 0x70ab, 0x3fb4, 0x0078, 0x2438, 0x1078, 0x45fc, 0x0078, 0x2438,
1538 0x70a7, 0x3fbc, 0x0078, 0x45f6, 0x2011, 0x0005, 0x1078, 0x4287,
1539 0x0079, 0x3fc2, 0x3fc7, 0x2438, 0x3b60, 0x3fcf, 0x3fd7, 0xa6b4,
1540 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x45e4, 0xa6b4,
1541 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x45e4, 0x70ab,
1542 0x3fdb, 0x0078, 0x2438, 0x0078, 0x3fc7, 0xa286, 0x0001, 0x0040,
1543 0x3fe3, 0x1078, 0x23ca, 0x70a7, 0x3fe7, 0x0078, 0x45f6, 0x2011,
1544 0x0006, 0x1078, 0x4287, 0x0079, 0x3fed, 0x3ff2, 0x2438, 0x3b60,
1545 0x3ff8, 0x4002, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x45e4,
1546 0xa6b4, 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0xa6b5, 0x4000, 0x7e5a,
1547 0x0078, 0x45e4, 0x70ab, 0x4006, 0x0078, 0x2438, 0x0078, 0x3ff2,
1548 0x2300, 0x0079, 0x400b, 0x4010, 0x400e, 0x400e, 0x1078, 0x23ca,
1549 0x1078, 0x23ca, 0x2300, 0x71a8, 0xa005, 0x017a, 0x6810, 0x70be,
1550 0xa282, 0x0003, 0x0050, 0x401e, 0x1078, 0x23ca, 0x2300, 0x0079,
1551 0x4021, 0x4024, 0x4037, 0x4059, 0x82ff, 0x00c0, 0x4029, 0x1078,
1552 0x23ca, 0xa684, 0x0200, 0x0040, 0x4031, 0x1078, 0x45b5, 0x1078,
1553 0x45bc, 0x2001, 0x0001, 0x1078, 0x454c, 0x0078, 0x2438, 0xa296,
1554 0x0002, 0x0040, 0x4040, 0x82ff, 0x0040, 0x4040, 0x1078, 0x23ca,
1555 0x70a7, 0x4044, 0x0078, 0x45f6, 0x2011, 0x0018, 0x1078, 0x4287,
1556 0x0079, 0x404a, 0x404f, 0x2438, 0x3b60, 0x4051, 0x4053, 0x0078,
1557 0x45e4, 0x0078, 0x45e4, 0x70ab, 0x4057, 0x0078, 0x2438, 0x0078,
1558 0x404f, 0x2200, 0x0079, 0x405c, 0x405e, 0x4077, 0x70a7, 0x4062,
1559 0x0078, 0x45f6, 0x2011, 0x0017, 0x1078, 0x4287, 0x0079, 0x4068,
1560 0x406d, 0x2438, 0x3b60, 0x406f, 0x4071, 0x0078, 0x45e4, 0x0078,
1561 0x45e4, 0x70ab, 0x4075, 0x0078, 0x2438, 0x0078, 0x406d, 0xa484,
1562 0x8000, 0x00c0, 0x40c1, 0xa684, 0x0100, 0x0040, 0x408b, 0x1078,
1563 0x45b5, 0x1078, 0x426f, 0x1078, 0x45bc, 0x7848, 0xa085, 0x000c,
1564 0x784a, 0x0078, 0x408f, 0x78d8, 0x78d2, 0x78dc, 0x78d6, 0xa6b4,
1565 0xefff, 0x7e5a, 0x70a7, 0x4096, 0x0078, 0x45f6, 0x2011, 0x000d,
1566 0x1078, 0x4287, 0x0079, 0x409c, 0x40a3, 0x2438, 0x3b60, 0x40a3,
1567 0x40b1, 0x40b7, 0x40b9, 0xa684, 0x0100, 0x0040, 0x40af, 0x1078,
1568 0x4573, 0x682c, 0x78d2, 0x6830, 0x78d6, 0x1078, 0x45ad, 0x0078,
1569 0x45e4, 0x70ab, 0x40b5, 0x0078, 0x2438, 0x0078, 0x40a3, 0x1078,
1570 0x23ca, 0x70ab, 0x40bd, 0x0078, 0x2438, 0x1078, 0x45fc, 0x0078,
1571 0x2438, 0x1078, 0x45bc, 0x70ab, 0x40cb, 0x2001, 0x0003, 0x1078,
1572 0x4544, 0x0078, 0x45f0, 0x1078, 0x45ad, 0x682c, 0x78d2, 0x6830,
1573 0x78d6, 0x0078, 0x45e4, 0x70b8, 0x6812, 0x70be, 0x8000, 0x70ba,
1574 0x681b, 0x0000, 0xa684, 0x0008, 0x0040, 0x40f6, 0x157e, 0x137e,
1575 0x147e, 0x7890, 0x8004, 0x8004, 0x8004, 0x8004, 0xa084, 0x000f,
1576 0x681a, 0x80ac, 0x789b, 0x0000, 0xaf80, 0x002b, 0x2098, 0xad80,
1577 0x000b, 0x20a0, 0x53a5, 0x147f, 0x137f, 0x157f, 0xa6c4, 0x0f00,
1578 0xa684, 0x0002, 0x00c0, 0x4102, 0x692c, 0x810d, 0x810d, 0x810d,
1579 0x0078, 0x410f, 0x789b, 0x0010, 0x79ac, 0x0078, 0x410f, 0x017e,
1580 0x2009, 0x0005, 0x2001, 0x3d00, 0x1078, 0x457e, 0x017f, 0xa184,
1581 0x001f, 0xa805, 0x6816, 0x1078, 0x3b33, 0x68be, 0xa684, 0x0004,
1582 0x0040, 0x4120, 0xa18c, 0xff00, 0x78a8, 0xa084, 0x00ff, 0xa105,
1583 0x682a, 0xa6b4, 0x00ff, 0x6000, 0xa084, 0x0008, 0x0040, 0x412a,
1584 0xa6b5, 0x4000, 0x6eb6, 0x007c, 0x157e, 0x137e, 0x147e, 0x6918,
1585 0x7890, 0x8004, 0x8004, 0x8004, 0x8004, 0xa084, 0x000f, 0x007e,
1586 0xa100, 0x681a, 0x007f, 0x8000, 0x8004, 0x0040, 0x414b, 0x20a8,
1587 0x8104, 0xa080, 0x000b, 0xad00, 0x20a0, 0x789b, 0x0000, 0xaf80,
1588 0x002b, 0x2098, 0x53a5, 0x147f, 0x137f, 0x157f, 0x007c, 0x682c,
1589 0xa084, 0x0020, 0x00c0, 0x4157, 0x620c, 0x0078, 0x4158, 0x6210,
1590 0x6b18, 0x2300, 0xa202, 0x0040, 0x4178, 0x2018, 0xa382, 0x000e,
1591 0x0048, 0x4168, 0x0040, 0x4168, 0x2019, 0x000e, 0x0078, 0x416c,
1592 0x7858, 0xa084, 0xffef, 0x785a, 0x783b, 0x1b01, 0x7893, 0x0000,
1593 0x7ba2, 0x70b4, 0xa080, 0x008e, 0x781a, 0xa085, 0x0001, 0x007c,
1594 0x7858, 0xa084, 0xffef, 0x785a, 0x7893, 0x0000, 0xa006, 0x007c,
1595 0x6904, 0xa18c, 0x00ff, 0xa196, 0x0007, 0x0040, 0x418d, 0xa196,
1596 0x000f, 0x0040, 0x418d, 0x6807, 0x0117, 0x6914, 0x1078, 0x3b33,
1597 0x6100, 0x8104, 0x00c8, 0x41a8, 0x601c, 0xa005, 0x0040, 0x419c,
1598 0x2001, 0x0800, 0x0078, 0x41aa, 0x0d7e, 0x6824, 0x007e, 0x1078,
1599 0x45c5, 0x007f, 0x6826, 0x2d00, 0x682e, 0x1078, 0x3ac2, 0x0d7f,
1600 0x2001, 0x0200, 0x6826, 0x8007, 0x789b, 0x000e, 0x78aa, 0x6820,
1601 0xa085, 0x8000, 0x6822, 0x2031, 0x0400, 0x6eb6, 0x7e5a, 0x71b4,
1602 0xa188, 0x0091, 0x791a, 0x007c, 0xa6c4, 0x0f00, 0xa684, 0x0002,
1603 0x00c0, 0x41cf, 0x692c, 0x810d, 0x810d, 0x810d, 0xa184, 0x001f,
1604 0xa805, 0x6816, 0x1078, 0x3b33, 0x68be, 0x0078, 0x41d2, 0x6914,
1605 0x1078, 0x3b33, 0x6100, 0x8104, 0x00c8, 0x421c, 0xa184, 0x0300,
1606 0x0040, 0x41de, 0x6807, 0x0117, 0x0078, 0x41fc, 0x6004, 0xa005,
1607 0x00c0, 0x4205, 0x6807, 0x0117, 0x601c, 0xa005, 0x00c0, 0x41f2,
1608 0x0d7e, 0x1078, 0x45c5, 0x6827, 0x0034, 0x2d00, 0x682e, 0x1078,
1609 0x3ac2, 0x0d7f, 0xa684, 0x0004, 0x0040, 0x41fc, 0x2031, 0x0400,
1610 0x2001, 0x2800, 0x0078, 0x4200, 0x2031, 0x0400, 0x2001, 0x0800,
1611 0x71b4, 0xa188, 0x0091, 0x0078, 0x424a, 0x6018, 0xa005, 0x00c0,
1612 0x41f2, 0x601c, 0xa005, 0x00c0, 0x41f2, 0x689f, 0x0000, 0x6827,
1613 0x003d, 0xa684, 0x0001, 0x0040, 0x4258, 0xa6b5, 0x0800, 0x71b4,
1614 0xa188, 0x00ae, 0x0078, 0x4253, 0x6807, 0x0117, 0x2031, 0x0400,
1615 0x692c, 0xa18c, 0x00ff, 0xa186, 0x0012, 0x00c0, 0x422d, 0x2001,
1616 0x4265, 0x2009, 0x0001, 0x0078, 0x423e, 0xa186, 0x0003, 0x00c0,
1617 0x4237, 0x2001, 0x4266, 0x2009, 0x0012, 0x0078, 0x423e, 0x2001,
1618 0x0200, 0x71b4, 0xa188, 0x0091, 0x0078, 0x424a, 0x1078, 0x4598,
1619 0x78a3, 0x0000, 0x681c, 0xa085, 0x0040, 0x681e, 0x71b4, 0xa188,
1620 0x00da, 0xa006, 0x6826, 0x8007, 0x789b, 0x000e, 0x78aa, 0x6820,
1621 0xa085, 0x8000, 0x6822, 0x6eb6, 0x7e5a, 0x791a, 0x0078, 0x2438,
1622 0x6eb6, 0x1078, 0x3ac2, 0x6810, 0x70be, 0x7003, 0x0007, 0x70a3,
1623 0x0000, 0x704b, 0x0000, 0x0078, 0x2438, 0x0023, 0x0070, 0x0005,
1624 0x0000, 0x0a00, 0x0000, 0x0000, 0x0025, 0x0000, 0x0000, 0x683b,
1625 0x0000, 0x6837, 0x0000, 0xa684, 0x0200, 0x0040, 0x4286, 0x78b8,
1626 0xa08c, 0x001f, 0xa084, 0x8000, 0x0040, 0x427f, 0x8108, 0x78d8,
1627 0xa100, 0x6836, 0x78dc, 0xa081, 0x0000, 0x683a, 0x007c, 0x7990,
1628 0x810f, 0xa5ac, 0x0007, 0x2021, 0x0000, 0xa480, 0x0010, 0x789a,
1629 0x79a8, 0xa18c, 0x00ff, 0xa184, 0x0080, 0x00c0, 0x42b5, 0xa182,
1630 0x0020, 0x00c8, 0x42cf, 0xa182, 0x0012, 0x00c8, 0x4536, 0x2100,
1631 0x1079, 0x42a3, 0x007c, 0x4536, 0x447e, 0x4536, 0x4536, 0x42dc,
1632 0x42df, 0x4319, 0x434f, 0x4381, 0x4384, 0x4536, 0x4536, 0x433a,
1633 0x43a8, 0x43e2, 0x4536, 0x4536, 0x4409, 0xa18c, 0x001f, 0x6814,
1634 0xa084, 0x001f, 0xa106, 0x0040, 0x42cc, 0x70b4, 0xa080, 0x00cd,
1635 0x781a, 0x2001, 0x0014, 0x1078, 0x454c, 0x1078, 0x45bc, 0x7003,
1636 0x0000, 0x2001, 0x0002, 0x007c, 0x2001, 0x0000, 0x007c, 0xa182,
1637 0x0024, 0x00c8, 0x4536, 0xa184, 0x0003, 0x1079, 0x42a3, 0x007c,
1638 0x4536, 0x4536, 0x4536, 0x4536, 0x1078, 0x4536, 0x007c, 0x2200,
1639 0x0079, 0x42e2, 0x440c, 0x440c, 0x4306, 0x4306, 0x4306, 0x4306,
1640 0x4306, 0x4306, 0x4306, 0x4306, 0x4304, 0x4306, 0x42fb, 0x4306,
1641 0x4306, 0x4306, 0x4306, 0x4306, 0x430e, 0x4311, 0x440c, 0x4311,
1642 0x4306, 0x4306, 0x4306, 0x0c7e, 0x077e, 0x6f14, 0x1078, 0x36b0,
1643 0x077f, 0x0c7f, 0x0078, 0x4306, 0x1078, 0x44d1, 0x6827, 0x02b3,
1644 0x2009, 0x000b, 0x2001, 0x4800, 0x0078, 0x4440, 0x1078, 0x452b,
1645 0x007c, 0x6827, 0x0093, 0x2009, 0x000b, 0x2001, 0x4800, 0x0078,
1646 0x4428, 0x2d58, 0x6804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
1647 0x4323, 0x6807, 0x0117, 0x6827, 0x0002, 0x1078, 0x45c5, 0x6827,
1648 0x0036, 0x6932, 0x2d00, 0x682e, 0x0d7e, 0x1078, 0x3a92, 0x1078,
1649 0x4466, 0x2b68, 0x1078, 0x3ac2, 0x0d7f, 0x1078, 0x3ac2, 0x2001,
1650 0x0002, 0x007c, 0x1078, 0x4466, 0x2001, 0x0017, 0x1078, 0x454c,
1651 0x70a3, 0x0000, 0x2009, 0x5038, 0x200b, 0x0006, 0x70af, 0x0017,
1652 0x2009, 0x0200, 0x1078, 0x39d2, 0x2001, 0x0001, 0x007c, 0x2200,
1653 0x0079, 0x4352, 0x440c, 0x443d, 0x443d, 0x443d, 0x4373, 0x444d,
1654 0x4379, 0x444d, 0x444d, 0x4450, 0x4450, 0x4455, 0x4455, 0x436b,
1655 0x436b, 0x443d, 0x443d, 0x444d, 0x443d, 0x4379, 0x440c, 0x4379,
1656 0x4379, 0x4379, 0x4379, 0x6827, 0x0084, 0x2009, 0x000b, 0x2001,
1657 0x4300, 0x0078, 0x445f, 0x2009, 0x000b, 0x2001, 0x4300, 0x0078,
1658 0x4440, 0x6827, 0x0093, 0x2009, 0x000b, 0x2001, 0x4300, 0x0078,
1659 0x4428, 0x2001, 0x0000, 0x007c, 0x2200, 0x0079, 0x4387, 0x440c,
1660 0x43a0, 0x43a0, 0x43a0, 0x43a0, 0x444d, 0x444d, 0x444d, 0x444d,
1661 0x444d, 0x444d, 0x444d, 0x444d, 0x43a0, 0x43a0, 0x43a0, 0x43a0,
1662 0x444d, 0x43a0, 0x43a0, 0x444d, 0x444d, 0x444d, 0x444d, 0x440c,
1663 0x6827, 0x0093, 0x2009, 0x000b, 0x2001, 0x4300, 0x0078, 0x4428,
1664 0xa684, 0x0004, 0x00c0, 0x43bc, 0x6804, 0xa084, 0x00ff, 0xa086,
1665 0x0006, 0x00c0, 0x4536, 0x1078, 0x4466, 0x6807, 0x0117, 0x1078,
1666 0x3ac2, 0x2001, 0x0002, 0x007c, 0x6000, 0xa084, 0x0004, 0x0040,
1667 0x4536, 0x2d58, 0x6804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
1668 0x43cb, 0x6807, 0x0117, 0x6827, 0x0002, 0x1078, 0x45c5, 0x6827,
1669 0x0036, 0x6932, 0x2d00, 0x682e, 0x0d7e, 0x1078, 0x3aa1, 0x1078,
1670 0x4466, 0x2b68, 0x1078, 0x3ac2, 0x0d7f, 0x1078, 0x3ac2, 0x2001,
1671 0x0002, 0x007c, 0x6000, 0xa084, 0x0004, 0x0040, 0x4536, 0x2d58,
1672 0x6a04, 0xa294, 0x00ff, 0xa286, 0x0006, 0x00c0, 0x43f1, 0x6807,
1673 0x0117, 0x6827, 0x0002, 0x2d58, 0x1078, 0x45c5, 0x6827, 0x0036,
1674 0x6932, 0x2d00, 0x682e, 0x0d7e, 0x1078, 0x3ab1, 0x1078, 0x4466,
1675 0x2b68, 0x1078, 0x3ac2, 0x0d7f, 0x1078, 0x3ac2, 0x2001, 0x0002,
1676 0x007c, 0x1078, 0x4536, 0x007c, 0x70b4, 0xa080, 0x00cd, 0x781a,
1677 0x2001, 0x0001, 0x1078, 0x454c, 0x1078, 0x45bc, 0x7003, 0x0000,
1678 0x2001, 0x0002, 0x007c, 0x1078, 0x457e, 0x1078, 0x45b5, 0x1078,
1679 0x426f, 0x1078, 0x4180, 0x1078, 0x45bc, 0x2001, 0x0001, 0x007c,
1680 0x1078, 0x457e, 0x1078, 0x45b5, 0x1078, 0x426f, 0x70b4, 0xa080,
1681 0x00cd, 0x781a, 0x2001, 0x0013, 0x1078, 0x454c, 0x1078, 0x45bc,
1682 0x7003, 0x0000, 0x2001, 0x0002, 0x007c, 0x1078, 0x4536, 0x007c,
1683 0x1078, 0x457e, 0x1078, 0x45b5, 0x1078, 0x426f, 0x1078, 0x4180,
1684 0x1078, 0x45bc, 0x2001, 0x0001, 0x007c, 0x2001, 0x0003, 0x007c,
1685 0x1078, 0x44d1, 0x2001, 0x0000, 0x007c, 0x0c7e, 0x077e, 0x6f14,
1686 0x1078, 0x36b0, 0x077f, 0x0c7f, 0x2001, 0x0000, 0x007c, 0x1078,
1687 0x457e, 0x1078, 0x4536, 0x2001, 0x0006, 0x007c, 0x6904, 0xa18c,
1688 0x00ff, 0xa186, 0x0007, 0x0040, 0x4471, 0xa186, 0x000f, 0x00c0,
1689 0x4475, 0x1078, 0x45b5, 0x1078, 0x426f, 0x70b4, 0xa080, 0x00cd,
1690 0x781a, 0x1078, 0x45bc, 0x7003, 0x0000, 0x007c, 0x7aa8, 0xa294,
1691 0x00ff, 0x78a8, 0xa084, 0x00ff, 0xa08a, 0x0004, 0x00c8, 0x4536,
1692 0x1079, 0x448b, 0x007c, 0x4536, 0x448f, 0x4536, 0x44df, 0xa282,
1693 0x0003, 0x0040, 0x4496, 0x1078, 0x4536, 0x007c, 0x7da8, 0xa5ac,
1694 0x00ff, 0x7ca8, 0xa4a4, 0x00ff, 0xa482, 0x000c, 0x0048, 0x44a4,
1695 0x0040, 0x44a4, 0x2021, 0x000c, 0x701c, 0xa502, 0x00c8, 0x44a9,
1696 0x751c, 0x1078, 0x451c, 0x852b, 0x852b, 0x1078, 0x372e, 0x0040,
1697 0x44b5, 0x1078, 0x44c3, 0x0078, 0x44b9, 0x1078, 0x4518, 0x1078,
1698 0x44d1, 0xa6b5, 0x1000, 0x7e5a, 0x70b4, 0xa080, 0x00b9, 0x781a,
1699 0x2001, 0x0004, 0x007c, 0x0c7e, 0x6914, 0x810f, 0xa18c, 0x000f,
1700 0x810b, 0x810b, 0x810b, 0xa1e0, 0x5280, 0x1078, 0x3538, 0x0c7f,
1701 0x007c, 0x0c7e, 0x6814, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003,
1702 0x8003, 0xa0e0, 0x5280, 0x1078, 0x355f, 0x0c7f, 0x007c, 0xa282,
1703 0x0002, 0x00c0, 0x4536, 0x7aa8, 0xa294, 0x00ff, 0xa284, 0xfffe,
1704 0x0040, 0x44ec, 0x2011, 0x0001, 0x1078, 0x450a, 0x1078, 0x44fc,
1705 0x1078, 0x44d1, 0xa6b5, 0x1000, 0x7e5a, 0x70b4, 0xa080, 0x00b9,
1706 0x781a, 0x2001, 0x0004, 0x007c, 0x0c7e, 0x6814, 0x8007, 0xa084,
1707 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e0, 0x5280, 0x1078, 0x3604,
1708 0x0c7f, 0x007c, 0x789b, 0x0018, 0x78ab, 0x0001, 0x78ab, 0x0002,
1709 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0081, 0x78ab, 0x0004, 0x007c,
1710 0x2021, 0x0000, 0x2029, 0x0032, 0x789b, 0x0018, 0x78ab, 0x0001,
1711 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa, 0x7caa, 0x789b, 0x0081,
1712 0x78ab, 0x0005, 0x007c, 0x2001, 0x0003, 0x1078, 0x4544, 0x70b4,
1713 0xa080, 0x00b9, 0x781a, 0x2001, 0x0005, 0x007c, 0x2001, 0x0007,
1714 0x1078, 0x4544, 0xa6b5, 0x1000, 0x7e5a, 0x70b4, 0xa080, 0x00b9,
1715 0x781a, 0x2001, 0x0004, 0x007c, 0x789b, 0x0018, 0x78aa, 0x789b,
1716 0x0081, 0x78ab, 0x0001, 0x007c, 0x6904, 0xa18c, 0x00ff, 0xa196,
1717 0x0007, 0x0040, 0x455a, 0xa196, 0x000f, 0x0040, 0x455a, 0x1078,
1718 0x193d, 0x007c, 0x6924, 0xa194, 0x003f, 0x00c0, 0x4563, 0xa18c,
1719 0xffc0, 0xa105, 0x6826, 0x1078, 0x3ac2, 0x691c, 0xa184, 0x0100,
1720 0x0040, 0x4572, 0x1078, 0x1b7e, 0x6914, 0x1078, 0x3b33, 0x6204,
1721 0x8210, 0x6206, 0x007c, 0x692c, 0x6834, 0x682e, 0xa112, 0x6930,
1722 0x6838, 0x6832, 0xa11b, 0xa200, 0xa301, 0x007c, 0x0c7e, 0xade0,
1723 0x0018, 0x6003, 0x0070, 0x6106, 0x600b, 0x0000, 0x600f, 0x0a00,
1724 0x6013, 0x0000, 0x6017, 0x0000, 0x8007, 0x601a, 0x601f, 0x0000,
1725 0x6023, 0x0000, 0x0c7f, 0x6824, 0xa085, 0x0080, 0x6826, 0x007c,
1726 0x157e, 0x137e, 0x147e, 0x2098, 0xaf80, 0x002d, 0x20a0, 0x81ac,
1727 0x0040, 0x45a3, 0x53a6, 0xa184, 0x0001, 0x0040, 0x45a9, 0x3304,
1728 0x78be, 0x147f, 0x137f, 0x157f, 0x007c, 0x70b0, 0xa005, 0x10c0,
1729 0x23ca, 0x70b3, 0x8000, 0x0078, 0x48f7, 0x71b0, 0x81ff, 0x0040,
1730 0x45bb, 0x1078, 0x49ed, 0x007c, 0x71b0, 0x81ff, 0x0040, 0x45c4,
1731 0x70b3, 0x0000, 0x1078, 0x4633, 0x007c, 0x0c7e, 0x0d7e, 0x1078,
1732 0x191a, 0x0c7f, 0x157e, 0x137e, 0x147e, 0x2da0, 0x2c98, 0x20a9,
1733 0x0031, 0x53a3, 0x147f, 0x137f, 0x157f, 0x6807, 0x010d, 0x680b,
1734 0x0000, 0x7004, 0x8007, 0x681a, 0x6823, 0x0000, 0x681f, 0x0000,
1735 0x689f, 0x0000, 0x0c7f, 0x007c, 0x70b4, 0xa080, 0x0091, 0x781a,
1736 0x0078, 0x2438, 0x70b4, 0xa080, 0x0081, 0x781a, 0x0078, 0x2438,
1737 0x70b4, 0xa080, 0x00b9, 0x781a, 0x0078, 0x2438, 0x70b4, 0xa080,
1738 0x00c3, 0x781a, 0x0078, 0x2438, 0x6904, 0xa18c, 0x00ff, 0xa196,
1739 0x0007, 0x0040, 0x4609, 0xa196, 0x000f, 0x0040, 0x4609, 0x6807,
1740 0x0117, 0x2001, 0x0200, 0x6826, 0x8007, 0x789b, 0x000e, 0x78aa,
1741 0x6820, 0xa085, 0x8000, 0x6822, 0x2031, 0x0400, 0x6eb6, 0x7e5a,
1742 0x71b4, 0xa188, 0x0091, 0x791a, 0x007c, 0x1078, 0x45bc, 0x7848,
1743 0xa085, 0x000c, 0x784a, 0x70b4, 0xa080, 0x00cd, 0x781a, 0x2009,
1744 0x000b, 0x2001, 0x4400, 0x1078, 0x457e, 0x2001, 0x0013, 0x1078,
1745 0x454c, 0x0078, 0x3b60, 0x127e, 0x2091, 0x2200, 0x2049, 0x4633,
1746 0x7000, 0x7204, 0xa205, 0x720c, 0xa215, 0x7008, 0xa084, 0xfff7,
1747 0xa205, 0x0040, 0x4645, 0x0078, 0x464a, 0x7003, 0x0000, 0x127f,
1748 0x2000, 0x007c, 0x7000, 0xa084, 0x0001, 0x00c0, 0x4678, 0x7108,
1749 0x8103, 0x00c8, 0x4657, 0x1078, 0x477a, 0x0078, 0x464f, 0x700c,
1750 0xa08c, 0x00ff, 0x0040, 0x4678, 0x7004, 0x8004, 0x00c8, 0x466f,
1751 0x7014, 0xa005, 0x00c0, 0x466b, 0x7010, 0xa005, 0x0040, 0x466f,
1752 0xa102, 0x00c8, 0x464f, 0x7007, 0x0010, 0x0078, 0x4678, 0x8aff,
1753 0x0040, 0x4678, 0x1078, 0x49c4, 0x00c0, 0x4672, 0x0040, 0x464f,
1754 0x1078, 0x4703, 0x7003, 0x0000, 0x127f, 0x2000, 0x007c, 0x017e,
1755 0x6104, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x468b, 0xa18e,
1756 0x000f, 0x00c0, 0x468e, 0x6040, 0x0078, 0x468f, 0x6428, 0x017f,
1757 0x84ff, 0x0040, 0x46b9, 0x2c70, 0x7004, 0xa0bc, 0x000f, 0xa7b8,
1758 0x46c9, 0x273c, 0x87fb, 0x00c0, 0x46a7, 0x0048, 0x46a1, 0x1078,
1759 0x23ca, 0x609c, 0xa075, 0x0040, 0x46b9, 0x0078, 0x4694, 0x2704,
1760 0xae68, 0x6808, 0xa630, 0x680c, 0xa529, 0x8421, 0x0040, 0x46b9,
1761 0x8738, 0x2704, 0xa005, 0x00c0, 0x46a8, 0x709c, 0xa075, 0x00c0,
1762 0x4694, 0x007c, 0x0000, 0x0005, 0x0009, 0x000d, 0x0011, 0x0015,
1763 0x0019, 0x001d, 0x0000, 0x0003, 0x0009, 0x000f, 0x0015, 0x001b,
1764 0x0000, 0x0000, 0x46be, 0x46bb, 0x0000, 0x0000, 0x8000, 0x0000,
1765 0x46be, 0x0000, 0x46c6, 0x46c3, 0x0000, 0x0000, 0x0000, 0x0000,
1766 0x46c6, 0x0000, 0x46c1, 0x46c1, 0x0000, 0x0000, 0x8000, 0x0000,
1767 0x46c1, 0x0000, 0x46c7, 0x46c7, 0x0000, 0x0000, 0x0000, 0x0000,
1768 0x46c7, 0x127e, 0x2091, 0x2200, 0x2079, 0x5000, 0x2071, 0x0010,
1769 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, 0x0000, 0x2071, 0x0020,
1770 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, 0x0000, 0x2049, 0x0000,
1771 0x127f, 0x2000, 0x007c, 0x2049, 0x4703, 0x2019, 0x0000, 0x7004,
1772 0x8004, 0x00c8, 0x4756, 0x7007, 0x0012, 0x7108, 0x7008, 0xa106,
1773 0x00c0, 0x470d, 0xa184, 0x01e0, 0x0040, 0x4718, 0x1078, 0x23ca,
1774 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x00c8, 0x4723, 0xa184,
1775 0x4000, 0x00c0, 0x470d, 0xa19c, 0x300c, 0xa386, 0x2004, 0x0040,
1776 0x4731, 0xa386, 0x0008, 0x0040, 0x473c, 0xa386, 0x200c, 0x00c0,
1777 0x470d, 0x7200, 0x8204, 0x0048, 0x473c, 0x730c, 0xa384, 0x00ff,
1778 0x0040, 0x473c, 0x1078, 0x23ca, 0x7007, 0x0012, 0x7000, 0xa084,
1779 0x0001, 0x00c0, 0x4756, 0x7008, 0xa084, 0x01e0, 0x00c0, 0x4756,
1780 0x7310, 0x7014, 0xa305, 0x0040, 0x4756, 0x710c, 0xa184, 0x0300,
1781 0x00c0, 0x4756, 0xa184, 0x00ff, 0x00c0, 0x4703, 0x7007, 0x0012,
1782 0x7007, 0x0008, 0x7004, 0xa084, 0x0008, 0x00c0, 0x475a, 0x7007,
1783 0x0012, 0x7108, 0x8103, 0x0048, 0x475f, 0x7003, 0x0000, 0x2049,
1784 0x0000, 0x007c, 0x107e, 0x007e, 0x127e, 0x157e, 0x2091, 0x2200,
1785 0x7108, 0x1078, 0x477a, 0x157f, 0x127f, 0x2091, 0x8001, 0x007f,
1786 0x107f, 0x007c, 0x7204, 0x7500, 0x730c, 0xa384, 0x0300, 0x00c0,
1787 0x47a1, 0xa184, 0x01e0, 0x00c0, 0x47c5, 0x7108, 0xa184, 0x01e0,
1788 0x00c0, 0x47c5, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x00c8,
1789 0x4795, 0xa184, 0x4000, 0x00c0, 0x4785, 0xa184, 0x0007, 0x0079,
1790 0x4799, 0x47a3, 0x47b5, 0x47a1, 0x47b5, 0x47a1, 0x4801, 0x47a1,
1791 0x47ff, 0x1078, 0x23ca, 0x7004, 0xa084, 0x0010, 0xa085, 0x0002,
1792 0x7006, 0x8aff, 0x00c0, 0x47b0, 0x2049, 0x0000, 0x0078, 0x47b4,
1793 0x1078, 0x49c4, 0x00c0, 0x47b0, 0x007c, 0x7004, 0xa084, 0x0010,
1794 0xa085, 0x0002, 0x7006, 0x8aff, 0x00c0, 0x47c0, 0x0078, 0x47c4,
1795 0x1078, 0x49c4, 0x00c0, 0x47c0, 0x007c, 0x7007, 0x0012, 0x7108,
1796 0x00e0, 0x47c8, 0x2091, 0x6000, 0x00e0, 0x47cc, 0x2091, 0x6000,
1797 0x7007, 0x0012, 0x7007, 0x0008, 0x7004, 0xa084, 0x0008, 0x00c0,
1798 0x47d4, 0x7007, 0x0012, 0x7108, 0x8103, 0x0048, 0x47d9, 0x7003,
1799 0x0000, 0x7000, 0xa005, 0x00c0, 0x47ed, 0x7004, 0xa005, 0x00c0,
1800 0x47ed, 0x700c, 0xa005, 0x0040, 0x47ef, 0x0078, 0x47d0, 0x2049,
1801 0x0000, 0x1078, 0x37d7, 0x6818, 0xa084, 0x8000, 0x0040, 0x47fa,
1802 0x681b, 0x0002, 0x007c, 0x1078, 0x23ca, 0x1078, 0x23ca, 0x1078,
1803 0x485d, 0x7210, 0x7114, 0x700c, 0xa09c, 0x00ff, 0x2800, 0xa300,
1804 0xa211, 0xa189, 0x0000, 0x1078, 0x485d, 0x2704, 0x2c58, 0xac60,
1805 0x6308, 0x2200, 0xa322, 0x630c, 0x2100, 0xa31b, 0x2400, 0xa305,
1806 0x0040, 0x4824, 0x00c8, 0x4824, 0x8412, 0x8210, 0x830a, 0xa189,
1807 0x0000, 0x2b60, 0x0078, 0x480b, 0x2b60, 0x8a07, 0x007e, 0x6004,
1808 0xa084, 0x0008, 0x0040, 0x4830, 0xa7ba, 0x46c3, 0x0078, 0x4832,
1809 0xa7ba, 0x46bb, 0x007f, 0xa73d, 0x2c00, 0x6886, 0x6f8a, 0x6c92,
1810 0x6b8e, 0x7007, 0x0012, 0x1078, 0x4703, 0x007c, 0x8738, 0x2704,
1811 0xa005, 0x00c0, 0x4851, 0x609c, 0xa005, 0x0040, 0x485a, 0x2060,
1812 0x6004, 0xa084, 0x000f, 0xa080, 0x46c9, 0x203c, 0x87fb, 0x1040,
1813 0x23ca, 0x8a51, 0x0040, 0x4859, 0x7008, 0xa084, 0x0003, 0xa086,
1814 0x0003, 0x007c, 0x2051, 0x0000, 0x007c, 0x8a50, 0x8739, 0x2704,
1815 0xa004, 0x00c0, 0x4871, 0x6000, 0xa064, 0x00c0, 0x4868, 0x2d60,
1816 0x6004, 0xa084, 0x000f, 0xa080, 0x46d9, 0x203c, 0x87fb, 0x1040,
1817 0x23ca, 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x6884,
1818 0x2060, 0x6888, 0x6b8c, 0x6c90, 0x8057, 0xaad4, 0x00ff, 0xa084,
1819 0x00ff, 0x007e, 0x6804, 0xa084, 0x0008, 0x007f, 0x0040, 0x488c,
1820 0xa0b8, 0x46c3, 0x0078, 0x488e, 0xa0b8, 0x46bb, 0x7e08, 0xa6b5,
1821 0x000c, 0x6904, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x489c,
1822 0xa18e, 0x000f, 0x00c0, 0x48a5, 0x681c, 0xa084, 0x0040, 0x0040,
1823 0x48ac, 0xa6b5, 0x0001, 0x0078, 0x48ac, 0x681c, 0xa084, 0x0040,
1824 0x0040, 0x48ac, 0xa6b5, 0x0001, 0x7007, 0x0004, 0x7004, 0xa084,
1825 0x0004, 0x00c0, 0x48ae, 0x2400, 0xa305, 0x00c0, 0x48b9, 0x0078,
1826 0x48df, 0x2c58, 0x2704, 0x6104, 0xac60, 0x6000, 0xa400, 0x701a,
1827 0x6004, 0xa301, 0x701e, 0xa184, 0x0008, 0x0040, 0x48cf, 0x6010,
1828 0xa081, 0x0000, 0x7022, 0x6014, 0xa081, 0x0000, 0x7026, 0x6208,
1829 0x2400, 0xa202, 0x7012, 0x620c, 0x2300, 0xa203, 0x7016, 0x7602,
1830 0x7007, 0x0001, 0x2b60, 0x1078, 0x483e, 0x0078, 0x48e1, 0x1078,
1831 0x49c4, 0x00c0, 0x48df, 0x127f, 0x2000, 0x007c, 0x127e, 0x0d7e,
1832 0x2091, 0x2200, 0x0d7f, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004,
1833 0x00c0, 0x48ed, 0x7003, 0x0008, 0x127f, 0x2000, 0x007c, 0x127e,
1834 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x2049, 0x48f7, 0x7007, 0x0004,
1835 0x7004, 0xa084, 0x0004, 0x00c0, 0x4900, 0x7e08, 0xa6b5, 0x000c,
1836 0x6904, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x4913, 0xa18e,
1837 0x000f, 0x00c0, 0x491e, 0x681c, 0xa084, 0x0040, 0x0040, 0x491a,
1838 0xa6b5, 0x0001, 0x6840, 0x2050, 0x0078, 0x4927, 0x681c, 0xa084,
1839 0x0020, 0x00c0, 0x4925, 0xa6b5, 0x0001, 0x6828, 0x2050, 0x2d60,
1840 0x6004, 0xa0bc, 0x000f, 0xa7b8, 0x46c9, 0x273c, 0x87fb, 0x00c0,
1841 0x493b, 0x0048, 0x4935, 0x1078, 0x23ca, 0x689c, 0xa065, 0x0040,
1842 0x493f, 0x0078, 0x4928, 0x1078, 0x49c4, 0x00c0, 0x493b, 0x127f,
1843 0x2000, 0x007c, 0x127e, 0x007e, 0x017e, 0x0d7e, 0x2091, 0x2200,
1844 0x0d7f, 0x037f, 0x047f, 0x7e08, 0xa6b5, 0x000c, 0x6904, 0xa18c,
1845 0x00ff, 0xa186, 0x0007, 0x0040, 0x4959, 0xa18e, 0x000f, 0x00c0,
1846 0x4962, 0x681c, 0xa084, 0x0040, 0x0040, 0x4969, 0xa6b5, 0x0001,
1847 0x0078, 0x4969, 0x681c, 0xa084, 0x0040, 0x0040, 0x4969, 0xa6b5,
1848 0x0001, 0x2049, 0x4942, 0x017e, 0x6904, 0xa18c, 0x00ff, 0xa186,
1849 0x0007, 0x0040, 0x4977, 0xa18e, 0x000f, 0x00c0, 0x497a, 0x6840,
1850 0x0078, 0x497b, 0x6828, 0x017f, 0xa055, 0x0040, 0x49c1, 0x2d70,
1851 0x2e60, 0x7004, 0xa0bc, 0x000f, 0xa7b8, 0x46c9, 0x273c, 0x87fb,
1852 0x00c0, 0x4995, 0x0048, 0x498e, 0x1078, 0x23ca, 0x709c, 0xa075,
1853 0x2060, 0x0040, 0x49c1, 0x0078, 0x4981, 0x2704, 0xae68, 0x6808,
1854 0xa422, 0x680c, 0xa31b, 0x0048, 0x49ae, 0x8a51, 0x00c0, 0x49a2,
1855 0x1078, 0x23ca, 0x8738, 0x2704, 0xa005, 0x00c0, 0x4996, 0x709c,
1856 0xa075, 0x2060, 0x0040, 0x49c1, 0x0078, 0x4981, 0x8422, 0x8420,
1857 0x831a, 0xa399, 0x0000, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300,
1858 0xa11b, 0x00c8, 0x49bd, 0x1078, 0x23ca, 0x2071, 0x0020, 0x0078,
1859 0x48ac, 0x127f, 0x2000, 0x007c, 0x7008, 0xa084, 0x0003, 0xa086,
1860 0x0003, 0x0040, 0x49ec, 0x2704, 0xac08, 0x2104, 0x701a, 0x8108,
1861 0x2104, 0x701e, 0x8108, 0x2104, 0x7012, 0x8108, 0x2104, 0x7016,
1862 0x6004, 0xa084, 0x0008, 0x0040, 0x49e3, 0x8108, 0x2104, 0x7022,
1863 0x8108, 0x2104, 0x7026, 0x7602, 0x7004, 0xa084, 0x0010, 0xa085,
1864 0x0001, 0x7006, 0x1078, 0x483e, 0x007c, 0x127e, 0x007e, 0x0d7e,
1865 0x2091, 0x2200, 0x2049, 0x49ed, 0x0d7f, 0x087f, 0x7108, 0xa184,
1866 0x0003, 0x00c0, 0x4a17, 0x017e, 0x6904, 0xa18c, 0x00ff, 0xa186,
1867 0x0007, 0x0040, 0x4a07, 0xa18e, 0x000f, 0x00c0, 0x4a0a, 0x6840,
1868 0x0078, 0x4a0b, 0x6828, 0x017f, 0xa005, 0x0040, 0x4a25, 0x0078,
1869 0x464a, 0x0020, 0x4a17, 0x1078, 0x4801, 0x0078, 0x4a25, 0x00a0,
1870 0x4a1e, 0x7108, 0x1078, 0x477a, 0x0078, 0x49f6, 0x7007, 0x0010,
1871 0x00a0, 0x4a20, 0x7108, 0x1078, 0x477a, 0x7008, 0xa086, 0x0008,
1872 0x00c0, 0x49f6, 0x7000, 0xa005, 0x00c0, 0x49f6, 0x7003, 0x0000,
1873 0x2049, 0x0000, 0x127f, 0x2000, 0x007c, 0x127e, 0x147e, 0x137e,
1874 0x157e, 0x0c7e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x2049, 0x4a35,
1875 0xad80, 0x0011, 0x20a0, 0x2099, 0x0031, 0x700c, 0xa084, 0x00ff,
1876 0x682a, 0x7007, 0x0008, 0x7007, 0x0002, 0x7003, 0x0001, 0x0040,
1877 0x4a54, 0x8000, 0x80ac, 0x53a5, 0x7007, 0x0004, 0x7004, 0xa084,
1878 0x0004, 0x00c0, 0x4a56, 0x0c7f, 0x2049, 0x0000, 0x7003, 0x0000,
1879 0x157f, 0x137f, 0x147f, 0x127f, 0x2000, 0x007c, 0x2091, 0x6000,
1880 0x2091, 0x8000, 0x78cc, 0xa005, 0x0040, 0x4a7d, 0x7994, 0x70d0,
1881 0xa106, 0x00c0, 0x4a7d, 0x7804, 0xa005, 0x0040, 0x4a7d, 0x7807,
1882 0x0000, 0x0068, 0x4a7d, 0x2091, 0x4080, 0x7820, 0x8001, 0x7822,
1883 0x00c0, 0x4ad8, 0x7824, 0x7822, 0x2069, 0x5040, 0x6800, 0xa084,
1884 0x0007, 0x0040, 0x4a9b, 0xa086, 0x0002, 0x0040, 0x4a9b, 0x6834,
1885 0xa00d, 0x0040, 0x4a9b, 0x2104, 0xa005, 0x0040, 0x4a9b, 0x8001,
1886 0x200a, 0x0040, 0x4b80, 0x7848, 0xa005, 0x0040, 0x4aa9, 0x8001,
1887 0x784a, 0x00c0, 0x4aa9, 0x2009, 0x0102, 0x6844, 0x200a, 0x1078,
1888 0x21b1, 0x6890, 0xa005, 0x0040, 0x4ab5, 0x8001, 0x6892, 0x00c0,
1889 0x4ab5, 0x686f, 0x0000, 0x6873, 0x0001, 0x2061, 0x5300, 0x20a9,
1890 0x0100, 0x2009, 0x0002, 0x6034, 0xa005, 0x0040, 0x4acb, 0x8001,
1891 0x6036, 0x00c0, 0x4acb, 0x6010, 0xa005, 0x0040, 0x4acb, 0x017e,
1892 0x1078, 0x21b1, 0x017f, 0xace0, 0x0010, 0x0070, 0x4ad1, 0x0078,
1893 0x4abb, 0x8109, 0x0040, 0x4ad8, 0x20a9, 0x0100, 0x0078, 0x4abb,
1894 0x1078, 0x4ae5, 0x1078, 0x4b0a, 0x2009, 0x5051, 0x2104, 0x2009,
1895 0x0102, 0x200a, 0x2091, 0x8001, 0x007c, 0x7834, 0x8001, 0x7836,
1896 0x00c0, 0x4b09, 0x7838, 0x7836, 0x2091, 0x8000, 0x7844, 0xa005,
1897 0x00c0, 0x4af4, 0x2001, 0x0101, 0x8001, 0x7846, 0xa080, 0x7300,
1898 0x2040, 0x2004, 0xa065, 0x0040, 0x4b09, 0x6024, 0xa005, 0x0040,
1899 0x4b05, 0x8001, 0x6026, 0x0040, 0x4b39, 0x6000, 0x2c40, 0x0078,
1900 0x4afa, 0x007c, 0x7828, 0x8001, 0x782a, 0x00c0, 0x4b38, 0x782c,
1901 0x782a, 0x7830, 0xa005, 0x00c0, 0x4b17, 0x2001, 0x0200, 0x8001,
1902 0x7832, 0x8003, 0x8003, 0x8003, 0x8003, 0xa090, 0x5300, 0xa298,
1903 0x0002, 0x2304, 0xa084, 0x0008, 0x0040, 0x4b38, 0xa290, 0x0009,
1904 0x2204, 0xa005, 0x0040, 0x4b30, 0x8001, 0x2012, 0x00c0, 0x4b38,
1905 0x2304, 0xa084, 0xfff7, 0xa085, 0x0080, 0x201a, 0x1078, 0x21b1,
1906 0x007c, 0x2069, 0x5040, 0x6800, 0xa005, 0x0040, 0x4b43, 0x6848,
1907 0xac06, 0x0040, 0x4b80, 0x601b, 0x0006, 0x60b4, 0xa084, 0x3f00,
1908 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085, 0x0060, 0x6022, 0x6000,
1909 0x2042, 0x6714, 0x6f82, 0x1078, 0x1956, 0x6818, 0xa005, 0x0040,
1910 0x4b5b, 0x8001, 0x681a, 0x6808, 0xa084, 0xffef, 0x680a, 0x6810,
1911 0x8001, 0x00d0, 0x4b65, 0x1078, 0x23ca, 0x6812, 0x602f, 0x0000,
1912 0x6033, 0x0000, 0x2c68, 0x1078, 0x1c53, 0x2069, 0x5040, 0x7944,
1913 0xa184, 0x0100, 0x2001, 0x0006, 0x686e, 0x00c0, 0x4b7b, 0x6986,
1914 0x2001, 0x0004, 0x686e, 0x1078, 0x21ac, 0x2091, 0x8001, 0x007c,
1915 0x2069, 0x0100, 0x2009, 0x5040, 0x2104, 0xa084, 0x0007, 0x0040,
1916 0x4bdc, 0xa086, 0x0007, 0x00c0, 0x4b96, 0x0d7e, 0x2009, 0x5052,
1917 0x216c, 0x1078, 0x3a1a, 0x0d7f, 0x0078, 0x4bdc, 0x2009, 0x5052,
1918 0x2164, 0x1078, 0x2375, 0x601b, 0x0006, 0x6858, 0xa084, 0x3f00,
1919 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085, 0x0048, 0x6022, 0x602f,
1920 0x0000, 0x6033, 0x0000, 0x6830, 0xa084, 0x0040, 0x0040, 0x4bd0,
1921 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0004, 0x0040,
1922 0x4bbd, 0x0070, 0x4bbd, 0x0078, 0x4bb4, 0x684b, 0x0009, 0x20a9,
1923 0x0014, 0x6848, 0xa084, 0x0001, 0x0040, 0x4bca, 0x0070, 0x4bca,
1924 0x0078, 0x4bc1, 0x20a9, 0x00fa, 0x0070, 0x4bd0, 0x0078, 0x4bcc,
1925 0x6808, 0xa084, 0xfffd, 0x680a, 0x681b, 0x0048, 0x2009, 0x505b,
1926 0x200b, 0x0007, 0x784c, 0x784a, 0x2091, 0x8001, 0x007c, 0x2079,
1927 0x5000, 0x1078, 0x4c0a, 0x1078, 0x4bee, 0x1078, 0x4bfc, 0x7833,
1928 0x0000, 0x7847, 0x0000, 0x784b, 0x0000, 0x007c, 0x2019, 0x0003,
1929 0x2011, 0x5046, 0x2204, 0xa086, 0x003c, 0x0040, 0x4bf9, 0x2019,
1930 0x0002, 0x7b2a, 0x7b2e, 0x007c, 0x2019, 0x0039, 0x2011, 0x5046,
1931 0x2204, 0xa086, 0x003c, 0x0040, 0x4c07, 0x2019, 0x0027, 0x7b36,
1932 0x7b3a, 0x007c, 0x2019, 0x3971, 0x2011, 0x5046, 0x2204, 0xa086,
1933 0x003c, 0x0040, 0x4c15, 0x2019, 0x2626, 0x7b22, 0x7b26, 0x783f,
1934 0x0000, 0x7843, 0x000a, 0x007c, 0x0020, 0x002b, 0x0000, 0x0020,
1935 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1936 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1937 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1938 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0014,
1939 0x0014, 0x9849, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014,
1940 0x0014, 0x0080, 0x000f, 0x0000, 0x0201, 0x0604, 0x0c08, 0x2120,
1941 0x4022, 0xf880, 0x0018, 0x300b, 0xa201, 0x0014, 0xa200, 0x0014,
1942 0xa200, 0x0214, 0x0000, 0x006c, 0x0002, 0x0014, 0x98d5, 0x009e,
1943 0x009b, 0xa202, 0x8838, 0x3806, 0x8839, 0x20c3, 0x0864, 0x9889,
1944 0x28c1, 0x9cb6, 0xa203, 0x300c, 0x2846, 0x8161, 0x846a, 0x8300,
1945 0x1856, 0x883a, 0x9865, 0x28f2, 0x9c95, 0x9858, 0x300c, 0x28e1,
1946 0x9c95, 0x2809, 0xa206, 0x64c0, 0x67a0, 0x6fc0, 0x1814, 0x883b,
1947 0x782c, 0x786d, 0x9879, 0x282b, 0xa207, 0x64a0, 0x67a0, 0x6fc0,
1948 0x1814, 0x883b, 0x7822, 0x883e, 0x987d, 0x8576, 0x8677, 0x206b,
1949 0x28c1, 0x9cb6, 0x2044, 0x2103, 0x20a2, 0x2081, 0x9865, 0xa209,
1950 0x2901, 0x9891, 0x0014, 0xa205, 0xa300, 0x1872, 0x879a, 0x883c,
1951 0x1fe2, 0xc601, 0xa20a, 0x856e, 0x0704, 0x9c95, 0x0014, 0xa204,
1952 0xa300, 0x3009, 0x19e2, 0xf868, 0x8176, 0x86eb, 0x85eb, 0x872e,
1953 0x87a9, 0x883f, 0x08e6, 0x9895, 0xf881, 0x9890, 0xc801, 0x0014,
1954 0xf8c1, 0x0016, 0x85b2, 0x80f0, 0x9532, 0xfb02, 0x1de2, 0x0014,
1955 0x8532, 0xf241, 0x0014, 0x1de2, 0x84a8, 0xd7a0, 0x1fe6, 0x0014,
1956 0xa208, 0x6043, 0x8008, 0x1dc1, 0x0016, 0x8300, 0x8160, 0x842a,
1957 0xf041, 0x3008, 0x84a8, 0x11d6, 0x7042, 0x20dd, 0x0011, 0x20d5,
1958 0x8822, 0x0016, 0x8000, 0x2847, 0x1011, 0x98c8, 0x8000, 0xa000,
1959 0x2802, 0x1011, 0x98ce, 0x9865, 0x283e, 0x1011, 0x98d2, 0xa20b,
1960 0x0017, 0x300c, 0xa300, 0x1de2, 0xdb81, 0x0014, 0x0210, 0x98df,
1961 0x0014, 0x26e0, 0x873a, 0xfb02, 0x19f2, 0x1fe2, 0x0014, 0xa20d,
1962 0x3806, 0x0210, 0x9cbb, 0x0704, 0x0000, 0x006c, 0x0002, 0x984f,
1963 0x0014, 0x009e, 0x00a0, 0x0017, 0x60ff, 0x300c, 0x8720, 0xa211,
1964 0x9cd0, 0x8772, 0x8837, 0x2101, 0x987a, 0x10d2, 0x78e2, 0x9cd3,
1965 0x9859, 0xd984, 0xf0e2, 0xf0a1, 0x98cd, 0x0014, 0x8831, 0xd166,
1966 0x8830, 0x800f, 0x9401, 0xb520, 0xc802, 0x8820, 0x987a, 0x2301,
1967 0x987a, 0x10d2, 0x78e4, 0x9cd3, 0x8821, 0x8820, 0x9859, 0xf123,
1968 0xf142, 0xf101, 0x98c6, 0x10d2, 0x70f6, 0x8832, 0x8203, 0x870c,
1969 0xd99e, 0x6001, 0x0014, 0x6845, 0x0214, 0xa21b, 0x9cd0, 0x2001,
1970 0x98c5, 0x8201, 0x1852, 0xd184, 0xd163, 0x8834, 0x8001, 0x988d,
1971 0x3027, 0x84a8, 0x1a56, 0x8833, 0x0014, 0xa218, 0x6981, 0x9cbc,
1972 0x6b2a, 0x6902, 0x1834, 0x989d, 0x1814, 0x8010, 0x8592, 0x8026,
1973 0x84b9, 0x7021, 0x0014, 0xa300, 0x69e1, 0x9ca9, 0x694b, 0xa213,
1974 0x1462, 0xa213, 0x8000, 0x16e1, 0x98b5, 0x8023, 0x16e1, 0x8001,
1975 0x10f1, 0x0016, 0x6969, 0xa214, 0x61c2, 0x8002, 0x14e1, 0x8004,
1976 0x16e1, 0x0101, 0x300a, 0x8827, 0x0014, 0xa217, 0x9cbc, 0x0014,
1977 0xa300, 0x8181, 0x842a, 0x84a8, 0x1ce6, 0x882c, 0x0016, 0xa212,
1978 0x9cd0, 0x10d2, 0x70e4, 0x0004, 0x8007, 0x9424, 0xcc1a, 0x9cd3,
1979 0x98c5, 0x8827, 0x300a, 0x0013, 0x8000, 0x84a4, 0x0016, 0x11c2,
1980 0x211e, 0x870e, 0xa21d, 0x0014, 0x878e, 0x0016, 0xa21c, 0x1035,
1981 0x9891, 0xa210, 0xa000, 0x8010, 0x8592, 0x853b, 0xd044, 0x8022,
1982 0x3807, 0x84bb, 0x98ea, 0x8021, 0x3807, 0x84b9, 0x300c, 0x817e,
1983 0x872b, 0x8772, 0x9891, 0x0000, 0x0020, 0x002b, 0x0000, 0x0020,
1984 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1985 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1986 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1987 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0014,
1988 0x0014, 0x9849, 0x0014, 0x0014, 0x98ea, 0x98d5, 0x0014, 0x0014,
1989 0x0014, 0x0080, 0x013f, 0x0000, 0x0201, 0x0604, 0x0c08, 0x2120,
1990 0x4022, 0xf880, 0x0018, 0x300b, 0xa201, 0x0014, 0xa200, 0x0014,
1991 0xa200, 0x0214, 0xa202, 0x8838, 0x3806, 0x8839, 0x20c3, 0x0864,
1992 0xa833, 0x28c1, 0x9cb6, 0xa203, 0x300c, 0x2846, 0x8161, 0x846a,
1993 0x8300, 0x1856, 0x883a, 0xa804, 0x28f2, 0x9c95, 0xa8f4, 0x300c,
1994 0x28e1, 0x9c95, 0x2809, 0xa206, 0x64c0, 0x67a0, 0x6fc0, 0x1814,
1995 0x883b, 0x782c, 0x786d, 0xa808, 0x282b, 0xa207, 0x64a0, 0x67a0,
1996 0x6fc0, 0x1814, 0x883b, 0x7822, 0x883e, 0xa802, 0x8576, 0x8677,
1997 0x206b, 0x28c1, 0x9cb6, 0x2044, 0x2103, 0x20a2, 0x2081, 0xa8e0,
1998 0xa209, 0x2901, 0xa809, 0x0014, 0xa205, 0xa300, 0x1872, 0x879a,
1999 0x883c, 0x1fe2, 0xc601, 0xa20a, 0x856e, 0x0704, 0x9c95, 0x0014,
2000 0xa204, 0xa300, 0x3009, 0x19e2, 0xf868, 0x8176, 0x86eb, 0x85eb,
2001 0x872e, 0x87a9, 0x883f, 0x08e6, 0xa8f3, 0xf881, 0xa8ec, 0xc801,
2002 0x0014, 0xf8c1, 0x0016, 0x85b2, 0x80f0, 0x9532, 0xfb02, 0x1de2,
2003 0x0014, 0x8532, 0xf241, 0x0014, 0x1de2, 0x84a8, 0xd7a0, 0x1fe6,
2004 0x0014, 0xa208, 0x6043, 0x8008, 0x1dc1, 0x0016, 0x8300, 0x8160,
2005 0x842a, 0xf041, 0x3008, 0x84a8, 0x11d6, 0x7042, 0x20dd, 0x0011,
2006 0x20d5, 0x8822, 0x0016, 0x8000, 0x2847, 0x1011, 0xa8fc, 0x8000,
2007 0xa000, 0x2802, 0x1011, 0xa8fd, 0xa893, 0x283e, 0x1011, 0xa8fd,
2008 0xa20b, 0x0017, 0x300c, 0xa300, 0x1de2, 0xdb81, 0x0014, 0x0210,
2009 0xa801, 0x0014, 0x26e0, 0x873a, 0xfb02, 0x19f2, 0x1fe2, 0x0014,
2010 0xa20d, 0x3806, 0x0210, 0x9cbb, 0x0704, 0x0017, 0x60ff, 0x300c,
2011 0x8720, 0xa211, 0x9d6b, 0x8772, 0x8837, 0x2101, 0xa821, 0x10d2,
2012 0x78e2, 0x9d6e, 0xa8fc, 0xd984, 0xf0e2, 0xf0a1, 0xa86c, 0x0014,
2013 0x8831, 0xd166, 0x8830, 0x800f, 0x9401, 0xb520, 0xc802, 0x8820,
2014 0xa80f, 0x2301, 0xa80d, 0x10d2, 0x78e4, 0x9d6e, 0x8821, 0x8820,
2015 0xa8e6, 0xf123, 0xf142, 0xf101, 0xa84f, 0x10d2, 0x70f6, 0x8832,
2016 0x8203, 0x870c, 0xd99e, 0x6001, 0x0014, 0x6845, 0x0214, 0xa21b,
2017 0x9d6b, 0x2001, 0xa840, 0x8201, 0x1852, 0xd184, 0xd163, 0x8834,
2018 0x8001, 0xa801, 0x3027, 0x84a8, 0x1a56, 0x8833, 0x0014, 0xa218,
2019 0x6981, 0x9d57, 0x6b2a, 0x6902, 0x1834, 0xa805, 0x1814, 0x8010,
2020 0x8592, 0x8026, 0x84b9, 0x7021, 0x0014, 0xa300, 0x69e1, 0x9d44,
2021 0x694b, 0xa213, 0x1462, 0xa213, 0x8000, 0x16e1, 0xa80c, 0x8023,
2022 0x16e1, 0x8001, 0x10f1, 0x0016, 0x6969, 0xa214, 0x61c2, 0x8002,
2023 0x14e1, 0x8004, 0x16e1, 0x0101, 0x300a, 0x8827, 0x0014, 0xa217,
2024 0x9d57, 0x0014, 0xa300, 0x8181, 0x842a, 0x84a8, 0x1ce6, 0x882c,
2025 0x0016, 0xa212, 0x9d6b, 0x10d2, 0x70e4, 0x0004, 0x8007, 0x9424,
2026 0xcc1a, 0x9d6e, 0xa8f8, 0x8827, 0x300a, 0x0013, 0x8000, 0x84a4,
2027 0x0016, 0x11c2, 0x211e, 0x870e, 0xa21d, 0x0014, 0x878e, 0x0016,
2028 0xa21c, 0x1035, 0xa8b4, 0xa210, 0x3807, 0x300c, 0x817e, 0x872b,
2029 0x8772, 0xa8ad, 0x0000, 0x8ec6
2030};
2031
2032#endif /* RELOAD_FIRMWARE */
2033
2034static const unsigned short risc_code_length01 = 0x3f14;
diff --git a/drivers/scsi/raid_class.c b/drivers/scsi/raid_class.c
index caa0c3629626..5b1c12041a4f 100644
--- a/drivers/scsi/raid_class.c
+++ b/drivers/scsi/raid_class.c
@@ -1,5 +1,13 @@
1/* 1/*
2 * RAID Attributes 2 * raid_class.c - implementation of a simple raid visualisation class
3 *
4 * Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com>
5 *
6 * This file is licensed under GPLv2
7 *
8 * This class is designed to allow raid attributes to be visualised and
9 * manipulated in a form independent of the underlying raid. Ultimately this
10 * should work for both hardware and software raids.
3 */ 11 */
4#include <linux/init.h> 12#include <linux/init.h>
5#include <linux/module.h> 13#include <linux/module.h>
@@ -24,7 +32,7 @@ struct raid_internal {
24 32
25struct raid_component { 33struct raid_component {
26 struct list_head node; 34 struct list_head node;
27 struct device *dev; 35 struct class_device cdev;
28 int num; 36 int num;
29}; 37};
30 38
@@ -74,11 +82,10 @@ static int raid_setup(struct transport_container *tc, struct device *dev,
74 82
75 BUG_ON(class_get_devdata(cdev)); 83 BUG_ON(class_get_devdata(cdev));
76 84
77 rd = kmalloc(sizeof(*rd), GFP_KERNEL); 85 rd = kzalloc(sizeof(*rd), GFP_KERNEL);
78 if (!rd) 86 if (!rd)
79 return -ENOMEM; 87 return -ENOMEM;
80 88
81 memset(rd, 0, sizeof(*rd));
82 INIT_LIST_HEAD(&rd->component_list); 89 INIT_LIST_HEAD(&rd->component_list);
83 class_set_devdata(cdev, rd); 90 class_set_devdata(cdev, rd);
84 91
@@ -90,15 +97,15 @@ static int raid_remove(struct transport_container *tc, struct device *dev,
90{ 97{
91 struct raid_data *rd = class_get_devdata(cdev); 98 struct raid_data *rd = class_get_devdata(cdev);
92 struct raid_component *rc, *next; 99 struct raid_component *rc, *next;
100 dev_printk(KERN_ERR, dev, "RAID REMOVE\n");
93 class_set_devdata(cdev, NULL); 101 class_set_devdata(cdev, NULL);
94 list_for_each_entry_safe(rc, next, &rd->component_list, node) { 102 list_for_each_entry_safe(rc, next, &rd->component_list, node) {
95 char buf[40];
96 snprintf(buf, sizeof(buf), "component-%d", rc->num);
97 list_del(&rc->node); 103 list_del(&rc->node);
98 sysfs_remove_link(&cdev->kobj, buf); 104 dev_printk(KERN_ERR, rc->cdev.dev, "RAID COMPONENT REMOVE\n");
99 kfree(rc); 105 class_device_unregister(&rc->cdev);
100 } 106 }
101 kfree(class_get_devdata(cdev)); 107 dev_printk(KERN_ERR, dev, "RAID REMOVE DONE\n");
108 kfree(rd);
102 return 0; 109 return 0;
103} 110}
104 111
@@ -112,10 +119,11 @@ static struct {
112 enum raid_state value; 119 enum raid_state value;
113 char *name; 120 char *name;
114} raid_states[] = { 121} raid_states[] = {
115 { RAID_ACTIVE, "active" }, 122 { RAID_STATE_UNKNOWN, "unknown" },
116 { RAID_DEGRADED, "degraded" }, 123 { RAID_STATE_ACTIVE, "active" },
117 { RAID_RESYNCING, "resyncing" }, 124 { RAID_STATE_DEGRADED, "degraded" },
118 { RAID_OFFLINE, "offline" }, 125 { RAID_STATE_RESYNCING, "resyncing" },
126 { RAID_STATE_OFFLINE, "offline" },
119}; 127};
120 128
121static const char *raid_state_name(enum raid_state state) 129static const char *raid_state_name(enum raid_state state)
@@ -132,6 +140,33 @@ static const char *raid_state_name(enum raid_state state)
132 return name; 140 return name;
133} 141}
134 142
143static struct {
144 enum raid_level value;
145 char *name;
146} raid_levels[] = {
147 { RAID_LEVEL_UNKNOWN, "unknown" },
148 { RAID_LEVEL_LINEAR, "linear" },
149 { RAID_LEVEL_0, "raid0" },
150 { RAID_LEVEL_1, "raid1" },
151 { RAID_LEVEL_3, "raid3" },
152 { RAID_LEVEL_4, "raid4" },
153 { RAID_LEVEL_5, "raid5" },
154 { RAID_LEVEL_6, "raid6" },
155};
156
157static const char *raid_level_name(enum raid_level level)
158{
159 int i;
160 char *name = NULL;
161
162 for (i = 0; i < sizeof(raid_levels)/sizeof(raid_levels[0]); i++) {
163 if (raid_levels[i].value == level) {
164 name = raid_levels[i].name;
165 break;
166 }
167 }
168 return name;
169}
135 170
136#define raid_attr_show_internal(attr, fmt, var, code) \ 171#define raid_attr_show_internal(attr, fmt, var, code) \
137static ssize_t raid_show_##attr(struct class_device *cdev, char *buf) \ 172static ssize_t raid_show_##attr(struct class_device *cdev, char *buf) \
@@ -161,11 +196,22 @@ static CLASS_DEVICE_ATTR(attr, S_IRUGO, raid_show_##attr, NULL)
161 196
162#define raid_attr_ro(attr) raid_attr_ro_internal(attr, ) 197#define raid_attr_ro(attr) raid_attr_ro_internal(attr, )
163#define raid_attr_ro_fn(attr) raid_attr_ro_internal(attr, ATTR_CODE(attr)) 198#define raid_attr_ro_fn(attr) raid_attr_ro_internal(attr, ATTR_CODE(attr))
164#define raid_attr_ro_state(attr) raid_attr_ro_states(attr, attr, ATTR_CODE(attr)) 199#define raid_attr_ro_state(attr) raid_attr_ro_states(attr, attr, )
200#define raid_attr_ro_state_fn(attr) raid_attr_ro_states(attr, attr, ATTR_CODE(attr))
201
165 202
166raid_attr_ro(level); 203raid_attr_ro_state(level);
167raid_attr_ro_fn(resync); 204raid_attr_ro_fn(resync);
168raid_attr_ro_state(state); 205raid_attr_ro_state_fn(state);
206
207static void raid_component_release(struct class_device *cdev)
208{
209 struct raid_component *rc = container_of(cdev, struct raid_component,
210 cdev);
211 dev_printk(KERN_ERR, rc->cdev.dev, "COMPONENT RELEASE\n");
212 put_device(rc->cdev.dev);
213 kfree(rc);
214}
169 215
170void raid_component_add(struct raid_template *r,struct device *raid_dev, 216void raid_component_add(struct raid_template *r,struct device *raid_dev,
171 struct device *component_dev) 217 struct device *component_dev)
@@ -175,34 +221,36 @@ void raid_component_add(struct raid_template *r,struct device *raid_dev,
175 raid_dev); 221 raid_dev);
176 struct raid_component *rc; 222 struct raid_component *rc;
177 struct raid_data *rd = class_get_devdata(cdev); 223 struct raid_data *rd = class_get_devdata(cdev);
178 char buf[40];
179 224
180 rc = kmalloc(sizeof(*rc), GFP_KERNEL); 225 rc = kzalloc(sizeof(*rc), GFP_KERNEL);
181 if (!rc) 226 if (!rc)
182 return; 227 return;
183 228
184 INIT_LIST_HEAD(&rc->node); 229 INIT_LIST_HEAD(&rc->node);
185 rc->dev = component_dev; 230 class_device_initialize(&rc->cdev);
231 rc->cdev.release = raid_component_release;
232 rc->cdev.dev = get_device(component_dev);
186 rc->num = rd->component_count++; 233 rc->num = rd->component_count++;
187 234
188 snprintf(buf, sizeof(buf), "component-%d", rc->num); 235 snprintf(rc->cdev.class_id, sizeof(rc->cdev.class_id),
236 "component-%d", rc->num);
189 list_add_tail(&rc->node, &rd->component_list); 237 list_add_tail(&rc->node, &rd->component_list);
190 sysfs_create_link(&cdev->kobj, &component_dev->kobj, buf); 238 rc->cdev.parent = cdev;
239 rc->cdev.class = &raid_class.class;
240 class_device_add(&rc->cdev);
191} 241}
192EXPORT_SYMBOL(raid_component_add); 242EXPORT_SYMBOL(raid_component_add);
193 243
194struct raid_template * 244struct raid_template *
195raid_class_attach(struct raid_function_template *ft) 245raid_class_attach(struct raid_function_template *ft)
196{ 246{
197 struct raid_internal *i = kmalloc(sizeof(struct raid_internal), 247 struct raid_internal *i = kzalloc(sizeof(struct raid_internal),
198 GFP_KERNEL); 248 GFP_KERNEL);
199 int count = 0; 249 int count = 0;
200 250
201 if (unlikely(!i)) 251 if (unlikely(!i))
202 return NULL; 252 return NULL;
203 253
204 memset(i, 0, sizeof(*i));
205
206 i->f = ft; 254 i->f = ft;
207 255
208 i->r.raid_attrs.ac.class = &raid_class.class; 256 i->r.raid_attrs.ac.class = &raid_class.class;
diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c
index 93d55233af7b..257c128f4aaa 100644
--- a/drivers/scsi/sata_mv.c
+++ b/drivers/scsi/sata_mv.c
@@ -349,7 +349,7 @@ static struct ata_port_info mv_port_info[] = {
349 }, 349 },
350}; 350};
351 351
352static struct pci_device_id mv_pci_tbl[] = { 352static const struct pci_device_id mv_pci_tbl[] = {
353 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5040), 0, 0, chip_504x}, 353 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5040), 0, 0, chip_504x},
354 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5041), 0, 0, chip_504x}, 354 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5041), 0, 0, chip_504x},
355 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5080), 0, 0, chip_508x}, 355 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5080), 0, 0, chip_508x},
@@ -359,6 +359,8 @@ static struct pci_device_id mv_pci_tbl[] = {
359 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6041), 0, 0, chip_604x}, 359 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6041), 0, 0, chip_604x},
360 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6080), 0, 0, chip_608x}, 360 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6080), 0, 0, chip_608x},
361 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6081), 0, 0, chip_608x}, 361 {PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6081), 0, 0, chip_608x},
362
363 {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x0241), 0, 0, chip_604x},
362 {} /* terminate list */ 364 {} /* terminate list */
363}; 365};
364 366
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c
index 37a4fae95ed4..4954896dfdb9 100644
--- a/drivers/scsi/sata_nv.c
+++ b/drivers/scsi/sata_nv.c
@@ -137,7 +137,7 @@ enum nv_host_type
137 CK804 137 CK804
138}; 138};
139 139
140static struct pci_device_id nv_pci_tbl[] = { 140static const struct pci_device_id nv_pci_tbl[] = {
141 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, 141 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA,
142 PCI_ANY_ID, PCI_ANY_ID, 0, 0, NFORCE2 }, 142 PCI_ANY_ID, PCI_ANY_ID, 0, 0, NFORCE2 },
143 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, 143 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA,
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c
index 9edc9d91efc3..242d906987ad 100644
--- a/drivers/scsi/sata_promise.c
+++ b/drivers/scsi/sata_promise.c
@@ -193,7 +193,7 @@ static struct ata_port_info pdc_port_info[] = {
193 }, 193 },
194}; 194};
195 195
196static struct pci_device_id pdc_ata_pci_tbl[] = { 196static const struct pci_device_id pdc_ata_pci_tbl[] = {
197 { PCI_VENDOR_ID_PROMISE, 0x3371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 197 { PCI_VENDOR_ID_PROMISE, 0x3371, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
198 board_2037x }, 198 board_2037x },
199 { PCI_VENDOR_ID_PROMISE, 0x3570, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 199 { PCI_VENDOR_ID_PROMISE, 0x3570, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
diff --git a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c
index d274ab235781..4a6d3067d23c 100644
--- a/drivers/scsi/sata_qstor.c
+++ b/drivers/scsi/sata_qstor.c
@@ -184,7 +184,7 @@ static struct ata_port_info qs_port_info[] = {
184 }, 184 },
185}; 185};
186 186
187static struct pci_device_id qs_ata_pci_tbl[] = { 187static const struct pci_device_id qs_ata_pci_tbl[] = {
188 { PCI_VENDOR_ID_PDC, 0x2068, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 188 { PCI_VENDOR_ID_PDC, 0x2068, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
189 board_2068_idx }, 189 board_2068_idx },
190 190
@@ -268,7 +268,7 @@ static void qs_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
268 writel(val, (void __iomem *)(ap->ioaddr.scr_addr + (sc_reg * 8))); 268 writel(val, (void __iomem *)(ap->ioaddr.scr_addr + (sc_reg * 8)));
269} 269}
270 270
271static void qs_fill_sg(struct ata_queued_cmd *qc) 271static unsigned int qs_fill_sg(struct ata_queued_cmd *qc)
272{ 272{
273 struct scatterlist *sg; 273 struct scatterlist *sg;
274 struct ata_port *ap = qc->ap; 274 struct ata_port *ap = qc->ap;
@@ -296,6 +296,8 @@ static void qs_fill_sg(struct ata_queued_cmd *qc)
296 (unsigned long long)addr, len); 296 (unsigned long long)addr, len);
297 nelem++; 297 nelem++;
298 } 298 }
299
300 return nelem;
299} 301}
300 302
301static void qs_qc_prep(struct ata_queued_cmd *qc) 303static void qs_qc_prep(struct ata_queued_cmd *qc)
@@ -304,6 +306,7 @@ static void qs_qc_prep(struct ata_queued_cmd *qc)
304 u8 dflags = QS_DF_PORD, *buf = pp->pkt; 306 u8 dflags = QS_DF_PORD, *buf = pp->pkt;
305 u8 hflags = QS_HF_DAT | QS_HF_IEN | QS_HF_VLD; 307 u8 hflags = QS_HF_DAT | QS_HF_IEN | QS_HF_VLD;
306 u64 addr; 308 u64 addr;
309 unsigned int nelem;
307 310
308 VPRINTK("ENTER\n"); 311 VPRINTK("ENTER\n");
309 312
@@ -313,7 +316,7 @@ static void qs_qc_prep(struct ata_queued_cmd *qc)
313 return; 316 return;
314 } 317 }
315 318
316 qs_fill_sg(qc); 319 nelem = qs_fill_sg(qc);
317 320
318 if ((qc->tf.flags & ATA_TFLAG_WRITE)) 321 if ((qc->tf.flags & ATA_TFLAG_WRITE))
319 hflags |= QS_HF_DIRO; 322 hflags |= QS_HF_DIRO;
@@ -324,7 +327,7 @@ static void qs_qc_prep(struct ata_queued_cmd *qc)
324 buf[ 0] = QS_HCB_HDR; 327 buf[ 0] = QS_HCB_HDR;
325 buf[ 1] = hflags; 328 buf[ 1] = hflags;
326 *(__le32 *)(&buf[ 4]) = cpu_to_le32(qc->nsect * ATA_SECT_SIZE); 329 *(__le32 *)(&buf[ 4]) = cpu_to_le32(qc->nsect * ATA_SECT_SIZE);
327 *(__le32 *)(&buf[ 8]) = cpu_to_le32(qc->n_elem); 330 *(__le32 *)(&buf[ 8]) = cpu_to_le32(nelem);
328 addr = ((u64)pp->pkt_dma) + QS_CPB_BYTES; 331 addr = ((u64)pp->pkt_dma) + QS_CPB_BYTES;
329 *(__le64 *)(&buf[16]) = cpu_to_le64(addr); 332 *(__le64 *)(&buf[16]) = cpu_to_le64(addr);
330 333
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c
index d0e3c3c6c25f..36091868560d 100644
--- a/drivers/scsi/sata_sil.c
+++ b/drivers/scsi/sata_sil.c
@@ -87,7 +87,7 @@ static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
87static void sil_post_set_mode (struct ata_port *ap); 87static void sil_post_set_mode (struct ata_port *ap);
88 88
89 89
90static struct pci_device_id sil_pci_tbl[] = { 90static const struct pci_device_id sil_pci_tbl[] = {
91 { 0x1095, 0x3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w }, 91 { 0x1095, 0x3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w },
92 { 0x1095, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w }, 92 { 0x1095, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w },
93 { 0x1095, 0x3512, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 }, 93 { 0x1095, 0x3512, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index 4682a50650b4..d3198d9a72c1 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -240,7 +240,7 @@ static void sil24_port_stop(struct ata_port *ap);
240static void sil24_host_stop(struct ata_host_set *host_set); 240static void sil24_host_stop(struct ata_host_set *host_set);
241static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); 241static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
242 242
243static struct pci_device_id sil24_pci_tbl[] = { 243static const struct pci_device_id sil24_pci_tbl[] = {
244 { 0x1095, 0x3124, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3124 }, 244 { 0x1095, 0x3124, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3124 },
245 { 0x1095, 0x3132, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3132 }, 245 { 0x1095, 0x3132, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3132 },
246 { 0x1095, 0x3131, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3131 }, 246 { 0x1095, 0x3131, PCI_ANY_ID, PCI_ANY_ID, 0, 0, BID_SIL3131 },
diff --git a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c
index 42d7c4e92501..32e12620b162 100644
--- a/drivers/scsi/sata_sis.c
+++ b/drivers/scsi/sata_sis.c
@@ -67,7 +67,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
67static u32 sis_scr_read (struct ata_port *ap, unsigned int sc_reg); 67static u32 sis_scr_read (struct ata_port *ap, unsigned int sc_reg);
68static void sis_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); 68static void sis_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
69 69
70static struct pci_device_id sis_pci_tbl[] = { 70static const struct pci_device_id sis_pci_tbl[] = {
71 { PCI_VENDOR_ID_SI, 0x180, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 }, 71 { PCI_VENDOR_ID_SI, 0x180, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 },
72 { PCI_VENDOR_ID_SI, 0x181, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 }, 72 { PCI_VENDOR_ID_SI, 0x181, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 },
73 { PCI_VENDOR_ID_SI, 0x182, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 }, 73 { PCI_VENDOR_ID_SI, 0x182, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sis_180 },
diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c
index 9895d1caefcf..57e5a9d964c3 100644
--- a/drivers/scsi/sata_svw.c
+++ b/drivers/scsi/sata_svw.c
@@ -466,7 +466,7 @@ err_out:
466 * 0x24a is device ID for BCM5785 (aka HT1000) HT southbridge integrated SATA 466 * 0x24a is device ID for BCM5785 (aka HT1000) HT southbridge integrated SATA
467 * controller 467 * controller
468 * */ 468 * */
469static struct pci_device_id k2_sata_pci_tbl[] = { 469static const struct pci_device_id k2_sata_pci_tbl[] = {
470 { 0x1166, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, 470 { 0x1166, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
471 { 0x1166, 0x0241, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, 471 { 0x1166, 0x0241, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
472 { 0x1166, 0x0242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8 }, 472 { 0x1166, 0x0242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8 },
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c
index d5a38784352b..b4bbe48acab0 100644
--- a/drivers/scsi/sata_sx4.c
+++ b/drivers/scsi/sata_sx4.c
@@ -229,7 +229,7 @@ static struct ata_port_info pdc_port_info[] = {
229 229
230}; 230};
231 231
232static struct pci_device_id pdc_sata_pci_tbl[] = { 232static const struct pci_device_id pdc_sata_pci_tbl[] = {
233 { PCI_VENDOR_ID_PROMISE, 0x6622, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 233 { PCI_VENDOR_ID_PROMISE, 0x6622, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
234 board_20621 }, 234 board_20621 },
235 { } /* terminate list */ 235 { } /* terminate list */
diff --git a/drivers/scsi/sata_uli.c b/drivers/scsi/sata_uli.c
index cf0baaa4e045..b2422a0f25c8 100644
--- a/drivers/scsi/sata_uli.c
+++ b/drivers/scsi/sata_uli.c
@@ -55,7 +55,7 @@ static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
55static u32 uli_scr_read (struct ata_port *ap, unsigned int sc_reg); 55static u32 uli_scr_read (struct ata_port *ap, unsigned int sc_reg);
56static void uli_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); 56static void uli_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
57 57
58static struct pci_device_id uli_pci_tbl[] = { 58static const struct pci_device_id uli_pci_tbl[] = {
59 { PCI_VENDOR_ID_AL, 0x5289, PCI_ANY_ID, PCI_ANY_ID, 0, 0, uli_5289 }, 59 { PCI_VENDOR_ID_AL, 0x5289, PCI_ANY_ID, PCI_ANY_ID, 0, 0, uli_5289 },
60 { PCI_VENDOR_ID_AL, 0x5287, PCI_ANY_ID, PCI_ANY_ID, 0, 0, uli_5287 }, 60 { PCI_VENDOR_ID_AL, 0x5287, PCI_ANY_ID, PCI_ANY_ID, 0, 0, uli_5287 },
61 { PCI_VENDOR_ID_AL, 0x5281, PCI_ANY_ID, PCI_ANY_ID, 0, 0, uli_5281 }, 61 { PCI_VENDOR_ID_AL, 0x5281, PCI_ANY_ID, PCI_ANY_ID, 0, 0, uli_5281 },
diff --git a/drivers/scsi/sata_via.c b/drivers/scsi/sata_via.c
index ab19d2ba2a4b..c76215692da2 100644
--- a/drivers/scsi/sata_via.c
+++ b/drivers/scsi/sata_via.c
@@ -75,7 +75,7 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
75static u32 svia_scr_read (struct ata_port *ap, unsigned int sc_reg); 75static u32 svia_scr_read (struct ata_port *ap, unsigned int sc_reg);
76static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); 76static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
77 77
78static struct pci_device_id svia_pci_tbl[] = { 78static const struct pci_device_id svia_pci_tbl[] = {
79 { 0x1106, 0x3149, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6420 }, 79 { 0x1106, 0x3149, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6420 },
80 { 0x1106, 0x3249, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6421 }, 80 { 0x1106, 0x3249, PCI_ANY_ID, PCI_ANY_ID, 0, 0, vt6421 },
81 81
diff --git a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c
index ce8a2fd7da84..77a6e4b9262d 100644
--- a/drivers/scsi/sata_vsc.c
+++ b/drivers/scsi/sata_vsc.c
@@ -400,7 +400,7 @@ err_out:
400 * 0x8086/0x3200 is the Intel 31244, which is supposed to be identical 400 * 0x8086/0x3200 is the Intel 31244, which is supposed to be identical
401 * compatibility is untested as of yet 401 * compatibility is untested as of yet
402 */ 402 */
403static struct pci_device_id vsc_sata_pci_tbl[] = { 403static const struct pci_device_id vsc_sata_pci_tbl[] = {
404 { 0x1725, 0x7174, PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 }, 404 { 0x1725, 0x7174, PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 },
405 { 0x8086, 0x3200, PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 }, 405 { 0x8086, 0x3200, PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 },
406 { } 406 { }
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index b61fb1295b8b..3ded9daaf4a0 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -178,7 +178,7 @@ struct sdebug_queued_cmd {
178}; 178};
179static struct sdebug_queued_cmd queued_arr[SCSI_DEBUG_CANQUEUE]; 179static struct sdebug_queued_cmd queued_arr[SCSI_DEBUG_CANQUEUE];
180 180
181static Scsi_Host_Template sdebug_driver_template = { 181static struct scsi_host_template sdebug_driver_template = {
182 .proc_info = scsi_debug_proc_info, 182 .proc_info = scsi_debug_proc_info,
183 .name = "SCSI DEBUG", 183 .name = "SCSI DEBUG",
184 .info = scsi_debug_info, 184 .info = scsi_debug_info,
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 0c5b02d4c7f8..18c5d2523014 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -417,43 +417,15 @@ static int scsi_eh_completed_normally(struct scsi_cmnd *scmd)
417} 417}
418 418
419/** 419/**
420 * scsi_eh_times_out - timeout function for error handling.
421 * @scmd: Cmd that is timing out.
422 *
423 * Notes:
424 * During error handling, the kernel thread will be sleeping waiting
425 * for some action to complete on the device. our only job is to
426 * record that it timed out, and to wake up the thread.
427 **/
428static void scsi_eh_times_out(struct scsi_cmnd *scmd)
429{
430 scmd->eh_eflags |= SCSI_EH_REC_TIMEOUT;
431 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd:%p\n", __FUNCTION__,
432 scmd));
433
434 up(scmd->device->host->eh_action);
435}
436
437/**
438 * scsi_eh_done - Completion function for error handling. 420 * scsi_eh_done - Completion function for error handling.
439 * @scmd: Cmd that is done. 421 * @scmd: Cmd that is done.
440 **/ 422 **/
441static void scsi_eh_done(struct scsi_cmnd *scmd) 423static void scsi_eh_done(struct scsi_cmnd *scmd)
442{ 424{
443 /* 425 SCSI_LOG_ERROR_RECOVERY(3,
444 * if the timeout handler is already running, then just set the 426 printk("%s scmd: %p result: %x\n",
445 * flag which says we finished late, and return. we have no 427 __FUNCTION__, scmd, scmd->result));
446 * way of stopping the timeout handler from running, so we must 428 complete(scmd->device->host->eh_action);
447 * always defer to it.
448 */
449 if (del_timer(&scmd->eh_timeout)) {
450 scmd->request->rq_status = RQ_SCSI_DONE;
451
452 SCSI_LOG_ERROR_RECOVERY(3, printk("%s scmd: %p result: %x\n",
453 __FUNCTION__, scmd, scmd->result));
454
455 up(scmd->device->host->eh_action);
456 }
457} 429}
458 430
459/** 431/**
@@ -461,10 +433,6 @@ static void scsi_eh_done(struct scsi_cmnd *scmd)
461 * @scmd: SCSI Cmd to send. 433 * @scmd: SCSI Cmd to send.
462 * @timeout: Timeout for cmd. 434 * @timeout: Timeout for cmd.
463 * 435 *
464 * Notes:
465 * The initialization of the structures is quite a bit different in
466 * this case, and furthermore, there is a different completion handler
467 * vs scsi_dispatch_cmd.
468 * Return value: 436 * Return value:
469 * SUCCESS or FAILED or NEEDS_RETRY 437 * SUCCESS or FAILED or NEEDS_RETRY
470 **/ 438 **/
@@ -472,24 +440,16 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
472{ 440{
473 struct scsi_device *sdev = scmd->device; 441 struct scsi_device *sdev = scmd->device;
474 struct Scsi_Host *shost = sdev->host; 442 struct Scsi_Host *shost = sdev->host;
475 DECLARE_MUTEX_LOCKED(sem); 443 DECLARE_COMPLETION(done);
444 unsigned long timeleft;
476 unsigned long flags; 445 unsigned long flags;
477 int rtn = SUCCESS; 446 int rtn;
478 447
479 /*
480 * we will use a queued command if possible, otherwise we will
481 * emulate the queuing and calling of completion function ourselves.
482 */
483 if (sdev->scsi_level <= SCSI_2) 448 if (sdev->scsi_level <= SCSI_2)
484 scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) | 449 scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) |
485 (sdev->lun << 5 & 0xe0); 450 (sdev->lun << 5 & 0xe0);
486 451
487 scsi_add_timer(scmd, timeout, scsi_eh_times_out); 452 shost->eh_action = &done;
488
489 /*
490 * set up the semaphore so we wait for the command to complete.
491 */
492 shost->eh_action = &sem;
493 scmd->request->rq_status = RQ_SCSI_BUSY; 453 scmd->request->rq_status = RQ_SCSI_BUSY;
494 454
495 spin_lock_irqsave(shost->host_lock, flags); 455 spin_lock_irqsave(shost->host_lock, flags);
@@ -497,47 +457,29 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
497 shost->hostt->queuecommand(scmd, scsi_eh_done); 457 shost->hostt->queuecommand(scmd, scsi_eh_done);
498 spin_unlock_irqrestore(shost->host_lock, flags); 458 spin_unlock_irqrestore(shost->host_lock, flags);
499 459
500 down(&sem); 460 timeleft = wait_for_completion_timeout(&done, timeout);
501 scsi_log_completion(scmd, SUCCESS);
502 461
462 scmd->request->rq_status = RQ_SCSI_DONE;
503 shost->eh_action = NULL; 463 shost->eh_action = NULL;
504 464
505 /* 465 scsi_log_completion(scmd, SUCCESS);
506 * see if timeout. if so, tell the host to forget about it.
507 * in other words, we don't want a callback any more.
508 */
509 if (scmd->eh_eflags & SCSI_EH_REC_TIMEOUT) {
510 scmd->eh_eflags &= ~SCSI_EH_REC_TIMEOUT;
511
512 /*
513 * as far as the low level driver is
514 * concerned, this command is still active, so
515 * we must give the low level driver a chance
516 * to abort it. (db)
517 *
518 * FIXME(eric) - we are not tracking whether we could
519 * abort a timed out command or not. not sure how
520 * we should treat them differently anyways.
521 */
522 if (shost->hostt->eh_abort_handler)
523 shost->hostt->eh_abort_handler(scmd);
524
525 scmd->request->rq_status = RQ_SCSI_DONE;
526 rtn = FAILED;
527 }
528 466
529 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd: %p, rtn:%x\n", 467 SCSI_LOG_ERROR_RECOVERY(3,
530 __FUNCTION__, scmd, rtn)); 468 printk("%s: scmd: %p, timeleft: %ld\n",
469 __FUNCTION__, scmd, timeleft));
531 470
532 /* 471 /*
533 * now examine the actual status codes to see whether the command 472 * If there is time left scsi_eh_done got called, and we will
534 * actually did complete normally. 473 * examine the actual status codes to see whether the command
474 * actually did complete normally, else tell the host to forget
475 * about this command.
535 */ 476 */
536 if (rtn == SUCCESS) { 477 if (timeleft) {
537 rtn = scsi_eh_completed_normally(scmd); 478 rtn = scsi_eh_completed_normally(scmd);
538 SCSI_LOG_ERROR_RECOVERY(3, 479 SCSI_LOG_ERROR_RECOVERY(3,
539 printk("%s: scsi_eh_completed_normally %x\n", 480 printk("%s: scsi_eh_completed_normally %x\n",
540 __FUNCTION__, rtn)); 481 __FUNCTION__, rtn));
482
541 switch (rtn) { 483 switch (rtn) {
542 case SUCCESS: 484 case SUCCESS:
543 case NEEDS_RETRY: 485 case NEEDS_RETRY:
@@ -547,6 +489,15 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
547 rtn = FAILED; 489 rtn = FAILED;
548 break; 490 break;
549 } 491 }
492 } else {
493 /*
494 * FIXME(eric) - we are not tracking whether we could
495 * abort a timed out command or not. not sure how
496 * we should treat them differently anyways.
497 */
498 if (shost->hostt->eh_abort_handler)
499 shost->hostt->eh_abort_handler(scmd);
500 rtn = FAILED;
550 } 501 }
551 502
552 return rtn; 503 return rtn;
@@ -1571,50 +1522,41 @@ static void scsi_unjam_host(struct Scsi_Host *shost)
1571} 1522}
1572 1523
1573/** 1524/**
1574 * scsi_error_handler - Handle errors/timeouts of SCSI cmds. 1525 * scsi_error_handler - SCSI error handler thread
1575 * @data: Host for which we are running. 1526 * @data: Host for which we are running.
1576 * 1527 *
1577 * Notes: 1528 * Notes:
1578 * This is always run in the context of a kernel thread. The idea is 1529 * This is the main error handling loop. This is run as a kernel thread
1579 * that we start this thing up when the kernel starts up (one per host 1530 * for every SCSI host and handles all error handling activity.
1580 * that we detect), and it immediately goes to sleep and waits for some
1581 * event (i.e. failure). When this takes place, we have the job of
1582 * trying to unjam the bus and restarting things.
1583 **/ 1531 **/
1584int scsi_error_handler(void *data) 1532int scsi_error_handler(void *data)
1585{ 1533{
1586 struct Scsi_Host *shost = (struct Scsi_Host *) data; 1534 struct Scsi_Host *shost = data;
1587 int rtn;
1588 1535
1589 current->flags |= PF_NOFREEZE; 1536 current->flags |= PF_NOFREEZE;
1590 1537
1591
1592 /* 1538 /*
1593 * Note - we always use TASK_INTERRUPTIBLE even if the module 1539 * We use TASK_INTERRUPTIBLE so that the thread is not
1594 * was loaded as part of the kernel. The reason is that 1540 * counted against the load average as a running process.
1595 * UNINTERRUPTIBLE would cause this thread to be counted in 1541 * We never actually get interrupted because kthread_run
1596 * the load average as a running process, and an interruptible 1542 * disables singal delivery for the created thread.
1597 * wait doesn't.
1598 */ 1543 */
1599 set_current_state(TASK_INTERRUPTIBLE); 1544 set_current_state(TASK_INTERRUPTIBLE);
1600 while (!kthread_should_stop()) { 1545 while (!kthread_should_stop()) {
1601 if (shost->host_failed == 0 || 1546 if (shost->host_failed == 0 ||
1602 shost->host_failed != shost->host_busy) { 1547 shost->host_failed != shost->host_busy) {
1603 SCSI_LOG_ERROR_RECOVERY(1, printk("Error handler" 1548 SCSI_LOG_ERROR_RECOVERY(1,
1604 " scsi_eh_%d" 1549 printk("Error handler scsi_eh_%d sleeping\n",
1605 " sleeping\n", 1550 shost->host_no));
1606 shost->host_no));
1607 schedule(); 1551 schedule();
1608 set_current_state(TASK_INTERRUPTIBLE); 1552 set_current_state(TASK_INTERRUPTIBLE);
1609 continue; 1553 continue;
1610 } 1554 }
1611 1555
1612 __set_current_state(TASK_RUNNING); 1556 __set_current_state(TASK_RUNNING);
1613 SCSI_LOG_ERROR_RECOVERY(1, printk("Error handler" 1557 SCSI_LOG_ERROR_RECOVERY(1,
1614 " scsi_eh_%d waking" 1558 printk("Error handler scsi_eh_%d waking up\n",
1615 " up\n",shost->host_no)); 1559 shost->host_no));
1616
1617 shost->eh_active = 1;
1618 1560
1619 /* 1561 /*
1620 * We have a host that is failing for some reason. Figure out 1562 * We have a host that is failing for some reason. Figure out
@@ -1622,12 +1564,10 @@ int scsi_error_handler(void *data)
1622 * If we fail, we end up taking the thing offline. 1564 * If we fail, we end up taking the thing offline.
1623 */ 1565 */
1624 if (shost->hostt->eh_strategy_handler) 1566 if (shost->hostt->eh_strategy_handler)
1625 rtn = shost->hostt->eh_strategy_handler(shost); 1567 shost->hostt->eh_strategy_handler(shost);
1626 else 1568 else
1627 scsi_unjam_host(shost); 1569 scsi_unjam_host(shost);
1628 1570
1629 shost->eh_active = 0;
1630
1631 /* 1571 /*
1632 * Note - if the above fails completely, the action is to take 1572 * Note - if the above fails completely, the action is to take
1633 * individual devices offline and flush the queue of any 1573 * individual devices offline and flush the queue of any
@@ -1638,15 +1578,10 @@ int scsi_error_handler(void *data)
1638 scsi_restart_operations(shost); 1578 scsi_restart_operations(shost);
1639 set_current_state(TASK_INTERRUPTIBLE); 1579 set_current_state(TASK_INTERRUPTIBLE);
1640 } 1580 }
1641
1642 __set_current_state(TASK_RUNNING); 1581 __set_current_state(TASK_RUNNING);
1643 1582
1644 SCSI_LOG_ERROR_RECOVERY(1, printk("Error handler scsi_eh_%d" 1583 SCSI_LOG_ERROR_RECOVERY(1,
1645 " exiting\n",shost->host_no)); 1584 printk("Error handler scsi_eh_%d exiting\n", shost->host_no));
1646
1647 /*
1648 * Make sure that nobody tries to wake us up again.
1649 */
1650 shost->ehandler = NULL; 1585 shost->ehandler = NULL;
1651 return 0; 1586 return 0;
1652} 1587}
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index e40c8b66da40..ce9d73a292e2 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -254,55 +254,6 @@ void scsi_do_req(struct scsi_request *sreq, const void *cmnd,
254} 254}
255EXPORT_SYMBOL(scsi_do_req); 255EXPORT_SYMBOL(scsi_do_req);
256 256
257/* This is the end routine we get to if a command was never attached
258 * to the request. Simply complete the request without changing
259 * rq_status; this will cause a DRIVER_ERROR. */
260static void scsi_wait_req_end_io(struct request *req)
261{
262 BUG_ON(!req->waiting);
263
264 complete(req->waiting);
265}
266
267void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer,
268 unsigned bufflen, int timeout, int retries)
269{
270 DECLARE_COMPLETION(wait);
271 int write = (sreq->sr_data_direction == DMA_TO_DEVICE);
272 struct request *req;
273
274 req = blk_get_request(sreq->sr_device->request_queue, write,
275 __GFP_WAIT);
276 if (bufflen && blk_rq_map_kern(sreq->sr_device->request_queue, req,
277 buffer, bufflen, __GFP_WAIT)) {
278 sreq->sr_result = DRIVER_ERROR << 24;
279 blk_put_request(req);
280 return;
281 }
282
283 req->flags |= REQ_NOMERGE;
284 req->waiting = &wait;
285 req->end_io = scsi_wait_req_end_io;
286 req->cmd_len = COMMAND_SIZE(((u8 *)cmnd)[0]);
287 req->sense = sreq->sr_sense_buffer;
288 req->sense_len = 0;
289 memcpy(req->cmd, cmnd, req->cmd_len);
290 req->timeout = timeout;
291 req->flags |= REQ_BLOCK_PC;
292 req->rq_disk = NULL;
293 blk_insert_request(sreq->sr_device->request_queue, req,
294 sreq->sr_data_direction == DMA_TO_DEVICE, NULL);
295 wait_for_completion(&wait);
296 sreq->sr_request->waiting = NULL;
297 sreq->sr_result = req->errors;
298 if (req->errors)
299 sreq->sr_result |= (DRIVER_ERROR << 24);
300
301 blk_put_request(req);
302}
303
304EXPORT_SYMBOL(scsi_wait_req);
305
306/** 257/**
307 * scsi_execute - insert request and wait for the result 258 * scsi_execute - insert request and wait for the result
308 * @sdev: scsi device 259 * @sdev: scsi device
@@ -591,10 +542,17 @@ static void scsi_requeue_command(struct request_queue *q, struct scsi_cmnd *cmd)
591 542
592void scsi_next_command(struct scsi_cmnd *cmd) 543void scsi_next_command(struct scsi_cmnd *cmd)
593{ 544{
594 struct request_queue *q = cmd->device->request_queue; 545 struct scsi_device *sdev = cmd->device;
546 struct request_queue *q = sdev->request_queue;
547
548 /* need to hold a reference on the device before we let go of the cmd */
549 get_device(&sdev->sdev_gendev);
595 550
596 scsi_put_command(cmd); 551 scsi_put_command(cmd);
597 scsi_run_queue(q); 552 scsi_run_queue(q);
553
554 /* ok to remove device now */
555 put_device(&sdev->sdev_gendev);
598} 556}
599 557
600void scsi_run_host_queues(struct Scsi_Host *shost) 558void scsi_run_host_queues(struct Scsi_Host *shost)
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index d05f778d31a8..d632d9e1493c 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -22,7 +22,6 @@ struct Scsi_Host;
22 * Scsi Error Handler Flags 22 * Scsi Error Handler Flags
23 */ 23 */
24#define SCSI_EH_CANCEL_CMD 0x0001 /* Cancel this cmd */ 24#define SCSI_EH_CANCEL_CMD 0x0001 /* Cancel this cmd */
25#define SCSI_EH_REC_TIMEOUT 0x0002 /* EH retry timed out */
26 25
27#define SCSI_SENSE_VALID(scmd) \ 26#define SCSI_SENSE_VALID(scmd) \
28 (((scmd)->sense_buffer[0] & 0x70) == 0x70) 27 (((scmd)->sense_buffer[0] & 0x70) == 0x70)
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 7eb3a2d40dc5..374853df9cca 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -9,7 +9,7 @@
9 * global variable (boot or module load time) settings. 9 * global variable (boot or module load time) settings.
10 * 10 *
11 * A specific LUN is scanned via an INQUIRY command; if the LUN has a 11 * A specific LUN is scanned via an INQUIRY command; if the LUN has a
12 * device attached, a Scsi_Device is allocated and setup for it. 12 * device attached, a scsi_device is allocated and setup for it.
13 * 13 *
14 * For every id of every channel on the given host: 14 * For every id of every channel on the given host:
15 * 15 *
@@ -17,7 +17,7 @@
17 * device or storage attached to LUN 0): 17 * device or storage attached to LUN 0):
18 * 18 *
19 * If LUN 0 has a device attached, allocate and setup a 19 * If LUN 0 has a device attached, allocate and setup a
20 * Scsi_Device for it. 20 * scsi_device for it.
21 * 21 *
22 * If target is SCSI-3 or up, issue a REPORT LUN, and scan 22 * If target is SCSI-3 or up, issue a REPORT LUN, and scan
23 * all of the LUNs returned by the REPORT LUN; else, 23 * all of the LUNs returned by the REPORT LUN; else,
@@ -441,7 +441,7 @@ void scsi_target_reap(struct scsi_target *starget)
441 * 441 *
442 * If the INQUIRY is successful, zero is returned and the 442 * If the INQUIRY is successful, zero is returned and the
443 * INQUIRY data is in @inq_result; the scsi_level and INQUIRY length 443 * INQUIRY data is in @inq_result; the scsi_level and INQUIRY length
444 * are copied to the Scsi_Device any flags value is stored in *@bflags. 444 * are copied to the scsi_device any flags value is stored in *@bflags.
445 **/ 445 **/
446static int scsi_probe_lun(struct scsi_device *sdev, char *inq_result, 446static int scsi_probe_lun(struct scsi_device *sdev, char *inq_result,
447 int result_len, int *bflags) 447 int result_len, int *bflags)
@@ -509,8 +509,8 @@ static int scsi_probe_lun(struct scsi_device *sdev, char *inq_result,
509 /* 509 /*
510 * Get any flags for this device. 510 * Get any flags for this device.
511 * 511 *
512 * XXX add a bflags to Scsi_Device, and replace the 512 * XXX add a bflags to scsi_device, and replace the
513 * corresponding bit fields in Scsi_Device, so bflags 513 * corresponding bit fields in scsi_device, so bflags
514 * need not be passed as an argument. 514 * need not be passed as an argument.
515 */ 515 */
516 *bflags = scsi_get_device_flags(sdev, &inq_result[8], 516 *bflags = scsi_get_device_flags(sdev, &inq_result[8],
@@ -592,21 +592,21 @@ static int scsi_probe_lun(struct scsi_device *sdev, char *inq_result,
592} 592}
593 593
594/** 594/**
595 * scsi_add_lun - allocate and fully initialze a Scsi_Device 595 * scsi_add_lun - allocate and fully initialze a scsi_device
596 * @sdevscan: holds information to be stored in the new Scsi_Device 596 * @sdevscan: holds information to be stored in the new scsi_device
597 * @sdevnew: store the address of the newly allocated Scsi_Device 597 * @sdevnew: store the address of the newly allocated scsi_device
598 * @inq_result: holds the result of a previous INQUIRY to the LUN 598 * @inq_result: holds the result of a previous INQUIRY to the LUN
599 * @bflags: black/white list flag 599 * @bflags: black/white list flag
600 * 600 *
601 * Description: 601 * Description:
602 * Allocate and initialize a Scsi_Device matching sdevscan. Optionally 602 * Allocate and initialize a scsi_device matching sdevscan. Optionally
603 * set fields based on values in *@bflags. If @sdevnew is not 603 * set fields based on values in *@bflags. If @sdevnew is not
604 * NULL, store the address of the new Scsi_Device in *@sdevnew (needed 604 * NULL, store the address of the new scsi_device in *@sdevnew (needed
605 * when scanning a particular LUN). 605 * when scanning a particular LUN).
606 * 606 *
607 * Return: 607 * Return:
608 * SCSI_SCAN_NO_RESPONSE: could not allocate or setup a Scsi_Device 608 * SCSI_SCAN_NO_RESPONSE: could not allocate or setup a scsi_device
609 * SCSI_SCAN_LUN_PRESENT: a new Scsi_Device was allocated and initialized 609 * SCSI_SCAN_LUN_PRESENT: a new scsi_device was allocated and initialized
610 **/ 610 **/
611static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags) 611static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
612{ 612{
@@ -674,7 +674,7 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
674 * 674 *
675 * The above is vague, as it implies that we could treat 001 and 675 * The above is vague, as it implies that we could treat 001 and
676 * 011 the same. Stay compatible with previous code, and create a 676 * 011 the same. Stay compatible with previous code, and create a
677 * Scsi_Device for a PQ of 1 677 * scsi_device for a PQ of 1
678 * 678 *
679 * Don't set the device offline here; rather let the upper 679 * Don't set the device offline here; rather let the upper
680 * level drivers eval the PQ to decide whether they should 680 * level drivers eval the PQ to decide whether they should
@@ -784,8 +784,8 @@ static inline void scsi_destroy_sdev(struct scsi_device *sdev)
784 * scsi_probe_and_add_lun - probe a LUN, if a LUN is found add it 784 * scsi_probe_and_add_lun - probe a LUN, if a LUN is found add it
785 * @starget: pointer to target device structure 785 * @starget: pointer to target device structure
786 * @lun: LUN of target device 786 * @lun: LUN of target device
787 * @sdevscan: probe the LUN corresponding to this Scsi_Device 787 * @sdevscan: probe the LUN corresponding to this scsi_device
788 * @sdevnew: store the value of any new Scsi_Device allocated 788 * @sdevnew: store the value of any new scsi_device allocated
789 * @bflagsp: store bflags here if not NULL 789 * @bflagsp: store bflags here if not NULL
790 * 790 *
791 * Description: 791 * Description:
@@ -793,10 +793,10 @@ static inline void scsi_destroy_sdev(struct scsi_device *sdev)
793 * allocate and set it up by calling scsi_add_lun. 793 * allocate and set it up by calling scsi_add_lun.
794 * 794 *
795 * Return: 795 * Return:
796 * SCSI_SCAN_NO_RESPONSE: could not allocate or setup a Scsi_Device 796 * SCSI_SCAN_NO_RESPONSE: could not allocate or setup a scsi_device
797 * SCSI_SCAN_TARGET_PRESENT: target responded, but no device is 797 * SCSI_SCAN_TARGET_PRESENT: target responded, but no device is
798 * attached at the LUN 798 * attached at the LUN
799 * SCSI_SCAN_LUN_PRESENT: a new Scsi_Device was allocated and initialized 799 * SCSI_SCAN_LUN_PRESENT: a new scsi_device was allocated and initialized
800 **/ 800 **/
801static int scsi_probe_and_add_lun(struct scsi_target *starget, 801static int scsi_probe_and_add_lun(struct scsi_target *starget,
802 uint lun, int *bflagsp, 802 uint lun, int *bflagsp,
@@ -1046,7 +1046,7 @@ EXPORT_SYMBOL(int_to_scsilun);
1046 1046
1047/** 1047/**
1048 * scsi_report_lun_scan - Scan using SCSI REPORT LUN results 1048 * scsi_report_lun_scan - Scan using SCSI REPORT LUN results
1049 * @sdevscan: scan the host, channel, and id of this Scsi_Device 1049 * @sdevscan: scan the host, channel, and id of this scsi_device
1050 * 1050 *
1051 * Description: 1051 * Description:
1052 * If @sdevscan is for a SCSI-3 or up device, send a REPORT LUN 1052 * If @sdevscan is for a SCSI-3 or up device, send a REPORT LUN
@@ -1074,6 +1074,7 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
1074 struct scsi_sense_hdr sshdr; 1074 struct scsi_sense_hdr sshdr;
1075 struct scsi_device *sdev; 1075 struct scsi_device *sdev;
1076 struct Scsi_Host *shost = dev_to_shost(&starget->dev); 1076 struct Scsi_Host *shost = dev_to_shost(&starget->dev);
1077 int ret = 0;
1077 1078
1078 /* 1079 /*
1079 * Only support SCSI-3 and up devices if BLIST_NOREPORTLUN is not set. 1080 * Only support SCSI-3 and up devices if BLIST_NOREPORTLUN is not set.
@@ -1169,8 +1170,8 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
1169 /* 1170 /*
1170 * The device probably does not support a REPORT LUN command 1171 * The device probably does not support a REPORT LUN command
1171 */ 1172 */
1172 kfree(lun_data); 1173 ret = 1;
1173 return 1; 1174 goto out_err;
1174 } 1175 }
1175 1176
1176 /* 1177 /*
@@ -1238,6 +1239,7 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
1238 } 1239 }
1239 } 1240 }
1240 1241
1242 out_err:
1241 kfree(lun_data); 1243 kfree(lun_data);
1242 out: 1244 out:
1243 scsi_device_put(sdev); 1245 scsi_device_put(sdev);
@@ -1246,7 +1248,7 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
1246 * the sdev we used didn't appear in the report luns scan 1248 * the sdev we used didn't appear in the report luns scan
1247 */ 1249 */
1248 scsi_destroy_sdev(sdev); 1250 scsi_destroy_sdev(sdev);
1249 return 0; 1251 return ret;
1250} 1252}
1251 1253
1252struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel, 1254struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
@@ -1472,16 +1474,16 @@ void scsi_forget_host(struct Scsi_Host *shost)
1472/* 1474/*
1473 * Function: scsi_get_host_dev() 1475 * Function: scsi_get_host_dev()
1474 * 1476 *
1475 * Purpose: Create a Scsi_Device that points to the host adapter itself. 1477 * Purpose: Create a scsi_device that points to the host adapter itself.
1476 * 1478 *
1477 * Arguments: SHpnt - Host that needs a Scsi_Device 1479 * Arguments: SHpnt - Host that needs a scsi_device
1478 * 1480 *
1479 * Lock status: None assumed. 1481 * Lock status: None assumed.
1480 * 1482 *
1481 * Returns: The Scsi_Device or NULL 1483 * Returns: The scsi_device or NULL
1482 * 1484 *
1483 * Notes: 1485 * Notes:
1484 * Attach a single Scsi_Device to the Scsi_Host - this should 1486 * Attach a single scsi_device to the Scsi_Host - this should
1485 * be made to look like a "pseudo-device" that points to the 1487 * be made to look like a "pseudo-device" that points to the
1486 * HA itself. 1488 * HA itself.
1487 * 1489 *
@@ -1518,7 +1520,7 @@ EXPORT_SYMBOL(scsi_get_host_dev);
1518 * 1520 *
1519 * Purpose: Free a scsi_device that points to the host adapter itself. 1521 * Purpose: Free a scsi_device that points to the host adapter itself.
1520 * 1522 *
1521 * Arguments: SHpnt - Host that needs a Scsi_Device 1523 * Arguments: SHpnt - Host that needs a scsi_device
1522 * 1524 *
1523 * Lock status: None assumed. 1525 * Lock status: None assumed.
1524 * 1526 *
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 72a6550a056c..46349293de08 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -691,16 +691,19 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
691 691
692void __scsi_remove_device(struct scsi_device *sdev) 692void __scsi_remove_device(struct scsi_device *sdev)
693{ 693{
694 struct device *dev = &sdev->sdev_gendev;
695
694 if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0) 696 if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0)
695 return; 697 return;
696 698
697 class_device_unregister(&sdev->sdev_classdev); 699 class_device_unregister(&sdev->sdev_classdev);
698 device_del(&sdev->sdev_gendev); 700 transport_remove_device(dev);
701 device_del(dev);
699 scsi_device_set_state(sdev, SDEV_DEL); 702 scsi_device_set_state(sdev, SDEV_DEL);
700 if (sdev->host->hostt->slave_destroy) 703 if (sdev->host->hostt->slave_destroy)
701 sdev->host->hostt->slave_destroy(sdev); 704 sdev->host->hostt->slave_destroy(sdev);
702 transport_unregister_device(&sdev->sdev_gendev); 705 transport_destroy_device(dev);
703 put_device(&sdev->sdev_gendev); 706 put_device(dev);
704} 707}
705 708
706/** 709/**
diff --git a/drivers/scsi/scsi_typedefs.h b/drivers/scsi/scsi_typedefs.h
index 6c431323581c..29f038b42f60 100644
--- a/drivers/scsi/scsi_typedefs.h
+++ b/drivers/scsi/scsi_typedefs.h
@@ -1,6 +1,3 @@
1 1
2typedef struct scsi_host_template Scsi_Host_Template;
3typedef struct scsi_device Scsi_Device;
4typedef struct scsi_cmnd Scsi_Cmnd; 2typedef struct scsi_cmnd Scsi_Cmnd;
5typedef struct scsi_request Scsi_Request; 3typedef struct scsi_request Scsi_Request;
6typedef struct scsi_pointer Scsi_Pointer;
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index bb5b242ac6b4..8613a1317712 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -769,20 +769,16 @@ static void sd_end_flush(request_queue_t *q, struct request *flush_rq)
769static int sd_prepare_flush(request_queue_t *q, struct request *rq) 769static int sd_prepare_flush(request_queue_t *q, struct request *rq)
770{ 770{
771 struct scsi_device *sdev = q->queuedata; 771 struct scsi_device *sdev = q->queuedata;
772 struct scsi_disk *sdkp = scsi_disk_get_from_dev(&sdev->sdev_gendev); 772 struct scsi_disk *sdkp = dev_get_drvdata(&sdev->sdev_gendev);
773 int ret = 0;
774 773
775 if (sdkp) { 774 if (!sdkp || !sdkp->WCE)
776 if (sdkp->WCE) { 775 return 0;
777 memset(rq->cmd, 0, sizeof(rq->cmd)); 776
778 rq->flags |= REQ_BLOCK_PC | REQ_SOFTBARRIER; 777 memset(rq->cmd, 0, sizeof(rq->cmd));
779 rq->timeout = SD_TIMEOUT; 778 rq->flags |= REQ_BLOCK_PC | REQ_SOFTBARRIER;
780 rq->cmd[0] = SYNCHRONIZE_CACHE; 779 rq->timeout = SD_TIMEOUT;
781 ret = 1; 780 rq->cmd[0] = SYNCHRONIZE_CACHE;
782 } 781 return 1;
783 scsi_disk_put(sdkp);
784 }
785 return ret;
786} 782}
787 783
788static void sd_rescan(struct device *dev) 784static void sd_rescan(struct device *dev)
diff --git a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c
index a0cace9aeb79..0ff83ddf13fe 100644
--- a/drivers/scsi/seagate.c
+++ b/drivers/scsi/seagate.c
@@ -418,7 +418,7 @@ static inline void borken_wait (void)
418#define ULOOP( i ) for (clock = i*8;;) 418#define ULOOP( i ) for (clock = i*8;;)
419#define TIMEOUT (!(clock--)) 419#define TIMEOUT (!(clock--))
420 420
421int __init seagate_st0x_detect (Scsi_Host_Template * tpnt) 421int __init seagate_st0x_detect (struct scsi_host_template * tpnt)
422{ 422{
423 struct Scsi_Host *instance; 423 struct Scsi_Host *instance;
424 int i, j; 424 int i, j;
@@ -1649,7 +1649,7 @@ static int seagate_st0x_release(struct Scsi_Host *shost)
1649 return 0; 1649 return 0;
1650} 1650}
1651 1651
1652static Scsi_Host_Template driver_template = { 1652static struct scsi_host_template driver_template = {
1653 .detect = seagate_st0x_detect, 1653 .detect = seagate_st0x_detect,
1654 .release = seagate_st0x_release, 1654 .release = seagate_st0x_release,
1655 .info = seagate_st0x_info, 1655 .info = seagate_st0x_info,
diff --git a/drivers/scsi/seagate.h b/drivers/scsi/seagate.h
index 8889ff1a6b20..fb5f380fa4b3 100644
--- a/drivers/scsi/seagate.h
+++ b/drivers/scsi/seagate.h
@@ -9,7 +9,7 @@
9#ifndef _SEAGATE_H 9#ifndef _SEAGATE_H
10#define SEAGATE_H 10#define SEAGATE_H
11 11
12static int seagate_st0x_detect(Scsi_Host_Template *); 12static int seagate_st0x_detect(struct scsi_host_template *);
13static int seagate_st0x_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 13static int seagate_st0x_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
14 14
15static int seagate_st0x_abort(Scsi_Cmnd *); 15static int seagate_st0x_abort(Scsi_Cmnd *);
diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index f37147f8f7bf..bf2ceb54354c 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -217,7 +217,7 @@ static inline void init_hpc_chain(struct hpc_data *hd)
217} 217}
218 218
219static struct Scsi_Host * __init sgiwd93_setup_scsi( 219static struct Scsi_Host * __init sgiwd93_setup_scsi(
220 Scsi_Host_Template *SGIblows, int unit, int irq, 220 struct scsi_host_template *SGIblows, int unit, int irq,
221 struct hpc3_scsiregs *hregs, unsigned char *wdregs) 221 struct hpc3_scsiregs *hregs, unsigned char *wdregs)
222{ 222{
223 struct ip22_hostdata *hdata; 223 struct ip22_hostdata *hdata;
@@ -265,7 +265,7 @@ out_unregister:
265 return NULL; 265 return NULL;
266} 266}
267 267
268int __init sgiwd93_detect(Scsi_Host_Template *SGIblows) 268int __init sgiwd93_detect(struct scsi_host_template *SGIblows)
269{ 269{
270 int found = 0; 270 int found = 0;
271 271
@@ -324,7 +324,7 @@ static int sgiwd93_bus_reset(Scsi_Cmnd *cmd)
324 * arguments not with pointers. So this is going to blow up beautyfully 324 * arguments not with pointers. So this is going to blow up beautyfully
325 * on 64-bit systems with memory outside the compat address spaces. 325 * on 64-bit systems with memory outside the compat address spaces.
326 */ 326 */
327static Scsi_Host_Template driver_template = { 327static struct scsi_host_template driver_template = {
328 .proc_name = "SGIWD93", 328 .proc_name = "SGIWD93",
329 .name = "SGI WD93", 329 .name = "SGI WD93",
330 .detect = sgiwd93_detect, 330 .detect = sgiwd93_detect,
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c
index 7e19589e71a0..c041bfd56e12 100644
--- a/drivers/scsi/sun3_NCR5380.c
+++ b/drivers/scsi/sun3_NCR5380.c
@@ -257,7 +257,7 @@
257 */ 257 */
258 258
259static struct Scsi_Host *first_instance = NULL; 259static struct Scsi_Host *first_instance = NULL;
260static Scsi_Host_Template *the_template = NULL; 260static struct scsi_host_template *the_template = NULL;
261 261
262/* Macros ease life... :-) */ 262/* Macros ease life... :-) */
263#define SETUP_HOSTDATA(in) \ 263#define SETUP_HOSTDATA(in) \
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
index e3ea99f23d60..837173415d4c 100644
--- a/drivers/scsi/sun3_scsi.c
+++ b/drivers/scsi/sun3_scsi.c
@@ -185,7 +185,7 @@ static inline void sun3_udc_write(unsigned short val, unsigned char reg)
185static struct Scsi_Host *default_instance; 185static struct Scsi_Host *default_instance;
186 186
187/* 187/*
188 * Function : int sun3scsi_detect(Scsi_Host_Template * tpnt) 188 * Function : int sun3scsi_detect(struct scsi_host_template * tpnt)
189 * 189 *
190 * Purpose : initializes mac NCR5380 driver based on the 190 * Purpose : initializes mac NCR5380 driver based on the
191 * command line / compile time port and irq definitions. 191 * command line / compile time port and irq definitions.
@@ -196,7 +196,7 @@ static struct Scsi_Host *default_instance;
196 * 196 *
197 */ 197 */
198 198
199int sun3scsi_detect(Scsi_Host_Template * tpnt) 199int sun3scsi_detect(struct scsi_host_template * tpnt)
200{ 200{
201 unsigned long ioaddr; 201 unsigned long ioaddr;
202 static int called = 0; 202 static int called = 0;
@@ -621,7 +621,7 @@ static int sun3scsi_dma_finish(int write_flag)
621 621
622#include "sun3_NCR5380.c" 622#include "sun3_NCR5380.c"
623 623
624static Scsi_Host_Template driver_template = { 624static struct scsi_host_template driver_template = {
625 .name = SUN3_SCSI_NAME, 625 .name = SUN3_SCSI_NAME,
626 .detect = sun3scsi_detect, 626 .detect = sun3scsi_detect,
627 .release = sun3scsi_release, 627 .release = sun3scsi_release,
diff --git a/drivers/scsi/sun3_scsi.h b/drivers/scsi/sun3_scsi.h
index 155282b92a95..834dab428019 100644
--- a/drivers/scsi/sun3_scsi.h
+++ b/drivers/scsi/sun3_scsi.h
@@ -48,7 +48,7 @@
48#define IOBASE_SUN3_VMESCSI 0xff200000 48#define IOBASE_SUN3_VMESCSI 0xff200000
49 49
50static int sun3scsi_abort (Scsi_Cmnd *); 50static int sun3scsi_abort (Scsi_Cmnd *);
51static int sun3scsi_detect (Scsi_Host_Template *); 51static int sun3scsi_detect (struct scsi_host_template *);
52static const char *sun3scsi_info (struct Scsi_Host *); 52static const char *sun3scsi_info (struct Scsi_Host *);
53static int sun3scsi_bus_reset(Scsi_Cmnd *); 53static int sun3scsi_bus_reset(Scsi_Cmnd *);
54static int sun3scsi_queue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 54static int sun3scsi_queue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
diff --git a/drivers/scsi/sun3_scsi_vme.c b/drivers/scsi/sun3_scsi_vme.c
index 9acb5ddebb07..008a82ab8521 100644
--- a/drivers/scsi/sun3_scsi_vme.c
+++ b/drivers/scsi/sun3_scsi_vme.c
@@ -127,7 +127,7 @@ static inline void sun3scsi_write(int reg, int value)
127static struct Scsi_Host *default_instance; 127static struct Scsi_Host *default_instance;
128 128
129/* 129/*
130 * Function : int sun3scsi_detect(Scsi_Host_Template * tpnt) 130 * Function : int sun3scsi_detect(struct scsi_host_template * tpnt)
131 * 131 *
132 * Purpose : initializes mac NCR5380 driver based on the 132 * Purpose : initializes mac NCR5380 driver based on the
133 * command line / compile time port and irq definitions. 133 * command line / compile time port and irq definitions.
@@ -138,7 +138,7 @@ static struct Scsi_Host *default_instance;
138 * 138 *
139 */ 139 */
140 140
141static int sun3scsi_detect(Scsi_Host_Template * tpnt) 141static int sun3scsi_detect(struct scsi_host_template * tpnt)
142{ 142{
143 unsigned long ioaddr, irq = 0; 143 unsigned long ioaddr, irq = 0;
144 static int called = 0; 144 static int called = 0;
@@ -564,7 +564,7 @@ static int sun3scsi_dma_finish(int write_flag)
564 564
565#include "sun3_NCR5380.c" 565#include "sun3_NCR5380.c"
566 566
567static Scsi_Host_Template driver_template = { 567static struct scsi_host_template driver_template = {
568 .name = SUN3_SCSI_NAME, 568 .name = SUN3_SCSI_NAME,
569 .detect = sun3scsi_detect, 569 .detect = sun3scsi_detect,
570 .release = sun3scsi_release, 570 .release = sun3scsi_release,
diff --git a/drivers/scsi/sun3x_esp.c b/drivers/scsi/sun3x_esp.c
index 09d7639079b4..cc990bed9683 100644
--- a/drivers/scsi/sun3x_esp.c
+++ b/drivers/scsi/sun3x_esp.c
@@ -47,7 +47,7 @@ static void dma_advance_sg (Scsi_Cmnd *sp);
47/* Detecting ESP chips on the machine. This is the simple and easy 47/* Detecting ESP chips on the machine. This is the simple and easy
48 * version. 48 * version.
49 */ 49 */
50int sun3x_esp_detect(Scsi_Host_Template *tpnt) 50int sun3x_esp_detect(struct scsi_host_template *tpnt)
51{ 51{
52 struct NCR_ESP *esp; 52 struct NCR_ESP *esp;
53 struct ConfigDev *esp_dev; 53 struct ConfigDev *esp_dev;
@@ -367,7 +367,7 @@ static int sun3x_esp_release(struct Scsi_Host *instance)
367 367
368} 368}
369 369
370static Scsi_Host_Template driver_template = { 370static struct scsi_host_template driver_template = {
371 .proc_name = "sun3x_esp", 371 .proc_name = "sun3x_esp",
372 .proc_info = &esp_proc_info, 372 .proc_info = &esp_proc_info,
373 .name = "Sun ESP 100/100a/200", 373 .name = "Sun ESP 100/100a/200",
diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c
index 93dc7b665ccf..8640253d6215 100644
--- a/drivers/scsi/sym53c416.c
+++ b/drivers/scsi/sym53c416.c
@@ -633,7 +633,7 @@ static void sym53c416_probe(void)
633 } 633 }
634} 634}
635 635
636int __init sym53c416_detect(Scsi_Host_Template *tpnt) 636int __init sym53c416_detect(struct scsi_host_template *tpnt)
637{ 637{
638 unsigned long flags; 638 unsigned long flags;
639 struct Scsi_Host * shpnt = NULL; 639 struct Scsi_Host * shpnt = NULL;
@@ -849,7 +849,7 @@ module_param_array(sym53c416_3, uint, NULL, 0);
849 849
850#endif 850#endif
851 851
852static Scsi_Host_Template driver_template = { 852static struct scsi_host_template driver_template = {
853 .proc_name = "sym53c416", 853 .proc_name = "sym53c416",
854 .name = "Symbios Logic 53c416", 854 .name = "Symbios Logic 53c416",
855 .detect = sym53c416_detect, 855 .detect = sym53c416_detect,
diff --git a/drivers/scsi/sym53c416.h b/drivers/scsi/sym53c416.h
index fd6b120d38c4..77860d0748ff 100644
--- a/drivers/scsi/sym53c416.h
+++ b/drivers/scsi/sym53c416.h
@@ -22,7 +22,7 @@
22 22
23#define SYM53C416_SCSI_ID 7 23#define SYM53C416_SCSI_ID 7
24 24
25static int sym53c416_detect(Scsi_Host_Template *); 25static int sym53c416_detect(struct scsi_host_template *);
26static const char *sym53c416_info(struct Scsi_Host *); 26static const char *sym53c416_info(struct Scsi_Host *);
27static int sym53c416_release(struct Scsi_Host *); 27static int sym53c416_release(struct Scsi_Host *);
28static int sym53c416_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 28static int sym53c416_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
diff --git a/drivers/scsi/t128.c b/drivers/scsi/t128.c
index f4b780e35cb6..21305fc91479 100644
--- a/drivers/scsi/t128.c
+++ b/drivers/scsi/t128.c
@@ -183,7 +183,7 @@ void __init t128_setup(char *str, int *ints){
183} 183}
184 184
185/* 185/*
186 * Function : int t128_detect(Scsi_Host_Template * tpnt) 186 * Function : int t128_detect(struct scsi_host_template * tpnt)
187 * 187 *
188 * Purpose : detects and initializes T128,T128F, or T228 controllers 188 * Purpose : detects and initializes T128,T128F, or T228 controllers
189 * that were autoprobed, overridden on the LILO command line, 189 * that were autoprobed, overridden on the LILO command line,
@@ -195,7 +195,7 @@ void __init t128_setup(char *str, int *ints){
195 * 195 *
196 */ 196 */
197 197
198int __init t128_detect(Scsi_Host_Template * tpnt){ 198int __init t128_detect(struct scsi_host_template * tpnt){
199 static int current_override = 0, current_base = 0; 199 static int current_override = 0, current_base = 0;
200 struct Scsi_Host *instance; 200 struct Scsi_Host *instance;
201 unsigned long base; 201 unsigned long base;
@@ -430,7 +430,7 @@ MODULE_LICENSE("GPL");
430 430
431#include "NCR5380.c" 431#include "NCR5380.c"
432 432
433static Scsi_Host_Template driver_template = { 433static struct scsi_host_template driver_template = {
434 .name = "Trantor T128/T128F/T228", 434 .name = "Trantor T128/T128F/T228",
435 .detect = t128_detect, 435 .detect = t128_detect,
436 .release = t128_release, 436 .release = t128_release,
diff --git a/drivers/scsi/t128.h b/drivers/scsi/t128.h
index 596f3a32a1c6..646e840266e2 100644
--- a/drivers/scsi/t128.h
+++ b/drivers/scsi/t128.h
@@ -95,7 +95,7 @@
95static int t128_abort(Scsi_Cmnd *); 95static int t128_abort(Scsi_Cmnd *);
96static int t128_biosparam(struct scsi_device *, struct block_device *, 96static int t128_biosparam(struct scsi_device *, struct block_device *,
97 sector_t, int*); 97 sector_t, int*);
98static int t128_detect(Scsi_Host_Template *); 98static int t128_detect(struct scsi_host_template *);
99static int t128_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 99static int t128_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
100static int t128_bus_reset(Scsi_Cmnd *); 100static int t128_bus_reset(Scsi_Cmnd *);
101 101
diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c
index 1ce29ba683eb..33cd90fc657b 100644
--- a/drivers/scsi/u14-34f.c
+++ b/drivers/scsi/u14-34f.c
@@ -282,7 +282,7 @@
282 * clustering is enabled. ENABLE_CLUSTERING provides a performance increase 282 * clustering is enabled. ENABLE_CLUSTERING provides a performance increase
283 * up to 50% on sequential access. 283 * up to 50% on sequential access.
284 * 284 *
285 * Since the Scsi_Host_Template structure is shared among all 14F and 34F, 285 * Since the struct scsi_host_template structure is shared among all 14F and 34F,
286 * the last setting of use_clustering is in effect for all of these boards. 286 * the last setting of use_clustering is in effect for all of these boards.
287 * 287 *
288 * Here a sample configuration using two U14F boards: 288 * Here a sample configuration using two U14F boards:
diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
index 486551bd54ba..e681681ab7a2 100644
--- a/drivers/scsi/ultrastor.c
+++ b/drivers/scsi/ultrastor.c
@@ -343,7 +343,7 @@ static void log_ultrastor_abort(struct ultrastor_config *config,
343} 343}
344#endif 344#endif
345 345
346static int ultrastor_14f_detect(Scsi_Host_Template * tpnt) 346static int ultrastor_14f_detect(struct scsi_host_template * tpnt)
347{ 347{
348 size_t i; 348 size_t i;
349 unsigned char in_byte, version_byte = 0; 349 unsigned char in_byte, version_byte = 0;
@@ -525,7 +525,7 @@ out_release_port:
525 return FALSE; 525 return FALSE;
526} 526}
527 527
528static int ultrastor_24f_detect(Scsi_Host_Template * tpnt) 528static int ultrastor_24f_detect(struct scsi_host_template * tpnt)
529{ 529{
530 int i; 530 int i;
531 struct Scsi_Host * shpnt = NULL; 531 struct Scsi_Host * shpnt = NULL;
@@ -637,7 +637,7 @@ static int ultrastor_24f_detect(Scsi_Host_Template * tpnt)
637 return FALSE; 637 return FALSE;
638} 638}
639 639
640static int ultrastor_detect(Scsi_Host_Template * tpnt) 640static int ultrastor_detect(struct scsi_host_template * tpnt)
641{ 641{
642 tpnt->proc_name = "ultrastor"; 642 tpnt->proc_name = "ultrastor";
643 return ultrastor_14f_detect(tpnt) || ultrastor_24f_detect(tpnt); 643 return ultrastor_14f_detect(tpnt) || ultrastor_24f_detect(tpnt);
@@ -1184,7 +1184,7 @@ static irqreturn_t do_ultrastor_interrupt(int irq, void *dev_id,
1184 1184
1185MODULE_LICENSE("GPL"); 1185MODULE_LICENSE("GPL");
1186 1186
1187static Scsi_Host_Template driver_template = { 1187static struct scsi_host_template driver_template = {
1188 .name = "UltraStor 14F/24F/34F", 1188 .name = "UltraStor 14F/24F/34F",
1189 .detect = ultrastor_detect, 1189 .detect = ultrastor_detect,
1190 .release = ultrastor_release, 1190 .release = ultrastor_release,
diff --git a/drivers/scsi/ultrastor.h b/drivers/scsi/ultrastor.h
index 0a0f8df9e871..da759a11deff 100644
--- a/drivers/scsi/ultrastor.h
+++ b/drivers/scsi/ultrastor.h
@@ -13,7 +13,7 @@
13#ifndef _ULTRASTOR_H 13#ifndef _ULTRASTOR_H
14#define _ULTRASTOR_H 14#define _ULTRASTOR_H
15 15
16static int ultrastor_detect(Scsi_Host_Template *); 16static int ultrastor_detect(struct scsi_host_template *);
17static const char *ultrastor_info(struct Scsi_Host * shpnt); 17static const char *ultrastor_info(struct Scsi_Host * shpnt);
18static int ultrastor_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 18static int ultrastor_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
19static int ultrastor_abort(Scsi_Cmnd *); 19static int ultrastor_abort(Scsi_Cmnd *);
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 98820603e75f..3742753241ee 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2381,9 +2381,9 @@ void serial8250_resume_port(int line)
2381 * list is terminated with a zero flags entry, which means we expect 2381 * list is terminated with a zero flags entry, which means we expect
2382 * all entries to have at least UPF_BOOT_AUTOCONF set. 2382 * all entries to have at least UPF_BOOT_AUTOCONF set.
2383 */ 2383 */
2384static int __devinit serial8250_probe(struct device *dev) 2384static int __devinit serial8250_probe(struct platform_device *dev)
2385{ 2385{
2386 struct plat_serial8250_port *p = dev->platform_data; 2386 struct plat_serial8250_port *p = dev->dev.platform_data;
2387 struct uart_port port; 2387 struct uart_port port;
2388 int ret, i; 2388 int ret, i;
2389 2389
@@ -2399,12 +2399,12 @@ static int __devinit serial8250_probe(struct device *dev)
2399 port.flags = p->flags; 2399 port.flags = p->flags;
2400 port.mapbase = p->mapbase; 2400 port.mapbase = p->mapbase;
2401 port.hub6 = p->hub6; 2401 port.hub6 = p->hub6;
2402 port.dev = dev; 2402 port.dev = &dev->dev;
2403 if (share_irqs) 2403 if (share_irqs)
2404 port.flags |= UPF_SHARE_IRQ; 2404 port.flags |= UPF_SHARE_IRQ;
2405 ret = serial8250_register_port(&port); 2405 ret = serial8250_register_port(&port);
2406 if (ret < 0) { 2406 if (ret < 0) {
2407 dev_err(dev, "unable to register port at index %d " 2407 dev_err(&dev->dev, "unable to register port at index %d "
2408 "(IO%lx MEM%lx IRQ%d): %d\n", i, 2408 "(IO%lx MEM%lx IRQ%d): %d\n", i,
2409 p->iobase, p->mapbase, p->irq, ret); 2409 p->iobase, p->mapbase, p->irq, ret);
2410 } 2410 }
@@ -2415,54 +2415,55 @@ static int __devinit serial8250_probe(struct device *dev)
2415/* 2415/*
2416 * Remove serial ports registered against a platform device. 2416 * Remove serial ports registered against a platform device.
2417 */ 2417 */
2418static int __devexit serial8250_remove(struct device *dev) 2418static int __devexit serial8250_remove(struct platform_device *dev)
2419{ 2419{
2420 int i; 2420 int i;
2421 2421
2422 for (i = 0; i < UART_NR; i++) { 2422 for (i = 0; i < UART_NR; i++) {
2423 struct uart_8250_port *up = &serial8250_ports[i]; 2423 struct uart_8250_port *up = &serial8250_ports[i];
2424 2424
2425 if (up->port.dev == dev) 2425 if (up->port.dev == &dev->dev)
2426 serial8250_unregister_port(i); 2426 serial8250_unregister_port(i);
2427 } 2427 }
2428 return 0; 2428 return 0;
2429} 2429}
2430 2430
2431static int serial8250_suspend(struct device *dev, pm_message_t state) 2431static int serial8250_suspend(struct platform_device *dev, pm_message_t state)
2432{ 2432{
2433 int i; 2433 int i;
2434 2434
2435 for (i = 0; i < UART_NR; i++) { 2435 for (i = 0; i < UART_NR; i++) {
2436 struct uart_8250_port *up = &serial8250_ports[i]; 2436 struct uart_8250_port *up = &serial8250_ports[i];
2437 2437
2438 if (up->port.type != PORT_UNKNOWN && up->port.dev == dev) 2438 if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev)
2439 uart_suspend_port(&serial8250_reg, &up->port); 2439 uart_suspend_port(&serial8250_reg, &up->port);
2440 } 2440 }
2441 2441
2442 return 0; 2442 return 0;
2443} 2443}
2444 2444
2445static int serial8250_resume(struct device *dev) 2445static int serial8250_resume(struct platform_device *dev)
2446{ 2446{
2447 int i; 2447 int i;
2448 2448
2449 for (i = 0; i < UART_NR; i++) { 2449 for (i = 0; i < UART_NR; i++) {
2450 struct uart_8250_port *up = &serial8250_ports[i]; 2450 struct uart_8250_port *up = &serial8250_ports[i];
2451 2451
2452 if (up->port.type != PORT_UNKNOWN && up->port.dev == dev) 2452 if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev)
2453 uart_resume_port(&serial8250_reg, &up->port); 2453 uart_resume_port(&serial8250_reg, &up->port);
2454 } 2454 }
2455 2455
2456 return 0; 2456 return 0;
2457} 2457}
2458 2458
2459static struct device_driver serial8250_isa_driver = { 2459static struct platform_driver serial8250_isa_driver = {
2460 .name = "serial8250",
2461 .bus = &platform_bus_type,
2462 .probe = serial8250_probe, 2460 .probe = serial8250_probe,
2463 .remove = __devexit_p(serial8250_remove), 2461 .remove = __devexit_p(serial8250_remove),
2464 .suspend = serial8250_suspend, 2462 .suspend = serial8250_suspend,
2465 .resume = serial8250_resume, 2463 .resume = serial8250_resume,
2464 .driver = {
2465 .name = "serial8250",
2466 },
2466}; 2467};
2467 2468
2468/* 2469/*
@@ -2608,7 +2609,7 @@ static int __init serial8250_init(void)
2608 2609
2609 serial8250_register_ports(&serial8250_reg, &serial8250_isa_devs->dev); 2610 serial8250_register_ports(&serial8250_reg, &serial8250_isa_devs->dev);
2610 2611
2611 ret = driver_register(&serial8250_isa_driver); 2612 ret = platform_driver_register(&serial8250_isa_driver);
2612 if (ret == 0) 2613 if (ret == 0)
2613 goto out; 2614 goto out;
2614 2615
@@ -2630,7 +2631,7 @@ static void __exit serial8250_exit(void)
2630 */ 2631 */
2631 serial8250_isa_devs = NULL; 2632 serial8250_isa_devs = NULL;
2632 2633
2633 driver_unregister(&serial8250_isa_driver); 2634 platform_driver_unregister(&serial8250_isa_driver);
2634 platform_device_unregister(isa_dev); 2635 platform_device_unregister(isa_dev);
2635 2636
2636 uart_unregister_driver(&serial8250_reg); 2637 uart_unregister_driver(&serial8250_reg);
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index 4a54ff584700..355cd93a8a87 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -921,9 +921,9 @@ static struct uart_driver imx_reg = {
921 .cons = IMX_CONSOLE, 921 .cons = IMX_CONSOLE,
922}; 922};
923 923
924static int serial_imx_suspend(struct device *_dev, pm_message_t state) 924static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
925{ 925{
926 struct imx_port *sport = dev_get_drvdata(_dev); 926 struct imx_port *sport = platform_get_drvdata(dev);
927 927
928 if (sport) 928 if (sport)
929 uart_suspend_port(&imx_reg, &sport->port); 929 uart_suspend_port(&imx_reg, &sport->port);
@@ -931,9 +931,9 @@ static int serial_imx_suspend(struct device *_dev, pm_message_t state)
931 return 0; 931 return 0;
932} 932}
933 933
934static int serial_imx_resume(struct device *_dev) 934static int serial_imx_resume(struct platform_device *dev)
935{ 935{
936 struct imx_port *sport = dev_get_drvdata(_dev); 936 struct imx_port *sport = platform_get_drvdata(dev);
937 937
938 if (sport) 938 if (sport)
939 uart_resume_port(&imx_reg, &sport->port); 939 uart_resume_port(&imx_reg, &sport->port);
@@ -941,21 +941,19 @@ static int serial_imx_resume(struct device *_dev)
941 return 0; 941 return 0;
942} 942}
943 943
944static int serial_imx_probe(struct device *_dev) 944static int serial_imx_probe(struct platform_device *dev)
945{ 945{
946 struct platform_device *dev = to_platform_device(_dev); 946 imx_ports[dev->id].port.dev = &dev->dev;
947
948 imx_ports[dev->id].port.dev = _dev;
949 uart_add_one_port(&imx_reg, &imx_ports[dev->id].port); 947 uart_add_one_port(&imx_reg, &imx_ports[dev->id].port);
950 dev_set_drvdata(_dev, &imx_ports[dev->id]); 948 platform_set_drvdata(dev, &imx_ports[dev->id]);
951 return 0; 949 return 0;
952} 950}
953 951
954static int serial_imx_remove(struct device *_dev) 952static int serial_imx_remove(struct platform_device *dev)
955{ 953{
956 struct imx_port *sport = dev_get_drvdata(_dev); 954 struct imx_port *sport = platform_get_drvdata(dev);
957 955
958 dev_set_drvdata(_dev, NULL); 956 platform_set_drvdata(dev, NULL);
959 957
960 if (sport) 958 if (sport)
961 uart_remove_one_port(&imx_reg, &sport->port); 959 uart_remove_one_port(&imx_reg, &sport->port);
@@ -963,14 +961,15 @@ static int serial_imx_remove(struct device *_dev)
963 return 0; 961 return 0;
964} 962}
965 963
966static struct device_driver serial_imx_driver = { 964static struct platform_driver serial_imx_driver = {
967 .name = "imx-uart",
968 .bus = &platform_bus_type,
969 .probe = serial_imx_probe, 965 .probe = serial_imx_probe,
970 .remove = serial_imx_remove, 966 .remove = serial_imx_remove,
971 967
972 .suspend = serial_imx_suspend, 968 .suspend = serial_imx_suspend,
973 .resume = serial_imx_resume, 969 .resume = serial_imx_resume,
970 .driver = {
971 .name = "imx-uart",
972 },
974}; 973};
975 974
976static int __init imx_serial_init(void) 975static int __init imx_serial_init(void)
@@ -985,7 +984,7 @@ static int __init imx_serial_init(void)
985 if (ret) 984 if (ret)
986 return ret; 985 return ret;
987 986
988 ret = driver_register(&serial_imx_driver); 987 ret = platform_driver_register(&serial_imx_driver);
989 if (ret != 0) 988 if (ret != 0)
990 uart_unregister_driver(&imx_reg); 989 uart_unregister_driver(&imx_reg);
991 990
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 0dd08a09e7e6..5d3cb8486447 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -717,10 +717,9 @@ static struct uart_driver mpc52xx_uart_driver = {
717/* ======================================================================== */ 717/* ======================================================================== */
718 718
719static int __devinit 719static int __devinit
720mpc52xx_uart_probe(struct device *dev) 720mpc52xx_uart_probe(struct platform_device *dev)
721{ 721{
722 struct platform_device *pdev = to_platform_device(dev); 722 struct resource *res = dev->resource;
723 struct resource *res = pdev->resource;
724 723
725 struct uart_port *port = NULL; 724 struct uart_port *port = NULL;
726 int i, idx, ret; 725 int i, idx, ret;
@@ -761,17 +760,17 @@ mpc52xx_uart_probe(struct device *dev)
761 /* Add the port to the uart sub-system */ 760 /* Add the port to the uart sub-system */
762 ret = uart_add_one_port(&mpc52xx_uart_driver, port); 761 ret = uart_add_one_port(&mpc52xx_uart_driver, port);
763 if (!ret) 762 if (!ret)
764 dev_set_drvdata(dev, (void*)port); 763 platform_set_drvdata(dev, (void*)port);
765 764
766 return ret; 765 return ret;
767} 766}
768 767
769static int 768static int
770mpc52xx_uart_remove(struct device *dev) 769mpc52xx_uart_remove(struct platform_device *dev)
771{ 770{
772 struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); 771 struct uart_port *port = (struct uart_port *) platform_get_drvdata(dev);
773 772
774 dev_set_drvdata(dev, NULL); 773 platform_set_drvdata(dev, NULL);
775 774
776 if (port) 775 if (port)
777 uart_remove_one_port(&mpc52xx_uart_driver, port); 776 uart_remove_one_port(&mpc52xx_uart_driver, port);
@@ -781,9 +780,9 @@ mpc52xx_uart_remove(struct device *dev)
781 780
782#ifdef CONFIG_PM 781#ifdef CONFIG_PM
783static int 782static int
784mpc52xx_uart_suspend(struct device *dev, pm_message_t state) 783mpc52xx_uart_suspend(struct platform_device *dev, pm_message_t state)
785{ 784{
786 struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); 785 struct uart_port *port = (struct uart_port *) platform_get_drvdata(dev);
787 786
788 if (sport) 787 if (sport)
789 uart_suspend_port(&mpc52xx_uart_driver, port); 788 uart_suspend_port(&mpc52xx_uart_driver, port);
@@ -792,9 +791,9 @@ mpc52xx_uart_suspend(struct device *dev, pm_message_t state)
792} 791}
793 792
794static int 793static int
795mpc52xx_uart_resume(struct device *dev) 794mpc52xx_uart_resume(struct platform_device *dev)
796{ 795{
797 struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); 796 struct uart_port *port = (struct uart_port *) platform_get_drvdata(dev);
798 797
799 if (port) 798 if (port)
800 uart_resume_port(&mpc52xx_uart_driver, port); 799 uart_resume_port(&mpc52xx_uart_driver, port);
@@ -803,15 +802,16 @@ mpc52xx_uart_resume(struct device *dev)
803} 802}
804#endif 803#endif
805 804
806static struct device_driver mpc52xx_uart_platform_driver = { 805static struct platform_driver mpc52xx_uart_platform_driver = {
807 .name = "mpc52xx-psc",
808 .bus = &platform_bus_type,
809 .probe = mpc52xx_uart_probe, 806 .probe = mpc52xx_uart_probe,
810 .remove = mpc52xx_uart_remove, 807 .remove = mpc52xx_uart_remove,
811#ifdef CONFIG_PM 808#ifdef CONFIG_PM
812 .suspend = mpc52xx_uart_suspend, 809 .suspend = mpc52xx_uart_suspend,
813 .resume = mpc52xx_uart_resume, 810 .resume = mpc52xx_uart_resume,
814#endif 811#endif
812 .driver = {
813 .name = "mpc52xx-psc",
814 },
815}; 815};
816 816
817 817
@@ -828,7 +828,7 @@ mpc52xx_uart_init(void)
828 828
829 ret = uart_register_driver(&mpc52xx_uart_driver); 829 ret = uart_register_driver(&mpc52xx_uart_driver);
830 if (ret == 0) { 830 if (ret == 0) {
831 ret = driver_register(&mpc52xx_uart_platform_driver); 831 ret = platform_driver_register(&mpc52xx_uart_platform_driver);
832 if (ret) 832 if (ret)
833 uart_unregister_driver(&mpc52xx_uart_driver); 833 uart_unregister_driver(&mpc52xx_uart_driver);
834 } 834 }
@@ -839,7 +839,7 @@ mpc52xx_uart_init(void)
839static void __exit 839static void __exit
840mpc52xx_uart_exit(void) 840mpc52xx_uart_exit(void)
841{ 841{
842 driver_unregister(&mpc52xx_uart_platform_driver); 842 platform_driver_unregister(&mpc52xx_uart_platform_driver);
843 uart_unregister_driver(&mpc52xx_uart_driver); 843 uart_unregister_driver(&mpc52xx_uart_driver);
844} 844}
845 845
diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c
index ba8838b234da..8f83e4007ecd 100644
--- a/drivers/serial/mpsc.c
+++ b/drivers/serial/mpsc.c
@@ -1551,15 +1551,14 @@ mpsc_shared_unmap_regs(void)
1551} 1551}
1552 1552
1553static int 1553static int
1554mpsc_shared_drv_probe(struct device *dev) 1554mpsc_shared_drv_probe(struct platform_device *dev)
1555{ 1555{
1556 struct platform_device *pd = to_platform_device(dev);
1557 struct mpsc_shared_pdata *pdata; 1556 struct mpsc_shared_pdata *pdata;
1558 int rc = -ENODEV; 1557 int rc = -ENODEV;
1559 1558
1560 if (pd->id == 0) { 1559 if (dev->id == 0) {
1561 if (!(rc = mpsc_shared_map_regs(pd))) { 1560 if (!(rc = mpsc_shared_map_regs(dev))) {
1562 pdata = (struct mpsc_shared_pdata *)dev->platform_data; 1561 pdata = (struct mpsc_shared_pdata *)dev->dev.platform_data;
1563 1562
1564 mpsc_shared_regs.MPSC_MRR_m = pdata->mrr_val; 1563 mpsc_shared_regs.MPSC_MRR_m = pdata->mrr_val;
1565 mpsc_shared_regs.MPSC_RCRR_m= pdata->rcrr_val; 1564 mpsc_shared_regs.MPSC_RCRR_m= pdata->rcrr_val;
@@ -1577,12 +1576,11 @@ mpsc_shared_drv_probe(struct device *dev)
1577} 1576}
1578 1577
1579static int 1578static int
1580mpsc_shared_drv_remove(struct device *dev) 1579mpsc_shared_drv_remove(struct platform_device *dev)
1581{ 1580{
1582 struct platform_device *pd = to_platform_device(dev);
1583 int rc = -ENODEV; 1581 int rc = -ENODEV;
1584 1582
1585 if (pd->id == 0) { 1583 if (dev->id == 0) {
1586 mpsc_shared_unmap_regs(); 1584 mpsc_shared_unmap_regs();
1587 mpsc_shared_regs.MPSC_MRR_m = 0; 1585 mpsc_shared_regs.MPSC_MRR_m = 0;
1588 mpsc_shared_regs.MPSC_RCRR_m = 0; 1586 mpsc_shared_regs.MPSC_RCRR_m = 0;
@@ -1595,11 +1593,12 @@ mpsc_shared_drv_remove(struct device *dev)
1595 return rc; 1593 return rc;
1596} 1594}
1597 1595
1598static struct device_driver mpsc_shared_driver = { 1596static struct platform_driver mpsc_shared_driver = {
1599 .name = MPSC_SHARED_NAME,
1600 .bus = &platform_bus_type,
1601 .probe = mpsc_shared_drv_probe, 1597 .probe = mpsc_shared_drv_probe,
1602 .remove = mpsc_shared_drv_remove, 1598 .remove = mpsc_shared_drv_remove,
1599 .driver = {
1600 .name = MPSC_SHARED_NAME,
1601 },
1603}; 1602};
1604 1603
1605/* 1604/*
@@ -1732,19 +1731,18 @@ mpsc_drv_get_platform_data(struct mpsc_port_info *pi,
1732} 1731}
1733 1732
1734static int 1733static int
1735mpsc_drv_probe(struct device *dev) 1734mpsc_drv_probe(struct platform_device *dev)
1736{ 1735{
1737 struct platform_device *pd = to_platform_device(dev);
1738 struct mpsc_port_info *pi; 1736 struct mpsc_port_info *pi;
1739 int rc = -ENODEV; 1737 int rc = -ENODEV;
1740 1738
1741 pr_debug("mpsc_drv_probe: Adding MPSC %d\n", pd->id); 1739 pr_debug("mpsc_drv_probe: Adding MPSC %d\n", dev->id);
1742 1740
1743 if (pd->id < MPSC_NUM_CTLRS) { 1741 if (dev->id < MPSC_NUM_CTLRS) {
1744 pi = &mpsc_ports[pd->id]; 1742 pi = &mpsc_ports[dev->id];
1745 1743
1746 if (!(rc = mpsc_drv_map_regs(pi, pd))) { 1744 if (!(rc = mpsc_drv_map_regs(pi, dev))) {
1747 mpsc_drv_get_platform_data(pi, pd, pd->id); 1745 mpsc_drv_get_platform_data(pi, dev, dev->id);
1748 1746
1749 if (!(rc = mpsc_make_ready(pi))) 1747 if (!(rc = mpsc_make_ready(pi)))
1750 if (!(rc = uart_add_one_port(&mpsc_reg, 1748 if (!(rc = uart_add_one_port(&mpsc_reg,
@@ -1764,27 +1762,26 @@ mpsc_drv_probe(struct device *dev)
1764} 1762}
1765 1763
1766static int 1764static int
1767mpsc_drv_remove(struct device *dev) 1765mpsc_drv_remove(struct platform_device *dev)
1768{ 1766{
1769 struct platform_device *pd = to_platform_device(dev); 1767 pr_debug("mpsc_drv_exit: Removing MPSC %d\n", dev->id);
1770 1768
1771 pr_debug("mpsc_drv_exit: Removing MPSC %d\n", pd->id); 1769 if (dev->id < MPSC_NUM_CTLRS) {
1772 1770 uart_remove_one_port(&mpsc_reg, &mpsc_ports[dev->id].port);
1773 if (pd->id < MPSC_NUM_CTLRS) { 1771 mpsc_release_port((struct uart_port *)&mpsc_ports[dev->id].port);
1774 uart_remove_one_port(&mpsc_reg, &mpsc_ports[pd->id].port); 1772 mpsc_drv_unmap_regs(&mpsc_ports[dev->id]);
1775 mpsc_release_port((struct uart_port *)&mpsc_ports[pd->id].port);
1776 mpsc_drv_unmap_regs(&mpsc_ports[pd->id]);
1777 return 0; 1773 return 0;
1778 } 1774 }
1779 else 1775 else
1780 return -ENODEV; 1776 return -ENODEV;
1781} 1777}
1782 1778
1783static struct device_driver mpsc_driver = { 1779static struct platform_driver mpsc_driver = {
1784 .name = MPSC_CTLR_NAME,
1785 .bus = &platform_bus_type,
1786 .probe = mpsc_drv_probe, 1780 .probe = mpsc_drv_probe,
1787 .remove = mpsc_drv_remove, 1781 .remove = mpsc_drv_remove,
1782 .driver = {
1783 .name = MPSC_CTLR_NAME,
1784 },
1788}; 1785};
1789 1786
1790static int __init 1787static int __init
@@ -1798,9 +1795,9 @@ mpsc_drv_init(void)
1798 memset(&mpsc_shared_regs, 0, sizeof(mpsc_shared_regs)); 1795 memset(&mpsc_shared_regs, 0, sizeof(mpsc_shared_regs));
1799 1796
1800 if (!(rc = uart_register_driver(&mpsc_reg))) { 1797 if (!(rc = uart_register_driver(&mpsc_reg))) {
1801 if (!(rc = driver_register(&mpsc_shared_driver))) { 1798 if (!(rc = platform_driver_register(&mpsc_shared_driver))) {
1802 if ((rc = driver_register(&mpsc_driver))) { 1799 if ((rc = platform_driver_register(&mpsc_driver))) {
1803 driver_unregister(&mpsc_shared_driver); 1800 platform_driver_unregister(&mpsc_shared_driver);
1804 uart_unregister_driver(&mpsc_reg); 1801 uart_unregister_driver(&mpsc_reg);
1805 } 1802 }
1806 } 1803 }
@@ -1815,8 +1812,8 @@ mpsc_drv_init(void)
1815static void __exit 1812static void __exit
1816mpsc_drv_exit(void) 1813mpsc_drv_exit(void)
1817{ 1814{
1818 driver_unregister(&mpsc_driver); 1815 platform_driver_unregister(&mpsc_driver);
1819 driver_unregister(&mpsc_shared_driver); 1816 platform_driver_unregister(&mpsc_shared_driver);
1820 uart_unregister_driver(&mpsc_reg); 1817 uart_unregister_driver(&mpsc_reg);
1821 memset(mpsc_ports, 0, sizeof(mpsc_ports)); 1818 memset(mpsc_ports, 0, sizeof(mpsc_ports));
1822 memset(&mpsc_shared_regs, 0, sizeof(mpsc_shared_regs)); 1819 memset(&mpsc_shared_regs, 0, sizeof(mpsc_shared_regs));
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c
index 16b2f9417af9..ff5e6309d682 100644
--- a/drivers/serial/pxa.c
+++ b/drivers/serial/pxa.c
@@ -805,9 +805,9 @@ static struct uart_driver serial_pxa_reg = {
805 .cons = PXA_CONSOLE, 805 .cons = PXA_CONSOLE,
806}; 806};
807 807
808static int serial_pxa_suspend(struct device *_dev, pm_message_t state) 808static int serial_pxa_suspend(struct platform_device *dev, pm_message_t state)
809{ 809{
810 struct uart_pxa_port *sport = dev_get_drvdata(_dev); 810 struct uart_pxa_port *sport = platform_get_drvdata(dev);
811 811
812 if (sport) 812 if (sport)
813 uart_suspend_port(&serial_pxa_reg, &sport->port); 813 uart_suspend_port(&serial_pxa_reg, &sport->port);
@@ -815,9 +815,9 @@ static int serial_pxa_suspend(struct device *_dev, pm_message_t state)
815 return 0; 815 return 0;
816} 816}
817 817
818static int serial_pxa_resume(struct device *_dev) 818static int serial_pxa_resume(struct platform_device *dev)
819{ 819{
820 struct uart_pxa_port *sport = dev_get_drvdata(_dev); 820 struct uart_pxa_port *sport = platform_get_drvdata(dev);
821 821
822 if (sport) 822 if (sport)
823 uart_resume_port(&serial_pxa_reg, &sport->port); 823 uart_resume_port(&serial_pxa_reg, &sport->port);
@@ -825,21 +825,19 @@ static int serial_pxa_resume(struct device *_dev)
825 return 0; 825 return 0;
826} 826}
827 827
828static int serial_pxa_probe(struct device *_dev) 828static int serial_pxa_probe(struct platform_device *dev)
829{ 829{
830 struct platform_device *dev = to_platform_device(_dev); 830 serial_pxa_ports[dev->id].port.dev = &dev->dev;
831
832 serial_pxa_ports[dev->id].port.dev = _dev;
833 uart_add_one_port(&serial_pxa_reg, &serial_pxa_ports[dev->id].port); 831 uart_add_one_port(&serial_pxa_reg, &serial_pxa_ports[dev->id].port);
834 dev_set_drvdata(_dev, &serial_pxa_ports[dev->id]); 832 platform_set_drvdata(dev, &serial_pxa_ports[dev->id]);
835 return 0; 833 return 0;
836} 834}
837 835
838static int serial_pxa_remove(struct device *_dev) 836static int serial_pxa_remove(struct platform_device *dev)
839{ 837{
840 struct uart_pxa_port *sport = dev_get_drvdata(_dev); 838 struct uart_pxa_port *sport = platform_get_drvdata(dev);
841 839
842 dev_set_drvdata(_dev, NULL); 840 platform_set_drvdata(dev, NULL);
843 841
844 if (sport) 842 if (sport)
845 uart_remove_one_port(&serial_pxa_reg, &sport->port); 843 uart_remove_one_port(&serial_pxa_reg, &sport->port);
@@ -847,14 +845,15 @@ static int serial_pxa_remove(struct device *_dev)
847 return 0; 845 return 0;
848} 846}
849 847
850static struct device_driver serial_pxa_driver = { 848static struct platform_driver serial_pxa_driver = {
851 .name = "pxa2xx-uart",
852 .bus = &platform_bus_type,
853 .probe = serial_pxa_probe, 849 .probe = serial_pxa_probe,
854 .remove = serial_pxa_remove, 850 .remove = serial_pxa_remove,
855 851
856 .suspend = serial_pxa_suspend, 852 .suspend = serial_pxa_suspend,
857 .resume = serial_pxa_resume, 853 .resume = serial_pxa_resume,
854 .driver = {
855 .name = "pxa2xx-uart",
856 },
858}; 857};
859 858
860int __init serial_pxa_init(void) 859int __init serial_pxa_init(void)
@@ -865,7 +864,7 @@ int __init serial_pxa_init(void)
865 if (ret != 0) 864 if (ret != 0)
866 return ret; 865 return ret;
867 866
868 ret = driver_register(&serial_pxa_driver); 867 ret = platform_driver_register(&serial_pxa_driver);
869 if (ret != 0) 868 if (ret != 0)
870 uart_unregister_driver(&serial_pxa_reg); 869 uart_unregister_driver(&serial_pxa_reg);
871 870
@@ -874,7 +873,7 @@ int __init serial_pxa_init(void)
874 873
875void __exit serial_pxa_exit(void) 874void __exit serial_pxa_exit(void)
876{ 875{
877 driver_unregister(&serial_pxa_driver); 876 platform_driver_unregister(&serial_pxa_driver);
878 uart_unregister_driver(&serial_pxa_reg); 877 uart_unregister_driver(&serial_pxa_reg);
879} 878}
880 879
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 036792328d49..47681c4654e4 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -1092,14 +1092,13 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
1092 1092
1093static int probe_index = 0; 1093static int probe_index = 0;
1094 1094
1095static int s3c24xx_serial_probe(struct device *_dev, 1095static int s3c24xx_serial_probe(struct platform_device *dev,
1096 struct s3c24xx_uart_info *info) 1096 struct s3c24xx_uart_info *info)
1097{ 1097{
1098 struct s3c24xx_uart_port *ourport; 1098 struct s3c24xx_uart_port *ourport;
1099 struct platform_device *dev = to_platform_device(_dev);
1100 int ret; 1099 int ret;
1101 1100
1102 dbg("s3c24xx_serial_probe(%p, %p) %d\n", _dev, info, probe_index); 1101 dbg("s3c24xx_serial_probe(%p, %p) %d\n", dev, info, probe_index);
1103 1102
1104 ourport = &s3c24xx_serial_ports[probe_index]; 1103 ourport = &s3c24xx_serial_ports[probe_index];
1105 probe_index++; 1104 probe_index++;
@@ -1112,7 +1111,7 @@ static int s3c24xx_serial_probe(struct device *_dev,
1112 1111
1113 dbg("%s: adding port\n", __FUNCTION__); 1112 dbg("%s: adding port\n", __FUNCTION__);
1114 uart_add_one_port(&s3c24xx_uart_drv, &ourport->port); 1113 uart_add_one_port(&s3c24xx_uart_drv, &ourport->port);
1115 dev_set_drvdata(_dev, &ourport->port); 1114 platform_set_drvdata(dev, &ourport->port);
1116 1115
1117 return 0; 1116 return 0;
1118 1117
@@ -1120,9 +1119,9 @@ static int s3c24xx_serial_probe(struct device *_dev,
1120 return ret; 1119 return ret;
1121} 1120}
1122 1121
1123static int s3c24xx_serial_remove(struct device *_dev) 1122static int s3c24xx_serial_remove(struct platform_device *dev)
1124{ 1123{
1125 struct uart_port *port = s3c24xx_dev_to_port(_dev); 1124 struct uart_port *port = s3c24xx_dev_to_port(&dev->dev);
1126 1125
1127 if (port) 1126 if (port)
1128 uart_remove_one_port(&s3c24xx_uart_drv, port); 1127 uart_remove_one_port(&s3c24xx_uart_drv, port);
@@ -1134,9 +1133,9 @@ static int s3c24xx_serial_remove(struct device *_dev)
1134 1133
1135#ifdef CONFIG_PM 1134#ifdef CONFIG_PM
1136 1135
1137static int s3c24xx_serial_suspend(struct device *dev, pm_message_t state) 1136static int s3c24xx_serial_suspend(struct platform_device *dev, pm_message_t state)
1138{ 1137{
1139 struct uart_port *port = s3c24xx_dev_to_port(dev); 1138 struct uart_port *port = s3c24xx_dev_to_port(&dev->dev);
1140 1139
1141 if (port) 1140 if (port)
1142 uart_suspend_port(&s3c24xx_uart_drv, port); 1141 uart_suspend_port(&s3c24xx_uart_drv, port);
@@ -1144,9 +1143,9 @@ static int s3c24xx_serial_suspend(struct device *dev, pm_message_t state)
1144 return 0; 1143 return 0;
1145} 1144}
1146 1145
1147static int s3c24xx_serial_resume(struct device *dev) 1146static int s3c24xx_serial_resume(struct platform_device *dev)
1148{ 1147{
1149 struct uart_port *port = s3c24xx_dev_to_port(dev); 1148 struct uart_port *port = s3c24xx_dev_to_port(&dev->dev);
1150 struct s3c24xx_uart_port *ourport = to_ourport(port); 1149 struct s3c24xx_uart_port *ourport = to_ourport(port);
1151 1150
1152 if (port) { 1151 if (port) {
@@ -1165,11 +1164,11 @@ static int s3c24xx_serial_resume(struct device *dev)
1165#define s3c24xx_serial_resume NULL 1164#define s3c24xx_serial_resume NULL
1166#endif 1165#endif
1167 1166
1168static int s3c24xx_serial_init(struct device_driver *drv, 1167static int s3c24xx_serial_init(struct platform_driver *drv,
1169 struct s3c24xx_uart_info *info) 1168 struct s3c24xx_uart_info *info)
1170{ 1169{
1171 dbg("s3c24xx_serial_init(%p,%p)\n", drv, info); 1170 dbg("s3c24xx_serial_init(%p,%p)\n", drv, info);
1172 return driver_register(drv); 1171 return platform_driver_register(drv);
1173} 1172}
1174 1173
1175 1174
@@ -1228,19 +1227,20 @@ static struct s3c24xx_uart_info s3c2400_uart_inf = {
1228 .reset_port = s3c2400_serial_resetport, 1227 .reset_port = s3c2400_serial_resetport,
1229}; 1228};
1230 1229
1231static int s3c2400_serial_probe(struct device *dev) 1230static int s3c2400_serial_probe(struct platform_device *dev)
1232{ 1231{
1233 return s3c24xx_serial_probe(dev, &s3c2400_uart_inf); 1232 return s3c24xx_serial_probe(dev, &s3c2400_uart_inf);
1234} 1233}
1235 1234
1236static struct device_driver s3c2400_serial_drv = { 1235static struct platform_driver s3c2400_serial_drv = {
1237 .name = "s3c2400-uart",
1238 .owner = THIS_MODULE,
1239 .bus = &platform_bus_type,
1240 .probe = s3c2400_serial_probe, 1236 .probe = s3c2400_serial_probe,
1241 .remove = s3c24xx_serial_remove, 1237 .remove = s3c24xx_serial_remove,
1242 .suspend = s3c24xx_serial_suspend, 1238 .suspend = s3c24xx_serial_suspend,
1243 .resume = s3c24xx_serial_resume, 1239 .resume = s3c24xx_serial_resume,
1240 .driver = {
1241 .name = "s3c2400-uart",
1242 .owner = THIS_MODULE,
1243 },
1244}; 1244};
1245 1245
1246static inline int s3c2400_serial_init(void) 1246static inline int s3c2400_serial_init(void)
@@ -1250,7 +1250,7 @@ static inline int s3c2400_serial_init(void)
1250 1250
1251static inline void s3c2400_serial_exit(void) 1251static inline void s3c2400_serial_exit(void)
1252{ 1252{
1253 driver_unregister(&s3c2400_serial_drv); 1253 platform_driver_unregister(&s3c2400_serial_drv);
1254} 1254}
1255 1255
1256#define s3c2400_uart_inf_at &s3c2400_uart_inf 1256#define s3c2400_uart_inf_at &s3c2400_uart_inf
@@ -1332,19 +1332,20 @@ static struct s3c24xx_uart_info s3c2410_uart_inf = {
1332 1332
1333/* device management */ 1333/* device management */
1334 1334
1335static int s3c2410_serial_probe(struct device *dev) 1335static int s3c2410_serial_probe(struct platform_device *dev)
1336{ 1336{
1337 return s3c24xx_serial_probe(dev, &s3c2410_uart_inf); 1337 return s3c24xx_serial_probe(dev, &s3c2410_uart_inf);
1338} 1338}
1339 1339
1340static struct device_driver s3c2410_serial_drv = { 1340static struct platform_driver s3c2410_serial_drv = {
1341 .name = "s3c2410-uart",
1342 .owner = THIS_MODULE,
1343 .bus = &platform_bus_type,
1344 .probe = s3c2410_serial_probe, 1341 .probe = s3c2410_serial_probe,
1345 .remove = s3c24xx_serial_remove, 1342 .remove = s3c24xx_serial_remove,
1346 .suspend = s3c24xx_serial_suspend, 1343 .suspend = s3c24xx_serial_suspend,
1347 .resume = s3c24xx_serial_resume, 1344 .resume = s3c24xx_serial_resume,
1345 .driver = {
1346 .name = "s3c2410-uart",
1347 .owner = THIS_MODULE,
1348 },
1348}; 1349};
1349 1350
1350static inline int s3c2410_serial_init(void) 1351static inline int s3c2410_serial_init(void)
@@ -1354,7 +1355,7 @@ static inline int s3c2410_serial_init(void)
1354 1355
1355static inline void s3c2410_serial_exit(void) 1356static inline void s3c2410_serial_exit(void)
1356{ 1357{
1357 driver_unregister(&s3c2410_serial_drv); 1358 platform_driver_unregister(&s3c2410_serial_drv);
1358} 1359}
1359 1360
1360#define s3c2410_uart_inf_at &s3c2410_uart_inf 1361#define s3c2410_uart_inf_at &s3c2410_uart_inf
@@ -1493,20 +1494,21 @@ static struct s3c24xx_uart_info s3c2440_uart_inf = {
1493 1494
1494/* device management */ 1495/* device management */
1495 1496
1496static int s3c2440_serial_probe(struct device *dev) 1497static int s3c2440_serial_probe(struct platform_device *dev)
1497{ 1498{
1498 dbg("s3c2440_serial_probe: dev=%p\n", dev); 1499 dbg("s3c2440_serial_probe: dev=%p\n", dev);
1499 return s3c24xx_serial_probe(dev, &s3c2440_uart_inf); 1500 return s3c24xx_serial_probe(dev, &s3c2440_uart_inf);
1500} 1501}
1501 1502
1502static struct device_driver s3c2440_serial_drv = { 1503static struct platform_driver s3c2440_serial_drv = {
1503 .name = "s3c2440-uart",
1504 .owner = THIS_MODULE,
1505 .bus = &platform_bus_type,
1506 .probe = s3c2440_serial_probe, 1504 .probe = s3c2440_serial_probe,
1507 .remove = s3c24xx_serial_remove, 1505 .remove = s3c24xx_serial_remove,
1508 .suspend = s3c24xx_serial_suspend, 1506 .suspend = s3c24xx_serial_suspend,
1509 .resume = s3c24xx_serial_resume, 1507 .resume = s3c24xx_serial_resume,
1508 .driver = {
1509 .name = "s3c2440-uart",
1510 .owner = THIS_MODULE,
1511 },
1510}; 1512};
1511 1513
1512 1514
@@ -1517,7 +1519,7 @@ static inline int s3c2440_serial_init(void)
1517 1519
1518static inline void s3c2440_serial_exit(void) 1520static inline void s3c2440_serial_exit(void)
1519{ 1521{
1520 driver_unregister(&s3c2440_serial_drv); 1522 platform_driver_unregister(&s3c2440_serial_drv);
1521} 1523}
1522 1524
1523#define s3c2440_uart_inf_at &s3c2440_uart_inf 1525#define s3c2440_uart_inf_at &s3c2440_uart_inf
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c
index ed618cc7ae96..fd9deee20e05 100644
--- a/drivers/serial/sa1100.c
+++ b/drivers/serial/sa1100.c
@@ -834,9 +834,9 @@ static struct uart_driver sa1100_reg = {
834 .cons = SA1100_CONSOLE, 834 .cons = SA1100_CONSOLE,
835}; 835};
836 836
837static int sa1100_serial_suspend(struct device *_dev, pm_message_t state) 837static int sa1100_serial_suspend(struct platform_device *dev, pm_message_t state)
838{ 838{
839 struct sa1100_port *sport = dev_get_drvdata(_dev); 839 struct sa1100_port *sport = platform_get_drvdata(dev);
840 840
841 if (sport) 841 if (sport)
842 uart_suspend_port(&sa1100_reg, &sport->port); 842 uart_suspend_port(&sa1100_reg, &sport->port);
@@ -844,9 +844,9 @@ static int sa1100_serial_suspend(struct device *_dev, pm_message_t state)
844 return 0; 844 return 0;
845} 845}
846 846
847static int sa1100_serial_resume(struct device *_dev) 847static int sa1100_serial_resume(struct platform_device *dev)
848{ 848{
849 struct sa1100_port *sport = dev_get_drvdata(_dev); 849 struct sa1100_port *sport = platform_get_drvdata(dev);
850 850
851 if (sport) 851 if (sport)
852 uart_resume_port(&sa1100_reg, &sport->port); 852 uart_resume_port(&sa1100_reg, &sport->port);
@@ -854,9 +854,8 @@ static int sa1100_serial_resume(struct device *_dev)
854 return 0; 854 return 0;
855} 855}
856 856
857static int sa1100_serial_probe(struct device *_dev) 857static int sa1100_serial_probe(struct platform_device *dev)
858{ 858{
859 struct platform_device *dev = to_platform_device(_dev);
860 struct resource *res = dev->resource; 859 struct resource *res = dev->resource;
861 int i; 860 int i;
862 861
@@ -869,9 +868,9 @@ static int sa1100_serial_probe(struct device *_dev)
869 if (sa1100_ports[i].port.mapbase != res->start) 868 if (sa1100_ports[i].port.mapbase != res->start)
870 continue; 869 continue;
871 870
872 sa1100_ports[i].port.dev = _dev; 871 sa1100_ports[i].port.dev = &dev->dev;
873 uart_add_one_port(&sa1100_reg, &sa1100_ports[i].port); 872 uart_add_one_port(&sa1100_reg, &sa1100_ports[i].port);
874 dev_set_drvdata(_dev, &sa1100_ports[i]); 873 platform_set_drvdata(dev, &sa1100_ports[i]);
875 break; 874 break;
876 } 875 }
877 } 876 }
@@ -879,11 +878,11 @@ static int sa1100_serial_probe(struct device *_dev)
879 return 0; 878 return 0;
880} 879}
881 880
882static int sa1100_serial_remove(struct device *_dev) 881static int sa1100_serial_remove(struct platform_device *pdev)
883{ 882{
884 struct sa1100_port *sport = dev_get_drvdata(_dev); 883 struct sa1100_port *sport = platform_get_drvdata(pdev);
885 884
886 dev_set_drvdata(_dev, NULL); 885 platform_set_drvdata(pdev, NULL);
887 886
888 if (sport) 887 if (sport)
889 uart_remove_one_port(&sa1100_reg, &sport->port); 888 uart_remove_one_port(&sa1100_reg, &sport->port);
@@ -891,13 +890,14 @@ static int sa1100_serial_remove(struct device *_dev)
891 return 0; 890 return 0;
892} 891}
893 892
894static struct device_driver sa11x0_serial_driver = { 893static struct platform_driver sa11x0_serial_driver = {
895 .name = "sa11x0-uart",
896 .bus = &platform_bus_type,
897 .probe = sa1100_serial_probe, 894 .probe = sa1100_serial_probe,
898 .remove = sa1100_serial_remove, 895 .remove = sa1100_serial_remove,
899 .suspend = sa1100_serial_suspend, 896 .suspend = sa1100_serial_suspend,
900 .resume = sa1100_serial_resume, 897 .resume = sa1100_serial_resume,
898 .driver = {
899 .name = "sa11x0-uart",
900 },
901}; 901};
902 902
903static int __init sa1100_serial_init(void) 903static int __init sa1100_serial_init(void)
@@ -910,7 +910,7 @@ static int __init sa1100_serial_init(void)
910 910
911 ret = uart_register_driver(&sa1100_reg); 911 ret = uart_register_driver(&sa1100_reg);
912 if (ret == 0) { 912 if (ret == 0) {
913 ret = driver_register(&sa11x0_serial_driver); 913 ret = platform_driver_register(&sa11x0_serial_driver);
914 if (ret) 914 if (ret)
915 uart_unregister_driver(&sa1100_reg); 915 uart_unregister_driver(&sa1100_reg);
916 } 916 }
@@ -919,7 +919,7 @@ static int __init sa1100_serial_init(void)
919 919
920static void __exit sa1100_serial_exit(void) 920static void __exit sa1100_serial_exit(void)
921{ 921{
922 driver_unregister(&sa11x0_serial_driver); 922 platform_driver_unregister(&sa11x0_serial_driver);
923 uart_unregister_driver(&sa1100_reg); 923 uart_unregister_driver(&sa1100_reg);
924} 924}
925 925
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c
index 01696b3e3f61..865d4dea65df 100644
--- a/drivers/serial/vr41xx_siu.c
+++ b/drivers/serial/vr41xx_siu.c
@@ -924,7 +924,7 @@ static struct uart_driver siu_uart_driver = {
924 .cons = SERIAL_VR41XX_CONSOLE, 924 .cons = SERIAL_VR41XX_CONSOLE,
925}; 925};
926 926
927static int siu_probe(struct device *dev) 927static int siu_probe(struct platform_device *dev)
928{ 928{
929 struct uart_port *port; 929 struct uart_port *port;
930 int num, i, retval; 930 int num, i, retval;
@@ -941,7 +941,7 @@ static int siu_probe(struct device *dev)
941 for (i = 0; i < num; i++) { 941 for (i = 0; i < num; i++) {
942 port = &siu_uart_ports[i]; 942 port = &siu_uart_ports[i];
943 port->ops = &siu_uart_ops; 943 port->ops = &siu_uart_ops;
944 port->dev = dev; 944 port->dev = &dev->dev;
945 945
946 retval = uart_add_one_port(&siu_uart_driver, port); 946 retval = uart_add_one_port(&siu_uart_driver, port);
947 if (retval < 0) { 947 if (retval < 0) {
@@ -958,14 +958,14 @@ static int siu_probe(struct device *dev)
958 return 0; 958 return 0;
959} 959}
960 960
961static int siu_remove(struct device *dev) 961static int siu_remove(struct platform_device *dev)
962{ 962{
963 struct uart_port *port; 963 struct uart_port *port;
964 int i; 964 int i;
965 965
966 for (i = 0; i < siu_uart_driver.nr; i++) { 966 for (i = 0; i < siu_uart_driver.nr; i++) {
967 port = &siu_uart_ports[i]; 967 port = &siu_uart_ports[i];
968 if (port->dev == dev) { 968 if (port->dev == &dev->dev) {
969 uart_remove_one_port(&siu_uart_driver, port); 969 uart_remove_one_port(&siu_uart_driver, port);
970 port->dev = NULL; 970 port->dev = NULL;
971 } 971 }
@@ -976,7 +976,7 @@ static int siu_remove(struct device *dev)
976 return 0; 976 return 0;
977} 977}
978 978
979static int siu_suspend(struct device *dev, pm_message_t state) 979static int siu_suspend(struct platform_device *dev, pm_message_t state)
980{ 980{
981 struct uart_port *port; 981 struct uart_port *port;
982 int i; 982 int i;
@@ -984,7 +984,7 @@ static int siu_suspend(struct device *dev, pm_message_t state)
984 for (i = 0; i < siu_uart_driver.nr; i++) { 984 for (i = 0; i < siu_uart_driver.nr; i++) {
985 port = &siu_uart_ports[i]; 985 port = &siu_uart_ports[i];
986 if ((port->type == PORT_VR41XX_SIU || 986 if ((port->type == PORT_VR41XX_SIU ||
987 port->type == PORT_VR41XX_DSIU) && port->dev == dev) 987 port->type == PORT_VR41XX_DSIU) && port->dev == &dev->dev)
988 uart_suspend_port(&siu_uart_driver, port); 988 uart_suspend_port(&siu_uart_driver, port);
989 989
990 } 990 }
@@ -992,7 +992,7 @@ static int siu_suspend(struct device *dev, pm_message_t state)
992 return 0; 992 return 0;
993} 993}
994 994
995static int siu_resume(struct device *dev) 995static int siu_resume(struct platform_device *dev)
996{ 996{
997 struct uart_port *port; 997 struct uart_port *port;
998 int i; 998 int i;
@@ -1000,7 +1000,7 @@ static int siu_resume(struct device *dev)
1000 for (i = 0; i < siu_uart_driver.nr; i++) { 1000 for (i = 0; i < siu_uart_driver.nr; i++) {
1001 port = &siu_uart_ports[i]; 1001 port = &siu_uart_ports[i];
1002 if ((port->type == PORT_VR41XX_SIU || 1002 if ((port->type == PORT_VR41XX_SIU ||
1003 port->type == PORT_VR41XX_DSIU) && port->dev == dev) 1003 port->type == PORT_VR41XX_DSIU) && port->dev == &dev->dev)
1004 uart_resume_port(&siu_uart_driver, port); 1004 uart_resume_port(&siu_uart_driver, port);
1005 } 1005 }
1006 1006
@@ -1009,13 +1009,14 @@ static int siu_resume(struct device *dev)
1009 1009
1010static struct platform_device *siu_platform_device; 1010static struct platform_device *siu_platform_device;
1011 1011
1012static struct device_driver siu_device_driver = { 1012static struct platform_driver siu_device_driver = {
1013 .name = "SIU",
1014 .bus = &platform_bus_type,
1015 .probe = siu_probe, 1013 .probe = siu_probe,
1016 .remove = siu_remove, 1014 .remove = siu_remove,
1017 .suspend = siu_suspend, 1015 .suspend = siu_suspend,
1018 .resume = siu_resume, 1016 .resume = siu_resume,
1017 .driver = {
1018 .name = "SIU",
1019 },
1019}; 1020};
1020 1021
1021static int __devinit vr41xx_siu_init(void) 1022static int __devinit vr41xx_siu_init(void)
@@ -1026,7 +1027,7 @@ static int __devinit vr41xx_siu_init(void)
1026 if (IS_ERR(siu_platform_device)) 1027 if (IS_ERR(siu_platform_device))
1027 return PTR_ERR(siu_platform_device); 1028 return PTR_ERR(siu_platform_device);
1028 1029
1029 retval = driver_register(&siu_device_driver); 1030 retval = platform_driver_register(&siu_device_driver);
1030 if (retval < 0) 1031 if (retval < 0)
1031 platform_device_unregister(siu_platform_device); 1032 platform_device_unregister(siu_platform_device);
1032 1033
@@ -1035,7 +1036,7 @@ static int __devinit vr41xx_siu_init(void)
1035 1036
1036static void __devexit vr41xx_siu_exit(void) 1037static void __devexit vr41xx_siu_exit(void)
1037{ 1038{
1038 driver_unregister(&siu_device_driver); 1039 platform_driver_unregister(&siu_device_driver);
1039 1040
1040 platform_device_unregister(siu_platform_device); 1041 platform_device_unregister(siu_platform_device);
1041} 1042}
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 904519085334..1e407745c115 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -896,7 +896,7 @@ dummy_gadget_release (struct device *dev)
896#endif 896#endif
897} 897}
898 898
899static int dummy_udc_probe (struct device *dev) 899static int dummy_udc_probe (struct platform_device *dev)
900{ 900{
901 struct dummy *dum = the_controller; 901 struct dummy *dum = the_controller;
902 int rc; 902 int rc;
@@ -909,7 +909,7 @@ static int dummy_udc_probe (struct device *dev)
909 dum->gadget.is_otg = (dummy_to_hcd(dum)->self.otg_port != 0); 909 dum->gadget.is_otg = (dummy_to_hcd(dum)->self.otg_port != 0);
910 910
911 strcpy (dum->gadget.dev.bus_id, "gadget"); 911 strcpy (dum->gadget.dev.bus_id, "gadget");
912 dum->gadget.dev.parent = dev; 912 dum->gadget.dev.parent = &dev->dev;
913 dum->gadget.dev.release = dummy_gadget_release; 913 dum->gadget.dev.release = dummy_gadget_release;
914 rc = device_register (&dum->gadget.dev); 914 rc = device_register (&dum->gadget.dev);
915 if (rc < 0) 915 if (rc < 0)
@@ -919,26 +919,26 @@ static int dummy_udc_probe (struct device *dev)
919 usb_bus_get (&dummy_to_hcd (dum)->self); 919 usb_bus_get (&dummy_to_hcd (dum)->self);
920#endif 920#endif
921 921
922 dev_set_drvdata (dev, dum); 922 platform_set_drvdata (dev, dum);
923 device_create_file (&dum->gadget.dev, &dev_attr_function); 923 device_create_file (&dum->gadget.dev, &dev_attr_function);
924 return rc; 924 return rc;
925} 925}
926 926
927static int dummy_udc_remove (struct device *dev) 927static int dummy_udc_remove (struct platform_device *dev)
928{ 928{
929 struct dummy *dum = dev_get_drvdata (dev); 929 struct dummy *dum = platform_get_drvdata (dev);
930 930
931 dev_set_drvdata (dev, NULL); 931 platform_set_drvdata (dev, NULL);
932 device_remove_file (&dum->gadget.dev, &dev_attr_function); 932 device_remove_file (&dum->gadget.dev, &dev_attr_function);
933 device_unregister (&dum->gadget.dev); 933 device_unregister (&dum->gadget.dev);
934 return 0; 934 return 0;
935} 935}
936 936
937static int dummy_udc_suspend (struct device *dev, pm_message_t state) 937static int dummy_udc_suspend (struct platform_device *dev, pm_message_t state)
938{ 938{
939 struct dummy *dum = dev_get_drvdata(dev); 939 struct dummy *dum = platform_get_drvdata(dev);
940 940
941 dev_dbg (dev, "%s\n", __FUNCTION__); 941 dev_dbg (&dev->dev, "%s\n", __FUNCTION__);
942 spin_lock_irq (&dum->lock); 942 spin_lock_irq (&dum->lock);
943 dum->udc_suspended = 1; 943 dum->udc_suspended = 1;
944 set_link_state (dum); 944 set_link_state (dum);
@@ -949,29 +949,30 @@ static int dummy_udc_suspend (struct device *dev, pm_message_t state)
949 return 0; 949 return 0;
950} 950}
951 951
952static int dummy_udc_resume (struct device *dev) 952static int dummy_udc_resume (struct platform_device *dev)
953{ 953{
954 struct dummy *dum = dev_get_drvdata(dev); 954 struct dummy *dum = platform_get_drvdata(dev);
955 955
956 dev_dbg (dev, "%s\n", __FUNCTION__); 956 dev_dbg (&dev->dev, "%s\n", __FUNCTION__);
957 spin_lock_irq (&dum->lock); 957 spin_lock_irq (&dum->lock);
958 dum->udc_suspended = 0; 958 dum->udc_suspended = 0;
959 set_link_state (dum); 959 set_link_state (dum);
960 spin_unlock_irq (&dum->lock); 960 spin_unlock_irq (&dum->lock);
961 961
962 dev->power.power_state = PMSG_ON; 962 dev->dev.power.power_state = PMSG_ON;
963 usb_hcd_poll_rh_status (dummy_to_hcd (dum)); 963 usb_hcd_poll_rh_status (dummy_to_hcd (dum));
964 return 0; 964 return 0;
965} 965}
966 966
967static struct device_driver dummy_udc_driver = { 967static struct platform_driver dummy_udc_driver = {
968 .name = (char *) gadget_name,
969 .owner = THIS_MODULE,
970 .bus = &platform_bus_type,
971 .probe = dummy_udc_probe, 968 .probe = dummy_udc_probe,
972 .remove = dummy_udc_remove, 969 .remove = dummy_udc_remove,
973 .suspend = dummy_udc_suspend, 970 .suspend = dummy_udc_suspend,
974 .resume = dummy_udc_resume, 971 .resume = dummy_udc_resume,
972 .driver = {
973 .name = (char *) gadget_name,
974 .owner = THIS_MODULE,
975 },
975}; 976};
976 977
977/*-------------------------------------------------------------------------*/ 978/*-------------------------------------------------------------------------*/
@@ -1898,14 +1899,14 @@ static const struct hc_driver dummy_hcd = {
1898 .bus_resume = dummy_bus_resume, 1899 .bus_resume = dummy_bus_resume,
1899}; 1900};
1900 1901
1901static int dummy_hcd_probe (struct device *dev) 1902static int dummy_hcd_probe (struct platform_device *dev)
1902{ 1903{
1903 struct usb_hcd *hcd; 1904 struct usb_hcd *hcd;
1904 int retval; 1905 int retval;
1905 1906
1906 dev_info (dev, "%s, driver " DRIVER_VERSION "\n", driver_desc); 1907 dev_info (dev, "%s, driver " DRIVER_VERSION "\n", driver_desc);
1907 1908
1908 hcd = usb_create_hcd (&dummy_hcd, dev, dev->bus_id); 1909 hcd = usb_create_hcd (&dummy_hcd, &dev->dev, dev->dev.bus_id);
1909 if (!hcd) 1910 if (!hcd)
1910 return -ENOMEM; 1911 return -ENOMEM;
1911 the_controller = hcd_to_dummy (hcd); 1912 the_controller = hcd_to_dummy (hcd);
@@ -1918,48 +1919,49 @@ static int dummy_hcd_probe (struct device *dev)
1918 return retval; 1919 return retval;
1919} 1920}
1920 1921
1921static int dummy_hcd_remove (struct device *dev) 1922static int dummy_hcd_remove (struct platform_device *dev)
1922{ 1923{
1923 struct usb_hcd *hcd; 1924 struct usb_hcd *hcd;
1924 1925
1925 hcd = dev_get_drvdata (dev); 1926 hcd = platform_get_drvdata (dev);
1926 usb_remove_hcd (hcd); 1927 usb_remove_hcd (hcd);
1927 usb_put_hcd (hcd); 1928 usb_put_hcd (hcd);
1928 the_controller = NULL; 1929 the_controller = NULL;
1929 return 0; 1930 return 0;
1930} 1931}
1931 1932
1932static int dummy_hcd_suspend (struct device *dev, pm_message_t state) 1933static int dummy_hcd_suspend (struct platform_device *dev, pm_message_t state)
1933{ 1934{
1934 struct usb_hcd *hcd; 1935 struct usb_hcd *hcd;
1935 1936
1936 dev_dbg (dev, "%s\n", __FUNCTION__); 1937 dev_dbg (&dev->dev, "%s\n", __FUNCTION__);
1937 hcd = dev_get_drvdata (dev); 1938 hcd = platform_get_drvdata (dev);
1938 1939
1939 hcd->state = HC_STATE_SUSPENDED; 1940 hcd->state = HC_STATE_SUSPENDED;
1940 return 0; 1941 return 0;
1941} 1942}
1942 1943
1943static int dummy_hcd_resume (struct device *dev) 1944static int dummy_hcd_resume (struct platform_device *dev)
1944{ 1945{
1945 struct usb_hcd *hcd; 1946 struct usb_hcd *hcd;
1946 1947
1947 dev_dbg (dev, "%s\n", __FUNCTION__); 1948 dev_dbg (&dev->dev, "%s\n", __FUNCTION__);
1948 hcd = dev_get_drvdata (dev); 1949 hcd = platform_get_drvdata (dev);
1949 hcd->state = HC_STATE_RUNNING; 1950 hcd->state = HC_STATE_RUNNING;
1950 1951
1951 usb_hcd_poll_rh_status (hcd); 1952 usb_hcd_poll_rh_status (hcd);
1952 return 0; 1953 return 0;
1953} 1954}
1954 1955
1955static struct device_driver dummy_hcd_driver = { 1956static struct platform_driver dummy_hcd_driver = {
1956 .name = (char *) driver_name,
1957 .owner = THIS_MODULE,
1958 .bus = &platform_bus_type,
1959 .probe = dummy_hcd_probe, 1957 .probe = dummy_hcd_probe,
1960 .remove = dummy_hcd_remove, 1958 .remove = dummy_hcd_remove,
1961 .suspend = dummy_hcd_suspend, 1959 .suspend = dummy_hcd_suspend,
1962 .resume = dummy_hcd_resume, 1960 .resume = dummy_hcd_resume,
1961 .driver = {
1962 .name = (char *) driver_name,
1963 .owner = THIS_MODULE,
1964 },
1963}; 1965};
1964 1966
1965/*-------------------------------------------------------------------------*/ 1967/*-------------------------------------------------------------------------*/
@@ -1995,11 +1997,11 @@ static int __init init (void)
1995 if (usb_disabled ()) 1997 if (usb_disabled ())
1996 return -ENODEV; 1998 return -ENODEV;
1997 1999
1998 retval = driver_register (&dummy_hcd_driver); 2000 retval = platform_driver_register (&dummy_hcd_driver);
1999 if (retval < 0) 2001 if (retval < 0)
2000 return retval; 2002 return retval;
2001 2003
2002 retval = driver_register (&dummy_udc_driver); 2004 retval = platform_driver_register (&dummy_udc_driver);
2003 if (retval < 0) 2005 if (retval < 0)
2004 goto err_register_udc_driver; 2006 goto err_register_udc_driver;
2005 2007
@@ -2015,9 +2017,9 @@ static int __init init (void)
2015err_register_udc: 2017err_register_udc:
2016 platform_device_unregister (&the_hcd_pdev); 2018 platform_device_unregister (&the_hcd_pdev);
2017err_register_hcd: 2019err_register_hcd:
2018 driver_unregister (&dummy_udc_driver); 2020 platform_driver_unregister (&dummy_udc_driver);
2019err_register_udc_driver: 2021err_register_udc_driver:
2020 driver_unregister (&dummy_hcd_driver); 2022 platform_driver_unregister (&dummy_hcd_driver);
2021 return retval; 2023 return retval;
2022} 2024}
2023module_init (init); 2025module_init (init);
@@ -2026,7 +2028,7 @@ static void __exit cleanup (void)
2026{ 2028{
2027 platform_device_unregister (&the_udc_pdev); 2029 platform_device_unregister (&the_udc_pdev);
2028 platform_device_unregister (&the_hcd_pdev); 2030 platform_device_unregister (&the_hcd_pdev);
2029 driver_unregister (&dummy_udc_driver); 2031 platform_driver_unregister (&dummy_udc_driver);
2030 driver_unregister (&dummy_hcd_driver); 2032 platform_driver_unregister (&dummy_hcd_driver);
2031} 2033}
2032module_exit (cleanup); 2034module_exit (cleanup);
diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c
index bc6269f10cbb..e02fea5a5433 100644
--- a/drivers/usb/gadget/lh7a40x_udc.c
+++ b/drivers/usb/gadget/lh7a40x_udc.c
@@ -2085,21 +2085,21 @@ static struct lh7a40x_udc memory = {
2085/* 2085/*
2086 * probe - binds to the platform device 2086 * probe - binds to the platform device
2087 */ 2087 */
2088static int lh7a40x_udc_probe(struct device *_dev) 2088static int lh7a40x_udc_probe(struct platform_device *pdev)
2089{ 2089{
2090 struct lh7a40x_udc *dev = &memory; 2090 struct lh7a40x_udc *dev = &memory;
2091 int retval; 2091 int retval;
2092 2092
2093 DEBUG("%s: %p\n", __FUNCTION__, _dev); 2093 DEBUG("%s: %p\n", __FUNCTION__, pdev);
2094 2094
2095 spin_lock_init(&dev->lock); 2095 spin_lock_init(&dev->lock);
2096 dev->dev = _dev; 2096 dev->dev = &pdev->dev;
2097 2097
2098 device_initialize(&dev->gadget.dev); 2098 device_initialize(&dev->gadget.dev);
2099 dev->gadget.dev.parent = _dev; 2099 dev->gadget.dev.parent = &pdev->dev;
2100 2100
2101 the_controller = dev; 2101 the_controller = dev;
2102 dev_set_drvdata(_dev, dev); 2102 platform_set_drvdata(pdev, dev);
2103 2103
2104 udc_disable(dev); 2104 udc_disable(dev);
2105 udc_reinit(dev); 2105 udc_reinit(dev);
@@ -2119,11 +2119,11 @@ static int lh7a40x_udc_probe(struct device *_dev)
2119 return retval; 2119 return retval;
2120} 2120}
2121 2121
2122static int lh7a40x_udc_remove(struct device *_dev) 2122static int lh7a40x_udc_remove(struct platform_device *pdev)
2123{ 2123{
2124 struct lh7a40x_udc *dev = _dev->driver_data; 2124 struct lh7a40x_udc *dev = platform_get_drvdata(pdev);
2125 2125
2126 DEBUG("%s: %p\n", __FUNCTION__, dev); 2126 DEBUG("%s: %p\n", __FUNCTION__, pdev);
2127 2127
2128 udc_disable(dev); 2128 udc_disable(dev);
2129 remove_proc_files(); 2129 remove_proc_files();
@@ -2131,7 +2131,7 @@ static int lh7a40x_udc_remove(struct device *_dev)
2131 2131
2132 free_irq(IRQ_USBINTR, dev); 2132 free_irq(IRQ_USBINTR, dev);
2133 2133
2134 dev_set_drvdata(_dev, 0); 2134 platform_set_drvdata(pdev, 0);
2135 2135
2136 the_controller = 0; 2136 the_controller = 0;
2137 2137
@@ -2140,26 +2140,27 @@ static int lh7a40x_udc_remove(struct device *_dev)
2140 2140
2141/*-------------------------------------------------------------------------*/ 2141/*-------------------------------------------------------------------------*/
2142 2142
2143static struct device_driver udc_driver = { 2143static struct platform_driver udc_driver = {
2144 .name = (char *)driver_name,
2145 .owner = THIS_MODULE,
2146 .bus = &platform_bus_type,
2147 .probe = lh7a40x_udc_probe, 2144 .probe = lh7a40x_udc_probe,
2148 .remove = lh7a40x_udc_remove 2145 .remove = lh7a40x_udc_remove
2149 /* FIXME power management support */ 2146 /* FIXME power management support */
2150 /* .suspend = ... disable UDC */ 2147 /* .suspend = ... disable UDC */
2151 /* .resume = ... re-enable UDC */ 2148 /* .resume = ... re-enable UDC */
2149 .driver = {
2150 .name = (char *)driver_name,
2151 .owner = THIS_MODULE,
2152 },
2152}; 2153};
2153 2154
2154static int __init udc_init(void) 2155static int __init udc_init(void)
2155{ 2156{
2156 DEBUG("%s: %s version %s\n", __FUNCTION__, driver_name, DRIVER_VERSION); 2157 DEBUG("%s: %s version %s\n", __FUNCTION__, driver_name, DRIVER_VERSION);
2157 return driver_register(&udc_driver); 2158 return platform_driver_register(&udc_driver);
2158} 2159}
2159 2160
2160static void __exit udc_exit(void) 2161static void __exit udc_exit(void)
2161{ 2162{
2162 driver_unregister(&udc_driver); 2163 platform_driver_unregister(&udc_driver);
2163} 2164}
2164 2165
2165module_init(udc_init); 2166module_init(udc_init);
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index 387692a3611e..a8972d7c97be 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -2707,18 +2707,17 @@ omap_udc_setup(struct platform_device *odev, struct otg_transceiver *xceiv)
2707 return 0; 2707 return 0;
2708} 2708}
2709 2709
2710static int __init omap_udc_probe(struct device *dev) 2710static int __init omap_udc_probe(struct platform_device *pdev)
2711{ 2711{
2712 struct platform_device *odev = to_platform_device(dev);
2713 int status = -ENODEV; 2712 int status = -ENODEV;
2714 int hmc; 2713 int hmc;
2715 struct otg_transceiver *xceiv = NULL; 2714 struct otg_transceiver *xceiv = NULL;
2716 const char *type = NULL; 2715 const char *type = NULL;
2717 struct omap_usb_config *config = dev->platform_data; 2716 struct omap_usb_config *config = pdev->dev.platform_data;
2718 2717
2719 /* NOTE: "knows" the order of the resources! */ 2718 /* NOTE: "knows" the order of the resources! */
2720 if (!request_mem_region(odev->resource[0].start, 2719 if (!request_mem_region(pdev->resource[0].start,
2721 odev->resource[0].end - odev->resource[0].start + 1, 2720 pdev->resource[0].end - pdev->resource[0].start + 1,
2722 driver_name)) { 2721 driver_name)) {
2723 DBG("request_mem_region failed\n"); 2722 DBG("request_mem_region failed\n");
2724 return -EBUSY; 2723 return -EBUSY;
@@ -2803,7 +2802,7 @@ bad_on_1710:
2803 INFO("hmc mode %d, %s transceiver\n", hmc, type); 2802 INFO("hmc mode %d, %s transceiver\n", hmc, type);
2804 2803
2805 /* a "gadget" abstracts/virtualizes the controller */ 2804 /* a "gadget" abstracts/virtualizes the controller */
2806 status = omap_udc_setup(odev, xceiv); 2805 status = omap_udc_setup(pdev, xceiv);
2807 if (status) { 2806 if (status) {
2808 goto cleanup0; 2807 goto cleanup0;
2809 } 2808 }
@@ -2821,28 +2820,28 @@ bad_on_1710:
2821 udc->clr_halt = UDC_RESET_EP; 2820 udc->clr_halt = UDC_RESET_EP;
2822 2821
2823 /* USB general purpose IRQ: ep0, state changes, dma, etc */ 2822 /* USB general purpose IRQ: ep0, state changes, dma, etc */
2824 status = request_irq(odev->resource[1].start, omap_udc_irq, 2823 status = request_irq(pdev->resource[1].start, omap_udc_irq,
2825 SA_SAMPLE_RANDOM, driver_name, udc); 2824 SA_SAMPLE_RANDOM, driver_name, udc);
2826 if (status != 0) { 2825 if (status != 0) {
2827 ERR( "can't get irq %ld, err %d\n", 2826 ERR( "can't get irq %ld, err %d\n",
2828 odev->resource[1].start, status); 2827 pdev->resource[1].start, status);
2829 goto cleanup1; 2828 goto cleanup1;
2830 } 2829 }
2831 2830
2832 /* USB "non-iso" IRQ (PIO for all but ep0) */ 2831 /* USB "non-iso" IRQ (PIO for all but ep0) */
2833 status = request_irq(odev->resource[2].start, omap_udc_pio_irq, 2832 status = request_irq(pdev->resource[2].start, omap_udc_pio_irq,
2834 SA_SAMPLE_RANDOM, "omap_udc pio", udc); 2833 SA_SAMPLE_RANDOM, "omap_udc pio", udc);
2835 if (status != 0) { 2834 if (status != 0) {
2836 ERR( "can't get irq %ld, err %d\n", 2835 ERR( "can't get irq %ld, err %d\n",
2837 odev->resource[2].start, status); 2836 pdev->resource[2].start, status);
2838 goto cleanup2; 2837 goto cleanup2;
2839 } 2838 }
2840#ifdef USE_ISO 2839#ifdef USE_ISO
2841 status = request_irq(odev->resource[3].start, omap_udc_iso_irq, 2840 status = request_irq(pdev->resource[3].start, omap_udc_iso_irq,
2842 SA_INTERRUPT, "omap_udc iso", udc); 2841 SA_INTERRUPT, "omap_udc iso", udc);
2843 if (status != 0) { 2842 if (status != 0) {
2844 ERR("can't get irq %ld, err %d\n", 2843 ERR("can't get irq %ld, err %d\n",
2845 odev->resource[3].start, status); 2844 pdev->resource[3].start, status);
2846 goto cleanup3; 2845 goto cleanup3;
2847 } 2846 }
2848#endif 2847#endif
@@ -2853,11 +2852,11 @@ bad_on_1710:
2853 2852
2854#ifdef USE_ISO 2853#ifdef USE_ISO
2855cleanup3: 2854cleanup3:
2856 free_irq(odev->resource[2].start, udc); 2855 free_irq(pdev->resource[2].start, udc);
2857#endif 2856#endif
2858 2857
2859cleanup2: 2858cleanup2:
2860 free_irq(odev->resource[1].start, udc); 2859 free_irq(pdev->resource[1].start, udc);
2861 2860
2862cleanup1: 2861cleanup1:
2863 kfree (udc); 2862 kfree (udc);
@@ -2866,14 +2865,13 @@ cleanup1:
2866cleanup0: 2865cleanup0:
2867 if (xceiv) 2866 if (xceiv)
2868 put_device(xceiv->dev); 2867 put_device(xceiv->dev);
2869 release_mem_region(odev->resource[0].start, 2868 release_mem_region(pdev->resource[0].start,
2870 odev->resource[0].end - odev->resource[0].start + 1); 2869 pdev->resource[0].end - pdev->resource[0].start + 1);
2871 return status; 2870 return status;
2872} 2871}
2873 2872
2874static int __exit omap_udc_remove(struct device *dev) 2873static int __exit omap_udc_remove(struct platform_device *pdev)
2875{ 2874{
2876 struct platform_device *odev = to_platform_device(dev);
2877 DECLARE_COMPLETION(done); 2875 DECLARE_COMPLETION(done);
2878 2876
2879 if (!udc) 2877 if (!udc)
@@ -2891,13 +2889,13 @@ static int __exit omap_udc_remove(struct device *dev)
2891 remove_proc_file(); 2889 remove_proc_file();
2892 2890
2893#ifdef USE_ISO 2891#ifdef USE_ISO
2894 free_irq(odev->resource[3].start, udc); 2892 free_irq(pdev->resource[3].start, udc);
2895#endif 2893#endif
2896 free_irq(odev->resource[2].start, udc); 2894 free_irq(pdev->resource[2].start, udc);
2897 free_irq(odev->resource[1].start, udc); 2895 free_irq(pdev->resource[1].start, udc);
2898 2896
2899 release_mem_region(odev->resource[0].start, 2897 release_mem_region(pdev->resource[0].start,
2900 odev->resource[0].end - odev->resource[0].start + 1); 2898 pdev->resource[0].end - pdev->resource[0].start + 1);
2901 2899
2902 device_unregister(&udc->gadget.dev); 2900 device_unregister(&udc->gadget.dev);
2903 wait_for_completion(&done); 2901 wait_for_completion(&done);
@@ -2915,7 +2913,7 @@ static int __exit omap_udc_remove(struct device *dev)
2915 * may involve talking to an external transceiver (e.g. isp1301). 2913 * may involve talking to an external transceiver (e.g. isp1301).
2916 */ 2914 */
2917 2915
2918static int omap_udc_suspend(struct device *dev, pm_message_t message) 2916static int omap_udc_suspend(struct platform_device *dev, pm_message_t message)
2919{ 2917{
2920 u32 devstat; 2918 u32 devstat;
2921 2919
@@ -2935,7 +2933,7 @@ static int omap_udc_suspend(struct device *dev, pm_message_t message)
2935 return 0; 2933 return 0;
2936} 2934}
2937 2935
2938static int omap_udc_resume(struct device *dev) 2936static int omap_udc_resume(struct platform_device *dev)
2939{ 2937{
2940 DBG("resume + wakeup/SRP\n"); 2938 DBG("resume + wakeup/SRP\n");
2941 omap_pullup(&udc->gadget, 1); 2939 omap_pullup(&udc->gadget, 1);
@@ -2947,14 +2945,15 @@ static int omap_udc_resume(struct device *dev)
2947 2945
2948/*-------------------------------------------------------------------------*/ 2946/*-------------------------------------------------------------------------*/
2949 2947
2950static struct device_driver udc_driver = { 2948static struct platform_driver udc_driver = {
2951 .name = (char *) driver_name,
2952 .owner = THIS_MODULE,
2953 .bus = &platform_bus_type,
2954 .probe = omap_udc_probe, 2949 .probe = omap_udc_probe,
2955 .remove = __exit_p(omap_udc_remove), 2950 .remove = __exit_p(omap_udc_remove),
2956 .suspend = omap_udc_suspend, 2951 .suspend = omap_udc_suspend,
2957 .resume = omap_udc_resume, 2952 .resume = omap_udc_resume,
2953 .driver = {
2954 .owner = THIS_MODULE,
2955 .name = (char *) driver_name,
2956 },
2958}; 2957};
2959 2958
2960static int __init udc_init(void) 2959static int __init udc_init(void)
@@ -2965,13 +2964,13 @@ static int __init udc_init(void)
2965#endif 2964#endif
2966 "%s\n", driver_desc, 2965 "%s\n", driver_desc,
2967 use_dma ? " (dma)" : ""); 2966 use_dma ? " (dma)" : "");
2968 return driver_register(&udc_driver); 2967 return platform_driver_register(&udc_driver);
2969} 2968}
2970module_init(udc_init); 2969module_init(udc_init);
2971 2970
2972static void __exit udc_exit(void) 2971static void __exit udc_exit(void)
2973{ 2972{
2974 driver_unregister(&udc_driver); 2973 platform_driver_unregister(&udc_driver);
2975} 2974}
2976module_exit(udc_exit); 2975module_exit(udc_exit);
2977 2976
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index 510d28a924db..bb028c5b8952 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa2xx_udc.c
@@ -2432,7 +2432,7 @@ static struct pxa2xx_udc memory = {
2432/* 2432/*
2433 * probe - binds to the platform device 2433 * probe - binds to the platform device
2434 */ 2434 */
2435static int __init pxa2xx_udc_probe(struct device *_dev) 2435static int __init pxa2xx_udc_probe(struct platform_device *pdev)
2436{ 2436{
2437 struct pxa2xx_udc *dev = &memory; 2437 struct pxa2xx_udc *dev = &memory;
2438 int retval, out_dma = 1; 2438 int retval, out_dma = 1;
@@ -2495,19 +2495,19 @@ static int __init pxa2xx_udc_probe(struct device *_dev)
2495#endif 2495#endif
2496 2496
2497 /* other non-static parts of init */ 2497 /* other non-static parts of init */
2498 dev->dev = _dev; 2498 dev->dev = &pdev->dev;
2499 dev->mach = _dev->platform_data; 2499 dev->mach = pdev->dev.platform_data;
2500 2500
2501 init_timer(&dev->timer); 2501 init_timer(&dev->timer);
2502 dev->timer.function = udc_watchdog; 2502 dev->timer.function = udc_watchdog;
2503 dev->timer.data = (unsigned long) dev; 2503 dev->timer.data = (unsigned long) dev;
2504 2504
2505 device_initialize(&dev->gadget.dev); 2505 device_initialize(&dev->gadget.dev);
2506 dev->gadget.dev.parent = _dev; 2506 dev->gadget.dev.parent = &pdev->dev;
2507 dev->gadget.dev.dma_mask = _dev->dma_mask; 2507 dev->gadget.dev.dma_mask = pdev->dev.dma_mask;
2508 2508
2509 the_controller = dev; 2509 the_controller = dev;
2510 dev_set_drvdata(_dev, dev); 2510 platform_set_drvdata(pdev, dev);
2511 2511
2512 udc_disable(dev); 2512 udc_disable(dev);
2513 udc_reinit(dev); 2513 udc_reinit(dev);
@@ -2559,14 +2559,14 @@ lubbock_fail0:
2559 return 0; 2559 return 0;
2560} 2560}
2561 2561
2562static void pxa2xx_udc_shutdown(struct device *_dev) 2562static void pxa2xx_udc_shutdown(struct platform_device *_dev)
2563{ 2563{
2564 pullup_off(); 2564 pullup_off();
2565} 2565}
2566 2566
2567static int __exit pxa2xx_udc_remove(struct device *_dev) 2567static int __exit pxa2xx_udc_remove(struct platform_device *pdev)
2568{ 2568{
2569 struct pxa2xx_udc *dev = dev_get_drvdata(_dev); 2569 struct pxa2xx_udc *dev = platform_get_drvdata(pdev);
2570 2570
2571 udc_disable(dev); 2571 udc_disable(dev);
2572 remove_proc_files(); 2572 remove_proc_files();
@@ -2580,7 +2580,7 @@ static int __exit pxa2xx_udc_remove(struct device *_dev)
2580 free_irq(LUBBOCK_USB_DISC_IRQ, dev); 2580 free_irq(LUBBOCK_USB_DISC_IRQ, dev);
2581 free_irq(LUBBOCK_USB_IRQ, dev); 2581 free_irq(LUBBOCK_USB_IRQ, dev);
2582 } 2582 }
2583 dev_set_drvdata(_dev, NULL); 2583 platform_set_drvdata(pdev, NULL);
2584 the_controller = NULL; 2584 the_controller = NULL;
2585 return 0; 2585 return 0;
2586} 2586}
@@ -2601,9 +2601,9 @@ static int __exit pxa2xx_udc_remove(struct device *_dev)
2601 * VBUS IRQs should probably be ignored so that the PXA device just acts 2601 * VBUS IRQs should probably be ignored so that the PXA device just acts
2602 * "dead" to USB hosts until system resume. 2602 * "dead" to USB hosts until system resume.
2603 */ 2603 */
2604static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state) 2604static int pxa2xx_udc_suspend(struct platform_device *dev, pm_message_t state)
2605{ 2605{
2606 struct pxa2xx_udc *udc = dev_get_drvdata(dev); 2606 struct pxa2xx_udc *udc = platform_get_drvdata(dev);
2607 2607
2608 if (!udc->mach->udc_command) 2608 if (!udc->mach->udc_command)
2609 WARN("USB host won't detect disconnect!\n"); 2609 WARN("USB host won't detect disconnect!\n");
@@ -2612,9 +2612,9 @@ static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state)
2612 return 0; 2612 return 0;
2613} 2613}
2614 2614
2615static int pxa2xx_udc_resume(struct device *dev) 2615static int pxa2xx_udc_resume(struct platform_device *dev)
2616{ 2616{
2617 struct pxa2xx_udc *udc = dev_get_drvdata(dev); 2617 struct pxa2xx_udc *udc = platform_get_drvdata(dev);
2618 2618
2619 pullup(udc, 1); 2619 pullup(udc, 1);
2620 2620
@@ -2628,27 +2628,28 @@ static int pxa2xx_udc_resume(struct device *dev)
2628 2628
2629/*-------------------------------------------------------------------------*/ 2629/*-------------------------------------------------------------------------*/
2630 2630
2631static struct device_driver udc_driver = { 2631static struct platform_driver udc_driver = {
2632 .name = "pxa2xx-udc",
2633 .owner = THIS_MODULE,
2634 .bus = &platform_bus_type,
2635 .probe = pxa2xx_udc_probe, 2632 .probe = pxa2xx_udc_probe,
2636 .shutdown = pxa2xx_udc_shutdown, 2633 .shutdown = pxa2xx_udc_shutdown,
2637 .remove = __exit_p(pxa2xx_udc_remove), 2634 .remove = __exit_p(pxa2xx_udc_remove),
2638 .suspend = pxa2xx_udc_suspend, 2635 .suspend = pxa2xx_udc_suspend,
2639 .resume = pxa2xx_udc_resume, 2636 .resume = pxa2xx_udc_resume,
2637 .driver = {
2638 .owner = THIS_MODULE,
2639 .name = "pxa2xx-udc",
2640 },
2640}; 2641};
2641 2642
2642static int __init udc_init(void) 2643static int __init udc_init(void)
2643{ 2644{
2644 printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION); 2645 printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION);
2645 return driver_register(&udc_driver); 2646 return platform_driver_register(&udc_driver);
2646} 2647}
2647module_init(udc_init); 2648module_init(udc_init);
2648 2649
2649static void __exit udc_exit(void) 2650static void __exit udc_exit(void)
2650{ 2651{
2651 driver_unregister(&udc_driver); 2652 platform_driver_unregister(&udc_driver);
2652} 2653}
2653module_exit(udc_exit); 2654module_exit(udc_exit);
2654 2655
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index f9c3f5b8dd1c..82f64986bc22 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -1633,17 +1633,15 @@ static struct hc_driver isp116x_hc_driver = {
1633 1633
1634/*----------------------------------------------------------------*/ 1634/*----------------------------------------------------------------*/
1635 1635
1636static int __init_or_module isp116x_remove(struct device *dev) 1636static int __init_or_module isp116x_remove(struct platform_device *pdev)
1637{ 1637{
1638 struct usb_hcd *hcd = dev_get_drvdata(dev); 1638 struct usb_hcd *hcd = platform_get_drvdata(pdev);
1639 struct isp116x *isp116x; 1639 struct isp116x *isp116x;
1640 struct platform_device *pdev;
1641 struct resource *res; 1640 struct resource *res;
1642 1641
1643 if (!hcd) 1642 if (!hcd)
1644 return 0; 1643 return 0;
1645 isp116x = hcd_to_isp116x(hcd); 1644 isp116x = hcd_to_isp116x(hcd);
1646 pdev = container_of(dev, struct platform_device, dev);
1647 remove_debug_file(isp116x); 1645 remove_debug_file(isp116x);
1648 usb_remove_hcd(hcd); 1646 usb_remove_hcd(hcd);
1649 1647
@@ -1660,18 +1658,16 @@ static int __init_or_module isp116x_remove(struct device *dev)
1660 1658
1661#define resource_len(r) (((r)->end - (r)->start) + 1) 1659#define resource_len(r) (((r)->end - (r)->start) + 1)
1662 1660
1663static int __init isp116x_probe(struct device *dev) 1661static int __init isp116x_probe(struct platform_device *pdev)
1664{ 1662{
1665 struct usb_hcd *hcd; 1663 struct usb_hcd *hcd;
1666 struct isp116x *isp116x; 1664 struct isp116x *isp116x;
1667 struct platform_device *pdev;
1668 struct resource *addr, *data; 1665 struct resource *addr, *data;
1669 void __iomem *addr_reg; 1666 void __iomem *addr_reg;
1670 void __iomem *data_reg; 1667 void __iomem *data_reg;
1671 int irq; 1668 int irq;
1672 int ret = 0; 1669 int ret = 0;
1673 1670
1674 pdev = container_of(dev, struct platform_device, dev);
1675 if (pdev->num_resources < 3) { 1671 if (pdev->num_resources < 3) {
1676 ret = -ENODEV; 1672 ret = -ENODEV;
1677 goto err1; 1673 goto err1;
@@ -1685,7 +1681,7 @@ static int __init isp116x_probe(struct device *dev)
1685 goto err1; 1681 goto err1;
1686 } 1682 }
1687 1683
1688 if (dev->dma_mask) { 1684 if (pdev->dev.dma_mask) {
1689 DBG("DMA not supported\n"); 1685 DBG("DMA not supported\n");
1690 ret = -EINVAL; 1686 ret = -EINVAL;
1691 goto err1; 1687 goto err1;
@@ -1711,7 +1707,7 @@ static int __init isp116x_probe(struct device *dev)
1711 } 1707 }
1712 1708
1713 /* allocate and initialize hcd */ 1709 /* allocate and initialize hcd */
1714 hcd = usb_create_hcd(&isp116x_hc_driver, dev, dev->bus_id); 1710 hcd = usb_create_hcd(&isp116x_hc_driver, &pdev->dev, pdev->dev.bus_id);
1715 if (!hcd) { 1711 if (!hcd) {
1716 ret = -ENOMEM; 1712 ret = -ENOMEM;
1717 goto err5; 1713 goto err5;
@@ -1723,7 +1719,7 @@ static int __init isp116x_probe(struct device *dev)
1723 isp116x->addr_reg = addr_reg; 1719 isp116x->addr_reg = addr_reg;
1724 spin_lock_init(&isp116x->lock); 1720 spin_lock_init(&isp116x->lock);
1725 INIT_LIST_HEAD(&isp116x->async); 1721 INIT_LIST_HEAD(&isp116x->async);
1726 isp116x->board = dev->platform_data; 1722 isp116x->board = pdev->dev.platform_data;
1727 1723
1728 if (!isp116x->board) { 1724 if (!isp116x->board) {
1729 ERR("Platform data structure not initialized\n"); 1725 ERR("Platform data structure not initialized\n");
@@ -1764,13 +1760,13 @@ static int __init isp116x_probe(struct device *dev)
1764/* 1760/*
1765 Suspend of platform device 1761 Suspend of platform device
1766*/ 1762*/
1767static int isp116x_suspend(struct device *dev, pm_message_t state) 1763static int isp116x_suspend(struct platform_device *dev, pm_message_t state)
1768{ 1764{
1769 int ret = 0; 1765 int ret = 0;
1770 1766
1771 VDBG("%s: state %x\n", __func__, state); 1767 VDBG("%s: state %x\n", __func__, state);
1772 1768
1773 dev->power.power_state = state; 1769 dev->dev.power.power_state = state;
1774 1770
1775 return ret; 1771 return ret;
1776} 1772}
@@ -1778,13 +1774,13 @@ static int isp116x_suspend(struct device *dev, pm_message_t state)
1778/* 1774/*
1779 Resume platform device 1775 Resume platform device
1780*/ 1776*/
1781static int isp116x_resume(struct device *dev) 1777static int isp116x_resume(struct platform_device *dev)
1782{ 1778{
1783 int ret = 0; 1779 int ret = 0;
1784 1780
1785 VDBG("%s: state %x\n", __func__, dev->power.power_state); 1781 VDBG("%s: state %x\n", __func__, dev->dev.power.power_state);
1786 1782
1787 dev->power.power_state = PMSG_ON; 1783 dev->dev.power.power_state = PMSG_ON;
1788 1784
1789 return ret; 1785 return ret;
1790} 1786}
@@ -1796,13 +1792,14 @@ static int isp116x_resume(struct device *dev)
1796 1792
1797#endif 1793#endif
1798 1794
1799static struct device_driver isp116x_driver = { 1795static struct platform_driver isp116x_driver = {
1800 .name = (char *)hcd_name,
1801 .bus = &platform_bus_type,
1802 .probe = isp116x_probe, 1796 .probe = isp116x_probe,
1803 .remove = isp116x_remove, 1797 .remove = isp116x_remove,
1804 .suspend = isp116x_suspend, 1798 .suspend = isp116x_suspend,
1805 .resume = isp116x_resume, 1799 .resume = isp116x_resume,
1800 .driver = {
1801 .name = (char *)hcd_name,
1802 },
1806}; 1803};
1807 1804
1808/*-----------------------------------------------------------------*/ 1805/*-----------------------------------------------------------------*/
@@ -1813,14 +1810,14 @@ static int __init isp116x_init(void)
1813 return -ENODEV; 1810 return -ENODEV;
1814 1811
1815 INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION); 1812 INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION);
1816 return driver_register(&isp116x_driver); 1813 return platform_driver_register(&isp116x_driver);
1817} 1814}
1818 1815
1819module_init(isp116x_init); 1816module_init(isp116x_init);
1820 1817
1821static void __exit isp116x_cleanup(void) 1818static void __exit isp116x_cleanup(void)
1822{ 1819{
1823 driver_unregister(&isp116x_driver); 1820 platform_driver_unregister(&isp116x_driver);
1824} 1821}
1825 1822
1826module_exit(isp116x_cleanup); 1823module_exit(isp116x_cleanup);
diff --git a/drivers/usb/host/ohci-au1xxx.c b/drivers/usb/host/ohci-au1xxx.c
index f0c78cf14b6c..d9cf3b327d96 100644
--- a/drivers/usb/host/ohci-au1xxx.c
+++ b/drivers/usb/host/ohci-au1xxx.c
@@ -225,9 +225,8 @@ static const struct hc_driver ohci_au1xxx_hc_driver = {
225 225
226/*-------------------------------------------------------------------------*/ 226/*-------------------------------------------------------------------------*/
227 227
228static int ohci_hcd_au1xxx_drv_probe(struct device *dev) 228static int ohci_hcd_au1xxx_drv_probe(struct platform_device *pdev)
229{ 229{
230 struct platform_device *pdev = to_platform_device(dev);
231 int ret; 230 int ret;
232 231
233 pr_debug ("In ohci_hcd_au1xxx_drv_probe"); 232 pr_debug ("In ohci_hcd_au1xxx_drv_probe");
@@ -239,39 +238,37 @@ static int ohci_hcd_au1xxx_drv_probe(struct device *dev)
239 return ret; 238 return ret;
240} 239}
241 240
242static int ohci_hcd_au1xxx_drv_remove(struct device *dev) 241static int ohci_hcd_au1xxx_drv_remove(struct platform_device *pdev)
243{ 242{
244 struct platform_device *pdev = to_platform_device(dev); 243 struct usb_hcd *hcd = platform_get_drvdata(pdev);
245 struct usb_hcd *hcd = dev_get_drvdata(dev);
246 244
247 usb_hcd_au1xxx_remove(hcd, pdev); 245 usb_hcd_au1xxx_remove(hcd, pdev);
248 return 0; 246 return 0;
249} 247}
250 /*TBD*/ 248 /*TBD*/
251/*static int ohci_hcd_au1xxx_drv_suspend(struct device *dev) 249/*static int ohci_hcd_au1xxx_drv_suspend(struct platform_device *dev)
252{ 250{
253 struct platform_device *pdev = to_platform_device(dev); 251 struct usb_hcd *hcd = platform_get_drvdata(dev);
254 struct usb_hcd *hcd = dev_get_drvdata(dev);
255 252
256 return 0; 253 return 0;
257} 254}
258static int ohci_hcd_au1xxx_drv_resume(struct device *dev) 255static int ohci_hcd_au1xxx_drv_resume(struct platform_device *dev)
259{ 256{
260 struct platform_device *pdev = to_platform_device(dev); 257 struct usb_hcd *hcd = platform_get_drvdata(dev);
261 struct usb_hcd *hcd = dev_get_drvdata(dev);
262 258
263 return 0; 259 return 0;
264} 260}
265*/ 261*/
266 262
267static struct device_driver ohci_hcd_au1xxx_driver = { 263static struct platform_driver ohci_hcd_au1xxx_driver = {
268 .name = "au1xxx-ohci",
269 .owner = THIS_MODULE,
270 .bus = &platform_bus_type,
271 .probe = ohci_hcd_au1xxx_drv_probe, 264 .probe = ohci_hcd_au1xxx_drv_probe,
272 .remove = ohci_hcd_au1xxx_drv_remove, 265 .remove = ohci_hcd_au1xxx_drv_remove,
273 /*.suspend = ohci_hcd_au1xxx_drv_suspend, */ 266 /*.suspend = ohci_hcd_au1xxx_drv_suspend, */
274 /*.resume = ohci_hcd_au1xxx_drv_resume, */ 267 /*.resume = ohci_hcd_au1xxx_drv_resume, */
268 .driver = {
269 .name = "au1xxx-ohci",
270 .owner = THIS_MODULE,
271 },
275}; 272};
276 273
277static int __init ohci_hcd_au1xxx_init (void) 274static int __init ohci_hcd_au1xxx_init (void)
@@ -280,12 +277,12 @@ static int __init ohci_hcd_au1xxx_init (void)
280 pr_debug ("block sizes: ed %d td %d\n", 277 pr_debug ("block sizes: ed %d td %d\n",
281 sizeof (struct ed), sizeof (struct td)); 278 sizeof (struct ed), sizeof (struct td));
282 279
283 return driver_register(&ohci_hcd_au1xxx_driver); 280 return platform_driver_register(&ohci_hcd_au1xxx_driver);
284} 281}
285 282
286static void __exit ohci_hcd_au1xxx_cleanup (void) 283static void __exit ohci_hcd_au1xxx_cleanup (void)
287{ 284{
288 driver_unregister(&ohci_hcd_au1xxx_driver); 285 platform_driver_unregister(&ohci_hcd_au1xxx_driver);
289} 286}
290 287
291module_init (ohci_hcd_au1xxx_init); 288module_init (ohci_hcd_au1xxx_init);
diff --git a/drivers/usb/host/ohci-lh7a404.c b/drivers/usb/host/ohci-lh7a404.c
index 336c766c6e29..081ec3f5cff4 100644
--- a/drivers/usb/host/ohci-lh7a404.c
+++ b/drivers/usb/host/ohci-lh7a404.c
@@ -204,9 +204,8 @@ static const struct hc_driver ohci_lh7a404_hc_driver = {
204 204
205/*-------------------------------------------------------------------------*/ 205/*-------------------------------------------------------------------------*/
206 206
207static int ohci_hcd_lh7a404_drv_probe(struct device *dev) 207static int ohci_hcd_lh7a404_drv_probe(struct platform_device *pdev)
208{ 208{
209 struct platform_device *pdev = to_platform_device(dev);
210 int ret; 209 int ret;
211 210
212 pr_debug ("In ohci_hcd_lh7a404_drv_probe"); 211 pr_debug ("In ohci_hcd_lh7a404_drv_probe");
@@ -218,40 +217,38 @@ static int ohci_hcd_lh7a404_drv_probe(struct device *dev)
218 return ret; 217 return ret;
219} 218}
220 219
221static int ohci_hcd_lh7a404_drv_remove(struct device *dev) 220static int ohci_hcd_lh7a404_drv_remove(struct platform_device *pdev)
222{ 221{
223 struct platform_device *pdev = to_platform_device(dev); 222 struct usb_hcd *hcd = platform_get_drvdata(dev);
224 struct usb_hcd *hcd = dev_get_drvdata(dev);
225 223
226 usb_hcd_lh7a404_remove(hcd, pdev); 224 usb_hcd_lh7a404_remove(hcd, pdev);
227 return 0; 225 return 0;
228} 226}
229 /*TBD*/ 227 /*TBD*/
230/*static int ohci_hcd_lh7a404_drv_suspend(struct device *dev) 228/*static int ohci_hcd_lh7a404_drv_suspend(struct platform_device *dev)
231{ 229{
232 struct platform_device *pdev = to_platform_device(dev); 230 struct usb_hcd *hcd = platform_get_drvdata(dev);
233 struct usb_hcd *hcd = dev_get_drvdata(dev);
234 231
235 return 0; 232 return 0;
236} 233}
237static int ohci_hcd_lh7a404_drv_resume(struct device *dev) 234static int ohci_hcd_lh7a404_drv_resume(struct platform_device *dev)
238{ 235{
239 struct platform_device *pdev = to_platform_device(dev); 236 struct usb_hcd *hcd = platform_get_drvdata(dev);
240 struct usb_hcd *hcd = dev_get_drvdata(dev);
241 237
242 238
243 return 0; 239 return 0;
244} 240}
245*/ 241*/
246 242
247static struct device_driver ohci_hcd_lh7a404_driver = { 243static struct platform_driver ohci_hcd_lh7a404_driver = {
248 .name = "lh7a404-ohci",
249 .owner = THIS_MODULE,
250 .bus = &platform_bus_type,
251 .probe = ohci_hcd_lh7a404_drv_probe, 244 .probe = ohci_hcd_lh7a404_drv_probe,
252 .remove = ohci_hcd_lh7a404_drv_remove, 245 .remove = ohci_hcd_lh7a404_drv_remove,
253 /*.suspend = ohci_hcd_lh7a404_drv_suspend, */ 246 /*.suspend = ohci_hcd_lh7a404_drv_suspend, */
254 /*.resume = ohci_hcd_lh7a404_drv_resume, */ 247 /*.resume = ohci_hcd_lh7a404_drv_resume, */
248 .driver = {
249 .name = "lh7a404-ohci",
250 .owner = THIS_MODULE,
251 },
255}; 252};
256 253
257static int __init ohci_hcd_lh7a404_init (void) 254static int __init ohci_hcd_lh7a404_init (void)
@@ -260,12 +257,12 @@ static int __init ohci_hcd_lh7a404_init (void)
260 pr_debug ("block sizes: ed %d td %d\n", 257 pr_debug ("block sizes: ed %d td %d\n",
261 sizeof (struct ed), sizeof (struct td)); 258 sizeof (struct ed), sizeof (struct td));
262 259
263 return driver_register(&ohci_hcd_lh7a404_driver); 260 return platform_driver_register(&ohci_hcd_lh7a404_driver);
264} 261}
265 262
266static void __exit ohci_hcd_lh7a404_cleanup (void) 263static void __exit ohci_hcd_lh7a404_cleanup (void)
267{ 264{
268 driver_unregister(&ohci_hcd_lh7a404_driver); 265 platform_driver_unregister(&ohci_hcd_lh7a404_driver);
269} 266}
270 267
271module_init (ohci_hcd_lh7a404_init); 268module_init (ohci_hcd_lh7a404_init);
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index e46cc540cf4d..c9e29d808711 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -433,24 +433,22 @@ static const struct hc_driver ohci_omap_hc_driver = {
433 433
434/*-------------------------------------------------------------------------*/ 434/*-------------------------------------------------------------------------*/
435 435
436static int ohci_hcd_omap_drv_probe(struct device *dev) 436static int ohci_hcd_omap_drv_probe(struct platform_device *dev)
437{ 437{
438 return usb_hcd_omap_probe(&ohci_omap_hc_driver, 438 return usb_hcd_omap_probe(&ohci_omap_hc_driver, dev);
439 to_platform_device(dev));
440} 439}
441 440
442static int ohci_hcd_omap_drv_remove(struct device *dev) 441static int ohci_hcd_omap_drv_remove(struct platform_device *dev)
443{ 442{
444 struct platform_device *pdev = to_platform_device(dev); 443 struct usb_hcd *hcd = platform_get_drvdata(dev);
445 struct usb_hcd *hcd = dev_get_drvdata(dev);
446 struct ohci_hcd *ohci = hcd_to_ohci (hcd); 444 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
447 445
448 usb_hcd_omap_remove(hcd, pdev); 446 usb_hcd_omap_remove(hcd, dev);
449 if (ohci->transceiver) { 447 if (ohci->transceiver) {
450 (void) otg_set_host(ohci->transceiver, 0); 448 (void) otg_set_host(ohci->transceiver, 0);
451 put_device(ohci->transceiver->dev); 449 put_device(ohci->transceiver->dev);
452 } 450 }
453 dev_set_drvdata(dev, NULL); 451 platform_set_drvdata(dev, NULL);
454 452
455 return 0; 453 return 0;
456} 454}
@@ -459,9 +457,9 @@ static int ohci_hcd_omap_drv_remove(struct device *dev)
459 457
460#ifdef CONFIG_PM 458#ifdef CONFIG_PM
461 459
462static int ohci_omap_suspend(struct device *dev, pm_message_t message) 460static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message)
463{ 461{
464 struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); 462 struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(dev));
465 463
466 if (time_before(jiffies, ohci->next_statechange)) 464 if (time_before(jiffies, ohci->next_statechange))
467 msleep(5); 465 msleep(5);
@@ -473,9 +471,9 @@ static int ohci_omap_suspend(struct device *dev, pm_message_t message)
473 return 0; 471 return 0;
474} 472}
475 473
476static int ohci_omap_resume(struct device *dev) 474static int ohci_omap_resume(struct platform_device *dev)
477{ 475{
478 struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); 476 struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(dev));
479 477
480 if (time_before(jiffies, ohci->next_statechange)) 478 if (time_before(jiffies, ohci->next_statechange))
481 msleep(5); 479 msleep(5);
@@ -494,16 +492,17 @@ static int ohci_omap_resume(struct device *dev)
494/* 492/*
495 * Driver definition to register with the OMAP bus 493 * Driver definition to register with the OMAP bus
496 */ 494 */
497static struct device_driver ohci_hcd_omap_driver = { 495static struct platform_driver ohci_hcd_omap_driver = {
498 .name = "ohci",
499 .owner = THIS_MODULE,
500 .bus = &platform_bus_type,
501 .probe = ohci_hcd_omap_drv_probe, 496 .probe = ohci_hcd_omap_drv_probe,
502 .remove = ohci_hcd_omap_drv_remove, 497 .remove = ohci_hcd_omap_drv_remove,
503#ifdef CONFIG_PM 498#ifdef CONFIG_PM
504 .suspend = ohci_omap_suspend, 499 .suspend = ohci_omap_suspend,
505 .resume = ohci_omap_resume, 500 .resume = ohci_omap_resume,
506#endif 501#endif
502 .driver = {
503 .owner = THIS_MODULE,
504 .name = "ohci",
505 },
507}; 506};
508 507
509static int __init ohci_hcd_omap_init (void) 508static int __init ohci_hcd_omap_init (void)
@@ -515,12 +514,12 @@ static int __init ohci_hcd_omap_init (void)
515 pr_debug("%s: block sizes: ed %Zd td %Zd\n", hcd_name, 514 pr_debug("%s: block sizes: ed %Zd td %Zd\n", hcd_name,
516 sizeof (struct ed), sizeof (struct td)); 515 sizeof (struct ed), sizeof (struct td));
517 516
518 return driver_register(&ohci_hcd_omap_driver); 517 return platform_driver_register(&ohci_hcd_omap_driver);
519} 518}
520 519
521static void __exit ohci_hcd_omap_cleanup (void) 520static void __exit ohci_hcd_omap_cleanup (void)
522{ 521{
523 driver_unregister(&ohci_hcd_omap_driver); 522 platform_driver_unregister(&ohci_hcd_omap_driver);
524} 523}
525 524
526module_init (ohci_hcd_omap_init); 525module_init (ohci_hcd_omap_init);
diff --git a/drivers/usb/host/ohci-ppc-soc.c b/drivers/usb/host/ohci-ppc-soc.c
index 92cf6f4a1374..18755766e406 100644
--- a/drivers/usb/host/ohci-ppc-soc.c
+++ b/drivers/usb/host/ohci-ppc-soc.c
@@ -172,9 +172,8 @@ static const struct hc_driver ohci_ppc_soc_hc_driver = {
172 .start_port_reset = ohci_start_port_reset, 172 .start_port_reset = ohci_start_port_reset,
173}; 173};
174 174
175static int ohci_hcd_ppc_soc_drv_probe(struct device *dev) 175static int ohci_hcd_ppc_soc_drv_probe(struct platform_device *pdev)
176{ 176{
177 struct platform_device *pdev = to_platform_device(dev);
178 int ret; 177 int ret;
179 178
180 if (usb_disabled()) 179 if (usb_disabled())
@@ -184,25 +183,25 @@ static int ohci_hcd_ppc_soc_drv_probe(struct device *dev)
184 return ret; 183 return ret;
185} 184}
186 185
187static int ohci_hcd_ppc_soc_drv_remove(struct device *dev) 186static int ohci_hcd_ppc_soc_drv_remove(struct platform_device *pdev)
188{ 187{
189 struct platform_device *pdev = to_platform_device(dev); 188 struct usb_hcd *hcd = platform_get_drvdata(dev);
190 struct usb_hcd *hcd = dev_get_drvdata(dev);
191 189
192 usb_hcd_ppc_soc_remove(hcd, pdev); 190 usb_hcd_ppc_soc_remove(hcd, pdev);
193 return 0; 191 return 0;
194} 192}
195 193
196static struct device_driver ohci_hcd_ppc_soc_driver = { 194static struct platform_driver ohci_hcd_ppc_soc_driver = {
197 .name = "ppc-soc-ohci",
198 .owner = THIS_MODULE,
199 .bus = &platform_bus_type,
200 .probe = ohci_hcd_ppc_soc_drv_probe, 195 .probe = ohci_hcd_ppc_soc_drv_probe,
201 .remove = ohci_hcd_ppc_soc_drv_remove, 196 .remove = ohci_hcd_ppc_soc_drv_remove,
202#ifdef CONFIG_PM 197#ifdef CONFIG_PM
203 /*.suspend = ohci_hcd_ppc_soc_drv_suspend,*/ 198 /*.suspend = ohci_hcd_ppc_soc_drv_suspend,*/
204 /*.resume = ohci_hcd_ppc_soc_drv_resume,*/ 199 /*.resume = ohci_hcd_ppc_soc_drv_resume,*/
205#endif 200#endif
201 .driver = {
202 .name = "ppc-soc-ohci",
203 .owner = THIS_MODULE,
204 },
206}; 205};
207 206
208static int __init ohci_hcd_ppc_soc_init(void) 207static int __init ohci_hcd_ppc_soc_init(void)
@@ -211,12 +210,12 @@ static int __init ohci_hcd_ppc_soc_init(void)
211 pr_debug("block sizes: ed %d td %d\n", sizeof(struct ed), 210 pr_debug("block sizes: ed %d td %d\n", sizeof(struct ed),
212 sizeof(struct td)); 211 sizeof(struct td));
213 212
214 return driver_register(&ohci_hcd_ppc_soc_driver); 213 return platform_driver_register(&ohci_hcd_ppc_soc_driver);
215} 214}
216 215
217static void __exit ohci_hcd_ppc_soc_cleanup(void) 216static void __exit ohci_hcd_ppc_soc_cleanup(void)
218{ 217{
219 driver_unregister(&ohci_hcd_ppc_soc_driver); 218 platform_driver_unregister(&ohci_hcd_ppc_soc_driver);
220} 219}
221 220
222module_init(ohci_hcd_ppc_soc_init); 221module_init(ohci_hcd_ppc_soc_init);
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 59e20568e8f9..9d65ec307990 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -290,9 +290,8 @@ static const struct hc_driver ohci_pxa27x_hc_driver = {
290 290
291/*-------------------------------------------------------------------------*/ 291/*-------------------------------------------------------------------------*/
292 292
293static int ohci_hcd_pxa27x_drv_probe(struct device *dev) 293static int ohci_hcd_pxa27x_drv_probe(struct platform_device *pdev)
294{ 294{
295 struct platform_device *pdev = to_platform_device(dev);
296 int ret; 295 int ret;
297 296
298 pr_debug ("In ohci_hcd_pxa27x_drv_probe"); 297 pr_debug ("In ohci_hcd_pxa27x_drv_probe");
@@ -304,41 +303,39 @@ static int ohci_hcd_pxa27x_drv_probe(struct device *dev)
304 return ret; 303 return ret;
305} 304}
306 305
307static int ohci_hcd_pxa27x_drv_remove(struct device *dev) 306static int ohci_hcd_pxa27x_drv_remove(struct platform_device *pdev)
308{ 307{
309 struct platform_device *pdev = to_platform_device(dev); 308 struct usb_hcd *hcd = platform_get_drvdata(pdev);
310 struct usb_hcd *hcd = dev_get_drvdata(dev);
311 309
312 usb_hcd_pxa27x_remove(hcd, pdev); 310 usb_hcd_pxa27x_remove(hcd, pdev);
313 return 0; 311 return 0;
314} 312}
315 313
316static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state) 314static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *dev, pm_message_t state)
317{ 315{
318// struct platform_device *pdev = to_platform_device(dev); 316// struct usb_hcd *hcd = platform_get_drvdata(dev);
319// struct usb_hcd *hcd = dev_get_drvdata(dev);
320 printk("%s: not implemented yet\n", __FUNCTION__); 317 printk("%s: not implemented yet\n", __FUNCTION__);
321 318
322 return 0; 319 return 0;
323} 320}
324 321
325static int ohci_hcd_pxa27x_drv_resume(struct device *dev) 322static int ohci_hcd_pxa27x_drv_resume(struct platform_device *dev)
326{ 323{
327// struct platform_device *pdev = to_platform_device(dev); 324// struct usb_hcd *hcd = platform_get_drvdata(dev);
328// struct usb_hcd *hcd = dev_get_drvdata(dev);
329 printk("%s: not implemented yet\n", __FUNCTION__); 325 printk("%s: not implemented yet\n", __FUNCTION__);
330 326
331 return 0; 327 return 0;
332} 328}
333 329
334 330
335static struct device_driver ohci_hcd_pxa27x_driver = { 331static struct platform_driver ohci_hcd_pxa27x_driver = {
336 .name = "pxa27x-ohci",
337 .bus = &platform_bus_type,
338 .probe = ohci_hcd_pxa27x_drv_probe, 332 .probe = ohci_hcd_pxa27x_drv_probe,
339 .remove = ohci_hcd_pxa27x_drv_remove, 333 .remove = ohci_hcd_pxa27x_drv_remove,
340 .suspend = ohci_hcd_pxa27x_drv_suspend, 334 .suspend = ohci_hcd_pxa27x_drv_suspend,
341 .resume = ohci_hcd_pxa27x_drv_resume, 335 .resume = ohci_hcd_pxa27x_drv_resume,
336 .driver = {
337 .name = "pxa27x-ohci",
338 },
342}; 339};
343 340
344static int __init ohci_hcd_pxa27x_init (void) 341static int __init ohci_hcd_pxa27x_init (void)
@@ -347,12 +344,12 @@ static int __init ohci_hcd_pxa27x_init (void)
347 pr_debug ("block sizes: ed %d td %d\n", 344 pr_debug ("block sizes: ed %d td %d\n",
348 sizeof (struct ed), sizeof (struct td)); 345 sizeof (struct ed), sizeof (struct td));
349 346
350 return driver_register(&ohci_hcd_pxa27x_driver); 347 return platform_driver_register(&ohci_hcd_pxa27x_driver);
351} 348}
352 349
353static void __exit ohci_hcd_pxa27x_cleanup (void) 350static void __exit ohci_hcd_pxa27x_cleanup (void)
354{ 351{
355 driver_unregister(&ohci_hcd_pxa27x_driver); 352 platform_driver_unregister(&ohci_hcd_pxa27x_driver);
356} 353}
357 354
358module_init (ohci_hcd_pxa27x_init); 355module_init (ohci_hcd_pxa27x_init);
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index ee1fc605b402..35cc9402adc0 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -459,39 +459,38 @@ static const struct hc_driver ohci_s3c2410_hc_driver = {
459 459
460/* device driver */ 460/* device driver */
461 461
462static int ohci_hcd_s3c2410_drv_probe(struct device *dev) 462static int ohci_hcd_s3c2410_drv_probe(struct platform_device *pdev)
463{ 463{
464 struct platform_device *pdev = to_platform_device(dev);
465 return usb_hcd_s3c2410_probe(&ohci_s3c2410_hc_driver, pdev); 464 return usb_hcd_s3c2410_probe(&ohci_s3c2410_hc_driver, pdev);
466} 465}
467 466
468static int ohci_hcd_s3c2410_drv_remove(struct device *dev) 467static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev)
469{ 468{
470 struct platform_device *pdev = to_platform_device(dev); 469 struct usb_hcd *hcd = platform_get_drvdata(pdev);
471 struct usb_hcd *hcd = dev_get_drvdata(dev);
472 470
473 usb_hcd_s3c2410_remove(hcd, pdev); 471 usb_hcd_s3c2410_remove(hcd, pdev);
474 return 0; 472 return 0;
475} 473}
476 474
477static struct device_driver ohci_hcd_s3c2410_driver = { 475static struct platform_driver ohci_hcd_s3c2410_driver = {
478 .name = "s3c2410-ohci",
479 .owner = THIS_MODULE,
480 .bus = &platform_bus_type,
481 .probe = ohci_hcd_s3c2410_drv_probe, 476 .probe = ohci_hcd_s3c2410_drv_probe,
482 .remove = ohci_hcd_s3c2410_drv_remove, 477 .remove = ohci_hcd_s3c2410_drv_remove,
483 /*.suspend = ohci_hcd_s3c2410_drv_suspend, */ 478 /*.suspend = ohci_hcd_s3c2410_drv_suspend, */
484 /*.resume = ohci_hcd_s3c2410_drv_resume, */ 479 /*.resume = ohci_hcd_s3c2410_drv_resume, */
480 .driver = {
481 .owner = THIS_MODULE,
482 .name = "s3c2410-ohci",
483 },
485}; 484};
486 485
487static int __init ohci_hcd_s3c2410_init (void) 486static int __init ohci_hcd_s3c2410_init (void)
488{ 487{
489 return driver_register(&ohci_hcd_s3c2410_driver); 488 return platform_driver_register(&ohci_hcd_s3c2410_driver);
490} 489}
491 490
492static void __exit ohci_hcd_s3c2410_cleanup (void) 491static void __exit ohci_hcd_s3c2410_cleanup (void)
493{ 492{
494 driver_unregister(&ohci_hcd_s3c2410_driver); 493 platform_driver_unregister(&ohci_hcd_s3c2410_driver);
495} 494}
496 495
497module_init (ohci_hcd_s3c2410_init); 496module_init (ohci_hcd_s3c2410_init);
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 5607c0ae6835..a7722a6a5a5b 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -1631,24 +1631,21 @@ static struct hc_driver sl811h_hc_driver = {
1631/*-------------------------------------------------------------------------*/ 1631/*-------------------------------------------------------------------------*/
1632 1632
1633static int __devexit 1633static int __devexit
1634sl811h_remove(struct device *dev) 1634sl811h_remove(struct platform_device *dev)
1635{ 1635{
1636 struct usb_hcd *hcd = dev_get_drvdata(dev); 1636 struct usb_hcd *hcd = platform_get_drvdata(dev);
1637 struct sl811 *sl811 = hcd_to_sl811(hcd); 1637 struct sl811 *sl811 = hcd_to_sl811(hcd);
1638 struct platform_device *pdev;
1639 struct resource *res; 1638 struct resource *res;
1640 1639
1641 pdev = container_of(dev, struct platform_device, dev);
1642
1643 remove_debug_file(sl811); 1640 remove_debug_file(sl811);
1644 usb_remove_hcd(hcd); 1641 usb_remove_hcd(hcd);
1645 1642
1646 /* some platforms may use IORESOURCE_IO */ 1643 /* some platforms may use IORESOURCE_IO */
1647 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 1644 res = platform_get_resource(dev, IORESOURCE_MEM, 1);
1648 if (res) 1645 if (res)
1649 iounmap(sl811->data_reg); 1646 iounmap(sl811->data_reg);
1650 1647
1651 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1648 res = platform_get_resource(dev, IORESOURCE_MEM, 0);
1652 if (res) 1649 if (res)
1653 iounmap(sl811->addr_reg); 1650 iounmap(sl811->addr_reg);
1654 1651
@@ -1657,11 +1654,10 @@ sl811h_remove(struct device *dev)
1657} 1654}
1658 1655
1659static int __devinit 1656static int __devinit
1660sl811h_probe(struct device *dev) 1657sl811h_probe(struct platform_device *dev)
1661{ 1658{
1662 struct usb_hcd *hcd; 1659 struct usb_hcd *hcd;
1663 struct sl811 *sl811; 1660 struct sl811 *sl811;
1664 struct platform_device *pdev;
1665 struct resource *addr, *data; 1661 struct resource *addr, *data;
1666 int irq; 1662 int irq;
1667 void __iomem *addr_reg; 1663 void __iomem *addr_reg;
@@ -1674,24 +1670,23 @@ sl811h_probe(struct device *dev)
1674 * specific platform_data. we don't probe for IRQs, and do only 1670 * specific platform_data. we don't probe for IRQs, and do only
1675 * minimal sanity checking. 1671 * minimal sanity checking.
1676 */ 1672 */
1677 pdev = container_of(dev, struct platform_device, dev); 1673 irq = platform_get_irq(dev, 0);
1678 irq = platform_get_irq(pdev, 0); 1674 if (dev->num_resources < 3 || irq < 0)
1679 if (pdev->num_resources < 3 || irq < 0)
1680 return -ENODEV; 1675 return -ENODEV;
1681 1676
1682 /* refuse to confuse usbcore */ 1677 /* refuse to confuse usbcore */
1683 if (dev->dma_mask) { 1678 if (dev->dev.dma_mask) {
1684 DBG("no we won't dma\n"); 1679 DBG("no we won't dma\n");
1685 return -EINVAL; 1680 return -EINVAL;
1686 } 1681 }
1687 1682
1688 /* the chip may be wired for either kind of addressing */ 1683 /* the chip may be wired for either kind of addressing */
1689 addr = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1684 addr = platform_get_resource(dev, IORESOURCE_MEM, 0);
1690 data = platform_get_resource(pdev, IORESOURCE_MEM, 1); 1685 data = platform_get_resource(dev, IORESOURCE_MEM, 1);
1691 retval = -EBUSY; 1686 retval = -EBUSY;
1692 if (!addr || !data) { 1687 if (!addr || !data) {
1693 addr = platform_get_resource(pdev, IORESOURCE_IO, 0); 1688 addr = platform_get_resource(dev, IORESOURCE_IO, 0);
1694 data = platform_get_resource(pdev, IORESOURCE_IO, 1); 1689 data = platform_get_resource(dev, IORESOURCE_IO, 1);
1695 if (!addr || !data) 1690 if (!addr || !data)
1696 return -ENODEV; 1691 return -ENODEV;
1697 ioaddr = 1; 1692 ioaddr = 1;
@@ -1713,7 +1708,7 @@ sl811h_probe(struct device *dev)
1713 } 1708 }
1714 1709
1715 /* allocate and initialize hcd */ 1710 /* allocate and initialize hcd */
1716 hcd = usb_create_hcd(&sl811h_hc_driver, dev, dev->bus_id); 1711 hcd = usb_create_hcd(&sl811h_hc_driver, &dev->dev, dev->dev.bus_id);
1717 if (!hcd) { 1712 if (!hcd) {
1718 retval = -ENOMEM; 1713 retval = -ENOMEM;
1719 goto err5; 1714 goto err5;
@@ -1723,7 +1718,7 @@ sl811h_probe(struct device *dev)
1723 1718
1724 spin_lock_init(&sl811->lock); 1719 spin_lock_init(&sl811->lock);
1725 INIT_LIST_HEAD(&sl811->async); 1720 INIT_LIST_HEAD(&sl811->async);
1726 sl811->board = dev->platform_data; 1721 sl811->board = dev->dev.platform_data;
1727 init_timer(&sl811->timer); 1722 init_timer(&sl811->timer);
1728 sl811->timer.function = sl811h_timer; 1723 sl811->timer.function = sl811h_timer;
1729 sl811->timer.data = (unsigned long) sl811; 1724 sl811->timer.data = (unsigned long) sl811;
@@ -1785,9 +1780,9 @@ sl811h_probe(struct device *dev)
1785 */ 1780 */
1786 1781
1787static int 1782static int
1788sl811h_suspend(struct device *dev, pm_message_t state) 1783sl811h_suspend(struct platform_device *dev, pm_message_t state)
1789{ 1784{
1790 struct usb_hcd *hcd = dev_get_drvdata(dev); 1785 struct usb_hcd *hcd = platform_get_drvdata(dev);
1791 struct sl811 *sl811 = hcd_to_sl811(hcd); 1786 struct sl811 *sl811 = hcd_to_sl811(hcd);
1792 int retval = 0; 1787 int retval = 0;
1793 1788
@@ -1796,27 +1791,27 @@ sl811h_suspend(struct device *dev, pm_message_t state)
1796 else if (state.event == PM_EVENT_SUSPEND) 1791 else if (state.event == PM_EVENT_SUSPEND)
1797 port_power(sl811, 0); 1792 port_power(sl811, 0);
1798 if (retval == 0) 1793 if (retval == 0)
1799 dev->power.power_state = state; 1794 dev->dev.power.power_state = state;
1800 return retval; 1795 return retval;
1801} 1796}
1802 1797
1803static int 1798static int
1804sl811h_resume(struct device *dev) 1799sl811h_resume(struct platform_device *dev)
1805{ 1800{
1806 struct usb_hcd *hcd = dev_get_drvdata(dev); 1801 struct usb_hcd *hcd = platform_get_drvdata(dev);
1807 struct sl811 *sl811 = hcd_to_sl811(hcd); 1802 struct sl811 *sl811 = hcd_to_sl811(hcd);
1808 1803
1809 /* with no "check to see if VBUS is still powered" board hook, 1804 /* with no "check to see if VBUS is still powered" board hook,
1810 * let's assume it'd only be powered to enable remote wakeup. 1805 * let's assume it'd only be powered to enable remote wakeup.
1811 */ 1806 */
1812 if (dev->power.power_state.event == PM_EVENT_SUSPEND 1807 if (dev->dev.power.power_state.event == PM_EVENT_SUSPEND
1813 || !hcd->can_wakeup) { 1808 || !hcd->can_wakeup) {
1814 sl811->port1 = 0; 1809 sl811->port1 = 0;
1815 port_power(sl811, 1); 1810 port_power(sl811, 1);
1816 return 0; 1811 return 0;
1817 } 1812 }
1818 1813
1819 dev->power.power_state = PMSG_ON; 1814 dev->dev.power.power_state = PMSG_ON;
1820 return sl811h_bus_resume(hcd); 1815 return sl811h_bus_resume(hcd);
1821} 1816}
1822 1817
@@ -1829,16 +1824,16 @@ sl811h_resume(struct device *dev)
1829 1824
1830 1825
1831/* this driver is exported so sl811_cs can depend on it */ 1826/* this driver is exported so sl811_cs can depend on it */
1832struct device_driver sl811h_driver = { 1827struct platform_driver sl811h_driver = {
1833 .name = (char *) hcd_name,
1834 .bus = &platform_bus_type,
1835 .owner = THIS_MODULE,
1836
1837 .probe = sl811h_probe, 1828 .probe = sl811h_probe,
1838 .remove = __devexit_p(sl811h_remove), 1829 .remove = __devexit_p(sl811h_remove),
1839 1830
1840 .suspend = sl811h_suspend, 1831 .suspend = sl811h_suspend,
1841 .resume = sl811h_resume, 1832 .resume = sl811h_resume,
1833 .driver = {
1834 .name = (char *) hcd_name,
1835 .owner = THIS_MODULE,
1836 },
1842}; 1837};
1843EXPORT_SYMBOL(sl811h_driver); 1838EXPORT_SYMBOL(sl811h_driver);
1844 1839
@@ -1850,12 +1845,12 @@ static int __init sl811h_init(void)
1850 return -ENODEV; 1845 return -ENODEV;
1851 1846
1852 INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION); 1847 INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION);
1853 return driver_register(&sl811h_driver); 1848 return platform_driver_register(&sl811h_driver);
1854} 1849}
1855module_init(sl811h_init); 1850module_init(sl811h_init);
1856 1851
1857static void __exit sl811h_cleanup(void) 1852static void __exit sl811h_cleanup(void)
1858{ 1853{
1859 driver_unregister(&sl811h_driver); 1854 platform_driver_unregister(&sl811h_driver);
1860} 1855}
1861module_exit(sl811h_cleanup); 1856module_exit(sl811h_cleanup);
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index c89d0769b3da..61a2604cce4f 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -632,7 +632,7 @@ out:
632 return err; 632 return err;
633} 633}
634 634
635static Scsi_Host_Template mts_scsi_host_template = { 635static struct scsi_host_template mts_scsi_host_template = {
636 .module = THIS_MODULE, 636 .module = THIS_MODULE,
637 .name = "microtekX6", 637 .name = "microtekX6",
638 .proc_name = "microtekX6", 638 .proc_name = "microtekX6",
diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index 193b482570c7..750cebb18306 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -1279,7 +1279,7 @@ free_unused_pages(unsigned int virtual_start, unsigned int virtual_end)
1279 printk("acornfb: freed %dK memory\n", mb_freed); 1279 printk("acornfb: freed %dK memory\n", mb_freed);
1280} 1280}
1281 1281
1282static int __init acornfb_probe(struct device *dev) 1282static int __init acornfb_probe(struct platform_device *dev)
1283{ 1283{
1284 unsigned long size; 1284 unsigned long size;
1285 u_int h_sync, v_sync; 1285 u_int h_sync, v_sync;
@@ -1292,7 +1292,7 @@ static int __init acornfb_probe(struct device *dev)
1292 1292
1293 acornfb_init_fbinfo(); 1293 acornfb_init_fbinfo();
1294 1294
1295 current_par.dev = dev; 1295 current_par.dev = &dev->dev;
1296 1296
1297 if (current_par.montype == -1) 1297 if (current_par.montype == -1)
1298 current_par.montype = acornfb_detect_monitortype(); 1298 current_par.montype = acornfb_detect_monitortype();
@@ -1453,15 +1453,16 @@ static int __init acornfb_probe(struct device *dev)
1453 return 0; 1453 return 0;
1454} 1454}
1455 1455
1456static struct device_driver acornfb_driver = { 1456static struct platform_driver acornfb_driver = {
1457 .name = "acornfb",
1458 .bus = &platform_bus_type,
1459 .probe = acornfb_probe, 1457 .probe = acornfb_probe,
1458 .driver = {
1459 .name = "acornfb",
1460 },
1460}; 1461};
1461 1462
1462static int __init acornfb_init(void) 1463static int __init acornfb_init(void)
1463{ 1464{
1464 return driver_register(&acornfb_driver); 1465 return platform_driver_register(&acornfb_driver);
1465} 1466}
1466 1467
1467module_init(acornfb_init); 1468module_init(acornfb_init);
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index a1fc8bbb1090..080db812ca48 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -514,9 +514,8 @@ static struct fb_ops arcfb_ops = {
514 .fb_ioctl = arcfb_ioctl, 514 .fb_ioctl = arcfb_ioctl,
515}; 515};
516 516
517static int __init arcfb_probe(struct device *device) 517static int __init arcfb_probe(struct platform_device *dev)
518{ 518{
519 struct platform_device *dev = to_platform_device(device);
520 struct fb_info *info; 519 struct fb_info *info;
521 int retval = -ENOMEM; 520 int retval = -ENOMEM;
522 int videomemorysize; 521 int videomemorysize;
@@ -559,7 +558,7 @@ static int __init arcfb_probe(struct device *device)
559 retval = register_framebuffer(info); 558 retval = register_framebuffer(info);
560 if (retval < 0) 559 if (retval < 0)
561 goto err1; 560 goto err1;
562 dev_set_drvdata(&dev->dev, info); 561 platform_set_drvdata(dev, info);
563 if (irq) { 562 if (irq) {
564 par->irq = irq; 563 par->irq = irq;
565 if (request_irq(par->irq, &arcfb_interrupt, SA_SHIRQ, 564 if (request_irq(par->irq, &arcfb_interrupt, SA_SHIRQ,
@@ -600,9 +599,9 @@ err:
600 return retval; 599 return retval;
601} 600}
602 601
603static int arcfb_remove(struct device *device) 602static int arcfb_remove(struct platform_device *dev)
604{ 603{
605 struct fb_info *info = dev_get_drvdata(device); 604 struct fb_info *info = platform_get_drvdata(dev);
606 605
607 if (info) { 606 if (info) {
608 unregister_framebuffer(info); 607 unregister_framebuffer(info);
@@ -612,11 +611,12 @@ static int arcfb_remove(struct device *device)
612 return 0; 611 return 0;
613} 612}
614 613
615static struct device_driver arcfb_driver = { 614static struct platform_driver arcfb_driver = {
616 .name = "arcfb",
617 .bus = &platform_bus_type,
618 .probe = arcfb_probe, 615 .probe = arcfb_probe,
619 .remove = arcfb_remove, 616 .remove = arcfb_remove,
617 .driver = {
618 .name = "arcfb",
619 },
620}; 620};
621 621
622static struct platform_device *arcfb_device; 622static struct platform_device *arcfb_device;
@@ -628,7 +628,7 @@ static int __init arcfb_init(void)
628 if (!arcfb_enable) 628 if (!arcfb_enable)
629 return -ENXIO; 629 return -ENXIO;
630 630
631 ret = driver_register(&arcfb_driver); 631 ret = platform_driver_register(&arcfb_driver);
632 if (!ret) { 632 if (!ret) {
633 arcfb_device = platform_device_alloc("arcfb", 0); 633 arcfb_device = platform_device_alloc("arcfb", 0);
634 if (arcfb_device) { 634 if (arcfb_device) {
@@ -638,7 +638,7 @@ static int __init arcfb_init(void)
638 } 638 }
639 if (ret) { 639 if (ret) {
640 platform_device_put(arcfb_device); 640 platform_device_put(arcfb_device);
641 driver_unregister(&arcfb_driver); 641 platform_driver_unregister(&arcfb_driver);
642 } 642 }
643 } 643 }
644 return ret; 644 return ret;
@@ -648,7 +648,7 @@ static int __init arcfb_init(void)
648static void __exit arcfb_exit(void) 648static void __exit arcfb_exit(void)
649{ 649{
650 platform_device_unregister(arcfb_device); 650 platform_device_unregister(arcfb_device);
651 driver_unregister(&arcfb_driver); 651 platform_driver_unregister(&arcfb_driver);
652} 652}
653 653
654module_param(num_cols, ulong, 0); 654module_param(num_cols, ulong, 0);
diff --git a/drivers/video/backlight/corgi_bl.c b/drivers/video/backlight/corgi_bl.c
index bd9a6996aee7..6a219b2c77e3 100644
--- a/drivers/video/backlight/corgi_bl.c
+++ b/drivers/video/backlight/corgi_bl.c
@@ -79,13 +79,13 @@ static void corgibl_blank(int blank)
79} 79}
80 80
81#ifdef CONFIG_PM 81#ifdef CONFIG_PM
82static int corgibl_suspend(struct device *dev, pm_message_t state) 82static int corgibl_suspend(struct platform_device *dev, pm_message_t state)
83{ 83{
84 corgibl_blank(FB_BLANK_POWERDOWN); 84 corgibl_blank(FB_BLANK_POWERDOWN);
85 return 0; 85 return 0;
86} 86}
87 87
88static int corgibl_resume(struct device *dev) 88static int corgibl_resume(struct platform_device *dev)
89{ 89{
90 corgibl_blank(FB_BLANK_UNBLANK); 90 corgibl_blank(FB_BLANK_UNBLANK);
91 return 0; 91 return 0;
@@ -143,9 +143,9 @@ static struct backlight_properties corgibl_data = {
143 143
144static struct backlight_device *corgi_backlight_device; 144static struct backlight_device *corgi_backlight_device;
145 145
146static int __init corgibl_probe(struct device *dev) 146static int __init corgibl_probe(struct platform_device *pdev)
147{ 147{
148 struct corgibl_machinfo *machinfo = dev->platform_data; 148 struct corgibl_machinfo *machinfo = pdev->dev.platform_data;
149 149
150 corgibl_data.max_brightness = machinfo->max_intensity; 150 corgibl_data.max_brightness = machinfo->max_intensity;
151 corgibl_mach_set_intensity = machinfo->set_bl_intensity; 151 corgibl_mach_set_intensity = machinfo->set_bl_intensity;
@@ -162,7 +162,7 @@ static int __init corgibl_probe(struct device *dev)
162 return 0; 162 return 0;
163} 163}
164 164
165static int corgibl_remove(struct device *dev) 165static int corgibl_remove(struct platform_device *dev)
166{ 166{
167 backlight_device_unregister(corgi_backlight_device); 167 backlight_device_unregister(corgi_backlight_device);
168 168
@@ -172,23 +172,24 @@ static int corgibl_remove(struct device *dev)
172 return 0; 172 return 0;
173} 173}
174 174
175static struct device_driver corgibl_driver = { 175static struct platform_driver corgibl_driver = {
176 .name = "corgi-bl",
177 .bus = &platform_bus_type,
178 .probe = corgibl_probe, 176 .probe = corgibl_probe,
179 .remove = corgibl_remove, 177 .remove = corgibl_remove,
180 .suspend = corgibl_suspend, 178 .suspend = corgibl_suspend,
181 .resume = corgibl_resume, 179 .resume = corgibl_resume,
180 .driver = {
181 .name = "corgi-bl",
182 },
182}; 183};
183 184
184static int __init corgibl_init(void) 185static int __init corgibl_init(void)
185{ 186{
186 return driver_register(&corgibl_driver); 187 return platform_driver_register(&corgibl_driver);
187} 188}
188 189
189static void __exit corgibl_exit(void) 190static void __exit corgibl_exit(void)
190{ 191{
191 driver_unregister(&corgibl_driver); 192 platform_driver_unregister(&corgibl_driver);
192} 193}
193 194
194module_init(corgibl_init); 195module_init(corgibl_init);
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c
index f53bf3ba1278..d3728f60961e 100644
--- a/drivers/video/bw2.c
+++ b/drivers/video/bw2.c
@@ -51,6 +51,9 @@ static struct fb_ops bw2_ops = {
51 .fb_imageblit = cfb_imageblit, 51 .fb_imageblit = cfb_imageblit,
52 .fb_mmap = bw2_mmap, 52 .fb_mmap = bw2_mmap,
53 .fb_ioctl = bw2_ioctl, 53 .fb_ioctl = bw2_ioctl,
54#ifdef CONFIG_COMPAT
55 .fb_compat_ioctl = sbusfb_compat_ioctl,
56#endif
54}; 57};
55 58
56/* OBio addresses for the bwtwo registers */ 59/* OBio addresses for the bwtwo registers */
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c
index 030d4b13b1c2..1bed50f2a276 100644
--- a/drivers/video/cg14.c
+++ b/drivers/video/cg14.c
@@ -49,6 +49,9 @@ static struct fb_ops cg14_ops = {
49 .fb_imageblit = cfb_imageblit, 49 .fb_imageblit = cfb_imageblit,
50 .fb_mmap = cg14_mmap, 50 .fb_mmap = cg14_mmap,
51 .fb_ioctl = cg14_ioctl, 51 .fb_ioctl = cg14_ioctl,
52#ifdef CONFIG_COMPAT
53 .fb_compat_ioctl = sbusfb_compat_ioctl,
54#endif
52}; 55};
53 56
54#define CG14_MCR_INTENABLE_SHIFT 7 57#define CG14_MCR_INTENABLE_SHIFT 7
diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c
index b94eee8c42d5..a1354e7e0513 100644
--- a/drivers/video/cg3.c
+++ b/drivers/video/cg3.c
@@ -50,6 +50,9 @@ static struct fb_ops cg3_ops = {
50 .fb_imageblit = cfb_imageblit, 50 .fb_imageblit = cfb_imageblit,
51 .fb_mmap = cg3_mmap, 51 .fb_mmap = cg3_mmap,
52 .fb_ioctl = cg3_ioctl, 52 .fb_ioctl = cg3_ioctl,
53#ifdef CONFIG_COMPAT
54 .fb_compat_ioctl = sbusfb_compat_ioctl,
55#endif
53}; 56};
54 57
55 58
diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c
index 414c4409e924..9debe642fd2f 100644
--- a/drivers/video/cg6.c
+++ b/drivers/video/cg6.c
@@ -54,6 +54,9 @@ static struct fb_ops cg6_ops = {
54 .fb_sync = cg6_sync, 54 .fb_sync = cg6_sync,
55 .fb_mmap = cg6_mmap, 55 .fb_mmap = cg6_mmap,
56 .fb_ioctl = cg6_ioctl, 56 .fb_ioctl = cg6_ioctl,
57#ifdef CONFIG_COMPAT
58 .fb_compat_ioctl = sbusfb_compat_ioctl,
59#endif
57}; 60};
58 61
59/* Offset of interesting structures in the OBIO space */ 62/* Offset of interesting structures in the OBIO space */
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 94c5f1392cce..5f74df993406 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -215,12 +215,5 @@ config FONT_10x18
215 big letters. It fits between the sun 12x22 and the normal 8x16 font. 215 big letters. It fits between the sun 12x22 and the normal 8x16 font.
216 If other fonts are too big or too small for you, say Y, otherwise say N. 216 If other fonts are too big or too small for you, say Y, otherwise say N.
217 217
218config FONT_RL
219 bool "console Roman Large 8x16 font" if FONTS
220 depends on FRAMEBUFFER_CONSOLE
221 help
222 This is the visually-appealing "RL" console font that is
223 included with the kbd package.
224
225endmenu 218endmenu
226 219
diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile
index fed600c9ca55..9b26dda18a38 100644
--- a/drivers/video/console/Makefile
+++ b/drivers/video/console/Makefile
@@ -15,7 +15,6 @@ font-objs-$(CONFIG_FONT_10x18) += font_10x18.o
15font-objs-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o 15font-objs-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o
16font-objs-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o 16font-objs-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o
17font-objs-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o 17font-objs-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o
18font-objs-$(CONFIG_FONT_RL) += font_rl.o
19 18
20font-objs += $(font-objs-y) 19font-objs += $(font-objs-y)
21 20
diff --git a/drivers/video/console/font_rl.c b/drivers/video/console/font_rl.c
deleted file mode 100644
index dfecc27d8ded..000000000000
--- a/drivers/video/console/font_rl.c
+++ /dev/null
@@ -1,4374 +0,0 @@
1
2/* This font is simply the "rl.fnt" console font from the kbd utility.
3 * Converted by Zack T Smith, fbui@comcast.net.
4 * The original binary file is covered under the GNU Public License.
5 */
6
7#include <linux/font.h>
8
9#define FONTDATAMAX 4096
10
11static unsigned char patterns[4096] = {
120x00,
130x00,
140x00,
150x00,
160x00,
170x00,
180x00,
190x00,
200x00,
210x00,
220x00,
230x00,
240x00,
250x00,
260x00,
270x00,
28
290x00,
300x00,
310x3c,
320x42,
330x81,
340xe7,
350xa5,
360x99,
370x81,
380x81,
390x99,
400x42,
410x3c,
420x00,
430x00,
440x00,
45
460x00,
470x00,
480x3c,
490x7e,
500xff,
510x99,
520xdb,
530xe7,
540xff,
550xff,
560xe7,
570x7e,
580x3c,
590x00,
600x00,
610x00,
62
630x00,
640x00,
650x00,
660x6c,
670xfe,
680xfe,
690xfe,
700xfe,
710xfe,
720x7c,
730x38,
740x10,
750x00,
760x00,
770x00,
780x00,
79
800x00,
810x00,
820x00,
830x00,
840x10,
850x38,
860x7c,
870xfe,
880x7c,
890x38,
900x10,
910x00,
920x00,
930x00,
940x00,
950x00,
96
970x00,
980x00,
990x38,
1000x38,
1010x10,
1020xd6,
1030xfe,
1040xd6,
1050x10,
1060x10,
1070x38,
1080x7c,
1090x00,
1100x00,
1110x00,
1120x00,
113
1140x00,
1150x00,
1160x10,
1170x38,
1180x7c,
1190xfe,
1200xfe,
1210x54,
1220x10,
1230x10,
1240x38,
1250x7c,
1260x00,
1270x00,
1280x00,
1290x00,
130
1310x00,
1320x00,
1330x00,
1340x00,
1350x00,
1360x00,
1370x18,
1380x3c,
1390x3c,
1400x18,
1410x00,
1420x00,
1430x00,
1440x00,
1450x00,
1460x00,
147
1480xff,
1490xff,
1500xff,
1510xff,
1520xff,
1530xff,
1540xe7,
1550xc3,
1560xc3,
1570xe7,
1580xff,
1590xff,
1600xff,
1610xff,
1620xff,
1630xff,
164
1650x00,
1660x00,
1670x00,
1680x00,
1690x00,
1700x3c,
1710x66,
1720x42,
1730x42,
1740x66,
1750x3c,
1760x00,
1770x00,
1780x00,
1790x00,
1800x00,
181
1820xff,
1830xff,
1840xff,
1850xff,
1860xff,
1870xc3,
1880x99,
1890xbd,
1900xbd,
1910x99,
1920xc3,
1930xff,
1940xff,
1950xff,
1960xff,
1970xff,
198
1990x00,
2000x00,
2010x0f,
2020x07,
2030x0d,
2040x18,
2050x78,
2060xcc,
2070xcc,
2080xcc,
2090xcc,
2100x78,
2110x00,
2120x00,
2130x00,
2140x00,
215
2160x00,
2170x00,
2180x3c,
2190x66,
2200x66,
2210x66,
2220x3c,
2230x18,
2240x7e,
2250x18,
2260x18,
2270x18,
2280x00,
2290x00,
2300x00,
2310x00,
232
2330x00,
2340x08,
2350x0c,
2360x0a,
2370x0a,
2380x0a,
2390x08,
2400x08,
2410x08,
2420x38,
2430x78,
2440x30,
2450x00,
2460x00,
2470x00,
2480x00,
249
2500x00,
2510x10,
2520x18,
2530x1c,
2540x1e,
2550x1e,
2560x16,
2570x12,
2580x72,
2590xf2,
2600x62,
2610x0e,
2620x1e,
2630x0c,
2640x00,
2650x00,
266
2670x00,
2680x00,
2690x00,
2700x10,
2710x92,
2720x54,
2730x38,
2740xfe,
2750x38,
2760x54,
2770x92,
2780x10,
2790x00,
2800x00,
2810x00,
2820x00,
283
2840x00,
2850x00,
2860x00,
2870x80,
2880xc0,
2890xe0,
2900xb8,
2910x8e,
2920xb8,
2930xe0,
2940xc0,
2950x80,
2960x00,
2970x00,
2980x00,
2990x00,
300
3010x00,
3020x00,
3030x00,
3040x02,
3050x06,
3060x0e,
3070x3a,
3080xe2,
3090x3a,
3100x0e,
3110x06,
3120x02,
3130x00,
3140x00,
3150x00,
3160x00,
317
3180x00,
3190x00,
3200x10,
3210x38,
3220x7c,
3230xd6,
3240x10,
3250x10,
3260x10,
3270x10,
3280xd6,
3290x7c,
3300x38,
3310x10,
3320x00,
3330x00,
334
3350x00,
3360x42,
3370xe7,
3380xe7,
3390xe7,
3400xe7,
3410x42,
3420x42,
3430x42,
3440x00,
3450x66,
3460x66,
3470x66,
3480x00,
3490x00,
3500x00,
351
3520x00,
3530x7f,
3540xca,
3550xca,
3560xca,
3570xca,
3580x7a,
3590x0a,
3600x0a,
3610x0a,
3620x0a,
3630x0a,
3640x1b,
3650x00,
3660x00,
3670x00,
368
3690x00,
3700x1e,
3710x31,
3720x78,
3730xcc,
3740xc6,
3750xc3,
3760x63,
3770x33,
3780x1e,
3790x8c,
3800x78,
3810x00,
3820x00,
3830x00,
3840x00,
385
3860x00,
3870x00,
3880x00,
3890x00,
3900x00,
3910x00,
3920x00,
3930x00,
3940xfe,
3950xfe,
3960xfe,
3970xfe,
3980x00,
3990x00,
4000x00,
4010x00,
402
4030x00,
4040x00,
4050x10,
4060x38,
4070x7c,
4080xd6,
4090x10,
4100x10,
4110x10,
4120x10,
4130xd6,
4140x7c,
4150x38,
4160x10,
4170xfe,
4180x00,
419
4200x00,
4210x00,
4220x10,
4230x38,
4240x7c,
4250xd6,
4260x10,
4270x10,
4280x10,
4290x10,
4300x10,
4310x10,
4320x10,
4330x10,
4340x00,
4350x00,
436
4370x00,
4380x00,
4390x10,
4400x10,
4410x10,
4420x10,
4430x10,
4440x10,
4450x10,
4460x10,
4470xd6,
4480x7c,
4490x38,
4500x10,
4510x00,
4520x00,
453
4540x00,
4550x00,
4560x00,
4570x00,
4580x00,
4590x08,
4600x0c,
4610x06,
4620xff,
4630x06,
4640x0c,
4650x08,
4660x00,
4670x00,
4680x00,
4690x00,
470
4710x00,
4720x00,
4730x00,
4740x00,
4750x00,
4760x10,
4770x30,
4780x60,
4790xff,
4800x60,
4810x30,
4820x10,
4830x00,
4840x00,
4850x00,
4860x00,
487
4880x22,
4890x44,
4900x88,
4910xcc,
4920xee,
4930x44,
4940x00,
4950x00,
4960x00,
4970x00,
4980x00,
4990x00,
5000x00,
5010x00,
5020x00,
5030x00,
504
5050x00,
5060x00,
5070x00,
5080x00,
5090x00,
5100x24,
5110x42,
5120xff,
5130x42,
5140x24,
5150x00,
5160x00,
5170x00,
5180x00,
5190x00,
5200x00,
521
5220x00,
5230x00,
5240x00,
5250x10,
5260x38,
5270x38,
5280x6c,
5290x6c,
5300xc6,
5310xfe,
5320x00,
5330x00,
5340x00,
5350x00,
5360x00,
5370x00,
538
5390x00,
5400x00,
5410x00,
5420xfe,
5430xc6,
5440x6c,
5450x6c,
5460x38,
5470x38,
5480x10,
5490x00,
5500x00,
5510x00,
5520x00,
5530x00,
5540x00,
555
5560x00,
5570x00,
5580x00,
5590x00,
5600x00,
5610x00,
5620x00,
5630x00,
5640x00,
5650x00,
5660x00,
5670x00,
5680x00,
5690x00,
5700x00,
5710x00,
572
5730x00,
5740x18,
5750x3c,
5760x3c,
5770x3c,
5780x3c,
5790x18,
5800x18,
5810x18,
5820x10,
5830x00,
5840x18,
5850x18,
5860x00,
5870x00,
5880x00,
589
5900x22,
5910x77,
5920x33,
5930x11,
5940x22,
5950x44,
5960x00,
5970x00,
5980x00,
5990x00,
6000x00,
6010x00,
6020x00,
6030x00,
6040x00,
6050x00,
606
6070x00,
6080x00,
6090x12,
6100x12,
6110x12,
6120x7f,
6130x24,
6140x24,
6150x24,
6160xfe,
6170x48,
6180x48,
6190x48,
6200x00,
6210x00,
6220x00,
623
6240x10,
6250x10,
6260x7c,
6270xd2,
6280xd0,
6290xd0,
6300xd0,
6310x7c,
6320x16,
6330x16,
6340x16,
6350x96,
6360x7c,
6370x10,
6380x10,
6390x00,
640
6410x00,
6420x42,
6430xbe,
6440x44,
6450x0c,
6460x08,
6470x18,
6480x10,
6490x30,
6500x20,
6510x64,
6520x4a,
6530xc4,
6540x00,
6550x00,
6560x00,
657
6580x00,
6590x38,
6600x6c,
6610x6c,
6620x6c,
6630x38,
6640x37,
6650x72,
6660xdc,
6670xcc,
6680xcc,
6690xcc,
6700x77,
6710x00,
6720x00,
6730x00,
674
6750x10,
6760x38,
6770x18,
6780x08,
6790x10,
6800x20,
6810x00,
6820x00,
6830x00,
6840x00,
6850x00,
6860x00,
6870x00,
6880x00,
6890x00,
6900x00,
691
6920x00,
6930x04,
6940x08,
6950x10,
6960x10,
6970x30,
6980x30,
6990x30,
7000x30,
7010x30,
7020x10,
7030x10,
7040x08,
7050x04,
7060x00,
7070x00,
708
7090x00,
7100x20,
7110x10,
7120x08,
7130x08,
7140x0c,
7150x0c,
7160x0c,
7170x0c,
7180x0c,
7190x08,
7200x08,
7210x10,
7220x20,
7230x00,
7240x00,
725
7260x00,
7270x00,
7280x00,
7290x00,
7300x44,
7310x28,
7320x38,
7330xfe,
7340x38,
7350x28,
7360x44,
7370x00,
7380x00,
7390x00,
7400x00,
7410x00,
742
7430x00,
7440x00,
7450x00,
7460x00,
7470x00,
7480x18,
7490x18,
7500x7e,
7510x18,
7520x18,
7530x00,
7540x00,
7550x00,
7560x00,
7570x00,
7580x00,
759
7600x00,
7610x00,
7620x00,
7630x00,
7640x00,
7650x00,
7660x00,
7670x00,
7680x00,
7690x00,
7700x10,
7710x38,
7720x18,
7730x08,
7740x10,
7750x20,
776
7770x00,
7780x00,
7790x00,
7800x00,
7810x00,
7820x00,
7830x00,
7840x7e,
7850x00,
7860x00,
7870x00,
7880x00,
7890x00,
7900x00,
7910x00,
7920x00,
793
7940x00,
7950x00,
7960x00,
7970x00,
7980x00,
7990x00,
8000x00,
8010x00,
8020x00,
8030x00,
8040x10,
8050x38,
8060x10,
8070x00,
8080x00,
8090x00,
810
8110x00,
8120x06,
8130x06,
8140x0c,
8150x0c,
8160x18,
8170x18,
8180x30,
8190x30,
8200x60,
8210x60,
8220xc0,
8230xc0,
8240x00,
8250x00,
8260x00,
827
8280x00,
8290x00,
8300x00,
8310x00,
8320x3c,
8330x46,
8340xc6,
8350xc6,
8360xc6,
8370xc6,
8380xc6,
8390xc4,
8400x78,
8410x00,
8420x00,
8430x00,
844
8450x00,
8460x00,
8470x00,
8480x00,
8490x08,
8500x18,
8510x78,
8520x18,
8530x18,
8540x18,
8550x18,
8560x18,
8570x7e,
8580x00,
8590x00,
8600x00,
861
8620x00,
8630x00,
8640x00,
8650x00,
8660x7c,
8670x86,
8680x06,
8690x0c,
8700x18,
8710x20,
8720x40,
8730xc1,
8740xfe,
8750x00,
8760x00,
8770x00,
878
8790x00,
8800x00,
8810x00,
8820x00,
8830x3c,
8840x46,
8850x04,
8860x08,
8870x1c,
8880x06,
8890x06,
8900x06,
8910x06,
8920x0c,
8930x70,
8940x00,
895
8960x00,
8970x00,
8980x00,
8990x00,
9000x04,
9010x08,
9020x10,
9030x2c,
9040x4c,
9050x8c,
9060x8c,
9070xfe,
9080x0c,
9090x0c,
9100x0c,
9110x00,
912
9130x00,
9140x00,
9150x00,
9160x02,
9170x3c,
9180x20,
9190x20,
9200x70,
9210x0c,
9220x06,
9230x06,
9240x06,
9250x06,
9260x0c,
9270x70,
9280x00,
929
9300x00,
9310x00,
9320x18,
9330x20,
9340x40,
9350xc0,
9360xdc,
9370xc6,
9380xc6,
9390xc6,
9400xc6,
9410x44,
9420x38,
9430x00,
9440x00,
9450x00,
946
9470x00,
9480x00,
9490x00,
9500x40,
9510x7e,
9520x82,
9530x06,
9540x04,
9550x0c,
9560x18,
9570x18,
9580x30,
9590x30,
9600x30,
9610x30,
9620x00,
963
9640x00,
9650x00,
9660x7c,
9670xc6,
9680xc6,
9690x64,
9700x38,
9710x4c,
9720xc6,
9730xc6,
9740xc6,
9750xc6,
9760x7c,
9770x00,
9780x00,
9790x00,
980
9810x00,
9820x00,
9830x00,
9840x00,
9850x38,
9860x44,
9870xc6,
9880xc6,
9890x76,
9900x06,
9910x06,
9920x06,
9930x04,
9940x08,
9950x30,
9960x00,
997
9980x00,
9990x00,
10000x00,
10010x00,
10020x10,
10030x38,
10040x10,
10050x00,
10060x00,
10070x00,
10080x10,
10090x38,
10100x10,
10110x00,
10120x00,
10130x00,
1014
10150x00,
10160x00,
10170x00,
10180x00,
10190x10,
10200x38,
10210x10,
10220x00,
10230x00,
10240x00,
10250x10,
10260x38,
10270x18,
10280x08,
10290x10,
10300x20,
1031
10320x00,
10330x06,
10340x0c,
10350x18,
10360x30,
10370x60,
10380xa0,
10390xa0,
10400x60,
10410x30,
10420x18,
10430x0c,
10440x06,
10450x00,
10460x00,
10470x00,
1048
10490x00,
10500x00,
10510x00,
10520x00,
10530x00,
10540x7e,
10550x00,
10560x00,
10570x7e,
10580x00,
10590x00,
10600x00,
10610x00,
10620x00,
10630x00,
10640x00,
1065
10660x00,
10670x60,
10680x30,
10690x18,
10700x0c,
10710x06,
10720x05,
10730x05,
10740x06,
10750x0c,
10760x18,
10770x30,
10780x60,
10790x00,
10800x00,
10810x00,
1082
10830x00,
10840x7c,
10850x86,
10860xc6,
10870x06,
10880x04,
10890x08,
10900x10,
10910x10,
10920x18,
10930x00,
10940x18,
10950x18,
10960x00,
10970x00,
10980x00,
1099
11000x00,
11010x00,
11020x3c,
11030x46,
11040xc6,
11050xce,
11060xd6,
11070xd6,
11080xd6,
11090xdc,
11100xc0,
11110xc4,
11120x78,
11130x00,
11140x00,
11150x00,
1116
11170x00,
11180x18,
11190x18,
11200x18,
11210x3c,
11220x2c,
11230x2c,
11240x2c,
11250x7e,
11260x46,
11270x46,
11280x46,
11290xef,
11300x00,
11310x00,
11320x00,
1133
11340x00,
11350xfc,
11360x66,
11370x66,
11380x66,
11390x66,
11400x7c,
11410x66,
11420x66,
11430x66,
11440x66,
11450x66,
11460xfc,
11470x00,
11480x00,
11490x00,
1150
11510x00,
11520x3a,
11530x66,
11540xc2,
11550xc0,
11560xc0,
11570xc0,
11580xc0,
11590xc0,
11600xc0,
11610xc0,
11620x62,
11630x3c,
11640x00,
11650x00,
11660x00,
1167
11680x00,
11690xfc,
11700x66,
11710x63,
11720x63,
11730x63,
11740x63,
11750x63,
11760x63,
11770x63,
11780x63,
11790x66,
11800xfc,
11810x00,
11820x00,
11830x00,
1184
11850x00,
11860xff,
11870x61,
11880x60,
11890x60,
11900x64,
11910x7c,
11920x64,
11930x60,
11940x60,
11950x60,
11960x61,
11970xfe,
11980x00,
11990x00,
12000x00,
1201
12020x00,
12030xff,
12040x61,
12050x61,
12060x60,
12070x64,
12080x7c,
12090x64,
12100x60,
12110x60,
12120x60,
12130x60,
12140xf0,
12150x00,
12160x00,
12170x00,
1218
12190x00,
12200x3a,
12210x66,
12220xc2,
12230xc0,
12240xc0,
12250xc0,
12260xcf,
12270xc6,
12280xc6,
12290xc6,
12300x66,
12310x38,
12320x00,
12330x00,
12340x00,
1235
12360x00,
12370xf7,
12380x62,
12390x62,
12400x62,
12410x62,
12420x7e,
12430x62,
12440x62,
12450x62,
12460x62,
12470x62,
12480xf7,
12490x00,
12500x00,
12510x00,
1252
12530x00,
12540x3c,
12550x18,
12560x18,
12570x18,
12580x18,
12590x18,
12600x18,
12610x18,
12620x18,
12630x18,
12640x18,
12650x3c,
12660x00,
12670x00,
12680x00,
1269
12700x00,
12710x1e,
12720x0c,
12730x0c,
12740x0c,
12750x0c,
12760x0c,
12770x0c,
12780x0c,
12790x0c,
12800x0c,
12810x0c,
12820x0c,
12830x0c,
12840x08,
12850xf0,
1286
12870x00,
12880xf7,
12890x64,
12900x6c,
12910x68,
12920x68,
12930x78,
12940x6c,
12950x6c,
12960x6c,
12970x66,
12980x66,
12990xf7,
13000x00,
13010x00,
13020x00,
1303
13040x00,
13050xf8,
13060x60,
13070x60,
13080x60,
13090x60,
13100x60,
13110x60,
13120x60,
13130x60,
13140x60,
13150x61,
13160xfe,
13170x00,
13180x00,
13190x00,
1320
13210x00,
13220xc3,
13230x66,
13240x76,
13250x7e,
13260x56,
13270x56,
13280x46,
13290x46,
13300x46,
13310x46,
13320x46,
13330xef,
13340x00,
13350x00,
13360x00,
1337
13380x00,
13390xe7,
13400x62,
13410x62,
13420x72,
13430x52,
13440x5a,
13450x4a,
13460x4e,
13470x46,
13480x46,
13490x42,
13500xe2,
13510x00,
13520x00,
13530x00,
1354
13550x00,
13560x3c,
13570x66,
13580xc3,
13590xc3,
13600xc3,
13610xc3,
13620xc3,
13630xc3,
13640xc3,
13650xc3,
13660x66,
13670x3c,
13680x00,
13690x00,
13700x00,
1371
13720x00,
13730xfc,
13740x66,
13750x66,
13760x66,
13770x66,
13780x6c,
13790x60,
13800x60,
13810x60,
13820x60,
13830x60,
13840xf0,
13850x00,
13860x00,
13870x00,
1388
13890x00,
13900x3c,
13910x66,
13920xc3,
13930xc3,
13940xc3,
13950xc3,
13960xc3,
13970xc3,
13980xc3,
13990xc3,
14000x66,
14010x3c,
14020x10,
14030x39,
14040x0e,
1405
14060x00,
14070xfc,
14080x66,
14090x66,
14100x66,
14110x66,
14120x7c,
14130x6c,
14140x66,
14150x66,
14160x66,
14170x66,
14180xf3,
14190x00,
14200x00,
14210x00,
1422
14230x00,
14240x7a,
14250xc6,
14260xc2,
14270xc0,
14280x70,
14290x3c,
14300x0e,
14310x06,
14320x06,
14330x86,
14340xc6,
14350xbc,
14360x00,
14370x00,
14380x00,
1439
14400x00,
14410xff,
14420x99,
14430x18,
14440x18,
14450x18,
14460x18,
14470x18,
14480x18,
14490x18,
14500x18,
14510x18,
14520x3c,
14530x00,
14540x00,
14550x00,
1456
14570x00,
14580xf7,
14590x62,
14600x62,
14610x62,
14620x62,
14630x62,
14640x62,
14650x62,
14660x62,
14670x62,
14680x62,
14690x3c,
14700x00,
14710x00,
14720x00,
1473
14740x00,
14750xf7,
14760x62,
14770x62,
14780x62,
14790x76,
14800x34,
14810x34,
14820x34,
14830x3c,
14840x18,
14850x18,
14860x18,
14870x00,
14880x00,
14890x00,
1490
14910x00,
14920xf7,
14930x62,
14940x62,
14950x62,
14960x62,
14970x6a,
14980x6a,
14990x6a,
15000x6a,
15010x7e,
15020x7e,
15030x34,
15040x00,
15050x00,
15060x00,
1507
15080x00,
15090xf7,
15100x62,
15110x62,
15120x34,
15130x34,
15140x18,
15150x18,
15160x2c,
15170x2c,
15180x46,
15190x46,
15200xef,
15210x00,
15220x00,
15230x00,
1524
15250x00,
15260xf7,
15270x62,
15280x62,
15290x62,
15300x34,
15310x34,
15320x18,
15330x18,
15340x18,
15350x18,
15360x18,
15370x3c,
15380x00,
15390x00,
15400x00,
1541
15420x00,
15430x7f,
15440x46,
15450x86,
15460x0c,
15470x0c,
15480x18,
15490x18,
15500x30,
15510x30,
15520x61,
15530x62,
15540xfe,
15550x00,
15560x00,
15570x00,
1558
15590x00,
15600x3c,
15610x30,
15620x30,
15630x30,
15640x30,
15650x30,
15660x30,
15670x30,
15680x30,
15690x30,
15700x30,
15710x3c,
15720x00,
15730x00,
15740x00,
1575
15760x00,
15770xc0,
15780xc0,
15790x60,
15800x60,
15810x30,
15820x30,
15830x18,
15840x18,
15850x0c,
15860x0c,
15870x06,
15880x06,
15890x00,
15900x00,
15910x00,
1592
15930x00,
15940x3c,
15950x0c,
15960x0c,
15970x0c,
15980x0c,
15990x0c,
16000x0c,
16010x0c,
16020x0c,
16030x0c,
16040x0c,
16050x3c,
16060x00,
16070x00,
16080x00,
1609
16100x00,
16110x10,
16120x38,
16130x4c,
16140x86,
16150x00,
16160x00,
16170x00,
16180x00,
16190x00,
16200x00,
16210x00,
16220x00,
16230x00,
16240x00,
16250x00,
1626
16270x00,
16280x00,
16290x00,
16300x00,
16310x00,
16320x00,
16330x00,
16340x00,
16350x00,
16360x00,
16370x00,
16380x00,
16390x00,
16400xff,
16410x00,
16420x00,
1643
16440x00,
16450x18,
16460x20,
16470x30,
16480x38,
16490x10,
16500x00,
16510x00,
16520x00,
16530x00,
16540x00,
16550x00,
16560x00,
16570x00,
16580x00,
16590x00,
1660
16610x00,
16620x00,
16630x00,
16640x00,
16650x00,
16660x78,
16670x8c,
16680x0c,
16690x3c,
16700xcc,
16710xcc,
16720xcd,
16730x76,
16740x00,
16750x00,
16760x00,
1677
16780x00,
16790x20,
16800xe0,
16810x60,
16820x60,
16830x6c,
16840x76,
16850x66,
16860x66,
16870x66,
16880x66,
16890x76,
16900x6c,
16910x00,
16920x00,
16930x00,
1694
16950x00,
16960x00,
16970x00,
16980x00,
16990x00,
17000x3c,
17010x66,
17020x60,
17030x60,
17040x60,
17050x60,
17060x62,
17070x3c,
17080x00,
17090x00,
17100x00,
1711
17120x00,
17130x04,
17140x1c,
17150x0c,
17160x0c,
17170x6c,
17180xdc,
17190xcc,
17200xcc,
17210xcc,
17220xcc,
17230xdc,
17240x66,
17250x00,
17260x00,
17270x00,
1728
17290x00,
17300x00,
17310x00,
17320x00,
17330x00,
17340x3c,
17350x66,
17360x7e,
17370x60,
17380x60,
17390x60,
17400x62,
17410x3c,
17420x00,
17430x00,
17440x00,
1745
17460x00,
17470x1e,
17480x31,
17490x33,
17500x30,
17510x30,
17520x78,
17530x30,
17540x30,
17550x30,
17560x30,
17570x30,
17580x78,
17590x00,
17600x00,
17610x00,
1762
17630x00,
17640x00,
17650x00,
17660x00,
17670x00,
17680x7b,
17690xce,
17700xcc,
17710xcc,
17720xcc,
17730x78,
17740x60,
17750x7c,
17760x86,
17770xc6,
17780x7c,
1779
17800x00,
17810x20,
17820xe0,
17830x60,
17840x60,
17850x6c,
17860x76,
17870x66,
17880x66,
17890x66,
17900x66,
17910x66,
17920xf7,
17930x00,
17940x00,
17950x00,
1796
17970x00,
17980x10,
17990x38,
18000x10,
18010x00,
18020x18,
18030x38,
18040x18,
18050x18,
18060x18,
18070x18,
18080x18,
18090x3c,
18100x00,
18110x00,
18120x00,
1813
18140x00,
18150x08,
18160x1c,
18170x08,
18180x00,
18190x0c,
18200x1c,
18210x0c,
18220x0c,
18230x0c,
18240x0c,
18250x0c,
18260x6c,
18270x4c,
18280x38,
18290x00,
1830
18310x00,
18320x20,
18330xe0,
18340x60,
18350x60,
18360x67,
18370x66,
18380x6c,
18390x78,
18400x6c,
18410x6c,
18420x66,
18430xe7,
18440x00,
18450x00,
18460x00,
1847
18480x00,
18490x08,
18500x38,
18510x18,
18520x18,
18530x18,
18540x18,
18550x18,
18560x18,
18570x18,
18580x18,
18590x18,
18600x3c,
18610x00,
18620x00,
18630x00,
1864
18650x00,
18660x00,
18670x00,
18680x00,
18690x00,
18700x6a,
18710xfe,
18720x6a,
18730x6a,
18740x6a,
18750x62,
18760x62,
18770xf7,
18780x00,
18790x00,
18800x00,
1881
18820x00,
18830x00,
18840x00,
18850x00,
18860x00,
18870x5c,
18880xf6,
18890x66,
18900x66,
18910x66,
18920x66,
18930x66,
18940xf7,
18950x00,
18960x00,
18970x00,
1898
18990x00,
19000x00,
19010x00,
19020x00,
19030x00,
19040x3c,
19050x66,
19060x66,
19070x66,
19080x66,
19090x66,
19100x66,
19110x3c,
19120x00,
19130x00,
19140x00,
1915
19160x00,
19170x00,
19180x00,
19190x00,
19200x00,
19210x5c,
19220xe6,
19230x66,
19240x66,
19250x66,
19260x66,
19270x66,
19280x7c,
19290x60,
19300x60,
19310xf0,
1932
19330x00,
19340x00,
19350x00,
19360x00,
19370x00,
19380x76,
19390xcc,
19400xcc,
19410xcc,
19420xcc,
19430xcc,
19440xcc,
19450x7c,
19460x0c,
19470x0c,
19480x1e,
1949
19500x00,
19510x00,
19520x00,
19530x00,
19540x00,
19550x5e,
19560xf6,
19570x60,
19580x60,
19590x60,
19600x60,
19610x60,
19620xf0,
19630x00,
19640x00,
19650x00,
1966
19670x00,
19680x00,
19690x00,
19700x00,
19710x00,
19720x7a,
19730xc6,
19740x72,
19750x1c,
19760x06,
19770x86,
19780xc6,
19790xbc,
19800x00,
19810x00,
19820x00,
1983
19840x00,
19850x00,
19860x00,
19870x10,
19880x30,
19890x7c,
19900x30,
19910x30,
19920x30,
19930x30,
19940x30,
19950x34,
19960x18,
19970x00,
19980x00,
19990x00,
2000
20010x00,
20020x00,
20030x00,
20040x00,
20050x00,
20060xee,
20070x66,
20080x66,
20090x66,
20100x66,
20110x66,
20120x67,
20130x3a,
20140x00,
20150x00,
20160x00,
2017
20180x00,
20190x00,
20200x00,
20210x00,
20220x00,
20230xf7,
20240x62,
20250x76,
20260x34,
20270x34,
20280x3c,
20290x18,
20300x18,
20310x00,
20320x00,
20330x00,
2034
20350x00,
20360x00,
20370x00,
20380x00,
20390x00,
20400xf7,
20410x62,
20420x6a,
20430x6a,
20440x6a,
20450x6a,
20460x7e,
20470x24,
20480x00,
20490x00,
20500x00,
2051
20520x00,
20530x00,
20540x00,
20550x00,
20560x00,
20570xf7,
20580x62,
20590x34,
20600x18,
20610x2c,
20620x46,
20630x46,
20640xef,
20650x00,
20660x00,
20670x00,
2068
20690x00,
20700x00,
20710x00,
20720x00,
20730x00,
20740xf7,
20750x62,
20760x62,
20770x34,
20780x34,
20790x18,
20800x18,
20810x18,
20820x10,
20830xb0,
20840xe0,
2085
20860x00,
20870x00,
20880x00,
20890x00,
20900x00,
20910xfe,
20920x8c,
20930x18,
20940x30,
20950x30,
20960x60,
20970xc2,
20980xfe,
20990x00,
21000x00,
21010x00,
2102
21030x00,
21040x0e,
21050x18,
21060x10,
21070x10,
21080x08,
21090x70,
21100x70,
21110x08,
21120x10,
21130x10,
21140x18,
21150x0e,
21160x00,
21170x00,
21180x00,
2119
21200x18,
21210x18,
21220x18,
21230x18,
21240x18,
21250x18,
21260x18,
21270x18,
21280x18,
21290x18,
21300x18,
21310x18,
21320x18,
21330x18,
21340x00,
21350x00,
2136
21370x00,
21380x70,
21390x18,
21400x08,
21410x08,
21420x10,
21430x0e,
21440x0e,
21450x10,
21460x08,
21470x08,
21480x18,
21490x70,
21500x00,
21510x00,
21520x00,
2153
21540x00,
21550x00,
21560x00,
21570x00,
21580x00,
21590x00,
21600x76,
21610xdc,
21620x00,
21630x00,
21640x00,
21650x00,
21660x00,
21670x00,
21680x00,
21690x00,
2170
21710x00,
21720x00,
21730x00,
21740x00,
21750x10,
21760x38,
21770x6c,
21780xc6,
21790xc6,
21800xc6,
21810xfe,
21820x00,
21830x00,
21840x00,
21850x00,
21860x00,
2187
21880x00,
21890x00,
21900x3a,
21910x66,
21920xc2,
21930xc0,
21940xc0,
21950xc0,
21960xc0,
21970xc0,
21980x62,
21990x3c,
22000x18,
22010x0c,
22020x24,
22030x18,
2204
22050x00,
22060x00,
22070x66,
22080x00,
22090x00,
22100xee,
22110x66,
22120x66,
22130x66,
22140x66,
22150x66,
22160x66,
22170x3b,
22180x00,
22190x00,
22200x00,
2221
22220x00,
22230x0c,
22240x18,
22250x20,
22260x00,
22270x3c,
22280x66,
22290x7e,
22300x60,
22310x60,
22320x60,
22330x62,
22340x3c,
22350x00,
22360x00,
22370x00,
2238
22390x00,
22400x30,
22410x58,
22420x8c,
22430x00,
22440x78,
22450x8c,
22460x0c,
22470x3c,
22480xcc,
22490xcc,
22500xcd,
22510x76,
22520x00,
22530x00,
22540x00,
2255
22560x00,
22570x00,
22580x66,
22590x00,
22600x00,
22610x78,
22620x8c,
22630x0c,
22640x3c,
22650xcc,
22660xcc,
22670xcd,
22680x76,
22690x00,
22700x00,
22710x00,
2272
22730x00,
22740x30,
22750x18,
22760x04,
22770x00,
22780x78,
22790x8c,
22800x0c,
22810x3c,
22820xcc,
22830xcc,
22840xcd,
22850x76,
22860x00,
22870x00,
22880x00,
2289
22900x38,
22910x44,
22920x44,
22930x38,
22940x00,
22950x78,
22960x8c,
22970x0c,
22980x3c,
22990xcc,
23000xcc,
23010xcd,
23020x76,
23030x00,
23040x00,
23050x00,
2306
23070x00,
23080x00,
23090x00,
23100x00,
23110x00,
23120x3c,
23130x66,
23140x60,
23150x60,
23160x60,
23170x60,
23180x62,
23190x3c,
23200x08,
23210x24,
23220x18,
2323
23240x00,
23250x18,
23260x2c,
23270x46,
23280x00,
23290x3c,
23300x66,
23310x7e,
23320x60,
23330x60,
23340x60,
23350x62,
23360x3c,
23370x00,
23380x00,
23390x00,
2340
23410x00,
23420x00,
23430x66,
23440x00,
23450x00,
23460x3c,
23470x66,
23480x7e,
23490x60,
23500x60,
23510x60,
23520x62,
23530x3c,
23540x00,
23550x00,
23560x00,
2357
23580x00,
23590x30,
23600x18,
23610x04,
23620x00,
23630x3c,
23640x66,
23650x7e,
23660x60,
23670x60,
23680x60,
23690x62,
23700x3c,
23710x00,
23720x00,
23730x00,
2374
23750x00,
23760x00,
23770x66,
23780x00,
23790x00,
23800x38,
23810x18,
23820x18,
23830x18,
23840x18,
23850x18,
23860x18,
23870x3c,
23880x00,
23890x00,
23900x00,
2391
23920x00,
23930x18,
23940x2c,
23950x46,
23960x00,
23970x38,
23980x18,
23990x18,
24000x18,
24010x18,
24020x18,
24030x18,
24040x3c,
24050x00,
24060x00,
24070x00,
2408
24090x00,
24100x60,
24110x30,
24120x08,
24130x00,
24140x38,
24150x18,
24160x18,
24170x18,
24180x18,
24190x18,
24200x18,
24210x3c,
24220x00,
24230x00,
24240x00,
2425
24260x66,
24270x18,
24280x18,
24290x18,
24300x3c,
24310x2c,
24320x2c,
24330x2c,
24340x7e,
24350x46,
24360x46,
24370x46,
24380xef,
24390x00,
24400x00,
24410x00,
2442
24430x18,
24440x24,
24450x18,
24460x18,
24470x3c,
24480x2c,
24490x2c,
24500x2c,
24510x7e,
24520x46,
24530x46,
24540x46,
24550xef,
24560x00,
24570x00,
24580x00,
2459
24600x0c,
24610x18,
24620xff,
24630x61,
24640x60,
24650x60,
24660x64,
24670x7c,
24680x64,
24690x60,
24700x60,
24710x61,
24720xfe,
24730x00,
24740x00,
24750x00,
2476
24770x00,
24780x00,
24790x00,
24800x00,
24810x00,
24820x76,
24830x9b,
24840x1b,
24850x3f,
24860xd8,
24870xd8,
24880xd9,
24890x6e,
24900x00,
24910x00,
24920x00,
2493
24940x00,
24950x1f,
24960x1d,
24970x1d,
24980x3c,
24990x2c,
25000x2e,
25010x2c,
25020x7c,
25030x4c,
25040x4c,
25050x4d,
25060xef,
25070x00,
25080x00,
25090x00,
2510
25110x00,
25120x18,
25130x2c,
25140x46,
25150x00,
25160x3c,
25170x66,
25180x66,
25190x66,
25200x66,
25210x66,
25220x66,
25230x3c,
25240x00,
25250x00,
25260x00,
2527
25280x00,
25290x00,
25300x66,
25310x00,
25320x00,
25330x3c,
25340x66,
25350x66,
25360x66,
25370x66,
25380x66,
25390x66,
25400x3c,
25410x00,
25420x00,
25430x00,
2544
25450x00,
25460x30,
25470x18,
25480x04,
25490x00,
25500x3c,
25510x66,
25520x66,
25530x66,
25540x66,
25550x66,
25560x66,
25570x3c,
25580x00,
25590x00,
25600x00,
2561
25620x00,
25630x18,
25640x2c,
25650x46,
25660x00,
25670xee,
25680x66,
25690x66,
25700x66,
25710x66,
25720x66,
25730x67,
25740x3a,
25750x00,
25760x00,
25770x00,
2578
25790x00,
25800x30,
25810x18,
25820x04,
25830x00,
25840xee,
25850x66,
25860x66,
25870x66,
25880x66,
25890x66,
25900x67,
25910x3a,
25920x00,
25930x00,
25940x00,
2595
25960x00,
25970x00,
25980x66,
25990x00,
26000x00,
26010xf7,
26020x62,
26030x62,
26040x34,
26050x34,
26060x18,
26070x18,
26080x18,
26090x10,
26100xb0,
26110xe0,
2612
26130x66,
26140x00,
26150x3c,
26160x66,
26170xc3,
26180xc3,
26190xc3,
26200xc3,
26210xc3,
26220xc3,
26230xc3,
26240x66,
26250x3c,
26260x00,
26270x00,
26280x00,
2629
26300x66,
26310x00,
26320xf7,
26330x62,
26340x62,
26350x62,
26360x62,
26370x62,
26380x62,
26390x62,
26400x62,
26410x62,
26420x3c,
26430x00,
26440x00,
26450x00,
2646
26470x00,
26480x00,
26490x10,
26500x10,
26510x10,
26520x7c,
26530xc6,
26540xc0,
26550xc0,
26560xc0,
26570xc0,
26580xc2,
26590x7c,
26600x10,
26610x10,
26620x00,
2663
26640x00,
26650x38,
26660x64,
26670x6c,
26680x60,
26690x60,
26700xf0,
26710x60,
26720x60,
26730x60,
26740x60,
26750x66,
26760xfc,
26770x00,
26780x00,
26790x00,
2680
26810x00,
26820x81,
26830xc3,
26840x66,
26850x3c,
26860x18,
26870xff,
26880x18,
26890x18,
26900xff,
26910x18,
26920x18,
26930x18,
26940x00,
26950x00,
26960x00,
2697
26980x00,
26990xfe,
27000x63,
27010x63,
27020x63,
27030x63,
27040x6e,
27050x60,
27060x64,
27070x6e,
27080x64,
27090x64,
27100xf5,
27110x06,
27120x00,
27130x00,
2714
27150x00,
27160x0e,
27170x19,
27180x1b,
27190x18,
27200x18,
27210x3c,
27220x18,
27230x18,
27240x18,
27250x18,
27260xd8,
27270x98,
27280x70,
27290x00,
27300x00,
2731
27320x00,
27330x0c,
27340x18,
27350x20,
27360x00,
27370x78,
27380x8c,
27390x0c,
27400x3c,
27410xcc,
27420xcc,
27430xcd,
27440x76,
27450x00,
27460x00,
27470x00,
2748
27490x00,
27500x06,
27510x0c,
27520x10,
27530x00,
27540x38,
27550x18,
27560x18,
27570x18,
27580x18,
27590x18,
27600x18,
27610x3c,
27620x00,
27630x00,
27640x00,
2765
27660x00,
27670x0c,
27680x18,
27690x20,
27700x00,
27710x3c,
27720x66,
27730x66,
27740x66,
27750x66,
27760x66,
27770x66,
27780x3c,
27790x00,
27800x00,
27810x00,
2782
27830x00,
27840x0c,
27850x18,
27860x20,
27870x00,
27880xee,
27890x66,
27900x66,
27910x66,
27920x66,
27930x66,
27940x67,
27950x3a,
27960x00,
27970x00,
27980x00,
2799
28000x00,
28010x00,
28020x32,
28030x4c,
28040x00,
28050x5c,
28060xf6,
28070x66,
28080x66,
28090x66,
28100x66,
28110x66,
28120xf7,
28130x00,
28140x00,
28150x00,
2816
28170x32,
28180x4c,
28190x00,
28200xe7,
28210x72,
28220x52,
28230x5a,
28240x4a,
28250x4e,
28260x46,
28270x46,
28280x42,
28290xe2,
28300x00,
28310x00,
28320x00,
2833
28340x00,
28350x78,
28360x8c,
28370x0c,
28380x3c,
28390xcc,
28400xcc,
28410xcd,
28420x76,
28430x00,
28440xfe,
28450x00,
28460x00,
28470x00,
28480x00,
28490x00,
2850
28510x00,
28520x3c,
28530x66,
28540x66,
28550x66,
28560x66,
28570x66,
28580x66,
28590x3c,
28600x00,
28610x7e,
28620x00,
28630x00,
28640x00,
28650x00,
28660x00,
2867
28680x00,
28690x30,
28700x30,
28710x00,
28720x30,
28730x10,
28740x10,
28750x20,
28760x40,
28770xc0,
28780xc6,
28790xc2,
28800x7c,
28810x00,
28820x00,
28830x00,
2884
28850x00,
28860x00,
28870x00,
28880x00,
28890x00,
28900x00,
28910xfe,
28920xc0,
28930xc0,
28940xc0,
28950xc0,
28960x00,
28970x00,
28980x00,
28990x00,
29000x00,
2901
29020x00,
29030x00,
29040x00,
29050x00,
29060x00,
29070x00,
29080xfe,
29090x06,
29100x06,
29110x06,
29120x06,
29130x00,
29140x00,
29150x00,
29160x00,
29170x00,
2918
29190x00,
29200x20,
29210xe0,
29220x63,
29230x66,
29240xfc,
29250x18,
29260x30,
29270x60,
29280xce,
29290x93,
29300x06,
29310x0c,
29320x1f,
29330x00,
29340x00,
2935
29360x00,
29370x20,
29380xe0,
29390x63,
29400x66,
29410xfc,
29420x18,
29430x30,
29440x64,
29450xc8,
29460x96,
29470x3f,
29480x06,
29490x06,
29500x00,
29510x00,
2952
29530x00,
29540x18,
29550x18,
29560x00,
29570x08,
29580x18,
29590x18,
29600x18,
29610x3c,
29620x3c,
29630x3c,
29640x3c,
29650x18,
29660x00,
29670x00,
29680x00,
2969
29700x00,
29710x00,
29720x00,
29730x00,
29740x00,
29750x36,
29760x6c,
29770xd8,
29780xd8,
29790x6c,
29800x36,
29810x00,
29820x00,
29830x00,
29840x00,
29850x00,
2986
29870x00,
29880x00,
29890x00,
29900x00,
29910x00,
29920xd8,
29930x6c,
29940x36,
29950x36,
29960x6c,
29970xd8,
29980x00,
29990x00,
30000x00,
30010x00,
30020x00,
3003
30040x82,
30050x10,
30060x82,
30070x10,
30080x82,
30090x10,
30100x82,
30110x10,
30120x82,
30130x10,
30140x82,
30150x10,
30160x82,
30170x10,
30180x82,
30190x10,
3020
30210x00,
30220x95,
30230x00,
30240xa9,
30250x00,
30260x95,
30270x00,
30280xa9,
30290x00,
30300x95,
30310x00,
30320xa9,
30330x00,
30340x95,
30350x00,
30360xa9,
3037
30380x92,
30390x49,
30400x92,
30410x49,
30420x92,
30430x49,
30440x92,
30450x49,
30460x92,
30470x49,
30480x92,
30490x49,
30500x92,
30510x49,
30520x92,
30530x49,
3054
30550x18,
30560x18,
30570x18,
30580x18,
30590x18,
30600x18,
30610x18,
30620x18,
30630x18,
30640x18,
30650x18,
30660x18,
30670x18,
30680x18,
30690x18,
30700x18,
3071
30720x18,
30730x18,
30740x18,
30750x18,
30760x18,
30770x18,
30780x18,
30790xf8,
30800x18,
30810x18,
30820x18,
30830x18,
30840x18,
30850x18,
30860x18,
30870x18,
3088
30890x18,
30900x18,
30910x18,
30920x18,
30930x18,
30940x18,
30950xf8,
30960x18,
30970x18,
30980xf8,
30990x18,
31000x18,
31010x18,
31020x18,
31030x18,
31040x18,
3105
31060x66,
31070x66,
31080x66,
31090x66,
31100x66,
31110x66,
31120x66,
31130xe6,
31140x66,
31150x66,
31160x66,
31170x66,
31180x66,
31190x66,
31200x66,
31210x66,
3122
31230x00,
31240x00,
31250x00,
31260x00,
31270x00,
31280x00,
31290x00,
31300xfe,
31310x66,
31320x66,
31330x66,
31340x66,
31350x66,
31360x66,
31370x66,
31380x66,
3139
31400x00,
31410x00,
31420x00,
31430x00,
31440x00,
31450x00,
31460xf8,
31470x18,
31480x18,
31490xf8,
31500x18,
31510x18,
31520x18,
31530x18,
31540x18,
31550x18,
3156
31570x66,
31580x66,
31590x66,
31600x66,
31610x66,
31620x66,
31630xe6,
31640x06,
31650x06,
31660xe6,
31670x66,
31680x66,
31690x66,
31700x66,
31710x66,
31720x66,
3173
31740x66,
31750x66,
31760x66,
31770x66,
31780x66,
31790x66,
31800x66,
31810x66,
31820x66,
31830x66,
31840x66,
31850x66,
31860x66,
31870x66,
31880x66,
31890x66,
3190
31910x00,
31920x00,
31930x00,
31940x00,
31950x00,
31960x00,
31970xfe,
31980x06,
31990x06,
32000xe6,
32010x66,
32020x66,
32030x66,
32040x66,
32050x66,
32060x66,
3207
32080x66,
32090x66,
32100x66,
32110x66,
32120x66,
32130x66,
32140xe6,
32150x06,
32160x06,
32170xfe,
32180x00,
32190x00,
32200x00,
32210x00,
32220x00,
32230x00,
3224
32250x66,
32260x66,
32270x66,
32280x66,
32290x66,
32300x66,
32310x66,
32320xfe,
32330x00,
32340x00,
32350x00,
32360x00,
32370x00,
32380x00,
32390x00,
32400x00,
3241
32420x18,
32430x18,
32440x18,
32450x18,
32460x18,
32470x18,
32480xf8,
32490x18,
32500x18,
32510xf8,
32520x00,
32530x00,
32540x00,
32550x00,
32560x00,
32570x00,
3258
32590x00,
32600x00,
32610x00,
32620x00,
32630x00,
32640x00,
32650x00,
32660xf8,
32670x18,
32680x18,
32690x18,
32700x18,
32710x18,
32720x18,
32730x18,
32740x18,
3275
32760x18,
32770x18,
32780x18,
32790x18,
32800x18,
32810x18,
32820x18,
32830x1f,
32840x00,
32850x00,
32860x00,
32870x00,
32880x00,
32890x00,
32900x00,
32910x00,
3292
32930x18,
32940x18,
32950x18,
32960x18,
32970x18,
32980x18,
32990x18,
33000xff,
33010x00,
33020x00,
33030x00,
33040x00,
33050x00,
33060x00,
33070x00,
33080x00,
3309
33100x00,
33110x00,
33120x00,
33130x00,
33140x00,
33150x00,
33160x00,
33170xff,
33180x18,
33190x18,
33200x18,
33210x18,
33220x18,
33230x18,
33240x18,
33250x18,
3326
33270x18,
33280x18,
33290x18,
33300x18,
33310x18,
33320x18,
33330x18,
33340x1f,
33350x18,
33360x18,
33370x18,
33380x18,
33390x18,
33400x18,
33410x18,
33420x18,
3343
33440x00,
33450x00,
33460x00,
33470x00,
33480x00,
33490x00,
33500x00,
33510xff,
33520x00,
33530x00,
33540x00,
33550x00,
33560x00,
33570x00,
33580x00,
33590x00,
3360
33610x18,
33620x18,
33630x18,
33640x18,
33650x18,
33660x18,
33670x18,
33680xff,
33690x18,
33700x18,
33710x18,
33720x18,
33730x18,
33740x18,
33750x18,
33760x18,
3377
33780x18,
33790x18,
33800x18,
33810x18,
33820x18,
33830x18,
33840x1f,
33850x18,
33860x18,
33870x1f,
33880x18,
33890x18,
33900x18,
33910x18,
33920x18,
33930x18,
3394
33950x66,
33960x66,
33970x66,
33980x66,
33990x66,
34000x66,
34010x66,
34020x67,
34030x66,
34040x66,
34050x66,
34060x66,
34070x66,
34080x66,
34090x66,
34100x66,
3411
34120x66,
34130x66,
34140x66,
34150x66,
34160x66,
34170x66,
34180x67,
34190x60,
34200x60,
34210x7f,
34220x00,
34230x00,
34240x00,
34250x00,
34260x00,
34270x00,
3428
34290x00,
34300x00,
34310x00,
34320x00,
34330x00,
34340x00,
34350x7f,
34360x60,
34370x60,
34380x67,
34390x66,
34400x66,
34410x66,
34420x66,
34430x66,
34440x66,
3445
34460x66,
34470x66,
34480x66,
34490x66,
34500x66,
34510x66,
34520xe7,
34530x00,
34540x00,
34550xff,
34560x00,
34570x00,
34580x00,
34590x00,
34600x00,
34610x00,
3462
34630x00,
34640x00,
34650x00,
34660x00,
34670x00,
34680x00,
34690xff,
34700x00,
34710x00,
34720xe7,
34730x66,
34740x66,
34750x66,
34760x66,
34770x66,
34780x66,
3479
34800x66,
34810x66,
34820x66,
34830x66,
34840x66,
34850x66,
34860x67,
34870x60,
34880x60,
34890x67,
34900x66,
34910x66,
34920x66,
34930x66,
34940x66,
34950x66,
3496
34970x00,
34980x00,
34990x00,
35000x00,
35010x00,
35020x00,
35030xff,
35040x00,
35050x00,
35060xff,
35070x00,
35080x00,
35090x00,
35100x00,
35110x00,
35120x00,
3513
35140x66,
35150x66,
35160x66,
35170x66,
35180x66,
35190x66,
35200xe7,
35210x00,
35220x00,
35230xe7,
35240x66,
35250x66,
35260x66,
35270x66,
35280x66,
35290x66,
3530
35310x18,
35320x18,
35330x18,
35340x18,
35350x18,
35360x18,
35370xff,
35380x00,
35390x00,
35400xff,
35410x00,
35420x00,
35430x00,
35440x00,
35450x00,
35460x00,
3547
35480x66,
35490x66,
35500x66,
35510x66,
35520x66,
35530x66,
35540x66,
35550xff,
35560x00,
35570x00,
35580x00,
35590x00,
35600x00,
35610x00,
35620x00,
35630x00,
3564
35650x00,
35660x00,
35670x00,
35680x00,
35690x00,
35700x00,
35710xff,
35720x00,
35730x00,
35740xff,
35750x18,
35760x18,
35770x18,
35780x18,
35790x18,
35800x18,
3581
35820x00,
35830x00,
35840x00,
35850x00,
35860x00,
35870x00,
35880x00,
35890xff,
35900x66,
35910x66,
35920x66,
35930x66,
35940x66,
35950x66,
35960x66,
35970x66,
3598
35990x66,
36000x66,
36010x66,
36020x66,
36030x66,
36040x66,
36050x66,
36060x7f,
36070x00,
36080x00,
36090x00,
36100x00,
36110x00,
36120x00,
36130x00,
36140x00,
3615
36160x18,
36170x18,
36180x18,
36190x18,
36200x18,
36210x18,
36220x1f,
36230x18,
36240x18,
36250x1f,
36260x00,
36270x00,
36280x00,
36290x00,
36300x00,
36310x00,
3632
36330x00,
36340x00,
36350x00,
36360x00,
36370x00,
36380x00,
36390x1f,
36400x18,
36410x18,
36420x1f,
36430x18,
36440x18,
36450x18,
36460x18,
36470x18,
36480x18,
3649
36500x00,
36510x00,
36520x00,
36530x00,
36540x00,
36550x00,
36560x00,
36570x7f,
36580x66,
36590x66,
36600x66,
36610x66,
36620x66,
36630x66,
36640x66,
36650x66,
3666
36670x66,
36680x66,
36690x66,
36700x66,
36710x66,
36720x66,
36730x66,
36740xff,
36750x66,
36760x66,
36770x66,
36780x66,
36790x66,
36800x66,
36810x66,
36820x66,
3683
36840x18,
36850x18,
36860x18,
36870x18,
36880x18,
36890x18,
36900xff,
36910x00,
36920x00,
36930xff,
36940x18,
36950x18,
36960x18,
36970x18,
36980x18,
36990x18,
3700
37010x18,
37020x18,
37030x18,
37040x18,
37050x18,
37060x18,
37070x18,
37080xf8,
37090x00,
37100x00,
37110x00,
37120x00,
37130x00,
37140x00,
37150x00,
37160x00,
3717
37180x00,
37190x00,
37200x00,
37210x00,
37220x00,
37230x00,
37240x00,
37250x1f,
37260x18,
37270x18,
37280x18,
37290x18,
37300x18,
37310x18,
37320x18,
37330x18,
3734
37350xff,
37360xff,
37370xff,
37380xff,
37390xff,
37400xff,
37410xff,
37420xff,
37430xff,
37440xff,
37450xff,
37460xff,
37470xff,
37480xff,
37490xff,
37500xff,
3751
37520x00,
37530x00,
37540x00,
37550x00,
37560x00,
37570x00,
37580x00,
37590x00,
37600xff,
37610xff,
37620xff,
37630xff,
37640xff,
37650xff,
37660xff,
37670xff,
3768
37690xf0,
37700xf0,
37710xf0,
37720xf0,
37730xf0,
37740xf0,
37750xf0,
37760xf0,
37770xf0,
37780xf0,
37790xf0,
37800xf0,
37810xf0,
37820xf0,
37830xf0,
37840xf0,
3785
37860x0f,
37870x0f,
37880x0f,
37890x0f,
37900x0f,
37910x0f,
37920x0f,
37930x0f,
37940x0f,
37950x0f,
37960x0f,
37970x0f,
37980x0f,
37990x0f,
38000x0f,
38010x0f,
3802
38030xff,
38040xff,
38050xff,
38060xff,
38070xff,
38080xff,
38090xff,
38100xff,
38110x00,
38120x00,
38130x00,
38140x00,
38150x00,
38160x00,
38170x00,
38180x00,
3819
38200x00,
38210x00,
38220x00,
38230x00,
38240x00,
38250x00,
38260x77,
38270xcc,
38280xcc,
38290xcc,
38300xcc,
38310xde,
38320x73,
38330x00,
38340x00,
38350x00,
3836
38370x00,
38380x7c,
38390xc6,
38400xc6,
38410xc6,
38420xc4,
38430xc8,
38440xc4,
38450xc6,
38460xc6,
38470xc6,
38480xc6,
38490xdc,
38500xc0,
38510xc0,
38520x00,
3853
38540x00,
38550xff,
38560x61,
38570x60,
38580x60,
38590x60,
38600x60,
38610x60,
38620x60,
38630x60,
38640x60,
38650x60,
38660xf0,
38670x00,
38680x00,
38690x00,
3870
38710x00,
38720x00,
38730x00,
38740x00,
38750x01,
38760x7e,
38770xa4,
38780x24,
38790x2c,
38800x6c,
38810x6c,
38820x6c,
38830x48,
38840x00,
38850x00,
38860x00,
3887
38880x00,
38890xff,
38900xc1,
38910x60,
38920x30,
38930x18,
38940x0c,
38950x18,
38960x30,
38970x60,
38980xc0,
38990xc1,
39000xfe,
39010x00,
39020x00,
39030x00,
3904
39050x00,
39060x00,
39070x00,
39080x00,
39090x00,
39100x7f,
39110xc8,
39120xc8,
39130xc8,
39140xc8,
39150xc8,
39160xc8,
39170x70,
39180x00,
39190x00,
39200x00,
3921
39220x00,
39230x00,
39240x00,
39250x00,
39260x00,
39270x22,
39280x66,
39290x66,
39300x66,
39310x66,
39320x66,
39330x7c,
39340x60,
39350x60,
39360x60,
39370xc0,
3938
39390x00,
39400x00,
39410x00,
39420x00,
39430x00,
39440x76,
39450xdc,
39460x18,
39470x18,
39480x18,
39490x18,
39500x18,
39510x10,
39520x00,
39530x00,
39540x00,
3955
39560x00,
39570x38,
39580x10,
39590x7c,
39600xd6,
39610xd6,
39620xd6,
39630xd6,
39640xd6,
39650xd6,
39660x7c,
39670x10,
39680x38,
39690x00,
39700x00,
39710x00,
3972
39730x00,
39740x38,
39750x6c,
39760xc6,
39770xc6,
39780xc6,
39790xfe,
39800xc6,
39810xc6,
39820xc6,
39830xc6,
39840x6c,
39850x38,
39860x00,
39870x00,
39880x00,
3989
39900x00,
39910x3c,
39920x66,
39930xc3,
39940xc3,
39950xc3,
39960xc3,
39970xc3,
39980x66,
39990x24,
40000x24,
40010xa5,
40020xe7,
40030x00,
40040x00,
40050x00,
4006
40070x00,
40080x1e,
40090x31,
40100x30,
40110x18,
40120x0c,
40130x3e,
40140x66,
40150x66,
40160x66,
40170x66,
40180x66,
40190x3c,
40200x00,
40210x00,
40220x00,
4023
40240x00,
40250x00,
40260x00,
40270x00,
40280x6e,
40290xff,
40300x99,
40310x99,
40320x99,
40330x99,
40340xff,
40350x76,
40360x00,
40370x00,
40380x00,
40390x00,
4040
40410x00,
40420x00,
40430x00,
40440x02,
40450x04,
40460x7c,
40470xca,
40480x92,
40490xa6,
40500x7c,
40510x40,
40520x80,
40530x00,
40540x00,
40550x00,
40560x00,
4057
40580x00,
40590x1c,
40600x30,
40610x60,
40620x60,
40630x60,
40640x7c,
40650x60,
40660x60,
40670x60,
40680x60,
40690x30,
40700x1c,
40710x00,
40720x00,
40730x00,
4074
40750x00,
40760x00,
40770x7c,
40780xc6,
40790xc6,
40800xc6,
40810xc6,
40820xc6,
40830xc6,
40840xc6,
40850xc6,
40860xc6,
40870xc6,
40880x00,
40890x00,
40900x00,
4091
40920x00,
40930x00,
40940x00,
40950xfe,
40960x00,
40970x00,
40980x00,
40990x7c,
41000x00,
41010x00,
41020x00,
41030xfe,
41040x00,
41050x00,
41060x00,
41070x00,
4108
41090x00,
41100x00,
41110x00,
41120x00,
41130x18,
41140x18,
41150x7e,
41160x18,
41170x18,
41180x00,
41190x00,
41200x7e,
41210x00,
41220x00,
41230x00,
41240x00,
4125
41260x00,
41270x00,
41280x00,
41290x30,
41300x18,
41310x0c,
41320x06,
41330x0c,
41340x18,
41350x30,
41360x00,
41370x7e,
41380x00,
41390x00,
41400x00,
41410x00,
4142
41430x00,
41440x00,
41450x00,
41460x0c,
41470x18,
41480x30,
41490x60,
41500x30,
41510x18,
41520x0c,
41530x00,
41540x7e,
41550x00,
41560x00,
41570x00,
41580x00,
4159
41600x00,
41610x00,
41620x00,
41630x0e,
41640x19,
41650x1b,
41660x18,
41670x18,
41680x18,
41690x18,
41700x18,
41710x18,
41720x18,
41730x18,
41740x18,
41750x18,
4176
41770x18,
41780x18,
41790x18,
41800x18,
41810x18,
41820x18,
41830x18,
41840x18,
41850x18,
41860xd8,
41870x98,
41880x70,
41890x00,
41900x00,
41910x00,
41920x00,
4193
41940x00,
41950x00,
41960x00,
41970x00,
41980x18,
41990x18,
42000x00,
42010x7e,
42020x00,
42030x18,
42040x18,
42050x00,
42060x00,
42070x00,
42080x00,
42090x00,
4210
42110x00,
42120x00,
42130x00,
42140x00,
42150x00,
42160x76,
42170xdc,
42180x00,
42190x00,
42200x76,
42210xdc,
42220x00,
42230x00,
42240x00,
42250x00,
42260x00,
4227
42280x00,
42290x38,
42300x44,
42310x44,
42320x44,
42330x38,
42340x00,
42350x00,
42360x00,
42370x00,
42380x00,
42390x00,
42400x00,
42410x00,
42420x00,
42430x00,
4244
42450x00,
42460x00,
42470x00,
42480x00,
42490x00,
42500x00,
42510x00,
42520x18,
42530x18,
42540x00,
42550x00,
42560x00,
42570x00,
42580x00,
42590x00,
42600x00,
4261
42620x00,
42630x00,
42640x00,
42650x00,
42660x00,
42670x00,
42680x00,
42690x00,
42700x18,
42710x00,
42720x00,
42730x00,
42740x00,
42750x00,
42760x00,
42770x00,
4278
42790x00,
42800x00,
42810x07,
42820x06,
42830x06,
42840x0c,
42850x0c,
42860x08,
42870x98,
42880xd0,
42890xf0,
42900x60,
42910x20,
42920x00,
42930x00,
42940x00,
4295
42960x00,
42970xcc,
42980x76,
42990x66,
43000x66,
43010x66,
43020x66,
43030xf7,
43040x00,
43050x00,
43060x00,
43070x00,
43080x00,
43090x00,
43100x00,
43110x00,
4312
43130x00,
43140x70,
43150x98,
43160x18,
43170x30,
43180x60,
43190x88,
43200xf8,
43210x00,
43220x00,
43230x00,
43240x00,
43250x00,
43260x00,
43270x00,
43280x00,
4329
43300x00,
43310x00,
43320x00,
43330x00,
43340x00,
43350x7c,
43360x64,
43370x64,
43380x64,
43390x64,
43400x64,
43410x7c,
43420x00,
43430x00,
43440x00,
43450x00,
4346
43470x00,
43480x00,
43490x00,
43500x00,
43510x00,
43520x00,
43530x00,
43540x00,
43550x00,
43560x00,
43570x00,
43580x00,
43590x00,
43600x00,
43610x00,
43620x00,
4363
4364};
4365
4366
4367const struct font_desc font_rl = {
4368 RL_IDX,
4369 "RomanLarge",
4370 8,
4371 16,
4372 patterns,
4373 -1
4374};
diff --git a/drivers/video/console/fonts.c b/drivers/video/console/fonts.c
index 9be83bed1959..4fd07d9eca03 100644
--- a/drivers/video/console/fonts.c
+++ b/drivers/video/console/fonts.c
@@ -64,10 +64,6 @@ static const struct font_desc *fonts[] = {
64#undef NO_FONTS 64#undef NO_FONTS
65 &font_mini_4x6, 65 &font_mini_4x6,
66#endif 66#endif
67#ifdef CONFIG_FONT_RL
68#undef NO_FONTS
69 &font_rl,
70#endif
71}; 67};
72 68
73#define num_fonts (sizeof(fonts)/sizeof(*fonts)) 69#define num_fonts (sizeof(fonts)/sizeof(*fonts))
diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c
index 957a3ada2b75..5abd3cb00671 100644
--- a/drivers/video/dnfb.c
+++ b/drivers/video/dnfb.c
@@ -227,9 +227,8 @@ void dnfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
227 * Initialization 227 * Initialization
228 */ 228 */
229 229
230static int __devinit dnfb_probe(struct device *device) 230static int __devinit dnfb_probe(struct platform_device *dev)
231{ 231{
232 struct platform_device *dev = to_platform_device(device);
233 struct fb_info *info; 232 struct fb_info *info;
234 int err = 0; 233 int err = 0;
235 234
@@ -257,7 +256,7 @@ static int __devinit dnfb_probe(struct device *device)
257 framebuffer_release(info); 256 framebuffer_release(info);
258 return err; 257 return err;
259 } 258 }
260 dev_set_drvdata(&dev->dev, info); 259 platform_set_drvdata(dev, info);
261 260
262 /* now we have registered we can safely setup the hardware */ 261 /* now we have registered we can safely setup the hardware */
263 out_8(AP_CONTROL_3A, RESET_CREG); 262 out_8(AP_CONTROL_3A, RESET_CREG);
@@ -271,10 +270,11 @@ static int __devinit dnfb_probe(struct device *device)
271 return err; 270 return err;
272} 271}
273 272
274static struct device_driver dnfb_driver = { 273static struct platform_driver dnfb_driver = {
275 .name = "dnfb",
276 .bus = &platform_bus_type,
277 .probe = dnfb_probe, 274 .probe = dnfb_probe,
275 .driver = {
276 .name = "dnfb",
277 },
278}; 278};
279 279
280static struct platform_device dnfb_device = { 280static struct platform_device dnfb_device = {
@@ -288,12 +288,12 @@ int __init dnfb_init(void)
288 if (fb_get_options("dnfb", NULL)) 288 if (fb_get_options("dnfb", NULL))
289 return -ENODEV; 289 return -ENODEV;
290 290
291 ret = driver_register(&dnfb_driver); 291 ret = platform_driver_register(&dnfb_driver);
292 292
293 if (!ret) { 293 if (!ret) {
294 ret = platform_device_register(&dnfb_device); 294 ret = platform_device_register(&dnfb_device);
295 if (ret) 295 if (ret)
296 driver_unregister(&dnfb_driver); 296 platform_driver_unregister(&dnfb_driver);
297 } 297 }
298 return ret; 298 return ret;
299} 299}
diff --git a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c
index 6a81a1dd8f3d..3b0e71383448 100644
--- a/drivers/video/epson1355fb.c
+++ b/drivers/video/epson1355fb.c
@@ -609,9 +609,9 @@ static void epson1355fb_platform_release(struct device *device)
609{ 609{
610} 610}
611 611
612static int epson1355fb_remove(struct device *device) 612static int epson1355fb_remove(struct platform_device *dev)
613{ 613{
614 struct fb_info *info = dev_get_drvdata(device); 614 struct fb_info *info = platform_get_drvdata(dev);
615 struct epson1355_par *par = info->par; 615 struct epson1355_par *par = info->par;
616 616
617 backlight_enable(0); 617 backlight_enable(0);
@@ -632,9 +632,8 @@ static int epson1355fb_remove(struct device *device)
632 return 0; 632 return 0;
633} 633}
634 634
635int __init epson1355fb_probe(struct device *device) 635int __init epson1355fb_probe(struct platform_device *dev)
636{ 636{
637 struct platform_device *dev = to_platform_device(device);
638 struct epson1355_par *default_par; 637 struct epson1355_par *default_par;
639 struct fb_info *info; 638 struct fb_info *info;
640 u8 revision; 639 u8 revision;
@@ -713,7 +712,7 @@ int __init epson1355fb_probe(struct device *device)
713 /* 712 /*
714 * Our driver data. 713 * Our driver data.
715 */ 714 */
716 dev_set_drvdata(&dev->dev, info); 715 platform_set_drvdata(dev, info);
717 716
718 printk(KERN_INFO "fb%d: %s frame buffer device\n", 717 printk(KERN_INFO "fb%d: %s frame buffer device\n",
719 info->node, info->fix.id); 718 info->node, info->fix.id);
@@ -721,15 +720,16 @@ int __init epson1355fb_probe(struct device *device)
721 return 0; 720 return 0;
722 721
723 bail: 722 bail:
724 epson1355fb_remove(device); 723 epson1355fb_remove(dev);
725 return rc; 724 return rc;
726} 725}
727 726
728static struct device_driver epson1355fb_driver = { 727static struct platform_driver epson1355fb_driver = {
729 .name = "epson1355fb",
730 .bus = &platform_bus_type,
731 .probe = epson1355fb_probe, 728 .probe = epson1355fb_probe,
732 .remove = epson1355fb_remove, 729 .remove = epson1355fb_remove,
730 .driver = {
731 .name = "epson1355fb",
732 },
733}; 733};
734 734
735static struct platform_device epson1355fb_device = { 735static struct platform_device epson1355fb_device = {
@@ -747,11 +747,11 @@ int __init epson1355fb_init(void)
747 if (fb_get_options("epson1355fb", NULL)) 747 if (fb_get_options("epson1355fb", NULL))
748 return -ENODEV; 748 return -ENODEV;
749 749
750 ret = driver_register(&epson1355fb_driver); 750 ret = platform_driver_register(&epson1355fb_driver);
751 if (!ret) { 751 if (!ret) {
752 ret = platform_device_register(&epson1355fb_device); 752 ret = platform_device_register(&epson1355fb_device);
753 if (ret) 753 if (ret)
754 driver_unregister(&epson1355fb_driver); 754 platform_driver_unregister(&epson1355fb_driver);
755 } 755 }
756 return ret; 756 return ret;
757} 757}
@@ -762,7 +762,7 @@ module_init(epson1355fb_init);
762static void __exit epson1355fb_exit(void) 762static void __exit epson1355fb_exit(void)
763{ 763{
764 platform_device_unregister(&epson1355fb_device); 764 platform_device_unregister(&epson1355fb_device);
765 driver_unregister(&epson1355fb_driver); 765 platform_driver_unregister(&epson1355fb_driver);
766} 766}
767 767
768/* ------------------------------------------------------------------------- */ 768/* ------------------------------------------------------------------------- */
diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c
index 04417dc16c2e..2584daec7bbf 100644
--- a/drivers/video/ffb.c
+++ b/drivers/video/ffb.c
@@ -57,6 +57,9 @@ static struct fb_ops ffb_ops = {
57 .fb_sync = ffb_sync, 57 .fb_sync = ffb_sync,
58 .fb_mmap = ffb_mmap, 58 .fb_mmap = ffb_mmap,
59 .fb_ioctl = ffb_ioctl, 59 .fb_ioctl = ffb_ioctl,
60#ifdef CONFIG_COMPAT
61 .fb_compat_ioctl = sbusfb_compat_ioctl,
62#endif
60}; 63};
61 64
62/* Register layout and definitions */ 65/* Register layout and definitions */
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index 9d5e4f342110..d744c51807b7 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -1105,12 +1105,11 @@ int __init gbefb_setup(char *options)
1105 return 0; 1105 return 0;
1106} 1106}
1107 1107
1108static int __init gbefb_probe(struct device *dev) 1108static int __init gbefb_probe(struct platform_device *p_dev)
1109{ 1109{
1110 int i, ret = 0; 1110 int i, ret = 0;
1111 struct fb_info *info; 1111 struct fb_info *info;
1112 struct gbefb_par *par; 1112 struct gbefb_par *par;
1113 struct platform_device *p_dev = to_platform_device(dev);
1114#ifndef MODULE 1113#ifndef MODULE
1115 char *options = NULL; 1114 char *options = NULL;
1116#endif 1115#endif
@@ -1204,8 +1203,8 @@ static int __init gbefb_probe(struct device *dev)
1204 goto out_gbe_unmap; 1203 goto out_gbe_unmap;
1205 } 1204 }
1206 1205
1207 dev_set_drvdata(&p_dev->dev, info); 1206 platform_set_drvdata(p_dev, info);
1208 gbefb_create_sysfs(dev); 1207 gbefb_create_sysfs(&p_dev->dev);
1209 1208
1210 printk(KERN_INFO "fb%d: %s rev %d @ 0x%08x using %dkB memory\n", 1209 printk(KERN_INFO "fb%d: %s rev %d @ 0x%08x using %dkB memory\n",
1211 info->node, info->fix.id, gbe_revision, (unsigned) GBE_BASE, 1210 info->node, info->fix.id, gbe_revision, (unsigned) GBE_BASE,
@@ -1231,10 +1230,9 @@ out_release_framebuffer:
1231 return ret; 1230 return ret;
1232} 1231}
1233 1232
1234static int __devexit gbefb_remove(struct device* dev) 1233static int __devexit gbefb_remove(struct platform_device* p_dev)
1235{ 1234{
1236 struct platform_device *p_dev = to_platform_device(dev); 1235 struct fb_info *info = platform_get_drvdata(p_dev);
1237 struct fb_info *info = dev_get_drvdata(&p_dev->dev);
1238 1236
1239 unregister_framebuffer(info); 1237 unregister_framebuffer(info);
1240 gbe_turn_off(); 1238 gbe_turn_off();
@@ -1252,18 +1250,19 @@ static int __devexit gbefb_remove(struct device* dev)
1252 return 0; 1250 return 0;
1253} 1251}
1254 1252
1255static struct device_driver gbefb_driver = { 1253static struct platform_driver gbefb_driver = {
1256 .name = "gbefb",
1257 .bus = &platform_bus_type,
1258 .probe = gbefb_probe, 1254 .probe = gbefb_probe,
1259 .remove = __devexit_p(gbefb_remove), 1255 .remove = __devexit_p(gbefb_remove),
1256 .driver = {
1257 .name = "gbefb",
1258 },
1260}; 1259};
1261 1260
1262static struct platform_device *gbefb_device; 1261static struct platform_device *gbefb_device;
1263 1262
1264int __init gbefb_init(void) 1263int __init gbefb_init(void)
1265{ 1264{
1266 int ret = driver_register(&gbefb_driver); 1265 int ret = platform_driver_register(&gbefb_driver);
1267 if (!ret) { 1266 if (!ret) {
1268 gbefb_device = platform_device_alloc("gbefb", 0); 1267 gbefb_device = platform_device_alloc("gbefb", 0);
1269 if (gbefb_device) { 1268 if (gbefb_device) {
@@ -1273,7 +1272,7 @@ int __init gbefb_init(void)
1273 } 1272 }
1274 if (ret) { 1273 if (ret) {
1275 platform_device_put(gbefb_device); 1274 platform_device_put(gbefb_device);
1276 driver_unregister(&gbefb_driver); 1275 platform_driver_unregister(&gbefb_driver);
1277 } 1276 }
1278 } 1277 }
1279 return ret; 1278 return ret;
@@ -1282,7 +1281,7 @@ int __init gbefb_init(void)
1282void __exit gbefb_exit(void) 1281void __exit gbefb_exit(void)
1283{ 1282{
1284 platform_device_unregister(gbefb_device); 1283 platform_device_unregister(gbefb_device);
1285 driver_unregister(&gbefb_driver); 1284 platform_driver_unregister(&gbefb_driver);
1286} 1285}
1287 1286
1288module_init(gbefb_init); 1287module_init(gbefb_init);
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index e20b9f3a255f..5924cc225c95 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -423,18 +423,18 @@ static void imxfb_setup_gpio(struct imxfb_info *fbi)
423 * Power management hooks. Note that we won't be called from IRQ context, 423 * Power management hooks. Note that we won't be called from IRQ context,
424 * unlike the blank functions above, so we may sleep. 424 * unlike the blank functions above, so we may sleep.
425 */ 425 */
426static int imxfb_suspend(struct device *dev, pm_message_t state) 426static int imxfb_suspend(struct platform_device *dev, pm_message_t state)
427{ 427{
428 struct imxfb_info *fbi = dev_get_drvdata(dev); 428 struct imxfb_info *fbi = platform_get_drvdata(dev);
429 pr_debug("%s\n",__FUNCTION__); 429 pr_debug("%s\n",__FUNCTION__);
430 430
431 imxfb_disable_controller(fbi); 431 imxfb_disable_controller(fbi);
432 return 0; 432 return 0;
433} 433}
434 434
435static int imxfb_resume(struct device *dev) 435static int imxfb_resume(struct platform_device *dev)
436{ 436{
437 struct imxfb_info *fbi = dev_get_drvdata(dev); 437 struct imxfb_info *fbi = platform_get_drvdata(dev);
438 pr_debug("%s\n",__FUNCTION__); 438 pr_debug("%s\n",__FUNCTION__);
439 439
440 imxfb_enable_controller(fbi); 440 imxfb_enable_controller(fbi);
@@ -538,9 +538,8 @@ static int __init imxfb_map_video_memory(struct fb_info *info)
538 return fbi->map_cpu ? 0 : -ENOMEM; 538 return fbi->map_cpu ? 0 : -ENOMEM;
539} 539}
540 540
541static int __init imxfb_probe(struct device *dev) 541static int __init imxfb_probe(struct platform_device *pdev)
542{ 542{
543 struct platform_device *pdev = to_platform_device(dev);
544 struct imxfb_info *fbi; 543 struct imxfb_info *fbi;
545 struct fb_info *info; 544 struct fb_info *info;
546 struct imxfb_mach_info *inf; 545 struct imxfb_mach_info *inf;
@@ -553,21 +552,21 @@ static int __init imxfb_probe(struct device *dev)
553 if(!res) 552 if(!res)
554 return -ENODEV; 553 return -ENODEV;
555 554
556 inf = dev->platform_data; 555 inf = pdev->dev.platform_data;
557 if(!inf) { 556 if(!inf) {
558 dev_err(dev,"No platform_data available\n"); 557 dev_err(dev,"No platform_data available\n");
559 return -ENOMEM; 558 return -ENOMEM;
560 } 559 }
561 560
562 info = framebuffer_alloc(sizeof(struct imxfb_info), dev); 561 info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev);
563 if(!info) 562 if(!info)
564 return -ENOMEM; 563 return -ENOMEM;
565 564
566 fbi = info->par; 565 fbi = info->par;
567 566
568 dev_set_drvdata(dev, info); 567 platform_set_drvdata(pdev, info);
569 568
570 ret = imxfb_init_fbinfo(dev); 569 ret = imxfb_init_fbinfo(&pdev->dev);
571 if( ret < 0 ) 570 if( ret < 0 )
572 goto failed_init; 571 goto failed_init;
573 572
@@ -621,22 +620,21 @@ failed_register:
621 fb_dealloc_cmap(&info->cmap); 620 fb_dealloc_cmap(&info->cmap);
622failed_cmap: 621failed_cmap:
623 if (!inf->fixed_screen_cpu) 622 if (!inf->fixed_screen_cpu)
624 dma_free_writecombine(dev,fbi->map_size,fbi->map_cpu, 623 dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu,
625 fbi->map_dma); 624 fbi->map_dma);
626failed_map: 625failed_map:
627 kfree(info->pseudo_palette); 626 kfree(info->pseudo_palette);
628failed_regs: 627failed_regs:
629 release_mem_region(res->start, res->end - res->start); 628 release_mem_region(res->start, res->end - res->start);
630failed_init: 629failed_init:
631 dev_set_drvdata(dev, NULL); 630 platform_set_drvdata(pdev, NULL);
632 framebuffer_release(info); 631 framebuffer_release(info);
633 return ret; 632 return ret;
634} 633}
635 634
636static int imxfb_remove(struct device *dev) 635static int imxfb_remove(struct platform_device *pdev)
637{ 636{
638 struct platform_device *pdev = to_platform_device(dev); 637 struct fb_info *info = platform_get_drvdata(pdev);
639 struct fb_info *info = dev_get_drvdata(dev);
640 struct imxfb_info *fbi = info->par; 638 struct imxfb_info *fbi = info->par;
641 struct resource *res; 639 struct resource *res;
642 640
@@ -651,36 +649,37 @@ static int imxfb_remove(struct device *dev)
651 framebuffer_release(info); 649 framebuffer_release(info);
652 650
653 release_mem_region(res->start, res->end - res->start + 1); 651 release_mem_region(res->start, res->end - res->start + 1);
654 dev_set_drvdata(dev, NULL); 652 platform_set_drvdata(pdev, NULL);
655 653
656 return 0; 654 return 0;
657} 655}
658 656
659void imxfb_shutdown(struct device * dev) 657void imxfb_shutdown(struct platform_device * dev)
660{ 658{
661 struct fb_info *info = dev_get_drvdata(dev); 659 struct fb_info *info = platform_get_drvdata(dev);
662 struct imxfb_info *fbi = info->par; 660 struct imxfb_info *fbi = info->par;
663 imxfb_disable_controller(fbi); 661 imxfb_disable_controller(fbi);
664} 662}
665 663
666static struct device_driver imxfb_driver = { 664static struct platform_driver imxfb_driver = {
667 .name = "imx-fb",
668 .bus = &platform_bus_type,
669 .probe = imxfb_probe, 665 .probe = imxfb_probe,
670 .suspend = imxfb_suspend, 666 .suspend = imxfb_suspend,
671 .resume = imxfb_resume, 667 .resume = imxfb_resume,
672 .remove = imxfb_remove, 668 .remove = imxfb_remove,
673 .shutdown = imxfb_shutdown, 669 .shutdown = imxfb_shutdown,
670 .driver = {
671 .name = "imx-fb",
672 },
674}; 673};
675 674
676int __init imxfb_init(void) 675int __init imxfb_init(void)
677{ 676{
678 return driver_register(&imxfb_driver); 677 return platform_driver_register(&imxfb_driver);
679} 678}
680 679
681static void __exit imxfb_cleanup(void) 680static void __exit imxfb_cleanup(void)
682{ 681{
683 driver_unregister(&imxfb_driver); 682 platform_driver_unregister(&imxfb_driver);
684} 683}
685 684
686module_init(imxfb_init); 685module_init(imxfb_init);
diff --git a/drivers/video/leo.c b/drivers/video/leo.c
index 84a7fe435bb8..376d4a171ec7 100644
--- a/drivers/video/leo.c
+++ b/drivers/video/leo.c
@@ -51,6 +51,9 @@ static struct fb_ops leo_ops = {
51 .fb_imageblit = cfb_imageblit, 51 .fb_imageblit = cfb_imageblit,
52 .fb_mmap = leo_mmap, 52 .fb_mmap = leo_mmap,
53 .fb_ioctl = leo_ioctl, 53 .fb_ioctl = leo_ioctl,
54#ifdef CONFIG_COMPAT
55 .fb_compat_ioctl = sbusfb_compat_ioctl,
56#endif
54}; 57};
55 58
56#define LEO_OFF_LC_SS0_KRN 0x00200000UL 59#define LEO_OFF_LC_SS0_KRN 0x00200000UL
diff --git a/drivers/video/p9100.c b/drivers/video/p9100.c
index 9aaf65fb623a..18bcda23d2cf 100644
--- a/drivers/video/p9100.c
+++ b/drivers/video/p9100.c
@@ -48,6 +48,9 @@ static struct fb_ops p9100_ops = {
48 .fb_imageblit = cfb_imageblit, 48 .fb_imageblit = cfb_imageblit,
49 .fb_mmap = p9100_mmap, 49 .fb_mmap = p9100_mmap,
50 .fb_ioctl = p9100_ioctl, 50 .fb_ioctl = p9100_ioctl,
51#ifdef CONFIG_COMPAT
52 .fb_compat_ioctl = sbusfb_compat_ioctl,
53#endif
51}; 54};
52 55
53/* P9100 control registers */ 56/* P9100 control registers */
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index f305a5b77b23..7b4cd250bec8 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -980,17 +980,17 @@ pxafb_freq_policy(struct notifier_block *nb, unsigned long val, void *data)
980 * Power management hooks. Note that we won't be called from IRQ context, 980 * Power management hooks. Note that we won't be called from IRQ context,
981 * unlike the blank functions above, so we may sleep. 981 * unlike the blank functions above, so we may sleep.
982 */ 982 */
983static int pxafb_suspend(struct device *dev, pm_message_t state) 983static int pxafb_suspend(struct platform_device *dev, pm_message_t state)
984{ 984{
985 struct pxafb_info *fbi = dev_get_drvdata(dev); 985 struct pxafb_info *fbi = platform_get_drvdata(dev);
986 986
987 set_ctrlr_state(fbi, C_DISABLE_PM); 987 set_ctrlr_state(fbi, C_DISABLE_PM);
988 return 0; 988 return 0;
989} 989}
990 990
991static int pxafb_resume(struct device *dev) 991static int pxafb_resume(struct platform_device *dev)
992{ 992{
993 struct pxafb_info *fbi = dev_get_drvdata(dev); 993 struct pxafb_info *fbi = platform_get_drvdata(dev);
994 994
995 set_ctrlr_state(fbi, C_ENABLE_PM); 995 set_ctrlr_state(fbi, C_ENABLE_PM);
996 return 0; 996 return 0;
@@ -1268,7 +1268,7 @@ static int __init pxafb_parse_options(struct device *dev, char *options)
1268} 1268}
1269#endif 1269#endif
1270 1270
1271int __init pxafb_probe(struct device *dev) 1271int __init pxafb_probe(struct platform_device *dev)
1272{ 1272{
1273 struct pxafb_info *fbi; 1273 struct pxafb_info *fbi;
1274 struct pxafb_mach_info *inf; 1274 struct pxafb_mach_info *inf;
@@ -1276,14 +1276,14 @@ int __init pxafb_probe(struct device *dev)
1276 1276
1277 dev_dbg(dev, "pxafb_probe\n"); 1277 dev_dbg(dev, "pxafb_probe\n");
1278 1278
1279 inf = dev->platform_data; 1279 inf = dev->dev.platform_data;
1280 ret = -ENOMEM; 1280 ret = -ENOMEM;
1281 fbi = NULL; 1281 fbi = NULL;
1282 if (!inf) 1282 if (!inf)
1283 goto failed; 1283 goto failed;
1284 1284
1285#ifdef CONFIG_FB_PXA_PARAMETERS 1285#ifdef CONFIG_FB_PXA_PARAMETERS
1286 ret = pxafb_parse_options(dev, g_options); 1286 ret = pxafb_parse_options(&dev->dev, g_options);
1287 if (ret < 0) 1287 if (ret < 0)
1288 goto failed; 1288 goto failed;
1289#endif 1289#endif
@@ -1293,36 +1293,36 @@ int __init pxafb_probe(struct device *dev)
1293 * a warning is given. */ 1293 * a warning is given. */
1294 1294
1295 if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK) 1295 if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK)
1296 dev_warn(dev, "machine LCCR0 setting contains illegal bits: %08x\n", 1296 dev_warn(&dev->dev, "machine LCCR0 setting contains illegal bits: %08x\n",
1297 inf->lccr0 & LCCR0_INVALID_CONFIG_MASK); 1297 inf->lccr0 & LCCR0_INVALID_CONFIG_MASK);
1298 if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK) 1298 if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK)
1299 dev_warn(dev, "machine LCCR3 setting contains illegal bits: %08x\n", 1299 dev_warn(&dev->dev, "machine LCCR3 setting contains illegal bits: %08x\n",
1300 inf->lccr3 & LCCR3_INVALID_CONFIG_MASK); 1300 inf->lccr3 & LCCR3_INVALID_CONFIG_MASK);
1301 if (inf->lccr0 & LCCR0_DPD && 1301 if (inf->lccr0 & LCCR0_DPD &&
1302 ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas || 1302 ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas ||
1303 (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl || 1303 (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl ||
1304 (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono)) 1304 (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono))
1305 dev_warn(dev, "Double Pixel Data (DPD) mode is only valid in passive mono" 1305 dev_warn(&dev->dev, "Double Pixel Data (DPD) mode is only valid in passive mono"
1306 " single panel mode\n"); 1306 " single panel mode\n");
1307 if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act && 1307 if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act &&
1308 (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual) 1308 (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual)
1309 dev_warn(dev, "Dual panel only valid in passive mode\n"); 1309 dev_warn(&dev->dev, "Dual panel only valid in passive mode\n");
1310 if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas && 1310 if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas &&
1311 (inf->upper_margin || inf->lower_margin)) 1311 (inf->upper_margin || inf->lower_margin))
1312 dev_warn(dev, "Upper and lower margins must be 0 in passive mode\n"); 1312 dev_warn(&dev->dev, "Upper and lower margins must be 0 in passive mode\n");
1313#endif 1313#endif
1314 1314
1315 dev_dbg(dev, "got a %dx%dx%d LCD\n",inf->xres, inf->yres, inf->bpp); 1315 dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n",inf->xres, inf->yres, inf->bpp);
1316 if (inf->xres == 0 || inf->yres == 0 || inf->bpp == 0) { 1316 if (inf->xres == 0 || inf->yres == 0 || inf->bpp == 0) {
1317 dev_err(dev, "Invalid resolution or bit depth\n"); 1317 dev_err(&dev->dev, "Invalid resolution or bit depth\n");
1318 ret = -EINVAL; 1318 ret = -EINVAL;
1319 goto failed; 1319 goto failed;
1320 } 1320 }
1321 pxafb_backlight_power = inf->pxafb_backlight_power; 1321 pxafb_backlight_power = inf->pxafb_backlight_power;
1322 pxafb_lcd_power = inf->pxafb_lcd_power; 1322 pxafb_lcd_power = inf->pxafb_lcd_power;
1323 fbi = pxafb_init_fbinfo(dev); 1323 fbi = pxafb_init_fbinfo(&dev->dev);
1324 if (!fbi) { 1324 if (!fbi) {
1325 dev_err(dev, "Failed to initialize framebuffer device\n"); 1325 dev_err(&dev->dev, "Failed to initialize framebuffer device\n");
1326 ret = -ENOMEM; // only reason for pxafb_init_fbinfo to fail is kmalloc 1326 ret = -ENOMEM; // only reason for pxafb_init_fbinfo to fail is kmalloc
1327 goto failed; 1327 goto failed;
1328 } 1328 }
@@ -1330,14 +1330,14 @@ int __init pxafb_probe(struct device *dev)
1330 /* Initialize video memory */ 1330 /* Initialize video memory */
1331 ret = pxafb_map_video_memory(fbi); 1331 ret = pxafb_map_video_memory(fbi);
1332 if (ret) { 1332 if (ret) {
1333 dev_err(dev, "Failed to allocate video RAM: %d\n", ret); 1333 dev_err(&dev->dev, "Failed to allocate video RAM: %d\n", ret);
1334 ret = -ENOMEM; 1334 ret = -ENOMEM;
1335 goto failed; 1335 goto failed;
1336 } 1336 }
1337 1337
1338 ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi); 1338 ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi);
1339 if (ret) { 1339 if (ret) {
1340 dev_err(dev, "request_irq failed: %d\n", ret); 1340 dev_err(&dev->dev, "request_irq failed: %d\n", ret);
1341 ret = -EBUSY; 1341 ret = -EBUSY;
1342 goto failed; 1342 goto failed;
1343 } 1343 }
@@ -1349,11 +1349,11 @@ int __init pxafb_probe(struct device *dev)
1349 pxafb_check_var(&fbi->fb.var, &fbi->fb); 1349 pxafb_check_var(&fbi->fb.var, &fbi->fb);
1350 pxafb_set_par(&fbi->fb); 1350 pxafb_set_par(&fbi->fb);
1351 1351
1352 dev_set_drvdata(dev, fbi); 1352 platform_set_drvdata(dev, fbi);
1353 1353
1354 ret = register_framebuffer(&fbi->fb); 1354 ret = register_framebuffer(&fbi->fb);
1355 if (ret < 0) { 1355 if (ret < 0) {
1356 dev_err(dev, "Failed to register framebuffer device: %d\n", ret); 1356 dev_err(&dev->dev, "Failed to register framebuffer device: %d\n", ret);
1357 goto failed; 1357 goto failed;
1358 } 1358 }
1359 1359
@@ -1376,19 +1376,20 @@ int __init pxafb_probe(struct device *dev)
1376 return 0; 1376 return 0;
1377 1377
1378failed: 1378failed:
1379 dev_set_drvdata(dev, NULL); 1379 platform_set_drvdata(dev, NULL);
1380 kfree(fbi); 1380 kfree(fbi);
1381 return ret; 1381 return ret;
1382} 1382}
1383 1383
1384static struct device_driver pxafb_driver = { 1384static struct platform_driver pxafb_driver = {
1385 .name = "pxa2xx-fb",
1386 .bus = &platform_bus_type,
1387 .probe = pxafb_probe, 1385 .probe = pxafb_probe,
1388#ifdef CONFIG_PM 1386#ifdef CONFIG_PM
1389 .suspend = pxafb_suspend, 1387 .suspend = pxafb_suspend,
1390 .resume = pxafb_resume, 1388 .resume = pxafb_resume,
1391#endif 1389#endif
1390 .driver = {
1391 .name = "pxa2xx-fb",
1392 },
1392}; 1393};
1393 1394
1394#ifndef MODULE 1395#ifndef MODULE
@@ -1415,7 +1416,7 @@ int __devinit pxafb_init(void)
1415 return -ENODEV; 1416 return -ENODEV;
1416 pxafb_setup(option); 1417 pxafb_setup(option);
1417#endif 1418#endif
1418 return driver_register(&pxafb_driver); 1419 return platform_driver_register(&pxafb_driver);
1419} 1420}
1420 1421
1421module_init(pxafb_init); 1422module_init(pxafb_init);
diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c
index bfc41f2c902a..fc91dbf896d2 100644
--- a/drivers/video/q40fb.c
+++ b/drivers/video/q40fb.c
@@ -86,9 +86,8 @@ static struct fb_ops q40fb_ops = {
86 .fb_imageblit = cfb_imageblit, 86 .fb_imageblit = cfb_imageblit,
87}; 87};
88 88
89static int __init q40fb_probe(struct device *device) 89static int __init q40fb_probe(struct platform_device *dev)
90{ 90{
91 struct platform_device *dev = to_platform_device(device);
92 struct fb_info *info; 91 struct fb_info *info;
93 92
94 if (!MACH_IS_Q40) 93 if (!MACH_IS_Q40)
@@ -128,10 +127,11 @@ static int __init q40fb_probe(struct device *device)
128 return 0; 127 return 0;
129} 128}
130 129
131static struct device_driver q40fb_driver = { 130static struct platform_driver q40fb_driver = {
132 .name = "q40fb",
133 .bus = &platform_bus_type,
134 .probe = q40fb_probe, 131 .probe = q40fb_probe,
132 .driver = {
133 .name = "q40fb",
134 },
135}; 135};
136 136
137static struct platform_device q40fb_device = { 137static struct platform_device q40fb_device = {
@@ -145,12 +145,12 @@ int __init q40fb_init(void)
145 if (fb_get_options("q40fb", NULL)) 145 if (fb_get_options("q40fb", NULL))
146 return -ENODEV; 146 return -ENODEV;
147 147
148 ret = driver_register(&q40fb_driver); 148 ret = platform_driver_register(&q40fb_driver);
149 149
150 if (!ret) { 150 if (!ret) {
151 ret = platform_device_register(&q40fb_device); 151 ret = platform_device_register(&q40fb_device);
152 if (ret) 152 if (ret)
153 driver_unregister(&q40fb_driver); 153 platform_driver_unregister(&q40fb_driver);
154 } 154 }
155 return ret; 155 return ret;
156} 156}
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c
index 3edbd14c5c46..e5d0f92eeae3 100644
--- a/drivers/video/s1d13xxxfb.c
+++ b/drivers/video/s1d13xxxfb.c
@@ -503,10 +503,9 @@ s1d13xxxfb_fetch_hw_state(struct fb_info *info)
503 503
504 504
505static int 505static int
506s1d13xxxfb_remove(struct device *dev) 506s1d13xxxfb_remove(struct platform_device *pdev)
507{ 507{
508 struct fb_info *info = dev_get_drvdata(dev); 508 struct fb_info *info = platform_get_drvdata(pdev);
509 struct platform_device *pdev = to_platform_device(dev);
510 struct s1d13xxxfb_par *par = NULL; 509 struct s1d13xxxfb_par *par = NULL;
511 510
512 if (info) { 511 if (info) {
@@ -534,9 +533,8 @@ s1d13xxxfb_remove(struct device *dev)
534} 533}
535 534
536static int __devinit 535static int __devinit
537s1d13xxxfb_probe(struct device *dev) 536s1d13xxxfb_probe(struct platform_device *pdev)
538{ 537{
539 struct platform_device *pdev = to_platform_device(dev);
540 struct s1d13xxxfb_par *default_par; 538 struct s1d13xxxfb_par *default_par;
541 struct fb_info *info; 539 struct fb_info *info;
542 struct s1d13xxxfb_pdata *pdata = NULL; 540 struct s1d13xxxfb_pdata *pdata = NULL;
@@ -548,8 +546,8 @@ s1d13xxxfb_probe(struct device *dev)
548 printk(KERN_INFO "Epson S1D13XXX FB Driver\n"); 546 printk(KERN_INFO "Epson S1D13XXX FB Driver\n");
549 547
550 /* enable platform-dependent hardware glue, if any */ 548 /* enable platform-dependent hardware glue, if any */
551 if (dev->platform_data) 549 if (pdev->dev.platform_data)
552 pdata = dev->platform_data; 550 pdata = pdev->dev.platform_data;
553 551
554 if (pdata && pdata->platform_init_video) 552 if (pdata && pdata->platform_init_video)
555 pdata->platform_init_video(); 553 pdata->platform_init_video();
@@ -572,14 +570,14 @@ s1d13xxxfb_probe(struct device *dev)
572 570
573 if (!request_mem_region(pdev->resource[0].start, 571 if (!request_mem_region(pdev->resource[0].start,
574 pdev->resource[0].end - pdev->resource[0].start +1, "s1d13xxxfb mem")) { 572 pdev->resource[0].end - pdev->resource[0].start +1, "s1d13xxxfb mem")) {
575 dev_dbg(dev, "request_mem_region failed\n"); 573 dev_dbg(&pdev->dev, "request_mem_region failed\n");
576 ret = -EBUSY; 574 ret = -EBUSY;
577 goto bail; 575 goto bail;
578 } 576 }
579 577
580 if (!request_mem_region(pdev->resource[1].start, 578 if (!request_mem_region(pdev->resource[1].start,
581 pdev->resource[1].end - pdev->resource[1].start +1, "s1d13xxxfb regs")) { 579 pdev->resource[1].end - pdev->resource[1].start +1, "s1d13xxxfb regs")) {
582 dev_dbg(dev, "request_mem_region failed\n"); 580 dev_dbg(&pdev->dev, "request_mem_region failed\n");
583 ret = -EBUSY; 581 ret = -EBUSY;
584 goto bail; 582 goto bail;
585 } 583 }
@@ -640,7 +638,7 @@ s1d13xxxfb_probe(struct device *dev)
640 goto bail; 638 goto bail;
641 } 639 }
642 640
643 dev_set_drvdata(&pdev->dev, info); 641 platform_set_drvdata(pdev, info);
644 642
645 printk(KERN_INFO "fb%d: %s frame buffer device\n", 643 printk(KERN_INFO "fb%d: %s frame buffer device\n",
646 info->node, info->fix.id); 644 info->node, info->fix.id);
@@ -648,15 +646,15 @@ s1d13xxxfb_probe(struct device *dev)
648 return 0; 646 return 0;
649 647
650bail: 648bail:
651 s1d13xxxfb_remove(dev); 649 s1d13xxxfb_remove(pdev);
652 return ret; 650 return ret;
653 651
654} 652}
655 653
656#ifdef CONFIG_PM 654#ifdef CONFIG_PM
657static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state) 655static int s1d13xxxfb_suspend(struct platform_device *dev, pm_message_t state)
658{ 656{
659 struct fb_info *info = dev_get_drvdata(dev); 657 struct fb_info *info = platform_get_drvdata(dev);
660 struct s1d13xxxfb_par *s1dfb = info->par; 658 struct s1d13xxxfb_par *s1dfb = info->par;
661 struct s1d13xxxfb_pdata *pdata = NULL; 659 struct s1d13xxxfb_pdata *pdata = NULL;
662 660
@@ -664,8 +662,8 @@ static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state)
664 lcd_enable(s1dfb, 0); 662 lcd_enable(s1dfb, 0);
665 crt_enable(s1dfb, 0); 663 crt_enable(s1dfb, 0);
666 664
667 if (dev->platform_data) 665 if (dev->dev.platform_data)
668 pdata = dev->platform_data; 666 pdata = dev->dev.platform_data;
669 667
670#if 0 668#if 0
671 if (!s1dfb->disp_save) 669 if (!s1dfb->disp_save)
@@ -701,9 +699,9 @@ static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state)
701 return 0; 699 return 0;
702} 700}
703 701
704static int s1d13xxxfb_resume(struct device *dev) 702static int s1d13xxxfb_resume(struct platform_device *dev)
705{ 703{
706 struct fb_info *info = dev_get_drvdata(dev); 704 struct fb_info *info = platform_get_drvdata(dev);
707 struct s1d13xxxfb_par *s1dfb = info->par; 705 struct s1d13xxxfb_par *s1dfb = info->par;
708 struct s1d13xxxfb_pdata *pdata = NULL; 706 struct s1d13xxxfb_pdata *pdata = NULL;
709 707
@@ -714,8 +712,8 @@ static int s1d13xxxfb_resume(struct device *dev)
714 while ((s1d13xxxfb_readreg(s1dfb, S1DREG_PS_STATUS) & 0x01)) 712 while ((s1d13xxxfb_readreg(s1dfb, S1DREG_PS_STATUS) & 0x01))
715 udelay(10); 713 udelay(10);
716 714
717 if (dev->platform_data) 715 if (dev->dev.platform_data)
718 pdata = dev->platform_data; 716 pdata = dev->dev.platform_data;
719 717
720 if (s1dfb->regs_save) { 718 if (s1dfb->regs_save) {
721 /* will write RO regs, *should* get away with it :) */ 719 /* will write RO regs, *should* get away with it :) */
@@ -741,15 +739,16 @@ static int s1d13xxxfb_resume(struct device *dev)
741} 739}
742#endif /* CONFIG_PM */ 740#endif /* CONFIG_PM */
743 741
744static struct device_driver s1d13xxxfb_driver = { 742static struct platform_driver s1d13xxxfb_driver = {
745 .name = S1D_DEVICENAME,
746 .bus = &platform_bus_type,
747 .probe = s1d13xxxfb_probe, 743 .probe = s1d13xxxfb_probe,
748 .remove = s1d13xxxfb_remove, 744 .remove = s1d13xxxfb_remove,
749#ifdef CONFIG_PM 745#ifdef CONFIG_PM
750 .suspend = s1d13xxxfb_suspend, 746 .suspend = s1d13xxxfb_suspend,
751 .resume = s1d13xxxfb_resume 747 .resume = s1d13xxxfb_resume,
752#endif 748#endif
749 .driver = {
750 .name = S1D_DEVICENAME,
751 },
753}; 752};
754 753
755 754
@@ -759,14 +758,14 @@ s1d13xxxfb_init(void)
759 if (fb_get_options("s1d13xxxfb", NULL)) 758 if (fb_get_options("s1d13xxxfb", NULL))
760 return -ENODEV; 759 return -ENODEV;
761 760
762 return driver_register(&s1d13xxxfb_driver); 761 return platform_driver_register(&s1d13xxxfb_driver);
763} 762}
764 763
765 764
766static void __exit 765static void __exit
767s1d13xxxfb_exit(void) 766s1d13xxxfb_exit(void)
768{ 767{
769 driver_unregister(&s1d13xxxfb_driver); 768 platform_driver_unregister(&s1d13xxxfb_driver);
770} 769}
771 770
772module_init(s1d13xxxfb_init); 771module_init(s1d13xxxfb_init);
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 855a6778b9eb..ce6e749db3a7 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -634,19 +634,18 @@ static irqreturn_t s3c2410fb_irq(int irq, void *dev_id, struct pt_regs *r)
634 634
635static char driver_name[]="s3c2410fb"; 635static char driver_name[]="s3c2410fb";
636 636
637int __init s3c2410fb_probe(struct device *dev) 637int __init s3c2410fb_probe(struct platform_device *pdev)
638{ 638{
639 struct s3c2410fb_info *info; 639 struct s3c2410fb_info *info;
640 struct fb_info *fbinfo; 640 struct fb_info *fbinfo;
641 struct platform_device *pdev = to_platform_device(dev);
642 struct s3c2410fb_hw *mregs; 641 struct s3c2410fb_hw *mregs;
643 int ret; 642 int ret;
644 int irq; 643 int irq;
645 int i; 644 int i;
646 645
647 mach_info = dev->platform_data; 646 mach_info = pdev->dev.platform_data;
648 if (mach_info == NULL) { 647 if (mach_info == NULL) {
649 dev_err(dev,"no platform data for lcd, cannot attach\n"); 648 dev_err(&pdev->dev,"no platform data for lcd, cannot attach\n");
650 return -EINVAL; 649 return -EINVAL;
651 } 650 }
652 651
@@ -654,11 +653,11 @@ int __init s3c2410fb_probe(struct device *dev)
654 653
655 irq = platform_get_irq(pdev, 0); 654 irq = platform_get_irq(pdev, 0);
656 if (irq < 0) { 655 if (irq < 0) {
657 dev_err(dev, "no irq for device\n"); 656 dev_err(&pdev->dev, "no irq for device\n");
658 return -ENOENT; 657 return -ENOENT;
659 } 658 }
660 659
661 fbinfo = framebuffer_alloc(sizeof(struct s3c2410fb_info), dev); 660 fbinfo = framebuffer_alloc(sizeof(struct s3c2410fb_info), &pdev->dev);
662 if (!fbinfo) { 661 if (!fbinfo) {
663 return -ENOMEM; 662 return -ENOMEM;
664 } 663 }
@@ -666,7 +665,7 @@ int __init s3c2410fb_probe(struct device *dev)
666 665
667 info = fbinfo->par; 666 info = fbinfo->par;
668 info->fb = fbinfo; 667 info->fb = fbinfo;
669 dev_set_drvdata(dev, fbinfo); 668 platform_set_drvdata(pdev, fbinfo);
670 669
671 s3c2410fb_init_registers(info); 670 s3c2410fb_init_registers(info);
672 671
@@ -676,7 +675,7 @@ int __init s3c2410fb_probe(struct device *dev)
676 675
677 memcpy(&info->regs, &mach_info->regs, sizeof(info->regs)); 676 memcpy(&info->regs, &mach_info->regs, sizeof(info->regs));
678 677
679 info->mach_info = dev->platform_data; 678 info->mach_info = pdev->dev.platform_data;
680 679
681 fbinfo->fix.type = FB_TYPE_PACKED_PIXELS; 680 fbinfo->fix.type = FB_TYPE_PACKED_PIXELS;
682 fbinfo->fix.type_aux = 0; 681 fbinfo->fix.type_aux = 0;
@@ -735,7 +734,7 @@ int __init s3c2410fb_probe(struct device *dev)
735 734
736 ret = request_irq(irq, s3c2410fb_irq, SA_INTERRUPT, pdev->name, info); 735 ret = request_irq(irq, s3c2410fb_irq, SA_INTERRUPT, pdev->name, info);
737 if (ret) { 736 if (ret) {
738 dev_err(dev, "cannot get irq %d - err %d\n", irq, ret); 737 dev_err(&pdev->dev, "cannot get irq %d - err %d\n", irq, ret);
739 ret = -EBUSY; 738 ret = -EBUSY;
740 goto release_mem; 739 goto release_mem;
741 } 740 }
@@ -773,7 +772,7 @@ int __init s3c2410fb_probe(struct device *dev)
773 } 772 }
774 773
775 /* create device files */ 774 /* create device files */
776 device_create_file(dev, &dev_attr_debug); 775 device_create_file(&pdev->dev, &dev_attr_debug);
777 776
778 printk(KERN_INFO "fb%d: %s frame buffer device\n", 777 printk(KERN_INFO "fb%d: %s frame buffer device\n",
779 fbinfo->node, fbinfo->fix.id); 778 fbinfo->node, fbinfo->fix.id);
@@ -816,10 +815,9 @@ static void s3c2410fb_stop_lcd(void)
816/* 815/*
817 * Cleanup 816 * Cleanup
818 */ 817 */
819static int s3c2410fb_remove(struct device *dev) 818static int s3c2410fb_remove(struct platform_device *pdev)
820{ 819{
821 struct platform_device *pdev = to_platform_device(dev); 820 struct fb_info *fbinfo = platform_get_drvdata(pdev);
822 struct fb_info *fbinfo = dev_get_drvdata(dev);
823 struct s3c2410fb_info *info = fbinfo->par; 821 struct s3c2410fb_info *info = fbinfo->par;
824 int irq; 822 int irq;
825 823
@@ -847,9 +845,9 @@ static int s3c2410fb_remove(struct device *dev)
847 845
848/* suspend and resume support for the lcd controller */ 846/* suspend and resume support for the lcd controller */
849 847
850static int s3c2410fb_suspend(struct device *dev, pm_message_t state) 848static int s3c2410fb_suspend(struct platform_device *dev, pm_message_t state)
851{ 849{
852 struct fb_info *fbinfo = dev_get_drvdata(dev); 850 struct fb_info *fbinfo = platform_get_drvdata(dev);
853 struct s3c2410fb_info *info = fbinfo->par; 851 struct s3c2410fb_info *info = fbinfo->par;
854 852
855 s3c2410fb_stop_lcd(); 853 s3c2410fb_stop_lcd();
@@ -864,9 +862,9 @@ static int s3c2410fb_suspend(struct device *dev, pm_message_t state)
864 return 0; 862 return 0;
865} 863}
866 864
867static int s3c2410fb_resume(struct device *dev) 865static int s3c2410fb_resume(struct platform_device *dev)
868{ 866{
869 struct fb_info *fbinfo = dev_get_drvdata(dev); 867 struct fb_info *fbinfo = platform_get_drvdata(dev);
870 struct s3c2410fb_info *info = fbinfo->par; 868 struct s3c2410fb_info *info = fbinfo->par;
871 869
872 clk_enable(info->clk); 870 clk_enable(info->clk);
@@ -882,24 +880,25 @@ static int s3c2410fb_resume(struct device *dev)
882#define s3c2410fb_resume NULL 880#define s3c2410fb_resume NULL
883#endif 881#endif
884 882
885static struct device_driver s3c2410fb_driver = { 883static struct platform_driver s3c2410fb_driver = {
886 .name = "s3c2410-lcd",
887 .owner = THIS_MODULE,
888 .bus = &platform_bus_type,
889 .probe = s3c2410fb_probe, 884 .probe = s3c2410fb_probe,
885 .remove = s3c2410fb_remove,
890 .suspend = s3c2410fb_suspend, 886 .suspend = s3c2410fb_suspend,
891 .resume = s3c2410fb_resume, 887 .resume = s3c2410fb_resume,
892 .remove = s3c2410fb_remove 888 .driver = {
889 .name = "s3c2410-lcd",
890 .owner = THIS_MODULE,
891 },
893}; 892};
894 893
895int __devinit s3c2410fb_init(void) 894int __devinit s3c2410fb_init(void)
896{ 895{
897 return driver_register(&s3c2410fb_driver); 896 return platform_driver_register(&s3c2410fb_driver);
898} 897}
899 898
900static void __exit s3c2410fb_cleanup(void) 899static void __exit s3c2410fb_cleanup(void)
901{ 900{
902 driver_unregister(&s3c2410fb_driver); 901 platform_driver_unregister(&s3c2410fb_driver);
903} 902}
904 903
905 904
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index a5184575cfae..2ea1354e439f 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -1308,17 +1308,17 @@ sa1100fb_freq_policy(struct notifier_block *nb, unsigned long val,
1308 * Power management hooks. Note that we won't be called from IRQ context, 1308 * Power management hooks. Note that we won't be called from IRQ context,
1309 * unlike the blank functions above, so we may sleep. 1309 * unlike the blank functions above, so we may sleep.
1310 */ 1310 */
1311static int sa1100fb_suspend(struct device *dev, pm_message_t state) 1311static int sa1100fb_suspend(struct platform_device *dev, pm_message_t state)
1312{ 1312{
1313 struct sa1100fb_info *fbi = dev_get_drvdata(dev); 1313 struct sa1100fb_info *fbi = platform_get_drvdata(dev);
1314 1314
1315 set_ctrlr_state(fbi, C_DISABLE_PM); 1315 set_ctrlr_state(fbi, C_DISABLE_PM);
1316 return 0; 1316 return 0;
1317} 1317}
1318 1318
1319static int sa1100fb_resume(struct device *dev) 1319static int sa1100fb_resume(struct platform_device *dev)
1320{ 1320{
1321 struct sa1100fb_info *fbi = dev_get_drvdata(dev); 1321 struct sa1100fb_info *fbi = platform_get_drvdata(dev);
1322 1322
1323 set_ctrlr_state(fbi, C_ENABLE_PM); 1323 set_ctrlr_state(fbi, C_ENABLE_PM);
1324 return 0; 1324 return 0;
@@ -1452,7 +1452,7 @@ static struct sa1100fb_info * __init sa1100fb_init_fbinfo(struct device *dev)
1452 return fbi; 1452 return fbi;
1453} 1453}
1454 1454
1455static int __init sa1100fb_probe(struct device *dev) 1455static int __init sa1100fb_probe(struct platform_device *pdev)
1456{ 1456{
1457 struct sa1100fb_info *fbi; 1457 struct sa1100fb_info *fbi;
1458 int ret; 1458 int ret;
@@ -1460,7 +1460,7 @@ static int __init sa1100fb_probe(struct device *dev)
1460 if (!request_mem_region(0xb0100000, 0x10000, "LCD")) 1460 if (!request_mem_region(0xb0100000, 0x10000, "LCD"))
1461 return -EBUSY; 1461 return -EBUSY;
1462 1462
1463 fbi = sa1100fb_init_fbinfo(dev); 1463 fbi = sa1100fb_init_fbinfo(&pdev->dev);
1464 ret = -ENOMEM; 1464 ret = -ENOMEM;
1465 if (!fbi) 1465 if (!fbi)
1466 goto failed; 1466 goto failed;
@@ -1488,7 +1488,7 @@ static int __init sa1100fb_probe(struct device *dev)
1488 */ 1488 */
1489 sa1100fb_check_var(&fbi->fb.var, &fbi->fb); 1489 sa1100fb_check_var(&fbi->fb.var, &fbi->fb);
1490 1490
1491 dev_set_drvdata(dev, fbi); 1491 platform_set_drvdata(pdev, fbi);
1492 1492
1493 ret = register_framebuffer(&fbi->fb); 1493 ret = register_framebuffer(&fbi->fb);
1494 if (ret < 0) 1494 if (ret < 0)
@@ -1505,18 +1505,19 @@ static int __init sa1100fb_probe(struct device *dev)
1505 return 0; 1505 return 0;
1506 1506
1507failed: 1507failed:
1508 dev_set_drvdata(dev, NULL); 1508 platform_set_drvdata(pdev, NULL);
1509 kfree(fbi); 1509 kfree(fbi);
1510 release_mem_region(0xb0100000, 0x10000); 1510 release_mem_region(0xb0100000, 0x10000);
1511 return ret; 1511 return ret;
1512} 1512}
1513 1513
1514static struct device_driver sa1100fb_driver = { 1514static struct platform_driver sa1100fb_driver = {
1515 .name = "sa11x0-fb",
1516 .bus = &platform_bus_type,
1517 .probe = sa1100fb_probe, 1515 .probe = sa1100fb_probe,
1518 .suspend = sa1100fb_suspend, 1516 .suspend = sa1100fb_suspend,
1519 .resume = sa1100fb_resume, 1517 .resume = sa1100fb_resume,
1518 .driver = {
1519 .name = "sa11x0-fb",
1520 },
1520}; 1521};
1521 1522
1522int __init sa1100fb_init(void) 1523int __init sa1100fb_init(void)
@@ -1524,7 +1525,7 @@ int __init sa1100fb_init(void)
1524 if (fb_get_options("sa1100fb", NULL)) 1525 if (fb_get_options("sa1100fb", NULL))
1525 return -ENODEV; 1526 return -ENODEV;
1526 1527
1527 return driver_register(&sa1100fb_driver); 1528 return platform_driver_register(&sa1100fb_driver);
1528} 1529}
1529 1530
1530int __init sa1100fb_setup(char *options) 1531int __init sa1100fb_setup(char *options)
diff --git a/drivers/video/sbuslib.c b/drivers/video/sbuslib.c
index 34f72edba820..646c43f921c5 100644
--- a/drivers/video/sbuslib.c
+++ b/drivers/video/sbuslib.c
@@ -3,6 +3,7 @@
3 * Copyright (C) 2003 David S. Miller (davem@redhat.com) 3 * Copyright (C) 2003 David S. Miller (davem@redhat.com)
4 */ 4 */
5 5
6#include <linux/compat.h>
6#include <linux/kernel.h> 7#include <linux/kernel.h>
7#include <linux/module.h> 8#include <linux/module.h>
8#include <linux/string.h> 9#include <linux/string.h>
@@ -182,3 +183,109 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
182 }; 183 };
183} 184}
184EXPORT_SYMBOL(sbusfb_ioctl_helper); 185EXPORT_SYMBOL(sbusfb_ioctl_helper);
186
187#ifdef CONFIG_COMPAT
188struct fbcmap32 {
189 int index; /* first element (0 origin) */
190 int count;
191 u32 red;
192 u32 green;
193 u32 blue;
194};
195
196#define FBIOPUTCMAP32 _IOW('F', 3, struct fbcmap32)
197#define FBIOGETCMAP32 _IOW('F', 4, struct fbcmap32)
198
199static int fbiogetputcmap(struct file *file, struct fb_info *info,
200 unsigned int cmd, unsigned long arg)
201{
202 struct fbcmap32 __user *argp = (void __user *)arg;
203 struct fbcmap __user *p = compat_alloc_user_space(sizeof(*p));
204 u32 addr;
205 int ret;
206
207 ret = copy_in_user(p, argp, 2 * sizeof(int));
208 ret |= get_user(addr, &argp->red);
209 ret |= put_user(compat_ptr(addr), &p->red);
210 ret |= get_user(addr, &argp->green);
211 ret |= put_user(compat_ptr(addr), &p->green);
212 ret |= get_user(addr, &argp->blue);
213 ret |= put_user(compat_ptr(addr), &p->blue);
214 if (ret)
215 return -EFAULT;
216 return info->fbops->fb_ioctl(file->f_dentry->d_inode, file,
217 (cmd == FBIOPUTCMAP32) ?
218 FBIOPUTCMAP_SPARC : FBIOGETCMAP_SPARC,
219 (unsigned long)p, info);
220}
221
222struct fbcursor32 {
223 short set; /* what to set, choose from the list above */
224 short enable; /* cursor on/off */
225 struct fbcurpos pos; /* cursor position */
226 struct fbcurpos hot; /* cursor hot spot */
227 struct fbcmap32 cmap; /* color map info */
228 struct fbcurpos size; /* cursor bit map size */
229 u32 image; /* cursor image bits */
230 u32 mask; /* cursor mask bits */
231};
232
233#define FBIOSCURSOR32 _IOW('F', 24, struct fbcursor32)
234#define FBIOGCURSOR32 _IOW('F', 25, struct fbcursor32)
235
236static int fbiogscursor(struct file *file, struct fb_info *info,
237 unsigned long arg)
238{
239 struct fbcursor __user *p = compat_alloc_user_space(sizeof(*p));
240 struct fbcursor32 __user *argp = (void __user *)arg;
241 compat_uptr_t addr;
242 int ret;
243
244 ret = copy_in_user(p, argp,
245 2 * sizeof (short) + 2 * sizeof(struct fbcurpos));
246 ret |= copy_in_user(&p->size, &argp->size, sizeof(struct fbcurpos));
247 ret |= copy_in_user(&p->cmap, &argp->cmap, 2 * sizeof(int));
248 ret |= get_user(addr, &argp->cmap.red);
249 ret |= put_user(compat_ptr(addr), &p->cmap.red);
250 ret |= get_user(addr, &argp->cmap.green);
251 ret |= put_user(compat_ptr(addr), &p->cmap.green);
252 ret |= get_user(addr, &argp->cmap.blue);
253 ret |= put_user(compat_ptr(addr), &p->cmap.blue);
254 ret |= get_user(addr, &argp->mask);
255 ret |= put_user(compat_ptr(addr), &p->mask);
256 ret |= get_user(addr, &argp->image);
257 ret |= put_user(compat_ptr(addr), &p->image);
258 if (ret)
259 return -EFAULT;
260 return info->fbops->fb_ioctl(file->f_dentry->d_inode, file,
261 FBIOSCURSOR, (unsigned long)p, info);
262}
263
264long sbusfb_compat_ioctl(struct file *file, unsigned int cmd,
265 unsigned long arg, struct fb_info *info)
266{
267 switch (cmd) {
268 case FBIOGTYPE:
269 case FBIOSATTR:
270 case FBIOGATTR:
271 case FBIOSVIDEO:
272 case FBIOGVIDEO:
273 case FBIOGCURSOR32: /* This is not implemented yet.
274 Later it should be converted... */
275 case FBIOSCURPOS:
276 case FBIOGCURPOS:
277 case FBIOGCURMAX:
278 return info->fbops->fb_ioctl(file->f_dentry->d_inode,
279 file, cmd, arg, info);
280 case FBIOPUTCMAP32:
281 return fbiogetputcmap(file, info, cmd, arg);
282 case FBIOGETCMAP32:
283 return fbiogetputcmap(file, info, cmd, arg);
284 case FBIOSCURSOR32:
285 return fbiogscursor(file, info, arg);
286 default:
287 return -ENOIOCTLCMD;
288 }
289}
290EXPORT_SYMBOL(sbusfb_compat_ioctl);
291#endif
diff --git a/drivers/video/sbuslib.h b/drivers/video/sbuslib.h
index a6aa33ba09d6..b470e52ce9e2 100644
--- a/drivers/video/sbuslib.h
+++ b/drivers/video/sbuslib.h
@@ -20,5 +20,7 @@ extern int sbusfb_mmap_helper(struct sbus_mmap_map *map,
20int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg, 20int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
21 struct fb_info *info, 21 struct fb_info *info,
22 int type, int fb_depth, unsigned long fb_size); 22 int type, int fb_depth, unsigned long fb_size);
23long sbusfb_compat_ioctl(struct file *file, unsigned int cmd,
24 unsigned long arg, struct fb_info *info);
23 25
24#endif /* _SBUSLIB_H */ 26#endif /* _SBUSLIB_H */
diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c
index 2e8769dd345a..7054660767e4 100644
--- a/drivers/video/sgivwfb.c
+++ b/drivers/video/sgivwfb.c
@@ -750,9 +750,8 @@ int __init sgivwfb_setup(char *options)
750/* 750/*
751 * Initialisation 751 * Initialisation
752 */ 752 */
753static int __init sgivwfb_probe(struct device *device) 753static int __init sgivwfb_probe(struct platform_device *dev)
754{ 754{
755 struct platform_device *dev = to_platform_device(device);
756 struct sgivw_par *par; 755 struct sgivw_par *par;
757 struct fb_info *info; 756 struct fb_info *info;
758 char *monitor; 757 char *monitor;
@@ -813,7 +812,7 @@ static int __init sgivwfb_probe(struct device *device)
813 goto fail_register_framebuffer; 812 goto fail_register_framebuffer;
814 } 813 }
815 814
816 dev_set_drvdata(&dev->dev, info); 815 platform_set_drvdata(dev, info);
817 816
818 printk(KERN_INFO "fb%d: SGI DBE frame buffer device, using %ldK of video memory at %#lx\n", 817 printk(KERN_INFO "fb%d: SGI DBE frame buffer device, using %ldK of video memory at %#lx\n",
819 info->node, sgivwfb_mem_size >> 10, sgivwfb_mem_phys); 818 info->node, sgivwfb_mem_size >> 10, sgivwfb_mem_phys);
@@ -831,9 +830,9 @@ fail_ioremap_regs:
831 return -ENXIO; 830 return -ENXIO;
832} 831}
833 832
834static int sgivwfb_remove(struct device *device) 833static int sgivwfb_remove(struct platform_device *dev)
835{ 834{
836 struct fb_info *info = dev_get_drvdata(device); 835 struct fb_info *info = platform_get_drvdata(dev);
837 836
838 if (info) { 837 if (info) {
839 struct sgivw_par *par = info->par; 838 struct sgivw_par *par = info->par;
@@ -847,11 +846,12 @@ static int sgivwfb_remove(struct device *device)
847 return 0; 846 return 0;
848} 847}
849 848
850static struct device_driver sgivwfb_driver = { 849static struct platform_driver sgivwfb_driver = {
851 .name = "sgivwfb",
852 .bus = &platform_bus_type,
853 .probe = sgivwfb_probe, 850 .probe = sgivwfb_probe,
854 .remove = sgivwfb_remove, 851 .remove = sgivwfb_remove,
852 .driver = {
853 .name = "sgivwfb",
854 },
855}; 855};
856 856
857static struct platform_device *sgivwfb_device; 857static struct platform_device *sgivwfb_device;
@@ -867,7 +867,7 @@ int __init sgivwfb_init(void)
867 return -ENODEV; 867 return -ENODEV;
868 sgivwfb_setup(option); 868 sgivwfb_setup(option);
869#endif 869#endif
870 ret = driver_register(&sgivwfb_driver); 870 ret = platform_driver_register(&sgivwfb_driver);
871 if (!ret) { 871 if (!ret) {
872 sgivwfb_device = platform_device_alloc("sgivwfb", 0); 872 sgivwfb_device = platform_device_alloc("sgivwfb", 0);
873 if (sgivwfb_device) { 873 if (sgivwfb_device) {
@@ -875,7 +875,7 @@ int __init sgivwfb_init(void)
875 } else 875 } else
876 ret = -ENOMEM; 876 ret = -ENOMEM;
877 if (ret) { 877 if (ret) {
878 driver_unregister(&sgivwfb_driver); 878 platform_driver_unregister(&sgivwfb_driver);
879 platform_device_put(sgivwfb_device); 879 platform_device_put(sgivwfb_device);
880 } 880 }
881 } 881 }
@@ -890,7 +890,7 @@ MODULE_LICENSE("GPL");
890static void __exit sgivwfb_exit(void) 890static void __exit sgivwfb_exit(void)
891{ 891{
892 platform_device_unregister(sgivwfb_device); 892 platform_device_unregister(sgivwfb_device);
893 driver_unregister(&sgivwfb_driver); 893 platform_driver_unregister(&sgivwfb_driver);
894} 894}
895 895
896module_exit(sgivwfb_exit); 896module_exit(sgivwfb_exit);
diff --git a/drivers/video/tcx.c b/drivers/video/tcx.c
index 59fff29bc02e..fe4f63f3849d 100644
--- a/drivers/video/tcx.c
+++ b/drivers/video/tcx.c
@@ -52,6 +52,9 @@ static struct fb_ops tcx_ops = {
52 .fb_imageblit = cfb_imageblit, 52 .fb_imageblit = cfb_imageblit,
53 .fb_mmap = tcx_mmap, 53 .fb_mmap = tcx_mmap,
54 .fb_ioctl = tcx_ioctl, 54 .fb_ioctl = tcx_ioctl,
55#ifdef CONFIG_COMPAT
56 .fb_compat_ioctl = sbusfb_compat_ioctl,
57#endif
55}; 58};
56 59
57/* THC definitions */ 60/* THC definitions */
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
index e25eae1a78c1..2c3aa2fcfd91 100644
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -245,9 +245,8 @@ static int __init vesafb_setup(char *options)
245 return 0; 245 return 0;
246} 246}
247 247
248static int __init vesafb_probe(struct device *device) 248static int __init vesafb_probe(struct platform_device *dev)
249{ 249{
250 struct platform_device *dev = to_platform_device(device);
251 struct fb_info *info; 250 struct fb_info *info;
252 int i, err; 251 int i, err;
253 unsigned int size_vmode; 252 unsigned int size_vmode;
@@ -480,10 +479,11 @@ err:
480 return err; 479 return err;
481} 480}
482 481
483static struct device_driver vesafb_driver = { 482static struct platform_driver vesafb_driver = {
484 .name = "vesafb",
485 .bus = &platform_bus_type,
486 .probe = vesafb_probe, 483 .probe = vesafb_probe,
484 .driver = {
485 .name = "vesafb",
486 },
487}; 487};
488 488
489static struct platform_device vesafb_device = { 489static struct platform_device vesafb_device = {
@@ -498,12 +498,12 @@ static int __init vesafb_init(void)
498 /* ignore error return of fb_get_options */ 498 /* ignore error return of fb_get_options */
499 fb_get_options("vesafb", &option); 499 fb_get_options("vesafb", &option);
500 vesafb_setup(option); 500 vesafb_setup(option);
501 ret = driver_register(&vesafb_driver); 501 ret = platform_driver_register(&vesafb_driver);
502 502
503 if (!ret) { 503 if (!ret) {
504 ret = platform_device_register(&vesafb_device); 504 ret = platform_device_register(&vesafb_device);
505 if (ret) 505 if (ret)
506 driver_unregister(&vesafb_driver); 506 platform_driver_unregister(&vesafb_driver);
507 } 507 }
508 return ret; 508 return ret;
509} 509}
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index 8794dc5d2466..ffa1ad474226 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -403,9 +403,8 @@ static void vfb_platform_release(struct device *device)
403 // This is called when the reference count goes to zero. 403 // This is called when the reference count goes to zero.
404} 404}
405 405
406static int __init vfb_probe(struct device *device) 406static int __init vfb_probe(struct platform_device *dev)
407{ 407{
408 struct platform_device *dev = to_platform_device(device);
409 struct fb_info *info; 408 struct fb_info *info;
410 int retval = -ENOMEM; 409 int retval = -ENOMEM;
411 410
@@ -447,7 +446,7 @@ static int __init vfb_probe(struct device *device)
447 retval = register_framebuffer(info); 446 retval = register_framebuffer(info);
448 if (retval < 0) 447 if (retval < 0)
449 goto err2; 448 goto err2;
450 dev_set_drvdata(&dev->dev, info); 449 platform_set_drvdata(dev, info);
451 450
452 printk(KERN_INFO 451 printk(KERN_INFO
453 "fb%d: Virtual frame buffer device, using %ldK of video memory\n", 452 "fb%d: Virtual frame buffer device, using %ldK of video memory\n",
@@ -462,9 +461,9 @@ err:
462 return retval; 461 return retval;
463} 462}
464 463
465static int vfb_remove(struct device *device) 464static int vfb_remove(struct platform_device *dev)
466{ 465{
467 struct fb_info *info = dev_get_drvdata(device); 466 struct fb_info *info = platform_get_drvdata(dev);
468 467
469 if (info) { 468 if (info) {
470 unregister_framebuffer(info); 469 unregister_framebuffer(info);
@@ -474,11 +473,12 @@ static int vfb_remove(struct device *device)
474 return 0; 473 return 0;
475} 474}
476 475
477static struct device_driver vfb_driver = { 476static struct platform_driver vfb_driver = {
478 .name = "vfb",
479 .bus = &platform_bus_type,
480 .probe = vfb_probe, 477 .probe = vfb_probe,
481 .remove = vfb_remove, 478 .remove = vfb_remove,
479 .driver = {
480 .name = "vfb",
481 },
482}; 482};
483 483
484static struct platform_device vfb_device = { 484static struct platform_device vfb_device = {
@@ -504,12 +504,12 @@ static int __init vfb_init(void)
504 if (!vfb_enable) 504 if (!vfb_enable)
505 return -ENXIO; 505 return -ENXIO;
506 506
507 ret = driver_register(&vfb_driver); 507 ret = platform_driver_register(&vfb_driver);
508 508
509 if (!ret) { 509 if (!ret) {
510 ret = platform_device_register(&vfb_device); 510 ret = platform_device_register(&vfb_device);
511 if (ret) 511 if (ret)
512 driver_unregister(&vfb_driver); 512 platform_driver_unregister(&vfb_driver);
513 } 513 }
514 return ret; 514 return ret;
515} 515}
@@ -520,7 +520,7 @@ module_init(vfb_init);
520static void __exit vfb_exit(void) 520static void __exit vfb_exit(void)
521{ 521{
522 platform_device_unregister(&vfb_device); 522 platform_device_unregister(&vfb_device);
523 driver_unregister(&vfb_driver); 523 platform_driver_unregister(&vfb_driver);
524} 524}
525 525
526module_exit(vfb_exit); 526module_exit(vfb_exit);
diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
index 48e70f153c4b..daa46051f55d 100644
--- a/drivers/video/w100fb.c
+++ b/drivers/video/w100fb.c
@@ -437,9 +437,9 @@ static void w100fb_restore_vidmem(struct w100fb_par *par)
437 } 437 }
438} 438}
439 439
440static int w100fb_suspend(struct device *dev, pm_message_t state) 440static int w100fb_suspend(struct platform_device *dev, pm_message_t state)
441{ 441{
442 struct fb_info *info = dev_get_drvdata(dev); 442 struct fb_info *info = platform_get_drvdata(dev);
443 struct w100fb_par *par=info->par; 443 struct w100fb_par *par=info->par;
444 struct w100_tg_info *tg = par->mach->tg; 444 struct w100_tg_info *tg = par->mach->tg;
445 445
@@ -452,9 +452,9 @@ static int w100fb_suspend(struct device *dev, pm_message_t state)
452 return 0; 452 return 0;
453} 453}
454 454
455static int w100fb_resume(struct device *dev) 455static int w100fb_resume(struct platform_device *dev)
456{ 456{
457 struct fb_info *info = dev_get_drvdata(dev); 457 struct fb_info *info = platform_get_drvdata(dev);
458 struct w100fb_par *par=info->par; 458 struct w100fb_par *par=info->par;
459 struct w100_tg_info *tg = par->mach->tg; 459 struct w100_tg_info *tg = par->mach->tg;
460 460
@@ -473,13 +473,12 @@ static int w100fb_resume(struct device *dev)
473#endif 473#endif
474 474
475 475
476int __init w100fb_probe(struct device *dev) 476int __init w100fb_probe(struct platform_device *pdev)
477{ 477{
478 int err = -EIO; 478 int err = -EIO;
479 struct w100fb_mach_info *inf; 479 struct w100fb_mach_info *inf;
480 struct fb_info *info = NULL; 480 struct fb_info *info = NULL;
481 struct w100fb_par *par; 481 struct w100fb_par *par;
482 struct platform_device *pdev = to_platform_device(dev);
483 struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 482 struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
484 unsigned int chip_id; 483 unsigned int chip_id;
485 484
@@ -522,9 +521,9 @@ int __init w100fb_probe(struct device *dev)
522 } 521 }
523 522
524 par = info->par; 523 par = info->par;
525 dev_set_drvdata(dev, info); 524 platform_set_drvdata(pdev, info);
526 525
527 inf = dev->platform_data; 526 inf = pdev->dev.platform_data;
528 par->chip_id = chip_id; 527 par->chip_id = chip_id;
529 par->mach = inf; 528 par->mach = inf;
530 par->fastpll_mode = 0; 529 par->fastpll_mode = 0;
@@ -600,10 +599,10 @@ int __init w100fb_probe(struct device *dev)
600 goto out; 599 goto out;
601 } 600 }
602 601
603 device_create_file(dev, &dev_attr_fastpllclk); 602 device_create_file(&pdev->dev, &dev_attr_fastpllclk);
604 device_create_file(dev, &dev_attr_reg_read); 603 device_create_file(&pdev->dev, &dev_attr_reg_read);
605 device_create_file(dev, &dev_attr_reg_write); 604 device_create_file(&pdev->dev, &dev_attr_reg_write);
606 device_create_file(dev, &dev_attr_flip); 605 device_create_file(&pdev->dev, &dev_attr_flip);
607 606
608 printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id); 607 printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id);
609 return 0; 608 return 0;
@@ -622,15 +621,15 @@ out:
622} 621}
623 622
624 623
625static int w100fb_remove(struct device *dev) 624static int w100fb_remove(struct platform_device *pdev)
626{ 625{
627 struct fb_info *info = dev_get_drvdata(dev); 626 struct fb_info *info = platform_get_drvdata(pdev);
628 struct w100fb_par *par=info->par; 627 struct w100fb_par *par=info->par;
629 628
630 device_remove_file(dev, &dev_attr_fastpllclk); 629 device_remove_file(&pdev->dev, &dev_attr_fastpllclk);
631 device_remove_file(dev, &dev_attr_reg_read); 630 device_remove_file(&pdev->dev, &dev_attr_reg_read);
632 device_remove_file(dev, &dev_attr_reg_write); 631 device_remove_file(&pdev->dev, &dev_attr_reg_write);
633 device_remove_file(dev, &dev_attr_flip); 632 device_remove_file(&pdev->dev, &dev_attr_flip);
634 633
635 unregister_framebuffer(info); 634 unregister_framebuffer(info);
636 635
@@ -1448,23 +1447,24 @@ static void w100_vsync(void)
1448 writel(0x00000002, remapped_regs + mmGEN_INT_STATUS); 1447 writel(0x00000002, remapped_regs + mmGEN_INT_STATUS);
1449} 1448}
1450 1449
1451static struct device_driver w100fb_driver = { 1450static struct platform_driver w100fb_driver = {
1452 .name = "w100fb",
1453 .bus = &platform_bus_type,
1454 .probe = w100fb_probe, 1451 .probe = w100fb_probe,
1455 .remove = w100fb_remove, 1452 .remove = w100fb_remove,
1456 .suspend = w100fb_suspend, 1453 .suspend = w100fb_suspend,
1457 .resume = w100fb_resume, 1454 .resume = w100fb_resume,
1455 .driver = {
1456 .name = "w100fb",
1457 },
1458}; 1458};
1459 1459
1460int __devinit w100fb_init(void) 1460int __devinit w100fb_init(void)
1461{ 1461{
1462 return driver_register(&w100fb_driver); 1462 return platform_driver_register(&w100fb_driver);
1463} 1463}
1464 1464
1465void __exit w100fb_cleanup(void) 1465void __exit w100fb_cleanup(void)
1466{ 1466{
1467 driver_unregister(&w100fb_driver); 1467 platform_driver_unregister(&w100fb_driver);
1468} 1468}
1469 1469
1470module_init(w100fb_init); 1470module_init(w100fb_init);