aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pretzel.yyz.us>2005-06-22 13:10:49 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-22 13:10:49 -0400
commit80bd6d7f5e0d872a0f5a151473d2a39d95d210a8 (patch)
treeb3a36048d6b7de88f7e906624ecb4b98816bb736 /drivers
parent949d33e70f2c3e93bfe5265a50e40175b1ab1ec1 (diff)
parent2a5a68b840cbab31baab2d9b2e1e6de3b289ae1e (diff)
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'drivers')
-rw-r--r--drivers/Kconfig2
-rw-r--r--drivers/Makefile2
-rw-r--r--drivers/acpi/Kconfig5
-rw-r--r--drivers/acpi/pci_irq.c4
-rw-r--r--drivers/acpi/processor_idle.c2
-rw-r--r--drivers/acpi/scan.c4
-rw-r--r--drivers/atm/Makefile3
-rw-r--r--drivers/atm/fore200e.c6
-rw-r--r--drivers/atm/he.c6
-rw-r--r--drivers/atm/nicstar.c20
-rw-r--r--drivers/atm/zatm.c11
-rw-r--r--drivers/base/Makefile4
-rw-r--r--drivers/base/base.h2
-rw-r--r--drivers/base/bus.c299
-rw-r--r--drivers/base/class.c194
-rw-r--r--drivers/base/class_simple.c199
-rw-r--r--drivers/base/core.c62
-rw-r--r--drivers/base/dd.c248
-rw-r--r--drivers/base/dmapool.c2
-rw-r--r--drivers/base/driver.c39
-rw-r--r--drivers/base/node.c22
-rw-r--r--drivers/base/power/resume.c8
-rw-r--r--drivers/base/power/suspend.c16
-rw-r--r--drivers/base/power/sysfs.c4
-rw-r--r--drivers/base/sys.c4
-rw-r--r--drivers/block/aoe/aoechr.c10
-rw-r--r--drivers/block/as-iosched.c4
-rw-r--r--drivers/block/cciss.c12
-rw-r--r--drivers/block/cfq-iosched.c13
-rw-r--r--drivers/block/deadline-iosched.c4
-rw-r--r--drivers/block/elevator.c22
-rw-r--r--drivers/block/genhd.c2
-rw-r--r--drivers/block/ll_rw_blk.c24
-rw-r--r--drivers/block/paride/pd.c2
-rw-r--r--drivers/block/paride/pg.c14
-rw-r--r--drivers/block/paride/pt.c20
-rw-r--r--drivers/block/sx8.c4
-rw-r--r--drivers/block/ub.c600
-rw-r--r--drivers/cdrom/viocd.c14
-rw-r--r--drivers/char/Kconfig4
-rw-r--r--drivers/char/Makefile1
-rw-r--r--drivers/char/agp/agp.h2
-rw-r--r--drivers/char/agp/ali-agp.c4
-rw-r--r--drivers/char/agp/amd-k7-agp.c6
-rw-r--r--drivers/char/agp/amd64-agp.c4
-rw-r--r--drivers/char/agp/ati-agp.c6
-rw-r--r--drivers/char/agp/backend.c6
-rw-r--r--drivers/char/agp/efficeon-agp.c2
-rw-r--r--drivers/char/agp/generic.c36
-rw-r--r--drivers/char/agp/hp-agp.c4
-rw-r--r--drivers/char/agp/i460-agp.c4
-rw-r--r--drivers/char/agp/intel-agp.c21
-rw-r--r--drivers/char/agp/sgi-agp.c12
-rw-r--r--drivers/char/agp/sworks-agp.c8
-rw-r--r--drivers/char/agp/uninorth-agp.c2
-rw-r--r--drivers/char/drm/drm_pciids.h1
-rw-r--r--drivers/char/drm/radeon_irq.c5
-rw-r--r--drivers/char/dsp56k.c14
-rw-r--r--drivers/char/ftape/zftape/zftape-init.c30
-rw-r--r--drivers/char/hvcs.c14
-rw-r--r--drivers/char/ip2main.c24
-rw-r--r--drivers/char/ipmi/ipmi_devintf.c14
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c2
-rw-r--r--drivers/char/istallion.c10
-rw-r--r--drivers/char/lp.c12
-rw-r--r--drivers/char/mbcs.c4
-rw-r--r--drivers/char/mem.c15
-rw-r--r--drivers/char/misc.c16
-rw-r--r--drivers/char/mwave/mwavedd.c2
-rw-r--r--drivers/char/mxser.c38
-rw-r--r--drivers/char/ppdev.c12
-rw-r--r--drivers/char/raw.c18
-rw-r--r--drivers/char/snsc.c7
-rw-r--r--drivers/char/stallion.c10
-rw-r--r--drivers/char/tipar.c14
-rw-r--r--drivers/char/tpm/tpm.c6
-rw-r--r--drivers/char/tty_io.c16
-rw-r--r--drivers/char/vc_screen.c16
-rw-r--r--drivers/char/viotape.c16
-rw-r--r--drivers/char/vr41xx_giu.c743
-rw-r--r--drivers/char/vt.c4
-rw-r--r--drivers/char/watchdog/ixp2000_wdt.c7
-rw-r--r--drivers/cpufreq/Kconfig24
-rw-r--r--drivers/cpufreq/Makefile1
-rw-r--r--drivers/cpufreq/cpufreq.c12
-rw-r--r--drivers/cpufreq/cpufreq_conservative.c586
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c180
-rw-r--r--drivers/cpufreq/cpufreq_stats.c47
-rw-r--r--drivers/dio/dio-sysfs.c10
-rw-r--r--drivers/eisa/eisa-bus.c4
-rw-r--r--drivers/fc4/fc.c32
-rw-r--r--drivers/fc4/fc_syms.c1
-rw-r--r--drivers/fc4/fcp_impl.h1
-rw-r--r--drivers/firmware/edd.c2
-rw-r--r--drivers/firmware/efivars.c4
-rw-r--r--drivers/firmware/pcdp.c1
-rw-r--r--drivers/i2c/busses/i2c-ali1563.c46
-rw-r--r--drivers/i2c/chips/adm1021.c6
-rw-r--r--drivers/i2c/chips/adm1025.c28
-rw-r--r--drivers/i2c/chips/adm1026.c572
-rw-r--r--drivers/i2c/chips/adm1031.c44
-rw-r--r--drivers/i2c/chips/asb100.c46
-rw-r--r--drivers/i2c/chips/ds1621.c6
-rw-r--r--drivers/i2c/chips/fscher.c8
-rw-r--r--drivers/i2c/chips/fscpos.c16
-rw-r--r--drivers/i2c/chips/gl518sm.c12
-rw-r--r--drivers/i2c/chips/gl520sm.c8
-rw-r--r--drivers/i2c/chips/it87.c50
-rw-r--r--drivers/i2c/chips/lm63.c24
-rw-r--r--drivers/i2c/chips/lm75.c4
-rw-r--r--drivers/i2c/chips/lm77.c14
-rw-r--r--drivers/i2c/chips/lm78.c36
-rw-r--r--drivers/i2c/chips/lm80.c20
-rw-r--r--drivers/i2c/chips/lm83.c6
-rw-r--r--drivers/i2c/chips/lm85.c72
-rw-r--r--drivers/i2c/chips/lm87.c46
-rw-r--r--drivers/i2c/chips/lm90.c12
-rw-r--r--drivers/i2c/chips/lm92.c14
-rw-r--r--drivers/i2c/chips/max1619.c6
-rw-r--r--drivers/i2c/chips/pc87360.c68
-rw-r--r--drivers/i2c/chips/pcf8574.c6
-rw-r--r--drivers/i2c/chips/pcf8591.c10
-rw-r--r--drivers/i2c/chips/sis5595.c34
-rw-r--r--drivers/i2c/chips/smsc47b397.c4
-rw-r--r--drivers/i2c/chips/smsc47m1.c20
-rw-r--r--drivers/i2c/chips/via686a.c32
-rw-r--r--drivers/i2c/chips/w83627hf.c56
-rw-r--r--drivers/i2c/chips/w83781d.c52
-rw-r--r--drivers/i2c/chips/w83l785ts.c4
-rw-r--r--drivers/i2c/i2c-core.c4
-rw-r--r--drivers/ide/Kconfig4
-rw-r--r--drivers/ide/ide-cd.c52
-rw-r--r--drivers/ide/ide-disk.c41
-rw-r--r--drivers/ide/ide-floppy.c42
-rw-r--r--drivers/ide/ide-probe.c51
-rw-r--r--drivers/ide/ide-proc.c52
-rw-r--r--drivers/ide/ide-tape.c51
-rw-r--r--drivers/ide/ide.c307
-rw-r--r--drivers/ide/pci/amd74xx.c3
-rw-r--r--drivers/ide/pci/sgiioc4.c30
-rw-r--r--drivers/ieee1394/dv1394.c6
-rw-r--r--drivers/ieee1394/ieee1394_core.c8
-rw-r--r--drivers/ieee1394/ieee1394_core.h3
-rw-r--r--drivers/ieee1394/nodemgr.c27
-rw-r--r--drivers/ieee1394/raw1394.c10
-rw-r--r--drivers/ieee1394/sbp2.c156
-rw-r--r--drivers/ieee1394/sbp2.h4
-rw-r--r--drivers/ieee1394/video1394.c4
-rw-r--r--drivers/infiniband/core/sysfs.c122
-rw-r--r--drivers/input/evdev.c9
-rw-r--r--drivers/input/gameport/Kconfig20
-rw-r--r--drivers/input/gameport/gameport.c6
-rw-r--r--drivers/input/input.c10
-rw-r--r--drivers/input/joydev.c10
-rw-r--r--drivers/input/keyboard/atkbd.c12
-rw-r--r--drivers/input/mouse/alps.c2
-rw-r--r--drivers/input/mouse/psmouse-base.c7
-rw-r--r--drivers/input/mouse/psmouse.h4
-rw-r--r--drivers/input/mouse/synaptics.c39
-rw-r--r--drivers/input/mousedev.c31
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h32
-rw-r--r--drivers/input/serio/i8042.c50
-rw-r--r--drivers/input/serio/serio.c16
-rw-r--r--drivers/input/touchscreen/gunze.c3
-rw-r--r--drivers/input/tsdev.c9
-rw-r--r--drivers/isdn/capi/capi.c14
-rw-r--r--drivers/macintosh/adb.c9
-rw-r--r--drivers/macintosh/therm_adt746x.c11
-rw-r--r--drivers/macintosh/therm_pm72.c4
-rw-r--r--drivers/macintosh/therm_windtunnel.c4
-rw-r--r--drivers/macintosh/via-pmu.c12
-rw-r--r--drivers/mca/mca-bus.c4
-rw-r--r--drivers/md/Makefile3
-rw-r--r--drivers/md/bitmap.c1586
-rw-r--r--drivers/md/dm-crypt.c3
-rw-r--r--drivers/md/dm-mpath.c3
-rw-r--r--drivers/md/linear.c3
-rw-r--r--drivers/md/md.c525
-rw-r--r--drivers/md/multipath.c3
-rw-r--r--drivers/md/raid0.c12
-rw-r--r--drivers/md/raid1.c242
-rw-r--r--drivers/md/raid10.c30
-rw-r--r--drivers/md/raid5.c12
-rw-r--r--drivers/md/raid6main.c12
-rw-r--r--drivers/media/dvb/bt8xx/dst.c122
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c13
-rw-r--r--drivers/message/fusion/Kconfig56
-rw-r--r--drivers/message/fusion/Makefile44
-rw-r--r--drivers/message/fusion/lsi/mpi.h70
-rw-r--r--drivers/message/fusion/lsi/mpi_cnfg.h1007
-rw-r--r--drivers/message/fusion/lsi/mpi_fc.h7
-rw-r--r--drivers/message/fusion/lsi/mpi_history.txt451
-rw-r--r--drivers/message/fusion/lsi/mpi_inb.h7
-rw-r--r--drivers/message/fusion/lsi/mpi_init.h88
-rw-r--r--drivers/message/fusion/lsi/mpi_ioc.h246
-rw-r--r--drivers/message/fusion/lsi/mpi_lan.h6
-rw-r--r--drivers/message/fusion/lsi/mpi_raid.h17
-rw-r--r--drivers/message/fusion/lsi/mpi_sas.h171
-rw-r--r--drivers/message/fusion/lsi/mpi_targ.h160
-rw-r--r--drivers/message/fusion/lsi/mpi_tool.h57
-rw-r--r--drivers/message/fusion/lsi/mpi_type.h11
-rw-r--r--drivers/message/fusion/mptbase.c343
-rw-r--r--drivers/message/fusion/mptbase.h52
-rw-r--r--drivers/message/fusion/mptctl.c68
-rw-r--r--drivers/message/fusion/mptctl.h15
-rw-r--r--drivers/message/fusion/mptfc.c431
-rw-r--r--drivers/message/fusion/mptlan.c37
-rw-r--r--drivers/message/fusion/mptlan.h48
-rw-r--r--drivers/message/fusion/mptscsih.c795
-rw-r--r--drivers/message/fusion/mptscsih.h43
-rw-r--r--drivers/message/fusion/mptspi.c486
-rw-r--r--drivers/message/i2o/i2o_block.c1
-rw-r--r--drivers/misc/ibmasm/command.c30
-rw-r--r--drivers/misc/ibmasm/dot_command.c10
-rw-r--r--drivers/misc/ibmasm/event.c18
-rw-r--r--drivers/misc/ibmasm/heartbeat.c13
-rw-r--r--drivers/misc/ibmasm/ibmasm.h76
-rw-r--r--drivers/misc/ibmasm/ibmasmfs.c125
-rw-r--r--drivers/misc/ibmasm/lowlevel.c18
-rw-r--r--drivers/misc/ibmasm/module.c69
-rw-r--r--drivers/misc/ibmasm/r_heartbeat.c2
-rw-r--r--drivers/misc/ibmasm/remote.c304
-rw-r--r--drivers/misc/ibmasm/remote.h173
-rw-r--r--drivers/mmc/mmc_sysfs.c2
-rw-r--r--drivers/net/3c59x.c5
-rw-r--r--drivers/net/8139cp.c100
-rw-r--r--drivers/net/8139too.c194
-rw-r--r--drivers/net/8390.c4
-rw-r--r--drivers/net/Kconfig57
-rw-r--r--drivers/net/Makefile5
-rw-r--r--drivers/net/Space.c6
-rw-r--r--drivers/net/arm/etherh.c16
-rw-r--r--drivers/net/au1000_eth.c10
-rw-r--r--drivers/net/bmac.c2
-rw-r--r--drivers/net/bnx2.c5530
-rw-r--r--drivers/net/bnx2.h4352
-rw-r--r--drivers/net/bnx2_fw.h2468
-rw-r--r--drivers/net/bonding/bond_main.c2
-rw-r--r--drivers/net/dm9000.c1219
-rw-r--r--drivers/net/dm9000.h135
-rw-r--r--drivers/net/fmv18x.c689
-rw-r--r--drivers/net/forcedeth.c103
-rw-r--r--drivers/net/hamradio/baycom_epp.c126
-rw-r--r--drivers/net/irda/Kconfig2
-rw-r--r--drivers/net/iseries_veth.c41
-rw-r--r--drivers/net/natsemi.c6
-rw-r--r--drivers/net/ns83820.c69
-rw-r--r--drivers/net/pcmcia/3c574_cs.c3
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c17
-rw-r--r--drivers/net/ppp_generic.c191
-rw-r--r--drivers/net/r8169.c345
-rw-r--r--drivers/net/shaper.c86
-rw-r--r--drivers/net/sis900.c52
-rw-r--r--drivers/net/sk98lin/skge.c8
-rw-r--r--drivers/net/sk_g16.c2066
-rw-r--r--drivers/net/sk_g16.h165
-rw-r--r--drivers/net/skge.c3386
-rw-r--r--drivers/net/skge.h3005
-rw-r--r--drivers/net/smc91x.c58
-rw-r--r--drivers/net/smc91x.h15
-rw-r--r--drivers/net/starfire.c142
-rw-r--r--drivers/net/starfire_firmware.h346
-rw-r--r--drivers/net/tg3.c610
-rw-r--r--drivers/net/tlan.c16
-rw-r--r--drivers/net/tokenring/ibmtr.c11
-rw-r--r--drivers/net/wan/cosa.c12
-rw-r--r--drivers/net/wan/hdlc_fr.c320
-rw-r--r--drivers/net/wan/hdlc_generic.c16
-rw-r--r--drivers/net/wan/lmc/lmc_main.c8
-rw-r--r--drivers/net/wireless/airo.c150
-rw-r--r--drivers/net/wireless/atmel_cs.c1
-rw-r--r--drivers/net/wireless/orinoco.c332
-rw-r--r--drivers/net/wireless/orinoco.h1
-rw-r--r--drivers/oprofile/buffer_sync.c4
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_core.c304
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_pci.c149
-rw-r--r--drivers/pci/hotplug/cpqphp_sysfs.c4
-rw-r--r--drivers/pci/hotplug/pci_hotplug_core.c4
-rw-r--r--drivers/pci/hotplug/rpadlpar_sysfs.c2
-rw-r--r--drivers/pci/hotplug/shpchp_sysfs.c4
-rw-r--r--drivers/pci/hotplug/shpchprm_acpi.c4
-rw-r--r--drivers/pci/pci-driver.c31
-rw-r--r--drivers/pci/pci-sysfs.c21
-rw-r--r--drivers/pci/pci.ids1
-rw-r--r--drivers/pci/pcie/portdrv_core.c139
-rw-r--r--drivers/pci/probe.c2
-rw-r--r--drivers/pci/quirks.c59
-rw-r--r--drivers/pcmcia/Kconfig6
-rw-r--r--drivers/pcmcia/ds.c4
-rw-r--r--drivers/pcmcia/m32r_cfc.c57
-rw-r--r--drivers/pcmcia/m32r_cfc.h8
-rw-r--r--drivers/pnp/card.c4
-rw-r--r--drivers/pnp/driver.c12
-rw-r--r--drivers/pnp/interface.c8
-rw-r--r--drivers/s390/block/dasd_devmap.c10
-rw-r--r--drivers/s390/block/dcssblk.c24
-rw-r--r--drivers/s390/char/raw3270.c6
-rw-r--r--drivers/s390/char/tape_class.c10
-rw-r--r--drivers/s390/char/tape_core.c10
-rw-r--r--drivers/s390/char/vmlogrdr.c22
-rw-r--r--drivers/s390/cio/blacklist.c6
-rw-r--r--drivers/s390/cio/ccwgroup.c6
-rw-r--r--drivers/s390/cio/chsc.c6
-rw-r--r--drivers/s390/cio/cmf.c12
-rw-r--r--drivers/s390/cio/device.c14
-rw-r--r--drivers/s390/net/Makefile3
-rw-r--r--drivers/s390/net/claw.c40
-rw-r--r--drivers/s390/net/ctcdbug.h12
-rw-r--r--drivers/s390/net/ctcmain.c634
-rw-r--r--drivers/s390/net/ctcmain.h276
-rw-r--r--drivers/s390/net/ctctty.c5
-rw-r--r--drivers/s390/net/cu3088.c4
-rw-r--r--drivers/s390/net/cu3088.h3
-rw-r--r--drivers/s390/net/iucv.c10
-rw-r--r--drivers/s390/net/lcs.c43
-rw-r--r--drivers/s390/net/netiucv.c44
-rw-r--r--drivers/s390/net/qeth.h35
-rw-r--r--drivers/s390/net/qeth_eddp.c51
-rw-r--r--drivers/s390/net/qeth_main.c316
-rw-r--r--drivers/s390/net/qeth_sys.c126
-rw-r--r--drivers/s390/net/qeth_tso.c285
-rw-r--r--drivers/s390/net/qeth_tso.h166
-rw-r--r--drivers/s390/scsi/zfcp_aux.c37
-rw-r--r--drivers/s390/scsi/zfcp_def.h25
-rw-r--r--drivers/s390/scsi/zfcp_erp.c121
-rw-r--r--drivers/s390/scsi/zfcp_ext.h4
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c324
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c68
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c26
-rw-r--r--drivers/s390/scsi/zfcp_sysfs_adapter.c10
-rw-r--r--drivers/s390/scsi/zfcp_sysfs_port.c10
-rw-r--r--drivers/s390/scsi/zfcp_sysfs_unit.c6
-rw-r--r--drivers/scsi/3w-9xxx.c3
-rw-r--r--drivers/scsi/3w-xxxx.c3
-rw-r--r--drivers/scsi/53c700.c28
-rw-r--r--drivers/scsi/BusLogic.c8
-rw-r--r--drivers/scsi/FlashPoint.c5676
-rw-r--r--drivers/scsi/Kconfig42
-rw-r--r--drivers/scsi/Makefile3
-rw-r--r--drivers/scsi/NCR5380.c42
-rw-r--r--drivers/scsi/NCR5380.h2
-rw-r--r--drivers/scsi/NCR53C9x.c6
-rw-r--r--drivers/scsi/NCR53c406a.c23
-rw-r--r--drivers/scsi/a2091.c7
-rw-r--r--drivers/scsi/a3000.c7
-rw-r--r--drivers/scsi/aacraid/aachba.c165
-rw-r--r--drivers/scsi/aacraid/aacraid.h468
-rw-r--r--drivers/scsi/aacraid/commctrl.c228
-rw-r--r--drivers/scsi/aacraid/comminit.c92
-rw-r--r--drivers/scsi/aacraid/commsup.c100
-rw-r--r--drivers/scsi/aacraid/dpcsup.c6
-rw-r--r--drivers/scsi/aacraid/linit.c179
-rw-r--r--drivers/scsi/aacraid/rkt.c43
-rw-r--r--drivers/scsi/aacraid/rx.c46
-rw-r--r--drivers/scsi/aacraid/sa.c35
-rw-r--r--drivers/scsi/aha152x.c2
-rw-r--r--drivers/scsi/aha1542.c22
-rw-r--r--drivers/scsi/aha1542.h1
-rw-r--r--drivers/scsi/ahci.c103
-rw-r--r--drivers/scsi/aic7xxx/aic7770_osm.c189
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.c14
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.h17
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx.h2
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_core.c16
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.c660
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.h64
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm_pci.c44
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_proc.c31
-rw-r--r--drivers/scsi/aic7xxx_old.c33
-rw-r--r--drivers/scsi/arm/cumana_1.c2
-rw-r--r--drivers/scsi/arm/ecoscsi.c2
-rw-r--r--drivers/scsi/arm/eesox.c4
-rw-r--r--drivers/scsi/arm/fas216.c3
-rw-r--r--drivers/scsi/arm/oak.c2
-rw-r--r--drivers/scsi/arm/powertec.c4
-rw-r--r--drivers/scsi/ata_piix.c18
-rw-r--r--drivers/scsi/atp870u.c4
-rw-r--r--drivers/scsi/ch.c1026
-rw-r--r--drivers/scsi/dc395x.c12
-rw-r--r--drivers/scsi/dmx3191d.c2
-rw-r--r--drivers/scsi/dpt_i2o.c65
-rw-r--r--drivers/scsi/dpti.h2
-rw-r--r--drivers/scsi/dtc.c2
-rw-r--r--drivers/scsi/dtc.h4
-rw-r--r--drivers/scsi/eata.c11
-rw-r--r--drivers/scsi/eata_pio.c5
-rw-r--r--drivers/scsi/fcal.c1
-rw-r--r--drivers/scsi/fd_mcs.c17
-rw-r--r--drivers/scsi/fdomain.c6
-rw-r--r--drivers/scsi/g_NCR5380.c2
-rw-r--r--drivers/scsi/g_NCR5380.h4
-rw-r--r--drivers/scsi/gdth.c23
-rw-r--r--drivers/scsi/gvp11.c8
-rw-r--r--drivers/scsi/ibmmca.c28
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c4
-rw-r--r--drivers/scsi/ide-scsi.c97
-rw-r--r--drivers/scsi/imm.c9
-rw-r--r--drivers/scsi/in2000.c31
-rw-r--r--drivers/scsi/in2000.h2
-rw-r--r--drivers/scsi/initio.c4
-rw-r--r--drivers/scsi/ipr.c57
-rw-r--r--drivers/scsi/ipr.h4
-rw-r--r--drivers/scsi/ips.c21
-rw-r--r--drivers/scsi/libata-core.c535
-rw-r--r--drivers/scsi/libata-scsi.c2
-rw-r--r--drivers/scsi/libata.h2
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c36
-rw-r--r--drivers/scsi/mac53c94.c11
-rw-r--r--drivers/scsi/mac_scsi.c2
-rw-r--r--drivers/scsi/mac_scsi.h2
-rw-r--r--drivers/scsi/megaraid.c14
-rw-r--r--drivers/scsi/megaraid/mega_common.h1
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.c160
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.h64
-rw-r--r--drivers/scsi/megaraid/megaraid_mm.c9
-rw-r--r--drivers/scsi/megaraid/megaraid_mm.h4
-rw-r--r--drivers/scsi/mesh.c4
-rw-r--r--drivers/scsi/mvme147.c7
-rw-r--r--drivers/scsi/nsp32.c7
-rw-r--r--drivers/scsi/osst.c10
-rw-r--r--drivers/scsi/pas16.c2
-rw-r--r--drivers/scsi/pas16.h4
-rw-r--r--drivers/scsi/pci2000.c836
-rw-r--r--drivers/scsi/pci2220i.c2915
-rw-r--r--drivers/scsi/pci2220i.h39
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c15
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c2
-rw-r--r--drivers/scsi/pcmcia/sym53c500_cs.c2
-rw-r--r--drivers/scsi/pluto.c1
-rw-r--r--drivers/scsi/ppa.c5
-rw-r--r--drivers/scsi/psi_dale.h564
-rw-r--r--drivers/scsi/psi_roy.h331
-rw-r--r--drivers/scsi/ql1040_fw.h4021
-rw-r--r--drivers/scsi/ql12160_fw.h3046
-rw-r--r--drivers/scsi/ql1280_fw.h3653
-rw-r--r--drivers/scsi/qla1280.c41
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.c3
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h60
-rw-r--r--drivers/scsi/qla2xxx/qla_gbl.h14
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c33
-rw-r--r--drivers/scsi/qla2xxx/qla_iocb.c3
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c18
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c6
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c173
-rw-r--r--drivers/scsi/qlogicfas.c2
-rw-r--r--drivers/scsi/qlogicfas408.c26
-rw-r--r--drivers/scsi/qlogicfas408.h2
-rw-r--r--drivers/scsi/sata_nv.c2
-rw-r--r--drivers/scsi/sata_promise.c27
-rw-r--r--drivers/scsi/sata_qstor.c2
-rw-r--r--drivers/scsi/sata_sil.c9
-rw-r--r--drivers/scsi/sata_sis.c1
-rw-r--r--drivers/scsi/sata_svw.c28
-rw-r--r--drivers/scsi/sata_sx4.c2
-rw-r--r--drivers/scsi/sata_uli.c1
-rw-r--r--drivers/scsi/sata_via.c1
-rw-r--r--drivers/scsi/sata_vsc.c2
-rw-r--r--drivers/scsi/scsi.c10
-rw-r--r--drivers/scsi/scsi_error.c42
-rw-r--r--drivers/scsi/scsi_lib.c40
-rw-r--r--drivers/scsi/scsi_scan.c26
-rw-r--r--drivers/scsi/scsi_sysfs.c42
-rw-r--r--drivers/scsi/scsi_transport_spi.c93
-rw-r--r--drivers/scsi/sd.c36
-rw-r--r--drivers/scsi/seagate.c15
-rw-r--r--drivers/scsi/seagate.h2
-rw-r--r--drivers/scsi/sg.c16
-rw-r--r--drivers/scsi/sgiwd93.c7
-rw-r--r--drivers/scsi/st.c47
-rw-r--r--drivers/scsi/sun3x_esp.c2
-rw-r--r--drivers/scsi/sym53c416.c23
-rw-r--r--drivers/scsi/sym53c416.h3
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_defs.h2
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_glue.c152
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_glue.h27
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_hipd.c65
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_hipd.h22
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_nvram.c7
-rw-r--r--drivers/scsi/t128.c2
-rw-r--r--drivers/scsi/t128.h4
-rw-r--r--drivers/scsi/tmscsim.c6
-rw-r--r--drivers/scsi/u14-34f.c8
-rw-r--r--drivers/scsi/ultrastor.c4
-rw-r--r--drivers/scsi/wd7000.c9
-rw-r--r--drivers/serial/Kconfig11
-rw-r--r--drivers/serial/Makefile2
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm2.c9
-rw-r--r--drivers/serial/ioc4_serial.c336
-rw-r--r--drivers/serial/sa1100.c2
-rw-r--r--drivers/serial/vr41xx_siu.c66
-rw-r--r--drivers/sh/superhyway/superhyway-sysfs.c2
-rw-r--r--drivers/sn/Kconfig20
-rw-r--r--drivers/sn/Makefile2
-rw-r--r--drivers/sn/ioc4.c418
-rw-r--r--drivers/usb/core/devices.c2
-rw-r--r--drivers/usb/core/file.c13
-rw-r--r--drivers/usb/core/hcd.c61
-rw-r--r--drivers/usb/core/sysfs.c48
-rw-r--r--drivers/usb/core/usb.c53
-rw-r--r--drivers/usb/gadget/dummy_hcd.c4
-rw-r--r--drivers/usb/gadget/file_storage.c8
-rw-r--r--drivers/usb/gadget/net2280.c6
-rw-r--r--drivers/usb/gadget/pxa2xx_udc.c2
-rw-r--r--drivers/usb/host/Kconfig11
-rw-r--r--drivers/usb/host/Makefile1
-rw-r--r--drivers/usb/host/ehci-dbg.c10
-rw-r--r--drivers/usb/host/ehci-hub.c5
-rw-r--r--drivers/usb/host/ohci-dbg.c10
-rw-r--r--drivers/usb/host/sl811-hcd.c146
-rw-r--r--drivers/usb/host/sl811_cs.c442
-rw-r--r--drivers/usb/input/aiptek.c78
-rw-r--r--drivers/usb/input/hid-core.c18
-rw-r--r--drivers/usb/media/pwc/ChangeLog143
-rw-r--r--drivers/usb/media/pwc/Makefile2
-rw-r--r--drivers/usb/media/pwc/pwc-ctrl.c14
-rw-r--r--drivers/usb/media/pwc/pwc-dec1.c42
-rw-r--r--drivers/usb/media/pwc/pwc-dec1.h36
-rw-r--r--drivers/usb/media/pwc/pwc-dec23.c623
-rw-r--r--drivers/usb/media/pwc/pwc-dec23.h58
-rw-r--r--drivers/usb/media/pwc/pwc-if.c13
-rw-r--r--drivers/usb/media/pwc/pwc-kiara.c573
-rw-r--r--drivers/usb/media/pwc/pwc-timon.c1130
-rw-r--r--drivers/usb/media/pwc/pwc-uncompress.c4
-rw-r--r--drivers/usb/misc/cytherm.c20
-rw-r--r--drivers/usb/misc/phidgetkit.c14
-rw-r--r--drivers/usb/misc/phidgetservo.c4
-rw-r--r--drivers/usb/misc/usbled.c4
-rw-r--r--drivers/usb/net/kaweth.c2
-rw-r--r--drivers/usb/net/usbnet.c2
-rw-r--r--drivers/usb/serial/Kconfig11
-rw-r--r--drivers/usb/serial/Makefile1
-rw-r--r--drivers/usb/serial/cp2101.c363
-rw-r--r--drivers/usb/serial/ftdi_sio.c127
-rw-r--r--drivers/usb/serial/ftdi_sio.h2
-rw-r--r--drivers/usb/serial/option.c729
-rw-r--r--drivers/usb/serial/usb-serial.c20
-rw-r--r--drivers/usb/storage/scsiglue.c13
-rw-r--r--drivers/usb/storage/unusual_devs.h9
-rw-r--r--drivers/video/Kconfig16
-rw-r--r--drivers/video/Makefile1
-rw-r--r--drivers/video/arcfb.c684
-rw-r--r--drivers/video/aty/radeon_base.c7
-rw-r--r--drivers/video/chipsfb.c3
-rw-r--r--drivers/video/console/Kconfig17
-rw-r--r--drivers/video/console/Makefile2
-rw-r--r--drivers/video/console/bitblit.c23
-rw-r--r--drivers/video/console/font_10x18.c5146
-rw-r--r--drivers/video/console/font_7x14.c4118
-rw-r--r--drivers/video/console/font_sun12x22.c1579
-rw-r--r--drivers/video/console/fonts.c8
-rw-r--r--drivers/video/console/vgacon.c17
-rw-r--r--drivers/video/fbmem.c77
-rw-r--r--drivers/video/fbsysfs.c2
-rw-r--r--drivers/video/gbefb.c4
-rw-r--r--drivers/video/i810/i810_main.c1
-rw-r--r--drivers/video/intelfb/intelfbdrv.c45
-rw-r--r--drivers/video/macmodes.c1
-rw-r--r--drivers/video/nvidia/nvidia.c18
-rw-r--r--drivers/video/pm3fb.c2
-rw-r--r--drivers/video/riva/fbdev.c19
-rw-r--r--drivers/video/s1d13xxxfb.c2
-rw-r--r--drivers/video/savage/savagefb_driver.c2
-rw-r--r--drivers/video/softcursor.c9
-rw-r--r--drivers/video/vesafb.c8
-rw-r--r--drivers/video/w100fb.c12
-rw-r--r--drivers/w1/w1.c16
-rw-r--r--drivers/w1/w1_family.h4
-rw-r--r--drivers/w1/w1_smem.c8
-rw-r--r--drivers/w1/w1_therm.c8
-rw-r--r--drivers/zorro/zorro-sysfs.c4
570 files changed, 57612 insertions, 32319 deletions
diff --git a/drivers/Kconfig b/drivers/Kconfig
index ed41d9036bfc..aed4a9b97c14 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -58,4 +58,6 @@ source "drivers/mmc/Kconfig"
58 58
59source "drivers/infiniband/Kconfig" 59source "drivers/infiniband/Kconfig"
60 60
61source "drivers/sn/Kconfig"
62
61endmenu 63endmenu
diff --git a/drivers/Makefile b/drivers/Makefile
index 15681de688f4..3167be54fedd 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -61,6 +61,6 @@ obj-$(CONFIG_EISA) += eisa/
61obj-$(CONFIG_CPU_FREQ) += cpufreq/ 61obj-$(CONFIG_CPU_FREQ) += cpufreq/
62obj-$(CONFIG_MMC) += mmc/ 62obj-$(CONFIG_MMC) += mmc/
63obj-$(CONFIG_INFINIBAND) += infiniband/ 63obj-$(CONFIG_INFINIBAND) += infiniband/
64obj-$(CONFIG_BLK_DEV_SGIIOC4) += sn/ 64obj-$(CONFIG_SGI_IOC4) += sn/
65obj-y += firmware/ 65obj-y += firmware/
66obj-$(CONFIG_CRYPTO) += crypto/ 66obj-$(CONFIG_CRYPTO) += crypto/
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 0400a52d5085..670fdb5142d1 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -40,13 +40,12 @@ config ACPI
40 available at: 40 available at:
41 <http://www.acpi.info> 41 <http://www.acpi.info>
42 42
43if ACPI
44
43config ACPI_BOOT 45config ACPI_BOOT
44 bool 46 bool
45 depends on ACPI || X86_HT
46 default y 47 default y
47 48
48if ACPI
49
50config ACPI_INTERPRETER 49config ACPI_INTERPRETER
51 bool 50 bool
52 depends on !IA64_SGI_SN 51 depends on !IA64_SGI_SN
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 12b0eea63407..8093f2e00321 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -391,7 +391,6 @@ acpi_pci_irq_enable (
391 u8 pin = 0; 391 u8 pin = 0;
392 int edge_level = ACPI_LEVEL_SENSITIVE; 392 int edge_level = ACPI_LEVEL_SENSITIVE;
393 int active_high_low = ACPI_ACTIVE_LOW; 393 int active_high_low = ACPI_ACTIVE_LOW;
394 extern int via_interrupt_line_quirk;
395 char *link = NULL; 394 char *link = NULL;
396 395
397 ACPI_FUNCTION_TRACE("acpi_pci_irq_enable"); 396 ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");
@@ -444,9 +443,6 @@ acpi_pci_irq_enable (
444 } 443 }
445 } 444 }
446 445
447 if (via_interrupt_line_quirk)
448 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq & 15);
449
450 dev->irq = acpi_register_gsi(irq, edge_level, active_high_low); 446 dev->irq = acpi_register_gsi(irq, edge_level, active_high_low);
451 447
452 printk(KERN_INFO PREFIX "PCI Interrupt %s[%c] -> ", 448 printk(KERN_INFO PREFIX "PCI Interrupt %s[%c] -> ",
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index ff64d333e95f..c9d671cf7857 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -171,7 +171,7 @@ static void acpi_processor_idle (void)
171 int sleep_ticks = 0; 171 int sleep_ticks = 0;
172 u32 t1, t2 = 0; 172 u32 t1, t2 = 0;
173 173
174 pr = processors[_smp_processor_id()]; 174 pr = processors[raw_smp_processor_id()];
175 if (!pr) 175 if (!pr)
176 return; 176 return;
177 177
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 119c94093a13..e85885593280 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -65,14 +65,14 @@ static ssize_t acpi_device_attr_show(struct kobject *kobj,
65{ 65{
66 struct acpi_device *device = to_acpi_device(kobj); 66 struct acpi_device *device = to_acpi_device(kobj);
67 struct acpi_device_attribute *attribute = to_handle_attr(attr); 67 struct acpi_device_attribute *attribute = to_handle_attr(attr);
68 return attribute->show ? attribute->show(device, buf) : 0; 68 return attribute->show ? attribute->show(device, buf) : -EIO;
69} 69}
70static ssize_t acpi_device_attr_store(struct kobject *kobj, 70static ssize_t acpi_device_attr_store(struct kobject *kobj,
71 struct attribute *attr, const char *buf, size_t len) 71 struct attribute *attr, const char *buf, size_t len)
72{ 72{
73 struct acpi_device *device = to_acpi_device(kobj); 73 struct acpi_device *device = to_acpi_device(kobj);
74 struct acpi_device_attribute *attribute = to_handle_attr(attr); 74 struct acpi_device_attribute *attribute = to_handle_attr(attr);
75 return attribute->store ? attribute->store(device, buf, len) : len; 75 return attribute->store ? attribute->store(device, buf, len) : -EIO;
76} 76}
77 77
78static struct sysfs_ops acpi_device_sysfs_ops = { 78static struct sysfs_ops acpi_device_sysfs_ops = {
diff --git a/drivers/atm/Makefile b/drivers/atm/Makefile
index d1dcd8eae3c9..5b77188527a9 100644
--- a/drivers/atm/Makefile
+++ b/drivers/atm/Makefile
@@ -39,7 +39,8 @@ ifeq ($(CONFIG_ATM_FORE200E_PCA),y)
39 fore_200e-objs += fore200e_pca_fw.o 39 fore_200e-objs += fore200e_pca_fw.o
40 # guess the target endianess to choose the right PCA-200E firmware image 40 # guess the target endianess to choose the right PCA-200E firmware image
41 ifeq ($(CONFIG_ATM_FORE200E_PCA_DEFAULT_FW),y) 41 ifeq ($(CONFIG_ATM_FORE200E_PCA_DEFAULT_FW),y)
42 CONFIG_ATM_FORE200E_PCA_FW = $(shell if test -n "`$(CC) -E -dM $(src)/../../include/asm/byteorder.h | grep ' __LITTLE_ENDIAN '`"; then echo $(obj)/pca200e.bin; else echo $(obj)/pca200e_ecd.bin2; fi) 42 byteorder.h := include$(if $(patsubst $(srctree),,$(objtree)),2)/asm/byteorder.h
43 CONFIG_ATM_FORE200E_PCA_FW := $(obj)/pca200e$(if $(shell $(CC) -E -dM $(byteorder.h) | grep ' __LITTLE_ENDIAN '),.bin,_ecd.bin2)
43 endif 44 endif
44endif 45endif
45 46
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index 9e65bfb85ba3..5f702199543a 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -383,8 +383,7 @@ fore200e_shutdown(struct fore200e* fore200e)
383 switch(fore200e->state) { 383 switch(fore200e->state) {
384 384
385 case FORE200E_STATE_COMPLETE: 385 case FORE200E_STATE_COMPLETE:
386 if (fore200e->stats) 386 kfree(fore200e->stats);
387 kfree(fore200e->stats);
388 387
389 case FORE200E_STATE_IRQ: 388 case FORE200E_STATE_IRQ:
390 free_irq(fore200e->irq, fore200e->atm_dev); 389 free_irq(fore200e->irq, fore200e->atm_dev);
@@ -963,8 +962,7 @@ fore200e_tx_irq(struct fore200e* fore200e)
963 entry, txq->tail, entry->vc_map, entry->skb); 962 entry, txq->tail, entry->vc_map, entry->skb);
964 963
965 /* free copy of misaligned data */ 964 /* free copy of misaligned data */
966 if (entry->data) 965 kfree(entry->data);
967 kfree(entry->data);
968 966
969 /* remove DMA mapping */ 967 /* remove DMA mapping */
970 fore200e->bus->dma_unmap(fore200e, entry->tpd->tsd[ 0 ].buffer, entry->tpd->tsd[ 0 ].length, 968 fore200e->bus->dma_unmap(fore200e, entry->tpd->tsd[ 0 ].buffer, entry->tpd->tsd[ 0 ].length,
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index 3022c548a132..df2c83fd5496 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -412,8 +412,7 @@ he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent)
412init_one_failure: 412init_one_failure:
413 if (atm_dev) 413 if (atm_dev)
414 atm_dev_deregister(atm_dev); 414 atm_dev_deregister(atm_dev);
415 if (he_dev) 415 kfree(he_dev);
416 kfree(he_dev);
417 pci_disable_device(pci_dev); 416 pci_disable_device(pci_dev);
418 return err; 417 return err;
419} 418}
@@ -2534,8 +2533,7 @@ he_open(struct atm_vcc *vcc)
2534open_failed: 2533open_failed:
2535 2534
2536 if (err) { 2535 if (err) {
2537 if (he_vcc) 2536 kfree(he_vcc);
2538 kfree(he_vcc);
2539 clear_bit(ATM_VF_ADDR, &vcc->flags); 2537 clear_bit(ATM_VF_ADDR, &vcc->flags);
2540 } 2538 }
2541 else 2539 else
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 85bf5c8442b0..b2a7b754fd14 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -676,10 +676,10 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
676 PRINTK("nicstar%d: RSQ base at 0x%x.\n", i, (u32) card->rsq.base); 676 PRINTK("nicstar%d: RSQ base at 0x%x.\n", i, (u32) card->rsq.base);
677 677
678 /* Initialize SCQ0, the only VBR SCQ used */ 678 /* Initialize SCQ0, the only VBR SCQ used */
679 card->scq1 = (scq_info *) NULL; 679 card->scq1 = NULL;
680 card->scq2 = (scq_info *) NULL; 680 card->scq2 = NULL;
681 card->scq0 = get_scq(VBR_SCQSIZE, NS_VRSCD0); 681 card->scq0 = get_scq(VBR_SCQSIZE, NS_VRSCD0);
682 if (card->scq0 == (scq_info *) NULL) 682 if (card->scq0 == NULL)
683 { 683 {
684 printk("nicstar%d: can't get SCQ0.\n", i); 684 printk("nicstar%d: can't get SCQ0.\n", i);
685 error = 12; 685 error = 12;
@@ -993,24 +993,24 @@ static scq_info *get_scq(int size, u32 scd)
993 int i; 993 int i;
994 994
995 if (size != VBR_SCQSIZE && size != CBR_SCQSIZE) 995 if (size != VBR_SCQSIZE && size != CBR_SCQSIZE)
996 return (scq_info *) NULL; 996 return NULL;
997 997
998 scq = (scq_info *) kmalloc(sizeof(scq_info), GFP_KERNEL); 998 scq = (scq_info *) kmalloc(sizeof(scq_info), GFP_KERNEL);
999 if (scq == (scq_info *) NULL) 999 if (scq == NULL)
1000 return (scq_info *) NULL; 1000 return NULL;
1001 scq->org = kmalloc(2 * size, GFP_KERNEL); 1001 scq->org = kmalloc(2 * size, GFP_KERNEL);
1002 if (scq->org == NULL) 1002 if (scq->org == NULL)
1003 { 1003 {
1004 kfree(scq); 1004 kfree(scq);
1005 return (scq_info *) NULL; 1005 return NULL;
1006 } 1006 }
1007 scq->skb = (struct sk_buff **) kmalloc(sizeof(struct sk_buff *) * 1007 scq->skb = (struct sk_buff **) kmalloc(sizeof(struct sk_buff *) *
1008 (size / NS_SCQE_SIZE), GFP_KERNEL); 1008 (size / NS_SCQE_SIZE), GFP_KERNEL);
1009 if (scq->skb == (struct sk_buff **) NULL) 1009 if (scq->skb == NULL)
1010 { 1010 {
1011 kfree(scq->org); 1011 kfree(scq->org);
1012 kfree(scq); 1012 kfree(scq);
1013 return (scq_info *) NULL; 1013 return NULL;
1014 } 1014 }
1015 scq->num_entries = size / NS_SCQE_SIZE; 1015 scq->num_entries = size / NS_SCQE_SIZE;
1016 scq->base = (ns_scqe *) ALIGN_ADDRESS(scq->org, size); 1016 scq->base = (ns_scqe *) ALIGN_ADDRESS(scq->org, size);
@@ -1498,7 +1498,7 @@ static int ns_open(struct atm_vcc *vcc)
1498 vc->cbr_scd = NS_FRSCD + frscdi * NS_FRSCD_SIZE; 1498 vc->cbr_scd = NS_FRSCD + frscdi * NS_FRSCD_SIZE;
1499 1499
1500 scq = get_scq(CBR_SCQSIZE, vc->cbr_scd); 1500 scq = get_scq(CBR_SCQSIZE, vc->cbr_scd);
1501 if (scq == (scq_info *) NULL) 1501 if (scq == NULL)
1502 { 1502 {
1503 PRINTK("nicstar%d: can't get fixed rate SCQ.\n", card->index); 1503 PRINTK("nicstar%d: can't get fixed rate SCQ.\n", card->index);
1504 card->scd2vc[frscdi] = NULL; 1504 card->scd2vc[frscdi] = NULL;
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index 47a800519ad0..8d5e65cb9755 100644
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -902,7 +902,7 @@ static void close_tx(struct atm_vcc *vcc)
902 zatm_dev->tx_bw += vcc->qos.txtp.min_pcr; 902 zatm_dev->tx_bw += vcc->qos.txtp.min_pcr;
903 dealloc_shaper(vcc->dev,zatm_vcc->shaper); 903 dealloc_shaper(vcc->dev,zatm_vcc->shaper);
904 } 904 }
905 if (zatm_vcc->ring) kfree(zatm_vcc->ring); 905 kfree(zatm_vcc->ring);
906} 906}
907 907
908 908
@@ -1339,12 +1339,9 @@ static int __init zatm_start(struct atm_dev *dev)
1339 return 0; 1339 return 0;
1340 out: 1340 out:
1341 for (i = 0; i < NR_MBX; i++) 1341 for (i = 0; i < NR_MBX; i++)
1342 if (zatm_dev->mbx_start[i] != 0) 1342 kfree(zatm_dev->mbx_start[i]);
1343 kfree((void *) zatm_dev->mbx_start[i]); 1343 kfree(zatm_dev->rx_map);
1344 if (zatm_dev->rx_map != NULL) 1344 kfree(zatm_dev->tx_map);
1345 kfree(zatm_dev->rx_map);
1346 if (zatm_dev->tx_map != NULL)
1347 kfree(zatm_dev->tx_map);
1348 free_irq(zatm_dev->irq, dev); 1345 free_irq(zatm_dev->irq, dev);
1349 return error; 1346 return error;
1350} 1347}
diff --git a/drivers/base/Makefile b/drivers/base/Makefile
index a47928a2e575..66d9c4643fc1 100644
--- a/drivers/base/Makefile
+++ b/drivers/base/Makefile
@@ -1,7 +1,7 @@
1# Makefile for the Linux device tree 1# Makefile for the Linux device tree
2 2
3obj-y := core.o sys.o bus.o \ 3obj-y := core.o sys.o bus.o dd.o \
4 driver.o class.o class_simple.o platform.o \ 4 driver.o class.o platform.o \
5 cpu.o firmware.o init.o map.o dmapool.o \ 5 cpu.o firmware.o init.o map.o dmapool.o \
6 attribute_container.o transport_class.o 6 attribute_container.o transport_class.o
7obj-y += power/ 7obj-y += power/
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 8d1e8bd48632..645f62692920 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -4,6 +4,8 @@ extern void bus_remove_device(struct device * dev);
4extern int bus_add_driver(struct device_driver *); 4extern int bus_add_driver(struct device_driver *);
5extern void bus_remove_driver(struct device_driver *); 5extern void bus_remove_driver(struct device_driver *);
6 6
7extern void driver_detach(struct device_driver * drv);
8
7static inline struct class_device *to_class_dev(struct kobject *obj) 9static inline struct class_device *to_class_dev(struct kobject *obj)
8{ 10{
9 return container_of(obj, struct class_device, kobj); 11 return container_of(obj, struct class_device, kobj);
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 3cb04bb04c2b..43722af90bdd 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -17,9 +17,6 @@
17#include "base.h" 17#include "base.h"
18#include "power/power.h" 18#include "power/power.h"
19 19
20#define to_dev(node) container_of(node, struct device, bus_list)
21#define to_drv(node) container_of(node, struct device_driver, kobj.entry)
22
23#define to_bus_attr(_attr) container_of(_attr, struct bus_attribute, attr) 20#define to_bus_attr(_attr) container_of(_attr, struct bus_attribute, attr)
24#define to_bus(obj) container_of(obj, struct bus_type, subsys.kset.kobj) 21#define to_bus(obj) container_of(obj, struct bus_type, subsys.kset.kobj)
25 22
@@ -36,7 +33,7 @@ drv_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
36{ 33{
37 struct driver_attribute * drv_attr = to_drv_attr(attr); 34 struct driver_attribute * drv_attr = to_drv_attr(attr);
38 struct device_driver * drv = to_driver(kobj); 35 struct device_driver * drv = to_driver(kobj);
39 ssize_t ret = 0; 36 ssize_t ret = -EIO;
40 37
41 if (drv_attr->show) 38 if (drv_attr->show)
42 ret = drv_attr->show(drv, buf); 39 ret = drv_attr->show(drv, buf);
@@ -49,7 +46,7 @@ drv_attr_store(struct kobject * kobj, struct attribute * attr,
49{ 46{
50 struct driver_attribute * drv_attr = to_drv_attr(attr); 47 struct driver_attribute * drv_attr = to_drv_attr(attr);
51 struct device_driver * drv = to_driver(kobj); 48 struct device_driver * drv = to_driver(kobj);
52 ssize_t ret = 0; 49 ssize_t ret = -EIO;
53 50
54 if (drv_attr->store) 51 if (drv_attr->store)
55 ret = drv_attr->store(drv, buf, count); 52 ret = drv_attr->store(drv, buf, count);
@@ -135,50 +132,11 @@ static struct kobj_type ktype_bus = {
135 132
136decl_subsys(bus, &ktype_bus, NULL); 133decl_subsys(bus, &ktype_bus, NULL);
137 134
138static int __bus_for_each_dev(struct bus_type *bus, struct device *start,
139 void *data, int (*fn)(struct device *, void *))
140{
141 struct list_head *head;
142 struct device *dev;
143 int error = 0;
144
145 if (!(bus = get_bus(bus)))
146 return -EINVAL;
147
148 head = &bus->devices.list;
149 dev = list_prepare_entry(start, head, bus_list);
150 list_for_each_entry_continue(dev, head, bus_list) {
151 get_device(dev);
152 error = fn(dev, data);
153 put_device(dev);
154 if (error)
155 break;
156 }
157 put_bus(bus);
158 return error;
159}
160 135
161static int __bus_for_each_drv(struct bus_type *bus, struct device_driver *start, 136static struct device * next_device(struct klist_iter * i)
162 void * data, int (*fn)(struct device_driver *, void *))
163{ 137{
164 struct list_head *head; 138 struct klist_node * n = klist_next(i);
165 struct device_driver *drv; 139 return n ? container_of(n, struct device, knode_bus) : NULL;
166 int error = 0;
167
168 if (!(bus = get_bus(bus)))
169 return -EINVAL;
170
171 head = &bus->drivers.list;
172 drv = list_prepare_entry(start, head, kobj.entry);
173 list_for_each_entry_continue(drv, head, kobj.entry) {
174 get_driver(drv);
175 error = fn(drv, data);
176 put_driver(drv);
177 if (error)
178 break;
179 }
180 put_bus(bus);
181 return error;
182} 140}
183 141
184/** 142/**
@@ -204,12 +162,27 @@ static int __bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
204int bus_for_each_dev(struct bus_type * bus, struct device * start, 162int bus_for_each_dev(struct bus_type * bus, struct device * start,
205 void * data, int (*fn)(struct device *, void *)) 163 void * data, int (*fn)(struct device *, void *))
206{ 164{
207 int ret; 165 struct klist_iter i;
166 struct device * dev;
167 int error = 0;
208 168
209 down_read(&bus->subsys.rwsem); 169 if (!bus)
210 ret = __bus_for_each_dev(bus, start, data, fn); 170 return -EINVAL;
211 up_read(&bus->subsys.rwsem); 171
212 return ret; 172 klist_iter_init_node(&bus->klist_devices, &i,
173 (start ? &start->knode_bus : NULL));
174 while ((dev = next_device(&i)) && !error)
175 error = fn(dev, data);
176 klist_iter_exit(&i);
177 return error;
178}
179
180
181
182static struct device_driver * next_driver(struct klist_iter * i)
183{
184 struct klist_node * n = klist_next(i);
185 return n ? container_of(n, struct device_driver, knode_bus) : NULL;
213} 186}
214 187
215/** 188/**
@@ -235,179 +208,19 @@ int bus_for_each_dev(struct bus_type * bus, struct device * start,
235int bus_for_each_drv(struct bus_type * bus, struct device_driver * start, 208int bus_for_each_drv(struct bus_type * bus, struct device_driver * start,
236 void * data, int (*fn)(struct device_driver *, void *)) 209 void * data, int (*fn)(struct device_driver *, void *))
237{ 210{
238 int ret; 211 struct klist_iter i;
239 212 struct device_driver * drv;
240 down_read(&bus->subsys.rwsem); 213 int error = 0;
241 ret = __bus_for_each_drv(bus, start, data, fn);
242 up_read(&bus->subsys.rwsem);
243 return ret;
244}
245
246/**
247 * device_bind_driver - bind a driver to one device.
248 * @dev: device.
249 *
250 * Allow manual attachment of a driver to a device.
251 * Caller must have already set @dev->driver.
252 *
253 * Note that this does not modify the bus reference count
254 * nor take the bus's rwsem. Please verify those are accounted
255 * for before calling this. (It is ok to call with no other effort
256 * from a driver's probe() method.)
257 */
258
259void device_bind_driver(struct device * dev)
260{
261 pr_debug("bound device '%s' to driver '%s'\n",
262 dev->bus_id, dev->driver->name);
263 list_add_tail(&dev->driver_list, &dev->driver->devices);
264 sysfs_create_link(&dev->driver->kobj, &dev->kobj,
265 kobject_name(&dev->kobj));
266 sysfs_create_link(&dev->kobj, &dev->driver->kobj, "driver");
267}
268
269
270/**
271 * driver_probe_device - attempt to bind device & driver.
272 * @drv: driver.
273 * @dev: device.
274 *
275 * First, we call the bus's match function, if one present, which
276 * should compare the device IDs the driver supports with the
277 * device IDs of the device. Note we don't do this ourselves
278 * because we don't know the format of the ID structures, nor what
279 * is to be considered a match and what is not.
280 *
281 * If we find a match, we call @drv->probe(@dev) if it exists, and
282 * call device_bind_driver() above.
283 */
284int driver_probe_device(struct device_driver * drv, struct device * dev)
285{
286 if (drv->bus->match && !drv->bus->match(dev, drv))
287 return -ENODEV;
288
289 dev->driver = drv;
290 if (drv->probe) {
291 int error = drv->probe(dev);
292 if (error) {
293 dev->driver = NULL;
294 return error;
295 }
296 }
297
298 device_bind_driver(dev);
299 return 0;
300}
301
302
303/**
304 * device_attach - try to attach device to a driver.
305 * @dev: device.
306 *
307 * Walk the list of drivers that the bus has and call
308 * driver_probe_device() for each pair. If a compatible
309 * pair is found, break out and return.
310 */
311int device_attach(struct device * dev)
312{
313 struct bus_type * bus = dev->bus;
314 struct list_head * entry;
315 int error;
316
317 if (dev->driver) {
318 device_bind_driver(dev);
319 return 1;
320 }
321
322 if (bus->match) {
323 list_for_each(entry, &bus->drivers.list) {
324 struct device_driver * drv = to_drv(entry);
325 error = driver_probe_device(drv, dev);
326 if (!error)
327 /* success, driver matched */
328 return 1;
329 if (error != -ENODEV && error != -ENXIO)
330 /* driver matched but the probe failed */
331 printk(KERN_WARNING
332 "%s: probe of %s failed with error %d\n",
333 drv->name, dev->bus_id, error);
334 }
335 }
336
337 return 0;
338}
339
340
341/**
342 * driver_attach - try to bind driver to devices.
343 * @drv: driver.
344 *
345 * Walk the list of devices that the bus has on it and try to
346 * match the driver with each one. If driver_probe_device()
347 * returns 0 and the @dev->driver is set, we've found a
348 * compatible pair.
349 *
350 * Note that we ignore the -ENODEV error from driver_probe_device(),
351 * since it's perfectly valid for a driver not to bind to any devices.
352 */
353void driver_attach(struct device_driver * drv)
354{
355 struct bus_type * bus = drv->bus;
356 struct list_head * entry;
357 int error;
358
359 if (!bus->match)
360 return;
361
362 list_for_each(entry, &bus->devices.list) {
363 struct device * dev = container_of(entry, struct device, bus_list);
364 if (!dev->driver) {
365 error = driver_probe_device(drv, dev);
366 if (error && (error != -ENODEV))
367 /* driver matched but the probe failed */
368 printk(KERN_WARNING
369 "%s: probe of %s failed with error %d\n",
370 drv->name, dev->bus_id, error);
371 }
372 }
373}
374
375
376/**
377 * device_release_driver - manually detach device from driver.
378 * @dev: device.
379 *
380 * Manually detach device from driver.
381 * Note that this is called without incrementing the bus
382 * reference count nor taking the bus's rwsem. Be sure that
383 * those are accounted for before calling this function.
384 */
385
386void device_release_driver(struct device * dev)
387{
388 struct device_driver * drv = dev->driver;
389 if (drv) {
390 sysfs_remove_link(&drv->kobj, kobject_name(&dev->kobj));
391 sysfs_remove_link(&dev->kobj, "driver");
392 list_del_init(&dev->driver_list);
393 if (drv->remove)
394 drv->remove(dev);
395 dev->driver = NULL;
396 }
397}
398
399 214
400/** 215 if (!bus)
401 * driver_detach - detach driver from all devices it controls. 216 return -EINVAL;
402 * @drv: driver.
403 */
404 217
405static void driver_detach(struct device_driver * drv) 218 klist_iter_init_node(&bus->klist_drivers, &i,
406{ 219 start ? &start->knode_bus : NULL);
407 while (!list_empty(&drv->devices)) { 220 while ((drv = next_driver(&i)) && !error)
408 struct device * dev = container_of(drv->devices.next, struct device, driver_list); 221 error = fn(drv, data);
409 device_release_driver(dev); 222 klist_iter_exit(&i);
410 } 223 return error;
411} 224}
412 225
413static int device_add_attrs(struct bus_type * bus, struct device * dev) 226static int device_add_attrs(struct bus_type * bus, struct device * dev)
@@ -456,14 +269,15 @@ int bus_add_device(struct device * dev)
456 int error = 0; 269 int error = 0;
457 270
458 if (bus) { 271 if (bus) {
459 down_write(&dev->bus->subsys.rwsem);
460 pr_debug("bus %s: add device %s\n", bus->name, dev->bus_id); 272 pr_debug("bus %s: add device %s\n", bus->name, dev->bus_id);
461 list_add_tail(&dev->bus_list, &dev->bus->devices.list); 273 error = device_attach(dev);
462 device_attach(dev); 274 klist_add_tail(&bus->klist_devices, &dev->knode_bus);
463 up_write(&dev->bus->subsys.rwsem); 275 if (error >= 0)
464 device_add_attrs(bus, dev); 276 error = device_add_attrs(bus, dev);
465 sysfs_create_link(&bus->devices.kobj, &dev->kobj, dev->bus_id); 277 if (!error) {
466 sysfs_create_link(&dev->kobj, &dev->bus->subsys.kset.kobj, "bus"); 278 sysfs_create_link(&bus->devices.kobj, &dev->kobj, dev->bus_id);
279 sysfs_create_link(&dev->kobj, &dev->bus->subsys.kset.kobj, "bus");
280 }
467 } 281 }
468 return error; 282 return error;
469} 283}
@@ -483,11 +297,9 @@ void bus_remove_device(struct device * dev)
483 sysfs_remove_link(&dev->kobj, "bus"); 297 sysfs_remove_link(&dev->kobj, "bus");
484 sysfs_remove_link(&dev->bus->devices.kobj, dev->bus_id); 298 sysfs_remove_link(&dev->bus->devices.kobj, dev->bus_id);
485 device_remove_attrs(dev->bus, dev); 299 device_remove_attrs(dev->bus, dev);
486 down_write(&dev->bus->subsys.rwsem); 300 klist_remove(&dev->knode_bus);
487 pr_debug("bus %s: remove device %s\n", dev->bus->name, dev->bus_id); 301 pr_debug("bus %s: remove device %s\n", dev->bus->name, dev->bus_id);
488 device_release_driver(dev); 302 device_release_driver(dev);
489 list_del_init(&dev->bus_list);
490 up_write(&dev->bus->subsys.rwsem);
491 put_bus(dev->bus); 303 put_bus(dev->bus);
492 } 304 }
493} 305}
@@ -547,9 +359,8 @@ int bus_add_driver(struct device_driver * drv)
547 return error; 359 return error;
548 } 360 }
549 361
550 down_write(&bus->subsys.rwsem);
551 driver_attach(drv); 362 driver_attach(drv);
552 up_write(&bus->subsys.rwsem); 363 klist_add_tail(&bus->klist_drivers, &drv->knode_bus);
553 module_add_driver(drv->owner, drv); 364 module_add_driver(drv->owner, drv);
554 365
555 driver_add_attrs(bus, drv); 366 driver_add_attrs(bus, drv);
@@ -571,10 +382,9 @@ void bus_remove_driver(struct device_driver * drv)
571{ 382{
572 if (drv->bus) { 383 if (drv->bus) {
573 driver_remove_attrs(drv->bus, drv); 384 driver_remove_attrs(drv->bus, drv);
574 down_write(&drv->bus->subsys.rwsem); 385 klist_remove(&drv->knode_bus);
575 pr_debug("bus %s: remove driver %s\n", drv->bus->name, drv->name); 386 pr_debug("bus %s: remove driver %s\n", drv->bus->name, drv->name);
576 driver_detach(drv); 387 driver_detach(drv);
577 up_write(&drv->bus->subsys.rwsem);
578 module_remove_driver(drv); 388 module_remove_driver(drv);
579 kobject_unregister(&drv->kobj); 389 kobject_unregister(&drv->kobj);
580 put_bus(drv->bus); 390 put_bus(drv->bus);
@@ -587,7 +397,7 @@ static int bus_rescan_devices_helper(struct device *dev, void *data)
587{ 397{
588 int *count = data; 398 int *count = data;
589 399
590 if (!dev->driver && device_attach(dev)) 400 if (!dev->driver && (device_attach(dev) > 0))
591 (*count)++; 401 (*count)++;
592 402
593 return 0; 403 return 0;
@@ -607,9 +417,7 @@ int bus_rescan_devices(struct bus_type * bus)
607{ 417{
608 int count = 0; 418 int count = 0;
609 419
610 down_write(&bus->subsys.rwsem); 420 bus_for_each_dev(bus, NULL, &count, bus_rescan_devices_helper);
611 __bus_for_each_dev(bus, NULL, &count, bus_rescan_devices_helper);
612 up_write(&bus->subsys.rwsem);
613 421
614 return count; 422 return count;
615} 423}
@@ -710,6 +518,9 @@ int bus_register(struct bus_type * bus)
710 retval = kset_register(&bus->drivers); 518 retval = kset_register(&bus->drivers);
711 if (retval) 519 if (retval)
712 goto bus_drivers_fail; 520 goto bus_drivers_fail;
521
522 klist_init(&bus->klist_devices);
523 klist_init(&bus->klist_drivers);
713 bus_add_attrs(bus); 524 bus_add_attrs(bus);
714 525
715 pr_debug("bus type '%s' registered\n", bus->name); 526 pr_debug("bus type '%s' registered\n", bus->name);
@@ -749,12 +560,6 @@ int __init buses_init(void)
749EXPORT_SYMBOL_GPL(bus_for_each_dev); 560EXPORT_SYMBOL_GPL(bus_for_each_dev);
750EXPORT_SYMBOL_GPL(bus_for_each_drv); 561EXPORT_SYMBOL_GPL(bus_for_each_drv);
751 562
752EXPORT_SYMBOL_GPL(driver_probe_device);
753EXPORT_SYMBOL_GPL(device_bind_driver);
754EXPORT_SYMBOL_GPL(device_release_driver);
755EXPORT_SYMBOL_GPL(device_attach);
756EXPORT_SYMBOL_GPL(driver_attach);
757
758EXPORT_SYMBOL_GPL(bus_add_device); 563EXPORT_SYMBOL_GPL(bus_add_device);
759EXPORT_SYMBOL_GPL(bus_remove_device); 564EXPORT_SYMBOL_GPL(bus_remove_device);
760EXPORT_SYMBOL_GPL(bus_register); 565EXPORT_SYMBOL_GPL(bus_register);
diff --git a/drivers/base/class.c b/drivers/base/class.c
index d2a2f8f2b4ed..479c12570881 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -16,6 +16,7 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/string.h> 17#include <linux/string.h>
18#include <linux/kdev_t.h> 18#include <linux/kdev_t.h>
19#include <linux/err.h>
19#include "base.h" 20#include "base.h"
20 21
21#define to_class_attr(_attr) container_of(_attr, struct class_attribute, attr) 22#define to_class_attr(_attr) container_of(_attr, struct class_attribute, attr)
@@ -26,7 +27,7 @@ class_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
26{ 27{
27 struct class_attribute * class_attr = to_class_attr(attr); 28 struct class_attribute * class_attr = to_class_attr(attr);
28 struct class * dc = to_class(kobj); 29 struct class * dc = to_class(kobj);
29 ssize_t ret = 0; 30 ssize_t ret = -EIO;
30 31
31 if (class_attr->show) 32 if (class_attr->show)
32 ret = class_attr->show(dc, buf); 33 ret = class_attr->show(dc, buf);
@@ -39,7 +40,7 @@ class_attr_store(struct kobject * kobj, struct attribute * attr,
39{ 40{
40 struct class_attribute * class_attr = to_class_attr(attr); 41 struct class_attribute * class_attr = to_class_attr(attr);
41 struct class * dc = to_class(kobj); 42 struct class * dc = to_class(kobj);
42 ssize_t ret = 0; 43 ssize_t ret = -EIO;
43 44
44 if (class_attr->store) 45 if (class_attr->store)
45 ret = class_attr->store(dc, buf, count); 46 ret = class_attr->store(dc, buf, count);
@@ -162,6 +163,69 @@ void class_unregister(struct class * cls)
162 subsystem_unregister(&cls->subsys); 163 subsystem_unregister(&cls->subsys);
163} 164}
164 165
166static void class_create_release(struct class *cls)
167{
168 kfree(cls);
169}
170
171static void class_device_create_release(struct class_device *class_dev)
172{
173 kfree(class_dev);
174}
175
176/**
177 * class_create - create a struct class structure
178 * @owner: pointer to the module that is to "own" this struct class
179 * @name: pointer to a string for the name of this class.
180 *
181 * This is used to create a struct class pointer that can then be used
182 * in calls to class_device_create().
183 *
184 * Note, the pointer created here is to be destroyed when finished by
185 * making a call to class_destroy().
186 */
187struct class *class_create(struct module *owner, char *name)
188{
189 struct class *cls;
190 int retval;
191
192 cls = kmalloc(sizeof(struct class), GFP_KERNEL);
193 if (!cls) {
194 retval = -ENOMEM;
195 goto error;
196 }
197 memset(cls, 0x00, sizeof(struct class));
198
199 cls->name = name;
200 cls->owner = owner;
201 cls->class_release = class_create_release;
202 cls->release = class_device_create_release;
203
204 retval = class_register(cls);
205 if (retval)
206 goto error;
207
208 return cls;
209
210error:
211 kfree(cls);
212 return ERR_PTR(retval);
213}
214
215/**
216 * class_destroy - destroys a struct class structure
217 * @cs: pointer to the struct class that is to be destroyed
218 *
219 * Note, the pointer to be destroyed must have been created with a call
220 * to class_create().
221 */
222void class_destroy(struct class *cls)
223{
224 if ((cls == NULL) || (IS_ERR(cls)))
225 return;
226
227 class_unregister(cls);
228}
165 229
166/* Class Device Stuff */ 230/* Class Device Stuff */
167 231
@@ -262,7 +326,7 @@ static int class_hotplug_filter(struct kset *kset, struct kobject *kobj)
262 return 0; 326 return 0;
263} 327}
264 328
265static char *class_hotplug_name(struct kset *kset, struct kobject *kobj) 329static const char *class_hotplug_name(struct kset *kset, struct kobject *kobj)
266{ 330{
267 struct class_device *class_dev = to_class_dev(kobj); 331 struct class_device *class_dev = to_class_dev(kobj);
268 332
@@ -375,7 +439,6 @@ static ssize_t show_dev(struct class_device *class_dev, char *buf)
375{ 439{
376 return print_dev_t(buf, class_dev->devt); 440 return print_dev_t(buf, class_dev->devt);
377} 441}
378static CLASS_DEVICE_ATTR(dev, S_IRUGO, show_dev, NULL);
379 442
380void class_device_initialize(struct class_device *class_dev) 443void class_device_initialize(struct class_device *class_dev)
381{ 444{
@@ -412,7 +475,31 @@ int class_device_add(struct class_device *class_dev)
412 if ((error = kobject_add(&class_dev->kobj))) 475 if ((error = kobject_add(&class_dev->kobj)))
413 goto register_done; 476 goto register_done;
414 477
415 /* now take care of our own registration */ 478 /* add the needed attributes to this device */
479 if (MAJOR(class_dev->devt)) {
480 struct class_device_attribute *attr;
481 attr = kmalloc(sizeof(*attr), GFP_KERNEL);
482 if (!attr) {
483 error = -ENOMEM;
484 kobject_del(&class_dev->kobj);
485 goto register_done;
486 }
487 memset(attr, sizeof(*attr), 0x00);
488 attr->attr.name = "dev";
489 attr->attr.mode = S_IRUGO;
490 attr->attr.owner = parent->owner;
491 attr->show = show_dev;
492 attr->store = NULL;
493 class_device_create_file(class_dev, attr);
494 class_dev->devt_attr = attr;
495 }
496
497 class_device_add_attrs(class_dev);
498 if (class_dev->dev)
499 sysfs_create_link(&class_dev->kobj,
500 &class_dev->dev->kobj, "device");
501
502 /* notify any interfaces this device is now here */
416 if (parent) { 503 if (parent) {
417 down(&parent->sem); 504 down(&parent->sem);
418 list_add_tail(&class_dev->node, &parent->children); 505 list_add_tail(&class_dev->node, &parent->children);
@@ -421,16 +508,8 @@ int class_device_add(struct class_device *class_dev)
421 class_intf->add(class_dev); 508 class_intf->add(class_dev);
422 up(&parent->sem); 509 up(&parent->sem);
423 } 510 }
424
425 if (MAJOR(class_dev->devt))
426 class_device_create_file(class_dev, &class_device_attr_dev);
427
428 class_device_add_attrs(class_dev);
429 if (class_dev->dev)
430 sysfs_create_link(&class_dev->kobj,
431 &class_dev->dev->kobj, "device");
432
433 kobject_hotplug(&class_dev->kobj, KOBJ_ADD); 511 kobject_hotplug(&class_dev->kobj, KOBJ_ADD);
512
434 register_done: 513 register_done:
435 if (error && parent) 514 if (error && parent)
436 class_put(parent); 515 class_put(parent);
@@ -444,6 +523,58 @@ int class_device_register(struct class_device *class_dev)
444 return class_device_add(class_dev); 523 return class_device_add(class_dev);
445} 524}
446 525
526/**
527 * class_device_create - creates a class device and registers it with sysfs
528 * @cs: pointer to the struct class that this device should be registered to.
529 * @dev: the dev_t for the char device to be added.
530 * @device: a pointer to a struct device that is assiociated with this class device.
531 * @fmt: string for the class device's name
532 *
533 * This function can be used by char device classes. A struct
534 * class_device will be created in sysfs, registered to the specified
535 * class. A "dev" file will be created, showing the dev_t for the
536 * device. The pointer to the struct class_device will be returned from
537 * the call. Any further sysfs files that might be required can be
538 * created using this pointer.
539 *
540 * Note: the struct class passed to this function must have previously
541 * been created with a call to class_create().
542 */
543struct class_device *class_device_create(struct class *cls, dev_t devt,
544 struct device *device, char *fmt, ...)
545{
546 va_list args;
547 struct class_device *class_dev = NULL;
548 int retval = -ENODEV;
549
550 if (cls == NULL || IS_ERR(cls))
551 goto error;
552
553 class_dev = kmalloc(sizeof(struct class_device), GFP_KERNEL);
554 if (!class_dev) {
555 retval = -ENOMEM;
556 goto error;
557 }
558 memset(class_dev, 0x00, sizeof(struct class_device));
559
560 class_dev->devt = devt;
561 class_dev->dev = device;
562 class_dev->class = cls;
563
564 va_start(args, fmt);
565 vsnprintf(class_dev->class_id, BUS_ID_SIZE, fmt, args);
566 va_end(args);
567 retval = class_device_register(class_dev);
568 if (retval)
569 goto error;
570
571 return class_dev;
572
573error:
574 kfree(class_dev);
575 return ERR_PTR(retval);
576}
577
447void class_device_del(struct class_device *class_dev) 578void class_device_del(struct class_device *class_dev)
448{ 579{
449 struct class * parent = class_dev->class; 580 struct class * parent = class_dev->class;
@@ -460,6 +591,11 @@ void class_device_del(struct class_device *class_dev)
460 591
461 if (class_dev->dev) 592 if (class_dev->dev)
462 sysfs_remove_link(&class_dev->kobj, "device"); 593 sysfs_remove_link(&class_dev->kobj, "device");
594 if (class_dev->devt_attr) {
595 class_device_remove_file(class_dev, class_dev->devt_attr);
596 kfree(class_dev->devt_attr);
597 class_dev->devt_attr = NULL;
598 }
463 class_device_remove_attrs(class_dev); 599 class_device_remove_attrs(class_dev);
464 600
465 kobject_hotplug(&class_dev->kobj, KOBJ_REMOVE); 601 kobject_hotplug(&class_dev->kobj, KOBJ_REMOVE);
@@ -477,6 +613,32 @@ void class_device_unregister(struct class_device *class_dev)
477 class_device_put(class_dev); 613 class_device_put(class_dev);
478} 614}
479 615
616/**
617 * class_device_destroy - removes a class device that was created with class_device_create()
618 * @cls: the pointer to the struct class that this device was registered * with.
619 * @dev: the dev_t of the device that was previously registered.
620 *
621 * This call unregisters and cleans up a class device that was created with a
622 * call to class_device_create()
623 */
624void class_device_destroy(struct class *cls, dev_t devt)
625{
626 struct class_device *class_dev = NULL;
627 struct class_device *class_dev_tmp;
628
629 down(&cls->sem);
630 list_for_each_entry(class_dev_tmp, &cls->children, node) {
631 if (class_dev_tmp->devt == devt) {
632 class_dev = class_dev_tmp;
633 break;
634 }
635 }
636 up(&cls->sem);
637
638 if (class_dev)
639 class_device_unregister(class_dev);
640}
641
480int class_device_rename(struct class_device *class_dev, char *new_name) 642int class_device_rename(struct class_device *class_dev, char *new_name)
481{ 643{
482 int error = 0; 644 int error = 0;
@@ -576,6 +738,8 @@ EXPORT_SYMBOL_GPL(class_register);
576EXPORT_SYMBOL_GPL(class_unregister); 738EXPORT_SYMBOL_GPL(class_unregister);
577EXPORT_SYMBOL_GPL(class_get); 739EXPORT_SYMBOL_GPL(class_get);
578EXPORT_SYMBOL_GPL(class_put); 740EXPORT_SYMBOL_GPL(class_put);
741EXPORT_SYMBOL_GPL(class_create);
742EXPORT_SYMBOL_GPL(class_destroy);
579 743
580EXPORT_SYMBOL_GPL(class_device_register); 744EXPORT_SYMBOL_GPL(class_device_register);
581EXPORT_SYMBOL_GPL(class_device_unregister); 745EXPORT_SYMBOL_GPL(class_device_unregister);
@@ -584,6 +748,8 @@ EXPORT_SYMBOL_GPL(class_device_add);
584EXPORT_SYMBOL_GPL(class_device_del); 748EXPORT_SYMBOL_GPL(class_device_del);
585EXPORT_SYMBOL_GPL(class_device_get); 749EXPORT_SYMBOL_GPL(class_device_get);
586EXPORT_SYMBOL_GPL(class_device_put); 750EXPORT_SYMBOL_GPL(class_device_put);
751EXPORT_SYMBOL_GPL(class_device_create);
752EXPORT_SYMBOL_GPL(class_device_destroy);
587EXPORT_SYMBOL_GPL(class_device_create_file); 753EXPORT_SYMBOL_GPL(class_device_create_file);
588EXPORT_SYMBOL_GPL(class_device_remove_file); 754EXPORT_SYMBOL_GPL(class_device_remove_file);
589EXPORT_SYMBOL_GPL(class_device_create_bin_file); 755EXPORT_SYMBOL_GPL(class_device_create_bin_file);
diff --git a/drivers/base/class_simple.c b/drivers/base/class_simple.c
deleted file mode 100644
index 27699eb20a37..000000000000
--- a/drivers/base/class_simple.c
+++ /dev/null
@@ -1,199 +0,0 @@
1/*
2 * class_simple.c - a "simple" interface for classes for simple char devices.
3 *
4 * Copyright (c) 2003-2004 Greg Kroah-Hartman <greg@kroah.com>
5 * Copyright (c) 2003-2004 IBM Corp.
6 *
7 * This file is released under the GPLv2
8 *
9 */
10
11#include <linux/config.h>
12#include <linux/device.h>
13#include <linux/err.h>
14
15struct class_simple {
16 struct class class;
17};
18#define to_class_simple(d) container_of(d, struct class_simple, class)
19
20struct simple_dev {
21 struct list_head node;
22 struct class_device class_dev;
23};
24#define to_simple_dev(d) container_of(d, struct simple_dev, class_dev)
25
26static LIST_HEAD(simple_dev_list);
27static DEFINE_SPINLOCK(simple_dev_list_lock);
28
29static void release_simple_dev(struct class_device *class_dev)
30{
31 struct simple_dev *s_dev = to_simple_dev(class_dev);
32 kfree(s_dev);
33}
34
35static void class_simple_release(struct class *class)
36{
37 struct class_simple *cs = to_class_simple(class);
38 kfree(cs);
39}
40
41/**
42 * class_simple_create - create a struct class_simple structure
43 * @owner: pointer to the module that is to "own" this struct class_simple
44 * @name: pointer to a string for the name of this class.
45 *
46 * This is used to create a struct class_simple pointer that can then be used
47 * in calls to class_simple_device_add(). This is used when you do not wish to
48 * create a full blown class support for a type of char devices.
49 *
50 * Note, the pointer created here is to be destroyed when finished by making a
51 * call to class_simple_destroy().
52 */
53struct class_simple *class_simple_create(struct module *owner, char *name)
54{
55 struct class_simple *cs;
56 int retval;
57
58 cs = kmalloc(sizeof(*cs), GFP_KERNEL);
59 if (!cs) {
60 retval = -ENOMEM;
61 goto error;
62 }
63 memset(cs, 0x00, sizeof(*cs));
64
65 cs->class.name = name;
66 cs->class.class_release = class_simple_release;
67 cs->class.release = release_simple_dev;
68
69 retval = class_register(&cs->class);
70 if (retval)
71 goto error;
72
73 return cs;
74
75error:
76 kfree(cs);
77 return ERR_PTR(retval);
78}
79EXPORT_SYMBOL(class_simple_create);
80
81/**
82 * class_simple_destroy - destroys a struct class_simple structure
83 * @cs: pointer to the struct class_simple that is to be destroyed
84 *
85 * Note, the pointer to be destroyed must have been created with a call to
86 * class_simple_create().
87 */
88void class_simple_destroy(struct class_simple *cs)
89{
90 if ((cs == NULL) || (IS_ERR(cs)))
91 return;
92
93 class_unregister(&cs->class);
94}
95EXPORT_SYMBOL(class_simple_destroy);
96
97/**
98 * class_simple_device_add - adds a class device to sysfs for a character driver
99 * @cs: pointer to the struct class_simple that this device should be registered to.
100 * @dev: the dev_t for the device to be added.
101 * @device: a pointer to a struct device that is assiociated with this class device.
102 * @fmt: string for the class device's name
103 *
104 * This function can be used by simple char device classes that do not
105 * implement their own class device registration. A struct class_device will
106 * be created in sysfs, registered to the specified class. A "dev" file will
107 * be created, showing the dev_t for the device. The pointer to the struct
108 * class_device will be returned from the call. Any further sysfs files that
109 * might be required can be created using this pointer.
110 * Note: the struct class_simple passed to this function must have previously been
111 * created with a call to class_simple_create().
112 */
113struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev, struct device *device, const char *fmt, ...)
114{
115 va_list args;
116 struct simple_dev *s_dev = NULL;
117 int retval;
118
119 if ((cs == NULL) || (IS_ERR(cs))) {
120 retval = -ENODEV;
121 goto error;
122 }
123
124 s_dev = kmalloc(sizeof(*s_dev), GFP_KERNEL);
125 if (!s_dev) {
126 retval = -ENOMEM;
127 goto error;
128 }
129 memset(s_dev, 0x00, sizeof(*s_dev));
130
131 s_dev->class_dev.devt = dev;
132 s_dev->class_dev.dev = device;
133 s_dev->class_dev.class = &cs->class;
134
135 va_start(args, fmt);
136 vsnprintf(s_dev->class_dev.class_id, BUS_ID_SIZE, fmt, args);
137 va_end(args);
138 retval = class_device_register(&s_dev->class_dev);
139 if (retval)
140 goto error;
141
142 spin_lock(&simple_dev_list_lock);
143 list_add(&s_dev->node, &simple_dev_list);
144 spin_unlock(&simple_dev_list_lock);
145
146 return &s_dev->class_dev;
147
148error:
149 kfree(s_dev);
150 return ERR_PTR(retval);
151}
152EXPORT_SYMBOL(class_simple_device_add);
153
154/**
155 * class_simple_set_hotplug - set the hotplug callback in the embedded struct class
156 * @cs: pointer to the struct class_simple to hold the pointer
157 * @hotplug: function pointer to the hotplug function
158 *
159 * Implement and set a hotplug function to add environment variables specific to this
160 * class on the hotplug event.
161 */
162int class_simple_set_hotplug(struct class_simple *cs,
163 int (*hotplug)(struct class_device *dev, char **envp, int num_envp, char *buffer, int buffer_size))
164{
165 if ((cs == NULL) || (IS_ERR(cs)))
166 return -ENODEV;
167 cs->class.hotplug = hotplug;
168 return 0;
169}
170EXPORT_SYMBOL(class_simple_set_hotplug);
171
172/**
173 * class_simple_device_remove - removes a class device that was created with class_simple_device_add()
174 * @dev: the dev_t of the device that was previously registered.
175 *
176 * This call unregisters and cleans up a class device that was created with a
177 * call to class_device_simple_add()
178 */
179void class_simple_device_remove(dev_t dev)
180{
181 struct simple_dev *s_dev = NULL;
182 int found = 0;
183
184 spin_lock(&simple_dev_list_lock);
185 list_for_each_entry(s_dev, &simple_dev_list, node) {
186 if (s_dev->class_dev.devt == dev) {
187 found = 1;
188 break;
189 }
190 }
191 if (found) {
192 list_del(&s_dev->node);
193 spin_unlock(&simple_dev_list_lock);
194 class_device_unregister(&s_dev->class_dev);
195 } else {
196 spin_unlock(&simple_dev_list_lock);
197 }
198}
199EXPORT_SYMBOL(class_simple_device_remove);
diff --git a/drivers/base/core.c b/drivers/base/core.c
index fbc223486f81..86d79755fbfb 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -36,10 +36,10 @@ dev_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
36{ 36{
37 struct device_attribute * dev_attr = to_dev_attr(attr); 37 struct device_attribute * dev_attr = to_dev_attr(attr);
38 struct device * dev = to_dev(kobj); 38 struct device * dev = to_dev(kobj);
39 ssize_t ret = 0; 39 ssize_t ret = -EIO;
40 40
41 if (dev_attr->show) 41 if (dev_attr->show)
42 ret = dev_attr->show(dev, buf); 42 ret = dev_attr->show(dev, dev_attr, buf);
43 return ret; 43 return ret;
44} 44}
45 45
@@ -49,10 +49,10 @@ dev_attr_store(struct kobject * kobj, struct attribute * attr,
49{ 49{
50 struct device_attribute * dev_attr = to_dev_attr(attr); 50 struct device_attribute * dev_attr = to_dev_attr(attr);
51 struct device * dev = to_dev(kobj); 51 struct device * dev = to_dev(kobj);
52 ssize_t ret = 0; 52 ssize_t ret = -EIO;
53 53
54 if (dev_attr->store) 54 if (dev_attr->store)
55 ret = dev_attr->store(dev, buf, count); 55 ret = dev_attr->store(dev, dev_attr, buf, count);
56 return ret; 56 return ret;
57} 57}
58 58
@@ -102,7 +102,7 @@ static int dev_hotplug_filter(struct kset *kset, struct kobject *kobj)
102 return 0; 102 return 0;
103} 103}
104 104
105static char *dev_hotplug_name(struct kset *kset, struct kobject *kobj) 105static const char *dev_hotplug_name(struct kset *kset, struct kobject *kobj)
106{ 106{
107 struct device *dev = to_dev(kobj); 107 struct device *dev = to_dev(kobj);
108 108
@@ -207,11 +207,9 @@ void device_initialize(struct device *dev)
207{ 207{
208 kobj_set_kset_s(dev, devices_subsys); 208 kobj_set_kset_s(dev, devices_subsys);
209 kobject_init(&dev->kobj); 209 kobject_init(&dev->kobj);
210 INIT_LIST_HEAD(&dev->node); 210 klist_init(&dev->klist_children);
211 INIT_LIST_HEAD(&dev->children);
212 INIT_LIST_HEAD(&dev->driver_list);
213 INIT_LIST_HEAD(&dev->bus_list);
214 INIT_LIST_HEAD(&dev->dma_pools); 211 INIT_LIST_HEAD(&dev->dma_pools);
212 init_MUTEX(&dev->sem);
215} 213}
216 214
217/** 215/**
@@ -250,10 +248,8 @@ int device_add(struct device *dev)
250 goto PMError; 248 goto PMError;
251 if ((error = bus_add_device(dev))) 249 if ((error = bus_add_device(dev)))
252 goto BusError; 250 goto BusError;
253 down_write(&devices_subsys.rwsem);
254 if (parent) 251 if (parent)
255 list_add_tail(&dev->node, &parent->children); 252 klist_add_tail(&parent->klist_children, &dev->knode_parent);
256 up_write(&devices_subsys.rwsem);
257 253
258 /* notify platform of device entry */ 254 /* notify platform of device entry */
259 if (platform_notify) 255 if (platform_notify)
@@ -336,10 +332,8 @@ void device_del(struct device * dev)
336{ 332{
337 struct device * parent = dev->parent; 333 struct device * parent = dev->parent;
338 334
339 down_write(&devices_subsys.rwsem);
340 if (parent) 335 if (parent)
341 list_del_init(&dev->node); 336 klist_remove(&dev->knode_parent);
342 up_write(&devices_subsys.rwsem);
343 337
344 /* Notify the platform of the removal, in case they 338 /* Notify the platform of the removal, in case they
345 * need to do anything... 339 * need to do anything...
@@ -373,6 +367,12 @@ void device_unregister(struct device * dev)
373} 367}
374 368
375 369
370static struct device * next_device(struct klist_iter * i)
371{
372 struct klist_node * n = klist_next(i);
373 return n ? container_of(n, struct device, knode_parent) : NULL;
374}
375
376/** 376/**
377 * device_for_each_child - device child iterator. 377 * device_for_each_child - device child iterator.
378 * @dev: parent struct device. 378 * @dev: parent struct device.
@@ -385,39 +385,20 @@ void device_unregister(struct device * dev)
385 * We check the return of @fn each time. If it returns anything 385 * We check the return of @fn each time. If it returns anything
386 * other than 0, we break out and return that value. 386 * other than 0, we break out and return that value.
387 */ 387 */
388int device_for_each_child(struct device * dev, void * data, 388int device_for_each_child(struct device * parent, void * data,
389 int (*fn)(struct device *, void *)) 389 int (*fn)(struct device *, void *))
390{ 390{
391 struct klist_iter i;
391 struct device * child; 392 struct device * child;
392 int error = 0; 393 int error = 0;
393 394
394 down_read(&devices_subsys.rwsem); 395 klist_iter_init(&parent->klist_children, &i);
395 list_for_each_entry(child, &dev->children, node) { 396 while ((child = next_device(&i)) && !error)
396 if((error = fn(child, data))) 397 error = fn(child, data);
397 break; 398 klist_iter_exit(&i);
398 }
399 up_read(&devices_subsys.rwsem);
400 return error; 399 return error;
401} 400}
402 401
403/**
404 * device_find - locate device on a bus by name.
405 * @name: name of the device.
406 * @bus: bus to scan for the device.
407 *
408 * Call kset_find_obj() to iterate over list of devices on
409 * a bus to find device by name. Return device if found.
410 *
411 * Note that kset_find_obj increments device's reference count.
412 */
413struct device *device_find(const char *name, struct bus_type *bus)
414{
415 struct kobject *k = kset_find_obj(&bus->devices, name);
416 if (k)
417 return to_dev(k);
418 return NULL;
419}
420
421int __init devices_init(void) 402int __init devices_init(void)
422{ 403{
423 return subsystem_register(&devices_subsys); 404 return subsystem_register(&devices_subsys);
@@ -433,7 +414,6 @@ EXPORT_SYMBOL_GPL(device_del);
433EXPORT_SYMBOL_GPL(device_unregister); 414EXPORT_SYMBOL_GPL(device_unregister);
434EXPORT_SYMBOL_GPL(get_device); 415EXPORT_SYMBOL_GPL(get_device);
435EXPORT_SYMBOL_GPL(put_device); 416EXPORT_SYMBOL_GPL(put_device);
436EXPORT_SYMBOL_GPL(device_find);
437 417
438EXPORT_SYMBOL_GPL(device_create_file); 418EXPORT_SYMBOL_GPL(device_create_file);
439EXPORT_SYMBOL_GPL(device_remove_file); 419EXPORT_SYMBOL_GPL(device_remove_file);
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
new file mode 100644
index 000000000000..6db3a789c54f
--- /dev/null
+++ b/drivers/base/dd.c
@@ -0,0 +1,248 @@
1/*
2 * drivers/base/dd.c - The core device/driver interactions.
3 *
4 * This file contains the (sometimes tricky) code that controls the
5 * interactions between devices and drivers, which primarily includes
6 * driver binding and unbinding.
7 *
8 * All of this code used to exist in drivers/base/bus.c, but was
9 * relocated to here in the name of compartmentalization (since it wasn't
10 * strictly code just for the 'struct bus_type'.
11 *
12 * Copyright (c) 2002-5 Patrick Mochel
13 * Copyright (c) 2002-3 Open Source Development Labs
14 *
15 * This file is released under the GPLv2
16 */
17
18#include <linux/device.h>
19#include <linux/module.h>
20
21#include "base.h"
22#include "power/power.h"
23
24#define to_drv(node) container_of(node, struct device_driver, kobj.entry)
25
26
27/**
28 * device_bind_driver - bind a driver to one device.
29 * @dev: device.
30 *
31 * Allow manual attachment of a driver to a device.
32 * Caller must have already set @dev->driver.
33 *
34 * Note that this does not modify the bus reference count
35 * nor take the bus's rwsem. Please verify those are accounted
36 * for before calling this. (It is ok to call with no other effort
37 * from a driver's probe() method.)
38 *
39 * This function must be called with @dev->sem held.
40 */
41void device_bind_driver(struct device * dev)
42{
43 pr_debug("bound device '%s' to driver '%s'\n",
44 dev->bus_id, dev->driver->name);
45 klist_add_tail(&dev->driver->klist_devices, &dev->knode_driver);
46 sysfs_create_link(&dev->driver->kobj, &dev->kobj,
47 kobject_name(&dev->kobj));
48 sysfs_create_link(&dev->kobj, &dev->driver->kobj, "driver");
49}
50
51/**
52 * driver_probe_device - attempt to bind device & driver.
53 * @drv: driver.
54 * @dev: device.
55 *
56 * First, we call the bus's match function, if one present, which
57 * should compare the device IDs the driver supports with the
58 * device IDs of the device. Note we don't do this ourselves
59 * because we don't know the format of the ID structures, nor what
60 * is to be considered a match and what is not.
61 *
62 *
63 * This function returns 1 if a match is found, an error if one
64 * occurs (that is not -ENODEV or -ENXIO), and 0 otherwise.
65 *
66 * This function must be called with @dev->sem held.
67 */
68static int driver_probe_device(struct device_driver * drv, struct device * dev)
69{
70 int ret = 0;
71
72 if (drv->bus->match && !drv->bus->match(dev, drv))
73 goto Done;
74
75 pr_debug("%s: Matched Device %s with Driver %s\n",
76 drv->bus->name, dev->bus_id, drv->name);
77 dev->driver = drv;
78 if (drv->probe) {
79 ret = drv->probe(dev);
80 if (ret) {
81 dev->driver = NULL;
82 goto ProbeFailed;
83 }
84 }
85 device_bind_driver(dev);
86 ret = 1;
87 pr_debug("%s: Bound Device %s to Driver %s\n",
88 drv->bus->name, dev->bus_id, drv->name);
89 goto Done;
90
91 ProbeFailed:
92 if (ret == -ENODEV || ret == -ENXIO) {
93 /* Driver matched, but didn't support device
94 * or device not found.
95 * Not an error; keep going.
96 */
97 ret = 0;
98 } else {
99 /* driver matched but the probe failed */
100 printk(KERN_WARNING
101 "%s: probe of %s failed with error %d\n",
102 drv->name, dev->bus_id, ret);
103 }
104 Done:
105 return ret;
106}
107
108static int __device_attach(struct device_driver * drv, void * data)
109{
110 struct device * dev = data;
111 return driver_probe_device(drv, dev);
112}
113
114/**
115 * device_attach - try to attach device to a driver.
116 * @dev: device.
117 *
118 * Walk the list of drivers that the bus has and call
119 * driver_probe_device() for each pair. If a compatible
120 * pair is found, break out and return.
121 *
122 * Returns 1 if the device was bound to a driver;
123 * 0 if no matching device was found; error code otherwise.
124 */
125int device_attach(struct device * dev)
126{
127 int ret = 0;
128
129 down(&dev->sem);
130 if (dev->driver) {
131 device_bind_driver(dev);
132 ret = 1;
133 } else
134 ret = bus_for_each_drv(dev->bus, NULL, dev, __device_attach);
135 up(&dev->sem);
136 return ret;
137}
138
139static int __driver_attach(struct device * dev, void * data)
140{
141 struct device_driver * drv = data;
142
143 /*
144 * Lock device and try to bind to it. We drop the error
145 * here and always return 0, because we need to keep trying
146 * to bind to devices and some drivers will return an error
147 * simply if it didn't support the device.
148 *
149 * driver_probe_device() will spit a warning if there
150 * is an error.
151 */
152
153 down(&dev->sem);
154 if (!dev->driver)
155 driver_probe_device(drv, dev);
156 up(&dev->sem);
157
158
159 return 0;
160}
161
162/**
163 * driver_attach - try to bind driver to devices.
164 * @drv: driver.
165 *
166 * Walk the list of devices that the bus has on it and try to
167 * match the driver with each one. If driver_probe_device()
168 * returns 0 and the @dev->driver is set, we've found a
169 * compatible pair.
170 */
171void driver_attach(struct device_driver * drv)
172{
173 bus_for_each_dev(drv->bus, NULL, drv, __driver_attach);
174}
175
176/**
177 * device_release_driver - manually detach device from driver.
178 * @dev: device.
179 *
180 * Manually detach device from driver.
181 *
182 * __device_release_driver() must be called with @dev->sem held.
183 */
184
185static void __device_release_driver(struct device * dev)
186{
187 struct device_driver * drv;
188
189 drv = dev->driver;
190 if (drv) {
191 get_driver(drv);
192 sysfs_remove_link(&drv->kobj, kobject_name(&dev->kobj));
193 sysfs_remove_link(&dev->kobj, "driver");
194 klist_remove(&dev->knode_driver);
195
196 if (drv->remove)
197 drv->remove(dev);
198 dev->driver = NULL;
199 put_driver(drv);
200 }
201}
202
203void device_release_driver(struct device * dev)
204{
205 /*
206 * If anyone calls device_release_driver() recursively from
207 * within their ->remove callback for the same device, they
208 * will deadlock right here.
209 */
210 down(&dev->sem);
211 __device_release_driver(dev);
212 up(&dev->sem);
213}
214
215
216/**
217 * driver_detach - detach driver from all devices it controls.
218 * @drv: driver.
219 */
220void driver_detach(struct device_driver * drv)
221{
222 struct device * dev;
223
224 for (;;) {
225 spin_lock_irq(&drv->klist_devices.k_lock);
226 if (list_empty(&drv->klist_devices.k_list)) {
227 spin_unlock_irq(&drv->klist_devices.k_lock);
228 break;
229 }
230 dev = list_entry(drv->klist_devices.k_list.prev,
231 struct device, knode_driver.n_node);
232 get_device(dev);
233 spin_unlock_irq(&drv->klist_devices.k_lock);
234
235 down(&dev->sem);
236 if (dev->driver == drv)
237 __device_release_driver(dev);
238 up(&dev->sem);
239 put_device(dev);
240 }
241}
242
243
244EXPORT_SYMBOL_GPL(device_bind_driver);
245EXPORT_SYMBOL_GPL(device_release_driver);
246EXPORT_SYMBOL_GPL(device_attach);
247EXPORT_SYMBOL_GPL(driver_attach);
248
diff --git a/drivers/base/dmapool.c b/drivers/base/dmapool.c
index f48833df61a2..c4aebf2f522d 100644
--- a/drivers/base/dmapool.c
+++ b/drivers/base/dmapool.c
@@ -41,7 +41,7 @@ struct dma_page { /* cacheable header for 'allocation' bytes */
41static DECLARE_MUTEX (pools_lock); 41static DECLARE_MUTEX (pools_lock);
42 42
43static ssize_t 43static ssize_t
44show_pools (struct device *dev, char *buf) 44show_pools (struct device *dev, struct device_attribute *attr, char *buf)
45{ 45{
46 unsigned temp; 46 unsigned temp;
47 unsigned size; 47 unsigned size;
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 3b269f7e5213..1b645886e9eb 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -18,6 +18,43 @@
18#define to_dev(node) container_of(node, struct device, driver_list) 18#define to_dev(node) container_of(node, struct device, driver_list)
19#define to_drv(obj) container_of(obj, struct device_driver, kobj) 19#define to_drv(obj) container_of(obj, struct device_driver, kobj)
20 20
21
22static struct device * next_device(struct klist_iter * i)
23{
24 struct klist_node * n = klist_next(i);
25 return n ? container_of(n, struct device, knode_driver) : NULL;
26}
27
28/**
29 * driver_for_each_device - Iterator for devices bound to a driver.
30 * @drv: Driver we're iterating.
31 * @data: Data to pass to the callback.
32 * @fn: Function to call for each device.
33 *
34 * Iterate over the @drv's list of devices calling @fn for each one.
35 */
36
37int driver_for_each_device(struct device_driver * drv, struct device * start,
38 void * data, int (*fn)(struct device *, void *))
39{
40 struct klist_iter i;
41 struct device * dev;
42 int error = 0;
43
44 if (!drv)
45 return -EINVAL;
46
47 klist_iter_init_node(&drv->klist_devices, &i,
48 start ? &start->knode_driver : NULL);
49 while ((dev = next_device(&i)) && !error)
50 error = fn(dev, data);
51 klist_iter_exit(&i);
52 return error;
53}
54
55EXPORT_SYMBOL_GPL(driver_for_each_device);
56
57
21/** 58/**
22 * driver_create_file - create sysfs file for driver. 59 * driver_create_file - create sysfs file for driver.
23 * @drv: driver. 60 * @drv: driver.
@@ -85,7 +122,7 @@ void put_driver(struct device_driver * drv)
85 */ 122 */
86int driver_register(struct device_driver * drv) 123int driver_register(struct device_driver * drv)
87{ 124{
88 INIT_LIST_HEAD(&drv->devices); 125 klist_init(&drv->klist_devices);
89 init_completion(&drv->unloaded); 126 init_completion(&drv->unloaded);
90 return bus_add_driver(drv); 127 return bus_add_driver(drv);
91} 128}
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 583d57ec49a8..904b27caf697 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -87,7 +87,7 @@ static ssize_t node_read_numastat(struct sys_device * dev, char * buf)
87 for (i = 0; i < MAX_NR_ZONES; i++) { 87 for (i = 0; i < MAX_NR_ZONES; i++) {
88 struct zone *z = &pg->node_zones[i]; 88 struct zone *z = &pg->node_zones[i];
89 for (cpu = 0; cpu < NR_CPUS; cpu++) { 89 for (cpu = 0; cpu < NR_CPUS; cpu++) {
90 struct per_cpu_pageset *ps = &z->pageset[cpu]; 90 struct per_cpu_pageset *ps = zone_pcp(z,cpu);
91 numa_hit += ps->numa_hit; 91 numa_hit += ps->numa_hit;
92 numa_miss += ps->numa_miss; 92 numa_miss += ps->numa_miss;
93 numa_foreign += ps->numa_foreign; 93 numa_foreign += ps->numa_foreign;
@@ -136,7 +136,7 @@ static SYSDEV_ATTR(distance, S_IRUGO, node_read_distance, NULL);
136 * 136 *
137 * Initialize and register the node device. 137 * Initialize and register the node device.
138 */ 138 */
139int __init register_node(struct node *node, int num, struct node *parent) 139int register_node(struct node *node, int num, struct node *parent)
140{ 140{
141 int error; 141 int error;
142 142
@@ -153,8 +153,24 @@ int __init register_node(struct node *node, int num, struct node *parent)
153 return error; 153 return error;
154} 154}
155 155
156/**
157 * unregister_node - unregister a node device
158 * @node: node going away
159 *
160 * Unregisters a node device @node. All the devices on the node must be
161 * unregistered before calling this function.
162 */
163void unregister_node(struct node *node)
164{
165 sysdev_remove_file(&node->sysdev, &attr_cpumap);
166 sysdev_remove_file(&node->sysdev, &attr_meminfo);
167 sysdev_remove_file(&node->sysdev, &attr_numastat);
168 sysdev_remove_file(&node->sysdev, &attr_distance);
169
170 sysdev_unregister(&node->sysdev);
171}
156 172
157int __init register_node_type(void) 173static int __init register_node_type(void)
158{ 174{
159 return sysdev_class_register(&node_class); 175 return sysdev_class_register(&node_class);
160} 176}
diff --git a/drivers/base/power/resume.c b/drivers/base/power/resume.c
index 26468971ef5a..bdd96b03b885 100644
--- a/drivers/base/power/resume.c
+++ b/drivers/base/power/resume.c
@@ -22,6 +22,9 @@ extern int sysdev_resume(void);
22 22
23int resume_device(struct device * dev) 23int resume_device(struct device * dev)
24{ 24{
25 int error = 0;
26
27 down(&dev->sem);
25 if (dev->power.pm_parent 28 if (dev->power.pm_parent
26 && dev->power.pm_parent->power.power_state) { 29 && dev->power.pm_parent->power.power_state) {
27 dev_err(dev, "PM: resume from %d, parent %s still %d\n", 30 dev_err(dev, "PM: resume from %d, parent %s still %d\n",
@@ -31,9 +34,10 @@ int resume_device(struct device * dev)
31 } 34 }
32 if (dev->bus && dev->bus->resume) { 35 if (dev->bus && dev->bus->resume) {
33 dev_dbg(dev,"resuming\n"); 36 dev_dbg(dev,"resuming\n");
34 return dev->bus->resume(dev); 37 error = dev->bus->resume(dev);
35 } 38 }
36 return 0; 39 up(&dev->sem);
40 return error;
37} 41}
38 42
39 43
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c
index 0ec44ef840be..2ccee3763acf 100644
--- a/drivers/base/power/suspend.c
+++ b/drivers/base/power/suspend.c
@@ -39,6 +39,7 @@ int suspend_device(struct device * dev, pm_message_t state)
39{ 39{
40 int error = 0; 40 int error = 0;
41 41
42 down(&dev->sem);
42 if (dev->power.power_state) { 43 if (dev->power.power_state) {
43 dev_dbg(dev, "PM: suspend %d-->%d\n", 44 dev_dbg(dev, "PM: suspend %d-->%d\n",
44 dev->power.power_state, state); 45 dev->power.power_state, state);
@@ -58,7 +59,7 @@ int suspend_device(struct device * dev, pm_message_t state)
58 dev_dbg(dev, "suspending\n"); 59 dev_dbg(dev, "suspending\n");
59 error = dev->bus->suspend(dev, state); 60 error = dev->bus->suspend(dev, state);
60 } 61 }
61 62 up(&dev->sem);
62 return error; 63 return error;
63} 64}
64 65
@@ -113,8 +114,19 @@ int device_suspend(pm_message_t state)
113 put_device(dev); 114 put_device(dev);
114 } 115 }
115 up(&dpm_list_sem); 116 up(&dpm_list_sem);
116 if (error) 117 if (error) {
118 /* we failed... before resuming, bring back devices from
119 * dpm_off_irq list back to main dpm_off list, we do want
120 * to call resume() on them, in case they partially suspended
121 * despite returning -EAGAIN
122 */
123 while (!list_empty(&dpm_off_irq)) {
124 struct list_head * entry = dpm_off_irq.next;
125 list_del(entry);
126 list_add(entry, &dpm_off);
127 }
117 dpm_resume(); 128 dpm_resume();
129 }
118 up(&dpm_sem); 130 up(&dpm_sem);
119 return error; 131 return error;
120} 132}
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
index 6ac96349a8e8..f82b3df9545f 100644
--- a/drivers/base/power/sysfs.c
+++ b/drivers/base/power/sysfs.c
@@ -24,12 +24,12 @@
24 * low-power state. 24 * low-power state.
25 */ 25 */
26 26
27static ssize_t state_show(struct device * dev, char * buf) 27static ssize_t state_show(struct device * dev, struct device_attribute *attr, char * buf)
28{ 28{
29 return sprintf(buf, "%u\n", dev->power.power_state); 29 return sprintf(buf, "%u\n", dev->power.power_state);
30} 30}
31 31
32static ssize_t state_store(struct device * dev, const char * buf, size_t n) 32static ssize_t state_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t n)
33{ 33{
34 u32 state; 34 u32 state;
35 char * rest; 35 char * rest;
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 9102e3756f95..f37a13de804a 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -37,7 +37,7 @@ sysdev_show(struct kobject * kobj, struct attribute * attr, char * buffer)
37 37
38 if (sysdev_attr->show) 38 if (sysdev_attr->show)
39 return sysdev_attr->show(sysdev, buffer); 39 return sysdev_attr->show(sysdev, buffer);
40 return 0; 40 return -EIO;
41} 41}
42 42
43 43
@@ -50,7 +50,7 @@ sysdev_store(struct kobject * kobj, struct attribute * attr,
50 50
51 if (sysdev_attr->store) 51 if (sysdev_attr->store)
52 return sysdev_attr->store(sysdev, buffer, count); 52 return sysdev_attr->store(sysdev, buffer, count);
53 return 0; 53 return -EIO;
54} 54}
55 55
56static struct sysfs_ops sysfs_ops = { 56static struct sysfs_ops sysfs_ops = {
diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c
index 14aeca3e2e8c..45a243096187 100644
--- a/drivers/block/aoe/aoechr.c
+++ b/drivers/block/aoe/aoechr.c
@@ -36,7 +36,7 @@ static int emsgs_head_idx, emsgs_tail_idx;
36static struct semaphore emsgs_sema; 36static struct semaphore emsgs_sema;
37static spinlock_t emsgs_lock; 37static spinlock_t emsgs_lock;
38static int nblocked_emsgs_readers; 38static int nblocked_emsgs_readers;
39static struct class_simple *aoe_class; 39static struct class *aoe_class;
40static struct aoe_chardev chardevs[] = { 40static struct aoe_chardev chardevs[] = {
41 { MINOR_ERR, "err" }, 41 { MINOR_ERR, "err" },
42 { MINOR_DISCOVER, "discover" }, 42 { MINOR_DISCOVER, "discover" },
@@ -218,13 +218,13 @@ aoechr_init(void)
218 } 218 }
219 sema_init(&emsgs_sema, 0); 219 sema_init(&emsgs_sema, 0);
220 spin_lock_init(&emsgs_lock); 220 spin_lock_init(&emsgs_lock);
221 aoe_class = class_simple_create(THIS_MODULE, "aoe"); 221 aoe_class = class_create(THIS_MODULE, "aoe");
222 if (IS_ERR(aoe_class)) { 222 if (IS_ERR(aoe_class)) {
223 unregister_chrdev(AOE_MAJOR, "aoechr"); 223 unregister_chrdev(AOE_MAJOR, "aoechr");
224 return PTR_ERR(aoe_class); 224 return PTR_ERR(aoe_class);
225 } 225 }
226 for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 226 for (i = 0; i < ARRAY_SIZE(chardevs); ++i)
227 class_simple_device_add(aoe_class, 227 class_device_create(aoe_class,
228 MKDEV(AOE_MAJOR, chardevs[i].minor), 228 MKDEV(AOE_MAJOR, chardevs[i].minor),
229 NULL, chardevs[i].name); 229 NULL, chardevs[i].name);
230 230
@@ -237,8 +237,8 @@ aoechr_exit(void)
237 int i; 237 int i;
238 238
239 for (i = 0; i < ARRAY_SIZE(chardevs); ++i) 239 for (i = 0; i < ARRAY_SIZE(chardevs); ++i)
240 class_simple_device_remove(MKDEV(AOE_MAJOR, chardevs[i].minor)); 240 class_device_destroy(aoe_class, MKDEV(AOE_MAJOR, chardevs[i].minor));
241 class_simple_destroy(aoe_class); 241 class_destroy(aoe_class);
242 unregister_chrdev(AOE_MAJOR, "aoechr"); 242 unregister_chrdev(AOE_MAJOR, "aoechr");
243} 243}
244 244
diff --git a/drivers/block/as-iosched.c b/drivers/block/as-iosched.c
index a9575bb58a5e..638db06de2be 100644
--- a/drivers/block/as-iosched.c
+++ b/drivers/block/as-iosched.c
@@ -2044,7 +2044,7 @@ as_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
2044 struct as_fs_entry *entry = to_as(attr); 2044 struct as_fs_entry *entry = to_as(attr);
2045 2045
2046 if (!entry->show) 2046 if (!entry->show)
2047 return 0; 2047 return -EIO;
2048 2048
2049 return entry->show(e->elevator_data, page); 2049 return entry->show(e->elevator_data, page);
2050} 2050}
@@ -2057,7 +2057,7 @@ as_attr_store(struct kobject *kobj, struct attribute *attr,
2057 struct as_fs_entry *entry = to_as(attr); 2057 struct as_fs_entry *entry = to_as(attr);
2058 2058
2059 if (!entry->store) 2059 if (!entry->store)
2060 return -EINVAL; 2060 return -EIO;
2061 2061
2062 return entry->store(e->elevator_data, page, length); 2062 return entry->store(e->elevator_data, page, length);
2063} 2063}
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 8f7c1a1ed7f4..abde27027c06 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -41,6 +41,7 @@
41#include <asm/uaccess.h> 41#include <asm/uaccess.h>
42#include <asm/io.h> 42#include <asm/io.h>
43 43
44#include <linux/dma-mapping.h>
44#include <linux/blkdev.h> 45#include <linux/blkdev.h>
45#include <linux/genhd.h> 46#include <linux/genhd.h>
46#include <linux/completion.h> 47#include <linux/completion.h>
@@ -126,8 +127,6 @@ static struct board_type products[] = {
126#define MAX_CTLR_ORIG 8 127#define MAX_CTLR_ORIG 8
127 128
128 129
129#define CCISS_DMA_MASK 0xFFFFFFFF /* 32 bit DMA */
130
131static ctlr_info_t *hba[MAX_CTLR]; 130static ctlr_info_t *hba[MAX_CTLR];
132 131
133static void do_cciss_request(request_queue_t *q); 132static void do_cciss_request(request_queue_t *q);
@@ -2393,11 +2392,6 @@ static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
2393 printk(KERN_ERR "cciss: Unable to Enable PCI device\n"); 2392 printk(KERN_ERR "cciss: Unable to Enable PCI device\n");
2394 return( -1); 2393 return( -1);
2395 } 2394 }
2396 if (pci_set_dma_mask(pdev, CCISS_DMA_MASK ) != 0)
2397 {
2398 printk(KERN_ERR "cciss: Unable to set DMA mask\n");
2399 return(-1);
2400 }
2401 2395
2402 subsystem_vendor_id = pdev->subsystem_vendor; 2396 subsystem_vendor_id = pdev->subsystem_vendor;
2403 subsystem_device_id = pdev->subsystem_device; 2397 subsystem_device_id = pdev->subsystem_device;
@@ -2747,9 +2741,9 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
2747 hba[i]->pdev = pdev; 2741 hba[i]->pdev = pdev;
2748 2742
2749 /* configure PCI DMA stuff */ 2743 /* configure PCI DMA stuff */
2750 if (!pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) 2744 if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK))
2751 printk("cciss: using DAC cycles\n"); 2745 printk("cciss: using DAC cycles\n");
2752 else if (!pci_set_dma_mask(pdev, 0xffffffff)) 2746 else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK))
2753 printk("cciss: not using DAC cycles\n"); 2747 printk("cciss: not using DAC cycles\n");
2754 else { 2748 else {
2755 printk("cciss: no suitable DMA available\n"); 2749 printk("cciss: no suitable DMA available\n");
diff --git a/drivers/block/cfq-iosched.c b/drivers/block/cfq-iosched.c
index 0ef7a0065ece..3ac47dde64da 100644
--- a/drivers/block/cfq-iosched.c
+++ b/drivers/block/cfq-iosched.c
@@ -1202,13 +1202,16 @@ retry:
1202 if (new_cfqq) { 1202 if (new_cfqq) {
1203 cfqq = new_cfqq; 1203 cfqq = new_cfqq;
1204 new_cfqq = NULL; 1204 new_cfqq = NULL;
1205 } else if (gfp_mask & __GFP_WAIT) { 1205 } else {
1206 spin_unlock_irq(cfqd->queue->queue_lock); 1206 spin_unlock_irq(cfqd->queue->queue_lock);
1207 new_cfqq = kmem_cache_alloc(cfq_pool, gfp_mask); 1207 new_cfqq = kmem_cache_alloc(cfq_pool, gfp_mask);
1208 spin_lock_irq(cfqd->queue->queue_lock); 1208 spin_lock_irq(cfqd->queue->queue_lock);
1209
1210 if (!new_cfqq && !(gfp_mask & __GFP_WAIT))
1211 goto out;
1212
1209 goto retry; 1213 goto retry;
1210 } else 1214 }
1211 goto out;
1212 1215
1213 memset(cfqq, 0, sizeof(*cfqq)); 1216 memset(cfqq, 0, sizeof(*cfqq));
1214 1217
@@ -1772,7 +1775,7 @@ cfq_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
1772 struct cfq_fs_entry *entry = to_cfq(attr); 1775 struct cfq_fs_entry *entry = to_cfq(attr);
1773 1776
1774 if (!entry->show) 1777 if (!entry->show)
1775 return 0; 1778 return -EIO;
1776 1779
1777 return entry->show(e->elevator_data, page); 1780 return entry->show(e->elevator_data, page);
1778} 1781}
@@ -1785,7 +1788,7 @@ cfq_attr_store(struct kobject *kobj, struct attribute *attr,
1785 struct cfq_fs_entry *entry = to_cfq(attr); 1788 struct cfq_fs_entry *entry = to_cfq(attr);
1786 1789
1787 if (!entry->store) 1790 if (!entry->store)
1788 return -EINVAL; 1791 return -EIO;
1789 1792
1790 return entry->store(e->elevator_data, page, length); 1793 return entry->store(e->elevator_data, page, length);
1791} 1794}
diff --git a/drivers/block/deadline-iosched.c b/drivers/block/deadline-iosched.c
index d63d34c671f7..7f79f3dd0165 100644
--- a/drivers/block/deadline-iosched.c
+++ b/drivers/block/deadline-iosched.c
@@ -886,7 +886,7 @@ deadline_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
886 struct deadline_fs_entry *entry = to_deadline(attr); 886 struct deadline_fs_entry *entry = to_deadline(attr);
887 887
888 if (!entry->show) 888 if (!entry->show)
889 return 0; 889 return -EIO;
890 890
891 return entry->show(e->elevator_data, page); 891 return entry->show(e->elevator_data, page);
892} 892}
@@ -899,7 +899,7 @@ deadline_attr_store(struct kobject *kobj, struct attribute *attr,
899 struct deadline_fs_entry *entry = to_deadline(attr); 899 struct deadline_fs_entry *entry = to_deadline(attr);
900 900
901 if (!entry->store) 901 if (!entry->store)
902 return -EINVAL; 902 return -EIO;
903 903
904 return entry->store(e->elevator_data, page, length); 904 return entry->store(e->elevator_data, page, length);
905} 905}
diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c
index 6b79b4314622..f831f08f839c 100644
--- a/drivers/block/elevator.c
+++ b/drivers/block/elevator.c
@@ -220,11 +220,6 @@ void elevator_exit(elevator_t *e)
220 kfree(e); 220 kfree(e);
221} 221}
222 222
223static int elevator_global_init(void)
224{
225 return 0;
226}
227
228int elv_merge(request_queue_t *q, struct request **req, struct bio *bio) 223int elv_merge(request_queue_t *q, struct request **req, struct bio *bio)
229{ 224{
230 elevator_t *e = q->elevator; 225 elevator_t *e = q->elevator;
@@ -291,6 +286,13 @@ void elv_requeue_request(request_queue_t *q, struct request *rq)
291 } 286 }
292 287
293 /* 288 /*
289 * the request is prepped and may have some resources allocated.
290 * allowing unprepped requests to pass this one may cause resource
291 * deadlock. turn on softbarrier.
292 */
293 rq->flags |= REQ_SOFTBARRIER;
294
295 /*
294 * if iosched has an explicit requeue hook, then use that. otherwise 296 * if iosched has an explicit requeue hook, then use that. otherwise
295 * just put the request at the front of the queue 297 * just put the request at the front of the queue
296 */ 298 */
@@ -322,7 +324,7 @@ void __elv_add_request(request_queue_t *q, struct request *rq, int where,
322 int nrq = q->rq.count[READ] + q->rq.count[WRITE] 324 int nrq = q->rq.count[READ] + q->rq.count[WRITE]
323 - q->in_flight; 325 - q->in_flight;
324 326
325 if (nrq == q->unplug_thresh) 327 if (nrq >= q->unplug_thresh)
326 __generic_unplug_device(q); 328 __generic_unplug_device(q);
327 } 329 }
328 } else 330 } else
@@ -386,6 +388,12 @@ struct request *elv_next_request(request_queue_t *q)
386 if (ret == BLKPREP_OK) { 388 if (ret == BLKPREP_OK) {
387 break; 389 break;
388 } else if (ret == BLKPREP_DEFER) { 390 } else if (ret == BLKPREP_DEFER) {
391 /*
392 * the request may have been (partially) prepped.
393 * we need to keep this request in the front to
394 * avoid resource deadlock. turn on softbarrier.
395 */
396 rq->flags |= REQ_SOFTBARRIER;
389 rq = NULL; 397 rq = NULL;
390 break; 398 break;
391 } else if (ret == BLKPREP_KILL) { 399 } else if (ret == BLKPREP_KILL) {
@@ -692,8 +700,6 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
692 return len; 700 return len;
693} 701}
694 702
695module_init(elevator_global_init);
696
697EXPORT_SYMBOL(elv_add_request); 703EXPORT_SYMBOL(elv_add_request);
698EXPORT_SYMBOL(__elv_add_request); 704EXPORT_SYMBOL(__elv_add_request);
699EXPORT_SYMBOL(elv_requeue_request); 705EXPORT_SYMBOL(elv_requeue_request);
diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c
index 8bbe01d4b487..53f7d846b747 100644
--- a/drivers/block/genhd.c
+++ b/drivers/block/genhd.c
@@ -322,7 +322,7 @@ static ssize_t disk_attr_show(struct kobject *kobj, struct attribute *attr,
322 struct gendisk *disk = to_disk(kobj); 322 struct gendisk *disk = to_disk(kobj);
323 struct disk_attribute *disk_attr = 323 struct disk_attribute *disk_attr =
324 container_of(attr,struct disk_attribute,attr); 324 container_of(attr,struct disk_attribute,attr);
325 ssize_t ret = 0; 325 ssize_t ret = -EIO;
326 326
327 if (disk_attr->show) 327 if (disk_attr->show)
328 ret = disk_attr->show(disk,page); 328 ret = disk_attr->show(disk,page);
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
index 11ef9d9ea139..81fe3a0c1fe7 100644
--- a/drivers/block/ll_rw_blk.c
+++ b/drivers/block/ll_rw_blk.c
@@ -2038,7 +2038,6 @@ EXPORT_SYMBOL(blk_requeue_request);
2038 * @rq: request to be inserted 2038 * @rq: request to be inserted
2039 * @at_head: insert request at head or tail of queue 2039 * @at_head: insert request at head or tail of queue
2040 * @data: private data 2040 * @data: private data
2041 * @reinsert: true if request it a reinsertion of previously processed one
2042 * 2041 *
2043 * Description: 2042 * Description:
2044 * Many block devices need to execute commands asynchronously, so they don't 2043 * Many block devices need to execute commands asynchronously, so they don't
@@ -2053,8 +2052,9 @@ EXPORT_SYMBOL(blk_requeue_request);
2053 * host that is unable to accept a particular command. 2052 * host that is unable to accept a particular command.
2054 */ 2053 */
2055void blk_insert_request(request_queue_t *q, struct request *rq, 2054void blk_insert_request(request_queue_t *q, struct request *rq,
2056 int at_head, void *data, int reinsert) 2055 int at_head, void *data)
2057{ 2056{
2057 int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK;
2058 unsigned long flags; 2058 unsigned long flags;
2059 2059
2060 /* 2060 /*
@@ -2071,20 +2071,12 @@ void blk_insert_request(request_queue_t *q, struct request *rq,
2071 /* 2071 /*
2072 * If command is tagged, release the tag 2072 * If command is tagged, release the tag
2073 */ 2073 */
2074 if (reinsert) 2074 if (blk_rq_tagged(rq))
2075 blk_requeue_request(q, rq); 2075 blk_queue_end_tag(q, rq);
2076 else {
2077 int where = ELEVATOR_INSERT_BACK;
2078
2079 if (at_head)
2080 where = ELEVATOR_INSERT_FRONT;
2081 2076
2082 if (blk_rq_tagged(rq)) 2077 drive_stat_acct(rq, rq->nr_sectors, 1);
2083 blk_queue_end_tag(q, rq); 2078 __elv_add_request(q, rq, where, 0);
2084 2079
2085 drive_stat_acct(rq, rq->nr_sectors, 1);
2086 __elv_add_request(q, rq, where, 0);
2087 }
2088 if (blk_queue_plugged(q)) 2080 if (blk_queue_plugged(q))
2089 __generic_unplug_device(q); 2081 __generic_unplug_device(q);
2090 else 2082 else
@@ -3582,7 +3574,7 @@ queue_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
3582 3574
3583 q = container_of(kobj, struct request_queue, kobj); 3575 q = container_of(kobj, struct request_queue, kobj);
3584 if (!entry->show) 3576 if (!entry->show)
3585 return 0; 3577 return -EIO;
3586 3578
3587 return entry->show(q, page); 3579 return entry->show(q, page);
3588} 3580}
@@ -3596,7 +3588,7 @@ queue_attr_store(struct kobject *kobj, struct attribute *attr,
3596 3588
3597 q = container_of(kobj, struct request_queue, kobj); 3589 q = container_of(kobj, struct request_queue, kobj);
3598 if (!entry->store) 3590 if (!entry->store)
3599 return -EINVAL; 3591 return -EIO;
3600 3592
3601 return entry->store(q, page, length); 3593 return entry->store(q, page, length);
3602} 3594}
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 202a5a74ad37..fa49d62626ba 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -723,7 +723,7 @@ static int pd_special_command(struct pd_unit *disk,
723 rq.ref_count = 1; 723 rq.ref_count = 1;
724 rq.waiting = &wait; 724 rq.waiting = &wait;
725 rq.end_io = blk_end_sync_rq; 725 rq.end_io = blk_end_sync_rq;
726 blk_insert_request(disk->gd->queue, &rq, 0, func, 0); 726 blk_insert_request(disk->gd->queue, &rq, 0, func);
727 wait_for_completion(&wait); 727 wait_for_completion(&wait);
728 rq.waiting = NULL; 728 rq.waiting = NULL;
729 if (rq.errors) 729 if (rq.errors)
diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c
index dbeb107bb971..84d8e291ed96 100644
--- a/drivers/block/paride/pg.c
+++ b/drivers/block/paride/pg.c
@@ -222,7 +222,7 @@ static int pg_identify(struct pg *dev, int log);
222 222
223static char pg_scratch[512]; /* scratch block buffer */ 223static char pg_scratch[512]; /* scratch block buffer */
224 224
225static struct class_simple *pg_class; 225static struct class *pg_class;
226 226
227/* kernel glue structures */ 227/* kernel glue structures */
228 228
@@ -666,7 +666,7 @@ static int __init pg_init(void)
666 err = -1; 666 err = -1;
667 goto out; 667 goto out;
668 } 668 }
669 pg_class = class_simple_create(THIS_MODULE, "pg"); 669 pg_class = class_create(THIS_MODULE, "pg");
670 if (IS_ERR(pg_class)) { 670 if (IS_ERR(pg_class)) {
671 err = PTR_ERR(pg_class); 671 err = PTR_ERR(pg_class);
672 goto out_chrdev; 672 goto out_chrdev;
@@ -675,7 +675,7 @@ static int __init pg_init(void)
675 for (unit = 0; unit < PG_UNITS; unit++) { 675 for (unit = 0; unit < PG_UNITS; unit++) {
676 struct pg *dev = &devices[unit]; 676 struct pg *dev = &devices[unit];
677 if (dev->present) { 677 if (dev->present) {
678 class_simple_device_add(pg_class, MKDEV(major, unit), 678 class_device_create(pg_class, MKDEV(major, unit),
679 NULL, "pg%u", unit); 679 NULL, "pg%u", unit);
680 err = devfs_mk_cdev(MKDEV(major, unit), 680 err = devfs_mk_cdev(MKDEV(major, unit),
681 S_IFCHR | S_IRUSR | S_IWUSR, "pg/%u", 681 S_IFCHR | S_IRUSR | S_IWUSR, "pg/%u",
@@ -688,8 +688,8 @@ static int __init pg_init(void)
688 goto out; 688 goto out;
689 689
690out_class: 690out_class:
691 class_simple_device_remove(MKDEV(major, unit)); 691 class_device_destroy(pg_class, MKDEV(major, unit));
692 class_simple_destroy(pg_class); 692 class_destroy(pg_class);
693out_chrdev: 693out_chrdev:
694 unregister_chrdev(major, "pg"); 694 unregister_chrdev(major, "pg");
695out: 695out:
@@ -703,11 +703,11 @@ static void __exit pg_exit(void)
703 for (unit = 0; unit < PG_UNITS; unit++) { 703 for (unit = 0; unit < PG_UNITS; unit++) {
704 struct pg *dev = &devices[unit]; 704 struct pg *dev = &devices[unit];
705 if (dev->present) { 705 if (dev->present) {
706 class_simple_device_remove(MKDEV(major, unit)); 706 class_device_destroy(pg_class, MKDEV(major, unit));
707 devfs_remove("pg/%u", unit); 707 devfs_remove("pg/%u", unit);
708 } 708 }
709 } 709 }
710 class_simple_destroy(pg_class); 710 class_destroy(pg_class);
711 devfs_remove("pg"); 711 devfs_remove("pg");
712 unregister_chrdev(major, name); 712 unregister_chrdev(major, name);
713 713
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
index 8fbd6922fe0d..5fe8ee86f095 100644
--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -242,7 +242,7 @@ static struct file_operations pt_fops = {
242}; 242};
243 243
244/* sysfs class support */ 244/* sysfs class support */
245static struct class_simple *pt_class; 245static struct class *pt_class;
246 246
247static inline int status_reg(struct pi_adapter *pi) 247static inline int status_reg(struct pi_adapter *pi)
248{ 248{
@@ -963,7 +963,7 @@ static int __init pt_init(void)
963 err = -1; 963 err = -1;
964 goto out; 964 goto out;
965 } 965 }
966 pt_class = class_simple_create(THIS_MODULE, "pt"); 966 pt_class = class_create(THIS_MODULE, "pt");
967 if (IS_ERR(pt_class)) { 967 if (IS_ERR(pt_class)) {
968 err = PTR_ERR(pt_class); 968 err = PTR_ERR(pt_class);
969 goto out_chrdev; 969 goto out_chrdev;
@@ -972,29 +972,29 @@ static int __init pt_init(void)
972 devfs_mk_dir("pt"); 972 devfs_mk_dir("pt");
973 for (unit = 0; unit < PT_UNITS; unit++) 973 for (unit = 0; unit < PT_UNITS; unit++)
974 if (pt[unit].present) { 974 if (pt[unit].present) {
975 class_simple_device_add(pt_class, MKDEV(major, unit), 975 class_device_create(pt_class, MKDEV(major, unit),
976 NULL, "pt%d", unit); 976 NULL, "pt%d", unit);
977 err = devfs_mk_cdev(MKDEV(major, unit), 977 err = devfs_mk_cdev(MKDEV(major, unit),
978 S_IFCHR | S_IRUSR | S_IWUSR, 978 S_IFCHR | S_IRUSR | S_IWUSR,
979 "pt/%d", unit); 979 "pt/%d", unit);
980 if (err) { 980 if (err) {
981 class_simple_device_remove(MKDEV(major, unit)); 981 class_device_destroy(pt_class, MKDEV(major, unit));
982 goto out_class; 982 goto out_class;
983 } 983 }
984 class_simple_device_add(pt_class, MKDEV(major, unit + 128), 984 class_device_create(pt_class, MKDEV(major, unit + 128),
985 NULL, "pt%dn", unit); 985 NULL, "pt%dn", unit);
986 err = devfs_mk_cdev(MKDEV(major, unit + 128), 986 err = devfs_mk_cdev(MKDEV(major, unit + 128),
987 S_IFCHR | S_IRUSR | S_IWUSR, 987 S_IFCHR | S_IRUSR | S_IWUSR,
988 "pt/%dn", unit); 988 "pt/%dn", unit);
989 if (err) { 989 if (err) {
990 class_simple_device_remove(MKDEV(major, unit + 128)); 990 class_device_destroy(pt_class, MKDEV(major, unit + 128));
991 goto out_class; 991 goto out_class;
992 } 992 }
993 } 993 }
994 goto out; 994 goto out;
995 995
996out_class: 996out_class:
997 class_simple_destroy(pt_class); 997 class_destroy(pt_class);
998out_chrdev: 998out_chrdev:
999 unregister_chrdev(major, "pt"); 999 unregister_chrdev(major, "pt");
1000out: 1000out:
@@ -1006,12 +1006,12 @@ static void __exit pt_exit(void)
1006 int unit; 1006 int unit;
1007 for (unit = 0; unit < PT_UNITS; unit++) 1007 for (unit = 0; unit < PT_UNITS; unit++)
1008 if (pt[unit].present) { 1008 if (pt[unit].present) {
1009 class_simple_device_remove(MKDEV(major, unit)); 1009 class_device_destroy(pt_class, MKDEV(major, unit));
1010 devfs_remove("pt/%d", unit); 1010 devfs_remove("pt/%d", unit);
1011 class_simple_device_remove(MKDEV(major, unit + 128)); 1011 class_device_destroy(pt_class, MKDEV(major, unit + 128));
1012 devfs_remove("pt/%dn", unit); 1012 devfs_remove("pt/%dn", unit);
1013 } 1013 }
1014 class_simple_destroy(pt_class); 1014 class_destroy(pt_class);
1015 devfs_remove("pt"); 1015 devfs_remove("pt");
1016 unregister_chrdev(major, name); 1016 unregister_chrdev(major, name);
1017 for (unit = 0; unit < PT_UNITS; unit++) 1017 for (unit = 0; unit < PT_UNITS; unit++)
diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c
index 797f5988c2b5..5ed3a6379452 100644
--- a/drivers/block/sx8.c
+++ b/drivers/block/sx8.c
@@ -614,7 +614,7 @@ static int carm_array_info (struct carm_host *host, unsigned int array_idx)
614 spin_unlock_irq(&host->lock); 614 spin_unlock_irq(&host->lock);
615 615
616 DPRINTK("blk_insert_request, tag == %u\n", idx); 616 DPRINTK("blk_insert_request, tag == %u\n", idx);
617 blk_insert_request(host->oob_q, crq->rq, 1, crq, 0); 617 blk_insert_request(host->oob_q, crq->rq, 1, crq);
618 618
619 return 0; 619 return 0;
620 620
@@ -653,7 +653,7 @@ static int carm_send_special (struct carm_host *host, carm_sspc_t func)
653 crq->msg_bucket = (u32) rc; 653 crq->msg_bucket = (u32) rc;
654 654
655 DPRINTK("blk_insert_request, tag == %u\n", idx); 655 DPRINTK("blk_insert_request, tag == %u\n", idx);
656 blk_insert_request(host->oob_q, crq->rq, 1, crq, 0); 656 blk_insert_request(host->oob_q, crq->rq, 1, crq);
657 657
658 return 0; 658 return 0;
659} 659}
diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index ce42889f98fb..685f061e69b2 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -8,13 +8,12 @@
8 * and is not licensed separately. See file COPYING for details. 8 * and is not licensed separately. See file COPYING for details.
9 * 9 *
10 * TODO (sorted by decreasing priority) 10 * TODO (sorted by decreasing priority)
11 * -- Kill first_open (Al Viro fixed the block layer now)
11 * -- Do resets with usb_device_reset (needs a thread context, use khubd) 12 * -- Do resets with usb_device_reset (needs a thread context, use khubd)
12 * -- set readonly flag for CDs, set removable flag for CF readers 13 * -- set readonly flag for CDs, set removable flag for CF readers
13 * -- do inquiry and verify we got a disk and not a tape (for LUN mismatch) 14 * -- do inquiry and verify we got a disk and not a tape (for LUN mismatch)
14 * -- support pphaneuf's SDDR-75 with two LUNs (also broken capacity...)
15 * -- special case some senses, e.g. 3a/0 -> no media present, reduce retries 15 * -- special case some senses, e.g. 3a/0 -> no media present, reduce retries
16 * -- verify the 13 conditions and do bulk resets 16 * -- verify the 13 conditions and do bulk resets
17 * -- normal pool of commands instead of cmdv[]?
18 * -- kill last_pipe and simply do two-state clearing on both pipes 17 * -- kill last_pipe and simply do two-state clearing on both pipes
19 * -- verify protocol (bulk) from USB descriptors (maybe...) 18 * -- verify protocol (bulk) from USB descriptors (maybe...)
20 * -- highmem and sg 19 * -- highmem and sg
@@ -49,7 +48,14 @@
49#define US_SC_SCSI 0x06 /* Transparent */ 48#define US_SC_SCSI 0x06 /* Transparent */
50 49
51/* 50/*
51 * This many LUNs per USB device.
52 * Every one of them takes a host, see UB_MAX_HOSTS.
52 */ 53 */
54#define UB_MAX_LUNS 9
55
56/*
57 */
58
53#define UB_MINORS_PER_MAJOR 8 59#define UB_MINORS_PER_MAJOR 8
54 60
55#define UB_MAX_CDB_SIZE 16 /* Corresponds to Bulk */ 61#define UB_MAX_CDB_SIZE 16 /* Corresponds to Bulk */
@@ -65,7 +71,7 @@ struct bulk_cb_wrap {
65 u32 Tag; /* unique per command id */ 71 u32 Tag; /* unique per command id */
66 __le32 DataTransferLength; /* size of data */ 72 __le32 DataTransferLength; /* size of data */
67 u8 Flags; /* direction in bit 0 */ 73 u8 Flags; /* direction in bit 0 */
68 u8 Lun; /* LUN normally 0 */ 74 u8 Lun; /* LUN */
69 u8 Length; /* of of the CDB */ 75 u8 Length; /* of of the CDB */
70 u8 CDB[UB_MAX_CDB_SIZE]; /* max command */ 76 u8 CDB[UB_MAX_CDB_SIZE]; /* max command */
71}; 77};
@@ -168,6 +174,7 @@ struct ub_scsi_cmd {
168 unsigned int len; /* Requested length */ 174 unsigned int len; /* Requested length */
169 // struct scatterlist sgv[UB_MAX_REQ_SG]; 175 // struct scatterlist sgv[UB_MAX_REQ_SG];
170 176
177 struct ub_lun *lun;
171 void (*done)(struct ub_dev *, struct ub_scsi_cmd *); 178 void (*done)(struct ub_dev *, struct ub_scsi_cmd *);
172 void *back; 179 void *back;
173}; 180};
@@ -252,25 +259,47 @@ struct ub_scsi_cmd_queue {
252}; 259};
253 260
254/* 261/*
255 * The UB device instance. 262 * The block device instance (one per LUN).
263 */
264struct ub_lun {
265 struct ub_dev *udev;
266 struct list_head link;
267 struct gendisk *disk;
268 int id; /* Host index */
269 int num; /* LUN number */
270 char name[16];
271
272 int changed; /* Media was changed */
273 int removable;
274 int readonly;
275 int first_open; /* Kludge. See ub_bd_open. */
276
277 /* Use Ingo's mempool if or when we have more than one command. */
278 /*
279 * Currently we never need more than one command for the whole device.
280 * However, giving every LUN a command is a cheap and automatic way
281 * to enforce fairness between them.
282 */
283 int cmda[1];
284 struct ub_scsi_cmd cmdv[1];
285
286 struct ub_capacity capacity;
287};
288
289/*
290 * The USB device instance.
256 */ 291 */
257struct ub_dev { 292struct ub_dev {
258 spinlock_t lock; 293 spinlock_t lock;
259 int id; /* Number among ub's */
260 atomic_t poison; /* The USB device is disconnected */ 294 atomic_t poison; /* The USB device is disconnected */
261 int openc; /* protected by ub_lock! */ 295 int openc; /* protected by ub_lock! */
262 /* kref is too implicit for our taste */ 296 /* kref is too implicit for our taste */
263 unsigned int tagcnt; 297 unsigned int tagcnt;
264 int changed; /* Media was changed */ 298 char name[12];
265 int removable;
266 int readonly;
267 int first_open; /* Kludge. See ub_bd_open. */
268 char name[8];
269 struct usb_device *dev; 299 struct usb_device *dev;
270 struct usb_interface *intf; 300 struct usb_interface *intf;
271 301
272 struct ub_capacity capacity; 302 struct list_head luns;
273 struct gendisk *disk;
274 303
275 unsigned int send_bulk_pipe; /* cached pipe values */ 304 unsigned int send_bulk_pipe; /* cached pipe values */
276 unsigned int recv_bulk_pipe; 305 unsigned int recv_bulk_pipe;
@@ -279,10 +308,6 @@ struct ub_dev {
279 308
280 struct tasklet_struct tasklet; 309 struct tasklet_struct tasklet;
281 310
282 /* XXX Use Ingo's mempool (once we have more than one) */
283 int cmda[1];
284 struct ub_scsi_cmd cmdv[1];
285
286 struct ub_scsi_cmd_queue cmd_queue; 311 struct ub_scsi_cmd_queue cmd_queue;
287 struct ub_scsi_cmd top_rqs_cmd; /* REQUEST SENSE */ 312 struct ub_scsi_cmd top_rqs_cmd; /* REQUEST SENSE */
288 unsigned char top_sense[UB_SENSE_SIZE]; 313 unsigned char top_sense[UB_SENSE_SIZE];
@@ -301,9 +326,9 @@ struct ub_dev {
301/* 326/*
302 */ 327 */
303static void ub_cleanup(struct ub_dev *sc); 328static void ub_cleanup(struct ub_dev *sc);
304static int ub_bd_rq_fn_1(struct ub_dev *sc, struct request *rq); 329static int ub_bd_rq_fn_1(struct ub_lun *lun, struct request *rq);
305static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd, 330static int ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun,
306 struct request *rq); 331 struct ub_scsi_cmd *cmd, struct request *rq);
307static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_scsi_cmd *cmd, 332static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
308 struct request *rq); 333 struct request *rq);
309static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd); 334static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd);
@@ -320,8 +345,10 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd);
320static int ub_submit_clear_stall(struct ub_dev *sc, struct ub_scsi_cmd *cmd, 345static int ub_submit_clear_stall(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
321 int stalled_pipe); 346 int stalled_pipe);
322static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd); 347static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd);
323static int ub_sync_tur(struct ub_dev *sc); 348static int ub_sync_tur(struct ub_dev *sc, struct ub_lun *lun);
324static int ub_sync_read_cap(struct ub_dev *sc, struct ub_capacity *ret); 349static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
350 struct ub_capacity *ret);
351static int ub_probe_lun(struct ub_dev *sc, int lnum);
325 352
326/* 353/*
327 */ 354 */
@@ -342,6 +369,7 @@ MODULE_DEVICE_TABLE(usb, ub_usb_ids);
342 */ 369 */
343#define UB_MAX_HOSTS 26 370#define UB_MAX_HOSTS 26
344static char ub_hostv[UB_MAX_HOSTS]; 371static char ub_hostv[UB_MAX_HOSTS];
372
345static DEFINE_SPINLOCK(ub_lock); /* Locks globals and ->openc */ 373static DEFINE_SPINLOCK(ub_lock); /* Locks globals and ->openc */
346 374
347/* 375/*
@@ -402,10 +430,12 @@ static void ub_cmdtr_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
402 } 430 }
403} 431}
404 432
405static ssize_t ub_diag_show(struct device *dev, char *page) 433static ssize_t ub_diag_show(struct device *dev, struct device_attribute *attr, char *page)
406{ 434{
407 struct usb_interface *intf; 435 struct usb_interface *intf;
408 struct ub_dev *sc; 436 struct ub_dev *sc;
437 struct list_head *p;
438 struct ub_lun *lun;
409 int cnt; 439 int cnt;
410 unsigned long flags; 440 unsigned long flags;
411 int nc, nh; 441 int nc, nh;
@@ -421,9 +451,15 @@ static ssize_t ub_diag_show(struct device *dev, char *page)
421 spin_lock_irqsave(&sc->lock, flags); 451 spin_lock_irqsave(&sc->lock, flags);
422 452
423 cnt += sprintf(page + cnt, 453 cnt += sprintf(page + cnt,
424 "qlen %d qmax %d changed %d removable %d readonly %d\n", 454 "qlen %d qmax %d\n",
425 sc->cmd_queue.qlen, sc->cmd_queue.qmax, 455 sc->cmd_queue.qlen, sc->cmd_queue.qmax);
426 sc->changed, sc->removable, sc->readonly); 456
457 list_for_each (p, &sc->luns) {
458 lun = list_entry(p, struct ub_lun, link);
459 cnt += sprintf(page + cnt,
460 "lun %u changed %d removable %d readonly %d\n",
461 lun->num, lun->changed, lun->removable, lun->readonly);
462 }
427 463
428 if ((nc = sc->tr.cur + 1) == SCMD_TRACE_SZ) nc = 0; 464 if ((nc = sc->tr.cur + 1) == SCMD_TRACE_SZ) nc = 0;
429 for (j = 0; j < SCMD_TRACE_SZ; j++) { 465 for (j = 0; j < SCMD_TRACE_SZ; j++) {
@@ -523,53 +559,63 @@ static void ub_put(struct ub_dev *sc)
523 */ 559 */
524static void ub_cleanup(struct ub_dev *sc) 560static void ub_cleanup(struct ub_dev *sc)
525{ 561{
562 struct list_head *p;
563 struct ub_lun *lun;
526 request_queue_t *q; 564 request_queue_t *q;
527 565
528 /* I don't think queue can be NULL. But... Stolen from sx8.c */ 566 while (!list_empty(&sc->luns)) {
529 if ((q = sc->disk->queue) != NULL) 567 p = sc->luns.next;
530 blk_cleanup_queue(q); 568 lun = list_entry(p, struct ub_lun, link);
569 list_del(p);
531 570
532 /* 571 /* I don't think queue can be NULL. But... Stolen from sx8.c */
533 * If we zero disk->private_data BEFORE put_disk, we have to check 572 if ((q = lun->disk->queue) != NULL)
534 * for NULL all over the place in open, release, check_media and 573 blk_cleanup_queue(q);
535 * revalidate, because the block level semaphore is well inside the 574 /*
536 * put_disk. But we cannot zero after the call, because *disk is gone. 575 * If we zero disk->private_data BEFORE put_disk, we have
537 * The sd.c is blatantly racy in this area. 576 * to check for NULL all over the place in open, release,
538 */ 577 * check_media and revalidate, because the block level
539 /* disk->private_data = NULL; */ 578 * semaphore is well inside the put_disk.
540 put_disk(sc->disk); 579 * But we cannot zero after the call, because *disk is gone.
541 sc->disk = NULL; 580 * The sd.c is blatantly racy in this area.
581 */
582 /* disk->private_data = NULL; */
583 put_disk(lun->disk);
584 lun->disk = NULL;
585
586 ub_id_put(lun->id);
587 kfree(lun);
588 }
542 589
543 ub_id_put(sc->id);
544 kfree(sc); 590 kfree(sc);
545} 591}
546 592
547/* 593/*
548 * The "command allocator". 594 * The "command allocator".
549 */ 595 */
550static struct ub_scsi_cmd *ub_get_cmd(struct ub_dev *sc) 596static struct ub_scsi_cmd *ub_get_cmd(struct ub_lun *lun)
551{ 597{
552 struct ub_scsi_cmd *ret; 598 struct ub_scsi_cmd *ret;
553 599
554 if (sc->cmda[0]) 600 if (lun->cmda[0])
555 return NULL; 601 return NULL;
556 ret = &sc->cmdv[0]; 602 ret = &lun->cmdv[0];
557 sc->cmda[0] = 1; 603 lun->cmda[0] = 1;
558 return ret; 604 return ret;
559} 605}
560 606
561static void ub_put_cmd(struct ub_dev *sc, struct ub_scsi_cmd *cmd) 607static void ub_put_cmd(struct ub_lun *lun, struct ub_scsi_cmd *cmd)
562{ 608{
563 if (cmd != &sc->cmdv[0]) { 609 if (cmd != &lun->cmdv[0]) {
564 printk(KERN_WARNING "%s: releasing a foreign cmd %p\n", 610 printk(KERN_WARNING "%s: releasing a foreign cmd %p\n",
565 sc->name, cmd); 611 lun->name, cmd);
566 return; 612 return;
567 } 613 }
568 if (!sc->cmda[0]) { 614 if (!lun->cmda[0]) {
569 printk(KERN_WARNING "%s: releasing a free cmd\n", sc->name); 615 printk(KERN_WARNING "%s: releasing a free cmd\n", lun->name);
570 return; 616 return;
571 } 617 }
572 sc->cmda[0] = 0; 618 lun->cmda[0] = 0;
573} 619}
574 620
575/* 621/*
@@ -630,29 +676,30 @@ static struct ub_scsi_cmd *ub_cmdq_pop(struct ub_dev *sc)
630 676
631static void ub_bd_rq_fn(request_queue_t *q) 677static void ub_bd_rq_fn(request_queue_t *q)
632{ 678{
633 struct ub_dev *sc = q->queuedata; 679 struct ub_lun *lun = q->queuedata;
634 struct request *rq; 680 struct request *rq;
635 681
636 while ((rq = elv_next_request(q)) != NULL) { 682 while ((rq = elv_next_request(q)) != NULL) {
637 if (ub_bd_rq_fn_1(sc, rq) != 0) { 683 if (ub_bd_rq_fn_1(lun, rq) != 0) {
638 blk_stop_queue(q); 684 blk_stop_queue(q);
639 break; 685 break;
640 } 686 }
641 } 687 }
642} 688}
643 689
644static int ub_bd_rq_fn_1(struct ub_dev *sc, struct request *rq) 690static int ub_bd_rq_fn_1(struct ub_lun *lun, struct request *rq)
645{ 691{
692 struct ub_dev *sc = lun->udev;
646 struct ub_scsi_cmd *cmd; 693 struct ub_scsi_cmd *cmd;
647 int rc; 694 int rc;
648 695
649 if (atomic_read(&sc->poison) || sc->changed) { 696 if (atomic_read(&sc->poison) || lun->changed) {
650 blkdev_dequeue_request(rq); 697 blkdev_dequeue_request(rq);
651 ub_end_rq(rq, 0); 698 ub_end_rq(rq, 0);
652 return 0; 699 return 0;
653 } 700 }
654 701
655 if ((cmd = ub_get_cmd(sc)) == NULL) 702 if ((cmd = ub_get_cmd(lun)) == NULL)
656 return -1; 703 return -1;
657 memset(cmd, 0, sizeof(struct ub_scsi_cmd)); 704 memset(cmd, 0, sizeof(struct ub_scsi_cmd));
658 705
@@ -661,32 +708,30 @@ static int ub_bd_rq_fn_1(struct ub_dev *sc, struct request *rq)
661 if (blk_pc_request(rq)) { 708 if (blk_pc_request(rq)) {
662 rc = ub_cmd_build_packet(sc, cmd, rq); 709 rc = ub_cmd_build_packet(sc, cmd, rq);
663 } else { 710 } else {
664 rc = ub_cmd_build_block(sc, cmd, rq); 711 rc = ub_cmd_build_block(sc, lun, cmd, rq);
665 } 712 }
666 if (rc != 0) { 713 if (rc != 0) {
667 ub_put_cmd(sc, cmd); 714 ub_put_cmd(lun, cmd);
668 ub_end_rq(rq, 0); 715 ub_end_rq(rq, 0);
669 blk_start_queue(sc->disk->queue);
670 return 0; 716 return 0;
671 } 717 }
672
673 cmd->state = UB_CMDST_INIT; 718 cmd->state = UB_CMDST_INIT;
719 cmd->lun = lun;
674 cmd->done = ub_rw_cmd_done; 720 cmd->done = ub_rw_cmd_done;
675 cmd->back = rq; 721 cmd->back = rq;
676 722
677 cmd->tag = sc->tagcnt++; 723 cmd->tag = sc->tagcnt++;
678 if ((rc = ub_submit_scsi(sc, cmd)) != 0) { 724 if ((rc = ub_submit_scsi(sc, cmd)) != 0) {
679 ub_put_cmd(sc, cmd); 725 ub_put_cmd(lun, cmd);
680 ub_end_rq(rq, 0); 726 ub_end_rq(rq, 0);
681 blk_start_queue(sc->disk->queue);
682 return 0; 727 return 0;
683 } 728 }
684 729
685 return 0; 730 return 0;
686} 731}
687 732
688static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd, 733static int ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun,
689 struct request *rq) 734 struct ub_scsi_cmd *cmd, struct request *rq)
690{ 735{
691 int ub_dir; 736 int ub_dir;
692#if 0 /* We use rq->buffer for now */ 737#if 0 /* We use rq->buffer for now */
@@ -707,7 +752,7 @@ static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
707 sg = &cmd->sgv[0]; 752 sg = &cmd->sgv[0];
708 n_elem = blk_rq_map_sg(q, rq, sg); 753 n_elem = blk_rq_map_sg(q, rq, sg);
709 if (n_elem <= 0) { 754 if (n_elem <= 0) {
710 ub_put_cmd(sc, cmd); 755 ub_put_cmd(lun, cmd);
711 ub_end_rq(rq, 0); 756 ub_end_rq(rq, 0);
712 blk_start_queue(q); 757 blk_start_queue(q);
713 return 0; /* request with no s/g entries? */ 758 return 0; /* request with no s/g entries? */
@@ -716,7 +761,7 @@ static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
716 if (n_elem != 1) { /* Paranoia */ 761 if (n_elem != 1) { /* Paranoia */
717 printk(KERN_WARNING "%s: request with %d segments\n", 762 printk(KERN_WARNING "%s: request with %d segments\n",
718 sc->name, n_elem); 763 sc->name, n_elem);
719 ub_put_cmd(sc, cmd); 764 ub_put_cmd(lun, cmd);
720 ub_end_rq(rq, 0); 765 ub_end_rq(rq, 0);
721 blk_start_queue(q); 766 blk_start_queue(q);
722 return 0; 767 return 0;
@@ -748,8 +793,8 @@ static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
748 * The call to blk_queue_hardsect_size() guarantees that request 793 * The call to blk_queue_hardsect_size() guarantees that request
749 * is aligned, but it is given in terms of 512 byte units, always. 794 * is aligned, but it is given in terms of 512 byte units, always.
750 */ 795 */
751 block = rq->sector >> sc->capacity.bshift; 796 block = rq->sector >> lun->capacity.bshift;
752 nblks = rq->nr_sectors >> sc->capacity.bshift; 797 nblks = rq->nr_sectors >> lun->capacity.bshift;
753 798
754 cmd->cdb[0] = (ub_dir == UB_DIR_READ)? READ_10: WRITE_10; 799 cmd->cdb[0] = (ub_dir == UB_DIR_READ)? READ_10: WRITE_10;
755 /* 10-byte uses 4 bytes of LBA: 2147483648KB, 2097152MB, 2048GB */ 800 /* 10-byte uses 4 bytes of LBA: 2147483648KB, 2097152MB, 2048GB */
@@ -803,7 +848,8 @@ static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
803static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd) 848static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
804{ 849{
805 struct request *rq = cmd->back; 850 struct request *rq = cmd->back;
806 struct gendisk *disk = sc->disk; 851 struct ub_lun *lun = cmd->lun;
852 struct gendisk *disk = lun->disk;
807 request_queue_t *q = disk->queue; 853 request_queue_t *q = disk->queue;
808 int uptodate; 854 int uptodate;
809 855
@@ -818,7 +864,7 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
818 else 864 else
819 uptodate = 0; 865 uptodate = 0;
820 866
821 ub_put_cmd(sc, cmd); 867 ub_put_cmd(lun, cmd);
822 ub_end_rq(rq, uptodate); 868 ub_end_rq(rq, uptodate);
823 blk_start_queue(q); 869 blk_start_queue(q);
824} 870}
@@ -887,7 +933,7 @@ static int ub_scsi_cmd_start(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
887 bcb->Tag = cmd->tag; /* Endianness is not important */ 933 bcb->Tag = cmd->tag; /* Endianness is not important */
888 bcb->DataTransferLength = cpu_to_le32(cmd->len); 934 bcb->DataTransferLength = cpu_to_le32(cmd->len);
889 bcb->Flags = (cmd->dir == UB_DIR_READ) ? 0x80 : 0; 935 bcb->Flags = (cmd->dir == UB_DIR_READ) ? 0x80 : 0;
890 bcb->Lun = 0; /* No multi-LUN yet */ 936 bcb->Lun = (cmd->lun != NULL) ? cmd->lun->num : 0;
891 bcb->Length = cmd->cdb_len; 937 bcb->Length = cmd->cdb_len;
892 938
893 /* copy the command payload */ 939 /* copy the command payload */
@@ -1002,9 +1048,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1002 * The control pipe clears itself - nothing to do. 1048 * The control pipe clears itself - nothing to do.
1003 * XXX Might try to reset the device here and retry. 1049 * XXX Might try to reset the device here and retry.
1004 */ 1050 */
1005 printk(KERN_NOTICE "%s: " 1051 printk(KERN_NOTICE "%s: stall on control pipe\n",
1006 "stall on control pipe for device %u\n", 1052 sc->name);
1007 sc->name, sc->dev->devnum);
1008 goto Bad_End; 1053 goto Bad_End;
1009 } 1054 }
1010 1055
@@ -1025,9 +1070,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1025 * The control pipe clears itself - nothing to do. 1070 * The control pipe clears itself - nothing to do.
1026 * XXX Might try to reset the device here and retry. 1071 * XXX Might try to reset the device here and retry.
1027 */ 1072 */
1028 printk(KERN_NOTICE "%s: " 1073 printk(KERN_NOTICE "%s: stall on control pipe\n",
1029 "stall on control pipe for device %u\n", 1074 sc->name);
1030 sc->name, sc->dev->devnum);
1031 goto Bad_End; 1075 goto Bad_End;
1032 } 1076 }
1033 1077
@@ -1046,9 +1090,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1046 rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe); 1090 rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe);
1047 if (rc != 0) { 1091 if (rc != 0) {
1048 printk(KERN_NOTICE "%s: " 1092 printk(KERN_NOTICE "%s: "
1049 "unable to submit clear for device %u" 1093 "unable to submit clear (%d)\n",
1050 " (code %d)\n", 1094 sc->name, rc);
1051 sc->name, sc->dev->devnum, rc);
1052 /* 1095 /*
1053 * This is typically ENOMEM or some other such shit. 1096 * This is typically ENOMEM or some other such shit.
1054 * Retrying is pointless. Just do Bad End on it... 1097 * Retrying is pointless. Just do Bad End on it...
@@ -1107,9 +1150,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1107 rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe); 1150 rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe);
1108 if (rc != 0) { 1151 if (rc != 0) {
1109 printk(KERN_NOTICE "%s: " 1152 printk(KERN_NOTICE "%s: "
1110 "unable to submit clear for device %u" 1153 "unable to submit clear (%d)\n",
1111 " (code %d)\n", 1154 sc->name, rc);
1112 sc->name, sc->dev->devnum, rc);
1113 /* 1155 /*
1114 * This is typically ENOMEM or some other such shit. 1156 * This is typically ENOMEM or some other such shit.
1115 * Retrying is pointless. Just do Bad End on it... 1157 * Retrying is pointless. Just do Bad End on it...
@@ -1140,9 +1182,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1140 rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe); 1182 rc = ub_submit_clear_stall(sc, cmd, sc->last_pipe);
1141 if (rc != 0) { 1183 if (rc != 0) {
1142 printk(KERN_NOTICE "%s: " 1184 printk(KERN_NOTICE "%s: "
1143 "unable to submit clear for device %u" 1185 "unable to submit clear (%d)\n",
1144 " (code %d)\n", 1186 sc->name, rc);
1145 sc->name, sc->dev->devnum, rc);
1146 /* 1187 /*
1147 * This is typically ENOMEM or some other such shit. 1188 * This is typically ENOMEM or some other such shit.
1148 * Retrying is pointless. Just do Bad End on it... 1189 * Retrying is pointless. Just do Bad End on it...
@@ -1164,9 +1205,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1164 * encounter such a thing, try to read the CSW again. 1205 * encounter such a thing, try to read the CSW again.
1165 */ 1206 */
1166 if (++cmd->stat_count >= 4) { 1207 if (++cmd->stat_count >= 4) {
1167 printk(KERN_NOTICE "%s: " 1208 printk(KERN_NOTICE "%s: unable to get CSW\n",
1168 "unable to get CSW on device %u\n", 1209 sc->name);
1169 sc->name, sc->dev->devnum);
1170 goto Bad_End; 1210 goto Bad_End;
1171 } 1211 }
1172 __ub_state_stat(sc, cmd); 1212 __ub_state_stat(sc, cmd);
@@ -1207,10 +1247,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1207 */ 1247 */
1208 if (++cmd->stat_count >= 4) { 1248 if (++cmd->stat_count >= 4) {
1209 printk(KERN_NOTICE "%s: " 1249 printk(KERN_NOTICE "%s: "
1210 "tag mismatch orig 0x%x reply 0x%x " 1250 "tag mismatch orig 0x%x reply 0x%x\n",
1211 "on device %u\n", 1251 sc->name, cmd->tag, bcs->Tag);
1212 sc->name, cmd->tag, bcs->Tag,
1213 sc->dev->devnum);
1214 goto Bad_End; 1252 goto Bad_End;
1215 } 1253 }
1216 __ub_state_stat(sc, cmd); 1254 __ub_state_stat(sc, cmd);
@@ -1244,8 +1282,8 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1244 1282
1245 } else { 1283 } else {
1246 printk(KERN_WARNING "%s: " 1284 printk(KERN_WARNING "%s: "
1247 "wrong command state %d on device %u\n", 1285 "wrong command state %d\n",
1248 sc->name, cmd->state, sc->dev->devnum); 1286 sc->name, cmd->state);
1249 goto Bad_End; 1287 goto Bad_End;
1250 } 1288 }
1251 return; 1289 return;
@@ -1288,7 +1326,6 @@ static void __ub_state_stat(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1288 1326
1289 if ((rc = usb_submit_urb(&sc->work_urb, GFP_ATOMIC)) != 0) { 1327 if ((rc = usb_submit_urb(&sc->work_urb, GFP_ATOMIC)) != 0) {
1290 /* XXX Clear stalls */ 1328 /* XXX Clear stalls */
1291 printk("%s: CSW #%d submit failed (%d)\n", sc->name, cmd->tag, rc); /* P3 */
1292 ub_complete(&sc->work_done); 1329 ub_complete(&sc->work_done);
1293 ub_state_done(sc, cmd, rc); 1330 ub_state_done(sc, cmd, rc);
1294 return; 1331 return;
@@ -1333,6 +1370,7 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1333 scmd->state = UB_CMDST_INIT; 1370 scmd->state = UB_CMDST_INIT;
1334 scmd->data = sc->top_sense; 1371 scmd->data = sc->top_sense;
1335 scmd->len = UB_SENSE_SIZE; 1372 scmd->len = UB_SENSE_SIZE;
1373 scmd->lun = cmd->lun;
1336 scmd->done = ub_top_sense_done; 1374 scmd->done = ub_top_sense_done;
1337 scmd->back = cmd; 1375 scmd->back = cmd;
1338 1376
@@ -1411,14 +1449,14 @@ static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd)
1411 } 1449 }
1412 if (cmd != scmd->back) { 1450 if (cmd != scmd->back) {
1413 printk(KERN_WARNING "%s: " 1451 printk(KERN_WARNING "%s: "
1414 "sense done for wrong command 0x%x on device %u\n", 1452 "sense done for wrong command 0x%x\n",
1415 sc->name, cmd->tag, sc->dev->devnum); 1453 sc->name, cmd->tag);
1416 return; 1454 return;
1417 } 1455 }
1418 if (cmd->state != UB_CMDST_SENSE) { 1456 if (cmd->state != UB_CMDST_SENSE) {
1419 printk(KERN_WARNING "%s: " 1457 printk(KERN_WARNING "%s: "
1420 "sense done with bad cmd state %d on device %u\n", 1458 "sense done with bad cmd state %d\n",
1421 sc->name, cmd->state, sc->dev->devnum); 1459 sc->name, cmd->state);
1422 return; 1460 return;
1423 } 1461 }
1424 1462
@@ -1429,68 +1467,32 @@ static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd)
1429 ub_scsi_urb_compl(sc, cmd); 1467 ub_scsi_urb_compl(sc, cmd);
1430} 1468}
1431 1469
1432#if 0
1433/* Determine what the maximum LUN supported is */
1434int usb_stor_Bulk_max_lun(struct us_data *us)
1435{
1436 int result;
1437
1438 /* issue the command */
1439 result = usb_stor_control_msg(us, us->recv_ctrl_pipe,
1440 US_BULK_GET_MAX_LUN,
1441 USB_DIR_IN | USB_TYPE_CLASS |
1442 USB_RECIP_INTERFACE,
1443 0, us->ifnum, us->iobuf, 1, HZ);
1444
1445 /*
1446 * Some devices (i.e. Iomega Zip100) need this -- apparently
1447 * the bulk pipes get STALLed when the GetMaxLUN request is
1448 * processed. This is, in theory, harmless to all other devices
1449 * (regardless of if they stall or not).
1450 */
1451 if (result < 0) {
1452 usb_stor_clear_halt(us, us->recv_bulk_pipe);
1453 usb_stor_clear_halt(us, us->send_bulk_pipe);
1454 }
1455
1456 US_DEBUGP("GetMaxLUN command result is %d, data is %d\n",
1457 result, us->iobuf[0]);
1458
1459 /* if we have a successful request, return the result */
1460 if (result == 1)
1461 return us->iobuf[0];
1462
1463 /* return the default -- no LUNs */
1464 return 0;
1465}
1466#endif
1467
1468/* 1470/*
1469 * This is called from a process context. 1471 * This is called from a process context.
1470 */ 1472 */
1471static void ub_revalidate(struct ub_dev *sc) 1473static void ub_revalidate(struct ub_dev *sc, struct ub_lun *lun)
1472{ 1474{
1473 1475
1474 sc->readonly = 0; /* XXX Query this from the device */ 1476 lun->readonly = 0; /* XXX Query this from the device */
1475 1477
1476 sc->capacity.nsec = 0; 1478 lun->capacity.nsec = 0;
1477 sc->capacity.bsize = 512; 1479 lun->capacity.bsize = 512;
1478 sc->capacity.bshift = 0; 1480 lun->capacity.bshift = 0;
1479 1481
1480 if (ub_sync_tur(sc) != 0) 1482 if (ub_sync_tur(sc, lun) != 0)
1481 return; /* Not ready */ 1483 return; /* Not ready */
1482 sc->changed = 0; 1484 lun->changed = 0;
1483 1485
1484 if (ub_sync_read_cap(sc, &sc->capacity) != 0) { 1486 if (ub_sync_read_cap(sc, lun, &lun->capacity) != 0) {
1485 /* 1487 /*
1486 * The retry here means something is wrong, either with the 1488 * The retry here means something is wrong, either with the
1487 * device, with the transport, or with our code. 1489 * device, with the transport, or with our code.
1488 * We keep this because sd.c has retries for capacity. 1490 * We keep this because sd.c has retries for capacity.
1489 */ 1491 */
1490 if (ub_sync_read_cap(sc, &sc->capacity) != 0) { 1492 if (ub_sync_read_cap(sc, lun, &lun->capacity) != 0) {
1491 sc->capacity.nsec = 0; 1493 lun->capacity.nsec = 0;
1492 sc->capacity.bsize = 512; 1494 lun->capacity.bsize = 512;
1493 sc->capacity.bshift = 0; 1495 lun->capacity.bshift = 0;
1494 } 1496 }
1495 } 1497 }
1496} 1498}
@@ -1503,12 +1505,15 @@ static void ub_revalidate(struct ub_dev *sc)
1503static int ub_bd_open(struct inode *inode, struct file *filp) 1505static int ub_bd_open(struct inode *inode, struct file *filp)
1504{ 1506{
1505 struct gendisk *disk = inode->i_bdev->bd_disk; 1507 struct gendisk *disk = inode->i_bdev->bd_disk;
1508 struct ub_lun *lun;
1506 struct ub_dev *sc; 1509 struct ub_dev *sc;
1507 unsigned long flags; 1510 unsigned long flags;
1508 int rc; 1511 int rc;
1509 1512
1510 if ((sc = disk->private_data) == NULL) 1513 if ((lun = disk->private_data) == NULL)
1511 return -ENXIO; 1514 return -ENXIO;
1515 sc = lun->udev;
1516
1512 spin_lock_irqsave(&ub_lock, flags); 1517 spin_lock_irqsave(&ub_lock, flags);
1513 if (atomic_read(&sc->poison)) { 1518 if (atomic_read(&sc->poison)) {
1514 spin_unlock_irqrestore(&ub_lock, flags); 1519 spin_unlock_irqrestore(&ub_lock, flags);
@@ -1529,15 +1534,15 @@ static int ub_bd_open(struct inode *inode, struct file *filp)
1529 * The bottom line is, Al Viro says that we should not allow 1534 * The bottom line is, Al Viro says that we should not allow
1530 * bdev->bd_invalidated to be set when doing add_disk no matter what. 1535 * bdev->bd_invalidated to be set when doing add_disk no matter what.
1531 */ 1536 */
1532 if (sc->first_open) { 1537 if (lun->first_open) {
1533 if (sc->changed) { 1538 lun->first_open = 0;
1534 sc->first_open = 0; 1539 if (lun->changed) {
1535 rc = -ENOMEDIUM; 1540 rc = -ENOMEDIUM;
1536 goto err_open; 1541 goto err_open;
1537 } 1542 }
1538 } 1543 }
1539 1544
1540 if (sc->removable || sc->readonly) 1545 if (lun->removable || lun->readonly)
1541 check_disk_change(inode->i_bdev); 1546 check_disk_change(inode->i_bdev);
1542 1547
1543 /* 1548 /*
@@ -1545,12 +1550,12 @@ static int ub_bd_open(struct inode *inode, struct file *filp)
1545 * under some pretty murky conditions (a failure of READ CAPACITY). 1550 * under some pretty murky conditions (a failure of READ CAPACITY).
1546 * We may need it one day. 1551 * We may need it one day.
1547 */ 1552 */
1548 if (sc->removable && sc->changed && !(filp->f_flags & O_NDELAY)) { 1553 if (lun->removable && lun->changed && !(filp->f_flags & O_NDELAY)) {
1549 rc = -ENOMEDIUM; 1554 rc = -ENOMEDIUM;
1550 goto err_open; 1555 goto err_open;
1551 } 1556 }
1552 1557
1553 if (sc->readonly && (filp->f_mode & FMODE_WRITE)) { 1558 if (lun->readonly && (filp->f_mode & FMODE_WRITE)) {
1554 rc = -EROFS; 1559 rc = -EROFS;
1555 goto err_open; 1560 goto err_open;
1556 } 1561 }
@@ -1567,7 +1572,8 @@ err_open:
1567static int ub_bd_release(struct inode *inode, struct file *filp) 1572static int ub_bd_release(struct inode *inode, struct file *filp)
1568{ 1573{
1569 struct gendisk *disk = inode->i_bdev->bd_disk; 1574 struct gendisk *disk = inode->i_bdev->bd_disk;
1570 struct ub_dev *sc = disk->private_data; 1575 struct ub_lun *lun = disk->private_data;
1576 struct ub_dev *sc = lun->udev;
1571 1577
1572 ub_put(sc); 1578 ub_put(sc);
1573 return 0; 1579 return 0;
@@ -1597,20 +1603,14 @@ static int ub_bd_ioctl(struct inode *inode, struct file *filp,
1597 */ 1603 */
1598static int ub_bd_revalidate(struct gendisk *disk) 1604static int ub_bd_revalidate(struct gendisk *disk)
1599{ 1605{
1600 struct ub_dev *sc = disk->private_data; 1606 struct ub_lun *lun = disk->private_data;
1601 1607
1602 ub_revalidate(sc); 1608 ub_revalidate(lun->udev, lun);
1603 /* This is pretty much a long term P3 */
1604 if (!atomic_read(&sc->poison)) { /* Cover sc->dev */
1605 printk(KERN_INFO "%s: device %u capacity nsec %ld bsize %u\n",
1606 sc->name, sc->dev->devnum,
1607 sc->capacity.nsec, sc->capacity.bsize);
1608 }
1609 1609
1610 /* XXX Support sector size switching like in sr.c */ 1610 /* XXX Support sector size switching like in sr.c */
1611 blk_queue_hardsect_size(disk->queue, sc->capacity.bsize); 1611 blk_queue_hardsect_size(disk->queue, lun->capacity.bsize);
1612 set_capacity(disk, sc->capacity.nsec); 1612 set_capacity(disk, lun->capacity.nsec);
1613 // set_disk_ro(sdkp->disk, sc->readonly); 1613 // set_disk_ro(sdkp->disk, lun->readonly);
1614 1614
1615 return 0; 1615 return 0;
1616} 1616}
@@ -1626,9 +1626,9 @@ static int ub_bd_revalidate(struct gendisk *disk)
1626 */ 1626 */
1627static int ub_bd_media_changed(struct gendisk *disk) 1627static int ub_bd_media_changed(struct gendisk *disk)
1628{ 1628{
1629 struct ub_dev *sc = disk->private_data; 1629 struct ub_lun *lun = disk->private_data;
1630 1630
1631 if (!sc->removable) 1631 if (!lun->removable)
1632 return 0; 1632 return 0;
1633 1633
1634 /* 1634 /*
@@ -1640,12 +1640,12 @@ static int ub_bd_media_changed(struct gendisk *disk)
1640 * will fail, then block layer discards the data. Since we never 1640 * will fail, then block layer discards the data. Since we never
1641 * spin drives up, such devices simply cannot be used with ub anyway. 1641 * spin drives up, such devices simply cannot be used with ub anyway.
1642 */ 1642 */
1643 if (ub_sync_tur(sc) != 0) { 1643 if (ub_sync_tur(lun->udev, lun) != 0) {
1644 sc->changed = 1; 1644 lun->changed = 1;
1645 return 1; 1645 return 1;
1646 } 1646 }
1647 1647
1648 return sc->changed; 1648 return lun->changed;
1649} 1649}
1650 1650
1651static struct block_device_operations ub_bd_fops = { 1651static struct block_device_operations ub_bd_fops = {
@@ -1669,7 +1669,7 @@ static void ub_probe_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
1669/* 1669/*
1670 * Test if the device has a check condition on it, synchronously. 1670 * Test if the device has a check condition on it, synchronously.
1671 */ 1671 */
1672static int ub_sync_tur(struct ub_dev *sc) 1672static int ub_sync_tur(struct ub_dev *sc, struct ub_lun *lun)
1673{ 1673{
1674 struct ub_scsi_cmd *cmd; 1674 struct ub_scsi_cmd *cmd;
1675 enum { ALLOC_SIZE = sizeof(struct ub_scsi_cmd) }; 1675 enum { ALLOC_SIZE = sizeof(struct ub_scsi_cmd) };
@@ -1688,6 +1688,7 @@ static int ub_sync_tur(struct ub_dev *sc)
1688 cmd->cdb_len = 6; 1688 cmd->cdb_len = 6;
1689 cmd->dir = UB_DIR_NONE; 1689 cmd->dir = UB_DIR_NONE;
1690 cmd->state = UB_CMDST_INIT; 1690 cmd->state = UB_CMDST_INIT;
1691 cmd->lun = lun; /* This may be NULL, but that's ok */
1691 cmd->done = ub_probe_done; 1692 cmd->done = ub_probe_done;
1692 cmd->back = &compl; 1693 cmd->back = &compl;
1693 1694
@@ -1718,7 +1719,8 @@ err_alloc:
1718/* 1719/*
1719 * Read the SCSI capacity synchronously (for probing). 1720 * Read the SCSI capacity synchronously (for probing).
1720 */ 1721 */
1721static int ub_sync_read_cap(struct ub_dev *sc, struct ub_capacity *ret) 1722static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
1723 struct ub_capacity *ret)
1722{ 1724{
1723 struct ub_scsi_cmd *cmd; 1725 struct ub_scsi_cmd *cmd;
1724 char *p; 1726 char *p;
@@ -1743,6 +1745,7 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_capacity *ret)
1743 cmd->state = UB_CMDST_INIT; 1745 cmd->state = UB_CMDST_INIT;
1744 cmd->data = p; 1746 cmd->data = p;
1745 cmd->len = 8; 1747 cmd->len = 8;
1748 cmd->lun = lun;
1746 cmd->done = ub_probe_done; 1749 cmd->done = ub_probe_done;
1747 cmd->back = &compl; 1750 cmd->back = &compl;
1748 1751
@@ -1812,6 +1815,90 @@ static void ub_probe_timeout(unsigned long arg)
1812} 1815}
1813 1816
1814/* 1817/*
1818 * Get number of LUNs by the way of Bulk GetMaxLUN command.
1819 */
1820static int ub_sync_getmaxlun(struct ub_dev *sc)
1821{
1822 int ifnum = sc->intf->cur_altsetting->desc.bInterfaceNumber;
1823 unsigned char *p;
1824 enum { ALLOC_SIZE = 1 };
1825 struct usb_ctrlrequest *cr;
1826 struct completion compl;
1827 struct timer_list timer;
1828 int nluns;
1829 int rc;
1830
1831 init_completion(&compl);
1832
1833 rc = -ENOMEM;
1834 if ((p = kmalloc(ALLOC_SIZE, GFP_KERNEL)) == NULL)
1835 goto err_alloc;
1836 *p = 55;
1837
1838 cr = &sc->work_cr;
1839 cr->bRequestType = USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE;
1840 cr->bRequest = US_BULK_GET_MAX_LUN;
1841 cr->wValue = cpu_to_le16(0);
1842 cr->wIndex = cpu_to_le16(ifnum);
1843 cr->wLength = cpu_to_le16(1);
1844
1845 usb_fill_control_urb(&sc->work_urb, sc->dev, sc->recv_ctrl_pipe,
1846 (unsigned char*) cr, p, 1, ub_probe_urb_complete, &compl);
1847 sc->work_urb.transfer_flags = 0;
1848 sc->work_urb.actual_length = 0;
1849 sc->work_urb.error_count = 0;
1850 sc->work_urb.status = 0;
1851
1852 if ((rc = usb_submit_urb(&sc->work_urb, GFP_KERNEL)) != 0) {
1853 if (rc == -EPIPE) {
1854 printk("%s: Stall at GetMaxLUN, using 1 LUN\n",
1855 sc->name); /* P3 */
1856 } else {
1857 printk(KERN_WARNING
1858 "%s: Unable to submit GetMaxLUN (%d)\n",
1859 sc->name, rc);
1860 }
1861 goto err_submit;
1862 }
1863
1864 init_timer(&timer);
1865 timer.function = ub_probe_timeout;
1866 timer.data = (unsigned long) &compl;
1867 timer.expires = jiffies + UB_CTRL_TIMEOUT;
1868 add_timer(&timer);
1869
1870 wait_for_completion(&compl);
1871
1872 del_timer_sync(&timer);
1873 usb_kill_urb(&sc->work_urb);
1874
1875 if (sc->work_urb.actual_length != 1) {
1876 printk("%s: GetMaxLUN returned %d bytes\n", sc->name,
1877 sc->work_urb.actual_length); /* P3 */
1878 nluns = 0;
1879 } else {
1880 if ((nluns = *p) == 55) {
1881 nluns = 0;
1882 } else {
1883 /* GetMaxLUN returns the maximum LUN number */
1884 nluns += 1;
1885 if (nluns > UB_MAX_LUNS)
1886 nluns = UB_MAX_LUNS;
1887 }
1888 printk("%s: GetMaxLUN returned %d, using %d LUNs\n", sc->name,
1889 *p, nluns); /* P3 */
1890 }
1891
1892 kfree(p);
1893 return nluns;
1894
1895err_submit:
1896 kfree(p);
1897err_alloc:
1898 return rc;
1899}
1900
1901/*
1815 * Clear initial stalls. 1902 * Clear initial stalls.
1816 */ 1903 */
1817static int ub_probe_clear_stall(struct ub_dev *sc, int stalled_pipe) 1904static int ub_probe_clear_stall(struct ub_dev *sc, int stalled_pipe)
@@ -1897,8 +1984,8 @@ static int ub_get_pipes(struct ub_dev *sc, struct usb_device *dev,
1897 } 1984 }
1898 1985
1899 if (ep_in == NULL || ep_out == NULL) { 1986 if (ep_in == NULL || ep_out == NULL) {
1900 printk(KERN_NOTICE "%s: device %u failed endpoint check\n", 1987 printk(KERN_NOTICE "%s: failed endpoint check\n",
1901 sc->name, sc->dev->devnum); 1988 sc->name);
1902 return -EIO; 1989 return -EIO;
1903 } 1990 }
1904 1991
@@ -1921,8 +2008,7 @@ static int ub_probe(struct usb_interface *intf,
1921 const struct usb_device_id *dev_id) 2008 const struct usb_device_id *dev_id)
1922{ 2009{
1923 struct ub_dev *sc; 2010 struct ub_dev *sc;
1924 request_queue_t *q; 2011 int nluns;
1925 struct gendisk *disk;
1926 int rc; 2012 int rc;
1927 int i; 2013 int i;
1928 2014
@@ -1931,6 +2017,7 @@ static int ub_probe(struct usb_interface *intf,
1931 goto err_core; 2017 goto err_core;
1932 memset(sc, 0, sizeof(struct ub_dev)); 2018 memset(sc, 0, sizeof(struct ub_dev));
1933 spin_lock_init(&sc->lock); 2019 spin_lock_init(&sc->lock);
2020 INIT_LIST_HEAD(&sc->luns);
1934 usb_init_urb(&sc->work_urb); 2021 usb_init_urb(&sc->work_urb);
1935 tasklet_init(&sc->tasklet, ub_scsi_action, (unsigned long)sc); 2022 tasklet_init(&sc->tasklet, ub_scsi_action, (unsigned long)sc);
1936 atomic_set(&sc->poison, 0); 2023 atomic_set(&sc->poison, 0);
@@ -1942,19 +2029,16 @@ static int ub_probe(struct usb_interface *intf,
1942 ub_init_completion(&sc->work_done); 2029 ub_init_completion(&sc->work_done);
1943 sc->work_done.done = 1; /* A little yuk, but oh well... */ 2030 sc->work_done.done = 1; /* A little yuk, but oh well... */
1944 2031
1945 rc = -ENOSR;
1946 if ((sc->id = ub_id_get()) == -1)
1947 goto err_id;
1948 snprintf(sc->name, 8, DRV_NAME "%c", sc->id + 'a');
1949
1950 sc->dev = interface_to_usbdev(intf); 2032 sc->dev = interface_to_usbdev(intf);
1951 sc->intf = intf; 2033 sc->intf = intf;
1952 // sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber; 2034 // sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
1953
1954 usb_set_intfdata(intf, sc); 2035 usb_set_intfdata(intf, sc);
1955 usb_get_dev(sc->dev); 2036 usb_get_dev(sc->dev);
1956 // usb_get_intf(sc->intf); /* Do we need this? */ 2037 // usb_get_intf(sc->intf); /* Do we need this? */
1957 2038
2039 snprintf(sc->name, 12, DRV_NAME "(%d.%d)",
2040 sc->dev->bus->busnum, sc->dev->devnum);
2041
1958 /* XXX Verify that we can handle the device (from descriptors) */ 2042 /* XXX Verify that we can handle the device (from descriptors) */
1959 2043
1960 ub_get_pipes(sc, sc->dev, intf); 2044 ub_get_pipes(sc, sc->dev, intf);
@@ -1992,35 +2076,88 @@ static int ub_probe(struct usb_interface *intf,
1992 * In any case it's not our business how revaliadation is implemented. 2076 * In any case it's not our business how revaliadation is implemented.
1993 */ 2077 */
1994 for (i = 0; i < 3; i++) { /* Retries for benh's key */ 2078 for (i = 0; i < 3; i++) { /* Retries for benh's key */
1995 if ((rc = ub_sync_tur(sc)) <= 0) break; 2079 if ((rc = ub_sync_tur(sc, NULL)) <= 0) break;
1996 if (rc != 0x6) break; 2080 if (rc != 0x6) break;
1997 msleep(10); 2081 msleep(10);
1998 } 2082 }
1999 2083
2000 sc->removable = 1; /* XXX Query this from the device */ 2084 nluns = 1;
2001 sc->changed = 1; /* ub_revalidate clears only */ 2085 for (i = 0; i < 3; i++) {
2002 sc->first_open = 1; 2086 if ((rc = ub_sync_getmaxlun(sc)) < 0) {
2087 /*
2088 * Some devices (i.e. Iomega Zip100) need this --
2089 * apparently the bulk pipes get STALLed when the
2090 * GetMaxLUN request is processed.
2091 * XXX I have a ZIP-100, verify it does this.
2092 */
2093 if (rc == -EPIPE) {
2094 ub_probe_clear_stall(sc, sc->recv_bulk_pipe);
2095 ub_probe_clear_stall(sc, sc->send_bulk_pipe);
2096 }
2097 break;
2098 }
2099 if (rc != 0) {
2100 nluns = rc;
2101 break;
2102 }
2103 msleep(100);
2104 }
2003 2105
2004 ub_revalidate(sc); 2106 for (i = 0; i < nluns; i++) {
2005 /* This is pretty much a long term P3 */ 2107 ub_probe_lun(sc, i);
2006 printk(KERN_INFO "%s: device %u capacity nsec %ld bsize %u\n", 2108 }
2007 sc->name, sc->dev->devnum, sc->capacity.nsec, sc->capacity.bsize); 2109 return 0;
2110
2111 /* device_remove_file(&sc->intf->dev, &dev_attr_diag); */
2112err_diag:
2113 usb_set_intfdata(intf, NULL);
2114 // usb_put_intf(sc->intf);
2115 usb_put_dev(sc->dev);
2116 kfree(sc);
2117err_core:
2118 return rc;
2119}
2120
2121static int ub_probe_lun(struct ub_dev *sc, int lnum)
2122{
2123 struct ub_lun *lun;
2124 request_queue_t *q;
2125 struct gendisk *disk;
2126 int rc;
2127
2128 rc = -ENOMEM;
2129 if ((lun = kmalloc(sizeof(struct ub_lun), GFP_KERNEL)) == NULL)
2130 goto err_alloc;
2131 memset(lun, 0, sizeof(struct ub_lun));
2132 lun->num = lnum;
2133
2134 rc = -ENOSR;
2135 if ((lun->id = ub_id_get()) == -1)
2136 goto err_id;
2137
2138 lun->udev = sc;
2139 list_add(&lun->link, &sc->luns);
2140
2141 snprintf(lun->name, 16, DRV_NAME "%c(%d.%d.%d)",
2142 lun->id + 'a', sc->dev->bus->busnum, sc->dev->devnum, lun->num);
2143
2144 lun->removable = 1; /* XXX Query this from the device */
2145 lun->changed = 1; /* ub_revalidate clears only */
2146 lun->first_open = 1;
2147 ub_revalidate(sc, lun);
2008 2148
2009 /*
2010 * Just one disk per sc currently, but maybe more.
2011 */
2012 rc = -ENOMEM; 2149 rc = -ENOMEM;
2013 if ((disk = alloc_disk(UB_MINORS_PER_MAJOR)) == NULL) 2150 if ((disk = alloc_disk(UB_MINORS_PER_MAJOR)) == NULL)
2014 goto err_diskalloc; 2151 goto err_diskalloc;
2015 2152
2016 sc->disk = disk; 2153 lun->disk = disk;
2017 sprintf(disk->disk_name, DRV_NAME "%c", sc->id + 'a'); 2154 sprintf(disk->disk_name, DRV_NAME "%c", lun->id + 'a');
2018 sprintf(disk->devfs_name, DEVFS_NAME "/%c", sc->id + 'a'); 2155 sprintf(disk->devfs_name, DEVFS_NAME "/%c", lun->id + 'a');
2019 disk->major = UB_MAJOR; 2156 disk->major = UB_MAJOR;
2020 disk->first_minor = sc->id * UB_MINORS_PER_MAJOR; 2157 disk->first_minor = lun->id * UB_MINORS_PER_MAJOR;
2021 disk->fops = &ub_bd_fops; 2158 disk->fops = &ub_bd_fops;
2022 disk->private_data = sc; 2159 disk->private_data = lun;
2023 disk->driverfs_dev = &intf->dev; 2160 disk->driverfs_dev = &sc->intf->dev; /* XXX Many to one ok? */
2024 2161
2025 rc = -ENOMEM; 2162 rc = -ENOMEM;
2026 if ((q = blk_init_queue(ub_bd_rq_fn, &sc->lock)) == NULL) 2163 if ((q = blk_init_queue(ub_bd_rq_fn, &sc->lock)) == NULL)
@@ -2028,28 +2165,17 @@ static int ub_probe(struct usb_interface *intf,
2028 2165
2029 disk->queue = q; 2166 disk->queue = q;
2030 2167
2031 // blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask); 2168 blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH);
2032 blk_queue_max_hw_segments(q, UB_MAX_REQ_SG); 2169 blk_queue_max_hw_segments(q, UB_MAX_REQ_SG);
2033 blk_queue_max_phys_segments(q, UB_MAX_REQ_SG); 2170 blk_queue_max_phys_segments(q, UB_MAX_REQ_SG);
2034 // blk_queue_segment_boundary(q, CARM_SG_BOUNDARY); 2171 blk_queue_segment_boundary(q, 0xffffffff); /* Dubious. */
2035 blk_queue_max_sectors(q, UB_MAX_SECTORS); 2172 blk_queue_max_sectors(q, UB_MAX_SECTORS);
2036 blk_queue_hardsect_size(q, sc->capacity.bsize); 2173 blk_queue_hardsect_size(q, lun->capacity.bsize);
2037
2038 /*
2039 * This is a serious infraction, caused by a deficiency in the
2040 * USB sg interface (usb_sg_wait()). We plan to remove this once
2041 * we get mileage on the driver and can justify a change to USB API.
2042 * See blk_queue_bounce_limit() to understand this part.
2043 *
2044 * XXX And I still need to be aware of the DMA mask in the HC.
2045 */
2046 q->bounce_pfn = blk_max_low_pfn;
2047 q->bounce_gfp = GFP_NOIO;
2048 2174
2049 q->queuedata = sc; 2175 q->queuedata = lun;
2050 2176
2051 set_capacity(disk, sc->capacity.nsec); 2177 set_capacity(disk, lun->capacity.nsec);
2052 if (sc->removable) 2178 if (lun->removable)
2053 disk->flags |= GENHD_FL_REMOVABLE; 2179 disk->flags |= GENHD_FL_REMOVABLE;
2054 2180
2055 add_disk(disk); 2181 add_disk(disk);
@@ -2059,22 +2185,20 @@ static int ub_probe(struct usb_interface *intf,
2059err_blkqinit: 2185err_blkqinit:
2060 put_disk(disk); 2186 put_disk(disk);
2061err_diskalloc: 2187err_diskalloc:
2062 device_remove_file(&sc->intf->dev, &dev_attr_diag); 2188 list_del(&lun->link);
2063err_diag: 2189 ub_id_put(lun->id);
2064 usb_set_intfdata(intf, NULL);
2065 // usb_put_intf(sc->intf);
2066 usb_put_dev(sc->dev);
2067 ub_id_put(sc->id);
2068err_id: 2190err_id:
2069 kfree(sc); 2191 kfree(lun);
2070err_core: 2192err_alloc:
2071 return rc; 2193 return rc;
2072} 2194}
2073 2195
2074static void ub_disconnect(struct usb_interface *intf) 2196static void ub_disconnect(struct usb_interface *intf)
2075{ 2197{
2076 struct ub_dev *sc = usb_get_intfdata(intf); 2198 struct ub_dev *sc = usb_get_intfdata(intf);
2077 struct gendisk *disk = sc->disk; 2199 struct list_head *p;
2200 struct ub_lun *lun;
2201 struct gendisk *disk;
2078 unsigned long flags; 2202 unsigned long flags;
2079 2203
2080 /* 2204 /*
@@ -2124,14 +2248,18 @@ static void ub_disconnect(struct usb_interface *intf)
2124 /* 2248 /*
2125 * Unregister the upper layer. 2249 * Unregister the upper layer.
2126 */ 2250 */
2127 if (disk->flags & GENHD_FL_UP) 2251 list_for_each (p, &sc->luns) {
2128 del_gendisk(disk); 2252 lun = list_entry(p, struct ub_lun, link);
2129 /* 2253 disk = lun->disk;
2130 * I wish I could do: 2254 if (disk->flags & GENHD_FL_UP)
2131 * set_bit(QUEUE_FLAG_DEAD, &q->queue_flags); 2255 del_gendisk(disk);
2132 * As it is, we rely on our internal poisoning and let 2256 /*
2133 * the upper levels to spin furiously failing all the I/O. 2257 * I wish I could do:
2134 */ 2258 * set_bit(QUEUE_FLAG_DEAD, &q->queue_flags);
2259 * As it is, we rely on our internal poisoning and let
2260 * the upper levels to spin furiously failing all the I/O.
2261 */
2262 }
2135 2263
2136 /* 2264 /*
2137 * Taking a lock on a structure which is about to be freed 2265 * Taking a lock on a structure which is about to be freed
@@ -2182,8 +2310,8 @@ static int __init ub_init(void)
2182{ 2310{
2183 int rc; 2311 int rc;
2184 2312
2185 /* P3 */ printk("ub: sizeof ub_scsi_cmd %zu ub_dev %zu\n", 2313 /* P3 */ printk("ub: sizeof ub_scsi_cmd %zu ub_dev %zu ub_lun %zu\n",
2186 sizeof(struct ub_scsi_cmd), sizeof(struct ub_dev)); 2314 sizeof(struct ub_scsi_cmd), sizeof(struct ub_dev), sizeof(struct ub_lun));
2187 2315
2188 if ((rc = register_blkdev(UB_MAJOR, DRV_NAME)) != 0) 2316 if ((rc = register_blkdev(UB_MAJOR, DRV_NAME)) != 0)
2189 goto err_regblkdev; 2317 goto err_regblkdev;
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index fcca26c89bbc..38dd9ffbe8bc 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -488,6 +488,20 @@ static int viocd_packet(struct cdrom_device_info *cdi,
488 & (CDC_DVD_RAM | CDC_RAM)) != 0; 488 & (CDC_DVD_RAM | CDC_RAM)) != 0;
489 } 489 }
490 break; 490 break;
491 case GPCMD_GET_CONFIGURATION:
492 if (cgc->cmd[3] == CDF_RWRT) {
493 struct rwrt_feature_desc *rfd = (struct rwrt_feature_desc *)(cgc->buffer + sizeof(struct feature_header));
494
495 if ((buflen >=
496 (sizeof(struct feature_header) + sizeof(*rfd))) &&
497 (cdi->ops->capability & ~cdi->mask
498 & (CDC_DVD_RAM | CDC_RAM))) {
499 rfd->feature_code = cpu_to_be16(CDF_RWRT);
500 rfd->curr = 1;
501 ret = 0;
502 }
503 }
504 break;
491 default: 505 default:
492 if (cgc->sense) { 506 if (cgc->sense) {
493 /* indicate Unknown code */ 507 /* indicate Unknown code */
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 5ed6515ae01f..7ccf871d3c9d 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -929,6 +929,10 @@ config SCx200_GPIO
929 929
930 If compiled as a module, it will be called scx200_gpio. 930 If compiled as a module, it will be called scx200_gpio.
931 931
932config GPIO_VR41XX
933 tristate "NEC VR4100 series General-purpose I/O Unit support"
934 depends on CPU_VR41XX
935
932config RAW_DRIVER 936config RAW_DRIVER
933 tristate "RAW driver (/dev/raw/rawN) (OBSOLETE)" 937 tristate "RAW driver (/dev/raw/rawN) (OBSOLETE)"
934 help 938 help
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index e3f5c32aac55..1aff819f3832 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -80,6 +80,7 @@ obj-$(CONFIG_PPDEV) += ppdev.o
80obj-$(CONFIG_NWBUTTON) += nwbutton.o 80obj-$(CONFIG_NWBUTTON) += nwbutton.o
81obj-$(CONFIG_NWFLASH) += nwflash.o 81obj-$(CONFIG_NWFLASH) += nwflash.o
82obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o 82obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o
83obj-$(CONFIG_GPIO_VR41XX) += vr41xx_giu.o
83obj-$(CONFIG_TANBAC_TB0219) += tb0219.o 84obj-$(CONFIG_TANBAC_TB0219) += tb0219.o
84 85
85obj-$(CONFIG_WATCHDOG) += watchdog/ 86obj-$(CONFIG_WATCHDOG) += watchdog/
diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h
index ad9c11391d81..c1fe013c64f3 100644
--- a/drivers/char/agp/agp.h
+++ b/drivers/char/agp/agp.h
@@ -278,6 +278,8 @@ void agp3_generic_cleanup(void);
278#define AGP_GENERIC_SIZES_ENTRIES 11 278#define AGP_GENERIC_SIZES_ENTRIES 11
279extern struct aper_size_info_16 agp3_generic_sizes[]; 279extern struct aper_size_info_16 agp3_generic_sizes[];
280 280
281#define virt_to_gart(x) (phys_to_gart(virt_to_phys(x)))
282#define gart_to_virt(x) (phys_to_virt(gart_to_phys(x)))
281 283
282extern int agp_off; 284extern int agp_off;
283extern int agp_try_unsupported_boot; 285extern int agp_try_unsupported_boot;
diff --git a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c
index 0212febda654..9c9c9c2247ce 100644
--- a/drivers/char/agp/ali-agp.c
+++ b/drivers/char/agp/ali-agp.c
@@ -150,7 +150,7 @@ static void *m1541_alloc_page(struct agp_bridge_data *bridge)
150 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); 150 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
151 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, 151 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
152 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | 152 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
153 virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN )); 153 virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN ));
154 return addr; 154 return addr;
155} 155}
156 156
@@ -174,7 +174,7 @@ static void m1541_destroy_page(void * addr)
174 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); 174 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
175 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, 175 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
176 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | 176 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
177 virt_to_phys(addr)) | ALI_CACHE_FLUSH_EN)); 177 virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN));
178 agp_generic_destroy_page(addr); 178 agp_generic_destroy_page(addr);
179} 179}
180 180
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c
index e62a3c2c44a9..3a41672e4d66 100644
--- a/drivers/char/agp/amd-k7-agp.c
+++ b/drivers/char/agp/amd-k7-agp.c
@@ -43,7 +43,7 @@ static int amd_create_page_map(struct amd_page_map *page_map)
43 43
44 SetPageReserved(virt_to_page(page_map->real)); 44 SetPageReserved(virt_to_page(page_map->real));
45 global_cache_flush(); 45 global_cache_flush();
46 page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), 46 page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real),
47 PAGE_SIZE); 47 PAGE_SIZE);
48 if (page_map->remapped == NULL) { 48 if (page_map->remapped == NULL) {
49 ClearPageReserved(virt_to_page(page_map->real)); 49 ClearPageReserved(virt_to_page(page_map->real));
@@ -154,7 +154,7 @@ static int amd_create_gatt_table(struct agp_bridge_data *bridge)
154 154
155 agp_bridge->gatt_table_real = (u32 *)page_dir.real; 155 agp_bridge->gatt_table_real = (u32 *)page_dir.real;
156 agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped; 156 agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
157 agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real); 157 agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real);
158 158
159 /* Get the address for the gart region. 159 /* Get the address for the gart region.
160 * This is a bus address even on the alpha, b/c its 160 * This is a bus address even on the alpha, b/c its
@@ -167,7 +167,7 @@ static int amd_create_gatt_table(struct agp_bridge_data *bridge)
167 167
168 /* Calculate the agp offset */ 168 /* Calculate the agp offset */
169 for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { 169 for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
170 writel(virt_to_phys(amd_irongate_private.gatt_pages[i]->real) | 1, 170 writel(virt_to_gart(amd_irongate_private.gatt_pages[i]->real) | 1,
171 page_dir.remapped+GET_PAGE_DIR_OFF(addr)); 171 page_dir.remapped+GET_PAGE_DIR_OFF(addr));
172 readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */ 172 readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */
173 } 173 }
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index 399c042f68f0..1407945a5892 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -219,7 +219,7 @@ static struct aper_size_info_32 amd_8151_sizes[7] =
219 219
220static int amd_8151_configure(void) 220static int amd_8151_configure(void)
221{ 221{
222 unsigned long gatt_bus = virt_to_phys(agp_bridge->gatt_table_real); 222 unsigned long gatt_bus = virt_to_gart(agp_bridge->gatt_table_real);
223 223
224 /* Configure AGP regs in each x86-64 host bridge. */ 224 /* Configure AGP regs in each x86-64 host bridge. */
225 for_each_nb() { 225 for_each_nb() {
@@ -591,7 +591,7 @@ static void __devexit agp_amd64_remove(struct pci_dev *pdev)
591{ 591{
592 struct agp_bridge_data *bridge = pci_get_drvdata(pdev); 592 struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
593 593
594 release_mem_region(virt_to_phys(bridge->gatt_table_real), 594 release_mem_region(virt_to_gart(bridge->gatt_table_real),
595 amd64_aperture_sizes[bridge->aperture_size_idx].size); 595 amd64_aperture_sizes[bridge->aperture_size_idx].size);
596 agp_remove_bridge(bridge); 596 agp_remove_bridge(bridge);
597 agp_put_bridge(bridge); 597 agp_put_bridge(bridge);
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c
index a65f8827c283..e572ced9100a 100644
--- a/drivers/char/agp/ati-agp.c
+++ b/drivers/char/agp/ati-agp.c
@@ -61,7 +61,7 @@ static int ati_create_page_map(ati_page_map *page_map)
61 61
62 SetPageReserved(virt_to_page(page_map->real)); 62 SetPageReserved(virt_to_page(page_map->real));
63 err = map_page_into_agp(virt_to_page(page_map->real)); 63 err = map_page_into_agp(virt_to_page(page_map->real));
64 page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), 64 page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real),
65 PAGE_SIZE); 65 PAGE_SIZE);
66 if (page_map->remapped == NULL || err) { 66 if (page_map->remapped == NULL || err) {
67 ClearPageReserved(virt_to_page(page_map->real)); 67 ClearPageReserved(virt_to_page(page_map->real));
@@ -343,7 +343,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge)
343 343
344 agp_bridge->gatt_table_real = (u32 *)page_dir.real; 344 agp_bridge->gatt_table_real = (u32 *)page_dir.real;
345 agp_bridge->gatt_table = (u32 __iomem *) page_dir.remapped; 345 agp_bridge->gatt_table = (u32 __iomem *) page_dir.remapped;
346 agp_bridge->gatt_bus_addr = virt_to_bus(page_dir.real); 346 agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real);
347 347
348 /* Write out the size register */ 348 /* Write out the size register */
349 current_size = A_SIZE_LVL2(agp_bridge->current_size); 349 current_size = A_SIZE_LVL2(agp_bridge->current_size);
@@ -373,7 +373,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge)
373 373
374 /* Calculate the agp offset */ 374 /* Calculate the agp offset */
375 for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { 375 for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
376 writel(virt_to_bus(ati_generic_private.gatt_pages[i]->real) | 1, 376 writel(virt_to_gart(ati_generic_private.gatt_pages[i]->real) | 1,
377 page_dir.remapped+GET_PAGE_DIR_OFF(addr)); 377 page_dir.remapped+GET_PAGE_DIR_OFF(addr));
378 readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */ 378 readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */
379 } 379 }
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
index 2f3dfb63bdc6..4d4e602fdc7e 100644
--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -148,7 +148,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
148 return -ENOMEM; 148 return -ENOMEM;
149 } 149 }
150 150
151 bridge->scratch_page_real = virt_to_phys(addr); 151 bridge->scratch_page_real = virt_to_gart(addr);
152 bridge->scratch_page = 152 bridge->scratch_page =
153 bridge->driver->mask_memory(bridge, bridge->scratch_page_real, 0); 153 bridge->driver->mask_memory(bridge, bridge->scratch_page_real, 0);
154 } 154 }
@@ -189,7 +189,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
189err_out: 189err_out:
190 if (bridge->driver->needs_scratch_page) 190 if (bridge->driver->needs_scratch_page)
191 bridge->driver->agp_destroy_page( 191 bridge->driver->agp_destroy_page(
192 phys_to_virt(bridge->scratch_page_real)); 192 gart_to_virt(bridge->scratch_page_real));
193 if (got_gatt) 193 if (got_gatt)
194 bridge->driver->free_gatt_table(bridge); 194 bridge->driver->free_gatt_table(bridge);
195 if (got_keylist) { 195 if (got_keylist) {
@@ -214,7 +214,7 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge)
214 if (bridge->driver->agp_destroy_page && 214 if (bridge->driver->agp_destroy_page &&
215 bridge->driver->needs_scratch_page) 215 bridge->driver->needs_scratch_page)
216 bridge->driver->agp_destroy_page( 216 bridge->driver->agp_destroy_page(
217 phys_to_virt(bridge->scratch_page_real)); 217 gart_to_virt(bridge->scratch_page_real));
218} 218}
219 219
220/* When we remove the global variable agp_bridge from all drivers 220/* When we remove the global variable agp_bridge from all drivers
diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c
index 1383c3165ea1..ac19fdcd21c1 100644
--- a/drivers/char/agp/efficeon-agp.c
+++ b/drivers/char/agp/efficeon-agp.c
@@ -219,7 +219,7 @@ static int efficeon_create_gatt_table(struct agp_bridge_data *bridge)
219 219
220 efficeon_private.l1_table[index] = page; 220 efficeon_private.l1_table[index] = page;
221 221
222 value = __pa(page) | pati | present | index; 222 value = virt_to_gart(page) | pati | present | index;
223 223
224 pci_write_config_dword(agp_bridge->dev, 224 pci_write_config_dword(agp_bridge->dev,
225 EFFICEON_ATTPAGE, value); 225 EFFICEON_ATTPAGE, value);
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index c321a924e38a..f0079e991bdc 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -153,7 +153,7 @@ void agp_free_memory(struct agp_memory *curr)
153 } 153 }
154 if (curr->page_count != 0) { 154 if (curr->page_count != 0) {
155 for (i = 0; i < curr->page_count; i++) { 155 for (i = 0; i < curr->page_count; i++) {
156 curr->bridge->driver->agp_destroy_page(phys_to_virt(curr->memory[i])); 156 curr->bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[i]));
157 } 157 }
158 } 158 }
159 agp_free_key(curr->key); 159 agp_free_key(curr->key);
@@ -209,7 +209,7 @@ struct agp_memory *agp_allocate_memory(struct agp_bridge_data *bridge,
209 agp_free_memory(new); 209 agp_free_memory(new);
210 return NULL; 210 return NULL;
211 } 211 }
212 new->memory[i] = virt_to_phys(addr); 212 new->memory[i] = virt_to_gart(addr);
213 new->page_count++; 213 new->page_count++;
214 } 214 }
215 new->bridge = bridge; 215 new->bridge = bridge;
@@ -295,19 +295,6 @@ int agp_num_entries(void)
295EXPORT_SYMBOL_GPL(agp_num_entries); 295EXPORT_SYMBOL_GPL(agp_num_entries);
296 296
297 297
298static int check_bridge_mode(struct pci_dev *dev)
299{
300 u32 agp3;
301 u8 cap_ptr;
302
303 cap_ptr = pci_find_capability(dev, PCI_CAP_ID_AGP);
304 pci_read_config_dword(dev, cap_ptr+AGPSTAT, &agp3);
305 if (agp3 & AGPSTAT_MODE_3_0)
306 return 1;
307 return 0;
308}
309
310
311/** 298/**
312 * agp_copy_info - copy bridge state information 299 * agp_copy_info - copy bridge state information
313 * 300 *
@@ -328,7 +315,7 @@ int agp_copy_info(struct agp_bridge_data *bridge, struct agp_kern_info *info)
328 info->version.minor = bridge->version->minor; 315 info->version.minor = bridge->version->minor;
329 info->chipset = SUPPORTED; 316 info->chipset = SUPPORTED;
330 info->device = bridge->dev; 317 info->device = bridge->dev;
331 if (check_bridge_mode(bridge->dev)) 318 if (bridge->mode & AGPSTAT_MODE_3_0)
332 info->mode = bridge->mode & ~AGP3_RESERVED_MASK; 319 info->mode = bridge->mode & ~AGP3_RESERVED_MASK;
333 else 320 else
334 info->mode = bridge->mode & ~AGP2_RESERVED_MASK; 321 info->mode = bridge->mode & ~AGP2_RESERVED_MASK;
@@ -661,7 +648,7 @@ u32 agp_collect_device_status(struct agp_bridge_data *bridge, u32 requested_mode
661 bridge_agpstat &= ~AGPSTAT_FW; 648 bridge_agpstat &= ~AGPSTAT_FW;
662 649
663 /* Check to see if we are operating in 3.0 mode */ 650 /* Check to see if we are operating in 3.0 mode */
664 if (check_bridge_mode(agp_bridge->dev)) 651 if (agp_bridge->mode & AGPSTAT_MODE_3_0)
665 agp_v3_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat); 652 agp_v3_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat);
666 else 653 else
667 agp_v2_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat); 654 agp_v2_parse_one(&requested_mode, &bridge_agpstat, &vga_agpstat);
@@ -732,7 +719,7 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode)
732 719
733 /* Do AGP version specific frobbing. */ 720 /* Do AGP version specific frobbing. */
734 if (bridge->major_version >= 3) { 721 if (bridge->major_version >= 3) {
735 if (check_bridge_mode(bridge->dev)) { 722 if (bridge->mode & AGPSTAT_MODE_3_0) {
736 /* If we have 3.5, we can do the isoch stuff. */ 723 /* If we have 3.5, we can do the isoch stuff. */
737 if (bridge->minor_version >= 5) 724 if (bridge->minor_version >= 5)
738 agp_3_5_enable(bridge); 725 agp_3_5_enable(bridge);
@@ -806,8 +793,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
806 break; 793 break;
807 } 794 }
808 795
809 table = (char *) __get_free_pages(GFP_KERNEL, 796 table = alloc_gatt_pages(page_order);
810 page_order);
811 797
812 if (table == NULL) { 798 if (table == NULL) {
813 i++; 799 i++;
@@ -838,7 +824,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
838 size = ((struct aper_size_info_fixed *) temp)->size; 824 size = ((struct aper_size_info_fixed *) temp)->size;
839 page_order = ((struct aper_size_info_fixed *) temp)->page_order; 825 page_order = ((struct aper_size_info_fixed *) temp)->page_order;
840 num_entries = ((struct aper_size_info_fixed *) temp)->num_entries; 826 num_entries = ((struct aper_size_info_fixed *) temp)->num_entries;
841 table = (char *) __get_free_pages(GFP_KERNEL, page_order); 827 table = alloc_gatt_pages(page_order);
842 } 828 }
843 829
844 if (table == NULL) 830 if (table == NULL)
@@ -853,7 +839,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
853 agp_gatt_table = (void *)table; 839 agp_gatt_table = (void *)table;
854 840
855 bridge->driver->cache_flush(); 841 bridge->driver->cache_flush();
856 bridge->gatt_table = ioremap_nocache(virt_to_phys(table), 842 bridge->gatt_table = ioremap_nocache(virt_to_gart(table),
857 (PAGE_SIZE * (1 << page_order))); 843 (PAGE_SIZE * (1 << page_order)));
858 bridge->driver->cache_flush(); 844 bridge->driver->cache_flush();
859 845
@@ -861,11 +847,11 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
861 for (page = virt_to_page(table); page <= virt_to_page(table_end); page++) 847 for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
862 ClearPageReserved(page); 848 ClearPageReserved(page);
863 849
864 free_pages((unsigned long) table, page_order); 850 free_gatt_pages(table, page_order);
865 851
866 return -ENOMEM; 852 return -ENOMEM;
867 } 853 }
868 bridge->gatt_bus_addr = virt_to_phys(bridge->gatt_table_real); 854 bridge->gatt_bus_addr = virt_to_gart(bridge->gatt_table_real);
869 855
870 /* AK: bogus, should encode addresses > 4GB */ 856 /* AK: bogus, should encode addresses > 4GB */
871 for (i = 0; i < num_entries; i++) { 857 for (i = 0; i < num_entries; i++) {
@@ -919,7 +905,7 @@ int agp_generic_free_gatt_table(struct agp_bridge_data *bridge)
919 for (page = virt_to_page(table); page <= virt_to_page(table_end); page++) 905 for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
920 ClearPageReserved(page); 906 ClearPageReserved(page);
921 907
922 free_pages((unsigned long) bridge->gatt_table_real, page_order); 908 free_gatt_pages(bridge->gatt_table_real, page_order);
923 909
924 agp_gatt_table = NULL; 910 agp_gatt_table = NULL;
925 bridge->gatt_table = NULL; 911 bridge->gatt_table = NULL;
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c
index 6052bfa04c72..99762b6c19ae 100644
--- a/drivers/char/agp/hp-agp.c
+++ b/drivers/char/agp/hp-agp.c
@@ -110,7 +110,7 @@ static int __init hp_zx1_ioc_shared(void)
110 hp->gart_size = HP_ZX1_GART_SIZE; 110 hp->gart_size = HP_ZX1_GART_SIZE;
111 hp->gatt_entries = hp->gart_size / hp->io_page_size; 111 hp->gatt_entries = hp->gart_size / hp->io_page_size;
112 112
113 hp->io_pdir = phys_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE)); 113 hp->io_pdir = gart_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE));
114 hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)]; 114 hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)];
115 115
116 if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) { 116 if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) {
@@ -248,7 +248,7 @@ hp_zx1_configure (void)
248 agp_bridge->mode = readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS); 248 agp_bridge->mode = readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS);
249 249
250 if (hp->io_pdir_owner) { 250 if (hp->io_pdir_owner) {
251 writel(virt_to_phys(hp->io_pdir), hp->ioc_regs+HP_ZX1_PDIR_BASE); 251 writel(virt_to_gart(hp->io_pdir), hp->ioc_regs+HP_ZX1_PDIR_BASE);
252 readl(hp->ioc_regs+HP_ZX1_PDIR_BASE); 252 readl(hp->ioc_regs+HP_ZX1_PDIR_BASE);
253 writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG); 253 writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG);
254 readl(hp->ioc_regs+HP_ZX1_TCNFG); 254 readl(hp->ioc_regs+HP_ZX1_TCNFG);
diff --git a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c
index adbea896c0d2..94943298c03e 100644
--- a/drivers/char/agp/i460-agp.c
+++ b/drivers/char/agp/i460-agp.c
@@ -372,7 +372,7 @@ static int i460_alloc_large_page (struct lp_desc *lp)
372 } 372 }
373 memset(lp->alloced_map, 0, map_size); 373 memset(lp->alloced_map, 0, map_size);
374 374
375 lp->paddr = virt_to_phys(lpage); 375 lp->paddr = virt_to_gart(lpage);
376 lp->refcount = 0; 376 lp->refcount = 0;
377 atomic_add(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp); 377 atomic_add(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp);
378 return 0; 378 return 0;
@@ -383,7 +383,7 @@ static void i460_free_large_page (struct lp_desc *lp)
383 kfree(lp->alloced_map); 383 kfree(lp->alloced_map);
384 lp->alloced_map = NULL; 384 lp->alloced_map = NULL;
385 385
386 free_pages((unsigned long) phys_to_virt(lp->paddr), I460_IO_PAGE_SHIFT - PAGE_SHIFT); 386 free_pages((unsigned long) gart_to_virt(lp->paddr), I460_IO_PAGE_SHIFT - PAGE_SHIFT);
387 atomic_sub(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp); 387 atomic_sub(I460_KPAGES_PER_IOPAGE, &agp_bridge->current_memory_agp);
388} 388}
389 389
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 8c7d727432bb..51266d6b4d78 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -286,7 +286,7 @@ static struct agp_memory *alloc_agpphysmem_i8xx(size_t pg_count, int type)
286 if (new == NULL) 286 if (new == NULL)
287 return NULL; 287 return NULL;
288 288
289 new->memory[0] = virt_to_phys(addr); 289 new->memory[0] = virt_to_gart(addr);
290 if (pg_count == 4) { 290 if (pg_count == 4) {
291 /* kludge to get 4 physical pages for ARGB cursor */ 291 /* kludge to get 4 physical pages for ARGB cursor */
292 new->memory[1] = new->memory[0] + PAGE_SIZE; 292 new->memory[1] = new->memory[0] + PAGE_SIZE;
@@ -329,10 +329,10 @@ static void intel_i810_free_by_type(struct agp_memory *curr)
329 agp_free_key(curr->key); 329 agp_free_key(curr->key);
330 if(curr->type == AGP_PHYS_MEMORY) { 330 if(curr->type == AGP_PHYS_MEMORY) {
331 if (curr->page_count == 4) 331 if (curr->page_count == 4)
332 i8xx_destroy_pages(phys_to_virt(curr->memory[0])); 332 i8xx_destroy_pages(gart_to_virt(curr->memory[0]));
333 else 333 else
334 agp_bridge->driver->agp_destroy_page( 334 agp_bridge->driver->agp_destroy_page(
335 phys_to_virt(curr->memory[0])); 335 gart_to_virt(curr->memory[0]));
336 vfree(curr->memory); 336 vfree(curr->memory);
337 } 337 }
338 kfree(curr); 338 kfree(curr);
@@ -418,7 +418,8 @@ static void intel_i830_init_gtt_entries(void)
418 case I915_GMCH_GMS_STOLEN_48M: 418 case I915_GMCH_GMS_STOLEN_48M:
419 /* Check it's really I915G */ 419 /* Check it's really I915G */
420 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || 420 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB ||
421 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) 421 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB ||
422 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB)
422 gtt_entries = MB(48) - KB(size); 423 gtt_entries = MB(48) - KB(size);
423 else 424 else
424 gtt_entries = 0; 425 gtt_entries = 0;
@@ -426,7 +427,8 @@ static void intel_i830_init_gtt_entries(void)
426 case I915_GMCH_GMS_STOLEN_64M: 427 case I915_GMCH_GMS_STOLEN_64M:
427 /* Check it's really I915G */ 428 /* Check it's really I915G */
428 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || 429 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB ||
429 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) 430 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB ||
431 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB)
430 gtt_entries = MB(64) - KB(size); 432 gtt_entries = MB(64) - KB(size);
431 else 433 else
432 gtt_entries = 0; 434 gtt_entries = 0;
@@ -1662,6 +1664,14 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1662 } 1664 }
1663 name = "915GM"; 1665 name = "915GM";
1664 break; 1666 break;
1667 case PCI_DEVICE_ID_INTEL_82945G_HB:
1668 if (find_i830(PCI_DEVICE_ID_INTEL_82945G_IG)) {
1669 bridge->driver = &intel_915_driver;
1670 } else {
1671 bridge->driver = &intel_845_driver;
1672 }
1673 name = "945G";
1674 break;
1665 case PCI_DEVICE_ID_INTEL_7505_0: 1675 case PCI_DEVICE_ID_INTEL_7505_0:
1666 bridge->driver = &intel_7505_driver; 1676 bridge->driver = &intel_7505_driver;
1667 name = "E7505"; 1677 name = "E7505";
@@ -1801,6 +1811,7 @@ static struct pci_device_id agp_intel_pci_table[] = {
1801 ID(PCI_DEVICE_ID_INTEL_7205_0), 1811 ID(PCI_DEVICE_ID_INTEL_7205_0),
1802 ID(PCI_DEVICE_ID_INTEL_82915G_HB), 1812 ID(PCI_DEVICE_ID_INTEL_82915G_HB),
1803 ID(PCI_DEVICE_ID_INTEL_82915GM_HB), 1813 ID(PCI_DEVICE_ID_INTEL_82915GM_HB),
1814 ID(PCI_DEVICE_ID_INTEL_82945G_HB),
1804 { } 1815 { }
1805}; 1816};
1806 1817
diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c
index 4b3eda267976..d3aa159c9dec 100644
--- a/drivers/char/agp/sgi-agp.c
+++ b/drivers/char/agp/sgi-agp.c
@@ -133,11 +133,14 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
133 off_t j; 133 off_t j;
134 void *temp; 134 void *temp;
135 struct agp_bridge_data *bridge; 135 struct agp_bridge_data *bridge;
136 u64 *table;
136 137
137 bridge = mem->bridge; 138 bridge = mem->bridge;
138 if (!bridge) 139 if (!bridge)
139 return -EINVAL; 140 return -EINVAL;
140 141
142 table = (u64 *)bridge->gatt_table;
143
141 temp = bridge->current_size; 144 temp = bridge->current_size;
142 145
143 switch (bridge->driver->size_type) { 146 switch (bridge->driver->size_type) {
@@ -175,7 +178,7 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
175 j = pg_start; 178 j = pg_start;
176 179
177 while (j < (pg_start + mem->page_count)) { 180 while (j < (pg_start + mem->page_count)) {
178 if (*(bridge->gatt_table + j)) 181 if (table[j])
179 return -EBUSY; 182 return -EBUSY;
180 j++; 183 j++;
181 } 184 }
@@ -186,7 +189,7 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
186 } 189 }
187 190
188 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { 191 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
189 *(bridge->gatt_table + j) = 192 table[j] =
190 bridge->driver->mask_memory(bridge, mem->memory[i], 193 bridge->driver->mask_memory(bridge, mem->memory[i],
191 mem->type); 194 mem->type);
192 } 195 }
@@ -200,6 +203,7 @@ static int sgi_tioca_remove_memory(struct agp_memory *mem, off_t pg_start,
200{ 203{
201 size_t i; 204 size_t i;
202 struct agp_bridge_data *bridge; 205 struct agp_bridge_data *bridge;
206 u64 *table;
203 207
204 bridge = mem->bridge; 208 bridge = mem->bridge;
205 if (!bridge) 209 if (!bridge)
@@ -209,8 +213,10 @@ static int sgi_tioca_remove_memory(struct agp_memory *mem, off_t pg_start,
209 return -EINVAL; 213 return -EINVAL;
210 } 214 }
211 215
216 table = (u64 *)bridge->gatt_table;
217
212 for (i = pg_start; i < (mem->page_count + pg_start); i++) { 218 for (i = pg_start; i < (mem->page_count + pg_start); i++) {
213 *(bridge->gatt_table + i) = 0; 219 table[i] = 0;
214 } 220 }
215 221
216 bridge->driver->tlb_flush(mem); 222 bridge->driver->tlb_flush(mem);
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index 10c23302dd84..a9fb12c20eb7 100644
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
@@ -51,7 +51,7 @@ static int serverworks_create_page_map(struct serverworks_page_map *page_map)
51 } 51 }
52 SetPageReserved(virt_to_page(page_map->real)); 52 SetPageReserved(virt_to_page(page_map->real));
53 global_cache_flush(); 53 global_cache_flush();
54 page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), 54 page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real),
55 PAGE_SIZE); 55 PAGE_SIZE);
56 if (page_map->remapped == NULL) { 56 if (page_map->remapped == NULL) {
57 ClearPageReserved(virt_to_page(page_map->real)); 57 ClearPageReserved(virt_to_page(page_map->real));
@@ -162,7 +162,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge)
162 /* Create a fake scratch directory */ 162 /* Create a fake scratch directory */
163 for(i = 0; i < 1024; i++) { 163 for(i = 0; i < 1024; i++) {
164 writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i); 164 writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i);
165 writel(virt_to_phys(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i); 165 writel(virt_to_gart(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i);
166 } 166 }
167 167
168 retval = serverworks_create_gatt_pages(value->num_entries / 1024); 168 retval = serverworks_create_gatt_pages(value->num_entries / 1024);
@@ -174,7 +174,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge)
174 174
175 agp_bridge->gatt_table_real = (u32 *)page_dir.real; 175 agp_bridge->gatt_table_real = (u32 *)page_dir.real;
176 agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped; 176 agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
177 agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real); 177 agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real);
178 178
179 /* Get the address for the gart region. 179 /* Get the address for the gart region.
180 * This is a bus address even on the alpha, b/c its 180 * This is a bus address even on the alpha, b/c its
@@ -187,7 +187,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge)
187 /* Calculate the agp offset */ 187 /* Calculate the agp offset */
188 188
189 for(i = 0; i < value->num_entries / 1024; i++) 189 for(i = 0; i < value->num_entries / 1024; i++)
190 writel(virt_to_phys(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i); 190 writel(virt_to_gart(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i);
191 191
192 return 0; 192 return 0;
193} 193}
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index a673971f2a90..c8255312b8c1 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -407,7 +407,7 @@ static int uninorth_create_gatt_table(struct agp_bridge_data *bridge)
407 407
408 bridge->gatt_table_real = (u32 *) table; 408 bridge->gatt_table_real = (u32 *) table;
409 bridge->gatt_table = (u32 *)table; 409 bridge->gatt_table = (u32 *)table;
410 bridge->gatt_bus_addr = virt_to_phys(table); 410 bridge->gatt_bus_addr = virt_to_gart(table);
411 411
412 for (i = 0; i < num_entries; i++) 412 for (i = 0; i < num_entries; i++)
413 bridge->gatt_table[i] = 0; 413 bridge->gatt_table[i] = 0;
diff --git a/drivers/char/drm/drm_pciids.h b/drivers/char/drm/drm_pciids.h
index 54a2914e3a32..11c6950158b3 100644
--- a/drivers/char/drm/drm_pciids.h
+++ b/drivers/char/drm/drm_pciids.h
@@ -220,5 +220,6 @@
220 {0x8086, 0x2572, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 220 {0x8086, 0x2572, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
221 {0x8086, 0x2582, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 221 {0x8086, 0x2582, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
222 {0x8086, 0x2592, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 222 {0x8086, 0x2592, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
223 {0x8086, 0x2772, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
223 {0, 0, 0} 224 {0, 0, 0}
224 225
diff --git a/drivers/char/drm/radeon_irq.c b/drivers/char/drm/radeon_irq.c
index 5b18bee6492e..cd25f28e26a3 100644
--- a/drivers/char/drm/radeon_irq.c
+++ b/drivers/char/drm/radeon_irq.c
@@ -123,11 +123,6 @@ static int radeon_wait_irq(drm_device_t *dev, int swi_nr)
123 123
124 dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; 124 dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE;
125 125
126 /* This is a hack to work around mysterious freezes on certain
127 * systems:
128 */
129 radeon_acknowledge_irqs( dev_priv );
130
131 DRM_WAIT_ON( ret, dev_priv->swi_queue, 3 * DRM_HZ, 126 DRM_WAIT_ON( ret, dev_priv->swi_queue, 3 * DRM_HZ,
132 RADEON_READ( RADEON_LAST_SWI_REG ) >= swi_nr ); 127 RADEON_READ( RADEON_LAST_SWI_REG ) >= swi_nr );
133 128
diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c
index 37d6649011ad..26271e3ca823 100644
--- a/drivers/char/dsp56k.c
+++ b/drivers/char/dsp56k.c
@@ -144,7 +144,7 @@ static struct dsp56k_device {
144 int tx_wsize, rx_wsize; 144 int tx_wsize, rx_wsize;
145} dsp56k; 145} dsp56k;
146 146
147static struct class_simple *dsp56k_class; 147static struct class *dsp56k_class;
148 148
149static int dsp56k_reset(void) 149static int dsp56k_reset(void)
150{ 150{
@@ -510,12 +510,12 @@ static int __init dsp56k_init_driver(void)
510 printk("DSP56k driver: Unable to register driver\n"); 510 printk("DSP56k driver: Unable to register driver\n");
511 return -ENODEV; 511 return -ENODEV;
512 } 512 }
513 dsp56k_class = class_simple_create(THIS_MODULE, "dsp56k"); 513 dsp56k_class = class_create(THIS_MODULE, "dsp56k");
514 if (IS_ERR(dsp56k_class)) { 514 if (IS_ERR(dsp56k_class)) {
515 err = PTR_ERR(dsp56k_class); 515 err = PTR_ERR(dsp56k_class);
516 goto out_chrdev; 516 goto out_chrdev;
517 } 517 }
518 class_simple_device_add(dsp56k_class, MKDEV(DSP56K_MAJOR, 0), NULL, "dsp56k"); 518 class_device_create(dsp56k_class, MKDEV(DSP56K_MAJOR, 0), NULL, "dsp56k");
519 519
520 err = devfs_mk_cdev(MKDEV(DSP56K_MAJOR, 0), 520 err = devfs_mk_cdev(MKDEV(DSP56K_MAJOR, 0),
521 S_IFCHR | S_IRUSR | S_IWUSR, "dsp56k"); 521 S_IFCHR | S_IRUSR | S_IWUSR, "dsp56k");
@@ -526,8 +526,8 @@ static int __init dsp56k_init_driver(void)
526 goto out; 526 goto out;
527 527
528out_class: 528out_class:
529 class_simple_device_remove(MKDEV(DSP56K_MAJOR, 0)); 529 class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0));
530 class_simple_destroy(dsp56k_class); 530 class_destroy(dsp56k_class);
531out_chrdev: 531out_chrdev:
532 unregister_chrdev(DSP56K_MAJOR, "dsp56k"); 532 unregister_chrdev(DSP56K_MAJOR, "dsp56k");
533out: 533out:
@@ -537,8 +537,8 @@ module_init(dsp56k_init_driver);
537 537
538static void __exit dsp56k_cleanup_driver(void) 538static void __exit dsp56k_cleanup_driver(void)
539{ 539{
540 class_simple_device_remove(MKDEV(DSP56K_MAJOR, 0)); 540 class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0));
541 class_simple_destroy(dsp56k_class); 541 class_destroy(dsp56k_class);
542 unregister_chrdev(DSP56K_MAJOR, "dsp56k"); 542 unregister_chrdev(DSP56K_MAJOR, "dsp56k");
543 devfs_remove("dsp56k"); 543 devfs_remove("dsp56k");
544} 544}
diff --git a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c
index dbac7e54e8e0..5745b74044ec 100644
--- a/drivers/char/ftape/zftape/zftape-init.c
+++ b/drivers/char/ftape/zftape/zftape-init.c
@@ -99,7 +99,7 @@ static struct file_operations zft_cdev =
99 .release = zft_close, 99 .release = zft_close,
100}; 100};
101 101
102static struct class_simple *zft_class; 102static struct class *zft_class;
103 103
104/* Open floppy tape device 104/* Open floppy tape device
105 */ 105 */
@@ -329,29 +329,29 @@ KERN_INFO
329 "installing zftape VFS interface for ftape driver ..."); 329 "installing zftape VFS interface for ftape driver ...");
330 TRACE_CATCH(register_chrdev(QIC117_TAPE_MAJOR, "zft", &zft_cdev),); 330 TRACE_CATCH(register_chrdev(QIC117_TAPE_MAJOR, "zft", &zft_cdev),);
331 331
332 zft_class = class_simple_create(THIS_MODULE, "zft"); 332 zft_class = class_create(THIS_MODULE, "zft");
333 for (i = 0; i < 4; i++) { 333 for (i = 0; i < 4; i++) {
334 class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i), NULL, "qft%i", i); 334 class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i), NULL, "qft%i", i);
335 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i), 335 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i),
336 S_IFCHR | S_IRUSR | S_IWUSR, 336 S_IFCHR | S_IRUSR | S_IWUSR,
337 "qft%i", i); 337 "qft%i", i);
338 class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 4), NULL, "nqft%i", i); 338 class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 4), NULL, "nqft%i", i);
339 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 4), 339 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 4),
340 S_IFCHR | S_IRUSR | S_IWUSR, 340 S_IFCHR | S_IRUSR | S_IWUSR,
341 "nqft%i", i); 341 "nqft%i", i);
342 class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 16), NULL, "zqft%i", i); 342 class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 16), NULL, "zqft%i", i);
343 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 16), 343 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 16),
344 S_IFCHR | S_IRUSR | S_IWUSR, 344 S_IFCHR | S_IRUSR | S_IWUSR,
345 "zqft%i", i); 345 "zqft%i", i);
346 class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 20), NULL, "nzqft%i", i); 346 class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 20), NULL, "nzqft%i", i);
347 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 20), 347 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 20),
348 S_IFCHR | S_IRUSR | S_IWUSR, 348 S_IFCHR | S_IRUSR | S_IWUSR,
349 "nzqft%i", i); 349 "nzqft%i", i);
350 class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 32), NULL, "rawqft%i", i); 350 class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 32), NULL, "rawqft%i", i);
351 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 32), 351 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 32),
352 S_IFCHR | S_IRUSR | S_IWUSR, 352 S_IFCHR | S_IRUSR | S_IWUSR,
353 "rawqft%i", i); 353 "rawqft%i", i);
354 class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 36), NULL, "nrawrawqft%i", i); 354 class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 36), NULL, "nrawrawqft%i", i);
355 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 36), 355 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 36),
356 S_IFCHR | S_IRUSR | S_IWUSR, 356 S_IFCHR | S_IRUSR | S_IWUSR,
357 "nrawqft%i", i); 357 "nrawqft%i", i);
@@ -381,19 +381,19 @@ static void zft_exit(void)
381 } 381 }
382 for (i = 0; i < 4; i++) { 382 for (i = 0; i < 4; i++) {
383 devfs_remove("qft%i", i); 383 devfs_remove("qft%i", i);
384 class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i)); 384 class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i));
385 devfs_remove("nqft%i", i); 385 devfs_remove("nqft%i", i);
386 class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 4)); 386 class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 4));
387 devfs_remove("zqft%i", i); 387 devfs_remove("zqft%i", i);
388 class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 16)); 388 class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 16));
389 devfs_remove("nzqft%i", i); 389 devfs_remove("nzqft%i", i);
390 class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 20)); 390 class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 20));
391 devfs_remove("rawqft%i", i); 391 devfs_remove("rawqft%i", i);
392 class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 32)); 392 class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 32));
393 devfs_remove("nrawqft%i", i); 393 devfs_remove("nrawqft%i", i);
394 class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 36)); 394 class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 36));
395 } 395 }
396 class_simple_destroy(zft_class); 396 class_destroy(zft_class);
397 zft_uninit_mem(); /* release remaining memory, if any */ 397 zft_uninit_mem(); /* release remaining memory, if any */
398 printk(KERN_INFO "zftape successfully unloaded.\n"); 398 printk(KERN_INFO "zftape successfully unloaded.\n");
399 TRACE_EXIT; 399 TRACE_EXIT;
diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c
index abfbdcfd4e72..3236d2404905 100644
--- a/drivers/char/hvcs.c
+++ b/drivers/char/hvcs.c
@@ -1466,7 +1466,7 @@ static inline struct hvcs_struct *from_vio_dev(struct vio_dev *viod)
1466} 1466}
1467/* The sysfs interface for the driver and devices */ 1467/* The sysfs interface for the driver and devices */
1468 1468
1469static ssize_t hvcs_partner_vtys_show(struct device *dev, char *buf) 1469static ssize_t hvcs_partner_vtys_show(struct device *dev, struct device_attribute *attr, char *buf)
1470{ 1470{
1471 struct vio_dev *viod = to_vio_dev(dev); 1471 struct vio_dev *viod = to_vio_dev(dev);
1472 struct hvcs_struct *hvcsd = from_vio_dev(viod); 1472 struct hvcs_struct *hvcsd = from_vio_dev(viod);
@@ -1480,7 +1480,7 @@ static ssize_t hvcs_partner_vtys_show(struct device *dev, char *buf)
1480} 1480}
1481static DEVICE_ATTR(partner_vtys, S_IRUGO, hvcs_partner_vtys_show, NULL); 1481static DEVICE_ATTR(partner_vtys, S_IRUGO, hvcs_partner_vtys_show, NULL);
1482 1482
1483static ssize_t hvcs_partner_clcs_show(struct device *dev, char *buf) 1483static ssize_t hvcs_partner_clcs_show(struct device *dev, struct device_attribute *attr, char *buf)
1484{ 1484{
1485 struct vio_dev *viod = to_vio_dev(dev); 1485 struct vio_dev *viod = to_vio_dev(dev);
1486 struct hvcs_struct *hvcsd = from_vio_dev(viod); 1486 struct hvcs_struct *hvcsd = from_vio_dev(viod);
@@ -1494,7 +1494,7 @@ static ssize_t hvcs_partner_clcs_show(struct device *dev, char *buf)
1494} 1494}
1495static DEVICE_ATTR(partner_clcs, S_IRUGO, hvcs_partner_clcs_show, NULL); 1495static DEVICE_ATTR(partner_clcs, S_IRUGO, hvcs_partner_clcs_show, NULL);
1496 1496
1497static ssize_t hvcs_current_vty_store(struct device *dev, const char * buf, 1497static ssize_t hvcs_current_vty_store(struct device *dev, struct device_attribute *attr, const char * buf,
1498 size_t count) 1498 size_t count)
1499{ 1499{
1500 /* 1500 /*
@@ -1505,7 +1505,7 @@ static ssize_t hvcs_current_vty_store(struct device *dev, const char * buf,
1505 return -EPERM; 1505 return -EPERM;
1506} 1506}
1507 1507
1508static ssize_t hvcs_current_vty_show(struct device *dev, char *buf) 1508static ssize_t hvcs_current_vty_show(struct device *dev, struct device_attribute *attr, char *buf)
1509{ 1509{
1510 struct vio_dev *viod = to_vio_dev(dev); 1510 struct vio_dev *viod = to_vio_dev(dev);
1511 struct hvcs_struct *hvcsd = from_vio_dev(viod); 1511 struct hvcs_struct *hvcsd = from_vio_dev(viod);
@@ -1521,7 +1521,7 @@ static ssize_t hvcs_current_vty_show(struct device *dev, char *buf)
1521static DEVICE_ATTR(current_vty, 1521static DEVICE_ATTR(current_vty,
1522 S_IRUGO | S_IWUSR, hvcs_current_vty_show, hvcs_current_vty_store); 1522 S_IRUGO | S_IWUSR, hvcs_current_vty_show, hvcs_current_vty_store);
1523 1523
1524static ssize_t hvcs_vterm_state_store(struct device *dev, const char *buf, 1524static ssize_t hvcs_vterm_state_store(struct device *dev, struct device_attribute *attr, const char *buf,
1525 size_t count) 1525 size_t count)
1526{ 1526{
1527 struct vio_dev *viod = to_vio_dev(dev); 1527 struct vio_dev *viod = to_vio_dev(dev);
@@ -1559,7 +1559,7 @@ static ssize_t hvcs_vterm_state_store(struct device *dev, const char *buf,
1559 return count; 1559 return count;
1560} 1560}
1561 1561
1562static ssize_t hvcs_vterm_state_show(struct device *dev, char *buf) 1562static ssize_t hvcs_vterm_state_show(struct device *dev, struct device_attribute *attr, char *buf)
1563{ 1563{
1564 struct vio_dev *viod = to_vio_dev(dev); 1564 struct vio_dev *viod = to_vio_dev(dev);
1565 struct hvcs_struct *hvcsd = from_vio_dev(viod); 1565 struct hvcs_struct *hvcsd = from_vio_dev(viod);
@@ -1574,7 +1574,7 @@ static ssize_t hvcs_vterm_state_show(struct device *dev, char *buf)
1574static DEVICE_ATTR(vterm_state, S_IRUGO | S_IWUSR, 1574static DEVICE_ATTR(vterm_state, S_IRUGO | S_IWUSR,
1575 hvcs_vterm_state_show, hvcs_vterm_state_store); 1575 hvcs_vterm_state_show, hvcs_vterm_state_store);
1576 1576
1577static ssize_t hvcs_index_show(struct device *dev, char *buf) 1577static ssize_t hvcs_index_show(struct device *dev, struct device_attribute *attr, char *buf)
1578{ 1578{
1579 struct vio_dev *viod = to_vio_dev(dev); 1579 struct vio_dev *viod = to_vio_dev(dev);
1580 struct hvcs_struct *hvcsd = from_vio_dev(viod); 1580 struct hvcs_struct *hvcsd = from_vio_dev(viod);
diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c
index fca9a978fb73..3b8314b4249a 100644
--- a/drivers/char/ip2main.c
+++ b/drivers/char/ip2main.c
@@ -302,7 +302,7 @@ static char rirqs[IP2_MAX_BOARDS];
302static int Valid_Irqs[] = { 3, 4, 5, 7, 10, 11, 12, 15, 0}; 302static int Valid_Irqs[] = { 3, 4, 5, 7, 10, 11, 12, 15, 0};
303 303
304/* for sysfs class support */ 304/* for sysfs class support */
305static struct class_simple *ip2_class; 305static struct class *ip2_class;
306 306
307// Some functions to keep track of what irq's we have 307// Some functions to keep track of what irq's we have
308 308
@@ -414,9 +414,9 @@ cleanup_module(void)
414 iiResetDelay( i2BoardPtrTable[i] ); 414 iiResetDelay( i2BoardPtrTable[i] );
415 /* free io addresses and Tibet */ 415 /* free io addresses and Tibet */
416 release_region( ip2config.addr[i], 8 ); 416 release_region( ip2config.addr[i], 8 );
417 class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 4 * i)); 417 class_device_destroy(ip2_class, MKDEV(IP2_IPL_MAJOR, 4 * i));
418 devfs_remove("ip2/ipl%d", i); 418 devfs_remove("ip2/ipl%d", i);
419 class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 4 * i + 1)); 419 class_device_destroy(ip2_class, MKDEV(IP2_IPL_MAJOR, 4 * i + 1));
420 devfs_remove("ip2/stat%d", i); 420 devfs_remove("ip2/stat%d", i);
421 } 421 }
422 /* Disable and remove interrupt handler. */ 422 /* Disable and remove interrupt handler. */
@@ -425,7 +425,7 @@ cleanup_module(void)
425 clear_requested_irq( ip2config.irq[i]); 425 clear_requested_irq( ip2config.irq[i]);
426 } 426 }
427 } 427 }
428 class_simple_destroy(ip2_class); 428 class_destroy(ip2_class);
429 devfs_remove("ip2"); 429 devfs_remove("ip2");
430 if ( ( err = tty_unregister_driver ( ip2_tty_driver ) ) ) { 430 if ( ( err = tty_unregister_driver ( ip2_tty_driver ) ) ) {
431 printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err); 431 printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err);
@@ -700,7 +700,7 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
700 printk(KERN_ERR "IP2: failed to register IPL device (%d)\n", err ); 700 printk(KERN_ERR "IP2: failed to register IPL device (%d)\n", err );
701 } else { 701 } else {
702 /* create the sysfs class */ 702 /* create the sysfs class */
703 ip2_class = class_simple_create(THIS_MODULE, "ip2"); 703 ip2_class = class_create(THIS_MODULE, "ip2");
704 if (IS_ERR(ip2_class)) { 704 if (IS_ERR(ip2_class)) {
705 err = PTR_ERR(ip2_class); 705 err = PTR_ERR(ip2_class);
706 goto out_chrdev; 706 goto out_chrdev;
@@ -722,25 +722,25 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
722 } 722 }
723 723
724 if ( NULL != ( pB = i2BoardPtrTable[i] ) ) { 724 if ( NULL != ( pB = i2BoardPtrTable[i] ) ) {
725 class_simple_device_add(ip2_class, MKDEV(IP2_IPL_MAJOR, 725 class_device_create(ip2_class, MKDEV(IP2_IPL_MAJOR,
726 4 * i), NULL, "ipl%d", i); 726 4 * i), NULL, "ipl%d", i);
727 err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i), 727 err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i),
728 S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, 728 S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
729 "ip2/ipl%d", i); 729 "ip2/ipl%d", i);
730 if (err) { 730 if (err) {
731 class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 731 class_device_destroy(ip2_class,
732 4 * i)); 732 MKDEV(IP2_IPL_MAJOR, 4 * i));
733 goto out_class; 733 goto out_class;
734 } 734 }
735 735
736 class_simple_device_add(ip2_class, MKDEV(IP2_IPL_MAJOR, 736 class_device_create(ip2_class, MKDEV(IP2_IPL_MAJOR,
737 4 * i + 1), NULL, "stat%d", i); 737 4 * i + 1), NULL, "stat%d", i);
738 err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i + 1), 738 err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i + 1),
739 S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, 739 S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
740 "ip2/stat%d", i); 740 "ip2/stat%d", i);
741 if (err) { 741 if (err) {
742 class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 742 class_device_destroy(ip2_class,
743 4 * i + 1)); 743 MKDEV(IP2_IPL_MAJOR, 4 * i + 1));
744 goto out_class; 744 goto out_class;
745 } 745 }
746 746
@@ -798,7 +798,7 @@ retry:
798 goto out; 798 goto out;
799 799
800out_class: 800out_class:
801 class_simple_destroy(ip2_class); 801 class_destroy(ip2_class);
802out_chrdev: 802out_chrdev:
803 unregister_chrdev(IP2_IPL_MAJOR, "ip2"); 803 unregister_chrdev(IP2_IPL_MAJOR, "ip2");
804out: 804out:
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index 6dc765dc5413..88d1ad656e99 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -520,7 +520,7 @@ MODULE_PARM_DESC(ipmi_major, "Sets the major number of the IPMI device. By"
520 " interface. Other values will set the major device number" 520 " interface. Other values will set the major device number"
521 " to that value."); 521 " to that value.");
522 522
523static struct class_simple *ipmi_class; 523static struct class *ipmi_class;
524 524
525static void ipmi_new_smi(int if_num) 525static void ipmi_new_smi(int if_num)
526{ 526{
@@ -529,12 +529,12 @@ static void ipmi_new_smi(int if_num)
529 devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR, 529 devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR,
530 "ipmidev/%d", if_num); 530 "ipmidev/%d", if_num);
531 531
532 class_simple_device_add(ipmi_class, dev, NULL, "ipmi%d", if_num); 532 class_device_create(ipmi_class, dev, NULL, "ipmi%d", if_num);
533} 533}
534 534
535static void ipmi_smi_gone(int if_num) 535static void ipmi_smi_gone(int if_num)
536{ 536{
537 class_simple_device_remove(MKDEV(ipmi_major, if_num)); 537 class_device_destroy(ipmi_class, MKDEV(ipmi_major, if_num));
538 devfs_remove("ipmidev/%d", if_num); 538 devfs_remove("ipmidev/%d", if_num);
539} 539}
540 540
@@ -555,7 +555,7 @@ static __init int init_ipmi_devintf(void)
555 printk(KERN_INFO "ipmi device interface version " 555 printk(KERN_INFO "ipmi device interface version "
556 IPMI_DEVINTF_VERSION "\n"); 556 IPMI_DEVINTF_VERSION "\n");
557 557
558 ipmi_class = class_simple_create(THIS_MODULE, "ipmi"); 558 ipmi_class = class_create(THIS_MODULE, "ipmi");
559 if (IS_ERR(ipmi_class)) { 559 if (IS_ERR(ipmi_class)) {
560 printk(KERN_ERR "ipmi: can't register device class\n"); 560 printk(KERN_ERR "ipmi: can't register device class\n");
561 return PTR_ERR(ipmi_class); 561 return PTR_ERR(ipmi_class);
@@ -563,7 +563,7 @@ static __init int init_ipmi_devintf(void)
563 563
564 rv = register_chrdev(ipmi_major, DEVICE_NAME, &ipmi_fops); 564 rv = register_chrdev(ipmi_major, DEVICE_NAME, &ipmi_fops);
565 if (rv < 0) { 565 if (rv < 0) {
566 class_simple_destroy(ipmi_class); 566 class_destroy(ipmi_class);
567 printk(KERN_ERR "ipmi: can't get major %d\n", ipmi_major); 567 printk(KERN_ERR "ipmi: can't get major %d\n", ipmi_major);
568 return rv; 568 return rv;
569 } 569 }
@@ -577,7 +577,7 @@ static __init int init_ipmi_devintf(void)
577 rv = ipmi_smi_watcher_register(&smi_watcher); 577 rv = ipmi_smi_watcher_register(&smi_watcher);
578 if (rv) { 578 if (rv) {
579 unregister_chrdev(ipmi_major, DEVICE_NAME); 579 unregister_chrdev(ipmi_major, DEVICE_NAME);
580 class_simple_destroy(ipmi_class); 580 class_destroy(ipmi_class);
581 printk(KERN_WARNING "ipmi: can't register smi watcher\n"); 581 printk(KERN_WARNING "ipmi: can't register smi watcher\n");
582 return rv; 582 return rv;
583 } 583 }
@@ -588,7 +588,7 @@ module_init(init_ipmi_devintf);
588 588
589static __exit void cleanup_ipmi(void) 589static __exit void cleanup_ipmi(void)
590{ 590{
591 class_simple_destroy(ipmi_class); 591 class_destroy(ipmi_class);
592 ipmi_smi_watcher_unregister(&smi_watcher); 592 ipmi_smi_watcher_unregister(&smi_watcher);
593 devfs_remove(DEVICE_NAME); 593 devfs_remove(DEVICE_NAME);
594 unregister_chrdev(ipmi_major, DEVICE_NAME); 594 unregister_chrdev(ipmi_major, DEVICE_NAME);
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index d7fb452af7f9..0c81652eaba6 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -641,7 +641,7 @@ int ipmi_create_user(unsigned int if_num,
641 return -ENOMEM; 641 return -ENOMEM;
642 642
643 down_read(&interfaces_sem); 643 down_read(&interfaces_sem);
644 if ((if_num > MAX_IPMI_INTERFACES) || ipmi_interfaces[if_num] == NULL) 644 if ((if_num >= MAX_IPMI_INTERFACES) || ipmi_interfaces[if_num] == NULL)
645 { 645 {
646 rv = -EINVAL; 646 rv = -EINVAL;
647 goto out_unlock; 647 goto out_unlock;
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index 21aed0e8779d..c02a21dbad5d 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -792,7 +792,7 @@ static int stli_timeron;
792 792
793/*****************************************************************************/ 793/*****************************************************************************/
794 794
795static struct class_simple *istallion_class; 795static struct class *istallion_class;
796 796
797#ifdef MODULE 797#ifdef MODULE
798 798
@@ -854,10 +854,10 @@ static void __exit istallion_module_exit(void)
854 put_tty_driver(stli_serial); 854 put_tty_driver(stli_serial);
855 for (i = 0; i < 4; i++) { 855 for (i = 0; i < 4; i++) {
856 devfs_remove("staliomem/%d", i); 856 devfs_remove("staliomem/%d", i);
857 class_simple_device_remove(MKDEV(STL_SIOMEMMAJOR, i)); 857 class_device_destroy(istallion_class, MKDEV(STL_SIOMEMMAJOR, i));
858 } 858 }
859 devfs_remove("staliomem"); 859 devfs_remove("staliomem");
860 class_simple_destroy(istallion_class); 860 class_destroy(istallion_class);
861 if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem"))) 861 if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
862 printk("STALLION: failed to un-register serial memory device, " 862 printk("STALLION: failed to un-register serial memory device, "
863 "errno=%d\n", -i); 863 "errno=%d\n", -i);
@@ -5242,12 +5242,12 @@ int __init stli_init(void)
5242 "device\n"); 5242 "device\n");
5243 5243
5244 devfs_mk_dir("staliomem"); 5244 devfs_mk_dir("staliomem");
5245 istallion_class = class_simple_create(THIS_MODULE, "staliomem"); 5245 istallion_class = class_create(THIS_MODULE, "staliomem");
5246 for (i = 0; i < 4; i++) { 5246 for (i = 0; i < 4; i++) {
5247 devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i), 5247 devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i),
5248 S_IFCHR | S_IRUSR | S_IWUSR, 5248 S_IFCHR | S_IRUSR | S_IWUSR,
5249 "staliomem/%d", i); 5249 "staliomem/%d", i);
5250 class_simple_device_add(istallion_class, MKDEV(STL_SIOMEMMAJOR, i), 5250 class_device_create(istallion_class, MKDEV(STL_SIOMEMMAJOR, i),
5251 NULL, "staliomem%d", i); 5251 NULL, "staliomem%d", i);
5252 } 5252 }
5253 5253
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index 4dee945031d4..59eebe5a035f 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -146,7 +146,7 @@
146static struct lp_struct lp_table[LP_NO]; 146static struct lp_struct lp_table[LP_NO];
147 147
148static unsigned int lp_count = 0; 148static unsigned int lp_count = 0;
149static struct class_simple *lp_class; 149static struct class *lp_class;
150 150
151#ifdef CONFIG_LP_CONSOLE 151#ifdef CONFIG_LP_CONSOLE
152static struct parport *console_registered; // initially NULL 152static struct parport *console_registered; // initially NULL
@@ -804,7 +804,7 @@ static int lp_register(int nr, struct parport *port)
804 if (reset) 804 if (reset)
805 lp_reset(nr); 805 lp_reset(nr);
806 806
807 class_simple_device_add(lp_class, MKDEV(LP_MAJOR, nr), NULL, 807 class_device_create(lp_class, MKDEV(LP_MAJOR, nr), NULL,
808 "lp%d", nr); 808 "lp%d", nr);
809 devfs_mk_cdev(MKDEV(LP_MAJOR, nr), S_IFCHR | S_IRUGO | S_IWUGO, 809 devfs_mk_cdev(MKDEV(LP_MAJOR, nr), S_IFCHR | S_IRUGO | S_IWUGO,
810 "printers/%d", nr); 810 "printers/%d", nr);
@@ -907,7 +907,7 @@ static int __init lp_init (void)
907 } 907 }
908 908
909 devfs_mk_dir("printers"); 909 devfs_mk_dir("printers");
910 lp_class = class_simple_create(THIS_MODULE, "printer"); 910 lp_class = class_create(THIS_MODULE, "printer");
911 if (IS_ERR(lp_class)) { 911 if (IS_ERR(lp_class)) {
912 err = PTR_ERR(lp_class); 912 err = PTR_ERR(lp_class);
913 goto out_devfs; 913 goto out_devfs;
@@ -930,7 +930,7 @@ static int __init lp_init (void)
930 return 0; 930 return 0;
931 931
932out_class: 932out_class:
933 class_simple_destroy(lp_class); 933 class_destroy(lp_class);
934out_devfs: 934out_devfs:
935 devfs_remove("printers"); 935 devfs_remove("printers");
936 unregister_chrdev(LP_MAJOR, "lp"); 936 unregister_chrdev(LP_MAJOR, "lp");
@@ -981,10 +981,10 @@ static void lp_cleanup_module (void)
981 continue; 981 continue;
982 parport_unregister_device(lp_table[offset].dev); 982 parport_unregister_device(lp_table[offset].dev);
983 devfs_remove("printers/%d", offset); 983 devfs_remove("printers/%d", offset);
984 class_simple_device_remove(MKDEV(LP_MAJOR, offset)); 984 class_device_destroy(lp_class, MKDEV(LP_MAJOR, offset));
985 } 985 }
986 devfs_remove("printers"); 986 devfs_remove("printers");
987 class_simple_destroy(lp_class); 987 class_destroy(lp_class);
988} 988}
989 989
990__setup("lp=", lp_setup); 990__setup("lp=", lp_setup);
diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c
index ac9cfa9701ea..115dbb35334b 100644
--- a/drivers/char/mbcs.c
+++ b/drivers/char/mbcs.c
@@ -699,7 +699,7 @@ static inline int mbcs_hw_init(struct mbcs_soft *soft)
699 return 0; 699 return 0;
700} 700}
701 701
702static ssize_t show_algo(struct device *dev, char *buf) 702static ssize_t show_algo(struct device *dev, struct device_attribute *attr, char *buf)
703{ 703{
704 struct cx_dev *cx_dev = to_cx_dev(dev); 704 struct cx_dev *cx_dev = to_cx_dev(dev);
705 struct mbcs_soft *soft = cx_dev->soft; 705 struct mbcs_soft *soft = cx_dev->soft;
@@ -715,7 +715,7 @@ static ssize_t show_algo(struct device *dev, char *buf)
715 (debug0 >> 32), (debug0 & 0xffffffff)); 715 (debug0 >> 32), (debug0 & 0xffffffff));
716} 716}
717 717
718static ssize_t store_algo(struct device *dev, const char *buf, size_t count) 718static ssize_t store_algo(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
719{ 719{
720 int n; 720 int n;
721 struct cx_dev *cx_dev = to_cx_dev(dev); 721 struct cx_dev *cx_dev = to_cx_dev(dev);
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 947cb3cef816..e3085b22a365 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -484,7 +484,7 @@ static ssize_t write_kmem(struct file * file, const char __user * buf,
484 return virtr + wrote; 484 return virtr + wrote;
485} 485}
486 486
487#if defined(CONFIG_ISA) || !defined(__mc68000__) 487#if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI))
488static ssize_t read_port(struct file * file, char __user * buf, 488static ssize_t read_port(struct file * file, char __user * buf,
489 size_t count, loff_t *ppos) 489 size_t count, loff_t *ppos)
490{ 490{
@@ -744,7 +744,7 @@ static struct file_operations null_fops = {
744 .write = write_null, 744 .write = write_null,
745}; 745};
746 746
747#if defined(CONFIG_ISA) || !defined(__mc68000__) 747#if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI))
748static struct file_operations port_fops = { 748static struct file_operations port_fops = {
749 .llseek = memory_lseek, 749 .llseek = memory_lseek,
750 .read = read_port, 750 .read = read_port,
@@ -804,7 +804,7 @@ static int memory_open(struct inode * inode, struct file * filp)
804 case 3: 804 case 3:
805 filp->f_op = &null_fops; 805 filp->f_op = &null_fops;
806 break; 806 break;
807#if defined(CONFIG_ISA) || !defined(__mc68000__) 807#if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI))
808 case 4: 808 case 4:
809 filp->f_op = &port_fops; 809 filp->f_op = &port_fops;
810 break; 810 break;
@@ -846,7 +846,7 @@ static const struct {
846 {1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops}, 846 {1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops},
847 {2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops}, 847 {2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops},
848 {3, "null", S_IRUGO | S_IWUGO, &null_fops}, 848 {3, "null", S_IRUGO | S_IWUGO, &null_fops},
849#if defined(CONFIG_ISA) || !defined(__mc68000__) 849#if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI))
850 {4, "port", S_IRUSR | S_IWUSR | S_IRGRP, &port_fops}, 850 {4, "port", S_IRUSR | S_IWUSR | S_IRGRP, &port_fops},
851#endif 851#endif
852 {5, "zero", S_IRUGO | S_IWUGO, &zero_fops}, 852 {5, "zero", S_IRUGO | S_IWUGO, &zero_fops},
@@ -856,7 +856,7 @@ static const struct {
856 {11,"kmsg", S_IRUGO | S_IWUSR, &kmsg_fops}, 856 {11,"kmsg", S_IRUGO | S_IWUSR, &kmsg_fops},
857}; 857};
858 858
859static struct class_simple *mem_class; 859static struct class *mem_class;
860 860
861static int __init chr_dev_init(void) 861static int __init chr_dev_init(void)
862{ 862{
@@ -865,10 +865,9 @@ static int __init chr_dev_init(void)
865 if (register_chrdev(MEM_MAJOR,"mem",&memory_fops)) 865 if (register_chrdev(MEM_MAJOR,"mem",&memory_fops))
866 printk("unable to get major %d for memory devs\n", MEM_MAJOR); 866 printk("unable to get major %d for memory devs\n", MEM_MAJOR);
867 867
868 mem_class = class_simple_create(THIS_MODULE, "mem"); 868 mem_class = class_create(THIS_MODULE, "mem");
869 for (i = 0; i < ARRAY_SIZE(devlist); i++) { 869 for (i = 0; i < ARRAY_SIZE(devlist); i++) {
870 class_simple_device_add(mem_class, 870 class_device_create(mem_class, MKDEV(MEM_MAJOR, devlist[i].minor),
871 MKDEV(MEM_MAJOR, devlist[i].minor),
872 NULL, devlist[i].name); 871 NULL, devlist[i].name);
873 devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor), 872 devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor),
874 S_IFCHR | devlist[i].mode, devlist[i].name); 873 S_IFCHR | devlist[i].mode, devlist[i].name);
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 0937544762da..3115d318b997 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -177,10 +177,10 @@ fail:
177 177
178/* 178/*
179 * TODO for 2.7: 179 * TODO for 2.7:
180 * - add a struct class_device to struct miscdevice and make all usages of 180 * - add a struct kref to struct miscdevice and make all usages of
181 * them dynamic. 181 * them dynamic.
182 */ 182 */
183static struct class_simple *misc_class; 183static struct class *misc_class;
184 184
185static struct file_operations misc_fops = { 185static struct file_operations misc_fops = {
186 .owner = THIS_MODULE, 186 .owner = THIS_MODULE,
@@ -238,8 +238,8 @@ int misc_register(struct miscdevice * misc)
238 } 238 }
239 dev = MKDEV(MISC_MAJOR, misc->minor); 239 dev = MKDEV(MISC_MAJOR, misc->minor);
240 240
241 misc->class = class_simple_device_add(misc_class, dev, 241 misc->class = class_device_create(misc_class, dev, misc->dev,
242 misc->dev, misc->name); 242 "%s", misc->name);
243 if (IS_ERR(misc->class)) { 243 if (IS_ERR(misc->class)) {
244 err = PTR_ERR(misc->class); 244 err = PTR_ERR(misc->class);
245 goto out; 245 goto out;
@@ -248,7 +248,7 @@ int misc_register(struct miscdevice * misc)
248 err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, 248 err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP,
249 misc->devfs_name); 249 misc->devfs_name);
250 if (err) { 250 if (err) {
251 class_simple_device_remove(dev); 251 class_device_destroy(misc_class, dev);
252 goto out; 252 goto out;
253 } 253 }
254 254
@@ -281,7 +281,7 @@ int misc_deregister(struct miscdevice * misc)
281 281
282 down(&misc_sem); 282 down(&misc_sem);
283 list_del(&misc->list); 283 list_del(&misc->list);
284 class_simple_device_remove(MKDEV(MISC_MAJOR, misc->minor)); 284 class_device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor));
285 devfs_remove(misc->devfs_name); 285 devfs_remove(misc->devfs_name);
286 if (i < DYNAMIC_MINORS && i>0) { 286 if (i < DYNAMIC_MINORS && i>0) {
287 misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); 287 misc_minors[i>>3] &= ~(1 << (misc->minor & 7));
@@ -302,7 +302,7 @@ static int __init misc_init(void)
302 if (ent) 302 if (ent)
303 ent->proc_fops = &misc_proc_fops; 303 ent->proc_fops = &misc_proc_fops;
304#endif 304#endif
305 misc_class = class_simple_create(THIS_MODULE, "misc"); 305 misc_class = class_create(THIS_MODULE, "misc");
306 if (IS_ERR(misc_class)) 306 if (IS_ERR(misc_class))
307 return PTR_ERR(misc_class); 307 return PTR_ERR(misc_class);
308#ifdef CONFIG_MVME16x 308#ifdef CONFIG_MVME16x
@@ -323,7 +323,7 @@ static int __init misc_init(void)
323 if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) { 323 if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) {
324 printk("unable to get major %d for misc devices\n", 324 printk("unable to get major %d for misc devices\n",
325 MISC_MAJOR); 325 MISC_MAJOR);
326 class_simple_destroy(misc_class); 326 class_destroy(misc_class);
327 return -EIO; 327 return -EIO;
328 } 328 }
329 return 0; 329 return 0;
diff --git a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c
index d37625d47746..d568991ac6b3 100644
--- a/drivers/char/mwave/mwavedd.c
+++ b/drivers/char/mwave/mwavedd.c
@@ -472,7 +472,7 @@ struct device mwave_device;
472 472
473/* Prevent code redundancy, create a macro for mwave_show_* functions. */ 473/* Prevent code redundancy, create a macro for mwave_show_* functions. */
474#define mwave_show_function(attr_name, format_string, field) \ 474#define mwave_show_function(attr_name, format_string, field) \
475static ssize_t mwave_show_##attr_name(struct device *dev, char *buf) \ 475static ssize_t mwave_show_##attr_name(struct device *dev, struct device_attribute *attr, char *buf) \
476{ \ 476{ \
477 DSP_3780I_CONFIG_SETTINGS *pSettings = \ 477 DSP_3780I_CONFIG_SETTINGS *pSettings = \
478 &mwave_s_mdd.rBDData.rDspSettings; \ 478 &mwave_s_mdd.rBDData.rDspSettings; \
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 7a245068e3e5..f022f0944434 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -1995,9 +1995,6 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status)
1995 unsigned char ch, gdl; 1995 unsigned char ch, gdl;
1996 int ignored = 0; 1996 int ignored = 0;
1997 int cnt = 0; 1997 int cnt = 0;
1998 unsigned char *cp;
1999 char *fp;
2000 int count;
2001 int recv_room; 1998 int recv_room;
2002 int max = 256; 1999 int max = 256;
2003 unsigned long flags; 2000 unsigned long flags;
@@ -2011,10 +2008,6 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status)
2011 //return; 2008 //return;
2012 } 2009 }
2013 2010
2014 cp = tty->flip.char_buf;
2015 fp = tty->flip.flag_buf;
2016 count = 0;
2017
2018 // following add by Victor Yu. 09-02-2002 2011 // following add by Victor Yu. 09-02-2002
2019 if (info->IsMoxaMustChipFlag != MOXA_OTHER_UART) { 2012 if (info->IsMoxaMustChipFlag != MOXA_OTHER_UART) {
2020 2013
@@ -2041,12 +2034,10 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status)
2041 } 2034 }
2042 while (gdl--) { 2035 while (gdl--) {
2043 ch = inb(info->base + UART_RX); 2036 ch = inb(info->base + UART_RX);
2044 count++; 2037 tty_insert_flip_char(tty, ch, 0);
2045 *cp++ = ch;
2046 *fp++ = 0;
2047 cnt++; 2038 cnt++;
2048 /* 2039 /*
2049 if((count>=HI_WATER) && (info->stop_rx==0)){ 2040 if((cnt>=HI_WATER) && (info->stop_rx==0)){
2050 mxser_stoprx(tty); 2041 mxser_stoprx(tty);
2051 info->stop_rx=1; 2042 info->stop_rx=1;
2052 break; 2043 break;
@@ -2061,7 +2052,7 @@ intr_old:
2061 if (max-- < 0) 2052 if (max-- < 0)
2062 break; 2053 break;
2063 /* 2054 /*
2064 if((count>=HI_WATER) && (info->stop_rx==0)){ 2055 if((cnt>=HI_WATER) && (info->stop_rx==0)){
2065 mxser_stoprx(tty); 2056 mxser_stoprx(tty);
2066 info->stop_rx=1; 2057 info->stop_rx=1;
2067 break; 2058 break;
@@ -2078,36 +2069,33 @@ intr_old:
2078 if (++ignored > 100) 2069 if (++ignored > 100)
2079 break; 2070 break;
2080 } else { 2071 } else {
2081 count++; 2072 char flag = 0;
2082 if (*status & UART_LSR_SPECIAL) { 2073 if (*status & UART_LSR_SPECIAL) {
2083 if (*status & UART_LSR_BI) { 2074 if (*status & UART_LSR_BI) {
2084 *fp++ = TTY_BREAK; 2075 flag = TTY_BREAK;
2085/* added by casper 1/11/2000 */ 2076/* added by casper 1/11/2000 */
2086 info->icount.brk++; 2077 info->icount.brk++;
2087
2088/* */ 2078/* */
2089 if (info->flags & ASYNC_SAK) 2079 if (info->flags & ASYNC_SAK)
2090 do_SAK(tty); 2080 do_SAK(tty);
2091 } else if (*status & UART_LSR_PE) { 2081 } else if (*status & UART_LSR_PE) {
2092 *fp++ = TTY_PARITY; 2082 flag = TTY_PARITY;
2093/* added by casper 1/11/2000 */ 2083/* added by casper 1/11/2000 */
2094 info->icount.parity++; 2084 info->icount.parity++;
2095/* */ 2085/* */
2096 } else if (*status & UART_LSR_FE) { 2086 } else if (*status & UART_LSR_FE) {
2097 *fp++ = TTY_FRAME; 2087 flag = TTY_FRAME;
2098/* added by casper 1/11/2000 */ 2088/* added by casper 1/11/2000 */
2099 info->icount.frame++; 2089 info->icount.frame++;
2100/* */ 2090/* */
2101 } else if (*status & UART_LSR_OE) { 2091 } else if (*status & UART_LSR_OE) {
2102 *fp++ = TTY_OVERRUN; 2092 flag = TTY_OVERRUN;
2103/* added by casper 1/11/2000 */ 2093/* added by casper 1/11/2000 */
2104 info->icount.overrun++; 2094 info->icount.overrun++;
2105/* */ 2095/* */
2106 } else 2096 }
2107 *fp++ = 0; 2097 }
2108 } else 2098 tty_insert_flip_char(tty, ch, flag);
2109 *fp++ = 0;
2110 *cp++ = ch;
2111 cnt++; 2099 cnt++;
2112 if (cnt >= recv_room) { 2100 if (cnt >= recv_room) {
2113 if (!info->ldisc_stop_rx) { 2101 if (!info->ldisc_stop_rx) {
@@ -2132,13 +2120,13 @@ intr_old:
2132 // above add by Victor Yu. 09-02-2002 2120 // above add by Victor Yu. 09-02-2002
2133 } while (*status & UART_LSR_DR); 2121 } while (*status & UART_LSR_DR);
2134 2122
2135 end_intr: // add by Victor Yu. 09-02-2002 2123end_intr: // add by Victor Yu. 09-02-2002
2136 2124
2137 mxvar_log.rxcnt[info->port] += cnt; 2125 mxvar_log.rxcnt[info->port] += cnt;
2138 info->mon_data.rxcnt += cnt; 2126 info->mon_data.rxcnt += cnt;
2139 info->mon_data.up_rxcnt += cnt; 2127 info->mon_data.up_rxcnt += cnt;
2140 spin_unlock_irqrestore(&info->slock, flags); 2128 spin_unlock_irqrestore(&info->slock, flags);
2141 2129
2142 tty_flip_buffer_push(tty); 2130 tty_flip_buffer_push(tty);
2143} 2131}
2144 2132
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index 5eda075c62bd..0e22880432bc 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -737,7 +737,7 @@ static unsigned int pp_poll (struct file * file, poll_table * wait)
737 return mask; 737 return mask;
738} 738}
739 739
740static struct class_simple *ppdev_class; 740static struct class *ppdev_class;
741 741
742static struct file_operations pp_fops = { 742static struct file_operations pp_fops = {
743 .owner = THIS_MODULE, 743 .owner = THIS_MODULE,
@@ -752,13 +752,13 @@ static struct file_operations pp_fops = {
752 752
753static void pp_attach(struct parport *port) 753static void pp_attach(struct parport *port)
754{ 754{
755 class_simple_device_add(ppdev_class, MKDEV(PP_MAJOR, port->number), 755 class_device_create(ppdev_class, MKDEV(PP_MAJOR, port->number),
756 NULL, "parport%d", port->number); 756 NULL, "parport%d", port->number);
757} 757}
758 758
759static void pp_detach(struct parport *port) 759static void pp_detach(struct parport *port)
760{ 760{
761 class_simple_device_remove(MKDEV(PP_MAJOR, port->number)); 761 class_device_destroy(ppdev_class, MKDEV(PP_MAJOR, port->number));
762} 762}
763 763
764static struct parport_driver pp_driver = { 764static struct parport_driver pp_driver = {
@@ -776,7 +776,7 @@ static int __init ppdev_init (void)
776 PP_MAJOR); 776 PP_MAJOR);
777 return -EIO; 777 return -EIO;
778 } 778 }
779 ppdev_class = class_simple_create(THIS_MODULE, CHRDEV); 779 ppdev_class = class_create(THIS_MODULE, CHRDEV);
780 if (IS_ERR(ppdev_class)) { 780 if (IS_ERR(ppdev_class)) {
781 err = PTR_ERR(ppdev_class); 781 err = PTR_ERR(ppdev_class);
782 goto out_chrdev; 782 goto out_chrdev;
@@ -798,7 +798,7 @@ out_class:
798 for (i = 0; i < PARPORT_MAX; i++) 798 for (i = 0; i < PARPORT_MAX; i++)
799 devfs_remove("parports/%d", i); 799 devfs_remove("parports/%d", i);
800 devfs_remove("parports"); 800 devfs_remove("parports");
801 class_simple_destroy(ppdev_class); 801 class_destroy(ppdev_class);
802out_chrdev: 802out_chrdev:
803 unregister_chrdev(PP_MAJOR, CHRDEV); 803 unregister_chrdev(PP_MAJOR, CHRDEV);
804out: 804out:
@@ -813,7 +813,7 @@ static void __exit ppdev_cleanup (void)
813 devfs_remove("parports/%d", i); 813 devfs_remove("parports/%d", i);
814 parport_unregister_driver(&pp_driver); 814 parport_unregister_driver(&pp_driver);
815 devfs_remove("parports"); 815 devfs_remove("parports");
816 class_simple_destroy(ppdev_class); 816 class_destroy(ppdev_class);
817 unregister_chrdev (PP_MAJOR, CHRDEV); 817 unregister_chrdev (PP_MAJOR, CHRDEV);
818} 818}
819 819
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index ca5f42bcaad9..f13e5de02207 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -27,7 +27,7 @@ struct raw_device_data {
27 int inuse; 27 int inuse;
28}; 28};
29 29
30static struct class_simple *raw_class; 30static struct class *raw_class;
31static struct raw_device_data raw_devices[MAX_RAW_MINORS]; 31static struct raw_device_data raw_devices[MAX_RAW_MINORS];
32static DECLARE_MUTEX(raw_mutex); 32static DECLARE_MUTEX(raw_mutex);
33static struct file_operations raw_ctl_fops; /* forward declaration */ 33static struct file_operations raw_ctl_fops; /* forward declaration */
@@ -127,8 +127,8 @@ raw_ioctl(struct inode *inode, struct file *filp,
127 127
128static void bind_device(struct raw_config_request *rq) 128static void bind_device(struct raw_config_request *rq)
129{ 129{
130 class_simple_device_remove(MKDEV(RAW_MAJOR, rq->raw_minor)); 130 class_device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor));
131 class_simple_device_add(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor), 131 class_device_create(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor),
132 NULL, "raw%d", rq->raw_minor); 132 NULL, "raw%d", rq->raw_minor);
133} 133}
134 134
@@ -200,8 +200,8 @@ static int raw_ctl_ioctl(struct inode *inode, struct file *filp,
200 if (rq.block_major == 0 && rq.block_minor == 0) { 200 if (rq.block_major == 0 && rq.block_minor == 0) {
201 /* unbind */ 201 /* unbind */
202 rawdev->binding = NULL; 202 rawdev->binding = NULL;
203 class_simple_device_remove(MKDEV(RAW_MAJOR, 203 class_device_destroy(raw_class,
204 rq.raw_minor)); 204 MKDEV(RAW_MAJOR, rq.raw_minor));
205 } else { 205 } else {
206 rawdev->binding = bdget(dev); 206 rawdev->binding = bdget(dev);
207 if (rawdev->binding == NULL) 207 if (rawdev->binding == NULL)
@@ -300,14 +300,14 @@ static int __init raw_init(void)
300 goto error; 300 goto error;
301 } 301 }
302 302
303 raw_class = class_simple_create(THIS_MODULE, "raw"); 303 raw_class = class_create(THIS_MODULE, "raw");
304 if (IS_ERR(raw_class)) { 304 if (IS_ERR(raw_class)) {
305 printk(KERN_ERR "Error creating raw class.\n"); 305 printk(KERN_ERR "Error creating raw class.\n");
306 cdev_del(&raw_cdev); 306 cdev_del(&raw_cdev);
307 unregister_chrdev_region(dev, MAX_RAW_MINORS); 307 unregister_chrdev_region(dev, MAX_RAW_MINORS);
308 goto error; 308 goto error;
309 } 309 }
310 class_simple_device_add(raw_class, MKDEV(RAW_MAJOR, 0), NULL, "rawctl"); 310 class_device_create(raw_class, MKDEV(RAW_MAJOR, 0), NULL, "rawctl");
311 311
312 devfs_mk_cdev(MKDEV(RAW_MAJOR, 0), 312 devfs_mk_cdev(MKDEV(RAW_MAJOR, 0),
313 S_IFCHR | S_IRUGO | S_IWUGO, 313 S_IFCHR | S_IRUGO | S_IWUGO,
@@ -331,8 +331,8 @@ static void __exit raw_exit(void)
331 devfs_remove("raw/raw%d", i); 331 devfs_remove("raw/raw%d", i);
332 devfs_remove("raw/rawctl"); 332 devfs_remove("raw/rawctl");
333 devfs_remove("raw"); 333 devfs_remove("raw");
334 class_simple_device_remove(MKDEV(RAW_MAJOR, 0)); 334 class_device_destroy(raw_class, MKDEV(RAW_MAJOR, 0));
335 class_simple_destroy(raw_class); 335 class_destroy(raw_class);
336 cdev_del(&raw_cdev); 336 cdev_del(&raw_cdev);
337 unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS); 337 unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS);
338} 338}
diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c
index e3c0b52d943f..261a41bf6d02 100644
--- a/drivers/char/snsc.c
+++ b/drivers/char/snsc.c
@@ -357,6 +357,8 @@ static struct file_operations scdrv_fops = {
357 .release = scdrv_release, 357 .release = scdrv_release,
358}; 358};
359 359
360static struct class *snsc_class;
361
360/* 362/*
361 * scdrv_init 363 * scdrv_init
362 * 364 *
@@ -372,7 +374,6 @@ scdrv_init(void)
372 char *devnamep; 374 char *devnamep;
373 struct sysctl_data_s *scd; 375 struct sysctl_data_s *scd;
374 void *salbuf; 376 void *salbuf;
375 struct class_simple *snsc_class;
376 dev_t first_dev, dev; 377 dev_t first_dev, dev;
377 nasid_t event_nasid = ia64_sn_get_console_nasid(); 378 nasid_t event_nasid = ia64_sn_get_console_nasid();
378 379
@@ -382,7 +383,7 @@ scdrv_init(void)
382 __FUNCTION__); 383 __FUNCTION__);
383 return -ENODEV; 384 return -ENODEV;
384 } 385 }
385 snsc_class = class_simple_create(THIS_MODULE, SYSCTL_BASENAME); 386 snsc_class = class_create(THIS_MODULE, SYSCTL_BASENAME);
386 387
387 for (cnode = 0; cnode < numionodes; cnode++) { 388 for (cnode = 0; cnode < numionodes; cnode++) {
388 geoid = cnodeid_get_geoid(cnode); 389 geoid = cnodeid_get_geoid(cnode);
@@ -436,7 +437,7 @@ scdrv_init(void)
436 continue; 437 continue;
437 } 438 }
438 439
439 class_simple_device_add(snsc_class, dev, NULL, 440 class_device_create(snsc_class, dev, NULL,
440 "%s", devname); 441 "%s", devname);
441 442
442 ia64_sn_irtr_intr_enable(scd->scd_nasid, 443 ia64_sn_irtr_intr_enable(scd->scd_nasid,
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index b8899f560b5e..951545a6ef2d 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -719,7 +719,7 @@ static struct file_operations stl_fsiomem = {
719 719
720/*****************************************************************************/ 720/*****************************************************************************/
721 721
722static struct class_simple *stallion_class; 722static struct class *stallion_class;
723 723
724/* 724/*
725 * Loadable module initialization stuff. 725 * Loadable module initialization stuff.
@@ -777,13 +777,13 @@ static void __exit stallion_module_exit(void)
777 } 777 }
778 for (i = 0; i < 4; i++) { 778 for (i = 0; i < 4; i++) {
779 devfs_remove("staliomem/%d", i); 779 devfs_remove("staliomem/%d", i);
780 class_simple_device_remove(MKDEV(STL_SIOMEMMAJOR, i)); 780 class_device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i));
781 } 781 }
782 devfs_remove("staliomem"); 782 devfs_remove("staliomem");
783 if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem"))) 783 if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
784 printk("STALLION: failed to un-register serial memory device, " 784 printk("STALLION: failed to un-register serial memory device, "
785 "errno=%d\n", -i); 785 "errno=%d\n", -i);
786 class_simple_destroy(stallion_class); 786 class_destroy(stallion_class);
787 787
788 if (stl_tmpwritebuf != (char *) NULL) 788 if (stl_tmpwritebuf != (char *) NULL)
789 kfree(stl_tmpwritebuf); 789 kfree(stl_tmpwritebuf);
@@ -3090,12 +3090,12 @@ static int __init stl_init(void)
3090 printk("STALLION: failed to register serial board device\n"); 3090 printk("STALLION: failed to register serial board device\n");
3091 devfs_mk_dir("staliomem"); 3091 devfs_mk_dir("staliomem");
3092 3092
3093 stallion_class = class_simple_create(THIS_MODULE, "staliomem"); 3093 stallion_class = class_create(THIS_MODULE, "staliomem");
3094 for (i = 0; i < 4; i++) { 3094 for (i = 0; i < 4; i++) {
3095 devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i), 3095 devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i),
3096 S_IFCHR|S_IRUSR|S_IWUSR, 3096 S_IFCHR|S_IRUSR|S_IWUSR,
3097 "staliomem/%d", i); 3097 "staliomem/%d", i);
3098 class_simple_device_add(stallion_class, MKDEV(STL_SIOMEMMAJOR, i), NULL, "staliomem%d", i); 3098 class_device_create(stallion_class, MKDEV(STL_SIOMEMMAJOR, i), NULL, "staliomem%d", i);
3099 } 3099 }
3100 3100
3101 stl_serial->owner = THIS_MODULE; 3101 stl_serial->owner = THIS_MODULE;
diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c
index 0c5ba9dc9063..659335d80ee7 100644
--- a/drivers/char/tipar.c
+++ b/drivers/char/tipar.c
@@ -90,7 +90,7 @@ static int timeout = TIMAXTIME; /* timeout in tenth of seconds */
90static unsigned int tp_count; /* tipar count */ 90static unsigned int tp_count; /* tipar count */
91static unsigned long opened; /* opened devices */ 91static unsigned long opened; /* opened devices */
92 92
93static struct class_simple *tipar_class; 93static struct class *tipar_class;
94 94
95/* --- macros for parport access -------------------------------------- */ 95/* --- macros for parport access -------------------------------------- */
96 96
@@ -436,7 +436,7 @@ tipar_register(int nr, struct parport *port)
436 goto out; 436 goto out;
437 } 437 }
438 438
439 class_simple_device_add(tipar_class, MKDEV(TIPAR_MAJOR, 439 class_device_create(tipar_class, MKDEV(TIPAR_MAJOR,
440 TIPAR_MINOR + nr), NULL, "par%d", nr); 440 TIPAR_MINOR + nr), NULL, "par%d", nr);
441 /* Use devfs, tree: /dev/ticables/par/[0..2] */ 441 /* Use devfs, tree: /dev/ticables/par/[0..2] */
442 err = devfs_mk_cdev(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr), 442 err = devfs_mk_cdev(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr),
@@ -458,8 +458,8 @@ tipar_register(int nr, struct parport *port)
458 goto out; 458 goto out;
459 459
460out_class: 460out_class:
461 class_simple_device_remove(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr)); 461 class_device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr));
462 class_simple_destroy(tipar_class); 462 class_destroy(tipar_class);
463out: 463out:
464 return err; 464 return err;
465} 465}
@@ -505,7 +505,7 @@ tipar_init_module(void)
505 /* Use devfs with tree: /dev/ticables/par/[0..2] */ 505 /* Use devfs with tree: /dev/ticables/par/[0..2] */
506 devfs_mk_dir("ticables/par"); 506 devfs_mk_dir("ticables/par");
507 507
508 tipar_class = class_simple_create(THIS_MODULE, "ticables"); 508 tipar_class = class_create(THIS_MODULE, "ticables");
509 if (IS_ERR(tipar_class)) { 509 if (IS_ERR(tipar_class)) {
510 err = PTR_ERR(tipar_class); 510 err = PTR_ERR(tipar_class);
511 goto out_chrdev; 511 goto out_chrdev;
@@ -539,10 +539,10 @@ tipar_cleanup_module(void)
539 if (table[i].dev == NULL) 539 if (table[i].dev == NULL)
540 continue; 540 continue;
541 parport_unregister_device(table[i].dev); 541 parport_unregister_device(table[i].dev);
542 class_simple_device_remove(MKDEV(TIPAR_MAJOR, i)); 542 class_device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, i));
543 devfs_remove("ticables/par/%d", i); 543 devfs_remove("ticables/par/%d", i);
544 } 544 }
545 class_simple_destroy(tipar_class); 545 class_destroy(tipar_class);
546 devfs_remove("ticables/par"); 546 devfs_remove("ticables/par");
547 547
548 pr_info("tipar: module unloaded\n"); 548 pr_info("tipar: module unloaded\n");
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 87235330fdbe..8ce508b29865 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -212,7 +212,7 @@ static u8 pcrread[] = {
212 0, 0, 0, 0 /* PCR index */ 212 0, 0, 0, 0 /* PCR index */
213}; 213};
214 214
215static ssize_t show_pcrs(struct device *dev, char *buf) 215static ssize_t show_pcrs(struct device *dev, struct device_attribute *attr, char *buf)
216{ 216{
217 u8 data[READ_PCR_RESULT_SIZE]; 217 u8 data[READ_PCR_RESULT_SIZE];
218 ssize_t len; 218 ssize_t len;
@@ -255,7 +255,7 @@ static u8 readpubek[] = {
255 0, 0, 0, 124, /* TPM_ORD_ReadPubek */ 255 0, 0, 0, 124, /* TPM_ORD_ReadPubek */
256}; 256};
257 257
258static ssize_t show_pubek(struct device *dev, char *buf) 258static ssize_t show_pubek(struct device *dev, struct device_attribute *attr, char *buf)
259{ 259{
260 u8 data[READ_PUBEK_RESULT_SIZE]; 260 u8 data[READ_PUBEK_RESULT_SIZE];
261 ssize_t len; 261 ssize_t len;
@@ -330,7 +330,7 @@ static u8 cap_manufacturer[] = {
330 0, 0, 1, 3 330 0, 0, 1, 3
331}; 331};
332 332
333static ssize_t show_caps(struct device *dev, char *buf) 333static ssize_t show_caps(struct device *dev, struct device_attribute *attr, char *buf)
334{ 334{
335 u8 data[READ_PUBEK_RESULT_SIZE]; 335 u8 data[READ_PUBEK_RESULT_SIZE];
336 ssize_t len; 336 ssize_t len;
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 26e5e19ed854..31831030f73f 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -2654,7 +2654,7 @@ static void tty_default_put_char(struct tty_struct *tty, unsigned char ch)
2654 tty->driver->write(tty, &ch, 1); 2654 tty->driver->write(tty, &ch, 1);
2655} 2655}
2656 2656
2657static struct class_simple *tty_class; 2657static struct class *tty_class;
2658 2658
2659/** 2659/**
2660 * tty_register_device - register a tty device 2660 * tty_register_device - register a tty device
@@ -2687,7 +2687,7 @@ void tty_register_device(struct tty_driver *driver, unsigned index,
2687 pty_line_name(driver, index, name); 2687 pty_line_name(driver, index, name);
2688 else 2688 else
2689 tty_line_name(driver, index, name); 2689 tty_line_name(driver, index, name);
2690 class_simple_device_add(tty_class, dev, device, name); 2690 class_device_create(tty_class, dev, device, name);
2691} 2691}
2692 2692
2693/** 2693/**
@@ -2701,7 +2701,7 @@ void tty_register_device(struct tty_driver *driver, unsigned index,
2701void tty_unregister_device(struct tty_driver *driver, unsigned index) 2701void tty_unregister_device(struct tty_driver *driver, unsigned index)
2702{ 2702{
2703 devfs_remove("%s%d", driver->devfs_name, index + driver->name_base); 2703 devfs_remove("%s%d", driver->devfs_name, index + driver->name_base);
2704 class_simple_device_remove(MKDEV(driver->major, driver->minor_start) + index); 2704 class_device_destroy(tty_class, MKDEV(driver->major, driver->minor_start) + index);
2705} 2705}
2706 2706
2707EXPORT_SYMBOL(tty_register_device); 2707EXPORT_SYMBOL(tty_register_device);
@@ -2918,7 +2918,7 @@ extern int vty_init(void);
2918 2918
2919static int __init tty_class_init(void) 2919static int __init tty_class_init(void)
2920{ 2920{
2921 tty_class = class_simple_create(THIS_MODULE, "tty"); 2921 tty_class = class_create(THIS_MODULE, "tty");
2922 if (IS_ERR(tty_class)) 2922 if (IS_ERR(tty_class))
2923 return PTR_ERR(tty_class); 2923 return PTR_ERR(tty_class);
2924 return 0; 2924 return 0;
@@ -2947,14 +2947,14 @@ static int __init tty_init(void)
2947 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0) 2947 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0)
2948 panic("Couldn't register /dev/tty driver\n"); 2948 panic("Couldn't register /dev/tty driver\n");
2949 devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 0), S_IFCHR|S_IRUGO|S_IWUGO, "tty"); 2949 devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 0), S_IFCHR|S_IRUGO|S_IWUGO, "tty");
2950 class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty"); 2950 class_device_create(tty_class, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty");
2951 2951
2952 cdev_init(&console_cdev, &console_fops); 2952 cdev_init(&console_cdev, &console_fops);
2953 if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) || 2953 if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) ||
2954 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0) 2954 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0)
2955 panic("Couldn't register /dev/console driver\n"); 2955 panic("Couldn't register /dev/console driver\n");
2956 devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 1), S_IFCHR|S_IRUSR|S_IWUSR, "console"); 2956 devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 1), S_IFCHR|S_IRUSR|S_IWUSR, "console");
2957 class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 1), NULL, "console"); 2957 class_device_create(tty_class, MKDEV(TTYAUX_MAJOR, 1), NULL, "console");
2958 2958
2959#ifdef CONFIG_UNIX98_PTYS 2959#ifdef CONFIG_UNIX98_PTYS
2960 cdev_init(&ptmx_cdev, &ptmx_fops); 2960 cdev_init(&ptmx_cdev, &ptmx_fops);
@@ -2962,7 +2962,7 @@ static int __init tty_init(void)
2962 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0) 2962 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0)
2963 panic("Couldn't register /dev/ptmx driver\n"); 2963 panic("Couldn't register /dev/ptmx driver\n");
2964 devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 2), S_IFCHR|S_IRUGO|S_IWUGO, "ptmx"); 2964 devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 2), S_IFCHR|S_IRUGO|S_IWUGO, "ptmx");
2965 class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx"); 2965 class_device_create(tty_class, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx");
2966#endif 2966#endif
2967 2967
2968#ifdef CONFIG_VT 2968#ifdef CONFIG_VT
@@ -2971,7 +2971,7 @@ static int __init tty_init(void)
2971 register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0) 2971 register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
2972 panic("Couldn't register /dev/tty0 driver\n"); 2972 panic("Couldn't register /dev/tty0 driver\n");
2973 devfs_mk_cdev(MKDEV(TTY_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vc/0"); 2973 devfs_mk_cdev(MKDEV(TTY_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vc/0");
2974 class_simple_device_add(tty_class, MKDEV(TTY_MAJOR, 0), NULL, "tty0"); 2974 class_device_create(tty_class, MKDEV(TTY_MAJOR, 0), NULL, "tty0");
2975 2975
2976 vty_init(); 2976 vty_init();
2977#endif 2977#endif
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index 7abe405b8657..79c2928a8817 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -474,7 +474,7 @@ static struct file_operations vcs_fops = {
474 .open = vcs_open, 474 .open = vcs_open,
475}; 475};
476 476
477static struct class_simple *vc_class; 477static struct class *vc_class;
478 478
479void vcs_make_devfs(struct tty_struct *tty) 479void vcs_make_devfs(struct tty_struct *tty)
480{ 480{
@@ -484,26 +484,26 @@ void vcs_make_devfs(struct tty_struct *tty)
484 devfs_mk_cdev(MKDEV(VCS_MAJOR, tty->index + 129), 484 devfs_mk_cdev(MKDEV(VCS_MAJOR, tty->index + 129),
485 S_IFCHR|S_IRUSR|S_IWUSR, 485 S_IFCHR|S_IRUSR|S_IWUSR,
486 "vcc/a%u", tty->index + 1); 486 "vcc/a%u", tty->index + 1);
487 class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, tty->index + 1), NULL, "vcs%u", tty->index + 1); 487 class_device_create(vc_class, MKDEV(VCS_MAJOR, tty->index + 1), NULL, "vcs%u", tty->index + 1);
488 class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, tty->index + 129), NULL, "vcsa%u", tty->index + 1); 488 class_device_create(vc_class, MKDEV(VCS_MAJOR, tty->index + 129), NULL, "vcsa%u", tty->index + 1);
489} 489}
490void vcs_remove_devfs(struct tty_struct *tty) 490void vcs_remove_devfs(struct tty_struct *tty)
491{ 491{
492 devfs_remove("vcc/%u", tty->index + 1); 492 devfs_remove("vcc/%u", tty->index + 1);
493 devfs_remove("vcc/a%u", tty->index + 1); 493 devfs_remove("vcc/a%u", tty->index + 1);
494 class_simple_device_remove(MKDEV(VCS_MAJOR, tty->index + 1)); 494 class_device_destroy(vc_class, MKDEV(VCS_MAJOR, tty->index + 1));
495 class_simple_device_remove(MKDEV(VCS_MAJOR, tty->index + 129)); 495 class_device_destroy(vc_class, MKDEV(VCS_MAJOR, tty->index + 129));
496} 496}
497 497
498int __init vcs_init(void) 498int __init vcs_init(void)
499{ 499{
500 if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops)) 500 if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops))
501 panic("unable to get major %d for vcs device", VCS_MAJOR); 501 panic("unable to get major %d for vcs device", VCS_MAJOR);
502 vc_class = class_simple_create(THIS_MODULE, "vc"); 502 vc_class = class_create(THIS_MODULE, "vc");
503 503
504 devfs_mk_cdev(MKDEV(VCS_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/0"); 504 devfs_mk_cdev(MKDEV(VCS_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/0");
505 devfs_mk_cdev(MKDEV(VCS_MAJOR, 128), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/a0"); 505 devfs_mk_cdev(MKDEV(VCS_MAJOR, 128), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/a0");
506 class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, 0), NULL, "vcs"); 506 class_device_create(vc_class, MKDEV(VCS_MAJOR, 0), NULL, "vcs");
507 class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, 128), NULL, "vcsa"); 507 class_device_create(vc_class, MKDEV(VCS_MAJOR, 128), NULL, "vcsa");
508 return 0; 508 return 0;
509} 509}
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index aea3cbf5219d..4764b4f9555d 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -237,7 +237,7 @@ static dma_addr_t viotape_unitinfo_token;
237 237
238static struct mtget viomtget[VIOTAPE_MAX_TAPE]; 238static struct mtget viomtget[VIOTAPE_MAX_TAPE];
239 239
240static struct class_simple *tape_class; 240static struct class *tape_class;
241 241
242static struct device *tape_device[VIOTAPE_MAX_TAPE]; 242static struct device *tape_device[VIOTAPE_MAX_TAPE];
243 243
@@ -956,9 +956,9 @@ static int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id)
956 state[i].cur_part = 0; 956 state[i].cur_part = 0;
957 for (j = 0; j < MAX_PARTITIONS; ++j) 957 for (j = 0; j < MAX_PARTITIONS; ++j)
958 state[i].part_stat_rwi[j] = VIOT_IDLE; 958 state[i].part_stat_rwi[j] = VIOT_IDLE;
959 class_simple_device_add(tape_class, MKDEV(VIOTAPE_MAJOR, i), NULL, 959 class_device_create(tape_class, MKDEV(VIOTAPE_MAJOR, i), NULL,
960 "iseries!vt%d", i); 960 "iseries!vt%d", i);
961 class_simple_device_add(tape_class, MKDEV(VIOTAPE_MAJOR, i | 0x80), 961 class_device_create(tape_class, MKDEV(VIOTAPE_MAJOR, i | 0x80),
962 NULL, "iseries!nvt%d", i); 962 NULL, "iseries!nvt%d", i);
963 devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i), S_IFCHR | S_IRUSR | S_IWUSR, 963 devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i), S_IFCHR | S_IRUSR | S_IWUSR,
964 "iseries/vt%d", i); 964 "iseries/vt%d", i);
@@ -980,8 +980,8 @@ static int viotape_remove(struct vio_dev *vdev)
980 devfs_remove("iseries/nvt%d", i); 980 devfs_remove("iseries/nvt%d", i);
981 devfs_remove("iseries/vt%d", i); 981 devfs_remove("iseries/vt%d", i);
982 devfs_unregister_tape(state[i].dev_handle); 982 devfs_unregister_tape(state[i].dev_handle);
983 class_simple_device_remove(MKDEV(VIOTAPE_MAJOR, i | 0x80)); 983 class_device_destroy(tape_class, MKDEV(VIOTAPE_MAJOR, i | 0x80));
984 class_simple_device_remove(MKDEV(VIOTAPE_MAJOR, i)); 984 class_device_destroy(tape_class, MKDEV(VIOTAPE_MAJOR, i));
985 return 0; 985 return 0;
986} 986}
987 987
@@ -1045,7 +1045,7 @@ int __init viotap_init(void)
1045 goto clear_handler; 1045 goto clear_handler;
1046 } 1046 }
1047 1047
1048 tape_class = class_simple_create(THIS_MODULE, "tape"); 1048 tape_class = class_create(THIS_MODULE, "tape");
1049 if (IS_ERR(tape_class)) { 1049 if (IS_ERR(tape_class)) {
1050 printk(VIOTAPE_KERN_WARN "Unable to allocat class\n"); 1050 printk(VIOTAPE_KERN_WARN "Unable to allocat class\n");
1051 ret = PTR_ERR(tape_class); 1051 ret = PTR_ERR(tape_class);
@@ -1070,7 +1070,7 @@ int __init viotap_init(void)
1070 return 0; 1070 return 0;
1071 1071
1072unreg_class: 1072unreg_class:
1073 class_simple_destroy(tape_class); 1073 class_destroy(tape_class);
1074unreg_chrdev: 1074unreg_chrdev:
1075 unregister_chrdev(VIOTAPE_MAJOR, "viotape"); 1075 unregister_chrdev(VIOTAPE_MAJOR, "viotape");
1076clear_handler: 1076clear_handler:
@@ -1110,7 +1110,7 @@ static void __exit viotap_exit(void)
1110 1110
1111 remove_proc_entry("iSeries/viotape", NULL); 1111 remove_proc_entry("iSeries/viotape", NULL);
1112 vio_unregister_driver(&viotape_driver); 1112 vio_unregister_driver(&viotape_driver);
1113 class_simple_destroy(tape_class); 1113 class_destroy(tape_class);
1114 ret = unregister_chrdev(VIOTAPE_MAJOR, "viotape"); 1114 ret = unregister_chrdev(VIOTAPE_MAJOR, "viotape");
1115 if (ret < 0) 1115 if (ret < 0)
1116 printk(VIOTAPE_KERN_WARN "Error unregistering device: %d\n", 1116 printk(VIOTAPE_KERN_WARN "Error unregistering device: %d\n",
diff --git a/drivers/char/vr41xx_giu.c b/drivers/char/vr41xx_giu.c
new file mode 100644
index 000000000000..683278bc5241
--- /dev/null
+++ b/drivers/char/vr41xx_giu.c
@@ -0,0 +1,743 @@
1/*
2 * Driver for NEC VR4100 series General-purpose I/O Unit.
3 *
4 * Copyright (C) 2002 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com>
6 * Copyright (C) 2003-2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#include <linux/device.h>
23#include <linux/errno.h>
24#include <linux/fs.h>
25#include <linux/init.h>
26#include <linux/irq.h>
27#include <linux/interrupt.h>
28#include <linux/kernel.h>
29#include <linux/module.h>
30#include <linux/spinlock.h>
31#include <linux/types.h>
32
33#include <asm/cpu.h>
34#include <asm/io.h>
35#include <asm/vr41xx/giu.h>
36#include <asm/vr41xx/vr41xx.h>
37
38MODULE_AUTHOR("Yoichi Yuasa <yuasa@hh.iij4u.or.jp>");
39MODULE_DESCRIPTION("NEC VR4100 series General-purpose I/O Unit driver");
40MODULE_LICENSE("GPL");
41
42static int major; /* default is dynamic major device number */
43module_param(major, int, 0);
44MODULE_PARM_DESC(major, "Major device number");
45
46#define GIU_TYPE1_START 0x0b000100UL
47#define GIU_TYPE1_SIZE 0x20UL
48
49#define GIU_TYPE2_START 0x0f000140UL
50#define GIU_TYPE2_SIZE 0x20UL
51
52#define GIU_TYPE3_START 0x0f000140UL
53#define GIU_TYPE3_SIZE 0x28UL
54
55#define GIU_PULLUPDOWN_START 0x0b0002e0UL
56#define GIU_PULLUPDOWN_SIZE 0x04UL
57
58#define GIUIOSELL 0x00
59#define GIUIOSELH 0x02
60#define GIUPIODL 0x04
61#define GIUPIODH 0x06
62#define GIUINTSTATL 0x08
63#define GIUINTSTATH 0x0a
64#define GIUINTENL 0x0c
65#define GIUINTENH 0x0e
66#define GIUINTTYPL 0x10
67#define GIUINTTYPH 0x12
68#define GIUINTALSELL 0x14
69#define GIUINTALSELH 0x16
70#define GIUINTHTSELL 0x18
71#define GIUINTHTSELH 0x1a
72#define GIUPODATL 0x1c
73#define GIUPODATEN 0x1c
74#define GIUPODATH 0x1e
75 #define PIOEN0 0x0100
76 #define PIOEN1 0x0200
77#define GIUPODAT 0x1e
78#define GIUFEDGEINHL 0x20
79#define GIUFEDGEINHH 0x22
80#define GIUREDGEINHL 0x24
81#define GIUREDGEINHH 0x26
82
83#define GIUUSEUPDN 0x1e0
84#define GIUTERMUPDN 0x1e2
85
86#define GPIO_HAS_PULLUPDOWN_IO 0x0001
87#define GPIO_HAS_OUTPUT_ENABLE 0x0002
88#define GPIO_HAS_INTERRUPT_EDGE_SELECT 0x0100
89
90static spinlock_t giu_lock;
91static struct resource *giu_resource1;
92static struct resource *giu_resource2;
93static unsigned long giu_flags;
94static unsigned int giu_nr_pins;
95
96static void __iomem *giu_base;
97
98#define giu_read(offset) readw(giu_base + (offset))
99#define giu_write(offset, value) writew((value), giu_base + (offset))
100
101#define GPIO_PIN_OF_IRQ(irq) ((irq) - GIU_IRQ_BASE)
102#define GIUINT_HIGH_OFFSET 16
103#define GIUINT_HIGH_MAX 32
104
105static inline uint16_t giu_set(uint16_t offset, uint16_t set)
106{
107 uint16_t data;
108
109 data = giu_read(offset);
110 data |= set;
111 giu_write(offset, data);
112
113 return data;
114}
115
116static inline uint16_t giu_clear(uint16_t offset, uint16_t clear)
117{
118 uint16_t data;
119
120 data = giu_read(offset);
121 data &= ~clear;
122 giu_write(offset, data);
123
124 return data;
125}
126
127static unsigned int startup_giuint_low_irq(unsigned int irq)
128{
129 unsigned int pin;
130
131 pin = GPIO_PIN_OF_IRQ(irq);
132 giu_write(GIUINTSTATL, 1 << pin);
133 giu_set(GIUINTENL, 1 << pin);
134
135 return 0;
136}
137
138static void shutdown_giuint_low_irq(unsigned int irq)
139{
140 giu_clear(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(irq));
141}
142
143static void enable_giuint_low_irq(unsigned int irq)
144{
145 giu_set(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(irq));
146}
147
148#define disable_giuint_low_irq shutdown_giuint_low_irq
149
150static void ack_giuint_low_irq(unsigned int irq)
151{
152 unsigned int pin;
153
154 pin = GPIO_PIN_OF_IRQ(irq);
155 giu_clear(GIUINTENL, 1 << pin);
156 giu_write(GIUINTSTATL, 1 << pin);
157}
158
159static void end_giuint_low_irq(unsigned int irq)
160{
161 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
162 giu_set(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(irq));
163}
164
165static struct hw_interrupt_type giuint_low_irq_type = {
166 .typename = "GIUINTL",
167 .startup = startup_giuint_low_irq,
168 .shutdown = shutdown_giuint_low_irq,
169 .enable = enable_giuint_low_irq,
170 .disable = disable_giuint_low_irq,
171 .ack = ack_giuint_low_irq,
172 .end = end_giuint_low_irq,
173};
174
175static unsigned int startup_giuint_high_irq(unsigned int irq)
176{
177 unsigned int pin;
178
179 pin = GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET;
180 giu_write(GIUINTSTATH, 1 << pin);
181 giu_set(GIUINTENH, 1 << pin);
182
183 return 0;
184}
185
186static void shutdown_giuint_high_irq(unsigned int irq)
187{
188 giu_clear(GIUINTENH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET));
189}
190
191static void enable_giuint_high_irq(unsigned int irq)
192{
193 giu_set(GIUINTENH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET));
194}
195
196#define disable_giuint_high_irq shutdown_giuint_high_irq
197
198static void ack_giuint_high_irq(unsigned int irq)
199{
200 unsigned int pin;
201
202 pin = GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET;
203 giu_clear(GIUINTENH, 1 << pin);
204 giu_write(GIUINTSTATH, 1 << pin);
205}
206
207static void end_giuint_high_irq(unsigned int irq)
208{
209 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
210 giu_set(GIUINTENH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET));
211}
212
213static struct hw_interrupt_type giuint_high_irq_type = {
214 .typename = "GIUINTH",
215 .startup = startup_giuint_high_irq,
216 .shutdown = shutdown_giuint_high_irq,
217 .enable = enable_giuint_high_irq,
218 .disable = disable_giuint_high_irq,
219 .ack = ack_giuint_high_irq,
220 .end = end_giuint_high_irq,
221};
222
223static int giu_get_irq(unsigned int irq, struct pt_regs *regs)
224{
225 uint16_t pendl, pendh, maskl, maskh;
226 int i;
227
228 pendl = giu_read(GIUINTSTATL);
229 pendh = giu_read(GIUINTSTATH);
230 maskl = giu_read(GIUINTENL);
231 maskh = giu_read(GIUINTENH);
232
233 maskl &= pendl;
234 maskh &= pendh;
235
236 if (maskl) {
237 for (i = 0; i < 16; i++) {
238 if (maskl & (1 << i))
239 return GIU_IRQ(i);
240 }
241 } else if (maskh) {
242 for (i = 0; i < 16; i++) {
243 if (maskh & (1 << i))
244 return GIU_IRQ(i + GIUINT_HIGH_OFFSET);
245 }
246 }
247
248 printk(KERN_ERR "spurious GIU interrupt: %04x(%04x),%04x(%04x)\n",
249 maskl, pendl, maskh, pendh);
250
251 atomic_inc(&irq_err_count);
252
253 return -EINVAL;
254}
255
256void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, irq_signal_t signal)
257{
258 uint16_t mask;
259
260 if (pin < GIUINT_HIGH_OFFSET) {
261 mask = 1 << pin;
262 if (trigger != IRQ_TRIGGER_LEVEL) {
263 giu_set(GIUINTTYPL, mask);
264 if (signal == IRQ_SIGNAL_HOLD)
265 giu_set(GIUINTHTSELL, mask);
266 else
267 giu_clear(GIUINTHTSELL, mask);
268 if (current_cpu_data.cputype == CPU_VR4133) {
269 switch (trigger) {
270 case IRQ_TRIGGER_EDGE_FALLING:
271 giu_set(GIUFEDGEINHL, mask);
272 giu_clear(GIUREDGEINHL, mask);
273 break;
274 case IRQ_TRIGGER_EDGE_RISING:
275 giu_clear(GIUFEDGEINHL, mask);
276 giu_set(GIUREDGEINHL, mask);
277 break;
278 default:
279 giu_set(GIUFEDGEINHL, mask);
280 giu_set(GIUREDGEINHL, mask);
281 break;
282 }
283 }
284 } else {
285 giu_clear(GIUINTTYPL, mask);
286 giu_clear(GIUINTHTSELL, mask);
287 }
288 giu_write(GIUINTSTATL, mask);
289 } else if (pin < GIUINT_HIGH_MAX) {
290 mask = 1 << (pin - GIUINT_HIGH_OFFSET);
291 if (trigger != IRQ_TRIGGER_LEVEL) {
292 giu_set(GIUINTTYPH, mask);
293 if (signal == IRQ_SIGNAL_HOLD)
294 giu_set(GIUINTHTSELH, mask);
295 else
296 giu_clear(GIUINTHTSELH, mask);
297 if (current_cpu_data.cputype == CPU_VR4133) {
298 switch (trigger) {
299 case IRQ_TRIGGER_EDGE_FALLING:
300 giu_set(GIUFEDGEINHH, mask);
301 giu_clear(GIUREDGEINHH, mask);
302 break;
303 case IRQ_TRIGGER_EDGE_RISING:
304 giu_clear(GIUFEDGEINHH, mask);
305 giu_set(GIUREDGEINHH, mask);
306 break;
307 default:
308 giu_set(GIUFEDGEINHH, mask);
309 giu_set(GIUREDGEINHH, mask);
310 break;
311 }
312 }
313 } else {
314 giu_clear(GIUINTTYPH, mask);
315 giu_clear(GIUINTHTSELH, mask);
316 }
317 giu_write(GIUINTSTATH, mask);
318 }
319}
320
321EXPORT_SYMBOL_GPL(vr41xx_set_irq_trigger);
322
323void vr41xx_set_irq_level(unsigned int pin, irq_level_t level)
324{
325 uint16_t mask;
326
327 if (pin < GIUINT_HIGH_OFFSET) {
328 mask = 1 << pin;
329 if (level == IRQ_LEVEL_HIGH)
330 giu_set(GIUINTALSELL, mask);
331 else
332 giu_clear(GIUINTALSELL, mask);
333 giu_write(GIUINTSTATL, mask);
334 } else if (pin < GIUINT_HIGH_MAX) {
335 mask = 1 << (pin - GIUINT_HIGH_OFFSET);
336 if (level == IRQ_LEVEL_HIGH)
337 giu_set(GIUINTALSELH, mask);
338 else
339 giu_clear(GIUINTALSELH, mask);
340 giu_write(GIUINTSTATH, mask);
341 }
342}
343
344EXPORT_SYMBOL_GPL(vr41xx_set_irq_level);
345
346gpio_data_t vr41xx_gpio_get_pin(unsigned int pin)
347{
348 uint16_t reg, mask;
349
350 if (pin >= giu_nr_pins)
351 return GPIO_DATA_INVAL;
352
353 if (pin < 16) {
354 reg = giu_read(GIUPIODL);
355 mask = (uint16_t)1 << pin;
356 } else if (pin < 32) {
357 reg = giu_read(GIUPIODH);
358 mask = (uint16_t)1 << (pin - 16);
359 } else if (pin < 48) {
360 reg = giu_read(GIUPODATL);
361 mask = (uint16_t)1 << (pin - 32);
362 } else {
363 reg = giu_read(GIUPODATH);
364 mask = (uint16_t)1 << (pin - 48);
365 }
366
367 if (reg & mask)
368 return GPIO_DATA_HIGH;
369
370 return GPIO_DATA_LOW;
371}
372
373EXPORT_SYMBOL_GPL(vr41xx_gpio_get_pin);
374
375int vr41xx_gpio_set_pin(unsigned int pin, gpio_data_t data)
376{
377 uint16_t offset, mask, reg;
378 unsigned long flags;
379
380 if (pin >= giu_nr_pins)
381 return -EINVAL;
382
383 if (pin < 16) {
384 offset = GIUPIODL;
385 mask = (uint16_t)1 << pin;
386 } else if (pin < 32) {
387 offset = GIUPIODH;
388 mask = (uint16_t)1 << (pin - 16);
389 } else if (pin < 48) {
390 offset = GIUPODATL;
391 mask = (uint16_t)1 << (pin - 32);
392 } else {
393 offset = GIUPODATH;
394 mask = (uint16_t)1 << (pin - 48);
395 }
396
397 spin_lock_irqsave(&giu_lock, flags);
398
399 reg = giu_read(offset);
400 if (data == GPIO_DATA_HIGH)
401 reg |= mask;
402 else
403 reg &= ~mask;
404 giu_write(offset, reg);
405
406 spin_unlock_irqrestore(&giu_lock, flags);
407
408 return 0;
409}
410
411EXPORT_SYMBOL_GPL(vr41xx_gpio_set_pin);
412
413int vr41xx_gpio_set_direction(unsigned int pin, gpio_direction_t dir)
414{
415 uint16_t offset, mask, reg;
416 unsigned long flags;
417
418 if (pin >= giu_nr_pins)
419 return -EINVAL;
420
421 if (pin < 16) {
422 offset = GIUIOSELL;
423 mask = (uint16_t)1 << pin;
424 } else if (pin < 32) {
425 offset = GIUIOSELH;
426 mask = (uint16_t)1 << (pin - 16);
427 } else {
428 if (giu_flags & GPIO_HAS_OUTPUT_ENABLE) {
429 offset = GIUPODATEN;
430 mask = (uint16_t)1 << (pin - 32);
431 } else {
432 switch (pin) {
433 case 48:
434 offset = GIUPODATH;
435 mask = PIOEN0;
436 break;
437 case 49:
438 offset = GIUPODATH;
439 mask = PIOEN1;
440 break;
441 default:
442 return -EINVAL;
443 }
444 }
445 }
446
447 spin_lock_irqsave(&giu_lock, flags);
448
449 reg = giu_read(offset);
450 if (dir == GPIO_OUTPUT)
451 reg |= mask;
452 else
453 reg &= ~mask;
454 giu_write(offset, reg);
455
456 spin_unlock_irqrestore(&giu_lock, flags);
457
458 return 0;
459}
460
461EXPORT_SYMBOL_GPL(vr41xx_gpio_set_direction);
462
463int vr41xx_gpio_pullupdown(unsigned int pin, gpio_pull_t pull)
464{
465 uint16_t reg, mask;
466 unsigned long flags;
467
468 if ((giu_flags & GPIO_HAS_PULLUPDOWN_IO) != GPIO_HAS_PULLUPDOWN_IO)
469 return -EPERM;
470
471 if (pin >= 15)
472 return -EINVAL;
473
474 mask = (uint16_t)1 << pin;
475
476 spin_lock_irqsave(&giu_lock, flags);
477
478 if (pull == GPIO_PULL_UP || pull == GPIO_PULL_DOWN) {
479 reg = giu_read(GIUTERMUPDN);
480 if (pull == GPIO_PULL_UP)
481 reg |= mask;
482 else
483 reg &= ~mask;
484 giu_write(GIUTERMUPDN, reg);
485
486 reg = giu_read(GIUUSEUPDN);
487 reg |= mask;
488 giu_write(GIUUSEUPDN, reg);
489 } else {
490 reg = giu_read(GIUUSEUPDN);
491 reg &= ~mask;
492 giu_write(GIUUSEUPDN, reg);
493 }
494
495 spin_unlock_irqrestore(&giu_lock, flags);
496
497 return 0;
498}
499
500EXPORT_SYMBOL_GPL(vr41xx_gpio_pullupdown);
501
502static ssize_t gpio_read(struct file *file, char __user *buf, size_t len,
503 loff_t *ppos)
504{
505 unsigned int pin;
506 char value = '0';
507
508 pin = iminor(file->f_dentry->d_inode);
509 if (pin >= giu_nr_pins)
510 return -EBADF;
511
512 if (vr41xx_gpio_get_pin(pin) == GPIO_DATA_HIGH)
513 value = '1';
514
515 if (len <= 0)
516 return -EFAULT;
517
518 if (put_user(value, buf))
519 return -EFAULT;
520
521 return 1;
522}
523
524static ssize_t gpio_write(struct file *file, const char __user *data,
525 size_t len, loff_t *ppos)
526{
527 unsigned int pin;
528 size_t i;
529 char c;
530 int retval = 0;
531
532 pin = iminor(file->f_dentry->d_inode);
533 if (pin >= giu_nr_pins)
534 return -EBADF;
535
536 for (i = 0; i < len; i++) {
537 if (get_user(c, data + i))
538 return -EFAULT;
539
540 switch (c) {
541 case '0':
542 retval = vr41xx_gpio_set_pin(pin, GPIO_DATA_LOW);
543 break;
544 case '1':
545 retval = vr41xx_gpio_set_pin(pin, GPIO_DATA_HIGH);
546 break;
547 case 'D':
548 printk(KERN_INFO "GPIO%d: pull down\n", pin);
549 retval = vr41xx_gpio_pullupdown(pin, GPIO_PULL_DOWN);
550 break;
551 case 'd':
552 printk(KERN_INFO "GPIO%d: pull up/down disable\n", pin);
553 retval = vr41xx_gpio_pullupdown(pin, GPIO_PULL_DISABLE);
554 break;
555 case 'I':
556 printk(KERN_INFO "GPIO%d: input\n", pin);
557 retval = vr41xx_gpio_set_direction(pin, GPIO_INPUT);
558 break;
559 case 'O':
560 printk(KERN_INFO "GPIO%d: output\n", pin);
561 retval = vr41xx_gpio_set_direction(pin, GPIO_OUTPUT);
562 break;
563 case 'o':
564 printk(KERN_INFO "GPIO%d: output disable\n", pin);
565 retval = vr41xx_gpio_set_direction(pin, GPIO_OUTPUT_DISABLE);
566 break;
567 case 'P':
568 printk(KERN_INFO "GPIO%d: pull up\n", pin);
569 retval = vr41xx_gpio_pullupdown(pin, GPIO_PULL_UP);
570 break;
571 case 'p':
572 printk(KERN_INFO "GPIO%d: pull up/down disable\n", pin);
573 retval = vr41xx_gpio_pullupdown(pin, GPIO_PULL_DISABLE);
574 break;
575 default:
576 break;
577 }
578
579 if (retval < 0)
580 break;
581 }
582
583 return i;
584}
585
586static int gpio_open(struct inode *inode, struct file *file)
587{
588 unsigned int pin;
589
590 pin = iminor(inode);
591 if (pin >= giu_nr_pins)
592 return -EBADF;
593
594 return nonseekable_open(inode, file);
595}
596
597static int gpio_release(struct inode *inode, struct file *file)
598{
599 unsigned int pin;
600
601 pin = iminor(inode);
602 if (pin >= giu_nr_pins)
603 return -EBADF;
604
605 return 0;
606}
607
608static struct file_operations gpio_fops = {
609 .owner = THIS_MODULE,
610 .read = gpio_read,
611 .write = gpio_write,
612 .open = gpio_open,
613 .release = gpio_release,
614};
615
616static int giu_probe(struct device *dev)
617{
618 unsigned long start, size, flags = 0;
619 unsigned int nr_pins = 0;
620 struct resource *res1, *res2 = NULL;
621 void *base;
622 int retval, i;
623
624 switch (current_cpu_data.cputype) {
625 case CPU_VR4111:
626 case CPU_VR4121:
627 start = GIU_TYPE1_START;
628 size = GIU_TYPE1_SIZE;
629 flags = GPIO_HAS_PULLUPDOWN_IO;
630 nr_pins = 50;
631 break;
632 case CPU_VR4122:
633 case CPU_VR4131:
634 start = GIU_TYPE2_START;
635 size = GIU_TYPE2_SIZE;
636 nr_pins = 36;
637 break;
638 case CPU_VR4133:
639 start = GIU_TYPE3_START;
640 size = GIU_TYPE3_SIZE;
641 flags = GPIO_HAS_INTERRUPT_EDGE_SELECT;
642 nr_pins = 48;
643 break;
644 default:
645 return -ENODEV;
646 }
647
648 res1 = request_mem_region(start, size, "GIU");
649 if (res1 == NULL)
650 return -EBUSY;
651
652 base = ioremap(start, size);
653 if (base == NULL) {
654 release_resource(res1);
655 return -ENOMEM;
656 }
657
658 if (flags & GPIO_HAS_PULLUPDOWN_IO) {
659 res2 = request_mem_region(GIU_PULLUPDOWN_START, GIU_PULLUPDOWN_SIZE, "GIU");
660 if (res2 == NULL) {
661 iounmap(base);
662 release_resource(res1);
663 return -EBUSY;
664 }
665 }
666
667 retval = register_chrdev(major, "GIU", &gpio_fops);
668 if (retval < 0) {
669 iounmap(base);
670 release_resource(res1);
671 release_resource(res2);
672 return retval;
673 }
674
675 if (major == 0) {
676 major = retval;
677 printk(KERN_INFO "GIU: major number %d\n", major);
678 }
679
680 spin_lock_init(&giu_lock);
681 giu_base = base;
682 giu_resource1 = res1;
683 giu_resource2 = res2;
684 giu_flags = flags;
685 giu_nr_pins = nr_pins;
686
687 giu_write(GIUINTENL, 0);
688 giu_write(GIUINTENH, 0);
689
690 for (i = GIU_IRQ_BASE; i <= GIU_IRQ_LAST; i++) {
691 if (i < GIU_IRQ(GIUINT_HIGH_OFFSET))
692 irq_desc[i].handler = &giuint_low_irq_type;
693 else
694 irq_desc[i].handler = &giuint_high_irq_type;
695 }
696
697 return cascade_irq(GIUINT_IRQ, giu_get_irq);
698}
699
700static int giu_remove(struct device *dev)
701{
702 iounmap(giu_base);
703
704 release_resource(giu_resource1);
705 if (giu_flags & GPIO_HAS_PULLUPDOWN_IO)
706 release_resource(giu_resource2);
707
708 return 0;
709}
710
711static struct platform_device *giu_platform_device;
712
713static struct device_driver giu_device_driver = {
714 .name = "GIU",
715 .bus = &platform_bus_type,
716 .probe = giu_probe,
717 .remove = giu_remove,
718};
719
720static int __devinit vr41xx_giu_init(void)
721{
722 int retval;
723
724 giu_platform_device = platform_device_register_simple("GIU", -1, NULL, 0);
725 if (IS_ERR(giu_platform_device))
726 return PTR_ERR(giu_platform_device);
727
728 retval = driver_register(&giu_device_driver);
729 if (retval < 0)
730 platform_device_unregister(giu_platform_device);
731
732 return retval;
733}
734
735static void __devexit vr41xx_giu_exit(void)
736{
737 driver_unregister(&giu_device_driver);
738
739 platform_device_unregister(giu_platform_device);
740}
741
742module_init(vr41xx_giu_init);
743module_exit(vr41xx_giu_exit);
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index e5ef1dfc5482..d7aa7a29f67e 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2867,6 +2867,10 @@ void unblank_screen(void)
2867 */ 2867 */
2868static void blank_screen_t(unsigned long dummy) 2868static void blank_screen_t(unsigned long dummy)
2869{ 2869{
2870 if (unlikely(!keventd_up())) {
2871 mod_timer(&console_timer, jiffies + blankinterval);
2872 return;
2873 }
2870 blank_timer_expired = 1; 2874 blank_timer_expired = 1;
2871 schedule_work(&console_work); 2875 schedule_work(&console_work);
2872} 2876}
diff --git a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c
index ab659d37b4d2..4e98c215e5b1 100644
--- a/drivers/char/watchdog/ixp2000_wdt.c
+++ b/drivers/char/watchdog/ixp2000_wdt.c
@@ -192,7 +192,12 @@ static struct miscdevice ixp2000_wdt_miscdev =
192 192
193static int __init ixp2000_wdt_init(void) 193static int __init ixp2000_wdt_init(void)
194{ 194{
195 wdt_tick_rate = (*IXP2000_T1_CLD * HZ)/ 256;; 195 if ((*IXP2000_PRODUCT_ID & 0x001ffef0) == 0x00000000) {
196 printk(KERN_INFO "Unable to use IXP2000 watchdog due to IXP2800 erratum #25.\n");
197 return -EIO;
198 }
199
200 wdt_tick_rate = (*IXP2000_T1_CLD * HZ) / 256;
196 201
197 return misc_register(&ixp2000_wdt_miscdev); 202 return misc_register(&ixp2000_wdt_miscdev);
198} 203}
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index 95882bb1950e..60c9be99c6d9 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -46,6 +46,10 @@ config CPU_FREQ_STAT_DETAILS
46 This will show detail CPU frequency translation table in sysfs file 46 This will show detail CPU frequency translation table in sysfs file
47 system 47 system
48 48
49# Note that it is not currently possible to set the other governors (such as ondemand)
50# as the default, since if they fail to initialise, cpufreq will be
51# left in an undefined state.
52
49choice 53choice
50 prompt "Default CPUFreq governor" 54 prompt "Default CPUFreq governor"
51 default CPU_FREQ_DEFAULT_GOV_USERSPACE if CPU_FREQ_SA1100 || CPU_FREQ_SA1110 55 default CPU_FREQ_DEFAULT_GOV_USERSPACE if CPU_FREQ_SA1100 || CPU_FREQ_SA1110
@@ -115,4 +119,24 @@ config CPU_FREQ_GOV_ONDEMAND
115 119
116 If in doubt, say N. 120 If in doubt, say N.
117 121
122config CPU_FREQ_GOV_CONSERVATIVE
123 tristate "'conservative' cpufreq governor"
124 depends on CPU_FREQ
125 help
126 'conservative' - this driver is rather similar to the 'ondemand'
127 governor both in its source code and its purpose, the difference is
128 its optimisation for better suitability in a battery powered
129 environment. The frequency is gracefully increased and decreased
130 rather than jumping to 100% when speed is required.
131
132 If you have a desktop machine then you should really be considering
133 the 'ondemand' governor instead, however if you are using a laptop,
134 PDA or even an AMD64 based computer (due to the unacceptable
135 step-by-step latency issues between the minimum and maximum frequency
136 transitions in the CPU) you will probably want to use this governor.
137
138 For details, take a look at linux/Documentation/cpu-freq.
139
140 If in doubt, say N.
141
118endif # CPU_FREQ 142endif # CPU_FREQ
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index 67b16e5a41a7..71fc3b4173f1 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_CPU_FREQ_GOV_PERFORMANCE) += cpufreq_performance.o
8obj-$(CONFIG_CPU_FREQ_GOV_POWERSAVE) += cpufreq_powersave.o 8obj-$(CONFIG_CPU_FREQ_GOV_POWERSAVE) += cpufreq_powersave.o
9obj-$(CONFIG_CPU_FREQ_GOV_USERSPACE) += cpufreq_userspace.o 9obj-$(CONFIG_CPU_FREQ_GOV_USERSPACE) += cpufreq_userspace.o
10obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND) += cpufreq_ondemand.o 10obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND) += cpufreq_ondemand.o
11obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE) += cpufreq_conservative.o
11 12
12# CPUfreq cross-arch helpers 13# CPUfreq cross-arch helpers
13obj-$(CONFIG_CPU_FREQ_TABLE) += freq_table.o 14obj-$(CONFIG_CPU_FREQ_TABLE) += freq_table.o
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 8e561313d094..bf62dfe4976a 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -258,7 +258,7 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
258 (likely(cpufreq_cpu_data[freqs->cpu]->cur)) && 258 (likely(cpufreq_cpu_data[freqs->cpu]->cur)) &&
259 (unlikely(freqs->old != cpufreq_cpu_data[freqs->cpu]->cur))) 259 (unlikely(freqs->old != cpufreq_cpu_data[freqs->cpu]->cur)))
260 { 260 {
261 printk(KERN_WARNING "Warning: CPU frequency is %u, " 261 dprintk(KERN_WARNING "Warning: CPU frequency is %u, "
262 "cpufreq assumed %u kHz.\n", freqs->old, cpufreq_cpu_data[freqs->cpu]->cur); 262 "cpufreq assumed %u kHz.\n", freqs->old, cpufreq_cpu_data[freqs->cpu]->cur);
263 freqs->old = cpufreq_cpu_data[freqs->cpu]->cur; 263 freqs->old = cpufreq_cpu_data[freqs->cpu]->cur;
264 } 264 }
@@ -521,7 +521,7 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr ,char * buf)
521 policy = cpufreq_cpu_get(policy->cpu); 521 policy = cpufreq_cpu_get(policy->cpu);
522 if (!policy) 522 if (!policy)
523 return -EINVAL; 523 return -EINVAL;
524 ret = fattr->show ? fattr->show(policy,buf) : 0; 524 ret = fattr->show ? fattr->show(policy,buf) : -EIO;
525 cpufreq_cpu_put(policy); 525 cpufreq_cpu_put(policy);
526 return ret; 526 return ret;
527} 527}
@@ -535,7 +535,7 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr,
535 policy = cpufreq_cpu_get(policy->cpu); 535 policy = cpufreq_cpu_get(policy->cpu);
536 if (!policy) 536 if (!policy)
537 return -EINVAL; 537 return -EINVAL;
538 ret = fattr->store ? fattr->store(policy,buf,count) : 0; 538 ret = fattr->store ? fattr->store(policy,buf,count) : -EIO;
539 cpufreq_cpu_put(policy); 539 cpufreq_cpu_put(policy);
540 return ret; 540 return ret;
541} 541}
@@ -814,7 +814,7 @@ static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, unsigne
814{ 814{
815 struct cpufreq_freqs freqs; 815 struct cpufreq_freqs freqs;
816 816
817 printk(KERN_WARNING "Warning: CPU frequency out of sync: cpufreq and timing " 817 dprintk(KERN_WARNING "Warning: CPU frequency out of sync: cpufreq and timing "
818 "core thinks of %u, is %u kHz.\n", old_freq, new_freq); 818 "core thinks of %u, is %u kHz.\n", old_freq, new_freq);
819 819
820 freqs.cpu = cpu; 820 freqs.cpu = cpu;
@@ -923,7 +923,7 @@ static int cpufreq_suspend(struct sys_device * sysdev, u32 state)
923 struct cpufreq_freqs freqs; 923 struct cpufreq_freqs freqs;
924 924
925 if (!(cpufreq_driver->flags & CPUFREQ_PM_NO_WARN)) 925 if (!(cpufreq_driver->flags & CPUFREQ_PM_NO_WARN))
926 printk(KERN_DEBUG "Warning: CPU frequency is %u, " 926 dprintk(KERN_DEBUG "Warning: CPU frequency is %u, "
927 "cpufreq assumed %u kHz.\n", 927 "cpufreq assumed %u kHz.\n",
928 cur_freq, cpu_policy->cur); 928 cur_freq, cpu_policy->cur);
929 929
@@ -1004,7 +1004,7 @@ static int cpufreq_resume(struct sys_device * sysdev)
1004 struct cpufreq_freqs freqs; 1004 struct cpufreq_freqs freqs;
1005 1005
1006 if (!(cpufreq_driver->flags & CPUFREQ_PM_NO_WARN)) 1006 if (!(cpufreq_driver->flags & CPUFREQ_PM_NO_WARN))
1007 printk(KERN_WARNING "Warning: CPU frequency" 1007 dprintk(KERN_WARNING "Warning: CPU frequency"
1008 "is %u, cpufreq assumed %u kHz.\n", 1008 "is %u, cpufreq assumed %u kHz.\n",
1009 cur_freq, cpu_policy->cur); 1009 cur_freq, cpu_policy->cur);
1010 1010
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
new file mode 100644
index 000000000000..e1df376e709e
--- /dev/null
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -0,0 +1,586 @@
1/*
2 * drivers/cpufreq/cpufreq_conservative.c
3 *
4 * Copyright (C) 2001 Russell King
5 * (C) 2003 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>.
6 * Jun Nakajima <jun.nakajima@intel.com>
7 * (C) 2004 Alexander Clouter <alex-kernel@digriz.org.uk>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/module.h>
16#include <linux/smp.h>
17#include <linux/init.h>
18#include <linux/interrupt.h>
19#include <linux/ctype.h>
20#include <linux/cpufreq.h>
21#include <linux/sysctl.h>
22#include <linux/types.h>
23#include <linux/fs.h>
24#include <linux/sysfs.h>
25#include <linux/sched.h>
26#include <linux/kmod.h>
27#include <linux/workqueue.h>
28#include <linux/jiffies.h>
29#include <linux/kernel_stat.h>
30#include <linux/percpu.h>
31
32/*
33 * dbs is used in this file as a shortform for demandbased switching
34 * It helps to keep variable names smaller, simpler
35 */
36
37#define DEF_FREQUENCY_UP_THRESHOLD (80)
38#define MIN_FREQUENCY_UP_THRESHOLD (0)
39#define MAX_FREQUENCY_UP_THRESHOLD (100)
40
41#define DEF_FREQUENCY_DOWN_THRESHOLD (20)
42#define MIN_FREQUENCY_DOWN_THRESHOLD (0)
43#define MAX_FREQUENCY_DOWN_THRESHOLD (100)
44
45/*
46 * The polling frequency of this governor depends on the capability of
47 * the processor. Default polling frequency is 1000 times the transition
48 * latency of the processor. The governor will work on any processor with
49 * transition latency <= 10mS, using appropriate sampling
50 * rate.
51 * For CPUs with transition latency > 10mS (mostly drivers with CPUFREQ_ETERNAL)
52 * this governor will not work.
53 * All times here are in uS.
54 */
55static unsigned int def_sampling_rate;
56#define MIN_SAMPLING_RATE (def_sampling_rate / 2)
57#define MAX_SAMPLING_RATE (500 * def_sampling_rate)
58#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (100000)
59#define DEF_SAMPLING_DOWN_FACTOR (5)
60#define TRANSITION_LATENCY_LIMIT (10 * 1000)
61
62static void do_dbs_timer(void *data);
63
64struct cpu_dbs_info_s {
65 struct cpufreq_policy *cur_policy;
66 unsigned int prev_cpu_idle_up;
67 unsigned int prev_cpu_idle_down;
68 unsigned int enable;
69};
70static DEFINE_PER_CPU(struct cpu_dbs_info_s, cpu_dbs_info);
71
72static unsigned int dbs_enable; /* number of CPUs using this policy */
73
74static DECLARE_MUTEX (dbs_sem);
75static DECLARE_WORK (dbs_work, do_dbs_timer, NULL);
76
77struct dbs_tuners {
78 unsigned int sampling_rate;
79 unsigned int sampling_down_factor;
80 unsigned int up_threshold;
81 unsigned int down_threshold;
82 unsigned int ignore_nice;
83 unsigned int freq_step;
84};
85
86static struct dbs_tuners dbs_tuners_ins = {
87 .up_threshold = DEF_FREQUENCY_UP_THRESHOLD,
88 .down_threshold = DEF_FREQUENCY_DOWN_THRESHOLD,
89 .sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR,
90};
91
92static inline unsigned int get_cpu_idle_time(unsigned int cpu)
93{
94 return kstat_cpu(cpu).cpustat.idle +
95 kstat_cpu(cpu).cpustat.iowait +
96 ( !dbs_tuners_ins.ignore_nice ?
97 kstat_cpu(cpu).cpustat.nice :
98 0);
99}
100
101/************************** sysfs interface ************************/
102static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf)
103{
104 return sprintf (buf, "%u\n", MAX_SAMPLING_RATE);
105}
106
107static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf)
108{
109 return sprintf (buf, "%u\n", MIN_SAMPLING_RATE);
110}
111
112#define define_one_ro(_name) \
113static struct freq_attr _name = \
114__ATTR(_name, 0444, show_##_name, NULL)
115
116define_one_ro(sampling_rate_max);
117define_one_ro(sampling_rate_min);
118
119/* cpufreq_conservative Governor Tunables */
120#define show_one(file_name, object) \
121static ssize_t show_##file_name \
122(struct cpufreq_policy *unused, char *buf) \
123{ \
124 return sprintf(buf, "%u\n", dbs_tuners_ins.object); \
125}
126show_one(sampling_rate, sampling_rate);
127show_one(sampling_down_factor, sampling_down_factor);
128show_one(up_threshold, up_threshold);
129show_one(down_threshold, down_threshold);
130show_one(ignore_nice, ignore_nice);
131show_one(freq_step, freq_step);
132
133static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused,
134 const char *buf, size_t count)
135{
136 unsigned int input;
137 int ret;
138 ret = sscanf (buf, "%u", &input);
139 if (ret != 1 )
140 return -EINVAL;
141
142 down(&dbs_sem);
143 dbs_tuners_ins.sampling_down_factor = input;
144 up(&dbs_sem);
145
146 return count;
147}
148
149static ssize_t store_sampling_rate(struct cpufreq_policy *unused,
150 const char *buf, size_t count)
151{
152 unsigned int input;
153 int ret;
154 ret = sscanf (buf, "%u", &input);
155
156 down(&dbs_sem);
157 if (ret != 1 || input > MAX_SAMPLING_RATE || input < MIN_SAMPLING_RATE) {
158 up(&dbs_sem);
159 return -EINVAL;
160 }
161
162 dbs_tuners_ins.sampling_rate = input;
163 up(&dbs_sem);
164
165 return count;
166}
167
168static ssize_t store_up_threshold(struct cpufreq_policy *unused,
169 const char *buf, size_t count)
170{
171 unsigned int input;
172 int ret;
173 ret = sscanf (buf, "%u", &input);
174
175 down(&dbs_sem);
176 if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD ||
177 input < MIN_FREQUENCY_UP_THRESHOLD ||
178 input <= dbs_tuners_ins.down_threshold) {
179 up(&dbs_sem);
180 return -EINVAL;
181 }
182
183 dbs_tuners_ins.up_threshold = input;
184 up(&dbs_sem);
185
186 return count;
187}
188
189static ssize_t store_down_threshold(struct cpufreq_policy *unused,
190 const char *buf, size_t count)
191{
192 unsigned int input;
193 int ret;
194 ret = sscanf (buf, "%u", &input);
195
196 down(&dbs_sem);
197 if (ret != 1 || input > MAX_FREQUENCY_DOWN_THRESHOLD ||
198 input < MIN_FREQUENCY_DOWN_THRESHOLD ||
199 input >= dbs_tuners_ins.up_threshold) {
200 up(&dbs_sem);
201 return -EINVAL;
202 }
203
204 dbs_tuners_ins.down_threshold = input;
205 up(&dbs_sem);
206
207 return count;
208}
209
210static ssize_t store_ignore_nice(struct cpufreq_policy *policy,
211 const char *buf, size_t count)
212{
213 unsigned int input;
214 int ret;
215
216 unsigned int j;
217
218 ret = sscanf (buf, "%u", &input);
219 if ( ret != 1 )
220 return -EINVAL;
221
222 if ( input > 1 )
223 input = 1;
224
225 down(&dbs_sem);
226 if ( input == dbs_tuners_ins.ignore_nice ) { /* nothing to do */
227 up(&dbs_sem);
228 return count;
229 }
230 dbs_tuners_ins.ignore_nice = input;
231
232 /* we need to re-evaluate prev_cpu_idle_up and prev_cpu_idle_down */
233 for_each_online_cpu(j) {
234 struct cpu_dbs_info_s *j_dbs_info;
235 j_dbs_info = &per_cpu(cpu_dbs_info, j);
236 j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j);
237 j_dbs_info->prev_cpu_idle_down = j_dbs_info->prev_cpu_idle_up;
238 }
239 up(&dbs_sem);
240
241 return count;
242}
243
244static ssize_t store_freq_step(struct cpufreq_policy *policy,
245 const char *buf, size_t count)
246{
247 unsigned int input;
248 int ret;
249
250 ret = sscanf (buf, "%u", &input);
251
252 if ( ret != 1 )
253 return -EINVAL;
254
255 if ( input > 100 )
256 input = 100;
257
258 /* no need to test here if freq_step is zero as the user might actually
259 * want this, they would be crazy though :) */
260 down(&dbs_sem);
261 dbs_tuners_ins.freq_step = input;
262 up(&dbs_sem);
263
264 return count;
265}
266
267#define define_one_rw(_name) \
268static struct freq_attr _name = \
269__ATTR(_name, 0644, show_##_name, store_##_name)
270
271define_one_rw(sampling_rate);
272define_one_rw(sampling_down_factor);
273define_one_rw(up_threshold);
274define_one_rw(down_threshold);
275define_one_rw(ignore_nice);
276define_one_rw(freq_step);
277
278static struct attribute * dbs_attributes[] = {
279 &sampling_rate_max.attr,
280 &sampling_rate_min.attr,
281 &sampling_rate.attr,
282 &sampling_down_factor.attr,
283 &up_threshold.attr,
284 &down_threshold.attr,
285 &ignore_nice.attr,
286 &freq_step.attr,
287 NULL
288};
289
290static struct attribute_group dbs_attr_group = {
291 .attrs = dbs_attributes,
292 .name = "conservative",
293};
294
295/************************** sysfs end ************************/
296
297static void dbs_check_cpu(int cpu)
298{
299 unsigned int idle_ticks, up_idle_ticks, down_idle_ticks;
300 unsigned int freq_step;
301 unsigned int freq_down_sampling_rate;
302 static int down_skip[NR_CPUS];
303 static int requested_freq[NR_CPUS];
304 static unsigned short init_flag = 0;
305 struct cpu_dbs_info_s *this_dbs_info;
306 struct cpu_dbs_info_s *dbs_info;
307
308 struct cpufreq_policy *policy;
309 unsigned int j;
310
311 this_dbs_info = &per_cpu(cpu_dbs_info, cpu);
312 if (!this_dbs_info->enable)
313 return;
314
315 policy = this_dbs_info->cur_policy;
316
317 if ( init_flag == 0 ) {
318 for ( /* NULL */; init_flag < NR_CPUS; init_flag++ ) {
319 dbs_info = &per_cpu(cpu_dbs_info, init_flag);
320 requested_freq[cpu] = dbs_info->cur_policy->cur;
321 }
322 init_flag = 1;
323 }
324
325 /*
326 * The default safe range is 20% to 80%
327 * Every sampling_rate, we check
328 * - If current idle time is less than 20%, then we try to
329 * increase frequency
330 * Every sampling_rate*sampling_down_factor, we check
331 * - If current idle time is more than 80%, then we try to
332 * decrease frequency
333 *
334 * Any frequency increase takes it to the maximum frequency.
335 * Frequency reduction happens at minimum steps of
336 * 5% (default) of max_frequency
337 */
338
339 /* Check for frequency increase */
340
341 idle_ticks = UINT_MAX;
342 for_each_cpu_mask(j, policy->cpus) {
343 unsigned int tmp_idle_ticks, total_idle_ticks;
344 struct cpu_dbs_info_s *j_dbs_info;
345
346 j_dbs_info = &per_cpu(cpu_dbs_info, j);
347 /* Check for frequency increase */
348 total_idle_ticks = get_cpu_idle_time(j);
349 tmp_idle_ticks = total_idle_ticks -
350 j_dbs_info->prev_cpu_idle_up;
351 j_dbs_info->prev_cpu_idle_up = total_idle_ticks;
352
353 if (tmp_idle_ticks < idle_ticks)
354 idle_ticks = tmp_idle_ticks;
355 }
356
357 /* Scale idle ticks by 100 and compare with up and down ticks */
358 idle_ticks *= 100;
359 up_idle_ticks = (100 - dbs_tuners_ins.up_threshold) *
360 usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
361
362 if (idle_ticks < up_idle_ticks) {
363 down_skip[cpu] = 0;
364 for_each_cpu_mask(j, policy->cpus) {
365 struct cpu_dbs_info_s *j_dbs_info;
366
367 j_dbs_info = &per_cpu(cpu_dbs_info, j);
368 j_dbs_info->prev_cpu_idle_down =
369 j_dbs_info->prev_cpu_idle_up;
370 }
371 /* if we are already at full speed then break out early */
372 if (requested_freq[cpu] == policy->max)
373 return;
374
375 freq_step = (dbs_tuners_ins.freq_step * policy->max) / 100;
376
377 /* max freq cannot be less than 100. But who knows.... */
378 if (unlikely(freq_step == 0))
379 freq_step = 5;
380
381 requested_freq[cpu] += freq_step;
382 if (requested_freq[cpu] > policy->max)
383 requested_freq[cpu] = policy->max;
384
385 __cpufreq_driver_target(policy, requested_freq[cpu],
386 CPUFREQ_RELATION_H);
387 return;
388 }
389
390 /* Check for frequency decrease */
391 down_skip[cpu]++;
392 if (down_skip[cpu] < dbs_tuners_ins.sampling_down_factor)
393 return;
394
395 idle_ticks = UINT_MAX;
396 for_each_cpu_mask(j, policy->cpus) {
397 unsigned int tmp_idle_ticks, total_idle_ticks;
398 struct cpu_dbs_info_s *j_dbs_info;
399
400 j_dbs_info = &per_cpu(cpu_dbs_info, j);
401 total_idle_ticks = j_dbs_info->prev_cpu_idle_up;
402 tmp_idle_ticks = total_idle_ticks -
403 j_dbs_info->prev_cpu_idle_down;
404 j_dbs_info->prev_cpu_idle_down = total_idle_ticks;
405
406 if (tmp_idle_ticks < idle_ticks)
407 idle_ticks = tmp_idle_ticks;
408 }
409
410 /* Scale idle ticks by 100 and compare with up and down ticks */
411 idle_ticks *= 100;
412 down_skip[cpu] = 0;
413
414 freq_down_sampling_rate = dbs_tuners_ins.sampling_rate *
415 dbs_tuners_ins.sampling_down_factor;
416 down_idle_ticks = (100 - dbs_tuners_ins.down_threshold) *
417 usecs_to_jiffies(freq_down_sampling_rate);
418
419 if (idle_ticks > down_idle_ticks) {
420 /* if we are already at the lowest speed then break out early
421 * or if we 'cannot' reduce the speed as the user might want
422 * freq_step to be zero */
423 if (requested_freq[cpu] == policy->min
424 || dbs_tuners_ins.freq_step == 0)
425 return;
426
427 freq_step = (dbs_tuners_ins.freq_step * policy->max) / 100;
428
429 /* max freq cannot be less than 100. But who knows.... */
430 if (unlikely(freq_step == 0))
431 freq_step = 5;
432
433 requested_freq[cpu] -= freq_step;
434 if (requested_freq[cpu] < policy->min)
435 requested_freq[cpu] = policy->min;
436
437 __cpufreq_driver_target(policy,
438 requested_freq[cpu],
439 CPUFREQ_RELATION_H);
440 return;
441 }
442}
443
444static void do_dbs_timer(void *data)
445{
446 int i;
447 down(&dbs_sem);
448 for_each_online_cpu(i)
449 dbs_check_cpu(i);
450 schedule_delayed_work(&dbs_work,
451 usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
452 up(&dbs_sem);
453}
454
455static inline void dbs_timer_init(void)
456{
457 INIT_WORK(&dbs_work, do_dbs_timer, NULL);
458 schedule_delayed_work(&dbs_work,
459 usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
460 return;
461}
462
463static inline void dbs_timer_exit(void)
464{
465 cancel_delayed_work(&dbs_work);
466 return;
467}
468
469static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
470 unsigned int event)
471{
472 unsigned int cpu = policy->cpu;
473 struct cpu_dbs_info_s *this_dbs_info;
474 unsigned int j;
475
476 this_dbs_info = &per_cpu(cpu_dbs_info, cpu);
477
478 switch (event) {
479 case CPUFREQ_GOV_START:
480 if ((!cpu_online(cpu)) ||
481 (!policy->cur))
482 return -EINVAL;
483
484 if (policy->cpuinfo.transition_latency >
485 (TRANSITION_LATENCY_LIMIT * 1000))
486 return -EINVAL;
487 if (this_dbs_info->enable) /* Already enabled */
488 break;
489
490 down(&dbs_sem);
491 for_each_cpu_mask(j, policy->cpus) {
492 struct cpu_dbs_info_s *j_dbs_info;
493 j_dbs_info = &per_cpu(cpu_dbs_info, j);
494 j_dbs_info->cur_policy = policy;
495
496 j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j);
497 j_dbs_info->prev_cpu_idle_down
498 = j_dbs_info->prev_cpu_idle_up;
499 }
500 this_dbs_info->enable = 1;
501 sysfs_create_group(&policy->kobj, &dbs_attr_group);
502 dbs_enable++;
503 /*
504 * Start the timerschedule work, when this governor
505 * is used for first time
506 */
507 if (dbs_enable == 1) {
508 unsigned int latency;
509 /* policy latency is in nS. Convert it to uS first */
510
511 latency = policy->cpuinfo.transition_latency;
512 if (latency < 1000)
513 latency = 1000;
514
515 def_sampling_rate = (latency / 1000) *
516 DEF_SAMPLING_RATE_LATENCY_MULTIPLIER;
517 dbs_tuners_ins.sampling_rate = def_sampling_rate;
518 dbs_tuners_ins.ignore_nice = 0;
519 dbs_tuners_ins.freq_step = 5;
520
521 dbs_timer_init();
522 }
523
524 up(&dbs_sem);
525 break;
526
527 case CPUFREQ_GOV_STOP:
528 down(&dbs_sem);
529 this_dbs_info->enable = 0;
530 sysfs_remove_group(&policy->kobj, &dbs_attr_group);
531 dbs_enable--;
532 /*
533 * Stop the timerschedule work, when this governor
534 * is used for first time
535 */
536 if (dbs_enable == 0)
537 dbs_timer_exit();
538
539 up(&dbs_sem);
540
541 break;
542
543 case CPUFREQ_GOV_LIMITS:
544 down(&dbs_sem);
545 if (policy->max < this_dbs_info->cur_policy->cur)
546 __cpufreq_driver_target(
547 this_dbs_info->cur_policy,
548 policy->max, CPUFREQ_RELATION_H);
549 else if (policy->min > this_dbs_info->cur_policy->cur)
550 __cpufreq_driver_target(
551 this_dbs_info->cur_policy,
552 policy->min, CPUFREQ_RELATION_L);
553 up(&dbs_sem);
554 break;
555 }
556 return 0;
557}
558
559static struct cpufreq_governor cpufreq_gov_dbs = {
560 .name = "conservative",
561 .governor = cpufreq_governor_dbs,
562 .owner = THIS_MODULE,
563};
564
565static int __init cpufreq_gov_dbs_init(void)
566{
567 return cpufreq_register_governor(&cpufreq_gov_dbs);
568}
569
570static void __exit cpufreq_gov_dbs_exit(void)
571{
572 /* Make sure that the scheduled work is indeed not running */
573 flush_scheduled_work();
574
575 cpufreq_unregister_governor(&cpufreq_gov_dbs);
576}
577
578
579MODULE_AUTHOR ("Alexander Clouter <alex-kernel@digriz.org.uk>");
580MODULE_DESCRIPTION ("'cpufreq_conservative' - A dynamic cpufreq governor for "
581 "Low Latency Frequency Transition capable processors "
582 "optimised for use in a battery environment");
583MODULE_LICENSE ("GPL");
584
585module_init(cpufreq_gov_dbs_init);
586module_exit(cpufreq_gov_dbs_exit);
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 8d83a21c6477..c1fc9c62bb51 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -34,13 +34,9 @@
34 */ 34 */
35 35
36#define DEF_FREQUENCY_UP_THRESHOLD (80) 36#define DEF_FREQUENCY_UP_THRESHOLD (80)
37#define MIN_FREQUENCY_UP_THRESHOLD (0) 37#define MIN_FREQUENCY_UP_THRESHOLD (11)
38#define MAX_FREQUENCY_UP_THRESHOLD (100) 38#define MAX_FREQUENCY_UP_THRESHOLD (100)
39 39
40#define DEF_FREQUENCY_DOWN_THRESHOLD (20)
41#define MIN_FREQUENCY_DOWN_THRESHOLD (0)
42#define MAX_FREQUENCY_DOWN_THRESHOLD (100)
43
44/* 40/*
45 * The polling frequency of this governor depends on the capability of 41 * The polling frequency of this governor depends on the capability of
46 * the processor. Default polling frequency is 1000 times the transition 42 * the processor. Default polling frequency is 1000 times the transition
@@ -55,9 +51,9 @@ static unsigned int def_sampling_rate;
55#define MIN_SAMPLING_RATE (def_sampling_rate / 2) 51#define MIN_SAMPLING_RATE (def_sampling_rate / 2)
56#define MAX_SAMPLING_RATE (500 * def_sampling_rate) 52#define MAX_SAMPLING_RATE (500 * def_sampling_rate)
57#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000) 53#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000)
58#define DEF_SAMPLING_DOWN_FACTOR (10) 54#define DEF_SAMPLING_DOWN_FACTOR (1)
55#define MAX_SAMPLING_DOWN_FACTOR (10)
59#define TRANSITION_LATENCY_LIMIT (10 * 1000) 56#define TRANSITION_LATENCY_LIMIT (10 * 1000)
60#define sampling_rate_in_HZ(x) (((x * HZ) < (1000 * 1000))?1:((x * HZ) / (1000 * 1000)))
61 57
62static void do_dbs_timer(void *data); 58static void do_dbs_timer(void *data);
63 59
@@ -78,15 +74,23 @@ struct dbs_tuners {
78 unsigned int sampling_rate; 74 unsigned int sampling_rate;
79 unsigned int sampling_down_factor; 75 unsigned int sampling_down_factor;
80 unsigned int up_threshold; 76 unsigned int up_threshold;
81 unsigned int down_threshold; 77 unsigned int ignore_nice;
82}; 78};
83 79
84static struct dbs_tuners dbs_tuners_ins = { 80static struct dbs_tuners dbs_tuners_ins = {
85 .up_threshold = DEF_FREQUENCY_UP_THRESHOLD, 81 .up_threshold = DEF_FREQUENCY_UP_THRESHOLD,
86 .down_threshold = DEF_FREQUENCY_DOWN_THRESHOLD,
87 .sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR, 82 .sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR,
88}; 83};
89 84
85static inline unsigned int get_cpu_idle_time(unsigned int cpu)
86{
87 return kstat_cpu(cpu).cpustat.idle +
88 kstat_cpu(cpu).cpustat.iowait +
89 ( !dbs_tuners_ins.ignore_nice ?
90 kstat_cpu(cpu).cpustat.nice :
91 0);
92}
93
90/************************** sysfs interface ************************/ 94/************************** sysfs interface ************************/
91static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf) 95static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf)
92{ 96{
@@ -115,7 +119,7 @@ static ssize_t show_##file_name \
115show_one(sampling_rate, sampling_rate); 119show_one(sampling_rate, sampling_rate);
116show_one(sampling_down_factor, sampling_down_factor); 120show_one(sampling_down_factor, sampling_down_factor);
117show_one(up_threshold, up_threshold); 121show_one(up_threshold, up_threshold);
118show_one(down_threshold, down_threshold); 122show_one(ignore_nice, ignore_nice);
119 123
120static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused, 124static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused,
121 const char *buf, size_t count) 125 const char *buf, size_t count)
@@ -126,6 +130,9 @@ static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused,
126 if (ret != 1 ) 130 if (ret != 1 )
127 return -EINVAL; 131 return -EINVAL;
128 132
133 if (input > MAX_SAMPLING_DOWN_FACTOR || input < 1)
134 return -EINVAL;
135
129 down(&dbs_sem); 136 down(&dbs_sem);
130 dbs_tuners_ins.sampling_down_factor = input; 137 dbs_tuners_ins.sampling_down_factor = input;
131 up(&dbs_sem); 138 up(&dbs_sem);
@@ -161,8 +168,7 @@ static ssize_t store_up_threshold(struct cpufreq_policy *unused,
161 168
162 down(&dbs_sem); 169 down(&dbs_sem);
163 if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD || 170 if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD ||
164 input < MIN_FREQUENCY_UP_THRESHOLD || 171 input < MIN_FREQUENCY_UP_THRESHOLD) {
165 input <= dbs_tuners_ins.down_threshold) {
166 up(&dbs_sem); 172 up(&dbs_sem);
167 return -EINVAL; 173 return -EINVAL;
168 } 174 }
@@ -173,22 +179,35 @@ static ssize_t store_up_threshold(struct cpufreq_policy *unused,
173 return count; 179 return count;
174} 180}
175 181
176static ssize_t store_down_threshold(struct cpufreq_policy *unused, 182static ssize_t store_ignore_nice(struct cpufreq_policy *policy,
177 const char *buf, size_t count) 183 const char *buf, size_t count)
178{ 184{
179 unsigned int input; 185 unsigned int input;
180 int ret; 186 int ret;
187
188 unsigned int j;
189
181 ret = sscanf (buf, "%u", &input); 190 ret = sscanf (buf, "%u", &input);
191 if ( ret != 1 )
192 return -EINVAL;
182 193
194 if ( input > 1 )
195 input = 1;
196
183 down(&dbs_sem); 197 down(&dbs_sem);
184 if (ret != 1 || input > MAX_FREQUENCY_DOWN_THRESHOLD || 198 if ( input == dbs_tuners_ins.ignore_nice ) { /* nothing to do */
185 input < MIN_FREQUENCY_DOWN_THRESHOLD ||
186 input >= dbs_tuners_ins.up_threshold) {
187 up(&dbs_sem); 199 up(&dbs_sem);
188 return -EINVAL; 200 return count;
189 } 201 }
202 dbs_tuners_ins.ignore_nice = input;
190 203
191 dbs_tuners_ins.down_threshold = input; 204 /* we need to re-evaluate prev_cpu_idle_up and prev_cpu_idle_down */
205 for_each_online_cpu(j) {
206 struct cpu_dbs_info_s *j_dbs_info;
207 j_dbs_info = &per_cpu(cpu_dbs_info, j);
208 j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j);
209 j_dbs_info->prev_cpu_idle_down = j_dbs_info->prev_cpu_idle_up;
210 }
192 up(&dbs_sem); 211 up(&dbs_sem);
193 212
194 return count; 213 return count;
@@ -201,7 +220,7 @@ __ATTR(_name, 0644, show_##_name, store_##_name)
201define_one_rw(sampling_rate); 220define_one_rw(sampling_rate);
202define_one_rw(sampling_down_factor); 221define_one_rw(sampling_down_factor);
203define_one_rw(up_threshold); 222define_one_rw(up_threshold);
204define_one_rw(down_threshold); 223define_one_rw(ignore_nice);
205 224
206static struct attribute * dbs_attributes[] = { 225static struct attribute * dbs_attributes[] = {
207 &sampling_rate_max.attr, 226 &sampling_rate_max.attr,
@@ -209,7 +228,7 @@ static struct attribute * dbs_attributes[] = {
209 &sampling_rate.attr, 228 &sampling_rate.attr,
210 &sampling_down_factor.attr, 229 &sampling_down_factor.attr,
211 &up_threshold.attr, 230 &up_threshold.attr,
212 &down_threshold.attr, 231 &ignore_nice.attr,
213 NULL 232 NULL
214}; 233};
215 234
@@ -222,9 +241,8 @@ static struct attribute_group dbs_attr_group = {
222 241
223static void dbs_check_cpu(int cpu) 242static void dbs_check_cpu(int cpu)
224{ 243{
225 unsigned int idle_ticks, up_idle_ticks, down_idle_ticks; 244 unsigned int idle_ticks, up_idle_ticks, total_ticks;
226 unsigned int total_idle_ticks; 245 unsigned int freq_next;
227 unsigned int freq_down_step;
228 unsigned int freq_down_sampling_rate; 246 unsigned int freq_down_sampling_rate;
229 static int down_skip[NR_CPUS]; 247 static int down_skip[NR_CPUS];
230 struct cpu_dbs_info_s *this_dbs_info; 248 struct cpu_dbs_info_s *this_dbs_info;
@@ -238,38 +256,25 @@ static void dbs_check_cpu(int cpu)
238 256
239 policy = this_dbs_info->cur_policy; 257 policy = this_dbs_info->cur_policy;
240 /* 258 /*
241 * The default safe range is 20% to 80% 259 * Every sampling_rate, we check, if current idle time is less
242 * Every sampling_rate, we check 260 * than 20% (default), then we try to increase frequency
243 * - If current idle time is less than 20%, then we try to 261 * Every sampling_rate*sampling_down_factor, we look for a the lowest
244 * increase frequency 262 * frequency which can sustain the load while keeping idle time over
245 * Every sampling_rate*sampling_down_factor, we check 263 * 30%. If such a frequency exist, we try to decrease to this frequency.
246 * - If current idle time is more than 80%, then we try to
247 * decrease frequency
248 * 264 *
249 * Any frequency increase takes it to the maximum frequency. 265 * Any frequency increase takes it to the maximum frequency.
250 * Frequency reduction happens at minimum steps of 266 * Frequency reduction happens at minimum steps of
251 * 5% of max_frequency 267 * 5% (default) of current frequency
252 */ 268 */
253 269
254 /* Check for frequency increase */ 270 /* Check for frequency increase */
255 total_idle_ticks = kstat_cpu(cpu).cpustat.idle + 271 idle_ticks = UINT_MAX;
256 kstat_cpu(cpu).cpustat.iowait;
257 idle_ticks = total_idle_ticks -
258 this_dbs_info->prev_cpu_idle_up;
259 this_dbs_info->prev_cpu_idle_up = total_idle_ticks;
260
261
262 for_each_cpu_mask(j, policy->cpus) { 272 for_each_cpu_mask(j, policy->cpus) {
263 unsigned int tmp_idle_ticks; 273 unsigned int tmp_idle_ticks, total_idle_ticks;
264 struct cpu_dbs_info_s *j_dbs_info; 274 struct cpu_dbs_info_s *j_dbs_info;
265 275
266 if (j == cpu)
267 continue;
268
269 j_dbs_info = &per_cpu(cpu_dbs_info, j); 276 j_dbs_info = &per_cpu(cpu_dbs_info, j);
270 /* Check for frequency increase */ 277 total_idle_ticks = get_cpu_idle_time(j);
271 total_idle_ticks = kstat_cpu(j).cpustat.idle +
272 kstat_cpu(j).cpustat.iowait;
273 tmp_idle_ticks = total_idle_ticks - 278 tmp_idle_ticks = total_idle_ticks -
274 j_dbs_info->prev_cpu_idle_up; 279 j_dbs_info->prev_cpu_idle_up;
275 j_dbs_info->prev_cpu_idle_up = total_idle_ticks; 280 j_dbs_info->prev_cpu_idle_up = total_idle_ticks;
@@ -281,13 +286,23 @@ static void dbs_check_cpu(int cpu)
281 /* Scale idle ticks by 100 and compare with up and down ticks */ 286 /* Scale idle ticks by 100 and compare with up and down ticks */
282 idle_ticks *= 100; 287 idle_ticks *= 100;
283 up_idle_ticks = (100 - dbs_tuners_ins.up_threshold) * 288 up_idle_ticks = (100 - dbs_tuners_ins.up_threshold) *
284 sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate); 289 usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
285 290
286 if (idle_ticks < up_idle_ticks) { 291 if (idle_ticks < up_idle_ticks) {
292 down_skip[cpu] = 0;
293 for_each_cpu_mask(j, policy->cpus) {
294 struct cpu_dbs_info_s *j_dbs_info;
295
296 j_dbs_info = &per_cpu(cpu_dbs_info, j);
297 j_dbs_info->prev_cpu_idle_down =
298 j_dbs_info->prev_cpu_idle_up;
299 }
300 /* if we are already at full speed then break out early */
301 if (policy->cur == policy->max)
302 return;
303
287 __cpufreq_driver_target(policy, policy->max, 304 __cpufreq_driver_target(policy, policy->max,
288 CPUFREQ_RELATION_H); 305 CPUFREQ_RELATION_H);
289 down_skip[cpu] = 0;
290 this_dbs_info->prev_cpu_idle_down = total_idle_ticks;
291 return; 306 return;
292 } 307 }
293 308
@@ -296,23 +311,14 @@ static void dbs_check_cpu(int cpu)
296 if (down_skip[cpu] < dbs_tuners_ins.sampling_down_factor) 311 if (down_skip[cpu] < dbs_tuners_ins.sampling_down_factor)
297 return; 312 return;
298 313
299 total_idle_ticks = kstat_cpu(cpu).cpustat.idle + 314 idle_ticks = UINT_MAX;
300 kstat_cpu(cpu).cpustat.iowait;
301 idle_ticks = total_idle_ticks -
302 this_dbs_info->prev_cpu_idle_down;
303 this_dbs_info->prev_cpu_idle_down = total_idle_ticks;
304
305 for_each_cpu_mask(j, policy->cpus) { 315 for_each_cpu_mask(j, policy->cpus) {
306 unsigned int tmp_idle_ticks; 316 unsigned int tmp_idle_ticks, total_idle_ticks;
307 struct cpu_dbs_info_s *j_dbs_info; 317 struct cpu_dbs_info_s *j_dbs_info;
308 318
309 if (j == cpu)
310 continue;
311
312 j_dbs_info = &per_cpu(cpu_dbs_info, j); 319 j_dbs_info = &per_cpu(cpu_dbs_info, j);
313 /* Check for frequency increase */ 320 /* Check for frequency decrease */
314 total_idle_ticks = kstat_cpu(j).cpustat.idle + 321 total_idle_ticks = j_dbs_info->prev_cpu_idle_up;
315 kstat_cpu(j).cpustat.iowait;
316 tmp_idle_ticks = total_idle_ticks - 322 tmp_idle_ticks = total_idle_ticks -
317 j_dbs_info->prev_cpu_idle_down; 323 j_dbs_info->prev_cpu_idle_down;
318 j_dbs_info->prev_cpu_idle_down = total_idle_ticks; 324 j_dbs_info->prev_cpu_idle_down = total_idle_ticks;
@@ -321,38 +327,37 @@ static void dbs_check_cpu(int cpu)
321 idle_ticks = tmp_idle_ticks; 327 idle_ticks = tmp_idle_ticks;
322 } 328 }
323 329
324 /* Scale idle ticks by 100 and compare with up and down ticks */
325 idle_ticks *= 100;
326 down_skip[cpu] = 0; 330 down_skip[cpu] = 0;
331 /* if we cannot reduce the frequency anymore, break out early */
332 if (policy->cur == policy->min)
333 return;
327 334
335 /* Compute how many ticks there are between two measurements */
328 freq_down_sampling_rate = dbs_tuners_ins.sampling_rate * 336 freq_down_sampling_rate = dbs_tuners_ins.sampling_rate *
329 dbs_tuners_ins.sampling_down_factor; 337 dbs_tuners_ins.sampling_down_factor;
330 down_idle_ticks = (100 - dbs_tuners_ins.down_threshold) * 338 total_ticks = usecs_to_jiffies(freq_down_sampling_rate);
331 sampling_rate_in_HZ(freq_down_sampling_rate);
332 339
333 if (idle_ticks > down_idle_ticks ) { 340 /*
334 freq_down_step = (5 * policy->max) / 100; 341 * The optimal frequency is the frequency that is the lowest that
335 342 * can support the current CPU usage without triggering the up
336 /* max freq cannot be less than 100. But who knows.... */ 343 * policy. To be safe, we focus 10 points under the threshold.
337 if (unlikely(freq_down_step == 0)) 344 */
338 freq_down_step = 5; 345 freq_next = ((total_ticks - idle_ticks) * 100) / total_ticks;
346 freq_next = (freq_next * policy->cur) /
347 (dbs_tuners_ins.up_threshold - 10);
339 348
340 __cpufreq_driver_target(policy, 349 if (freq_next <= ((policy->cur * 95) / 100))
341 policy->cur - freq_down_step, 350 __cpufreq_driver_target(policy, freq_next, CPUFREQ_RELATION_L);
342 CPUFREQ_RELATION_H);
343 return;
344 }
345} 351}
346 352
347static void do_dbs_timer(void *data) 353static void do_dbs_timer(void *data)
348{ 354{
349 int i; 355 int i;
350 down(&dbs_sem); 356 down(&dbs_sem);
351 for (i = 0; i < NR_CPUS; i++) 357 for_each_online_cpu(i)
352 if (cpu_online(i)) 358 dbs_check_cpu(i);
353 dbs_check_cpu(i);
354 schedule_delayed_work(&dbs_work, 359 schedule_delayed_work(&dbs_work,
355 sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate)); 360 usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
356 up(&dbs_sem); 361 up(&dbs_sem);
357} 362}
358 363
@@ -360,7 +365,7 @@ static inline void dbs_timer_init(void)
360{ 365{
361 INIT_WORK(&dbs_work, do_dbs_timer, NULL); 366 INIT_WORK(&dbs_work, do_dbs_timer, NULL);
362 schedule_delayed_work(&dbs_work, 367 schedule_delayed_work(&dbs_work,
363 sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate)); 368 usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
364 return; 369 return;
365} 370}
366 371
@@ -397,12 +402,9 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
397 j_dbs_info = &per_cpu(cpu_dbs_info, j); 402 j_dbs_info = &per_cpu(cpu_dbs_info, j);
398 j_dbs_info->cur_policy = policy; 403 j_dbs_info->cur_policy = policy;
399 404
400 j_dbs_info->prev_cpu_idle_up = 405 j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j);
401 kstat_cpu(j).cpustat.idle + 406 j_dbs_info->prev_cpu_idle_down
402 kstat_cpu(j).cpustat.iowait; 407 = j_dbs_info->prev_cpu_idle_up;
403 j_dbs_info->prev_cpu_idle_down =
404 kstat_cpu(j).cpustat.idle +
405 kstat_cpu(j).cpustat.iowait;
406 } 408 }
407 this_dbs_info->enable = 1; 409 this_dbs_info->enable = 1;
408 sysfs_create_group(&policy->kobj, &dbs_attr_group); 410 sysfs_create_group(&policy->kobj, &dbs_attr_group);
@@ -422,6 +424,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
422 def_sampling_rate = (latency / 1000) * 424 def_sampling_rate = (latency / 1000) *
423 DEF_SAMPLING_RATE_LATENCY_MULTIPLIER; 425 DEF_SAMPLING_RATE_LATENCY_MULTIPLIER;
424 dbs_tuners_ins.sampling_rate = def_sampling_rate; 426 dbs_tuners_ins.sampling_rate = def_sampling_rate;
427 dbs_tuners_ins.ignore_nice = 0;
425 428
426 dbs_timer_init(); 429 dbs_timer_init();
427 } 430 }
@@ -461,12 +464,11 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
461 return 0; 464 return 0;
462} 465}
463 466
464struct cpufreq_governor cpufreq_gov_dbs = { 467static struct cpufreq_governor cpufreq_gov_dbs = {
465 .name = "ondemand", 468 .name = "ondemand",
466 .governor = cpufreq_governor_dbs, 469 .governor = cpufreq_governor_dbs,
467 .owner = THIS_MODULE, 470 .owner = THIS_MODULE,
468}; 471};
469EXPORT_SYMBOL(cpufreq_gov_dbs);
470 472
471static int __init cpufreq_gov_dbs_init(void) 473static int __init cpufreq_gov_dbs_init(void)
472{ 474{
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index 2084593937c6..741b6b191e6a 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -19,6 +19,7 @@
19#include <linux/percpu.h> 19#include <linux/percpu.h>
20#include <linux/kobject.h> 20#include <linux/kobject.h>
21#include <linux/spinlock.h> 21#include <linux/spinlock.h>
22#include <asm/cputime.h>
22 23
23static spinlock_t cpufreq_stats_lock; 24static spinlock_t cpufreq_stats_lock;
24 25
@@ -29,20 +30,14 @@ static struct freq_attr _attr_##_name = {\
29 .show = _show,\ 30 .show = _show,\
30}; 31};
31 32
32static unsigned long
33delta_time(unsigned long old, unsigned long new)
34{
35 return (old > new) ? (old - new): (new + ~old + 1);
36}
37
38struct cpufreq_stats { 33struct cpufreq_stats {
39 unsigned int cpu; 34 unsigned int cpu;
40 unsigned int total_trans; 35 unsigned int total_trans;
41 unsigned long long last_time; 36 unsigned long long last_time;
42 unsigned int max_state; 37 unsigned int max_state;
43 unsigned int state_num; 38 unsigned int state_num;
44 unsigned int last_index; 39 unsigned int last_index;
45 unsigned long long *time_in_state; 40 cputime64_t *time_in_state;
46 unsigned int *freq_table; 41 unsigned int *freq_table;
47#ifdef CONFIG_CPU_FREQ_STAT_DETAILS 42#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
48 unsigned int *trans_table; 43 unsigned int *trans_table;
@@ -60,12 +55,16 @@ static int
60cpufreq_stats_update (unsigned int cpu) 55cpufreq_stats_update (unsigned int cpu)
61{ 56{
62 struct cpufreq_stats *stat; 57 struct cpufreq_stats *stat;
58 unsigned long long cur_time;
59
60 cur_time = get_jiffies_64();
63 spin_lock(&cpufreq_stats_lock); 61 spin_lock(&cpufreq_stats_lock);
64 stat = cpufreq_stats_table[cpu]; 62 stat = cpufreq_stats_table[cpu];
65 if (stat->time_in_state) 63 if (stat->time_in_state)
66 stat->time_in_state[stat->last_index] += 64 stat->time_in_state[stat->last_index] =
67 delta_time(stat->last_time, jiffies); 65 cputime64_add(stat->time_in_state[stat->last_index],
68 stat->last_time = jiffies; 66 cputime_sub(cur_time, stat->last_time));
67 stat->last_time = cur_time;
69 spin_unlock(&cpufreq_stats_lock); 68 spin_unlock(&cpufreq_stats_lock);
70 return 0; 69 return 0;
71} 70}
@@ -90,8 +89,8 @@ show_time_in_state(struct cpufreq_policy *policy, char *buf)
90 return 0; 89 return 0;
91 cpufreq_stats_update(stat->cpu); 90 cpufreq_stats_update(stat->cpu);
92 for (i = 0; i < stat->state_num; i++) { 91 for (i = 0; i < stat->state_num; i++) {
93 len += sprintf(buf + len, "%u %llu\n", 92 len += sprintf(buf + len, "%u %llu\n", stat->freq_table[i],
94 stat->freq_table[i], stat->time_in_state[i]); 93 (unsigned long long)cputime64_to_clock_t(stat->time_in_state[i]));
95 } 94 }
96 return len; 95 return len;
97} 96}
@@ -107,16 +106,30 @@ show_trans_table(struct cpufreq_policy *policy, char *buf)
107 if(!stat) 106 if(!stat)
108 return 0; 107 return 0;
109 cpufreq_stats_update(stat->cpu); 108 cpufreq_stats_update(stat->cpu);
109 len += snprintf(buf + len, PAGE_SIZE - len, " From : To\n");
110 len += snprintf(buf + len, PAGE_SIZE - len, " : ");
111 for (i = 0; i < stat->state_num; i++) {
112 if (len >= PAGE_SIZE)
113 break;
114 len += snprintf(buf + len, PAGE_SIZE - len, "%9u ",
115 stat->freq_table[i]);
116 }
117 if (len >= PAGE_SIZE)
118 return len;
119
120 len += snprintf(buf + len, PAGE_SIZE - len, "\n");
121
110 for (i = 0; i < stat->state_num; i++) { 122 for (i = 0; i < stat->state_num; i++) {
111 if (len >= PAGE_SIZE) 123 if (len >= PAGE_SIZE)
112 break; 124 break;
113 len += snprintf(buf + len, PAGE_SIZE - len, "%9u:\t", 125
126 len += snprintf(buf + len, PAGE_SIZE - len, "%9u: ",
114 stat->freq_table[i]); 127 stat->freq_table[i]);
115 128
116 for (j = 0; j < stat->state_num; j++) { 129 for (j = 0; j < stat->state_num; j++) {
117 if (len >= PAGE_SIZE) 130 if (len >= PAGE_SIZE)
118 break; 131 break;
119 len += snprintf(buf + len, PAGE_SIZE - len, "%u\t", 132 len += snprintf(buf + len, PAGE_SIZE - len, "%9u ",
120 stat->trans_table[i*stat->max_state+j]); 133 stat->trans_table[i*stat->max_state+j]);
121 } 134 }
122 len += snprintf(buf + len, PAGE_SIZE - len, "\n"); 135 len += snprintf(buf + len, PAGE_SIZE - len, "\n");
@@ -197,7 +210,7 @@ cpufreq_stats_create_table (struct cpufreq_policy *policy,
197 count++; 210 count++;
198 } 211 }
199 212
200 alloc_size = count * sizeof(int) + count * sizeof(long long); 213 alloc_size = count * sizeof(int) + count * sizeof(cputime64_t);
201 214
202#ifdef CONFIG_CPU_FREQ_STAT_DETAILS 215#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
203 alloc_size += count * count * sizeof(int); 216 alloc_size += count * count * sizeof(int);
@@ -224,7 +237,7 @@ cpufreq_stats_create_table (struct cpufreq_policy *policy,
224 } 237 }
225 stat->state_num = j; 238 stat->state_num = j;
226 spin_lock(&cpufreq_stats_lock); 239 spin_lock(&cpufreq_stats_lock);
227 stat->last_time = jiffies; 240 stat->last_time = get_jiffies_64();
228 stat->last_index = freq_table_get_index(stat, policy->cur); 241 stat->last_index = freq_table_get_index(stat, policy->cur);
229 spin_unlock(&cpufreq_stats_lock); 242 spin_unlock(&cpufreq_stats_lock);
230 cpufreq_cpu_put(data); 243 cpufreq_cpu_put(data);
diff --git a/drivers/dio/dio-sysfs.c b/drivers/dio/dio-sysfs.c
index d30591f69dd9..f46463038847 100644
--- a/drivers/dio/dio-sysfs.c
+++ b/drivers/dio/dio-sysfs.c
@@ -17,7 +17,7 @@
17 17
18/* show configuration fields */ 18/* show configuration fields */
19 19
20static ssize_t dio_show_id(struct device *dev, char *buf) 20static ssize_t dio_show_id(struct device *dev, struct device_attribute *attr, char *buf)
21{ 21{
22 struct dio_dev *d; 22 struct dio_dev *d;
23 23
@@ -26,7 +26,7 @@ static ssize_t dio_show_id(struct device *dev, char *buf)
26} 26}
27static DEVICE_ATTR(id, S_IRUGO, dio_show_id, NULL); 27static DEVICE_ATTR(id, S_IRUGO, dio_show_id, NULL);
28 28
29static ssize_t dio_show_ipl(struct device *dev, char *buf) 29static ssize_t dio_show_ipl(struct device *dev, struct device_attribute *attr, char *buf)
30{ 30{
31 struct dio_dev *d; 31 struct dio_dev *d;
32 32
@@ -35,7 +35,7 @@ static ssize_t dio_show_ipl(struct device *dev, char *buf)
35} 35}
36static DEVICE_ATTR(ipl, S_IRUGO, dio_show_ipl, NULL); 36static DEVICE_ATTR(ipl, S_IRUGO, dio_show_ipl, NULL);
37 37
38static ssize_t dio_show_secid(struct device *dev, char *buf) 38static ssize_t dio_show_secid(struct device *dev, struct device_attribute *attr, char *buf)
39{ 39{
40 struct dio_dev *d; 40 struct dio_dev *d;
41 41
@@ -44,7 +44,7 @@ static ssize_t dio_show_secid(struct device *dev, char *buf)
44} 44}
45static DEVICE_ATTR(secid, S_IRUGO, dio_show_secid, NULL); 45static DEVICE_ATTR(secid, S_IRUGO, dio_show_secid, NULL);
46 46
47static ssize_t dio_show_name(struct device *dev, char *buf) 47static ssize_t dio_show_name(struct device *dev, struct device_attribute *attr, char *buf)
48{ 48{
49 struct dio_dev *d; 49 struct dio_dev *d;
50 50
@@ -53,7 +53,7 @@ static ssize_t dio_show_name(struct device *dev, char *buf)
53} 53}
54static DEVICE_ATTR(name, S_IRUGO, dio_show_name, NULL); 54static DEVICE_ATTR(name, S_IRUGO, dio_show_name, NULL);
55 55
56static ssize_t dio_show_resource(struct device *dev, char *buf) 56static ssize_t dio_show_resource(struct device *dev, struct device_attribute *attr, char *buf)
57{ 57{
58 struct dio_dev *d = to_dio_dev(dev); 58 struct dio_dev *d = to_dio_dev(dev);
59 59
diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
index 6381ba53853c..1937743c8e29 100644
--- a/drivers/eisa/eisa-bus.c
+++ b/drivers/eisa/eisa-bus.c
@@ -149,7 +149,7 @@ void eisa_driver_unregister (struct eisa_driver *edrv)
149 driver_unregister (&edrv->driver); 149 driver_unregister (&edrv->driver);
150} 150}
151 151
152static ssize_t eisa_show_sig (struct device *dev, char *buf) 152static ssize_t eisa_show_sig (struct device *dev, struct device_attribute *attr, char *buf)
153{ 153{
154 struct eisa_device *edev = to_eisa_device (dev); 154 struct eisa_device *edev = to_eisa_device (dev);
155 return sprintf (buf,"%s\n", edev->id.sig); 155 return sprintf (buf,"%s\n", edev->id.sig);
@@ -157,7 +157,7 @@ static ssize_t eisa_show_sig (struct device *dev, char *buf)
157 157
158static DEVICE_ATTR(signature, S_IRUGO, eisa_show_sig, NULL); 158static DEVICE_ATTR(signature, S_IRUGO, eisa_show_sig, NULL);
159 159
160static ssize_t eisa_show_state (struct device *dev, char *buf) 160static ssize_t eisa_show_state (struct device *dev, struct device_attribute *attr, char *buf)
161{ 161{
162 struct eisa_device *edev = to_eisa_device (dev); 162 struct eisa_device *edev = to_eisa_device (dev);
163 return sprintf (buf,"%d\n", edev->state & EISA_CONFIG_ENABLED); 163 return sprintf (buf,"%d\n", edev->state & EISA_CONFIG_ENABLED);
diff --git a/drivers/fc4/fc.c b/drivers/fc4/fc.c
index 1fbb219aa9ba..e3c958823533 100644
--- a/drivers/fc4/fc.c
+++ b/drivers/fc4/fc.c
@@ -765,12 +765,8 @@ void fcp_release(fc_channel *fcchain, int count) /* count must > 0 */
765 765
766static void fcp_scsi_done (Scsi_Cmnd *SCpnt) 766static void fcp_scsi_done (Scsi_Cmnd *SCpnt)
767{ 767{
768 unsigned long flags;
769
770 spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
771 if (FCP_CMND(SCpnt)->done) 768 if (FCP_CMND(SCpnt)->done)
772 FCP_CMND(SCpnt)->done(SCpnt); 769 FCP_CMND(SCpnt)->done(SCpnt);
773 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
774} 770}
775 771
776static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, int prepare) 772static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, int prepare)
@@ -909,12 +905,8 @@ int fcp_scsi_abort(Scsi_Cmnd *SCpnt)
909 */ 905 */
910 906
911 if (++fc->abort_count < (fc->can_queue >> 1)) { 907 if (++fc->abort_count < (fc->can_queue >> 1)) {
912 unsigned long flags;
913
914 SCpnt->result = DID_ABORT; 908 SCpnt->result = DID_ABORT;
915 spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
916 fcmd->done(SCpnt); 909 fcmd->done(SCpnt);
917 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
918 printk("FC: soft abort\n"); 910 printk("FC: soft abort\n");
919 return SUCCESS; 911 return SUCCESS;
920 } else { 912 } else {
@@ -935,6 +927,7 @@ void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt)
935 927
936int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt) 928int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
937{ 929{
930 unsigned long flags;
938 fcp_cmd *cmd; 931 fcp_cmd *cmd;
939 fcp_cmnd *fcmd; 932 fcp_cmnd *fcmd;
940 fc_channel *fc = FC_SCMND(SCpnt); 933 fc_channel *fc = FC_SCMND(SCpnt);
@@ -987,7 +980,10 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
987 fc->rst_pkt->request->rq_status = RQ_SCSI_BUSY; 980 fc->rst_pkt->request->rq_status = RQ_SCSI_BUSY;
988 981
989 fc->rst_pkt->done = fcp_scsi_reset_done; 982 fc->rst_pkt->done = fcp_scsi_reset_done;
983
984 spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
990 fcp_scsi_queue_it(fc, fc->rst_pkt, fcmd, 0); 985 fcp_scsi_queue_it(fc, fc->rst_pkt, fcmd, 0);
986 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
991 987
992 down(&sem); 988 down(&sem);
993 989
@@ -1006,13 +1002,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
1006 return SUCCESS; 1002 return SUCCESS;
1007} 1003}
1008 1004
1009int fcp_scsi_bus_reset(Scsi_Cmnd *SCpnt) 1005static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
1010{
1011 printk ("FC: bus reset!\n");
1012 return FAILED;
1013}
1014
1015int fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
1016{ 1006{
1017 fc_channel *fc = FC_SCMND(SCpnt); 1007 fc_channel *fc = FC_SCMND(SCpnt);
1018 fcp_cmnd *fcmd = FCP_CMND(SCpnt); 1008 fcp_cmnd *fcmd = FCP_CMND(SCpnt);
@@ -1033,6 +1023,18 @@ int fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
1033 else return FAILED; 1023 else return FAILED;
1034} 1024}
1035 1025
1026int fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
1027{
1028 unsigned long flags;
1029 int rc;
1030
1031 spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
1032 rc = __fcp_scsi_host_reset(SCpnt);
1033 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
1034
1035 return rc;
1036}
1037
1036static int fcp_els_queue_it(fc_channel *fc, fcp_cmnd *fcmd) 1038static int fcp_els_queue_it(fc_channel *fc, fcp_cmnd *fcmd)
1037{ 1039{
1038 long i; 1040 long i;
diff --git a/drivers/fc4/fc_syms.c b/drivers/fc4/fc_syms.c
index 8bac2c453027..ed85dfcef69a 100644
--- a/drivers/fc4/fc_syms.c
+++ b/drivers/fc4/fc_syms.c
@@ -27,7 +27,6 @@ EXPORT_SYMBOL(fc_do_prli);
27EXPORT_SYMBOL(fcp_scsi_queuecommand); 27EXPORT_SYMBOL(fcp_scsi_queuecommand);
28EXPORT_SYMBOL(fcp_scsi_abort); 28EXPORT_SYMBOL(fcp_scsi_abort);
29EXPORT_SYMBOL(fcp_scsi_dev_reset); 29EXPORT_SYMBOL(fcp_scsi_dev_reset);
30EXPORT_SYMBOL(fcp_scsi_bus_reset);
31EXPORT_SYMBOL(fcp_scsi_host_reset); 30EXPORT_SYMBOL(fcp_scsi_host_reset);
32 31
33#endif /* CONFIG_MODULES */ 32#endif /* CONFIG_MODULES */
diff --git a/drivers/fc4/fcp_impl.h b/drivers/fc4/fcp_impl.h
index e44d652a83dc..c397c84bef63 100644
--- a/drivers/fc4/fcp_impl.h
+++ b/drivers/fc4/fcp_impl.h
@@ -158,7 +158,6 @@ int fc_do_prli(fc_channel *, unsigned char);
158int fcp_scsi_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *)); 158int fcp_scsi_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
159int fcp_scsi_abort(Scsi_Cmnd *); 159int fcp_scsi_abort(Scsi_Cmnd *);
160int fcp_scsi_dev_reset(Scsi_Cmnd *); 160int fcp_scsi_dev_reset(Scsi_Cmnd *);
161int fcp_scsi_bus_reset(Scsi_Cmnd *);
162int fcp_scsi_host_reset(Scsi_Cmnd *); 161int fcp_scsi_host_reset(Scsi_Cmnd *);
163 162
164#endif /* !(_FCP_SCSI_H) */ 163#endif /* !(_FCP_SCSI_H) */
diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index 33b669e6f977..6996476669f1 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -115,7 +115,7 @@ edd_attr_show(struct kobject * kobj, struct attribute *attr, char *buf)
115{ 115{
116 struct edd_device *dev = to_edd_device(kobj); 116 struct edd_device *dev = to_edd_device(kobj);
117 struct edd_attribute *edd_attr = to_edd_attr(attr); 117 struct edd_attribute *edd_attr = to_edd_attr(attr);
118 ssize_t ret = 0; 118 ssize_t ret = -EIO;
119 119
120 if (edd_attr->show) 120 if (edd_attr->show)
121 ret = edd_attr->show(dev, buf); 121 ret = edd_attr->show(dev, buf);
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 0287ff65963b..a3451cb94004 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -352,7 +352,7 @@ static ssize_t efivar_attr_show(struct kobject *kobj, struct attribute *attr,
352{ 352{
353 struct efivar_entry *var = to_efivar_entry(kobj); 353 struct efivar_entry *var = to_efivar_entry(kobj);
354 struct efivar_attribute *efivar_attr = to_efivar_attr(attr); 354 struct efivar_attribute *efivar_attr = to_efivar_attr(attr);
355 ssize_t ret = 0; 355 ssize_t ret = -EIO;
356 356
357 if (!capable(CAP_SYS_ADMIN)) 357 if (!capable(CAP_SYS_ADMIN))
358 return -EACCES; 358 return -EACCES;
@@ -368,7 +368,7 @@ static ssize_t efivar_attr_store(struct kobject *kobj, struct attribute *attr,
368{ 368{
369 struct efivar_entry *var = to_efivar_entry(kobj); 369 struct efivar_entry *var = to_efivar_entry(kobj);
370 struct efivar_attribute *efivar_attr = to_efivar_attr(attr); 370 struct efivar_attribute *efivar_attr = to_efivar_attr(attr);
371 ssize_t ret = 0; 371 ssize_t ret = -EIO;
372 372
373 if (!capable(CAP_SYS_ADMIN)) 373 if (!capable(CAP_SYS_ADMIN))
374 return -EACCES; 374 return -EACCES;
diff --git a/drivers/firmware/pcdp.c b/drivers/firmware/pcdp.c
index 6d5df6c2efa2..df1b721154d2 100644
--- a/drivers/firmware/pcdp.c
+++ b/drivers/firmware/pcdp.c
@@ -11,6 +11,7 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13 13
14#include <linux/config.h>
14#include <linux/acpi.h> 15#include <linux/acpi.h>
15#include <linux/console.h> 16#include <linux/console.h>
16#include <linux/efi.h> 17#include <linux/efi.h>
diff --git a/drivers/i2c/busses/i2c-ali1563.c b/drivers/i2c/busses/i2c-ali1563.c
index 35710818fe47..fdd881aee618 100644
--- a/drivers/i2c/busses/i2c-ali1563.c
+++ b/drivers/i2c/busses/i2c-ali1563.c
@@ -2,6 +2,7 @@
2 * i2c-ali1563.c - i2c driver for the ALi 1563 Southbridge 2 * i2c-ali1563.c - i2c driver for the ALi 1563 Southbridge
3 * 3 *
4 * Copyright (C) 2004 Patrick Mochel 4 * Copyright (C) 2004 Patrick Mochel
5 * 2005 Rudolf Marek <r.marek@sh.cvut.cz>
5 * 6 *
6 * The 1563 southbridge is deceptively similar to the 1533, with a 7 * The 1563 southbridge is deceptively similar to the 1533, with a
7 * few notable exceptions. One of those happens to be the fact they 8 * few notable exceptions. One of those happens to be the fact they
@@ -57,10 +58,11 @@
57#define HST_CNTL2_BLOCK 0x05 58#define HST_CNTL2_BLOCK 0x05
58 59
59 60
61#define HST_CNTL2_SIZEMASK 0x38
60 62
61static unsigned short ali1563_smba; 63static unsigned short ali1563_smba;
62 64
63static int ali1563_transaction(struct i2c_adapter * a) 65static int ali1563_transaction(struct i2c_adapter * a, int size)
64{ 66{
65 u32 data; 67 u32 data;
66 int timeout; 68 int timeout;
@@ -73,7 +75,7 @@ static int ali1563_transaction(struct i2c_adapter * a)
73 75
74 data = inb_p(SMB_HST_STS); 76 data = inb_p(SMB_HST_STS);
75 if (data & HST_STS_BAD) { 77 if (data & HST_STS_BAD) {
76 dev_warn(&a->dev,"ali1563: Trying to reset busy device\n"); 78 dev_err(&a->dev, "ali1563: Trying to reset busy device\n");
77 outb_p(data | HST_STS_BAD,SMB_HST_STS); 79 outb_p(data | HST_STS_BAD,SMB_HST_STS);
78 data = inb_p(SMB_HST_STS); 80 data = inb_p(SMB_HST_STS);
79 if (data & HST_STS_BAD) 81 if (data & HST_STS_BAD)
@@ -94,19 +96,31 @@ static int ali1563_transaction(struct i2c_adapter * a)
94 96
95 if (timeout && !(data & HST_STS_BAD)) 97 if (timeout && !(data & HST_STS_BAD))
96 return 0; 98 return 0;
97 dev_warn(&a->dev, "SMBus Error: %s%s%s%s%s\n",
98 timeout ? "Timeout " : "",
99 data & HST_STS_FAIL ? "Transaction Failed " : "",
100 data & HST_STS_BUSERR ? "No response or Bus Collision " : "",
101 data & HST_STS_DEVERR ? "Device Error " : "",
102 !(data & HST_STS_DONE) ? "Transaction Never Finished " : "");
103 99
104 if (!(data & HST_STS_DONE)) 100 if (!timeout) {
101 dev_err(&a->dev, "Timeout - Trying to KILL transaction!\n");
105 /* Issue 'kill' to host controller */ 102 /* Issue 'kill' to host controller */
106 outb_p(HST_CNTL2_KILL,SMB_HST_CNTL2); 103 outb_p(HST_CNTL2_KILL,SMB_HST_CNTL2);
107 else 104 data = inb_p(SMB_HST_STS);
108 /* Issue timeout to reset all devices on bus */ 105 }
106
107 /* device error - no response, ignore the autodetection case */
108 if ((data & HST_STS_DEVERR) && (size != HST_CNTL2_QUICK)) {
109 dev_err(&a->dev, "Device error!\n");
110 }
111
112 /* bus collision */
113 if (data & HST_STS_BUSERR) {
114 dev_err(&a->dev, "Bus collision!\n");
115 /* Issue timeout, hoping it helps */
109 outb_p(HST_CNTL1_TIMEOUT,SMB_HST_CNTL1); 116 outb_p(HST_CNTL1_TIMEOUT,SMB_HST_CNTL1);
117 }
118
119 if (data & HST_STS_FAIL) {
120 dev_err(&a->dev, "Cleaning fail after KILL!\n");
121 outb_p(0x0,SMB_HST_CNTL2);
122 }
123
110 return -1; 124 return -1;
111} 125}
112 126
@@ -149,7 +163,7 @@ static int ali1563_block_start(struct i2c_adapter * a)
149 163
150 if (timeout && !(data & HST_STS_BAD)) 164 if (timeout && !(data & HST_STS_BAD))
151 return 0; 165 return 0;
152 dev_warn(&a->dev, "SMBus Error: %s%s%s%s%s\n", 166 dev_err(&a->dev, "SMBus Error: %s%s%s%s%s\n",
153 timeout ? "Timeout " : "", 167 timeout ? "Timeout " : "",
154 data & HST_STS_FAIL ? "Transaction Failed " : "", 168 data & HST_STS_FAIL ? "Transaction Failed " : "",
155 data & HST_STS_BUSERR ? "No response or Bus Collision " : "", 169 data & HST_STS_BUSERR ? "No response or Bus Collision " : "",
@@ -242,13 +256,15 @@ static s32 ali1563_access(struct i2c_adapter * a, u16 addr,
242 } 256 }
243 257
244 outb_p(((addr & 0x7f) << 1) | (rw & 0x01), SMB_HST_ADD); 258 outb_p(((addr & 0x7f) << 1) | (rw & 0x01), SMB_HST_ADD);
245 outb_p(inb_p(SMB_HST_CNTL2) | (size << 3), SMB_HST_CNTL2); 259 outb_p((inb_p(SMB_HST_CNTL2) & ~HST_CNTL2_SIZEMASK) | (size << 3), SMB_HST_CNTL2);
246 260
247 /* Write the command register */ 261 /* Write the command register */
262
248 switch(size) { 263 switch(size) {
249 case HST_CNTL2_BYTE: 264 case HST_CNTL2_BYTE:
250 if (rw== I2C_SMBUS_WRITE) 265 if (rw== I2C_SMBUS_WRITE)
251 outb_p(cmd, SMB_HST_CMD); 266 /* Beware it uses DAT0 register and not CMD! */
267 outb_p(cmd, SMB_HST_DAT0);
252 break; 268 break;
253 case HST_CNTL2_BYTE_DATA: 269 case HST_CNTL2_BYTE_DATA:
254 outb_p(cmd, SMB_HST_CMD); 270 outb_p(cmd, SMB_HST_CMD);
@@ -268,7 +284,7 @@ static s32 ali1563_access(struct i2c_adapter * a, u16 addr,
268 goto Done; 284 goto Done;
269 } 285 }
270 286
271 if ((error = ali1563_transaction(a))) 287 if ((error = ali1563_transaction(a, size)))
272 goto Done; 288 goto Done;
273 289
274 if ((rw == I2C_SMBUS_WRITE) || (size == HST_CNTL2_QUICK)) 290 if ((rw == I2C_SMBUS_WRITE) || (size == HST_CNTL2_QUICK))
diff --git a/drivers/i2c/chips/adm1021.c b/drivers/i2c/chips/adm1021.c
index 9c59a370b6d9..9058c3956710 100644
--- a/drivers/i2c/chips/adm1021.c
+++ b/drivers/i2c/chips/adm1021.c
@@ -137,7 +137,7 @@ static struct i2c_driver adm1021_driver = {
137}; 137};
138 138
139#define show(value) \ 139#define show(value) \
140static ssize_t show_##value(struct device *dev, char *buf) \ 140static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
141{ \ 141{ \
142 struct adm1021_data *data = adm1021_update_device(dev); \ 142 struct adm1021_data *data = adm1021_update_device(dev); \
143 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ 143 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \
@@ -150,7 +150,7 @@ show(remote_temp_hyst);
150show(remote_temp_input); 150show(remote_temp_input);
151 151
152#define show2(value) \ 152#define show2(value) \
153static ssize_t show_##value(struct device *dev, char *buf) \ 153static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
154{ \ 154{ \
155 struct adm1021_data *data = adm1021_update_device(dev); \ 155 struct adm1021_data *data = adm1021_update_device(dev); \
156 return sprintf(buf, "%d\n", data->value); \ 156 return sprintf(buf, "%d\n", data->value); \
@@ -159,7 +159,7 @@ show2(alarms);
159show2(die_code); 159show2(die_code);
160 160
161#define set(value, reg) \ 161#define set(value, reg) \
162static ssize_t set_##value(struct device *dev, const char *buf, size_t count) \ 162static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
163{ \ 163{ \
164 struct i2c_client *client = to_i2c_client(dev); \ 164 struct i2c_client *client = to_i2c_client(dev); \
165 struct adm1021_data *data = i2c_get_clientdata(client); \ 165 struct adm1021_data *data = i2c_get_clientdata(client); \
diff --git a/drivers/i2c/chips/adm1025.c b/drivers/i2c/chips/adm1025.c
index e0771a3d05c9..111f0c86c933 100644
--- a/drivers/i2c/chips/adm1025.c
+++ b/drivers/i2c/chips/adm1025.c
@@ -153,19 +153,19 @@ struct adm1025_data {
153 */ 153 */
154 154
155#define show_in(offset) \ 155#define show_in(offset) \
156static ssize_t show_in##offset(struct device *dev, char *buf) \ 156static ssize_t show_in##offset(struct device *dev, struct device_attribute *attr, char *buf) \
157{ \ 157{ \
158 struct adm1025_data *data = adm1025_update_device(dev); \ 158 struct adm1025_data *data = adm1025_update_device(dev); \
159 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ 159 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \
160 in_scale[offset])); \ 160 in_scale[offset])); \
161} \ 161} \
162static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ 162static ssize_t show_in##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
163{ \ 163{ \
164 struct adm1025_data *data = adm1025_update_device(dev); \ 164 struct adm1025_data *data = adm1025_update_device(dev); \
165 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ 165 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \
166 in_scale[offset])); \ 166 in_scale[offset])); \
167} \ 167} \
168static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ 168static ssize_t show_in##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
169{ \ 169{ \
170 struct adm1025_data *data = adm1025_update_device(dev); \ 170 struct adm1025_data *data = adm1025_update_device(dev); \
171 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ 171 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \
@@ -180,17 +180,17 @@ show_in(4);
180show_in(5); 180show_in(5);
181 181
182#define show_temp(offset) \ 182#define show_temp(offset) \
183static ssize_t show_temp##offset(struct device *dev, char *buf) \ 183static ssize_t show_temp##offset(struct device *dev, struct device_attribute *attr, char *buf) \
184{ \ 184{ \
185 struct adm1025_data *data = adm1025_update_device(dev); \ 185 struct adm1025_data *data = adm1025_update_device(dev); \
186 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ 186 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \
187} \ 187} \
188static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \ 188static ssize_t show_temp##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
189{ \ 189{ \
190 struct adm1025_data *data = adm1025_update_device(dev); \ 190 struct adm1025_data *data = adm1025_update_device(dev); \
191 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \ 191 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \
192} \ 192} \
193static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \ 193static ssize_t show_temp##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
194{ \ 194{ \
195 struct adm1025_data *data = adm1025_update_device(dev); \ 195 struct adm1025_data *data = adm1025_update_device(dev); \
196 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \ 196 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \
@@ -200,7 +200,7 @@ show_temp(1);
200show_temp(2); 200show_temp(2);
201 201
202#define set_in(offset) \ 202#define set_in(offset) \
203static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \ 203static ssize_t set_in##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
204 size_t count) \ 204 size_t count) \
205{ \ 205{ \
206 struct i2c_client *client = to_i2c_client(dev); \ 206 struct i2c_client *client = to_i2c_client(dev); \
@@ -214,7 +214,7 @@ static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \
214 up(&data->update_lock); \ 214 up(&data->update_lock); \
215 return count; \ 215 return count; \
216} \ 216} \
217static ssize_t set_in##offset##_max(struct device *dev, const char *buf, \ 217static ssize_t set_in##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
218 size_t count) \ 218 size_t count) \
219{ \ 219{ \
220 struct i2c_client *client = to_i2c_client(dev); \ 220 struct i2c_client *client = to_i2c_client(dev); \
@@ -240,7 +240,7 @@ set_in(4);
240set_in(5); 240set_in(5);
241 241
242#define set_temp(offset) \ 242#define set_temp(offset) \
243static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ 243static ssize_t set_temp##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
244 size_t count) \ 244 size_t count) \
245{ \ 245{ \
246 struct i2c_client *client = to_i2c_client(dev); \ 246 struct i2c_client *client = to_i2c_client(dev); \
@@ -254,7 +254,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
254 up(&data->update_lock); \ 254 up(&data->update_lock); \
255 return count; \ 255 return count; \
256} \ 256} \
257static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ 257static ssize_t set_temp##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
258 size_t count) \ 258 size_t count) \
259{ \ 259{ \
260 struct i2c_client *client = to_i2c_client(dev); \ 260 struct i2c_client *client = to_i2c_client(dev); \
@@ -275,26 +275,26 @@ static DEVICE_ATTR(temp##offset##_max, S_IWUSR | S_IRUGO, \
275set_temp(1); 275set_temp(1);
276set_temp(2); 276set_temp(2);
277 277
278static ssize_t show_alarms(struct device *dev, char *buf) 278static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
279{ 279{
280 struct adm1025_data *data = adm1025_update_device(dev); 280 struct adm1025_data *data = adm1025_update_device(dev);
281 return sprintf(buf, "%u\n", data->alarms); 281 return sprintf(buf, "%u\n", data->alarms);
282} 282}
283static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); 283static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
284 284
285static ssize_t show_vid(struct device *dev, char *buf) 285static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
286{ 286{
287 struct adm1025_data *data = adm1025_update_device(dev); 287 struct adm1025_data *data = adm1025_update_device(dev);
288 return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm)); 288 return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm));
289} 289}
290static DEVICE_ATTR(in1_ref, S_IRUGO, show_vid, NULL); 290static DEVICE_ATTR(in1_ref, S_IRUGO, show_vid, NULL);
291 291
292static ssize_t show_vrm(struct device *dev, char *buf) 292static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
293{ 293{
294 struct adm1025_data *data = adm1025_update_device(dev); 294 struct adm1025_data *data = adm1025_update_device(dev);
295 return sprintf(buf, "%u\n", data->vrm); 295 return sprintf(buf, "%u\n", data->vrm);
296} 296}
297static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) 297static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
298{ 298{
299 struct i2c_client *client = to_i2c_client(dev); 299 struct i2c_client *client = to_i2c_client(dev);
300 struct adm1025_data *data = i2c_get_clientdata(client); 300 struct adm1025_data *data = i2c_get_clientdata(client);
diff --git a/drivers/i2c/chips/adm1026.c b/drivers/i2c/chips/adm1026.c
index 39e2f4a900bf..b15fafe8f111 100644
--- a/drivers/i2c/chips/adm1026.c
+++ b/drivers/i2c/chips/adm1026.c
@@ -30,6 +30,7 @@
30#include <linux/jiffies.h> 30#include <linux/jiffies.h>
31#include <linux/i2c.h> 31#include <linux/i2c.h>
32#include <linux/i2c-sensor.h> 32#include <linux/i2c-sensor.h>
33#include <linux/i2c-sysfs.h>
33#include <linux/i2c-vid.h> 34#include <linux/i2c-vid.h>
34 35
35/* Addresses to scan */ 36/* Addresses to scan */
@@ -711,19 +712,27 @@ static struct adm1026_data *adm1026_update_device(struct device *dev)
711 return data; 712 return data;
712} 713}
713 714
714static ssize_t show_in(struct device *dev, char *buf, int nr) 715static ssize_t show_in(struct device *dev, struct device_attribute *attr,
716 char *buf)
715{ 717{
718 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
719 int nr = sensor_attr->index;
716 struct adm1026_data *data = adm1026_update_device(dev); 720 struct adm1026_data *data = adm1026_update_device(dev);
717 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in[nr])); 721 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in[nr]));
718} 722}
719static ssize_t show_in_min(struct device *dev, char *buf, int nr) 723static ssize_t show_in_min(struct device *dev, struct device_attribute *attr,
724 char *buf)
720{ 725{
726 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
727 int nr = sensor_attr->index;
721 struct adm1026_data *data = adm1026_update_device(dev); 728 struct adm1026_data *data = adm1026_update_device(dev);
722 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_min[nr])); 729 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_min[nr]));
723} 730}
724static ssize_t set_in_min(struct device *dev, const char *buf, 731static ssize_t set_in_min(struct device *dev, struct device_attribute *attr,
725 size_t count, int nr) 732 const char *buf, size_t count)
726{ 733{
734 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
735 int nr = sensor_attr->index;
727 struct i2c_client *client = to_i2c_client(dev); 736 struct i2c_client *client = to_i2c_client(dev);
728 struct adm1026_data *data = i2c_get_clientdata(client); 737 struct adm1026_data *data = i2c_get_clientdata(client);
729 int val = simple_strtol(buf, NULL, 10); 738 int val = simple_strtol(buf, NULL, 10);
@@ -734,14 +743,19 @@ static ssize_t set_in_min(struct device *dev, const char *buf,
734 up(&data->update_lock); 743 up(&data->update_lock);
735 return count; 744 return count;
736} 745}
737static ssize_t show_in_max(struct device *dev, char *buf, int nr) 746static ssize_t show_in_max(struct device *dev, struct device_attribute *attr,
747 char *buf)
738{ 748{
749 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
750 int nr = sensor_attr->index;
739 struct adm1026_data *data = adm1026_update_device(dev); 751 struct adm1026_data *data = adm1026_update_device(dev);
740 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_max[nr])); 752 return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in_max[nr]));
741} 753}
742static ssize_t set_in_max(struct device *dev, const char *buf, 754static ssize_t set_in_max(struct device *dev, struct device_attribute *attr,
743 size_t count, int nr) 755 const char *buf, size_t count)
744{ 756{
757 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
758 int nr = sensor_attr->index;
745 struct i2c_client *client = to_i2c_client(dev); 759 struct i2c_client *client = to_i2c_client(dev);
746 struct adm1026_data *data = i2c_get_clientdata(client); 760 struct adm1026_data *data = i2c_get_clientdata(client);
747 int val = simple_strtol(buf, NULL, 10); 761 int val = simple_strtol(buf, NULL, 10);
@@ -753,34 +767,13 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
753 return count; 767 return count;
754} 768}
755 769
756#define in_reg(offset) \ 770#define in_reg(offset) \
757static ssize_t show_in##offset (struct device *dev, char *buf) \ 771static SENSOR_DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in, \
758{ \ 772 NULL, offset); \
759 return show_in(dev, buf, offset); \ 773static SENSOR_DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \
760} \ 774 show_in_min, set_in_min, offset); \
761static ssize_t show_in##offset##_min (struct device *dev, char *buf) \ 775static SENSOR_DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \
762{ \ 776 show_in_max, set_in_max, offset);
763 return show_in_min(dev, buf, offset); \
764} \
765static ssize_t set_in##offset##_min (struct device *dev, \
766 const char *buf, size_t count) \
767{ \
768 return set_in_min(dev, buf, count, offset); \
769} \
770static ssize_t show_in##offset##_max (struct device *dev, char *buf) \
771{ \
772 return show_in_max(dev, buf, offset); \
773} \
774static ssize_t set_in##offset##_max (struct device *dev, \
775 const char *buf, size_t count) \
776{ \
777 return set_in_max(dev, buf, count, offset); \
778} \
779static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL); \
780static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \
781 show_in##offset##_min, set_in##offset##_min); \
782static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \
783 show_in##offset##_max, set_in##offset##_max);
784 777
785 778
786in_reg(0); 779in_reg(0);
@@ -800,19 +793,19 @@ in_reg(13);
800in_reg(14); 793in_reg(14);
801in_reg(15); 794in_reg(15);
802 795
803static ssize_t show_in16(struct device *dev, char *buf) 796static ssize_t show_in16(struct device *dev, struct device_attribute *attr, char *buf)
804{ 797{
805 struct adm1026_data *data = adm1026_update_device(dev); 798 struct adm1026_data *data = adm1026_update_device(dev);
806 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in[16]) - 799 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in[16]) -
807 NEG12_OFFSET); 800 NEG12_OFFSET);
808} 801}
809static ssize_t show_in16_min(struct device *dev, char *buf) 802static ssize_t show_in16_min(struct device *dev, struct device_attribute *attr, char *buf)
810{ 803{
811 struct adm1026_data *data = adm1026_update_device(dev); 804 struct adm1026_data *data = adm1026_update_device(dev);
812 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_min[16]) 805 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_min[16])
813 - NEG12_OFFSET); 806 - NEG12_OFFSET);
814} 807}
815static ssize_t set_in16_min(struct device *dev, const char *buf, size_t count) 808static ssize_t set_in16_min(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
816{ 809{
817 struct i2c_client *client = to_i2c_client(dev); 810 struct i2c_client *client = to_i2c_client(dev);
818 struct adm1026_data *data = i2c_get_clientdata(client); 811 struct adm1026_data *data = i2c_get_clientdata(client);
@@ -824,13 +817,13 @@ static ssize_t set_in16_min(struct device *dev, const char *buf, size_t count)
824 up(&data->update_lock); 817 up(&data->update_lock);
825 return count; 818 return count;
826} 819}
827static ssize_t show_in16_max(struct device *dev, char *buf) 820static ssize_t show_in16_max(struct device *dev, struct device_attribute *attr, char *buf)
828{ 821{
829 struct adm1026_data *data = adm1026_update_device(dev); 822 struct adm1026_data *data = adm1026_update_device(dev);
830 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_max[16]) 823 return sprintf(buf,"%d\n", INS_FROM_REG(16, data->in_max[16])
831 - NEG12_OFFSET); 824 - NEG12_OFFSET);
832} 825}
833static ssize_t set_in16_max(struct device *dev, const char *buf, size_t count) 826static ssize_t set_in16_max(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
834{ 827{
835 struct i2c_client *client = to_i2c_client(dev); 828 struct i2c_client *client = to_i2c_client(dev);
836 struct adm1026_data *data = i2c_get_clientdata(client); 829 struct adm1026_data *data = i2c_get_clientdata(client);
@@ -843,30 +836,38 @@ static ssize_t set_in16_max(struct device *dev, const char *buf, size_t count)
843 return count; 836 return count;
844} 837}
845 838
846static DEVICE_ATTR(in16_input, S_IRUGO, show_in16, NULL); 839static SENSOR_DEVICE_ATTR(in16_input, S_IRUGO, show_in16, NULL, 16);
847static DEVICE_ATTR(in16_min, S_IRUGO | S_IWUSR, show_in16_min, set_in16_min); 840static SENSOR_DEVICE_ATTR(in16_min, S_IRUGO | S_IWUSR, show_in16_min, set_in16_min, 16);
848static DEVICE_ATTR(in16_max, S_IRUGO | S_IWUSR, show_in16_max, set_in16_max); 841static SENSOR_DEVICE_ATTR(in16_max, S_IRUGO | S_IWUSR, show_in16_max, set_in16_max, 16);
849 842
850 843
851 844
852 845
853/* Now add fan read/write functions */ 846/* Now add fan read/write functions */
854 847
855static ssize_t show_fan(struct device *dev, char *buf, int nr) 848static ssize_t show_fan(struct device *dev, struct device_attribute *attr,
849 char *buf)
856{ 850{
851 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
852 int nr = sensor_attr->index;
857 struct adm1026_data *data = adm1026_update_device(dev); 853 struct adm1026_data *data = adm1026_update_device(dev);
858 return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan[nr], 854 return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan[nr],
859 data->fan_div[nr])); 855 data->fan_div[nr]));
860} 856}
861static ssize_t show_fan_min(struct device *dev, char *buf, int nr) 857static ssize_t show_fan_min(struct device *dev, struct device_attribute *attr,
858 char *buf)
862{ 859{
860 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
861 int nr = sensor_attr->index;
863 struct adm1026_data *data = adm1026_update_device(dev); 862 struct adm1026_data *data = adm1026_update_device(dev);
864 return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan_min[nr], 863 return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan_min[nr],
865 data->fan_div[nr])); 864 data->fan_div[nr]));
866} 865}
867static ssize_t set_fan_min(struct device *dev, const char *buf, 866static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
868 size_t count, int nr) 867 const char *buf, size_t count)
869{ 868{
869 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
870 int nr = sensor_attr->index;
870 struct i2c_client *client = to_i2c_client(dev); 871 struct i2c_client *client = to_i2c_client(dev);
871 struct adm1026_data *data = i2c_get_clientdata(client); 872 struct adm1026_data *data = i2c_get_clientdata(client);
872 int val = simple_strtol(buf, NULL, 10); 873 int val = simple_strtol(buf, NULL, 10);
@@ -879,23 +880,11 @@ static ssize_t set_fan_min(struct device *dev, const char *buf,
879 return count; 880 return count;
880} 881}
881 882
882#define fan_offset(offset) \ 883#define fan_offset(offset) \
883static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 884static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan, NULL, \
884{ \ 885 offset - 1); \
885 return show_fan(dev, buf, offset - 1); \ 886static SENSOR_DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
886} \ 887 show_fan_min, set_fan_min, offset - 1);
887static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \
888{ \
889 return show_fan_min(dev, buf, offset - 1); \
890} \
891static ssize_t set_fan_##offset##_min (struct device *dev, \
892 const char *buf, size_t count) \
893{ \
894 return set_fan_min(dev, buf, count, offset - 1); \
895} \
896static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL); \
897static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
898 show_fan_##offset##_min, set_fan_##offset##_min);
899 888
900fan_offset(1); 889fan_offset(1);
901fan_offset(2); 890fan_offset(2);
@@ -926,14 +915,19 @@ static void fixup_fan_min(struct device *dev, int fan, int old_div)
926} 915}
927 916
928/* Now add fan_div read/write functions */ 917/* Now add fan_div read/write functions */
929static ssize_t show_fan_div(struct device *dev, char *buf, int nr) 918static ssize_t show_fan_div(struct device *dev, struct device_attribute *attr,
919 char *buf)
930{ 920{
921 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
922 int nr = sensor_attr->index;
931 struct adm1026_data *data = adm1026_update_device(dev); 923 struct adm1026_data *data = adm1026_update_device(dev);
932 return sprintf(buf,"%d\n", data->fan_div[nr]); 924 return sprintf(buf,"%d\n", data->fan_div[nr]);
933} 925}
934static ssize_t set_fan_div(struct device *dev, const char *buf, 926static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
935 size_t count, int nr) 927 const char *buf, size_t count)
936{ 928{
929 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
930 int nr = sensor_attr->index;
937 struct i2c_client *client = to_i2c_client(dev); 931 struct i2c_client *client = to_i2c_client(dev);
938 struct adm1026_data *data = i2c_get_clientdata(client); 932 struct adm1026_data *data = i2c_get_clientdata(client);
939 int val,orig_div,new_div,shift; 933 int val,orig_div,new_div,shift;
@@ -967,17 +961,8 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
967} 961}
968 962
969#define fan_offset_div(offset) \ 963#define fan_offset_div(offset) \
970static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 964static SENSOR_DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
971{ \ 965 show_fan_div, set_fan_div, offset - 1);
972 return show_fan_div(dev, buf, offset - 1); \
973} \
974static ssize_t set_fan_##offset##_div (struct device *dev, \
975 const char *buf, size_t count) \
976{ \
977 return set_fan_div(dev, buf, count, offset - 1); \
978} \
979static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
980 show_fan_##offset##_div, set_fan_##offset##_div);
981 966
982fan_offset_div(1); 967fan_offset_div(1);
983fan_offset_div(2); 968fan_offset_div(2);
@@ -989,19 +974,27 @@ fan_offset_div(7);
989fan_offset_div(8); 974fan_offset_div(8);
990 975
991/* Temps */ 976/* Temps */
992static ssize_t show_temp(struct device *dev, char *buf, int nr) 977static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
978 char *buf)
993{ 979{
980 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
981 int nr = sensor_attr->index;
994 struct adm1026_data *data = adm1026_update_device(dev); 982 struct adm1026_data *data = adm1026_update_device(dev);
995 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp[nr])); 983 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp[nr]));
996} 984}
997static ssize_t show_temp_min(struct device *dev, char *buf, int nr) 985static ssize_t show_temp_min(struct device *dev, struct device_attribute *attr,
986 char *buf)
998{ 987{
988 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
989 int nr = sensor_attr->index;
999 struct adm1026_data *data = adm1026_update_device(dev); 990 struct adm1026_data *data = adm1026_update_device(dev);
1000 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_min[nr])); 991 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_min[nr]));
1001} 992}
1002static ssize_t set_temp_min(struct device *dev, const char *buf, 993static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr,
1003 size_t count, int nr) 994 const char *buf, size_t count)
1004{ 995{
996 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
997 int nr = sensor_attr->index;
1005 struct i2c_client *client = to_i2c_client(dev); 998 struct i2c_client *client = to_i2c_client(dev);
1006 struct adm1026_data *data = i2c_get_clientdata(client); 999 struct adm1026_data *data = i2c_get_clientdata(client);
1007 int val = simple_strtol(buf, NULL, 10); 1000 int val = simple_strtol(buf, NULL, 10);
@@ -1013,14 +1006,19 @@ static ssize_t set_temp_min(struct device *dev, const char *buf,
1013 up(&data->update_lock); 1006 up(&data->update_lock);
1014 return count; 1007 return count;
1015} 1008}
1016static ssize_t show_temp_max(struct device *dev, char *buf, int nr) 1009static ssize_t show_temp_max(struct device *dev, struct device_attribute *attr,
1010 char *buf)
1017{ 1011{
1012 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1013 int nr = sensor_attr->index;
1018 struct adm1026_data *data = adm1026_update_device(dev); 1014 struct adm1026_data *data = adm1026_update_device(dev);
1019 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_max[nr])); 1015 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_max[nr]));
1020} 1016}
1021static ssize_t set_temp_max(struct device *dev, const char *buf, 1017static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
1022 size_t count, int nr) 1018 const char *buf, size_t count)
1023{ 1019{
1020 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1021 int nr = sensor_attr->index;
1024 struct i2c_client *client = to_i2c_client(dev); 1022 struct i2c_client *client = to_i2c_client(dev);
1025 struct adm1026_data *data = i2c_get_clientdata(client); 1023 struct adm1026_data *data = i2c_get_clientdata(client);
1026 int val = simple_strtol(buf, NULL, 10); 1024 int val = simple_strtol(buf, NULL, 10);
@@ -1032,48 +1030,34 @@ static ssize_t set_temp_max(struct device *dev, const char *buf,
1032 up(&data->update_lock); 1030 up(&data->update_lock);
1033 return count; 1031 return count;
1034} 1032}
1035#define temp_reg(offset) \ 1033
1036static ssize_t show_temp_##offset (struct device *dev, char *buf) \ 1034#define temp_reg(offset) \
1037{ \ 1035static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp, \
1038 return show_temp(dev, buf, offset - 1); \ 1036 NULL, offset - 1); \
1039} \ 1037static SENSOR_DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \
1040static ssize_t show_temp_##offset##_min (struct device *dev, char *buf) \ 1038 show_temp_min, set_temp_min, offset - 1); \
1041{ \ 1039static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \
1042 return show_temp_min(dev, buf, offset - 1); \ 1040 show_temp_max, set_temp_max, offset - 1);
1043} \
1044static ssize_t show_temp_##offset##_max (struct device *dev, char *buf) \
1045{ \
1046 return show_temp_max(dev, buf, offset - 1); \
1047} \
1048static ssize_t set_temp_##offset##_min (struct device *dev, \
1049 const char *buf, size_t count) \
1050{ \
1051 return set_temp_min(dev, buf, count, offset - 1); \
1052} \
1053static ssize_t set_temp_##offset##_max (struct device *dev, \
1054 const char *buf, size_t count) \
1055{ \
1056 return set_temp_max(dev, buf, count, offset - 1); \
1057} \
1058static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL); \
1059static DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \
1060 show_temp_##offset##_min, set_temp_##offset##_min); \
1061static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \
1062 show_temp_##offset##_max, set_temp_##offset##_max);
1063 1041
1064 1042
1065temp_reg(1); 1043temp_reg(1);
1066temp_reg(2); 1044temp_reg(2);
1067temp_reg(3); 1045temp_reg(3);
1068 1046
1069static ssize_t show_temp_offset(struct device *dev, char *buf, int nr) 1047static ssize_t show_temp_offset(struct device *dev,
1048 struct device_attribute *attr, char *buf)
1070{ 1049{
1050 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1051 int nr = sensor_attr->index;
1071 struct adm1026_data *data = adm1026_update_device(dev); 1052 struct adm1026_data *data = adm1026_update_device(dev);
1072 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_offset[nr])); 1053 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_offset[nr]));
1073} 1054}
1074static ssize_t set_temp_offset(struct device *dev, const char *buf, 1055static ssize_t set_temp_offset(struct device *dev,
1075 size_t count, int nr) 1056 struct device_attribute *attr, const char *buf,
1057 size_t count)
1076{ 1058{
1059 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1060 int nr = sensor_attr->index;
1077 struct i2c_client *client = to_i2c_client(dev); 1061 struct i2c_client *client = to_i2c_client(dev);
1078 struct adm1026_data *data = i2c_get_clientdata(client); 1062 struct adm1026_data *data = i2c_get_clientdata(client);
1079 int val = simple_strtol(buf, NULL, 10); 1063 int val = simple_strtol(buf, NULL, 10);
@@ -1086,46 +1070,45 @@ static ssize_t set_temp_offset(struct device *dev, const char *buf,
1086 return count; 1070 return count;
1087} 1071}
1088 1072
1089#define temp_offset_reg(offset) \ 1073#define temp_offset_reg(offset) \
1090static ssize_t show_temp_##offset##_offset (struct device *dev, char *buf) \ 1074static SENSOR_DEVICE_ATTR(temp##offset##_offset, S_IRUGO | S_IWUSR, \
1091{ \ 1075 show_temp_offset, set_temp_offset, offset - 1);
1092 return show_temp_offset(dev, buf, offset - 1); \
1093} \
1094static ssize_t set_temp_##offset##_offset (struct device *dev, \
1095 const char *buf, size_t count) \
1096{ \
1097 return set_temp_offset(dev, buf, count, offset - 1); \
1098} \
1099static DEVICE_ATTR(temp##offset##_offset, S_IRUGO | S_IWUSR, \
1100 show_temp_##offset##_offset, set_temp_##offset##_offset);
1101 1076
1102temp_offset_reg(1); 1077temp_offset_reg(1);
1103temp_offset_reg(2); 1078temp_offset_reg(2);
1104temp_offset_reg(3); 1079temp_offset_reg(3);
1105 1080
1106static ssize_t show_temp_auto_point1_temp_hyst(struct device *dev, char *buf, 1081static ssize_t show_temp_auto_point1_temp_hyst(struct device *dev,
1107 int nr) 1082 struct device_attribute *attr, char *buf)
1108{ 1083{
1084 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1085 int nr = sensor_attr->index;
1109 struct adm1026_data *data = adm1026_update_device(dev); 1086 struct adm1026_data *data = adm1026_update_device(dev);
1110 return sprintf(buf,"%d\n", TEMP_FROM_REG( 1087 return sprintf(buf,"%d\n", TEMP_FROM_REG(
1111 ADM1026_FAN_ACTIVATION_TEMP_HYST + data->temp_tmin[nr])); 1088 ADM1026_FAN_ACTIVATION_TEMP_HYST + data->temp_tmin[nr]));
1112} 1089}
1113static ssize_t show_temp_auto_point2_temp(struct device *dev, char *buf, 1090static ssize_t show_temp_auto_point2_temp(struct device *dev,
1114 int nr) 1091 struct device_attribute *attr, char *buf)
1115{ 1092{
1093 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1094 int nr = sensor_attr->index;
1116 struct adm1026_data *data = adm1026_update_device(dev); 1095 struct adm1026_data *data = adm1026_update_device(dev);
1117 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr] + 1096 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr] +
1118 ADM1026_FAN_CONTROL_TEMP_RANGE)); 1097 ADM1026_FAN_CONTROL_TEMP_RANGE));
1119} 1098}
1120static ssize_t show_temp_auto_point1_temp(struct device *dev, char *buf, 1099static ssize_t show_temp_auto_point1_temp(struct device *dev,
1121 int nr) 1100 struct device_attribute *attr, char *buf)
1122{ 1101{
1102 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1103 int nr = sensor_attr->index;
1123 struct adm1026_data *data = adm1026_update_device(dev); 1104 struct adm1026_data *data = adm1026_update_device(dev);
1124 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr])); 1105 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_tmin[nr]));
1125} 1106}
1126static ssize_t set_temp_auto_point1_temp(struct device *dev, const char *buf, 1107static ssize_t set_temp_auto_point1_temp(struct device *dev,
1127 size_t count, int nr) 1108 struct device_attribute *attr, const char *buf, size_t count)
1128{ 1109{
1110 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1111 int nr = sensor_attr->index;
1129 struct i2c_client *client = to_i2c_client(dev); 1112 struct i2c_client *client = to_i2c_client(dev);
1130 struct adm1026_data *data = i2c_get_clientdata(client); 1113 struct adm1026_data *data = i2c_get_clientdata(client);
1131 int val = simple_strtol(buf, NULL, 10); 1114 int val = simple_strtol(buf, NULL, 10);
@@ -1138,46 +1121,27 @@ static ssize_t set_temp_auto_point1_temp(struct device *dev, const char *buf,
1138 return count; 1121 return count;
1139} 1122}
1140 1123
1141#define temp_auto_point(offset) \ 1124#define temp_auto_point(offset) \
1142static ssize_t show_temp##offset##_auto_point1_temp (struct device *dev, \ 1125static SENSOR_DEVICE_ATTR(temp##offset##_auto_point1_temp, S_IRUGO | S_IWUSR, \
1143 char *buf) \ 1126 show_temp_auto_point1_temp, set_temp_auto_point1_temp, \
1144{ \ 1127 offset - 1); \
1145 return show_temp_auto_point1_temp(dev, buf, offset - 1); \ 1128static SENSOR_DEVICE_ATTR(temp##offset##_auto_point1_temp_hyst, S_IRUGO, \
1146} \ 1129 show_temp_auto_point1_temp_hyst, NULL, offset - 1); \
1147static ssize_t set_temp##offset##_auto_point1_temp (struct device *dev, \ 1130static SENSOR_DEVICE_ATTR(temp##offset##_auto_point2_temp, S_IRUGO, \
1148 const char *buf, size_t count) \ 1131 show_temp_auto_point2_temp, NULL, offset - 1);
1149{ \
1150 return set_temp_auto_point1_temp(dev, buf, count, offset - 1); \
1151} \
1152static ssize_t show_temp##offset##_auto_point1_temp_hyst (struct device \
1153 *dev, char *buf) \
1154{ \
1155 return show_temp_auto_point1_temp_hyst(dev, buf, offset - 1); \
1156} \
1157static ssize_t show_temp##offset##_auto_point2_temp (struct device *dev, \
1158 char *buf) \
1159{ \
1160 return show_temp_auto_point2_temp(dev, buf, offset - 1); \
1161} \
1162static DEVICE_ATTR(temp##offset##_auto_point1_temp, S_IRUGO | S_IWUSR, \
1163 show_temp##offset##_auto_point1_temp, \
1164 set_temp##offset##_auto_point1_temp); \
1165static DEVICE_ATTR(temp##offset##_auto_point1_temp_hyst, S_IRUGO, \
1166 show_temp##offset##_auto_point1_temp_hyst, NULL); \
1167static DEVICE_ATTR(temp##offset##_auto_point2_temp, S_IRUGO, \
1168 show_temp##offset##_auto_point2_temp, NULL);
1169 1132
1170temp_auto_point(1); 1133temp_auto_point(1);
1171temp_auto_point(2); 1134temp_auto_point(2);
1172temp_auto_point(3); 1135temp_auto_point(3);
1173 1136
1174static ssize_t show_temp_crit_enable(struct device *dev, char *buf) 1137static ssize_t show_temp_crit_enable(struct device *dev,
1138 struct device_attribute *attr, char *buf)
1175{ 1139{
1176 struct adm1026_data *data = adm1026_update_device(dev); 1140 struct adm1026_data *data = adm1026_update_device(dev);
1177 return sprintf(buf,"%d\n", (data->config1 & CFG1_THERM_HOT) >> 4); 1141 return sprintf(buf,"%d\n", (data->config1 & CFG1_THERM_HOT) >> 4);
1178} 1142}
1179static ssize_t set_temp_crit_enable(struct device *dev, const char *buf, 1143static ssize_t set_temp_crit_enable(struct device *dev,
1180 size_t count) 1144 struct device_attribute *attr, const char *buf, size_t count)
1181{ 1145{
1182 struct i2c_client *client = to_i2c_client(dev); 1146 struct i2c_client *client = to_i2c_client(dev);
1183 struct adm1026_data *data = i2c_get_clientdata(client); 1147 struct adm1026_data *data = i2c_get_clientdata(client);
@@ -1193,24 +1157,27 @@ static ssize_t set_temp_crit_enable(struct device *dev, const char *buf,
1193 return count; 1157 return count;
1194} 1158}
1195 1159
1196static DEVICE_ATTR(temp1_crit_enable, S_IRUGO | S_IWUSR, 1160#define temp_crit_enable(offset) \
1197 show_temp_crit_enable, set_temp_crit_enable); 1161static DEVICE_ATTR(temp##offset##_crit_enable, S_IRUGO | S_IWUSR, \
1198
1199static DEVICE_ATTR(temp2_crit_enable, S_IRUGO | S_IWUSR,
1200 show_temp_crit_enable, set_temp_crit_enable);
1201
1202static DEVICE_ATTR(temp3_crit_enable, S_IRUGO | S_IWUSR,
1203 show_temp_crit_enable, set_temp_crit_enable); 1162 show_temp_crit_enable, set_temp_crit_enable);
1204 1163
1164temp_crit_enable(1);
1165temp_crit_enable(2);
1166temp_crit_enable(3);
1205 1167
1206static ssize_t show_temp_crit(struct device *dev, char *buf, int nr) 1168static ssize_t show_temp_crit(struct device *dev,
1169 struct device_attribute *attr, char *buf)
1207{ 1170{
1171 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1172 int nr = sensor_attr->index;
1208 struct adm1026_data *data = adm1026_update_device(dev); 1173 struct adm1026_data *data = adm1026_update_device(dev);
1209 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_crit[nr])); 1174 return sprintf(buf,"%d\n", TEMP_FROM_REG(data->temp_crit[nr]));
1210} 1175}
1211static ssize_t set_temp_crit(struct device *dev, const char *buf, 1176static ssize_t set_temp_crit(struct device *dev, struct device_attribute *attr,
1212 size_t count, int nr) 1177 const char *buf, size_t count)
1213{ 1178{
1179 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
1180 int nr = sensor_attr->index;
1214 struct i2c_client *client = to_i2c_client(dev); 1181 struct i2c_client *client = to_i2c_client(dev);
1215 struct adm1026_data *data = i2c_get_clientdata(client); 1182 struct adm1026_data *data = i2c_get_clientdata(client);
1216 int val = simple_strtol(buf, NULL, 10); 1183 int val = simple_strtol(buf, NULL, 10);
@@ -1223,29 +1190,20 @@ static ssize_t set_temp_crit(struct device *dev, const char *buf,
1223 return count; 1190 return count;
1224} 1191}
1225 1192
1226#define temp_crit_reg(offset) \ 1193#define temp_crit_reg(offset) \
1227static ssize_t show_temp_##offset##_crit (struct device *dev, char *buf) \ 1194static SENSOR_DEVICE_ATTR(temp##offset##_crit, S_IRUGO | S_IWUSR, \
1228{ \ 1195 show_temp_crit, set_temp_crit, offset - 1);
1229 return show_temp_crit(dev, buf, offset - 1); \
1230} \
1231static ssize_t set_temp_##offset##_crit (struct device *dev, \
1232 const char *buf, size_t count) \
1233{ \
1234 return set_temp_crit(dev, buf, count, offset - 1); \
1235} \
1236static DEVICE_ATTR(temp##offset##_crit, S_IRUGO | S_IWUSR, \
1237 show_temp_##offset##_crit, set_temp_##offset##_crit);
1238 1196
1239temp_crit_reg(1); 1197temp_crit_reg(1);
1240temp_crit_reg(2); 1198temp_crit_reg(2);
1241temp_crit_reg(3); 1199temp_crit_reg(3);
1242 1200
1243static ssize_t show_analog_out_reg(struct device *dev, char *buf) 1201static ssize_t show_analog_out_reg(struct device *dev, struct device_attribute *attr, char *buf)
1244{ 1202{
1245 struct adm1026_data *data = adm1026_update_device(dev); 1203 struct adm1026_data *data = adm1026_update_device(dev);
1246 return sprintf(buf,"%d\n", DAC_FROM_REG(data->analog_out)); 1204 return sprintf(buf,"%d\n", DAC_FROM_REG(data->analog_out));
1247} 1205}
1248static ssize_t set_analog_out_reg(struct device *dev, const char *buf, 1206static ssize_t set_analog_out_reg(struct device *dev, struct device_attribute *attr, const char *buf,
1249 size_t count) 1207 size_t count)
1250{ 1208{
1251 struct i2c_client *client = to_i2c_client(dev); 1209 struct i2c_client *client = to_i2c_client(dev);
@@ -1262,7 +1220,7 @@ static ssize_t set_analog_out_reg(struct device *dev, const char *buf,
1262static DEVICE_ATTR(analog_out, S_IRUGO | S_IWUSR, show_analog_out_reg, 1220static DEVICE_ATTR(analog_out, S_IRUGO | S_IWUSR, show_analog_out_reg,
1263 set_analog_out_reg); 1221 set_analog_out_reg);
1264 1222
1265static ssize_t show_vid_reg(struct device *dev, char *buf) 1223static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
1266{ 1224{
1267 struct adm1026_data *data = adm1026_update_device(dev); 1225 struct adm1026_data *data = adm1026_update_device(dev);
1268 return sprintf(buf,"%d\n", vid_from_reg(data->vid & 0x3f, data->vrm)); 1226 return sprintf(buf,"%d\n", vid_from_reg(data->vid & 0x3f, data->vrm));
@@ -1270,12 +1228,12 @@ static ssize_t show_vid_reg(struct device *dev, char *buf)
1270 1228
1271static DEVICE_ATTR(vid, S_IRUGO, show_vid_reg, NULL); 1229static DEVICE_ATTR(vid, S_IRUGO, show_vid_reg, NULL);
1272 1230
1273static ssize_t show_vrm_reg(struct device *dev, char *buf) 1231static ssize_t show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
1274{ 1232{
1275 struct adm1026_data *data = adm1026_update_device(dev); 1233 struct adm1026_data *data = adm1026_update_device(dev);
1276 return sprintf(buf,"%d\n", data->vrm); 1234 return sprintf(buf,"%d\n", data->vrm);
1277} 1235}
1278static ssize_t store_vrm_reg(struct device *dev, const char *buf, 1236static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf,
1279 size_t count) 1237 size_t count)
1280{ 1238{
1281 struct i2c_client *client = to_i2c_client(dev); 1239 struct i2c_client *client = to_i2c_client(dev);
@@ -1287,7 +1245,7 @@ static ssize_t store_vrm_reg(struct device *dev, const char *buf,
1287 1245
1288static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); 1246static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
1289 1247
1290static ssize_t show_alarms_reg(struct device *dev, char *buf) 1248static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
1291{ 1249{
1292 struct adm1026_data *data = adm1026_update_device(dev); 1250 struct adm1026_data *data = adm1026_update_device(dev);
1293 return sprintf(buf, "%ld\n", (long) (data->alarms)); 1251 return sprintf(buf, "%ld\n", (long) (data->alarms));
@@ -1295,12 +1253,12 @@ static ssize_t show_alarms_reg(struct device *dev, char *buf)
1295 1253
1296static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); 1254static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
1297 1255
1298static ssize_t show_alarm_mask(struct device *dev, char *buf) 1256static ssize_t show_alarm_mask(struct device *dev, struct device_attribute *attr, char *buf)
1299{ 1257{
1300 struct adm1026_data *data = adm1026_update_device(dev); 1258 struct adm1026_data *data = adm1026_update_device(dev);
1301 return sprintf(buf,"%ld\n", data->alarm_mask); 1259 return sprintf(buf,"%ld\n", data->alarm_mask);
1302} 1260}
1303static ssize_t set_alarm_mask(struct device *dev, const char *buf, 1261static ssize_t set_alarm_mask(struct device *dev, struct device_attribute *attr, const char *buf,
1304 size_t count) 1262 size_t count)
1305{ 1263{
1306 struct i2c_client *client = to_i2c_client(dev); 1264 struct i2c_client *client = to_i2c_client(dev);
@@ -1331,12 +1289,12 @@ static DEVICE_ATTR(alarm_mask, S_IRUGO | S_IWUSR, show_alarm_mask,
1331 set_alarm_mask); 1289 set_alarm_mask);
1332 1290
1333 1291
1334static ssize_t show_gpio(struct device *dev, char *buf) 1292static ssize_t show_gpio(struct device *dev, struct device_attribute *attr, char *buf)
1335{ 1293{
1336 struct adm1026_data *data = adm1026_update_device(dev); 1294 struct adm1026_data *data = adm1026_update_device(dev);
1337 return sprintf(buf,"%ld\n", data->gpio); 1295 return sprintf(buf,"%ld\n", data->gpio);
1338} 1296}
1339static ssize_t set_gpio(struct device *dev, const char *buf, 1297static ssize_t set_gpio(struct device *dev, struct device_attribute *attr, const char *buf,
1340 size_t count) 1298 size_t count)
1341{ 1299{
1342 struct i2c_client *client = to_i2c_client(dev); 1300 struct i2c_client *client = to_i2c_client(dev);
@@ -1359,12 +1317,12 @@ static ssize_t set_gpio(struct device *dev, const char *buf,
1359static DEVICE_ATTR(gpio, S_IRUGO | S_IWUSR, show_gpio, set_gpio); 1317static DEVICE_ATTR(gpio, S_IRUGO | S_IWUSR, show_gpio, set_gpio);
1360 1318
1361 1319
1362static ssize_t show_gpio_mask(struct device *dev, char *buf) 1320static ssize_t show_gpio_mask(struct device *dev, struct device_attribute *attr, char *buf)
1363{ 1321{
1364 struct adm1026_data *data = adm1026_update_device(dev); 1322 struct adm1026_data *data = adm1026_update_device(dev);
1365 return sprintf(buf,"%ld\n", data->gpio_mask); 1323 return sprintf(buf,"%ld\n", data->gpio_mask);
1366} 1324}
1367static ssize_t set_gpio_mask(struct device *dev, const char *buf, 1325static ssize_t set_gpio_mask(struct device *dev, struct device_attribute *attr, const char *buf,
1368 size_t count) 1326 size_t count)
1369{ 1327{
1370 struct i2c_client *client = to_i2c_client(dev); 1328 struct i2c_client *client = to_i2c_client(dev);
@@ -1386,12 +1344,12 @@ static ssize_t set_gpio_mask(struct device *dev, const char *buf,
1386 1344
1387static DEVICE_ATTR(gpio_mask, S_IRUGO | S_IWUSR, show_gpio_mask, set_gpio_mask); 1345static DEVICE_ATTR(gpio_mask, S_IRUGO | S_IWUSR, show_gpio_mask, set_gpio_mask);
1388 1346
1389static ssize_t show_pwm_reg(struct device *dev, char *buf) 1347static ssize_t show_pwm_reg(struct device *dev, struct device_attribute *attr, char *buf)
1390{ 1348{
1391 struct adm1026_data *data = adm1026_update_device(dev); 1349 struct adm1026_data *data = adm1026_update_device(dev);
1392 return sprintf(buf,"%d\n", PWM_FROM_REG(data->pwm1.pwm)); 1350 return sprintf(buf,"%d\n", PWM_FROM_REG(data->pwm1.pwm));
1393} 1351}
1394static ssize_t set_pwm_reg(struct device *dev, const char *buf, 1352static ssize_t set_pwm_reg(struct device *dev, struct device_attribute *attr, const char *buf,
1395 size_t count) 1353 size_t count)
1396{ 1354{
1397 struct i2c_client *client = to_i2c_client(dev); 1355 struct i2c_client *client = to_i2c_client(dev);
@@ -1407,12 +1365,12 @@ static ssize_t set_pwm_reg(struct device *dev, const char *buf,
1407 } 1365 }
1408 return count; 1366 return count;
1409} 1367}
1410static ssize_t show_auto_pwm_min(struct device *dev, char *buf) 1368static ssize_t show_auto_pwm_min(struct device *dev, struct device_attribute *attr, char *buf)
1411{ 1369{
1412 struct adm1026_data *data = adm1026_update_device(dev); 1370 struct adm1026_data *data = adm1026_update_device(dev);
1413 return sprintf(buf,"%d\n", data->pwm1.auto_pwm_min); 1371 return sprintf(buf,"%d\n", data->pwm1.auto_pwm_min);
1414} 1372}
1415static ssize_t set_auto_pwm_min(struct device *dev, const char *buf, 1373static ssize_t set_auto_pwm_min(struct device *dev, struct device_attribute *attr, const char *buf,
1416 size_t count) 1374 size_t count)
1417{ 1375{
1418 struct i2c_client *client = to_i2c_client(dev); 1376 struct i2c_client *client = to_i2c_client(dev);
@@ -1429,16 +1387,16 @@ static ssize_t set_auto_pwm_min(struct device *dev, const char *buf,
1429 up(&data->update_lock); 1387 up(&data->update_lock);
1430 return count; 1388 return count;
1431} 1389}
1432static ssize_t show_auto_pwm_max(struct device *dev, char *buf) 1390static ssize_t show_auto_pwm_max(struct device *dev, struct device_attribute *attr, char *buf)
1433{ 1391{
1434 return sprintf(buf,"%d\n", ADM1026_PWM_MAX); 1392 return sprintf(buf,"%d\n", ADM1026_PWM_MAX);
1435} 1393}
1436static ssize_t show_pwm_enable(struct device *dev, char *buf) 1394static ssize_t show_pwm_enable(struct device *dev, struct device_attribute *attr, char *buf)
1437{ 1395{
1438 struct adm1026_data *data = adm1026_update_device(dev); 1396 struct adm1026_data *data = adm1026_update_device(dev);
1439 return sprintf(buf,"%d\n", data->pwm1.enable); 1397 return sprintf(buf,"%d\n", data->pwm1.enable);
1440} 1398}
1441static ssize_t set_pwm_enable(struct device *dev, const char *buf, 1399static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr, const char *buf,
1442 size_t count) 1400 size_t count)
1443{ 1401{
1444 struct i2c_client *client = to_i2c_client(dev); 1402 struct i2c_client *client = to_i2c_client(dev);
@@ -1597,114 +1555,114 @@ int adm1026_detect(struct i2c_adapter *adapter, int address,
1597 adm1026_init_client(new_client); 1555 adm1026_init_client(new_client);
1598 1556
1599 /* Register sysfs hooks */ 1557 /* Register sysfs hooks */
1600 device_create_file(&new_client->dev, &dev_attr_in0_input); 1558 device_create_file(&new_client->dev, &sensor_dev_attr_in0_input.dev_attr);
1601 device_create_file(&new_client->dev, &dev_attr_in0_max); 1559 device_create_file(&new_client->dev, &sensor_dev_attr_in0_max.dev_attr);
1602 device_create_file(&new_client->dev, &dev_attr_in0_min); 1560 device_create_file(&new_client->dev, &sensor_dev_attr_in0_min.dev_attr);
1603 device_create_file(&new_client->dev, &dev_attr_in1_input); 1561 device_create_file(&new_client->dev, &sensor_dev_attr_in1_input.dev_attr);
1604 device_create_file(&new_client->dev, &dev_attr_in1_max); 1562 device_create_file(&new_client->dev, &sensor_dev_attr_in1_max.dev_attr);
1605 device_create_file(&new_client->dev, &dev_attr_in1_min); 1563 device_create_file(&new_client->dev, &sensor_dev_attr_in1_min.dev_attr);
1606 device_create_file(&new_client->dev, &dev_attr_in2_input); 1564 device_create_file(&new_client->dev, &sensor_dev_attr_in2_input.dev_attr);
1607 device_create_file(&new_client->dev, &dev_attr_in2_max); 1565 device_create_file(&new_client->dev, &sensor_dev_attr_in2_max.dev_attr);
1608 device_create_file(&new_client->dev, &dev_attr_in2_min); 1566 device_create_file(&new_client->dev, &sensor_dev_attr_in2_min.dev_attr);
1609 device_create_file(&new_client->dev, &dev_attr_in3_input); 1567 device_create_file(&new_client->dev, &sensor_dev_attr_in3_input.dev_attr);
1610 device_create_file(&new_client->dev, &dev_attr_in3_max); 1568 device_create_file(&new_client->dev, &sensor_dev_attr_in3_max.dev_attr);
1611 device_create_file(&new_client->dev, &dev_attr_in3_min); 1569 device_create_file(&new_client->dev, &sensor_dev_attr_in3_min.dev_attr);
1612 device_create_file(&new_client->dev, &dev_attr_in4_input); 1570 device_create_file(&new_client->dev, &sensor_dev_attr_in4_input.dev_attr);
1613 device_create_file(&new_client->dev, &dev_attr_in4_max); 1571 device_create_file(&new_client->dev, &sensor_dev_attr_in4_max.dev_attr);
1614 device_create_file(&new_client->dev, &dev_attr_in4_min); 1572 device_create_file(&new_client->dev, &sensor_dev_attr_in4_min.dev_attr);
1615 device_create_file(&new_client->dev, &dev_attr_in5_input); 1573 device_create_file(&new_client->dev, &sensor_dev_attr_in5_input.dev_attr);
1616 device_create_file(&new_client->dev, &dev_attr_in5_max); 1574 device_create_file(&new_client->dev, &sensor_dev_attr_in5_max.dev_attr);
1617 device_create_file(&new_client->dev, &dev_attr_in5_min); 1575 device_create_file(&new_client->dev, &sensor_dev_attr_in5_min.dev_attr);
1618 device_create_file(&new_client->dev, &dev_attr_in6_input); 1576 device_create_file(&new_client->dev, &sensor_dev_attr_in6_input.dev_attr);
1619 device_create_file(&new_client->dev, &dev_attr_in6_max); 1577 device_create_file(&new_client->dev, &sensor_dev_attr_in6_max.dev_attr);
1620 device_create_file(&new_client->dev, &dev_attr_in6_min); 1578 device_create_file(&new_client->dev, &sensor_dev_attr_in6_min.dev_attr);
1621 device_create_file(&new_client->dev, &dev_attr_in7_input); 1579 device_create_file(&new_client->dev, &sensor_dev_attr_in7_input.dev_attr);
1622 device_create_file(&new_client->dev, &dev_attr_in7_max); 1580 device_create_file(&new_client->dev, &sensor_dev_attr_in7_max.dev_attr);
1623 device_create_file(&new_client->dev, &dev_attr_in7_min); 1581 device_create_file(&new_client->dev, &sensor_dev_attr_in7_min.dev_attr);
1624 device_create_file(&new_client->dev, &dev_attr_in8_input); 1582 device_create_file(&new_client->dev, &sensor_dev_attr_in8_input.dev_attr);
1625 device_create_file(&new_client->dev, &dev_attr_in8_max); 1583 device_create_file(&new_client->dev, &sensor_dev_attr_in8_max.dev_attr);
1626 device_create_file(&new_client->dev, &dev_attr_in8_min); 1584 device_create_file(&new_client->dev, &sensor_dev_attr_in8_min.dev_attr);
1627 device_create_file(&new_client->dev, &dev_attr_in9_input); 1585 device_create_file(&new_client->dev, &sensor_dev_attr_in9_input.dev_attr);
1628 device_create_file(&new_client->dev, &dev_attr_in9_max); 1586 device_create_file(&new_client->dev, &sensor_dev_attr_in9_max.dev_attr);
1629 device_create_file(&new_client->dev, &dev_attr_in9_min); 1587 device_create_file(&new_client->dev, &sensor_dev_attr_in9_min.dev_attr);
1630 device_create_file(&new_client->dev, &dev_attr_in10_input); 1588 device_create_file(&new_client->dev, &sensor_dev_attr_in10_input.dev_attr);
1631 device_create_file(&new_client->dev, &dev_attr_in10_max); 1589 device_create_file(&new_client->dev, &sensor_dev_attr_in10_max.dev_attr);
1632 device_create_file(&new_client->dev, &dev_attr_in10_min); 1590 device_create_file(&new_client->dev, &sensor_dev_attr_in10_min.dev_attr);
1633 device_create_file(&new_client->dev, &dev_attr_in11_input); 1591 device_create_file(&new_client->dev, &sensor_dev_attr_in11_input.dev_attr);
1634 device_create_file(&new_client->dev, &dev_attr_in11_max); 1592 device_create_file(&new_client->dev, &sensor_dev_attr_in11_max.dev_attr);
1635 device_create_file(&new_client->dev, &dev_attr_in11_min); 1593 device_create_file(&new_client->dev, &sensor_dev_attr_in11_min.dev_attr);
1636 device_create_file(&new_client->dev, &dev_attr_in12_input); 1594 device_create_file(&new_client->dev, &sensor_dev_attr_in12_input.dev_attr);
1637 device_create_file(&new_client->dev, &dev_attr_in12_max); 1595 device_create_file(&new_client->dev, &sensor_dev_attr_in12_max.dev_attr);
1638 device_create_file(&new_client->dev, &dev_attr_in12_min); 1596 device_create_file(&new_client->dev, &sensor_dev_attr_in12_min.dev_attr);
1639 device_create_file(&new_client->dev, &dev_attr_in13_input); 1597 device_create_file(&new_client->dev, &sensor_dev_attr_in13_input.dev_attr);
1640 device_create_file(&new_client->dev, &dev_attr_in13_max); 1598 device_create_file(&new_client->dev, &sensor_dev_attr_in13_max.dev_attr);
1641 device_create_file(&new_client->dev, &dev_attr_in13_min); 1599 device_create_file(&new_client->dev, &sensor_dev_attr_in13_min.dev_attr);
1642 device_create_file(&new_client->dev, &dev_attr_in14_input); 1600 device_create_file(&new_client->dev, &sensor_dev_attr_in14_input.dev_attr);
1643 device_create_file(&new_client->dev, &dev_attr_in14_max); 1601 device_create_file(&new_client->dev, &sensor_dev_attr_in14_max.dev_attr);
1644 device_create_file(&new_client->dev, &dev_attr_in14_min); 1602 device_create_file(&new_client->dev, &sensor_dev_attr_in14_min.dev_attr);
1645 device_create_file(&new_client->dev, &dev_attr_in15_input); 1603 device_create_file(&new_client->dev, &sensor_dev_attr_in15_input.dev_attr);
1646 device_create_file(&new_client->dev, &dev_attr_in15_max); 1604 device_create_file(&new_client->dev, &sensor_dev_attr_in15_max.dev_attr);
1647 device_create_file(&new_client->dev, &dev_attr_in15_min); 1605 device_create_file(&new_client->dev, &sensor_dev_attr_in15_min.dev_attr);
1648 device_create_file(&new_client->dev, &dev_attr_in16_input); 1606 device_create_file(&new_client->dev, &sensor_dev_attr_in16_input.dev_attr);
1649 device_create_file(&new_client->dev, &dev_attr_in16_max); 1607 device_create_file(&new_client->dev, &sensor_dev_attr_in16_max.dev_attr);
1650 device_create_file(&new_client->dev, &dev_attr_in16_min); 1608 device_create_file(&new_client->dev, &sensor_dev_attr_in16_min.dev_attr);
1651 device_create_file(&new_client->dev, &dev_attr_fan1_input); 1609 device_create_file(&new_client->dev, &sensor_dev_attr_fan1_input.dev_attr);
1652 device_create_file(&new_client->dev, &dev_attr_fan1_div); 1610 device_create_file(&new_client->dev, &sensor_dev_attr_fan1_div.dev_attr);
1653 device_create_file(&new_client->dev, &dev_attr_fan1_min); 1611 device_create_file(&new_client->dev, &sensor_dev_attr_fan1_min.dev_attr);
1654 device_create_file(&new_client->dev, &dev_attr_fan2_input); 1612 device_create_file(&new_client->dev, &sensor_dev_attr_fan2_input.dev_attr);
1655 device_create_file(&new_client->dev, &dev_attr_fan2_div); 1613 device_create_file(&new_client->dev, &sensor_dev_attr_fan2_div.dev_attr);
1656 device_create_file(&new_client->dev, &dev_attr_fan2_min); 1614 device_create_file(&new_client->dev, &sensor_dev_attr_fan2_min.dev_attr);
1657 device_create_file(&new_client->dev, &dev_attr_fan3_input); 1615 device_create_file(&new_client->dev, &sensor_dev_attr_fan3_input.dev_attr);
1658 device_create_file(&new_client->dev, &dev_attr_fan3_div); 1616 device_create_file(&new_client->dev, &sensor_dev_attr_fan3_div.dev_attr);
1659 device_create_file(&new_client->dev, &dev_attr_fan3_min); 1617 device_create_file(&new_client->dev, &sensor_dev_attr_fan3_min.dev_attr);
1660 device_create_file(&new_client->dev, &dev_attr_fan4_input); 1618 device_create_file(&new_client->dev, &sensor_dev_attr_fan4_input.dev_attr);
1661 device_create_file(&new_client->dev, &dev_attr_fan4_div); 1619 device_create_file(&new_client->dev, &sensor_dev_attr_fan4_div.dev_attr);
1662 device_create_file(&new_client->dev, &dev_attr_fan4_min); 1620 device_create_file(&new_client->dev, &sensor_dev_attr_fan4_min.dev_attr);
1663 device_create_file(&new_client->dev, &dev_attr_fan5_input); 1621 device_create_file(&new_client->dev, &sensor_dev_attr_fan5_input.dev_attr);
1664 device_create_file(&new_client->dev, &dev_attr_fan5_div); 1622 device_create_file(&new_client->dev, &sensor_dev_attr_fan5_div.dev_attr);
1665 device_create_file(&new_client->dev, &dev_attr_fan5_min); 1623 device_create_file(&new_client->dev, &sensor_dev_attr_fan5_min.dev_attr);
1666 device_create_file(&new_client->dev, &dev_attr_fan6_input); 1624 device_create_file(&new_client->dev, &sensor_dev_attr_fan6_input.dev_attr);
1667 device_create_file(&new_client->dev, &dev_attr_fan6_div); 1625 device_create_file(&new_client->dev, &sensor_dev_attr_fan6_div.dev_attr);
1668 device_create_file(&new_client->dev, &dev_attr_fan6_min); 1626 device_create_file(&new_client->dev, &sensor_dev_attr_fan6_min.dev_attr);
1669 device_create_file(&new_client->dev, &dev_attr_fan7_input); 1627 device_create_file(&new_client->dev, &sensor_dev_attr_fan7_input.dev_attr);
1670 device_create_file(&new_client->dev, &dev_attr_fan7_div); 1628 device_create_file(&new_client->dev, &sensor_dev_attr_fan7_div.dev_attr);
1671 device_create_file(&new_client->dev, &dev_attr_fan7_min); 1629 device_create_file(&new_client->dev, &sensor_dev_attr_fan7_min.dev_attr);
1672 device_create_file(&new_client->dev, &dev_attr_fan8_input); 1630 device_create_file(&new_client->dev, &sensor_dev_attr_fan8_input.dev_attr);
1673 device_create_file(&new_client->dev, &dev_attr_fan8_div); 1631 device_create_file(&new_client->dev, &sensor_dev_attr_fan8_div.dev_attr);
1674 device_create_file(&new_client->dev, &dev_attr_fan8_min); 1632 device_create_file(&new_client->dev, &sensor_dev_attr_fan8_min.dev_attr);
1675 device_create_file(&new_client->dev, &dev_attr_temp1_input); 1633 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_input.dev_attr);
1676 device_create_file(&new_client->dev, &dev_attr_temp1_max); 1634 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_max.dev_attr);
1677 device_create_file(&new_client->dev, &dev_attr_temp1_min); 1635 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_min.dev_attr);
1678 device_create_file(&new_client->dev, &dev_attr_temp2_input); 1636 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_input.dev_attr);
1679 device_create_file(&new_client->dev, &dev_attr_temp2_max); 1637 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_max.dev_attr);
1680 device_create_file(&new_client->dev, &dev_attr_temp2_min); 1638 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_min.dev_attr);
1681 device_create_file(&new_client->dev, &dev_attr_temp3_input); 1639 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_input.dev_attr);
1682 device_create_file(&new_client->dev, &dev_attr_temp3_max); 1640 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_max.dev_attr);
1683 device_create_file(&new_client->dev, &dev_attr_temp3_min); 1641 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_min.dev_attr);
1684 device_create_file(&new_client->dev, &dev_attr_temp1_offset); 1642 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_offset.dev_attr);
1685 device_create_file(&new_client->dev, &dev_attr_temp2_offset); 1643 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_offset.dev_attr);
1686 device_create_file(&new_client->dev, &dev_attr_temp3_offset); 1644 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_offset.dev_attr);
1687 device_create_file(&new_client->dev, 1645 device_create_file(&new_client->dev,
1688 &dev_attr_temp1_auto_point1_temp); 1646 &sensor_dev_attr_temp1_auto_point1_temp.dev_attr);
1689 device_create_file(&new_client->dev, 1647 device_create_file(&new_client->dev,
1690 &dev_attr_temp2_auto_point1_temp); 1648 &sensor_dev_attr_temp2_auto_point1_temp.dev_attr);
1691 device_create_file(&new_client->dev, 1649 device_create_file(&new_client->dev,
1692 &dev_attr_temp3_auto_point1_temp); 1650 &sensor_dev_attr_temp3_auto_point1_temp.dev_attr);
1693 device_create_file(&new_client->dev, 1651 device_create_file(&new_client->dev,
1694 &dev_attr_temp1_auto_point1_temp_hyst); 1652 &sensor_dev_attr_temp1_auto_point1_temp_hyst.dev_attr);
1695 device_create_file(&new_client->dev, 1653 device_create_file(&new_client->dev,
1696 &dev_attr_temp2_auto_point1_temp_hyst); 1654 &sensor_dev_attr_temp2_auto_point1_temp_hyst.dev_attr);
1697 device_create_file(&new_client->dev, 1655 device_create_file(&new_client->dev,
1698 &dev_attr_temp3_auto_point1_temp_hyst); 1656 &sensor_dev_attr_temp3_auto_point1_temp_hyst.dev_attr);
1699 device_create_file(&new_client->dev, 1657 device_create_file(&new_client->dev,
1700 &dev_attr_temp1_auto_point2_temp); 1658 &sensor_dev_attr_temp1_auto_point2_temp.dev_attr);
1701 device_create_file(&new_client->dev, 1659 device_create_file(&new_client->dev,
1702 &dev_attr_temp2_auto_point2_temp); 1660 &sensor_dev_attr_temp2_auto_point2_temp.dev_attr);
1703 device_create_file(&new_client->dev, 1661 device_create_file(&new_client->dev,
1704 &dev_attr_temp3_auto_point2_temp); 1662 &sensor_dev_attr_temp3_auto_point2_temp.dev_attr);
1705 device_create_file(&new_client->dev, &dev_attr_temp1_crit); 1663 device_create_file(&new_client->dev, &sensor_dev_attr_temp1_crit.dev_attr);
1706 device_create_file(&new_client->dev, &dev_attr_temp2_crit); 1664 device_create_file(&new_client->dev, &sensor_dev_attr_temp2_crit.dev_attr);
1707 device_create_file(&new_client->dev, &dev_attr_temp3_crit); 1665 device_create_file(&new_client->dev, &sensor_dev_attr_temp3_crit.dev_attr);
1708 device_create_file(&new_client->dev, &dev_attr_temp1_crit_enable); 1666 device_create_file(&new_client->dev, &dev_attr_temp1_crit_enable);
1709 device_create_file(&new_client->dev, &dev_attr_temp2_crit_enable); 1667 device_create_file(&new_client->dev, &dev_attr_temp2_crit_enable);
1710 device_create_file(&new_client->dev, &dev_attr_temp3_crit_enable); 1668 device_create_file(&new_client->dev, &dev_attr_temp3_crit_enable);
diff --git a/drivers/i2c/chips/adm1031.c b/drivers/i2c/chips/adm1031.c
index d4385a23f79a..2163dba467c4 100644
--- a/drivers/i2c/chips/adm1031.c
+++ b/drivers/i2c/chips/adm1031.c
@@ -292,11 +292,11 @@ set_fan_auto_channel(struct device *dev, const char *buf, size_t count, int nr)
292} 292}
293 293
294#define fan_auto_channel_offset(offset) \ 294#define fan_auto_channel_offset(offset) \
295static ssize_t show_fan_auto_channel_##offset (struct device *dev, char *buf) \ 295static ssize_t show_fan_auto_channel_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
296{ \ 296{ \
297 return show_fan_auto_channel(dev, buf, offset - 1); \ 297 return show_fan_auto_channel(dev, buf, offset - 1); \
298} \ 298} \
299static ssize_t set_fan_auto_channel_##offset (struct device *dev, \ 299static ssize_t set_fan_auto_channel_##offset (struct device *dev, struct device_attribute *attr, \
300 const char *buf, size_t count) \ 300 const char *buf, size_t count) \
301{ \ 301{ \
302 return set_fan_auto_channel(dev, buf, count, offset - 1); \ 302 return set_fan_auto_channel(dev, buf, count, offset - 1); \
@@ -357,24 +357,24 @@ set_auto_temp_max(struct device *dev, const char *buf, size_t count, int nr)
357} 357}
358 358
359#define auto_temp_reg(offset) \ 359#define auto_temp_reg(offset) \
360static ssize_t show_auto_temp_##offset##_off (struct device *dev, char *buf) \ 360static ssize_t show_auto_temp_##offset##_off (struct device *dev, struct device_attribute *attr, char *buf) \
361{ \ 361{ \
362 return show_auto_temp_off(dev, buf, offset - 1); \ 362 return show_auto_temp_off(dev, buf, offset - 1); \
363} \ 363} \
364static ssize_t show_auto_temp_##offset##_min (struct device *dev, char *buf) \ 364static ssize_t show_auto_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
365{ \ 365{ \
366 return show_auto_temp_min(dev, buf, offset - 1); \ 366 return show_auto_temp_min(dev, buf, offset - 1); \
367} \ 367} \
368static ssize_t show_auto_temp_##offset##_max (struct device *dev, char *buf) \ 368static ssize_t show_auto_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
369{ \ 369{ \
370 return show_auto_temp_max(dev, buf, offset - 1); \ 370 return show_auto_temp_max(dev, buf, offset - 1); \
371} \ 371} \
372static ssize_t set_auto_temp_##offset##_min (struct device *dev, \ 372static ssize_t set_auto_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \
373 const char *buf, size_t count) \ 373 const char *buf, size_t count) \
374{ \ 374{ \
375 return set_auto_temp_min(dev, buf, count, offset - 1); \ 375 return set_auto_temp_min(dev, buf, count, offset - 1); \
376} \ 376} \
377static ssize_t set_auto_temp_##offset##_max (struct device *dev, \ 377static ssize_t set_auto_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \
378 const char *buf, size_t count) \ 378 const char *buf, size_t count) \
379{ \ 379{ \
380 return set_auto_temp_max(dev, buf, count, offset - 1); \ 380 return set_auto_temp_max(dev, buf, count, offset - 1); \
@@ -421,11 +421,11 @@ set_pwm(struct device *dev, const char *buf, size_t count, int nr)
421} 421}
422 422
423#define pwm_reg(offset) \ 423#define pwm_reg(offset) \
424static ssize_t show_pwm_##offset (struct device *dev, char *buf) \ 424static ssize_t show_pwm_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
425{ \ 425{ \
426 return show_pwm(dev, buf, offset - 1); \ 426 return show_pwm(dev, buf, offset - 1); \
427} \ 427} \
428static ssize_t set_pwm_##offset (struct device *dev, \ 428static ssize_t set_pwm_##offset (struct device *dev, struct device_attribute *attr, \
429 const char *buf, size_t count) \ 429 const char *buf, size_t count) \
430{ \ 430{ \
431 return set_pwm(dev, buf, count, offset - 1); \ 431 return set_pwm(dev, buf, count, offset - 1); \
@@ -557,24 +557,24 @@ set_fan_div(struct device *dev, const char *buf, size_t count, int nr)
557} 557}
558 558
559#define fan_offset(offset) \ 559#define fan_offset(offset) \
560static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 560static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
561{ \ 561{ \
562 return show_fan(dev, buf, offset - 1); \ 562 return show_fan(dev, buf, offset - 1); \
563} \ 563} \
564static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 564static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
565{ \ 565{ \
566 return show_fan_min(dev, buf, offset - 1); \ 566 return show_fan_min(dev, buf, offset - 1); \
567} \ 567} \
568static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 568static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
569{ \ 569{ \
570 return show_fan_div(dev, buf, offset - 1); \ 570 return show_fan_div(dev, buf, offset - 1); \
571} \ 571} \
572static ssize_t set_fan_##offset##_min (struct device *dev, \ 572static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
573 const char *buf, size_t count) \ 573 const char *buf, size_t count) \
574{ \ 574{ \
575 return set_fan_min(dev, buf, count, offset - 1); \ 575 return set_fan_min(dev, buf, count, offset - 1); \
576} \ 576} \
577static ssize_t set_fan_##offset##_div (struct device *dev, \ 577static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \
578 const char *buf, size_t count) \ 578 const char *buf, size_t count) \
579{ \ 579{ \
580 return set_fan_div(dev, buf, count, offset - 1); \ 580 return set_fan_div(dev, buf, count, offset - 1); \
@@ -667,33 +667,33 @@ set_temp_crit(struct device *dev, const char *buf, size_t count, int nr)
667} 667}
668 668
669#define temp_reg(offset) \ 669#define temp_reg(offset) \
670static ssize_t show_temp_##offset (struct device *dev, char *buf) \ 670static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
671{ \ 671{ \
672 return show_temp(dev, buf, offset - 1); \ 672 return show_temp(dev, buf, offset - 1); \
673} \ 673} \
674static ssize_t show_temp_##offset##_min (struct device *dev, char *buf) \ 674static ssize_t show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
675{ \ 675{ \
676 return show_temp_min(dev, buf, offset - 1); \ 676 return show_temp_min(dev, buf, offset - 1); \
677} \ 677} \
678static ssize_t show_temp_##offset##_max (struct device *dev, char *buf) \ 678static ssize_t show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
679{ \ 679{ \
680 return show_temp_max(dev, buf, offset - 1); \ 680 return show_temp_max(dev, buf, offset - 1); \
681} \ 681} \
682static ssize_t show_temp_##offset##_crit (struct device *dev, char *buf) \ 682static ssize_t show_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, char *buf) \
683{ \ 683{ \
684 return show_temp_crit(dev, buf, offset - 1); \ 684 return show_temp_crit(dev, buf, offset - 1); \
685} \ 685} \
686static ssize_t set_temp_##offset##_min (struct device *dev, \ 686static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \
687 const char *buf, size_t count) \ 687 const char *buf, size_t count) \
688{ \ 688{ \
689 return set_temp_min(dev, buf, count, offset - 1); \ 689 return set_temp_min(dev, buf, count, offset - 1); \
690} \ 690} \
691static ssize_t set_temp_##offset##_max (struct device *dev, \ 691static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \
692 const char *buf, size_t count) \ 692 const char *buf, size_t count) \
693{ \ 693{ \
694 return set_temp_max(dev, buf, count, offset - 1); \ 694 return set_temp_max(dev, buf, count, offset - 1); \
695} \ 695} \
696static ssize_t set_temp_##offset##_crit (struct device *dev, \ 696static ssize_t set_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, \
697 const char *buf, size_t count) \ 697 const char *buf, size_t count) \
698{ \ 698{ \
699 return set_temp_crit(dev, buf, count, offset - 1); \ 699 return set_temp_crit(dev, buf, count, offset - 1); \
@@ -712,7 +712,7 @@ temp_reg(2);
712temp_reg(3); 712temp_reg(3);
713 713
714/* Alarms */ 714/* Alarms */
715static ssize_t show_alarms(struct device *dev, char *buf) 715static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
716{ 716{
717 struct adm1031_data *data = adm1031_update_device(dev); 717 struct adm1031_data *data = adm1031_update_device(dev);
718 return sprintf(buf, "%d\n", data->alarm); 718 return sprintf(buf, "%d\n", data->alarm);
diff --git a/drivers/i2c/chips/asb100.c b/drivers/i2c/chips/asb100.c
index 7f899002bc54..4a47b4493e34 100644
--- a/drivers/i2c/chips/asb100.c
+++ b/drivers/i2c/chips/asb100.c
@@ -260,28 +260,28 @@ set_in_reg(MAX, max)
260 260
261#define sysfs_in(offset) \ 261#define sysfs_in(offset) \
262static ssize_t \ 262static ssize_t \
263 show_in##offset (struct device *dev, char *buf) \ 263 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
264{ \ 264{ \
265 return show_in(dev, buf, offset); \ 265 return show_in(dev, buf, offset); \
266} \ 266} \
267static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ 267static DEVICE_ATTR(in##offset##_input, S_IRUGO, \
268 show_in##offset, NULL); \ 268 show_in##offset, NULL); \
269static ssize_t \ 269static ssize_t \
270 show_in##offset##_min (struct device *dev, char *buf) \ 270 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
271{ \ 271{ \
272 return show_in_min(dev, buf, offset); \ 272 return show_in_min(dev, buf, offset); \
273} \ 273} \
274static ssize_t \ 274static ssize_t \
275 show_in##offset##_max (struct device *dev, char *buf) \ 275 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
276{ \ 276{ \
277 return show_in_max(dev, buf, offset); \ 277 return show_in_max(dev, buf, offset); \
278} \ 278} \
279static ssize_t set_in##offset##_min (struct device *dev, \ 279static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
280 const char *buf, size_t count) \ 280 const char *buf, size_t count) \
281{ \ 281{ \
282 return set_in_min(dev, buf, count, offset); \ 282 return set_in_min(dev, buf, count, offset); \
283} \ 283} \
284static ssize_t set_in##offset##_max (struct device *dev, \ 284static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
285 const char *buf, size_t count) \ 285 const char *buf, size_t count) \
286{ \ 286{ \
287 return set_in_max(dev, buf, count, offset); \ 287 return set_in_max(dev, buf, count, offset); \
@@ -389,24 +389,24 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
389} 389}
390 390
391#define sysfs_fan(offset) \ 391#define sysfs_fan(offset) \
392static ssize_t show_fan##offset(struct device *dev, char *buf) \ 392static ssize_t show_fan##offset(struct device *dev, struct device_attribute *attr, char *buf) \
393{ \ 393{ \
394 return show_fan(dev, buf, offset - 1); \ 394 return show_fan(dev, buf, offset - 1); \
395} \ 395} \
396static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ 396static ssize_t show_fan##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
397{ \ 397{ \
398 return show_fan_min(dev, buf, offset - 1); \ 398 return show_fan_min(dev, buf, offset - 1); \
399} \ 399} \
400static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ 400static ssize_t show_fan##offset##_div(struct device *dev, struct device_attribute *attr, char *buf) \
401{ \ 401{ \
402 return show_fan_div(dev, buf, offset - 1); \ 402 return show_fan_div(dev, buf, offset - 1); \
403} \ 403} \
404static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ 404static ssize_t set_fan##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
405 size_t count) \ 405 size_t count) \
406{ \ 406{ \
407 return set_fan_min(dev, buf, count, offset - 1); \ 407 return set_fan_min(dev, buf, count, offset - 1); \
408} \ 408} \
409static ssize_t set_fan##offset##_div(struct device *dev, const char *buf, \ 409static ssize_t set_fan##offset##_div(struct device *dev, struct device_attribute *attr, const char *buf, \
410 size_t count) \ 410 size_t count) \
411{ \ 411{ \
412 return set_fan_div(dev, buf, count, offset - 1); \ 412 return set_fan_div(dev, buf, count, offset - 1); \
@@ -482,27 +482,27 @@ set_temp_reg(MAX, temp_max);
482set_temp_reg(HYST, temp_hyst); 482set_temp_reg(HYST, temp_hyst);
483 483
484#define sysfs_temp(num) \ 484#define sysfs_temp(num) \
485static ssize_t show_temp##num(struct device *dev, char *buf) \ 485static ssize_t show_temp##num(struct device *dev, struct device_attribute *attr, char *buf) \
486{ \ 486{ \
487 return show_temp(dev, buf, num-1); \ 487 return show_temp(dev, buf, num-1); \
488} \ 488} \
489static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL); \ 489static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL); \
490static ssize_t show_temp_max##num(struct device *dev, char *buf) \ 490static ssize_t show_temp_max##num(struct device *dev, struct device_attribute *attr, char *buf) \
491{ \ 491{ \
492 return show_temp_max(dev, buf, num-1); \ 492 return show_temp_max(dev, buf, num-1); \
493} \ 493} \
494static ssize_t set_temp_max##num(struct device *dev, const char *buf, \ 494static ssize_t set_temp_max##num(struct device *dev, struct device_attribute *attr, const char *buf, \
495 size_t count) \ 495 size_t count) \
496{ \ 496{ \
497 return set_temp_max(dev, buf, count, num-1); \ 497 return set_temp_max(dev, buf, count, num-1); \
498} \ 498} \
499static DEVICE_ATTR(temp##num##_max, S_IRUGO | S_IWUSR, \ 499static DEVICE_ATTR(temp##num##_max, S_IRUGO | S_IWUSR, \
500 show_temp_max##num, set_temp_max##num); \ 500 show_temp_max##num, set_temp_max##num); \
501static ssize_t show_temp_hyst##num(struct device *dev, char *buf) \ 501static ssize_t show_temp_hyst##num(struct device *dev, struct device_attribute *attr, char *buf) \
502{ \ 502{ \
503 return show_temp_hyst(dev, buf, num-1); \ 503 return show_temp_hyst(dev, buf, num-1); \
504} \ 504} \
505static ssize_t set_temp_hyst##num(struct device *dev, const char *buf, \ 505static ssize_t set_temp_hyst##num(struct device *dev, struct device_attribute *attr, const char *buf, \
506 size_t count) \ 506 size_t count) \
507{ \ 507{ \
508 return set_temp_hyst(dev, buf, count, num-1); \ 508 return set_temp_hyst(dev, buf, count, num-1); \
@@ -522,7 +522,7 @@ sysfs_temp(4);
522 device_create_file(&client->dev, &dev_attr_temp##num##_max_hyst); \ 522 device_create_file(&client->dev, &dev_attr_temp##num##_max_hyst); \
523} while (0) 523} while (0)
524 524
525static ssize_t show_vid(struct device *dev, char *buf) 525static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
526{ 526{
527 struct asb100_data *data = asb100_update_device(dev); 527 struct asb100_data *data = asb100_update_device(dev);
528 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm)); 528 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm));
@@ -533,13 +533,13 @@ static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
533device_create_file(&client->dev, &dev_attr_cpu0_vid) 533device_create_file(&client->dev, &dev_attr_cpu0_vid)
534 534
535/* VRM */ 535/* VRM */
536static ssize_t show_vrm(struct device *dev, char *buf) 536static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
537{ 537{
538 struct asb100_data *data = asb100_update_device(dev); 538 struct asb100_data *data = asb100_update_device(dev);
539 return sprintf(buf, "%d\n", data->vrm); 539 return sprintf(buf, "%d\n", data->vrm);
540} 540}
541 541
542static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) 542static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
543{ 543{
544 struct i2c_client *client = to_i2c_client(dev); 544 struct i2c_client *client = to_i2c_client(dev);
545 struct asb100_data *data = i2c_get_clientdata(client); 545 struct asb100_data *data = i2c_get_clientdata(client);
@@ -553,7 +553,7 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm);
553#define device_create_file_vrm(client) \ 553#define device_create_file_vrm(client) \
554device_create_file(&client->dev, &dev_attr_vrm); 554device_create_file(&client->dev, &dev_attr_vrm);
555 555
556static ssize_t show_alarms(struct device *dev, char *buf) 556static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
557{ 557{
558 struct asb100_data *data = asb100_update_device(dev); 558 struct asb100_data *data = asb100_update_device(dev);
559 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->alarms)); 559 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->alarms));
@@ -564,13 +564,13 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
564device_create_file(&client->dev, &dev_attr_alarms) 564device_create_file(&client->dev, &dev_attr_alarms)
565 565
566/* 1 PWM */ 566/* 1 PWM */
567static ssize_t show_pwm1(struct device *dev, char *buf) 567static ssize_t show_pwm1(struct device *dev, struct device_attribute *attr, char *buf)
568{ 568{
569 struct asb100_data *data = asb100_update_device(dev); 569 struct asb100_data *data = asb100_update_device(dev);
570 return sprintf(buf, "%d\n", ASB100_PWM_FROM_REG(data->pwm & 0x0f)); 570 return sprintf(buf, "%d\n", ASB100_PWM_FROM_REG(data->pwm & 0x0f));
571} 571}
572 572
573static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count) 573static ssize_t set_pwm1(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
574{ 574{
575 struct i2c_client *client = to_i2c_client(dev); 575 struct i2c_client *client = to_i2c_client(dev);
576 struct asb100_data *data = i2c_get_clientdata(client); 576 struct asb100_data *data = i2c_get_clientdata(client);
@@ -584,13 +584,13 @@ static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count)
584 return count; 584 return count;
585} 585}
586 586
587static ssize_t show_pwm_enable1(struct device *dev, char *buf) 587static ssize_t show_pwm_enable1(struct device *dev, struct device_attribute *attr, char *buf)
588{ 588{
589 struct asb100_data *data = asb100_update_device(dev); 589 struct asb100_data *data = asb100_update_device(dev);
590 return sprintf(buf, "%d\n", (data->pwm & 0x80) ? 1 : 0); 590 return sprintf(buf, "%d\n", (data->pwm & 0x80) ? 1 : 0);
591} 591}
592 592
593static ssize_t set_pwm_enable1(struct device *dev, const char *buf, 593static ssize_t set_pwm_enable1(struct device *dev, struct device_attribute *attr, const char *buf,
594 size_t count) 594 size_t count)
595{ 595{
596 struct i2c_client *client = to_i2c_client(dev); 596 struct i2c_client *client = to_i2c_client(dev);
diff --git a/drivers/i2c/chips/ds1621.c b/drivers/i2c/chips/ds1621.c
index bb1fefb2162e..4ae15bd5dcfb 100644
--- a/drivers/i2c/chips/ds1621.c
+++ b/drivers/i2c/chips/ds1621.c
@@ -137,7 +137,7 @@ static void ds1621_init_client(struct i2c_client *client)
137} 137}
138 138
139#define show(value) \ 139#define show(value) \
140static ssize_t show_##value(struct device *dev, char *buf) \ 140static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
141{ \ 141{ \
142 struct ds1621_data *data = ds1621_update_client(dev); \ 142 struct ds1621_data *data = ds1621_update_client(dev); \
143 return sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(data->value)); \ 143 return sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(data->value)); \
@@ -148,7 +148,7 @@ show(temp_min);
148show(temp_max); 148show(temp_max);
149 149
150#define set_temp(suffix, value, reg) \ 150#define set_temp(suffix, value, reg) \
151static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \ 151static ssize_t set_temp_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
152 size_t count) \ 152 size_t count) \
153{ \ 153{ \
154 struct i2c_client *client = to_i2c_client(dev); \ 154 struct i2c_client *client = to_i2c_client(dev); \
@@ -165,7 +165,7 @@ static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \
165set_temp(min, temp_min, DS1621_REG_TEMP_MIN); 165set_temp(min, temp_min, DS1621_REG_TEMP_MIN);
166set_temp(max, temp_max, DS1621_REG_TEMP_MAX); 166set_temp(max, temp_max, DS1621_REG_TEMP_MAX);
167 167
168static ssize_t show_alarms(struct device *dev, char *buf) 168static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
169{ 169{
170 struct ds1621_data *data = ds1621_update_client(dev); 170 struct ds1621_data *data = ds1621_update_client(dev);
171 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->conf)); 171 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->conf));
diff --git a/drivers/i2c/chips/fscher.c b/drivers/i2c/chips/fscher.c
index 18e33ac59d0c..c3f37dbec11a 100644
--- a/drivers/i2c/chips/fscher.c
+++ b/drivers/i2c/chips/fscher.c
@@ -157,8 +157,8 @@ struct fscher_data {
157 157
158#define sysfs_r(kind, sub, offset, reg) \ 158#define sysfs_r(kind, sub, offset, reg) \
159static ssize_t show_##kind##sub (struct fscher_data *, char *, int); \ 159static ssize_t show_##kind##sub (struct fscher_data *, char *, int); \
160static ssize_t show_##kind##offset##sub (struct device *, char *); \ 160static ssize_t show_##kind##offset##sub (struct device *, struct device_attribute *attr, char *); \
161static ssize_t show_##kind##offset##sub (struct device *dev, char *buf) \ 161static ssize_t show_##kind##offset##sub (struct device *dev, struct device_attribute *attr, char *buf) \
162{ \ 162{ \
163 struct fscher_data *data = fscher_update_device(dev); \ 163 struct fscher_data *data = fscher_update_device(dev); \
164 return show_##kind##sub(data, buf, (offset)); \ 164 return show_##kind##sub(data, buf, (offset)); \
@@ -166,8 +166,8 @@ static ssize_t show_##kind##offset##sub (struct device *dev, char *buf) \
166 166
167#define sysfs_w(kind, sub, offset, reg) \ 167#define sysfs_w(kind, sub, offset, reg) \
168static ssize_t set_##kind##sub (struct i2c_client *, struct fscher_data *, const char *, size_t, int, int); \ 168static ssize_t set_##kind##sub (struct i2c_client *, struct fscher_data *, const char *, size_t, int, int); \
169static ssize_t set_##kind##offset##sub (struct device *, const char *, size_t); \ 169static ssize_t set_##kind##offset##sub (struct device *, struct device_attribute *attr, const char *, size_t); \
170static ssize_t set_##kind##offset##sub (struct device *dev, const char *buf, size_t count) \ 170static ssize_t set_##kind##offset##sub (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
171{ \ 171{ \
172 struct i2c_client *client = to_i2c_client(dev); \ 172 struct i2c_client *client = to_i2c_client(dev); \
173 struct fscher_data *data = i2c_get_clientdata(client); \ 173 struct fscher_data *data = i2c_get_clientdata(client); \
diff --git a/drivers/i2c/chips/fscpos.c b/drivers/i2c/chips/fscpos.c
index 2cac79145c75..3beaa6191ef4 100644
--- a/drivers/i2c/chips/fscpos.c
+++ b/drivers/i2c/chips/fscpos.c
@@ -245,19 +245,19 @@ static void reset_fan_alarm(struct i2c_client *client, int nr)
245/* Volts */ 245/* Volts */
246#define VOLT_FROM_REG(val, mult) ((val) * (mult) / 255) 246#define VOLT_FROM_REG(val, mult) ((val) * (mult) / 255)
247 247
248static ssize_t show_volt_12(struct device *dev, char *buf) 248static ssize_t show_volt_12(struct device *dev, struct device_attribute *attr, char *buf)
249{ 249{
250 struct fscpos_data *data = fscpos_update_device(dev); 250 struct fscpos_data *data = fscpos_update_device(dev);
251 return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[0], 14200)); 251 return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[0], 14200));
252} 252}
253 253
254static ssize_t show_volt_5(struct device *dev, char *buf) 254static ssize_t show_volt_5(struct device *dev, struct device_attribute *attr, char *buf)
255{ 255{
256 struct fscpos_data *data = fscpos_update_device(dev); 256 struct fscpos_data *data = fscpos_update_device(dev);
257 return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[1], 6600)); 257 return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[1], 6600));
258} 258}
259 259
260static ssize_t show_volt_batt(struct device *dev, char *buf) 260static ssize_t show_volt_batt(struct device *dev, struct device_attribute *attr, char *buf)
261{ 261{
262 struct fscpos_data *data = fscpos_update_device(dev); 262 struct fscpos_data *data = fscpos_update_device(dev);
263 return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[2], 3300)); 263 return sprintf(buf, "%u\n", VOLT_FROM_REG(data->volt[2], 3300));
@@ -327,7 +327,7 @@ static ssize_t set_wdog_preset(struct i2c_client *client, struct fscpos_data
327} 327}
328 328
329/* Event */ 329/* Event */
330static ssize_t show_event(struct device *dev, char *buf) 330static ssize_t show_event(struct device *dev, struct device_attribute *attr, char *buf)
331{ 331{
332 /* bits 5..7 reserved => mask with 0x1f */ 332 /* bits 5..7 reserved => mask with 0x1f */
333 struct fscpos_data *data = fscpos_update_device(dev); 333 struct fscpos_data *data = fscpos_update_device(dev);
@@ -338,14 +338,14 @@ static ssize_t show_event(struct device *dev, char *buf)
338 * Sysfs stuff 338 * Sysfs stuff
339 */ 339 */
340#define create_getter(kind, sub) \ 340#define create_getter(kind, sub) \
341 static ssize_t sysfs_show_##kind##sub(struct device *dev, char *buf) \ 341 static ssize_t sysfs_show_##kind##sub(struct device *dev, struct device_attribute *attr, char *buf) \
342 { \ 342 { \
343 struct fscpos_data *data = fscpos_update_device(dev); \ 343 struct fscpos_data *data = fscpos_update_device(dev); \
344 return show_##kind##sub(data, buf); \ 344 return show_##kind##sub(data, buf); \
345 } 345 }
346 346
347#define create_getter_n(kind, offset, sub) \ 347#define create_getter_n(kind, offset, sub) \
348 static ssize_t sysfs_show_##kind##offset##sub(struct device *dev, char\ 348 static ssize_t sysfs_show_##kind##offset##sub(struct device *dev, struct device_attribute *attr, char\
349 *buf) \ 349 *buf) \
350 { \ 350 { \
351 struct fscpos_data *data = fscpos_update_device(dev); \ 351 struct fscpos_data *data = fscpos_update_device(dev); \
@@ -353,7 +353,7 @@ static ssize_t show_event(struct device *dev, char *buf)
353 } 353 }
354 354
355#define create_setter(kind, sub, reg) \ 355#define create_setter(kind, sub, reg) \
356 static ssize_t sysfs_set_##kind##sub (struct device *dev, const char \ 356 static ssize_t sysfs_set_##kind##sub (struct device *dev, struct device_attribute *attr, const char \
357 *buf, size_t count) \ 357 *buf, size_t count) \
358 { \ 358 { \
359 struct i2c_client *client = to_i2c_client(dev); \ 359 struct i2c_client *client = to_i2c_client(dev); \
@@ -362,7 +362,7 @@ static ssize_t show_event(struct device *dev, char *buf)
362 } 362 }
363 363
364#define create_setter_n(kind, offset, sub, reg) \ 364#define create_setter_n(kind, offset, sub, reg) \
365 static ssize_t sysfs_set_##kind##offset##sub (struct device *dev, \ 365 static ssize_t sysfs_set_##kind##offset##sub (struct device *dev, struct device_attribute *attr, \
366 const char *buf, size_t count) \ 366 const char *buf, size_t count) \
367 { \ 367 { \
368 struct i2c_client *client = to_i2c_client(dev); \ 368 struct i2c_client *client = to_i2c_client(dev); \
diff --git a/drivers/i2c/chips/gl518sm.c b/drivers/i2c/chips/gl518sm.c
index c82d6ce21205..4316a1562251 100644
--- a/drivers/i2c/chips/gl518sm.c
+++ b/drivers/i2c/chips/gl518sm.c
@@ -164,14 +164,14 @@ static struct i2c_driver gl518_driver = {
164 */ 164 */
165 165
166#define show(type, suffix, value) \ 166#define show(type, suffix, value) \
167static ssize_t show_##suffix(struct device *dev, char *buf) \ 167static ssize_t show_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
168{ \ 168{ \
169 struct gl518_data *data = gl518_update_device(dev); \ 169 struct gl518_data *data = gl518_update_device(dev); \
170 return sprintf(buf, "%d\n", type##_FROM_REG(data->value)); \ 170 return sprintf(buf, "%d\n", type##_FROM_REG(data->value)); \
171} 171}
172 172
173#define show_fan(suffix, value, index) \ 173#define show_fan(suffix, value, index) \
174static ssize_t show_##suffix(struct device *dev, char *buf) \ 174static ssize_t show_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
175{ \ 175{ \
176 struct gl518_data *data = gl518_update_device(dev); \ 176 struct gl518_data *data = gl518_update_device(dev); \
177 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value[index], \ 177 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value[index], \
@@ -205,7 +205,7 @@ show(BOOL, beep_enable, beep_enable);
205show(BEEP_MASK, beep_mask, beep_mask); 205show(BEEP_MASK, beep_mask, beep_mask);
206 206
207#define set(type, suffix, value, reg) \ 207#define set(type, suffix, value, reg) \
208static ssize_t set_##suffix(struct device *dev, const char *buf, \ 208static ssize_t set_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
209 size_t count) \ 209 size_t count) \
210{ \ 210{ \
211 struct i2c_client *client = to_i2c_client(dev); \ 211 struct i2c_client *client = to_i2c_client(dev); \
@@ -220,7 +220,7 @@ static ssize_t set_##suffix(struct device *dev, const char *buf, \
220} 220}
221 221
222#define set_bits(type, suffix, value, reg, mask, shift) \ 222#define set_bits(type, suffix, value, reg, mask, shift) \
223static ssize_t set_##suffix(struct device *dev, const char *buf, \ 223static ssize_t set_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
224 size_t count) \ 224 size_t count) \
225{ \ 225{ \
226 struct i2c_client *client = to_i2c_client(dev); \ 226 struct i2c_client *client = to_i2c_client(dev); \
@@ -258,7 +258,7 @@ set_high(IN, in_max3, voltage_max[3], GL518_REG_VIN3_LIMIT);
258set_bits(BOOL, beep_enable, beep_enable, GL518_REG_CONF, 0x04, 2); 258set_bits(BOOL, beep_enable, beep_enable, GL518_REG_CONF, 0x04, 2);
259set(BEEP_MASK, beep_mask, beep_mask, GL518_REG_ALARM); 259set(BEEP_MASK, beep_mask, beep_mask, GL518_REG_ALARM);
260 260
261static ssize_t set_fan_min1(struct device *dev, const char *buf, size_t count) 261static ssize_t set_fan_min1(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
262{ 262{
263 struct i2c_client *client = to_i2c_client(dev); 263 struct i2c_client *client = to_i2c_client(dev);
264 struct gl518_data *data = i2c_get_clientdata(client); 264 struct gl518_data *data = i2c_get_clientdata(client);
@@ -284,7 +284,7 @@ static ssize_t set_fan_min1(struct device *dev, const char *buf, size_t count)
284 return count; 284 return count;
285} 285}
286 286
287static ssize_t set_fan_min2(struct device *dev, const char *buf, size_t count) 287static ssize_t set_fan_min2(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
288{ 288{
289 struct i2c_client *client = to_i2c_client(dev); 289 struct i2c_client *client = to_i2c_client(dev);
290 struct gl518_data *data = i2c_get_clientdata(client); 290 struct gl518_data *data = i2c_get_clientdata(client);
diff --git a/drivers/i2c/chips/gl520sm.c b/drivers/i2c/chips/gl520sm.c
index 3fd17e46ffc6..a13a504f5bfa 100644
--- a/drivers/i2c/chips/gl520sm.c
+++ b/drivers/i2c/chips/gl520sm.c
@@ -148,8 +148,8 @@ struct gl520_data {
148 148
149#define sysfs_r(type, n, item, reg) \ 149#define sysfs_r(type, n, item, reg) \
150static ssize_t get_##type##item (struct gl520_data *, char *, int); \ 150static ssize_t get_##type##item (struct gl520_data *, char *, int); \
151static ssize_t get_##type##n##item (struct device *, char *); \ 151static ssize_t get_##type##n##item (struct device *, struct device_attribute *attr, char *); \
152static ssize_t get_##type##n##item (struct device *dev, char *buf) \ 152static ssize_t get_##type##n##item (struct device *dev, struct device_attribute *attr, char *buf) \
153{ \ 153{ \
154 struct gl520_data *data = gl520_update_device(dev); \ 154 struct gl520_data *data = gl520_update_device(dev); \
155 return get_##type##item(data, buf, (n)); \ 155 return get_##type##item(data, buf, (n)); \
@@ -157,8 +157,8 @@ static ssize_t get_##type##n##item (struct device *dev, char *buf) \
157 157
158#define sysfs_w(type, n, item, reg) \ 158#define sysfs_w(type, n, item, reg) \
159static ssize_t set_##type##item (struct i2c_client *, struct gl520_data *, const char *, size_t, int, int); \ 159static ssize_t set_##type##item (struct i2c_client *, struct gl520_data *, const char *, size_t, int, int); \
160static ssize_t set_##type##n##item (struct device *, const char *, size_t); \ 160static ssize_t set_##type##n##item (struct device *, struct device_attribute *attr, const char *, size_t); \
161static ssize_t set_##type##n##item (struct device *dev, const char *buf, size_t count) \ 161static ssize_t set_##type##n##item (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
162{ \ 162{ \
163 struct i2c_client *client = to_i2c_client(dev); \ 163 struct i2c_client *client = to_i2c_client(dev); \
164 struct gl520_data *data = i2c_get_clientdata(client); \ 164 struct gl520_data *data = i2c_get_clientdata(client); \
diff --git a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c
index cf7e6898754f..007bdf9e7e2a 100644
--- a/drivers/i2c/chips/it87.c
+++ b/drivers/i2c/chips/it87.c
@@ -290,7 +290,7 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
290 290
291#define show_in_offset(offset) \ 291#define show_in_offset(offset) \
292static ssize_t \ 292static ssize_t \
293 show_in##offset (struct device *dev, char *buf) \ 293 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
294{ \ 294{ \
295 return show_in(dev, buf, offset); \ 295 return show_in(dev, buf, offset); \
296} \ 296} \
@@ -298,21 +298,21 @@ static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL);
298 298
299#define limit_in_offset(offset) \ 299#define limit_in_offset(offset) \
300static ssize_t \ 300static ssize_t \
301 show_in##offset##_min (struct device *dev, char *buf) \ 301 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
302{ \ 302{ \
303 return show_in_min(dev, buf, offset); \ 303 return show_in_min(dev, buf, offset); \
304} \ 304} \
305static ssize_t \ 305static ssize_t \
306 show_in##offset##_max (struct device *dev, char *buf) \ 306 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
307{ \ 307{ \
308 return show_in_max(dev, buf, offset); \ 308 return show_in_max(dev, buf, offset); \
309} \ 309} \
310static ssize_t set_in##offset##_min (struct device *dev, \ 310static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
311 const char *buf, size_t count) \ 311 const char *buf, size_t count) \
312{ \ 312{ \
313 return set_in_min(dev, buf, count, offset); \ 313 return set_in_min(dev, buf, count, offset); \
314} \ 314} \
315static ssize_t set_in##offset##_max (struct device *dev, \ 315static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
316 const char *buf, size_t count) \ 316 const char *buf, size_t count) \
317{ \ 317{ \
318 return set_in_max(dev, buf, count, offset); \ 318 return set_in_max(dev, buf, count, offset); \
@@ -383,26 +383,26 @@ static ssize_t set_temp_min(struct device *dev, const char *buf,
383 return count; 383 return count;
384} 384}
385#define show_temp_offset(offset) \ 385#define show_temp_offset(offset) \
386static ssize_t show_temp_##offset (struct device *dev, char *buf) \ 386static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
387{ \ 387{ \
388 return show_temp(dev, buf, offset - 1); \ 388 return show_temp(dev, buf, offset - 1); \
389} \ 389} \
390static ssize_t \ 390static ssize_t \
391show_temp_##offset##_max (struct device *dev, char *buf) \ 391show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
392{ \ 392{ \
393 return show_temp_max(dev, buf, offset - 1); \ 393 return show_temp_max(dev, buf, offset - 1); \
394} \ 394} \
395static ssize_t \ 395static ssize_t \
396show_temp_##offset##_min (struct device *dev, char *buf) \ 396show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
397{ \ 397{ \
398 return show_temp_min(dev, buf, offset - 1); \ 398 return show_temp_min(dev, buf, offset - 1); \
399} \ 399} \
400static ssize_t set_temp_##offset##_max (struct device *dev, \ 400static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \
401 const char *buf, size_t count) \ 401 const char *buf, size_t count) \
402{ \ 402{ \
403 return set_temp_max(dev, buf, count, offset - 1); \ 403 return set_temp_max(dev, buf, count, offset - 1); \
404} \ 404} \
405static ssize_t set_temp_##offset##_min (struct device *dev, \ 405static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \
406 const char *buf, size_t count) \ 406 const char *buf, size_t count) \
407{ \ 407{ \
408 return set_temp_min(dev, buf, count, offset - 1); \ 408 return set_temp_min(dev, buf, count, offset - 1); \
@@ -453,11 +453,11 @@ static ssize_t set_sensor(struct device *dev, const char *buf,
453 return count; 453 return count;
454} 454}
455#define show_sensor_offset(offset) \ 455#define show_sensor_offset(offset) \
456static ssize_t show_sensor_##offset (struct device *dev, char *buf) \ 456static ssize_t show_sensor_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
457{ \ 457{ \
458 return show_sensor(dev, buf, offset - 1); \ 458 return show_sensor(dev, buf, offset - 1); \
459} \ 459} \
460static ssize_t set_sensor_##offset (struct device *dev, \ 460static ssize_t set_sensor_##offset (struct device *dev, struct device_attribute *attr, \
461 const char *buf, size_t count) \ 461 const char *buf, size_t count) \
462{ \ 462{ \
463 return set_sensor(dev, buf, count, offset - 1); \ 463 return set_sensor(dev, buf, count, offset - 1); \
@@ -600,24 +600,24 @@ static ssize_t set_pwm(struct device *dev, const char *buf,
600} 600}
601 601
602#define show_fan_offset(offset) \ 602#define show_fan_offset(offset) \
603static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 603static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
604{ \ 604{ \
605 return show_fan(dev, buf, offset - 1); \ 605 return show_fan(dev, buf, offset - 1); \
606} \ 606} \
607static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 607static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
608{ \ 608{ \
609 return show_fan_min(dev, buf, offset - 1); \ 609 return show_fan_min(dev, buf, offset - 1); \
610} \ 610} \
611static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 611static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
612{ \ 612{ \
613 return show_fan_div(dev, buf, offset - 1); \ 613 return show_fan_div(dev, buf, offset - 1); \
614} \ 614} \
615static ssize_t set_fan_##offset##_min (struct device *dev, \ 615static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
616 const char *buf, size_t count) \ 616 const char *buf, size_t count) \
617{ \ 617{ \
618 return set_fan_min(dev, buf, count, offset - 1); \ 618 return set_fan_min(dev, buf, count, offset - 1); \
619} \ 619} \
620static ssize_t set_fan_##offset##_div (struct device *dev, \ 620static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \
621 const char *buf, size_t count) \ 621 const char *buf, size_t count) \
622{ \ 622{ \
623 return set_fan_div(dev, buf, count, offset - 1); \ 623 return set_fan_div(dev, buf, count, offset - 1); \
@@ -633,21 +633,21 @@ show_fan_offset(2);
633show_fan_offset(3); 633show_fan_offset(3);
634 634
635#define show_pwm_offset(offset) \ 635#define show_pwm_offset(offset) \
636static ssize_t show_pwm##offset##_enable (struct device *dev, \ 636static ssize_t show_pwm##offset##_enable (struct device *dev, struct device_attribute *attr, \
637 char *buf) \ 637 char *buf) \
638{ \ 638{ \
639 return show_pwm_enable(dev, buf, offset - 1); \ 639 return show_pwm_enable(dev, buf, offset - 1); \
640} \ 640} \
641static ssize_t show_pwm##offset (struct device *dev, char *buf) \ 641static ssize_t show_pwm##offset (struct device *dev, struct device_attribute *attr, char *buf) \
642{ \ 642{ \
643 return show_pwm(dev, buf, offset - 1); \ 643 return show_pwm(dev, buf, offset - 1); \
644} \ 644} \
645static ssize_t set_pwm##offset##_enable (struct device *dev, \ 645static ssize_t set_pwm##offset##_enable (struct device *dev, struct device_attribute *attr, \
646 const char *buf, size_t count) \ 646 const char *buf, size_t count) \
647{ \ 647{ \
648 return set_pwm_enable(dev, buf, count, offset - 1); \ 648 return set_pwm_enable(dev, buf, count, offset - 1); \
649} \ 649} \
650static ssize_t set_pwm##offset (struct device *dev, \ 650static ssize_t set_pwm##offset (struct device *dev, struct device_attribute *attr, \
651 const char *buf, size_t count) \ 651 const char *buf, size_t count) \
652{ \ 652{ \
653 return set_pwm(dev, buf, count, offset - 1); \ 653 return set_pwm(dev, buf, count, offset - 1); \
@@ -663,7 +663,7 @@ show_pwm_offset(2);
663show_pwm_offset(3); 663show_pwm_offset(3);
664 664
665/* Alarms */ 665/* Alarms */
666static ssize_t show_alarms(struct device *dev, char *buf) 666static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
667{ 667{
668 struct it87_data *data = it87_update_device(dev); 668 struct it87_data *data = it87_update_device(dev);
669 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms)); 669 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms));
@@ -671,13 +671,13 @@ static ssize_t show_alarms(struct device *dev, char *buf)
671static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); 671static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
672 672
673static ssize_t 673static ssize_t
674show_vrm_reg(struct device *dev, char *buf) 674show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
675{ 675{
676 struct it87_data *data = it87_update_device(dev); 676 struct it87_data *data = it87_update_device(dev);
677 return sprintf(buf, "%ld\n", (long) data->vrm); 677 return sprintf(buf, "%ld\n", (long) data->vrm);
678} 678}
679static ssize_t 679static ssize_t
680store_vrm_reg(struct device *dev, const char *buf, size_t count) 680store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
681{ 681{
682 struct i2c_client *client = to_i2c_client(dev); 682 struct i2c_client *client = to_i2c_client(dev);
683 struct it87_data *data = i2c_get_clientdata(client); 683 struct it87_data *data = i2c_get_clientdata(client);
@@ -693,7 +693,7 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
693device_create_file(&client->dev, &dev_attr_vrm) 693device_create_file(&client->dev, &dev_attr_vrm)
694 694
695static ssize_t 695static ssize_t
696show_vid_reg(struct device *dev, char *buf) 696show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
697{ 697{
698 struct it87_data *data = it87_update_device(dev); 698 struct it87_data *data = it87_update_device(dev);
699 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); 699 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm));
diff --git a/drivers/i2c/chips/lm63.c b/drivers/i2c/chips/lm63.c
index 14cc5af03739..bc68e031392b 100644
--- a/drivers/i2c/chips/lm63.c
+++ b/drivers/i2c/chips/lm63.c
@@ -177,7 +177,7 @@ struct lm63_data {
177 */ 177 */
178 178
179#define show_fan(value) \ 179#define show_fan(value) \
180static ssize_t show_##value(struct device *dev, char *buf) \ 180static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
181{ \ 181{ \
182 struct lm63_data *data = lm63_update_device(dev); \ 182 struct lm63_data *data = lm63_update_device(dev); \
183 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value)); \ 183 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value)); \
@@ -185,7 +185,7 @@ static ssize_t show_##value(struct device *dev, char *buf) \
185show_fan(fan1_input); 185show_fan(fan1_input);
186show_fan(fan1_low); 186show_fan(fan1_low);
187 187
188static ssize_t set_fan1_low(struct device *dev, const char *buf, 188static ssize_t set_fan1_low(struct device *dev, struct device_attribute *attr, const char *buf,
189 size_t count) 189 size_t count)
190{ 190{
191 struct i2c_client *client = to_i2c_client(dev); 191 struct i2c_client *client = to_i2c_client(dev);
@@ -202,7 +202,7 @@ static ssize_t set_fan1_low(struct device *dev, const char *buf,
202 return count; 202 return count;
203} 203}
204 204
205static ssize_t show_pwm1(struct device *dev, char *buf) 205static ssize_t show_pwm1(struct device *dev, struct device_attribute *attr, char *buf)
206{ 206{
207 struct lm63_data *data = lm63_update_device(dev); 207 struct lm63_data *data = lm63_update_device(dev);
208 return sprintf(buf, "%d\n", data->pwm1_value >= 2 * data->pwm1_freq ? 208 return sprintf(buf, "%d\n", data->pwm1_value >= 2 * data->pwm1_freq ?
@@ -210,7 +210,7 @@ static ssize_t show_pwm1(struct device *dev, char *buf)
210 (2 * data->pwm1_freq)); 210 (2 * data->pwm1_freq));
211} 211}
212 212
213static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count) 213static ssize_t set_pwm1(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
214{ 214{
215 struct i2c_client *client = to_i2c_client(dev); 215 struct i2c_client *client = to_i2c_client(dev);
216 struct lm63_data *data = i2c_get_clientdata(client); 216 struct lm63_data *data = i2c_get_clientdata(client);
@@ -229,20 +229,20 @@ static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count)
229 return count; 229 return count;
230} 230}
231 231
232static ssize_t show_pwm1_enable(struct device *dev, char *buf) 232static ssize_t show_pwm1_enable(struct device *dev, struct device_attribute *attr, char *buf)
233{ 233{
234 struct lm63_data *data = lm63_update_device(dev); 234 struct lm63_data *data = lm63_update_device(dev);
235 return sprintf(buf, "%d\n", data->config_fan & 0x20 ? 1 : 2); 235 return sprintf(buf, "%d\n", data->config_fan & 0x20 ? 1 : 2);
236} 236}
237 237
238#define show_temp8(value) \ 238#define show_temp8(value) \
239static ssize_t show_##value(struct device *dev, char *buf) \ 239static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
240{ \ 240{ \
241 struct lm63_data *data = lm63_update_device(dev); \ 241 struct lm63_data *data = lm63_update_device(dev); \
242 return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->value)); \ 242 return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->value)); \
243} 243}
244#define show_temp11(value) \ 244#define show_temp11(value) \
245static ssize_t show_##value(struct device *dev, char *buf) \ 245static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
246{ \ 246{ \
247 struct lm63_data *data = lm63_update_device(dev); \ 247 struct lm63_data *data = lm63_update_device(dev); \
248 return sprintf(buf, "%d\n", TEMP11_FROM_REG(data->value)); \ 248 return sprintf(buf, "%d\n", TEMP11_FROM_REG(data->value)); \
@@ -255,7 +255,7 @@ show_temp11(temp2_low);
255show_temp8(temp2_crit); 255show_temp8(temp2_crit);
256 256
257#define set_temp8(value, reg) \ 257#define set_temp8(value, reg) \
258static ssize_t set_##value(struct device *dev, const char *buf, \ 258static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \
259 size_t count) \ 259 size_t count) \
260{ \ 260{ \
261 struct i2c_client *client = to_i2c_client(dev); \ 261 struct i2c_client *client = to_i2c_client(dev); \
@@ -269,7 +269,7 @@ static ssize_t set_##value(struct device *dev, const char *buf, \
269 return count; \ 269 return count; \
270} 270}
271#define set_temp11(value, reg_msb, reg_lsb) \ 271#define set_temp11(value, reg_msb, reg_lsb) \
272static ssize_t set_##value(struct device *dev, const char *buf, \ 272static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \
273 size_t count) \ 273 size_t count) \
274{ \ 274{ \
275 struct i2c_client *client = to_i2c_client(dev); \ 275 struct i2c_client *client = to_i2c_client(dev); \
@@ -289,7 +289,7 @@ set_temp11(temp2_low, LM63_REG_REMOTE_LOW_MSB, LM63_REG_REMOTE_LOW_LSB);
289 289
290/* Hysteresis register holds a relative value, while we want to present 290/* Hysteresis register holds a relative value, while we want to present
291 an absolute to user-space */ 291 an absolute to user-space */
292static ssize_t show_temp2_crit_hyst(struct device *dev, char *buf) 292static ssize_t show_temp2_crit_hyst(struct device *dev, struct device_attribute *attr, char *buf)
293{ 293{
294 struct lm63_data *data = lm63_update_device(dev); 294 struct lm63_data *data = lm63_update_device(dev);
295 return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->temp2_crit) 295 return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->temp2_crit)
@@ -298,7 +298,7 @@ static ssize_t show_temp2_crit_hyst(struct device *dev, char *buf)
298 298
299/* And now the other way around, user-space provides an absolute 299/* And now the other way around, user-space provides an absolute
300 hysteresis value and we have to store a relative one */ 300 hysteresis value and we have to store a relative one */
301static ssize_t set_temp2_crit_hyst(struct device *dev, const char *buf, 301static ssize_t set_temp2_crit_hyst(struct device *dev, struct device_attribute *attr, const char *buf,
302 size_t count) 302 size_t count)
303{ 303{
304 struct i2c_client *client = to_i2c_client(dev); 304 struct i2c_client *client = to_i2c_client(dev);
@@ -314,7 +314,7 @@ static ssize_t set_temp2_crit_hyst(struct device *dev, const char *buf,
314 return count; 314 return count;
315} 315}
316 316
317static ssize_t show_alarms(struct device *dev, char *buf) 317static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
318{ 318{
319 struct lm63_data *data = lm63_update_device(dev); 319 struct lm63_data *data = lm63_update_device(dev);
320 return sprintf(buf, "%u\n", data->alarms); 320 return sprintf(buf, "%u\n", data->alarms);
diff --git a/drivers/i2c/chips/lm75.c b/drivers/i2c/chips/lm75.c
index 0e86cc893981..57c51ac37c04 100644
--- a/drivers/i2c/chips/lm75.c
+++ b/drivers/i2c/chips/lm75.c
@@ -75,7 +75,7 @@ static struct i2c_driver lm75_driver = {
75}; 75};
76 76
77#define show(value) \ 77#define show(value) \
78static ssize_t show_##value(struct device *dev, char *buf) \ 78static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
79{ \ 79{ \
80 struct lm75_data *data = lm75_update_device(dev); \ 80 struct lm75_data *data = lm75_update_device(dev); \
81 return sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(data->value)); \ 81 return sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(data->value)); \
@@ -85,7 +85,7 @@ show(temp_hyst);
85show(temp_input); 85show(temp_input);
86 86
87#define set(value, reg) \ 87#define set(value, reg) \
88static ssize_t set_##value(struct device *dev, const char *buf, size_t count) \ 88static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
89{ \ 89{ \
90 struct i2c_client *client = to_i2c_client(dev); \ 90 struct i2c_client *client = to_i2c_client(dev); \
91 struct lm75_data *data = i2c_get_clientdata(client); \ 91 struct lm75_data *data = i2c_get_clientdata(client); \
diff --git a/drivers/i2c/chips/lm77.c b/drivers/i2c/chips/lm77.c
index f56b7a37de75..9d15cd5189f6 100644
--- a/drivers/i2c/chips/lm77.c
+++ b/drivers/i2c/chips/lm77.c
@@ -103,7 +103,7 @@ static inline int LM77_TEMP_FROM_REG(u16 reg)
103 103
104/* read routines for temperature limits */ 104/* read routines for temperature limits */
105#define show(value) \ 105#define show(value) \
106static ssize_t show_##value(struct device *dev, char *buf) \ 106static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
107{ \ 107{ \
108 struct lm77_data *data = lm77_update_device(dev); \ 108 struct lm77_data *data = lm77_update_device(dev); \
109 return sprintf(buf, "%d\n", data->value); \ 109 return sprintf(buf, "%d\n", data->value); \
@@ -116,17 +116,17 @@ show(temp_max);
116show(alarms); 116show(alarms);
117 117
118/* read routines for hysteresis values */ 118/* read routines for hysteresis values */
119static ssize_t show_temp_crit_hyst(struct device *dev, char *buf) 119static ssize_t show_temp_crit_hyst(struct device *dev, struct device_attribute *attr, char *buf)
120{ 120{
121 struct lm77_data *data = lm77_update_device(dev); 121 struct lm77_data *data = lm77_update_device(dev);
122 return sprintf(buf, "%d\n", data->temp_crit - data->temp_hyst); 122 return sprintf(buf, "%d\n", data->temp_crit - data->temp_hyst);
123} 123}
124static ssize_t show_temp_min_hyst(struct device *dev, char *buf) 124static ssize_t show_temp_min_hyst(struct device *dev, struct device_attribute *attr, char *buf)
125{ 125{
126 struct lm77_data *data = lm77_update_device(dev); 126 struct lm77_data *data = lm77_update_device(dev);
127 return sprintf(buf, "%d\n", data->temp_min + data->temp_hyst); 127 return sprintf(buf, "%d\n", data->temp_min + data->temp_hyst);
128} 128}
129static ssize_t show_temp_max_hyst(struct device *dev, char *buf) 129static ssize_t show_temp_max_hyst(struct device *dev, struct device_attribute *attr, char *buf)
130{ 130{
131 struct lm77_data *data = lm77_update_device(dev); 131 struct lm77_data *data = lm77_update_device(dev);
132 return sprintf(buf, "%d\n", data->temp_max - data->temp_hyst); 132 return sprintf(buf, "%d\n", data->temp_max - data->temp_hyst);
@@ -134,7 +134,7 @@ static ssize_t show_temp_max_hyst(struct device *dev, char *buf)
134 134
135/* write routines */ 135/* write routines */
136#define set(value, reg) \ 136#define set(value, reg) \
137static ssize_t set_##value(struct device *dev, const char *buf, size_t count) \ 137static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
138{ \ 138{ \
139 struct i2c_client *client = to_i2c_client(dev); \ 139 struct i2c_client *client = to_i2c_client(dev); \
140 struct lm77_data *data = i2c_get_clientdata(client); \ 140 struct lm77_data *data = i2c_get_clientdata(client); \
@@ -152,7 +152,7 @@ set(temp_max, LM77_REG_TEMP_MAX);
152 152
153/* hysteresis is stored as a relative value on the chip, so it has to be 153/* hysteresis is stored as a relative value on the chip, so it has to be
154 converted first */ 154 converted first */
155static ssize_t set_temp_crit_hyst(struct device *dev, const char *buf, size_t count) 155static ssize_t set_temp_crit_hyst(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
156{ 156{
157 struct i2c_client *client = to_i2c_client(dev); 157 struct i2c_client *client = to_i2c_client(dev);
158 struct lm77_data *data = i2c_get_clientdata(client); 158 struct lm77_data *data = i2c_get_clientdata(client);
@@ -167,7 +167,7 @@ static ssize_t set_temp_crit_hyst(struct device *dev, const char *buf, size_t co
167} 167}
168 168
169/* preserve hysteresis when setting T_crit */ 169/* preserve hysteresis when setting T_crit */
170static ssize_t set_temp_crit(struct device *dev, const char *buf, size_t count) 170static ssize_t set_temp_crit(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
171{ 171{
172 struct i2c_client *client = to_i2c_client(dev); 172 struct i2c_client *client = to_i2c_client(dev);
173 struct lm77_data *data = i2c_get_clientdata(client); 173 struct lm77_data *data = i2c_get_clientdata(client);
diff --git a/drivers/i2c/chips/lm78.c b/drivers/i2c/chips/lm78.c
index 6d52d14eb31c..21b195ff3871 100644
--- a/drivers/i2c/chips/lm78.c
+++ b/drivers/i2c/chips/lm78.c
@@ -224,28 +224,28 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
224 224
225#define show_in_offset(offset) \ 225#define show_in_offset(offset) \
226static ssize_t \ 226static ssize_t \
227 show_in##offset (struct device *dev, char *buf) \ 227 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
228{ \ 228{ \
229 return show_in(dev, buf, offset); \ 229 return show_in(dev, buf, offset); \
230} \ 230} \
231static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ 231static DEVICE_ATTR(in##offset##_input, S_IRUGO, \
232 show_in##offset, NULL); \ 232 show_in##offset, NULL); \
233static ssize_t \ 233static ssize_t \
234 show_in##offset##_min (struct device *dev, char *buf) \ 234 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
235{ \ 235{ \
236 return show_in_min(dev, buf, offset); \ 236 return show_in_min(dev, buf, offset); \
237} \ 237} \
238static ssize_t \ 238static ssize_t \
239 show_in##offset##_max (struct device *dev, char *buf) \ 239 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
240{ \ 240{ \
241 return show_in_max(dev, buf, offset); \ 241 return show_in_max(dev, buf, offset); \
242} \ 242} \
243static ssize_t set_in##offset##_min (struct device *dev, \ 243static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
244 const char *buf, size_t count) \ 244 const char *buf, size_t count) \
245{ \ 245{ \
246 return set_in_min(dev, buf, count, offset); \ 246 return set_in_min(dev, buf, count, offset); \
247} \ 247} \
248static ssize_t set_in##offset##_max (struct device *dev, \ 248static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
249 const char *buf, size_t count) \ 249 const char *buf, size_t count) \
250{ \ 250{ \
251 return set_in_max(dev, buf, count, offset); \ 251 return set_in_max(dev, buf, count, offset); \
@@ -264,19 +264,19 @@ show_in_offset(5);
264show_in_offset(6); 264show_in_offset(6);
265 265
266/* Temperature */ 266/* Temperature */
267static ssize_t show_temp(struct device *dev, char *buf) 267static ssize_t show_temp(struct device *dev, struct device_attribute *attr, char *buf)
268{ 268{
269 struct lm78_data *data = lm78_update_device(dev); 269 struct lm78_data *data = lm78_update_device(dev);
270 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp)); 270 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp));
271} 271}
272 272
273static ssize_t show_temp_over(struct device *dev, char *buf) 273static ssize_t show_temp_over(struct device *dev, struct device_attribute *attr, char *buf)
274{ 274{
275 struct lm78_data *data = lm78_update_device(dev); 275 struct lm78_data *data = lm78_update_device(dev);
276 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over)); 276 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over));
277} 277}
278 278
279static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count) 279static ssize_t set_temp_over(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
280{ 280{
281 struct i2c_client *client = to_i2c_client(dev); 281 struct i2c_client *client = to_i2c_client(dev);
282 struct lm78_data *data = i2c_get_clientdata(client); 282 struct lm78_data *data = i2c_get_clientdata(client);
@@ -289,13 +289,13 @@ static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count)
289 return count; 289 return count;
290} 290}
291 291
292static ssize_t show_temp_hyst(struct device *dev, char *buf) 292static ssize_t show_temp_hyst(struct device *dev, struct device_attribute *attr, char *buf)
293{ 293{
294 struct lm78_data *data = lm78_update_device(dev); 294 struct lm78_data *data = lm78_update_device(dev);
295 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst)); 295 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst));
296} 296}
297 297
298static ssize_t set_temp_hyst(struct device *dev, const char *buf, size_t count) 298static ssize_t set_temp_hyst(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
299{ 299{
300 struct i2c_client *client = to_i2c_client(dev); 300 struct i2c_client *client = to_i2c_client(dev);
301 struct lm78_data *data = i2c_get_clientdata(client); 301 struct lm78_data *data = i2c_get_clientdata(client);
@@ -398,19 +398,19 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
398} 398}
399 399
400#define show_fan_offset(offset) \ 400#define show_fan_offset(offset) \
401static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 401static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
402{ \ 402{ \
403 return show_fan(dev, buf, offset - 1); \ 403 return show_fan(dev, buf, offset - 1); \
404} \ 404} \
405static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 405static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
406{ \ 406{ \
407 return show_fan_min(dev, buf, offset - 1); \ 407 return show_fan_min(dev, buf, offset - 1); \
408} \ 408} \
409static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 409static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
410{ \ 410{ \
411 return show_fan_div(dev, buf, offset - 1); \ 411 return show_fan_div(dev, buf, offset - 1); \
412} \ 412} \
413static ssize_t set_fan_##offset##_min (struct device *dev, \ 413static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
414 const char *buf, size_t count) \ 414 const char *buf, size_t count) \
415{ \ 415{ \
416 return set_fan_min(dev, buf, count, offset - 1); \ 416 return set_fan_min(dev, buf, count, offset - 1); \
@@ -419,13 +419,13 @@ static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL);\
419static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ 419static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
420 show_fan_##offset##_min, set_fan_##offset##_min); 420 show_fan_##offset##_min, set_fan_##offset##_min);
421 421
422static ssize_t set_fan_1_div(struct device *dev, const char *buf, 422static ssize_t set_fan_1_div(struct device *dev, struct device_attribute *attr, const char *buf,
423 size_t count) 423 size_t count)
424{ 424{
425 return set_fan_div(dev, buf, count, 0) ; 425 return set_fan_div(dev, buf, count, 0) ;
426} 426}
427 427
428static ssize_t set_fan_2_div(struct device *dev, const char *buf, 428static ssize_t set_fan_2_div(struct device *dev, struct device_attribute *attr, const char *buf,
429 size_t count) 429 size_t count)
430{ 430{
431 return set_fan_div(dev, buf, count, 1) ; 431 return set_fan_div(dev, buf, count, 1) ;
@@ -443,7 +443,7 @@ static DEVICE_ATTR(fan2_div, S_IRUGO | S_IWUSR,
443static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL); 443static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL);
444 444
445/* VID */ 445/* VID */
446static ssize_t show_vid(struct device *dev, char *buf) 446static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
447{ 447{
448 struct lm78_data *data = lm78_update_device(dev); 448 struct lm78_data *data = lm78_update_device(dev);
449 return sprintf(buf, "%d\n", VID_FROM_REG(data->vid)); 449 return sprintf(buf, "%d\n", VID_FROM_REG(data->vid));
@@ -451,7 +451,7 @@ static ssize_t show_vid(struct device *dev, char *buf)
451static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); 451static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
452 452
453/* Alarms */ 453/* Alarms */
454static ssize_t show_alarms(struct device *dev, char *buf) 454static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
455{ 455{
456 struct lm78_data *data = lm78_update_device(dev); 456 struct lm78_data *data = lm78_update_device(dev);
457 return sprintf(buf, "%u\n", data->alarms); 457 return sprintf(buf, "%u\n", data->alarms);
diff --git a/drivers/i2c/chips/lm80.c b/drivers/i2c/chips/lm80.c
index a72f431971bb..404057b70e90 100644
--- a/drivers/i2c/chips/lm80.c
+++ b/drivers/i2c/chips/lm80.c
@@ -156,7 +156,7 @@ static struct i2c_driver lm80_driver = {
156 */ 156 */
157 157
158#define show_in(suffix, value) \ 158#define show_in(suffix, value) \
159static ssize_t show_in_##suffix(struct device *dev, char *buf) \ 159static ssize_t show_in_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
160{ \ 160{ \
161 struct lm80_data *data = lm80_update_device(dev); \ 161 struct lm80_data *data = lm80_update_device(dev); \
162 return sprintf(buf, "%d\n", IN_FROM_REG(data->value)); \ 162 return sprintf(buf, "%d\n", IN_FROM_REG(data->value)); \
@@ -184,7 +184,7 @@ show_in(input5, in[5]);
184show_in(input6, in[6]); 184show_in(input6, in[6]);
185 185
186#define set_in(suffix, value, reg) \ 186#define set_in(suffix, value, reg) \
187static ssize_t set_in_##suffix(struct device *dev, const char *buf, \ 187static ssize_t set_in_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
188 size_t count) \ 188 size_t count) \
189{ \ 189{ \
190 struct i2c_client *client = to_i2c_client(dev); \ 190 struct i2c_client *client = to_i2c_client(dev); \
@@ -213,7 +213,7 @@ set_in(max5, in_max[5], LM80_REG_IN_MAX(5));
213set_in(max6, in_max[6], LM80_REG_IN_MAX(6)); 213set_in(max6, in_max[6], LM80_REG_IN_MAX(6));
214 214
215#define show_fan(suffix, value, div) \ 215#define show_fan(suffix, value, div) \
216static ssize_t show_fan_##suffix(struct device *dev, char *buf) \ 216static ssize_t show_fan_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
217{ \ 217{ \
218 struct lm80_data *data = lm80_update_device(dev); \ 218 struct lm80_data *data = lm80_update_device(dev); \
219 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value, \ 219 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value, \
@@ -225,7 +225,7 @@ show_fan(input1, fan[0], fan_div[0]);
225show_fan(input2, fan[1], fan_div[1]); 225show_fan(input2, fan[1], fan_div[1]);
226 226
227#define show_fan_div(suffix, value) \ 227#define show_fan_div(suffix, value) \
228static ssize_t show_fan_div##suffix(struct device *dev, char *buf) \ 228static ssize_t show_fan_div##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
229{ \ 229{ \
230 struct lm80_data *data = lm80_update_device(dev); \ 230 struct lm80_data *data = lm80_update_device(dev); \
231 return sprintf(buf, "%d\n", DIV_FROM_REG(data->value)); \ 231 return sprintf(buf, "%d\n", DIV_FROM_REG(data->value)); \
@@ -234,7 +234,7 @@ show_fan_div(1, fan_div[0]);
234show_fan_div(2, fan_div[1]); 234show_fan_div(2, fan_div[1]);
235 235
236#define set_fan(suffix, value, reg, div) \ 236#define set_fan(suffix, value, reg, div) \
237static ssize_t set_fan_##suffix(struct device *dev, const char *buf, \ 237static ssize_t set_fan_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
238 size_t count) \ 238 size_t count) \
239{ \ 239{ \
240 struct i2c_client *client = to_i2c_client(dev); \ 240 struct i2c_client *client = to_i2c_client(dev); \
@@ -292,7 +292,7 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
292} 292}
293 293
294#define set_fan_div(number) \ 294#define set_fan_div(number) \
295static ssize_t set_fan_div##number(struct device *dev, const char *buf, \ 295static ssize_t set_fan_div##number(struct device *dev, struct device_attribute *attr, const char *buf, \
296 size_t count) \ 296 size_t count) \
297{ \ 297{ \
298 return set_fan_div(dev, buf, count, number - 1); \ 298 return set_fan_div(dev, buf, count, number - 1); \
@@ -300,14 +300,14 @@ static ssize_t set_fan_div##number(struct device *dev, const char *buf, \
300set_fan_div(1); 300set_fan_div(1);
301set_fan_div(2); 301set_fan_div(2);
302 302
303static ssize_t show_temp_input1(struct device *dev, char *buf) 303static ssize_t show_temp_input1(struct device *dev, struct device_attribute *attr, char *buf)
304{ 304{
305 struct lm80_data *data = lm80_update_device(dev); 305 struct lm80_data *data = lm80_update_device(dev);
306 return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp)); 306 return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp));
307} 307}
308 308
309#define show_temp(suffix, value) \ 309#define show_temp(suffix, value) \
310static ssize_t show_temp_##suffix(struct device *dev, char *buf) \ 310static ssize_t show_temp_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
311{ \ 311{ \
312 struct lm80_data *data = lm80_update_device(dev); \ 312 struct lm80_data *data = lm80_update_device(dev); \
313 return sprintf(buf, "%d\n", TEMP_LIMIT_FROM_REG(data->value)); \ 313 return sprintf(buf, "%d\n", TEMP_LIMIT_FROM_REG(data->value)); \
@@ -318,7 +318,7 @@ show_temp(os_max, temp_os_max);
318show_temp(os_hyst, temp_os_hyst); 318show_temp(os_hyst, temp_os_hyst);
319 319
320#define set_temp(suffix, value, reg) \ 320#define set_temp(suffix, value, reg) \
321static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \ 321static ssize_t set_temp_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
322 size_t count) \ 322 size_t count) \
323{ \ 323{ \
324 struct i2c_client *client = to_i2c_client(dev); \ 324 struct i2c_client *client = to_i2c_client(dev); \
@@ -336,7 +336,7 @@ set_temp(hot_hyst, temp_hot_hyst, LM80_REG_TEMP_HOT_HYST);
336set_temp(os_max, temp_os_max, LM80_REG_TEMP_OS_MAX); 336set_temp(os_max, temp_os_max, LM80_REG_TEMP_OS_MAX);
337set_temp(os_hyst, temp_os_hyst, LM80_REG_TEMP_OS_HYST); 337set_temp(os_hyst, temp_os_hyst, LM80_REG_TEMP_OS_HYST);
338 338
339static ssize_t show_alarms(struct device *dev, char *buf) 339static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
340{ 340{
341 struct lm80_data *data = lm80_update_device(dev); 341 struct lm80_data *data = lm80_update_device(dev);
342 return sprintf(buf, "%u\n", data->alarms); 342 return sprintf(buf, "%u\n", data->alarms);
diff --git a/drivers/i2c/chips/lm83.c b/drivers/i2c/chips/lm83.c
index 3dafe60766ad..4d6d7d21e14b 100644
--- a/drivers/i2c/chips/lm83.c
+++ b/drivers/i2c/chips/lm83.c
@@ -155,7 +155,7 @@ struct lm83_data {
155 */ 155 */
156 156
157#define show_temp(suffix, value) \ 157#define show_temp(suffix, value) \
158static ssize_t show_temp_##suffix(struct device *dev, char *buf) \ 158static ssize_t show_temp_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
159{ \ 159{ \
160 struct lm83_data *data = lm83_update_device(dev); \ 160 struct lm83_data *data = lm83_update_device(dev); \
161 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ 161 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \
@@ -171,7 +171,7 @@ show_temp(high4, temp_high[3]);
171show_temp(crit, temp_crit); 171show_temp(crit, temp_crit);
172 172
173#define set_temp(suffix, value, reg) \ 173#define set_temp(suffix, value, reg) \
174static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \ 174static ssize_t set_temp_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
175 size_t count) \ 175 size_t count) \
176{ \ 176{ \
177 struct i2c_client *client = to_i2c_client(dev); \ 177 struct i2c_client *client = to_i2c_client(dev); \
@@ -190,7 +190,7 @@ set_temp(high3, temp_high[2], LM83_REG_W_REMOTE2_HIGH);
190set_temp(high4, temp_high[3], LM83_REG_W_REMOTE3_HIGH); 190set_temp(high4, temp_high[3], LM83_REG_W_REMOTE3_HIGH);
191set_temp(crit, temp_crit, LM83_REG_W_TCRIT); 191set_temp(crit, temp_crit, LM83_REG_W_TCRIT);
192 192
193static ssize_t show_alarms(struct device *dev, char *buf) 193static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
194{ 194{
195 struct lm83_data *data = lm83_update_device(dev); 195 struct lm83_data *data = lm83_update_device(dev);
196 return sprintf(buf, "%d\n", data->alarms); 196 return sprintf(buf, "%d\n", data->alarms);
diff --git a/drivers/i2c/chips/lm85.c b/drivers/i2c/chips/lm85.c
index b1a0dc5f6b34..b1976775b4ba 100644
--- a/drivers/i2c/chips/lm85.c
+++ b/drivers/i2c/chips/lm85.c
@@ -426,15 +426,15 @@ static ssize_t set_fan_min(struct device *dev, const char *buf,
426} 426}
427 427
428#define show_fan_offset(offset) \ 428#define show_fan_offset(offset) \
429static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 429static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
430{ \ 430{ \
431 return show_fan(dev, buf, offset - 1); \ 431 return show_fan(dev, buf, offset - 1); \
432} \ 432} \
433static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 433static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
434{ \ 434{ \
435 return show_fan_min(dev, buf, offset - 1); \ 435 return show_fan_min(dev, buf, offset - 1); \
436} \ 436} \
437static ssize_t set_fan_##offset##_min (struct device *dev, \ 437static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
438 const char *buf, size_t count) \ 438 const char *buf, size_t count) \
439{ \ 439{ \
440 return set_fan_min(dev, buf, count, offset - 1); \ 440 return set_fan_min(dev, buf, count, offset - 1); \
@@ -451,7 +451,7 @@ show_fan_offset(4);
451 451
452/* vid, vrm, alarms */ 452/* vid, vrm, alarms */
453 453
454static ssize_t show_vid_reg(struct device *dev, char *buf) 454static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
455{ 455{
456 struct lm85_data *data = lm85_update_device(dev); 456 struct lm85_data *data = lm85_update_device(dev);
457 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); 457 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm));
@@ -459,13 +459,13 @@ static ssize_t show_vid_reg(struct device *dev, char *buf)
459 459
460static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL); 460static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL);
461 461
462static ssize_t show_vrm_reg(struct device *dev, char *buf) 462static ssize_t show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
463{ 463{
464 struct lm85_data *data = lm85_update_device(dev); 464 struct lm85_data *data = lm85_update_device(dev);
465 return sprintf(buf, "%ld\n", (long) data->vrm); 465 return sprintf(buf, "%ld\n", (long) data->vrm);
466} 466}
467 467
468static ssize_t store_vrm_reg(struct device *dev, const char *buf, size_t count) 468static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
469{ 469{
470 struct i2c_client *client = to_i2c_client(dev); 470 struct i2c_client *client = to_i2c_client(dev);
471 struct lm85_data *data = i2c_get_clientdata(client); 471 struct lm85_data *data = i2c_get_clientdata(client);
@@ -478,7 +478,7 @@ static ssize_t store_vrm_reg(struct device *dev, const char *buf, size_t count)
478 478
479static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); 479static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
480 480
481static ssize_t show_alarms_reg(struct device *dev, char *buf) 481static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
482{ 482{
483 struct lm85_data *data = lm85_update_device(dev); 483 struct lm85_data *data = lm85_update_device(dev);
484 return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms)); 484 return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms));
@@ -516,16 +516,16 @@ static ssize_t show_pwm_enable(struct device *dev, char *buf, int nr)
516} 516}
517 517
518#define show_pwm_reg(offset) \ 518#define show_pwm_reg(offset) \
519static ssize_t show_pwm_##offset (struct device *dev, char *buf) \ 519static ssize_t show_pwm_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
520{ \ 520{ \
521 return show_pwm(dev, buf, offset - 1); \ 521 return show_pwm(dev, buf, offset - 1); \
522} \ 522} \
523static ssize_t set_pwm_##offset (struct device *dev, \ 523static ssize_t set_pwm_##offset (struct device *dev, struct device_attribute *attr, \
524 const char *buf, size_t count) \ 524 const char *buf, size_t count) \
525{ \ 525{ \
526 return set_pwm(dev, buf, count, offset - 1); \ 526 return set_pwm(dev, buf, count, offset - 1); \
527} \ 527} \
528static ssize_t show_pwm_enable##offset (struct device *dev, char *buf) \ 528static ssize_t show_pwm_enable##offset (struct device *dev, struct device_attribute *attr, char *buf) \
529{ \ 529{ \
530 return show_pwm_enable(dev, buf, offset - 1); \ 530 return show_pwm_enable(dev, buf, offset - 1); \
531} \ 531} \
@@ -585,24 +585,24 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
585 return count; 585 return count;
586} 586}
587#define show_in_reg(offset) \ 587#define show_in_reg(offset) \
588static ssize_t show_in_##offset (struct device *dev, char *buf) \ 588static ssize_t show_in_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
589{ \ 589{ \
590 return show_in(dev, buf, offset); \ 590 return show_in(dev, buf, offset); \
591} \ 591} \
592static ssize_t show_in_##offset##_min (struct device *dev, char *buf) \ 592static ssize_t show_in_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
593{ \ 593{ \
594 return show_in_min(dev, buf, offset); \ 594 return show_in_min(dev, buf, offset); \
595} \ 595} \
596static ssize_t show_in_##offset##_max (struct device *dev, char *buf) \ 596static ssize_t show_in_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
597{ \ 597{ \
598 return show_in_max(dev, buf, offset); \ 598 return show_in_max(dev, buf, offset); \
599} \ 599} \
600static ssize_t set_in_##offset##_min (struct device *dev, \ 600static ssize_t set_in_##offset##_min (struct device *dev, struct device_attribute *attr, \
601 const char *buf, size_t count) \ 601 const char *buf, size_t count) \
602{ \ 602{ \
603 return set_in_min(dev, buf, count, offset); \ 603 return set_in_min(dev, buf, count, offset); \
604} \ 604} \
605static ssize_t set_in_##offset##_max (struct device *dev, \ 605static ssize_t set_in_##offset##_max (struct device *dev, struct device_attribute *attr, \
606 const char *buf, size_t count) \ 606 const char *buf, size_t count) \
607{ \ 607{ \
608 return set_in_max(dev, buf, count, offset); \ 608 return set_in_max(dev, buf, count, offset); \
@@ -666,24 +666,24 @@ static ssize_t set_temp_max(struct device *dev, const char *buf,
666 return count; 666 return count;
667} 667}
668#define show_temp_reg(offset) \ 668#define show_temp_reg(offset) \
669static ssize_t show_temp_##offset (struct device *dev, char *buf) \ 669static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
670{ \ 670{ \
671 return show_temp(dev, buf, offset - 1); \ 671 return show_temp(dev, buf, offset - 1); \
672} \ 672} \
673static ssize_t show_temp_##offset##_min (struct device *dev, char *buf) \ 673static ssize_t show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
674{ \ 674{ \
675 return show_temp_min(dev, buf, offset - 1); \ 675 return show_temp_min(dev, buf, offset - 1); \
676} \ 676} \
677static ssize_t show_temp_##offset##_max (struct device *dev, char *buf) \ 677static ssize_t show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
678{ \ 678{ \
679 return show_temp_max(dev, buf, offset - 1); \ 679 return show_temp_max(dev, buf, offset - 1); \
680} \ 680} \
681static ssize_t set_temp_##offset##_min (struct device *dev, \ 681static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \
682 const char *buf, size_t count) \ 682 const char *buf, size_t count) \
683{ \ 683{ \
684 return set_temp_min(dev, buf, count, offset - 1); \ 684 return set_temp_min(dev, buf, count, offset - 1); \
685} \ 685} \
686static ssize_t set_temp_##offset##_max (struct device *dev, \ 686static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \
687 const char *buf, size_t count) \ 687 const char *buf, size_t count) \
688{ \ 688{ \
689 return set_temp_max(dev, buf, count, offset - 1); \ 689 return set_temp_max(dev, buf, count, offset - 1); \
@@ -786,42 +786,42 @@ static ssize_t set_pwm_auto_pwm_freq(struct device *dev, const char *buf,
786 return count; 786 return count;
787} 787}
788#define pwm_auto(offset) \ 788#define pwm_auto(offset) \
789static ssize_t show_pwm##offset##_auto_channels (struct device *dev, \ 789static ssize_t show_pwm##offset##_auto_channels (struct device *dev, struct device_attribute *attr, \
790 char *buf) \ 790 char *buf) \
791{ \ 791{ \
792 return show_pwm_auto_channels(dev, buf, offset - 1); \ 792 return show_pwm_auto_channels(dev, buf, offset - 1); \
793} \ 793} \
794static ssize_t set_pwm##offset##_auto_channels (struct device *dev, \ 794static ssize_t set_pwm##offset##_auto_channels (struct device *dev, struct device_attribute *attr, \
795 const char *buf, size_t count) \ 795 const char *buf, size_t count) \
796{ \ 796{ \
797 return set_pwm_auto_channels(dev, buf, count, offset - 1); \ 797 return set_pwm_auto_channels(dev, buf, count, offset - 1); \
798} \ 798} \
799static ssize_t show_pwm##offset##_auto_pwm_min (struct device *dev, \ 799static ssize_t show_pwm##offset##_auto_pwm_min (struct device *dev, struct device_attribute *attr, \
800 char *buf) \ 800 char *buf) \
801{ \ 801{ \
802 return show_pwm_auto_pwm_min(dev, buf, offset - 1); \ 802 return show_pwm_auto_pwm_min(dev, buf, offset - 1); \
803} \ 803} \
804static ssize_t set_pwm##offset##_auto_pwm_min (struct device *dev, \ 804static ssize_t set_pwm##offset##_auto_pwm_min (struct device *dev, struct device_attribute *attr, \
805 const char *buf, size_t count) \ 805 const char *buf, size_t count) \
806{ \ 806{ \
807 return set_pwm_auto_pwm_min(dev, buf, count, offset - 1); \ 807 return set_pwm_auto_pwm_min(dev, buf, count, offset - 1); \
808} \ 808} \
809static ssize_t show_pwm##offset##_auto_pwm_minctl (struct device *dev, \ 809static ssize_t show_pwm##offset##_auto_pwm_minctl (struct device *dev, struct device_attribute *attr, \
810 char *buf) \ 810 char *buf) \
811{ \ 811{ \
812 return show_pwm_auto_pwm_minctl(dev, buf, offset - 1); \ 812 return show_pwm_auto_pwm_minctl(dev, buf, offset - 1); \
813} \ 813} \
814static ssize_t set_pwm##offset##_auto_pwm_minctl (struct device *dev, \ 814static ssize_t set_pwm##offset##_auto_pwm_minctl (struct device *dev, struct device_attribute *attr, \
815 const char *buf, size_t count) \ 815 const char *buf, size_t count) \
816{ \ 816{ \
817 return set_pwm_auto_pwm_minctl(dev, buf, count, offset - 1); \ 817 return set_pwm_auto_pwm_minctl(dev, buf, count, offset - 1); \
818} \ 818} \
819static ssize_t show_pwm##offset##_auto_pwm_freq (struct device *dev, \ 819static ssize_t show_pwm##offset##_auto_pwm_freq (struct device *dev, struct device_attribute *attr, \
820 char *buf) \ 820 char *buf) \
821{ \ 821{ \
822 return show_pwm_auto_pwm_freq(dev, buf, offset - 1); \ 822 return show_pwm_auto_pwm_freq(dev, buf, offset - 1); \
823} \ 823} \
824static ssize_t set_pwm##offset##_auto_pwm_freq(struct device *dev, \ 824static ssize_t set_pwm##offset##_auto_pwm_freq(struct device *dev, struct device_attribute *attr, \
825 const char *buf, size_t count) \ 825 const char *buf, size_t count) \
826{ \ 826{ \
827 return set_pwm_auto_pwm_freq(dev, buf, count, offset - 1); \ 827 return set_pwm_auto_pwm_freq(dev, buf, count, offset - 1); \
@@ -962,42 +962,42 @@ static ssize_t set_temp_auto_temp_crit(struct device *dev, const char *buf,
962 return count; 962 return count;
963} 963}
964#define temp_auto(offset) \ 964#define temp_auto(offset) \
965static ssize_t show_temp##offset##_auto_temp_off (struct device *dev, \ 965static ssize_t show_temp##offset##_auto_temp_off (struct device *dev, struct device_attribute *attr, \
966 char *buf) \ 966 char *buf) \
967{ \ 967{ \
968 return show_temp_auto_temp_off(dev, buf, offset - 1); \ 968 return show_temp_auto_temp_off(dev, buf, offset - 1); \
969} \ 969} \
970static ssize_t set_temp##offset##_auto_temp_off (struct device *dev, \ 970static ssize_t set_temp##offset##_auto_temp_off (struct device *dev, struct device_attribute *attr, \
971 const char *buf, size_t count) \ 971 const char *buf, size_t count) \
972{ \ 972{ \
973 return set_temp_auto_temp_off(dev, buf, count, offset - 1); \ 973 return set_temp_auto_temp_off(dev, buf, count, offset - 1); \
974} \ 974} \
975static ssize_t show_temp##offset##_auto_temp_min (struct device *dev, \ 975static ssize_t show_temp##offset##_auto_temp_min (struct device *dev, struct device_attribute *attr, \
976 char *buf) \ 976 char *buf) \
977{ \ 977{ \
978 return show_temp_auto_temp_min(dev, buf, offset - 1); \ 978 return show_temp_auto_temp_min(dev, buf, offset - 1); \
979} \ 979} \
980static ssize_t set_temp##offset##_auto_temp_min (struct device *dev, \ 980static ssize_t set_temp##offset##_auto_temp_min (struct device *dev, struct device_attribute *attr, \
981 const char *buf, size_t count) \ 981 const char *buf, size_t count) \
982{ \ 982{ \
983 return set_temp_auto_temp_min(dev, buf, count, offset - 1); \ 983 return set_temp_auto_temp_min(dev, buf, count, offset - 1); \
984} \ 984} \
985static ssize_t show_temp##offset##_auto_temp_max (struct device *dev, \ 985static ssize_t show_temp##offset##_auto_temp_max (struct device *dev, struct device_attribute *attr, \
986 char *buf) \ 986 char *buf) \
987{ \ 987{ \
988 return show_temp_auto_temp_max(dev, buf, offset - 1); \ 988 return show_temp_auto_temp_max(dev, buf, offset - 1); \
989} \ 989} \
990static ssize_t set_temp##offset##_auto_temp_max (struct device *dev, \ 990static ssize_t set_temp##offset##_auto_temp_max (struct device *dev, struct device_attribute *attr, \
991 const char *buf, size_t count) \ 991 const char *buf, size_t count) \
992{ \ 992{ \
993 return set_temp_auto_temp_max(dev, buf, count, offset - 1); \ 993 return set_temp_auto_temp_max(dev, buf, count, offset - 1); \
994} \ 994} \
995static ssize_t show_temp##offset##_auto_temp_crit (struct device *dev, \ 995static ssize_t show_temp##offset##_auto_temp_crit (struct device *dev, struct device_attribute *attr, \
996 char *buf) \ 996 char *buf) \
997{ \ 997{ \
998 return show_temp_auto_temp_crit(dev, buf, offset - 1); \ 998 return show_temp_auto_temp_crit(dev, buf, offset - 1); \
999} \ 999} \
1000static ssize_t set_temp##offset##_auto_temp_crit (struct device *dev, \ 1000static ssize_t set_temp##offset##_auto_temp_crit (struct device *dev, struct device_attribute *attr, \
1001 const char *buf, size_t count) \ 1001 const char *buf, size_t count) \
1002{ \ 1002{ \
1003 return set_temp_auto_temp_crit(dev, buf, count, offset - 1); \ 1003 return set_temp_auto_temp_crit(dev, buf, count, offset - 1); \
diff --git a/drivers/i2c/chips/lm87.c b/drivers/i2c/chips/lm87.c
index 98cabd665063..4372b61a0882 100644
--- a/drivers/i2c/chips/lm87.c
+++ b/drivers/i2c/chips/lm87.c
@@ -218,19 +218,19 @@ static inline int lm87_write_value(struct i2c_client *client, u8 reg, u8 value)
218} 218}
219 219
220#define show_in(offset) \ 220#define show_in(offset) \
221static ssize_t show_in##offset##_input(struct device *dev, char *buf) \ 221static ssize_t show_in##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
222{ \ 222{ \
223 struct lm87_data *data = lm87_update_device(dev); \ 223 struct lm87_data *data = lm87_update_device(dev); \
224 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ 224 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \
225 data->in_scale[offset])); \ 225 data->in_scale[offset])); \
226} \ 226} \
227static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ 227static ssize_t show_in##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
228{ \ 228{ \
229 struct lm87_data *data = lm87_update_device(dev); \ 229 struct lm87_data *data = lm87_update_device(dev); \
230 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ 230 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \
231 data->in_scale[offset])); \ 231 data->in_scale[offset])); \
232} \ 232} \
233static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ 233static ssize_t show_in##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
234{ \ 234{ \
235 struct lm87_data *data = lm87_update_device(dev); \ 235 struct lm87_data *data = lm87_update_device(dev); \
236 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ 236 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \
@@ -274,13 +274,13 @@ static void set_in_max(struct device *dev, const char *buf, int nr)
274} 274}
275 275
276#define set_in(offset) \ 276#define set_in(offset) \
277static ssize_t set_in##offset##_min(struct device *dev, \ 277static ssize_t set_in##offset##_min(struct device *dev, struct device_attribute *attr, \
278 const char *buf, size_t count) \ 278 const char *buf, size_t count) \
279{ \ 279{ \
280 set_in_min(dev, buf, offset); \ 280 set_in_min(dev, buf, offset); \
281 return count; \ 281 return count; \
282} \ 282} \
283static ssize_t set_in##offset##_max(struct device *dev, \ 283static ssize_t set_in##offset##_max(struct device *dev, struct device_attribute *attr, \
284 const char *buf, size_t count) \ 284 const char *buf, size_t count) \
285{ \ 285{ \
286 set_in_max(dev, buf, offset); \ 286 set_in_max(dev, buf, offset); \
@@ -300,17 +300,17 @@ set_in(6);
300set_in(7); 300set_in(7);
301 301
302#define show_temp(offset) \ 302#define show_temp(offset) \
303static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \ 303static ssize_t show_temp##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
304{ \ 304{ \
305 struct lm87_data *data = lm87_update_device(dev); \ 305 struct lm87_data *data = lm87_update_device(dev); \
306 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ 306 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \
307} \ 307} \
308static ssize_t show_temp##offset##_low(struct device *dev, char *buf) \ 308static ssize_t show_temp##offset##_low(struct device *dev, struct device_attribute *attr, char *buf) \
309{ \ 309{ \
310 struct lm87_data *data = lm87_update_device(dev); \ 310 struct lm87_data *data = lm87_update_device(dev); \
311 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[offset-1])); \ 311 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[offset-1])); \
312} \ 312} \
313static ssize_t show_temp##offset##_high(struct device *dev, char *buf) \ 313static ssize_t show_temp##offset##_high(struct device *dev, struct device_attribute *attr, char *buf) \
314{ \ 314{ \
315 struct lm87_data *data = lm87_update_device(dev); \ 315 struct lm87_data *data = lm87_update_device(dev); \
316 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[offset-1])); \ 316 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[offset-1])); \
@@ -346,13 +346,13 @@ static void set_temp_high(struct device *dev, const char *buf, int nr)
346} 346}
347 347
348#define set_temp(offset) \ 348#define set_temp(offset) \
349static ssize_t set_temp##offset##_low(struct device *dev, \ 349static ssize_t set_temp##offset##_low(struct device *dev, struct device_attribute *attr, \
350 const char *buf, size_t count) \ 350 const char *buf, size_t count) \
351{ \ 351{ \
352 set_temp_low(dev, buf, offset-1); \ 352 set_temp_low(dev, buf, offset-1); \
353 return count; \ 353 return count; \
354} \ 354} \
355static ssize_t set_temp##offset##_high(struct device *dev, \ 355static ssize_t set_temp##offset##_high(struct device *dev, struct device_attribute *attr, \
356 const char *buf, size_t count) \ 356 const char *buf, size_t count) \
357{ \ 357{ \
358 set_temp_high(dev, buf, offset-1); \ 358 set_temp_high(dev, buf, offset-1); \
@@ -366,13 +366,13 @@ set_temp(1);
366set_temp(2); 366set_temp(2);
367set_temp(3); 367set_temp(3);
368 368
369static ssize_t show_temp_crit_int(struct device *dev, char *buf) 369static ssize_t show_temp_crit_int(struct device *dev, struct device_attribute *attr, char *buf)
370{ 370{
371 struct lm87_data *data = lm87_update_device(dev); 371 struct lm87_data *data = lm87_update_device(dev);
372 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_int)); 372 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_int));
373} 373}
374 374
375static ssize_t show_temp_crit_ext(struct device *dev, char *buf) 375static ssize_t show_temp_crit_ext(struct device *dev, struct device_attribute *attr, char *buf)
376{ 376{
377 struct lm87_data *data = lm87_update_device(dev); 377 struct lm87_data *data = lm87_update_device(dev);
378 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_ext)); 378 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_ext));
@@ -383,19 +383,19 @@ static DEVICE_ATTR(temp2_crit, S_IRUGO, show_temp_crit_ext, NULL);
383static DEVICE_ATTR(temp3_crit, S_IRUGO, show_temp_crit_ext, NULL); 383static DEVICE_ATTR(temp3_crit, S_IRUGO, show_temp_crit_ext, NULL);
384 384
385#define show_fan(offset) \ 385#define show_fan(offset) \
386static ssize_t show_fan##offset##_input(struct device *dev, char *buf) \ 386static ssize_t show_fan##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
387{ \ 387{ \
388 struct lm87_data *data = lm87_update_device(dev); \ 388 struct lm87_data *data = lm87_update_device(dev); \
389 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[offset-1], \ 389 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[offset-1], \
390 FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \ 390 FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \
391} \ 391} \
392static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ 392static ssize_t show_fan##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
393{ \ 393{ \
394 struct lm87_data *data = lm87_update_device(dev); \ 394 struct lm87_data *data = lm87_update_device(dev); \
395 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan_min[offset-1], \ 395 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan_min[offset-1], \
396 FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \ 396 FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \
397} \ 397} \
398static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ 398static ssize_t show_fan##offset##_div(struct device *dev, struct device_attribute *attr, char *buf) \
399{ \ 399{ \
400 struct lm87_data *data = lm87_update_device(dev); \ 400 struct lm87_data *data = lm87_update_device(dev); \
401 return sprintf(buf, "%d\n", FAN_DIV_FROM_REG(data->fan_div[offset-1])); \ 401 return sprintf(buf, "%d\n", FAN_DIV_FROM_REG(data->fan_div[offset-1])); \
@@ -465,13 +465,13 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
465} 465}
466 466
467#define set_fan(offset) \ 467#define set_fan(offset) \
468static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ 468static ssize_t set_fan##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
469 size_t count) \ 469 size_t count) \
470{ \ 470{ \
471 set_fan_min(dev, buf, offset-1); \ 471 set_fan_min(dev, buf, offset-1); \
472 return count; \ 472 return count; \
473} \ 473} \
474static ssize_t set_fan##offset##_div(struct device *dev, const char *buf, \ 474static ssize_t set_fan##offset##_div(struct device *dev, struct device_attribute *attr, const char *buf, \
475 size_t count) \ 475 size_t count) \
476{ \ 476{ \
477 return set_fan_div(dev, buf, count, offset-1); \ 477 return set_fan_div(dev, buf, count, offset-1); \
@@ -483,26 +483,26 @@ static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
483set_fan(1); 483set_fan(1);
484set_fan(2); 484set_fan(2);
485 485
486static ssize_t show_alarms(struct device *dev, char *buf) 486static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
487{ 487{
488 struct lm87_data *data = lm87_update_device(dev); 488 struct lm87_data *data = lm87_update_device(dev);
489 return sprintf(buf, "%d\n", data->alarms); 489 return sprintf(buf, "%d\n", data->alarms);
490} 490}
491static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); 491static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
492 492
493static ssize_t show_vid(struct device *dev, char *buf) 493static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
494{ 494{
495 struct lm87_data *data = lm87_update_device(dev); 495 struct lm87_data *data = lm87_update_device(dev);
496 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm)); 496 return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm));
497} 497}
498static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); 498static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
499 499
500static ssize_t show_vrm(struct device *dev, char *buf) 500static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
501{ 501{
502 struct lm87_data *data = lm87_update_device(dev); 502 struct lm87_data *data = lm87_update_device(dev);
503 return sprintf(buf, "%d\n", data->vrm); 503 return sprintf(buf, "%d\n", data->vrm);
504} 504}
505static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) 505static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
506{ 506{
507 struct i2c_client *client = to_i2c_client(dev); 507 struct i2c_client *client = to_i2c_client(dev);
508 struct lm87_data *data = i2c_get_clientdata(client); 508 struct lm87_data *data = i2c_get_clientdata(client);
@@ -511,12 +511,12 @@ static ssize_t set_vrm(struct device *dev, const char *buf, size_t count)
511} 511}
512static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); 512static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm);
513 513
514static ssize_t show_aout(struct device *dev, char *buf) 514static ssize_t show_aout(struct device *dev, struct device_attribute *attr, char *buf)
515{ 515{
516 struct lm87_data *data = lm87_update_device(dev); 516 struct lm87_data *data = lm87_update_device(dev);
517 return sprintf(buf, "%d\n", AOUT_FROM_REG(data->aout)); 517 return sprintf(buf, "%d\n", AOUT_FROM_REG(data->aout));
518} 518}
519static ssize_t set_aout(struct device *dev, const char *buf, size_t count) 519static ssize_t set_aout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
520{ 520{
521 struct i2c_client *client = to_i2c_client(dev); 521 struct i2c_client *client = to_i2c_client(dev);
522 struct lm87_data *data = i2c_get_clientdata(client); 522 struct lm87_data *data = i2c_get_clientdata(client);
diff --git a/drivers/i2c/chips/lm90.c b/drivers/i2c/chips/lm90.c
index 2c00ff83babc..9b127a07f56b 100644
--- a/drivers/i2c/chips/lm90.c
+++ b/drivers/i2c/chips/lm90.c
@@ -218,7 +218,7 @@ struct lm90_data {
218 */ 218 */
219 219
220#define show_temp(value, converter) \ 220#define show_temp(value, converter) \
221static ssize_t show_##value(struct device *dev, char *buf) \ 221static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
222{ \ 222{ \
223 struct lm90_data *data = lm90_update_device(dev); \ 223 struct lm90_data *data = lm90_update_device(dev); \
224 return sprintf(buf, "%d\n", converter(data->value)); \ 224 return sprintf(buf, "%d\n", converter(data->value)); \
@@ -233,7 +233,7 @@ show_temp(temp_crit1, TEMP1_FROM_REG);
233show_temp(temp_crit2, TEMP1_FROM_REG); 233show_temp(temp_crit2, TEMP1_FROM_REG);
234 234
235#define set_temp1(value, reg) \ 235#define set_temp1(value, reg) \
236static ssize_t set_##value(struct device *dev, const char *buf, \ 236static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \
237 size_t count) \ 237 size_t count) \
238{ \ 238{ \
239 struct i2c_client *client = to_i2c_client(dev); \ 239 struct i2c_client *client = to_i2c_client(dev); \
@@ -250,7 +250,7 @@ static ssize_t set_##value(struct device *dev, const char *buf, \
250 return count; \ 250 return count; \
251} 251}
252#define set_temp2(value, regh, regl) \ 252#define set_temp2(value, regh, regl) \
253static ssize_t set_##value(struct device *dev, const char *buf, \ 253static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \
254 size_t count) \ 254 size_t count) \
255{ \ 255{ \
256 struct i2c_client *client = to_i2c_client(dev); \ 256 struct i2c_client *client = to_i2c_client(dev); \
@@ -275,7 +275,7 @@ set_temp1(temp_crit1, LM90_REG_W_LOCAL_CRIT);
275set_temp1(temp_crit2, LM90_REG_W_REMOTE_CRIT); 275set_temp1(temp_crit2, LM90_REG_W_REMOTE_CRIT);
276 276
277#define show_temp_hyst(value, basereg) \ 277#define show_temp_hyst(value, basereg) \
278static ssize_t show_##value(struct device *dev, char *buf) \ 278static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
279{ \ 279{ \
280 struct lm90_data *data = lm90_update_device(dev); \ 280 struct lm90_data *data = lm90_update_device(dev); \
281 return sprintf(buf, "%d\n", TEMP1_FROM_REG(data->basereg) \ 281 return sprintf(buf, "%d\n", TEMP1_FROM_REG(data->basereg) \
@@ -284,7 +284,7 @@ static ssize_t show_##value(struct device *dev, char *buf) \
284show_temp_hyst(temp_hyst1, temp_crit1); 284show_temp_hyst(temp_hyst1, temp_crit1);
285show_temp_hyst(temp_hyst2, temp_crit2); 285show_temp_hyst(temp_hyst2, temp_crit2);
286 286
287static ssize_t set_temp_hyst1(struct device *dev, const char *buf, 287static ssize_t set_temp_hyst1(struct device *dev, struct device_attribute *attr, const char *buf,
288 size_t count) 288 size_t count)
289{ 289{
290 struct i2c_client *client = to_i2c_client(dev); 290 struct i2c_client *client = to_i2c_client(dev);
@@ -300,7 +300,7 @@ static ssize_t set_temp_hyst1(struct device *dev, const char *buf,
300 return count; 300 return count;
301} 301}
302 302
303static ssize_t show_alarms(struct device *dev, char *buf) 303static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
304{ 304{
305 struct lm90_data *data = lm90_update_device(dev); 305 struct lm90_data *data = lm90_update_device(dev);
306 return sprintf(buf, "%d\n", data->alarms); 306 return sprintf(buf, "%d\n", data->alarms);
diff --git a/drivers/i2c/chips/lm92.c b/drivers/i2c/chips/lm92.c
index fe6e83d70a72..215c8e40ffdd 100644
--- a/drivers/i2c/chips/lm92.c
+++ b/drivers/i2c/chips/lm92.c
@@ -140,7 +140,7 @@ static struct lm92_data *lm92_update_device(struct device *dev)
140} 140}
141 141
142#define show_temp(value) \ 142#define show_temp(value) \
143static ssize_t show_##value(struct device *dev, char *buf) \ 143static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
144{ \ 144{ \
145 struct lm92_data *data = lm92_update_device(dev); \ 145 struct lm92_data *data = lm92_update_device(dev); \
146 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ 146 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \
@@ -151,7 +151,7 @@ show_temp(temp1_min);
151show_temp(temp1_max); 151show_temp(temp1_max);
152 152
153#define set_temp(value, reg) \ 153#define set_temp(value, reg) \
154static ssize_t set_##value(struct device *dev, const char *buf, \ 154static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \
155 size_t count) \ 155 size_t count) \
156{ \ 156{ \
157 struct i2c_client *client = to_i2c_client(dev); \ 157 struct i2c_client *client = to_i2c_client(dev); \
@@ -168,26 +168,26 @@ set_temp(temp1_crit, LM92_REG_TEMP_CRIT);
168set_temp(temp1_min, LM92_REG_TEMP_LOW); 168set_temp(temp1_min, LM92_REG_TEMP_LOW);
169set_temp(temp1_max, LM92_REG_TEMP_HIGH); 169set_temp(temp1_max, LM92_REG_TEMP_HIGH);
170 170
171static ssize_t show_temp1_crit_hyst(struct device *dev, char *buf) 171static ssize_t show_temp1_crit_hyst(struct device *dev, struct device_attribute *attr, char *buf)
172{ 172{
173 struct lm92_data *data = lm92_update_device(dev); 173 struct lm92_data *data = lm92_update_device(dev);
174 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp1_crit) 174 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp1_crit)
175 - TEMP_FROM_REG(data->temp1_hyst)); 175 - TEMP_FROM_REG(data->temp1_hyst));
176} 176}
177static ssize_t show_temp1_max_hyst(struct device *dev, char *buf) 177static ssize_t show_temp1_max_hyst(struct device *dev, struct device_attribute *attr, char *buf)
178{ 178{
179 struct lm92_data *data = lm92_update_device(dev); 179 struct lm92_data *data = lm92_update_device(dev);
180 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp1_max) 180 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp1_max)
181 - TEMP_FROM_REG(data->temp1_hyst)); 181 - TEMP_FROM_REG(data->temp1_hyst));
182} 182}
183static ssize_t show_temp1_min_hyst(struct device *dev, char *buf) 183static ssize_t show_temp1_min_hyst(struct device *dev, struct device_attribute *attr, char *buf)
184{ 184{
185 struct lm92_data *data = lm92_update_device(dev); 185 struct lm92_data *data = lm92_update_device(dev);
186 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp1_min) 186 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp1_min)
187 + TEMP_FROM_REG(data->temp1_hyst)); 187 + TEMP_FROM_REG(data->temp1_hyst));
188} 188}
189 189
190static ssize_t set_temp1_crit_hyst(struct device *dev, const char *buf, 190static ssize_t set_temp1_crit_hyst(struct device *dev, struct device_attribute *attr, const char *buf,
191 size_t count) 191 size_t count)
192{ 192{
193 struct i2c_client *client = to_i2c_client(dev); 193 struct i2c_client *client = to_i2c_client(dev);
@@ -202,7 +202,7 @@ static ssize_t set_temp1_crit_hyst(struct device *dev, const char *buf,
202 return count; 202 return count;
203} 203}
204 204
205static ssize_t show_alarms(struct device *dev, char *buf) 205static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
206{ 206{
207 struct lm92_data *data = lm92_update_device(dev); 207 struct lm92_data *data = lm92_update_device(dev);
208 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->temp1_input)); 208 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->temp1_input));
diff --git a/drivers/i2c/chips/max1619.c b/drivers/i2c/chips/max1619.c
index 5afa961a5e10..30a196155fd9 100644
--- a/drivers/i2c/chips/max1619.c
+++ b/drivers/i2c/chips/max1619.c
@@ -122,7 +122,7 @@ struct max1619_data {
122 */ 122 */
123 123
124#define show_temp(value) \ 124#define show_temp(value) \
125static ssize_t show_##value(struct device *dev, char *buf) \ 125static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
126{ \ 126{ \
127 struct max1619_data *data = max1619_update_device(dev); \ 127 struct max1619_data *data = max1619_update_device(dev); \
128 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ 128 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \
@@ -135,7 +135,7 @@ show_temp(temp_crit2);
135show_temp(temp_hyst2); 135show_temp(temp_hyst2);
136 136
137#define set_temp2(value, reg) \ 137#define set_temp2(value, reg) \
138static ssize_t set_##value(struct device *dev, const char *buf, \ 138static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \
139 size_t count) \ 139 size_t count) \
140{ \ 140{ \
141 struct i2c_client *client = to_i2c_client(dev); \ 141 struct i2c_client *client = to_i2c_client(dev); \
@@ -154,7 +154,7 @@ set_temp2(temp_high2, MAX1619_REG_W_REMOTE_HIGH);
154set_temp2(temp_crit2, MAX1619_REG_W_REMOTE_CRIT); 154set_temp2(temp_crit2, MAX1619_REG_W_REMOTE_CRIT);
155set_temp2(temp_hyst2, MAX1619_REG_W_TCRIT_HYST); 155set_temp2(temp_hyst2, MAX1619_REG_W_TCRIT_HYST);
156 156
157static ssize_t show_alarms(struct device *dev, char *buf) 157static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
158{ 158{
159 struct max1619_data *data = max1619_update_device(dev); 159 struct max1619_data *data = max1619_update_device(dev);
160 return sprintf(buf, "%d\n", data->alarms); 160 return sprintf(buf, "%d\n", data->alarms);
diff --git a/drivers/i2c/chips/pc87360.c b/drivers/i2c/chips/pc87360.c
index 6d94c36c9218..65637b2cd170 100644
--- a/drivers/i2c/chips/pc87360.c
+++ b/drivers/i2c/chips/pc87360.c
@@ -282,31 +282,31 @@ static ssize_t set_fan_min(struct device *dev, const char *buf,
282} 282}
283 283
284#define show_and_set_fan(offset) \ 284#define show_and_set_fan(offset) \
285static ssize_t show_fan##offset##_input(struct device *dev, char *buf) \ 285static ssize_t show_fan##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
286{ \ 286{ \
287 struct pc87360_data *data = pc87360_update_device(dev); \ 287 struct pc87360_data *data = pc87360_update_device(dev); \
288 return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan[offset-1], \ 288 return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan[offset-1], \
289 FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \ 289 FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \
290} \ 290} \
291static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ 291static ssize_t show_fan##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
292{ \ 292{ \
293 struct pc87360_data *data = pc87360_update_device(dev); \ 293 struct pc87360_data *data = pc87360_update_device(dev); \
294 return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan_min[offset-1], \ 294 return sprintf(buf, "%u\n", FAN_FROM_REG(data->fan_min[offset-1], \
295 FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \ 295 FAN_DIV_FROM_REG(data->fan_status[offset-1]))); \
296} \ 296} \
297static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ 297static ssize_t show_fan##offset##_div(struct device *dev, struct device_attribute *attr, char *buf) \
298{ \ 298{ \
299 struct pc87360_data *data = pc87360_update_device(dev); \ 299 struct pc87360_data *data = pc87360_update_device(dev); \
300 return sprintf(buf, "%u\n", \ 300 return sprintf(buf, "%u\n", \
301 FAN_DIV_FROM_REG(data->fan_status[offset-1])); \ 301 FAN_DIV_FROM_REG(data->fan_status[offset-1])); \
302} \ 302} \
303static ssize_t show_fan##offset##_status(struct device *dev, char *buf) \ 303static ssize_t show_fan##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \
304{ \ 304{ \
305 struct pc87360_data *data = pc87360_update_device(dev); \ 305 struct pc87360_data *data = pc87360_update_device(dev); \
306 return sprintf(buf, "%u\n", \ 306 return sprintf(buf, "%u\n", \
307 FAN_STATUS_FROM_REG(data->fan_status[offset-1])); \ 307 FAN_STATUS_FROM_REG(data->fan_status[offset-1])); \
308} \ 308} \
309static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ 309static ssize_t set_fan##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
310 size_t count) \ 310 size_t count) \
311{ \ 311{ \
312 return set_fan_min(dev, buf, count, offset-1); \ 312 return set_fan_min(dev, buf, count, offset-1); \
@@ -324,7 +324,7 @@ show_and_set_fan(2)
324show_and_set_fan(3) 324show_and_set_fan(3)
325 325
326#define show_and_set_pwm(offset) \ 326#define show_and_set_pwm(offset) \
327static ssize_t show_pwm##offset(struct device *dev, char *buf) \ 327static ssize_t show_pwm##offset(struct device *dev, struct device_attribute *attr, char *buf) \
328{ \ 328{ \
329 struct pc87360_data *data = pc87360_update_device(dev); \ 329 struct pc87360_data *data = pc87360_update_device(dev); \
330 return sprintf(buf, "%u\n", \ 330 return sprintf(buf, "%u\n", \
@@ -332,7 +332,7 @@ static ssize_t show_pwm##offset(struct device *dev, char *buf) \
332 FAN_CONFIG_INVERT(data->fan_conf, \ 332 FAN_CONFIG_INVERT(data->fan_conf, \
333 offset-1))); \ 333 offset-1))); \
334} \ 334} \
335static ssize_t set_pwm##offset(struct device *dev, const char *buf, \ 335static ssize_t set_pwm##offset(struct device *dev, struct device_attribute *attr, const char *buf, \
336 size_t count) \ 336 size_t count) \
337{ \ 337{ \
338 struct i2c_client *client = to_i2c_client(dev); \ 338 struct i2c_client *client = to_i2c_client(dev); \
@@ -354,30 +354,30 @@ show_and_set_pwm(2)
354show_and_set_pwm(3) 354show_and_set_pwm(3)
355 355
356#define show_and_set_in(offset) \ 356#define show_and_set_in(offset) \
357static ssize_t show_in##offset##_input(struct device *dev, char *buf) \ 357static ssize_t show_in##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
358{ \ 358{ \
359 struct pc87360_data *data = pc87360_update_device(dev); \ 359 struct pc87360_data *data = pc87360_update_device(dev); \
360 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ 360 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \
361 data->in_vref)); \ 361 data->in_vref)); \
362} \ 362} \
363static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ 363static ssize_t show_in##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
364{ \ 364{ \
365 struct pc87360_data *data = pc87360_update_device(dev); \ 365 struct pc87360_data *data = pc87360_update_device(dev); \
366 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ 366 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \
367 data->in_vref)); \ 367 data->in_vref)); \
368} \ 368} \
369static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ 369static ssize_t show_in##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
370{ \ 370{ \
371 struct pc87360_data *data = pc87360_update_device(dev); \ 371 struct pc87360_data *data = pc87360_update_device(dev); \
372 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ 372 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \
373 data->in_vref)); \ 373 data->in_vref)); \
374} \ 374} \
375static ssize_t show_in##offset##_status(struct device *dev, char *buf) \ 375static ssize_t show_in##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \
376{ \ 376{ \
377 struct pc87360_data *data = pc87360_update_device(dev); \ 377 struct pc87360_data *data = pc87360_update_device(dev); \
378 return sprintf(buf, "%u\n", data->in_status[offset]); \ 378 return sprintf(buf, "%u\n", data->in_status[offset]); \
379} \ 379} \
380static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \ 380static ssize_t set_in##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
381 size_t count) \ 381 size_t count) \
382{ \ 382{ \
383 struct i2c_client *client = to_i2c_client(dev); \ 383 struct i2c_client *client = to_i2c_client(dev); \
@@ -391,7 +391,7 @@ static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \
391 up(&data->update_lock); \ 391 up(&data->update_lock); \
392 return count; \ 392 return count; \
393} \ 393} \
394static ssize_t set_in##offset##_max(struct device *dev, const char *buf, \ 394static ssize_t set_in##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
395 size_t count) \ 395 size_t count) \
396{ \ 396{ \
397 struct i2c_client *client = to_i2c_client(dev); \ 397 struct i2c_client *client = to_i2c_client(dev); \
@@ -427,36 +427,36 @@ show_and_set_in(9)
427show_and_set_in(10) 427show_and_set_in(10)
428 428
429#define show_and_set_therm(offset) \ 429#define show_and_set_therm(offset) \
430static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \ 430static ssize_t show_temp##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
431{ \ 431{ \
432 struct pc87360_data *data = pc87360_update_device(dev); \ 432 struct pc87360_data *data = pc87360_update_device(dev); \
433 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset+7], \ 433 return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset+7], \
434 data->in_vref)); \ 434 data->in_vref)); \
435} \ 435} \
436static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \ 436static ssize_t show_temp##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
437{ \ 437{ \
438 struct pc87360_data *data = pc87360_update_device(dev); \ 438 struct pc87360_data *data = pc87360_update_device(dev); \
439 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset+7], \ 439 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset+7], \
440 data->in_vref)); \ 440 data->in_vref)); \
441} \ 441} \
442static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \ 442static ssize_t show_temp##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
443{ \ 443{ \
444 struct pc87360_data *data = pc87360_update_device(dev); \ 444 struct pc87360_data *data = pc87360_update_device(dev); \
445 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset+7], \ 445 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset+7], \
446 data->in_vref)); \ 446 data->in_vref)); \
447} \ 447} \
448static ssize_t show_temp##offset##_crit(struct device *dev, char *buf) \ 448static ssize_t show_temp##offset##_crit(struct device *dev, struct device_attribute *attr, char *buf) \
449{ \ 449{ \
450 struct pc87360_data *data = pc87360_update_device(dev); \ 450 struct pc87360_data *data = pc87360_update_device(dev); \
451 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_crit[offset-4], \ 451 return sprintf(buf, "%u\n", IN_FROM_REG(data->in_crit[offset-4], \
452 data->in_vref)); \ 452 data->in_vref)); \
453} \ 453} \
454static ssize_t show_temp##offset##_status(struct device *dev, char *buf) \ 454static ssize_t show_temp##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \
455{ \ 455{ \
456 struct pc87360_data *data = pc87360_update_device(dev); \ 456 struct pc87360_data *data = pc87360_update_device(dev); \
457 return sprintf(buf, "%u\n", data->in_status[offset+7]); \ 457 return sprintf(buf, "%u\n", data->in_status[offset+7]); \
458} \ 458} \
459static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ 459static ssize_t set_temp##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
460 size_t count) \ 460 size_t count) \
461{ \ 461{ \
462 struct i2c_client *client = to_i2c_client(dev); \ 462 struct i2c_client *client = to_i2c_client(dev); \
@@ -470,7 +470,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
470 up(&data->update_lock); \ 470 up(&data->update_lock); \
471 return count; \ 471 return count; \
472} \ 472} \
473static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ 473static ssize_t set_temp##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
474 size_t count) \ 474 size_t count) \
475{ \ 475{ \
476 struct i2c_client *client = to_i2c_client(dev); \ 476 struct i2c_client *client = to_i2c_client(dev); \
@@ -484,7 +484,7 @@ static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \
484 up(&data->update_lock); \ 484 up(&data->update_lock); \
485 return count; \ 485 return count; \
486} \ 486} \
487static ssize_t set_temp##offset##_crit(struct device *dev, const char *buf, \ 487static ssize_t set_temp##offset##_crit(struct device *dev, struct device_attribute *attr, const char *buf, \
488 size_t count) \ 488 size_t count) \
489{ \ 489{ \
490 struct i2c_client *client = to_i2c_client(dev); \ 490 struct i2c_client *client = to_i2c_client(dev); \
@@ -512,19 +512,19 @@ show_and_set_therm(4)
512show_and_set_therm(5) 512show_and_set_therm(5)
513show_and_set_therm(6) 513show_and_set_therm(6)
514 514
515static ssize_t show_vid(struct device *dev, char *buf) 515static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
516{ 516{
517 struct pc87360_data *data = pc87360_update_device(dev); 517 struct pc87360_data *data = pc87360_update_device(dev);
518 return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm)); 518 return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm));
519} 519}
520static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); 520static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
521 521
522static ssize_t show_vrm(struct device *dev, char *buf) 522static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
523{ 523{
524 struct pc87360_data *data = pc87360_update_device(dev); 524 struct pc87360_data *data = pc87360_update_device(dev);
525 return sprintf(buf, "%u\n", data->vrm); 525 return sprintf(buf, "%u\n", data->vrm);
526} 526}
527static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) 527static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
528{ 528{
529 struct i2c_client *client = to_i2c_client(dev); 529 struct i2c_client *client = to_i2c_client(dev);
530 struct pc87360_data *data = i2c_get_clientdata(client); 530 struct pc87360_data *data = i2c_get_clientdata(client);
@@ -533,7 +533,7 @@ static ssize_t set_vrm(struct device *dev, const char *buf, size_t count)
533} 533}
534static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); 534static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm);
535 535
536static ssize_t show_in_alarms(struct device *dev, char *buf) 536static ssize_t show_in_alarms(struct device *dev, struct device_attribute *attr, char *buf)
537{ 537{
538 struct pc87360_data *data = pc87360_update_device(dev); 538 struct pc87360_data *data = pc87360_update_device(dev);
539 return sprintf(buf, "%u\n", data->in_alarms); 539 return sprintf(buf, "%u\n", data->in_alarms);
@@ -541,32 +541,32 @@ static ssize_t show_in_alarms(struct device *dev, char *buf)
541static DEVICE_ATTR(alarms_in, S_IRUGO, show_in_alarms, NULL); 541static DEVICE_ATTR(alarms_in, S_IRUGO, show_in_alarms, NULL);
542 542
543#define show_and_set_temp(offset) \ 543#define show_and_set_temp(offset) \
544static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \ 544static ssize_t show_temp##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \
545{ \ 545{ \
546 struct pc87360_data *data = pc87360_update_device(dev); \ 546 struct pc87360_data *data = pc87360_update_device(dev); \
547 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ 547 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \
548} \ 548} \
549static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \ 549static ssize_t show_temp##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \
550{ \ 550{ \
551 struct pc87360_data *data = pc87360_update_device(dev); \ 551 struct pc87360_data *data = pc87360_update_device(dev); \
552 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \ 552 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \
553} \ 553} \
554static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \ 554static ssize_t show_temp##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \
555{ \ 555{ \
556 struct pc87360_data *data = pc87360_update_device(dev); \ 556 struct pc87360_data *data = pc87360_update_device(dev); \
557 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \ 557 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \
558}\ 558}\
559static ssize_t show_temp##offset##_crit(struct device *dev, char *buf) \ 559static ssize_t show_temp##offset##_crit(struct device *dev, struct device_attribute *attr, char *buf) \
560{ \ 560{ \
561 struct pc87360_data *data = pc87360_update_device(dev); \ 561 struct pc87360_data *data = pc87360_update_device(dev); \
562 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit[offset-1])); \ 562 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit[offset-1])); \
563}\ 563}\
564static ssize_t show_temp##offset##_status(struct device *dev, char *buf) \ 564static ssize_t show_temp##offset##_status(struct device *dev, struct device_attribute *attr, char *buf) \
565{ \ 565{ \
566 struct pc87360_data *data = pc87360_update_device(dev); \ 566 struct pc87360_data *data = pc87360_update_device(dev); \
567 return sprintf(buf, "%d\n", data->temp_status[offset-1]); \ 567 return sprintf(buf, "%d\n", data->temp_status[offset-1]); \
568}\ 568}\
569static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ 569static ssize_t set_temp##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \
570 size_t count) \ 570 size_t count) \
571{ \ 571{ \
572 struct i2c_client *client = to_i2c_client(dev); \ 572 struct i2c_client *client = to_i2c_client(dev); \
@@ -580,7 +580,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
580 up(&data->update_lock); \ 580 up(&data->update_lock); \
581 return count; \ 581 return count; \
582} \ 582} \
583static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ 583static ssize_t set_temp##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \
584 size_t count) \ 584 size_t count) \
585{ \ 585{ \
586 struct i2c_client *client = to_i2c_client(dev); \ 586 struct i2c_client *client = to_i2c_client(dev); \
@@ -594,7 +594,7 @@ static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \
594 up(&data->update_lock); \ 594 up(&data->update_lock); \
595 return count; \ 595 return count; \
596} \ 596} \
597static ssize_t set_temp##offset##_crit(struct device *dev, const char *buf, \ 597static ssize_t set_temp##offset##_crit(struct device *dev, struct device_attribute *attr, const char *buf, \
598 size_t count) \ 598 size_t count) \
599{ \ 599{ \
600 struct i2c_client *client = to_i2c_client(dev); \ 600 struct i2c_client *client = to_i2c_client(dev); \
@@ -622,7 +622,7 @@ show_and_set_temp(1)
622show_and_set_temp(2) 622show_and_set_temp(2)
623show_and_set_temp(3) 623show_and_set_temp(3)
624 624
625static ssize_t show_temp_alarms(struct device *dev, char *buf) 625static ssize_t show_temp_alarms(struct device *dev, struct device_attribute *attr, char *buf)
626{ 626{
627 struct pc87360_data *data = pc87360_update_device(dev); 627 struct pc87360_data *data = pc87360_update_device(dev);
628 return sprintf(buf, "%u\n", data->temp_alarms); 628 return sprintf(buf, "%u\n", data->temp_alarms);
diff --git a/drivers/i2c/chips/pcf8574.c b/drivers/i2c/chips/pcf8574.c
index 48b4e22eaffe..4956e9effd75 100644
--- a/drivers/i2c/chips/pcf8574.c
+++ b/drivers/i2c/chips/pcf8574.c
@@ -76,7 +76,7 @@ static struct i2c_driver pcf8574_driver = {
76}; 76};
77 77
78/* following are the sysfs callback functions */ 78/* following are the sysfs callback functions */
79static ssize_t show_read(struct device *dev, char *buf) 79static ssize_t show_read(struct device *dev, struct device_attribute *attr, char *buf)
80{ 80{
81 struct i2c_client *client = to_i2c_client(dev); 81 struct i2c_client *client = to_i2c_client(dev);
82 struct pcf8574_data *data = i2c_get_clientdata(client); 82 struct pcf8574_data *data = i2c_get_clientdata(client);
@@ -86,13 +86,13 @@ static ssize_t show_read(struct device *dev, char *buf)
86 86
87static DEVICE_ATTR(read, S_IRUGO, show_read, NULL); 87static DEVICE_ATTR(read, S_IRUGO, show_read, NULL);
88 88
89static ssize_t show_write(struct device *dev, char *buf) 89static ssize_t show_write(struct device *dev, struct device_attribute *attr, char *buf)
90{ 90{
91 struct pcf8574_data *data = i2c_get_clientdata(to_i2c_client(dev)); 91 struct pcf8574_data *data = i2c_get_clientdata(to_i2c_client(dev));
92 return sprintf(buf, "%u\n", data->write); 92 return sprintf(buf, "%u\n", data->write);
93} 93}
94 94
95static ssize_t set_write(struct device *dev, const char *buf, 95static ssize_t set_write(struct device *dev, struct device_attribute *attr, const char *buf,
96 size_t count) 96 size_t count)
97{ 97{
98 struct i2c_client *client = to_i2c_client(dev); 98 struct i2c_client *client = to_i2c_client(dev);
diff --git a/drivers/i2c/chips/pcf8591.c b/drivers/i2c/chips/pcf8591.c
index b6b927d8b372..db812ade8564 100644
--- a/drivers/i2c/chips/pcf8591.c
+++ b/drivers/i2c/chips/pcf8591.c
@@ -100,7 +100,7 @@ static struct i2c_driver pcf8591_driver = {
100 100
101/* following are the sysfs callback functions */ 101/* following are the sysfs callback functions */
102#define show_in_channel(channel) \ 102#define show_in_channel(channel) \
103static ssize_t show_in##channel##_input(struct device *dev, char *buf) \ 103static ssize_t show_in##channel##_input(struct device *dev, struct device_attribute *attr, char *buf) \
104{ \ 104{ \
105 return sprintf(buf, "%d\n", pcf8591_read_channel(dev, channel));\ 105 return sprintf(buf, "%d\n", pcf8591_read_channel(dev, channel));\
106} \ 106} \
@@ -112,13 +112,13 @@ show_in_channel(1);
112show_in_channel(2); 112show_in_channel(2);
113show_in_channel(3); 113show_in_channel(3);
114 114
115static ssize_t show_out0_ouput(struct device *dev, char *buf) 115static ssize_t show_out0_ouput(struct device *dev, struct device_attribute *attr, char *buf)
116{ 116{
117 struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev)); 117 struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev));
118 return sprintf(buf, "%d\n", data->aout * 10); 118 return sprintf(buf, "%d\n", data->aout * 10);
119} 119}
120 120
121static ssize_t set_out0_output(struct device *dev, const char *buf, size_t count) 121static ssize_t set_out0_output(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
122{ 122{
123 unsigned int value; 123 unsigned int value;
124 struct i2c_client *client = to_i2c_client(dev); 124 struct i2c_client *client = to_i2c_client(dev);
@@ -134,13 +134,13 @@ static ssize_t set_out0_output(struct device *dev, const char *buf, size_t count
134static DEVICE_ATTR(out0_output, S_IWUSR | S_IRUGO, 134static DEVICE_ATTR(out0_output, S_IWUSR | S_IRUGO,
135 show_out0_ouput, set_out0_output); 135 show_out0_ouput, set_out0_output);
136 136
137static ssize_t show_out0_enable(struct device *dev, char *buf) 137static ssize_t show_out0_enable(struct device *dev, struct device_attribute *attr, char *buf)
138{ 138{
139 struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev)); 139 struct pcf8591_data *data = i2c_get_clientdata(to_i2c_client(dev));
140 return sprintf(buf, "%u\n", !(!(data->control & PCF8591_CONTROL_AOEF))); 140 return sprintf(buf, "%u\n", !(!(data->control & PCF8591_CONTROL_AOEF)));
141} 141}
142 142
143static ssize_t set_out0_enable(struct device *dev, const char *buf, size_t count) 143static ssize_t set_out0_enable(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
144{ 144{
145 struct i2c_client *client = to_i2c_client(dev); 145 struct i2c_client *client = to_i2c_client(dev);
146 struct pcf8591_data *data = i2c_get_clientdata(client); 146 struct pcf8591_data *data = i2c_get_clientdata(client);
diff --git a/drivers/i2c/chips/sis5595.c b/drivers/i2c/chips/sis5595.c
index 7ea84532df32..c6650727a27d 100644
--- a/drivers/i2c/chips/sis5595.c
+++ b/drivers/i2c/chips/sis5595.c
@@ -256,28 +256,28 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
256 256
257#define show_in_offset(offset) \ 257#define show_in_offset(offset) \
258static ssize_t \ 258static ssize_t \
259 show_in##offset (struct device *dev, char *buf) \ 259 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
260{ \ 260{ \
261 return show_in(dev, buf, offset); \ 261 return show_in(dev, buf, offset); \
262} \ 262} \
263static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ 263static DEVICE_ATTR(in##offset##_input, S_IRUGO, \
264 show_in##offset, NULL); \ 264 show_in##offset, NULL); \
265static ssize_t \ 265static ssize_t \
266 show_in##offset##_min (struct device *dev, char *buf) \ 266 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
267{ \ 267{ \
268 return show_in_min(dev, buf, offset); \ 268 return show_in_min(dev, buf, offset); \
269} \ 269} \
270static ssize_t \ 270static ssize_t \
271 show_in##offset##_max (struct device *dev, char *buf) \ 271 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
272{ \ 272{ \
273 return show_in_max(dev, buf, offset); \ 273 return show_in_max(dev, buf, offset); \
274} \ 274} \
275static ssize_t set_in##offset##_min (struct device *dev, \ 275static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
276 const char *buf, size_t count) \ 276 const char *buf, size_t count) \
277{ \ 277{ \
278 return set_in_min(dev, buf, count, offset); \ 278 return set_in_min(dev, buf, count, offset); \
279} \ 279} \
280static ssize_t set_in##offset##_max (struct device *dev, \ 280static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
281 const char *buf, size_t count) \ 281 const char *buf, size_t count) \
282{ \ 282{ \
283 return set_in_max(dev, buf, count, offset); \ 283 return set_in_max(dev, buf, count, offset); \
@@ -294,19 +294,19 @@ show_in_offset(3);
294show_in_offset(4); 294show_in_offset(4);
295 295
296/* Temperature */ 296/* Temperature */
297static ssize_t show_temp(struct device *dev, char *buf) 297static ssize_t show_temp(struct device *dev, struct device_attribute *attr, char *buf)
298{ 298{
299 struct sis5595_data *data = sis5595_update_device(dev); 299 struct sis5595_data *data = sis5595_update_device(dev);
300 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp)); 300 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp));
301} 301}
302 302
303static ssize_t show_temp_over(struct device *dev, char *buf) 303static ssize_t show_temp_over(struct device *dev, struct device_attribute *attr, char *buf)
304{ 304{
305 struct sis5595_data *data = sis5595_update_device(dev); 305 struct sis5595_data *data = sis5595_update_device(dev);
306 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over)); 306 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over));
307} 307}
308 308
309static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count) 309static ssize_t set_temp_over(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
310{ 310{
311 struct i2c_client *client = to_i2c_client(dev); 311 struct i2c_client *client = to_i2c_client(dev);
312 struct sis5595_data *data = i2c_get_clientdata(client); 312 struct sis5595_data *data = i2c_get_clientdata(client);
@@ -319,13 +319,13 @@ static ssize_t set_temp_over(struct device *dev, const char *buf, size_t count)
319 return count; 319 return count;
320} 320}
321 321
322static ssize_t show_temp_hyst(struct device *dev, char *buf) 322static ssize_t show_temp_hyst(struct device *dev, struct device_attribute *attr, char *buf)
323{ 323{
324 struct sis5595_data *data = sis5595_update_device(dev); 324 struct sis5595_data *data = sis5595_update_device(dev);
325 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst)); 325 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst));
326} 326}
327 327
328static ssize_t set_temp_hyst(struct device *dev, const char *buf, size_t count) 328static ssize_t set_temp_hyst(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
329{ 329{
330 struct i2c_client *client = to_i2c_client(dev); 330 struct i2c_client *client = to_i2c_client(dev);
331 struct sis5595_data *data = i2c_get_clientdata(client); 331 struct sis5595_data *data = i2c_get_clientdata(client);
@@ -426,19 +426,19 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
426} 426}
427 427
428#define show_fan_offset(offset) \ 428#define show_fan_offset(offset) \
429static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 429static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
430{ \ 430{ \
431 return show_fan(dev, buf, offset - 1); \ 431 return show_fan(dev, buf, offset - 1); \
432} \ 432} \
433static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 433static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
434{ \ 434{ \
435 return show_fan_min(dev, buf, offset - 1); \ 435 return show_fan_min(dev, buf, offset - 1); \
436} \ 436} \
437static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 437static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
438{ \ 438{ \
439 return show_fan_div(dev, buf, offset - 1); \ 439 return show_fan_div(dev, buf, offset - 1); \
440} \ 440} \
441static ssize_t set_fan_##offset##_min (struct device *dev, \ 441static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
442 const char *buf, size_t count) \ 442 const char *buf, size_t count) \
443{ \ 443{ \
444 return set_fan_min(dev, buf, count, offset - 1); \ 444 return set_fan_min(dev, buf, count, offset - 1); \
@@ -450,13 +450,13 @@ static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
450show_fan_offset(1); 450show_fan_offset(1);
451show_fan_offset(2); 451show_fan_offset(2);
452 452
453static ssize_t set_fan_1_div(struct device *dev, const char *buf, 453static ssize_t set_fan_1_div(struct device *dev, struct device_attribute *attr, const char *buf,
454 size_t count) 454 size_t count)
455{ 455{
456 return set_fan_div(dev, buf, count, 0) ; 456 return set_fan_div(dev, buf, count, 0) ;
457} 457}
458 458
459static ssize_t set_fan_2_div(struct device *dev, const char *buf, 459static ssize_t set_fan_2_div(struct device *dev, struct device_attribute *attr, const char *buf,
460 size_t count) 460 size_t count)
461{ 461{
462 return set_fan_div(dev, buf, count, 1) ; 462 return set_fan_div(dev, buf, count, 1) ;
@@ -467,7 +467,7 @@ static DEVICE_ATTR(fan2_div, S_IRUGO | S_IWUSR,
467 show_fan_2_div, set_fan_2_div); 467 show_fan_2_div, set_fan_2_div);
468 468
469/* Alarms */ 469/* Alarms */
470static ssize_t show_alarms(struct device *dev, char *buf) 470static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
471{ 471{
472 struct sis5595_data *data = sis5595_update_device(dev); 472 struct sis5595_data *data = sis5595_update_device(dev);
473 return sprintf(buf, "%d\n", data->alarms); 473 return sprintf(buf, "%d\n", data->alarms);
diff --git a/drivers/i2c/chips/smsc47b397.c b/drivers/i2c/chips/smsc47b397.c
index 1119c76791d9..251ac2659554 100644
--- a/drivers/i2c/chips/smsc47b397.c
+++ b/drivers/i2c/chips/smsc47b397.c
@@ -172,7 +172,7 @@ static ssize_t show_temp(struct device *dev, char *buf, int nr)
172} 172}
173 173
174#define sysfs_temp(num) \ 174#define sysfs_temp(num) \
175static ssize_t show_temp##num(struct device *dev, char *buf) \ 175static ssize_t show_temp##num(struct device *dev, struct device_attribute *attr, char *buf) \
176{ \ 176{ \
177 return show_temp(dev, buf, num-1); \ 177 return show_temp(dev, buf, num-1); \
178} \ 178} \
@@ -201,7 +201,7 @@ static ssize_t show_fan(struct device *dev, char *buf, int nr)
201} 201}
202 202
203#define sysfs_fan(num) \ 203#define sysfs_fan(num) \
204static ssize_t show_fan##num(struct device *dev, char *buf) \ 204static ssize_t show_fan##num(struct device *dev, struct device_attribute *attr, char *buf) \
205{ \ 205{ \
206 return show_fan(dev, buf, num-1); \ 206 return show_fan(dev, buf, num-1); \
207} \ 207} \
diff --git a/drivers/i2c/chips/smsc47m1.c b/drivers/i2c/chips/smsc47m1.c
index 0e12ca369413..13d6d4a8bc7d 100644
--- a/drivers/i2c/chips/smsc47m1.c
+++ b/drivers/i2c/chips/smsc47m1.c
@@ -184,7 +184,7 @@ static ssize_t get_pwm_en(struct device *dev, char *buf, int nr)
184 return sprintf(buf, "%d\n", PWM_EN_FROM_REG(data->pwm[nr])); 184 return sprintf(buf, "%d\n", PWM_EN_FROM_REG(data->pwm[nr]));
185} 185}
186 186
187static ssize_t get_alarms(struct device *dev, char *buf) 187static ssize_t get_alarms(struct device *dev, struct device_attribute *attr, char *buf)
188{ 188{
189 struct smsc47m1_data *data = smsc47m1_update_device(dev, 0); 189 struct smsc47m1_data *data = smsc47m1_update_device(dev, 0);
190 return sprintf(buf, "%d\n", data->alarms); 190 return sprintf(buf, "%d\n", data->alarms);
@@ -298,42 +298,42 @@ static ssize_t set_pwm_en(struct device *dev, const char *buf,
298} 298}
299 299
300#define fan_present(offset) \ 300#define fan_present(offset) \
301static ssize_t get_fan##offset (struct device *dev, char *buf) \ 301static ssize_t get_fan##offset (struct device *dev, struct device_attribute *attr, char *buf) \
302{ \ 302{ \
303 return get_fan(dev, buf, offset - 1); \ 303 return get_fan(dev, buf, offset - 1); \
304} \ 304} \
305static ssize_t get_fan##offset##_min (struct device *dev, char *buf) \ 305static ssize_t get_fan##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
306{ \ 306{ \
307 return get_fan_min(dev, buf, offset - 1); \ 307 return get_fan_min(dev, buf, offset - 1); \
308} \ 308} \
309static ssize_t set_fan##offset##_min (struct device *dev, \ 309static ssize_t set_fan##offset##_min (struct device *dev, struct device_attribute *attr, \
310 const char *buf, size_t count) \ 310 const char *buf, size_t count) \
311{ \ 311{ \
312 return set_fan_min(dev, buf, count, offset - 1); \ 312 return set_fan_min(dev, buf, count, offset - 1); \
313} \ 313} \
314static ssize_t get_fan##offset##_div (struct device *dev, char *buf) \ 314static ssize_t get_fan##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
315{ \ 315{ \
316 return get_fan_div(dev, buf, offset - 1); \ 316 return get_fan_div(dev, buf, offset - 1); \
317} \ 317} \
318static ssize_t set_fan##offset##_div (struct device *dev, \ 318static ssize_t set_fan##offset##_div (struct device *dev, struct device_attribute *attr, \
319 const char *buf, size_t count) \ 319 const char *buf, size_t count) \
320{ \ 320{ \
321 return set_fan_div(dev, buf, count, offset - 1); \ 321 return set_fan_div(dev, buf, count, offset - 1); \
322} \ 322} \
323static ssize_t get_pwm##offset (struct device *dev, char *buf) \ 323static ssize_t get_pwm##offset (struct device *dev, struct device_attribute *attr, char *buf) \
324{ \ 324{ \
325 return get_pwm(dev, buf, offset - 1); \ 325 return get_pwm(dev, buf, offset - 1); \
326} \ 326} \
327static ssize_t set_pwm##offset (struct device *dev, \ 327static ssize_t set_pwm##offset (struct device *dev, struct device_attribute *attr, \
328 const char *buf, size_t count) \ 328 const char *buf, size_t count) \
329{ \ 329{ \
330 return set_pwm(dev, buf, count, offset - 1); \ 330 return set_pwm(dev, buf, count, offset - 1); \
331} \ 331} \
332static ssize_t get_pwm##offset##_en (struct device *dev, char *buf) \ 332static ssize_t get_pwm##offset##_en (struct device *dev, struct device_attribute *attr, char *buf) \
333{ \ 333{ \
334 return get_pwm_en(dev, buf, offset - 1); \ 334 return get_pwm_en(dev, buf, offset - 1); \
335} \ 335} \
336static ssize_t set_pwm##offset##_en (struct device *dev, \ 336static ssize_t set_pwm##offset##_en (struct device *dev, struct device_attribute *attr, \
337 const char *buf, size_t count) \ 337 const char *buf, size_t count) \
338{ \ 338{ \
339 return set_pwm_en(dev, buf, count, offset - 1); \ 339 return set_pwm_en(dev, buf, count, offset - 1); \
diff --git a/drivers/i2c/chips/via686a.c b/drivers/i2c/chips/via686a.c
index 6614a59cecd4..fefc24a9251a 100644
--- a/drivers/i2c/chips/via686a.c
+++ b/drivers/i2c/chips/via686a.c
@@ -386,26 +386,26 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
386} 386}
387#define show_in_offset(offset) \ 387#define show_in_offset(offset) \
388static ssize_t \ 388static ssize_t \
389 show_in##offset (struct device *dev, char *buf) \ 389 show_in##offset (struct device *dev, struct device_attribute *attr, char *buf) \
390{ \ 390{ \
391 return show_in(dev, buf, offset); \ 391 return show_in(dev, buf, offset); \
392} \ 392} \
393static ssize_t \ 393static ssize_t \
394 show_in##offset##_min (struct device *dev, char *buf) \ 394 show_in##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
395{ \ 395{ \
396 return show_in_min(dev, buf, offset); \ 396 return show_in_min(dev, buf, offset); \
397} \ 397} \
398static ssize_t \ 398static ssize_t \
399 show_in##offset##_max (struct device *dev, char *buf) \ 399 show_in##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \
400{ \ 400{ \
401 return show_in_max(dev, buf, offset); \ 401 return show_in_max(dev, buf, offset); \
402} \ 402} \
403static ssize_t set_in##offset##_min (struct device *dev, \ 403static ssize_t set_in##offset##_min (struct device *dev, struct device_attribute *attr, \
404 const char *buf, size_t count) \ 404 const char *buf, size_t count) \
405{ \ 405{ \
406 return set_in_min(dev, buf, count, offset); \ 406 return set_in_min(dev, buf, count, offset); \
407} \ 407} \
408static ssize_t set_in##offset##_max (struct device *dev, \ 408static ssize_t set_in##offset##_max (struct device *dev, struct device_attribute *attr, \
409 const char *buf, size_t count) \ 409 const char *buf, size_t count) \
410{ \ 410{ \
411 return set_in_max(dev, buf, count, offset); \ 411 return set_in_max(dev, buf, count, offset); \
@@ -460,26 +460,26 @@ static ssize_t set_temp_hyst(struct device *dev, const char *buf,
460 return count; 460 return count;
461} 461}
462#define show_temp_offset(offset) \ 462#define show_temp_offset(offset) \
463static ssize_t show_temp_##offset (struct device *dev, char *buf) \ 463static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
464{ \ 464{ \
465 return show_temp(dev, buf, offset - 1); \ 465 return show_temp(dev, buf, offset - 1); \
466} \ 466} \
467static ssize_t \ 467static ssize_t \
468show_temp_##offset##_over (struct device *dev, char *buf) \ 468show_temp_##offset##_over (struct device *dev, struct device_attribute *attr, char *buf) \
469{ \ 469{ \
470 return show_temp_over(dev, buf, offset - 1); \ 470 return show_temp_over(dev, buf, offset - 1); \
471} \ 471} \
472static ssize_t \ 472static ssize_t \
473show_temp_##offset##_hyst (struct device *dev, char *buf) \ 473show_temp_##offset##_hyst (struct device *dev, struct device_attribute *attr, char *buf) \
474{ \ 474{ \
475 return show_temp_hyst(dev, buf, offset - 1); \ 475 return show_temp_hyst(dev, buf, offset - 1); \
476} \ 476} \
477static ssize_t set_temp_##offset##_over (struct device *dev, \ 477static ssize_t set_temp_##offset##_over (struct device *dev, struct device_attribute *attr, \
478 const char *buf, size_t count) \ 478 const char *buf, size_t count) \
479{ \ 479{ \
480 return set_temp_over(dev, buf, count, offset - 1); \ 480 return set_temp_over(dev, buf, count, offset - 1); \
481} \ 481} \
482static ssize_t set_temp_##offset##_hyst (struct device *dev, \ 482static ssize_t set_temp_##offset##_hyst (struct device *dev, struct device_attribute *attr, \
483 const char *buf, size_t count) \ 483 const char *buf, size_t count) \
484{ \ 484{ \
485 return set_temp_hyst(dev, buf, count, offset - 1); \ 485 return set_temp_hyst(dev, buf, count, offset - 1); \
@@ -538,24 +538,24 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
538} 538}
539 539
540#define show_fan_offset(offset) \ 540#define show_fan_offset(offset) \
541static ssize_t show_fan_##offset (struct device *dev, char *buf) \ 541static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
542{ \ 542{ \
543 return show_fan(dev, buf, offset - 1); \ 543 return show_fan(dev, buf, offset - 1); \
544} \ 544} \
545static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ 545static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \
546{ \ 546{ \
547 return show_fan_min(dev, buf, offset - 1); \ 547 return show_fan_min(dev, buf, offset - 1); \
548} \ 548} \
549static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ 549static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \
550{ \ 550{ \
551 return show_fan_div(dev, buf, offset - 1); \ 551 return show_fan_div(dev, buf, offset - 1); \
552} \ 552} \
553static ssize_t set_fan_##offset##_min (struct device *dev, \ 553static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \
554 const char *buf, size_t count) \ 554 const char *buf, size_t count) \
555{ \ 555{ \
556 return set_fan_min(dev, buf, count, offset - 1); \ 556 return set_fan_min(dev, buf, count, offset - 1); \
557} \ 557} \
558static ssize_t set_fan_##offset##_div (struct device *dev, \ 558static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \
559 const char *buf, size_t count) \ 559 const char *buf, size_t count) \
560{ \ 560{ \
561 return set_fan_div(dev, buf, count, offset - 1); \ 561 return set_fan_div(dev, buf, count, offset - 1); \
@@ -570,7 +570,7 @@ show_fan_offset(1);
570show_fan_offset(2); 570show_fan_offset(2);
571 571
572/* Alarms */ 572/* Alarms */
573static ssize_t show_alarms(struct device *dev, char *buf) { 573static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) {
574 struct via686a_data *data = via686a_update_device(dev); 574 struct via686a_data *data = via686a_update_device(dev);
575 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms)); 575 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms));
576} 576}
diff --git a/drivers/i2c/chips/w83627hf.c b/drivers/i2c/chips/w83627hf.c
index b1da5ed696d3..4f1bff572c1c 100644
--- a/drivers/i2c/chips/w83627hf.c
+++ b/drivers/i2c/chips/w83627hf.c
@@ -368,19 +368,19 @@ store_in_reg(MAX, max)
368 368
369#define sysfs_in_offset(offset) \ 369#define sysfs_in_offset(offset) \
370static ssize_t \ 370static ssize_t \
371show_regs_in_##offset (struct device *dev, char *buf) \ 371show_regs_in_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
372{ \ 372{ \
373 return show_in(dev, buf, offset); \ 373 return show_in(dev, buf, offset); \
374} \ 374} \
375static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL); 375static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL);
376 376
377#define sysfs_in_reg_offset(reg, offset) \ 377#define sysfs_in_reg_offset(reg, offset) \
378static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \ 378static ssize_t show_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \
379{ \ 379{ \
380 return show_in_##reg (dev, buf, offset); \ 380 return show_in_##reg (dev, buf, offset); \
381} \ 381} \
382static ssize_t \ 382static ssize_t \
383store_regs_in_##reg##offset (struct device *dev, \ 383store_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, \
384 const char *buf, size_t count) \ 384 const char *buf, size_t count) \
385{ \ 385{ \
386 return store_in_##reg (dev, buf, count, offset); \ 386 return store_in_##reg (dev, buf, count, offset); \
@@ -419,25 +419,25 @@ static ssize_t show_in_0(struct w83627hf_data *data, char *buf, u8 reg)
419 return sprintf(buf,"%ld\n", in0); 419 return sprintf(buf,"%ld\n", in0);
420} 420}
421 421
422static ssize_t show_regs_in_0(struct device *dev, char *buf) 422static ssize_t show_regs_in_0(struct device *dev, struct device_attribute *attr, char *buf)
423{ 423{
424 struct w83627hf_data *data = w83627hf_update_device(dev); 424 struct w83627hf_data *data = w83627hf_update_device(dev);
425 return show_in_0(data, buf, data->in[0]); 425 return show_in_0(data, buf, data->in[0]);
426} 426}
427 427
428static ssize_t show_regs_in_min0(struct device *dev, char *buf) 428static ssize_t show_regs_in_min0(struct device *dev, struct device_attribute *attr, char *buf)
429{ 429{
430 struct w83627hf_data *data = w83627hf_update_device(dev); 430 struct w83627hf_data *data = w83627hf_update_device(dev);
431 return show_in_0(data, buf, data->in_min[0]); 431 return show_in_0(data, buf, data->in_min[0]);
432} 432}
433 433
434static ssize_t show_regs_in_max0(struct device *dev, char *buf) 434static ssize_t show_regs_in_max0(struct device *dev, struct device_attribute *attr, char *buf)
435{ 435{
436 struct w83627hf_data *data = w83627hf_update_device(dev); 436 struct w83627hf_data *data = w83627hf_update_device(dev);
437 return show_in_0(data, buf, data->in_max[0]); 437 return show_in_0(data, buf, data->in_max[0]);
438} 438}
439 439
440static ssize_t store_regs_in_min0(struct device *dev, 440static ssize_t store_regs_in_min0(struct device *dev, struct device_attribute *attr,
441 const char *buf, size_t count) 441 const char *buf, size_t count)
442{ 442{
443 struct i2c_client *client = to_i2c_client(dev); 443 struct i2c_client *client = to_i2c_client(dev);
@@ -462,7 +462,7 @@ static ssize_t store_regs_in_min0(struct device *dev,
462 return count; 462 return count;
463} 463}
464 464
465static ssize_t store_regs_in_max0(struct device *dev, 465static ssize_t store_regs_in_max0(struct device *dev, struct device_attribute *attr,
466 const char *buf, size_t count) 466 const char *buf, size_t count)
467{ 467{
468 struct i2c_client *client = to_i2c_client(dev); 468 struct i2c_client *client = to_i2c_client(dev);
@@ -531,19 +531,19 @@ store_fan_min(struct device *dev, const char *buf, size_t count, int nr)
531} 531}
532 532
533#define sysfs_fan_offset(offset) \ 533#define sysfs_fan_offset(offset) \
534static ssize_t show_regs_fan_##offset (struct device *dev, char *buf) \ 534static ssize_t show_regs_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
535{ \ 535{ \
536 return show_fan(dev, buf, offset); \ 536 return show_fan(dev, buf, offset); \
537} \ 537} \
538static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL); 538static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL);
539 539
540#define sysfs_fan_min_offset(offset) \ 540#define sysfs_fan_min_offset(offset) \
541static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \ 541static ssize_t show_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, char *buf) \
542{ \ 542{ \
543 return show_fan_min(dev, buf, offset); \ 543 return show_fan_min(dev, buf, offset); \
544} \ 544} \
545static ssize_t \ 545static ssize_t \
546store_regs_fan_min##offset (struct device *dev, const char *buf, size_t count) \ 546store_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
547{ \ 547{ \
548 return store_fan_min(dev, buf, count, offset); \ 548 return store_fan_min(dev, buf, count, offset); \
549} \ 549} \
@@ -608,19 +608,19 @@ store_temp_reg(HYST, max_hyst);
608 608
609#define sysfs_temp_offset(offset) \ 609#define sysfs_temp_offset(offset) \
610static ssize_t \ 610static ssize_t \
611show_regs_temp_##offset (struct device *dev, char *buf) \ 611show_regs_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
612{ \ 612{ \
613 return show_temp(dev, buf, offset); \ 613 return show_temp(dev, buf, offset); \
614} \ 614} \
615static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL); 615static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL);
616 616
617#define sysfs_temp_reg_offset(reg, offset) \ 617#define sysfs_temp_reg_offset(reg, offset) \
618static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \ 618static ssize_t show_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \
619{ \ 619{ \
620 return show_temp_##reg (dev, buf, offset); \ 620 return show_temp_##reg (dev, buf, offset); \
621} \ 621} \
622static ssize_t \ 622static ssize_t \
623store_regs_temp_##reg##offset (struct device *dev, \ 623store_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, \
624 const char *buf, size_t count) \ 624 const char *buf, size_t count) \
625{ \ 625{ \
626 return store_temp_##reg (dev, buf, count, offset); \ 626 return store_temp_##reg (dev, buf, count, offset); \
@@ -645,7 +645,7 @@ device_create_file(&client->dev, &dev_attr_temp##offset##_max_hyst); \
645} while (0) 645} while (0)
646 646
647static ssize_t 647static ssize_t
648show_vid_reg(struct device *dev, char *buf) 648show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
649{ 649{
650 struct w83627hf_data *data = w83627hf_update_device(dev); 650 struct w83627hf_data *data = w83627hf_update_device(dev);
651 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); 651 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm));
@@ -655,13 +655,13 @@ static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL);
655device_create_file(&client->dev, &dev_attr_cpu0_vid) 655device_create_file(&client->dev, &dev_attr_cpu0_vid)
656 656
657static ssize_t 657static ssize_t
658show_vrm_reg(struct device *dev, char *buf) 658show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
659{ 659{
660 struct w83627hf_data *data = w83627hf_update_device(dev); 660 struct w83627hf_data *data = w83627hf_update_device(dev);
661 return sprintf(buf, "%ld\n", (long) data->vrm); 661 return sprintf(buf, "%ld\n", (long) data->vrm);
662} 662}
663static ssize_t 663static ssize_t
664store_vrm_reg(struct device *dev, const char *buf, size_t count) 664store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
665{ 665{
666 struct i2c_client *client = to_i2c_client(dev); 666 struct i2c_client *client = to_i2c_client(dev);
667 struct w83627hf_data *data = i2c_get_clientdata(client); 667 struct w83627hf_data *data = i2c_get_clientdata(client);
@@ -677,7 +677,7 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
677device_create_file(&client->dev, &dev_attr_vrm) 677device_create_file(&client->dev, &dev_attr_vrm)
678 678
679static ssize_t 679static ssize_t
680show_alarms_reg(struct device *dev, char *buf) 680show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
681{ 681{
682 struct w83627hf_data *data = w83627hf_update_device(dev); 682 struct w83627hf_data *data = w83627hf_update_device(dev);
683 return sprintf(buf, "%ld\n", (long) data->alarms); 683 return sprintf(buf, "%ld\n", (long) data->alarms);
@@ -687,7 +687,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
687device_create_file(&client->dev, &dev_attr_alarms) 687device_create_file(&client->dev, &dev_attr_alarms)
688 688
689#define show_beep_reg(REG, reg) \ 689#define show_beep_reg(REG, reg) \
690static ssize_t show_beep_##reg (struct device *dev, char *buf) \ 690static ssize_t show_beep_##reg (struct device *dev, struct device_attribute *attr, char *buf) \
691{ \ 691{ \
692 struct w83627hf_data *data = w83627hf_update_device(dev); \ 692 struct w83627hf_data *data = w83627hf_update_device(dev); \
693 return sprintf(buf,"%ld\n", \ 693 return sprintf(buf,"%ld\n", \
@@ -732,12 +732,12 @@ store_beep_reg(struct device *dev, const char *buf, size_t count,
732} 732}
733 733
734#define sysfs_beep(REG, reg) \ 734#define sysfs_beep(REG, reg) \
735static ssize_t show_regs_beep_##reg (struct device *dev, char *buf) \ 735static ssize_t show_regs_beep_##reg (struct device *dev, struct device_attribute *attr, char *buf) \
736{ \ 736{ \
737 return show_beep_##reg(dev, buf); \ 737 return show_beep_##reg(dev, attr, buf); \
738} \ 738} \
739static ssize_t \ 739static ssize_t \
740store_regs_beep_##reg (struct device *dev, const char *buf, size_t count) \ 740store_regs_beep_##reg (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
741{ \ 741{ \
742 return store_beep_reg(dev, buf, count, BEEP_##REG); \ 742 return store_beep_reg(dev, buf, count, BEEP_##REG); \
743} \ 743} \
@@ -801,12 +801,12 @@ store_fan_div_reg(struct device *dev, const char *buf, size_t count, int nr)
801} 801}
802 802
803#define sysfs_fan_div(offset) \ 803#define sysfs_fan_div(offset) \
804static ssize_t show_regs_fan_div_##offset (struct device *dev, char *buf) \ 804static ssize_t show_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
805{ \ 805{ \
806 return show_fan_div_reg(dev, buf, offset); \ 806 return show_fan_div_reg(dev, buf, offset); \
807} \ 807} \
808static ssize_t \ 808static ssize_t \
809store_regs_fan_div_##offset (struct device *dev, \ 809store_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, \
810 const char *buf, size_t count) \ 810 const char *buf, size_t count) \
811{ \ 811{ \
812 return store_fan_div_reg(dev, buf, count, offset - 1); \ 812 return store_fan_div_reg(dev, buf, count, offset - 1); \
@@ -861,12 +861,12 @@ store_pwm_reg(struct device *dev, const char *buf, size_t count, int nr)
861} 861}
862 862
863#define sysfs_pwm(offset) \ 863#define sysfs_pwm(offset) \
864static ssize_t show_regs_pwm_##offset (struct device *dev, char *buf) \ 864static ssize_t show_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
865{ \ 865{ \
866 return show_pwm_reg(dev, buf, offset); \ 866 return show_pwm_reg(dev, buf, offset); \
867} \ 867} \
868static ssize_t \ 868static ssize_t \
869store_regs_pwm_##offset (struct device *dev, const char *buf, size_t count) \ 869store_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
870{ \ 870{ \
871 return store_pwm_reg(dev, buf, count, offset); \ 871 return store_pwm_reg(dev, buf, count, offset); \
872} \ 872} \
@@ -937,12 +937,12 @@ store_sensor_reg(struct device *dev, const char *buf, size_t count, int nr)
937} 937}
938 938
939#define sysfs_sensor(offset) \ 939#define sysfs_sensor(offset) \
940static ssize_t show_regs_sensor_##offset (struct device *dev, char *buf) \ 940static ssize_t show_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
941{ \ 941{ \
942 return show_sensor_reg(dev, buf, offset); \ 942 return show_sensor_reg(dev, buf, offset); \
943} \ 943} \
944static ssize_t \ 944static ssize_t \
945store_regs_sensor_##offset (struct device *dev, const char *buf, size_t count) \ 945store_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
946{ \ 946{ \
947 return store_sensor_reg(dev, buf, count, offset); \ 947 return store_sensor_reg(dev, buf, count, offset); \
948} \ 948} \
diff --git a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c
index 4954e465c419..c3926d2d8ac6 100644
--- a/drivers/i2c/chips/w83781d.c
+++ b/drivers/i2c/chips/w83781d.c
@@ -309,18 +309,18 @@ store_in_reg(MAX, max);
309 309
310#define sysfs_in_offset(offset) \ 310#define sysfs_in_offset(offset) \
311static ssize_t \ 311static ssize_t \
312show_regs_in_##offset (struct device *dev, char *buf) \ 312show_regs_in_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
313{ \ 313{ \
314 return show_in(dev, buf, offset); \ 314 return show_in(dev, buf, offset); \
315} \ 315} \
316static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL); 316static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL);
317 317
318#define sysfs_in_reg_offset(reg, offset) \ 318#define sysfs_in_reg_offset(reg, offset) \
319static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \ 319static ssize_t show_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \
320{ \ 320{ \
321 return show_in_##reg (dev, buf, offset); \ 321 return show_in_##reg (dev, buf, offset); \
322} \ 322} \
323static ssize_t store_regs_in_##reg##offset (struct device *dev, const char *buf, size_t count) \ 323static ssize_t store_regs_in_##reg##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
324{ \ 324{ \
325 return store_in_##reg (dev, buf, count, offset); \ 325 return store_in_##reg (dev, buf, count, offset); \
326} \ 326} \
@@ -378,18 +378,18 @@ store_fan_min(struct device *dev, const char *buf, size_t count, int nr)
378} 378}
379 379
380#define sysfs_fan_offset(offset) \ 380#define sysfs_fan_offset(offset) \
381static ssize_t show_regs_fan_##offset (struct device *dev, char *buf) \ 381static ssize_t show_regs_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
382{ \ 382{ \
383 return show_fan(dev, buf, offset); \ 383 return show_fan(dev, buf, offset); \
384} \ 384} \
385static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL); 385static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL);
386 386
387#define sysfs_fan_min_offset(offset) \ 387#define sysfs_fan_min_offset(offset) \
388static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \ 388static ssize_t show_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, char *buf) \
389{ \ 389{ \
390 return show_fan_min(dev, buf, offset); \ 390 return show_fan_min(dev, buf, offset); \
391} \ 391} \
392static ssize_t store_regs_fan_min##offset (struct device *dev, const char *buf, size_t count) \ 392static ssize_t store_regs_fan_min##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
393{ \ 393{ \
394 return store_fan_min(dev, buf, count, offset); \ 394 return store_fan_min(dev, buf, count, offset); \
395} \ 395} \
@@ -452,18 +452,18 @@ store_temp_reg(HYST, max_hyst);
452 452
453#define sysfs_temp_offset(offset) \ 453#define sysfs_temp_offset(offset) \
454static ssize_t \ 454static ssize_t \
455show_regs_temp_##offset (struct device *dev, char *buf) \ 455show_regs_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
456{ \ 456{ \
457 return show_temp(dev, buf, offset); \ 457 return show_temp(dev, buf, offset); \
458} \ 458} \
459static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL); 459static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL);
460 460
461#define sysfs_temp_reg_offset(reg, offset) \ 461#define sysfs_temp_reg_offset(reg, offset) \
462static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \ 462static ssize_t show_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, char *buf) \
463{ \ 463{ \
464 return show_temp_##reg (dev, buf, offset); \ 464 return show_temp_##reg (dev, buf, offset); \
465} \ 465} \
466static ssize_t store_regs_temp_##reg##offset (struct device *dev, const char *buf, size_t count) \ 466static ssize_t store_regs_temp_##reg##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
467{ \ 467{ \
468 return store_temp_##reg (dev, buf, count, offset); \ 468 return store_temp_##reg (dev, buf, count, offset); \
469} \ 469} \
@@ -486,7 +486,7 @@ device_create_file(&client->dev, &dev_attr_temp##offset##_max_hyst); \
486} while (0) 486} while (0)
487 487
488static ssize_t 488static ssize_t
489show_vid_reg(struct device *dev, char *buf) 489show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
490{ 490{
491 struct w83781d_data *data = w83781d_update_device(dev); 491 struct w83781d_data *data = w83781d_update_device(dev);
492 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); 492 return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm));
@@ -497,14 +497,14 @@ DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL);
497#define device_create_file_vid(client) \ 497#define device_create_file_vid(client) \
498device_create_file(&client->dev, &dev_attr_cpu0_vid); 498device_create_file(&client->dev, &dev_attr_cpu0_vid);
499static ssize_t 499static ssize_t
500show_vrm_reg(struct device *dev, char *buf) 500show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
501{ 501{
502 struct w83781d_data *data = w83781d_update_device(dev); 502 struct w83781d_data *data = w83781d_update_device(dev);
503 return sprintf(buf, "%ld\n", (long) data->vrm); 503 return sprintf(buf, "%ld\n", (long) data->vrm);
504} 504}
505 505
506static ssize_t 506static ssize_t
507store_vrm_reg(struct device *dev, const char *buf, size_t count) 507store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
508{ 508{
509 struct i2c_client *client = to_i2c_client(dev); 509 struct i2c_client *client = to_i2c_client(dev);
510 struct w83781d_data *data = i2c_get_clientdata(client); 510 struct w83781d_data *data = i2c_get_clientdata(client);
@@ -521,7 +521,7 @@ DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
521#define device_create_file_vrm(client) \ 521#define device_create_file_vrm(client) \
522device_create_file(&client->dev, &dev_attr_vrm); 522device_create_file(&client->dev, &dev_attr_vrm);
523static ssize_t 523static ssize_t
524show_alarms_reg(struct device *dev, char *buf) 524show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
525{ 525{
526 struct w83781d_data *data = w83781d_update_device(dev); 526 struct w83781d_data *data = w83781d_update_device(dev);
527 return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms)); 527 return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms));
@@ -531,13 +531,13 @@ static
531DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); 531DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
532#define device_create_file_alarms(client) \ 532#define device_create_file_alarms(client) \
533device_create_file(&client->dev, &dev_attr_alarms); 533device_create_file(&client->dev, &dev_attr_alarms);
534static ssize_t show_beep_mask (struct device *dev, char *buf) 534static ssize_t show_beep_mask (struct device *dev, struct device_attribute *attr, char *buf)
535{ 535{
536 struct w83781d_data *data = w83781d_update_device(dev); 536 struct w83781d_data *data = w83781d_update_device(dev);
537 return sprintf(buf, "%ld\n", 537 return sprintf(buf, "%ld\n",
538 (long)BEEP_MASK_FROM_REG(data->beep_mask, data->type)); 538 (long)BEEP_MASK_FROM_REG(data->beep_mask, data->type));
539} 539}
540static ssize_t show_beep_enable (struct device *dev, char *buf) 540static ssize_t show_beep_enable (struct device *dev, struct device_attribute *attr, char *buf)
541{ 541{
542 struct w83781d_data *data = w83781d_update_device(dev); 542 struct w83781d_data *data = w83781d_update_device(dev);
543 return sprintf(buf, "%ld\n", 543 return sprintf(buf, "%ld\n",
@@ -583,11 +583,11 @@ store_beep_reg(struct device *dev, const char *buf, size_t count,
583} 583}
584 584
585#define sysfs_beep(REG, reg) \ 585#define sysfs_beep(REG, reg) \
586static ssize_t show_regs_beep_##reg (struct device *dev, char *buf) \ 586static ssize_t show_regs_beep_##reg (struct device *dev, struct device_attribute *attr, char *buf) \
587{ \ 587{ \
588 return show_beep_##reg(dev, buf); \ 588 return show_beep_##reg(dev, attr, buf); \
589} \ 589} \
590static ssize_t store_regs_beep_##reg (struct device *dev, const char *buf, size_t count) \ 590static ssize_t store_regs_beep_##reg (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
591{ \ 591{ \
592 return store_beep_reg(dev, buf, count, BEEP_##REG); \ 592 return store_beep_reg(dev, buf, count, BEEP_##REG); \
593} \ 593} \
@@ -653,11 +653,11 @@ store_fan_div_reg(struct device *dev, const char *buf, size_t count, int nr)
653} 653}
654 654
655#define sysfs_fan_div(offset) \ 655#define sysfs_fan_div(offset) \
656static ssize_t show_regs_fan_div_##offset (struct device *dev, char *buf) \ 656static ssize_t show_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
657{ \ 657{ \
658 return show_fan_div_reg(dev, buf, offset); \ 658 return show_fan_div_reg(dev, buf, offset); \
659} \ 659} \
660static ssize_t store_regs_fan_div_##offset (struct device *dev, const char *buf, size_t count) \ 660static ssize_t store_regs_fan_div_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
661{ \ 661{ \
662 return store_fan_div_reg(dev, buf, count, offset - 1); \ 662 return store_fan_div_reg(dev, buf, count, offset - 1); \
663} \ 663} \
@@ -737,11 +737,11 @@ store_pwmenable_reg(struct device *dev, const char *buf, size_t count, int nr)
737} 737}
738 738
739#define sysfs_pwm(offset) \ 739#define sysfs_pwm(offset) \
740static ssize_t show_regs_pwm_##offset (struct device *dev, char *buf) \ 740static ssize_t show_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
741{ \ 741{ \
742 return show_pwm_reg(dev, buf, offset); \ 742 return show_pwm_reg(dev, buf, offset); \
743} \ 743} \
744static ssize_t store_regs_pwm_##offset (struct device *dev, \ 744static ssize_t store_regs_pwm_##offset (struct device *dev, struct device_attribute *attr, \
745 const char *buf, size_t count) \ 745 const char *buf, size_t count) \
746{ \ 746{ \
747 return store_pwm_reg(dev, buf, count, offset); \ 747 return store_pwm_reg(dev, buf, count, offset); \
@@ -750,11 +750,11 @@ static DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR, \
750 show_regs_pwm_##offset, store_regs_pwm_##offset); 750 show_regs_pwm_##offset, store_regs_pwm_##offset);
751 751
752#define sysfs_pwmenable(offset) \ 752#define sysfs_pwmenable(offset) \
753static ssize_t show_regs_pwmenable_##offset (struct device *dev, char *buf) \ 753static ssize_t show_regs_pwmenable_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
754{ \ 754{ \
755 return show_pwmenable_reg(dev, buf, offset); \ 755 return show_pwmenable_reg(dev, buf, offset); \
756} \ 756} \
757static ssize_t store_regs_pwmenable_##offset (struct device *dev, \ 757static ssize_t store_regs_pwmenable_##offset (struct device *dev, struct device_attribute *attr, \
758 const char *buf, size_t count) \ 758 const char *buf, size_t count) \
759{ \ 759{ \
760 return store_pwmenable_reg(dev, buf, count, offset); \ 760 return store_pwmenable_reg(dev, buf, count, offset); \
@@ -832,11 +832,11 @@ store_sensor_reg(struct device *dev, const char *buf, size_t count, int nr)
832} 832}
833 833
834#define sysfs_sensor(offset) \ 834#define sysfs_sensor(offset) \
835static ssize_t show_regs_sensor_##offset (struct device *dev, char *buf) \ 835static ssize_t show_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, char *buf) \
836{ \ 836{ \
837 return show_sensor_reg(dev, buf, offset); \ 837 return show_sensor_reg(dev, buf, offset); \
838} \ 838} \
839static ssize_t store_regs_sensor_##offset (struct device *dev, const char *buf, size_t count) \ 839static ssize_t store_regs_sensor_##offset (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
840{ \ 840{ \
841 return store_sensor_reg(dev, buf, count, offset); \ 841 return store_sensor_reg(dev, buf, count, offset); \
842} \ 842} \
diff --git a/drivers/i2c/chips/w83l785ts.c b/drivers/i2c/chips/w83l785ts.c
index 59bbc5881fa6..74d4b58e4237 100644
--- a/drivers/i2c/chips/w83l785ts.c
+++ b/drivers/i2c/chips/w83l785ts.c
@@ -118,13 +118,13 @@ struct w83l785ts_data {
118 * Sysfs stuff 118 * Sysfs stuff
119 */ 119 */
120 120
121static ssize_t show_temp(struct device *dev, char *buf) 121static ssize_t show_temp(struct device *dev, struct device_attribute *attr, char *buf)
122{ 122{
123 struct w83l785ts_data *data = w83l785ts_update_device(dev); 123 struct w83l785ts_data *data = w83l785ts_update_device(dev);
124 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp)); 124 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp));
125} 125}
126 126
127static ssize_t show_temp_over(struct device *dev, char *buf) 127static ssize_t show_temp_over(struct device *dev, struct device_attribute *attr, char *buf)
128{ 128{
129 struct w83l785ts_data *data = w83l785ts_update_device(dev); 129 struct w83l785ts_data *data = w83l785ts_update_device(dev);
130 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over)); 130 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over));
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 9011627d7eb0..a22e53badacb 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -103,7 +103,7 @@ static struct class i2c_adapter_class = {
103 .release = &i2c_adapter_class_dev_release, 103 .release = &i2c_adapter_class_dev_release,
104}; 104};
105 105
106static ssize_t show_adapter_name(struct device *dev, char *buf) 106static ssize_t show_adapter_name(struct device *dev, struct device_attribute *attr, char *buf)
107{ 107{
108 struct i2c_adapter *adap = dev_to_i2c_adapter(dev); 108 struct i2c_adapter *adap = dev_to_i2c_adapter(dev);
109 return sprintf(buf, "%s\n", adap->name); 109 return sprintf(buf, "%s\n", adap->name);
@@ -117,7 +117,7 @@ static void i2c_client_release(struct device *dev)
117 complete(&client->released); 117 complete(&client->released);
118} 118}
119 119
120static ssize_t show_client_name(struct device *dev, char *buf) 120static ssize_t show_client_name(struct device *dev, struct device_attribute *attr, char *buf)
121{ 121{
122 struct i2c_client *client = to_i2c_client(dev); 122 struct i2c_client *client = to_i2c_client(dev);
123 return sprintf(buf, "%s\n", client->name); 123 return sprintf(buf, "%s\n", client->name);
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 3ac0a535b4aa..0273f124a4f7 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -672,8 +672,8 @@ config BLK_DEV_SVWKS
672 chipsets. 672 chipsets.
673 673
674config BLK_DEV_SGIIOC4 674config BLK_DEV_SGIIOC4
675 tristate "Silicon Graphics IOC4 chipset support" 675 tristate "Silicon Graphics IOC4 chipset ATA/ATAPI support"
676 depends on IA64_SGI_SN2 || IA64_GENERIC 676 depends on (IA64_SGI_SN2 || IA64_GENERIC) && SGI_IOC4
677 help 677 help
678 This driver adds PIO & MultiMode DMA-2 support for the SGI IOC4 678 This driver adds PIO & MultiMode DMA-2 support for the SGI IOC4
679 chipset, which has one channel and can support two devices. 679 chipset, which has one channel and can support two devices.
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 4f7ce7056228..39f3e9101ed4 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1932,8 +1932,11 @@ static ide_startstop_t cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
1932 1932
1933 /* 1933 /*
1934 * check if dma is safe 1934 * check if dma is safe
1935 *
1936 * NOTE! The "len" and "addr" checks should possibly have
1937 * separate masks.
1935 */ 1938 */
1936 if ((rq->data_len & 3) || (addr & mask)) 1939 if ((rq->data_len & 15) || (addr & mask))
1937 info->dma = 0; 1940 info->dma = 0;
1938 } 1941 }
1939 1942
@@ -3255,16 +3258,12 @@ sector_t ide_cdrom_capacity (ide_drive_t *drive)
3255 return capacity * sectors_per_frame; 3258 return capacity * sectors_per_frame;
3256} 3259}
3257 3260
3258static 3261static int ide_cd_remove(struct device *dev)
3259int ide_cdrom_cleanup(ide_drive_t *drive)
3260{ 3262{
3263 ide_drive_t *drive = to_ide_device(dev);
3261 struct cdrom_info *info = drive->driver_data; 3264 struct cdrom_info *info = drive->driver_data;
3262 3265
3263 if (ide_unregister_subdriver(drive)) { 3266 ide_unregister_subdriver(drive, info->driver);
3264 printk(KERN_ERR "%s: %s: failed to ide_unregister_subdriver\n",
3265 __FUNCTION__, drive->name);
3266 return 1;
3267 }
3268 3267
3269 del_gendisk(info->disk); 3268 del_gendisk(info->disk);
3270 3269
@@ -3297,7 +3296,7 @@ static void ide_cd_release(struct kref *kref)
3297 kfree(info); 3296 kfree(info);
3298} 3297}
3299 3298
3300static int ide_cdrom_attach (ide_drive_t *drive); 3299static int ide_cd_probe(struct device *);
3301 3300
3302#ifdef CONFIG_PROC_FS 3301#ifdef CONFIG_PROC_FS
3303static int proc_idecd_read_capacity 3302static int proc_idecd_read_capacity
@@ -3320,19 +3319,20 @@ static ide_proc_entry_t idecd_proc[] = {
3320 3319
3321static ide_driver_t ide_cdrom_driver = { 3320static ide_driver_t ide_cdrom_driver = {
3322 .owner = THIS_MODULE, 3321 .owner = THIS_MODULE,
3323 .name = "ide-cdrom", 3322 .gen_driver = {
3323 .name = "ide-cdrom",
3324 .bus = &ide_bus_type,
3325 .probe = ide_cd_probe,
3326 .remove = ide_cd_remove,
3327 },
3324 .version = IDECD_VERSION, 3328 .version = IDECD_VERSION,
3325 .media = ide_cdrom, 3329 .media = ide_cdrom,
3326 .busy = 0,
3327 .supports_dsc_overlap = 1, 3330 .supports_dsc_overlap = 1,
3328 .cleanup = ide_cdrom_cleanup,
3329 .do_request = ide_do_rw_cdrom, 3331 .do_request = ide_do_rw_cdrom,
3330 .end_request = ide_end_request, 3332 .end_request = ide_end_request,
3331 .error = __ide_error, 3333 .error = __ide_error,
3332 .abort = __ide_abort, 3334 .abort = __ide_abort,
3333 .proc = idecd_proc, 3335 .proc = idecd_proc,
3334 .attach = ide_cdrom_attach,
3335 .drives = LIST_HEAD_INIT(ide_cdrom_driver.drives),
3336}; 3336};
3337 3337
3338static int idecd_open(struct inode * inode, struct file * file) 3338static int idecd_open(struct inode * inode, struct file * file)
@@ -3418,8 +3418,9 @@ static char *ignore = NULL;
3418module_param(ignore, charp, 0400); 3418module_param(ignore, charp, 0400);
3419MODULE_DESCRIPTION("ATAPI CD-ROM Driver"); 3419MODULE_DESCRIPTION("ATAPI CD-ROM Driver");
3420 3420
3421static int ide_cdrom_attach (ide_drive_t *drive) 3421static int ide_cd_probe(struct device *dev)
3422{ 3422{
3423 ide_drive_t *drive = to_ide_device(dev);
3423 struct cdrom_info *info; 3424 struct cdrom_info *info;
3424 struct gendisk *g; 3425 struct gendisk *g;
3425 struct request_sense sense; 3426 struct request_sense sense;
@@ -3453,11 +3454,8 @@ static int ide_cdrom_attach (ide_drive_t *drive)
3453 3454
3454 ide_init_disk(g, drive); 3455 ide_init_disk(g, drive);
3455 3456
3456 if (ide_register_subdriver(drive, &ide_cdrom_driver)) { 3457 ide_register_subdriver(drive, &ide_cdrom_driver);
3457 printk(KERN_ERR "%s: Failed to register the driver with ide.c\n", 3458
3458 drive->name);
3459 goto out_put_disk;
3460 }
3461 memset(info, 0, sizeof (struct cdrom_info)); 3459 memset(info, 0, sizeof (struct cdrom_info));
3462 3460
3463 kref_init(&info->kref); 3461 kref_init(&info->kref);
@@ -3470,7 +3468,6 @@ static int ide_cdrom_attach (ide_drive_t *drive)
3470 3468
3471 drive->driver_data = info; 3469 drive->driver_data = info;
3472 3470
3473 DRIVER(drive)->busy++;
3474 g->minors = 1; 3471 g->minors = 1;
3475 snprintf(g->devfs_name, sizeof(g->devfs_name), 3472 snprintf(g->devfs_name, sizeof(g->devfs_name),
3476 "%s/cd", drive->devfs_name); 3473 "%s/cd", drive->devfs_name);
@@ -3478,8 +3475,7 @@ static int ide_cdrom_attach (ide_drive_t *drive)
3478 g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE; 3475 g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE;
3479 if (ide_cdrom_setup(drive)) { 3476 if (ide_cdrom_setup(drive)) {
3480 struct cdrom_device_info *devinfo = &info->devinfo; 3477 struct cdrom_device_info *devinfo = &info->devinfo;
3481 DRIVER(drive)->busy--; 3478 ide_unregister_subdriver(drive, &ide_cdrom_driver);
3482 ide_unregister_subdriver(drive);
3483 if (info->buffer != NULL) 3479 if (info->buffer != NULL)
3484 kfree(info->buffer); 3480 kfree(info->buffer);
3485 if (info->toc != NULL) 3481 if (info->toc != NULL)
@@ -3492,7 +3488,6 @@ static int ide_cdrom_attach (ide_drive_t *drive)
3492 drive->driver_data = NULL; 3488 drive->driver_data = NULL;
3493 goto failed; 3489 goto failed;
3494 } 3490 }
3495 DRIVER(drive)->busy--;
3496 3491
3497 cdrom_read_toc(drive, &sense); 3492 cdrom_read_toc(drive, &sense);
3498 g->fops = &idecd_ops; 3493 g->fops = &idecd_ops;
@@ -3500,23 +3495,20 @@ static int ide_cdrom_attach (ide_drive_t *drive)
3500 add_disk(g); 3495 add_disk(g);
3501 return 0; 3496 return 0;
3502 3497
3503out_put_disk:
3504 put_disk(g);
3505out_free_cd: 3498out_free_cd:
3506 kfree(info); 3499 kfree(info);
3507failed: 3500failed:
3508 return 1; 3501 return -ENODEV;
3509} 3502}
3510 3503
3511static void __exit ide_cdrom_exit(void) 3504static void __exit ide_cdrom_exit(void)
3512{ 3505{
3513 ide_unregister_driver(&ide_cdrom_driver); 3506 driver_unregister(&ide_cdrom_driver.gen_driver);
3514} 3507}
3515 3508
3516static int ide_cdrom_init(void) 3509static int ide_cdrom_init(void)
3517{ 3510{
3518 ide_register_driver(&ide_cdrom_driver); 3511 return driver_register(&ide_cdrom_driver.gen_driver);
3519 return 0;
3520} 3512}
3521 3513
3522module_init(ide_cdrom_init); 3514module_init(ide_cdrom_init);
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 5d54f7756100..3302cd8eab4c 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -1024,14 +1024,16 @@ static void ide_cacheflush_p(ide_drive_t *drive)
1024 printk(KERN_INFO "%s: wcache flush failed!\n", drive->name); 1024 printk(KERN_INFO "%s: wcache flush failed!\n", drive->name);
1025} 1025}
1026 1026
1027static int idedisk_cleanup (ide_drive_t *drive) 1027static int ide_disk_remove(struct device *dev)
1028{ 1028{
1029 ide_drive_t *drive = to_ide_device(dev);
1029 struct ide_disk_obj *idkp = drive->driver_data; 1030 struct ide_disk_obj *idkp = drive->driver_data;
1030 struct gendisk *g = idkp->disk; 1031 struct gendisk *g = idkp->disk;
1031 1032
1032 ide_cacheflush_p(drive); 1033 ide_cacheflush_p(drive);
1033 if (ide_unregister_subdriver(drive)) 1034
1034 return 1; 1035 ide_unregister_subdriver(drive, idkp->driver);
1036
1035 del_gendisk(g); 1037 del_gendisk(g);
1036 1038
1037 ide_disk_put(idkp); 1039 ide_disk_put(idkp);
@@ -1052,7 +1054,7 @@ static void ide_disk_release(struct kref *kref)
1052 kfree(idkp); 1054 kfree(idkp);
1053} 1055}
1054 1056
1055static int idedisk_attach(ide_drive_t *drive); 1057static int ide_disk_probe(struct device *dev);
1056 1058
1057static void ide_device_shutdown(struct device *dev) 1059static void ide_device_shutdown(struct device *dev)
1058{ 1060{
@@ -1082,27 +1084,23 @@ static void ide_device_shutdown(struct device *dev)
1082 dev->bus->suspend(dev, PMSG_SUSPEND); 1084 dev->bus->suspend(dev, PMSG_SUSPEND);
1083} 1085}
1084 1086
1085/*
1086 * IDE subdriver functions, registered with ide.c
1087 */
1088static ide_driver_t idedisk_driver = { 1087static ide_driver_t idedisk_driver = {
1089 .owner = THIS_MODULE, 1088 .owner = THIS_MODULE,
1090 .gen_driver = { 1089 .gen_driver = {
1090 .name = "ide-disk",
1091 .bus = &ide_bus_type,
1092 .probe = ide_disk_probe,
1093 .remove = ide_disk_remove,
1091 .shutdown = ide_device_shutdown, 1094 .shutdown = ide_device_shutdown,
1092 }, 1095 },
1093 .name = "ide-disk",
1094 .version = IDEDISK_VERSION, 1096 .version = IDEDISK_VERSION,
1095 .media = ide_disk, 1097 .media = ide_disk,
1096 .busy = 0,
1097 .supports_dsc_overlap = 0, 1098 .supports_dsc_overlap = 0,
1098 .cleanup = idedisk_cleanup,
1099 .do_request = ide_do_rw_disk, 1099 .do_request = ide_do_rw_disk,
1100 .end_request = ide_end_request, 1100 .end_request = ide_end_request,
1101 .error = __ide_error, 1101 .error = __ide_error,
1102 .abort = __ide_abort, 1102 .abort = __ide_abort,
1103 .proc = idedisk_proc, 1103 .proc = idedisk_proc,
1104 .attach = idedisk_attach,
1105 .drives = LIST_HEAD_INIT(idedisk_driver.drives),
1106}; 1104};
1107 1105
1108static int idedisk_open(struct inode *inode, struct file *filp) 1106static int idedisk_open(struct inode *inode, struct file *filp)
@@ -1199,8 +1197,9 @@ static struct block_device_operations idedisk_ops = {
1199 1197
1200MODULE_DESCRIPTION("ATA DISK Driver"); 1198MODULE_DESCRIPTION("ATA DISK Driver");
1201 1199
1202static int idedisk_attach(ide_drive_t *drive) 1200static int ide_disk_probe(struct device *dev)
1203{ 1201{
1202 ide_drive_t *drive = to_ide_device(dev);
1204 struct ide_disk_obj *idkp; 1203 struct ide_disk_obj *idkp;
1205 struct gendisk *g; 1204 struct gendisk *g;
1206 1205
@@ -1222,10 +1221,7 @@ static int idedisk_attach(ide_drive_t *drive)
1222 1221
1223 ide_init_disk(g, drive); 1222 ide_init_disk(g, drive);
1224 1223
1225 if (ide_register_subdriver(drive, &idedisk_driver)) { 1224 ide_register_subdriver(drive, &idedisk_driver);
1226 printk (KERN_ERR "ide-disk: %s: Failed to register the driver with ide.c\n", drive->name);
1227 goto out_put_disk;
1228 }
1229 1225
1230 memset(idkp, 0, sizeof(*idkp)); 1226 memset(idkp, 0, sizeof(*idkp));
1231 1227
@@ -1239,7 +1235,6 @@ static int idedisk_attach(ide_drive_t *drive)
1239 1235
1240 drive->driver_data = idkp; 1236 drive->driver_data = idkp;
1241 1237
1242 DRIVER(drive)->busy++;
1243 idedisk_setup(drive); 1238 idedisk_setup(drive);
1244 if ((!drive->head || drive->head > 16) && !drive->select.b.lba) { 1239 if ((!drive->head || drive->head > 16) && !drive->select.b.lba) {
1245 printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n", 1240 printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n",
@@ -1247,7 +1242,7 @@ static int idedisk_attach(ide_drive_t *drive)
1247 drive->attach = 0; 1242 drive->attach = 0;
1248 } else 1243 } else
1249 drive->attach = 1; 1244 drive->attach = 1;
1250 DRIVER(drive)->busy--; 1245
1251 g->minors = 1 << PARTN_BITS; 1246 g->minors = 1 << PARTN_BITS;
1252 strcpy(g->devfs_name, drive->devfs_name); 1247 strcpy(g->devfs_name, drive->devfs_name);
1253 g->driverfs_dev = &drive->gendev; 1248 g->driverfs_dev = &drive->gendev;
@@ -1257,22 +1252,20 @@ static int idedisk_attach(ide_drive_t *drive)
1257 add_disk(g); 1252 add_disk(g);
1258 return 0; 1253 return 0;
1259 1254
1260out_put_disk:
1261 put_disk(g);
1262out_free_idkp: 1255out_free_idkp:
1263 kfree(idkp); 1256 kfree(idkp);
1264failed: 1257failed:
1265 return 1; 1258 return -ENODEV;
1266} 1259}
1267 1260
1268static void __exit idedisk_exit (void) 1261static void __exit idedisk_exit (void)
1269{ 1262{
1270 ide_unregister_driver(&idedisk_driver); 1263 driver_unregister(&idedisk_driver.gen_driver);
1271} 1264}
1272 1265
1273static int idedisk_init (void) 1266static int idedisk_init (void)
1274{ 1267{
1275 return ide_register_driver(&idedisk_driver); 1268 return driver_register(&idedisk_driver.gen_driver);
1276} 1269}
1277 1270
1278module_init(idedisk_init); 1271module_init(idedisk_init);
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 36c0b74a4e45..c949e98df4b6 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -1865,13 +1865,13 @@ static void idefloppy_setup (ide_drive_t *drive, idefloppy_floppy_t *floppy)
1865 idefloppy_add_settings(drive); 1865 idefloppy_add_settings(drive);
1866} 1866}
1867 1867
1868static int idefloppy_cleanup (ide_drive_t *drive) 1868static int ide_floppy_remove(struct device *dev)
1869{ 1869{
1870 ide_drive_t *drive = to_ide_device(dev);
1870 idefloppy_floppy_t *floppy = drive->driver_data; 1871 idefloppy_floppy_t *floppy = drive->driver_data;
1871 struct gendisk *g = floppy->disk; 1872 struct gendisk *g = floppy->disk;
1872 1873
1873 if (ide_unregister_subdriver(drive)) 1874 ide_unregister_subdriver(drive, floppy->driver);
1874 return 1;
1875 1875
1876 del_gendisk(g); 1876 del_gendisk(g);
1877 1877
@@ -1916,26 +1916,24 @@ static ide_proc_entry_t idefloppy_proc[] = {
1916 1916
1917#endif /* CONFIG_PROC_FS */ 1917#endif /* CONFIG_PROC_FS */
1918 1918
1919static int idefloppy_attach(ide_drive_t *drive); 1919static int ide_floppy_probe(struct device *);
1920 1920
1921/*
1922 * IDE subdriver functions, registered with ide.c
1923 */
1924static ide_driver_t idefloppy_driver = { 1921static ide_driver_t idefloppy_driver = {
1925 .owner = THIS_MODULE, 1922 .owner = THIS_MODULE,
1926 .name = "ide-floppy", 1923 .gen_driver = {
1924 .name = "ide-floppy",
1925 .bus = &ide_bus_type,
1926 .probe = ide_floppy_probe,
1927 .remove = ide_floppy_remove,
1928 },
1927 .version = IDEFLOPPY_VERSION, 1929 .version = IDEFLOPPY_VERSION,
1928 .media = ide_floppy, 1930 .media = ide_floppy,
1929 .busy = 0,
1930 .supports_dsc_overlap = 0, 1931 .supports_dsc_overlap = 0,
1931 .cleanup = idefloppy_cleanup,
1932 .do_request = idefloppy_do_request, 1932 .do_request = idefloppy_do_request,
1933 .end_request = idefloppy_do_end_request, 1933 .end_request = idefloppy_do_end_request,
1934 .error = __ide_error, 1934 .error = __ide_error,
1935 .abort = __ide_abort, 1935 .abort = __ide_abort,
1936 .proc = idefloppy_proc, 1936 .proc = idefloppy_proc,
1937 .attach = idefloppy_attach,
1938 .drives = LIST_HEAD_INIT(idefloppy_driver.drives),
1939}; 1937};
1940 1938
1941static int idefloppy_open(struct inode *inode, struct file *filp) 1939static int idefloppy_open(struct inode *inode, struct file *filp)
@@ -2122,8 +2120,9 @@ static struct block_device_operations idefloppy_ops = {
2122 .revalidate_disk= idefloppy_revalidate_disk 2120 .revalidate_disk= idefloppy_revalidate_disk
2123}; 2121};
2124 2122
2125static int idefloppy_attach (ide_drive_t *drive) 2123static int ide_floppy_probe(struct device *dev)
2126{ 2124{
2125 ide_drive_t *drive = to_ide_device(dev);
2127 idefloppy_floppy_t *floppy; 2126 idefloppy_floppy_t *floppy;
2128 struct gendisk *g; 2127 struct gendisk *g;
2129 2128
@@ -2152,10 +2151,7 @@ static int idefloppy_attach (ide_drive_t *drive)
2152 2151
2153 ide_init_disk(g, drive); 2152 ide_init_disk(g, drive);
2154 2153
2155 if (ide_register_subdriver(drive, &idefloppy_driver)) { 2154 ide_register_subdriver(drive, &idefloppy_driver);
2156 printk (KERN_ERR "ide-floppy: %s: Failed to register the driver with ide.c\n", drive->name);
2157 goto out_put_disk;
2158 }
2159 2155
2160 memset(floppy, 0, sizeof(*floppy)); 2156 memset(floppy, 0, sizeof(*floppy));
2161 2157
@@ -2169,9 +2165,8 @@ static int idefloppy_attach (ide_drive_t *drive)
2169 2165
2170 drive->driver_data = floppy; 2166 drive->driver_data = floppy;
2171 2167
2172 DRIVER(drive)->busy++;
2173 idefloppy_setup (drive, floppy); 2168 idefloppy_setup (drive, floppy);
2174 DRIVER(drive)->busy--; 2169
2175 g->minors = 1 << PARTN_BITS; 2170 g->minors = 1 << PARTN_BITS;
2176 g->driverfs_dev = &drive->gendev; 2171 g->driverfs_dev = &drive->gendev;
2177 strcpy(g->devfs_name, drive->devfs_name); 2172 strcpy(g->devfs_name, drive->devfs_name);
@@ -2181,19 +2176,17 @@ static int idefloppy_attach (ide_drive_t *drive)
2181 add_disk(g); 2176 add_disk(g);
2182 return 0; 2177 return 0;
2183 2178
2184out_put_disk:
2185 put_disk(g);
2186out_free_floppy: 2179out_free_floppy:
2187 kfree(floppy); 2180 kfree(floppy);
2188failed: 2181failed:
2189 return 1; 2182 return -ENODEV;
2190} 2183}
2191 2184
2192MODULE_DESCRIPTION("ATAPI FLOPPY Driver"); 2185MODULE_DESCRIPTION("ATAPI FLOPPY Driver");
2193 2186
2194static void __exit idefloppy_exit (void) 2187static void __exit idefloppy_exit (void)
2195{ 2188{
2196 ide_unregister_driver(&idefloppy_driver); 2189 driver_unregister(&idefloppy_driver.gen_driver);
2197} 2190}
2198 2191
2199/* 2192/*
@@ -2202,8 +2195,7 @@ static void __exit idefloppy_exit (void)
2202static int idefloppy_init (void) 2195static int idefloppy_init (void)
2203{ 2196{
2204 printk("ide-floppy driver " IDEFLOPPY_VERSION "\n"); 2197 printk("ide-floppy driver " IDEFLOPPY_VERSION "\n");
2205 ide_register_driver(&idefloppy_driver); 2198 return driver_register(&idefloppy_driver.gen_driver);
2206 return 0;
2207} 2199}
2208 2200
2209module_init(idefloppy_init); 2201module_init(idefloppy_init);
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 554473a95cf7..5d876f53c697 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -47,6 +47,7 @@
47#include <linux/slab.h> 47#include <linux/slab.h>
48#include <linux/delay.h> 48#include <linux/delay.h>
49#include <linux/ide.h> 49#include <linux/ide.h>
50#include <linux/devfs_fs_kernel.h>
50#include <linux/spinlock.h> 51#include <linux/spinlock.h>
51#include <linux/kmod.h> 52#include <linux/kmod.h>
52#include <linux/pci.h> 53#include <linux/pci.h>
@@ -696,13 +697,13 @@ static int wait_hwif_ready(ide_hwif_t *hwif)
696 SELECT_DRIVE(&hwif->drives[0]); 697 SELECT_DRIVE(&hwif->drives[0]);
697 hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]); 698 hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
698 mdelay(2); 699 mdelay(2);
699 rc = ide_wait_not_busy(hwif, 10000); 700 rc = ide_wait_not_busy(hwif, 35000);
700 if (rc) 701 if (rc)
701 return rc; 702 return rc;
702 SELECT_DRIVE(&hwif->drives[1]); 703 SELECT_DRIVE(&hwif->drives[1]);
703 hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]); 704 hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
704 mdelay(2); 705 mdelay(2);
705 rc = ide_wait_not_busy(hwif, 10000); 706 rc = ide_wait_not_busy(hwif, 35000);
706 707
707 /* Exit function with master reselected (let's be sane) */ 708 /* Exit function with master reselected (let's be sane) */
708 SELECT_DRIVE(&hwif->drives[0]); 709 SELECT_DRIVE(&hwif->drives[0]);
@@ -918,7 +919,7 @@ int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)
918 want them on default or a new "empty" class 919 want them on default or a new "empty" class
919 for hotplug reprobing ? */ 920 for hotplug reprobing ? */
920 if (drive->present) { 921 if (drive->present) {
921 ata_attach(drive); 922 device_register(&drive->gendev);
922 } 923 }
923 } 924 }
924 } 925 }
@@ -1279,10 +1280,51 @@ void ide_init_disk(struct gendisk *disk, ide_drive_t *drive)
1279 1280
1280EXPORT_SYMBOL_GPL(ide_init_disk); 1281EXPORT_SYMBOL_GPL(ide_init_disk);
1281 1282
1283static void ide_remove_drive_from_hwgroup(ide_drive_t *drive)
1284{
1285 ide_hwgroup_t *hwgroup = drive->hwif->hwgroup;
1286
1287 if (drive == drive->next) {
1288 /* special case: last drive from hwgroup. */
1289 BUG_ON(hwgroup->drive != drive);
1290 hwgroup->drive = NULL;
1291 } else {
1292 ide_drive_t *walk;
1293
1294 walk = hwgroup->drive;
1295 while (walk->next != drive)
1296 walk = walk->next;
1297 walk->next = drive->next;
1298 if (hwgroup->drive == drive) {
1299 hwgroup->drive = drive->next;
1300 hwgroup->hwif = hwgroup->drive->hwif;
1301 }
1302 }
1303 BUG_ON(hwgroup->drive == drive);
1304}
1305
1282static void drive_release_dev (struct device *dev) 1306static void drive_release_dev (struct device *dev)
1283{ 1307{
1284 ide_drive_t *drive = container_of(dev, ide_drive_t, gendev); 1308 ide_drive_t *drive = container_of(dev, ide_drive_t, gendev);
1285 1309
1310 spin_lock_irq(&ide_lock);
1311 if (drive->devfs_name[0] != '\0') {
1312 devfs_remove(drive->devfs_name);
1313 drive->devfs_name[0] = '\0';
1314 }
1315 ide_remove_drive_from_hwgroup(drive);
1316 if (drive->id != NULL) {
1317 kfree(drive->id);
1318 drive->id = NULL;
1319 }
1320 drive->present = 0;
1321 /* Messed up locking ... */
1322 spin_unlock_irq(&ide_lock);
1323 blk_cleanup_queue(drive->queue);
1324 spin_lock_irq(&ide_lock);
1325 drive->queue = NULL;
1326 spin_unlock_irq(&ide_lock);
1327
1286 up(&drive->gendev_rel_sem); 1328 up(&drive->gendev_rel_sem);
1287} 1329}
1288 1330
@@ -1306,7 +1348,6 @@ static void init_gendisk (ide_hwif_t *hwif)
1306 drive->gendev.driver_data = drive; 1348 drive->gendev.driver_data = drive;
1307 drive->gendev.release = drive_release_dev; 1349 drive->gendev.release = drive_release_dev;
1308 if (drive->present) { 1350 if (drive->present) {
1309 device_register(&drive->gendev);
1310 sprintf(drive->devfs_name, "ide/host%d/bus%d/target%d/lun%d", 1351 sprintf(drive->devfs_name, "ide/host%d/bus%d/target%d/lun%d",
1311 (hwif->channel && hwif->mate) ? 1352 (hwif->channel && hwif->mate) ?
1312 hwif->mate->index : hwif->index, 1353 hwif->mate->index : hwif->index,
@@ -1412,7 +1453,7 @@ int ideprobe_init (void)
1412 hwif->chipset = ide_generic; 1453 hwif->chipset = ide_generic;
1413 for (unit = 0; unit < MAX_DRIVES; ++unit) 1454 for (unit = 0; unit < MAX_DRIVES; ++unit)
1414 if (hwif->drives[unit].present) 1455 if (hwif->drives[unit].present)
1415 ata_attach(&hwif->drives[unit]); 1456 device_register(&hwif->drives[unit].gendev);
1416 } 1457 }
1417 } 1458 }
1418 return 0; 1459 return 0;
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
index 4b1e43b4118b..4063d2c34e3d 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -307,17 +307,41 @@ static int proc_ide_read_driver
307 (char *page, char **start, off_t off, int count, int *eof, void *data) 307 (char *page, char **start, off_t off, int count, int *eof, void *data)
308{ 308{
309 ide_drive_t *drive = (ide_drive_t *) data; 309 ide_drive_t *drive = (ide_drive_t *) data;
310 ide_driver_t *driver = drive->driver; 310 struct device *dev = &drive->gendev;
311 ide_driver_t *ide_drv;
311 int len; 312 int len;
312 313
313 if (driver) { 314 down_read(&dev->bus->subsys.rwsem);
315 if (dev->driver) {
316 ide_drv = container_of(dev->driver, ide_driver_t, gen_driver);
314 len = sprintf(page, "%s version %s\n", 317 len = sprintf(page, "%s version %s\n",
315 driver->name, driver->version); 318 dev->driver->name, ide_drv->version);
316 } else 319 } else
317 len = sprintf(page, "ide-default version 0.9.newide\n"); 320 len = sprintf(page, "ide-default version 0.9.newide\n");
321 up_read(&dev->bus->subsys.rwsem);
318 PROC_IDE_READ_RETURN(page,start,off,count,eof,len); 322 PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
319} 323}
320 324
325static int ide_replace_subdriver(ide_drive_t *drive, const char *driver)
326{
327 struct device *dev = &drive->gendev;
328 int ret = 1;
329
330 down_write(&dev->bus->subsys.rwsem);
331 device_release_driver(dev);
332 /* FIXME: device can still be in use by previous driver */
333 strlcpy(drive->driver_req, driver, sizeof(drive->driver_req));
334 device_attach(dev);
335 drive->driver_req[0] = 0;
336 if (dev->driver == NULL)
337 device_attach(dev);
338 if (dev->driver && !strcmp(dev->driver->name, driver))
339 ret = 0;
340 up_write(&dev->bus->subsys.rwsem);
341
342 return ret;
343}
344
321static int proc_ide_write_driver 345static int proc_ide_write_driver
322 (struct file *file, const char __user *buffer, unsigned long count, void *data) 346 (struct file *file, const char __user *buffer, unsigned long count, void *data)
323{ 347{
@@ -488,16 +512,32 @@ void destroy_proc_ide_interface(ide_hwif_t *hwif)
488 } 512 }
489} 513}
490 514
491extern struct seq_operations ide_drivers_op; 515static int proc_print_driver(struct device_driver *drv, void *data)
516{
517 ide_driver_t *ide_drv = container_of(drv, ide_driver_t, gen_driver);
518 struct seq_file *s = data;
519
520 seq_printf(s, "%s version %s\n", drv->name, ide_drv->version);
521
522 return 0;
523}
524
525static int ide_drivers_show(struct seq_file *s, void *p)
526{
527 bus_for_each_drv(&ide_bus_type, NULL, s, proc_print_driver);
528 return 0;
529}
530
492static int ide_drivers_open(struct inode *inode, struct file *file) 531static int ide_drivers_open(struct inode *inode, struct file *file)
493{ 532{
494 return seq_open(file, &ide_drivers_op); 533 return single_open(file, &ide_drivers_show, NULL);
495} 534}
535
496static struct file_operations ide_drivers_operations = { 536static struct file_operations ide_drivers_operations = {
497 .open = ide_drivers_open, 537 .open = ide_drivers_open,
498 .read = seq_read, 538 .read = seq_read,
499 .llseek = seq_lseek, 539 .llseek = seq_lseek,
500 .release = seq_release, 540 .release = single_release,
501}; 541};
502 542
503void proc_ide_create(void) 543void proc_ide_create(void)
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 482544854985..5a3dc46008e6 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -4681,21 +4681,12 @@ static void idetape_setup (ide_drive_t *drive, idetape_tape_t *tape, int minor)
4681 idetape_add_settings(drive); 4681 idetape_add_settings(drive);
4682} 4682}
4683 4683
4684static int idetape_cleanup (ide_drive_t *drive) 4684static int ide_tape_remove(struct device *dev)
4685{ 4685{
4686 ide_drive_t *drive = to_ide_device(dev);
4686 idetape_tape_t *tape = drive->driver_data; 4687 idetape_tape_t *tape = drive->driver_data;
4687 unsigned long flags;
4688
4689 spin_lock_irqsave(&ide_lock, flags);
4690 if (test_bit(IDETAPE_BUSY, &tape->flags) || drive->usage ||
4691 tape->first_stage != NULL || tape->merge_stage_size) {
4692 spin_unlock_irqrestore(&ide_lock, flags);
4693 return 1;
4694 }
4695 4688
4696 spin_unlock_irqrestore(&ide_lock, flags); 4689 ide_unregister_subdriver(drive, tape->driver);
4697 DRIVER(drive)->busy = 0;
4698 (void) ide_unregister_subdriver(drive);
4699 4690
4700 ide_unregister_region(tape->disk); 4691 ide_unregister_region(tape->disk);
4701 4692
@@ -4710,6 +4701,8 @@ static void ide_tape_release(struct kref *kref)
4710 ide_drive_t *drive = tape->drive; 4701 ide_drive_t *drive = tape->drive;
4711 struct gendisk *g = tape->disk; 4702 struct gendisk *g = tape->disk;
4712 4703
4704 BUG_ON(tape->first_stage != NULL || tape->merge_stage_size);
4705
4713 drive->dsc_overlap = 0; 4706 drive->dsc_overlap = 0;
4714 drive->driver_data = NULL; 4707 drive->driver_data = NULL;
4715 devfs_remove("%s/mt", drive->devfs_name); 4708 devfs_remove("%s/mt", drive->devfs_name);
@@ -4747,26 +4740,24 @@ static ide_proc_entry_t idetape_proc[] = {
4747 4740
4748#endif 4741#endif
4749 4742
4750static int idetape_attach(ide_drive_t *drive); 4743static int ide_tape_probe(struct device *);
4751 4744
4752/*
4753 * IDE subdriver functions, registered with ide.c
4754 */
4755static ide_driver_t idetape_driver = { 4745static ide_driver_t idetape_driver = {
4756 .owner = THIS_MODULE, 4746 .owner = THIS_MODULE,
4757 .name = "ide-tape", 4747 .gen_driver = {
4748 .name = "ide-tape",
4749 .bus = &ide_bus_type,
4750 .probe = ide_tape_probe,
4751 .remove = ide_tape_remove,
4752 },
4758 .version = IDETAPE_VERSION, 4753 .version = IDETAPE_VERSION,
4759 .media = ide_tape, 4754 .media = ide_tape,
4760 .busy = 1,
4761 .supports_dsc_overlap = 1, 4755 .supports_dsc_overlap = 1,
4762 .cleanup = idetape_cleanup,
4763 .do_request = idetape_do_request, 4756 .do_request = idetape_do_request,
4764 .end_request = idetape_end_request, 4757 .end_request = idetape_end_request,
4765 .error = __ide_error, 4758 .error = __ide_error,
4766 .abort = __ide_abort, 4759 .abort = __ide_abort,
4767 .proc = idetape_proc, 4760 .proc = idetape_proc,
4768 .attach = idetape_attach,
4769 .drives = LIST_HEAD_INIT(idetape_driver.drives),
4770}; 4761};
4771 4762
4772/* 4763/*
@@ -4829,8 +4820,9 @@ static struct block_device_operations idetape_block_ops = {
4829 .ioctl = idetape_ioctl, 4820 .ioctl = idetape_ioctl,
4830}; 4821};
4831 4822
4832static int idetape_attach (ide_drive_t *drive) 4823static int ide_tape_probe(struct device *dev)
4833{ 4824{
4825 ide_drive_t *drive = to_ide_device(dev);
4834 idetape_tape_t *tape; 4826 idetape_tape_t *tape;
4835 struct gendisk *g; 4827 struct gendisk *g;
4836 int minor; 4828 int minor;
@@ -4865,10 +4857,7 @@ static int idetape_attach (ide_drive_t *drive)
4865 4857
4866 ide_init_disk(g, drive); 4858 ide_init_disk(g, drive);
4867 4859
4868 if (ide_register_subdriver(drive, &idetape_driver)) { 4860 ide_register_subdriver(drive, &idetape_driver);
4869 printk(KERN_ERR "ide-tape: %s: Failed to register the driver with ide.c\n", drive->name);
4870 goto out_put_disk;
4871 }
4872 4861
4873 memset(tape, 0, sizeof(*tape)); 4862 memset(tape, 0, sizeof(*tape));
4874 4863
@@ -4902,12 +4891,11 @@ static int idetape_attach (ide_drive_t *drive)
4902 ide_register_region(g); 4891 ide_register_region(g);
4903 4892
4904 return 0; 4893 return 0;
4905out_put_disk: 4894
4906 put_disk(g);
4907out_free_tape: 4895out_free_tape:
4908 kfree(tape); 4896 kfree(tape);
4909failed: 4897failed:
4910 return 1; 4898 return -ENODEV;
4911} 4899}
4912 4900
4913MODULE_DESCRIPTION("ATAPI Streaming TAPE Driver"); 4901MODULE_DESCRIPTION("ATAPI Streaming TAPE Driver");
@@ -4915,7 +4903,7 @@ MODULE_LICENSE("GPL");
4915 4903
4916static void __exit idetape_exit (void) 4904static void __exit idetape_exit (void)
4917{ 4905{
4918 ide_unregister_driver(&idetape_driver); 4906 driver_unregister(&idetape_driver.gen_driver);
4919 unregister_chrdev(IDETAPE_MAJOR, "ht"); 4907 unregister_chrdev(IDETAPE_MAJOR, "ht");
4920} 4908}
4921 4909
@@ -4928,8 +4916,7 @@ static int idetape_init (void)
4928 printk(KERN_ERR "ide-tape: Failed to register character device interface\n"); 4916 printk(KERN_ERR "ide-tape: Failed to register character device interface\n");
4929 return -EBUSY; 4917 return -EBUSY;
4930 } 4918 }
4931 ide_register_driver(&idetape_driver); 4919 return driver_register(&idetape_driver.gen_driver);
4932 return 0;
4933} 4920}
4934 4921
4935module_init(idetape_init); 4922module_init(idetape_init);
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 973dec799b5c..dae1bd5b8c3e 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -196,8 +196,6 @@ ide_hwif_t ide_hwifs[MAX_HWIFS]; /* master data repository */
196 196
197EXPORT_SYMBOL(ide_hwifs); 197EXPORT_SYMBOL(ide_hwifs);
198 198
199static struct list_head ide_drives = LIST_HEAD_INIT(ide_drives);
200
201/* 199/*
202 * Do not even *think* about calling this! 200 * Do not even *think* about calling this!
203 */ 201 */
@@ -358,54 +356,6 @@ static int ide_system_bus_speed(void)
358 return system_bus_speed; 356 return system_bus_speed;
359} 357}
360 358
361/*
362 * drives_lock protects the list of drives, drivers_lock the
363 * list of drivers. Currently nobody takes both at once.
364 */
365
366static DEFINE_SPINLOCK(drives_lock);
367static DEFINE_SPINLOCK(drivers_lock);
368static LIST_HEAD(drivers);
369
370/* Iterator for the driver list. */
371
372static void *m_start(struct seq_file *m, loff_t *pos)
373{
374 struct list_head *p;
375 loff_t l = *pos;
376 spin_lock(&drivers_lock);
377 list_for_each(p, &drivers)
378 if (!l--)
379 return list_entry(p, ide_driver_t, drivers);
380 return NULL;
381}
382
383static void *m_next(struct seq_file *m, void *v, loff_t *pos)
384{
385 struct list_head *p = ((ide_driver_t *)v)->drivers.next;
386 (*pos)++;
387 return p==&drivers ? NULL : list_entry(p, ide_driver_t, drivers);
388}
389
390static void m_stop(struct seq_file *m, void *v)
391{
392 spin_unlock(&drivers_lock);
393}
394
395static int show_driver(struct seq_file *m, void *v)
396{
397 ide_driver_t *driver = v;
398 seq_printf(m, "%s version %s\n", driver->name, driver->version);
399 return 0;
400}
401
402struct seq_operations ide_drivers_op = {
403 .start = m_start,
404 .next = m_next,
405 .stop = m_stop,
406 .show = show_driver
407};
408
409#ifdef CONFIG_PROC_FS 359#ifdef CONFIG_PROC_FS
410struct proc_dir_entry *proc_ide_root; 360struct proc_dir_entry *proc_ide_root;
411#endif 361#endif
@@ -630,7 +580,7 @@ void ide_unregister(unsigned int index)
630 ide_hwif_t *hwif, *g; 580 ide_hwif_t *hwif, *g;
631 static ide_hwif_t tmp_hwif; /* protected by ide_cfg_sem */ 581 static ide_hwif_t tmp_hwif; /* protected by ide_cfg_sem */
632 ide_hwgroup_t *hwgroup; 582 ide_hwgroup_t *hwgroup;
633 int irq_count = 0, unit, i; 583 int irq_count = 0, unit;
634 584
635 BUG_ON(index >= MAX_HWIFS); 585 BUG_ON(index >= MAX_HWIFS);
636 586
@@ -643,23 +593,22 @@ void ide_unregister(unsigned int index)
643 goto abort; 593 goto abort;
644 for (unit = 0; unit < MAX_DRIVES; ++unit) { 594 for (unit = 0; unit < MAX_DRIVES; ++unit) {
645 drive = &hwif->drives[unit]; 595 drive = &hwif->drives[unit];
646 if (!drive->present) 596 if (!drive->present) {
597 if (drive->devfs_name[0] != '\0') {
598 devfs_remove(drive->devfs_name);
599 drive->devfs_name[0] = '\0';
600 }
647 continue; 601 continue;
648 if (drive->usage || DRIVER(drive)->busy) 602 }
649 goto abort; 603 spin_unlock_irq(&ide_lock);
650 drive->dead = 1; 604 device_unregister(&drive->gendev);
605 down(&drive->gendev_rel_sem);
606 spin_lock_irq(&ide_lock);
651 } 607 }
652 hwif->present = 0; 608 hwif->present = 0;
653 609
654 spin_unlock_irq(&ide_lock); 610 spin_unlock_irq(&ide_lock);
655 611
656 for (unit = 0; unit < MAX_DRIVES; ++unit) {
657 drive = &hwif->drives[unit];
658 if (!drive->present)
659 continue;
660 DRIVER(drive)->cleanup(drive);
661 }
662
663 destroy_proc_ide_interface(hwif); 612 destroy_proc_ide_interface(hwif);
664 613
665 hwgroup = hwif->hwgroup; 614 hwgroup = hwif->hwgroup;
@@ -687,44 +636,6 @@ void ide_unregister(unsigned int index)
687 * Remove us from the hwgroup, and free 636 * Remove us from the hwgroup, and free
688 * the hwgroup if we were the only member 637 * the hwgroup if we were the only member
689 */ 638 */
690 for (i = 0; i < MAX_DRIVES; ++i) {
691 drive = &hwif->drives[i];
692 if (drive->devfs_name[0] != '\0') {
693 devfs_remove(drive->devfs_name);
694 drive->devfs_name[0] = '\0';
695 }
696 if (!drive->present)
697 continue;
698 if (drive == drive->next) {
699 /* special case: last drive from hwgroup. */
700 BUG_ON(hwgroup->drive != drive);
701 hwgroup->drive = NULL;
702 } else {
703 ide_drive_t *walk;
704
705 walk = hwgroup->drive;
706 while (walk->next != drive)
707 walk = walk->next;
708 walk->next = drive->next;
709 if (hwgroup->drive == drive) {
710 hwgroup->drive = drive->next;
711 hwgroup->hwif = HWIF(hwgroup->drive);
712 }
713 }
714 BUG_ON(hwgroup->drive == drive);
715 if (drive->id != NULL) {
716 kfree(drive->id);
717 drive->id = NULL;
718 }
719 drive->present = 0;
720 /* Messed up locking ... */
721 spin_unlock_irq(&ide_lock);
722 blk_cleanup_queue(drive->queue);
723 device_unregister(&drive->gendev);
724 down(&drive->gendev_rel_sem);
725 spin_lock_irq(&ide_lock);
726 drive->queue = NULL;
727 }
728 if (hwif->next == hwif) { 639 if (hwif->next == hwif) {
729 BUG_ON(hwgroup->hwif != hwif); 640 BUG_ON(hwgroup->hwif != hwif);
730 kfree(hwgroup); 641 kfree(hwgroup);
@@ -1304,73 +1215,6 @@ int system_bus_clock (void)
1304 1215
1305EXPORT_SYMBOL(system_bus_clock); 1216EXPORT_SYMBOL(system_bus_clock);
1306 1217
1307/*
1308 * Locking is badly broken here - since way back. That sucker is
1309 * root-only, but that's not an excuse... The real question is what
1310 * exclusion rules do we want here.
1311 */
1312int ide_replace_subdriver (ide_drive_t *drive, const char *driver)
1313{
1314 if (!drive->present || drive->usage || drive->dead)
1315 goto abort;
1316 if (DRIVER(drive)->cleanup(drive))
1317 goto abort;
1318 strlcpy(drive->driver_req, driver, sizeof(drive->driver_req));
1319 if (ata_attach(drive)) {
1320 spin_lock(&drives_lock);
1321 list_del_init(&drive->list);
1322 spin_unlock(&drives_lock);
1323 drive->driver_req[0] = 0;
1324 ata_attach(drive);
1325 } else {
1326 drive->driver_req[0] = 0;
1327 }
1328 if (drive->driver && !strcmp(drive->driver->name, driver))
1329 return 0;
1330abort:
1331 return 1;
1332}
1333
1334/**
1335 * ata_attach - attach an ATA/ATAPI device
1336 * @drive: drive to attach
1337 *
1338 * Takes a drive that is as yet not assigned to any midlayer IDE
1339 * driver (or is assigned to the default driver) and figures out
1340 * which driver would like to own it. If nobody claims the drive
1341 * then it is automatically attached to the default driver used for
1342 * unclaimed objects.
1343 *
1344 * A return of zero indicates attachment to a driver, of one
1345 * attachment to the default driver.
1346 *
1347 * Takes drivers_lock.
1348 */
1349
1350int ata_attach(ide_drive_t *drive)
1351{
1352 struct list_head *p;
1353 spin_lock(&drivers_lock);
1354 list_for_each(p, &drivers) {
1355 ide_driver_t *driver = list_entry(p, ide_driver_t, drivers);
1356 if (!try_module_get(driver->owner))
1357 continue;
1358 spin_unlock(&drivers_lock);
1359 if (driver->attach(drive) == 0) {
1360 module_put(driver->owner);
1361 drive->gendev.driver = &driver->gen_driver;
1362 return 0;
1363 }
1364 spin_lock(&drivers_lock);
1365 module_put(driver->owner);
1366 }
1367 drive->gendev.driver = NULL;
1368 spin_unlock(&drivers_lock);
1369 if (ide_register_subdriver(drive, NULL))
1370 panic("ide: default attach failed");
1371 return 1;
1372}
1373
1374static int generic_ide_suspend(struct device *dev, pm_message_t state) 1218static int generic_ide_suspend(struct device *dev, pm_message_t state)
1375{ 1219{
1376 ide_drive_t *drive = dev->driver_data; 1220 ide_drive_t *drive = dev->driver_data;
@@ -2013,27 +1857,11 @@ static void __init probe_for_hwifs (void)
2013#endif 1857#endif
2014} 1858}
2015 1859
2016int ide_register_subdriver(ide_drive_t *drive, ide_driver_t *driver) 1860void ide_register_subdriver(ide_drive_t *drive, ide_driver_t *driver)
2017{ 1861{
2018 unsigned long flags;
2019
2020 spin_lock_irqsave(&ide_lock, flags);
2021 if (!drive->present || drive->driver != NULL ||
2022 drive->usage || drive->dead) {
2023 spin_unlock_irqrestore(&ide_lock, flags);
2024 return 1;
2025 }
2026 drive->driver = driver;
2027 spin_unlock_irqrestore(&ide_lock, flags);
2028 spin_lock(&drives_lock);
2029 list_add_tail(&drive->list, driver ? &driver->drives : &ide_drives);
2030 spin_unlock(&drives_lock);
2031// printk(KERN_INFO "%s: attached %s driver.\n", drive->name, driver->name);
2032#ifdef CONFIG_PROC_FS 1862#ifdef CONFIG_PROC_FS
2033 if (driver) 1863 ide_add_proc_entries(drive->proc, driver->proc, drive);
2034 ide_add_proc_entries(drive->proc, driver->proc, drive);
2035#endif 1864#endif
2036 return 0;
2037} 1865}
2038 1866
2039EXPORT_SYMBOL(ide_register_subdriver); 1867EXPORT_SYMBOL(ide_register_subdriver);
@@ -2041,136 +1869,51 @@ EXPORT_SYMBOL(ide_register_subdriver);
2041/** 1869/**
2042 * ide_unregister_subdriver - disconnect drive from driver 1870 * ide_unregister_subdriver - disconnect drive from driver
2043 * @drive: drive to unplug 1871 * @drive: drive to unplug
1872 * @driver: driver
2044 * 1873 *
2045 * Disconnect a drive from the driver it was attached to and then 1874 * Disconnect a drive from the driver it was attached to and then
2046 * clean up the various proc files and other objects attached to it. 1875 * clean up the various proc files and other objects attached to it.
2047 * 1876 *
2048 * Takes ide_setting_sem, ide_lock and drives_lock. 1877 * Takes ide_setting_sem and ide_lock.
2049 * Caller must hold none of the locks. 1878 * Caller must hold none of the locks.
2050 *
2051 * No locking versus subdriver unload because we are moving to the
2052 * default driver anyway. Wants double checking.
2053 */ 1879 */
2054 1880
2055int ide_unregister_subdriver (ide_drive_t *drive) 1881void ide_unregister_subdriver(ide_drive_t *drive, ide_driver_t *driver)
2056{ 1882{
2057 unsigned long flags; 1883 unsigned long flags;
2058 1884
2059 down(&ide_setting_sem); 1885 down(&ide_setting_sem);
2060 spin_lock_irqsave(&ide_lock, flags); 1886 spin_lock_irqsave(&ide_lock, flags);
2061 if (drive->usage || drive->driver == NULL || DRIVER(drive)->busy) {
2062 spin_unlock_irqrestore(&ide_lock, flags);
2063 up(&ide_setting_sem);
2064 return 1;
2065 }
2066#ifdef CONFIG_PROC_FS 1887#ifdef CONFIG_PROC_FS
2067 ide_remove_proc_entries(drive->proc, DRIVER(drive)->proc); 1888 ide_remove_proc_entries(drive->proc, driver->proc);
2068#endif 1889#endif
2069 auto_remove_settings(drive); 1890 auto_remove_settings(drive);
2070 drive->driver = NULL;
2071 spin_unlock_irqrestore(&ide_lock, flags); 1891 spin_unlock_irqrestore(&ide_lock, flags);
2072 up(&ide_setting_sem); 1892 up(&ide_setting_sem);
2073 spin_lock(&drives_lock);
2074 list_del_init(&drive->list);
2075 spin_unlock(&drives_lock);
2076 /* drive will be added to &ide_drives in ata_attach() */
2077 return 0;
2078} 1893}
2079 1894
2080EXPORT_SYMBOL(ide_unregister_subdriver); 1895EXPORT_SYMBOL(ide_unregister_subdriver);
2081 1896
2082static int ide_drive_remove(struct device * dev)
2083{
2084 ide_drive_t * drive = container_of(dev,ide_drive_t,gendev);
2085 DRIVER(drive)->cleanup(drive);
2086 return 0;
2087}
2088
2089/**
2090 * ide_register_driver - register IDE device driver
2091 * @driver: the IDE device driver
2092 *
2093 * Register a new device driver and then scan the devices
2094 * on the IDE bus in case any should be attached to the
2095 * driver we have just registered. If so attach them.
2096 *
2097 * Takes drivers_lock and drives_lock.
2098 */
2099
2100int ide_register_driver(ide_driver_t *driver)
2101{
2102 struct list_head list;
2103 struct list_head *list_loop;
2104 struct list_head *tmp_storage;
2105
2106 spin_lock(&drivers_lock);
2107 list_add(&driver->drivers, &drivers);
2108 spin_unlock(&drivers_lock);
2109
2110 INIT_LIST_HEAD(&list);
2111 spin_lock(&drives_lock);
2112 list_splice_init(&ide_drives, &list);
2113 spin_unlock(&drives_lock);
2114
2115 list_for_each_safe(list_loop, tmp_storage, &list) {
2116 ide_drive_t *drive = container_of(list_loop, ide_drive_t, list);
2117 list_del_init(&drive->list);
2118 if (drive->present)
2119 ata_attach(drive);
2120 }
2121 driver->gen_driver.name = (char *) driver->name;
2122 driver->gen_driver.bus = &ide_bus_type;
2123 driver->gen_driver.remove = ide_drive_remove;
2124 return driver_register(&driver->gen_driver);
2125}
2126
2127EXPORT_SYMBOL(ide_register_driver);
2128
2129/**
2130 * ide_unregister_driver - unregister IDE device driver
2131 * @driver: the IDE device driver
2132 *
2133 * Called when a driver module is being unloaded. We reattach any
2134 * devices to whatever driver claims them next (typically the default
2135 * driver).
2136 *
2137 * Takes drivers_lock and called functions will take ide_setting_sem.
2138 */
2139
2140void ide_unregister_driver(ide_driver_t *driver)
2141{
2142 ide_drive_t *drive;
2143
2144 spin_lock(&drivers_lock);
2145 list_del(&driver->drivers);
2146 spin_unlock(&drivers_lock);
2147
2148 driver_unregister(&driver->gen_driver);
2149
2150 while(!list_empty(&driver->drives)) {
2151 drive = list_entry(driver->drives.next, ide_drive_t, list);
2152 if (driver->cleanup(drive)) {
2153 printk(KERN_ERR "%s: cleanup_module() called while still busy\n", drive->name);
2154 BUG();
2155 }
2156 ata_attach(drive);
2157 }
2158}
2159
2160EXPORT_SYMBOL(ide_unregister_driver);
2161
2162/* 1897/*
2163 * Probe module 1898 * Probe module
2164 */ 1899 */
2165 1900
2166EXPORT_SYMBOL(ide_lock); 1901EXPORT_SYMBOL(ide_lock);
2167 1902
1903static int ide_bus_match(struct device *dev, struct device_driver *drv)
1904{
1905 return 1;
1906}
1907
2168struct bus_type ide_bus_type = { 1908struct bus_type ide_bus_type = {
2169 .name = "ide", 1909 .name = "ide",
1910 .match = ide_bus_match,
2170 .suspend = generic_ide_suspend, 1911 .suspend = generic_ide_suspend,
2171 .resume = generic_ide_resume, 1912 .resume = generic_ide_resume,
2172}; 1913};
2173 1914
1915EXPORT_SYMBOL_GPL(ide_bus_type);
1916
2174/* 1917/*
2175 * This is gets invoked once during initialization, to set *everything* up 1918 * This is gets invoked once during initialization, to set *everything* up
2176 */ 1919 */
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index 47225e324356..4e0f13d1d060 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -72,6 +72,7 @@ static struct amd_ide_chip {
72 { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, 0x50, AMD_UDMA_133 }, 72 { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, 0x50, AMD_UDMA_133 },
73 { PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, 0x50, AMD_UDMA_133 }, 73 { PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, 0x50, AMD_UDMA_133 },
74 { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, 0x50, AMD_UDMA_133 }, 74 { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, 0x50, AMD_UDMA_133 },
75 { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, 0x50, AMD_UDMA_133 },
75 { 0 } 76 { 0 }
76}; 77};
77 78
@@ -487,6 +488,7 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
487 /* 12 */ DECLARE_NV_DEV("NFORCE3-250-SATA2"), 488 /* 12 */ DECLARE_NV_DEV("NFORCE3-250-SATA2"),
488 /* 13 */ DECLARE_NV_DEV("NFORCE-CK804"), 489 /* 13 */ DECLARE_NV_DEV("NFORCE-CK804"),
489 /* 14 */ DECLARE_NV_DEV("NFORCE-MCP04"), 490 /* 14 */ DECLARE_NV_DEV("NFORCE-MCP04"),
491 /* 15 */ DECLARE_NV_DEV("NFORCE-MCP51"),
490}; 492};
491 493
492static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id) 494static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id)
@@ -521,6 +523,7 @@ static struct pci_device_id amd74xx_pci_tbl[] = {
521#endif 523#endif
522 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13 }, 524 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13 },
523 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 }, 525 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 },
526 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15 },
524 { 0, }, 527 { 0, },
525}; 528};
526MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl); 529MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl);
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 4651a22bf12e..af526b671c4e 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -34,7 +34,7 @@
34#include <linux/mm.h> 34#include <linux/mm.h>
35#include <linux/ioport.h> 35#include <linux/ioport.h>
36#include <linux/blkdev.h> 36#include <linux/blkdev.h>
37#include <linux/ioc4_common.h> 37#include <linux/ioc4.h>
38#include <asm/io.h> 38#include <asm/io.h>
39 39
40#include <linux/ide.h> 40#include <linux/ide.h>
@@ -715,14 +715,34 @@ static ide_pci_device_t sgiioc4_chipsets[] __devinitdata = {
715}; 715};
716 716
717int 717int
718ioc4_ide_attach_one(struct pci_dev *dev, const struct pci_device_id *id) 718ioc4_ide_attach_one(struct ioc4_driver_data *idd)
719{ 719{
720 return pci_init_sgiioc4(dev, &sgiioc4_chipsets[id->driver_data]); 720 return pci_init_sgiioc4(idd->idd_pdev,
721 &sgiioc4_chipsets[idd->idd_pci_id->driver_data]);
721} 722}
722 723
724static struct ioc4_submodule ioc4_ide_submodule = {
725 .is_name = "IOC4_ide",
726 .is_owner = THIS_MODULE,
727 .is_probe = ioc4_ide_attach_one,
728/* .is_remove = ioc4_ide_remove_one, */
729};
730
731static int __devinit
732ioc4_ide_init(void)
733{
734 return ioc4_register_submodule(&ioc4_ide_submodule);
735}
736
737static void __devexit
738ioc4_ide_exit(void)
739{
740 ioc4_unregister_submodule(&ioc4_ide_submodule);
741}
742
743module_init(ioc4_ide_init);
744module_exit(ioc4_ide_exit);
723 745
724MODULE_AUTHOR("Aniket Malatpure - Silicon Graphics Inc. (SGI)"); 746MODULE_AUTHOR("Aniket Malatpure - Silicon Graphics Inc. (SGI)");
725MODULE_DESCRIPTION("IDE PCI driver module for SGI IOC4 Base-IO Card"); 747MODULE_DESCRIPTION("IDE PCI driver module for SGI IOC4 Base-IO Card");
726MODULE_LICENSE("GPL"); 748MODULE_LICENSE("GPL");
727
728EXPORT_SYMBOL(ioc4_ide_attach_one);
diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
index 68c7a5f07842..4538b0235ca3 100644
--- a/drivers/ieee1394/dv1394.c
+++ b/drivers/ieee1394/dv1394.c
@@ -2343,8 +2343,8 @@ static void dv1394_remove_host (struct hpsb_host *host)
2343 dv1394_un_init(video); 2343 dv1394_un_init(video);
2344 } while (video != NULL); 2344 } while (video != NULL);
2345 2345
2346 class_simple_device_remove(MKDEV( 2346 class_device_destroy(hpsb_protocol_class,
2347 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2))); 2347 MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2)));
2348 devfs_remove("ieee1394/dv/host%d/NTSC", id); 2348 devfs_remove("ieee1394/dv/host%d/NTSC", id);
2349 devfs_remove("ieee1394/dv/host%d/PAL", id); 2349 devfs_remove("ieee1394/dv/host%d/PAL", id);
2350 devfs_remove("ieee1394/dv/host%d", id); 2350 devfs_remove("ieee1394/dv/host%d", id);
@@ -2361,7 +2361,7 @@ static void dv1394_add_host (struct hpsb_host *host)
2361 2361
2362 ohci = (struct ti_ohci *)host->hostdata; 2362 ohci = (struct ti_ohci *)host->hostdata;
2363 2363
2364 class_simple_device_add(hpsb_protocol_class, MKDEV( 2364 class_device_create(hpsb_protocol_class, MKDEV(
2365 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2)), 2365 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2)),
2366 NULL, "dv1394-%d", id); 2366 NULL, "dv1394-%d", id);
2367 devfs_mk_dir("ieee1394/dv/host%d", id); 2367 devfs_mk_dir("ieee1394/dv/host%d", id);
diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c
index a294e45c77cd..2d9a9b74e687 100644
--- a/drivers/ieee1394/ieee1394_core.c
+++ b/drivers/ieee1394/ieee1394_core.c
@@ -67,7 +67,7 @@ MODULE_LICENSE("GPL");
67 67
68/* Some globals used */ 68/* Some globals used */
69const char *hpsb_speedto_str[] = { "S100", "S200", "S400", "S800", "S1600", "S3200" }; 69const char *hpsb_speedto_str[] = { "S100", "S200", "S400", "S800", "S1600", "S3200" };
70struct class_simple *hpsb_protocol_class; 70struct class *hpsb_protocol_class;
71 71
72#ifdef CONFIG_IEEE1394_VERBOSEDEBUG 72#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
73static void dump_packet(const char *text, quadlet_t *data, int size) 73static void dump_packet(const char *text, quadlet_t *data, int size)
@@ -1121,7 +1121,7 @@ static int __init ieee1394_init(void)
1121 if (ret < 0) 1121 if (ret < 0)
1122 goto release_all_bus; 1122 goto release_all_bus;
1123 1123
1124 hpsb_protocol_class = class_simple_create(THIS_MODULE, "ieee1394_protocol"); 1124 hpsb_protocol_class = class_create(THIS_MODULE, "ieee1394_protocol");
1125 if (IS_ERR(hpsb_protocol_class)) { 1125 if (IS_ERR(hpsb_protocol_class)) {
1126 ret = PTR_ERR(hpsb_protocol_class); 1126 ret = PTR_ERR(hpsb_protocol_class);
1127 goto release_class_host; 1127 goto release_class_host;
@@ -1159,7 +1159,7 @@ static int __init ieee1394_init(void)
1159cleanup_csr: 1159cleanup_csr:
1160 cleanup_csr(); 1160 cleanup_csr();
1161release_class_protocol: 1161release_class_protocol:
1162 class_simple_destroy(hpsb_protocol_class); 1162 class_destroy(hpsb_protocol_class);
1163release_class_host: 1163release_class_host:
1164 class_unregister(&hpsb_host_class); 1164 class_unregister(&hpsb_host_class);
1165release_all_bus: 1165release_all_bus:
@@ -1189,7 +1189,7 @@ static void __exit ieee1394_cleanup(void)
1189 1189
1190 cleanup_csr(); 1190 cleanup_csr();
1191 1191
1192 class_simple_destroy(hpsb_protocol_class); 1192 class_destroy(hpsb_protocol_class);
1193 class_unregister(&hpsb_host_class); 1193 class_unregister(&hpsb_host_class);
1194 for (i = 0; fw_bus_attrs[i]; i++) 1194 for (i = 0; fw_bus_attrs[i]; i++)
1195 bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]); 1195 bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]);
diff --git a/drivers/ieee1394/ieee1394_core.h b/drivers/ieee1394/ieee1394_core.h
index c4b4408e2e05..73bd8efd2b6c 100644
--- a/drivers/ieee1394/ieee1394_core.h
+++ b/drivers/ieee1394/ieee1394_core.h
@@ -223,6 +223,7 @@ extern int hpsb_disable_irm;
223/* Our sysfs bus entry */ 223/* Our sysfs bus entry */
224extern struct bus_type ieee1394_bus_type; 224extern struct bus_type ieee1394_bus_type;
225extern struct class hpsb_host_class; 225extern struct class hpsb_host_class;
226extern struct class_simple *hpsb_protocol_class; 226extern struct class *hpsb_protocol_class;
227 227
228#endif /* _IEEE1394_CORE_H */ 228#endif /* _IEEE1394_CORE_H */
229
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 83e66ed97ab5..32abb6dda888 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -220,7 +220,7 @@ struct device nodemgr_dev_template_host = {
220 220
221 221
222#define fw_attr(class, class_type, field, type, format_string) \ 222#define fw_attr(class, class_type, field, type, format_string) \
223static ssize_t fw_show_##class##_##field (struct device *dev, char *buf)\ 223static ssize_t fw_show_##class##_##field (struct device *dev, struct device_attribute *attr, char *buf)\
224{ \ 224{ \
225 class_type *class; \ 225 class_type *class; \
226 class = container_of(dev, class_type, device); \ 226 class = container_of(dev, class_type, device); \
@@ -232,7 +232,7 @@ static struct device_attribute dev_attr_##class##_##field = { \
232}; 232};
233 233
234#define fw_attr_td(class, class_type, td_kv) \ 234#define fw_attr_td(class, class_type, td_kv) \
235static ssize_t fw_show_##class##_##td_kv (struct device *dev, char *buf)\ 235static ssize_t fw_show_##class##_##td_kv (struct device *dev, struct device_attribute *attr, char *buf)\
236{ \ 236{ \
237 int len; \ 237 int len; \
238 class_type *class = container_of(dev, class_type, device); \ 238 class_type *class = container_of(dev, class_type, device); \
@@ -265,7 +265,7 @@ static struct driver_attribute driver_attr_drv_##field = { \
265}; 265};
266 266
267 267
268static ssize_t fw_show_ne_bus_options(struct device *dev, char *buf) 268static ssize_t fw_show_ne_bus_options(struct device *dev, struct device_attribute *attr, char *buf)
269{ 269{
270 struct node_entry *ne = container_of(dev, struct node_entry, device); 270 struct node_entry *ne = container_of(dev, struct node_entry, device);
271 271
@@ -281,7 +281,7 @@ static ssize_t fw_show_ne_bus_options(struct device *dev, char *buf)
281static DEVICE_ATTR(bus_options,S_IRUGO,fw_show_ne_bus_options,NULL); 281static DEVICE_ATTR(bus_options,S_IRUGO,fw_show_ne_bus_options,NULL);
282 282
283 283
284static ssize_t fw_show_ne_tlabels_free(struct device *dev, char *buf) 284static ssize_t fw_show_ne_tlabels_free(struct device *dev, struct device_attribute *attr, char *buf)
285{ 285{
286 struct node_entry *ne = container_of(dev, struct node_entry, device); 286 struct node_entry *ne = container_of(dev, struct node_entry, device);
287 return sprintf(buf, "%d\n", atomic_read(&ne->tpool->count.count) + 1); 287 return sprintf(buf, "%d\n", atomic_read(&ne->tpool->count.count) + 1);
@@ -289,7 +289,7 @@ static ssize_t fw_show_ne_tlabels_free(struct device *dev, char *buf)
289static DEVICE_ATTR(tlabels_free,S_IRUGO,fw_show_ne_tlabels_free,NULL); 289static DEVICE_ATTR(tlabels_free,S_IRUGO,fw_show_ne_tlabels_free,NULL);
290 290
291 291
292static ssize_t fw_show_ne_tlabels_allocations(struct device *dev, char *buf) 292static ssize_t fw_show_ne_tlabels_allocations(struct device *dev, struct device_attribute *attr, char *buf)
293{ 293{
294 struct node_entry *ne = container_of(dev, struct node_entry, device); 294 struct node_entry *ne = container_of(dev, struct node_entry, device);
295 return sprintf(buf, "%u\n", ne->tpool->allocations); 295 return sprintf(buf, "%u\n", ne->tpool->allocations);
@@ -297,7 +297,7 @@ static ssize_t fw_show_ne_tlabels_allocations(struct device *dev, char *buf)
297static DEVICE_ATTR(tlabels_allocations,S_IRUGO,fw_show_ne_tlabels_allocations,NULL); 297static DEVICE_ATTR(tlabels_allocations,S_IRUGO,fw_show_ne_tlabels_allocations,NULL);
298 298
299 299
300static ssize_t fw_show_ne_tlabels_mask(struct device *dev, char *buf) 300static ssize_t fw_show_ne_tlabels_mask(struct device *dev, struct device_attribute *attr, char *buf)
301{ 301{
302 struct node_entry *ne = container_of(dev, struct node_entry, device); 302 struct node_entry *ne = container_of(dev, struct node_entry, device);
303#if (BITS_PER_LONG <= 32) 303#if (BITS_PER_LONG <= 32)
@@ -309,7 +309,7 @@ static ssize_t fw_show_ne_tlabels_mask(struct device *dev, char *buf)
309static DEVICE_ATTR(tlabels_mask, S_IRUGO, fw_show_ne_tlabels_mask, NULL); 309static DEVICE_ATTR(tlabels_mask, S_IRUGO, fw_show_ne_tlabels_mask, NULL);
310 310
311 311
312static ssize_t fw_set_ignore_driver(struct device *dev, const char *buf, size_t count) 312static ssize_t fw_set_ignore_driver(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
313{ 313{
314 struct unit_directory *ud = container_of(dev, struct unit_directory, device); 314 struct unit_directory *ud = container_of(dev, struct unit_directory, device);
315 int state = simple_strtoul(buf, NULL, 10); 315 int state = simple_strtoul(buf, NULL, 10);
@@ -324,7 +324,7 @@ static ssize_t fw_set_ignore_driver(struct device *dev, const char *buf, size_t
324 324
325 return count; 325 return count;
326} 326}
327static ssize_t fw_get_ignore_driver(struct device *dev, char *buf) 327static ssize_t fw_get_ignore_driver(struct device *dev, struct device_attribute *attr, char *buf)
328{ 328{
329 struct unit_directory *ud = container_of(dev, struct unit_directory, device); 329 struct unit_directory *ud = container_of(dev, struct unit_directory, device);
330 330
@@ -695,14 +695,15 @@ static void nodemgr_remove_ne(struct node_entry *ne)
695 put_device(dev); 695 put_device(dev);
696} 696}
697 697
698static int __nodemgr_remove_host_dev(struct device *dev, void *data)
699{
700 nodemgr_remove_ne(container_of(dev, struct node_entry, device));
701 return 0;
702}
698 703
699static void nodemgr_remove_host_dev(struct device *dev) 704static void nodemgr_remove_host_dev(struct device *dev)
700{ 705{
701 struct device *ne_dev, *next; 706 device_for_each_child(dev, NULL, __nodemgr_remove_host_dev);
702
703 list_for_each_entry_safe(ne_dev, next, &dev->children, node)
704 nodemgr_remove_ne(container_of(ne_dev, struct node_entry, device));
705
706 sysfs_remove_link(&dev->kobj, "irm_id"); 707 sysfs_remove_link(&dev->kobj, "irm_id");
707 sysfs_remove_link(&dev->kobj, "busmgr_id"); 708 sysfs_remove_link(&dev->kobj, "busmgr_id");
708 sysfs_remove_link(&dev->kobj, "host_id"); 709 sysfs_remove_link(&dev->kobj, "host_id");
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
index 6a08a8982ea8..7419af450bd1 100644
--- a/drivers/ieee1394/raw1394.c
+++ b/drivers/ieee1394/raw1394.c
@@ -2901,7 +2901,7 @@ static int __init init_raw1394(void)
2901 2901
2902 hpsb_register_highlevel(&raw1394_highlevel); 2902 hpsb_register_highlevel(&raw1394_highlevel);
2903 2903
2904 if (IS_ERR(class_simple_device_add(hpsb_protocol_class, MKDEV( 2904 if (IS_ERR(class_device_create(hpsb_protocol_class, MKDEV(
2905 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16), 2905 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16),
2906 NULL, RAW1394_DEVICE_NAME))) { 2906 NULL, RAW1394_DEVICE_NAME))) {
2907 ret = -EFAULT; 2907 ret = -EFAULT;
@@ -2934,8 +2934,8 @@ static int __init init_raw1394(void)
2934 2934
2935out_dev: 2935out_dev:
2936 devfs_remove(RAW1394_DEVICE_NAME); 2936 devfs_remove(RAW1394_DEVICE_NAME);
2937 class_simple_device_remove(MKDEV( 2937 class_device_destroy(hpsb_protocol_class,
2938 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16)); 2938 MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16));
2939out_unreg: 2939out_unreg:
2940 hpsb_unregister_highlevel(&raw1394_highlevel); 2940 hpsb_unregister_highlevel(&raw1394_highlevel);
2941out: 2941out:
@@ -2944,8 +2944,8 @@ out:
2944 2944
2945static void __exit cleanup_raw1394(void) 2945static void __exit cleanup_raw1394(void)
2946{ 2946{
2947 class_simple_device_remove(MKDEV( 2947 class_device_destroy(hpsb_protocol_class,
2948 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16)); 2948 MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16));
2949 cdev_del(&raw1394_cdev); 2949 cdev_del(&raw1394_cdev);
2950 devfs_remove(RAW1394_DEVICE_NAME); 2950 devfs_remove(RAW1394_DEVICE_NAME);
2951 hpsb_unregister_highlevel(&raw1394_highlevel); 2951 hpsb_unregister_highlevel(&raw1394_highlevel);
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 00c7b958361a..32368f3428ec 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -745,7 +745,8 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud
745 list_add_tail(&scsi_id->scsi_list, &hi->scsi_ids); 745 list_add_tail(&scsi_id->scsi_list, &hi->scsi_ids);
746 746
747 /* Register our host with the SCSI stack. */ 747 /* Register our host with the SCSI stack. */
748 scsi_host = scsi_host_alloc(&scsi_driver_template, 0); 748 scsi_host = scsi_host_alloc(&scsi_driver_template,
749 sizeof (unsigned long));
749 if (!scsi_host) { 750 if (!scsi_host) {
750 SBP2_ERR("failed to register scsi host"); 751 SBP2_ERR("failed to register scsi host");
751 goto failed_alloc; 752 goto failed_alloc;
@@ -1070,7 +1071,7 @@ static int sbp2_handle_physdma_read(struct hpsb_host *host, int nodeid, quadlet_
1070static __inline__ int sbp2_command_conversion_device_type(u8 device_type) 1071static __inline__ int sbp2_command_conversion_device_type(u8 device_type)
1071{ 1072{
1072 return (((device_type == TYPE_DISK) || 1073 return (((device_type == TYPE_DISK) ||
1073 (device_type == TYPE_SDAD) || 1074 (device_type == TYPE_RBC) ||
1074 (device_type == TYPE_ROM)) ? 1:0); 1075 (device_type == TYPE_ROM)) ? 1:0);
1075} 1076}
1076 1077
@@ -2111,102 +2112,6 @@ static int sbp2_send_command(struct scsi_id_instance_data *scsi_id,
2111 */ 2112 */
2112static void sbp2_check_sbp2_command(struct scsi_id_instance_data *scsi_id, unchar *cmd) 2113static void sbp2_check_sbp2_command(struct scsi_id_instance_data *scsi_id, unchar *cmd)
2113{ 2114{
2114 unchar new_cmd[16];
2115 u8 device_type = SBP2_DEVICE_TYPE (scsi_id->sbp2_device_type_and_lun);
2116
2117 SBP2_DEBUG("sbp2_check_sbp2_command");
2118
2119 switch (*cmd) {
2120
2121 case READ_6:
2122
2123 if (sbp2_command_conversion_device_type(device_type)) {
2124
2125 SBP2_DEBUG("Convert READ_6 to READ_10");
2126
2127 /*
2128 * Need to turn read_6 into read_10
2129 */
2130 new_cmd[0] = 0x28;
2131 new_cmd[1] = (cmd[1] & 0xe0);
2132 new_cmd[2] = 0x0;
2133 new_cmd[3] = (cmd[1] & 0x1f);
2134 new_cmd[4] = cmd[2];
2135 new_cmd[5] = cmd[3];
2136 new_cmd[6] = 0x0;
2137 new_cmd[7] = 0x0;
2138 new_cmd[8] = cmd[4];
2139 new_cmd[9] = cmd[5];
2140
2141 memcpy(cmd, new_cmd, 10);
2142
2143 }
2144
2145 break;
2146
2147 case WRITE_6:
2148
2149 if (sbp2_command_conversion_device_type(device_type)) {
2150
2151 SBP2_DEBUG("Convert WRITE_6 to WRITE_10");
2152
2153 /*
2154 * Need to turn write_6 into write_10
2155 */
2156 new_cmd[0] = 0x2a;
2157 new_cmd[1] = (cmd[1] & 0xe0);
2158 new_cmd[2] = 0x0;
2159 new_cmd[3] = (cmd[1] & 0x1f);
2160 new_cmd[4] = cmd[2];
2161 new_cmd[5] = cmd[3];
2162 new_cmd[6] = 0x0;
2163 new_cmd[7] = 0x0;
2164 new_cmd[8] = cmd[4];
2165 new_cmd[9] = cmd[5];
2166
2167 memcpy(cmd, new_cmd, 10);
2168
2169 }
2170
2171 break;
2172
2173 case MODE_SENSE:
2174
2175 if (sbp2_command_conversion_device_type(device_type)) {
2176
2177 SBP2_DEBUG("Convert MODE_SENSE_6 to MODE_SENSE_10");
2178
2179 /*
2180 * Need to turn mode_sense_6 into mode_sense_10
2181 */
2182 new_cmd[0] = 0x5a;
2183 new_cmd[1] = cmd[1];
2184 new_cmd[2] = cmd[2];
2185 new_cmd[3] = 0x0;
2186 new_cmd[4] = 0x0;
2187 new_cmd[5] = 0x0;
2188 new_cmd[6] = 0x0;
2189 new_cmd[7] = 0x0;
2190 new_cmd[8] = cmd[4];
2191 new_cmd[9] = cmd[5];
2192
2193 memcpy(cmd, new_cmd, 10);
2194
2195 }
2196
2197 break;
2198
2199 case MODE_SELECT:
2200
2201 /*
2202 * TODO. Probably need to change mode select to 10 byte version
2203 */
2204
2205 default:
2206 break;
2207 }
2208
2209 return;
2210} 2115}
2211 2116
2212/* 2117/*
@@ -2247,7 +2152,6 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,
2247 struct scsi_cmnd *SCpnt) 2152 struct scsi_cmnd *SCpnt)
2248{ 2153{
2249 u8 *scsi_buf = SCpnt->request_buffer; 2154 u8 *scsi_buf = SCpnt->request_buffer;
2250 u8 device_type = SBP2_DEVICE_TYPE (scsi_id->sbp2_device_type_and_lun);
2251 2155
2252 SBP2_DEBUG("sbp2_check_sbp2_response"); 2156 SBP2_DEBUG("sbp2_check_sbp2_response");
2253 2157
@@ -2272,14 +2176,6 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,
2272 } 2176 }
2273 2177
2274 /* 2178 /*
2275 * Check for Simple Direct Access Device and change it to TYPE_DISK
2276 */
2277 if ((scsi_buf[0] & 0x1f) == TYPE_SDAD) {
2278 SBP2_DEBUG("Changing TYPE_SDAD to TYPE_DISK");
2279 scsi_buf[0] &= 0xe0;
2280 }
2281
2282 /*
2283 * Fix ansi revision and response data format 2179 * Fix ansi revision and response data format
2284 */ 2180 */
2285 scsi_buf[2] |= 2; 2181 scsi_buf[2] |= 2;
@@ -2287,27 +2183,6 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,
2287 2183
2288 break; 2184 break;
2289 2185
2290 case MODE_SENSE:
2291
2292 if (sbp2_command_conversion_device_type(device_type)) {
2293
2294 SBP2_DEBUG("Modify mode sense response (10 byte version)");
2295
2296 scsi_buf[0] = scsi_buf[1]; /* Mode data length */
2297 scsi_buf[1] = scsi_buf[2]; /* Medium type */
2298 scsi_buf[2] = scsi_buf[3]; /* Device specific parameter */
2299 scsi_buf[3] = scsi_buf[7]; /* Block descriptor length */
2300 memcpy(scsi_buf + 4, scsi_buf + 8, scsi_buf[0]);
2301 }
2302
2303 break;
2304
2305 case MODE_SELECT:
2306
2307 /*
2308 * TODO. Probably need to change mode select to 10 byte version
2309 */
2310
2311 default: 2186 default:
2312 break; 2187 break;
2313 } 2188 }
@@ -2579,8 +2454,6 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id,
2579 u32 scsi_status, struct scsi_cmnd *SCpnt, 2454 u32 scsi_status, struct scsi_cmnd *SCpnt,
2580 void (*done)(struct scsi_cmnd *)) 2455 void (*done)(struct scsi_cmnd *))
2581{ 2456{
2582 unsigned long flags;
2583
2584 SBP2_DEBUG("sbp2scsi_complete_command"); 2457 SBP2_DEBUG("sbp2scsi_complete_command");
2585 2458
2586 /* 2459 /*
@@ -2679,18 +2552,15 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id,
2679 /* 2552 /*
2680 * Tell scsi stack that we're done with this command 2553 * Tell scsi stack that we're done with this command
2681 */ 2554 */
2682 spin_lock_irqsave(scsi_id->scsi_host->host_lock,flags);
2683 done (SCpnt); 2555 done (SCpnt);
2684 spin_unlock_irqrestore(scsi_id->scsi_host->host_lock,flags);
2685
2686 return;
2687} 2556}
2688 2557
2689 2558
2690static int sbp2scsi_slave_configure (struct scsi_device *sdev) 2559static int sbp2scsi_slave_configure (struct scsi_device *sdev)
2691{ 2560{
2692 blk_queue_dma_alignment(sdev->request_queue, (512 - 1)); 2561 blk_queue_dma_alignment(sdev->request_queue, (512 - 1));
2693 2562 sdev->use_10_for_rw = 1;
2563 sdev->use_10_for_ms = 1;
2694 return 0; 2564 return 0;
2695} 2565}
2696 2566
@@ -2746,7 +2616,7 @@ static int sbp2scsi_abort(struct scsi_cmnd *SCpnt)
2746/* 2616/*
2747 * Called by scsi stack when something has really gone wrong. 2617 * Called by scsi stack when something has really gone wrong.
2748 */ 2618 */
2749static int sbp2scsi_reset(struct scsi_cmnd *SCpnt) 2619static int __sbp2scsi_reset(struct scsi_cmnd *SCpnt)
2750{ 2620{
2751 struct scsi_id_instance_data *scsi_id = 2621 struct scsi_id_instance_data *scsi_id =
2752 (struct scsi_id_instance_data *)SCpnt->device->host->hostdata[0]; 2622 (struct scsi_id_instance_data *)SCpnt->device->host->hostdata[0];
@@ -2761,12 +2631,24 @@ static int sbp2scsi_reset(struct scsi_cmnd *SCpnt)
2761 return(SUCCESS); 2631 return(SUCCESS);
2762} 2632}
2763 2633
2634static int sbp2scsi_reset(struct scsi_cmnd *SCpnt)
2635{
2636 unsigned long flags;
2637 int rc;
2638
2639 spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
2640 rc = __sbp2scsi_reset(SCpnt);
2641 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
2642
2643 return rc;
2644}
2645
2764static const char *sbp2scsi_info (struct Scsi_Host *host) 2646static const char *sbp2scsi_info (struct Scsi_Host *host)
2765{ 2647{
2766 return "SCSI emulation for IEEE-1394 SBP-2 Devices"; 2648 return "SCSI emulation for IEEE-1394 SBP-2 Devices";
2767} 2649}
2768 2650
2769static ssize_t sbp2_sysfs_ieee1394_id_show(struct device *dev, char *buf) 2651static ssize_t sbp2_sysfs_ieee1394_id_show(struct device *dev, struct device_attribute *attr, char *buf)
2770{ 2652{
2771 struct scsi_device *sdev; 2653 struct scsi_device *sdev;
2772 struct scsi_id_instance_data *scsi_id; 2654 struct scsi_id_instance_data *scsi_id;
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h
index a84b039a05b9..cd425be74841 100644
--- a/drivers/ieee1394/sbp2.h
+++ b/drivers/ieee1394/sbp2.h
@@ -266,10 +266,6 @@ struct sbp2_status_block {
266#define SBP2_MAX_UDS_PER_NODE 16 /* Maximum scsi devices per node */ 266#define SBP2_MAX_UDS_PER_NODE 16 /* Maximum scsi devices per node */
267#define SBP2_MAX_SECTORS 255 /* Max sectors supported */ 267#define SBP2_MAX_SECTORS 255 /* Max sectors supported */
268 268
269#ifndef TYPE_SDAD
270#define TYPE_SDAD 0x0e /* simplified direct access device */
271#endif
272
273/* 269/*
274 * SCSI direction table... 270 * SCSI direction table...
275 * (now used as a back-up in case the direction passed down from above is "unknown") 271 * (now used as a back-up in case the direction passed down from above is "unknown")
diff --git a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c
index d68c4658f2fc..06759b36afea 100644
--- a/drivers/ieee1394/video1394.c
+++ b/drivers/ieee1394/video1394.c
@@ -1370,7 +1370,7 @@ static void video1394_add_host (struct hpsb_host *host)
1370 hpsb_set_hostinfo_key(&video1394_highlevel, host, ohci->host->id); 1370 hpsb_set_hostinfo_key(&video1394_highlevel, host, ohci->host->id);
1371 1371
1372 minor = IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id; 1372 minor = IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id;
1373 class_simple_device_add(hpsb_protocol_class, MKDEV( 1373 class_device_create(hpsb_protocol_class, MKDEV(
1374 IEEE1394_MAJOR, minor), 1374 IEEE1394_MAJOR, minor),
1375 NULL, "%s-%d", VIDEO1394_DRIVER_NAME, ohci->host->id); 1375 NULL, "%s-%d", VIDEO1394_DRIVER_NAME, ohci->host->id);
1376 devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, minor), 1376 devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, minor),
@@ -1384,7 +1384,7 @@ static void video1394_remove_host (struct hpsb_host *host)
1384 struct ti_ohci *ohci = hpsb_get_hostinfo(&video1394_highlevel, host); 1384 struct ti_ohci *ohci = hpsb_get_hostinfo(&video1394_highlevel, host);
1385 1385
1386 if (ohci) { 1386 if (ohci) {
1387 class_simple_device_remove(MKDEV(IEEE1394_MAJOR, 1387 class_device_destroy(hpsb_protocol_class, MKDEV(IEEE1394_MAJOR,
1388 IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id)); 1388 IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id));
1389 devfs_remove("%s/%d", VIDEO1394_DRIVER_NAME, ohci->host->id); 1389 devfs_remove("%s/%d", VIDEO1394_DRIVER_NAME, ohci->host->id);
1390 } 1390 }
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 3a413f72ff6d..90d51b179abe 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -40,9 +40,7 @@ struct ib_port {
40 struct kobject kobj; 40 struct kobject kobj;
41 struct ib_device *ibdev; 41 struct ib_device *ibdev;
42 struct attribute_group gid_group; 42 struct attribute_group gid_group;
43 struct attribute **gid_attr;
44 struct attribute_group pkey_group; 43 struct attribute_group pkey_group;
45 struct attribute **pkey_attr;
46 u8 port_num; 44 u8 port_num;
47}; 45};
48 46
@@ -60,8 +58,9 @@ struct port_attribute port_attr_##_name = __ATTR(_name, _mode, _show, _store)
60struct port_attribute port_attr_##_name = __ATTR_RO(_name) 58struct port_attribute port_attr_##_name = __ATTR_RO(_name)
61 59
62struct port_table_attribute { 60struct port_table_attribute {
63 struct port_attribute attr; 61 struct port_attribute attr;
64 int index; 62 char name[8];
63 int index;
65}; 64};
66 65
67static ssize_t port_attr_show(struct kobject *kobj, 66static ssize_t port_attr_show(struct kobject *kobj,
@@ -72,7 +71,7 @@ static ssize_t port_attr_show(struct kobject *kobj,
72 struct ib_port *p = container_of(kobj, struct ib_port, kobj); 71 struct ib_port *p = container_of(kobj, struct ib_port, kobj);
73 72
74 if (!port_attr->show) 73 if (!port_attr->show)
75 return 0; 74 return -EIO;
76 75
77 return port_attr->show(p, port_attr, buf); 76 return port_attr->show(p, port_attr, buf);
78} 77}
@@ -398,17 +397,16 @@ static void ib_port_release(struct kobject *kobj)
398 struct attribute *a; 397 struct attribute *a;
399 int i; 398 int i;
400 399
401 for (i = 0; (a = p->gid_attr[i]); ++i) { 400 for (i = 0; (a = p->gid_group.attrs[i]); ++i)
402 kfree(a->name);
403 kfree(a); 401 kfree(a);
404 }
405 402
406 for (i = 0; (a = p->pkey_attr[i]); ++i) { 403 kfree(p->gid_group.attrs);
407 kfree(a->name); 404
405 for (i = 0; (a = p->pkey_group.attrs[i]); ++i)
408 kfree(a); 406 kfree(a);
409 }
410 407
411 kfree(p->gid_attr); 408 kfree(p->pkey_group.attrs);
409
412 kfree(p); 410 kfree(p);
413} 411}
414 412
@@ -449,58 +447,45 @@ static int ib_device_hotplug(struct class_device *cdev, char **envp,
449 return 0; 447 return 0;
450} 448}
451 449
452static int alloc_group(struct attribute ***attr, 450static struct attribute **
453 ssize_t (*show)(struct ib_port *, 451alloc_group_attrs(ssize_t (*show)(struct ib_port *,
454 struct port_attribute *, char *buf), 452 struct port_attribute *, char *buf),
455 int len) 453 int len)
456{ 454{
457 struct port_table_attribute ***tab_attr = 455 struct attribute **tab_attr;
458 (struct port_table_attribute ***) attr; 456 struct port_table_attribute *element;
459 int i; 457 int i;
460 int ret;
461
462 *tab_attr = kmalloc((1 + len) * sizeof *tab_attr, GFP_KERNEL);
463 if (!*tab_attr)
464 return -ENOMEM;
465 458
466 memset(*tab_attr, 0, (1 + len) * sizeof *tab_attr); 459 tab_attr = kcalloc(1 + len, sizeof(struct attribute *), GFP_KERNEL);
460 if (!tab_attr)
461 return NULL;
467 462
468 for (i = 0; i < len; ++i) { 463 for (i = 0; i < len; i++) {
469 (*tab_attr)[i] = kmalloc(sizeof *(*tab_attr)[i], GFP_KERNEL); 464 element = kcalloc(1, sizeof(struct port_table_attribute),
470 if (!(*tab_attr)[i]) { 465 GFP_KERNEL);
471 ret = -ENOMEM; 466 if (!element)
472 goto err; 467 goto err;
473 }
474 memset((*tab_attr)[i], 0, sizeof *(*tab_attr)[i]);
475 (*tab_attr)[i]->attr.attr.name = kmalloc(8, GFP_KERNEL);
476 if (!(*tab_attr)[i]->attr.attr.name) {
477 ret = -ENOMEM;
478 goto err;
479 }
480 468
481 if (snprintf((*tab_attr)[i]->attr.attr.name, 8, "%d", i) >= 8) { 469 if (snprintf(element->name, sizeof(element->name),
482 ret = -ENOMEM; 470 "%d", i) >= sizeof(element->name))
483 goto err; 471 goto err;
484 }
485 472
486 (*tab_attr)[i]->attr.attr.mode = S_IRUGO; 473 element->attr.attr.name = element->name;
487 (*tab_attr)[i]->attr.attr.owner = THIS_MODULE; 474 element->attr.attr.mode = S_IRUGO;
488 (*tab_attr)[i]->attr.show = show; 475 element->attr.attr.owner = THIS_MODULE;
489 (*tab_attr)[i]->index = i; 476 element->attr.show = show;
490 } 477 element->index = i;
491
492 return 0;
493 478
494err: 479 tab_attr[i] = &element->attr.attr;
495 for (i = 0; i < len; ++i) {
496 if ((*tab_attr)[i])
497 kfree((*tab_attr)[i]->attr.attr.name);
498 kfree((*tab_attr)[i]);
499 } 480 }
500 481
501 kfree(*tab_attr); 482 return tab_attr;
502 483
503 return ret; 484err:
485 while (--i >= 0)
486 kfree(tab_attr[i]);
487 kfree(tab_attr);
488 return NULL;
504} 489}
505 490
506static int add_port(struct ib_device *device, int port_num) 491static int add_port(struct ib_device *device, int port_num)
@@ -541,23 +526,20 @@ static int add_port(struct ib_device *device, int port_num)
541 if (ret) 526 if (ret)
542 goto err_put; 527 goto err_put;
543 528
544 ret = alloc_group(&p->gid_attr, show_port_gid, attr.gid_tbl_len);
545 if (ret)
546 goto err_remove_pma;
547
548 p->gid_group.name = "gids"; 529 p->gid_group.name = "gids";
549 p->gid_group.attrs = p->gid_attr; 530 p->gid_group.attrs = alloc_group_attrs(show_port_gid, attr.gid_tbl_len);
531 if (!p->gid_group.attrs)
532 goto err_remove_pma;
550 533
551 ret = sysfs_create_group(&p->kobj, &p->gid_group); 534 ret = sysfs_create_group(&p->kobj, &p->gid_group);
552 if (ret) 535 if (ret)
553 goto err_free_gid; 536 goto err_free_gid;
554 537
555 ret = alloc_group(&p->pkey_attr, show_port_pkey, attr.pkey_tbl_len);
556 if (ret)
557 goto err_remove_gid;
558
559 p->pkey_group.name = "pkeys"; 538 p->pkey_group.name = "pkeys";
560 p->pkey_group.attrs = p->pkey_attr; 539 p->pkey_group.attrs = alloc_group_attrs(show_port_pkey,
540 attr.pkey_tbl_len);
541 if (!p->pkey_group.attrs)
542 goto err_remove_gid;
561 543
562 ret = sysfs_create_group(&p->kobj, &p->pkey_group); 544 ret = sysfs_create_group(&p->kobj, &p->pkey_group);
563 if (ret) 545 if (ret)
@@ -568,23 +550,19 @@ static int add_port(struct ib_device *device, int port_num)
568 return 0; 550 return 0;
569 551
570err_free_pkey: 552err_free_pkey:
571 for (i = 0; i < attr.pkey_tbl_len; ++i) { 553 for (i = 0; i < attr.pkey_tbl_len; ++i)
572 kfree(p->pkey_attr[i]->name); 554 kfree(p->pkey_group.attrs[i]);
573 kfree(p->pkey_attr[i]);
574 }
575 555
576 kfree(p->pkey_attr); 556 kfree(p->pkey_group.attrs);
577 557
578err_remove_gid: 558err_remove_gid:
579 sysfs_remove_group(&p->kobj, &p->gid_group); 559 sysfs_remove_group(&p->kobj, &p->gid_group);
580 560
581err_free_gid: 561err_free_gid:
582 for (i = 0; i < attr.gid_tbl_len; ++i) { 562 for (i = 0; i < attr.gid_tbl_len; ++i)
583 kfree(p->gid_attr[i]->name); 563 kfree(p->gid_group.attrs[i]);
584 kfree(p->gid_attr[i]);
585 }
586 564
587 kfree(p->gid_attr); 565 kfree(p->gid_group.attrs);
588 566
589err_remove_pma: 567err_remove_pma:
590 sysfs_remove_group(&p->kobj, &pma_group); 568 sysfs_remove_group(&p->kobj, &pma_group);
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 17552a29978b..556264b43425 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -431,9 +431,9 @@ static struct input_handle *evdev_connect(struct input_handler *handler, struct
431 431
432 devfs_mk_cdev(MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor), 432 devfs_mk_cdev(MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor),
433 S_IFCHR|S_IRUGO|S_IWUSR, "input/event%d", minor); 433 S_IFCHR|S_IRUGO|S_IWUSR, "input/event%d", minor);
434 class_simple_device_add(input_class, 434 class_device_create(input_class,
435 MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor), 435 MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor),
436 dev->dev, "event%d", minor); 436 dev->dev, "event%d", minor);
437 437
438 return &evdev->handle; 438 return &evdev->handle;
439} 439}
@@ -443,7 +443,8 @@ static void evdev_disconnect(struct input_handle *handle)
443 struct evdev *evdev = handle->private; 443 struct evdev *evdev = handle->private;
444 struct evdev_list *list; 444 struct evdev_list *list;
445 445
446 class_simple_device_remove(MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + evdev->minor)); 446 class_device_destroy(input_class,
447 MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + evdev->minor));
447 devfs_remove("input/event%d", evdev->minor); 448 devfs_remove("input/event%d", evdev->minor);
448 evdev->exist = 0; 449 evdev->exist = 0;
449 450
diff --git a/drivers/input/gameport/Kconfig b/drivers/input/gameport/Kconfig
index 6282f460aba0..1d93f5092904 100644
--- a/drivers/input/gameport/Kconfig
+++ b/drivers/input/gameport/Kconfig
@@ -68,23 +68,3 @@ config GAMEPORT_CS461X
68 depends on PCI 68 depends on PCI
69 69
70endif 70endif
71
72# Yes, SOUND_GAMEPORT looks a bit odd. Yes, it ends up being turned on
73# in every .config. Please don't touch it. It is here to handle an
74# unusual dependency between GAMEPORT and sound drivers.
75#
76# Some sound drivers call gameport functions. If GAMEPORT is
77# not selected, empty stubs are provided for the functions and all is
78# well.
79# If GAMEPORT is built in, everything is fine.
80# If GAMEPORT is a module, however, it would need to be loaded for the
81# sound driver to be able to link properly. Therefore, the sound
82# driver must be a module as well in that case. Since there's no way
83# to express that directly in Kconfig, we use SOUND_GAMEPORT to
84# express it. SOUND_GAMEPORT boils down to "if GAMEPORT is 'm',
85# anything that depends on SOUND_GAMEPORT must be 'm' as well. if
86# GAMEPORT is 'y' or 'n', it can be anything".
87config SOUND_GAMEPORT
88 tristate
89 default m if GAMEPORT=m
90 default y
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index f20c3f23388b..e152d0fa0cdd 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -134,7 +134,7 @@ static int gameport_measure_speed(struct gameport *gameport)
134 } 134 }
135 135
136 gameport_close(gameport); 136 gameport_close(gameport);
137 return (cpu_data[_smp_processor_id()].loops_per_jiffy * (unsigned long)HZ / (1000 / 50)) / (tx < 1 ? 1 : tx); 137 return (cpu_data[raw_smp_processor_id()].loops_per_jiffy * (unsigned long)HZ / (1000 / 50)) / (tx < 1 ? 1 : tx);
138 138
139#else 139#else
140 140
@@ -453,13 +453,13 @@ static int gameport_thread(void *nothing)
453 * Gameport port operations 453 * Gameport port operations
454 */ 454 */
455 455
456static ssize_t gameport_show_description(struct device *dev, char *buf) 456static ssize_t gameport_show_description(struct device *dev, struct device_attribute *attr, char *buf)
457{ 457{
458 struct gameport *gameport = to_gameport_port(dev); 458 struct gameport *gameport = to_gameport_port(dev);
459 return sprintf(buf, "%s\n", gameport->name); 459 return sprintf(buf, "%s\n", gameport->name);
460} 460}
461 461
462static ssize_t gameport_rebind_driver(struct device *dev, const char *buf, size_t count) 462static ssize_t gameport_rebind_driver(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
463{ 463{
464 struct gameport *gameport = to_gameport_port(dev); 464 struct gameport *gameport = to_gameport_port(dev);
465 struct device_driver *drv; 465 struct device_driver *drv;
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 3385dd03abfc..83c77c990dda 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -702,13 +702,13 @@ static int __init input_proc_init(void)
702static inline int input_proc_init(void) { return 0; } 702static inline int input_proc_init(void) { return 0; }
703#endif 703#endif
704 704
705struct class_simple *input_class; 705struct class *input_class;
706 706
707static int __init input_init(void) 707static int __init input_init(void)
708{ 708{
709 int retval = -ENOMEM; 709 int retval = -ENOMEM;
710 710
711 input_class = class_simple_create(THIS_MODULE, "input"); 711 input_class = class_create(THIS_MODULE, "input");
712 if (IS_ERR(input_class)) 712 if (IS_ERR(input_class))
713 return PTR_ERR(input_class); 713 return PTR_ERR(input_class);
714 input_proc_init(); 714 input_proc_init();
@@ -718,7 +718,7 @@ static int __init input_init(void)
718 remove_proc_entry("devices", proc_bus_input_dir); 718 remove_proc_entry("devices", proc_bus_input_dir);
719 remove_proc_entry("handlers", proc_bus_input_dir); 719 remove_proc_entry("handlers", proc_bus_input_dir);
720 remove_proc_entry("input", proc_bus); 720 remove_proc_entry("input", proc_bus);
721 class_simple_destroy(input_class); 721 class_destroy(input_class);
722 return retval; 722 return retval;
723 } 723 }
724 724
@@ -728,7 +728,7 @@ static int __init input_init(void)
728 remove_proc_entry("handlers", proc_bus_input_dir); 728 remove_proc_entry("handlers", proc_bus_input_dir);
729 remove_proc_entry("input", proc_bus); 729 remove_proc_entry("input", proc_bus);
730 unregister_chrdev(INPUT_MAJOR, "input"); 730 unregister_chrdev(INPUT_MAJOR, "input");
731 class_simple_destroy(input_class); 731 class_destroy(input_class);
732 } 732 }
733 return retval; 733 return retval;
734} 734}
@@ -741,7 +741,7 @@ static void __exit input_exit(void)
741 741
742 devfs_remove("input"); 742 devfs_remove("input");
743 unregister_chrdev(INPUT_MAJOR, "input"); 743 unregister_chrdev(INPUT_MAJOR, "input");
744 class_simple_destroy(input_class); 744 class_destroy(input_class);
745} 745}
746 746
747subsys_initcall(input_init); 747subsys_initcall(input_init);
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 7d7527f8b02d..39775fc380c7 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -422,7 +422,7 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct
422 joydev->nkey++; 422 joydev->nkey++;
423 } 423 }
424 424
425 for (i = 0; i < BTN_JOYSTICK - BTN_MISC + 1; i++) 425 for (i = 0; i < BTN_JOYSTICK - BTN_MISC; i++)
426 if (test_bit(i + BTN_MISC, dev->keybit)) { 426 if (test_bit(i + BTN_MISC, dev->keybit)) {
427 joydev->keymap[i] = joydev->nkey; 427 joydev->keymap[i] = joydev->nkey;
428 joydev->keypam[joydev->nkey] = i + BTN_MISC; 428 joydev->keypam[joydev->nkey] = i + BTN_MISC;
@@ -452,9 +452,9 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct
452 452
453 devfs_mk_cdev(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor), 453 devfs_mk_cdev(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
454 S_IFCHR|S_IRUGO|S_IWUSR, "input/js%d", minor); 454 S_IFCHR|S_IRUGO|S_IWUSR, "input/js%d", minor);
455 class_simple_device_add(input_class, 455 class_device_create(input_class,
456 MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor), 456 MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
457 dev->dev, "js%d", minor); 457 dev->dev, "js%d", minor);
458 458
459 return &joydev->handle; 459 return &joydev->handle;
460} 460}
@@ -464,7 +464,7 @@ static void joydev_disconnect(struct input_handle *handle)
464 struct joydev *joydev = handle->private; 464 struct joydev *joydev = handle->private;
465 struct joydev_list *list; 465 struct joydev_list *list;
466 466
467 class_simple_device_remove(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + joydev->minor)); 467 class_device_destroy(input_class, MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + joydev->minor));
468 devfs_remove("input/js%d", joydev->minor); 468 devfs_remove("input/js%d", joydev->minor);
469 joydev->exist = 0; 469 joydev->exist = 0;
470 470
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 79c332f16fc7..82fad9a23ace 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -54,7 +54,7 @@ static int atkbd_softraw = 1;
54module_param_named(softraw, atkbd_softraw, bool, 0); 54module_param_named(softraw, atkbd_softraw, bool, 0);
55MODULE_PARM_DESC(softraw, "Use software generated rawmode"); 55MODULE_PARM_DESC(softraw, "Use software generated rawmode");
56 56
57static int atkbd_scroll = 1; 57static int atkbd_scroll = 0;
58module_param_named(scroll, atkbd_scroll, bool, 0); 58module_param_named(scroll, atkbd_scroll, bool, 0);
59MODULE_PARM_DESC(scroll, "Enable scroll-wheel on MS Office and similar keyboards"); 59MODULE_PARM_DESC(scroll, "Enable scroll-wheel on MS Office and similar keyboards");
60 60
@@ -171,9 +171,9 @@ static struct {
171 unsigned char set2; 171 unsigned char set2;
172} atkbd_scroll_keys[] = { 172} atkbd_scroll_keys[] = {
173 { ATKBD_SCR_1, 0xc5 }, 173 { ATKBD_SCR_1, 0xc5 },
174 { ATKBD_SCR_2, 0xa9 }, 174 { ATKBD_SCR_2, 0x9d },
175 { ATKBD_SCR_4, 0xb6 }, 175 { ATKBD_SCR_4, 0xa4 },
176 { ATKBD_SCR_8, 0xa7 }, 176 { ATKBD_SCR_8, 0x9b },
177 { ATKBD_SCR_CLICK, 0xe0 }, 177 { ATKBD_SCR_CLICK, 0xe0 },
178 { ATKBD_SCR_LEFT, 0xcb }, 178 { ATKBD_SCR_LEFT, 0xcb },
179 { ATKBD_SCR_RIGHT, 0xd2 }, 179 { ATKBD_SCR_RIGHT, 0xd2 },
@@ -219,11 +219,11 @@ static ssize_t atkbd_attr_set_helper(struct device *dev, const char *buf, size_t
219#define ATKBD_DEFINE_ATTR(_name) \ 219#define ATKBD_DEFINE_ATTR(_name) \
220static ssize_t atkbd_show_##_name(struct atkbd *, char *); \ 220static ssize_t atkbd_show_##_name(struct atkbd *, char *); \
221static ssize_t atkbd_set_##_name(struct atkbd *, const char *, size_t); \ 221static ssize_t atkbd_set_##_name(struct atkbd *, const char *, size_t); \
222static ssize_t atkbd_do_show_##_name(struct device *d, char *b) \ 222static ssize_t atkbd_do_show_##_name(struct device *d, struct device_attribute *attr, char *b) \
223{ \ 223{ \
224 return atkbd_attr_show_helper(d, b, atkbd_show_##_name); \ 224 return atkbd_attr_show_helper(d, b, atkbd_show_##_name); \
225} \ 225} \
226static ssize_t atkbd_do_set_##_name(struct device *d, const char *b, size_t s) \ 226static ssize_t atkbd_do_set_##_name(struct device *d, struct device_attribute *attr, const char *b, size_t s) \
227{ \ 227{ \
228 return atkbd_attr_set_helper(d, b, s, atkbd_set_##_name); \ 228 return atkbd_attr_set_helper(d, b, s, atkbd_set_##_name); \
229} \ 229} \
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 42a9f7f6f8cb..7bf4be733e9a 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -352,7 +352,7 @@ static int alps_reconnect(struct psmouse *psmouse)
352 if (alps_get_status(psmouse, param)) 352 if (alps_get_status(psmouse, param))
353 return -1; 353 return -1;
354 354
355 if (param[0] & 0x04) 355 if (!(param[0] & 0x04))
356 alps_tap_mode(psmouse, 1); 356 alps_tap_mode(psmouse, 1);
357 357
358 if (alps_absolute_mode(psmouse)) { 358 if (alps_absolute_mode(psmouse)) {
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index cd8509549eac..019034b21a0b 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -518,13 +518,16 @@ static int psmouse_probe(struct psmouse *psmouse)
518/* 518/*
519 * First, we check if it's a mouse. It should send 0x00 or 0x03 519 * First, we check if it's a mouse. It should send 0x00 or 0x03
520 * in case of an IntelliMouse in 4-byte mode or 0x04 for IM Explorer. 520 * in case of an IntelliMouse in 4-byte mode or 0x04 for IM Explorer.
521 * Sunrex K8561 IR Keyboard/Mouse reports 0xff on second and subsequent
522 * ID queries, probably due to a firmware bug.
521 */ 523 */
522 524
523 param[0] = 0xa5; 525 param[0] = 0xa5;
524 if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID)) 526 if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
525 return -1; 527 return -1;
526 528
527 if (param[0] != 0x00 && param[0] != 0x03 && param[0] != 0x04) 529 if (param[0] != 0x00 && param[0] != 0x03 &&
530 param[0] != 0x04 && param[0] != 0xff)
528 return -1; 531 return -1;
529 532
530/* 533/*
@@ -972,7 +975,7 @@ static int psmouse_set_maxproto(const char *val, struct kernel_param *kp)
972 return -EINVAL; 975 return -EINVAL;
973 976
974 if (!strncmp(val, "any", 3)) { 977 if (!strncmp(val, "any", 3)) {
975 *((unsigned int *)kp->arg) = -1UL; 978 *((unsigned int *)kp->arg) = -1U;
976 return 0; 979 return 0;
977 } 980 }
978 981
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
index bda5b065d03c..79e17a0c4664 100644
--- a/drivers/input/mouse/psmouse.h
+++ b/drivers/input/mouse/psmouse.h
@@ -91,11 +91,11 @@ ssize_t psmouse_attr_set_helper(struct device *dev, const char *buf, size_t coun
91#define PSMOUSE_DEFINE_ATTR(_name) \ 91#define PSMOUSE_DEFINE_ATTR(_name) \
92static ssize_t psmouse_attr_show_##_name(struct psmouse *, char *); \ 92static ssize_t psmouse_attr_show_##_name(struct psmouse *, char *); \
93static ssize_t psmouse_attr_set_##_name(struct psmouse *, const char *, size_t);\ 93static ssize_t psmouse_attr_set_##_name(struct psmouse *, const char *, size_t);\
94static ssize_t psmouse_do_show_##_name(struct device *d, char *b) \ 94static ssize_t psmouse_do_show_##_name(struct device *d, struct device_attribute *attr, char *b) \
95{ \ 95{ \
96 return psmouse_attr_show_helper(d, b, psmouse_attr_show_##_name); \ 96 return psmouse_attr_show_helper(d, b, psmouse_attr_show_##_name); \
97} \ 97} \
98static ssize_t psmouse_do_set_##_name(struct device *d, const char *b, size_t s)\ 98static ssize_t psmouse_do_set_##_name(struct device *d, struct device_attribute *attr, const char *b, size_t s)\
99{ \ 99{ \
100 return psmouse_attr_set_helper(d, b, s, psmouse_attr_set_##_name); \ 100 return psmouse_attr_set_helper(d, b, s, psmouse_attr_set_##_name); \
101} \ 101} \
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 69832f8fb720..36c721227b68 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -143,39 +143,6 @@ static int synaptics_identify(struct psmouse *psmouse)
143 return -1; 143 return -1;
144} 144}
145 145
146static void print_ident(struct synaptics_data *priv)
147{
148 printk(KERN_INFO "Synaptics Touchpad, model: %ld\n", SYN_ID_MODEL(priv->identity));
149 printk(KERN_INFO " Firmware: %ld.%ld\n", SYN_ID_MAJOR(priv->identity),
150 SYN_ID_MINOR(priv->identity));
151 if (SYN_MODEL_ROT180(priv->model_id))
152 printk(KERN_INFO " 180 degree mounted touchpad\n");
153 if (SYN_MODEL_PORTRAIT(priv->model_id))
154 printk(KERN_INFO " portrait touchpad\n");
155 printk(KERN_INFO " Sensor: %ld\n", SYN_MODEL_SENSOR(priv->model_id));
156 if (SYN_MODEL_NEWABS(priv->model_id))
157 printk(KERN_INFO " new absolute packet format\n");
158 if (SYN_MODEL_PEN(priv->model_id))
159 printk(KERN_INFO " pen detection\n");
160
161 if (SYN_CAP_EXTENDED(priv->capabilities)) {
162 printk(KERN_INFO " Touchpad has extended capability bits\n");
163 if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
164 printk(KERN_INFO " -> %d multi-buttons, i.e. besides standard buttons\n",
165 (int)(SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap)));
166 if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities))
167 printk(KERN_INFO " -> middle button\n");
168 if (SYN_CAP_FOUR_BUTTON(priv->capabilities))
169 printk(KERN_INFO " -> four buttons\n");
170 if (SYN_CAP_MULTIFINGER(priv->capabilities))
171 printk(KERN_INFO " -> multifinger detection\n");
172 if (SYN_CAP_PALMDETECT(priv->capabilities))
173 printk(KERN_INFO " -> palm detection\n");
174 if (SYN_CAP_PASS_THROUGH(priv->capabilities))
175 printk(KERN_INFO " -> pass-through port\n");
176 }
177}
178
179static int synaptics_query_hardware(struct psmouse *psmouse) 146static int synaptics_query_hardware(struct psmouse *psmouse)
180{ 147{
181 int retries = 0; 148 int retries = 0;
@@ -666,7 +633,11 @@ int synaptics_init(struct psmouse *psmouse)
666 633
667 priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS; 634 priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS;
668 635
669 print_ident(priv); 636 printk(KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx\n",
637 SYN_ID_MODEL(priv->identity),
638 SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity),
639 priv->model_id, priv->capabilities, priv->ext_cap);
640
670 set_input_params(&psmouse->dev, priv); 641 set_input_params(&psmouse->dev, priv);
671 642
672 psmouse->protocol_handler = synaptics_process_byte; 643 psmouse->protocol_handler = synaptics_process_byte;
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index 564974ce5793..062848ac7e6b 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -101,6 +101,7 @@ struct mousedev_list {
101 unsigned char ready, buffer, bufsiz; 101 unsigned char ready, buffer, bufsiz;
102 unsigned char imexseq, impsseq; 102 unsigned char imexseq, impsseq;
103 enum mousedev_emul mode; 103 enum mousedev_emul mode;
104 unsigned long last_buttons;
104}; 105};
105 106
106#define MOUSEDEV_SEQ_LEN 6 107#define MOUSEDEV_SEQ_LEN 6
@@ -224,7 +225,7 @@ static void mousedev_notify_readers(struct mousedev *mousedev, struct mousedev_h
224 spin_lock_irqsave(&list->packet_lock, flags); 225 spin_lock_irqsave(&list->packet_lock, flags);
225 226
226 p = &list->packets[list->head]; 227 p = &list->packets[list->head];
227 if (list->ready && p->buttons != packet->buttons) { 228 if (list->ready && p->buttons != mousedev->packet.buttons) {
228 unsigned int new_head = (list->head + 1) % PACKET_QUEUE_LEN; 229 unsigned int new_head = (list->head + 1) % PACKET_QUEUE_LEN;
229 if (new_head != list->tail) { 230 if (new_head != list->tail) {
230 p = &list->packets[list->head = new_head]; 231 p = &list->packets[list->head = new_head];
@@ -249,10 +250,13 @@ static void mousedev_notify_readers(struct mousedev *mousedev, struct mousedev_h
249 p->dz += packet->dz; 250 p->dz += packet->dz;
250 p->buttons = mousedev->packet.buttons; 251 p->buttons = mousedev->packet.buttons;
251 252
252 list->ready = 1; 253 if (p->dx || p->dy || p->dz || p->buttons != list->last_buttons)
254 list->ready = 1;
253 255
254 spin_unlock_irqrestore(&list->packet_lock, flags); 256 spin_unlock_irqrestore(&list->packet_lock, flags);
255 kill_fasync(&list->fasync, SIGIO, POLL_IN); 257
258 if (list->ready)
259 kill_fasync(&list->fasync, SIGIO, POLL_IN);
256 } 260 }
257 261
258 wake_up_interruptible(&mousedev->wait); 262 wake_up_interruptible(&mousedev->wait);
@@ -477,9 +481,10 @@ static void mousedev_packet(struct mousedev_list *list, signed char *ps2_data)
477 } 481 }
478 482
479 if (!p->dx && !p->dy && !p->dz) { 483 if (!p->dx && !p->dy && !p->dz) {
480 if (list->tail == list->head) 484 if (list->tail == list->head) {
481 list->ready = 0; 485 list->ready = 0;
482 else 486 list->last_buttons = p->buttons;
487 } else
483 list->tail = (list->tail + 1) % PACKET_QUEUE_LEN; 488 list->tail = (list->tail + 1) % PACKET_QUEUE_LEN;
484 } 489 }
485 490
@@ -642,9 +647,9 @@ static struct input_handle *mousedev_connect(struct input_handler *handler, stru
642 647
643 devfs_mk_cdev(MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + minor), 648 devfs_mk_cdev(MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + minor),
644 S_IFCHR|S_IRUGO|S_IWUSR, "input/mouse%d", minor); 649 S_IFCHR|S_IRUGO|S_IWUSR, "input/mouse%d", minor);
645 class_simple_device_add(input_class, 650 class_device_create(input_class,
646 MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + minor), 651 MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + minor),
647 dev->dev, "mouse%d", minor); 652 dev->dev, "mouse%d", minor);
648 653
649 return &mousedev->handle; 654 return &mousedev->handle;
650} 655}
@@ -654,7 +659,8 @@ static void mousedev_disconnect(struct input_handle *handle)
654 struct mousedev *mousedev = handle->private; 659 struct mousedev *mousedev = handle->private;
655 struct mousedev_list *list; 660 struct mousedev_list *list;
656 661
657 class_simple_device_remove(MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + mousedev->minor)); 662 class_device_destroy(input_class,
663 MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + mousedev->minor));
658 devfs_remove("input/mouse%d", mousedev->minor); 664 devfs_remove("input/mouse%d", mousedev->minor);
659 mousedev->exist = 0; 665 mousedev->exist = 0;
660 666
@@ -730,8 +736,8 @@ static int __init mousedev_init(void)
730 736
731 devfs_mk_cdev(MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + MOUSEDEV_MIX), 737 devfs_mk_cdev(MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + MOUSEDEV_MIX),
732 S_IFCHR|S_IRUGO|S_IWUSR, "input/mice"); 738 S_IFCHR|S_IRUGO|S_IWUSR, "input/mice");
733 class_simple_device_add(input_class, MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + MOUSEDEV_MIX), 739 class_device_create(input_class,
734 NULL, "mice"); 740 MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + MOUSEDEV_MIX), NULL, "mice");
735 741
736#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX 742#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
737 if (!(psaux_registered = !misc_register(&psaux_mouse))) 743 if (!(psaux_registered = !misc_register(&psaux_mouse)))
@@ -750,7 +756,8 @@ static void __exit mousedev_exit(void)
750 misc_deregister(&psaux_mouse); 756 misc_deregister(&psaux_mouse);
751#endif 757#endif
752 devfs_remove("input/mice"); 758 devfs_remove("input/mice");
753 class_simple_device_remove(MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + MOUSEDEV_MIX)); 759 class_device_destroy(input_class,
760 MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + MOUSEDEV_MIX));
754 input_unregister_handler(&mousedev_handler); 761 input_unregister_handler(&mousedev_handler);
755} 762}
756 763
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index f64867808fea..0487ecbb8a49 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -88,9 +88,11 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
88}; 88};
89 89
90/* 90/*
91 * Some Fujitsu notebooks are ahving trouble with touhcpads if 91 * Some Fujitsu notebooks are having trouble with touchpads if
92 * active multiplexing mode is activated. Luckily they don't have 92 * active multiplexing mode is activated. Luckily they don't have
93 * external PS/2 ports so we can safely disable it. 93 * external PS/2 ports so we can safely disable it.
94 * ... apparently some Toshibas don't like MUX mode either and
95 * die horrible death on reboot.
94 */ 96 */
95static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = { 97static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
96 { 98 {
@@ -115,12 +117,26 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
115 }, 117 },
116 }, 118 },
117 { 119 {
120 .ident = "Fujitsu Lifebook S6230",
121 .matches = {
122 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
123 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
124 },
125 },
126 {
118 .ident = "Fujitsu T70H", 127 .ident = "Fujitsu T70H",
119 .matches = { 128 .matches = {
120 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 129 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
121 DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"), 130 DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
122 }, 131 },
123 }, 132 },
133 {
134 .ident = "Toshiba P10",
135 .matches = {
136 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
137 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
138 },
139 },
124 { } 140 { }
125}; 141};
126 142
@@ -215,11 +231,15 @@ static struct pnp_driver i8042_pnp_aux_driver = {
215 231
216static void i8042_pnp_exit(void) 232static void i8042_pnp_exit(void)
217{ 233{
218 if (i8042_pnp_kbd_registered) 234 if (i8042_pnp_kbd_registered) {
235 i8042_pnp_kbd_registered = 0;
219 pnp_unregister_driver(&i8042_pnp_kbd_driver); 236 pnp_unregister_driver(&i8042_pnp_kbd_driver);
237 }
220 238
221 if (i8042_pnp_aux_registered) 239 if (i8042_pnp_aux_registered) {
240 i8042_pnp_aux_registered = 0;
222 pnp_unregister_driver(&i8042_pnp_aux_driver); 241 pnp_unregister_driver(&i8042_pnp_aux_driver);
242 }
223} 243}
224 244
225static int i8042_pnp_init(void) 245static int i8042_pnp_init(void)
@@ -227,7 +247,7 @@ static int i8042_pnp_init(void)
227 int result_kbd, result_aux; 247 int result_kbd, result_aux;
228 248
229 if (i8042_nopnp) { 249 if (i8042_nopnp) {
230 printk("i8042: PNP detection disabled\n"); 250 printk(KERN_INFO "i8042: PNP detection disabled\n");
231 return 0; 251 return 0;
232 } 252 }
233 253
@@ -241,7 +261,7 @@ static int i8042_pnp_init(void)
241#if defined(__ia64__) 261#if defined(__ia64__)
242 return -ENODEV; 262 return -ENODEV;
243#else 263#else
244 printk(KERN_WARNING "PNP: No PS/2 controller found. Probing ports directly.\n"); 264 printk(KERN_INFO "PNP: No PS/2 controller found. Probing ports directly.\n");
245 return 0; 265 return 0;
246#endif 266#endif
247 } 267 }
@@ -265,7 +285,7 @@ static int i8042_pnp_init(void)
265 i8042_pnp_kbd_irq = i8042_kbd_irq; 285 i8042_pnp_kbd_irq = i8042_kbd_irq;
266 } 286 }
267 287
268 if (result_aux > 0 && !i8042_pnp_aux_irq) { 288 if (!i8042_pnp_aux_irq) {
269 printk(KERN_WARNING "PNP: PS/2 controller doesn't have AUX irq; using default %#x\n", i8042_aux_irq); 289 printk(KERN_WARNING "PNP: PS/2 controller doesn't have AUX irq; using default %#x\n", i8042_aux_irq);
270 i8042_pnp_aux_irq = i8042_aux_irq; 290 i8042_pnp_aux_irq = i8042_aux_irq;
271 } 291 }
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 8e63e464d361..5900de3c3f4f 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -698,6 +698,26 @@ static void i8042_timer_func(unsigned long data)
698 i8042_interrupt(0, NULL, NULL); 698 i8042_interrupt(0, NULL, NULL);
699} 699}
700 700
701static int i8042_ctl_test(void)
702{
703 unsigned char param;
704
705 if (!i8042_reset)
706 return 0;
707
708 if (i8042_command(&param, I8042_CMD_CTL_TEST)) {
709 printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n");
710 return -1;
711 }
712
713 if (param != I8042_RET_CTL_TEST) {
714 printk(KERN_ERR "i8042.c: i8042 controller selftest failed. (%#x != %#x)\n",
715 param, I8042_RET_CTL_TEST);
716 return -1;
717 }
718
719 return 0;
720}
701 721
702/* 722/*
703 * i8042_controller init initializes the i8042 controller, and, 723 * i8042_controller init initializes the i8042 controller, and,
@@ -719,21 +739,8 @@ static int i8042_controller_init(void)
719 return -1; 739 return -1;
720 } 740 }
721 741
722 if (i8042_reset) { 742 if (i8042_ctl_test())
723 743 return -1;
724 unsigned char param;
725
726 if (i8042_command(&param, I8042_CMD_CTL_TEST)) {
727 printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n");
728 return -1;
729 }
730
731 if (param != I8042_RET_CTL_TEST) {
732 printk(KERN_ERR "i8042.c: i8042 controller selftest failed. (%#x != %#x)\n",
733 param, I8042_RET_CTL_TEST);
734 return -1;
735 }
736 }
737 744
738/* 745/*
739 * Save the CTR for restoral on unload / reboot. 746 * Save the CTR for restoral on unload / reboot.
@@ -802,15 +809,11 @@ static int i8042_controller_init(void)
802 */ 809 */
803static void i8042_controller_reset(void) 810static void i8042_controller_reset(void)
804{ 811{
805 unsigned char param;
806
807/* 812/*
808 * Reset the controller if requested. 813 * Reset the controller if requested.
809 */ 814 */
810 815
811 if (i8042_reset) 816 i8042_ctl_test();
812 if (i8042_command(&param, I8042_CMD_CTL_TEST))
813 printk(KERN_ERR "i8042.c: i8042 controller reset timeout.\n");
814 817
815/* 818/*
816 * Disable MUX mode if present. 819 * Disable MUX mode if present.
@@ -922,8 +925,11 @@ static int i8042_resume(struct device *dev, u32 level)
922 if (level != RESUME_ENABLE) 925 if (level != RESUME_ENABLE)
923 return 0; 926 return 0;
924 927
925 if (i8042_controller_init()) { 928 if (i8042_ctl_test())
926 printk(KERN_ERR "i8042: resume failed\n"); 929 return -1;
930
931 if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
932 printk(KERN_ERR "i8042: Can't write CTR\n");
927 return -1; 933 return -1;
928 } 934 }
929 935
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 0beacb77ee18..feab4970406e 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -358,31 +358,31 @@ static int serio_thread(void *nothing)
358 * Serio port operations 358 * Serio port operations
359 */ 359 */
360 360
361static ssize_t serio_show_description(struct device *dev, char *buf) 361static ssize_t serio_show_description(struct device *dev, struct device_attribute *attr, char *buf)
362{ 362{
363 struct serio *serio = to_serio_port(dev); 363 struct serio *serio = to_serio_port(dev);
364 return sprintf(buf, "%s\n", serio->name); 364 return sprintf(buf, "%s\n", serio->name);
365} 365}
366 366
367static ssize_t serio_show_id_type(struct device *dev, char *buf) 367static ssize_t serio_show_id_type(struct device *dev, struct device_attribute *attr, char *buf)
368{ 368{
369 struct serio *serio = to_serio_port(dev); 369 struct serio *serio = to_serio_port(dev);
370 return sprintf(buf, "%02x\n", serio->id.type); 370 return sprintf(buf, "%02x\n", serio->id.type);
371} 371}
372 372
373static ssize_t serio_show_id_proto(struct device *dev, char *buf) 373static ssize_t serio_show_id_proto(struct device *dev, struct device_attribute *attr, char *buf)
374{ 374{
375 struct serio *serio = to_serio_port(dev); 375 struct serio *serio = to_serio_port(dev);
376 return sprintf(buf, "%02x\n", serio->id.proto); 376 return sprintf(buf, "%02x\n", serio->id.proto);
377} 377}
378 378
379static ssize_t serio_show_id_id(struct device *dev, char *buf) 379static ssize_t serio_show_id_id(struct device *dev, struct device_attribute *attr, char *buf)
380{ 380{
381 struct serio *serio = to_serio_port(dev); 381 struct serio *serio = to_serio_port(dev);
382 return sprintf(buf, "%02x\n", serio->id.id); 382 return sprintf(buf, "%02x\n", serio->id.id);
383} 383}
384 384
385static ssize_t serio_show_id_extra(struct device *dev, char *buf) 385static ssize_t serio_show_id_extra(struct device *dev, struct device_attribute *attr, char *buf)
386{ 386{
387 struct serio *serio = to_serio_port(dev); 387 struct serio *serio = to_serio_port(dev);
388 return sprintf(buf, "%02x\n", serio->id.extra); 388 return sprintf(buf, "%02x\n", serio->id.extra);
@@ -406,7 +406,7 @@ static struct attribute_group serio_id_attr_group = {
406 .attrs = serio_device_id_attrs, 406 .attrs = serio_device_id_attrs,
407}; 407};
408 408
409static ssize_t serio_rebind_driver(struct device *dev, const char *buf, size_t count) 409static ssize_t serio_rebind_driver(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
410{ 410{
411 struct serio *serio = to_serio_port(dev); 411 struct serio *serio = to_serio_port(dev);
412 struct device_driver *drv; 412 struct device_driver *drv;
@@ -437,13 +437,13 @@ static ssize_t serio_rebind_driver(struct device *dev, const char *buf, size_t c
437 return retval; 437 return retval;
438} 438}
439 439
440static ssize_t serio_show_bind_mode(struct device *dev, char *buf) 440static ssize_t serio_show_bind_mode(struct device *dev, struct device_attribute *attr, char *buf)
441{ 441{
442 struct serio *serio = to_serio_port(dev); 442 struct serio *serio = to_serio_port(dev);
443 return sprintf(buf, "%s\n", serio->manual_bind ? "manual" : "auto"); 443 return sprintf(buf, "%s\n", serio->manual_bind ? "manual" : "auto");
444} 444}
445 445
446static ssize_t serio_set_bind_mode(struct device *dev, const char *buf, size_t count) 446static ssize_t serio_set_bind_mode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
447{ 447{
448 struct serio *serio = to_serio_port(dev); 448 struct serio *serio = to_serio_port(dev);
449 int retval; 449 int retval;
diff --git a/drivers/input/touchscreen/gunze.c b/drivers/input/touchscreen/gunze.c
index c9d0a153671c..53a27e43dd23 100644
--- a/drivers/input/touchscreen/gunze.c
+++ b/drivers/input/touchscreen/gunze.c
@@ -68,8 +68,7 @@ static void gunze_process_packet(struct gunze* gunze, struct pt_regs *regs)
68 68
69 if (gunze->idx != GUNZE_MAX_LENGTH || gunze->data[5] != ',' || 69 if (gunze->idx != GUNZE_MAX_LENGTH || gunze->data[5] != ',' ||
70 (gunze->data[0] != 'T' && gunze->data[0] != 'R')) { 70 (gunze->data[0] != 'T' && gunze->data[0] != 'R')) {
71 gunze->data[10] = 0; 71 printk(KERN_WARNING "gunze.c: bad packet: >%.*s<\n", GUNZE_MAX_LENGTH, gunze->data);
72 printk(KERN_WARNING "gunze.c: bad packet: >%s<\n", gunze->data);
73 return; 72 return;
74 } 73 }
75 74
diff --git a/drivers/input/tsdev.c b/drivers/input/tsdev.c
index d0afba85720b..50c63a155156 100644
--- a/drivers/input/tsdev.c
+++ b/drivers/input/tsdev.c
@@ -414,9 +414,9 @@ static struct input_handle *tsdev_connect(struct input_handler *handler,
414 S_IFCHR|S_IRUGO|S_IWUSR, "input/ts%d", minor); 414 S_IFCHR|S_IRUGO|S_IWUSR, "input/ts%d", minor);
415 devfs_mk_cdev(MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + minor + TSDEV_MINORS/2), 415 devfs_mk_cdev(MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + minor + TSDEV_MINORS/2),
416 S_IFCHR|S_IRUGO|S_IWUSR, "input/tsraw%d", minor); 416 S_IFCHR|S_IRUGO|S_IWUSR, "input/tsraw%d", minor);
417 class_simple_device_add(input_class, 417 class_device_create(input_class,
418 MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + minor), 418 MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + minor),
419 dev->dev, "ts%d", minor); 419 dev->dev, "ts%d", minor);
420 420
421 return &tsdev->handle; 421 return &tsdev->handle;
422} 422}
@@ -426,7 +426,8 @@ static void tsdev_disconnect(struct input_handle *handle)
426 struct tsdev *tsdev = handle->private; 426 struct tsdev *tsdev = handle->private;
427 struct tsdev_list *list; 427 struct tsdev_list *list;
428 428
429 class_simple_device_remove(MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + tsdev->minor)); 429 class_device_destroy(input_class,
430 MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + tsdev->minor));
430 devfs_remove("input/ts%d", tsdev->minor); 431 devfs_remove("input/ts%d", tsdev->minor);
431 devfs_remove("input/tsraw%d", tsdev->minor); 432 devfs_remove("input/tsraw%d", tsdev->minor);
432 tsdev->exist = 0; 433 tsdev->exist = 0;
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 12dee8e9fbbe..04fb606b5ddd 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -58,7 +58,7 @@ MODULE_LICENSE("GPL");
58 58
59/* -------- driver information -------------------------------------- */ 59/* -------- driver information -------------------------------------- */
60 60
61static struct class_simple *capi_class; 61static struct class *capi_class;
62 62
63static int capi_major = 68; /* allocated */ 63static int capi_major = 68; /* allocated */
64#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE 64#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
@@ -1499,20 +1499,20 @@ static int __init capi_init(void)
1499 return -EIO; 1499 return -EIO;
1500 } 1500 }
1501 1501
1502 capi_class = class_simple_create(THIS_MODULE, "capi"); 1502 capi_class = class_create(THIS_MODULE, "capi");
1503 if (IS_ERR(capi_class)) { 1503 if (IS_ERR(capi_class)) {
1504 unregister_chrdev(capi_major, "capi20"); 1504 unregister_chrdev(capi_major, "capi20");
1505 return PTR_ERR(capi_class); 1505 return PTR_ERR(capi_class);
1506 } 1506 }
1507 1507
1508 class_simple_device_add(capi_class, MKDEV(capi_major, 0), NULL, "capi"); 1508 class_device_create(capi_class, MKDEV(capi_major, 0), NULL, "capi");
1509 devfs_mk_cdev(MKDEV(capi_major, 0), S_IFCHR | S_IRUSR | S_IWUSR, 1509 devfs_mk_cdev(MKDEV(capi_major, 0), S_IFCHR | S_IRUSR | S_IWUSR,
1510 "isdn/capi20"); 1510 "isdn/capi20");
1511 1511
1512#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE 1512#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1513 if (capinc_tty_init() < 0) { 1513 if (capinc_tty_init() < 0) {
1514 class_simple_device_remove(MKDEV(capi_major, 0)); 1514 class_device_destroy(capi_class, MKDEV(capi_major, 0));
1515 class_simple_destroy(capi_class); 1515 class_destroy(capi_class);
1516 unregister_chrdev(capi_major, "capi20"); 1516 unregister_chrdev(capi_major, "capi20");
1517 return -ENOMEM; 1517 return -ENOMEM;
1518 } 1518 }
@@ -1539,8 +1539,8 @@ static void __exit capi_exit(void)
1539{ 1539{
1540 proc_exit(); 1540 proc_exit();
1541 1541
1542 class_simple_device_remove(MKDEV(capi_major, 0)); 1542 class_device_destroy(capi_class, MKDEV(capi_major, 0));
1543 class_simple_destroy(capi_class); 1543 class_destroy(capi_class);
1544 unregister_chrdev(capi_major, "capi20"); 1544 unregister_chrdev(capi_major, "capi20");
1545 devfs_remove("isdn/capi20"); 1545 devfs_remove("isdn/capi20");
1546 1546
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 7297c77f99cf..493e2afa191c 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -77,7 +77,7 @@ static struct adb_driver *adb_driver_list[] = {
77 NULL 77 NULL
78}; 78};
79 79
80static struct class_simple *adb_dev_class; 80static struct class *adb_dev_class;
81 81
82struct adb_driver *adb_controller; 82struct adb_driver *adb_controller;
83struct notifier_block *adb_client_list = NULL; 83struct notifier_block *adb_client_list = NULL;
@@ -902,9 +902,8 @@ adbdev_init(void)
902 902
903 devfs_mk_cdev(MKDEV(ADB_MAJOR, 0), S_IFCHR | S_IRUSR | S_IWUSR, "adb"); 903 devfs_mk_cdev(MKDEV(ADB_MAJOR, 0), S_IFCHR | S_IRUSR | S_IWUSR, "adb");
904 904
905 adb_dev_class = class_simple_create(THIS_MODULE, "adb"); 905 adb_dev_class = class_create(THIS_MODULE, "adb");
906 if (IS_ERR(adb_dev_class)) { 906 if (IS_ERR(adb_dev_class))
907 return; 907 return;
908 } 908 class_device_create(adb_dev_class, MKDEV(ADB_MAJOR, 0), NULL, "adb");
909 class_simple_device_add(adb_dev_class, MKDEV(ADB_MAJOR, 0), NULL, "adb");
910} 909}
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index d09308f30960..5ba190ce14a0 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -455,21 +455,22 @@ static int attach_one_thermostat(struct i2c_adapter *adapter, int addr,
455 * pass around to the attribute functions, so we don't really have 455 * pass around to the attribute functions, so we don't really have
456 * choice but implement a bunch of them... 456 * choice but implement a bunch of them...
457 * 457 *
458 * FIXME, it does now...
458 */ 459 */
459#define BUILD_SHOW_FUNC_INT(name, data) \ 460#define BUILD_SHOW_FUNC_INT(name, data) \
460static ssize_t show_##name(struct device *dev, char *buf) \ 461static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \
461{ \ 462{ \
462 return sprintf(buf, "%d\n", data); \ 463 return sprintf(buf, "%d\n", data); \
463} 464}
464 465
465#define BUILD_SHOW_FUNC_STR(name, data) \ 466#define BUILD_SHOW_FUNC_STR(name, data) \
466static ssize_t show_##name(struct device *dev, char *buf) \ 467static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \
467{ \ 468{ \
468 return sprintf(buf, "%s\n", data); \ 469 return sprintf(buf, "%s\n", data); \
469} 470}
470 471
471#define BUILD_SHOW_FUNC_FAN(name, data) \ 472#define BUILD_SHOW_FUNC_FAN(name, data) \
472static ssize_t show_##name(struct device *dev, char *buf) \ 473static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \
473{ \ 474{ \
474 return sprintf(buf, "%d (%d rpm)\n", \ 475 return sprintf(buf, "%d (%d rpm)\n", \
475 thermostat->last_speed[data], \ 476 thermostat->last_speed[data], \
@@ -478,7 +479,7 @@ static ssize_t show_##name(struct device *dev, char *buf) \
478} 479}
479 480
480#define BUILD_STORE_FUNC_DEG(name, data) \ 481#define BUILD_STORE_FUNC_DEG(name, data) \
481static ssize_t store_##name(struct device *dev, const char *buf, size_t n) \ 482static ssize_t store_##name(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) \
482{ \ 483{ \
483 int val; \ 484 int val; \
484 int i; \ 485 int i; \
@@ -491,7 +492,7 @@ static ssize_t store_##name(struct device *dev, const char *buf, size_t n) \
491} 492}
492 493
493#define BUILD_STORE_FUNC_INT(name, data) \ 494#define BUILD_STORE_FUNC_INT(name, data) \
494static ssize_t store_##name(struct device *dev, const char *buf, size_t n) \ 495static ssize_t store_##name(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) \
495{ \ 496{ \
496 u32 val; \ 497 u32 val; \
497 val = simple_strtoul(buf, NULL, 10); \ 498 val = simple_strtoul(buf, NULL, 10); \
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index 82336a5a5474..feb4e2413858 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -685,7 +685,7 @@ static void fetch_cpu_pumps_minmax(void)
685 * the input twice... I accept patches :) 685 * the input twice... I accept patches :)
686 */ 686 */
687#define BUILD_SHOW_FUNC_FIX(name, data) \ 687#define BUILD_SHOW_FUNC_FIX(name, data) \
688static ssize_t show_##name(struct device *dev, char *buf) \ 688static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \
689{ \ 689{ \
690 ssize_t r; \ 690 ssize_t r; \
691 down(&driver_lock); \ 691 down(&driver_lock); \
@@ -694,7 +694,7 @@ static ssize_t show_##name(struct device *dev, char *buf) \
694 return r; \ 694 return r; \
695} 695}
696#define BUILD_SHOW_FUNC_INT(name, data) \ 696#define BUILD_SHOW_FUNC_INT(name, data) \
697static ssize_t show_##name(struct device *dev, char *buf) \ 697static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \
698{ \ 698{ \
699 return sprintf(buf, "%d", data); \ 699 return sprintf(buf, "%d", data); \
700} 700}
diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c
index c153699d0f84..0bdb47f08c2a 100644
--- a/drivers/macintosh/therm_windtunnel.c
+++ b/drivers/macintosh/therm_windtunnel.c
@@ -107,13 +107,13 @@ print_temp( const char *s, int temp )
107} 107}
108 108
109static ssize_t 109static ssize_t
110show_cpu_temperature( struct device *dev, char *buf ) 110show_cpu_temperature( struct device *dev, struct device_attribute *attr, char *buf )
111{ 111{
112 return sprintf(buf, "%d.%d\n", x.temp>>8, (x.temp & 255)*10/256 ); 112 return sprintf(buf, "%d.%d\n", x.temp>>8, (x.temp & 255)*10/256 );
113} 113}
114 114
115static ssize_t 115static ssize_t
116show_case_temperature( struct device *dev, char *buf ) 116show_case_temperature( struct device *dev, struct device_attribute *attr, char *buf )
117{ 117{
118 return sprintf(buf, "%d.%d\n", x.casetemp>>8, (x.casetemp & 255)*10/256 ); 118 return sprintf(buf, "%d.%d\n", x.casetemp>>8, (x.casetemp & 255)*10/256 );
119} 119}
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index e654aa5eecd4..b941ee220997 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -2421,7 +2421,7 @@ pmac_wakeup_devices(void)
2421 2421
2422 /* Re-enable local CPU interrupts */ 2422 /* Re-enable local CPU interrupts */
2423 local_irq_enable(); 2423 local_irq_enable();
2424 mdelay(100); 2424 mdelay(10);
2425 preempt_enable(); 2425 preempt_enable();
2426 2426
2427 /* Re-enable clock spreading on some machines */ 2427 /* Re-enable clock spreading on some machines */
@@ -2549,7 +2549,9 @@ powerbook_sleep_Core99(void)
2549 return ret; 2549 return ret;
2550 } 2550 }
2551 2551
2552 printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1)); 2552 /* Stop environment and ADB interrupts */
2553 pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0);
2554 pmu_wait_complete(&req);
2553 2555
2554 /* Tell PMU what events will wake us up */ 2556 /* Tell PMU what events will wake us up */
2555 pmu_request(&req, NULL, 4, PMU_POWER_EVENTS, PMU_PWR_CLR_WAKEUP_EVENTS, 2557 pmu_request(&req, NULL, 4, PMU_POWER_EVENTS, PMU_PWR_CLR_WAKEUP_EVENTS,
@@ -2591,6 +2593,9 @@ powerbook_sleep_Core99(void)
2591 /* Restore VIA */ 2593 /* Restore VIA */
2592 restore_via_state(); 2594 restore_via_state();
2593 2595
2596 /* tweak LPJ before cpufreq is there */
2597 loops_per_jiffy *= 2;
2598
2594 /* Restore video */ 2599 /* Restore video */
2595 pmac_call_early_video_resume(); 2600 pmac_call_early_video_resume();
2596 2601
@@ -2611,7 +2616,8 @@ powerbook_sleep_Core99(void)
2611 pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask); 2616 pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask);
2612 pmu_wait_complete(&req); 2617 pmu_wait_complete(&req);
2613 2618
2614 printk(KERN_DEBUG "HID1, after: %x\n", mfspr(SPRN_HID1)); 2619 /* Restore LPJ, cpufreq will adjust the cpu frequency */
2620 loops_per_jiffy /= 2;
2615 2621
2616 pmac_wakeup_devices(); 2622 pmac_wakeup_devices();
2617 2623
diff --git a/drivers/mca/mca-bus.c b/drivers/mca/mca-bus.c
index ff9be67c2a15..09baa43b2599 100644
--- a/drivers/mca/mca-bus.c
+++ b/drivers/mca/mca-bus.c
@@ -69,7 +69,7 @@ struct bus_type mca_bus_type = {
69}; 69};
70EXPORT_SYMBOL (mca_bus_type); 70EXPORT_SYMBOL (mca_bus_type);
71 71
72static ssize_t mca_show_pos_id(struct device *dev, char *buf) 72static ssize_t mca_show_pos_id(struct device *dev, struct device_attribute *attr, char *buf)
73{ 73{
74 /* four digits, \n and trailing \0 */ 74 /* four digits, \n and trailing \0 */
75 struct mca_device *mca_dev = to_mca_device(dev); 75 struct mca_device *mca_dev = to_mca_device(dev);
@@ -81,7 +81,7 @@ static ssize_t mca_show_pos_id(struct device *dev, char *buf)
81 len = sprintf(buf, "none\n"); 81 len = sprintf(buf, "none\n");
82 return len; 82 return len;
83} 83}
84static ssize_t mca_show_pos(struct device *dev, char *buf) 84static ssize_t mca_show_pos(struct device *dev, struct device_attribute *attr, char *buf)
85{ 85{
86 /* enough for 8 two byte hex chars plus space and new line */ 86 /* enough for 8 two byte hex chars plus space and new line */
87 int j, len=0; 87 int j, len=0;
diff --git a/drivers/md/Makefile b/drivers/md/Makefile
index 90de9c146a5f..d3efedf6a6ad 100644
--- a/drivers/md/Makefile
+++ b/drivers/md/Makefile
@@ -7,6 +7,7 @@ dm-mod-objs := dm.o dm-table.o dm-target.o dm-linear.o dm-stripe.o \
7dm-multipath-objs := dm-hw-handler.o dm-path-selector.o dm-mpath.o 7dm-multipath-objs := dm-hw-handler.o dm-path-selector.o dm-mpath.o
8dm-snapshot-objs := dm-snap.o dm-exception-store.o 8dm-snapshot-objs := dm-snap.o dm-exception-store.o
9dm-mirror-objs := dm-log.o dm-raid1.o 9dm-mirror-objs := dm-log.o dm-raid1.o
10md-mod-objs := md.o bitmap.o
10raid6-objs := raid6main.o raid6algos.o raid6recov.o raid6tables.o \ 11raid6-objs := raid6main.o raid6algos.o raid6recov.o raid6tables.o \
11 raid6int1.o raid6int2.o raid6int4.o \ 12 raid6int1.o raid6int2.o raid6int4.o \
12 raid6int8.o raid6int16.o raid6int32.o \ 13 raid6int8.o raid6int16.o raid6int32.o \
@@ -28,7 +29,7 @@ obj-$(CONFIG_MD_RAID5) += raid5.o xor.o
28obj-$(CONFIG_MD_RAID6) += raid6.o xor.o 29obj-$(CONFIG_MD_RAID6) += raid6.o xor.o
29obj-$(CONFIG_MD_MULTIPATH) += multipath.o 30obj-$(CONFIG_MD_MULTIPATH) += multipath.o
30obj-$(CONFIG_MD_FAULTY) += faulty.o 31obj-$(CONFIG_MD_FAULTY) += faulty.o
31obj-$(CONFIG_BLK_DEV_MD) += md.o 32obj-$(CONFIG_BLK_DEV_MD) += md-mod.o
32obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o 33obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o
33obj-$(CONFIG_DM_CRYPT) += dm-crypt.o 34obj-$(CONFIG_DM_CRYPT) += dm-crypt.o
34obj-$(CONFIG_DM_MULTIPATH) += dm-multipath.o dm-round-robin.o 35obj-$(CONFIG_DM_MULTIPATH) += dm-multipath.o dm-round-robin.o
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
new file mode 100644
index 000000000000..95980ad6b27b
--- /dev/null
+++ b/drivers/md/bitmap.c
@@ -0,0 +1,1586 @@
1/*
2 * bitmap.c two-level bitmap (C) Peter T. Breuer (ptb@ot.uc3m.es) 2003
3 *
4 * bitmap_create - sets up the bitmap structure
5 * bitmap_destroy - destroys the bitmap structure
6 *
7 * additions, Copyright (C) 2003-2004, Paul Clements, SteelEye Technology, Inc.:
8 * - added disk storage for bitmap
9 * - changes to allow various bitmap chunk sizes
10 * - added bitmap daemon (to asynchronously clear bitmap bits from disk)
11 */
12
13/*
14 * Still to do:
15 *
16 * flush after percent set rather than just time based. (maybe both).
17 * wait if count gets too high, wake when it drops to half.
18 * allow bitmap to be mirrored with superblock (before or after...)
19 * allow hot-add to re-instate a current device.
20 * allow hot-add of bitmap after quiessing device
21 */
22
23#include <linux/module.h>
24#include <linux/version.h>
25#include <linux/errno.h>
26#include <linux/slab.h>
27#include <linux/init.h>
28#include <linux/config.h>
29#include <linux/timer.h>
30#include <linux/sched.h>
31#include <linux/list.h>
32#include <linux/file.h>
33#include <linux/mount.h>
34#include <linux/buffer_head.h>
35#include <linux/raid/md.h>
36#include <linux/raid/bitmap.h>
37
38/* debug macros */
39
40#define DEBUG 0
41
42#if DEBUG
43/* these are for debugging purposes only! */
44
45/* define one and only one of these */
46#define INJECT_FAULTS_1 0 /* cause bitmap_alloc_page to fail always */
47#define INJECT_FAULTS_2 0 /* cause bitmap file to be kicked when first bit set*/
48#define INJECT_FAULTS_3 0 /* treat bitmap file as kicked at init time */
49#define INJECT_FAULTS_4 0 /* undef */
50#define INJECT_FAULTS_5 0 /* undef */
51#define INJECT_FAULTS_6 0
52
53/* if these are defined, the driver will fail! debug only */
54#define INJECT_FATAL_FAULT_1 0 /* fail kmalloc, causing bitmap_create to fail */
55#define INJECT_FATAL_FAULT_2 0 /* undef */
56#define INJECT_FATAL_FAULT_3 0 /* undef */
57#endif
58
59//#define DPRINTK PRINTK /* set this NULL to avoid verbose debug output */
60#define DPRINTK(x...) do { } while(0)
61
62#ifndef PRINTK
63# if DEBUG > 0
64# define PRINTK(x...) printk(KERN_DEBUG x)
65# else
66# define PRINTK(x...)
67# endif
68#endif
69
70static inline char * bmname(struct bitmap *bitmap)
71{
72 return bitmap->mddev ? mdname(bitmap->mddev) : "mdX";
73}
74
75
76/*
77 * test if the bitmap is active
78 */
79int bitmap_active(struct bitmap *bitmap)
80{
81 unsigned long flags;
82 int res = 0;
83
84 if (!bitmap)
85 return res;
86 spin_lock_irqsave(&bitmap->lock, flags);
87 res = bitmap->flags & BITMAP_ACTIVE;
88 spin_unlock_irqrestore(&bitmap->lock, flags);
89 return res;
90}
91
92#define WRITE_POOL_SIZE 256
93/* mempool for queueing pending writes on the bitmap file */
94static void *write_pool_alloc(unsigned int gfp_flags, void *data)
95{
96 return kmalloc(sizeof(struct page_list), gfp_flags);
97}
98
99static void write_pool_free(void *ptr, void *data)
100{
101 kfree(ptr);
102}
103
104/*
105 * just a placeholder - calls kmalloc for bitmap pages
106 */
107static unsigned char *bitmap_alloc_page(struct bitmap *bitmap)
108{
109 unsigned char *page;
110
111#if INJECT_FAULTS_1
112 page = NULL;
113#else
114 page = kmalloc(PAGE_SIZE, GFP_NOIO);
115#endif
116 if (!page)
117 printk("%s: bitmap_alloc_page FAILED\n", bmname(bitmap));
118 else
119 PRINTK("%s: bitmap_alloc_page: allocated page at %p\n",
120 bmname(bitmap), page);
121 return page;
122}
123
124/*
125 * for now just a placeholder -- just calls kfree for bitmap pages
126 */
127static void bitmap_free_page(struct bitmap *bitmap, unsigned char *page)
128{
129 PRINTK("%s: bitmap_free_page: free page %p\n", bmname(bitmap), page);
130 kfree(page);
131}
132
133/*
134 * check a page and, if necessary, allocate it (or hijack it if the alloc fails)
135 *
136 * 1) check to see if this page is allocated, if it's not then try to alloc
137 * 2) if the alloc fails, set the page's hijacked flag so we'll use the
138 * page pointer directly as a counter
139 *
140 * if we find our page, we increment the page's refcount so that it stays
141 * allocated while we're using it
142 */
143static int bitmap_checkpage(struct bitmap *bitmap, unsigned long page, int create)
144{
145 unsigned char *mappage;
146
147 if (page >= bitmap->pages) {
148 printk(KERN_ALERT
149 "%s: invalid bitmap page request: %lu (> %lu)\n",
150 bmname(bitmap), page, bitmap->pages-1);
151 return -EINVAL;
152 }
153
154
155 if (bitmap->bp[page].hijacked) /* it's hijacked, don't try to alloc */
156 return 0;
157
158 if (bitmap->bp[page].map) /* page is already allocated, just return */
159 return 0;
160
161 if (!create)
162 return -ENOENT;
163
164 spin_unlock_irq(&bitmap->lock);
165
166 /* this page has not been allocated yet */
167
168 if ((mappage = bitmap_alloc_page(bitmap)) == NULL) {
169 PRINTK("%s: bitmap map page allocation failed, hijacking\n",
170 bmname(bitmap));
171 /* failed - set the hijacked flag so that we can use the
172 * pointer as a counter */
173 spin_lock_irq(&bitmap->lock);
174 if (!bitmap->bp[page].map)
175 bitmap->bp[page].hijacked = 1;
176 goto out;
177 }
178
179 /* got a page */
180
181 spin_lock_irq(&bitmap->lock);
182
183 /* recheck the page */
184
185 if (bitmap->bp[page].map || bitmap->bp[page].hijacked) {
186 /* somebody beat us to getting the page */
187 bitmap_free_page(bitmap, mappage);
188 return 0;
189 }
190
191 /* no page was in place and we have one, so install it */
192
193 memset(mappage, 0, PAGE_SIZE);
194 bitmap->bp[page].map = mappage;
195 bitmap->missing_pages--;
196out:
197 return 0;
198}
199
200
201/* if page is completely empty, put it back on the free list, or dealloc it */
202/* if page was hijacked, unmark the flag so it might get alloced next time */
203/* Note: lock should be held when calling this */
204static inline void bitmap_checkfree(struct bitmap *bitmap, unsigned long page)
205{
206 char *ptr;
207
208 if (bitmap->bp[page].count) /* page is still busy */
209 return;
210
211 /* page is no longer in use, it can be released */
212
213 if (bitmap->bp[page].hijacked) { /* page was hijacked, undo this now */
214 bitmap->bp[page].hijacked = 0;
215 bitmap->bp[page].map = NULL;
216 return;
217 }
218
219 /* normal case, free the page */
220
221#if 0
222/* actually ... let's not. We will probably need the page again exactly when
223 * memory is tight and we are flusing to disk
224 */
225 return;
226#else
227 ptr = bitmap->bp[page].map;
228 bitmap->bp[page].map = NULL;
229 bitmap->missing_pages++;
230 bitmap_free_page(bitmap, ptr);
231 return;
232#endif
233}
234
235
236/*
237 * bitmap file handling - read and write the bitmap file and its superblock
238 */
239
240/* copy the pathname of a file to a buffer */
241char *file_path(struct file *file, char *buf, int count)
242{
243 struct dentry *d;
244 struct vfsmount *v;
245
246 if (!buf)
247 return NULL;
248
249 d = file->f_dentry;
250 v = file->f_vfsmnt;
251
252 buf = d_path(d, v, buf, count);
253
254 return IS_ERR(buf) ? NULL : buf;
255}
256
257/*
258 * basic page I/O operations
259 */
260
261/* IO operations when bitmap is stored near all superblocks */
262static struct page *read_sb_page(mddev_t *mddev, long offset, unsigned long index)
263{
264 /* choose a good rdev and read the page from there */
265
266 mdk_rdev_t *rdev;
267 struct list_head *tmp;
268 struct page *page = alloc_page(GFP_KERNEL);
269 sector_t target;
270
271 if (!page)
272 return ERR_PTR(-ENOMEM);
273 do {
274 ITERATE_RDEV(mddev, rdev, tmp)
275 if (rdev->in_sync && !rdev->faulty)
276 goto found;
277 return ERR_PTR(-EIO);
278
279 found:
280 target = (rdev->sb_offset << 1) + offset + index * (PAGE_SIZE/512);
281
282 } while (!sync_page_io(rdev->bdev, target, PAGE_SIZE, page, READ));
283
284 page->index = index;
285 return page;
286}
287
288static int write_sb_page(mddev_t *mddev, long offset, struct page *page, int wait)
289{
290 mdk_rdev_t *rdev;
291 struct list_head *tmp;
292
293 ITERATE_RDEV(mddev, rdev, tmp)
294 if (rdev->in_sync && !rdev->faulty)
295 md_super_write(mddev, rdev,
296 (rdev->sb_offset<<1) + offset
297 + page->index * (PAGE_SIZE/512),
298 PAGE_SIZE,
299 page);
300
301 if (wait)
302 wait_event(mddev->sb_wait, atomic_read(&mddev->pending_writes)==0);
303 return 0;
304}
305
306/*
307 * write out a page to a file
308 */
309static int write_page(struct bitmap *bitmap, struct page *page, int wait)
310{
311 int ret = -ENOMEM;
312
313 if (bitmap->file == NULL)
314 return write_sb_page(bitmap->mddev, bitmap->offset, page, wait);
315
316 if (wait)
317 lock_page(page);
318 else {
319 if (TestSetPageLocked(page))
320 return -EAGAIN; /* already locked */
321 if (PageWriteback(page)) {
322 unlock_page(page);
323 return -EAGAIN;
324 }
325 }
326
327 ret = page->mapping->a_ops->prepare_write(NULL, page, 0, PAGE_SIZE);
328 if (!ret)
329 ret = page->mapping->a_ops->commit_write(NULL, page, 0,
330 PAGE_SIZE);
331 if (ret) {
332 unlock_page(page);
333 return ret;
334 }
335
336 set_page_dirty(page); /* force it to be written out */
337
338 if (!wait) {
339 /* add to list to be waited for by daemon */
340 struct page_list *item = mempool_alloc(bitmap->write_pool, GFP_NOIO);
341 item->page = page;
342 page_cache_get(page);
343 spin_lock(&bitmap->write_lock);
344 list_add(&item->list, &bitmap->complete_pages);
345 spin_unlock(&bitmap->write_lock);
346 md_wakeup_thread(bitmap->writeback_daemon);
347 }
348 return write_one_page(page, wait);
349}
350
351/* read a page from a file, pinning it into cache, and return bytes_read */
352static struct page *read_page(struct file *file, unsigned long index,
353 unsigned long *bytes_read)
354{
355 struct inode *inode = file->f_mapping->host;
356 struct page *page = NULL;
357 loff_t isize = i_size_read(inode);
358 unsigned long end_index = isize >> PAGE_CACHE_SHIFT;
359
360 PRINTK("read bitmap file (%dB @ %Lu)\n", (int)PAGE_CACHE_SIZE,
361 (unsigned long long)index << PAGE_CACHE_SHIFT);
362
363 page = read_cache_page(inode->i_mapping, index,
364 (filler_t *)inode->i_mapping->a_ops->readpage, file);
365 if (IS_ERR(page))
366 goto out;
367 wait_on_page_locked(page);
368 if (!PageUptodate(page) || PageError(page)) {
369 page_cache_release(page);
370 page = ERR_PTR(-EIO);
371 goto out;
372 }
373
374 if (index > end_index) /* we have read beyond EOF */
375 *bytes_read = 0;
376 else if (index == end_index) /* possible short read */
377 *bytes_read = isize & ~PAGE_CACHE_MASK;
378 else
379 *bytes_read = PAGE_CACHE_SIZE; /* got a full page */
380out:
381 if (IS_ERR(page))
382 printk(KERN_ALERT "md: bitmap read error: (%dB @ %Lu): %ld\n",
383 (int)PAGE_CACHE_SIZE,
384 (unsigned long long)index << PAGE_CACHE_SHIFT,
385 PTR_ERR(page));
386 return page;
387}
388
389/*
390 * bitmap file superblock operations
391 */
392
393/* update the event counter and sync the superblock to disk */
394int bitmap_update_sb(struct bitmap *bitmap)
395{
396 bitmap_super_t *sb;
397 unsigned long flags;
398
399 if (!bitmap || !bitmap->mddev) /* no bitmap for this array */
400 return 0;
401 spin_lock_irqsave(&bitmap->lock, flags);
402 if (!bitmap->sb_page) { /* no superblock */
403 spin_unlock_irqrestore(&bitmap->lock, flags);
404 return 0;
405 }
406 spin_unlock_irqrestore(&bitmap->lock, flags);
407 sb = (bitmap_super_t *)kmap(bitmap->sb_page);
408 sb->events = cpu_to_le64(bitmap->mddev->events);
409 if (!bitmap->mddev->degraded)
410 sb->events_cleared = cpu_to_le64(bitmap->mddev->events);
411 kunmap(bitmap->sb_page);
412 return write_page(bitmap, bitmap->sb_page, 1);
413}
414
415/* print out the bitmap file superblock */
416void bitmap_print_sb(struct bitmap *bitmap)
417{
418 bitmap_super_t *sb;
419
420 if (!bitmap || !bitmap->sb_page)
421 return;
422 sb = (bitmap_super_t *)kmap(bitmap->sb_page);
423 printk(KERN_DEBUG "%s: bitmap file superblock:\n", bmname(bitmap));
424 printk(KERN_DEBUG " magic: %08x\n", le32_to_cpu(sb->magic));
425 printk(KERN_DEBUG " version: %d\n", le32_to_cpu(sb->version));
426 printk(KERN_DEBUG " uuid: %08x.%08x.%08x.%08x\n",
427 *(__u32 *)(sb->uuid+0),
428 *(__u32 *)(sb->uuid+4),
429 *(__u32 *)(sb->uuid+8),
430 *(__u32 *)(sb->uuid+12));
431 printk(KERN_DEBUG " events: %llu\n",
432 (unsigned long long) le64_to_cpu(sb->events));
433 printk(KERN_DEBUG "events cleared: %llu\n",
434 (unsigned long long) le64_to_cpu(sb->events_cleared));
435 printk(KERN_DEBUG " state: %08x\n", le32_to_cpu(sb->state));
436 printk(KERN_DEBUG " chunksize: %d B\n", le32_to_cpu(sb->chunksize));
437 printk(KERN_DEBUG " daemon sleep: %ds\n", le32_to_cpu(sb->daemon_sleep));
438 printk(KERN_DEBUG " sync size: %llu KB\n",
439 (unsigned long long)le64_to_cpu(sb->sync_size)/2);
440 kunmap(bitmap->sb_page);
441}
442
443/* read the superblock from the bitmap file and initialize some bitmap fields */
444static int bitmap_read_sb(struct bitmap *bitmap)
445{
446 char *reason = NULL;
447 bitmap_super_t *sb;
448 unsigned long chunksize, daemon_sleep;
449 unsigned long bytes_read;
450 unsigned long long events;
451 int err = -EINVAL;
452
453 /* page 0 is the superblock, read it... */
454 if (bitmap->file)
455 bitmap->sb_page = read_page(bitmap->file, 0, &bytes_read);
456 else {
457 bitmap->sb_page = read_sb_page(bitmap->mddev, bitmap->offset, 0);
458 bytes_read = PAGE_SIZE;
459 }
460 if (IS_ERR(bitmap->sb_page)) {
461 err = PTR_ERR(bitmap->sb_page);
462 bitmap->sb_page = NULL;
463 return err;
464 }
465
466 sb = (bitmap_super_t *)kmap(bitmap->sb_page);
467
468 if (bytes_read < sizeof(*sb)) { /* short read */
469 printk(KERN_INFO "%s: bitmap file superblock truncated\n",
470 bmname(bitmap));
471 err = -ENOSPC;
472 goto out;
473 }
474
475 chunksize = le32_to_cpu(sb->chunksize);
476 daemon_sleep = le32_to_cpu(sb->daemon_sleep);
477
478 /* verify that the bitmap-specific fields are valid */
479 if (sb->magic != cpu_to_le32(BITMAP_MAGIC))
480 reason = "bad magic";
481 else if (sb->version != cpu_to_le32(BITMAP_MAJOR))
482 reason = "unrecognized superblock version";
483 else if (chunksize < 512 || chunksize > (1024 * 1024 * 4))
484 reason = "bitmap chunksize out of range (512B - 4MB)";
485 else if ((1 << ffz(~chunksize)) != chunksize)
486 reason = "bitmap chunksize not a power of 2";
487 else if (daemon_sleep < 1 || daemon_sleep > 15)
488 reason = "daemon sleep period out of range";
489 if (reason) {
490 printk(KERN_INFO "%s: invalid bitmap file superblock: %s\n",
491 bmname(bitmap), reason);
492 goto out;
493 }
494
495 /* keep the array size field of the bitmap superblock up to date */
496 sb->sync_size = cpu_to_le64(bitmap->mddev->resync_max_sectors);
497
498 if (!bitmap->mddev->persistent)
499 goto success;
500
501 /*
502 * if we have a persistent array superblock, compare the
503 * bitmap's UUID and event counter to the mddev's
504 */
505 if (memcmp(sb->uuid, bitmap->mddev->uuid, 16)) {
506 printk(KERN_INFO "%s: bitmap superblock UUID mismatch\n",
507 bmname(bitmap));
508 goto out;
509 }
510 events = le64_to_cpu(sb->events);
511 if (events < bitmap->mddev->events) {
512 printk(KERN_INFO "%s: bitmap file is out of date (%llu < %llu) "
513 "-- forcing full recovery\n", bmname(bitmap), events,
514 (unsigned long long) bitmap->mddev->events);
515 sb->state |= BITMAP_STALE;
516 }
517success:
518 /* assign fields using values from superblock */
519 bitmap->chunksize = chunksize;
520 bitmap->daemon_sleep = daemon_sleep;
521 bitmap->flags |= sb->state;
522 bitmap->events_cleared = le64_to_cpu(sb->events_cleared);
523 err = 0;
524out:
525 kunmap(bitmap->sb_page);
526 if (err)
527 bitmap_print_sb(bitmap);
528 return err;
529}
530
531enum bitmap_mask_op {
532 MASK_SET,
533 MASK_UNSET
534};
535
536/* record the state of the bitmap in the superblock */
537static void bitmap_mask_state(struct bitmap *bitmap, enum bitmap_state bits,
538 enum bitmap_mask_op op)
539{
540 bitmap_super_t *sb;
541 unsigned long flags;
542
543 spin_lock_irqsave(&bitmap->lock, flags);
544 if (!bitmap || !bitmap->sb_page) { /* can't set the state */
545 spin_unlock_irqrestore(&bitmap->lock, flags);
546 return;
547 }
548 page_cache_get(bitmap->sb_page);
549 spin_unlock_irqrestore(&bitmap->lock, flags);
550 sb = (bitmap_super_t *)kmap(bitmap->sb_page);
551 switch (op) {
552 case MASK_SET: sb->state |= bits;
553 break;
554 case MASK_UNSET: sb->state &= ~bits;
555 break;
556 default: BUG();
557 }
558 kunmap(bitmap->sb_page);
559 page_cache_release(bitmap->sb_page);
560}
561
562/*
563 * general bitmap file operations
564 */
565
566/* calculate the index of the page that contains this bit */
567static inline unsigned long file_page_index(unsigned long chunk)
568{
569 return CHUNK_BIT_OFFSET(chunk) >> PAGE_BIT_SHIFT;
570}
571
572/* calculate the (bit) offset of this bit within a page */
573static inline unsigned long file_page_offset(unsigned long chunk)
574{
575 return CHUNK_BIT_OFFSET(chunk) & (PAGE_BITS - 1);
576}
577
578/*
579 * return a pointer to the page in the filemap that contains the given bit
580 *
581 * this lookup is complicated by the fact that the bitmap sb might be exactly
582 * 1 page (e.g., x86) or less than 1 page -- so the bitmap might start on page
583 * 0 or page 1
584 */
585static inline struct page *filemap_get_page(struct bitmap *bitmap,
586 unsigned long chunk)
587{
588 return bitmap->filemap[file_page_index(chunk) - file_page_index(0)];
589}
590
591
592static void bitmap_file_unmap(struct bitmap *bitmap)
593{
594 struct page **map, *sb_page;
595 unsigned long *attr;
596 int pages;
597 unsigned long flags;
598
599 spin_lock_irqsave(&bitmap->lock, flags);
600 map = bitmap->filemap;
601 bitmap->filemap = NULL;
602 attr = bitmap->filemap_attr;
603 bitmap->filemap_attr = NULL;
604 pages = bitmap->file_pages;
605 bitmap->file_pages = 0;
606 sb_page = bitmap->sb_page;
607 bitmap->sb_page = NULL;
608 spin_unlock_irqrestore(&bitmap->lock, flags);
609
610 while (pages--)
611 if (map[pages]->index != 0) /* 0 is sb_page, release it below */
612 page_cache_release(map[pages]);
613 kfree(map);
614 kfree(attr);
615
616 if (sb_page)
617 page_cache_release(sb_page);
618}
619
620static void bitmap_stop_daemons(struct bitmap *bitmap);
621
622/* dequeue the next item in a page list -- don't call from irq context */
623static struct page_list *dequeue_page(struct bitmap *bitmap)
624{
625 struct page_list *item = NULL;
626 struct list_head *head = &bitmap->complete_pages;
627
628 spin_lock(&bitmap->write_lock);
629 if (list_empty(head))
630 goto out;
631 item = list_entry(head->prev, struct page_list, list);
632 list_del(head->prev);
633out:
634 spin_unlock(&bitmap->write_lock);
635 return item;
636}
637
638static void drain_write_queues(struct bitmap *bitmap)
639{
640 struct page_list *item;
641
642 while ((item = dequeue_page(bitmap))) {
643 /* don't bother to wait */
644 page_cache_release(item->page);
645 mempool_free(item, bitmap->write_pool);
646 }
647
648 wake_up(&bitmap->write_wait);
649}
650
651static void bitmap_file_put(struct bitmap *bitmap)
652{
653 struct file *file;
654 struct inode *inode;
655 unsigned long flags;
656
657 spin_lock_irqsave(&bitmap->lock, flags);
658 file = bitmap->file;
659 bitmap->file = NULL;
660 spin_unlock_irqrestore(&bitmap->lock, flags);
661
662 bitmap_stop_daemons(bitmap);
663
664 drain_write_queues(bitmap);
665
666 bitmap_file_unmap(bitmap);
667
668 if (file) {
669 inode = file->f_mapping->host;
670 spin_lock(&inode->i_lock);
671 atomic_set(&inode->i_writecount, 1); /* allow writes again */
672 spin_unlock(&inode->i_lock);
673 fput(file);
674 }
675}
676
677
678/*
679 * bitmap_file_kick - if an error occurs while manipulating the bitmap file
680 * then it is no longer reliable, so we stop using it and we mark the file
681 * as failed in the superblock
682 */
683static void bitmap_file_kick(struct bitmap *bitmap)
684{
685 char *path, *ptr = NULL;
686
687 bitmap_mask_state(bitmap, BITMAP_STALE, MASK_SET);
688 bitmap_update_sb(bitmap);
689
690 if (bitmap->file) {
691 path = kmalloc(PAGE_SIZE, GFP_KERNEL);
692 if (path)
693 ptr = file_path(bitmap->file, path, PAGE_SIZE);
694
695 printk(KERN_ALERT "%s: kicking failed bitmap file %s from array!\n",
696 bmname(bitmap), ptr ? ptr : "");
697
698 kfree(path);
699 }
700
701 bitmap_file_put(bitmap);
702
703 return;
704}
705
706enum bitmap_page_attr {
707 BITMAP_PAGE_DIRTY = 1, // there are set bits that need to be synced
708 BITMAP_PAGE_CLEAN = 2, // there are bits that might need to be cleared
709 BITMAP_PAGE_NEEDWRITE=4, // there are cleared bits that need to be synced
710};
711
712static inline void set_page_attr(struct bitmap *bitmap, struct page *page,
713 enum bitmap_page_attr attr)
714{
715 bitmap->filemap_attr[page->index] |= attr;
716}
717
718static inline void clear_page_attr(struct bitmap *bitmap, struct page *page,
719 enum bitmap_page_attr attr)
720{
721 bitmap->filemap_attr[page->index] &= ~attr;
722}
723
724static inline unsigned long get_page_attr(struct bitmap *bitmap, struct page *page)
725{
726 return bitmap->filemap_attr[page->index];
727}
728
729/*
730 * bitmap_file_set_bit -- called before performing a write to the md device
731 * to set (and eventually sync) a particular bit in the bitmap file
732 *
733 * we set the bit immediately, then we record the page number so that
734 * when an unplug occurs, we can flush the dirty pages out to disk
735 */
736static void bitmap_file_set_bit(struct bitmap *bitmap, sector_t block)
737{
738 unsigned long bit;
739 struct page *page;
740 void *kaddr;
741 unsigned long chunk = block >> CHUNK_BLOCK_SHIFT(bitmap);
742
743 if (!bitmap->filemap) {
744 return;
745 }
746
747 page = filemap_get_page(bitmap, chunk);
748 bit = file_page_offset(chunk);
749
750
751 /* make sure the page stays cached until it gets written out */
752 if (! (get_page_attr(bitmap, page) & BITMAP_PAGE_DIRTY))
753 page_cache_get(page);
754
755 /* set the bit */
756 kaddr = kmap_atomic(page, KM_USER0);
757 set_bit(bit, kaddr);
758 kunmap_atomic(kaddr, KM_USER0);
759 PRINTK("set file bit %lu page %lu\n", bit, page->index);
760
761 /* record page number so it gets flushed to disk when unplug occurs */
762 set_page_attr(bitmap, page, BITMAP_PAGE_DIRTY);
763
764}
765
766/* this gets called when the md device is ready to unplug its underlying
767 * (slave) device queues -- before we let any writes go down, we need to
768 * sync the dirty pages of the bitmap file to disk */
769int bitmap_unplug(struct bitmap *bitmap)
770{
771 unsigned long i, attr, flags;
772 struct page *page;
773 int wait = 0;
774 int err;
775
776 if (!bitmap)
777 return 0;
778
779 /* look at each page to see if there are any set bits that need to be
780 * flushed out to disk */
781 for (i = 0; i < bitmap->file_pages; i++) {
782 spin_lock_irqsave(&bitmap->lock, flags);
783 if (!bitmap->filemap) {
784 spin_unlock_irqrestore(&bitmap->lock, flags);
785 return 0;
786 }
787 page = bitmap->filemap[i];
788 attr = get_page_attr(bitmap, page);
789 clear_page_attr(bitmap, page, BITMAP_PAGE_DIRTY);
790 clear_page_attr(bitmap, page, BITMAP_PAGE_NEEDWRITE);
791 if ((attr & BITMAP_PAGE_DIRTY))
792 wait = 1;
793 spin_unlock_irqrestore(&bitmap->lock, flags);
794
795 if (attr & (BITMAP_PAGE_DIRTY | BITMAP_PAGE_NEEDWRITE)) {
796 err = write_page(bitmap, page, 0);
797 if (err == -EAGAIN) {
798 if (attr & BITMAP_PAGE_DIRTY)
799 err = write_page(bitmap, page, 1);
800 else
801 err = 0;
802 }
803 if (err)
804 return 1;
805 }
806 }
807 if (wait) { /* if any writes were performed, we need to wait on them */
808 if (bitmap->file) {
809 spin_lock_irq(&bitmap->write_lock);
810 wait_event_lock_irq(bitmap->write_wait,
811 list_empty(&bitmap->complete_pages), bitmap->write_lock,
812 wake_up_process(bitmap->writeback_daemon->tsk));
813 spin_unlock_irq(&bitmap->write_lock);
814 } else
815 wait_event(bitmap->mddev->sb_wait,
816 atomic_read(&bitmap->mddev->pending_writes)==0);
817 }
818 return 0;
819}
820
821static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset,
822 unsigned long sectors, int in_sync);
823/* * bitmap_init_from_disk -- called at bitmap_create time to initialize
824 * the in-memory bitmap from the on-disk bitmap -- also, sets up the
825 * memory mapping of the bitmap file
826 * Special cases:
827 * if there's no bitmap file, or if the bitmap file had been
828 * previously kicked from the array, we mark all the bits as
829 * 1's in order to cause a full resync.
830 */
831static int bitmap_init_from_disk(struct bitmap *bitmap, int in_sync)
832{
833 unsigned long i, chunks, index, oldindex, bit;
834 struct page *page = NULL, *oldpage = NULL;
835 unsigned long num_pages, bit_cnt = 0;
836 struct file *file;
837 unsigned long bytes, offset, dummy;
838 int outofdate;
839 int ret = -ENOSPC;
840
841 chunks = bitmap->chunks;
842 file = bitmap->file;
843
844 BUG_ON(!file && !bitmap->offset);
845
846#if INJECT_FAULTS_3
847 outofdate = 1;
848#else
849 outofdate = bitmap->flags & BITMAP_STALE;
850#endif
851 if (outofdate)
852 printk(KERN_INFO "%s: bitmap file is out of date, doing full "
853 "recovery\n", bmname(bitmap));
854
855 bytes = (chunks + 7) / 8;
856
857 num_pages = (bytes + sizeof(bitmap_super_t) + PAGE_SIZE - 1) / PAGE_SIZE;
858
859 if (file && i_size_read(file->f_mapping->host) < bytes + sizeof(bitmap_super_t)) {
860 printk(KERN_INFO "%s: bitmap file too short %lu < %lu\n",
861 bmname(bitmap),
862 (unsigned long) i_size_read(file->f_mapping->host),
863 bytes + sizeof(bitmap_super_t));
864 goto out;
865 }
866
867 ret = -ENOMEM;
868
869 bitmap->filemap = kmalloc(sizeof(struct page *) * num_pages, GFP_KERNEL);
870 if (!bitmap->filemap)
871 goto out;
872
873 bitmap->filemap_attr = kmalloc(sizeof(long) * num_pages, GFP_KERNEL);
874 if (!bitmap->filemap_attr)
875 goto out;
876
877 memset(bitmap->filemap_attr, 0, sizeof(long) * num_pages);
878
879 oldindex = ~0L;
880
881 for (i = 0; i < chunks; i++) {
882 index = file_page_index(i);
883 bit = file_page_offset(i);
884 if (index != oldindex) { /* this is a new page, read it in */
885 /* unmap the old page, we're done with it */
886 if (oldpage != NULL)
887 kunmap(oldpage);
888 if (index == 0) {
889 /*
890 * if we're here then the superblock page
891 * contains some bits (PAGE_SIZE != sizeof sb)
892 * we've already read it in, so just use it
893 */
894 page = bitmap->sb_page;
895 offset = sizeof(bitmap_super_t);
896 } else if (file) {
897 page = read_page(file, index, &dummy);
898 offset = 0;
899 } else {
900 page = read_sb_page(bitmap->mddev, bitmap->offset, index);
901 offset = 0;
902 }
903 if (IS_ERR(page)) { /* read error */
904 ret = PTR_ERR(page);
905 goto out;
906 }
907
908 oldindex = index;
909 oldpage = page;
910 kmap(page);
911
912 if (outofdate) {
913 /*
914 * if bitmap is out of date, dirty the
915 * whole page and write it out
916 */
917 memset(page_address(page) + offset, 0xff,
918 PAGE_SIZE - offset);
919 ret = write_page(bitmap, page, 1);
920 if (ret) {
921 kunmap(page);
922 /* release, page not in filemap yet */
923 page_cache_release(page);
924 goto out;
925 }
926 }
927
928 bitmap->filemap[bitmap->file_pages++] = page;
929 }
930 if (test_bit(bit, page_address(page))) {
931 /* if the disk bit is set, set the memory bit */
932 bitmap_set_memory_bits(bitmap,
933 i << CHUNK_BLOCK_SHIFT(bitmap), 1, in_sync);
934 bit_cnt++;
935 }
936 }
937
938 /* everything went OK */
939 ret = 0;
940 bitmap_mask_state(bitmap, BITMAP_STALE, MASK_UNSET);
941
942 if (page) /* unmap the last page */
943 kunmap(page);
944
945 if (bit_cnt) { /* Kick recovery if any bits were set */
946 set_bit(MD_RECOVERY_NEEDED, &bitmap->mddev->recovery);
947 md_wakeup_thread(bitmap->mddev->thread);
948 }
949
950out:
951 printk(KERN_INFO "%s: bitmap initialized from disk: "
952 "read %lu/%lu pages, set %lu bits, status: %d\n",
953 bmname(bitmap), bitmap->file_pages, num_pages, bit_cnt, ret);
954
955 return ret;
956}
957
958void bitmap_write_all(struct bitmap *bitmap)
959{
960 /* We don't actually write all bitmap blocks here,
961 * just flag them as needing to be written
962 */
963
964 unsigned long chunks = bitmap->chunks;
965 unsigned long bytes = (chunks+7)/8 + sizeof(bitmap_super_t);
966 unsigned long num_pages = (bytes + PAGE_SIZE-1) / PAGE_SIZE;
967 while (num_pages--)
968 bitmap->filemap_attr[num_pages] |= BITMAP_PAGE_NEEDWRITE;
969}
970
971
972static void bitmap_count_page(struct bitmap *bitmap, sector_t offset, int inc)
973{
974 sector_t chunk = offset >> CHUNK_BLOCK_SHIFT(bitmap);
975 unsigned long page = chunk >> PAGE_COUNTER_SHIFT;
976 bitmap->bp[page].count += inc;
977/*
978 if (page == 0) printk("count page 0, offset %llu: %d gives %d\n",
979 (unsigned long long)offset, inc, bitmap->bp[page].count);
980*/
981 bitmap_checkfree(bitmap, page);
982}
983static bitmap_counter_t *bitmap_get_counter(struct bitmap *bitmap,
984 sector_t offset, int *blocks,
985 int create);
986
987/*
988 * bitmap daemon -- periodically wakes up to clean bits and flush pages
989 * out to disk
990 */
991
992int bitmap_daemon_work(struct bitmap *bitmap)
993{
994 unsigned long j;
995 unsigned long flags;
996 struct page *page = NULL, *lastpage = NULL;
997 int err = 0;
998 int blocks;
999 int attr;
1000
1001 if (bitmap == NULL)
1002 return 0;
1003 if (time_before(jiffies, bitmap->daemon_lastrun + bitmap->daemon_sleep*HZ))
1004 return 0;
1005 bitmap->daemon_lastrun = jiffies;
1006
1007 for (j = 0; j < bitmap->chunks; j++) {
1008 bitmap_counter_t *bmc;
1009 spin_lock_irqsave(&bitmap->lock, flags);
1010 if (!bitmap->filemap) {
1011 /* error or shutdown */
1012 spin_unlock_irqrestore(&bitmap->lock, flags);
1013 break;
1014 }
1015
1016 page = filemap_get_page(bitmap, j);
1017
1018 if (page != lastpage) {
1019 /* skip this page unless it's marked as needing cleaning */
1020 if (!((attr=get_page_attr(bitmap, page)) & BITMAP_PAGE_CLEAN)) {
1021 if (attr & BITMAP_PAGE_NEEDWRITE) {
1022 page_cache_get(page);
1023 clear_page_attr(bitmap, page, BITMAP_PAGE_NEEDWRITE);
1024 }
1025 spin_unlock_irqrestore(&bitmap->lock, flags);
1026 if (attr & BITMAP_PAGE_NEEDWRITE) {
1027 switch (write_page(bitmap, page, 0)) {
1028 case -EAGAIN:
1029 set_page_attr(bitmap, page, BITMAP_PAGE_NEEDWRITE);
1030 break;
1031 case 0:
1032 break;
1033 default:
1034 bitmap_file_kick(bitmap);
1035 }
1036 page_cache_release(page);
1037 }
1038 continue;
1039 }
1040
1041 /* grab the new page, sync and release the old */
1042 page_cache_get(page);
1043 if (lastpage != NULL) {
1044 if (get_page_attr(bitmap, lastpage) & BITMAP_PAGE_NEEDWRITE) {
1045 clear_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE);
1046 spin_unlock_irqrestore(&bitmap->lock, flags);
1047 err = write_page(bitmap, lastpage, 0);
1048 if (err == -EAGAIN) {
1049 err = 0;
1050 set_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE);
1051 }
1052 } else {
1053 set_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE);
1054 spin_unlock_irqrestore(&bitmap->lock, flags);
1055 }
1056 kunmap(lastpage);
1057 page_cache_release(lastpage);
1058 if (err)
1059 bitmap_file_kick(bitmap);
1060 } else
1061 spin_unlock_irqrestore(&bitmap->lock, flags);
1062 lastpage = page;
1063 kmap(page);
1064/*
1065 printk("bitmap clean at page %lu\n", j);
1066*/
1067 spin_lock_irqsave(&bitmap->lock, flags);
1068 clear_page_attr(bitmap, page, BITMAP_PAGE_CLEAN);
1069 }
1070 bmc = bitmap_get_counter(bitmap, j << CHUNK_BLOCK_SHIFT(bitmap),
1071 &blocks, 0);
1072 if (bmc) {
1073/*
1074 if (j < 100) printk("bitmap: j=%lu, *bmc = 0x%x\n", j, *bmc);
1075*/
1076 if (*bmc == 2) {
1077 *bmc=1; /* maybe clear the bit next time */
1078 set_page_attr(bitmap, page, BITMAP_PAGE_CLEAN);
1079 } else if (*bmc == 1) {
1080 /* we can clear the bit */
1081 *bmc = 0;
1082 bitmap_count_page(bitmap, j << CHUNK_BLOCK_SHIFT(bitmap),
1083 -1);
1084
1085 /* clear the bit */
1086 clear_bit(file_page_offset(j), page_address(page));
1087 }
1088 }
1089 spin_unlock_irqrestore(&bitmap->lock, flags);
1090 }
1091
1092 /* now sync the final page */
1093 if (lastpage != NULL) {
1094 kunmap(lastpage);
1095 spin_lock_irqsave(&bitmap->lock, flags);
1096 if (get_page_attr(bitmap, lastpage) &BITMAP_PAGE_NEEDWRITE) {
1097 clear_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE);
1098 spin_unlock_irqrestore(&bitmap->lock, flags);
1099 err = write_page(bitmap, lastpage, 0);
1100 if (err == -EAGAIN) {
1101 set_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE);
1102 err = 0;
1103 }
1104 } else {
1105 set_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE);
1106 spin_unlock_irqrestore(&bitmap->lock, flags);
1107 }
1108
1109 page_cache_release(lastpage);
1110 }
1111
1112 return err;
1113}
1114
1115static void daemon_exit(struct bitmap *bitmap, mdk_thread_t **daemon)
1116{
1117 mdk_thread_t *dmn;
1118 unsigned long flags;
1119
1120 /* if no one is waiting on us, we'll free the md thread struct
1121 * and exit, otherwise we let the waiter clean things up */
1122 spin_lock_irqsave(&bitmap->lock, flags);
1123 if ((dmn = *daemon)) { /* no one is waiting, cleanup and exit */
1124 *daemon = NULL;
1125 spin_unlock_irqrestore(&bitmap->lock, flags);
1126 kfree(dmn);
1127 complete_and_exit(NULL, 0); /* do_exit not exported */
1128 }
1129 spin_unlock_irqrestore(&bitmap->lock, flags);
1130}
1131
1132static void bitmap_writeback_daemon(mddev_t *mddev)
1133{
1134 struct bitmap *bitmap = mddev->bitmap;
1135 struct page *page;
1136 struct page_list *item;
1137 int err = 0;
1138
1139 if (signal_pending(current)) {
1140 printk(KERN_INFO
1141 "%s: bitmap writeback daemon got signal, exiting...\n",
1142 bmname(bitmap));
1143 err = -EINTR;
1144 goto out;
1145 }
1146
1147 PRINTK("%s: bitmap writeback daemon woke up...\n", bmname(bitmap));
1148 /* wait on bitmap page writebacks */
1149 while ((item = dequeue_page(bitmap))) {
1150 page = item->page;
1151 mempool_free(item, bitmap->write_pool);
1152 PRINTK("wait on page writeback: %p\n", page);
1153 wait_on_page_writeback(page);
1154 PRINTK("finished page writeback: %p\n", page);
1155
1156 err = PageError(page);
1157 page_cache_release(page);
1158 if (err) {
1159 printk(KERN_WARNING "%s: bitmap file writeback "
1160 "failed (page %lu): %d\n",
1161 bmname(bitmap), page->index, err);
1162 bitmap_file_kick(bitmap);
1163 goto out;
1164 }
1165 }
1166 out:
1167 wake_up(&bitmap->write_wait);
1168 if (err) {
1169 printk(KERN_INFO "%s: bitmap writeback daemon exiting (%d)\n",
1170 bmname(bitmap), err);
1171 daemon_exit(bitmap, &bitmap->writeback_daemon);
1172 }
1173}
1174
1175static int bitmap_start_daemon(struct bitmap *bitmap, mdk_thread_t **ptr,
1176 void (*func)(mddev_t *), char *name)
1177{
1178 mdk_thread_t *daemon;
1179 unsigned long flags;
1180 char namebuf[32];
1181
1182 spin_lock_irqsave(&bitmap->lock, flags);
1183 *ptr = NULL;
1184
1185 if (!bitmap->file) /* no need for daemon if there's no backing file */
1186 goto out_unlock;
1187
1188 spin_unlock_irqrestore(&bitmap->lock, flags);
1189
1190#if INJECT_FATAL_FAULT_2
1191 daemon = NULL;
1192#else
1193 sprintf(namebuf, "%%s_%s", name);
1194 daemon = md_register_thread(func, bitmap->mddev, namebuf);
1195#endif
1196 if (!daemon) {
1197 printk(KERN_ERR "%s: failed to start bitmap daemon\n",
1198 bmname(bitmap));
1199 return -ECHILD;
1200 }
1201
1202 spin_lock_irqsave(&bitmap->lock, flags);
1203 *ptr = daemon;
1204
1205 md_wakeup_thread(daemon); /* start it running */
1206
1207 PRINTK("%s: %s daemon (pid %d) started...\n",
1208 bmname(bitmap), name, daemon->tsk->pid);
1209out_unlock:
1210 spin_unlock_irqrestore(&bitmap->lock, flags);
1211 return 0;
1212}
1213
1214static int bitmap_start_daemons(struct bitmap *bitmap)
1215{
1216 int err = bitmap_start_daemon(bitmap, &bitmap->writeback_daemon,
1217 bitmap_writeback_daemon, "bitmap_wb");
1218 return err;
1219}
1220
1221static void bitmap_stop_daemon(struct bitmap *bitmap, mdk_thread_t **ptr)
1222{
1223 mdk_thread_t *daemon;
1224 unsigned long flags;
1225
1226 spin_lock_irqsave(&bitmap->lock, flags);
1227 daemon = *ptr;
1228 *ptr = NULL;
1229 spin_unlock_irqrestore(&bitmap->lock, flags);
1230 if (daemon)
1231 md_unregister_thread(daemon); /* destroy the thread */
1232}
1233
1234static void bitmap_stop_daemons(struct bitmap *bitmap)
1235{
1236 /* the daemons can't stop themselves... they'll just exit instead... */
1237 if (bitmap->writeback_daemon &&
1238 current->pid != bitmap->writeback_daemon->tsk->pid)
1239 bitmap_stop_daemon(bitmap, &bitmap->writeback_daemon);
1240}
1241
1242static bitmap_counter_t *bitmap_get_counter(struct bitmap *bitmap,
1243 sector_t offset, int *blocks,
1244 int create)
1245{
1246 /* If 'create', we might release the lock and reclaim it.
1247 * The lock must have been taken with interrupts enabled.
1248 * If !create, we don't release the lock.
1249 */
1250 sector_t chunk = offset >> CHUNK_BLOCK_SHIFT(bitmap);
1251 unsigned long page = chunk >> PAGE_COUNTER_SHIFT;
1252 unsigned long pageoff = (chunk & PAGE_COUNTER_MASK) << COUNTER_BYTE_SHIFT;
1253 sector_t csize;
1254
1255 if (bitmap_checkpage(bitmap, page, create) < 0) {
1256 csize = ((sector_t)1) << (CHUNK_BLOCK_SHIFT(bitmap));
1257 *blocks = csize - (offset & (csize- 1));
1258 return NULL;
1259 }
1260 /* now locked ... */
1261
1262 if (bitmap->bp[page].hijacked) { /* hijacked pointer */
1263 /* should we use the first or second counter field
1264 * of the hijacked pointer? */
1265 int hi = (pageoff > PAGE_COUNTER_MASK);
1266 csize = ((sector_t)1) << (CHUNK_BLOCK_SHIFT(bitmap) +
1267 PAGE_COUNTER_SHIFT - 1);
1268 *blocks = csize - (offset & (csize- 1));
1269 return &((bitmap_counter_t *)
1270 &bitmap->bp[page].map)[hi];
1271 } else { /* page is allocated */
1272 csize = ((sector_t)1) << (CHUNK_BLOCK_SHIFT(bitmap));
1273 *blocks = csize - (offset & (csize- 1));
1274 return (bitmap_counter_t *)
1275 &(bitmap->bp[page].map[pageoff]);
1276 }
1277}
1278
1279int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors)
1280{
1281 if (!bitmap) return 0;
1282 while (sectors) {
1283 int blocks;
1284 bitmap_counter_t *bmc;
1285
1286 spin_lock_irq(&bitmap->lock);
1287 bmc = bitmap_get_counter(bitmap, offset, &blocks, 1);
1288 if (!bmc) {
1289 spin_unlock_irq(&bitmap->lock);
1290 return 0;
1291 }
1292
1293 switch(*bmc) {
1294 case 0:
1295 bitmap_file_set_bit(bitmap, offset);
1296 bitmap_count_page(bitmap,offset, 1);
1297 blk_plug_device(bitmap->mddev->queue);
1298 /* fall through */
1299 case 1:
1300 *bmc = 2;
1301 }
1302 if ((*bmc & COUNTER_MAX) == COUNTER_MAX) BUG();
1303 (*bmc)++;
1304
1305 spin_unlock_irq(&bitmap->lock);
1306
1307 offset += blocks;
1308 if (sectors > blocks)
1309 sectors -= blocks;
1310 else sectors = 0;
1311 }
1312 return 0;
1313}
1314
1315void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors,
1316 int success)
1317{
1318 if (!bitmap) return;
1319 while (sectors) {
1320 int blocks;
1321 unsigned long flags;
1322 bitmap_counter_t *bmc;
1323
1324 spin_lock_irqsave(&bitmap->lock, flags);
1325 bmc = bitmap_get_counter(bitmap, offset, &blocks, 0);
1326 if (!bmc) {
1327 spin_unlock_irqrestore(&bitmap->lock, flags);
1328 return;
1329 }
1330
1331 if (!success && ! (*bmc & NEEDED_MASK))
1332 *bmc |= NEEDED_MASK;
1333
1334 (*bmc)--;
1335 if (*bmc <= 2) {
1336 set_page_attr(bitmap,
1337 filemap_get_page(bitmap, offset >> CHUNK_BLOCK_SHIFT(bitmap)),
1338 BITMAP_PAGE_CLEAN);
1339 }
1340 spin_unlock_irqrestore(&bitmap->lock, flags);
1341 offset += blocks;
1342 if (sectors > blocks)
1343 sectors -= blocks;
1344 else sectors = 0;
1345 }
1346}
1347
1348int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks)
1349{
1350 bitmap_counter_t *bmc;
1351 int rv;
1352 if (bitmap == NULL) {/* FIXME or bitmap set as 'failed' */
1353 *blocks = 1024;
1354 return 1; /* always resync if no bitmap */
1355 }
1356 spin_lock_irq(&bitmap->lock);
1357 bmc = bitmap_get_counter(bitmap, offset, blocks, 0);
1358 rv = 0;
1359 if (bmc) {
1360 /* locked */
1361 if (RESYNC(*bmc))
1362 rv = 1;
1363 else if (NEEDED(*bmc)) {
1364 rv = 1;
1365 *bmc |= RESYNC_MASK;
1366 *bmc &= ~NEEDED_MASK;
1367 }
1368 }
1369 spin_unlock_irq(&bitmap->lock);
1370 return rv;
1371}
1372
1373void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted)
1374{
1375 bitmap_counter_t *bmc;
1376 unsigned long flags;
1377/*
1378 if (offset == 0) printk("bitmap_end_sync 0 (%d)\n", aborted);
1379*/ if (bitmap == NULL) {
1380 *blocks = 1024;
1381 return;
1382 }
1383 spin_lock_irqsave(&bitmap->lock, flags);
1384 bmc = bitmap_get_counter(bitmap, offset, blocks, 0);
1385 if (bmc == NULL)
1386 goto unlock;
1387 /* locked */
1388/*
1389 if (offset == 0) printk("bitmap_end sync found 0x%x, blocks %d\n", *bmc, *blocks);
1390*/
1391 if (RESYNC(*bmc)) {
1392 *bmc &= ~RESYNC_MASK;
1393
1394 if (!NEEDED(*bmc) && aborted)
1395 *bmc |= NEEDED_MASK;
1396 else {
1397 if (*bmc <= 2) {
1398 set_page_attr(bitmap,
1399 filemap_get_page(bitmap, offset >> CHUNK_BLOCK_SHIFT(bitmap)),
1400 BITMAP_PAGE_CLEAN);
1401 }
1402 }
1403 }
1404 unlock:
1405 spin_unlock_irqrestore(&bitmap->lock, flags);
1406}
1407
1408void bitmap_close_sync(struct bitmap *bitmap)
1409{
1410 /* Sync has finished, and any bitmap chunks that weren't synced
1411 * properly have been aborted. It remains to us to clear the
1412 * RESYNC bit wherever it is still on
1413 */
1414 sector_t sector = 0;
1415 int blocks;
1416 if (!bitmap) return;
1417 while (sector < bitmap->mddev->resync_max_sectors) {
1418 bitmap_end_sync(bitmap, sector, &blocks, 0);
1419/*
1420 if (sector < 500) printk("bitmap_close_sync: sec %llu blks %d\n",
1421 (unsigned long long)sector, blocks);
1422*/ sector += blocks;
1423 }
1424}
1425
1426static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset,
1427 unsigned long sectors, int in_sync)
1428{
1429 /* For each chunk covered by any of these sectors, set the
1430 * counter to 1 and set resync_needed unless in_sync. They should all
1431 * be 0 at this point
1432 */
1433 while (sectors) {
1434 int secs;
1435 bitmap_counter_t *bmc;
1436 spin_lock_irq(&bitmap->lock);
1437 bmc = bitmap_get_counter(bitmap, offset, &secs, 1);
1438 if (!bmc) {
1439 spin_unlock_irq(&bitmap->lock);
1440 return;
1441 }
1442 if (! *bmc) {
1443 struct page *page;
1444 *bmc = 1 | (in_sync? 0 : NEEDED_MASK);
1445 bitmap_count_page(bitmap, offset, 1);
1446 page = filemap_get_page(bitmap, offset >> CHUNK_BLOCK_SHIFT(bitmap));
1447 set_page_attr(bitmap, page, BITMAP_PAGE_CLEAN);
1448 }
1449 spin_unlock_irq(&bitmap->lock);
1450 if (sectors > secs)
1451 sectors -= secs;
1452 else
1453 sectors = 0;
1454 }
1455}
1456
1457/*
1458 * free memory that was allocated
1459 */
1460void bitmap_destroy(mddev_t *mddev)
1461{
1462 unsigned long k, pages;
1463 struct bitmap_page *bp;
1464 struct bitmap *bitmap = mddev->bitmap;
1465
1466 if (!bitmap) /* there was no bitmap */
1467 return;
1468
1469 mddev->bitmap = NULL; /* disconnect from the md device */
1470
1471 /* release the bitmap file and kill the daemon */
1472 bitmap_file_put(bitmap);
1473
1474 bp = bitmap->bp;
1475 pages = bitmap->pages;
1476
1477 /* free all allocated memory */
1478
1479 mempool_destroy(bitmap->write_pool);
1480
1481 if (bp) /* deallocate the page memory */
1482 for (k = 0; k < pages; k++)
1483 if (bp[k].map && !bp[k].hijacked)
1484 kfree(bp[k].map);
1485 kfree(bp);
1486 kfree(bitmap);
1487}
1488
1489/*
1490 * initialize the bitmap structure
1491 * if this returns an error, bitmap_destroy must be called to do clean up
1492 */
1493int bitmap_create(mddev_t *mddev)
1494{
1495 struct bitmap *bitmap;
1496 unsigned long blocks = mddev->resync_max_sectors;
1497 unsigned long chunks;
1498 unsigned long pages;
1499 struct file *file = mddev->bitmap_file;
1500 int err;
1501
1502 BUG_ON(sizeof(bitmap_super_t) != 256);
1503
1504 if (!file && !mddev->bitmap_offset) /* bitmap disabled, nothing to do */
1505 return 0;
1506
1507 BUG_ON(file && mddev->bitmap_offset);
1508
1509 bitmap = kmalloc(sizeof(*bitmap), GFP_KERNEL);
1510 if (!bitmap)
1511 return -ENOMEM;
1512
1513 memset(bitmap, 0, sizeof(*bitmap));
1514
1515 spin_lock_init(&bitmap->lock);
1516 bitmap->mddev = mddev;
1517 mddev->bitmap = bitmap;
1518
1519 spin_lock_init(&bitmap->write_lock);
1520 INIT_LIST_HEAD(&bitmap->complete_pages);
1521 init_waitqueue_head(&bitmap->write_wait);
1522 bitmap->write_pool = mempool_create(WRITE_POOL_SIZE, write_pool_alloc,
1523 write_pool_free, NULL);
1524 if (!bitmap->write_pool)
1525 return -ENOMEM;
1526
1527 bitmap->file = file;
1528 bitmap->offset = mddev->bitmap_offset;
1529 if (file) get_file(file);
1530 /* read superblock from bitmap file (this sets bitmap->chunksize) */
1531 err = bitmap_read_sb(bitmap);
1532 if (err)
1533 return err;
1534
1535 bitmap->chunkshift = find_first_bit(&bitmap->chunksize,
1536 sizeof(bitmap->chunksize));
1537
1538 /* now that chunksize and chunkshift are set, we can use these macros */
1539 chunks = (blocks + CHUNK_BLOCK_RATIO(bitmap) - 1) /
1540 CHUNK_BLOCK_RATIO(bitmap);
1541 pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO;
1542
1543 BUG_ON(!pages);
1544
1545 bitmap->chunks = chunks;
1546 bitmap->pages = pages;
1547 bitmap->missing_pages = pages;
1548 bitmap->counter_bits = COUNTER_BITS;
1549
1550 bitmap->syncchunk = ~0UL;
1551
1552#if INJECT_FATAL_FAULT_1
1553 bitmap->bp = NULL;
1554#else
1555 bitmap->bp = kmalloc(pages * sizeof(*bitmap->bp), GFP_KERNEL);
1556#endif
1557 if (!bitmap->bp)
1558 return -ENOMEM;
1559 memset(bitmap->bp, 0, pages * sizeof(*bitmap->bp));
1560
1561 bitmap->flags |= BITMAP_ACTIVE;
1562
1563 /* now that we have some pages available, initialize the in-memory
1564 * bitmap from the on-disk bitmap */
1565 err = bitmap_init_from_disk(bitmap, mddev->recovery_cp == MaxSector);
1566 if (err)
1567 return err;
1568
1569 printk(KERN_INFO "created bitmap (%lu pages) for device %s\n",
1570 pages, bmname(bitmap));
1571
1572 /* kick off the bitmap daemons */
1573 err = bitmap_start_daemons(bitmap);
1574 if (err)
1575 return err;
1576 return bitmap_update_sb(bitmap);
1577}
1578
1579/* the bitmap API -- for raid personalities */
1580EXPORT_SYMBOL(bitmap_startwrite);
1581EXPORT_SYMBOL(bitmap_endwrite);
1582EXPORT_SYMBOL(bitmap_start_sync);
1583EXPORT_SYMBOL(bitmap_end_sync);
1584EXPORT_SYMBOL(bitmap_unplug);
1585EXPORT_SYMBOL(bitmap_close_sync);
1586EXPORT_SYMBOL(bitmap_daemon_work);
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 0dd6c2b5391b..d0a4bab220e5 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -704,8 +704,7 @@ static void crypt_dtr(struct dm_target *ti)
704 mempool_destroy(cc->page_pool); 704 mempool_destroy(cc->page_pool);
705 mempool_destroy(cc->io_pool); 705 mempool_destroy(cc->io_pool);
706 706
707 if (cc->iv_mode) 707 kfree(cc->iv_mode);
708 kfree(cc->iv_mode);
709 if (cc->iv_gen_ops && cc->iv_gen_ops->dtr) 708 if (cc->iv_gen_ops && cc->iv_gen_ops->dtr)
710 cc->iv_gen_ops->dtr(cc); 709 cc->iv_gen_ops->dtr(cc);
711 crypto_free_tfm(cc->tfm); 710 crypto_free_tfm(cc->tfm);
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 1e97b3c12bd5..0c1b8520ef86 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -985,6 +985,9 @@ static int do_end_io(struct multipath *m, struct bio *bio,
985 if (!error) 985 if (!error)
986 return 0; /* I/O complete */ 986 return 0; /* I/O complete */
987 987
988 if ((error == -EWOULDBLOCK) && bio_rw_ahead(bio))
989 return error;
990
988 spin_lock(&m->lock); 991 spin_lock(&m->lock);
989 if (!m->nr_valid_paths) { 992 if (!m->nr_valid_paths) {
990 if (!m->queue_if_no_path || m->suspended) { 993 if (!m->queue_if_no_path || m->suspended) {
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index b1941b887f46..8d740013d74d 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -217,8 +217,7 @@ static int linear_run (mddev_t *mddev)
217 return 0; 217 return 0;
218 218
219out: 219out:
220 if (conf) 220 kfree(conf);
221 kfree(conf);
222 return 1; 221 return 1;
223} 222}
224 223
diff --git a/drivers/md/md.c b/drivers/md/md.c
index d899204d3743..0c6b5b6baff6 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -19,6 +19,9 @@
19 19
20 Neil Brown <neilb@cse.unsw.edu.au>. 20 Neil Brown <neilb@cse.unsw.edu.au>.
21 21
22 - persistent bitmap code
23 Copyright (C) 2003-2004, Paul Clements, SteelEye Technology, Inc.
24
22 This program is free software; you can redistribute it and/or modify 25 This program is free software; you can redistribute it and/or modify
23 it under the terms of the GNU General Public License as published by 26 it under the terms of the GNU General Public License as published by
24 the Free Software Foundation; either version 2, or (at your option) 27 the Free Software Foundation; either version 2, or (at your option)
@@ -33,6 +36,7 @@
33#include <linux/config.h> 36#include <linux/config.h>
34#include <linux/linkage.h> 37#include <linux/linkage.h>
35#include <linux/raid/md.h> 38#include <linux/raid/md.h>
39#include <linux/raid/bitmap.h>
36#include <linux/sysctl.h> 40#include <linux/sysctl.h>
37#include <linux/devfs_fs_kernel.h> 41#include <linux/devfs_fs_kernel.h>
38#include <linux/buffer_head.h> /* for invalidate_bdev */ 42#include <linux/buffer_head.h> /* for invalidate_bdev */
@@ -40,6 +44,8 @@
40 44
41#include <linux/init.h> 45#include <linux/init.h>
42 46
47#include <linux/file.h>
48
43#ifdef CONFIG_KMOD 49#ifdef CONFIG_KMOD
44#include <linux/kmod.h> 50#include <linux/kmod.h>
45#endif 51#endif
@@ -189,8 +195,7 @@ static mddev_t * mddev_find(dev_t unit)
189 if (mddev->unit == unit) { 195 if (mddev->unit == unit) {
190 mddev_get(mddev); 196 mddev_get(mddev);
191 spin_unlock(&all_mddevs_lock); 197 spin_unlock(&all_mddevs_lock);
192 if (new) 198 kfree(new);
193 kfree(new);
194 return mddev; 199 return mddev;
195 } 200 }
196 201
@@ -218,6 +223,8 @@ static mddev_t * mddev_find(dev_t unit)
218 INIT_LIST_HEAD(&new->all_mddevs); 223 INIT_LIST_HEAD(&new->all_mddevs);
219 init_timer(&new->safemode_timer); 224 init_timer(&new->safemode_timer);
220 atomic_set(&new->active, 1); 225 atomic_set(&new->active, 1);
226 spin_lock_init(&new->write_lock);
227 init_waitqueue_head(&new->sb_wait);
221 228
222 new->queue = blk_alloc_queue(GFP_KERNEL); 229 new->queue = blk_alloc_queue(GFP_KERNEL);
223 if (!new->queue) { 230 if (!new->queue) {
@@ -320,6 +327,40 @@ static void free_disk_sb(mdk_rdev_t * rdev)
320} 327}
321 328
322 329
330static int super_written(struct bio *bio, unsigned int bytes_done, int error)
331{
332 mdk_rdev_t *rdev = bio->bi_private;
333 if (bio->bi_size)
334 return 1;
335
336 if (error || !test_bit(BIO_UPTODATE, &bio->bi_flags))
337 md_error(rdev->mddev, rdev);
338
339 if (atomic_dec_and_test(&rdev->mddev->pending_writes))
340 wake_up(&rdev->mddev->sb_wait);
341 return 0;
342}
343
344void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev,
345 sector_t sector, int size, struct page *page)
346{
347 /* write first size bytes of page to sector of rdev
348 * Increment mddev->pending_writes before returning
349 * and decrement it on completion, waking up sb_wait
350 * if zero is reached.
351 * If an error occurred, call md_error
352 */
353 struct bio *bio = bio_alloc(GFP_NOIO, 1);
354
355 bio->bi_bdev = rdev->bdev;
356 bio->bi_sector = sector;
357 bio_add_page(bio, page, size, 0);
358 bio->bi_private = rdev;
359 bio->bi_end_io = super_written;
360 atomic_inc(&mddev->pending_writes);
361 submit_bio((1<<BIO_RW)|(1<<BIO_RW_SYNC), bio);
362}
363
323static int bi_complete(struct bio *bio, unsigned int bytes_done, int error) 364static int bi_complete(struct bio *bio, unsigned int bytes_done, int error)
324{ 365{
325 if (bio->bi_size) 366 if (bio->bi_size)
@@ -329,7 +370,7 @@ static int bi_complete(struct bio *bio, unsigned int bytes_done, int error)
329 return 0; 370 return 0;
330} 371}
331 372
332static int sync_page_io(struct block_device *bdev, sector_t sector, int size, 373int sync_page_io(struct block_device *bdev, sector_t sector, int size,
333 struct page *page, int rw) 374 struct page *page, int rw)
334{ 375{
335 struct bio *bio = bio_alloc(GFP_NOIO, 1); 376 struct bio *bio = bio_alloc(GFP_NOIO, 1);
@@ -416,11 +457,8 @@ static int sb_equal(mdp_super_t *sb1, mdp_super_t *sb2)
416 ret = 1; 457 ret = 1;
417 458
418abort: 459abort:
419 if (tmp1) 460 kfree(tmp1);
420 kfree(tmp1); 461 kfree(tmp2);
421 if (tmp2)
422 kfree(tmp2);
423
424 return ret; 462 return ret;
425} 463}
426 464
@@ -569,6 +607,8 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev)
569 mdp_disk_t *desc; 607 mdp_disk_t *desc;
570 mdp_super_t *sb = (mdp_super_t *)page_address(rdev->sb_page); 608 mdp_super_t *sb = (mdp_super_t *)page_address(rdev->sb_page);
571 609
610 rdev->raid_disk = -1;
611 rdev->in_sync = 0;
572 if (mddev->raid_disks == 0) { 612 if (mddev->raid_disks == 0) {
573 mddev->major_version = 0; 613 mddev->major_version = 0;
574 mddev->minor_version = sb->minor_version; 614 mddev->minor_version = sb->minor_version;
@@ -599,16 +639,35 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev)
599 memcpy(mddev->uuid+12,&sb->set_uuid3, 4); 639 memcpy(mddev->uuid+12,&sb->set_uuid3, 4);
600 640
601 mddev->max_disks = MD_SB_DISKS; 641 mddev->max_disks = MD_SB_DISKS;
602 } else { 642
603 __u64 ev1; 643 if (sb->state & (1<<MD_SB_BITMAP_PRESENT) &&
604 ev1 = md_event(sb); 644 mddev->bitmap_file == NULL) {
645 if (mddev->level != 1) {
646 /* FIXME use a better test */
647 printk(KERN_WARNING "md: bitmaps only support for raid1\n");
648 return -EINVAL;
649 }
650 mddev->bitmap_offset = (MD_SB_BYTES >> 9);
651 }
652
653 } else if (mddev->pers == NULL) {
654 /* Insist on good event counter while assembling */
655 __u64 ev1 = md_event(sb);
605 ++ev1; 656 ++ev1;
606 if (ev1 < mddev->events) 657 if (ev1 < mddev->events)
607 return -EINVAL; 658 return -EINVAL;
608 } 659 } else if (mddev->bitmap) {
660 /* if adding to array with a bitmap, then we can accept an
661 * older device ... but not too old.
662 */
663 __u64 ev1 = md_event(sb);
664 if (ev1 < mddev->bitmap->events_cleared)
665 return 0;
666 } else /* just a hot-add of a new device, leave raid_disk at -1 */
667 return 0;
668
609 if (mddev->level != LEVEL_MULTIPATH) { 669 if (mddev->level != LEVEL_MULTIPATH) {
610 rdev->raid_disk = -1; 670 rdev->faulty = 0;
611 rdev->in_sync = rdev->faulty = 0;
612 desc = sb->disks + rdev->desc_nr; 671 desc = sb->disks + rdev->desc_nr;
613 672
614 if (desc->state & (1<<MD_DISK_FAULTY)) 673 if (desc->state & (1<<MD_DISK_FAULTY))
@@ -618,7 +677,8 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev)
618 rdev->in_sync = 1; 677 rdev->in_sync = 1;
619 rdev->raid_disk = desc->raid_disk; 678 rdev->raid_disk = desc->raid_disk;
620 } 679 }
621 } 680 } else /* MULTIPATH are always insync */
681 rdev->in_sync = 1;
622 return 0; 682 return 0;
623} 683}
624 684
@@ -683,6 +743,9 @@ static void super_90_sync(mddev_t *mddev, mdk_rdev_t *rdev)
683 sb->layout = mddev->layout; 743 sb->layout = mddev->layout;
684 sb->chunk_size = mddev->chunk_size; 744 sb->chunk_size = mddev->chunk_size;
685 745
746 if (mddev->bitmap && mddev->bitmap_file == NULL)
747 sb->state |= (1<<MD_SB_BITMAP_PRESENT);
748
686 sb->disks[0].state = (1<<MD_DISK_REMOVED); 749 sb->disks[0].state = (1<<MD_DISK_REMOVED);
687 ITERATE_RDEV(mddev,rdev2,tmp) { 750 ITERATE_RDEV(mddev,rdev2,tmp) {
688 mdp_disk_t *d; 751 mdp_disk_t *d;
@@ -780,7 +843,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
780 case 0: 843 case 0:
781 sb_offset = rdev->bdev->bd_inode->i_size >> 9; 844 sb_offset = rdev->bdev->bd_inode->i_size >> 9;
782 sb_offset -= 8*2; 845 sb_offset -= 8*2;
783 sb_offset &= ~(4*2-1); 846 sb_offset &= ~(sector_t)(4*2-1);
784 /* convert from sectors to K */ 847 /* convert from sectors to K */
785 sb_offset /= 2; 848 sb_offset /= 2;
786 break; 849 break;
@@ -860,6 +923,8 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
860{ 923{
861 struct mdp_superblock_1 *sb = (struct mdp_superblock_1*)page_address(rdev->sb_page); 924 struct mdp_superblock_1 *sb = (struct mdp_superblock_1*)page_address(rdev->sb_page);
862 925
926 rdev->raid_disk = -1;
927 rdev->in_sync = 0;
863 if (mddev->raid_disks == 0) { 928 if (mddev->raid_disks == 0) {
864 mddev->major_version = 1; 929 mddev->major_version = 1;
865 mddev->patch_version = 0; 930 mddev->patch_version = 0;
@@ -877,13 +942,30 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
877 memcpy(mddev->uuid, sb->set_uuid, 16); 942 memcpy(mddev->uuid, sb->set_uuid, 16);
878 943
879 mddev->max_disks = (4096-256)/2; 944 mddev->max_disks = (4096-256)/2;
880 } else { 945
881 __u64 ev1; 946 if ((le32_to_cpu(sb->feature_map) & 1) &&
882 ev1 = le64_to_cpu(sb->events); 947 mddev->bitmap_file == NULL ) {
948 if (mddev->level != 1) {
949 printk(KERN_WARNING "md: bitmaps only supported for raid1\n");
950 return -EINVAL;
951 }
952 mddev->bitmap_offset = (__s32)le32_to_cpu(sb->bitmap_offset);
953 }
954 } else if (mddev->pers == NULL) {
955 /* Insist of good event counter while assembling */
956 __u64 ev1 = le64_to_cpu(sb->events);
883 ++ev1; 957 ++ev1;
884 if (ev1 < mddev->events) 958 if (ev1 < mddev->events)
885 return -EINVAL; 959 return -EINVAL;
886 } 960 } else if (mddev->bitmap) {
961 /* If adding to array with a bitmap, then we can accept an
962 * older device, but not too old.
963 */
964 __u64 ev1 = le64_to_cpu(sb->events);
965 if (ev1 < mddev->bitmap->events_cleared)
966 return 0;
967 } else /* just a hot-add of a new device, leave raid_disk at -1 */
968 return 0;
887 969
888 if (mddev->level != LEVEL_MULTIPATH) { 970 if (mddev->level != LEVEL_MULTIPATH) {
889 int role; 971 int role;
@@ -891,14 +973,10 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
891 role = le16_to_cpu(sb->dev_roles[rdev->desc_nr]); 973 role = le16_to_cpu(sb->dev_roles[rdev->desc_nr]);
892 switch(role) { 974 switch(role) {
893 case 0xffff: /* spare */ 975 case 0xffff: /* spare */
894 rdev->in_sync = 0;
895 rdev->faulty = 0; 976 rdev->faulty = 0;
896 rdev->raid_disk = -1;
897 break; 977 break;
898 case 0xfffe: /* faulty */ 978 case 0xfffe: /* faulty */
899 rdev->in_sync = 0;
900 rdev->faulty = 1; 979 rdev->faulty = 1;
901 rdev->raid_disk = -1;
902 break; 980 break;
903 default: 981 default:
904 rdev->in_sync = 1; 982 rdev->in_sync = 1;
@@ -906,7 +984,9 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
906 rdev->raid_disk = role; 984 rdev->raid_disk = role;
907 break; 985 break;
908 } 986 }
909 } 987 } else /* MULTIPATH are always insync */
988 rdev->in_sync = 1;
989
910 return 0; 990 return 0;
911} 991}
912 992
@@ -933,6 +1013,11 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
933 else 1013 else
934 sb->resync_offset = cpu_to_le64(0); 1014 sb->resync_offset = cpu_to_le64(0);
935 1015
1016 if (mddev->bitmap && mddev->bitmap_file == NULL) {
1017 sb->bitmap_offset = cpu_to_le32((__u32)mddev->bitmap_offset);
1018 sb->feature_map = cpu_to_le32(1);
1019 }
1020
936 max_dev = 0; 1021 max_dev = 0;
937 ITERATE_RDEV(mddev,rdev2,tmp) 1022 ITERATE_RDEV(mddev,rdev2,tmp)
938 if (rdev2->desc_nr+1 > max_dev) 1023 if (rdev2->desc_nr+1 > max_dev)
@@ -1196,8 +1281,11 @@ void md_print_devices(void)
1196 printk("md: * <COMPLETE RAID STATE PRINTOUT> *\n"); 1281 printk("md: * <COMPLETE RAID STATE PRINTOUT> *\n");
1197 printk("md: **********************************\n"); 1282 printk("md: **********************************\n");
1198 ITERATE_MDDEV(mddev,tmp) { 1283 ITERATE_MDDEV(mddev,tmp) {
1199 printk("%s: ", mdname(mddev));
1200 1284
1285 if (mddev->bitmap)
1286 bitmap_print_sb(mddev->bitmap);
1287 else
1288 printk("%s: ", mdname(mddev));
1201 ITERATE_RDEV(mddev,rdev,tmp2) 1289 ITERATE_RDEV(mddev,rdev,tmp2)
1202 printk("<%s>", bdevname(rdev->bdev,b)); 1290 printk("<%s>", bdevname(rdev->bdev,b));
1203 printk("\n"); 1291 printk("\n");
@@ -1210,30 +1298,6 @@ void md_print_devices(void)
1210} 1298}
1211 1299
1212 1300
1213static int write_disk_sb(mdk_rdev_t * rdev)
1214{
1215 char b[BDEVNAME_SIZE];
1216 if (!rdev->sb_loaded) {
1217 MD_BUG();
1218 return 1;
1219 }
1220 if (rdev->faulty) {
1221 MD_BUG();
1222 return 1;
1223 }
1224
1225 dprintk(KERN_INFO "(write) %s's sb offset: %llu\n",
1226 bdevname(rdev->bdev,b),
1227 (unsigned long long)rdev->sb_offset);
1228
1229 if (sync_page_io(rdev->bdev, rdev->sb_offset<<1, MD_SB_BYTES, rdev->sb_page, WRITE))
1230 return 0;
1231
1232 printk("md: write_disk_sb failed for device %s\n",
1233 bdevname(rdev->bdev,b));
1234 return 1;
1235}
1236
1237static void sync_sbs(mddev_t * mddev) 1301static void sync_sbs(mddev_t * mddev)
1238{ 1302{
1239 mdk_rdev_t *rdev; 1303 mdk_rdev_t *rdev;
@@ -1248,12 +1312,14 @@ static void sync_sbs(mddev_t * mddev)
1248 1312
1249static void md_update_sb(mddev_t * mddev) 1313static void md_update_sb(mddev_t * mddev)
1250{ 1314{
1251 int err, count = 100; 1315 int err;
1252 struct list_head *tmp; 1316 struct list_head *tmp;
1253 mdk_rdev_t *rdev; 1317 mdk_rdev_t *rdev;
1318 int sync_req;
1254 1319
1255 mddev->sb_dirty = 0;
1256repeat: 1320repeat:
1321 spin_lock(&mddev->write_lock);
1322 sync_req = mddev->in_sync;
1257 mddev->utime = get_seconds(); 1323 mddev->utime = get_seconds();
1258 mddev->events ++; 1324 mddev->events ++;
1259 1325
@@ -1266,20 +1332,26 @@ repeat:
1266 MD_BUG(); 1332 MD_BUG();
1267 mddev->events --; 1333 mddev->events --;
1268 } 1334 }
1335 mddev->sb_dirty = 2;
1269 sync_sbs(mddev); 1336 sync_sbs(mddev);
1270 1337
1271 /* 1338 /*
1272 * do not write anything to disk if using 1339 * do not write anything to disk if using
1273 * nonpersistent superblocks 1340 * nonpersistent superblocks
1274 */ 1341 */
1275 if (!mddev->persistent) 1342 if (!mddev->persistent) {
1343 mddev->sb_dirty = 0;
1344 spin_unlock(&mddev->write_lock);
1345 wake_up(&mddev->sb_wait);
1276 return; 1346 return;
1347 }
1348 spin_unlock(&mddev->write_lock);
1277 1349
1278 dprintk(KERN_INFO 1350 dprintk(KERN_INFO
1279 "md: updating %s RAID superblock on device (in sync %d)\n", 1351 "md: updating %s RAID superblock on device (in sync %d)\n",
1280 mdname(mddev),mddev->in_sync); 1352 mdname(mddev),mddev->in_sync);
1281 1353
1282 err = 0; 1354 err = bitmap_update_sb(mddev->bitmap);
1283 ITERATE_RDEV(mddev,rdev,tmp) { 1355 ITERATE_RDEV(mddev,rdev,tmp) {
1284 char b[BDEVNAME_SIZE]; 1356 char b[BDEVNAME_SIZE];
1285 dprintk(KERN_INFO "md: "); 1357 dprintk(KERN_INFO "md: ");
@@ -1288,22 +1360,32 @@ repeat:
1288 1360
1289 dprintk("%s ", bdevname(rdev->bdev,b)); 1361 dprintk("%s ", bdevname(rdev->bdev,b));
1290 if (!rdev->faulty) { 1362 if (!rdev->faulty) {
1291 err += write_disk_sb(rdev); 1363 md_super_write(mddev,rdev,
1364 rdev->sb_offset<<1, MD_SB_BYTES,
1365 rdev->sb_page);
1366 dprintk(KERN_INFO "(write) %s's sb offset: %llu\n",
1367 bdevname(rdev->bdev,b),
1368 (unsigned long long)rdev->sb_offset);
1369
1292 } else 1370 } else
1293 dprintk(")\n"); 1371 dprintk(")\n");
1294 if (!err && mddev->level == LEVEL_MULTIPATH) 1372 if (mddev->level == LEVEL_MULTIPATH)
1295 /* only need to write one superblock... */ 1373 /* only need to write one superblock... */
1296 break; 1374 break;
1297 } 1375 }
1298 if (err) { 1376 wait_event(mddev->sb_wait, atomic_read(&mddev->pending_writes)==0);
1299 if (--count) { 1377 /* if there was a failure, sb_dirty was set to 1, and we re-write super */
1300 printk(KERN_ERR "md: errors occurred during superblock" 1378
1301 " update, repeating\n"); 1379 spin_lock(&mddev->write_lock);
1302 goto repeat; 1380 if (mddev->in_sync != sync_req|| mddev->sb_dirty == 1) {
1303 } 1381 /* have to write it out again */
1304 printk(KERN_ERR \ 1382 spin_unlock(&mddev->write_lock);
1305 "md: excessive errors occurred during superblock update, exiting\n"); 1383 goto repeat;
1306 } 1384 }
1385 mddev->sb_dirty = 0;
1386 spin_unlock(&mddev->write_lock);
1387 wake_up(&mddev->sb_wait);
1388
1307} 1389}
1308 1390
1309/* 1391/*
@@ -1607,12 +1689,19 @@ static int do_md_run(mddev_t * mddev)
1607 1689
1608 mddev->resync_max_sectors = mddev->size << 1; /* may be over-ridden by personality */ 1690 mddev->resync_max_sectors = mddev->size << 1; /* may be over-ridden by personality */
1609 1691
1610 err = mddev->pers->run(mddev); 1692 /* before we start the array running, initialise the bitmap */
1693 err = bitmap_create(mddev);
1694 if (err)
1695 printk(KERN_ERR "%s: failed to create bitmap (%d)\n",
1696 mdname(mddev), err);
1697 else
1698 err = mddev->pers->run(mddev);
1611 if (err) { 1699 if (err) {
1612 printk(KERN_ERR "md: pers->run() failed ...\n"); 1700 printk(KERN_ERR "md: pers->run() failed ...\n");
1613 module_put(mddev->pers->owner); 1701 module_put(mddev->pers->owner);
1614 mddev->pers = NULL; 1702 mddev->pers = NULL;
1615 return -EINVAL; 1703 bitmap_destroy(mddev);
1704 return err;
1616 } 1705 }
1617 atomic_set(&mddev->writes_pending,0); 1706 atomic_set(&mddev->writes_pending,0);
1618 mddev->safemode = 0; 1707 mddev->safemode = 0;
@@ -1725,6 +1814,14 @@ static int do_md_stop(mddev_t * mddev, int ro)
1725 if (ro) 1814 if (ro)
1726 set_disk_ro(disk, 1); 1815 set_disk_ro(disk, 1);
1727 } 1816 }
1817
1818 bitmap_destroy(mddev);
1819 if (mddev->bitmap_file) {
1820 atomic_set(&mddev->bitmap_file->f_dentry->d_inode->i_writecount, 1);
1821 fput(mddev->bitmap_file);
1822 mddev->bitmap_file = NULL;
1823 }
1824
1728 /* 1825 /*
1729 * Free resources if final stop 1826 * Free resources if final stop
1730 */ 1827 */
@@ -1983,6 +2080,42 @@ static int get_array_info(mddev_t * mddev, void __user * arg)
1983 return 0; 2080 return 0;
1984} 2081}
1985 2082
2083static int get_bitmap_file(mddev_t * mddev, void * arg)
2084{
2085 mdu_bitmap_file_t *file = NULL; /* too big for stack allocation */
2086 char *ptr, *buf = NULL;
2087 int err = -ENOMEM;
2088
2089 file = kmalloc(sizeof(*file), GFP_KERNEL);
2090 if (!file)
2091 goto out;
2092
2093 /* bitmap disabled, zero the first byte and copy out */
2094 if (!mddev->bitmap || !mddev->bitmap->file) {
2095 file->pathname[0] = '\0';
2096 goto copy_out;
2097 }
2098
2099 buf = kmalloc(sizeof(file->pathname), GFP_KERNEL);
2100 if (!buf)
2101 goto out;
2102
2103 ptr = file_path(mddev->bitmap->file, buf, sizeof(file->pathname));
2104 if (!ptr)
2105 goto out;
2106
2107 strcpy(file->pathname, ptr);
2108
2109copy_out:
2110 err = 0;
2111 if (copy_to_user(arg, file, sizeof(*file)))
2112 err = -EFAULT;
2113out:
2114 kfree(buf);
2115 kfree(file);
2116 return err;
2117}
2118
1986static int get_disk_info(mddev_t * mddev, void __user * arg) 2119static int get_disk_info(mddev_t * mddev, void __user * arg)
1987{ 2120{
1988 mdu_disk_info_t info; 2121 mdu_disk_info_t info;
@@ -2078,11 +2211,25 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
2078 PTR_ERR(rdev)); 2211 PTR_ERR(rdev));
2079 return PTR_ERR(rdev); 2212 return PTR_ERR(rdev);
2080 } 2213 }
2214 /* set save_raid_disk if appropriate */
2215 if (!mddev->persistent) {
2216 if (info->state & (1<<MD_DISK_SYNC) &&
2217 info->raid_disk < mddev->raid_disks)
2218 rdev->raid_disk = info->raid_disk;
2219 else
2220 rdev->raid_disk = -1;
2221 } else
2222 super_types[mddev->major_version].
2223 validate_super(mddev, rdev);
2224 rdev->saved_raid_disk = rdev->raid_disk;
2225
2081 rdev->in_sync = 0; /* just to be sure */ 2226 rdev->in_sync = 0; /* just to be sure */
2082 rdev->raid_disk = -1; 2227 rdev->raid_disk = -1;
2083 err = bind_rdev_to_array(rdev, mddev); 2228 err = bind_rdev_to_array(rdev, mddev);
2084 if (err) 2229 if (err)
2085 export_rdev(rdev); 2230 export_rdev(rdev);
2231
2232 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
2086 if (mddev->thread) 2233 if (mddev->thread)
2087 md_wakeup_thread(mddev->thread); 2234 md_wakeup_thread(mddev->thread);
2088 return err; 2235 return err;
@@ -2256,6 +2403,49 @@ abort_export:
2256 return err; 2403 return err;
2257} 2404}
2258 2405
2406/* similar to deny_write_access, but accounts for our holding a reference
2407 * to the file ourselves */
2408static int deny_bitmap_write_access(struct file * file)
2409{
2410 struct inode *inode = file->f_mapping->host;
2411
2412 spin_lock(&inode->i_lock);
2413 if (atomic_read(&inode->i_writecount) > 1) {
2414 spin_unlock(&inode->i_lock);
2415 return -ETXTBSY;
2416 }
2417 atomic_set(&inode->i_writecount, -1);
2418 spin_unlock(&inode->i_lock);
2419
2420 return 0;
2421}
2422
2423static int set_bitmap_file(mddev_t *mddev, int fd)
2424{
2425 int err;
2426
2427 if (mddev->pers)
2428 return -EBUSY;
2429
2430 mddev->bitmap_file = fget(fd);
2431
2432 if (mddev->bitmap_file == NULL) {
2433 printk(KERN_ERR "%s: error: failed to get bitmap file\n",
2434 mdname(mddev));
2435 return -EBADF;
2436 }
2437
2438 err = deny_bitmap_write_access(mddev->bitmap_file);
2439 if (err) {
2440 printk(KERN_ERR "%s: error: bitmap file is already in use\n",
2441 mdname(mddev));
2442 fput(mddev->bitmap_file);
2443 mddev->bitmap_file = NULL;
2444 } else
2445 mddev->bitmap_offset = 0; /* file overrides offset */
2446 return err;
2447}
2448
2259/* 2449/*
2260 * set_array_info is used two different ways 2450 * set_array_info is used two different ways
2261 * The original usage is when creating a new array. 2451 * The original usage is when creating a new array.
@@ -2567,8 +2757,10 @@ static int md_ioctl(struct inode *inode, struct file *file,
2567 /* 2757 /*
2568 * Commands querying/configuring an existing array: 2758 * Commands querying/configuring an existing array:
2569 */ 2759 */
2570 /* if we are initialised yet, only ADD_NEW_DISK or STOP_ARRAY is allowed */ 2760 /* if we are not initialised yet, only ADD_NEW_DISK, STOP_ARRAY,
2571 if (!mddev->raid_disks && cmd != ADD_NEW_DISK && cmd != STOP_ARRAY && cmd != RUN_ARRAY) { 2761 * RUN_ARRAY, and SET_BITMAP_FILE are allowed */
2762 if (!mddev->raid_disks && cmd != ADD_NEW_DISK && cmd != STOP_ARRAY
2763 && cmd != RUN_ARRAY && cmd != SET_BITMAP_FILE) {
2572 err = -ENODEV; 2764 err = -ENODEV;
2573 goto abort_unlock; 2765 goto abort_unlock;
2574 } 2766 }
@@ -2582,6 +2774,10 @@ static int md_ioctl(struct inode *inode, struct file *file,
2582 err = get_array_info(mddev, argp); 2774 err = get_array_info(mddev, argp);
2583 goto done_unlock; 2775 goto done_unlock;
2584 2776
2777 case GET_BITMAP_FILE:
2778 err = get_bitmap_file(mddev, (void *)arg);
2779 goto done_unlock;
2780
2585 case GET_DISK_INFO: 2781 case GET_DISK_INFO:
2586 err = get_disk_info(mddev, argp); 2782 err = get_disk_info(mddev, argp);
2587 goto done_unlock; 2783 goto done_unlock;
@@ -2662,6 +2858,10 @@ static int md_ioctl(struct inode *inode, struct file *file,
2662 err = do_md_run (mddev); 2858 err = do_md_run (mddev);
2663 goto done_unlock; 2859 goto done_unlock;
2664 2860
2861 case SET_BITMAP_FILE:
2862 err = set_bitmap_file(mddev, (int)arg);
2863 goto done_unlock;
2864
2665 default: 2865 default:
2666 if (_IOC_TYPE(cmd) == MD_MAJOR) 2866 if (_IOC_TYPE(cmd) == MD_MAJOR)
2667 printk(KERN_WARNING "md: %s(pid %d) used" 2867 printk(KERN_WARNING "md: %s(pid %d) used"
@@ -2773,8 +2973,9 @@ static int md_thread(void * arg)
2773 while (thread->run) { 2973 while (thread->run) {
2774 void (*run)(mddev_t *); 2974 void (*run)(mddev_t *);
2775 2975
2776 wait_event_interruptible(thread->wqueue, 2976 wait_event_interruptible_timeout(thread->wqueue,
2777 test_bit(THREAD_WAKEUP, &thread->flags)); 2977 test_bit(THREAD_WAKEUP, &thread->flags),
2978 thread->timeout);
2778 if (current->flags & PF_FREEZE) 2979 if (current->flags & PF_FREEZE)
2779 refrigerator(PF_FREEZE); 2980 refrigerator(PF_FREEZE);
2780 2981
@@ -2820,6 +3021,7 @@ mdk_thread_t *md_register_thread(void (*run) (mddev_t *), mddev_t *mddev,
2820 thread->run = run; 3021 thread->run = run;
2821 thread->mddev = mddev; 3022 thread->mddev = mddev;
2822 thread->name = name; 3023 thread->name = name;
3024 thread->timeout = MAX_SCHEDULE_TIMEOUT;
2823 ret = kernel_thread(md_thread, thread, 0); 3025 ret = kernel_thread(md_thread, thread, 0);
2824 if (ret < 0) { 3026 if (ret < 0) {
2825 kfree(thread); 3027 kfree(thread);
@@ -2858,13 +3060,13 @@ void md_error(mddev_t *mddev, mdk_rdev_t *rdev)
2858 3060
2859 if (!rdev || rdev->faulty) 3061 if (!rdev || rdev->faulty)
2860 return; 3062 return;
2861 3063/*
2862 dprintk("md_error dev:%s, rdev:(%d:%d), (caller: %p,%p,%p,%p).\n", 3064 dprintk("md_error dev:%s, rdev:(%d:%d), (caller: %p,%p,%p,%p).\n",
2863 mdname(mddev), 3065 mdname(mddev),
2864 MAJOR(rdev->bdev->bd_dev), MINOR(rdev->bdev->bd_dev), 3066 MAJOR(rdev->bdev->bd_dev), MINOR(rdev->bdev->bd_dev),
2865 __builtin_return_address(0),__builtin_return_address(1), 3067 __builtin_return_address(0),__builtin_return_address(1),
2866 __builtin_return_address(2),__builtin_return_address(3)); 3068 __builtin_return_address(2),__builtin_return_address(3));
2867 3069*/
2868 if (!mddev->pers->error_handler) 3070 if (!mddev->pers->error_handler)
2869 return; 3071 return;
2870 mddev->pers->error_handler(mddev,rdev); 3072 mddev->pers->error_handler(mddev,rdev);
@@ -3018,6 +3220,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
3018 struct list_head *tmp2; 3220 struct list_head *tmp2;
3019 mdk_rdev_t *rdev; 3221 mdk_rdev_t *rdev;
3020 int i; 3222 int i;
3223 struct bitmap *bitmap;
3021 3224
3022 if (v == (void*)1) { 3225 if (v == (void*)1) {
3023 seq_printf(seq, "Personalities : "); 3226 seq_printf(seq, "Personalities : ");
@@ -3070,10 +3273,35 @@ static int md_seq_show(struct seq_file *seq, void *v)
3070 if (mddev->pers) { 3273 if (mddev->pers) {
3071 mddev->pers->status (seq, mddev); 3274 mddev->pers->status (seq, mddev);
3072 seq_printf(seq, "\n "); 3275 seq_printf(seq, "\n ");
3073 if (mddev->curr_resync > 2) 3276 if (mddev->curr_resync > 2) {
3074 status_resync (seq, mddev); 3277 status_resync (seq, mddev);
3075 else if (mddev->curr_resync == 1 || mddev->curr_resync == 2) 3278 seq_printf(seq, "\n ");
3076 seq_printf(seq, " resync=DELAYED"); 3279 } else if (mddev->curr_resync == 1 || mddev->curr_resync == 2)
3280 seq_printf(seq, " resync=DELAYED\n ");
3281 } else
3282 seq_printf(seq, "\n ");
3283
3284 if ((bitmap = mddev->bitmap)) {
3285 unsigned long chunk_kb;
3286 unsigned long flags;
3287 spin_lock_irqsave(&bitmap->lock, flags);
3288 chunk_kb = bitmap->chunksize >> 10;
3289 seq_printf(seq, "bitmap: %lu/%lu pages [%luKB], "
3290 "%lu%s chunk",
3291 bitmap->pages - bitmap->missing_pages,
3292 bitmap->pages,
3293 (bitmap->pages - bitmap->missing_pages)
3294 << (PAGE_SHIFT - 10),
3295 chunk_kb ? chunk_kb : bitmap->chunksize,
3296 chunk_kb ? "KB" : "B");
3297 if (bitmap->file) {
3298 seq_printf(seq, ", file: ");
3299 seq_path(seq, bitmap->file->f_vfsmnt,
3300 bitmap->file->f_dentry," \t\n");
3301 }
3302
3303 seq_printf(seq, "\n");
3304 spin_unlock_irqrestore(&bitmap->lock, flags);
3077 } 3305 }
3078 3306
3079 seq_printf(seq, "\n"); 3307 seq_printf(seq, "\n");
@@ -3176,19 +3404,28 @@ void md_done_sync(mddev_t *mddev, int blocks, int ok)
3176} 3404}
3177 3405
3178 3406
3179void md_write_start(mddev_t *mddev) 3407/* md_write_start(mddev, bi)
3408 * If we need to update some array metadata (e.g. 'active' flag
3409 * in superblock) before writing, schedule a superblock update
3410 * and wait for it to complete.
3411 */
3412void md_write_start(mddev_t *mddev, struct bio *bi)
3180{ 3413{
3181 if (!atomic_read(&mddev->writes_pending)) { 3414 DEFINE_WAIT(w);
3182 mddev_lock_uninterruptible(mddev); 3415 if (bio_data_dir(bi) != WRITE)
3416 return;
3417
3418 atomic_inc(&mddev->writes_pending);
3419 if (mddev->in_sync) {
3420 spin_lock(&mddev->write_lock);
3183 if (mddev->in_sync) { 3421 if (mddev->in_sync) {
3184 mddev->in_sync = 0; 3422 mddev->in_sync = 0;
3185 del_timer(&mddev->safemode_timer); 3423 mddev->sb_dirty = 1;
3186 md_update_sb(mddev); 3424 md_wakeup_thread(mddev->thread);
3187 } 3425 }
3188 atomic_inc(&mddev->writes_pending); 3426 spin_unlock(&mddev->write_lock);
3189 mddev_unlock(mddev); 3427 }
3190 } else 3428 wait_event(mddev->sb_wait, mddev->sb_dirty==0);
3191 atomic_inc(&mddev->writes_pending);
3192} 3429}
3193 3430
3194void md_write_end(mddev_t *mddev) 3431void md_write_end(mddev_t *mddev)
@@ -3201,37 +3438,6 @@ void md_write_end(mddev_t *mddev)
3201 } 3438 }
3202} 3439}
3203 3440
3204static inline void md_enter_safemode(mddev_t *mddev)
3205{
3206 if (!mddev->safemode) return;
3207 if (mddev->safemode == 2 &&
3208 (atomic_read(&mddev->writes_pending) || mddev->in_sync ||
3209 mddev->recovery_cp != MaxSector))
3210 return; /* avoid the lock */
3211 mddev_lock_uninterruptible(mddev);
3212 if (mddev->safemode && !atomic_read(&mddev->writes_pending) &&
3213 !mddev->in_sync && mddev->recovery_cp == MaxSector) {
3214 mddev->in_sync = 1;
3215 md_update_sb(mddev);
3216 }
3217 mddev_unlock(mddev);
3218
3219 if (mddev->safemode == 1)
3220 mddev->safemode = 0;
3221}
3222
3223void md_handle_safemode(mddev_t *mddev)
3224{
3225 if (signal_pending(current)) {
3226 printk(KERN_INFO "md: %s in immediate safe mode\n",
3227 mdname(mddev));
3228 mddev->safemode = 2;
3229 flush_signals(current);
3230 }
3231 md_enter_safemode(mddev);
3232}
3233
3234
3235static DECLARE_WAIT_QUEUE_HEAD(resync_wait); 3441static DECLARE_WAIT_QUEUE_HEAD(resync_wait);
3236 3442
3237#define SYNC_MARKS 10 3443#define SYNC_MARKS 10
@@ -3241,12 +3447,13 @@ static void md_do_sync(mddev_t *mddev)
3241 mddev_t *mddev2; 3447 mddev_t *mddev2;
3242 unsigned int currspeed = 0, 3448 unsigned int currspeed = 0,
3243 window; 3449 window;
3244 sector_t max_sectors,j; 3450 sector_t max_sectors,j, io_sectors;
3245 unsigned long mark[SYNC_MARKS]; 3451 unsigned long mark[SYNC_MARKS];
3246 sector_t mark_cnt[SYNC_MARKS]; 3452 sector_t mark_cnt[SYNC_MARKS];
3247 int last_mark,m; 3453 int last_mark,m;
3248 struct list_head *tmp; 3454 struct list_head *tmp;
3249 sector_t last_check; 3455 sector_t last_check;
3456 int skipped = 0;
3250 3457
3251 /* just incase thread restarts... */ 3458 /* just incase thread restarts... */
3252 if (test_bit(MD_RECOVERY_DONE, &mddev->recovery)) 3459 if (test_bit(MD_RECOVERY_DONE, &mddev->recovery))
@@ -3312,7 +3519,7 @@ static void md_do_sync(mddev_t *mddev)
3312 3519
3313 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) 3520 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery))
3314 /* resync follows the size requested by the personality, 3521 /* resync follows the size requested by the personality,
3315 * which default to physical size, but can be virtual size 3522 * which defaults to physical size, but can be virtual size
3316 */ 3523 */
3317 max_sectors = mddev->resync_max_sectors; 3524 max_sectors = mddev->resync_max_sectors;
3318 else 3525 else
@@ -3327,13 +3534,15 @@ static void md_do_sync(mddev_t *mddev)
3327 sysctl_speed_limit_max); 3534 sysctl_speed_limit_max);
3328 3535
3329 is_mddev_idle(mddev); /* this also initializes IO event counters */ 3536 is_mddev_idle(mddev); /* this also initializes IO event counters */
3330 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) 3537 /* we don't use the checkpoint if there's a bitmap */
3538 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) && !mddev->bitmap)
3331 j = mddev->recovery_cp; 3539 j = mddev->recovery_cp;
3332 else 3540 else
3333 j = 0; 3541 j = 0;
3542 io_sectors = 0;
3334 for (m = 0; m < SYNC_MARKS; m++) { 3543 for (m = 0; m < SYNC_MARKS; m++) {
3335 mark[m] = jiffies; 3544 mark[m] = jiffies;
3336 mark_cnt[m] = j; 3545 mark_cnt[m] = io_sectors;
3337 } 3546 }
3338 last_mark = 0; 3547 last_mark = 0;
3339 mddev->resync_mark = mark[last_mark]; 3548 mddev->resync_mark = mark[last_mark];
@@ -3358,21 +3567,29 @@ static void md_do_sync(mddev_t *mddev)
3358 } 3567 }
3359 3568
3360 while (j < max_sectors) { 3569 while (j < max_sectors) {
3361 int sectors; 3570 sector_t sectors;
3362 3571
3363 sectors = mddev->pers->sync_request(mddev, j, currspeed < sysctl_speed_limit_min); 3572 skipped = 0;
3364 if (sectors < 0) { 3573 sectors = mddev->pers->sync_request(mddev, j, &skipped,
3574 currspeed < sysctl_speed_limit_min);
3575 if (sectors == 0) {
3365 set_bit(MD_RECOVERY_ERR, &mddev->recovery); 3576 set_bit(MD_RECOVERY_ERR, &mddev->recovery);
3366 goto out; 3577 goto out;
3367 } 3578 }
3368 atomic_add(sectors, &mddev->recovery_active); 3579
3580 if (!skipped) { /* actual IO requested */
3581 io_sectors += sectors;
3582 atomic_add(sectors, &mddev->recovery_active);
3583 }
3584
3369 j += sectors; 3585 j += sectors;
3370 if (j>1) mddev->curr_resync = j; 3586 if (j>1) mddev->curr_resync = j;
3371 3587
3372 if (last_check + window > j || j == max_sectors) 3588
3589 if (last_check + window > io_sectors || j == max_sectors)
3373 continue; 3590 continue;
3374 3591
3375 last_check = j; 3592 last_check = io_sectors;
3376 3593
3377 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery) || 3594 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery) ||
3378 test_bit(MD_RECOVERY_ERR, &mddev->recovery)) 3595 test_bit(MD_RECOVERY_ERR, &mddev->recovery))
@@ -3386,7 +3603,7 @@ static void md_do_sync(mddev_t *mddev)
3386 mddev->resync_mark = mark[next]; 3603 mddev->resync_mark = mark[next];
3387 mddev->resync_mark_cnt = mark_cnt[next]; 3604 mddev->resync_mark_cnt = mark_cnt[next];
3388 mark[next] = jiffies; 3605 mark[next] = jiffies;
3389 mark_cnt[next] = j - atomic_read(&mddev->recovery_active); 3606 mark_cnt[next] = io_sectors - atomic_read(&mddev->recovery_active);
3390 last_mark = next; 3607 last_mark = next;
3391 } 3608 }
3392 3609
@@ -3413,7 +3630,8 @@ static void md_do_sync(mddev_t *mddev)
3413 mddev->queue->unplug_fn(mddev->queue); 3630 mddev->queue->unplug_fn(mddev->queue);
3414 cond_resched(); 3631 cond_resched();
3415 3632
3416 currspeed = ((unsigned long)(j-mddev->resync_mark_cnt))/2/((jiffies-mddev->resync_mark)/HZ +1) +1; 3633 currspeed = ((unsigned long)(io_sectors-mddev->resync_mark_cnt))/2
3634 /((jiffies-mddev->resync_mark)/HZ +1) +1;
3417 3635
3418 if (currspeed > sysctl_speed_limit_min) { 3636 if (currspeed > sysctl_speed_limit_min) {
3419 if ((currspeed > sysctl_speed_limit_max) || 3637 if ((currspeed > sysctl_speed_limit_max) ||
@@ -3433,7 +3651,7 @@ static void md_do_sync(mddev_t *mddev)
3433 wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active)); 3651 wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active));
3434 3652
3435 /* tell personality that we are finished */ 3653 /* tell personality that we are finished */
3436 mddev->pers->sync_request(mddev, max_sectors, 1); 3654 mddev->pers->sync_request(mddev, max_sectors, &skipped, 1);
3437 3655
3438 if (!test_bit(MD_RECOVERY_ERR, &mddev->recovery) && 3656 if (!test_bit(MD_RECOVERY_ERR, &mddev->recovery) &&
3439 mddev->curr_resync > 2 && 3657 mddev->curr_resync > 2 &&
@@ -3447,7 +3665,6 @@ static void md_do_sync(mddev_t *mddev)
3447 mddev->recovery_cp = MaxSector; 3665 mddev->recovery_cp = MaxSector;
3448 } 3666 }
3449 3667
3450 md_enter_safemode(mddev);
3451 skip: 3668 skip:
3452 mddev->curr_resync = 0; 3669 mddev->curr_resync = 0;
3453 wake_up(&resync_wait); 3670 wake_up(&resync_wait);
@@ -3484,20 +3701,48 @@ void md_check_recovery(mddev_t *mddev)
3484 struct list_head *rtmp; 3701 struct list_head *rtmp;
3485 3702
3486 3703
3487 dprintk(KERN_INFO "md: recovery thread got woken up ...\n"); 3704 if (mddev->bitmap)
3705 bitmap_daemon_work(mddev->bitmap);
3488 3706
3489 if (mddev->ro) 3707 if (mddev->ro)
3490 return; 3708 return;
3709
3710 if (signal_pending(current)) {
3711 if (mddev->pers->sync_request) {
3712 printk(KERN_INFO "md: %s in immediate safe mode\n",
3713 mdname(mddev));
3714 mddev->safemode = 2;
3715 }
3716 flush_signals(current);
3717 }
3718
3491 if ( ! ( 3719 if ( ! (
3492 mddev->sb_dirty || 3720 mddev->sb_dirty ||
3493 test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) || 3721 test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) ||
3494 test_bit(MD_RECOVERY_DONE, &mddev->recovery) 3722 test_bit(MD_RECOVERY_DONE, &mddev->recovery) ||
3723 (mddev->safemode == 1) ||
3724 (mddev->safemode == 2 && ! atomic_read(&mddev->writes_pending)
3725 && !mddev->in_sync && mddev->recovery_cp == MaxSector)
3495 )) 3726 ))
3496 return; 3727 return;
3728
3497 if (mddev_trylock(mddev)==0) { 3729 if (mddev_trylock(mddev)==0) {
3498 int spares =0; 3730 int spares =0;
3731
3732 spin_lock(&mddev->write_lock);
3733 if (mddev->safemode && !atomic_read(&mddev->writes_pending) &&
3734 !mddev->in_sync && mddev->recovery_cp == MaxSector) {
3735 mddev->in_sync = 1;
3736 mddev->sb_dirty = 1;
3737 }
3738 if (mddev->safemode == 1)
3739 mddev->safemode = 0;
3740 spin_unlock(&mddev->write_lock);
3741
3499 if (mddev->sb_dirty) 3742 if (mddev->sb_dirty)
3500 md_update_sb(mddev); 3743 md_update_sb(mddev);
3744
3745
3501 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) && 3746 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) &&
3502 !test_bit(MD_RECOVERY_DONE, &mddev->recovery)) { 3747 !test_bit(MD_RECOVERY_DONE, &mddev->recovery)) {
3503 /* resync/recovery still happening */ 3748 /* resync/recovery still happening */
@@ -3515,6 +3760,14 @@ void md_check_recovery(mddev_t *mddev)
3515 mddev->pers->spare_active(mddev); 3760 mddev->pers->spare_active(mddev);
3516 } 3761 }
3517 md_update_sb(mddev); 3762 md_update_sb(mddev);
3763
3764 /* if array is no-longer degraded, then any saved_raid_disk
3765 * information must be scrapped
3766 */
3767 if (!mddev->degraded)
3768 ITERATE_RDEV(mddev,rdev,rtmp)
3769 rdev->saved_raid_disk = -1;
3770
3518 mddev->recovery = 0; 3771 mddev->recovery = 0;
3519 /* flag recovery needed just to double check */ 3772 /* flag recovery needed just to double check */
3520 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 3773 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
@@ -3557,6 +3810,13 @@ void md_check_recovery(mddev_t *mddev)
3557 set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); 3810 set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
3558 if (!spares) 3811 if (!spares)
3559 set_bit(MD_RECOVERY_SYNC, &mddev->recovery); 3812 set_bit(MD_RECOVERY_SYNC, &mddev->recovery);
3813 if (spares && mddev->bitmap && ! mddev->bitmap->file) {
3814 /* We are adding a device or devices to an array
3815 * which has the bitmap stored on all devices.
3816 * So make sure all bitmap pages get written
3817 */
3818 bitmap_write_all(mddev->bitmap);
3819 }
3560 mddev->sync_thread = md_register_thread(md_do_sync, 3820 mddev->sync_thread = md_register_thread(md_do_sync,
3561 mddev, 3821 mddev,
3562 "%s_resync"); 3822 "%s_resync");
@@ -3624,6 +3884,8 @@ static int __init md_init(void)
3624 " MD_SB_DISKS=%d\n", 3884 " MD_SB_DISKS=%d\n",
3625 MD_MAJOR_VERSION, MD_MINOR_VERSION, 3885 MD_MAJOR_VERSION, MD_MINOR_VERSION,
3626 MD_PATCHLEVEL_VERSION, MAX_MD_DEVS, MD_SB_DISKS); 3886 MD_PATCHLEVEL_VERSION, MAX_MD_DEVS, MD_SB_DISKS);
3887 printk(KERN_INFO "md: bitmap version %d.%d\n", BITMAP_MAJOR,
3888 BITMAP_MINOR);
3627 3889
3628 if (register_blkdev(MAJOR_NR, "md")) 3890 if (register_blkdev(MAJOR_NR, "md"))
3629 return -1; 3891 return -1;
@@ -3739,7 +4001,6 @@ EXPORT_SYMBOL(md_error);
3739EXPORT_SYMBOL(md_done_sync); 4001EXPORT_SYMBOL(md_done_sync);
3740EXPORT_SYMBOL(md_write_start); 4002EXPORT_SYMBOL(md_write_start);
3741EXPORT_SYMBOL(md_write_end); 4003EXPORT_SYMBOL(md_write_end);
3742EXPORT_SYMBOL(md_handle_safemode);
3743EXPORT_SYMBOL(md_register_thread); 4004EXPORT_SYMBOL(md_register_thread);
3744EXPORT_SYMBOL(md_unregister_thread); 4005EXPORT_SYMBOL(md_unregister_thread);
3745EXPORT_SYMBOL(md_wakeup_thread); 4006EXPORT_SYMBOL(md_wakeup_thread);
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 2ae2d709cb15..2d2ca7fa0265 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -533,8 +533,7 @@ static int multipath_run (mddev_t *mddev)
533out_free_conf: 533out_free_conf:
534 if (conf->pool) 534 if (conf->pool)
535 mempool_destroy(conf->pool); 535 mempool_destroy(conf->pool);
536 if (conf->multipaths) 536 kfree(conf->multipaths);
537 kfree(conf->multipaths);
538 kfree(conf); 537 kfree(conf);
539 mddev->private = NULL; 538 mddev->private = NULL;
540out: 539out:
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index e7d934eca06f..e11dd14d0b43 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -371,10 +371,8 @@ static int raid0_run (mddev_t *mddev)
371 return 0; 371 return 0;
372 372
373out_free_conf: 373out_free_conf:
374 if (conf->strip_zone) 374 kfree(conf->strip_zone);
375 kfree(conf->strip_zone); 375 kfree(conf->devlist);
376 if (conf->devlist)
377 kfree (conf->devlist);
378 kfree(conf); 376 kfree(conf);
379 mddev->private = NULL; 377 mddev->private = NULL;
380out: 378out:
@@ -386,11 +384,11 @@ static int raid0_stop (mddev_t *mddev)
386 raid0_conf_t *conf = mddev_to_conf(mddev); 384 raid0_conf_t *conf = mddev_to_conf(mddev);
387 385
388 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ 386 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
389 kfree (conf->hash_table); 387 kfree(conf->hash_table);
390 conf->hash_table = NULL; 388 conf->hash_table = NULL;
391 kfree (conf->strip_zone); 389 kfree(conf->strip_zone);
392 conf->strip_zone = NULL; 390 conf->strip_zone = NULL;
393 kfree (conf); 391 kfree(conf);
394 mddev->private = NULL; 392 mddev->private = NULL;
395 393
396 return 0; 394 return 0;
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 1db5de52d376..ff1dbec864af 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -12,6 +12,15 @@
12 * Fixes to reconstruction by Jakob Østergaard" <jakob@ostenfeld.dk> 12 * Fixes to reconstruction by Jakob Østergaard" <jakob@ostenfeld.dk>
13 * Various fixes by Neil Brown <neilb@cse.unsw.edu.au> 13 * Various fixes by Neil Brown <neilb@cse.unsw.edu.au>
14 * 14 *
15 * Changes by Peter T. Breuer <ptb@it.uc3m.es> 31/1/2003 to support
16 * bitmapped intelligence in resync:
17 *
18 * - bitmap marked during normal i/o
19 * - bitmap used to skip nondirty blocks during sync
20 *
21 * Additions to bitmap code, (C) 2003-2004 Paul Clements, SteelEye Technology:
22 * - persistent bitmap code
23 *
15 * This program is free software; you can redistribute it and/or modify 24 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by 25 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option) 26 * the Free Software Foundation; either version 2, or (at your option)
@@ -22,7 +31,16 @@
22 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 31 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */ 32 */
24 33
34#include "dm-bio-list.h"
25#include <linux/raid/raid1.h> 35#include <linux/raid/raid1.h>
36#include <linux/raid/bitmap.h>
37
38#define DEBUG 0
39#if DEBUG
40#define PRINTK(x...) printk(x)
41#else
42#define PRINTK(x...)
43#endif
26 44
27/* 45/*
28 * Number of guaranteed r1bios in case of extreme VM load: 46 * Number of guaranteed r1bios in case of extreme VM load:
@@ -287,9 +305,11 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
287 /* 305 /*
288 * this branch is our 'one mirror IO has finished' event handler: 306 * this branch is our 'one mirror IO has finished' event handler:
289 */ 307 */
290 if (!uptodate) 308 if (!uptodate) {
291 md_error(r1_bio->mddev, conf->mirrors[mirror].rdev); 309 md_error(r1_bio->mddev, conf->mirrors[mirror].rdev);
292 else 310 /* an I/O failed, we can't clear the bitmap */
311 set_bit(R1BIO_Degraded, &r1_bio->state);
312 } else
293 /* 313 /*
294 * Set R1BIO_Uptodate in our master bio, so that 314 * Set R1BIO_Uptodate in our master bio, so that
295 * we will return a good error code for to the higher 315 * we will return a good error code for to the higher
@@ -309,6 +329,10 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
309 * already. 329 * already.
310 */ 330 */
311 if (atomic_dec_and_test(&r1_bio->remaining)) { 331 if (atomic_dec_and_test(&r1_bio->remaining)) {
332 /* clear the bitmap if all writes complete successfully */
333 bitmap_endwrite(r1_bio->mddev->bitmap, r1_bio->sector,
334 r1_bio->sectors,
335 !test_bit(R1BIO_Degraded, &r1_bio->state));
312 md_write_end(r1_bio->mddev); 336 md_write_end(r1_bio->mddev);
313 raid_end_bio_io(r1_bio); 337 raid_end_bio_io(r1_bio);
314 } 338 }
@@ -458,7 +482,10 @@ static void unplug_slaves(mddev_t *mddev)
458 482
459static void raid1_unplug(request_queue_t *q) 483static void raid1_unplug(request_queue_t *q)
460{ 484{
461 unplug_slaves(q->queuedata); 485 mddev_t *mddev = q->queuedata;
486
487 unplug_slaves(mddev);
488 md_wakeup_thread(mddev->thread);
462} 489}
463 490
464static int raid1_issue_flush(request_queue_t *q, struct gendisk *disk, 491static int raid1_issue_flush(request_queue_t *q, struct gendisk *disk,
@@ -501,16 +528,16 @@ static void device_barrier(conf_t *conf, sector_t sect)
501{ 528{
502 spin_lock_irq(&conf->resync_lock); 529 spin_lock_irq(&conf->resync_lock);
503 wait_event_lock_irq(conf->wait_idle, !waitqueue_active(&conf->wait_resume), 530 wait_event_lock_irq(conf->wait_idle, !waitqueue_active(&conf->wait_resume),
504 conf->resync_lock, unplug_slaves(conf->mddev)); 531 conf->resync_lock, raid1_unplug(conf->mddev->queue));
505 532
506 if (!conf->barrier++) { 533 if (!conf->barrier++) {
507 wait_event_lock_irq(conf->wait_idle, !conf->nr_pending, 534 wait_event_lock_irq(conf->wait_idle, !conf->nr_pending,
508 conf->resync_lock, unplug_slaves(conf->mddev)); 535 conf->resync_lock, raid1_unplug(conf->mddev->queue));
509 if (conf->nr_pending) 536 if (conf->nr_pending)
510 BUG(); 537 BUG();
511 } 538 }
512 wait_event_lock_irq(conf->wait_resume, conf->barrier < RESYNC_DEPTH, 539 wait_event_lock_irq(conf->wait_resume, conf->barrier < RESYNC_DEPTH,
513 conf->resync_lock, unplug_slaves(conf->mddev)); 540 conf->resync_lock, raid1_unplug(conf->mddev->queue));
514 conf->next_resync = sect; 541 conf->next_resync = sect;
515 spin_unlock_irq(&conf->resync_lock); 542 spin_unlock_irq(&conf->resync_lock);
516} 543}
@@ -522,14 +549,20 @@ static int make_request(request_queue_t *q, struct bio * bio)
522 mirror_info_t *mirror; 549 mirror_info_t *mirror;
523 r1bio_t *r1_bio; 550 r1bio_t *r1_bio;
524 struct bio *read_bio; 551 struct bio *read_bio;
525 int i, disks; 552 int i, targets = 0, disks;
526 mdk_rdev_t *rdev; 553 mdk_rdev_t *rdev;
554 struct bitmap *bitmap = mddev->bitmap;
555 unsigned long flags;
556 struct bio_list bl;
557
527 558
528 /* 559 /*
529 * Register the new request and wait if the reconstruction 560 * Register the new request and wait if the reconstruction
530 * thread has put up a bar for new requests. 561 * thread has put up a bar for new requests.
531 * Continue immediately if no resync is active currently. 562 * Continue immediately if no resync is active currently.
532 */ 563 */
564 md_write_start(mddev, bio); /* wait on superblock update early */
565
533 spin_lock_irq(&conf->resync_lock); 566 spin_lock_irq(&conf->resync_lock);
534 wait_event_lock_irq(conf->wait_resume, !conf->barrier, conf->resync_lock, ); 567 wait_event_lock_irq(conf->wait_resume, !conf->barrier, conf->resync_lock, );
535 conf->nr_pending++; 568 conf->nr_pending++;
@@ -552,7 +585,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
552 585
553 r1_bio->master_bio = bio; 586 r1_bio->master_bio = bio;
554 r1_bio->sectors = bio->bi_size >> 9; 587 r1_bio->sectors = bio->bi_size >> 9;
555 588 r1_bio->state = 0;
556 r1_bio->mddev = mddev; 589 r1_bio->mddev = mddev;
557 r1_bio->sector = bio->bi_sector; 590 r1_bio->sector = bio->bi_sector;
558 591
@@ -595,6 +628,13 @@ static int make_request(request_queue_t *q, struct bio * bio)
595 * bios[x] to bio 628 * bios[x] to bio
596 */ 629 */
597 disks = conf->raid_disks; 630 disks = conf->raid_disks;
631#if 0
632 { static int first=1;
633 if (first) printk("First Write sector %llu disks %d\n",
634 (unsigned long long)r1_bio->sector, disks);
635 first = 0;
636 }
637#endif
598 rcu_read_lock(); 638 rcu_read_lock();
599 for (i = 0; i < disks; i++) { 639 for (i = 0; i < disks; i++) {
600 if ((rdev=conf->mirrors[i].rdev) != NULL && 640 if ((rdev=conf->mirrors[i].rdev) != NULL &&
@@ -605,13 +645,21 @@ static int make_request(request_queue_t *q, struct bio * bio)
605 r1_bio->bios[i] = NULL; 645 r1_bio->bios[i] = NULL;
606 } else 646 } else
607 r1_bio->bios[i] = bio; 647 r1_bio->bios[i] = bio;
648 targets++;
608 } else 649 } else
609 r1_bio->bios[i] = NULL; 650 r1_bio->bios[i] = NULL;
610 } 651 }
611 rcu_read_unlock(); 652 rcu_read_unlock();
612 653
613 atomic_set(&r1_bio->remaining, 1); 654 if (targets < conf->raid_disks) {
614 md_write_start(mddev); 655 /* array is degraded, we will not clear the bitmap
656 * on I/O completion (see raid1_end_write_request) */
657 set_bit(R1BIO_Degraded, &r1_bio->state);
658 }
659
660 atomic_set(&r1_bio->remaining, 0);
661
662 bio_list_init(&bl);
615 for (i = 0; i < disks; i++) { 663 for (i = 0; i < disks; i++) {
616 struct bio *mbio; 664 struct bio *mbio;
617 if (!r1_bio->bios[i]) 665 if (!r1_bio->bios[i])
@@ -627,14 +675,23 @@ static int make_request(request_queue_t *q, struct bio * bio)
627 mbio->bi_private = r1_bio; 675 mbio->bi_private = r1_bio;
628 676
629 atomic_inc(&r1_bio->remaining); 677 atomic_inc(&r1_bio->remaining);
630 generic_make_request(mbio);
631 }
632 678
633 if (atomic_dec_and_test(&r1_bio->remaining)) { 679 bio_list_add(&bl, mbio);
634 md_write_end(mddev);
635 raid_end_bio_io(r1_bio);
636 } 680 }
637 681
682 bitmap_startwrite(bitmap, bio->bi_sector, r1_bio->sectors);
683 spin_lock_irqsave(&conf->device_lock, flags);
684 bio_list_merge(&conf->pending_bio_list, &bl);
685 bio_list_init(&bl);
686
687 blk_plug_device(mddev->queue);
688 spin_unlock_irqrestore(&conf->device_lock, flags);
689
690#if 0
691 while ((bio = bio_list_pop(&bl)) != NULL)
692 generic_make_request(bio);
693#endif
694
638 return 0; 695 return 0;
639} 696}
640 697
@@ -714,7 +771,7 @@ static void close_sync(conf_t *conf)
714{ 771{
715 spin_lock_irq(&conf->resync_lock); 772 spin_lock_irq(&conf->resync_lock);
716 wait_event_lock_irq(conf->wait_resume, !conf->barrier, 773 wait_event_lock_irq(conf->wait_resume, !conf->barrier,
717 conf->resync_lock, unplug_slaves(conf->mddev)); 774 conf->resync_lock, raid1_unplug(conf->mddev->queue));
718 spin_unlock_irq(&conf->resync_lock); 775 spin_unlock_irq(&conf->resync_lock);
719 776
720 if (conf->barrier) BUG(); 777 if (conf->barrier) BUG();
@@ -754,9 +811,12 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
754{ 811{
755 conf_t *conf = mddev->private; 812 conf_t *conf = mddev->private;
756 int found = 0; 813 int found = 0;
757 int mirror; 814 int mirror = 0;
758 mirror_info_t *p; 815 mirror_info_t *p;
759 816
817 if (rdev->saved_raid_disk >= 0 &&
818 conf->mirrors[rdev->saved_raid_disk].rdev == NULL)
819 mirror = rdev->saved_raid_disk;
760 for (mirror=0; mirror < mddev->raid_disks; mirror++) 820 for (mirror=0; mirror < mddev->raid_disks; mirror++)
761 if ( !(p=conf->mirrors+mirror)->rdev) { 821 if ( !(p=conf->mirrors+mirror)->rdev) {
762 822
@@ -773,6 +833,8 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
773 p->head_position = 0; 833 p->head_position = 0;
774 rdev->raid_disk = mirror; 834 rdev->raid_disk = mirror;
775 found = 1; 835 found = 1;
836 if (rdev->saved_raid_disk != mirror)
837 conf->fullsync = 1;
776 p->rdev = rdev; 838 p->rdev = rdev;
777 break; 839 break;
778 } 840 }
@@ -828,10 +890,11 @@ static int end_sync_read(struct bio *bio, unsigned int bytes_done, int error)
828 * or re-read if the read failed. 890 * or re-read if the read failed.
829 * We don't do much here, just schedule handling by raid1d 891 * We don't do much here, just schedule handling by raid1d
830 */ 892 */
831 if (!uptodate) 893 if (!uptodate) {
832 md_error(r1_bio->mddev, 894 md_error(r1_bio->mddev,
833 conf->mirrors[r1_bio->read_disk].rdev); 895 conf->mirrors[r1_bio->read_disk].rdev);
834 else 896 set_bit(R1BIO_Degraded, &r1_bio->state);
897 } else
835 set_bit(R1BIO_Uptodate, &r1_bio->state); 898 set_bit(R1BIO_Uptodate, &r1_bio->state);
836 rdev_dec_pending(conf->mirrors[r1_bio->read_disk].rdev, conf->mddev); 899 rdev_dec_pending(conf->mirrors[r1_bio->read_disk].rdev, conf->mddev);
837 reschedule_retry(r1_bio); 900 reschedule_retry(r1_bio);
@@ -855,8 +918,10 @@ static int end_sync_write(struct bio *bio, unsigned int bytes_done, int error)
855 mirror = i; 918 mirror = i;
856 break; 919 break;
857 } 920 }
858 if (!uptodate) 921 if (!uptodate) {
859 md_error(mddev, conf->mirrors[mirror].rdev); 922 md_error(mddev, conf->mirrors[mirror].rdev);
923 set_bit(R1BIO_Degraded, &r1_bio->state);
924 }
860 update_head_pos(mirror, r1_bio); 925 update_head_pos(mirror, r1_bio);
861 926
862 if (atomic_dec_and_test(&r1_bio->remaining)) { 927 if (atomic_dec_and_test(&r1_bio->remaining)) {
@@ -876,6 +941,9 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
876 941
877 bio = r1_bio->bios[r1_bio->read_disk]; 942 bio = r1_bio->bios[r1_bio->read_disk];
878 943
944/*
945 if (r1_bio->sector == 0) printk("First sync write startss\n");
946*/
879 /* 947 /*
880 * schedule writes 948 * schedule writes
881 */ 949 */
@@ -903,10 +971,12 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
903 atomic_inc(&conf->mirrors[i].rdev->nr_pending); 971 atomic_inc(&conf->mirrors[i].rdev->nr_pending);
904 atomic_inc(&r1_bio->remaining); 972 atomic_inc(&r1_bio->remaining);
905 md_sync_acct(conf->mirrors[i].rdev->bdev, wbio->bi_size >> 9); 973 md_sync_acct(conf->mirrors[i].rdev->bdev, wbio->bi_size >> 9);
974
906 generic_make_request(wbio); 975 generic_make_request(wbio);
907 } 976 }
908 977
909 if (atomic_dec_and_test(&r1_bio->remaining)) { 978 if (atomic_dec_and_test(&r1_bio->remaining)) {
979 /* if we're here, all write(s) have completed, so clean up */
910 md_done_sync(mddev, r1_bio->sectors, 1); 980 md_done_sync(mddev, r1_bio->sectors, 1);
911 put_buf(r1_bio); 981 put_buf(r1_bio);
912 } 982 }
@@ -931,11 +1001,30 @@ static void raid1d(mddev_t *mddev)
931 mdk_rdev_t *rdev; 1001 mdk_rdev_t *rdev;
932 1002
933 md_check_recovery(mddev); 1003 md_check_recovery(mddev);
934 md_handle_safemode(mddev);
935 1004
936 for (;;) { 1005 for (;;) {
937 char b[BDEVNAME_SIZE]; 1006 char b[BDEVNAME_SIZE];
938 spin_lock_irqsave(&conf->device_lock, flags); 1007 spin_lock_irqsave(&conf->device_lock, flags);
1008
1009 if (conf->pending_bio_list.head) {
1010 bio = bio_list_get(&conf->pending_bio_list);
1011 blk_remove_plug(mddev->queue);
1012 spin_unlock_irqrestore(&conf->device_lock, flags);
1013 /* flush any pending bitmap writes to disk before proceeding w/ I/O */
1014 if (bitmap_unplug(mddev->bitmap) != 0)
1015 printk("%s: bitmap file write failed!\n", mdname(mddev));
1016
1017 while (bio) { /* submit pending writes */
1018 struct bio *next = bio->bi_next;
1019 bio->bi_next = NULL;
1020 generic_make_request(bio);
1021 bio = next;
1022 }
1023 unplug = 1;
1024
1025 continue;
1026 }
1027
939 if (list_empty(head)) 1028 if (list_empty(head))
940 break; 1029 break;
941 r1_bio = list_entry(head->prev, r1bio_t, retry_list); 1030 r1_bio = list_entry(head->prev, r1bio_t, retry_list);
@@ -1009,7 +1098,7 @@ static int init_resync(conf_t *conf)
1009 * that can be installed to exclude normal IO requests. 1098 * that can be installed to exclude normal IO requests.
1010 */ 1099 */
1011 1100
1012static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster) 1101static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster)
1013{ 1102{
1014 conf_t *conf = mddev_to_conf(mddev); 1103 conf_t *conf = mddev_to_conf(mddev);
1015 mirror_info_t *mirror; 1104 mirror_info_t *mirror;
@@ -1019,17 +1108,43 @@ static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster)
1019 int disk; 1108 int disk;
1020 int i; 1109 int i;
1021 int write_targets = 0; 1110 int write_targets = 0;
1111 int sync_blocks;
1022 1112
1023 if (!conf->r1buf_pool) 1113 if (!conf->r1buf_pool)
1114 {
1115/*
1116 printk("sync start - bitmap %p\n", mddev->bitmap);
1117*/
1024 if (init_resync(conf)) 1118 if (init_resync(conf))
1025 return -ENOMEM; 1119 return 0;
1120 }
1026 1121
1027 max_sector = mddev->size << 1; 1122 max_sector = mddev->size << 1;
1028 if (sector_nr >= max_sector) { 1123 if (sector_nr >= max_sector) {
1124 /* If we aborted, we need to abort the
1125 * sync on the 'current' bitmap chunk (there will
1126 * only be one in raid1 resync.
1127 * We can find the current addess in mddev->curr_resync
1128 */
1129 if (!conf->fullsync) {
1130 if (mddev->curr_resync < max_sector)
1131 bitmap_end_sync(mddev->bitmap,
1132 mddev->curr_resync,
1133 &sync_blocks, 1);
1134 bitmap_close_sync(mddev->bitmap);
1135 }
1136 if (mddev->curr_resync >= max_sector)
1137 conf->fullsync = 0;
1029 close_sync(conf); 1138 close_sync(conf);
1030 return 0; 1139 return 0;
1031 } 1140 }
1032 1141
1142 if (!conf->fullsync &&
1143 !bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks)) {
1144 /* We can skip this block, and probably several more */
1145 *skipped = 1;
1146 return sync_blocks;
1147 }
1033 /* 1148 /*
1034 * If there is non-resync activity waiting for us then 1149 * If there is non-resync activity waiting for us then
1035 * put in a delay to throttle resync. 1150 * put in a delay to throttle resync.
@@ -1068,6 +1183,7 @@ static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster)
1068 1183
1069 r1_bio->mddev = mddev; 1184 r1_bio->mddev = mddev;
1070 r1_bio->sector = sector_nr; 1185 r1_bio->sector = sector_nr;
1186 r1_bio->state = 0;
1071 set_bit(R1BIO_IsSync, &r1_bio->state); 1187 set_bit(R1BIO_IsSync, &r1_bio->state);
1072 r1_bio->read_disk = disk; 1188 r1_bio->read_disk = disk;
1073 1189
@@ -1102,18 +1218,24 @@ static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster)
1102 bio->bi_bdev = conf->mirrors[i].rdev->bdev; 1218 bio->bi_bdev = conf->mirrors[i].rdev->bdev;
1103 bio->bi_private = r1_bio; 1219 bio->bi_private = r1_bio;
1104 } 1220 }
1221
1222 if (write_targets + 1 < conf->raid_disks)
1223 /* array degraded, can't clear bitmap */
1224 set_bit(R1BIO_Degraded, &r1_bio->state);
1225
1105 if (write_targets == 0) { 1226 if (write_targets == 0) {
1106 /* There is nowhere to write, so all non-sync 1227 /* There is nowhere to write, so all non-sync
1107 * drives must be failed - so we are finished 1228 * drives must be failed - so we are finished
1108 */ 1229 */
1109 int rv = max_sector - sector_nr; 1230 sector_t rv = max_sector - sector_nr;
1110 md_done_sync(mddev, rv, 1); 1231 *skipped = 1;
1111 put_buf(r1_bio); 1232 put_buf(r1_bio);
1112 rdev_dec_pending(conf->mirrors[disk].rdev, mddev); 1233 rdev_dec_pending(conf->mirrors[disk].rdev, mddev);
1113 return rv; 1234 return rv;
1114 } 1235 }
1115 1236
1116 nr_sectors = 0; 1237 nr_sectors = 0;
1238 sync_blocks = 0;
1117 do { 1239 do {
1118 struct page *page; 1240 struct page *page;
1119 int len = PAGE_SIZE; 1241 int len = PAGE_SIZE;
@@ -1121,6 +1243,17 @@ static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster)
1121 len = (max_sector - sector_nr) << 9; 1243 len = (max_sector - sector_nr) << 9;
1122 if (len == 0) 1244 if (len == 0)
1123 break; 1245 break;
1246 if (!conf->fullsync) {
1247 if (sync_blocks == 0) {
1248 if (!bitmap_start_sync(mddev->bitmap,
1249 sector_nr, &sync_blocks))
1250 break;
1251 if (sync_blocks < (PAGE_SIZE>>9))
1252 BUG();
1253 if (len > (sync_blocks<<9)) len = sync_blocks<<9;
1254 }
1255 }
1256
1124 for (i=0 ; i < conf->raid_disks; i++) { 1257 for (i=0 ; i < conf->raid_disks; i++) {
1125 bio = r1_bio->bios[i]; 1258 bio = r1_bio->bios[i];
1126 if (bio->bi_end_io) { 1259 if (bio->bi_end_io) {
@@ -1143,6 +1276,7 @@ static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster)
1143 } 1276 }
1144 nr_sectors += len>>9; 1277 nr_sectors += len>>9;
1145 sector_nr += len>>9; 1278 sector_nr += len>>9;
1279 sync_blocks -= (len>>9);
1146 } while (r1_bio->bios[disk]->bi_vcnt < RESYNC_PAGES); 1280 } while (r1_bio->bios[disk]->bi_vcnt < RESYNC_PAGES);
1147 bio_full: 1281 bio_full:
1148 bio = r1_bio->bios[disk]; 1282 bio = r1_bio->bios[disk];
@@ -1231,6 +1365,9 @@ static int run(mddev_t *mddev)
1231 init_waitqueue_head(&conf->wait_idle); 1365 init_waitqueue_head(&conf->wait_idle);
1232 init_waitqueue_head(&conf->wait_resume); 1366 init_waitqueue_head(&conf->wait_resume);
1233 1367
1368 bio_list_init(&conf->pending_bio_list);
1369 bio_list_init(&conf->flushing_bio_list);
1370
1234 if (!conf->working_disks) { 1371 if (!conf->working_disks) {
1235 printk(KERN_ERR "raid1: no operational mirrors for %s\n", 1372 printk(KERN_ERR "raid1: no operational mirrors for %s\n",
1236 mdname(mddev)); 1373 mdname(mddev));
@@ -1259,16 +1396,15 @@ static int run(mddev_t *mddev)
1259 conf->last_used = j; 1396 conf->last_used = j;
1260 1397
1261 1398
1262 1399 mddev->thread = md_register_thread(raid1d, mddev, "%s_raid1");
1263 { 1400 if (!mddev->thread) {
1264 mddev->thread = md_register_thread(raid1d, mddev, "%s_raid1"); 1401 printk(KERN_ERR
1265 if (!mddev->thread) { 1402 "raid1: couldn't allocate thread for %s\n",
1266 printk(KERN_ERR 1403 mdname(mddev));
1267 "raid1: couldn't allocate thread for %s\n", 1404 goto out_free_conf;
1268 mdname(mddev));
1269 goto out_free_conf;
1270 }
1271 } 1405 }
1406 if (mddev->bitmap) mddev->thread->timeout = mddev->bitmap->daemon_sleep * HZ;
1407
1272 printk(KERN_INFO 1408 printk(KERN_INFO
1273 "raid1: raid set %s active with %d out of %d mirrors\n", 1409 "raid1: raid set %s active with %d out of %d mirrors\n",
1274 mdname(mddev), mddev->raid_disks - mddev->degraded, 1410 mdname(mddev), mddev->raid_disks - mddev->degraded,
@@ -1291,10 +1427,8 @@ out_free_conf:
1291 if (conf) { 1427 if (conf) {
1292 if (conf->r1bio_pool) 1428 if (conf->r1bio_pool)
1293 mempool_destroy(conf->r1bio_pool); 1429 mempool_destroy(conf->r1bio_pool);
1294 if (conf->mirrors) 1430 kfree(conf->mirrors);
1295 kfree(conf->mirrors); 1431 kfree(conf->poolinfo);
1296 if (conf->poolinfo)
1297 kfree(conf->poolinfo);
1298 kfree(conf); 1432 kfree(conf);
1299 mddev->private = NULL; 1433 mddev->private = NULL;
1300 } 1434 }
@@ -1311,10 +1445,8 @@ static int stop(mddev_t *mddev)
1311 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ 1445 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
1312 if (conf->r1bio_pool) 1446 if (conf->r1bio_pool)
1313 mempool_destroy(conf->r1bio_pool); 1447 mempool_destroy(conf->r1bio_pool);
1314 if (conf->mirrors) 1448 kfree(conf->mirrors);
1315 kfree(conf->mirrors); 1449 kfree(conf->poolinfo);
1316 if (conf->poolinfo)
1317 kfree(conf->poolinfo);
1318 kfree(conf); 1450 kfree(conf);
1319 mddev->private = NULL; 1451 mddev->private = NULL;
1320 return 0; 1452 return 0;
@@ -1349,17 +1481,26 @@ static int raid1_reshape(mddev_t *mddev, int raid_disks)
1349 * We allocate a new r1bio_pool if we can. 1481 * We allocate a new r1bio_pool if we can.
1350 * Then raise a device barrier and wait until all IO stops. 1482 * Then raise a device barrier and wait until all IO stops.
1351 * Then resize conf->mirrors and swap in the new r1bio pool. 1483 * Then resize conf->mirrors and swap in the new r1bio pool.
1484 *
1485 * At the same time, we "pack" the devices so that all the missing
1486 * devices have the higher raid_disk numbers.
1352 */ 1487 */
1353 mempool_t *newpool, *oldpool; 1488 mempool_t *newpool, *oldpool;
1354 struct pool_info *newpoolinfo; 1489 struct pool_info *newpoolinfo;
1355 mirror_info_t *newmirrors; 1490 mirror_info_t *newmirrors;
1356 conf_t *conf = mddev_to_conf(mddev); 1491 conf_t *conf = mddev_to_conf(mddev);
1492 int cnt;
1357 1493
1358 int d; 1494 int d, d2;
1359 1495
1360 for (d= raid_disks; d < conf->raid_disks; d++) 1496 if (raid_disks < conf->raid_disks) {
1361 if (conf->mirrors[d].rdev) 1497 cnt=0;
1498 for (d= 0; d < conf->raid_disks; d++)
1499 if (conf->mirrors[d].rdev)
1500 cnt++;
1501 if (cnt > raid_disks)
1362 return -EBUSY; 1502 return -EBUSY;
1503 }
1363 1504
1364 newpoolinfo = kmalloc(sizeof(*newpoolinfo), GFP_KERNEL); 1505 newpoolinfo = kmalloc(sizeof(*newpoolinfo), GFP_KERNEL);
1365 if (!newpoolinfo) 1506 if (!newpoolinfo)
@@ -1384,14 +1525,18 @@ static int raid1_reshape(mddev_t *mddev, int raid_disks)
1384 spin_lock_irq(&conf->resync_lock); 1525 spin_lock_irq(&conf->resync_lock);
1385 conf->barrier++; 1526 conf->barrier++;
1386 wait_event_lock_irq(conf->wait_idle, !conf->nr_pending, 1527 wait_event_lock_irq(conf->wait_idle, !conf->nr_pending,
1387 conf->resync_lock, unplug_slaves(mddev)); 1528 conf->resync_lock, raid1_unplug(mddev->queue));
1388 spin_unlock_irq(&conf->resync_lock); 1529 spin_unlock_irq(&conf->resync_lock);
1389 1530
1390 /* ok, everything is stopped */ 1531 /* ok, everything is stopped */
1391 oldpool = conf->r1bio_pool; 1532 oldpool = conf->r1bio_pool;
1392 conf->r1bio_pool = newpool; 1533 conf->r1bio_pool = newpool;
1393 for (d=0; d < raid_disks && d < conf->raid_disks; d++) 1534
1394 newmirrors[d] = conf->mirrors[d]; 1535 for (d=d2=0; d < conf->raid_disks; d++)
1536 if (conf->mirrors[d].rdev) {
1537 conf->mirrors[d].rdev->raid_disk = d2;
1538 newmirrors[d2++].rdev = conf->mirrors[d].rdev;
1539 }
1395 kfree(conf->mirrors); 1540 kfree(conf->mirrors);
1396 conf->mirrors = newmirrors; 1541 conf->mirrors = newmirrors;
1397 kfree(conf->poolinfo); 1542 kfree(conf->poolinfo);
@@ -1400,6 +1545,7 @@ static int raid1_reshape(mddev_t *mddev, int raid_disks)
1400 mddev->degraded += (raid_disks - conf->raid_disks); 1545 mddev->degraded += (raid_disks - conf->raid_disks);
1401 conf->raid_disks = mddev->raid_disks = raid_disks; 1546 conf->raid_disks = mddev->raid_disks = raid_disks;
1402 1547
1548 conf->last_used = 0; /* just make sure it is in-range */
1403 spin_lock_irq(&conf->resync_lock); 1549 spin_lock_irq(&conf->resync_lock);
1404 conf->barrier--; 1550 conf->barrier--;
1405 spin_unlock_irq(&conf->resync_lock); 1551 spin_unlock_irq(&conf->resync_lock);
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 3c37be6423d7..62ebb1bc72be 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -700,6 +700,8 @@ static int make_request(request_queue_t *q, struct bio * bio)
700 return 0; 700 return 0;
701 } 701 }
702 702
703 md_write_start(mddev, bio);
704
703 /* 705 /*
704 * Register the new request and wait if the reconstruction 706 * Register the new request and wait if the reconstruction
705 * thread has put up a bar for new requests. 707 * thread has put up a bar for new requests.
@@ -774,7 +776,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
774 rcu_read_unlock(); 776 rcu_read_unlock();
775 777
776 atomic_set(&r10_bio->remaining, 1); 778 atomic_set(&r10_bio->remaining, 1);
777 md_write_start(mddev); 779
778 for (i = 0; i < conf->copies; i++) { 780 for (i = 0; i < conf->copies; i++) {
779 struct bio *mbio; 781 struct bio *mbio;
780 int d = r10_bio->devs[i].devnum; 782 int d = r10_bio->devs[i].devnum;
@@ -1216,7 +1218,6 @@ static void raid10d(mddev_t *mddev)
1216 mdk_rdev_t *rdev; 1218 mdk_rdev_t *rdev;
1217 1219
1218 md_check_recovery(mddev); 1220 md_check_recovery(mddev);
1219 md_handle_safemode(mddev);
1220 1221
1221 for (;;) { 1222 for (;;) {
1222 char b[BDEVNAME_SIZE]; 1223 char b[BDEVNAME_SIZE];
@@ -1319,7 +1320,7 @@ static int init_resync(conf_t *conf)
1319 * 1320 *
1320 */ 1321 */
1321 1322
1322static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster) 1323static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster)
1323{ 1324{
1324 conf_t *conf = mddev_to_conf(mddev); 1325 conf_t *conf = mddev_to_conf(mddev);
1325 r10bio_t *r10_bio; 1326 r10bio_t *r10_bio;
@@ -1333,7 +1334,7 @@ static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster)
1333 1334
1334 if (!conf->r10buf_pool) 1335 if (!conf->r10buf_pool)
1335 if (init_resync(conf)) 1336 if (init_resync(conf))
1336 return -ENOMEM; 1337 return 0;
1337 1338
1338 skipped: 1339 skipped:
1339 max_sector = mddev->size << 1; 1340 max_sector = mddev->size << 1;
@@ -1341,15 +1342,15 @@ static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster)
1341 max_sector = mddev->resync_max_sectors; 1342 max_sector = mddev->resync_max_sectors;
1342 if (sector_nr >= max_sector) { 1343 if (sector_nr >= max_sector) {
1343 close_sync(conf); 1344 close_sync(conf);
1345 *skipped = 1;
1344 return sectors_skipped; 1346 return sectors_skipped;
1345 } 1347 }
1346 if (chunks_skipped >= conf->raid_disks) { 1348 if (chunks_skipped >= conf->raid_disks) {
1347 /* if there has been nothing to do on any drive, 1349 /* if there has been nothing to do on any drive,
1348 * then there is nothing to do at all.. 1350 * then there is nothing to do at all..
1349 */ 1351 */
1350 sector_t sec = max_sector - sector_nr; 1352 *skipped = 1;
1351 md_done_sync(mddev, sec, 1); 1353 return (max_sector - sector_nr) + sectors_skipped;
1352 return sec + sectors_skipped;
1353 } 1354 }
1354 1355
1355 /* make sure whole request will fit in a chunk - if chunks 1356 /* make sure whole request will fit in a chunk - if chunks
@@ -1563,17 +1564,22 @@ static int sync_request(mddev_t *mddev, sector_t sector_nr, int go_faster)
1563 } 1564 }
1564 } 1565 }
1565 1566
1567 if (sectors_skipped)
1568 /* pretend they weren't skipped, it makes
1569 * no important difference in this case
1570 */
1571 md_done_sync(mddev, sectors_skipped, 1);
1572
1566 return sectors_skipped + nr_sectors; 1573 return sectors_skipped + nr_sectors;
1567 giveup: 1574 giveup:
1568 /* There is nowhere to write, so all non-sync 1575 /* There is nowhere to write, so all non-sync
1569 * drives must be failed, so try the next chunk... 1576 * drives must be failed, so try the next chunk...
1570 */ 1577 */
1571 { 1578 {
1572 int sec = max_sector - sector_nr; 1579 sector_t sec = max_sector - sector_nr;
1573 sectors_skipped += sec; 1580 sectors_skipped += sec;
1574 chunks_skipped ++; 1581 chunks_skipped ++;
1575 sector_nr = max_sector; 1582 sector_nr = max_sector;
1576 md_done_sync(mddev, sec, 1);
1577 goto skipped; 1583 goto skipped;
1578 } 1584 }
1579} 1585}
@@ -1731,8 +1737,7 @@ static int run(mddev_t *mddev)
1731out_free_conf: 1737out_free_conf:
1732 if (conf->r10bio_pool) 1738 if (conf->r10bio_pool)
1733 mempool_destroy(conf->r10bio_pool); 1739 mempool_destroy(conf->r10bio_pool);
1734 if (conf->mirrors) 1740 kfree(conf->mirrors);
1735 kfree(conf->mirrors);
1736 kfree(conf); 1741 kfree(conf);
1737 mddev->private = NULL; 1742 mddev->private = NULL;
1738out: 1743out:
@@ -1748,8 +1753,7 @@ static int stop(mddev_t *mddev)
1748 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ 1753 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
1749 if (conf->r10bio_pool) 1754 if (conf->r10bio_pool)
1750 mempool_destroy(conf->r10bio_pool); 1755 mempool_destroy(conf->r10bio_pool);
1751 if (conf->mirrors) 1756 kfree(conf->mirrors);
1752 kfree(conf->mirrors);
1753 kfree(conf); 1757 kfree(conf);
1754 mddev->private = NULL; 1758 mddev->private = NULL;
1755 return 0; 1759 return 0;
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 3cb11ac232fa..93a9726cc2d6 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1411,6 +1411,8 @@ static int make_request (request_queue_t *q, struct bio * bi)
1411 sector_t logical_sector, last_sector; 1411 sector_t logical_sector, last_sector;
1412 struct stripe_head *sh; 1412 struct stripe_head *sh;
1413 1413
1414 md_write_start(mddev, bi);
1415
1414 if (bio_data_dir(bi)==WRITE) { 1416 if (bio_data_dir(bi)==WRITE) {
1415 disk_stat_inc(mddev->gendisk, writes); 1417 disk_stat_inc(mddev->gendisk, writes);
1416 disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bi)); 1418 disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bi));
@@ -1423,8 +1425,7 @@ static int make_request (request_queue_t *q, struct bio * bi)
1423 last_sector = bi->bi_sector + (bi->bi_size>>9); 1425 last_sector = bi->bi_sector + (bi->bi_size>>9);
1424 bi->bi_next = NULL; 1426 bi->bi_next = NULL;
1425 bi->bi_phys_segments = 1; /* over-loaded to count active stripes */ 1427 bi->bi_phys_segments = 1; /* over-loaded to count active stripes */
1426 if ( bio_data_dir(bi) == WRITE ) 1428
1427 md_write_start(mddev);
1428 for (;logical_sector < last_sector; logical_sector += STRIPE_SECTORS) { 1429 for (;logical_sector < last_sector; logical_sector += STRIPE_SECTORS) {
1429 DEFINE_WAIT(w); 1430 DEFINE_WAIT(w);
1430 1431
@@ -1475,7 +1476,7 @@ static int make_request (request_queue_t *q, struct bio * bi)
1475} 1476}
1476 1477
1477/* FIXME go_faster isn't used */ 1478/* FIXME go_faster isn't used */
1478static int sync_request (mddev_t *mddev, sector_t sector_nr, int go_faster) 1479static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster)
1479{ 1480{
1480 raid5_conf_t *conf = (raid5_conf_t *) mddev->private; 1481 raid5_conf_t *conf = (raid5_conf_t *) mddev->private;
1481 struct stripe_head *sh; 1482 struct stripe_head *sh;
@@ -1498,8 +1499,8 @@ static int sync_request (mddev_t *mddev, sector_t sector_nr, int go_faster)
1498 * nothing we can do. 1499 * nothing we can do.
1499 */ 1500 */
1500 if (mddev->degraded >= 1 && test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { 1501 if (mddev->degraded >= 1 && test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
1501 int rv = (mddev->size << 1) - sector_nr; 1502 sector_t rv = (mddev->size << 1) - sector_nr;
1502 md_done_sync(mddev, rv, 1); 1503 *skipped = 1;
1503 return rv; 1504 return rv;
1504 } 1505 }
1505 1506
@@ -1546,7 +1547,6 @@ static void raid5d (mddev_t *mddev)
1546 PRINTK("+++ raid5d active\n"); 1547 PRINTK("+++ raid5d active\n");
1547 1548
1548 md_check_recovery(mddev); 1549 md_check_recovery(mddev);
1549 md_handle_safemode(mddev);
1550 1550
1551 handled = 0; 1551 handled = 0;
1552 spin_lock_irq(&conf->device_lock); 1552 spin_lock_irq(&conf->device_lock);
diff --git a/drivers/md/raid6main.c b/drivers/md/raid6main.c
index 908edd78a792..f62ea1a73d0d 100644
--- a/drivers/md/raid6main.c
+++ b/drivers/md/raid6main.c
@@ -1570,6 +1570,8 @@ static int make_request (request_queue_t *q, struct bio * bi)
1570 sector_t logical_sector, last_sector; 1570 sector_t logical_sector, last_sector;
1571 struct stripe_head *sh; 1571 struct stripe_head *sh;
1572 1572
1573 md_write_start(mddev, bi);
1574
1573 if (bio_data_dir(bi)==WRITE) { 1575 if (bio_data_dir(bi)==WRITE) {
1574 disk_stat_inc(mddev->gendisk, writes); 1576 disk_stat_inc(mddev->gendisk, writes);
1575 disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bi)); 1577 disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bi));
@@ -1583,8 +1585,7 @@ static int make_request (request_queue_t *q, struct bio * bi)
1583 1585
1584 bi->bi_next = NULL; 1586 bi->bi_next = NULL;
1585 bi->bi_phys_segments = 1; /* over-loaded to count active stripes */ 1587 bi->bi_phys_segments = 1; /* over-loaded to count active stripes */
1586 if ( bio_data_dir(bi) == WRITE ) 1588
1587 md_write_start(mddev);
1588 for (;logical_sector < last_sector; logical_sector += STRIPE_SECTORS) { 1589 for (;logical_sector < last_sector; logical_sector += STRIPE_SECTORS) {
1589 DEFINE_WAIT(w); 1590 DEFINE_WAIT(w);
1590 1591
@@ -1634,7 +1635,7 @@ static int make_request (request_queue_t *q, struct bio * bi)
1634} 1635}
1635 1636
1636/* FIXME go_faster isn't used */ 1637/* FIXME go_faster isn't used */
1637static int sync_request (mddev_t *mddev, sector_t sector_nr, int go_faster) 1638static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster)
1638{ 1639{
1639 raid6_conf_t *conf = (raid6_conf_t *) mddev->private; 1640 raid6_conf_t *conf = (raid6_conf_t *) mddev->private;
1640 struct stripe_head *sh; 1641 struct stripe_head *sh;
@@ -1657,8 +1658,8 @@ static int sync_request (mddev_t *mddev, sector_t sector_nr, int go_faster)
1657 * nothing we can do. 1658 * nothing we can do.
1658 */ 1659 */
1659 if (mddev->degraded >= 2 && test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { 1660 if (mddev->degraded >= 2 && test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
1660 int rv = (mddev->size << 1) - sector_nr; 1661 sector_t rv = (mddev->size << 1) - sector_nr;
1661 md_done_sync(mddev, rv, 1); 1662 *skipped = 1;
1662 return rv; 1663 return rv;
1663 } 1664 }
1664 1665
@@ -1705,7 +1706,6 @@ static void raid6d (mddev_t *mddev)
1705 PRINTK("+++ raid6d active\n"); 1706 PRINTK("+++ raid6d active\n");
1706 1707
1707 md_check_recovery(mddev); 1708 md_check_recovery(mddev);
1708 md_handle_safemode(mddev);
1709 1709
1710 handled = 0; 1710 handled = 0;
1711 spin_lock_irq(&conf->device_lock); 1711 spin_lock_irq(&conf->device_lock);
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c
index d047e349d706..1339912c308b 100644
--- a/drivers/media/dvb/bt8xx/dst.c
+++ b/drivers/media/dvb/bt8xx/dst.c
@@ -906,22 +906,12 @@ static int dst_tone_power_cmd(struct dst_state* state)
906 if (state->dst_type == DST_TYPE_IS_TERR) 906 if (state->dst_type == DST_TYPE_IS_TERR)
907 return 0; 907 return 0;
908 908
909 if (state->voltage == SEC_VOLTAGE_OFF) 909 paket[4] = state->tx_tuna[4];
910 paket[4] = 0; 910 paket[2] = state->tx_tuna[2];
911 else 911 paket[3] = state->tx_tuna[3];
912 paket[4] = 1;
913
914 if (state->tone == SEC_TONE_ON)
915 paket[2] = 0x02;
916 else
917 paket[2] = 0;
918 if (state->minicmd == SEC_MINI_A)
919 paket[3] = 0x02;
920 else
921 paket[3] = 0;
922
923 paket[7] = dst_check_sum (paket, 7); 912 paket[7] = dst_check_sum (paket, 7);
924 dst_command(state, paket, 8); 913 dst_command(state, paket, 8);
914
925 return 0; 915 return 0;
926} 916}
927 917
@@ -980,7 +970,7 @@ static int dst_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage);
980 970
981static int dst_write_tuna(struct dvb_frontend* fe) 971static int dst_write_tuna(struct dvb_frontend* fe)
982{ 972{
983 struct dst_state* state = (struct dst_state*) fe->demodulator_priv; 973 struct dst_state* state = fe->demodulator_priv;
984 int retval; 974 int retval;
985 u8 reply; 975 u8 reply;
986 976
@@ -1048,10 +1038,10 @@ static int dst_write_tuna(struct dvb_frontend* fe)
1048 1038
1049static int dst_set_diseqc(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd* cmd) 1039static int dst_set_diseqc(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd* cmd)
1050{ 1040{
1051 struct dst_state* state = (struct dst_state*) fe->demodulator_priv; 1041 struct dst_state* state = fe->demodulator_priv;
1052 u8 paket[8] = { 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf0, 0xec }; 1042 u8 paket[8] = { 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf0, 0xec };
1053 1043
1054 if (state->dst_type == DST_TYPE_IS_TERR) 1044 if (state->dst_type != DST_TYPE_IS_SAT)
1055 return 0; 1045 return 0;
1056 1046
1057 if (cmd->msg_len == 0 || cmd->msg_len > 4) 1047 if (cmd->msg_len == 0 || cmd->msg_len > 4)
@@ -1064,39 +1054,32 @@ static int dst_set_diseqc(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd*
1064 1054
1065static int dst_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage) 1055static int dst_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage)
1066{ 1056{
1067 u8 *val;
1068 int need_cmd; 1057 int need_cmd;
1069 struct dst_state* state = (struct dst_state*) fe->demodulator_priv; 1058 struct dst_state* state = fe->demodulator_priv;
1070 1059
1071 state->voltage = voltage; 1060 state->voltage = voltage;
1072 1061
1073 if (state->dst_type == DST_TYPE_IS_TERR) 1062 if (state->dst_type != DST_TYPE_IS_SAT)
1074 return 0; 1063 return 0;
1075 1064
1076 need_cmd = 0; 1065 need_cmd = 0;
1077 val = &state->tx_tuna[0];
1078 val[8] &= ~0x40;
1079 switch (voltage) { 1066 switch (voltage) {
1080 case SEC_VOLTAGE_13: 1067 case SEC_VOLTAGE_13:
1081 if ((state->diseq_flags & HAS_POWER) == 0) 1068 case SEC_VOLTAGE_18:
1082 need_cmd = 1; 1069 if ((state->diseq_flags & HAS_POWER) == 0)
1083 state->diseq_flags |= HAS_POWER; 1070 need_cmd = 1;
1084 break; 1071 state->diseq_flags |= HAS_POWER;
1072 state->tx_tuna[4] = 0x01;
1073 break;
1085 1074
1086 case SEC_VOLTAGE_18: 1075 case SEC_VOLTAGE_OFF:
1087 if ((state->diseq_flags & HAS_POWER) == 0)
1088 need_cmd = 1; 1076 need_cmd = 1;
1089 state->diseq_flags |= HAS_POWER; 1077 state->diseq_flags &= ~(HAS_POWER | HAS_LOCK | ATTEMPT_TUNE);
1090 val[8] |= 0x40; 1078 state->tx_tuna[4] = 0x00;
1091 break; 1079 break;
1092
1093 case SEC_VOLTAGE_OFF:
1094 need_cmd = 1;
1095 state->diseq_flags &= ~(HAS_POWER | HAS_LOCK | ATTEMPT_TUNE);
1096 break;
1097 1080
1098 default: 1081 default:
1099 return -EINVAL; 1082 return -EINVAL;
1100 } 1083 }
1101 if (need_cmd) 1084 if (need_cmd)
1102 dst_tone_power_cmd(state); 1085 dst_tone_power_cmd(state);
@@ -1106,37 +1089,56 @@ static int dst_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage)
1106 1089
1107static int dst_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) 1090static int dst_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
1108{ 1091{
1109 u8 *val; 1092 struct dst_state* state = fe->demodulator_priv;
1110 struct dst_state* state = (struct dst_state*) fe->demodulator_priv;
1111 1093
1112 state->tone = tone; 1094 state->tone = tone;
1113 1095
1114 if (state->dst_type == DST_TYPE_IS_TERR) 1096 if (state->dst_type != DST_TYPE_IS_SAT)
1115 return 0; 1097 return 0;
1116 1098
1117 val = &state->tx_tuna[0]; 1099 switch (tone) {
1100 case SEC_TONE_OFF:
1101 state->tx_tuna[2] = 0xff;
1102 break;
1118 1103
1119 val[8] &= ~0x1; 1104 case SEC_TONE_ON:
1105 state->tx_tuna[2] = 0x02;
1106 break;
1120 1107
1121 switch (tone) { 1108 default:
1122 case SEC_TONE_OFF: 1109 return -EINVAL;
1123 break; 1110 }
1111 dst_tone_power_cmd(state);
1124 1112
1125 case SEC_TONE_ON: 1113 return 0;
1126 val[8] |= 1; 1114}
1127 break;
1128 1115
1129 default: 1116static int dst_send_burst(struct dvb_frontend *fe, fe_sec_mini_cmd_t minicmd)
1130 return -EINVAL; 1117{
1118 struct dst_state *state = fe->demodulator_priv;
1119
1120 if (state->dst_type != DST_TYPE_IS_SAT)
1121 return 0;
1122
1123 state->minicmd = minicmd;
1124
1125 switch (minicmd) {
1126 case SEC_MINI_A:
1127 state->tx_tuna[3] = 0x02;
1128 break;
1129 case SEC_MINI_B:
1130 state->tx_tuna[3] = 0xff;
1131 break;
1131 } 1132 }
1132 dst_tone_power_cmd(state); 1133 dst_tone_power_cmd(state);
1133 1134
1134 return 0; 1135 return 0;
1135} 1136}
1136 1137
1138
1137static int dst_init(struct dvb_frontend* fe) 1139static int dst_init(struct dvb_frontend* fe)
1138{ 1140{
1139 struct dst_state* state = (struct dst_state*) fe->demodulator_priv; 1141 struct dst_state* state = fe->demodulator_priv;
1140 static u8 ini_satci_tuna[] = { 9, 0, 3, 0xb6, 1, 0, 0x73, 0x21, 0, 0 }; 1142 static u8 ini_satci_tuna[] = { 9, 0, 3, 0xb6, 1, 0, 0x73, 0x21, 0, 0 };
1141 static u8 ini_satfta_tuna[] = { 0, 0, 3, 0xb6, 1, 0x55, 0xbd, 0x50, 0, 0 }; 1143 static u8 ini_satfta_tuna[] = { 0, 0, 3, 0xb6, 1, 0x55, 0xbd, 0x50, 0, 0 };
1142 static u8 ini_tvfta_tuna[] = { 0, 0, 3, 0xb6, 1, 7, 0x0, 0x0, 0, 0 }; 1144 static u8 ini_tvfta_tuna[] = { 0, 0, 3, 0xb6, 1, 7, 0x0, 0x0, 0, 0 };
@@ -1168,7 +1170,7 @@ static int dst_init(struct dvb_frontend* fe)
1168 1170
1169static int dst_read_status(struct dvb_frontend* fe, fe_status_t* status) 1171static int dst_read_status(struct dvb_frontend* fe, fe_status_t* status)
1170{ 1172{
1171 struct dst_state* state = (struct dst_state*) fe->demodulator_priv; 1173 struct dst_state* state = fe->demodulator_priv;
1172 1174
1173 *status = 0; 1175 *status = 0;
1174 if (state->diseq_flags & HAS_LOCK) { 1176 if (state->diseq_flags & HAS_LOCK) {
@@ -1182,7 +1184,7 @@ static int dst_read_status(struct dvb_frontend* fe, fe_status_t* status)
1182 1184
1183static int dst_read_signal_strength(struct dvb_frontend* fe, u16* strength) 1185static int dst_read_signal_strength(struct dvb_frontend* fe, u16* strength)
1184{ 1186{
1185 struct dst_state* state = (struct dst_state*) fe->demodulator_priv; 1187 struct dst_state* state = fe->demodulator_priv;
1186 1188
1187 dst_get_signal(state); 1189 dst_get_signal(state);
1188 *strength = state->decode_strength; 1190 *strength = state->decode_strength;
@@ -1192,7 +1194,7 @@ static int dst_read_signal_strength(struct dvb_frontend* fe, u16* strength)
1192 1194
1193static int dst_read_snr(struct dvb_frontend* fe, u16* snr) 1195static int dst_read_snr(struct dvb_frontend* fe, u16* snr)
1194{ 1196{
1195 struct dst_state* state = (struct dst_state*) fe->demodulator_priv; 1197 struct dst_state* state = fe->demodulator_priv;
1196 1198
1197 dst_get_signal(state); 1199 dst_get_signal(state);
1198 *snr = state->decode_snr; 1200 *snr = state->decode_snr;
@@ -1202,7 +1204,7 @@ static int dst_read_snr(struct dvb_frontend* fe, u16* snr)
1202 1204
1203static int dst_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) 1205static int dst_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
1204{ 1206{
1205 struct dst_state* state = (struct dst_state*) fe->demodulator_priv; 1207 struct dst_state* state = fe->demodulator_priv;
1206 1208
1207 dst_set_freq(state, p->frequency); 1209 dst_set_freq(state, p->frequency);
1208 if (verbose > 4) 1210 if (verbose > 4)
@@ -1228,7 +1230,7 @@ static int dst_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_paramet
1228 1230
1229static int dst_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) 1231static int dst_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
1230{ 1232{
1231 struct dst_state* state = (struct dst_state*) fe->demodulator_priv; 1233 struct dst_state* state = fe->demodulator_priv;
1232 1234
1233 p->frequency = state->decode_freq; 1235 p->frequency = state->decode_freq;
1234 p->inversion = state->inversion; 1236 p->inversion = state->inversion;
@@ -1248,7 +1250,7 @@ static int dst_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_paramet
1248 1250
1249static void dst_release(struct dvb_frontend* fe) 1251static void dst_release(struct dvb_frontend* fe)
1250{ 1252{
1251 struct dst_state* state = (struct dst_state*) fe->demodulator_priv; 1253 struct dst_state* state = fe->demodulator_priv;
1252 kfree(state); 1254 kfree(state);
1253} 1255}
1254 1256
@@ -1346,7 +1348,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
1346 .read_signal_strength = dst_read_signal_strength, 1348 .read_signal_strength = dst_read_signal_strength,
1347 .read_snr = dst_read_snr, 1349 .read_snr = dst_read_snr,
1348 1350
1349 .diseqc_send_burst = dst_set_tone, 1351 .diseqc_send_burst = dst_send_burst,
1350 .diseqc_send_master_cmd = dst_set_diseqc, 1352 .diseqc_send_master_cmd = dst_set_diseqc,
1351 .set_voltage = dst_set_voltage, 1353 .set_voltage = dst_set_voltage,
1352 .set_tone = dst_set_tone, 1354 .set_tone = dst_set_tone,
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index 9d9662f4b8e6..4b7adca3e286 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -56,8 +56,7 @@ static const char * const dnames[] = {
56#define nums2minor(num,type,id) ((num << 6) | (id << 4) | type) 56#define nums2minor(num,type,id) ((num << 6) | (id << 4) | type)
57#define MAX_DVB_MINORS (DVB_MAX_ADAPTERS*64) 57#define MAX_DVB_MINORS (DVB_MAX_ADAPTERS*64)
58 58
59struct class_simple *dvb_class; 59static struct class *dvb_class;
60EXPORT_SYMBOL(dvb_class);
61 60
62static struct dvb_device* dvbdev_find_device (int minor) 61static struct dvb_device* dvbdev_find_device (int minor)
63{ 62{
@@ -236,8 +235,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
236 S_IFCHR | S_IRUSR | S_IWUSR, 235 S_IFCHR | S_IRUSR | S_IWUSR,
237 "dvb/adapter%d/%s%d", adap->num, dnames[type], id); 236 "dvb/adapter%d/%s%d", adap->num, dnames[type], id);
238 237
239 class_simple_device_add(dvb_class, MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), 238 class_device_create(dvb_class, MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)),
240 NULL, "dvb%d.%s%d", adap->num, dnames[type], id); 239 NULL, "dvb%d.%s%d", adap->num, dnames[type], id);
241 240
242 dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n", 241 dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n",
243 adap->num, dnames[type], id, nums2minor(adap->num, type, id), 242 adap->num, dnames[type], id, nums2minor(adap->num, type, id),
@@ -256,7 +255,7 @@ void dvb_unregister_device(struct dvb_device *dvbdev)
256 devfs_remove("dvb/adapter%d/%s%d", dvbdev->adapter->num, 255 devfs_remove("dvb/adapter%d/%s%d", dvbdev->adapter->num,
257 dnames[dvbdev->type], dvbdev->id); 256 dnames[dvbdev->type], dvbdev->id);
258 257
259 class_simple_device_remove(MKDEV(DVB_MAJOR, nums2minor(dvbdev->adapter->num, 258 class_device_destroy(dvb_class, MKDEV(DVB_MAJOR, nums2minor(dvbdev->adapter->num,
260 dvbdev->type, dvbdev->id))); 259 dvbdev->type, dvbdev->id)));
261 260
262 list_del (&dvbdev->list_head); 261 list_del (&dvbdev->list_head);
@@ -412,7 +411,7 @@ static int __init init_dvbdev(void)
412 411
413 devfs_mk_dir("dvb"); 412 devfs_mk_dir("dvb");
414 413
415 dvb_class = class_simple_create(THIS_MODULE, "dvb"); 414 dvb_class = class_create(THIS_MODULE, "dvb");
416 if (IS_ERR(dvb_class)) { 415 if (IS_ERR(dvb_class)) {
417 retval = PTR_ERR(dvb_class); 416 retval = PTR_ERR(dvb_class);
418 goto error; 417 goto error;
@@ -429,7 +428,7 @@ error:
429static void __exit exit_dvbdev(void) 428static void __exit exit_dvbdev(void)
430{ 429{
431 devfs_remove("dvb"); 430 devfs_remove("dvb");
432 class_simple_destroy(dvb_class); 431 class_destroy(dvb_class);
433 cdev_del(&dvb_device_cdev); 432 cdev_del(&dvb_device_cdev);
434 unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS); 433 unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS);
435} 434}
diff --git a/drivers/message/fusion/Kconfig b/drivers/message/fusion/Kconfig
index 452418b24d7b..33f209a39cb6 100644
--- a/drivers/message/fusion/Kconfig
+++ b/drivers/message/fusion/Kconfig
@@ -2,34 +2,54 @@
2menu "Fusion MPT device support" 2menu "Fusion MPT device support"
3 3
4config FUSION 4config FUSION
5 tristate "Fusion MPT (base + ScsiHost) drivers" 5 bool
6 default n
7
8config FUSION_SPI
9 tristate "Fusion MPT ScsiHost drivers for SPI"
10 depends on PCI && SCSI
11 select FUSION
12 ---help---
13 SCSI HOST support for a parallel SCSI host adapters.
14
15 List of supported controllers:
16
17 LSI53C1020
18 LSI53C1020A
19 LSI53C1030
20 LSI53C1035
21
22config FUSION_FC
23 tristate "Fusion MPT ScsiHost drivers for FC"
6 depends on PCI && SCSI 24 depends on PCI && SCSI
25 select FUSION
7 ---help--- 26 ---help---
8 LSI Logic Fusion(TM) Message Passing Technology (MPT) device support 27 SCSI HOST support for a Fiber Channel host adapters.
9 provides high performance SCSI host initiator, and LAN [1] interface
10 services to a host system. The Fusion architecture is capable of
11 duplexing these protocols on high-speed Fibre Channel
12 (up to 2 GHz x 2 ports = 4 GHz) and parallel SCSI (up to Ultra-320)
13 physical medium.
14 28
15 [1] LAN is not supported on parallel SCSI medium. 29 List of supported controllers:
30
31 LSIFC909
32 LSIFC919
33 LSIFC919X
34 LSIFC929
35 LSIFC929X
36 LSIFC929XL
16 37
17config FUSION_MAX_SGE 38config FUSION_MAX_SGE
18 int "Maximum number of scatter gather entries" 39 int "Maximum number of scatter gather entries (16 - 128)"
19 depends on FUSION 40 depends on FUSION
20 default "40" 41 default "128"
42 range 16 128
21 help 43 help
22 This option allows you to specify the maximum number of scatter- 44 This option allows you to specify the maximum number of scatter-
23 gather entries per I/O. The driver defaults to 40, a reasonable number 45 gather entries per I/O. The driver default is 128, which matches
24 for most systems. However, the user may increase this up to 128. 46 SCSI_MAX_PHYS_SEGMENTS. However, it may decreased down to 16.
25 Increasing this parameter will require significantly more memory 47 Decreasing this parameter will reduce memory requirements
26 on a per controller instance. Increasing the parameter is not 48 on a per controller instance.
27 necessary (or recommended) unless the user will be running
28 large I/O's via the raw interface.
29 49
30config FUSION_CTL 50config FUSION_CTL
31 tristate "Fusion MPT misc device (ioctl) driver" 51 tristate "Fusion MPT misc device (ioctl) driver"
32 depends on FUSION 52 depends on FUSION_SPI || FUSION_FC
33 ---help--- 53 ---help---
34 The Fusion MPT misc device driver provides specialized control 54 The Fusion MPT misc device driver provides specialized control
35 of MPT adapters via system ioctl calls. Use of ioctl calls to 55 of MPT adapters via system ioctl calls. Use of ioctl calls to
@@ -48,7 +68,7 @@ config FUSION_CTL
48 68
49config FUSION_LAN 69config FUSION_LAN
50 tristate "Fusion MPT LAN driver" 70 tristate "Fusion MPT LAN driver"
51 depends on FUSION && NET_FC 71 depends on FUSION_FC && NET_FC
52 ---help--- 72 ---help---
53 This module supports LAN IP traffic over Fibre Channel port(s) 73 This module supports LAN IP traffic over Fibre Channel port(s)
54 on Fusion MPT compatible hardware (LSIFC9xx chips). 74 on Fusion MPT compatible hardware (LSIFC9xx chips).
diff --git a/drivers/message/fusion/Makefile b/drivers/message/fusion/Makefile
index f6fdcaaefc89..1d2f9db813c1 100644
--- a/drivers/message/fusion/Makefile
+++ b/drivers/message/fusion/Makefile
@@ -1,52 +1,38 @@
1#
2# Makefile for the LSI Logic Fusion MPT (Message Passing Technology) drivers.
3#
4# Note! If you want to turn on various debug defines for an extended period of
5# time but don't want them lingering around in the Makefile when you pass it on
6# to someone else, use the MPT_CFLAGS env variable (thanks Steve). -nromer
7
8#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-{ LSI_LOGIC
9
10# Architecture-specific...
11# # intel
12#EXTRA_CFLAGS += -g
13# # sparc64
14#EXTRA_CFLAGS += -gstabs+
15
16EXTRA_CFLAGS += ${MPT_CFLAGS}
17
18# Fusion MPT drivers; recognized debug defines... 1# Fusion MPT drivers; recognized debug defines...
19# MPT general: 2# MPT general:
20#EXTRA_CFLAGS += -DMPT_DEBUG_SCSI
21#EXTRA_CFLAGS += -DMPT_DEBUG 3#EXTRA_CFLAGS += -DMPT_DEBUG
22#EXTRA_CFLAGS += -DMPT_DEBUG_MSG_FRAME 4#EXTRA_CFLAGS += -DMPT_DEBUG_MSG_FRAME
23#EXTRA_CFLAGS += -DMPT_DEBUG_SG 5#EXTRA_CFLAGS += -DMPT_DEBUG_SG
6#EXTRA_CFLAGS += -DMPT_DEBUG_EVENTS
7#EXTRA_CFLAGS += -DMPT_DEBUG_INIT
8#EXTRA_CFLAGS += -DMPT_DEBUG_EXIT
9#EXTRA_CFLAGS += -DMPT_DEBUG_FAIL
10
24 11
25# 12#
26# driver/module specifics... 13# driver/module specifics...
27# 14#
28# For mptbase: 15# For mptbase:
29#CFLAGS_mptbase.o += -DMPT_DEBUG_HANDSHAKE 16#CFLAGS_mptbase.o += -DMPT_DEBUG_HANDSHAKE
17#CFLAGS_mptbase.o += -DMPT_DEBUG_CONFIG
18#CFLAGS_mptbase.o += -DMPT_DEBUG_DL
30#CFLAGS_mptbase.o += -DMPT_DEBUG_IRQ 19#CFLAGS_mptbase.o += -DMPT_DEBUG_IRQ
20#CFLAGS_mptbase.o += -DMPT_DEBUG_RESET
31# 21#
32# For mptscsih: 22# For mptscsih:
33#CFLAGS_mptscsih.o += -DMPT_DEBUG_SCANDV 23#CFLAGS_mptscsih.o += -DMPT_DEBUG_DV
34#CFLAGS_mptscsih.o += -DMPT_DEBUG_RESET 24#CFLAGS_mptscsih.o += -DMPT_DEBUG_NEGO
35#CFLAGS_mptscsih.o += -DMPT_DEBUG_NEH 25#CFLAGS_mptscsih.o += -DMPT_DEBUG_TM
26#CFLAGS_mptscsih.o += -DMPT_DEBUG_SCSI
27#CFLAGS_mptscsih.o += -DMPT_DEBUG_REPLY
36# 28#
37# For mptctl: 29# For mptctl:
38#CFLAGS_mptctl.o += -DMPT_DEBUG_IOCTL 30#CFLAGS_mptctl.o += -DMPT_DEBUG_IOCTL
39# 31#
40# For mptlan:
41#CFLAGS_mptlan.o += -DMPT_LAN_IO_DEBUG
42#
43# For isense:
44
45# EXP...
46##mptscsih-objs := scsihost.o scsiherr.o
47 32
48#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC 33#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC
49 34
50obj-$(CONFIG_FUSION) += mptbase.o mptscsih.o 35obj-$(CONFIG_FUSION_SPI) += mptbase.o mptscsih.o mptspi.o
36obj-$(CONFIG_FUSION_FC) += mptbase.o mptscsih.o mptfc.o
51obj-$(CONFIG_FUSION_CTL) += mptctl.o 37obj-$(CONFIG_FUSION_CTL) += mptctl.o
52obj-$(CONFIG_FUSION_LAN) += mptlan.o 38obj-$(CONFIG_FUSION_LAN) += mptlan.o
diff --git a/drivers/message/fusion/lsi/mpi.h b/drivers/message/fusion/lsi/mpi.h
index 9dbb061265fe..9f98334e5076 100644
--- a/drivers/message/fusion/lsi/mpi.h
+++ b/drivers/message/fusion/lsi/mpi.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2005 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi.h 5 * Name: mpi.h
6 * Title: MPI Message independent structures and definitions 6 * Title: MPI Message independent structures and definitions
7 * Creation Date: July 27, 2000 7 * Creation Date: July 27, 2000
8 * 8 *
9 * mpi.h Version: 01.05.xx 9 * mpi.h Version: 01.05.07
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -52,6 +52,25 @@
52 * obsoleted define MPI_IOCSTATUS_TARGET_INVALID_IOCINDEX. 52 * obsoleted define MPI_IOCSTATUS_TARGET_INVALID_IOCINDEX.
53 * 04-01-03 01.02.09 New IOCStatus code: MPI_IOCSTATUS_FC_EXCHANGE_CANCELED 53 * 04-01-03 01.02.09 New IOCStatus code: MPI_IOCSTATUS_FC_EXCHANGE_CANCELED
54 * 06-26-03 01.02.10 Bumped MPI_HEADER_VERSION_UNIT value. 54 * 06-26-03 01.02.10 Bumped MPI_HEADER_VERSION_UNIT value.
55 * 01-16-04 01.02.11 Added define for MPI_IOCLOGINFO_TYPE_SHIFT.
56 * 04-29-04 01.02.12 Added function codes for MPI_FUNCTION_DIAG_BUFFER_POST
57 * and MPI_FUNCTION_DIAG_RELEASE.
58 * Added MPI_IOCSTATUS_DIAGNOSTIC_RELEASED define.
59 * Bumped MPI_HEADER_VERSION_UNIT value.
60 * 05-11-04 01.03.01 Bumped MPI_VERSION_MINOR for MPI v1.3.
61 * Added codes for Inband.
62 * 08-19-04 01.05.01 Added defines for Host Buffer Access Control doorbell.
63 * Added define for offset of High Priority Request Queue.
64 * Added new function codes and new IOCStatus codes.
65 * Added a IOCLogInfo type of SAS.
66 * 12-07-04 01.05.02 Bumped MPI_HEADER_VERSION_UNIT.
67 * 12-09-04 01.05.03 Bumped MPI_HEADER_VERSION_UNIT.
68 * 01-15-05 01.05.04 Bumped MPI_HEADER_VERSION_UNIT.
69 * 02-09-05 01.05.05 Bumped MPI_HEADER_VERSION_UNIT.
70 * 02-22-05 01.05.06 Bumped MPI_HEADER_VERSION_UNIT.
71 * 03-11-05 01.05.07 Removed function codes for SCSI IO 32 and
72 * TargetAssistExtended requests.
73 * Removed EEDP IOCStatus codes.
55 * -------------------------------------------------------------------------- 74 * --------------------------------------------------------------------------
56 */ 75 */
57 76
@@ -82,7 +101,7 @@
82/* Note: The major versions of 0xe0 through 0xff are reserved */ 101/* Note: The major versions of 0xe0 through 0xff are reserved */
83 102
84/* versioning for this MPI header set */ 103/* versioning for this MPI header set */
85#define MPI_HEADER_VERSION_UNIT (0x00) 104#define MPI_HEADER_VERSION_UNIT (0x09)
86#define MPI_HEADER_VERSION_DEV (0x00) 105#define MPI_HEADER_VERSION_DEV (0x00)
87#define MPI_HEADER_VERSION_UNIT_MASK (0xFF00) 106#define MPI_HEADER_VERSION_UNIT_MASK (0xFF00)
88#define MPI_HEADER_VERSION_UNIT_SHIFT (8) 107#define MPI_HEADER_VERSION_UNIT_SHIFT (8)
@@ -122,7 +141,11 @@
122* 141*
123*****************************************************************************/ 142*****************************************************************************/
124 143
125/* S y s t e m D o o r b e l l */ 144/*
145 * Defines for working with the System Doorbell register.
146 * Values for doorbell function codes are included in the section that defines
147 * all the function codes (further on in this file).
148 */
126#define MPI_DOORBELL_OFFSET (0x00000000) 149#define MPI_DOORBELL_OFFSET (0x00000000)
127#define MPI_DOORBELL_ACTIVE (0x08000000) /* DoorbellUsed */ 150#define MPI_DOORBELL_ACTIVE (0x08000000) /* DoorbellUsed */
128#define MPI_DOORBELL_USED (MPI_DOORBELL_ACTIVE) 151#define MPI_DOORBELL_USED (MPI_DOORBELL_ACTIVE)
@@ -134,6 +157,13 @@
134#define MPI_DOORBELL_ADD_DWORDS_MASK (0x00FF0000) 157#define MPI_DOORBELL_ADD_DWORDS_MASK (0x00FF0000)
135#define MPI_DOORBELL_ADD_DWORDS_SHIFT (16) 158#define MPI_DOORBELL_ADD_DWORDS_SHIFT (16)
136#define MPI_DOORBELL_DATA_MASK (0x0000FFFF) 159#define MPI_DOORBELL_DATA_MASK (0x0000FFFF)
160#define MPI_DOORBELL_FUNCTION_SPECIFIC_MASK (0x0000FFFF)
161
162/* values for Host Buffer Access Control doorbell function */
163#define MPI_DB_HPBAC_VALUE_MASK (0x0000F000)
164#define MPI_DB_HPBAC_ENABLE_ACCESS (0x01)
165#define MPI_DB_HPBAC_DISABLE_ACCESS (0x02)
166#define MPI_DB_HPBAC_FREE_BUFFER (0x03)
137 167
138 168
139#define MPI_WRITE_SEQUENCE_OFFSET (0x00000004) 169#define MPI_WRITE_SEQUENCE_OFFSET (0x00000004)
@@ -257,16 +287,18 @@
257 287
258#define MPI_FUNCTION_SMP_PASSTHROUGH (0x1A) 288#define MPI_FUNCTION_SMP_PASSTHROUGH (0x1A)
259#define MPI_FUNCTION_SAS_IO_UNIT_CONTROL (0x1B) 289#define MPI_FUNCTION_SAS_IO_UNIT_CONTROL (0x1B)
290#define MPI_FUNCTION_SATA_PASSTHROUGH (0x1C)
260 291
261#define MPI_DIAG_BUFFER_POST (0x1D) 292#define MPI_FUNCTION_DIAG_BUFFER_POST (0x1D)
262#define MPI_DIAG_RELEASE (0x1E) 293#define MPI_FUNCTION_DIAG_RELEASE (0x1E)
263
264#define MPI_FUNCTION_SCSI_IO_32 (0x1F)
265 294
266#define MPI_FUNCTION_LAN_SEND (0x20) 295#define MPI_FUNCTION_LAN_SEND (0x20)
267#define MPI_FUNCTION_LAN_RECEIVE (0x21) 296#define MPI_FUNCTION_LAN_RECEIVE (0x21)
268#define MPI_FUNCTION_LAN_RESET (0x22) 297#define MPI_FUNCTION_LAN_RESET (0x22)
269 298
299#define MPI_FUNCTION_TARGET_CMD_BUF_BASE_POST (0x24)
300#define MPI_FUNCTION_TARGET_CMD_BUF_LIST_POST (0x25)
301
270#define MPI_FUNCTION_INBAND_BUFFER_POST (0x28) 302#define MPI_FUNCTION_INBAND_BUFFER_POST (0x28)
271#define MPI_FUNCTION_INBAND_SEND (0x29) 303#define MPI_FUNCTION_INBAND_SEND (0x29)
272#define MPI_FUNCTION_INBAND_RSP (0x2A) 304#define MPI_FUNCTION_INBAND_RSP (0x2A)
@@ -276,6 +308,7 @@
276#define MPI_FUNCTION_IO_UNIT_RESET (0x41) 308#define MPI_FUNCTION_IO_UNIT_RESET (0x41)
277#define MPI_FUNCTION_HANDSHAKE (0x42) 309#define MPI_FUNCTION_HANDSHAKE (0x42)
278#define MPI_FUNCTION_REPLY_FRAME_REMOVAL (0x43) 310#define MPI_FUNCTION_REPLY_FRAME_REMOVAL (0x43)
311#define MPI_FUNCTION_HOST_PAGEBUF_ACCESS_CONTROL (0x44)
279 312
280 313
281/* standard version format */ 314/* standard version format */
@@ -328,8 +361,8 @@ typedef struct _SGE_SIMPLE_UNION
328 U32 Address32; 361 U32 Address32;
329 U64 Address64; 362 U64 Address64;
330 }u; 363 }u;
331} SGESimpleUnion_t, MPI_POINTER pSGESimpleUnion_t, 364} SGE_SIMPLE_UNION, MPI_POINTER PTR_SGE_SIMPLE_UNION,
332 SGE_SIMPLE_UNION, MPI_POINTER PTR_SGE_SIMPLE_UNION; 365 SGESimpleUnion_t, MPI_POINTER pSGESimpleUnion_t;
333 366
334/****************************************************************************/ 367/****************************************************************************/
335/* Chain element structures */ 368/* Chain element structures */
@@ -648,27 +681,21 @@ typedef struct _MSG_DEFAULT_REPLY
648#define MPI_IOCSTATUS_SCSI_EXT_TERMINATED (0x004C) 681#define MPI_IOCSTATUS_SCSI_EXT_TERMINATED (0x004C)
649 682
650/****************************************************************************/ 683/****************************************************************************/
651/* For use by SCSI Initiator and SCSI Target end-to-end data protection */ 684/* SCSI Target values */
652/****************************************************************************/
653
654#define MPI_IOCSTATUS_EEDP_CRC_ERROR (0x004D)
655#define MPI_IOCSTATUS_EEDP_LBA_TAG_ERROR (0x004E)
656#define MPI_IOCSTATUS_EEDP_APP_TAG_ERROR (0x004F)
657
658
659/****************************************************************************/
660/* SCSI (SPI & FCP) target values */
661/****************************************************************************/ 685/****************************************************************************/
662 686
663#define MPI_IOCSTATUS_TARGET_PRIORITY_IO (0x0060) 687#define MPI_IOCSTATUS_TARGET_PRIORITY_IO (0x0060)
664#define MPI_IOCSTATUS_TARGET_INVALID_PORT (0x0061) 688#define MPI_IOCSTATUS_TARGET_INVALID_PORT (0x0061)
665#define MPI_IOCSTATUS_TARGET_INVALID_IOCINDEX (0x0062) /* obsolete */ 689#define MPI_IOCSTATUS_TARGET_INVALID_IOCINDEX (0x0062) /* obsolete name */
666#define MPI_IOCSTATUS_TARGET_INVALID_IO_INDEX (0x0062) 690#define MPI_IOCSTATUS_TARGET_INVALID_IO_INDEX (0x0062)
667#define MPI_IOCSTATUS_TARGET_ABORTED (0x0063) 691#define MPI_IOCSTATUS_TARGET_ABORTED (0x0063)
668#define MPI_IOCSTATUS_TARGET_NO_CONN_RETRYABLE (0x0064) 692#define MPI_IOCSTATUS_TARGET_NO_CONN_RETRYABLE (0x0064)
669#define MPI_IOCSTATUS_TARGET_NO_CONNECTION (0x0065) 693#define MPI_IOCSTATUS_TARGET_NO_CONNECTION (0x0065)
670#define MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH (0x006A) 694#define MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH (0x006A)
671#define MPI_IOCSTATUS_TARGET_STS_DATA_NOT_SENT (0x006B) 695#define MPI_IOCSTATUS_TARGET_STS_DATA_NOT_SENT (0x006B)
696#define MPI_IOCSTATUS_TARGET_DATA_OFFSET_ERROR (0x006D)
697#define MPI_IOCSTATUS_TARGET_TOO_MUCH_WRITE_DATA (0x006E)
698#define MPI_IOCSTATUS_TARGET_IU_TOO_SHORT (0x006F)
672 699
673/****************************************************************************/ 700/****************************************************************************/
674/* Additional FCP target values (obsolete) */ 701/* Additional FCP target values (obsolete) */
@@ -707,6 +734,7 @@ typedef struct _MSG_DEFAULT_REPLY
707/****************************************************************************/ 734/****************************************************************************/
708 735
709#define MPI_IOCSTATUS_SAS_SMP_REQUEST_FAILED (0x0090) 736#define MPI_IOCSTATUS_SAS_SMP_REQUEST_FAILED (0x0090)
737#define MPI_IOCSTATUS_SAS_SMP_DATA_OVERRUN (0x0091)
710 738
711/****************************************************************************/ 739/****************************************************************************/
712/* Inband values */ 740/* Inband values */
diff --git a/drivers/message/fusion/lsi/mpi_cnfg.h b/drivers/message/fusion/lsi/mpi_cnfg.h
index a5680d864bf0..15b12b06799d 100644
--- a/drivers/message/fusion/lsi/mpi_cnfg.h
+++ b/drivers/message/fusion/lsi/mpi_cnfg.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2005 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_cnfg.h 5 * Name: mpi_cnfg.h
6 * Title: MPI Config message, structures, and Pages 6 * Title: MPI Config message, structures, and Pages
7 * Creation Date: July 27, 2000 7 * Creation Date: July 27, 2000
8 * 8 *
9 * mpi_cnfg.h Version: 01.05.xx 9 * mpi_cnfg.h Version: 01.05.08
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -145,6 +145,93 @@
145 * In CONFIG_PAGE_FC_DEVICE_0, replaced Reserved1 field 145 * In CONFIG_PAGE_FC_DEVICE_0, replaced Reserved1 field
146 * with ADISCHardALPA. 146 * with ADISCHardALPA.
147 * Added MPI_FC_DEVICE_PAGE0_PROT_FCP_RETRY define. 147 * Added MPI_FC_DEVICE_PAGE0_PROT_FCP_RETRY define.
148 * 01-16-04 01.02.13 Added InitiatorDeviceTimeout and InitiatorIoPendTimeout
149 * fields and related defines to CONFIG_PAGE_FC_PORT_1.
150 * Added define for
151 * MPI_FCPORTPAGE1_FLAGS_SOFT_ALPA_FALLBACK.
152 * Added new fields to the substructures of
153 * CONFIG_PAGE_FC_PORT_10.
154 * 04-29-04 01.02.14 Added define for IDP bit for CONFIG_PAGE_SCSI_PORT_0,
155 * CONFIG_PAGE_SCSI_DEVICE_0, and
156 * CONFIG_PAGE_SCSI_DEVICE_1. Also bumped Page Version for
157 * these pages.
158 * 05-11-04 01.03.01 Added structure for CONFIG_PAGE_INBAND_0.
159 * 08-19-04 01.05.01 Modified MSG_CONFIG request to support extended config
160 * pages.
161 * Added a new structure for extended config page header.
162 * Added new extended config pages types and structures for
163 * SAS IO Unit, SAS Expander, SAS Device, and SAS PHY.
164 * Replaced a reserved byte in CONFIG_PAGE_MANUFACTURING_4
165 * to add a Flags field.
166 * Two new Manufacturing config pages (5 and 6).
167 * Two new bits defined for IO Unit Page 1 Flags field.
168 * Modified CONFIG_PAGE_IO_UNIT_2 to add three new fields
169 * to specify the BIOS boot device.
170 * Four new Flags bits defined for IO Unit Page 2.
171 * Added IO Unit Page 4.
172 * Added EEDP Flags settings to IOC Page 1.
173 * Added new BIOS Page 1 config page.
174 * 10-05-04 01.05.02 Added define for
175 * MPI_IOCPAGE1_INITIATOR_CONTEXT_REPLY_DISABLE.
176 * Added new Flags field to CONFIG_PAGE_MANUFACTURING_5 and
177 * associated defines.
178 * Added more defines for SAS IO Unit Page 0
179 * DiscoveryStatus field.
180 * Added define for MPI_SAS_IOUNIT0_DS_SUBTRACTIVE_LINK
181 * and MPI_SAS_IOUNIT0_DS_TABLE_LINK.
182 * Added defines for Physical Mapping Modes to SAS IO Unit
183 * Page 2.
184 * Added define for
185 * MPI_SAS_DEVICE0_FLAGS_PORT_SELECTOR_ATTACH.
186 * 10-27-04 01.05.03 Added defines for new SAS PHY page addressing mode.
187 * Added defines for MaxTargetSpinUp to BIOS Page 1.
188 * Added 5 new ControlFlags defines for SAS IO Unit
189 * Page 1.
190 * Added MaxNumPhysicalMappedIDs field to SAS IO Unit
191 * Page 2.
192 * Added AccessStatus field to SAS Device Page 0 and added
193 * new Flags bits for supported SATA features.
194 * 12-07-04 01.05.04 Added config page structures for BIOS Page 2, RAID
195 * Volume Page 1, and RAID Physical Disk Page 1.
196 * Replaced IO Unit Page 1 BootTargetID,BootBus, and
197 * BootAdapterNum with reserved field.
198 * Added DataScrubRate and ResyncRate to RAID Volume
199 * Page 0.
200 * Added MPI_SAS_IOUNIT2_FLAGS_RESERVE_ID_0_FOR_BOOT
201 * define.
202 * 12-09-04 01.05.05 Added Target Mode Large CDB Enable to FC Port Page 1
203 * Flags field.
204 * Added Auto Port Config flag define for SAS IOUNIT
205 * Page 1 ControlFlags.
206 * Added Disabled bad Phy define to Expander Page 1
207 * Discovery Info field.
208 * Added SAS/SATA device support to SAS IOUnit Page 1
209 * ControlFlags.
210 * Added Unsupported device to SAS Dev Page 0 Flags field
211 * Added disable use SATA Hash Address for SAS IOUNIT
212 * page 1 in ControlFields.
213 * 01-15-05 01.05.06 Added defaults for data scrub rate and resync rate to
214 * Manufacturing Page 4.
215 * Added new defines for BIOS Page 1 IOCSettings field.
216 * Added ExtDiskIdentifier field to RAID Physical Disk
217 * Page 0.
218 * Added new defines for SAS IO Unit Page 1 ControlFlags
219 * and to SAS Device Page 0 Flags to control SATA devices.
220 * Added defines and structures for the new Log Page 0, a
221 * new type of configuration page.
222 * 02-09-05 01.05.07 Added InactiveStatus field to RAID Volume Page 0.
223 * Added WWID field to RAID Volume Page 1.
224 * Added PhysicalPort field to SAS Expander pages 0 and 1.
225 * 03-11-05 01.05.08 Removed the EEDP flags from IOC Page 1.
226 * Added Enclosure/Slot boot device format to BIOS Page 2.
227 * New status value for RAID Volume Page 0 VolumeStatus
228 * (VolumeState subfield).
229 * New value for RAID Physical Page 0 InactiveStatus.
230 * Added Inactive Volume Member flag RAID Physical Disk
231 * Page 0 PhysDiskStatus field.
232 * New physical mapping mode in SAS IO Unit Page 2.
233 * Added CONFIG_PAGE_SAS_ENCLOSURE_0.
234 * Added Slot and Enclosure fields to SAS Device Page 0.
148 * -------------------------------------------------------------------------- 235 * --------------------------------------------------------------------------
149 */ 236 */
150 237
@@ -164,7 +251,7 @@ typedef struct _CONFIG_PAGE_HEADER
164 U8 PageLength; /* 01h */ 251 U8 PageLength; /* 01h */
165 U8 PageNumber; /* 02h */ 252 U8 PageNumber; /* 02h */
166 U8 PageType; /* 03h */ 253 U8 PageType; /* 03h */
167} fCONFIG_PAGE_HEADER, MPI_POINTER PTR_CONFIG_PAGE_HEADER, 254} CONFIG_PAGE_HEADER, MPI_POINTER PTR_CONFIG_PAGE_HEADER,
168 ConfigPageHeader_t, MPI_POINTER pConfigPageHeader_t; 255 ConfigPageHeader_t, MPI_POINTER pConfigPageHeader_t;
169 256
170typedef union _CONFIG_PAGE_HEADER_UNION 257typedef union _CONFIG_PAGE_HEADER_UNION
@@ -174,7 +261,7 @@ typedef union _CONFIG_PAGE_HEADER_UNION
174 U16 Word16[2]; 261 U16 Word16[2];
175 U32 Word32; 262 U32 Word32;
176} ConfigPageHeaderUnion, MPI_POINTER pConfigPageHeaderUnion, 263} ConfigPageHeaderUnion, MPI_POINTER pConfigPageHeaderUnion,
177 fCONFIG_PAGE_HEADER_UNION, MPI_POINTER PTR_CONFIG_PAGE_HEADER_UNION; 264 CONFIG_PAGE_HEADER_UNION, MPI_POINTER PTR_CONFIG_PAGE_HEADER_UNION;
178 265
179typedef struct _CONFIG_EXTENDED_PAGE_HEADER 266typedef struct _CONFIG_EXTENDED_PAGE_HEADER
180{ 267{
@@ -185,7 +272,7 @@ typedef struct _CONFIG_EXTENDED_PAGE_HEADER
185 U16 ExtPageLength; /* 04h */ 272 U16 ExtPageLength; /* 04h */
186 U8 ExtPageType; /* 06h */ 273 U8 ExtPageType; /* 06h */
187 U8 Reserved2; /* 07h */ 274 U8 Reserved2; /* 07h */
188} fCONFIG_EXTENDED_PAGE_HEADER, MPI_POINTER PTR_CONFIG_EXTENDED_PAGE_HEADER, 275} CONFIG_EXTENDED_PAGE_HEADER, MPI_POINTER PTR_CONFIG_EXTENDED_PAGE_HEADER,
189 ConfigExtendedPageHeader_t, MPI_POINTER pConfigExtendedPageHeader_t; 276 ConfigExtendedPageHeader_t, MPI_POINTER pConfigExtendedPageHeader_t;
190 277
191 278
@@ -224,6 +311,8 @@ typedef struct _CONFIG_EXTENDED_PAGE_HEADER
224#define MPI_CONFIG_EXTPAGETYPE_SAS_EXPANDER (0x11) 311#define MPI_CONFIG_EXTPAGETYPE_SAS_EXPANDER (0x11)
225#define MPI_CONFIG_EXTPAGETYPE_SAS_DEVICE (0x12) 312#define MPI_CONFIG_EXTPAGETYPE_SAS_DEVICE (0x12)
226#define MPI_CONFIG_EXTPAGETYPE_SAS_PHY (0x13) 313#define MPI_CONFIG_EXTPAGETYPE_SAS_PHY (0x13)
314#define MPI_CONFIG_EXTPAGETYPE_LOG (0x14)
315#define MPI_CONFIG_EXTPAGETYPE_ENCLOSURE (0x15)
227 316
228 317
229/**************************************************************************** 318/****************************************************************************
@@ -231,10 +320,19 @@ typedef struct _CONFIG_EXTENDED_PAGE_HEADER
231****************************************************************************/ 320****************************************************************************/
232#define MPI_SCSI_PORT_PGAD_PORT_MASK (0x000000FF) 321#define MPI_SCSI_PORT_PGAD_PORT_MASK (0x000000FF)
233 322
323#define MPI_SCSI_DEVICE_FORM_MASK (0xF0000000)
324#define MPI_SCSI_DEVICE_FORM_BUS_TID (0x00000000)
234#define MPI_SCSI_DEVICE_TARGET_ID_MASK (0x000000FF) 325#define MPI_SCSI_DEVICE_TARGET_ID_MASK (0x000000FF)
235#define MPI_SCSI_DEVICE_TARGET_ID_SHIFT (0) 326#define MPI_SCSI_DEVICE_TARGET_ID_SHIFT (0)
236#define MPI_SCSI_DEVICE_BUS_MASK (0x0000FF00) 327#define MPI_SCSI_DEVICE_BUS_MASK (0x0000FF00)
237#define MPI_SCSI_DEVICE_BUS_SHIFT (8) 328#define MPI_SCSI_DEVICE_BUS_SHIFT (8)
329#define MPI_SCSI_DEVICE_FORM_TARGET_MODE (0x10000000)
330#define MPI_SCSI_DEVICE_TM_RESPOND_ID_MASK (0x000000FF)
331#define MPI_SCSI_DEVICE_TM_RESPOND_ID_SHIFT (0)
332#define MPI_SCSI_DEVICE_TM_BUS_MASK (0x0000FF00)
333#define MPI_SCSI_DEVICE_TM_BUS_SHIFT (8)
334#define MPI_SCSI_DEVICE_TM_INIT_ID_MASK (0x00FF0000)
335#define MPI_SCSI_DEVICE_TM_INIT_ID_SHIFT (16)
238 336
239#define MPI_FC_PORT_PGAD_PORT_MASK (0xF0000000) 337#define MPI_FC_PORT_PGAD_PORT_MASK (0xF0000000)
240#define MPI_FC_PORT_PGAD_PORT_SHIFT (28) 338#define MPI_FC_PORT_PGAD_PORT_SHIFT (28)
@@ -260,6 +358,20 @@ typedef struct _CONFIG_EXTENDED_PAGE_HEADER
260#define MPI_PHYSDISK_PGAD_PHYSDISKNUM_MASK (0x000000FF) 358#define MPI_PHYSDISK_PGAD_PHYSDISKNUM_MASK (0x000000FF)
261#define MPI_PHYSDISK_PGAD_PHYSDISKNUM_SHIFT (0) 359#define MPI_PHYSDISK_PGAD_PHYSDISKNUM_SHIFT (0)
262 360
361#define MPI_SAS_EXPAND_PGAD_FORM_MASK (0xF0000000)
362#define MPI_SAS_EXPAND_PGAD_FORM_SHIFT (28)
363#define MPI_SAS_EXPAND_PGAD_FORM_GET_NEXT_HANDLE (0x00000000)
364#define MPI_SAS_EXPAND_PGAD_FORM_HANDLE_PHY_NUM (0x00000001)
365#define MPI_SAS_EXPAND_PGAD_FORM_HANDLE (0x00000002)
366#define MPI_SAS_EXPAND_PGAD_GNH_MASK_HANDLE (0x0000FFFF)
367#define MPI_SAS_EXPAND_PGAD_GNH_SHIFT_HANDLE (0)
368#define MPI_SAS_EXPAND_PGAD_HPN_MASK_PHY (0x00FF0000)
369#define MPI_SAS_EXPAND_PGAD_HPN_SHIFT_PHY (16)
370#define MPI_SAS_EXPAND_PGAD_HPN_MASK_HANDLE (0x0000FFFF)
371#define MPI_SAS_EXPAND_PGAD_HPN_SHIFT_HANDLE (0)
372#define MPI_SAS_EXPAND_PGAD_H_MASK_HANDLE (0x0000FFFF)
373#define MPI_SAS_EXPAND_PGAD_H_SHIFT_HANDLE (0)
374
263#define MPI_SAS_DEVICE_PGAD_FORM_MASK (0xF0000000) 375#define MPI_SAS_DEVICE_PGAD_FORM_MASK (0xF0000000)
264#define MPI_SAS_DEVICE_PGAD_FORM_SHIFT (28) 376#define MPI_SAS_DEVICE_PGAD_FORM_SHIFT (28)
265#define MPI_SAS_DEVICE_PGAD_FORM_GET_NEXT_HANDLE (0x00000000) 377#define MPI_SAS_DEVICE_PGAD_FORM_GET_NEXT_HANDLE (0x00000000)
@@ -274,10 +386,24 @@ typedef struct _CONFIG_EXTENDED_PAGE_HEADER
274#define MPI_SAS_DEVICE_PGAD_H_HANDLE_MASK (0x0000FFFF) 386#define MPI_SAS_DEVICE_PGAD_H_HANDLE_MASK (0x0000FFFF)
275#define MPI_SAS_DEVICE_PGAD_H_HANDLE_SHIFT (0) 387#define MPI_SAS_DEVICE_PGAD_H_HANDLE_SHIFT (0)
276 388
277#define MPI_SAS_PHY_PGAD_PHY_NUMBER_MASK (0x00FF0000) 389#define MPI_SAS_PHY_PGAD_FORM_MASK (0xF0000000)
278#define MPI_SAS_PHY_PGAD_PHY_NUMBER_SHIFT (16) 390#define MPI_SAS_PHY_PGAD_FORM_SHIFT (28)
279#define MPI_SAS_PHY_PGAD_DEVHANDLE_MASK (0x0000FFFF) 391#define MPI_SAS_PHY_PGAD_FORM_PHY_NUMBER (0x0)
280#define MPI_SAS_PHY_PGAD_DEVHANDLE_SHIFT (0) 392#define MPI_SAS_PHY_PGAD_FORM_PHY_TBL_INDEX (0x1)
393#define MPI_SAS_PHY_PGAD_PHY_NUMBER_MASK (0x000000FF)
394#define MPI_SAS_PHY_PGAD_PHY_NUMBER_SHIFT (0)
395#define MPI_SAS_PHY_PGAD_PHY_TBL_INDEX_MASK (0x0000FFFF)
396#define MPI_SAS_PHY_PGAD_PHY_TBL_INDEX_SHIFT (0)
397
398#define MPI_SAS_ENCLOS_PGAD_FORM_MASK (0xF0000000)
399#define MPI_SAS_ENCLOS_PGAD_FORM_SHIFT (28)
400#define MPI_SAS_ENCLOS_PGAD_FORM_GET_NEXT_HANDLE (0x00000000)
401#define MPI_SAS_ENCLOS_PGAD_FORM_HANDLE (0x00000001)
402#define MPI_SAS_ENCLOS_PGAD_GNH_HANDLE_MASK (0x0000FFFF)
403#define MPI_SAS_ENCLOS_PGAD_GNH_HANDLE_SHIFT (0)
404#define MPI_SAS_ENCLOS_PGAD_H_HANDLE_MASK (0x0000FFFF)
405#define MPI_SAS_ENCLOS_PGAD_H_HANDLE_SHIFT (0)
406
281 407
282 408
283/**************************************************************************** 409/****************************************************************************
@@ -294,7 +420,7 @@ typedef struct _MSG_CONFIG
294 U8 MsgFlags; /* 07h */ 420 U8 MsgFlags; /* 07h */
295 U32 MsgContext; /* 08h */ 421 U32 MsgContext; /* 08h */
296 U8 Reserved2[8]; /* 0Ch */ 422 U8 Reserved2[8]; /* 0Ch */
297 fCONFIG_PAGE_HEADER Header; /* 14h */ 423 CONFIG_PAGE_HEADER Header; /* 14h */
298 U32 PageAddress; /* 18h */ 424 U32 PageAddress; /* 18h */
299 SGE_IO_UNION PageBufferSGE; /* 1Ch */ 425 SGE_IO_UNION PageBufferSGE; /* 1Ch */
300} MSG_CONFIG, MPI_POINTER PTR_MSG_CONFIG, 426} MSG_CONFIG, MPI_POINTER PTR_MSG_CONFIG,
@@ -327,7 +453,7 @@ typedef struct _MSG_CONFIG_REPLY
327 U8 Reserved2[2]; /* 0Ch */ 453 U8 Reserved2[2]; /* 0Ch */
328 U16 IOCStatus; /* 0Eh */ 454 U16 IOCStatus; /* 0Eh */
329 U32 IOCLogInfo; /* 10h */ 455 U32 IOCLogInfo; /* 10h */
330 fCONFIG_PAGE_HEADER Header; /* 14h */ 456 CONFIG_PAGE_HEADER Header; /* 14h */
331} MSG_CONFIG_REPLY, MPI_POINTER PTR_MSG_CONFIG_REPLY, 457} MSG_CONFIG_REPLY, MPI_POINTER PTR_MSG_CONFIG_REPLY,
332 ConfigReply_t, MPI_POINTER pConfigReply_t; 458 ConfigReply_t, MPI_POINTER pConfigReply_t;
333 459
@@ -349,6 +475,8 @@ typedef struct _MSG_CONFIG_REPLY
349#define MPI_MANUFACTPAGE_DEVICEID_FC929 (0x0622) 475#define MPI_MANUFACTPAGE_DEVICEID_FC929 (0x0622)
350#define MPI_MANUFACTPAGE_DEVICEID_FC919X (0x0628) 476#define MPI_MANUFACTPAGE_DEVICEID_FC919X (0x0628)
351#define MPI_MANUFACTPAGE_DEVICEID_FC929X (0x0626) 477#define MPI_MANUFACTPAGE_DEVICEID_FC929X (0x0626)
478#define MPI_MANUFACTPAGE_DEVICEID_FC939X (0x0642)
479#define MPI_MANUFACTPAGE_DEVICEID_FC949X (0x0640)
352/* SCSI */ 480/* SCSI */
353#define MPI_MANUFACTPAGE_DEVID_53C1030 (0x0030) 481#define MPI_MANUFACTPAGE_DEVID_53C1030 (0x0030)
354#define MPI_MANUFACTPAGE_DEVID_53C1030ZC (0x0031) 482#define MPI_MANUFACTPAGE_DEVID_53C1030ZC (0x0031)
@@ -358,18 +486,25 @@ typedef struct _MSG_CONFIG_REPLY
358#define MPI_MANUFACTPAGE_DEVID_53C1035ZC (0x0041) 486#define MPI_MANUFACTPAGE_DEVID_53C1035ZC (0x0041)
359/* SAS */ 487/* SAS */
360#define MPI_MANUFACTPAGE_DEVID_SAS1064 (0x0050) 488#define MPI_MANUFACTPAGE_DEVID_SAS1064 (0x0050)
489#define MPI_MANUFACTPAGE_DEVID_SAS1064A (0x005C)
490#define MPI_MANUFACTPAGE_DEVID_SAS1064E (0x0056)
491#define MPI_MANUFACTPAGE_DEVID_SAS1066 (0x005E)
492#define MPI_MANUFACTPAGE_DEVID_SAS1066E (0x005A)
493#define MPI_MANUFACTPAGE_DEVID_SAS1068 (0x0054)
494#define MPI_MANUFACTPAGE_DEVID_SAS1068E (0x0058)
495#define MPI_MANUFACTPAGE_DEVID_SAS1078 (0x0060)
361 496
362 497
363typedef struct _CONFIG_PAGE_MANUFACTURING_0 498typedef struct _CONFIG_PAGE_MANUFACTURING_0
364{ 499{
365 fCONFIG_PAGE_HEADER Header; /* 00h */ 500 CONFIG_PAGE_HEADER Header; /* 00h */
366 U8 ChipName[16]; /* 04h */ 501 U8 ChipName[16]; /* 04h */
367 U8 ChipRevision[8]; /* 14h */ 502 U8 ChipRevision[8]; /* 14h */
368 U8 BoardName[16]; /* 1Ch */ 503 U8 BoardName[16]; /* 1Ch */
369 U8 BoardAssembly[16]; /* 2Ch */ 504 U8 BoardAssembly[16]; /* 2Ch */
370 U8 BoardTracerNumber[16]; /* 3Ch */ 505 U8 BoardTracerNumber[16]; /* 3Ch */
371 506
372} fCONFIG_PAGE_MANUFACTURING_0, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_0, 507} CONFIG_PAGE_MANUFACTURING_0, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_0,
373 ManufacturingPage0_t, MPI_POINTER pManufacturingPage0_t; 508 ManufacturingPage0_t, MPI_POINTER pManufacturingPage0_t;
374 509
375#define MPI_MANUFACTURING0_PAGEVERSION (0x00) 510#define MPI_MANUFACTURING0_PAGEVERSION (0x00)
@@ -377,9 +512,9 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_0
377 512
378typedef struct _CONFIG_PAGE_MANUFACTURING_1 513typedef struct _CONFIG_PAGE_MANUFACTURING_1
379{ 514{
380 fCONFIG_PAGE_HEADER Header; /* 00h */ 515 CONFIG_PAGE_HEADER Header; /* 00h */
381 U8 VPD[256]; /* 04h */ 516 U8 VPD[256]; /* 04h */
382} fCONFIG_PAGE_MANUFACTURING_1, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_1, 517} CONFIG_PAGE_MANUFACTURING_1, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_1,
383 ManufacturingPage1_t, MPI_POINTER pManufacturingPage1_t; 518 ManufacturingPage1_t, MPI_POINTER pManufacturingPage1_t;
384 519
385#define MPI_MANUFACTURING1_PAGEVERSION (0x00) 520#define MPI_MANUFACTURING1_PAGEVERSION (0x00)
@@ -404,10 +539,10 @@ typedef struct _MPI_CHIP_REVISION_ID
404 539
405typedef struct _CONFIG_PAGE_MANUFACTURING_2 540typedef struct _CONFIG_PAGE_MANUFACTURING_2
406{ 541{
407 fCONFIG_PAGE_HEADER Header; /* 00h */ 542 CONFIG_PAGE_HEADER Header; /* 00h */
408 MPI_CHIP_REVISION_ID ChipId; /* 04h */ 543 MPI_CHIP_REVISION_ID ChipId; /* 04h */
409 U32 HwSettings[MPI_MAN_PAGE_2_HW_SETTINGS_WORDS];/* 08h */ 544 U32 HwSettings[MPI_MAN_PAGE_2_HW_SETTINGS_WORDS];/* 08h */
410} fCONFIG_PAGE_MANUFACTURING_2, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_2, 545} CONFIG_PAGE_MANUFACTURING_2, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_2,
411 ManufacturingPage2_t, MPI_POINTER pManufacturingPage2_t; 546 ManufacturingPage2_t, MPI_POINTER pManufacturingPage2_t;
412 547
413#define MPI_MANUFACTURING2_PAGEVERSION (0x00) 548#define MPI_MANUFACTURING2_PAGEVERSION (0x00)
@@ -423,10 +558,10 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_2
423 558
424typedef struct _CONFIG_PAGE_MANUFACTURING_3 559typedef struct _CONFIG_PAGE_MANUFACTURING_3
425{ 560{
426 fCONFIG_PAGE_HEADER Header; /* 00h */ 561 CONFIG_PAGE_HEADER Header; /* 00h */
427 MPI_CHIP_REVISION_ID ChipId; /* 04h */ 562 MPI_CHIP_REVISION_ID ChipId; /* 04h */
428 U32 Info[MPI_MAN_PAGE_3_INFO_WORDS];/* 08h */ 563 U32 Info[MPI_MAN_PAGE_3_INFO_WORDS];/* 08h */
429} fCONFIG_PAGE_MANUFACTURING_3, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_3, 564} CONFIG_PAGE_MANUFACTURING_3, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_3,
430 ManufacturingPage3_t, MPI_POINTER pManufacturingPage3_t; 565 ManufacturingPage3_t, MPI_POINTER pManufacturingPage3_t;
431 566
432#define MPI_MANUFACTURING3_PAGEVERSION (0x00) 567#define MPI_MANUFACTURING3_PAGEVERSION (0x00)
@@ -434,7 +569,7 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_3
434 569
435typedef struct _CONFIG_PAGE_MANUFACTURING_4 570typedef struct _CONFIG_PAGE_MANUFACTURING_4
436{ 571{
437 fCONFIG_PAGE_HEADER Header; /* 00h */ 572 CONFIG_PAGE_HEADER Header; /* 00h */
438 U32 Reserved1; /* 04h */ 573 U32 Reserved1; /* 04h */
439 U8 InfoOffset0; /* 08h */ 574 U8 InfoOffset0; /* 08h */
440 U8 InfoSize0; /* 09h */ 575 U8 InfoSize0; /* 09h */
@@ -447,10 +582,23 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4
447 U32 ISVolumeSettings; /* 48h */ 582 U32 ISVolumeSettings; /* 48h */
448 U32 IMEVolumeSettings; /* 4Ch */ 583 U32 IMEVolumeSettings; /* 4Ch */
449 U32 IMVolumeSettings; /* 50h */ 584 U32 IMVolumeSettings; /* 50h */
450} fCONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4, 585 U32 Reserved3; /* 54h */
586 U32 Reserved4; /* 58h */
587 U8 ISDataScrubRate; /* 5Ch */
588 U8 ISResyncRate; /* 5Dh */
589 U16 Reserved5; /* 5Eh */
590 U8 IMEDataScrubRate; /* 60h */
591 U8 IMEResyncRate; /* 61h */
592 U16 Reserved6; /* 62h */
593 U8 IMDataScrubRate; /* 64h */
594 U8 IMResyncRate; /* 65h */
595 U16 Reserved7; /* 66h */
596 U32 Reserved8; /* 68h */
597 U32 Reserved9; /* 6Ch */
598} CONFIG_PAGE_MANUFACTURING_4, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_4,
451 ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t; 599 ManufacturingPage4_t, MPI_POINTER pManufacturingPage4_t;
452 600
453#define MPI_MANUFACTURING4_PAGEVERSION (0x01) 601#define MPI_MANUFACTURING4_PAGEVERSION (0x02)
454 602
455/* defines for the Flags field */ 603/* defines for the Flags field */
456#define MPI_MANPAGE4_IR_NO_MIX_SAS_SATA (0x01) 604#define MPI_MANPAGE4_IR_NO_MIX_SAS_SATA (0x01)
@@ -458,19 +606,25 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_4
458 606
459typedef struct _CONFIG_PAGE_MANUFACTURING_5 607typedef struct _CONFIG_PAGE_MANUFACTURING_5
460{ 608{
461 fCONFIG_PAGE_HEADER Header; /* 00h */ 609 CONFIG_PAGE_HEADER Header; /* 00h */
462 U64 BaseWWID; /* 04h */ 610 U64 BaseWWID; /* 04h */
463} fCONFIG_PAGE_MANUFACTURING_5, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_5, 611 U8 Flags; /* 0Ch */
612 U8 Reserved1; /* 0Dh */
613 U16 Reserved2; /* 0Eh */
614} CONFIG_PAGE_MANUFACTURING_5, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_5,
464 ManufacturingPage5_t, MPI_POINTER pManufacturingPage5_t; 615 ManufacturingPage5_t, MPI_POINTER pManufacturingPage5_t;
465 616
466#define MPI_MANUFACTURING5_PAGEVERSION (0x00) 617#define MPI_MANUFACTURING5_PAGEVERSION (0x01)
618
619/* defines for the Flags field */
620#define MPI_MANPAGE5_TWO_WWID_PER_PHY (0x01)
467 621
468 622
469typedef struct _CONFIG_PAGE_MANUFACTURING_6 623typedef struct _CONFIG_PAGE_MANUFACTURING_6
470{ 624{
471 fCONFIG_PAGE_HEADER Header; /* 00h */ 625 CONFIG_PAGE_HEADER Header; /* 00h */
472 U32 ProductSpecificInfo;/* 04h */ 626 U32 ProductSpecificInfo;/* 04h */
473} fCONFIG_PAGE_MANUFACTURING_6, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_6, 627} CONFIG_PAGE_MANUFACTURING_6, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_6,
474 ManufacturingPage6_t, MPI_POINTER pManufacturingPage6_t; 628 ManufacturingPage6_t, MPI_POINTER pManufacturingPage6_t;
475 629
476#define MPI_MANUFACTURING6_PAGEVERSION (0x00) 630#define MPI_MANUFACTURING6_PAGEVERSION (0x00)
@@ -482,9 +636,9 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_6
482 636
483typedef struct _CONFIG_PAGE_IO_UNIT_0 637typedef struct _CONFIG_PAGE_IO_UNIT_0
484{ 638{
485 fCONFIG_PAGE_HEADER Header; /* 00h */ 639 CONFIG_PAGE_HEADER Header; /* 00h */
486 U64 UniqueValue; /* 04h */ 640 U64 UniqueValue; /* 04h */
487} fCONFIG_PAGE_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_0, 641} CONFIG_PAGE_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_0,
488 IOUnitPage0_t, MPI_POINTER pIOUnitPage0_t; 642 IOUnitPage0_t, MPI_POINTER pIOUnitPage0_t;
489 643
490#define MPI_IOUNITPAGE0_PAGEVERSION (0x00) 644#define MPI_IOUNITPAGE0_PAGEVERSION (0x00)
@@ -492,9 +646,9 @@ typedef struct _CONFIG_PAGE_IO_UNIT_0
492 646
493typedef struct _CONFIG_PAGE_IO_UNIT_1 647typedef struct _CONFIG_PAGE_IO_UNIT_1
494{ 648{
495 fCONFIG_PAGE_HEADER Header; /* 00h */ 649 CONFIG_PAGE_HEADER Header; /* 00h */
496 U32 Flags; /* 04h */ 650 U32 Flags; /* 04h */
497} fCONFIG_PAGE_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_1, 651} CONFIG_PAGE_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_1,
498 IOUnitPage1_t, MPI_POINTER pIOUnitPage1_t; 652 IOUnitPage1_t, MPI_POINTER pIOUnitPage1_t;
499 653
500#define MPI_IOUNITPAGE1_PAGEVERSION (0x01) 654#define MPI_IOUNITPAGE1_PAGEVERSION (0x01)
@@ -524,14 +678,15 @@ typedef struct _MPI_ADAPTER_INFO
524 678
525typedef struct _CONFIG_PAGE_IO_UNIT_2 679typedef struct _CONFIG_PAGE_IO_UNIT_2
526{ 680{
527 fCONFIG_PAGE_HEADER Header; /* 00h */ 681 CONFIG_PAGE_HEADER Header; /* 00h */
528 U32 Flags; /* 04h */ 682 U32 Flags; /* 04h */
529 U32 BiosVersion; /* 08h */ 683 U32 BiosVersion; /* 08h */
530 MPI_ADAPTER_INFO AdapterOrder[4]; /* 0Ch */ 684 MPI_ADAPTER_INFO AdapterOrder[4]; /* 0Ch */
531} fCONFIG_PAGE_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_2, 685 U32 Reserved1; /* 1Ch */
686} CONFIG_PAGE_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_2,
532 IOUnitPage2_t, MPI_POINTER pIOUnitPage2_t; 687 IOUnitPage2_t, MPI_POINTER pIOUnitPage2_t;
533 688
534#define MPI_IOUNITPAGE2_PAGEVERSION (0x00) 689#define MPI_IOUNITPAGE2_PAGEVERSION (0x02)
535 690
536#define MPI_IOUNITPAGE2_FLAGS_PAUSE_ON_ERROR (0x00000002) 691#define MPI_IOUNITPAGE2_FLAGS_PAUSE_ON_ERROR (0x00000002)
537#define MPI_IOUNITPAGE2_FLAGS_VERBOSE_ENABLE (0x00000004) 692#define MPI_IOUNITPAGE2_FLAGS_VERBOSE_ENABLE (0x00000004)
@@ -554,12 +709,12 @@ typedef struct _CONFIG_PAGE_IO_UNIT_2
554 709
555typedef struct _CONFIG_PAGE_IO_UNIT_3 710typedef struct _CONFIG_PAGE_IO_UNIT_3
556{ 711{
557 fCONFIG_PAGE_HEADER Header; /* 00h */ 712 CONFIG_PAGE_HEADER Header; /* 00h */
558 U8 GPIOCount; /* 04h */ 713 U8 GPIOCount; /* 04h */
559 U8 Reserved1; /* 05h */ 714 U8 Reserved1; /* 05h */
560 U16 Reserved2; /* 06h */ 715 U16 Reserved2; /* 06h */
561 U16 GPIOVal[MPI_IO_UNIT_PAGE_3_GPIO_VAL_MAX]; /* 08h */ 716 U16 GPIOVal[MPI_IO_UNIT_PAGE_3_GPIO_VAL_MAX]; /* 08h */
562} fCONFIG_PAGE_IO_UNIT_3, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_3, 717} CONFIG_PAGE_IO_UNIT_3, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_3,
563 IOUnitPage3_t, MPI_POINTER pIOUnitPage3_t; 718 IOUnitPage3_t, MPI_POINTER pIOUnitPage3_t;
564 719
565#define MPI_IOUNITPAGE3_PAGEVERSION (0x01) 720#define MPI_IOUNITPAGE3_PAGEVERSION (0x01)
@@ -570,13 +725,24 @@ typedef struct _CONFIG_PAGE_IO_UNIT_3
570#define MPI_IOUNITPAGE3_GPIO_SETTING_ON (0x01) 725#define MPI_IOUNITPAGE3_GPIO_SETTING_ON (0x01)
571 726
572 727
728typedef struct _CONFIG_PAGE_IO_UNIT_4
729{
730 CONFIG_PAGE_HEADER Header; /* 00h */
731 U32 Reserved1; /* 04h */
732 SGE_SIMPLE_UNION FWImageSGE; /* 08h */
733} CONFIG_PAGE_IO_UNIT_4, MPI_POINTER PTR_CONFIG_PAGE_IO_UNIT_4,
734 IOUnitPage4_t, MPI_POINTER pIOUnitPage4_t;
735
736#define MPI_IOUNITPAGE4_PAGEVERSION (0x00)
737
738
573/**************************************************************************** 739/****************************************************************************
574* IOC Config Pages 740* IOC Config Pages
575****************************************************************************/ 741****************************************************************************/
576 742
577typedef struct _CONFIG_PAGE_IOC_0 743typedef struct _CONFIG_PAGE_IOC_0
578{ 744{
579 fCONFIG_PAGE_HEADER Header; /* 00h */ 745 CONFIG_PAGE_HEADER Header; /* 00h */
580 U32 TotalNVStore; /* 04h */ 746 U32 TotalNVStore; /* 04h */
581 U32 FreeNVStore; /* 08h */ 747 U32 FreeNVStore; /* 08h */
582 U16 VendorID; /* 0Ch */ 748 U16 VendorID; /* 0Ch */
@@ -586,7 +752,7 @@ typedef struct _CONFIG_PAGE_IOC_0
586 U32 ClassCode; /* 14h */ 752 U32 ClassCode; /* 14h */
587 U16 SubsystemVendorID; /* 18h */ 753 U16 SubsystemVendorID; /* 18h */
588 U16 SubsystemID; /* 1Ah */ 754 U16 SubsystemID; /* 1Ah */
589} fCONFIG_PAGE_IOC_0, MPI_POINTER PTR_CONFIG_PAGE_IOC_0, 755} CONFIG_PAGE_IOC_0, MPI_POINTER PTR_CONFIG_PAGE_IOC_0,
590 IOCPage0_t, MPI_POINTER pIOCPage0_t; 756 IOCPage0_t, MPI_POINTER pIOCPage0_t;
591 757
592#define MPI_IOCPAGE0_PAGEVERSION (0x01) 758#define MPI_IOCPAGE0_PAGEVERSION (0x01)
@@ -594,23 +760,19 @@ typedef struct _CONFIG_PAGE_IOC_0
594 760
595typedef struct _CONFIG_PAGE_IOC_1 761typedef struct _CONFIG_PAGE_IOC_1
596{ 762{
597 fCONFIG_PAGE_HEADER Header; /* 00h */ 763 CONFIG_PAGE_HEADER Header; /* 00h */
598 U32 Flags; /* 04h */ 764 U32 Flags; /* 04h */
599 U32 CoalescingTimeout; /* 08h */ 765 U32 CoalescingTimeout; /* 08h */
600 U8 CoalescingDepth; /* 0Ch */ 766 U8 CoalescingDepth; /* 0Ch */
601 U8 PCISlotNum; /* 0Dh */ 767 U8 PCISlotNum; /* 0Dh */
602 U8 Reserved[2]; /* 0Eh */ 768 U8 Reserved[2]; /* 0Eh */
603} fCONFIG_PAGE_IOC_1, MPI_POINTER PTR_CONFIG_PAGE_IOC_1, 769} CONFIG_PAGE_IOC_1, MPI_POINTER PTR_CONFIG_PAGE_IOC_1,
604 IOCPage1_t, MPI_POINTER pIOCPage1_t; 770 IOCPage1_t, MPI_POINTER pIOCPage1_t;
605 771
606#define MPI_IOCPAGE1_PAGEVERSION (0x01) 772#define MPI_IOCPAGE1_PAGEVERSION (0x02)
607 773
608/* defines for the Flags field */ 774/* defines for the Flags field */
609#define MPI_IOCPAGE1_EEDP_HOST_SUPPORTS_DIF (0x08000000) 775#define MPI_IOCPAGE1_INITIATOR_CONTEXT_REPLY_DISABLE (0x00000010)
610#define MPI_IOCPAGE1_EEDP_MODE_MASK (0x07000000)
611#define MPI_IOCPAGE1_EEDP_MODE_OFF (0x00000000)
612#define MPI_IOCPAGE1_EEDP_MODE_T10 (0x01000000)
613#define MPI_IOCPAGE1_EEDP_MODE_LSI_1 (0x02000000)
614#define MPI_IOCPAGE1_REPLY_COALESCING (0x00000001) 776#define MPI_IOCPAGE1_REPLY_COALESCING (0x00000001)
615 777
616#define MPI_IOCPAGE1_PCISLOTNUM_UNKNOWN (0xFF) 778#define MPI_IOCPAGE1_PCISLOTNUM_UNKNOWN (0xFF)
@@ -625,7 +787,7 @@ typedef struct _CONFIG_PAGE_IOC_2_RAID_VOL
625 U8 VolumeType; /* 04h */ 787 U8 VolumeType; /* 04h */
626 U8 Flags; /* 05h */ 788 U8 Flags; /* 05h */
627 U16 Reserved3; /* 06h */ 789 U16 Reserved3; /* 06h */
628} fCONFIG_PAGE_IOC_2_RAID_VOL, MPI_POINTER PTR_CONFIG_PAGE_IOC_2_RAID_VOL, 790} CONFIG_PAGE_IOC_2_RAID_VOL, MPI_POINTER PTR_CONFIG_PAGE_IOC_2_RAID_VOL,
629 ConfigPageIoc2RaidVol_t, MPI_POINTER pConfigPageIoc2RaidVol_t; 791 ConfigPageIoc2RaidVol_t, MPI_POINTER pConfigPageIoc2RaidVol_t;
630 792
631/* IOC Page 2 Volume RAID Type values, also used in RAID Volume pages */ 793/* IOC Page 2 Volume RAID Type values, also used in RAID Volume pages */
@@ -648,14 +810,14 @@ typedef struct _CONFIG_PAGE_IOC_2_RAID_VOL
648 810
649typedef struct _CONFIG_PAGE_IOC_2 811typedef struct _CONFIG_PAGE_IOC_2
650{ 812{
651 fCONFIG_PAGE_HEADER Header; /* 00h */ 813 CONFIG_PAGE_HEADER Header; /* 00h */
652 U32 CapabilitiesFlags; /* 04h */ 814 U32 CapabilitiesFlags; /* 04h */
653 U8 NumActiveVolumes; /* 08h */ 815 U8 NumActiveVolumes; /* 08h */
654 U8 MaxVolumes; /* 09h */ 816 U8 MaxVolumes; /* 09h */
655 U8 NumActivePhysDisks; /* 0Ah */ 817 U8 NumActivePhysDisks; /* 0Ah */
656 U8 MaxPhysDisks; /* 0Bh */ 818 U8 MaxPhysDisks; /* 0Bh */
657 fCONFIG_PAGE_IOC_2_RAID_VOL RaidVolume[MPI_IOC_PAGE_2_RAID_VOLUME_MAX];/* 0Ch */ 819 CONFIG_PAGE_IOC_2_RAID_VOL RaidVolume[MPI_IOC_PAGE_2_RAID_VOLUME_MAX];/* 0Ch */
658} fCONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2, 820} CONFIG_PAGE_IOC_2, MPI_POINTER PTR_CONFIG_PAGE_IOC_2,
659 IOCPage2_t, MPI_POINTER pIOCPage2_t; 821 IOCPage2_t, MPI_POINTER pIOCPage2_t;
660 822
661#define MPI_IOCPAGE2_PAGEVERSION (0x02) 823#define MPI_IOCPAGE2_PAGEVERSION (0x02)
@@ -689,12 +851,12 @@ typedef struct _IOC_3_PHYS_DISK
689 851
690typedef struct _CONFIG_PAGE_IOC_3 852typedef struct _CONFIG_PAGE_IOC_3
691{ 853{
692 fCONFIG_PAGE_HEADER Header; /* 00h */ 854 CONFIG_PAGE_HEADER Header; /* 00h */
693 U8 NumPhysDisks; /* 04h */ 855 U8 NumPhysDisks; /* 04h */
694 U8 Reserved1; /* 05h */ 856 U8 Reserved1; /* 05h */
695 U16 Reserved2; /* 06h */ 857 U16 Reserved2; /* 06h */
696 IOC_3_PHYS_DISK PhysDisk[MPI_IOC_PAGE_3_PHYSDISK_MAX]; /* 08h */ 858 IOC_3_PHYS_DISK PhysDisk[MPI_IOC_PAGE_3_PHYSDISK_MAX]; /* 08h */
697} fCONFIG_PAGE_IOC_3, MPI_POINTER PTR_CONFIG_PAGE_IOC_3, 859} CONFIG_PAGE_IOC_3, MPI_POINTER PTR_CONFIG_PAGE_IOC_3,
698 IOCPage3_t, MPI_POINTER pIOCPage3_t; 860 IOCPage3_t, MPI_POINTER pIOCPage3_t;
699 861
700#define MPI_IOCPAGE3_PAGEVERSION (0x00) 862#define MPI_IOCPAGE3_PAGEVERSION (0x00)
@@ -718,12 +880,12 @@ typedef struct _IOC_4_SEP
718 880
719typedef struct _CONFIG_PAGE_IOC_4 881typedef struct _CONFIG_PAGE_IOC_4
720{ 882{
721 fCONFIG_PAGE_HEADER Header; /* 00h */ 883 CONFIG_PAGE_HEADER Header; /* 00h */
722 U8 ActiveSEP; /* 04h */ 884 U8 ActiveSEP; /* 04h */
723 U8 MaxSEP; /* 05h */ 885 U8 MaxSEP; /* 05h */
724 U16 Reserved1; /* 06h */ 886 U16 Reserved1; /* 06h */
725 IOC_4_SEP SEP[MPI_IOC_PAGE_4_SEP_MAX]; /* 08h */ 887 IOC_4_SEP SEP[MPI_IOC_PAGE_4_SEP_MAX]; /* 08h */
726} fCONFIG_PAGE_IOC_4, MPI_POINTER PTR_CONFIG_PAGE_IOC_4, 888} CONFIG_PAGE_IOC_4, MPI_POINTER PTR_CONFIG_PAGE_IOC_4,
727 IOCPage4_t, MPI_POINTER pIOCPage4_t; 889 IOCPage4_t, MPI_POINTER pIOCPage4_t;
728 890
729#define MPI_IOCPAGE4_PAGEVERSION (0x00) 891#define MPI_IOCPAGE4_PAGEVERSION (0x00)
@@ -751,25 +913,25 @@ typedef struct _IOC_5_HOT_SPARE
751 913
752typedef struct _CONFIG_PAGE_IOC_5 914typedef struct _CONFIG_PAGE_IOC_5
753{ 915{
754 fCONFIG_PAGE_HEADER Header; /* 00h */ 916 CONFIG_PAGE_HEADER Header; /* 00h */
755 U32 Reserved1; /* 04h */ 917 U32 Reserved1; /* 04h */
756 U8 NumHotSpares; /* 08h */ 918 U8 NumHotSpares; /* 08h */
757 U8 Reserved2; /* 09h */ 919 U8 Reserved2; /* 09h */
758 U16 Reserved3; /* 0Ah */ 920 U16 Reserved3; /* 0Ah */
759 IOC_5_HOT_SPARE HotSpare[MPI_IOC_PAGE_5_HOT_SPARE_MAX]; /* 0Ch */ 921 IOC_5_HOT_SPARE HotSpare[MPI_IOC_PAGE_5_HOT_SPARE_MAX]; /* 0Ch */
760} fCONFIG_PAGE_IOC_5, MPI_POINTER PTR_CONFIG_PAGE_IOC_5, 922} CONFIG_PAGE_IOC_5, MPI_POINTER PTR_CONFIG_PAGE_IOC_5,
761 IOCPage5_t, MPI_POINTER pIOCPage5_t; 923 IOCPage5_t, MPI_POINTER pIOCPage5_t;
762 924
763#define MPI_IOCPAGE5_PAGEVERSION (0x00) 925#define MPI_IOCPAGE5_PAGEVERSION (0x00)
764 926
765 927
766/**************************************************************************** 928/****************************************************************************
767* BIOS Port Config Pages 929* BIOS Config Pages
768****************************************************************************/ 930****************************************************************************/
769 931
770typedef struct _CONFIG_PAGE_BIOS_1 932typedef struct _CONFIG_PAGE_BIOS_1
771{ 933{
772 fCONFIG_PAGE_HEADER Header; /* 00h */ 934 CONFIG_PAGE_HEADER Header; /* 00h */
773 U32 BiosOptions; /* 04h */ 935 U32 BiosOptions; /* 04h */
774 U32 IOCSettings; /* 08h */ 936 U32 IOCSettings; /* 08h */
775 U32 Reserved1; /* 0Ch */ 937 U32 Reserved1; /* 0Ch */
@@ -780,10 +942,10 @@ typedef struct _CONFIG_PAGE_BIOS_1
780 U16 IOTimeoutSequential; /* 1Ah */ 942 U16 IOTimeoutSequential; /* 1Ah */
781 U16 IOTimeoutOther; /* 1Ch */ 943 U16 IOTimeoutOther; /* 1Ch */
782 U16 IOTimeoutBlockDevicesRM; /* 1Eh */ 944 U16 IOTimeoutBlockDevicesRM; /* 1Eh */
783} fCONFIG_PAGE_BIOS_1, MPI_POINTER PTR_CONFIG_PAGE_BIOS_1, 945} CONFIG_PAGE_BIOS_1, MPI_POINTER PTR_CONFIG_PAGE_BIOS_1,
784 BIOSPage1_t, MPI_POINTER pBIOSPage1_t; 946 BIOSPage1_t, MPI_POINTER pBIOSPage1_t;
785 947
786#define MPI_BIOSPAGE1_PAGEVERSION (0x00) 948#define MPI_BIOSPAGE1_PAGEVERSION (0x01)
787 949
788/* values for the BiosOptions field */ 950/* values for the BiosOptions field */
789#define MPI_BIOSPAGE1_OPTIONS_SPI_ENABLE (0x00000400) 951#define MPI_BIOSPAGE1_OPTIONS_SPI_ENABLE (0x00000400)
@@ -792,6 +954,13 @@ typedef struct _CONFIG_PAGE_BIOS_1
792#define MPI_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001) 954#define MPI_BIOSPAGE1_OPTIONS_DISABLE_BIOS (0x00000001)
793 955
794/* values for the IOCSettings field */ 956/* values for the IOCSettings field */
957#define MPI_BIOSPAGE1_IOCSET_MASK_BOOT_PREFERENCE (0x00030000)
958#define MPI_BIOSPAGE1_IOCSET_ENCLOSURE_SLOT_BOOT (0x00000000)
959#define MPI_BIOSPAGE1_IOCSET_SAS_ADDRESS_BOOT (0x00010000)
960
961#define MPI_BIOSPAGE1_IOCSET_MASK_MAX_TARGET_SPIN_UP (0x0000F000)
962#define MPI_BIOSPAGE1_IOCSET_SHIFT_MAX_TARGET_SPIN_UP (12)
963
795#define MPI_BIOSPAGE1_IOCSET_MASK_SPINUP_DELAY (0x00000F00) 964#define MPI_BIOSPAGE1_IOCSET_MASK_SPINUP_DELAY (0x00000F00)
796#define MPI_BIOSPAGE1_IOCSET_SHIFT_SPINUP_DELAY (8) 965#define MPI_BIOSPAGE1_IOCSET_SHIFT_SPINUP_DELAY (8)
797 966
@@ -814,6 +983,191 @@ typedef struct _CONFIG_PAGE_BIOS_1
814#define MPI_BIOSPAGE1_DEVSET_DISABLE_NON_RM_LUN (0x00000002) 983#define MPI_BIOSPAGE1_DEVSET_DISABLE_NON_RM_LUN (0x00000002)
815#define MPI_BIOSPAGE1_DEVSET_DISABLE_OTHER_LUN (0x00000001) 984#define MPI_BIOSPAGE1_DEVSET_DISABLE_OTHER_LUN (0x00000001)
816 985
986typedef struct _MPI_BOOT_DEVICE_ADAPTER_ORDER
987{
988 U32 Reserved1; /* 00h */
989 U32 Reserved2; /* 04h */
990 U32 Reserved3; /* 08h */
991 U32 Reserved4; /* 0Ch */
992 U32 Reserved5; /* 10h */
993 U32 Reserved6; /* 14h */
994 U32 Reserved7; /* 18h */
995 U32 Reserved8; /* 1Ch */
996 U32 Reserved9; /* 20h */
997 U32 Reserved10; /* 24h */
998 U32 Reserved11; /* 28h */
999 U32 Reserved12; /* 2Ch */
1000 U32 Reserved13; /* 30h */
1001 U32 Reserved14; /* 34h */
1002 U32 Reserved15; /* 38h */
1003 U32 Reserved16; /* 3Ch */
1004 U32 Reserved17; /* 40h */
1005} MPI_BOOT_DEVICE_ADAPTER_ORDER, MPI_POINTER PTR_MPI_BOOT_DEVICE_ADAPTER_ORDER;
1006
1007typedef struct _MPI_BOOT_DEVICE_ADAPTER_NUMBER
1008{
1009 U8 TargetID; /* 00h */
1010 U8 Bus; /* 01h */
1011 U8 AdapterNumber; /* 02h */
1012 U8 Reserved1; /* 03h */
1013 U32 Reserved2; /* 04h */
1014 U32 Reserved3; /* 08h */
1015 U32 Reserved4; /* 0Ch */
1016 U8 LUN[8]; /* 10h */
1017 U32 Reserved5; /* 18h */
1018 U32 Reserved6; /* 1Ch */
1019 U32 Reserved7; /* 20h */
1020 U32 Reserved8; /* 24h */
1021 U32 Reserved9; /* 28h */
1022 U32 Reserved10; /* 2Ch */
1023 U32 Reserved11; /* 30h */
1024 U32 Reserved12; /* 34h */
1025 U32 Reserved13; /* 38h */
1026 U32 Reserved14; /* 3Ch */
1027 U32 Reserved15; /* 40h */
1028} MPI_BOOT_DEVICE_ADAPTER_NUMBER, MPI_POINTER PTR_MPI_BOOT_DEVICE_ADAPTER_NUMBER;
1029
1030typedef struct _MPI_BOOT_DEVICE_PCI_ADDRESS
1031{
1032 U8 TargetID; /* 00h */
1033 U8 Bus; /* 01h */
1034 U16 PCIAddress; /* 02h */
1035 U32 Reserved1; /* 04h */
1036 U32 Reserved2; /* 08h */
1037 U32 Reserved3; /* 0Ch */
1038 U8 LUN[8]; /* 10h */
1039 U32 Reserved4; /* 18h */
1040 U32 Reserved5; /* 1Ch */
1041 U32 Reserved6; /* 20h */
1042 U32 Reserved7; /* 24h */
1043 U32 Reserved8; /* 28h */
1044 U32 Reserved9; /* 2Ch */
1045 U32 Reserved10; /* 30h */
1046 U32 Reserved11; /* 34h */
1047 U32 Reserved12; /* 38h */
1048 U32 Reserved13; /* 3Ch */
1049 U32 Reserved14; /* 40h */
1050} MPI_BOOT_DEVICE_PCI_ADDRESS, MPI_POINTER PTR_MPI_BOOT_DEVICE_PCI_ADDRESS;
1051
1052typedef struct _MPI_BOOT_DEVICE_SLOT_NUMBER
1053{
1054 U8 TargetID; /* 00h */
1055 U8 Bus; /* 01h */
1056 U8 PCISlotNumber; /* 02h */
1057 U8 Reserved1; /* 03h */
1058 U32 Reserved2; /* 04h */
1059 U32 Reserved3; /* 08h */
1060 U32 Reserved4; /* 0Ch */
1061 U8 LUN[8]; /* 10h */
1062 U32 Reserved5; /* 18h */
1063 U32 Reserved6; /* 1Ch */
1064 U32 Reserved7; /* 20h */
1065 U32 Reserved8; /* 24h */
1066 U32 Reserved9; /* 28h */
1067 U32 Reserved10; /* 2Ch */
1068 U32 Reserved11; /* 30h */
1069 U32 Reserved12; /* 34h */
1070 U32 Reserved13; /* 38h */
1071 U32 Reserved14; /* 3Ch */
1072 U32 Reserved15; /* 40h */
1073} MPI_BOOT_DEVICE_PCI_SLOT_NUMBER, MPI_POINTER PTR_MPI_BOOT_DEVICE_PCI_SLOT_NUMBER;
1074
1075typedef struct _MPI_BOOT_DEVICE_FC_WWN
1076{
1077 U64 WWPN; /* 00h */
1078 U32 Reserved1; /* 08h */
1079 U32 Reserved2; /* 0Ch */
1080 U8 LUN[8]; /* 10h */
1081 U32 Reserved3; /* 18h */
1082 U32 Reserved4; /* 1Ch */
1083 U32 Reserved5; /* 20h */
1084 U32 Reserved6; /* 24h */
1085 U32 Reserved7; /* 28h */
1086 U32 Reserved8; /* 2Ch */
1087 U32 Reserved9; /* 30h */
1088 U32 Reserved10; /* 34h */
1089 U32 Reserved11; /* 38h */
1090 U32 Reserved12; /* 3Ch */
1091 U32 Reserved13; /* 40h */
1092} MPI_BOOT_DEVICE_FC_WWN, MPI_POINTER PTR_MPI_BOOT_DEVICE_FC_WWN;
1093
1094typedef struct _MPI_BOOT_DEVICE_SAS_WWN
1095{
1096 U64 SASAddress; /* 00h */
1097 U32 Reserved1; /* 08h */
1098 U32 Reserved2; /* 0Ch */
1099 U8 LUN[8]; /* 10h */
1100 U32 Reserved3; /* 18h */
1101 U32 Reserved4; /* 1Ch */
1102 U32 Reserved5; /* 20h */
1103 U32 Reserved6; /* 24h */
1104 U32 Reserved7; /* 28h */
1105 U32 Reserved8; /* 2Ch */
1106 U32 Reserved9; /* 30h */
1107 U32 Reserved10; /* 34h */
1108 U32 Reserved11; /* 38h */
1109 U32 Reserved12; /* 3Ch */
1110 U32 Reserved13; /* 40h */
1111} MPI_BOOT_DEVICE_SAS_WWN, MPI_POINTER PTR_MPI_BOOT_DEVICE_SAS_WWN;
1112
1113typedef struct _MPI_BOOT_DEVICE_ENCLOSURE_SLOT
1114{
1115 U64 EnclosureLogicalID; /* 00h */
1116 U32 Reserved1; /* 08h */
1117 U32 Reserved2; /* 0Ch */
1118 U8 LUN[8]; /* 10h */
1119 U16 SlotNumber; /* 18h */
1120 U16 Reserved3; /* 1Ah */
1121 U32 Reserved4; /* 1Ch */
1122 U32 Reserved5; /* 20h */
1123 U32 Reserved6; /* 24h */
1124 U32 Reserved7; /* 28h */
1125 U32 Reserved8; /* 2Ch */
1126 U32 Reserved9; /* 30h */
1127 U32 Reserved10; /* 34h */
1128 U32 Reserved11; /* 38h */
1129 U32 Reserved12; /* 3Ch */
1130 U32 Reserved13; /* 40h */
1131} MPI_BOOT_DEVICE_ENCLOSURE_SLOT,
1132 MPI_POINTER PTR_MPI_BOOT_DEVICE_ENCLOSURE_SLOT;
1133
1134typedef union _MPI_BIOSPAGE2_BOOT_DEVICE
1135{
1136 MPI_BOOT_DEVICE_ADAPTER_ORDER AdapterOrder;
1137 MPI_BOOT_DEVICE_ADAPTER_NUMBER AdapterNumber;
1138 MPI_BOOT_DEVICE_PCI_ADDRESS PCIAddress;
1139 MPI_BOOT_DEVICE_PCI_SLOT_NUMBER PCISlotNumber;
1140 MPI_BOOT_DEVICE_FC_WWN FcWwn;
1141 MPI_BOOT_DEVICE_SAS_WWN SasWwn;
1142 MPI_BOOT_DEVICE_ENCLOSURE_SLOT EnclosureSlot;
1143} MPI_BIOSPAGE2_BOOT_DEVICE, MPI_POINTER PTR_MPI_BIOSPAGE2_BOOT_DEVICE;
1144
1145typedef struct _CONFIG_PAGE_BIOS_2
1146{
1147 CONFIG_PAGE_HEADER Header; /* 00h */
1148 U32 Reserved1; /* 04h */
1149 U32 Reserved2; /* 08h */
1150 U32 Reserved3; /* 0Ch */
1151 U32 Reserved4; /* 10h */
1152 U32 Reserved5; /* 14h */
1153 U32 Reserved6; /* 18h */
1154 U8 BootDeviceForm; /* 1Ch */
1155 U8 Reserved7; /* 1Dh */
1156 U16 Reserved8; /* 1Eh */
1157 MPI_BIOSPAGE2_BOOT_DEVICE BootDevice; /* 20h */
1158} CONFIG_PAGE_BIOS_2, MPI_POINTER PTR_CONFIG_PAGE_BIOS_2,
1159 BIOSPage2_t, MPI_POINTER pBIOSPage2_t;
1160
1161#define MPI_BIOSPAGE2_PAGEVERSION (0x01)
1162
1163#define MPI_BIOSPAGE2_FORM_MASK (0x0F)
1164#define MPI_BIOSPAGE2_FORM_ADAPTER_ORDER (0x00)
1165#define MPI_BIOSPAGE2_FORM_ADAPTER_NUMBER (0x01)
1166#define MPI_BIOSPAGE2_FORM_PCI_ADDRESS (0x02)
1167#define MPI_BIOSPAGE2_FORM_PCI_SLOT_NUMBER (0x03)
1168#define MPI_BIOSPAGE2_FORM_FC_WWN (0x04)
1169#define MPI_BIOSPAGE2_FORM_SAS_WWN (0x05)
1170
817 1171
818/**************************************************************************** 1172/****************************************************************************
819* SCSI Port Config Pages 1173* SCSI Port Config Pages
@@ -821,13 +1175,13 @@ typedef struct _CONFIG_PAGE_BIOS_1
821 1175
822typedef struct _CONFIG_PAGE_SCSI_PORT_0 1176typedef struct _CONFIG_PAGE_SCSI_PORT_0
823{ 1177{
824 fCONFIG_PAGE_HEADER Header; /* 00h */ 1178 CONFIG_PAGE_HEADER Header; /* 00h */
825 U32 Capabilities; /* 04h */ 1179 U32 Capabilities; /* 04h */
826 U32 PhysicalInterface; /* 08h */ 1180 U32 PhysicalInterface; /* 08h */
827} fCONFIG_PAGE_SCSI_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_0, 1181} CONFIG_PAGE_SCSI_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_0,
828 SCSIPortPage0_t, MPI_POINTER pSCSIPortPage0_t; 1182 SCSIPortPage0_t, MPI_POINTER pSCSIPortPage0_t;
829 1183
830#define MPI_SCSIPORTPAGE0_PAGEVERSION (0x01) 1184#define MPI_SCSIPORTPAGE0_PAGEVERSION (0x02)
831 1185
832#define MPI_SCSIPORTPAGE0_CAP_IU (0x00000001) 1186#define MPI_SCSIPORTPAGE0_CAP_IU (0x00000001)
833#define MPI_SCSIPORTPAGE0_CAP_DT (0x00000002) 1187#define MPI_SCSIPORTPAGE0_CAP_DT (0x00000002)
@@ -854,6 +1208,7 @@ typedef struct _CONFIG_PAGE_SCSI_PORT_0
854 ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MASK_MAX_SYNC_OFFSET) \ 1208 ( ((Cap) & MPI_SCSIPORTPAGE0_CAP_MASK_MAX_SYNC_OFFSET) \
855 >> MPI_SCSIPORTPAGE0_CAP_SHIFT_MAX_SYNC_OFFSET \ 1209 >> MPI_SCSIPORTPAGE0_CAP_SHIFT_MAX_SYNC_OFFSET \
856 ) 1210 )
1211#define MPI_SCSIPORTPAGE0_CAP_IDP (0x08000000)
857#define MPI_SCSIPORTPAGE0_CAP_WIDE (0x20000000) 1212#define MPI_SCSIPORTPAGE0_CAP_WIDE (0x20000000)
858#define MPI_SCSIPORTPAGE0_CAP_AIP (0x80000000) 1213#define MPI_SCSIPORTPAGE0_CAP_AIP (0x80000000)
859 1214
@@ -869,13 +1224,13 @@ typedef struct _CONFIG_PAGE_SCSI_PORT_0
869 1224
870typedef struct _CONFIG_PAGE_SCSI_PORT_1 1225typedef struct _CONFIG_PAGE_SCSI_PORT_1
871{ 1226{
872 fCONFIG_PAGE_HEADER Header; /* 00h */ 1227 CONFIG_PAGE_HEADER Header; /* 00h */
873 U32 Configuration; /* 04h */ 1228 U32 Configuration; /* 04h */
874 U32 OnBusTimerValue; /* 08h */ 1229 U32 OnBusTimerValue; /* 08h */
875 U8 TargetConfig; /* 0Ch */ 1230 U8 TargetConfig; /* 0Ch */
876 U8 Reserved1; /* 0Dh */ 1231 U8 Reserved1; /* 0Dh */
877 U16 IDConfig; /* 0Eh */ 1232 U16 IDConfig; /* 0Eh */
878} fCONFIG_PAGE_SCSI_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_1, 1233} CONFIG_PAGE_SCSI_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_1,
879 SCSIPortPage1_t, MPI_POINTER pSCSIPortPage1_t; 1234 SCSIPortPage1_t, MPI_POINTER pSCSIPortPage1_t;
880 1235
881#define MPI_SCSIPORTPAGE1_PAGEVERSION (0x03) 1236#define MPI_SCSIPORTPAGE1_PAGEVERSION (0x03)
@@ -900,11 +1255,11 @@ typedef struct _MPI_DEVICE_INFO
900 1255
901typedef struct _CONFIG_PAGE_SCSI_PORT_2 1256typedef struct _CONFIG_PAGE_SCSI_PORT_2
902{ 1257{
903 fCONFIG_PAGE_HEADER Header; /* 00h */ 1258 CONFIG_PAGE_HEADER Header; /* 00h */
904 U32 PortFlags; /* 04h */ 1259 U32 PortFlags; /* 04h */
905 U32 PortSettings; /* 08h */ 1260 U32 PortSettings; /* 08h */
906 MPI_DEVICE_INFO DeviceSettings[16]; /* 0Ch */ 1261 MPI_DEVICE_INFO DeviceSettings[16]; /* 0Ch */
907} fCONFIG_PAGE_SCSI_PORT_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_2, 1262} CONFIG_PAGE_SCSI_PORT_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_PORT_2,
908 SCSIPortPage2_t, MPI_POINTER pSCSIPortPage2_t; 1263 SCSIPortPage2_t, MPI_POINTER pSCSIPortPage2_t;
909 1264
910#define MPI_SCSIPORTPAGE2_PAGEVERSION (0x02) 1265#define MPI_SCSIPORTPAGE2_PAGEVERSION (0x02)
@@ -953,13 +1308,13 @@ typedef struct _CONFIG_PAGE_SCSI_PORT_2
953 1308
954typedef struct _CONFIG_PAGE_SCSI_DEVICE_0 1309typedef struct _CONFIG_PAGE_SCSI_DEVICE_0
955{ 1310{
956 fCONFIG_PAGE_HEADER Header; /* 00h */ 1311 CONFIG_PAGE_HEADER Header; /* 00h */
957 U32 NegotiatedParameters; /* 04h */ 1312 U32 NegotiatedParameters; /* 04h */
958 U32 Information; /* 08h */ 1313 U32 Information; /* 08h */
959} fCONFIG_PAGE_SCSI_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_0, 1314} CONFIG_PAGE_SCSI_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_0,
960 SCSIDevicePage0_t, MPI_POINTER pSCSIDevicePage0_t; 1315 SCSIDevicePage0_t, MPI_POINTER pSCSIDevicePage0_t;
961 1316
962#define MPI_SCSIDEVPAGE0_PAGEVERSION (0x03) 1317#define MPI_SCSIDEVPAGE0_PAGEVERSION (0x04)
963 1318
964#define MPI_SCSIDEVPAGE0_NP_IU (0x00000001) 1319#define MPI_SCSIDEVPAGE0_NP_IU (0x00000001)
965#define MPI_SCSIDEVPAGE0_NP_DT (0x00000002) 1320#define MPI_SCSIDEVPAGE0_NP_DT (0x00000002)
@@ -973,6 +1328,7 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_0
973#define MPI_SCSIDEVPAGE0_NP_SHIFT_SYNC_PERIOD (8) 1328#define MPI_SCSIDEVPAGE0_NP_SHIFT_SYNC_PERIOD (8)
974#define MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK (0x00FF0000) 1329#define MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK (0x00FF0000)
975#define MPI_SCSIDEVPAGE0_NP_SHIFT_SYNC_OFFSET (16) 1330#define MPI_SCSIDEVPAGE0_NP_SHIFT_SYNC_OFFSET (16)
1331#define MPI_SCSIDEVPAGE0_NP_IDP (0x08000000)
976#define MPI_SCSIDEVPAGE0_NP_WIDE (0x20000000) 1332#define MPI_SCSIDEVPAGE0_NP_WIDE (0x20000000)
977#define MPI_SCSIDEVPAGE0_NP_AIP (0x80000000) 1333#define MPI_SCSIDEVPAGE0_NP_AIP (0x80000000)
978 1334
@@ -984,14 +1340,14 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_0
984 1340
985typedef struct _CONFIG_PAGE_SCSI_DEVICE_1 1341typedef struct _CONFIG_PAGE_SCSI_DEVICE_1
986{ 1342{
987 fCONFIG_PAGE_HEADER Header; /* 00h */ 1343 CONFIG_PAGE_HEADER Header; /* 00h */
988 U32 RequestedParameters; /* 04h */ 1344 U32 RequestedParameters; /* 04h */
989 U32 Reserved; /* 08h */ 1345 U32 Reserved; /* 08h */
990 U32 Configuration; /* 0Ch */ 1346 U32 Configuration; /* 0Ch */
991} fCONFIG_PAGE_SCSI_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_1, 1347} CONFIG_PAGE_SCSI_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_1,
992 SCSIDevicePage1_t, MPI_POINTER pSCSIDevicePage1_t; 1348 SCSIDevicePage1_t, MPI_POINTER pSCSIDevicePage1_t;
993 1349
994#define MPI_SCSIDEVPAGE1_PAGEVERSION (0x04) 1350#define MPI_SCSIDEVPAGE1_PAGEVERSION (0x05)
995 1351
996#define MPI_SCSIDEVPAGE1_RP_IU (0x00000001) 1352#define MPI_SCSIDEVPAGE1_RP_IU (0x00000001)
997#define MPI_SCSIDEVPAGE1_RP_DT (0x00000002) 1353#define MPI_SCSIDEVPAGE1_RP_DT (0x00000002)
@@ -1005,6 +1361,7 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_1
1005#define MPI_SCSIDEVPAGE1_RP_SHIFT_MIN_SYNC_PERIOD (8) 1361#define MPI_SCSIDEVPAGE1_RP_SHIFT_MIN_SYNC_PERIOD (8)
1006#define MPI_SCSIDEVPAGE1_RP_MAX_SYNC_OFFSET_MASK (0x00FF0000) 1362#define MPI_SCSIDEVPAGE1_RP_MAX_SYNC_OFFSET_MASK (0x00FF0000)
1007#define MPI_SCSIDEVPAGE1_RP_SHIFT_MAX_SYNC_OFFSET (16) 1363#define MPI_SCSIDEVPAGE1_RP_SHIFT_MAX_SYNC_OFFSET (16)
1364#define MPI_SCSIDEVPAGE1_RP_IDP (0x08000000)
1008#define MPI_SCSIDEVPAGE1_RP_WIDE (0x20000000) 1365#define MPI_SCSIDEVPAGE1_RP_WIDE (0x20000000)
1009#define MPI_SCSIDEVPAGE1_RP_AIP (0x80000000) 1366#define MPI_SCSIDEVPAGE1_RP_AIP (0x80000000)
1010 1367
@@ -1016,11 +1373,11 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_1
1016 1373
1017typedef struct _CONFIG_PAGE_SCSI_DEVICE_2 1374typedef struct _CONFIG_PAGE_SCSI_DEVICE_2
1018{ 1375{
1019 fCONFIG_PAGE_HEADER Header; /* 00h */ 1376 CONFIG_PAGE_HEADER Header; /* 00h */
1020 U32 DomainValidation; /* 04h */ 1377 U32 DomainValidation; /* 04h */
1021 U32 ParityPipeSelect; /* 08h */ 1378 U32 ParityPipeSelect; /* 08h */
1022 U32 DataPipeSelect; /* 0Ch */ 1379 U32 DataPipeSelect; /* 0Ch */
1023} fCONFIG_PAGE_SCSI_DEVICE_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_2, 1380} CONFIG_PAGE_SCSI_DEVICE_2, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_2,
1024 SCSIDevicePage2_t, MPI_POINTER pSCSIDevicePage2_t; 1381 SCSIDevicePage2_t, MPI_POINTER pSCSIDevicePage2_t;
1025 1382
1026#define MPI_SCSIDEVPAGE2_PAGEVERSION (0x01) 1383#define MPI_SCSIDEVPAGE2_PAGEVERSION (0x01)
@@ -1057,12 +1414,12 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_2
1057 1414
1058typedef struct _CONFIG_PAGE_SCSI_DEVICE_3 1415typedef struct _CONFIG_PAGE_SCSI_DEVICE_3
1059{ 1416{
1060 fCONFIG_PAGE_HEADER Header; /* 00h */ 1417 CONFIG_PAGE_HEADER Header; /* 00h */
1061 U16 MsgRejectCount; /* 04h */ 1418 U16 MsgRejectCount; /* 04h */
1062 U16 PhaseErrorCount; /* 06h */ 1419 U16 PhaseErrorCount; /* 06h */
1063 U16 ParityErrorCount; /* 08h */ 1420 U16 ParityErrorCount; /* 08h */
1064 U16 Reserved; /* 0Ah */ 1421 U16 Reserved; /* 0Ah */
1065} fCONFIG_PAGE_SCSI_DEVICE_3, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_3, 1422} CONFIG_PAGE_SCSI_DEVICE_3, MPI_POINTER PTR_CONFIG_PAGE_SCSI_DEVICE_3,
1066 SCSIDevicePage3_t, MPI_POINTER pSCSIDevicePage3_t; 1423 SCSIDevicePage3_t, MPI_POINTER pSCSIDevicePage3_t;
1067 1424
1068#define MPI_SCSIDEVPAGE3_PAGEVERSION (0x00) 1425#define MPI_SCSIDEVPAGE3_PAGEVERSION (0x00)
@@ -1077,7 +1434,7 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_3
1077 1434
1078typedef struct _CONFIG_PAGE_FC_PORT_0 1435typedef struct _CONFIG_PAGE_FC_PORT_0
1079{ 1436{
1080 fCONFIG_PAGE_HEADER Header; /* 00h */ 1437 CONFIG_PAGE_HEADER Header; /* 00h */
1081 U32 Flags; /* 04h */ 1438 U32 Flags; /* 04h */
1082 U8 MPIPortNumber; /* 08h */ 1439 U8 MPIPortNumber; /* 08h */
1083 U8 LinkType; /* 09h */ 1440 U8 LinkType; /* 09h */
@@ -1098,7 +1455,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_0
1098 U8 MaxHardAliasesSupported; /* 49h */ 1455 U8 MaxHardAliasesSupported; /* 49h */
1099 U8 NumCurrentAliases; /* 4Ah */ 1456 U8 NumCurrentAliases; /* 4Ah */
1100 U8 Reserved1; /* 4Bh */ 1457 U8 Reserved1; /* 4Bh */
1101} fCONFIG_PAGE_FC_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_0, 1458} CONFIG_PAGE_FC_PORT_0, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_0,
1102 FCPortPage0_t, MPI_POINTER pFCPortPage0_t; 1459 FCPortPage0_t, MPI_POINTER pFCPortPage0_t;
1103 1460
1104#define MPI_FCPORTPAGE0_PAGEVERSION (0x02) 1461#define MPI_FCPORTPAGE0_PAGEVERSION (0x02)
@@ -1164,10 +1521,9 @@ typedef struct _CONFIG_PAGE_FC_PORT_0
1164#define MPI_FCPORTPAGE0_CURRENT_SPEED_NOT_NEGOTIATED (0x00008000) /* (SNIA)HBA_PORTSPEED_NOT_NEGOTIATED (1<<15) Speed not established */ 1521#define MPI_FCPORTPAGE0_CURRENT_SPEED_NOT_NEGOTIATED (0x00008000) /* (SNIA)HBA_PORTSPEED_NOT_NEGOTIATED (1<<15) Speed not established */
1165 1522
1166 1523
1167
1168typedef struct _CONFIG_PAGE_FC_PORT_1 1524typedef struct _CONFIG_PAGE_FC_PORT_1
1169{ 1525{
1170 fCONFIG_PAGE_HEADER Header; /* 00h */ 1526 CONFIG_PAGE_HEADER Header; /* 00h */
1171 U32 Flags; /* 04h */ 1527 U32 Flags; /* 04h */
1172 U64 NoSEEPROMWWNN; /* 08h */ 1528 U64 NoSEEPROMWWNN; /* 08h */
1173 U64 NoSEEPROMWWPN; /* 10h */ 1529 U64 NoSEEPROMWWPN; /* 10h */
@@ -1179,7 +1535,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_1
1179 U8 RR_TOV; /* 1Dh */ 1535 U8 RR_TOV; /* 1Dh */
1180 U8 InitiatorDeviceTimeout; /* 1Eh */ 1536 U8 InitiatorDeviceTimeout; /* 1Eh */
1181 U8 InitiatorIoPendTimeout; /* 1Fh */ 1537 U8 InitiatorIoPendTimeout; /* 1Fh */
1182} fCONFIG_PAGE_FC_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_1, 1538} CONFIG_PAGE_FC_PORT_1, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_1,
1183 FCPortPage1_t, MPI_POINTER pFCPortPage1_t; 1539 FCPortPage1_t, MPI_POINTER pFCPortPage1_t;
1184 1540
1185#define MPI_FCPORTPAGE1_PAGEVERSION (0x06) 1541#define MPI_FCPORTPAGE1_PAGEVERSION (0x06)
@@ -1191,6 +1547,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_1
1191#define MPI_FCPORTPAGE1_FLAGS_TARGET_MODE_OXID (0x00800000) 1547#define MPI_FCPORTPAGE1_FLAGS_TARGET_MODE_OXID (0x00800000)
1192#define MPI_FCPORTPAGE1_FLAGS_PORT_OFFLINE (0x00400000) 1548#define MPI_FCPORTPAGE1_FLAGS_PORT_OFFLINE (0x00400000)
1193#define MPI_FCPORTPAGE1_FLAGS_SOFT_ALPA_FALLBACK (0x00200000) 1549#define MPI_FCPORTPAGE1_FLAGS_SOFT_ALPA_FALLBACK (0x00200000)
1550#define MPI_FCPORTPAGE1_FLAGS_TARGET_LARGE_CDB_ENABLE (0x00000080)
1194#define MPI_FCPORTPAGE1_FLAGS_MASK_RR_TOV_UNITS (0x00000070) 1551#define MPI_FCPORTPAGE1_FLAGS_MASK_RR_TOV_UNITS (0x00000070)
1195#define MPI_FCPORTPAGE1_FLAGS_SUPPRESS_PROT_REG (0x00000008) 1552#define MPI_FCPORTPAGE1_FLAGS_SUPPRESS_PROT_REG (0x00000008)
1196#define MPI_FCPORTPAGE1_FLAGS_PLOGI_ON_LOGO (0x00000004) 1553#define MPI_FCPORTPAGE1_FLAGS_PLOGI_ON_LOGO (0x00000004)
@@ -1227,14 +1584,15 @@ typedef struct _CONFIG_PAGE_FC_PORT_1
1227#define MPI_FCPORTPAGE1_ALT_CONN_UNKNOWN (0x00) 1584#define MPI_FCPORTPAGE1_ALT_CONN_UNKNOWN (0x00)
1228 1585
1229#define MPI_FCPORTPAGE1_INITIATOR_DEV_TIMEOUT_MASK (0x7F) 1586#define MPI_FCPORTPAGE1_INITIATOR_DEV_TIMEOUT_MASK (0x7F)
1587#define MPI_FCPORTPAGE1_INITIATOR_DEV_UNIT_16 (0x80)
1230 1588
1231 1589
1232typedef struct _CONFIG_PAGE_FC_PORT_2 1590typedef struct _CONFIG_PAGE_FC_PORT_2
1233{ 1591{
1234 fCONFIG_PAGE_HEADER Header; /* 00h */ 1592 CONFIG_PAGE_HEADER Header; /* 00h */
1235 U8 NumberActive; /* 04h */ 1593 U8 NumberActive; /* 04h */
1236 U8 ALPA[127]; /* 05h */ 1594 U8 ALPA[127]; /* 05h */
1237} fCONFIG_PAGE_FC_PORT_2, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_2, 1595} CONFIG_PAGE_FC_PORT_2, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_2,
1238 FCPortPage2_t, MPI_POINTER pFCPortPage2_t; 1596 FCPortPage2_t, MPI_POINTER pFCPortPage2_t;
1239 1597
1240#define MPI_FCPORTPAGE2_PAGEVERSION (0x01) 1598#define MPI_FCPORTPAGE2_PAGEVERSION (0x01)
@@ -1280,9 +1638,9 @@ typedef struct _FC_PORT_PERSISTENT
1280 1638
1281typedef struct _CONFIG_PAGE_FC_PORT_3 1639typedef struct _CONFIG_PAGE_FC_PORT_3
1282{ 1640{
1283 fCONFIG_PAGE_HEADER Header; /* 00h */ 1641 CONFIG_PAGE_HEADER Header; /* 00h */
1284 FC_PORT_PERSISTENT Entry[MPI_FC_PORT_PAGE_3_ENTRY_MAX]; /* 04h */ 1642 FC_PORT_PERSISTENT Entry[MPI_FC_PORT_PAGE_3_ENTRY_MAX]; /* 04h */
1285} fCONFIG_PAGE_FC_PORT_3, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_3, 1643} CONFIG_PAGE_FC_PORT_3, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_3,
1286 FCPortPage3_t, MPI_POINTER pFCPortPage3_t; 1644 FCPortPage3_t, MPI_POINTER pFCPortPage3_t;
1287 1645
1288#define MPI_FCPORTPAGE3_PAGEVERSION (0x01) 1646#define MPI_FCPORTPAGE3_PAGEVERSION (0x01)
@@ -1290,10 +1648,10 @@ typedef struct _CONFIG_PAGE_FC_PORT_3
1290 1648
1291typedef struct _CONFIG_PAGE_FC_PORT_4 1649typedef struct _CONFIG_PAGE_FC_PORT_4
1292{ 1650{
1293 fCONFIG_PAGE_HEADER Header; /* 00h */ 1651 CONFIG_PAGE_HEADER Header; /* 00h */
1294 U32 PortFlags; /* 04h */ 1652 U32 PortFlags; /* 04h */
1295 U32 PortSettings; /* 08h */ 1653 U32 PortSettings; /* 08h */
1296} fCONFIG_PAGE_FC_PORT_4, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_4, 1654} CONFIG_PAGE_FC_PORT_4, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_4,
1297 FCPortPage4_t, MPI_POINTER pFCPortPage4_t; 1655 FCPortPage4_t, MPI_POINTER pFCPortPage4_t;
1298 1656
1299#define MPI_FCPORTPAGE4_PAGEVERSION (0x00) 1657#define MPI_FCPORTPAGE4_PAGEVERSION (0x00)
@@ -1316,15 +1674,15 @@ typedef struct _CONFIG_PAGE_FC_PORT_5_ALIAS_INFO
1316 U16 Reserved; /* 02h */ 1674 U16 Reserved; /* 02h */
1317 U64 AliasWWNN; /* 04h */ 1675 U64 AliasWWNN; /* 04h */
1318 U64 AliasWWPN; /* 0Ch */ 1676 U64 AliasWWPN; /* 0Ch */
1319} fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO, 1677} CONFIG_PAGE_FC_PORT_5_ALIAS_INFO,
1320 MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5_ALIAS_INFO, 1678 MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5_ALIAS_INFO,
1321 FcPortPage5AliasInfo_t, MPI_POINTER pFcPortPage5AliasInfo_t; 1679 FcPortPage5AliasInfo_t, MPI_POINTER pFcPortPage5AliasInfo_t;
1322 1680
1323typedef struct _CONFIG_PAGE_FC_PORT_5 1681typedef struct _CONFIG_PAGE_FC_PORT_5
1324{ 1682{
1325 fCONFIG_PAGE_HEADER Header; /* 00h */ 1683 CONFIG_PAGE_HEADER Header; /* 00h */
1326 fCONFIG_PAGE_FC_PORT_5_ALIAS_INFO AliasInfo; /* 04h */ 1684 CONFIG_PAGE_FC_PORT_5_ALIAS_INFO AliasInfo; /* 04h */
1327} fCONFIG_PAGE_FC_PORT_5, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5, 1685} CONFIG_PAGE_FC_PORT_5, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_5,
1328 FCPortPage5_t, MPI_POINTER pFCPortPage5_t; 1686 FCPortPage5_t, MPI_POINTER pFCPortPage5_t;
1329 1687
1330#define MPI_FCPORTPAGE5_PAGEVERSION (0x02) 1688#define MPI_FCPORTPAGE5_PAGEVERSION (0x02)
@@ -1337,7 +1695,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_5
1337 1695
1338typedef struct _CONFIG_PAGE_FC_PORT_6 1696typedef struct _CONFIG_PAGE_FC_PORT_6
1339{ 1697{
1340 fCONFIG_PAGE_HEADER Header; /* 00h */ 1698 CONFIG_PAGE_HEADER Header; /* 00h */
1341 U32 Reserved; /* 04h */ 1699 U32 Reserved; /* 04h */
1342 U64 TimeSinceReset; /* 08h */ 1700 U64 TimeSinceReset; /* 08h */
1343 U64 TxFrames; /* 10h */ 1701 U64 TxFrames; /* 10h */
@@ -1355,7 +1713,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_6
1355 U64 InvalidTxWordCount; /* 70h */ 1713 U64 InvalidTxWordCount; /* 70h */
1356 U64 InvalidCrcCount; /* 78h */ 1714 U64 InvalidCrcCount; /* 78h */
1357 U64 FcpInitiatorIoCount; /* 80h */ 1715 U64 FcpInitiatorIoCount; /* 80h */
1358} fCONFIG_PAGE_FC_PORT_6, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_6, 1716} CONFIG_PAGE_FC_PORT_6, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_6,
1359 FCPortPage6_t, MPI_POINTER pFCPortPage6_t; 1717 FCPortPage6_t, MPI_POINTER pFCPortPage6_t;
1360 1718
1361#define MPI_FCPORTPAGE6_PAGEVERSION (0x00) 1719#define MPI_FCPORTPAGE6_PAGEVERSION (0x00)
@@ -1363,10 +1721,10 @@ typedef struct _CONFIG_PAGE_FC_PORT_6
1363 1721
1364typedef struct _CONFIG_PAGE_FC_PORT_7 1722typedef struct _CONFIG_PAGE_FC_PORT_7
1365{ 1723{
1366 fCONFIG_PAGE_HEADER Header; /* 00h */ 1724 CONFIG_PAGE_HEADER Header; /* 00h */
1367 U32 Reserved; /* 04h */ 1725 U32 Reserved; /* 04h */
1368 U8 PortSymbolicName[256]; /* 08h */ 1726 U8 PortSymbolicName[256]; /* 08h */
1369} fCONFIG_PAGE_FC_PORT_7, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_7, 1727} CONFIG_PAGE_FC_PORT_7, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_7,
1370 FCPortPage7_t, MPI_POINTER pFCPortPage7_t; 1728 FCPortPage7_t, MPI_POINTER pFCPortPage7_t;
1371 1729
1372#define MPI_FCPORTPAGE7_PAGEVERSION (0x00) 1730#define MPI_FCPORTPAGE7_PAGEVERSION (0x00)
@@ -1374,9 +1732,9 @@ typedef struct _CONFIG_PAGE_FC_PORT_7
1374 1732
1375typedef struct _CONFIG_PAGE_FC_PORT_8 1733typedef struct _CONFIG_PAGE_FC_PORT_8
1376{ 1734{
1377 fCONFIG_PAGE_HEADER Header; /* 00h */ 1735 CONFIG_PAGE_HEADER Header; /* 00h */
1378 U32 BitVector[8]; /* 04h */ 1736 U32 BitVector[8]; /* 04h */
1379} fCONFIG_PAGE_FC_PORT_8, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_8, 1737} CONFIG_PAGE_FC_PORT_8, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_8,
1380 FCPortPage8_t, MPI_POINTER pFCPortPage8_t; 1738 FCPortPage8_t, MPI_POINTER pFCPortPage8_t;
1381 1739
1382#define MPI_FCPORTPAGE8_PAGEVERSION (0x00) 1740#define MPI_FCPORTPAGE8_PAGEVERSION (0x00)
@@ -1384,7 +1742,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_8
1384 1742
1385typedef struct _CONFIG_PAGE_FC_PORT_9 1743typedef struct _CONFIG_PAGE_FC_PORT_9
1386{ 1744{
1387 fCONFIG_PAGE_HEADER Header; /* 00h */ 1745 CONFIG_PAGE_HEADER Header; /* 00h */
1388 U32 Reserved; /* 04h */ 1746 U32 Reserved; /* 04h */
1389 U64 GlobalWWPN; /* 08h */ 1747 U64 GlobalWWPN; /* 08h */
1390 U64 GlobalWWNN; /* 10h */ 1748 U64 GlobalWWNN; /* 10h */
@@ -1396,7 +1754,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_9
1396 U8 IPAddress[16]; /* 28h */ 1754 U8 IPAddress[16]; /* 28h */
1397 U16 Reserved1; /* 38h */ 1755 U16 Reserved1; /* 38h */
1398 U16 TopologyDiscoveryFlags; /* 3Ah */ 1756 U16 TopologyDiscoveryFlags; /* 3Ah */
1399} fCONFIG_PAGE_FC_PORT_9, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_9, 1757} CONFIG_PAGE_FC_PORT_9, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_9,
1400 FCPortPage9_t, MPI_POINTER pFCPortPage9_t; 1758 FCPortPage9_t, MPI_POINTER pFCPortPage9_t;
1401 1759
1402#define MPI_FCPORTPAGE9_PAGEVERSION (0x00) 1760#define MPI_FCPORTPAGE9_PAGEVERSION (0x00)
@@ -1422,10 +1780,10 @@ typedef struct _CONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA
1422 U8 VendorOUI[3]; /* 35h */ 1780 U8 VendorOUI[3]; /* 35h */
1423 U8 VendorPN[16]; /* 38h */ 1781 U8 VendorPN[16]; /* 38h */
1424 U8 VendorRev[4]; /* 48h */ 1782 U8 VendorRev[4]; /* 48h */
1425 U16 Reserved4; /* 4Ch */ 1783 U16 Wavelength; /* 4Ch */
1426 U8 Reserved5; /* 4Eh */ 1784 U8 Reserved4; /* 4Eh */
1427 U8 CC_BASE; /* 4Fh */ 1785 U8 CC_BASE; /* 4Fh */
1428} fCONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA, 1786} CONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA,
1429 MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA, 1787 MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA,
1430 FCPortPage10BaseSfpData_t, MPI_POINTER pFCPortPage10BaseSfpData_t; 1788 FCPortPage10BaseSfpData_t, MPI_POINTER pFCPortPage10BaseSfpData_t;
1431 1789
@@ -1481,9 +1839,11 @@ typedef struct _CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA
1481 U8 BitRateMin; /* 53h */ 1839 U8 BitRateMin; /* 53h */
1482 U8 VendorSN[16]; /* 54h */ 1840 U8 VendorSN[16]; /* 54h */
1483 U8 DateCode[8]; /* 64h */ 1841 U8 DateCode[8]; /* 64h */
1484 U8 Reserved5[3]; /* 6Ch */ 1842 U8 DiagMonitoringType; /* 6Ch */
1843 U8 EnhancedOptions; /* 6Dh */
1844 U8 SFF8472Compliance; /* 6Eh */
1485 U8 CC_EXT; /* 6Fh */ 1845 U8 CC_EXT; /* 6Fh */
1486} fCONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA, 1846} CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA,
1487 MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA, 1847 MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA,
1488 FCPortPage10ExtendedSfpData_t, MPI_POINTER pFCPortPage10ExtendedSfpData_t; 1848 FCPortPage10ExtendedSfpData_t, MPI_POINTER pFCPortPage10ExtendedSfpData_t;
1489 1849
@@ -1496,19 +1856,19 @@ typedef struct _CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA
1496 1856
1497typedef struct _CONFIG_PAGE_FC_PORT_10 1857typedef struct _CONFIG_PAGE_FC_PORT_10
1498{ 1858{
1499 fCONFIG_PAGE_HEADER Header; /* 00h */ 1859 CONFIG_PAGE_HEADER Header; /* 00h */
1500 U8 Flags; /* 04h */ 1860 U8 Flags; /* 04h */
1501 U8 Reserved1; /* 05h */ 1861 U8 Reserved1; /* 05h */
1502 U16 Reserved2; /* 06h */ 1862 U16 Reserved2; /* 06h */
1503 U32 HwConfig1; /* 08h */ 1863 U32 HwConfig1; /* 08h */
1504 U32 HwConfig2; /* 0Ch */ 1864 U32 HwConfig2; /* 0Ch */
1505 fCONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA Base; /* 10h */ 1865 CONFIG_PAGE_FC_PORT_10_BASE_SFP_DATA Base; /* 10h */
1506 fCONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA Extended; /* 50h */ 1866 CONFIG_PAGE_FC_PORT_10_EXTENDED_SFP_DATA Extended; /* 50h */
1507 U8 VendorSpecific[32]; /* 70h */ 1867 U8 VendorSpecific[32]; /* 70h */
1508} fCONFIG_PAGE_FC_PORT_10, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10, 1868} CONFIG_PAGE_FC_PORT_10, MPI_POINTER PTR_CONFIG_PAGE_FC_PORT_10,
1509 FCPortPage10_t, MPI_POINTER pFCPortPage10_t; 1869 FCPortPage10_t, MPI_POINTER pFCPortPage10_t;
1510 1870
1511#define MPI_FCPORTPAGE10_PAGEVERSION (0x00) 1871#define MPI_FCPORTPAGE10_PAGEVERSION (0x01)
1512 1872
1513/* standard MODDEF pin definitions (from GBIC spec.) */ 1873/* standard MODDEF pin definitions (from GBIC spec.) */
1514#define MPI_FCPORTPAGE10_FLAGS_MODDEF_MASK (0x00000007) 1874#define MPI_FCPORTPAGE10_FLAGS_MODDEF_MASK (0x00000007)
@@ -1534,7 +1894,7 @@ typedef struct _CONFIG_PAGE_FC_PORT_10
1534 1894
1535typedef struct _CONFIG_PAGE_FC_DEVICE_0 1895typedef struct _CONFIG_PAGE_FC_DEVICE_0
1536{ 1896{
1537 fCONFIG_PAGE_HEADER Header; /* 00h */ 1897 CONFIG_PAGE_HEADER Header; /* 00h */
1538 U64 WWNN; /* 04h */ 1898 U64 WWNN; /* 04h */
1539 U64 WWPN; /* 0Ch */ 1899 U64 WWPN; /* 0Ch */
1540 U32 PortIdentifier; /* 14h */ 1900 U32 PortIdentifier; /* 14h */
@@ -1548,7 +1908,7 @@ typedef struct _CONFIG_PAGE_FC_DEVICE_0
1548 U8 FcPhHighestVersion; /* 21h */ 1908 U8 FcPhHighestVersion; /* 21h */
1549 U8 CurrentTargetID; /* 22h */ 1909 U8 CurrentTargetID; /* 22h */
1550 U8 CurrentBus; /* 23h */ 1910 U8 CurrentBus; /* 23h */
1551} fCONFIG_PAGE_FC_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_FC_DEVICE_0, 1911} CONFIG_PAGE_FC_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_FC_DEVICE_0,
1552 FCDevicePage0_t, MPI_POINTER pFCDevicePage0_t; 1912 FCDevicePage0_t, MPI_POINTER pFCDevicePage0_t;
1553 1913
1554#define MPI_FC_DEVICE_PAGE0_PAGEVERSION (0x03) 1914#define MPI_FC_DEVICE_PAGE0_PAGEVERSION (0x03)
@@ -1606,6 +1966,7 @@ typedef struct _RAID_VOL0_STATUS
1606#define MPI_RAIDVOL0_STATUS_STATE_OPTIMAL (0x00) 1966#define MPI_RAIDVOL0_STATUS_STATE_OPTIMAL (0x00)
1607#define MPI_RAIDVOL0_STATUS_STATE_DEGRADED (0x01) 1967#define MPI_RAIDVOL0_STATUS_STATE_DEGRADED (0x01)
1608#define MPI_RAIDVOL0_STATUS_STATE_FAILED (0x02) 1968#define MPI_RAIDVOL0_STATUS_STATE_FAILED (0x02)
1969#define MPI_RAIDVOL0_STATUS_STATE_MISSING (0x03)
1609 1970
1610typedef struct _RAID_VOL0_SETTINGS 1971typedef struct _RAID_VOL0_SETTINGS
1611{ 1972{
@@ -1616,11 +1977,11 @@ typedef struct _RAID_VOL0_SETTINGS
1616 RaidVol0Settings, MPI_POINTER pRaidVol0Settings; 1977 RaidVol0Settings, MPI_POINTER pRaidVol0Settings;
1617 1978
1618/* RAID Volume Page 0 VolumeSettings defines */ 1979/* RAID Volume Page 0 VolumeSettings defines */
1619
1620#define MPI_RAIDVOL0_SETTING_WRITE_CACHING_ENABLE (0x0001) 1980#define MPI_RAIDVOL0_SETTING_WRITE_CACHING_ENABLE (0x0001)
1621#define MPI_RAIDVOL0_SETTING_OFFLINE_ON_SMART (0x0002) 1981#define MPI_RAIDVOL0_SETTING_OFFLINE_ON_SMART (0x0002)
1622#define MPI_RAIDVOL0_SETTING_AUTO_CONFIGURE (0x0004) 1982#define MPI_RAIDVOL0_SETTING_AUTO_CONFIGURE (0x0004)
1623#define MPI_RAIDVOL0_SETTING_PRIORITY_RESYNC (0x0008) 1983#define MPI_RAIDVOL0_SETTING_PRIORITY_RESYNC (0x0008)
1984#define MPI_RAIDVOL0_SETTING_FAST_DATA_SCRUBBING_0102 (0x0020) /* obsolete */
1624#define MPI_RAIDVOL0_SETTING_USE_PRODUCT_ID_SUFFIX (0x0010) 1985#define MPI_RAIDVOL0_SETTING_USE_PRODUCT_ID_SUFFIX (0x0010)
1625#define MPI_RAIDVOL0_SETTING_USE_DEFAULTS (0x8000) 1986#define MPI_RAIDVOL0_SETTING_USE_DEFAULTS (0x8000)
1626 1987
@@ -1644,7 +2005,7 @@ typedef struct _RAID_VOL0_SETTINGS
1644 2005
1645typedef struct _CONFIG_PAGE_RAID_VOL_0 2006typedef struct _CONFIG_PAGE_RAID_VOL_0
1646{ 2007{
1647 fCONFIG_PAGE_HEADER Header; /* 00h */ 2008 CONFIG_PAGE_HEADER Header; /* 00h */
1648 U8 VolumeID; /* 04h */ 2009 U8 VolumeID; /* 04h */
1649 U8 VolumeBus; /* 05h */ 2010 U8 VolumeBus; /* 05h */
1650 U8 VolumeIOC; /* 06h */ 2011 U8 VolumeIOC; /* 06h */
@@ -1657,13 +2018,41 @@ typedef struct _CONFIG_PAGE_RAID_VOL_0
1657 U32 Reserved2; /* 1Ch */ 2018 U32 Reserved2; /* 1Ch */
1658 U32 Reserved3; /* 20h */ 2019 U32 Reserved3; /* 20h */
1659 U8 NumPhysDisks; /* 24h */ 2020 U8 NumPhysDisks; /* 24h */
1660 U8 Reserved4; /* 25h */ 2021 U8 DataScrubRate; /* 25h */
1661 U16 Reserved5; /* 26h */ 2022 U8 ResyncRate; /* 26h */
2023 U8 InactiveStatus; /* 27h */
1662 RAID_VOL0_PHYS_DISK PhysDisk[MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX];/* 28h */ 2024 RAID_VOL0_PHYS_DISK PhysDisk[MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX];/* 28h */
1663} fCONFIG_PAGE_RAID_VOL_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_0, 2025} CONFIG_PAGE_RAID_VOL_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_0,
1664 RaidVolumePage0_t, MPI_POINTER pRaidVolumePage0_t; 2026 RaidVolumePage0_t, MPI_POINTER pRaidVolumePage0_t;
1665 2027
1666#define MPI_RAIDVOLPAGE0_PAGEVERSION (0x01) 2028#define MPI_RAIDVOLPAGE0_PAGEVERSION (0x04)
2029
2030/* values for RAID Volume Page 0 InactiveStatus field */
2031#define MPI_RAIDVOLPAGE0_UNKNOWN_INACTIVE (0x00)
2032#define MPI_RAIDVOLPAGE0_STALE_METADATA_INACTIVE (0x01)
2033#define MPI_RAIDVOLPAGE0_FOREIGN_VOLUME_INACTIVE (0x02)
2034#define MPI_RAIDVOLPAGE0_INSUFFICIENT_RESOURCE_INACTIVE (0x03)
2035#define MPI_RAIDVOLPAGE0_CLONE_VOLUME_INACTIVE (0x04)
2036#define MPI_RAIDVOLPAGE0_INSUFFICIENT_METADATA_INACTIVE (0x05)
2037#define MPI_RAIDVOLPAGE0_PREVIOUSLY_DELETED (0x06)
2038
2039
2040typedef struct _CONFIG_PAGE_RAID_VOL_1
2041{
2042 CONFIG_PAGE_HEADER Header; /* 00h */
2043 U8 VolumeID; /* 01h */
2044 U8 VolumeBus; /* 02h */
2045 U8 VolumeIOC; /* 03h */
2046 U8 Reserved0; /* 04h */
2047 U8 GUID[24]; /* 05h */
2048 U8 Name[32]; /* 20h */
2049 U64 WWID; /* 40h */
2050 U32 Reserved1; /* 48h */
2051 U32 Reserved2; /* 4Ch */
2052} CONFIG_PAGE_RAID_VOL_1, MPI_POINTER PTR_CONFIG_PAGE_RAID_VOL_1,
2053 RaidVolumePage1_t, MPI_POINTER pRaidVolumePage1_t;
2054
2055#define MPI_RAIDVOLPAGE1_PAGEVERSION (0x01)
1667 2056
1668 2057
1669/**************************************************************************** 2058/****************************************************************************
@@ -1714,6 +2103,7 @@ typedef struct _RAID_PHYS_DISK0_STATUS
1714 2103
1715#define MPI_PHYSDISK0_STATUS_FLAG_OUT_OF_SYNC (0x01) 2104#define MPI_PHYSDISK0_STATUS_FLAG_OUT_OF_SYNC (0x01)
1716#define MPI_PHYSDISK0_STATUS_FLAG_QUIESCED (0x02) 2105#define MPI_PHYSDISK0_STATUS_FLAG_QUIESCED (0x02)
2106#define MPI_PHYSDISK0_STATUS_FLAG_INACTIVE_VOLUME (0x04)
1717 2107
1718#define MPI_PHYSDISK0_STATUS_ONLINE (0x00) 2108#define MPI_PHYSDISK0_STATUS_ONLINE (0x00)
1719#define MPI_PHYSDISK0_STATUS_MISSING (0x01) 2109#define MPI_PHYSDISK0_STATUS_MISSING (0x01)
@@ -1726,24 +2116,54 @@ typedef struct _RAID_PHYS_DISK0_STATUS
1726 2116
1727typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_0 2117typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_0
1728{ 2118{
1729 fCONFIG_PAGE_HEADER Header; /* 00h */ 2119 CONFIG_PAGE_HEADER Header; /* 00h */
1730 U8 PhysDiskID; /* 04h */ 2120 U8 PhysDiskID; /* 04h */
1731 U8 PhysDiskBus; /* 05h */ 2121 U8 PhysDiskBus; /* 05h */
1732 U8 PhysDiskIOC; /* 06h */ 2122 U8 PhysDiskIOC; /* 06h */
1733 U8 PhysDiskNum; /* 07h */ 2123 U8 PhysDiskNum; /* 07h */
1734 RAID_PHYS_DISK0_SETTINGS PhysDiskSettings; /* 08h */ 2124 RAID_PHYS_DISK0_SETTINGS PhysDiskSettings; /* 08h */
1735 U32 Reserved1; /* 0Ch */ 2125 U32 Reserved1; /* 0Ch */
1736 U32 Reserved2; /* 10h */ 2126 U8 ExtDiskIdentifier[8]; /* 10h */
1737 U32 Reserved3; /* 14h */
1738 U8 DiskIdentifier[16]; /* 18h */ 2127 U8 DiskIdentifier[16]; /* 18h */
1739 RAID_PHYS_DISK0_INQUIRY_DATA InquiryData; /* 28h */ 2128 RAID_PHYS_DISK0_INQUIRY_DATA InquiryData; /* 28h */
1740 RAID_PHYS_DISK0_STATUS PhysDiskStatus; /* 64h */ 2129 RAID_PHYS_DISK0_STATUS PhysDiskStatus; /* 64h */
1741 U32 MaxLBA; /* 68h */ 2130 U32 MaxLBA; /* 68h */
1742 RAID_PHYS_DISK0_ERROR_DATA ErrorData; /* 6Ch */ 2131 RAID_PHYS_DISK0_ERROR_DATA ErrorData; /* 6Ch */
1743} fCONFIG_PAGE_RAID_PHYS_DISK_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_PHYS_DISK_0, 2132} CONFIG_PAGE_RAID_PHYS_DISK_0, MPI_POINTER PTR_CONFIG_PAGE_RAID_PHYS_DISK_0,
1744 RaidPhysDiskPage0_t, MPI_POINTER pRaidPhysDiskPage0_t; 2133 RaidPhysDiskPage0_t, MPI_POINTER pRaidPhysDiskPage0_t;
1745 2134
1746#define MPI_RAIDPHYSDISKPAGE0_PAGEVERSION (0x00) 2135#define MPI_RAIDPHYSDISKPAGE0_PAGEVERSION (0x01)
2136
2137
2138typedef struct _RAID_PHYS_DISK1_PATH
2139{
2140 U8 PhysDiskID; /* 00h */
2141 U8 PhysDiskBus; /* 01h */
2142 U16 Reserved1; /* 02h */
2143 U64 WWID; /* 04h */
2144 U64 OwnerWWID; /* 0Ch */
2145 U8 OwnerIdentifier; /* 14h */
2146 U8 Reserved2; /* 15h */
2147 U16 Flags; /* 16h */
2148} RAID_PHYS_DISK1_PATH, MPI_POINTER PTR_RAID_PHYS_DISK1_PATH,
2149 RaidPhysDisk1Path_t, MPI_POINTER pRaidPhysDisk1Path_t;
2150
2151/* RAID Physical Disk Page 1 Flags field defines */
2152#define MPI_RAID_PHYSDISK1_FLAG_BROKEN (0x0002)
2153#define MPI_RAID_PHYSDISK1_FLAG_INVALID (0x0001)
2154
2155typedef struct _CONFIG_PAGE_RAID_PHYS_DISK_1
2156{
2157 CONFIG_PAGE_HEADER Header; /* 00h */
2158 U8 NumPhysDiskPaths; /* 04h */
2159 U8 PhysDiskNum; /* 05h */
2160 U16 Reserved2; /* 06h */
2161 U32 Reserved1; /* 08h */
2162 RAID_PHYS_DISK1_PATH Path[1]; /* 0Ch */
2163} CONFIG_PAGE_RAID_PHYS_DISK_1, MPI_POINTER PTR_CONFIG_PAGE_RAID_PHYS_DISK_1,
2164 RaidPhysDiskPage1_t, MPI_POINTER pRaidPhysDiskPage1_t;
2165
2166#define MPI_RAIDPHYSDISKPAGE1_PAGEVERSION (0x00)
1747 2167
1748 2168
1749/**************************************************************************** 2169/****************************************************************************
@@ -1756,7 +2176,7 @@ typedef struct _CONFIG_PAGE_LAN_0
1756 U16 TxRxModes; /* 04h */ 2176 U16 TxRxModes; /* 04h */
1757 U16 Reserved; /* 06h */ 2177 U16 Reserved; /* 06h */
1758 U32 PacketPrePad; /* 08h */ 2178 U32 PacketPrePad; /* 08h */
1759} fCONFIG_PAGE_LAN_0, MPI_POINTER PTR_CONFIG_PAGE_LAN_0, 2179} CONFIG_PAGE_LAN_0, MPI_POINTER PTR_CONFIG_PAGE_LAN_0,
1760 LANPage0_t, MPI_POINTER pLANPage0_t; 2180 LANPage0_t, MPI_POINTER pLANPage0_t;
1761 2181
1762#define MPI_LAN_PAGE0_PAGEVERSION (0x01) 2182#define MPI_LAN_PAGE0_PAGEVERSION (0x01)
@@ -1781,7 +2201,7 @@ typedef struct _CONFIG_PAGE_LAN_1
1781 U32 MaxReplySize; /* 24h */ 2201 U32 MaxReplySize; /* 24h */
1782 U32 NegWireSpeedLow; /* 28h */ 2202 U32 NegWireSpeedLow; /* 28h */
1783 U32 NegWireSpeedHigh; /* 2Ch */ 2203 U32 NegWireSpeedHigh; /* 2Ch */
1784} fCONFIG_PAGE_LAN_1, MPI_POINTER PTR_CONFIG_PAGE_LAN_1, 2204} CONFIG_PAGE_LAN_1, MPI_POINTER PTR_CONFIG_PAGE_LAN_1,
1785 LANPage1_t, MPI_POINTER pLANPage1_t; 2205 LANPage1_t, MPI_POINTER pLANPage1_t;
1786 2206
1787#define MPI_LAN_PAGE1_PAGEVERSION (0x03) 2207#define MPI_LAN_PAGE1_PAGEVERSION (0x03)
@@ -1796,11 +2216,11 @@ typedef struct _CONFIG_PAGE_LAN_1
1796 2216
1797typedef struct _CONFIG_PAGE_INBAND_0 2217typedef struct _CONFIG_PAGE_INBAND_0
1798{ 2218{
1799 fCONFIG_PAGE_HEADER Header; /* 00h */ 2219 CONFIG_PAGE_HEADER Header; /* 00h */
1800 MPI_VERSION_FORMAT InbandVersion; /* 04h */ 2220 MPI_VERSION_FORMAT InbandVersion; /* 04h */
1801 U16 MaximumBuffers; /* 08h */ 2221 U16 MaximumBuffers; /* 08h */
1802 U16 Reserved1; /* 0Ah */ 2222 U16 Reserved1; /* 0Ah */
1803} fCONFIG_PAGE_INBAND_0, MPI_POINTER PTR_CONFIG_PAGE_INBAND_0, 2223} CONFIG_PAGE_INBAND_0, MPI_POINTER PTR_CONFIG_PAGE_INBAND_0,
1804 InbandPage0_t, MPI_POINTER pInbandPage0_t; 2224 InbandPage0_t, MPI_POINTER pInbandPage0_t;
1805 2225
1806#define MPI_INBAND_PAGEVERSION (0x00) 2226#define MPI_INBAND_PAGEVERSION (0x00)
@@ -1820,7 +2240,7 @@ typedef struct _MPI_SAS_IO_UNIT0_PHY_DATA
1820 U32 ControllerPhyDeviceInfo;/* 04h */ 2240 U32 ControllerPhyDeviceInfo;/* 04h */
1821 U16 AttachedDeviceHandle; /* 08h */ 2241 U16 AttachedDeviceHandle; /* 08h */
1822 U16 ControllerDevHandle; /* 0Ah */ 2242 U16 ControllerDevHandle; /* 0Ah */
1823 U32 Reserved2; /* 0Ch */ 2243 U32 DiscoveryStatus; /* 0Ch */
1824} MPI_SAS_IO_UNIT0_PHY_DATA, MPI_POINTER PTR_MPI_SAS_IO_UNIT0_PHY_DATA, 2244} MPI_SAS_IO_UNIT0_PHY_DATA, MPI_POINTER PTR_MPI_SAS_IO_UNIT0_PHY_DATA,
1825 SasIOUnit0PhyData, MPI_POINTER pSasIOUnit0PhyData; 2245 SasIOUnit0PhyData, MPI_POINTER pSasIOUnit0PhyData;
1826 2246
@@ -1834,22 +2254,21 @@ typedef struct _MPI_SAS_IO_UNIT0_PHY_DATA
1834 2254
1835typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0 2255typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0
1836{ 2256{
1837 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2257 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
1838 U32 Reserved1; /* 08h */ 2258 U32 Reserved1; /* 08h */
1839 U8 NumPhys; /* 0Ch */ 2259 U8 NumPhys; /* 0Ch */
1840 U8 Reserved2; /* 0Dh */ 2260 U8 Reserved2; /* 0Dh */
1841 U16 Reserved3; /* 0Eh */ 2261 U16 Reserved3; /* 0Eh */
1842 MPI_SAS_IO_UNIT0_PHY_DATA PhyData[MPI_SAS_IOUNIT0_PHY_MAX]; /* 10h */ 2262 MPI_SAS_IO_UNIT0_PHY_DATA PhyData[MPI_SAS_IOUNIT0_PHY_MAX]; /* 10h */
1843} fCONFIG_PAGE_SAS_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_0, 2263} CONFIG_PAGE_SAS_IO_UNIT_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_0,
1844 SasIOUnitPage0_t, MPI_POINTER pSasIOUnitPage0_t; 2264 SasIOUnitPage0_t, MPI_POINTER pSasIOUnitPage0_t;
1845 2265
1846#define MPI_SASIOUNITPAGE0_PAGEVERSION (0x00) 2266#define MPI_SASIOUNITPAGE0_PAGEVERSION (0x02)
1847 2267
1848/* values for SAS IO Unit Page 0 PortFlags */ 2268/* values for SAS IO Unit Page 0 PortFlags */
1849#define MPI_SAS_IOUNIT0_PORT_FLAGS_DISCOVERY_IN_PROGRESS (0x08) 2269#define MPI_SAS_IOUNIT0_PORT_FLAGS_DISCOVERY_IN_PROGRESS (0x08)
1850#define MPI_SAS_IOUNIT0_PORT_FLAGS_0_TARGET_IOC_NUM (0x00) 2270#define MPI_SAS_IOUNIT0_PORT_FLAGS_0_TARGET_IOC_NUM (0x00)
1851#define MPI_SAS_IOUNIT0_PORT_FLAGS_1_TARGET_IOC_NUM (0x04) 2271#define MPI_SAS_IOUNIT0_PORT_FLAGS_1_TARGET_IOC_NUM (0x04)
1852#define MPI_SAS_IOUNIT0_PORT_FLAGS_WAIT_FOR_PORTENABLE (0x02)
1853#define MPI_SAS_IOUNIT0_PORT_FLAGS_AUTO_PORT_CONFIG (0x01) 2272#define MPI_SAS_IOUNIT0_PORT_FLAGS_AUTO_PORT_CONFIG (0x01)
1854 2273
1855/* values for SAS IO Unit Page 0 PhyFlags */ 2274/* values for SAS IO Unit Page 0 PhyFlags */
@@ -1867,6 +2286,20 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_0
1867 2286
1868/* see mpi_sas.h for values for SAS IO Unit Page 0 ControllerPhyDeviceInfo values */ 2287/* see mpi_sas.h for values for SAS IO Unit Page 0 ControllerPhyDeviceInfo values */
1869 2288
2289/* values for SAS IO Unit Page 0 DiscoveryStatus */
2290#define MPI_SAS_IOUNIT0_DS_LOOP_DETECTED (0x00000001)
2291#define MPI_SAS_IOUNIT0_DS_UNADDRESSABLE_DEVICE (0x00000002)
2292#define MPI_SAS_IOUNIT0_DS_MULTIPLE_PORTS (0x00000004)
2293#define MPI_SAS_IOUNIT0_DS_EXPANDER_ERR (0x00000008)
2294#define MPI_SAS_IOUNIT0_DS_SMP_TIMEOUT (0x00000010)
2295#define MPI_SAS_IOUNIT0_DS_OUT_ROUTE_ENTRIES (0x00000020)
2296#define MPI_SAS_IOUNIT0_DS_INDEX_NOT_EXIST (0x00000040)
2297#define MPI_SAS_IOUNIT0_DS_SMP_FUNCTION_FAILED (0x00000080)
2298#define MPI_SAS_IOUNIT0_DS_SMP_CRC_ERROR (0x00000100)
2299#define MPI_SAS_IOUNIT0_DS_SUBTRACTIVE_LINK (0x00000200)
2300#define MPI_SAS_IOUNIT0_DS_TABLE_LINK (0x00000400)
2301#define MPI_SAS_IOUNIT0_DS_UNSUPPORTED_DEVICE (0x00000800)
2302
1870 2303
1871typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA 2304typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA
1872{ 2305{
@@ -1889,52 +2322,75 @@ typedef struct _MPI_SAS_IO_UNIT1_PHY_DATA
1889 2322
1890typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1 2323typedef struct _CONFIG_PAGE_SAS_IO_UNIT_1
1891{ 2324{
1892 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2325 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
1893 U32 Reserved1; /* 08h */ 2326 U16 ControlFlags; /* 08h */
1894 U8 NumPhys; /* 0Ch */ 2327 U16 MaxNumSATATargets; /* 0Ah */
1895 U8 Reserved2; /* 0Dh */ 2328 U32 Reserved1; /* 0Ch */
1896 U16 Reserved3; /* 0Eh */ 2329 U8 NumPhys; /* 10h */
1897 MPI_SAS_IO_UNIT1_PHY_DATA PhyData[MPI_SAS_IOUNIT1_PHY_MAX]; /* 10h */ 2330 U8 SATAMaxQDepth; /* 11h */
1898} fCONFIG_PAGE_SAS_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_1, 2331 U16 Reserved2; /* 12h */
2332 MPI_SAS_IO_UNIT1_PHY_DATA PhyData[MPI_SAS_IOUNIT1_PHY_MAX]; /* 14h */
2333} CONFIG_PAGE_SAS_IO_UNIT_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_1,
1899 SasIOUnitPage1_t, MPI_POINTER pSasIOUnitPage1_t; 2334 SasIOUnitPage1_t, MPI_POINTER pSasIOUnitPage1_t;
1900 2335
1901#define MPI_SASIOUNITPAGE1_PAGEVERSION (0x00) 2336#define MPI_SASIOUNITPAGE1_PAGEVERSION (0x04)
1902 2337
1903/* values for SAS IO Unit Page 0 PortFlags */ 2338/* values for SAS IO Unit Page 1 ControlFlags */
1904#define MPI_SAS_IOUNIT1_PORT_FLAGS_0_TARGET_IOC_NUM (0x00) 2339#define MPI_SAS_IOUNIT1_CONTROL_SATA_3_0_MAX (0x4000)
1905#define MPI_SAS_IOUNIT1_PORT_FLAGS_1_TARGET_IOC_NUM (0x04) 2340#define MPI_SAS_IOUNIT1_CONTROL_SATA_1_5_MAX (0x2000)
1906#define MPI_SAS_IOUNIT1_PORT_FLAGS_WAIT_FOR_PORTENABLE (0x02) 2341#define MPI_SAS_IOUNIT1_CONTROL_SATA_SW_PRESERVE (0x1000)
1907#define MPI_SAS_IOUNIT1_PORT_FLAGS_AUTO_PORT_CONFIG (0x01) 2342#define MPI_SAS_IOUNIT1_CONTROL_DISABLE_SAS_HASH (0x0800)
2343
2344#define MPI_SAS_IOUNIT1_CONTROL_MASK_DEV_SUPPORT (0x0600)
2345#define MPI_SAS_IOUNIT1_CONTROL_SHIFT_DEV_SUPPORT (9)
2346#define MPI_SAS_IOUNIT1_CONTROL_DEV_SUPPORT_BOTH (0x00)
2347#define MPI_SAS_IOUNIT1_CONTROL_DEV_SAS_SUPPORT (0x01)
2348#define MPI_SAS_IOUNIT1_CONTROL_DEV_SATA_SUPPORT (0x10)
2349
2350#define MPI_SAS_IOUNIT1_CONTROL_AUTO_PORT_SAME_SAS_ADDR (0x0100)
2351#define MPI_SAS_IOUNIT1_CONTROL_SATA_48BIT_LBA_REQUIRED (0x0080)
2352#define MPI_SAS_IOUNIT1_CONTROL_SATA_SMART_REQUIRED (0x0040)
2353#define MPI_SAS_IOUNIT1_CONTROL_SATA_NCQ_REQUIRED (0x0020)
2354#define MPI_SAS_IOUNIT1_CONTROL_SATA_FUA_REQUIRED (0x0010)
2355#define MPI_SAS_IOUNIT1_CONTROL_PHY_ENABLE_ORDER_HIGH (0x0008)
2356#define MPI_SAS_IOUNIT1_CONTROL_SUBTRACTIVE_ILLEGAL (0x0004)
2357#define MPI_SAS_IOUNIT1_CONTROL_FIRST_LVL_DISC_ONLY (0x0002)
2358#define MPI_SAS_IOUNIT1_CONTROL_CLEAR_AFFILIATION (0x0001)
2359
2360/* values for SAS IO Unit Page 1 PortFlags */
2361#define MPI_SAS_IOUNIT1_PORT_FLAGS_0_TARGET_IOC_NUM (0x00)
2362#define MPI_SAS_IOUNIT1_PORT_FLAGS_1_TARGET_IOC_NUM (0x04)
2363#define MPI_SAS_IOUNIT1_PORT_FLAGS_AUTO_PORT_CONFIG (0x01)
1908 2364
1909/* values for SAS IO Unit Page 0 PhyFlags */ 2365/* values for SAS IO Unit Page 0 PhyFlags */
1910#define MPI_SAS_IOUNIT1_PHY_FLAGS_PHY_DISABLE (0x04) 2366#define MPI_SAS_IOUNIT1_PHY_FLAGS_PHY_DISABLE (0x04)
1911#define MPI_SAS_IOUNIT1_PHY_FLAGS_TX_INVERT (0x02) 2367#define MPI_SAS_IOUNIT1_PHY_FLAGS_TX_INVERT (0x02)
1912#define MPI_SAS_IOUNIT1_PHY_FLAGS_RX_INVERT (0x01) 2368#define MPI_SAS_IOUNIT1_PHY_FLAGS_RX_INVERT (0x01)
1913 2369
1914/* values for SAS IO Unit Page 0 MaxMinLinkRate */ 2370/* values for SAS IO Unit Page 0 MaxMinLinkRate */
1915#define MPI_SAS_IOUNIT1_MAX_RATE_MASK (0xF0) 2371#define MPI_SAS_IOUNIT1_MAX_RATE_MASK (0xF0)
1916#define MPI_SAS_IOUNIT1_MAX_RATE_1_5 (0x80) 2372#define MPI_SAS_IOUNIT1_MAX_RATE_1_5 (0x80)
1917#define MPI_SAS_IOUNIT1_MAX_RATE_3_0 (0x90) 2373#define MPI_SAS_IOUNIT1_MAX_RATE_3_0 (0x90)
1918#define MPI_SAS_IOUNIT1_MIN_RATE_MASK (0x0F) 2374#define MPI_SAS_IOUNIT1_MIN_RATE_MASK (0x0F)
1919#define MPI_SAS_IOUNIT1_MIN_RATE_1_5 (0x08) 2375#define MPI_SAS_IOUNIT1_MIN_RATE_1_5 (0x08)
1920#define MPI_SAS_IOUNIT1_MIN_RATE_3_0 (0x09) 2376#define MPI_SAS_IOUNIT1_MIN_RATE_3_0 (0x09)
1921 2377
1922/* see mpi_sas.h for values for SAS IO Unit Page 1 ControllerPhyDeviceInfo values */ 2378/* see mpi_sas.h for values for SAS IO Unit Page 1 ControllerPhyDeviceInfo values */
1923 2379
1924 2380
1925typedef struct _CONFIG_PAGE_SAS_IO_UNIT_2 2381typedef struct _CONFIG_PAGE_SAS_IO_UNIT_2
1926{ 2382{
1927 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2383 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
1928 U32 Reserved1; /* 08h */ 2384 U32 Reserved1; /* 08h */
1929 U16 MaxPersistentIDs; /* 0Ch */ 2385 U16 MaxPersistentIDs; /* 0Ch */
1930 U16 NumPersistentIDsUsed; /* 0Eh */ 2386 U16 NumPersistentIDsUsed; /* 0Eh */
1931 U8 Status; /* 10h */ 2387 U8 Status; /* 10h */
1932 U8 Flags; /* 11h */ 2388 U8 Flags; /* 11h */
1933 U16 Reserved2; /* 12h */ 2389 U16 MaxNumPhysicalMappedIDs;/* 12h */ /* 12h */
1934} fCONFIG_PAGE_SAS_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_2, 2390} CONFIG_PAGE_SAS_IO_UNIT_2, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_2,
1935 SasIOUnitPage2_t, MPI_POINTER pSasIOUnitPage2_t; 2391 SasIOUnitPage2_t, MPI_POINTER pSasIOUnitPage2_t;
1936 2392
1937#define MPI_SASIOUNITPAGE2_PAGEVERSION (0x00) 2393#define MPI_SASIOUNITPAGE2_PAGEVERSION (0x03)
1938 2394
1939/* values for SAS IO Unit Page 2 Status field */ 2395/* values for SAS IO Unit Page 2 Status field */
1940#define MPI_SAS_IOUNIT2_STATUS_DISABLED_PERSISTENT_MAPPINGS (0x02) 2396#define MPI_SAS_IOUNIT2_STATUS_DISABLED_PERSISTENT_MAPPINGS (0x02)
@@ -1942,11 +2398,19 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_2
1942 2398
1943/* values for SAS IO Unit Page 2 Flags field */ 2399/* values for SAS IO Unit Page 2 Flags field */
1944#define MPI_SAS_IOUNIT2_FLAGS_DISABLE_PERSISTENT_MAPPINGS (0x01) 2400#define MPI_SAS_IOUNIT2_FLAGS_DISABLE_PERSISTENT_MAPPINGS (0x01)
2401/* Physical Mapping Modes */
2402#define MPI_SAS_IOUNIT2_FLAGS_MASK_PHYS_MAP_MODE (0x0E)
2403#define MPI_SAS_IOUNIT2_FLAGS_SHIFT_PHYS_MAP_MODE (1)
2404#define MPI_SAS_IOUNIT2_FLAGS_NO_PHYS_MAP (0x00)
2405#define MPI_SAS_IOUNIT2_FLAGS_DIRECT_ATTACH_PHYS_MAP (0x01)
2406#define MPI_SAS_IOUNIT2_FLAGS_ENCLOSURE_SLOT_PHYS_MAP (0x02)
2407
2408#define MPI_SAS_IOUNIT2_FLAGS_RESERVE_ID_0_FOR_BOOT (0x10)
1945 2409
1946 2410
1947typedef struct _CONFIG_PAGE_SAS_IO_UNIT_3 2411typedef struct _CONFIG_PAGE_SAS_IO_UNIT_3
1948{ 2412{
1949 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2413 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
1950 U32 Reserved1; /* 08h */ 2414 U32 Reserved1; /* 08h */
1951 U32 MaxInvalidDwordCount; /* 0Ch */ 2415 U32 MaxInvalidDwordCount; /* 0Ch */
1952 U32 InvalidDwordCountTime; /* 10h */ 2416 U32 InvalidDwordCountTime; /* 10h */
@@ -1956,18 +2420,24 @@ typedef struct _CONFIG_PAGE_SAS_IO_UNIT_3
1956 U32 LossDwordSynchCountTime; /* 20h */ 2420 U32 LossDwordSynchCountTime; /* 20h */
1957 U32 MaxPhyResetProblemCount; /* 24h */ 2421 U32 MaxPhyResetProblemCount; /* 24h */
1958 U32 PhyResetProblemTime; /* 28h */ 2422 U32 PhyResetProblemTime; /* 28h */
1959} fCONFIG_PAGE_SAS_IO_UNIT_3, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_3, 2423} CONFIG_PAGE_SAS_IO_UNIT_3, MPI_POINTER PTR_CONFIG_PAGE_SAS_IO_UNIT_3,
1960 SasIOUnitPage3_t, MPI_POINTER pSasIOUnitPage3_t; 2424 SasIOUnitPage3_t, MPI_POINTER pSasIOUnitPage3_t;
1961 2425
1962#define MPI_SASIOUNITPAGE3_PAGEVERSION (0x00) 2426#define MPI_SASIOUNITPAGE3_PAGEVERSION (0x00)
1963 2427
1964 2428
2429/****************************************************************************
2430* SAS Expander Config Pages
2431****************************************************************************/
2432
1965typedef struct _CONFIG_PAGE_SAS_EXPANDER_0 2433typedef struct _CONFIG_PAGE_SAS_EXPANDER_0
1966{ 2434{
1967 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2435 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
1968 U32 Reserved1; /* 08h */ 2436 U8 PhysicalPort; /* 08h */
2437 U8 Reserved1; /* 09h */
2438 U16 Reserved2; /* 0Ah */
1969 U64 SASAddress; /* 0Ch */ 2439 U64 SASAddress; /* 0Ch */
1970 U32 Reserved2; /* 14h */ 2440 U32 DiscoveryStatus; /* 14h */
1971 U16 DevHandle; /* 18h */ 2441 U16 DevHandle; /* 18h */
1972 U16 ParentDevHandle; /* 1Ah */ 2442 U16 ParentDevHandle; /* 1Ah */
1973 U16 ExpanderChangeCount; /* 1Ch */ 2443 U16 ExpanderChangeCount; /* 1Ch */
@@ -1976,45 +2446,127 @@ typedef struct _CONFIG_PAGE_SAS_EXPANDER_0
1976 U8 SASLevel; /* 21h */ 2446 U8 SASLevel; /* 21h */
1977 U8 Flags; /* 22h */ 2447 U8 Flags; /* 22h */
1978 U8 Reserved3; /* 23h */ 2448 U8 Reserved3; /* 23h */
1979} fCONFIG_PAGE_SAS_EXPANDER_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_EXPANDER_0, 2449} CONFIG_PAGE_SAS_EXPANDER_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_EXPANDER_0,
1980 SasExpanderPage0_t, MPI_POINTER pSasExpanderPage0_t; 2450 SasExpanderPage0_t, MPI_POINTER pSasExpanderPage0_t;
1981 2451
1982#define MPI_SASEXPANDER0_PAGEVERSION (0x00) 2452#define MPI_SASEXPANDER0_PAGEVERSION (0x02)
2453
2454/* values for SAS Expander Page 0 DiscoveryStatus field */
2455#define MPI_SAS_EXPANDER0_DS_LOOP_DETECTED (0x00000001)
2456#define MPI_SAS_EXPANDER0_DS_UNADDRESSABLE_DEVICE (0x00000002)
2457#define MPI_SAS_EXPANDER0_DS_MULTIPLE_PORTS (0x00000004)
2458#define MPI_SAS_EXPANDER0_DS_EXPANDER_ERR (0x00000008)
2459#define MPI_SAS_EXPANDER0_DS_SMP_TIMEOUT (0x00000010)
2460#define MPI_SAS_EXPANDER0_DS_OUT_ROUTE_ENTRIES (0x00000020)
2461#define MPI_SAS_EXPANDER0_DS_INDEX_NOT_EXIST (0x00000040)
2462#define MPI_SAS_EXPANDER0_DS_SMP_FUNCTION_FAILED (0x00000080)
2463#define MPI_SAS_EXPANDER0_DS_SMP_CRC_ERROR (0x00000100)
2464#define MPI_SAS_EXPANDER0_DS_SUBTRACTIVE_LINK (0x00000200)
2465#define MPI_SAS_EXPANDER0_DS_TABLE_LINK (0x00000400)
2466#define MPI_SAS_EXPANDER0_DS_UNSUPPORTED_DEVICE (0x00000800)
1983 2467
1984/* values for SAS Expander Page 0 Flags field */ 2468/* values for SAS Expander Page 0 Flags field */
1985#define MPI_SAS_EXPANDER0_FLAGS_ROUTE_TABLE_CONFIG (0x02) 2469#define MPI_SAS_EXPANDER0_FLAGS_ROUTE_TABLE_CONFIG (0x02)
1986#define MPI_SAS_EXPANDER0_FLAGS_CONFIG_IN_PROGRESS (0x01) 2470#define MPI_SAS_EXPANDER0_FLAGS_CONFIG_IN_PROGRESS (0x01)
1987 2471
1988 2472
2473typedef struct _CONFIG_PAGE_SAS_EXPANDER_1
2474{
2475 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2476 U8 PhysicalPort; /* 08h */
2477 U8 Reserved1; /* 09h */
2478 U16 Reserved2; /* 0Ah */
2479 U8 NumPhys; /* 0Ch */
2480 U8 Phy; /* 0Dh */
2481 U16 NumTableEntriesProgrammed; /* 0Eh */
2482 U8 ProgrammedLinkRate; /* 10h */
2483 U8 HwLinkRate; /* 11h */
2484 U16 AttachedDevHandle; /* 12h */
2485 U32 PhyInfo; /* 14h */
2486 U32 AttachedDeviceInfo; /* 18h */
2487 U16 OwnerDevHandle; /* 1Ch */
2488 U8 ChangeCount; /* 1Eh */
2489 U8 NegotiatedLinkRate; /* 1Fh */
2490 U8 PhyIdentifier; /* 20h */
2491 U8 AttachedPhyIdentifier; /* 21h */
2492 U8 NumTableEntriesProg; /* 22h */
2493 U8 DiscoveryInfo; /* 23h */
2494 U32 Reserved3; /* 24h */
2495} CONFIG_PAGE_SAS_EXPANDER_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_EXPANDER_1,
2496 SasExpanderPage1_t, MPI_POINTER pSasExpanderPage1_t;
2497
2498#define MPI_SASEXPANDER1_PAGEVERSION (0x01)
2499
2500/* use MPI_SAS_PHY0_PRATE_ defines for ProgrammedLinkRate */
2501
2502/* use MPI_SAS_PHY0_HWRATE_ defines for HwLinkRate */
2503
2504/* use MPI_SAS_PHY0_PHYINFO_ defines for PhyInfo */
2505
2506/* see mpi_sas.h for values for SAS Expander Page 1 AttachedDeviceInfo values */
2507
2508/* values for SAS Expander Page 1 DiscoveryInfo field */
2509#define MPI_SAS_EXPANDER1_DISCINFO_BAD_PHY DISABLED (0x04)
2510#define MPI_SAS_EXPANDER1_DISCINFO_LINK_STATUS_CHANGE (0x02)
2511#define MPI_SAS_EXPANDER1_DISCINFO_NO_ROUTING_ENTRIES (0x01)
2512
2513/* values for SAS Expander Page 1 NegotiatedLinkRate field */
2514#define MPI_SAS_EXPANDER1_NEG_RATE_UNKNOWN (0x00)
2515#define MPI_SAS_EXPANDER1_NEG_RATE_PHY_DISABLED (0x01)
2516#define MPI_SAS_EXPANDER1_NEG_RATE_FAILED_NEGOTIATION (0x02)
2517#define MPI_SAS_EXPANDER1_NEG_RATE_SATA_OOB_COMPLETE (0x03)
2518#define MPI_SAS_EXPANDER1_NEG_RATE_1_5 (0x08)
2519#define MPI_SAS_EXPANDER1_NEG_RATE_3_0 (0x09)
2520
2521
2522/****************************************************************************
2523* SAS Device Config Pages
2524****************************************************************************/
2525
1989typedef struct _CONFIG_PAGE_SAS_DEVICE_0 2526typedef struct _CONFIG_PAGE_SAS_DEVICE_0
1990{ 2527{
1991 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2528 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
1992 U32 Reserved1; /* 08h */ 2529 U16 Slot; /* 08h */
2530 U16 EnclosureHandle; /* 0Ah */
1993 U64 SASAddress; /* 0Ch */ 2531 U64 SASAddress; /* 0Ch */
1994 U32 Reserved2; /* 14h */ 2532 U16 ParentDevHandle; /* 14h */
2533 U8 PhyNum; /* 16h */
2534 U8 AccessStatus; /* 17h */
1995 U16 DevHandle; /* 18h */ 2535 U16 DevHandle; /* 18h */
1996 U8 TargetID; /* 1Ah */ 2536 U8 TargetID; /* 1Ah */
1997 U8 Bus; /* 1Bh */ 2537 U8 Bus; /* 1Bh */
1998 U32 DeviceInfo; /* 1Ch */ 2538 U32 DeviceInfo; /* 1Ch */
1999 U16 Flags; /* 20h */ 2539 U16 Flags; /* 20h */
2000 U8 PhysicalPort; /* 22h */ 2540 U8 PhysicalPort; /* 22h */
2001 U8 Reserved3; /* 23h */ 2541 U8 Reserved2; /* 23h */
2002} fCONFIG_PAGE_SAS_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_DEVICE_0, 2542} CONFIG_PAGE_SAS_DEVICE_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_DEVICE_0,
2003 SasDevicePage0_t, MPI_POINTER pSasDevicePage0_t; 2543 SasDevicePage0_t, MPI_POINTER pSasDevicePage0_t;
2004 2544
2005#define MPI_SASDEVICE0_PAGEVERSION (0x00) 2545#define MPI_SASDEVICE0_PAGEVERSION (0x04)
2546
2547/* values for SAS Device Page 0 AccessStatus field */
2548#define MPI_SAS_DEVICE0_ASTATUS_NO_ERRORS (0x00)
2549#define MPI_SAS_DEVICE0_ASTATUS_SATA_INIT_FAILED (0x01)
2550#define MPI_SAS_DEVICE0_ASTATUS_SATA_CAPABILITY_FAILED (0x02)
2006 2551
2007/* values for SAS Device Page 0 Flags field */ 2552/* values for SAS Device Page 0 Flags field */
2008#define MPI_SAS_DEVICE0_FLAGS_MAPPING_PERSISTENT (0x04) 2553#define MPI_SAS_DEVICE0_FLAGS_SATA_SW_PRESERVE (0x0200)
2009#define MPI_SAS_DEVICE0_FLAGS_DEVICE_MAPPED (0x02) 2554#define MPI_SAS_DEVICE0_FLAGS_UNSUPPORTED_DEVICE (0x0100)
2010#define MPI_SAS_DEVICE0_FLAGS_DEVICE_PRESENT (0x01) 2555#define MPI_SAS_DEVICE0_FLAGS_SATA_48BIT_LBA_SUPPORTED (0x0080)
2556#define MPI_SAS_DEVICE0_FLAGS_SATA_SMART_SUPPORTED (0x0040)
2557#define MPI_SAS_DEVICE0_FLAGS_SATA_NCQ_SUPPORTED (0x0020)
2558#define MPI_SAS_DEVICE0_FLAGS_SATA_FUA_SUPPORTED (0x0010)
2559#define MPI_SAS_DEVICE0_FLAGS_PORT_SELECTOR_ATTACH (0x0008)
2560#define MPI_SAS_DEVICE0_FLAGS_MAPPING_PERSISTENT (0x0004)
2561#define MPI_SAS_DEVICE0_FLAGS_DEVICE_MAPPED (0x0002)
2562#define MPI_SAS_DEVICE0_FLAGS_DEVICE_PRESENT (0x0001)
2011 2563
2012/* see mpi_sas.h for values for SAS Device Page 0 DeviceInfo values */ 2564/* see mpi_sas.h for values for SAS Device Page 0 DeviceInfo values */
2013 2565
2014 2566
2015typedef struct _CONFIG_PAGE_SAS_DEVICE_1 2567typedef struct _CONFIG_PAGE_SAS_DEVICE_1
2016{ 2568{
2017 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2569 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2018 U32 Reserved1; /* 08h */ 2570 U32 Reserved1; /* 08h */
2019 U64 SASAddress; /* 0Ch */ 2571 U64 SASAddress; /* 0Ch */
2020 U32 Reserved2; /* 14h */ 2572 U32 Reserved2; /* 14h */
@@ -2022,15 +2574,30 @@ typedef struct _CONFIG_PAGE_SAS_DEVICE_1
2022 U8 TargetID; /* 1Ah */ 2574 U8 TargetID; /* 1Ah */
2023 U8 Bus; /* 1Bh */ 2575 U8 Bus; /* 1Bh */
2024 U8 InitialRegDeviceFIS[20];/* 1Ch */ 2576 U8 InitialRegDeviceFIS[20];/* 1Ch */
2025} fCONFIG_PAGE_SAS_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_DEVICE_1, 2577} CONFIG_PAGE_SAS_DEVICE_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_DEVICE_1,
2026 SasDevicePage1_t, MPI_POINTER pSasDevicePage1_t; 2578 SasDevicePage1_t, MPI_POINTER pSasDevicePage1_t;
2027 2579
2028#define MPI_SASDEVICE1_PAGEVERSION (0x00) 2580#define MPI_SASDEVICE1_PAGEVERSION (0x00)
2029 2581
2030 2582
2583typedef struct _CONFIG_PAGE_SAS_DEVICE_2
2584{
2585 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2586 U64 PhysicalIdentifier; /* 08h */
2587 U32 Reserved1; /* 10h */
2588} CONFIG_PAGE_SAS_DEVICE_2, MPI_POINTER PTR_CONFIG_PAGE_SAS_DEVICE_2,
2589 SasDevicePage2_t, MPI_POINTER pSasDevicePage2_t;
2590
2591#define MPI_SASDEVICE2_PAGEVERSION (0x00)
2592
2593
2594/****************************************************************************
2595* SAS PHY Config Pages
2596****************************************************************************/
2597
2031typedef struct _CONFIG_PAGE_SAS_PHY_0 2598typedef struct _CONFIG_PAGE_SAS_PHY_0
2032{ 2599{
2033 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2600 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2034 U32 Reserved1; /* 08h */ 2601 U32 Reserved1; /* 08h */
2035 U64 SASAddress; /* 0Ch */ 2602 U64 SASAddress; /* 0Ch */
2036 U16 AttachedDevHandle; /* 14h */ 2603 U16 AttachedDevHandle; /* 14h */
@@ -2042,7 +2609,7 @@ typedef struct _CONFIG_PAGE_SAS_PHY_0
2042 U8 ChangeCount; /* 22h */ 2609 U8 ChangeCount; /* 22h */
2043 U8 Reserved3; /* 23h */ 2610 U8 Reserved3; /* 23h */
2044 U32 PhyInfo; /* 24h */ 2611 U32 PhyInfo; /* 24h */
2045} fCONFIG_PAGE_SAS_PHY_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_PHY_0, 2612} CONFIG_PAGE_SAS_PHY_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_PHY_0,
2046 SasPhyPage0_t, MPI_POINTER pSasPhyPage0_t; 2613 SasPhyPage0_t, MPI_POINTER pSasPhyPage0_t;
2047 2614
2048#define MPI_SASPHY0_PAGEVERSION (0x00) 2615#define MPI_SASPHY0_PAGEVERSION (0x00)
@@ -2089,17 +2656,95 @@ typedef struct _CONFIG_PAGE_SAS_PHY_0
2089 2656
2090typedef struct _CONFIG_PAGE_SAS_PHY_1 2657typedef struct _CONFIG_PAGE_SAS_PHY_1
2091{ 2658{
2092 fCONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */ 2659 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2093 U32 Reserved1; /* 08h */ 2660 U32 Reserved1; /* 08h */
2094 U32 InvalidDwordCount; /* 0Ch */ 2661 U32 InvalidDwordCount; /* 0Ch */
2095 U32 RunningDisparityErrorCount; /* 10h */ 2662 U32 RunningDisparityErrorCount; /* 10h */
2096 U32 LossDwordSynchCount; /* 14h */ 2663 U32 LossDwordSynchCount; /* 14h */
2097 U32 PhyResetProblemCount; /* 18h */ 2664 U32 PhyResetProblemCount; /* 18h */
2098} fCONFIG_PAGE_SAS_PHY_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_PHY_1, 2665} CONFIG_PAGE_SAS_PHY_1, MPI_POINTER PTR_CONFIG_PAGE_SAS_PHY_1,
2099 SasPhyPage1_t, MPI_POINTER pSasPhyPage1_t; 2666 SasPhyPage1_t, MPI_POINTER pSasPhyPage1_t;
2100 2667
2101#define MPI_SASPHY1_PAGEVERSION (0x00) 2668#define MPI_SASPHY1_PAGEVERSION (0x00)
2102 2669
2103 2670
2671/****************************************************************************
2672* SAS Enclosure Config Pages
2673****************************************************************************/
2674
2675typedef struct _CONFIG_PAGE_SAS_ENCLOSURE_0
2676{
2677 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2678 U32 Reserved1; /* 08h */
2679 U64 EnclosureLogicalID; /* 0Ch */
2680 U16 Flags; /* 14h */
2681 U16 EnclosureHandle; /* 16h */
2682 U16 NumSlots; /* 18h */
2683 U16 StartSlot; /* 1Ah */
2684 U8 StartTargetID; /* 1Ch */
2685 U8 StartBus; /* 1Dh */
2686 U8 SEPTargetID; /* 1Eh */
2687 U8 SEPBus; /* 1Fh */
2688 U32 Reserved2; /* 20h */
2689 U32 Reserved3; /* 24h */
2690} CONFIG_PAGE_SAS_ENCLOSURE_0, MPI_POINTER PTR_CONFIG_PAGE_SAS_ENCLOSURE_0,
2691 SasEnclosurePage0_t, MPI_POINTER pSasEnclosurePage0_t;
2692
2693#define MPI_SASENCLOSURE0_PAGEVERSION (0x00)
2694
2695/* values for SAS Enclosure Page 0 Flags field */
2696#define MPI_SAS_ENCLS0_FLAGS_SEP_BUS_ID_VALID (0x0020)
2697#define MPI_SAS_ENCLS0_FLAGS_START_BUS_ID_VALID (0x0010)
2698
2699#define MPI_SAS_ENCLS0_FLAGS_MNG_MASK (0x000F)
2700#define MPI_SAS_ENCLS0_FLAGS_MNG_UNKNOWN (0x0000)
2701#define MPI_SAS_ENCLS0_FLAGS_MNG_IOC_SES (0x0001)
2702#define MPI_SAS_ENCLS0_FLAGS_MNG_IOC_SGPIO (0x0002)
2703#define MPI_SAS_ENCLS0_FLAGS_MNG_EXP_SGPIO (0x0003)
2704#define MPI_SAS_ENCLS0_FLAGS_MNG_SES_ENCLOSURE (0x0004)
2705
2706
2707/****************************************************************************
2708* Log Config Pages
2709****************************************************************************/
2710/*
2711 * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
2712 * one and check NumLogEntries at runtime.
2713 */
2714#ifndef MPI_LOG_0_NUM_LOG_ENTRIES
2715#define MPI_LOG_0_NUM_LOG_ENTRIES (1)
2716#endif
2717
2718#define MPI_LOG_0_LOG_DATA_LENGTH (20)
2719
2720typedef struct _MPI_LOG_0_ENTRY
2721{
2722 U64 WWID; /* 00h */
2723 U32 TimeStamp; /* 08h */
2724 U32 Reserved1; /* 0Ch */
2725 U16 LogSequence; /* 10h */
2726 U16 LogEntryQualifier; /* 12h */
2727 U8 LogData[MPI_LOG_0_LOG_DATA_LENGTH]; /* 14h */
2728} MPI_LOG_0_ENTRY, MPI_POINTER PTR_MPI_LOG_0_ENTRY,
2729 MpiLog0Entry_t, MPI_POINTER pMpiLog0Entry_t;
2730
2731/* values for Log Page 0 LogEntry LogEntryQualifier field */
2732#define MPI_LOG_0_ENTRY_QUAL_ENTRY_UNUSED (0x0000)
2733#define MPI_LOG_0_ENTRY_QUAL_POWER_ON_RESET (0x0001)
2734
2735typedef struct _CONFIG_PAGE_LOG_0
2736{
2737 CONFIG_EXTENDED_PAGE_HEADER Header; /* 00h */
2738 U32 Reserved1; /* 08h */
2739 U32 Reserved2; /* 0Ch */
2740 U16 NumLogEntries; /* 10h */
2741 U16 Reserved3; /* 12h */
2742 MPI_LOG_0_ENTRY LogEntry[MPI_LOG_0_NUM_LOG_ENTRIES]; /* 14h */
2743} CONFIG_PAGE_LOG_0, MPI_POINTER PTR_CONFIG_PAGE_LOG_0,
2744 LogPage0_t, MPI_POINTER pLogPage0_t;
2745
2746#define MPI_LOG_0_PAGEVERSION (0x00)
2747
2748
2104#endif 2749#endif
2105 2750
diff --git a/drivers/message/fusion/lsi/mpi_fc.h b/drivers/message/fusion/lsi/mpi_fc.h
index ea266b236c1f..51a6aeb990ba 100644
--- a/drivers/message/fusion/lsi/mpi_fc.h
+++ b/drivers/message/fusion/lsi/mpi_fc.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2004 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_fc.h 5 * Name: mpi_fc.h
6 * Title: MPI Fibre Channel messages and structures 6 * Title: MPI Fibre Channel messages and structures
7 * Creation Date: June 12, 2000 7 * Creation Date: June 12, 2000
8 * 8 *
9 * mpi_fc.h Version: 01.05.xx 9 * mpi_fc.h Version: 01.05.01
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -36,6 +36,9 @@
36 * 09-28-01 01.02.02 Change name of reserved field in 36 * 09-28-01 01.02.02 Change name of reserved field in
37 * MSG_LINK_SERVICE_RSP_REPLY. 37 * MSG_LINK_SERVICE_RSP_REPLY.
38 * 05-31-02 01.02.03 Adding AliasIndex to FC Direct Access requests. 38 * 05-31-02 01.02.03 Adding AliasIndex to FC Direct Access requests.
39 * 01-16-04 01.02.04 Added define for MPI_FC_PRIM_SEND_FLAGS_ML_RESET_LINK.
40 * 05-11-04 01.03.01 Original release for MPI v1.3.
41 * 08-19-04 01.05.01 Original release for MPI v1.5.
39 * -------------------------------------------------------------------------- 42 * --------------------------------------------------------------------------
40 */ 43 */
41 44
diff --git a/drivers/message/fusion/lsi/mpi_history.txt b/drivers/message/fusion/lsi/mpi_history.txt
index 0deb7721e936..c9edbee41edf 100644
--- a/drivers/message/fusion/lsi/mpi_history.txt
+++ b/drivers/message/fusion/lsi/mpi_history.txt
@@ -3,25 +3,28 @@
3 MPI Header File Change History 3 MPI Header File Change History
4 ============================== 4 ==============================
5 5
6 Copyright (c) 2000-2001 LSI Logic Corporation. 6 Copyright (c) 2000-2005 LSI Logic Corporation.
7 7
8 --------------------------------------- 8 ---------------------------------------
9 Header Set Release Version: 01.01.10 9 Header Set Release Version: 01.05.09
10 Header Set Release Date: 04-09-01 10 Header Set Release Date: 03-11-05
11 --------------------------------------- 11 ---------------------------------------
12 12
13 Filename Current version Prior version 13 Filename Current version Prior version
14 ---------- --------------- ------------- 14 ---------- --------------- -------------
15 mpi.h 01.01.07 01.01.06 15 mpi.h 01.05.07 01.05.06
16 mpi_ioc.h 01.01.07 01.01.06 16 mpi_ioc.h 01.05.08 01.05.07
17 mpi_cnfg.h 01.01.11 01.01.10 17 mpi_cnfg.h 01.05.08 01.05.07
18 mpi_init.h 01.01.05 01.01.04 18 mpi_init.h 01.05.04 01.05.03
19 mpi_targ.h 01.01.04 01.01.04 19 mpi_targ.h 01.05.04 01.05.03
20 mpi_fc.h 01.01.07 01.01.06 20 mpi_fc.h 01.05.01 01.05.01
21 mpi_lan.h 01.01.03 01.01.03 21 mpi_lan.h 01.05.01 01.05.01
22 mpi_raid.h 01.01.02 01.01.02 22 mpi_raid.h 01.05.02 01.05.02
23 mpi_type.h 01.01.02 01.01.02 23 mpi_tool.h 01.05.03 01.05.03
24 mpi_history.txt 01.01.09 01.01.09 24 mpi_inb.h 01.05.01 01.05.01
25 mpi_sas.h 01.05.01 01.05.01
26 mpi_type.h 01.05.01 01.05.01
27 mpi_history.txt 01.05.09 01.05.08
25 28
26 29
27 * Date Version Description 30 * Date Version Description
@@ -53,6 +56,38 @@ mpi.h
53 * Added function codes for RAID. 56 * Added function codes for RAID.
54 * 04-09-01 01.01.07 Added alternate define for MPI_DOORBELL_ACTIVE, 57 * 04-09-01 01.01.07 Added alternate define for MPI_DOORBELL_ACTIVE,
55 * MPI_DOORBELL_USED, to better match the spec. 58 * MPI_DOORBELL_USED, to better match the spec.
59 * 08-08-01 01.02.01 Original release for v1.2 work.
60 * Changed MPI_VERSION_MINOR from 0x01 to 0x02.
61 * Added define MPI_FUNCTION_TOOLBOX.
62 * 09-28-01 01.02.02 New function code MPI_SCSI_ENCLOSURE_PROCESSOR.
63 * 11-01-01 01.02.03 Changed name to MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR.
64 * 03-14-02 01.02.04 Added MPI_HEADER_VERSION_ defines.
65 * 05-31-02 01.02.05 Bumped MPI_HEADER_VERSION_UNIT.
66 * 07-12-02 01.02.06 Added define for MPI_FUNCTION_MAILBOX.
67 * 09-16-02 01.02.07 Bumped value for MPI_HEADER_VERSION_UNIT.
68 * 11-15-02 01.02.08 Added define MPI_IOCSTATUS_TARGET_INVALID_IO_INDEX and
69 * obsoleted define MPI_IOCSTATUS_TARGET_INVALID_IOCINDEX.
70 * 04-01-03 01.02.09 New IOCStatus code: MPI_IOCSTATUS_FC_EXCHANGE_CANCELED
71 * 06-26-03 01.02.10 Bumped MPI_HEADER_VERSION_UNIT value.
72 * 01-16-04 01.02.11 Added define for MPI_IOCLOGINFO_TYPE_SHIFT.
73 * 04-29-04 01.02.12 Added function codes for MPI_FUNCTION_DIAG_BUFFER_POST
74 * and MPI_FUNCTION_DIAG_RELEASE.
75 * Added MPI_IOCSTATUS_DIAGNOSTIC_RELEASED define.
76 * Bumped MPI_HEADER_VERSION_UNIT value.
77 * 05-11-04 01.03.01 Bumped MPI_VERSION_MINOR for MPI v1.3.
78 * Added codes for Inband.
79 * 08-19-04 01.05.01 Added defines for Host Buffer Access Control doorbell.
80 * Added define for offset of High Priority Request Queue.
81 * Added new function codes and new IOCStatus codes.
82 * Added a IOCLogInfo type of SAS.
83 * 12-07-04 01.05.02 Bumped MPI_HEADER_VERSION_UNIT.
84 * 12-09-04 01.05.03 Bumped MPI_HEADER_VERSION_UNIT.
85 * 01-15-05 01.05.04 Bumped MPI_HEADER_VERSION_UNIT.
86 * 02-09-05 01.05.05 Bumped MPI_HEADER_VERSION_UNIT.
87 * 02-22-05 01.05.06 Bumped MPI_HEADER_VERSION_UNIT.
88 * 03-11-05 01.05.07 Removed function codes for SCSI IO 32 and
89 * TargetAssistExtended requests.
90 * Removed EEDP IOCStatus codes.
56 * -------------------------------------------------------------------------- 91 * --------------------------------------------------------------------------
57 92
58mpi_ioc.h 93mpi_ioc.h
@@ -81,6 +116,49 @@ mpi_ioc.h
81 * 03-27-01 01.01.06 Added defines for ProductId field of MPI_FW_HEADER. 116 * 03-27-01 01.01.06 Added defines for ProductId field of MPI_FW_HEADER.
82 * Added structure offset comments. 117 * Added structure offset comments.
83 * 04-09-01 01.01.07 Added structure EVENT_DATA_EVENT_CHANGE. 118 * 04-09-01 01.01.07 Added structure EVENT_DATA_EVENT_CHANGE.
119 * 08-08-01 01.02.01 Original release for v1.2 work.
120 * New format for FWVersion and ProductId in
121 * MSG_IOC_FACTS_REPLY and MPI_FW_HEADER.
122 * 08-31-01 01.02.02 Addded event MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE and
123 * related structure and defines.
124 * Added event MPI_EVENT_ON_BUS_TIMER_EXPIRED.
125 * Added MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE.
126 * Replaced a reserved field in MSG_IOC_FACTS_REPLY with
127 * IOCExceptions and changed DataImageSize to reserved.
128 * Added MPI_FW_DOWNLOAD_ITYPE_NVSTORE_DATA and
129 * MPI_FW_UPLOAD_ITYPE_NVDATA.
130 * 09-28-01 01.02.03 Modified Event Data for Integrated RAID.
131 * 11-01-01 01.02.04 Added defines for MPI_EXT_IMAGE_HEADER ImageType field.
132 * 03-14-02 01.02.05 Added HeaderVersion field to MSG_IOC_FACTS_REPLY.
133 * 05-31-02 01.02.06 Added define for
134 * MPI_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID.
135 * Added AliasIndex to EVENT_DATA_LOGOUT structure.
136 * 04-01-03 01.02.07 Added defines for MPI_FW_HEADER_SIGNATURE_.
137 * 06-26-03 01.02.08 Added new values to the product family defines.
138 * 04-29-04 01.02.09 Added IOCCapabilities field to MSG_IOC_FACTS_REPLY and
139 * added related defines.
140 * 05-11-04 01.03.01 Original release for MPI v1.3.
141 * 08-19-04 01.05.01 Added four new fields to MSG_IOC_INIT.
142 * Added three new fields to MSG_IOC_FACTS_REPLY.
143 * Defined four new bits for the IOCCapabilities field of
144 * the IOCFacts reply.
145 * Added two new PortTypes for the PortFacts reply.
146 * Added six new events along with their EventData
147 * structures.
148 * Added a new MsgFlag to the FwDownload request to
149 * indicate last segment.
150 * Defined a new image type of boot loader.
151 * Added FW family codes for SAS product families.
152 * 10-05-04 01.05.02 Added ReplyFifoHostSignalingAddr field to
153 * MSG_IOC_FACTS_REPLY.
154 * 12-07-04 01.05.03 Added more defines for SAS Discovery Error event.
155 * 12-09-04 01.05.04 Added Unsupported device to SAS Device event.
156 * 01-15-05 01.05.05 Added event data for SAS SES Event.
157 * 02-09-05 01.05.06 Added MPI_FW_UPLOAD_ITYPE_FW_BACKUP define.
158 * 02-22-05 01.05.07 Added Host Page Buffer Persistent flag to IOC Facts
159 * Reply and IOC Init Request.
160 * 03-11-05 01.05.08 Added family code for 1068E family.
161 * Removed IOCFacts Reply EEDP Capability bit.
84 * -------------------------------------------------------------------------- 162 * --------------------------------------------------------------------------
85 163
86mpi_cnfg.h 164mpi_cnfg.h
@@ -142,6 +220,166 @@ mpi_cnfg.h
142 * Added IO Unit Page 3. 220 * Added IO Unit Page 3.
143 * Modified defines for Scsi Port Page 2. 221 * Modified defines for Scsi Port Page 2.
144 * Modified RAID Volume Pages. 222 * Modified RAID Volume Pages.
223 * 08-08-01 01.02.01 Original release for v1.2 work.
224 * Added SepID and SepBus to RVP2 IMPhysicalDisk struct.
225 * Added defines for the SEP bits in RVP2 VolumeSettings.
226 * Modified the DeviceSettings field in RVP2 to use the
227 * proper structure.
228 * Added defines for SES, SAF-TE, and cross channel for
229 * IOCPage2 CapabilitiesFlags.
230 * Removed define for MPI_IOUNITPAGE2_FLAGS_RAID_DISABLE.
231 * Removed define for
232 * MPI_SCSIPORTPAGE2_PORT_FLAGS_PARITY_ENABLE.
233 * Added define for MPI_CONFIG_PAGEATTR_RO_PERSISTENT.
234 * 08-29-01 01.02.02 Fixed value for MPI_MANUFACTPAGE_DEVID_53C1035.
235 * Added defines for MPI_FCPORTPAGE1_FLAGS_HARD_ALPA_ONLY
236 * and MPI_FCPORTPAGE1_FLAGS_IMMEDIATE_ERROR_REPLY.
237 * Removed MPI_SCSIPORTPAGE0_CAP_PACING_TRANSFERS,
238 * MPI_SCSIDEVPAGE0_NP_PACING_TRANSFERS, and
239 * MPI_SCSIDEVPAGE1_RP_PACING_TRANSFERS, and
240 * MPI_SCSIDEVPAGE1_CONF_PPR_ALLOWED.
241 * Added defines for MPI_SCSIDEVPAGE1_CONF_WDTR_DISALLOWED
242 * and MPI_SCSIDEVPAGE1_CONF_SDTR_DISALLOWED.
243 * Added OnBusTimerValue to CONFIG_PAGE_SCSI_PORT_1.
244 * Added rejected bits to SCSI Device Page 0 Information.
245 * Increased size of ALPA array in FC Port Page 2 by one
246 * and removed a one byte reserved field.
247 * 09-28-01 01.02.03 Swapped NegWireSpeedLow and NegWireSpeedLow in
248 * CONFIG_PAGE_LAN_1 to match preferred 64-bit ordering.
249 * Added structures for Manufacturing Page 4, IO Unit
250 * Page 3, IOC Page 3, IOC Page 4, RAID Volume Page 0, and
251 * RAID PhysDisk Page 0.
252 * 10-04-01 01.02.04 Added define for MPI_CONFIG_PAGETYPE_RAID_PHYSDISK.
253 * Modified some of the new defines to make them 32
254 * character unique.
255 * Modified how variable length pages (arrays) are defined.
256 * Added generic defines for hot spare pools and RAID
257 * volume types.
258 * 11-01-01 01.02.05 Added define for MPI_IOUNITPAGE1_DISABLE_IR.
259 * 03-14-02 01.02.06 Added PCISlotNum field to CONFIG_PAGE_IOC_1 along with
260 * related define, and bumped the page version define.
261 * 05-31-02 01.02.07 Added a Flags field to CONFIG_PAGE_IOC_2_RAID_VOL in a
262 * reserved byte and added a define.
263 * Added define for
264 * MPI_RAIDVOL0_STATUS_FLAG_VOLUME_INACTIVE.
265 * Added new config page: CONFIG_PAGE_IOC_5.
266 * Added MaxAliases, MaxHardAliases, and NumCurrentAliases
267 * fields to CONFIG_PAGE_FC_PORT_0.
268 * Added AltConnector and NumRequestedAliases fields to
269 * CONFIG_PAGE_FC_PORT_1.
270 * Added new config page: CONFIG_PAGE_FC_PORT_10.
271 * 07-12-02 01.02.08 Added more MPI_MANUFACTPAGE_DEVID_ defines.
272 * Added additional MPI_SCSIDEVPAGE0_NP_ defines.
273 * Added more MPI_SCSIDEVPAGE1_RP_ defines.
274 * Added define for
275 * MPI_SCSIDEVPAGE1_CONF_EXTENDED_PARAMS_ENABLE.
276 * Added new config page: CONFIG_PAGE_SCSI_DEVICE_3.
277 * Modified MPI_FCPORTPAGE5_FLAGS_ defines.
278 * 09-16-02 01.02.09 Added MPI_SCSIDEVPAGE1_CONF_FORCE_PPR_MSG define.
279 * 11-15-02 01.02.10 Added ConnectedID defines for CONFIG_PAGE_SCSI_PORT_0.
280 * Added more Flags defines for CONFIG_PAGE_FC_PORT_1.
281 * Added more Flags defines for CONFIG_PAGE_FC_DEVICE_0.
282 * 04-01-03 01.02.11 Added RR_TOV field and additional Flags defines for
283 * CONFIG_PAGE_FC_PORT_1.
284 * Added define MPI_FCPORTPAGE5_FLAGS_DISABLE to disable
285 * an alias.
286 * Added more device id defines.
287 * 06-26-03 01.02.12 Added MPI_IOUNITPAGE1_IR_USE_STATIC_VOLUME_ID define.
288 * Added TargetConfig and IDConfig fields to
289 * CONFIG_PAGE_SCSI_PORT_1.
290 * Added more PortFlags defines for CONFIG_PAGE_SCSI_PORT_2
291 * to control DV.
292 * Added more Flags defines for CONFIG_PAGE_FC_PORT_1.
293 * In CONFIG_PAGE_FC_DEVICE_0, replaced Reserved1 field
294 * with ADISCHardALPA.
295 * Added MPI_FC_DEVICE_PAGE0_PROT_FCP_RETRY define.
296 * 01-16-04 01.02.13 Added InitiatorDeviceTimeout and InitiatorIoPendTimeout
297 * fields and related defines to CONFIG_PAGE_FC_PORT_1.
298 * Added define for
299 * MPI_FCPORTPAGE1_FLAGS_SOFT_ALPA_FALLBACK.
300 * Added new fields to the substructures of
301 * CONFIG_PAGE_FC_PORT_10.
302 * 04-29-04 01.02.14 Added define for IDP bit for CONFIG_PAGE_SCSI_PORT_0,
303 * CONFIG_PAGE_SCSI_DEVICE_0, and
304 * CONFIG_PAGE_SCSI_DEVICE_1. Also bumped Page Version for
305 * these pages.
306 * 05-11-04 01.03.01 Added structure for CONFIG_PAGE_INBAND_0.
307 * 08-19-04 01.05.01 Modified MSG_CONFIG request to support extended config
308 * pages.
309 * Added a new structure for extended config page header.
310 * Added new extended config pages types and structures for
311 * SAS IO Unit, SAS Expander, SAS Device, and SAS PHY.
312 * Replaced a reserved byte in CONFIG_PAGE_MANUFACTURING_4
313 * to add a Flags field.
314 * Two new Manufacturing config pages (5 and 6).
315 * Two new bits defined for IO Unit Page 1 Flags field.
316 * Modified CONFIG_PAGE_IO_UNIT_2 to add three new fields
317 * to specify the BIOS boot device.
318 * Four new Flags bits defined for IO Unit Page 2.
319 * Added IO Unit Page 4.
320 * Added EEDP Flags settings to IOC Page 1.
321 * Added new BIOS Page 1 config page.
322 * 10-05-04 01.05.02 Added define for
323 * MPI_IOCPAGE1_INITIATOR_CONTEXT_REPLY_DISABLE.
324 * Added new Flags field to CONFIG_PAGE_MANUFACTURING_5 and
325 * associated defines.
326 * Added more defines for SAS IO Unit Page 0
327 * DiscoveryStatus field.
328 * Added define for MPI_SAS_IOUNIT0_DS_SUBTRACTIVE_LINK
329 * and MPI_SAS_IOUNIT0_DS_TABLE_LINK.
330 * Added defines for Physical Mapping Modes to SAS IO Unit
331 * Page 2.
332 * Added define for
333 * MPI_SAS_DEVICE0_FLAGS_PORT_SELECTOR_ATTACH.
334 * 10-27-04 01.05.03 Added defines for new SAS PHY page addressing mode.
335 * Added defines for MaxTargetSpinUp to BIOS Page 1.
336 * Added 5 new ControlFlags defines for SAS IO Unit
337 * Page 1.
338 * Added MaxNumPhysicalMappedIDs field to SAS IO Unit
339 * Page 2.
340 * Added AccessStatus field to SAS Device Page 0 and added
341 * new Flags bits for supported SATA features.
342 * 12-07-04 01.05.04 Added config page structures for BIOS Page 2, RAID
343 * Volume Page 1, and RAID Physical Disk Page 1.
344 * Replaced IO Unit Page 1 BootTargetID,BootBus, and
345 * BootAdapterNum with reserved field.
346 * Added DataScrubRate and ResyncRate to RAID Volume
347 * Page 0.
348 * Added MPI_SAS_IOUNIT2_FLAGS_RESERVE_ID_0_FOR_BOOT
349 * define.
350 * 12-09-04 01.05.05 Added Target Mode Large CDB Enable to FC Port Page 1
351 * Flags field.
352 * Added Auto Port Config flag define for SAS IOUNIT
353 * Page 1 ControlFlags.
354 * Added Disabled bad Phy define to Expander Page 1
355 * Discovery Info field.
356 * Added SAS/SATA device support to SAS IOUnit Page 1
357 * ControlFlags.
358 * Added Unsupported device to SAS Dev Page 0 Flags field
359 * Added disable use SATA Hash Address for SAS IOUNIT
360 * page 1 in ControlFields.
361 * 01-15-05 01.05.06 Added defaults for data scrub rate and resync rate to
362 * Manufacturing Page 4.
363 * Added new defines for BIOS Page 1 IOCSettings field.
364 * Added ExtDiskIdentifier field to RAID Physical Disk
365 * Page 0.
366 * Added new defines for SAS IO Unit Page 1 ControlFlags
367 * and to SAS Device Page 0 Flags to control SATA devices.
368 * Added defines and structures for the new Log Page 0, a
369 * new type of configuration page.
370 * 02-09-05 01.05.07 Added InactiveStatus field to RAID Volume Page 0.
371 * Added WWID field to RAID Volume Page 1.
372 * Added PhysicalPort field to SAS Expander pages 0 and 1.
373 * 03-11-05 01.05.08 Removed the EEDP flags from IOC Page 1.
374 * Added Enclosure/Slot boot device format to BIOS Page 2.
375 * New status value for RAID Volume Page 0 VolumeStatus
376 * (VolumeState subfield).
377 * New value for RAID Physical Page 0 InactiveStatus.
378 * Added Inactive Volume Member flag RAID Physical Disk
379 * Page 0 PhysDiskStatus field.
380 * New physical mapping mode in SAS IO Unit Page 2.
381 * Added CONFIG_PAGE_SAS_ENCLOSURE_0.
382 * Added Slot and Enclosure fields to SAS Device Page 0.
145 * -------------------------------------------------------------------------- 383 * --------------------------------------------------------------------------
146 384
147mpi_init.h 385mpi_init.h
@@ -154,6 +392,32 @@ mpi_init.h
154 * 02-20-01 01.01.03 Started using MPI_POINTER. 392 * 02-20-01 01.01.03 Started using MPI_POINTER.
155 * 03-27-01 01.01.04 Added structure offset comments. 393 * 03-27-01 01.01.04 Added structure offset comments.
156 * 04-10-01 01.01.05 Added new MsgFlag for MSG_SCSI_TASK_MGMT. 394 * 04-10-01 01.01.05 Added new MsgFlag for MSG_SCSI_TASK_MGMT.
395 * 08-08-01 01.02.01 Original release for v1.2 work.
396 * 08-29-01 01.02.02 Added MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET.
397 * Added MPI_SCSI_STATE_QUEUE_TAG_REJECTED for
398 * MSG_SCSI_IO_REPLY.
399 * 09-28-01 01.02.03 Added structures and defines for SCSI Enclosure
400 * Processor messages.
401 * 10-04-01 01.02.04 Added defines for SEP request Action field.
402 * 05-31-02 01.02.05 Added MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR define
403 * for SCSI IO requests.
404 * 11-15-02 01.02.06 Added special extended SCSI Status defines for FCP.
405 * 06-26-03 01.02.07 Added MPI_SCSI_STATUS_FCPEXT_UNASSIGNED define.
406 * 05-11-04 01.03.01 Original release for MPI v1.3.
407 * 08-19-04 01.05.01 Added MsgFlags defines for EEDP to SCSI IO request.
408 * Added new word to MSG_SCSI_IO_REPLY to add TaskTag field
409 * and a reserved U16.
410 * Added new MSG_SCSI_IO32_REQUEST structure.
411 * Added a TaskType of Clear Task Set to SCSI
412 * Task Management request.
413 * 12-07-04 01.05.02 Added support for Task Management Query Task.
414 * 01-15-05 01.05.03 Modified SCSI Enclosure Processor Request to support
415 * WWID addressing.
416 * 03-11-05 01.05.04 Removed EEDP flags from SCSI IO Request.
417 * Removed SCSI IO 32 Request.
418 * Modified SCSI Enclosure Processor Request and Reply to
419 * support Enclosure/Slot addressing rather than WWID
420 * addressing.
157 * -------------------------------------------------------------------------- 421 * --------------------------------------------------------------------------
158 422
159mpi_targ.h 423mpi_targ.h
@@ -170,6 +434,33 @@ mpi_targ.h
170 * Added structures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and 434 * Added structures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and
171 * MPI_TARGET_FCP_CMD_BUFFER. 435 * MPI_TARGET_FCP_CMD_BUFFER.
172 * 03-27-01 01.01.04 Added structure offset comments. 436 * 03-27-01 01.01.04 Added structure offset comments.
437 * 08-08-01 01.02.01 Original release for v1.2 work.
438 * 09-28-01 01.02.02 Added structure for MPI_TARGET_SCSI_SPI_STATUS_IU.
439 * Added PriorityReason field to some replies and
440 * defined more PriorityReason codes.
441 * Added some defines for to support previous version
442 * of MPI.
443 * 10-04-01 01.02.03 Added PriorityReason to MSG_TARGET_ERROR_REPLY.
444 * 11-01-01 01.02.04 Added define for TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY.
445 * 03-14-02 01.02.05 Modified MPI_TARGET_FCP_RSP_BUFFER to get the proper
446 * byte ordering.
447 * 05-31-02 01.02.06 Modified TARGET_MODE_REPLY_ALIAS_MASK to only include
448 * one bit.
449 * Added AliasIndex field to MPI_TARGET_FCP_CMD_BUFFER.
450 * 09-16-02 01.02.07 Added flags for confirmed completion.
451 * Added PRIORITY_REASON_TARGET_BUSY.
452 * 11-15-02 01.02.08 Added AliasID field to MPI_TARGET_SCSI_SPI_CMD_BUFFER.
453 * 04-01-03 01.02.09 Added OptionalOxid field to MPI_TARGET_FCP_CMD_BUFFER.
454 * 05-11-04 01.03.01 Original release for MPI v1.3.
455 * 08-19-04 01.05.01 Added new request message structures for
456 * MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
457 * MSG_TARGET_CMD_BUF_POST_LIST_REQUEST, and
458 * MSG_TARGET_ASSIST_EXT_REQUEST.
459 * Added new structures for SAS SSP Command buffer, SSP
460 * Task buffer, and SSP Status IU.
461 * 10-05-04 01.05.02 MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY added.
462 * 02-22-05 01.05.03 Changed a comment.
463 * 03-11-05 01.05.04 Removed TargetAssistExtended Request.
173 * -------------------------------------------------------------------------- 464 * --------------------------------------------------------------------------
174 465
175mpi_fc.h 466mpi_fc.h
@@ -192,6 +483,13 @@ mpi_fc.h
192 * Added MPI_FC_PRIM_SEND_FLAGS_RESET_LINK define. 483 * Added MPI_FC_PRIM_SEND_FLAGS_RESET_LINK define.
193 * Added structure offset comments. 484 * Added structure offset comments.
194 * 04-09-01 01.01.07 Added RspLength field to MSG_LINK_SERVICE_RSP_REQUEST. 485 * 04-09-01 01.01.07 Added RspLength field to MSG_LINK_SERVICE_RSP_REQUEST.
486 * 08-08-01 01.02.01 Original release for v1.2 work.
487 * 09-28-01 01.02.02 Change name of reserved field in
488 * MSG_LINK_SERVICE_RSP_REPLY.
489 * 05-31-02 01.02.03 Adding AliasIndex to FC Direct Access requests.
490 * 01-16-04 01.02.04 Added define for MPI_FC_PRIM_SEND_FLAGS_ML_RESET_LINK.
491 * 05-11-04 01.03.01 Original release for MPI v1.3.
492 * 08-19-04 01.05.01 Original release for MPI v1.5.
195 * -------------------------------------------------------------------------- 493 * --------------------------------------------------------------------------
196 494
197mpi_lan.h 495mpi_lan.h
@@ -209,11 +507,56 @@ mpi_lan.h
209 * 11-02-00 01.01.01 Original release for post 1.0 work 507 * 11-02-00 01.01.01 Original release for post 1.0 work
210 * 02-20-01 01.01.02 Started using MPI_POINTER. 508 * 02-20-01 01.01.02 Started using MPI_POINTER.
211 * 03-27-01 01.01.03 Added structure offset comments. 509 * 03-27-01 01.01.03 Added structure offset comments.
510 * 08-08-01 01.02.01 Original release for v1.2 work.
511 * 05-11-04 01.03.01 Original release for MPI v1.3.
512 * 08-19-04 01.05.01 Original release for MPI v1.5.
212 * -------------------------------------------------------------------------- 513 * --------------------------------------------------------------------------
213 514
214mpi_raid.h 515mpi_raid.h
215 * 02-27-01 01.01.01 Original release for this file. 516 * 02-27-01 01.01.01 Original release for this file.
216 * 03-27-01 01.01.02 Added structure offset comments. 517 * 03-27-01 01.01.02 Added structure offset comments.
518 * 08-08-01 01.02.01 Original release for v1.2 work.
519 * 08-29-01 01.02.02 Added DIAG_DATA_UPLOAD_HEADER and related defines.
520 * 09-28-01 01.02.02 Major rework for MPI v1.2 Integrated RAID changes.
521 * 10-04-01 01.02.03 Added ActionData defines for
522 * MPI_RAID_ACTION_DELETE_VOLUME action.
523 * 11-01-01 01.02.04 Added define for MPI_RAID_ACTION_ADATA_DO_NOT_SYNC.
524 * 03-14-02 01.02.05 Added define for MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT.
525 * 05-07-02 01.02.06 Added define for MPI_RAID_ACTION_ACTIVATE_VOLUME,
526 * MPI_RAID_ACTION_INACTIVATE_VOLUME, and
527 * MPI_RAID_ACTION_ADATA_INACTIVATE_ALL.
528 * 07-12-02 01.02.07 Added structures for Mailbox request and reply.
529 * 11-15-02 01.02.08 Added missing MsgContext field to MSG_MAILBOX_REQUEST.
530 * 04-01-03 01.02.09 New action data option flag for
531 * MPI_RAID_ACTION_DELETE_VOLUME.
532 * 05-11-04 01.03.01 Original release for MPI v1.3.
533 * 08-19-04 01.05.01 Original release for MPI v1.5.
534 * 01-15-05 01.05.02 Added defines for the two new RAID Actions for
535 * _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE.
536 * --------------------------------------------------------------------------
537
538mpi_tool.h
539 * 08-08-01 01.02.01 Original release.
540 * 08-29-01 01.02.02 Added DIAG_DATA_UPLOAD_HEADER and related defines.
541 * 01-16-04 01.02.03 Added defines and structures for new tools
542 *. MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL and
543 * MPI_TOOLBOX_FC_MANAGEMENT_TOOL.
544 * 04-29-04 01.02.04 Added message structures for Diagnostic Buffer Post and
545 * Diagnostic Release requests and replies.
546 * 05-11-04 01.03.01 Original release for MPI v1.3.
547 * 08-19-04 01.05.01 Original release for MPI v1.5.
548 * 10-06-04 01.05.02 Added define for MPI_DIAG_BUF_TYPE_COUNT.
549 * 02-09-05 01.05.03 Added frame size option to FC management tool.
550 * Added Beacon tool to the Toolbox.
551 * --------------------------------------------------------------------------
552
553mpi_inb.h
554 * 05-11-04 01.03.01 Original release.
555 * 08-19-04 01.05.01 Original release for MPI v1.5.
556 * --------------------------------------------------------------------------
557
558mpi_sas.h
559 * 08-19-04 01.05.01 Original release.
217 * -------------------------------------------------------------------------- 560 * --------------------------------------------------------------------------
218 561
219mpi_type.h 562mpi_type.h
@@ -221,21 +564,83 @@ mpi_type.h
221 * 06-06-00 01.00.01 Update version number for 1.0 release. 564 * 06-06-00 01.00.01 Update version number for 1.0 release.
222 * 11-02-00 01.01.01 Original release for post 1.0 work 565 * 11-02-00 01.01.01 Original release for post 1.0 work
223 * 02-20-01 01.01.02 Added define and ifdef for MPI_POINTER. 566 * 02-20-01 01.01.02 Added define and ifdef for MPI_POINTER.
567 * 08-08-01 01.02.01 Original release for v1.2 work.
568 * 05-11-04 01.03.01 Original release for MPI v1.3.
569 * 08-19-04 01.05.01 Original release for MPI v1.5.
224 * -------------------------------------------------------------------------- 570 * --------------------------------------------------------------------------
225 571
226mpi_history.txt Parts list history 572mpi_history.txt Parts list history
227 573
228Filename 01.01.10 574Filename 01.05.09
229---------- -------- 575---------- --------
230mpi.h 01.01.07 576mpi.h 01.05.07
231mpi_ioc.h 01.01.07 577mpi_ioc.h 01.05.08
232mpi_cnfg.h 01.01.11 578mpi_cnfg.h 01.05.08
233mpi_init.h 01.01.05 579mpi_init.h 01.05.04
234mpi_targ.h 01.01.04 580mpi_targ.h 01.05.04
235mpi_fc.h 01.01.07 581mpi_fc.h 01.05.01
236mpi_lan.h 01.01.03 582mpi_lan.h 01.05.01
237mpi_raid.h 01.01.02 583mpi_raid.h 01.05.02
238mpi_type.h 01.01.02 584mpi_tool.h 01.05.03
585mpi_inb.h 01.05.01
586mpi_sas.h 01.05.01
587mpi_type.h 01.05.01
588
589Filename 01.05.08 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03
590---------- -------- -------- -------- -------- -------- --------
591mpi.h 01.05.06 01.05.05 01.05.04 01.05.03 01.05.02 01.05.01
592mpi_ioc.h 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03 01.05.02
593mpi_cnfg.h 01.05.07 01.05.07 01.05.06 01.05.05 01.05.04 01.05.03
594mpi_init.h 01.05.03 01.05.03 01.05.03 01.05.02 01.05.02 01.05.01
595mpi_targ.h 01.05.03 01.05.02 01.05.02 01.05.02 01.05.02 01.05.02
596mpi_fc.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01
597mpi_lan.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01
598mpi_raid.h 01.05.02 01.05.02 01.05.02 01.05.01 01.05.01 01.05.01
599mpi_tool.h 01.05.03 01.05.03 01.05.02 01.05.02 01.05.02 01.05.02
600mpi_inb.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01
601mpi_sas.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01
602mpi_type.h 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01 01.05.01
603
604Filename 01.05.02 01.05.01 01.03.01 01.02.14 01.02.13 01.02.12
605---------- -------- -------- -------- -------- -------- --------
606mpi.h 01.05.01 01.05.01 01.03.01 01.02.12 01.02.11 01.02.10
607mpi_ioc.h 01.05.02 01.05.01 01.03.01 01.02.09 01.02.08 01.02.08
608mpi_cnfg.h 01.05.02 01.05.01 01.03.01 01.02.14 01.02.13 01.02.12
609mpi_init.h 01.05.01 01.05.01 01.03.01 01.02.07 01.02.07 01.02.07
610mpi_targ.h 01.05.02 01.05.01 01.03.01 01.02.09 01.02.09 01.02.09
611mpi_fc.h 01.05.01 01.05.01 01.03.01 01.02.04 01.02.04 01.02.03
612mpi_lan.h 01.05.01 01.05.01 01.03.01 01.02.01 01.02.01 01.02.01
613mpi_raid.h 01.05.01 01.05.01 01.03.01 01.02.09 01.02.09 01.02.09
614mpi_tool.h 01.05.02 01.05.01 01.03.01 01.02.01 01.02.01 01.02.01
615mpi_inb.h 01.05.01 01.05.01 01.03.01
616mpi_sas.h 01.05.01 01.05.01
617mpi_type.h 01.05.01 01.05.01 01.03.01 01.02.04 01.02.03 01.02.02
618
619Filename 01.02.11 01.02.10 01.02.09 01.02.08 01.02.07 01.02.06
620---------- -------- -------- -------- -------- -------- --------
621mpi.h 01.02.09 01.02.08 01.02.07 01.02.06 01.02.05 01.02.04
622mpi_ioc.h 01.02.07 01.02.06 01.02.06 01.02.06 01.02.06 01.02.05
623mpi_cnfg.h 01.02.11 01.02.10 01.02.09 01.02.08 01.02.07 01.02.06
624mpi_init.h 01.02.06 01.02.06 01.02.05 01.02.05 01.02.05 01.02.04
625mpi_targ.h 01.02.09 01.02.08 01.02.07 01.02.06 01.02.06 01.02.05
626mpi_fc.h 01.02.03 01.02.03 01.02.03 01.02.03 01.02.03 01.02.02
627mpi_lan.h 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01
628mpi_raid.h 01.02.09 01.02.08 01.02.07 01.02.07 01.02.06 01.02.05
629mpi_tool.h 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01
630mpi_type.h 01.02.02 01.02.02 01.02.02 01.02.02 01.02.02 01.02.02
631
632Filename 01.02.05 01.02.04 01.02.03 01.02.02 01.02.01 01.01.10
633---------- -------- -------- -------- -------- -------- --------
634mpi.h 01.02.03 01.02.02 01.02.02 01.02.01 01.02.01 01.01.07
635mpi_ioc.h 01.02.04 01.02.03 01.02.03 01.02.02 01.02.01 01.01.07
636mpi_cnfg.h 01.02.05 01.02.04 01.02.03 01.02.02 01.02.01 01.01.11
637mpi_init.h 01.02.04 01.02.04 01.02.03 01.02.02 01.02.01 01.01.05
638mpi_targ.h 01.02.04 01.02.03 01.02.02 01.02.01 01.02.01 01.01.04
639mpi_fc.h 01.02.02 01.02.02 01.02.02 01.02.01 01.02.01 01.01.07
640mpi_lan.h 01.02.01 01.02.01 01.02.01 01.02.01 01.02.01 01.01.03
641mpi_raid.h 01.02.04 01.02.03 01.02.02 01.02.01 01.02.01 01.01.02
642mpi_tool.h 01.02.02 01.02.02 01.02.02 01.02.02 01.02.01
643mpi_type.h 01.02.02 01.02.02 01.02.02 01.02.02 01.02.01 01.01.02
239 644
240Filename 01.01.09 01.01.08 01.01.07 01.01.06 01.01.05 01.01.04 645Filename 01.01.09 01.01.08 01.01.07 01.01.06 01.01.05 01.01.04
241---------- -------- -------- -------- -------- -------- -------- 646---------- -------- -------- -------- -------- -------- --------
diff --git a/drivers/message/fusion/lsi/mpi_inb.h b/drivers/message/fusion/lsi/mpi_inb.h
index dae29fbed56f..ff167309ba27 100644
--- a/drivers/message/fusion/lsi/mpi_inb.h
+++ b/drivers/message/fusion/lsi/mpi_inb.h
@@ -1,19 +1,20 @@
1/* 1/*
2 * Copyright (c) 2003 LSI Logic Corporation. 2 * Copyright (c) 2003-2004 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_inb.h 5 * Name: mpi_inb.h
6 * Title: MPI Inband structures and definitions 6 * Title: MPI Inband structures and definitions
7 * Creation Date: September 30, 2003 7 * Creation Date: September 30, 2003
8 * 8 *
9 * mpi_inb.h Version: 01.03.xx 9 * mpi_inb.h Version: 01.05.01
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
13 * 13 *
14 * Date Version Description 14 * Date Version Description
15 * -------- -------- ------------------------------------------------------ 15 * -------- -------- ------------------------------------------------------
16 * ??-??-?? 01.03.01 Original release. 16 * 05-11-04 01.03.01 Original release.
17 * 08-19-04 01.05.01 Original release for MPI v1.5.
17 * -------------------------------------------------------------------------- 18 * --------------------------------------------------------------------------
18 */ 19 */
19 20
diff --git a/drivers/message/fusion/lsi/mpi_init.h b/drivers/message/fusion/lsi/mpi_init.h
index b3c95fd7256f..aca035801a86 100644
--- a/drivers/message/fusion/lsi/mpi_init.h
+++ b/drivers/message/fusion/lsi/mpi_init.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2005 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_init.h 5 * Name: mpi_init.h
6 * Title: MPI initiator mode messages and structures 6 * Title: MPI initiator mode messages and structures
7 * Creation Date: June 8, 2000 7 * Creation Date: June 8, 2000
8 * 8 *
9 * mpi_init.h Version: 01.05.xx 9 * mpi_init.h Version: 01.05.04
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -33,6 +33,21 @@
33 * for SCSI IO requests. 33 * for SCSI IO requests.
34 * 11-15-02 01.02.06 Added special extended SCSI Status defines for FCP. 34 * 11-15-02 01.02.06 Added special extended SCSI Status defines for FCP.
35 * 06-26-03 01.02.07 Added MPI_SCSI_STATUS_FCPEXT_UNASSIGNED define. 35 * 06-26-03 01.02.07 Added MPI_SCSI_STATUS_FCPEXT_UNASSIGNED define.
36 * 05-11-04 01.03.01 Original release for MPI v1.3.
37 * 08-19-04 01.05.01 Added MsgFlags defines for EEDP to SCSI IO request.
38 * Added new word to MSG_SCSI_IO_REPLY to add TaskTag field
39 * and a reserved U16.
40 * Added new MSG_SCSI_IO32_REQUEST structure.
41 * Added a TaskType of Clear Task Set to SCSI
42 * Task Management request.
43 * 12-07-04 01.05.02 Added support for Task Management Query Task.
44 * 01-15-05 01.05.03 Modified SCSI Enclosure Processor Request to support
45 * WWID addressing.
46 * 03-11-05 01.05.04 Removed EEDP flags from SCSI IO Request.
47 * Removed SCSI IO 32 Request.
48 * Modified SCSI Enclosure Processor Request and Reply to
49 * support Enclosure/Slot addressing rather than WWID
50 * addressing.
36 * -------------------------------------------------------------------------- 51 * --------------------------------------------------------------------------
37 */ 52 */
38 53
@@ -76,20 +91,12 @@ typedef struct _MSG_SCSI_IO_REQUEST
76#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH (0x01) 91#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH (0x01)
77#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 (0x00) 92#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 (0x00)
78#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 (0x01) 93#define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 (0x01)
94
79#define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION (0x02) 95#define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION (0x02)
80#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST (0x00) 96#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST (0x00)
81#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC (0x02) 97#define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC (0x02)
82#define MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR (0x04)
83#define MPI_SCSIIO_MSGFLGS_EEDP_TYPE_MASK (0xE0)
84#define MPI_SCSIIO_MSGFLGS_EEDP_NONE (0x00)
85#define MPI_SCSIIO_MSGFLGS_EEDP_RDPROTECT_T10 (0x20)
86#define MPI_SCSIIO_MSGFLGS_EEDP_VRPROTECT_T10 (0x40)
87#define MPI_SCSIIO_MSGFLGS_EEDP_WRPROTECT_T10 (0x60)
88#define MPI_SCSIIO_MSGFLGS_EEDP_520_READ_MODE1 (0x20)
89#define MPI_SCSIIO_MSGFLGS_EEDP_520_WRITE_MODE1 (0x40)
90#define MPI_SCSIIO_MSGFLGS_EEDP_8_9_READ_MODE1 (0x60)
91#define MPI_SCSIIO_MSGFLGS_EEDP_8_9_WRITE_MODE1 (0x80)
92 98
99#define MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR (0x04)
93 100
94/* SCSI IO LUN fields */ 101/* SCSI IO LUN fields */
95 102
@@ -148,6 +155,8 @@ typedef struct _MSG_SCSI_IO_REPLY
148 U32 TransferCount; /* 14h */ 155 U32 TransferCount; /* 14h */
149 U32 SenseCount; /* 18h */ 156 U32 SenseCount; /* 18h */
150 U32 ResponseInfo; /* 1Ch */ 157 U32 ResponseInfo; /* 1Ch */
158 U16 TaskTag; /* 20h */
159 U16 Reserved1; /* 22h */
151} MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY, 160} MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY,
152 SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t; 161 SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t;
153 162
@@ -190,32 +199,7 @@ typedef struct _MSG_SCSI_IO_REPLY
190#define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED (0x05000000) 199#define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED (0x05000000)
191#define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE (0x06000000) 200#define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE (0x06000000)
192 201
193 202#define MPI_SCSI_TASKTAG_UNKNOWN (0xFFFF)
194/****************************************************************************/
195/* SCSI IO 32 Request message structure */
196/****************************************************************************/
197
198typedef struct _MSG_SCSI_IO32_REQUEST
199{
200 U8 TargetID; /* 00h */
201 U8 Bus; /* 01h */
202 U8 ChainOffset; /* 02h */
203 U8 Function; /* 03h */
204 U8 CDBLength; /* 04h */
205 U8 SenseBufferLength; /* 05h */
206 U8 Reserved; /* 06h */
207 U8 MsgFlags; /* 07h */
208 U32 MsgContext; /* 08h */
209 U8 LUN[8]; /* 0Ch */
210 U32 Control; /* 14h */
211 U8 CDB[32]; /* 18h */
212 U32 DataLength; /* 38h */
213 U32 SenseBufferLowAddr; /* 3Ch */
214 SGE_IO_UNION SGL; /* 40h */
215} MSG_SCSI_IO32_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO32_REQUEST,
216 SCSIIO32Request_t, MPI_POINTER pSCSIIO32Request_t;
217
218/* SCSI IO 32 uses the same defines as above for SCSI IO */
219 203
220 204
221/****************************************************************************/ 205/****************************************************************************/
@@ -247,6 +231,7 @@ typedef struct _MSG_SCSI_TASK_MGMT
247#define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS (0x04) 231#define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS (0x04)
248#define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05) 232#define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05)
249#define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06) 233#define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06)
234#define MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07)
250 235
251/* MsgFlags bits */ 236/* MsgFlags bits */
252#define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00) 237#define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00)
@@ -260,7 +245,7 @@ typedef struct _MSG_SCSI_TASK_MGMT_REPLY
260 U8 Bus; /* 01h */ 245 U8 Bus; /* 01h */
261 U8 MsgLength; /* 02h */ 246 U8 MsgLength; /* 02h */
262 U8 Function; /* 03h */ 247 U8 Function; /* 03h */
263 U8 Reserved; /* 04h */ 248 U8 ResponseCode; /* 04h */
264 U8 TaskType; /* 05h */ 249 U8 TaskType; /* 05h */
265 U8 Reserved1; /* 06h */ 250 U8 Reserved1; /* 06h */
266 U8 MsgFlags; /* 07h */ 251 U8 MsgFlags; /* 07h */
@@ -272,6 +257,15 @@ typedef struct _MSG_SCSI_TASK_MGMT_REPLY
272} MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY, 257} MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY,
273 SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t; 258 SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t;
274 259
260/* ResponseCode values */
261#define MPI_SCSITASKMGMT_RSP_TM_COMPLETE (0x00)
262#define MPI_SCSITASKMGMT_RSP_INVALID_FRAME (0x02)
263#define MPI_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED (0x04)
264#define MPI_SCSITASKMGMT_RSP_TM_FAILED (0x05)
265#define MPI_SCSITASKMGMT_RSP_TM_SUCCEEDED (0x08)
266#define MPI_SCSITASKMGMT_RSP_TM_INVALID_LUN (0x09)
267#define MPI_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC (0x80)
268
275 269
276/****************************************************************************/ 270/****************************************************************************/
277/* SCSI Enclosure Processor messages */ 271/* SCSI Enclosure Processor messages */
@@ -284,11 +278,16 @@ typedef struct _MSG_SEP_REQUEST
284 U8 ChainOffset; /* 02h */ 278 U8 ChainOffset; /* 02h */
285 U8 Function; /* 03h */ 279 U8 Function; /* 03h */
286 U8 Action; /* 04h */ 280 U8 Action; /* 04h */
287 U8 Reserved1; /* 05h */ 281 U8 Flags; /* 05h */
288 U8 Reserved2; /* 06h */ 282 U8 Reserved1; /* 06h */
289 U8 MsgFlags; /* 07h */ 283 U8 MsgFlags; /* 07h */
290 U32 MsgContext; /* 08h */ 284 U32 MsgContext; /* 08h */
291 U32 SlotStatus; /* 0Ch */ 285 U32 SlotStatus; /* 0Ch */
286 U32 Reserved2; /* 10h */
287 U32 Reserved3; /* 14h */
288 U32 Reserved4; /* 18h */
289 U16 Slot; /* 1Ch */
290 U16 EnclosureHandle; /* 1Eh */
292} MSG_SEP_REQUEST, MPI_POINTER PTR_MSG_SEP_REQUEST, 291} MSG_SEP_REQUEST, MPI_POINTER PTR_MSG_SEP_REQUEST,
293 SEPRequest_t, MPI_POINTER pSEPRequest_t; 292 SEPRequest_t, MPI_POINTER pSEPRequest_t;
294 293
@@ -296,6 +295,10 @@ typedef struct _MSG_SEP_REQUEST
296#define MPI_SEP_REQ_ACTION_WRITE_STATUS (0x00) 295#define MPI_SEP_REQ_ACTION_WRITE_STATUS (0x00)
297#define MPI_SEP_REQ_ACTION_READ_STATUS (0x01) 296#define MPI_SEP_REQ_ACTION_READ_STATUS (0x01)
298 297
298/* Flags defines */
299#define MPI_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS (0x01)
300#define MPI_SEP_REQ_FLAGS_BUS_TARGETID_ADDRESS (0x00)
301
299/* SlotStatus bits for MSG_SEP_REQUEST */ 302/* SlotStatus bits for MSG_SEP_REQUEST */
300#define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR (0x00000001) 303#define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR (0x00000001)
301#define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY (0x00000002) 304#define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY (0x00000002)
@@ -332,6 +335,9 @@ typedef struct _MSG_SEP_REPLY
332 U16 IOCStatus; /* 0Eh */ 335 U16 IOCStatus; /* 0Eh */
333 U32 IOCLogInfo; /* 10h */ 336 U32 IOCLogInfo; /* 10h */
334 U32 SlotStatus; /* 14h */ 337 U32 SlotStatus; /* 14h */
338 U32 Reserved4; /* 18h */
339 U16 Slot; /* 1Ch */
340 U16 EnclosureHandle; /* 1Eh */
335} MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY, 341} MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY,
336 SEPReply_t, MPI_POINTER pSEPReply_t; 342 SEPReply_t, MPI_POINTER pSEPReply_t;
337 343
diff --git a/drivers/message/fusion/lsi/mpi_ioc.h b/drivers/message/fusion/lsi/mpi_ioc.h
index 82445d18b4d5..f91eb4efe8cc 100644
--- a/drivers/message/fusion/lsi/mpi_ioc.h
+++ b/drivers/message/fusion/lsi/mpi_ioc.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2005 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_ioc.h 5 * Name: mpi_ioc.h
6 * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages 6 * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages
7 * Creation Date: August 11, 2000 7 * Creation Date: August 11, 2000
8 * 8 *
9 * mpi_ioc.h Version: 01.05.xx 9 * mpi_ioc.h Version: 01.05.08
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -57,6 +57,30 @@
57 * Added AliasIndex to EVENT_DATA_LOGOUT structure. 57 * Added AliasIndex to EVENT_DATA_LOGOUT structure.
58 * 04-01-03 01.02.07 Added defines for MPI_FW_HEADER_SIGNATURE_. 58 * 04-01-03 01.02.07 Added defines for MPI_FW_HEADER_SIGNATURE_.
59 * 06-26-03 01.02.08 Added new values to the product family defines. 59 * 06-26-03 01.02.08 Added new values to the product family defines.
60 * 04-29-04 01.02.09 Added IOCCapabilities field to MSG_IOC_FACTS_REPLY and
61 * added related defines.
62 * 05-11-04 01.03.01 Original release for MPI v1.3.
63 * 08-19-04 01.05.01 Added four new fields to MSG_IOC_INIT.
64 * Added three new fields to MSG_IOC_FACTS_REPLY.
65 * Defined four new bits for the IOCCapabilities field of
66 * the IOCFacts reply.
67 * Added two new PortTypes for the PortFacts reply.
68 * Added six new events along with their EventData
69 * structures.
70 * Added a new MsgFlag to the FwDownload request to
71 * indicate last segment.
72 * Defined a new image type of boot loader.
73 * Added FW family codes for SAS product families.
74 * 10-05-04 01.05.02 Added ReplyFifoHostSignalingAddr field to
75 * MSG_IOC_FACTS_REPLY.
76 * 12-07-04 01.05.03 Added more defines for SAS Discovery Error event.
77 * 12-09-04 01.05.04 Added Unsupported device to SAS Device event.
78 * 01-15-05 01.05.05 Added event data for SAS SES Event.
79 * 02-09-05 01.05.06 Added MPI_FW_UPLOAD_ITYPE_FW_BACKUP define.
80 * 02-22-05 01.05.07 Added Host Page Buffer Persistent flag to IOC Facts
81 * Reply and IOC Init Request.
82 * 03-11-05 01.05.08 Added family code for 1068E family.
83 * Removed IOCFacts Reply EEDP Capability bit.
60 * -------------------------------------------------------------------------- 84 * --------------------------------------------------------------------------
61 */ 85 */
62 86
@@ -90,20 +114,37 @@ typedef struct _MSG_IOC_INIT
90 U32 HostMfaHighAddr; /* 10h */ 114 U32 HostMfaHighAddr; /* 10h */
91 U32 SenseBufferHighAddr; /* 14h */ 115 U32 SenseBufferHighAddr; /* 14h */
92 U32 ReplyFifoHostSignalingAddr; /* 18h */ 116 U32 ReplyFifoHostSignalingAddr; /* 18h */
117 SGE_SIMPLE_UNION HostPageBufferSGE; /* 1Ch */
118 U16 MsgVersion; /* 28h */
119 U16 HeaderVersion; /* 2Ah */
93} MSG_IOC_INIT, MPI_POINTER PTR_MSG_IOC_INIT, 120} MSG_IOC_INIT, MPI_POINTER PTR_MSG_IOC_INIT,
94 IOCInit_t, MPI_POINTER pIOCInit_t; 121 IOCInit_t, MPI_POINTER pIOCInit_t;
95 122
96/* WhoInit values */ 123/* WhoInit values */
97#define MPI_WHOINIT_NO_ONE (0x00) 124#define MPI_WHOINIT_NO_ONE (0x00)
98#define MPI_WHOINIT_SYSTEM_BIOS (0x01) 125#define MPI_WHOINIT_SYSTEM_BIOS (0x01)
99#define MPI_WHOINIT_ROM_BIOS (0x02) 126#define MPI_WHOINIT_ROM_BIOS (0x02)
100#define MPI_WHOINIT_PCI_PEER (0x03) 127#define MPI_WHOINIT_PCI_PEER (0x03)
101#define MPI_WHOINIT_HOST_DRIVER (0x04) 128#define MPI_WHOINIT_HOST_DRIVER (0x04)
102#define MPI_WHOINIT_MANUFACTURER (0x05) 129#define MPI_WHOINIT_MANUFACTURER (0x05)
103 130
104/* Flags values */ 131/* Flags values */
105#define MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE (0x01) 132#define MPI_IOCINIT_FLAGS_HOST_PAGE_BUFFER_PERSISTENT (0x04)
106#define MPI_IOCINIT_FLAGS_REPLY_FIFO_HOST_SIGNAL (0x02) 133#define MPI_IOCINIT_FLAGS_REPLY_FIFO_HOST_SIGNAL (0x02)
134#define MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE (0x01)
135
136/* MsgVersion */
137#define MPI_IOCINIT_MSGVERSION_MAJOR_MASK (0xFF00)
138#define MPI_IOCINIT_MSGVERSION_MAJOR_SHIFT (8)
139#define MPI_IOCINIT_MSGVERSION_MINOR_MASK (0x00FF)
140#define MPI_IOCINIT_MSGVERSION_MINOR_SHIFT (0)
141
142/* HeaderVersion */
143#define MPI_IOCINIT_HEADERVERSION_UNIT_MASK (0xFF00)
144#define MPI_IOCINIT_HEADERVERSION_UNIT_SHIFT (8)
145#define MPI_IOCINIT_HEADERVERSION_DEV_MASK (0x00FF)
146#define MPI_IOCINIT_HEADERVERSION_DEV_SHIFT (0)
147
107 148
108typedef struct _MSG_IOC_INIT_REPLY 149typedef struct _MSG_IOC_INIT_REPLY
109{ 150{
@@ -187,32 +228,39 @@ typedef struct _MSG_IOC_FACTS_REPLY
187 MPI_FW_VERSION FWVersion; /* 38h */ 228 MPI_FW_VERSION FWVersion; /* 38h */
188 U16 HighPriorityQueueDepth; /* 3Ch */ 229 U16 HighPriorityQueueDepth; /* 3Ch */
189 U16 Reserved2; /* 3Eh */ 230 U16 Reserved2; /* 3Eh */
231 SGE_SIMPLE_UNION HostPageBufferSGE; /* 40h */
232 U32 ReplyFifoHostSignalingAddr; /* 4Ch */
190} MSG_IOC_FACTS_REPLY, MPI_POINTER PTR_MSG_IOC_FACTS_REPLY, 233} MSG_IOC_FACTS_REPLY, MPI_POINTER PTR_MSG_IOC_FACTS_REPLY,
191 IOCFactsReply_t, MPI_POINTER pIOCFactsReply_t; 234 IOCFactsReply_t, MPI_POINTER pIOCFactsReply_t;
192 235
193#define MPI_IOCFACTS_MSGVERSION_MAJOR_MASK (0xFF00) 236#define MPI_IOCFACTS_MSGVERSION_MAJOR_MASK (0xFF00)
194#define MPI_IOCFACTS_MSGVERSION_MINOR_MASK (0x00FF) 237#define MPI_IOCFACTS_MSGVERSION_MAJOR_SHIFT (8)
238#define MPI_IOCFACTS_MSGVERSION_MINOR_MASK (0x00FF)
239#define MPI_IOCFACTS_MSGVERSION_MINOR_SHIFT (0)
195 240
196#define MPI_IOCFACTS_HEADERVERSION_UNIT_MASK (0xFF00) 241#define MPI_IOCFACTS_HDRVERSION_UNIT_MASK (0xFF00)
197#define MPI_IOCFACTS_HEADERVERSION_DEV_MASK (0x00FF) 242#define MPI_IOCFACTS_HDRVERSION_UNIT_SHIFT (8)
243#define MPI_IOCFACTS_HDRVERSION_DEV_MASK (0x00FF)
244#define MPI_IOCFACTS_HDRVERSION_DEV_SHIFT (0)
198 245
199#define MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL (0x0001) 246#define MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL (0x0001)
200#define MPI_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID (0x0002) 247#define MPI_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID (0x0002)
201#define MPI_IOCFACTS_EXCEPT_FW_CHECKSUM_FAIL (0x0004) 248#define MPI_IOCFACTS_EXCEPT_FW_CHECKSUM_FAIL (0x0004)
202#define MPI_IOCFACTS_EXCEPT_PERSISTENT_TABLE_FULL (0x0008) 249#define MPI_IOCFACTS_EXCEPT_PERSISTENT_TABLE_FULL (0x0008)
203 250
204#define MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT (0x01) 251#define MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT (0x01)
252#define MPI_IOCFACTS_FLAGS_REPLY_FIFO_HOST_SIGNAL (0x02)
253#define MPI_IOCFACTS_FLAGS_HOST_PAGE_BUFFER_PERSISTENT (0x04)
205 254
206#define MPI_IOCFACTS_EVENTSTATE_DISABLED (0x00) 255#define MPI_IOCFACTS_EVENTSTATE_DISABLED (0x00)
207#define MPI_IOCFACTS_EVENTSTATE_ENABLED (0x01) 256#define MPI_IOCFACTS_EVENTSTATE_ENABLED (0x01)
208 257
209#define MPI_IOCFACTS_CAPABILITY_HIGH_PRI_Q (0x00000001) 258#define MPI_IOCFACTS_CAPABILITY_HIGH_PRI_Q (0x00000001)
210#define MPI_IOCFACTS_CAPABILITY_REPLY_HOST_SIGNAL (0x00000002) 259#define MPI_IOCFACTS_CAPABILITY_REPLY_HOST_SIGNAL (0x00000002)
211#define MPI_IOCFACTS_CAPABILITY_QUEUE_FULL_HANDLING (0x00000004) 260#define MPI_IOCFACTS_CAPABILITY_QUEUE_FULL_HANDLING (0x00000004)
212#define MPI_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER (0x00000008) 261#define MPI_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER (0x00000008)
213#define MPI_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER (0x00000010) 262#define MPI_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER (0x00000010)
214#define MPI_IOCFACTS_CAPABILITY_EXTENDED_BUFFER (0x00000020) 263#define MPI_IOCFACTS_CAPABILITY_EXTENDED_BUFFER (0x00000020)
215#define MPI_IOCFACTS_CAPABILITY_EEDP (0x00000040)
216 264
217 265
218 266
@@ -408,6 +456,8 @@ typedef struct _MSG_EVENT_ACK_REPLY
408#define MPI_EVENT_SAS_DEVICE_STATUS_CHANGE (0x0000000F) 456#define MPI_EVENT_SAS_DEVICE_STATUS_CHANGE (0x0000000F)
409#define MPI_EVENT_SAS_SES (0x00000010) 457#define MPI_EVENT_SAS_SES (0x00000010)
410#define MPI_EVENT_PERSISTENT_TABLE_FULL (0x00000011) 458#define MPI_EVENT_PERSISTENT_TABLE_FULL (0x00000011)
459#define MPI_EVENT_SAS_PHY_LINK_STATUS (0x00000012)
460#define MPI_EVENT_SAS_DISCOVERY_ERROR (0x00000013)
411 461
412/* AckRequired field values */ 462/* AckRequired field values */
413 463
@@ -467,6 +517,10 @@ typedef struct _EVENT_DATA_SAS_DEVICE_STATUS_CHANGE
467 U8 ASCQ; /* 05h */ 517 U8 ASCQ; /* 05h */
468 U16 DevHandle; /* 06h */ 518 U16 DevHandle; /* 06h */
469 U32 DeviceInfo; /* 08h */ 519 U32 DeviceInfo; /* 08h */
520 U16 ParentDevHandle; /* 0Ch */
521 U8 PhyNum; /* 0Eh */
522 U8 Reserved1; /* 0Fh */
523 U64 SASAddress; /* 10h */
470} EVENT_DATA_SAS_DEVICE_STATUS_CHANGE, 524} EVENT_DATA_SAS_DEVICE_STATUS_CHANGE,
471 MPI_POINTER PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE, 525 MPI_POINTER PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE,
472 MpiEventDataSasDeviceStatusChange_t, 526 MpiEventDataSasDeviceStatusChange_t,
@@ -477,6 +531,8 @@ typedef struct _EVENT_DATA_SAS_DEVICE_STATUS_CHANGE
477#define MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING (0x04) 531#define MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING (0x04)
478#define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05) 532#define MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05)
479#define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED (0x06) 533#define MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED (0x06)
534#define MPI_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED (0x07)
535
480 536
481/* SCSI Event data for Queue Full event */ 537/* SCSI Event data for Queue Full event */
482 538
@@ -488,6 +544,35 @@ typedef struct _EVENT_DATA_QUEUE_FULL
488} EVENT_DATA_QUEUE_FULL, MPI_POINTER PTR_EVENT_DATA_QUEUE_FULL, 544} EVENT_DATA_QUEUE_FULL, MPI_POINTER PTR_EVENT_DATA_QUEUE_FULL,
489 EventDataQueueFull_t, MPI_POINTER pEventDataQueueFull_t; 545 EventDataQueueFull_t, MPI_POINTER pEventDataQueueFull_t;
490 546
547/* MPI Integrated RAID Event data */
548
549typedef struct _EVENT_DATA_RAID
550{
551 U8 VolumeID; /* 00h */
552 U8 VolumeBus; /* 01h */
553 U8 ReasonCode; /* 02h */
554 U8 PhysDiskNum; /* 03h */
555 U8 ASC; /* 04h */
556 U8 ASCQ; /* 05h */
557 U16 Reserved; /* 06h */
558 U32 SettingsStatus; /* 08h */
559} EVENT_DATA_RAID, MPI_POINTER PTR_EVENT_DATA_RAID,
560 MpiEventDataRaid_t, MPI_POINTER pMpiEventDataRaid_t;
561
562/* MPI Integrated RAID Event data ReasonCode values */
563#define MPI_EVENT_RAID_RC_VOLUME_CREATED (0x00)
564#define MPI_EVENT_RAID_RC_VOLUME_DELETED (0x01)
565#define MPI_EVENT_RAID_RC_VOLUME_SETTINGS_CHANGED (0x02)
566#define MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED (0x03)
567#define MPI_EVENT_RAID_RC_VOLUME_PHYSDISK_CHANGED (0x04)
568#define MPI_EVENT_RAID_RC_PHYSDISK_CREATED (0x05)
569#define MPI_EVENT_RAID_RC_PHYSDISK_DELETED (0x06)
570#define MPI_EVENT_RAID_RC_PHYSDISK_SETTINGS_CHANGED (0x07)
571#define MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED (0x08)
572#define MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED (0x09)
573#define MPI_EVENT_RAID_RC_SMART_DATA (0x0A)
574#define MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED (0x0B)
575
491/* MPI Link Status Change Event data */ 576/* MPI Link Status Change Event data */
492 577
493typedef struct _EVENT_DATA_LINK_STATUS 578typedef struct _EVENT_DATA_LINK_STATUS
@@ -535,35 +620,63 @@ typedef struct _EVENT_DATA_LOGOUT
535 620
536#define MPI_EVENT_LOGOUT_ALL_ALIASES (0xFF) 621#define MPI_EVENT_LOGOUT_ALL_ALIASES (0xFF)
537 622
623/* SAS SES Event data */
538 624
539/* MPI Integrated RAID Event data */ 625typedef struct _EVENT_DATA_SAS_SES
540
541typedef struct _EVENT_DATA_RAID
542{ 626{
543 U8 VolumeID; /* 00h */ 627 U8 PhyNum; /* 00h */
544 U8 VolumeBus; /* 01h */ 628 U8 Port; /* 01h */
545 U8 ReasonCode; /* 02h */ 629 U8 PortWidth; /* 02h */
546 U8 PhysDiskNum; /* 03h */ 630 U8 Reserved1; /* 04h */
547 U8 ASC; /* 04h */ 631} EVENT_DATA_SAS_SES, MPI_POINTER PTR_EVENT_DATA_SAS_SES,
548 U8 ASCQ; /* 05h */ 632 MpiEventDataSasSes_t, MPI_POINTER pMpiEventDataSasSes_t;
549 U16 Reserved; /* 06h */
550 U32 SettingsStatus; /* 08h */
551} EVENT_DATA_RAID, MPI_POINTER PTR_EVENT_DATA_RAID,
552 MpiEventDataRaid_t, MPI_POINTER pMpiEventDataRaid_t;
553 633
554/* MPI Integrated RAID Event data ReasonCode values */ 634/* SAS Phy Link Status Event data */
555#define MPI_EVENT_RAID_RC_VOLUME_CREATED (0x00) 635
556#define MPI_EVENT_RAID_RC_VOLUME_DELETED (0x01) 636typedef struct _EVENT_DATA_SAS_PHY_LINK_STATUS
557#define MPI_EVENT_RAID_RC_VOLUME_SETTINGS_CHANGED (0x02) 637{
558#define MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED (0x03) 638 U8 PhyNum; /* 00h */
559#define MPI_EVENT_RAID_RC_VOLUME_PHYSDISK_CHANGED (0x04) 639 U8 LinkRates; /* 01h */
560#define MPI_EVENT_RAID_RC_PHYSDISK_CREATED (0x05) 640 U16 DevHandle; /* 02h */
561#define MPI_EVENT_RAID_RC_PHYSDISK_DELETED (0x06) 641 U64 SASAddress; /* 04h */
562#define MPI_EVENT_RAID_RC_PHYSDISK_SETTINGS_CHANGED (0x07) 642} EVENT_DATA_SAS_PHY_LINK_STATUS, MPI_POINTER PTR_EVENT_DATA_SAS_PHY_LINK_STATUS,
563#define MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED (0x08) 643 MpiEventDataSasPhyLinkStatus_t, MPI_POINTER pMpiEventDataSasPhyLinkStatus_t;
564#define MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED (0x09) 644
565#define MPI_EVENT_RAID_RC_SMART_DATA (0x0A) 645/* defines for the LinkRates field of the SAS PHY Link Status event */
566#define MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED (0x0B) 646#define MPI_EVENT_SAS_PLS_LR_CURRENT_MASK (0xF0)
647#define MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT (4)
648#define MPI_EVENT_SAS_PLS_LR_PREVIOUS_MASK (0x0F)
649#define MPI_EVENT_SAS_PLS_LR_PREVIOUS_SHIFT (0)
650#define MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN (0x00)
651#define MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED (0x01)
652#define MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEGOTIATION (0x02)
653#define MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE (0x03)
654#define MPI_EVENT_SAS_PLS_LR_RATE_1_5 (0x08)
655#define MPI_EVENT_SAS_PLS_LR_RATE_3_0 (0x09)
656
657/* SAS Discovery Errror Event data */
658
659typedef struct _EVENT_DATA_DISCOVERY_ERROR
660{
661 U32 DiscoveryStatus; /* 00h */
662 U8 Port; /* 04h */
663 U8 Reserved1; /* 05h */
664 U16 Reserved2; /* 06h */
665} EVENT_DATA_DISCOVERY_ERROR, MPI_POINTER PTR_EVENT_DATA_DISCOVERY_ERROR,
666 EventDataDiscoveryError_t, MPI_POINTER pEventDataDiscoveryError_t;
667
668#define MPI_EVENT_DSCVRY_ERR_DS_LOOP_DETECTED (0x00000001)
669#define MPI_EVENT_DSCVRY_ERR_DS_UNADDRESSABLE_DEVICE (0x00000002)
670#define MPI_EVENT_DSCVRY_ERR_DS_MULTIPLE_PORTS (0x00000004)
671#define MPI_EVENT_DSCVRY_ERR_DS_EXPANDER_ERR (0x00000008)
672#define MPI_EVENT_DSCVRY_ERR_DS_SMP_TIMEOUT (0x00000010)
673#define MPI_EVENT_DSCVRY_ERR_DS_OUT_ROUTE_ENTRIES (0x00000020)
674#define MPI_EVENT_DSCVRY_ERR_DS_INDEX_NOT_EXIST (0x00000040)
675#define MPI_EVENT_DSCVRY_ERR_DS_SMP_FUNCTION_FAILED (0x00000080)
676#define MPI_EVENT_DSCVRY_ERR_DS_SMP_CRC_ERROR (0x00000100)
677#define MPI_EVENT_DSCVRY_ERR_DS_MULTPL_SUBTRACTIVE (0x00000200)
678#define MPI_EVENT_DSCVRY_ERR_DS_TABLE_TO_TABLE (0x00000400)
679#define MPI_EVENT_DSCVRY_ERR_DS_MULTPL_PATHS (0x00000800)
567 680
568 681
569/***************************************************************************** 682/*****************************************************************************
@@ -589,11 +702,13 @@ typedef struct _MSG_FW_DOWNLOAD
589} MSG_FW_DOWNLOAD, MPI_POINTER PTR_MSG_FW_DOWNLOAD, 702} MSG_FW_DOWNLOAD, MPI_POINTER PTR_MSG_FW_DOWNLOAD,
590 FWDownload_t, MPI_POINTER pFWDownload_t; 703 FWDownload_t, MPI_POINTER pFWDownload_t;
591 704
592#define MPI_FW_DOWNLOAD_ITYPE_RESERVED (0x00) 705#define MPI_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT (0x01)
593#define MPI_FW_DOWNLOAD_ITYPE_FW (0x01) 706
594#define MPI_FW_DOWNLOAD_ITYPE_BIOS (0x02) 707#define MPI_FW_DOWNLOAD_ITYPE_RESERVED (0x00)
595#define MPI_FW_DOWNLOAD_ITYPE_NVDATA (0x03) 708#define MPI_FW_DOWNLOAD_ITYPE_FW (0x01)
596#define MPI_FW_DOWNLOAD_ITYPE_BOOTLOADER (0x04) 709#define MPI_FW_DOWNLOAD_ITYPE_BIOS (0x02)
710#define MPI_FW_DOWNLOAD_ITYPE_NVDATA (0x03)
711#define MPI_FW_DOWNLOAD_ITYPE_BOOTLOADER (0x04)
597 712
598 713
599typedef struct _FWDownloadTCSGE 714typedef struct _FWDownloadTCSGE
@@ -647,6 +762,7 @@ typedef struct _MSG_FW_UPLOAD
647#define MPI_FW_UPLOAD_ITYPE_BIOS_FLASH (0x02) 762#define MPI_FW_UPLOAD_ITYPE_BIOS_FLASH (0x02)
648#define MPI_FW_UPLOAD_ITYPE_NVDATA (0x03) 763#define MPI_FW_UPLOAD_ITYPE_NVDATA (0x03)
649#define MPI_FW_UPLOAD_ITYPE_BOOTLOADER (0x04) 764#define MPI_FW_UPLOAD_ITYPE_BOOTLOADER (0x04)
765#define MPI_FW_UPLOAD_ITYPE_FW_BACKUP (0x05)
650 766
651typedef struct _FWUploadTCSGE 767typedef struct _FWUploadTCSGE
652{ 768{
@@ -723,6 +839,7 @@ typedef struct _MPI_FW_HEADER
723#define MPI_FW_HEADER_PID_PROD_IM_SCSI (0x0400) 839#define MPI_FW_HEADER_PID_PROD_IM_SCSI (0x0400)
724#define MPI_FW_HEADER_PID_PROD_IS_SCSI (0x0500) 840#define MPI_FW_HEADER_PID_PROD_IS_SCSI (0x0500)
725#define MPI_FW_HEADER_PID_PROD_CTX_SCSI (0x0600) 841#define MPI_FW_HEADER_PID_PROD_CTX_SCSI (0x0600)
842#define MPI_FW_HEADER_PID_PROD_IR_SCSI (0x0700)
726 843
727#define MPI_FW_HEADER_PID_FAMILY_MASK (0x00FF) 844#define MPI_FW_HEADER_PID_FAMILY_MASK (0x00FF)
728/* SCSI */ 845/* SCSI */
@@ -740,13 +857,16 @@ typedef struct _MPI_FW_HEADER
740#define MPI_FW_HEADER_PID_FAMILY_1020TA0_SCSI (0x000C) 857#define MPI_FW_HEADER_PID_FAMILY_1020TA0_SCSI (0x000C)
741/* Fibre Channel */ 858/* Fibre Channel */
742#define MPI_FW_HEADER_PID_FAMILY_909_FC (0x0000) 859#define MPI_FW_HEADER_PID_FAMILY_909_FC (0x0000)
743#define MPI_FW_HEADER_PID_FAMILY_919_FC (0x0001) 860#define MPI_FW_HEADER_PID_FAMILY_919_FC (0x0001) /* 919 and 929 */
744#define MPI_FW_HEADER_PID_FAMILY_919X_FC (0x0002) 861#define MPI_FW_HEADER_PID_FAMILY_919X_FC (0x0002) /* 919X and 929X */
745#define MPI_FW_HEADER_PID_FAMILY_919XL_FC (0x0003) 862#define MPI_FW_HEADER_PID_FAMILY_919XL_FC (0x0003) /* 919XL and 929XL */
746#define MPI_FW_HEADER_PID_FAMILY_949_FC (0x0004) 863#define MPI_FW_HEADER_PID_FAMILY_939X_FC (0x0004) /* 939X and 949X */
747#define MPI_FW_HEADER_PID_FAMILY_959_FC (0x0005) 864#define MPI_FW_HEADER_PID_FAMILY_959_FC (0x0005)
748/* SAS */ 865/* SAS */
749#define MPI_FW_HEADER_PID_FAMILY_1064_SAS (0x0001) 866#define MPI_FW_HEADER_PID_FAMILY_1064_SAS (0x0001)
867#define MPI_FW_HEADER_PID_FAMILY_1068_SAS (0x0002)
868#define MPI_FW_HEADER_PID_FAMILY_1078_SAS (0x0003)
869#define MPI_FW_HEADER_PID_FAMILY_106xE_SAS (0x0004) /* 1068E, 1066E, and 1064E */
750 870
751typedef struct _MPI_EXT_IMAGE_HEADER 871typedef struct _MPI_EXT_IMAGE_HEADER
752{ 872{
diff --git a/drivers/message/fusion/lsi/mpi_lan.h b/drivers/message/fusion/lsi/mpi_lan.h
index 3ced12784ee8..dc0b52ae83dd 100644
--- a/drivers/message/fusion/lsi/mpi_lan.h
+++ b/drivers/message/fusion/lsi/mpi_lan.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2004 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_lan.h 5 * Name: mpi_lan.h
6 * Title: MPI LAN messages and structures 6 * Title: MPI LAN messages and structures
7 * Creation Date: June 30, 2000 7 * Creation Date: June 30, 2000
8 * 8 *
9 * mpi_lan.h Version: 01.05.xx 9 * mpi_lan.h Version: 01.05.01
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -28,6 +28,8 @@
28 * 02-20-01 01.01.02 Started using MPI_POINTER. 28 * 02-20-01 01.01.02 Started using MPI_POINTER.
29 * 03-27-01 01.01.03 Added structure offset comments. 29 * 03-27-01 01.01.03 Added structure offset comments.
30 * 08-08-01 01.02.01 Original release for v1.2 work. 30 * 08-08-01 01.02.01 Original release for v1.2 work.
31 * 05-11-04 01.03.01 Original release for MPI v1.3.
32 * 08-19-04 01.05.01 Original release for MPI v1.5.
31 * -------------------------------------------------------------------------- 33 * --------------------------------------------------------------------------
32 */ 34 */
33 35
diff --git a/drivers/message/fusion/lsi/mpi_raid.h b/drivers/message/fusion/lsi/mpi_raid.h
index 9580a9de7fd2..802255d2747c 100644
--- a/drivers/message/fusion/lsi/mpi_raid.h
+++ b/drivers/message/fusion/lsi/mpi_raid.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2001-2003 LSI Logic Corporation. 2 * Copyright (c) 2001-2005 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_raid.h 5 * Name: mpi_raid.h
6 * Title: MPI RAID message and structures 6 * Title: MPI RAID message and structures
7 * Creation Date: February 27, 2001 7 * Creation Date: February 27, 2001
8 * 8 *
9 * mpi_raid.h Version: 01.05.xx 9 * mpi_raid.h Version: 01.05.02
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -28,6 +28,10 @@
28 * 11-15-02 01.02.08 Added missing MsgContext field to MSG_MAILBOX_REQUEST. 28 * 11-15-02 01.02.08 Added missing MsgContext field to MSG_MAILBOX_REQUEST.
29 * 04-01-03 01.02.09 New action data option flag for 29 * 04-01-03 01.02.09 New action data option flag for
30 * MPI_RAID_ACTION_DELETE_VOLUME. 30 * MPI_RAID_ACTION_DELETE_VOLUME.
31 * 05-11-04 01.03.01 Original release for MPI v1.3.
32 * 08-19-04 01.05.01 Original release for MPI v1.5.
33 * 01-15-05 01.05.02 Added defines for the two new RAID Actions for
34 * _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE.
31 * -------------------------------------------------------------------------- 35 * --------------------------------------------------------------------------
32 */ 36 */
33 37
@@ -84,6 +88,8 @@ typedef struct _MSG_RAID_ACTION
84#define MPI_RAID_ACTION_REPLACE_PHYSDISK (0x10) 88#define MPI_RAID_ACTION_REPLACE_PHYSDISK (0x10)
85#define MPI_RAID_ACTION_ACTIVATE_VOLUME (0x11) 89#define MPI_RAID_ACTION_ACTIVATE_VOLUME (0x11)
86#define MPI_RAID_ACTION_INACTIVATE_VOLUME (0x12) 90#define MPI_RAID_ACTION_INACTIVATE_VOLUME (0x12)
91#define MPI_RAID_ACTION_SET_RESYNC_RATE (0x13)
92#define MPI_RAID_ACTION_SET_DATA_SCRUB_RATE (0x14)
87 93
88/* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */ 94/* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */
89#define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001) 95#define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001)
@@ -99,6 +105,13 @@ typedef struct _MSG_RAID_ACTION
99/* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */ 105/* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */
100#define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL (0x00000001) 106#define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL (0x00000001)
101 107
108/* ActionDataWord defines for use with MPI_RAID_ACTION_SET_RESYNC_RATE action */
109#define MPI_RAID_ACTION_ADATA_RESYNC_RATE_MASK (0x000000FF)
110
111/* ActionDataWord defines for use with MPI_RAID_ACTION_SET_DATA_SCRUB_RATE action */
112#define MPI_RAID_ACTION_ADATA_DATA_SCRUB_RATE_MASK (0x000000FF)
113
114
102 115
103/* RAID Action reply message */ 116/* RAID Action reply message */
104 117
diff --git a/drivers/message/fusion/lsi/mpi_sas.h b/drivers/message/fusion/lsi/mpi_sas.h
index cb878f9c65de..230fa69b5353 100644
--- a/drivers/message/fusion/lsi/mpi_sas.h
+++ b/drivers/message/fusion/lsi/mpi_sas.h
@@ -1,25 +1,76 @@
1/* 1/*
2 * Copyright (c) 2003 LSI Logic Corporation. 2 * Copyright (c) 2004 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_sas.h 5 * Name: mpi_sas.h
6 * Title: MPI Serial Attached SCSI structures and definitions 6 * Title: MPI Serial Attached SCSI structures and definitions
7 * Creation Date: April 23, 2003 7 * Creation Date: August 19, 2004
8 * 8 *
9 * mpi_sas.h Version: 01.05.xx 9 * mpi_sas.h Version: 01.05.01
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
13 * 13 *
14 * Date Version Description 14 * Date Version Description
15 * -------- -------- ------------------------------------------------------ 15 * -------- -------- ------------------------------------------------------
16 * xx-yy-zz 01.05.01 Original release. 16 * 08-19-04 01.05.01 Original release.
17 * -------------------------------------------------------------------------- 17 * --------------------------------------------------------------------------
18 */ 18 */
19 19
20#ifndef MPI_SAS_H 20#ifndef MPI_SAS_H
21#define MPI_SAS_H 21#define MPI_SAS_H
22 22
23
24/*
25 * Values for SASStatus.
26 */
27#define MPI_SASSTATUS_SUCCESS (0x00)
28#define MPI_SASSTATUS_UNKNOWN_ERROR (0x01)
29#define MPI_SASSTATUS_INVALID_FRAME (0x02)
30#define MPI_SASSTATUS_UTC_BAD_DEST (0x03)
31#define MPI_SASSTATUS_UTC_BREAK_RECEIVED (0x04)
32#define MPI_SASSTATUS_UTC_CONNECT_RATE_NOT_SUPPORTED (0x05)
33#define MPI_SASSTATUS_UTC_PORT_LAYER_REQUEST (0x06)
34#define MPI_SASSTATUS_UTC_PROTOCOL_NOT_SUPPORTED (0x07)
35#define MPI_SASSTATUS_UTC_STP_RESOURCES_BUSY (0x08)
36#define MPI_SASSTATUS_UTC_WRONG_DESTINATION (0x09)
37#define MPI_SASSTATUS_SHORT_INFORMATION_UNIT (0x0A)
38#define MPI_SASSTATUS_LONG_INFORMATION_UNIT (0x0B)
39#define MPI_SASSTATUS_XFER_RDY_INCORRECT_WRITE_DATA (0x0C)
40#define MPI_SASSTATUS_XFER_RDY_REQUEST_OFFSET_ERROR (0x0D)
41#define MPI_SASSTATUS_XFER_RDY_NOT_EXPECTED (0x0E)
42#define MPI_SASSTATUS_DATA_INCORRECT_DATA_LENGTH (0x0F)
43#define MPI_SASSTATUS_DATA_TOO_MUCH_READ_DATA (0x10)
44#define MPI_SASSTATUS_DATA_OFFSET_ERROR (0x11)
45#define MPI_SASSTATUS_SDSF_NAK_RECEIVED (0x12)
46#define MPI_SASSTATUS_SDSF_CONNECTION_FAILED (0x13)
47#define MPI_SASSTATUS_INITIATOR_RESPONSE_TIMEOUT (0x14)
48
49
50/*
51 * Values for the SAS DeviceInfo field used in SAS Device Status Change Event
52 * data and SAS IO Unit Configuration pages.
53 */
54#define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000)
55#define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000)
56#define MPI_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800)
57#define MPI_SAS_DEVICE_INFO_SSP_TARGET (0x00000400)
58#define MPI_SAS_DEVICE_INFO_STP_TARGET (0x00000200)
59#define MPI_SAS_DEVICE_INFO_SMP_TARGET (0x00000100)
60#define MPI_SAS_DEVICE_INFO_SATA_DEVICE (0x00000080)
61#define MPI_SAS_DEVICE_INFO_SSP_INITIATOR (0x00000040)
62#define MPI_SAS_DEVICE_INFO_STP_INITIATOR (0x00000020)
63#define MPI_SAS_DEVICE_INFO_SMP_INITIATOR (0x00000010)
64#define MPI_SAS_DEVICE_INFO_SATA_HOST (0x00000008)
65
66#define MPI_SAS_DEVICE_INFO_MASK_DEVICE_TYPE (0x00000007)
67#define MPI_SAS_DEVICE_INFO_NO_DEVICE (0x00000000)
68#define MPI_SAS_DEVICE_INFO_END_DEVICE (0x00000001)
69#define MPI_SAS_DEVICE_INFO_EDGE_EXPANDER (0x00000002)
70#define MPI_SAS_DEVICE_INFO_FANOUT_EXPANDER (0x00000003)
71
72
73
23/***************************************************************************** 74/*****************************************************************************
24* 75*
25* S e r i a l A t t a c h e d S C S I M e s s a g e s 76* S e r i a l A t t a c h e d S C S I M e s s a g e s
@@ -48,8 +99,10 @@ typedef struct _MSG_SMP_PASSTHROUGH_REQUEST
48} MSG_SMP_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REQUEST, 99} MSG_SMP_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REQUEST,
49 SmpPassthroughRequest_t, MPI_POINTER pSmpPassthroughRequest_t; 100 SmpPassthroughRequest_t, MPI_POINTER pSmpPassthroughRequest_t;
50 101
102/* values for PassthroughFlags field */
51#define MPI_SMP_PT_REQ_PT_FLAGS_IMMEDIATE (0x80) 103#define MPI_SMP_PT_REQ_PT_FLAGS_IMMEDIATE (0x80)
52 104
105/* values for ConnectionRate field */
53#define MPI_SMP_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00) 106#define MPI_SMP_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00)
54#define MPI_SMP_PT_REQ_CONNECT_RATE_1_5 (0x08) 107#define MPI_SMP_PT_REQ_CONNECT_RATE_1_5 (0x08)
55#define MPI_SMP_PT_REQ_CONNECT_RATE_3_0 (0x09) 108#define MPI_SMP_PT_REQ_CONNECT_RATE_3_0 (0x09)
@@ -77,51 +130,69 @@ typedef struct _MSG_SMP_PASSTHROUGH_REPLY
77 130
78#define MPI_SMP_PT_REPLY_PT_FLAGS_IMMEDIATE (0x80) 131#define MPI_SMP_PT_REPLY_PT_FLAGS_IMMEDIATE (0x80)
79 132
80/* values for the SASStatus field */
81#define MPI_SASSTATUS_SUCCESS (0x00)
82#define MPI_SASSTATUS_UNKNOWN_ERROR (0x01)
83#define MPI_SASSTATUS_INVALID_FRAME (0x02)
84#define MPI_SASSTATUS_UTC_BAD_DEST (0x03)
85#define MPI_SASSTATUS_UTC_BREAK_RECEIVED (0x04)
86#define MPI_SASSTATUS_UTC_CONNECT_RATE_NOT_SUPPORTED (0x05)
87#define MPI_SASSTATUS_UTC_PORT_LAYER_REQUEST (0x06)
88#define MPI_SASSTATUS_UTC_PROTOCOL_NOT_SUPPORTED (0x07)
89#define MPI_SASSTATUS_UTC_STP_RESOURCES_BUSY (0x08)
90#define MPI_SASSTATUS_UTC_WRONG_DESTINATION (0x09)
91#define MPI_SASSTATUS_SHORT_INFORMATION_UNIT (0x0A)
92#define MPI_SASSTATUS_LONG_INFORMATION_UNIT (0x0B)
93#define MPI_SASSTATUS_XFER_RDY_INCORRECT_WRITE_DATA (0x0C)
94#define MPI_SASSTATUS_XFER_RDY_REQUEST_OFFSET_ERROR (0x0D)
95#define MPI_SASSTATUS_XFER_RDY_NOT_EXPECTED (0x0E)
96#define MPI_SASSTATUS_DATA_INCORRECT_DATA_LENGTH (0x0F)
97#define MPI_SASSTATUS_DATA_TOO_MUCH_READ_DATA (0x10)
98#define MPI_SASSTATUS_DATA_OFFSET_ERROR (0x11)
99#define MPI_SASSTATUS_SDSF_NAK_RECEIVED (0x12)
100#define MPI_SASSTATUS_SDSF_CONNECTION_FAILED (0x13)
101#define MPI_SASSTATUS_INITIATOR_RESPONSE_TIMEOUT (0x14)
102 133
134/****************************************************************************/
135/* SATA Passthrough Request */
136/****************************************************************************/
137
138typedef struct _MSG_SATA_PASSTHROUGH_REQUEST
139{
140 U8 TargetID; /* 00h */
141 U8 Bus; /* 01h */
142 U8 ChainOffset; /* 02h */
143 U8 Function; /* 03h */
144 U16 PassthroughFlags; /* 04h */
145 U8 ConnectionRate; /* 06h */
146 U8 MsgFlags; /* 07h */
147 U32 MsgContext; /* 08h */
148 U32 Reserved1; /* 0Ch */
149 U32 Reserved2; /* 10h */
150 U32 Reserved3; /* 14h */
151 U32 DataLength; /* 18h */
152 U8 CommandFIS[20]; /* 1Ch */
153 SGE_SIMPLE_UNION SGL; /* 30h */
154} MSG_SATA_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REQUEST,
155 SataPassthroughRequest_t, MPI_POINTER pSataPassthroughRequest_t;
156
157/* values for PassthroughFlags field */
158#define MPI_SATA_PT_REQ_PT_FLAGS_RESET_DEVICE (0x0200)
159#define MPI_SATA_PT_REQ_PT_FLAGS_EXECUTE_DIAG (0x0100)
160#define MPI_SATA_PT_REQ_PT_FLAGS_DMA_QUEUED (0x0080)
161#define MPI_SATA_PT_REQ_PT_FLAGS_PACKET_COMMAND (0x0040)
162#define MPI_SATA_PT_REQ_PT_FLAGS_DMA (0x0020)
163#define MPI_SATA_PT_REQ_PT_FLAGS_PIO (0x0010)
164#define MPI_SATA_PT_REQ_PT_FLAGS_UNSPECIFIED_VU (0x0004)
165#define MPI_SATA_PT_REQ_PT_FLAGS_WRITE (0x0002)
166#define MPI_SATA_PT_REQ_PT_FLAGS_READ (0x0001)
167
168/* values for ConnectionRate field */
169#define MPI_SATA_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00)
170#define MPI_SATA_PT_REQ_CONNECT_RATE_1_5 (0x08)
171#define MPI_SATA_PT_REQ_CONNECT_RATE_3_0 (0x09)
172
173
174/* SATA Passthrough Reply */
175typedef struct _MSG_SATA_PASSTHROUGH_REPLY
176{
177 U8 TargetID; /* 00h */
178 U8 Bus; /* 01h */
179 U8 MsgLength; /* 02h */
180 U8 Function; /* 03h */
181 U16 PassthroughFlags; /* 04h */
182 U8 Reserved1; /* 06h */
183 U8 MsgFlags; /* 07h */
184 U32 MsgContext; /* 08h */
185 U8 Reserved2; /* 0Ch */
186 U8 SASStatus; /* 0Dh */
187 U16 IOCStatus; /* 0Eh */
188 U32 IOCLogInfo; /* 10h */
189 U8 StatusFIS[20]; /* 14h */
190 U32 StatusControlRegisters; /* 28h */
191 U32 TransferCount; /* 2Ch */
192} MSG_SATA_PASSTHROUGH_REPLY, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REPLY,
193 SataPassthroughReply_t, MPI_POINTER pSataPassthroughReply_t;
103 194
104/*
105 * Values for the SAS DeviceInfo field used in SAS Device Status Change Event
106 * data and SAS IO Unit Configuration pages.
107 */
108#define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000)
109#define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000)
110#define MPI_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800)
111#define MPI_SAS_DEVICE_INFO_SSP_TARGET (0x00000400)
112#define MPI_SAS_DEVICE_INFO_STP_TARGET (0x00000200)
113#define MPI_SAS_DEVICE_INFO_SMP_TARGET (0x00000100)
114#define MPI_SAS_DEVICE_INFO_SATA_DEVICE (0x00000080)
115#define MPI_SAS_DEVICE_INFO_SSP_INITIATOR (0x00000040)
116#define MPI_SAS_DEVICE_INFO_STP_INITIATOR (0x00000020)
117#define MPI_SAS_DEVICE_INFO_SMP_INITIATOR (0x00000010)
118#define MPI_SAS_DEVICE_INFO_SATA_HOST (0x00000008)
119 195
120#define MPI_SAS_DEVICE_INFO_MASK_DEVICE_TYPE (0x00000007)
121#define MPI_SAS_DEVICE_INFO_NO_DEVICE (0x00000000)
122#define MPI_SAS_DEVICE_INFO_END_DEVICE (0x00000001)
123#define MPI_SAS_DEVICE_INFO_EDGE_EXPANDER (0x00000002)
124#define MPI_SAS_DEVICE_INFO_FANOUT_EXPANDER (0x00000003)
125 196
126 197
127/****************************************************************************/ 198/****************************************************************************/
@@ -148,15 +219,13 @@ typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST
148} MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST, 219} MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST,
149 SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t; 220 SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t;
150 221
151/* values for the ... field */ 222/* values for the Operation field */
152#define MPI_SAS_OP_CLEAR_NOT_PRESENT (0x01) 223#define MPI_SAS_OP_CLEAR_NOT_PRESENT (0x01)
153#define MPI_SAS_OP_CLEAR_ALL (0x02) 224#define MPI_SAS_OP_CLEAR_ALL_PERSISTENT (0x02)
154#define MPI_SAS_OP_MAP (0x03)
155#define MPI_SAS_OP_MOVE (0x04)
156#define MPI_SAS_OP_CLEAR (0x05)
157#define MPI_SAS_OP_PHY_LINK_RESET (0x06) 225#define MPI_SAS_OP_PHY_LINK_RESET (0x06)
158#define MPI_SAS_OP_PHY_HARD_RESET (0x07) 226#define MPI_SAS_OP_PHY_HARD_RESET (0x07)
159#define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08) 227#define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08)
228#define MPI_SAS_OP_MAP_CURRENT (0x09)
160 229
161 230
162/* SAS IO Unit Control Reply */ 231/* SAS IO Unit Control Reply */
diff --git a/drivers/message/fusion/lsi/mpi_targ.h b/drivers/message/fusion/lsi/mpi_targ.h
index 804dc85426c1..623901fd82be 100644
--- a/drivers/message/fusion/lsi/mpi_targ.h
+++ b/drivers/message/fusion/lsi/mpi_targ.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2004 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_targ.h 5 * Name: mpi_targ.h
6 * Title: MPI Target mode messages and structures 6 * Title: MPI Target mode messages and structures
7 * Creation Date: June 22, 2000 7 * Creation Date: June 22, 2000
8 * 8 *
9 * mpi_targ.h Version: 01.05.xx 9 * mpi_targ.h Version: 01.05.04
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -43,6 +43,16 @@
43 * Added PRIORITY_REASON_TARGET_BUSY. 43 * Added PRIORITY_REASON_TARGET_BUSY.
44 * 11-15-02 01.02.08 Added AliasID field to MPI_TARGET_SCSI_SPI_CMD_BUFFER. 44 * 11-15-02 01.02.08 Added AliasID field to MPI_TARGET_SCSI_SPI_CMD_BUFFER.
45 * 04-01-03 01.02.09 Added OptionalOxid field to MPI_TARGET_FCP_CMD_BUFFER. 45 * 04-01-03 01.02.09 Added OptionalOxid field to MPI_TARGET_FCP_CMD_BUFFER.
46 * 05-11-04 01.03.01 Original release for MPI v1.3.
47 * 08-19-04 01.05.01 Added new request message structures for
48 * MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
49 * MSG_TARGET_CMD_BUF_POST_LIST_REQUEST, and
50 * MSG_TARGET_ASSIST_EXT_REQUEST.
51 * Added new structures for SAS SSP Command buffer, SSP
52 * Task buffer, and SSP Status IU.
53 * 10-05-04 01.05.02 MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY added.
54 * 02-22-05 01.05.03 Changed a comment.
55 * 03-11-05 01.05.04 Removed TargetAssistExtended Request.
46 * -------------------------------------------------------------------------- 56 * --------------------------------------------------------------------------
47 */ 57 */
48 58
@@ -133,6 +143,25 @@ typedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY
133} MSG_PRIORITY_CMD_RECEIVED_REPLY, MPI_POINTER PTR_MSG_PRIORITY_CMD_RECEIVED_REPLY, 143} MSG_PRIORITY_CMD_RECEIVED_REPLY, MPI_POINTER PTR_MSG_PRIORITY_CMD_RECEIVED_REPLY,
134 PriorityCommandReceivedReply_t, MPI_POINTER pPriorityCommandReceivedReply_t; 144 PriorityCommandReceivedReply_t, MPI_POINTER pPriorityCommandReceivedReply_t;
135 145
146
147typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY
148{
149 U16 Reserved; /* 00h */
150 U8 MsgLength; /* 02h */
151 U8 Function; /* 03h */
152 U16 Reserved1; /* 04h */
153 U8 Reserved2; /* 06h */
154 U8 MsgFlags; /* 07h */
155 U32 MsgContext; /* 08h */
156 U8 PriorityReason; /* 0Ch */
157 U8 Reserved3; /* 0Dh */
158 U16 IOCStatus; /* 0Eh */
159 U32 IOCLogInfo; /* 10h */
160 U32 ReplyWord; /* 14h */
161} MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
162 MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
163 TargetCmdBufferPostErrorReply_t, MPI_POINTER pTargetCmdBufferPostErrorReply_t;
164
136#define PRIORITY_REASON_NO_DISCONNECT (0x00) 165#define PRIORITY_REASON_NO_DISCONNECT (0x00)
137#define PRIORITY_REASON_SCSI_TASK_MANAGEMENT (0x01) 166#define PRIORITY_REASON_SCSI_TASK_MANAGEMENT (0x01)
138#define PRIORITY_REASON_CMD_PARITY_ERR (0x02) 167#define PRIORITY_REASON_CMD_PARITY_ERR (0x02)
@@ -146,7 +175,34 @@ typedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY
146#define PRIORITY_REASON_UNKNOWN (0xFF) 175#define PRIORITY_REASON_UNKNOWN (0xFF)
147 176
148 177
149typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY 178/****************************************************************************/
179/* Target Command Buffer Post Base Request */
180/****************************************************************************/
181
182typedef struct _MSG_TARGET_CMD_BUF_POST_BASE_REQUEST
183{
184 U8 BufferPostFlags; /* 00h */
185 U8 PortNumber; /* 01h */
186 U8 ChainOffset; /* 02h */
187 U8 Function; /* 03h */
188 U16 TotalCmdBuffers; /* 04h */
189 U8 Reserved; /* 06h */
190 U8 MsgFlags; /* 07h */
191 U32 MsgContext; /* 08h */
192 U32 Reserved1; /* 0Ch */
193 U16 CmdBufferLength; /* 10h */
194 U16 NextCmdBufferOffset; /* 12h */
195 U32 BaseAddressLow; /* 14h */
196 U32 BaseAddressHigh; /* 18h */
197} MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
198 MPI_POINTER PTR__MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
199 TargetCmdBufferPostBaseRequest_t,
200 MPI_POINTER pTargetCmdBufferPostBaseRequest_t;
201
202#define CMD_BUFFER_POST_BASE_FLAGS_AUTO_POST_ALL (0x01)
203
204
205typedef struct _MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY
150{ 206{
151 U16 Reserved; /* 00h */ 207 U16 Reserved; /* 00h */
152 U8 MsgLength; /* 02h */ 208 U8 MsgLength; /* 02h */
@@ -155,16 +211,41 @@ typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY
155 U8 Reserved2; /* 06h */ 211 U8 Reserved2; /* 06h */
156 U8 MsgFlags; /* 07h */ 212 U8 MsgFlags; /* 07h */
157 U32 MsgContext; /* 08h */ 213 U32 MsgContext; /* 08h */
158 U8 PriorityReason; /* 0Ch */ 214 U16 Reserved3; /* 0Ch */
159 U8 Reserved3; /* 0Dh */
160 U16 IOCStatus; /* 0Eh */ 215 U16 IOCStatus; /* 0Eh */
161 U32 IOCLogInfo; /* 10h */ 216 U32 IOCLogInfo; /* 10h */
162 U32 ReplyWord; /* 14h */ 217} MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,
163} MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY, 218 MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,
164 MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY, 219 TargetCmdBufferPostBaseListReply_t,
165 TargetCmdBufferPostErrorReply_t, MPI_POINTER pTargetCmdBufferPostErrorReply_t; 220 MPI_POINTER pTargetCmdBufferPostBaseListReply_t;
221
222
223/****************************************************************************/
224/* Target Command Buffer Post List Request */
225/****************************************************************************/
226
227typedef struct _MSG_TARGET_CMD_BUF_POST_LIST_REQUEST
228{
229 U8 Reserved; /* 00h */
230 U8 PortNumber; /* 01h */
231 U8 ChainOffset; /* 02h */
232 U8 Function; /* 03h */
233 U16 CmdBufferCount; /* 04h */
234 U8 Reserved1; /* 06h */
235 U8 MsgFlags; /* 07h */
236 U32 MsgContext; /* 08h */
237 U32 Reserved2; /* 0Ch */
238 U16 IoIndex[2]; /* 10h */
239} MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,
240 MPI_POINTER PTR_MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,
241 TargetCmdBufferPostListRequest_t,
242 MPI_POINTER pTargetCmdBufferPostListRequest_t;
166 243
167 244
245/****************************************************************************/
246/* Command Buffer Formats (with 16 byte CDB) */
247/****************************************************************************/
248
168typedef struct _MPI_TARGET_FCP_CMD_BUFFER 249typedef struct _MPI_TARGET_FCP_CMD_BUFFER
169{ 250{
170 U8 FcpLun[8]; /* 00h */ 251 U8 FcpLun[8]; /* 00h */
@@ -201,6 +282,46 @@ typedef struct _MPI_TARGET_SCSI_SPI_CMD_BUFFER
201 MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer; 282 MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer;
202 283
203 284
285typedef struct _MPI_TARGET_SSP_CMD_BUFFER
286{
287 U8 FrameType; /* 00h */
288 U8 Reserved1; /* 01h */
289 U16 Reserved2; /* 02h */
290 U16 InitiatorTag; /* 04h */
291 U16 DevHandle; /* 06h */
292 /* COMMAND information unit starts here */
293 U8 LogicalUnitNumber[8]; /* 08h */
294 U8 Reserved3; /* 10h */
295 U8 TaskAttribute; /* lower 3 bits */ /* 11h */
296 U8 Reserved4; /* 12h */
297 U8 AdditionalCDBLength; /* upper 5 bits */ /* 13h */
298 U8 CDB[16]; /* 14h */
299 /* Additional CDB bytes extend past the CDB field */
300} MPI_TARGET_SSP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_CMD_BUFFER,
301 MpiTargetSspCmdBuffer, MPI_POINTER pMpiTargetSspCmdBuffer;
302
303typedef struct _MPI_TARGET_SSP_TASK_BUFFER
304{
305 U8 FrameType; /* 00h */
306 U8 Reserved1; /* 01h */
307 U16 Reserved2; /* 02h */
308 U16 InitiatorTag; /* 04h */
309 U16 DevHandle; /* 06h */
310 /* TASK information unit starts here */
311 U8 LogicalUnitNumber[8]; /* 08h */
312 U8 Reserved3; /* 10h */
313 U8 Reserved4; /* 11h */
314 U8 TaskManagementFunction; /* 12h */
315 U8 Reserved5; /* 13h */
316 U16 ManagedTaskTag; /* 14h */
317 U16 Reserved6; /* 16h */
318 U32 Reserved7; /* 18h */
319 U32 Reserved8; /* 1Ch */
320 U32 Reserved9; /* 20h */
321} MPI_TARGET_SSP_TASK_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_TASK_BUFFER,
322 MpiTargetSspTaskBuffer, MPI_POINTER pMpiTargetSspTaskBuffer;
323
324
204/****************************************************************************/ 325/****************************************************************************/
205/* Target Assist Request */ 326/* Target Assist Request */
206/****************************************************************************/ 327/****************************************************************************/
@@ -308,6 +429,27 @@ typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU
308} MPI_TARGET_SCSI_SPI_STATUS_IU, MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_STATUS_IU, 429} MPI_TARGET_SCSI_SPI_STATUS_IU, MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_STATUS_IU,
309 TargetScsiSpiStatusIU_t, MPI_POINTER pTargetScsiSpiStatusIU_t; 430 TargetScsiSpiStatusIU_t, MPI_POINTER pTargetScsiSpiStatusIU_t;
310 431
432/*
433 * NOTE: The SSP status IU is big-endian. When used on a little-endian system,
434 * this structure properly orders the bytes.
435 */
436typedef struct _MPI_TARGET_SSP_RSP_IU
437{
438 U32 Reserved0[6]; /* reserved for SSP header */ /* 00h */
439 /* start of RESPONSE information unit */
440 U32 Reserved1; /* 18h */
441 U32 Reserved2; /* 1Ch */
442 U16 Reserved3; /* 20h */
443 U8 DataPres; /* lower 2 bits */ /* 22h */
444 U8 Status; /* 23h */
445 U32 Reserved4; /* 24h */
446 U32 SenseDataLength; /* 28h */
447 U32 ResponseDataLength; /* 2Ch */
448 U8 ResponseSenseData[4]; /* 30h */
449} MPI_TARGET_SSP_RSP_IU, MPI_POINTER PTR_MPI_TARGET_SSP_RSP_IU,
450 MpiTargetSspRspIu_t, MPI_POINTER pMpiTargetSspRspIu_t;
451
452
311/****************************************************************************/ 453/****************************************************************************/
312/* Target Mode Abort Request */ 454/* Target Mode Abort Request */
313/****************************************************************************/ 455/****************************************************************************/
diff --git a/drivers/message/fusion/lsi/mpi_tool.h b/drivers/message/fusion/lsi/mpi_tool.h
index 536d197c4142..aa9053da1f58 100644
--- a/drivers/message/fusion/lsi/mpi_tool.h
+++ b/drivers/message/fusion/lsi/mpi_tool.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2001-2003 LSI Logic Corporation. 2 * Copyright (c) 2001-2005 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_tool.h 5 * Name: mpi_tool.h
6 * Title: MPI Toolbox structures and definitions 6 * Title: MPI Toolbox structures and definitions
7 * Creation Date: July 30, 2001 7 * Creation Date: July 30, 2001
8 * 8 *
9 * mpi_tool.h Version: 01.05.xx 9 * mpi_tool.h Version: 01.05.03
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -15,6 +15,16 @@
15 * -------- -------- ------------------------------------------------------ 15 * -------- -------- ------------------------------------------------------
16 * 08-08-01 01.02.01 Original release. 16 * 08-08-01 01.02.01 Original release.
17 * 08-29-01 01.02.02 Added DIAG_DATA_UPLOAD_HEADER and related defines. 17 * 08-29-01 01.02.02 Added DIAG_DATA_UPLOAD_HEADER and related defines.
18 * 01-16-04 01.02.03 Added defines and structures for new tools
19 *. MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL and
20 * MPI_TOOLBOX_FC_MANAGEMENT_TOOL.
21 * 04-29-04 01.02.04 Added message structures for Diagnostic Buffer Post and
22 * Diagnostic Release requests and replies.
23 * 05-11-04 01.03.01 Original release for MPI v1.3.
24 * 08-19-04 01.05.01 Original release for MPI v1.5.
25 * 10-06-04 01.05.02 Added define for MPI_DIAG_BUF_TYPE_COUNT.
26 * 02-09-05 01.05.03 Added frame size option to FC management tool.
27 * Added Beacon tool to the Toolbox.
18 * -------------------------------------------------------------------------- 28 * --------------------------------------------------------------------------
19 */ 29 */
20 30
@@ -26,6 +36,7 @@
26#define MPI_TOOLBOX_DIAG_DATA_UPLOAD_TOOL (0x02) 36#define MPI_TOOLBOX_DIAG_DATA_UPLOAD_TOOL (0x02)
27#define MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL (0x03) 37#define MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL (0x03)
28#define MPI_TOOLBOX_FC_MANAGEMENT_TOOL (0x04) 38#define MPI_TOOLBOX_FC_MANAGEMENT_TOOL (0x04)
39#define MPI_TOOLBOX_BEACON_TOOL (0x05)
29 40
30 41
31/****************************************************************************/ 42/****************************************************************************/
@@ -185,11 +196,21 @@ typedef struct _MPI_TB_FC_MANAGE_PID_AI
185} MPI_TB_FC_MANAGE_PID_AI, MPI_POINTER PTR_MPI_TB_FC_MANAGE_PID_AI, 196} MPI_TB_FC_MANAGE_PID_AI, MPI_POINTER PTR_MPI_TB_FC_MANAGE_PID_AI,
186 MpiTbFcManagePidAi_t, MPI_POINTER pMpiTbFcManagePidAi_t; 197 MpiTbFcManagePidAi_t, MPI_POINTER pMpiTbFcManagePidAi_t;
187 198
199/* ActionInfo for set max frame size */
200typedef struct _MPI_TB_FC_MANAGE_FRAME_SIZE_AI
201{
202 U16 FrameSize; /* 00h */
203 U8 PortNum; /* 02h */
204 U8 Reserved1; /* 03h */
205} MPI_TB_FC_MANAGE_FRAME_SIZE_AI, MPI_POINTER PTR_MPI_TB_FC_MANAGE_FRAME_SIZE_AI,
206 MpiTbFcManageFrameSizeAi_t, MPI_POINTER pMpiTbFcManageFrameSizeAi_t;
207
188/* union of ActionInfo */ 208/* union of ActionInfo */
189typedef union _MPI_TB_FC_MANAGE_AI_UNION 209typedef union _MPI_TB_FC_MANAGE_AI_UNION
190{ 210{
191 MPI_TB_FC_MANAGE_BUS_TID_AI BusTid; 211 MPI_TB_FC_MANAGE_BUS_TID_AI BusTid;
192 MPI_TB_FC_MANAGE_PID_AI Port; 212 MPI_TB_FC_MANAGE_PID_AI Port;
213 MPI_TB_FC_MANAGE_FRAME_SIZE_AI FrameSize;
193} MPI_TB_FC_MANAGE_AI_UNION, MPI_POINTER PTR_MPI_TB_FC_MANAGE_AI_UNION, 214} MPI_TB_FC_MANAGE_AI_UNION, MPI_POINTER PTR_MPI_TB_FC_MANAGE_AI_UNION,
194 MpiTbFcManageAiUnion_t, MPI_POINTER pMpiTbFcManageAiUnion_t; 215 MpiTbFcManageAiUnion_t, MPI_POINTER pMpiTbFcManageAiUnion_t;
195 216
@@ -214,6 +235,32 @@ typedef struct _MSG_TOOLBOX_FC_MANAGE_REQUEST
214#define MPI_TB_FC_MANAGE_ACTION_DISC_ALL (0x00) 235#define MPI_TB_FC_MANAGE_ACTION_DISC_ALL (0x00)
215#define MPI_TB_FC_MANAGE_ACTION_DISC_PID (0x01) 236#define MPI_TB_FC_MANAGE_ACTION_DISC_PID (0x01)
216#define MPI_TB_FC_MANAGE_ACTION_DISC_BUS_TID (0x02) 237#define MPI_TB_FC_MANAGE_ACTION_DISC_BUS_TID (0x02)
238#define MPI_TB_FC_MANAGE_ACTION_SET_MAX_FRAME_SIZE (0x03)
239
240
241/****************************************************************************/
242/* Toolbox Beacon Tool request */
243/****************************************************************************/
244
245typedef struct _MSG_TOOLBOX_BEACON_REQUEST
246{
247 U8 Tool; /* 00h */
248 U8 Reserved; /* 01h */
249 U8 ChainOffset; /* 02h */
250 U8 Function; /* 03h */
251 U16 Reserved1; /* 04h */
252 U8 Reserved2; /* 06h */
253 U8 MsgFlags; /* 07h */
254 U32 MsgContext; /* 08h */
255 U8 ConnectNum; /* 0Ch */
256 U8 PortNum; /* 0Dh */
257 U8 Reserved3; /* 0Eh */
258 U8 Flags; /* 0Fh */
259} MSG_TOOLBOX_BEACON_REQUEST, MPI_POINTER PTR_MSG_TOOLBOX_BEACON_REQUEST,
260 ToolboxBeaconRequest_t, MPI_POINTER pToolboxBeaconRequest_t;
261
262#define MPI_TOOLBOX_FLAGS_BEACON_MODE_OFF (0x00)
263#define MPI_TOOLBOX_FLAGS_BEACON_MODE_ON (0x01)
217 264
218 265
219/****************************************************************************/ 266/****************************************************************************/
@@ -233,14 +280,16 @@ typedef struct _MSG_DIAG_BUFFER_POST_REQUEST
233 U32 ExtendedType; /* 0Ch */ 280 U32 ExtendedType; /* 0Ch */
234 U32 BufferLength; /* 10h */ 281 U32 BufferLength; /* 10h */
235 U32 ProductSpecific[4]; /* 14h */ 282 U32 ProductSpecific[4]; /* 14h */
236 U32 Reserved3; /* 18h */ 283 U32 Reserved3; /* 24h */
237 SGE_SIMPLE_UNION SGL; /* 28h */ 284 U64 BufferAddress; /* 28h */
238} MSG_DIAG_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_DIAG_BUFFER_POST_REQUEST, 285} MSG_DIAG_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_DIAG_BUFFER_POST_REQUEST,
239 DiagBufferPostRequest_t, MPI_POINTER pDiagBufferPostRequest_t; 286 DiagBufferPostRequest_t, MPI_POINTER pDiagBufferPostRequest_t;
240 287
241#define MPI_DIAG_BUF_TYPE_TRACE (0x00) 288#define MPI_DIAG_BUF_TYPE_TRACE (0x00)
242#define MPI_DIAG_BUF_TYPE_SNAPSHOT (0x01) 289#define MPI_DIAG_BUF_TYPE_SNAPSHOT (0x01)
243#define MPI_DIAG_BUF_TYPE_EXTENDED (0x02) 290#define MPI_DIAG_BUF_TYPE_EXTENDED (0x02)
291/* count of the number of buffer types */
292#define MPI_DIAG_BUF_TYPE_COUNT (0x03)
244 293
245#define MPI_DIAG_EXTENDED_QTAG (0x00000001) 294#define MPI_DIAG_EXTENDED_QTAG (0x00000001)
246 295
diff --git a/drivers/message/fusion/lsi/mpi_type.h b/drivers/message/fusion/lsi/mpi_type.h
index 239328a7689c..32cc9b1151b8 100644
--- a/drivers/message/fusion/lsi/mpi_type.h
+++ b/drivers/message/fusion/lsi/mpi_type.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Copyright (c) 2000-2003 LSI Logic Corporation. 2 * Copyright (c) 2000-2004 LSI Logic Corporation.
3 * 3 *
4 * 4 *
5 * Name: mpi_type.h 5 * Name: mpi_type.h
6 * Title: MPI Basic type definitions 6 * Title: MPI Basic type definitions
7 * Creation Date: June 6, 2000 7 * Creation Date: June 6, 2000
8 * 8 *
9 * mpi_type.h Version: 01.05.xx 9 * mpi_type.h Version: 01.05.01
10 * 10 *
11 * Version History 11 * Version History
12 * --------------- 12 * ---------------
@@ -18,6 +18,8 @@
18 * 11-02-00 01.01.01 Original release for post 1.0 work 18 * 11-02-00 01.01.01 Original release for post 1.0 work
19 * 02-20-01 01.01.02 Added define and ifdef for MPI_POINTER. 19 * 02-20-01 01.01.02 Added define and ifdef for MPI_POINTER.
20 * 08-08-01 01.02.01 Original release for v1.2 work. 20 * 08-08-01 01.02.01 Original release for v1.2 work.
21 * 05-11-04 01.03.01 Original release for MPI v1.3.
22 * 08-19-04 01.05.01 Original release for MPI v1.5.
21 * -------------------------------------------------------------------------- 23 * --------------------------------------------------------------------------
22 */ 24 */
23 25
@@ -50,11 +52,6 @@ typedef unsigned short U16;
50typedef int32_t S32; 52typedef int32_t S32;
51typedef u_int32_t U32; 53typedef u_int32_t U32;
52 54
53/*
54 * The only way crap below could work on big-endian boxen would be if it
55 * wasn't used at all.
56 */
57
58typedef struct _S64 55typedef struct _S64
59{ 56{
60 U32 Low; 57 U32 Low;
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 8b22630f1aef..8b623278ccd2 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1,55 +1,13 @@
1/* 1/*
2 * linux/drivers/message/fusion/mptbase.c 2 * linux/drivers/message/fusion/mptbase.c
3 * High performance SCSI + LAN / Fibre Channel device drivers.
4 * This is the Fusion MPT base driver which supports multiple 3 * This is the Fusion MPT base driver which supports multiple
5 * (SCSI + LAN) specialized protocol drivers. 4 * (SCSI + LAN) specialized protocol drivers.
6 * For use with PCI chip/adapter(s): 5 * For use with LSI Logic PCI chip/adapter(s)
7 * LSIFC9xx/LSI409xx Fibre Channel
8 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
9 * 7 *
10 * Credits: 8 * Copyright (c) 1999-2005 LSI Logic Corporation
11 * There are lots of people not mentioned below that deserve credit
12 * and thanks but won't get it here - sorry in advance that you
13 * got overlooked.
14 *
15 * This driver would not exist if not for Alan Cox's development
16 * of the linux i2o driver.
17 *
18 * A special thanks to Noah Romer (LSI Logic) for tons of work
19 * and tough debugging on the LAN driver, especially early on;-)
20 * And to Roger Hickerson (LSI Logic) for tirelessly supporting
21 * this driver project.
22 *
23 * A special thanks to Pamela Delaney (LSI Logic) for tons of work
24 * and countless enhancements while adding support for the 1030
25 * chip family. Pam has been instrumental in the development of
26 * of the 2.xx.xx series fusion drivers, and her contributions are
27 * far too numerous to hope to list in one place.
28 *
29 * All manner of help from Stephen Shirron (LSI Logic):
30 * low-level FC analysis, debug + various fixes in FCxx firmware,
31 * initial port to alpha platform, various driver code optimizations,
32 * being a faithful sounding board on all sorts of issues & ideas,
33 * etc.
34 *
35 * A huge debt of gratitude is owed to David S. Miller (DaveM)
36 * for fixing much of the stupid and broken stuff in the early
37 * driver while porting to sparc64 platform. THANK YOU!
38 *
39 * Special thanks goes to the I2O LAN driver people at the
40 * University of Helsinki, who, unbeknownst to them, provided
41 * the inspiration and initial structure for this driver.
42 *
43 * A really huge debt of gratitude is owed to Eddie C. Dost
44 * for gobs of hard work fixing and optimizing LAN code.
45 * THANK YOU!
46 *
47 * Copyright (c) 1999-2004 LSI Logic Corporation
48 * Originally By: Steven J. Ralston
49 * (mailto:sjralston1@netscape.net)
50 * (mailto:mpt_linux_developer@lsil.com) 9 * (mailto:mpt_linux_developer@lsil.com)
51 * 10 *
52 * $Id: mptbase.c,v 1.126 2002/12/16 15:28:45 pdelaney Exp $
53 */ 11 */
54/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 12/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
55/* 13/*
@@ -101,6 +59,7 @@
101#include <linux/blkdev.h> 59#include <linux/blkdev.h>
102#include <linux/delay.h> 60#include <linux/delay.h>
103#include <linux/interrupt.h> /* needed for in_interrupt() proto */ 61#include <linux/interrupt.h> /* needed for in_interrupt() proto */
62#include <linux/dma-mapping.h>
104#include <asm/io.h> 63#include <asm/io.h>
105#ifdef CONFIG_MTRR 64#ifdef CONFIG_MTRR
106#include <asm/mtrr.h> 65#include <asm/mtrr.h>
@@ -218,41 +177,35 @@ static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info);
218static void mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info); 177static void mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info);
219 178
220/* module entry point */ 179/* module entry point */
221static int __devinit mptbase_probe (struct pci_dev *, const struct pci_device_id *);
222static void __devexit mptbase_remove(struct pci_dev *);
223static void mptbase_shutdown(struct device * );
224static int __init fusion_init (void); 180static int __init fusion_init (void);
225static void __exit fusion_exit (void); 181static void __exit fusion_exit (void);
226 182
227/****************************************************************************
228 * Supported hardware
229 */
230
231static struct pci_device_id mptbase_pci_table[] = {
232 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC909,
233 PCI_ANY_ID, PCI_ANY_ID },
234 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929,
235 PCI_ANY_ID, PCI_ANY_ID },
236 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919,
237 PCI_ANY_ID, PCI_ANY_ID },
238 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929X,
239 PCI_ANY_ID, PCI_ANY_ID },
240 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919X,
241 PCI_ANY_ID, PCI_ANY_ID },
242 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030,
243 PCI_ANY_ID, PCI_ANY_ID },
244 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_1030_53C1035,
245 PCI_ANY_ID, PCI_ANY_ID },
246 {0} /* Terminating entry */
247};
248MODULE_DEVICE_TABLE(pci, mptbase_pci_table);
249
250#define CHIPREG_READ32(addr) readl_relaxed(addr) 183#define CHIPREG_READ32(addr) readl_relaxed(addr)
251#define CHIPREG_READ32_dmasync(addr) readl(addr) 184#define CHIPREG_READ32_dmasync(addr) readl(addr)
252#define CHIPREG_WRITE32(addr,val) writel(val, addr) 185#define CHIPREG_WRITE32(addr,val) writel(val, addr)
253#define CHIPREG_PIO_WRITE32(addr,val) outl(val, (unsigned long)addr) 186#define CHIPREG_PIO_WRITE32(addr,val) outl(val, (unsigned long)addr)
254#define CHIPREG_PIO_READ32(addr) inl((unsigned long)addr) 187#define CHIPREG_PIO_READ32(addr) inl((unsigned long)addr)
255 188
189static void
190pci_disable_io_access(struct pci_dev *pdev)
191{
192 u16 command_reg;
193
194 pci_read_config_word(pdev, PCI_COMMAND, &command_reg);
195 command_reg &= ~1;
196 pci_write_config_word(pdev, PCI_COMMAND, command_reg);
197}
198
199static void
200pci_enable_io_access(struct pci_dev *pdev)
201{
202 u16 command_reg;
203
204 pci_read_config_word(pdev, PCI_COMMAND, &command_reg);
205 command_reg |= 1;
206 pci_write_config_word(pdev, PCI_COMMAND, command_reg);
207}
208
256/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 209/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
257/* 210/*
258 * mpt_interrupt - MPT adapter (IOC) specific interrupt handler. 211 * mpt_interrupt - MPT adapter (IOC) specific interrupt handler.
@@ -330,8 +283,7 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
330 ioc->name, mr, req_idx)); 283 ioc->name, mr, req_idx));
331 DBG_DUMP_REPLY_FRAME(mr) 284 DBG_DUMP_REPLY_FRAME(mr)
332 285
333 /* NEW! 20010301 -sralston 286 /* Check/log IOC log info
334 * Check/log IOC log info
335 */ 287 */
336 ioc_stat = le16_to_cpu(mr->u.reply.IOCStatus); 288 ioc_stat = le16_to_cpu(mr->u.reply.IOCStatus);
337 if (ioc_stat & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) { 289 if (ioc_stat & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) {
@@ -357,9 +309,7 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
357 mr = (MPT_FRAME_HDR *) CAST_U32_TO_PTR(pa); 309 mr = (MPT_FRAME_HDR *) CAST_U32_TO_PTR(pa);
358 } else if (type == MPI_CONTEXT_REPLY_TYPE_LAN) { 310 } else if (type == MPI_CONTEXT_REPLY_TYPE_LAN) {
359 cb_idx = mpt_lan_index; 311 cb_idx = mpt_lan_index;
360 /* 312 /* Blind set of mf to NULL here was fatal
361 * BUG FIX! 20001218 -sralston
362 * Blind set of mf to NULL here was fatal
363 * after lan_reply says "freeme" 313 * after lan_reply says "freeme"
364 * Fix sort of combined with an optimization here; 314 * Fix sort of combined with an optimization here;
365 * added explicit check for case where lan_reply 315 * added explicit check for case where lan_reply
@@ -430,15 +380,8 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
430 } 380 }
431 381
432 if (freeme) { 382 if (freeme) {
433 unsigned long flags;
434
435 /* Put Request back on FreeQ! */ 383 /* Put Request back on FreeQ! */
436 spin_lock_irqsave(&ioc->FreeQlock, flags); 384 mpt_free_msg_frame(ioc, mf);
437 list_add_tail(&mf->u.frame.linkage.list, &ioc->FreeQ);
438#ifdef MFCNT
439 ioc->mfcnt--;
440#endif
441 spin_unlock_irqrestore(&ioc->FreeQlock, flags);
442 } 385 }
443 386
444 mb(); 387 mb();
@@ -725,11 +668,9 @@ int
725mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx) 668mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx)
726{ 669{
727 MPT_ADAPTER *ioc; 670 MPT_ADAPTER *ioc;
728 int error=0;
729 671
730 if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS) { 672 if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS) {
731 error= -EINVAL; 673 return -EINVAL;
732 return error;
733 } 674 }
734 675
735 MptDeviceDriverHandlers[cb_idx] = dd_cbfunc; 676 MptDeviceDriverHandlers[cb_idx] = dd_cbfunc;
@@ -737,14 +678,12 @@ mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx)
737 /* call per pci device probe entry point */ 678 /* call per pci device probe entry point */
738 list_for_each_entry(ioc, &ioc_list, list) { 679 list_for_each_entry(ioc, &ioc_list, list) {
739 if(dd_cbfunc->probe) { 680 if(dd_cbfunc->probe) {
740 error = dd_cbfunc->probe(ioc->pcidev, 681 dd_cbfunc->probe(ioc->pcidev,
741 ioc->pcidev->driver->id_table); 682 ioc->pcidev->driver->id_table);
742 if(error != 0)
743 return error;
744 } 683 }
745 } 684 }
746 685
747 return error; 686 return 0;
748} 687}
749 688
750/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 689/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -809,8 +748,8 @@ mpt_get_msg_frame(int handle, MPT_ADAPTER *ioc)
809 mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle; /* byte */ 748 mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle; /* byte */
810 req_offset = (u8 *)mf - (u8 *)ioc->req_frames; 749 req_offset = (u8 *)mf - (u8 *)ioc->req_frames;
811 /* u16! */ 750 /* u16! */
812 req_idx = cpu_to_le16(req_offset / ioc->req_sz); 751 req_idx = req_offset / ioc->req_sz;
813 mf->u.frame.hwhdr.msgctxu.fld.req_idx = req_idx; 752 mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_idx);
814 mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0; 753 mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0;
815 ioc->RequestNB[req_idx] = ioc->NB_for_64_byte_frame; /* Default, will be changed if necessary in SG generation */ 754 ioc->RequestNB[req_idx] = ioc->NB_for_64_byte_frame; /* Default, will be changed if necessary in SG generation */
816#ifdef MFCNT 755#ifdef MFCNT
@@ -856,8 +795,8 @@ mpt_put_msg_frame(int handle, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf)
856 mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle; /* byte */ 795 mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle; /* byte */
857 req_offset = (u8 *)mf - (u8 *)ioc->req_frames; 796 req_offset = (u8 *)mf - (u8 *)ioc->req_frames;
858 /* u16! */ 797 /* u16! */
859 req_idx = cpu_to_le16(req_offset / ioc->req_sz); 798 req_idx = req_offset / ioc->req_sz;
860 mf->u.frame.hwhdr.msgctxu.fld.req_idx = req_idx; 799 mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_idx);
861 mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0; 800 mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0;
862 801
863#ifdef MPT_DEBUG_MSG_FRAME 802#ifdef MPT_DEBUG_MSG_FRAME
@@ -1058,7 +997,7 @@ mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp)
1058 997
1059/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 998/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1060/* 999/*
1061 * mptbase_probe - Install a PCI intelligent MPT adapter. 1000 * mpt_attach - Install a PCI intelligent MPT adapter.
1062 * @pdev: Pointer to pci_dev structure 1001 * @pdev: Pointer to pci_dev structure
1063 * 1002 *
1064 * This routine performs all the steps necessary to bring the IOC of 1003 * This routine performs all the steps necessary to bring the IOC of
@@ -1073,8 +1012,8 @@ mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp)
1073 * 1012 *
1074 * TODO: Add support for polled controllers 1013 * TODO: Add support for polled controllers
1075 */ 1014 */
1076static int __devinit 1015int
1077mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id) 1016mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1078{ 1017{
1079 MPT_ADAPTER *ioc; 1018 MPT_ADAPTER *ioc;
1080 u8 __iomem *mem; 1019 u8 __iomem *mem;
@@ -1084,7 +1023,6 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1084 u32 psize; 1023 u32 psize;
1085 int ii; 1024 int ii;
1086 int r = -ENODEV; 1025 int r = -ENODEV;
1087 u64 mask = 0xffffffffffffffffULL;
1088 u8 revision; 1026 u8 revision;
1089 u8 pcixcmd; 1027 u8 pcixcmd;
1090 static int mpt_ids = 0; 1028 static int mpt_ids = 0;
@@ -1097,15 +1035,15 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1097 1035
1098 dinitprintk((KERN_WARNING MYNAM ": mpt_adapter_install\n")); 1036 dinitprintk((KERN_WARNING MYNAM ": mpt_adapter_install\n"));
1099 1037
1100 if (!pci_set_dma_mask(pdev, mask)) { 1038 if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
1101 dprintk((KERN_INFO MYNAM 1039 dprintk((KERN_INFO MYNAM
1102 ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n")); 1040 ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n"));
1103 } else if (pci_set_dma_mask(pdev, (u64) 0xffffffff)) { 1041 } else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
1104 printk(KERN_WARNING MYNAM ": 32 BIT PCI BUS DMA ADDRESSING NOT SUPPORTED\n"); 1042 printk(KERN_WARNING MYNAM ": 32 BIT PCI BUS DMA ADDRESSING NOT SUPPORTED\n");
1105 return r; 1043 return r;
1106 } 1044 }
1107 1045
1108 if (!pci_set_consistent_dma_mask(pdev, mask)) 1046 if (!pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK))
1109 dprintk((KERN_INFO MYNAM 1047 dprintk((KERN_INFO MYNAM
1110 ": Using 64 bit consistent mask\n")); 1048 ": Using 64 bit consistent mask\n"));
1111 else 1049 else
@@ -1243,6 +1181,16 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1243 pcixcmd &= 0x8F; 1181 pcixcmd &= 0x8F;
1244 pci_write_config_byte(pdev, 0x6a, pcixcmd); 1182 pci_write_config_byte(pdev, 0x6a, pcixcmd);
1245 } 1183 }
1184 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC939X) {
1185 ioc->prod_name = "LSIFC939X";
1186 ioc->bus_type = FC;
1187 ioc->errata_flag_1064 = 1;
1188 }
1189 else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC949X) {
1190 ioc->prod_name = "LSIFC949X";
1191 ioc->bus_type = FC;
1192 ioc->errata_flag_1064 = 1;
1193 }
1246 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_53C1030) { 1194 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_53C1030) {
1247 ioc->prod_name = "LSI53C1030"; 1195 ioc->prod_name = "LSI53C1030";
1248 ioc->bus_type = SCSI; 1196 ioc->bus_type = SCSI;
@@ -1261,6 +1209,9 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1261 ioc->bus_type = SCSI; 1209 ioc->bus_type = SCSI;
1262 } 1210 }
1263 1211
1212 if (ioc->errata_flag_1064)
1213 pci_disable_io_access(pdev);
1214
1264 sprintf(ioc->name, "ioc%d", ioc->id); 1215 sprintf(ioc->name, "ioc%d", ioc->id);
1265 1216
1266 spin_lock_init(&ioc->FreeQlock); 1217 spin_lock_init(&ioc->FreeQlock);
@@ -1303,8 +1254,7 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1303#endif 1254#endif
1304 } 1255 }
1305 1256
1306 /* NEW! 20010220 -sralston 1257 /* Check for "bound ports" (929, 929X, 1030, 1035) to reduce redundant resets.
1307 * Check for "bound ports" (929, 929X, 1030, 1035) to reduce redundant resets.
1308 */ 1258 */
1309 mpt_detect_bound_ports(ioc, pdev); 1259 mpt_detect_bound_ports(ioc, pdev);
1310 1260
@@ -1354,13 +1304,13 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1354 1304
1355/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1305/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1356/* 1306/*
1357 * mptbase_remove - Remove a PCI intelligent MPT adapter. 1307 * mpt_detach - Remove a PCI intelligent MPT adapter.
1358 * @pdev: Pointer to pci_dev structure 1308 * @pdev: Pointer to pci_dev structure
1359 * 1309 *
1360 */ 1310 */
1361 1311
1362static void __devexit 1312void
1363mptbase_remove(struct pci_dev *pdev) 1313mpt_detach(struct pci_dev *pdev)
1364{ 1314{
1365 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 1315 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
1366 char pname[32]; 1316 char pname[32];
@@ -1397,43 +1347,21 @@ mptbase_remove(struct pci_dev *pdev)
1397 pci_set_drvdata(pdev, NULL); 1347 pci_set_drvdata(pdev, NULL);
1398} 1348}
1399 1349
1400/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1401/*
1402 * mptbase_shutdown -
1403 *
1404 */
1405static void
1406mptbase_shutdown(struct device * dev)
1407{
1408 int ii;
1409
1410 /* call per device driver shutdown entry point */
1411 for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
1412 if(MptDeviceDriverHandlers[ii] &&
1413 MptDeviceDriverHandlers[ii]->shutdown) {
1414 MptDeviceDriverHandlers[ii]->shutdown(dev);
1415 }
1416 }
1417
1418}
1419
1420
1421/************************************************************************** 1350/**************************************************************************
1422 * Power Management 1351 * Power Management
1423 */ 1352 */
1424#ifdef CONFIG_PM 1353#ifdef CONFIG_PM
1425/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1354/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1426/* 1355/*
1427 * mptbase_suspend - Fusion MPT base driver suspend routine. 1356 * mpt_suspend - Fusion MPT base driver suspend routine.
1428 * 1357 *
1429 * 1358 *
1430 */ 1359 */
1431static int 1360int
1432mptbase_suspend(struct pci_dev *pdev, pm_message_t state) 1361mpt_suspend(struct pci_dev *pdev, pm_message_t state)
1433{ 1362{
1434 u32 device_state; 1363 u32 device_state;
1435 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 1364 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
1436 int ii;
1437 1365
1438 switch(state) 1366 switch(state)
1439 { 1367 {
@@ -1453,14 +1381,6 @@ mptbase_suspend(struct pci_dev *pdev, pm_message_t state)
1453 "pci-suspend: pdev=0x%p, slot=%s, Entering operating state [D%d]\n", 1381 "pci-suspend: pdev=0x%p, slot=%s, Entering operating state [D%d]\n",
1454 ioc->name, pdev, pci_name(pdev), device_state); 1382 ioc->name, pdev, pci_name(pdev), device_state);
1455 1383
1456 /* call per device driver suspend entry point */
1457 for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
1458 if(MptDeviceDriverHandlers[ii] &&
1459 MptDeviceDriverHandlers[ii]->suspend) {
1460 MptDeviceDriverHandlers[ii]->suspend(pdev, state);
1461 }
1462 }
1463
1464 pci_save_state(pdev); 1384 pci_save_state(pdev);
1465 1385
1466 /* put ioc into READY_STATE */ 1386 /* put ioc into READY_STATE */
@@ -1484,18 +1404,18 @@ mptbase_suspend(struct pci_dev *pdev, pm_message_t state)
1484 1404
1485/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1405/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1486/* 1406/*
1487 * mptbase_resume - Fusion MPT base driver resume routine. 1407 * mpt_resume - Fusion MPT base driver resume routine.
1488 * 1408 *
1489 * 1409 *
1490 */ 1410 */
1491static int 1411int
1492mptbase_resume(struct pci_dev *pdev) 1412mpt_resume(struct pci_dev *pdev)
1493{ 1413{
1494 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 1414 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
1495 u32 device_state = pdev->current_state; 1415 u32 device_state = pdev->current_state;
1496 int recovery_state; 1416 int recovery_state;
1497 int ii; 1417 int ii;
1498 1418
1499 printk(MYIOC_s_INFO_FMT 1419 printk(MYIOC_s_INFO_FMT
1500 "pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n", 1420 "pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n",
1501 ioc->name, pdev, pci_name(pdev), device_state); 1421 ioc->name, pdev, pci_name(pdev), device_state);
@@ -1533,14 +1453,6 @@ mptbase_resume(struct pci_dev *pdev)
1533 "pci-resume: success\n", ioc->name); 1453 "pci-resume: success\n", ioc->name);
1534 } 1454 }
1535 1455
1536 /* call per device driver resume entry point */
1537 for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
1538 if(MptDeviceDriverHandlers[ii] &&
1539 MptDeviceDriverHandlers[ii]->resume) {
1540 MptDeviceDriverHandlers[ii]->resume(pdev);
1541 }
1542 }
1543
1544 return 0; 1456 return 0;
1545} 1457}
1546#endif 1458#endif
@@ -1719,8 +1631,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1719 ioc->alt_ioc->active = 1; 1631 ioc->alt_ioc->active = 1;
1720 } 1632 }
1721 1633
1722 /* NEW! 20010120 -sralston 1634 /* Enable MPT base driver management of EventNotification
1723 * Enable MPT base driver management of EventNotification
1724 * and EventAck handling. 1635 * and EventAck handling.
1725 */ 1636 */
1726 if ((ret == 0) && (!ioc->facts.EventState)) 1637 if ((ret == 0) && (!ioc->facts.EventState))
@@ -1729,9 +1640,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1729 if (ioc->alt_ioc && alt_ioc_ready && !ioc->alt_ioc->facts.EventState) 1640 if (ioc->alt_ioc && alt_ioc_ready && !ioc->alt_ioc->facts.EventState)
1730 (void) SendEventNotification(ioc->alt_ioc, 1); /* 1=Enable EventNotification */ 1641 (void) SendEventNotification(ioc->alt_ioc, 1); /* 1=Enable EventNotification */
1731 1642
1732 /* (Bugzilla:fibrebugs, #513) 1643 /* Add additional "reason" check before call to GetLanConfigPages
1733 * Bug fix (part 2)! 20010905 -sralston
1734 * Add additional "reason" check before call to GetLanConfigPages
1735 * (combined with GetIoUnitPage2 call). This prevents a somewhat 1644 * (combined with GetIoUnitPage2 call). This prevents a somewhat
1736 * recursive scenario; GetLanConfigPages times out, timer expired 1645 * recursive scenario; GetLanConfigPages times out, timer expired
1737 * routine calls HardResetHandler, which calls into here again, 1646 * routine calls HardResetHandler, which calls into here again,
@@ -1829,37 +1738,43 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1829static void 1738static void
1830mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev) 1739mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev)
1831{ 1740{
1832 unsigned int match_lo, match_hi; 1741 struct pci_dev *peer=NULL;
1742 unsigned int slot = PCI_SLOT(pdev->devfn);
1743 unsigned int func = PCI_FUNC(pdev->devfn);
1833 MPT_ADAPTER *ioc_srch; 1744 MPT_ADAPTER *ioc_srch;
1834 1745
1835 match_lo = pdev->devfn-1; 1746 dprintk((MYIOC_s_INFO_FMT "PCI device %s devfn=%x/%x,"
1836 match_hi = pdev->devfn+1; 1747 " searching for devfn match on %x or %x\n",
1837 dprintk((MYIOC_s_INFO_FMT "PCI bus/devfn=%x/%x, searching for devfn match on %x or %x\n", 1748 ioc->name, pci_name(pdev), pdev->devfn,
1838 ioc->name, pdev->bus->number, pdev->devfn, match_lo, match_hi)); 1749 func-1, func+1));
1750
1751 peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func-1));
1752 if (!peer) {
1753 peer = pci_get_slot(pdev->bus, PCI_DEVFN(slot,func+1));
1754 if (!peer)
1755 return;
1756 }
1839 1757
1840 list_for_each_entry(ioc_srch, &ioc_list, list) { 1758 list_for_each_entry(ioc_srch, &ioc_list, list) {
1841 struct pci_dev *_pcidev = ioc_srch->pcidev; 1759 struct pci_dev *_pcidev = ioc_srch->pcidev;
1842 1760 if (_pcidev == peer) {
1843 if ((_pcidev->device == pdev->device) &&
1844 (_pcidev->bus->number == pdev->bus->number) &&
1845 (_pcidev->devfn == match_lo || _pcidev->devfn == match_hi) ) {
1846 /* Paranoia checks */ 1761 /* Paranoia checks */
1847 if (ioc->alt_ioc != NULL) { 1762 if (ioc->alt_ioc != NULL) {
1848 printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n", 1763 printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n",
1849 ioc->name, ioc->alt_ioc->name); 1764 ioc->name, ioc->alt_ioc->name);
1850 break; 1765 break;
1851 } else if (ioc_srch->alt_ioc != NULL) { 1766 } else if (ioc_srch->alt_ioc != NULL) {
1852 printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n", 1767 printk(KERN_WARNING MYNAM ": Oops, already bound (%s <==> %s)!\n",
1853 ioc_srch->name, ioc_srch->alt_ioc->name); 1768 ioc_srch->name, ioc_srch->alt_ioc->name);
1854 break; 1769 break;
1855 } 1770 }
1856 dprintk((KERN_INFO MYNAM ": FOUND! binding %s <==> %s\n", 1771 dprintk((KERN_INFO MYNAM ": FOUND! binding %s <==> %s\n",
1857 ioc->name, ioc_srch->name)); 1772 ioc->name, ioc_srch->name));
1858 ioc_srch->alt_ioc = ioc; 1773 ioc_srch->alt_ioc = ioc;
1859 ioc->alt_ioc = ioc_srch; 1774 ioc->alt_ioc = ioc_srch;
1860 break;
1861 } 1775 }
1862 } 1776 }
1777 pci_dev_put(peer);
1863} 1778}
1864 1779
1865/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1780/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1922,15 +1837,10 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
1922 ioc->alloc_total -= sz; 1837 ioc->alloc_total -= sz;
1923 } 1838 }
1924 1839
1925 if (ioc->spi_data.nvram != NULL) { 1840 kfree(ioc->spi_data.nvram);
1926 kfree(ioc->spi_data.nvram); 1841 kfree(ioc->spi_data.pIocPg3);
1927 ioc->spi_data.nvram = NULL; 1842 ioc->spi_data.nvram = NULL;
1928 } 1843 ioc->spi_data.pIocPg3 = NULL;
1929
1930 if (ioc->spi_data.pIocPg3 != NULL) {
1931 kfree(ioc->spi_data.pIocPg3);
1932 ioc->spi_data.pIocPg3 = NULL;
1933 }
1934 1844
1935 if (ioc->spi_data.pIocPg4 != NULL) { 1845 if (ioc->spi_data.pIocPg4 != NULL) {
1936 sz = ioc->spi_data.IocPg4Sz; 1846 sz = ioc->spi_data.IocPg4Sz;
@@ -1947,10 +1857,8 @@ mpt_adapter_disable(MPT_ADAPTER *ioc)
1947 ioc->ReqToChain = NULL; 1857 ioc->ReqToChain = NULL;
1948 } 1858 }
1949 1859
1950 if (ioc->ChainToChain != NULL) { 1860 kfree(ioc->ChainToChain);
1951 kfree(ioc->ChainToChain); 1861 ioc->ChainToChain = NULL;
1952 ioc->ChainToChain = NULL;
1953 }
1954} 1862}
1955 1863
1956/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1864/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -2333,7 +2241,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
2333 return -55; 2241 return -55;
2334 } 2242 }
2335 2243
2336 r = sz = le32_to_cpu(facts->BlockSize); 2244 r = sz = facts->BlockSize;
2337 vv = ((63 / (sz * 4)) + 1) & 0x03; 2245 vv = ((63 / (sz * 4)) + 1) & 0x03;
2338 ioc->NB_for_64_byte_frame = vv; 2246 ioc->NB_for_64_byte_frame = vv;
2339 while ( sz ) 2247 while ( sz )
@@ -2785,7 +2693,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
2785 /* prevent a second downloadboot and memory free with alt_ioc */ 2693 /* prevent a second downloadboot and memory free with alt_ioc */
2786 if (ioc->alt_ioc && ioc->alt_ioc->cached_fw) 2694 if (ioc->alt_ioc && ioc->alt_ioc->cached_fw)
2787 ioc->alt_ioc->cached_fw = NULL; 2695 ioc->alt_ioc->cached_fw = NULL;
2788 2696
2789 CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF); 2697 CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF);
2790 CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_1ST_KEY_VALUE); 2698 CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_1ST_KEY_VALUE);
2791 CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE); 2699 CHIPREG_WRITE32(&ioc->chip->WriteSequence, MPI_WRSEQ_2ND_KEY_VALUE);
@@ -2843,6 +2751,9 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
2843 /* Write the LoadStartAddress to the DiagRw Address Register 2751 /* Write the LoadStartAddress to the DiagRw Address Register
2844 * using Programmed IO 2752 * using Programmed IO
2845 */ 2753 */
2754 if (ioc->errata_flag_1064)
2755 pci_enable_io_access(ioc->pcidev);
2756
2846 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, pFwHeader->LoadStartAddress); 2757 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, pFwHeader->LoadStartAddress);
2847 ddlprintk((MYIOC_s_INFO_FMT "LoadStart addr written 0x%x \n", 2758 ddlprintk((MYIOC_s_INFO_FMT "LoadStart addr written 0x%x \n",
2848 ioc->name, pFwHeader->LoadStartAddress)); 2759 ioc->name, pFwHeader->LoadStartAddress));
@@ -2889,6 +2800,9 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
2889 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, 0x3F000000); 2800 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, 0x3F000000);
2890 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, diagRwData); 2801 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, diagRwData);
2891 2802
2803 if (ioc->errata_flag_1064)
2804 pci_disable_io_access(ioc->pcidev);
2805
2892 diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); 2806 diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
2893 ddlprintk((MYIOC_s_INFO_FMT "downloadboot diag0val=%x, turning off PREVENT_IOC_BOOT, DISABLE_ARM\n", 2807 ddlprintk((MYIOC_s_INFO_FMT "downloadboot diag0val=%x, turning off PREVENT_IOC_BOOT, DISABLE_ARM\n",
2894 ioc->name, diag0val)); 2808 ioc->name, diag0val));
@@ -4250,7 +4164,7 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum)
4250 if ((ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_HVD) || 4164 if ((ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_HVD) ||
4251 (ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_SE)) { 4165 (ioc->spi_data.busType == MPI_SCSIPORTPAGE0_PHY_SIGNAL_SE)) {
4252 4166
4253 if (ioc->spi_data.minSyncFactor < MPT_ULTRA) 4167 if (ioc->spi_data.minSyncFactor < MPT_ULTRA)
4254 ioc->spi_data.minSyncFactor = MPT_ULTRA; 4168 ioc->spi_data.minSyncFactor = MPT_ULTRA;
4255 } 4169 }
4256 } 4170 }
@@ -4482,10 +4396,8 @@ mpt_read_ioc_pg_3(MPT_ADAPTER *ioc)
4482 4396
4483 /* Free the old page 4397 /* Free the old page
4484 */ 4398 */
4485 if (ioc->spi_data.pIocPg3) { 4399 kfree(ioc->spi_data.pIocPg3);
4486 kfree(ioc->spi_data.pIocPg3); 4400 ioc->spi_data.pIocPg3 = NULL;
4487 ioc->spi_data.pIocPg3 = NULL;
4488 }
4489 4401
4490 /* There is at least one physical disk. 4402 /* There is at least one physical disk.
4491 * Read and save IOC Page 3 4403 * Read and save IOC Page 3
@@ -4753,9 +4665,7 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
4753 u32 flagsLength; 4665 u32 flagsLength;
4754 int in_isr; 4666 int in_isr;
4755 4667
4756 /* (Bugzilla:fibrebugs, #513) 4668 /* Prevent calling wait_event() (below), if caller happens
4757 * Bug fix (part 1)! 20010905 -sralston
4758 * Prevent calling wait_event() (below), if caller happens
4759 * to be in ISR context, because that is fatal! 4669 * to be in ISR context, because that is fatal!
4760 */ 4670 */
4761 in_isr = in_interrupt(); 4671 in_isr = in_interrupt();
@@ -4861,9 +4771,7 @@ mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
4861 u32 flagsLength; 4771 u32 flagsLength;
4862 int in_isr; 4772 int in_isr;
4863 4773
4864 /* (Bugzilla:fibrebugs, #513) 4774 /* Prevent calling wait_event() (below), if caller happens
4865 * Bug fix (part 1)! 20010905 -sralston
4866 * Prevent calling wait_event() (below), if caller happens
4867 * to be in ISR context, because that is fatal! 4775 * to be in ISR context, because that is fatal!
4868 */ 4776 */
4869 in_isr = in_interrupt(); 4777 in_isr = in_interrupt();
@@ -5130,20 +5038,26 @@ static int
5130procmpt_version_read(char *buf, char **start, off_t offset, int request, int *eof, void *data) 5038procmpt_version_read(char *buf, char **start, off_t offset, int request, int *eof, void *data)
5131{ 5039{
5132 int ii; 5040 int ii;
5133 int scsi, lan, ctl, targ, dmp; 5041 int scsi, fc, sas, lan, ctl, targ, dmp;
5134 char *drvname; 5042 char *drvname;
5135 int len; 5043 int len;
5136 5044
5137 len = sprintf(buf, "%s-%s\n", "mptlinux", MPT_LINUX_VERSION_COMMON); 5045 len = sprintf(buf, "%s-%s\n", "mptlinux", MPT_LINUX_VERSION_COMMON);
5138 len += sprintf(buf+len, " Fusion MPT base driver\n"); 5046 len += sprintf(buf+len, " Fusion MPT base driver\n");
5139 5047
5140 scsi = lan = ctl = targ = dmp = 0; 5048 scsi = fc = sas = lan = ctl = targ = dmp = 0;
5141 for (ii=MPT_MAX_PROTOCOL_DRIVERS-1; ii; ii--) { 5049 for (ii=MPT_MAX_PROTOCOL_DRIVERS-1; ii; ii--) {
5142 drvname = NULL; 5050 drvname = NULL;
5143 if (MptCallbacks[ii]) { 5051 if (MptCallbacks[ii]) {
5144 switch (MptDriverClass[ii]) { 5052 switch (MptDriverClass[ii]) {
5145 case MPTSCSIH_DRIVER: 5053 case MPTSPI_DRIVER:
5146 if (!scsi++) drvname = "SCSI host"; 5054 if (!scsi++) drvname = "SPI host";
5055 break;
5056 case MPTFC_DRIVER:
5057 if (!fc++) drvname = "FC host";
5058 break;
5059 case MPTSAS_DRIVER:
5060 if (!sas++) drvname = "SAS host";
5147 break; 5061 break;
5148 case MPTLAN_DRIVER: 5062 case MPTLAN_DRIVER:
5149 if (!lan++) drvname = "LAN"; 5063 if (!lan++) drvname = "LAN";
@@ -5832,6 +5746,12 @@ mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf)
5832} 5746}
5833 5747
5834/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 5748/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
5749EXPORT_SYMBOL(mpt_attach);
5750EXPORT_SYMBOL(mpt_detach);
5751#ifdef CONFIG_PM
5752EXPORT_SYMBOL(mpt_resume);
5753EXPORT_SYMBOL(mpt_suspend);
5754#endif
5835EXPORT_SYMBOL(ioc_list); 5755EXPORT_SYMBOL(ioc_list);
5836EXPORT_SYMBOL(mpt_proc_root_dir); 5756EXPORT_SYMBOL(mpt_proc_root_dir);
5837EXPORT_SYMBOL(mpt_register); 5757EXPORT_SYMBOL(mpt_register);
@@ -5860,19 +5780,6 @@ EXPORT_SYMBOL(mpt_read_ioc_pg_3);
5860EXPORT_SYMBOL(mpt_alloc_fw_memory); 5780EXPORT_SYMBOL(mpt_alloc_fw_memory);
5861EXPORT_SYMBOL(mpt_free_fw_memory); 5781EXPORT_SYMBOL(mpt_free_fw_memory);
5862 5782
5863static struct pci_driver mptbase_driver = {
5864 .name = "mptbase",
5865 .id_table = mptbase_pci_table,
5866 .probe = mptbase_probe,
5867 .remove = __devexit_p(mptbase_remove),
5868 .driver = {
5869 .shutdown = mptbase_shutdown,
5870 },
5871#ifdef CONFIG_PM
5872 .suspend = mptbase_suspend,
5873 .resume = mptbase_resume,
5874#endif
5875};
5876 5783
5877/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 5784/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
5878/* 5785/*
@@ -5884,7 +5791,6 @@ static int __init
5884fusion_init(void) 5791fusion_init(void)
5885{ 5792{
5886 int i; 5793 int i;
5887 int r;
5888 5794
5889 show_mptmod_ver(my_NAME, my_VERSION); 5795 show_mptmod_ver(my_NAME, my_VERSION);
5890 printk(KERN_INFO COPYRIGHT "\n"); 5796 printk(KERN_INFO COPYRIGHT "\n");
@@ -5896,8 +5802,7 @@ fusion_init(void)
5896 MptResetHandlers[i] = NULL; 5802 MptResetHandlers[i] = NULL;
5897 } 5803 }
5898 5804
5899 /* NEW! 20010120 -sralston 5805 /* Register ourselves (mptbase) in order to facilitate
5900 * Register ourselves (mptbase) in order to facilitate
5901 * EventNotification handling. 5806 * EventNotification handling.
5902 */ 5807 */
5903 mpt_base_index = mpt_register(mpt_base_reply, MPTBASE_DRIVER); 5808 mpt_base_index = mpt_register(mpt_base_reply, MPTBASE_DRIVER);
@@ -5913,11 +5818,7 @@ fusion_init(void)
5913#ifdef CONFIG_PROC_FS 5818#ifdef CONFIG_PROC_FS
5914 (void) procmpt_create(); 5819 (void) procmpt_create();
5915#endif 5820#endif
5916 r = pci_register_driver(&mptbase_driver); 5821 return 0;
5917 if(r)
5918 return(r);
5919
5920 return r;
5921} 5822}
5922 5823
5923/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 5824/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -5933,7 +5834,6 @@ fusion_exit(void)
5933 5834
5934 dexitprintk((KERN_INFO MYNAM ": fusion_exit() called!\n")); 5835 dexitprintk((KERN_INFO MYNAM ": fusion_exit() called!\n"));
5935 5836
5936 pci_unregister_driver(&mptbase_driver);
5937 mpt_reset_deregister(mpt_base_index); 5837 mpt_reset_deregister(mpt_base_index);
5938 5838
5939#ifdef CONFIG_PROC_FS 5839#ifdef CONFIG_PROC_FS
@@ -5941,6 +5841,5 @@ fusion_exit(void)
5941#endif 5841#endif
5942} 5842}
5943 5843
5944
5945module_init(fusion_init); 5844module_init(fusion_init);
5946module_exit(fusion_exit); 5845module_exit(fusion_exit);
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index 6d16acc7a179..848fb236b175 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -5,15 +5,9 @@
5 * LSIFC9xx/LSI409xx Fibre Channel 5 * LSIFC9xx/LSI409xx Fibre Channel
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 * 7 *
8 * Credits: 8 * Copyright (c) 1999-2005 LSI Logic Corporation
9 * (see mptbase.c)
10 *
11 * Copyright (c) 1999-2004 LSI Logic Corporation
12 * Originally By: Steven J. Ralston
13 * (mailto:sjralston1@netscape.net)
14 * (mailto:mpt_linux_developer@lsil.com) 9 * (mailto:mpt_linux_developer@lsil.com)
15 * 10 *
16 * $Id: mptbase.h,v 1.144 2003/01/28 21:31:56 pdelaney Exp $
17 */ 11 */
18/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 12/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
19/* 13/*
@@ -71,7 +65,6 @@
71#include "lsi/mpi_fc.h" /* Fibre Channel (lowlevel) support */ 65#include "lsi/mpi_fc.h" /* Fibre Channel (lowlevel) support */
72#include "lsi/mpi_targ.h" /* SCSI/FCP Target protcol support */ 66#include "lsi/mpi_targ.h" /* SCSI/FCP Target protcol support */
73#include "lsi/mpi_tool.h" /* Tools support */ 67#include "lsi/mpi_tool.h" /* Tools support */
74#include "lsi/fc_log.h"
75 68
76/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 69/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
77 70
@@ -80,11 +73,11 @@
80#endif 73#endif
81 74
82#ifndef COPYRIGHT 75#ifndef COPYRIGHT
83#define COPYRIGHT "Copyright (c) 1999-2004 " MODULEAUTHOR 76#define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR
84#endif 77#endif
85 78
86#define MPT_LINUX_VERSION_COMMON "3.01.20" 79#define MPT_LINUX_VERSION_COMMON "3.03.02"
87#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.01.20" 80#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.02"
88#define WHAT_MAGIC_STRING "@" "(" "#" ")" 81#define WHAT_MAGIC_STRING "@" "(" "#" ")"
89 82
90#define show_mptmod_ver(s,ver) \ 83#define show_mptmod_ver(s,ver) \
@@ -203,7 +196,9 @@
203typedef enum { 196typedef enum {
204 MPTBASE_DRIVER, /* MPT base class */ 197 MPTBASE_DRIVER, /* MPT base class */
205 MPTCTL_DRIVER, /* MPT ioctl class */ 198 MPTCTL_DRIVER, /* MPT ioctl class */
206 MPTSCSIH_DRIVER, /* MPT SCSI host (initiator) class */ 199 MPTSPI_DRIVER, /* MPT SPI host class */
200 MPTFC_DRIVER, /* MPT FC host class */
201 MPTSAS_DRIVER, /* MPT SAS host class */
207 MPTLAN_DRIVER, /* MPT LAN class */ 202 MPTLAN_DRIVER, /* MPT LAN class */
208 MPTSTM_DRIVER, /* MPT SCSI target mode class */ 203 MPTSTM_DRIVER, /* MPT SCSI target mode class */
209 MPTUNKNOWN_DRIVER 204 MPTUNKNOWN_DRIVER
@@ -212,11 +207,6 @@ typedef enum {
212struct mpt_pci_driver{ 207struct mpt_pci_driver{
213 int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); 208 int (*probe) (struct pci_dev *dev, const struct pci_device_id *id);
214 void (*remove) (struct pci_dev *dev); 209 void (*remove) (struct pci_dev *dev);
215 void (*shutdown) (struct device * dev);
216#ifdef CONFIG_PM
217 int (*resume) (struct pci_dev *dev);
218 int (*suspend) (struct pci_dev *dev, pm_message_t state);
219#endif
220}; 210};
221 211
222/* 212/*
@@ -483,6 +473,7 @@ typedef struct _ScsiCfgData {
483 u8 forceDv; /* 1 to force DV scheduling */ 473 u8 forceDv; /* 1 to force DV scheduling */
484 u8 noQas; /* Disable QAS for this adapter */ 474 u8 noQas; /* Disable QAS for this adapter */
485 u8 Saf_Te; /* 1 to force all Processors as SAF-TE if Inquiry data length is too short to check for SAF-TE */ 475 u8 Saf_Te; /* 1 to force all Processors as SAF-TE if Inquiry data length is too short to check for SAF-TE */
476 u8 mpt_dv; /* command line option: enhanced=1, basic=0 */
486 u8 rsvd[1]; 477 u8 rsvd[1];
487} ScsiCfgData; 478} ScsiCfgData;
488 479
@@ -571,11 +562,21 @@ typedef struct _MPT_ADAPTER
571 FCPortPage0_t fc_port_page0[2]; 562 FCPortPage0_t fc_port_page0[2];
572 LANPage0_t lan_cnfg_page0; 563 LANPage0_t lan_cnfg_page0;
573 LANPage1_t lan_cnfg_page1; 564 LANPage1_t lan_cnfg_page1;
565 /*
566 * Description: errata_flag_1064
567 * If a PCIX read occurs within 1 or 2 cycles after the chip receives
568 * a split completion for a read data, an internal address pointer incorrectly
569 * increments by 32 bytes
570 */
571 int errata_flag_1064;
574 u8 FirstWhoInit; 572 u8 FirstWhoInit;
575 u8 upload_fw; /* If set, do a fw upload */ 573 u8 upload_fw; /* If set, do a fw upload */
576 u8 reload_fw; /* Force a FW Reload on next reset */ 574 u8 reload_fw; /* Force a FW Reload on next reset */
577 u8 NBShiftFactor; /* NB Shift Factor based on Block Size (Facts) */ 575 u8 NBShiftFactor; /* NB Shift Factor based on Block Size (Facts) */
578 u8 pad1[4]; 576 u8 pad1[4];
577 int DoneCtx;
578 int TaskCtx;
579 int InternalCtx;
579 struct list_head list; 580 struct list_head list;
580 struct net_device *netdev; 581 struct net_device *netdev;
581} MPT_ADAPTER; 582} MPT_ADAPTER;
@@ -773,12 +774,6 @@ typedef struct _mpt_sge {
773#define DBG_DUMP_TM_REPLY_FRAME(mfp) 774#define DBG_DUMP_TM_REPLY_FRAME(mfp)
774#endif 775#endif
775 776
776#ifdef MPT_DEBUG_NEH
777#define nehprintk(x) printk x
778#else
779#define nehprintk(x)
780#endif
781
782#if defined(MPT_DEBUG_CONFIG) || defined(MPT_DEBUG) 777#if defined(MPT_DEBUG_CONFIG) || defined(MPT_DEBUG)
783#define dcprintk(x) printk x 778#define dcprintk(x) printk x
784#else 779#else
@@ -898,6 +893,11 @@ typedef struct _MPT_SCSI_HOST {
898 unsigned long soft_resets; /* fw/external bus resets count */ 893 unsigned long soft_resets; /* fw/external bus resets count */
899 unsigned long timeouts; /* cmd timeouts */ 894 unsigned long timeouts; /* cmd timeouts */
900 ushort sel_timeout[MPT_MAX_FC_DEVICES]; 895 ushort sel_timeout[MPT_MAX_FC_DEVICES];
896 char *info_kbuf;
897 wait_queue_head_t scandv_waitq;
898 int scandv_wait_done;
899 long last_queue_full;
900 u8 mpt_pq_filter;
901} MPT_SCSI_HOST; 901} MPT_SCSI_HOST;
902 902
903/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 903/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -931,6 +931,12 @@ typedef struct _x_config_parms {
931/* 931/*
932 * Public entry points... 932 * Public entry points...
933 */ 933 */
934extern int mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id);
935extern void mpt_detach(struct pci_dev *pdev);
936#ifdef CONFIG_PM
937extern int mpt_suspend(struct pci_dev *pdev, pm_message_t state);
938extern int mpt_resume(struct pci_dev *pdev);
939#endif
934extern int mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass); 940extern int mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass);
935extern void mpt_deregister(int cb_idx); 941extern void mpt_deregister(int cb_idx);
936extern int mpt_event_register(int cb_idx, MPT_EVHANDLER ev_cbfunc); 942extern int mpt_event_register(int cb_idx, MPT_EVHANDLER ev_cbfunc);
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index 70b0cfb5ac5c..05ea5944c487 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -1,40 +1,12 @@
1/* 1/*
2 * linux/drivers/message/fusion/mptctl.c 2 * linux/drivers/message/fusion/mptctl.c
3 * Fusion MPT misc device (ioctl) driver. 3 * mpt Ioctl driver.
4 * For use with PCI chip/adapter(s): 4 * For use with LSI Logic PCI chip/adapters
5 * LSIFC9xx/LSI409xx Fibre Channel
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 5 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 * 6 *
8 * Credits: 7 * Copyright (c) 1999-2005 LSI Logic Corporation
9 * This driver would not exist if not for Alan Cox's development
10 * of the linux i2o driver.
11 *
12 * A special thanks to Pamela Delaney (LSI Logic) for tons of work
13 * and countless enhancements while adding support for the 1030
14 * chip family. Pam has been instrumental in the development of
15 * of the 2.xx.xx series fusion drivers, and her contributions are
16 * far too numerous to hope to list in one place.
17 *
18 * A huge debt of gratitude is owed to David S. Miller (DaveM)
19 * for fixing much of the stupid and broken stuff in the early
20 * driver while porting to sparc64 platform. THANK YOU!
21 *
22 * A big THANKS to Eddie C. Dost for fixing the ioctl path
23 * and most importantly f/w download on sparc64 platform!
24 * (plus Eddie's other helpful hints and insights)
25 *
26 * Thanks to Arnaldo Carvalho de Melo for finding and patching
27 * a potential memory leak in mptctl_do_fw_download(),
28 * and for some kmalloc insight:-)
29 *
30 * (see also mptbase.c)
31 *
32 * Copyright (c) 1999-2004 LSI Logic Corporation
33 * Originally By: Steven J. Ralston, Noah Romer
34 * (mailto:sjralston1@netscape.net)
35 * (mailto:mpt_linux_developer@lsil.com) 8 * (mailto:mpt_linux_developer@lsil.com)
36 * 9 *
37 * $Id: mptctl.c,v 1.63 2002/12/03 21:26:33 pdelaney Exp $
38 */ 10 */
39/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 11/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
40/* 12/*
@@ -95,8 +67,8 @@
95#include <scsi/scsi_host.h> 67#include <scsi/scsi_host.h>
96#include <scsi/scsi_tcq.h> 68#include <scsi/scsi_tcq.h>
97 69
98#define COPYRIGHT "Copyright (c) 1999-2004 LSI Logic Corporation" 70#define COPYRIGHT "Copyright (c) 1999-2005 LSI Logic Corporation"
99#define MODULEAUTHOR "Steven J. Ralston, Noah Romer, Pamela Delaney" 71#define MODULEAUTHOR "LSI Logic Corporation"
100#include "mptbase.h" 72#include "mptbase.h"
101#include "mptctl.h" 73#include "mptctl.h"
102 74
@@ -127,14 +99,14 @@ struct buflist {
127 * arg contents specific to function. 99 * arg contents specific to function.
128 */ 100 */
129static int mptctl_fw_download(unsigned long arg); 101static int mptctl_fw_download(unsigned long arg);
130static int mptctl_getiocinfo (unsigned long arg, unsigned int cmd); 102static int mptctl_getiocinfo(unsigned long arg, unsigned int cmd);
131static int mptctl_gettargetinfo (unsigned long arg); 103static int mptctl_gettargetinfo(unsigned long arg);
132static int mptctl_readtest (unsigned long arg); 104static int mptctl_readtest(unsigned long arg);
133static int mptctl_mpt_command (unsigned long arg); 105static int mptctl_mpt_command(unsigned long arg);
134static int mptctl_eventquery (unsigned long arg); 106static int mptctl_eventquery(unsigned long arg);
135static int mptctl_eventenable (unsigned long arg); 107static int mptctl_eventenable(unsigned long arg);
136static int mptctl_eventreport (unsigned long arg); 108static int mptctl_eventreport(unsigned long arg);
137static int mptctl_replace_fw (unsigned long arg); 109static int mptctl_replace_fw(unsigned long arg);
138 110
139static int mptctl_do_reset(unsigned long arg); 111static int mptctl_do_reset(unsigned long arg);
140static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd); 112static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd);
@@ -149,11 +121,11 @@ static long compat_mpctl_ioctl(struct file *f, unsigned cmd, unsigned long arg);
149/* 121/*
150 * Private function calls. 122 * Private function calls.
151 */ 123 */
152static int mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr); 124static int mptctl_do_mpt_command(struct mpt_ioctl_command karg, void __user *mfPtr);
153static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen); 125static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen);
154static MptSge_t *kbuf_alloc_2_sgl( int bytes, u32 dir, int sge_offset, int *frags, 126static MptSge_t *kbuf_alloc_2_sgl(int bytes, u32 dir, int sge_offset, int *frags,
155 struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc); 127 struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc);
156static void kfree_sgl( MptSge_t *sgl, dma_addr_t sgl_dma, 128static void kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma,
157 struct buflist *buflist, MPT_ADAPTER *ioc); 129 struct buflist *buflist, MPT_ADAPTER *ioc);
158static void mptctl_timeout_expired (MPT_IOCTL *ioctl); 130static void mptctl_timeout_expired (MPT_IOCTL *ioctl);
159static int mptctl_bus_reset(MPT_IOCTL *ioctl); 131static int mptctl_bus_reset(MPT_IOCTL *ioctl);
@@ -1119,7 +1091,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
1119 int numDevices = 0; 1091 int numDevices = 0;
1120 unsigned int max_id; 1092 unsigned int max_id;
1121 int ii; 1093 int ii;
1122 int port; 1094 unsigned int port;
1123 int cim_rev; 1095 int cim_rev;
1124 u8 revision; 1096 u8 revision;
1125 1097
@@ -1162,9 +1134,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
1162 return -ENODEV; 1134 return -ENODEV;
1163 } 1135 }
1164 1136
1165 /* Verify the data transfer size is correct. 1137 /* Verify the data transfer size is correct. */
1166 * Ignore the port setting.
1167 */
1168 if (karg->hdr.maxDataSize != data_size) { 1138 if (karg->hdr.maxDataSize != data_size) {
1169 printk(KERN_ERR "%s@%d::mptctl_getiocinfo - " 1139 printk(KERN_ERR "%s@%d::mptctl_getiocinfo - "
1170 "Structure size mismatch. Command not completed.\n", 1140 "Structure size mismatch. Command not completed.\n",
@@ -1181,6 +1151,8 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
1181 else 1151 else
1182 karg->adapterType = MPT_IOCTL_INTERFACE_SCSI; 1152 karg->adapterType = MPT_IOCTL_INTERFACE_SCSI;
1183 1153
1154 if (karg->hdr.port > 1)
1155 return -EINVAL;
1184 port = karg->hdr.port; 1156 port = karg->hdr.port;
1185 1157
1186 karg->port = port; 1158 karg->port = port;
diff --git a/drivers/message/fusion/mptctl.h b/drivers/message/fusion/mptctl.h
index cc4ecf0382df..28754a9cb803 100644
--- a/drivers/message/fusion/mptctl.h
+++ b/drivers/message/fusion/mptctl.h
@@ -5,22 +5,9 @@
5 * LSIFC9xx/LSI409xx Fibre Channel 5 * LSIFC9xx/LSI409xx Fibre Channel
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 * 7 *
8 * Credits: 8 * Copyright (c) 1999-2005 LSI Logic Corporation
9 * This driver would not exist if not for Alan Cox's development
10 * of the linux i2o driver.
11 *
12 * A huge debt of gratitude is owed to David S. Miller (DaveM)
13 * for fixing much of the stupid and broken stuff in the early
14 * driver while porting to sparc64 platform. THANK YOU!
15 *
16 * (see also mptbase.c)
17 *
18 * Copyright (c) 1999-2004 LSI Logic Corporation
19 * Originally By: Steven J. Ralston
20 * (mailto:sjralston1@netscape.net)
21 * (mailto:mpt_linux_developer@lsil.com) 9 * (mailto:mpt_linux_developer@lsil.com)
22 * 10 *
23 * $Id: mptctl.h,v 1.13 2002/12/03 21:26:33 pdelaney Exp $
24 */ 11 */
25/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 12/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
26/* 13/*
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
new file mode 100644
index 000000000000..d8d65397e06e
--- /dev/null
+++ b/drivers/message/fusion/mptfc.c
@@ -0,0 +1,431 @@
1/*
2 * linux/drivers/message/fusion/mptfc.c
3 * For use with LSI Logic PCI chip/adapter(s)
4 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
5 *
6 * Copyright (c) 1999-2005 LSI Logic Corporation
7 * (mailto:mpt_linux_developer@lsil.com)
8 *
9 */
10/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
11/*
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; version 2 of the License.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 NO WARRANTY
22 THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
23 CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
24 LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
25 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
26 solely responsible for determining the appropriateness of using and
27 distributing the Program and assumes all risks associated with its
28 exercise of rights under this Agreement, including but not limited to
29 the risks and costs of program errors, damage to or loss of data,
30 programs or equipment, and unavailability or interruption of operations.
31
32 DISCLAIMER OF LIABILITY
33 NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
34 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
36 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
37 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
38 USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
39 HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
40
41 You should have received a copy of the GNU General Public License
42 along with this program; if not, write to the Free Software
43 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
44*/
45/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
46#include "linux_compat.h" /* linux-2.6 tweaks */
47#include <linux/module.h>
48#include <linux/kernel.h>
49#include <linux/init.h>
50#include <linux/errno.h>
51#include <linux/kdev_t.h>
52#include <linux/blkdev.h>
53#include <linux/delay.h> /* for mdelay */
54#include <linux/interrupt.h> /* needed for in_interrupt() proto */
55#include <linux/reboot.h> /* notifier code */
56#include <linux/sched.h>
57#include <linux/workqueue.h>
58
59#include <scsi/scsi.h>
60#include <scsi/scsi_cmnd.h>
61#include <scsi/scsi_device.h>
62#include <scsi/scsi_host.h>
63#include <scsi/scsi_tcq.h>
64
65#include "mptbase.h"
66#include "mptscsih.h"
67
68/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
69#define my_NAME "Fusion MPT FC Host driver"
70#define my_VERSION MPT_LINUX_VERSION_COMMON
71#define MYNAM "mptfc"
72
73MODULE_AUTHOR(MODULEAUTHOR);
74MODULE_DESCRIPTION(my_NAME);
75MODULE_LICENSE("GPL");
76
77/* Command line args */
78static int mpt_pq_filter = 0;
79module_param(mpt_pq_filter, int, 0);
80MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)");
81
82static int mptfcDoneCtx = -1;
83static int mptfcTaskCtx = -1;
84static int mptfcInternalCtx = -1; /* Used only for internal commands */
85
86static struct device_attribute mptfc_queue_depth_attr = {
87 .attr = {
88 .name = "queue_depth",
89 .mode = S_IWUSR,
90 },
91 .store = mptscsih_store_queue_depth,
92};
93
94static struct device_attribute *mptfc_dev_attrs[] = {
95 &mptfc_queue_depth_attr,
96 NULL,
97};
98
99static struct scsi_host_template mptfc_driver_template = {
100 .proc_name = "mptfc",
101 .proc_info = mptscsih_proc_info,
102 .name = "MPT FC Host",
103 .info = mptscsih_info,
104 .queuecommand = mptscsih_qcmd,
105 .slave_alloc = mptscsih_slave_alloc,
106 .slave_configure = mptscsih_slave_configure,
107 .slave_destroy = mptscsih_slave_destroy,
108 .eh_abort_handler = mptscsih_abort,
109 .eh_device_reset_handler = mptscsih_dev_reset,
110 .eh_bus_reset_handler = mptscsih_bus_reset,
111 .eh_host_reset_handler = mptscsih_host_reset,
112 .bios_param = mptscsih_bios_param,
113 .can_queue = MPT_FC_CAN_QUEUE,
114 .this_id = -1,
115 .sg_tablesize = MPT_SCSI_SG_DEPTH,
116 .max_sectors = 8192,
117 .cmd_per_lun = 7,
118 .use_clustering = ENABLE_CLUSTERING,
119 .sdev_attrs = mptfc_dev_attrs,
120};
121
122/****************************************************************************
123 * Supported hardware
124 */
125
126static struct pci_device_id mptfc_pci_table[] = {
127 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC909,
128 PCI_ANY_ID, PCI_ANY_ID },
129 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919,
130 PCI_ANY_ID, PCI_ANY_ID },
131 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929,
132 PCI_ANY_ID, PCI_ANY_ID },
133 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919X,
134 PCI_ANY_ID, PCI_ANY_ID },
135 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929X,
136 PCI_ANY_ID, PCI_ANY_ID },
137 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC939X,
138 PCI_ANY_ID, PCI_ANY_ID },
139 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC949X,
140 PCI_ANY_ID, PCI_ANY_ID },
141 {0} /* Terminating entry */
142};
143MODULE_DEVICE_TABLE(pci, mptfc_pci_table);
144
145/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
146/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
147/*
148 * mptfc_probe - Installs scsi devices per bus.
149 * @pdev: Pointer to pci_dev structure
150 *
151 * Returns 0 for success, non-zero for failure.
152 *
153 */
154static int
155mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
156{
157 struct Scsi_Host *sh;
158 MPT_SCSI_HOST *hd;
159 MPT_ADAPTER *ioc;
160 unsigned long flags;
161 int sz, ii;
162 int numSGE = 0;
163 int scale;
164 int ioc_cap;
165 u8 *mem;
166 int error=0;
167 int r;
168
169 if ((r = mpt_attach(pdev,id)) != 0)
170 return r;
171
172 ioc = pci_get_drvdata(pdev);
173 ioc->DoneCtx = mptfcDoneCtx;
174 ioc->TaskCtx = mptfcTaskCtx;
175 ioc->InternalCtx = mptfcInternalCtx;
176
177 /* Added sanity check on readiness of the MPT adapter.
178 */
179 if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) {
180 printk(MYIOC_s_WARN_FMT
181 "Skipping because it's not operational!\n",
182 ioc->name);
183 return -ENODEV;
184 }
185
186 if (!ioc->active) {
187 printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n",
188 ioc->name);
189 return -ENODEV;
190 }
191
192 /* Sanity check - ensure at least 1 port is INITIATOR capable
193 */
194 ioc_cap = 0;
195 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
196 if (ioc->pfacts[ii].ProtocolFlags &
197 MPI_PORTFACTS_PROTOCOL_INITIATOR)
198 ioc_cap ++;
199 }
200
201 if (!ioc_cap) {
202 printk(MYIOC_s_WARN_FMT
203 "Skipping ioc=%p because SCSI Initiator mode is NOT enabled!\n",
204 ioc->name, ioc);
205 return -ENODEV;
206 }
207
208 sh = scsi_host_alloc(&mptfc_driver_template, sizeof(MPT_SCSI_HOST));
209
210 if (!sh) {
211 printk(MYIOC_s_WARN_FMT
212 "Unable to register controller with SCSI subsystem\n",
213 ioc->name);
214 return -1;
215 }
216
217 spin_lock_irqsave(&ioc->FreeQlock, flags);
218
219 /* Attach the SCSI Host to the IOC structure
220 */
221 ioc->sh = sh;
222
223 sh->io_port = 0;
224 sh->n_io_port = 0;
225 sh->irq = 0;
226
227 /* set 16 byte cdb's */
228 sh->max_cmd_len = 16;
229
230 sh->max_id = MPT_MAX_FC_DEVICES<256 ? MPT_MAX_FC_DEVICES : 255;
231
232 sh->max_lun = MPT_LAST_LUN + 1;
233 sh->max_channel = 0;
234 sh->this_id = ioc->pfacts[0].PortSCSIID;
235
236 /* Required entry.
237 */
238 sh->unique_id = ioc->id;
239
240 /* Verify that we won't exceed the maximum
241 * number of chain buffers
242 * We can optimize: ZZ = req_sz/sizeof(SGE)
243 * For 32bit SGE's:
244 * numSGE = 1 + (ZZ-1)*(maxChain -1) + ZZ
245 * + (req_sz - 64)/sizeof(SGE)
246 * A slightly different algorithm is required for
247 * 64bit SGEs.
248 */
249 scale = ioc->req_sz/(sizeof(dma_addr_t) + sizeof(u32));
250 if (sizeof(dma_addr_t) == sizeof(u64)) {
251 numSGE = (scale - 1) *
252 (ioc->facts.MaxChainDepth-1) + scale +
253 (ioc->req_sz - 60) / (sizeof(dma_addr_t) +
254 sizeof(u32));
255 } else {
256 numSGE = 1 + (scale - 1) *
257 (ioc->facts.MaxChainDepth-1) + scale +
258 (ioc->req_sz - 64) / (sizeof(dma_addr_t) +
259 sizeof(u32));
260 }
261
262 if (numSGE < sh->sg_tablesize) {
263 /* Reset this value */
264 dprintk((MYIOC_s_INFO_FMT
265 "Resetting sg_tablesize to %d from %d\n",
266 ioc->name, numSGE, sh->sg_tablesize));
267 sh->sg_tablesize = numSGE;
268 }
269
270 /* Set the pci device pointer in Scsi_Host structure.
271 */
272 scsi_set_device(sh, &ioc->pcidev->dev);
273
274 spin_unlock_irqrestore(&ioc->FreeQlock, flags);
275
276 hd = (MPT_SCSI_HOST *) sh->hostdata;
277 hd->ioc = ioc;
278
279 /* SCSI needs scsi_cmnd lookup table!
280 * (with size equal to req_depth*PtrSz!)
281 */
282 sz = ioc->req_depth * sizeof(void *);
283 mem = kmalloc(sz, GFP_ATOMIC);
284 if (mem == NULL) {
285 error = -ENOMEM;
286 goto mptfc_probe_failed;
287 }
288
289 memset(mem, 0, sz);
290 hd->ScsiLookup = (struct scsi_cmnd **) mem;
291
292 dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n",
293 ioc->name, hd->ScsiLookup, sz));
294
295 /* Allocate memory for the device structures.
296 * A non-Null pointer at an offset
297 * indicates a device exists.
298 * max_id = 1 + maximum id (hosts.h)
299 */
300 sz = sh->max_id * sizeof(void *);
301 mem = kmalloc(sz, GFP_ATOMIC);
302 if (mem == NULL) {
303 error = -ENOMEM;
304 goto mptfc_probe_failed;
305 }
306
307 memset(mem, 0, sz);
308 hd->Targets = (VirtDevice **) mem;
309
310 dprintk((KERN_INFO
311 " Targets @ %p, sz=%d\n", hd->Targets, sz));
312
313 /* Clear the TM flags
314 */
315 hd->tmPending = 0;
316 hd->tmState = TM_STATE_NONE;
317 hd->resetPending = 0;
318 hd->abortSCpnt = NULL;
319
320 /* Clear the pointer used to store
321 * single-threaded commands, i.e., those
322 * issued during a bus scan, dv and
323 * configuration pages.
324 */
325 hd->cmdPtr = NULL;
326
327 /* Initialize this SCSI Hosts' timers
328 * To use, set the timer expires field
329 * and add_timer
330 */
331 init_timer(&hd->timer);
332 hd->timer.data = (unsigned long) hd;
333 hd->timer.function = mptscsih_timer_expired;
334
335 hd->mpt_pq_filter = mpt_pq_filter;
336
337 ddvprintk((MYIOC_s_INFO_FMT
338 "mpt_pq_filter %x\n",
339 ioc->name,
340 mpt_pq_filter));
341
342 init_waitqueue_head(&hd->scandv_waitq);
343 hd->scandv_wait_done = 0;
344 hd->last_queue_full = 0;
345
346 error = scsi_add_host (sh, &ioc->pcidev->dev);
347 if(error) {
348 dprintk((KERN_ERR MYNAM
349 "scsi_add_host failed\n"));
350 goto mptfc_probe_failed;
351 }
352
353 scsi_scan_host(sh);
354 return 0;
355
356mptfc_probe_failed:
357
358 mptscsih_remove(pdev);
359 return error;
360}
361
362static struct pci_driver mptfc_driver = {
363 .name = "mptfc",
364 .id_table = mptfc_pci_table,
365 .probe = mptfc_probe,
366 .remove = __devexit_p(mptscsih_remove),
367 .driver = {
368 .shutdown = mptscsih_shutdown,
369 },
370#ifdef CONFIG_PM
371 .suspend = mptscsih_suspend,
372 .resume = mptscsih_resume,
373#endif
374};
375
376/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
377/**
378 * mptfc_init - Register MPT adapter(s) as SCSI host(s) with
379 * linux scsi mid-layer.
380 *
381 * Returns 0 for success, non-zero for failure.
382 */
383static int __init
384mptfc_init(void)
385{
386
387 show_mptmod_ver(my_NAME, my_VERSION);
388
389 mptfcDoneCtx = mpt_register(mptscsih_io_done, MPTFC_DRIVER);
390 mptfcTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTFC_DRIVER);
391 mptfcInternalCtx = mpt_register(mptscsih_scandv_complete, MPTFC_DRIVER);
392
393 if (mpt_event_register(mptfcDoneCtx, mptscsih_event_process) == 0) {
394 devtprintk((KERN_INFO MYNAM
395 ": Registered for IOC event notifications\n"));
396 }
397
398 if (mpt_reset_register(mptfcDoneCtx, mptscsih_ioc_reset) == 0) {
399 dprintk((KERN_INFO MYNAM
400 ": Registered for IOC reset notifications\n"));
401 }
402
403 return pci_register_driver(&mptfc_driver);
404}
405
406/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
407/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
408/**
409 * mptfc_exit - Unregisters MPT adapter(s)
410 *
411 */
412static void __exit
413mptfc_exit(void)
414{
415 pci_unregister_driver(&mptfc_driver);
416
417 mpt_reset_deregister(mptfcDoneCtx);
418 dprintk((KERN_INFO MYNAM
419 ": Deregistered for IOC reset notifications\n"));
420
421 mpt_event_deregister(mptfcDoneCtx);
422 dprintk((KERN_INFO MYNAM
423 ": Deregistered for IOC event notifications\n"));
424
425 mpt_deregister(mptfcInternalCtx);
426 mpt_deregister(mptfcTaskCtx);
427 mpt_deregister(mptfcDoneCtx);
428}
429
430module_init(mptfc_init);
431module_exit(mptfc_exit);
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c
index ef2713b93fab..52794be5a95c 100644
--- a/drivers/message/fusion/mptlan.c
+++ b/drivers/message/fusion/mptlan.c
@@ -1,33 +1,11 @@
1/* 1/*
2 * linux/drivers/message/fusion/mptlan.c 2 * linux/drivers/message/fusion/mptlan.c
3 * IP Over Fibre Channel device driver. 3 * IP Over Fibre Channel device driver.
4 * For use with PCI chip/adapter(s): 4 * For use with LSI Logic Fibre Channel PCI chip/adapters
5 * LSIFC9xx/LSI409xx Fibre Channel
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 5 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 * 6 *
8 * Credits: 7 * Copyright (c) 2000-2005 LSI Logic Corporation
9 * This driver would not exist if not for Alan Cox's development
10 * of the linux i2o driver.
11 * 8 *
12 * Special thanks goes to the I2O LAN driver people at the
13 * University of Helsinki, who, unbeknownst to them, provided
14 * the inspiration and initial structure for this driver.
15 *
16 * A huge debt of gratitude is owed to David S. Miller (DaveM)
17 * for fixing much of the stupid and broken stuff in the early
18 * driver while porting to sparc64 platform. THANK YOU!
19 *
20 * A really huge debt of gratitude is owed to Eddie C. Dost
21 * for gobs of hard work fixing and optimizing LAN code.
22 * THANK YOU!
23 *
24 * (see also mptbase.c)
25 *
26 * Copyright (c) 2000-2004 LSI Logic Corporation
27 * Originally By: Noah Romer
28 * (mailto:mpt_linux_developer@lsil.com)
29 *
30 * $Id: mptlan.c,v 1.53 2002/10/17 20:15:58 pdelaney Exp $
31 */ 9 */
32/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 10/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
33/* 11/*
@@ -221,7 +199,7 @@ lan_reply (MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
221 199
222 // NOTE! (Optimization) First case here is now caught in 200 // NOTE! (Optimization) First case here is now caught in
223 // mptbase.c::mpt_interrupt() routine and callcack here 201 // mptbase.c::mpt_interrupt() routine and callcack here
224 // is now skipped for this case! 20001218 -sralston 202 // is now skipped for this case!
225#if 0 203#if 0
226 case LAN_REPLY_FORM_MESSAGE_CONTEXT: 204 case LAN_REPLY_FORM_MESSAGE_CONTEXT:
227// dioprintk((KERN_INFO MYNAM "/lan_reply: " 205// dioprintk((KERN_INFO MYNAM "/lan_reply: "
@@ -234,7 +212,7 @@ lan_reply (MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
234// dioprintk((MYNAM "/lan_reply: " 212// dioprintk((MYNAM "/lan_reply: "
235// "calling mpt_lan_send_reply (turbo)\n")); 213// "calling mpt_lan_send_reply (turbo)\n"));
236 214
237 // Potential BUG here? -sralston 215 // Potential BUG here?
238 // FreeReqFrame = mpt_lan_send_turbo(dev, tmsg); 216 // FreeReqFrame = mpt_lan_send_turbo(dev, tmsg);
239 // If/when mpt_lan_send_turbo would return 1 here, 217 // If/when mpt_lan_send_turbo would return 1 here,
240 // calling routine (mptbase.c|mpt_interrupt) 218 // calling routine (mptbase.c|mpt_interrupt)
@@ -310,8 +288,7 @@ lan_reply (MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
310 288
311 case MPI_FUNCTION_EVENT_NOTIFICATION: 289 case MPI_FUNCTION_EVENT_NOTIFICATION:
312 case MPI_FUNCTION_EVENT_ACK: 290 case MPI_FUNCTION_EVENT_ACK:
313 /* UPDATE! 20010120 -sralston 291 /* _EVENT_NOTIFICATION should NOT come down this path any more.
314 * _EVENT_NOTIFICATION should NOT come down this path any more.
315 * Should be routed to mpt_lan_event_process(), but just in case... 292 * Should be routed to mpt_lan_event_process(), but just in case...
316 */ 293 */
317 FreeReqFrame = 1; 294 FreeReqFrame = 1;
@@ -561,8 +538,8 @@ mpt_lan_close(struct net_device *dev)
561 } 538 }
562 } 539 }
563 540
564 kfree (priv->RcvCtl); 541 kfree(priv->RcvCtl);
565 kfree (priv->mpt_rxfidx); 542 kfree(priv->mpt_rxfidx);
566 543
567 for (i = 0; i < priv->tx_max_out; i++) { 544 for (i = 0; i < priv->tx_max_out; i++) {
568 if (priv->SendCtl[i].skb != NULL) { 545 if (priv->SendCtl[i].skb != NULL) {
diff --git a/drivers/message/fusion/mptlan.h b/drivers/message/fusion/mptlan.h
index 057904260ab1..750e343eb981 100644
--- a/drivers/message/fusion/mptlan.h
+++ b/drivers/message/fusion/mptlan.h
@@ -1,3 +1,49 @@
1/*
2 * linux/drivers/message/fusion/mptlan.h
3 * IP Over Fibre Channel device driver.
4 * For use with LSI Logic Fibre Channel PCI chip/adapters
5 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
6 *
7 * Copyright (c) 2000-2005 LSI Logic Corporation
8 *
9 */
10/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
11/*
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; version 2 of the License.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 NO WARRANTY
22 THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
23 CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
24 LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
25 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
26 solely responsible for determining the appropriateness of using and
27 distributing the Program and assumes all risks associated with its
28 exercise of rights under this Agreement, including but not limited to
29 the risks and costs of program errors, damage to or loss of data,
30 programs or equipment, and unavailability or interruption of operations.
31
32 DISCLAIMER OF LIABILITY
33 NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
34 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
36 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
37 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
38 USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
39 HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
40
41 You should have received a copy of the GNU General Public License
42 along with this program; if not, write to the Free Software
43 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
44*/
45/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
46
1/* mptlan.h */ 47/* mptlan.h */
2 48
3#ifndef LINUX_MPTLAN_H_INCLUDED 49#ifndef LINUX_MPTLAN_H_INCLUDED
@@ -29,7 +75,7 @@
29#include <asm/io.h> 75#include <asm/io.h>
30 76
31 /* Override mptbase.h by pre-defining these! */ 77 /* Override mptbase.h by pre-defining these! */
32 #define MODULEAUTHOR "Noah Romer, Eddie C. Dost" 78#define MODULEAUTHOR "LSI Logic Corporation"
33 79
34#include "mptbase.h" 80#include "mptbase.h"
35 81
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 3a3ef127df04..a0078ae5b9b8 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -1,32 +1,11 @@
1/* 1/*
2 * linux/drivers/message/fusion/mptscsih.c 2 * linux/drivers/message/fusion/mptscsih.c
3 * High performance SCSI / Fibre Channel SCSI Host device driver. 3 * For use with LSI Logic PCI chip/adapter(s)
4 * For use with PCI chip/adapter(s):
5 * LSIFC9xx/LSI409xx Fibre Channel
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 4 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 * 5 *
8 * Credits: 6 * Copyright (c) 1999-2005 LSI Logic Corporation
9 * This driver would not exist if not for Alan Cox's development
10 * of the linux i2o driver.
11 *
12 * A special thanks to Pamela Delaney (LSI Logic) for tons of work
13 * and countless enhancements while adding support for the 1030
14 * chip family. Pam has been instrumental in the development of
15 * of the 2.xx.xx series fusion drivers, and her contributions are
16 * far too numerous to hope to list in one place.
17 *
18 * A huge debt of gratitude is owed to David S. Miller (DaveM)
19 * for fixing much of the stupid and broken stuff in the early
20 * driver while porting to sparc64 platform. THANK YOU!
21 *
22 * (see mptbase.c)
23 *
24 * Copyright (c) 1999-2004 LSI Logic Corporation
25 * Original author: Steven J. Ralston
26 * (mailto:sjralston1@netscape.net)
27 * (mailto:mpt_linux_developer@lsil.com) 7 * (mailto:mpt_linux_developer@lsil.com)
28 * 8 *
29 * $Id: mptscsih.c,v 1.104 2002/12/03 21:26:34 pdelaney Exp $
30 */ 9 */
31/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 10/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
32/* 11/*
@@ -96,27 +75,6 @@ MODULE_AUTHOR(MODULEAUTHOR);
96MODULE_DESCRIPTION(my_NAME); 75MODULE_DESCRIPTION(my_NAME);
97MODULE_LICENSE("GPL"); 76MODULE_LICENSE("GPL");
98 77
99/* Command line args */
100static int mpt_dv = MPTSCSIH_DOMAIN_VALIDATION;
101MODULE_PARM(mpt_dv, "i");
102MODULE_PARM_DESC(mpt_dv, " DV Algorithm: enhanced=1, basic=0 (default=MPTSCSIH_DOMAIN_VALIDATION=1)");
103
104static int mpt_width = MPTSCSIH_MAX_WIDTH;
105MODULE_PARM(mpt_width, "i");
106MODULE_PARM_DESC(mpt_width, " Max Bus Width: wide=1, narrow=0 (default=MPTSCSIH_MAX_WIDTH=1)");
107
108static int mpt_factor = MPTSCSIH_MIN_SYNC;
109MODULE_PARM(mpt_factor, "h");
110MODULE_PARM_DESC(mpt_factor, " Min Sync Factor (default=MPTSCSIH_MIN_SYNC=0x08)");
111
112static int mpt_saf_te = MPTSCSIH_SAF_TE;
113MODULE_PARM(mpt_saf_te, "i");
114MODULE_PARM_DESC(mpt_saf_te, " Force enabling SEP Processor: enable=1 (default=MPTSCSIH_SAF_TE=0)");
115
116static int mpt_pq_filter = 0;
117MODULE_PARM(mpt_pq_filter, "i");
118MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)");
119
120/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 78/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
121 79
122typedef struct _BIG_SENSE_BUF { 80typedef struct _BIG_SENSE_BUF {
@@ -169,18 +127,17 @@ typedef struct _dv_parameters {
169 u16 pad1; 127 u16 pad1;
170} DVPARAMETERS; 128} DVPARAMETERS;
171 129
172
173/* 130/*
174 * Other private/forward protos... 131 * Other private/forward protos...
175 */ 132 */
176static int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); 133int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
177static void mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq); 134static void mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq);
178static int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); 135int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
179 136
180static int mptscsih_AddSGE(MPT_ADAPTER *ioc, struct scsi_cmnd *SCpnt, 137static int mptscsih_AddSGE(MPT_ADAPTER *ioc, struct scsi_cmnd *SCpnt,
181 SCSIIORequest_t *pReq, int req_idx); 138 SCSIIORequest_t *pReq, int req_idx);
182static void mptscsih_freeChainBuffers(MPT_ADAPTER *ioc, int req_idx); 139static void mptscsih_freeChainBuffers(MPT_ADAPTER *ioc, int req_idx);
183static void copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply); 140static void mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply);
184static int mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd); 141static int mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd);
185static int mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout ); 142static int mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout );
186static u32 SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc); 143static u32 SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc);
@@ -188,8 +145,8 @@ static u32 SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc);
188static int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout); 145static int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout);
189static int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout); 146static int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun, int ctx2abort, ulong timeout);
190 147
191static int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); 148int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset);
192static int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); 149int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply);
193 150
194static void mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *data, int dlen); 151static void mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *data, int dlen);
195static void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56); 152static void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56);
@@ -198,8 +155,7 @@ static void mptscsih_setDevicePage1Flags (u8 width, u8 factor, u8 offset, int *r
198static void mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id); 155static void mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id);
199static int mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target, int flags); 156static int mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target, int flags);
200static int mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus); 157static int mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus);
201static int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); 158int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
202static void mptscsih_timer_expired(unsigned long data);
203static int mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd); 159static int mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd);
204static int mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum); 160static int mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum);
205 161
@@ -212,29 +168,14 @@ static int mptscsih_doDv(MPT_SCSI_HOST *hd, int channel, int target);
212static void mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage); 168static void mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage);
213static void mptscsih_fillbuf(char *buffer, int size, int index, int width); 169static void mptscsih_fillbuf(char *buffer, int size, int index, int width);
214#endif 170#endif
215/* module entry point */
216static int __init mptscsih_init (void);
217static void __exit mptscsih_exit (void);
218 171
219static int mptscsih_probe (struct pci_dev *, const struct pci_device_id *); 172void mptscsih_remove(struct pci_dev *);
220static void mptscsih_remove(struct pci_dev *); 173void mptscsih_shutdown(struct device *);
221static void mptscsih_shutdown(struct device *);
222#ifdef CONFIG_PM 174#ifdef CONFIG_PM
223static int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state); 175int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state);
224static int mptscsih_resume(struct pci_dev *pdev); 176int mptscsih_resume(struct pci_dev *pdev);
225#endif 177#endif
226 178
227
228/*
229 * Private data...
230 */
231
232static int mpt_scsi_hosts = 0;
233
234static int ScsiDoneCtx = -1;
235static int ScsiTaskCtx = -1;
236static int ScsiScanDvCtx = -1; /* Used only for bus scan and dv */
237
238#define SNS_LEN(scp) sizeof((scp)->sense_buffer) 179#define SNS_LEN(scp) sizeof((scp)->sense_buffer)
239 180
240#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION 181#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
@@ -244,20 +185,9 @@ static int ScsiScanDvCtx = -1; /* Used only for bus scan and dv */
244static DEFINE_SPINLOCK(dvtaskQ_lock); 185static DEFINE_SPINLOCK(dvtaskQ_lock);
245static int dvtaskQ_active = 0; 186static int dvtaskQ_active = 0;
246static int dvtaskQ_release = 0; 187static int dvtaskQ_release = 0;
247static struct work_struct mptscsih_dvTask; 188static struct work_struct dvTaskQ_task;
248#endif 189#endif
249 190
250/*
251 * Wait Queue setup
252 */
253static DECLARE_WAIT_QUEUE_HEAD (scandv_waitq);
254static int scandv_wait_done = 1;
255
256
257/* Driver command line structure
258 */
259static struct scsi_host_template driver_template;
260
261/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 191/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
262/** 192/**
263 * mptscsih_add_sge - Place a simple SGE at address pAddr. 193 * mptscsih_add_sge - Place a simple SGE at address pAddr.
@@ -619,7 +549,7 @@ nextSGEset:
619 * 549 *
620 * Returns 1 indicating alloc'd request frame ptr should be freed. 550 * Returns 1 indicating alloc'd request frame ptr should be freed.
621 */ 551 */
622static int 552int
623mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) 553mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
624{ 554{
625 struct scsi_cmnd *sc; 555 struct scsi_cmnd *sc;
@@ -677,8 +607,8 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
677 sc->request_bufflen, xfer_cnt)); 607 sc->request_bufflen, xfer_cnt));
678 608
679 if (scsi_state & MPI_SCSI_STATE_AUTOSENSE_VALID) 609 if (scsi_state & MPI_SCSI_STATE_AUTOSENSE_VALID)
680 copy_sense_data(sc, hd, mf, pScsiReply); 610 mptscsih_copy_sense_data(sc, hd, mf, pScsiReply);
681 611
682 /* 612 /*
683 * Look for + dump FCP ResponseInfo[]! 613 * Look for + dump FCP ResponseInfo[]!
684 */ 614 */
@@ -740,7 +670,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
740 } 670 }
741 dreplyprintk((KERN_NOTICE "RESIDUAL_MISMATCH: result=%x on id=%d\n", sc->result, sc->target)); 671 dreplyprintk((KERN_NOTICE "RESIDUAL_MISMATCH: result=%x on id=%d\n", sc->result, sc->target));
742 break; 672 break;
743 673
744 case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ 674 case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */
745 /* 675 /*
746 * Do upfront check for valid SenseData and give it 676 * Do upfront check for valid SenseData and give it
@@ -773,7 +703,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
773 */ 703 */
774 if (scsi_status == MPI_SCSI_STATUS_TASK_SET_FULL) 704 if (scsi_status == MPI_SCSI_STATUS_TASK_SET_FULL)
775 mptscsih_report_queue_full(sc, pScsiReply, pScsiReq); 705 mptscsih_report_queue_full(sc, pScsiReply, pScsiReq);
776 706
777 break; 707 break;
778 708
779 case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ 709 case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */
@@ -905,18 +835,16 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
905 * Do OS callback 835 * Do OS callback
906 * Free driver resources (chain, msg buffers) 836 * Free driver resources (chain, msg buffers)
907 */ 837 */
908 if (scsi_device_online(SCpnt->device)) { 838 if (SCpnt->use_sg) {
909 if (SCpnt->use_sg) { 839 pci_unmap_sg(ioc->pcidev,
910 pci_unmap_sg(ioc->pcidev, 840 (struct scatterlist *) SCpnt->request_buffer,
911 (struct scatterlist *) SCpnt->request_buffer, 841 SCpnt->use_sg,
912 SCpnt->use_sg, 842 SCpnt->sc_data_direction);
913 SCpnt->sc_data_direction); 843 } else if (SCpnt->request_bufflen) {
914 } else if (SCpnt->request_bufflen) { 844 pci_unmap_single(ioc->pcidev,
915 pci_unmap_single(ioc->pcidev, 845 SCpnt->SCp.dma_handle,
916 SCpnt->SCp.dma_handle, 846 SCpnt->request_bufflen,
917 SCpnt->request_bufflen, 847 SCpnt->sc_data_direction);
918 SCpnt->sc_data_direction);
919 }
920 } 848 }
921 SCpnt->result = DID_RESET << 16; 849 SCpnt->result = DID_RESET << 16;
922 SCpnt->host_scribble = NULL; 850 SCpnt->host_scribble = NULL;
@@ -981,11 +909,6 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, uint target, uint lun)
981} 909}
982 910
983/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 911/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
984/*
985 * Hack! It might be nice to report if a device is returning QUEUE_FULL
986 * but maybe not each and every time...
987 */
988static long last_queue_full = 0;
989 912
990/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 913/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
991/* 914/*
@@ -1003,280 +926,20 @@ static void
1003mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq) 926mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq)
1004{ 927{
1005 long time = jiffies; 928 long time = jiffies;
1006
1007 if (time - last_queue_full > 10 * HZ) {
1008 char *ioc_str = "ioc?";
1009
1010 if (sc->device && sc->device->host != NULL && sc->device->host->hostdata != NULL)
1011 ioc_str = ((MPT_SCSI_HOST *)sc->device->host->hostdata)->ioc->name;
1012 dprintk((MYIOC_s_WARN_FMT "Device (%d:%d:%d) reported QUEUE_FULL!\n",
1013 ioc_str, 0, sc->device->id, sc->device->lun));
1014 last_queue_full = time;
1015 }
1016}
1017
1018/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1019static char *info_kbuf = NULL;
1020
1021/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1022/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1023/*
1024 * mptscsih_probe - Installs scsi devices per bus.
1025 * @pdev: Pointer to pci_dev structure
1026 *
1027 * Returns 0 for success, non-zero for failure.
1028 *
1029 */
1030
1031static int
1032mptscsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1033{
1034 struct Scsi_Host *sh;
1035 MPT_SCSI_HOST *hd; 929 MPT_SCSI_HOST *hd;
1036 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
1037 unsigned long flags;
1038 int sz, ii;
1039 int numSGE = 0;
1040 int scale;
1041 int ioc_cap;
1042 u8 *mem;
1043 int error=0;
1044
1045
1046 /* 20010202 -sralston
1047 * Added sanity check on readiness of the MPT adapter.
1048 */
1049 if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) {
1050 printk(MYIOC_s_WARN_FMT
1051 "Skipping because it's not operational!\n",
1052 ioc->name);
1053 return -ENODEV;
1054 }
1055
1056 if (!ioc->active) {
1057 printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n",
1058 ioc->name);
1059 return -ENODEV;
1060 }
1061
1062 /* Sanity check - ensure at least 1 port is INITIATOR capable
1063 */
1064 ioc_cap = 0;
1065 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
1066 if (ioc->pfacts[ii].ProtocolFlags &
1067 MPI_PORTFACTS_PROTOCOL_INITIATOR)
1068 ioc_cap ++;
1069 }
1070
1071 if (!ioc_cap) {
1072 printk(MYIOC_s_WARN_FMT
1073 "Skipping ioc=%p because SCSI Initiator mode is NOT enabled!\n",
1074 ioc->name, ioc);
1075 return -ENODEV;
1076 }
1077
1078 sh = scsi_host_alloc(&driver_template, sizeof(MPT_SCSI_HOST));
1079
1080 if (!sh) {
1081 printk(MYIOC_s_WARN_FMT
1082 "Unable to register controller with SCSI subsystem\n",
1083 ioc->name);
1084 return -1;
1085 }
1086
1087 spin_lock_irqsave(&ioc->FreeQlock, flags);
1088
1089 /* Attach the SCSI Host to the IOC structure
1090 */
1091 ioc->sh = sh;
1092
1093 sh->io_port = 0;
1094 sh->n_io_port = 0;
1095 sh->irq = 0;
1096
1097 /* set 16 byte cdb's */
1098 sh->max_cmd_len = 16;
1099
1100 /* Yikes! This is important!
1101 * Otherwise, by default, linux
1102 * only scans target IDs 0-7!
1103 * pfactsN->MaxDevices unreliable
1104 * (not supported in early
1105 * versions of the FW).
1106 * max_id = 1 + actual max id,
1107 * max_lun = 1 + actual last lun,
1108 * see hosts.h :o(
1109 */
1110 if (ioc->bus_type == SCSI) {
1111 sh->max_id = MPT_MAX_SCSI_DEVICES;
1112 } else {
1113 /* For FC, increase the queue depth
1114 * from MPT_SCSI_CAN_QUEUE (31)
1115 * to MPT_FC_CAN_QUEUE (63).
1116 */
1117 sh->can_queue = MPT_FC_CAN_QUEUE;
1118 sh->max_id =
1119 MPT_MAX_FC_DEVICES<256 ? MPT_MAX_FC_DEVICES : 255;
1120 }
1121
1122 sh->max_lun = MPT_LAST_LUN + 1;
1123 sh->max_channel = 0;
1124 sh->this_id = ioc->pfacts[0].PortSCSIID;
1125
1126 /* Required entry.
1127 */
1128 sh->unique_id = ioc->id;
1129
1130 /* Verify that we won't exceed the maximum
1131 * number of chain buffers
1132 * We can optimize: ZZ = req_sz/sizeof(SGE)
1133 * For 32bit SGE's:
1134 * numSGE = 1 + (ZZ-1)*(maxChain -1) + ZZ
1135 * + (req_sz - 64)/sizeof(SGE)
1136 * A slightly different algorithm is required for
1137 * 64bit SGEs.
1138 */
1139 scale = ioc->req_sz/(sizeof(dma_addr_t) + sizeof(u32));
1140 if (sizeof(dma_addr_t) == sizeof(u64)) {
1141 numSGE = (scale - 1) *
1142 (ioc->facts.MaxChainDepth-1) + scale +
1143 (ioc->req_sz - 60) / (sizeof(dma_addr_t) +
1144 sizeof(u32));
1145 } else {
1146 numSGE = 1 + (scale - 1) *
1147 (ioc->facts.MaxChainDepth-1) + scale +
1148 (ioc->req_sz - 64) / (sizeof(dma_addr_t) +
1149 sizeof(u32));
1150 }
1151
1152 if (numSGE < sh->sg_tablesize) {
1153 /* Reset this value */
1154 dprintk((MYIOC_s_INFO_FMT
1155 "Resetting sg_tablesize to %d from %d\n",
1156 ioc->name, numSGE, sh->sg_tablesize));
1157 sh->sg_tablesize = numSGE;
1158 }
1159
1160 /* Set the pci device pointer in Scsi_Host structure.
1161 */
1162 scsi_set_device(sh, &ioc->pcidev->dev);
1163
1164 spin_unlock_irqrestore(&ioc->FreeQlock, flags);
1165
1166 hd = (MPT_SCSI_HOST *) sh->hostdata;
1167 hd->ioc = ioc;
1168
1169 /* SCSI needs scsi_cmnd lookup table!
1170 * (with size equal to req_depth*PtrSz!)
1171 */
1172 sz = ioc->req_depth * sizeof(void *);
1173 mem = kmalloc(sz, GFP_ATOMIC);
1174 if (mem == NULL) {
1175 error = -ENOMEM;
1176 goto mptscsih_probe_failed;
1177 }
1178
1179 memset(mem, 0, sz);
1180 hd->ScsiLookup = (struct scsi_cmnd **) mem;
1181
1182 dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n",
1183 ioc->name, hd->ScsiLookup, sz));
1184
1185 /* Allocate memory for the device structures.
1186 * A non-Null pointer at an offset
1187 * indicates a device exists.
1188 * max_id = 1 + maximum id (hosts.h)
1189 */
1190 sz = sh->max_id * sizeof(void *);
1191 mem = kmalloc(sz, GFP_ATOMIC);
1192 if (mem == NULL) {
1193 error = -ENOMEM;
1194 goto mptscsih_probe_failed;
1195 }
1196
1197 memset(mem, 0, sz);
1198 hd->Targets = (VirtDevice **) mem;
1199
1200 dprintk((KERN_INFO
1201 " Targets @ %p, sz=%d\n", hd->Targets, sz));
1202
1203 /* Clear the TM flags
1204 */
1205 hd->tmPending = 0;
1206 hd->tmState = TM_STATE_NONE;
1207 hd->resetPending = 0;
1208 hd->abortSCpnt = NULL;
1209
1210 /* Clear the pointer used to store
1211 * single-threaded commands, i.e., those
1212 * issued during a bus scan, dv and
1213 * configuration pages.
1214 */
1215 hd->cmdPtr = NULL;
1216 930
1217 /* Initialize this SCSI Hosts' timers 931 if (sc->device == NULL)
1218 * To use, set the timer expires field 932 return;
1219 * and add_timer 933 if (sc->device->host == NULL)
1220 */ 934 return;
1221 init_timer(&hd->timer); 935 if ((hd = (MPT_SCSI_HOST *)sc->device->host->hostdata) == NULL)
1222 hd->timer.data = (unsigned long) hd; 936 return;
1223 hd->timer.function = mptscsih_timer_expired;
1224
1225 if (ioc->bus_type == SCSI) {
1226 /* Update with the driver setup
1227 * values.
1228 */
1229 if (ioc->spi_data.maxBusWidth > mpt_width)
1230 ioc->spi_data.maxBusWidth = mpt_width;
1231 if (ioc->spi_data.minSyncFactor < mpt_factor)
1232 ioc->spi_data.minSyncFactor = mpt_factor;
1233
1234 if (ioc->spi_data.minSyncFactor == MPT_ASYNC) {
1235 ioc->spi_data.maxSyncOffset = 0;
1236 }
1237
1238 ioc->spi_data.Saf_Te = mpt_saf_te;
1239
1240 hd->negoNvram = 0;
1241#ifndef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
1242 hd->negoNvram = MPT_SCSICFG_USE_NVRAM;
1243#endif
1244 ioc->spi_data.forceDv = 0;
1245 ioc->spi_data.noQas = 0;
1246 for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) {
1247 ioc->spi_data.dvStatus[ii] =
1248 MPT_SCSICFG_NEGOTIATE;
1249 }
1250
1251 for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++)
1252 ioc->spi_data.dvStatus[ii] |=
1253 MPT_SCSICFG_DV_NOT_DONE;
1254
1255 dinitprintk((MYIOC_s_INFO_FMT
1256 "dv %x width %x factor %x saf_te %x\n",
1257 ioc->name, mpt_dv,
1258 mpt_width,
1259 mpt_factor,
1260 mpt_saf_te));
1261 }
1262
1263 mpt_scsi_hosts++;
1264 937
1265 error = scsi_add_host (sh, &ioc->pcidev->dev); 938 if (time - hd->last_queue_full > 10 * HZ) {
1266 if(error) { 939 dprintk((MYIOC_s_WARN_FMT "Device (%d:%d:%d) reported QUEUE_FULL!\n",
1267 dprintk((KERN_ERR MYNAM 940 hd->ioc->name, 0, sc->device->id, sc->device->lun));
1268 "scsi_add_host failed\n")); 941 hd->last_queue_full = time;
1269 goto mptscsih_probe_failed;
1270 } 942 }
1271
1272 scsi_scan_host(sh);
1273 return 0;
1274
1275mptscsih_probe_failed:
1276
1277 mptscsih_remove(pdev);
1278 return error;
1279
1280} 943}
1281 944
1282/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 945/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1286,7 +949,7 @@ mptscsih_probe_failed:
1286 * 949 *
1287 * 950 *
1288 */ 951 */
1289static void 952void
1290mptscsih_remove(struct pci_dev *pdev) 953mptscsih_remove(struct pci_dev *pdev)
1291{ 954{
1292 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 955 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
@@ -1294,12 +957,16 @@ mptscsih_remove(struct pci_dev *pdev)
1294 MPT_SCSI_HOST *hd; 957 MPT_SCSI_HOST *hd;
1295 int count; 958 int count;
1296 unsigned long flags; 959 unsigned long flags;
960 int sz1;
1297 961
1298 if(!host) 962 if(!host)
1299 return; 963 return;
1300 964
1301 scsi_remove_host(host); 965 scsi_remove_host(host);
1302 966
967 if((hd = (MPT_SCSI_HOST *)host->hostdata) == NULL)
968 return;
969
1303#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION 970#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
1304 /* Check DV thread active */ 971 /* Check DV thread active */
1305 count = 10 * HZ; 972 count = 10 * HZ;
@@ -1321,40 +988,36 @@ mptscsih_remove(struct pci_dev *pdev)
1321#endif 988#endif
1322#endif 989#endif
1323 990
1324 hd = (MPT_SCSI_HOST *)host->hostdata; 991 mptscsih_shutdown(&pdev->dev);
1325 if (hd != NULL) {
1326 int sz1;
1327 992
1328 mptscsih_shutdown(&pdev->dev); 993 sz1=0;
1329 994
1330 sz1=0; 995 if (hd->ScsiLookup != NULL) {
996 sz1 = hd->ioc->req_depth * sizeof(void *);
997 kfree(hd->ScsiLookup);
998 hd->ScsiLookup = NULL;
999 }
1331 1000
1332 if (hd->ScsiLookup != NULL) { 1001 /*
1333 sz1 = hd->ioc->req_depth * sizeof(void *); 1002 * Free pointer array.
1334 kfree(hd->ScsiLookup); 1003 */
1335 hd->ScsiLookup = NULL; 1004 kfree(hd->Targets);
1336 } 1005 hd->Targets = NULL;
1337 1006
1338 if (hd->Targets != NULL) { 1007 dprintk((MYIOC_s_INFO_FMT
1339 /* 1008 "Free'd ScsiLookup (%d) memory\n",
1340 * Free pointer array. 1009 hd->ioc->name, sz1));
1341 */
1342 kfree(hd->Targets);
1343 hd->Targets = NULL;
1344 }
1345 1010
1346 dprintk((MYIOC_s_INFO_FMT 1011 kfree(hd->info_kbuf);
1347 "Free'd ScsiLookup (%d) memory\n",
1348 hd->ioc->name, sz1));
1349 1012
1350 /* NULL the Scsi_Host pointer 1013 /* NULL the Scsi_Host pointer
1351 */ 1014 */
1352 hd->ioc->sh = NULL; 1015 hd->ioc->sh = NULL;
1353 }
1354 1016
1355 scsi_host_put(host); 1017 scsi_host_put(host);
1356 mpt_scsi_hosts--;
1357 1018
1019 mpt_detach(pdev);
1020
1358} 1021}
1359 1022
1360/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1023/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1362,7 +1025,7 @@ mptscsih_remove(struct pci_dev *pdev)
1362 * mptscsih_shutdown - reboot notifier 1025 * mptscsih_shutdown - reboot notifier
1363 * 1026 *
1364 */ 1027 */
1365static void 1028void
1366mptscsih_shutdown(struct device * dev) 1029mptscsih_shutdown(struct device * dev)
1367{ 1030{
1368 MPT_ADAPTER *ioc = pci_get_drvdata(to_pci_dev(dev)); 1031 MPT_ADAPTER *ioc = pci_get_drvdata(to_pci_dev(dev));
@@ -1384,15 +1047,15 @@ mptscsih_shutdown(struct device * dev)
1384#ifdef CONFIG_PM 1047#ifdef CONFIG_PM
1385/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1048/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1386/* 1049/*
1387 * mptscsih_suspend - Fusion MPT scsie driver suspend routine. 1050 * mptscsih_suspend - Fusion MPT scsi driver suspend routine.
1388 * 1051 *
1389 * 1052 *
1390 */ 1053 */
1391static int 1054int
1392mptscsih_suspend(struct pci_dev *pdev, pm_message_t state) 1055mptscsih_suspend(struct pci_dev *pdev, pm_message_t state)
1393{ 1056{
1394 mptscsih_shutdown(&pdev->dev); 1057 mptscsih_shutdown(&pdev->dev);
1395 return 0; 1058 return mpt_suspend(pdev,state);
1396} 1059}
1397 1060
1398/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1061/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1401,13 +1064,15 @@ mptscsih_suspend(struct pci_dev *pdev, pm_message_t state)
1401 * 1064 *
1402 * 1065 *
1403 */ 1066 */
1404static int 1067int
1405mptscsih_resume(struct pci_dev *pdev) 1068mptscsih_resume(struct pci_dev *pdev)
1406{ 1069{
1407 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 1070 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
1408 struct Scsi_Host *host = ioc->sh; 1071 struct Scsi_Host *host = ioc->sh;
1409 MPT_SCSI_HOST *hd; 1072 MPT_SCSI_HOST *hd;
1410 1073
1074 mpt_resume(pdev);
1075
1411 if(!host) 1076 if(!host)
1412 return 0; 1077 return 0;
1413 1078
@@ -1422,9 +1087,9 @@ mptscsih_resume(struct pci_dev *pdev)
1422 if (!dvtaskQ_active) { 1087 if (!dvtaskQ_active) {
1423 dvtaskQ_active = 1; 1088 dvtaskQ_active = 1;
1424 spin_unlock_irqrestore(&dvtaskQ_lock, lflags); 1089 spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
1425 INIT_WORK(&mptscsih_dvTask, 1090 INIT_WORK(&dvTaskQ_task,
1426 mptscsih_domainValidation, (void *) hd); 1091 mptscsih_domainValidation, (void *) hd);
1427 schedule_work(&mptscsih_dvTask); 1092 schedule_work(&dvTaskQ_task);
1428 } else { 1093 } else {
1429 spin_unlock_irqrestore(&dvtaskQ_lock, lflags); 1094 spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
1430 } 1095 }
@@ -1435,82 +1100,6 @@ mptscsih_resume(struct pci_dev *pdev)
1435 1100
1436#endif 1101#endif
1437 1102
1438static struct mpt_pci_driver mptscsih_driver = {
1439 .probe = mptscsih_probe,
1440 .remove = mptscsih_remove,
1441 .shutdown = mptscsih_shutdown,
1442#ifdef CONFIG_PM
1443 .suspend = mptscsih_suspend,
1444 .resume = mptscsih_resume,
1445#endif
1446};
1447
1448/* SCSI host fops start here... */
1449/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1450/**
1451 * mptscsih_init - Register MPT adapter(s) as SCSI host(s) with
1452 * linux scsi mid-layer.
1453 *
1454 * Returns 0 for success, non-zero for failure.
1455 */
1456static int __init
1457mptscsih_init(void)
1458{
1459
1460 show_mptmod_ver(my_NAME, my_VERSION);
1461
1462 ScsiDoneCtx = mpt_register(mptscsih_io_done, MPTSCSIH_DRIVER);
1463 ScsiTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSCSIH_DRIVER);
1464 ScsiScanDvCtx = mpt_register(mptscsih_scandv_complete, MPTSCSIH_DRIVER);
1465
1466 if (mpt_event_register(ScsiDoneCtx, mptscsih_event_process) == 0) {
1467 devtprintk((KERN_INFO MYNAM
1468 ": Registered for IOC event notifications\n"));
1469 }
1470
1471 if (mpt_reset_register(ScsiDoneCtx, mptscsih_ioc_reset) == 0) {
1472 dprintk((KERN_INFO MYNAM
1473 ": Registered for IOC reset notifications\n"));
1474 }
1475
1476 if(mpt_device_driver_register(&mptscsih_driver,
1477 MPTSCSIH_DRIVER) != 0 ) {
1478 dprintk((KERN_INFO MYNAM
1479 ": failed to register dd callbacks\n"));
1480 }
1481
1482 return 0;
1483
1484}
1485
1486/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1487/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1488/**
1489 * mptscsih_exit - Unregisters MPT adapter(s)
1490 *
1491 */
1492static void __exit
1493mptscsih_exit(void)
1494{
1495 mpt_device_driver_deregister(MPTSCSIH_DRIVER);
1496
1497 mpt_reset_deregister(ScsiDoneCtx);
1498 dprintk((KERN_INFO MYNAM
1499 ": Deregistered for IOC reset notifications\n"));
1500
1501 mpt_event_deregister(ScsiDoneCtx);
1502 dprintk((KERN_INFO MYNAM
1503 ": Deregistered for IOC event notifications\n"));
1504
1505 mpt_deregister(ScsiScanDvCtx);
1506 mpt_deregister(ScsiTaskCtx);
1507 mpt_deregister(ScsiDoneCtx);
1508
1509 if (info_kbuf != NULL)
1510 kfree(info_kbuf);
1511
1512}
1513
1514/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1103/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1515/** 1104/**
1516 * mptscsih_info - Return information about MPT adapter 1105 * mptscsih_info - Return information about MPT adapter
@@ -1520,24 +1109,25 @@ mptscsih_exit(void)
1520 * 1109 *
1521 * Returns pointer to buffer where information was written. 1110 * Returns pointer to buffer where information was written.
1522 */ 1111 */
1523static const char * 1112const char *
1524mptscsih_info(struct Scsi_Host *SChost) 1113mptscsih_info(struct Scsi_Host *SChost)
1525{ 1114{
1526 MPT_SCSI_HOST *h; 1115 MPT_SCSI_HOST *h;
1527 int size = 0; 1116 int size = 0;
1528 1117
1529 if (info_kbuf == NULL)
1530 if ((info_kbuf = kmalloc(0x1000 /* 4Kb */, GFP_KERNEL)) == NULL)
1531 return info_kbuf;
1532
1533 h = (MPT_SCSI_HOST *)SChost->hostdata; 1118 h = (MPT_SCSI_HOST *)SChost->hostdata;
1534 info_kbuf[0] = '\0'; 1119
1535 if (h) { 1120 if (h) {
1536 mpt_print_ioc_summary(h->ioc, info_kbuf, &size, 0, 0); 1121 if (h->info_kbuf == NULL)
1537 info_kbuf[size-1] = '\0'; 1122 if ((h->info_kbuf = kmalloc(0x1000 /* 4Kb */, GFP_KERNEL)) == NULL)
1123 return h->info_kbuf;
1124 h->info_kbuf[0] = '\0';
1125
1126 mpt_print_ioc_summary(h->ioc, h->info_kbuf, &size, 0, 0);
1127 h->info_kbuf[size-1] = '\0';
1538 } 1128 }
1539 1129
1540 return info_kbuf; 1130 return h->info_kbuf;
1541} 1131}
1542 1132
1543struct info_str { 1133struct info_str {
@@ -1547,7 +1137,8 @@ struct info_str {
1547 int pos; 1137 int pos;
1548}; 1138};
1549 1139
1550static void copy_mem_info(struct info_str *info, char *data, int len) 1140static void
1141mptscsih_copy_mem_info(struct info_str *info, char *data, int len)
1551{ 1142{
1552 if (info->pos + len > info->length) 1143 if (info->pos + len > info->length)
1553 len = info->length - info->pos; 1144 len = info->length - info->pos;
@@ -1568,7 +1159,8 @@ static void copy_mem_info(struct info_str *info, char *data, int len)
1568 } 1159 }
1569} 1160}
1570 1161
1571static int copy_info(struct info_str *info, char *fmt, ...) 1162static int
1163mptscsih_copy_info(struct info_str *info, char *fmt, ...)
1572{ 1164{
1573 va_list args; 1165 va_list args;
1574 char buf[81]; 1166 char buf[81];
@@ -1578,11 +1170,12 @@ static int copy_info(struct info_str *info, char *fmt, ...)
1578 len = vsprintf(buf, fmt, args); 1170 len = vsprintf(buf, fmt, args);
1579 va_end(args); 1171 va_end(args);
1580 1172
1581 copy_mem_info(info, buf, len); 1173 mptscsih_copy_mem_info(info, buf, len);
1582 return len; 1174 return len;
1583} 1175}
1584 1176
1585static int mptscsih_host_info(MPT_ADAPTER *ioc, char *pbuf, off_t offset, int len) 1177static int
1178mptscsih_host_info(MPT_ADAPTER *ioc, char *pbuf, off_t offset, int len)
1586{ 1179{
1587 struct info_str info; 1180 struct info_str info;
1588 1181
@@ -1591,10 +1184,10 @@ static int mptscsih_host_info(MPT_ADAPTER *ioc, char *pbuf, off_t offset, int le
1591 info.offset = offset; 1184 info.offset = offset;
1592 info.pos = 0; 1185 info.pos = 0;
1593 1186
1594 copy_info(&info, "%s: %s, ", ioc->name, ioc->prod_name); 1187 mptscsih_copy_info(&info, "%s: %s, ", ioc->name, ioc->prod_name);
1595 copy_info(&info, "%s%08xh, ", MPT_FW_REV_MAGIC_ID_STRING, ioc->facts.FWVersion.Word); 1188 mptscsih_copy_info(&info, "%s%08xh, ", MPT_FW_REV_MAGIC_ID_STRING, ioc->facts.FWVersion.Word);
1596 copy_info(&info, "Ports=%d, ", ioc->facts.NumberOfPorts); 1189 mptscsih_copy_info(&info, "Ports=%d, ", ioc->facts.NumberOfPorts);
1597 copy_info(&info, "MaxQ=%d\n", ioc->req_depth); 1190 mptscsih_copy_info(&info, "MaxQ=%d\n", ioc->req_depth);
1598 1191
1599 return ((info.pos > info.offset) ? info.pos - info.offset : 0); 1192 return ((info.pos > info.offset) ? info.pos - info.offset : 0);
1600} 1193}
@@ -1612,7 +1205,7 @@ static int mptscsih_host_info(MPT_ADAPTER *ioc, char *pbuf, off_t offset, int le
1612 * hostno: scsi host number 1205 * hostno: scsi host number
1613 * func: if write = 1; if read = 0 1206 * func: if write = 1; if read = 0
1614 */ 1207 */
1615static int 1208int
1616mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, 1209mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,
1617 int length, int func) 1210 int length, int func)
1618{ 1211{
@@ -1649,7 +1242,7 @@ mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t off
1649 * 1242 *
1650 * Returns 0. (rtn value discarded by linux scsi mid-layer) 1243 * Returns 0. (rtn value discarded by linux scsi mid-layer)
1651 */ 1244 */
1652static int 1245int
1653mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) 1246mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1654{ 1247{
1655 MPT_SCSI_HOST *hd; 1248 MPT_SCSI_HOST *hd;
@@ -1684,7 +1277,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1684 /* 1277 /*
1685 * Put together a MPT SCSI request... 1278 * Put together a MPT SCSI request...
1686 */ 1279 */
1687 if ((mf = mpt_get_msg_frame(ScsiDoneCtx, hd->ioc)) == NULL) { 1280 if ((mf = mpt_get_msg_frame(hd->ioc->DoneCtx, hd->ioc)) == NULL) {
1688 dprintk((MYIOC_s_WARN_FMT "QueueCmd, no msg frames!!\n", 1281 dprintk((MYIOC_s_WARN_FMT "QueueCmd, no msg frames!!\n",
1689 hd->ioc->name)); 1282 hd->ioc->name));
1690 return SCSI_MLQUEUE_HOST_BUSY; 1283 return SCSI_MLQUEUE_HOST_BUSY;
@@ -1696,8 +1289,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1696 1289
1697 ADD_INDEX_LOG(my_idx); 1290 ADD_INDEX_LOG(my_idx);
1698 1291
1699 /* BUG FIX! 19991030 -sralston 1292 /* TUR's being issued with scsictl=0x02000000 (DATA_IN)!
1700 * TUR's being issued with scsictl=0x02000000 (DATA_IN)!
1701 * Seems we may receive a buffer (datalen>0) even when there 1293 * Seems we may receive a buffer (datalen>0) even when there
1702 * will be no data transfer! GRRRRR... 1294 * will be no data transfer! GRRRRR...
1703 */ 1295 */
@@ -1791,9 +1383,9 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1791 if (!dvtaskQ_active) { 1383 if (!dvtaskQ_active) {
1792 dvtaskQ_active = 1; 1384 dvtaskQ_active = 1;
1793 spin_unlock_irqrestore(&dvtaskQ_lock, lflags); 1385 spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
1794 INIT_WORK(&mptscsih_dvTask, mptscsih_domainValidation, (void *) hd); 1386 INIT_WORK(&dvTaskQ_task, mptscsih_domainValidation, (void *) hd);
1795 1387
1796 schedule_work(&mptscsih_dvTask); 1388 schedule_work(&dvTaskQ_task);
1797 } else { 1389 } else {
1798 spin_unlock_irqrestore(&dvtaskQ_lock, lflags); 1390 spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
1799 } 1391 }
@@ -1819,7 +1411,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
1819 } 1411 }
1820#endif 1412#endif
1821 1413
1822 mpt_put_msg_frame(ScsiDoneCtx, hd->ioc, mf); 1414 mpt_put_msg_frame(hd->ioc->DoneCtx, hd->ioc, mf);
1823 dmfprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (%p) mf=%p idx=%d\n", 1415 dmfprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (%p) mf=%p idx=%d\n",
1824 hd->ioc->name, SCpnt, mf, my_idx)); 1416 hd->ioc->name, SCpnt, mf, my_idx));
1825 DBG_DUMP_REQUEST_FRAME(mf) 1417 DBG_DUMP_REQUEST_FRAME(mf)
@@ -2036,7 +1628,7 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun
2036 1628
2037 /* Return Fail to calling function if no message frames available. 1629 /* Return Fail to calling function if no message frames available.
2038 */ 1630 */
2039 if ((mf = mpt_get_msg_frame(ScsiTaskCtx, hd->ioc)) == NULL) { 1631 if ((mf = mpt_get_msg_frame(hd->ioc->TaskCtx, hd->ioc)) == NULL) {
2040 dfailprintk((MYIOC_s_ERR_FMT "IssueTaskMgmt, no msg frames!!\n", 1632 dfailprintk((MYIOC_s_ERR_FMT "IssueTaskMgmt, no msg frames!!\n",
2041 hd->ioc->name)); 1633 hd->ioc->name));
2042 //return FAILED; 1634 //return FAILED;
@@ -2075,7 +1667,7 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun
2075 1667
2076 DBG_DUMP_TM_REQUEST_FRAME((u32 *)pScsiTm); 1668 DBG_DUMP_TM_REQUEST_FRAME((u32 *)pScsiTm);
2077 1669
2078 if ((retval = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc, 1670 if ((retval = mpt_send_handshake_request(hd->ioc->TaskCtx, hd->ioc,
2079 sizeof(SCSITaskMgmt_t), (u32*)pScsiTm, 1671 sizeof(SCSITaskMgmt_t), (u32*)pScsiTm,
2080 CAN_SLEEP)) != 0) { 1672 CAN_SLEEP)) != 0) {
2081 dfailprintk((MYIOC_s_ERR_FMT "_send_handshake FAILED!" 1673 dfailprintk((MYIOC_s_ERR_FMT "_send_handshake FAILED!"
@@ -2107,7 +1699,7 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun
2107 * 1699 *
2108 * Returns SUCCESS or FAILED. 1700 * Returns SUCCESS or FAILED.
2109 */ 1701 */
2110static int 1702int
2111mptscsih_abort(struct scsi_cmnd * SCpnt) 1703mptscsih_abort(struct scsi_cmnd * SCpnt)
2112{ 1704{
2113 MPT_SCSI_HOST *hd; 1705 MPT_SCSI_HOST *hd;
@@ -2115,7 +1707,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
2115 MPT_FRAME_HDR *mf; 1707 MPT_FRAME_HDR *mf;
2116 u32 ctx2abort; 1708 u32 ctx2abort;
2117 int scpnt_idx; 1709 int scpnt_idx;
2118 spinlock_t *host_lock = SCpnt->device->host->host_lock;
2119 1710
2120 /* If we can't locate our host adapter structure, return FAILED status. 1711 /* If we can't locate our host adapter structure, return FAILED status.
2121 */ 1712 */
@@ -2163,7 +1754,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
2163 1754
2164 hd->abortSCpnt = SCpnt; 1755 hd->abortSCpnt = SCpnt;
2165 1756
2166 spin_unlock_irq(host_lock);
2167 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK, 1757 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK,
2168 SCpnt->device->channel, SCpnt->device->id, SCpnt->device->lun, 1758 SCpnt->device->channel, SCpnt->device->id, SCpnt->device->lun,
2169 ctx2abort, 2 /* 2 second timeout */) 1759 ctx2abort, 2 /* 2 second timeout */)
@@ -2180,8 +1770,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
2180 hd->tmPending = 0; 1770 hd->tmPending = 0;
2181 hd->tmState = TM_STATE_NONE; 1771 hd->tmState = TM_STATE_NONE;
2182 1772
2183 spin_lock_irq(host_lock);
2184
2185 /* Unmap the DMA buffers, if any. */ 1773 /* Unmap the DMA buffers, if any. */
2186 if (SCpnt->use_sg) { 1774 if (SCpnt->use_sg) {
2187 pci_unmap_sg(ioc->pcidev, (struct scatterlist *) SCpnt->request_buffer, 1775 pci_unmap_sg(ioc->pcidev, (struct scatterlist *) SCpnt->request_buffer,
@@ -2197,7 +1785,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
2197 mpt_free_msg_frame(ioc, mf); 1785 mpt_free_msg_frame(ioc, mf);
2198 return FAILED; 1786 return FAILED;
2199 } 1787 }
2200 spin_lock_irq(host_lock);
2201 return SUCCESS; 1788 return SUCCESS;
2202} 1789}
2203 1790
@@ -2210,11 +1797,10 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
2210 * 1797 *
2211 * Returns SUCCESS or FAILED. 1798 * Returns SUCCESS or FAILED.
2212 */ 1799 */
2213static int 1800int
2214mptscsih_dev_reset(struct scsi_cmnd * SCpnt) 1801mptscsih_dev_reset(struct scsi_cmnd * SCpnt)
2215{ 1802{
2216 MPT_SCSI_HOST *hd; 1803 MPT_SCSI_HOST *hd;
2217 spinlock_t *host_lock = SCpnt->device->host->host_lock;
2218 1804
2219 /* If we can't locate our host adapter structure, return FAILED status. 1805 /* If we can't locate our host adapter structure, return FAILED status.
2220 */ 1806 */
@@ -2231,7 +1817,6 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt)
2231 printk(KERN_WARNING MYNAM ": %s: >> Attempting target reset! (sc=%p)\n", 1817 printk(KERN_WARNING MYNAM ": %s: >> Attempting target reset! (sc=%p)\n",
2232 hd->ioc->name, SCpnt); 1818 hd->ioc->name, SCpnt);
2233 1819
2234 spin_unlock_irq(host_lock);
2235 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 1820 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET,
2236 SCpnt->device->channel, SCpnt->device->id, 1821 SCpnt->device->channel, SCpnt->device->id,
2237 0, 0, 5 /* 5 second timeout */) 1822 0, 0, 5 /* 5 second timeout */)
@@ -2243,12 +1828,10 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt)
2243 hd->ioc->name, SCpnt); 1828 hd->ioc->name, SCpnt);
2244 hd->tmPending = 0; 1829 hd->tmPending = 0;
2245 hd->tmState = TM_STATE_NONE; 1830 hd->tmState = TM_STATE_NONE;
2246 spin_lock_irq(host_lock);
2247 return FAILED; 1831 return FAILED;
2248 } 1832 }
2249 spin_lock_irq(host_lock);
2250 return SUCCESS;
2251 1833
1834 return SUCCESS;
2252} 1835}
2253 1836
2254/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1837/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -2260,7 +1843,7 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt)
2260 * 1843 *
2261 * Returns SUCCESS or FAILED. 1844 * Returns SUCCESS or FAILED.
2262 */ 1845 */
2263static int 1846int
2264mptscsih_bus_reset(struct scsi_cmnd * SCpnt) 1847mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
2265{ 1848{
2266 MPT_SCSI_HOST *hd; 1849 MPT_SCSI_HOST *hd;
@@ -2282,7 +1865,6 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
2282 hd->timeouts++; 1865 hd->timeouts++;
2283 1866
2284 /* We are now ready to execute the task management request. */ 1867 /* We are now ready to execute the task management request. */
2285 spin_unlock_irq(host_lock);
2286 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS, 1868 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS,
2287 SCpnt->device->channel, 0, 0, 0, 5 /* 5 second timeout */) 1869 SCpnt->device->channel, 0, 0, 0, 5 /* 5 second timeout */)
2288 < 0){ 1870 < 0){
@@ -2298,7 +1880,7 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
2298 spin_lock_irq(host_lock); 1880 spin_lock_irq(host_lock);
2299 return FAILED; 1881 return FAILED;
2300 } 1882 }
2301 spin_lock_irq(host_lock); 1883
2302 return SUCCESS; 1884 return SUCCESS;
2303} 1885}
2304 1886
@@ -2312,12 +1894,11 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
2312 * 1894 *
2313 * Returns SUCCESS or FAILED. 1895 * Returns SUCCESS or FAILED.
2314 */ 1896 */
2315static int 1897int
2316mptscsih_host_reset(struct scsi_cmnd *SCpnt) 1898mptscsih_host_reset(struct scsi_cmnd *SCpnt)
2317{ 1899{
2318 MPT_SCSI_HOST * hd; 1900 MPT_SCSI_HOST * hd;
2319 int status = SUCCESS; 1901 int status = SUCCESS;
2320 spinlock_t *host_lock = SCpnt->device->host->host_lock;
2321 1902
2322 /* If we can't locate the host to reset, then we failed. */ 1903 /* If we can't locate the host to reset, then we failed. */
2323 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){ 1904 if ((hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata) == NULL){
@@ -2333,7 +1914,6 @@ mptscsih_host_reset(struct scsi_cmnd *SCpnt)
2333 /* If our attempts to reset the host failed, then return a failed 1914 /* If our attempts to reset the host failed, then return a failed
2334 * status. The host will be taken off line by the SCSI mid-layer. 1915 * status. The host will be taken off line by the SCSI mid-layer.
2335 */ 1916 */
2336 spin_unlock_irq(host_lock);
2337 if (mpt_HardResetHandler(hd->ioc, CAN_SLEEP) < 0){ 1917 if (mpt_HardResetHandler(hd->ioc, CAN_SLEEP) < 0){
2338 status = FAILED; 1918 status = FAILED;
2339 } else { 1919 } else {
@@ -2343,8 +1923,6 @@ mptscsih_host_reset(struct scsi_cmnd *SCpnt)
2343 hd->tmPending = 0; 1923 hd->tmPending = 0;
2344 hd->tmState = TM_STATE_NONE; 1924 hd->tmState = TM_STATE_NONE;
2345 } 1925 }
2346 spin_lock_irq(host_lock);
2347
2348 1926
2349 dtmprintk( ( KERN_WARNING MYNAM ": mptscsih_host_reset: " 1927 dtmprintk( ( KERN_WARNING MYNAM ": mptscsih_host_reset: "
2350 "Status = %s\n", 1928 "Status = %s\n",
@@ -2426,7 +2004,7 @@ mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout )
2426 * 2004 *
2427 * Returns 1 indicating alloc'd request frame ptr should be freed. 2005 * Returns 1 indicating alloc'd request frame ptr should be freed.
2428 */ 2006 */
2429static int 2007int
2430mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) 2008mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
2431{ 2009{
2432 SCSITaskMgmtReply_t *pScsiTmReply; 2010 SCSITaskMgmtReply_t *pScsiTmReply;
@@ -2509,7 +2087,7 @@ mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *m
2509/* 2087/*
2510 * This is anyones guess quite frankly. 2088 * This is anyones guess quite frankly.
2511 */ 2089 */
2512static int 2090int
2513mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, 2091mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev,
2514 sector_t capacity, int geom[]) 2092 sector_t capacity, int geom[])
2515{ 2093{
@@ -2556,7 +2134,7 @@ mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev,
2556 * Return non-zero if allocation fails. 2134 * Return non-zero if allocation fails.
2557 * Init memory once per id (not LUN). 2135 * Init memory once per id (not LUN).
2558 */ 2136 */
2559static int 2137int
2560mptscsih_slave_alloc(struct scsi_device *device) 2138mptscsih_slave_alloc(struct scsi_device *device)
2561{ 2139{
2562 struct Scsi_Host *host = device->host; 2140 struct Scsi_Host *host = device->host;
@@ -2599,7 +2177,8 @@ mptscsih_slave_alloc(struct scsi_device *device)
2599 return 0; 2177 return 0;
2600} 2178}
2601 2179
2602static int mptscsih_is_raid_volume(MPT_SCSI_HOST *hd, uint id) 2180static int
2181mptscsih_is_raid_volume(MPT_SCSI_HOST *hd, uint id)
2603{ 2182{
2604 int i; 2183 int i;
2605 2184
@@ -2618,7 +2197,7 @@ static int mptscsih_is_raid_volume(MPT_SCSI_HOST *hd, uint id)
2618 * OS entry point to allow for host driver to free allocated memory 2197 * OS entry point to allow for host driver to free allocated memory
2619 * Called if no device present or device being unloaded 2198 * Called if no device present or device being unloaded
2620 */ 2199 */
2621static void 2200void
2622mptscsih_slave_destroy(struct scsi_device *device) 2201mptscsih_slave_destroy(struct scsi_device *device)
2623{ 2202{
2624 struct Scsi_Host *host = device->host; 2203 struct Scsi_Host *host = device->host;
@@ -2639,7 +2218,7 @@ mptscsih_slave_destroy(struct scsi_device *device)
2639 2218
2640 kfree(hd->Targets[target]); 2219 kfree(hd->Targets[target]);
2641 hd->Targets[target] = NULL; 2220 hd->Targets[target] = NULL;
2642 2221
2643 if (hd->ioc->bus_type == SCSI) { 2222 if (hd->ioc->bus_type == SCSI) {
2644 if (mptscsih_is_raid_volume(hd, target)) { 2223 if (mptscsih_is_raid_volume(hd, target)) {
2645 hd->ioc->spi_data.forceDv |= MPT_SCSICFG_RELOAD_IOC_PG3; 2224 hd->ioc->spi_data.forceDv |= MPT_SCSICFG_RELOAD_IOC_PG3;
@@ -2695,7 +2274,7 @@ mptscsih_set_queue_depth(struct scsi_device *device, MPT_SCSI_HOST *hd,
2695 * member to 1 if a device does not support Q tags. 2274 * member to 1 if a device does not support Q tags.
2696 * Return non-zero if fails. 2275 * Return non-zero if fails.
2697 */ 2276 */
2698static int 2277int
2699mptscsih_slave_configure(struct scsi_device *device) 2278mptscsih_slave_configure(struct scsi_device *device)
2700{ 2279{
2701 struct Scsi_Host *sh = device->host; 2280 struct Scsi_Host *sh = device->host;
@@ -2758,8 +2337,8 @@ slave_configure_exit:
2758 return 0; 2337 return 0;
2759} 2338}
2760 2339
2761static ssize_t 2340ssize_t
2762mptscsih_store_queue_depth(struct device *dev, const char *buf, size_t count) 2341mptscsih_store_queue_depth(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
2763{ 2342{
2764 int depth; 2343 int depth;
2765 struct scsi_device *sdev = to_scsi_device(dev); 2344 struct scsi_device *sdev = to_scsi_device(dev);
@@ -2788,7 +2367,7 @@ mptscsih_store_queue_depth(struct device *dev, const char *buf, size_t count)
2788 * 2367 *
2789 */ 2368 */
2790static void 2369static void
2791copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply) 2370mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply)
2792{ 2371{
2793 VirtDevice *target; 2372 VirtDevice *target;
2794 SCSIIORequest_t *pReq; 2373 SCSIIORequest_t *pReq;
@@ -2854,7 +2433,7 @@ SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc)
2854} 2433}
2855 2434
2856/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 2435/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
2857static int 2436int
2858mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) 2437mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
2859{ 2438{
2860 MPT_SCSI_HOST *hd; 2439 MPT_SCSI_HOST *hd;
@@ -2949,8 +2528,8 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
2949 */ 2528 */
2950 hd->pLocal = &hd->localReply; 2529 hd->pLocal = &hd->localReply;
2951 hd->pLocal->completion = MPT_SCANDV_DID_RESET; 2530 hd->pLocal->completion = MPT_SCANDV_DID_RESET;
2952 scandv_wait_done = 1; 2531 hd->scandv_wait_done = 1;
2953 wake_up(&scandv_waitq); 2532 wake_up(&hd->scandv_waitq);
2954 hd->cmdPtr = NULL; 2533 hd->cmdPtr = NULL;
2955 } 2534 }
2956 2535
@@ -2969,7 +2548,7 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
2969} 2548}
2970 2549
2971/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 2550/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
2972static int 2551int
2973mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) 2552mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
2974{ 2553{
2975 MPT_SCSI_HOST *hd; 2554 MPT_SCSI_HOST *hd;
@@ -3085,42 +2664,6 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
3085 return 1; /* currently means nothing really */ 2664 return 1; /* currently means nothing really */
3086} 2665}
3087 2666
3088static struct device_attribute mptscsih_queue_depth_attr = {
3089 .attr = {
3090 .name = "queue_depth",
3091 .mode = S_IWUSR,
3092 },
3093 .store = mptscsih_store_queue_depth,
3094};
3095
3096static struct device_attribute *mptscsih_dev_attrs[] = {
3097 &mptscsih_queue_depth_attr,
3098 NULL,
3099};
3100
3101static struct scsi_host_template driver_template = {
3102 .proc_name = "mptscsih",
3103 .proc_info = mptscsih_proc_info,
3104 .name = "MPT SCSI Host",
3105 .info = mptscsih_info,
3106 .queuecommand = mptscsih_qcmd,
3107 .slave_alloc = mptscsih_slave_alloc,
3108 .slave_configure = mptscsih_slave_configure,
3109 .slave_destroy = mptscsih_slave_destroy,
3110 .eh_abort_handler = mptscsih_abort,
3111 .eh_device_reset_handler = mptscsih_dev_reset,
3112 .eh_bus_reset_handler = mptscsih_bus_reset,
3113 .eh_host_reset_handler = mptscsih_host_reset,
3114 .bios_param = mptscsih_bios_param,
3115 .can_queue = MPT_SCSI_CAN_QUEUE,
3116 .this_id = -1,
3117 .sg_tablesize = MPT_SCSI_SG_DEPTH,
3118 .max_sectors = 8192,
3119 .cmd_per_lun = 7,
3120 .use_clustering = ENABLE_CLUSTERING,
3121 .sdev_attrs = mptscsih_dev_attrs,
3122};
3123
3124/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 2667/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
3125/* 2668/*
3126 * mptscsih_initTarget - Target, LUN alloc/free functionality. 2669 * mptscsih_initTarget - Target, LUN alloc/free functionality.
@@ -3158,9 +2701,9 @@ mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *
3158 * around a bug in th emid-layer in some distributions in which the mid-layer will 2701 * around a bug in th emid-layer in some distributions in which the mid-layer will
3159 * continue to try to communicate to the LUN and evntually create a dummy LUN. 2702 * continue to try to communicate to the LUN and evntually create a dummy LUN.
3160 */ 2703 */
3161 if (mpt_pq_filter && dlen && (data[0] & 0xE0)) 2704 if (hd->mpt_pq_filter && dlen && (data[0] & 0xE0))
3162 data[0] |= 0x40; 2705 data[0] |= 0x40;
3163 2706
3164 /* Is LUN supported? If so, upper 2 bits will be 0 2707 /* Is LUN supported? If so, upper 2 bits will be 0
3165 * in first byte of inquiry data. 2708 * in first byte of inquiry data.
3166 */ 2709 */
@@ -3307,7 +2850,7 @@ mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56)
3307 ddvtprintk((KERN_INFO "Enabling QAS on id=%d due to ~TARGET_FLAGS_VALID_56!\n", id)); 2850 ddvtprintk((KERN_INFO "Enabling QAS on id=%d due to ~TARGET_FLAGS_VALID_56!\n", id));
3308 noQas = 0; 2851 noQas = 0;
3309 } 2852 }
3310 2853
3311 offset = pspi_data->maxSyncOffset; 2854 offset = pspi_data->maxSyncOffset;
3312 2855
3313 /* If RAID, never disable QAS 2856 /* If RAID, never disable QAS
@@ -3401,7 +2944,7 @@ mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56)
3401 if ( (vdev = hd->Targets[ii]) ) { 2944 if ( (vdev = hd->Targets[ii]) ) {
3402 vdev->negoFlags |= MPT_TARGET_NO_NEGO_QAS; 2945 vdev->negoFlags |= MPT_TARGET_NO_NEGO_QAS;
3403 mptscsih_writeSDP1(hd, 0, ii, vdev->negoFlags); 2946 mptscsih_writeSDP1(hd, 0, ii, vdev->negoFlags);
3404 } 2947 }
3405 } 2948 }
3406 } 2949 }
3407 } 2950 }
@@ -3426,14 +2969,15 @@ mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byte56)
3426 * Tapes, initTarget will set this flag on completion of Inquiry command. 2969 * Tapes, initTarget will set this flag on completion of Inquiry command.
3427 * Called only if DV_NOT_DONE flag is set 2970 * Called only if DV_NOT_DONE flag is set
3428 */ 2971 */
3429static void mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq) 2972static void
2973mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq)
3430{ 2974{
3431 u8 cmd; 2975 u8 cmd;
3432 ScsiCfgData *pSpi; 2976 ScsiCfgData *pSpi;
3433 2977
3434 ddvtprintk((" set_dvflags: id=%d lun=%d negoNvram=%x cmd=%x\n", 2978 ddvtprintk((" set_dvflags: id=%d lun=%d negoNvram=%x cmd=%x\n",
3435 pReq->TargetID, pReq->LUN[1], hd->negoNvram, pReq->CDB[0])); 2979 pReq->TargetID, pReq->LUN[1], hd->negoNvram, pReq->CDB[0]));
3436 2980
3437 if ((pReq->LUN[1] != 0) || (hd->negoNvram != 0)) 2981 if ((pReq->LUN[1] != 0) || (hd->negoNvram != 0))
3438 return; 2982 return;
3439 2983
@@ -3464,7 +3008,8 @@ static void mptscsih_set_dvflags(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq)
3464 * If no Target, bus reset on 1st I/O. Set the flag to 3008 * If no Target, bus reset on 1st I/O. Set the flag to
3465 * prevent any future negotiations to this device. 3009 * prevent any future negotiations to this device.
3466 */ 3010 */
3467static void mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id) 3011static void
3012mptscsih_no_negotiate(MPT_SCSI_HOST *hd, int target_id)
3468{ 3013{
3469 3014
3470 if ((hd->Targets) && (hd->Targets[target_id] == NULL)) 3015 if ((hd->Targets) && (hd->Targets[target_id] == NULL))
@@ -3631,7 +3176,7 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags)
3631 offset = pTarget->maxOffset; 3176 offset = pTarget->maxOffset;
3632 negoFlags = pTarget->negoFlags; 3177 negoFlags = pTarget->negoFlags;
3633 } 3178 }
3634 3179
3635#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION 3180#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
3636 /* Force to async and narrow if DV has not been executed 3181 /* Force to async and narrow if DV has not been executed
3637 * for this ID 3182 * for this ID
@@ -3653,7 +3198,7 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags)
3653 3198
3654 /* Get a MF for this command. 3199 /* Get a MF for this command.
3655 */ 3200 */
3656 if ((mf = mpt_get_msg_frame(ScsiDoneCtx, ioc)) == NULL) { 3201 if ((mf = mpt_get_msg_frame(ioc->DoneCtx, ioc)) == NULL) {
3657 dprintk((MYIOC_s_WARN_FMT "write SDP1: no msg frames!\n", 3202 dprintk((MYIOC_s_WARN_FMT "write SDP1: no msg frames!\n",
3658 ioc->name)); 3203 ioc->name));
3659 return -EAGAIN; 3204 return -EAGAIN;
@@ -3717,7 +3262,7 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags)
3717 ioc->name, id, (id | (bus<<8)), 3262 ioc->name, id, (id | (bus<<8)),
3718 requested, configuration)); 3263 requested, configuration));
3719 3264
3720 mpt_put_msg_frame(ScsiDoneCtx, ioc, mf); 3265 mpt_put_msg_frame(ioc->DoneCtx, ioc, mf);
3721 } 3266 }
3722 3267
3723 return 0; 3268 return 0;
@@ -3748,7 +3293,7 @@ mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus)
3748 3293
3749 /* Get a MF for this command. 3294 /* Get a MF for this command.
3750 */ 3295 */
3751 if ((mf = mpt_get_msg_frame(ScsiDoneCtx, ioc)) == NULL) { 3296 if ((mf = mpt_get_msg_frame(ioc->DoneCtx, ioc)) == NULL) {
3752 dprintk((MYIOC_s_WARN_FMT "writeIOCPage4 : no msg frames!\n", 3297 dprintk((MYIOC_s_WARN_FMT "writeIOCPage4 : no msg frames!\n",
3753 ioc->name)); 3298 ioc->name));
3754 return -EAGAIN; 3299 return -EAGAIN;
@@ -3794,7 +3339,7 @@ mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus)
3794 "writeIOCPage4: MaxSEP=%d ActiveSEP=%d id=%d bus=%d\n", 3339 "writeIOCPage4: MaxSEP=%d ActiveSEP=%d id=%d bus=%d\n",
3795 ioc->name, IOCPage4Ptr->MaxSEP, IOCPage4Ptr->ActiveSEP, target_id, bus)); 3340 ioc->name, IOCPage4Ptr->MaxSEP, IOCPage4Ptr->ActiveSEP, target_id, bus));
3796 3341
3797 mpt_put_msg_frame(ScsiDoneCtx, ioc, mf); 3342 mpt_put_msg_frame(ioc->DoneCtx, ioc, mf);
3798 3343
3799 return 0; 3344 return 0;
3800} 3345}
@@ -3824,7 +3369,7 @@ mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus)
3824 * in the IOC member localReply structure. 3369 * in the IOC member localReply structure.
3825 * Used ONLY for DV and other internal commands. 3370 * Used ONLY for DV and other internal commands.
3826 */ 3371 */
3827static int 3372int
3828mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) 3373mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
3829{ 3374{
3830 MPT_SCSI_HOST *hd; 3375 MPT_SCSI_HOST *hd;
@@ -3832,6 +3377,8 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
3832 int completionCode; 3377 int completionCode;
3833 u16 req_idx; 3378 u16 req_idx;
3834 3379
3380 hd = (MPT_SCSI_HOST *) ioc->sh->hostdata;
3381
3835 if ((mf == NULL) || 3382 if ((mf == NULL) ||
3836 (mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth))) { 3383 (mf >= MPT_INDEX_2_MFPTR(ioc, ioc->req_depth))) {
3837 printk(MYIOC_s_ERR_FMT 3384 printk(MYIOC_s_ERR_FMT
@@ -3840,7 +3387,6 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
3840 goto wakeup; 3387 goto wakeup;
3841 } 3388 }
3842 3389
3843 hd = (MPT_SCSI_HOST *) ioc->sh->hostdata;
3844 del_timer(&hd->timer); 3390 del_timer(&hd->timer);
3845 req_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); 3391 req_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx);
3846 hd->ScsiLookup[req_idx] = NULL; 3392 hd->ScsiLookup[req_idx] = NULL;
@@ -3972,8 +3518,8 @@ wakeup:
3972 /* 3518 /*
3973 * Wake up the original calling thread 3519 * Wake up the original calling thread
3974 */ 3520 */
3975 scandv_wait_done = 1; 3521 hd->scandv_wait_done = 1;
3976 wake_up(&scandv_waitq); 3522 wake_up(&hd->scandv_waitq);
3977 3523
3978 return 1; 3524 return 1;
3979} 3525}
@@ -3984,7 +3530,8 @@ wakeup:
3984 * @data: Pointer to MPT_SCSI_HOST recast as an unsigned long 3530 * @data: Pointer to MPT_SCSI_HOST recast as an unsigned long
3985 * 3531 *
3986 */ 3532 */
3987static void mptscsih_timer_expired(unsigned long data) 3533void
3534mptscsih_timer_expired(unsigned long data)
3988{ 3535{
3989 MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *) data; 3536 MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *) data;
3990 3537
@@ -4051,7 +3598,7 @@ mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io)
4051 3598
4052 /* Get and Populate a free Frame 3599 /* Get and Populate a free Frame
4053 */ 3600 */
4054 if ((mf = mpt_get_msg_frame(ScsiScanDvCtx, hd->ioc)) == NULL) { 3601 if ((mf = mpt_get_msg_frame(hd->ioc->InternalCtx, hd->ioc)) == NULL) {
4055 ddvprintk((MYIOC_s_WARN_FMT "_do_raid: no msg frames!\n", 3602 ddvprintk((MYIOC_s_WARN_FMT "_do_raid: no msg frames!\n",
4056 hd->ioc->name)); 3603 hd->ioc->name));
4057 return -EAGAIN; 3604 return -EAGAIN;
@@ -4077,7 +3624,7 @@ mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io)
4077 3624
4078 hd->pLocal = NULL; 3625 hd->pLocal = NULL;
4079 hd->timer.expires = jiffies + HZ*10; /* 10 second timeout */ 3626 hd->timer.expires = jiffies + HZ*10; /* 10 second timeout */
4080 scandv_wait_done = 0; 3627 hd->scandv_wait_done = 0;
4081 3628
4082 /* Save cmd pointer, for resource free if timeout or 3629 /* Save cmd pointer, for resource free if timeout or
4083 * FW reload occurs 3630 * FW reload occurs
@@ -4085,8 +3632,8 @@ mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io)
4085 hd->cmdPtr = mf; 3632 hd->cmdPtr = mf;
4086 3633
4087 add_timer(&hd->timer); 3634 add_timer(&hd->timer);
4088 mpt_put_msg_frame(ScsiScanDvCtx, hd->ioc, mf); 3635 mpt_put_msg_frame(hd->ioc->InternalCtx, hd->ioc, mf);
4089 wait_event(scandv_waitq, scandv_wait_done); 3636 wait_event(hd->scandv_waitq, hd->scandv_wait_done);
4090 3637
4091 if ((hd->pLocal == NULL) || (hd->pLocal->completion != MPT_SCANDV_GOOD)) 3638 if ((hd->pLocal == NULL) || (hd->pLocal->completion != MPT_SCANDV_GOOD))
4092 return -1; 3639 return -1;
@@ -4232,7 +3779,7 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
4232 3779
4233 /* Get and Populate a free Frame 3780 /* Get and Populate a free Frame
4234 */ 3781 */
4235 if ((mf = mpt_get_msg_frame(ScsiScanDvCtx, hd->ioc)) == NULL) { 3782 if ((mf = mpt_get_msg_frame(hd->ioc->InternalCtx, hd->ioc)) == NULL) {
4236 ddvprintk((MYIOC_s_WARN_FMT "No msg frames!\n", 3783 ddvprintk((MYIOC_s_WARN_FMT "No msg frames!\n",
4237 hd->ioc->name)); 3784 hd->ioc->name));
4238 return -EBUSY; 3785 return -EBUSY;
@@ -4314,7 +3861,7 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
4314 */ 3861 */
4315 hd->pLocal = NULL; 3862 hd->pLocal = NULL;
4316 hd->timer.expires = jiffies + HZ*cmdTimeout; 3863 hd->timer.expires = jiffies + HZ*cmdTimeout;
4317 scandv_wait_done = 0; 3864 hd->scandv_wait_done = 0;
4318 3865
4319 /* Save cmd pointer, for resource free if timeout or 3866 /* Save cmd pointer, for resource free if timeout or
4320 * FW reload occurs 3867 * FW reload occurs
@@ -4322,8 +3869,8 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
4322 hd->cmdPtr = mf; 3869 hd->cmdPtr = mf;
4323 3870
4324 add_timer(&hd->timer); 3871 add_timer(&hd->timer);
4325 mpt_put_msg_frame(ScsiScanDvCtx, hd->ioc, mf); 3872 mpt_put_msg_frame(hd->ioc->InternalCtx, hd->ioc, mf);
4326 wait_event(scandv_waitq, scandv_wait_done); 3873 wait_event(hd->scandv_waitq, hd->scandv_wait_done);
4327 3874
4328 if (hd->pLocal) { 3875 if (hd->pLocal) {
4329 rc = hd->pLocal->completion; 3876 rc = hd->pLocal->completion;
@@ -4640,7 +4187,8 @@ mptscsih_domainValidation(void *arg)
4640 4187
4641/* Search IOC page 3 to determine if this is hidden physical disk 4188/* Search IOC page 3 to determine if this is hidden physical disk
4642 */ 4189 */
4643static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id) 4190static int
4191mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id)
4644{ 4192{
4645 if (ioc->spi_data.pIocPg3) { 4193 if (ioc->spi_data.pIocPg3) {
4646 Ioc3PhysDisk_t *pPDisk = ioc->spi_data.pIocPg3->PhysDisk; 4194 Ioc3PhysDisk_t *pPDisk = ioc->spi_data.pIocPg3->PhysDisk;
@@ -4659,7 +4207,8 @@ static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id)
4659 4207
4660/* Write SDP1 if no QAS has been enabled 4208/* Write SDP1 if no QAS has been enabled
4661 */ 4209 */
4662static void mptscsih_qas_check(MPT_SCSI_HOST *hd, int id) 4210static void
4211mptscsih_qas_check(MPT_SCSI_HOST *hd, int id)
4663{ 4212{
4664 VirtDevice *pTarget; 4213 VirtDevice *pTarget;
4665 int ii; 4214 int ii;
@@ -5157,7 +4706,7 @@ mptscsih_doDv(MPT_SCSI_HOST *hd, int bus_number, int id)
5157 } 4706 }
5158 ddvprintk((MYIOC_s_NOTE_FMT "DV: Basic test on id=%d completed OK.\n", ioc->name, id)); 4707 ddvprintk((MYIOC_s_NOTE_FMT "DV: Basic test on id=%d completed OK.\n", ioc->name, id));
5159 4708
5160 if (mpt_dv == 0) 4709 if (ioc->spi_data.mpt_dv == 0)
5161 goto target_done; 4710 goto target_done;
5162 4711
5163 inq0 = (*pbuf1) & 0x1F; 4712 inq0 = (*pbuf1) & 0x1F;
@@ -6015,7 +5564,29 @@ mptscsih_fillbuf(char *buffer, int size, int index, int width)
6015} 5564}
6016#endif /* ~MPTSCSIH_ENABLE_DOMAIN_VALIDATION */ 5565#endif /* ~MPTSCSIH_ENABLE_DOMAIN_VALIDATION */
6017 5566
6018/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 5567EXPORT_SYMBOL(mptscsih_remove);
5568EXPORT_SYMBOL(mptscsih_shutdown);
5569#ifdef CONFIG_PM
5570EXPORT_SYMBOL(mptscsih_suspend);
5571EXPORT_SYMBOL(mptscsih_resume);
5572#endif
5573EXPORT_SYMBOL(mptscsih_proc_info);
5574EXPORT_SYMBOL(mptscsih_info);
5575EXPORT_SYMBOL(mptscsih_qcmd);
5576EXPORT_SYMBOL(mptscsih_slave_alloc);
5577EXPORT_SYMBOL(mptscsih_slave_destroy);
5578EXPORT_SYMBOL(mptscsih_slave_configure);
5579EXPORT_SYMBOL(mptscsih_abort);
5580EXPORT_SYMBOL(mptscsih_dev_reset);
5581EXPORT_SYMBOL(mptscsih_bus_reset);
5582EXPORT_SYMBOL(mptscsih_host_reset);
5583EXPORT_SYMBOL(mptscsih_bios_param);
5584EXPORT_SYMBOL(mptscsih_io_done);
5585EXPORT_SYMBOL(mptscsih_taskmgmt_complete);
5586EXPORT_SYMBOL(mptscsih_scandv_complete);
5587EXPORT_SYMBOL(mptscsih_event_process);
5588EXPORT_SYMBOL(mptscsih_ioc_reset);
5589EXPORT_SYMBOL(mptscsih_store_queue_depth);
5590EXPORT_SYMBOL(mptscsih_timer_expired);
6019 5591
6020module_init(mptscsih_init); 5592/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
6021module_exit(mptscsih_exit);
diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h
index 5cb2fd45c38f..d73aec33e16a 100644
--- a/drivers/message/fusion/mptscsih.h
+++ b/drivers/message/fusion/mptscsih.h
@@ -1,26 +1,13 @@
1/* 1/*
2 * linux/drivers/message/fusion/mptscsih.h 2 * linux/drivers/message/fusion/mptscsi.h
3 * High performance SCSI / Fibre Channel SCSI Host device driver. 3 * High performance SCSI / Fibre Channel SCSI Host device driver.
4 * For use with PCI chip/adapter(s): 4 * For use with PCI chip/adapter(s):
5 * LSIFC9xx/LSI409xx Fibre Channel 5 * LSIFC9xx/LSI409xx Fibre Channel
6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware. 6 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
7 * 7 *
8 * Credits: 8 * Copyright (c) 1999-2005 LSI Logic Corporation
9 * This driver would not exist if not for Alan Cox's development
10 * of the linux i2o driver.
11 *
12 * A huge debt of gratitude is owed to David S. Miller (DaveM)
13 * for fixing much of the stupid and broken stuff in the early
14 * driver while porting to sparc64 platform. THANK YOU!
15 *
16 * (see also mptbase.c)
17 *
18 * Copyright (c) 1999-2004 LSI Logic Corporation
19 * Originally By: Steven J. Ralston
20 * (mailto:netscape.net)
21 * (mailto:mpt_linux_developer@lsil.com) 9 * (mailto:mpt_linux_developer@lsil.com)
22 * 10 *
23 * $Id: mptscsih.h,v 1.21 2002/12/03 21:26:35 pdelaney Exp $
24 */ 11 */
25/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 12/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
26/* 13/*
@@ -91,4 +78,30 @@
91#define MPTSCSIH_MIN_SYNC 0x08 78#define MPTSCSIH_MIN_SYNC 0x08
92#define MPTSCSIH_SAF_TE 0 79#define MPTSCSIH_SAF_TE 0
93 80
81
82#endif
83
84extern void mptscsih_remove(struct pci_dev *);
85extern void mptscsih_shutdown(struct device *);
86#ifdef CONFIG_PM
87extern int mptscsih_suspend(struct pci_dev *pdev, u32 state);
88extern int mptscsih_resume(struct pci_dev *pdev);
94#endif 89#endif
90extern int mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, int func);
91extern const char * mptscsih_info(struct Scsi_Host *SChost);
92extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *));
93extern int mptscsih_slave_alloc(struct scsi_device *device);
94extern void mptscsih_slave_destroy(struct scsi_device *device);
95extern int mptscsih_slave_configure(struct scsi_device *device);
96extern int mptscsih_abort(struct scsi_cmnd * SCpnt);
97extern int mptscsih_dev_reset(struct scsi_cmnd * SCpnt);
98extern int mptscsih_bus_reset(struct scsi_cmnd * SCpnt);
99extern int mptscsih_host_reset(struct scsi_cmnd *SCpnt);
100extern int mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, sector_t capacity, int geom[]);
101extern int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
102extern int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
103extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
104extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply);
105extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset);
106extern ssize_t mptscsih_store_queue_depth(struct device *dev, struct device_attribute *attr, const char *buf, size_t count);
107extern void mptscsih_timer_expired(unsigned long data);
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
new file mode 100644
index 000000000000..5f9a61b85b3b
--- /dev/null
+++ b/drivers/message/fusion/mptspi.c
@@ -0,0 +1,486 @@
1/*
2 * linux/drivers/message/fusion/mptspi.c
3 * For use with LSI Logic PCI chip/adapter(s)
4 * running LSI Logic Fusion MPT (Message Passing Technology) firmware.
5 *
6 * Copyright (c) 1999-2005 LSI Logic Corporation
7 * (mailto:mpt_linux_developer@lsil.com)
8 *
9 */
10/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
11/*
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; version 2 of the License.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 NO WARRANTY
22 THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
23 CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
24 LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
25 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
26 solely responsible for determining the appropriateness of using and
27 distributing the Program and assumes all risks associated with its
28 exercise of rights under this Agreement, including but not limited to
29 the risks and costs of program errors, damage to or loss of data,
30 programs or equipment, and unavailability or interruption of operations.
31
32 DISCLAIMER OF LIABILITY
33 NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
34 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
36 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
37 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
38 USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
39 HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
40
41 You should have received a copy of the GNU General Public License
42 along with this program; if not, write to the Free Software
43 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
44*/
45/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
46
47#include "linux_compat.h" /* linux-2.6 tweaks */
48#include <linux/module.h>
49#include <linux/kernel.h>
50#include <linux/init.h>
51#include <linux/errno.h>
52#include <linux/kdev_t.h>
53#include <linux/blkdev.h>
54#include <linux/delay.h> /* for mdelay */
55#include <linux/interrupt.h> /* needed for in_interrupt() proto */
56#include <linux/reboot.h> /* notifier code */
57#include <linux/sched.h>
58#include <linux/workqueue.h>
59
60#include <scsi/scsi.h>
61#include <scsi/scsi_cmnd.h>
62#include <scsi/scsi_device.h>
63#include <scsi/scsi_host.h>
64#include <scsi/scsi_tcq.h>
65
66#include "mptbase.h"
67#include "mptscsih.h"
68
69/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
70#define my_NAME "Fusion MPT SPI Host driver"
71#define my_VERSION MPT_LINUX_VERSION_COMMON
72#define MYNAM "mptspi"
73
74MODULE_AUTHOR(MODULEAUTHOR);
75MODULE_DESCRIPTION(my_NAME);
76MODULE_LICENSE("GPL");
77
78/* Command line args */
79#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
80static int mpt_dv = MPTSCSIH_DOMAIN_VALIDATION;
81module_param(mpt_dv, int, 0);
82MODULE_PARM_DESC(mpt_dv, " DV Algorithm: enhanced=1, basic=0 (default=MPTSCSIH_DOMAIN_VALIDATION=1)");
83
84static int mpt_width = MPTSCSIH_MAX_WIDTH;
85module_param(mpt_width, int, 0);
86MODULE_PARM_DESC(mpt_width, " Max Bus Width: wide=1, narrow=0 (default=MPTSCSIH_MAX_WIDTH=1)");
87
88static ushort mpt_factor = MPTSCSIH_MIN_SYNC;
89module_param(mpt_factor, ushort, 0);
90MODULE_PARM_DESC(mpt_factor, " Min Sync Factor (default=MPTSCSIH_MIN_SYNC=0x08)");
91#endif
92
93static int mpt_saf_te = MPTSCSIH_SAF_TE;
94module_param(mpt_saf_te, int, 0);
95MODULE_PARM_DESC(mpt_saf_te, " Force enabling SEP Processor: enable=1 (default=MPTSCSIH_SAF_TE=0)");
96
97static int mpt_pq_filter = 0;
98module_param(mpt_pq_filter, int, 0);
99MODULE_PARM_DESC(mpt_pq_filter, " Enable peripheral qualifier filter: enable=1 (default=0)");
100
101static int mptspiDoneCtx = -1;
102static int mptspiTaskCtx = -1;
103static int mptspiInternalCtx = -1; /* Used only for internal commands */
104
105static struct device_attribute mptspi_queue_depth_attr = {
106 .attr = {
107 .name = "queue_depth",
108 .mode = S_IWUSR,
109 },
110 .store = mptscsih_store_queue_depth,
111};
112
113static struct device_attribute *mptspi_dev_attrs[] = {
114 &mptspi_queue_depth_attr,
115 NULL,
116};
117
118static struct scsi_host_template mptspi_driver_template = {
119 .proc_name = "mptspi",
120 .proc_info = mptscsih_proc_info,
121 .name = "MPT SPI Host",
122 .info = mptscsih_info,
123 .queuecommand = mptscsih_qcmd,
124 .slave_alloc = mptscsih_slave_alloc,
125 .slave_configure = mptscsih_slave_configure,
126 .slave_destroy = mptscsih_slave_destroy,
127 .eh_abort_handler = mptscsih_abort,
128 .eh_device_reset_handler = mptscsih_dev_reset,
129 .eh_bus_reset_handler = mptscsih_bus_reset,
130 .eh_host_reset_handler = mptscsih_host_reset,
131 .bios_param = mptscsih_bios_param,
132 .can_queue = MPT_SCSI_CAN_QUEUE,
133 .this_id = -1,
134 .sg_tablesize = MPT_SCSI_SG_DEPTH,
135 .max_sectors = 8192,
136 .cmd_per_lun = 7,
137 .use_clustering = ENABLE_CLUSTERING,
138 .sdev_attrs = mptspi_dev_attrs,
139};
140
141
142/****************************************************************************
143 * Supported hardware
144 */
145
146static struct pci_device_id mptspi_pci_table[] = {
147 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030,
148 PCI_ANY_ID, PCI_ANY_ID },
149 { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_1030_53C1035,
150 PCI_ANY_ID, PCI_ANY_ID },
151 {0} /* Terminating entry */
152};
153MODULE_DEVICE_TABLE(pci, mptspi_pci_table);
154
155/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
156/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
157/*
158 * mptspi_probe - Installs scsi devices per bus.
159 * @pdev: Pointer to pci_dev structure
160 *
161 * Returns 0 for success, non-zero for failure.
162 *
163 */
164static int
165mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
166{
167 struct Scsi_Host *sh;
168 MPT_SCSI_HOST *hd;
169 MPT_ADAPTER *ioc;
170 unsigned long flags;
171 int sz, ii;
172 int numSGE = 0;
173 int scale;
174 int ioc_cap;
175 u8 *mem;
176 int error=0;
177 int r;
178
179 if ((r = mpt_attach(pdev,id)) != 0)
180 return r;
181
182 ioc = pci_get_drvdata(pdev);
183 ioc->DoneCtx = mptspiDoneCtx;
184 ioc->TaskCtx = mptspiTaskCtx;
185 ioc->InternalCtx = mptspiInternalCtx;
186
187 /* Added sanity check on readiness of the MPT adapter.
188 */
189 if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) {
190 printk(MYIOC_s_WARN_FMT
191 "Skipping because it's not operational!\n",
192 ioc->name);
193 return -ENODEV;
194 }
195
196 if (!ioc->active) {
197 printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n",
198 ioc->name);
199 return -ENODEV;
200 }
201
202 /* Sanity check - ensure at least 1 port is INITIATOR capable
203 */
204 ioc_cap = 0;
205 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
206 if (ioc->pfacts[ii].ProtocolFlags &
207 MPI_PORTFACTS_PROTOCOL_INITIATOR)
208 ioc_cap ++;
209 }
210
211 if (!ioc_cap) {
212 printk(MYIOC_s_WARN_FMT
213 "Skipping ioc=%p because SCSI Initiator mode is NOT enabled!\n",
214 ioc->name, ioc);
215 return -ENODEV;
216 }
217
218 sh = scsi_host_alloc(&mptspi_driver_template, sizeof(MPT_SCSI_HOST));
219
220 if (!sh) {
221 printk(MYIOC_s_WARN_FMT
222 "Unable to register controller with SCSI subsystem\n",
223 ioc->name);
224 return -1;
225 }
226
227 spin_lock_irqsave(&ioc->FreeQlock, flags);
228
229 /* Attach the SCSI Host to the IOC structure
230 */
231 ioc->sh = sh;
232
233 sh->io_port = 0;
234 sh->n_io_port = 0;
235 sh->irq = 0;
236
237 /* set 16 byte cdb's */
238 sh->max_cmd_len = 16;
239
240 /* Yikes! This is important!
241 * Otherwise, by default, linux
242 * only scans target IDs 0-7!
243 * pfactsN->MaxDevices unreliable
244 * (not supported in early
245 * versions of the FW).
246 * max_id = 1 + actual max id,
247 * max_lun = 1 + actual last lun,
248 * see hosts.h :o(
249 */
250 sh->max_id = MPT_MAX_SCSI_DEVICES;
251
252 sh->max_lun = MPT_LAST_LUN + 1;
253 sh->max_channel = 0;
254 sh->this_id = ioc->pfacts[0].PortSCSIID;
255
256 /* Required entry.
257 */
258 sh->unique_id = ioc->id;
259
260 /* Verify that we won't exceed the maximum
261 * number of chain buffers
262 * We can optimize: ZZ = req_sz/sizeof(SGE)
263 * For 32bit SGE's:
264 * numSGE = 1 + (ZZ-1)*(maxChain -1) + ZZ
265 * + (req_sz - 64)/sizeof(SGE)
266 * A slightly different algorithm is required for
267 * 64bit SGEs.
268 */
269 scale = ioc->req_sz/(sizeof(dma_addr_t) + sizeof(u32));
270 if (sizeof(dma_addr_t) == sizeof(u64)) {
271 numSGE = (scale - 1) *
272 (ioc->facts.MaxChainDepth-1) + scale +
273 (ioc->req_sz - 60) / (sizeof(dma_addr_t) +
274 sizeof(u32));
275 } else {
276 numSGE = 1 + (scale - 1) *
277 (ioc->facts.MaxChainDepth-1) + scale +
278 (ioc->req_sz - 64) / (sizeof(dma_addr_t) +
279 sizeof(u32));
280 }
281
282 if (numSGE < sh->sg_tablesize) {
283 /* Reset this value */
284 dprintk((MYIOC_s_INFO_FMT
285 "Resetting sg_tablesize to %d from %d\n",
286 ioc->name, numSGE, sh->sg_tablesize));
287 sh->sg_tablesize = numSGE;
288 }
289
290 /* Set the pci device pointer in Scsi_Host structure.
291 */
292 scsi_set_device(sh, &ioc->pcidev->dev);
293
294 spin_unlock_irqrestore(&ioc->FreeQlock, flags);
295
296 hd = (MPT_SCSI_HOST *) sh->hostdata;
297 hd->ioc = ioc;
298
299 /* SCSI needs scsi_cmnd lookup table!
300 * (with size equal to req_depth*PtrSz!)
301 */
302 sz = ioc->req_depth * sizeof(void *);
303 mem = kmalloc(sz, GFP_ATOMIC);
304 if (mem == NULL) {
305 error = -ENOMEM;
306 goto mptspi_probe_failed;
307 }
308
309 memset(mem, 0, sz);
310 hd->ScsiLookup = (struct scsi_cmnd **) mem;
311
312 dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n",
313 ioc->name, hd->ScsiLookup, sz));
314
315 /* Allocate memory for the device structures.
316 * A non-Null pointer at an offset
317 * indicates a device exists.
318 * max_id = 1 + maximum id (hosts.h)
319 */
320 sz = sh->max_id * sizeof(void *);
321 mem = kmalloc(sz, GFP_ATOMIC);
322 if (mem == NULL) {
323 error = -ENOMEM;
324 goto mptspi_probe_failed;
325 }
326
327 memset(mem, 0, sz);
328 hd->Targets = (VirtDevice **) mem;
329
330 dprintk((KERN_INFO
331 " Targets @ %p, sz=%d\n", hd->Targets, sz));
332
333 /* Clear the TM flags
334 */
335 hd->tmPending = 0;
336 hd->tmState = TM_STATE_NONE;
337 hd->resetPending = 0;
338 hd->abortSCpnt = NULL;
339
340 /* Clear the pointer used to store
341 * single-threaded commands, i.e., those
342 * issued during a bus scan, dv and
343 * configuration pages.
344 */
345 hd->cmdPtr = NULL;
346
347 /* Initialize this SCSI Hosts' timers
348 * To use, set the timer expires field
349 * and add_timer
350 */
351 init_timer(&hd->timer);
352 hd->timer.data = (unsigned long) hd;
353 hd->timer.function = mptscsih_timer_expired;
354
355 ioc->spi_data.Saf_Te = mpt_saf_te;
356 hd->mpt_pq_filter = mpt_pq_filter;
357
358#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
359 if (ioc->spi_data.maxBusWidth > mpt_width)
360 ioc->spi_data.maxBusWidth = mpt_width;
361 if (ioc->spi_data.minSyncFactor < mpt_factor)
362 ioc->spi_data.minSyncFactor = mpt_factor;
363 if (ioc->spi_data.minSyncFactor == MPT_ASYNC) {
364 ioc->spi_data.maxSyncOffset = 0;
365 }
366 ioc->spi_data.mpt_dv = mpt_dv;
367 hd->negoNvram = 0;
368
369 ddvprintk((MYIOC_s_INFO_FMT
370 "dv %x width %x factor %x saf_te %x mpt_pq_filter %x\n",
371 ioc->name,
372 mpt_dv,
373 mpt_width,
374 mpt_factor,
375 mpt_saf_te,
376 mpt_pq_filter));
377#else
378 hd->negoNvram = MPT_SCSICFG_USE_NVRAM;
379 ddvprintk((MYIOC_s_INFO_FMT
380 "saf_te %x mpt_pq_filter %x\n",
381 ioc->name,
382 mpt_saf_te,
383 mpt_pq_filter));
384#endif
385
386 ioc->spi_data.forceDv = 0;
387 ioc->spi_data.noQas = 0;
388
389 for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++)
390 ioc->spi_data.dvStatus[ii] =
391 MPT_SCSICFG_NEGOTIATE;
392
393 for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++)
394 ioc->spi_data.dvStatus[ii] |=
395 MPT_SCSICFG_DV_NOT_DONE;
396
397 init_waitqueue_head(&hd->scandv_waitq);
398 hd->scandv_wait_done = 0;
399 hd->last_queue_full = 0;
400
401 error = scsi_add_host (sh, &ioc->pcidev->dev);
402 if(error) {
403 dprintk((KERN_ERR MYNAM
404 "scsi_add_host failed\n"));
405 goto mptspi_probe_failed;
406 }
407
408 scsi_scan_host(sh);
409 return 0;
410
411mptspi_probe_failed:
412
413 mptscsih_remove(pdev);
414 return error;
415}
416
417static struct pci_driver mptspi_driver = {
418 .name = "mptspi",
419 .id_table = mptspi_pci_table,
420 .probe = mptspi_probe,
421 .remove = __devexit_p(mptscsih_remove),
422 .driver = {
423 .shutdown = mptscsih_shutdown,
424 },
425#ifdef CONFIG_PM
426 .suspend = mptscsih_suspend,
427 .resume = mptscsih_resume,
428#endif
429};
430
431/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
432/**
433 * mptspi_init - Register MPT adapter(s) as SCSI host(s) with
434 * linux scsi mid-layer.
435 *
436 * Returns 0 for success, non-zero for failure.
437 */
438static int __init
439mptspi_init(void)
440{
441
442 show_mptmod_ver(my_NAME, my_VERSION);
443
444 mptspiDoneCtx = mpt_register(mptscsih_io_done, MPTSPI_DRIVER);
445 mptspiTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSPI_DRIVER);
446 mptspiInternalCtx = mpt_register(mptscsih_scandv_complete, MPTSPI_DRIVER);
447
448 if (mpt_event_register(mptspiDoneCtx, mptscsih_event_process) == 0) {
449 devtprintk((KERN_INFO MYNAM
450 ": Registered for IOC event notifications\n"));
451 }
452
453 if (mpt_reset_register(mptspiDoneCtx, mptscsih_ioc_reset) == 0) {
454 dprintk((KERN_INFO MYNAM
455 ": Registered for IOC reset notifications\n"));
456 }
457
458 return pci_register_driver(&mptspi_driver);
459}
460
461/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
462/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
463/**
464 * mptspi_exit - Unregisters MPT adapter(s)
465 *
466 */
467static void __exit
468mptspi_exit(void)
469{
470 pci_unregister_driver(&mptspi_driver);
471
472 mpt_reset_deregister(mptspiDoneCtx);
473 dprintk((KERN_INFO MYNAM
474 ": Deregistered for IOC reset notifications\n"));
475
476 mpt_event_deregister(mptspiDoneCtx);
477 dprintk((KERN_INFO MYNAM
478 ": Deregistered for IOC event notifications\n"));
479
480 mpt_deregister(mptspiInternalCtx);
481 mpt_deregister(mptspiTaskCtx);
482 mpt_deregister(mptspiDoneCtx);
483}
484
485module_init(mptspi_init);
486module_exit(mptspi_exit);
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index 7b74c87b569e..4830b7759061 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -573,6 +573,7 @@ static int i2o_block_reply(struct i2o_controller *c, u32 m,
573static void i2o_block_event(struct i2o_event *evt) 573static void i2o_block_event(struct i2o_event *evt)
574{ 574{
575 osm_info("block-osm: event received\n"); 575 osm_info("block-osm: event received\n");
576 kfree(evt);
576}; 577};
577 578
578/* 579/*
diff --git a/drivers/misc/ibmasm/command.c b/drivers/misc/ibmasm/command.c
index 245b0058381d..07a085ccbd5b 100644
--- a/drivers/misc/ibmasm/command.c
+++ b/drivers/misc/ibmasm/command.c
@@ -23,6 +23,7 @@
23 */ 23 */
24 24
25#include "ibmasm.h" 25#include "ibmasm.h"
26#include "lowlevel.h"
26 27
27static void exec_next_command(struct service_processor *sp); 28static void exec_next_command(struct service_processor *sp);
28static void free_command(struct kobject *kobj); 29static void free_command(struct kobject *kobj);
@@ -31,8 +32,9 @@ static struct kobj_type ibmasm_cmd_kobj_type = {
31 .release = free_command, 32 .release = free_command,
32}; 33};
33 34
35static atomic_t command_count = ATOMIC_INIT(0);
34 36
35struct command *ibmasm_new_command(size_t buffer_size) 37struct command *ibmasm_new_command(struct service_processor *sp, size_t buffer_size)
36{ 38{
37 struct command *cmd; 39 struct command *cmd;
38 40
@@ -55,11 +57,15 @@ struct command *ibmasm_new_command(size_t buffer_size)
55 57
56 kobject_init(&cmd->kobj); 58 kobject_init(&cmd->kobj);
57 cmd->kobj.ktype = &ibmasm_cmd_kobj_type; 59 cmd->kobj.ktype = &ibmasm_cmd_kobj_type;
60 cmd->lock = &sp->lock;
58 61
59 cmd->status = IBMASM_CMD_PENDING; 62 cmd->status = IBMASM_CMD_PENDING;
60 init_waitqueue_head(&cmd->wait); 63 init_waitqueue_head(&cmd->wait);
61 INIT_LIST_HEAD(&cmd->queue_node); 64 INIT_LIST_HEAD(&cmd->queue_node);
62 65
66 atomic_inc(&command_count);
67 dbg("command count: %d\n", atomic_read(&command_count));
68
63 return cmd; 69 return cmd;
64} 70}
65 71
@@ -68,6 +74,8 @@ static void free_command(struct kobject *kobj)
68 struct command *cmd = to_command(kobj); 74 struct command *cmd = to_command(kobj);
69 75
70 list_del(&cmd->queue_node); 76 list_del(&cmd->queue_node);
77 atomic_dec(&command_count);
78 dbg("command count: %d\n", atomic_read(&command_count));
71 kfree(cmd->buffer); 79 kfree(cmd->buffer);
72 kfree(cmd); 80 kfree(cmd);
73} 81}
@@ -94,8 +102,14 @@ static struct command *dequeue_command(struct service_processor *sp)
94 102
95static inline void do_exec_command(struct service_processor *sp) 103static inline void do_exec_command(struct service_processor *sp)
96{ 104{
105 char tsbuf[32];
106
107 dbg("%s:%d at %s\n", __FUNCTION__, __LINE__, get_timestamp(tsbuf));
108
97 if (ibmasm_send_i2o_message(sp)) { 109 if (ibmasm_send_i2o_message(sp)) {
98 sp->current_command->status = IBMASM_CMD_FAILED; 110 sp->current_command->status = IBMASM_CMD_FAILED;
111 wake_up(&sp->current_command->wait);
112 command_put(sp->current_command);
99 exec_next_command(sp); 113 exec_next_command(sp);
100 } 114 }
101} 115}
@@ -111,14 +125,16 @@ static inline void do_exec_command(struct service_processor *sp)
111void ibmasm_exec_command(struct service_processor *sp, struct command *cmd) 125void ibmasm_exec_command(struct service_processor *sp, struct command *cmd)
112{ 126{
113 unsigned long flags; 127 unsigned long flags;
128 char tsbuf[32];
129
130 dbg("%s:%d at %s\n", __FUNCTION__, __LINE__, get_timestamp(tsbuf));
114 131
115 spin_lock_irqsave(&sp->lock, flags); 132 spin_lock_irqsave(&sp->lock, flags);
116 133
117 if (!sp->current_command) { 134 if (!sp->current_command) {
118 command_get(cmd);
119 sp->current_command = cmd; 135 sp->current_command = cmd;
136 command_get(sp->current_command);
120 spin_unlock_irqrestore(&sp->lock, flags); 137 spin_unlock_irqrestore(&sp->lock, flags);
121
122 do_exec_command(sp); 138 do_exec_command(sp);
123 } else { 139 } else {
124 enqueue_command(sp, cmd); 140 enqueue_command(sp, cmd);
@@ -129,9 +145,9 @@ void ibmasm_exec_command(struct service_processor *sp, struct command *cmd)
129static void exec_next_command(struct service_processor *sp) 145static void exec_next_command(struct service_processor *sp)
130{ 146{
131 unsigned long flags; 147 unsigned long flags;
148 char tsbuf[32];
132 149
133 wake_up(&sp->current_command->wait); 150 dbg("%s:%d at %s\n", __FUNCTION__, __LINE__, get_timestamp(tsbuf));
134 command_put(sp->current_command);
135 151
136 spin_lock_irqsave(&sp->lock, flags); 152 spin_lock_irqsave(&sp->lock, flags);
137 sp->current_command = dequeue_command(sp); 153 sp->current_command = dequeue_command(sp);
@@ -169,7 +185,9 @@ void ibmasm_receive_command_response(struct service_processor *sp, void *respons
169 if (!sp->current_command) 185 if (!sp->current_command)
170 return; 186 return;
171 187
172 memcpy(cmd->buffer, response, min(size, cmd->buffer_size)); 188 memcpy_fromio(cmd->buffer, response, min(size, cmd->buffer_size));
173 cmd->status = IBMASM_CMD_COMPLETE; 189 cmd->status = IBMASM_CMD_COMPLETE;
190 wake_up(&sp->current_command->wait);
191 command_put(sp->current_command);
174 exec_next_command(sp); 192 exec_next_command(sp);
175} 193}
diff --git a/drivers/misc/ibmasm/dot_command.c b/drivers/misc/ibmasm/dot_command.c
index 478a8d898fc1..13c52f866e2e 100644
--- a/drivers/misc/ibmasm/dot_command.c
+++ b/drivers/misc/ibmasm/dot_command.c
@@ -33,7 +33,13 @@ void ibmasm_receive_message(struct service_processor *sp, void *message, int mes
33 u32 size; 33 u32 size;
34 struct dot_command_header *header = (struct dot_command_header *)message; 34 struct dot_command_header *header = (struct dot_command_header *)message;
35 35
36 if (message_size == 0)
37 return;
38
36 size = get_dot_command_size(message); 39 size = get_dot_command_size(message);
40 if (size == 0)
41 return;
42
37 if (size > message_size) 43 if (size > message_size)
38 size = message_size; 44 size = message_size;
39 45
@@ -67,7 +73,7 @@ int ibmasm_send_driver_vpd(struct service_processor *sp)
67 u8 *vpd_data; 73 u8 *vpd_data;
68 int result = 0; 74 int result = 0;
69 75
70 command = ibmasm_new_command(INIT_BUFFER_SIZE); 76 command = ibmasm_new_command(sp, INIT_BUFFER_SIZE);
71 if (command == NULL) 77 if (command == NULL)
72 return -ENOMEM; 78 return -ENOMEM;
73 79
@@ -121,7 +127,7 @@ int ibmasm_send_os_state(struct service_processor *sp, int os_state)
121 struct os_state_command *os_state_cmd; 127 struct os_state_command *os_state_cmd;
122 int result = 0; 128 int result = 0;
123 129
124 cmd = ibmasm_new_command(sizeof(struct os_state_command)); 130 cmd = ibmasm_new_command(sp, sizeof(struct os_state_command));
125 if (cmd == NULL) 131 if (cmd == NULL)
126 return -ENOMEM; 132 return -ENOMEM;
127 133
diff --git a/drivers/misc/ibmasm/event.c b/drivers/misc/ibmasm/event.c
index e100f34f1587..fe1e819235a4 100644
--- a/drivers/misc/ibmasm/event.c
+++ b/drivers/misc/ibmasm/event.c
@@ -23,6 +23,7 @@
23 */ 23 */
24 24
25#include "ibmasm.h" 25#include "ibmasm.h"
26#include "lowlevel.h"
26 27
27/* 28/*
28 * ASM service processor event handling routines. 29 * ASM service processor event handling routines.
@@ -34,7 +35,6 @@
34 * circular buffer. 35 * circular buffer.
35 */ 36 */
36 37
37
38static void wake_up_event_readers(struct service_processor *sp) 38static void wake_up_event_readers(struct service_processor *sp)
39{ 39{
40 struct event_reader *reader; 40 struct event_reader *reader;
@@ -63,7 +63,7 @@ void ibmasm_receive_event(struct service_processor *sp, void *data, unsigned int
63 spin_lock_irqsave(&sp->lock, flags); 63 spin_lock_irqsave(&sp->lock, flags);
64 /* copy the event into the next slot in the circular buffer */ 64 /* copy the event into the next slot in the circular buffer */
65 event = &buffer->events[buffer->next_index]; 65 event = &buffer->events[buffer->next_index];
66 memcpy(event->data, data, data_size); 66 memcpy_fromio(event->data, data, data_size);
67 event->data_size = data_size; 67 event->data_size = data_size;
68 event->serial_number = buffer->next_serial_number; 68 event->serial_number = buffer->next_serial_number;
69 69
@@ -93,7 +93,10 @@ int ibmasm_get_next_event(struct service_processor *sp, struct event_reader *rea
93 unsigned int index; 93 unsigned int index;
94 unsigned long flags; 94 unsigned long flags;
95 95
96 if (wait_event_interruptible(reader->wait, event_available(buffer, reader))) 96 reader->cancelled = 0;
97
98 if (wait_event_interruptible(reader->wait,
99 event_available(buffer, reader) || reader->cancelled))
97 return -ERESTARTSYS; 100 return -ERESTARTSYS;
98 101
99 if (!event_available(buffer, reader)) 102 if (!event_available(buffer, reader))
@@ -116,6 +119,12 @@ int ibmasm_get_next_event(struct service_processor *sp, struct event_reader *rea
116 return event->data_size; 119 return event->data_size;
117} 120}
118 121
122void ibmasm_cancel_next_event(struct event_reader *reader)
123{
124 reader->cancelled = 1;
125 wake_up_interruptible(&reader->wait);
126}
127
119void ibmasm_event_reader_register(struct service_processor *sp, struct event_reader *reader) 128void ibmasm_event_reader_register(struct service_processor *sp, struct event_reader *reader)
120{ 129{
121 unsigned long flags; 130 unsigned long flags;
@@ -131,8 +140,6 @@ void ibmasm_event_reader_unregister(struct service_processor *sp, struct event_r
131{ 140{
132 unsigned long flags; 141 unsigned long flags;
133 142
134 wake_up_interruptible(&reader->wait);
135
136 spin_lock_irqsave(&sp->lock, flags); 143 spin_lock_irqsave(&sp->lock, flags);
137 list_del(&reader->node); 144 list_del(&reader->node);
138 spin_unlock_irqrestore(&sp->lock, flags); 145 spin_unlock_irqrestore(&sp->lock, flags);
@@ -164,6 +171,5 @@ int ibmasm_event_buffer_init(struct service_processor *sp)
164 171
165void ibmasm_event_buffer_exit(struct service_processor *sp) 172void ibmasm_event_buffer_exit(struct service_processor *sp)
166{ 173{
167 wake_up_event_readers(sp);
168 kfree(sp->event_buffer); 174 kfree(sp->event_buffer);
169} 175}
diff --git a/drivers/misc/ibmasm/heartbeat.c b/drivers/misc/ibmasm/heartbeat.c
index ce09309174d6..f295401fac21 100644
--- a/drivers/misc/ibmasm/heartbeat.c
+++ b/drivers/misc/ibmasm/heartbeat.c
@@ -25,6 +25,7 @@
25#include <linux/notifier.h> 25#include <linux/notifier.h>
26#include "ibmasm.h" 26#include "ibmasm.h"
27#include "dot_command.h" 27#include "dot_command.h"
28#include "lowlevel.h"
28 29
29static int suspend_heartbeats = 0; 30static int suspend_heartbeats = 0;
30 31
@@ -62,7 +63,7 @@ void ibmasm_unregister_panic_notifier(void)
62 63
63int ibmasm_heartbeat_init(struct service_processor *sp) 64int ibmasm_heartbeat_init(struct service_processor *sp)
64{ 65{
65 sp->heartbeat = ibmasm_new_command(HEARTBEAT_BUFFER_SIZE); 66 sp->heartbeat = ibmasm_new_command(sp, HEARTBEAT_BUFFER_SIZE);
66 if (sp->heartbeat == NULL) 67 if (sp->heartbeat == NULL)
67 return -ENOMEM; 68 return -ENOMEM;
68 69
@@ -71,6 +72,12 @@ int ibmasm_heartbeat_init(struct service_processor *sp)
71 72
72void ibmasm_heartbeat_exit(struct service_processor *sp) 73void ibmasm_heartbeat_exit(struct service_processor *sp)
73{ 74{
75 char tsbuf[32];
76
77 dbg("%s:%d at %s\n", __FUNCTION__, __LINE__, get_timestamp(tsbuf));
78 ibmasm_wait_for_response(sp->heartbeat, IBMASM_CMD_TIMEOUT_NORMAL);
79 dbg("%s:%d at %s\n", __FUNCTION__, __LINE__, get_timestamp(tsbuf));
80 suspend_heartbeats = 1;
74 command_put(sp->heartbeat); 81 command_put(sp->heartbeat);
75} 82}
76 83
@@ -78,14 +85,16 @@ void ibmasm_receive_heartbeat(struct service_processor *sp, void *message, size
78{ 85{
79 struct command *cmd = sp->heartbeat; 86 struct command *cmd = sp->heartbeat;
80 struct dot_command_header *header = (struct dot_command_header *)cmd->buffer; 87 struct dot_command_header *header = (struct dot_command_header *)cmd->buffer;
88 char tsbuf[32];
81 89
90 dbg("%s:%d at %s\n", __FUNCTION__, __LINE__, get_timestamp(tsbuf));
82 if (suspend_heartbeats) 91 if (suspend_heartbeats)
83 return; 92 return;
84 93
85 /* return the received dot command to sender */ 94 /* return the received dot command to sender */
86 cmd->status = IBMASM_CMD_PENDING; 95 cmd->status = IBMASM_CMD_PENDING;
87 size = min(size, cmd->buffer_size); 96 size = min(size, cmd->buffer_size);
88 memcpy(cmd->buffer, message, size); 97 memcpy_fromio(cmd->buffer, message, size);
89 header->type = sp_write; 98 header->type = sp_write;
90 ibmasm_exec_command(sp, cmd); 99 ibmasm_exec_command(sp, cmd);
91} 100}
diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h
index 6fec7fd8cd1a..ecce4ffd3e23 100644
--- a/drivers/misc/ibmasm/ibmasm.h
+++ b/drivers/misc/ibmasm/ibmasm.h
@@ -34,16 +34,31 @@
34#include <linux/version.h> 34#include <linux/version.h>
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <linux/device.h> 36#include <linux/device.h>
37#include <linux/input.h>
37 38
38/* Driver identification */ 39/* Driver identification */
39#define DRIVER_NAME "ibmasm" 40#define DRIVER_NAME "ibmasm"
40#define DRIVER_VERSION "0.4" 41#define DRIVER_VERSION "1.0"
41#define DRIVER_AUTHOR "Max Asbock" 42#define DRIVER_AUTHOR "Max Asbock <masbock@us.ibm.com>, Vernon Mauery <vernux@us.ibm.com>"
42#define DRIVER_DESC "IBM ASM Service Processor Driver" 43#define DRIVER_DESC "IBM ASM Service Processor Driver"
43 44
44#define err(msg) printk(KERN_ERR "%s: " msg "\n", DRIVER_NAME) 45#define err(msg) printk(KERN_ERR "%s: " msg "\n", DRIVER_NAME)
45#define info(msg) printk(KERN_INFO "%s: " msg "\n", DRIVER_NAME) 46#define info(msg) printk(KERN_INFO "%s: " msg "\n", DRIVER_NAME)
46 47
48extern int ibmasm_debug;
49#define dbg(STR, ARGS...) \
50 do { \
51 if (ibmasm_debug) \
52 printk(KERN_DEBUG STR , ##ARGS); \
53 } while (0)
54
55static inline char *get_timestamp(char *buf)
56{
57 struct timeval now;
58 do_gettimeofday(&now);
59 sprintf(buf, "%lu.%lu", now.tv_sec, now.tv_usec);
60 return buf;
61}
47 62
48#define IBMASM_CMD_PENDING 0 63#define IBMASM_CMD_PENDING 0
49#define IBMASM_CMD_COMPLETE 1 64#define IBMASM_CMD_COMPLETE 1
@@ -52,7 +67,7 @@
52#define IBMASM_CMD_TIMEOUT_NORMAL 45 67#define IBMASM_CMD_TIMEOUT_NORMAL 45
53#define IBMASM_CMD_TIMEOUT_EXTRA 240 68#define IBMASM_CMD_TIMEOUT_EXTRA 240
54 69
55#define IBMASM_CMD_MAX_BUFFER_SIZE 0x4000 70#define IBMASM_CMD_MAX_BUFFER_SIZE 0x8000
56 71
57#define REVERSE_HEARTBEAT_TIMEOUT 120 72#define REVERSE_HEARTBEAT_TIMEOUT 120
58 73
@@ -80,12 +95,17 @@ struct command {
80 size_t buffer_size; 95 size_t buffer_size;
81 int status; 96 int status;
82 struct kobject kobj; 97 struct kobject kobj;
98 spinlock_t *lock;
83}; 99};
84#define to_command(c) container_of(c, struct command, kobj) 100#define to_command(c) container_of(c, struct command, kobj)
85 101
86static inline void command_put(struct command *cmd) 102static inline void command_put(struct command *cmd)
87{ 103{
104 unsigned long flags;
105
106 spin_lock_irqsave(cmd->lock, flags);
88 kobject_put(&cmd->kobj); 107 kobject_put(&cmd->kobj);
108 spin_unlock_irqrestore(cmd->lock, flags);
89} 109}
90 110
91static inline void command_get(struct command *cmd) 111static inline void command_get(struct command *cmd)
@@ -108,6 +128,7 @@ struct event_buffer {
108}; 128};
109 129
110struct event_reader { 130struct event_reader {
131 int cancelled;
111 unsigned int next_serial_number; 132 unsigned int next_serial_number;
112 wait_queue_head_t wait; 133 wait_queue_head_t wait;
113 struct list_head node; 134 struct list_head node;
@@ -120,41 +141,11 @@ struct reverse_heartbeat {
120 unsigned int stopped; 141 unsigned int stopped;
121}; 142};
122 143
123 144struct ibmasm_remote {
124/* remote console events */ 145 struct input_dev keybd_dev;
125struct mouse_event { 146 struct input_dev mouse_dev;
126 long x;
127 long y;
128 unsigned char buttons;
129 unsigned char transitions;
130};
131
132struct keyboard_event {
133 unsigned long key_code;
134 unsigned char key_down;
135}; 147};
136 148
137struct remote_event {
138 unsigned long type;
139 union {
140 struct mouse_event mouse;
141 struct keyboard_event keyboard;
142 } data;
143};
144
145#define DRIVER_REMOTE_QUEUE_SIZE 240
146
147struct remote_queue {
148 struct remote_event *start;
149 struct remote_event *end;
150 struct remote_event *reader;
151 struct remote_event *writer;
152 unsigned int size;
153 int open;
154 wait_queue_head_t wait;
155};
156
157
158struct service_processor { 149struct service_processor {
159 struct list_head node; 150 struct list_head node;
160 spinlock_t lock; 151 spinlock_t lock;
@@ -167,13 +158,13 @@ struct service_processor {
167 char dirname[IBMASM_NAME_SIZE]; 158 char dirname[IBMASM_NAME_SIZE];
168 char devname[IBMASM_NAME_SIZE]; 159 char devname[IBMASM_NAME_SIZE];
169 unsigned int number; 160 unsigned int number;
170 struct remote_queue remote_queue; 161 struct ibmasm_remote *remote;
171 int serial_line; 162 int serial_line;
172 struct device *dev; 163 struct device *dev;
173}; 164};
174 165
175/* command processing */ 166/* command processing */
176extern struct command *ibmasm_new_command(size_t buffer_size); 167extern struct command *ibmasm_new_command(struct service_processor *sp, size_t buffer_size);
177extern void ibmasm_exec_command(struct service_processor *sp, struct command *cmd); 168extern void ibmasm_exec_command(struct service_processor *sp, struct command *cmd);
178extern void ibmasm_wait_for_response(struct command *cmd, int timeout); 169extern void ibmasm_wait_for_response(struct command *cmd, int timeout);
179extern void ibmasm_receive_command_response(struct service_processor *sp, void *response, size_t size); 170extern void ibmasm_receive_command_response(struct service_processor *sp, void *response, size_t size);
@@ -185,6 +176,7 @@ extern void ibmasm_receive_event(struct service_processor *sp, void *data, unsi
185extern void ibmasm_event_reader_register(struct service_processor *sp, struct event_reader *reader); 176extern void ibmasm_event_reader_register(struct service_processor *sp, struct event_reader *reader);
186extern void ibmasm_event_reader_unregister(struct service_processor *sp, struct event_reader *reader); 177extern void ibmasm_event_reader_unregister(struct service_processor *sp, struct event_reader *reader);
187extern int ibmasm_get_next_event(struct service_processor *sp, struct event_reader *reader); 178extern int ibmasm_get_next_event(struct service_processor *sp, struct event_reader *reader);
179extern void ibmasm_cancel_next_event(struct event_reader *reader);
188 180
189/* heartbeat - from SP to OS */ 181/* heartbeat - from SP to OS */
190extern void ibmasm_register_panic_notifier(void); 182extern void ibmasm_register_panic_notifier(void);
@@ -208,11 +200,9 @@ extern int ibmasm_send_i2o_message(struct service_processor *sp);
208extern irqreturn_t ibmasm_interrupt_handler(int irq, void * dev_id, struct pt_regs *regs); 200extern irqreturn_t ibmasm_interrupt_handler(int irq, void * dev_id, struct pt_regs *regs);
209 201
210/* remote console */ 202/* remote console */
211extern void ibmasm_handle_mouse_interrupt(struct service_processor *sp); 203extern void ibmasm_handle_mouse_interrupt(struct service_processor *sp, struct pt_regs *regs);
212extern int ibmasm_init_remote_queue(struct service_processor *sp); 204extern int ibmasm_init_remote_input_dev(struct service_processor *sp);
213extern void ibmasm_free_remote_queue(struct service_processor *sp); 205extern void ibmasm_free_remote_input_dev(struct service_processor *sp);
214extern void ibmasm_advance_reader(struct remote_queue *q, unsigned int n);
215extern size_t ibmasm_events_available(struct remote_queue *q);
216 206
217/* file system */ 207/* file system */
218extern int ibmasmfs_register(void); 208extern int ibmasmfs_register(void);
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c
index 866e867e68f2..5c550fcac2c4 100644
--- a/drivers/misc/ibmasm/ibmasmfs.c
+++ b/drivers/misc/ibmasm/ibmasmfs.c
@@ -37,9 +37,7 @@
37 * | |-- event 37 * | |-- event
38 * | |-- reverse_heartbeat 38 * | |-- reverse_heartbeat
39 * | `-- remote_video 39 * | `-- remote_video
40 * | |-- connected
41 * | |-- depth 40 * | |-- depth
42 * | |-- events
43 * | |-- height 41 * | |-- height
44 * | `-- width 42 * | `-- width
45 * . 43 * .
@@ -50,9 +48,7 @@
50 * |-- event 48 * |-- event
51 * |-- reverse_heartbeat 49 * |-- reverse_heartbeat
52 * `-- remote_video 50 * `-- remote_video
53 * |-- connected
54 * |-- depth 51 * |-- depth
55 * |-- events
56 * |-- height 52 * |-- height
57 * `-- width 53 * `-- width
58 * 54 *
@@ -75,14 +71,6 @@
75 * remote_video/width: control remote display settings 71 * remote_video/width: control remote display settings
76 * write: set value 72 * write: set value
77 * read: read value 73 * read: read value
78 *
79 * remote_video/connected
80 * read: return "1" if web browser VNC java applet is connected,
81 * "0" otherwise
82 *
83 * remote_video/events
84 * read: sleep until a remote mouse or keyboard event occurs, then return
85 * then event.
86 */ 74 */
87 75
88#include <linux/fs.h> 76#include <linux/fs.h>
@@ -333,7 +321,7 @@ static ssize_t command_file_write(struct file *file, const char __user *ubuff, s
333 if (command_data->command) 321 if (command_data->command)
334 return -EAGAIN; 322 return -EAGAIN;
335 323
336 cmd = ibmasm_new_command(count); 324 cmd = ibmasm_new_command(command_data->sp, count);
337 if (!cmd) 325 if (!cmd)
338 return -ENOMEM; 326 return -ENOMEM;
339 327
@@ -374,6 +362,7 @@ static int event_file_open(struct inode *inode, struct file *file)
374 ibmasm_event_reader_register(sp, &event_data->reader); 362 ibmasm_event_reader_register(sp, &event_data->reader);
375 363
376 event_data->sp = sp; 364 event_data->sp = sp;
365 event_data->active = 0;
377 file->private_data = event_data; 366 file->private_data = event_data;
378 return 0; 367 return 0;
379} 368}
@@ -391,7 +380,9 @@ static ssize_t event_file_read(struct file *file, char __user *buf, size_t count
391{ 380{
392 struct ibmasmfs_event_data *event_data = file->private_data; 381 struct ibmasmfs_event_data *event_data = file->private_data;
393 struct event_reader *reader = &event_data->reader; 382 struct event_reader *reader = &event_data->reader;
383 struct service_processor *sp = event_data->sp;
394 int ret; 384 int ret;
385 unsigned long flags;
395 386
396 if (*offset < 0) 387 if (*offset < 0)
397 return -EINVAL; 388 return -EINVAL;
@@ -400,17 +391,32 @@ static ssize_t event_file_read(struct file *file, char __user *buf, size_t count
400 if (*offset != 0) 391 if (*offset != 0)
401 return 0; 392 return 0;
402 393
403 ret = ibmasm_get_next_event(event_data->sp, reader); 394 spin_lock_irqsave(&sp->lock, flags);
395 if (event_data->active) {
396 spin_unlock_irqrestore(&sp->lock, flags);
397 return -EBUSY;
398 }
399 event_data->active = 1;
400 spin_unlock_irqrestore(&sp->lock, flags);
401
402 ret = ibmasm_get_next_event(sp, reader);
404 if (ret <= 0) 403 if (ret <= 0)
405 return ret; 404 goto out;
406 405
407 if (count < reader->data_size) 406 if (count < reader->data_size) {
408 return -EINVAL; 407 ret = -EINVAL;
408 goto out;
409 }
409 410
410 if (copy_to_user(buf, reader->data, reader->data_size)) 411 if (copy_to_user(buf, reader->data, reader->data_size)) {
411 return -EFAULT; 412 ret = -EFAULT;
413 goto out;
414 }
415 ret = reader->data_size;
412 416
413 return reader->data_size; 417out:
418 event_data->active = 0;
419 return ret;
414} 420}
415 421
416static ssize_t event_file_write(struct file *file, const char __user *buf, size_t count, loff_t *offset) 422static ssize_t event_file_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)
@@ -424,7 +430,7 @@ static ssize_t event_file_write(struct file *file, const char __user *buf, size_
424 if (*offset != 0) 430 if (*offset != 0)
425 return 0; 431 return 0;
426 432
427 wake_up_interruptible(&event_data->reader.wait); 433 ibmasm_cancel_next_event(&event_data->reader);
428 return 0; 434 return 0;
429} 435}
430 436
@@ -575,75 +581,6 @@ static ssize_t remote_settings_file_write(struct file *file, const char __user *
575 return count; 581 return count;
576} 582}
577 583
578static int remote_event_file_open(struct inode *inode, struct file *file)
579{
580 struct service_processor *sp;
581 unsigned long flags;
582 struct remote_queue *q;
583
584 file->private_data = inode->u.generic_ip;
585 sp = file->private_data;
586 q = &sp->remote_queue;
587
588 /* allow only one event reader */
589 spin_lock_irqsave(&sp->lock, flags);
590 if (q->open) {
591 spin_unlock_irqrestore(&sp->lock, flags);
592 return -EBUSY;
593 }
594 q->open = 1;
595 spin_unlock_irqrestore(&sp->lock, flags);
596
597 enable_mouse_interrupts(sp);
598
599 return 0;
600}
601
602static int remote_event_file_close(struct inode *inode, struct file *file)
603{
604 struct service_processor *sp = file->private_data;
605
606 disable_mouse_interrupts(sp);
607 wake_up_interruptible(&sp->remote_queue.wait);
608 sp->remote_queue.open = 0;
609
610 return 0;
611}
612
613static ssize_t remote_event_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
614{
615 struct service_processor *sp = file->private_data;
616 struct remote_queue *q = &sp->remote_queue;
617 size_t data_size;
618 struct remote_event *reader = q->reader;
619 size_t num_events;
620
621 if (*offset < 0)
622 return -EINVAL;
623 if (count == 0 || count > 1024)
624 return 0;
625 if (*offset != 0)
626 return 0;
627
628 if (wait_event_interruptible(q->wait, q->reader != q->writer))
629 return -ERESTARTSYS;
630
631 /* only get multiples of struct remote_event */
632 num_events = min((count/sizeof(struct remote_event)), ibmasm_events_available(q));
633 if (!num_events)
634 return 0;
635
636 data_size = num_events * sizeof(struct remote_event);
637
638 if (copy_to_user(buf, reader, data_size))
639 return -EFAULT;
640
641 ibmasm_advance_reader(q, num_events);
642
643 return data_size;
644}
645
646
647static struct file_operations command_fops = { 584static struct file_operations command_fops = {
648 .open = command_file_open, 585 .open = command_file_open,
649 .release = command_file_close, 586 .release = command_file_close,
@@ -672,12 +609,6 @@ static struct file_operations remote_settings_fops = {
672 .write = remote_settings_file_write, 609 .write = remote_settings_file_write,
673}; 610};
674 611
675static struct file_operations remote_event_fops = {
676 .open = remote_event_file_open,
677 .release = remote_event_file_close,
678 .read = remote_event_file_read,
679};
680
681 612
682static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root) 613static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root)
683{ 614{
@@ -703,7 +634,5 @@ static void ibmasmfs_create_files (struct super_block *sb, struct dentry *root)
703 ibmasmfs_create_file(sb, remote_dir, "width", &remote_settings_fops, (void *)display_width(sp), S_IRUSR|S_IWUSR); 634 ibmasmfs_create_file(sb, remote_dir, "width", &remote_settings_fops, (void *)display_width(sp), S_IRUSR|S_IWUSR);
704 ibmasmfs_create_file(sb, remote_dir, "height", &remote_settings_fops, (void *)display_height(sp), S_IRUSR|S_IWUSR); 635 ibmasmfs_create_file(sb, remote_dir, "height", &remote_settings_fops, (void *)display_height(sp), S_IRUSR|S_IWUSR);
705 ibmasmfs_create_file(sb, remote_dir, "depth", &remote_settings_fops, (void *)display_depth(sp), S_IRUSR|S_IWUSR); 636 ibmasmfs_create_file(sb, remote_dir, "depth", &remote_settings_fops, (void *)display_depth(sp), S_IRUSR|S_IWUSR);
706 ibmasmfs_create_file(sb, remote_dir, "connected", &remote_settings_fops, (void *)vnc_status(sp), S_IRUSR);
707 ibmasmfs_create_file(sb, remote_dir, "events", &remote_event_fops, (void *)sp, S_IRUSR);
708 } 637 }
709} 638}
diff --git a/drivers/misc/ibmasm/lowlevel.c b/drivers/misc/ibmasm/lowlevel.c
index 5156de2759d8..47949a2c7e94 100644
--- a/drivers/misc/ibmasm/lowlevel.c
+++ b/drivers/misc/ibmasm/lowlevel.c
@@ -46,8 +46,8 @@ int ibmasm_send_i2o_message(struct service_processor *sp)
46 46
47 message = get_i2o_message(sp->base_address, mfa); 47 message = get_i2o_message(sp->base_address, mfa);
48 48
49 memcpy(&message->header, &header, sizeof(struct i2o_header)); 49 memcpy_toio(&message->header, &header, sizeof(struct i2o_header));
50 memcpy(&message->data, command->buffer, command_size); 50 memcpy_toio(&message->data, command->buffer, command_size);
51 51
52 set_mfa_inbound(sp->base_address, mfa); 52 set_mfa_inbound(sp->base_address, mfa);
53 53
@@ -59,23 +59,27 @@ irqreturn_t ibmasm_interrupt_handler(int irq, void * dev_id, struct pt_regs *reg
59 u32 mfa; 59 u32 mfa;
60 struct service_processor *sp = (struct service_processor *)dev_id; 60 struct service_processor *sp = (struct service_processor *)dev_id;
61 void __iomem *base_address = sp->base_address; 61 void __iomem *base_address = sp->base_address;
62 char tsbuf[32];
62 63
63 if (!sp_interrupt_pending(base_address)) 64 if (!sp_interrupt_pending(base_address))
64 return IRQ_NONE; 65 return IRQ_NONE;
65 66
67 dbg("respond to interrupt at %s\n", get_timestamp(tsbuf));
68
66 if (mouse_interrupt_pending(sp)) { 69 if (mouse_interrupt_pending(sp)) {
67 ibmasm_handle_mouse_interrupt(sp); 70 ibmasm_handle_mouse_interrupt(sp, regs);
68 mfa = get_mfa_outbound(base_address);
69 clear_mouse_interrupt(sp); 71 clear_mouse_interrupt(sp);
70 set_mfa_outbound(base_address, mfa);
71 return IRQ_HANDLED;
72 } 72 }
73 73
74 mfa = get_mfa_outbound(base_address); 74 mfa = get_mfa_outbound(base_address);
75 if (valid_mfa(mfa)) { 75 if (valid_mfa(mfa)) {
76 struct i2o_message *msg = get_i2o_message(base_address, mfa); 76 struct i2o_message *msg = get_i2o_message(base_address, mfa);
77 ibmasm_receive_message(sp, &msg->data, incoming_data_size(msg)); 77 ibmasm_receive_message(sp, &msg->data, incoming_data_size(msg));
78 } 78 } else
79 dbg("didn't get a valid MFA\n");
80
79 set_mfa_outbound(base_address, mfa); 81 set_mfa_outbound(base_address, mfa);
82 dbg("finished interrupt at %s\n", get_timestamp(tsbuf));
83
80 return IRQ_HANDLED; 84 return IRQ_HANDLED;
81} 85}
diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c
index 777432ae764a..1fdf03fd2da7 100644
--- a/drivers/misc/ibmasm/module.c
+++ b/drivers/misc/ibmasm/module.c
@@ -56,17 +56,26 @@
56#include "lowlevel.h" 56#include "lowlevel.h"
57#include "remote.h" 57#include "remote.h"
58 58
59int ibmasm_debug = 0;
60module_param(ibmasm_debug, int , S_IRUGO | S_IWUSR);
61MODULE_PARM_DESC(ibmasm_debug, " Set debug mode on or off");
62
59 63
60static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id) 64static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
61{ 65{
62 int err, result = -ENOMEM; 66 int result;
63 struct service_processor *sp; 67 struct service_processor *sp;
64 68
65 if ((err = pci_enable_device(pdev))) { 69 if ((result = pci_enable_device(pdev))) {
66 printk(KERN_ERR "%s: can't enable PCI device at %s\n", 70 dev_err(&pdev->dev, "Failed to enable PCI device\n");
67 DRIVER_NAME, pci_name(pdev)); 71 return result;
68 return err;
69 } 72 }
73 if ((result = pci_request_regions(pdev, DRIVER_NAME))) {
74 dev_err(&pdev->dev, "Failed to allocate PCI resources\n");
75 goto error_resources;
76 }
77 /* vnc client won't work without bus-mastering */
78 pci_set_master(pdev);
70 79
71 sp = kmalloc(sizeof(struct service_processor), GFP_KERNEL); 80 sp = kmalloc(sizeof(struct service_processor), GFP_KERNEL);
72 if (sp == NULL) { 81 if (sp == NULL) {
@@ -76,6 +85,9 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
76 } 85 }
77 memset(sp, 0, sizeof(struct service_processor)); 86 memset(sp, 0, sizeof(struct service_processor));
78 87
88 sp->lock = SPIN_LOCK_UNLOCKED;
89 INIT_LIST_HEAD(&sp->command_queue);
90
79 pci_set_drvdata(pdev, (void *)sp); 91 pci_set_drvdata(pdev, (void *)sp);
80 sp->dev = &pdev->dev; 92 sp->dev = &pdev->dev;
81 sp->number = pdev->bus->number; 93 sp->number = pdev->bus->number;
@@ -101,15 +113,6 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
101 goto error_ioremap; 113 goto error_ioremap;
102 } 114 }
103 115
104 result = ibmasm_init_remote_queue(sp);
105 if (result) {
106 dev_err(sp->dev, "Failed to initialize remote queue\n");
107 goto error_remote_queue;
108 }
109
110 spin_lock_init(&sp->lock);
111 INIT_LIST_HEAD(&sp->command_queue);
112
113 result = request_irq(sp->irq, ibmasm_interrupt_handler, SA_SHIRQ, sp->devname, (void*)sp); 116 result = request_irq(sp->irq, ibmasm_interrupt_handler, SA_SHIRQ, sp->devname, (void*)sp);
114 if (result) { 117 if (result) {
115 dev_err(sp->dev, "Failed to register interrupt handler\n"); 118 dev_err(sp->dev, "Failed to register interrupt handler\n");
@@ -117,7 +120,12 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
117 } 120 }
118 121
119 enable_sp_interrupts(sp->base_address); 122 enable_sp_interrupts(sp->base_address);
120 disable_mouse_interrupts(sp); 123
124 result = ibmasm_init_remote_input_dev(sp);
125 if (result) {
126 dev_err(sp->dev, "Failed to initialize remote queue\n");
127 goto error_send_message;
128 }
121 129
122 result = ibmasm_send_driver_vpd(sp); 130 result = ibmasm_send_driver_vpd(sp);
123 if (result) { 131 if (result) {
@@ -133,30 +141,25 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
133 141
134 ibmasm_register_uart(sp); 142 ibmasm_register_uart(sp);
135 143
136 dev_printk(KERN_DEBUG, &pdev->dev, "WARNING: This software may not be supported or function\n");
137 dev_printk(KERN_DEBUG, &pdev->dev, "correctly on your IBM server. Please consult the IBM\n");
138 dev_printk(KERN_DEBUG, &pdev->dev, "ServerProven website\n");
139 dev_printk(KERN_DEBUG, &pdev->dev, "http://www.pc.ibm.com/ww/eserver/xseries/serverproven\n");
140 dev_printk(KERN_DEBUG, &pdev->dev, "for information on the specific driver level and support\n");
141 dev_printk(KERN_DEBUG, &pdev->dev, "statement for your IBM server.\n");
142
143 return 0; 144 return 0;
144 145
145error_send_message: 146error_send_message:
146 disable_sp_interrupts(sp->base_address); 147 disable_sp_interrupts(sp->base_address);
148 ibmasm_free_remote_input_dev(sp);
147 free_irq(sp->irq, (void *)sp); 149 free_irq(sp->irq, (void *)sp);
148error_request_irq: 150error_request_irq:
149 ibmasm_free_remote_queue(sp);
150error_remote_queue:
151 iounmap(sp->base_address); 151 iounmap(sp->base_address);
152error_ioremap: 152error_ioremap:
153 ibmasm_heartbeat_exit(sp); 153 ibmasm_heartbeat_exit(sp);
154error_heartbeat: 154error_heartbeat:
155 ibmasm_event_buffer_exit(sp); 155 ibmasm_event_buffer_exit(sp);
156error_eventbuffer: 156error_eventbuffer:
157 pci_set_drvdata(pdev, NULL);
157 kfree(sp); 158 kfree(sp);
158error_kmalloc: 159error_kmalloc:
159 pci_disable_device(pdev); 160 pci_release_regions(pdev);
161error_resources:
162 pci_disable_device(pdev);
160 163
161 return result; 164 return result;
162} 165}
@@ -165,16 +168,24 @@ static void __devexit ibmasm_remove_one(struct pci_dev *pdev)
165{ 168{
166 struct service_processor *sp = (struct service_processor *)pci_get_drvdata(pdev); 169 struct service_processor *sp = (struct service_processor *)pci_get_drvdata(pdev);
167 170
171 dbg("Unregistering UART\n");
168 ibmasm_unregister_uart(sp); 172 ibmasm_unregister_uart(sp);
169 ibmasm_send_os_state(sp, SYSTEM_STATE_OS_DOWN); 173 dbg("Sending OS down message\n");
174 if (ibmasm_send_os_state(sp, SYSTEM_STATE_OS_DOWN))
175 err("failed to get repsonse to 'Send OS State' command\n");
176 dbg("Disabling heartbeats\n");
177 ibmasm_heartbeat_exit(sp);
178 dbg("Disabling interrupts\n");
170 disable_sp_interrupts(sp->base_address); 179 disable_sp_interrupts(sp->base_address);
171 disable_mouse_interrupts(sp); 180 dbg("Freeing SP irq\n");
172 free_irq(sp->irq, (void *)sp); 181 free_irq(sp->irq, (void *)sp);
173 ibmasm_heartbeat_exit(sp); 182 dbg("Cleaning up\n");
174 ibmasm_free_remote_queue(sp); 183 ibmasm_free_remote_input_dev(sp);
175 iounmap(sp->base_address); 184 iounmap(sp->base_address);
176 ibmasm_event_buffer_exit(sp); 185 ibmasm_event_buffer_exit(sp);
186 pci_set_drvdata(pdev, NULL);
177 kfree(sp); 187 kfree(sp);
188 pci_release_regions(pdev);
178 pci_disable_device(pdev); 189 pci_disable_device(pdev);
179} 190}
180 191
diff --git a/drivers/misc/ibmasm/r_heartbeat.c b/drivers/misc/ibmasm/r_heartbeat.c
index 93d9c1b2ad6f..f8fdb2d5417e 100644
--- a/drivers/misc/ibmasm/r_heartbeat.c
+++ b/drivers/misc/ibmasm/r_heartbeat.c
@@ -63,7 +63,7 @@ int ibmasm_start_reverse_heartbeat(struct service_processor *sp, struct reverse_
63 int times_failed = 0; 63 int times_failed = 0;
64 int result = 1; 64 int result = 1;
65 65
66 cmd = ibmasm_new_command(sizeof rhb_dot_cmd); 66 cmd = ibmasm_new_command(sp, sizeof rhb_dot_cmd);
67 if (!cmd) 67 if (!cmd)
68 return -ENOMEM; 68 return -ENOMEM;
69 69
diff --git a/drivers/misc/ibmasm/remote.c b/drivers/misc/ibmasm/remote.c
index 520c3f10c271..d3c48d23ee51 100644
--- a/drivers/misc/ibmasm/remote.c
+++ b/drivers/misc/ibmasm/remote.c
@@ -1,4 +1,3 @@
1
2/* 1/*
3 * IBM ASM Service Processor Device Driver 2 * IBM ASM Service Processor Device Driver
4 * 3 *
@@ -18,135 +17,256 @@
18 * 17 *
19 * Copyright (C) IBM Corporation, 2004 18 * Copyright (C) IBM Corporation, 2004
20 * 19 *
21 * Author: Max Asböck <amax@us.ibm.com> 20 * Authors: Max Asböck <amax@us.ibm.com>
21 * Vernon Mauery <vernux@us.ibm.com>
22 * 22 *
23 */ 23 */
24 24
25/* Remote mouse and keyboard event handling functions */ 25/* Remote mouse and keyboard event handling functions */
26 26
27#include <linux/pci.h>
27#include "ibmasm.h" 28#include "ibmasm.h"
28#include "remote.h" 29#include "remote.h"
29 30
30int ibmasm_init_remote_queue(struct service_processor *sp) 31static int xmax = 1600;
31{ 32static int ymax = 1200;
32 struct remote_queue *q = &sp->remote_queue;
33
34 disable_mouse_interrupts(sp);
35 33
36 q->open = 0;
37 q->size = 0;
38 34
39 q->start = kmalloc(DRIVER_REMOTE_QUEUE_SIZE * sizeof(struct remote_event), GFP_KERNEL); 35static unsigned short xlate_high[XLATE_SIZE] = {
40 if (q->start == 0) 36 [KEY_SYM_ENTER & 0xff] = KEY_ENTER,
41 return -ENOMEM; 37 [KEY_SYM_KPSLASH & 0xff] = KEY_KPSLASH,
38 [KEY_SYM_KPSTAR & 0xff] = KEY_KPASTERISK,
39 [KEY_SYM_KPMINUS & 0xff] = KEY_KPMINUS,
40 [KEY_SYM_KPDOT & 0xff] = KEY_KPDOT,
41 [KEY_SYM_KPPLUS & 0xff] = KEY_KPPLUS,
42 [KEY_SYM_KP0 & 0xff] = KEY_KP0,
43 [KEY_SYM_KP1 & 0xff] = KEY_KP1,
44 [KEY_SYM_KP2 & 0xff] = KEY_KP2, [KEY_SYM_KPDOWN & 0xff] = KEY_KP2,
45 [KEY_SYM_KP3 & 0xff] = KEY_KP3,
46 [KEY_SYM_KP4 & 0xff] = KEY_KP4, [KEY_SYM_KPLEFT & 0xff] = KEY_KP4,
47 [KEY_SYM_KP5 & 0xff] = KEY_KP5,
48 [KEY_SYM_KP6 & 0xff] = KEY_KP6, [KEY_SYM_KPRIGHT & 0xff] = KEY_KP6,
49 [KEY_SYM_KP7 & 0xff] = KEY_KP7,
50 [KEY_SYM_KP8 & 0xff] = KEY_KP8, [KEY_SYM_KPUP & 0xff] = KEY_KP8,
51 [KEY_SYM_KP9 & 0xff] = KEY_KP9,
52 [KEY_SYM_BK_SPC & 0xff] = KEY_BACKSPACE,
53 [KEY_SYM_TAB & 0xff] = KEY_TAB,
54 [KEY_SYM_CTRL & 0xff] = KEY_LEFTCTRL,
55 [KEY_SYM_ALT & 0xff] = KEY_LEFTALT,
56 [KEY_SYM_INSERT & 0xff] = KEY_INSERT,
57 [KEY_SYM_DELETE & 0xff] = KEY_DELETE,
58 [KEY_SYM_SHIFT & 0xff] = KEY_LEFTSHIFT,
59 [KEY_SYM_UARROW & 0xff] = KEY_UP,
60 [KEY_SYM_DARROW & 0xff] = KEY_DOWN,
61 [KEY_SYM_LARROW & 0xff] = KEY_LEFT,
62 [KEY_SYM_RARROW & 0xff] = KEY_RIGHT,
63 [KEY_SYM_ESCAPE & 0xff] = KEY_ESC,
64 [KEY_SYM_PAGEUP & 0xff] = KEY_PAGEUP,
65 [KEY_SYM_PAGEDOWN & 0xff] = KEY_PAGEDOWN,
66 [KEY_SYM_HOME & 0xff] = KEY_HOME,
67 [KEY_SYM_END & 0xff] = KEY_END,
68 [KEY_SYM_F1 & 0xff] = KEY_F1,
69 [KEY_SYM_F2 & 0xff] = KEY_F2,
70 [KEY_SYM_F3 & 0xff] = KEY_F3,
71 [KEY_SYM_F4 & 0xff] = KEY_F4,
72 [KEY_SYM_F5 & 0xff] = KEY_F5,
73 [KEY_SYM_F6 & 0xff] = KEY_F6,
74 [KEY_SYM_F7 & 0xff] = KEY_F7,
75 [KEY_SYM_F8 & 0xff] = KEY_F8,
76 [KEY_SYM_F9 & 0xff] = KEY_F9,
77 [KEY_SYM_F10 & 0xff] = KEY_F10,
78 [KEY_SYM_F11 & 0xff] = KEY_F11,
79 [KEY_SYM_F12 & 0xff] = KEY_F12,
80 [KEY_SYM_CAP_LOCK & 0xff] = KEY_CAPSLOCK,
81 [KEY_SYM_NUM_LOCK & 0xff] = KEY_NUMLOCK,
82 [KEY_SYM_SCR_LOCK & 0xff] = KEY_SCROLLLOCK,
83};
84static unsigned short xlate[XLATE_SIZE] = {
85 [NO_KEYCODE] = KEY_RESERVED,
86 [KEY_SYM_SPACE] = KEY_SPACE,
87 [KEY_SYM_TILDE] = KEY_GRAVE, [KEY_SYM_BKTIC] = KEY_GRAVE,
88 [KEY_SYM_ONE] = KEY_1, [KEY_SYM_BANG] = KEY_1,
89 [KEY_SYM_TWO] = KEY_2, [KEY_SYM_AT] = KEY_2,
90 [KEY_SYM_THREE] = KEY_3, [KEY_SYM_POUND] = KEY_3,
91 [KEY_SYM_FOUR] = KEY_4, [KEY_SYM_DOLLAR] = KEY_4,
92 [KEY_SYM_FIVE] = KEY_5, [KEY_SYM_PERCENT] = KEY_5,
93 [KEY_SYM_SIX] = KEY_6, [KEY_SYM_CARAT] = KEY_6,
94 [KEY_SYM_SEVEN] = KEY_7, [KEY_SYM_AMPER] = KEY_7,
95 [KEY_SYM_EIGHT] = KEY_8, [KEY_SYM_STAR] = KEY_8,
96 [KEY_SYM_NINE] = KEY_9, [KEY_SYM_LPAREN] = KEY_9,
97 [KEY_SYM_ZERO] = KEY_0, [KEY_SYM_RPAREN] = KEY_0,
98 [KEY_SYM_MINUS] = KEY_MINUS, [KEY_SYM_USCORE] = KEY_MINUS,
99 [KEY_SYM_EQUAL] = KEY_EQUAL, [KEY_SYM_PLUS] = KEY_EQUAL,
100 [KEY_SYM_LBRKT] = KEY_LEFTBRACE, [KEY_SYM_LCURLY] = KEY_LEFTBRACE,
101 [KEY_SYM_RBRKT] = KEY_RIGHTBRACE, [KEY_SYM_RCURLY] = KEY_RIGHTBRACE,
102 [KEY_SYM_SLASH] = KEY_BACKSLASH, [KEY_SYM_PIPE] = KEY_BACKSLASH,
103 [KEY_SYM_TIC] = KEY_APOSTROPHE, [KEY_SYM_QUOTE] = KEY_APOSTROPHE,
104 [KEY_SYM_SEMIC] = KEY_SEMICOLON, [KEY_SYM_COLON] = KEY_SEMICOLON,
105 [KEY_SYM_COMMA] = KEY_COMMA, [KEY_SYM_LT] = KEY_COMMA,
106 [KEY_SYM_PERIOD] = KEY_DOT, [KEY_SYM_GT] = KEY_DOT,
107 [KEY_SYM_BSLASH] = KEY_SLASH, [KEY_SYM_QMARK] = KEY_SLASH,
108 [KEY_SYM_A] = KEY_A, [KEY_SYM_a] = KEY_A,
109 [KEY_SYM_B] = KEY_B, [KEY_SYM_b] = KEY_B,
110 [KEY_SYM_C] = KEY_C, [KEY_SYM_c] = KEY_C,
111 [KEY_SYM_D] = KEY_D, [KEY_SYM_d] = KEY_D,
112 [KEY_SYM_E] = KEY_E, [KEY_SYM_e] = KEY_E,
113 [KEY_SYM_F] = KEY_F, [KEY_SYM_f] = KEY_F,
114 [KEY_SYM_G] = KEY_G, [KEY_SYM_g] = KEY_G,
115 [KEY_SYM_H] = KEY_H, [KEY_SYM_h] = KEY_H,
116 [KEY_SYM_I] = KEY_I, [KEY_SYM_i] = KEY_I,
117 [KEY_SYM_J] = KEY_J, [KEY_SYM_j] = KEY_J,
118 [KEY_SYM_K] = KEY_K, [KEY_SYM_k] = KEY_K,
119 [KEY_SYM_L] = KEY_L, [KEY_SYM_l] = KEY_L,
120 [KEY_SYM_M] = KEY_M, [KEY_SYM_m] = KEY_M,
121 [KEY_SYM_N] = KEY_N, [KEY_SYM_n] = KEY_N,
122 [KEY_SYM_O] = KEY_O, [KEY_SYM_o] = KEY_O,
123 [KEY_SYM_P] = KEY_P, [KEY_SYM_p] = KEY_P,
124 [KEY_SYM_Q] = KEY_Q, [KEY_SYM_q] = KEY_Q,
125 [KEY_SYM_R] = KEY_R, [KEY_SYM_r] = KEY_R,
126 [KEY_SYM_S] = KEY_S, [KEY_SYM_s] = KEY_S,
127 [KEY_SYM_T] = KEY_T, [KEY_SYM_t] = KEY_T,
128 [KEY_SYM_U] = KEY_U, [KEY_SYM_u] = KEY_U,
129 [KEY_SYM_V] = KEY_V, [KEY_SYM_v] = KEY_V,
130 [KEY_SYM_W] = KEY_W, [KEY_SYM_w] = KEY_W,
131 [KEY_SYM_X] = KEY_X, [KEY_SYM_x] = KEY_X,
132 [KEY_SYM_Y] = KEY_Y, [KEY_SYM_y] = KEY_Y,
133 [KEY_SYM_Z] = KEY_Z, [KEY_SYM_z] = KEY_Z,
134};
42 135
43 q->end = q->start + DRIVER_REMOTE_QUEUE_SIZE; 136static char remote_mouse_name[] = "ibmasm RSA I remote mouse";
44 q->reader = q->start; 137static char remote_keybd_name[] = "ibmasm RSA I remote keyboard";
45 q->writer = q->start;
46 q->size = DRIVER_REMOTE_QUEUE_SIZE;
47 init_waitqueue_head(&q->wait);
48 138
49 return 0; 139static void print_input(struct remote_input *input)
50}
51
52void ibmasm_free_remote_queue(struct service_processor *sp)
53{ 140{
54 kfree(sp->remote_queue.start); 141 if (input->type == INPUT_TYPE_MOUSE) {
142 unsigned char buttons = input->mouse_buttons;
143 dbg("remote mouse movement: (x,y)=(%d,%d)%s%s%s%s\n",
144 input->data.mouse.x, input->data.mouse.y,
145 (buttons)?" -- buttons:":"",
146 (buttons & REMOTE_BUTTON_LEFT)?"left ":"",
147 (buttons & REMOTE_BUTTON_MIDDLE)?"middle ":"",
148 (buttons & REMOTE_BUTTON_RIGHT)?"right":""
149 );
150 } else {
151 dbg("remote keypress (code, flag, down):"
152 "%d (0x%x) [0x%x] [0x%x]\n",
153 input->data.keyboard.key_code,
154 input->data.keyboard.key_code,
155 input->data.keyboard.key_flag,
156 input->data.keyboard.key_down
157 );
158 }
55} 159}
56 160
57void ibmasm_advance_reader(struct remote_queue *q, unsigned int n) 161static void send_mouse_event(struct input_dev *dev, struct pt_regs *regs,
162 struct remote_input *input)
58{ 163{
59 q->reader += n; 164 unsigned char buttons = input->mouse_buttons;
60 if (q->reader >= q->end)
61 q->reader -= q->size;
62}
63 165
64size_t ibmasm_events_available(struct remote_queue *q) 166 input_regs(dev, regs);
65{ 167 input_report_abs(dev, ABS_X, input->data.mouse.x);
66 ssize_t diff = q->writer - q->reader; 168 input_report_abs(dev, ABS_Y, input->data.mouse.y);
67 169 input_report_key(dev, BTN_LEFT, buttons & REMOTE_BUTTON_LEFT);
68 return (diff >= 0) ? diff : q->end - q->reader; 170 input_report_key(dev, BTN_MIDDLE, buttons & REMOTE_BUTTON_MIDDLE);
171 input_report_key(dev, BTN_RIGHT, buttons & REMOTE_BUTTON_RIGHT);
172 input_sync(dev);
69} 173}
70
71 174
72static int space_free(struct remote_queue *q) 175static void send_keyboard_event(struct input_dev *dev, struct pt_regs *regs,
176 struct remote_input *input)
73{ 177{
74 if (q->reader == q->writer) 178 unsigned int key;
75 return q->size - 1; 179 unsigned short code = input->data.keyboard.key_code;
76 180
77 return ( (q->reader + q->size - q->writer) % q->size ) - 1; 181 if (code & 0xff00)
182 key = xlate_high[code & 0xff];
183 else
184 key = xlate[code];
185 input_regs(dev, regs);
186 input_report_key(dev, key, (input->data.keyboard.key_down) ? 1 : 0);
187 input_sync(dev);
78} 188}
79 189
80static void set_mouse_event(struct remote_input *input, struct mouse_event *mouse) 190void ibmasm_handle_mouse_interrupt(struct service_processor *sp,
191 struct pt_regs *regs)
81{ 192{
82 static char last_buttons = 0; 193 unsigned long reader;
194 unsigned long writer;
195 struct remote_input input;
83 196
84 mouse->x = input->data.mouse.x; 197 reader = get_queue_reader(sp);
85 mouse->y = input->data.mouse.y; 198 writer = get_queue_writer(sp);
86 199
87 if (input->mouse_buttons == REMOTE_MOUSE_DOUBLE_CLICK) { 200 while (reader != writer) {
88 mouse->buttons = REMOTE_MOUSE_DOUBLE_CLICK; 201 memcpy_fromio(&input, get_queue_entry(sp, reader),
89 last_buttons = 0; 202 sizeof(struct remote_input));
90 return;
91 }
92 mouse->transitions = last_buttons ^ input->mouse_buttons;
93 mouse->buttons = input->mouse_buttons;
94 203
95 last_buttons = input->mouse_buttons; 204 print_input(&input);
96} 205 if (input.type == INPUT_TYPE_MOUSE) {
206 send_mouse_event(&sp->remote->mouse_dev, regs, &input);
207 } else if (input.type == INPUT_TYPE_KEYBOARD) {
208 send_keyboard_event(&sp->remote->keybd_dev, regs, &input);
209 } else
210 break;
97 211
98static void set_keyboard_event(struct remote_input *input, struct keyboard_event *keyboard) 212 reader = advance_queue_reader(sp, reader);
99{ 213 writer = get_queue_writer(sp);
100 keyboard->key_code = input->data.keyboard.key_code; 214 }
101 keyboard->key_down = input->data.keyboard.key_down;
102} 215}
103 216
104static int add_to_driver_queue(struct remote_queue *q, struct remote_input *input) 217int ibmasm_init_remote_input_dev(struct service_processor *sp)
105{ 218{
106 struct remote_event *event = q->writer; 219 /* set up the mouse input device */
220 struct ibmasm_remote *remote;
221 struct pci_dev *pdev = to_pci_dev(sp->dev);
222 int i;
107 223
108 if (space_free(q) < 1) { 224 sp->remote = remote = kmalloc(sizeof(*remote), GFP_KERNEL);
109 return 1; 225 if (!remote)
110 } 226 return -ENOMEM;
111 227
112 switch(input->type) { 228 memset(remote, 0, sizeof(*remote));
113 case (INPUT_TYPE_MOUSE):
114 event->type = INPUT_TYPE_MOUSE;
115 set_mouse_event(input, &event->data.mouse);
116 break;
117 case (INPUT_TYPE_KEYBOARD):
118 event->type = INPUT_TYPE_KEYBOARD;
119 set_keyboard_event(input, &event->data.keyboard);
120 break;
121 default:
122 return 0;
123 }
124 event->type = input->type;
125 229
126 q->writer++; 230 remote->mouse_dev.private = remote;
127 if (q->writer == q->end) 231 init_input_dev(&remote->mouse_dev);
128 q->writer = q->start; 232 remote->mouse_dev.id.vendor = pdev->vendor;
233 remote->mouse_dev.id.product = pdev->device;
234 remote->mouse_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
235 remote->mouse_dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) |
236 BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);
237 set_bit(BTN_TOUCH, remote->mouse_dev.keybit);
238 remote->mouse_dev.name = remote_mouse_name;
239 input_set_abs_params(&remote->mouse_dev, ABS_X, 0, xmax, 0, 0);
240 input_set_abs_params(&remote->mouse_dev, ABS_Y, 0, ymax, 0, 0);
129 241
130 return 0; 242 remote->keybd_dev.private = remote;
131} 243 init_input_dev(&remote->keybd_dev);
132 244 remote->keybd_dev.id.vendor = pdev->vendor;
245 remote->keybd_dev.id.product = pdev->device;
246 remote->keybd_dev.evbit[0] = BIT(EV_KEY);
247 remote->keybd_dev.name = remote_keybd_name;
133 248
134void ibmasm_handle_mouse_interrupt(struct service_processor *sp) 249 for (i=0; i<XLATE_SIZE; i++) {
135{ 250 if (xlate_high[i])
136 unsigned long reader; 251 set_bit(xlate_high[i], remote->keybd_dev.keybit);
137 unsigned long writer; 252 if (xlate[i])
138 struct remote_input input; 253 set_bit(xlate[i], remote->keybd_dev.keybit);
254 }
139 255
140 reader = get_queue_reader(sp); 256 input_register_device(&remote->mouse_dev);
141 writer = get_queue_writer(sp); 257 input_register_device(&remote->keybd_dev);
258 enable_mouse_interrupts(sp);
142 259
143 while (reader != writer) { 260 printk(KERN_INFO "ibmasm remote responding to events on RSA card %d\n", sp->number);
144 memcpy(&input, (void *)get_queue_entry(sp, reader), sizeof(struct remote_input));
145 261
146 if (add_to_driver_queue(&sp->remote_queue, &input)) 262 return 0;
147 break; 263}
148 264
149 reader = advance_queue_reader(sp, reader); 265void ibmasm_free_remote_input_dev(struct service_processor *sp)
150 } 266{
151 wake_up_interruptible(&sp->remote_queue.wait); 267 disable_mouse_interrupts(sp);
268 input_unregister_device(&sp->remote->keybd_dev);
269 input_unregister_device(&sp->remote->mouse_dev);
270 kfree(sp->remote);
152} 271}
272
diff --git a/drivers/misc/ibmasm/remote.h b/drivers/misc/ibmasm/remote.h
index a8eb19f02d3f..b7076a8442d2 100644
--- a/drivers/misc/ibmasm/remote.h
+++ b/drivers/misc/ibmasm/remote.h
@@ -51,11 +51,13 @@
51 51
52 52
53/* mouse button states received from SP */ 53/* mouse button states received from SP */
54#define REMOTE_MOUSE_DOUBLE_CLICK 0xF0 54#define REMOTE_DOUBLE_CLICK 0xF0
55#define REMOTE_MOUSE_BUTTON_LEFT 0x01 55#define REMOTE_BUTTON_LEFT 0x01
56#define REMOTE_MOUSE_BUTTON_MIDDLE 0x02 56#define REMOTE_BUTTON_MIDDLE 0x02
57#define REMOTE_MOUSE_BUTTON_RIGHT 0x04 57#define REMOTE_BUTTON_RIGHT 0x04
58 58
59/* size of keysym/keycode translation matricies */
60#define XLATE_SIZE 256
59 61
60struct mouse_input { 62struct mouse_input {
61 unsigned short y; 63 unsigned short y;
@@ -83,11 +85,13 @@ struct remote_input {
83 unsigned char pad3; 85 unsigned char pad3;
84}; 86};
85 87
86#define mouse_addr(sp) sp->base_address + CONDOR_MOUSE_DATA 88#define mouse_addr(sp) (sp->base_address + CONDOR_MOUSE_DATA)
87#define display_width(sp) mouse_addr(sp) + CONDOR_INPUT_DISPLAY_RESX 89#define display_width(sp) (mouse_addr(sp) + CONDOR_INPUT_DISPLAY_RESX)
88#define display_height(sp) mouse_addr(sp) + CONDOR_INPUT_DISPLAY_RESY 90#define display_height(sp) (mouse_addr(sp) + CONDOR_INPUT_DISPLAY_RESY)
89#define display_depth(sp) mouse_addr(sp) + CONDOR_INPUT_DISPLAY_BITS 91#define display_depth(sp) (mouse_addr(sp) + CONDOR_INPUT_DISPLAY_BITS)
90#define vnc_status(sp) mouse_addr(sp) + CONDOR_OUTPUT_VNC_STATUS 92#define desktop_info(sp) (mouse_addr(sp) + CONDOR_INPUT_DESKTOP_INFO)
93#define vnc_status(sp) (mouse_addr(sp) + CONDOR_OUTPUT_VNC_STATUS)
94#define isr_control(sp) (mouse_addr(sp) + CONDOR_MOUSE_ISR_CONTROL)
91 95
92#define mouse_interrupt_pending(sp) readl(mouse_addr(sp) + CONDOR_MOUSE_ISR_STATUS) 96#define mouse_interrupt_pending(sp) readl(mouse_addr(sp) + CONDOR_MOUSE_ISR_STATUS)
93#define clear_mouse_interrupt(sp) writel(0, mouse_addr(sp) + CONDOR_MOUSE_ISR_STATUS) 97#define clear_mouse_interrupt(sp) writel(0, mouse_addr(sp) + CONDOR_MOUSE_ISR_STATUS)
@@ -101,10 +105,10 @@ struct remote_input {
101#define get_queue_reader(sp) readl(mouse_addr(sp) + CONDOR_MOUSE_Q_READER) 105#define get_queue_reader(sp) readl(mouse_addr(sp) + CONDOR_MOUSE_Q_READER)
102#define set_queue_reader(sp, reader) writel(reader, mouse_addr(sp) + CONDOR_MOUSE_Q_READER) 106#define set_queue_reader(sp, reader) writel(reader, mouse_addr(sp) + CONDOR_MOUSE_Q_READER)
103 107
104#define queue_begin mouse_addr(sp) + CONDOR_MOUSE_Q_BEGIN 108#define queue_begin (mouse_addr(sp) + CONDOR_MOUSE_Q_BEGIN)
105 109
106#define get_queue_entry(sp, read_index) \ 110#define get_queue_entry(sp, read_index) \
107 queue_begin + read_index * sizeof(struct remote_input) 111 ((void*)(queue_begin + read_index * sizeof(struct remote_input)))
108 112
109static inline int advance_queue_reader(struct service_processor *sp, unsigned long reader) 113static inline int advance_queue_reader(struct service_processor *sp, unsigned long reader)
110{ 114{
@@ -116,4 +120,151 @@ static inline int advance_queue_reader(struct service_processor *sp, unsigned lo
116 return reader; 120 return reader;
117} 121}
118 122
123#define NO_KEYCODE 0
124#define KEY_SYM_BK_SPC 0xFF08
125#define KEY_SYM_TAB 0xFF09
126#define KEY_SYM_ENTER 0xFF0D
127#define KEY_SYM_SCR_LOCK 0xFF14
128#define KEY_SYM_ESCAPE 0xFF1B
129#define KEY_SYM_HOME 0xFF50
130#define KEY_SYM_LARROW 0xFF51
131#define KEY_SYM_UARROW 0xFF52
132#define KEY_SYM_RARROW 0xFF53
133#define KEY_SYM_DARROW 0xFF54
134#define KEY_SYM_PAGEUP 0xFF55
135#define KEY_SYM_PAGEDOWN 0xFF56
136#define KEY_SYM_END 0xFF57
137#define KEY_SYM_INSERT 0xFF63
138#define KEY_SYM_NUM_LOCK 0xFF7F
139#define KEY_SYM_KPSTAR 0xFFAA
140#define KEY_SYM_KPPLUS 0xFFAB
141#define KEY_SYM_KPMINUS 0xFFAD
142#define KEY_SYM_KPDOT 0xFFAE
143#define KEY_SYM_KPSLASH 0xFFAF
144#define KEY_SYM_KPRIGHT 0xFF96
145#define KEY_SYM_KPUP 0xFF97
146#define KEY_SYM_KPLEFT 0xFF98
147#define KEY_SYM_KPDOWN 0xFF99
148#define KEY_SYM_KP0 0xFFB0
149#define KEY_SYM_KP1 0xFFB1
150#define KEY_SYM_KP2 0xFFB2
151#define KEY_SYM_KP3 0xFFB3
152#define KEY_SYM_KP4 0xFFB4
153#define KEY_SYM_KP5 0xFFB5
154#define KEY_SYM_KP6 0xFFB6
155#define KEY_SYM_KP7 0xFFB7
156#define KEY_SYM_KP8 0xFFB8
157#define KEY_SYM_KP9 0xFFB9
158#define KEY_SYM_F1 0xFFBE // 1B 5B 5B 41
159#define KEY_SYM_F2 0xFFBF // 1B 5B 5B 42
160#define KEY_SYM_F3 0xFFC0 // 1B 5B 5B 43
161#define KEY_SYM_F4 0xFFC1 // 1B 5B 5B 44
162#define KEY_SYM_F5 0xFFC2 // 1B 5B 5B 45
163#define KEY_SYM_F6 0xFFC3 // 1B 5B 31 37 7E
164#define KEY_SYM_F7 0xFFC4 // 1B 5B 31 38 7E
165#define KEY_SYM_F8 0xFFC5 // 1B 5B 31 39 7E
166#define KEY_SYM_F9 0xFFC6 // 1B 5B 32 30 7E
167#define KEY_SYM_F10 0xFFC7 // 1B 5B 32 31 7E
168#define KEY_SYM_F11 0xFFC8 // 1B 5B 32 33 7E
169#define KEY_SYM_F12 0xFFC9 // 1B 5B 32 34 7E
170#define KEY_SYM_SHIFT 0xFFE1
171#define KEY_SYM_CTRL 0xFFE3
172#define KEY_SYM_ALT 0xFFE9
173#define KEY_SYM_CAP_LOCK 0xFFE5
174#define KEY_SYM_DELETE 0xFFFF
175#define KEY_SYM_TILDE 0x60
176#define KEY_SYM_BKTIC 0x7E
177#define KEY_SYM_ONE 0x31
178#define KEY_SYM_BANG 0x21
179#define KEY_SYM_TWO 0x32
180#define KEY_SYM_AT 0x40
181#define KEY_SYM_THREE 0x33
182#define KEY_SYM_POUND 0x23
183#define KEY_SYM_FOUR 0x34
184#define KEY_SYM_DOLLAR 0x24
185#define KEY_SYM_FIVE 0x35
186#define KEY_SYM_PERCENT 0x25
187#define KEY_SYM_SIX 0x36
188#define KEY_SYM_CARAT 0x5E
189#define KEY_SYM_SEVEN 0x37
190#define KEY_SYM_AMPER 0x26
191#define KEY_SYM_EIGHT 0x38
192#define KEY_SYM_STAR 0x2A
193#define KEY_SYM_NINE 0x39
194#define KEY_SYM_LPAREN 0x28
195#define KEY_SYM_ZERO 0x30
196#define KEY_SYM_RPAREN 0x29
197#define KEY_SYM_MINUS 0x2D
198#define KEY_SYM_USCORE 0x5F
199#define KEY_SYM_EQUAL 0x2B
200#define KEY_SYM_PLUS 0x3D
201#define KEY_SYM_LBRKT 0x5B
202#define KEY_SYM_LCURLY 0x7B
203#define KEY_SYM_RBRKT 0x5D
204#define KEY_SYM_RCURLY 0x7D
205#define KEY_SYM_SLASH 0x5C
206#define KEY_SYM_PIPE 0x7C
207#define KEY_SYM_TIC 0x27
208#define KEY_SYM_QUOTE 0x22
209#define KEY_SYM_SEMIC 0x3B
210#define KEY_SYM_COLON 0x3A
211#define KEY_SYM_COMMA 0x2C
212#define KEY_SYM_LT 0x3C
213#define KEY_SYM_PERIOD 0x2E
214#define KEY_SYM_GT 0x3E
215#define KEY_SYM_BSLASH 0x2F
216#define KEY_SYM_QMARK 0x3F
217#define KEY_SYM_A 0x41
218#define KEY_SYM_B 0x42
219#define KEY_SYM_C 0x43
220#define KEY_SYM_D 0x44
221#define KEY_SYM_E 0x45
222#define KEY_SYM_F 0x46
223#define KEY_SYM_G 0x47
224#define KEY_SYM_H 0x48
225#define KEY_SYM_I 0x49
226#define KEY_SYM_J 0x4A
227#define KEY_SYM_K 0x4B
228#define KEY_SYM_L 0x4C
229#define KEY_SYM_M 0x4D
230#define KEY_SYM_N 0x4E
231#define KEY_SYM_O 0x4F
232#define KEY_SYM_P 0x50
233#define KEY_SYM_Q 0x51
234#define KEY_SYM_R 0x52
235#define KEY_SYM_S 0x53
236#define KEY_SYM_T 0x54
237#define KEY_SYM_U 0x55
238#define KEY_SYM_V 0x56
239#define KEY_SYM_W 0x57
240#define KEY_SYM_X 0x58
241#define KEY_SYM_Y 0x59
242#define KEY_SYM_Z 0x5A
243#define KEY_SYM_a 0x61
244#define KEY_SYM_b 0x62
245#define KEY_SYM_c 0x63
246#define KEY_SYM_d 0x64
247#define KEY_SYM_e 0x65
248#define KEY_SYM_f 0x66
249#define KEY_SYM_g 0x67
250#define KEY_SYM_h 0x68
251#define KEY_SYM_i 0x69
252#define KEY_SYM_j 0x6A
253#define KEY_SYM_k 0x6B
254#define KEY_SYM_l 0x6C
255#define KEY_SYM_m 0x6D
256#define KEY_SYM_n 0x6E
257#define KEY_SYM_o 0x6F
258#define KEY_SYM_p 0x70
259#define KEY_SYM_q 0x71
260#define KEY_SYM_r 0x72
261#define KEY_SYM_s 0x73
262#define KEY_SYM_t 0x74
263#define KEY_SYM_u 0x75
264#define KEY_SYM_v 0x76
265#define KEY_SYM_w 0x77
266#define KEY_SYM_x 0x78
267#define KEY_SYM_y 0x79
268#define KEY_SYM_z 0x7A
269#define KEY_SYM_SPACE 0x20
119#endif /* _IBMASM_REMOTE_H_ */ 270#endif /* _IBMASM_REMOTE_H_ */
diff --git a/drivers/mmc/mmc_sysfs.c b/drivers/mmc/mmc_sysfs.c
index 29a56e9cd5b3..5556cd3b5559 100644
--- a/drivers/mmc/mmc_sysfs.c
+++ b/drivers/mmc/mmc_sysfs.c
@@ -22,7 +22,7 @@
22#define to_mmc_driver(d) container_of(d, struct mmc_driver, drv) 22#define to_mmc_driver(d) container_of(d, struct mmc_driver, drv)
23 23
24#define MMC_ATTR(name, fmt, args...) \ 24#define MMC_ATTR(name, fmt, args...) \
25static ssize_t mmc_##name##_show (struct device *dev, char *buf) \ 25static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf) \
26{ \ 26{ \
27 struct mmc_card *card = dev_to_mmc_card(dev); \ 27 struct mmc_card *card = dev_to_mmc_card(dev); \
28 return sprintf(buf, fmt, args); \ 28 return sprintf(buf, fmt, args); \
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index b5e076043431..80ec9aa575bb 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -2202,9 +2202,8 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
2202 2202
2203 if (vortex_debug > 6) { 2203 if (vortex_debug > 6) {
2204 printk(KERN_DEBUG "boomerang_start_xmit()\n"); 2204 printk(KERN_DEBUG "boomerang_start_xmit()\n");
2205 if (vortex_debug > 3) 2205 printk(KERN_DEBUG "%s: Trying to send a packet, Tx index %d.\n",
2206 printk(KERN_DEBUG "%s: Trying to send a packet, Tx index %d.\n", 2206 dev->name, vp->cur_tx);
2207 dev->name, vp->cur_tx);
2208 } 2207 }
2209 2208
2210 if (vp->cur_tx - vp->dirty_tx >= TX_RING_SIZE) { 2209 if (vp->cur_tx - vp->dirty_tx >= TX_RING_SIZE) {
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index d639cb8dc461..72cdf19e1be1 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -54,6 +54,7 @@
54 54
55#include <linux/config.h> 55#include <linux/config.h>
56#include <linux/module.h> 56#include <linux/module.h>
57#include <linux/moduleparam.h>
57#include <linux/kernel.h> 58#include <linux/kernel.h>
58#include <linux/compiler.h> 59#include <linux/compiler.h>
59#include <linux/netdevice.h> 60#include <linux/netdevice.h>
@@ -91,16 +92,17 @@ KERN_INFO DRV_NAME ": 10/100 PCI Ethernet driver v" DRV_VERSION " (" DRV_RELDATE
91 92
92MODULE_AUTHOR("Jeff Garzik <jgarzik@pobox.com>"); 93MODULE_AUTHOR("Jeff Garzik <jgarzik@pobox.com>");
93MODULE_DESCRIPTION("RealTek RTL-8139C+ series 10/100 PCI Ethernet driver"); 94MODULE_DESCRIPTION("RealTek RTL-8139C+ series 10/100 PCI Ethernet driver");
95MODULE_VERSION(DRV_VERSION);
94MODULE_LICENSE("GPL"); 96MODULE_LICENSE("GPL");
95 97
96static int debug = -1; 98static int debug = -1;
97MODULE_PARM (debug, "i"); 99module_param(debug, int, 0);
98MODULE_PARM_DESC (debug, "8139cp: bitmapped message enable number"); 100MODULE_PARM_DESC (debug, "8139cp: bitmapped message enable number");
99 101
100/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). 102/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
101 The RTL chips use a 64 element hash table based on the Ethernet CRC. */ 103 The RTL chips use a 64 element hash table based on the Ethernet CRC. */
102static int multicast_filter_limit = 32; 104static int multicast_filter_limit = 32;
103MODULE_PARM (multicast_filter_limit, "i"); 105module_param(multicast_filter_limit, int, 0);
104MODULE_PARM_DESC (multicast_filter_limit, "8139cp: maximum number of filtered multicast addresses"); 106MODULE_PARM_DESC (multicast_filter_limit, "8139cp: maximum number of filtered multicast addresses");
105 107
106#define PFX DRV_NAME ": " 108#define PFX DRV_NAME ": "
@@ -186,6 +188,9 @@ enum {
186 RingEnd = (1 << 30), /* End of descriptor ring */ 188 RingEnd = (1 << 30), /* End of descriptor ring */
187 FirstFrag = (1 << 29), /* First segment of a packet */ 189 FirstFrag = (1 << 29), /* First segment of a packet */
188 LastFrag = (1 << 28), /* Final segment of a packet */ 190 LastFrag = (1 << 28), /* Final segment of a packet */
191 LargeSend = (1 << 27), /* TCP Large Send Offload (TSO) */
192 MSSShift = 16, /* MSS value position */
193 MSSMask = 0xfff, /* MSS value: 11 bits */
189 TxError = (1 << 23), /* Tx error summary */ 194 TxError = (1 << 23), /* Tx error summary */
190 RxError = (1 << 20), /* Rx error summary */ 195 RxError = (1 << 20), /* Rx error summary */
191 IPCS = (1 << 18), /* Calculate IP checksum */ 196 IPCS = (1 << 18), /* Calculate IP checksum */
@@ -312,7 +317,7 @@ struct cp_desc {
312struct ring_info { 317struct ring_info {
313 struct sk_buff *skb; 318 struct sk_buff *skb;
314 dma_addr_t mapping; 319 dma_addr_t mapping;
315 unsigned frag; 320 u32 len;
316}; 321};
317 322
318struct cp_dma_stats { 323struct cp_dma_stats {
@@ -394,6 +399,9 @@ struct cp_private {
394static void __cp_set_rx_mode (struct net_device *dev); 399static void __cp_set_rx_mode (struct net_device *dev);
395static void cp_tx (struct cp_private *cp); 400static void cp_tx (struct cp_private *cp);
396static void cp_clean_rings (struct cp_private *cp); 401static void cp_clean_rings (struct cp_private *cp);
402#ifdef CONFIG_NET_POLL_CONTROLLER
403static void cp_poll_controller(struct net_device *dev);
404#endif
397 405
398static struct pci_device_id cp_pci_tbl[] = { 406static struct pci_device_id cp_pci_tbl[] = {
399 { PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139, 407 { PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139,
@@ -688,6 +696,19 @@ cp_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
688 return IRQ_HANDLED; 696 return IRQ_HANDLED;
689} 697}
690 698
699#ifdef CONFIG_NET_POLL_CONTROLLER
700/*
701 * Polling receive - used by netconsole and other diagnostic tools
702 * to allow network i/o with interrupts disabled.
703 */
704static void cp_poll_controller(struct net_device *dev)
705{
706 disable_irq(dev->irq);
707 cp_interrupt(dev->irq, dev, NULL);
708 enable_irq(dev->irq);
709}
710#endif
711
691static void cp_tx (struct cp_private *cp) 712static void cp_tx (struct cp_private *cp)
692{ 713{
693 unsigned tx_head = cp->tx_head; 714 unsigned tx_head = cp->tx_head;
@@ -707,7 +728,7 @@ static void cp_tx (struct cp_private *cp)
707 BUG(); 728 BUG();
708 729
709 pci_unmap_single(cp->pdev, cp->tx_skb[tx_tail].mapping, 730 pci_unmap_single(cp->pdev, cp->tx_skb[tx_tail].mapping,
710 skb->len, PCI_DMA_TODEVICE); 731 cp->tx_skb[tx_tail].len, PCI_DMA_TODEVICE);
711 732
712 if (status & LastFrag) { 733 if (status & LastFrag) {
713 if (status & (TxError | TxFIFOUnder)) { 734 if (status & (TxError | TxFIFOUnder)) {
@@ -749,10 +770,11 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
749{ 770{
750 struct cp_private *cp = netdev_priv(dev); 771 struct cp_private *cp = netdev_priv(dev);
751 unsigned entry; 772 unsigned entry;
752 u32 eor; 773 u32 eor, flags;
753#if CP_VLAN_TAG_USED 774#if CP_VLAN_TAG_USED
754 u32 vlan_tag = 0; 775 u32 vlan_tag = 0;
755#endif 776#endif
777 int mss = 0;
756 778
757 spin_lock_irq(&cp->lock); 779 spin_lock_irq(&cp->lock);
758 780
@@ -772,6 +794,9 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
772 794
773 entry = cp->tx_head; 795 entry = cp->tx_head;
774 eor = (entry == (CP_TX_RING_SIZE - 1)) ? RingEnd : 0; 796 eor = (entry == (CP_TX_RING_SIZE - 1)) ? RingEnd : 0;
797 if (dev->features & NETIF_F_TSO)
798 mss = skb_shinfo(skb)->tso_size;
799
775 if (skb_shinfo(skb)->nr_frags == 0) { 800 if (skb_shinfo(skb)->nr_frags == 0) {
776 struct cp_desc *txd = &cp->tx_ring[entry]; 801 struct cp_desc *txd = &cp->tx_ring[entry];
777 u32 len; 802 u32 len;
@@ -783,26 +808,26 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
783 txd->addr = cpu_to_le64(mapping); 808 txd->addr = cpu_to_le64(mapping);
784 wmb(); 809 wmb();
785 810
786 if (skb->ip_summed == CHECKSUM_HW) { 811 flags = eor | len | DescOwn | FirstFrag | LastFrag;
812
813 if (mss)
814 flags |= LargeSend | ((mss & MSSMask) << MSSShift);
815 else if (skb->ip_summed == CHECKSUM_HW) {
787 const struct iphdr *ip = skb->nh.iph; 816 const struct iphdr *ip = skb->nh.iph;
788 if (ip->protocol == IPPROTO_TCP) 817 if (ip->protocol == IPPROTO_TCP)
789 txd->opts1 = cpu_to_le32(eor | len | DescOwn | 818 flags |= IPCS | TCPCS;
790 FirstFrag | LastFrag |
791 IPCS | TCPCS);
792 else if (ip->protocol == IPPROTO_UDP) 819 else if (ip->protocol == IPPROTO_UDP)
793 txd->opts1 = cpu_to_le32(eor | len | DescOwn | 820 flags |= IPCS | UDPCS;
794 FirstFrag | LastFrag |
795 IPCS | UDPCS);
796 else 821 else
797 BUG(); 822 WARN_ON(1); /* we need a WARN() */
798 } else 823 }
799 txd->opts1 = cpu_to_le32(eor | len | DescOwn | 824
800 FirstFrag | LastFrag); 825 txd->opts1 = cpu_to_le32(flags);
801 wmb(); 826 wmb();
802 827
803 cp->tx_skb[entry].skb = skb; 828 cp->tx_skb[entry].skb = skb;
804 cp->tx_skb[entry].mapping = mapping; 829 cp->tx_skb[entry].mapping = mapping;
805 cp->tx_skb[entry].frag = 0; 830 cp->tx_skb[entry].len = len;
806 entry = NEXT_TX(entry); 831 entry = NEXT_TX(entry);
807 } else { 832 } else {
808 struct cp_desc *txd; 833 struct cp_desc *txd;
@@ -820,7 +845,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
820 first_len, PCI_DMA_TODEVICE); 845 first_len, PCI_DMA_TODEVICE);
821 cp->tx_skb[entry].skb = skb; 846 cp->tx_skb[entry].skb = skb;
822 cp->tx_skb[entry].mapping = first_mapping; 847 cp->tx_skb[entry].mapping = first_mapping;
823 cp->tx_skb[entry].frag = 1; 848 cp->tx_skb[entry].len = first_len;
824 entry = NEXT_TX(entry); 849 entry = NEXT_TX(entry);
825 850
826 for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) { 851 for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
@@ -836,16 +861,19 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
836 len, PCI_DMA_TODEVICE); 861 len, PCI_DMA_TODEVICE);
837 eor = (entry == (CP_TX_RING_SIZE - 1)) ? RingEnd : 0; 862 eor = (entry == (CP_TX_RING_SIZE - 1)) ? RingEnd : 0;
838 863
839 if (skb->ip_summed == CHECKSUM_HW) { 864 ctrl = eor | len | DescOwn;
840 ctrl = eor | len | DescOwn | IPCS; 865
866 if (mss)
867 ctrl |= LargeSend |
868 ((mss & MSSMask) << MSSShift);
869 else if (skb->ip_summed == CHECKSUM_HW) {
841 if (ip->protocol == IPPROTO_TCP) 870 if (ip->protocol == IPPROTO_TCP)
842 ctrl |= TCPCS; 871 ctrl |= IPCS | TCPCS;
843 else if (ip->protocol == IPPROTO_UDP) 872 else if (ip->protocol == IPPROTO_UDP)
844 ctrl |= UDPCS; 873 ctrl |= IPCS | UDPCS;
845 else 874 else
846 BUG(); 875 BUG();
847 } else 876 }
848 ctrl = eor | len | DescOwn;
849 877
850 if (frag == skb_shinfo(skb)->nr_frags - 1) 878 if (frag == skb_shinfo(skb)->nr_frags - 1)
851 ctrl |= LastFrag; 879 ctrl |= LastFrag;
@@ -860,7 +888,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
860 888
861 cp->tx_skb[entry].skb = skb; 889 cp->tx_skb[entry].skb = skb;
862 cp->tx_skb[entry].mapping = mapping; 890 cp->tx_skb[entry].mapping = mapping;
863 cp->tx_skb[entry].frag = frag + 2; 891 cp->tx_skb[entry].len = len;
864 entry = NEXT_TX(entry); 892 entry = NEXT_TX(entry);
865 } 893 }
866 894
@@ -1074,7 +1102,6 @@ static int cp_refill_rx (struct cp_private *cp)
1074 cp->rx_skb[i].mapping = pci_map_single(cp->pdev, 1102 cp->rx_skb[i].mapping = pci_map_single(cp->pdev,
1075 skb->tail, cp->rx_buf_sz, PCI_DMA_FROMDEVICE); 1103 skb->tail, cp->rx_buf_sz, PCI_DMA_FROMDEVICE);
1076 cp->rx_skb[i].skb = skb; 1104 cp->rx_skb[i].skb = skb;
1077 cp->rx_skb[i].frag = 0;
1078 1105
1079 cp->rx_ring[i].opts2 = 0; 1106 cp->rx_ring[i].opts2 = 0;
1080 cp->rx_ring[i].addr = cpu_to_le64(cp->rx_skb[i].mapping); 1107 cp->rx_ring[i].addr = cpu_to_le64(cp->rx_skb[i].mapping);
@@ -1126,9 +1153,6 @@ static void cp_clean_rings (struct cp_private *cp)
1126{ 1153{
1127 unsigned i; 1154 unsigned i;
1128 1155
1129 memset(cp->rx_ring, 0, sizeof(struct cp_desc) * CP_RX_RING_SIZE);
1130 memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE);
1131
1132 for (i = 0; i < CP_RX_RING_SIZE; i++) { 1156 for (i = 0; i < CP_RX_RING_SIZE; i++) {
1133 if (cp->rx_skb[i].skb) { 1157 if (cp->rx_skb[i].skb) {
1134 pci_unmap_single(cp->pdev, cp->rx_skb[i].mapping, 1158 pci_unmap_single(cp->pdev, cp->rx_skb[i].mapping,
@@ -1140,13 +1164,18 @@ static void cp_clean_rings (struct cp_private *cp)
1140 for (i = 0; i < CP_TX_RING_SIZE; i++) { 1164 for (i = 0; i < CP_TX_RING_SIZE; i++) {
1141 if (cp->tx_skb[i].skb) { 1165 if (cp->tx_skb[i].skb) {
1142 struct sk_buff *skb = cp->tx_skb[i].skb; 1166 struct sk_buff *skb = cp->tx_skb[i].skb;
1167
1143 pci_unmap_single(cp->pdev, cp->tx_skb[i].mapping, 1168 pci_unmap_single(cp->pdev, cp->tx_skb[i].mapping,
1144 skb->len, PCI_DMA_TODEVICE); 1169 cp->tx_skb[i].len, PCI_DMA_TODEVICE);
1145 dev_kfree_skb(skb); 1170 if (le32_to_cpu(cp->tx_ring[i].opts1) & LastFrag)
1171 dev_kfree_skb(skb);
1146 cp->net_stats.tx_dropped++; 1172 cp->net_stats.tx_dropped++;
1147 } 1173 }
1148 } 1174 }
1149 1175
1176 memset(cp->rx_ring, 0, sizeof(struct cp_desc) * CP_RX_RING_SIZE);
1177 memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE);
1178
1150 memset(&cp->rx_skb, 0, sizeof(struct ring_info) * CP_RX_RING_SIZE); 1179 memset(&cp->rx_skb, 0, sizeof(struct ring_info) * CP_RX_RING_SIZE);
1151 memset(&cp->tx_skb, 0, sizeof(struct ring_info) * CP_TX_RING_SIZE); 1180 memset(&cp->tx_skb, 0, sizeof(struct ring_info) * CP_TX_RING_SIZE);
1152} 1181}
@@ -1538,6 +1567,8 @@ static struct ethtool_ops cp_ethtool_ops = {
1538 .set_tx_csum = ethtool_op_set_tx_csum, /* local! */ 1567 .set_tx_csum = ethtool_op_set_tx_csum, /* local! */
1539 .get_sg = ethtool_op_get_sg, 1568 .get_sg = ethtool_op_get_sg,
1540 .set_sg = ethtool_op_set_sg, 1569 .set_sg = ethtool_op_set_sg,
1570 .get_tso = ethtool_op_get_tso,
1571 .set_tso = ethtool_op_set_tso,
1541 .get_regs = cp_get_regs, 1572 .get_regs = cp_get_regs,
1542 .get_wol = cp_get_wol, 1573 .get_wol = cp_get_wol,
1543 .set_wol = cp_set_wol, 1574 .set_wol = cp_set_wol,
@@ -1749,6 +1780,9 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1749 dev->get_stats = cp_get_stats; 1780 dev->get_stats = cp_get_stats;
1750 dev->do_ioctl = cp_ioctl; 1781 dev->do_ioctl = cp_ioctl;
1751 dev->poll = cp_rx_poll; 1782 dev->poll = cp_rx_poll;
1783#ifdef CONFIG_NET_POLL_CONTROLLER
1784 dev->poll_controller = cp_poll_controller;
1785#endif
1752 dev->weight = 16; /* arbitrary? from NAPI_HOWTO.txt. */ 1786 dev->weight = 16; /* arbitrary? from NAPI_HOWTO.txt. */
1753#ifdef BROKEN 1787#ifdef BROKEN
1754 dev->change_mtu = cp_change_mtu; 1788 dev->change_mtu = cp_change_mtu;
@@ -1768,6 +1802,10 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1768 if (pci_using_dac) 1802 if (pci_using_dac)
1769 dev->features |= NETIF_F_HIGHDMA; 1803 dev->features |= NETIF_F_HIGHDMA;
1770 1804
1805#if 0 /* disabled by default until verified */
1806 dev->features |= NETIF_F_TSO;
1807#endif
1808
1771 dev->irq = pdev->irq; 1809 dev->irq = pdev->irq;
1772 1810
1773 rc = register_netdev(dev); 1811 rc = register_netdev(dev);
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index d4bd20c21a1f..047202c4d9a8 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -569,7 +569,7 @@ struct rtl_extra_stats {
569}; 569};
570 570
571struct rtl8139_private { 571struct rtl8139_private {
572 void *mmio_addr; 572 void __iomem *mmio_addr;
573 int drv_flags; 573 int drv_flags;
574 struct pci_dev *pci_dev; 574 struct pci_dev *pci_dev;
575 u32 msg_enable; 575 u32 msg_enable;
@@ -614,7 +614,7 @@ MODULE_PARM_DESC (multicast_filter_limit, "8139too maximum number of filtered mu
614MODULE_PARM_DESC (media, "8139too: Bits 4+9: force full duplex, bit 5: 100Mbps"); 614MODULE_PARM_DESC (media, "8139too: Bits 4+9: force full duplex, bit 5: 100Mbps");
615MODULE_PARM_DESC (full_duplex, "8139too: Force full duplex for board(s) (1)"); 615MODULE_PARM_DESC (full_duplex, "8139too: Force full duplex for board(s) (1)");
616 616
617static int read_eeprom (void *ioaddr, int location, int addr_len); 617static int read_eeprom (void __iomem *ioaddr, int location, int addr_len);
618static int rtl8139_open (struct net_device *dev); 618static int rtl8139_open (struct net_device *dev);
619static int mdio_read (struct net_device *dev, int phy_id, int location); 619static int mdio_read (struct net_device *dev, int phy_id, int location);
620static void mdio_write (struct net_device *dev, int phy_id, int location, 620static void mdio_write (struct net_device *dev, int phy_id, int location,
@@ -638,46 +638,20 @@ static void __set_rx_mode (struct net_device *dev);
638static void rtl8139_hw_start (struct net_device *dev); 638static void rtl8139_hw_start (struct net_device *dev);
639static struct ethtool_ops rtl8139_ethtool_ops; 639static struct ethtool_ops rtl8139_ethtool_ops;
640 640
641#ifdef USE_IO_OPS
642
643#define RTL_R8(reg) inb (((unsigned long)ioaddr) + (reg))
644#define RTL_R16(reg) inw (((unsigned long)ioaddr) + (reg))
645#define RTL_R32(reg) ((unsigned long) inl (((unsigned long)ioaddr) + (reg)))
646#define RTL_W8(reg, val8) outb ((val8), ((unsigned long)ioaddr) + (reg))
647#define RTL_W16(reg, val16) outw ((val16), ((unsigned long)ioaddr) + (reg))
648#define RTL_W32(reg, val32) outl ((val32), ((unsigned long)ioaddr) + (reg))
649#define RTL_W8_F RTL_W8
650#define RTL_W16_F RTL_W16
651#define RTL_W32_F RTL_W32
652#undef readb
653#undef readw
654#undef readl
655#undef writeb
656#undef writew
657#undef writel
658#define readb(addr) inb((unsigned long)(addr))
659#define readw(addr) inw((unsigned long)(addr))
660#define readl(addr) inl((unsigned long)(addr))
661#define writeb(val,addr) outb((val),(unsigned long)(addr))
662#define writew(val,addr) outw((val),(unsigned long)(addr))
663#define writel(val,addr) outl((val),(unsigned long)(addr))
664
665#else
666
667/* write MMIO register, with flush */ 641/* write MMIO register, with flush */
668/* Flush avoids rtl8139 bug w/ posted MMIO writes */ 642/* Flush avoids rtl8139 bug w/ posted MMIO writes */
669#define RTL_W8_F(reg, val8) do { writeb ((val8), ioaddr + (reg)); readb (ioaddr + (reg)); } while (0) 643#define RTL_W8_F(reg, val8) do { iowrite8 ((val8), ioaddr + (reg)); ioread8 (ioaddr + (reg)); } while (0)
670#define RTL_W16_F(reg, val16) do { writew ((val16), ioaddr + (reg)); readw (ioaddr + (reg)); } while (0) 644#define RTL_W16_F(reg, val16) do { iowrite16 ((val16), ioaddr + (reg)); ioread16 (ioaddr + (reg)); } while (0)
671#define RTL_W32_F(reg, val32) do { writel ((val32), ioaddr + (reg)); readl (ioaddr + (reg)); } while (0) 645#define RTL_W32_F(reg, val32) do { iowrite32 ((val32), ioaddr + (reg)); ioread32 (ioaddr + (reg)); } while (0)
672 646
673 647
674#define MMIO_FLUSH_AUDIT_COMPLETE 1 648#define MMIO_FLUSH_AUDIT_COMPLETE 1
675#if MMIO_FLUSH_AUDIT_COMPLETE 649#if MMIO_FLUSH_AUDIT_COMPLETE
676 650
677/* write MMIO register */ 651/* write MMIO register */
678#define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg)) 652#define RTL_W8(reg, val8) iowrite8 ((val8), ioaddr + (reg))
679#define RTL_W16(reg, val16) writew ((val16), ioaddr + (reg)) 653#define RTL_W16(reg, val16) iowrite16 ((val16), ioaddr + (reg))
680#define RTL_W32(reg, val32) writel ((val32), ioaddr + (reg)) 654#define RTL_W32(reg, val32) iowrite32 ((val32), ioaddr + (reg))
681 655
682#else 656#else
683 657
@@ -689,11 +663,9 @@ static struct ethtool_ops rtl8139_ethtool_ops;
689#endif /* MMIO_FLUSH_AUDIT_COMPLETE */ 663#endif /* MMIO_FLUSH_AUDIT_COMPLETE */
690 664
691/* read MMIO register */ 665/* read MMIO register */
692#define RTL_R8(reg) readb (ioaddr + (reg)) 666#define RTL_R8(reg) ioread8 (ioaddr + (reg))
693#define RTL_R16(reg) readw (ioaddr + (reg)) 667#define RTL_R16(reg) ioread16 (ioaddr + (reg))
694#define RTL_R32(reg) ((unsigned long) readl (ioaddr + (reg))) 668#define RTL_R32(reg) ((unsigned long) ioread32 (ioaddr + (reg)))
695
696#endif /* USE_IO_OPS */
697 669
698 670
699static const u16 rtl8139_intr_mask = 671static const u16 rtl8139_intr_mask =
@@ -740,10 +712,13 @@ static void __rtl8139_cleanup_dev (struct net_device *dev)
740 assert (tp->pci_dev != NULL); 712 assert (tp->pci_dev != NULL);
741 pdev = tp->pci_dev; 713 pdev = tp->pci_dev;
742 714
743#ifndef USE_IO_OPS 715#ifdef USE_IO_OPS
716 if (tp->mmio_addr)
717 ioport_unmap (tp->mmio_addr);
718#else
744 if (tp->mmio_addr) 719 if (tp->mmio_addr)
745 iounmap (tp->mmio_addr); 720 pci_iounmap (pdev, tp->mmio_addr);
746#endif /* !USE_IO_OPS */ 721#endif /* USE_IO_OPS */
747 722
748 /* it's ok to call this even if we have no regions to free */ 723 /* it's ok to call this even if we have no regions to free */
749 pci_release_regions (pdev); 724 pci_release_regions (pdev);
@@ -753,7 +728,7 @@ static void __rtl8139_cleanup_dev (struct net_device *dev)
753} 728}
754 729
755 730
756static void rtl8139_chip_reset (void *ioaddr) 731static void rtl8139_chip_reset (void __iomem *ioaddr)
757{ 732{
758 int i; 733 int i;
759 734
@@ -773,7 +748,7 @@ static void rtl8139_chip_reset (void *ioaddr)
773static int __devinit rtl8139_init_board (struct pci_dev *pdev, 748static int __devinit rtl8139_init_board (struct pci_dev *pdev,
774 struct net_device **dev_out) 749 struct net_device **dev_out)
775{ 750{
776 void *ioaddr; 751 void __iomem *ioaddr;
777 struct net_device *dev; 752 struct net_device *dev;
778 struct rtl8139_private *tp; 753 struct rtl8139_private *tp;
779 u8 tmp8; 754 u8 tmp8;
@@ -855,13 +830,18 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
855 pci_set_master (pdev); 830 pci_set_master (pdev);
856 831
857#ifdef USE_IO_OPS 832#ifdef USE_IO_OPS
858 ioaddr = (void *) pio_start; 833 ioaddr = ioport_map(pio_start, pio_len);
834 if (!ioaddr) {
835 printk (KERN_ERR PFX "%s: cannot map PIO, aborting\n", pci_name(pdev));
836 rc = -EIO;
837 goto err_out;
838 }
859 dev->base_addr = pio_start; 839 dev->base_addr = pio_start;
860 tp->mmio_addr = ioaddr; 840 tp->mmio_addr = ioaddr;
861 tp->regs_len = pio_len; 841 tp->regs_len = pio_len;
862#else 842#else
863 /* ioremap MMIO region */ 843 /* ioremap MMIO region */
864 ioaddr = ioremap (mmio_start, mmio_len); 844 ioaddr = pci_iomap(pdev, 1, 0);
865 if (ioaddr == NULL) { 845 if (ioaddr == NULL) {
866 printk (KERN_ERR PFX "%s: cannot remap MMIO, aborting\n", pci_name(pdev)); 846 printk (KERN_ERR PFX "%s: cannot remap MMIO, aborting\n", pci_name(pdev));
867 rc = -EIO; 847 rc = -EIO;
@@ -947,7 +927,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
947 struct net_device *dev = NULL; 927 struct net_device *dev = NULL;
948 struct rtl8139_private *tp; 928 struct rtl8139_private *tp;
949 int i, addr_len, option; 929 int i, addr_len, option;
950 void *ioaddr; 930 void __iomem *ioaddr;
951 static int board_idx = -1; 931 static int board_idx = -1;
952 u8 pci_rev; 932 u8 pci_rev;
953 933
@@ -1147,47 +1127,46 @@ static void __devexit rtl8139_remove_one (struct pci_dev *pdev)
1147 No extra delay is needed with 33Mhz PCI, but 66Mhz may change this. 1127 No extra delay is needed with 33Mhz PCI, but 66Mhz may change this.
1148 */ 1128 */
1149 1129
1150#define eeprom_delay() readl(ee_addr) 1130#define eeprom_delay() RTL_R32(Cfg9346)
1151 1131
1152/* The EEPROM commands include the alway-set leading bit. */ 1132/* The EEPROM commands include the alway-set leading bit. */
1153#define EE_WRITE_CMD (5) 1133#define EE_WRITE_CMD (5)
1154#define EE_READ_CMD (6) 1134#define EE_READ_CMD (6)
1155#define EE_ERASE_CMD (7) 1135#define EE_ERASE_CMD (7)
1156 1136
1157static int __devinit read_eeprom (void *ioaddr, int location, int addr_len) 1137static int __devinit read_eeprom (void __iomem *ioaddr, int location, int addr_len)
1158{ 1138{
1159 int i; 1139 int i;
1160 unsigned retval = 0; 1140 unsigned retval = 0;
1161 void *ee_addr = ioaddr + Cfg9346;
1162 int read_cmd = location | (EE_READ_CMD << addr_len); 1141 int read_cmd = location | (EE_READ_CMD << addr_len);
1163 1142
1164 writeb (EE_ENB & ~EE_CS, ee_addr); 1143 RTL_W8 (Cfg9346, EE_ENB & ~EE_CS);
1165 writeb (EE_ENB, ee_addr); 1144 RTL_W8 (Cfg9346, EE_ENB);
1166 eeprom_delay (); 1145 eeprom_delay ();
1167 1146
1168 /* Shift the read command bits out. */ 1147 /* Shift the read command bits out. */
1169 for (i = 4 + addr_len; i >= 0; i--) { 1148 for (i = 4 + addr_len; i >= 0; i--) {
1170 int dataval = (read_cmd & (1 << i)) ? EE_DATA_WRITE : 0; 1149 int dataval = (read_cmd & (1 << i)) ? EE_DATA_WRITE : 0;
1171 writeb (EE_ENB | dataval, ee_addr); 1150 RTL_W8 (Cfg9346, EE_ENB | dataval);
1172 eeprom_delay (); 1151 eeprom_delay ();
1173 writeb (EE_ENB | dataval | EE_SHIFT_CLK, ee_addr); 1152 RTL_W8 (Cfg9346, EE_ENB | dataval | EE_SHIFT_CLK);
1174 eeprom_delay (); 1153 eeprom_delay ();
1175 } 1154 }
1176 writeb (EE_ENB, ee_addr); 1155 RTL_W8 (Cfg9346, EE_ENB);
1177 eeprom_delay (); 1156 eeprom_delay ();
1178 1157
1179 for (i = 16; i > 0; i--) { 1158 for (i = 16; i > 0; i--) {
1180 writeb (EE_ENB | EE_SHIFT_CLK, ee_addr); 1159 RTL_W8 (Cfg9346, EE_ENB | EE_SHIFT_CLK);
1181 eeprom_delay (); 1160 eeprom_delay ();
1182 retval = 1161 retval =
1183 (retval << 1) | ((readb (ee_addr) & EE_DATA_READ) ? 1 : 1162 (retval << 1) | ((RTL_R8 (Cfg9346) & EE_DATA_READ) ? 1 :
1184 0); 1163 0);
1185 writeb (EE_ENB, ee_addr); 1164 RTL_W8 (Cfg9346, EE_ENB);
1186 eeprom_delay (); 1165 eeprom_delay ();
1187 } 1166 }
1188 1167
1189 /* Terminate the EEPROM access. */ 1168 /* Terminate the EEPROM access. */
1190 writeb (~EE_CS, ee_addr); 1169 RTL_W8 (Cfg9346, ~EE_CS);
1191 eeprom_delay (); 1170 eeprom_delay ();
1192 1171
1193 return retval; 1172 return retval;
@@ -1206,7 +1185,7 @@ static int __devinit read_eeprom (void *ioaddr, int location, int addr_len)
1206#define MDIO_WRITE0 (MDIO_DIR) 1185#define MDIO_WRITE0 (MDIO_DIR)
1207#define MDIO_WRITE1 (MDIO_DIR | MDIO_DATA_OUT) 1186#define MDIO_WRITE1 (MDIO_DIR | MDIO_DATA_OUT)
1208 1187
1209#define mdio_delay(mdio_addr) readb(mdio_addr) 1188#define mdio_delay() RTL_R8(Config4)
1210 1189
1211 1190
1212static char mii_2_8139_map[8] = { 1191static char mii_2_8139_map[8] = {
@@ -1223,15 +1202,15 @@ static char mii_2_8139_map[8] = {
1223 1202
1224#ifdef CONFIG_8139TOO_8129 1203#ifdef CONFIG_8139TOO_8129
1225/* Syncronize the MII management interface by shifting 32 one bits out. */ 1204/* Syncronize the MII management interface by shifting 32 one bits out. */
1226static void mdio_sync (void *mdio_addr) 1205static void mdio_sync (void __iomem *ioaddr)
1227{ 1206{
1228 int i; 1207 int i;
1229 1208
1230 for (i = 32; i >= 0; i--) { 1209 for (i = 32; i >= 0; i--) {
1231 writeb (MDIO_WRITE1, mdio_addr); 1210 RTL_W8 (Config4, MDIO_WRITE1);
1232 mdio_delay (mdio_addr); 1211 mdio_delay ();
1233 writeb (MDIO_WRITE1 | MDIO_CLK, mdio_addr); 1212 RTL_W8 (Config4, MDIO_WRITE1 | MDIO_CLK);
1234 mdio_delay (mdio_addr); 1213 mdio_delay ();
1235 } 1214 }
1236} 1215}
1237#endif 1216#endif
@@ -1241,35 +1220,36 @@ static int mdio_read (struct net_device *dev, int phy_id, int location)
1241 struct rtl8139_private *tp = netdev_priv(dev); 1220 struct rtl8139_private *tp = netdev_priv(dev);
1242 int retval = 0; 1221 int retval = 0;
1243#ifdef CONFIG_8139TOO_8129 1222#ifdef CONFIG_8139TOO_8129
1244 void *mdio_addr = tp->mmio_addr + Config4; 1223 void __iomem *ioaddr = tp->mmio_addr;
1245 int mii_cmd = (0xf6 << 10) | (phy_id << 5) | location; 1224 int mii_cmd = (0xf6 << 10) | (phy_id << 5) | location;
1246 int i; 1225 int i;
1247#endif 1226#endif
1248 1227
1249 if (phy_id > 31) { /* Really a 8139. Use internal registers. */ 1228 if (phy_id > 31) { /* Really a 8139. Use internal registers. */
1229 void __iomem *ioaddr = tp->mmio_addr;
1250 return location < 8 && mii_2_8139_map[location] ? 1230 return location < 8 && mii_2_8139_map[location] ?
1251 readw (tp->mmio_addr + mii_2_8139_map[location]) : 0; 1231 RTL_R16 (mii_2_8139_map[location]) : 0;
1252 } 1232 }
1253 1233
1254#ifdef CONFIG_8139TOO_8129 1234#ifdef CONFIG_8139TOO_8129
1255 mdio_sync (mdio_addr); 1235 mdio_sync (ioaddr);
1256 /* Shift the read command bits out. */ 1236 /* Shift the read command bits out. */
1257 for (i = 15; i >= 0; i--) { 1237 for (i = 15; i >= 0; i--) {
1258 int dataval = (mii_cmd & (1 << i)) ? MDIO_DATA_OUT : 0; 1238 int dataval = (mii_cmd & (1 << i)) ? MDIO_DATA_OUT : 0;
1259 1239
1260 writeb (MDIO_DIR | dataval, mdio_addr); 1240 RTL_W8 (Config4, MDIO_DIR | dataval);
1261 mdio_delay (mdio_addr); 1241 mdio_delay ();
1262 writeb (MDIO_DIR | dataval | MDIO_CLK, mdio_addr); 1242 RTL_W8 (Config4, MDIO_DIR | dataval | MDIO_CLK);
1263 mdio_delay (mdio_addr); 1243 mdio_delay ();
1264 } 1244 }
1265 1245
1266 /* Read the two transition, 16 data, and wire-idle bits. */ 1246 /* Read the two transition, 16 data, and wire-idle bits. */
1267 for (i = 19; i > 0; i--) { 1247 for (i = 19; i > 0; i--) {
1268 writeb (0, mdio_addr); 1248 RTL_W8 (Config4, 0);
1269 mdio_delay (mdio_addr); 1249 mdio_delay ();
1270 retval = (retval << 1) | ((readb (mdio_addr) & MDIO_DATA_IN) ? 1 : 0); 1250 retval = (retval << 1) | ((RTL_R8 (Config4) & MDIO_DATA_IN) ? 1 : 0);
1271 writeb (MDIO_CLK, mdio_addr); 1251 RTL_W8 (Config4, MDIO_CLK);
1272 mdio_delay (mdio_addr); 1252 mdio_delay ();
1273 } 1253 }
1274#endif 1254#endif
1275 1255
@@ -1282,13 +1262,13 @@ static void mdio_write (struct net_device *dev, int phy_id, int location,
1282{ 1262{
1283 struct rtl8139_private *tp = netdev_priv(dev); 1263 struct rtl8139_private *tp = netdev_priv(dev);
1284#ifdef CONFIG_8139TOO_8129 1264#ifdef CONFIG_8139TOO_8129
1285 void *mdio_addr = tp->mmio_addr + Config4; 1265 void __iomem *ioaddr = tp->mmio_addr;
1286 int mii_cmd = (0x5002 << 16) | (phy_id << 23) | (location << 18) | value; 1266 int mii_cmd = (0x5002 << 16) | (phy_id << 23) | (location << 18) | value;
1287 int i; 1267 int i;
1288#endif 1268#endif
1289 1269
1290 if (phy_id > 31) { /* Really a 8139. Use internal registers. */ 1270 if (phy_id > 31) { /* Really a 8139. Use internal registers. */
1291 void *ioaddr = tp->mmio_addr; 1271 void __iomem *ioaddr = tp->mmio_addr;
1292 if (location == 0) { 1272 if (location == 0) {
1293 RTL_W8 (Cfg9346, Cfg9346_Unlock); 1273 RTL_W8 (Cfg9346, Cfg9346_Unlock);
1294 RTL_W16 (BasicModeCtrl, value); 1274 RTL_W16 (BasicModeCtrl, value);
@@ -1299,23 +1279,23 @@ static void mdio_write (struct net_device *dev, int phy_id, int location,
1299 } 1279 }
1300 1280
1301#ifdef CONFIG_8139TOO_8129 1281#ifdef CONFIG_8139TOO_8129
1302 mdio_sync (mdio_addr); 1282 mdio_sync (ioaddr);
1303 1283
1304 /* Shift the command bits out. */ 1284 /* Shift the command bits out. */
1305 for (i = 31; i >= 0; i--) { 1285 for (i = 31; i >= 0; i--) {
1306 int dataval = 1286 int dataval =
1307 (mii_cmd & (1 << i)) ? MDIO_WRITE1 : MDIO_WRITE0; 1287 (mii_cmd & (1 << i)) ? MDIO_WRITE1 : MDIO_WRITE0;
1308 writeb (dataval, mdio_addr); 1288 RTL_W8 (Config4, dataval);
1309 mdio_delay (mdio_addr); 1289 mdio_delay ();
1310 writeb (dataval | MDIO_CLK, mdio_addr); 1290 RTL_W8 (Config4, dataval | MDIO_CLK);
1311 mdio_delay (mdio_addr); 1291 mdio_delay ();
1312 } 1292 }
1313 /* Clear out extra bits. */ 1293 /* Clear out extra bits. */
1314 for (i = 2; i > 0; i--) { 1294 for (i = 2; i > 0; i--) {
1315 writeb (0, mdio_addr); 1295 RTL_W8 (Config4, 0);
1316 mdio_delay (mdio_addr); 1296 mdio_delay ();
1317 writeb (MDIO_CLK, mdio_addr); 1297 RTL_W8 (Config4, MDIO_CLK);
1318 mdio_delay (mdio_addr); 1298 mdio_delay ();
1319 } 1299 }
1320#endif 1300#endif
1321} 1301}
@@ -1325,7 +1305,7 @@ static int rtl8139_open (struct net_device *dev)
1325{ 1305{
1326 struct rtl8139_private *tp = netdev_priv(dev); 1306 struct rtl8139_private *tp = netdev_priv(dev);
1327 int retval; 1307 int retval;
1328 void *ioaddr = tp->mmio_addr; 1308 void __iomem *ioaddr = tp->mmio_addr;
1329 1309
1330 retval = request_irq (dev->irq, rtl8139_interrupt, SA_SHIRQ, dev->name, dev); 1310 retval = request_irq (dev->irq, rtl8139_interrupt, SA_SHIRQ, dev->name, dev);
1331 if (retval) 1311 if (retval)
@@ -1382,7 +1362,7 @@ static void rtl_check_media (struct net_device *dev, unsigned int init_media)
1382static void rtl8139_hw_start (struct net_device *dev) 1362static void rtl8139_hw_start (struct net_device *dev)
1383{ 1363{
1384 struct rtl8139_private *tp = netdev_priv(dev); 1364 struct rtl8139_private *tp = netdev_priv(dev);
1385 void *ioaddr = tp->mmio_addr; 1365 void __iomem *ioaddr = tp->mmio_addr;
1386 u32 i; 1366 u32 i;
1387 u8 tmp; 1367 u8 tmp;
1388 1368
@@ -1484,7 +1464,7 @@ static void rtl8139_tune_twister (struct net_device *dev,
1484 struct rtl8139_private *tp) 1464 struct rtl8139_private *tp)
1485{ 1465{
1486 int linkcase; 1466 int linkcase;
1487 void *ioaddr = tp->mmio_addr; 1467 void __iomem *ioaddr = tp->mmio_addr;
1488 1468
1489 /* This is a complicated state machine to configure the "twister" for 1469 /* This is a complicated state machine to configure the "twister" for
1490 impedance/echos based on the cable length. 1470 impedance/echos based on the cable length.
@@ -1568,7 +1548,7 @@ static void rtl8139_tune_twister (struct net_device *dev,
1568 1548
1569static inline void rtl8139_thread_iter (struct net_device *dev, 1549static inline void rtl8139_thread_iter (struct net_device *dev,
1570 struct rtl8139_private *tp, 1550 struct rtl8139_private *tp,
1571 void *ioaddr) 1551 void __iomem *ioaddr)
1572{ 1552{
1573 int mii_lpa; 1553 int mii_lpa;
1574 1554
@@ -1676,7 +1656,7 @@ static inline void rtl8139_tx_clear (struct rtl8139_private *tp)
1676static void rtl8139_tx_timeout (struct net_device *dev) 1656static void rtl8139_tx_timeout (struct net_device *dev)
1677{ 1657{
1678 struct rtl8139_private *tp = netdev_priv(dev); 1658 struct rtl8139_private *tp = netdev_priv(dev);
1679 void *ioaddr = tp->mmio_addr; 1659 void __iomem *ioaddr = tp->mmio_addr;
1680 int i; 1660 int i;
1681 u8 tmp8; 1661 u8 tmp8;
1682 unsigned long flags; 1662 unsigned long flags;
@@ -1721,7 +1701,7 @@ static void rtl8139_tx_timeout (struct net_device *dev)
1721static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev) 1701static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
1722{ 1702{
1723 struct rtl8139_private *tp = netdev_priv(dev); 1703 struct rtl8139_private *tp = netdev_priv(dev);
1724 void *ioaddr = tp->mmio_addr; 1704 void __iomem *ioaddr = tp->mmio_addr;
1725 unsigned int entry; 1705 unsigned int entry;
1726 unsigned int len = skb->len; 1706 unsigned int len = skb->len;
1727 1707
@@ -1763,7 +1743,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
1763 1743
1764static void rtl8139_tx_interrupt (struct net_device *dev, 1744static void rtl8139_tx_interrupt (struct net_device *dev,
1765 struct rtl8139_private *tp, 1745 struct rtl8139_private *tp,
1766 void *ioaddr) 1746 void __iomem *ioaddr)
1767{ 1747{
1768 unsigned long dirty_tx, tx_left; 1748 unsigned long dirty_tx, tx_left;
1769 1749
@@ -1833,7 +1813,7 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
1833 1813
1834/* TODO: clean this up! Rx reset need not be this intensive */ 1814/* TODO: clean this up! Rx reset need not be this intensive */
1835static void rtl8139_rx_err (u32 rx_status, struct net_device *dev, 1815static void rtl8139_rx_err (u32 rx_status, struct net_device *dev,
1836 struct rtl8139_private *tp, void *ioaddr) 1816 struct rtl8139_private *tp, void __iomem *ioaddr)
1837{ 1817{
1838 u8 tmp8; 1818 u8 tmp8;
1839#ifdef CONFIG_8139_OLD_RX_RESET 1819#ifdef CONFIG_8139_OLD_RX_RESET
@@ -1930,7 +1910,7 @@ static __inline__ void wrap_copy(struct sk_buff *skb, const unsigned char *ring,
1930 1910
1931static void rtl8139_isr_ack(struct rtl8139_private *tp) 1911static void rtl8139_isr_ack(struct rtl8139_private *tp)
1932{ 1912{
1933 void *ioaddr = tp->mmio_addr; 1913 void __iomem *ioaddr = tp->mmio_addr;
1934 u16 status; 1914 u16 status;
1935 1915
1936 status = RTL_R16 (IntrStatus) & RxAckBits; 1916 status = RTL_R16 (IntrStatus) & RxAckBits;
@@ -1949,7 +1929,7 @@ static void rtl8139_isr_ack(struct rtl8139_private *tp)
1949static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, 1929static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
1950 int budget) 1930 int budget)
1951{ 1931{
1952 void *ioaddr = tp->mmio_addr; 1932 void __iomem *ioaddr = tp->mmio_addr;
1953 int received = 0; 1933 int received = 0;
1954 unsigned char *rx_ring = tp->rx_ring; 1934 unsigned char *rx_ring = tp->rx_ring;
1955 unsigned int cur_rx = tp->cur_rx; 1935 unsigned int cur_rx = tp->cur_rx;
@@ -2087,7 +2067,7 @@ out:
2087 2067
2088static void rtl8139_weird_interrupt (struct net_device *dev, 2068static void rtl8139_weird_interrupt (struct net_device *dev,
2089 struct rtl8139_private *tp, 2069 struct rtl8139_private *tp,
2090 void *ioaddr, 2070 void __iomem *ioaddr,
2091 int status, int link_changed) 2071 int status, int link_changed)
2092{ 2072{
2093 DPRINTK ("%s: Abnormal interrupt, status %8.8x.\n", 2073 DPRINTK ("%s: Abnormal interrupt, status %8.8x.\n",
@@ -2127,7 +2107,7 @@ static void rtl8139_weird_interrupt (struct net_device *dev,
2127static int rtl8139_poll(struct net_device *dev, int *budget) 2107static int rtl8139_poll(struct net_device *dev, int *budget)
2128{ 2108{
2129 struct rtl8139_private *tp = netdev_priv(dev); 2109 struct rtl8139_private *tp = netdev_priv(dev);
2130 void *ioaddr = tp->mmio_addr; 2110 void __iomem *ioaddr = tp->mmio_addr;
2131 int orig_budget = min(*budget, dev->quota); 2111 int orig_budget = min(*budget, dev->quota);
2132 int done = 1; 2112 int done = 1;
2133 2113
@@ -2165,7 +2145,7 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance,
2165{ 2145{
2166 struct net_device *dev = (struct net_device *) dev_instance; 2146 struct net_device *dev = (struct net_device *) dev_instance;
2167 struct rtl8139_private *tp = netdev_priv(dev); 2147 struct rtl8139_private *tp = netdev_priv(dev);
2168 void *ioaddr = tp->mmio_addr; 2148 void __iomem *ioaddr = tp->mmio_addr;
2169 u16 status, ackstat; 2149 u16 status, ackstat;
2170 int link_changed = 0; /* avoid bogus "uninit" warning */ 2150 int link_changed = 0; /* avoid bogus "uninit" warning */
2171 int handled = 0; 2151 int handled = 0;
@@ -2241,7 +2221,7 @@ static void rtl8139_poll_controller(struct net_device *dev)
2241static int rtl8139_close (struct net_device *dev) 2221static int rtl8139_close (struct net_device *dev)
2242{ 2222{
2243 struct rtl8139_private *tp = netdev_priv(dev); 2223 struct rtl8139_private *tp = netdev_priv(dev);
2244 void *ioaddr = tp->mmio_addr; 2224 void __iomem *ioaddr = tp->mmio_addr;
2245 int ret = 0; 2225 int ret = 0;
2246 unsigned long flags; 2226 unsigned long flags;
2247 2227
@@ -2304,7 +2284,7 @@ static int rtl8139_close (struct net_device *dev)
2304static void rtl8139_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 2284static void rtl8139_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
2305{ 2285{
2306 struct rtl8139_private *np = netdev_priv(dev); 2286 struct rtl8139_private *np = netdev_priv(dev);
2307 void *ioaddr = np->mmio_addr; 2287 void __iomem *ioaddr = np->mmio_addr;
2308 2288
2309 spin_lock_irq(&np->lock); 2289 spin_lock_irq(&np->lock);
2310 if (rtl_chip_info[np->chipset].flags & HasLWake) { 2290 if (rtl_chip_info[np->chipset].flags & HasLWake) {
@@ -2338,7 +2318,7 @@ static void rtl8139_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
2338static int rtl8139_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 2318static int rtl8139_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
2339{ 2319{
2340 struct rtl8139_private *np = netdev_priv(dev); 2320 struct rtl8139_private *np = netdev_priv(dev);
2341 void *ioaddr = np->mmio_addr; 2321 void __iomem *ioaddr = np->mmio_addr;
2342 u32 support; 2322 u32 support;
2343 u8 cfg3, cfg5; 2323 u8 cfg3, cfg5;
2344 2324
@@ -2506,7 +2486,7 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2506static struct net_device_stats *rtl8139_get_stats (struct net_device *dev) 2486static struct net_device_stats *rtl8139_get_stats (struct net_device *dev)
2507{ 2487{
2508 struct rtl8139_private *tp = netdev_priv(dev); 2488 struct rtl8139_private *tp = netdev_priv(dev);
2509 void *ioaddr = tp->mmio_addr; 2489 void __iomem *ioaddr = tp->mmio_addr;
2510 unsigned long flags; 2490 unsigned long flags;
2511 2491
2512 if (netif_running(dev)) { 2492 if (netif_running(dev)) {
@@ -2525,7 +2505,7 @@ static struct net_device_stats *rtl8139_get_stats (struct net_device *dev)
2525static void __set_rx_mode (struct net_device *dev) 2505static void __set_rx_mode (struct net_device *dev)
2526{ 2506{
2527 struct rtl8139_private *tp = netdev_priv(dev); 2507 struct rtl8139_private *tp = netdev_priv(dev);
2528 void *ioaddr = tp->mmio_addr; 2508 void __iomem *ioaddr = tp->mmio_addr;
2529 u32 mc_filter[2]; /* Multicast hash filter */ 2509 u32 mc_filter[2]; /* Multicast hash filter */
2530 int i, rx_mode; 2510 int i, rx_mode;
2531 u32 tmp; 2511 u32 tmp;
@@ -2586,7 +2566,7 @@ static int rtl8139_suspend (struct pci_dev *pdev, pm_message_t state)
2586{ 2566{
2587 struct net_device *dev = pci_get_drvdata (pdev); 2567 struct net_device *dev = pci_get_drvdata (pdev);
2588 struct rtl8139_private *tp = netdev_priv(dev); 2568 struct rtl8139_private *tp = netdev_priv(dev);
2589 void *ioaddr = tp->mmio_addr; 2569 void __iomem *ioaddr = tp->mmio_addr;
2590 unsigned long flags; 2570 unsigned long flags;
2591 2571
2592 pci_save_state (pdev); 2572 pci_save_state (pdev);
diff --git a/drivers/net/8390.c b/drivers/net/8390.c
index bab16bcc9ae5..6d76f3a99b17 100644
--- a/drivers/net/8390.c
+++ b/drivers/net/8390.c
@@ -225,9 +225,9 @@ void ei_tx_timeout(struct net_device *dev)
225 unsigned long icucr; 225 unsigned long icucr;
226 226
227 local_irq_save(flags); 227 local_irq_save(flags);
228 icucr = inl(ICUCR1); 228 icucr = inl(M32R_ICU_CR1_PORTL);
229 icucr |= M32R_ICUCR_ISMOD11; 229 icucr |= M32R_ICUCR_ISMOD11;
230 outl(icucr, ICUCR1); 230 outl(icucr, M32R_ICU_CR1_PORTL);
231 local_irq_restore(flags); 231 local_irq_restore(flags);
232#endif 232#endif
233 ei_local->stat.tx_errors++; 233 ei_local->stat.tx_errors++;
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 3a0a55b62aaf..fa9f76c953dd 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -824,6 +824,18 @@ config SMC9194
824 <file:Documentation/networking/net-modules.txt>. The module 824 <file:Documentation/networking/net-modules.txt>. The module
825 will be called smc9194. 825 will be called smc9194.
826 826
827config DM9000
828 tristate "DM9000 support"
829 depends on ARM && NET_ETHERNET
830 select CRC32
831 select MII
832 ---help---
833 Support for DM9000 chipset.
834
835 To compile this driver as a module, choose M here and read
836 <file:Documentation/networking/net-modules.txt>. The module will be
837 called dm9000.
838
827config NET_VENDOR_RACAL 839config NET_VENDOR_RACAL
828 bool "Racal-Interlan (Micom) NI cards" 840 bool "Racal-Interlan (Micom) NI cards"
829 depends on NET_ETHERNET && ISA 841 depends on NET_ETHERNET && ISA
@@ -989,21 +1001,6 @@ config EEXPRESS_PRO
989 <file:Documentation/networking/net-modules.txt>. The module 1001 <file:Documentation/networking/net-modules.txt>. The module
990 will be called eepro. 1002 will be called eepro.
991 1003
992config FMV18X
993 tristate "FMV-181/182/183/184 support (OBSOLETE)"
994 depends on NET_ISA && OBSOLETE
995 ---help---
996 If you have a Fujitsu FMV-181/182/183/184 network (Ethernet) card,
997 say Y and read the Ethernet-HOWTO, available from
998 <http://www.tldp.org/docs.html#howto>.
999
1000 If you use an FMV-183 or FMV-184 and it is not working, you may need
1001 to disable Plug & Play mode of the card.
1002
1003 To compile this driver as a module, choose M here and read
1004 <file:Documentation/networking/net-modules.txt>. The module
1005 will be called fmv18x.
1006
1007config HPLAN_PLUS 1004config HPLAN_PLUS
1008 tristate "HP PCLAN+ (27247B and 27252A) support" 1005 tristate "HP PCLAN+ (27247B and 27252A) support"
1009 depends on NET_ISA 1006 depends on NET_ISA
@@ -1092,14 +1089,6 @@ config SEEQ8005
1092 <file:Documentation/networking/net-modules.txt>. The module 1089 <file:Documentation/networking/net-modules.txt>. The module
1093 will be called seeq8005. 1090 will be called seeq8005.
1094 1091
1095config SK_G16
1096 tristate "SK_G16 support (OBSOLETE)"
1097 depends on NET_ISA && OBSOLETE
1098 help
1099 If you have a network (Ethernet) card of this type, say Y and read
1100 the Ethernet-HOWTO, available from
1101 <http://www.tldp.org/docs.html#howto>.
1102
1103config SKMC 1092config SKMC
1104 tristate "SKnet MCA support" 1093 tristate "SKnet MCA support"
1105 depends on NET_ETHERNET && MCA && BROKEN 1094 depends on NET_ETHERNET && MCA && BROKEN
@@ -1555,6 +1544,7 @@ config SIS900
1555 tristate "SiS 900/7016 PCI Fast Ethernet Adapter support" 1544 tristate "SiS 900/7016 PCI Fast Ethernet Adapter support"
1556 depends on NET_PCI && PCI 1545 depends on NET_PCI && PCI
1557 select CRC32 1546 select CRC32
1547 select MII
1558 ---help--- 1548 ---help---
1559 This is a driver for the Fast Ethernet PCI network cards based on 1549 This is a driver for the Fast Ethernet PCI network cards based on
1560 the SiS 900 and SiS 7016 chips. The SiS 900 core is also embedded in 1550 the SiS 900 and SiS 7016 chips. The SiS 900 core is also embedded in
@@ -1931,6 +1921,18 @@ config R8169_VLAN
1931 1921
1932 If in doubt, say Y. 1922 If in doubt, say Y.
1933 1923
1924config SKGE
1925 tristate "New SysKonnect GigaEthernet support (EXPERIMENTAL)"
1926 depends on PCI && EXPERIMENTAL
1927 select CRC32
1928 ---help---
1929 This driver support the Marvell Yukon or SysKonnect SK-98xx/SK-95xx
1930 and related Gigabit Ethernet adapters. It is a new smaller driver
1931 driver with better performance and more complete ethtool support.
1932
1933 It does not support the link failover and network management
1934 features that "portable" vendor supplied sk98lin driver does.
1935
1934config SK98LIN 1936config SK98LIN
1935 tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support" 1937 tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support"
1936 depends on PCI 1938 depends on PCI
@@ -2031,6 +2033,15 @@ config TIGON3
2031 To compile this driver as a module, choose M here: the module 2033 To compile this driver as a module, choose M here: the module
2032 will be called tg3. This is recommended. 2034 will be called tg3. This is recommended.
2033 2035
2036config BNX2
2037 tristate "Broadcom NetXtremeII support"
2038 depends on PCI
2039 help
2040 This driver supports Broadcom NetXtremeII gigabit Ethernet cards.
2041
2042 To compile this driver as a module, choose M here: the module
2043 will be called bnx2. This is recommended.
2044
2034config GIANFAR 2045config GIANFAR
2035 tristate "Gianfar Ethernet" 2046 tristate "Gianfar Ethernet"
2036 depends on 85xx || 83xx 2047 depends on 85xx || 83xx
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index e038d55e4f6f..63c6d1e6d4d9 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -51,7 +51,9 @@ obj-$(CONFIG_NS83820) += ns83820.o
51obj-$(CONFIG_STNIC) += stnic.o 8390.o 51obj-$(CONFIG_STNIC) += stnic.o 8390.o
52obj-$(CONFIG_FEALNX) += fealnx.o 52obj-$(CONFIG_FEALNX) += fealnx.o
53obj-$(CONFIG_TIGON3) += tg3.o 53obj-$(CONFIG_TIGON3) += tg3.o
54obj-$(CONFIG_BNX2) += bnx2.o
54obj-$(CONFIG_TC35815) += tc35815.o 55obj-$(CONFIG_TC35815) += tc35815.o
56obj-$(CONFIG_SKGE) += skge.o
55obj-$(CONFIG_SK98LIN) += sk98lin/ 57obj-$(CONFIG_SK98LIN) += sk98lin/
56obj-$(CONFIG_SKFP) += skfp/ 58obj-$(CONFIG_SKFP) += skfp/
57obj-$(CONFIG_VIA_RHINE) += via-rhine.o 59obj-$(CONFIG_VIA_RHINE) += via-rhine.o
@@ -73,7 +75,6 @@ obj-$(CONFIG_MAC8390) += mac8390.o 8390.o
73obj-$(CONFIG_APNE) += apne.o 8390.o 75obj-$(CONFIG_APNE) += apne.o 8390.o
74obj-$(CONFIG_PCMCIA_PCNET) += 8390.o 76obj-$(CONFIG_PCMCIA_PCNET) += 8390.o
75obj-$(CONFIG_SHAPER) += shaper.o 77obj-$(CONFIG_SHAPER) += shaper.o
76obj-$(CONFIG_SK_G16) += sk_g16.o
77obj-$(CONFIG_HP100) += hp100.o 78obj-$(CONFIG_HP100) += hp100.o
78obj-$(CONFIG_SMC9194) += smc9194.o 79obj-$(CONFIG_SMC9194) += smc9194.o
79obj-$(CONFIG_FEC) += fec.o 80obj-$(CONFIG_FEC) += fec.o
@@ -121,7 +122,6 @@ obj-$(CONFIG_DEFXX) += defxx.o
121obj-$(CONFIG_SGISEEQ) += sgiseeq.o 122obj-$(CONFIG_SGISEEQ) += sgiseeq.o
122obj-$(CONFIG_SGI_O2MACE_ETH) += meth.o 123obj-$(CONFIG_SGI_O2MACE_ETH) += meth.o
123obj-$(CONFIG_AT1700) += at1700.o 124obj-$(CONFIG_AT1700) += at1700.o
124obj-$(CONFIG_FMV18X) += fmv18x.o
125obj-$(CONFIG_EL1) += 3c501.o 125obj-$(CONFIG_EL1) += 3c501.o
126obj-$(CONFIG_EL16) += 3c507.o 126obj-$(CONFIG_EL16) += 3c507.o
127obj-$(CONFIG_ELMC) += 3c523.o 127obj-$(CONFIG_ELMC) += 3c523.o
@@ -179,6 +179,7 @@ obj-$(CONFIG_AMD8111_ETH) += amd8111e.o
179obj-$(CONFIG_IBMVETH) += ibmveth.o 179obj-$(CONFIG_IBMVETH) += ibmveth.o
180obj-$(CONFIG_S2IO) += s2io.o 180obj-$(CONFIG_S2IO) += s2io.o
181obj-$(CONFIG_SMC91X) += smc91x.o 181obj-$(CONFIG_SMC91X) += smc91x.o
182obj-$(CONFIG_DM9000) += dm9000.o
182obj-$(CONFIG_FEC_8XX) += fec_8xx/ 183obj-$(CONFIG_FEC_8XX) += fec_8xx/
183 184
184obj-$(CONFIG_ARM) += arm/ 185obj-$(CONFIG_ARM) += arm/
diff --git a/drivers/net/Space.c b/drivers/net/Space.c
index fb433325aa27..3707df6b0cfa 100644
--- a/drivers/net/Space.c
+++ b/drivers/net/Space.c
@@ -210,9 +210,6 @@ static struct devprobe2 isa_probes[] __initdata = {
210#ifdef CONFIG_AT1700 210#ifdef CONFIG_AT1700
211 {at1700_probe, 0}, 211 {at1700_probe, 0},
212#endif 212#endif
213#ifdef CONFIG_FMV18X /* Fujitsu FMV-181/182 */
214 {fmv18x_probe, 0},
215#endif
216#ifdef CONFIG_ETH16I 213#ifdef CONFIG_ETH16I
217 {eth16i_probe, 0}, /* ICL EtherTeam 16i/32 */ 214 {eth16i_probe, 0}, /* ICL EtherTeam 16i/32 */
218#endif 215#endif
@@ -243,9 +240,6 @@ static struct devprobe2 isa_probes[] __initdata = {
243#ifdef CONFIG_ELPLUS /* 3c505 */ 240#ifdef CONFIG_ELPLUS /* 3c505 */
244 {elplus_probe, 0}, 241 {elplus_probe, 0},
245#endif 242#endif
246#ifdef CONFIG_SK_G16
247 {SK_init, 0},
248#endif
249#ifdef CONFIG_NI5010 243#ifdef CONFIG_NI5010
250 {ni5010_probe, 0}, 244 {ni5010_probe, 0},
251#endif 245#endif
diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c
index 942a2819576c..2e28c201dcc0 100644
--- a/drivers/net/arm/etherh.c
+++ b/drivers/net/arm/etherh.c
@@ -68,6 +68,7 @@ struct etherh_priv {
68 void __iomem *dma_base; 68 void __iomem *dma_base;
69 unsigned int id; 69 unsigned int id;
70 void __iomem *ctrl_port; 70 void __iomem *ctrl_port;
71 void __iomem *base;
71 unsigned char ctrl; 72 unsigned char ctrl;
72 u32 supported; 73 u32 supported;
73}; 74};
@@ -177,7 +178,7 @@ etherh_setif(struct net_device *dev)
177 switch (etherh_priv(dev)->id) { 178 switch (etherh_priv(dev)->id) {
178 case PROD_I3_ETHERLAN600: 179 case PROD_I3_ETHERLAN600:
179 case PROD_I3_ETHERLAN600A: 180 case PROD_I3_ETHERLAN600A:
180 addr = (void *)dev->base_addr + EN0_RCNTHI; 181 addr = etherh_priv(dev)->base + EN0_RCNTHI;
181 182
182 switch (dev->if_port) { 183 switch (dev->if_port) {
183 case IF_PORT_10BASE2: 184 case IF_PORT_10BASE2:
@@ -218,7 +219,7 @@ etherh_getifstat(struct net_device *dev)
218 switch (etherh_priv(dev)->id) { 219 switch (etherh_priv(dev)->id) {
219 case PROD_I3_ETHERLAN600: 220 case PROD_I3_ETHERLAN600:
220 case PROD_I3_ETHERLAN600A: 221 case PROD_I3_ETHERLAN600A:
221 addr = (void *)dev->base_addr + EN0_RCNTHI; 222 addr = etherh_priv(dev)->base + EN0_RCNTHI;
222 switch (dev->if_port) { 223 switch (dev->if_port) {
223 case IF_PORT_10BASE2: 224 case IF_PORT_10BASE2:
224 stat = 1; 225 stat = 1;
@@ -281,7 +282,7 @@ static void
281etherh_reset(struct net_device *dev) 282etherh_reset(struct net_device *dev)
282{ 283{
283 struct ei_device *ei_local = netdev_priv(dev); 284 struct ei_device *ei_local = netdev_priv(dev);
284 void __iomem *addr = (void *)dev->base_addr; 285 void __iomem *addr = etherh_priv(dev)->base;
285 286
286 writeb(E8390_NODMA+E8390_PAGE0+E8390_STOP, addr); 287 writeb(E8390_NODMA+E8390_PAGE0+E8390_STOP, addr);
287 288
@@ -327,7 +328,7 @@ etherh_block_output (struct net_device *dev, int count, const unsigned char *buf
327 328
328 ei_local->dmaing = 1; 329 ei_local->dmaing = 1;
329 330
330 addr = (void *)dev->base_addr; 331 addr = etherh_priv(dev)->base;
331 dma_base = etherh_priv(dev)->dma_base; 332 dma_base = etherh_priv(dev)->dma_base;
332 333
333 count = (count + 1) & ~1; 334 count = (count + 1) & ~1;
@@ -387,7 +388,7 @@ etherh_block_input (struct net_device *dev, int count, struct sk_buff *skb, int
387 388
388 ei_local->dmaing = 1; 389 ei_local->dmaing = 1;
389 390
390 addr = (void *)dev->base_addr; 391 addr = etherh_priv(dev)->base;
391 dma_base = etherh_priv(dev)->dma_base; 392 dma_base = etherh_priv(dev)->dma_base;
392 393
393 buf = skb->data; 394 buf = skb->data;
@@ -427,7 +428,7 @@ etherh_get_header (struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_p
427 428
428 ei_local->dmaing = 1; 429 ei_local->dmaing = 1;
429 430
430 addr = (void *)dev->base_addr; 431 addr = etherh_priv(dev)->base;
431 dma_base = etherh_priv(dev)->dma_base; 432 dma_base = etherh_priv(dev)->dma_base;
432 433
433 writeb (E8390_NODMA | E8390_PAGE0 | E8390_START, addr + E8390_CMD); 434 writeb (E8390_NODMA | E8390_PAGE0 | E8390_START, addr + E8390_CMD);
@@ -696,7 +697,8 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
696 eh->ctrl_port = eh->ioc_fast; 697 eh->ctrl_port = eh->ioc_fast;
697 } 698 }
698 699
699 dev->base_addr = (unsigned long)eh->memc + data->ns8390_offset; 700 eh->base = eh->memc + data->ns8390_offset;
701 dev->base_addr = (unsigned long)eh->base;
700 eh->dma_base = eh->memc + data->dataport_offset; 702 eh->dma_base = eh->memc + data->dataport_offset;
701 eh->ctrl_port += data->ctrlport_offset; 703 eh->ctrl_port += data->ctrlport_offset;
702 704
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 5a2efd343db4..c82b9cd1c924 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -1681,10 +1681,6 @@ static int au1000_init(struct net_device *dev)
1681 control |= MAC_FULL_DUPLEX; 1681 control |= MAC_FULL_DUPLEX;
1682 } 1682 }
1683 1683
1684 /* fix for startup without cable */
1685 if (!link)
1686 dev->flags &= ~IFF_RUNNING;
1687
1688 aup->mac->control = control; 1684 aup->mac->control = control;
1689 aup->mac->vlan1_tag = 0x8100; /* activate vlan support */ 1685 aup->mac->vlan1_tag = 0x8100; /* activate vlan support */
1690 au_sync(); 1686 au_sync();
@@ -1709,16 +1705,14 @@ static void au1000_timer(unsigned long data)
1709 if_port = dev->if_port; 1705 if_port = dev->if_port;
1710 if (aup->phy_ops->phy_status(dev, aup->phy_addr, &link, &speed) == 0) { 1706 if (aup->phy_ops->phy_status(dev, aup->phy_addr, &link, &speed) == 0) {
1711 if (link) { 1707 if (link) {
1712 if (!(dev->flags & IFF_RUNNING)) { 1708 if (!netif_carrier_ok(dev)) {
1713 netif_carrier_on(dev); 1709 netif_carrier_on(dev);
1714 dev->flags |= IFF_RUNNING;
1715 printk(KERN_INFO "%s: link up\n", dev->name); 1710 printk(KERN_INFO "%s: link up\n", dev->name);
1716 } 1711 }
1717 } 1712 }
1718 else { 1713 else {
1719 if (dev->flags & IFF_RUNNING) { 1714 if (netif_carrier_ok(dev)) {
1720 netif_carrier_off(dev); 1715 netif_carrier_off(dev);
1721 dev->flags &= ~IFF_RUNNING;
1722 dev->if_port = 0; 1716 dev->if_port = 0;
1723 printk(KERN_INFO "%s: link down\n", dev->name); 1717 printk(KERN_INFO "%s: link down\n", dev->name);
1724 } 1718 }
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c
index 734bd4ee3f9b..00e5257b176f 100644
--- a/drivers/net/bmac.c
+++ b/drivers/net/bmac.c
@@ -1412,7 +1412,6 @@ static int bmac_open(struct net_device *dev)
1412 bp->opened = 1; 1412 bp->opened = 1;
1413 bmac_reset_and_enable(dev); 1413 bmac_reset_and_enable(dev);
1414 enable_irq(dev->irq); 1414 enable_irq(dev->irq);
1415 dev->flags |= IFF_RUNNING;
1416 return 0; 1415 return 0;
1417} 1416}
1418 1417
@@ -1425,7 +1424,6 @@ static int bmac_close(struct net_device *dev)
1425 int i; 1424 int i;
1426 1425
1427 bp->sleeping = 1; 1426 bp->sleeping = 1;
1428 dev->flags &= ~(IFF_UP | IFF_RUNNING);
1429 1427
1430 /* disable rx and tx */ 1428 /* disable rx and tx */
1431 config = bmread(dev, RXCFG); 1429 config = bmread(dev, RXCFG);
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
new file mode 100644
index 000000000000..8acc655ec1e8
--- /dev/null
+++ b/drivers/net/bnx2.c
@@ -0,0 +1,5530 @@
1/* bnx2.c: Broadcom NX2 network driver.
2 *
3 * Copyright (c) 2004, 2005 Broadcom Corporation
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation.
8 *
9 * Written by: Michael Chan (mchan@broadcom.com)
10 */
11
12#include "bnx2.h"
13#include "bnx2_fw.h"
14
15#define DRV_MODULE_NAME "bnx2"
16#define PFX DRV_MODULE_NAME ": "
17#define DRV_MODULE_VERSION "1.2.19"
18#define DRV_MODULE_RELDATE "May 23, 2005"
19
20#define RUN_AT(x) (jiffies + (x))
21
22/* Time in jiffies before concluding the transmitter is hung. */
23#define TX_TIMEOUT (5*HZ)
24
25static char version[] __devinitdata =
26 "Broadcom NetXtreme II Gigabit Ethernet Driver " DRV_MODULE_NAME " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
27
28MODULE_AUTHOR("Michael Chan <mchan@broadcom.com>");
29MODULE_DESCRIPTION("Broadcom NetXtreme II BCM5706 Driver");
30MODULE_LICENSE("GPL");
31MODULE_VERSION(DRV_MODULE_VERSION);
32
33static int disable_msi = 0;
34
35module_param(disable_msi, int, 0);
36MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
37
38typedef enum {
39 BCM5706 = 0,
40 NC370T,
41 NC370I,
42 BCM5706S,
43 NC370F,
44} board_t;
45
46/* indexed by board_t, above */
47static struct {
48 char *name;
49} board_info[] __devinitdata = {
50 { "Broadcom NetXtreme II BCM5706 1000Base-T" },
51 { "HP NC370T Multifunction Gigabit Server Adapter" },
52 { "HP NC370i Multifunction Gigabit Server Adapter" },
53 { "Broadcom NetXtreme II BCM5706 1000Base-SX" },
54 { "HP NC370F Multifunction Gigabit Server Adapter" },
55 { 0 },
56 };
57
58static struct pci_device_id bnx2_pci_tbl[] = {
59 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_5706,
60 PCI_VENDOR_ID_HP, 0x3101, 0, 0, NC370T },
61 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_5706,
62 PCI_VENDOR_ID_HP, 0x3106, 0, 0, NC370I },
63 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_5706,
64 PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5706 },
65 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_5706S,
66 PCI_VENDOR_ID_HP, 0x3102, 0, 0, NC370F },
67 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_5706S,
68 PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM5706S },
69 { 0, }
70};
71
72static struct flash_spec flash_table[] =
73{
74 /* Slow EEPROM */
75 {0x00000000, 0x40030380, 0x009f0081, 0xa184a053, 0xaf000400,
76 1, SEEPROM_PAGE_BITS, SEEPROM_PAGE_SIZE,
77 SEEPROM_BYTE_ADDR_MASK, SEEPROM_TOTAL_SIZE,
78 "EEPROM - slow"},
79 /* Fast EEPROM */
80 {0x02000000, 0x62008380, 0x009f0081, 0xa184a053, 0xaf000400,
81 1, SEEPROM_PAGE_BITS, SEEPROM_PAGE_SIZE,
82 SEEPROM_BYTE_ADDR_MASK, SEEPROM_TOTAL_SIZE,
83 "EEPROM - fast"},
84 /* ATMEL AT45DB011B (buffered flash) */
85 {0x02000003, 0x6e008173, 0x00570081, 0x68848353, 0xaf000400,
86 1, BUFFERED_FLASH_PAGE_BITS, BUFFERED_FLASH_PAGE_SIZE,
87 BUFFERED_FLASH_BYTE_ADDR_MASK, BUFFERED_FLASH_TOTAL_SIZE,
88 "Buffered flash"},
89 /* Saifun SA25F005 (non-buffered flash) */
90 /* strap, cfg1, & write1 need updates */
91 {0x01000003, 0x5f008081, 0x00050081, 0x03840253, 0xaf020406,
92 0, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE,
93 SAIFUN_FLASH_BYTE_ADDR_MASK, SAIFUN_FLASH_BASE_TOTAL_SIZE,
94 "Non-buffered flash (64kB)"},
95 /* Saifun SA25F010 (non-buffered flash) */
96 /* strap, cfg1, & write1 need updates */
97 {0x00000001, 0x47008081, 0x00050081, 0x03840253, 0xaf020406,
98 0, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE,
99 SAIFUN_FLASH_BYTE_ADDR_MASK, SAIFUN_FLASH_BASE_TOTAL_SIZE*2,
100 "Non-buffered flash (128kB)"},
101 /* Saifun SA25F020 (non-buffered flash) */
102 /* strap, cfg1, & write1 need updates */
103 {0x00000003, 0x4f008081, 0x00050081, 0x03840253, 0xaf020406,
104 0, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE,
105 SAIFUN_FLASH_BYTE_ADDR_MASK, SAIFUN_FLASH_BASE_TOTAL_SIZE*4,
106 "Non-buffered flash (256kB)"},
107};
108
109MODULE_DEVICE_TABLE(pci, bnx2_pci_tbl);
110
111static u32
112bnx2_reg_rd_ind(struct bnx2 *bp, u32 offset)
113{
114 REG_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, offset);
115 return (REG_RD(bp, BNX2_PCICFG_REG_WINDOW));
116}
117
118static void
119bnx2_reg_wr_ind(struct bnx2 *bp, u32 offset, u32 val)
120{
121 REG_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, offset);
122 REG_WR(bp, BNX2_PCICFG_REG_WINDOW, val);
123}
124
125static void
126bnx2_ctx_wr(struct bnx2 *bp, u32 cid_addr, u32 offset, u32 val)
127{
128 offset += cid_addr;
129 REG_WR(bp, BNX2_CTX_DATA_ADR, offset);
130 REG_WR(bp, BNX2_CTX_DATA, val);
131}
132
133static int
134bnx2_read_phy(struct bnx2 *bp, u32 reg, u32 *val)
135{
136 u32 val1;
137 int i, ret;
138
139 if (bp->phy_flags & PHY_INT_MODE_AUTO_POLLING_FLAG) {
140 val1 = REG_RD(bp, BNX2_EMAC_MDIO_MODE);
141 val1 &= ~BNX2_EMAC_MDIO_MODE_AUTO_POLL;
142
143 REG_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
144 REG_RD(bp, BNX2_EMAC_MDIO_MODE);
145
146 udelay(40);
147 }
148
149 val1 = (bp->phy_addr << 21) | (reg << 16) |
150 BNX2_EMAC_MDIO_COMM_COMMAND_READ | BNX2_EMAC_MDIO_COMM_DISEXT |
151 BNX2_EMAC_MDIO_COMM_START_BUSY;
152 REG_WR(bp, BNX2_EMAC_MDIO_COMM, val1);
153
154 for (i = 0; i < 50; i++) {
155 udelay(10);
156
157 val1 = REG_RD(bp, BNX2_EMAC_MDIO_COMM);
158 if (!(val1 & BNX2_EMAC_MDIO_COMM_START_BUSY)) {
159 udelay(5);
160
161 val1 = REG_RD(bp, BNX2_EMAC_MDIO_COMM);
162 val1 &= BNX2_EMAC_MDIO_COMM_DATA;
163
164 break;
165 }
166 }
167
168 if (val1 & BNX2_EMAC_MDIO_COMM_START_BUSY) {
169 *val = 0x0;
170 ret = -EBUSY;
171 }
172 else {
173 *val = val1;
174 ret = 0;
175 }
176
177 if (bp->phy_flags & PHY_INT_MODE_AUTO_POLLING_FLAG) {
178 val1 = REG_RD(bp, BNX2_EMAC_MDIO_MODE);
179 val1 |= BNX2_EMAC_MDIO_MODE_AUTO_POLL;
180
181 REG_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
182 REG_RD(bp, BNX2_EMAC_MDIO_MODE);
183
184 udelay(40);
185 }
186
187 return ret;
188}
189
190static int
191bnx2_write_phy(struct bnx2 *bp, u32 reg, u32 val)
192{
193 u32 val1;
194 int i, ret;
195
196 if (bp->phy_flags & PHY_INT_MODE_AUTO_POLLING_FLAG) {
197 val1 = REG_RD(bp, BNX2_EMAC_MDIO_MODE);
198 val1 &= ~BNX2_EMAC_MDIO_MODE_AUTO_POLL;
199
200 REG_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
201 REG_RD(bp, BNX2_EMAC_MDIO_MODE);
202
203 udelay(40);
204 }
205
206 val1 = (bp->phy_addr << 21) | (reg << 16) | val |
207 BNX2_EMAC_MDIO_COMM_COMMAND_WRITE |
208 BNX2_EMAC_MDIO_COMM_START_BUSY | BNX2_EMAC_MDIO_COMM_DISEXT;
209 REG_WR(bp, BNX2_EMAC_MDIO_COMM, val1);
210
211 for (i = 0; i < 50; i++) {
212 udelay(10);
213
214 val1 = REG_RD(bp, BNX2_EMAC_MDIO_COMM);
215 if (!(val1 & BNX2_EMAC_MDIO_COMM_START_BUSY)) {
216 udelay(5);
217 break;
218 }
219 }
220
221 if (val1 & BNX2_EMAC_MDIO_COMM_START_BUSY)
222 ret = -EBUSY;
223 else
224 ret = 0;
225
226 if (bp->phy_flags & PHY_INT_MODE_AUTO_POLLING_FLAG) {
227 val1 = REG_RD(bp, BNX2_EMAC_MDIO_MODE);
228 val1 |= BNX2_EMAC_MDIO_MODE_AUTO_POLL;
229
230 REG_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
231 REG_RD(bp, BNX2_EMAC_MDIO_MODE);
232
233 udelay(40);
234 }
235
236 return ret;
237}
238
239static void
240bnx2_disable_int(struct bnx2 *bp)
241{
242 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
243 BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
244 REG_RD(bp, BNX2_PCICFG_INT_ACK_CMD);
245}
246
247static void
248bnx2_enable_int(struct bnx2 *bp)
249{
250 u32 val;
251
252 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
253 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | bp->last_status_idx);
254
255 val = REG_RD(bp, BNX2_HC_COMMAND);
256 REG_WR(bp, BNX2_HC_COMMAND, val | BNX2_HC_COMMAND_COAL_NOW);
257}
258
259static void
260bnx2_disable_int_sync(struct bnx2 *bp)
261{
262 atomic_inc(&bp->intr_sem);
263 bnx2_disable_int(bp);
264 synchronize_irq(bp->pdev->irq);
265}
266
267static void
268bnx2_netif_stop(struct bnx2 *bp)
269{
270 bnx2_disable_int_sync(bp);
271 if (netif_running(bp->dev)) {
272 netif_poll_disable(bp->dev);
273 netif_tx_disable(bp->dev);
274 bp->dev->trans_start = jiffies; /* prevent tx timeout */
275 }
276}
277
278static void
279bnx2_netif_start(struct bnx2 *bp)
280{
281 if (atomic_dec_and_test(&bp->intr_sem)) {
282 if (netif_running(bp->dev)) {
283 netif_wake_queue(bp->dev);
284 netif_poll_enable(bp->dev);
285 bnx2_enable_int(bp);
286 }
287 }
288}
289
290static void
291bnx2_free_mem(struct bnx2 *bp)
292{
293 if (bp->stats_blk) {
294 pci_free_consistent(bp->pdev, sizeof(struct statistics_block),
295 bp->stats_blk, bp->stats_blk_mapping);
296 bp->stats_blk = NULL;
297 }
298 if (bp->status_blk) {
299 pci_free_consistent(bp->pdev, sizeof(struct status_block),
300 bp->status_blk, bp->status_blk_mapping);
301 bp->status_blk = NULL;
302 }
303 if (bp->tx_desc_ring) {
304 pci_free_consistent(bp->pdev,
305 sizeof(struct tx_bd) * TX_DESC_CNT,
306 bp->tx_desc_ring, bp->tx_desc_mapping);
307 bp->tx_desc_ring = NULL;
308 }
309 if (bp->tx_buf_ring) {
310 kfree(bp->tx_buf_ring);
311 bp->tx_buf_ring = NULL;
312 }
313 if (bp->rx_desc_ring) {
314 pci_free_consistent(bp->pdev,
315 sizeof(struct rx_bd) * RX_DESC_CNT,
316 bp->rx_desc_ring, bp->rx_desc_mapping);
317 bp->rx_desc_ring = NULL;
318 }
319 if (bp->rx_buf_ring) {
320 kfree(bp->rx_buf_ring);
321 bp->rx_buf_ring = NULL;
322 }
323}
324
325static int
326bnx2_alloc_mem(struct bnx2 *bp)
327{
328 bp->tx_buf_ring = kmalloc(sizeof(struct sw_bd) * TX_DESC_CNT,
329 GFP_KERNEL);
330 if (bp->tx_buf_ring == NULL)
331 return -ENOMEM;
332
333 memset(bp->tx_buf_ring, 0, sizeof(struct sw_bd) * TX_DESC_CNT);
334 bp->tx_desc_ring = pci_alloc_consistent(bp->pdev,
335 sizeof(struct tx_bd) *
336 TX_DESC_CNT,
337 &bp->tx_desc_mapping);
338 if (bp->tx_desc_ring == NULL)
339 goto alloc_mem_err;
340
341 bp->rx_buf_ring = kmalloc(sizeof(struct sw_bd) * RX_DESC_CNT,
342 GFP_KERNEL);
343 if (bp->rx_buf_ring == NULL)
344 goto alloc_mem_err;
345
346 memset(bp->rx_buf_ring, 0, sizeof(struct sw_bd) * RX_DESC_CNT);
347 bp->rx_desc_ring = pci_alloc_consistent(bp->pdev,
348 sizeof(struct rx_bd) *
349 RX_DESC_CNT,
350 &bp->rx_desc_mapping);
351 if (bp->rx_desc_ring == NULL)
352 goto alloc_mem_err;
353
354 bp->status_blk = pci_alloc_consistent(bp->pdev,
355 sizeof(struct status_block),
356 &bp->status_blk_mapping);
357 if (bp->status_blk == NULL)
358 goto alloc_mem_err;
359
360 memset(bp->status_blk, 0, sizeof(struct status_block));
361
362 bp->stats_blk = pci_alloc_consistent(bp->pdev,
363 sizeof(struct statistics_block),
364 &bp->stats_blk_mapping);
365 if (bp->stats_blk == NULL)
366 goto alloc_mem_err;
367
368 memset(bp->stats_blk, 0, sizeof(struct statistics_block));
369
370 return 0;
371
372alloc_mem_err:
373 bnx2_free_mem(bp);
374 return -ENOMEM;
375}
376
377static void
378bnx2_report_link(struct bnx2 *bp)
379{
380 if (bp->link_up) {
381 netif_carrier_on(bp->dev);
382 printk(KERN_INFO PFX "%s NIC Link is Up, ", bp->dev->name);
383
384 printk("%d Mbps ", bp->line_speed);
385
386 if (bp->duplex == DUPLEX_FULL)
387 printk("full duplex");
388 else
389 printk("half duplex");
390
391 if (bp->flow_ctrl) {
392 if (bp->flow_ctrl & FLOW_CTRL_RX) {
393 printk(", receive ");
394 if (bp->flow_ctrl & FLOW_CTRL_TX)
395 printk("& transmit ");
396 }
397 else {
398 printk(", transmit ");
399 }
400 printk("flow control ON");
401 }
402 printk("\n");
403 }
404 else {
405 netif_carrier_off(bp->dev);
406 printk(KERN_ERR PFX "%s NIC Link is Down\n", bp->dev->name);
407 }
408}
409
410static void
411bnx2_resolve_flow_ctrl(struct bnx2 *bp)
412{
413 u32 local_adv, remote_adv;
414
415 bp->flow_ctrl = 0;
416 if ((bp->autoneg & (AUTONEG_SPEED | AUTONEG_FLOW_CTRL)) !=
417 (AUTONEG_SPEED | AUTONEG_FLOW_CTRL)) {
418
419 if (bp->duplex == DUPLEX_FULL) {
420 bp->flow_ctrl = bp->req_flow_ctrl;
421 }
422 return;
423 }
424
425 if (bp->duplex != DUPLEX_FULL) {
426 return;
427 }
428
429 bnx2_read_phy(bp, MII_ADVERTISE, &local_adv);
430 bnx2_read_phy(bp, MII_LPA, &remote_adv);
431
432 if (bp->phy_flags & PHY_SERDES_FLAG) {
433 u32 new_local_adv = 0;
434 u32 new_remote_adv = 0;
435
436 if (local_adv & ADVERTISE_1000XPAUSE)
437 new_local_adv |= ADVERTISE_PAUSE_CAP;
438 if (local_adv & ADVERTISE_1000XPSE_ASYM)
439 new_local_adv |= ADVERTISE_PAUSE_ASYM;
440 if (remote_adv & ADVERTISE_1000XPAUSE)
441 new_remote_adv |= ADVERTISE_PAUSE_CAP;
442 if (remote_adv & ADVERTISE_1000XPSE_ASYM)
443 new_remote_adv |= ADVERTISE_PAUSE_ASYM;
444
445 local_adv = new_local_adv;
446 remote_adv = new_remote_adv;
447 }
448
449 /* See Table 28B-3 of 802.3ab-1999 spec. */
450 if (local_adv & ADVERTISE_PAUSE_CAP) {
451 if(local_adv & ADVERTISE_PAUSE_ASYM) {
452 if (remote_adv & ADVERTISE_PAUSE_CAP) {
453 bp->flow_ctrl = FLOW_CTRL_TX | FLOW_CTRL_RX;
454 }
455 else if (remote_adv & ADVERTISE_PAUSE_ASYM) {
456 bp->flow_ctrl = FLOW_CTRL_RX;
457 }
458 }
459 else {
460 if (remote_adv & ADVERTISE_PAUSE_CAP) {
461 bp->flow_ctrl = FLOW_CTRL_TX | FLOW_CTRL_RX;
462 }
463 }
464 }
465 else if (local_adv & ADVERTISE_PAUSE_ASYM) {
466 if ((remote_adv & ADVERTISE_PAUSE_CAP) &&
467 (remote_adv & ADVERTISE_PAUSE_ASYM)) {
468
469 bp->flow_ctrl = FLOW_CTRL_TX;
470 }
471 }
472}
473
474static int
475bnx2_serdes_linkup(struct bnx2 *bp)
476{
477 u32 bmcr, local_adv, remote_adv, common;
478
479 bp->link_up = 1;
480 bp->line_speed = SPEED_1000;
481
482 bnx2_read_phy(bp, MII_BMCR, &bmcr);
483 if (bmcr & BMCR_FULLDPLX) {
484 bp->duplex = DUPLEX_FULL;
485 }
486 else {
487 bp->duplex = DUPLEX_HALF;
488 }
489
490 if (!(bmcr & BMCR_ANENABLE)) {
491 return 0;
492 }
493
494 bnx2_read_phy(bp, MII_ADVERTISE, &local_adv);
495 bnx2_read_phy(bp, MII_LPA, &remote_adv);
496
497 common = local_adv & remote_adv;
498 if (common & (ADVERTISE_1000XHALF | ADVERTISE_1000XFULL)) {
499
500 if (common & ADVERTISE_1000XFULL) {
501 bp->duplex = DUPLEX_FULL;
502 }
503 else {
504 bp->duplex = DUPLEX_HALF;
505 }
506 }
507
508 return 0;
509}
510
511static int
512bnx2_copper_linkup(struct bnx2 *bp)
513{
514 u32 bmcr;
515
516 bnx2_read_phy(bp, MII_BMCR, &bmcr);
517 if (bmcr & BMCR_ANENABLE) {
518 u32 local_adv, remote_adv, common;
519
520 bnx2_read_phy(bp, MII_CTRL1000, &local_adv);
521 bnx2_read_phy(bp, MII_STAT1000, &remote_adv);
522
523 common = local_adv & (remote_adv >> 2);
524 if (common & ADVERTISE_1000FULL) {
525 bp->line_speed = SPEED_1000;
526 bp->duplex = DUPLEX_FULL;
527 }
528 else if (common & ADVERTISE_1000HALF) {
529 bp->line_speed = SPEED_1000;
530 bp->duplex = DUPLEX_HALF;
531 }
532 else {
533 bnx2_read_phy(bp, MII_ADVERTISE, &local_adv);
534 bnx2_read_phy(bp, MII_LPA, &remote_adv);
535
536 common = local_adv & remote_adv;
537 if (common & ADVERTISE_100FULL) {
538 bp->line_speed = SPEED_100;
539 bp->duplex = DUPLEX_FULL;
540 }
541 else if (common & ADVERTISE_100HALF) {
542 bp->line_speed = SPEED_100;
543 bp->duplex = DUPLEX_HALF;
544 }
545 else if (common & ADVERTISE_10FULL) {
546 bp->line_speed = SPEED_10;
547 bp->duplex = DUPLEX_FULL;
548 }
549 else if (common & ADVERTISE_10HALF) {
550 bp->line_speed = SPEED_10;
551 bp->duplex = DUPLEX_HALF;
552 }
553 else {
554 bp->line_speed = 0;
555 bp->link_up = 0;
556 }
557 }
558 }
559 else {
560 if (bmcr & BMCR_SPEED100) {
561 bp->line_speed = SPEED_100;
562 }
563 else {
564 bp->line_speed = SPEED_10;
565 }
566 if (bmcr & BMCR_FULLDPLX) {
567 bp->duplex = DUPLEX_FULL;
568 }
569 else {
570 bp->duplex = DUPLEX_HALF;
571 }
572 }
573
574 return 0;
575}
576
577static int
578bnx2_set_mac_link(struct bnx2 *bp)
579{
580 u32 val;
581
582 REG_WR(bp, BNX2_EMAC_TX_LENGTHS, 0x2620);
583 if (bp->link_up && (bp->line_speed == SPEED_1000) &&
584 (bp->duplex == DUPLEX_HALF)) {
585 REG_WR(bp, BNX2_EMAC_TX_LENGTHS, 0x26ff);
586 }
587
588 /* Configure the EMAC mode register. */
589 val = REG_RD(bp, BNX2_EMAC_MODE);
590
591 val &= ~(BNX2_EMAC_MODE_PORT | BNX2_EMAC_MODE_HALF_DUPLEX |
592 BNX2_EMAC_MODE_MAC_LOOP | BNX2_EMAC_MODE_FORCE_LINK);
593
594 if (bp->link_up) {
595 if (bp->line_speed != SPEED_1000)
596 val |= BNX2_EMAC_MODE_PORT_MII;
597 else
598 val |= BNX2_EMAC_MODE_PORT_GMII;
599 }
600 else {
601 val |= BNX2_EMAC_MODE_PORT_GMII;
602 }
603
604 /* Set the MAC to operate in the appropriate duplex mode. */
605 if (bp->duplex == DUPLEX_HALF)
606 val |= BNX2_EMAC_MODE_HALF_DUPLEX;
607 REG_WR(bp, BNX2_EMAC_MODE, val);
608
609 /* Enable/disable rx PAUSE. */
610 bp->rx_mode &= ~BNX2_EMAC_RX_MODE_FLOW_EN;
611
612 if (bp->flow_ctrl & FLOW_CTRL_RX)
613 bp->rx_mode |= BNX2_EMAC_RX_MODE_FLOW_EN;
614 REG_WR(bp, BNX2_EMAC_RX_MODE, bp->rx_mode);
615
616 /* Enable/disable tx PAUSE. */
617 val = REG_RD(bp, BNX2_EMAC_TX_MODE);
618 val &= ~BNX2_EMAC_TX_MODE_FLOW_EN;
619
620 if (bp->flow_ctrl & FLOW_CTRL_TX)
621 val |= BNX2_EMAC_TX_MODE_FLOW_EN;
622 REG_WR(bp, BNX2_EMAC_TX_MODE, val);
623
624 /* Acknowledge the interrupt. */
625 REG_WR(bp, BNX2_EMAC_STATUS, BNX2_EMAC_STATUS_LINK_CHANGE);
626
627 return 0;
628}
629
630static int
631bnx2_set_link(struct bnx2 *bp)
632{
633 u32 bmsr;
634 u8 link_up;
635
636 if (bp->loopback == MAC_LOOPBACK) {
637 bp->link_up = 1;
638 return 0;
639 }
640
641 link_up = bp->link_up;
642
643 bnx2_read_phy(bp, MII_BMSR, &bmsr);
644 bnx2_read_phy(bp, MII_BMSR, &bmsr);
645
646 if ((bp->phy_flags & PHY_SERDES_FLAG) &&
647 (CHIP_NUM(bp) == CHIP_NUM_5706)) {
648 u32 val;
649
650 val = REG_RD(bp, BNX2_EMAC_STATUS);
651 if (val & BNX2_EMAC_STATUS_LINK)
652 bmsr |= BMSR_LSTATUS;
653 else
654 bmsr &= ~BMSR_LSTATUS;
655 }
656
657 if (bmsr & BMSR_LSTATUS) {
658 bp->link_up = 1;
659
660 if (bp->phy_flags & PHY_SERDES_FLAG) {
661 bnx2_serdes_linkup(bp);
662 }
663 else {
664 bnx2_copper_linkup(bp);
665 }
666 bnx2_resolve_flow_ctrl(bp);
667 }
668 else {
669 if ((bp->phy_flags & PHY_SERDES_FLAG) &&
670 (bp->autoneg & AUTONEG_SPEED)) {
671
672 u32 bmcr;
673
674 bnx2_read_phy(bp, MII_BMCR, &bmcr);
675 if (!(bmcr & BMCR_ANENABLE)) {
676 bnx2_write_phy(bp, MII_BMCR, bmcr |
677 BMCR_ANENABLE);
678 }
679 }
680 bp->phy_flags &= ~PHY_PARALLEL_DETECT_FLAG;
681 bp->link_up = 0;
682 }
683
684 if (bp->link_up != link_up) {
685 bnx2_report_link(bp);
686 }
687
688 bnx2_set_mac_link(bp);
689
690 return 0;
691}
692
693static int
694bnx2_reset_phy(struct bnx2 *bp)
695{
696 int i;
697 u32 reg;
698
699 bnx2_write_phy(bp, MII_BMCR, BMCR_RESET);
700
701#define PHY_RESET_MAX_WAIT 100
702 for (i = 0; i < PHY_RESET_MAX_WAIT; i++) {
703 udelay(10);
704
705 bnx2_read_phy(bp, MII_BMCR, &reg);
706 if (!(reg & BMCR_RESET)) {
707 udelay(20);
708 break;
709 }
710 }
711 if (i == PHY_RESET_MAX_WAIT) {
712 return -EBUSY;
713 }
714 return 0;
715}
716
717static u32
718bnx2_phy_get_pause_adv(struct bnx2 *bp)
719{
720 u32 adv = 0;
721
722 if ((bp->req_flow_ctrl & (FLOW_CTRL_RX | FLOW_CTRL_TX)) ==
723 (FLOW_CTRL_RX | FLOW_CTRL_TX)) {
724
725 if (bp->phy_flags & PHY_SERDES_FLAG) {
726 adv = ADVERTISE_1000XPAUSE;
727 }
728 else {
729 adv = ADVERTISE_PAUSE_CAP;
730 }
731 }
732 else if (bp->req_flow_ctrl & FLOW_CTRL_TX) {
733 if (bp->phy_flags & PHY_SERDES_FLAG) {
734 adv = ADVERTISE_1000XPSE_ASYM;
735 }
736 else {
737 adv = ADVERTISE_PAUSE_ASYM;
738 }
739 }
740 else if (bp->req_flow_ctrl & FLOW_CTRL_RX) {
741 if (bp->phy_flags & PHY_SERDES_FLAG) {
742 adv = ADVERTISE_1000XPAUSE | ADVERTISE_1000XPSE_ASYM;
743 }
744 else {
745 adv = ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
746 }
747 }
748 return adv;
749}
750
751static int
752bnx2_setup_serdes_phy(struct bnx2 *bp)
753{
754 u32 adv, bmcr;
755 u32 new_adv = 0;
756
757 if (!(bp->autoneg & AUTONEG_SPEED)) {
758 u32 new_bmcr;
759
760 bnx2_read_phy(bp, MII_BMCR, &bmcr);
761 new_bmcr = bmcr & ~BMCR_ANENABLE;
762 new_bmcr |= BMCR_SPEED1000;
763 if (bp->req_duplex == DUPLEX_FULL) {
764 new_bmcr |= BMCR_FULLDPLX;
765 }
766 else {
767 new_bmcr &= ~BMCR_FULLDPLX;
768 }
769 if (new_bmcr != bmcr) {
770 /* Force a link down visible on the other side */
771 if (bp->link_up) {
772 bnx2_read_phy(bp, MII_ADVERTISE, &adv);
773 adv &= ~(ADVERTISE_1000XFULL |
774 ADVERTISE_1000XHALF);
775 bnx2_write_phy(bp, MII_ADVERTISE, adv);
776 bnx2_write_phy(bp, MII_BMCR, bmcr |
777 BMCR_ANRESTART | BMCR_ANENABLE);
778
779 bp->link_up = 0;
780 netif_carrier_off(bp->dev);
781 }
782 bnx2_write_phy(bp, MII_BMCR, new_bmcr);
783 }
784 return 0;
785 }
786
787 if (bp->advertising & ADVERTISED_1000baseT_Full)
788 new_adv |= ADVERTISE_1000XFULL;
789
790 new_adv |= bnx2_phy_get_pause_adv(bp);
791
792 bnx2_read_phy(bp, MII_ADVERTISE, &adv);
793 bnx2_read_phy(bp, MII_BMCR, &bmcr);
794
795 bp->serdes_an_pending = 0;
796 if ((adv != new_adv) || ((bmcr & BMCR_ANENABLE) == 0)) {
797 /* Force a link down visible on the other side */
798 if (bp->link_up) {
799 int i;
800
801 bnx2_write_phy(bp, MII_BMCR, BMCR_LOOPBACK);
802 for (i = 0; i < 110; i++) {
803 udelay(100);
804 }
805 }
806
807 bnx2_write_phy(bp, MII_ADVERTISE, new_adv);
808 bnx2_write_phy(bp, MII_BMCR, bmcr | BMCR_ANRESTART |
809 BMCR_ANENABLE);
810 bp->serdes_an_pending = SERDES_AN_TIMEOUT / bp->timer_interval;
811 }
812
813 return 0;
814}
815
816#define ETHTOOL_ALL_FIBRE_SPEED \
817 (ADVERTISED_1000baseT_Full)
818
819#define ETHTOOL_ALL_COPPER_SPEED \
820 (ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full | \
821 ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full | \
822 ADVERTISED_1000baseT_Full)
823
824#define PHY_ALL_10_100_SPEED (ADVERTISE_10HALF | ADVERTISE_10FULL | \
825 ADVERTISE_100HALF | ADVERTISE_100FULL | ADVERTISE_CSMA)
826
827#define PHY_ALL_1000_SPEED (ADVERTISE_1000HALF | ADVERTISE_1000FULL)
828
829static int
830bnx2_setup_copper_phy(struct bnx2 *bp)
831{
832 u32 bmcr;
833 u32 new_bmcr;
834
835 bnx2_read_phy(bp, MII_BMCR, &bmcr);
836
837 if (bp->autoneg & AUTONEG_SPEED) {
838 u32 adv_reg, adv1000_reg;
839 u32 new_adv_reg = 0;
840 u32 new_adv1000_reg = 0;
841
842 bnx2_read_phy(bp, MII_ADVERTISE, &adv_reg);
843 adv_reg &= (PHY_ALL_10_100_SPEED | ADVERTISE_PAUSE_CAP |
844 ADVERTISE_PAUSE_ASYM);
845
846 bnx2_read_phy(bp, MII_CTRL1000, &adv1000_reg);
847 adv1000_reg &= PHY_ALL_1000_SPEED;
848
849 if (bp->advertising & ADVERTISED_10baseT_Half)
850 new_adv_reg |= ADVERTISE_10HALF;
851 if (bp->advertising & ADVERTISED_10baseT_Full)
852 new_adv_reg |= ADVERTISE_10FULL;
853 if (bp->advertising & ADVERTISED_100baseT_Half)
854 new_adv_reg |= ADVERTISE_100HALF;
855 if (bp->advertising & ADVERTISED_100baseT_Full)
856 new_adv_reg |= ADVERTISE_100FULL;
857 if (bp->advertising & ADVERTISED_1000baseT_Full)
858 new_adv1000_reg |= ADVERTISE_1000FULL;
859
860 new_adv_reg |= ADVERTISE_CSMA;
861
862 new_adv_reg |= bnx2_phy_get_pause_adv(bp);
863
864 if ((adv1000_reg != new_adv1000_reg) ||
865 (adv_reg != new_adv_reg) ||
866 ((bmcr & BMCR_ANENABLE) == 0)) {
867
868 bnx2_write_phy(bp, MII_ADVERTISE, new_adv_reg);
869 bnx2_write_phy(bp, MII_CTRL1000, new_adv1000_reg);
870 bnx2_write_phy(bp, MII_BMCR, BMCR_ANRESTART |
871 BMCR_ANENABLE);
872 }
873 else if (bp->link_up) {
874 /* Flow ctrl may have changed from auto to forced */
875 /* or vice-versa. */
876
877 bnx2_resolve_flow_ctrl(bp);
878 bnx2_set_mac_link(bp);
879 }
880 return 0;
881 }
882
883 new_bmcr = 0;
884 if (bp->req_line_speed == SPEED_100) {
885 new_bmcr |= BMCR_SPEED100;
886 }
887 if (bp->req_duplex == DUPLEX_FULL) {
888 new_bmcr |= BMCR_FULLDPLX;
889 }
890 if (new_bmcr != bmcr) {
891 u32 bmsr;
892 int i = 0;
893
894 bnx2_read_phy(bp, MII_BMSR, &bmsr);
895 bnx2_read_phy(bp, MII_BMSR, &bmsr);
896
897 if (bmsr & BMSR_LSTATUS) {
898 /* Force link down */
899 bnx2_write_phy(bp, MII_BMCR, BMCR_LOOPBACK);
900 do {
901 udelay(100);
902 bnx2_read_phy(bp, MII_BMSR, &bmsr);
903 bnx2_read_phy(bp, MII_BMSR, &bmsr);
904 i++;
905 } while ((bmsr & BMSR_LSTATUS) && (i < 620));
906 }
907
908 bnx2_write_phy(bp, MII_BMCR, new_bmcr);
909
910 /* Normally, the new speed is setup after the link has
911 * gone down and up again. In some cases, link will not go
912 * down so we need to set up the new speed here.
913 */
914 if (bmsr & BMSR_LSTATUS) {
915 bp->line_speed = bp->req_line_speed;
916 bp->duplex = bp->req_duplex;
917 bnx2_resolve_flow_ctrl(bp);
918 bnx2_set_mac_link(bp);
919 }
920 }
921 return 0;
922}
923
924static int
925bnx2_setup_phy(struct bnx2 *bp)
926{
927 if (bp->loopback == MAC_LOOPBACK)
928 return 0;
929
930 if (bp->phy_flags & PHY_SERDES_FLAG) {
931 return (bnx2_setup_serdes_phy(bp));
932 }
933 else {
934 return (bnx2_setup_copper_phy(bp));
935 }
936}
937
938static int
939bnx2_init_serdes_phy(struct bnx2 *bp)
940{
941 bp->phy_flags &= ~PHY_PARALLEL_DETECT_FLAG;
942
943 if (CHIP_NUM(bp) == CHIP_NUM_5706) {
944 REG_WR(bp, BNX2_MISC_UNUSED0, 0x300);
945 }
946
947 if (bp->dev->mtu > 1500) {
948 u32 val;
949
950 /* Set extended packet length bit */
951 bnx2_write_phy(bp, 0x18, 0x7);
952 bnx2_read_phy(bp, 0x18, &val);
953 bnx2_write_phy(bp, 0x18, (val & 0xfff8) | 0x4000);
954
955 bnx2_write_phy(bp, 0x1c, 0x6c00);
956 bnx2_read_phy(bp, 0x1c, &val);
957 bnx2_write_phy(bp, 0x1c, (val & 0x3ff) | 0xec02);
958 }
959 else {
960 u32 val;
961
962 bnx2_write_phy(bp, 0x18, 0x7);
963 bnx2_read_phy(bp, 0x18, &val);
964 bnx2_write_phy(bp, 0x18, val & ~0x4007);
965
966 bnx2_write_phy(bp, 0x1c, 0x6c00);
967 bnx2_read_phy(bp, 0x1c, &val);
968 bnx2_write_phy(bp, 0x1c, (val & 0x3fd) | 0xec00);
969 }
970
971 return 0;
972}
973
974static int
975bnx2_init_copper_phy(struct bnx2 *bp)
976{
977 bp->phy_flags |= PHY_CRC_FIX_FLAG;
978
979 if (bp->phy_flags & PHY_CRC_FIX_FLAG) {
980 bnx2_write_phy(bp, 0x18, 0x0c00);
981 bnx2_write_phy(bp, 0x17, 0x000a);
982 bnx2_write_phy(bp, 0x15, 0x310b);
983 bnx2_write_phy(bp, 0x17, 0x201f);
984 bnx2_write_phy(bp, 0x15, 0x9506);
985 bnx2_write_phy(bp, 0x17, 0x401f);
986 bnx2_write_phy(bp, 0x15, 0x14e2);
987 bnx2_write_phy(bp, 0x18, 0x0400);
988 }
989
990 if (bp->dev->mtu > 1500) {
991 u32 val;
992
993 /* Set extended packet length bit */
994 bnx2_write_phy(bp, 0x18, 0x7);
995 bnx2_read_phy(bp, 0x18, &val);
996 bnx2_write_phy(bp, 0x18, val | 0x4000);
997
998 bnx2_read_phy(bp, 0x10, &val);
999 bnx2_write_phy(bp, 0x10, val | 0x1);
1000 }
1001 else {
1002 u32 val;
1003
1004 bnx2_write_phy(bp, 0x18, 0x7);
1005 bnx2_read_phy(bp, 0x18, &val);
1006 bnx2_write_phy(bp, 0x18, val & ~0x4007);
1007
1008 bnx2_read_phy(bp, 0x10, &val);
1009 bnx2_write_phy(bp, 0x10, val & ~0x1);
1010 }
1011
1012 return 0;
1013}
1014
1015
1016static int
1017bnx2_init_phy(struct bnx2 *bp)
1018{
1019 u32 val;
1020 int rc = 0;
1021
1022 bp->phy_flags &= ~PHY_INT_MODE_MASK_FLAG;
1023 bp->phy_flags |= PHY_INT_MODE_LINK_READY_FLAG;
1024
1025 REG_WR(bp, BNX2_EMAC_ATTENTION_ENA, BNX2_EMAC_ATTENTION_ENA_LINK);
1026
1027 bnx2_reset_phy(bp);
1028
1029 bnx2_read_phy(bp, MII_PHYSID1, &val);
1030 bp->phy_id = val << 16;
1031 bnx2_read_phy(bp, MII_PHYSID2, &val);
1032 bp->phy_id |= val & 0xffff;
1033
1034 if (bp->phy_flags & PHY_SERDES_FLAG) {
1035 rc = bnx2_init_serdes_phy(bp);
1036 }
1037 else {
1038 rc = bnx2_init_copper_phy(bp);
1039 }
1040
1041 bnx2_setup_phy(bp);
1042
1043 return rc;
1044}
1045
1046static int
1047bnx2_set_mac_loopback(struct bnx2 *bp)
1048{
1049 u32 mac_mode;
1050
1051 mac_mode = REG_RD(bp, BNX2_EMAC_MODE);
1052 mac_mode &= ~BNX2_EMAC_MODE_PORT;
1053 mac_mode |= BNX2_EMAC_MODE_MAC_LOOP | BNX2_EMAC_MODE_FORCE_LINK;
1054 REG_WR(bp, BNX2_EMAC_MODE, mac_mode);
1055 bp->link_up = 1;
1056 return 0;
1057}
1058
1059static int
1060bnx2_fw_sync(struct bnx2 *bp, u32 msg_data)
1061{
1062 int i;
1063 u32 val;
1064
1065 if (bp->fw_timed_out)
1066 return -EBUSY;
1067
1068 bp->fw_wr_seq++;
1069 msg_data |= bp->fw_wr_seq;
1070
1071 REG_WR_IND(bp, HOST_VIEW_SHMEM_BASE + BNX2_DRV_MB, msg_data);
1072
1073 /* wait for an acknowledgement. */
1074 for (i = 0; i < (FW_ACK_TIME_OUT_MS * 1000)/5; i++) {
1075 udelay(5);
1076
1077 val = REG_RD_IND(bp, HOST_VIEW_SHMEM_BASE + BNX2_FW_MB);
1078
1079 if ((val & BNX2_FW_MSG_ACK) == (msg_data & BNX2_DRV_MSG_SEQ))
1080 break;
1081 }
1082
1083 /* If we timed out, inform the firmware that this is the case. */
1084 if (((val & BNX2_FW_MSG_ACK) != (msg_data & BNX2_DRV_MSG_SEQ)) &&
1085 ((msg_data & BNX2_DRV_MSG_DATA) != BNX2_DRV_MSG_DATA_WAIT0)) {
1086
1087 msg_data &= ~BNX2_DRV_MSG_CODE;
1088 msg_data |= BNX2_DRV_MSG_CODE_FW_TIMEOUT;
1089
1090 REG_WR_IND(bp, HOST_VIEW_SHMEM_BASE + BNX2_DRV_MB, msg_data);
1091
1092 bp->fw_timed_out = 1;
1093
1094 return -EBUSY;
1095 }
1096
1097 return 0;
1098}
1099
1100static void
1101bnx2_init_context(struct bnx2 *bp)
1102{
1103 u32 vcid;
1104
1105 vcid = 96;
1106 while (vcid) {
1107 u32 vcid_addr, pcid_addr, offset;
1108
1109 vcid--;
1110
1111 if (CHIP_ID(bp) == CHIP_ID_5706_A0) {
1112 u32 new_vcid;
1113
1114 vcid_addr = GET_PCID_ADDR(vcid);
1115 if (vcid & 0x8) {
1116 new_vcid = 0x60 + (vcid & 0xf0) + (vcid & 0x7);
1117 }
1118 else {
1119 new_vcid = vcid;
1120 }
1121 pcid_addr = GET_PCID_ADDR(new_vcid);
1122 }
1123 else {
1124 vcid_addr = GET_CID_ADDR(vcid);
1125 pcid_addr = vcid_addr;
1126 }
1127
1128 REG_WR(bp, BNX2_CTX_VIRT_ADDR, 0x00);
1129 REG_WR(bp, BNX2_CTX_PAGE_TBL, pcid_addr);
1130
1131 /* Zero out the context. */
1132 for (offset = 0; offset < PHY_CTX_SIZE; offset += 4) {
1133 CTX_WR(bp, 0x00, offset, 0);
1134 }
1135
1136 REG_WR(bp, BNX2_CTX_VIRT_ADDR, vcid_addr);
1137 REG_WR(bp, BNX2_CTX_PAGE_TBL, pcid_addr);
1138 }
1139}
1140
1141static int
1142bnx2_alloc_bad_rbuf(struct bnx2 *bp)
1143{
1144 u16 *good_mbuf;
1145 u32 good_mbuf_cnt;
1146 u32 val;
1147
1148 good_mbuf = kmalloc(512 * sizeof(u16), GFP_KERNEL);
1149 if (good_mbuf == NULL) {
1150 printk(KERN_ERR PFX "Failed to allocate memory in "
1151 "bnx2_alloc_bad_rbuf\n");
1152 return -ENOMEM;
1153 }
1154
1155 REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
1156 BNX2_MISC_ENABLE_SET_BITS_RX_MBUF_ENABLE);
1157
1158 good_mbuf_cnt = 0;
1159
1160 /* Allocate a bunch of mbufs and save the good ones in an array. */
1161 val = REG_RD_IND(bp, BNX2_RBUF_STATUS1);
1162 while (val & BNX2_RBUF_STATUS1_FREE_COUNT) {
1163 REG_WR_IND(bp, BNX2_RBUF_COMMAND, BNX2_RBUF_COMMAND_ALLOC_REQ);
1164
1165 val = REG_RD_IND(bp, BNX2_RBUF_FW_BUF_ALLOC);
1166
1167 val &= BNX2_RBUF_FW_BUF_ALLOC_VALUE;
1168
1169 /* The addresses with Bit 9 set are bad memory blocks. */
1170 if (!(val & (1 << 9))) {
1171 good_mbuf[good_mbuf_cnt] = (u16) val;
1172 good_mbuf_cnt++;
1173 }
1174
1175 val = REG_RD_IND(bp, BNX2_RBUF_STATUS1);
1176 }
1177
1178 /* Free the good ones back to the mbuf pool thus discarding
1179 * all the bad ones. */
1180 while (good_mbuf_cnt) {
1181 good_mbuf_cnt--;
1182
1183 val = good_mbuf[good_mbuf_cnt];
1184 val = (val << 9) | val | 1;
1185
1186 REG_WR_IND(bp, BNX2_RBUF_FW_BUF_FREE, val);
1187 }
1188 kfree(good_mbuf);
1189 return 0;
1190}
1191
1192static void
1193bnx2_set_mac_addr(struct bnx2 *bp)
1194{
1195 u32 val;
1196 u8 *mac_addr = bp->dev->dev_addr;
1197
1198 val = (mac_addr[0] << 8) | mac_addr[1];
1199
1200 REG_WR(bp, BNX2_EMAC_MAC_MATCH0, val);
1201
1202 val = (mac_addr[2] << 24) | (mac_addr[3] << 16) |
1203 (mac_addr[4] << 8) | mac_addr[5];
1204
1205 REG_WR(bp, BNX2_EMAC_MAC_MATCH1, val);
1206}
1207
1208static inline int
1209bnx2_alloc_rx_skb(struct bnx2 *bp, u16 index)
1210{
1211 struct sk_buff *skb;
1212 struct sw_bd *rx_buf = &bp->rx_buf_ring[index];
1213 dma_addr_t mapping;
1214 struct rx_bd *rxbd = &bp->rx_desc_ring[index];
1215 unsigned long align;
1216
1217 skb = dev_alloc_skb(bp->rx_buf_size);
1218 if (skb == NULL) {
1219 return -ENOMEM;
1220 }
1221
1222 if (unlikely((align = (unsigned long) skb->data & 0x7))) {
1223 skb_reserve(skb, 8 - align);
1224 }
1225
1226 skb->dev = bp->dev;
1227 mapping = pci_map_single(bp->pdev, skb->data, bp->rx_buf_use_size,
1228 PCI_DMA_FROMDEVICE);
1229
1230 rx_buf->skb = skb;
1231 pci_unmap_addr_set(rx_buf, mapping, mapping);
1232
1233 rxbd->rx_bd_haddr_hi = (u64) mapping >> 32;
1234 rxbd->rx_bd_haddr_lo = (u64) mapping & 0xffffffff;
1235
1236 bp->rx_prod_bseq += bp->rx_buf_use_size;
1237
1238 return 0;
1239}
1240
1241static void
1242bnx2_phy_int(struct bnx2 *bp)
1243{
1244 u32 new_link_state, old_link_state;
1245
1246 new_link_state = bp->status_blk->status_attn_bits &
1247 STATUS_ATTN_BITS_LINK_STATE;
1248 old_link_state = bp->status_blk->status_attn_bits_ack &
1249 STATUS_ATTN_BITS_LINK_STATE;
1250 if (new_link_state != old_link_state) {
1251 if (new_link_state) {
1252 REG_WR(bp, BNX2_PCICFG_STATUS_BIT_SET_CMD,
1253 STATUS_ATTN_BITS_LINK_STATE);
1254 }
1255 else {
1256 REG_WR(bp, BNX2_PCICFG_STATUS_BIT_CLEAR_CMD,
1257 STATUS_ATTN_BITS_LINK_STATE);
1258 }
1259 bnx2_set_link(bp);
1260 }
1261}
1262
1263static void
1264bnx2_tx_int(struct bnx2 *bp)
1265{
1266 u16 hw_cons, sw_cons, sw_ring_cons;
1267 int tx_free_bd = 0;
1268
1269 hw_cons = bp->status_blk->status_tx_quick_consumer_index0;
1270 if ((hw_cons & MAX_TX_DESC_CNT) == MAX_TX_DESC_CNT) {
1271 hw_cons++;
1272 }
1273 sw_cons = bp->tx_cons;
1274
1275 while (sw_cons != hw_cons) {
1276 struct sw_bd *tx_buf;
1277 struct sk_buff *skb;
1278 int i, last;
1279
1280 sw_ring_cons = TX_RING_IDX(sw_cons);
1281
1282 tx_buf = &bp->tx_buf_ring[sw_ring_cons];
1283 skb = tx_buf->skb;
1284#ifdef BCM_TSO
1285 /* partial BD completions possible with TSO packets */
1286 if (skb_shinfo(skb)->tso_size) {
1287 u16 last_idx, last_ring_idx;
1288
1289 last_idx = sw_cons +
1290 skb_shinfo(skb)->nr_frags + 1;
1291 last_ring_idx = sw_ring_cons +
1292 skb_shinfo(skb)->nr_frags + 1;
1293 if (unlikely(last_ring_idx >= MAX_TX_DESC_CNT)) {
1294 last_idx++;
1295 }
1296 if (((s16) ((s16) last_idx - (s16) hw_cons)) > 0) {
1297 break;
1298 }
1299 }
1300#endif
1301 pci_unmap_single(bp->pdev, pci_unmap_addr(tx_buf, mapping),
1302 skb_headlen(skb), PCI_DMA_TODEVICE);
1303
1304 tx_buf->skb = NULL;
1305 last = skb_shinfo(skb)->nr_frags;
1306
1307 for (i = 0; i < last; i++) {
1308 sw_cons = NEXT_TX_BD(sw_cons);
1309
1310 pci_unmap_page(bp->pdev,
1311 pci_unmap_addr(
1312 &bp->tx_buf_ring[TX_RING_IDX(sw_cons)],
1313 mapping),
1314 skb_shinfo(skb)->frags[i].size,
1315 PCI_DMA_TODEVICE);
1316 }
1317
1318 sw_cons = NEXT_TX_BD(sw_cons);
1319
1320 tx_free_bd += last + 1;
1321
1322 dev_kfree_skb_irq(skb);
1323
1324 hw_cons = bp->status_blk->status_tx_quick_consumer_index0;
1325 if ((hw_cons & MAX_TX_DESC_CNT) == MAX_TX_DESC_CNT) {
1326 hw_cons++;
1327 }
1328 }
1329
1330 atomic_add(tx_free_bd, &bp->tx_avail_bd);
1331
1332 if (unlikely(netif_queue_stopped(bp->dev))) {
1333 unsigned long flags;
1334
1335 spin_lock_irqsave(&bp->tx_lock, flags);
1336 if ((netif_queue_stopped(bp->dev)) &&
1337 (atomic_read(&bp->tx_avail_bd) > MAX_SKB_FRAGS)) {
1338
1339 netif_wake_queue(bp->dev);
1340 }
1341 spin_unlock_irqrestore(&bp->tx_lock, flags);
1342 }
1343
1344 bp->tx_cons = sw_cons;
1345
1346}
1347
1348static inline void
1349bnx2_reuse_rx_skb(struct bnx2 *bp, struct sk_buff *skb,
1350 u16 cons, u16 prod)
1351{
1352 struct sw_bd *cons_rx_buf = &bp->rx_buf_ring[cons];
1353 struct sw_bd *prod_rx_buf = &bp->rx_buf_ring[prod];
1354 struct rx_bd *cons_bd = &bp->rx_desc_ring[cons];
1355 struct rx_bd *prod_bd = &bp->rx_desc_ring[prod];
1356
1357 pci_dma_sync_single_for_device(bp->pdev,
1358 pci_unmap_addr(cons_rx_buf, mapping),
1359 bp->rx_offset + RX_COPY_THRESH, PCI_DMA_FROMDEVICE);
1360
1361 prod_rx_buf->skb = cons_rx_buf->skb;
1362 pci_unmap_addr_set(prod_rx_buf, mapping,
1363 pci_unmap_addr(cons_rx_buf, mapping));
1364
1365 memcpy(prod_bd, cons_bd, 8);
1366
1367 bp->rx_prod_bseq += bp->rx_buf_use_size;
1368
1369}
1370
1371static int
1372bnx2_rx_int(struct bnx2 *bp, int budget)
1373{
1374 u16 hw_cons, sw_cons, sw_ring_cons, sw_prod, sw_ring_prod;
1375 struct l2_fhdr *rx_hdr;
1376 int rx_pkt = 0;
1377
1378 hw_cons = bp->status_blk->status_rx_quick_consumer_index0;
1379 if ((hw_cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT) {
1380 hw_cons++;
1381 }
1382 sw_cons = bp->rx_cons;
1383 sw_prod = bp->rx_prod;
1384
1385 /* Memory barrier necessary as speculative reads of the rx
1386 * buffer can be ahead of the index in the status block
1387 */
1388 rmb();
1389 while (sw_cons != hw_cons) {
1390 unsigned int len;
1391 u16 status;
1392 struct sw_bd *rx_buf;
1393 struct sk_buff *skb;
1394
1395 sw_ring_cons = RX_RING_IDX(sw_cons);
1396 sw_ring_prod = RX_RING_IDX(sw_prod);
1397
1398 rx_buf = &bp->rx_buf_ring[sw_ring_cons];
1399 skb = rx_buf->skb;
1400 pci_dma_sync_single_for_cpu(bp->pdev,
1401 pci_unmap_addr(rx_buf, mapping),
1402 bp->rx_offset + RX_COPY_THRESH, PCI_DMA_FROMDEVICE);
1403
1404 rx_hdr = (struct l2_fhdr *) skb->data;
1405 len = rx_hdr->l2_fhdr_pkt_len - 4;
1406
1407 if (rx_hdr->l2_fhdr_errors &
1408 (L2_FHDR_ERRORS_BAD_CRC |
1409 L2_FHDR_ERRORS_PHY_DECODE |
1410 L2_FHDR_ERRORS_ALIGNMENT |
1411 L2_FHDR_ERRORS_TOO_SHORT |
1412 L2_FHDR_ERRORS_GIANT_FRAME)) {
1413
1414 goto reuse_rx;
1415 }
1416
1417 /* Since we don't have a jumbo ring, copy small packets
1418 * if mtu > 1500
1419 */
1420 if ((bp->dev->mtu > 1500) && (len <= RX_COPY_THRESH)) {
1421 struct sk_buff *new_skb;
1422
1423 new_skb = dev_alloc_skb(len + 2);
1424 if (new_skb == NULL)
1425 goto reuse_rx;
1426
1427 /* aligned copy */
1428 memcpy(new_skb->data,
1429 skb->data + bp->rx_offset - 2,
1430 len + 2);
1431
1432 skb_reserve(new_skb, 2);
1433 skb_put(new_skb, len);
1434 new_skb->dev = bp->dev;
1435
1436 bnx2_reuse_rx_skb(bp, skb,
1437 sw_ring_cons, sw_ring_prod);
1438
1439 skb = new_skb;
1440 }
1441 else if (bnx2_alloc_rx_skb(bp, sw_ring_prod) == 0) {
1442 pci_unmap_single(bp->pdev,
1443 pci_unmap_addr(rx_buf, mapping),
1444 bp->rx_buf_use_size, PCI_DMA_FROMDEVICE);
1445
1446 skb_reserve(skb, bp->rx_offset);
1447 skb_put(skb, len);
1448 }
1449 else {
1450reuse_rx:
1451 bnx2_reuse_rx_skb(bp, skb,
1452 sw_ring_cons, sw_ring_prod);
1453 goto next_rx;
1454 }
1455
1456 skb->protocol = eth_type_trans(skb, bp->dev);
1457
1458 if ((len > (bp->dev->mtu + ETH_HLEN)) &&
1459 (htons(skb->protocol) != 0x8100)) {
1460
1461 dev_kfree_skb_irq(skb);
1462 goto next_rx;
1463
1464 }
1465
1466 status = rx_hdr->l2_fhdr_status;
1467 skb->ip_summed = CHECKSUM_NONE;
1468 if (bp->rx_csum &&
1469 (status & (L2_FHDR_STATUS_TCP_SEGMENT |
1470 L2_FHDR_STATUS_UDP_DATAGRAM))) {
1471
1472 u16 cksum = rx_hdr->l2_fhdr_tcp_udp_xsum;
1473
1474 if (cksum == 0xffff)
1475 skb->ip_summed = CHECKSUM_UNNECESSARY;
1476 }
1477
1478#ifdef BCM_VLAN
1479 if ((status & L2_FHDR_STATUS_L2_VLAN_TAG) && (bp->vlgrp != 0)) {
1480 vlan_hwaccel_receive_skb(skb, bp->vlgrp,
1481 rx_hdr->l2_fhdr_vlan_tag);
1482 }
1483 else
1484#endif
1485 netif_receive_skb(skb);
1486
1487 bp->dev->last_rx = jiffies;
1488 rx_pkt++;
1489
1490next_rx:
1491 rx_buf->skb = NULL;
1492
1493 sw_cons = NEXT_RX_BD(sw_cons);
1494 sw_prod = NEXT_RX_BD(sw_prod);
1495
1496 if ((rx_pkt == budget))
1497 break;
1498 }
1499 bp->rx_cons = sw_cons;
1500 bp->rx_prod = sw_prod;
1501
1502 REG_WR16(bp, MB_RX_CID_ADDR + BNX2_L2CTX_HOST_BDIDX, sw_prod);
1503
1504 REG_WR(bp, MB_RX_CID_ADDR + BNX2_L2CTX_HOST_BSEQ, bp->rx_prod_bseq);
1505
1506 mmiowb();
1507
1508 return rx_pkt;
1509
1510}
1511
1512/* MSI ISR - The only difference between this and the INTx ISR
1513 * is that the MSI interrupt is always serviced.
1514 */
1515static irqreturn_t
1516bnx2_msi(int irq, void *dev_instance, struct pt_regs *regs)
1517{
1518 struct net_device *dev = dev_instance;
1519 struct bnx2 *bp = dev->priv;
1520
1521 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
1522 BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM |
1523 BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
1524
1525 /* Return here if interrupt is disabled. */
1526 if (unlikely(atomic_read(&bp->intr_sem) != 0)) {
1527 return IRQ_RETVAL(1);
1528 }
1529
1530 if (netif_rx_schedule_prep(dev)) {
1531 __netif_rx_schedule(dev);
1532 }
1533
1534 return IRQ_RETVAL(1);
1535}
1536
1537static irqreturn_t
1538bnx2_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
1539{
1540 struct net_device *dev = dev_instance;
1541 struct bnx2 *bp = dev->priv;
1542
1543 /* When using INTx, it is possible for the interrupt to arrive
1544 * at the CPU before the status block posted prior to the
1545 * interrupt. Reading a register will flush the status block.
1546 * When using MSI, the MSI message will always complete after
1547 * the status block write.
1548 */
1549 if ((bp->status_blk->status_idx == bp->last_status_idx) ||
1550 (REG_RD(bp, BNX2_PCICFG_MISC_STATUS) &
1551 BNX2_PCICFG_MISC_STATUS_INTA_VALUE))
1552 return IRQ_RETVAL(0);
1553
1554 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
1555 BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM |
1556 BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
1557
1558 /* Return here if interrupt is shared and is disabled. */
1559 if (unlikely(atomic_read(&bp->intr_sem) != 0)) {
1560 return IRQ_RETVAL(1);
1561 }
1562
1563 if (netif_rx_schedule_prep(dev)) {
1564 __netif_rx_schedule(dev);
1565 }
1566
1567 return IRQ_RETVAL(1);
1568}
1569
1570static int
1571bnx2_poll(struct net_device *dev, int *budget)
1572{
1573 struct bnx2 *bp = dev->priv;
1574 int rx_done = 1;
1575
1576 bp->last_status_idx = bp->status_blk->status_idx;
1577
1578 rmb();
1579 if ((bp->status_blk->status_attn_bits &
1580 STATUS_ATTN_BITS_LINK_STATE) !=
1581 (bp->status_blk->status_attn_bits_ack &
1582 STATUS_ATTN_BITS_LINK_STATE)) {
1583
1584 unsigned long flags;
1585
1586 spin_lock_irqsave(&bp->phy_lock, flags);
1587 bnx2_phy_int(bp);
1588 spin_unlock_irqrestore(&bp->phy_lock, flags);
1589 }
1590
1591 if (bp->status_blk->status_tx_quick_consumer_index0 != bp->tx_cons) {
1592 bnx2_tx_int(bp);
1593 }
1594
1595 if (bp->status_blk->status_rx_quick_consumer_index0 != bp->rx_cons) {
1596 int orig_budget = *budget;
1597 int work_done;
1598
1599 if (orig_budget > dev->quota)
1600 orig_budget = dev->quota;
1601
1602 work_done = bnx2_rx_int(bp, orig_budget);
1603 *budget -= work_done;
1604 dev->quota -= work_done;
1605
1606 if (work_done >= orig_budget) {
1607 rx_done = 0;
1608 }
1609 }
1610
1611 if (rx_done) {
1612 netif_rx_complete(dev);
1613 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
1614 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
1615 bp->last_status_idx);
1616 return 0;
1617 }
1618
1619 return 1;
1620}
1621
1622/* Called with rtnl_lock from vlan functions and also dev->xmit_lock
1623 * from set_multicast.
1624 */
1625static void
1626bnx2_set_rx_mode(struct net_device *dev)
1627{
1628 struct bnx2 *bp = dev->priv;
1629 u32 rx_mode, sort_mode;
1630 int i;
1631 unsigned long flags;
1632
1633 spin_lock_irqsave(&bp->phy_lock, flags);
1634
1635 rx_mode = bp->rx_mode & ~(BNX2_EMAC_RX_MODE_PROMISCUOUS |
1636 BNX2_EMAC_RX_MODE_KEEP_VLAN_TAG);
1637 sort_mode = 1 | BNX2_RPM_SORT_USER0_BC_EN;
1638#ifdef BCM_VLAN
1639 if (!bp->vlgrp) {
1640 rx_mode |= BNX2_EMAC_RX_MODE_KEEP_VLAN_TAG;
1641 }
1642#else
1643 rx_mode |= BNX2_EMAC_RX_MODE_KEEP_VLAN_TAG;
1644#endif
1645 if (dev->flags & IFF_PROMISC) {
1646 /* Promiscuous mode. */
1647 rx_mode |= BNX2_EMAC_RX_MODE_PROMISCUOUS;
1648 sort_mode |= BNX2_RPM_SORT_USER0_PROM_EN;
1649 }
1650 else if (dev->flags & IFF_ALLMULTI) {
1651 for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) {
1652 REG_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),
1653 0xffffffff);
1654 }
1655 sort_mode |= BNX2_RPM_SORT_USER0_MC_EN;
1656 }
1657 else {
1658 /* Accept one or more multicast(s). */
1659 struct dev_mc_list *mclist;
1660 u32 mc_filter[NUM_MC_HASH_REGISTERS];
1661 u32 regidx;
1662 u32 bit;
1663 u32 crc;
1664
1665 memset(mc_filter, 0, 4 * NUM_MC_HASH_REGISTERS);
1666
1667 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
1668 i++, mclist = mclist->next) {
1669
1670 crc = ether_crc_le(ETH_ALEN, mclist->dmi_addr);
1671 bit = crc & 0xff;
1672 regidx = (bit & 0xe0) >> 5;
1673 bit &= 0x1f;
1674 mc_filter[regidx] |= (1 << bit);
1675 }
1676
1677 for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) {
1678 REG_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),
1679 mc_filter[i]);
1680 }
1681
1682 sort_mode |= BNX2_RPM_SORT_USER0_MC_HSH_EN;
1683 }
1684
1685 if (rx_mode != bp->rx_mode) {
1686 bp->rx_mode = rx_mode;
1687 REG_WR(bp, BNX2_EMAC_RX_MODE, rx_mode);
1688 }
1689
1690 REG_WR(bp, BNX2_RPM_SORT_USER0, 0x0);
1691 REG_WR(bp, BNX2_RPM_SORT_USER0, sort_mode);
1692 REG_WR(bp, BNX2_RPM_SORT_USER0, sort_mode | BNX2_RPM_SORT_USER0_ENA);
1693
1694 spin_unlock_irqrestore(&bp->phy_lock, flags);
1695}
1696
1697static void
1698load_rv2p_fw(struct bnx2 *bp, u32 *rv2p_code, u32 rv2p_code_len,
1699 u32 rv2p_proc)
1700{
1701 int i;
1702 u32 val;
1703
1704
1705 for (i = 0; i < rv2p_code_len; i += 8) {
1706 REG_WR(bp, BNX2_RV2P_INSTR_HIGH, *rv2p_code);
1707 rv2p_code++;
1708 REG_WR(bp, BNX2_RV2P_INSTR_LOW, *rv2p_code);
1709 rv2p_code++;
1710
1711 if (rv2p_proc == RV2P_PROC1) {
1712 val = (i / 8) | BNX2_RV2P_PROC1_ADDR_CMD_RDWR;
1713 REG_WR(bp, BNX2_RV2P_PROC1_ADDR_CMD, val);
1714 }
1715 else {
1716 val = (i / 8) | BNX2_RV2P_PROC2_ADDR_CMD_RDWR;
1717 REG_WR(bp, BNX2_RV2P_PROC2_ADDR_CMD, val);
1718 }
1719 }
1720
1721 /* Reset the processor, un-stall is done later. */
1722 if (rv2p_proc == RV2P_PROC1) {
1723 REG_WR(bp, BNX2_RV2P_COMMAND, BNX2_RV2P_COMMAND_PROC1_RESET);
1724 }
1725 else {
1726 REG_WR(bp, BNX2_RV2P_COMMAND, BNX2_RV2P_COMMAND_PROC2_RESET);
1727 }
1728}
1729
1730static void
1731load_cpu_fw(struct bnx2 *bp, struct cpu_reg *cpu_reg, struct fw_info *fw)
1732{
1733 u32 offset;
1734 u32 val;
1735
1736 /* Halt the CPU. */
1737 val = REG_RD_IND(bp, cpu_reg->mode);
1738 val |= cpu_reg->mode_value_halt;
1739 REG_WR_IND(bp, cpu_reg->mode, val);
1740 REG_WR_IND(bp, cpu_reg->state, cpu_reg->state_value_clear);
1741
1742 /* Load the Text area. */
1743 offset = cpu_reg->spad_base + (fw->text_addr - cpu_reg->mips_view_base);
1744 if (fw->text) {
1745 int j;
1746
1747 for (j = 0; j < (fw->text_len / 4); j++, offset += 4) {
1748 REG_WR_IND(bp, offset, fw->text[j]);
1749 }
1750 }
1751
1752 /* Load the Data area. */
1753 offset = cpu_reg->spad_base + (fw->data_addr - cpu_reg->mips_view_base);
1754 if (fw->data) {
1755 int j;
1756
1757 for (j = 0; j < (fw->data_len / 4); j++, offset += 4) {
1758 REG_WR_IND(bp, offset, fw->data[j]);
1759 }
1760 }
1761
1762 /* Load the SBSS area. */
1763 offset = cpu_reg->spad_base + (fw->sbss_addr - cpu_reg->mips_view_base);
1764 if (fw->sbss) {
1765 int j;
1766
1767 for (j = 0; j < (fw->sbss_len / 4); j++, offset += 4) {
1768 REG_WR_IND(bp, offset, fw->sbss[j]);
1769 }
1770 }
1771
1772 /* Load the BSS area. */
1773 offset = cpu_reg->spad_base + (fw->bss_addr - cpu_reg->mips_view_base);
1774 if (fw->bss) {
1775 int j;
1776
1777 for (j = 0; j < (fw->bss_len/4); j++, offset += 4) {
1778 REG_WR_IND(bp, offset, fw->bss[j]);
1779 }
1780 }
1781
1782 /* Load the Read-Only area. */
1783 offset = cpu_reg->spad_base +
1784 (fw->rodata_addr - cpu_reg->mips_view_base);
1785 if (fw->rodata) {
1786 int j;
1787
1788 for (j = 0; j < (fw->rodata_len / 4); j++, offset += 4) {
1789 REG_WR_IND(bp, offset, fw->rodata[j]);
1790 }
1791 }
1792
1793 /* Clear the pre-fetch instruction. */
1794 REG_WR_IND(bp, cpu_reg->inst, 0);
1795 REG_WR_IND(bp, cpu_reg->pc, fw->start_addr);
1796
1797 /* Start the CPU. */
1798 val = REG_RD_IND(bp, cpu_reg->mode);
1799 val &= ~cpu_reg->mode_value_halt;
1800 REG_WR_IND(bp, cpu_reg->state, cpu_reg->state_value_clear);
1801 REG_WR_IND(bp, cpu_reg->mode, val);
1802}
1803
1804static void
1805bnx2_init_cpus(struct bnx2 *bp)
1806{
1807 struct cpu_reg cpu_reg;
1808 struct fw_info fw;
1809
1810 /* Initialize the RV2P processor. */
1811 load_rv2p_fw(bp, bnx2_rv2p_proc1, sizeof(bnx2_rv2p_proc1), RV2P_PROC1);
1812 load_rv2p_fw(bp, bnx2_rv2p_proc2, sizeof(bnx2_rv2p_proc2), RV2P_PROC2);
1813
1814 /* Initialize the RX Processor. */
1815 cpu_reg.mode = BNX2_RXP_CPU_MODE;
1816 cpu_reg.mode_value_halt = BNX2_RXP_CPU_MODE_SOFT_HALT;
1817 cpu_reg.mode_value_sstep = BNX2_RXP_CPU_MODE_STEP_ENA;
1818 cpu_reg.state = BNX2_RXP_CPU_STATE;
1819 cpu_reg.state_value_clear = 0xffffff;
1820 cpu_reg.gpr0 = BNX2_RXP_CPU_REG_FILE;
1821 cpu_reg.evmask = BNX2_RXP_CPU_EVENT_MASK;
1822 cpu_reg.pc = BNX2_RXP_CPU_PROGRAM_COUNTER;
1823 cpu_reg.inst = BNX2_RXP_CPU_INSTRUCTION;
1824 cpu_reg.bp = BNX2_RXP_CPU_HW_BREAKPOINT;
1825 cpu_reg.spad_base = BNX2_RXP_SCRATCH;
1826 cpu_reg.mips_view_base = 0x8000000;
1827
1828 fw.ver_major = bnx2_RXP_b06FwReleaseMajor;
1829 fw.ver_minor = bnx2_RXP_b06FwReleaseMinor;
1830 fw.ver_fix = bnx2_RXP_b06FwReleaseFix;
1831 fw.start_addr = bnx2_RXP_b06FwStartAddr;
1832
1833 fw.text_addr = bnx2_RXP_b06FwTextAddr;
1834 fw.text_len = bnx2_RXP_b06FwTextLen;
1835 fw.text_index = 0;
1836 fw.text = bnx2_RXP_b06FwText;
1837
1838 fw.data_addr = bnx2_RXP_b06FwDataAddr;
1839 fw.data_len = bnx2_RXP_b06FwDataLen;
1840 fw.data_index = 0;
1841 fw.data = bnx2_RXP_b06FwData;
1842
1843 fw.sbss_addr = bnx2_RXP_b06FwSbssAddr;
1844 fw.sbss_len = bnx2_RXP_b06FwSbssLen;
1845 fw.sbss_index = 0;
1846 fw.sbss = bnx2_RXP_b06FwSbss;
1847
1848 fw.bss_addr = bnx2_RXP_b06FwBssAddr;
1849 fw.bss_len = bnx2_RXP_b06FwBssLen;
1850 fw.bss_index = 0;
1851 fw.bss = bnx2_RXP_b06FwBss;
1852
1853 fw.rodata_addr = bnx2_RXP_b06FwRodataAddr;
1854 fw.rodata_len = bnx2_RXP_b06FwRodataLen;
1855 fw.rodata_index = 0;
1856 fw.rodata = bnx2_RXP_b06FwRodata;
1857
1858 load_cpu_fw(bp, &cpu_reg, &fw);
1859
1860 /* Initialize the TX Processor. */
1861 cpu_reg.mode = BNX2_TXP_CPU_MODE;
1862 cpu_reg.mode_value_halt = BNX2_TXP_CPU_MODE_SOFT_HALT;
1863 cpu_reg.mode_value_sstep = BNX2_TXP_CPU_MODE_STEP_ENA;
1864 cpu_reg.state = BNX2_TXP_CPU_STATE;
1865 cpu_reg.state_value_clear = 0xffffff;
1866 cpu_reg.gpr0 = BNX2_TXP_CPU_REG_FILE;
1867 cpu_reg.evmask = BNX2_TXP_CPU_EVENT_MASK;
1868 cpu_reg.pc = BNX2_TXP_CPU_PROGRAM_COUNTER;
1869 cpu_reg.inst = BNX2_TXP_CPU_INSTRUCTION;
1870 cpu_reg.bp = BNX2_TXP_CPU_HW_BREAKPOINT;
1871 cpu_reg.spad_base = BNX2_TXP_SCRATCH;
1872 cpu_reg.mips_view_base = 0x8000000;
1873
1874 fw.ver_major = bnx2_TXP_b06FwReleaseMajor;
1875 fw.ver_minor = bnx2_TXP_b06FwReleaseMinor;
1876 fw.ver_fix = bnx2_TXP_b06FwReleaseFix;
1877 fw.start_addr = bnx2_TXP_b06FwStartAddr;
1878
1879 fw.text_addr = bnx2_TXP_b06FwTextAddr;
1880 fw.text_len = bnx2_TXP_b06FwTextLen;
1881 fw.text_index = 0;
1882 fw.text = bnx2_TXP_b06FwText;
1883
1884 fw.data_addr = bnx2_TXP_b06FwDataAddr;
1885 fw.data_len = bnx2_TXP_b06FwDataLen;
1886 fw.data_index = 0;
1887 fw.data = bnx2_TXP_b06FwData;
1888
1889 fw.sbss_addr = bnx2_TXP_b06FwSbssAddr;
1890 fw.sbss_len = bnx2_TXP_b06FwSbssLen;
1891 fw.sbss_index = 0;
1892 fw.sbss = bnx2_TXP_b06FwSbss;
1893
1894 fw.bss_addr = bnx2_TXP_b06FwBssAddr;
1895 fw.bss_len = bnx2_TXP_b06FwBssLen;
1896 fw.bss_index = 0;
1897 fw.bss = bnx2_TXP_b06FwBss;
1898
1899 fw.rodata_addr = bnx2_TXP_b06FwRodataAddr;
1900 fw.rodata_len = bnx2_TXP_b06FwRodataLen;
1901 fw.rodata_index = 0;
1902 fw.rodata = bnx2_TXP_b06FwRodata;
1903
1904 load_cpu_fw(bp, &cpu_reg, &fw);
1905
1906 /* Initialize the TX Patch-up Processor. */
1907 cpu_reg.mode = BNX2_TPAT_CPU_MODE;
1908 cpu_reg.mode_value_halt = BNX2_TPAT_CPU_MODE_SOFT_HALT;
1909 cpu_reg.mode_value_sstep = BNX2_TPAT_CPU_MODE_STEP_ENA;
1910 cpu_reg.state = BNX2_TPAT_CPU_STATE;
1911 cpu_reg.state_value_clear = 0xffffff;
1912 cpu_reg.gpr0 = BNX2_TPAT_CPU_REG_FILE;
1913 cpu_reg.evmask = BNX2_TPAT_CPU_EVENT_MASK;
1914 cpu_reg.pc = BNX2_TPAT_CPU_PROGRAM_COUNTER;
1915 cpu_reg.inst = BNX2_TPAT_CPU_INSTRUCTION;
1916 cpu_reg.bp = BNX2_TPAT_CPU_HW_BREAKPOINT;
1917 cpu_reg.spad_base = BNX2_TPAT_SCRATCH;
1918 cpu_reg.mips_view_base = 0x8000000;
1919
1920 fw.ver_major = bnx2_TPAT_b06FwReleaseMajor;
1921 fw.ver_minor = bnx2_TPAT_b06FwReleaseMinor;
1922 fw.ver_fix = bnx2_TPAT_b06FwReleaseFix;
1923 fw.start_addr = bnx2_TPAT_b06FwStartAddr;
1924
1925 fw.text_addr = bnx2_TPAT_b06FwTextAddr;
1926 fw.text_len = bnx2_TPAT_b06FwTextLen;
1927 fw.text_index = 0;
1928 fw.text = bnx2_TPAT_b06FwText;
1929
1930 fw.data_addr = bnx2_TPAT_b06FwDataAddr;
1931 fw.data_len = bnx2_TPAT_b06FwDataLen;
1932 fw.data_index = 0;
1933 fw.data = bnx2_TPAT_b06FwData;
1934
1935 fw.sbss_addr = bnx2_TPAT_b06FwSbssAddr;
1936 fw.sbss_len = bnx2_TPAT_b06FwSbssLen;
1937 fw.sbss_index = 0;
1938 fw.sbss = bnx2_TPAT_b06FwSbss;
1939
1940 fw.bss_addr = bnx2_TPAT_b06FwBssAddr;
1941 fw.bss_len = bnx2_TPAT_b06FwBssLen;
1942 fw.bss_index = 0;
1943 fw.bss = bnx2_TPAT_b06FwBss;
1944
1945 fw.rodata_addr = bnx2_TPAT_b06FwRodataAddr;
1946 fw.rodata_len = bnx2_TPAT_b06FwRodataLen;
1947 fw.rodata_index = 0;
1948 fw.rodata = bnx2_TPAT_b06FwRodata;
1949
1950 load_cpu_fw(bp, &cpu_reg, &fw);
1951
1952 /* Initialize the Completion Processor. */
1953 cpu_reg.mode = BNX2_COM_CPU_MODE;
1954 cpu_reg.mode_value_halt = BNX2_COM_CPU_MODE_SOFT_HALT;
1955 cpu_reg.mode_value_sstep = BNX2_COM_CPU_MODE_STEP_ENA;
1956 cpu_reg.state = BNX2_COM_CPU_STATE;
1957 cpu_reg.state_value_clear = 0xffffff;
1958 cpu_reg.gpr0 = BNX2_COM_CPU_REG_FILE;
1959 cpu_reg.evmask = BNX2_COM_CPU_EVENT_MASK;
1960 cpu_reg.pc = BNX2_COM_CPU_PROGRAM_COUNTER;
1961 cpu_reg.inst = BNX2_COM_CPU_INSTRUCTION;
1962 cpu_reg.bp = BNX2_COM_CPU_HW_BREAKPOINT;
1963 cpu_reg.spad_base = BNX2_COM_SCRATCH;
1964 cpu_reg.mips_view_base = 0x8000000;
1965
1966 fw.ver_major = bnx2_COM_b06FwReleaseMajor;
1967 fw.ver_minor = bnx2_COM_b06FwReleaseMinor;
1968 fw.ver_fix = bnx2_COM_b06FwReleaseFix;
1969 fw.start_addr = bnx2_COM_b06FwStartAddr;
1970
1971 fw.text_addr = bnx2_COM_b06FwTextAddr;
1972 fw.text_len = bnx2_COM_b06FwTextLen;
1973 fw.text_index = 0;
1974 fw.text = bnx2_COM_b06FwText;
1975
1976 fw.data_addr = bnx2_COM_b06FwDataAddr;
1977 fw.data_len = bnx2_COM_b06FwDataLen;
1978 fw.data_index = 0;
1979 fw.data = bnx2_COM_b06FwData;
1980
1981 fw.sbss_addr = bnx2_COM_b06FwSbssAddr;
1982 fw.sbss_len = bnx2_COM_b06FwSbssLen;
1983 fw.sbss_index = 0;
1984 fw.sbss = bnx2_COM_b06FwSbss;
1985
1986 fw.bss_addr = bnx2_COM_b06FwBssAddr;
1987 fw.bss_len = bnx2_COM_b06FwBssLen;
1988 fw.bss_index = 0;
1989 fw.bss = bnx2_COM_b06FwBss;
1990
1991 fw.rodata_addr = bnx2_COM_b06FwRodataAddr;
1992 fw.rodata_len = bnx2_COM_b06FwRodataLen;
1993 fw.rodata_index = 0;
1994 fw.rodata = bnx2_COM_b06FwRodata;
1995
1996 load_cpu_fw(bp, &cpu_reg, &fw);
1997
1998}
1999
2000static int
2001bnx2_set_power_state(struct bnx2 *bp, int state)
2002{
2003 u16 pmcsr;
2004
2005 pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmcsr);
2006
2007 switch (state) {
2008 case 0: {
2009 u32 val;
2010
2011 pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL,
2012 (pmcsr & ~PCI_PM_CTRL_STATE_MASK) |
2013 PCI_PM_CTRL_PME_STATUS);
2014
2015 if (pmcsr & PCI_PM_CTRL_STATE_MASK)
2016 /* delay required during transition out of D3hot */
2017 msleep(20);
2018
2019 val = REG_RD(bp, BNX2_EMAC_MODE);
2020 val |= BNX2_EMAC_MODE_MPKT_RCVD | BNX2_EMAC_MODE_ACPI_RCVD;
2021 val &= ~BNX2_EMAC_MODE_MPKT;
2022 REG_WR(bp, BNX2_EMAC_MODE, val);
2023
2024 val = REG_RD(bp, BNX2_RPM_CONFIG);
2025 val &= ~BNX2_RPM_CONFIG_ACPI_ENA;
2026 REG_WR(bp, BNX2_RPM_CONFIG, val);
2027 break;
2028 }
2029 case 3: {
2030 int i;
2031 u32 val, wol_msg;
2032
2033 if (bp->wol) {
2034 u32 advertising;
2035 u8 autoneg;
2036
2037 autoneg = bp->autoneg;
2038 advertising = bp->advertising;
2039
2040 bp->autoneg = AUTONEG_SPEED;
2041 bp->advertising = ADVERTISED_10baseT_Half |
2042 ADVERTISED_10baseT_Full |
2043 ADVERTISED_100baseT_Half |
2044 ADVERTISED_100baseT_Full |
2045 ADVERTISED_Autoneg;
2046
2047 bnx2_setup_copper_phy(bp);
2048
2049 bp->autoneg = autoneg;
2050 bp->advertising = advertising;
2051
2052 bnx2_set_mac_addr(bp);
2053
2054 val = REG_RD(bp, BNX2_EMAC_MODE);
2055
2056 /* Enable port mode. */
2057 val &= ~BNX2_EMAC_MODE_PORT;
2058 val |= BNX2_EMAC_MODE_PORT_MII |
2059 BNX2_EMAC_MODE_MPKT_RCVD |
2060 BNX2_EMAC_MODE_ACPI_RCVD |
2061 BNX2_EMAC_MODE_FORCE_LINK |
2062 BNX2_EMAC_MODE_MPKT;
2063
2064 REG_WR(bp, BNX2_EMAC_MODE, val);
2065
2066 /* receive all multicast */
2067 for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) {
2068 REG_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),
2069 0xffffffff);
2070 }
2071 REG_WR(bp, BNX2_EMAC_RX_MODE,
2072 BNX2_EMAC_RX_MODE_SORT_MODE);
2073
2074 val = 1 | BNX2_RPM_SORT_USER0_BC_EN |
2075 BNX2_RPM_SORT_USER0_MC_EN;
2076 REG_WR(bp, BNX2_RPM_SORT_USER0, 0x0);
2077 REG_WR(bp, BNX2_RPM_SORT_USER0, val);
2078 REG_WR(bp, BNX2_RPM_SORT_USER0, val |
2079 BNX2_RPM_SORT_USER0_ENA);
2080
2081 /* Need to enable EMAC and RPM for WOL. */
2082 REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
2083 BNX2_MISC_ENABLE_SET_BITS_RX_PARSER_MAC_ENABLE |
2084 BNX2_MISC_ENABLE_SET_BITS_TX_HEADER_Q_ENABLE |
2085 BNX2_MISC_ENABLE_SET_BITS_EMAC_ENABLE);
2086
2087 val = REG_RD(bp, BNX2_RPM_CONFIG);
2088 val &= ~BNX2_RPM_CONFIG_ACPI_ENA;
2089 REG_WR(bp, BNX2_RPM_CONFIG, val);
2090
2091 wol_msg = BNX2_DRV_MSG_CODE_SUSPEND_WOL;
2092 }
2093 else {
2094 wol_msg = BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL;
2095 }
2096
2097 bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT3 | wol_msg);
2098
2099 pmcsr &= ~PCI_PM_CTRL_STATE_MASK;
2100 if ((CHIP_ID(bp) == CHIP_ID_5706_A0) ||
2101 (CHIP_ID(bp) == CHIP_ID_5706_A1)) {
2102
2103 if (bp->wol)
2104 pmcsr |= 3;
2105 }
2106 else {
2107 pmcsr |= 3;
2108 }
2109 if (bp->wol) {
2110 pmcsr |= PCI_PM_CTRL_PME_ENABLE;
2111 }
2112 pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL,
2113 pmcsr);
2114
2115 /* No more memory access after this point until
2116 * device is brought back to D0.
2117 */
2118 udelay(50);
2119 break;
2120 }
2121 default:
2122 return -EINVAL;
2123 }
2124 return 0;
2125}
2126
2127static int
2128bnx2_acquire_nvram_lock(struct bnx2 *bp)
2129{
2130 u32 val;
2131 int j;
2132
2133 /* Request access to the flash interface. */
2134 REG_WR(bp, BNX2_NVM_SW_ARB, BNX2_NVM_SW_ARB_ARB_REQ_SET2);
2135 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
2136 val = REG_RD(bp, BNX2_NVM_SW_ARB);
2137 if (val & BNX2_NVM_SW_ARB_ARB_ARB2)
2138 break;
2139
2140 udelay(5);
2141 }
2142
2143 if (j >= NVRAM_TIMEOUT_COUNT)
2144 return -EBUSY;
2145
2146 return 0;
2147}
2148
2149static int
2150bnx2_release_nvram_lock(struct bnx2 *bp)
2151{
2152 int j;
2153 u32 val;
2154
2155 /* Relinquish nvram interface. */
2156 REG_WR(bp, BNX2_NVM_SW_ARB, BNX2_NVM_SW_ARB_ARB_REQ_CLR2);
2157
2158 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
2159 val = REG_RD(bp, BNX2_NVM_SW_ARB);
2160 if (!(val & BNX2_NVM_SW_ARB_ARB_ARB2))
2161 break;
2162
2163 udelay(5);
2164 }
2165
2166 if (j >= NVRAM_TIMEOUT_COUNT)
2167 return -EBUSY;
2168
2169 return 0;
2170}
2171
2172
2173static int
2174bnx2_enable_nvram_write(struct bnx2 *bp)
2175{
2176 u32 val;
2177
2178 val = REG_RD(bp, BNX2_MISC_CFG);
2179 REG_WR(bp, BNX2_MISC_CFG, val | BNX2_MISC_CFG_NVM_WR_EN_PCI);
2180
2181 if (!bp->flash_info->buffered) {
2182 int j;
2183
2184 REG_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);
2185 REG_WR(bp, BNX2_NVM_COMMAND,
2186 BNX2_NVM_COMMAND_WREN | BNX2_NVM_COMMAND_DOIT);
2187
2188 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
2189 udelay(5);
2190
2191 val = REG_RD(bp, BNX2_NVM_COMMAND);
2192 if (val & BNX2_NVM_COMMAND_DONE)
2193 break;
2194 }
2195
2196 if (j >= NVRAM_TIMEOUT_COUNT)
2197 return -EBUSY;
2198 }
2199 return 0;
2200}
2201
2202static void
2203bnx2_disable_nvram_write(struct bnx2 *bp)
2204{
2205 u32 val;
2206
2207 val = REG_RD(bp, BNX2_MISC_CFG);
2208 REG_WR(bp, BNX2_MISC_CFG, val & ~BNX2_MISC_CFG_NVM_WR_EN);
2209}
2210
2211
2212static void
2213bnx2_enable_nvram_access(struct bnx2 *bp)
2214{
2215 u32 val;
2216
2217 val = REG_RD(bp, BNX2_NVM_ACCESS_ENABLE);
2218 /* Enable both bits, even on read. */
2219 REG_WR(bp, BNX2_NVM_ACCESS_ENABLE,
2220 val | BNX2_NVM_ACCESS_ENABLE_EN | BNX2_NVM_ACCESS_ENABLE_WR_EN);
2221}
2222
2223static void
2224bnx2_disable_nvram_access(struct bnx2 *bp)
2225{
2226 u32 val;
2227
2228 val = REG_RD(bp, BNX2_NVM_ACCESS_ENABLE);
2229 /* Disable both bits, even after read. */
2230 REG_WR(bp, BNX2_NVM_ACCESS_ENABLE,
2231 val & ~(BNX2_NVM_ACCESS_ENABLE_EN |
2232 BNX2_NVM_ACCESS_ENABLE_WR_EN));
2233}
2234
2235static int
2236bnx2_nvram_erase_page(struct bnx2 *bp, u32 offset)
2237{
2238 u32 cmd;
2239 int j;
2240
2241 if (bp->flash_info->buffered)
2242 /* Buffered flash, no erase needed */
2243 return 0;
2244
2245 /* Build an erase command */
2246 cmd = BNX2_NVM_COMMAND_ERASE | BNX2_NVM_COMMAND_WR |
2247 BNX2_NVM_COMMAND_DOIT;
2248
2249 /* Need to clear DONE bit separately. */
2250 REG_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);
2251
2252 /* Address of the NVRAM to read from. */
2253 REG_WR(bp, BNX2_NVM_ADDR, offset & BNX2_NVM_ADDR_NVM_ADDR_VALUE);
2254
2255 /* Issue an erase command. */
2256 REG_WR(bp, BNX2_NVM_COMMAND, cmd);
2257
2258 /* Wait for completion. */
2259 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
2260 u32 val;
2261
2262 udelay(5);
2263
2264 val = REG_RD(bp, BNX2_NVM_COMMAND);
2265 if (val & BNX2_NVM_COMMAND_DONE)
2266 break;
2267 }
2268
2269 if (j >= NVRAM_TIMEOUT_COUNT)
2270 return -EBUSY;
2271
2272 return 0;
2273}
2274
2275static int
2276bnx2_nvram_read_dword(struct bnx2 *bp, u32 offset, u8 *ret_val, u32 cmd_flags)
2277{
2278 u32 cmd;
2279 int j;
2280
2281 /* Build the command word. */
2282 cmd = BNX2_NVM_COMMAND_DOIT | cmd_flags;
2283
2284 /* Calculate an offset of a buffered flash. */
2285 if (bp->flash_info->buffered) {
2286 offset = ((offset / bp->flash_info->page_size) <<
2287 bp->flash_info->page_bits) +
2288 (offset % bp->flash_info->page_size);
2289 }
2290
2291 /* Need to clear DONE bit separately. */
2292 REG_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);
2293
2294 /* Address of the NVRAM to read from. */
2295 REG_WR(bp, BNX2_NVM_ADDR, offset & BNX2_NVM_ADDR_NVM_ADDR_VALUE);
2296
2297 /* Issue a read command. */
2298 REG_WR(bp, BNX2_NVM_COMMAND, cmd);
2299
2300 /* Wait for completion. */
2301 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
2302 u32 val;
2303
2304 udelay(5);
2305
2306 val = REG_RD(bp, BNX2_NVM_COMMAND);
2307 if (val & BNX2_NVM_COMMAND_DONE) {
2308 val = REG_RD(bp, BNX2_NVM_READ);
2309
2310 val = be32_to_cpu(val);
2311 memcpy(ret_val, &val, 4);
2312 break;
2313 }
2314 }
2315 if (j >= NVRAM_TIMEOUT_COUNT)
2316 return -EBUSY;
2317
2318 return 0;
2319}
2320
2321
2322static int
2323bnx2_nvram_write_dword(struct bnx2 *bp, u32 offset, u8 *val, u32 cmd_flags)
2324{
2325 u32 cmd, val32;
2326 int j;
2327
2328 /* Build the command word. */
2329 cmd = BNX2_NVM_COMMAND_DOIT | BNX2_NVM_COMMAND_WR | cmd_flags;
2330
2331 /* Calculate an offset of a buffered flash. */
2332 if (bp->flash_info->buffered) {
2333 offset = ((offset / bp->flash_info->page_size) <<
2334 bp->flash_info->page_bits) +
2335 (offset % bp->flash_info->page_size);
2336 }
2337
2338 /* Need to clear DONE bit separately. */
2339 REG_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);
2340
2341 memcpy(&val32, val, 4);
2342 val32 = cpu_to_be32(val32);
2343
2344 /* Write the data. */
2345 REG_WR(bp, BNX2_NVM_WRITE, val32);
2346
2347 /* Address of the NVRAM to write to. */
2348 REG_WR(bp, BNX2_NVM_ADDR, offset & BNX2_NVM_ADDR_NVM_ADDR_VALUE);
2349
2350 /* Issue the write command. */
2351 REG_WR(bp, BNX2_NVM_COMMAND, cmd);
2352
2353 /* Wait for completion. */
2354 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
2355 udelay(5);
2356
2357 if (REG_RD(bp, BNX2_NVM_COMMAND) & BNX2_NVM_COMMAND_DONE)
2358 break;
2359 }
2360 if (j >= NVRAM_TIMEOUT_COUNT)
2361 return -EBUSY;
2362
2363 return 0;
2364}
2365
2366static int
2367bnx2_init_nvram(struct bnx2 *bp)
2368{
2369 u32 val;
2370 int j, entry_count, rc;
2371 struct flash_spec *flash;
2372
2373 /* Determine the selected interface. */
2374 val = REG_RD(bp, BNX2_NVM_CFG1);
2375
2376 entry_count = sizeof(flash_table) / sizeof(struct flash_spec);
2377
2378 rc = 0;
2379 if (val & 0x40000000) {
2380
2381 /* Flash interface has been reconfigured */
2382 for (j = 0, flash = &flash_table[0]; j < entry_count;
2383 j++, flash++) {
2384
2385 if (val == flash->config1) {
2386 bp->flash_info = flash;
2387 break;
2388 }
2389 }
2390 }
2391 else {
2392 /* Not yet been reconfigured */
2393
2394 for (j = 0, flash = &flash_table[0]; j < entry_count;
2395 j++, flash++) {
2396
2397 if ((val & FLASH_STRAP_MASK) == flash->strapping) {
2398 bp->flash_info = flash;
2399
2400 /* Request access to the flash interface. */
2401 if ((rc = bnx2_acquire_nvram_lock(bp)) != 0)
2402 return rc;
2403
2404 /* Enable access to flash interface */
2405 bnx2_enable_nvram_access(bp);
2406
2407 /* Reconfigure the flash interface */
2408 REG_WR(bp, BNX2_NVM_CFG1, flash->config1);
2409 REG_WR(bp, BNX2_NVM_CFG2, flash->config2);
2410 REG_WR(bp, BNX2_NVM_CFG3, flash->config3);
2411 REG_WR(bp, BNX2_NVM_WRITE1, flash->write1);
2412
2413 /* Disable access to flash interface */
2414 bnx2_disable_nvram_access(bp);
2415 bnx2_release_nvram_lock(bp);
2416
2417 break;
2418 }
2419 }
2420 } /* if (val & 0x40000000) */
2421
2422 if (j == entry_count) {
2423 bp->flash_info = NULL;
2424 printk(KERN_ALERT "Unknown flash/EEPROM type.\n");
2425 rc = -ENODEV;
2426 }
2427
2428 return rc;
2429}
2430
2431static int
2432bnx2_nvram_read(struct bnx2 *bp, u32 offset, u8 *ret_buf,
2433 int buf_size)
2434{
2435 int rc = 0;
2436 u32 cmd_flags, offset32, len32, extra;
2437
2438 if (buf_size == 0)
2439 return 0;
2440
2441 /* Request access to the flash interface. */
2442 if ((rc = bnx2_acquire_nvram_lock(bp)) != 0)
2443 return rc;
2444
2445 /* Enable access to flash interface */
2446 bnx2_enable_nvram_access(bp);
2447
2448 len32 = buf_size;
2449 offset32 = offset;
2450 extra = 0;
2451
2452 cmd_flags = 0;
2453
2454 if (offset32 & 3) {
2455 u8 buf[4];
2456 u32 pre_len;
2457
2458 offset32 &= ~3;
2459 pre_len = 4 - (offset & 3);
2460
2461 if (pre_len >= len32) {
2462 pre_len = len32;
2463 cmd_flags = BNX2_NVM_COMMAND_FIRST |
2464 BNX2_NVM_COMMAND_LAST;
2465 }
2466 else {
2467 cmd_flags = BNX2_NVM_COMMAND_FIRST;
2468 }
2469
2470 rc = bnx2_nvram_read_dword(bp, offset32, buf, cmd_flags);
2471
2472 if (rc)
2473 return rc;
2474
2475 memcpy(ret_buf, buf + (offset & 3), pre_len);
2476
2477 offset32 += 4;
2478 ret_buf += pre_len;
2479 len32 -= pre_len;
2480 }
2481 if (len32 & 3) {
2482 extra = 4 - (len32 & 3);
2483 len32 = (len32 + 4) & ~3;
2484 }
2485
2486 if (len32 == 4) {
2487 u8 buf[4];
2488
2489 if (cmd_flags)
2490 cmd_flags = BNX2_NVM_COMMAND_LAST;
2491 else
2492 cmd_flags = BNX2_NVM_COMMAND_FIRST |
2493 BNX2_NVM_COMMAND_LAST;
2494
2495 rc = bnx2_nvram_read_dword(bp, offset32, buf, cmd_flags);
2496
2497 memcpy(ret_buf, buf, 4 - extra);
2498 }
2499 else if (len32 > 0) {
2500 u8 buf[4];
2501
2502 /* Read the first word. */
2503 if (cmd_flags)
2504 cmd_flags = 0;
2505 else
2506 cmd_flags = BNX2_NVM_COMMAND_FIRST;
2507
2508 rc = bnx2_nvram_read_dword(bp, offset32, ret_buf, cmd_flags);
2509
2510 /* Advance to the next dword. */
2511 offset32 += 4;
2512 ret_buf += 4;
2513 len32 -= 4;
2514
2515 while (len32 > 4 && rc == 0) {
2516 rc = bnx2_nvram_read_dword(bp, offset32, ret_buf, 0);
2517
2518 /* Advance to the next dword. */
2519 offset32 += 4;
2520 ret_buf += 4;
2521 len32 -= 4;
2522 }
2523
2524 if (rc)
2525 return rc;
2526
2527 cmd_flags = BNX2_NVM_COMMAND_LAST;
2528 rc = bnx2_nvram_read_dword(bp, offset32, buf, cmd_flags);
2529
2530 memcpy(ret_buf, buf, 4 - extra);
2531 }
2532
2533 /* Disable access to flash interface */
2534 bnx2_disable_nvram_access(bp);
2535
2536 bnx2_release_nvram_lock(bp);
2537
2538 return rc;
2539}
2540
2541static int
2542bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
2543 int buf_size)
2544{
2545 u32 written, offset32, len32;
2546 u8 *buf, start[4], end[4];
2547 int rc = 0;
2548 int align_start, align_end;
2549
2550 buf = data_buf;
2551 offset32 = offset;
2552 len32 = buf_size;
2553 align_start = align_end = 0;
2554
2555 if ((align_start = (offset32 & 3))) {
2556 offset32 &= ~3;
2557 len32 += align_start;
2558 if ((rc = bnx2_nvram_read(bp, offset32, start, 4)))
2559 return rc;
2560 }
2561
2562 if (len32 & 3) {
2563 if ((len32 > 4) || !align_start) {
2564 align_end = 4 - (len32 & 3);
2565 len32 += align_end;
2566 if ((rc = bnx2_nvram_read(bp, offset32 + len32 - 4,
2567 end, 4))) {
2568 return rc;
2569 }
2570 }
2571 }
2572
2573 if (align_start || align_end) {
2574 buf = kmalloc(len32, GFP_KERNEL);
2575 if (buf == 0)
2576 return -ENOMEM;
2577 if (align_start) {
2578 memcpy(buf, start, 4);
2579 }
2580 if (align_end) {
2581 memcpy(buf + len32 - 4, end, 4);
2582 }
2583 memcpy(buf + align_start, data_buf, buf_size);
2584 }
2585
2586 written = 0;
2587 while ((written < len32) && (rc == 0)) {
2588 u32 page_start, page_end, data_start, data_end;
2589 u32 addr, cmd_flags;
2590 int i;
2591 u8 flash_buffer[264];
2592
2593 /* Find the page_start addr */
2594 page_start = offset32 + written;
2595 page_start -= (page_start % bp->flash_info->page_size);
2596 /* Find the page_end addr */
2597 page_end = page_start + bp->flash_info->page_size;
2598 /* Find the data_start addr */
2599 data_start = (written == 0) ? offset32 : page_start;
2600 /* Find the data_end addr */
2601 data_end = (page_end > offset32 + len32) ?
2602 (offset32 + len32) : page_end;
2603
2604 /* Request access to the flash interface. */
2605 if ((rc = bnx2_acquire_nvram_lock(bp)) != 0)
2606 goto nvram_write_end;
2607
2608 /* Enable access to flash interface */
2609 bnx2_enable_nvram_access(bp);
2610
2611 cmd_flags = BNX2_NVM_COMMAND_FIRST;
2612 if (bp->flash_info->buffered == 0) {
2613 int j;
2614
2615 /* Read the whole page into the buffer
2616 * (non-buffer flash only) */
2617 for (j = 0; j < bp->flash_info->page_size; j += 4) {
2618 if (j == (bp->flash_info->page_size - 4)) {
2619 cmd_flags |= BNX2_NVM_COMMAND_LAST;
2620 }
2621 rc = bnx2_nvram_read_dword(bp,
2622 page_start + j,
2623 &flash_buffer[j],
2624 cmd_flags);
2625
2626 if (rc)
2627 goto nvram_write_end;
2628
2629 cmd_flags = 0;
2630 }
2631 }
2632
2633 /* Enable writes to flash interface (unlock write-protect) */
2634 if ((rc = bnx2_enable_nvram_write(bp)) != 0)
2635 goto nvram_write_end;
2636
2637 /* Erase the page */
2638 if ((rc = bnx2_nvram_erase_page(bp, page_start)) != 0)
2639 goto nvram_write_end;
2640
2641 /* Re-enable the write again for the actual write */
2642 bnx2_enable_nvram_write(bp);
2643
2644 /* Loop to write back the buffer data from page_start to
2645 * data_start */
2646 i = 0;
2647 if (bp->flash_info->buffered == 0) {
2648 for (addr = page_start; addr < data_start;
2649 addr += 4, i += 4) {
2650
2651 rc = bnx2_nvram_write_dword(bp, addr,
2652 &flash_buffer[i], cmd_flags);
2653
2654 if (rc != 0)
2655 goto nvram_write_end;
2656
2657 cmd_flags = 0;
2658 }
2659 }
2660
2661 /* Loop to write the new data from data_start to data_end */
2662 for (addr = data_start; addr < data_end; addr += 4, i++) {
2663 if ((addr == page_end - 4) ||
2664 ((bp->flash_info->buffered) &&
2665 (addr == data_end - 4))) {
2666
2667 cmd_flags |= BNX2_NVM_COMMAND_LAST;
2668 }
2669 rc = bnx2_nvram_write_dword(bp, addr, buf,
2670 cmd_flags);
2671
2672 if (rc != 0)
2673 goto nvram_write_end;
2674
2675 cmd_flags = 0;
2676 buf += 4;
2677 }
2678
2679 /* Loop to write back the buffer data from data_end
2680 * to page_end */
2681 if (bp->flash_info->buffered == 0) {
2682 for (addr = data_end; addr < page_end;
2683 addr += 4, i += 4) {
2684
2685 if (addr == page_end-4) {
2686 cmd_flags = BNX2_NVM_COMMAND_LAST;
2687 }
2688 rc = bnx2_nvram_write_dword(bp, addr,
2689 &flash_buffer[i], cmd_flags);
2690
2691 if (rc != 0)
2692 goto nvram_write_end;
2693
2694 cmd_flags = 0;
2695 }
2696 }
2697
2698 /* Disable writes to flash interface (lock write-protect) */
2699 bnx2_disable_nvram_write(bp);
2700
2701 /* Disable access to flash interface */
2702 bnx2_disable_nvram_access(bp);
2703 bnx2_release_nvram_lock(bp);
2704
2705 /* Increment written */
2706 written += data_end - data_start;
2707 }
2708
2709nvram_write_end:
2710 if (align_start || align_end)
2711 kfree(buf);
2712 return rc;
2713}
2714
2715static int
2716bnx2_reset_chip(struct bnx2 *bp, u32 reset_code)
2717{
2718 u32 val;
2719 int i, rc = 0;
2720
2721 /* Wait for the current PCI transaction to complete before
2722 * issuing a reset. */
2723 REG_WR(bp, BNX2_MISC_ENABLE_CLR_BITS,
2724 BNX2_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE |
2725 BNX2_MISC_ENABLE_CLR_BITS_DMA_ENGINE_ENABLE |
2726 BNX2_MISC_ENABLE_CLR_BITS_RX_DMA_ENABLE |
2727 BNX2_MISC_ENABLE_CLR_BITS_HOST_COALESCE_ENABLE);
2728 val = REG_RD(bp, BNX2_MISC_ENABLE_CLR_BITS);
2729 udelay(5);
2730
2731 /* Deposit a driver reset signature so the firmware knows that
2732 * this is a soft reset. */
2733 REG_WR_IND(bp, HOST_VIEW_SHMEM_BASE + BNX2_DRV_RESET_SIGNATURE,
2734 BNX2_DRV_RESET_SIGNATURE_MAGIC);
2735
2736 bp->fw_timed_out = 0;
2737
2738 /* Wait for the firmware to tell us it is ok to issue a reset. */
2739 bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT0 | reset_code);
2740
2741 /* Do a dummy read to force the chip to complete all current transaction
2742 * before we issue a reset. */
2743 val = REG_RD(bp, BNX2_MISC_ID);
2744
2745 val = BNX2_PCICFG_MISC_CONFIG_CORE_RST_REQ |
2746 BNX2_PCICFG_MISC_CONFIG_REG_WINDOW_ENA |
2747 BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP;
2748
2749 /* Chip reset. */
2750 REG_WR(bp, BNX2_PCICFG_MISC_CONFIG, val);
2751
2752 if ((CHIP_ID(bp) == CHIP_ID_5706_A0) ||
2753 (CHIP_ID(bp) == CHIP_ID_5706_A1))
2754 msleep(15);
2755
2756 /* Reset takes approximate 30 usec */
2757 for (i = 0; i < 10; i++) {
2758 val = REG_RD(bp, BNX2_PCICFG_MISC_CONFIG);
2759 if ((val & (BNX2_PCICFG_MISC_CONFIG_CORE_RST_REQ |
2760 BNX2_PCICFG_MISC_CONFIG_CORE_RST_BSY)) == 0) {
2761 break;
2762 }
2763 udelay(10);
2764 }
2765
2766 if (val & (BNX2_PCICFG_MISC_CONFIG_CORE_RST_REQ |
2767 BNX2_PCICFG_MISC_CONFIG_CORE_RST_BSY)) {
2768 printk(KERN_ERR PFX "Chip reset did not complete\n");
2769 return -EBUSY;
2770 }
2771
2772 /* Make sure byte swapping is properly configured. */
2773 val = REG_RD(bp, BNX2_PCI_SWAP_DIAG0);
2774 if (val != 0x01020304) {
2775 printk(KERN_ERR PFX "Chip not in correct endian mode\n");
2776 return -ENODEV;
2777 }
2778
2779 bp->fw_timed_out = 0;
2780
2781 /* Wait for the firmware to finish its initialization. */
2782 bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT1 | reset_code);
2783
2784 if (CHIP_ID(bp) == CHIP_ID_5706_A0) {
2785 /* Adjust the voltage regular to two steps lower. The default
2786 * of this register is 0x0000000e. */
2787 REG_WR(bp, BNX2_MISC_VREG_CONTROL, 0x000000fa);
2788
2789 /* Remove bad rbuf memory from the free pool. */
2790 rc = bnx2_alloc_bad_rbuf(bp);
2791 }
2792
2793 return rc;
2794}
2795
2796static int
2797bnx2_init_chip(struct bnx2 *bp)
2798{
2799 u32 val;
2800
2801 /* Make sure the interrupt is not active. */
2802 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
2803
2804 val = BNX2_DMA_CONFIG_DATA_BYTE_SWAP |
2805 BNX2_DMA_CONFIG_DATA_WORD_SWAP |
2806#ifdef __BIG_ENDIAN
2807 BNX2_DMA_CONFIG_CNTL_BYTE_SWAP |
2808#endif
2809 BNX2_DMA_CONFIG_CNTL_WORD_SWAP |
2810 DMA_READ_CHANS << 12 |
2811 DMA_WRITE_CHANS << 16;
2812
2813 val |= (0x2 << 20) | (1 << 11);
2814
2815 if ((bp->flags & PCIX_FLAG) && (bp->bus_speed_mhz = 133))
2816 val |= (1 << 23);
2817
2818 if ((CHIP_NUM(bp) == CHIP_NUM_5706) &&
2819 (CHIP_ID(bp) != CHIP_ID_5706_A0) && !(bp->flags & PCIX_FLAG))
2820 val |= BNX2_DMA_CONFIG_CNTL_PING_PONG_DMA;
2821
2822 REG_WR(bp, BNX2_DMA_CONFIG, val);
2823
2824 if (CHIP_ID(bp) == CHIP_ID_5706_A0) {
2825 val = REG_RD(bp, BNX2_TDMA_CONFIG);
2826 val |= BNX2_TDMA_CONFIG_ONE_DMA;
2827 REG_WR(bp, BNX2_TDMA_CONFIG, val);
2828 }
2829
2830 if (bp->flags & PCIX_FLAG) {
2831 u16 val16;
2832
2833 pci_read_config_word(bp->pdev, bp->pcix_cap + PCI_X_CMD,
2834 &val16);
2835 pci_write_config_word(bp->pdev, bp->pcix_cap + PCI_X_CMD,
2836 val16 & ~PCI_X_CMD_ERO);
2837 }
2838
2839 REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
2840 BNX2_MISC_ENABLE_SET_BITS_HOST_COALESCE_ENABLE |
2841 BNX2_MISC_ENABLE_STATUS_BITS_RX_V2P_ENABLE |
2842 BNX2_MISC_ENABLE_STATUS_BITS_CONTEXT_ENABLE);
2843
2844 /* Initialize context mapping and zero out the quick contexts. The
2845 * context block must have already been enabled. */
2846 bnx2_init_context(bp);
2847
2848 bnx2_init_cpus(bp);
2849 bnx2_init_nvram(bp);
2850
2851 bnx2_set_mac_addr(bp);
2852
2853 val = REG_RD(bp, BNX2_MQ_CONFIG);
2854 val &= ~BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE;
2855 val |= BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE_256;
2856 REG_WR(bp, BNX2_MQ_CONFIG, val);
2857
2858 val = 0x10000 + (MAX_CID_CNT * MB_KERNEL_CTX_SIZE);
2859 REG_WR(bp, BNX2_MQ_KNL_BYP_WIND_START, val);
2860 REG_WR(bp, BNX2_MQ_KNL_WIND_END, val);
2861
2862 val = (BCM_PAGE_BITS - 8) << 24;
2863 REG_WR(bp, BNX2_RV2P_CONFIG, val);
2864
2865 /* Configure page size. */
2866 val = REG_RD(bp, BNX2_TBDR_CONFIG);
2867 val &= ~BNX2_TBDR_CONFIG_PAGE_SIZE;
2868 val |= (BCM_PAGE_BITS - 8) << 24 | 0x40;
2869 REG_WR(bp, BNX2_TBDR_CONFIG, val);
2870
2871 val = bp->mac_addr[0] +
2872 (bp->mac_addr[1] << 8) +
2873 (bp->mac_addr[2] << 16) +
2874 bp->mac_addr[3] +
2875 (bp->mac_addr[4] << 8) +
2876 (bp->mac_addr[5] << 16);
2877 REG_WR(bp, BNX2_EMAC_BACKOFF_SEED, val);
2878
2879 /* Program the MTU. Also include 4 bytes for CRC32. */
2880 val = bp->dev->mtu + ETH_HLEN + 4;
2881 if (val > (MAX_ETHERNET_PACKET_SIZE + 4))
2882 val |= BNX2_EMAC_RX_MTU_SIZE_JUMBO_ENA;
2883 REG_WR(bp, BNX2_EMAC_RX_MTU_SIZE, val);
2884
2885 bp->last_status_idx = 0;
2886 bp->rx_mode = BNX2_EMAC_RX_MODE_SORT_MODE;
2887
2888 /* Set up how to generate a link change interrupt. */
2889 REG_WR(bp, BNX2_EMAC_ATTENTION_ENA, BNX2_EMAC_ATTENTION_ENA_LINK);
2890
2891 REG_WR(bp, BNX2_HC_STATUS_ADDR_L,
2892 (u64) bp->status_blk_mapping & 0xffffffff);
2893 REG_WR(bp, BNX2_HC_STATUS_ADDR_H, (u64) bp->status_blk_mapping >> 32);
2894
2895 REG_WR(bp, BNX2_HC_STATISTICS_ADDR_L,
2896 (u64) bp->stats_blk_mapping & 0xffffffff);
2897 REG_WR(bp, BNX2_HC_STATISTICS_ADDR_H,
2898 (u64) bp->stats_blk_mapping >> 32);
2899
2900 REG_WR(bp, BNX2_HC_TX_QUICK_CONS_TRIP,
2901 (bp->tx_quick_cons_trip_int << 16) | bp->tx_quick_cons_trip);
2902
2903 REG_WR(bp, BNX2_HC_RX_QUICK_CONS_TRIP,
2904 (bp->rx_quick_cons_trip_int << 16) | bp->rx_quick_cons_trip);
2905
2906 REG_WR(bp, BNX2_HC_COMP_PROD_TRIP,
2907 (bp->comp_prod_trip_int << 16) | bp->comp_prod_trip);
2908
2909 REG_WR(bp, BNX2_HC_TX_TICKS, (bp->tx_ticks_int << 16) | bp->tx_ticks);
2910
2911 REG_WR(bp, BNX2_HC_RX_TICKS, (bp->rx_ticks_int << 16) | bp->rx_ticks);
2912
2913 REG_WR(bp, BNX2_HC_COM_TICKS,
2914 (bp->com_ticks_int << 16) | bp->com_ticks);
2915
2916 REG_WR(bp, BNX2_HC_CMD_TICKS,
2917 (bp->cmd_ticks_int << 16) | bp->cmd_ticks);
2918
2919 REG_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks & 0xffff00);
2920 REG_WR(bp, BNX2_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */
2921
2922 if (CHIP_ID(bp) == CHIP_ID_5706_A1)
2923 REG_WR(bp, BNX2_HC_CONFIG, BNX2_HC_CONFIG_COLLECT_STATS);
2924 else {
2925 REG_WR(bp, BNX2_HC_CONFIG, BNX2_HC_CONFIG_RX_TMR_MODE |
2926 BNX2_HC_CONFIG_TX_TMR_MODE |
2927 BNX2_HC_CONFIG_COLLECT_STATS);
2928 }
2929
2930 /* Clear internal stats counters. */
2931 REG_WR(bp, BNX2_HC_COMMAND, BNX2_HC_COMMAND_CLR_STAT_NOW);
2932
2933 REG_WR(bp, BNX2_HC_ATTN_BITS_ENABLE, STATUS_ATTN_BITS_LINK_STATE);
2934
2935 /* Initialize the receive filter. */
2936 bnx2_set_rx_mode(bp->dev);
2937
2938 bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT2 | BNX2_DRV_MSG_CODE_RESET);
2939
2940 REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS, 0x5ffffff);
2941 REG_RD(bp, BNX2_MISC_ENABLE_SET_BITS);
2942
2943 udelay(20);
2944
2945 return 0;
2946}
2947
2948
2949static void
2950bnx2_init_tx_ring(struct bnx2 *bp)
2951{
2952 struct tx_bd *txbd;
2953 u32 val;
2954
2955 txbd = &bp->tx_desc_ring[MAX_TX_DESC_CNT];
2956
2957 txbd->tx_bd_haddr_hi = (u64) bp->tx_desc_mapping >> 32;
2958 txbd->tx_bd_haddr_lo = (u64) bp->tx_desc_mapping & 0xffffffff;
2959
2960 bp->tx_prod = 0;
2961 bp->tx_cons = 0;
2962 bp->tx_prod_bseq = 0;
2963 atomic_set(&bp->tx_avail_bd, bp->tx_ring_size);
2964
2965 val = BNX2_L2CTX_TYPE_TYPE_L2;
2966 val |= BNX2_L2CTX_TYPE_SIZE_L2;
2967 CTX_WR(bp, GET_CID_ADDR(TX_CID), BNX2_L2CTX_TYPE, val);
2968
2969 val = BNX2_L2CTX_CMD_TYPE_TYPE_L2;
2970 val |= 8 << 16;
2971 CTX_WR(bp, GET_CID_ADDR(TX_CID), BNX2_L2CTX_CMD_TYPE, val);
2972
2973 val = (u64) bp->tx_desc_mapping >> 32;
2974 CTX_WR(bp, GET_CID_ADDR(TX_CID), BNX2_L2CTX_TBDR_BHADDR_HI, val);
2975
2976 val = (u64) bp->tx_desc_mapping & 0xffffffff;
2977 CTX_WR(bp, GET_CID_ADDR(TX_CID), BNX2_L2CTX_TBDR_BHADDR_LO, val);
2978}
2979
2980static void
2981bnx2_init_rx_ring(struct bnx2 *bp)
2982{
2983 struct rx_bd *rxbd;
2984 int i;
2985 u16 prod, ring_prod;
2986 u32 val;
2987
2988 /* 8 for CRC and VLAN */
2989 bp->rx_buf_use_size = bp->dev->mtu + ETH_HLEN + bp->rx_offset + 8;
2990 /* 8 for alignment */
2991 bp->rx_buf_size = bp->rx_buf_use_size + 8;
2992
2993 ring_prod = prod = bp->rx_prod = 0;
2994 bp->rx_cons = 0;
2995 bp->rx_prod_bseq = 0;
2996
2997 rxbd = &bp->rx_desc_ring[0];
2998 for (i = 0; i < MAX_RX_DESC_CNT; i++, rxbd++) {
2999 rxbd->rx_bd_len = bp->rx_buf_use_size;
3000 rxbd->rx_bd_flags = RX_BD_FLAGS_START | RX_BD_FLAGS_END;
3001 }
3002
3003 rxbd->rx_bd_haddr_hi = (u64) bp->rx_desc_mapping >> 32;
3004 rxbd->rx_bd_haddr_lo = (u64) bp->rx_desc_mapping & 0xffffffff;
3005
3006 val = BNX2_L2CTX_CTX_TYPE_CTX_BD_CHN_TYPE_VALUE;
3007 val |= BNX2_L2CTX_CTX_TYPE_SIZE_L2;
3008 val |= 0x02 << 8;
3009 CTX_WR(bp, GET_CID_ADDR(RX_CID), BNX2_L2CTX_CTX_TYPE, val);
3010
3011 val = (u64) bp->rx_desc_mapping >> 32;
3012 CTX_WR(bp, GET_CID_ADDR(RX_CID), BNX2_L2CTX_NX_BDHADDR_HI, val);
3013
3014 val = (u64) bp->rx_desc_mapping & 0xffffffff;
3015 CTX_WR(bp, GET_CID_ADDR(RX_CID), BNX2_L2CTX_NX_BDHADDR_LO, val);
3016
3017 for ( ;ring_prod < bp->rx_ring_size; ) {
3018 if (bnx2_alloc_rx_skb(bp, ring_prod) < 0) {
3019 break;
3020 }
3021 prod = NEXT_RX_BD(prod);
3022 ring_prod = RX_RING_IDX(prod);
3023 }
3024 bp->rx_prod = prod;
3025
3026 REG_WR16(bp, MB_RX_CID_ADDR + BNX2_L2CTX_HOST_BDIDX, prod);
3027
3028 REG_WR(bp, MB_RX_CID_ADDR + BNX2_L2CTX_HOST_BSEQ, bp->rx_prod_bseq);
3029}
3030
3031static void
3032bnx2_free_tx_skbs(struct bnx2 *bp)
3033{
3034 int i;
3035
3036 if (bp->tx_buf_ring == NULL)
3037 return;
3038
3039 for (i = 0; i < TX_DESC_CNT; ) {
3040 struct sw_bd *tx_buf = &bp->tx_buf_ring[i];
3041 struct sk_buff *skb = tx_buf->skb;
3042 int j, last;
3043
3044 if (skb == NULL) {
3045 i++;
3046 continue;
3047 }
3048
3049 pci_unmap_single(bp->pdev, pci_unmap_addr(tx_buf, mapping),
3050 skb_headlen(skb), PCI_DMA_TODEVICE);
3051
3052 tx_buf->skb = NULL;
3053
3054 last = skb_shinfo(skb)->nr_frags;
3055 for (j = 0; j < last; j++) {
3056 tx_buf = &bp->tx_buf_ring[i + j + 1];
3057 pci_unmap_page(bp->pdev,
3058 pci_unmap_addr(tx_buf, mapping),
3059 skb_shinfo(skb)->frags[j].size,
3060 PCI_DMA_TODEVICE);
3061 }
3062 dev_kfree_skb_any(skb);
3063 i += j + 1;
3064 }
3065
3066}
3067
3068static void
3069bnx2_free_rx_skbs(struct bnx2 *bp)
3070{
3071 int i;
3072
3073 if (bp->rx_buf_ring == NULL)
3074 return;
3075
3076 for (i = 0; i < RX_DESC_CNT; i++) {
3077 struct sw_bd *rx_buf = &bp->rx_buf_ring[i];
3078 struct sk_buff *skb = rx_buf->skb;
3079
3080 if (skb == 0)
3081 continue;
3082
3083 pci_unmap_single(bp->pdev, pci_unmap_addr(rx_buf, mapping),
3084 bp->rx_buf_use_size, PCI_DMA_FROMDEVICE);
3085
3086 rx_buf->skb = NULL;
3087
3088 dev_kfree_skb_any(skb);
3089 }
3090}
3091
3092static void
3093bnx2_free_skbs(struct bnx2 *bp)
3094{
3095 bnx2_free_tx_skbs(bp);
3096 bnx2_free_rx_skbs(bp);
3097}
3098
3099static int
3100bnx2_reset_nic(struct bnx2 *bp, u32 reset_code)
3101{
3102 int rc;
3103
3104 rc = bnx2_reset_chip(bp, reset_code);
3105 bnx2_free_skbs(bp);
3106 if (rc)
3107 return rc;
3108
3109 bnx2_init_chip(bp);
3110 bnx2_init_tx_ring(bp);
3111 bnx2_init_rx_ring(bp);
3112 return 0;
3113}
3114
3115static int
3116bnx2_init_nic(struct bnx2 *bp)
3117{
3118 int rc;
3119
3120 if ((rc = bnx2_reset_nic(bp, BNX2_DRV_MSG_CODE_RESET)) != 0)
3121 return rc;
3122
3123 bnx2_init_phy(bp);
3124 bnx2_set_link(bp);
3125 return 0;
3126}
3127
3128static int
3129bnx2_test_registers(struct bnx2 *bp)
3130{
3131 int ret;
3132 int i;
3133 static struct {
3134 u16 offset;
3135 u16 flags;
3136 u32 rw_mask;
3137 u32 ro_mask;
3138 } reg_tbl[] = {
3139 { 0x006c, 0, 0x00000000, 0x0000003f },
3140 { 0x0090, 0, 0xffffffff, 0x00000000 },
3141 { 0x0094, 0, 0x00000000, 0x00000000 },
3142
3143 { 0x0404, 0, 0x00003f00, 0x00000000 },
3144 { 0x0418, 0, 0x00000000, 0xffffffff },
3145 { 0x041c, 0, 0x00000000, 0xffffffff },
3146 { 0x0420, 0, 0x00000000, 0x80ffffff },
3147 { 0x0424, 0, 0x00000000, 0x00000000 },
3148 { 0x0428, 0, 0x00000000, 0x00000001 },
3149 { 0x0450, 0, 0x00000000, 0x0000ffff },
3150 { 0x0454, 0, 0x00000000, 0xffffffff },
3151 { 0x0458, 0, 0x00000000, 0xffffffff },
3152
3153 { 0x0808, 0, 0x00000000, 0xffffffff },
3154 { 0x0854, 0, 0x00000000, 0xffffffff },
3155 { 0x0868, 0, 0x00000000, 0x77777777 },
3156 { 0x086c, 0, 0x00000000, 0x77777777 },
3157 { 0x0870, 0, 0x00000000, 0x77777777 },
3158 { 0x0874, 0, 0x00000000, 0x77777777 },
3159
3160 { 0x0c00, 0, 0x00000000, 0x00000001 },
3161 { 0x0c04, 0, 0x00000000, 0x03ff0001 },
3162 { 0x0c08, 0, 0x0f0ff073, 0x00000000 },
3163 { 0x0c0c, 0, 0x00ffffff, 0x00000000 },
3164 { 0x0c30, 0, 0x00000000, 0xffffffff },
3165 { 0x0c34, 0, 0x00000000, 0xffffffff },
3166 { 0x0c38, 0, 0x00000000, 0xffffffff },
3167 { 0x0c3c, 0, 0x00000000, 0xffffffff },
3168 { 0x0c40, 0, 0x00000000, 0xffffffff },
3169 { 0x0c44, 0, 0x00000000, 0xffffffff },
3170 { 0x0c48, 0, 0x00000000, 0x0007ffff },
3171 { 0x0c4c, 0, 0x00000000, 0xffffffff },
3172 { 0x0c50, 0, 0x00000000, 0xffffffff },
3173 { 0x0c54, 0, 0x00000000, 0xffffffff },
3174 { 0x0c58, 0, 0x00000000, 0xffffffff },
3175 { 0x0c5c, 0, 0x00000000, 0xffffffff },
3176 { 0x0c60, 0, 0x00000000, 0xffffffff },
3177 { 0x0c64, 0, 0x00000000, 0xffffffff },
3178 { 0x0c68, 0, 0x00000000, 0xffffffff },
3179 { 0x0c6c, 0, 0x00000000, 0xffffffff },
3180 { 0x0c70, 0, 0x00000000, 0xffffffff },
3181 { 0x0c74, 0, 0x00000000, 0xffffffff },
3182 { 0x0c78, 0, 0x00000000, 0xffffffff },
3183 { 0x0c7c, 0, 0x00000000, 0xffffffff },
3184 { 0x0c80, 0, 0x00000000, 0xffffffff },
3185 { 0x0c84, 0, 0x00000000, 0xffffffff },
3186 { 0x0c88, 0, 0x00000000, 0xffffffff },
3187 { 0x0c8c, 0, 0x00000000, 0xffffffff },
3188 { 0x0c90, 0, 0x00000000, 0xffffffff },
3189 { 0x0c94, 0, 0x00000000, 0xffffffff },
3190 { 0x0c98, 0, 0x00000000, 0xffffffff },
3191 { 0x0c9c, 0, 0x00000000, 0xffffffff },
3192 { 0x0ca0, 0, 0x00000000, 0xffffffff },
3193 { 0x0ca4, 0, 0x00000000, 0xffffffff },
3194 { 0x0ca8, 0, 0x00000000, 0x0007ffff },
3195 { 0x0cac, 0, 0x00000000, 0xffffffff },
3196 { 0x0cb0, 0, 0x00000000, 0xffffffff },
3197 { 0x0cb4, 0, 0x00000000, 0xffffffff },
3198 { 0x0cb8, 0, 0x00000000, 0xffffffff },
3199 { 0x0cbc, 0, 0x00000000, 0xffffffff },
3200 { 0x0cc0, 0, 0x00000000, 0xffffffff },
3201 { 0x0cc4, 0, 0x00000000, 0xffffffff },
3202 { 0x0cc8, 0, 0x00000000, 0xffffffff },
3203 { 0x0ccc, 0, 0x00000000, 0xffffffff },
3204 { 0x0cd0, 0, 0x00000000, 0xffffffff },
3205 { 0x0cd4, 0, 0x00000000, 0xffffffff },
3206 { 0x0cd8, 0, 0x00000000, 0xffffffff },
3207 { 0x0cdc, 0, 0x00000000, 0xffffffff },
3208 { 0x0ce0, 0, 0x00000000, 0xffffffff },
3209 { 0x0ce4, 0, 0x00000000, 0xffffffff },
3210 { 0x0ce8, 0, 0x00000000, 0xffffffff },
3211 { 0x0cec, 0, 0x00000000, 0xffffffff },
3212 { 0x0cf0, 0, 0x00000000, 0xffffffff },
3213 { 0x0cf4, 0, 0x00000000, 0xffffffff },
3214 { 0x0cf8, 0, 0x00000000, 0xffffffff },
3215 { 0x0cfc, 0, 0x00000000, 0xffffffff },
3216 { 0x0d00, 0, 0x00000000, 0xffffffff },
3217 { 0x0d04, 0, 0x00000000, 0xffffffff },
3218
3219 { 0x1000, 0, 0x00000000, 0x00000001 },
3220 { 0x1004, 0, 0x00000000, 0x000f0001 },
3221 { 0x1044, 0, 0x00000000, 0xffc003ff },
3222 { 0x1080, 0, 0x00000000, 0x0001ffff },
3223 { 0x1084, 0, 0x00000000, 0xffffffff },
3224 { 0x1088, 0, 0x00000000, 0xffffffff },
3225 { 0x108c, 0, 0x00000000, 0xffffffff },
3226 { 0x1090, 0, 0x00000000, 0xffffffff },
3227 { 0x1094, 0, 0x00000000, 0xffffffff },
3228 { 0x1098, 0, 0x00000000, 0xffffffff },
3229 { 0x109c, 0, 0x00000000, 0xffffffff },
3230 { 0x10a0, 0, 0x00000000, 0xffffffff },
3231
3232 { 0x1408, 0, 0x01c00800, 0x00000000 },
3233 { 0x149c, 0, 0x8000ffff, 0x00000000 },
3234 { 0x14a8, 0, 0x00000000, 0x000001ff },
3235 { 0x14ac, 0, 0x4fffffff, 0x10000000 },
3236 { 0x14b0, 0, 0x00000002, 0x00000001 },
3237 { 0x14b8, 0, 0x00000000, 0x00000000 },
3238 { 0x14c0, 0, 0x00000000, 0x00000009 },
3239 { 0x14c4, 0, 0x00003fff, 0x00000000 },
3240 { 0x14cc, 0, 0x00000000, 0x00000001 },
3241 { 0x14d0, 0, 0xffffffff, 0x00000000 },
3242 { 0x1500, 0, 0x00000000, 0xffffffff },
3243 { 0x1504, 0, 0x00000000, 0xffffffff },
3244 { 0x1508, 0, 0x00000000, 0xffffffff },
3245 { 0x150c, 0, 0x00000000, 0xffffffff },
3246 { 0x1510, 0, 0x00000000, 0xffffffff },
3247 { 0x1514, 0, 0x00000000, 0xffffffff },
3248 { 0x1518, 0, 0x00000000, 0xffffffff },
3249 { 0x151c, 0, 0x00000000, 0xffffffff },
3250 { 0x1520, 0, 0x00000000, 0xffffffff },
3251 { 0x1524, 0, 0x00000000, 0xffffffff },
3252 { 0x1528, 0, 0x00000000, 0xffffffff },
3253 { 0x152c, 0, 0x00000000, 0xffffffff },
3254 { 0x1530, 0, 0x00000000, 0xffffffff },
3255 { 0x1534, 0, 0x00000000, 0xffffffff },
3256 { 0x1538, 0, 0x00000000, 0xffffffff },
3257 { 0x153c, 0, 0x00000000, 0xffffffff },
3258 { 0x1540, 0, 0x00000000, 0xffffffff },
3259 { 0x1544, 0, 0x00000000, 0xffffffff },
3260 { 0x1548, 0, 0x00000000, 0xffffffff },
3261 { 0x154c, 0, 0x00000000, 0xffffffff },
3262 { 0x1550, 0, 0x00000000, 0xffffffff },
3263 { 0x1554, 0, 0x00000000, 0xffffffff },
3264 { 0x1558, 0, 0x00000000, 0xffffffff },
3265 { 0x1600, 0, 0x00000000, 0xffffffff },
3266 { 0x1604, 0, 0x00000000, 0xffffffff },
3267 { 0x1608, 0, 0x00000000, 0xffffffff },
3268 { 0x160c, 0, 0x00000000, 0xffffffff },
3269 { 0x1610, 0, 0x00000000, 0xffffffff },
3270 { 0x1614, 0, 0x00000000, 0xffffffff },
3271 { 0x1618, 0, 0x00000000, 0xffffffff },
3272 { 0x161c, 0, 0x00000000, 0xffffffff },
3273 { 0x1620, 0, 0x00000000, 0xffffffff },
3274 { 0x1624, 0, 0x00000000, 0xffffffff },
3275 { 0x1628, 0, 0x00000000, 0xffffffff },
3276 { 0x162c, 0, 0x00000000, 0xffffffff },
3277 { 0x1630, 0, 0x00000000, 0xffffffff },
3278 { 0x1634, 0, 0x00000000, 0xffffffff },
3279 { 0x1638, 0, 0x00000000, 0xffffffff },
3280 { 0x163c, 0, 0x00000000, 0xffffffff },
3281 { 0x1640, 0, 0x00000000, 0xffffffff },
3282 { 0x1644, 0, 0x00000000, 0xffffffff },
3283 { 0x1648, 0, 0x00000000, 0xffffffff },
3284 { 0x164c, 0, 0x00000000, 0xffffffff },
3285 { 0x1650, 0, 0x00000000, 0xffffffff },
3286 { 0x1654, 0, 0x00000000, 0xffffffff },
3287
3288 { 0x1800, 0, 0x00000000, 0x00000001 },
3289 { 0x1804, 0, 0x00000000, 0x00000003 },
3290 { 0x1840, 0, 0x00000000, 0xffffffff },
3291 { 0x1844, 0, 0x00000000, 0xffffffff },
3292 { 0x1848, 0, 0x00000000, 0xffffffff },
3293 { 0x184c, 0, 0x00000000, 0xffffffff },
3294 { 0x1850, 0, 0x00000000, 0xffffffff },
3295 { 0x1900, 0, 0x7ffbffff, 0x00000000 },
3296 { 0x1904, 0, 0xffffffff, 0x00000000 },
3297 { 0x190c, 0, 0xffffffff, 0x00000000 },
3298 { 0x1914, 0, 0xffffffff, 0x00000000 },
3299 { 0x191c, 0, 0xffffffff, 0x00000000 },
3300 { 0x1924, 0, 0xffffffff, 0x00000000 },
3301 { 0x192c, 0, 0xffffffff, 0x00000000 },
3302 { 0x1934, 0, 0xffffffff, 0x00000000 },
3303 { 0x193c, 0, 0xffffffff, 0x00000000 },
3304 { 0x1944, 0, 0xffffffff, 0x00000000 },
3305 { 0x194c, 0, 0xffffffff, 0x00000000 },
3306 { 0x1954, 0, 0xffffffff, 0x00000000 },
3307 { 0x195c, 0, 0xffffffff, 0x00000000 },
3308 { 0x1964, 0, 0xffffffff, 0x00000000 },
3309 { 0x196c, 0, 0xffffffff, 0x00000000 },
3310 { 0x1974, 0, 0xffffffff, 0x00000000 },
3311 { 0x197c, 0, 0xffffffff, 0x00000000 },
3312 { 0x1980, 0, 0x0700ffff, 0x00000000 },
3313
3314 { 0x1c00, 0, 0x00000000, 0x00000001 },
3315 { 0x1c04, 0, 0x00000000, 0x00000003 },
3316 { 0x1c08, 0, 0x0000000f, 0x00000000 },
3317 { 0x1c40, 0, 0x00000000, 0xffffffff },
3318 { 0x1c44, 0, 0x00000000, 0xffffffff },
3319 { 0x1c48, 0, 0x00000000, 0xffffffff },
3320 { 0x1c4c, 0, 0x00000000, 0xffffffff },
3321 { 0x1c50, 0, 0x00000000, 0xffffffff },
3322 { 0x1d00, 0, 0x7ffbffff, 0x00000000 },
3323 { 0x1d04, 0, 0xffffffff, 0x00000000 },
3324 { 0x1d0c, 0, 0xffffffff, 0x00000000 },
3325 { 0x1d14, 0, 0xffffffff, 0x00000000 },
3326 { 0x1d1c, 0, 0xffffffff, 0x00000000 },
3327 { 0x1d24, 0, 0xffffffff, 0x00000000 },
3328 { 0x1d2c, 0, 0xffffffff, 0x00000000 },
3329 { 0x1d34, 0, 0xffffffff, 0x00000000 },
3330 { 0x1d3c, 0, 0xffffffff, 0x00000000 },
3331 { 0x1d44, 0, 0xffffffff, 0x00000000 },
3332 { 0x1d4c, 0, 0xffffffff, 0x00000000 },
3333 { 0x1d54, 0, 0xffffffff, 0x00000000 },
3334 { 0x1d5c, 0, 0xffffffff, 0x00000000 },
3335 { 0x1d64, 0, 0xffffffff, 0x00000000 },
3336 { 0x1d6c, 0, 0xffffffff, 0x00000000 },
3337 { 0x1d74, 0, 0xffffffff, 0x00000000 },
3338 { 0x1d7c, 0, 0xffffffff, 0x00000000 },
3339 { 0x1d80, 0, 0x0700ffff, 0x00000000 },
3340
3341 { 0x2004, 0, 0x00000000, 0x0337000f },
3342 { 0x2008, 0, 0xffffffff, 0x00000000 },
3343 { 0x200c, 0, 0xffffffff, 0x00000000 },
3344 { 0x2010, 0, 0xffffffff, 0x00000000 },
3345 { 0x2014, 0, 0x801fff80, 0x00000000 },
3346 { 0x2018, 0, 0x000003ff, 0x00000000 },
3347
3348 { 0x2800, 0, 0x00000000, 0x00000001 },
3349 { 0x2804, 0, 0x00000000, 0x00003f01 },
3350 { 0x2808, 0, 0x0f3f3f03, 0x00000000 },
3351 { 0x2810, 0, 0xffff0000, 0x00000000 },
3352 { 0x2814, 0, 0xffff0000, 0x00000000 },
3353 { 0x2818, 0, 0xffff0000, 0x00000000 },
3354 { 0x281c, 0, 0xffff0000, 0x00000000 },
3355 { 0x2834, 0, 0xffffffff, 0x00000000 },
3356 { 0x2840, 0, 0x00000000, 0xffffffff },
3357 { 0x2844, 0, 0x00000000, 0xffffffff },
3358 { 0x2848, 0, 0xffffffff, 0x00000000 },
3359 { 0x284c, 0, 0xf800f800, 0x07ff07ff },
3360
3361 { 0x2c00, 0, 0x00000000, 0x00000011 },
3362 { 0x2c04, 0, 0x00000000, 0x00030007 },
3363
3364 { 0x3000, 0, 0x00000000, 0x00000001 },
3365 { 0x3004, 0, 0x00000000, 0x007007ff },
3366 { 0x3008, 0, 0x00000003, 0x00000000 },
3367 { 0x300c, 0, 0xffffffff, 0x00000000 },
3368 { 0x3010, 0, 0xffffffff, 0x00000000 },
3369 { 0x3014, 0, 0xffffffff, 0x00000000 },
3370 { 0x3034, 0, 0xffffffff, 0x00000000 },
3371 { 0x3038, 0, 0xffffffff, 0x00000000 },
3372 { 0x3050, 0, 0x00000001, 0x00000000 },
3373
3374 { 0x3c00, 0, 0x00000000, 0x00000001 },
3375 { 0x3c04, 0, 0x00000000, 0x00070000 },
3376 { 0x3c08, 0, 0x00007f71, 0x07f00000 },
3377 { 0x3c0c, 0, 0x1f3ffffc, 0x00000000 },
3378 { 0x3c10, 0, 0xffffffff, 0x00000000 },
3379 { 0x3c14, 0, 0x00000000, 0xffffffff },
3380 { 0x3c18, 0, 0x00000000, 0xffffffff },
3381 { 0x3c1c, 0, 0xfffff000, 0x00000000 },
3382 { 0x3c20, 0, 0xffffff00, 0x00000000 },
3383 { 0x3c24, 0, 0xffffffff, 0x00000000 },
3384 { 0x3c28, 0, 0xffffffff, 0x00000000 },
3385 { 0x3c2c, 0, 0xffffffff, 0x00000000 },
3386 { 0x3c30, 0, 0xffffffff, 0x00000000 },
3387 { 0x3c34, 0, 0xffffffff, 0x00000000 },
3388 { 0x3c38, 0, 0xffffffff, 0x00000000 },
3389 { 0x3c3c, 0, 0xffffffff, 0x00000000 },
3390 { 0x3c40, 0, 0xffffffff, 0x00000000 },
3391 { 0x3c44, 0, 0xffffffff, 0x00000000 },
3392 { 0x3c48, 0, 0xffffffff, 0x00000000 },
3393 { 0x3c4c, 0, 0xffffffff, 0x00000000 },
3394 { 0x3c50, 0, 0xffffffff, 0x00000000 },
3395 { 0x3c54, 0, 0xffffffff, 0x00000000 },
3396 { 0x3c58, 0, 0xffffffff, 0x00000000 },
3397 { 0x3c5c, 0, 0xffffffff, 0x00000000 },
3398 { 0x3c60, 0, 0xffffffff, 0x00000000 },
3399 { 0x3c64, 0, 0xffffffff, 0x00000000 },
3400 { 0x3c68, 0, 0xffffffff, 0x00000000 },
3401 { 0x3c6c, 0, 0xffffffff, 0x00000000 },
3402 { 0x3c70, 0, 0xffffffff, 0x00000000 },
3403 { 0x3c74, 0, 0x0000003f, 0x00000000 },
3404 { 0x3c78, 0, 0x00000000, 0x00000000 },
3405 { 0x3c7c, 0, 0x00000000, 0x00000000 },
3406 { 0x3c80, 0, 0x3fffffff, 0x00000000 },
3407 { 0x3c84, 0, 0x0000003f, 0x00000000 },
3408 { 0x3c88, 0, 0x00000000, 0xffffffff },
3409 { 0x3c8c, 0, 0x00000000, 0xffffffff },
3410
3411 { 0x4000, 0, 0x00000000, 0x00000001 },
3412 { 0x4004, 0, 0x00000000, 0x00030000 },
3413 { 0x4008, 0, 0x00000ff0, 0x00000000 },
3414 { 0x400c, 0, 0xffffffff, 0x00000000 },
3415 { 0x4088, 0, 0x00000000, 0x00070303 },
3416
3417 { 0x4400, 0, 0x00000000, 0x00000001 },
3418 { 0x4404, 0, 0x00000000, 0x00003f01 },
3419 { 0x4408, 0, 0x7fff00ff, 0x00000000 },
3420 { 0x440c, 0, 0xffffffff, 0x00000000 },
3421 { 0x4410, 0, 0xffff, 0x0000 },
3422 { 0x4414, 0, 0xffff, 0x0000 },
3423 { 0x4418, 0, 0xffff, 0x0000 },
3424 { 0x441c, 0, 0xffff, 0x0000 },
3425 { 0x4428, 0, 0xffffffff, 0x00000000 },
3426 { 0x442c, 0, 0xffffffff, 0x00000000 },
3427 { 0x4430, 0, 0xffffffff, 0x00000000 },
3428 { 0x4434, 0, 0xffffffff, 0x00000000 },
3429 { 0x4438, 0, 0xffffffff, 0x00000000 },
3430 { 0x443c, 0, 0xffffffff, 0x00000000 },
3431 { 0x4440, 0, 0xffffffff, 0x00000000 },
3432 { 0x4444, 0, 0xffffffff, 0x00000000 },
3433
3434 { 0x4c00, 0, 0x00000000, 0x00000001 },
3435 { 0x4c04, 0, 0x00000000, 0x0000003f },
3436 { 0x4c08, 0, 0xffffffff, 0x00000000 },
3437 { 0x4c0c, 0, 0x0007fc00, 0x00000000 },
3438 { 0x4c10, 0, 0x80003fe0, 0x00000000 },
3439 { 0x4c14, 0, 0xffffffff, 0x00000000 },
3440 { 0x4c44, 0, 0x00000000, 0x9fff9fff },
3441 { 0x4c48, 0, 0x00000000, 0xb3009fff },
3442 { 0x4c4c, 0, 0x00000000, 0x77f33b30 },
3443 { 0x4c50, 0, 0x00000000, 0xffffffff },
3444
3445 { 0x5004, 0, 0x00000000, 0x0000007f },
3446 { 0x5008, 0, 0x0f0007ff, 0x00000000 },
3447 { 0x500c, 0, 0xf800f800, 0x07ff07ff },
3448
3449 { 0x5400, 0, 0x00000008, 0x00000001 },
3450 { 0x5404, 0, 0x00000000, 0x0000003f },
3451 { 0x5408, 0, 0x0000001f, 0x00000000 },
3452 { 0x540c, 0, 0xffffffff, 0x00000000 },
3453 { 0x5410, 0, 0xffffffff, 0x00000000 },
3454 { 0x5414, 0, 0x0000ffff, 0x00000000 },
3455 { 0x5418, 0, 0x0000ffff, 0x00000000 },
3456 { 0x541c, 0, 0x0000ffff, 0x00000000 },
3457 { 0x5420, 0, 0x0000ffff, 0x00000000 },
3458 { 0x5428, 0, 0x000000ff, 0x00000000 },
3459 { 0x542c, 0, 0xff00ffff, 0x00000000 },
3460 { 0x5430, 0, 0x001fff80, 0x00000000 },
3461 { 0x5438, 0, 0xffffffff, 0x00000000 },
3462 { 0x543c, 0, 0xffffffff, 0x00000000 },
3463 { 0x5440, 0, 0xf800f800, 0x07ff07ff },
3464
3465 { 0x5c00, 0, 0x00000000, 0x00000001 },
3466 { 0x5c04, 0, 0x00000000, 0x0003000f },
3467 { 0x5c08, 0, 0x00000003, 0x00000000 },
3468 { 0x5c0c, 0, 0x0000fff8, 0x00000000 },
3469 { 0x5c10, 0, 0x00000000, 0xffffffff },
3470 { 0x5c80, 0, 0x00000000, 0x0f7113f1 },
3471 { 0x5c84, 0, 0x00000000, 0x0000f333 },
3472 { 0x5c88, 0, 0x00000000, 0x00077373 },
3473 { 0x5c8c, 0, 0x00000000, 0x0007f737 },
3474
3475 { 0x6808, 0, 0x0000ff7f, 0x00000000 },
3476 { 0x680c, 0, 0xffffffff, 0x00000000 },
3477 { 0x6810, 0, 0xffffffff, 0x00000000 },
3478 { 0x6814, 0, 0xffffffff, 0x00000000 },
3479 { 0x6818, 0, 0xffffffff, 0x00000000 },
3480 { 0x681c, 0, 0xffffffff, 0x00000000 },
3481 { 0x6820, 0, 0x00ff00ff, 0x00000000 },
3482 { 0x6824, 0, 0x00ff00ff, 0x00000000 },
3483 { 0x6828, 0, 0x00ff00ff, 0x00000000 },
3484 { 0x682c, 0, 0x03ff03ff, 0x00000000 },
3485 { 0x6830, 0, 0x03ff03ff, 0x00000000 },
3486 { 0x6834, 0, 0x03ff03ff, 0x00000000 },
3487 { 0x6838, 0, 0x03ff03ff, 0x00000000 },
3488 { 0x683c, 0, 0x0000ffff, 0x00000000 },
3489 { 0x6840, 0, 0x00000ff0, 0x00000000 },
3490 { 0x6844, 0, 0x00ffff00, 0x00000000 },
3491 { 0x684c, 0, 0xffffffff, 0x00000000 },
3492 { 0x6850, 0, 0x7f7f7f7f, 0x00000000 },
3493 { 0x6854, 0, 0x7f7f7f7f, 0x00000000 },
3494 { 0x6858, 0, 0x7f7f7f7f, 0x00000000 },
3495 { 0x685c, 0, 0x7f7f7f7f, 0x00000000 },
3496 { 0x6908, 0, 0x00000000, 0x0001ff0f },
3497 { 0x690c, 0, 0x00000000, 0x0ffe00f0 },
3498
3499 { 0xffff, 0, 0x00000000, 0x00000000 },
3500 };
3501
3502 ret = 0;
3503 for (i = 0; reg_tbl[i].offset != 0xffff; i++) {
3504 u32 offset, rw_mask, ro_mask, save_val, val;
3505
3506 offset = (u32) reg_tbl[i].offset;
3507 rw_mask = reg_tbl[i].rw_mask;
3508 ro_mask = reg_tbl[i].ro_mask;
3509
3510 save_val = readl((u8 *) bp->regview + offset);
3511
3512 writel(0, (u8 *) bp->regview + offset);
3513
3514 val = readl((u8 *) bp->regview + offset);
3515 if ((val & rw_mask) != 0) {
3516 goto reg_test_err;
3517 }
3518
3519 if ((val & ro_mask) != (save_val & ro_mask)) {
3520 goto reg_test_err;
3521 }
3522
3523 writel(0xffffffff, (u8 *) bp->regview + offset);
3524
3525 val = readl((u8 *) bp->regview + offset);
3526 if ((val & rw_mask) != rw_mask) {
3527 goto reg_test_err;
3528 }
3529
3530 if ((val & ro_mask) != (save_val & ro_mask)) {
3531 goto reg_test_err;
3532 }
3533
3534 writel(save_val, (u8 *) bp->regview + offset);
3535 continue;
3536
3537reg_test_err:
3538 writel(save_val, (u8 *) bp->regview + offset);
3539 ret = -ENODEV;
3540 break;
3541 }
3542 return ret;
3543}
3544
3545static int
3546bnx2_do_mem_test(struct bnx2 *bp, u32 start, u32 size)
3547{
3548 static u32 test_pattern[] = { 0x00000000, 0xffffffff, 0x55555555,
3549 0xaaaaaaaa , 0xaa55aa55, 0x55aa55aa };
3550 int i;
3551
3552 for (i = 0; i < sizeof(test_pattern) / 4; i++) {
3553 u32 offset;
3554
3555 for (offset = 0; offset < size; offset += 4) {
3556
3557 REG_WR_IND(bp, start + offset, test_pattern[i]);
3558
3559 if (REG_RD_IND(bp, start + offset) !=
3560 test_pattern[i]) {
3561 return -ENODEV;
3562 }
3563 }
3564 }
3565 return 0;
3566}
3567
3568static int
3569bnx2_test_memory(struct bnx2 *bp)
3570{
3571 int ret = 0;
3572 int i;
3573 static struct {
3574 u32 offset;
3575 u32 len;
3576 } mem_tbl[] = {
3577 { 0x60000, 0x4000 },
3578 { 0xa0000, 0x4000 },
3579 { 0xe0000, 0x4000 },
3580 { 0x120000, 0x4000 },
3581 { 0x1a0000, 0x4000 },
3582 { 0x160000, 0x4000 },
3583 { 0xffffffff, 0 },
3584 };
3585
3586 for (i = 0; mem_tbl[i].offset != 0xffffffff; i++) {
3587 if ((ret = bnx2_do_mem_test(bp, mem_tbl[i].offset,
3588 mem_tbl[i].len)) != 0) {
3589 return ret;
3590 }
3591 }
3592
3593 return ret;
3594}
3595
3596static int
3597bnx2_test_loopback(struct bnx2 *bp)
3598{
3599 unsigned int pkt_size, num_pkts, i;
3600 struct sk_buff *skb, *rx_skb;
3601 unsigned char *packet;
3602 u16 rx_start_idx, rx_idx, send_idx;
3603 u32 send_bseq, val;
3604 dma_addr_t map;
3605 struct tx_bd *txbd;
3606 struct sw_bd *rx_buf;
3607 struct l2_fhdr *rx_hdr;
3608 int ret = -ENODEV;
3609
3610 if (!netif_running(bp->dev))
3611 return -ENODEV;
3612
3613 bp->loopback = MAC_LOOPBACK;
3614 bnx2_reset_nic(bp, BNX2_DRV_MSG_CODE_DIAG);
3615 bnx2_set_mac_loopback(bp);
3616
3617 pkt_size = 1514;
3618 skb = dev_alloc_skb(pkt_size);
3619 packet = skb_put(skb, pkt_size);
3620 memcpy(packet, bp->mac_addr, 6);
3621 memset(packet + 6, 0x0, 8);
3622 for (i = 14; i < pkt_size; i++)
3623 packet[i] = (unsigned char) (i & 0xff);
3624
3625 map = pci_map_single(bp->pdev, skb->data, pkt_size,
3626 PCI_DMA_TODEVICE);
3627
3628 val = REG_RD(bp, BNX2_HC_COMMAND);
3629 REG_WR(bp, BNX2_HC_COMMAND, val | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
3630 REG_RD(bp, BNX2_HC_COMMAND);
3631
3632 udelay(5);
3633 rx_start_idx = bp->status_blk->status_rx_quick_consumer_index0;
3634
3635 send_idx = 0;
3636 send_bseq = 0;
3637 num_pkts = 0;
3638
3639 txbd = &bp->tx_desc_ring[send_idx];
3640
3641 txbd->tx_bd_haddr_hi = (u64) map >> 32;
3642 txbd->tx_bd_haddr_lo = (u64) map & 0xffffffff;
3643 txbd->tx_bd_mss_nbytes = pkt_size;
3644 txbd->tx_bd_vlan_tag_flags = TX_BD_FLAGS_START | TX_BD_FLAGS_END;
3645
3646 num_pkts++;
3647 send_idx = NEXT_TX_BD(send_idx);
3648
3649 send_bseq += pkt_size;
3650
3651 REG_WR16(bp, MB_TX_CID_ADDR + BNX2_L2CTX_TX_HOST_BIDX, send_idx);
3652 REG_WR(bp, MB_TX_CID_ADDR + BNX2_L2CTX_TX_HOST_BSEQ, send_bseq);
3653
3654
3655 udelay(100);
3656
3657 val = REG_RD(bp, BNX2_HC_COMMAND);
3658 REG_WR(bp, BNX2_HC_COMMAND, val | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
3659 REG_RD(bp, BNX2_HC_COMMAND);
3660
3661 udelay(5);
3662
3663 pci_unmap_single(bp->pdev, map, pkt_size, PCI_DMA_TODEVICE);
3664 dev_kfree_skb_irq(skb);
3665
3666 if (bp->status_blk->status_tx_quick_consumer_index0 != send_idx) {
3667 goto loopback_test_done;
3668 }
3669
3670 rx_idx = bp->status_blk->status_rx_quick_consumer_index0;
3671 if (rx_idx != rx_start_idx + num_pkts) {
3672 goto loopback_test_done;
3673 }
3674
3675 rx_buf = &bp->rx_buf_ring[rx_start_idx];
3676 rx_skb = rx_buf->skb;
3677
3678 rx_hdr = (struct l2_fhdr *) rx_skb->data;
3679 skb_reserve(rx_skb, bp->rx_offset);
3680
3681 pci_dma_sync_single_for_cpu(bp->pdev,
3682 pci_unmap_addr(rx_buf, mapping),
3683 bp->rx_buf_size, PCI_DMA_FROMDEVICE);
3684
3685 if (rx_hdr->l2_fhdr_errors &
3686 (L2_FHDR_ERRORS_BAD_CRC |
3687 L2_FHDR_ERRORS_PHY_DECODE |
3688 L2_FHDR_ERRORS_ALIGNMENT |
3689 L2_FHDR_ERRORS_TOO_SHORT |
3690 L2_FHDR_ERRORS_GIANT_FRAME)) {
3691
3692 goto loopback_test_done;
3693 }
3694
3695 if ((rx_hdr->l2_fhdr_pkt_len - 4) != pkt_size) {
3696 goto loopback_test_done;
3697 }
3698
3699 for (i = 14; i < pkt_size; i++) {
3700 if (*(rx_skb->data + i) != (unsigned char) (i & 0xff)) {
3701 goto loopback_test_done;
3702 }
3703 }
3704
3705 ret = 0;
3706
3707loopback_test_done:
3708 bp->loopback = 0;
3709 return ret;
3710}
3711
3712#define NVRAM_SIZE 0x200
3713#define CRC32_RESIDUAL 0xdebb20e3
3714
3715static int
3716bnx2_test_nvram(struct bnx2 *bp)
3717{
3718 u32 buf[NVRAM_SIZE / 4];
3719 u8 *data = (u8 *) buf;
3720 int rc = 0;
3721 u32 magic, csum;
3722
3723 if ((rc = bnx2_nvram_read(bp, 0, data, 4)) != 0)
3724 goto test_nvram_done;
3725
3726 magic = be32_to_cpu(buf[0]);
3727 if (magic != 0x669955aa) {
3728 rc = -ENODEV;
3729 goto test_nvram_done;
3730 }
3731
3732 if ((rc = bnx2_nvram_read(bp, 0x100, data, NVRAM_SIZE)) != 0)
3733 goto test_nvram_done;
3734
3735 csum = ether_crc_le(0x100, data);
3736 if (csum != CRC32_RESIDUAL) {
3737 rc = -ENODEV;
3738 goto test_nvram_done;
3739 }
3740
3741 csum = ether_crc_le(0x100, data + 0x100);
3742 if (csum != CRC32_RESIDUAL) {
3743 rc = -ENODEV;
3744 }
3745
3746test_nvram_done:
3747 return rc;
3748}
3749
3750static int
3751bnx2_test_link(struct bnx2 *bp)
3752{
3753 u32 bmsr;
3754
3755 spin_lock_irq(&bp->phy_lock);
3756 bnx2_read_phy(bp, MII_BMSR, &bmsr);
3757 bnx2_read_phy(bp, MII_BMSR, &bmsr);
3758 spin_unlock_irq(&bp->phy_lock);
3759
3760 if (bmsr & BMSR_LSTATUS) {
3761 return 0;
3762 }
3763 return -ENODEV;
3764}
3765
3766static int
3767bnx2_test_intr(struct bnx2 *bp)
3768{
3769 int i;
3770 u32 val;
3771 u16 status_idx;
3772
3773 if (!netif_running(bp->dev))
3774 return -ENODEV;
3775
3776 status_idx = REG_RD(bp, BNX2_PCICFG_INT_ACK_CMD) & 0xffff;
3777
3778 /* This register is not touched during run-time. */
3779 val = REG_RD(bp, BNX2_HC_COMMAND);
3780 REG_WR(bp, BNX2_HC_COMMAND, val | BNX2_HC_COMMAND_COAL_NOW);
3781 REG_RD(bp, BNX2_HC_COMMAND);
3782
3783 for (i = 0; i < 10; i++) {
3784 if ((REG_RD(bp, BNX2_PCICFG_INT_ACK_CMD) & 0xffff) !=
3785 status_idx) {
3786
3787 break;
3788 }
3789
3790 msleep_interruptible(10);
3791 }
3792 if (i < 10)
3793 return 0;
3794
3795 return -ENODEV;
3796}
3797
3798static void
3799bnx2_timer(unsigned long data)
3800{
3801 struct bnx2 *bp = (struct bnx2 *) data;
3802 u32 msg;
3803
3804 if (atomic_read(&bp->intr_sem) != 0)
3805 goto bnx2_restart_timer;
3806
3807 msg = (u32) ++bp->fw_drv_pulse_wr_seq;
3808 REG_WR_IND(bp, HOST_VIEW_SHMEM_BASE + BNX2_DRV_PULSE_MB, msg);
3809
3810 if ((bp->phy_flags & PHY_SERDES_FLAG) &&
3811 (CHIP_NUM(bp) == CHIP_NUM_5706)) {
3812 unsigned long flags;
3813
3814 spin_lock_irqsave(&bp->phy_lock, flags);
3815 if (bp->serdes_an_pending) {
3816 bp->serdes_an_pending--;
3817 }
3818 else if ((bp->link_up == 0) && (bp->autoneg & AUTONEG_SPEED)) {
3819 u32 bmcr;
3820
3821 bnx2_read_phy(bp, MII_BMCR, &bmcr);
3822
3823 if (bmcr & BMCR_ANENABLE) {
3824 u32 phy1, phy2;
3825
3826 bnx2_write_phy(bp, 0x1c, 0x7c00);
3827 bnx2_read_phy(bp, 0x1c, &phy1);
3828
3829 bnx2_write_phy(bp, 0x17, 0x0f01);
3830 bnx2_read_phy(bp, 0x15, &phy2);
3831 bnx2_write_phy(bp, 0x17, 0x0f01);
3832 bnx2_read_phy(bp, 0x15, &phy2);
3833
3834 if ((phy1 & 0x10) && /* SIGNAL DETECT */
3835 !(phy2 & 0x20)) { /* no CONFIG */
3836
3837 bmcr &= ~BMCR_ANENABLE;
3838 bmcr |= BMCR_SPEED1000 |
3839 BMCR_FULLDPLX;
3840 bnx2_write_phy(bp, MII_BMCR, bmcr);
3841 bp->phy_flags |=
3842 PHY_PARALLEL_DETECT_FLAG;
3843 }
3844 }
3845 }
3846 else if ((bp->link_up) && (bp->autoneg & AUTONEG_SPEED) &&
3847 (bp->phy_flags & PHY_PARALLEL_DETECT_FLAG)) {
3848 u32 phy2;
3849
3850 bnx2_write_phy(bp, 0x17, 0x0f01);
3851 bnx2_read_phy(bp, 0x15, &phy2);
3852 if (phy2 & 0x20) {
3853 u32 bmcr;
3854
3855 bnx2_read_phy(bp, MII_BMCR, &bmcr);
3856 bmcr |= BMCR_ANENABLE;
3857 bnx2_write_phy(bp, MII_BMCR, bmcr);
3858
3859 bp->phy_flags &= ~PHY_PARALLEL_DETECT_FLAG;
3860
3861 }
3862 }
3863
3864 spin_unlock_irqrestore(&bp->phy_lock, flags);
3865 }
3866
3867bnx2_restart_timer:
3868 bp->timer.expires = RUN_AT(bp->timer_interval);
3869
3870 add_timer(&bp->timer);
3871}
3872
3873/* Called with rtnl_lock */
3874static int
3875bnx2_open(struct net_device *dev)
3876{
3877 struct bnx2 *bp = dev->priv;
3878 int rc;
3879
3880 bnx2_set_power_state(bp, 0);
3881 bnx2_disable_int(bp);
3882
3883 rc = bnx2_alloc_mem(bp);
3884 if (rc)
3885 return rc;
3886
3887 if ((CHIP_ID(bp) != CHIP_ID_5706_A0) &&
3888 (CHIP_ID(bp) != CHIP_ID_5706_A1) &&
3889 !disable_msi) {
3890
3891 if (pci_enable_msi(bp->pdev) == 0) {
3892 bp->flags |= USING_MSI_FLAG;
3893 rc = request_irq(bp->pdev->irq, bnx2_msi, 0, dev->name,
3894 dev);
3895 }
3896 else {
3897 rc = request_irq(bp->pdev->irq, bnx2_interrupt,
3898 SA_SHIRQ, dev->name, dev);
3899 }
3900 }
3901 else {
3902 rc = request_irq(bp->pdev->irq, bnx2_interrupt, SA_SHIRQ,
3903 dev->name, dev);
3904 }
3905 if (rc) {
3906 bnx2_free_mem(bp);
3907 return rc;
3908 }
3909
3910 rc = bnx2_init_nic(bp);
3911
3912 if (rc) {
3913 free_irq(bp->pdev->irq, dev);
3914 if (bp->flags & USING_MSI_FLAG) {
3915 pci_disable_msi(bp->pdev);
3916 bp->flags &= ~USING_MSI_FLAG;
3917 }
3918 bnx2_free_skbs(bp);
3919 bnx2_free_mem(bp);
3920 return rc;
3921 }
3922
3923 init_timer(&bp->timer);
3924
3925 bp->timer.expires = RUN_AT(bp->timer_interval);
3926 bp->timer.data = (unsigned long) bp;
3927 bp->timer.function = bnx2_timer;
3928 add_timer(&bp->timer);
3929
3930 atomic_set(&bp->intr_sem, 0);
3931
3932 bnx2_enable_int(bp);
3933
3934 if (bp->flags & USING_MSI_FLAG) {
3935 /* Test MSI to make sure it is working
3936 * If MSI test fails, go back to INTx mode
3937 */
3938 if (bnx2_test_intr(bp) != 0) {
3939 printk(KERN_WARNING PFX "%s: No interrupt was generated"
3940 " using MSI, switching to INTx mode. Please"
3941 " report this failure to the PCI maintainer"
3942 " and include system chipset information.\n",
3943 bp->dev->name);
3944
3945 bnx2_disable_int(bp);
3946 free_irq(bp->pdev->irq, dev);
3947 pci_disable_msi(bp->pdev);
3948 bp->flags &= ~USING_MSI_FLAG;
3949
3950 rc = bnx2_init_nic(bp);
3951
3952 if (!rc) {
3953 rc = request_irq(bp->pdev->irq, bnx2_interrupt,
3954 SA_SHIRQ, dev->name, dev);
3955 }
3956 if (rc) {
3957 bnx2_free_skbs(bp);
3958 bnx2_free_mem(bp);
3959 del_timer_sync(&bp->timer);
3960 return rc;
3961 }
3962 bnx2_enable_int(bp);
3963 }
3964 }
3965 if (bp->flags & USING_MSI_FLAG) {
3966 printk(KERN_INFO PFX "%s: using MSI\n", dev->name);
3967 }
3968
3969 netif_start_queue(dev);
3970
3971 return 0;
3972}
3973
3974static void
3975bnx2_reset_task(void *data)
3976{
3977 struct bnx2 *bp = data;
3978
3979 bnx2_netif_stop(bp);
3980
3981 bnx2_init_nic(bp);
3982
3983 atomic_set(&bp->intr_sem, 1);
3984 bnx2_netif_start(bp);
3985}
3986
3987static void
3988bnx2_tx_timeout(struct net_device *dev)
3989{
3990 struct bnx2 *bp = dev->priv;
3991
3992 /* This allows the netif to be shutdown gracefully before resetting */
3993 schedule_work(&bp->reset_task);
3994}
3995
3996#ifdef BCM_VLAN
3997/* Called with rtnl_lock */
3998static void
3999bnx2_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp)
4000{
4001 struct bnx2 *bp = dev->priv;
4002
4003 bnx2_netif_stop(bp);
4004
4005 bp->vlgrp = vlgrp;
4006 bnx2_set_rx_mode(dev);
4007
4008 bnx2_netif_start(bp);
4009}
4010
4011/* Called with rtnl_lock */
4012static void
4013bnx2_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid)
4014{
4015 struct bnx2 *bp = dev->priv;
4016
4017 bnx2_netif_stop(bp);
4018
4019 if (bp->vlgrp)
4020 bp->vlgrp->vlan_devices[vid] = NULL;
4021 bnx2_set_rx_mode(dev);
4022
4023 bnx2_netif_start(bp);
4024}
4025#endif
4026
4027/* Called with dev->xmit_lock.
4028 * hard_start_xmit is pseudo-lockless - a lock is only required when
4029 * the tx queue is full. This way, we get the benefit of lockless
4030 * operations most of the time without the complexities to handle
4031 * netif_stop_queue/wake_queue race conditions.
4032 */
4033static int
4034bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
4035{
4036 struct bnx2 *bp = dev->priv;
4037 dma_addr_t mapping;
4038 struct tx_bd *txbd;
4039 struct sw_bd *tx_buf;
4040 u32 len, vlan_tag_flags, last_frag, mss;
4041 u16 prod, ring_prod;
4042 int i;
4043
4044 if (unlikely(atomic_read(&bp->tx_avail_bd) <
4045 (skb_shinfo(skb)->nr_frags + 1))) {
4046
4047 netif_stop_queue(dev);
4048 printk(KERN_ERR PFX "%s: BUG! Tx ring full when queue awake!\n",
4049 dev->name);
4050
4051 return NETDEV_TX_BUSY;
4052 }
4053 len = skb_headlen(skb);
4054 prod = bp->tx_prod;
4055 ring_prod = TX_RING_IDX(prod);
4056
4057 vlan_tag_flags = 0;
4058 if (skb->ip_summed == CHECKSUM_HW) {
4059 vlan_tag_flags |= TX_BD_FLAGS_TCP_UDP_CKSUM;
4060 }
4061
4062 if (bp->vlgrp != 0 && vlan_tx_tag_present(skb)) {
4063 vlan_tag_flags |=
4064 (TX_BD_FLAGS_VLAN_TAG | (vlan_tx_tag_get(skb) << 16));
4065 }
4066#ifdef BCM_TSO
4067 if ((mss = skb_shinfo(skb)->tso_size) &&
4068 (skb->len > (bp->dev->mtu + ETH_HLEN))) {
4069 u32 tcp_opt_len, ip_tcp_len;
4070
4071 if (skb_header_cloned(skb) &&
4072 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
4073 dev_kfree_skb(skb);
4074 return NETDEV_TX_OK;
4075 }
4076
4077 tcp_opt_len = ((skb->h.th->doff - 5) * 4);
4078 vlan_tag_flags |= TX_BD_FLAGS_SW_LSO;
4079
4080 tcp_opt_len = 0;
4081 if (skb->h.th->doff > 5) {
4082 tcp_opt_len = (skb->h.th->doff - 5) << 2;
4083 }
4084 ip_tcp_len = (skb->nh.iph->ihl << 2) + sizeof(struct tcphdr);
4085
4086 skb->nh.iph->check = 0;
4087 skb->nh.iph->tot_len = ntohs(mss + ip_tcp_len + tcp_opt_len);
4088 skb->h.th->check =
4089 ~csum_tcpudp_magic(skb->nh.iph->saddr,
4090 skb->nh.iph->daddr,
4091 0, IPPROTO_TCP, 0);
4092
4093 if (tcp_opt_len || (skb->nh.iph->ihl > 5)) {
4094 vlan_tag_flags |= ((skb->nh.iph->ihl - 5) +
4095 (tcp_opt_len >> 2)) << 8;
4096 }
4097 }
4098 else
4099#endif
4100 {
4101 mss = 0;
4102 }
4103
4104 mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE);
4105
4106 tx_buf = &bp->tx_buf_ring[ring_prod];
4107 tx_buf->skb = skb;
4108 pci_unmap_addr_set(tx_buf, mapping, mapping);
4109
4110 txbd = &bp->tx_desc_ring[ring_prod];
4111
4112 txbd->tx_bd_haddr_hi = (u64) mapping >> 32;
4113 txbd->tx_bd_haddr_lo = (u64) mapping & 0xffffffff;
4114 txbd->tx_bd_mss_nbytes = len | (mss << 16);
4115 txbd->tx_bd_vlan_tag_flags = vlan_tag_flags | TX_BD_FLAGS_START;
4116
4117 last_frag = skb_shinfo(skb)->nr_frags;
4118
4119 for (i = 0; i < last_frag; i++) {
4120 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
4121
4122 prod = NEXT_TX_BD(prod);
4123 ring_prod = TX_RING_IDX(prod);
4124 txbd = &bp->tx_desc_ring[ring_prod];
4125
4126 len = frag->size;
4127 mapping = pci_map_page(bp->pdev, frag->page, frag->page_offset,
4128 len, PCI_DMA_TODEVICE);
4129 pci_unmap_addr_set(&bp->tx_buf_ring[ring_prod],
4130 mapping, mapping);
4131
4132 txbd->tx_bd_haddr_hi = (u64) mapping >> 32;
4133 txbd->tx_bd_haddr_lo = (u64) mapping & 0xffffffff;
4134 txbd->tx_bd_mss_nbytes = len | (mss << 16);
4135 txbd->tx_bd_vlan_tag_flags = vlan_tag_flags;
4136
4137 }
4138 txbd->tx_bd_vlan_tag_flags |= TX_BD_FLAGS_END;
4139
4140 prod = NEXT_TX_BD(prod);
4141 bp->tx_prod_bseq += skb->len;
4142
4143 atomic_sub(last_frag + 1, &bp->tx_avail_bd);
4144
4145 REG_WR16(bp, MB_TX_CID_ADDR + BNX2_L2CTX_TX_HOST_BIDX, prod);
4146 REG_WR(bp, MB_TX_CID_ADDR + BNX2_L2CTX_TX_HOST_BSEQ, bp->tx_prod_bseq);
4147
4148 mmiowb();
4149
4150 bp->tx_prod = prod;
4151 dev->trans_start = jiffies;
4152
4153 if (unlikely(atomic_read(&bp->tx_avail_bd) <= MAX_SKB_FRAGS)) {
4154 unsigned long flags;
4155
4156 spin_lock_irqsave(&bp->tx_lock, flags);
4157 if (atomic_read(&bp->tx_avail_bd) <= MAX_SKB_FRAGS) {
4158 netif_stop_queue(dev);
4159
4160 if (atomic_read(&bp->tx_avail_bd) > MAX_SKB_FRAGS)
4161 netif_wake_queue(dev);
4162 }
4163 spin_unlock_irqrestore(&bp->tx_lock, flags);
4164 }
4165
4166 return NETDEV_TX_OK;
4167}
4168
4169/* Called with rtnl_lock */
4170static int
4171bnx2_close(struct net_device *dev)
4172{
4173 struct bnx2 *bp = dev->priv;
4174 u32 reset_code;
4175
4176 flush_scheduled_work();
4177 bnx2_netif_stop(bp);
4178 del_timer_sync(&bp->timer);
4179 if (bp->wol)
4180 reset_code = BNX2_DRV_MSG_CODE_SUSPEND_WOL;
4181 else
4182 reset_code = BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL;
4183 bnx2_reset_chip(bp, reset_code);
4184 free_irq(bp->pdev->irq, dev);
4185 if (bp->flags & USING_MSI_FLAG) {
4186 pci_disable_msi(bp->pdev);
4187 bp->flags &= ~USING_MSI_FLAG;
4188 }
4189 bnx2_free_skbs(bp);
4190 bnx2_free_mem(bp);
4191 bp->link_up = 0;
4192 netif_carrier_off(bp->dev);
4193 bnx2_set_power_state(bp, 3);
4194 return 0;
4195}
4196
4197#define GET_NET_STATS64(ctr) \
4198 (unsigned long) ((unsigned long) (ctr##_hi) << 32) + \
4199 (unsigned long) (ctr##_lo)
4200
4201#define GET_NET_STATS32(ctr) \
4202 (ctr##_lo)
4203
4204#if (BITS_PER_LONG == 64)
4205#define GET_NET_STATS GET_NET_STATS64
4206#else
4207#define GET_NET_STATS GET_NET_STATS32
4208#endif
4209
4210static struct net_device_stats *
4211bnx2_get_stats(struct net_device *dev)
4212{
4213 struct bnx2 *bp = dev->priv;
4214 struct statistics_block *stats_blk = bp->stats_blk;
4215 struct net_device_stats *net_stats = &bp->net_stats;
4216
4217 if (bp->stats_blk == NULL) {
4218 return net_stats;
4219 }
4220 net_stats->rx_packets =
4221 GET_NET_STATS(stats_blk->stat_IfHCInUcastPkts) +
4222 GET_NET_STATS(stats_blk->stat_IfHCInMulticastPkts) +
4223 GET_NET_STATS(stats_blk->stat_IfHCInBroadcastPkts);
4224
4225 net_stats->tx_packets =
4226 GET_NET_STATS(stats_blk->stat_IfHCOutUcastPkts) +
4227 GET_NET_STATS(stats_blk->stat_IfHCOutMulticastPkts) +
4228 GET_NET_STATS(stats_blk->stat_IfHCOutBroadcastPkts);
4229
4230 net_stats->rx_bytes =
4231 GET_NET_STATS(stats_blk->stat_IfHCInOctets);
4232
4233 net_stats->tx_bytes =
4234 GET_NET_STATS(stats_blk->stat_IfHCOutOctets);
4235
4236 net_stats->multicast =
4237 GET_NET_STATS(stats_blk->stat_IfHCOutMulticastPkts);
4238
4239 net_stats->collisions =
4240 (unsigned long) stats_blk->stat_EtherStatsCollisions;
4241
4242 net_stats->rx_length_errors =
4243 (unsigned long) (stats_blk->stat_EtherStatsUndersizePkts +
4244 stats_blk->stat_EtherStatsOverrsizePkts);
4245
4246 net_stats->rx_over_errors =
4247 (unsigned long) stats_blk->stat_IfInMBUFDiscards;
4248
4249 net_stats->rx_frame_errors =
4250 (unsigned long) stats_blk->stat_Dot3StatsAlignmentErrors;
4251
4252 net_stats->rx_crc_errors =
4253 (unsigned long) stats_blk->stat_Dot3StatsFCSErrors;
4254
4255 net_stats->rx_errors = net_stats->rx_length_errors +
4256 net_stats->rx_over_errors + net_stats->rx_frame_errors +
4257 net_stats->rx_crc_errors;
4258
4259 net_stats->tx_aborted_errors =
4260 (unsigned long) (stats_blk->stat_Dot3StatsExcessiveCollisions +
4261 stats_blk->stat_Dot3StatsLateCollisions);
4262
4263 if (CHIP_NUM(bp) == CHIP_NUM_5706)
4264 net_stats->tx_carrier_errors = 0;
4265 else {
4266 net_stats->tx_carrier_errors =
4267 (unsigned long)
4268 stats_blk->stat_Dot3StatsCarrierSenseErrors;
4269 }
4270
4271 net_stats->tx_errors =
4272 (unsigned long)
4273 stats_blk->stat_emac_tx_stat_dot3statsinternalmactransmiterrors
4274 +
4275 net_stats->tx_aborted_errors +
4276 net_stats->tx_carrier_errors;
4277
4278 return net_stats;
4279}
4280
4281/* All ethtool functions called with rtnl_lock */
4282
4283static int
4284bnx2_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
4285{
4286 struct bnx2 *bp = dev->priv;
4287
4288 cmd->supported = SUPPORTED_Autoneg;
4289 if (bp->phy_flags & PHY_SERDES_FLAG) {
4290 cmd->supported |= SUPPORTED_1000baseT_Full |
4291 SUPPORTED_FIBRE;
4292
4293 cmd->port = PORT_FIBRE;
4294 }
4295 else {
4296 cmd->supported |= SUPPORTED_10baseT_Half |
4297 SUPPORTED_10baseT_Full |
4298 SUPPORTED_100baseT_Half |
4299 SUPPORTED_100baseT_Full |
4300 SUPPORTED_1000baseT_Full |
4301 SUPPORTED_TP;
4302
4303 cmd->port = PORT_TP;
4304 }
4305
4306 cmd->advertising = bp->advertising;
4307
4308 if (bp->autoneg & AUTONEG_SPEED) {
4309 cmd->autoneg = AUTONEG_ENABLE;
4310 }
4311 else {
4312 cmd->autoneg = AUTONEG_DISABLE;
4313 }
4314
4315 if (netif_carrier_ok(dev)) {
4316 cmd->speed = bp->line_speed;
4317 cmd->duplex = bp->duplex;
4318 }
4319 else {
4320 cmd->speed = -1;
4321 cmd->duplex = -1;
4322 }
4323
4324 cmd->transceiver = XCVR_INTERNAL;
4325 cmd->phy_address = bp->phy_addr;
4326
4327 return 0;
4328}
4329
4330static int
4331bnx2_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
4332{
4333 struct bnx2 *bp = dev->priv;
4334 u8 autoneg = bp->autoneg;
4335 u8 req_duplex = bp->req_duplex;
4336 u16 req_line_speed = bp->req_line_speed;
4337 u32 advertising = bp->advertising;
4338
4339 if (cmd->autoneg == AUTONEG_ENABLE) {
4340 autoneg |= AUTONEG_SPEED;
4341
4342 cmd->advertising &= ETHTOOL_ALL_COPPER_SPEED;
4343
4344 /* allow advertising 1 speed */
4345 if ((cmd->advertising == ADVERTISED_10baseT_Half) ||
4346 (cmd->advertising == ADVERTISED_10baseT_Full) ||
4347 (cmd->advertising == ADVERTISED_100baseT_Half) ||
4348 (cmd->advertising == ADVERTISED_100baseT_Full)) {
4349
4350 if (bp->phy_flags & PHY_SERDES_FLAG)
4351 return -EINVAL;
4352
4353 advertising = cmd->advertising;
4354
4355 }
4356 else if (cmd->advertising == ADVERTISED_1000baseT_Full) {
4357 advertising = cmd->advertising;
4358 }
4359 else if (cmd->advertising == ADVERTISED_1000baseT_Half) {
4360 return -EINVAL;
4361 }
4362 else {
4363 if (bp->phy_flags & PHY_SERDES_FLAG) {
4364 advertising = ETHTOOL_ALL_FIBRE_SPEED;
4365 }
4366 else {
4367 advertising = ETHTOOL_ALL_COPPER_SPEED;
4368 }
4369 }
4370 advertising |= ADVERTISED_Autoneg;
4371 }
4372 else {
4373 if (bp->phy_flags & PHY_SERDES_FLAG) {
4374 if ((cmd->speed != SPEED_1000) ||
4375 (cmd->duplex != DUPLEX_FULL)) {
4376 return -EINVAL;
4377 }
4378 }
4379 else if (cmd->speed == SPEED_1000) {
4380 return -EINVAL;
4381 }
4382 autoneg &= ~AUTONEG_SPEED;
4383 req_line_speed = cmd->speed;
4384 req_duplex = cmd->duplex;
4385 advertising = 0;
4386 }
4387
4388 bp->autoneg = autoneg;
4389 bp->advertising = advertising;
4390 bp->req_line_speed = req_line_speed;
4391 bp->req_duplex = req_duplex;
4392
4393 spin_lock_irq(&bp->phy_lock);
4394
4395 bnx2_setup_phy(bp);
4396
4397 spin_unlock_irq(&bp->phy_lock);
4398
4399 return 0;
4400}
4401
4402static void
4403bnx2_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
4404{
4405 struct bnx2 *bp = dev->priv;
4406
4407 strcpy(info->driver, DRV_MODULE_NAME);
4408 strcpy(info->version, DRV_MODULE_VERSION);
4409 strcpy(info->bus_info, pci_name(bp->pdev));
4410 info->fw_version[0] = ((bp->fw_ver & 0xff000000) >> 24) + '0';
4411 info->fw_version[2] = ((bp->fw_ver & 0xff0000) >> 16) + '0';
4412 info->fw_version[4] = ((bp->fw_ver & 0xff00) >> 8) + '0';
4413 info->fw_version[6] = (bp->fw_ver & 0xff) + '0';
4414 info->fw_version[1] = info->fw_version[3] = info->fw_version[5] = '.';
4415 info->fw_version[7] = 0;
4416}
4417
4418static void
4419bnx2_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
4420{
4421 struct bnx2 *bp = dev->priv;
4422
4423 if (bp->flags & NO_WOL_FLAG) {
4424 wol->supported = 0;
4425 wol->wolopts = 0;
4426 }
4427 else {
4428 wol->supported = WAKE_MAGIC;
4429 if (bp->wol)
4430 wol->wolopts = WAKE_MAGIC;
4431 else
4432 wol->wolopts = 0;
4433 }
4434 memset(&wol->sopass, 0, sizeof(wol->sopass));
4435}
4436
4437static int
4438bnx2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
4439{
4440 struct bnx2 *bp = dev->priv;
4441
4442 if (wol->wolopts & ~WAKE_MAGIC)
4443 return -EINVAL;
4444
4445 if (wol->wolopts & WAKE_MAGIC) {
4446 if (bp->flags & NO_WOL_FLAG)
4447 return -EINVAL;
4448
4449 bp->wol = 1;
4450 }
4451 else {
4452 bp->wol = 0;
4453 }
4454 return 0;
4455}
4456
4457static int
4458bnx2_nway_reset(struct net_device *dev)
4459{
4460 struct bnx2 *bp = dev->priv;
4461 u32 bmcr;
4462
4463 if (!(bp->autoneg & AUTONEG_SPEED)) {
4464 return -EINVAL;
4465 }
4466
4467 spin_lock_irq(&bp->phy_lock);
4468
4469 /* Force a link down visible on the other side */
4470 if (bp->phy_flags & PHY_SERDES_FLAG) {
4471 bnx2_write_phy(bp, MII_BMCR, BMCR_LOOPBACK);
4472 spin_unlock_irq(&bp->phy_lock);
4473
4474 msleep(20);
4475
4476 spin_lock_irq(&bp->phy_lock);
4477 if (CHIP_NUM(bp) == CHIP_NUM_5706) {
4478 bp->serdes_an_pending = SERDES_AN_TIMEOUT /
4479 bp->timer_interval;
4480 }
4481 }
4482
4483 bnx2_read_phy(bp, MII_BMCR, &bmcr);
4484 bmcr &= ~BMCR_LOOPBACK;
4485 bnx2_write_phy(bp, MII_BMCR, bmcr | BMCR_ANRESTART | BMCR_ANENABLE);
4486
4487 spin_unlock_irq(&bp->phy_lock);
4488
4489 return 0;
4490}
4491
4492static int
4493bnx2_get_eeprom_len(struct net_device *dev)
4494{
4495 struct bnx2 *bp = dev->priv;
4496
4497 if (bp->flash_info == 0)
4498 return 0;
4499
4500 return (int) bp->flash_info->total_size;
4501}
4502
4503static int
4504bnx2_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
4505 u8 *eebuf)
4506{
4507 struct bnx2 *bp = dev->priv;
4508 int rc;
4509
4510 if (eeprom->offset > bp->flash_info->total_size)
4511 return -EINVAL;
4512
4513 if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size)
4514 eeprom->len = bp->flash_info->total_size - eeprom->offset;
4515
4516 rc = bnx2_nvram_read(bp, eeprom->offset, eebuf, eeprom->len);
4517
4518 return rc;
4519}
4520
4521static int
4522bnx2_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
4523 u8 *eebuf)
4524{
4525 struct bnx2 *bp = dev->priv;
4526 int rc;
4527
4528 if (eeprom->offset > bp->flash_info->total_size)
4529 return -EINVAL;
4530
4531 if ((eeprom->offset + eeprom->len) > bp->flash_info->total_size)
4532 eeprom->len = bp->flash_info->total_size - eeprom->offset;
4533
4534 rc = bnx2_nvram_write(bp, eeprom->offset, eebuf, eeprom->len);
4535
4536 return rc;
4537}
4538
4539static int
4540bnx2_get_coalesce(struct net_device *dev, struct ethtool_coalesce *coal)
4541{
4542 struct bnx2 *bp = dev->priv;
4543
4544 memset(coal, 0, sizeof(struct ethtool_coalesce));
4545
4546 coal->rx_coalesce_usecs = bp->rx_ticks;
4547 coal->rx_max_coalesced_frames = bp->rx_quick_cons_trip;
4548 coal->rx_coalesce_usecs_irq = bp->rx_ticks_int;
4549 coal->rx_max_coalesced_frames_irq = bp->rx_quick_cons_trip_int;
4550
4551 coal->tx_coalesce_usecs = bp->tx_ticks;
4552 coal->tx_max_coalesced_frames = bp->tx_quick_cons_trip;
4553 coal->tx_coalesce_usecs_irq = bp->tx_ticks_int;
4554 coal->tx_max_coalesced_frames_irq = bp->tx_quick_cons_trip_int;
4555
4556 coal->stats_block_coalesce_usecs = bp->stats_ticks;
4557
4558 return 0;
4559}
4560
4561static int
4562bnx2_set_coalesce(struct net_device *dev, struct ethtool_coalesce *coal)
4563{
4564 struct bnx2 *bp = dev->priv;
4565
4566 bp->rx_ticks = (u16) coal->rx_coalesce_usecs;
4567 if (bp->rx_ticks > 0x3ff) bp->rx_ticks = 0x3ff;
4568
4569 bp->rx_quick_cons_trip = (u16) coal->rx_max_coalesced_frames;
4570 if (bp->rx_quick_cons_trip > 0xff) bp->rx_quick_cons_trip = 0xff;
4571
4572 bp->rx_ticks_int = (u16) coal->rx_coalesce_usecs_irq;
4573 if (bp->rx_ticks_int > 0x3ff) bp->rx_ticks_int = 0x3ff;
4574
4575 bp->rx_quick_cons_trip_int = (u16) coal->rx_max_coalesced_frames_irq;
4576 if (bp->rx_quick_cons_trip_int > 0xff)
4577 bp->rx_quick_cons_trip_int = 0xff;
4578
4579 bp->tx_ticks = (u16) coal->tx_coalesce_usecs;
4580 if (bp->tx_ticks > 0x3ff) bp->tx_ticks = 0x3ff;
4581
4582 bp->tx_quick_cons_trip = (u16) coal->tx_max_coalesced_frames;
4583 if (bp->tx_quick_cons_trip > 0xff) bp->tx_quick_cons_trip = 0xff;
4584
4585 bp->tx_ticks_int = (u16) coal->tx_coalesce_usecs_irq;
4586 if (bp->tx_ticks_int > 0x3ff) bp->tx_ticks_int = 0x3ff;
4587
4588 bp->tx_quick_cons_trip_int = (u16) coal->tx_max_coalesced_frames_irq;
4589 if (bp->tx_quick_cons_trip_int > 0xff) bp->tx_quick_cons_trip_int =
4590 0xff;
4591
4592 bp->stats_ticks = coal->stats_block_coalesce_usecs;
4593 if (bp->stats_ticks > 0xffff00) bp->stats_ticks = 0xffff00;
4594 bp->stats_ticks &= 0xffff00;
4595
4596 if (netif_running(bp->dev)) {
4597 bnx2_netif_stop(bp);
4598 bnx2_init_nic(bp);
4599 bnx2_netif_start(bp);
4600 }
4601
4602 return 0;
4603}
4604
4605static void
4606bnx2_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
4607{
4608 struct bnx2 *bp = dev->priv;
4609
4610 ering->rx_max_pending = MAX_RX_DESC_CNT;
4611 ering->rx_mini_max_pending = 0;
4612 ering->rx_jumbo_max_pending = 0;
4613
4614 ering->rx_pending = bp->rx_ring_size;
4615 ering->rx_mini_pending = 0;
4616 ering->rx_jumbo_pending = 0;
4617
4618 ering->tx_max_pending = MAX_TX_DESC_CNT;
4619 ering->tx_pending = bp->tx_ring_size;
4620}
4621
4622static int
4623bnx2_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
4624{
4625 struct bnx2 *bp = dev->priv;
4626
4627 if ((ering->rx_pending > MAX_RX_DESC_CNT) ||
4628 (ering->tx_pending > MAX_TX_DESC_CNT) ||
4629 (ering->tx_pending <= MAX_SKB_FRAGS)) {
4630
4631 return -EINVAL;
4632 }
4633 bp->rx_ring_size = ering->rx_pending;
4634 bp->tx_ring_size = ering->tx_pending;
4635
4636 if (netif_running(bp->dev)) {
4637 bnx2_netif_stop(bp);
4638 bnx2_init_nic(bp);
4639 bnx2_netif_start(bp);
4640 }
4641
4642 return 0;
4643}
4644
4645static void
4646bnx2_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *epause)
4647{
4648 struct bnx2 *bp = dev->priv;
4649
4650 epause->autoneg = ((bp->autoneg & AUTONEG_FLOW_CTRL) != 0);
4651 epause->rx_pause = ((bp->flow_ctrl & FLOW_CTRL_RX) != 0);
4652 epause->tx_pause = ((bp->flow_ctrl & FLOW_CTRL_TX) != 0);
4653}
4654
4655static int
4656bnx2_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *epause)
4657{
4658 struct bnx2 *bp = dev->priv;
4659
4660 bp->req_flow_ctrl = 0;
4661 if (epause->rx_pause)
4662 bp->req_flow_ctrl |= FLOW_CTRL_RX;
4663 if (epause->tx_pause)
4664 bp->req_flow_ctrl |= FLOW_CTRL_TX;
4665
4666 if (epause->autoneg) {
4667 bp->autoneg |= AUTONEG_FLOW_CTRL;
4668 }
4669 else {
4670 bp->autoneg &= ~AUTONEG_FLOW_CTRL;
4671 }
4672
4673 spin_lock_irq(&bp->phy_lock);
4674
4675 bnx2_setup_phy(bp);
4676
4677 spin_unlock_irq(&bp->phy_lock);
4678
4679 return 0;
4680}
4681
4682static u32
4683bnx2_get_rx_csum(struct net_device *dev)
4684{
4685 struct bnx2 *bp = dev->priv;
4686
4687 return bp->rx_csum;
4688}
4689
4690static int
4691bnx2_set_rx_csum(struct net_device *dev, u32 data)
4692{
4693 struct bnx2 *bp = dev->priv;
4694
4695 bp->rx_csum = data;
4696 return 0;
4697}
4698
4699#define BNX2_NUM_STATS 45
4700
4701struct {
4702 char string[ETH_GSTRING_LEN];
4703} bnx2_stats_str_arr[BNX2_NUM_STATS] = {
4704 { "rx_bytes" },
4705 { "rx_error_bytes" },
4706 { "tx_bytes" },
4707 { "tx_error_bytes" },
4708 { "rx_ucast_packets" },
4709 { "rx_mcast_packets" },
4710 { "rx_bcast_packets" },
4711 { "tx_ucast_packets" },
4712 { "tx_mcast_packets" },
4713 { "tx_bcast_packets" },
4714 { "tx_mac_errors" },
4715 { "tx_carrier_errors" },
4716 { "rx_crc_errors" },
4717 { "rx_align_errors" },
4718 { "tx_single_collisions" },
4719 { "tx_multi_collisions" },
4720 { "tx_deferred" },
4721 { "tx_excess_collisions" },
4722 { "tx_late_collisions" },
4723 { "tx_total_collisions" },
4724 { "rx_fragments" },
4725 { "rx_jabbers" },
4726 { "rx_undersize_packets" },
4727 { "rx_oversize_packets" },
4728 { "rx_64_byte_packets" },
4729 { "rx_65_to_127_byte_packets" },
4730 { "rx_128_to_255_byte_packets" },
4731 { "rx_256_to_511_byte_packets" },
4732 { "rx_512_to_1023_byte_packets" },
4733 { "rx_1024_to_1522_byte_packets" },
4734 { "rx_1523_to_9022_byte_packets" },
4735 { "tx_64_byte_packets" },
4736 { "tx_65_to_127_byte_packets" },
4737 { "tx_128_to_255_byte_packets" },
4738 { "tx_256_to_511_byte_packets" },
4739 { "tx_512_to_1023_byte_packets" },
4740 { "tx_1024_to_1522_byte_packets" },
4741 { "tx_1523_to_9022_byte_packets" },
4742 { "rx_xon_frames" },
4743 { "rx_xoff_frames" },
4744 { "tx_xon_frames" },
4745 { "tx_xoff_frames" },
4746 { "rx_mac_ctrl_frames" },
4747 { "rx_filtered_packets" },
4748 { "rx_discards" },
4749};
4750
4751#define STATS_OFFSET32(offset_name) (offsetof(struct statistics_block, offset_name) / 4)
4752
4753unsigned long bnx2_stats_offset_arr[BNX2_NUM_STATS] = {
4754 STATS_OFFSET32(stat_IfHCInOctets_hi),
4755 STATS_OFFSET32(stat_IfHCInBadOctets_hi),
4756 STATS_OFFSET32(stat_IfHCOutOctets_hi),
4757 STATS_OFFSET32(stat_IfHCOutBadOctets_hi),
4758 STATS_OFFSET32(stat_IfHCInUcastPkts_hi),
4759 STATS_OFFSET32(stat_IfHCInMulticastPkts_hi),
4760 STATS_OFFSET32(stat_IfHCInBroadcastPkts_hi),
4761 STATS_OFFSET32(stat_IfHCOutUcastPkts_hi),
4762 STATS_OFFSET32(stat_IfHCOutMulticastPkts_hi),
4763 STATS_OFFSET32(stat_IfHCOutBroadcastPkts_hi),
4764 STATS_OFFSET32(stat_emac_tx_stat_dot3statsinternalmactransmiterrors),
4765 STATS_OFFSET32(stat_Dot3StatsCarrierSenseErrors),
4766 STATS_OFFSET32(stat_Dot3StatsFCSErrors),
4767 STATS_OFFSET32(stat_Dot3StatsAlignmentErrors),
4768 STATS_OFFSET32(stat_Dot3StatsSingleCollisionFrames),
4769 STATS_OFFSET32(stat_Dot3StatsMultipleCollisionFrames),
4770 STATS_OFFSET32(stat_Dot3StatsDeferredTransmissions),
4771 STATS_OFFSET32(stat_Dot3StatsExcessiveCollisions),
4772 STATS_OFFSET32(stat_Dot3StatsLateCollisions),
4773 STATS_OFFSET32(stat_EtherStatsCollisions),
4774 STATS_OFFSET32(stat_EtherStatsFragments),
4775 STATS_OFFSET32(stat_EtherStatsJabbers),
4776 STATS_OFFSET32(stat_EtherStatsUndersizePkts),
4777 STATS_OFFSET32(stat_EtherStatsOverrsizePkts),
4778 STATS_OFFSET32(stat_EtherStatsPktsRx64Octets),
4779 STATS_OFFSET32(stat_EtherStatsPktsRx65Octetsto127Octets),
4780 STATS_OFFSET32(stat_EtherStatsPktsRx128Octetsto255Octets),
4781 STATS_OFFSET32(stat_EtherStatsPktsRx256Octetsto511Octets),
4782 STATS_OFFSET32(stat_EtherStatsPktsRx512Octetsto1023Octets),
4783 STATS_OFFSET32(stat_EtherStatsPktsRx1024Octetsto1522Octets),
4784 STATS_OFFSET32(stat_EtherStatsPktsRx1523Octetsto9022Octets),
4785 STATS_OFFSET32(stat_EtherStatsPktsTx64Octets),
4786 STATS_OFFSET32(stat_EtherStatsPktsTx65Octetsto127Octets),
4787 STATS_OFFSET32(stat_EtherStatsPktsTx128Octetsto255Octets),
4788 STATS_OFFSET32(stat_EtherStatsPktsTx256Octetsto511Octets),
4789 STATS_OFFSET32(stat_EtherStatsPktsTx512Octetsto1023Octets),
4790 STATS_OFFSET32(stat_EtherStatsPktsTx1024Octetsto1522Octets),
4791 STATS_OFFSET32(stat_EtherStatsPktsTx1523Octetsto9022Octets),
4792 STATS_OFFSET32(stat_XonPauseFramesReceived),
4793 STATS_OFFSET32(stat_XoffPauseFramesReceived),
4794 STATS_OFFSET32(stat_OutXonSent),
4795 STATS_OFFSET32(stat_OutXoffSent),
4796 STATS_OFFSET32(stat_MacControlFramesReceived),
4797 STATS_OFFSET32(stat_IfInFramesL2FilterDiscards),
4798 STATS_OFFSET32(stat_IfInMBUFDiscards),
4799};
4800
4801/* stat_IfHCInBadOctets and stat_Dot3StatsCarrierSenseErrors are
4802 * skipped because of errata.
4803 */
4804u8 bnx2_5706_stats_len_arr[BNX2_NUM_STATS] = {
4805 8,0,8,8,8,8,8,8,8,8,
4806 4,0,4,4,4,4,4,4,4,4,
4807 4,4,4,4,4,4,4,4,4,4,
4808 4,4,4,4,4,4,4,4,4,4,
4809 4,4,4,4,4,
4810};
4811
4812#define BNX2_NUM_TESTS 6
4813
4814struct {
4815 char string[ETH_GSTRING_LEN];
4816} bnx2_tests_str_arr[BNX2_NUM_TESTS] = {
4817 { "register_test (offline)" },
4818 { "memory_test (offline)" },
4819 { "loopback_test (offline)" },
4820 { "nvram_test (online)" },
4821 { "interrupt_test (online)" },
4822 { "link_test (online)" },
4823};
4824
4825static int
4826bnx2_self_test_count(struct net_device *dev)
4827{
4828 return BNX2_NUM_TESTS;
4829}
4830
4831static void
4832bnx2_self_test(struct net_device *dev, struct ethtool_test *etest, u64 *buf)
4833{
4834 struct bnx2 *bp = dev->priv;
4835
4836 memset(buf, 0, sizeof(u64) * BNX2_NUM_TESTS);
4837 if (etest->flags & ETH_TEST_FL_OFFLINE) {
4838 bnx2_netif_stop(bp);
4839 bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_DIAG);
4840 bnx2_free_skbs(bp);
4841
4842 if (bnx2_test_registers(bp) != 0) {
4843 buf[0] = 1;
4844 etest->flags |= ETH_TEST_FL_FAILED;
4845 }
4846 if (bnx2_test_memory(bp) != 0) {
4847 buf[1] = 1;
4848 etest->flags |= ETH_TEST_FL_FAILED;
4849 }
4850 if (bnx2_test_loopback(bp) != 0) {
4851 buf[2] = 1;
4852 etest->flags |= ETH_TEST_FL_FAILED;
4853 }
4854
4855 if (!netif_running(bp->dev)) {
4856 bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_RESET);
4857 }
4858 else {
4859 bnx2_init_nic(bp);
4860 bnx2_netif_start(bp);
4861 }
4862
4863 /* wait for link up */
4864 msleep_interruptible(3000);
4865 if ((!bp->link_up) && !(bp->phy_flags & PHY_SERDES_FLAG))
4866 msleep_interruptible(4000);
4867 }
4868
4869 if (bnx2_test_nvram(bp) != 0) {
4870 buf[3] = 1;
4871 etest->flags |= ETH_TEST_FL_FAILED;
4872 }
4873 if (bnx2_test_intr(bp) != 0) {
4874 buf[4] = 1;
4875 etest->flags |= ETH_TEST_FL_FAILED;
4876 }
4877
4878 if (bnx2_test_link(bp) != 0) {
4879 buf[5] = 1;
4880 etest->flags |= ETH_TEST_FL_FAILED;
4881
4882 }
4883}
4884
4885static void
4886bnx2_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
4887{
4888 switch (stringset) {
4889 case ETH_SS_STATS:
4890 memcpy(buf, bnx2_stats_str_arr,
4891 sizeof(bnx2_stats_str_arr));
4892 break;
4893 case ETH_SS_TEST:
4894 memcpy(buf, bnx2_tests_str_arr,
4895 sizeof(bnx2_tests_str_arr));
4896 break;
4897 }
4898}
4899
4900static int
4901bnx2_get_stats_count(struct net_device *dev)
4902{
4903 return BNX2_NUM_STATS;
4904}
4905
4906static void
4907bnx2_get_ethtool_stats(struct net_device *dev,
4908 struct ethtool_stats *stats, u64 *buf)
4909{
4910 struct bnx2 *bp = dev->priv;
4911 int i;
4912 u32 *hw_stats = (u32 *) bp->stats_blk;
4913 u8 *stats_len_arr = 0;
4914
4915 if (hw_stats == NULL) {
4916 memset(buf, 0, sizeof(u64) * BNX2_NUM_STATS);
4917 return;
4918 }
4919
4920 if (CHIP_NUM(bp) == CHIP_NUM_5706)
4921 stats_len_arr = bnx2_5706_stats_len_arr;
4922
4923 for (i = 0; i < BNX2_NUM_STATS; i++) {
4924 if (stats_len_arr[i] == 0) {
4925 /* skip this counter */
4926 buf[i] = 0;
4927 continue;
4928 }
4929 if (stats_len_arr[i] == 4) {
4930 /* 4-byte counter */
4931 buf[i] = (u64)
4932 *(hw_stats + bnx2_stats_offset_arr[i]);
4933 continue;
4934 }
4935 /* 8-byte counter */
4936 buf[i] = (((u64) *(hw_stats +
4937 bnx2_stats_offset_arr[i])) << 32) +
4938 *(hw_stats + bnx2_stats_offset_arr[i] + 1);
4939 }
4940}
4941
4942static int
4943bnx2_phys_id(struct net_device *dev, u32 data)
4944{
4945 struct bnx2 *bp = dev->priv;
4946 int i;
4947 u32 save;
4948
4949 if (data == 0)
4950 data = 2;
4951
4952 save = REG_RD(bp, BNX2_MISC_CFG);
4953 REG_WR(bp, BNX2_MISC_CFG, BNX2_MISC_CFG_LEDMODE_MAC);
4954
4955 for (i = 0; i < (data * 2); i++) {
4956 if ((i % 2) == 0) {
4957 REG_WR(bp, BNX2_EMAC_LED, BNX2_EMAC_LED_OVERRIDE);
4958 }
4959 else {
4960 REG_WR(bp, BNX2_EMAC_LED, BNX2_EMAC_LED_OVERRIDE |
4961 BNX2_EMAC_LED_1000MB_OVERRIDE |
4962 BNX2_EMAC_LED_100MB_OVERRIDE |
4963 BNX2_EMAC_LED_10MB_OVERRIDE |
4964 BNX2_EMAC_LED_TRAFFIC_OVERRIDE |
4965 BNX2_EMAC_LED_TRAFFIC);
4966 }
4967 msleep_interruptible(500);
4968 if (signal_pending(current))
4969 break;
4970 }
4971 REG_WR(bp, BNX2_EMAC_LED, 0);
4972 REG_WR(bp, BNX2_MISC_CFG, save);
4973 return 0;
4974}
4975
4976static struct ethtool_ops bnx2_ethtool_ops = {
4977 .get_settings = bnx2_get_settings,
4978 .set_settings = bnx2_set_settings,
4979 .get_drvinfo = bnx2_get_drvinfo,
4980 .get_wol = bnx2_get_wol,
4981 .set_wol = bnx2_set_wol,
4982 .nway_reset = bnx2_nway_reset,
4983 .get_link = ethtool_op_get_link,
4984 .get_eeprom_len = bnx2_get_eeprom_len,
4985 .get_eeprom = bnx2_get_eeprom,
4986 .set_eeprom = bnx2_set_eeprom,
4987 .get_coalesce = bnx2_get_coalesce,
4988 .set_coalesce = bnx2_set_coalesce,
4989 .get_ringparam = bnx2_get_ringparam,
4990 .set_ringparam = bnx2_set_ringparam,
4991 .get_pauseparam = bnx2_get_pauseparam,
4992 .set_pauseparam = bnx2_set_pauseparam,
4993 .get_rx_csum = bnx2_get_rx_csum,
4994 .set_rx_csum = bnx2_set_rx_csum,
4995 .get_tx_csum = ethtool_op_get_tx_csum,
4996 .set_tx_csum = ethtool_op_set_tx_csum,
4997 .get_sg = ethtool_op_get_sg,
4998 .set_sg = ethtool_op_set_sg,
4999#ifdef BCM_TSO
5000 .get_tso = ethtool_op_get_tso,
5001 .set_tso = ethtool_op_set_tso,
5002#endif
5003 .self_test_count = bnx2_self_test_count,
5004 .self_test = bnx2_self_test,
5005 .get_strings = bnx2_get_strings,
5006 .phys_id = bnx2_phys_id,
5007 .get_stats_count = bnx2_get_stats_count,
5008 .get_ethtool_stats = bnx2_get_ethtool_stats,
5009};
5010
5011/* Called with rtnl_lock */
5012static int
5013bnx2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
5014{
5015 struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data;
5016 struct bnx2 *bp = dev->priv;
5017 int err;
5018
5019 switch(cmd) {
5020 case SIOCGMIIPHY:
5021 data->phy_id = bp->phy_addr;
5022
5023 /* fallthru */
5024 case SIOCGMIIREG: {
5025 u32 mii_regval;
5026
5027 spin_lock_irq(&bp->phy_lock);
5028 err = bnx2_read_phy(bp, data->reg_num & 0x1f, &mii_regval);
5029 spin_unlock_irq(&bp->phy_lock);
5030
5031 data->val_out = mii_regval;
5032
5033 return err;
5034 }
5035
5036 case SIOCSMIIREG:
5037 if (!capable(CAP_NET_ADMIN))
5038 return -EPERM;
5039
5040 spin_lock_irq(&bp->phy_lock);
5041 err = bnx2_write_phy(bp, data->reg_num & 0x1f, data->val_in);
5042 spin_unlock_irq(&bp->phy_lock);
5043
5044 return err;
5045
5046 default:
5047 /* do nothing */
5048 break;
5049 }
5050 return -EOPNOTSUPP;
5051}
5052
5053/* Called with rtnl_lock */
5054static int
5055bnx2_change_mac_addr(struct net_device *dev, void *p)
5056{
5057 struct sockaddr *addr = p;
5058 struct bnx2 *bp = dev->priv;
5059
5060 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
5061 if (netif_running(dev))
5062 bnx2_set_mac_addr(bp);
5063
5064 return 0;
5065}
5066
5067/* Called with rtnl_lock */
5068static int
5069bnx2_change_mtu(struct net_device *dev, int new_mtu)
5070{
5071 struct bnx2 *bp = dev->priv;
5072
5073 if (((new_mtu + ETH_HLEN) > MAX_ETHERNET_JUMBO_PACKET_SIZE) ||
5074 ((new_mtu + ETH_HLEN) < MIN_ETHERNET_PACKET_SIZE))
5075 return -EINVAL;
5076
5077 dev->mtu = new_mtu;
5078 if (netif_running(dev)) {
5079 bnx2_netif_stop(bp);
5080
5081 bnx2_init_nic(bp);
5082
5083 bnx2_netif_start(bp);
5084 }
5085 return 0;
5086}
5087
5088#if defined(HAVE_POLL_CONTROLLER) || defined(CONFIG_NET_POLL_CONTROLLER)
5089static void
5090poll_bnx2(struct net_device *dev)
5091{
5092 struct bnx2 *bp = dev->priv;
5093
5094 disable_irq(bp->pdev->irq);
5095 bnx2_interrupt(bp->pdev->irq, dev, NULL);
5096 enable_irq(bp->pdev->irq);
5097}
5098#endif
5099
5100static int __devinit
5101bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5102{
5103 struct bnx2 *bp;
5104 unsigned long mem_len;
5105 int rc;
5106 u32 reg;
5107
5108 SET_MODULE_OWNER(dev);
5109 SET_NETDEV_DEV(dev, &pdev->dev);
5110 bp = dev->priv;
5111
5112 bp->flags = 0;
5113 bp->phy_flags = 0;
5114
5115 /* enable device (incl. PCI PM wakeup), and bus-mastering */
5116 rc = pci_enable_device(pdev);
5117 if (rc) {
5118 printk(KERN_ERR PFX "Cannot enable PCI device, aborting.");
5119 goto err_out;
5120 }
5121
5122 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
5123 printk(KERN_ERR PFX "Cannot find PCI device base address, "
5124 "aborting.\n");
5125 rc = -ENODEV;
5126 goto err_out_disable;
5127 }
5128
5129 rc = pci_request_regions(pdev, DRV_MODULE_NAME);
5130 if (rc) {
5131 printk(KERN_ERR PFX "Cannot obtain PCI resources, aborting.\n");
5132 goto err_out_disable;
5133 }
5134
5135 pci_set_master(pdev);
5136
5137 bp->pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
5138 if (bp->pm_cap == 0) {
5139 printk(KERN_ERR PFX "Cannot find power management capability, "
5140 "aborting.\n");
5141 rc = -EIO;
5142 goto err_out_release;
5143 }
5144
5145 bp->pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX);
5146 if (bp->pcix_cap == 0) {
5147 printk(KERN_ERR PFX "Cannot find PCIX capability, aborting.\n");
5148 rc = -EIO;
5149 goto err_out_release;
5150 }
5151
5152 if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) {
5153 bp->flags |= USING_DAC_FLAG;
5154 if (pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK) != 0) {
5155 printk(KERN_ERR PFX "pci_set_consistent_dma_mask "
5156 "failed, aborting.\n");
5157 rc = -EIO;
5158 goto err_out_release;
5159 }
5160 }
5161 else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) {
5162 printk(KERN_ERR PFX "System does not support DMA, aborting.\n");
5163 rc = -EIO;
5164 goto err_out_release;
5165 }
5166
5167 bp->dev = dev;
5168 bp->pdev = pdev;
5169
5170 spin_lock_init(&bp->phy_lock);
5171 spin_lock_init(&bp->tx_lock);
5172 INIT_WORK(&bp->reset_task, bnx2_reset_task, bp);
5173
5174 dev->base_addr = dev->mem_start = pci_resource_start(pdev, 0);
5175 mem_len = MB_GET_CID_ADDR(17);
5176 dev->mem_end = dev->mem_start + mem_len;
5177 dev->irq = pdev->irq;
5178
5179 bp->regview = ioremap_nocache(dev->base_addr, mem_len);
5180
5181 if (!bp->regview) {
5182 printk(KERN_ERR PFX "Cannot map register space, aborting.\n");
5183 rc = -ENOMEM;
5184 goto err_out_release;
5185 }
5186
5187 /* Configure byte swap and enable write to the reg_window registers.
5188 * Rely on CPU to do target byte swapping on big endian systems
5189 * The chip's target access swapping will not swap all accesses
5190 */
5191 pci_write_config_dword(bp->pdev, BNX2_PCICFG_MISC_CONFIG,
5192 BNX2_PCICFG_MISC_CONFIG_REG_WINDOW_ENA |
5193 BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP);
5194
5195 bnx2_set_power_state(bp, 0);
5196
5197 bp->chip_id = REG_RD(bp, BNX2_MISC_ID);
5198
5199 bp->phy_addr = 1;
5200
5201 /* Get bus information. */
5202 reg = REG_RD(bp, BNX2_PCICFG_MISC_STATUS);
5203 if (reg & BNX2_PCICFG_MISC_STATUS_PCIX_DET) {
5204 u32 clkreg;
5205
5206 bp->flags |= PCIX_FLAG;
5207
5208 clkreg = REG_RD(bp, BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS);
5209
5210 clkreg &= BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET;
5211 switch (clkreg) {
5212 case BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_133MHZ:
5213 bp->bus_speed_mhz = 133;
5214 break;
5215
5216 case BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_95MHZ:
5217 bp->bus_speed_mhz = 100;
5218 break;
5219
5220 case BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_66MHZ:
5221 case BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_80MHZ:
5222 bp->bus_speed_mhz = 66;
5223 break;
5224
5225 case BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_48MHZ:
5226 case BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_55MHZ:
5227 bp->bus_speed_mhz = 50;
5228 break;
5229
5230 case BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_LOW:
5231 case BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_32MHZ:
5232 case BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_38MHZ:
5233 bp->bus_speed_mhz = 33;
5234 break;
5235 }
5236 }
5237 else {
5238 if (reg & BNX2_PCICFG_MISC_STATUS_M66EN)
5239 bp->bus_speed_mhz = 66;
5240 else
5241 bp->bus_speed_mhz = 33;
5242 }
5243
5244 if (reg & BNX2_PCICFG_MISC_STATUS_32BIT_DET)
5245 bp->flags |= PCI_32BIT_FLAG;
5246
5247 /* 5706A0 may falsely detect SERR and PERR. */
5248 if (CHIP_ID(bp) == CHIP_ID_5706_A0) {
5249 reg = REG_RD(bp, PCI_COMMAND);
5250 reg &= ~(PCI_COMMAND_SERR | PCI_COMMAND_PARITY);
5251 REG_WR(bp, PCI_COMMAND, reg);
5252 }
5253 else if ((CHIP_ID(bp) == CHIP_ID_5706_A1) &&
5254 !(bp->flags & PCIX_FLAG)) {
5255
5256 printk(KERN_ERR PFX "5706 A1 can only be used in a PCIX bus, "
5257 "aborting.\n");
5258 goto err_out_unmap;
5259 }
5260
5261 bnx2_init_nvram(bp);
5262
5263 /* Get the permanent MAC address. First we need to make sure the
5264 * firmware is actually running.
5265 */
5266 reg = REG_RD_IND(bp, HOST_VIEW_SHMEM_BASE + BNX2_DEV_INFO_SIGNATURE);
5267
5268 if ((reg & BNX2_DEV_INFO_SIGNATURE_MAGIC_MASK) !=
5269 BNX2_DEV_INFO_SIGNATURE_MAGIC) {
5270 printk(KERN_ERR PFX "Firmware not running, aborting.\n");
5271 rc = -ENODEV;
5272 goto err_out_unmap;
5273 }
5274
5275 bp->fw_ver = REG_RD_IND(bp, HOST_VIEW_SHMEM_BASE +
5276 BNX2_DEV_INFO_BC_REV);
5277
5278 reg = REG_RD_IND(bp, HOST_VIEW_SHMEM_BASE + BNX2_PORT_HW_CFG_MAC_UPPER);
5279 bp->mac_addr[0] = (u8) (reg >> 8);
5280 bp->mac_addr[1] = (u8) reg;
5281
5282 reg = REG_RD_IND(bp, HOST_VIEW_SHMEM_BASE + BNX2_PORT_HW_CFG_MAC_LOWER);
5283 bp->mac_addr[2] = (u8) (reg >> 24);
5284 bp->mac_addr[3] = (u8) (reg >> 16);
5285 bp->mac_addr[4] = (u8) (reg >> 8);
5286 bp->mac_addr[5] = (u8) reg;
5287
5288 bp->tx_ring_size = MAX_TX_DESC_CNT;
5289 bp->rx_ring_size = 100;
5290
5291 bp->rx_csum = 1;
5292
5293 bp->rx_offset = sizeof(struct l2_fhdr) + 2;
5294
5295 bp->tx_quick_cons_trip_int = 20;
5296 bp->tx_quick_cons_trip = 20;
5297 bp->tx_ticks_int = 80;
5298 bp->tx_ticks = 80;
5299
5300 bp->rx_quick_cons_trip_int = 6;
5301 bp->rx_quick_cons_trip = 6;
5302 bp->rx_ticks_int = 18;
5303 bp->rx_ticks = 18;
5304
5305 bp->stats_ticks = 1000000 & 0xffff00;
5306
5307 bp->timer_interval = HZ;
5308
5309 /* Disable WOL support if we are running on a SERDES chip. */
5310 if (CHIP_BOND_ID(bp) & CHIP_BOND_ID_SERDES_BIT) {
5311 bp->phy_flags |= PHY_SERDES_FLAG;
5312 bp->flags |= NO_WOL_FLAG;
5313 }
5314
5315 if (CHIP_ID(bp) == CHIP_ID_5706_A0) {
5316 bp->tx_quick_cons_trip_int =
5317 bp->tx_quick_cons_trip;
5318 bp->tx_ticks_int = bp->tx_ticks;
5319 bp->rx_quick_cons_trip_int =
5320 bp->rx_quick_cons_trip;
5321 bp->rx_ticks_int = bp->rx_ticks;
5322 bp->comp_prod_trip_int = bp->comp_prod_trip;
5323 bp->com_ticks_int = bp->com_ticks;
5324 bp->cmd_ticks_int = bp->cmd_ticks;
5325 }
5326
5327 bp->autoneg = AUTONEG_SPEED | AUTONEG_FLOW_CTRL;
5328 bp->req_line_speed = 0;
5329 if (bp->phy_flags & PHY_SERDES_FLAG) {
5330 bp->advertising = ETHTOOL_ALL_FIBRE_SPEED | ADVERTISED_Autoneg;
5331 }
5332 else {
5333 bp->advertising = ETHTOOL_ALL_COPPER_SPEED | ADVERTISED_Autoneg;
5334 }
5335
5336 bp->req_flow_ctrl = FLOW_CTRL_RX | FLOW_CTRL_TX;
5337
5338 return 0;
5339
5340err_out_unmap:
5341 if (bp->regview) {
5342 iounmap(bp->regview);
5343 }
5344
5345err_out_release:
5346 pci_release_regions(pdev);
5347
5348err_out_disable:
5349 pci_disable_device(pdev);
5350 pci_set_drvdata(pdev, NULL);
5351
5352err_out:
5353 return rc;
5354}
5355
5356static int __devinit
5357bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
5358{
5359 static int version_printed = 0;
5360 struct net_device *dev = NULL;
5361 struct bnx2 *bp;
5362 int rc, i;
5363
5364 if (version_printed++ == 0)
5365 printk(KERN_INFO "%s", version);
5366
5367 /* dev zeroed in init_etherdev */
5368 dev = alloc_etherdev(sizeof(*bp));
5369
5370 if (!dev)
5371 return -ENOMEM;
5372
5373 rc = bnx2_init_board(pdev, dev);
5374 if (rc < 0) {
5375 free_netdev(dev);
5376 return rc;
5377 }
5378
5379 dev->open = bnx2_open;
5380 dev->hard_start_xmit = bnx2_start_xmit;
5381 dev->stop = bnx2_close;
5382 dev->get_stats = bnx2_get_stats;
5383 dev->set_multicast_list = bnx2_set_rx_mode;
5384 dev->do_ioctl = bnx2_ioctl;
5385 dev->set_mac_address = bnx2_change_mac_addr;
5386 dev->change_mtu = bnx2_change_mtu;
5387 dev->tx_timeout = bnx2_tx_timeout;
5388 dev->watchdog_timeo = TX_TIMEOUT;
5389#ifdef BCM_VLAN
5390 dev->vlan_rx_register = bnx2_vlan_rx_register;
5391 dev->vlan_rx_kill_vid = bnx2_vlan_rx_kill_vid;
5392#endif
5393 dev->poll = bnx2_poll;
5394 dev->ethtool_ops = &bnx2_ethtool_ops;
5395 dev->weight = 64;
5396
5397 bp = dev->priv;
5398
5399#if defined(HAVE_POLL_CONTROLLER) || defined(CONFIG_NET_POLL_CONTROLLER)
5400 dev->poll_controller = poll_bnx2;
5401#endif
5402
5403 if ((rc = register_netdev(dev))) {
5404 printk(KERN_ERR PFX "Cannot register net device\n");
5405 if (bp->regview)
5406 iounmap(bp->regview);
5407 pci_release_regions(pdev);
5408 pci_disable_device(pdev);
5409 pci_set_drvdata(pdev, NULL);
5410 free_netdev(dev);
5411 return rc;
5412 }
5413
5414 pci_set_drvdata(pdev, dev);
5415
5416 memcpy(dev->dev_addr, bp->mac_addr, 6);
5417 bp->name = board_info[ent->driver_data].name,
5418 printk(KERN_INFO "%s: %s (%c%d) PCI%s %s %dMHz found at mem %lx, "
5419 "IRQ %d, ",
5420 dev->name,
5421 bp->name,
5422 ((CHIP_ID(bp) & 0xf000) >> 12) + 'A',
5423 ((CHIP_ID(bp) & 0x0ff0) >> 4),
5424 ((bp->flags & PCIX_FLAG) ? "-X" : ""),
5425 ((bp->flags & PCI_32BIT_FLAG) ? "32-bit" : "64-bit"),
5426 bp->bus_speed_mhz,
5427 dev->base_addr,
5428 bp->pdev->irq);
5429
5430 printk("node addr ");
5431 for (i = 0; i < 6; i++)
5432 printk("%2.2x", dev->dev_addr[i]);
5433 printk("\n");
5434
5435 dev->features |= NETIF_F_SG;
5436 if (bp->flags & USING_DAC_FLAG)
5437 dev->features |= NETIF_F_HIGHDMA;
5438 dev->features |= NETIF_F_IP_CSUM;
5439#ifdef BCM_VLAN
5440 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
5441#endif
5442#ifdef BCM_TSO
5443 dev->features |= NETIF_F_TSO;
5444#endif
5445
5446 netif_carrier_off(bp->dev);
5447
5448 return 0;
5449}
5450
5451static void __devexit
5452bnx2_remove_one(struct pci_dev *pdev)
5453{
5454 struct net_device *dev = pci_get_drvdata(pdev);
5455 struct bnx2 *bp = dev->priv;
5456
5457 unregister_netdev(dev);
5458
5459 if (bp->regview)
5460 iounmap(bp->regview);
5461
5462 free_netdev(dev);
5463 pci_release_regions(pdev);
5464 pci_disable_device(pdev);
5465 pci_set_drvdata(pdev, NULL);
5466}
5467
5468static int
5469bnx2_suspend(struct pci_dev *pdev, u32 state)
5470{
5471 struct net_device *dev = pci_get_drvdata(pdev);
5472 struct bnx2 *bp = dev->priv;
5473 u32 reset_code;
5474
5475 if (!netif_running(dev))
5476 return 0;
5477
5478 bnx2_netif_stop(bp);
5479 netif_device_detach(dev);
5480 del_timer_sync(&bp->timer);
5481 if (bp->wol)
5482 reset_code = BNX2_DRV_MSG_CODE_SUSPEND_WOL;
5483 else
5484 reset_code = BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL;
5485 bnx2_reset_chip(bp, reset_code);
5486 bnx2_free_skbs(bp);
5487 bnx2_set_power_state(bp, state);
5488 return 0;
5489}
5490
5491static int
5492bnx2_resume(struct pci_dev *pdev)
5493{
5494 struct net_device *dev = pci_get_drvdata(pdev);
5495 struct bnx2 *bp = dev->priv;
5496
5497 if (!netif_running(dev))
5498 return 0;
5499
5500 bnx2_set_power_state(bp, 0);
5501 netif_device_attach(dev);
5502 bnx2_init_nic(bp);
5503 bnx2_netif_start(bp);
5504 return 0;
5505}
5506
5507static struct pci_driver bnx2_pci_driver = {
5508 name: DRV_MODULE_NAME,
5509 id_table: bnx2_pci_tbl,
5510 probe: bnx2_init_one,
5511 remove: __devexit_p(bnx2_remove_one),
5512 suspend: bnx2_suspend,
5513 resume: bnx2_resume,
5514};
5515
5516static int __init bnx2_init(void)
5517{
5518 return pci_module_init(&bnx2_pci_driver);
5519}
5520
5521static void __exit bnx2_cleanup(void)
5522{
5523 pci_unregister_driver(&bnx2_pci_driver);
5524}
5525
5526module_init(bnx2_init);
5527module_exit(bnx2_cleanup);
5528
5529
5530
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
new file mode 100644
index 000000000000..8214a2853d0d
--- /dev/null
+++ b/drivers/net/bnx2.h
@@ -0,0 +1,4352 @@
1/* bnx2.h: Broadcom NX2 network driver.
2 *
3 * Copyright (c) 2004, 2005 Broadcom Corporation
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation.
8 *
9 * Written by: Michael Chan (mchan@broadcom.com)
10 */
11
12
13#ifndef BNX2_H
14#define BNX2_H
15
16#include <linux/config.h>
17
18#include <linux/module.h>
19#include <linux/moduleparam.h>
20
21#include <linux/kernel.h>
22#include <linux/timer.h>
23#include <linux/errno.h>
24#include <linux/ioport.h>
25#include <linux/slab.h>
26#include <linux/interrupt.h>
27#include <linux/pci.h>
28#include <linux/init.h>
29#include <linux/netdevice.h>
30#include <linux/etherdevice.h>
31#include <linux/skbuff.h>
32#include <linux/dma-mapping.h>
33#include <asm/bitops.h>
34#include <asm/io.h>
35#include <asm/irq.h>
36#include <linux/delay.h>
37#include <asm/byteorder.h>
38#include <linux/time.h>
39#include <linux/ethtool.h>
40#include <linux/mii.h>
41#ifdef NETIF_F_HW_VLAN_TX
42#include <linux/if_vlan.h>
43#define BCM_VLAN 1
44#endif
45#ifdef NETIF_F_TSO
46#include <net/ip.h>
47#include <net/tcp.h>
48#include <net/checksum.h>
49#define BCM_TSO 1
50#endif
51#include <linux/workqueue.h>
52#include <linux/crc32.h>
53
54/* Hardware data structures and register definitions automatically
55 * generated from RTL code. Do not modify.
56 */
57
58/*
59 * tx_bd definition
60 */
61struct tx_bd {
62 u32 tx_bd_haddr_hi;
63 u32 tx_bd_haddr_lo;
64 u32 tx_bd_mss_nbytes;
65 u32 tx_bd_vlan_tag_flags;
66 #define TX_BD_FLAGS_CONN_FAULT (1<<0)
67 #define TX_BD_FLAGS_TCP_UDP_CKSUM (1<<1)
68 #define TX_BD_FLAGS_IP_CKSUM (1<<2)
69 #define TX_BD_FLAGS_VLAN_TAG (1<<3)
70 #define TX_BD_FLAGS_COAL_NOW (1<<4)
71 #define TX_BD_FLAGS_DONT_GEN_CRC (1<<5)
72 #define TX_BD_FLAGS_END (1<<6)
73 #define TX_BD_FLAGS_START (1<<7)
74 #define TX_BD_FLAGS_SW_OPTION_WORD (0x1f<<8)
75 #define TX_BD_FLAGS_SW_FLAGS (1<<13)
76 #define TX_BD_FLAGS_SW_SNAP (1<<14)
77 #define TX_BD_FLAGS_SW_LSO (1<<15)
78
79};
80
81
82/*
83 * rx_bd definition
84 */
85struct rx_bd {
86 u32 rx_bd_haddr_hi;
87 u32 rx_bd_haddr_lo;
88 u32 rx_bd_len;
89 u32 rx_bd_flags;
90 #define RX_BD_FLAGS_NOPUSH (1<<0)
91 #define RX_BD_FLAGS_DUMMY (1<<1)
92 #define RX_BD_FLAGS_END (1<<2)
93 #define RX_BD_FLAGS_START (1<<3)
94
95};
96
97
98/*
99 * status_block definition
100 */
101struct status_block {
102 u32 status_attn_bits;
103 #define STATUS_ATTN_BITS_LINK_STATE (1L<<0)
104 #define STATUS_ATTN_BITS_TX_SCHEDULER_ABORT (1L<<1)
105 #define STATUS_ATTN_BITS_TX_BD_READ_ABORT (1L<<2)
106 #define STATUS_ATTN_BITS_TX_BD_CACHE_ABORT (1L<<3)
107 #define STATUS_ATTN_BITS_TX_PROCESSOR_ABORT (1L<<4)
108 #define STATUS_ATTN_BITS_TX_DMA_ABORT (1L<<5)
109 #define STATUS_ATTN_BITS_TX_PATCHUP_ABORT (1L<<6)
110 #define STATUS_ATTN_BITS_TX_ASSEMBLER_ABORT (1L<<7)
111 #define STATUS_ATTN_BITS_RX_PARSER_MAC_ABORT (1L<<8)
112 #define STATUS_ATTN_BITS_RX_PARSER_CATCHUP_ABORT (1L<<9)
113 #define STATUS_ATTN_BITS_RX_MBUF_ABORT (1L<<10)
114 #define STATUS_ATTN_BITS_RX_LOOKUP_ABORT (1L<<11)
115 #define STATUS_ATTN_BITS_RX_PROCESSOR_ABORT (1L<<12)
116 #define STATUS_ATTN_BITS_RX_V2P_ABORT (1L<<13)
117 #define STATUS_ATTN_BITS_RX_BD_CACHE_ABORT (1L<<14)
118 #define STATUS_ATTN_BITS_RX_DMA_ABORT (1L<<15)
119 #define STATUS_ATTN_BITS_COMPLETION_ABORT (1L<<16)
120 #define STATUS_ATTN_BITS_HOST_COALESCE_ABORT (1L<<17)
121 #define STATUS_ATTN_BITS_MAILBOX_QUEUE_ABORT (1L<<18)
122 #define STATUS_ATTN_BITS_CONTEXT_ABORT (1L<<19)
123 #define STATUS_ATTN_BITS_CMD_SCHEDULER_ABORT (1L<<20)
124 #define STATUS_ATTN_BITS_CMD_PROCESSOR_ABORT (1L<<21)
125 #define STATUS_ATTN_BITS_MGMT_PROCESSOR_ABORT (1L<<22)
126 #define STATUS_ATTN_BITS_MAC_ABORT (1L<<23)
127 #define STATUS_ATTN_BITS_TIMER_ABORT (1L<<24)
128 #define STATUS_ATTN_BITS_DMAE_ABORT (1L<<25)
129 #define STATUS_ATTN_BITS_FLSH_ABORT (1L<<26)
130 #define STATUS_ATTN_BITS_GRC_ABORT (1L<<27)
131 #define STATUS_ATTN_BITS_PARITY_ERROR (1L<<31)
132
133 u32 status_attn_bits_ack;
134#if defined(__BIG_ENDIAN)
135 u16 status_tx_quick_consumer_index0;
136 u16 status_tx_quick_consumer_index1;
137 u16 status_tx_quick_consumer_index2;
138 u16 status_tx_quick_consumer_index3;
139 u16 status_rx_quick_consumer_index0;
140 u16 status_rx_quick_consumer_index1;
141 u16 status_rx_quick_consumer_index2;
142 u16 status_rx_quick_consumer_index3;
143 u16 status_rx_quick_consumer_index4;
144 u16 status_rx_quick_consumer_index5;
145 u16 status_rx_quick_consumer_index6;
146 u16 status_rx_quick_consumer_index7;
147 u16 status_rx_quick_consumer_index8;
148 u16 status_rx_quick_consumer_index9;
149 u16 status_rx_quick_consumer_index10;
150 u16 status_rx_quick_consumer_index11;
151 u16 status_rx_quick_consumer_index12;
152 u16 status_rx_quick_consumer_index13;
153 u16 status_rx_quick_consumer_index14;
154 u16 status_rx_quick_consumer_index15;
155 u16 status_completion_producer_index;
156 u16 status_cmd_consumer_index;
157 u16 status_idx;
158 u16 status_unused;
159#elif defined(__LITTLE_ENDIAN)
160 u16 status_tx_quick_consumer_index1;
161 u16 status_tx_quick_consumer_index0;
162 u16 status_tx_quick_consumer_index3;
163 u16 status_tx_quick_consumer_index2;
164 u16 status_rx_quick_consumer_index1;
165 u16 status_rx_quick_consumer_index0;
166 u16 status_rx_quick_consumer_index3;
167 u16 status_rx_quick_consumer_index2;
168 u16 status_rx_quick_consumer_index5;
169 u16 status_rx_quick_consumer_index4;
170 u16 status_rx_quick_consumer_index7;
171 u16 status_rx_quick_consumer_index6;
172 u16 status_rx_quick_consumer_index9;
173 u16 status_rx_quick_consumer_index8;
174 u16 status_rx_quick_consumer_index11;
175 u16 status_rx_quick_consumer_index10;
176 u16 status_rx_quick_consumer_index13;
177 u16 status_rx_quick_consumer_index12;
178 u16 status_rx_quick_consumer_index15;
179 u16 status_rx_quick_consumer_index14;
180 u16 status_cmd_consumer_index;
181 u16 status_completion_producer_index;
182 u16 status_unused;
183 u16 status_idx;
184#endif
185};
186
187
188/*
189 * statistics_block definition
190 */
191struct statistics_block {
192 u32 stat_IfHCInOctets_hi;
193 u32 stat_IfHCInOctets_lo;
194 u32 stat_IfHCInBadOctets_hi;
195 u32 stat_IfHCInBadOctets_lo;
196 u32 stat_IfHCOutOctets_hi;
197 u32 stat_IfHCOutOctets_lo;
198 u32 stat_IfHCOutBadOctets_hi;
199 u32 stat_IfHCOutBadOctets_lo;
200 u32 stat_IfHCInUcastPkts_hi;
201 u32 stat_IfHCInUcastPkts_lo;
202 u32 stat_IfHCInMulticastPkts_hi;
203 u32 stat_IfHCInMulticastPkts_lo;
204 u32 stat_IfHCInBroadcastPkts_hi;
205 u32 stat_IfHCInBroadcastPkts_lo;
206 u32 stat_IfHCOutUcastPkts_hi;
207 u32 stat_IfHCOutUcastPkts_lo;
208 u32 stat_IfHCOutMulticastPkts_hi;
209 u32 stat_IfHCOutMulticastPkts_lo;
210 u32 stat_IfHCOutBroadcastPkts_hi;
211 u32 stat_IfHCOutBroadcastPkts_lo;
212 u32 stat_emac_tx_stat_dot3statsinternalmactransmiterrors;
213 u32 stat_Dot3StatsCarrierSenseErrors;
214 u32 stat_Dot3StatsFCSErrors;
215 u32 stat_Dot3StatsAlignmentErrors;
216 u32 stat_Dot3StatsSingleCollisionFrames;
217 u32 stat_Dot3StatsMultipleCollisionFrames;
218 u32 stat_Dot3StatsDeferredTransmissions;
219 u32 stat_Dot3StatsExcessiveCollisions;
220 u32 stat_Dot3StatsLateCollisions;
221 u32 stat_EtherStatsCollisions;
222 u32 stat_EtherStatsFragments;
223 u32 stat_EtherStatsJabbers;
224 u32 stat_EtherStatsUndersizePkts;
225 u32 stat_EtherStatsOverrsizePkts;
226 u32 stat_EtherStatsPktsRx64Octets;
227 u32 stat_EtherStatsPktsRx65Octetsto127Octets;
228 u32 stat_EtherStatsPktsRx128Octetsto255Octets;
229 u32 stat_EtherStatsPktsRx256Octetsto511Octets;
230 u32 stat_EtherStatsPktsRx512Octetsto1023Octets;
231 u32 stat_EtherStatsPktsRx1024Octetsto1522Octets;
232 u32 stat_EtherStatsPktsRx1523Octetsto9022Octets;
233 u32 stat_EtherStatsPktsTx64Octets;
234 u32 stat_EtherStatsPktsTx65Octetsto127Octets;
235 u32 stat_EtherStatsPktsTx128Octetsto255Octets;
236 u32 stat_EtherStatsPktsTx256Octetsto511Octets;
237 u32 stat_EtherStatsPktsTx512Octetsto1023Octets;
238 u32 stat_EtherStatsPktsTx1024Octetsto1522Octets;
239 u32 stat_EtherStatsPktsTx1523Octetsto9022Octets;
240 u32 stat_XonPauseFramesReceived;
241 u32 stat_XoffPauseFramesReceived;
242 u32 stat_OutXonSent;
243 u32 stat_OutXoffSent;
244 u32 stat_FlowControlDone;
245 u32 stat_MacControlFramesReceived;
246 u32 stat_XoffStateEntered;
247 u32 stat_IfInFramesL2FilterDiscards;
248 u32 stat_IfInRuleCheckerDiscards;
249 u32 stat_IfInFTQDiscards;
250 u32 stat_IfInMBUFDiscards;
251 u32 stat_IfInRuleCheckerP4Hit;
252 u32 stat_CatchupInRuleCheckerDiscards;
253 u32 stat_CatchupInFTQDiscards;
254 u32 stat_CatchupInMBUFDiscards;
255 u32 stat_CatchupInRuleCheckerP4Hit;
256 u32 stat_GenStat00;
257 u32 stat_GenStat01;
258 u32 stat_GenStat02;
259 u32 stat_GenStat03;
260 u32 stat_GenStat04;
261 u32 stat_GenStat05;
262 u32 stat_GenStat06;
263 u32 stat_GenStat07;
264 u32 stat_GenStat08;
265 u32 stat_GenStat09;
266 u32 stat_GenStat10;
267 u32 stat_GenStat11;
268 u32 stat_GenStat12;
269 u32 stat_GenStat13;
270 u32 stat_GenStat14;
271 u32 stat_GenStat15;
272};
273
274
275/*
276 * l2_fhdr definition
277 */
278struct l2_fhdr {
279#if defined(__BIG_ENDIAN)
280 u16 l2_fhdr_errors;
281 u16 l2_fhdr_status;
282#elif defined(__LITTLE_ENDIAN)
283 u16 l2_fhdr_status;
284 u16 l2_fhdr_errors;
285#endif
286 #define L2_FHDR_ERRORS_BAD_CRC (1<<1)
287 #define L2_FHDR_ERRORS_PHY_DECODE (1<<2)
288 #define L2_FHDR_ERRORS_ALIGNMENT (1<<3)
289 #define L2_FHDR_ERRORS_TOO_SHORT (1<<4)
290 #define L2_FHDR_ERRORS_GIANT_FRAME (1<<5)
291
292 #define L2_FHDR_STATUS_RULE_CLASS (0x7<<0)
293 #define L2_FHDR_STATUS_RULE_P2 (1<<3)
294 #define L2_FHDR_STATUS_RULE_P3 (1<<4)
295 #define L2_FHDR_STATUS_RULE_P4 (1<<5)
296 #define L2_FHDR_STATUS_L2_VLAN_TAG (1<<6)
297 #define L2_FHDR_STATUS_L2_LLC_SNAP (1<<7)
298 #define L2_FHDR_STATUS_RSS_HASH (1<<8)
299 #define L2_FHDR_STATUS_IP_DATAGRAM (1<<13)
300 #define L2_FHDR_STATUS_TCP_SEGMENT (1<<14)
301 #define L2_FHDR_STATUS_UDP_DATAGRAM (1<<15)
302
303 u32 l2_fhdr_hash;
304#if defined(__BIG_ENDIAN)
305 u16 l2_fhdr_pkt_len;
306 u16 l2_fhdr_vlan_tag;
307 u16 l2_fhdr_ip_xsum;
308 u16 l2_fhdr_tcp_udp_xsum;
309#elif defined(__LITTLE_ENDIAN)
310 u16 l2_fhdr_vlan_tag;
311 u16 l2_fhdr_pkt_len;
312 u16 l2_fhdr_tcp_udp_xsum;
313 u16 l2_fhdr_ip_xsum;
314#endif
315};
316
317
318/*
319 * l2_context definition
320 */
321#define BNX2_L2CTX_TYPE 0x00000000
322#define BNX2_L2CTX_TYPE_SIZE_L2 ((0xc0/0x20)<<16)
323#define BNX2_L2CTX_TYPE_TYPE (0xf<<28)
324#define BNX2_L2CTX_TYPE_TYPE_EMPTY (0<<28)
325#define BNX2_L2CTX_TYPE_TYPE_L2 (1<<28)
326
327#define BNX2_L2CTX_TX_HOST_BIDX 0x00000088
328#define BNX2_L2CTX_EST_NBD 0x00000088
329#define BNX2_L2CTX_CMD_TYPE 0x00000088
330#define BNX2_L2CTX_CMD_TYPE_TYPE (0xf<<24)
331#define BNX2_L2CTX_CMD_TYPE_TYPE_L2 (0<<24)
332#define BNX2_L2CTX_CMD_TYPE_TYPE_TCP (1<<24)
333
334#define BNX2_L2CTX_TX_HOST_BSEQ 0x00000090
335#define BNX2_L2CTX_TSCH_BSEQ 0x00000094
336#define BNX2_L2CTX_TBDR_BSEQ 0x00000098
337#define BNX2_L2CTX_TBDR_BOFF 0x0000009c
338#define BNX2_L2CTX_TBDR_BIDX 0x0000009c
339#define BNX2_L2CTX_TBDR_BHADDR_HI 0x000000a0
340#define BNX2_L2CTX_TBDR_BHADDR_LO 0x000000a4
341#define BNX2_L2CTX_TXP_BOFF 0x000000a8
342#define BNX2_L2CTX_TXP_BIDX 0x000000a8
343#define BNX2_L2CTX_TXP_BSEQ 0x000000ac
344
345
346/*
347 * l2_bd_chain_context definition
348 */
349#define BNX2_L2CTX_BD_PRE_READ 0x00000000
350#define BNX2_L2CTX_CTX_SIZE 0x00000000
351#define BNX2_L2CTX_CTX_TYPE 0x00000000
352#define BNX2_L2CTX_CTX_TYPE_SIZE_L2 ((0x20/20)<<16)
353#define BNX2_L2CTX_CTX_TYPE_CTX_BD_CHN_TYPE (0xf<<28)
354#define BNX2_L2CTX_CTX_TYPE_CTX_BD_CHN_TYPE_UNDEFINED (0<<28)
355#define BNX2_L2CTX_CTX_TYPE_CTX_BD_CHN_TYPE_VALUE (1<<28)
356
357#define BNX2_L2CTX_HOST_BDIDX 0x00000004
358#define BNX2_L2CTX_HOST_BSEQ 0x00000008
359#define BNX2_L2CTX_NX_BSEQ 0x0000000c
360#define BNX2_L2CTX_NX_BDHADDR_HI 0x00000010
361#define BNX2_L2CTX_NX_BDHADDR_LO 0x00000014
362#define BNX2_L2CTX_NX_BDIDX 0x00000018
363
364
365/*
366 * pci_config_l definition
367 * offset: 0000
368 */
369#define BNX2_PCICFG_MISC_CONFIG 0x00000068
370#define BNX2_PCICFG_MISC_CONFIG_TARGET_BYTE_SWAP (1L<<2)
371#define BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP (1L<<3)
372#define BNX2_PCICFG_MISC_CONFIG_CLOCK_CTL_ENA (1L<<5)
373#define BNX2_PCICFG_MISC_CONFIG_TARGET_GRC_WORD_SWAP (1L<<6)
374#define BNX2_PCICFG_MISC_CONFIG_REG_WINDOW_ENA (1L<<7)
375#define BNX2_PCICFG_MISC_CONFIG_CORE_RST_REQ (1L<<8)
376#define BNX2_PCICFG_MISC_CONFIG_CORE_RST_BSY (1L<<9)
377#define BNX2_PCICFG_MISC_CONFIG_ASIC_METAL_REV (0xffL<<16)
378#define BNX2_PCICFG_MISC_CONFIG_ASIC_BASE_REV (0xfL<<24)
379#define BNX2_PCICFG_MISC_CONFIG_ASIC_ID (0xfL<<28)
380
381#define BNX2_PCICFG_MISC_STATUS 0x0000006c
382#define BNX2_PCICFG_MISC_STATUS_INTA_VALUE (1L<<0)
383#define BNX2_PCICFG_MISC_STATUS_32BIT_DET (1L<<1)
384#define BNX2_PCICFG_MISC_STATUS_M66EN (1L<<2)
385#define BNX2_PCICFG_MISC_STATUS_PCIX_DET (1L<<3)
386#define BNX2_PCICFG_MISC_STATUS_PCIX_SPEED (0x3L<<4)
387#define BNX2_PCICFG_MISC_STATUS_PCIX_SPEED_66 (0L<<4)
388#define BNX2_PCICFG_MISC_STATUS_PCIX_SPEED_100 (1L<<4)
389#define BNX2_PCICFG_MISC_STATUS_PCIX_SPEED_133 (2L<<4)
390#define BNX2_PCICFG_MISC_STATUS_PCIX_SPEED_PCI_MODE (3L<<4)
391
392#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS 0x00000070
393#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET (0xfL<<0)
394#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_32MHZ (0L<<0)
395#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_38MHZ (1L<<0)
396#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_48MHZ (2L<<0)
397#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_55MHZ (3L<<0)
398#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_66MHZ (4L<<0)
399#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_80MHZ (5L<<0)
400#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_95MHZ (6L<<0)
401#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_133MHZ (7L<<0)
402#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_LOW (0xfL<<0)
403#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_DISABLE (1L<<6)
404#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_ALT (1L<<7)
405#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_ALT_SRC (0x7L<<8)
406#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_ALT_SRC_UNDEF (0L<<8)
407#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_ALT_SRC_12 (1L<<8)
408#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_ALT_SRC_6 (2L<<8)
409#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_ALT_SRC_62 (4L<<8)
410#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PLAY_DEAD (1L<<11)
411#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_PLL_SPEED (0xfL<<12)
412#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_PLL_SPEED_100 (0L<<12)
413#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_PLL_SPEED_80 (1L<<12)
414#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_PLL_SPEED_50 (2L<<12)
415#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_PLL_SPEED_40 (4L<<12)
416#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_PLL_SPEED_25 (8L<<12)
417#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_CORE_CLK_PLL_STOP (1L<<16)
418#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_PLL_STOP (1L<<17)
419#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_RESERVED_18 (1L<<18)
420#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_USE_SPD_DET (1L<<19)
421#define BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_RESERVED (0xfffL<<20)
422
423#define BNX2_PCICFG_REG_WINDOW_ADDRESS 0x00000078
424#define BNX2_PCICFG_REG_WINDOW 0x00000080
425#define BNX2_PCICFG_INT_ACK_CMD 0x00000084
426#define BNX2_PCICFG_INT_ACK_CMD_INDEX (0xffffL<<0)
427#define BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID (1L<<16)
428#define BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM (1L<<17)
429#define BNX2_PCICFG_INT_ACK_CMD_MASK_INT (1L<<18)
430
431#define BNX2_PCICFG_STATUS_BIT_SET_CMD 0x00000088
432#define BNX2_PCICFG_STATUS_BIT_CLEAR_CMD 0x0000008c
433#define BNX2_PCICFG_MAILBOX_QUEUE_ADDR 0x00000090
434#define BNX2_PCICFG_MAILBOX_QUEUE_DATA 0x00000094
435
436
437/*
438 * pci_reg definition
439 * offset: 0x400
440 */
441#define BNX2_PCI_GRC_WINDOW_ADDR 0x00000400
442#define BNX2_PCI_GRC_WINDOW_ADDR_PCI_GRC_WINDOW_ADDR_VALUE (0x3ffffL<<8)
443
444#define BNX2_PCI_CONFIG_1 0x00000404
445#define BNX2_PCI_CONFIG_1_READ_BOUNDARY (0x7L<<8)
446#define BNX2_PCI_CONFIG_1_READ_BOUNDARY_OFF (0L<<8)
447#define BNX2_PCI_CONFIG_1_READ_BOUNDARY_16 (1L<<8)
448#define BNX2_PCI_CONFIG_1_READ_BOUNDARY_32 (2L<<8)
449#define BNX2_PCI_CONFIG_1_READ_BOUNDARY_64 (3L<<8)
450#define BNX2_PCI_CONFIG_1_READ_BOUNDARY_128 (4L<<8)
451#define BNX2_PCI_CONFIG_1_READ_BOUNDARY_256 (5L<<8)
452#define BNX2_PCI_CONFIG_1_READ_BOUNDARY_512 (6L<<8)
453#define BNX2_PCI_CONFIG_1_READ_BOUNDARY_1024 (7L<<8)
454#define BNX2_PCI_CONFIG_1_WRITE_BOUNDARY (0x7L<<11)
455#define BNX2_PCI_CONFIG_1_WRITE_BOUNDARY_OFF (0L<<11)
456#define BNX2_PCI_CONFIG_1_WRITE_BOUNDARY_16 (1L<<11)
457#define BNX2_PCI_CONFIG_1_WRITE_BOUNDARY_32 (2L<<11)
458#define BNX2_PCI_CONFIG_1_WRITE_BOUNDARY_64 (3L<<11)
459#define BNX2_PCI_CONFIG_1_WRITE_BOUNDARY_128 (4L<<11)
460#define BNX2_PCI_CONFIG_1_WRITE_BOUNDARY_256 (5L<<11)
461#define BNX2_PCI_CONFIG_1_WRITE_BOUNDARY_512 (6L<<11)
462#define BNX2_PCI_CONFIG_1_WRITE_BOUNDARY_1024 (7L<<11)
463
464#define BNX2_PCI_CONFIG_2 0x00000408
465#define BNX2_PCI_CONFIG_2_BAR1_SIZE (0xfL<<0)
466#define BNX2_PCI_CONFIG_2_BAR1_SIZE_DISABLED (0L<<0)
467#define BNX2_PCI_CONFIG_2_BAR1_SIZE_64K (1L<<0)
468#define BNX2_PCI_CONFIG_2_BAR1_SIZE_128K (2L<<0)
469#define BNX2_PCI_CONFIG_2_BAR1_SIZE_256K (3L<<0)
470#define BNX2_PCI_CONFIG_2_BAR1_SIZE_512K (4L<<0)
471#define BNX2_PCI_CONFIG_2_BAR1_SIZE_1M (5L<<0)
472#define BNX2_PCI_CONFIG_2_BAR1_SIZE_2M (6L<<0)
473#define BNX2_PCI_CONFIG_2_BAR1_SIZE_4M (7L<<0)
474#define BNX2_PCI_CONFIG_2_BAR1_SIZE_8M (8L<<0)
475#define BNX2_PCI_CONFIG_2_BAR1_SIZE_16M (9L<<0)
476#define BNX2_PCI_CONFIG_2_BAR1_SIZE_32M (10L<<0)
477#define BNX2_PCI_CONFIG_2_BAR1_SIZE_64M (11L<<0)
478#define BNX2_PCI_CONFIG_2_BAR1_SIZE_128M (12L<<0)
479#define BNX2_PCI_CONFIG_2_BAR1_SIZE_256M (13L<<0)
480#define BNX2_PCI_CONFIG_2_BAR1_SIZE_512M (14L<<0)
481#define BNX2_PCI_CONFIG_2_BAR1_SIZE_1G (15L<<0)
482#define BNX2_PCI_CONFIG_2_BAR1_64ENA (1L<<4)
483#define BNX2_PCI_CONFIG_2_EXP_ROM_RETRY (1L<<5)
484#define BNX2_PCI_CONFIG_2_CFG_CYCLE_RETRY (1L<<6)
485#define BNX2_PCI_CONFIG_2_FIRST_CFG_DONE (1L<<7)
486#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE (0xffL<<8)
487#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_DISABLED (0L<<8)
488#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_1K (1L<<8)
489#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_2K (2L<<8)
490#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_4K (3L<<8)
491#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_8K (4L<<8)
492#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_16K (5L<<8)
493#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_32K (6L<<8)
494#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_64K (7L<<8)
495#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_128K (8L<<8)
496#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_256K (9L<<8)
497#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_512K (10L<<8)
498#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_1M (11L<<8)
499#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_2M (12L<<8)
500#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_4M (13L<<8)
501#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_8M (14L<<8)
502#define BNX2_PCI_CONFIG_2_EXP_ROM_SIZE_16M (15L<<8)
503#define BNX2_PCI_CONFIG_2_MAX_SPLIT_LIMIT (0x1fL<<16)
504#define BNX2_PCI_CONFIG_2_MAX_READ_LIMIT (0x3L<<21)
505#define BNX2_PCI_CONFIG_2_MAX_READ_LIMIT_512 (0L<<21)
506#define BNX2_PCI_CONFIG_2_MAX_READ_LIMIT_1K (1L<<21)
507#define BNX2_PCI_CONFIG_2_MAX_READ_LIMIT_2K (2L<<21)
508#define BNX2_PCI_CONFIG_2_MAX_READ_LIMIT_4K (3L<<21)
509#define BNX2_PCI_CONFIG_2_FORCE_32_BIT_MSTR (1L<<23)
510#define BNX2_PCI_CONFIG_2_FORCE_32_BIT_TGT (1L<<24)
511#define BNX2_PCI_CONFIG_2_KEEP_REQ_ASSERT (1L<<25)
512
513#define BNX2_PCI_CONFIG_3 0x0000040c
514#define BNX2_PCI_CONFIG_3_STICKY_BYTE (0xffL<<0)
515#define BNX2_PCI_CONFIG_3_FORCE_PME (1L<<24)
516#define BNX2_PCI_CONFIG_3_PME_STATUS (1L<<25)
517#define BNX2_PCI_CONFIG_3_PME_ENABLE (1L<<26)
518#define BNX2_PCI_CONFIG_3_PM_STATE (0x3L<<27)
519#define BNX2_PCI_CONFIG_3_VAUX_PRESET (1L<<30)
520#define BNX2_PCI_CONFIG_3_PCI_POWER (1L<<31)
521
522#define BNX2_PCI_PM_DATA_A 0x00000410
523#define BNX2_PCI_PM_DATA_A_PM_DATA_0_PRG (0xffL<<0)
524#define BNX2_PCI_PM_DATA_A_PM_DATA_1_PRG (0xffL<<8)
525#define BNX2_PCI_PM_DATA_A_PM_DATA_2_PRG (0xffL<<16)
526#define BNX2_PCI_PM_DATA_A_PM_DATA_3_PRG (0xffL<<24)
527
528#define BNX2_PCI_PM_DATA_B 0x00000414
529#define BNX2_PCI_PM_DATA_B_PM_DATA_4_PRG (0xffL<<0)
530#define BNX2_PCI_PM_DATA_B_PM_DATA_5_PRG (0xffL<<8)
531#define BNX2_PCI_PM_DATA_B_PM_DATA_6_PRG (0xffL<<16)
532#define BNX2_PCI_PM_DATA_B_PM_DATA_7_PRG (0xffL<<24)
533
534#define BNX2_PCI_SWAP_DIAG0 0x00000418
535#define BNX2_PCI_SWAP_DIAG1 0x0000041c
536#define BNX2_PCI_EXP_ROM_ADDR 0x00000420
537#define BNX2_PCI_EXP_ROM_ADDR_ADDRESS (0x3fffffL<<2)
538#define BNX2_PCI_EXP_ROM_ADDR_REQ (1L<<31)
539
540#define BNX2_PCI_EXP_ROM_DATA 0x00000424
541#define BNX2_PCI_VPD_INTF 0x00000428
542#define BNX2_PCI_VPD_INTF_INTF_REQ (1L<<0)
543
544#define BNX2_PCI_VPD_ADDR_FLAG 0x0000042c
545#define BNX2_PCI_VPD_ADDR_FLAG_ADDRESS (0x1fff<<2)
546#define BNX2_PCI_VPD_ADDR_FLAG_WR (1<<15)
547
548#define BNX2_PCI_VPD_DATA 0x00000430
549#define BNX2_PCI_ID_VAL1 0x00000434
550#define BNX2_PCI_ID_VAL1_DEVICE_ID (0xffffL<<0)
551#define BNX2_PCI_ID_VAL1_VENDOR_ID (0xffffL<<16)
552
553#define BNX2_PCI_ID_VAL2 0x00000438
554#define BNX2_PCI_ID_VAL2_SUBSYSTEM_VENDOR_ID (0xffffL<<0)
555#define BNX2_PCI_ID_VAL2_SUBSYSTEM_ID (0xffffL<<16)
556
557#define BNX2_PCI_ID_VAL3 0x0000043c
558#define BNX2_PCI_ID_VAL3_CLASS_CODE (0xffffffL<<0)
559#define BNX2_PCI_ID_VAL3_REVISION_ID (0xffL<<24)
560
561#define BNX2_PCI_ID_VAL4 0x00000440
562#define BNX2_PCI_ID_VAL4_CAP_ENA (0xfL<<0)
563#define BNX2_PCI_ID_VAL4_CAP_ENA_0 (0L<<0)
564#define BNX2_PCI_ID_VAL4_CAP_ENA_1 (1L<<0)
565#define BNX2_PCI_ID_VAL4_CAP_ENA_2 (2L<<0)
566#define BNX2_PCI_ID_VAL4_CAP_ENA_3 (3L<<0)
567#define BNX2_PCI_ID_VAL4_CAP_ENA_4 (4L<<0)
568#define BNX2_PCI_ID_VAL4_CAP_ENA_5 (5L<<0)
569#define BNX2_PCI_ID_VAL4_CAP_ENA_6 (6L<<0)
570#define BNX2_PCI_ID_VAL4_CAP_ENA_7 (7L<<0)
571#define BNX2_PCI_ID_VAL4_CAP_ENA_8 (8L<<0)
572#define BNX2_PCI_ID_VAL4_CAP_ENA_9 (9L<<0)
573#define BNX2_PCI_ID_VAL4_CAP_ENA_10 (10L<<0)
574#define BNX2_PCI_ID_VAL4_CAP_ENA_11 (11L<<0)
575#define BNX2_PCI_ID_VAL4_CAP_ENA_12 (12L<<0)
576#define BNX2_PCI_ID_VAL4_CAP_ENA_13 (13L<<0)
577#define BNX2_PCI_ID_VAL4_CAP_ENA_14 (14L<<0)
578#define BNX2_PCI_ID_VAL4_CAP_ENA_15 (15L<<0)
579#define BNX2_PCI_ID_VAL4_PM_SCALE_PRG (0x3L<<6)
580#define BNX2_PCI_ID_VAL4_PM_SCALE_PRG_0 (0L<<6)
581#define BNX2_PCI_ID_VAL4_PM_SCALE_PRG_1 (1L<<6)
582#define BNX2_PCI_ID_VAL4_PM_SCALE_PRG_2 (2L<<6)
583#define BNX2_PCI_ID_VAL4_PM_SCALE_PRG_3 (3L<<6)
584#define BNX2_PCI_ID_VAL4_MSI_LIMIT (0x7L<<9)
585#define BNX2_PCI_ID_VAL4_MSI_ADVERTIZE (0x7L<<12)
586#define BNX2_PCI_ID_VAL4_MSI_ENABLE (1L<<15)
587#define BNX2_PCI_ID_VAL4_MAX_64_ADVERTIZE (1L<<16)
588#define BNX2_PCI_ID_VAL4_MAX_133_ADVERTIZE (1L<<17)
589#define BNX2_PCI_ID_VAL4_MAX_MEM_READ_SIZE (0x3L<<21)
590#define BNX2_PCI_ID_VAL4_MAX_SPLIT_SIZE (0x7L<<23)
591#define BNX2_PCI_ID_VAL4_MAX_CUMULATIVE_SIZE (0x7L<<26)
592
593#define BNX2_PCI_ID_VAL5 0x00000444
594#define BNX2_PCI_ID_VAL5_D1_SUPPORT (1L<<0)
595#define BNX2_PCI_ID_VAL5_D2_SUPPORT (1L<<1)
596#define BNX2_PCI_ID_VAL5_PME_IN_D0 (1L<<2)
597#define BNX2_PCI_ID_VAL5_PME_IN_D1 (1L<<3)
598#define BNX2_PCI_ID_VAL5_PME_IN_D2 (1L<<4)
599#define BNX2_PCI_ID_VAL5_PME_IN_D3_HOT (1L<<5)
600
601#define BNX2_PCI_PCIX_EXTENDED_STATUS 0x00000448
602#define BNX2_PCI_PCIX_EXTENDED_STATUS_NO_SNOOP (1L<<8)
603#define BNX2_PCI_PCIX_EXTENDED_STATUS_LONG_BURST (1L<<9)
604#define BNX2_PCI_PCIX_EXTENDED_STATUS_SPLIT_COMP_MSG_CLASS (0xfL<<16)
605#define BNX2_PCI_PCIX_EXTENDED_STATUS_SPLIT_COMP_MSG_IDX (0xffL<<24)
606
607#define BNX2_PCI_ID_VAL6 0x0000044c
608#define BNX2_PCI_ID_VAL6_MAX_LAT (0xffL<<0)
609#define BNX2_PCI_ID_VAL6_MIN_GNT (0xffL<<8)
610#define BNX2_PCI_ID_VAL6_BIST (0xffL<<16)
611
612#define BNX2_PCI_MSI_DATA 0x00000450
613#define BNX2_PCI_MSI_DATA_PCI_MSI_DATA (0xffffL<<0)
614
615#define BNX2_PCI_MSI_ADDR_H 0x00000454
616#define BNX2_PCI_MSI_ADDR_L 0x00000458
617
618
619/*
620 * misc_reg definition
621 * offset: 0x800
622 */
623#define BNX2_MISC_COMMAND 0x00000800
624#define BNX2_MISC_COMMAND_ENABLE_ALL (1L<<0)
625#define BNX2_MISC_COMMAND_DISABLE_ALL (1L<<1)
626#define BNX2_MISC_COMMAND_CORE_RESET (1L<<4)
627#define BNX2_MISC_COMMAND_HARD_RESET (1L<<5)
628#define BNX2_MISC_COMMAND_PAR_ERROR (1L<<8)
629#define BNX2_MISC_COMMAND_PAR_ERR_RAM (0x7fL<<16)
630
631#define BNX2_MISC_CFG 0x00000804
632#define BNX2_MISC_CFG_PCI_GRC_TMOUT (1L<<0)
633#define BNX2_MISC_CFG_NVM_WR_EN (0x3L<<1)
634#define BNX2_MISC_CFG_NVM_WR_EN_PROTECT (0L<<1)
635#define BNX2_MISC_CFG_NVM_WR_EN_PCI (1L<<1)
636#define BNX2_MISC_CFG_NVM_WR_EN_ALLOW (2L<<1)
637#define BNX2_MISC_CFG_NVM_WR_EN_ALLOW2 (3L<<1)
638#define BNX2_MISC_CFG_BIST_EN (1L<<3)
639#define BNX2_MISC_CFG_CK25_OUT_ALT_SRC (1L<<4)
640#define BNX2_MISC_CFG_BYPASS_BSCAN (1L<<5)
641#define BNX2_MISC_CFG_BYPASS_EJTAG (1L<<6)
642#define BNX2_MISC_CFG_CLK_CTL_OVERRIDE (1L<<7)
643#define BNX2_MISC_CFG_LEDMODE (0x3L<<8)
644#define BNX2_MISC_CFG_LEDMODE_MAC (0L<<8)
645#define BNX2_MISC_CFG_LEDMODE_GPHY1 (1L<<8)
646#define BNX2_MISC_CFG_LEDMODE_GPHY2 (2L<<8)
647
648#define BNX2_MISC_ID 0x00000808
649#define BNX2_MISC_ID_BOND_ID (0xfL<<0)
650#define BNX2_MISC_ID_CHIP_METAL (0xffL<<4)
651#define BNX2_MISC_ID_CHIP_REV (0xfL<<12)
652#define BNX2_MISC_ID_CHIP_NUM (0xffffL<<16)
653
654#define BNX2_MISC_ENABLE_STATUS_BITS 0x0000080c
655#define BNX2_MISC_ENABLE_STATUS_BITS_TX_SCHEDULER_ENABLE (1L<<0)
656#define BNX2_MISC_ENABLE_STATUS_BITS_TX_BD_READ_ENABLE (1L<<1)
657#define BNX2_MISC_ENABLE_STATUS_BITS_TX_BD_CACHE_ENABLE (1L<<2)
658#define BNX2_MISC_ENABLE_STATUS_BITS_TX_PROCESSOR_ENABLE (1L<<3)
659#define BNX2_MISC_ENABLE_STATUS_BITS_TX_DMA_ENABLE (1L<<4)
660#define BNX2_MISC_ENABLE_STATUS_BITS_TX_PATCHUP_ENABLE (1L<<5)
661#define BNX2_MISC_ENABLE_STATUS_BITS_TX_PAYLOAD_Q_ENABLE (1L<<6)
662#define BNX2_MISC_ENABLE_STATUS_BITS_TX_HEADER_Q_ENABLE (1L<<7)
663#define BNX2_MISC_ENABLE_STATUS_BITS_TX_ASSEMBLER_ENABLE (1L<<8)
664#define BNX2_MISC_ENABLE_STATUS_BITS_EMAC_ENABLE (1L<<9)
665#define BNX2_MISC_ENABLE_STATUS_BITS_RX_PARSER_MAC_ENABLE (1L<<10)
666#define BNX2_MISC_ENABLE_STATUS_BITS_RX_PARSER_CATCHUP_ENABLE (1L<<11)
667#define BNX2_MISC_ENABLE_STATUS_BITS_RX_MBUF_ENABLE (1L<<12)
668#define BNX2_MISC_ENABLE_STATUS_BITS_RX_LOOKUP_ENABLE (1L<<13)
669#define BNX2_MISC_ENABLE_STATUS_BITS_RX_PROCESSOR_ENABLE (1L<<14)
670#define BNX2_MISC_ENABLE_STATUS_BITS_RX_V2P_ENABLE (1L<<15)
671#define BNX2_MISC_ENABLE_STATUS_BITS_RX_BD_CACHE_ENABLE (1L<<16)
672#define BNX2_MISC_ENABLE_STATUS_BITS_RX_DMA_ENABLE (1L<<17)
673#define BNX2_MISC_ENABLE_STATUS_BITS_COMPLETION_ENABLE (1L<<18)
674#define BNX2_MISC_ENABLE_STATUS_BITS_HOST_COALESCE_ENABLE (1L<<19)
675#define BNX2_MISC_ENABLE_STATUS_BITS_MAILBOX_QUEUE_ENABLE (1L<<20)
676#define BNX2_MISC_ENABLE_STATUS_BITS_CONTEXT_ENABLE (1L<<21)
677#define BNX2_MISC_ENABLE_STATUS_BITS_CMD_SCHEDULER_ENABLE (1L<<22)
678#define BNX2_MISC_ENABLE_STATUS_BITS_CMD_PROCESSOR_ENABLE (1L<<23)
679#define BNX2_MISC_ENABLE_STATUS_BITS_MGMT_PROCESSOR_ENABLE (1L<<24)
680#define BNX2_MISC_ENABLE_STATUS_BITS_TIMER_ENABLE (1L<<25)
681#define BNX2_MISC_ENABLE_STATUS_BITS_DMA_ENGINE_ENABLE (1L<<26)
682#define BNX2_MISC_ENABLE_STATUS_BITS_UMP_ENABLE (1L<<27)
683
684#define BNX2_MISC_ENABLE_SET_BITS 0x00000810
685#define BNX2_MISC_ENABLE_SET_BITS_TX_SCHEDULER_ENABLE (1L<<0)
686#define BNX2_MISC_ENABLE_SET_BITS_TX_BD_READ_ENABLE (1L<<1)
687#define BNX2_MISC_ENABLE_SET_BITS_TX_BD_CACHE_ENABLE (1L<<2)
688#define BNX2_MISC_ENABLE_SET_BITS_TX_PROCESSOR_ENABLE (1L<<3)
689#define BNX2_MISC_ENABLE_SET_BITS_TX_DMA_ENABLE (1L<<4)
690#define BNX2_MISC_ENABLE_SET_BITS_TX_PATCHUP_ENABLE (1L<<5)
691#define BNX2_MISC_ENABLE_SET_BITS_TX_PAYLOAD_Q_ENABLE (1L<<6)
692#define BNX2_MISC_ENABLE_SET_BITS_TX_HEADER_Q_ENABLE (1L<<7)
693#define BNX2_MISC_ENABLE_SET_BITS_TX_ASSEMBLER_ENABLE (1L<<8)
694#define BNX2_MISC_ENABLE_SET_BITS_EMAC_ENABLE (1L<<9)
695#define BNX2_MISC_ENABLE_SET_BITS_RX_PARSER_MAC_ENABLE (1L<<10)
696#define BNX2_MISC_ENABLE_SET_BITS_RX_PARSER_CATCHUP_ENABLE (1L<<11)
697#define BNX2_MISC_ENABLE_SET_BITS_RX_MBUF_ENABLE (1L<<12)
698#define BNX2_MISC_ENABLE_SET_BITS_RX_LOOKUP_ENABLE (1L<<13)
699#define BNX2_MISC_ENABLE_SET_BITS_RX_PROCESSOR_ENABLE (1L<<14)
700#define BNX2_MISC_ENABLE_SET_BITS_RX_V2P_ENABLE (1L<<15)
701#define BNX2_MISC_ENABLE_SET_BITS_RX_BD_CACHE_ENABLE (1L<<16)
702#define BNX2_MISC_ENABLE_SET_BITS_RX_DMA_ENABLE (1L<<17)
703#define BNX2_MISC_ENABLE_SET_BITS_COMPLETION_ENABLE (1L<<18)
704#define BNX2_MISC_ENABLE_SET_BITS_HOST_COALESCE_ENABLE (1L<<19)
705#define BNX2_MISC_ENABLE_SET_BITS_MAILBOX_QUEUE_ENABLE (1L<<20)
706#define BNX2_MISC_ENABLE_SET_BITS_CONTEXT_ENABLE (1L<<21)
707#define BNX2_MISC_ENABLE_SET_BITS_CMD_SCHEDULER_ENABLE (1L<<22)
708#define BNX2_MISC_ENABLE_SET_BITS_CMD_PROCESSOR_ENABLE (1L<<23)
709#define BNX2_MISC_ENABLE_SET_BITS_MGMT_PROCESSOR_ENABLE (1L<<24)
710#define BNX2_MISC_ENABLE_SET_BITS_TIMER_ENABLE (1L<<25)
711#define BNX2_MISC_ENABLE_SET_BITS_DMA_ENGINE_ENABLE (1L<<26)
712#define BNX2_MISC_ENABLE_SET_BITS_UMP_ENABLE (1L<<27)
713
714#define BNX2_MISC_ENABLE_CLR_BITS 0x00000814
715#define BNX2_MISC_ENABLE_CLR_BITS_TX_SCHEDULER_ENABLE (1L<<0)
716#define BNX2_MISC_ENABLE_CLR_BITS_TX_BD_READ_ENABLE (1L<<1)
717#define BNX2_MISC_ENABLE_CLR_BITS_TX_BD_CACHE_ENABLE (1L<<2)
718#define BNX2_MISC_ENABLE_CLR_BITS_TX_PROCESSOR_ENABLE (1L<<3)
719#define BNX2_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE (1L<<4)
720#define BNX2_MISC_ENABLE_CLR_BITS_TX_PATCHUP_ENABLE (1L<<5)
721#define BNX2_MISC_ENABLE_CLR_BITS_TX_PAYLOAD_Q_ENABLE (1L<<6)
722#define BNX2_MISC_ENABLE_CLR_BITS_TX_HEADER_Q_ENABLE (1L<<7)
723#define BNX2_MISC_ENABLE_CLR_BITS_TX_ASSEMBLER_ENABLE (1L<<8)
724#define BNX2_MISC_ENABLE_CLR_BITS_EMAC_ENABLE (1L<<9)
725#define BNX2_MISC_ENABLE_CLR_BITS_RX_PARSER_MAC_ENABLE (1L<<10)
726#define BNX2_MISC_ENABLE_CLR_BITS_RX_PARSER_CATCHUP_ENABLE (1L<<11)
727#define BNX2_MISC_ENABLE_CLR_BITS_RX_MBUF_ENABLE (1L<<12)
728#define BNX2_MISC_ENABLE_CLR_BITS_RX_LOOKUP_ENABLE (1L<<13)
729#define BNX2_MISC_ENABLE_CLR_BITS_RX_PROCESSOR_ENABLE (1L<<14)
730#define BNX2_MISC_ENABLE_CLR_BITS_RX_V2P_ENABLE (1L<<15)
731#define BNX2_MISC_ENABLE_CLR_BITS_RX_BD_CACHE_ENABLE (1L<<16)
732#define BNX2_MISC_ENABLE_CLR_BITS_RX_DMA_ENABLE (1L<<17)
733#define BNX2_MISC_ENABLE_CLR_BITS_COMPLETION_ENABLE (1L<<18)
734#define BNX2_MISC_ENABLE_CLR_BITS_HOST_COALESCE_ENABLE (1L<<19)
735#define BNX2_MISC_ENABLE_CLR_BITS_MAILBOX_QUEUE_ENABLE (1L<<20)
736#define BNX2_MISC_ENABLE_CLR_BITS_CONTEXT_ENABLE (1L<<21)
737#define BNX2_MISC_ENABLE_CLR_BITS_CMD_SCHEDULER_ENABLE (1L<<22)
738#define BNX2_MISC_ENABLE_CLR_BITS_CMD_PROCESSOR_ENABLE (1L<<23)
739#define BNX2_MISC_ENABLE_CLR_BITS_MGMT_PROCESSOR_ENABLE (1L<<24)
740#define BNX2_MISC_ENABLE_CLR_BITS_TIMER_ENABLE (1L<<25)
741#define BNX2_MISC_ENABLE_CLR_BITS_DMA_ENGINE_ENABLE (1L<<26)
742#define BNX2_MISC_ENABLE_CLR_BITS_UMP_ENABLE (1L<<27)
743
744#define BNX2_MISC_CLOCK_CONTROL_BITS 0x00000818
745#define BNX2_MISC_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET (0xfL<<0)
746#define BNX2_MISC_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_32MHZ (0L<<0)
747#define BNX2_MISC_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_38MHZ (1L<<0)
748#define BNX2_MISC_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_48MHZ (2L<<0)
749#define BNX2_MISC_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_55MHZ (3L<<0)
750#define BNX2_MISC_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_66MHZ (4L<<0)
751#define BNX2_MISC_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_80MHZ (5L<<0)
752#define BNX2_MISC_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_95MHZ (6L<<0)
753#define BNX2_MISC_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_133MHZ (7L<<0)
754#define BNX2_MISC_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_LOW (0xfL<<0)
755#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_DISABLE (1L<<6)
756#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_ALT (1L<<7)
757#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_ALT_SRC (0x7L<<8)
758#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_ALT_SRC_UNDEF (0L<<8)
759#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_ALT_SRC_12 (1L<<8)
760#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_ALT_SRC_6 (2L<<8)
761#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_ALT_SRC_62 (4L<<8)
762#define BNX2_MISC_CLOCK_CONTROL_BITS_PLAY_DEAD (1L<<11)
763#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_PLL_SPEED (0xfL<<12)
764#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_PLL_SPEED_100 (0L<<12)
765#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_PLL_SPEED_80 (1L<<12)
766#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_PLL_SPEED_50 (2L<<12)
767#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_PLL_SPEED_40 (4L<<12)
768#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_PLL_SPEED_25 (8L<<12)
769#define BNX2_MISC_CLOCK_CONTROL_BITS_CORE_CLK_PLL_STOP (1L<<16)
770#define BNX2_MISC_CLOCK_CONTROL_BITS_PCI_PLL_STOP (1L<<17)
771#define BNX2_MISC_CLOCK_CONTROL_BITS_RESERVED_18 (1L<<18)
772#define BNX2_MISC_CLOCK_CONTROL_BITS_USE_SPD_DET (1L<<19)
773#define BNX2_MISC_CLOCK_CONTROL_BITS_RESERVED (0xfffL<<20)
774
775#define BNX2_MISC_GPIO 0x0000081c
776#define BNX2_MISC_GPIO_VALUE (0xffL<<0)
777#define BNX2_MISC_GPIO_SET (0xffL<<8)
778#define BNX2_MISC_GPIO_CLR (0xffL<<16)
779#define BNX2_MISC_GPIO_FLOAT (0xffL<<24)
780
781#define BNX2_MISC_GPIO_INT 0x00000820
782#define BNX2_MISC_GPIO_INT_INT_STATE (0xfL<<0)
783#define BNX2_MISC_GPIO_INT_OLD_VALUE (0xfL<<8)
784#define BNX2_MISC_GPIO_INT_OLD_SET (0xfL<<16)
785#define BNX2_MISC_GPIO_INT_OLD_CLR (0xfL<<24)
786
787#define BNX2_MISC_CONFIG_LFSR 0x00000824
788#define BNX2_MISC_CONFIG_LFSR_DIV (0xffffL<<0)
789
790#define BNX2_MISC_LFSR_MASK_BITS 0x00000828
791#define BNX2_MISC_LFSR_MASK_BITS_TX_SCHEDULER_ENABLE (1L<<0)
792#define BNX2_MISC_LFSR_MASK_BITS_TX_BD_READ_ENABLE (1L<<1)
793#define BNX2_MISC_LFSR_MASK_BITS_TX_BD_CACHE_ENABLE (1L<<2)
794#define BNX2_MISC_LFSR_MASK_BITS_TX_PROCESSOR_ENABLE (1L<<3)
795#define BNX2_MISC_LFSR_MASK_BITS_TX_DMA_ENABLE (1L<<4)
796#define BNX2_MISC_LFSR_MASK_BITS_TX_PATCHUP_ENABLE (1L<<5)
797#define BNX2_MISC_LFSR_MASK_BITS_TX_PAYLOAD_Q_ENABLE (1L<<6)
798#define BNX2_MISC_LFSR_MASK_BITS_TX_HEADER_Q_ENABLE (1L<<7)
799#define BNX2_MISC_LFSR_MASK_BITS_TX_ASSEMBLER_ENABLE (1L<<8)
800#define BNX2_MISC_LFSR_MASK_BITS_EMAC_ENABLE (1L<<9)
801#define BNX2_MISC_LFSR_MASK_BITS_RX_PARSER_MAC_ENABLE (1L<<10)
802#define BNX2_MISC_LFSR_MASK_BITS_RX_PARSER_CATCHUP_ENABLE (1L<<11)
803#define BNX2_MISC_LFSR_MASK_BITS_RX_MBUF_ENABLE (1L<<12)
804#define BNX2_MISC_LFSR_MASK_BITS_RX_LOOKUP_ENABLE (1L<<13)
805#define BNX2_MISC_LFSR_MASK_BITS_RX_PROCESSOR_ENABLE (1L<<14)
806#define BNX2_MISC_LFSR_MASK_BITS_RX_V2P_ENABLE (1L<<15)
807#define BNX2_MISC_LFSR_MASK_BITS_RX_BD_CACHE_ENABLE (1L<<16)
808#define BNX2_MISC_LFSR_MASK_BITS_RX_DMA_ENABLE (1L<<17)
809#define BNX2_MISC_LFSR_MASK_BITS_COMPLETION_ENABLE (1L<<18)
810#define BNX2_MISC_LFSR_MASK_BITS_HOST_COALESCE_ENABLE (1L<<19)
811#define BNX2_MISC_LFSR_MASK_BITS_MAILBOX_QUEUE_ENABLE (1L<<20)
812#define BNX2_MISC_LFSR_MASK_BITS_CONTEXT_ENABLE (1L<<21)
813#define BNX2_MISC_LFSR_MASK_BITS_CMD_SCHEDULER_ENABLE (1L<<22)
814#define BNX2_MISC_LFSR_MASK_BITS_CMD_PROCESSOR_ENABLE (1L<<23)
815#define BNX2_MISC_LFSR_MASK_BITS_MGMT_PROCESSOR_ENABLE (1L<<24)
816#define BNX2_MISC_LFSR_MASK_BITS_TIMER_ENABLE (1L<<25)
817#define BNX2_MISC_LFSR_MASK_BITS_DMA_ENGINE_ENABLE (1L<<26)
818#define BNX2_MISC_LFSR_MASK_BITS_UMP_ENABLE (1L<<27)
819
820#define BNX2_MISC_ARB_REQ0 0x0000082c
821#define BNX2_MISC_ARB_REQ1 0x00000830
822#define BNX2_MISC_ARB_REQ2 0x00000834
823#define BNX2_MISC_ARB_REQ3 0x00000838
824#define BNX2_MISC_ARB_REQ4 0x0000083c
825#define BNX2_MISC_ARB_FREE0 0x00000840
826#define BNX2_MISC_ARB_FREE1 0x00000844
827#define BNX2_MISC_ARB_FREE2 0x00000848
828#define BNX2_MISC_ARB_FREE3 0x0000084c
829#define BNX2_MISC_ARB_FREE4 0x00000850
830#define BNX2_MISC_ARB_REQ_STATUS0 0x00000854
831#define BNX2_MISC_ARB_REQ_STATUS1 0x00000858
832#define BNX2_MISC_ARB_REQ_STATUS2 0x0000085c
833#define BNX2_MISC_ARB_REQ_STATUS3 0x00000860
834#define BNX2_MISC_ARB_REQ_STATUS4 0x00000864
835#define BNX2_MISC_ARB_GNT0 0x00000868
836#define BNX2_MISC_ARB_GNT0_0 (0x7L<<0)
837#define BNX2_MISC_ARB_GNT0_1 (0x7L<<4)
838#define BNX2_MISC_ARB_GNT0_2 (0x7L<<8)
839#define BNX2_MISC_ARB_GNT0_3 (0x7L<<12)
840#define BNX2_MISC_ARB_GNT0_4 (0x7L<<16)
841#define BNX2_MISC_ARB_GNT0_5 (0x7L<<20)
842#define BNX2_MISC_ARB_GNT0_6 (0x7L<<24)
843#define BNX2_MISC_ARB_GNT0_7 (0x7L<<28)
844
845#define BNX2_MISC_ARB_GNT1 0x0000086c
846#define BNX2_MISC_ARB_GNT1_8 (0x7L<<0)
847#define BNX2_MISC_ARB_GNT1_9 (0x7L<<4)
848#define BNX2_MISC_ARB_GNT1_10 (0x7L<<8)
849#define BNX2_MISC_ARB_GNT1_11 (0x7L<<12)
850#define BNX2_MISC_ARB_GNT1_12 (0x7L<<16)
851#define BNX2_MISC_ARB_GNT1_13 (0x7L<<20)
852#define BNX2_MISC_ARB_GNT1_14 (0x7L<<24)
853#define BNX2_MISC_ARB_GNT1_15 (0x7L<<28)
854
855#define BNX2_MISC_ARB_GNT2 0x00000870
856#define BNX2_MISC_ARB_GNT2_16 (0x7L<<0)
857#define BNX2_MISC_ARB_GNT2_17 (0x7L<<4)
858#define BNX2_MISC_ARB_GNT2_18 (0x7L<<8)
859#define BNX2_MISC_ARB_GNT2_19 (0x7L<<12)
860#define BNX2_MISC_ARB_GNT2_20 (0x7L<<16)
861#define BNX2_MISC_ARB_GNT2_21 (0x7L<<20)
862#define BNX2_MISC_ARB_GNT2_22 (0x7L<<24)
863#define BNX2_MISC_ARB_GNT2_23 (0x7L<<28)
864
865#define BNX2_MISC_ARB_GNT3 0x00000874
866#define BNX2_MISC_ARB_GNT3_24 (0x7L<<0)
867#define BNX2_MISC_ARB_GNT3_25 (0x7L<<4)
868#define BNX2_MISC_ARB_GNT3_26 (0x7L<<8)
869#define BNX2_MISC_ARB_GNT3_27 (0x7L<<12)
870#define BNX2_MISC_ARB_GNT3_28 (0x7L<<16)
871#define BNX2_MISC_ARB_GNT3_29 (0x7L<<20)
872#define BNX2_MISC_ARB_GNT3_30 (0x7L<<24)
873#define BNX2_MISC_ARB_GNT3_31 (0x7L<<28)
874
875#define BNX2_MISC_PRBS_CONTROL 0x00000878
876#define BNX2_MISC_PRBS_CONTROL_EN (1L<<0)
877#define BNX2_MISC_PRBS_CONTROL_RSTB (1L<<1)
878#define BNX2_MISC_PRBS_CONTROL_INV (1L<<2)
879#define BNX2_MISC_PRBS_CONTROL_ERR_CLR (1L<<3)
880#define BNX2_MISC_PRBS_CONTROL_ORDER (0x3L<<4)
881#define BNX2_MISC_PRBS_CONTROL_ORDER_7TH (0L<<4)
882#define BNX2_MISC_PRBS_CONTROL_ORDER_15TH (1L<<4)
883#define BNX2_MISC_PRBS_CONTROL_ORDER_23RD (2L<<4)
884#define BNX2_MISC_PRBS_CONTROL_ORDER_31ST (3L<<4)
885
886#define BNX2_MISC_PRBS_STATUS 0x0000087c
887#define BNX2_MISC_PRBS_STATUS_LOCK (1L<<0)
888#define BNX2_MISC_PRBS_STATUS_STKY (1L<<1)
889#define BNX2_MISC_PRBS_STATUS_ERRORS (0x3fffL<<2)
890#define BNX2_MISC_PRBS_STATUS_STATE (0xfL<<16)
891
892#define BNX2_MISC_SM_ASF_CONTROL 0x00000880
893#define BNX2_MISC_SM_ASF_CONTROL_ASF_RST (1L<<0)
894#define BNX2_MISC_SM_ASF_CONTROL_TSC_EN (1L<<1)
895#define BNX2_MISC_SM_ASF_CONTROL_WG_TO (1L<<2)
896#define BNX2_MISC_SM_ASF_CONTROL_HB_TO (1L<<3)
897#define BNX2_MISC_SM_ASF_CONTROL_PA_TO (1L<<4)
898#define BNX2_MISC_SM_ASF_CONTROL_PL_TO (1L<<5)
899#define BNX2_MISC_SM_ASF_CONTROL_RT_TO (1L<<6)
900#define BNX2_MISC_SM_ASF_CONTROL_SMB_EVENT (1L<<7)
901#define BNX2_MISC_SM_ASF_CONTROL_RES (0xfL<<8)
902#define BNX2_MISC_SM_ASF_CONTROL_SMB_EN (1L<<12)
903#define BNX2_MISC_SM_ASF_CONTROL_SMB_BB_EN (1L<<13)
904#define BNX2_MISC_SM_ASF_CONTROL_SMB_NO_ADDR_FILT (1L<<14)
905#define BNX2_MISC_SM_ASF_CONTROL_SMB_AUTOREAD (1L<<15)
906#define BNX2_MISC_SM_ASF_CONTROL_NIC_SMB_ADDR1 (0x3fL<<16)
907#define BNX2_MISC_SM_ASF_CONTROL_NIC_SMB_ADDR2 (0x3fL<<24)
908#define BNX2_MISC_SM_ASF_CONTROL_EN_NIC_SMB_ADDR_0 (1L<<30)
909#define BNX2_MISC_SM_ASF_CONTROL_SMB_EARLY_ATTN (1L<<31)
910
911#define BNX2_MISC_SMB_IN 0x00000884
912#define BNX2_MISC_SMB_IN_DAT_IN (0xffL<<0)
913#define BNX2_MISC_SMB_IN_RDY (1L<<8)
914#define BNX2_MISC_SMB_IN_DONE (1L<<9)
915#define BNX2_MISC_SMB_IN_FIRSTBYTE (1L<<10)
916#define BNX2_MISC_SMB_IN_STATUS (0x7L<<11)
917#define BNX2_MISC_SMB_IN_STATUS_OK (0x0L<<11)
918#define BNX2_MISC_SMB_IN_STATUS_PEC (0x1L<<11)
919#define BNX2_MISC_SMB_IN_STATUS_OFLOW (0x2L<<11)
920#define BNX2_MISC_SMB_IN_STATUS_STOP (0x3L<<11)
921#define BNX2_MISC_SMB_IN_STATUS_TIMEOUT (0x4L<<11)
922
923#define BNX2_MISC_SMB_OUT 0x00000888
924#define BNX2_MISC_SMB_OUT_DAT_OUT (0xffL<<0)
925#define BNX2_MISC_SMB_OUT_RDY (1L<<8)
926#define BNX2_MISC_SMB_OUT_START (1L<<9)
927#define BNX2_MISC_SMB_OUT_LAST (1L<<10)
928#define BNX2_MISC_SMB_OUT_ACC_TYPE (1L<<11)
929#define BNX2_MISC_SMB_OUT_ENB_PEC (1L<<12)
930#define BNX2_MISC_SMB_OUT_GET_RX_LEN (1L<<13)
931#define BNX2_MISC_SMB_OUT_SMB_READ_LEN (0x3fL<<14)
932#define BNX2_MISC_SMB_OUT_SMB_OUT_STATUS (0xfL<<20)
933#define BNX2_MISC_SMB_OUT_SMB_OUT_STATUS_OK (0L<<20)
934#define BNX2_MISC_SMB_OUT_SMB_OUT_STATUS_FIRST_NACK (1L<<20)
935#define BNX2_MISC_SMB_OUT_SMB_OUT_STATUS_SUB_NACK (9L<<20)
936#define BNX2_MISC_SMB_OUT_SMB_OUT_STATUS_UFLOW (2L<<20)
937#define BNX2_MISC_SMB_OUT_SMB_OUT_STATUS_STOP (3L<<20)
938#define BNX2_MISC_SMB_OUT_SMB_OUT_STATUS_TIMEOUT (4L<<20)
939#define BNX2_MISC_SMB_OUT_SMB_OUT_STATUS_FIRST_LOST (5L<<20)
940#define BNX2_MISC_SMB_OUT_SMB_OUT_STATUS_SUB_LOST (0xdL<<20)
941#define BNX2_MISC_SMB_OUT_SMB_OUT_STATUS_BADACK (0x6L<<20)
942#define BNX2_MISC_SMB_OUT_SMB_OUT_SLAVEMODE (1L<<24)
943#define BNX2_MISC_SMB_OUT_SMB_OUT_DAT_EN (1L<<25)
944#define BNX2_MISC_SMB_OUT_SMB_OUT_DAT_IN (1L<<26)
945#define BNX2_MISC_SMB_OUT_SMB_OUT_CLK_EN (1L<<27)
946#define BNX2_MISC_SMB_OUT_SMB_OUT_CLK_IN (1L<<28)
947
948#define BNX2_MISC_SMB_WATCHDOG 0x0000088c
949#define BNX2_MISC_SMB_WATCHDOG_WATCHDOG (0xffffL<<0)
950
951#define BNX2_MISC_SMB_HEARTBEAT 0x00000890
952#define BNX2_MISC_SMB_HEARTBEAT_HEARTBEAT (0xffffL<<0)
953
954#define BNX2_MISC_SMB_POLL_ASF 0x00000894
955#define BNX2_MISC_SMB_POLL_ASF_POLL_ASF (0xffffL<<0)
956
957#define BNX2_MISC_SMB_POLL_LEGACY 0x00000898
958#define BNX2_MISC_SMB_POLL_LEGACY_POLL_LEGACY (0xffffL<<0)
959
960#define BNX2_MISC_SMB_RETRAN 0x0000089c
961#define BNX2_MISC_SMB_RETRAN_RETRAN (0xffL<<0)
962
963#define BNX2_MISC_SMB_TIMESTAMP 0x000008a0
964#define BNX2_MISC_SMB_TIMESTAMP_TIMESTAMP (0xffffffffL<<0)
965
966#define BNX2_MISC_PERR_ENA0 0x000008a4
967#define BNX2_MISC_PERR_ENA0_COM_MISC_CTXC (1L<<0)
968#define BNX2_MISC_PERR_ENA0_COM_MISC_REGF (1L<<1)
969#define BNX2_MISC_PERR_ENA0_COM_MISC_SCPAD (1L<<2)
970#define BNX2_MISC_PERR_ENA0_CP_MISC_CTXC (1L<<3)
971#define BNX2_MISC_PERR_ENA0_CP_MISC_REGF (1L<<4)
972#define BNX2_MISC_PERR_ENA0_CP_MISC_SCPAD (1L<<5)
973#define BNX2_MISC_PERR_ENA0_CS_MISC_TMEM (1L<<6)
974#define BNX2_MISC_PERR_ENA0_CTX_MISC_ACCM0 (1L<<7)
975#define BNX2_MISC_PERR_ENA0_CTX_MISC_ACCM1 (1L<<8)
976#define BNX2_MISC_PERR_ENA0_CTX_MISC_ACCM2 (1L<<9)
977#define BNX2_MISC_PERR_ENA0_CTX_MISC_ACCM3 (1L<<10)
978#define BNX2_MISC_PERR_ENA0_CTX_MISC_ACCM4 (1L<<11)
979#define BNX2_MISC_PERR_ENA0_CTX_MISC_ACCM5 (1L<<12)
980#define BNX2_MISC_PERR_ENA0_CTX_MISC_PGTBL (1L<<13)
981#define BNX2_MISC_PERR_ENA0_DMAE_MISC_DR0 (1L<<14)
982#define BNX2_MISC_PERR_ENA0_DMAE_MISC_DR1 (1L<<15)
983#define BNX2_MISC_PERR_ENA0_DMAE_MISC_DR2 (1L<<16)
984#define BNX2_MISC_PERR_ENA0_DMAE_MISC_DR3 (1L<<17)
985#define BNX2_MISC_PERR_ENA0_DMAE_MISC_DR4 (1L<<18)
986#define BNX2_MISC_PERR_ENA0_DMAE_MISC_DW0 (1L<<19)
987#define BNX2_MISC_PERR_ENA0_DMAE_MISC_DW1 (1L<<20)
988#define BNX2_MISC_PERR_ENA0_DMAE_MISC_DW2 (1L<<21)
989#define BNX2_MISC_PERR_ENA0_HC_MISC_DMA (1L<<22)
990#define BNX2_MISC_PERR_ENA0_MCP_MISC_REGF (1L<<23)
991#define BNX2_MISC_PERR_ENA0_MCP_MISC_SCPAD (1L<<24)
992#define BNX2_MISC_PERR_ENA0_MQ_MISC_CTX (1L<<25)
993#define BNX2_MISC_PERR_ENA0_RBDC_MISC (1L<<26)
994#define BNX2_MISC_PERR_ENA0_RBUF_MISC_MB (1L<<27)
995#define BNX2_MISC_PERR_ENA0_RBUF_MISC_PTR (1L<<28)
996#define BNX2_MISC_PERR_ENA0_RDE_MISC_RPC (1L<<29)
997#define BNX2_MISC_PERR_ENA0_RDE_MISC_RPM (1L<<30)
998#define BNX2_MISC_PERR_ENA0_RV2P_MISC_CB0REGS (1L<<31)
999
1000#define BNX2_MISC_PERR_ENA1 0x000008a8
1001#define BNX2_MISC_PERR_ENA1_RV2P_MISC_CB1REGS (1L<<0)
1002#define BNX2_MISC_PERR_ENA1_RV2P_MISC_P1IRAM (1L<<1)
1003#define BNX2_MISC_PERR_ENA1_RV2P_MISC_P2IRAM (1L<<2)
1004#define BNX2_MISC_PERR_ENA1_RXP_MISC_CTXC (1L<<3)
1005#define BNX2_MISC_PERR_ENA1_RXP_MISC_REGF (1L<<4)
1006#define BNX2_MISC_PERR_ENA1_RXP_MISC_SCPAD (1L<<5)
1007#define BNX2_MISC_PERR_ENA1_RXP_MISC_RBUFC (1L<<6)
1008#define BNX2_MISC_PERR_ENA1_TBDC_MISC (1L<<7)
1009#define BNX2_MISC_PERR_ENA1_TDMA_MISC (1L<<8)
1010#define BNX2_MISC_PERR_ENA1_THBUF_MISC_MB0 (1L<<9)
1011#define BNX2_MISC_PERR_ENA1_THBUF_MISC_MB1 (1L<<10)
1012#define BNX2_MISC_PERR_ENA1_TPAT_MISC_REGF (1L<<11)
1013#define BNX2_MISC_PERR_ENA1_TPAT_MISC_SCPAD (1L<<12)
1014#define BNX2_MISC_PERR_ENA1_TPBUF_MISC_MB (1L<<13)
1015#define BNX2_MISC_PERR_ENA1_TSCH_MISC_LR (1L<<14)
1016#define BNX2_MISC_PERR_ENA1_TXP_MISC_CTXC (1L<<15)
1017#define BNX2_MISC_PERR_ENA1_TXP_MISC_REGF (1L<<16)
1018#define BNX2_MISC_PERR_ENA1_TXP_MISC_SCPAD (1L<<17)
1019#define BNX2_MISC_PERR_ENA1_UMP_MISC_FIORX (1L<<18)
1020#define BNX2_MISC_PERR_ENA1_UMP_MISC_FIOTX (1L<<19)
1021#define BNX2_MISC_PERR_ENA1_UMP_MISC_RX (1L<<20)
1022#define BNX2_MISC_PERR_ENA1_UMP_MISC_TX (1L<<21)
1023#define BNX2_MISC_PERR_ENA1_RDMAQ_MISC (1L<<22)
1024#define BNX2_MISC_PERR_ENA1_CSQ_MISC (1L<<23)
1025#define BNX2_MISC_PERR_ENA1_CPQ_MISC (1L<<24)
1026#define BNX2_MISC_PERR_ENA1_MCPQ_MISC (1L<<25)
1027#define BNX2_MISC_PERR_ENA1_RV2PMQ_MISC (1L<<26)
1028#define BNX2_MISC_PERR_ENA1_RV2PPQ_MISC (1L<<27)
1029#define BNX2_MISC_PERR_ENA1_RV2PTQ_MISC (1L<<28)
1030#define BNX2_MISC_PERR_ENA1_RXPQ_MISC (1L<<29)
1031#define BNX2_MISC_PERR_ENA1_RXPCQ_MISC (1L<<30)
1032#define BNX2_MISC_PERR_ENA1_RLUPQ_MISC (1L<<31)
1033
1034#define BNX2_MISC_PERR_ENA2 0x000008ac
1035#define BNX2_MISC_PERR_ENA2_COMQ_MISC (1L<<0)
1036#define BNX2_MISC_PERR_ENA2_COMXQ_MISC (1L<<1)
1037#define BNX2_MISC_PERR_ENA2_COMTQ_MISC (1L<<2)
1038#define BNX2_MISC_PERR_ENA2_TSCHQ_MISC (1L<<3)
1039#define BNX2_MISC_PERR_ENA2_TBDRQ_MISC (1L<<4)
1040#define BNX2_MISC_PERR_ENA2_TXPQ_MISC (1L<<5)
1041#define BNX2_MISC_PERR_ENA2_TDMAQ_MISC (1L<<6)
1042#define BNX2_MISC_PERR_ENA2_TPATQ_MISC (1L<<7)
1043#define BNX2_MISC_PERR_ENA2_TASQ_MISC (1L<<8)
1044
1045#define BNX2_MISC_DEBUG_VECTOR_SEL 0x000008b0
1046#define BNX2_MISC_DEBUG_VECTOR_SEL_0 (0xfffL<<0)
1047#define BNX2_MISC_DEBUG_VECTOR_SEL_1 (0xfffL<<12)
1048
1049#define BNX2_MISC_VREG_CONTROL 0x000008b4
1050#define BNX2_MISC_VREG_CONTROL_1_2 (0xfL<<0)
1051#define BNX2_MISC_VREG_CONTROL_2_5 (0xfL<<4)
1052
1053#define BNX2_MISC_FINAL_CLK_CTL_VAL 0x000008b8
1054#define BNX2_MISC_FINAL_CLK_CTL_VAL_MISC_FINAL_CLK_CTL_VAL (0x3ffffffL<<6)
1055
1056#define BNX2_MISC_UNUSED0 0x000008bc
1057
1058
1059/*
1060 * nvm_reg definition
1061 * offset: 0x6400
1062 */
1063#define BNX2_NVM_COMMAND 0x00006400
1064#define BNX2_NVM_COMMAND_RST (1L<<0)
1065#define BNX2_NVM_COMMAND_DONE (1L<<3)
1066#define BNX2_NVM_COMMAND_DOIT (1L<<4)
1067#define BNX2_NVM_COMMAND_WR (1L<<5)
1068#define BNX2_NVM_COMMAND_ERASE (1L<<6)
1069#define BNX2_NVM_COMMAND_FIRST (1L<<7)
1070#define BNX2_NVM_COMMAND_LAST (1L<<8)
1071#define BNX2_NVM_COMMAND_WREN (1L<<16)
1072#define BNX2_NVM_COMMAND_WRDI (1L<<17)
1073#define BNX2_NVM_COMMAND_EWSR (1L<<18)
1074#define BNX2_NVM_COMMAND_WRSR (1L<<19)
1075
1076#define BNX2_NVM_STATUS 0x00006404
1077#define BNX2_NVM_STATUS_PI_FSM_STATE (0xfL<<0)
1078#define BNX2_NVM_STATUS_EE_FSM_STATE (0xfL<<4)
1079#define BNX2_NVM_STATUS_EQ_FSM_STATE (0xfL<<8)
1080
1081#define BNX2_NVM_WRITE 0x00006408
1082#define BNX2_NVM_WRITE_NVM_WRITE_VALUE (0xffffffffL<<0)
1083#define BNX2_NVM_WRITE_NVM_WRITE_VALUE_BIT_BANG (0L<<0)
1084#define BNX2_NVM_WRITE_NVM_WRITE_VALUE_EECLK (1L<<0)
1085#define BNX2_NVM_WRITE_NVM_WRITE_VALUE_EEDATA (2L<<0)
1086#define BNX2_NVM_WRITE_NVM_WRITE_VALUE_SCLK (4L<<0)
1087#define BNX2_NVM_WRITE_NVM_WRITE_VALUE_CS_B (8L<<0)
1088#define BNX2_NVM_WRITE_NVM_WRITE_VALUE_SO (16L<<0)
1089#define BNX2_NVM_WRITE_NVM_WRITE_VALUE_SI (32L<<0)
1090
1091#define BNX2_NVM_ADDR 0x0000640c
1092#define BNX2_NVM_ADDR_NVM_ADDR_VALUE (0xffffffL<<0)
1093#define BNX2_NVM_ADDR_NVM_ADDR_VALUE_BIT_BANG (0L<<0)
1094#define BNX2_NVM_ADDR_NVM_ADDR_VALUE_EECLK (1L<<0)
1095#define BNX2_NVM_ADDR_NVM_ADDR_VALUE_EEDATA (2L<<0)
1096#define BNX2_NVM_ADDR_NVM_ADDR_VALUE_SCLK (4L<<0)
1097#define BNX2_NVM_ADDR_NVM_ADDR_VALUE_CS_B (8L<<0)
1098#define BNX2_NVM_ADDR_NVM_ADDR_VALUE_SO (16L<<0)
1099#define BNX2_NVM_ADDR_NVM_ADDR_VALUE_SI (32L<<0)
1100
1101#define BNX2_NVM_READ 0x00006410
1102#define BNX2_NVM_READ_NVM_READ_VALUE (0xffffffffL<<0)
1103#define BNX2_NVM_READ_NVM_READ_VALUE_BIT_BANG (0L<<0)
1104#define BNX2_NVM_READ_NVM_READ_VALUE_EECLK (1L<<0)
1105#define BNX2_NVM_READ_NVM_READ_VALUE_EEDATA (2L<<0)
1106#define BNX2_NVM_READ_NVM_READ_VALUE_SCLK (4L<<0)
1107#define BNX2_NVM_READ_NVM_READ_VALUE_CS_B (8L<<0)
1108#define BNX2_NVM_READ_NVM_READ_VALUE_SO (16L<<0)
1109#define BNX2_NVM_READ_NVM_READ_VALUE_SI (32L<<0)
1110
1111#define BNX2_NVM_CFG1 0x00006414
1112#define BNX2_NVM_CFG1_FLASH_MODE (1L<<0)
1113#define BNX2_NVM_CFG1_BUFFER_MODE (1L<<1)
1114#define BNX2_NVM_CFG1_PASS_MODE (1L<<2)
1115#define BNX2_NVM_CFG1_BITBANG_MODE (1L<<3)
1116#define BNX2_NVM_CFG1_STATUS_BIT (0x7L<<4)
1117#define BNX2_NVM_CFG1_STATUS_BIT_FLASH_RDY (0L<<4)
1118#define BNX2_NVM_CFG1_STATUS_BIT_BUFFER_RDY (7L<<4)
1119#define BNX2_NVM_CFG1_SPI_CLK_DIV (0xfL<<7)
1120#define BNX2_NVM_CFG1_SEE_CLK_DIV (0x7ffL<<11)
1121#define BNX2_NVM_CFG1_PROTECT_MODE (1L<<24)
1122#define BNX2_NVM_CFG1_FLASH_SIZE (1L<<25)
1123#define BNX2_NVM_CFG1_COMPAT_BYPASSS (1L<<31)
1124
1125#define BNX2_NVM_CFG2 0x00006418
1126#define BNX2_NVM_CFG2_ERASE_CMD (0xffL<<0)
1127#define BNX2_NVM_CFG2_DUMMY (0xffL<<8)
1128#define BNX2_NVM_CFG2_STATUS_CMD (0xffL<<16)
1129
1130#define BNX2_NVM_CFG3 0x0000641c
1131#define BNX2_NVM_CFG3_BUFFER_RD_CMD (0xffL<<0)
1132#define BNX2_NVM_CFG3_WRITE_CMD (0xffL<<8)
1133#define BNX2_NVM_CFG3_BUFFER_WRITE_CMD (0xffL<<16)
1134#define BNX2_NVM_CFG3_READ_CMD (0xffL<<24)
1135
1136#define BNX2_NVM_SW_ARB 0x00006420
1137#define BNX2_NVM_SW_ARB_ARB_REQ_SET0 (1L<<0)
1138#define BNX2_NVM_SW_ARB_ARB_REQ_SET1 (1L<<1)
1139#define BNX2_NVM_SW_ARB_ARB_REQ_SET2 (1L<<2)
1140#define BNX2_NVM_SW_ARB_ARB_REQ_SET3 (1L<<3)
1141#define BNX2_NVM_SW_ARB_ARB_REQ_CLR0 (1L<<4)
1142#define BNX2_NVM_SW_ARB_ARB_REQ_CLR1 (1L<<5)
1143#define BNX2_NVM_SW_ARB_ARB_REQ_CLR2 (1L<<6)
1144#define BNX2_NVM_SW_ARB_ARB_REQ_CLR3 (1L<<7)
1145#define BNX2_NVM_SW_ARB_ARB_ARB0 (1L<<8)
1146#define BNX2_NVM_SW_ARB_ARB_ARB1 (1L<<9)
1147#define BNX2_NVM_SW_ARB_ARB_ARB2 (1L<<10)
1148#define BNX2_NVM_SW_ARB_ARB_ARB3 (1L<<11)
1149#define BNX2_NVM_SW_ARB_REQ0 (1L<<12)
1150#define BNX2_NVM_SW_ARB_REQ1 (1L<<13)
1151#define BNX2_NVM_SW_ARB_REQ2 (1L<<14)
1152#define BNX2_NVM_SW_ARB_REQ3 (1L<<15)
1153
1154#define BNX2_NVM_ACCESS_ENABLE 0x00006424
1155#define BNX2_NVM_ACCESS_ENABLE_EN (1L<<0)
1156#define BNX2_NVM_ACCESS_ENABLE_WR_EN (1L<<1)
1157
1158#define BNX2_NVM_WRITE1 0x00006428
1159#define BNX2_NVM_WRITE1_WREN_CMD (0xffL<<0)
1160#define BNX2_NVM_WRITE1_WRDI_CMD (0xffL<<8)
1161#define BNX2_NVM_WRITE1_SR_DATA (0xffL<<16)
1162
1163
1164
1165/*
1166 * dma_reg definition
1167 * offset: 0xc00
1168 */
1169#define BNX2_DMA_COMMAND 0x00000c00
1170#define BNX2_DMA_COMMAND_ENABLE (1L<<0)
1171
1172#define BNX2_DMA_STATUS 0x00000c04
1173#define BNX2_DMA_STATUS_PAR_ERROR_STATE (1L<<0)
1174#define BNX2_DMA_STATUS_READ_TRANSFERS_STAT (1L<<16)
1175#define BNX2_DMA_STATUS_READ_DELAY_PCI_CLKS_STAT (1L<<17)
1176#define BNX2_DMA_STATUS_BIG_READ_TRANSFERS_STAT (1L<<18)
1177#define BNX2_DMA_STATUS_BIG_READ_DELAY_PCI_CLKS_STAT (1L<<19)
1178#define BNX2_DMA_STATUS_BIG_READ_RETRY_AFTER_DATA_STAT (1L<<20)
1179#define BNX2_DMA_STATUS_WRITE_TRANSFERS_STAT (1L<<21)
1180#define BNX2_DMA_STATUS_WRITE_DELAY_PCI_CLKS_STAT (1L<<22)
1181#define BNX2_DMA_STATUS_BIG_WRITE_TRANSFERS_STAT (1L<<23)
1182#define BNX2_DMA_STATUS_BIG_WRITE_DELAY_PCI_CLKS_STAT (1L<<24)
1183#define BNX2_DMA_STATUS_BIG_WRITE_RETRY_AFTER_DATA_STAT (1L<<25)
1184
1185#define BNX2_DMA_CONFIG 0x00000c08
1186#define BNX2_DMA_CONFIG_DATA_BYTE_SWAP (1L<<0)
1187#define BNX2_DMA_CONFIG_DATA_WORD_SWAP (1L<<1)
1188#define BNX2_DMA_CONFIG_CNTL_BYTE_SWAP (1L<<4)
1189#define BNX2_DMA_CONFIG_CNTL_WORD_SWAP (1L<<5)
1190#define BNX2_DMA_CONFIG_ONE_DMA (1L<<6)
1191#define BNX2_DMA_CONFIG_CNTL_TWO_DMA (1L<<7)
1192#define BNX2_DMA_CONFIG_CNTL_FPGA_MODE (1L<<8)
1193#define BNX2_DMA_CONFIG_CNTL_PING_PONG_DMA (1L<<10)
1194#define BNX2_DMA_CONFIG_CNTL_PCI_COMP_DLY (1L<<11)
1195#define BNX2_DMA_CONFIG_NO_RCHANS_IN_USE (0xfL<<12)
1196#define BNX2_DMA_CONFIG_NO_WCHANS_IN_USE (0xfL<<16)
1197#define BNX2_DMA_CONFIG_PCI_CLK_CMP_BITS (0x7L<<20)
1198#define BNX2_DMA_CONFIG_PCI_FAST_CLK_CMP (1L<<23)
1199#define BNX2_DMA_CONFIG_BIG_SIZE (0xfL<<24)
1200#define BNX2_DMA_CONFIG_BIG_SIZE_NONE (0x0L<<24)
1201#define BNX2_DMA_CONFIG_BIG_SIZE_64 (0x1L<<24)
1202#define BNX2_DMA_CONFIG_BIG_SIZE_128 (0x2L<<24)
1203#define BNX2_DMA_CONFIG_BIG_SIZE_256 (0x4L<<24)
1204#define BNX2_DMA_CONFIG_BIG_SIZE_512 (0x8L<<24)
1205
1206#define BNX2_DMA_BLACKOUT 0x00000c0c
1207#define BNX2_DMA_BLACKOUT_RD_RETRY_BLACKOUT (0xffL<<0)
1208#define BNX2_DMA_BLACKOUT_2ND_RD_RETRY_BLACKOUT (0xffL<<8)
1209#define BNX2_DMA_BLACKOUT_WR_RETRY_BLACKOUT (0xffL<<16)
1210
1211#define BNX2_DMA_RCHAN_STAT 0x00000c30
1212#define BNX2_DMA_RCHAN_STAT_COMP_CODE_0 (0x7L<<0)
1213#define BNX2_DMA_RCHAN_STAT_PAR_ERR_0 (1L<<3)
1214#define BNX2_DMA_RCHAN_STAT_COMP_CODE_1 (0x7L<<4)
1215#define BNX2_DMA_RCHAN_STAT_PAR_ERR_1 (1L<<7)
1216#define BNX2_DMA_RCHAN_STAT_COMP_CODE_2 (0x7L<<8)
1217#define BNX2_DMA_RCHAN_STAT_PAR_ERR_2 (1L<<11)
1218#define BNX2_DMA_RCHAN_STAT_COMP_CODE_3 (0x7L<<12)
1219#define BNX2_DMA_RCHAN_STAT_PAR_ERR_3 (1L<<15)
1220#define BNX2_DMA_RCHAN_STAT_COMP_CODE_4 (0x7L<<16)
1221#define BNX2_DMA_RCHAN_STAT_PAR_ERR_4 (1L<<19)
1222#define BNX2_DMA_RCHAN_STAT_COMP_CODE_5 (0x7L<<20)
1223#define BNX2_DMA_RCHAN_STAT_PAR_ERR_5 (1L<<23)
1224#define BNX2_DMA_RCHAN_STAT_COMP_CODE_6 (0x7L<<24)
1225#define BNX2_DMA_RCHAN_STAT_PAR_ERR_6 (1L<<27)
1226#define BNX2_DMA_RCHAN_STAT_COMP_CODE_7 (0x7L<<28)
1227#define BNX2_DMA_RCHAN_STAT_PAR_ERR_7 (1L<<31)
1228
1229#define BNX2_DMA_WCHAN_STAT 0x00000c34
1230#define BNX2_DMA_WCHAN_STAT_COMP_CODE_0 (0x7L<<0)
1231#define BNX2_DMA_WCHAN_STAT_PAR_ERR_0 (1L<<3)
1232#define BNX2_DMA_WCHAN_STAT_COMP_CODE_1 (0x7L<<4)
1233#define BNX2_DMA_WCHAN_STAT_PAR_ERR_1 (1L<<7)
1234#define BNX2_DMA_WCHAN_STAT_COMP_CODE_2 (0x7L<<8)
1235#define BNX2_DMA_WCHAN_STAT_PAR_ERR_2 (1L<<11)
1236#define BNX2_DMA_WCHAN_STAT_COMP_CODE_3 (0x7L<<12)
1237#define BNX2_DMA_WCHAN_STAT_PAR_ERR_3 (1L<<15)
1238#define BNX2_DMA_WCHAN_STAT_COMP_CODE_4 (0x7L<<16)
1239#define BNX2_DMA_WCHAN_STAT_PAR_ERR_4 (1L<<19)
1240#define BNX2_DMA_WCHAN_STAT_COMP_CODE_5 (0x7L<<20)
1241#define BNX2_DMA_WCHAN_STAT_PAR_ERR_5 (1L<<23)
1242#define BNX2_DMA_WCHAN_STAT_COMP_CODE_6 (0x7L<<24)
1243#define BNX2_DMA_WCHAN_STAT_PAR_ERR_6 (1L<<27)
1244#define BNX2_DMA_WCHAN_STAT_COMP_CODE_7 (0x7L<<28)
1245#define BNX2_DMA_WCHAN_STAT_PAR_ERR_7 (1L<<31)
1246
1247#define BNX2_DMA_RCHAN_ASSIGNMENT 0x00000c38
1248#define BNX2_DMA_RCHAN_ASSIGNMENT_0 (0xfL<<0)
1249#define BNX2_DMA_RCHAN_ASSIGNMENT_1 (0xfL<<4)
1250#define BNX2_DMA_RCHAN_ASSIGNMENT_2 (0xfL<<8)
1251#define BNX2_DMA_RCHAN_ASSIGNMENT_3 (0xfL<<12)
1252#define BNX2_DMA_RCHAN_ASSIGNMENT_4 (0xfL<<16)
1253#define BNX2_DMA_RCHAN_ASSIGNMENT_5 (0xfL<<20)
1254#define BNX2_DMA_RCHAN_ASSIGNMENT_6 (0xfL<<24)
1255#define BNX2_DMA_RCHAN_ASSIGNMENT_7 (0xfL<<28)
1256
1257#define BNX2_DMA_WCHAN_ASSIGNMENT 0x00000c3c
1258#define BNX2_DMA_WCHAN_ASSIGNMENT_0 (0xfL<<0)
1259#define BNX2_DMA_WCHAN_ASSIGNMENT_1 (0xfL<<4)
1260#define BNX2_DMA_WCHAN_ASSIGNMENT_2 (0xfL<<8)
1261#define BNX2_DMA_WCHAN_ASSIGNMENT_3 (0xfL<<12)
1262#define BNX2_DMA_WCHAN_ASSIGNMENT_4 (0xfL<<16)
1263#define BNX2_DMA_WCHAN_ASSIGNMENT_5 (0xfL<<20)
1264#define BNX2_DMA_WCHAN_ASSIGNMENT_6 (0xfL<<24)
1265#define BNX2_DMA_WCHAN_ASSIGNMENT_7 (0xfL<<28)
1266
1267#define BNX2_DMA_RCHAN_STAT_00 0x00000c40
1268#define BNX2_DMA_RCHAN_STAT_00_RCHAN_STA_HOST_ADDR_LOW (0xffffffffL<<0)
1269
1270#define BNX2_DMA_RCHAN_STAT_01 0x00000c44
1271#define BNX2_DMA_RCHAN_STAT_01_RCHAN_STA_HOST_ADDR_HIGH (0xffffffffL<<0)
1272
1273#define BNX2_DMA_RCHAN_STAT_02 0x00000c48
1274#define BNX2_DMA_RCHAN_STAT_02_LENGTH (0xffffL<<0)
1275#define BNX2_DMA_RCHAN_STAT_02_WORD_SWAP (1L<<16)
1276#define BNX2_DMA_RCHAN_STAT_02_BYTE_SWAP (1L<<17)
1277#define BNX2_DMA_RCHAN_STAT_02_PRIORITY_LVL (1L<<18)
1278
1279#define BNX2_DMA_RCHAN_STAT_10 0x00000c4c
1280#define BNX2_DMA_RCHAN_STAT_11 0x00000c50
1281#define BNX2_DMA_RCHAN_STAT_12 0x00000c54
1282#define BNX2_DMA_RCHAN_STAT_20 0x00000c58
1283#define BNX2_DMA_RCHAN_STAT_21 0x00000c5c
1284#define BNX2_DMA_RCHAN_STAT_22 0x00000c60
1285#define BNX2_DMA_RCHAN_STAT_30 0x00000c64
1286#define BNX2_DMA_RCHAN_STAT_31 0x00000c68
1287#define BNX2_DMA_RCHAN_STAT_32 0x00000c6c
1288#define BNX2_DMA_RCHAN_STAT_40 0x00000c70
1289#define BNX2_DMA_RCHAN_STAT_41 0x00000c74
1290#define BNX2_DMA_RCHAN_STAT_42 0x00000c78
1291#define BNX2_DMA_RCHAN_STAT_50 0x00000c7c
1292#define BNX2_DMA_RCHAN_STAT_51 0x00000c80
1293#define BNX2_DMA_RCHAN_STAT_52 0x00000c84
1294#define BNX2_DMA_RCHAN_STAT_60 0x00000c88
1295#define BNX2_DMA_RCHAN_STAT_61 0x00000c8c
1296#define BNX2_DMA_RCHAN_STAT_62 0x00000c90
1297#define BNX2_DMA_RCHAN_STAT_70 0x00000c94
1298#define BNX2_DMA_RCHAN_STAT_71 0x00000c98
1299#define BNX2_DMA_RCHAN_STAT_72 0x00000c9c
1300#define BNX2_DMA_WCHAN_STAT_00 0x00000ca0
1301#define BNX2_DMA_WCHAN_STAT_00_WCHAN_STA_HOST_ADDR_LOW (0xffffffffL<<0)
1302
1303#define BNX2_DMA_WCHAN_STAT_01 0x00000ca4
1304#define BNX2_DMA_WCHAN_STAT_01_WCHAN_STA_HOST_ADDR_HIGH (0xffffffffL<<0)
1305
1306#define BNX2_DMA_WCHAN_STAT_02 0x00000ca8
1307#define BNX2_DMA_WCHAN_STAT_02_LENGTH (0xffffL<<0)
1308#define BNX2_DMA_WCHAN_STAT_02_WORD_SWAP (1L<<16)
1309#define BNX2_DMA_WCHAN_STAT_02_BYTE_SWAP (1L<<17)
1310#define BNX2_DMA_WCHAN_STAT_02_PRIORITY_LVL (1L<<18)
1311
1312#define BNX2_DMA_WCHAN_STAT_10 0x00000cac
1313#define BNX2_DMA_WCHAN_STAT_11 0x00000cb0
1314#define BNX2_DMA_WCHAN_STAT_12 0x00000cb4
1315#define BNX2_DMA_WCHAN_STAT_20 0x00000cb8
1316#define BNX2_DMA_WCHAN_STAT_21 0x00000cbc
1317#define BNX2_DMA_WCHAN_STAT_22 0x00000cc0
1318#define BNX2_DMA_WCHAN_STAT_30 0x00000cc4
1319#define BNX2_DMA_WCHAN_STAT_31 0x00000cc8
1320#define BNX2_DMA_WCHAN_STAT_32 0x00000ccc
1321#define BNX2_DMA_WCHAN_STAT_40 0x00000cd0
1322#define BNX2_DMA_WCHAN_STAT_41 0x00000cd4
1323#define BNX2_DMA_WCHAN_STAT_42 0x00000cd8
1324#define BNX2_DMA_WCHAN_STAT_50 0x00000cdc
1325#define BNX2_DMA_WCHAN_STAT_51 0x00000ce0
1326#define BNX2_DMA_WCHAN_STAT_52 0x00000ce4
1327#define BNX2_DMA_WCHAN_STAT_60 0x00000ce8
1328#define BNX2_DMA_WCHAN_STAT_61 0x00000cec
1329#define BNX2_DMA_WCHAN_STAT_62 0x00000cf0
1330#define BNX2_DMA_WCHAN_STAT_70 0x00000cf4
1331#define BNX2_DMA_WCHAN_STAT_71 0x00000cf8
1332#define BNX2_DMA_WCHAN_STAT_72 0x00000cfc
1333#define BNX2_DMA_ARB_STAT_00 0x00000d00
1334#define BNX2_DMA_ARB_STAT_00_MASTER (0xffffL<<0)
1335#define BNX2_DMA_ARB_STAT_00_MASTER_ENC (0xffL<<16)
1336#define BNX2_DMA_ARB_STAT_00_CUR_BINMSTR (0xffL<<24)
1337
1338#define BNX2_DMA_ARB_STAT_01 0x00000d04
1339#define BNX2_DMA_ARB_STAT_01_LPR_RPTR (0xfL<<0)
1340#define BNX2_DMA_ARB_STAT_01_LPR_WPTR (0xfL<<4)
1341#define BNX2_DMA_ARB_STAT_01_LPB_RPTR (0xfL<<8)
1342#define BNX2_DMA_ARB_STAT_01_LPB_WPTR (0xfL<<12)
1343#define BNX2_DMA_ARB_STAT_01_HPR_RPTR (0xfL<<16)
1344#define BNX2_DMA_ARB_STAT_01_HPR_WPTR (0xfL<<20)
1345#define BNX2_DMA_ARB_STAT_01_HPB_RPTR (0xfL<<24)
1346#define BNX2_DMA_ARB_STAT_01_HPB_WPTR (0xfL<<28)
1347
1348#define BNX2_DMA_FUSE_CTRL0_CMD 0x00000f00
1349#define BNX2_DMA_FUSE_CTRL0_CMD_PWRUP_DONE (1L<<0)
1350#define BNX2_DMA_FUSE_CTRL0_CMD_SHIFT_DONE (1L<<1)
1351#define BNX2_DMA_FUSE_CTRL0_CMD_SHIFT (1L<<2)
1352#define BNX2_DMA_FUSE_CTRL0_CMD_LOAD (1L<<3)
1353#define BNX2_DMA_FUSE_CTRL0_CMD_SEL (0xfL<<8)
1354
1355#define BNX2_DMA_FUSE_CTRL0_DATA 0x00000f04
1356#define BNX2_DMA_FUSE_CTRL1_CMD 0x00000f08
1357#define BNX2_DMA_FUSE_CTRL1_CMD_PWRUP_DONE (1L<<0)
1358#define BNX2_DMA_FUSE_CTRL1_CMD_SHIFT_DONE (1L<<1)
1359#define BNX2_DMA_FUSE_CTRL1_CMD_SHIFT (1L<<2)
1360#define BNX2_DMA_FUSE_CTRL1_CMD_LOAD (1L<<3)
1361#define BNX2_DMA_FUSE_CTRL1_CMD_SEL (0xfL<<8)
1362
1363#define BNX2_DMA_FUSE_CTRL1_DATA 0x00000f0c
1364#define BNX2_DMA_FUSE_CTRL2_CMD 0x00000f10
1365#define BNX2_DMA_FUSE_CTRL2_CMD_PWRUP_DONE (1L<<0)
1366#define BNX2_DMA_FUSE_CTRL2_CMD_SHIFT_DONE (1L<<1)
1367#define BNX2_DMA_FUSE_CTRL2_CMD_SHIFT (1L<<2)
1368#define BNX2_DMA_FUSE_CTRL2_CMD_LOAD (1L<<3)
1369#define BNX2_DMA_FUSE_CTRL2_CMD_SEL (0xfL<<8)
1370
1371#define BNX2_DMA_FUSE_CTRL2_DATA 0x00000f14
1372
1373
1374/*
1375 * context_reg definition
1376 * offset: 0x1000
1377 */
1378#define BNX2_CTX_COMMAND 0x00001000
1379#define BNX2_CTX_COMMAND_ENABLED (1L<<0)
1380
1381#define BNX2_CTX_STATUS 0x00001004
1382#define BNX2_CTX_STATUS_LOCK_WAIT (1L<<0)
1383#define BNX2_CTX_STATUS_READ_STAT (1L<<16)
1384#define BNX2_CTX_STATUS_WRITE_STAT (1L<<17)
1385#define BNX2_CTX_STATUS_ACC_STALL_STAT (1L<<18)
1386#define BNX2_CTX_STATUS_LOCK_STALL_STAT (1L<<19)
1387
1388#define BNX2_CTX_VIRT_ADDR 0x00001008
1389#define BNX2_CTX_VIRT_ADDR_VIRT_ADDR (0x7fffL<<6)
1390
1391#define BNX2_CTX_PAGE_TBL 0x0000100c
1392#define BNX2_CTX_PAGE_TBL_PAGE_TBL (0x3fffL<<6)
1393
1394#define BNX2_CTX_DATA_ADR 0x00001010
1395#define BNX2_CTX_DATA_ADR_DATA_ADR (0x7ffffL<<2)
1396
1397#define BNX2_CTX_DATA 0x00001014
1398#define BNX2_CTX_LOCK 0x00001018
1399#define BNX2_CTX_LOCK_TYPE (0x7L<<0)
1400#define BNX2_CTX_LOCK_TYPE_LOCK_TYPE_VOID (0x0L<<0)
1401#define BNX2_CTX_LOCK_TYPE_LOCK_TYPE_COMPLETE (0x7L<<0)
1402#define BNX2_CTX_LOCK_TYPE_LOCK_TYPE_PROTOCOL (0x1L<<0)
1403#define BNX2_CTX_LOCK_TYPE_LOCK_TYPE_TX (0x2L<<0)
1404#define BNX2_CTX_LOCK_TYPE_LOCK_TYPE_TIMER (0x4L<<0)
1405#define BNX2_CTX_LOCK_CID_VALUE (0x3fffL<<7)
1406#define BNX2_CTX_LOCK_GRANTED (1L<<26)
1407#define BNX2_CTX_LOCK_MODE (0x7L<<27)
1408#define BNX2_CTX_LOCK_MODE_UNLOCK (0x0L<<27)
1409#define BNX2_CTX_LOCK_MODE_IMMEDIATE (0x1L<<27)
1410#define BNX2_CTX_LOCK_MODE_SURE (0x2L<<27)
1411#define BNX2_CTX_LOCK_STATUS (1L<<30)
1412#define BNX2_CTX_LOCK_REQ (1L<<31)
1413
1414#define BNX2_CTX_ACCESS_STATUS 0x00001040
1415#define BNX2_CTX_ACCESS_STATUS_MASTERENCODED (0xfL<<0)
1416#define BNX2_CTX_ACCESS_STATUS_ACCESSMEMORYSM (0x3L<<10)
1417#define BNX2_CTX_ACCESS_STATUS_PAGETABLEINITSM (0x3L<<12)
1418#define BNX2_CTX_ACCESS_STATUS_ACCESSMEMORYINITSM (0x3L<<14)
1419#define BNX2_CTX_ACCESS_STATUS_QUALIFIED_REQUEST (0x7ffL<<17)
1420
1421#define BNX2_CTX_DBG_LOCK_STATUS 0x00001044
1422#define BNX2_CTX_DBG_LOCK_STATUS_SM (0x3ffL<<0)
1423#define BNX2_CTX_DBG_LOCK_STATUS_MATCH (0x3ffL<<22)
1424
1425#define BNX2_CTX_CHNL_LOCK_STATUS_0 0x00001080
1426#define BNX2_CTX_CHNL_LOCK_STATUS_0_CID (0x3fffL<<0)
1427#define BNX2_CTX_CHNL_LOCK_STATUS_0_TYPE (0x3L<<14)
1428#define BNX2_CTX_CHNL_LOCK_STATUS_0_MODE (1L<<16)
1429
1430#define BNX2_CTX_CHNL_LOCK_STATUS_1 0x00001084
1431#define BNX2_CTX_CHNL_LOCK_STATUS_2 0x00001088
1432#define BNX2_CTX_CHNL_LOCK_STATUS_3 0x0000108c
1433#define BNX2_CTX_CHNL_LOCK_STATUS_4 0x00001090
1434#define BNX2_CTX_CHNL_LOCK_STATUS_5 0x00001094
1435#define BNX2_CTX_CHNL_LOCK_STATUS_6 0x00001098
1436#define BNX2_CTX_CHNL_LOCK_STATUS_7 0x0000109c
1437#define BNX2_CTX_CHNL_LOCK_STATUS_8 0x000010a0
1438
1439
1440/*
1441 * emac_reg definition
1442 * offset: 0x1400
1443 */
1444#define BNX2_EMAC_MODE 0x00001400
1445#define BNX2_EMAC_MODE_RESET (1L<<0)
1446#define BNX2_EMAC_MODE_HALF_DUPLEX (1L<<1)
1447#define BNX2_EMAC_MODE_PORT (0x3L<<2)
1448#define BNX2_EMAC_MODE_PORT_NONE (0L<<2)
1449#define BNX2_EMAC_MODE_PORT_MII (1L<<2)
1450#define BNX2_EMAC_MODE_PORT_GMII (2L<<2)
1451#define BNX2_EMAC_MODE_PORT_UNDEF (3L<<2)
1452#define BNX2_EMAC_MODE_MAC_LOOP (1L<<4)
1453#define BNX2_EMAC_MODE_TAGGED_MAC_CTL (1L<<7)
1454#define BNX2_EMAC_MODE_TX_BURST (1L<<8)
1455#define BNX2_EMAC_MODE_MAX_DEFER_DROP_ENA (1L<<9)
1456#define BNX2_EMAC_MODE_EXT_LINK_POL (1L<<10)
1457#define BNX2_EMAC_MODE_FORCE_LINK (1L<<11)
1458#define BNX2_EMAC_MODE_MPKT (1L<<18)
1459#define BNX2_EMAC_MODE_MPKT_RCVD (1L<<19)
1460#define BNX2_EMAC_MODE_ACPI_RCVD (1L<<20)
1461
1462#define BNX2_EMAC_STATUS 0x00001404
1463#define BNX2_EMAC_STATUS_LINK (1L<<11)
1464#define BNX2_EMAC_STATUS_LINK_CHANGE (1L<<12)
1465#define BNX2_EMAC_STATUS_MI_COMPLETE (1L<<22)
1466#define BNX2_EMAC_STATUS_MI_INT (1L<<23)
1467#define BNX2_EMAC_STATUS_AP_ERROR (1L<<24)
1468#define BNX2_EMAC_STATUS_PARITY_ERROR_STATE (1L<<31)
1469
1470#define BNX2_EMAC_ATTENTION_ENA 0x00001408
1471#define BNX2_EMAC_ATTENTION_ENA_LINK (1L<<11)
1472#define BNX2_EMAC_ATTENTION_ENA_MI_COMPLETE (1L<<22)
1473#define BNX2_EMAC_ATTENTION_ENA_MI_INT (1L<<23)
1474#define BNX2_EMAC_ATTENTION_ENA_AP_ERROR (1L<<24)
1475
1476#define BNX2_EMAC_LED 0x0000140c
1477#define BNX2_EMAC_LED_OVERRIDE (1L<<0)
1478#define BNX2_EMAC_LED_1000MB_OVERRIDE (1L<<1)
1479#define BNX2_EMAC_LED_100MB_OVERRIDE (1L<<2)
1480#define BNX2_EMAC_LED_10MB_OVERRIDE (1L<<3)
1481#define BNX2_EMAC_LED_TRAFFIC_OVERRIDE (1L<<4)
1482#define BNX2_EMAC_LED_BLNK_TRAFFIC (1L<<5)
1483#define BNX2_EMAC_LED_TRAFFIC (1L<<6)
1484#define BNX2_EMAC_LED_1000MB (1L<<7)
1485#define BNX2_EMAC_LED_100MB (1L<<8)
1486#define BNX2_EMAC_LED_10MB (1L<<9)
1487#define BNX2_EMAC_LED_TRAFFIC_STAT (1L<<10)
1488#define BNX2_EMAC_LED_BLNK_RATE (0xfffL<<19)
1489#define BNX2_EMAC_LED_BLNK_RATE_ENA (1L<<31)
1490
1491#define BNX2_EMAC_MAC_MATCH0 0x00001410
1492#define BNX2_EMAC_MAC_MATCH1 0x00001414
1493#define BNX2_EMAC_MAC_MATCH2 0x00001418
1494#define BNX2_EMAC_MAC_MATCH3 0x0000141c
1495#define BNX2_EMAC_MAC_MATCH4 0x00001420
1496#define BNX2_EMAC_MAC_MATCH5 0x00001424
1497#define BNX2_EMAC_MAC_MATCH6 0x00001428
1498#define BNX2_EMAC_MAC_MATCH7 0x0000142c
1499#define BNX2_EMAC_MAC_MATCH8 0x00001430
1500#define BNX2_EMAC_MAC_MATCH9 0x00001434
1501#define BNX2_EMAC_MAC_MATCH10 0x00001438
1502#define BNX2_EMAC_MAC_MATCH11 0x0000143c
1503#define BNX2_EMAC_MAC_MATCH12 0x00001440
1504#define BNX2_EMAC_MAC_MATCH13 0x00001444
1505#define BNX2_EMAC_MAC_MATCH14 0x00001448
1506#define BNX2_EMAC_MAC_MATCH15 0x0000144c
1507#define BNX2_EMAC_MAC_MATCH16 0x00001450
1508#define BNX2_EMAC_MAC_MATCH17 0x00001454
1509#define BNX2_EMAC_MAC_MATCH18 0x00001458
1510#define BNX2_EMAC_MAC_MATCH19 0x0000145c
1511#define BNX2_EMAC_MAC_MATCH20 0x00001460
1512#define BNX2_EMAC_MAC_MATCH21 0x00001464
1513#define BNX2_EMAC_MAC_MATCH22 0x00001468
1514#define BNX2_EMAC_MAC_MATCH23 0x0000146c
1515#define BNX2_EMAC_MAC_MATCH24 0x00001470
1516#define BNX2_EMAC_MAC_MATCH25 0x00001474
1517#define BNX2_EMAC_MAC_MATCH26 0x00001478
1518#define BNX2_EMAC_MAC_MATCH27 0x0000147c
1519#define BNX2_EMAC_MAC_MATCH28 0x00001480
1520#define BNX2_EMAC_MAC_MATCH29 0x00001484
1521#define BNX2_EMAC_MAC_MATCH30 0x00001488
1522#define BNX2_EMAC_MAC_MATCH31 0x0000148c
1523#define BNX2_EMAC_BACKOFF_SEED 0x00001498
1524#define BNX2_EMAC_BACKOFF_SEED_EMAC_BACKOFF_SEED (0x3ffL<<0)
1525
1526#define BNX2_EMAC_RX_MTU_SIZE 0x0000149c
1527#define BNX2_EMAC_RX_MTU_SIZE_MTU_SIZE (0xffffL<<0)
1528#define BNX2_EMAC_RX_MTU_SIZE_JUMBO_ENA (1L<<31)
1529
1530#define BNX2_EMAC_SERDES_CNTL 0x000014a4
1531#define BNX2_EMAC_SERDES_CNTL_RXR (0x7L<<0)
1532#define BNX2_EMAC_SERDES_CNTL_RXG (0x3L<<3)
1533#define BNX2_EMAC_SERDES_CNTL_RXCKSEL (1L<<6)
1534#define BNX2_EMAC_SERDES_CNTL_TXBIAS (0x7L<<7)
1535#define BNX2_EMAC_SERDES_CNTL_BGMAX (1L<<10)
1536#define BNX2_EMAC_SERDES_CNTL_BGMIN (1L<<11)
1537#define BNX2_EMAC_SERDES_CNTL_TXMODE (1L<<12)
1538#define BNX2_EMAC_SERDES_CNTL_TXEDGE (1L<<13)
1539#define BNX2_EMAC_SERDES_CNTL_SERDES_MODE (1L<<14)
1540#define BNX2_EMAC_SERDES_CNTL_PLLTEST (1L<<15)
1541#define BNX2_EMAC_SERDES_CNTL_CDET_EN (1L<<16)
1542#define BNX2_EMAC_SERDES_CNTL_TBI_LBK (1L<<17)
1543#define BNX2_EMAC_SERDES_CNTL_REMOTE_LBK (1L<<18)
1544#define BNX2_EMAC_SERDES_CNTL_REV_PHASE (1L<<19)
1545#define BNX2_EMAC_SERDES_CNTL_REGCTL12 (0x3L<<20)
1546#define BNX2_EMAC_SERDES_CNTL_REGCTL25 (0x3L<<22)
1547
1548#define BNX2_EMAC_SERDES_STATUS 0x000014a8
1549#define BNX2_EMAC_SERDES_STATUS_RX_STAT (0xffL<<0)
1550#define BNX2_EMAC_SERDES_STATUS_COMMA_DET (1L<<8)
1551
1552#define BNX2_EMAC_MDIO_COMM 0x000014ac
1553#define BNX2_EMAC_MDIO_COMM_DATA (0xffffL<<0)
1554#define BNX2_EMAC_MDIO_COMM_REG_ADDR (0x1fL<<16)
1555#define BNX2_EMAC_MDIO_COMM_PHY_ADDR (0x1fL<<21)
1556#define BNX2_EMAC_MDIO_COMM_COMMAND (0x3L<<26)
1557#define BNX2_EMAC_MDIO_COMM_COMMAND_UNDEFINED_0 (0L<<26)
1558#define BNX2_EMAC_MDIO_COMM_COMMAND_WRITE (1L<<26)
1559#define BNX2_EMAC_MDIO_COMM_COMMAND_READ (2L<<26)
1560#define BNX2_EMAC_MDIO_COMM_COMMAND_UNDEFINED_3 (3L<<26)
1561#define BNX2_EMAC_MDIO_COMM_FAIL (1L<<28)
1562#define BNX2_EMAC_MDIO_COMM_START_BUSY (1L<<29)
1563#define BNX2_EMAC_MDIO_COMM_DISEXT (1L<<30)
1564
1565#define BNX2_EMAC_MDIO_STATUS 0x000014b0
1566#define BNX2_EMAC_MDIO_STATUS_LINK (1L<<0)
1567#define BNX2_EMAC_MDIO_STATUS_10MB (1L<<1)
1568
1569#define BNX2_EMAC_MDIO_MODE 0x000014b4
1570#define BNX2_EMAC_MDIO_MODE_SHORT_PREAMBLE (1L<<1)
1571#define BNX2_EMAC_MDIO_MODE_AUTO_POLL (1L<<4)
1572#define BNX2_EMAC_MDIO_MODE_BIT_BANG (1L<<8)
1573#define BNX2_EMAC_MDIO_MODE_MDIO (1L<<9)
1574#define BNX2_EMAC_MDIO_MODE_MDIO_OE (1L<<10)
1575#define BNX2_EMAC_MDIO_MODE_MDC (1L<<11)
1576#define BNX2_EMAC_MDIO_MODE_MDINT (1L<<12)
1577#define BNX2_EMAC_MDIO_MODE_CLOCK_CNT (0x1fL<<16)
1578
1579#define BNX2_EMAC_MDIO_AUTO_STATUS 0x000014b8
1580#define BNX2_EMAC_MDIO_AUTO_STATUS_AUTO_ERR (1L<<0)
1581
1582#define BNX2_EMAC_TX_MODE 0x000014bc
1583#define BNX2_EMAC_TX_MODE_RESET (1L<<0)
1584#define BNX2_EMAC_TX_MODE_EXT_PAUSE_EN (1L<<3)
1585#define BNX2_EMAC_TX_MODE_FLOW_EN (1L<<4)
1586#define BNX2_EMAC_TX_MODE_BIG_BACKOFF (1L<<5)
1587#define BNX2_EMAC_TX_MODE_LONG_PAUSE (1L<<6)
1588#define BNX2_EMAC_TX_MODE_LINK_AWARE (1L<<7)
1589
1590#define BNX2_EMAC_TX_STATUS 0x000014c0
1591#define BNX2_EMAC_TX_STATUS_XOFFED (1L<<0)
1592#define BNX2_EMAC_TX_STATUS_XOFF_SENT (1L<<1)
1593#define BNX2_EMAC_TX_STATUS_XON_SENT (1L<<2)
1594#define BNX2_EMAC_TX_STATUS_LINK_UP (1L<<3)
1595#define BNX2_EMAC_TX_STATUS_UNDERRUN (1L<<4)
1596
1597#define BNX2_EMAC_TX_LENGTHS 0x000014c4
1598#define BNX2_EMAC_TX_LENGTHS_SLOT (0xffL<<0)
1599#define BNX2_EMAC_TX_LENGTHS_IPG (0xfL<<8)
1600#define BNX2_EMAC_TX_LENGTHS_IPG_CRS (0x3L<<12)
1601
1602#define BNX2_EMAC_RX_MODE 0x000014c8
1603#define BNX2_EMAC_RX_MODE_RESET (1L<<0)
1604#define BNX2_EMAC_RX_MODE_FLOW_EN (1L<<2)
1605#define BNX2_EMAC_RX_MODE_KEEP_MAC_CONTROL (1L<<3)
1606#define BNX2_EMAC_RX_MODE_KEEP_PAUSE (1L<<4)
1607#define BNX2_EMAC_RX_MODE_ACCEPT_OVERSIZE (1L<<5)
1608#define BNX2_EMAC_RX_MODE_ACCEPT_RUNTS (1L<<6)
1609#define BNX2_EMAC_RX_MODE_LLC_CHK (1L<<7)
1610#define BNX2_EMAC_RX_MODE_PROMISCUOUS (1L<<8)
1611#define BNX2_EMAC_RX_MODE_NO_CRC_CHK (1L<<9)
1612#define BNX2_EMAC_RX_MODE_KEEP_VLAN_TAG (1L<<10)
1613#define BNX2_EMAC_RX_MODE_FILT_BROADCAST (1L<<11)
1614#define BNX2_EMAC_RX_MODE_SORT_MODE (1L<<12)
1615
1616#define BNX2_EMAC_RX_STATUS 0x000014cc
1617#define BNX2_EMAC_RX_STATUS_FFED (1L<<0)
1618#define BNX2_EMAC_RX_STATUS_FF_RECEIVED (1L<<1)
1619#define BNX2_EMAC_RX_STATUS_N_RECEIVED (1L<<2)
1620
1621#define BNX2_EMAC_MULTICAST_HASH0 0x000014d0
1622#define BNX2_EMAC_MULTICAST_HASH1 0x000014d4
1623#define BNX2_EMAC_MULTICAST_HASH2 0x000014d8
1624#define BNX2_EMAC_MULTICAST_HASH3 0x000014dc
1625#define BNX2_EMAC_MULTICAST_HASH4 0x000014e0
1626#define BNX2_EMAC_MULTICAST_HASH5 0x000014e4
1627#define BNX2_EMAC_MULTICAST_HASH6 0x000014e8
1628#define BNX2_EMAC_MULTICAST_HASH7 0x000014ec
1629#define BNX2_EMAC_RX_STAT_IFHCINOCTETS 0x00001500
1630#define BNX2_EMAC_RX_STAT_IFHCINBADOCTETS 0x00001504
1631#define BNX2_EMAC_RX_STAT_ETHERSTATSFRAGMENTS 0x00001508
1632#define BNX2_EMAC_RX_STAT_IFHCINUCASTPKTS 0x0000150c
1633#define BNX2_EMAC_RX_STAT_IFHCINMULTICASTPKTS 0x00001510
1634#define BNX2_EMAC_RX_STAT_IFHCINBROADCASTPKTS 0x00001514
1635#define BNX2_EMAC_RX_STAT_DOT3STATSFCSERRORS 0x00001518
1636#define BNX2_EMAC_RX_STAT_DOT3STATSALIGNMENTERRORS 0x0000151c
1637#define BNX2_EMAC_RX_STAT_DOT3STATSCARRIERSENSEERRORS 0x00001520
1638#define BNX2_EMAC_RX_STAT_XONPAUSEFRAMESRECEIVED 0x00001524
1639#define BNX2_EMAC_RX_STAT_XOFFPAUSEFRAMESRECEIVED 0x00001528
1640#define BNX2_EMAC_RX_STAT_MACCONTROLFRAMESRECEIVED 0x0000152c
1641#define BNX2_EMAC_RX_STAT_XOFFSTATEENTERED 0x00001530
1642#define BNX2_EMAC_RX_STAT_DOT3STATSFRAMESTOOLONG 0x00001534
1643#define BNX2_EMAC_RX_STAT_ETHERSTATSJABBERS 0x00001538
1644#define BNX2_EMAC_RX_STAT_ETHERSTATSUNDERSIZEPKTS 0x0000153c
1645#define BNX2_EMAC_RX_STAT_ETHERSTATSPKTS64OCTETS 0x00001540
1646#define BNX2_EMAC_RX_STAT_ETHERSTATSPKTS65OCTETSTO127OCTETS 0x00001544
1647#define BNX2_EMAC_RX_STAT_ETHERSTATSPKTS128OCTETSTO255OCTETS 0x00001548
1648#define BNX2_EMAC_RX_STAT_ETHERSTATSPKTS256OCTETSTO511OCTETS 0x0000154c
1649#define BNX2_EMAC_RX_STAT_ETHERSTATSPKTS512OCTETSTO1023OCTETS 0x00001550
1650#define BNX2_EMAC_RX_STAT_ETHERSTATSPKTS1024OCTETSTO1522OCTETS 0x00001554
1651#define BNX2_EMAC_RX_STAT_ETHERSTATSPKTS1523OCTETSTO9022OCTETS 0x00001558
1652#define BNX2_EMAC_RXMAC_DEBUG0 0x0000155c
1653#define BNX2_EMAC_RXMAC_DEBUG1 0x00001560
1654#define BNX2_EMAC_RXMAC_DEBUG1_LENGTH_NE_BYTE_COUNT (1L<<0)
1655#define BNX2_EMAC_RXMAC_DEBUG1_LENGTH_OUT_RANGE (1L<<1)
1656#define BNX2_EMAC_RXMAC_DEBUG1_BAD_CRC (1L<<2)
1657#define BNX2_EMAC_RXMAC_DEBUG1_RX_ERROR (1L<<3)
1658#define BNX2_EMAC_RXMAC_DEBUG1_ALIGN_ERROR (1L<<4)
1659#define BNX2_EMAC_RXMAC_DEBUG1_LAST_DATA (1L<<5)
1660#define BNX2_EMAC_RXMAC_DEBUG1_ODD_BYTE_START (1L<<6)
1661#define BNX2_EMAC_RXMAC_DEBUG1_BYTE_COUNT (0xffffL<<7)
1662#define BNX2_EMAC_RXMAC_DEBUG1_SLOT_TIME (0xffL<<23)
1663
1664#define BNX2_EMAC_RXMAC_DEBUG2 0x00001564
1665#define BNX2_EMAC_RXMAC_DEBUG2_SM_STATE (0x7L<<0)
1666#define BNX2_EMAC_RXMAC_DEBUG2_SM_STATE_IDLE (0x0L<<0)
1667#define BNX2_EMAC_RXMAC_DEBUG2_SM_STATE_SFD (0x1L<<0)
1668#define BNX2_EMAC_RXMAC_DEBUG2_SM_STATE_DATA (0x2L<<0)
1669#define BNX2_EMAC_RXMAC_DEBUG2_SM_STATE_SKEEP (0x3L<<0)
1670#define BNX2_EMAC_RXMAC_DEBUG2_SM_STATE_EXT (0x4L<<0)
1671#define BNX2_EMAC_RXMAC_DEBUG2_SM_STATE_DROP (0x5L<<0)
1672#define BNX2_EMAC_RXMAC_DEBUG2_SM_STATE_SDROP (0x6L<<0)
1673#define BNX2_EMAC_RXMAC_DEBUG2_SM_STATE_FC (0x7L<<0)
1674#define BNX2_EMAC_RXMAC_DEBUG2_IDI_STATE (0xfL<<3)
1675#define BNX2_EMAC_RXMAC_DEBUG2_IDI_STATE_IDLE (0x0L<<3)
1676#define BNX2_EMAC_RXMAC_DEBUG2_IDI_STATE_DATA0 (0x1L<<3)
1677#define BNX2_EMAC_RXMAC_DEBUG2_IDI_STATE_DATA1 (0x2L<<3)
1678#define BNX2_EMAC_RXMAC_DEBUG2_IDI_STATE_DATA2 (0x3L<<3)
1679#define BNX2_EMAC_RXMAC_DEBUG2_IDI_STATE_DATA3 (0x4L<<3)
1680#define BNX2_EMAC_RXMAC_DEBUG2_IDI_STATE_ABORT (0x5L<<3)
1681#define BNX2_EMAC_RXMAC_DEBUG2_IDI_STATE_WAIT (0x6L<<3)
1682#define BNX2_EMAC_RXMAC_DEBUG2_IDI_STATE_STATUS (0x7L<<3)
1683#define BNX2_EMAC_RXMAC_DEBUG2_IDI_STATE_LAST (0x8L<<3)
1684#define BNX2_EMAC_RXMAC_DEBUG2_BYTE_IN (0xffL<<7)
1685#define BNX2_EMAC_RXMAC_DEBUG2_FALSEC (1L<<15)
1686#define BNX2_EMAC_RXMAC_DEBUG2_TAGGED (1L<<16)
1687#define BNX2_EMAC_RXMAC_DEBUG2_PAUSE_STATE (1L<<18)
1688#define BNX2_EMAC_RXMAC_DEBUG2_PAUSE_STATE_IDLE (0L<<18)
1689#define BNX2_EMAC_RXMAC_DEBUG2_PAUSE_STATE_PAUSED (1L<<18)
1690#define BNX2_EMAC_RXMAC_DEBUG2_SE_COUNTER (0xfL<<19)
1691#define BNX2_EMAC_RXMAC_DEBUG2_QUANTA (0x1fL<<23)
1692
1693#define BNX2_EMAC_RXMAC_DEBUG3 0x00001568
1694#define BNX2_EMAC_RXMAC_DEBUG3_PAUSE_CTR (0xffffL<<0)
1695#define BNX2_EMAC_RXMAC_DEBUG3_TMP_PAUSE_CTR (0xffffL<<16)
1696
1697#define BNX2_EMAC_RXMAC_DEBUG4 0x0000156c
1698#define BNX2_EMAC_RXMAC_DEBUG4_TYPE_FIELD (0xffffL<<0)
1699#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE (0x3fL<<16)
1700#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_IDLE (0x0L<<16)
1701#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_UMAC2 (0x1L<<16)
1702#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_UMAC3 (0x2L<<16)
1703#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_UNI (0x3L<<16)
1704#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_MMAC2 (0x7L<<16)
1705#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_MMAC3 (0x5L<<16)
1706#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_PSA1 (0x6L<<16)
1707#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_PSA2 (0x7L<<16)
1708#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_PSA3 (0x8L<<16)
1709#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_MC2 (0x9L<<16)
1710#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_MC3 (0xaL<<16)
1711#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_MWAIT1 (0xeL<<16)
1712#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_MWAIT2 (0xfL<<16)
1713#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_MCHECK (0x10L<<16)
1714#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_MC (0x11L<<16)
1715#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_BC2 (0x12L<<16)
1716#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_BC3 (0x13L<<16)
1717#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_BSA1 (0x14L<<16)
1718#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_BSA2 (0x15L<<16)
1719#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_BSA3 (0x16L<<16)
1720#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_BTYPE (0x17L<<16)
1721#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_BC (0x18L<<16)
1722#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_PTYPE (0x19L<<16)
1723#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_CMD (0x1aL<<16)
1724#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_MAC (0x1bL<<16)
1725#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_LATCH (0x1cL<<16)
1726#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_XOFF (0x1dL<<16)
1727#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_XON (0x1eL<<16)
1728#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_PAUSED (0x1fL<<16)
1729#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_NPAUSED (0x20L<<16)
1730#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_TTYPE (0x21L<<16)
1731#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_TVAL (0x22L<<16)
1732#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_USA1 (0x23L<<16)
1733#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_USA2 (0x24L<<16)
1734#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_USA3 (0x25L<<16)
1735#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_UTYPE (0x26L<<16)
1736#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_UTTYPE (0x27L<<16)
1737#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_UTVAL (0x28L<<16)
1738#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_MTYPE (0x29L<<16)
1739#define BNX2_EMAC_RXMAC_DEBUG4_FILT_STATE_DROP (0x2aL<<16)
1740#define BNX2_EMAC_RXMAC_DEBUG4_DROP_PKT (1L<<22)
1741#define BNX2_EMAC_RXMAC_DEBUG4_SLOT_FILLED (1L<<23)
1742#define BNX2_EMAC_RXMAC_DEBUG4_FALSE_CARRIER (1L<<24)
1743#define BNX2_EMAC_RXMAC_DEBUG4_LAST_DATA (1L<<25)
1744#define BNX2_EMAC_RXMAC_DEBUG4_sfd_FOUND (1L<<26)
1745#define BNX2_EMAC_RXMAC_DEBUG4_ADVANCE (1L<<27)
1746#define BNX2_EMAC_RXMAC_DEBUG4_START (1L<<28)
1747
1748#define BNX2_EMAC_RXMAC_DEBUG5 0x00001570
1749#define BNX2_EMAC_RXMAC_DEBUG5_PS_IDISM (0x7L<<0)
1750#define BNX2_EMAC_RXMAC_DEBUG5_PS_IDISM_IDLE (0L<<0)
1751#define BNX2_EMAC_RXMAC_DEBUG5_PS_IDISM_WAIT_EOF (1L<<0)
1752#define BNX2_EMAC_RXMAC_DEBUG5_PS_IDISM_WAIT_STAT (2L<<0)
1753#define BNX2_EMAC_RXMAC_DEBUG5_PS_IDISM_SET_EOF4FCRC (3L<<0)
1754#define BNX2_EMAC_RXMAC_DEBUG5_PS_IDISM_SET_EOF4RDE (4L<<0)
1755#define BNX2_EMAC_RXMAC_DEBUG5_PS_IDISM_SET_EOF4ALL (5L<<0)
1756#define BNX2_EMAC_RXMAC_DEBUG5_PS_IDISM_1WD_WAIT_STAT (6L<<0)
1757#define BNX2_EMAC_RXMAC_DEBUG5_CCODE_BUF1 (0x7L<<4)
1758#define BNX2_EMAC_RXMAC_DEBUG5_CCODE_BUF1_VDW (0x0L<<4)
1759#define BNX2_EMAC_RXMAC_DEBUG5_CCODE_BUF1_STAT (0x1L<<4)
1760#define BNX2_EMAC_RXMAC_DEBUG5_CCODE_BUF1_AEOF (0x2L<<4)
1761#define BNX2_EMAC_RXMAC_DEBUG5_CCODE_BUF1_NEOF (0x3L<<4)
1762#define BNX2_EMAC_RXMAC_DEBUG5_CCODE_BUF1_SOF (0x4L<<4)
1763#define BNX2_EMAC_RXMAC_DEBUG5_CCODE_BUF1_SAEOF (0x6L<<4)
1764#define BNX2_EMAC_RXMAC_DEBUG5_CCODE_BUF1_SNEOF (0x7L<<4)
1765#define BNX2_EMAC_RXMAC_DEBUG5_EOF_DETECTED (1L<<7)
1766#define BNX2_EMAC_RXMAC_DEBUG5_CCODE_BUF0 (0x7L<<8)
1767#define BNX2_EMAC_RXMAC_DEBUG5_RPM_IDI_FIFO_FULL (1L<<11)
1768#define BNX2_EMAC_RXMAC_DEBUG5_LOAD_CCODE (1L<<12)
1769#define BNX2_EMAC_RXMAC_DEBUG5_LOAD_DATA (1L<<13)
1770#define BNX2_EMAC_RXMAC_DEBUG5_LOAD_STAT (1L<<14)
1771#define BNX2_EMAC_RXMAC_DEBUG5_CLR_STAT (1L<<15)
1772#define BNX2_EMAC_RXMAC_DEBUG5_IDI_RPM_CCODE (0x3L<<16)
1773#define BNX2_EMAC_RXMAC_DEBUG5_IDI_RPM_ACCEPT (1L<<19)
1774#define BNX2_EMAC_RXMAC_DEBUG5_FMLEN (0xfffL<<20)
1775
1776#define BNX2_EMAC_RX_STAT_AC0 0x00001580
1777#define BNX2_EMAC_RX_STAT_AC1 0x00001584
1778#define BNX2_EMAC_RX_STAT_AC2 0x00001588
1779#define BNX2_EMAC_RX_STAT_AC3 0x0000158c
1780#define BNX2_EMAC_RX_STAT_AC4 0x00001590
1781#define BNX2_EMAC_RX_STAT_AC5 0x00001594
1782#define BNX2_EMAC_RX_STAT_AC6 0x00001598
1783#define BNX2_EMAC_RX_STAT_AC7 0x0000159c
1784#define BNX2_EMAC_RX_STAT_AC8 0x000015a0
1785#define BNX2_EMAC_RX_STAT_AC9 0x000015a4
1786#define BNX2_EMAC_RX_STAT_AC10 0x000015a8
1787#define BNX2_EMAC_RX_STAT_AC11 0x000015ac
1788#define BNX2_EMAC_RX_STAT_AC12 0x000015b0
1789#define BNX2_EMAC_RX_STAT_AC13 0x000015b4
1790#define BNX2_EMAC_RX_STAT_AC14 0x000015b8
1791#define BNX2_EMAC_RX_STAT_AC15 0x000015bc
1792#define BNX2_EMAC_RX_STAT_AC16 0x000015c0
1793#define BNX2_EMAC_RX_STAT_AC17 0x000015c4
1794#define BNX2_EMAC_RX_STAT_AC18 0x000015c8
1795#define BNX2_EMAC_RX_STAT_AC19 0x000015cc
1796#define BNX2_EMAC_RX_STAT_AC20 0x000015d0
1797#define BNX2_EMAC_RX_STAT_AC21 0x000015d4
1798#define BNX2_EMAC_RX_STAT_AC22 0x000015d8
1799#define BNX2_EMAC_RXMAC_SUC_DBG_OVERRUNVEC 0x000015dc
1800#define BNX2_EMAC_TX_STAT_IFHCOUTOCTETS 0x00001600
1801#define BNX2_EMAC_TX_STAT_IFHCOUTBADOCTETS 0x00001604
1802#define BNX2_EMAC_TX_STAT_ETHERSTATSCOLLISIONS 0x00001608
1803#define BNX2_EMAC_TX_STAT_OUTXONSENT 0x0000160c
1804#define BNX2_EMAC_TX_STAT_OUTXOFFSENT 0x00001610
1805#define BNX2_EMAC_TX_STAT_FLOWCONTROLDONE 0x00001614
1806#define BNX2_EMAC_TX_STAT_DOT3STATSSINGLECOLLISIONFRAMES 0x00001618
1807#define BNX2_EMAC_TX_STAT_DOT3STATSMULTIPLECOLLISIONFRAMES 0x0000161c
1808#define BNX2_EMAC_TX_STAT_DOT3STATSDEFERREDTRANSMISSIONS 0x00001620
1809#define BNX2_EMAC_TX_STAT_DOT3STATSEXCESSIVECOLLISIONS 0x00001624
1810#define BNX2_EMAC_TX_STAT_DOT3STATSLATECOLLISIONS 0x00001628
1811#define BNX2_EMAC_TX_STAT_IFHCOUTUCASTPKTS 0x0000162c
1812#define BNX2_EMAC_TX_STAT_IFHCOUTMULTICASTPKTS 0x00001630
1813#define BNX2_EMAC_TX_STAT_IFHCOUTBROADCASTPKTS 0x00001634
1814#define BNX2_EMAC_TX_STAT_ETHERSTATSPKTS64OCTETS 0x00001638
1815#define BNX2_EMAC_TX_STAT_ETHERSTATSPKTS65OCTETSTO127OCTETS 0x0000163c
1816#define BNX2_EMAC_TX_STAT_ETHERSTATSPKTS128OCTETSTO255OCTETS 0x00001640
1817#define BNX2_EMAC_TX_STAT_ETHERSTATSPKTS256OCTETSTO511OCTETS 0x00001644
1818#define BNX2_EMAC_TX_STAT_ETHERSTATSPKTS512OCTETSTO1023OCTETS 0x00001648
1819#define BNX2_EMAC_TX_STAT_ETHERSTATSPKTS1024OCTETSTO1522OCTETS 0x0000164c
1820#define BNX2_EMAC_TX_STAT_ETHERSTATSPKTS1523OCTETSTO9022OCTETS 0x00001650
1821#define BNX2_EMAC_TX_STAT_DOT3STATSINTERNALMACTRANSMITERRORS 0x00001654
1822#define BNX2_EMAC_TXMAC_DEBUG0 0x00001658
1823#define BNX2_EMAC_TXMAC_DEBUG1 0x0000165c
1824#define BNX2_EMAC_TXMAC_DEBUG1_ODI_STATE (0xfL<<0)
1825#define BNX2_EMAC_TXMAC_DEBUG1_ODI_STATE_IDLE (0x0L<<0)
1826#define BNX2_EMAC_TXMAC_DEBUG1_ODI_STATE_START0 (0x1L<<0)
1827#define BNX2_EMAC_TXMAC_DEBUG1_ODI_STATE_DATA0 (0x4L<<0)
1828#define BNX2_EMAC_TXMAC_DEBUG1_ODI_STATE_DATA1 (0x5L<<0)
1829#define BNX2_EMAC_TXMAC_DEBUG1_ODI_STATE_DATA2 (0x6L<<0)
1830#define BNX2_EMAC_TXMAC_DEBUG1_ODI_STATE_DATA3 (0x7L<<0)
1831#define BNX2_EMAC_TXMAC_DEBUG1_ODI_STATE_WAIT0 (0x8L<<0)
1832#define BNX2_EMAC_TXMAC_DEBUG1_ODI_STATE_WAIT1 (0x9L<<0)
1833#define BNX2_EMAC_TXMAC_DEBUG1_CRS_ENABLE (1L<<4)
1834#define BNX2_EMAC_TXMAC_DEBUG1_BAD_CRC (1L<<5)
1835#define BNX2_EMAC_TXMAC_DEBUG1_SE_COUNTER (0xfL<<6)
1836#define BNX2_EMAC_TXMAC_DEBUG1_SEND_PAUSE (1L<<10)
1837#define BNX2_EMAC_TXMAC_DEBUG1_LATE_COLLISION (1L<<11)
1838#define BNX2_EMAC_TXMAC_DEBUG1_MAX_DEFER (1L<<12)
1839#define BNX2_EMAC_TXMAC_DEBUG1_DEFERRED (1L<<13)
1840#define BNX2_EMAC_TXMAC_DEBUG1_ONE_BYTE (1L<<14)
1841#define BNX2_EMAC_TXMAC_DEBUG1_IPG_TIME (0xfL<<15)
1842#define BNX2_EMAC_TXMAC_DEBUG1_SLOT_TIME (0xffL<<19)
1843
1844#define BNX2_EMAC_TXMAC_DEBUG2 0x00001660
1845#define BNX2_EMAC_TXMAC_DEBUG2_BACK_OFF (0x3ffL<<0)
1846#define BNX2_EMAC_TXMAC_DEBUG2_BYTE_COUNT (0xffffL<<10)
1847#define BNX2_EMAC_TXMAC_DEBUG2_COL_COUNT (0x1fL<<26)
1848#define BNX2_EMAC_TXMAC_DEBUG2_COL_BIT (1L<<31)
1849
1850#define BNX2_EMAC_TXMAC_DEBUG3 0x00001664
1851#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE (0xfL<<0)
1852#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_IDLE (0x0L<<0)
1853#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_PRE1 (0x1L<<0)
1854#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_PRE2 (0x2L<<0)
1855#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_SFD (0x3L<<0)
1856#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_DATA (0x4L<<0)
1857#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_CRC1 (0x5L<<0)
1858#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_CRC2 (0x6L<<0)
1859#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_EXT (0x7L<<0)
1860#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_STATB (0x8L<<0)
1861#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_STATG (0x9L<<0)
1862#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_JAM (0xaL<<0)
1863#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_EJAM (0xbL<<0)
1864#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_BJAM (0xcL<<0)
1865#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_SWAIT (0xdL<<0)
1866#define BNX2_EMAC_TXMAC_DEBUG3_SM_STATE_BACKOFF (0xeL<<0)
1867#define BNX2_EMAC_TXMAC_DEBUG3_FILT_STATE (0x7L<<4)
1868#define BNX2_EMAC_TXMAC_DEBUG3_FILT_STATE_IDLE (0x0L<<4)
1869#define BNX2_EMAC_TXMAC_DEBUG3_FILT_STATE_WAIT (0x1L<<4)
1870#define BNX2_EMAC_TXMAC_DEBUG3_FILT_STATE_UNI (0x2L<<4)
1871#define BNX2_EMAC_TXMAC_DEBUG3_FILT_STATE_MC (0x3L<<4)
1872#define BNX2_EMAC_TXMAC_DEBUG3_FILT_STATE_BC2 (0x4L<<4)
1873#define BNX2_EMAC_TXMAC_DEBUG3_FILT_STATE_BC3 (0x5L<<4)
1874#define BNX2_EMAC_TXMAC_DEBUG3_FILT_STATE_BC (0x6L<<4)
1875#define BNX2_EMAC_TXMAC_DEBUG3_CRS_DONE (1L<<7)
1876#define BNX2_EMAC_TXMAC_DEBUG3_XOFF (1L<<8)
1877#define BNX2_EMAC_TXMAC_DEBUG3_SE_COUNTER (0xfL<<9)
1878#define BNX2_EMAC_TXMAC_DEBUG3_QUANTA_COUNTER (0x1fL<<13)
1879
1880#define BNX2_EMAC_TXMAC_DEBUG4 0x00001668
1881#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_COUNTER (0xffffL<<0)
1882#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE (0xfL<<16)
1883#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE_IDLE (0x0L<<16)
1884#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE_MCA1 (0x2L<<16)
1885#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE_MCA2 (0x3L<<16)
1886#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE_MCA3 (0x6L<<16)
1887#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE_SRC1 (0x7L<<16)
1888#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE_SRC2 (0x5L<<16)
1889#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE_SRC3 (0x4L<<16)
1890#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE_TYPE (0xcL<<16)
1891#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE_CMD (0xeL<<16)
1892#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE_TIME (0xaL<<16)
1893#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE_CRC1 (0x8L<<16)
1894#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE_CRC2 (0x9L<<16)
1895#define BNX2_EMAC_TXMAC_DEBUG4_PAUSE_STATE_WAIT (0xdL<<16)
1896#define BNX2_EMAC_TXMAC_DEBUG4_STATS0_VALID (1L<<20)
1897#define BNX2_EMAC_TXMAC_DEBUG4_APPEND_CRC (1L<<21)
1898#define BNX2_EMAC_TXMAC_DEBUG4_SLOT_FILLED (1L<<22)
1899#define BNX2_EMAC_TXMAC_DEBUG4_MAX_DEFER (1L<<23)
1900#define BNX2_EMAC_TXMAC_DEBUG4_SEND_EXTEND (1L<<24)
1901#define BNX2_EMAC_TXMAC_DEBUG4_SEND_PADDING (1L<<25)
1902#define BNX2_EMAC_TXMAC_DEBUG4_EOF_LOC (1L<<26)
1903#define BNX2_EMAC_TXMAC_DEBUG4_COLLIDING (1L<<27)
1904#define BNX2_EMAC_TXMAC_DEBUG4_COL_IN (1L<<28)
1905#define BNX2_EMAC_TXMAC_DEBUG4_BURSTING (1L<<29)
1906#define BNX2_EMAC_TXMAC_DEBUG4_ADVANCE (1L<<30)
1907#define BNX2_EMAC_TXMAC_DEBUG4_GO (1L<<31)
1908
1909#define BNX2_EMAC_TX_STAT_AC0 0x00001680
1910#define BNX2_EMAC_TX_STAT_AC1 0x00001684
1911#define BNX2_EMAC_TX_STAT_AC2 0x00001688
1912#define BNX2_EMAC_TX_STAT_AC3 0x0000168c
1913#define BNX2_EMAC_TX_STAT_AC4 0x00001690
1914#define BNX2_EMAC_TX_STAT_AC5 0x00001694
1915#define BNX2_EMAC_TX_STAT_AC6 0x00001698
1916#define BNX2_EMAC_TX_STAT_AC7 0x0000169c
1917#define BNX2_EMAC_TX_STAT_AC8 0x000016a0
1918#define BNX2_EMAC_TX_STAT_AC9 0x000016a4
1919#define BNX2_EMAC_TX_STAT_AC10 0x000016a8
1920#define BNX2_EMAC_TX_STAT_AC11 0x000016ac
1921#define BNX2_EMAC_TX_STAT_AC12 0x000016b0
1922#define BNX2_EMAC_TX_STAT_AC13 0x000016b4
1923#define BNX2_EMAC_TX_STAT_AC14 0x000016b8
1924#define BNX2_EMAC_TX_STAT_AC15 0x000016bc
1925#define BNX2_EMAC_TX_STAT_AC16 0x000016c0
1926#define BNX2_EMAC_TX_STAT_AC17 0x000016c4
1927#define BNX2_EMAC_TX_STAT_AC18 0x000016c8
1928#define BNX2_EMAC_TX_STAT_AC19 0x000016cc
1929#define BNX2_EMAC_TX_STAT_AC20 0x000016d0
1930#define BNX2_EMAC_TX_STAT_AC21 0x000016d4
1931#define BNX2_EMAC_TXMAC_SUC_DBG_OVERRUNVEC 0x000016d8
1932
1933
1934/*
1935 * rpm_reg definition
1936 * offset: 0x1800
1937 */
1938#define BNX2_RPM_COMMAND 0x00001800
1939#define BNX2_RPM_COMMAND_ENABLED (1L<<0)
1940#define BNX2_RPM_COMMAND_OVERRUN_ABORT (1L<<4)
1941
1942#define BNX2_RPM_STATUS 0x00001804
1943#define BNX2_RPM_STATUS_MBUF_WAIT (1L<<0)
1944#define BNX2_RPM_STATUS_FREE_WAIT (1L<<1)
1945
1946#define BNX2_RPM_CONFIG 0x00001808
1947#define BNX2_RPM_CONFIG_NO_PSD_HDR_CKSUM (1L<<0)
1948#define BNX2_RPM_CONFIG_ACPI_ENA (1L<<1)
1949#define BNX2_RPM_CONFIG_ACPI_KEEP (1L<<2)
1950#define BNX2_RPM_CONFIG_MP_KEEP (1L<<3)
1951#define BNX2_RPM_CONFIG_SORT_VECT_VAL (0xfL<<4)
1952#define BNX2_RPM_CONFIG_IGNORE_VLAN (1L<<31)
1953
1954#define BNX2_RPM_VLAN_MATCH0 0x00001810
1955#define BNX2_RPM_VLAN_MATCH0_RPM_VLAN_MTCH0_VALUE (0xfffL<<0)
1956
1957#define BNX2_RPM_VLAN_MATCH1 0x00001814
1958#define BNX2_RPM_VLAN_MATCH1_RPM_VLAN_MTCH1_VALUE (0xfffL<<0)
1959
1960#define BNX2_RPM_VLAN_MATCH2 0x00001818
1961#define BNX2_RPM_VLAN_MATCH2_RPM_VLAN_MTCH2_VALUE (0xfffL<<0)
1962
1963#define BNX2_RPM_VLAN_MATCH3 0x0000181c
1964#define BNX2_RPM_VLAN_MATCH3_RPM_VLAN_MTCH3_VALUE (0xfffL<<0)
1965
1966#define BNX2_RPM_SORT_USER0 0x00001820
1967#define BNX2_RPM_SORT_USER0_PM_EN (0xffffL<<0)
1968#define BNX2_RPM_SORT_USER0_BC_EN (1L<<16)
1969#define BNX2_RPM_SORT_USER0_MC_EN (1L<<17)
1970#define BNX2_RPM_SORT_USER0_MC_HSH_EN (1L<<18)
1971#define BNX2_RPM_SORT_USER0_PROM_EN (1L<<19)
1972#define BNX2_RPM_SORT_USER0_VLAN_EN (0xfL<<20)
1973#define BNX2_RPM_SORT_USER0_PROM_VLAN (1L<<24)
1974#define BNX2_RPM_SORT_USER0_ENA (1L<<31)
1975
1976#define BNX2_RPM_SORT_USER1 0x00001824
1977#define BNX2_RPM_SORT_USER1_PM_EN (0xffffL<<0)
1978#define BNX2_RPM_SORT_USER1_BC_EN (1L<<16)
1979#define BNX2_RPM_SORT_USER1_MC_EN (1L<<17)
1980#define BNX2_RPM_SORT_USER1_MC_HSH_EN (1L<<18)
1981#define BNX2_RPM_SORT_USER1_PROM_EN (1L<<19)
1982#define BNX2_RPM_SORT_USER1_VLAN_EN (0xfL<<20)
1983#define BNX2_RPM_SORT_USER1_PROM_VLAN (1L<<24)
1984#define BNX2_RPM_SORT_USER1_ENA (1L<<31)
1985
1986#define BNX2_RPM_SORT_USER2 0x00001828
1987#define BNX2_RPM_SORT_USER2_PM_EN (0xffffL<<0)
1988#define BNX2_RPM_SORT_USER2_BC_EN (1L<<16)
1989#define BNX2_RPM_SORT_USER2_MC_EN (1L<<17)
1990#define BNX2_RPM_SORT_USER2_MC_HSH_EN (1L<<18)
1991#define BNX2_RPM_SORT_USER2_PROM_EN (1L<<19)
1992#define BNX2_RPM_SORT_USER2_VLAN_EN (0xfL<<20)
1993#define BNX2_RPM_SORT_USER2_PROM_VLAN (1L<<24)
1994#define BNX2_RPM_SORT_USER2_ENA (1L<<31)
1995
1996#define BNX2_RPM_SORT_USER3 0x0000182c
1997#define BNX2_RPM_SORT_USER3_PM_EN (0xffffL<<0)
1998#define BNX2_RPM_SORT_USER3_BC_EN (1L<<16)
1999#define BNX2_RPM_SORT_USER3_MC_EN (1L<<17)
2000#define BNX2_RPM_SORT_USER3_MC_HSH_EN (1L<<18)
2001#define BNX2_RPM_SORT_USER3_PROM_EN (1L<<19)
2002#define BNX2_RPM_SORT_USER3_VLAN_EN (0xfL<<20)
2003#define BNX2_RPM_SORT_USER3_PROM_VLAN (1L<<24)
2004#define BNX2_RPM_SORT_USER3_ENA (1L<<31)
2005
2006#define BNX2_RPM_STAT_L2_FILTER_DISCARDS 0x00001840
2007#define BNX2_RPM_STAT_RULE_CHECKER_DISCARDS 0x00001844
2008#define BNX2_RPM_STAT_IFINFTQDISCARDS 0x00001848
2009#define BNX2_RPM_STAT_IFINMBUFDISCARD 0x0000184c
2010#define BNX2_RPM_STAT_RULE_CHECKER_P4_HIT 0x00001850
2011#define BNX2_RPM_STAT_AC0 0x00001880
2012#define BNX2_RPM_STAT_AC1 0x00001884
2013#define BNX2_RPM_STAT_AC2 0x00001888
2014#define BNX2_RPM_STAT_AC3 0x0000188c
2015#define BNX2_RPM_STAT_AC4 0x00001890
2016#define BNX2_RPM_RC_CNTL_0 0x00001900
2017#define BNX2_RPM_RC_CNTL_0_OFFSET (0xffL<<0)
2018#define BNX2_RPM_RC_CNTL_0_CLASS (0x7L<<8)
2019#define BNX2_RPM_RC_CNTL_0_PRIORITY (1L<<11)
2020#define BNX2_RPM_RC_CNTL_0_P4 (1L<<12)
2021#define BNX2_RPM_RC_CNTL_0_HDR_TYPE (0x7L<<13)
2022#define BNX2_RPM_RC_CNTL_0_HDR_TYPE_START (0L<<13)
2023#define BNX2_RPM_RC_CNTL_0_HDR_TYPE_IP (1L<<13)
2024#define BNX2_RPM_RC_CNTL_0_HDR_TYPE_TCP (2L<<13)
2025#define BNX2_RPM_RC_CNTL_0_HDR_TYPE_UDP (3L<<13)
2026#define BNX2_RPM_RC_CNTL_0_HDR_TYPE_DATA (4L<<13)
2027#define BNX2_RPM_RC_CNTL_0_COMP (0x3L<<16)
2028#define BNX2_RPM_RC_CNTL_0_COMP_EQUAL (0L<<16)
2029#define BNX2_RPM_RC_CNTL_0_COMP_NEQUAL (1L<<16)
2030#define BNX2_RPM_RC_CNTL_0_COMP_GREATER (2L<<16)
2031#define BNX2_RPM_RC_CNTL_0_COMP_LESS (3L<<16)
2032#define BNX2_RPM_RC_CNTL_0_SBIT (1L<<19)
2033#define BNX2_RPM_RC_CNTL_0_CMDSEL (0xfL<<20)
2034#define BNX2_RPM_RC_CNTL_0_MAP (1L<<24)
2035#define BNX2_RPM_RC_CNTL_0_DISCARD (1L<<25)
2036#define BNX2_RPM_RC_CNTL_0_MASK (1L<<26)
2037#define BNX2_RPM_RC_CNTL_0_P1 (1L<<27)
2038#define BNX2_RPM_RC_CNTL_0_P2 (1L<<28)
2039#define BNX2_RPM_RC_CNTL_0_P3 (1L<<29)
2040#define BNX2_RPM_RC_CNTL_0_NBIT (1L<<30)
2041
2042#define BNX2_RPM_RC_VALUE_MASK_0 0x00001904
2043#define BNX2_RPM_RC_VALUE_MASK_0_VALUE (0xffffL<<0)
2044#define BNX2_RPM_RC_VALUE_MASK_0_MASK (0xffffL<<16)
2045
2046#define BNX2_RPM_RC_CNTL_1 0x00001908
2047#define BNX2_RPM_RC_CNTL_1_A (0x3ffffL<<0)
2048#define BNX2_RPM_RC_CNTL_1_B (0xfffL<<19)
2049
2050#define BNX2_RPM_RC_VALUE_MASK_1 0x0000190c
2051#define BNX2_RPM_RC_CNTL_2 0x00001910
2052#define BNX2_RPM_RC_CNTL_2_A (0x3ffffL<<0)
2053#define BNX2_RPM_RC_CNTL_2_B (0xfffL<<19)
2054
2055#define BNX2_RPM_RC_VALUE_MASK_2 0x00001914
2056#define BNX2_RPM_RC_CNTL_3 0x00001918
2057#define BNX2_RPM_RC_CNTL_3_A (0x3ffffL<<0)
2058#define BNX2_RPM_RC_CNTL_3_B (0xfffL<<19)
2059
2060#define BNX2_RPM_RC_VALUE_MASK_3 0x0000191c
2061#define BNX2_RPM_RC_CNTL_4 0x00001920
2062#define BNX2_RPM_RC_CNTL_4_A (0x3ffffL<<0)
2063#define BNX2_RPM_RC_CNTL_4_B (0xfffL<<19)
2064
2065#define BNX2_RPM_RC_VALUE_MASK_4 0x00001924
2066#define BNX2_RPM_RC_CNTL_5 0x00001928
2067#define BNX2_RPM_RC_CNTL_5_A (0x3ffffL<<0)
2068#define BNX2_RPM_RC_CNTL_5_B (0xfffL<<19)
2069
2070#define BNX2_RPM_RC_VALUE_MASK_5 0x0000192c
2071#define BNX2_RPM_RC_CNTL_6 0x00001930
2072#define BNX2_RPM_RC_CNTL_6_A (0x3ffffL<<0)
2073#define BNX2_RPM_RC_CNTL_6_B (0xfffL<<19)
2074
2075#define BNX2_RPM_RC_VALUE_MASK_6 0x00001934
2076#define BNX2_RPM_RC_CNTL_7 0x00001938
2077#define BNX2_RPM_RC_CNTL_7_A (0x3ffffL<<0)
2078#define BNX2_RPM_RC_CNTL_7_B (0xfffL<<19)
2079
2080#define BNX2_RPM_RC_VALUE_MASK_7 0x0000193c
2081#define BNX2_RPM_RC_CNTL_8 0x00001940
2082#define BNX2_RPM_RC_CNTL_8_A (0x3ffffL<<0)
2083#define BNX2_RPM_RC_CNTL_8_B (0xfffL<<19)
2084
2085#define BNX2_RPM_RC_VALUE_MASK_8 0x00001944
2086#define BNX2_RPM_RC_CNTL_9 0x00001948
2087#define BNX2_RPM_RC_CNTL_9_A (0x3ffffL<<0)
2088#define BNX2_RPM_RC_CNTL_9_B (0xfffL<<19)
2089
2090#define BNX2_RPM_RC_VALUE_MASK_9 0x0000194c
2091#define BNX2_RPM_RC_CNTL_10 0x00001950
2092#define BNX2_RPM_RC_CNTL_10_A (0x3ffffL<<0)
2093#define BNX2_RPM_RC_CNTL_10_B (0xfffL<<19)
2094
2095#define BNX2_RPM_RC_VALUE_MASK_10 0x00001954
2096#define BNX2_RPM_RC_CNTL_11 0x00001958
2097#define BNX2_RPM_RC_CNTL_11_A (0x3ffffL<<0)
2098#define BNX2_RPM_RC_CNTL_11_B (0xfffL<<19)
2099
2100#define BNX2_RPM_RC_VALUE_MASK_11 0x0000195c
2101#define BNX2_RPM_RC_CNTL_12 0x00001960
2102#define BNX2_RPM_RC_CNTL_12_A (0x3ffffL<<0)
2103#define BNX2_RPM_RC_CNTL_12_B (0xfffL<<19)
2104
2105#define BNX2_RPM_RC_VALUE_MASK_12 0x00001964
2106#define BNX2_RPM_RC_CNTL_13 0x00001968
2107#define BNX2_RPM_RC_CNTL_13_A (0x3ffffL<<0)
2108#define BNX2_RPM_RC_CNTL_13_B (0xfffL<<19)
2109
2110#define BNX2_RPM_RC_VALUE_MASK_13 0x0000196c
2111#define BNX2_RPM_RC_CNTL_14 0x00001970
2112#define BNX2_RPM_RC_CNTL_14_A (0x3ffffL<<0)
2113#define BNX2_RPM_RC_CNTL_14_B (0xfffL<<19)
2114
2115#define BNX2_RPM_RC_VALUE_MASK_14 0x00001974
2116#define BNX2_RPM_RC_CNTL_15 0x00001978
2117#define BNX2_RPM_RC_CNTL_15_A (0x3ffffL<<0)
2118#define BNX2_RPM_RC_CNTL_15_B (0xfffL<<19)
2119
2120#define BNX2_RPM_RC_VALUE_MASK_15 0x0000197c
2121#define BNX2_RPM_RC_CONFIG 0x00001980
2122#define BNX2_RPM_RC_CONFIG_RULE_ENABLE (0xffffL<<0)
2123#define BNX2_RPM_RC_CONFIG_DEF_CLASS (0x7L<<24)
2124
2125#define BNX2_RPM_DEBUG0 0x00001984
2126#define BNX2_RPM_DEBUG0_FM_BCNT (0xffffL<<0)
2127#define BNX2_RPM_DEBUG0_T_DATA_OFST_VLD (1L<<16)
2128#define BNX2_RPM_DEBUG0_T_UDP_OFST_VLD (1L<<17)
2129#define BNX2_RPM_DEBUG0_T_TCP_OFST_VLD (1L<<18)
2130#define BNX2_RPM_DEBUG0_T_IP_OFST_VLD (1L<<19)
2131#define BNX2_RPM_DEBUG0_IP_MORE_FRGMT (1L<<20)
2132#define BNX2_RPM_DEBUG0_T_IP_NO_TCP_UDP_HDR (1L<<21)
2133#define BNX2_RPM_DEBUG0_LLC_SNAP (1L<<22)
2134#define BNX2_RPM_DEBUG0_FM_STARTED (1L<<23)
2135#define BNX2_RPM_DEBUG0_DONE (1L<<24)
2136#define BNX2_RPM_DEBUG0_WAIT_4_DONE (1L<<25)
2137#define BNX2_RPM_DEBUG0_USE_TPBUF_CKSUM (1L<<26)
2138#define BNX2_RPM_DEBUG0_RX_NO_PSD_HDR_CKSUM (1L<<27)
2139#define BNX2_RPM_DEBUG0_IGNORE_VLAN (1L<<28)
2140#define BNX2_RPM_DEBUG0_RP_ENA_ACTIVE (1L<<31)
2141
2142#define BNX2_RPM_DEBUG1 0x00001988
2143#define BNX2_RPM_DEBUG1_FSM_CUR_ST (0xffffL<<0)
2144#define BNX2_RPM_DEBUG1_FSM_CUR_ST_IDLE (0L<<0)
2145#define BNX2_RPM_DEBUG1_FSM_CUR_ST_ETYPE_B6_ALL (1L<<0)
2146#define BNX2_RPM_DEBUG1_FSM_CUR_ST_ETYPE_B2_IPLLC (2L<<0)
2147#define BNX2_RPM_DEBUG1_FSM_CUR_ST_ETYPE_B6_IP (4L<<0)
2148#define BNX2_RPM_DEBUG1_FSM_CUR_ST_ETYPE_B2_IP (8L<<0)
2149#define BNX2_RPM_DEBUG1_FSM_CUR_ST_IP_START (16L<<0)
2150#define BNX2_RPM_DEBUG1_FSM_CUR_ST_IP (32L<<0)
2151#define BNX2_RPM_DEBUG1_FSM_CUR_ST_TCP (64L<<0)
2152#define BNX2_RPM_DEBUG1_FSM_CUR_ST_UDP (128L<<0)
2153#define BNX2_RPM_DEBUG1_FSM_CUR_ST_AH (256L<<0)
2154#define BNX2_RPM_DEBUG1_FSM_CUR_ST_ESP (512L<<0)
2155#define BNX2_RPM_DEBUG1_FSM_CUR_ST_ESP_PAYLOAD (1024L<<0)
2156#define BNX2_RPM_DEBUG1_FSM_CUR_ST_DATA (2048L<<0)
2157#define BNX2_RPM_DEBUG1_FSM_CUR_ST_ADD_CARRY (0x2000L<<0)
2158#define BNX2_RPM_DEBUG1_FSM_CUR_ST_ADD_CARRYOUT (0x4000L<<0)
2159#define BNX2_RPM_DEBUG1_FSM_CUR_ST_LATCH_RESULT (0x8000L<<0)
2160#define BNX2_RPM_DEBUG1_HDR_BCNT (0x7ffL<<16)
2161#define BNX2_RPM_DEBUG1_UNKNOWN_ETYPE_D (1L<<28)
2162#define BNX2_RPM_DEBUG1_VLAN_REMOVED_D2 (1L<<29)
2163#define BNX2_RPM_DEBUG1_VLAN_REMOVED_D1 (1L<<30)
2164#define BNX2_RPM_DEBUG1_EOF_0XTRA_WD (1L<<31)
2165
2166#define BNX2_RPM_DEBUG2 0x0000198c
2167#define BNX2_RPM_DEBUG2_CMD_HIT_VEC (0xffffL<<0)
2168#define BNX2_RPM_DEBUG2_IP_BCNT (0xffL<<16)
2169#define BNX2_RPM_DEBUG2_THIS_CMD_M4 (1L<<24)
2170#define BNX2_RPM_DEBUG2_THIS_CMD_M3 (1L<<25)
2171#define BNX2_RPM_DEBUG2_THIS_CMD_M2 (1L<<26)
2172#define BNX2_RPM_DEBUG2_THIS_CMD_M1 (1L<<27)
2173#define BNX2_RPM_DEBUG2_IPIPE_EMPTY (1L<<28)
2174#define BNX2_RPM_DEBUG2_FM_DISCARD (1L<<29)
2175#define BNX2_RPM_DEBUG2_LAST_RULE_IN_FM_D2 (1L<<30)
2176#define BNX2_RPM_DEBUG2_LAST_RULE_IN_FM_D1 (1L<<31)
2177
2178#define BNX2_RPM_DEBUG3 0x00001990
2179#define BNX2_RPM_DEBUG3_AVAIL_MBUF_PTR (0x1ffL<<0)
2180#define BNX2_RPM_DEBUG3_RDE_RLUPQ_WR_REQ_INT (1L<<9)
2181#define BNX2_RPM_DEBUG3_RDE_RBUF_WR_LAST_INT (1L<<10)
2182#define BNX2_RPM_DEBUG3_RDE_RBUF_WR_REQ_INT (1L<<11)
2183#define BNX2_RPM_DEBUG3_RDE_RBUF_FREE_REQ (1L<<12)
2184#define BNX2_RPM_DEBUG3_RDE_RBUF_ALLOC_REQ (1L<<13)
2185#define BNX2_RPM_DEBUG3_DFSM_MBUF_NOTAVAIL (1L<<14)
2186#define BNX2_RPM_DEBUG3_RBUF_RDE_SOF_DROP (1L<<15)
2187#define BNX2_RPM_DEBUG3_DFIFO_VLD_ENTRY_CT (0xfL<<16)
2188#define BNX2_RPM_DEBUG3_RDE_SRC_FIFO_ALMFULL (1L<<21)
2189#define BNX2_RPM_DEBUG3_DROP_NXT_VLD (1L<<22)
2190#define BNX2_RPM_DEBUG3_DROP_NXT (1L<<23)
2191#define BNX2_RPM_DEBUG3_FTQ_FSM (0x3L<<24)
2192#define BNX2_RPM_DEBUG3_FTQ_FSM_IDLE (0x0L<<24)
2193#define BNX2_RPM_DEBUG3_FTQ_FSM_WAIT_ACK (0x1L<<24)
2194#define BNX2_RPM_DEBUG3_FTQ_FSM_WAIT_FREE (0x2L<<24)
2195#define BNX2_RPM_DEBUG3_MBWRITE_FSM (0x3L<<26)
2196#define BNX2_RPM_DEBUG3_MBWRITE_FSM_WAIT_SOF (0x0L<<26)
2197#define BNX2_RPM_DEBUG3_MBWRITE_FSM_GET_MBUF (0x1L<<26)
2198#define BNX2_RPM_DEBUG3_MBWRITE_FSM_DMA_DATA (0x2L<<26)
2199#define BNX2_RPM_DEBUG3_MBWRITE_FSM_WAIT_DATA (0x3L<<26)
2200#define BNX2_RPM_DEBUG3_MBWRITE_FSM_WAIT_EOF (0x4L<<26)
2201#define BNX2_RPM_DEBUG3_MBWRITE_FSM_WAIT_MF_ACK (0x5L<<26)
2202#define BNX2_RPM_DEBUG3_MBWRITE_FSM_WAIT_DROP_NXT_VLD (0x6L<<26)
2203#define BNX2_RPM_DEBUG3_MBWRITE_FSM_DONE (0x7L<<26)
2204#define BNX2_RPM_DEBUG3_MBFREE_FSM (1L<<29)
2205#define BNX2_RPM_DEBUG3_MBFREE_FSM_IDLE (0L<<29)
2206#define BNX2_RPM_DEBUG3_MBFREE_FSM_WAIT_ACK (1L<<29)
2207#define BNX2_RPM_DEBUG3_MBALLOC_FSM (1L<<30)
2208#define BNX2_RPM_DEBUG3_MBALLOC_FSM_ET_MBUF (0x0L<<30)
2209#define BNX2_RPM_DEBUG3_MBALLOC_FSM_IVE_MBUF (0x1L<<30)
2210#define BNX2_RPM_DEBUG3_CCODE_EOF_ERROR (1L<<31)
2211
2212#define BNX2_RPM_DEBUG4 0x00001994
2213#define BNX2_RPM_DEBUG4_DFSM_MBUF_CLUSTER (0x1ffffffL<<0)
2214#define BNX2_RPM_DEBUG4_DFIFO_CUR_CCODE (0x7L<<25)
2215#define BNX2_RPM_DEBUG4_MBWRITE_FSM (0x7L<<28)
2216#define BNX2_RPM_DEBUG4_DFIFO_EMPTY (1L<<31)
2217
2218#define BNX2_RPM_DEBUG5 0x00001998
2219#define BNX2_RPM_DEBUG5_RDROP_WPTR (0x1fL<<0)
2220#define BNX2_RPM_DEBUG5_RDROP_ACPI_RPTR (0x1fL<<5)
2221#define BNX2_RPM_DEBUG5_RDROP_MC_RPTR (0x1fL<<10)
2222#define BNX2_RPM_DEBUG5_RDROP_RC_RPTR (0x1fL<<15)
2223#define BNX2_RPM_DEBUG5_RDROP_ACPI_EMPTY (1L<<20)
2224#define BNX2_RPM_DEBUG5_RDROP_MC_EMPTY (1L<<21)
2225#define BNX2_RPM_DEBUG5_RDROP_AEOF_VEC_AT_RDROP_MC_RPTR (1L<<22)
2226#define BNX2_RPM_DEBUG5_HOLDREG_WOL_DROP_INT (1L<<23)
2227#define BNX2_RPM_DEBUG5_HOLDREG_DISCARD (1L<<24)
2228#define BNX2_RPM_DEBUG5_HOLDREG_MBUF_NOTAVAIL (1L<<25)
2229#define BNX2_RPM_DEBUG5_HOLDREG_MC_EMPTY (1L<<26)
2230#define BNX2_RPM_DEBUG5_HOLDREG_RC_EMPTY (1L<<27)
2231#define BNX2_RPM_DEBUG5_HOLDREG_FC_EMPTY (1L<<28)
2232#define BNX2_RPM_DEBUG5_HOLDREG_ACPI_EMPTY (1L<<29)
2233#define BNX2_RPM_DEBUG5_HOLDREG_FULL_T (1L<<30)
2234#define BNX2_RPM_DEBUG5_HOLDREG_RD (1L<<31)
2235
2236#define BNX2_RPM_DEBUG6 0x0000199c
2237#define BNX2_RPM_DEBUG6_ACPI_VEC (0xffffL<<0)
2238#define BNX2_RPM_DEBUG6_VEC (0xffffL<<16)
2239
2240#define BNX2_RPM_DEBUG7 0x000019a0
2241#define BNX2_RPM_DEBUG7_RPM_DBG7_LAST_CRC (0xffffffffL<<0)
2242
2243#define BNX2_RPM_DEBUG8 0x000019a4
2244#define BNX2_RPM_DEBUG8_PS_ACPI_FSM (0xfL<<0)
2245#define BNX2_RPM_DEBUG8_PS_ACPI_FSM_IDLE (0L<<0)
2246#define BNX2_RPM_DEBUG8_PS_ACPI_FSM_SOF_W1_ADDR (1L<<0)
2247#define BNX2_RPM_DEBUG8_PS_ACPI_FSM_SOF_W2_ADDR (2L<<0)
2248#define BNX2_RPM_DEBUG8_PS_ACPI_FSM_SOF_W3_ADDR (3L<<0)
2249#define BNX2_RPM_DEBUG8_PS_ACPI_FSM_SOF_WAIT_THBUF (4L<<0)
2250#define BNX2_RPM_DEBUG8_PS_ACPI_FSM_W3_DATA (5L<<0)
2251#define BNX2_RPM_DEBUG8_PS_ACPI_FSM_W0_ADDR (6L<<0)
2252#define BNX2_RPM_DEBUG8_PS_ACPI_FSM_W1_ADDR (7L<<0)
2253#define BNX2_RPM_DEBUG8_PS_ACPI_FSM_W2_ADDR (8L<<0)
2254#define BNX2_RPM_DEBUG8_PS_ACPI_FSM_W3_ADDR (9L<<0)
2255#define BNX2_RPM_DEBUG8_PS_ACPI_FSM_WAIT_THBUF (10L<<0)
2256#define BNX2_RPM_DEBUG8_COMPARE_AT_W0 (1L<<4)
2257#define BNX2_RPM_DEBUG8_COMPARE_AT_W3_DATA (1L<<5)
2258#define BNX2_RPM_DEBUG8_COMPARE_AT_SOF_WAIT (1L<<6)
2259#define BNX2_RPM_DEBUG8_COMPARE_AT_SOF_W3 (1L<<7)
2260#define BNX2_RPM_DEBUG8_COMPARE_AT_SOF_W2 (1L<<8)
2261#define BNX2_RPM_DEBUG8_EOF_W_LTEQ6_VLDBYTES (1L<<9)
2262#define BNX2_RPM_DEBUG8_EOF_W_LTEQ4_VLDBYTES (1L<<10)
2263#define BNX2_RPM_DEBUG8_NXT_EOF_W_12_VLDBYTES (1L<<11)
2264#define BNX2_RPM_DEBUG8_EOF_DET (1L<<12)
2265#define BNX2_RPM_DEBUG8_SOF_DET (1L<<13)
2266#define BNX2_RPM_DEBUG8_WAIT_4_SOF (1L<<14)
2267#define BNX2_RPM_DEBUG8_ALL_DONE (1L<<15)
2268#define BNX2_RPM_DEBUG8_THBUF_ADDR (0x7fL<<16)
2269#define BNX2_RPM_DEBUG8_BYTE_CTR (0xffL<<24)
2270
2271#define BNX2_RPM_DEBUG9 0x000019a8
2272#define BNX2_RPM_DEBUG9_OUTFIFO_COUNT (0x7L<<0)
2273#define BNX2_RPM_DEBUG9_RDE_ACPI_RDY (1L<<3)
2274#define BNX2_RPM_DEBUG9_VLD_RD_ENTRY_CT (0x7L<<4)
2275#define BNX2_RPM_DEBUG9_OUTFIFO_OVERRUN_OCCURRED (1L<<28)
2276#define BNX2_RPM_DEBUG9_INFIFO_OVERRUN_OCCURRED (1L<<29)
2277#define BNX2_RPM_DEBUG9_ACPI_MATCH_INT (1L<<30)
2278#define BNX2_RPM_DEBUG9_ACPI_ENABLE_SYN (1L<<31)
2279
2280#define BNX2_RPM_ACPI_DBG_BUF_W00 0x000019c0
2281#define BNX2_RPM_ACPI_DBG_BUF_W01 0x000019c4
2282#define BNX2_RPM_ACPI_DBG_BUF_W02 0x000019c8
2283#define BNX2_RPM_ACPI_DBG_BUF_W03 0x000019cc
2284#define BNX2_RPM_ACPI_DBG_BUF_W10 0x000019d0
2285#define BNX2_RPM_ACPI_DBG_BUF_W11 0x000019d4
2286#define BNX2_RPM_ACPI_DBG_BUF_W12 0x000019d8
2287#define BNX2_RPM_ACPI_DBG_BUF_W13 0x000019dc
2288#define BNX2_RPM_ACPI_DBG_BUF_W20 0x000019e0
2289#define BNX2_RPM_ACPI_DBG_BUF_W21 0x000019e4
2290#define BNX2_RPM_ACPI_DBG_BUF_W22 0x000019e8
2291#define BNX2_RPM_ACPI_DBG_BUF_W23 0x000019ec
2292#define BNX2_RPM_ACPI_DBG_BUF_W30 0x000019f0
2293#define BNX2_RPM_ACPI_DBG_BUF_W31 0x000019f4
2294#define BNX2_RPM_ACPI_DBG_BUF_W32 0x000019f8
2295#define BNX2_RPM_ACPI_DBG_BUF_W33 0x000019fc
2296
2297
2298/*
2299 * rbuf_reg definition
2300 * offset: 0x200000
2301 */
2302#define BNX2_RBUF_COMMAND 0x00200000
2303#define BNX2_RBUF_COMMAND_ENABLED (1L<<0)
2304#define BNX2_RBUF_COMMAND_FREE_INIT (1L<<1)
2305#define BNX2_RBUF_COMMAND_RAM_INIT (1L<<2)
2306#define BNX2_RBUF_COMMAND_OVER_FREE (1L<<4)
2307#define BNX2_RBUF_COMMAND_ALLOC_REQ (1L<<5)
2308
2309#define BNX2_RBUF_STATUS1 0x00200004
2310#define BNX2_RBUF_STATUS1_FREE_COUNT (0x3ffL<<0)
2311
2312#define BNX2_RBUF_STATUS2 0x00200008
2313#define BNX2_RBUF_STATUS2_FREE_TAIL (0x3ffL<<0)
2314#define BNX2_RBUF_STATUS2_FREE_HEAD (0x3ffL<<16)
2315
2316#define BNX2_RBUF_CONFIG 0x0020000c
2317#define BNX2_RBUF_CONFIG_XOFF_TRIP (0x3ffL<<0)
2318#define BNX2_RBUF_CONFIG_XON_TRIP (0x3ffL<<16)
2319
2320#define BNX2_RBUF_FW_BUF_ALLOC 0x00200010
2321#define BNX2_RBUF_FW_BUF_ALLOC_VALUE (0x1ffL<<7)
2322
2323#define BNX2_RBUF_FW_BUF_FREE 0x00200014
2324#define BNX2_RBUF_FW_BUF_FREE_COUNT (0x7fL<<0)
2325#define BNX2_RBUF_FW_BUF_FREE_TAIL (0x1ffL<<7)
2326#define BNX2_RBUF_FW_BUF_FREE_HEAD (0x1ffL<<16)
2327
2328#define BNX2_RBUF_FW_BUF_SEL 0x00200018
2329#define BNX2_RBUF_FW_BUF_SEL_COUNT (0x7fL<<0)
2330#define BNX2_RBUF_FW_BUF_SEL_TAIL (0x1ffL<<7)
2331#define BNX2_RBUF_FW_BUF_SEL_HEAD (0x1ffL<<16)
2332
2333#define BNX2_RBUF_CONFIG2 0x0020001c
2334#define BNX2_RBUF_CONFIG2_MAC_DROP_TRIP (0x3ffL<<0)
2335#define BNX2_RBUF_CONFIG2_MAC_KEEP_TRIP (0x3ffL<<16)
2336
2337#define BNX2_RBUF_CONFIG3 0x00200020
2338#define BNX2_RBUF_CONFIG3_CU_DROP_TRIP (0x3ffL<<0)
2339#define BNX2_RBUF_CONFIG3_CU_KEEP_TRIP (0x3ffL<<16)
2340
2341#define BNX2_RBUF_PKT_DATA 0x00208000
2342#define BNX2_RBUF_CLIST_DATA 0x00210000
2343#define BNX2_RBUF_BUF_DATA 0x00220000
2344
2345
2346/*
2347 * rv2p_reg definition
2348 * offset: 0x2800
2349 */
2350#define BNX2_RV2P_COMMAND 0x00002800
2351#define BNX2_RV2P_COMMAND_ENABLED (1L<<0)
2352#define BNX2_RV2P_COMMAND_PROC1_INTRPT (1L<<1)
2353#define BNX2_RV2P_COMMAND_PROC2_INTRPT (1L<<2)
2354#define BNX2_RV2P_COMMAND_ABORT0 (1L<<4)
2355#define BNX2_RV2P_COMMAND_ABORT1 (1L<<5)
2356#define BNX2_RV2P_COMMAND_ABORT2 (1L<<6)
2357#define BNX2_RV2P_COMMAND_ABORT3 (1L<<7)
2358#define BNX2_RV2P_COMMAND_ABORT4 (1L<<8)
2359#define BNX2_RV2P_COMMAND_ABORT5 (1L<<9)
2360#define BNX2_RV2P_COMMAND_PROC1_RESET (1L<<16)
2361#define BNX2_RV2P_COMMAND_PROC2_RESET (1L<<17)
2362#define BNX2_RV2P_COMMAND_CTXIF_RESET (1L<<18)
2363
2364#define BNX2_RV2P_STATUS 0x00002804
2365#define BNX2_RV2P_STATUS_ALWAYS_0 (1L<<0)
2366#define BNX2_RV2P_STATUS_RV2P_GEN_STAT0_CNT (1L<<8)
2367#define BNX2_RV2P_STATUS_RV2P_GEN_STAT1_CNT (1L<<9)
2368#define BNX2_RV2P_STATUS_RV2P_GEN_STAT2_CNT (1L<<10)
2369#define BNX2_RV2P_STATUS_RV2P_GEN_STAT3_CNT (1L<<11)
2370#define BNX2_RV2P_STATUS_RV2P_GEN_STAT4_CNT (1L<<12)
2371#define BNX2_RV2P_STATUS_RV2P_GEN_STAT5_CNT (1L<<13)
2372
2373#define BNX2_RV2P_CONFIG 0x00002808
2374#define BNX2_RV2P_CONFIG_STALL_PROC1 (1L<<0)
2375#define BNX2_RV2P_CONFIG_STALL_PROC2 (1L<<1)
2376#define BNX2_RV2P_CONFIG_PROC1_STALL_ON_ABORT0 (1L<<8)
2377#define BNX2_RV2P_CONFIG_PROC1_STALL_ON_ABORT1 (1L<<9)
2378#define BNX2_RV2P_CONFIG_PROC1_STALL_ON_ABORT2 (1L<<10)
2379#define BNX2_RV2P_CONFIG_PROC1_STALL_ON_ABORT3 (1L<<11)
2380#define BNX2_RV2P_CONFIG_PROC1_STALL_ON_ABORT4 (1L<<12)
2381#define BNX2_RV2P_CONFIG_PROC1_STALL_ON_ABORT5 (1L<<13)
2382#define BNX2_RV2P_CONFIG_PROC2_STALL_ON_ABORT0 (1L<<16)
2383#define BNX2_RV2P_CONFIG_PROC2_STALL_ON_ABORT1 (1L<<17)
2384#define BNX2_RV2P_CONFIG_PROC2_STALL_ON_ABORT2 (1L<<18)
2385#define BNX2_RV2P_CONFIG_PROC2_STALL_ON_ABORT3 (1L<<19)
2386#define BNX2_RV2P_CONFIG_PROC2_STALL_ON_ABORT4 (1L<<20)
2387#define BNX2_RV2P_CONFIG_PROC2_STALL_ON_ABORT5 (1L<<21)
2388#define BNX2_RV2P_CONFIG_PAGE_SIZE (0xfL<<24)
2389#define BNX2_RV2P_CONFIG_PAGE_SIZE_256 (0L<<24)
2390#define BNX2_RV2P_CONFIG_PAGE_SIZE_512 (1L<<24)
2391#define BNX2_RV2P_CONFIG_PAGE_SIZE_1K (2L<<24)
2392#define BNX2_RV2P_CONFIG_PAGE_SIZE_2K (3L<<24)
2393#define BNX2_RV2P_CONFIG_PAGE_SIZE_4K (4L<<24)
2394#define BNX2_RV2P_CONFIG_PAGE_SIZE_8K (5L<<24)
2395#define BNX2_RV2P_CONFIG_PAGE_SIZE_16K (6L<<24)
2396#define BNX2_RV2P_CONFIG_PAGE_SIZE_32K (7L<<24)
2397#define BNX2_RV2P_CONFIG_PAGE_SIZE_64K (8L<<24)
2398#define BNX2_RV2P_CONFIG_PAGE_SIZE_128K (9L<<24)
2399#define BNX2_RV2P_CONFIG_PAGE_SIZE_256K (10L<<24)
2400#define BNX2_RV2P_CONFIG_PAGE_SIZE_512K (11L<<24)
2401#define BNX2_RV2P_CONFIG_PAGE_SIZE_1M (12L<<24)
2402
2403#define BNX2_RV2P_GEN_BFR_ADDR_0 0x00002810
2404#define BNX2_RV2P_GEN_BFR_ADDR_0_VALUE (0xffffL<<16)
2405
2406#define BNX2_RV2P_GEN_BFR_ADDR_1 0x00002814
2407#define BNX2_RV2P_GEN_BFR_ADDR_1_VALUE (0xffffL<<16)
2408
2409#define BNX2_RV2P_GEN_BFR_ADDR_2 0x00002818
2410#define BNX2_RV2P_GEN_BFR_ADDR_2_VALUE (0xffffL<<16)
2411
2412#define BNX2_RV2P_GEN_BFR_ADDR_3 0x0000281c
2413#define BNX2_RV2P_GEN_BFR_ADDR_3_VALUE (0xffffL<<16)
2414
2415#define BNX2_RV2P_INSTR_HIGH 0x00002830
2416#define BNX2_RV2P_INSTR_HIGH_HIGH (0x1fL<<0)
2417
2418#define BNX2_RV2P_INSTR_LOW 0x00002834
2419#define BNX2_RV2P_PROC1_ADDR_CMD 0x00002838
2420#define BNX2_RV2P_PROC1_ADDR_CMD_ADD (0x3ffL<<0)
2421#define BNX2_RV2P_PROC1_ADDR_CMD_RDWR (1L<<31)
2422
2423#define BNX2_RV2P_PROC2_ADDR_CMD 0x0000283c
2424#define BNX2_RV2P_PROC2_ADDR_CMD_ADD (0x3ffL<<0)
2425#define BNX2_RV2P_PROC2_ADDR_CMD_RDWR (1L<<31)
2426
2427#define BNX2_RV2P_PROC1_GRC_DEBUG 0x00002840
2428#define BNX2_RV2P_PROC2_GRC_DEBUG 0x00002844
2429#define BNX2_RV2P_GRC_PROC_DEBUG 0x00002848
2430#define BNX2_RV2P_DEBUG_VECT_PEEK 0x0000284c
2431#define BNX2_RV2P_DEBUG_VECT_PEEK_1_VALUE (0x7ffL<<0)
2432#define BNX2_RV2P_DEBUG_VECT_PEEK_1_PEEK_EN (1L<<11)
2433#define BNX2_RV2P_DEBUG_VECT_PEEK_1_SEL (0xfL<<12)
2434#define BNX2_RV2P_DEBUG_VECT_PEEK_2_VALUE (0x7ffL<<16)
2435#define BNX2_RV2P_DEBUG_VECT_PEEK_2_PEEK_EN (1L<<27)
2436#define BNX2_RV2P_DEBUG_VECT_PEEK_2_SEL (0xfL<<28)
2437
2438#define BNX2_RV2P_PFTQ_DATA 0x00002b40
2439#define BNX2_RV2P_PFTQ_CMD 0x00002b78
2440#define BNX2_RV2P_PFTQ_CMD_OFFSET (0x3ffL<<0)
2441#define BNX2_RV2P_PFTQ_CMD_WR_TOP (1L<<10)
2442#define BNX2_RV2P_PFTQ_CMD_WR_TOP_0 (0L<<10)
2443#define BNX2_RV2P_PFTQ_CMD_WR_TOP_1 (1L<<10)
2444#define BNX2_RV2P_PFTQ_CMD_SFT_RESET (1L<<25)
2445#define BNX2_RV2P_PFTQ_CMD_RD_DATA (1L<<26)
2446#define BNX2_RV2P_PFTQ_CMD_ADD_INTERVEN (1L<<27)
2447#define BNX2_RV2P_PFTQ_CMD_ADD_DATA (1L<<28)
2448#define BNX2_RV2P_PFTQ_CMD_INTERVENE_CLR (1L<<29)
2449#define BNX2_RV2P_PFTQ_CMD_POP (1L<<30)
2450#define BNX2_RV2P_PFTQ_CMD_BUSY (1L<<31)
2451
2452#define BNX2_RV2P_PFTQ_CTL 0x00002b7c
2453#define BNX2_RV2P_PFTQ_CTL_INTERVENE (1L<<0)
2454#define BNX2_RV2P_PFTQ_CTL_OVERFLOW (1L<<1)
2455#define BNX2_RV2P_PFTQ_CTL_FORCE_INTERVENE (1L<<2)
2456#define BNX2_RV2P_PFTQ_CTL_MAX_DEPTH (0x3ffL<<12)
2457#define BNX2_RV2P_PFTQ_CTL_CUR_DEPTH (0x3ffL<<22)
2458
2459#define BNX2_RV2P_TFTQ_DATA 0x00002b80
2460#define BNX2_RV2P_TFTQ_CMD 0x00002bb8
2461#define BNX2_RV2P_TFTQ_CMD_OFFSET (0x3ffL<<0)
2462#define BNX2_RV2P_TFTQ_CMD_WR_TOP (1L<<10)
2463#define BNX2_RV2P_TFTQ_CMD_WR_TOP_0 (0L<<10)
2464#define BNX2_RV2P_TFTQ_CMD_WR_TOP_1 (1L<<10)
2465#define BNX2_RV2P_TFTQ_CMD_SFT_RESET (1L<<25)
2466#define BNX2_RV2P_TFTQ_CMD_RD_DATA (1L<<26)
2467#define BNX2_RV2P_TFTQ_CMD_ADD_INTERVEN (1L<<27)
2468#define BNX2_RV2P_TFTQ_CMD_ADD_DATA (1L<<28)
2469#define BNX2_RV2P_TFTQ_CMD_INTERVENE_CLR (1L<<29)
2470#define BNX2_RV2P_TFTQ_CMD_POP (1L<<30)
2471#define BNX2_RV2P_TFTQ_CMD_BUSY (1L<<31)
2472
2473#define BNX2_RV2P_TFTQ_CTL 0x00002bbc
2474#define BNX2_RV2P_TFTQ_CTL_INTERVENE (1L<<0)
2475#define BNX2_RV2P_TFTQ_CTL_OVERFLOW (1L<<1)
2476#define BNX2_RV2P_TFTQ_CTL_FORCE_INTERVENE (1L<<2)
2477#define BNX2_RV2P_TFTQ_CTL_MAX_DEPTH (0x3ffL<<12)
2478#define BNX2_RV2P_TFTQ_CTL_CUR_DEPTH (0x3ffL<<22)
2479
2480#define BNX2_RV2P_MFTQ_DATA 0x00002bc0
2481#define BNX2_RV2P_MFTQ_CMD 0x00002bf8
2482#define BNX2_RV2P_MFTQ_CMD_OFFSET (0x3ffL<<0)
2483#define BNX2_RV2P_MFTQ_CMD_WR_TOP (1L<<10)
2484#define BNX2_RV2P_MFTQ_CMD_WR_TOP_0 (0L<<10)
2485#define BNX2_RV2P_MFTQ_CMD_WR_TOP_1 (1L<<10)
2486#define BNX2_RV2P_MFTQ_CMD_SFT_RESET (1L<<25)
2487#define BNX2_RV2P_MFTQ_CMD_RD_DATA (1L<<26)
2488#define BNX2_RV2P_MFTQ_CMD_ADD_INTERVEN (1L<<27)
2489#define BNX2_RV2P_MFTQ_CMD_ADD_DATA (1L<<28)
2490#define BNX2_RV2P_MFTQ_CMD_INTERVENE_CLR (1L<<29)
2491#define BNX2_RV2P_MFTQ_CMD_POP (1L<<30)
2492#define BNX2_RV2P_MFTQ_CMD_BUSY (1L<<31)
2493
2494#define BNX2_RV2P_MFTQ_CTL 0x00002bfc
2495#define BNX2_RV2P_MFTQ_CTL_INTERVENE (1L<<0)
2496#define BNX2_RV2P_MFTQ_CTL_OVERFLOW (1L<<1)
2497#define BNX2_RV2P_MFTQ_CTL_FORCE_INTERVENE (1L<<2)
2498#define BNX2_RV2P_MFTQ_CTL_MAX_DEPTH (0x3ffL<<12)
2499#define BNX2_RV2P_MFTQ_CTL_CUR_DEPTH (0x3ffL<<22)
2500
2501
2502
2503/*
2504 * mq_reg definition
2505 * offset: 0x3c00
2506 */
2507#define BNX2_MQ_COMMAND 0x00003c00
2508#define BNX2_MQ_COMMAND_ENABLED (1L<<0)
2509#define BNX2_MQ_COMMAND_OVERFLOW (1L<<4)
2510#define BNX2_MQ_COMMAND_WR_ERROR (1L<<5)
2511#define BNX2_MQ_COMMAND_RD_ERROR (1L<<6)
2512
2513#define BNX2_MQ_STATUS 0x00003c04
2514#define BNX2_MQ_STATUS_CTX_ACCESS_STAT (1L<<16)
2515#define BNX2_MQ_STATUS_CTX_ACCESS64_STAT (1L<<17)
2516#define BNX2_MQ_STATUS_PCI_STALL_STAT (1L<<18)
2517
2518#define BNX2_MQ_CONFIG 0x00003c08
2519#define BNX2_MQ_CONFIG_TX_HIGH_PRI (1L<<0)
2520#define BNX2_MQ_CONFIG_HALT_DIS (1L<<1)
2521#define BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE (0x7L<<4)
2522#define BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE_256 (0L<<4)
2523#define BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE_512 (1L<<4)
2524#define BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE_1K (2L<<4)
2525#define BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE_2K (3L<<4)
2526#define BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE_4K (4L<<4)
2527#define BNX2_MQ_CONFIG_MAX_DEPTH (0x7fL<<8)
2528#define BNX2_MQ_CONFIG_CUR_DEPTH (0x7fL<<20)
2529
2530#define BNX2_MQ_ENQUEUE1 0x00003c0c
2531#define BNX2_MQ_ENQUEUE1_OFFSET (0x3fL<<2)
2532#define BNX2_MQ_ENQUEUE1_CID (0x3fffL<<8)
2533#define BNX2_MQ_ENQUEUE1_BYTE_MASK (0xfL<<24)
2534#define BNX2_MQ_ENQUEUE1_KNL_MODE (1L<<28)
2535
2536#define BNX2_MQ_ENQUEUE2 0x00003c10
2537#define BNX2_MQ_BAD_WR_ADDR 0x00003c14
2538#define BNX2_MQ_BAD_RD_ADDR 0x00003c18
2539#define BNX2_MQ_KNL_BYP_WIND_START 0x00003c1c
2540#define BNX2_MQ_KNL_BYP_WIND_START_VALUE (0xfffffL<<12)
2541
2542#define BNX2_MQ_KNL_WIND_END 0x00003c20
2543#define BNX2_MQ_KNL_WIND_END_VALUE (0xffffffL<<8)
2544
2545#define BNX2_MQ_KNL_WRITE_MASK1 0x00003c24
2546#define BNX2_MQ_KNL_TX_MASK1 0x00003c28
2547#define BNX2_MQ_KNL_CMD_MASK1 0x00003c2c
2548#define BNX2_MQ_KNL_COND_ENQUEUE_MASK1 0x00003c30
2549#define BNX2_MQ_KNL_RX_V2P_MASK1 0x00003c34
2550#define BNX2_MQ_KNL_WRITE_MASK2 0x00003c38
2551#define BNX2_MQ_KNL_TX_MASK2 0x00003c3c
2552#define BNX2_MQ_KNL_CMD_MASK2 0x00003c40
2553#define BNX2_MQ_KNL_COND_ENQUEUE_MASK2 0x00003c44
2554#define BNX2_MQ_KNL_RX_V2P_MASK2 0x00003c48
2555#define BNX2_MQ_KNL_BYP_WRITE_MASK1 0x00003c4c
2556#define BNX2_MQ_KNL_BYP_TX_MASK1 0x00003c50
2557#define BNX2_MQ_KNL_BYP_CMD_MASK1 0x00003c54
2558#define BNX2_MQ_KNL_BYP_COND_ENQUEUE_MASK1 0x00003c58
2559#define BNX2_MQ_KNL_BYP_RX_V2P_MASK1 0x00003c5c
2560#define BNX2_MQ_KNL_BYP_WRITE_MASK2 0x00003c60
2561#define BNX2_MQ_KNL_BYP_TX_MASK2 0x00003c64
2562#define BNX2_MQ_KNL_BYP_CMD_MASK2 0x00003c68
2563#define BNX2_MQ_KNL_BYP_COND_ENQUEUE_MASK2 0x00003c6c
2564#define BNX2_MQ_KNL_BYP_RX_V2P_MASK2 0x00003c70
2565#define BNX2_MQ_MEM_WR_ADDR 0x00003c74
2566#define BNX2_MQ_MEM_WR_ADDR_VALUE (0x3fL<<0)
2567
2568#define BNX2_MQ_MEM_WR_DATA0 0x00003c78
2569#define BNX2_MQ_MEM_WR_DATA0_VALUE (0xffffffffL<<0)
2570
2571#define BNX2_MQ_MEM_WR_DATA1 0x00003c7c
2572#define BNX2_MQ_MEM_WR_DATA1_VALUE (0xffffffffL<<0)
2573
2574#define BNX2_MQ_MEM_WR_DATA2 0x00003c80
2575#define BNX2_MQ_MEM_WR_DATA2_VALUE (0x3fffffffL<<0)
2576
2577#define BNX2_MQ_MEM_RD_ADDR 0x00003c84
2578#define BNX2_MQ_MEM_RD_ADDR_VALUE (0x3fL<<0)
2579
2580#define BNX2_MQ_MEM_RD_DATA0 0x00003c88
2581#define BNX2_MQ_MEM_RD_DATA0_VALUE (0xffffffffL<<0)
2582
2583#define BNX2_MQ_MEM_RD_DATA1 0x00003c8c
2584#define BNX2_MQ_MEM_RD_DATA1_VALUE (0xffffffffL<<0)
2585
2586#define BNX2_MQ_MEM_RD_DATA2 0x00003c90
2587#define BNX2_MQ_MEM_RD_DATA2_VALUE (0x3fffffffL<<0)
2588
2589
2590
2591/*
2592 * tbdr_reg definition
2593 * offset: 0x5000
2594 */
2595#define BNX2_TBDR_COMMAND 0x00005000
2596#define BNX2_TBDR_COMMAND_ENABLE (1L<<0)
2597#define BNX2_TBDR_COMMAND_SOFT_RST (1L<<1)
2598#define BNX2_TBDR_COMMAND_MSTR_ABORT (1L<<4)
2599
2600#define BNX2_TBDR_STATUS 0x00005004
2601#define BNX2_TBDR_STATUS_DMA_WAIT (1L<<0)
2602#define BNX2_TBDR_STATUS_FTQ_WAIT (1L<<1)
2603#define BNX2_TBDR_STATUS_FIFO_OVERFLOW (1L<<2)
2604#define BNX2_TBDR_STATUS_FIFO_UNDERFLOW (1L<<3)
2605#define BNX2_TBDR_STATUS_SEARCHMISS_ERROR (1L<<4)
2606#define BNX2_TBDR_STATUS_FTQ_ENTRY_CNT (1L<<5)
2607#define BNX2_TBDR_STATUS_BURST_CNT (1L<<6)
2608
2609#define BNX2_TBDR_CONFIG 0x00005008
2610#define BNX2_TBDR_CONFIG_MAX_BDS (0xffL<<0)
2611#define BNX2_TBDR_CONFIG_SWAP_MODE (1L<<8)
2612#define BNX2_TBDR_CONFIG_PRIORITY (1L<<9)
2613#define BNX2_TBDR_CONFIG_CACHE_NEXT_PAGE_PTRS (1L<<10)
2614#define BNX2_TBDR_CONFIG_PAGE_SIZE (0xfL<<24)
2615#define BNX2_TBDR_CONFIG_PAGE_SIZE_256 (0L<<24)
2616#define BNX2_TBDR_CONFIG_PAGE_SIZE_512 (1L<<24)
2617#define BNX2_TBDR_CONFIG_PAGE_SIZE_1K (2L<<24)
2618#define BNX2_TBDR_CONFIG_PAGE_SIZE_2K (3L<<24)
2619#define BNX2_TBDR_CONFIG_PAGE_SIZE_4K (4L<<24)
2620#define BNX2_TBDR_CONFIG_PAGE_SIZE_8K (5L<<24)
2621#define BNX2_TBDR_CONFIG_PAGE_SIZE_16K (6L<<24)
2622#define BNX2_TBDR_CONFIG_PAGE_SIZE_32K (7L<<24)
2623#define BNX2_TBDR_CONFIG_PAGE_SIZE_64K (8L<<24)
2624#define BNX2_TBDR_CONFIG_PAGE_SIZE_128K (9L<<24)
2625#define BNX2_TBDR_CONFIG_PAGE_SIZE_256K (10L<<24)
2626#define BNX2_TBDR_CONFIG_PAGE_SIZE_512K (11L<<24)
2627#define BNX2_TBDR_CONFIG_PAGE_SIZE_1M (12L<<24)
2628
2629#define BNX2_TBDR_DEBUG_VECT_PEEK 0x0000500c
2630#define BNX2_TBDR_DEBUG_VECT_PEEK_1_VALUE (0x7ffL<<0)
2631#define BNX2_TBDR_DEBUG_VECT_PEEK_1_PEEK_EN (1L<<11)
2632#define BNX2_TBDR_DEBUG_VECT_PEEK_1_SEL (0xfL<<12)
2633#define BNX2_TBDR_DEBUG_VECT_PEEK_2_VALUE (0x7ffL<<16)
2634#define BNX2_TBDR_DEBUG_VECT_PEEK_2_PEEK_EN (1L<<27)
2635#define BNX2_TBDR_DEBUG_VECT_PEEK_2_SEL (0xfL<<28)
2636
2637#define BNX2_TBDR_FTQ_DATA 0x000053c0
2638#define BNX2_TBDR_FTQ_CMD 0x000053f8
2639#define BNX2_TBDR_FTQ_CMD_OFFSET (0x3ffL<<0)
2640#define BNX2_TBDR_FTQ_CMD_WR_TOP (1L<<10)
2641#define BNX2_TBDR_FTQ_CMD_WR_TOP_0 (0L<<10)
2642#define BNX2_TBDR_FTQ_CMD_WR_TOP_1 (1L<<10)
2643#define BNX2_TBDR_FTQ_CMD_SFT_RESET (1L<<25)
2644#define BNX2_TBDR_FTQ_CMD_RD_DATA (1L<<26)
2645#define BNX2_TBDR_FTQ_CMD_ADD_INTERVEN (1L<<27)
2646#define BNX2_TBDR_FTQ_CMD_ADD_DATA (1L<<28)
2647#define BNX2_TBDR_FTQ_CMD_INTERVENE_CLR (1L<<29)
2648#define BNX2_TBDR_FTQ_CMD_POP (1L<<30)
2649#define BNX2_TBDR_FTQ_CMD_BUSY (1L<<31)
2650
2651#define BNX2_TBDR_FTQ_CTL 0x000053fc
2652#define BNX2_TBDR_FTQ_CTL_INTERVENE (1L<<0)
2653#define BNX2_TBDR_FTQ_CTL_OVERFLOW (1L<<1)
2654#define BNX2_TBDR_FTQ_CTL_FORCE_INTERVENE (1L<<2)
2655#define BNX2_TBDR_FTQ_CTL_MAX_DEPTH (0x3ffL<<12)
2656#define BNX2_TBDR_FTQ_CTL_CUR_DEPTH (0x3ffL<<22)
2657
2658
2659
2660/*
2661 * tdma_reg definition
2662 * offset: 0x5c00
2663 */
2664#define BNX2_TDMA_COMMAND 0x00005c00
2665#define BNX2_TDMA_COMMAND_ENABLED (1L<<0)
2666#define BNX2_TDMA_COMMAND_MASTER_ABORT (1L<<4)
2667#define BNX2_TDMA_COMMAND_BAD_L2_LENGTH_ABORT (1L<<7)
2668
2669#define BNX2_TDMA_STATUS 0x00005c04
2670#define BNX2_TDMA_STATUS_DMA_WAIT (1L<<0)
2671#define BNX2_TDMA_STATUS_PAYLOAD_WAIT (1L<<1)
2672#define BNX2_TDMA_STATUS_PATCH_FTQ_WAIT (1L<<2)
2673#define BNX2_TDMA_STATUS_LOCK_WAIT (1L<<3)
2674#define BNX2_TDMA_STATUS_FTQ_ENTRY_CNT (1L<<16)
2675#define BNX2_TDMA_STATUS_BURST_CNT (1L<<17)
2676
2677#define BNX2_TDMA_CONFIG 0x00005c08
2678#define BNX2_TDMA_CONFIG_ONE_DMA (1L<<0)
2679#define BNX2_TDMA_CONFIG_ONE_RECORD (1L<<1)
2680#define BNX2_TDMA_CONFIG_LIMIT_SZ (0xfL<<4)
2681#define BNX2_TDMA_CONFIG_LIMIT_SZ_64 (0L<<4)
2682#define BNX2_TDMA_CONFIG_LIMIT_SZ_128 (0x4L<<4)
2683#define BNX2_TDMA_CONFIG_LIMIT_SZ_256 (0x6L<<4)
2684#define BNX2_TDMA_CONFIG_LIMIT_SZ_512 (0x8L<<4)
2685#define BNX2_TDMA_CONFIG_LINE_SZ (0xfL<<8)
2686#define BNX2_TDMA_CONFIG_LINE_SZ_64 (0L<<8)
2687#define BNX2_TDMA_CONFIG_LINE_SZ_128 (4L<<8)
2688#define BNX2_TDMA_CONFIG_LINE_SZ_256 (6L<<8)
2689#define BNX2_TDMA_CONFIG_LINE_SZ_512 (8L<<8)
2690#define BNX2_TDMA_CONFIG_ALIGN_ENA (1L<<15)
2691#define BNX2_TDMA_CONFIG_CHK_L2_BD (1L<<16)
2692#define BNX2_TDMA_CONFIG_FIFO_CMP (0xfL<<20)
2693
2694#define BNX2_TDMA_PAYLOAD_PROD 0x00005c0c
2695#define BNX2_TDMA_PAYLOAD_PROD_VALUE (0x1fffL<<3)
2696
2697#define BNX2_TDMA_DBG_WATCHDOG 0x00005c10
2698#define BNX2_TDMA_DBG_TRIGGER 0x00005c14
2699#define BNX2_TDMA_DMAD_FSM 0x00005c80
2700#define BNX2_TDMA_DMAD_FSM_BD_INVLD (1L<<0)
2701#define BNX2_TDMA_DMAD_FSM_PUSH (0xfL<<4)
2702#define BNX2_TDMA_DMAD_FSM_ARB_TBDC (0x3L<<8)
2703#define BNX2_TDMA_DMAD_FSM_ARB_CTX (1L<<12)
2704#define BNX2_TDMA_DMAD_FSM_DR_INTF (1L<<16)
2705#define BNX2_TDMA_DMAD_FSM_DMAD (0x7L<<20)
2706#define BNX2_TDMA_DMAD_FSM_BD (0xfL<<24)
2707
2708#define BNX2_TDMA_DMAD_STATUS 0x00005c84
2709#define BNX2_TDMA_DMAD_STATUS_RHOLD_PUSH_ENTRY (0x3L<<0)
2710#define BNX2_TDMA_DMAD_STATUS_RHOLD_DMAD_ENTRY (0x3L<<4)
2711#define BNX2_TDMA_DMAD_STATUS_RHOLD_BD_ENTRY (0x3L<<8)
2712#define BNX2_TDMA_DMAD_STATUS_IFTQ_ENUM (0xfL<<12)
2713
2714#define BNX2_TDMA_DR_INTF_FSM 0x00005c88
2715#define BNX2_TDMA_DR_INTF_FSM_L2_COMP (0x3L<<0)
2716#define BNX2_TDMA_DR_INTF_FSM_TPATQ (0x7L<<4)
2717#define BNX2_TDMA_DR_INTF_FSM_TPBUF (0x3L<<8)
2718#define BNX2_TDMA_DR_INTF_FSM_DR_BUF (0x7L<<12)
2719#define BNX2_TDMA_DR_INTF_FSM_DMAD (0x7L<<16)
2720
2721#define BNX2_TDMA_DR_INTF_STATUS 0x00005c8c
2722#define BNX2_TDMA_DR_INTF_STATUS_HOLE_PHASE (0x7L<<0)
2723#define BNX2_TDMA_DR_INTF_STATUS_DATA_AVAIL (0x3L<<4)
2724#define BNX2_TDMA_DR_INTF_STATUS_SHIFT_ADDR (0x7L<<8)
2725#define BNX2_TDMA_DR_INTF_STATUS_NXT_PNTR (0xfL<<12)
2726#define BNX2_TDMA_DR_INTF_STATUS_BYTE_COUNT (0x7L<<16)
2727
2728#define BNX2_TDMA_FTQ_DATA 0x00005fc0
2729#define BNX2_TDMA_FTQ_CMD 0x00005ff8
2730#define BNX2_TDMA_FTQ_CMD_OFFSET (0x3ffL<<0)
2731#define BNX2_TDMA_FTQ_CMD_WR_TOP (1L<<10)
2732#define BNX2_TDMA_FTQ_CMD_WR_TOP_0 (0L<<10)
2733#define BNX2_TDMA_FTQ_CMD_WR_TOP_1 (1L<<10)
2734#define BNX2_TDMA_FTQ_CMD_SFT_RESET (1L<<25)
2735#define BNX2_TDMA_FTQ_CMD_RD_DATA (1L<<26)
2736#define BNX2_TDMA_FTQ_CMD_ADD_INTERVEN (1L<<27)
2737#define BNX2_TDMA_FTQ_CMD_ADD_DATA (1L<<28)
2738#define BNX2_TDMA_FTQ_CMD_INTERVENE_CLR (1L<<29)
2739#define BNX2_TDMA_FTQ_CMD_POP (1L<<30)
2740#define BNX2_TDMA_FTQ_CMD_BUSY (1L<<31)
2741
2742#define BNX2_TDMA_FTQ_CTL 0x00005ffc
2743#define BNX2_TDMA_FTQ_CTL_INTERVENE (1L<<0)
2744#define BNX2_TDMA_FTQ_CTL_OVERFLOW (1L<<1)
2745#define BNX2_TDMA_FTQ_CTL_FORCE_INTERVENE (1L<<2)
2746#define BNX2_TDMA_FTQ_CTL_MAX_DEPTH (0x3ffL<<12)
2747#define BNX2_TDMA_FTQ_CTL_CUR_DEPTH (0x3ffL<<22)
2748
2749
2750
2751/*
2752 * hc_reg definition
2753 * offset: 0x6800
2754 */
2755#define BNX2_HC_COMMAND 0x00006800
2756#define BNX2_HC_COMMAND_ENABLE (1L<<0)
2757#define BNX2_HC_COMMAND_SKIP_ABORT (1L<<4)
2758#define BNX2_HC_COMMAND_COAL_NOW (1L<<16)
2759#define BNX2_HC_COMMAND_COAL_NOW_WO_INT (1L<<17)
2760#define BNX2_HC_COMMAND_STATS_NOW (1L<<18)
2761#define BNX2_HC_COMMAND_FORCE_INT (0x3L<<19)
2762#define BNX2_HC_COMMAND_FORCE_INT_NULL (0L<<19)
2763#define BNX2_HC_COMMAND_FORCE_INT_HIGH (1L<<19)
2764#define BNX2_HC_COMMAND_FORCE_INT_LOW (2L<<19)
2765#define BNX2_HC_COMMAND_FORCE_INT_FREE (3L<<19)
2766#define BNX2_HC_COMMAND_CLR_STAT_NOW (1L<<21)
2767
2768#define BNX2_HC_STATUS 0x00006804
2769#define BNX2_HC_STATUS_MASTER_ABORT (1L<<0)
2770#define BNX2_HC_STATUS_PARITY_ERROR_STATE (1L<<1)
2771#define BNX2_HC_STATUS_PCI_CLK_CNT_STAT (1L<<16)
2772#define BNX2_HC_STATUS_CORE_CLK_CNT_STAT (1L<<17)
2773#define BNX2_HC_STATUS_NUM_STATUS_BLOCKS_STAT (1L<<18)
2774#define BNX2_HC_STATUS_NUM_INT_GEN_STAT (1L<<19)
2775#define BNX2_HC_STATUS_NUM_INT_MBOX_WR_STAT (1L<<20)
2776#define BNX2_HC_STATUS_CORE_CLKS_TO_HW_INTACK_STAT (1L<<23)
2777#define BNX2_HC_STATUS_CORE_CLKS_TO_SW_INTACK_STAT (1L<<24)
2778#define BNX2_HC_STATUS_CORE_CLKS_DURING_SW_INTACK_STAT (1L<<25)
2779
2780#define BNX2_HC_CONFIG 0x00006808
2781#define BNX2_HC_CONFIG_COLLECT_STATS (1L<<0)
2782#define BNX2_HC_CONFIG_RX_TMR_MODE (1L<<1)
2783#define BNX2_HC_CONFIG_TX_TMR_MODE (1L<<2)
2784#define BNX2_HC_CONFIG_COM_TMR_MODE (1L<<3)
2785#define BNX2_HC_CONFIG_CMD_TMR_MODE (1L<<4)
2786#define BNX2_HC_CONFIG_STATISTIC_PRIORITY (1L<<5)
2787#define BNX2_HC_CONFIG_STATUS_PRIORITY (1L<<6)
2788#define BNX2_HC_CONFIG_STAT_MEM_ADDR (0xffL<<8)
2789
2790#define BNX2_HC_ATTN_BITS_ENABLE 0x0000680c
2791#define BNX2_HC_STATUS_ADDR_L 0x00006810
2792#define BNX2_HC_STATUS_ADDR_H 0x00006814
2793#define BNX2_HC_STATISTICS_ADDR_L 0x00006818
2794#define BNX2_HC_STATISTICS_ADDR_H 0x0000681c
2795#define BNX2_HC_TX_QUICK_CONS_TRIP 0x00006820
2796#define BNX2_HC_TX_QUICK_CONS_TRIP_VALUE (0xffL<<0)
2797#define BNX2_HC_TX_QUICK_CONS_TRIP_INT (0xffL<<16)
2798
2799#define BNX2_HC_COMP_PROD_TRIP 0x00006824
2800#define BNX2_HC_COMP_PROD_TRIP_VALUE (0xffL<<0)
2801#define BNX2_HC_COMP_PROD_TRIP_INT (0xffL<<16)
2802
2803#define BNX2_HC_RX_QUICK_CONS_TRIP 0x00006828
2804#define BNX2_HC_RX_QUICK_CONS_TRIP_VALUE (0xffL<<0)
2805#define BNX2_HC_RX_QUICK_CONS_TRIP_INT (0xffL<<16)
2806
2807#define BNX2_HC_RX_TICKS 0x0000682c
2808#define BNX2_HC_RX_TICKS_VALUE (0x3ffL<<0)
2809#define BNX2_HC_RX_TICKS_INT (0x3ffL<<16)
2810
2811#define BNX2_HC_TX_TICKS 0x00006830
2812#define BNX2_HC_TX_TICKS_VALUE (0x3ffL<<0)
2813#define BNX2_HC_TX_TICKS_INT (0x3ffL<<16)
2814
2815#define BNX2_HC_COM_TICKS 0x00006834
2816#define BNX2_HC_COM_TICKS_VALUE (0x3ffL<<0)
2817#define BNX2_HC_COM_TICKS_INT (0x3ffL<<16)
2818
2819#define BNX2_HC_CMD_TICKS 0x00006838
2820#define BNX2_HC_CMD_TICKS_VALUE (0x3ffL<<0)
2821#define BNX2_HC_CMD_TICKS_INT (0x3ffL<<16)
2822
2823#define BNX2_HC_PERIODIC_TICKS 0x0000683c
2824#define BNX2_HC_PERIODIC_TICKS_HC_PERIODIC_TICKS (0xffffL<<0)
2825
2826#define BNX2_HC_STAT_COLLECT_TICKS 0x00006840
2827#define BNX2_HC_STAT_COLLECT_TICKS_HC_STAT_COLL_TICKS (0xffL<<4)
2828
2829#define BNX2_HC_STATS_TICKS 0x00006844
2830#define BNX2_HC_STATS_TICKS_HC_STAT_TICKS (0xffffL<<8)
2831
2832#define BNX2_HC_STAT_MEM_DATA 0x0000684c
2833#define BNX2_HC_STAT_GEN_SEL_0 0x00006850
2834#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0 (0x7fL<<0)
2835#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXP_STAT0 (0L<<0)
2836#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXP_STAT1 (1L<<0)
2837#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXP_STAT2 (2L<<0)
2838#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXP_STAT3 (3L<<0)
2839#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXP_STAT4 (4L<<0)
2840#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXP_STAT5 (5L<<0)
2841#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXP_STAT6 (6L<<0)
2842#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXP_STAT7 (7L<<0)
2843#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXP_STAT8 (8L<<0)
2844#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXP_STAT9 (9L<<0)
2845#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXP_STAT10 (10L<<0)
2846#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXP_STAT11 (11L<<0)
2847#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TXP_STAT0 (12L<<0)
2848#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TXP_STAT1 (13L<<0)
2849#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TXP_STAT2 (14L<<0)
2850#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TXP_STAT3 (15L<<0)
2851#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TXP_STAT4 (16L<<0)
2852#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TXP_STAT5 (17L<<0)
2853#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TXP_STAT6 (18L<<0)
2854#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TXP_STAT7 (19L<<0)
2855#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COM_STAT0 (20L<<0)
2856#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COM_STAT1 (21L<<0)
2857#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COM_STAT2 (22L<<0)
2858#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COM_STAT3 (23L<<0)
2859#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COM_STAT4 (24L<<0)
2860#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COM_STAT5 (25L<<0)
2861#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COM_STAT6 (26L<<0)
2862#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COM_STAT7 (27L<<0)
2863#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COM_STAT8 (28L<<0)
2864#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COM_STAT9 (29L<<0)
2865#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COM_STAT10 (30L<<0)
2866#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COM_STAT11 (31L<<0)
2867#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TPAT_STAT0 (32L<<0)
2868#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TPAT_STAT1 (33L<<0)
2869#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TPAT_STAT2 (34L<<0)
2870#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TPAT_STAT3 (35L<<0)
2871#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CP_STAT0 (36L<<0)
2872#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CP_STAT1 (37L<<0)
2873#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CP_STAT2 (38L<<0)
2874#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CP_STAT3 (39L<<0)
2875#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CP_STAT4 (40L<<0)
2876#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CP_STAT5 (41L<<0)
2877#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CP_STAT6 (42L<<0)
2878#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CP_STAT7 (43L<<0)
2879#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_MCP_STAT0 (44L<<0)
2880#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_MCP_STAT1 (45L<<0)
2881#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_MCP_STAT2 (46L<<0)
2882#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_MCP_STAT3 (47L<<0)
2883#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_MCP_STAT4 (48L<<0)
2884#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_MCP_STAT5 (49L<<0)
2885#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_MCP_STAT6 (50L<<0)
2886#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_MCP_STAT7 (51L<<0)
2887#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_PCI_CLK_CNT (52L<<0)
2888#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CORE_CLK_CNT (53L<<0)
2889#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_HC_NUM_STATUS_BLOCKS (54L<<0)
2890#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_HC_NUM_INT_GEN (55L<<0)
2891#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_HC_NUM_INT_MBOX_WR (56L<<0)
2892#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_HC_CORE_CLKS_TO_HW_INTACK (59L<<0)
2893#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_HC_CORE_CLKS_TO_SW_INTACK (60L<<0)
2894#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_HC_CORE_CLKS_DURING_SW_INTACK (61L<<0)
2895#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TSCH_CMD_CNT (62L<<0)
2896#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TSCH_SLOT_CNT (63L<<0)
2897#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CSCH_CMD_CNT (64L<<0)
2898#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CSCH_SLOT_CNT (65L<<0)
2899#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RLUPQ_VALID_CNT (66L<<0)
2900#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXPQ_VALID_CNT (67L<<0)
2901#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RXPCQ_VALID_CNT (68L<<0)
2902#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RV2PPQ_VALID_CNT (69L<<0)
2903#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RV2PMQ_VALID_CNT (70L<<0)
2904#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RV2PTQ_VALID_CNT (71L<<0)
2905#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RDMAQ_VALID_CNT (72L<<0)
2906#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TSCHQ_VALID_CNT (73L<<0)
2907#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TBDRQ_VALID_CNT (74L<<0)
2908#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TXPQ_VALID_CNT (75L<<0)
2909#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TDMAQ_VALID_CNT (76L<<0)
2910#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TPATQ_VALID_CNT (77L<<0)
2911#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TASQ_VALID_CNT (78L<<0)
2912#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CSQ_VALID_CNT (79L<<0)
2913#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CPQ_VALID_CNT (80L<<0)
2914#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COMXQ_VALID_CNT (81L<<0)
2915#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COMTQ_VALID_CNT (82L<<0)
2916#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_COMQ_VALID_CNT (83L<<0)
2917#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_MGMQ_VALID_CNT (84L<<0)
2918#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_DMAE_READ_TRANSFERS_CNT (85L<<0)
2919#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_DMAE_READ_DELAY_PCI_CLKS_CNT (86L<<0)
2920#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_DMAE_BIG_READ_TRANSFERS_CNT (87L<<0)
2921#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_DMAE_BIG_READ_DELAY_PCI_CLKS_CNT (88L<<0)
2922#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_DMAE_BIG_READ_RETRY_AFTER_DATA_CNT (89L<<0)
2923#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_DMAE_WRITE_TRANSFERS_CNT (90L<<0)
2924#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_DMAE_WRITE_DELAY_PCI_CLKS_CNT (91L<<0)
2925#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_DMAE_BIG_WRITE_TRANSFERS_CNT (92L<<0)
2926#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_DMAE_BIG_WRITE_DELAY_PCI_CLKS_CNT (93L<<0)
2927#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_DMAE_BIG_WRITE_RETRY_AFTER_DATA_CNT (94L<<0)
2928#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CTX_WR_CNT64 (95L<<0)
2929#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CTX_RD_CNT64 (96L<<0)
2930#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CTX_ACC_STALL_CLKS (97L<<0)
2931#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_CTX_LOCK_STALL_CLKS (98L<<0)
2932#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_MBQ_CTX_ACCESS_STAT (99L<<0)
2933#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_MBQ_CTX_ACCESS64_STAT (100L<<0)
2934#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_MBQ_PCI_STALL_STAT (101L<<0)
2935#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TBDR_FTQ_ENTRY_CNT (102L<<0)
2936#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TBDR_BURST_CNT (103L<<0)
2937#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TDMA_FTQ_ENTRY_CNT (104L<<0)
2938#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TDMA_BURST_CNT (105L<<0)
2939#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RDMA_FTQ_ENTRY_CNT (106L<<0)
2940#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RDMA_BURST_CNT (107L<<0)
2941#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RLUP_MATCH_CNT (108L<<0)
2942#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TMR_POLL_PASS_CNT (109L<<0)
2943#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TMR_TMR1_CNT (110L<<0)
2944#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TMR_TMR2_CNT (111L<<0)
2945#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TMR_TMR3_CNT (112L<<0)
2946#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TMR_TMR4_CNT (113L<<0)
2947#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_TMR_TMR5_CNT (114L<<0)
2948#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RV2P_STAT0 (115L<<0)
2949#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RV2P_STAT1 (116L<<0)
2950#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RV2P_STAT2 (117L<<0)
2951#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RV2P_STAT3 (118L<<0)
2952#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RV2P_STAT4 (119L<<0)
2953#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RV2P_STAT5 (120L<<0)
2954#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RBDC_PROC1_MISS (121L<<0)
2955#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RBDC_PROC2_MISS (122L<<0)
2956#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_0_RBDC_BURST_CNT (127L<<0)
2957#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_1 (0x7fL<<8)
2958#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_2 (0x7fL<<16)
2959#define BNX2_HC_STAT_GEN_SEL_0_GEN_SEL_3 (0x7fL<<24)
2960
2961#define BNX2_HC_STAT_GEN_SEL_1 0x00006854
2962#define BNX2_HC_STAT_GEN_SEL_1_GEN_SEL_4 (0x7fL<<0)
2963#define BNX2_HC_STAT_GEN_SEL_1_GEN_SEL_5 (0x7fL<<8)
2964#define BNX2_HC_STAT_GEN_SEL_1_GEN_SEL_6 (0x7fL<<16)
2965#define BNX2_HC_STAT_GEN_SEL_1_GEN_SEL_7 (0x7fL<<24)
2966
2967#define BNX2_HC_STAT_GEN_SEL_2 0x00006858
2968#define BNX2_HC_STAT_GEN_SEL_2_GEN_SEL_8 (0x7fL<<0)
2969#define BNX2_HC_STAT_GEN_SEL_2_GEN_SEL_9 (0x7fL<<8)
2970#define BNX2_HC_STAT_GEN_SEL_2_GEN_SEL_10 (0x7fL<<16)
2971#define BNX2_HC_STAT_GEN_SEL_2_GEN_SEL_11 (0x7fL<<24)
2972
2973#define BNX2_HC_STAT_GEN_SEL_3 0x0000685c
2974#define BNX2_HC_STAT_GEN_SEL_3_GEN_SEL_12 (0x7fL<<0)
2975#define BNX2_HC_STAT_GEN_SEL_3_GEN_SEL_13 (0x7fL<<8)
2976#define BNX2_HC_STAT_GEN_SEL_3_GEN_SEL_14 (0x7fL<<16)
2977#define BNX2_HC_STAT_GEN_SEL_3_GEN_SEL_15 (0x7fL<<24)
2978
2979#define BNX2_HC_STAT_GEN_STAT0 0x00006888
2980#define BNX2_HC_STAT_GEN_STAT1 0x0000688c
2981#define BNX2_HC_STAT_GEN_STAT2 0x00006890
2982#define BNX2_HC_STAT_GEN_STAT3 0x00006894
2983#define BNX2_HC_STAT_GEN_STAT4 0x00006898
2984#define BNX2_HC_STAT_GEN_STAT5 0x0000689c
2985#define BNX2_HC_STAT_GEN_STAT6 0x000068a0
2986#define BNX2_HC_STAT_GEN_STAT7 0x000068a4
2987#define BNX2_HC_STAT_GEN_STAT8 0x000068a8
2988#define BNX2_HC_STAT_GEN_STAT9 0x000068ac
2989#define BNX2_HC_STAT_GEN_STAT10 0x000068b0
2990#define BNX2_HC_STAT_GEN_STAT11 0x000068b4
2991#define BNX2_HC_STAT_GEN_STAT12 0x000068b8
2992#define BNX2_HC_STAT_GEN_STAT13 0x000068bc
2993#define BNX2_HC_STAT_GEN_STAT14 0x000068c0
2994#define BNX2_HC_STAT_GEN_STAT15 0x000068c4
2995#define BNX2_HC_STAT_GEN_STAT_AC0 0x000068c8
2996#define BNX2_HC_STAT_GEN_STAT_AC1 0x000068cc
2997#define BNX2_HC_STAT_GEN_STAT_AC2 0x000068d0
2998#define BNX2_HC_STAT_GEN_STAT_AC3 0x000068d4
2999#define BNX2_HC_STAT_GEN_STAT_AC4 0x000068d8
3000#define BNX2_HC_STAT_GEN_STAT_AC5 0x000068dc
3001#define BNX2_HC_STAT_GEN_STAT_AC6 0x000068e0
3002#define BNX2_HC_STAT_GEN_STAT_AC7 0x000068e4
3003#define BNX2_HC_STAT_GEN_STAT_AC8 0x000068e8
3004#define BNX2_HC_STAT_GEN_STAT_AC9 0x000068ec
3005#define BNX2_HC_STAT_GEN_STAT_AC10 0x000068f0
3006#define BNX2_HC_STAT_GEN_STAT_AC11 0x000068f4
3007#define BNX2_HC_STAT_GEN_STAT_AC12 0x000068f8
3008#define BNX2_HC_STAT_GEN_STAT_AC13 0x000068fc
3009#define BNX2_HC_STAT_GEN_STAT_AC14 0x00006900
3010#define BNX2_HC_STAT_GEN_STAT_AC15 0x00006904
3011#define BNX2_HC_VIS 0x00006908
3012#define BNX2_HC_VIS_STAT_BUILD_STATE (0xfL<<0)
3013#define BNX2_HC_VIS_STAT_BUILD_STATE_IDLE (0L<<0)
3014#define BNX2_HC_VIS_STAT_BUILD_STATE_START (1L<<0)
3015#define BNX2_HC_VIS_STAT_BUILD_STATE_REQUEST (2L<<0)
3016#define BNX2_HC_VIS_STAT_BUILD_STATE_UPDATE64 (3L<<0)
3017#define BNX2_HC_VIS_STAT_BUILD_STATE_UPDATE32 (4L<<0)
3018#define BNX2_HC_VIS_STAT_BUILD_STATE_UPDATE_DONE (5L<<0)
3019#define BNX2_HC_VIS_STAT_BUILD_STATE_DMA (6L<<0)
3020#define BNX2_HC_VIS_STAT_BUILD_STATE_MSI_CONTROL (7L<<0)
3021#define BNX2_HC_VIS_STAT_BUILD_STATE_MSI_LOW (8L<<0)
3022#define BNX2_HC_VIS_STAT_BUILD_STATE_MSI_HIGH (9L<<0)
3023#define BNX2_HC_VIS_STAT_BUILD_STATE_MSI_DATA (10L<<0)
3024#define BNX2_HC_VIS_DMA_STAT_STATE (0xfL<<8)
3025#define BNX2_HC_VIS_DMA_STAT_STATE_IDLE (0L<<8)
3026#define BNX2_HC_VIS_DMA_STAT_STATE_STATUS_PARAM (1L<<8)
3027#define BNX2_HC_VIS_DMA_STAT_STATE_STATUS_DMA (2L<<8)
3028#define BNX2_HC_VIS_DMA_STAT_STATE_WRITE_COMP (3L<<8)
3029#define BNX2_HC_VIS_DMA_STAT_STATE_COMP (4L<<8)
3030#define BNX2_HC_VIS_DMA_STAT_STATE_STATISTIC_PARAM (5L<<8)
3031#define BNX2_HC_VIS_DMA_STAT_STATE_STATISTIC_DMA (6L<<8)
3032#define BNX2_HC_VIS_DMA_STAT_STATE_WRITE_COMP_1 (7L<<8)
3033#define BNX2_HC_VIS_DMA_STAT_STATE_WRITE_COMP_2 (8L<<8)
3034#define BNX2_HC_VIS_DMA_STAT_STATE_WAIT (9L<<8)
3035#define BNX2_HC_VIS_DMA_STAT_STATE_ABORT (15L<<8)
3036#define BNX2_HC_VIS_DMA_MSI_STATE (0x7L<<12)
3037#define BNX2_HC_VIS_STATISTIC_DMA_EN_STATE (0x3L<<15)
3038#define BNX2_HC_VIS_STATISTIC_DMA_EN_STATE_IDLE (0L<<15)
3039#define BNX2_HC_VIS_STATISTIC_DMA_EN_STATE_COUNT (1L<<15)
3040#define BNX2_HC_VIS_STATISTIC_DMA_EN_STATE_START (2L<<15)
3041
3042#define BNX2_HC_VIS_1 0x0000690c
3043#define BNX2_HC_VIS_1_HW_INTACK_STATE (1L<<4)
3044#define BNX2_HC_VIS_1_HW_INTACK_STATE_IDLE (0L<<4)
3045#define BNX2_HC_VIS_1_HW_INTACK_STATE_COUNT (1L<<4)
3046#define BNX2_HC_VIS_1_SW_INTACK_STATE (1L<<5)
3047#define BNX2_HC_VIS_1_SW_INTACK_STATE_IDLE (0L<<5)
3048#define BNX2_HC_VIS_1_SW_INTACK_STATE_COUNT (1L<<5)
3049#define BNX2_HC_VIS_1_DURING_SW_INTACK_STATE (1L<<6)
3050#define BNX2_HC_VIS_1_DURING_SW_INTACK_STATE_IDLE (0L<<6)
3051#define BNX2_HC_VIS_1_DURING_SW_INTACK_STATE_COUNT (1L<<6)
3052#define BNX2_HC_VIS_1_MAILBOX_COUNT_STATE (1L<<7)
3053#define BNX2_HC_VIS_1_MAILBOX_COUNT_STATE_IDLE (0L<<7)
3054#define BNX2_HC_VIS_1_MAILBOX_COUNT_STATE_COUNT (1L<<7)
3055#define BNX2_HC_VIS_1_RAM_RD_ARB_STATE (0xfL<<17)
3056#define BNX2_HC_VIS_1_RAM_RD_ARB_STATE_IDLE (0L<<17)
3057#define BNX2_HC_VIS_1_RAM_RD_ARB_STATE_DMA (1L<<17)
3058#define BNX2_HC_VIS_1_RAM_RD_ARB_STATE_UPDATE (2L<<17)
3059#define BNX2_HC_VIS_1_RAM_RD_ARB_STATE_ASSIGN (3L<<17)
3060#define BNX2_HC_VIS_1_RAM_RD_ARB_STATE_WAIT (4L<<17)
3061#define BNX2_HC_VIS_1_RAM_RD_ARB_STATE_REG_UPDATE (5L<<17)
3062#define BNX2_HC_VIS_1_RAM_RD_ARB_STATE_REG_ASSIGN (6L<<17)
3063#define BNX2_HC_VIS_1_RAM_RD_ARB_STATE_REG_WAIT (7L<<17)
3064#define BNX2_HC_VIS_1_RAM_WR_ARB_STATE (0x3L<<21)
3065#define BNX2_HC_VIS_1_RAM_WR_ARB_STATE_NORMAL (0L<<21)
3066#define BNX2_HC_VIS_1_RAM_WR_ARB_STATE_CLEAR (1L<<21)
3067#define BNX2_HC_VIS_1_INT_GEN_STATE (1L<<23)
3068#define BNX2_HC_VIS_1_INT_GEN_STATE_DLE (0L<<23)
3069#define BNX2_HC_VIS_1_INT_GEN_STATE_NTERRUPT (1L<<23)
3070#define BNX2_HC_VIS_1_STAT_CHAN_ID (0x7L<<24)
3071#define BNX2_HC_VIS_1_INT_B (1L<<27)
3072
3073#define BNX2_HC_DEBUG_VECT_PEEK 0x00006910
3074#define BNX2_HC_DEBUG_VECT_PEEK_1_VALUE (0x7ffL<<0)
3075#define BNX2_HC_DEBUG_VECT_PEEK_1_PEEK_EN (1L<<11)
3076#define BNX2_HC_DEBUG_VECT_PEEK_1_SEL (0xfL<<12)
3077#define BNX2_HC_DEBUG_VECT_PEEK_2_VALUE (0x7ffL<<16)
3078#define BNX2_HC_DEBUG_VECT_PEEK_2_PEEK_EN (1L<<27)
3079#define BNX2_HC_DEBUG_VECT_PEEK_2_SEL (0xfL<<28)
3080
3081
3082
3083/*
3084 * txp_reg definition
3085 * offset: 0x40000
3086 */
3087#define BNX2_TXP_CPU_MODE 0x00045000
3088#define BNX2_TXP_CPU_MODE_LOCAL_RST (1L<<0)
3089#define BNX2_TXP_CPU_MODE_STEP_ENA (1L<<1)
3090#define BNX2_TXP_CPU_MODE_PAGE_0_DATA_ENA (1L<<2)
3091#define BNX2_TXP_CPU_MODE_PAGE_0_INST_ENA (1L<<3)
3092#define BNX2_TXP_CPU_MODE_MSG_BIT1 (1L<<6)
3093#define BNX2_TXP_CPU_MODE_INTERRUPT_ENA (1L<<7)
3094#define BNX2_TXP_CPU_MODE_SOFT_HALT (1L<<10)
3095#define BNX2_TXP_CPU_MODE_BAD_DATA_HALT_ENA (1L<<11)
3096#define BNX2_TXP_CPU_MODE_BAD_INST_HALT_ENA (1L<<12)
3097#define BNX2_TXP_CPU_MODE_FIO_ABORT_HALT_ENA (1L<<13)
3098#define BNX2_TXP_CPU_MODE_SPAD_UNDERFLOW_HALT_ENA (1L<<15)
3099
3100#define BNX2_TXP_CPU_STATE 0x00045004
3101#define BNX2_TXP_CPU_STATE_BREAKPOINT (1L<<0)
3102#define BNX2_TXP_CPU_STATE_BAD_INST_HALTED (1L<<2)
3103#define BNX2_TXP_CPU_STATE_PAGE_0_DATA_HALTED (1L<<3)
3104#define BNX2_TXP_CPU_STATE_PAGE_0_INST_HALTED (1L<<4)
3105#define BNX2_TXP_CPU_STATE_BAD_DATA_ADDR_HALTED (1L<<5)
3106#define BNX2_TXP_CPU_STATE_BAD_pc_HALTED (1L<<6)
3107#define BNX2_TXP_CPU_STATE_ALIGN_HALTED (1L<<7)
3108#define BNX2_TXP_CPU_STATE_FIO_ABORT_HALTED (1L<<8)
3109#define BNX2_TXP_CPU_STATE_SOFT_HALTED (1L<<10)
3110#define BNX2_TXP_CPU_STATE_SPAD_UNDERFLOW (1L<<11)
3111#define BNX2_TXP_CPU_STATE_INTERRRUPT (1L<<12)
3112#define BNX2_TXP_CPU_STATE_DATA_ACCESS_STALL (1L<<14)
3113#define BNX2_TXP_CPU_STATE_INST_FETCH_STALL (1L<<15)
3114#define BNX2_TXP_CPU_STATE_BLOCKED_READ (1L<<31)
3115
3116#define BNX2_TXP_CPU_EVENT_MASK 0x00045008
3117#define BNX2_TXP_CPU_EVENT_MASK_BREAKPOINT_MASK (1L<<0)
3118#define BNX2_TXP_CPU_EVENT_MASK_BAD_INST_HALTED_MASK (1L<<2)
3119#define BNX2_TXP_CPU_EVENT_MASK_PAGE_0_DATA_HALTED_MASK (1L<<3)
3120#define BNX2_TXP_CPU_EVENT_MASK_PAGE_0_INST_HALTED_MASK (1L<<4)
3121#define BNX2_TXP_CPU_EVENT_MASK_BAD_DATA_ADDR_HALTED_MASK (1L<<5)
3122#define BNX2_TXP_CPU_EVENT_MASK_BAD_PC_HALTED_MASK (1L<<6)
3123#define BNX2_TXP_CPU_EVENT_MASK_ALIGN_HALTED_MASK (1L<<7)
3124#define BNX2_TXP_CPU_EVENT_MASK_FIO_ABORT_MASK (1L<<8)
3125#define BNX2_TXP_CPU_EVENT_MASK_SOFT_HALTED_MASK (1L<<10)
3126#define BNX2_TXP_CPU_EVENT_MASK_SPAD_UNDERFLOW_MASK (1L<<11)
3127#define BNX2_TXP_CPU_EVENT_MASK_INTERRUPT_MASK (1L<<12)
3128
3129#define BNX2_TXP_CPU_PROGRAM_COUNTER 0x0004501c
3130#define BNX2_TXP_CPU_INSTRUCTION 0x00045020
3131#define BNX2_TXP_CPU_DATA_ACCESS 0x00045024
3132#define BNX2_TXP_CPU_INTERRUPT_ENABLE 0x00045028
3133#define BNX2_TXP_CPU_INTERRUPT_VECTOR 0x0004502c
3134#define BNX2_TXP_CPU_INTERRUPT_SAVED_PC 0x00045030
3135#define BNX2_TXP_CPU_HW_BREAKPOINT 0x00045034
3136#define BNX2_TXP_CPU_HW_BREAKPOINT_DISABLE (1L<<0)
3137#define BNX2_TXP_CPU_HW_BREAKPOINT_ADDRESS (0x3fffffffL<<2)
3138
3139#define BNX2_TXP_CPU_DEBUG_VECT_PEEK 0x00045038
3140#define BNX2_TXP_CPU_DEBUG_VECT_PEEK_1_VALUE (0x7ffL<<0)
3141#define BNX2_TXP_CPU_DEBUG_VECT_PEEK_1_PEEK_EN (1L<<11)
3142#define BNX2_TXP_CPU_DEBUG_VECT_PEEK_1_SEL (0xfL<<12)
3143#define BNX2_TXP_CPU_DEBUG_VECT_PEEK_2_VALUE (0x7ffL<<16)
3144#define BNX2_TXP_CPU_DEBUG_VECT_PEEK_2_PEEK_EN (1L<<27)
3145#define BNX2_TXP_CPU_DEBUG_VECT_PEEK_2_SEL (0xfL<<28)
3146
3147#define BNX2_TXP_CPU_LAST_BRANCH_ADDR 0x00045048
3148#define BNX2_TXP_CPU_LAST_BRANCH_ADDR_TYPE (1L<<1)
3149#define BNX2_TXP_CPU_LAST_BRANCH_ADDR_TYPE_JUMP (0L<<1)
3150#define BNX2_TXP_CPU_LAST_BRANCH_ADDR_TYPE_BRANCH (1L<<1)
3151#define BNX2_TXP_CPU_LAST_BRANCH_ADDR_LBA (0x3fffffffL<<2)
3152
3153#define BNX2_TXP_CPU_REG_FILE 0x00045200
3154#define BNX2_TXP_FTQ_DATA 0x000453c0
3155#define BNX2_TXP_FTQ_CMD 0x000453f8
3156#define BNX2_TXP_FTQ_CMD_OFFSET (0x3ffL<<0)
3157#define BNX2_TXP_FTQ_CMD_WR_TOP (1L<<10)
3158#define BNX2_TXP_FTQ_CMD_WR_TOP_0 (0L<<10)
3159#define BNX2_TXP_FTQ_CMD_WR_TOP_1 (1L<<10)
3160#define BNX2_TXP_FTQ_CMD_SFT_RESET (1L<<25)
3161#define BNX2_TXP_FTQ_CMD_RD_DATA (1L<<26)
3162#define BNX2_TXP_FTQ_CMD_ADD_INTERVEN (1L<<27)
3163#define BNX2_TXP_FTQ_CMD_ADD_DATA (1L<<28)
3164#define BNX2_TXP_FTQ_CMD_INTERVENE_CLR (1L<<29)
3165#define BNX2_TXP_FTQ_CMD_POP (1L<<30)
3166#define BNX2_TXP_FTQ_CMD_BUSY (1L<<31)
3167
3168#define BNX2_TXP_FTQ_CTL 0x000453fc
3169#define BNX2_TXP_FTQ_CTL_INTERVENE (1L<<0)
3170#define BNX2_TXP_FTQ_CTL_OVERFLOW (1L<<1)
3171#define BNX2_TXP_FTQ_CTL_FORCE_INTERVENE (1L<<2)
3172#define BNX2_TXP_FTQ_CTL_MAX_DEPTH (0x3ffL<<12)
3173#define BNX2_TXP_FTQ_CTL_CUR_DEPTH (0x3ffL<<22)
3174
3175#define BNX2_TXP_SCRATCH 0x00060000
3176
3177
3178/*
3179 * tpat_reg definition
3180 * offset: 0x80000
3181 */
3182#define BNX2_TPAT_CPU_MODE 0x00085000
3183#define BNX2_TPAT_CPU_MODE_LOCAL_RST (1L<<0)
3184#define BNX2_TPAT_CPU_MODE_STEP_ENA (1L<<1)
3185#define BNX2_TPAT_CPU_MODE_PAGE_0_DATA_ENA (1L<<2)
3186#define BNX2_TPAT_CPU_MODE_PAGE_0_INST_ENA (1L<<3)
3187#define BNX2_TPAT_CPU_MODE_MSG_BIT1 (1L<<6)
3188#define BNX2_TPAT_CPU_MODE_INTERRUPT_ENA (1L<<7)
3189#define BNX2_TPAT_CPU_MODE_SOFT_HALT (1L<<10)
3190#define BNX2_TPAT_CPU_MODE_BAD_DATA_HALT_ENA (1L<<11)
3191#define BNX2_TPAT_CPU_MODE_BAD_INST_HALT_ENA (1L<<12)
3192#define BNX2_TPAT_CPU_MODE_FIO_ABORT_HALT_ENA (1L<<13)
3193#define BNX2_TPAT_CPU_MODE_SPAD_UNDERFLOW_HALT_ENA (1L<<15)
3194
3195#define BNX2_TPAT_CPU_STATE 0x00085004
3196#define BNX2_TPAT_CPU_STATE_BREAKPOINT (1L<<0)
3197#define BNX2_TPAT_CPU_STATE_BAD_INST_HALTED (1L<<2)
3198#define BNX2_TPAT_CPU_STATE_PAGE_0_DATA_HALTED (1L<<3)
3199#define BNX2_TPAT_CPU_STATE_PAGE_0_INST_HALTED (1L<<4)
3200#define BNX2_TPAT_CPU_STATE_BAD_DATA_ADDR_HALTED (1L<<5)
3201#define BNX2_TPAT_CPU_STATE_BAD_pc_HALTED (1L<<6)
3202#define BNX2_TPAT_CPU_STATE_ALIGN_HALTED (1L<<7)
3203#define BNX2_TPAT_CPU_STATE_FIO_ABORT_HALTED (1L<<8)
3204#define BNX2_TPAT_CPU_STATE_SOFT_HALTED (1L<<10)
3205#define BNX2_TPAT_CPU_STATE_SPAD_UNDERFLOW (1L<<11)
3206#define BNX2_TPAT_CPU_STATE_INTERRRUPT (1L<<12)
3207#define BNX2_TPAT_CPU_STATE_DATA_ACCESS_STALL (1L<<14)
3208#define BNX2_TPAT_CPU_STATE_INST_FETCH_STALL (1L<<15)
3209#define BNX2_TPAT_CPU_STATE_BLOCKED_READ (1L<<31)
3210
3211#define BNX2_TPAT_CPU_EVENT_MASK 0x00085008
3212#define BNX2_TPAT_CPU_EVENT_MASK_BREAKPOINT_MASK (1L<<0)
3213#define BNX2_TPAT_CPU_EVENT_MASK_BAD_INST_HALTED_MASK (1L<<2)
3214#define BNX2_TPAT_CPU_EVENT_MASK_PAGE_0_DATA_HALTED_MASK (1L<<3)
3215#define BNX2_TPAT_CPU_EVENT_MASK_PAGE_0_INST_HALTED_MASK (1L<<4)
3216#define BNX2_TPAT_CPU_EVENT_MASK_BAD_DATA_ADDR_HALTED_MASK (1L<<5)
3217#define BNX2_TPAT_CPU_EVENT_MASK_BAD_PC_HALTED_MASK (1L<<6)
3218#define BNX2_TPAT_CPU_EVENT_MASK_ALIGN_HALTED_MASK (1L<<7)
3219#define BNX2_TPAT_CPU_EVENT_MASK_FIO_ABORT_MASK (1L<<8)
3220#define BNX2_TPAT_CPU_EVENT_MASK_SOFT_HALTED_MASK (1L<<10)
3221#define BNX2_TPAT_CPU_EVENT_MASK_SPAD_UNDERFLOW_MASK (1L<<11)
3222#define BNX2_TPAT_CPU_EVENT_MASK_INTERRUPT_MASK (1L<<12)
3223
3224#define BNX2_TPAT_CPU_PROGRAM_COUNTER 0x0008501c
3225#define BNX2_TPAT_CPU_INSTRUCTION 0x00085020
3226#define BNX2_TPAT_CPU_DATA_ACCESS 0x00085024
3227#define BNX2_TPAT_CPU_INTERRUPT_ENABLE 0x00085028
3228#define BNX2_TPAT_CPU_INTERRUPT_VECTOR 0x0008502c
3229#define BNX2_TPAT_CPU_INTERRUPT_SAVED_PC 0x00085030
3230#define BNX2_TPAT_CPU_HW_BREAKPOINT 0x00085034
3231#define BNX2_TPAT_CPU_HW_BREAKPOINT_DISABLE (1L<<0)
3232#define BNX2_TPAT_CPU_HW_BREAKPOINT_ADDRESS (0x3fffffffL<<2)
3233
3234#define BNX2_TPAT_CPU_DEBUG_VECT_PEEK 0x00085038
3235#define BNX2_TPAT_CPU_DEBUG_VECT_PEEK_1_VALUE (0x7ffL<<0)
3236#define BNX2_TPAT_CPU_DEBUG_VECT_PEEK_1_PEEK_EN (1L<<11)
3237#define BNX2_TPAT_CPU_DEBUG_VECT_PEEK_1_SEL (0xfL<<12)
3238#define BNX2_TPAT_CPU_DEBUG_VECT_PEEK_2_VALUE (0x7ffL<<16)
3239#define BNX2_TPAT_CPU_DEBUG_VECT_PEEK_2_PEEK_EN (1L<<27)
3240#define BNX2_TPAT_CPU_DEBUG_VECT_PEEK_2_SEL (0xfL<<28)
3241
3242#define BNX2_TPAT_CPU_LAST_BRANCH_ADDR 0x00085048
3243#define BNX2_TPAT_CPU_LAST_BRANCH_ADDR_TYPE (1L<<1)
3244#define BNX2_TPAT_CPU_LAST_BRANCH_ADDR_TYPE_JUMP (0L<<1)
3245#define BNX2_TPAT_CPU_LAST_BRANCH_ADDR_TYPE_BRANCH (1L<<1)
3246#define BNX2_TPAT_CPU_LAST_BRANCH_ADDR_LBA (0x3fffffffL<<2)
3247
3248#define BNX2_TPAT_CPU_REG_FILE 0x00085200
3249#define BNX2_TPAT_FTQ_DATA 0x000853c0
3250#define BNX2_TPAT_FTQ_CMD 0x000853f8
3251#define BNX2_TPAT_FTQ_CMD_OFFSET (0x3ffL<<0)
3252#define BNX2_TPAT_FTQ_CMD_WR_TOP (1L<<10)
3253#define BNX2_TPAT_FTQ_CMD_WR_TOP_0 (0L<<10)
3254#define BNX2_TPAT_FTQ_CMD_WR_TOP_1 (1L<<10)
3255#define BNX2_TPAT_FTQ_CMD_SFT_RESET (1L<<25)
3256#define BNX2_TPAT_FTQ_CMD_RD_DATA (1L<<26)
3257#define BNX2_TPAT_FTQ_CMD_ADD_INTERVEN (1L<<27)
3258#define BNX2_TPAT_FTQ_CMD_ADD_DATA (1L<<28)
3259#define BNX2_TPAT_FTQ_CMD_INTERVENE_CLR (1L<<29)
3260#define BNX2_TPAT_FTQ_CMD_POP (1L<<30)
3261#define BNX2_TPAT_FTQ_CMD_BUSY (1L<<31)
3262
3263#define BNX2_TPAT_FTQ_CTL 0x000853fc
3264#define BNX2_TPAT_FTQ_CTL_INTERVENE (1L<<0)
3265#define BNX2_TPAT_FTQ_CTL_OVERFLOW (1L<<1)
3266#define BNX2_TPAT_FTQ_CTL_FORCE_INTERVENE (1L<<2)
3267#define BNX2_TPAT_FTQ_CTL_MAX_DEPTH (0x3ffL<<12)
3268#define BNX2_TPAT_FTQ_CTL_CUR_DEPTH (0x3ffL<<22)
3269
3270#define BNX2_TPAT_SCRATCH 0x000a0000
3271
3272
3273/*
3274 * rxp_reg definition
3275 * offset: 0xc0000
3276 */
3277#define BNX2_RXP_CPU_MODE 0x000c5000
3278#define BNX2_RXP_CPU_MODE_LOCAL_RST (1L<<0)
3279#define BNX2_RXP_CPU_MODE_STEP_ENA (1L<<1)
3280#define BNX2_RXP_CPU_MODE_PAGE_0_DATA_ENA (1L<<2)
3281#define BNX2_RXP_CPU_MODE_PAGE_0_INST_ENA (1L<<3)
3282#define BNX2_RXP_CPU_MODE_MSG_BIT1 (1L<<6)
3283#define BNX2_RXP_CPU_MODE_INTERRUPT_ENA (1L<<7)
3284#define BNX2_RXP_CPU_MODE_SOFT_HALT (1L<<10)
3285#define BNX2_RXP_CPU_MODE_BAD_DATA_HALT_ENA (1L<<11)
3286#define BNX2_RXP_CPU_MODE_BAD_INST_HALT_ENA (1L<<12)
3287#define BNX2_RXP_CPU_MODE_FIO_ABORT_HALT_ENA (1L<<13)
3288#define BNX2_RXP_CPU_MODE_SPAD_UNDERFLOW_HALT_ENA (1L<<15)
3289
3290#define BNX2_RXP_CPU_STATE 0x000c5004
3291#define BNX2_RXP_CPU_STATE_BREAKPOINT (1L<<0)
3292#define BNX2_RXP_CPU_STATE_BAD_INST_HALTED (1L<<2)
3293#define BNX2_RXP_CPU_STATE_PAGE_0_DATA_HALTED (1L<<3)
3294#define BNX2_RXP_CPU_STATE_PAGE_0_INST_HALTED (1L<<4)
3295#define BNX2_RXP_CPU_STATE_BAD_DATA_ADDR_HALTED (1L<<5)
3296#define BNX2_RXP_CPU_STATE_BAD_pc_HALTED (1L<<6)
3297#define BNX2_RXP_CPU_STATE_ALIGN_HALTED (1L<<7)
3298#define BNX2_RXP_CPU_STATE_FIO_ABORT_HALTED (1L<<8)
3299#define BNX2_RXP_CPU_STATE_SOFT_HALTED (1L<<10)
3300#define BNX2_RXP_CPU_STATE_SPAD_UNDERFLOW (1L<<11)
3301#define BNX2_RXP_CPU_STATE_INTERRRUPT (1L<<12)
3302#define BNX2_RXP_CPU_STATE_DATA_ACCESS_STALL (1L<<14)
3303#define BNX2_RXP_CPU_STATE_INST_FETCH_STALL (1L<<15)
3304#define BNX2_RXP_CPU_STATE_BLOCKED_READ (1L<<31)
3305
3306#define BNX2_RXP_CPU_EVENT_MASK 0x000c5008
3307#define BNX2_RXP_CPU_EVENT_MASK_BREAKPOINT_MASK (1L<<0)
3308#define BNX2_RXP_CPU_EVENT_MASK_BAD_INST_HALTED_MASK (1L<<2)
3309#define BNX2_RXP_CPU_EVENT_MASK_PAGE_0_DATA_HALTED_MASK (1L<<3)
3310#define BNX2_RXP_CPU_EVENT_MASK_PAGE_0_INST_HALTED_MASK (1L<<4)
3311#define BNX2_RXP_CPU_EVENT_MASK_BAD_DATA_ADDR_HALTED_MASK (1L<<5)
3312#define BNX2_RXP_CPU_EVENT_MASK_BAD_PC_HALTED_MASK (1L<<6)
3313#define BNX2_RXP_CPU_EVENT_MASK_ALIGN_HALTED_MASK (1L<<7)
3314#define BNX2_RXP_CPU_EVENT_MASK_FIO_ABORT_MASK (1L<<8)
3315#define BNX2_RXP_CPU_EVENT_MASK_SOFT_HALTED_MASK (1L<<10)
3316#define BNX2_RXP_CPU_EVENT_MASK_SPAD_UNDERFLOW_MASK (1L<<11)
3317#define BNX2_RXP_CPU_EVENT_MASK_INTERRUPT_MASK (1L<<12)
3318
3319#define BNX2_RXP_CPU_PROGRAM_COUNTER 0x000c501c
3320#define BNX2_RXP_CPU_INSTRUCTION 0x000c5020
3321#define BNX2_RXP_CPU_DATA_ACCESS 0x000c5024
3322#define BNX2_RXP_CPU_INTERRUPT_ENABLE 0x000c5028
3323#define BNX2_RXP_CPU_INTERRUPT_VECTOR 0x000c502c
3324#define BNX2_RXP_CPU_INTERRUPT_SAVED_PC 0x000c5030
3325#define BNX2_RXP_CPU_HW_BREAKPOINT 0x000c5034
3326#define BNX2_RXP_CPU_HW_BREAKPOINT_DISABLE (1L<<0)
3327#define BNX2_RXP_CPU_HW_BREAKPOINT_ADDRESS (0x3fffffffL<<2)
3328
3329#define BNX2_RXP_CPU_DEBUG_VECT_PEEK 0x000c5038
3330#define BNX2_RXP_CPU_DEBUG_VECT_PEEK_1_VALUE (0x7ffL<<0)
3331#define BNX2_RXP_CPU_DEBUG_VECT_PEEK_1_PEEK_EN (1L<<11)
3332#define BNX2_RXP_CPU_DEBUG_VECT_PEEK_1_SEL (0xfL<<12)
3333#define BNX2_RXP_CPU_DEBUG_VECT_PEEK_2_VALUE (0x7ffL<<16)
3334#define BNX2_RXP_CPU_DEBUG_VECT_PEEK_2_PEEK_EN (1L<<27)
3335#define BNX2_RXP_CPU_DEBUG_VECT_PEEK_2_SEL (0xfL<<28)
3336
3337#define BNX2_RXP_CPU_LAST_BRANCH_ADDR 0x000c5048
3338#define BNX2_RXP_CPU_LAST_BRANCH_ADDR_TYPE (1L<<1)
3339#define BNX2_RXP_CPU_LAST_BRANCH_ADDR_TYPE_JUMP (0L<<1)
3340#define BNX2_RXP_CPU_LAST_BRANCH_ADDR_TYPE_BRANCH (1L<<1)
3341#define BNX2_RXP_CPU_LAST_BRANCH_ADDR_LBA (0x3fffffffL<<2)
3342
3343#define BNX2_RXP_CPU_REG_FILE 0x000c5200
3344#define BNX2_RXP_CFTQ_DATA 0x000c5380
3345#define BNX2_RXP_CFTQ_CMD 0x000c53b8
3346#define BNX2_RXP_CFTQ_CMD_OFFSET (0x3ffL<<0)
3347#define BNX2_RXP_CFTQ_CMD_WR_TOP (1L<<10)
3348#define BNX2_RXP_CFTQ_CMD_WR_TOP_0 (0L<<10)
3349#define BNX2_RXP_CFTQ_CMD_WR_TOP_1 (1L<<10)
3350#define BNX2_RXP_CFTQ_CMD_SFT_RESET (1L<<25)
3351#define BNX2_RXP_CFTQ_CMD_RD_DATA (1L<<26)
3352#define BNX2_RXP_CFTQ_CMD_ADD_INTERVEN (1L<<27)
3353#define BNX2_RXP_CFTQ_CMD_ADD_DATA (1L<<28)
3354#define BNX2_RXP_CFTQ_CMD_INTERVENE_CLR (1L<<29)
3355#define BNX2_RXP_CFTQ_CMD_POP (1L<<30)
3356#define BNX2_RXP_CFTQ_CMD_BUSY (1L<<31)
3357
3358#define BNX2_RXP_CFTQ_CTL 0x000c53bc
3359#define BNX2_RXP_CFTQ_CTL_INTERVENE (1L<<0)
3360#define BNX2_RXP_CFTQ_CTL_OVERFLOW (1L<<1)
3361#define BNX2_RXP_CFTQ_CTL_FORCE_INTERVENE (1L<<2)
3362#define BNX2_RXP_CFTQ_CTL_MAX_DEPTH (0x3ffL<<12)
3363#define BNX2_RXP_CFTQ_CTL_CUR_DEPTH (0x3ffL<<22)
3364
3365#define BNX2_RXP_FTQ_DATA 0x000c53c0
3366#define BNX2_RXP_FTQ_CMD 0x000c53f8
3367#define BNX2_RXP_FTQ_CMD_OFFSET (0x3ffL<<0)
3368#define BNX2_RXP_FTQ_CMD_WR_TOP (1L<<10)
3369#define BNX2_RXP_FTQ_CMD_WR_TOP_0 (0L<<10)
3370#define BNX2_RXP_FTQ_CMD_WR_TOP_1 (1L<<10)
3371#define BNX2_RXP_FTQ_CMD_SFT_RESET (1L<<25)
3372#define BNX2_RXP_FTQ_CMD_RD_DATA (1L<<26)
3373#define BNX2_RXP_FTQ_CMD_ADD_INTERVEN (1L<<27)
3374#define BNX2_RXP_FTQ_CMD_ADD_DATA (1L<<28)
3375#define BNX2_RXP_FTQ_CMD_INTERVENE_CLR (1L<<29)
3376#define BNX2_RXP_FTQ_CMD_POP (1L<<30)
3377#define BNX2_RXP_FTQ_CMD_BUSY (1L<<31)
3378
3379#define BNX2_RXP_FTQ_CTL 0x000c53fc
3380#define BNX2_RXP_FTQ_CTL_INTERVENE (1L<<0)
3381#define BNX2_RXP_FTQ_CTL_OVERFLOW (1L<<1)
3382#define BNX2_RXP_FTQ_CTL_FORCE_INTERVENE (1L<<2)
3383#define BNX2_RXP_FTQ_CTL_MAX_DEPTH (0x3ffL<<12)
3384#define BNX2_RXP_FTQ_CTL_CUR_DEPTH (0x3ffL<<22)
3385
3386#define BNX2_RXP_SCRATCH 0x000e0000
3387
3388
3389/*
3390 * com_reg definition
3391 * offset: 0x100000
3392 */
3393#define BNX2_COM_CPU_MODE 0x00105000
3394#define BNX2_COM_CPU_MODE_LOCAL_RST (1L<<0)
3395#define BNX2_COM_CPU_MODE_STEP_ENA (1L<<1)
3396#define BNX2_COM_CPU_MODE_PAGE_0_DATA_ENA (1L<<2)
3397#define BNX2_COM_CPU_MODE_PAGE_0_INST_ENA (1L<<3)
3398#define BNX2_COM_CPU_MODE_MSG_BIT1 (1L<<6)
3399#define BNX2_COM_CPU_MODE_INTERRUPT_ENA (1L<<7)
3400#define BNX2_COM_CPU_MODE_SOFT_HALT (1L<<10)
3401#define BNX2_COM_CPU_MODE_BAD_DATA_HALT_ENA (1L<<11)
3402#define BNX2_COM_CPU_MODE_BAD_INST_HALT_ENA (1L<<12)
3403#define BNX2_COM_CPU_MODE_FIO_ABORT_HALT_ENA (1L<<13)
3404#define BNX2_COM_CPU_MODE_SPAD_UNDERFLOW_HALT_ENA (1L<<15)
3405
3406#define BNX2_COM_CPU_STATE 0x00105004
3407#define BNX2_COM_CPU_STATE_BREAKPOINT (1L<<0)
3408#define BNX2_COM_CPU_STATE_BAD_INST_HALTED (1L<<2)
3409#define BNX2_COM_CPU_STATE_PAGE_0_DATA_HALTED (1L<<3)
3410#define BNX2_COM_CPU_STATE_PAGE_0_INST_HALTED (1L<<4)
3411#define BNX2_COM_CPU_STATE_BAD_DATA_ADDR_HALTED (1L<<5)
3412#define BNX2_COM_CPU_STATE_BAD_pc_HALTED (1L<<6)
3413#define BNX2_COM_CPU_STATE_ALIGN_HALTED (1L<<7)
3414#define BNX2_COM_CPU_STATE_FIO_ABORT_HALTED (1L<<8)
3415#define BNX2_COM_CPU_STATE_SOFT_HALTED (1L<<10)
3416#define BNX2_COM_CPU_STATE_SPAD_UNDERFLOW (1L<<11)
3417#define BNX2_COM_CPU_STATE_INTERRRUPT (1L<<12)
3418#define BNX2_COM_CPU_STATE_DATA_ACCESS_STALL (1L<<14)
3419#define BNX2_COM_CPU_STATE_INST_FETCH_STALL (1L<<15)
3420#define BNX2_COM_CPU_STATE_BLOCKED_READ (1L<<31)
3421
3422#define BNX2_COM_CPU_EVENT_MASK 0x00105008
3423#define BNX2_COM_CPU_EVENT_MASK_BREAKPOINT_MASK (1L<<0)
3424#define BNX2_COM_CPU_EVENT_MASK_BAD_INST_HALTED_MASK (1L<<2)
3425#define BNX2_COM_CPU_EVENT_MASK_PAGE_0_DATA_HALTED_MASK (1L<<3)
3426#define BNX2_COM_CPU_EVENT_MASK_PAGE_0_INST_HALTED_MASK (1L<<4)
3427#define BNX2_COM_CPU_EVENT_MASK_BAD_DATA_ADDR_HALTED_MASK (1L<<5)
3428#define BNX2_COM_CPU_EVENT_MASK_BAD_PC_HALTED_MASK (1L<<6)
3429#define BNX2_COM_CPU_EVENT_MASK_ALIGN_HALTED_MASK (1L<<7)
3430#define BNX2_COM_CPU_EVENT_MASK_FIO_ABORT_MASK (1L<<8)
3431#define BNX2_COM_CPU_EVENT_MASK_SOFT_HALTED_MASK (1L<<10)
3432#define BNX2_COM_CPU_EVENT_MASK_SPAD_UNDERFLOW_MASK (1L<<11)
3433#define BNX2_COM_CPU_EVENT_MASK_INTERRUPT_MASK (1L<<12)
3434
3435#define BNX2_COM_CPU_PROGRAM_COUNTER 0x0010501c
3436#define BNX2_COM_CPU_INSTRUCTION 0x00105020
3437#define BNX2_COM_CPU_DATA_ACCESS 0x00105024
3438#define BNX2_COM_CPU_INTERRUPT_ENABLE 0x00105028
3439#define BNX2_COM_CPU_INTERRUPT_VECTOR 0x0010502c
3440#define BNX2_COM_CPU_INTERRUPT_SAVED_PC 0x00105030
3441#define BNX2_COM_CPU_HW_BREAKPOINT 0x00105034
3442#define BNX2_COM_CPU_HW_BREAKPOINT_DISABLE (1L<<0)
3443#define BNX2_COM_CPU_HW_BREAKPOINT_ADDRESS (0x3fffffffL<<2)
3444
3445#define BNX2_COM_CPU_DEBUG_VECT_PEEK 0x00105038
3446#define BNX2_COM_CPU_DEBUG_VECT_PEEK_1_VALUE (0x7ffL<<0)
3447#define BNX2_COM_CPU_DEBUG_VECT_PEEK_1_PEEK_EN (1L<<11)
3448#define BNX2_COM_CPU_DEBUG_VECT_PEEK_1_SEL (0xfL<<12)
3449#define BNX2_COM_CPU_DEBUG_VECT_PEEK_2_VALUE (0x7ffL<<16)
3450#define BNX2_COM_CPU_DEBUG_VECT_PEEK_2_PEEK_EN (1L<<27)
3451#define BNX2_COM_CPU_DEBUG_VECT_PEEK_2_SEL (0xfL<<28)
3452
3453#define BNX2_COM_CPU_LAST_BRANCH_ADDR 0x00105048
3454#define BNX2_COM_CPU_LAST_BRANCH_ADDR_TYPE (1L<<1)
3455#define BNX2_COM_CPU_LAST_BRANCH_ADDR_TYPE_JUMP (0L<<1)
3456#define BNX2_COM_CPU_LAST_BRANCH_ADDR_TYPE_BRANCH (1L<<1)
3457#define BNX2_COM_CPU_LAST_BRANCH_ADDR_LBA (0x3fffffffL<<2)
3458
3459#define BNX2_COM_CPU_REG_FILE 0x00105200
3460#define BNX2_COM_COMXQ_FTQ_DATA 0x00105340
3461#define BNX2_COM_COMXQ_FTQ_CMD 0x00105378
3462#define BNX2_COM_COMXQ_FTQ_CMD_OFFSET (0x3ffL<<0)
3463#define BNX2_COM_COMXQ_FTQ_CMD_WR_TOP (1L<<10)
3464#define BNX2_COM_COMXQ_FTQ_CMD_WR_TOP_0 (0L<<10)
3465#define BNX2_COM_COMXQ_FTQ_CMD_WR_TOP_1 (1L<<10)
3466#define BNX2_COM_COMXQ_FTQ_CMD_SFT_RESET (1L<<25)
3467#define BNX2_COM_COMXQ_FTQ_CMD_RD_DATA (1L<<26)
3468#define BNX2_COM_COMXQ_FTQ_CMD_ADD_INTERVEN (1L<<27)
3469#define BNX2_COM_COMXQ_FTQ_CMD_ADD_DATA (1L<<28)
3470#define BNX2_COM_COMXQ_FTQ_CMD_INTERVENE_CLR (1L<<29)
3471#define BNX2_COM_COMXQ_FTQ_CMD_POP (1L<<30)
3472#define BNX2_COM_COMXQ_FTQ_CMD_BUSY (1L<<31)
3473
3474#define BNX2_COM_COMXQ_FTQ_CTL 0x0010537c
3475#define BNX2_COM_COMXQ_FTQ_CTL_INTERVENE (1L<<0)
3476#define BNX2_COM_COMXQ_FTQ_CTL_OVERFLOW (1L<<1)
3477#define BNX2_COM_COMXQ_FTQ_CTL_FORCE_INTERVENE (1L<<2)
3478#define BNX2_COM_COMXQ_FTQ_CTL_MAX_DEPTH (0x3ffL<<12)
3479#define BNX2_COM_COMXQ_FTQ_CTL_CUR_DEPTH (0x3ffL<<22)
3480
3481#define BNX2_COM_COMTQ_FTQ_DATA 0x00105380
3482#define BNX2_COM_COMTQ_FTQ_CMD 0x001053b8
3483#define BNX2_COM_COMTQ_FTQ_CMD_OFFSET (0x3ffL<<0)
3484#define BNX2_COM_COMTQ_FTQ_CMD_WR_TOP (1L<<10)
3485#define BNX2_COM_COMTQ_FTQ_CMD_WR_TOP_0 (0L<<10)
3486#define BNX2_COM_COMTQ_FTQ_CMD_WR_TOP_1 (1L<<10)
3487#define BNX2_COM_COMTQ_FTQ_CMD_SFT_RESET (1L<<25)
3488#define BNX2_COM_COMTQ_FTQ_CMD_RD_DATA (1L<<26)
3489#define BNX2_COM_COMTQ_FTQ_CMD_ADD_INTERVEN (1L<<27)
3490#define BNX2_COM_COMTQ_FTQ_CMD_ADD_DATA (1L<<28)
3491#define BNX2_COM_COMTQ_FTQ_CMD_INTERVENE_CLR (1L<<29)
3492#define BNX2_COM_COMTQ_FTQ_CMD_POP (1L<<30)
3493#define BNX2_COM_COMTQ_FTQ_CMD_BUSY (1L<<31)
3494
3495#define BNX2_COM_COMTQ_FTQ_CTL 0x001053bc
3496#define BNX2_COM_COMTQ_FTQ_CTL_INTERVENE (1L<<0)
3497#define BNX2_COM_COMTQ_FTQ_CTL_OVERFLOW (1L<<1)
3498#define BNX2_COM_COMTQ_FTQ_CTL_FORCE_INTERVENE (1L<<2)
3499#define BNX2_COM_COMTQ_FTQ_CTL_MAX_DEPTH (0x3ffL<<12)
3500#define BNX2_COM_COMTQ_FTQ_CTL_CUR_DEPTH (0x3ffL<<22)
3501
3502#define BNX2_COM_COMQ_FTQ_DATA 0x001053c0
3503#define BNX2_COM_COMQ_FTQ_CMD 0x001053f8
3504#define BNX2_COM_COMQ_FTQ_CMD_OFFSET (0x3ffL<<0)
3505#define BNX2_COM_COMQ_FTQ_CMD_WR_TOP (1L<<10)
3506#define BNX2_COM_COMQ_FTQ_CMD_WR_TOP_0 (0L<<10)
3507#define BNX2_COM_COMQ_FTQ_CMD_WR_TOP_1 (1L<<10)
3508#define BNX2_COM_COMQ_FTQ_CMD_SFT_RESET (1L<<25)
3509#define BNX2_COM_COMQ_FTQ_CMD_RD_DATA (1L<<26)
3510#define BNX2_COM_COMQ_FTQ_CMD_ADD_INTERVEN (1L<<27)
3511#define BNX2_COM_COMQ_FTQ_CMD_ADD_DATA (1L<<28)
3512#define BNX2_COM_COMQ_FTQ_CMD_INTERVENE_CLR (1L<<29)
3513#define BNX2_COM_COMQ_FTQ_CMD_POP (1L<<30)
3514#define BNX2_COM_COMQ_FTQ_CMD_BUSY (1L<<31)
3515
3516#define BNX2_COM_COMQ_FTQ_CTL 0x001053fc
3517#define BNX2_COM_COMQ_FTQ_CTL_INTERVENE (1L<<0)
3518#define BNX2_COM_COMQ_FTQ_CTL_OVERFLOW (1L<<1)
3519#define BNX2_COM_COMQ_FTQ_CTL_FORCE_INTERVENE (1L<<2)
3520#define BNX2_COM_COMQ_FTQ_CTL_MAX_DEPTH (0x3ffL<<12)
3521#define BNX2_COM_COMQ_FTQ_CTL_CUR_DEPTH (0x3ffL<<22)
3522
3523#define BNX2_COM_SCRATCH 0x00120000
3524
3525
3526/*
3527 * cp_reg definition
3528 * offset: 0x180000
3529 */
3530#define BNX2_CP_CPU_MODE 0x00185000
3531#define BNX2_CP_CPU_MODE_LOCAL_RST (1L<<0)
3532#define BNX2_CP_CPU_MODE_STEP_ENA (1L<<1)
3533#define BNX2_CP_CPU_MODE_PAGE_0_DATA_ENA (1L<<2)
3534#define BNX2_CP_CPU_MODE_PAGE_0_INST_ENA (1L<<3)
3535#define BNX2_CP_CPU_MODE_MSG_BIT1 (1L<<6)
3536#define BNX2_CP_CPU_MODE_INTERRUPT_ENA (1L<<7)
3537#define BNX2_CP_CPU_MODE_SOFT_HALT (1L<<10)
3538#define BNX2_CP_CPU_MODE_BAD_DATA_HALT_ENA (1L<<11)
3539#define BNX2_CP_CPU_MODE_BAD_INST_HALT_ENA (1L<<12)
3540#define BNX2_CP_CPU_MODE_FIO_ABORT_HALT_ENA (1L<<13)
3541#define BNX2_CP_CPU_MODE_SPAD_UNDERFLOW_HALT_ENA (1L<<15)
3542
3543#define BNX2_CP_CPU_STATE 0x00185004
3544#define BNX2_CP_CPU_STATE_BREAKPOINT (1L<<0)
3545#define BNX2_CP_CPU_STATE_BAD_INST_HALTED (1L<<2)
3546#define BNX2_CP_CPU_STATE_PAGE_0_DATA_HALTED (1L<<3)
3547#define BNX2_CP_CPU_STATE_PAGE_0_INST_HALTED (1L<<4)
3548#define BNX2_CP_CPU_STATE_BAD_DATA_ADDR_HALTED (1L<<5)
3549#define BNX2_CP_CPU_STATE_BAD_pc_HALTED (1L<<6)
3550#define BNX2_CP_CPU_STATE_ALIGN_HALTED (1L<<7)
3551#define BNX2_CP_CPU_STATE_FIO_ABORT_HALTED (1L<<8)
3552#define BNX2_CP_CPU_STATE_SOFT_HALTED (1L<<10)
3553#define BNX2_CP_CPU_STATE_SPAD_UNDERFLOW (1L<<11)
3554#define BNX2_CP_CPU_STATE_INTERRRUPT (1L<<12)
3555#define BNX2_CP_CPU_STATE_DATA_ACCESS_STALL (1L<<14)
3556#define BNX2_CP_CPU_STATE_INST_FETCH_STALL (1L<<15)
3557#define BNX2_CP_CPU_STATE_BLOCKED_READ (1L<<31)
3558
3559#define BNX2_CP_CPU_EVENT_MASK 0x00185008
3560#define BNX2_CP_CPU_EVENT_MASK_BREAKPOINT_MASK (1L<<0)
3561#define BNX2_CP_CPU_EVENT_MASK_BAD_INST_HALTED_MASK (1L<<2)
3562#define BNX2_CP_CPU_EVENT_MASK_PAGE_0_DATA_HALTED_MASK (1L<<3)
3563#define BNX2_CP_CPU_EVENT_MASK_PAGE_0_INST_HALTED_MASK (1L<<4)
3564#define BNX2_CP_CPU_EVENT_MASK_BAD_DATA_ADDR_HALTED_MASK (1L<<5)
3565#define BNX2_CP_CPU_EVENT_MASK_BAD_PC_HALTED_MASK (1L<<6)
3566#define BNX2_CP_CPU_EVENT_MASK_ALIGN_HALTED_MASK (1L<<7)
3567#define BNX2_CP_CPU_EVENT_MASK_FIO_ABORT_MASK (1L<<8)
3568#define BNX2_CP_CPU_EVENT_MASK_SOFT_HALTED_MASK (1L<<10)
3569#define BNX2_CP_CPU_EVENT_MASK_SPAD_UNDERFLOW_MASK (1L<<11)
3570#define BNX2_CP_CPU_EVENT_MASK_INTERRUPT_MASK (1L<<12)
3571
3572#define BNX2_CP_CPU_PROGRAM_COUNTER 0x0018501c
3573#define BNX2_CP_CPU_INSTRUCTION 0x00185020
3574#define BNX2_CP_CPU_DATA_ACCESS 0x00185024
3575#define BNX2_CP_CPU_INTERRUPT_ENABLE 0x00185028
3576#define BNX2_CP_CPU_INTERRUPT_VECTOR 0x0018502c
3577#define BNX2_CP_CPU_INTERRUPT_SAVED_PC 0x00185030
3578#define BNX2_CP_CPU_HW_BREAKPOINT 0x00185034
3579#define BNX2_CP_CPU_HW_BREAKPOINT_DISABLE (1L<<0)
3580#define BNX2_CP_CPU_HW_BREAKPOINT_ADDRESS (0x3fffffffL<<2)
3581
3582#define BNX2_CP_CPU_DEBUG_VECT_PEEK 0x00185038
3583#define BNX2_CP_CPU_DEBUG_VECT_PEEK_1_VALUE (0x7ffL<<0)
3584#define BNX2_CP_CPU_DEBUG_VECT_PEEK_1_PEEK_EN (1L<<11)
3585#define BNX2_CP_CPU_DEBUG_VECT_PEEK_1_SEL (0xfL<<12)
3586#define BNX2_CP_CPU_DEBUG_VECT_PEEK_2_VALUE (0x7ffL<<16)
3587#define BNX2_CP_CPU_DEBUG_VECT_PEEK_2_PEEK_EN (1L<<27)
3588#define BNX2_CP_CPU_DEBUG_VECT_PEEK_2_SEL (0xfL<<28)
3589
3590#define BNX2_CP_CPU_LAST_BRANCH_ADDR 0x00185048
3591#define BNX2_CP_CPU_LAST_BRANCH_ADDR_TYPE (1L<<1)
3592#define BNX2_CP_CPU_LAST_BRANCH_ADDR_TYPE_JUMP (0L<<1)
3593#define BNX2_CP_CPU_LAST_BRANCH_ADDR_TYPE_BRANCH (1L<<1)
3594#define BNX2_CP_CPU_LAST_BRANCH_ADDR_LBA (0x3fffffffL<<2)
3595
3596#define BNX2_CP_CPU_REG_FILE 0x00185200
3597#define BNX2_CP_CPQ_FTQ_DATA 0x001853c0
3598#define BNX2_CP_CPQ_FTQ_CMD 0x001853f8
3599#define BNX2_CP_CPQ_FTQ_CMD_OFFSET (0x3ffL<<0)
3600#define BNX2_CP_CPQ_FTQ_CMD_WR_TOP (1L<<10)
3601#define BNX2_CP_CPQ_FTQ_CMD_WR_TOP_0 (0L<<10)
3602#define BNX2_CP_CPQ_FTQ_CMD_WR_TOP_1 (1L<<10)
3603#define BNX2_CP_CPQ_FTQ_CMD_SFT_RESET (1L<<25)
3604#define BNX2_CP_CPQ_FTQ_CMD_RD_DATA (1L<<26)
3605#define BNX2_CP_CPQ_FTQ_CMD_ADD_INTERVEN (1L<<27)
3606#define BNX2_CP_CPQ_FTQ_CMD_ADD_DATA (1L<<28)
3607#define BNX2_CP_CPQ_FTQ_CMD_INTERVENE_CLR (1L<<29)
3608#define BNX2_CP_CPQ_FTQ_CMD_POP (1L<<30)
3609#define BNX2_CP_CPQ_FTQ_CMD_BUSY (1L<<31)
3610
3611#define BNX2_CP_CPQ_FTQ_CTL 0x001853fc
3612#define BNX2_CP_CPQ_FTQ_CTL_INTERVENE (1L<<0)
3613#define BNX2_CP_CPQ_FTQ_CTL_OVERFLOW (1L<<1)
3614#define BNX2_CP_CPQ_FTQ_CTL_FORCE_INTERVENE (1L<<2)
3615#define BNX2_CP_CPQ_FTQ_CTL_MAX_DEPTH (0x3ffL<<12)
3616#define BNX2_CP_CPQ_FTQ_CTL_CUR_DEPTH (0x3ffL<<22)
3617
3618#define BNX2_CP_SCRATCH 0x001a0000
3619
3620
3621/*
3622 * mcp_reg definition
3623 * offset: 0x140000
3624 */
3625#define BNX2_MCP_CPU_MODE 0x00145000
3626#define BNX2_MCP_CPU_MODE_LOCAL_RST (1L<<0)
3627#define BNX2_MCP_CPU_MODE_STEP_ENA (1L<<1)
3628#define BNX2_MCP_CPU_MODE_PAGE_0_DATA_ENA (1L<<2)
3629#define BNX2_MCP_CPU_MODE_PAGE_0_INST_ENA (1L<<3)
3630#define BNX2_MCP_CPU_MODE_MSG_BIT1 (1L<<6)
3631#define BNX2_MCP_CPU_MODE_INTERRUPT_ENA (1L<<7)
3632#define BNX2_MCP_CPU_MODE_SOFT_HALT (1L<<10)
3633#define BNX2_MCP_CPU_MODE_BAD_DATA_HALT_ENA (1L<<11)
3634#define BNX2_MCP_CPU_MODE_BAD_INST_HALT_ENA (1L<<12)
3635#define BNX2_MCP_CPU_MODE_FIO_ABORT_HALT_ENA (1L<<13)
3636#define BNX2_MCP_CPU_MODE_SPAD_UNDERFLOW_HALT_ENA (1L<<15)
3637
3638#define BNX2_MCP_CPU_STATE 0x00145004
3639#define BNX2_MCP_CPU_STATE_BREAKPOINT (1L<<0)
3640#define BNX2_MCP_CPU_STATE_BAD_INST_HALTED (1L<<2)
3641#define BNX2_MCP_CPU_STATE_PAGE_0_DATA_HALTED (1L<<3)
3642#define BNX2_MCP_CPU_STATE_PAGE_0_INST_HALTED (1L<<4)
3643#define BNX2_MCP_CPU_STATE_BAD_DATA_ADDR_HALTED (1L<<5)
3644#define BNX2_MCP_CPU_STATE_BAD_pc_HALTED (1L<<6)
3645#define BNX2_MCP_CPU_STATE_ALIGN_HALTED (1L<<7)
3646#define BNX2_MCP_CPU_STATE_FIO_ABORT_HALTED (1L<<8)
3647#define BNX2_MCP_CPU_STATE_SOFT_HALTED (1L<<10)
3648#define BNX2_MCP_CPU_STATE_SPAD_UNDERFLOW (1L<<11)
3649#define BNX2_MCP_CPU_STATE_INTERRRUPT (1L<<12)
3650#define BNX2_MCP_CPU_STATE_DATA_ACCESS_STALL (1L<<14)
3651#define BNX2_MCP_CPU_STATE_INST_FETCH_STALL (1L<<15)
3652#define BNX2_MCP_CPU_STATE_BLOCKED_READ (1L<<31)
3653
3654#define BNX2_MCP_CPU_EVENT_MASK 0x00145008
3655#define BNX2_MCP_CPU_EVENT_MASK_BREAKPOINT_MASK (1L<<0)
3656#define BNX2_MCP_CPU_EVENT_MASK_BAD_INST_HALTED_MASK (1L<<2)
3657#define BNX2_MCP_CPU_EVENT_MASK_PAGE_0_DATA_HALTED_MASK (1L<<3)
3658#define BNX2_MCP_CPU_EVENT_MASK_PAGE_0_INST_HALTED_MASK (1L<<4)
3659#define BNX2_MCP_CPU_EVENT_MASK_BAD_DATA_ADDR_HALTED_MASK (1L<<5)
3660#define BNX2_MCP_CPU_EVENT_MASK_BAD_PC_HALTED_MASK (1L<<6)
3661#define BNX2_MCP_CPU_EVENT_MASK_ALIGN_HALTED_MASK (1L<<7)
3662#define BNX2_MCP_CPU_EVENT_MASK_FIO_ABORT_MASK (1L<<8)
3663#define BNX2_MCP_CPU_EVENT_MASK_SOFT_HALTED_MASK (1L<<10)
3664#define BNX2_MCP_CPU_EVENT_MASK_SPAD_UNDERFLOW_MASK (1L<<11)
3665#define BNX2_MCP_CPU_EVENT_MASK_INTERRUPT_MASK (1L<<12)
3666
3667#define BNX2_MCP_CPU_PROGRAM_COUNTER 0x0014501c
3668#define BNX2_MCP_CPU_INSTRUCTION 0x00145020
3669#define BNX2_MCP_CPU_DATA_ACCESS 0x00145024
3670#define BNX2_MCP_CPU_INTERRUPT_ENABLE 0x00145028
3671#define BNX2_MCP_CPU_INTERRUPT_VECTOR 0x0014502c
3672#define BNX2_MCP_CPU_INTERRUPT_SAVED_PC 0x00145030
3673#define BNX2_MCP_CPU_HW_BREAKPOINT 0x00145034
3674#define BNX2_MCP_CPU_HW_BREAKPOINT_DISABLE (1L<<0)
3675#define BNX2_MCP_CPU_HW_BREAKPOINT_ADDRESS (0x3fffffffL<<2)
3676
3677#define BNX2_MCP_CPU_DEBUG_VECT_PEEK 0x00145038
3678#define BNX2_MCP_CPU_DEBUG_VECT_PEEK_1_VALUE (0x7ffL<<0)
3679#define BNX2_MCP_CPU_DEBUG_VECT_PEEK_1_PEEK_EN (1L<<11)
3680#define BNX2_MCP_CPU_DEBUG_VECT_PEEK_1_SEL (0xfL<<12)
3681#define BNX2_MCP_CPU_DEBUG_VECT_PEEK_2_VALUE (0x7ffL<<16)
3682#define BNX2_MCP_CPU_DEBUG_VECT_PEEK_2_PEEK_EN (1L<<27)
3683#define BNX2_MCP_CPU_DEBUG_VECT_PEEK_2_SEL (0xfL<<28)
3684
3685#define BNX2_MCP_CPU_LAST_BRANCH_ADDR 0x00145048
3686#define BNX2_MCP_CPU_LAST_BRANCH_ADDR_TYPE (1L<<1)
3687#define BNX2_MCP_CPU_LAST_BRANCH_ADDR_TYPE_JUMP (0L<<1)
3688#define BNX2_MCP_CPU_LAST_BRANCH_ADDR_TYPE_BRANCH (1L<<1)
3689#define BNX2_MCP_CPU_LAST_BRANCH_ADDR_LBA (0x3fffffffL<<2)
3690
3691#define BNX2_MCP_CPU_REG_FILE 0x00145200
3692#define BNX2_MCP_MCPQ_FTQ_DATA 0x001453c0
3693#define BNX2_MCP_MCPQ_FTQ_CMD 0x001453f8
3694#define BNX2_MCP_MCPQ_FTQ_CMD_OFFSET (0x3ffL<<0)
3695#define BNX2_MCP_MCPQ_FTQ_CMD_WR_TOP (1L<<10)
3696#define BNX2_MCP_MCPQ_FTQ_CMD_WR_TOP_0 (0L<<10)
3697#define BNX2_MCP_MCPQ_FTQ_CMD_WR_TOP_1 (1L<<10)
3698#define BNX2_MCP_MCPQ_FTQ_CMD_SFT_RESET (1L<<25)
3699#define BNX2_MCP_MCPQ_FTQ_CMD_RD_DATA (1L<<26)
3700#define BNX2_MCP_MCPQ_FTQ_CMD_ADD_INTERVEN (1L<<27)
3701#define BNX2_MCP_MCPQ_FTQ_CMD_ADD_DATA (1L<<28)
3702#define BNX2_MCP_MCPQ_FTQ_CMD_INTERVENE_CLR (1L<<29)
3703#define BNX2_MCP_MCPQ_FTQ_CMD_POP (1L<<30)
3704#define BNX2_MCP_MCPQ_FTQ_CMD_BUSY (1L<<31)
3705
3706#define BNX2_MCP_MCPQ_FTQ_CTL 0x001453fc
3707#define BNX2_MCP_MCPQ_FTQ_CTL_INTERVENE (1L<<0)
3708#define BNX2_MCP_MCPQ_FTQ_CTL_OVERFLOW (1L<<1)
3709#define BNX2_MCP_MCPQ_FTQ_CTL_FORCE_INTERVENE (1L<<2)
3710#define BNX2_MCP_MCPQ_FTQ_CTL_MAX_DEPTH (0x3ffL<<12)
3711#define BNX2_MCP_MCPQ_FTQ_CTL_CUR_DEPTH (0x3ffL<<22)
3712
3713#define BNX2_MCP_ROM 0x00150000
3714#define BNX2_MCP_SCRATCH 0x00160000
3715
3716
3717#define NUM_MC_HASH_REGISTERS 8
3718
3719
3720/* PHY_ID1: bits 31-16; PHY_ID2: bits 15-0. */
3721#define PHY_BCM5706_PHY_ID 0x00206160
3722
3723#define PHY_ID(id) ((id) & 0xfffffff0)
3724#define PHY_REV_ID(id) ((id) & 0xf)
3725
3726#define MIN_ETHERNET_PACKET_SIZE 60
3727#define MAX_ETHERNET_PACKET_SIZE 1514
3728#define MAX_ETHERNET_JUMBO_PACKET_SIZE 9014
3729
3730#define RX_COPY_THRESH 92
3731
3732#define DMA_READ_CHANS 5
3733#define DMA_WRITE_CHANS 3
3734
3735#define BCM_PAGE_BITS 12
3736#define BCM_PAGE_SIZE (1 << BCM_PAGE_BITS)
3737
3738#define TX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct tx_bd))
3739#define MAX_TX_DESC_CNT (TX_DESC_CNT - 1)
3740
3741#define RX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct rx_bd))
3742#define MAX_RX_DESC_CNT (RX_DESC_CNT - 1)
3743
3744#define NEXT_TX_BD(x) (((x) & (MAX_TX_DESC_CNT - 1)) == \
3745 (MAX_TX_DESC_CNT - 1)) ? \
3746 (x) + 2 : (x) + 1
3747
3748#define TX_RING_IDX(x) ((x) & MAX_TX_DESC_CNT)
3749
3750#define NEXT_RX_BD(x) (((x) & (MAX_RX_DESC_CNT - 1)) == \
3751 (MAX_RX_DESC_CNT - 1)) ? \
3752 (x) + 2 : (x) + 1
3753
3754#define RX_RING_IDX(x) ((x) & MAX_RX_DESC_CNT)
3755
3756
3757/* Context size. */
3758#define CTX_SHIFT 7
3759#define CTX_SIZE (1 << CTX_SHIFT)
3760#define CTX_MASK (CTX_SIZE - 1)
3761#define GET_CID_ADDR(_cid) ((_cid) << CTX_SHIFT)
3762#define GET_CID(_cid_addr) ((_cid_addr) >> CTX_SHIFT)
3763
3764#define PHY_CTX_SHIFT 6
3765#define PHY_CTX_SIZE (1 << PHY_CTX_SHIFT)
3766#define PHY_CTX_MASK (PHY_CTX_SIZE - 1)
3767#define GET_PCID_ADDR(_pcid) ((_pcid) << PHY_CTX_SHIFT)
3768#define GET_PCID(_pcid_addr) ((_pcid_addr) >> PHY_CTX_SHIFT)
3769
3770#define MB_KERNEL_CTX_SHIFT 8
3771#define MB_KERNEL_CTX_SIZE (1 << MB_KERNEL_CTX_SHIFT)
3772#define MB_KERNEL_CTX_MASK (MB_KERNEL_CTX_SIZE - 1)
3773#define MB_GET_CID_ADDR(_cid) (0x10000 + ((_cid) << MB_KERNEL_CTX_SHIFT))
3774
3775#define MAX_CID_CNT 0x4000
3776#define MAX_CID_ADDR (GET_CID_ADDR(MAX_CID_CNT))
3777#define INVALID_CID_ADDR 0xffffffff
3778
3779#define TX_CID 16
3780#define RX_CID 0
3781
3782#define MB_TX_CID_ADDR MB_GET_CID_ADDR(TX_CID)
3783#define MB_RX_CID_ADDR MB_GET_CID_ADDR(RX_CID)
3784
3785struct sw_bd {
3786 struct sk_buff *skb;
3787 DECLARE_PCI_UNMAP_ADDR(mapping)
3788};
3789
3790/* Buffered flash (Atmel: AT45DB011B) specific information */
3791#define SEEPROM_PAGE_BITS 2
3792#define SEEPROM_PHY_PAGE_SIZE (1 << SEEPROM_PAGE_BITS)
3793#define SEEPROM_BYTE_ADDR_MASK (SEEPROM_PHY_PAGE_SIZE-1)
3794#define SEEPROM_PAGE_SIZE 4
3795#define SEEPROM_TOTAL_SIZE 65536
3796
3797#define BUFFERED_FLASH_PAGE_BITS 9
3798#define BUFFERED_FLASH_PHY_PAGE_SIZE (1 << BUFFERED_FLASH_PAGE_BITS)
3799#define BUFFERED_FLASH_BYTE_ADDR_MASK (BUFFERED_FLASH_PHY_PAGE_SIZE-1)
3800#define BUFFERED_FLASH_PAGE_SIZE 264
3801#define BUFFERED_FLASH_TOTAL_SIZE 131072
3802
3803#define SAIFUN_FLASH_PAGE_BITS 8
3804#define SAIFUN_FLASH_PHY_PAGE_SIZE (1 << SAIFUN_FLASH_PAGE_BITS)
3805#define SAIFUN_FLASH_BYTE_ADDR_MASK (SAIFUN_FLASH_PHY_PAGE_SIZE-1)
3806#define SAIFUN_FLASH_PAGE_SIZE 256
3807#define SAIFUN_FLASH_BASE_TOTAL_SIZE 65536
3808
3809#define NVRAM_TIMEOUT_COUNT 30000
3810
3811
3812#define FLASH_STRAP_MASK (BNX2_NVM_CFG1_FLASH_MODE | \
3813 BNX2_NVM_CFG1_BUFFER_MODE | \
3814 BNX2_NVM_CFG1_PROTECT_MODE | \
3815 BNX2_NVM_CFG1_FLASH_SIZE)
3816
3817struct flash_spec {
3818 u32 strapping;
3819 u32 config1;
3820 u32 config2;
3821 u32 config3;
3822 u32 write1;
3823 u32 buffered;
3824 u32 page_bits;
3825 u32 page_size;
3826 u32 addr_mask;
3827 u32 total_size;
3828 u8 *name;
3829};
3830
3831struct bnx2 {
3832 /* Fields used in the tx and intr/napi performance paths are grouped */
3833 /* together in the beginning of the structure. */
3834 void __iomem *regview;
3835
3836 struct net_device *dev;
3837 struct pci_dev *pdev;
3838
3839 atomic_t intr_sem;
3840
3841 struct status_block *status_blk;
3842 u32 last_status_idx;
3843
3844 atomic_t tx_avail_bd;
3845 struct tx_bd *tx_desc_ring;
3846 struct sw_bd *tx_buf_ring;
3847 u32 tx_prod_bseq;
3848 u16 tx_prod;
3849 u16 tx_cons;
3850
3851#ifdef BCM_VLAN
3852 struct vlan_group *vlgrp;
3853#endif
3854
3855 u32 rx_offset;
3856 u32 rx_buf_use_size; /* useable size */
3857 u32 rx_buf_size; /* with alignment */
3858 struct rx_bd *rx_desc_ring;
3859 struct sw_bd *rx_buf_ring;
3860 u32 rx_prod_bseq;
3861 u16 rx_prod;
3862 u16 rx_cons;
3863
3864 u32 rx_csum;
3865
3866 /* Only used to synchronize netif_stop_queue/wake_queue when tx */
3867 /* ring is full */
3868 spinlock_t tx_lock;
3869
3870 /* End of fileds used in the performance code paths. */
3871
3872 char *name;
3873
3874 int timer_interval;
3875 struct timer_list timer;
3876 struct work_struct reset_task;
3877
3878 /* Used to synchronize phy accesses. */
3879 spinlock_t phy_lock;
3880
3881 u32 flags;
3882#define PCIX_FLAG 1
3883#define PCI_32BIT_FLAG 2
3884#define ONE_TDMA_FLAG 4 /* no longer used */
3885#define NO_WOL_FLAG 8
3886#define USING_DAC_FLAG 0x10
3887#define USING_MSI_FLAG 0x20
3888
3889 u32 phy_flags;
3890#define PHY_SERDES_FLAG 1
3891#define PHY_CRC_FIX_FLAG 2
3892#define PHY_PARALLEL_DETECT_FLAG 4
3893#define PHY_INT_MODE_MASK_FLAG 0x300
3894#define PHY_INT_MODE_AUTO_POLLING_FLAG 0x100
3895#define PHY_INT_MODE_LINK_READY_FLAG 0x200
3896
3897 u32 chip_id;
3898 /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */
3899#define CHIP_NUM(bp) (((bp)->chip_id) & 0xffff0000)
3900#define CHIP_NUM_5706 0x57060000
3901
3902#define CHIP_REV(bp) (((bp)->chip_id) & 0x0000f000)
3903#define CHIP_REV_Ax 0x00000000
3904#define CHIP_REV_Bx 0x00001000
3905#define CHIP_REV_Cx 0x00002000
3906
3907#define CHIP_METAL(bp) (((bp)->chip_id) & 0x00000ff0)
3908#define CHIP_BONDING(bp) (((bp)->chip_id) & 0x0000000f)
3909
3910#define CHIP_ID(bp) (((bp)->chip_id) & 0xfffffff0)
3911#define CHIP_ID_5706_A0 0x57060000
3912#define CHIP_ID_5706_A1 0x57060010
3913
3914#define CHIP_BOND_ID(bp) (((bp)->chip_id) & 0xf)
3915
3916/* A serdes chip will have the first bit of the bond id set. */
3917#define CHIP_BOND_ID_SERDES_BIT 0x01
3918
3919 u32 phy_addr;
3920 u32 phy_id;
3921
3922 u16 bus_speed_mhz;
3923 u8 wol;
3924
3925 u8 fw_timed_out;
3926
3927 u16 fw_wr_seq;
3928 u16 fw_drv_pulse_wr_seq;
3929
3930 int tx_ring_size;
3931 dma_addr_t tx_desc_mapping;
3932
3933
3934 int rx_ring_size;
3935 dma_addr_t rx_desc_mapping;
3936
3937 u16 tx_quick_cons_trip;
3938 u16 tx_quick_cons_trip_int;
3939 u16 rx_quick_cons_trip;
3940 u16 rx_quick_cons_trip_int;
3941 u16 comp_prod_trip;
3942 u16 comp_prod_trip_int;
3943 u16 tx_ticks;
3944 u16 tx_ticks_int;
3945 u16 com_ticks;
3946 u16 com_ticks_int;
3947 u16 cmd_ticks;
3948 u16 cmd_ticks_int;
3949 u16 rx_ticks;
3950 u16 rx_ticks_int;
3951
3952 u32 stats_ticks;
3953
3954 dma_addr_t status_blk_mapping;
3955
3956 struct statistics_block *stats_blk;
3957 dma_addr_t stats_blk_mapping;
3958
3959 u32 rx_mode;
3960
3961 u16 req_line_speed;
3962 u8 req_duplex;
3963
3964 u8 link_up;
3965
3966 u16 line_speed;
3967 u8 duplex;
3968 u8 flow_ctrl; /* actual flow ctrl settings */
3969 /* may be different from */
3970 /* req_flow_ctrl if autoneg */
3971#define FLOW_CTRL_TX 1
3972#define FLOW_CTRL_RX 2
3973
3974 u32 advertising;
3975
3976 u8 req_flow_ctrl; /* flow ctrl advertisement */
3977 /* settings or forced */
3978 /* settings */
3979 u8 autoneg;
3980#define AUTONEG_SPEED 1
3981#define AUTONEG_FLOW_CTRL 2
3982
3983 u8 loopback;
3984#define MAC_LOOPBACK 1
3985#define PHY_LOOPBACK 2
3986
3987 u8 serdes_an_pending;
3988#define SERDES_AN_TIMEOUT (2 * HZ)
3989
3990 u8 mac_addr[8];
3991
3992 u32 fw_ver;
3993
3994 int pm_cap;
3995 int pcix_cap;
3996
3997 struct net_device_stats net_stats;
3998
3999 struct flash_spec *flash_info;
4000};
4001
4002static u32 bnx2_reg_rd_ind(struct bnx2 *bp, u32 offset);
4003static void bnx2_reg_wr_ind(struct bnx2 *bp, u32 offset, u32 val);
4004
4005#define REG_RD(bp, offset) \
4006 readl(bp->regview + offset)
4007
4008#define REG_WR(bp, offset, val) \
4009 writel(val, bp->regview + offset)
4010
4011#define REG_WR16(bp, offset, val) \
4012 writew(val, bp->regview + offset)
4013
4014#define REG_RD_IND(bp, offset) \
4015 bnx2_reg_rd_ind(bp, offset)
4016
4017#define REG_WR_IND(bp, offset, val) \
4018 bnx2_reg_wr_ind(bp, offset, val)
4019
4020/* Indirect context access. Unlike the MBQ_WR, these macros will not
4021 * trigger a chip event. */
4022static void bnx2_ctx_wr(struct bnx2 *bp, u32 cid_addr, u32 offset, u32 val);
4023
4024#define CTX_WR(bp, cid_addr, offset, val) \
4025 bnx2_ctx_wr(bp, cid_addr, offset, val)
4026
4027struct cpu_reg {
4028 u32 mode;
4029 u32 mode_value_halt;
4030 u32 mode_value_sstep;
4031
4032 u32 state;
4033 u32 state_value_clear;
4034
4035 u32 gpr0;
4036 u32 evmask;
4037 u32 pc;
4038 u32 inst;
4039 u32 bp;
4040
4041 u32 spad_base;
4042
4043 u32 mips_view_base;
4044};
4045
4046struct fw_info {
4047 u32 ver_major;
4048 u32 ver_minor;
4049 u32 ver_fix;
4050
4051 u32 start_addr;
4052
4053 /* Text section. */
4054 u32 text_addr;
4055 u32 text_len;
4056 u32 text_index;
4057 u32 *text;
4058
4059 /* Data section. */
4060 u32 data_addr;
4061 u32 data_len;
4062 u32 data_index;
4063 u32 *data;
4064
4065 /* SBSS section. */
4066 u32 sbss_addr;
4067 u32 sbss_len;
4068 u32 sbss_index;
4069 u32 *sbss;
4070
4071 /* BSS section. */
4072 u32 bss_addr;
4073 u32 bss_len;
4074 u32 bss_index;
4075 u32 *bss;
4076
4077 /* Read-only section. */
4078 u32 rodata_addr;
4079 u32 rodata_len;
4080 u32 rodata_index;
4081 u32 *rodata;
4082};
4083
4084#define RV2P_PROC1 0
4085#define RV2P_PROC2 1
4086
4087
4088/* This value (in milliseconds) determines the frequency of the driver
4089 * issuing the PULSE message code. The firmware monitors this periodic
4090 * pulse to determine when to switch to an OS-absent mode. */
4091#define DRV_PULSE_PERIOD_MS 250
4092
4093/* This value (in milliseconds) determines how long the driver should
4094 * wait for an acknowledgement from the firmware before timing out. Once
4095 * the firmware has timed out, the driver will assume there is no firmware
4096 * running and there won't be any firmware-driver synchronization during a
4097 * driver reset. */
4098#define FW_ACK_TIME_OUT_MS 50
4099
4100
4101#define BNX2_DRV_RESET_SIGNATURE 0x00000000
4102#define BNX2_DRV_RESET_SIGNATURE_MAGIC 0x4841564b /* HAVK */
4103//#define DRV_RESET_SIGNATURE_MAGIC 0x47495352 /* RSIG */
4104
4105#define BNX2_DRV_MB 0x00000004
4106#define BNX2_DRV_MSG_CODE 0xff000000
4107#define BNX2_DRV_MSG_CODE_RESET 0x01000000
4108#define BNX2_DRV_MSG_CODE_UNLOAD 0x02000000
4109#define BNX2_DRV_MSG_CODE_SHUTDOWN 0x03000000
4110#define BNX2_DRV_MSG_CODE_SUSPEND_WOL 0x04000000
4111#define BNX2_DRV_MSG_CODE_FW_TIMEOUT 0x05000000
4112#define BNX2_DRV_MSG_CODE_PULSE 0x06000000
4113#define BNX2_DRV_MSG_CODE_DIAG 0x07000000
4114#define BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL 0x09000000
4115
4116#define BNX2_DRV_MSG_DATA 0x00ff0000
4117#define BNX2_DRV_MSG_DATA_WAIT0 0x00010000
4118#define BNX2_DRV_MSG_DATA_WAIT1 0x00020000
4119#define BNX2_DRV_MSG_DATA_WAIT2 0x00030000
4120#define BNX2_DRV_MSG_DATA_WAIT3 0x00040000
4121
4122#define BNX2_DRV_MSG_SEQ 0x0000ffff
4123
4124#define BNX2_FW_MB 0x00000008
4125#define BNX2_FW_MSG_ACK 0x0000ffff
4126#define BNX2_FW_MSG_STATUS_MASK 0x00ff0000
4127#define BNX2_FW_MSG_STATUS_OK 0x00000000
4128#define BNX2_FW_MSG_STATUS_FAILURE 0x00ff0000
4129
4130#define BNX2_LINK_STATUS 0x0000000c
4131
4132#define BNX2_DRV_PULSE_MB 0x00000010
4133#define BNX2_DRV_PULSE_SEQ_MASK 0x0000ffff
4134
4135/* Indicate to the firmware not to go into the
4136 * OS absent when it is not getting driver pulse.
4137 * This is used for debugging. */
4138#define BNX2_DRV_MSG_DATA_PULSE_CODE_ALWAYS_ALIVE 0x00010000
4139
4140#define BNX2_DEV_INFO_SIGNATURE 0x00000020
4141#define BNX2_DEV_INFO_SIGNATURE_MAGIC 0x44564900
4142#define BNX2_DEV_INFO_SIGNATURE_MAGIC_MASK 0xffffff00
4143#define BNX2_DEV_INFO_FEATURE_CFG_VALID 0x01
4144#define BNX2_DEV_INFO_SECONDARY_PORT 0x80
4145#define BNX2_DEV_INFO_DRV_ALWAYS_ALIVE 0x40
4146
4147#define BNX2_SHARED_HW_CFG_PART_NUM 0x00000024
4148
4149#define BNX2_SHARED_HW_CFG_POWER_DISSIPATED 0x00000034
4150#define BNX2_SHARED_HW_CFG_POWER_STATE_D3_MASK 0xff000000
4151#define BNX2_SHARED_HW_CFG_POWER_STATE_D2_MASK 0xff0000
4152#define BNX2_SHARED_HW_CFG_POWER_STATE_D1_MASK 0xff00
4153#define BNX2_SHARED_HW_CFG_POWER_STATE_D0_MASK 0xff
4154
4155#define BNX2_SHARED_HW_CFG POWER_CONSUMED 0x00000038
4156#define BNX2_SHARED_HW_CFG_CONFIG 0x0000003c
4157#define BNX2_SHARED_HW_CFG_DESIGN_NIC 0
4158#define BNX2_SHARED_HW_CFG_DESIGN_LOM 0x1
4159#define BNX2_SHARED_HW_CFG_PHY_COPPER 0
4160#define BNX2_SHARED_HW_CFG_PHY_FIBER 0x2
4161#define BNX2_SHARED_HW_CFG_LED_MODE_SHIFT_BITS 8
4162#define BNX2_SHARED_HW_CFG_LED_MODE_MASK 0x300
4163#define BNX2_SHARED_HW_CFG_LED_MODE_MAC 0
4164#define BNX2_SHARED_HW_CFG_LED_MODE_GPHY1 0x100
4165#define BNX2_SHARED_HW_CFG_LED_MODE_GPHY2 0x200
4166
4167#define BNX2_DEV_INFO_BC_REV 0x0000004c
4168
4169#define BNX2_PORT_HW_CFG_MAC_UPPER 0x00000050
4170#define BNX2_PORT_HW_CFG_UPPERMAC_MASK 0xffff
4171
4172#define BNX2_PORT_HW_CFG_MAC_LOWER 0x00000054
4173#define BNX2_PORT_HW_CFG_CONFIG 0x00000058
4174
4175#define BNX2_PORT_HW_CFG_IMD_MAC_A_UPPER 0x00000068
4176#define BNX2_PORT_HW_CFG_IMD_MAC_A_LOWER 0x0000006c
4177#define BNX2_PORT_HW_CFG_IMD_MAC_B_UPPER 0x00000070
4178#define BNX2_PORT_HW_CFG_IMD_MAC_B_LOWER 0x00000074
4179#define BNX2_PORT_HW_CFG_ISCSI_MAC_UPPER 0x00000078
4180#define BNX2_PORT_HW_CFG_ISCSI_MAC_LOWER 0x0000007c
4181
4182#define BNX2_DEV_INFO_PER_PORT_HW_CONFIG2 0x000000b4
4183
4184#define BNX2_DEV_INFO_FORMAT_REV 0x000000c4
4185#define BNX2_DEV_INFO_FORMAT_REV_MASK 0xff000000
4186#define BNX2_DEV_INFO_FORMAT_REV_ID ('A' << 24)
4187
4188#define BNX2_SHARED_FEATURE 0x000000c8
4189#define BNX2_SHARED_FEATURE_MASK 0xffffffff
4190
4191#define BNX2_PORT_FEATURE 0x000000d8
4192#define BNX2_PORT2_FEATURE 0x00000014c
4193#define BNX2_PORT_FEATURE_WOL_ENABLED 0x01000000
4194#define BNX2_PORT_FEATURE_MBA_ENABLED 0x02000000
4195#define BNX2_PORT_FEATURE_ASF_ENABLED 0x04000000
4196#define BNX2_PORT_FEATURE_IMD_ENABLED 0x08000000
4197#define BNX2_PORT_FEATURE_BAR1_SIZE_MASK 0xf
4198#define BNX2_PORT_FEATURE_BAR1_SIZE_DISABLED 0x0
4199#define BNX2_PORT_FEATURE_BAR1_SIZE_64K 0x1
4200#define BNX2_PORT_FEATURE_BAR1_SIZE_128K 0x2
4201#define BNX2_PORT_FEATURE_BAR1_SIZE_256K 0x3
4202#define BNX2_PORT_FEATURE_BAR1_SIZE_512K 0x4
4203#define BNX2_PORT_FEATURE_BAR1_SIZE_1M 0x5
4204#define BNX2_PORT_FEATURE_BAR1_SIZE_2M 0x6
4205#define BNX2_PORT_FEATURE_BAR1_SIZE_4M 0x7
4206#define BNX2_PORT_FEATURE_BAR1_SIZE_8M 0x8
4207#define BNX2_PORT_FEATURE_BAR1_SIZE_16M 0x9
4208#define BNX2_PORT_FEATURE_BAR1_SIZE_32M 0xa
4209#define BNX2_PORT_FEATURE_BAR1_SIZE_64M 0xb
4210#define BNX2_PORT_FEATURE_BAR1_SIZE_128M 0xc
4211#define BNX2_PORT_FEATURE_BAR1_SIZE_256M 0xd
4212#define BNX2_PORT_FEATURE_BAR1_SIZE_512M 0xe
4213#define BNX2_PORT_FEATURE_BAR1_SIZE_1G 0xf
4214
4215#define BNX2_PORT_FEATURE_WOL 0xdc
4216#define BNX2_PORT2_FEATURE_WOL 0x150
4217#define BNX2_PORT_FEATURE_WOL_DEFAULT_SHIFT_BITS 4
4218#define BNX2_PORT_FEATURE_WOL_DEFAULT_MASK 0x30
4219#define BNX2_PORT_FEATURE_WOL_DEFAULT_DISABLE 0
4220#define BNX2_PORT_FEATURE_WOL_DEFAULT_MAGIC 0x10
4221#define BNX2_PORT_FEATURE_WOL_DEFAULT_ACPI 0x20
4222#define BNX2_PORT_FEATURE_WOL_DEFAULT_MAGIC_AND_ACPI 0x30
4223#define BNX2_PORT_FEATURE_WOL_LINK_SPEED_MASK 0xf
4224#define BNX2_PORT_FEATURE_WOL_LINK_SPEED_AUTONEG 0
4225#define BNX2_PORT_FEATURE_WOL_LINK_SPEED_10HALF 1
4226#define BNX2_PORT_FEATURE_WOL_LINK_SPEED_10FULL 2
4227#define BNX2_PORT_FEATURE_WOL_LINK_SPEED_100HALF 3
4228#define BNX2_PORT_FEATURE_WOL_LINK_SPEED_100FULL 4
4229#define BNX2_PORT_FEATURE_WOL_LINK_SPEED_1000HALF 5
4230#define BNX2_PORT_FEATURE_WOL_LINK_SPEED_1000FULL 6
4231#define BNX2_PORT_FEATURE_WOL_AUTONEG_ADVERTISE_1000 0x40
4232#define BNX2_PORT_FEATURE_WOL_RESERVED_PAUSE_CAP 0x400
4233#define BNX2_PORT_FEATURE_WOL_RESERVED_ASYM_PAUSE_CAP 0x800
4234
4235#define BNX2_PORT_FEATURE_MBA 0xe0
4236#define BNX2_PORT2_FEATURE_MBA 0x154
4237#define BNX2_PORT_FEATURE_MBA_BOOT_AGENT_TYPE_SHIFT_BITS 0
4238#define BNX2_PORT_FEATURE_MBA_BOOT_AGENT_TYPE_MASK 0x3
4239#define BNX2_PORT_FEATURE_MBA_BOOT_AGENT_TYPE_PXE 0
4240#define BNX2_PORT_FEATURE_MBA_BOOT_AGENT_TYPE_RPL 1
4241#define BNX2_PORT_FEATURE_MBA_BOOT_AGENT_TYPE_BOOTP 2
4242#define BNX2_PORT_FEATURE_MBA_LINK_SPEED_SHIFT_BITS 2
4243#define BNX2_PORT_FEATURE_MBA_LINK_SPEED_MASK 0x3c
4244#define BNX2_PORT_FEATURE_MBA_LINK_SPEED_AUTONEG 0
4245#define BNX2_PORT_FEATURE_MBA_LINK_SPEED_10HALF 0x4
4246#define BNX2_PORT_FEATURE_MBA_LINK_SPEED_10FULL 0x8
4247#define BNX2_PORT_FEATURE_MBA_LINK_SPEED_100HALF 0xc
4248#define BNX2_PORT_FEATURE_MBA_LINK_SPEED_100FULL 0x10
4249#define BNX2_PORT_FEATURE_MBA_LINK_SPEED_1000HALF 0x14
4250#define BNX2_PORT_FEATURE_MBA_LINK_SPEED_1000FULL 0x18
4251#define BNX2_PORT_FEATURE_MBA_SETUP_PROMPT_ENABLE 0x40
4252#define BNX2_PORT_FEATURE_MBA_HOTKEY_CTRL_S 0
4253#define BNX2_PORT_FEATURE_MBA_HOTKEY_CTRL_B 0x80
4254#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_SHIFT_BITS 8
4255#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_MASK 0xff00
4256#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_DISABLED 0
4257#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_1K 0x100
4258#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_2K 0x200
4259#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_4K 0x300
4260#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_8K 0x400
4261#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_16K 0x500
4262#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_32K 0x600
4263#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_64K 0x700
4264#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_128K 0x800
4265#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_256K 0x900
4266#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_512K 0xa00
4267#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_1M 0xb00
4268#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_2M 0xc00
4269#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_4M 0xd00
4270#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_8M 0xe00
4271#define BNX2_PORT_FEATURE_MBA_EXP_ROM_SIZE_16M 0xf00
4272#define BNX2_PORT_FEATURE_MBA_MSG_TIMEOUT_SHIFT_BITS 16
4273#define BNX2_PORT_FEATURE_MBA_MSG_TIMEOUT_MASK 0xf0000
4274#define BNX2_PORT_FEATURE_MBA_BIOS_BOOTSTRAP_SHIFT_BITS 20
4275#define BNX2_PORT_FEATURE_MBA_BIOS_BOOTSTRAP_MASK 0x300000
4276#define BNX2_PORT_FEATURE_MBA_BIOS_BOOTSTRAP_AUTO 0
4277#define BNX2_PORT_FEATURE_MBA_BIOS_BOOTSTRAP_BBS 0x100000
4278#define BNX2_PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT18H 0x200000
4279#define BNX2_PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT19H 0x300000
4280
4281#define BNX2_PORT_FEATURE_IMD 0xe4
4282#define BNX2_PORT2_FEATURE_IMD 0x158
4283#define BNX2_PORT_FEATURE_IMD_LINK_OVERRIDE_DEFAULT 0
4284#define BNX2_PORT_FEATURE_IMD_LINK_OVERRIDE_ENABLE 1
4285
4286#define BNX2_PORT_FEATURE_VLAN 0xe8
4287#define BNX2_PORT2_FEATURE_VLAN 0x15c
4288#define BNX2_PORT_FEATURE_MBA_VLAN_TAG_MASK 0xffff
4289#define BNX2_PORT_FEATURE_MBA_VLAN_ENABLE 0x10000
4290
4291#define BNX2_BC_STATE_RESET_TYPE 0x000001c0
4292#define BNX2_BC_STATE_RESET_TYPE_SIG 0x00005254
4293#define BNX2_BC_STATE_RESET_TYPE_SIG_MASK 0x0000ffff
4294#define BNX2_BC_STATE_RESET_TYPE_NONE (BNX2_BC_STATE_RESET_TYPE_SIG | \
4295 0x00010000)
4296#define BNX2_BC_STATE_RESET_TYPE_PCI (BNX2_BC_STATE_RESET_TYPE_SIG | \
4297 0x00020000)
4298#define BNX2_BC_STATE_RESET_TYPE_VAUX (BNX2_BC_STATE_RESET_TYPE_SIG | \
4299 0x00030000)
4300#define BNX2_BC_STATE_RESET_TYPE_DRV_MASK DRV_MSG_CODE
4301#define BNX2_BC_STATE_RESET_TYPE_DRV_RESET (BNX2_BC_STATE_RESET_TYPE_SIG | \
4302 DRV_MSG_CODE_RESET)
4303#define BNX2_BC_STATE_RESET_TYPE_DRV_UNLOAD (BNX2_BC_STATE_RESET_TYPE_SIG | \
4304 DRV_MSG_CODE_UNLOAD)
4305#define BNX2_BC_STATE_RESET_TYPE_DRV_SHUTDOWN (BNX2_BC_STATE_RESET_TYPE_SIG | \
4306 DRV_MSG_CODE_SHUTDOWN)
4307#define BNX2_BC_STATE_RESET_TYPE_DRV_WOL (BNX2_BC_STATE_RESET_TYPE_SIG | \
4308 DRV_MSG_CODE_WOL)
4309#define BNX2_BC_STATE_RESET_TYPE_DRV_DIAG (BNX2_BC_STATE_RESET_TYPE_SIG | \
4310 DRV_MSG_CODE_DIAG)
4311#define BNX2_BC_STATE_RESET_TYPE_VALUE(msg) (BNX2_BC_STATE_RESET_TYPE_SIG | \
4312 (msg))
4313
4314#define BNX2_BC_STATE 0x000001c4
4315#define BNX2_BC_STATE_ERR_MASK 0x0000ff00
4316#define BNX2_BC_STATE_SIGN 0x42530000
4317#define BNX2_BC_STATE_SIGN_MASK 0xffff0000
4318#define BNX2_BC_STATE_BC1_START (BNX2_BC_STATE_SIGN | 0x1)
4319#define BNX2_BC_STATE_GET_NVM_CFG1 (BNX2_BC_STATE_SIGN | 0x2)
4320#define BNX2_BC_STATE_PROG_BAR (BNX2_BC_STATE_SIGN | 0x3)
4321#define BNX2_BC_STATE_INIT_VID (BNX2_BC_STATE_SIGN | 0x4)
4322#define BNX2_BC_STATE_GET_NVM_CFG2 (BNX2_BC_STATE_SIGN | 0x5)
4323#define BNX2_BC_STATE_APPLY_WKARND (BNX2_BC_STATE_SIGN | 0x6)
4324#define BNX2_BC_STATE_LOAD_BC2 (BNX2_BC_STATE_SIGN | 0x7)
4325#define BNX2_BC_STATE_GOING_BC2 (BNX2_BC_STATE_SIGN | 0x8)
4326#define BNX2_BC_STATE_GOING_DIAG (BNX2_BC_STATE_SIGN | 0x9)
4327#define BNX2_BC_STATE_RT_FINAL_INIT (BNX2_BC_STATE_SIGN | 0x81)
4328#define BNX2_BC_STATE_RT_WKARND (BNX2_BC_STATE_SIGN | 0x82)
4329#define BNX2_BC_STATE_RT_DRV_PULSE (BNX2_BC_STATE_SIGN | 0x83)
4330#define BNX2_BC_STATE_RT_FIOEVTS (BNX2_BC_STATE_SIGN | 0x84)
4331#define BNX2_BC_STATE_RT_DRV_CMD (BNX2_BC_STATE_SIGN | 0x85)
4332#define BNX2_BC_STATE_RT_LOW_POWER (BNX2_BC_STATE_SIGN | 0x86)
4333#define BNX2_BC_STATE_RT_SET_WOL (BNX2_BC_STATE_SIGN | 0x87)
4334#define BNX2_BC_STATE_RT_OTHER_FW (BNX2_BC_STATE_SIGN | 0x88)
4335#define BNX2_BC_STATE_RT_GOING_D3 (BNX2_BC_STATE_SIGN | 0x89)
4336#define BNX2_BC_STATE_ERR_BAD_VERSION (BNX2_BC_STATE_SIGN | 0x0100)
4337#define BNX2_BC_STATE_ERR_BAD_BC2_CRC (BNX2_BC_STATE_SIGN | 0x0200)
4338#define BNX2_BC_STATE_ERR_BC1_LOOP (BNX2_BC_STATE_SIGN | 0x0300)
4339#define BNX2_BC_STATE_ERR_UNKNOWN_CMD (BNX2_BC_STATE_SIGN | 0x0400)
4340#define BNX2_BC_STATE_ERR_DRV_DEAD (BNX2_BC_STATE_SIGN | 0x0500)
4341#define BNX2_BC_STATE_ERR_NO_RXP (BNX2_BC_STATE_SIGN | 0x0600)
4342#define BNX2_BC_STATE_ERR_TOO_MANY_RBUF (BNX2_BC_STATE_SIGN | 0x0700)
4343
4344#define BNX2_BC_STATE_DEBUG_CMD 0x1dc
4345#define BNX2_BC_STATE_BC_DBG_CMD_SIGNATURE 0x42440000
4346#define BNX2_BC_STATE_BC_DBG_CMD_SIGNATURE_MASK 0xffff0000
4347#define BNX2_BC_STATE_BC_DBG_CMD_LOOP_CNT_MASK 0xffff
4348#define BNX2_BC_STATE_BC_DBG_CMD_LOOP_INFINITE 0xffff
4349
4350#define HOST_VIEW_SHMEM_BASE 0x167c00
4351
4352#endif
diff --git a/drivers/net/bnx2_fw.h b/drivers/net/bnx2_fw.h
new file mode 100644
index 000000000000..35f3a2ae5ef1
--- /dev/null
+++ b/drivers/net/bnx2_fw.h
@@ -0,0 +1,2468 @@
1/* bnx2_fw.h: Broadcom NX2 network driver.
2 *
3 * Copyright (c) 2004, 2005 Broadcom Corporation
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, except as noted below.
8 *
9 * This file contains firmware data derived from proprietary unpublished
10 * source code, Copyright (c) 2004, 2005 Broadcom Corporation.
11 *
12 * Permission is hereby granted for the distribution of this firmware data
13 * in hexadecimal or equivalent format, provided this copyright notice is
14 * accompanying it.
15 */
16
17
18static int bnx2_COM_b06FwReleaseMajor = 0x0;
19static int bnx2_COM_b06FwReleaseMinor = 0x0;
20static int bnx2_COM_b06FwReleaseFix = 0x0;
21static u32 bnx2_COM_b06FwStartAddr = 0x080004a0;
22static u32 bnx2_COM_b06FwTextAddr = 0x08000000;
23static int bnx2_COM_b06FwTextLen = 0x4594;
24static u32 bnx2_COM_b06FwDataAddr = 0x080045e0;
25static int bnx2_COM_b06FwDataLen = 0x0;
26static u32 bnx2_COM_b06FwRodataAddr = 0x08004598;
27static int bnx2_COM_b06FwRodataLen = 0x18;
28static u32 bnx2_COM_b06FwBssAddr = 0x08004600;
29static int bnx2_COM_b06FwBssLen = 0x88;
30static u32 bnx2_COM_b06FwSbssAddr = 0x080045e0;
31static int bnx2_COM_b06FwSbssLen = 0x1c;
32static u32 bnx2_COM_b06FwText[(0x4594/4) + 1] = {
33 0x0a000128, 0x00000000, 0x00000000, 0x0000000d, 0x636f6d20, 0x302e362e,
34 0x39000000, 0x00060902, 0x00000000, 0x00000003, 0x00000014, 0x00000032,
35 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
36 0x00000010, 0x000003e8, 0x0000ea60, 0x00000001, 0x00000000, 0x00000000,
37 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
38 0x0000ffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
39 0x00000000, 0x00000000, 0x00000002, 0x00000020, 0x00000000, 0x00000000,
40 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
41 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
42 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
43 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
44 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
45 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
46 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
47 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
48 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
49 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
50 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
51 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
52 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
53 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
54 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
55 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
56 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
57 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
58 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
59 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
60 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
61 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
62 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
63 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
64 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
65 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
66 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
67 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
68 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
69 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
70 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
71 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
72 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
73 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
74 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
75 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
76 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
77 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
78 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
79 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
80 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
81 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
82 0x00000000, 0x00000000, 0x00000000, 0x10000003, 0x00000000, 0x0000000d,
83 0x0000000d, 0x3c020800, 0x244245e0, 0x3c030800, 0x24634688, 0xac400000,
84 0x0043202b, 0x1480fffd, 0x24420004, 0x3c1d0800, 0x37bd7ffc, 0x03a0f021,
85 0x3c100800, 0x261004a0, 0x3c1c0800, 0x279c45e0, 0x0e0001f2, 0x00000000,
86 0x0000000d, 0x27bdffe8, 0x3c1a8000, 0x3c020008, 0x0342d825, 0x3c036010,
87 0xafbf0010, 0x8c655000, 0x3c020800, 0x24470ac8, 0x3c040800, 0x24864600,
88 0x2402ff7f, 0x00a22824, 0x34a5380c, 0xac655000, 0x00002821, 0x24020037,
89 0x24030c80, 0xaf420008, 0xaf430024, 0xacc70000, 0x24a50001, 0x2ca20016,
90 0x1440fffc, 0x24c60004, 0x24844600, 0x3c020800, 0x24420ad4, 0x3c030800,
91 0x246309d4, 0xac820004, 0x3c020800, 0x24420618, 0x3c050800, 0x24a50ca0,
92 0xac82000c, 0x3c020800, 0x24423100, 0xac830008, 0x3c030800, 0x246325c8,
93 0xac820014, 0x3c020800, 0x24422b0c, 0xac830018, 0xac83001c, 0x3c030800,
94 0x24630adc, 0xac820024, 0x3c020800, 0x24423040, 0xac83002c, 0x3c030800,
95 0x24633060, 0xac820030, 0x3c020800, 0x24422f6c, 0xac830034, 0x3c030800,
96 0x24632c60, 0xac82003c, 0x3c020800, 0x24420b6c, 0xac850010, 0xac850020,
97 0xac830040, 0x0e000bd6, 0xac820050, 0x8fbf0010, 0x03e00008, 0x27bd0018,
98 0x27bdffe0, 0xafb00010, 0x27500100, 0xafbf0018, 0xafb10014, 0x9203000b,
99 0x24020003, 0x1462005b, 0x96110008, 0x32220001, 0x10400009, 0x27430080,
100 0x8e020000, 0x96040014, 0x000211c2, 0x00021040, 0x00621821, 0xa4640000,
101 0x0a0001cb, 0x3c020800, 0x3c020800, 0x8c430020, 0x1060002a, 0x3c030800,
102 0x0e001006, 0x00000000, 0x97420108, 0x8f850018, 0x9743010c, 0x3042003e,
103 0x00021400, 0x00621825, 0xaca30000, 0x8f840018, 0x8f420100, 0xac820004,
104 0x97430116, 0x9742010e, 0x8f840018, 0x00031c00, 0x00431025, 0xac820008,
105 0x97430110, 0x97440112, 0x8f850018, 0x00031c00, 0x00832025, 0xaca4000c,
106 0x97420114, 0x8f840018, 0x3042ffff, 0xac820010, 0x8f830018, 0xac600014,
107 0x8f820018, 0x3c030800, 0xac400018, 0x9462466e, 0x8f840018, 0x3c032000,
108 0x00431025, 0xac82001c, 0x0e001044, 0x24040001, 0x3c030800, 0x8c620040,
109 0x24420001, 0xac620040, 0x3c020800, 0x8c430044, 0x32240004, 0x24630001,
110 0x10800017, 0xac430044, 0x8f4202b8, 0x04430007, 0x8e020020, 0x3c040800,
111 0x8c830060, 0x24020001, 0x24630001, 0x0a0001ed, 0xac830060, 0x3c060800,
112 0x8cc4005c, 0xaf420280, 0x96030016, 0x00001021, 0xa7430284, 0x8e050004,
113 0x24840001, 0x3c031000, 0xaf450288, 0xaf4302b8, 0x0a0001ed, 0xacc4005c,
114 0x32220002, 0x0a0001ed, 0x0002102b, 0x3c026000, 0xac400808, 0x0000000d,
115 0x00001021, 0x8fbf0018, 0x8fb10014, 0x8fb00010, 0x03e00008, 0x27bd0020,
116 0x27bdffc8, 0xafbf0034, 0xafbe0030, 0xafb7002c, 0xafb60028, 0xafb50024,
117 0xafb40020, 0xafb3001c, 0xafb20018, 0xafb10014, 0x0e00013f, 0xafb00010,
118 0x24110020, 0x24150030, 0x2794000c, 0x27930008, 0x3c124000, 0x3c1e0800,
119 0x3c170800, 0x3c160800, 0x8f820004, 0x3c040800, 0x8c830020, 0x10430004,
120 0x00000000, 0xaf830004, 0x0e00110b, 0x00000000, 0x8f500000, 0x32020007,
121 0x1040fff5, 0x32020001, 0x1040002b, 0x32020002, 0x8f420100, 0xaf420020,
122 0x8f430104, 0xaf4300a8, 0x9342010b, 0x93630000, 0x306300ff, 0x10710005,
123 0x304400ff, 0x10750006, 0x2c820016, 0x0a000227, 0x00000000, 0xaf940000,
124 0x0a000228, 0x2c820016, 0xaf930000, 0x0a000228, 0x00000000, 0xaf800000,
125 0x14400005, 0x00041880, 0x0e0002b2, 0x00000000, 0x0a000234, 0x00000000,
126 0x3c020800, 0x24424600, 0x00621821, 0x8c620000, 0x0040f809, 0x00000000,
127 0x10400005, 0x8fc20034, 0x8f420104, 0x3c016020, 0xac220014, 0x8fc20034,
128 0xaf520138, 0x24420001, 0xafc20034, 0x32020002, 0x10400019, 0x32020004,
129 0x8f420140, 0xaf420020, 0x93630000, 0x306300ff, 0x10710005, 0x00000000,
130 0x10750006, 0x00000000, 0x0a000250, 0x00000000, 0xaf940000, 0x0a000251,
131 0x00000000, 0xaf930000, 0x0a000251, 0x00000000, 0xaf800000, 0x0e0008b9,
132 0x00000000, 0x8ee20038, 0xaf520178, 0x24420001, 0xaee20038, 0x32020004,
133 0x1040ffad, 0x00000000, 0x8f420180, 0xaf420020, 0x93630000, 0x306300ff,
134 0x10710005, 0x00000000, 0x10750006, 0x00000000, 0x0a00026a, 0x00000000,
135 0xaf940000, 0x0a00026b, 0x00000000, 0xaf930000, 0x0a00026b, 0x00000000,
136 0xaf800000, 0x93620000, 0x14510004, 0x8ec2003c, 0x0e000835, 0x00000000,
137 0x8ec2003c, 0xaf5201b8, 0x24420001, 0x0a000206, 0xaec2003c, 0x27bdffe8,
138 0xafbf0010, 0x97420108, 0x24033000, 0x30447000, 0x10830012, 0x28823001,
139 0x10400007, 0x24024000, 0x1080000b, 0x24022000, 0x1082001a, 0x24020001,
140 0x0a000299, 0x00000000, 0x1082000c, 0x24025000, 0x1082000e, 0x00000000,
141 0x0a000299, 0x00000000, 0x0000000d, 0x0a00029b, 0x00001021, 0x0e000300,
142 0x00000000, 0x0a00029b, 0x00001021, 0x0e00048f, 0x00000000, 0x0a00029b,
143 0x00001021, 0x0e000fdf, 0x00000000, 0x0a00029b, 0x00001021, 0x0000000d,
144 0x00001021, 0x8fbf0010, 0x03e00008, 0x27bd0018, 0x93620000, 0x24030020,
145 0x304400ff, 0x10830005, 0x24020030, 0x10820007, 0x00000000, 0x0a0002af,
146 0x00000000, 0x2782000c, 0xaf820000, 0x03e00008, 0x00000000, 0x27820008,
147 0xaf820000, 0x03e00008, 0x00000000, 0xaf800000, 0x03e00008, 0x00000000,
148 0x0000000d, 0x03e00008, 0x00001021, 0x03e00008, 0x00001021, 0x27440100,
149 0x94830008, 0x30620004, 0x10400017, 0x30620002, 0x8f4202b8, 0x04430007,
150 0x8c820020, 0x3c040800, 0x8c830060, 0x24020001, 0x24630001, 0x03e00008,
151 0xac830060, 0xaf420280, 0x94830016, 0x3c060800, 0xa7430284, 0x8c850004,
152 0x8cc4005c, 0x00001021, 0x3c031000, 0x24840001, 0xaf450288, 0xaf4302b8,
153 0x03e00008, 0xacc4005c, 0x14400003, 0x3c040800, 0x03e00008, 0x00001021,
154 0x8c830084, 0x24020001, 0x24630001, 0x03e00008, 0xac830084, 0x27450100,
155 0x3c040800, 0x8c820088, 0x94a3000c, 0x24420001, 0x007a1821, 0xac820088,
156 0x8ca40018, 0x90664000, 0xaf440038, 0x8ca2001c, 0x2403fff8, 0x00063600,
157 0x00431024, 0x34420004, 0x3c030005, 0xaf42003c, 0xaf430030, 0x00000000,
158 0x00000000, 0x00000000, 0xaf460404, 0x00000000, 0x00000000, 0x00000000,
159 0x3c020006, 0x34420001, 0xaf420030, 0x00000000, 0x00000000, 0x00000000,
160 0x8f420000, 0x30420010, 0x1040fffd, 0x00001021, 0x03e00008, 0x00000000,
161 0x3c020800, 0x8c430020, 0x27bdffe8, 0xafb00010, 0x27500100, 0x1060001e,
162 0xafbf0014, 0x0e001006, 0x00000000, 0x8f830018, 0x8e020018, 0xac620000,
163 0x8f840018, 0x9602000c, 0xac820004, 0x8f830018, 0xac600008, 0x8f820018,
164 0xac40000c, 0x8f830018, 0xac600010, 0x8f820018, 0xac400014, 0x8f840018,
165 0x3c026000, 0x8c434448, 0xac830018, 0x96020008, 0x3c030800, 0x9464466e,
166 0x8f850018, 0x00021400, 0x00441025, 0x24040001, 0x0e001044, 0xaca2001c,
167 0x8fbf0014, 0x8fb00010, 0x03e00008, 0x27bd0018, 0x27bdffc8, 0xafb3001c,
168 0x00009821, 0xafb7002c, 0x0000b821, 0xafbe0030, 0x0000f021, 0xafb50024,
169 0x27550100, 0xafbf0034, 0xafb60028, 0xafb40020, 0xafb20018, 0xafb10014,
170 0xafb00010, 0x96a20008, 0x8f540100, 0x8eb20018, 0x30420001, 0x10400037,
171 0x02a0b021, 0x8f630054, 0x2642ffff, 0x00431023, 0x18400006, 0x00000000,
172 0x0000000d, 0x00000000, 0x24000128, 0x0a000372, 0x00002021, 0x8f62004c,
173 0x02421023, 0x18400028, 0x00002021, 0x93650120, 0x93640121, 0x3c030800,
174 0x8c62008c, 0x308400ff, 0x24420001, 0x30a500ff, 0x00803821, 0x1485000b,
175 0xac62008c, 0x3c040800, 0x8c830090, 0x24630001, 0xac830090, 0x93620122,
176 0x30420001, 0x00021023, 0x30420005, 0x0a000372, 0x34440004, 0x27660100,
177 0x00041080, 0x00c21021, 0x8c430000, 0x02431823, 0x04600004, 0x24820001,
178 0x30440007, 0x1485fff9, 0x00041080, 0x10870007, 0x3c030800, 0xa3640121,
179 0x8c620094, 0x24040005, 0x24420001, 0x0a000372, 0xac620094, 0x24040004,
180 0x00809821, 0x9362003f, 0x304400ff, 0x38830016, 0x2c630001, 0x38820010,
181 0x2c420001, 0x00621825, 0x1460000c, 0x24020001, 0x38830008, 0x2c630001,
182 0x38820014, 0x2c420001, 0x00621825, 0x14600005, 0x24020001, 0x24020012,
183 0x14820002, 0x00001021, 0x24020001, 0x50400007, 0x8eb10020, 0x8ea20020,
184 0x8f630040, 0x00408821, 0x00431023, 0x5c400001, 0x8f710040, 0x9343010b,
185 0x24020004, 0x54620005, 0x36730080, 0x96a20008, 0x36730002, 0x24170001,
186 0x305e0020, 0x2402fffb, 0x02628024, 0x1200002a, 0x3c030800, 0x8c620030,
187 0x02021024, 0x10400026, 0x3c020800, 0x8c430020, 0x10600024, 0x32620004,
188 0x0e001006, 0x00000000, 0x8f830018, 0x8f420100, 0xac620000, 0x8f840018,
189 0x02201821, 0x32620002, 0xac900004, 0x8f840018, 0x50400001, 0x8ec30014,
190 0xac830008, 0x8f830018, 0x8ec20020, 0xac62000c, 0x8f840018, 0x8f620040,
191 0xac820010, 0x8f830018, 0x8ec20018, 0xac620014, 0x8f840018, 0x3c026000,
192 0x8c434448, 0x3c020800, 0xac830018, 0x9443466e, 0x8f840018, 0x3c024010,
193 0x00621825, 0xac83001c, 0x0e001044, 0x24040001, 0x32620004, 0x10400076,
194 0x00003821, 0x3c029000, 0x34420001, 0x3c038000, 0x02821025, 0xa360007c,
195 0xaf420020, 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000, 0x93620023,
196 0x30420080, 0x10400011, 0x00000000, 0x8f65005c, 0x8f63004c, 0x9764003c,
197 0x8f620064, 0x00a32823, 0x00852821, 0x00a2102b, 0x54400006, 0x3c023fff,
198 0x93620023, 0x3042007f, 0xa3620023, 0xaf720064, 0x3c023fff, 0x0a0003f1,
199 0x3442ffff, 0x8f62005c, 0x02421023, 0x04400011, 0x00000000, 0x8f65005c,
200 0x8f630064, 0x9764003c, 0x3c023fff, 0x3442ffff, 0xaf720064, 0x00a32823,
201 0x00852821, 0x0045102b, 0x10400004, 0x02451021, 0x3c053fff, 0x34a5ffff,
202 0x02451021, 0xaf62005c, 0x24070001, 0xaf72004c, 0x8f620054, 0x16420005,
203 0x00000000, 0x93620023, 0x30420040, 0x10400017, 0x24020001, 0x9762006a,
204 0x00022880, 0x50a00001, 0x24050001, 0x97630068, 0x93640081, 0x3c020800,
205 0x8c46004c, 0x00652821, 0x00852804, 0x00c5102b, 0x54400001, 0x00a03021,
206 0x3c020800, 0x8c440050, 0x00c4182b, 0x54600001, 0x00c02021, 0x8f420074,
207 0x2403fffe, 0x00832824, 0x00a21021, 0xaf62000c, 0x3c028000, 0x34420001,
208 0x02821025, 0xa3600081, 0xaf420020, 0x9363007e, 0x9362007a, 0x10620004,
209 0x00000000, 0x0e000f2a, 0x00000000, 0x00403821, 0x10e00017, 0x3c029000,
210 0x34420001, 0x02821025, 0xaf420020, 0x3c038000, 0x8f420020, 0x00431024,
211 0x1440fffd, 0x3c028000, 0x9363007d, 0x34420001, 0x3c048000, 0x02821025,
212 0xa363007d, 0xaf420020, 0x8f4201f8, 0x00441024, 0x1440fffd, 0x24020002,
213 0x3c031000, 0xaf5401c0, 0xa34201c4, 0xaf4301f8, 0x8ea30014, 0x8f620040,
214 0x14430003, 0x00431023, 0x0a000443, 0x00001021, 0x28420001, 0x10400034,
215 0x00000000, 0x8f620040, 0xaf630040, 0x9362003e, 0x30420001, 0x1440000b,
216 0x3c029000, 0x93620022, 0x24420001, 0xa3620022, 0x93630022, 0x3c020800,
217 0x8c440098, 0x0064182b, 0x1460001e, 0x3c020800, 0x3c029000, 0x34420001,
218 0x02821025, 0xaf420020, 0x3c038000, 0x8f420020, 0x00431024, 0x1440fffd,
219 0x00000000, 0x3c038000, 0x9362007d, 0x34630001, 0x3c048000, 0x02831825,
220 0x34420001, 0xa362007d, 0xaf430020, 0x8f4201f8, 0x00441024, 0x1440fffd,
221 0x24020002, 0x3c031000, 0xaf5401c0, 0xa34201c4, 0x24020001, 0xaf4301f8,
222 0xa7620012, 0x0a000476, 0xa3600022, 0x9743007a, 0x9444002a, 0x00641821,
223 0x3063fffe, 0xa7630012, 0x0e000b68, 0x00000000, 0x12e00003, 0x00000000,
224 0x0e000f27, 0x00000000, 0x53c00004, 0x96a20008, 0x0e000c10, 0x00000000,
225 0x96a20008, 0x8fbf0034, 0x8fbe0030, 0x8fb7002c, 0x8fb60028, 0x8fb50024,
226 0x8fb40020, 0x8fb3001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, 0x00021042,
227 0x30420001, 0x03e00008, 0x27bd0038, 0x27bdffe8, 0xafbf0010, 0x97420108,
228 0x2403000b, 0x304400ff, 0x1083004e, 0x2882000c, 0x10400011, 0x24020006,
229 0x1082003e, 0x28820007, 0x10400007, 0x28820008, 0x1080002b, 0x24020001,
230 0x1082002e, 0x3c026000, 0x0a000504, 0x00000000, 0x14400061, 0x2882000a,
231 0x1440002b, 0x00000000, 0x0a0004ec, 0x00000000, 0x2402001c, 0x1082004e,
232 0x2882001d, 0x1040000e, 0x24020019, 0x10820041, 0x2882001a, 0x10400005,
233 0x2402000e, 0x10820036, 0x00000000, 0x0a000504, 0x00000000, 0x2402001b,
234 0x1082003c, 0x00000000, 0x0a000504, 0x00000000, 0x240200c1, 0x10820040,
235 0x288200c2, 0x10400005, 0x24020080, 0x1082001f, 0x00000000, 0x0a000504,
236 0x00000000, 0x240200c2, 0x1082003b, 0x00000000, 0x0a000504, 0x00000000,
237 0x3c026000, 0x0e000c7d, 0xac400808, 0x0a000506, 0x8fbf0010, 0x8c444448,
238 0x3c030800, 0xac640064, 0x0e000c7d, 0x00000000, 0x3c026000, 0x8c444448,
239 0x3c030800, 0x0a000505, 0xac640068, 0x8f440100, 0x0e000508, 0x00000000,
240 0x3c026000, 0x8c444448, 0x3c030800, 0x0a000505, 0xac64006c, 0x0e000cab,
241 0x00000000, 0x0a000506, 0x8fbf0010, 0x8f440100, 0x0e000cd5, 0x00000000,
242 0x0a000506, 0x8fbf0010, 0x0e000d1c, 0x00000000, 0x0a000506, 0x8fbf0010,
243 0x0000000d, 0x0a000506, 0x8fbf0010, 0x0e0005d7, 0x00000000, 0x0a000506,
244 0x8fbf0010, 0x8f440100, 0x0e000d7e, 0x00000000, 0x0a000506, 0x8fbf0010,
245 0x0e000e95, 0x00000000, 0x0a000506, 0x8fbf0010, 0x0e000626, 0x00000000,
246 0x0a000506, 0x8fbf0010, 0x0e000b68, 0x00000000, 0x0a000506, 0x8fbf0010,
247 0x0000000d, 0x8fbf0010, 0x03e00008, 0x27bd0018, 0x27bdffe8, 0x3c029000,
248 0x34420001, 0xafb00010, 0x00808021, 0x02021025, 0x3c038000, 0xafbf0014,
249 0xaf420020, 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000, 0x93620005,
250 0x34420001, 0xa3620005, 0x8f63004c, 0x8f620054, 0x10620019, 0x3c028000,
251 0x9762006a, 0x00022880, 0x50a00001, 0x24050001, 0x97630068, 0x93640081,
252 0x3c020800, 0x8c46004c, 0x00652821, 0x00852804, 0x00c5102b, 0x54400001,
253 0x00a03021, 0x3c020800, 0x8c440050, 0x00c4182b, 0x54600001, 0x00c02021,
254 0x8f420074, 0x2403fffe, 0x00832824, 0x00a21021, 0xaf62000c, 0x3c028000,
255 0x34420001, 0x02021025, 0x0e000c7d, 0xaf420020, 0x3c029000, 0x34420001,
256 0x3c038000, 0x02021025, 0xaf420020, 0x8f420020, 0x00431024, 0x1440fffd,
257 0x3c028000, 0x9363007d, 0x34420001, 0x3c048000, 0x02021025, 0xa363007d,
258 0xaf420020, 0x8f4201f8, 0x00441024, 0x1440fffd, 0x8fbf0014, 0xaf5001c0,
259 0x8fb00010, 0x24020002, 0x3c031000, 0xa34201c4, 0xaf4301f8, 0x03e00008,
260 0x27bd0018, 0x27bdffd8, 0xafbf0020, 0xafb3001c, 0xafb20018, 0xafb10014,
261 0xafb00010, 0x93630005, 0x00809021, 0x24020030, 0x30630030, 0x14620072,
262 0x00a09821, 0x3c020800, 0x8c430020, 0x1060006c, 0x00000000, 0x0e001006,
263 0x00000000, 0x8f820018, 0xac520000, 0x9363003e, 0x9362003f, 0x8f840018,
264 0x00031a00, 0x00431025, 0xac820004, 0x93630081, 0x93620082, 0x8f850018,
265 0x00031e00, 0x00021400, 0x00621825, 0xaca30008, 0x8f840018, 0x8f620040,
266 0xac82000c, 0x8f830018, 0x8f620048, 0xac620010, 0x8f840018, 0x8f62004c,
267 0x3c110800, 0xac820014, 0x8f830018, 0x8f620050, 0x26304660, 0x00002021,
268 0xac620018, 0x9602000e, 0x8f850018, 0x3c03c00b, 0x00431025, 0x0e001044,
269 0xaca2001c, 0x8f830018, 0x8f620054, 0xac620000, 0x8f840018, 0x8f620058,
270 0xac820004, 0x8f830018, 0x8f62005c, 0xac620008, 0x8f840018, 0x8f620060,
271 0xac82000c, 0x8f850018, 0x8f620064, 0xaca20010, 0x97630068, 0x9762006a,
272 0x8f840018, 0x00031c00, 0x00431025, 0xac820014, 0x8f830018, 0x00002021,
273 0xac600018, 0x9602000e, 0x8f850018, 0x3c03c00c, 0x00431025, 0x0e001044,
274 0xaca2001c, 0x8f840018, 0x8f630018, 0xac830000, 0x936200c4, 0x30420002,
275 0x10400006, 0x00000000, 0x976200c8, 0x8f830018, 0x3042ffff, 0x0a0005b5,
276 0xac620004, 0x8f820018, 0xac400004, 0x8f830018, 0x8f62006c, 0xac620008,
277 0x8f840018, 0x8f6200dc, 0xac82000c, 0x8f830018, 0xac600010, 0x93620005,
278 0x8f830018, 0x00021600, 0x00531025, 0xac620014, 0x8f850018, 0x3c026000,
279 0x8c434448, 0x24040001, 0x26224660, 0xaca30018, 0x9443000e, 0x8f850018,
280 0x3c02400d, 0x00621825, 0x0e001044, 0xaca3001c, 0x0e000d48, 0x02402021,
281 0x8fbf0020, 0x8fb3001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, 0x03e00008,
282 0x27bd0028, 0x27bdffe0, 0xafb00010, 0x27500100, 0xafbf0018, 0xafb10014,
283 0x9603000c, 0x240200c1, 0x5462001d, 0x8e040000, 0x3c029000, 0x8f440100,
284 0x34420001, 0x3c038000, 0x00821025, 0xaf420020, 0x8f420020, 0x00431024,
285 0x1440fffd, 0x00000000, 0x3c038000, 0x9362007d, 0x34630001, 0x3c058000,
286 0x00831825, 0x34420004, 0xa362007d, 0xaf430020, 0x8f4201f8, 0x00451024,
287 0x1440fffd, 0x24020002, 0x3c031000, 0xaf4401c0, 0xa34201c4, 0xaf4301f8,
288 0x0a000622, 0x8fbf0018, 0x8f65004c, 0x24060001, 0x0e000db5, 0x2407049f,
289 0x3c020800, 0x8c430020, 0x9611000c, 0x1060001d, 0x8e100000, 0x0e001006,
290 0x00000000, 0x8f820018, 0xac500000, 0x8f840018, 0x00111400, 0xac820004,
291 0x8f830018, 0xac600008, 0x8f820018, 0xac40000c, 0x8f830018, 0xac600010,
292 0x8f840018, 0x240204a2, 0xac820014, 0x8f850018, 0x3c026000, 0x8c434448,
293 0x24040001, 0x3c020800, 0xaca30018, 0x9443466e, 0x8f850018, 0x3c024019,
294 0x00621825, 0x0e001044, 0xaca3001c, 0x8fbf0018, 0x8fb10014, 0x8fb00010,
295 0x03e00008, 0x27bd0020, 0x27bdffb0, 0xafb1002c, 0x27510100, 0xafbf004c,
296 0xafbe0048, 0xafb70044, 0xafb60040, 0xafb5003c, 0xafb40038, 0xafb30034,
297 0xafb20030, 0xafb00028, 0x8e350000, 0x9634000c, 0x3c026000, 0x8c434448,
298 0x0000f021, 0xaf630170, 0x8f620040, 0x8e230014, 0x0000b821, 0x00431023,
299 0x044001ec, 0x0000b021, 0x32820010, 0x1040002e, 0x3c026000, 0x9363003f,
300 0x9222000e, 0x10430006, 0x2402000c, 0x9223000f, 0x10620003, 0x24020014,
301 0x14620025, 0x3c026000, 0x32820004, 0x10400007, 0x241e0001, 0x8f620050,
302 0x24420001, 0xaf620050, 0x8f630054, 0x24630001, 0xaf630054, 0x32830102,
303 0x24020002, 0x5462000d, 0x9222000f, 0x8f620040, 0x24420001, 0xaf620040,
304 0x8f630048, 0x8f620040, 0x24630001, 0x54620005, 0x9222000f, 0x8f620048,
305 0x24420001, 0xaf620048, 0x9222000f, 0xa362003f, 0x9223000f, 0x24020012,
306 0x14620007, 0x3c026000, 0x3c030800, 0x8c620074, 0x24420001, 0x0e000f6e,
307 0xac620074, 0x3c026000, 0x8c434448, 0x32820040, 0xaf630174, 0x32830020,
308 0xafa30010, 0x32830080, 0xafa30014, 0x32830001, 0xafa3001c, 0x32830008,
309 0xafa30020, 0x32830100, 0x104000bb, 0xafa30018, 0x8e260010, 0x8f630054,
310 0x24c2ffff, 0x00431023, 0x18400006, 0x00000000, 0x0000000d, 0x00000000,
311 0x24000128, 0x0a0006b2, 0x00009021, 0x8f62004c, 0x00c21023, 0x18400028,
312 0x00009021, 0x93650120, 0x93640121, 0x3c030800, 0x8c62008c, 0x308400ff,
313 0x24420001, 0x30a500ff, 0x00804021, 0x1485000b, 0xac62008c, 0x3c040800,
314 0x8c830090, 0x24630001, 0xac830090, 0x93620122, 0x30420001, 0x00021023,
315 0x30420005, 0x0a0006b2, 0x34520004, 0x27670100, 0x00041080, 0x00e21021,
316 0x8c430000, 0x00c31823, 0x04600004, 0x24820001, 0x30440007, 0x1485fff9,
317 0x00041080, 0x10880007, 0x3c030800, 0xa3640121, 0x8c620094, 0x24120005,
318 0x24420001, 0x0a0006b2, 0xac620094, 0x24120004, 0x32420001, 0x10400020,
319 0x3c020800, 0x8c430020, 0x8e300000, 0x1060001c, 0x8e330010, 0x0e001006,
320 0x00000000, 0x8f820018, 0xac500000, 0x8f840018, 0x24020001, 0xac820004,
321 0x8f830018, 0xac600008, 0x8f820018, 0xac40000c, 0x8f830018, 0xac600010,
322 0x8f820018, 0xac530014, 0x8f850018, 0x3c026000, 0x8c434448, 0x24040001,
323 0x3c020800, 0xaca30018, 0x9443466e, 0x8f850018, 0x3c024010, 0x00621825,
324 0x0e001044, 0xaca3001c, 0x32420004, 0x10400060, 0x00003821, 0x3c029000,
325 0x8e260010, 0x34420001, 0x3c038000, 0x02a21025, 0xa360007c, 0xaf420020,
326 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000, 0x93620023, 0x30420080,
327 0x10400011, 0x00000000, 0x8f65005c, 0x8f63004c, 0x9764003c, 0x8f620064,
328 0x00a32823, 0x00852821, 0x00a2102b, 0x54400006, 0x3c023fff, 0x93620023,
329 0x3042007f, 0xa3620023, 0xaf660064, 0x3c023fff, 0x0a000702, 0x3442ffff,
330 0x8f62005c, 0x00c21023, 0x04400011, 0x00000000, 0x8f65005c, 0x8f630064,
331 0x9764003c, 0x3c023fff, 0x3442ffff, 0xaf660064, 0x00a32823, 0x00852821,
332 0x0045102b, 0x10400004, 0x00c51021, 0x3c053fff, 0x34a5ffff, 0x00c51021,
333 0xaf62005c, 0x24070001, 0xaf66004c, 0x8f620054, 0x14c20005, 0x00000000,
334 0x93620023, 0x30420040, 0x10400017, 0x24020001, 0x9762006a, 0x00022880,
335 0x50a00001, 0x24050001, 0x97630068, 0x93640081, 0x3c020800, 0x8c46004c,
336 0x00652821, 0x00852804, 0x00c5102b, 0x54400001, 0x00a03021, 0x3c020800,
337 0x8c440050, 0x00c4182b, 0x54600001, 0x00c02021, 0x8f420074, 0x2403fffe,
338 0x00832824, 0x00a21021, 0xaf62000c, 0x3c028000, 0x34420001, 0x02a21025,
339 0xa3600081, 0xaf420020, 0x9363007e, 0x9362007a, 0x10620005, 0x00e0b021,
340 0x0e000f2a, 0x00000000, 0x00403821, 0x00e0b021, 0x8fa20010, 0x10400008,
341 0x00000000, 0x8e220018, 0xaf620018, 0x8e23001c, 0xaf63001c, 0x8e220020,
342 0x24160001, 0xaf620058, 0x13c00036, 0x32820004, 0x10400035, 0x8fa30014,
343 0x93620023, 0x30420040, 0x10400031, 0x3c020800, 0x8c430020, 0x1060001c,
344 0x8e300000, 0x0e001006, 0x00000000, 0x8f820018, 0xac500000, 0x8f830018,
345 0xac600004, 0x8f820018, 0xac400008, 0x8f830018, 0xac60000c, 0x8f820018,
346 0xac400010, 0x8f830018, 0x24020587, 0xac620014, 0x8f850018, 0x3c026000,
347 0x8c434448, 0x24040001, 0x3c020800, 0xaca30018, 0x9443466e, 0x8f850018,
348 0x3c024019, 0x00621825, 0x0e001044, 0xaca3001c, 0x3c029000, 0x34420001,
349 0x02a21025, 0xaf420020, 0x3c038000, 0x8f420020, 0x00431024, 0x1440fffd,
350 0x24020001, 0xaf62000c, 0x93630023, 0x3c028000, 0x34420001, 0x02a21025,
351 0x306300bf, 0xa3630023, 0xaf420020, 0x8fa30014, 0x10600012, 0x8fa3001c,
352 0x9362007c, 0x24420001, 0xa362007c, 0x9363007e, 0x9362007a, 0x1462000b,
353 0x8fa3001c, 0x9362007c, 0x3c030800, 0x8c640024, 0x0044102b, 0x14400005,
354 0x8fa3001c, 0x0e000f2a, 0x00000000, 0x02c2b025, 0x8fa3001c, 0x3062ffff,
355 0x10400003, 0x32820200, 0x0a000793, 0x24170004, 0x10400003, 0x00000000,
356 0x24170040, 0x24160001, 0x13c0005d, 0x32820002, 0x1040005c, 0x8fa20020,
357 0x9222000a, 0x30420020, 0x10400033, 0x3c100800, 0x93620023, 0x30420040,
358 0x1040002f, 0x8e020020, 0x1040001e, 0x3c029000, 0x0e001006, 0x00000000,
359 0x8f820018, 0xac550000, 0x8f840018, 0x3c02008d, 0xac820004, 0x8f830018,
360 0xac600008, 0x8f820018, 0xac40000c, 0x8f830018, 0xac600010, 0x8f840018,
361 0x240205bf, 0xac820014, 0x8f850018, 0x3c026000, 0x8c434448, 0x24040001,
362 0x3c020800, 0xaca30018, 0x9443466e, 0x8f850018, 0x3c024019, 0x00621825,
363 0x0e001044, 0xaca3001c, 0x3c029000, 0x34420001, 0x02a21025, 0xaf420020,
364 0x3c038000, 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000, 0x93630023,
365 0x3c028000, 0x34420001, 0x02a21025, 0x306300bf, 0xa3630023, 0xaf420020,
366 0x8e020020, 0x10400023, 0x8fa20020, 0x0e001006, 0x00000000, 0x8f840018,
367 0x8e230000, 0xac830000, 0x9222000a, 0x8f830018, 0x00021600, 0xac620004,
368 0x8f840018, 0x8f620040, 0xac820008, 0x8f850018, 0x8f63004c, 0xaca3000c,
369 0x9362003f, 0x8f840018, 0x304200ff, 0xac820010, 0x8f830018, 0x3c026000,
370 0xac600014, 0x8f850018, 0x8c434448, 0x24040001, 0x3c020800, 0xaca30018,
371 0x9443466e, 0x8f850018, 0x3c02401a, 0x00621825, 0x0e001044, 0xaca3001c,
372 0x8fa20020, 0x1040000e, 0x8fa20018, 0x9222000a, 0xa3620082, 0x56e00005,
373 0x36f70008, 0x8fa30018, 0x10600004, 0x00000000, 0x36f70008, 0x0a000801,
374 0x24160001, 0x0e000de1, 0x02a02021, 0x8fa20018, 0x10400003, 0x00000000,
375 0x36f70010, 0x24160001, 0x12c00019, 0x3c029000, 0x34420001, 0x02a21025,
376 0xaf420020, 0x3c038000, 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000,
377 0x3c038000, 0x9362007d, 0x34630001, 0x3c048000, 0x02a31825, 0x02e21025,
378 0xa362007d, 0xaf430020, 0x8f4201f8, 0x00441024, 0x1440fffd, 0x24020002,
379 0x3c031000, 0xaf5501c0, 0xa34201c4, 0xaf4301f8, 0x9363003f, 0x24020012,
380 0x14620004, 0x3c026000, 0x0e000f6e, 0x00000000, 0x3c026000, 0x8c434448,
381 0xaf630178, 0x8fbf004c, 0x8fbe0048, 0x8fb70044, 0x8fb60040, 0x8fb5003c,
382 0x8fb40038, 0x8fb30034, 0x8fb20030, 0x8fb1002c, 0x8fb00028, 0x03e00008,
383 0x27bd0050, 0x27bdffe8, 0xafbf0014, 0xafb00010, 0x8f500180, 0x97420184,
384 0x30420200, 0x14400015, 0x00000000, 0x8f430188, 0x3c02ff00, 0x00621824,
385 0x3c020200, 0x10620031, 0x0043102b, 0x14400007, 0x3c020300, 0x1060000b,
386 0x3c020100, 0x1062000d, 0x00000000, 0x0a0008b4, 0x00000000, 0x10620027,
387 0x3c020400, 0x1062003e, 0x02002021, 0x0a0008b4, 0x00000000, 0x0e000e1e,
388 0x02002021, 0x0a0008b6, 0x8fbf0014, 0x93620005, 0x30420020, 0x1440005e,
389 0x8fbf0014, 0x3c029000, 0x34420001, 0x02021025, 0xaf420020, 0x3c038000,
390 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000, 0x93620005, 0x3c038000,
391 0x34630001, 0x02031825, 0x34420020, 0xa3620005, 0xaf430020, 0x93620005,
392 0x30420020, 0x14400003, 0x02002021, 0x0000000d, 0x02002021, 0x0e000553,
393 0x24055854, 0x0a0008b6, 0x8fbf0014, 0x93620005, 0x30420001, 0x1040003f,
394 0x3c029000, 0x34420001, 0x02021025, 0xaf420020, 0x3c038000, 0x8f420020,
395 0x00431024, 0x1440fffd, 0x00000000, 0x93620005, 0x3c048000, 0x3c030800,
396 0x304200fe, 0xa3620005, 0x8c620020, 0x34840001, 0x02042025, 0xaf440020,
397 0x1040002d, 0x8fbf0014, 0x0a000894, 0x00000000, 0x00002821, 0x00003021,
398 0x0e000f78, 0x240706a4, 0x3c020800, 0x8c430020, 0x10600023, 0x8fbf0014,
399 0x0e001006, 0x00000000, 0x8f820018, 0xac500000, 0x93630082, 0x9362003f,
400 0x8f840018, 0x00031a00, 0x00431025, 0xac820004, 0x8f830018, 0xac600008,
401 0x8f820018, 0xac40000c, 0x8f830018, 0xac600010, 0x8f820018, 0xac400014,
402 0x8f850018, 0x3c026000, 0x8c434448, 0x24040001, 0x3c020800, 0xaca30018,
403 0x9443466e, 0x8f850018, 0x3c02400a, 0x00621825, 0x0e001044, 0xaca3001c,
404 0x0a0008b6, 0x8fbf0014, 0x0000000d, 0x8fbf0014, 0x8fb00010, 0x03e00008,
405 0x27bd0018, 0x27bdffe8, 0xafbf0010, 0x93420148, 0x2444ffff, 0x2c830005,
406 0x10600047, 0x3c020800, 0x24424598, 0x00041880, 0x00621821, 0x8c640000,
407 0x00800008, 0x00000000, 0x8f430144, 0x8f62000c, 0x14620006, 0x24020001,
408 0xaf62000c, 0x0e000909, 0x00000000, 0x0a000907, 0x8fbf0010, 0x8f62000c,
409 0x0a000900, 0x00000000, 0x97630010, 0x8f420144, 0x14430006, 0x24020001,
410 0xa7620010, 0x0e000eeb, 0x00000000, 0x0a000907, 0x8fbf0010, 0x97620010,
411 0x0a000900, 0x00000000, 0x97630012, 0x8f420144, 0x14430006, 0x24020001,
412 0xa7620012, 0x0e000f06, 0x00000000, 0x0a000907, 0x8fbf0010, 0x97620012,
413 0x0a000900, 0x00000000, 0x97630014, 0x8f420144, 0x14430006, 0x24020001,
414 0xa7620014, 0x0e000f21, 0x00000000, 0x0a000907, 0x8fbf0010, 0x97620014,
415 0x0a000900, 0x00000000, 0x97630016, 0x8f420144, 0x14430006, 0x24020001,
416 0xa7620016, 0x0e000f24, 0x00000000, 0x0a000907, 0x8fbf0010, 0x97620016,
417 0x14400006, 0x8fbf0010, 0x3c030800, 0x8c620070, 0x24420001, 0xac620070,
418 0x8fbf0010, 0x03e00008, 0x27bd0018, 0x27bdffe8, 0xafbf0010, 0x93620081,
419 0x3c030800, 0x8c640048, 0x0044102b, 0x14400028, 0x3c029000, 0x8f460140,
420 0x34420001, 0x3c038000, 0x00c21025, 0xaf420020, 0x8f420020, 0x00431024,
421 0x1440fffd, 0x3c048000, 0x34840001, 0x3c059000, 0x34a50001, 0x3c078000,
422 0x24020012, 0x24030080, 0x00c42025, 0x00c52825, 0xa362003f, 0xa3630082,
423 0xaf440020, 0xaf450020, 0x8f420020, 0x00471024, 0x1440fffd, 0x3c038000,
424 0x9362007d, 0x34630001, 0x3c048000, 0x00c31825, 0x34420020, 0xa362007d,
425 0xaf430020, 0x8f4201f8, 0x00441024, 0x1440fffd, 0x24020002, 0x3c031000,
426 0x0a00096d, 0xaf4601c0, 0x93620081, 0x24420001, 0x0e000f2a, 0xa3620081,
427 0x9763006a, 0x00032880, 0x14a00002, 0x00403821, 0x24050001, 0x97630068,
428 0x93640081, 0x3c020800, 0x8c46004c, 0x00652821, 0x00852804, 0x00c5102b,
429 0x54400001, 0x00a03021, 0x3c020800, 0x8c440050, 0x00c4182b, 0x54600001,
430 0x00c02021, 0x8f420074, 0x2403fffe, 0x00832824, 0x00a21021, 0xaf62000c,
431 0x10e0001a, 0x3c029000, 0x8f440140, 0x34420001, 0x3c038000, 0x00821025,
432 0xaf420020, 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000, 0x3c038000,
433 0x9362007d, 0x34630001, 0x3c058000, 0x00831825, 0x34420004, 0xa362007d,
434 0xaf430020, 0x8f4201f8, 0x00451024, 0x1440fffd, 0x24020002, 0x3c031000,
435 0xaf4401c0, 0xa34201c4, 0xaf4301f8, 0x8fbf0010, 0x03e00008, 0x27bd0018,
436 0x27bdffd8, 0xafb3001c, 0x27530100, 0xafbf0024, 0xafb40020, 0xafb20018,
437 0xafb10014, 0xafb00010, 0x96620008, 0x3c140800, 0x8f520100, 0x30420001,
438 0x104000cf, 0x00000000, 0x8e700018, 0x8f630054, 0x2602ffff, 0x00431023,
439 0x18400006, 0x00000000, 0x0000000d, 0x00000000, 0x24000128, 0x0a0009b6,
440 0x00008821, 0x8f62004c, 0x02021023, 0x18400028, 0x00008821, 0x93650120,
441 0x93640121, 0x3c030800, 0x8c62008c, 0x308400ff, 0x24420001, 0x30a500ff,
442 0x00803821, 0x1485000b, 0xac62008c, 0x3c040800, 0x8c830090, 0x24630001,
443 0xac830090, 0x93620122, 0x30420001, 0x00021023, 0x30420005, 0x0a0009b6,
444 0x34510004, 0x27660100, 0x00041080, 0x00c21021, 0x8c430000, 0x02031823,
445 0x04600004, 0x24820001, 0x30440007, 0x1485fff9, 0x00041080, 0x10870007,
446 0x3c030800, 0xa3640121, 0x8c620094, 0x24110005, 0x24420001, 0x0a0009b6,
447 0xac620094, 0x24110004, 0x32220001, 0x1040001e, 0x8e820020, 0x1040001d,
448 0x32220004, 0x0e001006, 0x00000000, 0x8f820018, 0xac520000, 0x8f840018,
449 0x24020001, 0xac820004, 0x8f830018, 0xac600008, 0x8f820018, 0xac40000c,
450 0x8f830018, 0xac600010, 0x8f820018, 0xac500014, 0x8f850018, 0x3c026000,
451 0x8c434448, 0x24040001, 0x3c020800, 0xaca30018, 0x9443466e, 0x8f850018,
452 0x3c024010, 0x00621825, 0x0e001044, 0xaca3001c, 0x32220004, 0x10400076,
453 0x00003821, 0x3c029000, 0x34420001, 0x3c038000, 0x02421025, 0xa360007c,
454 0xaf420020, 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000, 0x93620023,
455 0x30420080, 0x10400011, 0x00000000, 0x8f65005c, 0x8f63004c, 0x9764003c,
456 0x8f620064, 0x00a32823, 0x00852821, 0x00a2102b, 0x54400006, 0x3c023fff,
457 0x93620023, 0x3042007f, 0xa3620023, 0xaf700064, 0x3c023fff, 0x0a000a03,
458 0x3442ffff, 0x8f62005c, 0x02021023, 0x04400011, 0x00000000, 0x8f65005c,
459 0x8f630064, 0x9764003c, 0x3c023fff, 0x3442ffff, 0xaf700064, 0x00a32823,
460 0x00852821, 0x0045102b, 0x10400004, 0x02051021, 0x3c053fff, 0x34a5ffff,
461 0x02051021, 0xaf62005c, 0x24070001, 0xaf70004c, 0x8f620054, 0x16020005,
462 0x00000000, 0x93620023, 0x30420040, 0x10400017, 0x24020001, 0x9762006a,
463 0x00022880, 0x50a00001, 0x24050001, 0x97630068, 0x93640081, 0x3c020800,
464 0x8c46004c, 0x00652821, 0x00852804, 0x00c5102b, 0x54400001, 0x00a03021,
465 0x3c020800, 0x8c440050, 0x00c4182b, 0x54600001, 0x00c02021, 0x8f420074,
466 0x2403fffe, 0x00832824, 0x00a21021, 0xaf62000c, 0x3c028000, 0x34420001,
467 0x02421025, 0xa3600081, 0xaf420020, 0x9363007e, 0x9362007a, 0x10620004,
468 0x00000000, 0x0e000f2a, 0x00000000, 0x00403821, 0x10e00017, 0x3c029000,
469 0x34420001, 0x02421025, 0xaf420020, 0x3c038000, 0x8f420020, 0x00431024,
470 0x1440fffd, 0x3c028000, 0x9363007d, 0x34420001, 0x3c048000, 0x02421025,
471 0xa363007d, 0xaf420020, 0x8f4201f8, 0x00441024, 0x1440fffd, 0x24020002,
472 0x3c031000, 0xaf5201c0, 0xa34201c4, 0xaf4301f8, 0x9342010b, 0x8e830020,
473 0x27500100, 0x38420006, 0x10600029, 0x2c510001, 0x0e001006, 0x00000000,
474 0x8f830018, 0x8e020000, 0xac620000, 0x8f840018, 0x96020008, 0xac820004,
475 0x8f830018, 0x8e020014, 0xac620008, 0x8f850018, 0x3c026000, 0x8c434448,
476 0xaca3000c, 0x8f840018, 0x96020012, 0xac820010, 0x8f850018, 0x8e030020,
477 0xaca30014, 0x9602000c, 0x9603000e, 0x8f840018, 0x00021400, 0x00431025,
478 0xac820018, 0x12200005, 0x3c020800, 0x9443466e, 0x8f840018, 0x0a000a78,
479 0x3c024013, 0x9443466e, 0x8f840018, 0x3c024014, 0x00621825, 0xac83001c,
480 0x0e001044, 0x24040001, 0x8e630014, 0x8f620040, 0x14430003, 0x00431023,
481 0x0a000a83, 0x00001021, 0x28420001, 0x10400034, 0x00000000, 0x8f620040,
482 0xaf630040, 0x9362003e, 0x30420001, 0x1440000b, 0x3c029000, 0x93620022,
483 0x24420001, 0xa3620022, 0x93630022, 0x3c020800, 0x8c440098, 0x0064182b,
484 0x1460001e, 0x3c020800, 0x3c029000, 0x34420001, 0x02421025, 0xaf420020,
485 0x3c038000, 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000, 0x3c038000,
486 0x9362007d, 0x34630001, 0x3c048000, 0x02431825, 0x34420001, 0xa362007d,
487 0xaf430020, 0x8f4201f8, 0x00441024, 0x1440fffd, 0x24020002, 0x3c031000,
488 0xaf5201c0, 0xa34201c4, 0x24020001, 0xaf4301f8, 0xa7620012, 0x0a000ab6,
489 0xa3600022, 0x9743007a, 0x9444002a, 0x00641821, 0x3063fffe, 0xa7630012,
490 0x0e000b68, 0x00000000, 0x97420108, 0x8fbf0024, 0x8fb40020, 0x8fb3001c,
491 0x8fb20018, 0x8fb10014, 0x8fb00010, 0x00021042, 0x30420001, 0x03e00008,
492 0x27bd0028, 0x27bdffe0, 0xafb20018, 0x3c120800, 0x8e420020, 0xafb00010,
493 0x27500100, 0xafbf001c, 0x10400046, 0xafb10014, 0x0e001006, 0x00000000,
494 0x8f840018, 0x8e020000, 0xac820000, 0x936300b1, 0x936200c5, 0x8f850018,
495 0x00031e00, 0x00021400, 0x34420100, 0x00621825, 0xaca30004, 0x8f840018,
496 0x8e02001c, 0xac820008, 0x8f830018, 0x8f620048, 0xac62000c, 0x8f840018,
497 0x96020012, 0xac820010, 0x8f830018, 0x8f620040, 0x24040001, 0xac620014,
498 0x8f850018, 0x3c026000, 0x8c434448, 0x3c020800, 0x24514660, 0xaca30018,
499 0x9623000e, 0x8f850018, 0x3c024016, 0x00621825, 0x0e001044, 0xaca3001c,
500 0x96030008, 0x30630010, 0x1060001c, 0x8e420020, 0x1040001a, 0x8e100000,
501 0x0e001006, 0x00000000, 0x8f820018, 0xac500000, 0x8f830018, 0xac600004,
502 0x8f820018, 0xac400008, 0x8f830018, 0xac60000c, 0x8f820018, 0xac400010,
503 0x8f830018, 0xac600014, 0x8f850018, 0x3c036000, 0x8c634448, 0x24040001,
504 0xaca30018, 0x9622000e, 0x8f850018, 0x3c034015, 0x00431025, 0x0e001044,
505 0xaca2001c, 0x00001021, 0x8fbf001c, 0x8fb20018, 0x8fb10014, 0x8fb00010,
506 0x03e00008, 0x27bd0020, 0x27bdffe0, 0xafb20018, 0x3c120800, 0x8e420020,
507 0xafb00010, 0x27500100, 0xafbf001c, 0x10400041, 0xafb10014, 0x0e001006,
508 0x00000000, 0x8f830018, 0x8e020000, 0xac620000, 0x8f840018, 0x24020100,
509 0xac820004, 0x8f830018, 0x8e02001c, 0xac620008, 0x8f840018, 0x8e020018,
510 0xac82000c, 0x8f830018, 0x96020012, 0xac620010, 0x8f840018, 0x96020008,
511 0xac820014, 0x8f850018, 0x3c026000, 0x8c434448, 0x24040001, 0x3c020800,
512 0x24514660, 0xaca30018, 0x9623000e, 0x8f850018, 0x3c024017, 0x00621825,
513 0x0e001044, 0xaca3001c, 0x96030008, 0x30630010, 0x1060001c, 0x8e420020,
514 0x1040001a, 0x8e100000, 0x0e001006, 0x00000000, 0x8f820018, 0xac500000,
515 0x8f830018, 0xac600004, 0x8f820018, 0xac400008, 0x8f830018, 0xac60000c,
516 0x8f820018, 0xac400010, 0x8f830018, 0xac600014, 0x8f850018, 0x3c036000,
517 0x8c634448, 0x24040001, 0xaca30018, 0x9622000e, 0x8f850018, 0x3c034015,
518 0x00431025, 0x0e001044, 0xaca2001c, 0x00001021, 0x8fbf001c, 0x8fb20018,
519 0x8fb10014, 0x8fb00010, 0x03e00008, 0x27bd0020, 0x27bdffe8, 0xafbf0010,
520 0x936200c4, 0x30420002, 0x10400019, 0x00000000, 0x936200c5, 0x936300b1,
521 0x00431023, 0x304400ff, 0x30830080, 0x10600004, 0x00000000, 0x0000000d,
522 0x00000000, 0x24000a6a, 0x93620004, 0x00441023, 0x304400ff, 0x30830080,
523 0x10600004, 0x2482ffff, 0x8f650024, 0x0a000b82, 0x00000000, 0x00022b00,
524 0x8f620024, 0x0045102b, 0x10400002, 0x00000000, 0x8f650024, 0x8f620048,
525 0x8f630040, 0x00431823, 0x0065202b, 0x10800004, 0x00000000, 0x8f620040,
526 0x00451021, 0xaf620048, 0x9762003c, 0x0062102b, 0x10400041, 0x8fbf0010,
527 0x10a0003f, 0x3c029000, 0x34420001, 0x3c040800, 0x8c830080, 0x8f450100,
528 0x3c068000, 0x24630001, 0x00a21025, 0xac830080, 0xaf420020, 0x8f420020,
529 0x00461024, 0x1440fffd, 0x3c038000, 0x9362007d, 0x34630001, 0x3c048000,
530 0x00a31825, 0x34420004, 0xa362007d, 0xaf430020, 0x8f4201f8, 0x00441024,
531 0x1440fffd, 0x24020002, 0x3c030800, 0xaf4501c0, 0xa34201c4, 0x8c640020,
532 0x3c021000, 0xaf4201f8, 0x1080001f, 0x8fbf0010, 0x0e001006, 0x00000000,
533 0x8f830018, 0x8f420100, 0xac620000, 0x8f840018, 0x8f620040, 0xac820004,
534 0x8f850018, 0x8f620048, 0xaca20008, 0x8f830018, 0xac60000c, 0x8f820018,
535 0xac400010, 0x8f830018, 0x3c026000, 0xac600014, 0x8f840018, 0x8c434448,
536 0x3c020800, 0xac830018, 0x9443466e, 0x8f840018, 0x3c0240c2, 0x00621825,
537 0xac83001c, 0x0e001044, 0x24040001, 0x8fbf0010, 0x03e00008, 0x27bd0018,
538 0x3c020800, 0x24423958, 0xaf82000c, 0x03e00008, 0x00000000, 0x27bdffe8,
539 0xafb00010, 0x27500100, 0xafbf0014, 0x8e02001c, 0x14400003, 0x3c020800,
540 0x0000000d, 0x3c020800, 0x8c430020, 0x10600026, 0x00001021, 0x0e001006,
541 0x00000000, 0x8f830018, 0x8e020000, 0xac620000, 0x8f840018, 0x8e02001c,
542 0xac820004, 0x8f830018, 0xac600008, 0x8f840018, 0x8e020018, 0xac82000c,
543 0x8f850018, 0x96020012, 0xaca20010, 0x8f830018, 0x3c106000, 0xac600014,
544 0x8f840018, 0x8e024448, 0x3c030800, 0xac820018, 0x9462466e, 0x8f840018,
545 0x3c034012, 0x00431025, 0xac82001c, 0x0e001044, 0x24040001, 0x8e036800,
546 0x00001021, 0x3c040001, 0x00641825, 0xae036800, 0x0a000c0d, 0x8fbf0014,
547 0x8fbf0014, 0x8fb00010, 0x03e00008, 0x27bd0018, 0x3c020800, 0x97430078,
548 0x9444002e, 0x00001021, 0x00641821, 0x3063fffe, 0x03e00008, 0xa7630010,
549 0x27450100, 0x8f640048, 0x8ca30018, 0x00641023, 0x18400021, 0x00000000,
550 0xaf630048, 0x8f620040, 0x9763003c, 0x00821023, 0x0043102a, 0x1040001a,
551 0x3c029000, 0x8ca40000, 0x34420001, 0x3c038000, 0x00821025, 0xaf420020,
552 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000, 0x3c038000, 0x9362007d,
553 0x34630001, 0x3c058000, 0x00831825, 0x34420004, 0xa362007d, 0xaf430020,
554 0x8f4201f8, 0x00451024, 0x1440fffd, 0x24020002, 0x3c031000, 0xaf4401c0,
555 0xa34201c4, 0xaf4301f8, 0x03e00008, 0x00001021, 0x8f420100, 0x34420001,
556 0xaf4200a4, 0x03e00008, 0x00001021, 0x27bdffe0, 0xafbf0018, 0xafb10014,
557 0xafb00010, 0x9362007e, 0x30d000ff, 0x16020029, 0x00808821, 0x93620080,
558 0x16020026, 0x00000000, 0x9362007f, 0x16020023, 0x00000000, 0x9362007a,
559 0x16020004, 0x00000000, 0x0000000d, 0x00000000, 0x24000771, 0x0e000f49,
560 0x00000000, 0x3c039000, 0x34630001, 0x3c048000, 0x02231825, 0xa370007a,
561 0xaf430020, 0x8f420020, 0x00441024, 0x1440fffd, 0x3c028000, 0x9363007d,
562 0x34420001, 0x3c048000, 0x02221025, 0xa363007d, 0xaf420020, 0x8f4201f8,
563 0x00441024, 0x1440fffd, 0x24020002, 0x3c031000, 0xaf5101c0, 0xa34201c4,
564 0xaf4301f8, 0x0a000c79, 0x8fbf0018, 0x0000000d, 0x00000000, 0x24000781,
565 0x8fbf0018, 0x8fb10014, 0x8fb00010, 0x03e00008, 0x27bd0020, 0x3c020800,
566 0x8c430020, 0x27bdffe8, 0xafb00010, 0x27500100, 0x10600024, 0xafbf0014,
567 0x0e001006, 0x00000000, 0x8f830018, 0x8e020000, 0xac620000, 0x8f840018,
568 0x8e020004, 0xac820004, 0x8f830018, 0x8e020018, 0xac620008, 0x8f840018,
569 0x8e03001c, 0xac83000c, 0x9602000c, 0x9203000a, 0x8f840018, 0x00021400,
570 0x00431025, 0xac820010, 0x8f830018, 0x3c026000, 0xac600014, 0x8f840018,
571 0x8c434448, 0xac830018, 0x96020008, 0x3c030800, 0x9464466e, 0x8f850018,
572 0x00021400, 0x00441025, 0x24040001, 0x0e001044, 0xaca2001c, 0x8fbf0014,
573 0x8fb00010, 0x03e00008, 0x27bd0018, 0x3c020800, 0x8c430020, 0x27bdffe8,
574 0xafb00010, 0x27500100, 0x10600020, 0xafbf0014, 0x0e001006, 0x00000000,
575 0x8f820018, 0xac400000, 0x8f830018, 0xac600004, 0x8f820018, 0xac400008,
576 0x8f830018, 0xac60000c, 0x9602000c, 0x9603000e, 0x8f840018, 0x00021400,
577 0x00431025, 0xac820010, 0x8f830018, 0x3c026000, 0xac600014, 0x8f840018,
578 0x8c434448, 0xac830018, 0x96020008, 0x3c030800, 0x9464466e, 0x8f850018,
579 0x00021400, 0x00441025, 0x24040001, 0x0e001044, 0xaca2001c, 0x8fbf0014,
580 0x8fb00010, 0x03e00008, 0x27bd0018, 0x27bdffe8, 0xafb00010, 0x27500100,
581 0xafbf0014, 0x9602000c, 0x10400024, 0x00802821, 0x3c020800, 0x8c430020,
582 0x1060003a, 0x8fbf0014, 0x0e001006, 0x00000000, 0x8f840018, 0x8e030000,
583 0xac830000, 0x9602000c, 0x8f840018, 0x00021400, 0xac820004, 0x8f830018,
584 0xac600008, 0x8f820018, 0xac40000c, 0x8f830018, 0xac600010, 0x8f820018,
585 0xac400014, 0x8f850018, 0x3c026000, 0x8c434448, 0x24040001, 0x3c020800,
586 0xaca30018, 0x9443466e, 0x8f850018, 0x3c02400b, 0x00621825, 0x0e001044,
587 0xaca3001c, 0x0a000d19, 0x8fbf0014, 0x93620005, 0x30420010, 0x14400015,
588 0x3c029000, 0x34420001, 0x00a21025, 0xaf420020, 0x3c038000, 0x8f420020,
589 0x00431024, 0x1440fffd, 0x00000000, 0x3c038000, 0x93620005, 0x34630001,
590 0x00a02021, 0x00a31825, 0x24055852, 0x34420010, 0xa3620005, 0x0e000553,
591 0xaf430020, 0x0a000d19, 0x8fbf0014, 0x0000000d, 0x8fbf0014, 0x8fb00010,
592 0x03e00008, 0x27bd0018, 0x3c020800, 0x8c430020, 0x27bdffe8, 0xafb00010,
593 0x27500100, 0x10600022, 0xafbf0014, 0x0e001006, 0x00000000, 0x8f840018,
594 0x8e020004, 0xac820000, 0x9603000c, 0x9762002c, 0x8f840018, 0x00031c00,
595 0x00431025, 0xac820004, 0x8f830018, 0xac600008, 0x8f820018, 0xac40000c,
596 0x8f830018, 0xac600010, 0x8f820018, 0xac400014, 0x8f850018, 0x3c026000,
597 0x8c434448, 0x24040001, 0x3c020800, 0xaca30018, 0x9443466e, 0x8f850018,
598 0x3c02400e, 0x00621825, 0x0e001044, 0xaca3001c, 0x0e000d48, 0x8e040000,
599 0x8fbf0014, 0x8fb00010, 0x03e00008, 0x27bd0018, 0x3c038000, 0x8f420278,
600 0x00431024, 0x1440fffd, 0x24020002, 0x3c031000, 0xaf440240, 0xa3420244,
601 0x03e00008, 0xaf430278, 0x3c020800, 0x8c430020, 0x27bdffe0, 0xafb10014,
602 0x00808821, 0xafb20018, 0x00c09021, 0xafb00010, 0x30b0ffff, 0x1060001c,
603 0xafbf001c, 0x0e001006, 0x00000000, 0x8f820018, 0xac510000, 0x8f840018,
604 0x00101400, 0xac820004, 0x8f830018, 0xac600008, 0x8f820018, 0xac40000c,
605 0x8f830018, 0xac600010, 0x8f820018, 0xac520014, 0x8f840018, 0x3c026000,
606 0x8c434448, 0x3c020800, 0xac830018, 0x9443466e, 0x8f840018, 0x3c024019,
607 0x00621825, 0xac83001c, 0x0e001044, 0x24040001, 0x8fbf001c, 0x8fb20018,
608 0x8fb10014, 0x8fb00010, 0x03e00008, 0x27bd0020, 0x27bdffe8, 0x27450100,
609 0xafbf0010, 0x94a3000c, 0x240200c1, 0x14620029, 0x00803021, 0x3c029000,
610 0x34420001, 0x00c21025, 0xaf420020, 0x3c038000, 0x8f420020, 0x00431024,
611 0x1440fffd, 0x3c028000, 0x34420001, 0x3c049000, 0x34840001, 0x3c058000,
612 0x24030012, 0x00c21025, 0x00c42025, 0xa363003f, 0xaf420020, 0xaf440020,
613 0x8f420020, 0x00451024, 0x1440fffd, 0x3c038000, 0x9362007d, 0x34630001,
614 0x3c048000, 0x00c31825, 0x34420020, 0xa362007d, 0xaf430020, 0x8f4201f8,
615 0x00441024, 0x1440fffd, 0x24020002, 0x3c031000, 0xaf4601c0, 0xa34201c4,
616 0xaf4301f8, 0x0a000db3, 0x8fbf0010, 0x00c02021, 0x94a5000c, 0x24060001,
617 0x0e000f78, 0x240706d8, 0x8fbf0010, 0x03e00008, 0x27bd0018, 0x3c020800,
618 0x8c430020, 0x27bdffe0, 0xafb00010, 0x00808021, 0xafb20018, 0x00a09021,
619 0xafb10014, 0x30d100ff, 0x1060001c, 0xafbf001c, 0x0e001006, 0x00000000,
620 0x8f820018, 0xac500000, 0x8f840018, 0x24020001, 0xac820004, 0x8f830018,
621 0xac600008, 0x8f820018, 0xac40000c, 0x8f830018, 0xac600010, 0x8f820018,
622 0xac520014, 0x8f840018, 0x3c026000, 0x8c434448, 0x3c020800, 0xac830018,
623 0x9443466e, 0x8f840018, 0x3c024010, 0x00621825, 0xac83001c, 0x0e001044,
624 0x02202021, 0x8fbf001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, 0x03e00008,
625 0x27bd0020, 0x27bdffe8, 0xafbf0014, 0xafb00010, 0x93620005, 0x30420001,
626 0x10400033, 0x00808021, 0x3c029000, 0x34420001, 0x02021025, 0xaf420020,
627 0x3c038000, 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000, 0x93620005,
628 0x3c048000, 0x3c030800, 0x304200fe, 0xa3620005, 0x8c620020, 0x34840001,
629 0x02042025, 0xaf440020, 0x10400020, 0x8fbf0014, 0x0e001006, 0x00000000,
630 0x8f820018, 0xac500000, 0x93630082, 0x9362003f, 0x8f840018, 0x00031a00,
631 0x00431025, 0xac820004, 0x8f830018, 0xac600008, 0x8f820018, 0xac40000c,
632 0x8f830018, 0xac600010, 0x8f820018, 0xac400014, 0x8f840018, 0x3c026000,
633 0x8c434448, 0x3c020800, 0xac830018, 0x9443466e, 0x8f840018, 0x3c02400a,
634 0x00621825, 0xac83001c, 0x0e001044, 0x24040001, 0x8fbf0014, 0x8fb00010,
635 0x03e00008, 0x27bd0018, 0x27bdffe8, 0xafbf0010, 0x8f420188, 0x00803021,
636 0x9364003f, 0x24030012, 0x00021402, 0x1483001c, 0x304500ff, 0x3c029000,
637 0x34420001, 0x3c038000, 0x00c21025, 0xa3650080, 0xa365007a, 0xaf420020,
638 0x8f420020, 0x00431024, 0x1440fffd, 0x3c028000, 0x9363007d, 0x34420001,
639 0x3c048000, 0x00c21025, 0xa363007d, 0xaf420020, 0x8f4201f8, 0x00441024,
640 0x1440fffd, 0x24020002, 0x3c031000, 0xaf4601c0, 0xa34201c4, 0xaf4301f8,
641 0x0a000e54, 0x8fbf0010, 0x9362007e, 0x1445000e, 0x00000000, 0x93620080,
642 0x1045000b, 0x00000000, 0xa3650080, 0x8f820000, 0x93660080, 0x8f440180,
643 0x8f65004c, 0x8c430000, 0x0060f809, 0x00000000, 0x0a000e54, 0x8fbf0010,
644 0xa3650080, 0x8fbf0010, 0x03e00008, 0x27bd0018, 0x3c020800, 0x8c430020,
645 0x27bdffe0, 0xafb10014, 0x00808821, 0xafb20018, 0x00a09021, 0xafb00010,
646 0x30d000ff, 0x1060002f, 0xafbf001c, 0x0e001006, 0x00000000, 0x8f820018,
647 0xac510000, 0x8f830018, 0xac700004, 0x8f820018, 0xac520008, 0x8f830018,
648 0xac60000c, 0x8f820018, 0xac400010, 0x9763006a, 0x00032880, 0x50a00001,
649 0x24050001, 0x97630068, 0x93640081, 0x3c020800, 0x8c46004c, 0x00652821,
650 0x00852804, 0x00c5102b, 0x54400001, 0x00a03021, 0x3c020800, 0x8c440050,
651 0x00c4182b, 0x54600001, 0x00c02021, 0x8f830018, 0x2402fffe, 0x00822824,
652 0x3c026000, 0xac650014, 0x8f840018, 0x8c434448, 0x3c020800, 0xac830018,
653 0x9443466e, 0x8f840018, 0x3c024011, 0x00621825, 0xac83001c, 0x0e001044,
654 0x24040001, 0x8fbf001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, 0x03e00008,
655 0x27bd0020, 0x27bdffe8, 0xafbf0014, 0xafb00010, 0x8f440100, 0x27500100,
656 0x8f650050, 0x0e000c45, 0x9206001b, 0x3c020800, 0x8c430020, 0x1060001d,
657 0x8e100018, 0x0e001006, 0x00000000, 0x8f840018, 0x8f420100, 0xac820000,
658 0x8f830018, 0xac700004, 0x8f840018, 0x8f620050, 0xac820008, 0x8f830018,
659 0xac60000c, 0x8f820018, 0xac400010, 0x8f830018, 0x3c026000, 0xac600014,
660 0x8f850018, 0x8c434448, 0x24040001, 0x3c020800, 0xaca30018, 0x9443466e,
661 0x8f850018, 0x3c02401c, 0x00621825, 0x0e001044, 0xaca3001c, 0x8fbf0014,
662 0x8fb00010, 0x03e00008, 0x27bd0018, 0x3c029000, 0x8f460140, 0x34420001,
663 0x3c038000, 0x00c21025, 0xaf420020, 0x8f420020, 0x00431024, 0x1440fffd,
664 0x3c048000, 0x34840001, 0x3c059000, 0x34a50001, 0x3c078000, 0x24020012,
665 0x24030080, 0x00c42025, 0x00c52825, 0xa362003f, 0xa3630082, 0xaf440020,
666 0xaf450020, 0x8f420020, 0x00471024, 0x1440fffd, 0x3c038000, 0x9362007d,
667 0x34630001, 0x3c048000, 0x00c31825, 0x34420020, 0xa362007d, 0xaf430020,
668 0x8f4201f8, 0x00441024, 0x1440fffd, 0x24020002, 0x3c031000, 0xaf4601c0,
669 0xa34201c4, 0x03e00008, 0xaf4301f8, 0x8f430238, 0x3c020800, 0x04610013,
670 0x8c44009c, 0x2406fffe, 0x3c050800, 0x3c038000, 0x2484ffff, 0x14800009,
671 0x00000000, 0x97420078, 0x8ca3007c, 0x24420001, 0x00461024, 0x24630001,
672 0xa7620010, 0x03e00008, 0xaca3007c, 0x8f420238, 0x00431024, 0x1440fff3,
673 0x2484ffff, 0x8f420140, 0x3c031000, 0xaf420200, 0x03e00008, 0xaf430238,
674 0x3c029000, 0x8f440140, 0x34420001, 0x3c038000, 0x00821025, 0xaf420020,
675 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000, 0x3c038000, 0x9362007d,
676 0x34630001, 0x3c058000, 0x00831825, 0x34420001, 0xa362007d, 0xaf430020,
677 0x8f4201f8, 0x00451024, 0x1440fffd, 0x24020002, 0x3c031000, 0xaf4401c0,
678 0xa34201c4, 0x03e00008, 0xaf4301f8, 0x0000000d, 0x03e00008, 0x00000000,
679 0x0000000d, 0x03e00008, 0x00000000, 0x24020001, 0x03e00008, 0xa7620010,
680 0x9362003f, 0x304400ff, 0x3883000e, 0x2c630001, 0x38820010, 0x2c420001,
681 0x00621825, 0x14600003, 0x24020012, 0x14820003, 0x00000000, 0x03e00008,
682 0x00001021, 0x9363007e, 0x9362007a, 0x14620006, 0x00000000, 0x9363007e,
683 0x24020001, 0x24630001, 0x03e00008, 0xa363007e, 0x9363007e, 0x93620080,
684 0x14620004, 0x24020001, 0xa362000b, 0x03e00008, 0x24020001, 0x03e00008,
685 0x00001021, 0x9362000b, 0x10400021, 0x00001021, 0xa360000b, 0x9362003f,
686 0x304400ff, 0x3883000e, 0x2c630001, 0x38820010, 0x2c420001, 0x00621825,
687 0x14600015, 0x00001821, 0x24020012, 0x10820012, 0x00000000, 0x9363007e,
688 0x9362007a, 0x14620007, 0x00000000, 0x9362007e, 0x24030001, 0x24420001,
689 0xa362007e, 0x03e00008, 0x00601021, 0x9363007e, 0x93620080, 0x14620004,
690 0x00001821, 0x24020001, 0xa362000b, 0x24030001, 0x03e00008, 0x00601021,
691 0x03e00008, 0x00000000, 0x24040001, 0xaf64000c, 0x8f6300dc, 0x8f6200cc,
692 0x50620001, 0xa7640010, 0xa7640012, 0xa7640014, 0x03e00008, 0xa7640016,
693 0x27bdffd8, 0xafb00010, 0x00808021, 0xafb3001c, 0x00c09821, 0xafbf0020,
694 0xafb20018, 0xafb10014, 0x93620023, 0x00e09021, 0x30420040, 0x10400020,
695 0x30b1ffff, 0x3c020800, 0x8c430020, 0x1060001c, 0x00000000, 0x0e001006,
696 0x00000000, 0x8f820018, 0xac500000, 0x8f840018, 0x3c02008d, 0xac820004,
697 0x8f830018, 0xac600008, 0x8f820018, 0xac40000c, 0x8f830018, 0xac600010,
698 0x8f820018, 0xac520014, 0x8f850018, 0x3c026000, 0x8c434448, 0x24040001,
699 0x3c020800, 0xaca30018, 0x9443466e, 0x8f850018, 0x3c024019, 0x00621825,
700 0x0e001044, 0xaca3001c, 0x93620023, 0x30420020, 0x14400003, 0x3c020800,
701 0x52600020, 0x3c029000, 0x8c430020, 0x1060001d, 0x3c029000, 0x0e001006,
702 0x00000000, 0x8f820018, 0xac500000, 0x8f840018, 0x00111400, 0xac820004,
703 0x8f830018, 0xac720008, 0x8f820018, 0xac40000c, 0x8f830018, 0xac600010,
704 0x8f820018, 0xac400014, 0x8f850018, 0x3c026000, 0x8c434448, 0x24040001,
705 0x3c020800, 0xaca30018, 0x9443466e, 0x8f850018, 0x3c02401b, 0x00621825,
706 0x0e001044, 0xaca3001c, 0x3c029000, 0x34420001, 0x02021025, 0xaf420020,
707 0x3c038000, 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000, 0x93630023,
708 0x3c028000, 0x34420001, 0x02021025, 0x8fbf0020, 0x8fb3001c, 0x8fb20018,
709 0x8fb10014, 0x8fb00010, 0x3063009f, 0xa3630023, 0xaf420020, 0x03e00008,
710 0x27bd0028, 0x3c020800, 0x8c430020, 0x27bdffe8, 0xafb00010, 0x27500100,
711 0x1060001d, 0xafbf0014, 0x0e001006, 0x00000000, 0x8f830018, 0x8e020004,
712 0xac620000, 0x8f840018, 0x8e020018, 0xac820004, 0x8f850018, 0x8e020000,
713 0xaca20008, 0x8f830018, 0xac60000c, 0x8f820018, 0xac400010, 0x8f830018,
714 0xac600014, 0x8f820018, 0xac400018, 0x96030008, 0x3c020800, 0x9444466e,
715 0x8f850018, 0x00031c00, 0x00641825, 0x24040001, 0x0e001044, 0xaca3001c,
716 0x8fbf0014, 0x8fb00010, 0x03e00008, 0x27bd0018, 0x3c060800, 0x24c54660,
717 0x3c02000a, 0x03421821, 0x94640006, 0x94a2000a, 0x00441023, 0x00021400,
718 0x00021c03, 0x04610006, 0xa4a40006, 0x0000000d, 0x00000000, 0x2400005a,
719 0x0a00101b, 0x24020001, 0x8f820014, 0x0062102b, 0x14400002, 0x00001021,
720 0x24020001, 0x304200ff, 0x1040001c, 0x274a0400, 0x3c07000a, 0x3c020800,
721 0x24454660, 0x94a9000a, 0x8f880014, 0x03471021, 0x94430006, 0x00402021,
722 0xa4a30006, 0x94820006, 0xa4a20006, 0x01221023, 0x00021400, 0x00021403,
723 0x04410006, 0x0048102b, 0x0000000d, 0x00000000, 0x2400005a, 0x0a001036,
724 0x24020001, 0x14400002, 0x00001021, 0x24020001, 0x304200ff, 0x1440ffec,
725 0x03471021, 0x24c44660, 0x8c820010, 0xaf420038, 0x8c830014, 0x3c020005,
726 0xaf43003c, 0xaf420030, 0xaf800010, 0xaf8a0018, 0x03e00008, 0x00000000,
727 0x27bdffe0, 0x8f820010, 0x8f850018, 0x3c070800, 0x24e84660, 0xafbf001c,
728 0xafb20018, 0xafb10014, 0xafb00010, 0x9503000a, 0x8d060014, 0x00009021,
729 0x309000ff, 0x00e08821, 0x24420001, 0x24a50020, 0x24630001, 0xaf820010,
730 0xaf850018, 0xa503000a, 0x24c30020, 0x3c028000, 0x04c10007, 0xad030014,
731 0x00621024, 0x14400005, 0x26224660, 0x8d020010, 0x24420001, 0xad020010,
732 0x26224660, 0x9444000a, 0x94450018, 0x0010102b, 0x00a41826, 0x2c630001,
733 0x00621825, 0x1060001c, 0x3c030006, 0x8f820010, 0x24120001, 0x00021140,
734 0x00431025, 0xaf420030, 0x00000000, 0x00000000, 0x00000000, 0x27450400,
735 0x8f420000, 0x30420010, 0x1040fffd, 0x26224660, 0x9444000a, 0x94430018,
736 0xaf800010, 0xaf850018, 0x14830012, 0x26274660, 0x0e0010d2, 0x00000000,
737 0x1600000e, 0x26274660, 0x0e001006, 0x00000000, 0x0a00108f, 0x26274660,
738 0x00041c00, 0x00031c03, 0x00051400, 0x00021403, 0x00621823, 0x18600002,
739 0x3c026000, 0xac400808, 0x26274660, 0x94e2000e, 0x94e3000c, 0x24420001,
740 0xa4e2000e, 0x3042ffff, 0x50430001, 0xa4e0000e, 0x12000005, 0x3c02000a,
741 0x94e2000a, 0xa74200a2, 0x0a0010cc, 0x02401021, 0x03421821, 0x94640006,
742 0x94e2000a, 0x00441023, 0x00021400, 0x00021c03, 0x04610006, 0xa4e40006,
743 0x0000000d, 0x00000000, 0x2400005a, 0x0a0010ae, 0x24020001, 0x8f820014,
744 0x0062102b, 0x14400002, 0x00001021, 0x24020001, 0x304200ff, 0x1040001b,
745 0x3c020800, 0x3c06000a, 0x24454660, 0x94a8000a, 0x8f870014, 0x03461021,
746 0x94430006, 0x00402021, 0xa4a30006, 0x94820006, 0xa4a20006, 0x01021023,
747 0x00021400, 0x00021403, 0x04410006, 0x0047102b, 0x0000000d, 0x00000000,
748 0x2400005a, 0x0a0010c8, 0x24020001, 0x14400002, 0x00001021, 0x24020001,
749 0x304200ff, 0x1440ffec, 0x03461021, 0x02401021, 0x8fbf001c, 0x8fb20018,
750 0x8fb10014, 0x8fb00010, 0x03e00008, 0x27bd0020, 0x3c020800, 0x24454660,
751 0x94a3001a, 0x8ca40024, 0x00403021, 0x000318c0, 0x00832021, 0xaf44003c,
752 0x8ca20020, 0xaf420038, 0x3c020050, 0x34420008, 0xaf420030, 0x00000000,
753 0x00000000, 0x00000000, 0x8f420000, 0x30420020, 0x1040fffd, 0x00000000,
754 0x8f430400, 0x24c64660, 0xacc30010, 0x8f420404, 0x3c030020, 0xacc20014,
755 0xaf430030, 0x94c40018, 0x94c3001c, 0x94c2001a, 0x94c5001e, 0x00832021,
756 0x24420001, 0xa4c2001a, 0x3042ffff, 0x14450002, 0xa4c40018, 0xa4c0001a,
757 0x03e00008, 0x00000000, 0x8f820010, 0x3c030006, 0x00021140, 0x00431025,
758 0xaf420030, 0x00000000, 0x00000000, 0x00000000, 0x27430400, 0x8f420000,
759 0x30420010, 0x1040fffd, 0x00000000, 0xaf800010, 0xaf830018, 0x03e00008,
760 0x00000000, 0x27bdffe8, 0xafb00010, 0x3c100800, 0x26104660, 0x3c05000a,
761 0x02002021, 0x03452821, 0xafbf0014, 0x0e001128, 0x2406000a, 0x96020002,
762 0x9603001e, 0x3042000f, 0x24420003, 0x00431804, 0x24027fff, 0x0043102b,
763 0xaf830014, 0x10400004, 0x00000000, 0x0000000d, 0x00000000, 0x24000043,
764 0x0e0010d2, 0x00000000, 0x8fbf0014, 0x8fb00010, 0x03e00008, 0x27bd0018,
765 0x10c00007, 0x00000000, 0x8ca20000, 0x24c6ffff, 0x24a50004, 0xac820000,
766 0x14c0fffb, 0x24840004, 0x03e00008, 0x00000000, 0x0a001137, 0x00a01021,
767 0xac860000, 0x24840004, 0x00a01021, 0x1440fffc, 0x24a5ffff, 0x03e00008,
768 0x00000000, 0x3c036000, 0x8c642b7c, 0x3c036010, 0x8c6553fc, 0x00041582,
769 0x00042302, 0x308403ff, 0x00052d82, 0x00441026, 0x0002102b, 0x0005282b,
770 0x00451025, 0x1440000d, 0x3c020050, 0x34420004, 0xaf400038, 0xaf40003c,
771 0xaf420030, 0x00000000, 0x00000000, 0x8f420000, 0x30420020, 0x1040fffd,
772 0x3c020020, 0xaf420030, 0x0000000d, 0x03e00008, 0x00000000, 0x3c020050,
773 0x34420004, 0xaf440038, 0xaf45003c, 0xaf420030, 0x00000000, 0x00000000,
774 0x8f420000, 0x30420020, 0x1040fffd, 0x3c020020, 0xaf420030, 0x03e00008,
775 0x00000000, 0x00000000 };
776
777static u32 bnx2_COM_b06FwData[(0x0/4) + 1] = { 0x00000000 };
778static u32 bnx2_COM_b06FwRodata[(0x18/4) + 1] = {
779 0x08002318, 0x08002348, 0x08002378, 0x080023a8, 0x080023d8, 0x00000000,
780 0x00000000 };
781
782static u32 bnx2_COM_b06FwBss[(0x88/4) + 1] = { 0x00000000 };
783static u32 bnx2_COM_b06FwSbss[(0x1c/4) + 1] = { 0x00000000 };
784
785static int bnx2_RXP_b06FwReleaseMajor = 0x0;
786static int bnx2_RXP_b06FwReleaseMinor = 0x0;
787static int bnx2_RXP_b06FwReleaseFix = 0x0;
788static u32 bnx2_RXP_b06FwStartAddr = 0x08000060;
789static u32 bnx2_RXP_b06FwTextAddr = 0x08000000;
790static int bnx2_RXP_b06FwTextLen = 0x20b8;
791static u32 bnx2_RXP_b06FwDataAddr = 0x080020e0;
792static int bnx2_RXP_b06FwDataLen = 0x0;
793static u32 bnx2_RXP_b06FwRodataAddr = 0x00000000;
794static int bnx2_RXP_b06FwRodataLen = 0x0;
795static u32 bnx2_RXP_b06FwBssAddr = 0x08002100;
796static int bnx2_RXP_b06FwBssLen = 0x239c;
797static u32 bnx2_RXP_b06FwSbssAddr = 0x080020e0;
798static int bnx2_RXP_b06FwSbssLen = 0x14;
799
800static u32 bnx2_RXP_b06FwText[(0x20b8/4) + 1] = {
801 0x0a000018, 0x00000000, 0x00000000, 0x0000000d, 0x72787020, 0x302e362e,
802 0x39000000, 0x00060903, 0x00000000, 0x0000000d, 0x00000000, 0x00000000,
803 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
804 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
805 0x00000000, 0x10000003, 0x00000000, 0x0000000d, 0x0000000d, 0x3c020800,
806 0x244220e0, 0x3c030800, 0x2463449c, 0xac400000, 0x0043202b, 0x1480fffd,
807 0x24420004, 0x3c1d0800, 0x37bd3ffc, 0x03a0f021, 0x3c100800, 0x26100060,
808 0x3c1c0800, 0x279c20e0, 0x0e000329, 0x00000000, 0x0000000d, 0x8f870008,
809 0x2ce20080, 0x10400018, 0x3c030800, 0x24633490, 0x8f460100, 0x00072140,
810 0x00831021, 0xac460000, 0x8f450104, 0x00641021, 0xac450004, 0x8f460108,
811 0xac460008, 0x8f45010c, 0xac45000c, 0x8f460114, 0xac460010, 0x8f450118,
812 0xac450014, 0x8f460124, 0xac460018, 0x8f450128, 0x00641821, 0x24e20001,
813 0xaf820008, 0xac65001c, 0x03e00008, 0x00000000, 0x00804021, 0x8f830000,
814 0x24070001, 0x3c020001, 0x00621024, 0x10400037, 0x00603021, 0x9742010e,
815 0x3c038000, 0x3045ffff, 0x8f4201b8, 0x00431024, 0x1440fffd, 0x24020003,
816 0xa342018b, 0x8f840004, 0x24020080, 0x24030002, 0xaf420180, 0xa743018c,
817 0x10800005, 0xa745018e, 0x9743011c, 0x9742011e, 0x0a000069, 0x00021400,
818 0x9743011e, 0x9742011c, 0x00021400, 0x00621825, 0xaf4301a8, 0x8f84000c,
819 0x24020003, 0x30838000, 0x1060000d, 0xa7420188, 0x93420116, 0x304200fc,
820 0x005a1021, 0x24424004, 0x8c430000, 0x3063ffff, 0x14600005, 0x00000000,
821 0x3c02ffff, 0x34427fff, 0x00821024, 0xaf82000c, 0x9782000e, 0x9743010c,
822 0x8f440104, 0x3042bfff, 0x00031c00, 0x3084ffff, 0x00641825, 0xa74201a6,
823 0xaf4301ac, 0x3c021000, 0xaf4201b8, 0x03e00008, 0x00001021, 0x30c21000,
824 0x1040000f, 0x00000000, 0x9742010c, 0x3042fc00, 0x5440000b, 0x24070005,
825 0x3c021000, 0x00c21024, 0x10400007, 0x3c030dff, 0x3463ffff, 0x3c020e00,
826 0x00c21024, 0x0062182b, 0x54600001, 0x24070005, 0x8f82000c, 0x30434000,
827 0x10600016, 0x00404821, 0x3c020f00, 0x00c21024, 0x14400012, 0x00000000,
828 0x93420116, 0x34424000, 0x03421821, 0x94650002, 0x2ca21389, 0x1040000b,
829 0x3c020800, 0x24422100, 0x00051942, 0x00031880, 0x00621821, 0x30a5001f,
830 0x8c640000, 0x24020001, 0x00a21004, 0x00822024, 0x01044025, 0x11000037,
831 0x3c021000, 0x9742010e, 0x34e60002, 0x3c038000, 0x24420004, 0x3045ffff,
832 0x8f4201b8, 0x00431024, 0x1440fffd, 0x24020003, 0xa342018b, 0x8f840004,
833 0x24020180, 0x24030002, 0xaf420180, 0xa743018c, 0x10800005, 0xa745018e,
834 0x9743011c, 0x9742011e, 0x0a0000cd, 0x00021400, 0x9743011e, 0x9742011c,
835 0x00021400, 0x00621825, 0xaf4301a8, 0x8f84000c, 0x30828000, 0x1040000c,
836 0xa7460188, 0x93420116, 0x304200fc, 0x005a1021, 0x24424004, 0x8c430000,
837 0x3063ffff, 0x14600004, 0x3c02ffff, 0x34427fff, 0x00821024, 0xaf82000c,
838 0x9782000e, 0x9743010c, 0x8f440104, 0x3042bfff, 0x00031c00, 0x3084ffff,
839 0x00641825, 0xa74201a6, 0xaf4301ac, 0x3c021000, 0xaf4201b8, 0x03e00008,
840 0x00001021, 0x00c21024, 0x104000ba, 0x3c020800, 0x8c430030, 0x1060003e,
841 0x31224000, 0x1040003c, 0x3c030f00, 0x00c31824, 0x3c020100, 0x0043102b,
842 0x14400038, 0x3c030800, 0x9742010e, 0x34e60002, 0x3c038000, 0x24420004,
843 0x3045ffff, 0x8f4201b8, 0x00431024, 0x1440fffd, 0x24020003, 0xa342018b,
844 0x8f840004, 0x24020080, 0x24030002, 0xaf420180, 0xa743018c, 0x10800005,
845 0xa745018e, 0x9743011c, 0x9742011e, 0x0a000110, 0x00021400, 0x9743011e,
846 0x9742011c, 0x00021400, 0x00621825, 0xaf4301a8, 0x8f84000c, 0x30828000,
847 0x1040000c, 0xa7460188, 0x93420116, 0x304200fc, 0x005a1021, 0x24424004,
848 0x8c430000, 0x3063ffff, 0x14600004, 0x3c02ffff, 0x34427fff, 0x00821024,
849 0xaf82000c, 0x9782000e, 0x9743010c, 0x8f440104, 0x3042bfff, 0x00031c00,
850 0x3084ffff, 0x00641825, 0xa74201a6, 0xaf4301ac, 0x3c021000, 0xaf4201b8,
851 0x03e00008, 0x00001021, 0x3c030800, 0x8c620024, 0x30420008, 0x1040003d,
852 0x34e80002, 0x3c020f00, 0x00c21024, 0x5440003a, 0x3107ffff, 0x9742010c,
853 0x30420200, 0x50400036, 0x3107ffff, 0x9742010e, 0x30e6fffb, 0x3c038000,
854 0x24420004, 0x3045ffff, 0x8f4201b8, 0x00431024, 0x1440fffd, 0x24020003,
855 0xa342018b, 0x8f840004, 0x24020180, 0x24030002, 0xaf420180, 0xa743018c,
856 0x10800005, 0xa745018e, 0x9743011c, 0x9742011e, 0x0a000153, 0x00021400,
857 0x9743011e, 0x9742011c, 0x00021400, 0x00621825, 0xaf4301a8, 0x8f84000c,
858 0x30828000, 0x1040000c, 0xa7460188, 0x93420116, 0x304200fc, 0x005a1021,
859 0x24424004, 0x8c430000, 0x3063ffff, 0x14600004, 0x3c02ffff, 0x34427fff,
860 0x00821024, 0xaf82000c, 0x9782000e, 0x9743010c, 0x8f440104, 0x3042bfff,
861 0x00031c00, 0x3084ffff, 0x00641825, 0xa74201a6, 0xaf4301ac, 0x3c021000,
862 0xaf4201b8, 0x3107ffff, 0x8f820000, 0x3c068000, 0x9743010e, 0x00021442,
863 0x30440780, 0x24630004, 0x3065ffff, 0x8f4201b8, 0x00461024, 0x1440fffd,
864 0x24020003, 0xa342018b, 0x8f830004, 0x24020002, 0xaf440180, 0xa742018c,
865 0x10600005, 0xa745018e, 0x9743011c, 0x9742011e, 0x0a000189, 0x00021400,
866 0x9743011e, 0x9742011c, 0x00021400, 0x00621825, 0xaf4301a8, 0x8f84000c,
867 0x30828000, 0x1040000c, 0xa7470188, 0x93420116, 0x304200fc, 0x005a1021,
868 0x24424004, 0x8c430000, 0x3063ffff, 0x14600004, 0x3c02ffff, 0x34427fff,
869 0x00821024, 0xaf82000c, 0x9782000e, 0x9743010c, 0x8f440104, 0x3042bfff,
870 0x00031c00, 0x3084ffff, 0x00641825, 0xa74201a6, 0xaf4301ac, 0x3c021000,
871 0xaf4201b8, 0x03e00008, 0x00001021, 0x8f424000, 0x30420100, 0x104000ef,
872 0x3c020800, 0x8c440024, 0x24030001, 0x14830036, 0x00404021, 0x9742010e,
873 0x34e50002, 0x3c038000, 0x24420004, 0x3044ffff, 0x8f4201b8, 0x00431024,
874 0x1440fffd, 0x24020003, 0xa342018b, 0x8f830004, 0x24020002, 0xaf400180,
875 0xa742018c, 0x10600005, 0xa744018e, 0x9743011c, 0x9742011e, 0x0a0001c6,
876 0x00021400, 0x9743011e, 0x9742011c, 0x00021400, 0x00621825, 0xaf4301a8,
877 0x8f84000c, 0x30828000, 0x1040000c, 0xa7450188, 0x93420116, 0x304200fc,
878 0x005a1021, 0x24424004, 0x8c430000, 0x3063ffff, 0x14600004, 0x3c02ffff,
879 0x34427fff, 0x00821024, 0xaf82000c, 0x9782000e, 0x9743010c, 0x8f440104,
880 0x3042bfff, 0x00031c00, 0x3084ffff, 0x00641825, 0xa74201a6, 0xaf4301ac,
881 0x3c021000, 0xaf4201b8, 0x03e00008, 0x00001021, 0x30820001, 0x10400035,
882 0x30e90004, 0x9742010e, 0x30e6fffb, 0x3c038000, 0x24420004, 0x3044ffff,
883 0x8f4201b8, 0x00431024, 0x1440fffd, 0x24020003, 0xa342018b, 0x8f830004,
884 0x24020002, 0xaf400180, 0xa742018c, 0x10600005, 0xa744018e, 0x9743011c,
885 0x9742011e, 0x0a0001fe, 0x00021400, 0x9743011e, 0x9742011c, 0x00021400,
886 0x00621825, 0xaf4301a8, 0x8f84000c, 0x30828000, 0x1040000c, 0xa7470188,
887 0x93420116, 0x304200fc, 0x005a1021, 0x24424004, 0x8c430000, 0x3063ffff,
888 0x14600004, 0x3c02ffff, 0x34427fff, 0x00821024, 0xaf82000c, 0x9782000e,
889 0x9743010c, 0x8f440104, 0x3042bfff, 0x00031c00, 0x3084ffff, 0x00641825,
890 0xa74201a6, 0xaf4301ac, 0x3c021000, 0xaf4201b8, 0x30c7ffff, 0x8d020024,
891 0x30420004, 0x10400037, 0x8d020024, 0x9742010e, 0x30e6fffb, 0x3c038000,
892 0x24420004, 0x3045ffff, 0x8f4201b8, 0x00431024, 0x1440fffd, 0x24020003,
893 0xa342018b, 0x8f840004, 0x24020100, 0x24030002, 0xaf420180, 0xa743018c,
894 0x10800005, 0xa745018e, 0x9743011c, 0x9742011e, 0x0a000237, 0x00021400,
895 0x9743011e, 0x9742011c, 0x00021400, 0x00621825, 0xaf4301a8, 0x8f84000c,
896 0x30828000, 0x1040000c, 0xa7470188, 0x93420116, 0x304200fc, 0x005a1021,
897 0x24424004, 0x8c430000, 0x3063ffff, 0x14600004, 0x3c02ffff, 0x34427fff,
898 0x00821024, 0xaf82000c, 0x9782000e, 0x9743010c, 0x8f440104, 0x3042bfff,
899 0x00031c00, 0x3084ffff, 0x00641825, 0xa74201a6, 0xaf4301ac, 0x3c021000,
900 0xaf4201b8, 0x30c7ffff, 0x8d020024, 0x30420008, 0x10400034, 0x00000000,
901 0x9742010e, 0x3c038000, 0x24420004, 0x3045ffff, 0x8f4201b8, 0x00431024,
902 0x1440fffd, 0x24020003, 0xa342018b, 0x8f840004, 0x24020180, 0x24030002,
903 0xaf420180, 0xa743018c, 0x10800005, 0xa745018e, 0x9743011c, 0x9742011e,
904 0x0a00026f, 0x00021400, 0x9743011e, 0x9742011c, 0x00021400, 0x00621825,
905 0xaf4301a8, 0x8f84000c, 0x30828000, 0x1040000c, 0xa7470188, 0x93420116,
906 0x304200fc, 0x005a1021, 0x24424004, 0x8c430000, 0x3063ffff, 0x14600004,
907 0x3c02ffff, 0x34427fff, 0x00821024, 0xaf82000c, 0x9782000e, 0x9743010c,
908 0x8f440104, 0x3042bfff, 0x00031c00, 0x3084ffff, 0x00641825, 0xa74201a6,
909 0xaf4301ac, 0x3c021000, 0xaf4201b8, 0x15200046, 0x00001021, 0x3c038000,
910 0x8f4201b8, 0x00431024, 0x1440fffd, 0x24020002, 0x24032000, 0xa342018b,
911 0xa7430188, 0x3c021000, 0xaf4201b8, 0x03e00008, 0x00001021, 0x3c030800,
912 0x8c620024, 0x30420001, 0x10400035, 0x00001021, 0x9742010e, 0x34e50002,
913 0x3c038000, 0x24420004, 0x3044ffff, 0x8f4201b8, 0x00431024, 0x1440fffd,
914 0x24020003, 0xa342018b, 0x8f830004, 0x24020002, 0xaf400180, 0xa742018c,
915 0x10600005, 0xa744018e, 0x9743011c, 0x9742011e, 0x0a0002b5, 0x00021400,
916 0x9743011e, 0x9742011c, 0x00021400, 0x00621825, 0xaf4301a8, 0x8f84000c,
917 0x30828000, 0x1040000c, 0xa7450188, 0x93420116, 0x304200fc, 0x005a1021,
918 0x24424004, 0x8c430000, 0x3063ffff, 0x14600004, 0x3c02ffff, 0x34427fff,
919 0x00821024, 0xaf82000c, 0x9782000e, 0x9743010c, 0x8f440104, 0x3042bfff,
920 0x00031c00, 0x3084ffff, 0x00641825, 0xa74201a6, 0xaf4301ac, 0x3c021000,
921 0xaf4201b8, 0x00001021, 0x03e00008, 0x00000000, 0x27bdffe0, 0xafbf0018,
922 0xafb10014, 0xafb00010, 0x8f420140, 0xaf420020, 0x8f430148, 0x3c027000,
923 0x00621824, 0x3c024000, 0x1062000c, 0x0043102b, 0x14400006, 0x3c025000,
924 0x3c023000, 0x1062000b, 0x3c024000, 0x0a00031f, 0x00000000, 0x10620034,
925 0x3c024000, 0x0a00031f, 0x00000000, 0x0e00067c, 0x00000000, 0x0a00031f,
926 0x3c024000, 0x8f420148, 0x24030002, 0x3044ffff, 0x00021402, 0x305000ff,
927 0x1203000c, 0x27510180, 0x2a020003, 0x10400005, 0x24020003, 0x0600001d,
928 0x36053000, 0x0a00030a, 0x3c038000, 0x12020007, 0x00000000, 0x0a000317,
929 0x00000000, 0x0e000423, 0x00000000, 0x0a000308, 0x00402021, 0x0e000435,
930 0x00000000, 0x00402021, 0x36053000, 0x3c038000, 0x8f4201b8, 0x00431024,
931 0x1440fffd, 0x24020002, 0xa6250008, 0xa222000b, 0xa6240010, 0x8f420144,
932 0x3c031000, 0xae220024, 0xaf4301b8, 0x0a00031f, 0x3c024000, 0x0000000d,
933 0x00000000, 0x240001c3, 0x0a00031f, 0x3c024000, 0x0e0007f7, 0x00000000,
934 0x3c024000, 0xaf420178, 0x00000000, 0x8fbf0018, 0x8fb10014, 0x8fb00010,
935 0x03e00008, 0x27bd0020, 0x24020800, 0x03e00008, 0xaf4201b8, 0x27bdffe8,
936 0x3c04600c, 0xafbf0014, 0xafb00010, 0x8c825000, 0x3c1a8000, 0x2403ff7f,
937 0x3c106000, 0x00431024, 0x3442380c, 0x24030003, 0xac825000, 0x3c040008,
938 0xaf430008, 0x8e020808, 0x3c030800, 0xac600020, 0x3042fff0, 0x2c420001,
939 0xaf820004, 0x0e000819, 0x0344d825, 0x0e000781, 0x00000000, 0x3c020400,
940 0x3442000c, 0x3c03ffff, 0x34630806, 0xae021948, 0xae03194c, 0x8e021980,
941 0x34420200, 0xae021980, 0x8f500000, 0x32020003, 0x1040fffd, 0x32020001,
942 0x10400004, 0x32020002, 0x0e0003bd, 0x00000000, 0x32020002, 0x1040fff6,
943 0x00000000, 0x0e0002d4, 0x00000000, 0x0a00034a, 0x00000000, 0x27bdffe8,
944 0x3c04600c, 0xafbf0014, 0xafb00010, 0x8c825000, 0x3c1a8000, 0x2403ff7f,
945 0x3c106000, 0x00431024, 0x3442380c, 0x24030003, 0xac825000, 0x3c040008,
946 0xaf430008, 0x8e020808, 0x3c030800, 0xac600020, 0x3042fff0, 0x2c420001,
947 0xaf820004, 0x0e000819, 0x0344d825, 0x0e000781, 0x00000000, 0x3c020400,
948 0x3442000c, 0x3c03ffff, 0x34630806, 0xae021948, 0xae03194c, 0x8e021980,
949 0x8fbf0014, 0x34420200, 0xae021980, 0x8fb00010, 0x03e00008, 0x27bd0018,
950 0x30a5ffff, 0x30c6ffff, 0x30e7ffff, 0x3c038000, 0x8f4201b8, 0x00431024,
951 0x1440fffd, 0x24020003, 0xa342018b, 0x8f830004, 0xaf440180, 0xa745018c,
952 0x10600005, 0xa746018e, 0x9743011c, 0x9742011e, 0x0a000393, 0x00021400,
953 0x9743011e, 0x9742011c, 0x00021400, 0x00621825, 0xaf4301a8, 0x8f84000c,
954 0x30828000, 0x1040000c, 0xa7470188, 0x93420116, 0x304200fc, 0x005a1021,
955 0x24424004, 0x8c430000, 0x3063ffff, 0x14600004, 0x3c02ffff, 0x34427fff,
956 0x00821024, 0xaf82000c, 0x9782000e, 0x9743010c, 0x8f440104, 0x3042bfff,
957 0x00031c00, 0x3084ffff, 0x00641825, 0xa74201a6, 0xaf4301ac, 0x3c021000,
958 0xaf4201b8, 0x03e00008, 0x00000000, 0x3c038000, 0x8f4201b8, 0x00431024,
959 0x1440fffd, 0x24020002, 0x24032000, 0xa342018b, 0xa7430188, 0x3c021000,
960 0xaf4201b8, 0x03e00008, 0x00000000, 0x27bdffe8, 0xafbf0010, 0x8f460128,
961 0xaf460020, 0x8f420104, 0x8f450100, 0x24030800, 0x3c040010, 0xaf820000,
962 0x00441024, 0xaf85000c, 0xaf4301b8, 0x14400005, 0x3c02001f, 0x3c030800,
963 0x8c620020, 0x0a0003d5, 0x00002021, 0x3442ff00, 0x14c20009, 0x2402bfff,
964 0x3c030800, 0x8c620020, 0x24040001, 0x24420001, 0x0e00004c, 0xac620020,
965 0x0a0003e4, 0x00000000, 0x00a21024, 0x14400006, 0x00000000, 0xaf400048,
966 0x0e000448, 0xaf400040, 0x0a0003e4, 0x00000000, 0x0e000783, 0x00000000,
967 0x10400005, 0x3c024000, 0x8f430124, 0x3c026020, 0xac430014, 0x3c024000,
968 0xaf420138, 0x00000000, 0x8fbf0010, 0x03e00008, 0x27bd0018, 0x27bdffe0,
969 0xafbf0018, 0xafb10014, 0xafb00010, 0x8f420148, 0x24030002, 0x3044ffff,
970 0x00021402, 0x305000ff, 0x1203000c, 0x27510180, 0x2a020003, 0x10400005,
971 0x24020003, 0x0600001d, 0x36053000, 0x0a00040e, 0x3c038000, 0x12020007,
972 0x00000000, 0x0a00041b, 0x00000000, 0x0e000423, 0x00000000, 0x0a00040c,
973 0x00402021, 0x0e000435, 0x00000000, 0x00402021, 0x36053000, 0x3c038000,
974 0x8f4201b8, 0x00431024, 0x1440fffd, 0x24020002, 0xa6250008, 0xa222000b,
975 0xa6240010, 0x8f420144, 0x3c031000, 0xae220024, 0xaf4301b8, 0x0a00041f,
976 0x8fbf0018, 0x0000000d, 0x00000000, 0x240001c3, 0x8fbf0018, 0x8fb10014,
977 0x8fb00010, 0x03e00008, 0x27bd0020, 0x3084ffff, 0x2c821389, 0x1040000d,
978 0x00001021, 0x3c030800, 0x24632100, 0x00042942, 0x00052880, 0x00a32821,
979 0x3086001f, 0x8ca40000, 0x24030001, 0x00c31804, 0x00832025, 0x03e00008,
980 0xaca40000, 0x03e00008, 0x24020091, 0x3084ffff, 0x2c821389, 0x1040000e,
981 0x00001021, 0x3c030800, 0x24632100, 0x00042942, 0x00052880, 0x00a32821,
982 0x3086001f, 0x24030001, 0x8ca40000, 0x00c31804, 0x00031827, 0x00832024,
983 0x03e00008, 0xaca40000, 0x03e00008, 0x24020091, 0x27bdffb0, 0x3c026000,
984 0xafbf0048, 0x8c434448, 0xaf630140, 0x93620005, 0x30420001, 0x14400005,
985 0x00000000, 0x0e0007ed, 0x00000000, 0x0a00067a, 0x8fbf0048, 0x93420116,
986 0x93430112, 0x8f430104, 0x3c040020, 0x34424000, 0x00641824, 0x1060000d,
987 0x03426021, 0x8f430128, 0x27420180, 0xac430000, 0x8f650040, 0x24040008,
988 0x240340c1, 0xa4430008, 0x24030002, 0xa043000b, 0x3c031000, 0x0a000563,
989 0xa044000a, 0x8f420104, 0x3c030040, 0x00431024, 0x10400007, 0x00000000,
990 0x8f430128, 0x27420180, 0xac430000, 0x8f650040, 0x0a00055c, 0x24040010,
991 0xaf400048, 0xaf400054, 0xaf400040, 0x8f630048, 0x8f620040, 0x00624823,
992 0x05210004, 0x00000000, 0x0000000d, 0x00000000, 0x24000132, 0x9742011a,
993 0x3046ffff, 0x10c00004, 0x8d880004, 0x01061021, 0x0a000487, 0x2445ffff,
994 0x01002821, 0x918a000d, 0xa7a00020, 0xafa00028, 0x9364003f, 0x3c026000,
995 0x8c434448, 0x308700ff, 0x31420004, 0x10400033, 0xaf630144, 0x24090012,
996 0x14e90006, 0x3c040800, 0x8c830028, 0x24020001, 0x24630001, 0x0a00054e,
997 0xac830028, 0x8f620044, 0x15020012, 0x97a20020, 0x27a60010, 0x27450180,
998 0x3442001a, 0xa7a20020, 0x8f630040, 0x3c048000, 0x24020020, 0xa3a70022,
999 0xa3a90023, 0xa3a2001a, 0xafa30028, 0x8f4201b8, 0x00441024, 0x1440fffd,
1000 0x00000000, 0x0a000533, 0x00000000, 0x8f620044, 0x01021023, 0x0440009e,
1001 0x24020001, 0x8f620048, 0x01021023, 0x0441009a, 0x24020001, 0x97a20020,
1002 0x27a60010, 0x34420001, 0xa7a20020, 0x8f630040, 0x27450180, 0x3c048000,
1003 0xafa30028, 0x8f4201b8, 0x00441024, 0x1440fffd, 0x00000000, 0x0a000533,
1004 0x00000000, 0x3c026000, 0x8c424448, 0xaf620148, 0x8f630040, 0x00685823,
1005 0x19600013, 0x00cb102a, 0x54400007, 0x314a00fe, 0x5566000c, 0x010b4021,
1006 0x31420001, 0x54400009, 0x010b4021, 0x314a00fe, 0x24020001, 0xa7a20020,
1007 0x8f630040, 0x00c05821, 0x00003021, 0x0a0004dd, 0xafa30028, 0x00cb1023,
1008 0x0a0004dd, 0x3046ffff, 0x00005821, 0x8f620048, 0x2442ffff, 0x00a21823,
1009 0x18600019, 0x0066102a, 0x14400013, 0x24020001, 0xa7a20020, 0x8f630040,
1010 0xafa30028, 0x8f620040, 0x55020005, 0x27a60010, 0x55200003, 0x27a60010,
1011 0x0a0004f6, 0x00c01821, 0x27450180, 0x3c038000, 0x8f4201b8, 0x00431024,
1012 0x1440fffd, 0x00000000, 0x0a000533, 0x00000000, 0x8f650048, 0x00c31023,
1013 0x3046ffff, 0x314a00f6, 0x3c046000, 0x8c824448, 0x31430002, 0x1060001e,
1014 0xaf62014c, 0x8f620044, 0x1502000e, 0x97a20020, 0x27a60010, 0x34420200,
1015 0xa7a20020, 0x8f630040, 0x27450180, 0x3c048000, 0xafa30028, 0x8f4201b8,
1016 0x00441024, 0x1440fffd, 0x00000000, 0x0a000533, 0x00000000, 0x27a60010,
1017 0x34420001, 0xa7a20020, 0x8f630040, 0x27450180, 0x3c048000, 0xafa30028,
1018 0x8f4201b8, 0x00441024, 0x1440fffd, 0x00000000, 0x0a000533, 0x00000000,
1019 0x3c026000, 0x8c424448, 0x31430010, 0xaf620150, 0x54600003, 0x8d890008,
1020 0x0a00054e, 0x24020001, 0x8f630054, 0x2522ffff, 0x00431023, 0x1840002a,
1021 0x24020001, 0x27a60010, 0xa7a20020, 0x8f630040, 0x27450180, 0x3c048000,
1022 0xafa30028, 0x8f4201b8, 0x00441024, 0x1440fffd, 0x00000000, 0x8f420128,
1023 0xaca20000, 0x8cc30018, 0x240240c1, 0xa4a20008, 0xaca30018, 0x90c4000a,
1024 0x24020002, 0xa0a2000b, 0xa0a4000a, 0x94c20010, 0xa4a20010, 0x90c30012,
1025 0xa0a30012, 0x90c20013, 0xa0a20013, 0x8cc30014, 0xaca30014, 0x8cc20024,
1026 0xaca20024, 0x8cc30028, 0xaca30028, 0x8cc4002c, 0x24020001, 0x3c031000,
1027 0xaca4002c, 0xaf4301b8, 0xaf400044, 0xaf400050, 0x0a00067a, 0x8fbf0048,
1028 0x3c026000, 0x8c424448, 0x31430020, 0x10600019, 0xaf620154, 0x8f430128,
1029 0x27420180, 0xac430000, 0x8f650040, 0x24040004, 0x240340c1, 0xa4430008,
1030 0x24030002, 0xa044000a, 0x24040008, 0xa043000b, 0x3c031000, 0xa4440010,
1031 0xa0400012, 0xa0400013, 0xac400014, 0xac400024, 0xac400028, 0xac40002c,
1032 0xac450018, 0x0e0007ed, 0xaf4301b8, 0x0a00067a, 0x8fbf0048, 0x8f430104,
1033 0x8c824448, 0x38e3000a, 0x2c630001, 0xaf620158, 0x38e2000c, 0x2c420001,
1034 0x00621825, 0x14600003, 0x2402000e, 0x14e2002a, 0x00000000, 0x50c00008,
1035 0x9584000e, 0x10c00004, 0xa7a60040, 0x01061021, 0x0a000583, 0x2445ffff,
1036 0x01002821, 0x9584000e, 0x93630035, 0x8f62004c, 0x00642004, 0x00892021,
1037 0x00821023, 0x1840001f, 0x3c026000, 0x8f620018, 0x01021023, 0x1c40000f,
1038 0x97a20020, 0x8f620018, 0x15020018, 0x3c026000, 0x8f62001c, 0x01221023,
1039 0x1c400008, 0x97a20020, 0x8f62001c, 0x15220011, 0x3c026000, 0x8f620058,
1040 0x00821023, 0x1840000c, 0x97a20020, 0xafa50028, 0xafa80034, 0xafa90038,
1041 0xafa4003c, 0x34420020, 0x0a0005a8, 0xa7a20020, 0x8f680040, 0x00003021,
1042 0x8f640058, 0x01002821, 0x3c026000, 0x8c434448, 0xaf63015c, 0x8f62004c,
1043 0x01221023, 0x18400009, 0x00000000, 0x8f620054, 0x01221023, 0x1c400005,
1044 0x97a20020, 0xafa50028, 0xafa90024, 0x0a0005c3, 0x34420040, 0x9742011a,
1045 0x1440000c, 0x24020014, 0x8f620058, 0x14820009, 0x24020014, 0x8f63004c,
1046 0x8f620054, 0x10620004, 0x97a20020, 0xafa50028, 0x34420080, 0xa7a20020,
1047 0x24020014, 0x10e2000a, 0x28e20015, 0x10400005, 0x2402000c, 0x10e20006,
1048 0x3c026000, 0x0a000600, 0x00000000, 0x24020016, 0x14e20031, 0x3c026000,
1049 0x8f620054, 0x24420001, 0x1522002d, 0x3c026000, 0x24020014, 0x10e2001e,
1050 0x28e20015, 0x10400005, 0x2402000c, 0x10e20008, 0x3c026000, 0x0a000600,
1051 0x00000000, 0x24020016, 0x10e2000c, 0x97a20020, 0x0a000600, 0x3c026000,
1052 0x97a30020, 0x2402000e, 0xafa50028, 0xa3a70022, 0xa3a20023, 0xafa90024,
1053 0x34630054, 0x0a0005ff, 0xa7a30020, 0x24030010, 0x24040002, 0xafa50028,
1054 0xa3a70022, 0xa3a30023, 0xa3a4001a, 0xafa90024, 0x0a0005fe, 0x3442005d,
1055 0x97a20020, 0x24030012, 0x24040002, 0xafa50028, 0xa3a70022, 0xa3a30023,
1056 0xa3a4001a, 0xafa90024, 0x3042fffe, 0x3442005c, 0xa7a20020, 0x3c026000,
1057 0x8c434448, 0x31420001, 0xaf630160, 0x1040002c, 0x2402000c, 0x10e20014,
1058 0x28e2000d, 0x10400005, 0x2402000a, 0x10e20008, 0x97a20020, 0x0a000631,
1059 0x3c026000, 0x2402000e, 0x10e20018, 0x3c026000, 0x0a000631, 0x00000000,
1060 0x24030008, 0x24040002, 0xafa50028, 0xa3a70022, 0xa3a30023, 0xa3a4001a,
1061 0x0a00062f, 0x34420013, 0x97a30020, 0x30620004, 0x1440000b, 0x97a20020,
1062 0x3462001b, 0xa7a20020, 0x24020016, 0x24030002, 0xafa50028, 0xa3a70022,
1063 0xa3a20023, 0x0a000630, 0xa3a3001a, 0x97a20020, 0x24030010, 0x24040002,
1064 0xafa50028, 0xa3a70022, 0xa3a30023, 0xa3a4001a, 0x3442001b, 0xa7a20020,
1065 0x3c026000, 0x8c434448, 0x31420009, 0x0002102b, 0x00021023, 0x30420007,
1066 0x34440003, 0xaf630164, 0x10c00016, 0x24030800, 0x8f820010, 0x27450180,
1067 0x24420001, 0xaf820010, 0x24020004, 0xaf4301b8, 0xa4a40008, 0xa0a2000b,
1068 0x93440120, 0x3c031000, 0xa4a6000e, 0xaca90024, 0xaca80028, 0x008b2021,
1069 0xa4a4000c, 0xaf4301b8, 0x97a20020, 0x00003021, 0x3042ffbf, 0x0a000650,
1070 0xa7a20020, 0x24060001, 0x3c026000, 0x8c434448, 0xaf630168, 0x97a20020,
1071 0x10400020, 0x27450180, 0x3c038000, 0x8f4201b8, 0x00431024, 0x1440fffd,
1072 0x00000000, 0x8f420128, 0xaca20000, 0x8fa30028, 0x240240c1, 0xa4a20008,
1073 0xaca30018, 0x93a4001a, 0x24020002, 0xa0a2000b, 0xa0a4000a, 0x97a20020,
1074 0xa4a20010, 0x93a30022, 0xa0a30012, 0x93a20023, 0xa0a20013, 0x8fa30024,
1075 0xaca30014, 0x8fa20034, 0xaca20024, 0x8fa30038, 0xaca30028, 0x8fa2003c,
1076 0x3c031000, 0xaca2002c, 0xaf4301b8, 0x3c026000, 0x8c434448, 0x00c01021,
1077 0xaf63016c, 0x8fbf0048, 0x03e00008, 0x27bd0050, 0x8f460140, 0x8f470148,
1078 0x3c028000, 0x00e24024, 0x00072c02, 0x30a300ff, 0x2402000b, 0x1062008f,
1079 0x27440180, 0x2862000c, 0x10400011, 0x24020006, 0x1062005a, 0x28620007,
1080 0x10400007, 0x24020008, 0x10600024, 0x24020001, 0x10620037, 0x00000000,
1081 0x0a00077e, 0x00000000, 0x106200a9, 0x24020009, 0x106200bb, 0x00071c02,
1082 0x0a00077e, 0x00000000, 0x2402001b, 0x106200c7, 0x2862001c, 0x10400007,
1083 0x2402000e, 0x106200b1, 0x24020019, 0x106200c2, 0x00071c02, 0x0a00077e,
1084 0x00000000, 0x24020080, 0x10620060, 0x28620081, 0x10400005, 0x2402001c,
1085 0x10620094, 0x00071c02, 0x0a00077e, 0x00000000, 0x240200c2, 0x106200c5,
1086 0x00a01821, 0x0a00077e, 0x00000000, 0x00a01821, 0x3c058000, 0x8f4201b8,
1087 0x00451024, 0x1440fffd, 0x24020001, 0xa4830008, 0x24030002, 0xac860000,
1088 0xac800004, 0xa082000a, 0xa083000b, 0xa4870010, 0x8f430144, 0x3c021000,
1089 0xac800028, 0xac830024, 0x3c036000, 0xaf4201b8, 0x03e00008, 0xac600808,
1090 0x11000009, 0x00a01821, 0x3c020800, 0x24030002, 0xa0434490, 0x24424490,
1091 0xac460008, 0x8f430144, 0x03e00008, 0xac430004, 0x3c058000, 0x8f4201b8,
1092 0x00451024, 0x1440fffd, 0x24020002, 0xac800000, 0xac860004, 0xa4830008,
1093 0xa082000a, 0xa082000b, 0xa4870010, 0xac800024, 0x8f420144, 0x3c031000,
1094 0xac820028, 0x3c026000, 0xaf4301b8, 0x03e00008, 0xac400808, 0x00a01821,
1095 0x3c080800, 0x3c058000, 0x8f4201b8, 0x00451024, 0x1440fffd, 0x00000000,
1096 0xac860000, 0x91024490, 0x00002821, 0x10400002, 0x25064490, 0x8cc50008,
1097 0xac850004, 0xa4830008, 0x91034490, 0x24020002, 0xa082000b, 0xa4870010,
1098 0x34630001, 0xa083000a, 0x8f420144, 0xac820024, 0x91034490, 0x10600002,
1099 0x00001021, 0x8cc20004, 0xac820028, 0x3c021000, 0xaf4201b8, 0x3c026000,
1100 0xa1004490, 0x03e00008, 0xac400808, 0x00a01821, 0x3c058000, 0x8f4201b8,
1101 0x00451024, 0x1440fffd, 0x24020002, 0xa082000b, 0xa4830008, 0xa4870010,
1102 0x8f420144, 0x3c031000, 0xa4820012, 0x03e00008, 0xaf4301b8, 0x30e2ffff,
1103 0x14400028, 0x00071c02, 0x93620005, 0x30420004, 0x14400020, 0x3c029000,
1104 0x34420001, 0x00c21025, 0xaf420020, 0x3c038000, 0x8f420020, 0x00431024,
1105 0x1440fffd, 0x00000000, 0x93620005, 0x3c038000, 0x34630001, 0x00c31825,
1106 0x34420004, 0xa3620005, 0xaf430020, 0x93620005, 0x30420004, 0x14400003,
1107 0x3c038000, 0x0000000d, 0x3c038000, 0x8f4201b8, 0x00431024, 0x1440fffd,
1108 0x24020005, 0x3c031000, 0xac860000, 0xa082000b, 0xaf4301b8, 0x0a00073d,
1109 0x00071c02, 0x0000000d, 0x03e00008, 0x00000000, 0x00071c02, 0x3c058000,
1110 0x8f4201b8, 0x00451024, 0x1440fffd, 0x24020001, 0xa4830008, 0x24030002,
1111 0xac860000, 0xac800004, 0xa082000a, 0xa083000b, 0xa4870010, 0x8f430144,
1112 0x3c021000, 0xac800028, 0xac830024, 0x03e00008, 0xaf4201b8, 0x00071c02,
1113 0x3c058000, 0x8f4201b8, 0x00451024, 0x1440fffd, 0x24020002, 0xac800000,
1114 0xac860004, 0xa4830008, 0xa082000a, 0xa082000b, 0xa4870010, 0xac800024,
1115 0x8f420144, 0x3c031000, 0xac820028, 0x03e00008, 0xaf4301b8, 0x00071c02,
1116 0x3c058000, 0x8f4201b8, 0x00451024, 0x1440fffd, 0x24020001, 0xa4830008,
1117 0x24030002, 0xa082000a, 0x3c021000, 0xac860000, 0xac800004, 0xa083000b,
1118 0xa4870010, 0xac800024, 0xac800028, 0x03e00008, 0xaf4201b8, 0x3c058000,
1119 0x8f4201b8, 0x00451024, 0x1440fffd, 0x24020002, 0xac860000, 0xac800004,
1120 0xa4830008, 0xa080000a, 0x0a000748, 0xa082000b, 0x0000000d, 0x03e00008,
1121 0x00000000, 0x03e00008, 0x00000000, 0x8f420100, 0x3042003e, 0x14400011,
1122 0x24020001, 0xaf400048, 0x8f420100, 0x304207c0, 0x10400005, 0x00000000,
1123 0xaf40004c, 0xaf400050, 0x03e00008, 0x24020001, 0xaf400054, 0xaf400040,
1124 0x8f420100, 0x30423800, 0x54400001, 0xaf400044, 0x24020001, 0x03e00008,
1125 0x00000000, 0x3c029000, 0x34420001, 0x00822025, 0xaf440020, 0x3c038000,
1126 0x8f420020, 0x00431024, 0x1440fffd, 0x00000000, 0x03e00008, 0x00000000,
1127 0x3c028000, 0x34420001, 0x00822025, 0x03e00008, 0xaf440020, 0x8f430128,
1128 0x27420180, 0xac430000, 0x8f650040, 0x240340c1, 0xa4430008, 0x24030002,
1129 0xa044000a, 0x24040008, 0xa043000b, 0x3c031000, 0xa4440010, 0xa0400012,
1130 0xa0400013, 0xac400014, 0xac400024, 0xac400028, 0xac40002c, 0xac450018,
1131 0x03e00008, 0xaf4301b8, 0x24020001, 0xacc40000, 0x03e00008, 0xa4e50000,
1132 0x03e00008, 0x24020001, 0x24020001, 0xaf400044, 0x03e00008, 0xaf400050,
1133 0x00803021, 0x27450180, 0x3c038000, 0x8f4201b8, 0x00431024, 0x1440fffd,
1134 0x00000000, 0x8f420128, 0xaca20000, 0x8cc30018, 0x240240c1, 0xa4a20008,
1135 0xaca30018, 0x90c4000a, 0x24020002, 0xa0a2000b, 0xa0a4000a, 0x94c20010,
1136 0xa4a20010, 0x90c30012, 0xa0a30012, 0x90c20013, 0xa0a20013, 0x8cc30014,
1137 0xaca30014, 0x8cc20024, 0xaca20024, 0x8cc30028, 0xaca30028, 0x8cc2002c,
1138 0x3c031000, 0xaca2002c, 0x24020001, 0xaf4301b8, 0xaf400044, 0x03e00008,
1139 0xaf400050, 0x27bdffe8, 0xafbf0010, 0x0e000326, 0x00000000, 0x00002021,
1140 0x0e00004c, 0xaf400180, 0x8fbf0010, 0x03e00008, 0x27bd0018, 0x8f460148,
1141 0x27450180, 0x3c038000, 0x00061402, 0x304700ff, 0x8f4201b8, 0x00431024,
1142 0x1440fffd, 0x00000000, 0x8f440140, 0x00061202, 0x304200ff, 0x00061c02,
1143 0xaca20004, 0x24020002, 0xa4a30008, 0x30c300ff, 0xa0a2000b, 0xaca30024,
1144 0x10e0000a, 0xaca40000, 0x28e20004, 0x14400005, 0x24020001, 0x24020005,
1145 0x54e20005, 0xa0a0000a, 0x24020001, 0x0a000816, 0xa0a2000a, 0xa0a0000a,
1146 0x3c021000, 0x03e00008, 0xaf4201b8, 0x03e00008, 0x00001021, 0x10c00007,
1147 0x00000000, 0x8ca20000, 0x24c6ffff, 0x24a50004, 0xac820000, 0x14c0fffb,
1148 0x24840004, 0x03e00008, 0x00000000, 0x0a00082a, 0x00a01021, 0xac860000,
1149 0x24840004, 0x00a01021, 0x1440fffc, 0x24a5ffff, 0x03e00008, 0x00000000,
1150 0x00000000 };
1151
1152static u32 bnx2_RXP_b06FwData[(0x0/4) + 1] = { 0x00000000 };
1153static u32 bnx2_RXP_b06FwRodata[(0x0/4) + 1] = { 0x00000000 };
1154static u32 bnx2_RXP_b06FwBss[(0x239c/4) + 1] = { 0x00000000 };
1155static u32 bnx2_RXP_b06FwSbss[(0x14/4) + 1] = { 0x00000000 };
1156
1157static u32 bnx2_rv2p_proc1[] = {
1158 0x00000008, 0xac000001, 0x0000000c, 0x2f800001, 0x00000010, 0x213f0004,
1159 0x00000010, 0x20bf002c, 0x00000010, 0x203f0143, 0x00000018, 0x8000fffd,
1160 0x00000010, 0xb1b8b017, 0x0000000b, 0x2fdf0002, 0x00000000, 0x03d80000,
1161 0x00000000, 0x2c380000, 0x00000008, 0x2c800000, 0x00000008, 0x2d000000,
1162 0x00000010, 0x91d40000, 0x00000008, 0x2d800108, 0x00000008, 0x02000002,
1163 0x00000010, 0x91de0000, 0x0000000f, 0x42e0001c, 0x00000010, 0x91840a08,
1164 0x00000008, 0x2c8000b0, 0x00000008, 0x2d000008, 0x00000008, 0x2d800150,
1165 0x00000000, 0x00000000, 0x00000010, 0x91de0000, 0x00000010, 0x2c620002,
1166 0x00000018, 0x80000012, 0x0000000b, 0x2fdf0002, 0x0000000c, 0x1f800002,
1167 0x00000000, 0x2c070000, 0x00000018, 0x8000ffe6, 0x00000008, 0x02000002,
1168 0x0000000f, 0x42e0001c, 0x00000010, 0x91840a08, 0x00000008, 0x2c8000b0,
1169 0x00000008, 0x2d000008, 0x00000010, 0x91d40000, 0x00000008, 0x2d800108,
1170 0x00000000, 0x00000000, 0x00000010, 0x91de0000, 0x00000018, 0x80000004,
1171 0x0000000c, 0x1f800002, 0x00000000, 0x00000000, 0x00000018, 0x8000ffd9,
1172 0x0000000c, 0x29800002, 0x0000000c, 0x1f800002, 0x00000000, 0x2adf0000,
1173 0x00000008, 0x2a000005, 0x00000018, 0x8000ffd4, 0x00000008, 0x02240030,
1174 0x00000018, 0x00040000, 0x00000018, 0x80000015, 0x00000018, 0x80000017,
1175 0x00000018, 0x8000001b, 0x00000018, 0x8000004c, 0x00000018, 0x8000008c,
1176 0x00000018, 0x8000000f, 0x00000018, 0x8000000e, 0x00000018, 0x8000000d,
1177 0x00000018, 0x8000000c, 0x00000018, 0x800000c2, 0x00000018, 0x8000000a,
1178 0x00000018, 0x80000009, 0x00000018, 0x80000008, 0x00000018, 0x800000fd,
1179 0x00000018, 0x80000006, 0x00000018, 0x80000005, 0x00000018, 0x800000ff,
1180 0x00000018, 0x80000104, 0x00000018, 0x80000002, 0x00000018, 0x80000098,
1181 0x00000018, 0x80000000, 0x0000000c, 0x1f800001, 0x00000000, 0x00000000,
1182 0x00000018, 0x8000ffba, 0x00000010, 0x91d40000, 0x0000000c, 0x29800001,
1183 0x0000000c, 0x1f800001, 0x00000008, 0x2a000002, 0x00000018, 0x8000ffb5,
1184 0x00000010, 0xb1a0b012, 0x0000000b, 0x2fdf0002, 0x00000000, 0x2c200000,
1185 0x00000008, 0x2c800000, 0x00000008, 0x2d000000, 0x00000010, 0x91d40000,
1186 0x00000008, 0x2d80011c, 0x00000000, 0x00000000, 0x00000010, 0x91de0000,
1187 0x0000000f, 0x47600008, 0x0000000f, 0x060e0001, 0x00000010, 0x001f0000,
1188 0x00000000, 0x0f580000, 0x00000000, 0x0a640000, 0x00000000, 0x0ae50000,
1189 0x00000000, 0x0b660000, 0x00000000, 0x0d610000, 0x00000018, 0x80000013,
1190 0x0000000f, 0x47600008, 0x0000000b, 0x2fdf0002, 0x00000008, 0x2c800000,
1191 0x00000008, 0x2d000000, 0x00000010, 0x91d40000, 0x00000008, 0x2d80011c,
1192 0x0000000f, 0x060e0001, 0x00000010, 0x001f0000, 0x00000000, 0x0f580000,
1193 0x00000010, 0x91de0000, 0x00000000, 0x0a640000, 0x00000000, 0x0ae50000,
1194 0x00000000, 0x0b660000, 0x00000000, 0x0d610000, 0x00000000, 0x02620000,
1195 0x0000000b, 0x2fdf0002, 0x00000000, 0x309a0000, 0x00000000, 0x31040000,
1196 0x00000000, 0x0c961800, 0x00000009, 0x0c99ffff, 0x00000004, 0xcc993400,
1197 0x00000010, 0xb1963202, 0x00000008, 0x0f800000, 0x0000000c, 0x29800001,
1198 0x00000010, 0x00220002, 0x0000000c, 0x29520001, 0x0000000c, 0x29520000,
1199 0x00000008, 0x22000001, 0x0000000c, 0x1f800001, 0x00000000, 0x2adf0000,
1200 0x00000008, 0x2a000003, 0x00000018, 0x8000ff83, 0x00000010, 0xb1a0b01d,
1201 0x0000000b, 0x2fdf0002, 0x00000000, 0x2c200000, 0x00000008, 0x2c8000b0,
1202 0x00000008, 0x2d000008, 0x00000010, 0x91d40000, 0x00000008, 0x2d800150,
1203 0x00000000, 0x00000000, 0x00000010, 0x205f0000, 0x00000008, 0x2c800000,
1204 0x00000008, 0x2d000000, 0x00000008, 0x2d800108, 0x00000000, 0x00000000,
1205 0x00000010, 0x91de0000, 0x0000000f, 0x47600008, 0x00000000, 0x060e0000,
1206 0x00000010, 0x001f0000, 0x00000000, 0x0f580000, 0x00000010, 0x91de0000,
1207 0x00000000, 0x0a640000, 0x00000000, 0x0ae50000, 0x00000000, 0x0b670000,
1208 0x00000000, 0x0d620000, 0x00000000, 0x0ce71800, 0x00000009, 0x0c99ffff,
1209 0x00000004, 0xcc993400, 0x00000010, 0xb1963220, 0x00000008, 0x0f800000,
1210 0x00000018, 0x8000001e, 0x0000000f, 0x47600008, 0x0000000b, 0x2fdf0002,
1211 0x00000008, 0x2c8000b0, 0x00000008, 0x2d000008, 0x00000010, 0x91d40000,
1212 0x00000008, 0x2d80012c, 0x0000000f, 0x060e0001, 0x00000010, 0x001f0000,
1213 0x00000000, 0x0f580000, 0x00000010, 0x91de0000, 0x00000000, 0x0a640000,
1214 0x00000000, 0x0ae50000, 0x00000000, 0x0b670000, 0x00000000, 0x0d620000,
1215 0x00000000, 0x02630000, 0x0000000f, 0x47620010, 0x00000000, 0x0ce71800,
1216 0x0000000b, 0x2fdf0002, 0x00000000, 0x311a0000, 0x00000000, 0x31840000,
1217 0x0000000b, 0xc20000ff, 0x00000002, 0x42040000, 0x00000001, 0x31620800,
1218 0x0000000f, 0x020e0010, 0x00000002, 0x31620800, 0x00000009, 0x0c99ffff,
1219 0x00000004, 0xcc993400, 0x00000010, 0xb1963202, 0x00000008, 0x0f800000,
1220 0x0000000c, 0x29800001, 0x0000000c, 0x1f800001, 0x0000000c, 0x61420006,
1221 0x00000008, 0x22000008, 0x00000000, 0x2adf0000, 0x00000008, 0x2a000004,
1222 0x00000018, 0x8000ff42, 0x00000008, 0x2c8000b0, 0x00000008, 0x2d000008,
1223 0x00000010, 0x91a0b008, 0x00000010, 0x91d40000, 0x0000000c, 0x31620018,
1224 0x00000008, 0x2d800001, 0x00000000, 0x00000000, 0x00000010, 0x91de0000,
1225 0x00000008, 0xac000001, 0x00000018, 0x8000000e, 0x00000000, 0x0380b000,
1226 0x0000000b, 0x2fdf0002, 0x00000000, 0x2c004000, 0x00000010, 0x91d40000,
1227 0x00000008, 0x2d800101, 0x00000000, 0x00000000, 0x00000010, 0x91de0000,
1228 0x0000000c, 0x31620018, 0x00000008, 0x2d800001, 0x00000000, 0x00000000,
1229 0x00000010, 0x91de0000, 0x0000000b, 0x2fdf0002, 0x00000000, 0x2c000e00,
1230 0x0000000c, 0x29800001, 0x0000000c, 0x1f800001, 0x00000008, 0x2a000007,
1231 0x00000018, 0x8000ff27, 0x00000010, 0xb1a0b016, 0x0000000b, 0x2fdf0002,
1232 0x00000000, 0x03d80000, 0x00000000, 0x2c200000, 0x00000008, 0x2c8000b0,
1233 0x00000008, 0x2d000008, 0x00000010, 0x91d40000, 0x00000008, 0x2d800150,
1234 0x00000000, 0x00000000, 0x00000010, 0x205f0000, 0x00000008, 0x2c800000,
1235 0x00000008, 0x2d000000, 0x00000008, 0x2d800108, 0x00000008, 0x07000001,
1236 0x00000010, 0xb5de1c00, 0x00000010, 0x2c620002, 0x00000018, 0x8000000a,
1237 0x0000000b, 0x2fdf0002, 0x00000000, 0x2c070000, 0x0000000c, 0x1f800001,
1238 0x00000010, 0x91de0000, 0x00000018, 0x8000ff11, 0x00000008, 0x2c8000b0,
1239 0x00000008, 0x2d000008, 0x00000010, 0x91d40000, 0x00000008, 0x2d800108,
1240 0x0000000c, 0x29800001, 0x0000000c, 0x1f800001, 0x00000010, 0x91de0000,
1241 0x00000000, 0x2adf0000, 0x00000008, 0x2a00000a, 0x00000018, 0x8000ff07,
1242 0x00000000, 0x82265600, 0x0000000f, 0x47220008, 0x00000009, 0x070e000f,
1243 0x00000008, 0x070e0008, 0x00000008, 0x02800001, 0x00000007, 0x02851c00,
1244 0x00000008, 0x82850001, 0x00000000, 0x02840a00, 0x00000007, 0x42851c00,
1245 0x00000003, 0xc3aa5200, 0x00000000, 0x03b10e00, 0x00000010, 0x001f0000,
1246 0x0000000f, 0x0f280007, 0x00000007, 0x4b071c00, 0x00000000, 0x00000000,
1247 0x0000000f, 0x0a960003, 0x00000000, 0x0a955c00, 0x00000000, 0x4a005a00,
1248 0x00000000, 0x0c960a00, 0x00000009, 0x0c99ffff, 0x00000008, 0x0d00ffff,
1249 0x00000010, 0xb1963202, 0x00000008, 0x0f800005, 0x00000010, 0x00220020,
1250 0x00000000, 0x02a70000, 0x00000010, 0xb1850002, 0x00000008, 0x82850200,
1251 0x00000000, 0x02000000, 0x00000000, 0x03a60000, 0x00000018, 0x8000004e,
1252 0x00000000, 0x072b0000, 0x00000001, 0x878c1c00, 0x00000000, 0x870e1e00,
1253 0x00000000, 0x860c1e00, 0x00000000, 0x03061e00, 0x00000010, 0xb18e0003,
1254 0x00000018, 0x80000047, 0x00000018, 0x8000fffa, 0x00000010, 0x918c0003,
1255 0x00000010, 0xb1870002, 0x00000018, 0x80000043, 0x00000010, 0x91d40000,
1256 0x0000000c, 0x29800001, 0x00000000, 0x2a860000, 0x00000000, 0x230c0000,
1257 0x00000000, 0x2b070000, 0x00000010, 0xb187000e, 0x00000008, 0x2a000008,
1258 0x00000018, 0x8000003b, 0x00000010, 0x91d40000, 0x00000000, 0x28d18c00,
1259 0x00000000, 0x2a860000, 0x00000000, 0x230c0000, 0x00000000, 0x2b070000,
1260 0x00000018, 0x8000fff8, 0x00000010, 0x91d40000, 0x0000000c, 0x29800001,
1261 0x00000000, 0x2aab0000, 0x00000000, 0xa3265600, 0x00000000, 0x2b000000,
1262 0x0000000c, 0x1f800001, 0x00000008, 0x2a000008, 0x00000018, 0x8000fec8,
1263 0x00000010, 0x91d40000, 0x0000000c, 0x29800001, 0x0000000c, 0x1f800001,
1264 0x00000008, 0x2a000009, 0x00000018, 0x8000fec3, 0x00000010, 0x91d40000,
1265 0x0000000c, 0x29800001, 0x0000000c, 0x1f800001, 0x00000000, 0x29420000,
1266 0x00000008, 0x2a000002, 0x00000018, 0x8000febd, 0x00000018, 0x8000febc,
1267 0x00000010, 0xb1bcb016, 0x0000000b, 0x2fdf0002, 0x00000000, 0x03d80000,
1268 0x00000000, 0x2c3c0000, 0x00000008, 0x2c8000b0, 0x00000008, 0x2d000008,
1269 0x00000010, 0x91d40000, 0x00000008, 0x2d800150, 0x00000000, 0x00000000,
1270 0x00000010, 0x205f0000, 0x00000008, 0x2c800000, 0x00000008, 0x2d000000,
1271 0x00000008, 0x2d800108, 0x00000008, 0x07000001, 0x00000010, 0xb5de1c00,
1272 0x00000010, 0x2c620002, 0x00000018, 0x8000000a, 0x0000000b, 0x2fdf0002,
1273 0x00000000, 0x2c070000, 0x0000000c, 0x1f800000, 0x00000010, 0x91de0000,
1274 0x00000018, 0x8000fea6, 0x00000008, 0x2c8000b0, 0x00000008, 0x2d000008,
1275 0x00000010, 0x91d40000, 0x00000008, 0x2d800108, 0x0000000c, 0x29800000,
1276 0x0000000c, 0x1f800000, 0x00000010, 0x91de0000, 0x00000000, 0x2adf0000,
1277 0x00000008, 0x2a000006, 0x00000018, 0x8000fe9c, 0x00000008, 0x03050004,
1278 0x00000006, 0x83040c00, 0x00000008, 0x02850200, 0x00000000, 0x86050c00,
1279 0x00000001, 0x860c0e00, 0x00000008, 0x02040004, 0x00000000, 0x02041800,
1280 0x00000000, 0x83871800, 0x00000018, 0x00020000 };
1281
1282static u32 bnx2_rv2p_proc2[] = {
1283 0x00000000, 0x2a000000, 0x00000010, 0xb1d40000, 0x00000008, 0x02540003,
1284 0x00000018, 0x00040000, 0x00000018, 0x8000000a, 0x00000018, 0x8000000a,
1285 0x00000018, 0x8000000e, 0x00000018, 0x80000056, 0x00000018, 0x800001b9,
1286 0x00000018, 0x800001e1, 0x00000018, 0x8000019b, 0x00000018, 0x800001f9,
1287 0x00000018, 0x8000019f, 0x00000018, 0x800001a6, 0x00000018, 0x80000000,
1288 0x0000000c, 0x29800001, 0x00000000, 0x2a000000, 0x0000000c, 0x29800000,
1289 0x00000010, 0x20530000, 0x00000018, 0x8000ffee, 0x0000000c, 0x29800001,
1290 0x00000010, 0x91de0000, 0x00000010, 0x001f0000, 0x00000000, 0x2f80aa00,
1291 0x00000000, 0x2a000000, 0x00000000, 0x0d610000, 0x00000000, 0x03620000,
1292 0x00000000, 0x2c400000, 0x00000000, 0x02638c00, 0x00000000, 0x26460000,
1293 0x00000010, 0x00420002, 0x00000008, 0x02040012, 0x00000010, 0xb9060836,
1294 0x00000000, 0x0f580000, 0x00000000, 0x0a640000, 0x00000000, 0x0ae50000,
1295 0x00000000, 0x0b660000, 0x00000000, 0x0c000000, 0x00000000, 0x0b800000,
1296 0x00000010, 0x00420009, 0x00000008, 0x0cc60012, 0x00000008, 0x0f800003,
1297 0x00000000, 0x00000000, 0x00000010, 0x009f0000, 0x00000008, 0x27110012,
1298 0x00000000, 0x66900000, 0x00000008, 0xa31b0012, 0x00000018, 0x80000008,
1299 0x00000000, 0x0cc60000, 0x00000008, 0x0f800003, 0x00000000, 0x00000000,
1300 0x00000010, 0x009f0000, 0x00000000, 0x27110000, 0x00000000, 0x66900000,
1301 0x00000000, 0x231b0000, 0x00000010, 0xb197320e, 0x00000000, 0x25960000,
1302 0x00000000, 0x021b0000, 0x00000010, 0x001f0000, 0x00000008, 0x0f800003,
1303 0x0000000c, 0x29800000, 0x00000010, 0x20530000, 0x00000000, 0x22c50800,
1304 0x00000010, 0x009f0000, 0x00000000, 0x27002200, 0x00000000, 0x26802000,
1305 0x00000000, 0x231b0000, 0x0000000c, 0x69520001, 0x00000018, 0x8000fff3,
1306 0x00000010, 0x01130002, 0x00000010, 0xb1980003, 0x00000010, 0x001f0000,
1307 0x00000008, 0x0f800004, 0x00000008, 0x22000003, 0x00000008, 0x2c80000c,
1308 0x00000008, 0x2d00000c, 0x00000010, 0x009f0000, 0x00000000, 0x25960000,
1309 0x0000000c, 0x29800000, 0x00000000, 0x32140000, 0x00000000, 0x32950000,
1310 0x00000000, 0x33160000, 0x00000000, 0x31e32e00, 0x00000008, 0x2d800010,
1311 0x00000010, 0x20530000, 0x00000018, 0x8000ffac, 0x00000000, 0x23000000,
1312 0x00000000, 0x25e60000, 0x00000008, 0x2200000b, 0x0000000c, 0x69520000,
1313 0x0000000c, 0x29800000, 0x00000010, 0x20530000, 0x00000018, 0x8000ffa5,
1314 0x0000000c, 0x29800001, 0x00000010, 0x91de0000, 0x00000000, 0x2fd50000,
1315 0x00000010, 0x001f0000, 0x00000000, 0x02700000, 0x00000000, 0x0d620000,
1316 0x00000000, 0xbb630800, 0x00000000, 0x2a000000, 0x00000009, 0x076000ff,
1317 0x0000000f, 0x2c0e0007, 0x00000008, 0x2c800000, 0x00000008, 0x2d000064,
1318 0x00000008, 0x2d80011c, 0x00000009, 0x06420002, 0x0000000c, 0x61420001,
1319 0x00000000, 0x0f400000, 0x00000000, 0x02d08c00, 0x00000000, 0x23000000,
1320 0x00000004, 0x826da000, 0x00000000, 0x8304a000, 0x00000000, 0x22c50c00,
1321 0x00000000, 0x03760000, 0x00000004, 0x83860a00, 0x00000000, 0x83870c00,
1322 0x00000010, 0x91de0000, 0x00000000, 0x037c0000, 0x00000000, 0x837b0c00,
1323 0x00000001, 0x83060e00, 0x00000000, 0x83870c00, 0x00000000, 0x82850e00,
1324 0x00000010, 0xb1860016, 0x0000000f, 0x47610018, 0x00000000, 0x068e0000,
1325 0x0000000f, 0x47670010, 0x0000000f, 0x47e20010, 0x00000000, 0x870e1e00,
1326 0x00000010, 0xb70e1a10, 0x00000010, 0x0ce7000e, 0x00000008, 0x22000009,
1327 0x00000000, 0x286d0000, 0x0000000f, 0x65680010, 0x00000003, 0xf66c9400,
1328 0x00000010, 0xb972a003, 0x0000000c, 0x73e70019, 0x0000000c, 0x21420004,
1329 0x00000018, 0x8000023f, 0x00000000, 0x37ed0000, 0x0000000c, 0x73e7001a,
1330 0x00000010, 0x20530000, 0x00000008, 0x22000008, 0x0000000c, 0x61420004,
1331 0x00000000, 0x02f60000, 0x00000004, 0x82840a00, 0x00000010, 0xb1840a2b,
1332 0x00000010, 0x2d67000a, 0x00000010, 0xb96d0804, 0x00000004, 0xb6ed0a00,
1333 0x00000000, 0x37ed0000, 0x00000018, 0x80000029, 0x0000000c, 0x61420000,
1334 0x00000000, 0x37040000, 0x00000000, 0x37850000, 0x0000000c, 0x33e7001a,
1335 0x00000018, 0x80000024, 0x00000010, 0xb96d0809, 0x00000004, 0xb6ed0a00,
1336 0x00000000, 0x036d0000, 0x00000004, 0xb76e0c00, 0x00000010, 0x91ee0c1f,
1337 0x0000000c, 0x73e7001a, 0x00000004, 0xb6ef0c00, 0x00000000, 0x37ed0000,
1338 0x00000018, 0x8000001b, 0x0000000c, 0x61420000, 0x00000010, 0xb7ee0a05,
1339 0x00000010, 0xb96f0815, 0x00000003, 0xb76e0800, 0x00000004, 0xb7ef0a00,
1340 0x00000018, 0x80000015, 0x00000010, 0x0ce7000c, 0x00000008, 0x22000009,
1341 0x00000000, 0x286d0000, 0x0000000f, 0x65680010, 0x00000003, 0xf66c9400,
1342 0x00000010, 0xb972a003, 0x0000000c, 0x73e70019, 0x0000000c, 0x21420004,
1343 0x00000018, 0x80000215, 0x00000010, 0x20530000, 0x00000008, 0x22000008,
1344 0x0000000c, 0x61420004, 0x00000000, 0x37040000, 0x00000000, 0x37850000,
1345 0x00000000, 0x036d0000, 0x00000003, 0xb8f10c00, 0x00000018, 0x80000004,
1346 0x00000000, 0x02840000, 0x00000002, 0x21421800, 0x0000000c, 0x61420000,
1347 0x00000000, 0x286d0000, 0x0000000f, 0x65ed0010, 0x00000009, 0x266dffff,
1348 0x00000000, 0x23000000, 0x00000010, 0xb1840a3d, 0x00000010, 0x01420002,
1349 0x00000004, 0xb8f10a00, 0x00000003, 0x83760a00, 0x00000010, 0xb8040c39,
1350 0x00000010, 0xb7e6080a, 0x00000000, 0x0a640000, 0x00000000, 0x0ae50000,
1351 0x00000009, 0x0c68ffff, 0x00000009, 0x0b67ffff, 0x00000000, 0x0be60000,
1352 0x00000000, 0x0c840000, 0x00000010, 0xb197320c, 0x00000008, 0x0f800002,
1353 0x00000018, 0x8000000a, 0x00000000, 0x0a6a0000, 0x00000000, 0x0aeb0000,
1354 0x00000000, 0x0c000000, 0x00000009, 0x0b6cffff, 0x00000000, 0x0be90000,
1355 0x00000000, 0x0c840000, 0x00000010, 0xb1973203, 0x00000008, 0x0f800002,
1356 0x00000018, 0x80000001, 0x00000010, 0x001f0000, 0x00000000, 0x0c860000,
1357 0x00000000, 0x06980000, 0x00000008, 0x0f800003, 0x00000000, 0x00000000,
1358 0x00000010, 0x009f0000, 0x00000010, 0xb1973210, 0x00000000, 0x231b0000,
1359 0x00000000, 0x02043600, 0x00000003, 0x8384a000, 0x0000000f, 0x65870010,
1360 0x00000009, 0x2607ffff, 0x00000000, 0x27111a00, 0x00000000, 0x66900000,
1361 0x0000000c, 0x29000000, 0x00000018, 0x800001de, 0x00000000, 0x06980000,
1362 0x00000010, 0x20530000, 0x00000000, 0x22c58c00, 0x00000010, 0x001f0000,
1363 0x00000008, 0x0f800003, 0x00000018, 0x8000fff0, 0x00000000, 0x02043600,
1364 0x00000000, 0x231b0000, 0x00000003, 0x8384a000, 0x0000000f, 0x65870010,
1365 0x00000009, 0x2607ffff, 0x00000000, 0x27111a00, 0x00000000, 0x66900000,
1366 0x0000000c, 0x29000000, 0x00000010, 0x91840a02, 0x00000002, 0x21421800,
1367 0x00000000, 0x32140000, 0x00000000, 0x32950000, 0x00000005, 0x73e72c00,
1368 0x00000005, 0x74683000, 0x00000000, 0x33170000, 0x00000018, 0x80000138,
1369 0x00000010, 0x91c60004, 0x00000008, 0x07000004, 0x00000010, 0xb1c41c02,
1370 0x00000010, 0x91840a04, 0x00000018, 0x800001c3, 0x00000010, 0x20530000,
1371 0x00000000, 0x22c58c00, 0x00000010, 0xb1840a8e, 0x0000000c, 0x21420006,
1372 0x00000010, 0x0ce7001a, 0x0000000f, 0x43680010, 0x00000000, 0x03f30c00,
1373 0x00000010, 0x91870850, 0x0000000f, 0x46ec0010, 0x00000010, 0xb68d0c4e,
1374 0x00000000, 0x838d0c00, 0x00000000, 0xa3050800, 0x00000001, 0xa3460e00,
1375 0x00000000, 0x02048c00, 0x00000010, 0x91840a02, 0x00000002, 0x21421800,
1376 0x00000010, 0x001f0000, 0x00000008, 0x22000008, 0x00000003, 0x8384a000,
1377 0x0000000f, 0x65870010, 0x00000009, 0x2607ffff, 0x00000000, 0x27750c00,
1378 0x00000000, 0x66f40000, 0x0000000c, 0x29000000, 0x00000018, 0x800001aa,
1379 0x00000000, 0x03068c00, 0x00000003, 0xf4680c00, 0x00000010, 0x20530000,
1380 0x00000000, 0x22c58c00, 0x00000018, 0x8000ffe5, 0x00000000, 0x39760000,
1381 0x00000000, 0x39840000, 0x0000000c, 0x33e70019, 0x00000010, 0x001f0000,
1382 0x00000000, 0x031e0000, 0x00000000, 0x0760fe00, 0x0000000f, 0x0f0e0007,
1383 0x00000000, 0x83850800, 0x00000000, 0x0a7d0000, 0x00000000, 0x0afe0000,
1384 0x00000000, 0x0b7f0000, 0x00000000, 0x0d7a0000, 0x00000000, 0x0c000000,
1385 0x00000000, 0x0bfc0000, 0x00000000, 0x0c970e00, 0x00000008, 0x0f800003,
1386 0x0000000f, 0x47670010, 0x00000008, 0x070e0001, 0x0000000b, 0xc38000ff,
1387 0x00000002, 0x43870000, 0x00000001, 0x33e70e00, 0x0000000f, 0x038e0010,
1388 0x00000002, 0x33e70e00, 0x00000000, 0x28f30000, 0x00000010, 0x009f0000,
1389 0x00000000, 0x02043600, 0x00000010, 0x91840a02, 0x00000002, 0x21421800,
1390 0x00000008, 0x22000006, 0x00000000, 0x231b0000, 0x00000000, 0x23ff0000,
1391 0x00000000, 0x241b0000, 0x00000003, 0x8384a000, 0x0000000f, 0x65870010,
1392 0x00000009, 0x2607ffff, 0x00000000, 0x27110000, 0x00000000, 0x26900000,
1393 0x0000000c, 0x29000000, 0x00000018, 0x8000017e, 0x00000003, 0xf4683600,
1394 0x00000000, 0x3a100000, 0x00000000, 0x3a910000, 0x00000003, 0xf66c2400,
1395 0x00000010, 0x001f0000, 0x00000010, 0xb1923604, 0x00000008, 0x0f800004,
1396 0x00000000, 0x00000000, 0x00000010, 0x009f0000, 0x00000000, 0x3e170000,
1397 0x00000000, 0x3e940000, 0x00000000, 0x3f150000, 0x00000000, 0x3f960000,
1398 0x00000010, 0x001f0000, 0x00000000, 0x0f060000, 0x00000010, 0x20530000,
1399 0x00000000, 0x22c53600, 0x00000018, 0x8000ffac, 0x00000010, 0x001f0000,
1400 0x00000000, 0x031e0000, 0x00000000, 0x83850800, 0x00000009, 0x076000ff,
1401 0x0000000f, 0x0f0e0007, 0x00000000, 0x0c000000, 0x00000000, 0x0a7d0000,
1402 0x00000000, 0x0afe0000, 0x00000000, 0x0b7f0000, 0x00000000, 0x0d7a0000,
1403 0x00000000, 0x0bfc0000, 0x00000000, 0x0c970e00, 0x00000008, 0x0f800003,
1404 0x0000000f, 0x47670010, 0x00000008, 0x070e0001, 0x0000000b, 0xc38000ff,
1405 0x00000002, 0x43870000, 0x00000001, 0x33e70e00, 0x0000000f, 0x038e0010,
1406 0x00000002, 0x33e70e00, 0x00000000, 0x39840000, 0x00000003, 0xb9720800,
1407 0x00000000, 0x28f30000, 0x0000000f, 0x65680010, 0x00000010, 0x009f0000,
1408 0x00000000, 0x02043600, 0x00000010, 0x91840a02, 0x00000002, 0x21421800,
1409 0x00000008, 0x22000007, 0x00000000, 0x231b0000, 0x00000000, 0x23ff0000,
1410 0x00000000, 0x241b0000, 0x00000003, 0x8384a000, 0x0000000f, 0x65870010,
1411 0x00000009, 0x2607ffff, 0x00000000, 0x27110000, 0x00000000, 0x26900000,
1412 0x0000000c, 0x29000000, 0x00000018, 0x80000145, 0x00000003, 0xf4683600,
1413 0x00000000, 0x3a100000, 0x00000000, 0x3a910000, 0x00000003, 0xf66c2400,
1414 0x00000010, 0x001f0000, 0x00000010, 0xb1923604, 0x00000008, 0x0f800004,
1415 0x00000000, 0x00000000, 0x00000010, 0x009f0000, 0x00000000, 0x3e170000,
1416 0x00000000, 0x3e940000, 0x00000000, 0x3f150000, 0x00000000, 0x3f960000,
1417 0x00000010, 0x001f0000, 0x00000000, 0x0f060000, 0x00000010, 0x20530000,
1418 0x00000000, 0x22c53600, 0x00000018, 0x8000ff73, 0x00000010, 0x0ce70005,
1419 0x00000008, 0x2c80000c, 0x00000008, 0x2d000070, 0x00000008, 0x2d800010,
1420 0x00000000, 0x00000000, 0x00000010, 0x205f0000, 0x00000018, 0x8000011d,
1421 0x00000000, 0x2c1e0000, 0x00000008, 0x2c8000b8, 0x00000008, 0x2d000010,
1422 0x00000008, 0x2d800048, 0x00000000, 0x00000000, 0x00000010, 0x91de0000,
1423 0x00000018, 0x8000fe5d, 0x0000000c, 0x29800001, 0x00000000, 0x2a000000,
1424 0x00000010, 0x001f0000, 0x00000000, 0x0f008000, 0x00000008, 0x0f800007,
1425 0x00000018, 0x80000006, 0x0000000c, 0x29800001, 0x00000000, 0x2a000000,
1426 0x00000010, 0x001f0000, 0x0000000f, 0x0f470007, 0x00000008, 0x0f800008,
1427 0x00000018, 0x80000119, 0x00000010, 0x20530000, 0x00000018, 0x8000fe4f,
1428 0x0000000c, 0x29800001, 0x00000010, 0x91de0000, 0x00000000, 0x2fd50000,
1429 0x00000000, 0x2a000000, 0x00000009, 0x0261ffff, 0x0000000d, 0x70e10001,
1430 0x00000018, 0x80000101, 0x00000000, 0x2c400000, 0x00000008, 0x2c8000c4,
1431 0x00000008, 0x2d00001c, 0x00000008, 0x2d800001, 0x00000005, 0x70e10800,
1432 0x00000010, 0x91de0000, 0x00000018, 0x8000fe41, 0x0000000c, 0x29800001,
1433 0x00000010, 0x91de0000, 0x00000000, 0x2fd50000, 0x00000010, 0x001f0000,
1434 0x00000000, 0x02700000, 0x00000000, 0x0d620000, 0x00000000, 0xbb630800,
1435 0x00000000, 0x2a000000, 0x00000000, 0x0f400000, 0x00000000, 0x2c400000,
1436 0x0000000c, 0x73e7001b, 0x00000010, 0x0ce7000e, 0x00000000, 0x286d0000,
1437 0x0000000f, 0x65ed0010, 0x00000009, 0x266dffff, 0x00000018, 0x80000069,
1438 0x00000008, 0x02000004, 0x00000010, 0x91c40803, 0x00000018, 0x800000f6,
1439 0x00000010, 0x20530000, 0x00000018, 0x800000e5, 0x00000008, 0x2c8000b8,
1440 0x00000008, 0x2d000010, 0x00000008, 0x2d800048, 0x00000018, 0x80000005,
1441 0x00000008, 0x2c8000c4, 0x00000008, 0x2d00001c, 0x00000008, 0x2d800001,
1442 0x00000000, 0x00000000, 0x00000010, 0x205f0000, 0x00000008, 0x2c800048,
1443 0x00000008, 0x2d000068, 0x00000008, 0x2d800104, 0x00000000, 0x00000000,
1444 0x00000010, 0x91de0000, 0x00000000, 0x27f60000, 0x00000010, 0xb87a9e04,
1445 0x00000008, 0x2200000d, 0x00000018, 0x800000e2, 0x00000010, 0x20530000,
1446 0x00000018, 0x8000fe18, 0x0000000c, 0x29800001, 0x00000010, 0x91de0000,
1447 0x00000000, 0x2fd50000, 0x00000010, 0x001f0000, 0x00000000, 0x02700000,
1448 0x00000000, 0x0d620000, 0x00000000, 0xbb630800, 0x00000000, 0x2a000000,
1449 0x00000010, 0x0e670011, 0x00000000, 0x286d0000, 0x0000000f, 0x65ed0010,
1450 0x00000009, 0x266dffff, 0x00000004, 0xb8f1a000, 0x00000000, 0x0f400000,
1451 0x0000000c, 0x73e7001c, 0x00000018, 0x80000040, 0x00000008, 0x02000004,
1452 0x00000010, 0x91c40802, 0x00000018, 0x800000cd, 0x00000000, 0x2c1e0000,
1453 0x00000008, 0x2c8000b8, 0x00000008, 0x2d000010, 0x00000008, 0x2d800048,
1454 0x00000010, 0x20530000, 0x00000010, 0x91de0000, 0x00000018, 0x8000fdfe,
1455 0x0000000c, 0x29800001, 0x00000000, 0x03550000, 0x00000000, 0x06460000,
1456 0x00000000, 0x03d60000, 0x00000000, 0x2a000000, 0x0000000f, 0x0f480007,
1457 0x00000010, 0xb18c0027, 0x0000000f, 0x47420008, 0x00000009, 0x070e000f,
1458 0x00000008, 0x070e0008, 0x00000010, 0x001f0000, 0x00000008, 0x09000001,
1459 0x00000007, 0x09121c00, 0x00000003, 0xcbca9200, 0x00000000, 0x0b97a200,
1460 0x00000007, 0x4b171c00, 0x0000000f, 0x0a960003, 0x00000000, 0x0a959c00,
1461 0x00000000, 0x4a009a00, 0x00000008, 0x82120001, 0x00000001, 0x0c170800,
1462 0x00000000, 0x02180000, 0x00000000, 0x0c971800, 0x00000008, 0x0d00ffff,
1463 0x00000008, 0x0f800006, 0x0000000c, 0x29000000, 0x00000008, 0x22000001,
1464 0x00000000, 0x22c50c00, 0x00000010, 0x009f0000, 0x00000010, 0xb197320b,
1465 0x00000000, 0x231b0000, 0x00000000, 0x27110800, 0x00000000, 0x66900000,
1466 0x00000018, 0x800000a4, 0x00000000, 0x02180000, 0x00000010, 0x20530000,
1467 0x00000000, 0x22c53600, 0x00000010, 0x001f0000, 0x00000008, 0x0f800006,
1468 0x00000018, 0x8000fff5, 0x00000010, 0x91870002, 0x00000008, 0x2200000a,
1469 0x00000000, 0x231b0000, 0x00000000, 0x27110800, 0x00000000, 0x66900000,
1470 0x00000018, 0x80000098, 0x00000008, 0x0200000a, 0x00000010, 0x91c40804,
1471 0x00000010, 0x02c20003, 0x00000010, 0x001f0000, 0x00000008, 0x0f800008,
1472 0x00000010, 0x20530000, 0x00000018, 0x8000fdc9, 0x00000000, 0x06820000,
1473 0x00000010, 0x001f0000, 0x00000010, 0x0ce70028, 0x00000000, 0x03720000,
1474 0x00000000, 0xa8760c00, 0x00000000, 0x0cf60000, 0x00000010, 0xb8723224,
1475 0x00000000, 0x03440000, 0x00000008, 0x22000010, 0x00000000, 0x03ca0000,
1476 0x0000000f, 0x65680010, 0x00000000, 0x0bcf0000, 0x00000000, 0x27f20000,
1477 0x00000010, 0xb7ef3203, 0x0000000c, 0x21420004, 0x0000000c, 0x73e70019,
1478 0x00000000, 0x07520000, 0x00000000, 0x29000000, 0x00000018, 0x8000007e,
1479 0x00000004, 0xb9723200, 0x00000010, 0x20530000, 0x00000000, 0x22060000,
1480 0x0000000c, 0x61420004, 0x00000000, 0x25070000, 0x00000000, 0x27970000,
1481 0x00000000, 0x290e0000, 0x00000010, 0x0ce70010, 0x00000010, 0xb873320f,
1482 0x0000000f, 0x436c0010, 0x00000000, 0x03f30c00, 0x00000000, 0x03f30000,
1483 0x00000000, 0x83990e00, 0x00000001, 0x83860e00, 0x00000000, 0x83060e00,
1484 0x00000003, 0xf66c0c00, 0x00000000, 0x39f30e00, 0x00000000, 0x3af50e00,
1485 0x00000000, 0x7a740000, 0x0000000f, 0x43680010, 0x00000001, 0x83860e00,
1486 0x00000000, 0x83060e00, 0x00000003, 0xf4680c00, 0x00000000, 0x286d0000,
1487 0x00000000, 0x03690000, 0x00000010, 0xb1f60c54, 0x00000000, 0x0a6a0000,
1488 0x00000000, 0x0aeb0000, 0x00000009, 0x0b6cffff, 0x00000000, 0x0c000000,
1489 0x00000000, 0x0be90000, 0x00000003, 0x8cf6a000, 0x0000000c, 0x09800002,
1490 0x00000010, 0x009f0000, 0x00000010, 0xb8173209, 0x00000000, 0x35140000,
1491 0x00000000, 0x35950000, 0x00000005, 0x766c2c00, 0x00000000, 0x34970000,
1492 0x00000004, 0xb8f12e00, 0x00000010, 0x001f0000, 0x00000008, 0x0f800004,
1493 0x00000018, 0x8000fff7, 0x00000000, 0x03e90000, 0x00000010, 0xb8f6a01a,
1494 0x00000010, 0x20130019, 0x00000010, 0xb1f10e18, 0x00000000, 0x83973200,
1495 0x00000000, 0x38700e00, 0x00000000, 0xbb760e00, 0x00000000, 0x37d00000,
1496 0x0000000c, 0x73e7001a, 0x00000003, 0xb8f1a000, 0x00000000, 0x32140000,
1497 0x00000000, 0x32950000, 0x00000005, 0x73e72c00, 0x00000000, 0x33190000,
1498 0x00000005, 0x74680000, 0x00000010, 0x0ce7000d, 0x00000008, 0x22000009,
1499 0x00000000, 0x07520000, 0x00000000, 0x29000000, 0x0000000c, 0x73e70019,
1500 0x0000000f, 0x65680010, 0x0000000c, 0x21420004, 0x00000018, 0x8000003c,
1501 0x00000010, 0x20530000, 0x0000000c, 0x61420004, 0x00000000, 0x290e0000,
1502 0x00000018, 0x80000002, 0x00000010, 0x91973206, 0x00000000, 0x35140000,
1503 0x00000000, 0x35950000, 0x00000005, 0x766c2c00, 0x00000000, 0x34990000,
1504 0x00000004, 0xb8f13200, 0x00000000, 0x83690c00, 0x00000010, 0xb1860013,
1505 0x00000000, 0x28e90000, 0x00000008, 0x22000004, 0x00000000, 0x23ec0000,
1506 0x00000000, 0x03690000, 0x00000010, 0xb8660c07, 0x00000009, 0x036cffff,
1507 0x00000000, 0x326a0000, 0x00000000, 0x32eb0000, 0x00000005, 0x73e70c00,
1508 0x00000000, 0x33690000, 0x00000005, 0x74680000, 0x0000000c, 0x73e7001c,
1509 0x00000000, 0x03690000, 0x00000010, 0xb1f60c12, 0x00000010, 0xb1d00c11,
1510 0x0000000c, 0x21420005, 0x0000000c, 0x33e7001c, 0x00000018, 0x8000000e,
1511 0x00000010, 0x2e67000d, 0x00000000, 0x03690000, 0x00000010, 0xb1f60c0b,
1512 0x00000010, 0xb1d00c0a, 0x00000000, 0x03440000, 0x00000008, 0x2200000c,
1513 0x00000000, 0x07520000, 0x00000000, 0x29000000, 0x00000018, 0x80000015,
1514 0x0000000c, 0x33e7001c, 0x00000010, 0x20530000, 0x00000000, 0x22060000,
1515 0x00000000, 0x290e0000, 0x00000018, 0x000d0000, 0x00000000, 0x06820000,
1516 0x00000010, 0x2de7000d, 0x00000010, 0x0ce7000c, 0x00000000, 0x27f20000,
1517 0x00000010, 0xb96d9e0a, 0x00000000, 0xa86d9e00, 0x00000009, 0x0361ffff,
1518 0x00000010, 0xb7500c07, 0x00000008, 0x2200000f, 0x0000000f, 0x65680010,
1519 0x00000000, 0x29000000, 0x00000018, 0x80000004, 0x0000000c, 0x33e7001b,
1520 0x00000010, 0x20530000, 0x00000018, 0x000d0000, 0x00000000, 0x2b820000,
1521 0x00000010, 0x20d2002f, 0x00000010, 0x0052002e, 0x00000009, 0x054e0007,
1522 0x00000010, 0xb18a002c, 0x00000000, 0x050a8c00, 0x00000008, 0x850a0008,
1523 0x00000010, 0x918a0029, 0x00000003, 0xc5008800, 0x00000008, 0xa3460001,
1524 0x00000010, 0xb1c60007, 0x00000008, 0x22000001, 0x0000000c, 0x29800000,
1525 0x00000010, 0x20530000, 0x00000000, 0x274e8c00, 0x00000000, 0x66cd0000,
1526 0x00000000, 0x22c58c00, 0x00000008, 0x22000014, 0x00000003, 0x22c58e00,
1527 0x00000003, 0x23c58e00, 0x00000003, 0x22c58e00, 0x00000003, 0x26cd9e00,
1528 0x00000003, 0x27cd9e00, 0x00000003, 0x26cd9e00, 0x00000003, 0x274ea000,
1529 0x00000003, 0x284ea000, 0x00000003, 0x274ea000, 0x0000000c, 0x69520000,
1530 0x0000000c, 0x29800000, 0x00000010, 0x20530000, 0x00000003, 0x22c58e00,
1531 0x00000003, 0x23c58e00, 0x00000003, 0x22c58e00, 0x00000003, 0x26cd9e00,
1532 0x00000003, 0x27cd9e00, 0x00000003, 0x26cd9e00, 0x00000003, 0x274ea000,
1533 0x00000003, 0x284ea000, 0x00000003, 0x274ea000, 0x00000000, 0xa2c58c00,
1534 0x00000000, 0xa74e8c00, 0x00000000, 0xe6cd0000, 0x0000000f, 0x620a0010,
1535 0x00000008, 0x23460001, 0x0000000c, 0x29800000, 0x00000010, 0x20530000,
1536 0x0000000c, 0x29520000, 0x00000018, 0x80000002, 0x0000000c, 0x29800000,
1537 0x00000018, 0x00570000 };
1538
1539static int bnx2_TPAT_b06FwReleaseMajor = 0x0;
1540static int bnx2_TPAT_b06FwReleaseMinor = 0x0;
1541static int bnx2_TPAT_b06FwReleaseFix = 0x0;
1542static u32 bnx2_TPAT_b06FwStartAddr = 0x08000858;
1543static u32 bnx2_TPAT_b06FwTextAddr = 0x08000800;
1544static int bnx2_TPAT_b06FwTextLen = 0x1314;
1545static u32 bnx2_TPAT_b06FwDataAddr = 0x08001b40;
1546static int bnx2_TPAT_b06FwDataLen = 0x0;
1547static u32 bnx2_TPAT_b06FwRodataAddr = 0x00000000;
1548static int bnx2_TPAT_b06FwRodataLen = 0x0;
1549static u32 bnx2_TPAT_b06FwBssAddr = 0x08001b90;
1550static int bnx2_TPAT_b06FwBssLen = 0x80;
1551static u32 bnx2_TPAT_b06FwSbssAddr = 0x08001b40;
1552static int bnx2_TPAT_b06FwSbssLen = 0x48;
1553
1554static u32 bnx2_TPAT_b06FwText[(0x1314/4) + 1] = {
1555 0x0a000216, 0x00000000, 0x00000000, 0x0000000d, 0x74706174, 0x20302e36,
1556 0x2e390000, 0x00060901, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1557 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1558 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000003,
1559 0x00000000, 0x0000000d, 0x0000000d, 0x3c020800, 0x24421b40, 0x3c030800,
1560 0x24631c10, 0xac400000, 0x0043202b, 0x1480fffd, 0x24420004, 0x3c1d0800,
1561 0x37bd3ffc, 0x03a0f021, 0x3c100800, 0x26100858, 0x3c1c0800, 0x279c1b40,
1562 0x0e00051f, 0x00000000, 0x0000000d, 0x8f820024, 0x27bdffe8, 0xafbf0014,
1563 0x10400004, 0xafb00010, 0x0000000d, 0x00000000, 0x2400015f, 0x8f82001c,
1564 0x8c450008, 0x24030800, 0xaf430178, 0x97430104, 0x3c020008, 0xaf420140,
1565 0x8f820034, 0x30420001, 0x10400006, 0x3070ffff, 0x24020002, 0x2603fffe,
1566 0xa7420146, 0x0a000246, 0xa7430148, 0xa7400146, 0x8f850034, 0x30a20020,
1567 0x0002102b, 0x00021023, 0x30460009, 0x30a30c00, 0x24020400, 0x14620002,
1568 0x34c40001, 0x34c40005, 0xa744014a, 0x3c020800, 0x8c440820, 0x3c030048,
1569 0x24020002, 0x00832025, 0x30a30006, 0x1062000d, 0x2c620003, 0x50400005,
1570 0x24020004, 0x10600012, 0x3c020001, 0x0a000271, 0x00000000, 0x10620007,
1571 0x24020006, 0x1462000f, 0x3c020111, 0x0a000269, 0x00821025, 0x0a000268,
1572 0x3c020101, 0x3c020011, 0x00821025, 0x24030001, 0xaf421000, 0xaf830030,
1573 0x0a000271, 0x00000000, 0x00821025, 0xaf421000, 0xaf800030, 0x00000000,
1574 0x00000000, 0x00000000, 0x00000000, 0x8f830030, 0x1060003f, 0x3c048000,
1575 0x8f421000, 0x00441024, 0x1040fffd, 0x00000000, 0x10600039, 0x00000000,
1576 0x8f421000, 0x3c030020, 0x00431024, 0x10400034, 0x00000000, 0x97421014,
1577 0x14400031, 0x00000000, 0x97421008, 0x8f84001c, 0x24420006, 0x00024082,
1578 0x00081880, 0x00643821, 0x8ce50000, 0x30430003, 0x30420001, 0x10400004,
1579 0x00000000, 0x0000000d, 0x0a0002b0, 0x00081080, 0x5460000f, 0x30a5ffff,
1580 0x3c06ffff, 0x00a62824, 0x0005182b, 0x00a61026, 0x0002102b, 0x00621824,
1581 0x10600004, 0x00000000, 0x0000000d, 0x00000000, 0x240001fc, 0x8ce20000,
1582 0x0a0002af, 0x00462825, 0x0005182b, 0x38a2ffff, 0x0002102b, 0x00621824,
1583 0x10600004, 0x00000000, 0x0000000d, 0x00000000, 0x24000206, 0x8ce20000,
1584 0x3445ffff, 0x00081080, 0x00441021, 0x3c030800, 0xac450000, 0x8c620840,
1585 0x24420001, 0xac620840, 0x8f820008, 0x10400003, 0x00000000, 0x0e000660,
1586 0x00000000, 0x8f840028, 0x02002821, 0x24820008, 0x30421fff, 0x24434000,
1587 0x0343d821, 0x30a30007, 0xaf840018, 0xaf820028, 0xaf420084, 0x10600002,
1588 0x24a20007, 0x3045fff8, 0x8f820044, 0x8f840004, 0x00451821, 0xaf82002c,
1589 0x0064102b, 0xaf830044, 0x14400002, 0x00641023, 0xaf820044, 0x8f840044,
1590 0x34028000, 0x8fbf0014, 0x8fb00010, 0x00821021, 0x03421821, 0x3c021000,
1591 0xaf83001c, 0xaf440080, 0xaf420178, 0x03e00008, 0x27bd0018, 0x8f820024,
1592 0x27bdffe8, 0xafbf0014, 0x10400004, 0xafb00010, 0x0000000d, 0x00000000,
1593 0x24000249, 0x8f85001c, 0x24020001, 0xaf820024, 0x8ca70008, 0xa3800023,
1594 0x8f620004, 0x3c100800, 0x26041b90, 0x00021402, 0xa3820010, 0x304600ff,
1595 0x24c60005, 0x0e00064a, 0x00063082, 0x8f640004, 0x8f430108, 0x3c021000,
1596 0x00621824, 0xa7840020, 0x10600008, 0x00000000, 0x97420104, 0x93830023,
1597 0x2442ffec, 0x34630002, 0xa3830023, 0x0a000304, 0x3045ffff, 0x97420104,
1598 0x2442fff0, 0x3045ffff, 0x8f620004, 0x3042ffff, 0x2c420013, 0x14400004,
1599 0x00000000, 0x93820023, 0x34420001, 0xa3820023, 0x93830023, 0x24020001,
1600 0x10620009, 0x28620002, 0x14400014, 0x24020002, 0x10620012, 0x24020003,
1601 0x1062000a, 0x00000000, 0x0a000325, 0x00000000, 0x8f82001c, 0x8c43000c,
1602 0x3c04ffff, 0x00641824, 0x00651825, 0x0a000325, 0xac43000c, 0x8f82001c,
1603 0x8c430010, 0x3c04ffff, 0x00641824, 0x00651825, 0xac430010, 0x8f620004,
1604 0x3042ffff, 0x24420002, 0x00021083, 0xa3820038, 0x304500ff, 0x8f82001c,
1605 0x3c04ffff, 0x00052880, 0x00a22821, 0x8ca70000, 0x97820020, 0x97430104,
1606 0x00e42024, 0x24420002, 0x00621823, 0x00833825, 0xaca70000, 0x93840038,
1607 0x26061b90, 0x00041080, 0x00461021, 0x90430000, 0x3063000f, 0x00832021,
1608 0xa3840022, 0x308200ff, 0x3c04fff6, 0x24420003, 0x00021080, 0x00461021,
1609 0x8c450000, 0x93830022, 0x8f82001c, 0x3484ffff, 0x00a43824, 0x00031880,
1610 0x00621821, 0xaf850000, 0xac67000c, 0x93820022, 0x93830022, 0x8f84001c,
1611 0x24420003, 0x00021080, 0x00461021, 0x24630004, 0x00031880, 0xac470000,
1612 0x93820022, 0x00661821, 0x94670002, 0x00021080, 0x00441021, 0xac670000,
1613 0x24030010, 0xac470010, 0xa7430140, 0x24030002, 0xa7400142, 0xa7400144,
1614 0xa7430146, 0x97420104, 0x8f840034, 0x24030001, 0x2442fffe, 0x30840006,
1615 0xa7420148, 0x24020002, 0xa743014a, 0x1082000d, 0x2c820003, 0x10400005,
1616 0x24020004, 0x10800011, 0x3c020009, 0x0a000383, 0x00000000, 0x10820007,
1617 0x24020006, 0x1482000d, 0x3c020119, 0x0a00037d, 0x24030001, 0x0a00037c,
1618 0x3c020109, 0x3c020019, 0x24030001, 0xaf421000, 0xaf830030, 0x0a000383,
1619 0x00000000, 0xaf421000, 0xaf800030, 0x00000000, 0x00000000, 0x00000000,
1620 0x00000000, 0x93820010, 0x24030008, 0x8f840030, 0x24420002, 0x30420007,
1621 0x00621823, 0x30630007, 0xaf83000c, 0x10800005, 0x3c038000, 0x8f421000,
1622 0x00431024, 0x1040fffd, 0x00000000, 0x8f820028, 0xaf820018, 0x24420010,
1623 0x30421fff, 0xaf820028, 0xaf420084, 0x97430104, 0x24424000, 0x0342d821,
1624 0x3063ffff, 0x30620007, 0x10400002, 0x24620007, 0x3043fff8, 0x8f820044,
1625 0x8f840004, 0x00431821, 0xaf82002c, 0x0064102b, 0xaf830044, 0x14400002,
1626 0x00641023, 0xaf820044, 0x8f840044, 0x34028000, 0x8fbf0014, 0x8fb00010,
1627 0x00821021, 0x03421821, 0x3c021000, 0xaf83001c, 0xaf440080, 0xaf420178,
1628 0x03e00008, 0x27bd0018, 0x8f820024, 0x27bdffe8, 0xafbf0014, 0x14400004,
1629 0xafb00010, 0x0000000d, 0x00000000, 0x240002db, 0x8f620004, 0x04410009,
1630 0x3c050800, 0x93820022, 0x8f830000, 0x24a41b90, 0xaf800024, 0x24420003,
1631 0x00021080, 0x00441021, 0xac430000, 0x93820038, 0x24a51b90, 0x93860010,
1632 0x3c040001, 0x27700008, 0x24420001, 0x00021080, 0x00451021, 0x8c430000,
1633 0x24c60005, 0x00063082, 0x00641821, 0x02002021, 0x0e00064a, 0xac430000,
1634 0x93840022, 0x3c057fff, 0x8f620004, 0x00042080, 0x00902021, 0x8c830004,
1635 0x34a5ffff, 0x00451024, 0x00621821, 0xac830004, 0x93850038, 0x3c07ffff,
1636 0x93840010, 0x00052880, 0x00b02821, 0x8ca30000, 0x97420104, 0x97860020,
1637 0x00671824, 0x00441021, 0x00461023, 0x3042ffff, 0x00621825, 0xaca30000,
1638 0x93830023, 0x24020001, 0x10620009, 0x28620002, 0x1440001a, 0x24020002,
1639 0x10620018, 0x24020003, 0x1062000d, 0x00000000, 0x0a000411, 0x00000000,
1640 0x93820010, 0x97430104, 0x8e04000c, 0x00621821, 0x2463fff2, 0x3063ffff,
1641 0x00872024, 0x00832025, 0x0a000411, 0xae04000c, 0x93820010, 0x97430104,
1642 0x8e040010, 0x00621821, 0x2463ffee, 0x3063ffff, 0x00872024, 0x00832025,
1643 0xae040010, 0x9783000e, 0x8f840034, 0x2402000a, 0xa7420140, 0xa7430142,
1644 0x93820010, 0xa7420144, 0xa7400146, 0x97430104, 0x30840006, 0x24020001,
1645 0xa7430148, 0xa742014a, 0x24020002, 0x1082000d, 0x2c820003, 0x10400005,
1646 0x24020004, 0x10800011, 0x3c020041, 0x0a000437, 0x00000000, 0x10820007,
1647 0x24020006, 0x1482000d, 0x3c020151, 0x0a000431, 0x24030001, 0x0a000430,
1648 0x3c020141, 0x3c020051, 0x24030001, 0xaf421000, 0xaf830030, 0x0a000437,
1649 0x00000000, 0xaf421000, 0xaf800030, 0x00000000, 0x00000000, 0x00000000,
1650 0x00000000, 0x8f820030, 0x93840010, 0x8f850028, 0x10400005, 0x3c038000,
1651 0x8f421000, 0x00431024, 0x1040fffd, 0x00000000, 0x2483000a, 0x30620007,
1652 0x10400002, 0x24620007, 0x304303f8, 0x00a31021, 0x30421fff, 0xaf850018,
1653 0xaf820028, 0xaf420084, 0x97430104, 0x24424000, 0x0342d821, 0x3063ffff,
1654 0x30620007, 0x10400002, 0x24620007, 0x3043fff8, 0x8f820044, 0x8f840004,
1655 0x00431821, 0xaf82002c, 0x0064102b, 0xaf830044, 0x14400002, 0x00641023,
1656 0xaf820044, 0x8f840044, 0x34028000, 0x8fbf0014, 0x8fb00010, 0x00821021,
1657 0x03421821, 0x3c021000, 0xaf83001c, 0xaf440080, 0xaf420178, 0x03e00008,
1658 0x27bd0018, 0x3c026000, 0x8c444448, 0x3c030800, 0xac64082c, 0x8f620000,
1659 0x97430104, 0x3c048000, 0x3046ffff, 0x3067ffff, 0x8f420178, 0x00441024,
1660 0x1440fffd, 0x2402000a, 0x30c30007, 0xa7420140, 0x24020008, 0x00431023,
1661 0x30420007, 0x24c3fffe, 0xa7420142, 0xa7430144, 0xa7400146, 0xa7470148,
1662 0x8f420108, 0x3c036000, 0x8f850034, 0x30420020, 0x0002102b, 0x00021023,
1663 0x30420009, 0x34420001, 0xa742014a, 0x8c644448, 0x3c020800, 0x30a50006,
1664 0xac440830, 0x24020002, 0x10a2000d, 0x2ca20003, 0x10400005, 0x24020004,
1665 0x10a00011, 0x3c020041, 0x0a0004a8, 0x00000000, 0x10a20007, 0x24020006,
1666 0x14a2000d, 0x3c020151, 0x0a0004a2, 0x24030001, 0x0a0004a1, 0x3c020141,
1667 0x3c020051, 0x24030001, 0xaf421000, 0xaf830030, 0x0a0004a8, 0x00000000,
1668 0xaf421000, 0xaf800030, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1669 0x8f820030, 0x24c30008, 0x10400006, 0x30e6ffff, 0x3c048000, 0x8f421000,
1670 0x00441024, 0x1040fffd, 0x00000000, 0x3c026000, 0x8c444448, 0x3065ffff,
1671 0x3c020800, 0x30a30007, 0x10600003, 0xac440834, 0x24a20007, 0x3045fff8,
1672 0x8f840028, 0x00851021, 0x30421fff, 0x24434000, 0x0343d821, 0x30c30007,
1673 0xaf840018, 0xaf820028, 0xaf420084, 0x10600002, 0x24c20007, 0x3046fff8,
1674 0x8f820044, 0x8f840004, 0x00461821, 0xaf82002c, 0x0064102b, 0xaf830044,
1675 0x14400002, 0x00641023, 0xaf820044, 0x8f840044, 0x34028000, 0x3c030800,
1676 0x8c650844, 0x00821021, 0x03421821, 0xaf83001c, 0xaf440080, 0x10a00006,
1677 0x2402000e, 0x93830043, 0x14620004, 0x3c021000, 0x2402043f, 0xa7420148,
1678 0x3c021000, 0x3c036000, 0xaf420178, 0x8c644448, 0x3c020800, 0x03e00008,
1679 0xac440838, 0x8f820034, 0x30424000, 0x10400005, 0x24020800, 0x0000000d,
1680 0x00000000, 0x24000405, 0x24020800, 0xaf420178, 0x97440104, 0x3c030008,
1681 0xaf430140, 0x8f820034, 0x30420001, 0x10400006, 0x3085ffff, 0x24020002,
1682 0x24a3fffe, 0xa7420146, 0x0a0004ff, 0xa7430148, 0xa7400146, 0x8f840028,
1683 0x2402000d, 0xa742014a, 0x24830008, 0x30631fff, 0x24624000, 0x0342d821,
1684 0x30a20007, 0xaf840018, 0xaf830028, 0xaf430084, 0x10400002, 0x24a20007,
1685 0x3045fff8, 0x8f820044, 0x8f840004, 0x00451821, 0xaf82002c, 0x0064102b,
1686 0xaf830044, 0x14400002, 0x00641023, 0xaf820044, 0x8f840044, 0x34028000,
1687 0x00821021, 0x03421821, 0x3c021000, 0xaf83001c, 0xaf440080, 0x03e00008,
1688 0xaf420178, 0x27bdffe8, 0x3c046008, 0xafbf0014, 0xafb00010, 0x8c825000,
1689 0x3c1a8000, 0x2403ff7f, 0x375b4000, 0x00431024, 0x3442380c, 0xac825000,
1690 0x8f430008, 0x3c100800, 0x37428000, 0x34630001, 0xaf430008, 0xaf82001c,
1691 0x3c02601c, 0xaf800028, 0xaf400080, 0xaf400084, 0x8c450008, 0x3c036000,
1692 0x8c620808, 0x3c040800, 0x3c030080, 0xac830820, 0x3042fff0, 0x38420010,
1693 0x2c420001, 0xaf850004, 0xaf820008, 0x0e00062f, 0x00000000, 0x8f420000,
1694 0x30420001, 0x1040fffb, 0x00000000, 0x8f440108, 0x30822000, 0xaf840034,
1695 0x10400004, 0x8e02083c, 0x24420001, 0x0a00059d, 0xae02083c, 0x30820200,
1696 0x10400027, 0x00000000, 0x97420104, 0x1040001c, 0x30824000, 0x14400005,
1697 0x00000000, 0x0e00022d, 0x00000000, 0x0a000592, 0x00000000, 0x8f620008,
1698 0x8f630000, 0x24020030, 0x00031e02, 0x306300f0, 0x10620007, 0x28620031,
1699 0x14400031, 0x24020040, 0x10620007, 0x00000000, 0x0a000592, 0x00000000,
1700 0x0e0002dd, 0x00000000, 0x0a000592, 0x00000000, 0x0e0003b8, 0x00000000,
1701 0x0a000592, 0x00000000, 0x30820040, 0x1440002d, 0x00000000, 0x0000000d,
1702 0x00000000, 0x240004a6, 0x0a00059d, 0x00000000, 0x8f430100, 0x24020d00,
1703 0x1462000f, 0x30820006, 0x97420104, 0x10400005, 0x30820040, 0x0e0004e9,
1704 0x00000000, 0x0a000592, 0x00000000, 0x1440001b, 0x00000000, 0x0000000d,
1705 0x00000000, 0x240004b8, 0x0a00059d, 0x00000000, 0x1040000e, 0x30821000,
1706 0x10400005, 0x00000000, 0x0e00065d, 0x00000000, 0x0a000592, 0x00000000,
1707 0x0e00046b, 0x00000000, 0x8f820040, 0x24420001, 0xaf820040, 0x0a00059d,
1708 0x00000000, 0x30820040, 0x14400004, 0x00000000, 0x0000000d, 0x00000000,
1709 0x240004cf, 0x8f420138, 0x3c034000, 0x00431025, 0xaf420138, 0x0a00053f,
1710 0x00000000, 0x3c046008, 0x8c835000, 0x3c1a8000, 0x2402ff7f, 0x375b4000,
1711 0x00621824, 0x3463380c, 0xac835000, 0x8f420008, 0x3c056000, 0x3c03601c,
1712 0x34420001, 0xaf420008, 0x37428000, 0xaf800028, 0xaf82001c, 0xaf400080,
1713 0xaf400084, 0x8c660008, 0x8ca20808, 0x3c040800, 0x3c030080, 0xac830820,
1714 0x3042fff0, 0x38420010, 0x2c420001, 0xaf860004, 0xaf820008, 0x03e00008,
1715 0x00000000, 0x3084ffff, 0x30820007, 0x10400002, 0x24820007, 0x3044fff8,
1716 0x8f820028, 0x00441821, 0x30631fff, 0x24644000, 0x0344d821, 0xaf820018,
1717 0xaf830028, 0x03e00008, 0xaf430084, 0x3084ffff, 0x30820007, 0x10400002,
1718 0x24820007, 0x3044fff8, 0x8f820044, 0x8f830004, 0x00442021, 0xaf82002c,
1719 0x0083102b, 0xaf840044, 0x14400002, 0x00831023, 0xaf820044, 0x8f820044,
1720 0x34038000, 0x00431821, 0x03432021, 0xaf84001c, 0x03e00008, 0xaf420080,
1721 0x8f830034, 0x24020002, 0x30630006, 0x1062000d, 0x2c620003, 0x50400005,
1722 0x24020004, 0x10600012, 0x3c020001, 0x0a000601, 0x00000000, 0x10620007,
1723 0x24020006, 0x1462000f, 0x3c020111, 0x0a0005f9, 0x00821025, 0x0a0005f8,
1724 0x3c020101, 0x3c020011, 0x00821025, 0x24030001, 0xaf421000, 0xaf830030,
1725 0x0a000601, 0x00000000, 0x00821025, 0xaf421000, 0xaf800030, 0x00000000,
1726 0x00000000, 0x00000000, 0x03e00008, 0x00000000, 0x8f820030, 0x10400005,
1727 0x3c038000, 0x8f421000, 0x00431024, 0x1040fffd, 0x00000000, 0x03e00008,
1728 0x00000000, 0x8f820034, 0x27bdffe8, 0x30424000, 0x14400005, 0xafbf0010,
1729 0x0e00022d, 0x00000000, 0x0a00062d, 0x8fbf0010, 0x8f620008, 0x8f630000,
1730 0x24020030, 0x00031e02, 0x306300f0, 0x10620008, 0x28620031, 0x1440000d,
1731 0x8fbf0010, 0x24020040, 0x10620007, 0x00000000, 0x0a00062d, 0x00000000,
1732 0x0e0002dd, 0x00000000, 0x0a00062d, 0x8fbf0010, 0x0e0003b8, 0x00000000,
1733 0x8fbf0010, 0x03e00008, 0x27bd0018, 0x8f84003c, 0x1080000f, 0x3c026000,
1734 0x8c430c3c, 0x30630fff, 0xaf830014, 0x14600011, 0x3082000f, 0x10400005,
1735 0x308200f0, 0x10400003, 0x30820f00, 0x14400006, 0x00000000, 0x0000000d,
1736 0x00000000, 0x2400050e, 0x03e00008, 0x00000000, 0x0000000d, 0x00000000,
1737 0x24000513, 0x03e00008, 0x00000000, 0xaf83003c, 0x03e00008, 0x00000000,
1738 0x10c00007, 0x00000000, 0x8ca20000, 0x24c6ffff, 0x24a50004, 0xac820000,
1739 0x14c0fffb, 0x24840004, 0x03e00008, 0x00000000, 0x0a000659, 0x00a01021,
1740 0xac860000, 0x24840004, 0x00a01021, 0x1440fffc, 0x24a5ffff, 0x03e00008,
1741 0x00000000, 0x0000000d, 0x03e00008, 0x00000000, 0x3c040800, 0x8c82084c,
1742 0x54400007, 0xac80084c, 0x8f820034, 0x24030400, 0x30420c00, 0x1443005b,
1743 0x00000000, 0xac80084c, 0x0000000d, 0x00000000, 0x2400003c, 0x3c026000,
1744 0x8c444448, 0x3c030800, 0xac640850, 0x24000043, 0x97420104, 0x3045ffff,
1745 0x000530c2, 0x24a2007f, 0x000239c2, 0x2400004e, 0x3c046020, 0x24030020,
1746 0xac830000, 0x8c820000, 0x30420020, 0x10400005, 0x3c036020, 0x8c620000,
1747 0x30420020, 0x1440fffd, 0x00000000, 0x3c026020, 0x8c430010, 0x24040001,
1748 0x0087102b, 0x30ea007f, 0x24abfffe, 0x10400010, 0x00034240, 0x3c056020,
1749 0x24090020, 0xaca90000, 0x8ca20000, 0x30420020, 0x10400006, 0x24840001,
1750 0x3c036020, 0x8c620000, 0x30420020, 0x1440fffd, 0x00000000, 0x0087102b,
1751 0x1440fff4, 0x00000000, 0x8f85001c, 0x3c026020, 0x8c430010, 0x3c046020,
1752 0x34848000, 0x006a1825, 0x01034025, 0x2400006b, 0x10c0000b, 0x00000000,
1753 0x8ca30000, 0x24a50004, 0x8ca20000, 0x24a50004, 0x24c6ffff, 0xac820000,
1754 0x24840004, 0xac830000, 0x14c0fff7, 0x24840004, 0x24000077, 0x3c020007,
1755 0x34427700, 0x3c036000, 0xac6223c8, 0xac6b23cc, 0xac6823e4, 0x24000086,
1756 0x3c046000, 0x3c038000, 0x8c8223f8, 0x00431024, 0x1440fffd, 0x3c021000,
1757 0x3c056000, 0x24030019, 0xaca223f8, 0xa743014a, 0x8ca44448, 0x3c020800,
1758 0xac440854, 0x03e00008, 0x00000000, 0x00000000 };
1759
1760static u32 bnx2_TPAT_b06FwData[(0x0/4) + 1] = { 0x00000000 };
1761static u32 bnx2_TPAT_b06FwRodata[(0x0/4) + 1] = { 0x00000000 };
1762static u32 bnx2_TPAT_b06FwBss[(0x80/4) + 1] = { 0x00000000 };
1763static u32 bnx2_TPAT_b06FwSbss[(0x48/4) + 1] = { 0x00000000 };
1764
1765static int bnx2_TXP_b06FwReleaseMajor = 0x0;
1766static int bnx2_TXP_b06FwReleaseMinor = 0x0;
1767static int bnx2_TXP_b06FwReleaseFix = 0x0;
1768static u32 bnx2_TXP_b06FwStartAddr = 0x08002090;
1769static u32 bnx2_TXP_b06FwTextAddr = 0x08000000;
1770static int bnx2_TXP_b06FwTextLen = 0x3ffc;
1771static u32 bnx2_TXP_b06FwDataAddr = 0x08004020;
1772static int bnx2_TXP_b06FwDataLen = 0x0;
1773static u32 bnx2_TXP_b06FwRodataAddr = 0x00000000;
1774static int bnx2_TXP_b06FwRodataLen = 0x0;
1775static u32 bnx2_TXP_b06FwBssAddr = 0x08004060;
1776static int bnx2_TXP_b06FwBssLen = 0x194;
1777static u32 bnx2_TXP_b06FwSbssAddr = 0x08004020;
1778static int bnx2_TXP_b06FwSbssLen = 0x34;
1779static u32 bnx2_TXP_b06FwText[(0x3ffc/4) + 1] = {
1780 0x0a000824, 0x00000000, 0x00000000, 0x0000000d, 0x74787020, 0x302e362e,
1781 0x39000000, 0x00060900, 0x0000000a, 0x000003e8, 0x0000ea60, 0x00000000,
1782 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1783 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1784 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1785 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1786 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1787 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1788 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1789 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1790 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1791 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1792 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1793 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1794 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1795 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1796 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1797 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1798 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1799 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1800 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1801 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1802 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1803 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1804 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1805 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1806 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1807 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1808 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1809 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1810 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1811 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1812 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1813 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1814 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1815 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1816 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1817 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1818 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1819 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1820 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1821 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1822 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1823 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1824 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1825 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1826 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1827 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1828 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1829 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1830 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1831 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1832 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1833 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1834 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1835 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1836 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1837 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1838 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1839 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1840 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1841 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1842 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1843 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1844 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1845 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1846 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1847 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1848 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1849 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1850 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1851 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1852 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1853 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1854 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1855 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1856 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1857 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1858 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1859 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1860 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1861 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1862 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1863 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1864 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1865 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1866 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1867 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1868 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1869 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1870 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1871 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1872 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1873 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1874 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1875 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1876 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1877 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1878 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1879 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1880 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1881 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1882 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1883 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1884 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1885 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1886 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1887 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1888 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1889 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1890 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1891 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1892 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1893 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1894 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1895 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1896 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1897 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1898 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1899 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1900 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1901 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1902 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1903 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1904 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1905 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1906 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1907 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1908 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1909 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1910 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1911 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1912 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1913 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1914 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1915 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1916 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1917 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1918 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1919 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1920 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1921 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1922 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1923 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1924 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1925 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1926 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1927 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1928 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1929 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1930 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1931 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1932 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1933 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1934 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1935 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1936 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1937 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1938 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1939 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1940 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1941 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1942 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1943 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1944 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1945 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1946 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1947 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1948 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1949 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1950 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1951 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1952 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1953 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1954 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1955 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1956 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1957 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1958 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1959 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1960 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1961 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1962 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1963 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1964 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1965 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1966 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1967 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1968 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1969 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1970 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1971 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1972 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1973 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1974 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1975 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1976 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1977 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1978 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1979 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1980 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1981 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1982 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1983 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1984 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1985 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1986 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1987 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1988 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1989 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1990 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1991 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1992 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1993 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1994 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1995 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1996 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1997 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1998 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1999 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2000 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2001 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2002 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2003 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2004 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2005 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2006 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2007 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2008 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2009 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2010 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2011 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2012 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2013 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2014 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2015 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2016 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2017 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2018 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2019 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2020 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2021 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2022 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2023 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2024 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2025 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2026 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2027 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2028 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2029 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2030 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2031 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2032 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2033 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2034 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2035 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2036 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2037 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2038 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2039 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2040 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2041 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2042 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2043 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2044 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2045 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2046 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2047 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2048 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2049 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2050 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2051 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2052 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2053 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2054 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2055 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2056 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2057 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2058 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2059 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2060 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2061 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2062 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2063 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2064 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2065 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2066 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2067 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2068 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2069 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2070 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2071 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2072 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2073 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2074 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2075 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2076 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2077 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2078 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2079 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2080 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2081 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2082 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2083 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2084 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2085 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2086 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2087 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2088 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2089 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2090 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2091 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2092 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2093 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2094 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2095 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2096 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2097 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2098 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2099 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2100 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2101 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2102 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2103 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2104 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2105 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2106 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2107 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2108 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2109 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2110 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2111 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2112 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2113 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2114 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2115 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2116 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2117 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2118 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2119 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2120 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2121 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2122 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2123 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2124 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2125 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2126 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2127 0x00000000, 0x00000000, 0x00000000, 0x10000003, 0x00000000, 0x0000000d,
2128 0x0000000d, 0x3c020800, 0x24424020, 0x3c030800, 0x246341f4, 0xac400000,
2129 0x0043202b, 0x1480fffd, 0x24420004, 0x3c1d0800, 0x37bd7ffc, 0x03a0f021,
2130 0x3c100800, 0x26102090, 0x3c1c0800, 0x279c4020, 0x0e000a0e, 0x00000000,
2131 0x0000000d, 0x8f840014, 0x27bdffe8, 0xafb00010, 0x8f460104, 0x8f830008,
2132 0x8c8500ac, 0xaf430080, 0x948200a8, 0xa7420e10, 0x948300aa, 0xa7430e12,
2133 0x8c8200ac, 0xaf420e18, 0x97430e10, 0xa7430e14, 0x97420e12, 0xa7420e16,
2134 0x8f430e18, 0x00005021, 0x00c53023, 0x10c001a3, 0xaf430e1c, 0x240f0800,
2135 0x3c0e1000, 0x2419fff8, 0x24100010, 0x3c188100, 0x93620008, 0x10400009,
2136 0x00000000, 0x97620010, 0x00c2102b, 0x14400005, 0x00000000, 0x97620010,
2137 0x3042ffff, 0x0a000862, 0xaf420e00, 0xaf460e00, 0x8f420000, 0x30420008,
2138 0x1040fffd, 0x00000000, 0x97420e08, 0x8f450e04, 0x3044ffff, 0x30820001,
2139 0x14400005, 0x00000000, 0x14a00005, 0x3083a040, 0x0a0009e6, 0x00000000,
2140 0x0000000d, 0x3083a040, 0x24020040, 0x14620049, 0x3082a000, 0x8f87000c,
2141 0x30880036, 0x30890008, 0xaf4f0178, 0x00e01821, 0x9742008a, 0x00431023,
2142 0x2442ffff, 0x30421fff, 0x2c420008, 0x1440fffa, 0x00000000, 0x8f830018,
2143 0x00a05021, 0x00c53023, 0x24e24000, 0x03422821, 0x306b00ff, 0x24630001,
2144 0xaf830018, 0x93840012, 0x000b1400, 0x3c030100, 0x00431025, 0xaca20000,
2145 0x8f820018, 0x30840007, 0x00042240, 0x34870001, 0x00e83825, 0x1120000f,
2146 0xaca20004, 0x97430e0a, 0x8f84000c, 0x00ee3825, 0x2402000e, 0x00781825,
2147 0xaf430160, 0x25430006, 0x24840008, 0x30841fff, 0xa742015a, 0xa7430158,
2148 0xaf84000c, 0x0a0008a9, 0x00000000, 0x8f83000c, 0x25420002, 0xa7420158,
2149 0x24630008, 0x30631fff, 0xaf83000c, 0x54c0000c, 0x8f420e14, 0x97420e10,
2150 0x97430e12, 0x8f840014, 0x00021400, 0x00621825, 0xac8300a8, 0x8f850014,
2151 0x8f420e18, 0x34e70040, 0xaca200ac, 0x8f420e14, 0x8f430e1c, 0xaf420144,
2152 0xaf430148, 0xa34b0152, 0xaf470154, 0x0a0009f1, 0xaf4e0178, 0x10400128,
2153 0x00000000, 0x97620010, 0x00a2102b, 0x10400003, 0x30820040, 0x10400122,
2154 0x00000000, 0xafa60008, 0xa7840010, 0xaf850004, 0x93620008, 0x1440005e,
2155 0x27ac0008, 0xaf60000c, 0x97820010, 0x30424000, 0x10400002, 0x2403000e,
2156 0x24030016, 0xa363000a, 0x24034007, 0xaf630014, 0x93820012, 0x8f630014,
2157 0x30420007, 0x00021240, 0x00621825, 0xaf630014, 0x97820010, 0x8f630014,
2158 0x30420010, 0x00621825, 0xaf630014, 0x97820010, 0x30420008, 0x5040000e,
2159 0x00002821, 0x8f620014, 0x004e1025, 0xaf620014, 0x97430e0a, 0x2402000e,
2160 0x00781825, 0xaf630004, 0xa3620002, 0x9363000a, 0x3405fffc, 0x24630004,
2161 0x0a0008f2, 0xa363000a, 0xaf600004, 0xa3600002, 0x97820010, 0x9363000a,
2162 0x30421f00, 0x00021182, 0x24420028, 0x00621821, 0xa3630009, 0x97420e0c,
2163 0xa7620010, 0x93630009, 0x24020008, 0x24630002, 0x30630007, 0x00431023,
2164 0x30420007, 0xa362000b, 0x93640009, 0x97620010, 0x8f890004, 0x97830010,
2165 0x00441021, 0x00a21021, 0x30630040, 0x10600006, 0x3045ffff, 0x15250005,
2166 0x0125102b, 0x3c068000, 0x0a000925, 0x00005821, 0x0125102b, 0x144000c8,
2167 0x00005021, 0x97420e14, 0xa7420e10, 0x97430e16, 0xa7430e12, 0x8f420e1c,
2168 0xaf420e18, 0xaf450e00, 0x8f420000, 0x30420008, 0x1040fffd, 0x00000000,
2169 0x97420e08, 0x00a04821, 0xa7820010, 0x8f430e04, 0x00003021, 0x240b0001,
2170 0xaf830004, 0x97620010, 0x0a000936, 0x304dffff, 0x8f890004, 0x97820010,
2171 0x30420040, 0x10400004, 0x01206821, 0x3c068000, 0x0a000936, 0x00005821,
2172 0x97630010, 0x8f820004, 0x144300a7, 0x00005021, 0x00003021, 0x240b0001,
2173 0x8d820000, 0x00491023, 0x1440000d, 0xad820000, 0x8f620014, 0x34420040,
2174 0xaf620014, 0x97430e10, 0x97420e12, 0x8f840014, 0x00031c00, 0x00431025,
2175 0xac8200a8, 0x8f830014, 0x8f420e18, 0xac6200ac, 0x93620008, 0x1440003f,
2176 0x00000000, 0x25260002, 0x8f84000c, 0x9743008a, 0x3063ffff, 0xafa30000,
2177 0x8fa20000, 0x00441023, 0x2442ffff, 0x30421fff, 0x2c420010, 0x1440fff7,
2178 0x00000000, 0x8f82000c, 0x8f830018, 0x00021082, 0x00021080, 0x24424000,
2179 0x03422821, 0x00605021, 0x24630001, 0x314200ff, 0x00021400, 0xaf830018,
2180 0x3c033200, 0x00431025, 0xaca20000, 0x93630009, 0x9362000a, 0x00031c00,
2181 0x00431025, 0xaca20004, 0x8f830018, 0xaca30008, 0x97820010, 0x30420008,
2182 0x10400002, 0x00c04021, 0x25280006, 0x97430e14, 0x93640002, 0x8f450e1c,
2183 0x8f660004, 0x8f670014, 0xaf4f0178, 0x3063ffff, 0xa7430144, 0x97420e16,
2184 0xa7420146, 0xaf450148, 0xa34a0152, 0x8f82000c, 0x308400ff, 0xa744015a,
2185 0xaf460160, 0xa7480158, 0xaf470154, 0xaf4e0178, 0x00501021, 0x30421fff,
2186 0xaf82000c, 0x0a0009c5, 0x8d820000, 0x93620009, 0x9363000b, 0x8f85000c,
2187 0x2463000a, 0x00435021, 0x25440007, 0x00992024, 0x9743008a, 0x3063ffff,
2188 0xafa30000, 0x8fa20000, 0x00451023, 0x2442ffff, 0x30421fff, 0x0044102b,
2189 0x1440fff7, 0x00000000, 0x8f82000c, 0x8f840018, 0x00021082, 0x00021080,
2190 0x24424000, 0x03422821, 0x00804021, 0x24840001, 0xaf840018, 0x93630009,
2191 0x310200ff, 0x00022400, 0x3c024100, 0x24630002, 0x00621825, 0x00832025,
2192 0xaca40000, 0x8f62000c, 0x00461025, 0xaca20004, 0x97430e14, 0x93640002,
2193 0x8f450e1c, 0x8f660004, 0x8f670014, 0xaf4f0178, 0x3063ffff, 0xa7430144,
2194 0x97420e16, 0x308400ff, 0xa7420146, 0xaf450148, 0xa3480152, 0x8f83000c,
2195 0x25420007, 0x00591024, 0xa744015a, 0xaf460160, 0xa7490158, 0xaf470154,
2196 0xaf4e0178, 0x00621821, 0x30631fff, 0xaf83000c, 0x8d820000, 0x14400005,
2197 0x00000000, 0x8f620014, 0x2403ffbf, 0x00431024, 0xaf620014, 0x8f62000c,
2198 0x004d1021, 0xaf62000c, 0x93630008, 0x14600008, 0x00000000, 0x11600006,
2199 0x00000000, 0x8f630014, 0x3c02efff, 0x3442fffe, 0x00621824, 0xaf630014,
2200 0xa36b0008, 0x01205021, 0x15400016, 0x8fa60008, 0x97420e14, 0x97430e16,
2201 0x8f850014, 0x00021400, 0x00621825, 0xaca300a8, 0x8f840014, 0x8f420e1c,
2202 0x0a0009f3, 0xac8200ac, 0x97420e14, 0x97430e16, 0x8f840014, 0x00021400,
2203 0x00621825, 0xac8300a8, 0x8f850014, 0x8f420e1c, 0x00005021, 0x0a0009f3,
2204 0xaca200ac, 0x14c0fe64, 0x00000000, 0x55400018, 0x8fb00010, 0x3c038000,
2205 0x8f420178, 0x00431024, 0x1440fffd, 0x00000000, 0x97430e14, 0x8f440e1c,
2206 0x24020800, 0xaf420178, 0x3063ffff, 0xa7430144, 0x97420e16, 0x3c031000,
2207 0xa7420146, 0x24020240, 0xaf440148, 0xa3400152, 0xa740015a, 0xaf400160,
2208 0xa7400158, 0xaf420154, 0xaf430178, 0x8fb00010, 0x03e00008, 0x27bd0018,
2209 0x27bdffd8, 0x3c1a8000, 0x3c0420ff, 0x3484fffd, 0x3c020008, 0x03421821,
2210 0xafbf0020, 0xafb3001c, 0xafb20018, 0xafb10014, 0xafb00010, 0xaf830014,
2211 0xaf440e00, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2212 0x3c0200ff, 0x3442fffd, 0x3c046004, 0xaf420e00, 0x8c835000, 0x24130d00,
2213 0x3c120800, 0x3c114000, 0x2402ff7f, 0x00621824, 0x3463380c, 0x24020009,
2214 0xac835000, 0xaf420008, 0xaf800018, 0xaf80000c, 0x0e000fa1, 0x00000000,
2215 0x0e000a96, 0x00000000, 0x3c020800, 0x24504080, 0x8f420000, 0x30420001,
2216 0x1040fffd, 0x00000000, 0x8f440100, 0xaf840008, 0xaf440020, 0x93430108,
2217 0xa3830012, 0x93820012, 0x30420001, 0x10400008, 0x00000000, 0x93820012,
2218 0x30420006, 0x00021100, 0x0e00083b, 0x0050d821, 0x0a000a52, 0x00000000,
2219 0x14930005, 0x00000000, 0x0e00083b, 0x265b4100, 0x0a000a52, 0x00000000,
2220 0x0e000ba3, 0x00000000, 0xaf510138, 0x0a000a36, 0x00000000, 0x27bdfff8,
2221 0x3084ffff, 0x24820007, 0x3044fff8, 0x8f85000c, 0x9743008a, 0x3063ffff,
2222 0xafa30000, 0x8fa20000, 0x00451023, 0x2442ffff, 0x30421fff, 0x0044102b,
2223 0x1440fff7, 0x00000000, 0x8f82000c, 0x00021082, 0x00021080, 0x24424000,
2224 0x03421021, 0x03e00008, 0x27bd0008, 0x3084ffff, 0x8f82000c, 0x24840007,
2225 0x3084fff8, 0x00441021, 0x30421fff, 0xaf82000c, 0x03e00008, 0x00000000,
2226 0x27bdffe8, 0x3c1a8000, 0x3c0420ff, 0x3484fffd, 0x3c020008, 0x03421821,
2227 0xafbf0010, 0xaf830014, 0xaf440e00, 0x00000000, 0x00000000, 0x00000000,
2228 0x00000000, 0x00000000, 0x3c0200ff, 0x3442fffd, 0x3c046004, 0xaf420e00,
2229 0x8c825000, 0x2403ff7f, 0x00431024, 0x3442380c, 0x24030009, 0xac825000,
2230 0xaf430008, 0xaf800018, 0xaf80000c, 0x0e000fa1, 0x00000000, 0x0e000a96,
2231 0x00000000, 0x8fbf0010, 0x03e00008, 0x27bd0018, 0x27bdffe8, 0x3c02000a,
2232 0x03421821, 0x3c040800, 0x24844120, 0x24050018, 0xafbf0010, 0xaf830024,
2233 0x0e000fad, 0x00003021, 0x3c050800, 0x3c020800, 0x24423d60, 0xaca24180,
2234 0x24a54180, 0x3c020800, 0x24423e18, 0x3c030800, 0x24633e2c, 0x3c040800,
2235 0xaca20004, 0x3c020800, 0x24423d68, 0xaca30008, 0xac824190, 0x24844190,
2236 0x3c020800, 0x24423da4, 0x3c070800, 0x24e73de4, 0x3c060800, 0x24c63e40,
2237 0x3c050800, 0x24a52b28, 0x3c030800, 0xac820004, 0x3c020800, 0x24423e48,
2238 0xac870008, 0xac86000c, 0xac850010, 0xac6241b0, 0x246341b0, 0x8fbf0010,
2239 0x3c020800, 0x24423e60, 0xac620004, 0xac670008, 0xac66000c, 0xac650010,
2240 0x03e00008, 0x27bd0018, 0x27bdffc8, 0x3c020800, 0x24424120, 0xafbf0030,
2241 0xafb3002c, 0xafb20028, 0xafb10024, 0xafb00020, 0x90470021, 0x8c510008,
2242 0x8c45001c, 0x8f900020, 0x3c060800, 0x3c038000, 0x8f420178, 0x00431024,
2243 0x1440fffd, 0x8cc2414c, 0x24c3414c, 0x2473ffd4, 0xaf420144, 0x8e620030,
2244 0x30b22000, 0xaf420148, 0x3c021000, 0xaf50014c, 0xa3470152, 0xa7510158,
2245 0xaf450154, 0xaf420178, 0x12400004, 0x3c030800, 0x8c620030, 0x24420001,
2246 0xac620030, 0x93420109, 0x9344010a, 0x00111c00, 0xafa30018, 0x00071a00,
2247 0xafa50014, 0x8cc5414c, 0x00021600, 0x00042400, 0x00441025, 0x00431025,
2248 0xafa20010, 0x8f440100, 0x8e660030, 0x0e000fe1, 0x02003821, 0x1640000e,
2249 0x8fbf0030, 0x8f820000, 0x8e630030, 0x8c44017c, 0x02031823, 0x00711823,
2250 0x00641823, 0x2c630002, 0x14600006, 0x8fb3002c, 0x0000000d, 0x00000000,
2251 0x240000ca, 0x8fbf0030, 0x8fb3002c, 0x8fb20028, 0x8fb10024, 0x8fb00020,
2252 0x03e00008, 0x27bd0038, 0x974309da, 0x00804021, 0xad030000, 0x8f4209dc,
2253 0xad020004, 0x8f4309e0, 0xad030008, 0x934409d9, 0x24020001, 0x30840003,
2254 0x1082001f, 0x30a900ff, 0x28820002, 0x10400005, 0x24020002, 0x10800009,
2255 0x3c0a0800, 0x0a000b64, 0x93420934, 0x1082000b, 0x24020003, 0x10820026,
2256 0x3c0a0800, 0x0a000b64, 0x93420934, 0x974209e4, 0x00021400, 0x34420800,
2257 0xad02000c, 0x0a000b63, 0x25080010, 0x974209e4, 0x00021400, 0x34428100,
2258 0xad02000c, 0x974309e8, 0x3c0a0800, 0x00031c00, 0x34630800, 0xad030010,
2259 0x0a000b63, 0x25080014, 0x974409e4, 0x3c050800, 0x24a24120, 0x94430018,
2260 0x94460010, 0x9447000c, 0x00a05021, 0x24020800, 0xad000010, 0xad020014,
2261 0x00042400, 0x00661821, 0x00671823, 0x2463fff2, 0x00832025, 0xad04000c,
2262 0x0a000b63, 0x25080018, 0x974209e4, 0x3c050800, 0x00021400, 0x34428100,
2263 0xad02000c, 0x974409e8, 0x24a24120, 0x94430018, 0x94460010, 0x9447000c,
2264 0x00a05021, 0x24020800, 0xad000014, 0xad020018, 0x00042400, 0x00661821,
2265 0x00671823, 0x2463ffee, 0x00832025, 0xad040010, 0x2508001c, 0x93420934,
2266 0x93450921, 0x3c074000, 0x25444120, 0x94830014, 0x94860010, 0x00021082,
2267 0x00021600, 0x00052c00, 0x00a72825, 0x00451025, 0x00661821, 0x00431025,
2268 0xad020000, 0x97830028, 0x974209ea, 0x00621821, 0x00031c00, 0xad030004,
2269 0x97820028, 0x24420001, 0x30427fff, 0xa7820028, 0x93430920, 0x3c020006,
2270 0x00031e00, 0x00621825, 0xad030008, 0x8f42092c, 0xad02000c, 0x8f430930,
2271 0xad030010, 0x8f440938, 0x25080014, 0xad040000, 0x8f820020, 0x11200004,
2272 0xad020004, 0x8f420940, 0x0a000b8d, 0x2442ffff, 0x8f420940, 0xad020008,
2273 0x8f440948, 0x8f420940, 0x93430936, 0x00822823, 0x00652806, 0x3402ffff,
2274 0x0045102b, 0x54400001, 0x3405ffff, 0x93420937, 0x25444120, 0x90830020,
2275 0xad000010, 0x00021700, 0x34630010, 0x00031c00, 0x00431025, 0x00451025,
2276 0xad02000c, 0x03e00008, 0x25020014, 0x27bdffb0, 0x3c020008, 0x03421821,
2277 0xafbf004c, 0xafbe0048, 0xafb70044, 0xafb60040, 0xafb5003c, 0xafb40038,
2278 0xafb30034, 0xafb20030, 0xafb1002c, 0xafb00028, 0xaf830000, 0x24020040,
2279 0xaf420814, 0xaf400810, 0x8f420944, 0x8f430950, 0x8f440954, 0x8f45095c,
2280 0xaf820030, 0xaf830020, 0xaf84001c, 0xaf85002c, 0x93430900, 0x24020020,
2281 0x10620005, 0x24020030, 0x10620022, 0x3c030800, 0x0a000bf1, 0x8c62002c,
2282 0x24020088, 0xaf420818, 0x3c020800, 0x24424180, 0xafa20020, 0x93430109,
2283 0x3c020800, 0x10600009, 0x24574190, 0x3c026000, 0x24030100, 0xac43081c,
2284 0x3c030001, 0xac43081c, 0x0000000d, 0x00000000, 0x2400031d, 0x9342010a,
2285 0x30420080, 0x1440001c, 0x00000000, 0x3c026000, 0x24030100, 0xac43081c,
2286 0x3c030001, 0xac43081c, 0x0000000d, 0x00000000, 0x24000324, 0x0a000bf4,
2287 0x00000000, 0x93430109, 0x3063007f, 0x00031140, 0x000318c0, 0x00431021,
2288 0x24430088, 0xaf430818, 0x0000000d, 0x3c020800, 0x244241d0, 0x3c030800,
2289 0x247741e0, 0x0a000bf4, 0xafa20020, 0x24420001, 0x0a000f4c, 0xac62002c,
2290 0x8f840000, 0x8f850020, 0x24020800, 0xaf420178, 0x8f4209a4, 0x8c83017c,
2291 0x00a21023, 0x00431023, 0x2c420002, 0x14400004, 0x00000000, 0x0000000d,
2292 0x00000000, 0x24000349, 0x8f420104, 0x8f430988, 0x00431023, 0x58400005,
2293 0x8f4209a0, 0x0000000d, 0x00000000, 0x2400034d, 0x8f4209a0, 0x3c100800,
2294 0xae02414c, 0x8f4309a4, 0x2604414c, 0x2491ffd4, 0xae230030, 0x8f420104,
2295 0xae250024, 0x00431023, 0xac82ffd4, 0x8fa30020, 0x8c620000, 0x0040f809,
2296 0x0200b021, 0x00409021, 0x32440010, 0x32420002, 0x10400007, 0xafa40024,
2297 0x8e22001c, 0x32500040, 0x2403ffbf, 0x00431024, 0x0a000f13, 0xae22001c,
2298 0x32420020, 0x10400002, 0x3c020800, 0x245741b0, 0x32420001, 0x14400007,
2299 0x00000000, 0x8f820008, 0xaf420080, 0x8ec3414c, 0xaf430e10, 0x8e220030,
2300 0xaf420e18, 0x9343010b, 0x93420905, 0x30420008, 0x1040003c, 0x307400ff,
2301 0x8f820000, 0x8c430074, 0x0460000a, 0x00000000, 0x3c026000, 0x24030100,
2302 0xac43081c, 0x3c030001, 0xac43081c, 0x0000000d, 0x00000000, 0x24000384,
2303 0x8f820000, 0x9044007b, 0x9343010a, 0x14830027, 0x32500040, 0x24072000,
2304 0x3c090800, 0x3c038000, 0x8f420178, 0x00431024, 0x1440fffd, 0x8ec2414c,
2305 0x26c4414c, 0x2484ffd4, 0xaf420144, 0x8c820030, 0x3c030100, 0xaf420148,
2306 0x24020047, 0xaf43014c, 0x00001821, 0xa3420152, 0x3c021000, 0xa7430158,
2307 0xaf470154, 0xaf420178, 0x8ec5414c, 0x8d230030, 0x8c860030, 0x24630001,
2308 0xad230030, 0x93420109, 0x9343010a, 0xafa70014, 0xafa00018, 0x00021600,
2309 0x00031c00, 0x00431025, 0x34424700, 0xafa20010, 0x8f440100, 0x0e000fe1,
2310 0x3c070100, 0x3c030800, 0x24624120, 0x0a000d01, 0x8c43001c, 0x32820002,
2311 0x10400047, 0x3c039000, 0x34630001, 0x8f820008, 0x32500040, 0x3c048000,
2312 0x00431025, 0xaf420020, 0x8f420020, 0x00441024, 0x1440fffd, 0x00000000,
2313 0x8f830000, 0x90620005, 0x3c058000, 0x34420008, 0xa0620005, 0x8f860000,
2314 0x34a50001, 0x8f840008, 0x8cc20074, 0x3c038000, 0x00852025, 0x00431025,
2315 0xacc20074, 0xaf440020, 0x90c3007b, 0x9342010a, 0x14620028, 0x3c040800,
2316 0x24072000, 0x3c090800, 0x3c038000, 0x8f420178, 0x00431024, 0x1440fffd,
2317 0x8ec2414c, 0x26c4414c, 0x2484ffd4, 0xaf420144, 0x8c820030, 0x3c030100,
2318 0xaf420148, 0x24020046, 0xaf43014c, 0x00001821, 0xa3420152, 0x3c021000,
2319 0xa7430158, 0xaf470154, 0xaf420178, 0x8ec5414c, 0x8d230030, 0x8c860030,
2320 0x24630001, 0xad230030, 0x93420109, 0x9343010a, 0xafa70014, 0xafa00018,
2321 0x00021600, 0x00031c00, 0x00431025, 0x34424600, 0xafa20010, 0x8f440100,
2322 0x0e000fe1, 0x3c070100, 0x3c040800, 0x24824120, 0x0a000d01, 0x8c43001c,
2323 0x93420108, 0x30420010, 0x50400050, 0x9343093f, 0x8f860000, 0x90c3007f,
2324 0x90c2007e, 0x90c40080, 0x306800ff, 0x00021600, 0x00081c00, 0x00431025,
2325 0x00042200, 0x90c3007a, 0x90c5000a, 0x00441025, 0x11050028, 0x00623825,
2326 0xa0c8000a, 0x24086000, 0x3c090800, 0x3c038000, 0x8f420178, 0x00431024,
2327 0x1440fffd, 0x8ec2414c, 0x26c4414c, 0x2484ffd4, 0xaf420144, 0x8c820030,
2328 0x00001821, 0xaf420148, 0x24020052, 0xaf47014c, 0xa3420152, 0x3c021000,
2329 0xa7430158, 0xaf480154, 0xaf420178, 0x8ec5414c, 0x8d230030, 0x8c860030,
2330 0x24630001, 0xad230030, 0x93420109, 0x9343010a, 0xafa80014, 0xafa00018,
2331 0x00021600, 0x00031c00, 0x00431025, 0x34425200, 0xafa20010, 0x0e000fe1,
2332 0x8f440100, 0x0a000cfb, 0x00000000, 0x3c026000, 0x24030100, 0xac43081c,
2333 0x3c030001, 0xac43081c, 0x0000000d, 0x00000000, 0x240003cd, 0x16800009,
2334 0x3c040800, 0x3c030800, 0x24624120, 0x8c43001c, 0x32500040, 0x2404ffbf,
2335 0x00641824, 0x0a000f13, 0xac43001c, 0x8c824120, 0x10400005, 0x3c030800,
2336 0x8c620034, 0xac804120, 0x24420001, 0xac620034, 0x9343093f, 0x24020012,
2337 0x1462000f, 0x329e0038, 0x17c0000c, 0x3c030800, 0x8f830000, 0x8c62004c,
2338 0xac62005c, 0x3c020800, 0x24444120, 0x8c82001c, 0x32500040, 0x2403ffbf,
2339 0x00431024, 0x0a000f13, 0xac82001c, 0xac604120, 0x97420908, 0x000211c0,
2340 0xaf420024, 0x97420908, 0x3c030080, 0x34630003, 0x000211c0, 0xaf42080c,
2341 0xaf43081c, 0x974209ec, 0x8f4309a4, 0xa7820028, 0x3c020800, 0x24444120,
2342 0xac830028, 0x93420937, 0x93430934, 0x00021080, 0x00621821, 0xa4830014,
2343 0x934209d8, 0x00621821, 0xa4830016, 0x934209d8, 0x93430934, 0x00809821,
2344 0x00431021, 0x24420010, 0xa4820012, 0x0000a821, 0x24020006, 0x13c00003,
2345 0xae62001c, 0x0a000d82, 0x24120008, 0x8f420958, 0x8f830020, 0x8f84002c,
2346 0x00431023, 0x00832023, 0x04800003, 0xae620004, 0x04410003, 0x0082102b,
2347 0x0a000d4e, 0xae600004, 0x54400001, 0xae640004, 0x8ee20000, 0x0040f809,
2348 0x00000000, 0x00409021, 0x32420001, 0x5440001e, 0x8ee20004, 0x8e630008,
2349 0x1060002b, 0x3c02c000, 0x00621025, 0xaf420e00, 0x8f420000, 0x30420008,
2350 0x1040fffd, 0x00000000, 0x97420e08, 0xa7820010, 0x8f430e04, 0x8e620008,
2351 0xaf830004, 0x8f840004, 0x0044102b, 0x1040000b, 0x24150001, 0x24020100,
2352 0x3c016000, 0xac22081c, 0x3c020001, 0x3c016000, 0xac22081c, 0x0000000d,
2353 0x00000000, 0x24000449, 0x24150001, 0x8ee20004, 0x0040f809, 0x00000000,
2354 0x02429025, 0x32420002, 0x5040001d, 0x8f470940, 0x12a00006, 0x8ec2414c,
2355 0x8f830000, 0xac6200a8, 0x8f840000, 0x8e620030, 0xac8200ac, 0x32420004,
2356 0x50400013, 0x8f470940, 0x3c020800, 0x3283007d, 0x106000fe, 0x245741b0,
2357 0x32820001, 0x50400006, 0x36520002, 0x8f830030, 0x8f420940, 0x106200f7,
2358 0x00000000, 0x36520002, 0x24020008, 0xa660000c, 0xa662000e, 0xae600008,
2359 0xa2600020, 0x8f470940, 0x3c030800, 0x24684120, 0x8d020028, 0x8d050008,
2360 0x9504000c, 0x9506000a, 0x95030022, 0x00451021, 0x00862021, 0x00641821,
2361 0xaf870030, 0xad020028, 0x32820030, 0x10400006, 0xa5030010, 0x91020020,
2362 0x32910040, 0x34420004, 0x0a000dd4, 0xa1020020, 0x93420923, 0x30420040,
2363 0x10400029, 0x32910040, 0x8f830000, 0x8f840020, 0x8c620084, 0x00441023,
2364 0x0442000a, 0x3c039000, 0x95020010, 0x8c630084, 0x00821021, 0x00621823,
2365 0x1c600004, 0x3c039000, 0x91020020, 0x34420001, 0xa1020020, 0x34630001,
2366 0x8f820008, 0x32910040, 0x3c048000, 0x00431025, 0xaf420020, 0x8f420020,
2367 0x00441024, 0x1440fffd, 0x00000000, 0x8f840000, 0x9083003f, 0x2402000a,
2368 0x10620005, 0x2402000c, 0x9083003f, 0x24020008, 0x14620002, 0x24020014,
2369 0xa082003f, 0x8f830008, 0x3c028000, 0x34420001, 0x00621825, 0xaf430020,
2370 0x3c040800, 0x24904120, 0x9602000c, 0x96030016, 0x9604000e, 0x00431021,
2371 0x00442021, 0x24840002, 0x3084ffff, 0x0e000a55, 0xa6020018, 0x8f850018,
2372 0x00a01821, 0xa2030021, 0x8ee60008, 0x00402021, 0x24a50001, 0xaf850018,
2373 0x00c0f809, 0x00000000, 0x00402021, 0x0e000b12, 0x02202821, 0x8ee3000c,
2374 0x0060f809, 0x00402021, 0x96040018, 0x9602000e, 0x00822021, 0x24840002,
2375 0x0e000a6b, 0x3084ffff, 0x3c030800, 0x8c624120, 0x8e030008, 0x3c040800,
2376 0x00431023, 0x14400012, 0xac824120, 0x54600006, 0x8e02001c, 0x3243004a,
2377 0x24020002, 0x14620005, 0x00000000, 0x8e02001c, 0x34420040, 0x0a000e0b,
2378 0xae02001c, 0x52a00006, 0x36520002, 0x8e02002c, 0xaf420e10, 0x8e030030,
2379 0xaf430e18, 0x36520002, 0x52a00008, 0x96670010, 0x8f830000, 0x8f420e10,
2380 0xac6200a8, 0x8f840000, 0x8f420e18, 0xac8200ac, 0x96670010, 0x92680020,
2381 0x24020040, 0xaf420814, 0x8f830020, 0x8f82001c, 0x00671821, 0x00621023,
2382 0xaf830020, 0x58400005, 0x8f42095c, 0x8f820000, 0xaf83001c, 0xac430054,
2383 0x8f42095c, 0x31030008, 0xaf82002c, 0x1060001a, 0x00000000, 0x8f840000,
2384 0x90820120, 0x90830121, 0x304600ff, 0x00c31823, 0x30630007, 0x24020007,
2385 0x1062000e, 0x00000000, 0x90820122, 0x304200fe, 0xa0820122, 0x8f850000,
2386 0x00061880, 0x8f840020, 0x24a20100, 0x00431021, 0x24c30001, 0x30630007,
2387 0xac440000, 0x0a000e40, 0xa0a30120, 0x90820122, 0x34420001, 0xa0820122,
2388 0x14e00003, 0x31020001, 0x10400031, 0x32510002, 0x8f820000, 0x8c43000c,
2389 0x30630001, 0x1060002c, 0x32510002, 0x3c029000, 0x8f830008, 0x34420001,
2390 0x3c048000, 0x00621825, 0xaf430020, 0x8f420020, 0x00441024, 0x1440fffd,
2391 0x00000000, 0x8f870000, 0x8ce2000c, 0x30420001, 0x10400018, 0x00000000,
2392 0x94e2006a, 0x00022880, 0x50a00001, 0x24050001, 0x94e30068, 0x90e40081,
2393 0x3c020800, 0x8c460024, 0x00652821, 0x00852804, 0x00c5102b, 0x54400001,
2394 0x00a03021, 0x3c020800, 0x8c440028, 0x00c4182b, 0x54600001, 0x00c02021,
2395 0x8f430074, 0x2402fffe, 0x00822824, 0x00a31821, 0xace3000c, 0x8f830008,
2396 0x3c028000, 0x34420001, 0x00621825, 0xaf430020, 0x8f830020, 0x3c020800,
2397 0x24504120, 0xae030024, 0x8ee20010, 0x0040f809, 0x00000000, 0x12a00005,
2398 0x00000000, 0x8f420e10, 0xae02002c, 0x8f430e18, 0xae030030, 0x1220feba,
2399 0x0000a821, 0x8f870024, 0x97860028, 0x8f830000, 0x8f820030, 0x8f840020,
2400 0x8f85001c, 0x32500040, 0xa4e6002c, 0xac620044, 0x32420008, 0xac640050,
2401 0xac650054, 0x1040007a, 0x32820020, 0x10400027, 0x32910010, 0x24072000,
2402 0x3c090800, 0x3c038000, 0x8f420178, 0x00431024, 0x1440fffd, 0x8ec2414c,
2403 0x26c4414c, 0x2484ffd4, 0xaf420144, 0x8c820030, 0x3c030400, 0xaf420148,
2404 0x24020041, 0xaf43014c, 0x00001821, 0xa3420152, 0x3c021000, 0xa7430158,
2405 0xaf470154, 0xaf420178, 0x8ec5414c, 0x8d230030, 0x8c860030, 0x24630001,
2406 0xad230030, 0x93420109, 0x9343010a, 0xafa70014, 0xafa00018, 0x00021600,
2407 0x00031c00, 0x00431025, 0x34424100, 0xafa20010, 0x8f440100, 0x0e000fe1,
2408 0x3c070400, 0x12200028, 0x24072000, 0x3c090800, 0x3c038000, 0x8f420178,
2409 0x00431024, 0x1440fffd, 0x8ec2414c, 0x26c4414c, 0x2484ffd4, 0xaf420144,
2410 0x8c820030, 0x3c030300, 0xaf420148, 0x2402004e, 0xaf43014c, 0x00001821,
2411 0xa3420152, 0x3c021000, 0xa7430158, 0xaf470154, 0xaf420178, 0x8ec5414c,
2412 0x8d230030, 0x8c860030, 0x24630001, 0xad230030, 0x93420109, 0x9343010a,
2413 0xafa70014, 0xafa00018, 0x00021600, 0x00031c00, 0x00431025, 0x34424e00,
2414 0xafa20010, 0x8f440100, 0x0e000fe1, 0x3c070300, 0x0a000f0b, 0x8fa30024,
2415 0x32820008, 0x10400026, 0x3c090800, 0x24072000, 0x3c038000, 0x8f420178,
2416 0x00431024, 0x1440fffd, 0x8ec2414c, 0x26c4414c, 0x2484ffd4, 0xaf420144,
2417 0x8c820030, 0x3c030200, 0xaf420148, 0x2402004b, 0xaf43014c, 0x00001821,
2418 0xa3420152, 0x3c021000, 0xa7430158, 0xaf470154, 0xaf420178, 0x8ec5414c,
2419 0x8d230030, 0x8c860030, 0x24630001, 0xad230030, 0x93420109, 0x9343010a,
2420 0xafa70014, 0xafa00018, 0x00021600, 0x00031c00, 0x00431025, 0x34424b00,
2421 0xafa20010, 0x8f440100, 0x0e000fe1, 0x3c070200, 0x8fa30024, 0x14600004,
2422 0x8fa40020, 0x32420010, 0x10400004, 0x00000000, 0x8c820004, 0x0040f809,
2423 0x00000000, 0x12000006, 0x8fa30020, 0x8c620008, 0x0040f809, 0x00000000,
2424 0x0a000f4d, 0x8fbf004c, 0x3c030800, 0x8c62413c, 0x30420040, 0x1440002f,
2425 0x8fbf004c, 0x24040040, 0x8f910020, 0x3c038000, 0x8f420178, 0x00431024,
2426 0x1440fffd, 0x8ec2414c, 0x26d0414c, 0x2610ffd4, 0xaf420144, 0x8e020030,
2427 0x00001821, 0xaf420148, 0x24020049, 0xaf51014c, 0xa3420152, 0x3c021000,
2428 0xa7430158, 0xaf440154, 0xaf420178, 0x8ec5414c, 0x8e060030, 0x93420109,
2429 0x9343010a, 0xafa40014, 0xafa00018, 0x00021600, 0x00031c00, 0x00431025,
2430 0x34424900, 0xafa20010, 0x8f440100, 0x0e000fe1, 0x02203821, 0x8f830000,
2431 0x8e020030, 0x8c64017c, 0x02221023, 0x00441023, 0x2c420002, 0x14400005,
2432 0x8fbf004c, 0x0000000d, 0x00000000, 0x240000ca, 0x8fbf004c, 0x8fbe0048,
2433 0x8fb70044, 0x8fb60040, 0x8fb5003c, 0x8fb40038, 0x8fb30034, 0x8fb20030,
2434 0x8fb1002c, 0x8fb00028, 0x03e00008, 0x27bd0050, 0x03e00008, 0x00001021,
2435 0x3c030800, 0x24654120, 0x8ca40004, 0x8c634120, 0x0064102b, 0x54400001,
2436 0x00602021, 0x9743093c, 0x0083102b, 0x54400001, 0x00801821, 0x00001021,
2437 0xaca30008, 0x03e00008, 0xa4a00022, 0x8f850004, 0x97840010, 0x3c030800,
2438 0x24634120, 0x24020008, 0xa462000e, 0x8f820004, 0xa460000c, 0x000420c2,
2439 0x30840008, 0x2c420001, 0x00021023, 0x30420006, 0xac650008, 0x03e00008,
2440 0xa0640020, 0x3c020800, 0x24424120, 0x90450021, 0x94430018, 0x3c021100,
2441 0xac800004, 0x00052c00, 0x24630002, 0x00621825, 0x00a32825, 0x24820008,
2442 0x03e00008, 0xac850000, 0x0000000d, 0x00000000, 0x2400016f, 0x03e00008,
2443 0x00000000, 0x0000000d, 0x00000000, 0x2400017b, 0x03e00008, 0x00000000,
2444 0x03e00008, 0x00000000, 0x3c020800, 0x24424120, 0xac400008, 0xa4400022,
2445 0x03e00008, 0x24020001, 0x3c020800, 0x24424120, 0x24030008, 0xac400008,
2446 0xa440000c, 0xa443000e, 0xa0400020, 0x03e00008, 0x24020004, 0x03e00008,
2447 0x00001021, 0x10c00007, 0x00000000, 0x8ca20000, 0x24c6ffff, 0x24a50004,
2448 0xac820000, 0x14c0fffb, 0x24840004, 0x03e00008, 0x00000000, 0x0a000fb2,
2449 0x00a01021, 0xac860000, 0x24840004, 0x00a01021, 0x1440fffc, 0x24a5ffff,
2450 0x03e00008, 0x00000000, 0x3c0a0800, 0x8d490068, 0x3c050800, 0x24a51090,
2451 0x00093140, 0x00c51021, 0xac440000, 0x8f440e04, 0x00a61021, 0xac440004,
2452 0x97430e08, 0x97420e0c, 0x00a62021, 0x00031c00, 0x00431025, 0xac820008,
2453 0x8f430e10, 0x00801021, 0xac43000c, 0x8f440e14, 0xac440010, 0x8f430e18,
2454 0x3c0800ff, 0xac430014, 0x8f470e1c, 0x3508ffff, 0x25290001, 0xac470018,
2455 0x3c070800, 0x8ce3006c, 0x9344010a, 0x3c026000, 0x24630001, 0xace3006c,
2456 0x8c434448, 0x3129007f, 0x00a62821, 0xad490068, 0x00042600, 0x00681824,
2457 0x00832025, 0x03e00008, 0xaca4001c, 0x8fac0010, 0x8fad0014, 0x8fae0018,
2458 0x3c0b0800, 0x8d6a0060, 0x3c080800, 0x25080078, 0x000a4940, 0x01281021,
2459 0x01091821, 0xac440000, 0x00601021, 0xac650004, 0xac460008, 0xac67000c,
2460 0xac4c0010, 0xac6d0014, 0x3c036000, 0xac4e0018, 0x8c654448, 0x3c040800,
2461 0x8c820064, 0x254a0001, 0x314a007f, 0x01094021, 0xad6a0060, 0x24420001,
2462 0xac820064, 0x03e00008, 0xad05001c, 0x00000000 };
2463
2464static u32 bnx2_TXP_b06FwData[(0x0/4) + 1] = { 0x00000000 };
2465static u32 bnx2_TXP_b06FwRodata[(0x0/4) + 1] = { 0x00000000 };
2466static u32 bnx2_TXP_b06FwBss[(0x194/4) + 1] = { 0x00000000 };
2467static u32 bnx2_TXP_b06FwSbss[(0x34/4) + 1] = { 0x00000000 };
2468
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 770e28f98fd5..269a5e407349 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3037,7 +3037,7 @@ static void bond_activebackup_arp_mon(struct net_device *bond_dev)
3037 bond_set_slave_inactive_flags(bond->current_arp_slave); 3037 bond_set_slave_inactive_flags(bond->current_arp_slave);
3038 3038
3039 /* search for next candidate */ 3039 /* search for next candidate */
3040 bond_for_each_slave_from(bond, slave, i, bond->current_arp_slave) { 3040 bond_for_each_slave_from(bond, slave, i, bond->current_arp_slave->next) {
3041 if (IS_UP(slave->dev)) { 3041 if (IS_UP(slave->dev)) {
3042 slave->link = BOND_LINK_BACK; 3042 slave->link = BOND_LINK_BACK;
3043 bond_set_slave_active_flags(slave); 3043 bond_set_slave_active_flags(slave);
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
new file mode 100644
index 000000000000..f4ba0ffb8637
--- /dev/null
+++ b/drivers/net/dm9000.c
@@ -0,0 +1,1219 @@
1/*
2 * dm9000.c: Version 1.2 03/18/2003
3 *
4 * A Davicom DM9000 ISA NIC fast Ethernet driver for Linux.
5 * Copyright (C) 1997 Sten Wang
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * (C)Copyright 1997-1998 DAVICOM Semiconductor,Inc. All Rights Reserved.
18 *
19 * V0.11 06/20/2001 REG_0A bit3=1, default enable BP with DA match
20 * 06/22/2001 Support DM9801 progrmming
21 * E3: R25 = ((R24 + NF) & 0x00ff) | 0xf000
22 * E4: R25 = ((R24 + NF) & 0x00ff) | 0xc200
23 * R17 = (R17 & 0xfff0) | NF + 3
24 * E5: R25 = ((R24 + NF - 3) & 0x00ff) | 0xc200
25 * R17 = (R17 & 0xfff0) | NF
26 *
27 * v1.00 modify by simon 2001.9.5
28 * change for kernel 2.4.x
29 *
30 * v1.1 11/09/2001 fix force mode bug
31 *
32 * v1.2 03/18/2003 Weilun Huang <weilun_huang@davicom.com.tw>:
33 * Fixed phy reset.
34 * Added tx/rx 32 bit mode.
35 * Cleaned up for kernel merge.
36 *
37 * 03/03/2004 Sascha Hauer <s.hauer@pengutronix.de>
38 * Port to 2.6 kernel
39 *
40 * 24-Sep-2004 Ben Dooks <ben@simtec.co.uk>
41 * Cleanup of code to remove ifdefs
42 * Allowed platform device data to influence access width
43 * Reformatting areas of code
44 *
45 * 17-Mar-2005 Sascha Hauer <s.hauer@pengutronix.de>
46 * * removed 2.4 style module parameters
47 * * removed removed unused stat counter and fixed
48 * net_device_stats
49 * * introduced tx_timeout function
50 * * reworked locking
51 */
52
53#include <linux/module.h>
54#include <linux/ioport.h>
55#include <linux/netdevice.h>
56#include <linux/etherdevice.h>
57#include <linux/init.h>
58#include <linux/skbuff.h>
59#include <linux/version.h>
60#include <linux/spinlock.h>
61#include <linux/crc32.h>
62#include <linux/mii.h>
63#include <linux/dm9000.h>
64#include <linux/delay.h>
65
66#include <asm/delay.h>
67#include <asm/irq.h>
68#include <asm/io.h>
69
70#include "dm9000.h"
71
72/* Board/System/Debug information/definition ---------------- */
73
74#define DM9000_PHY 0x40 /* PHY address 0x01 */
75
76#define TRUE 1
77#define FALSE 0
78
79#define CARDNAME "dm9000"
80#define PFX CARDNAME ": "
81
82#define DM9000_TIMER_WUT jiffies+(HZ*2) /* timer wakeup time : 2 second */
83
84#define DM9000_DEBUG 0
85
86#if DM9000_DEBUG > 2
87#define PRINTK3(args...) printk(CARDNAME ": " args)
88#else
89#define PRINTK3(args...) do { } while(0)
90#endif
91
92#if DM9000_DEBUG > 1
93#define PRINTK2(args...) printk(CARDNAME ": " args)
94#else
95#define PRINTK2(args...) do { } while(0)
96#endif
97
98#if DM9000_DEBUG > 0
99#define PRINTK1(args...) printk(CARDNAME ": " args)
100#define PRINTK(args...) printk(CARDNAME ": " args)
101#else
102#define PRINTK1(args...) do { } while(0)
103#define PRINTK(args...) printk(KERN_DEBUG args)
104#endif
105
106/*
107 * Transmit timeout, default 5 seconds.
108 */
109static int watchdog = 5000;
110module_param(watchdog, int, 0400);
111MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds");
112
113/* Structure/enum declaration ------------------------------- */
114typedef struct board_info {
115
116 void __iomem *io_addr; /* Register I/O base address */
117 void __iomem *io_data; /* Data I/O address */
118 u16 irq; /* IRQ */
119
120 u16 tx_pkt_cnt;
121 u16 queue_pkt_len;
122 u16 queue_start_addr;
123 u16 dbug_cnt;
124 u8 io_mode; /* 0:word, 2:byte */
125 u8 phy_addr;
126
127 void (*inblk)(void __iomem *port, void *data, int length);
128 void (*outblk)(void __iomem *port, void *data, int length);
129 void (*dumpblk)(void __iomem *port, int length);
130
131 struct resource *addr_res; /* resources found */
132 struct resource *data_res;
133 struct resource *addr_req; /* resources requested */
134 struct resource *data_req;
135 struct resource *irq_res;
136
137 struct timer_list timer;
138 struct net_device_stats stats;
139 unsigned char srom[128];
140 spinlock_t lock;
141
142 struct mii_if_info mii;
143 u32 msg_enable;
144} board_info_t;
145
146/* function declaration ------------------------------------- */
147static int dm9000_probe(struct device *);
148static int dm9000_open(struct net_device *);
149static int dm9000_start_xmit(struct sk_buff *, struct net_device *);
150static int dm9000_stop(struct net_device *);
151static int dm9000_do_ioctl(struct net_device *, struct ifreq *, int);
152
153
154static void dm9000_timer(unsigned long);
155static void dm9000_init_dm9000(struct net_device *);
156
157static struct net_device_stats *dm9000_get_stats(struct net_device *);
158
159static irqreturn_t dm9000_interrupt(int, void *, struct pt_regs *);
160
161static int dm9000_phy_read(struct net_device *dev, int phyaddr_unsused, int reg);
162static void dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg,
163 int value);
164static u16 read_srom_word(board_info_t *, int);
165static void dm9000_rx(struct net_device *);
166static void dm9000_hash_table(struct net_device *);
167
168//#define DM9000_PROGRAM_EEPROM
169#ifdef DM9000_PROGRAM_EEPROM
170static void program_eeprom(board_info_t * db);
171#endif
172/* DM9000 network board routine ---------------------------- */
173
174static void
175dm9000_reset(board_info_t * db)
176{
177 PRINTK1("dm9000x: resetting\n");
178 /* RESET device */
179 writeb(DM9000_NCR, db->io_addr);
180 udelay(200);
181 writeb(NCR_RST, db->io_data);
182 udelay(200);
183}
184
185/*
186 * Read a byte from I/O port
187 */
188static u8
189ior(board_info_t * db, int reg)
190{
191 writeb(reg, db->io_addr);
192 return readb(db->io_data);
193}
194
195/*
196 * Write a byte to I/O port
197 */
198
199static void
200iow(board_info_t * db, int reg, int value)
201{
202 writeb(reg, db->io_addr);
203 writeb(value, db->io_data);
204}
205
206/* routines for sending block to chip */
207
208static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count)
209{
210 writesb(reg, data, count);
211}
212
213static void dm9000_outblk_16bit(void __iomem *reg, void *data, int count)
214{
215 writesw(reg, data, (count+1) >> 1);
216}
217
218static void dm9000_outblk_32bit(void __iomem *reg, void *data, int count)
219{
220 writesl(reg, data, (count+3) >> 2);
221}
222
223/* input block from chip to memory */
224
225static void dm9000_inblk_8bit(void __iomem *reg, void *data, int count)
226{
227 readsb(reg, data, count+1);
228}
229
230
231static void dm9000_inblk_16bit(void __iomem *reg, void *data, int count)
232{
233 readsw(reg, data, (count+1) >> 1);
234}
235
236static void dm9000_inblk_32bit(void __iomem *reg, void *data, int count)
237{
238 readsl(reg, data, (count+3) >> 2);
239}
240
241/* dump block from chip to null */
242
243static void dm9000_dumpblk_8bit(void __iomem *reg, int count)
244{
245 int i;
246 int tmp;
247
248 for (i = 0; i < count; i++)
249 tmp = readb(reg);
250}
251
252static void dm9000_dumpblk_16bit(void __iomem *reg, int count)
253{
254 int i;
255 int tmp;
256
257 count = (count + 1) >> 1;
258
259 for (i = 0; i < count; i++)
260 tmp = readw(reg);
261}
262
263static void dm9000_dumpblk_32bit(void __iomem *reg, int count)
264{
265 int i;
266 int tmp;
267
268 count = (count + 3) >> 2;
269
270 for (i = 0; i < count; i++)
271 tmp = readl(reg);
272}
273
274/* dm9000_set_io
275 *
276 * select the specified set of io routines to use with the
277 * device
278 */
279
280static void dm9000_set_io(struct board_info *db, int byte_width)
281{
282 /* use the size of the data resource to work out what IO
283 * routines we want to use
284 */
285
286 switch (byte_width) {
287 case 1:
288 db->dumpblk = dm9000_dumpblk_8bit;
289 db->outblk = dm9000_outblk_8bit;
290 db->inblk = dm9000_inblk_8bit;
291 break;
292
293 case 2:
294 db->dumpblk = dm9000_dumpblk_16bit;
295 db->outblk = dm9000_outblk_16bit;
296 db->inblk = dm9000_inblk_16bit;
297 break;
298
299 case 3:
300 printk(KERN_ERR PFX ": 3 byte IO, falling back to 16bit\n");
301 db->dumpblk = dm9000_dumpblk_16bit;
302 db->outblk = dm9000_outblk_16bit;
303 db->inblk = dm9000_inblk_16bit;
304 break;
305
306 case 4:
307 default:
308 db->dumpblk = dm9000_dumpblk_32bit;
309 db->outblk = dm9000_outblk_32bit;
310 db->inblk = dm9000_inblk_32bit;
311 break;
312 }
313}
314
315
316/* Our watchdog timed out. Called by the networking layer */
317static void dm9000_timeout(struct net_device *dev)
318{
319 board_info_t *db = (board_info_t *) dev->priv;
320 u8 reg_save;
321 unsigned long flags;
322
323 /* Save previous register address */
324 reg_save = readb(db->io_addr);
325 spin_lock_irqsave(db->lock,flags);
326
327 netif_stop_queue(dev);
328 dm9000_reset(db);
329 dm9000_init_dm9000(dev);
330 /* We can accept TX packets again */
331 dev->trans_start = jiffies;
332 netif_wake_queue(dev);
333
334 /* Restore previous register address */
335 writeb(reg_save, db->io_addr);
336 spin_unlock_irqrestore(db->lock,flags);
337}
338
339
340/* dm9000_release_board
341 *
342 * release a board, and any mapped resources
343 */
344
345static void
346dm9000_release_board(struct platform_device *pdev, struct board_info *db)
347{
348 if (db->data_res == NULL) {
349 if (db->addr_res != NULL)
350 release_mem_region((unsigned long)db->io_addr, 4);
351 return;
352 }
353
354 /* unmap our resources */
355
356 iounmap(db->io_addr);
357 iounmap(db->io_data);
358
359 /* release the resources */
360
361 if (db->data_req != NULL) {
362 release_resource(db->data_req);
363 kfree(db->data_req);
364 }
365
366 if (db->addr_res != NULL) {
367 release_resource(db->data_req);
368 kfree(db->addr_req);
369 }
370}
371
372#define res_size(_r) (((_r)->end - (_r)->start) + 1)
373
374/*
375 * Search DM9000 board, allocate space and register it
376 */
377static int
378dm9000_probe(struct device *dev)
379{
380 struct platform_device *pdev = to_platform_device(dev);
381 struct dm9000_plat_data *pdata = pdev->dev.platform_data;
382 struct board_info *db; /* Point a board information structure */
383 struct net_device *ndev;
384 unsigned long base;
385 int ret = 0;
386 int iosize;
387 int i;
388 u32 id_val;
389
390 printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME);
391
392 /* Init network device */
393 ndev = alloc_etherdev(sizeof (struct board_info));
394 if (!ndev) {
395 printk("%s: could not allocate device.\n", CARDNAME);
396 return -ENOMEM;
397 }
398
399 SET_MODULE_OWNER(ndev);
400 SET_NETDEV_DEV(ndev, dev);
401
402 PRINTK2("dm9000_probe()");
403
404 /* setup board info structure */
405 db = (struct board_info *) ndev->priv;
406 memset(db, 0, sizeof (*db));
407
408 if (pdev->num_resources < 2) {
409 ret = -ENODEV;
410 goto out;
411 }
412
413 switch (pdev->num_resources) {
414 case 2:
415 base = pdev->resource[0].start;
416
417 if (!request_mem_region(base, 4, ndev->name)) {
418 ret = -EBUSY;
419 goto out;
420 }
421
422 ndev->base_addr = base;
423 ndev->irq = pdev->resource[1].start;
424 db->io_addr = (void *)base;
425 db->io_data = (void *)(base + 4);
426
427 break;
428
429 case 3:
430 db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
431 db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
432 db->irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
433
434 if (db->addr_res == NULL || db->data_res == NULL) {
435 printk(KERN_ERR PFX "insufficient resources\n");
436 ret = -ENOENT;
437 goto out;
438 }
439
440 i = res_size(db->addr_res);
441 db->addr_req = request_mem_region(db->addr_res->start, i,
442 pdev->name);
443
444 if (db->addr_req == NULL) {
445 printk(KERN_ERR PFX "cannot claim address reg area\n");
446 ret = -EIO;
447 goto out;
448 }
449
450 db->io_addr = ioremap(db->addr_res->start, i);
451
452 if (db->io_addr == NULL) {
453 printk(KERN_ERR "failed to ioremap address reg\n");
454 ret = -EINVAL;
455 goto out;
456 }
457
458 iosize = res_size(db->data_res);
459 db->data_req = request_mem_region(db->data_res->start, iosize,
460 pdev->name);
461
462 if (db->data_req == NULL) {
463 printk(KERN_ERR PFX "cannot claim data reg area\n");
464 ret = -EIO;
465 goto out;
466 }
467
468 db->io_data = ioremap(db->data_res->start, iosize);
469
470 if (db->io_data == NULL) {
471 printk(KERN_ERR "failed to ioremap data reg\n");
472 ret = -EINVAL;
473 goto out;
474 }
475
476 /* fill in parameters for net-dev structure */
477
478 ndev->base_addr = (unsigned long)db->io_addr;
479 ndev->irq = db->irq_res->start;
480
481 /* ensure at least we have a default set of IO routines */
482 dm9000_set_io(db, iosize);
483
484 }
485
486 /* check to see if anything is being over-ridden */
487 if (pdata != NULL) {
488 /* check to see if the driver wants to over-ride the
489 * default IO width */
490
491 if (pdata->flags & DM9000_PLATF_8BITONLY)
492 dm9000_set_io(db, 1);
493
494 if (pdata->flags & DM9000_PLATF_16BITONLY)
495 dm9000_set_io(db, 2);
496
497 if (pdata->flags & DM9000_PLATF_32BITONLY)
498 dm9000_set_io(db, 4);
499
500 /* check to see if there are any IO routine
501 * over-rides */
502
503 if (pdata->inblk != NULL)
504 db->inblk = pdata->inblk;
505
506 if (pdata->outblk != NULL)
507 db->outblk = pdata->outblk;
508
509 if (pdata->dumpblk != NULL)
510 db->dumpblk = pdata->dumpblk;
511 }
512
513 dm9000_reset(db);
514
515 /* try two times, DM9000 sometimes gets the first read wrong */
516 for (i = 0; i < 2; i++) {
517 id_val = ior(db, DM9000_VIDL);
518 id_val |= (u32)ior(db, DM9000_VIDH) << 8;
519 id_val |= (u32)ior(db, DM9000_PIDL) << 16;
520 id_val |= (u32)ior(db, DM9000_PIDH) << 24;
521
522 if (id_val == DM9000_ID)
523 break;
524 printk("%s: read wrong id 0x%08x\n", CARDNAME, id_val);
525 }
526
527 if (id_val != DM9000_ID) {
528 printk("%s: wrong id: 0x%08x\n", CARDNAME, id_val);
529 goto release;
530 }
531
532 /* from this point we assume that we have found a DM9000 */
533
534 /* driver system function */
535 ether_setup(ndev);
536
537 ndev->open = &dm9000_open;
538 ndev->hard_start_xmit = &dm9000_start_xmit;
539 ndev->tx_timeout = &dm9000_timeout;
540 ndev->watchdog_timeo = msecs_to_jiffies(watchdog);
541 ndev->stop = &dm9000_stop;
542 ndev->get_stats = &dm9000_get_stats;
543 ndev->set_multicast_list = &dm9000_hash_table;
544 ndev->do_ioctl = &dm9000_do_ioctl;
545
546#ifdef DM9000_PROGRAM_EEPROM
547 program_eeprom(db);
548#endif
549 db->msg_enable = NETIF_MSG_LINK;
550 db->mii.phy_id_mask = 0x1f;
551 db->mii.reg_num_mask = 0x1f;
552 db->mii.force_media = 0;
553 db->mii.full_duplex = 0;
554 db->mii.dev = ndev;
555 db->mii.mdio_read = dm9000_phy_read;
556 db->mii.mdio_write = dm9000_phy_write;
557
558 /* Read SROM content */
559 for (i = 0; i < 64; i++)
560 ((u16 *) db->srom)[i] = read_srom_word(db, i);
561
562 /* Set Node Address */
563 for (i = 0; i < 6; i++)
564 ndev->dev_addr[i] = db->srom[i];
565
566 if (!is_valid_ether_addr(ndev->dev_addr))
567 printk("%s: Invalid ethernet MAC address. Please "
568 "set using ifconfig\n", ndev->name);
569
570 dev_set_drvdata(dev, ndev);
571 ret = register_netdev(ndev);
572
573 if (ret == 0) {
574 printk("%s: dm9000 at %p,%p IRQ %d MAC: ",
575 ndev->name, db->io_addr, db->io_data, ndev->irq);
576 for (i = 0; i < 5; i++)
577 printk("%02x:", ndev->dev_addr[i]);
578 printk("%02x\n", ndev->dev_addr[5]);
579 }
580 return 0;
581
582 release:
583 out:
584 printk("%s: not found (%d).\n", CARDNAME, ret);
585
586 dm9000_release_board(pdev, db);
587 kfree(ndev);
588
589 return ret;
590}
591
592/*
593 * Open the interface.
594 * The interface is opened whenever "ifconfig" actives it.
595 */
596static int
597dm9000_open(struct net_device *dev)
598{
599 board_info_t *db = (board_info_t *) dev->priv;
600
601 PRINTK2("entering dm9000_open\n");
602
603 if (request_irq(dev->irq, &dm9000_interrupt, SA_SHIRQ, dev->name, dev))
604 return -EAGAIN;
605
606 /* Initialize DM9000 board */
607 dm9000_reset(db);
608 dm9000_init_dm9000(dev);
609
610 /* Init driver variable */
611 db->dbug_cnt = 0;
612
613 /* set and active a timer process */
614 init_timer(&db->timer);
615 db->timer.expires = DM9000_TIMER_WUT * 2;
616 db->timer.data = (unsigned long) dev;
617 db->timer.function = &dm9000_timer;
618 add_timer(&db->timer);
619
620 mii_check_media(&db->mii, netif_msg_link(db), 1);
621 netif_start_queue(dev);
622
623 return 0;
624}
625
626/*
627 * Initilize dm9000 board
628 */
629static void
630dm9000_init_dm9000(struct net_device *dev)
631{
632 board_info_t *db = (board_info_t *) dev->priv;
633
634 PRINTK1("entering %s\n",__FUNCTION__);
635
636 /* I/O mode */
637 db->io_mode = ior(db, DM9000_ISR) >> 6; /* ISR bit7:6 keeps I/O mode */
638
639 /* GPIO0 on pre-activate PHY */
640 iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */
641 iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */
642 iow(db, DM9000_GPR, 0); /* Enable PHY */
643
644 /* Program operating register */
645 iow(db, DM9000_TCR, 0); /* TX Polling clear */
646 iow(db, DM9000_BPTR, 0x3f); /* Less 3Kb, 200us */
647 iow(db, DM9000_FCR, 0xff); /* Flow Control */
648 iow(db, DM9000_SMCR, 0); /* Special Mode */
649 /* clear TX status */
650 iow(db, DM9000_NSR, NSR_WAKEST | NSR_TX2END | NSR_TX1END);
651 iow(db, DM9000_ISR, ISR_CLR_STATUS); /* Clear interrupt status */
652
653 /* Set address filter table */
654 dm9000_hash_table(dev);
655
656 /* Activate DM9000 */
657 iow(db, DM9000_RCR, RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN);
658 /* Enable TX/RX interrupt mask */
659 iow(db, DM9000_IMR, IMR_PAR | IMR_PTM | IMR_PRM);
660
661 /* Init Driver variable */
662 db->tx_pkt_cnt = 0;
663 db->queue_pkt_len = 0;
664 dev->trans_start = 0;
665 spin_lock_init(&db->lock);
666}
667
668/*
669 * Hardware start transmission.
670 * Send a packet to media from the upper layer.
671 */
672static int
673dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev)
674{
675 board_info_t *db = (board_info_t *) dev->priv;
676
677 PRINTK3("dm9000_start_xmit\n");
678
679 if (db->tx_pkt_cnt > 1)
680 return 1;
681
682 netif_stop_queue(dev);
683
684 /* Disable all interrupts */
685 iow(db, DM9000_IMR, IMR_PAR);
686
687 /* Move data to DM9000 TX RAM */
688 writeb(DM9000_MWCMD, db->io_addr);
689
690 (db->outblk)(db->io_data, skb->data, skb->len);
691 db->stats.tx_bytes += skb->len;
692
693 /* TX control: First packet immediately send, second packet queue */
694 if (db->tx_pkt_cnt == 0) {
695
696 /* First Packet */
697 db->tx_pkt_cnt++;
698
699 /* Set TX length to DM9000 */
700 iow(db, DM9000_TXPLL, skb->len & 0xff);
701 iow(db, DM9000_TXPLH, (skb->len >> 8) & 0xff);
702
703 /* Issue TX polling command */
704 iow(db, DM9000_TCR, TCR_TXREQ); /* Cleared after TX complete */
705
706 dev->trans_start = jiffies; /* save the time stamp */
707
708 } else {
709 /* Second packet */
710 db->tx_pkt_cnt++;
711 db->queue_pkt_len = skb->len;
712 }
713
714 /* free this SKB */
715 dev_kfree_skb(skb);
716
717 /* Re-enable resource check */
718 if (db->tx_pkt_cnt == 1)
719 netif_wake_queue(dev);
720
721 /* Re-enable interrupt */
722 iow(db, DM9000_IMR, IMR_PAR | IMR_PTM | IMR_PRM);
723
724 return 0;
725}
726
727static void
728dm9000_shutdown(struct net_device *dev)
729{
730 board_info_t *db = (board_info_t *) dev->priv;
731
732 /* RESET device */
733 dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */
734 iow(db, DM9000_GPR, 0x01); /* Power-Down PHY */
735 iow(db, DM9000_IMR, IMR_PAR); /* Disable all interrupt */
736 iow(db, DM9000_RCR, 0x00); /* Disable RX */
737}
738
739/*
740 * Stop the interface.
741 * The interface is stopped when it is brought.
742 */
743static int
744dm9000_stop(struct net_device *ndev)
745{
746 board_info_t *db = (board_info_t *) ndev->priv;
747
748 PRINTK1("entering %s\n",__FUNCTION__);
749
750 /* deleted timer */
751 del_timer(&db->timer);
752
753 netif_stop_queue(ndev);
754 netif_carrier_off(ndev);
755
756 /* free interrupt */
757 free_irq(ndev->irq, ndev);
758
759 dm9000_shutdown(ndev);
760
761 return 0;
762}
763
764/*
765 * DM9000 interrupt handler
766 * receive the packet to upper layer, free the transmitted packet
767 */
768
769void
770dm9000_tx_done(struct net_device *dev, board_info_t * db)
771{
772 int tx_status = ior(db, DM9000_NSR); /* Got TX status */
773
774 if (tx_status & (NSR_TX2END | NSR_TX1END)) {
775 /* One packet sent complete */
776 db->tx_pkt_cnt--;
777 db->stats.tx_packets++;
778
779 /* Queue packet check & send */
780 if (db->tx_pkt_cnt > 0) {
781 iow(db, DM9000_TXPLL, db->queue_pkt_len & 0xff);
782 iow(db, DM9000_TXPLH, (db->queue_pkt_len >> 8) & 0xff);
783 iow(db, DM9000_TCR, TCR_TXREQ);
784 dev->trans_start = jiffies;
785 }
786 netif_wake_queue(dev);
787 }
788}
789
790static irqreturn_t
791dm9000_interrupt(int irq, void *dev_id, struct pt_regs *regs)
792{
793 struct net_device *dev = dev_id;
794 board_info_t *db;
795 int int_status;
796 u8 reg_save;
797
798 PRINTK3("entering %s\n",__FUNCTION__);
799
800 if (!dev) {
801 PRINTK1("dm9000_interrupt() without DEVICE arg\n");
802 return IRQ_HANDLED;
803 }
804
805 /* A real interrupt coming */
806 db = (board_info_t *) dev->priv;
807 spin_lock(&db->lock);
808
809 /* Save previous register address */
810 reg_save = readb(db->io_addr);
811
812 /* Disable all interrupts */
813 iow(db, DM9000_IMR, IMR_PAR);
814
815 /* Got DM9000 interrupt status */
816 int_status = ior(db, DM9000_ISR); /* Got ISR */
817 iow(db, DM9000_ISR, int_status); /* Clear ISR status */
818
819 /* Received the coming packet */
820 if (int_status & ISR_PRS)
821 dm9000_rx(dev);
822
823 /* Trnasmit Interrupt check */
824 if (int_status & ISR_PTS)
825 dm9000_tx_done(dev, db);
826
827 /* Re-enable interrupt mask */
828 iow(db, DM9000_IMR, IMR_PAR | IMR_PTM | IMR_PRM);
829
830 /* Restore previous register address */
831 writeb(reg_save, db->io_addr);
832
833 spin_unlock(&db->lock);
834
835 return IRQ_HANDLED;
836}
837
838/*
839 * Get statistics from driver.
840 */
841static struct net_device_stats *
842dm9000_get_stats(struct net_device *dev)
843{
844 board_info_t *db = (board_info_t *) dev->priv;
845 return &db->stats;
846}
847
848/*
849 * Process the upper socket ioctl command
850 */
851static int
852dm9000_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
853{
854 PRINTK1("entering %s\n",__FUNCTION__);
855 return 0;
856}
857
858/*
859 * A periodic timer routine
860 * Dynamic media sense, allocated Rx buffer...
861 */
862static void
863dm9000_timer(unsigned long data)
864{
865 struct net_device *dev = (struct net_device *) data;
866 board_info_t *db = (board_info_t *) dev->priv;
867 u8 reg_save;
868 unsigned long flags;
869
870 PRINTK3("dm9000_timer()\n");
871
872 spin_lock_irqsave(db->lock,flags);
873 /* Save previous register address */
874 reg_save = readb(db->io_addr);
875
876 mii_check_media(&db->mii, netif_msg_link(db), 0);
877
878 /* Restore previous register address */
879 writeb(reg_save, db->io_addr);
880 spin_unlock_irqrestore(db->lock,flags);
881
882 /* Set timer again */
883 db->timer.expires = DM9000_TIMER_WUT;
884 add_timer(&db->timer);
885}
886
887struct dm9000_rxhdr {
888 u16 RxStatus;
889 u16 RxLen;
890} __attribute__((__packed__));
891
892/*
893 * Received a packet and pass to upper layer
894 */
895static void
896dm9000_rx(struct net_device *dev)
897{
898 board_info_t *db = (board_info_t *) dev->priv;
899 struct dm9000_rxhdr rxhdr;
900 struct sk_buff *skb;
901 u8 rxbyte, *rdptr;
902 int GoodPacket;
903 int RxLen;
904
905 /* Check packet ready or not */
906 do {
907 ior(db, DM9000_MRCMDX); /* Dummy read */
908
909 /* Get most updated data */
910 rxbyte = readb(db->io_data);
911
912 /* Status check: this byte must be 0 or 1 */
913 if (rxbyte > DM9000_PKT_RDY) {
914 printk("status check failed: %d\n", rxbyte);
915 iow(db, DM9000_RCR, 0x00); /* Stop Device */
916 iow(db, DM9000_ISR, IMR_PAR); /* Stop INT request */
917 return;
918 }
919
920 if (rxbyte != DM9000_PKT_RDY)
921 return;
922
923 /* A packet ready now & Get status/length */
924 GoodPacket = TRUE;
925 writeb(DM9000_MRCMD, db->io_addr);
926
927 (db->inblk)(db->io_data, &rxhdr, sizeof(rxhdr));
928
929 RxLen = rxhdr.RxLen;
930
931 /* Packet Status check */
932 if (RxLen < 0x40) {
933 GoodPacket = FALSE;
934 PRINTK1("Bad Packet received (runt)\n");
935 }
936
937 if (RxLen > DM9000_PKT_MAX) {
938 PRINTK1("RST: RX Len:%x\n", RxLen);
939 }
940
941 if (rxhdr.RxStatus & 0xbf00) {
942 GoodPacket = FALSE;
943 if (rxhdr.RxStatus & 0x100) {
944 PRINTK1("fifo error\n");
945 db->stats.rx_fifo_errors++;
946 }
947 if (rxhdr.RxStatus & 0x200) {
948 PRINTK1("crc error\n");
949 db->stats.rx_crc_errors++;
950 }
951 if (rxhdr.RxStatus & 0x8000) {
952 PRINTK1("length error\n");
953 db->stats.rx_length_errors++;
954 }
955 }
956
957 /* Move data from DM9000 */
958 if (GoodPacket
959 && ((skb = dev_alloc_skb(RxLen + 4)) != NULL)) {
960 skb->dev = dev;
961 skb_reserve(skb, 2);
962 rdptr = (u8 *) skb_put(skb, RxLen - 4);
963
964 /* Read received packet from RX SRAM */
965
966 (db->inblk)(db->io_data, rdptr, RxLen);
967 db->stats.rx_bytes += RxLen;
968
969 /* Pass to upper layer */
970 skb->protocol = eth_type_trans(skb, dev);
971 netif_rx(skb);
972 db->stats.rx_packets++;
973
974 } else {
975 /* need to dump the packet's data */
976
977 (db->dumpblk)(db->io_data, RxLen);
978 }
979 } while (rxbyte == DM9000_PKT_RDY);
980}
981
982/*
983 * Read a word data from SROM
984 */
985static u16
986read_srom_word(board_info_t * db, int offset)
987{
988 iow(db, DM9000_EPAR, offset);
989 iow(db, DM9000_EPCR, EPCR_ERPRR);
990 mdelay(8); /* according to the datasheet 200us should be enough,
991 but it doesn't work */
992 iow(db, DM9000_EPCR, 0x0);
993 return (ior(db, DM9000_EPDRL) + (ior(db, DM9000_EPDRH) << 8));
994}
995
996#ifdef DM9000_PROGRAM_EEPROM
997/*
998 * Write a word data to SROM
999 */
1000static void
1001write_srom_word(board_info_t * db, int offset, u16 val)
1002{
1003 iow(db, DM9000_EPAR, offset);
1004 iow(db, DM9000_EPDRH, ((val >> 8) & 0xff));
1005 iow(db, DM9000_EPDRL, (val & 0xff));
1006 iow(db, DM9000_EPCR, EPCR_WEP | EPCR_ERPRW);
1007 mdelay(8); /* same shit */
1008 iow(db, DM9000_EPCR, 0);
1009}
1010
1011/*
1012 * Only for development:
1013 * Here we write static data to the eeprom in case
1014 * we don't have valid content on a new board
1015 */
1016static void
1017program_eeprom(board_info_t * db)
1018{
1019 u16 eeprom[] = { 0x0c00, 0x007f, 0x1300, /* MAC Address */
1020 0x0000, /* Autoload: accept nothing */
1021 0x0a46, 0x9000, /* Vendor / Product ID */
1022 0x0000, /* pin control */
1023 0x0000,
1024 }; /* Wake-up mode control */
1025 int i;
1026 for (i = 0; i < 8; i++)
1027 write_srom_word(db, i, eeprom[i]);
1028}
1029#endif
1030
1031
1032/*
1033 * Calculate the CRC valude of the Rx packet
1034 * flag = 1 : return the reverse CRC (for the received packet CRC)
1035 * 0 : return the normal CRC (for Hash Table index)
1036 */
1037
1038static unsigned long
1039cal_CRC(unsigned char *Data, unsigned int Len, u8 flag)
1040{
1041
1042 u32 crc = ether_crc_le(Len, Data);
1043
1044 if (flag)
1045 return ~crc;
1046
1047 return crc;
1048}
1049
1050/*
1051 * Set DM9000 multicast address
1052 */
1053static void
1054dm9000_hash_table(struct net_device *dev)
1055{
1056 board_info_t *db = (board_info_t *) dev->priv;
1057 struct dev_mc_list *mcptr = dev->mc_list;
1058 int mc_cnt = dev->mc_count;
1059 u32 hash_val;
1060 u16 i, oft, hash_table[4];
1061 unsigned long flags;
1062
1063 PRINTK2("dm9000_hash_table()\n");
1064
1065 spin_lock_irqsave(&db->lock,flags);
1066
1067 for (i = 0, oft = 0x10; i < 6; i++, oft++)
1068 iow(db, oft, dev->dev_addr[i]);
1069
1070 /* Clear Hash Table */
1071 for (i = 0; i < 4; i++)
1072 hash_table[i] = 0x0;
1073
1074 /* broadcast address */
1075 hash_table[3] = 0x8000;
1076
1077 /* the multicast address in Hash Table : 64 bits */
1078 for (i = 0; i < mc_cnt; i++, mcptr = mcptr->next) {
1079 hash_val = cal_CRC((char *) mcptr->dmi_addr, 6, 0) & 0x3f;
1080 hash_table[hash_val / 16] |= (u16) 1 << (hash_val % 16);
1081 }
1082
1083 /* Write the hash table to MAC MD table */
1084 for (i = 0, oft = 0x16; i < 4; i++) {
1085 iow(db, oft++, hash_table[i] & 0xff);
1086 iow(db, oft++, (hash_table[i] >> 8) & 0xff);
1087 }
1088
1089 spin_unlock_irqrestore(&db->lock,flags);
1090}
1091
1092
1093/*
1094 * Read a word from phyxcer
1095 */
1096static int
1097dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg)
1098{
1099 board_info_t *db = (board_info_t *) dev->priv;
1100 unsigned long flags;
1101 int ret;
1102
1103 spin_lock_irqsave(&db->lock,flags);
1104 /* Fill the phyxcer register into REG_0C */
1105 iow(db, DM9000_EPAR, DM9000_PHY | reg);
1106
1107 iow(db, DM9000_EPCR, 0xc); /* Issue phyxcer read command */
1108 udelay(100); /* Wait read complete */
1109 iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer read command */
1110
1111 /* The read data keeps on REG_0D & REG_0E */
1112 ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL);
1113
1114 spin_unlock_irqrestore(&db->lock,flags);
1115
1116 return ret;
1117}
1118
1119/*
1120 * Write a word to phyxcer
1121 */
1122static void
1123dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value)
1124{
1125 board_info_t *db = (board_info_t *) dev->priv;
1126 unsigned long flags;
1127
1128 spin_lock_irqsave(&db->lock,flags);
1129
1130 /* Fill the phyxcer register into REG_0C */
1131 iow(db, DM9000_EPAR, DM9000_PHY | reg);
1132
1133 /* Fill the written data into REG_0D & REG_0E */
1134 iow(db, DM9000_EPDRL, (value & 0xff));
1135 iow(db, DM9000_EPDRH, ((value >> 8) & 0xff));
1136
1137 iow(db, DM9000_EPCR, 0xa); /* Issue phyxcer write command */
1138 udelay(500); /* Wait write complete */
1139 iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */
1140
1141 spin_unlock_irqrestore(&db->lock,flags);
1142}
1143
1144static int
1145dm9000_drv_suspend(struct device *dev, u32 state, u32 level)
1146{
1147 struct net_device *ndev = dev_get_drvdata(dev);
1148
1149 if (ndev && level == SUSPEND_DISABLE) {
1150 if (netif_running(ndev)) {
1151 netif_device_detach(ndev);
1152 dm9000_shutdown(ndev);
1153 }
1154 }
1155 return 0;
1156}
1157
1158static int
1159dm9000_drv_resume(struct device *dev, u32 level)
1160{
1161 struct net_device *ndev = dev_get_drvdata(dev);
1162 board_info_t *db = (board_info_t *) ndev->priv;
1163
1164 if (ndev && level == RESUME_ENABLE) {
1165
1166 if (netif_running(ndev)) {
1167 dm9000_reset(db);
1168 dm9000_init_dm9000(ndev);
1169
1170 netif_device_attach(ndev);
1171 }
1172 }
1173 return 0;
1174}
1175
1176static int
1177dm9000_drv_remove(struct device *dev)
1178{
1179 struct platform_device *pdev = to_platform_device(dev);
1180 struct net_device *ndev = dev_get_drvdata(dev);
1181
1182 dev_set_drvdata(dev, NULL);
1183
1184 unregister_netdev(ndev);
1185 dm9000_release_board(pdev, (board_info_t *) ndev->priv);
1186 kfree(ndev); /* free device structure */
1187
1188 PRINTK1("clean_module() exit\n");
1189
1190 return 0;
1191}
1192
1193static struct device_driver dm9000_driver = {
1194 .name = "dm9000",
1195 .bus = &platform_bus_type,
1196 .probe = dm9000_probe,
1197 .remove = dm9000_drv_remove,
1198 .suspend = dm9000_drv_suspend,
1199 .resume = dm9000_drv_resume,
1200};
1201
1202static int __init
1203dm9000_init(void)
1204{
1205 return driver_register(&dm9000_driver); /* search board and register */
1206}
1207
1208static void __exit
1209dm9000_cleanup(void)
1210{
1211 driver_unregister(&dm9000_driver);
1212}
1213
1214module_init(dm9000_init);
1215module_exit(dm9000_cleanup);
1216
1217MODULE_AUTHOR("Sascha Hauer, Ben Dooks");
1218MODULE_DESCRIPTION("Davicom DM9000 network driver");
1219MODULE_LICENSE("GPL");
diff --git a/drivers/net/dm9000.h b/drivers/net/dm9000.h
new file mode 100644
index 000000000000..82cad360bafc
--- /dev/null
+++ b/drivers/net/dm9000.h
@@ -0,0 +1,135 @@
1/*
2 * dm9000 Ethernet
3 */
4
5#ifndef _DM9000X_H_
6#define _DM9000X_H_
7
8#define DM9000_ID 0x90000A46
9
10/* although the registers are 16 bit, they are 32-bit aligned.
11 */
12
13#define DM9000_NCR 0x00
14#define DM9000_NSR 0x01
15#define DM9000_TCR 0x02
16#define DM9000_TSR1 0x03
17#define DM9000_TSR2 0x04
18#define DM9000_RCR 0x05
19#define DM9000_RSR 0x06
20#define DM9000_ROCR 0x07
21#define DM9000_BPTR 0x08
22#define DM9000_FCTR 0x09
23#define DM9000_FCR 0x0A
24#define DM9000_EPCR 0x0B
25#define DM9000_EPAR 0x0C
26#define DM9000_EPDRL 0x0D
27#define DM9000_EPDRH 0x0E
28#define DM9000_WCR 0x0F
29
30#define DM9000_PAR 0x10
31#define DM9000_MAR 0x16
32
33#define DM9000_GPCR 0x1e
34#define DM9000_GPR 0x1f
35#define DM9000_TRPAL 0x22
36#define DM9000_TRPAH 0x23
37#define DM9000_RWPAL 0x24
38#define DM9000_RWPAH 0x25
39
40#define DM9000_VIDL 0x28
41#define DM9000_VIDH 0x29
42#define DM9000_PIDL 0x2A
43#define DM9000_PIDH 0x2B
44
45#define DM9000_CHIPR 0x2C
46#define DM9000_SMCR 0x2F
47
48#define DM9000_MRCMDX 0xF0
49#define DM9000_MRCMD 0xF2
50#define DM9000_MRRL 0xF4
51#define DM9000_MRRH 0xF5
52#define DM9000_MWCMDX 0xF6
53#define DM9000_MWCMD 0xF8
54#define DM9000_MWRL 0xFA
55#define DM9000_MWRH 0xFB
56#define DM9000_TXPLL 0xFC
57#define DM9000_TXPLH 0xFD
58#define DM9000_ISR 0xFE
59#define DM9000_IMR 0xFF
60
61#define NCR_EXT_PHY (1<<7)
62#define NCR_WAKEEN (1<<6)
63#define NCR_FCOL (1<<4)
64#define NCR_FDX (1<<3)
65#define NCR_LBK (3<<1)
66#define NCR_RST (1<<0)
67
68#define NSR_SPEED (1<<7)
69#define NSR_LINKST (1<<6)
70#define NSR_WAKEST (1<<5)
71#define NSR_TX2END (1<<3)
72#define NSR_TX1END (1<<2)
73#define NSR_RXOV (1<<1)
74
75#define TCR_TJDIS (1<<6)
76#define TCR_EXCECM (1<<5)
77#define TCR_PAD_DIS2 (1<<4)
78#define TCR_CRC_DIS2 (1<<3)
79#define TCR_PAD_DIS1 (1<<2)
80#define TCR_CRC_DIS1 (1<<1)
81#define TCR_TXREQ (1<<0)
82
83#define TSR_TJTO (1<<7)
84#define TSR_LC (1<<6)
85#define TSR_NC (1<<5)
86#define TSR_LCOL (1<<4)
87#define TSR_COL (1<<3)
88#define TSR_EC (1<<2)
89
90#define RCR_WTDIS (1<<6)
91#define RCR_DIS_LONG (1<<5)
92#define RCR_DIS_CRC (1<<4)
93#define RCR_ALL (1<<3)
94#define RCR_RUNT (1<<2)
95#define RCR_PRMSC (1<<1)
96#define RCR_RXEN (1<<0)
97
98#define RSR_RF (1<<7)
99#define RSR_MF (1<<6)
100#define RSR_LCS (1<<5)
101#define RSR_RWTO (1<<4)
102#define RSR_PLE (1<<3)
103#define RSR_AE (1<<2)
104#define RSR_CE (1<<1)
105#define RSR_FOE (1<<0)
106
107#define FCTR_HWOT(ot) (( ot & 0xf ) << 4 )
108#define FCTR_LWOT(ot) ( ot & 0xf )
109
110#define IMR_PAR (1<<7)
111#define IMR_ROOM (1<<3)
112#define IMR_ROM (1<<2)
113#define IMR_PTM (1<<1)
114#define IMR_PRM (1<<0)
115
116#define ISR_ROOS (1<<3)
117#define ISR_ROS (1<<2)
118#define ISR_PTS (1<<1)
119#define ISR_PRS (1<<0)
120#define ISR_CLR_STATUS (ISR_ROOS | ISR_ROS | ISR_PTS | ISR_PRS)
121
122#define EPCR_REEP (1<<5)
123#define EPCR_WEP (1<<4)
124#define EPCR_EPOS (1<<3)
125#define EPCR_ERPRR (1<<2)
126#define EPCR_ERPRW (1<<1)
127#define EPCR_ERRE (1<<0)
128
129#define GPCR_GEP_CNTL (1<<0)
130
131#define DM9000_PKT_RDY 0x01 /* Packet ready to receive */
132#define DM9000_PKT_MAX 1536 /* Received packet max size */
133
134#endif /* _DM9000X_H_ */
135
diff --git a/drivers/net/fmv18x.c b/drivers/net/fmv18x.c
deleted file mode 100644
index 04c748523471..000000000000
--- a/drivers/net/fmv18x.c
+++ /dev/null
@@ -1,689 +0,0 @@
1/* fmv18x.c: A network device driver for the Fujitsu FMV-181/182/183/184.
2
3 Original: at1700.c (1993-94 by Donald Becker).
4 Copyright 1993 United States Government as represented by the
5 Director, National Security Agency.
6 The author may be reached as becker@scyld.com, or C/O
7 Scyld Computing Corporation
8 410 Severn Ave., Suite 210
9 Annapolis MD 21403
10
11 Modified by Yutaka TAMIYA (tamy@flab.fujitsu.co.jp)
12 Copyright 1994 Fujitsu Laboratories Ltd.
13 Special thanks to:
14 Masayoshi UTAKA (utaka@ace.yk.fujitsu.co.jp)
15 for testing this driver.
16 H. NEGISHI (agy, negishi@sun45.psd.cs.fujitsu.co.jp)
17 for suggestion of some program modification.
18 Masahiro SEKIGUCHI <seki@sysrap.cs.fujitsu.co.jp>
19 for suggestion of some program modification.
20 Kazutoshi MORIOKA (morioka@aurora.oaks.cs.fujitsu.co.jp)
21 for testing this driver.
22
23 This software may be used and distributed according to the terms
24 of the GNU General Public License, incorporated herein by reference.
25
26 This is a device driver for the Fujitsu FMV-181/182/183/184, which
27 is a straight-forward Fujitsu MB86965 implementation.
28
29 Sources:
30 at1700.c
31 The Fujitsu MB86965 datasheet.
32 The Fujitsu FMV-181/182 user's guide
33*/
34
35static const char version[] =
36 "fmv18x.c:v2.2.0 09/24/98 Yutaka TAMIYA (tamy@flab.fujitsu.co.jp)\n";
37
38#include <linux/module.h>
39#include <linux/kernel.h>
40#include <linux/types.h>
41#include <linux/fcntl.h>
42#include <linux/interrupt.h>
43#include <linux/ioport.h>
44#include <linux/in.h>
45#include <linux/slab.h>
46#include <linux/string.h>
47#include <linux/init.h>
48#include <linux/errno.h>
49#include <linux/spinlock.h>
50#include <linux/netdevice.h>
51#include <linux/etherdevice.h>
52#include <linux/skbuff.h>
53#include <linux/delay.h>
54#include <linux/bitops.h>
55
56#include <asm/system.h>
57#include <asm/io.h>
58#include <asm/dma.h>
59
60#define DRV_NAME "fmv18x"
61
62static unsigned fmv18x_probe_list[] __initdata = {
63 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x300, 0x340, 0
64};
65
66/* use 0 for production, 1 for verification, >2 for debug */
67#ifndef NET_DEBUG
68#define NET_DEBUG 1
69#endif
70static unsigned int net_debug = NET_DEBUG;
71
72typedef unsigned char uchar;
73
74/* Information that need to be kept for each board. */
75struct net_local {
76 struct net_device_stats stats;
77 long open_time; /* Useless example local info. */
78 uint tx_started:1; /* Number of packet on the Tx queue. */
79 uint tx_queue_ready:1; /* Tx queue is ready to be sent. */
80 uint rx_started:1; /* Packets are Rxing. */
81 uchar tx_queue; /* Number of packet on the Tx queue. */
82 ushort tx_queue_len; /* Current length of the Tx queue. */
83 spinlock_t lock;
84};
85
86
87/* Offsets from the base address. */
88#define STATUS 0
89#define TX_STATUS 0
90#define RX_STATUS 1
91#define TX_INTR 2 /* Bit-mapped interrupt enable registers. */
92#define RX_INTR 3
93#define TX_MODE 4
94#define RX_MODE 5
95#define CONFIG_0 6 /* Misc. configuration settings. */
96#define CONFIG_1 7
97/* Run-time register bank 2 definitions. */
98#define DATAPORT 8 /* Word-wide DMA or programmed-I/O dataport. */
99#define TX_START 10
100#define COL16CNTL 11 /* Controll Reg for 16 collisions */
101#define MODE13 13
102/* Fujitsu FMV-18x Card Configuration */
103#define FJ_STATUS0 0x10
104#define FJ_STATUS1 0x11
105#define FJ_CONFIG0 0x12
106#define FJ_CONFIG1 0x13
107#define FJ_MACADDR 0x14 /* 0x14 - 0x19 */
108#define FJ_BUFCNTL 0x1A
109#define FJ_BUFDATA 0x1C
110#define FMV18X_IO_EXTENT 32
111
112/* Index to functions, as function prototypes. */
113
114static int fmv18x_probe1(struct net_device *dev, short ioaddr);
115static int net_open(struct net_device *dev);
116static int net_send_packet(struct sk_buff *skb, struct net_device *dev);
117static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs *regs);
118static void net_rx(struct net_device *dev);
119static void net_timeout(struct net_device *dev);
120static int net_close(struct net_device *dev);
121static struct net_device_stats *net_get_stats(struct net_device *dev);
122static void set_multicast_list(struct net_device *dev);
123
124
125/* Check for a network adaptor of this type, and return '0' iff one exists.
126 If dev->base_addr == 0, probe all likely locations.
127 If dev->base_addr == 1, always return failure.
128 If dev->base_addr == 2, allocate space for the device and return success
129 (detachable devices only).
130 */
131
132static int io = 0x220;
133static int irq;
134
135struct net_device * __init fmv18x_probe(int unit)
136{
137 struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
138 unsigned *port;
139 int err = 0;
140
141 if (!dev)
142 return ERR_PTR(-ENODEV);
143
144 if (unit >= 0) {
145 sprintf(dev->name, "eth%d", unit);
146 netdev_boot_setup_check(dev);
147 io = dev->base_addr;
148 irq = dev->irq;
149 }
150
151 SET_MODULE_OWNER(dev);
152
153 if (io > 0x1ff) { /* Check a single specified location. */
154 err = fmv18x_probe1(dev, io);
155 } else if (io != 0) { /* Don't probe at all. */
156 err = -ENXIO;
157 } else {
158 for (port = fmv18x_probe_list; *port; port++)
159 if (fmv18x_probe1(dev, *port) == 0)
160 break;
161 if (!*port)
162 err = -ENODEV;
163 }
164 if (err)
165 goto out;
166 err = register_netdev(dev);
167 if (err)
168 goto out1;
169 return dev;
170out1:
171 free_irq(dev->irq, dev);
172 release_region(dev->base_addr, FMV18X_IO_EXTENT);
173out:
174 free_netdev(dev);
175 return ERR_PTR(err);
176}
177
178/* The Fujitsu datasheet suggests that the NIC be probed for by checking its
179 "signature", the default bit pattern after a reset. This *doesn't* work --
180 there is no way to reset the bus interface without a complete power-cycle!
181
182 It turns out that ATI came to the same conclusion I did: the only thing
183 that can be done is checking a few bits and then diving right into MAC
184 address check. */
185
186static int __init fmv18x_probe1(struct net_device *dev, short ioaddr)
187{
188 char irqmap[4] = {3, 7, 10, 15};
189 char irqmap_pnp[8] = {3, 4, 5, 7, 9, 10, 11, 15};
190 unsigned int i, retval;
191 struct net_local *lp;
192
193 /* Resetting the chip doesn't reset the ISA interface, so don't bother.
194 That means we have to be careful with the register values we probe for.
195 */
196
197 if (!request_region(ioaddr, FMV18X_IO_EXTENT, DRV_NAME))
198 return -EBUSY;
199
200 dev->irq = irq;
201 dev->base_addr = ioaddr;
202
203 /* Check I/O address configuration and Fujitsu vendor code */
204 if (inb(ioaddr+FJ_MACADDR ) != 0x00
205 || inb(ioaddr+FJ_MACADDR+1) != 0x00
206 || inb(ioaddr+FJ_MACADDR+2) != 0x0e) {
207 retval = -ENODEV;
208 goto out;
209 }
210
211 /* Check PnP mode for FMV-183/184/183A/184A. */
212 /* This PnP routine is very poor. IO and IRQ should be known. */
213 if (inb(ioaddr + FJ_STATUS1) & 0x20) {
214 for (i = 0; i < 8; i++) {
215 if (dev->irq == irqmap_pnp[i])
216 break;
217 }
218 if (i == 8) {
219 retval = -ENODEV;
220 goto out;
221 }
222 } else {
223 if (fmv18x_probe_list[inb(ioaddr + FJ_CONFIG0) & 0x07] != ioaddr)
224 return -ENODEV;
225 dev->irq = irqmap[(inb(ioaddr + FJ_CONFIG0)>>6) & 0x03];
226 }
227
228 /* Snarf the interrupt vector now. */
229 retval = request_irq(dev->irq, &net_interrupt, 0, DRV_NAME, dev);
230 if (retval) {
231 printk ("FMV-18x found at %#3x, but it's unusable due to a conflict on"
232 "IRQ %d.\n", ioaddr, dev->irq);
233 goto out;
234 }
235
236 printk("%s: FMV-18x found at %#3x, IRQ %d, address ", dev->name,
237 ioaddr, dev->irq);
238
239 for(i = 0; i < 6; i++) {
240 unsigned char val = inb(ioaddr + FJ_MACADDR + i);
241 printk("%02x", val);
242 dev->dev_addr[i] = val;
243 }
244
245 /* "FJ_STATUS0" 12 bit 0x0400 means use regular 100 ohm 10baseT signals,
246 rather than 150 ohm shielded twisted pair compensation.
247 0x0000 == auto-sense the interface
248 0x0800 == use TP interface
249 0x1800 == use coax interface
250 */
251 {
252 const char *porttype[] = {"auto-sense", "10baseT", "auto-sense", "10base2/5"};
253 ushort setup_value = inb(ioaddr + FJ_STATUS0);
254
255 switch( setup_value & 0x07 ){
256 case 0x01 /* 10base5 */:
257 case 0x02 /* 10base2 */: dev->if_port = 0x18; break;
258 case 0x04 /* 10baseT */: dev->if_port = 0x08; break;
259 default /* auto-sense*/: dev->if_port = 0x00; break;
260 }
261 printk(" %s interface.\n", porttype[(dev->if_port>>3) & 3]);
262 }
263
264 /* Initialize LAN Controller and LAN Card */
265 outb(0xda, ioaddr + CONFIG_0); /* Initialize LAN Controller */
266 outb(0x00, ioaddr + CONFIG_1); /* Stand by mode */
267 outb(0x00, ioaddr + FJ_CONFIG1); /* Disable IRQ of LAN Card */
268 outb(0x00, ioaddr + FJ_BUFCNTL); /* Reset ? I'm not sure (TAMIYA) */
269
270 /* wait for a while */
271 udelay(200);
272
273 /* Set the station address in bank zero. */
274 outb(0x00, ioaddr + CONFIG_1);
275 for (i = 0; i < 6; i++)
276 outb(dev->dev_addr[i], ioaddr + 8 + i);
277
278 /* Switch to bank 1 and set the multicast table to accept none. */
279 outb(0x04, ioaddr + CONFIG_1);
280 for (i = 0; i < 8; i++)
281 outb(0x00, ioaddr + 8 + i);
282
283 /* Switch to bank 2 and lock our I/O address. */
284 outb(0x08, ioaddr + CONFIG_1);
285 outb(dev->if_port, ioaddr + MODE13);
286 outb(0x00, ioaddr + COL16CNTL);
287
288 if (net_debug)
289 printk(version);
290
291 /* Initialize the device structure. */
292 dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL);
293 if (!dev->priv) {
294 retval = -ENOMEM;
295 goto out_irq;
296 }
297 memset(dev->priv, 0, sizeof(struct net_local));
298 lp = dev->priv;
299 spin_lock_init(&lp->lock);
300
301 dev->open = net_open;
302 dev->stop = net_close;
303 dev->hard_start_xmit = net_send_packet;
304 dev->tx_timeout = net_timeout;
305 dev->watchdog_timeo = HZ/10;
306 dev->get_stats = net_get_stats;
307 dev->set_multicast_list = set_multicast_list;
308 return 0;
309
310out_irq:
311 free_irq(dev->irq, dev);
312out:
313 release_region(ioaddr, FMV18X_IO_EXTENT);
314 return retval;
315}
316
317
318static int net_open(struct net_device *dev)
319{
320 struct net_local *lp = dev->priv;
321 int ioaddr = dev->base_addr;
322
323 /* Set the configuration register 0 to 32K 100ns. byte-wide memory,
324 16 bit bus access, and two 4K Tx, enable the Rx and Tx. */
325 outb(0x5a, ioaddr + CONFIG_0);
326
327 /* Powerup and switch to register bank 2 for the run-time registers. */
328 outb(0xe8, ioaddr + CONFIG_1);
329
330 lp->tx_started = 0;
331 lp->tx_queue_ready = 1;
332 lp->rx_started = 0;
333 lp->tx_queue = 0;
334 lp->tx_queue_len = 0;
335
336 /* Clear Tx and Rx Status */
337 outb(0xff, ioaddr + TX_STATUS);
338 outb(0xff, ioaddr + RX_STATUS);
339 lp->open_time = jiffies;
340
341 netif_start_queue(dev);
342
343 /* Enable the IRQ of the LAN Card */
344 outb(0x80, ioaddr + FJ_CONFIG1);
345
346 /* Enable both Tx and Rx interrupts */
347 outw(0x8182, ioaddr+TX_INTR);
348
349 return 0;
350}
351
352static void net_timeout(struct net_device *dev)
353{
354 struct net_local *lp = dev->priv;
355 int ioaddr = dev->base_addr;
356 unsigned long flags;
357
358
359 printk(KERN_WARNING "%s: transmit timed out with status %04x, %s?\n", dev->name,
360 htons(inw(ioaddr + TX_STATUS)),
361 inb(ioaddr + TX_STATUS) & 0x80
362 ? "IRQ conflict" : "network cable problem");
363 printk(KERN_WARNING "%s: timeout registers: %04x %04x %04x %04x %04x %04x %04x %04x.\n",
364 dev->name, htons(inw(ioaddr + 0)),
365 htons(inw(ioaddr + 2)), htons(inw(ioaddr + 4)),
366 htons(inw(ioaddr + 6)), htons(inw(ioaddr + 8)),
367 htons(inw(ioaddr +10)), htons(inw(ioaddr +12)),
368 htons(inw(ioaddr +14)));
369 printk(KERN_WARNING "eth card: %04x %04x\n",
370 htons(inw(ioaddr+FJ_STATUS0)),
371 htons(inw(ioaddr+FJ_CONFIG0)));
372 lp->stats.tx_errors++;
373 /* ToDo: We should try to restart the adaptor... */
374 spin_lock_irqsave(&lp->lock, flags);
375
376 /* Initialize LAN Controller and LAN Card */
377 outb(0xda, ioaddr + CONFIG_0); /* Initialize LAN Controller */
378 outb(0x00, ioaddr + CONFIG_1); /* Stand by mode */
379 outb(0x00, ioaddr + FJ_CONFIG1); /* Disable IRQ of LAN Card */
380 outb(0x00, ioaddr + FJ_BUFCNTL); /* Reset ? I'm not sure */
381 net_open(dev);
382 spin_unlock_irqrestore(&lp->lock, flags);
383
384 netif_wake_queue(dev);
385}
386
387static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
388{
389 struct net_local *lp = dev->priv;
390 int ioaddr = dev->base_addr;
391 short length = skb->len;
392 unsigned char *buf;
393 unsigned long flags;
394
395 /* Block a transmit from overlapping. */
396
397 if (length > ETH_FRAME_LEN) {
398 if (net_debug)
399 printk("%s: Attempting to send a large packet (%d bytes).\n",
400 dev->name, length);
401 return 1;
402 }
403
404 if (length < ETH_ZLEN) {
405 skb = skb_padto(skb, ETH_ZLEN);
406 if (skb == NULL)
407 return 0;
408 length = ETH_ZLEN;
409 }
410 buf = skb->data;
411
412 if (net_debug > 4)
413 printk("%s: Transmitting a packet of length %lu.\n", dev->name,
414 (unsigned long)skb->len);
415 /* We may not start transmitting unless we finish transferring
416 a packet into the Tx queue. During executing the following
417 codes we possibly catch a Tx interrupt. Thus we flag off
418 tx_queue_ready, so that we prevent the interrupt routine
419 (net_interrupt) to start transmitting. */
420 spin_lock_irqsave(&lp->lock, flags);
421 lp->tx_queue_ready = 0;
422 {
423 outw(length, ioaddr + DATAPORT);
424 outsw(ioaddr + DATAPORT, buf, (length + 1) >> 1);
425 lp->tx_queue++;
426 lp->tx_queue_len += length + 2;
427 }
428 lp->tx_queue_ready = 1;
429 spin_unlock_irqrestore(&lp->lock, flags);
430
431 if (lp->tx_started == 0) {
432 /* If the Tx is idle, always trigger a transmit. */
433 outb(0x80 | lp->tx_queue, ioaddr + TX_START);
434 lp->tx_queue = 0;
435 lp->tx_queue_len = 0;
436 dev->trans_start = jiffies;
437 lp->tx_started = 1;
438 } else if (lp->tx_queue_len >= 4096 - 1502) /* No room for a packet */
439 netif_stop_queue(dev);
440
441 dev_kfree_skb(skb);
442 return 0;
443}
444
445/* The typical workload of the driver:
446 Handle the network interface interrupts. */
447static irqreturn_t
448net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
449{
450 struct net_device *dev = dev_id;
451 struct net_local *lp;
452 int ioaddr, status;
453
454 ioaddr = dev->base_addr;
455 lp = dev->priv;
456 status = inw(ioaddr + TX_STATUS);
457 outw(status, ioaddr + TX_STATUS);
458
459 if (net_debug > 4)
460 printk("%s: Interrupt with status %04x.\n", dev->name, status);
461 if (lp->rx_started == 0 &&
462 (status & 0xff00 || (inb(ioaddr + RX_MODE) & 0x40) == 0)) {
463 /* Got a packet(s).
464 We cannot execute net_rx more than once at the same time for
465 the same device. During executing net_rx, we possibly catch a
466 Tx interrupt. Thus we flag on rx_started, so that we prevent
467 the interrupt routine (net_interrupt) to dive into net_rx
468 again. */
469 lp->rx_started = 1;
470 outb(0x00, ioaddr + RX_INTR); /* Disable RX intr. */
471 net_rx(dev);
472 outb(0x81, ioaddr + RX_INTR); /* Enable RX intr. */
473 lp->rx_started = 0;
474 }
475 if (status & 0x00ff) {
476 if (status & 0x02) {
477 /* More than 16 collisions occurred */
478 if (net_debug > 4)
479 printk("%s: 16 Collision occur during Txing.\n", dev->name);
480 /* Cancel sending a packet. */
481 outb(0x03, ioaddr + COL16CNTL);
482 lp->stats.collisions++;
483 }
484 if (status & 0x82) {
485 spin_lock(&lp->lock);
486 lp->stats.tx_packets++;
487 if (lp->tx_queue && lp->tx_queue_ready) {
488 outb(0x80 | lp->tx_queue, ioaddr + TX_START);
489 lp->tx_queue = 0;
490 lp->tx_queue_len = 0;
491 dev->trans_start = jiffies;
492 netif_wake_queue(dev); /* Inform upper layers. */
493 } else {
494 lp->tx_started = 0;
495 netif_wake_queue(dev); /* Inform upper layers. */
496 }
497 spin_unlock(&lp->lock);
498 }
499 }
500 return IRQ_RETVAL(status);
501}
502
503/* We have a good packet(s), get it/them out of the buffers. */
504static void net_rx(struct net_device *dev)
505{
506 struct net_local *lp = dev->priv;
507 int ioaddr = dev->base_addr;
508 int boguscount = 5;
509
510 while ((inb(ioaddr + RX_MODE) & 0x40) == 0) {
511 /* Clear PKT_RDY bit: by agy 19940922 */
512 /* outb(0x80, ioaddr + RX_STATUS); */
513 ushort status = inw(ioaddr + DATAPORT);
514
515 if (net_debug > 4)
516 printk("%s: Rxing packet mode %02x status %04x.\n",
517 dev->name, inb(ioaddr + RX_MODE), status);
518#ifndef final_version
519 if (status == 0) {
520 outb(0x05, ioaddr + 14);
521 break;
522 }
523#endif
524
525 if ((status & 0xF0) != 0x20) { /* There was an error. */
526 lp->stats.rx_errors++;
527 if (status & 0x08) lp->stats.rx_length_errors++;
528 if (status & 0x04) lp->stats.rx_frame_errors++;
529 if (status & 0x02) lp->stats.rx_crc_errors++;
530 if (status & 0x01) lp->stats.rx_over_errors++;
531 } else {
532 ushort pkt_len = inw(ioaddr + DATAPORT);
533 /* Malloc up new buffer. */
534 struct sk_buff *skb;
535
536 if (pkt_len > 1550) {
537 printk("%s: The FMV-18x claimed a very large packet, size %d.\n",
538 dev->name, pkt_len);
539 outb(0x05, ioaddr + 14);
540 lp->stats.rx_errors++;
541 break;
542 }
543 skb = dev_alloc_skb(pkt_len+3);
544 if (skb == NULL) {
545 printk("%s: Memory squeeze, dropping packet (len %d).\n",
546 dev->name, pkt_len);
547 outb(0x05, ioaddr + 14);
548 lp->stats.rx_dropped++;
549 break;
550 }
551 skb->dev = dev;
552 skb_reserve(skb,2);
553
554 insw(ioaddr + DATAPORT, skb_put(skb,pkt_len), (pkt_len + 1) >> 1);
555
556 if (net_debug > 5) {
557 int i;
558 printk("%s: Rxed packet of length %d: ", dev->name, pkt_len);
559 for (i = 0; i < 14; i++)
560 printk(" %02x", skb->data[i]);
561 printk(".\n");
562 }
563
564 skb->protocol=eth_type_trans(skb, dev);
565 netif_rx(skb);
566 dev->last_rx = jiffies;
567 lp->stats.rx_packets++;
568 lp->stats.rx_bytes += pkt_len;
569 }
570 if (--boguscount <= 0)
571 break;
572 }
573
574 /* If any worth-while packets have been received, dev_rint()
575 has done a mark_bh(NET_BH) for us and will work on them
576 when we get to the bottom-half routine. */
577 {
578 int i;
579 for (i = 0; i < 20; i++) {
580 if ((inb(ioaddr + RX_MODE) & 0x40) == 0x40)
581 break;
582 (void)inw(ioaddr + DATAPORT); /* dummy status read */
583 outb(0x05, ioaddr + 14);
584 }
585
586 if (net_debug > 5 && i > 0)
587 printk("%s: Exint Rx packet with mode %02x after %d ticks.\n",
588 dev->name, inb(ioaddr + RX_MODE), i);
589 }
590
591 return;
592}
593
594/* The inverse routine to net_open(). */
595static int net_close(struct net_device *dev)
596{
597 int ioaddr = dev->base_addr;
598
599 ((struct net_local *)dev->priv)->open_time = 0;
600
601 netif_stop_queue(dev);
602
603 /* Set configuration register 0 to disable Tx and Rx. */
604 outb(0xda, ioaddr + CONFIG_0);
605
606 /* Update the statistics -- ToDo. */
607
608 /* Power-down the chip. Green, green, green! */
609 outb(0x00, ioaddr + CONFIG_1);
610
611 /* Set the ethernet adaptor disable IRQ */
612 outb(0x00, ioaddr + FJ_CONFIG1);
613
614 return 0;
615}
616
617/* Get the current statistics. This may be called with the card open or
618 closed. */
619static struct net_device_stats *net_get_stats(struct net_device *dev)
620{
621 struct net_local *lp = dev->priv;
622 return &lp->stats;
623}
624
625/* Set or clear the multicast filter for this adaptor.
626 num_addrs == -1 Promiscuous mode, receive all packets
627 num_addrs == 0 Normal mode, clear multicast list
628 num_addrs > 0 Multicast mode, receive normal and MC packets, and do
629 best-effort filtering.
630 */
631
632static void set_multicast_list(struct net_device *dev)
633{
634 short ioaddr = dev->base_addr;
635 if (dev->mc_count || dev->flags&(IFF_PROMISC|IFF_ALLMULTI))
636 {
637 /*
638 * We must make the kernel realise we had to move
639 * into promisc mode or we start all out war on
640 * the cable. - AC
641 */
642 dev->flags|=IFF_PROMISC;
643
644 outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */
645 }
646 else
647 outb(2, ioaddr + RX_MODE); /* Disable promiscuous, use normal mode */
648}
649
650#ifdef MODULE
651static struct net_device *dev_fmv18x;
652
653MODULE_PARM(io, "i");
654MODULE_PARM(irq, "i");
655MODULE_PARM(net_debug, "i");
656MODULE_PARM_DESC(io, "FMV-18X I/O address");
657MODULE_PARM_DESC(irq, "FMV-18X IRQ number");
658MODULE_PARM_DESC(net_debug, "FMV-18X debug level (0-1,5-6)");
659MODULE_LICENSE("GPL");
660
661int init_module(void)
662{
663 if (io == 0)
664 printk("fmv18x: You should not use auto-probing with insmod!\n");
665 dev_fmv18x = fmv18x_probe(-1);
666 if (IS_ERR(dev_fmv18x))
667 return PTR_ERR(dev_fmv18x);
668 return 0;
669}
670
671void
672cleanup_module(void)
673{
674 unregister_netdev(dev_fmv18x);
675 free_irq(dev_fmv18x->irq, dev_fmv18x);
676 release_region(dev_fmv18x->base_addr, FMV18X_IO_EXTENT);
677 free_netdev(dev_fmv18x);
678}
679#endif /* MODULE */
680
681/*
682 * Local variables:
683 * compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c fmv18x.c"
684 * version-control: t
685 * kept-new-versions: 5
686 * tab-width: 4
687 * c-indent-level: 4
688 * End:
689 */
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index cda48c5d72a9..4ebcd052e150 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -81,6 +81,7 @@
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 * 85 *
85 * Known bugs: 86 * Known bugs:
86 * We suspect that on some hardware no TX done interrupts are generated. 87 * We suspect that on some hardware no TX done interrupts are generated.
@@ -92,7 +93,7 @@
92 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few 93 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
93 * superfluous timer interrupts from the nic. 94 * superfluous timer interrupts from the nic.
94 */ 95 */
95#define FORCEDETH_VERSION "0.31" 96#define FORCEDETH_VERSION "0.32"
96#define DRV_NAME "forcedeth" 97#define DRV_NAME "forcedeth"
97 98
98#include <linux/module.h> 99#include <linux/module.h>
@@ -109,6 +110,7 @@
109#include <linux/mii.h> 110#include <linux/mii.h>
110#include <linux/random.h> 111#include <linux/random.h>
111#include <linux/init.h> 112#include <linux/init.h>
113#include <linux/if_vlan.h>
112 114
113#include <asm/irq.h> 115#include <asm/irq.h>
114#include <asm/io.h> 116#include <asm/io.h>
@@ -1013,6 +1015,59 @@ static void nv_tx_timeout(struct net_device *dev)
1013 spin_unlock_irq(&np->lock); 1015 spin_unlock_irq(&np->lock);
1014} 1016}
1015 1017
1018/*
1019 * Called when the nic notices a mismatch between the actual data len on the
1020 * wire and the len indicated in the 802 header
1021 */
1022static int nv_getlen(struct net_device *dev, void *packet, int datalen)
1023{
1024 int hdrlen; /* length of the 802 header */
1025 int protolen; /* length as stored in the proto field */
1026
1027 /* 1) calculate len according to header */
1028 if ( ((struct vlan_ethhdr *)packet)->h_vlan_proto == __constant_htons(ETH_P_8021Q)) {
1029 protolen = ntohs( ((struct vlan_ethhdr *)packet)->h_vlan_encapsulated_proto );
1030 hdrlen = VLAN_HLEN;
1031 } else {
1032 protolen = ntohs( ((struct ethhdr *)packet)->h_proto);
1033 hdrlen = ETH_HLEN;
1034 }
1035 dprintk(KERN_DEBUG "%s: nv_getlen: datalen %d, protolen %d, hdrlen %d\n",
1036 dev->name, datalen, protolen, hdrlen);
1037 if (protolen > ETH_DATA_LEN)
1038 return datalen; /* Value in proto field not a len, no checks possible */
1039
1040 protolen += hdrlen;
1041 /* consistency checks: */
1042 if (datalen > ETH_ZLEN) {
1043 if (datalen >= protolen) {
1044 /* more data on wire than in 802 header, trim of
1045 * additional data.
1046 */
1047 dprintk(KERN_DEBUG "%s: nv_getlen: accepting %d bytes.\n",
1048 dev->name, protolen);
1049 return protolen;
1050 } else {
1051 /* less data on wire than mentioned in header.
1052 * Discard the packet.
1053 */
1054 dprintk(KERN_DEBUG "%s: nv_getlen: discarding long packet.\n",
1055 dev->name);
1056 return -1;
1057 }
1058 } else {
1059 /* short packet. Accept only if 802 values are also short */
1060 if (protolen > ETH_ZLEN) {
1061 dprintk(KERN_DEBUG "%s: nv_getlen: discarding short packet.\n",
1062 dev->name);
1063 return -1;
1064 }
1065 dprintk(KERN_DEBUG "%s: nv_getlen: accepting %d bytes.\n",
1066 dev->name, datalen);
1067 return datalen;
1068 }
1069}
1070
1016static void nv_rx_process(struct net_device *dev) 1071static void nv_rx_process(struct net_device *dev)
1017{ 1072{
1018 struct fe_priv *np = get_nvpriv(dev); 1073 struct fe_priv *np = get_nvpriv(dev);
@@ -1064,7 +1119,7 @@ static void nv_rx_process(struct net_device *dev)
1064 np->stats.rx_errors++; 1119 np->stats.rx_errors++;
1065 goto next_pkt; 1120 goto next_pkt;
1066 } 1121 }
1067 if (Flags & (NV_RX_ERROR1|NV_RX_ERROR2|NV_RX_ERROR3|NV_RX_ERROR4)) { 1122 if (Flags & (NV_RX_ERROR1|NV_RX_ERROR2|NV_RX_ERROR3)) {
1068 np->stats.rx_errors++; 1123 np->stats.rx_errors++;
1069 goto next_pkt; 1124 goto next_pkt;
1070 } 1125 }
@@ -1078,22 +1133,24 @@ static void nv_rx_process(struct net_device *dev)
1078 np->stats.rx_errors++; 1133 np->stats.rx_errors++;
1079 goto next_pkt; 1134 goto next_pkt;
1080 } 1135 }
1081 if (Flags & NV_RX_ERROR) { 1136 if (Flags & NV_RX_ERROR4) {
1082 /* framing errors are soft errors, the rest is fatal. */ 1137 len = nv_getlen(dev, np->rx_skbuff[i]->data, len);
1083 if (Flags & NV_RX_FRAMINGERR) { 1138 if (len < 0) {
1084 if (Flags & NV_RX_SUBSTRACT1) {
1085 len--;
1086 }
1087 } else {
1088 np->stats.rx_errors++; 1139 np->stats.rx_errors++;
1089 goto next_pkt; 1140 goto next_pkt;
1090 } 1141 }
1091 } 1142 }
1143 /* framing errors are soft errors. */
1144 if (Flags & NV_RX_FRAMINGERR) {
1145 if (Flags & NV_RX_SUBSTRACT1) {
1146 len--;
1147 }
1148 }
1092 } else { 1149 } else {
1093 if (!(Flags & NV_RX2_DESCRIPTORVALID)) 1150 if (!(Flags & NV_RX2_DESCRIPTORVALID))
1094 goto next_pkt; 1151 goto next_pkt;
1095 1152
1096 if (Flags & (NV_RX2_ERROR1|NV_RX2_ERROR2|NV_RX2_ERROR3|NV_RX2_ERROR4)) { 1153 if (Flags & (NV_RX2_ERROR1|NV_RX2_ERROR2|NV_RX2_ERROR3)) {
1097 np->stats.rx_errors++; 1154 np->stats.rx_errors++;
1098 goto next_pkt; 1155 goto next_pkt;
1099 } 1156 }
@@ -1107,17 +1164,19 @@ static void nv_rx_process(struct net_device *dev)
1107 np->stats.rx_errors++; 1164 np->stats.rx_errors++;
1108 goto next_pkt; 1165 goto next_pkt;
1109 } 1166 }
1110 if (Flags & NV_RX2_ERROR) { 1167 if (Flags & NV_RX2_ERROR4) {
1111 /* framing errors are soft errors, the rest is fatal. */ 1168 len = nv_getlen(dev, np->rx_skbuff[i]->data, len);
1112 if (Flags & NV_RX2_FRAMINGERR) { 1169 if (len < 0) {
1113 if (Flags & NV_RX2_SUBSTRACT1) {
1114 len--;
1115 }
1116 } else {
1117 np->stats.rx_errors++; 1170 np->stats.rx_errors++;
1118 goto next_pkt; 1171 goto next_pkt;
1119 } 1172 }
1120 } 1173 }
1174 /* framing errors are soft errors */
1175 if (Flags & NV_RX2_FRAMINGERR) {
1176 if (Flags & NV_RX2_SUBSTRACT1) {
1177 len--;
1178 }
1179 }
1121 Flags &= NV_RX2_CHECKSUMMASK; 1180 Flags &= NV_RX2_CHECKSUMMASK;
1122 if (Flags == NV_RX2_CHECKSUMOK1 || 1181 if (Flags == NV_RX2_CHECKSUMOK1 ||
1123 Flags == NV_RX2_CHECKSUMOK2 || 1182 Flags == NV_RX2_CHECKSUMOK2 ||
@@ -1480,6 +1539,13 @@ static void nv_do_nic_poll(unsigned long data)
1480 enable_irq(dev->irq); 1539 enable_irq(dev->irq);
1481} 1540}
1482 1541
1542#ifdef CONFIG_NET_POLL_CONTROLLER
1543static void nv_poll_controller(struct net_device *dev)
1544{
1545 nv_do_nic_poll((unsigned long) dev);
1546}
1547#endif
1548
1483static void nv_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 1549static void nv_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
1484{ 1550{
1485 struct fe_priv *np = get_nvpriv(dev); 1551 struct fe_priv *np = get_nvpriv(dev);
@@ -1962,6 +2028,9 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
1962 dev->get_stats = nv_get_stats; 2028 dev->get_stats = nv_get_stats;
1963 dev->change_mtu = nv_change_mtu; 2029 dev->change_mtu = nv_change_mtu;
1964 dev->set_multicast_list = nv_set_multicast; 2030 dev->set_multicast_list = nv_set_multicast;
2031#ifdef CONFIG_NET_POLL_CONTROLLER
2032 dev->poll_controller = nv_poll_controller;
2033#endif
1965 SET_ETHTOOL_OPS(dev, &ops); 2034 SET_ETHTOOL_OPS(dev, &ops);
1966 dev->tx_timeout = nv_tx_timeout; 2035 dev->tx_timeout = nv_tx_timeout;
1967 dev->watchdog_timeo = NV_WATCHDOG_TIMEO; 2036 dev->watchdog_timeo = NV_WATCHDOG_TIMEO;
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index 1c563f905a59..a7f15d9f13e5 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -374,29 +374,6 @@ static inline void do_kiss_params(struct baycom_state *bc,
374} 374}
375 375
376/* --------------------------------------------------------------------- */ 376/* --------------------------------------------------------------------- */
377/*
378 * high performance HDLC encoder
379 * yes, it's ugly, but generates pretty good code
380 */
381
382#define ENCODEITERA(j) \
383({ \
384 if (!(notbitstream & (0x1f0 << j))) \
385 goto stuff##j; \
386 encodeend##j: ; \
387})
388
389#define ENCODEITERB(j) \
390({ \
391 stuff##j: \
392 bitstream &= ~(0x100 << j); \
393 bitbuf = (bitbuf & (((2 << j) << numbit) - 1)) | \
394 ((bitbuf & ~(((2 << j) << numbit) - 1)) << 1); \
395 numbit++; \
396 notbitstream = ~bitstream; \
397 goto encodeend##j; \
398})
399
400 377
401static void encode_hdlc(struct baycom_state *bc) 378static void encode_hdlc(struct baycom_state *bc)
402{ 379{
@@ -405,6 +382,7 @@ static void encode_hdlc(struct baycom_state *bc)
405 int pkt_len; 382 int pkt_len;
406 unsigned bitstream, notbitstream, bitbuf, numbit, crc; 383 unsigned bitstream, notbitstream, bitbuf, numbit, crc;
407 unsigned char crcarr[2]; 384 unsigned char crcarr[2];
385 int j;
408 386
409 if (bc->hdlctx.bufcnt > 0) 387 if (bc->hdlctx.bufcnt > 0)
410 return; 388 return;
@@ -429,24 +407,14 @@ static void encode_hdlc(struct baycom_state *bc)
429 pkt_len--; 407 pkt_len--;
430 if (!pkt_len) 408 if (!pkt_len)
431 bp = crcarr; 409 bp = crcarr;
432 ENCODEITERA(0); 410 for (j = 0; j < 8; j++)
433 ENCODEITERA(1); 411 if (unlikely(!(notbitstream & (0x1f0 << j)))) {
434 ENCODEITERA(2); 412 bitstream &= ~(0x100 << j);
435 ENCODEITERA(3); 413 bitbuf = (bitbuf & (((2 << j) << numbit) - 1)) |
436 ENCODEITERA(4); 414 ((bitbuf & ~(((2 << j) << numbit) - 1)) << 1);
437 ENCODEITERA(5); 415 numbit++;
438 ENCODEITERA(6); 416 notbitstream = ~bitstream;
439 ENCODEITERA(7); 417 }
440 goto enditer;
441 ENCODEITERB(0);
442 ENCODEITERB(1);
443 ENCODEITERB(2);
444 ENCODEITERB(3);
445 ENCODEITERB(4);
446 ENCODEITERB(5);
447 ENCODEITERB(6);
448 ENCODEITERB(7);
449 enditer:
450 numbit += 8; 418 numbit += 8;
451 while (numbit >= 8) { 419 while (numbit >= 8) {
452 *wp++ = bitbuf; 420 *wp++ = bitbuf;
@@ -610,37 +578,6 @@ static void do_rxpacket(struct net_device *dev)
610 bc->stats.rx_packets++; 578 bc->stats.rx_packets++;
611} 579}
612 580
613#define DECODEITERA(j) \
614({ \
615 if (!(notbitstream & (0x0fc << j))) /* flag or abort */ \
616 goto flgabrt##j; \
617 if ((bitstream & (0x1f8 << j)) == (0xf8 << j)) /* stuffed bit */ \
618 goto stuff##j; \
619 enditer##j: ; \
620})
621
622#define DECODEITERB(j) \
623({ \
624 flgabrt##j: \
625 if (!(notbitstream & (0x1fc << j))) { /* abort received */ \
626 state = 0; \
627 goto enditer##j; \
628 } \
629 if ((bitstream & (0x1fe << j)) != (0x0fc << j)) /* flag received */ \
630 goto enditer##j; \
631 if (state) \
632 do_rxpacket(dev); \
633 bc->hdlcrx.bufcnt = 0; \
634 bc->hdlcrx.bufptr = bc->hdlcrx.buf; \
635 state = 1; \
636 numbits = 7-j; \
637 goto enditer##j; \
638 stuff##j: \
639 numbits--; \
640 bitbuf = (bitbuf & ((~0xff) << j)) | ((bitbuf & ~((~0xff) << j)) << 1); \
641 goto enditer##j; \
642})
643
644static int receive(struct net_device *dev, int cnt) 581static int receive(struct net_device *dev, int cnt)
645{ 582{
646 struct baycom_state *bc = netdev_priv(dev); 583 struct baycom_state *bc = netdev_priv(dev);
@@ -649,6 +586,7 @@ static int receive(struct net_device *dev, int cnt)
649 unsigned char tmp[128]; 586 unsigned char tmp[128];
650 unsigned char *cp; 587 unsigned char *cp;
651 int cnt2, ret = 0; 588 int cnt2, ret = 0;
589 int j;
652 590
653 numbits = bc->hdlcrx.numbits; 591 numbits = bc->hdlcrx.numbits;
654 state = bc->hdlcrx.state; 592 state = bc->hdlcrx.state;
@@ -669,24 +607,32 @@ static int receive(struct net_device *dev, int cnt)
669 bitbuf |= (*cp) << 8; 607 bitbuf |= (*cp) << 8;
670 numbits += 8; 608 numbits += 8;
671 notbitstream = ~bitstream; 609 notbitstream = ~bitstream;
672 DECODEITERA(0); 610 for (j = 0; j < 8; j++) {
673 DECODEITERA(1); 611
674 DECODEITERA(2); 612 /* flag or abort */
675 DECODEITERA(3); 613 if (unlikely(!(notbitstream & (0x0fc << j)))) {
676 DECODEITERA(4); 614
677 DECODEITERA(5); 615 /* abort received */
678 DECODEITERA(6); 616 if (!(notbitstream & (0x1fc << j)))
679 DECODEITERA(7); 617 state = 0;
680 goto enddec; 618
681 DECODEITERB(0); 619 /* not flag received */
682 DECODEITERB(1); 620 else if (!(bitstream & (0x1fe << j)) != (0x0fc << j)) {
683 DECODEITERB(2); 621 if (state)
684 DECODEITERB(3); 622 do_rxpacket(dev);
685 DECODEITERB(4); 623 bc->hdlcrx.bufcnt = 0;
686 DECODEITERB(5); 624 bc->hdlcrx.bufptr = bc->hdlcrx.buf;
687 DECODEITERB(6); 625 state = 1;
688 DECODEITERB(7); 626 numbits = 7-j;
689 enddec: 627 }
628 }
629
630 /* stuffed bit */
631 else if (unlikely((bitstream & (0x1f8 << j)) == (0xf8 << j))) {
632 numbits--;
633 bitbuf = (bitbuf & ((~0xff) << j)) | ((bitbuf & ~((~0xff) << j)) << 1);
634 }
635 }
690 while (state && numbits >= 8) { 636 while (state && numbits >= 8) {
691 if (bc->hdlcrx.bufcnt >= TXBUFFER_SIZE) { 637 if (bc->hdlcrx.bufcnt >= TXBUFFER_SIZE) {
692 state = 0; 638 state = 0;
diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
index 1c553d7efdd9..ca5914091d3a 100644
--- a/drivers/net/irda/Kconfig
+++ b/drivers/net/irda/Kconfig
@@ -389,7 +389,7 @@ config VIA_FIR
389 help 389 help
390 Say Y here if you want to build support for the VIA VT8231 390 Say Y here if you want to build support for the VIA VT8231
391 and VIA VT1211 IrDA controllers, found on the motherboards using 391 and VIA VT1211 IrDA controllers, found on the motherboards using
392 those those VIA chipsets. To use this controller, you will need 392 those VIA chipsets. To use this controller, you will need
393 to plug a specific 5 pins FIR IrDA dongle in the specific 393 to plug a specific 5 pins FIR IrDA dongle in the specific
394 motherboard connector. The driver provides support for SIR, MIR 394 motherboard connector. The driver provides support for SIR, MIR
395 and FIR (4Mbps) speeds. 395 and FIR (4Mbps) speeds.
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 855f8b2cf13b..55af32e9bf08 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -802,13 +802,14 @@ static void veth_tx_timeout(struct net_device *dev)
802 802
803 spin_lock_irqsave(&port->pending_gate, flags); 803 spin_lock_irqsave(&port->pending_gate, flags);
804 804
805 if (!port->pending_lpmask) {
806 spin_unlock_irqrestore(&port->pending_gate, flags);
807 return;
808 }
809
805 printk(KERN_WARNING "%s: Tx timeout! Resetting lp connections: %08x\n", 810 printk(KERN_WARNING "%s: Tx timeout! Resetting lp connections: %08x\n",
806 dev->name, port->pending_lpmask); 811 dev->name, port->pending_lpmask);
807 812
808 /* If we've timed out the queue must be stopped, which should
809 * only ever happen when there is a pending packet. */
810 WARN_ON(! port->pending_lpmask);
811
812 for (i = 0; i < HVMAXARCHITECTEDLPS; i++) { 813 for (i = 0; i < HVMAXARCHITECTEDLPS; i++) {
813 struct veth_lpar_connection *cnx = veth_cnx[i]; 814 struct veth_lpar_connection *cnx = veth_cnx[i];
814 815
@@ -924,7 +925,7 @@ static int veth_transmit_to_one(struct sk_buff *skb, HvLpIndex rlp,
924 925
925 spin_lock_irqsave(&cnx->lock, flags); 926 spin_lock_irqsave(&cnx->lock, flags);
926 927
927 if (! cnx->state & VETH_STATE_READY) 928 if (! (cnx->state & VETH_STATE_READY))
928 goto drop; 929 goto drop;
929 930
930 if ((skb->len - 14) > VETH_MAX_MTU) 931 if ((skb->len - 14) > VETH_MAX_MTU)
@@ -1023,6 +1024,8 @@ static int veth_start_xmit(struct sk_buff *skb, struct net_device *dev)
1023 1024
1024 lpmask = veth_transmit_to_many(skb, lpmask, dev); 1025 lpmask = veth_transmit_to_many(skb, lpmask, dev);
1025 1026
1027 dev->trans_start = jiffies;
1028
1026 if (! lpmask) { 1029 if (! lpmask) {
1027 dev_kfree_skb(skb); 1030 dev_kfree_skb(skb);
1028 } else { 1031 } else {
@@ -1262,13 +1265,18 @@ static void veth_receive(struct veth_lpar_connection *cnx,
1262 1265
1263 vlan = skb->data[9]; 1266 vlan = skb->data[9];
1264 dev = veth_dev[vlan]; 1267 dev = veth_dev[vlan];
1265 if (! dev) 1268 if (! dev) {
1266 /* Some earlier versions of the driver sent 1269 /*
1267 broadcasts down all connections, even to 1270 * Some earlier versions of the driver sent
1268 lpars that weren't on the relevant vlan. 1271 * broadcasts down all connections, even to lpars
1269 So ignore packets belonging to a vlan we're 1272 * that weren't on the relevant vlan. So ignore
1270 not on. */ 1273 * packets belonging to a vlan we're not on.
1274 * We can also be here if we receive packets while
1275 * the driver is going down, because then dev is NULL.
1276 */
1277 dev_kfree_skb_irq(skb);
1271 continue; 1278 continue;
1279 }
1272 1280
1273 port = (struct veth_port *)dev->priv; 1281 port = (struct veth_port *)dev->priv;
1274 dest = *((u64 *) skb->data) & 0xFFFFFFFFFFFF0000; 1282 dest = *((u64 *) skb->data) & 0xFFFFFFFFFFFF0000;
@@ -1381,18 +1389,25 @@ void __exit veth_module_cleanup(void)
1381{ 1389{
1382 int i; 1390 int i;
1383 1391
1384 vio_unregister_driver(&veth_driver); 1392 /* Stop the queues first to stop any new packets being sent. */
1393 for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++)
1394 if (veth_dev[i])
1395 netif_stop_queue(veth_dev[i]);
1385 1396
1397 /* Stop the connections before we unregister the driver. This
1398 * ensures there's no skbs lying around holding the device open. */
1386 for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) 1399 for (i = 0; i < HVMAXARCHITECTEDLPS; ++i)
1387 veth_stop_connection(i); 1400 veth_stop_connection(i);
1388 1401
1389 HvLpEvent_unregisterHandler(HvLpEvent_Type_VirtualLan); 1402 HvLpEvent_unregisterHandler(HvLpEvent_Type_VirtualLan);
1390 1403
1391 /* Hypervisor callbacks may have scheduled more work while we 1404 /* Hypervisor callbacks may have scheduled more work while we
1392 * were destroying connections. Now that we've disconnected from 1405 * were stoping connections. Now that we've disconnected from
1393 * the hypervisor make sure everything's finished. */ 1406 * the hypervisor make sure everything's finished. */
1394 flush_scheduled_work(); 1407 flush_scheduled_work();
1395 1408
1409 vio_unregister_driver(&veth_driver);
1410
1396 for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) 1411 for (i = 0; i < HVMAXARCHITECTEDLPS; ++i)
1397 veth_destroy_connection(i); 1412 veth_destroy_connection(i);
1398 1413
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 223bdadd4c0d..babb59e146ea 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -2433,9 +2433,9 @@ static void __set_rx_mode(struct net_device *dev)
2433 rx_mode = RxFilterEnable | AcceptBroadcast 2433 rx_mode = RxFilterEnable | AcceptBroadcast
2434 | AcceptMulticast | AcceptMyPhys; 2434 | AcceptMulticast | AcceptMyPhys;
2435 for (i = 0; i < 64; i += 2) { 2435 for (i = 0; i < 64; i += 2) {
2436 writew(HASH_TABLE + i, ioaddr + RxFilterAddr); 2436 writel(HASH_TABLE + i, ioaddr + RxFilterAddr);
2437 writew((mc_filter[i+1]<<8) + mc_filter[i], 2437 writel((mc_filter[i + 1] << 8) + mc_filter[i],
2438 ioaddr + RxFilterData); 2438 ioaddr + RxFilterData);
2439 } 2439 }
2440 } 2440 }
2441 writel(rx_mode, ioaddr + RxFilterAddr); 2441 writel(rx_mode, ioaddr + RxFilterAddr);
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 2fcc181a8624..c336b46bd332 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -1,4 +1,4 @@
1#define _VERSION "0.20" 1#define VERSION "0.22"
2/* ns83820.c by Benjamin LaHaise with contributions. 2/* ns83820.c by Benjamin LaHaise with contributions.
3 * 3 *
4 * Questions/comments/discussion to linux-ns83820@kvack.org. 4 * Questions/comments/discussion to linux-ns83820@kvack.org.
@@ -63,9 +63,11 @@
63 * - fix missed txok introduced during performance 63 * - fix missed txok introduced during performance
64 * tuning 64 * tuning
65 * 0.20 - fix stupid RFEN thinko. i am such a smurf. 65 * 0.20 - fix stupid RFEN thinko. i am such a smurf.
66 *
67 * 20040828 0.21 - add hardware vlan accleration 66 * 20040828 0.21 - add hardware vlan accleration
68 * by Neil Horman <nhorman@redhat.com> 67 * by Neil Horman <nhorman@redhat.com>
68 * 20050406 0.22 - improved DAC ifdefs from Andi Kleen
69 * - removal of dead code from Adrian Bunk
70 * - fix half duplex collision behaviour
69 * Driver Overview 71 * Driver Overview
70 * =============== 72 * ===============
71 * 73 *
@@ -129,18 +131,6 @@ static int lnksts = 0; /* CFG_LNKSTS bit polarity */
129#undef Dprintk 131#undef Dprintk
130#define Dprintk dprintk 132#define Dprintk dprintk
131 133
132#if defined(CONFIG_HIGHMEM64G) || defined(__ia64__)
133#define USE_64BIT_ADDR "+"
134#endif
135
136#if defined(USE_64BIT_ADDR)
137#define VERSION _VERSION USE_64BIT_ADDR
138#define TRY_DAC 1
139#else
140#define VERSION _VERSION
141#define TRY_DAC 0
142#endif
143
144/* tunables */ 134/* tunables */
145#define RX_BUF_SIZE 1500 /* 8192 */ 135#define RX_BUF_SIZE 1500 /* 8192 */
146#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 136#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
@@ -386,22 +376,16 @@ static int lnksts = 0; /* CFG_LNKSTS bit polarity */
386#define LINK_DOWN 0x02 376#define LINK_DOWN 0x02
387#define LINK_UP 0x04 377#define LINK_UP 0x04
388 378
389#ifdef USE_64BIT_ADDR 379#define HW_ADDR_LEN sizeof(dma_addr_t)
390#define HW_ADDR_LEN 8
391#define desc_addr_set(desc, addr) \ 380#define desc_addr_set(desc, addr) \
392 do { \ 381 do { \
393 u64 __addr = (addr); \ 382 ((desc)[0] = cpu_to_le32(addr)); \
394 (desc)[0] = cpu_to_le32(__addr); \ 383 if (HW_ADDR_LEN == 8) \
395 (desc)[1] = cpu_to_le32(__addr >> 32); \ 384 (desc)[1] = cpu_to_le32(((u64)addr) >> 32); \
396 } while(0) 385 } while(0)
397#define desc_addr_get(desc) \ 386#define desc_addr_get(desc) \
398 (((u64)le32_to_cpu((desc)[1]) << 32) \ 387 (le32_to_cpu((desc)[0]) | \
399 | le32_to_cpu((desc)[0])) 388 (HW_ADDR_LEN == 8 ? ((dma_addr_t)le32_to_cpu((desc)[1]))<<32 : 0))
400#else
401#define HW_ADDR_LEN 4
402#define desc_addr_set(desc, addr) ((desc)[0] = cpu_to_le32(addr))
403#define desc_addr_get(desc) (le32_to_cpu((desc)[0]))
404#endif
405 389
406#define DESC_LINK 0 390#define DESC_LINK 0
407#define DESC_BUFPTR (DESC_LINK + HW_ADDR_LEN/4) 391#define DESC_BUFPTR (DESC_LINK + HW_ADDR_LEN/4)
@@ -727,11 +711,23 @@ static void fastcall phy_intr(struct net_device *ndev)
727 speed = ((cfg / CFG_SPDSTS0) & 3); 711 speed = ((cfg / CFG_SPDSTS0) & 3);
728 fullduplex = (cfg & CFG_DUPSTS); 712 fullduplex = (cfg & CFG_DUPSTS);
729 713
730 if (fullduplex) 714 if (fullduplex) {
731 new_cfg |= CFG_SB; 715 new_cfg |= CFG_SB;
716 writel(readl(dev->base + TXCFG)
717 | TXCFG_CSI | TXCFG_HBI,
718 dev->base + TXCFG);
719 writel(readl(dev->base + RXCFG) | RXCFG_RX_FD,
720 dev->base + RXCFG);
721 } else {
722 writel(readl(dev->base + TXCFG)
723 & ~(TXCFG_CSI | TXCFG_HBI),
724 dev->base + TXCFG);
725 writel(readl(dev->base + RXCFG) & ~(RXCFG_RX_FD),
726 dev->base + RXCFG);
727 }
732 728
733 if ((cfg & CFG_LNKSTS) && 729 if ((cfg & CFG_LNKSTS) &&
734 ((new_cfg ^ dev->CFG_cache) & CFG_MODE_1000)) { 730 ((new_cfg ^ dev->CFG_cache) != 0)) {
735 writel(new_cfg, dev->base + CFG); 731 writel(new_cfg, dev->base + CFG);
736 dev->CFG_cache = new_cfg; 732 dev->CFG_cache = new_cfg;
737 } 733 }
@@ -1189,7 +1185,6 @@ again:
1189 1185
1190 for (;;) { 1186 for (;;) {
1191 volatile u32 *desc = dev->tx_descs + (free_idx * DESC_SIZE); 1187 volatile u32 *desc = dev->tx_descs + (free_idx * DESC_SIZE);
1192 u32 residue = 0;
1193 1188
1194 dprintk("frag[%3u]: %4u @ 0x%08Lx\n", free_idx, len, 1189 dprintk("frag[%3u]: %4u @ 0x%08Lx\n", free_idx, len,
1195 (unsigned long long)buf); 1190 (unsigned long long)buf);
@@ -1199,17 +1194,11 @@ again:
1199 desc_addr_set(desc + DESC_BUFPTR, buf); 1194 desc_addr_set(desc + DESC_BUFPTR, buf);
1200 desc[DESC_EXTSTS] = cpu_to_le32(extsts); 1195 desc[DESC_EXTSTS] = cpu_to_le32(extsts);
1201 1196
1202 cmdsts = ((nr_frags|residue) ? CMDSTS_MORE : do_intr ? CMDSTS_INTR : 0); 1197 cmdsts = ((nr_frags) ? CMDSTS_MORE : do_intr ? CMDSTS_INTR : 0);
1203 cmdsts |= (desc == first_desc) ? 0 : CMDSTS_OWN; 1198 cmdsts |= (desc == first_desc) ? 0 : CMDSTS_OWN;
1204 cmdsts |= len; 1199 cmdsts |= len;
1205 desc[DESC_CMDSTS] = cpu_to_le32(cmdsts); 1200 desc[DESC_CMDSTS] = cpu_to_le32(cmdsts);
1206 1201
1207 if (residue) {
1208 buf += len;
1209 len = residue;
1210 continue;
1211 }
1212
1213 if (!nr_frags) 1202 if (!nr_frags)
1214 break; 1203 break;
1215 1204
@@ -1841,7 +1830,8 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
1841 int using_dac = 0; 1830 int using_dac = 0;
1842 1831
1843 /* See if we can set the dma mask early on; failure is fatal. */ 1832 /* See if we can set the dma mask early on; failure is fatal. */
1844 if (TRY_DAC && !pci_set_dma_mask(pci_dev, 0xffffffffffffffffULL)) { 1833 if (sizeof(dma_addr_t) == 8 &&
1834 !pci_set_dma_mask(pci_dev, 0xffffffffffffffffULL)) {
1845 using_dac = 1; 1835 using_dac = 1;
1846 } else if (!pci_set_dma_mask(pci_dev, 0xffffffff)) { 1836 } else if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
1847 using_dac = 0; 1837 using_dac = 0;
@@ -1972,9 +1962,8 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
1972 /* When compiled with 64 bit addressing, we must always enable 1962 /* When compiled with 64 bit addressing, we must always enable
1973 * the 64 bit descriptor format. 1963 * the 64 bit descriptor format.
1974 */ 1964 */
1975#ifdef USE_64BIT_ADDR 1965 if (sizeof(dma_addr_t) == 8)
1976 dev->CFG_cache |= CFG_M64ADDR; 1966 dev->CFG_cache |= CFG_M64ADDR;
1977#endif
1978 if (using_dac) 1967 if (using_dac)
1979 dev->CFG_cache |= CFG_T64ADDR; 1968 dev->CFG_cache |= CFG_T64ADDR;
1980 1969
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 41e517114807..c6e8b25f9685 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -1274,6 +1274,9 @@ static int el3_close(struct net_device *dev)
1274 spin_lock_irqsave(&lp->window_lock, flags); 1274 spin_lock_irqsave(&lp->window_lock, flags);
1275 update_stats(dev); 1275 update_stats(dev);
1276 spin_unlock_irqrestore(&lp->window_lock, flags); 1276 spin_unlock_irqrestore(&lp->window_lock, flags);
1277
1278 /* force interrupts off */
1279 outw(SetIntrEnb | 0x0000, ioaddr + EL3_CMD);
1277 } 1280 }
1278 1281
1279 link->open--; 1282 link->open--;
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index b0126304ca08..181b6ed55003 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -1537,20 +1537,20 @@ static void shmem_get_8390_hdr(struct net_device *dev,
1537static void shmem_block_input(struct net_device *dev, int count, 1537static void shmem_block_input(struct net_device *dev, int count,
1538 struct sk_buff *skb, int ring_offset) 1538 struct sk_buff *skb, int ring_offset)
1539{ 1539{
1540 void __iomem *xfer_start = ei_status.mem + (TX_PAGES<<8) 1540 void __iomem *base = ei_status.mem;
1541 + ring_offset 1541 unsigned long offset = (TX_PAGES<<8) + ring_offset
1542 - (ei_status.rx_start_page << 8); 1542 - (ei_status.rx_start_page << 8);
1543 char *buf = skb->data; 1543 char *buf = skb->data;
1544 1544
1545 if (xfer_start + count > (void __iomem *)ei_status.rmem_end) { 1545 if (offset + count > ei_status.priv) {
1546 /* We must wrap the input move. */ 1546 /* We must wrap the input move. */
1547 int semi_count = (void __iomem *)ei_status.rmem_end - xfer_start; 1547 int semi_count = ei_status.priv - offset;
1548 copyin(buf, xfer_start, semi_count); 1548 copyin(buf, base + offset, semi_count);
1549 buf += semi_count; 1549 buf += semi_count;
1550 xfer_start = ei_status.mem + (TX_PAGES<<8); 1550 offset = TX_PAGES<<8;
1551 count -= semi_count; 1551 count -= semi_count;
1552 } 1552 }
1553 copyin(buf, xfer_start, count); 1553 copyin(buf, base + offset, count);
1554} 1554}
1555 1555
1556/*====================================================================*/ 1556/*====================================================================*/
@@ -1611,8 +1611,9 @@ static int setup_shmem_window(dev_link_t *link, int start_pg,
1611 } 1611 }
1612 1612
1613 ei_status.mem = info->base + offset; 1613 ei_status.mem = info->base + offset;
1614 ei_status.priv = req.Size;
1614 dev->mem_start = (u_long)ei_status.mem; 1615 dev->mem_start = (u_long)ei_status.mem;
1615 dev->mem_end = ei_status.rmem_end = (u_long)info->base + req.Size; 1616 dev->mem_end = dev->mem_start + req.Size;
1616 1617
1617 ei_status.tx_start_page = start_pg; 1618 ei_status.tx_start_page = start_pg;
1618 ei_status.rx_start_page = start_pg + TX_PAGES; 1619 ei_status.rx_start_page = start_pg + TX_PAGES;
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 3b377f6cd4a0..ab726ab43798 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -273,7 +273,7 @@ static int ppp_connect_channel(struct channel *pch, int unit);
273static int ppp_disconnect_channel(struct channel *pch); 273static int ppp_disconnect_channel(struct channel *pch);
274static void ppp_destroy_channel(struct channel *pch); 274static void ppp_destroy_channel(struct channel *pch);
275 275
276static struct class_simple *ppp_class; 276static struct class *ppp_class;
277 277
278/* Translates a PPP protocol number to a NP index (NP == network protocol) */ 278/* Translates a PPP protocol number to a NP index (NP == network protocol) */
279static inline int proto_to_npindex(int proto) 279static inline int proto_to_npindex(int proto)
@@ -858,12 +858,12 @@ static int __init ppp_init(void)
858 printk(KERN_INFO "PPP generic driver version " PPP_VERSION "\n"); 858 printk(KERN_INFO "PPP generic driver version " PPP_VERSION "\n");
859 err = register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops); 859 err = register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops);
860 if (!err) { 860 if (!err) {
861 ppp_class = class_simple_create(THIS_MODULE, "ppp"); 861 ppp_class = class_create(THIS_MODULE, "ppp");
862 if (IS_ERR(ppp_class)) { 862 if (IS_ERR(ppp_class)) {
863 err = PTR_ERR(ppp_class); 863 err = PTR_ERR(ppp_class);
864 goto out_chrdev; 864 goto out_chrdev;
865 } 865 }
866 class_simple_device_add(ppp_class, MKDEV(PPP_MAJOR, 0), NULL, "ppp"); 866 class_device_create(ppp_class, MKDEV(PPP_MAJOR, 0), NULL, "ppp");
867 err = devfs_mk_cdev(MKDEV(PPP_MAJOR, 0), 867 err = devfs_mk_cdev(MKDEV(PPP_MAJOR, 0),
868 S_IFCHR|S_IRUSR|S_IWUSR, "ppp"); 868 S_IFCHR|S_IRUSR|S_IWUSR, "ppp");
869 if (err) 869 if (err)
@@ -876,8 +876,8 @@ out:
876 return err; 876 return err;
877 877
878out_class: 878out_class:
879 class_simple_device_remove(MKDEV(PPP_MAJOR,0)); 879 class_device_destroy(ppp_class, MKDEV(PPP_MAJOR,0));
880 class_simple_destroy(ppp_class); 880 class_destroy(ppp_class);
881out_chrdev: 881out_chrdev:
882 unregister_chrdev(PPP_MAJOR, "ppp"); 882 unregister_chrdev(PPP_MAJOR, "ppp");
883 goto out; 883 goto out;
@@ -1217,36 +1217,43 @@ ppp_push(struct ppp *ppp)
1217 */ 1217 */
1218static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb) 1218static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
1219{ 1219{
1220 int nch, len, fragsize; 1220 int len, fragsize;
1221 int i, bits, hdrlen, mtu; 1221 int i, bits, hdrlen, mtu;
1222 int flen, fnb; 1222 int flen;
1223 int navail, nfree;
1224 int nbigger;
1223 unsigned char *p, *q; 1225 unsigned char *p, *q;
1224 struct list_head *list; 1226 struct list_head *list;
1225 struct channel *pch; 1227 struct channel *pch;
1226 struct sk_buff *frag; 1228 struct sk_buff *frag;
1227 struct ppp_channel *chan; 1229 struct ppp_channel *chan;
1228 1230
1229 nch = 0; 1231 nfree = 0; /* # channels which have no packet already queued */
1232 navail = 0; /* total # of usable channels (not deregistered) */
1230 hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN; 1233 hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN;
1234 i = 0;
1231 list = &ppp->channels; 1235 list = &ppp->channels;
1232 while ((list = list->next) != &ppp->channels) { 1236 while ((list = list->next) != &ppp->channels) {
1233 pch = list_entry(list, struct channel, clist); 1237 pch = list_entry(list, struct channel, clist);
1234 nch += pch->avail = (skb_queue_len(&pch->file.xq) == 0); 1238 navail += pch->avail = (pch->chan != NULL);
1235 /* 1239 if (pch->avail) {
1236 * If a channel hasn't had a fragment yet, it has to get 1240 if (skb_queue_len(&pch->file.xq) == 0
1237 * one before we send any fragments on later channels. 1241 || !pch->had_frag) {
1238 * If it can't take a fragment now, don't give any 1242 pch->avail = 2;
1239 * to subsequent channels. 1243 ++nfree;
1240 */
1241 if (!pch->had_frag && !pch->avail) {
1242 while ((list = list->next) != &ppp->channels) {
1243 pch = list_entry(list, struct channel, clist);
1244 pch->avail = 0;
1245 } 1244 }
1246 break; 1245 if (!pch->had_frag && i < ppp->nxchan)
1246 ppp->nxchan = i;
1247 } 1247 }
1248 ++i;
1248 } 1249 }
1249 if (nch == 0) 1250
1251 /*
1252 * Don't start sending this packet unless at least half of
1253 * the channels are free. This gives much better TCP
1254 * performance if we have a lot of channels.
1255 */
1256 if (nfree == 0 || nfree < navail / 2)
1250 return 0; /* can't take now, leave it in xmit_pending */ 1257 return 0; /* can't take now, leave it in xmit_pending */
1251 1258
1252 /* Do protocol field compression (XXX this should be optional) */ 1259 /* Do protocol field compression (XXX this should be optional) */
@@ -1257,14 +1264,19 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
1257 --len; 1264 --len;
1258 } 1265 }
1259 1266
1260 /* decide on fragment size */ 1267 /*
1268 * Decide on fragment size.
1269 * We create a fragment for each free channel regardless of
1270 * how small they are (i.e. even 0 length) in order to minimize
1271 * the time that it will take to detect when a channel drops
1272 * a fragment.
1273 */
1261 fragsize = len; 1274 fragsize = len;
1262 if (nch > 1) { 1275 if (nfree > 1)
1263 int maxch = ROUNDUP(len, MIN_FRAG_SIZE); 1276 fragsize = ROUNDUP(fragsize, nfree);
1264 if (nch > maxch) 1277 /* nbigger channels get fragsize bytes, the rest get fragsize-1,
1265 nch = maxch; 1278 except if nbigger==0, then they all get fragsize. */
1266 fragsize = ROUNDUP(fragsize, nch); 1279 nbigger = len % nfree;
1267 }
1268 1280
1269 /* skip to the channel after the one we last used 1281 /* skip to the channel after the one we last used
1270 and start at that one */ 1282 and start at that one */
@@ -1278,7 +1290,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
1278 1290
1279 /* create a fragment for each channel */ 1291 /* create a fragment for each channel */
1280 bits = B; 1292 bits = B;
1281 do { 1293 while (nfree > 0 || len > 0) {
1282 list = list->next; 1294 list = list->next;
1283 if (list == &ppp->channels) { 1295 if (list == &ppp->channels) {
1284 i = 0; 1296 i = 0;
@@ -1289,61 +1301,92 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
1289 if (!pch->avail) 1301 if (!pch->avail)
1290 continue; 1302 continue;
1291 1303
1304 /*
1305 * Skip this channel if it has a fragment pending already and
1306 * we haven't given a fragment to all of the free channels.
1307 */
1308 if (pch->avail == 1) {
1309 if (nfree > 0)
1310 continue;
1311 } else {
1312 --nfree;
1313 pch->avail = 1;
1314 }
1315
1292 /* check the channel's mtu and whether it is still attached. */ 1316 /* check the channel's mtu and whether it is still attached. */
1293 spin_lock_bh(&pch->downl); 1317 spin_lock_bh(&pch->downl);
1294 if (pch->chan == 0 || (mtu = pch->chan->mtu) < hdrlen) { 1318 if (pch->chan == NULL) {
1295 /* can't use this channel */ 1319 /* can't use this channel, it's being deregistered */
1296 spin_unlock_bh(&pch->downl); 1320 spin_unlock_bh(&pch->downl);
1297 pch->avail = 0; 1321 pch->avail = 0;
1298 if (--nch == 0) 1322 if (--navail == 0)
1299 break; 1323 break;
1300 continue; 1324 continue;
1301 } 1325 }
1302 1326
1303 /* 1327 /*
1304 * We have to create multiple fragments for this channel 1328 * Create a fragment for this channel of
1305 * if fragsize is greater than the channel's mtu. 1329 * min(max(mtu+2-hdrlen, 4), fragsize, len) bytes.
1330 * If mtu+2-hdrlen < 4, that is a ridiculously small
1331 * MTU, so we use mtu = 2 + hdrlen.
1306 */ 1332 */
1307 if (fragsize > len) 1333 if (fragsize > len)
1308 fragsize = len; 1334 fragsize = len;
1309 for (flen = fragsize; flen > 0; flen -= fnb) { 1335 flen = fragsize;
1310 fnb = flen; 1336 mtu = pch->chan->mtu + 2 - hdrlen;
1311 if (fnb > mtu + 2 - hdrlen) 1337 if (mtu < 4)
1312 fnb = mtu + 2 - hdrlen; 1338 mtu = 4;
1313 if (fnb >= len) 1339 if (flen > mtu)
1314 bits |= E; 1340 flen = mtu;
1315 frag = alloc_skb(fnb + hdrlen, GFP_ATOMIC); 1341 if (flen == len && nfree == 0)
1316 if (frag == 0) 1342 bits |= E;
1317 goto noskb; 1343 frag = alloc_skb(flen + hdrlen + (flen == 0), GFP_ATOMIC);
1318 q = skb_put(frag, fnb + hdrlen); 1344 if (frag == 0)
1319 /* make the MP header */ 1345 goto noskb;
1320 q[0] = PPP_MP >> 8; 1346 q = skb_put(frag, flen + hdrlen);
1321 q[1] = PPP_MP; 1347
1322 if (ppp->flags & SC_MP_XSHORTSEQ) { 1348 /* make the MP header */
1323 q[2] = bits + ((ppp->nxseq >> 8) & 0xf); 1349 q[0] = PPP_MP >> 8;
1324 q[3] = ppp->nxseq; 1350 q[1] = PPP_MP;
1325 } else { 1351 if (ppp->flags & SC_MP_XSHORTSEQ) {
1326 q[2] = bits; 1352 q[2] = bits + ((ppp->nxseq >> 8) & 0xf);
1327 q[3] = ppp->nxseq >> 16; 1353 q[3] = ppp->nxseq;
1328 q[4] = ppp->nxseq >> 8; 1354 } else {
1329 q[5] = ppp->nxseq; 1355 q[2] = bits;
1330 } 1356 q[3] = ppp->nxseq >> 16;
1331 1357 q[4] = ppp->nxseq >> 8;
1332 /* copy the data in */ 1358 q[5] = ppp->nxseq;
1333 memcpy(q + hdrlen, p, fnb);
1334
1335 /* try to send it down the channel */
1336 chan = pch->chan;
1337 if (!chan->ops->start_xmit(chan, frag))
1338 skb_queue_tail(&pch->file.xq, frag);
1339 pch->had_frag = 1;
1340 p += fnb;
1341 len -= fnb;
1342 ++ppp->nxseq;
1343 bits = 0;
1344 } 1359 }
1360
1361 /*
1362 * Copy the data in.
1363 * Unfortunately there is a bug in older versions of
1364 * the Linux PPP multilink reconstruction code where it
1365 * drops 0-length fragments. Therefore we make sure the
1366 * fragment has at least one byte of data. Any bytes
1367 * we add in this situation will end up as padding on the
1368 * end of the reconstructed packet.
1369 */
1370 if (flen == 0)
1371 *skb_put(frag, 1) = 0;
1372 else
1373 memcpy(q + hdrlen, p, flen);
1374
1375 /* try to send it down the channel */
1376 chan = pch->chan;
1377 if (skb_queue_len(&pch->file.xq)
1378 || !chan->ops->start_xmit(chan, frag))
1379 skb_queue_tail(&pch->file.xq, frag);
1380 pch->had_frag = 1;
1381 p += flen;
1382 len -= flen;
1383 ++ppp->nxseq;
1384 bits = 0;
1345 spin_unlock_bh(&pch->downl); 1385 spin_unlock_bh(&pch->downl);
1346 } while (len > 0); 1386
1387 if (--nbigger == 0 && fragsize > 0)
1388 --fragsize;
1389 }
1347 ppp->nxchan = i; 1390 ppp->nxchan = i;
1348 1391
1349 return 1; 1392 return 1;
@@ -1422,7 +1465,7 @@ ppp_input(struct ppp_channel *chan, struct sk_buff *skb)
1422 kfree_skb(skb); 1465 kfree_skb(skb);
1423 return; 1466 return;
1424 } 1467 }
1425 1468
1426 proto = PPP_PROTO(skb); 1469 proto = PPP_PROTO(skb);
1427 read_lock_bh(&pch->upl); 1470 read_lock_bh(&pch->upl);
1428 if (pch->ppp == 0 || proto >= 0xc000 || proto == PPP_CCPFRAG) { 1471 if (pch->ppp == 0 || proto >= 0xc000 || proto == PPP_CCPFRAG) {
@@ -1691,7 +1734,7 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
1691 struct list_head *l; 1734 struct list_head *l;
1692 int mphdrlen = (ppp->flags & SC_MP_SHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN; 1735 int mphdrlen = (ppp->flags & SC_MP_SHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN;
1693 1736
1694 if (!pskb_may_pull(skb, mphdrlen + 1) || ppp->mrru == 0) 1737 if (!pskb_may_pull(skb, mphdrlen) || ppp->mrru == 0)
1695 goto err; /* no good, throw it away */ 1738 goto err; /* no good, throw it away */
1696 1739
1697 /* Decode sequence number and begin/end bits */ 1740 /* Decode sequence number and begin/end bits */
@@ -2611,8 +2654,8 @@ static void __exit ppp_cleanup(void)
2611 if (unregister_chrdev(PPP_MAJOR, "ppp") != 0) 2654 if (unregister_chrdev(PPP_MAJOR, "ppp") != 0)
2612 printk(KERN_ERR "PPP: failed to unregister PPP device\n"); 2655 printk(KERN_ERR "PPP: failed to unregister PPP device\n");
2613 devfs_remove("ppp"); 2656 devfs_remove("ppp");
2614 class_simple_device_remove(MKDEV(PPP_MAJOR, 0)); 2657 class_device_destroy(ppp_class, MKDEV(PPP_MAJOR, 0));
2615 class_simple_destroy(ppp_class); 2658 class_destroy(ppp_class);
2616} 2659}
2617 2660
2618/* 2661/*
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index c59507f8a76b..ce449fe90e6d 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -69,7 +69,13 @@ VERSION 2.2LK <2005/01/25>
69#include <asm/io.h> 69#include <asm/io.h>
70#include <asm/irq.h> 70#include <asm/irq.h>
71 71
72#define RTL8169_VERSION "2.2LK" 72#ifdef CONFIG_R8169_NAPI
73#define NAPI_SUFFIX "-NAPI"
74#else
75#define NAPI_SUFFIX ""
76#endif
77
78#define RTL8169_VERSION "2.2LK" NAPI_SUFFIX
73#define MODULENAME "r8169" 79#define MODULENAME "r8169"
74#define PFX MODULENAME ": " 80#define PFX MODULENAME ": "
75 81
@@ -85,6 +91,10 @@ VERSION 2.2LK <2005/01/25>
85#define dprintk(fmt, args...) do {} while (0) 91#define dprintk(fmt, args...) do {} while (0)
86#endif /* RTL8169_DEBUG */ 92#endif /* RTL8169_DEBUG */
87 93
94#define R8169_MSG_DEFAULT \
95 (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK | NETIF_MSG_IFUP | \
96 NETIF_MSG_IFDOWN)
97
88#define TX_BUFFS_AVAIL(tp) \ 98#define TX_BUFFS_AVAIL(tp) \
89 (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1) 99 (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1)
90 100
@@ -174,8 +184,9 @@ const static struct {
174#undef _R 184#undef _R
175 185
176static struct pci_device_id rtl8169_pci_tbl[] = { 186static struct pci_device_id rtl8169_pci_tbl[] = {
177 {0x10ec, 0x8169, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 187 { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8169), },
178 {0x1186, 0x4300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 188 { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4300), },
189 { PCI_DEVICE(0x16ec, 0x0116), },
179 {0,}, 190 {0,},
180}; 191};
181 192
@@ -183,10 +194,15 @@ MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl);
183 194
184static int rx_copybreak = 200; 195static int rx_copybreak = 200;
185static int use_dac; 196static int use_dac;
197static struct {
198 u32 msg_enable;
199} debug = { -1 };
186 200
187enum RTL8169_registers { 201enum RTL8169_registers {
188 MAC0 = 0, /* Ethernet hardware address. */ 202 MAC0 = 0, /* Ethernet hardware address. */
189 MAR0 = 8, /* Multicast filter. */ 203 MAR0 = 8, /* Multicast filter. */
204 CounterAddrLow = 0x10,
205 CounterAddrHigh = 0x14,
190 TxDescStartAddrLow = 0x20, 206 TxDescStartAddrLow = 0x20,
191 TxDescStartAddrHigh = 0x24, 207 TxDescStartAddrHigh = 0x24,
192 TxHDescStartAddrLow = 0x28, 208 TxHDescStartAddrLow = 0x28,
@@ -328,6 +344,9 @@ enum RTL8169_register_content {
328 344
329 /* _TBICSRBit */ 345 /* _TBICSRBit */
330 TBILinkOK = 0x02000000, 346 TBILinkOK = 0x02000000,
347
348 /* DumpCounterCommand */
349 CounterDump = 0x8,
331}; 350};
332 351
333enum _DescStatusBit { 352enum _DescStatusBit {
@@ -385,6 +404,7 @@ struct rtl8169_private {
385 struct pci_dev *pci_dev; /* Index of PCI device */ 404 struct pci_dev *pci_dev; /* Index of PCI device */
386 struct net_device_stats stats; /* statistics of net device */ 405 struct net_device_stats stats; /* statistics of net device */
387 spinlock_t lock; /* spin lock flag */ 406 spinlock_t lock; /* spin lock flag */
407 u32 msg_enable;
388 int chipset; 408 int chipset;
389 int mac_version; 409 int mac_version;
390 int phy_version; 410 int phy_version;
@@ -415,12 +435,16 @@ struct rtl8169_private {
415 struct work_struct task; 435 struct work_struct task;
416}; 436};
417 437
418MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@oss.sgi.com>"); 438MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
419MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver"); 439MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
420module_param_array(media, int, &num_media, 0); 440module_param_array(media, int, &num_media, 0);
441MODULE_PARM_DESC(media, "force phy operation. Deprecated by ethtool (8).");
421module_param(rx_copybreak, int, 0); 442module_param(rx_copybreak, int, 0);
443MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames");
422module_param(use_dac, int, 0); 444module_param(use_dac, int, 0);
423MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot."); 445MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot.");
446module_param_named(debug, debug.msg_enable, int, 0);
447MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)");
424MODULE_LICENSE("GPL"); 448MODULE_LICENSE("GPL");
425MODULE_VERSION(RTL8169_VERSION); 449MODULE_VERSION(RTL8169_VERSION);
426 450
@@ -433,10 +457,10 @@ static void rtl8169_hw_start(struct net_device *dev);
433static int rtl8169_close(struct net_device *dev); 457static int rtl8169_close(struct net_device *dev);
434static void rtl8169_set_rx_mode(struct net_device *dev); 458static void rtl8169_set_rx_mode(struct net_device *dev);
435static void rtl8169_tx_timeout(struct net_device *dev); 459static void rtl8169_tx_timeout(struct net_device *dev);
436static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev); 460static struct net_device_stats *rtl8169_get_stats(struct net_device *dev);
437static int rtl8169_rx_interrupt(struct net_device *, struct rtl8169_private *, 461static int rtl8169_rx_interrupt(struct net_device *, struct rtl8169_private *,
438 void __iomem *); 462 void __iomem *);
439static int rtl8169_change_mtu(struct net_device *netdev, int new_mtu); 463static int rtl8169_change_mtu(struct net_device *dev, int new_mtu);
440static void rtl8169_down(struct net_device *dev); 464static void rtl8169_down(struct net_device *dev);
441 465
442#ifdef CONFIG_R8169_NAPI 466#ifdef CONFIG_R8169_NAPI
@@ -543,9 +567,13 @@ static void rtl8169_check_link_status(struct net_device *dev,
543 spin_lock_irqsave(&tp->lock, flags); 567 spin_lock_irqsave(&tp->lock, flags);
544 if (tp->link_ok(ioaddr)) { 568 if (tp->link_ok(ioaddr)) {
545 netif_carrier_on(dev); 569 netif_carrier_on(dev);
546 printk(KERN_INFO PFX "%s: link up\n", dev->name); 570 if (netif_msg_ifup(tp))
547 } else 571 printk(KERN_INFO PFX "%s: link up\n", dev->name);
572 } else {
573 if (netif_msg_ifdown(tp))
574 printk(KERN_INFO PFX "%s: link down\n", dev->name);
548 netif_carrier_off(dev); 575 netif_carrier_off(dev);
576 }
549 spin_unlock_irqrestore(&tp->lock, flags); 577 spin_unlock_irqrestore(&tp->lock, flags);
550} 578}
551 579
@@ -569,7 +597,7 @@ static void rtl8169_link_option(int idx, u8 *autoneg, u16 *speed, u8 *duplex)
569 597
570 option = ((idx < MAX_UNITS) && (idx >= 0)) ? media[idx] : 0xff; 598 option = ((idx < MAX_UNITS) && (idx >= 0)) ? media[idx] : 0xff;
571 599
572 if ((option != 0xff) && !idx) 600 if ((option != 0xff) && !idx && netif_msg_drv(&debug))
573 printk(KERN_WARNING PFX "media option is deprecated.\n"); 601 printk(KERN_WARNING PFX "media option is deprecated.\n");
574 602
575 for (p = link_settings; p->media != 0xff; p++) { 603 for (p = link_settings; p->media != 0xff; p++) {
@@ -611,9 +639,11 @@ static int rtl8169_set_speed_tbi(struct net_device *dev,
611 } else if (autoneg == AUTONEG_ENABLE) 639 } else if (autoneg == AUTONEG_ENABLE)
612 RTL_W32(TBICSR, reg | TBINwEnable | TBINwRestart); 640 RTL_W32(TBICSR, reg | TBINwEnable | TBINwRestart);
613 else { 641 else {
614 printk(KERN_WARNING PFX 642 if (netif_msg_link(tp)) {
615 "%s: incorrect speed setting refused in TBI mode\n", 643 printk(KERN_WARNING "%s: "
616 dev->name); 644 "incorrect speed setting refused in TBI mode\n",
645 dev->name);
646 }
617 ret = -EOPNOTSUPP; 647 ret = -EOPNOTSUPP;
618 } 648 }
619 649
@@ -871,12 +901,120 @@ static void rtl8169_get_regs(struct net_device *dev, struct ethtool_regs *regs,
871 spin_unlock_irqrestore(&tp->lock, flags); 901 spin_unlock_irqrestore(&tp->lock, flags);
872} 902}
873 903
904static u32 rtl8169_get_msglevel(struct net_device *dev)
905{
906 struct rtl8169_private *tp = netdev_priv(dev);
907
908 return tp->msg_enable;
909}
910
911static void rtl8169_set_msglevel(struct net_device *dev, u32 value)
912{
913 struct rtl8169_private *tp = netdev_priv(dev);
914
915 tp->msg_enable = value;
916}
917
918static const char rtl8169_gstrings[][ETH_GSTRING_LEN] = {
919 "tx_packets",
920 "rx_packets",
921 "tx_errors",
922 "rx_errors",
923 "rx_missed",
924 "align_errors",
925 "tx_single_collisions",
926 "tx_multi_collisions",
927 "unicast",
928 "broadcast",
929 "multicast",
930 "tx_aborted",
931 "tx_underrun",
932};
933
934struct rtl8169_counters {
935 u64 tx_packets;
936 u64 rx_packets;
937 u64 tx_errors;
938 u32 rx_errors;
939 u16 rx_missed;
940 u16 align_errors;
941 u32 tx_one_collision;
942 u32 tx_multi_collision;
943 u64 rx_unicast;
944 u64 rx_broadcast;
945 u32 rx_multicast;
946 u16 tx_aborted;
947 u16 tx_underun;
948};
949
950static int rtl8169_get_stats_count(struct net_device *dev)
951{
952 return ARRAY_SIZE(rtl8169_gstrings);
953}
954
955static void rtl8169_get_ethtool_stats(struct net_device *dev,
956 struct ethtool_stats *stats, u64 *data)
957{
958 struct rtl8169_private *tp = netdev_priv(dev);
959 void __iomem *ioaddr = tp->mmio_addr;
960 struct rtl8169_counters *counters;
961 dma_addr_t paddr;
962 u32 cmd;
963
964 ASSERT_RTNL();
965
966 counters = pci_alloc_consistent(tp->pci_dev, sizeof(*counters), &paddr);
967 if (!counters)
968 return;
969
970 RTL_W32(CounterAddrHigh, (u64)paddr >> 32);
971 cmd = (u64)paddr & DMA_32BIT_MASK;
972 RTL_W32(CounterAddrLow, cmd);
973 RTL_W32(CounterAddrLow, cmd | CounterDump);
974
975 while (RTL_R32(CounterAddrLow) & CounterDump) {
976 if (msleep_interruptible(1))
977 break;
978 }
979
980 RTL_W32(CounterAddrLow, 0);
981 RTL_W32(CounterAddrHigh, 0);
982
983 data[0] = le64_to_cpu(counters->tx_packets);
984 data[1] = le64_to_cpu(counters->rx_packets);
985 data[2] = le64_to_cpu(counters->tx_errors);
986 data[3] = le32_to_cpu(counters->rx_errors);
987 data[4] = le16_to_cpu(counters->rx_missed);
988 data[5] = le16_to_cpu(counters->align_errors);
989 data[6] = le32_to_cpu(counters->tx_one_collision);
990 data[7] = le32_to_cpu(counters->tx_multi_collision);
991 data[8] = le64_to_cpu(counters->rx_unicast);
992 data[9] = le64_to_cpu(counters->rx_broadcast);
993 data[10] = le32_to_cpu(counters->rx_multicast);
994 data[11] = le16_to_cpu(counters->tx_aborted);
995 data[12] = le16_to_cpu(counters->tx_underun);
996
997 pci_free_consistent(tp->pci_dev, sizeof(*counters), counters, paddr);
998}
999
1000static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data)
1001{
1002 switch(stringset) {
1003 case ETH_SS_STATS:
1004 memcpy(data, *rtl8169_gstrings, sizeof(rtl8169_gstrings));
1005 break;
1006 }
1007}
1008
1009
874static struct ethtool_ops rtl8169_ethtool_ops = { 1010static struct ethtool_ops rtl8169_ethtool_ops = {
875 .get_drvinfo = rtl8169_get_drvinfo, 1011 .get_drvinfo = rtl8169_get_drvinfo,
876 .get_regs_len = rtl8169_get_regs_len, 1012 .get_regs_len = rtl8169_get_regs_len,
877 .get_link = ethtool_op_get_link, 1013 .get_link = ethtool_op_get_link,
878 .get_settings = rtl8169_get_settings, 1014 .get_settings = rtl8169_get_settings,
879 .set_settings = rtl8169_set_settings, 1015 .set_settings = rtl8169_set_settings,
1016 .get_msglevel = rtl8169_get_msglevel,
1017 .set_msglevel = rtl8169_set_msglevel,
880 .get_rx_csum = rtl8169_get_rx_csum, 1018 .get_rx_csum = rtl8169_get_rx_csum,
881 .set_rx_csum = rtl8169_set_rx_csum, 1019 .set_rx_csum = rtl8169_set_rx_csum,
882 .get_tx_csum = ethtool_op_get_tx_csum, 1020 .get_tx_csum = ethtool_op_get_tx_csum,
@@ -886,6 +1024,9 @@ static struct ethtool_ops rtl8169_ethtool_ops = {
886 .get_tso = ethtool_op_get_tso, 1024 .get_tso = ethtool_op_get_tso,
887 .set_tso = ethtool_op_set_tso, 1025 .set_tso = ethtool_op_set_tso,
888 .get_regs = rtl8169_get_regs, 1026 .get_regs = rtl8169_get_regs,
1027 .get_strings = rtl8169_get_strings,
1028 .get_stats_count = rtl8169_get_stats_count,
1029 .get_ethtool_stats = rtl8169_get_ethtool_stats,
889}; 1030};
890 1031
891static void rtl8169_write_gmii_reg_bit(void __iomem *ioaddr, int reg, int bitnum, 1032static void rtl8169_write_gmii_reg_bit(void __iomem *ioaddr, int reg, int bitnum,
@@ -1091,7 +1232,8 @@ static void rtl8169_phy_timer(unsigned long __opaque)
1091 if (tp->link_ok(ioaddr)) 1232 if (tp->link_ok(ioaddr))
1092 goto out_unlock; 1233 goto out_unlock;
1093 1234
1094 printk(KERN_WARNING PFX "%s: PHY reset until link up\n", dev->name); 1235 if (netif_msg_link(tp))
1236 printk(KERN_WARNING "%s: PHY reset until link up\n", dev->name);
1095 1237
1096 tp->phy_reset_enable(ioaddr); 1238 tp->phy_reset_enable(ioaddr);
1097 1239
@@ -1169,18 +1311,23 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1169 /* dev zeroed in alloc_etherdev */ 1311 /* dev zeroed in alloc_etherdev */
1170 dev = alloc_etherdev(sizeof (*tp)); 1312 dev = alloc_etherdev(sizeof (*tp));
1171 if (dev == NULL) { 1313 if (dev == NULL) {
1172 printk(KERN_ERR PFX "unable to alloc new ethernet\n"); 1314 if (netif_msg_drv(&debug))
1315 printk(KERN_ERR PFX "unable to alloc new ethernet\n");
1173 goto err_out; 1316 goto err_out;
1174 } 1317 }
1175 1318
1176 SET_MODULE_OWNER(dev); 1319 SET_MODULE_OWNER(dev);
1177 SET_NETDEV_DEV(dev, &pdev->dev); 1320 SET_NETDEV_DEV(dev, &pdev->dev);
1178 tp = netdev_priv(dev); 1321 tp = netdev_priv(dev);
1322 tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT);
1179 1323
1180 /* enable device (incl. PCI PM wakeup and hotplug setup) */ 1324 /* enable device (incl. PCI PM wakeup and hotplug setup) */
1181 rc = pci_enable_device(pdev); 1325 rc = pci_enable_device(pdev);
1182 if (rc) { 1326 if (rc < 0) {
1183 printk(KERN_ERR PFX "%s: enable failure\n", pci_name(pdev)); 1327 if (netif_msg_probe(tp)) {
1328 printk(KERN_ERR PFX "%s: enable failure\n",
1329 pci_name(pdev));
1330 }
1184 goto err_out_free_dev; 1331 goto err_out_free_dev;
1185 } 1332 }
1186 1333
@@ -1196,29 +1343,39 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1196 pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command); 1343 pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command);
1197 acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK; 1344 acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;
1198 } else { 1345 } else {
1199 printk(KERN_ERR PFX 1346 if (netif_msg_probe(tp)) {
1200 "Cannot find PowerManagement capability, aborting.\n"); 1347 printk(KERN_ERR PFX
1348 "Cannot find PowerManagement capability. "
1349 "Aborting.\n");
1350 }
1201 goto err_out_mwi; 1351 goto err_out_mwi;
1202 } 1352 }
1203 1353
1204 /* make sure PCI base addr 1 is MMIO */ 1354 /* make sure PCI base addr 1 is MMIO */
1205 if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) { 1355 if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
1206 printk(KERN_ERR PFX 1356 if (netif_msg_probe(tp)) {
1207 "region #1 not an MMIO resource, aborting\n"); 1357 printk(KERN_ERR PFX
1358 "region #1 not an MMIO resource, aborting\n");
1359 }
1208 rc = -ENODEV; 1360 rc = -ENODEV;
1209 goto err_out_mwi; 1361 goto err_out_mwi;
1210 } 1362 }
1211 /* check for weird/broken PCI region reporting */ 1363 /* check for weird/broken PCI region reporting */
1212 if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) { 1364 if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) {
1213 printk(KERN_ERR PFX "Invalid PCI region size(s), aborting\n"); 1365 if (netif_msg_probe(tp)) {
1366 printk(KERN_ERR PFX
1367 "Invalid PCI region size(s), aborting\n");
1368 }
1214 rc = -ENODEV; 1369 rc = -ENODEV;
1215 goto err_out_mwi; 1370 goto err_out_mwi;
1216 } 1371 }
1217 1372
1218 rc = pci_request_regions(pdev, MODULENAME); 1373 rc = pci_request_regions(pdev, MODULENAME);
1219 if (rc) { 1374 if (rc < 0) {
1220 printk(KERN_ERR PFX "%s: could not request regions.\n", 1375 if (netif_msg_probe(tp)) {
1221 pci_name(pdev)); 1376 printk(KERN_ERR PFX "%s: could not request regions.\n",
1377 pci_name(pdev));
1378 }
1222 goto err_out_mwi; 1379 goto err_out_mwi;
1223 } 1380 }
1224 1381
@@ -1231,7 +1388,10 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1231 } else { 1388 } else {
1232 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 1389 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
1233 if (rc < 0) { 1390 if (rc < 0) {
1234 printk(KERN_ERR PFX "DMA configuration failed.\n"); 1391 if (netif_msg_probe(tp)) {
1392 printk(KERN_ERR PFX
1393 "DMA configuration failed.\n");
1394 }
1235 goto err_out_free_res; 1395 goto err_out_free_res;
1236 } 1396 }
1237 } 1397 }
@@ -1241,7 +1401,8 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1241 /* ioremap MMIO region */ 1401 /* ioremap MMIO region */
1242 ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE); 1402 ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE);
1243 if (ioaddr == NULL) { 1403 if (ioaddr == NULL) {
1244 printk(KERN_ERR PFX "cannot remap MMIO, aborting\n"); 1404 if (netif_msg_probe(tp))
1405 printk(KERN_ERR PFX "cannot remap MMIO, aborting\n");
1245 rc = -EIO; 1406 rc = -EIO;
1246 goto err_out_free_res; 1407 goto err_out_free_res;
1247 } 1408 }
@@ -1272,9 +1433,11 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1272 } 1433 }
1273 if (i < 0) { 1434 if (i < 0) {
1274 /* Unknown chip: assume array element #0, original RTL-8169 */ 1435 /* Unknown chip: assume array element #0, original RTL-8169 */
1275 printk(KERN_DEBUG PFX 1436 if (netif_msg_probe(tp)) {
1276 "PCI device %s: unknown chip version, assuming %s\n", 1437 printk(KERN_DEBUG PFX "PCI device %s: "
1277 pci_name(pdev), rtl_chip_info[0].name); 1438 "unknown chip version, assuming %s\n",
1439 pci_name(pdev), rtl_chip_info[0].name);
1440 }
1278 i++; 1441 i++;
1279 } 1442 }
1280 tp->chipset = i; 1443 tp->chipset = i;
@@ -1308,7 +1471,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1308 struct rtl8169_private *tp; 1471 struct rtl8169_private *tp;
1309 void __iomem *ioaddr = NULL; 1472 void __iomem *ioaddr = NULL;
1310 static int board_idx = -1; 1473 static int board_idx = -1;
1311 static int printed_version = 0;
1312 u8 autoneg, duplex; 1474 u8 autoneg, duplex;
1313 u16 speed; 1475 u16 speed;
1314 int i, rc; 1476 int i, rc;
@@ -1318,10 +1480,9 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1318 1480
1319 board_idx++; 1481 board_idx++;
1320 1482
1321 if (!printed_version) { 1483 if (netif_msg_drv(&debug)) {
1322 printk(KERN_INFO "%s Gigabit Ethernet driver %s loaded\n", 1484 printk(KERN_INFO "%s Gigabit Ethernet driver %s loaded\n",
1323 MODULENAME, RTL8169_VERSION); 1485 MODULENAME, RTL8169_VERSION);
1324 printed_version = 1;
1325 } 1486 }
1326 1487
1327 rc = rtl8169_init_board(pdev, &dev, &ioaddr); 1488 rc = rtl8169_init_board(pdev, &dev, &ioaddr);
@@ -1366,7 +1527,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1366#ifdef CONFIG_R8169_NAPI 1527#ifdef CONFIG_R8169_NAPI
1367 dev->poll = rtl8169_poll; 1528 dev->poll = rtl8169_poll;
1368 dev->weight = R8169_NAPI_WEIGHT; 1529 dev->weight = R8169_NAPI_WEIGHT;
1369 printk(KERN_INFO PFX "NAPI enabled\n");
1370#endif 1530#endif
1371 1531
1372#ifdef CONFIG_R8169_VLAN 1532#ifdef CONFIG_R8169_VLAN
@@ -1391,20 +1551,24 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1391 return rc; 1551 return rc;
1392 } 1552 }
1393 1553
1394 printk(KERN_DEBUG "%s: Identified chip type is '%s'.\n", dev->name, 1554 if (netif_msg_probe(tp)) {
1395 rtl_chip_info[tp->chipset].name); 1555 printk(KERN_DEBUG "%s: Identified chip type is '%s'.\n",
1556 dev->name, rtl_chip_info[tp->chipset].name);
1557 }
1396 1558
1397 pci_set_drvdata(pdev, dev); 1559 pci_set_drvdata(pdev, dev);
1398 1560
1399 printk(KERN_INFO "%s: %s at 0x%lx, " 1561 if (netif_msg_probe(tp)) {
1400 "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, " 1562 printk(KERN_INFO "%s: %s at 0x%lx, "
1401 "IRQ %d\n", 1563 "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, "
1402 dev->name, 1564 "IRQ %d\n",
1403 rtl_chip_info[ent->driver_data].name, 1565 dev->name,
1404 dev->base_addr, 1566 rtl_chip_info[ent->driver_data].name,
1405 dev->dev_addr[0], dev->dev_addr[1], 1567 dev->base_addr,
1406 dev->dev_addr[2], dev->dev_addr[3], 1568 dev->dev_addr[0], dev->dev_addr[1],
1407 dev->dev_addr[4], dev->dev_addr[5], dev->irq); 1569 dev->dev_addr[2], dev->dev_addr[3],
1570 dev->dev_addr[4], dev->dev_addr[5], dev->irq);
1571 }
1408 1572
1409 rtl8169_hw_phy_config(dev); 1573 rtl8169_hw_phy_config(dev);
1410 1574
@@ -1427,7 +1591,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1427 1591
1428 rtl8169_set_speed(dev, autoneg, speed, duplex); 1592 rtl8169_set_speed(dev, autoneg, speed, duplex);
1429 1593
1430 if (RTL_R8(PHYstatus) & TBI_Enable) 1594 if ((RTL_R8(PHYstatus) & TBI_Enable) && netif_msg_link(tp))
1431 printk(KERN_INFO PFX "%s: TBI auto-negotiating\n", dev->name); 1595 printk(KERN_INFO PFX "%s: TBI auto-negotiating\n", dev->name);
1432 1596
1433 return 0; 1597 return 0;
@@ -1585,8 +1749,8 @@ rtl8169_hw_start(struct net_device *dev)
1585 RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); 1749 RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
1586 RTL_W8(EarlyTxThres, EarlyTxThld); 1750 RTL_W8(EarlyTxThres, EarlyTxThld);
1587 1751
1588 /* For gigabit rtl8169, MTU + header + CRC + VLAN */ 1752 /* Low hurts. Let's disable the filtering. */
1589 RTL_W16(RxMaxSize, tp->rx_buf_sz); 1753 RTL_W16(RxMaxSize, 16383);
1590 1754
1591 /* Set Rx Config register */ 1755 /* Set Rx Config register */
1592 i = rtl8169_rx_config | 1756 i = rtl8169_rx_config |
@@ -1860,8 +2024,13 @@ static void rtl8169_reinit_task(void *_data)
1860 ret = rtl8169_open(dev); 2024 ret = rtl8169_open(dev);
1861 if (unlikely(ret < 0)) { 2025 if (unlikely(ret < 0)) {
1862 if (net_ratelimit()) { 2026 if (net_ratelimit()) {
1863 printk(PFX KERN_ERR "%s: reinit failure (status = %d)." 2027 struct rtl8169_private *tp = netdev_priv(dev);
1864 " Rescheduling.\n", dev->name, ret); 2028
2029 if (netif_msg_drv(tp)) {
2030 printk(PFX KERN_ERR
2031 "%s: reinit failure (status = %d)."
2032 " Rescheduling.\n", dev->name, ret);
2033 }
1865 } 2034 }
1866 rtl8169_schedule_work(dev, rtl8169_reinit_task); 2035 rtl8169_schedule_work(dev, rtl8169_reinit_task);
1867 } 2036 }
@@ -1886,8 +2055,12 @@ static void rtl8169_reset_task(void *_data)
1886 netif_wake_queue(dev); 2055 netif_wake_queue(dev);
1887 } else { 2056 } else {
1888 if (net_ratelimit()) { 2057 if (net_ratelimit()) {
1889 printk(PFX KERN_EMERG "%s: Rx buffers shortage\n", 2058 struct rtl8169_private *tp = netdev_priv(dev);
1890 dev->name); 2059
2060 if (netif_msg_intr(tp)) {
2061 printk(PFX KERN_EMERG
2062 "%s: Rx buffers shortage\n", dev->name);
2063 }
1891 } 2064 }
1892 rtl8169_schedule_work(dev, rtl8169_reset_task); 2065 rtl8169_schedule_work(dev, rtl8169_reset_task);
1893 } 2066 }
@@ -1973,8 +2146,11 @@ static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev)
1973 int ret = 0; 2146 int ret = 0;
1974 2147
1975 if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) { 2148 if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) {
1976 printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", 2149 if (netif_msg_drv(tp)) {
1977 dev->name); 2150 printk(KERN_ERR
2151 "%s: BUG! Tx Ring full when queue awake!\n",
2152 dev->name);
2153 }
1978 goto err_stop; 2154 goto err_stop;
1979 } 2155 }
1980 2156
@@ -2049,8 +2225,11 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev)
2049 pci_read_config_word(pdev, PCI_COMMAND, &pci_cmd); 2225 pci_read_config_word(pdev, PCI_COMMAND, &pci_cmd);
2050 pci_read_config_word(pdev, PCI_STATUS, &pci_status); 2226 pci_read_config_word(pdev, PCI_STATUS, &pci_status);
2051 2227
2052 printk(KERN_ERR PFX "%s: PCI error (cmd = 0x%04x, status = 0x%04x).\n", 2228 if (netif_msg_intr(tp)) {
2053 dev->name, pci_cmd, pci_status); 2229 printk(KERN_ERR
2230 "%s: PCI error (cmd = 0x%04x, status = 0x%04x).\n",
2231 dev->name, pci_cmd, pci_status);
2232 }
2054 2233
2055 /* 2234 /*
2056 * The recovery sequence below admits a very elaborated explanation: 2235 * The recovery sequence below admits a very elaborated explanation:
@@ -2069,7 +2248,8 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev)
2069 2248
2070 /* The infamous DAC f*ckup only happens at boot time */ 2249 /* The infamous DAC f*ckup only happens at boot time */
2071 if ((tp->cp_cmd & PCIDAC) && !tp->dirty_rx && !tp->cur_rx) { 2250 if ((tp->cp_cmd & PCIDAC) && !tp->dirty_rx && !tp->cur_rx) {
2072 printk(KERN_INFO PFX "%s: disabling PCI DAC.\n", dev->name); 2251 if (netif_msg_intr(tp))
2252 printk(KERN_INFO "%s: disabling PCI DAC.\n", dev->name);
2073 tp->cp_cmd &= ~PCIDAC; 2253 tp->cp_cmd &= ~PCIDAC;
2074 RTL_W16(CPlusCmd, tp->cp_cmd); 2254 RTL_W16(CPlusCmd, tp->cp_cmd);
2075 dev->features &= ~NETIF_F_HIGHDMA; 2255 dev->features &= ~NETIF_F_HIGHDMA;
@@ -2127,6 +2307,11 @@ rtl8169_tx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
2127 } 2307 }
2128} 2308}
2129 2309
2310static inline int rtl8169_fragmented_frame(u32 status)
2311{
2312 return (status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag);
2313}
2314
2130static inline void rtl8169_rx_csum(struct sk_buff *skb, struct RxDesc *desc) 2315static inline void rtl8169_rx_csum(struct sk_buff *skb, struct RxDesc *desc)
2131{ 2316{
2132 u32 opts1 = le32_to_cpu(desc->opts1); 2317 u32 opts1 = le32_to_cpu(desc->opts1);
@@ -2175,29 +2360,46 @@ rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
2175 rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx; 2360 rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx;
2176 rx_left = rtl8169_rx_quota(rx_left, (u32) dev->quota); 2361 rx_left = rtl8169_rx_quota(rx_left, (u32) dev->quota);
2177 2362
2178 while (rx_left > 0) { 2363 for (; rx_left > 0; rx_left--, cur_rx++) {
2179 unsigned int entry = cur_rx % NUM_RX_DESC; 2364 unsigned int entry = cur_rx % NUM_RX_DESC;
2365 struct RxDesc *desc = tp->RxDescArray + entry;
2180 u32 status; 2366 u32 status;
2181 2367
2182 rmb(); 2368 rmb();
2183 status = le32_to_cpu(tp->RxDescArray[entry].opts1); 2369 status = le32_to_cpu(desc->opts1);
2184 2370
2185 if (status & DescOwn) 2371 if (status & DescOwn)
2186 break; 2372 break;
2187 if (status & RxRES) { 2373 if (unlikely(status & RxRES)) {
2188 printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name); 2374 if (netif_msg_rx_err(tp)) {
2375 printk(KERN_INFO
2376 "%s: Rx ERROR. status = %08x\n",
2377 dev->name, status);
2378 }
2189 tp->stats.rx_errors++; 2379 tp->stats.rx_errors++;
2190 if (status & (RxRWT | RxRUNT)) 2380 if (status & (RxRWT | RxRUNT))
2191 tp->stats.rx_length_errors++; 2381 tp->stats.rx_length_errors++;
2192 if (status & RxCRC) 2382 if (status & RxCRC)
2193 tp->stats.rx_crc_errors++; 2383 tp->stats.rx_crc_errors++;
2384 rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
2194 } else { 2385 } else {
2195 struct RxDesc *desc = tp->RxDescArray + entry;
2196 struct sk_buff *skb = tp->Rx_skbuff[entry]; 2386 struct sk_buff *skb = tp->Rx_skbuff[entry];
2197 int pkt_size = (status & 0x00001FFF) - 4; 2387 int pkt_size = (status & 0x00001FFF) - 4;
2198 void (*pci_action)(struct pci_dev *, dma_addr_t, 2388 void (*pci_action)(struct pci_dev *, dma_addr_t,
2199 size_t, int) = pci_dma_sync_single_for_device; 2389 size_t, int) = pci_dma_sync_single_for_device;
2200 2390
2391 /*
2392 * The driver does not support incoming fragmented
2393 * frames. They are seen as a symptom of over-mtu
2394 * sized frames.
2395 */
2396 if (unlikely(rtl8169_fragmented_frame(status))) {
2397 tp->stats.rx_dropped++;
2398 tp->stats.rx_length_errors++;
2399 rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
2400 continue;
2401 }
2402
2201 rtl8169_rx_csum(skb, desc); 2403 rtl8169_rx_csum(skb, desc);
2202 2404
2203 pci_dma_sync_single_for_cpu(tp->pci_dev, 2405 pci_dma_sync_single_for_cpu(tp->pci_dev,
@@ -2224,16 +2426,13 @@ rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
2224 tp->stats.rx_bytes += pkt_size; 2426 tp->stats.rx_bytes += pkt_size;
2225 tp->stats.rx_packets++; 2427 tp->stats.rx_packets++;
2226 } 2428 }
2227
2228 cur_rx++;
2229 rx_left--;
2230 } 2429 }
2231 2430
2232 count = cur_rx - tp->cur_rx; 2431 count = cur_rx - tp->cur_rx;
2233 tp->cur_rx = cur_rx; 2432 tp->cur_rx = cur_rx;
2234 2433
2235 delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx); 2434 delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx);
2236 if (!delta && count) 2435 if (!delta && count && netif_msg_intr(tp))
2237 printk(KERN_INFO "%s: no Rx buffer allocated\n", dev->name); 2436 printk(KERN_INFO "%s: no Rx buffer allocated\n", dev->name);
2238 tp->dirty_rx += delta; 2437 tp->dirty_rx += delta;
2239 2438
@@ -2244,7 +2443,7 @@ rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
2244 * after refill ? 2443 * after refill ?
2245 * - how do others driver handle this condition (Uh oh...). 2444 * - how do others driver handle this condition (Uh oh...).
2246 */ 2445 */
2247 if (tp->dirty_rx + NUM_RX_DESC == tp->cur_rx) 2446 if ((tp->dirty_rx + NUM_RX_DESC == tp->cur_rx) && netif_msg_intr(tp))
2248 printk(KERN_EMERG "%s: Rx buffers exhausted\n", dev->name); 2447 printk(KERN_EMERG "%s: Rx buffers exhausted\n", dev->name);
2249 2448
2250 return count; 2449 return count;
@@ -2296,7 +2495,7 @@ rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
2296 2495
2297 if (likely(netif_rx_schedule_prep(dev))) 2496 if (likely(netif_rx_schedule_prep(dev)))
2298 __netif_rx_schedule(dev); 2497 __netif_rx_schedule(dev);
2299 else { 2498 else if (netif_msg_intr(tp)) {
2300 printk(KERN_INFO "%s: interrupt %04x taken in poll\n", 2499 printk(KERN_INFO "%s: interrupt %04x taken in poll\n",
2301 dev->name, status); 2500 dev->name, status);
2302 } 2501 }
@@ -2315,8 +2514,10 @@ rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
2315 } while (boguscnt > 0); 2514 } while (boguscnt > 0);
2316 2515
2317 if (boguscnt <= 0) { 2516 if (boguscnt <= 0) {
2318 printk(KERN_WARNING "%s: Too much work at interrupt!\n", 2517 if (net_ratelimit() && netif_msg_intr(tp)) {
2319 dev->name); 2518 printk(KERN_WARNING
2519 "%s: Too much work at interrupt!\n", dev->name);
2520 }
2320 /* Clear all interrupt sources. */ 2521 /* Clear all interrupt sources. */
2321 RTL_W16(IntrStatus, 0xffff); 2522 RTL_W16(IntrStatus, 0xffff);
2322 } 2523 }
@@ -2439,8 +2640,10 @@ rtl8169_set_rx_mode(struct net_device *dev)
2439 2640
2440 if (dev->flags & IFF_PROMISC) { 2641 if (dev->flags & IFF_PROMISC) {
2441 /* Unconditionally log net taps. */ 2642 /* Unconditionally log net taps. */
2442 printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n", 2643 if (netif_msg_link(tp)) {
2443 dev->name); 2644 printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n",
2645 dev->name);
2646 }
2444 rx_mode = 2647 rx_mode =
2445 AcceptBroadcast | AcceptMulticast | AcceptMyPhys | 2648 AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
2446 AcceptAllPhys; 2649 AcceptAllPhys;
diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c
index e68cf5fb4920..20edeb345792 100644
--- a/drivers/net/shaper.c
+++ b/drivers/net/shaper.c
@@ -100,35 +100,8 @@ static int sh_debug; /* Debug flag */
100 100
101#define SHAPER_BANNER "CymruNet Traffic Shaper BETA 0.04 for Linux 2.1\n" 101#define SHAPER_BANNER "CymruNet Traffic Shaper BETA 0.04 for Linux 2.1\n"
102 102
103/*
104 * Locking
105 */
106
107static int shaper_lock(struct shaper *sh)
108{
109 /*
110 * Lock in an interrupt must fail
111 */
112 while (test_and_set_bit(0, &sh->locked))
113 {
114 if (!in_interrupt())
115 sleep_on(&sh->wait_queue);
116 else
117 return 0;
118
119 }
120 return 1;
121}
122
123static void shaper_kick(struct shaper *sh); 103static void shaper_kick(struct shaper *sh);
124 104
125static void shaper_unlock(struct shaper *sh)
126{
127 clear_bit(0, &sh->locked);
128 wake_up(&sh->wait_queue);
129 shaper_kick(sh);
130}
131
132/* 105/*
133 * Compute clocks on a buffer 106 * Compute clocks on a buffer
134 */ 107 */
@@ -157,17 +130,15 @@ static void shaper_setspeed(struct shaper *shaper, int bitspersec)
157 * Throw a frame at a shaper. 130 * Throw a frame at a shaper.
158 */ 131 */
159 132
160static int shaper_qframe(struct shaper *shaper, struct sk_buff *skb) 133
134static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev)
161{ 135{
136 struct shaper *shaper = dev->priv;
162 struct sk_buff *ptr; 137 struct sk_buff *ptr;
163 138
164 /* 139 if (down_trylock(&shaper->sem))
165 * Get ready to work on this shaper. Lock may fail if its 140 return -1;
166 * an interrupt and locked. 141
167 */
168
169 if(!shaper_lock(shaper))
170 return -1;
171 ptr=shaper->sendq.prev; 142 ptr=shaper->sendq.prev;
172 143
173 /* 144 /*
@@ -260,7 +231,8 @@ static int shaper_qframe(struct shaper *shaper, struct sk_buff *skb)
260 dev_kfree_skb(ptr); 231 dev_kfree_skb(ptr);
261 shaper->stats.collisions++; 232 shaper->stats.collisions++;
262 } 233 }
263 shaper_unlock(shaper); 234 shaper_kick(shaper);
235 up(&shaper->sem);
264 return 0; 236 return 0;
265} 237}
266 238
@@ -297,8 +269,13 @@ static void shaper_queue_xmit(struct shaper *shaper, struct sk_buff *skb)
297 269
298static void shaper_timer(unsigned long data) 270static void shaper_timer(unsigned long data)
299{ 271{
300 struct shaper *sh=(struct shaper *)data; 272 struct shaper *shaper = (struct shaper *)data;
301 shaper_kick(sh); 273
274 if (!down_trylock(&shaper->sem)) {
275 shaper_kick(shaper);
276 up(&shaper->sem);
277 } else
278 mod_timer(&shaper->timer, jiffies);
302} 279}
303 280
304/* 281/*
@@ -311,19 +288,6 @@ static void shaper_kick(struct shaper *shaper)
311 struct sk_buff *skb; 288 struct sk_buff *skb;
312 289
313 /* 290 /*
314 * Shaper unlock will kick
315 */
316
317 if (test_and_set_bit(0, &shaper->locked))
318 {
319 if(sh_debug)
320 printk("Shaper locked.\n");
321 mod_timer(&shaper->timer, jiffies);
322 return;
323 }
324
325
326 /*
327 * Walk the list (may be empty) 291 * Walk the list (may be empty)
328 */ 292 */
329 293
@@ -364,8 +328,6 @@ static void shaper_kick(struct shaper *shaper)
364 328
365 if(skb!=NULL) 329 if(skb!=NULL)
366 mod_timer(&shaper->timer, SHAPERCB(skb)->shapeclock); 330 mod_timer(&shaper->timer, SHAPERCB(skb)->shapeclock);
367
368 clear_bit(0, &shaper->locked);
369} 331}
370 332
371 333
@@ -376,14 +338,12 @@ static void shaper_kick(struct shaper *shaper)
376static void shaper_flush(struct shaper *shaper) 338static void shaper_flush(struct shaper *shaper)
377{ 339{
378 struct sk_buff *skb; 340 struct sk_buff *skb;
379 if(!shaper_lock(shaper)) 341
380 { 342 down(&shaper->sem);
381 printk(KERN_ERR "shaper: shaper_flush() called by an irq!\n");
382 return;
383 }
384 while((skb=skb_dequeue(&shaper->sendq))!=NULL) 343 while((skb=skb_dequeue(&shaper->sendq))!=NULL)
385 dev_kfree_skb(skb); 344 dev_kfree_skb(skb);
386 shaper_unlock(shaper); 345 shaper_kick(shaper);
346 up(&shaper->sem);
387} 347}
388 348
389/* 349/*
@@ -426,13 +386,6 @@ static int shaper_close(struct net_device *dev)
426 * ARP and other resolutions and not before. 386 * ARP and other resolutions and not before.
427 */ 387 */
428 388
429
430static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev)
431{
432 struct shaper *sh=dev->priv;
433 return shaper_qframe(sh, skb);
434}
435
436static struct net_device_stats *shaper_get_stats(struct net_device *dev) 389static struct net_device_stats *shaper_get_stats(struct net_device *dev)
437{ 390{
438 struct shaper *sh=dev->priv; 391 struct shaper *sh=dev->priv;
@@ -623,7 +576,6 @@ static void shaper_init_priv(struct net_device *dev)
623 init_timer(&sh->timer); 576 init_timer(&sh->timer);
624 sh->timer.function=shaper_timer; 577 sh->timer.function=shaper_timer;
625 sh->timer.data=(unsigned long)sh; 578 sh->timer.data=(unsigned long)sh;
626 init_waitqueue_head(&sh->wait_queue);
627} 579}
628 580
629/* 581/*
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
index 3e9d9aab0588..3107aed0fb51 100644
--- a/drivers/net/sis900.c
+++ b/drivers/net/sis900.c
@@ -162,6 +162,7 @@ struct sis900_private {
162 struct mii_phy * mii; 162 struct mii_phy * mii;
163 struct mii_phy * first_mii; /* record the first mii structure */ 163 struct mii_phy * first_mii; /* record the first mii structure */
164 unsigned int cur_phy; 164 unsigned int cur_phy;
165 struct mii_if_info mii_info;
165 166
166 struct timer_list timer; /* Link status detection timer. */ 167 struct timer_list timer; /* Link status detection timer. */
167 u8 autong_complete; /* 1: auto-negotiate complete */ 168 u8 autong_complete; /* 1: auto-negotiate complete */
@@ -203,7 +204,7 @@ static int sis900_open(struct net_device *net_dev);
203static int sis900_mii_probe (struct net_device * net_dev); 204static int sis900_mii_probe (struct net_device * net_dev);
204static void sis900_init_rxfilter (struct net_device * net_dev); 205static void sis900_init_rxfilter (struct net_device * net_dev);
205static u16 read_eeprom(long ioaddr, int location); 206static u16 read_eeprom(long ioaddr, int location);
206static u16 mdio_read(struct net_device *net_dev, int phy_id, int location); 207static int mdio_read(struct net_device *net_dev, int phy_id, int location);
207static void mdio_write(struct net_device *net_dev, int phy_id, int location, int val); 208static void mdio_write(struct net_device *net_dev, int phy_id, int location, int val);
208static void sis900_timer(unsigned long data); 209static void sis900_timer(unsigned long data);
209static void sis900_check_mode (struct net_device *net_dev, struct mii_phy *mii_phy); 210static void sis900_check_mode (struct net_device *net_dev, struct mii_phy *mii_phy);
@@ -478,7 +479,13 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
478 sis_priv->msg_enable = sis900_debug; 479 sis_priv->msg_enable = sis900_debug;
479 else 480 else
480 sis_priv->msg_enable = SIS900_DEF_MSG; 481 sis_priv->msg_enable = SIS900_DEF_MSG;
481 482
483 sis_priv->mii_info.dev = net_dev;
484 sis_priv->mii_info.mdio_read = mdio_read;
485 sis_priv->mii_info.mdio_write = mdio_write;
486 sis_priv->mii_info.phy_id_mask = 0x1f;
487 sis_priv->mii_info.reg_num_mask = 0x1f;
488
482 /* Get Mac address according to the chip revision */ 489 /* Get Mac address according to the chip revision */
483 pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &(sis_priv->chipset_rev)); 490 pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &(sis_priv->chipset_rev));
484 if(netif_msg_probe(sis_priv)) 491 if(netif_msg_probe(sis_priv))
@@ -725,6 +732,8 @@ static u16 sis900_default_phy(struct net_device * net_dev)
725 pci_name(sis_priv->pci_dev), sis_priv->cur_phy); 732 pci_name(sis_priv->pci_dev), sis_priv->cur_phy);
726 } 733 }
727 734
735 sis_priv->mii_info.phy_id = sis_priv->cur_phy;
736
728 status = mdio_read(net_dev, sis_priv->cur_phy, MII_CONTROL); 737 status = mdio_read(net_dev, sis_priv->cur_phy, MII_CONTROL);
729 status &= (~MII_CNTL_ISOLATE); 738 status &= (~MII_CNTL_ISOLATE);
730 739
@@ -852,7 +861,7 @@ static void mdio_reset(long mdio_addr)
852 * Please see SiS7014 or ICS spec 861 * Please see SiS7014 or ICS spec
853 */ 862 */
854 863
855static u16 mdio_read(struct net_device *net_dev, int phy_id, int location) 864static int mdio_read(struct net_device *net_dev, int phy_id, int location)
856{ 865{
857 long mdio_addr = net_dev->base_addr + mear; 866 long mdio_addr = net_dev->base_addr + mear;
858 int mii_cmd = MIIread|(phy_id<<MIIpmdShift)|(location<<MIIregShift); 867 int mii_cmd = MIIread|(phy_id<<MIIpmdShift)|(location<<MIIregShift);
@@ -1966,10 +1975,47 @@ static void sis900_set_msglevel(struct net_device *net_dev, u32 value)
1966 sis_priv->msg_enable = value; 1975 sis_priv->msg_enable = value;
1967} 1976}
1968 1977
1978static u32 sis900_get_link(struct net_device *net_dev)
1979{
1980 struct sis900_private *sis_priv = net_dev->priv;
1981 return mii_link_ok(&sis_priv->mii_info);
1982}
1983
1984static int sis900_get_settings(struct net_device *net_dev,
1985 struct ethtool_cmd *cmd)
1986{
1987 struct sis900_private *sis_priv = net_dev->priv;
1988 spin_lock_irq(&sis_priv->lock);
1989 mii_ethtool_gset(&sis_priv->mii_info, cmd);
1990 spin_unlock_irq(&sis_priv->lock);
1991 return 0;
1992}
1993
1994static int sis900_set_settings(struct net_device *net_dev,
1995 struct ethtool_cmd *cmd)
1996{
1997 struct sis900_private *sis_priv = net_dev->priv;
1998 int rt;
1999 spin_lock_irq(&sis_priv->lock);
2000 rt = mii_ethtool_sset(&sis_priv->mii_info, cmd);
2001 spin_unlock_irq(&sis_priv->lock);
2002 return rt;
2003}
2004
2005static int sis900_nway_reset(struct net_device *net_dev)
2006{
2007 struct sis900_private *sis_priv = net_dev->priv;
2008 return mii_nway_restart(&sis_priv->mii_info);
2009}
2010
1969static struct ethtool_ops sis900_ethtool_ops = { 2011static struct ethtool_ops sis900_ethtool_ops = {
1970 .get_drvinfo = sis900_get_drvinfo, 2012 .get_drvinfo = sis900_get_drvinfo,
1971 .get_msglevel = sis900_get_msglevel, 2013 .get_msglevel = sis900_get_msglevel,
1972 .set_msglevel = sis900_set_msglevel, 2014 .set_msglevel = sis900_set_msglevel,
2015 .get_link = sis900_get_link,
2016 .get_settings = sis900_get_settings,
2017 .set_settings = sis900_set_settings,
2018 .nway_reset = sis900_nway_reset,
1973}; 2019};
1974 2020
1975/** 2021/**
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index 05b827f79f54..1ccb2989001c 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -4212,7 +4212,7 @@ SK_BOOL DualNet;
4212 Flags); 4212 Flags);
4213 4213
4214 SkGeStopPort(pAC, IoC, FromPort, SK_STOP_ALL, SK_HARD_RST); 4214 SkGeStopPort(pAC, IoC, FromPort, SK_STOP_ALL, SK_HARD_RST);
4215 pAC->dev[Param.Para32[0]]->flags &= ~IFF_RUNNING; 4215 netif_carrier_off(pAC->dev[Param.Para32[0]]);
4216 spin_unlock_irqrestore( 4216 spin_unlock_irqrestore(
4217 &pAC->TxPort[FromPort][TX_PRIO_LOW].TxDesRingLock, 4217 &pAC->TxPort[FromPort][TX_PRIO_LOW].TxDesRingLock,
4218 Flags); 4218 Flags);
@@ -4355,7 +4355,7 @@ SK_BOOL DualNet;
4355 } 4355 }
4356 4356
4357 /* Inform the world that link protocol is up. */ 4357 /* Inform the world that link protocol is up. */
4358 pAC->dev[Param.Para32[0]]->flags |= IFF_RUNNING; 4358 netif_carrier_on(pAC->dev[Param.Para32[0]]);
4359 4359
4360 break; 4360 break;
4361 case SK_DRV_NET_DOWN: /* SK_U32 Reason */ 4361 case SK_DRV_NET_DOWN: /* SK_U32 Reason */
@@ -4368,7 +4368,7 @@ SK_BOOL DualNet;
4368 } else { 4368 } else {
4369 DoPrintInterfaceChange = SK_TRUE; 4369 DoPrintInterfaceChange = SK_TRUE;
4370 } 4370 }
4371 pAC->dev[Param.Para32[1]]->flags &= ~IFF_RUNNING; 4371 netif_carrier_off(pAC->dev[Param.Para32[1]]);
4372 break; 4372 break;
4373 case SK_DRV_SWITCH_HARD: /* SK_U32 FromPortIdx SK_U32 ToPortIdx */ 4373 case SK_DRV_SWITCH_HARD: /* SK_U32 FromPortIdx SK_U32 ToPortIdx */
4374 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, 4374 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT,
@@ -4961,7 +4961,6 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
4961#ifdef CONFIG_NET_POLL_CONTROLLER 4961#ifdef CONFIG_NET_POLL_CONTROLLER
4962 dev->poll_controller = &SkGePollController; 4962 dev->poll_controller = &SkGePollController;
4963#endif 4963#endif
4964 dev->flags &= ~IFF_RUNNING;
4965 SET_NETDEV_DEV(dev, &pdev->dev); 4964 SET_NETDEV_DEV(dev, &pdev->dev);
4966 SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps); 4965 SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps);
4967 4966
@@ -5035,7 +5034,6 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
5035 dev->set_mac_address = &SkGeSetMacAddr; 5034 dev->set_mac_address = &SkGeSetMacAddr;
5036 dev->do_ioctl = &SkGeIoctl; 5035 dev->do_ioctl = &SkGeIoctl;
5037 dev->change_mtu = &SkGeChangeMtu; 5036 dev->change_mtu = &SkGeChangeMtu;
5038 dev->flags &= ~IFF_RUNNING;
5039 SET_NETDEV_DEV(dev, &pdev->dev); 5037 SET_NETDEV_DEV(dev, &pdev->dev);
5040 SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps); 5038 SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps);
5041 5039
diff --git a/drivers/net/sk_g16.c b/drivers/net/sk_g16.c
deleted file mode 100644
index 134ae0e6495b..000000000000
--- a/drivers/net/sk_g16.c
+++ /dev/null
@@ -1,2066 +0,0 @@
1/*-
2 * Copyright (C) 1994 by PJD Weichmann & SWS Bern, Switzerland
3 *
4 * This software may be used and distributed according to the terms
5 * of the GNU General Public License, incorporated herein by reference.
6 *
7 * Module : sk_g16.c
8 *
9 * Version : $Revision: 1.1 $
10 *
11 * Author : Patrick J.D. Weichmann
12 *
13 * Date Created : 94/05/26
14 * Last Updated : $Date: 1994/06/30 16:25:15 $
15 *
16 * Description : Schneider & Koch G16 Ethernet Device Driver for
17 * Linux Kernel >= 1.1.22
18 * Update History :
19 * Paul Gortmaker, 03/97: Fix for v2.1.x to use read{b,w}
20 * write{b,w} and memcpy -> memcpy_{to,from}io
21 *
22 * Jeff Garzik, 06/2000, Modularize
23 *
24-*/
25
26static const char rcsid[] = "$Id: sk_g16.c,v 1.1 1994/06/30 16:25:15 root Exp $";
27
28/*
29 * The Schneider & Koch (SK) G16 Network device driver is based
30 * on the 'ni6510' driver from Michael Hipp which can be found at
31 * ftp://sunsite.unc.edu/pub/Linux/system/Network/drivers/nidrivers.tar.gz
32 *
33 * Sources: 1) ni6510.c by M. Hipp
34 * 2) depca.c by D.C. Davies
35 * 3) skeleton.c by D. Becker
36 * 4) Am7990 Local Area Network Controller for Ethernet (LANCE),
37 * AMD, Pub. #05698, June 1989
38 *
39 * Many Thanks for helping me to get things working to:
40 *
41 * A. Cox (A.Cox@swansea.ac.uk)
42 * M. Hipp (mhipp@student.uni-tuebingen.de)
43 * R. Bolz (Schneider & Koch, Germany)
44 *
45 * To Do:
46 * - Support of SK_G8 and other SK Network Cards.
47 * - Autoset memory mapped RAM. Check for free memory and then
48 * configure RAM correctly.
49 * - SK_close should really set card in to initial state.
50 * - Test if IRQ 3 is not switched off. Use autoirq() functionality.
51 * (as in /drivers/net/skeleton.c)
52 * - Implement Multicast addressing. At minimum something like
53 * in depca.c.
54 * - Redo the statistics part.
55 * - Try to find out if the board is in 8 Bit or 16 Bit slot.
56 * If in 8 Bit mode don't use IRQ 11.
57 * - (Try to make it slightly faster.)
58 * - Power management support
59 */
60
61#include <linux/module.h>
62#include <linux/kernel.h>
63#include <linux/fcntl.h>
64#include <linux/ioport.h>
65#include <linux/interrupt.h>
66#include <linux/slab.h>
67#include <linux/string.h>
68#include <linux/delay.h>
69#include <linux/errno.h>
70#include <linux/init.h>
71#include <linux/spinlock.h>
72#include <linux/netdevice.h>
73#include <linux/etherdevice.h>
74#include <linux/skbuff.h>
75#include <linux/bitops.h>
76
77#include <asm/system.h>
78#include <asm/io.h>
79
80#include "sk_g16.h"
81
82/*
83 * Schneider & Koch Card Definitions
84 * =================================
85 */
86
87#define SK_NAME "SK_G16"
88
89/*
90 * SK_G16 Configuration
91 * --------------------
92 */
93
94/*
95 * Abbreviations
96 * -------------
97 *
98 * RAM - used for the 16KB shared memory
99 * Boot_ROM, ROM - are used for referencing the BootEPROM
100 *
101 * SK_BOOT_ROM and SK_ADDR are symbolic constants used to configure
102 * the behaviour of the driver and the SK_G16.
103 *
104 * ! See sk_g16.install on how to install and configure the driver !
105 *
106 * SK_BOOT_ROM defines if the Boot_ROM should be switched off or not.
107 *
108 * SK_ADDR defines the address where the RAM will be mapped into the real
109 * host memory.
110 * valid addresses are from 0xa0000 to 0xfc000 in 16Kbyte steps.
111 */
112
113#define SK_BOOT_ROM 1 /* 1=BootROM on 0=off */
114
115#define SK_ADDR 0xcc000
116
117/*
118 * In POS3 are bits A14-A19 of the address bus. These bits can be set
119 * to choose the RAM address. That's why we only can choose the RAM address
120 * in 16KB steps.
121 */
122
123#define POS_ADDR (rom_addr>>14) /* Do not change this line */
124
125/*
126 * SK_G16 I/O PORT's + IRQ's + Boot_ROM locations
127 * ----------------------------------------------
128 */
129
130/*
131 * As nearly every card has also SK_G16 a specified I/O Port region and
132 * only a few possible IRQ's.
133 * In the Installation Guide from Schneider & Koch is listed a possible
134 * Interrupt IRQ2. IRQ2 is always IRQ9 in boards with two cascaded interrupt
135 * controllers. So we use in SK_IRQS IRQ9.
136 */
137
138/* Don't touch any of the following #defines. */
139
140#define SK_IO_PORTS { 0x100, 0x180, 0x208, 0x220, 0x288, 0x320, 0x328, 0x390, 0 }
141
142#define SK_IRQS { 3, 5, 9, 11, 0 }
143
144#define SK_BOOT_ROM_LOCATIONS { 0xc0000, 0xc4000, 0xc8000, 0xcc000, 0xd0000, 0xd4000, 0xd8000, 0xdc000, 0 }
145
146#define SK_BOOT_ROM_ID { 0x55, 0xaa, 0x10, 0x50, 0x06, 0x33 }
147
148/*
149 * SK_G16 POS REGISTERS
150 * --------------------
151 */
152
153/*
154 * SK_G16 has a Programmable Option Select (POS) Register.
155 * The POS is composed of 8 separate registers (POS0-7) which
156 * are I/O mapped on an address set by the W1 switch.
157 *
158 */
159
160#define SK_POS_SIZE 8 /* 8 I/O Ports are used by SK_G16 */
161
162#define SK_POS0 ioaddr /* Card-ID Low (R) */
163#define SK_POS1 ioaddr+1 /* Card-ID High (R) */
164#define SK_POS2 ioaddr+2 /* Card-Enable, Boot-ROM Disable (RW) */
165#define SK_POS3 ioaddr+3 /* Base address of RAM */
166#define SK_POS4 ioaddr+4 /* IRQ */
167
168/* POS5 - POS7 are unused */
169
170/*
171 * SK_G16 MAC PREFIX
172 * -----------------
173 */
174
175/*
176 * Scheider & Koch manufacturer code (00:00:a5).
177 * This must be checked, that we are sure it is a SK card.
178 */
179
180#define SK_MAC0 0x00
181#define SK_MAC1 0x00
182#define SK_MAC2 0x5a
183
184/*
185 * SK_G16 ID
186 * ---------
187 */
188
189/*
190 * If POS0,POS1 contain the following ID, then we know
191 * at which I/O Port Address we are.
192 */
193
194#define SK_IDLOW 0xfd
195#define SK_IDHIGH 0x6a
196
197
198/*
199 * LANCE POS Bit definitions
200 * -------------------------
201 */
202
203#define SK_ROM_RAM_ON (POS2_CARD)
204#define SK_ROM_RAM_OFF (POS2_EPROM)
205#define SK_ROM_ON (inb(SK_POS2) & POS2_CARD)
206#define SK_ROM_OFF (inb(SK_POS2) | POS2_EPROM)
207#define SK_RAM_ON (inb(SK_POS2) | POS2_CARD)
208#define SK_RAM_OFF (inb(SK_POS2) & POS2_EPROM)
209
210#define POS2_CARD 0x0001 /* 1 = SK_G16 on 0 = off */
211#define POS2_EPROM 0x0002 /* 1 = Boot EPROM off 0 = on */
212
213/*
214 * SK_G16 Memory mapped Registers
215 * ------------------------------
216 *
217 */
218
219#define SK_IOREG (&board->ioreg) /* LANCE data registers. */
220#define SK_PORT (&board->port) /* Control, Status register */
221#define SK_IOCOM (&board->iocom) /* I/O Command */
222
223/*
224 * SK_G16 Status/Control Register bits
225 * -----------------------------------
226 *
227 * (C) Controlreg (S) Statusreg
228 */
229
230/*
231 * Register transfer: 0 = no transfer
232 * 1 = transferring data between LANCE and I/O reg
233 */
234#define SK_IORUN 0x20
235
236/*
237 * LANCE interrupt: 0 = LANCE interrupt occurred
238 * 1 = no LANCE interrupt occurred
239 */
240#define SK_IRQ 0x10
241
242#define SK_RESET 0x08 /* Reset SK_CARD: 0 = RESET 1 = normal */
243#define SK_RW 0x02 /* 0 = write to 1 = read from */
244#define SK_ADR 0x01 /* 0 = REG DataPort 1 = RAP Reg addr port */
245
246
247#define SK_RREG SK_RW /* Transferdirection to read from lance */
248#define SK_WREG 0 /* Transferdirection to write to lance */
249#define SK_RAP SK_ADR /* Destination Register RAP */
250#define SK_RDATA 0 /* Destination Register REG DataPort */
251
252/*
253 * SK_G16 I/O Command
254 * ------------------
255 */
256
257/*
258 * Any bitcombination sets the internal I/O bit (transfer will start)
259 * when written to I/O Command
260 */
261
262#define SK_DOIO 0x80 /* Do Transfer */
263
264/*
265 * LANCE RAP (Register Address Port).
266 * ---------------------------------
267 */
268
269/*
270 * The LANCE internal registers are selected through the RAP.
271 * The Registers are:
272 *
273 * CSR0 - Status and Control flags
274 * CSR1 - Low order bits of initialize block (bits 15:00)
275 * CSR2 - High order bits of initialize block (bits 07:00, 15:08 are reserved)
276 * CSR3 - Allows redefinition of the Bus Master Interface.
277 * This register must be set to 0x0002, which means BSWAP = 0,
278 * ACON = 1, BCON = 0;
279 *
280 */
281
282#define CSR0 0x00
283#define CSR1 0x01
284#define CSR2 0x02
285#define CSR3 0x03
286
287/*
288 * General Definitions
289 * ===================
290 */
291
292/*
293 * Set the number of Tx and Rx buffers, using Log_2(# buffers).
294 * We have 16KB RAM which can be accessed by the LANCE. In the
295 * memory are not only the buffers but also the ring descriptors and
296 * the initialize block.
297 * Don't change anything unless you really know what you do.
298 */
299
300#define LC_LOG_TX_BUFFERS 1 /* (2 == 2^^1) 2 Transmit buffers */
301#define LC_LOG_RX_BUFFERS 3 /* (8 == 2^^3) 8 Receive buffers */
302
303/* Descriptor ring sizes */
304
305#define TMDNUM (1 << (LC_LOG_TX_BUFFERS)) /* 2 Transmit descriptor rings */
306#define RMDNUM (1 << (LC_LOG_RX_BUFFERS)) /* 8 Receive Buffers */
307
308/* Define Mask for setting RMD, TMD length in the LANCE init_block */
309
310#define TMDNUMMASK (LC_LOG_TX_BUFFERS << 29)
311#define RMDNUMMASK (LC_LOG_RX_BUFFERS << 29)
312
313/*
314 * Data Buffer size is set to maximum packet length.
315 */
316
317#define PKT_BUF_SZ 1518
318
319/*
320 * The number of low I/O ports used by the ethercard.
321 */
322
323#define ETHERCARD_TOTAL_SIZE SK_POS_SIZE
324
325/*
326 * SK_DEBUG
327 *
328 * Here you can choose what level of debugging wanted.
329 *
330 * If SK_DEBUG and SK_DEBUG2 are undefined, then only the
331 * necessary messages will be printed.
332 *
333 * If SK_DEBUG is defined, there will be many debugging prints
334 * which can help to find some mistakes in configuration or even
335 * in the driver code.
336 *
337 * If SK_DEBUG2 is defined, many many messages will be printed
338 * which normally you don't need. I used this to check the interrupt
339 * routine.
340 *
341 * (If you define only SK_DEBUG2 then only the messages for
342 * checking interrupts will be printed!)
343 *
344 * Normal way of live is:
345 *
346 * For the whole thing get going let both symbolic constants
347 * undefined. If you face any problems and you know what's going
348 * on (you know something about the card and you can interpret some
349 * hex LANCE register output) then define SK_DEBUG
350 *
351 */
352
353#undef SK_DEBUG /* debugging */
354#undef SK_DEBUG2 /* debugging with more verbose report */
355
356#ifdef SK_DEBUG
357#define PRINTK(x) printk x
358#else
359#define PRINTK(x) /**/
360#endif
361
362#ifdef SK_DEBUG2
363#define PRINTK2(x) printk x
364#else
365#define PRINTK2(x) /**/
366#endif
367
368/*
369 * SK_G16 RAM
370 *
371 * The components are memory mapped and can be set in a region from
372 * 0x00000 through 0xfc000 in 16KB steps.
373 *
374 * The Network components are: dual ported RAM, Prom, I/O Reg, Status-,
375 * Controlregister and I/O Command.
376 *
377 * dual ported RAM: This is the only memory region which the LANCE chip
378 * has access to. From the Lance it is addressed from 0x0000 to
379 * 0x3fbf. The host accesses it normally.
380 *
381 * PROM: The PROM obtains the ETHERNET-MAC-Address. It is realised as a
382 * 8-Bit PROM, this means only the 16 even addresses are used of the
383 * 32 Byte Address region. Access to an odd address results in invalid
384 * data.
385 *
386 * LANCE I/O Reg: The I/O Reg is build of 4 single Registers, Low-Byte Write,
387 * Hi-Byte Write, Low-Byte Read, Hi-Byte Read.
388 * Transfer from or to the LANCE is always in 16Bit so Low and High
389 * registers are always relevant.
390 *
391 * The Data from the Readregister is not the data in the Writeregister!!
392 *
393 * Port: Status- and Controlregister.
394 * Two different registers which share the same address, Status is
395 * read-only, Control is write-only.
396 *
397 * I/O Command:
398 * Any bitcombination written in here starts the transmission between
399 * Host and LANCE.
400 */
401
402typedef struct
403{
404 unsigned char ram[0x3fc0]; /* 16KB dual ported ram */
405 unsigned char rom[0x0020]; /* 32Byte PROM containing 6Byte MAC */
406 unsigned char res1[0x0010]; /* reserved */
407 unsigned volatile short ioreg;/* LANCE I/O Register */
408 unsigned volatile char port; /* Statusregister and Controlregister */
409 unsigned char iocom; /* I/O Command Register */
410} SK_RAM;
411
412/* struct */
413
414/*
415 * This is the structure for the dual ported ram. We
416 * have exactly 16 320 Bytes. In here there must be:
417 *
418 * - Initialize Block (starting at a word boundary)
419 * - Receive and Transmit Descriptor Rings (quadword boundary)
420 * - Data Buffers (arbitrary boundary)
421 *
422 * This is because LANCE has on SK_G16 only access to the dual ported
423 * RAM and nowhere else.
424 */
425
426struct SK_ram
427{
428 struct init_block ib;
429 struct tmd tmde[TMDNUM];
430 struct rmd rmde[RMDNUM];
431 char tmdbuf[TMDNUM][PKT_BUF_SZ];
432 char rmdbuf[RMDNUM][PKT_BUF_SZ];
433};
434
435/*
436 * Structure where all necessary information is for ring buffer
437 * management and statistics.
438 */
439
440struct priv
441{
442 struct SK_ram *ram; /* dual ported ram structure */
443 struct rmd *rmdhead; /* start of receive ring descriptors */
444 struct tmd *tmdhead; /* start of transmit ring descriptors */
445 int rmdnum; /* actual used ring descriptor */
446 int tmdnum; /* actual transmit descriptor for transmitting data */
447 int tmdlast; /* last sent descriptor used for error handling, etc */
448 void *rmdbufs[RMDNUM]; /* pointer to the receive buffers */
449 void *tmdbufs[TMDNUM]; /* pointer to the transmit buffers */
450 struct net_device_stats stats; /* Device driver statistics */
451};
452
453/* global variable declaration */
454
455/* IRQ map used to reserve a IRQ (see SK_open()) */
456
457/* static variables */
458
459static SK_RAM *board; /* pointer to our memory mapped board components */
460static DEFINE_SPINLOCK(SK_lock);
461
462/* Macros */
463
464
465/* Function Prototypes */
466
467/*
468 * Device Driver functions
469 * -----------------------
470 * See for short explanation of each function its definitions header.
471 */
472
473static int SK_probe(struct net_device *dev, short ioaddr);
474
475static void SK_timeout(struct net_device *dev);
476static int SK_open(struct net_device *dev);
477static int SK_send_packet(struct sk_buff *skb, struct net_device *dev);
478static irqreturn_t SK_interrupt(int irq, void *dev_id, struct pt_regs * regs);
479static void SK_rxintr(struct net_device *dev);
480static void SK_txintr(struct net_device *dev);
481static int SK_close(struct net_device *dev);
482
483static struct net_device_stats *SK_get_stats(struct net_device *dev);
484
485unsigned int SK_rom_addr(void);
486
487static void set_multicast_list(struct net_device *dev);
488
489/*
490 * LANCE Functions
491 * ---------------
492 */
493
494static int SK_lance_init(struct net_device *dev, unsigned short mode);
495void SK_reset_board(void);
496void SK_set_RAP(int reg_number);
497int SK_read_reg(int reg_number);
498int SK_rread_reg(void);
499void SK_write_reg(int reg_number, int value);
500
501/*
502 * Debugging functions
503 * -------------------
504 */
505
506void SK_print_pos(struct net_device *dev, char *text);
507void SK_print_dev(struct net_device *dev, char *text);
508void SK_print_ram(struct net_device *dev);
509
510
511/*-
512 * Function : SK_init
513 * Author : Patrick J.D. Weichmann
514 * Date Created : 94/05/26
515 *
516 * Description : Check for a SK_G16 network adaptor and initialize it.
517 * This function gets called by dev_init which initializes
518 * all Network devices.
519 *
520 * Parameters : I : struct net_device *dev - structure preconfigured
521 * from Space.c
522 * Return Value : 0 = Driver Found and initialized
523 * Errors : ENODEV - no device found
524 * ENXIO - not probed
525 * Globals : None
526 * Update History :
527 * YY/MM/DD uid Description
528-*/
529
530static int io; /* 0 == probe */
531
532/*
533 * Check for a network adaptor of this type, and return '0' if one exists.
534 * If dev->base_addr == 0, probe all likely locations.
535 * If dev->base_addr == 1, always return failure.
536 */
537
538struct net_device * __init SK_init(int unit)
539{
540 int *port, ports[] = SK_IO_PORTS; /* SK_G16 supported ports */
541 static unsigned version_printed;
542 struct net_device *dev = alloc_etherdev(sizeof(struct priv));
543 int err = -ENODEV;
544
545 if (!dev)
546 return ERR_PTR(-ENOMEM);
547
548 if (unit >= 0) {
549 sprintf(dev->name, "eth%d", unit);
550 netdev_boot_setup_check(dev);
551 io = dev->base_addr;
552 }
553
554 if (version_printed++ == 0)
555 PRINTK(("%s: %s", SK_NAME, rcsid));
556
557 if (io > 0xff) { /* Check a single specified address */
558 err = -EBUSY;
559 /* Check if on specified address is a SK_G16 */
560 if (request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16")) {
561 err = SK_probe(dev, io);
562 if (!err)
563 goto got_it;
564 release_region(io, ETHERCARD_TOTAL_SIZE);
565 }
566 } else if (io > 0) { /* Don't probe at all */
567 err = -ENXIO;
568 } else {
569 /* Autoprobe base_addr */
570 for (port = &ports[0]; *port; port++) {
571 io = *port;
572
573 /* Check if I/O Port region is used by another board */
574 if (!request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16"))
575 continue; /* Try next Port address */
576
577 /* Check if at ioaddr is a SK_G16 */
578 if (SK_probe(dev, io) == 0)
579 goto got_it;
580
581 release_region(io, ETHERCARD_TOTAL_SIZE);
582 }
583 }
584err_out:
585 free_netdev(dev);
586 return ERR_PTR(err);
587
588got_it:
589 err = register_netdev(dev);
590 if (err) {
591 release_region(dev->base_addr, ETHERCARD_TOTAL_SIZE);
592 goto err_out;
593 }
594 return dev;
595
596} /* End of SK_init */
597
598
599MODULE_AUTHOR("Patrick J.D. Weichmann");
600MODULE_DESCRIPTION("Schneider & Koch G16 Ethernet Device Driver");
601MODULE_LICENSE("GPL");
602MODULE_PARM(io, "i");
603MODULE_PARM_DESC(io, "0 to probe common ports (unsafe), or the I/O base of the board");
604
605
606#ifdef MODULE
607
608static struct net_device *SK_dev;
609
610static int __init SK_init_module (void)
611{
612 SK_dev = SK_init(-1);
613 return IS_ERR(SK_dev) ? PTR_ERR(SK_dev) : 0;
614}
615
616static void __exit SK_cleanup_module (void)
617{
618 unregister_netdev(SK_dev);
619 release_region(SK_dev->base_addr, ETHERCARD_TOTAL_SIZE);
620 free_netdev(SK_dev);
621}
622
623module_init(SK_init_module);
624module_exit(SK_cleanup_module);
625#endif
626
627
628/*-
629 * Function : SK_probe
630 * Author : Patrick J.D. Weichmann
631 * Date Created : 94/05/26
632 *
633 * Description : This function is called by SK_init and
634 * does the main part of initialization.
635 *
636 * Parameters : I : struct net_device *dev - SK_G16 device structure
637 * I : short ioaddr - I/O Port address where POS is.
638 * Return Value : 0 = Initialization done
639 * Errors : ENODEV - No SK_G16 found
640 * -1 - Configuration problem
641 * Globals : board - pointer to SK_RAM
642 * Update History :
643 * YY/MM/DD uid Description
644 * 94/06/30 pwe SK_ADDR now checked and at the correct place
645-*/
646
647int __init SK_probe(struct net_device *dev, short ioaddr)
648{
649 int i,j; /* Counters */
650 int sk_addr_flag = 0; /* SK ADDR correct? 1 - no, 0 - yes */
651 unsigned int rom_addr; /* used to store RAM address used for POS_ADDR */
652
653 struct priv *p = netdev_priv(dev); /* SK_G16 private structure */
654
655 if (inb(SK_POS0) != SK_IDLOW || inb(SK_POS1) != SK_IDHIGH)
656 return -ENODEV;
657 dev->base_addr = ioaddr;
658
659 if (SK_ADDR & 0x3fff || SK_ADDR < 0xa0000)
660 {
661
662 sk_addr_flag = 1;
663
664 /*
665 * Now here we could use a routine which searches for a free
666 * place in the ram and set SK_ADDR if found. TODO.
667 */
668 }
669
670 if (SK_BOOT_ROM) /* Shall we keep Boot_ROM on ? */
671 {
672 PRINTK(("## %s: SK_BOOT_ROM is set.\n", SK_NAME));
673
674 rom_addr = SK_rom_addr();
675
676 if (rom_addr == 0) /* No Boot_ROM found */
677 {
678 if (sk_addr_flag) /* No or Invalid SK_ADDR is defined */
679 {
680 printk("%s: SK_ADDR %#08x is not valid. Check configuration.\n",
681 dev->name, SK_ADDR);
682 return -1;
683 }
684
685 rom_addr = SK_ADDR; /* assign predefined address */
686
687 PRINTK(("## %s: NO Bootrom found \n", SK_NAME));
688
689 outb(SK_ROM_RAM_OFF, SK_POS2); /* Boot_ROM + RAM off */
690 outb(POS_ADDR, SK_POS3); /* Set RAM address */
691 outb(SK_RAM_ON, SK_POS2); /* enable RAM */
692 }
693 else if (rom_addr == SK_ADDR)
694 {
695 printk("%s: RAM + ROM are set to the same address %#08x\n"
696 " Check configuration. Now switching off Boot_ROM\n",
697 SK_NAME, rom_addr);
698
699 outb(SK_ROM_RAM_OFF, SK_POS2); /* Boot_ROM + RAM off*/
700 outb(POS_ADDR, SK_POS3); /* Set RAM address */
701 outb(SK_RAM_ON, SK_POS2); /* enable RAM */
702 }
703 else
704 {
705 PRINTK(("## %s: Found ROM at %#08x\n", SK_NAME, rom_addr));
706 PRINTK(("## %s: Keeping Boot_ROM on\n", SK_NAME));
707
708 if (sk_addr_flag) /* No or Invalid SK_ADDR is defined */
709 {
710 printk("%s: SK_ADDR %#08x is not valid. Check configuration.\n",
711 dev->name, SK_ADDR);
712 return -1;
713 }
714
715 rom_addr = SK_ADDR;
716
717 outb(SK_ROM_RAM_OFF, SK_POS2); /* Boot_ROM + RAM off */
718 outb(POS_ADDR, SK_POS3); /* Set RAM address */
719 outb(SK_ROM_RAM_ON, SK_POS2); /* RAM on, BOOT_ROM on */
720 }
721 }
722 else /* Don't keep Boot_ROM */
723 {
724 PRINTK(("## %s: SK_BOOT_ROM is not set.\n", SK_NAME));
725
726 if (sk_addr_flag) /* No or Invalid SK_ADDR is defined */
727 {
728 printk("%s: SK_ADDR %#08x is not valid. Check configuration.\n",
729 dev->name, SK_ADDR);
730 return -1;
731 }
732
733 rom_addr = SK_rom_addr(); /* Try to find a Boot_ROM */
734
735 /* IF we find a Boot_ROM disable it */
736
737 outb(SK_ROM_RAM_OFF, SK_POS2); /* Boot_ROM + RAM off */
738
739 /* We found a Boot_ROM and it's gone. Set RAM address on
740 * Boot_ROM address.
741 */
742
743 if (rom_addr)
744 {
745 printk("%s: We found Boot_ROM at %#08x. Now setting RAM on"
746 "that address\n", SK_NAME, rom_addr);
747
748 outb(POS_ADDR, SK_POS3); /* Set RAM on Boot_ROM address */
749 }
750 else /* We did not find a Boot_ROM, use predefined SK_ADDR for ram */
751 {
752 if (sk_addr_flag) /* No or Invalid SK_ADDR is defined */
753 {
754 printk("%s: SK_ADDR %#08x is not valid. Check configuration.\n",
755 dev->name, SK_ADDR);
756 return -1;
757 }
758
759 rom_addr = SK_ADDR;
760
761 outb(POS_ADDR, SK_POS3); /* Set RAM address */
762 }
763 outb(SK_RAM_ON, SK_POS2); /* enable RAM */
764 }
765
766#ifdef SK_DEBUG
767 SK_print_pos(dev, "POS registers after ROM, RAM config");
768#endif
769
770 board = (SK_RAM *) isa_bus_to_virt(rom_addr);
771
772 /* Read in station address */
773 for (i = 0, j = 0; i < ETH_ALEN; i++, j+=2)
774 {
775 dev->dev_addr[i] = readb(board->rom+j);
776 }
777
778 /* Check for manufacturer code */
779 if (!(dev->dev_addr[0] == SK_MAC0 &&
780 dev->dev_addr[1] == SK_MAC1 &&
781 dev->dev_addr[2] == SK_MAC2) )
782 {
783 PRINTK(("## %s: We did not find SK_G16 at RAM location.\n",
784 SK_NAME));
785 return -ENODEV; /* NO SK_G16 found */
786 }
787
788 printk("%s: %s found at %#3x, HW addr: %#04x:%02x:%02x:%02x:%02x:%02x\n",
789 dev->name,
790 "Schneider & Koch Netcard",
791 (unsigned int) dev->base_addr,
792 dev->dev_addr[0],
793 dev->dev_addr[1],
794 dev->dev_addr[2],
795 dev->dev_addr[3],
796 dev->dev_addr[4],
797 dev->dev_addr[5]);
798
799 memset((char *) dev->priv, 0, sizeof(struct priv)); /* clear memory */
800
801 /* Assign our Device Driver functions */
802
803 dev->open = SK_open;
804 dev->stop = SK_close;
805 dev->hard_start_xmit = SK_send_packet;
806 dev->get_stats = SK_get_stats;
807 dev->set_multicast_list = set_multicast_list;
808 dev->tx_timeout = SK_timeout;
809 dev->watchdog_timeo = HZ/7;
810
811
812 dev->flags &= ~IFF_MULTICAST;
813
814 /* Initialize private structure */
815
816 p->ram = (struct SK_ram *) rom_addr; /* Set dual ported RAM addr */
817 p->tmdhead = &(p->ram)->tmde[0]; /* Set TMD head */
818 p->rmdhead = &(p->ram)->rmde[0]; /* Set RMD head */
819
820 /* Initialize buffer pointers */
821
822 for (i = 0; i < TMDNUM; i++)
823 {
824 p->tmdbufs[i] = &(p->ram)->tmdbuf[i];
825 }
826
827 for (i = 0; i < RMDNUM; i++)
828 {
829 p->rmdbufs[i] = &(p->ram)->rmdbuf[i];
830 }
831
832#ifdef SK_DEBUG
833 SK_print_pos(dev, "End of SK_probe");
834 SK_print_ram(dev);
835#endif
836 return 0; /* Initialization done */
837} /* End of SK_probe() */
838
839
840/*-
841 * Function : SK_open
842 * Author : Patrick J.D. Weichmann
843 * Date Created : 94/05/26
844 *
845 * Description : This function is called sometimes after booting
846 * when ifconfig program is run.
847 *
848 * This function requests an IRQ, sets the correct
849 * IRQ in the card. Then calls SK_lance_init() to
850 * init and start the LANCE chip. Then if everything is
851 * ok returns with 0 (OK), which means SK_G16 is now
852 * opened and operational.
853 *
854 * (Called by dev_open() /net/inet/dev.c)
855 *
856 * Parameters : I : struct net_device *dev - SK_G16 device structure
857 * Return Value : 0 - Device opened
858 * Errors : -EAGAIN - Open failed
859 * Side Effects : None
860 * Update History :
861 * YY/MM/DD uid Description
862-*/
863
864static int SK_open(struct net_device *dev)
865{
866 int i = 0;
867 int irqval = 0;
868 int ioaddr = dev->base_addr;
869
870 int irqtab[] = SK_IRQS;
871
872 struct priv *p = netdev_priv(dev);
873
874 PRINTK(("## %s: At beginning of SK_open(). CSR0: %#06x\n",
875 SK_NAME, SK_read_reg(CSR0)));
876
877 if (dev->irq == 0) /* Autoirq */
878 {
879 i = 0;
880
881 /*
882 * Check if one IRQ out of SK_IRQS is free and install
883 * interrupt handler.
884 * Most done by request_irq().
885 * irqval: 0 - interrupt handler installed for IRQ irqtab[i]
886 * -EBUSY - interrupt busy
887 * -EINVAL - irq > 15 or handler = NULL
888 */
889
890 do
891 {
892 irqval = request_irq(irqtab[i], &SK_interrupt, 0, "sk_g16", dev);
893 i++;
894 } while (irqval && irqtab[i]);
895
896 if (irqval) /* We tried every possible IRQ but no success */
897 {
898 printk("%s: unable to get an IRQ\n", dev->name);
899 return -EAGAIN;
900 }
901
902 dev->irq = irqtab[--i];
903
904 outb(i<<2, SK_POS4); /* Set Card on probed IRQ */
905
906 }
907 else if (dev->irq == 2) /* IRQ2 is always IRQ9 */
908 {
909 if (request_irq(9, &SK_interrupt, 0, "sk_g16", dev))
910 {
911 printk("%s: unable to get IRQ 9\n", dev->name);
912 return -EAGAIN;
913 }
914 dev->irq = 9;
915
916 /*
917 * Now we set card on IRQ2.
918 * This can be confusing, but remember that IRQ2 on the network
919 * card is in reality IRQ9
920 */
921 outb(0x08, SK_POS4); /* set card to IRQ2 */
922
923 }
924 else /* Check IRQ as defined in Space.c */
925 {
926 int i = 0;
927
928 /* check if IRQ free and valid. Then install Interrupt handler */
929
930 if (request_irq(dev->irq, &SK_interrupt, 0, "sk_g16", dev))
931 {
932 printk("%s: unable to get selected IRQ\n", dev->name);
933 return -EAGAIN;
934 }
935
936 switch(dev->irq)
937 {
938 case 3: i = 0;
939 break;
940 case 5: i = 1;
941 break;
942 case 2: i = 2;
943 break;
944 case 11:i = 3;
945 break;
946 default:
947 printk("%s: Preselected IRQ %d is invalid for %s boards",
948 dev->name,
949 dev->irq,
950 SK_NAME);
951 return -EAGAIN;
952 }
953
954 outb(i<<2, SK_POS4); /* Set IRQ on card */
955 }
956
957 printk("%s: Schneider & Koch G16 at %#3x, IRQ %d, shared mem at %#08x\n",
958 dev->name, (unsigned int)dev->base_addr,
959 (int) dev->irq, (unsigned int) p->ram);
960
961 if (!(i = SK_lance_init(dev, 0))) /* LANCE init OK? */
962 {
963 netif_start_queue(dev);
964
965#ifdef SK_DEBUG
966
967 /*
968 * This debug block tries to stop LANCE,
969 * reinit LANCE with transmitter and receiver disabled,
970 * then stop again and reinit with NORMAL_MODE
971 */
972
973 printk("## %s: After lance init. CSR0: %#06x\n",
974 SK_NAME, SK_read_reg(CSR0));
975 SK_write_reg(CSR0, CSR0_STOP);
976 printk("## %s: LANCE stopped. CSR0: %#06x\n",
977 SK_NAME, SK_read_reg(CSR0));
978 SK_lance_init(dev, MODE_DTX | MODE_DRX);
979 printk("## %s: Reinit with DTX + DRX off. CSR0: %#06x\n",
980 SK_NAME, SK_read_reg(CSR0));
981 SK_write_reg(CSR0, CSR0_STOP);
982 printk("## %s: LANCE stopped. CSR0: %#06x\n",
983 SK_NAME, SK_read_reg(CSR0));
984 SK_lance_init(dev, MODE_NORMAL);
985 printk("## %s: LANCE back to normal mode. CSR0: %#06x\n",
986 SK_NAME, SK_read_reg(CSR0));
987 SK_print_pos(dev, "POS regs before returning OK");
988
989#endif /* SK_DEBUG */
990
991 return 0; /* SK_open() is successful */
992 }
993 else /* LANCE init failed */
994 {
995
996 PRINTK(("## %s: LANCE init failed: CSR0: %#06x\n",
997 SK_NAME, SK_read_reg(CSR0)));
998
999 return -EAGAIN;
1000 }
1001
1002} /* End of SK_open() */
1003
1004
1005/*-
1006 * Function : SK_lance_init
1007 * Author : Patrick J.D. Weichmann
1008 * Date Created : 94/05/26
1009 *
1010 * Description : Reset LANCE chip, fill RMD, TMD structures with
1011 * start values and Start LANCE.
1012 *
1013 * Parameters : I : struct net_device *dev - SK_G16 device structure
1014 * I : int mode - put LANCE into "mode" see data-sheet for
1015 * more info.
1016 * Return Value : 0 - Init done
1017 * Errors : -1 - Init failed
1018 * Update History :
1019 * YY/MM/DD uid Description
1020-*/
1021
1022static int SK_lance_init(struct net_device *dev, unsigned short mode)
1023{
1024 int i;
1025 unsigned long flags;
1026 struct priv *p = netdev_priv(dev);
1027 struct tmd *tmdp;
1028 struct rmd *rmdp;
1029
1030 PRINTK(("## %s: At beginning of LANCE init. CSR0: %#06x\n",
1031 SK_NAME, SK_read_reg(CSR0)));
1032
1033 /* Reset LANCE */
1034 SK_reset_board();
1035
1036 /* Initialize TMD's with start values */
1037 p->tmdnum = 0; /* First descriptor for transmitting */
1038 p->tmdlast = 0; /* First descriptor for reading stats */
1039
1040 for (i = 0; i < TMDNUM; i++) /* Init all TMD's */
1041 {
1042 tmdp = p->tmdhead + i;
1043
1044 writel((unsigned long) p->tmdbufs[i], tmdp->u.buffer); /* assign buffer */
1045
1046 /* Mark TMD as start and end of packet */
1047 writeb(TX_STP | TX_ENP, &tmdp->u.s.status);
1048 }
1049
1050
1051 /* Initialize RMD's with start values */
1052
1053 p->rmdnum = 0; /* First RMD which will be used */
1054
1055 for (i = 0; i < RMDNUM; i++) /* Init all RMD's */
1056 {
1057 rmdp = p->rmdhead + i;
1058
1059
1060 writel((unsigned long) p->rmdbufs[i], rmdp->u.buffer); /* assign buffer */
1061
1062 /*
1063 * LANCE must be owner at beginning so that he can fill in
1064 * receiving packets, set status and release RMD
1065 */
1066
1067 writeb(RX_OWN, &rmdp->u.s.status);
1068
1069 writew(-PKT_BUF_SZ, &rmdp->blen); /* Buffer Size (two's complement) */
1070
1071 writeb(0, &rmdp->mlen); /* init message length */
1072
1073 }
1074
1075 /* Fill LANCE Initialize Block */
1076
1077 writew(mode, (&((p->ram)->ib.mode))); /* Set operation mode */
1078
1079 for (i = 0; i < ETH_ALEN; i++) /* Set physical address */
1080 {
1081 writeb(dev->dev_addr[i], (&((p->ram)->ib.paddr[i])));
1082 }
1083
1084 for (i = 0; i < 8; i++) /* Set multicast, logical address */
1085 {
1086 writeb(0, (&((p->ram)->ib.laddr[i]))); /* We do not use logical addressing */
1087 }
1088
1089 /* Set ring descriptor pointers and set number of descriptors */
1090
1091 writel((int)p->rmdhead | RMDNUMMASK, (&((p->ram)->ib.rdrp)));
1092 writel((int)p->tmdhead | TMDNUMMASK, (&((p->ram)->ib.tdrp)));
1093
1094 /* Prepare LANCE Control and Status Registers */
1095
1096 spin_lock_irqsave(&SK_lock, flags);
1097
1098 SK_write_reg(CSR3, CSR3_ACON); /* Ale Control !!!THIS MUST BE SET!!!! */
1099
1100 /*
1101 * LANCE addresses the RAM from 0x0000 to 0x3fbf and has no access to
1102 * PC Memory locations.
1103 *
1104 * In structure SK_ram is defined that the first thing in ram
1105 * is the initialization block. So his address is for LANCE always
1106 * 0x0000
1107 *
1108 * CSR1 contains low order bits 15:0 of initialization block address
1109 * CSR2 is built of:
1110 * 7:0 High order bits 23:16 of initialization block address
1111 * 15:8 reserved, must be 0
1112 */
1113
1114 /* Set initialization block address (must be on word boundary) */
1115 SK_write_reg(CSR1, 0); /* Set low order bits 15:0 */
1116 SK_write_reg(CSR2, 0); /* Set high order bits 23:16 */
1117
1118
1119 PRINTK(("## %s: After setting CSR1-3. CSR0: %#06x\n",
1120 SK_NAME, SK_read_reg(CSR0)));
1121
1122 /* Initialize LANCE */
1123
1124 /*
1125 * INIT = Initialize, when set, causes the LANCE to begin the
1126 * initialization procedure and access the Init Block.
1127 */
1128
1129 SK_write_reg(CSR0, CSR0_INIT);
1130
1131 spin_unlock_irqrestore(&SK_lock, flags);
1132
1133 /* Wait until LANCE finished initialization */
1134
1135 SK_set_RAP(CSR0); /* Register Address Pointer to CSR0 */
1136
1137 for (i = 0; (i < 100) && !(SK_rread_reg() & CSR0_IDON); i++)
1138 ; /* Wait until init done or go ahead if problems (i>=100) */
1139
1140 if (i >= 100) /* Something is wrong ! */
1141 {
1142 printk("%s: can't init am7990, status: %04x "
1143 "init_block: %#08x\n",
1144 dev->name, (int) SK_read_reg(CSR0),
1145 (unsigned int) &(p->ram)->ib);
1146
1147#ifdef SK_DEBUG
1148 SK_print_pos(dev, "LANCE INIT failed");
1149 SK_print_dev(dev,"Device Structure:");
1150#endif
1151
1152 return -1; /* LANCE init failed */
1153 }
1154
1155 PRINTK(("## %s: init done after %d ticks\n", SK_NAME, i));
1156
1157 /* Clear Initialize done, enable Interrupts, start LANCE */
1158
1159 SK_write_reg(CSR0, CSR0_IDON | CSR0_INEA | CSR0_STRT);
1160
1161 PRINTK(("## %s: LANCE started. CSR0: %#06x\n", SK_NAME,
1162 SK_read_reg(CSR0)));
1163
1164 return 0; /* LANCE is up and running */
1165
1166} /* End of SK_lance_init() */
1167
1168
1169
1170/*-
1171 * Function : SK_send_packet
1172 * Author : Patrick J.D. Weichmann
1173 * Date Created : 94/05/27
1174 *
1175 * Description : Writes an socket buffer into a transmit descriptor
1176 * and starts transmission.
1177 *
1178 * Parameters : I : struct sk_buff *skb - packet to transfer
1179 * I : struct net_device *dev - SK_G16 device structure
1180 * Return Value : 0 - OK
1181 * 1 - Could not transmit (dev_queue_xmit will queue it)
1182 * and try to sent it later
1183 * Globals : None
1184 * Side Effects : None
1185 * Update History :
1186 * YY/MM/DD uid Description
1187-*/
1188
1189static void SK_timeout(struct net_device *dev)
1190{
1191 printk(KERN_WARNING "%s: xmitter timed out, try to restart!\n", dev->name);
1192 SK_lance_init(dev, MODE_NORMAL); /* Reinit LANCE */
1193 netif_wake_queue(dev); /* Clear Transmitter flag */
1194 dev->trans_start = jiffies; /* Mark Start of transmission */
1195}
1196
1197static int SK_send_packet(struct sk_buff *skb, struct net_device *dev)
1198{
1199 struct priv *p = netdev_priv(dev);
1200 struct tmd *tmdp;
1201 static char pad[64];
1202
1203 PRINTK2(("## %s: SK_send_packet() called, CSR0 %#04x.\n",
1204 SK_NAME, SK_read_reg(CSR0)));
1205
1206
1207 /*
1208 * Block a timer-based transmit from overlapping.
1209 * This means check if we are already in.
1210 */
1211
1212 netif_stop_queue (dev);
1213
1214 {
1215
1216 /* Evaluate Packet length */
1217 short len = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
1218
1219 tmdp = p->tmdhead + p->tmdnum; /* Which descriptor for transmitting */
1220
1221 /* Fill in Transmit Message Descriptor */
1222
1223 /* Copy data into dual ported ram */
1224
1225 memcpy_toio((tmdp->u.buffer & 0x00ffffff), skb->data, skb->len);
1226 if (len != skb->len)
1227 memcpy_toio((tmdp->u.buffer & 0x00ffffff) + skb->len, pad, len-skb->len);
1228
1229 writew(-len, &tmdp->blen); /* set length to transmit */
1230
1231 /*
1232 * Packet start and end is always set because we use the maximum
1233 * packet length as buffer length.
1234 * Relinquish ownership to LANCE
1235 */
1236
1237 writeb(TX_OWN | TX_STP | TX_ENP, &tmdp->u.s.status);
1238
1239 /* Start Demand Transmission */
1240 SK_write_reg(CSR0, CSR0_TDMD | CSR0_INEA);
1241
1242 dev->trans_start = jiffies; /* Mark start of transmission */
1243
1244 /* Set pointer to next transmit buffer */
1245 p->tmdnum++;
1246 p->tmdnum &= TMDNUM-1;
1247
1248 /* Do we own the next transmit buffer ? */
1249 if (! (readb(&((p->tmdhead + p->tmdnum)->u.s.status)) & TX_OWN) )
1250 {
1251 /*
1252 * We own next buffer and are ready to transmit, so
1253 * clear busy flag
1254 */
1255 netif_start_queue(dev);
1256 }
1257
1258 p->stats.tx_bytes += skb->len;
1259
1260 }
1261
1262 dev_kfree_skb(skb);
1263 return 0;
1264} /* End of SK_send_packet */
1265
1266
1267/*-
1268 * Function : SK_interrupt
1269 * Author : Patrick J.D. Weichmann
1270 * Date Created : 94/05/27
1271 *
1272 * Description : SK_G16 interrupt handler which checks for LANCE
1273 * Errors, handles transmit and receive interrupts
1274 *
1275 * Parameters : I : int irq, void *dev_id, struct pt_regs * regs -
1276 * Return Value : None
1277 * Errors : None
1278 * Globals : None
1279 * Side Effects : None
1280 * Update History :
1281 * YY/MM/DD uid Description
1282-*/
1283
1284static irqreturn_t SK_interrupt(int irq, void *dev_id, struct pt_regs * regs)
1285{
1286 int csr0;
1287 struct net_device *dev = dev_id;
1288 struct priv *p = netdev_priv(dev);
1289
1290
1291 PRINTK2(("## %s: SK_interrupt(). status: %#06x\n",
1292 SK_NAME, SK_read_reg(CSR0)));
1293
1294 if (dev == NULL)
1295 {
1296 printk("SK_interrupt(): IRQ %d for unknown device.\n", irq);
1297 }
1298
1299 spin_lock (&SK_lock);
1300
1301 csr0 = SK_read_reg(CSR0); /* store register for checking */
1302
1303 /*
1304 * Acknowledge all of the current interrupt sources, disable
1305 * Interrupts (INEA = 0)
1306 */
1307
1308 SK_write_reg(CSR0, csr0 & CSR0_CLRALL);
1309
1310 if (csr0 & CSR0_ERR) /* LANCE Error */
1311 {
1312 printk("%s: error: %04x\n", dev->name, csr0);
1313
1314 if (csr0 & CSR0_MISS) /* No place to store packet ? */
1315 {
1316 p->stats.rx_dropped++;
1317 }
1318 }
1319
1320 if (csr0 & CSR0_RINT) /* Receive Interrupt (packet arrived) */
1321 {
1322 SK_rxintr(dev);
1323 }
1324
1325 if (csr0 & CSR0_TINT) /* Transmit interrupt (packet sent) */
1326 {
1327 SK_txintr(dev);
1328 }
1329
1330 SK_write_reg(CSR0, CSR0_INEA); /* Enable Interrupts */
1331
1332 spin_unlock (&SK_lock);
1333 return IRQ_HANDLED;
1334} /* End of SK_interrupt() */
1335
1336
1337/*-
1338 * Function : SK_txintr
1339 * Author : Patrick J.D. Weichmann
1340 * Date Created : 94/05/27
1341 *
1342 * Description : After sending a packet we check status, update
1343 * statistics and relinquish ownership of transmit
1344 * descriptor ring.
1345 *
1346 * Parameters : I : struct net_device *dev - SK_G16 device structure
1347 * Return Value : None
1348 * Errors : None
1349 * Globals : None
1350 * Update History :
1351 * YY/MM/DD uid Description
1352-*/
1353
1354static void SK_txintr(struct net_device *dev)
1355{
1356 int tmdstat;
1357 struct tmd *tmdp;
1358 struct priv *p = netdev_priv(dev);
1359
1360
1361 PRINTK2(("## %s: SK_txintr() status: %#06x\n",
1362 SK_NAME, SK_read_reg(CSR0)));
1363
1364 tmdp = p->tmdhead + p->tmdlast; /* Which buffer we sent at last ? */
1365
1366 /* Set next buffer */
1367 p->tmdlast++;
1368 p->tmdlast &= TMDNUM-1;
1369
1370 tmdstat = readb(&tmdp->u.s.status);
1371
1372 /*
1373 * We check status of transmitted packet.
1374 * see LANCE data-sheet for error explanation
1375 */
1376 if (tmdstat & TX_ERR) /* Error occurred */
1377 {
1378 int stat2 = readw(&tmdp->status2);
1379
1380 printk("%s: TX error: %04x %04x\n", dev->name, tmdstat, stat2);
1381
1382 if (stat2 & TX_TDR) /* TDR problems? */
1383 {
1384 printk("%s: tdr-problems \n", dev->name);
1385 }
1386
1387 if (stat2 & TX_RTRY) /* Failed in 16 attempts to transmit ? */
1388 p->stats.tx_aborted_errors++;
1389 if (stat2 & TX_LCOL) /* Late collision ? */
1390 p->stats.tx_window_errors++;
1391 if (stat2 & TX_LCAR) /* Loss of Carrier ? */
1392 p->stats.tx_carrier_errors++;
1393 if (stat2 & TX_UFLO) /* Underflow error ? */
1394 {
1395 p->stats.tx_fifo_errors++;
1396
1397 /*
1398 * If UFLO error occurs it will turn transmitter of.
1399 * So we must reinit LANCE
1400 */
1401
1402 SK_lance_init(dev, MODE_NORMAL);
1403 }
1404
1405 p->stats.tx_errors++;
1406
1407 writew(0, &tmdp->status2); /* Clear error flags */
1408 }
1409 else if (tmdstat & TX_MORE) /* Collisions occurred ? */
1410 {
1411 /*
1412 * Here I have a problem.
1413 * I only know that there must be one or up to 15 collisions.
1414 * That's why TX_MORE is set, because after 16 attempts TX_RTRY
1415 * will be set which means couldn't send packet aborted transfer.
1416 *
1417 * First I did not have this in but then I thought at minimum
1418 * we see that something was not ok.
1419 * If anyone knows something better than this to handle this
1420 * please report it.
1421 */
1422
1423 p->stats.collisions++;
1424 }
1425 else /* Packet sent without any problems */
1426 {
1427 p->stats.tx_packets++;
1428 }
1429
1430 /*
1431 * We mark transmitter not busy anymore, because now we have a free
1432 * transmit descriptor which can be filled by SK_send_packet and
1433 * afterwards sent by the LANCE
1434 *
1435 * The function which do handle slow IRQ parts is do_bottom_half()
1436 * which runs at normal kernel priority, that means all interrupt are
1437 * enabled. (see kernel/irq.c)
1438 *
1439 * net_bh does something like this:
1440 * - check if already in net_bh
1441 * - try to transmit something from the send queue
1442 * - if something is in the receive queue send it up to higher
1443 * levels if it is a known protocol
1444 * - try to transmit something from the send queue
1445 */
1446
1447 netif_wake_queue(dev);
1448
1449} /* End of SK_txintr() */
1450
1451
1452/*-
1453 * Function : SK_rxintr
1454 * Author : Patrick J.D. Weichmann
1455 * Date Created : 94/05/27
1456 *
1457 * Description : Buffer sent, check for errors, relinquish ownership
1458 * of the receive message descriptor.
1459 *
1460 * Parameters : I : SK_G16 device structure
1461 * Return Value : None
1462 * Globals : None
1463 * Update History :
1464 * YY/MM/DD uid Description
1465-*/
1466
1467static void SK_rxintr(struct net_device *dev)
1468{
1469
1470 struct rmd *rmdp;
1471 int rmdstat;
1472 struct priv *p = netdev_priv(dev);
1473
1474 PRINTK2(("## %s: SK_rxintr(). CSR0: %#06x\n",
1475 SK_NAME, SK_read_reg(CSR0)));
1476
1477 rmdp = p->rmdhead + p->rmdnum;
1478
1479 /* As long as we own the next entry, check status and send
1480 * it up to higher layer
1481 */
1482
1483 while (!( (rmdstat = readb(&rmdp->u.s.status)) & RX_OWN))
1484 {
1485 /*
1486 * Start and end of packet must be set, because we use
1487 * the ethernet maximum packet length (1518) as buffer size.
1488 *
1489 * Because our buffers are at maximum OFLO and BUFF errors are
1490 * not to be concerned (see Data sheet)
1491 */
1492
1493 if ((rmdstat & (RX_STP | RX_ENP)) != (RX_STP | RX_ENP))
1494 {
1495 /* Start of a frame > 1518 Bytes ? */
1496
1497 if (rmdstat & RX_STP)
1498 {
1499 p->stats.rx_errors++; /* bad packet received */
1500 p->stats.rx_length_errors++; /* packet too long */
1501
1502 printk("%s: packet too long\n", dev->name);
1503 }
1504
1505 /*
1506 * All other packets will be ignored until a new frame with
1507 * start (RX_STP) set follows.
1508 *
1509 * What we do is just give descriptor free for new incoming
1510 * packets.
1511 */
1512
1513 writeb(RX_OWN, &rmdp->u.s.status); /* Relinquish ownership to LANCE */
1514
1515 }
1516 else if (rmdstat & RX_ERR) /* Receive Error ? */
1517 {
1518 printk("%s: RX error: %04x\n", dev->name, (int) rmdstat);
1519
1520 p->stats.rx_errors++;
1521
1522 if (rmdstat & RX_FRAM) p->stats.rx_frame_errors++;
1523 if (rmdstat & RX_CRC) p->stats.rx_crc_errors++;
1524
1525 writeb(RX_OWN, &rmdp->u.s.status); /* Relinquish ownership to LANCE */
1526
1527 }
1528 else /* We have a packet which can be queued for the upper layers */
1529 {
1530
1531 int len = readw(&rmdp->mlen) & 0x0fff; /* extract message length from receive buffer */
1532 struct sk_buff *skb;
1533
1534 skb = dev_alloc_skb(len+2); /* allocate socket buffer */
1535
1536 if (skb == NULL) /* Could not get mem ? */
1537 {
1538
1539 /*
1540 * Couldn't allocate sk_buffer so we give descriptor back
1541 * to Lance, update statistics and go ahead.
1542 */
1543
1544 writeb(RX_OWN, &rmdp->u.s.status); /* Relinquish ownership to LANCE */
1545 printk("%s: Couldn't allocate sk_buff, deferring packet.\n",
1546 dev->name);
1547 p->stats.rx_dropped++;
1548
1549 break; /* Jump out */
1550 }
1551
1552 /* Prepare sk_buff to queue for upper layers */
1553
1554 skb->dev = dev;
1555 skb_reserve(skb,2); /* Align IP header on 16 byte boundary */
1556
1557 /*
1558 * Copy data out of our receive descriptor into sk_buff.
1559 *
1560 * (rmdp->u.buffer & 0x00ffffff) -> get address of buffer and
1561 * ignore status fields)
1562 */
1563
1564 memcpy_fromio(skb_put(skb,len), (rmdp->u.buffer & 0x00ffffff), len);
1565
1566
1567 /*
1568 * Notify the upper protocol layers that there is another packet
1569 * to handle
1570 *
1571 * netif_rx() always succeeds. see /net/inet/dev.c for more.
1572 */
1573
1574 skb->protocol=eth_type_trans(skb,dev);
1575 netif_rx(skb); /* queue packet and mark it for processing */
1576
1577 /*
1578 * Packet is queued and marked for processing so we
1579 * free our descriptor and update statistics
1580 */
1581
1582 writeb(RX_OWN, &rmdp->u.s.status);
1583 dev->last_rx = jiffies;
1584 p->stats.rx_packets++;
1585 p->stats.rx_bytes += len;
1586
1587
1588 p->rmdnum++;
1589 p->rmdnum %= RMDNUM;
1590
1591 rmdp = p->rmdhead + p->rmdnum;
1592 }
1593 }
1594} /* End of SK_rxintr() */
1595
1596
1597/*-
1598 * Function : SK_close
1599 * Author : Patrick J.D. Weichmann
1600 * Date Created : 94/05/26
1601 *
1602 * Description : close gets called from dev_close() and should
1603 * deinstall the card (free_irq, mem etc).
1604 *
1605 * Parameters : I : struct net_device *dev - our device structure
1606 * Return Value : 0 - closed device driver
1607 * Errors : None
1608 * Globals : None
1609 * Update History :
1610 * YY/MM/DD uid Description
1611-*/
1612
1613/* I have tried to set BOOT_ROM on and RAM off but then, after a 'ifconfig
1614 * down' the system stops. So I don't shut set card to init state.
1615 */
1616
1617static int SK_close(struct net_device *dev)
1618{
1619
1620 PRINTK(("## %s: SK_close(). CSR0: %#06x\n",
1621 SK_NAME, SK_read_reg(CSR0)));
1622
1623 netif_stop_queue(dev); /* Transmitter busy */
1624
1625 printk("%s: Shutting %s down CSR0 %#06x\n", dev->name, SK_NAME,
1626 (int) SK_read_reg(CSR0));
1627
1628 SK_write_reg(CSR0, CSR0_STOP); /* STOP the LANCE */
1629
1630 free_irq(dev->irq, dev); /* Free IRQ */
1631
1632 return 0; /* always succeed */
1633
1634} /* End of SK_close() */
1635
1636
1637/*-
1638 * Function : SK_get_stats
1639 * Author : Patrick J.D. Weichmann
1640 * Date Created : 94/05/26
1641 *
1642 * Description : Return current status structure to upper layers.
1643 * It is called by sprintf_stats (dev.c).
1644 *
1645 * Parameters : I : struct net_device *dev - our device structure
1646 * Return Value : struct net_device_stats * - our current statistics
1647 * Errors : None
1648 * Side Effects : None
1649 * Update History :
1650 * YY/MM/DD uid Description
1651-*/
1652
1653static struct net_device_stats *SK_get_stats(struct net_device *dev)
1654{
1655
1656 struct priv *p = netdev_priv(dev);
1657
1658 PRINTK(("## %s: SK_get_stats(). CSR0: %#06x\n",
1659 SK_NAME, SK_read_reg(CSR0)));
1660
1661 return &p->stats; /* Return Device status */
1662
1663} /* End of SK_get_stats() */
1664
1665
1666/*-
1667 * Function : set_multicast_list
1668 * Author : Patrick J.D. Weichmann
1669 * Date Created : 94/05/26
1670 *
1671 * Description : This function gets called when a program performs
1672 * a SIOCSIFFLAGS call. Ifconfig does this if you call
1673 * 'ifconfig [-]allmulti' which enables or disables the
1674 * Promiscuous mode.
1675 * Promiscuous mode is when the Network card accepts all
1676 * packets, not only the packets which match our MAC
1677 * Address. It is useful for writing a network monitor,
1678 * but it is also a security problem. You have to remember
1679 * that all information on the net is not encrypted.
1680 *
1681 * Parameters : I : struct net_device *dev - SK_G16 device Structure
1682 * Return Value : None
1683 * Errors : None
1684 * Globals : None
1685 * Update History :
1686 * YY/MM/DD uid Description
1687 * 95/10/18 ACox New multicast calling scheme
1688-*/
1689
1690
1691/* Set or clear the multicast filter for SK_G16.
1692 */
1693
1694static void set_multicast_list(struct net_device *dev)
1695{
1696
1697 if (dev->flags&IFF_PROMISC)
1698 {
1699 /* Reinitialize LANCE with MODE_PROM set */
1700 SK_lance_init(dev, MODE_PROM);
1701 }
1702 else if (dev->mc_count==0 && !(dev->flags&IFF_ALLMULTI))
1703 {
1704 /* Reinitialize LANCE without MODE_PROM */
1705 SK_lance_init(dev, MODE_NORMAL);
1706 }
1707 else
1708 {
1709 /* Multicast with logical address filter on */
1710 /* Reinitialize LANCE without MODE_PROM */
1711 SK_lance_init(dev, MODE_NORMAL);
1712
1713 /* Not implemented yet. */
1714 }
1715} /* End of set_multicast_list() */
1716
1717
1718
1719/*-
1720 * Function : SK_rom_addr
1721 * Author : Patrick J.D. Weichmann
1722 * Date Created : 94/06/01
1723 *
1724 * Description : Try to find a Boot_ROM at all possible locations
1725 *
1726 * Parameters : None
1727 * Return Value : Address where Boot_ROM is
1728 * Errors : 0 - Did not find Boot_ROM
1729 * Globals : None
1730 * Update History :
1731 * YY/MM/DD uid Description
1732-*/
1733
1734unsigned int __init SK_rom_addr(void)
1735{
1736 int i,j;
1737 int rom_found = 0;
1738 unsigned int rom_location[] = SK_BOOT_ROM_LOCATIONS;
1739 unsigned char rom_id[] = SK_BOOT_ROM_ID;
1740 unsigned char test_byte;
1741
1742 /* Autodetect Boot_ROM */
1743 PRINTK(("## %s: Autodetection of Boot_ROM\n", SK_NAME));
1744
1745 for (i = 0; (rom_location[i] != 0) && (rom_found == 0); i++)
1746 {
1747
1748 PRINTK(("## Trying ROM location %#08x", rom_location[i]));
1749
1750 rom_found = 1;
1751 for (j = 0; j < 6; j++)
1752 {
1753 test_byte = readb(rom_location[i]+j);
1754 PRINTK((" %02x ", *test_byte));
1755
1756 if(test_byte != rom_id[j])
1757 {
1758 rom_found = 0;
1759 }
1760 }
1761 PRINTK(("\n"));
1762 }
1763
1764 if (rom_found == 1)
1765 {
1766 PRINTK(("## %s: Boot_ROM found at %#08x\n",
1767 SK_NAME, rom_location[(i-1)]));
1768
1769 return (rom_location[--i]);
1770 }
1771 else
1772 {
1773 PRINTK(("%s: No Boot_ROM found\n", SK_NAME));
1774 return 0;
1775 }
1776} /* End of SK_rom_addr() */
1777
1778
1779
1780/* LANCE access functions
1781 *
1782 * ! CSR1-3 can only be accessed when in CSR0 the STOP bit is set !
1783 */
1784
1785
1786/*-
1787 * Function : SK_reset_board
1788 *
1789 * Author : Patrick J.D. Weichmann
1790 *
1791 * Date Created : 94/05/25
1792 *
1793 * Description : This function resets SK_G16 and all components, but
1794 * POS registers are not changed
1795 *
1796 * Parameters : None
1797 * Return Value : None
1798 * Errors : None
1799 * Globals : SK_RAM *board - SK_RAM structure pointer
1800 *
1801 * Update History :
1802 * YY/MM/DD uid Description
1803-*/
1804
1805void SK_reset_board(void)
1806{
1807 writeb(0x00, SK_PORT); /* Reset active */
1808 mdelay(5); /* Delay min 5ms */
1809 writeb(SK_RESET, SK_PORT); /* Set back to normal operation */
1810
1811} /* End of SK_reset_board() */
1812
1813
1814/*-
1815 * Function : SK_set_RAP
1816 * Author : Patrick J.D. Weichmann
1817 * Date Created : 94/05/25
1818 *
1819 * Description : Set LANCE Register Address Port to register
1820 * for later data transfer.
1821 *
1822 * Parameters : I : reg_number - which CSR to read/write from/to
1823 * Return Value : None
1824 * Errors : None
1825 * Globals : SK_RAM *board - SK_RAM structure pointer
1826 * Update History :
1827 * YY/MM/DD uid Description
1828-*/
1829
1830void SK_set_RAP(int reg_number)
1831{
1832 writew(reg_number, SK_IOREG);
1833 writeb(SK_RESET | SK_RAP | SK_WREG, SK_PORT);
1834 writeb(SK_DOIO, SK_IOCOM);
1835
1836 while (readb(SK_PORT) & SK_IORUN)
1837 barrier();
1838} /* End of SK_set_RAP() */
1839
1840
1841/*-
1842 * Function : SK_read_reg
1843 * Author : Patrick J.D. Weichmann
1844 * Date Created : 94/05/25
1845 *
1846 * Description : Set RAP and read data from a LANCE CSR register
1847 *
1848 * Parameters : I : reg_number - which CSR to read from
1849 * Return Value : Register contents
1850 * Errors : None
1851 * Globals : SK_RAM *board - SK_RAM structure pointer
1852 * Update History :
1853 * YY/MM/DD uid Description
1854-*/
1855
1856int SK_read_reg(int reg_number)
1857{
1858 SK_set_RAP(reg_number);
1859
1860 writeb(SK_RESET | SK_RDATA | SK_RREG, SK_PORT);
1861 writeb(SK_DOIO, SK_IOCOM);
1862
1863 while (readb(SK_PORT) & SK_IORUN)
1864 barrier();
1865 return (readw(SK_IOREG));
1866
1867} /* End of SK_read_reg() */
1868
1869
1870/*-
1871 * Function : SK_rread_reg
1872 * Author : Patrick J.D. Weichmann
1873 * Date Created : 94/05/28
1874 *
1875 * Description : Read data from preseted register.
1876 * This function requires that you know which
1877 * Register is actually set. Be aware that CSR1-3
1878 * can only be accessed when in CSR0 STOP is set.
1879 *
1880 * Return Value : Register contents
1881 * Errors : None
1882 * Globals : SK_RAM *board - SK_RAM structure pointer
1883 * Update History :
1884 * YY/MM/DD uid Description
1885-*/
1886
1887int SK_rread_reg(void)
1888{
1889 writeb(SK_RESET | SK_RDATA | SK_RREG, SK_PORT);
1890
1891 writeb(SK_DOIO, SK_IOCOM);
1892
1893 while (readb(SK_PORT) & SK_IORUN)
1894 barrier();
1895 return (readw(SK_IOREG));
1896
1897} /* End of SK_rread_reg() */
1898
1899
1900/*-
1901 * Function : SK_write_reg
1902 * Author : Patrick J.D. Weichmann
1903 * Date Created : 94/05/25
1904 *
1905 * Description : This function sets the RAP then fills in the
1906 * LANCE I/O Reg and starts Transfer to LANCE.
1907 * It waits until transfer has ended which is max. 7 ms
1908 * and then it returns.
1909 *
1910 * Parameters : I : reg_number - which CSR to write to
1911 * I : value - what value to fill into register
1912 * Return Value : None
1913 * Errors : None
1914 * Globals : SK_RAM *board - SK_RAM structure pointer
1915 * Update History :
1916 * YY/MM/DD uid Description
1917-*/
1918
1919void SK_write_reg(int reg_number, int value)
1920{
1921 SK_set_RAP(reg_number);
1922
1923 writew(value, SK_IOREG);
1924 writeb(SK_RESET | SK_RDATA | SK_WREG, SK_PORT);
1925 writeb(SK_DOIO, SK_IOCOM);
1926
1927 while (readb(SK_PORT) & SK_IORUN)
1928 barrier();
1929} /* End of SK_write_reg */
1930
1931
1932
1933/*
1934 * Debugging functions
1935 * -------------------
1936 */
1937
1938/*-
1939 * Function : SK_print_pos
1940 * Author : Patrick J.D. Weichmann
1941 * Date Created : 94/05/25
1942 *
1943 * Description : This function prints out the 4 POS (Programmable
1944 * Option Select) Registers. Used mainly to debug operation.
1945 *
1946 * Parameters : I : struct net_device *dev - SK_G16 device structure
1947 * I : char * - Text which will be printed as title
1948 * Return Value : None
1949 * Errors : None
1950 * Update History :
1951 * YY/MM/DD uid Description
1952-*/
1953
1954void SK_print_pos(struct net_device *dev, char *text)
1955{
1956 int ioaddr = dev->base_addr;
1957
1958 unsigned char pos0 = inb(SK_POS0),
1959 pos1 = inb(SK_POS1),
1960 pos2 = inb(SK_POS2),
1961 pos3 = inb(SK_POS3),
1962 pos4 = inb(SK_POS4);
1963
1964
1965 printk("## %s: %s.\n"
1966 "## pos0=%#4x pos1=%#4x pos2=%#04x pos3=%#08x pos4=%#04x\n",
1967 SK_NAME, text, pos0, pos1, pos2, (pos3<<14), pos4);
1968
1969} /* End of SK_print_pos() */
1970
1971
1972
1973/*-
1974 * Function : SK_print_dev
1975 * Author : Patrick J.D. Weichmann
1976 * Date Created : 94/05/25
1977 *
1978 * Description : This function simply prints out the important fields
1979 * of the device structure.
1980 *
1981 * Parameters : I : struct net_device *dev - SK_G16 device structure
1982 * I : char *text - Title for printing
1983 * Return Value : None
1984 * Errors : None
1985 * Update History :
1986 * YY/MM/DD uid Description
1987-*/
1988
1989void SK_print_dev(struct net_device *dev, char *text)
1990{
1991 if (dev == NULL)
1992 {
1993 printk("## %s: Device Structure. %s\n", SK_NAME, text);
1994 printk("## DEVICE == NULL\n");
1995 }
1996 else
1997 {
1998 printk("## %s: Device Structure. %s\n", SK_NAME, text);
1999 printk("## Device Name: %s Base Address: %#06lx IRQ: %d\n",
2000 dev->name, dev->base_addr, dev->irq);
2001
2002 printk("## next device: %#08x init function: %#08x\n",
2003 (int) dev->next, (int) dev->init);
2004 }
2005
2006} /* End of SK_print_dev() */
2007
2008
2009
2010/*-
2011 * Function : SK_print_ram
2012 * Author : Patrick J.D. Weichmann
2013 * Date Created : 94/06/02
2014 *
2015 * Description : This function is used to check how are things set up
2016 * in the 16KB RAM. Also the pointers to the receive and
2017 * transmit descriptor rings and rx and tx buffers locations.
2018 * It contains a minor bug in printing, but has no effect to the values
2019 * only newlines are not correct.
2020 *
2021 * Parameters : I : struct net_device *dev - SK_G16 device structure
2022 * Return Value : None
2023 * Errors : None
2024 * Globals : None
2025 * Update History :
2026 * YY/MM/DD uid Description
2027-*/
2028
2029void __init SK_print_ram(struct net_device *dev)
2030{
2031
2032 int i;
2033 struct priv *p = netdev_priv(dev);
2034
2035 printk("## %s: RAM Details.\n"
2036 "## RAM at %#08x tmdhead: %#08x rmdhead: %#08x initblock: %#08x\n",
2037 SK_NAME,
2038 (unsigned int) p->ram,
2039 (unsigned int) p->tmdhead,
2040 (unsigned int) p->rmdhead,
2041 (unsigned int) &(p->ram)->ib);
2042
2043 printk("## ");
2044
2045 for(i = 0; i < TMDNUM; i++)
2046 {
2047 if (!(i % 3)) /* Every third line do a newline */
2048 {
2049 printk("\n## ");
2050 }
2051 printk("tmdbufs%d: %#08x ", (i+1), (int) p->tmdbufs[i]);
2052 }
2053 printk("## ");
2054
2055 for(i = 0; i < RMDNUM; i++)
2056 {
2057 if (!(i % 3)) /* Every third line do a newline */
2058 {
2059 printk("\n## ");
2060 }
2061 printk("rmdbufs%d: %#08x ", (i+1), (int) p->rmdbufs[i]);
2062 }
2063 printk("\n");
2064
2065} /* End of SK_print_ram() */
2066
diff --git a/drivers/net/sk_g16.h b/drivers/net/sk_g16.h
deleted file mode 100644
index 0a5dc0908a04..000000000000
--- a/drivers/net/sk_g16.h
+++ /dev/null
@@ -1,165 +0,0 @@
1/*-
2 *
3 * This software may be used and distributed according to the terms
4 * of the GNU General Public License, incorporated herein by reference.
5 *
6 * Module : sk_g16.h
7 * Version : $Revision$
8 *
9 * Author : M.Hipp (mhipp@student.uni-tuebingen.de)
10 * changes by : Patrick J.D. Weichmann
11 *
12 * Date Created : 94/05/25
13 *
14 * Description : In here are all necessary definitions of
15 * the am7990 (LANCE) chip used for writing a
16 * network device driver which uses this chip
17 *
18 * $Log$
19-*/
20
21#ifndef SK_G16_H
22
23#define SK_G16_H
24
25
26/*
27 * Control and Status Register 0 (CSR0) bit definitions
28 *
29 * (R=Readable) (W=Writeable) (S=Set on write) (C-Clear on write)
30 *
31 */
32
33#define CSR0_ERR 0x8000 /* Error summary (R) */
34#define CSR0_BABL 0x4000 /* Babble transmitter timeout error (RC) */
35#define CSR0_CERR 0x2000 /* Collision Error (RC) */
36#define CSR0_MISS 0x1000 /* Missed packet (RC) */
37#define CSR0_MERR 0x0800 /* Memory Error (RC) */
38#define CSR0_RINT 0x0400 /* Receiver Interrupt (RC) */
39#define CSR0_TINT 0x0200 /* Transmit Interrupt (RC) */
40#define CSR0_IDON 0x0100 /* Initialization Done (RC) */
41#define CSR0_INTR 0x0080 /* Interrupt Flag (R) */
42#define CSR0_INEA 0x0040 /* Interrupt Enable (RW) */
43#define CSR0_RXON 0x0020 /* Receiver on (R) */
44#define CSR0_TXON 0x0010 /* Transmitter on (R) */
45#define CSR0_TDMD 0x0008 /* Transmit Demand (RS) */
46#define CSR0_STOP 0x0004 /* Stop (RS) */
47#define CSR0_STRT 0x0002 /* Start (RS) */
48#define CSR0_INIT 0x0001 /* Initialize (RS) */
49
50#define CSR0_CLRALL 0x7f00 /* mask for all clearable bits */
51
52/*
53 * Control and Status Register 3 (CSR3) bit definitions
54 *
55 */
56
57#define CSR3_BSWAP 0x0004 /* Byte Swap (RW) */
58#define CSR3_ACON 0x0002 /* ALE Control (RW) */
59#define CSR3_BCON 0x0001 /* Byte Control (RW) */
60
61/*
62 * Initialization Block Mode operation Bit Definitions.
63 */
64
65#define MODE_PROM 0x8000 /* Promiscuous Mode */
66#define MODE_INTL 0x0040 /* Internal Loopback */
67#define MODE_DRTY 0x0020 /* Disable Retry */
68#define MODE_COLL 0x0010 /* Force Collision */
69#define MODE_DTCR 0x0008 /* Disable Transmit CRC) */
70#define MODE_LOOP 0x0004 /* Loopback */
71#define MODE_DTX 0x0002 /* Disable the Transmitter */
72#define MODE_DRX 0x0001 /* Disable the Receiver */
73
74#define MODE_NORMAL 0x0000 /* Normal operation mode */
75
76/*
77 * Receive message descriptor status bit definitions.
78 */
79
80#define RX_OWN 0x80 /* Owner bit 0 = host, 1 = lance */
81#define RX_ERR 0x40 /* Error Summary */
82#define RX_FRAM 0x20 /* Framing Error */
83#define RX_OFLO 0x10 /* Overflow Error */
84#define RX_CRC 0x08 /* CRC Error */
85#define RX_BUFF 0x04 /* Buffer Error */
86#define RX_STP 0x02 /* Start of Packet */
87#define RX_ENP 0x01 /* End of Packet */
88
89
90/*
91 * Transmit message descriptor status bit definitions.
92 */
93
94#define TX_OWN 0x80 /* Owner bit 0 = host, 1 = lance */
95#define TX_ERR 0x40 /* Error Summary */
96#define TX_MORE 0x10 /* More the 1 retry needed to Xmit */
97#define TX_ONE 0x08 /* One retry needed to Xmit */
98#define TX_DEF 0x04 /* Deferred */
99#define TX_STP 0x02 /* Start of Packet */
100#define TX_ENP 0x01 /* End of Packet */
101
102/*
103 * Transmit status (2) (valid if TX_ERR == 1)
104 */
105
106#define TX_BUFF 0x8000 /* Buffering error (no ENP) */
107#define TX_UFLO 0x4000 /* Underflow (late memory) */
108#define TX_LCOL 0x1000 /* Late collision */
109#define TX_LCAR 0x0400 /* Loss of Carrier */
110#define TX_RTRY 0x0200 /* Failed after 16 retransmissions */
111#define TX_TDR 0x003f /* Time-domain-reflectometer-value */
112
113
114/*
115 * Structures used for Communication with the LANCE
116 */
117
118/* LANCE Initialize Block */
119
120struct init_block
121{
122 unsigned short mode; /* Mode Register */
123 unsigned char paddr[6]; /* Physical Address (MAC) */
124 unsigned char laddr[8]; /* Logical Filter Address (not used) */
125 unsigned int rdrp; /* Receive Descriptor Ring pointer */
126 unsigned int tdrp; /* Transmit Descriptor Ring pointer */
127};
128
129
130/* Receive Message Descriptor Entry */
131
132struct rmd
133{
134 union
135 {
136 unsigned long buffer; /* Address of buffer */
137 struct
138 {
139 unsigned char unused[3];
140 unsigned volatile char status; /* Status Bits */
141 } s;
142 } u;
143 volatile short blen; /* Buffer Length (two's complement) */
144 unsigned short mlen; /* Message Byte Count */
145};
146
147
148/* Transmit Message Descriptor Entry */
149
150struct tmd
151{
152 union
153 {
154 unsigned long buffer; /* Address of buffer */
155 struct
156 {
157 unsigned char unused[3];
158 unsigned volatile char status; /* Status Bits */
159 } s;
160 } u;
161 unsigned short blen; /* Buffer Length (two's complement) */
162 unsigned volatile short status2; /* Error Status Bits */
163};
164
165#endif /* End of SK_G16_H */
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
new file mode 100644
index 000000000000..30e8d589d167
--- /dev/null
+++ b/drivers/net/skge.c
@@ -0,0 +1,3386 @@
1/*
2 * New driver for Marvell Yukon chipset and SysKonnect Gigabit
3 * Ethernet adapters. Based on earlier sk98lin, e100 and
4 * FreeBSD if_sk drivers.
5 *
6 * This driver intentionally does not support all the features
7 * of the original driver such as link fail-over and link management because
8 * those should be done at higher levels.
9 *
10 * Copyright (C) 2004, Stephen Hemminger <shemminger@osdl.org>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26
27#include <linux/config.h>
28#include <linux/kernel.h>
29#include <linux/module.h>
30#include <linux/moduleparam.h>
31#include <linux/netdevice.h>
32#include <linux/etherdevice.h>
33#include <linux/ethtool.h>
34#include <linux/pci.h>
35#include <linux/if_vlan.h>
36#include <linux/ip.h>
37#include <linux/delay.h>
38#include <linux/crc32.h>
39#include <linux/dma-mapping.h>
40#include <asm/irq.h>
41
42#include "skge.h"
43
44#define DRV_NAME "skge"
45#define DRV_VERSION "0.6"
46#define PFX DRV_NAME " "
47
48#define DEFAULT_TX_RING_SIZE 128
49#define DEFAULT_RX_RING_SIZE 512
50#define MAX_TX_RING_SIZE 1024
51#define MAX_RX_RING_SIZE 4096
52#define PHY_RETRIES 1000
53#define ETH_JUMBO_MTU 9000
54#define TX_WATCHDOG (5 * HZ)
55#define NAPI_WEIGHT 64
56#define BLINK_HZ (HZ/4)
57#define LINK_POLL_HZ (HZ/10)
58
59MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver");
60MODULE_AUTHOR("Stephen Hemminger <shemminger@osdl.org>");
61MODULE_LICENSE("GPL");
62MODULE_VERSION(DRV_VERSION);
63
64static const u32 default_msg
65 = NETIF_MSG_DRV| NETIF_MSG_PROBE| NETIF_MSG_LINK
66 | NETIF_MSG_IFUP| NETIF_MSG_IFDOWN;
67
68static int debug = -1; /* defaults above */
69module_param(debug, int, 0);
70MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
71
72static const struct pci_device_id skge_id_table[] = {
73 { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940,
74 PCI_ANY_ID, PCI_ANY_ID },
75 { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940B,
76 PCI_ANY_ID, PCI_ANY_ID },
77 { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE,
78 PCI_ANY_ID, PCI_ANY_ID },
79 { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU,
80 PCI_ANY_ID, PCI_ANY_ID },
81 { PCI_VENDOR_ID_SYSKONNECT, 0x9E00, /* SK-9Exx */
82 PCI_ANY_ID, PCI_ANY_ID },
83 { PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T,
84 PCI_ANY_ID, PCI_ANY_ID },
85 { PCI_VENDOR_ID_MARVELL, 0x4320, /* Gigabit Ethernet Controller */
86 PCI_ANY_ID, PCI_ANY_ID },
87 { PCI_VENDOR_ID_MARVELL, 0x5005, /* Marvell (11ab), Belkin */
88 PCI_ANY_ID, PCI_ANY_ID },
89 { PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD,
90 PCI_ANY_ID, PCI_ANY_ID },
91 { PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1032,
92 PCI_ANY_ID, PCI_ANY_ID },
93 { PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1064,
94 PCI_ANY_ID, PCI_ANY_ID },
95 { 0 }
96};
97MODULE_DEVICE_TABLE(pci, skge_id_table);
98
99static int skge_up(struct net_device *dev);
100static int skge_down(struct net_device *dev);
101static void skge_tx_clean(struct skge_port *skge);
102static void skge_xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val);
103static void skge_gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val);
104static void genesis_get_stats(struct skge_port *skge, u64 *data);
105static void yukon_get_stats(struct skge_port *skge, u64 *data);
106static void yukon_init(struct skge_hw *hw, int port);
107static void yukon_reset(struct skge_hw *hw, int port);
108static void genesis_mac_init(struct skge_hw *hw, int port);
109static void genesis_reset(struct skge_hw *hw, int port);
110
111static const int txqaddr[] = { Q_XA1, Q_XA2 };
112static const int rxqaddr[] = { Q_R1, Q_R2 };
113static const u32 rxirqmask[] = { IS_R1_F, IS_R2_F };
114static const u32 txirqmask[] = { IS_XA1_F, IS_XA2_F };
115
116/* Don't need to look at whole 16K.
117 * last interesting register is descriptor poll timer.
118 */
119#define SKGE_REGS_LEN (29*128)
120
121static int skge_get_regs_len(struct net_device *dev)
122{
123 return SKGE_REGS_LEN;
124}
125
126/*
127 * Returns copy of control register region
128 * I/O region is divided into banks and certain regions are unreadable
129 */
130static void skge_get_regs(struct net_device *dev, struct ethtool_regs *regs,
131 void *p)
132{
133 const struct skge_port *skge = netdev_priv(dev);
134 unsigned long offs;
135 const void __iomem *io = skge->hw->regs;
136 static const unsigned long bankmap
137 = (1<<0) | (1<<2) | (1<<8) | (1<<9)
138 | (1<<12) | (1<<13) | (1<<14) | (1<<15) | (1<<16)
139 | (1<<17) | (1<<20) | (1<<21) | (1<<22) | (1<<23)
140 | (1<<24) | (1<<25) | (1<<26) | (1<<27) | (1<<28);
141
142 regs->version = 1;
143 for (offs = 0; offs < regs->len; offs += 128) {
144 u32 len = min_t(u32, 128, regs->len - offs);
145
146 if (bankmap & (1<<(offs/128)))
147 memcpy_fromio(p + offs, io + offs, len);
148 else
149 memset(p + offs, 0, len);
150 }
151}
152
153/* Wake on Lan only supported on Yukon chps with rev 1 or above */
154static int wol_supported(const struct skge_hw *hw)
155{
156 return !((hw->chip_id == CHIP_ID_GENESIS ||
157 (hw->chip_id == CHIP_ID_YUKON && chip_rev(hw) == 0)));
158}
159
160static void skge_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
161{
162 struct skge_port *skge = netdev_priv(dev);
163
164 wol->supported = wol_supported(skge->hw) ? WAKE_MAGIC : 0;
165 wol->wolopts = skge->wol ? WAKE_MAGIC : 0;
166}
167
168static int skge_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
169{
170 struct skge_port *skge = netdev_priv(dev);
171 struct skge_hw *hw = skge->hw;
172
173 if(wol->wolopts != WAKE_MAGIC && wol->wolopts != 0)
174 return -EOPNOTSUPP;
175
176 if (wol->wolopts == WAKE_MAGIC && !wol_supported(hw))
177 return -EOPNOTSUPP;
178
179 skge->wol = wol->wolopts == WAKE_MAGIC;
180
181 if (skge->wol) {
182 memcpy_toio(hw->regs + WOL_MAC_ADDR, dev->dev_addr, ETH_ALEN);
183
184 skge_write16(hw, WOL_CTRL_STAT,
185 WOL_CTL_ENA_PME_ON_MAGIC_PKT |
186 WOL_CTL_ENA_MAGIC_PKT_UNIT);
187 } else
188 skge_write16(hw, WOL_CTRL_STAT, WOL_CTL_DEFAULT);
189
190 return 0;
191}
192
193
194static int skge_get_settings(struct net_device *dev,
195 struct ethtool_cmd *ecmd)
196{
197 struct skge_port *skge = netdev_priv(dev);
198 struct skge_hw *hw = skge->hw;
199
200 ecmd->transceiver = XCVR_INTERNAL;
201
202 if (iscopper(hw)) {
203 if (hw->chip_id == CHIP_ID_GENESIS)
204 ecmd->supported = SUPPORTED_1000baseT_Full
205 | SUPPORTED_1000baseT_Half
206 | SUPPORTED_Autoneg | SUPPORTED_TP;
207 else {
208 ecmd->supported = SUPPORTED_10baseT_Half
209 | SUPPORTED_10baseT_Full
210 | SUPPORTED_100baseT_Half
211 | SUPPORTED_100baseT_Full
212 | SUPPORTED_1000baseT_Half
213 | SUPPORTED_1000baseT_Full
214 | SUPPORTED_Autoneg| SUPPORTED_TP;
215
216 if (hw->chip_id == CHIP_ID_YUKON)
217 ecmd->supported &= ~SUPPORTED_1000baseT_Half;
218
219 else if (hw->chip_id == CHIP_ID_YUKON_FE)
220 ecmd->supported &= ~(SUPPORTED_1000baseT_Half
221 | SUPPORTED_1000baseT_Full);
222 }
223
224 ecmd->port = PORT_TP;
225 ecmd->phy_address = hw->phy_addr;
226 } else {
227 ecmd->supported = SUPPORTED_1000baseT_Full
228 | SUPPORTED_FIBRE
229 | SUPPORTED_Autoneg;
230
231 ecmd->port = PORT_FIBRE;
232 }
233
234 ecmd->advertising = skge->advertising;
235 ecmd->autoneg = skge->autoneg;
236 ecmd->speed = skge->speed;
237 ecmd->duplex = skge->duplex;
238 return 0;
239}
240
241static u32 skge_modes(const struct skge_hw *hw)
242{
243 u32 modes = ADVERTISED_Autoneg
244 | ADVERTISED_1000baseT_Full | ADVERTISED_1000baseT_Half
245 | ADVERTISED_100baseT_Full | ADVERTISED_100baseT_Half
246 | ADVERTISED_10baseT_Full | ADVERTISED_10baseT_Half;
247
248 if (iscopper(hw)) {
249 modes |= ADVERTISED_TP;
250 switch(hw->chip_id) {
251 case CHIP_ID_GENESIS:
252 modes &= ~(ADVERTISED_100baseT_Full
253 | ADVERTISED_100baseT_Half
254 | ADVERTISED_10baseT_Full
255 | ADVERTISED_10baseT_Half);
256 break;
257
258 case CHIP_ID_YUKON:
259 modes &= ~ADVERTISED_1000baseT_Half;
260 break;
261
262 case CHIP_ID_YUKON_FE:
263 modes &= ~(ADVERTISED_1000baseT_Half|ADVERTISED_1000baseT_Full);
264 break;
265 }
266 } else {
267 modes |= ADVERTISED_FIBRE;
268 modes &= ~ADVERTISED_1000baseT_Half;
269 }
270 return modes;
271}
272
273static int skge_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
274{
275 struct skge_port *skge = netdev_priv(dev);
276 const struct skge_hw *hw = skge->hw;
277
278 if (ecmd->autoneg == AUTONEG_ENABLE) {
279 if (ecmd->advertising & skge_modes(hw))
280 return -EINVAL;
281 } else {
282 switch(ecmd->speed) {
283 case SPEED_1000:
284 if (hw->chip_id == CHIP_ID_YUKON_FE)
285 return -EINVAL;
286 break;
287 case SPEED_100:
288 case SPEED_10:
289 if (iscopper(hw) || hw->chip_id == CHIP_ID_GENESIS)
290 return -EINVAL;
291 break;
292 default:
293 return -EINVAL;
294 }
295 }
296
297 skge->autoneg = ecmd->autoneg;
298 skge->speed = ecmd->speed;
299 skge->duplex = ecmd->duplex;
300 skge->advertising = ecmd->advertising;
301
302 if (netif_running(dev)) {
303 skge_down(dev);
304 skge_up(dev);
305 }
306 return (0);
307}
308
309static void skge_get_drvinfo(struct net_device *dev,
310 struct ethtool_drvinfo *info)
311{
312 struct skge_port *skge = netdev_priv(dev);
313
314 strcpy(info->driver, DRV_NAME);
315 strcpy(info->version, DRV_VERSION);
316 strcpy(info->fw_version, "N/A");
317 strcpy(info->bus_info, pci_name(skge->hw->pdev));
318}
319
320static const struct skge_stat {
321 char name[ETH_GSTRING_LEN];
322 u16 xmac_offset;
323 u16 gma_offset;
324} skge_stats[] = {
325 { "tx_bytes", XM_TXO_OK_HI, GM_TXO_OK_HI },
326 { "rx_bytes", XM_RXO_OK_HI, GM_RXO_OK_HI },
327
328 { "tx_broadcast", XM_TXF_BC_OK, GM_TXF_BC_OK },
329 { "rx_broadcast", XM_RXF_BC_OK, GM_RXF_BC_OK },
330 { "tx_multicast", XM_TXF_MC_OK, GM_TXF_MC_OK },
331 { "rx_multicast", XM_RXF_MC_OK, GM_RXF_MC_OK },
332 { "tx_unicast", XM_TXF_UC_OK, GM_TXF_UC_OK },
333 { "rx_unicast", XM_RXF_UC_OK, GM_RXF_UC_OK },
334 { "tx_mac_pause", XM_TXF_MPAUSE, GM_TXF_MPAUSE },
335 { "rx_mac_pause", XM_RXF_MPAUSE, GM_RXF_MPAUSE },
336
337 { "collisions", XM_TXF_SNG_COL, GM_TXF_SNG_COL },
338 { "multi_collisions", XM_TXF_MUL_COL, GM_TXF_MUL_COL },
339 { "aborted", XM_TXF_ABO_COL, GM_TXF_ABO_COL },
340 { "late_collision", XM_TXF_LAT_COL, GM_TXF_LAT_COL },
341 { "fifo_underrun", XM_TXE_FIFO_UR, GM_TXE_FIFO_UR },
342 { "fifo_overflow", XM_RXE_FIFO_OV, GM_RXE_FIFO_OV },
343
344 { "rx_toolong", XM_RXF_LNG_ERR, GM_RXF_LNG_ERR },
345 { "rx_jabber", XM_RXF_JAB_PKT, GM_RXF_JAB_PKT },
346 { "rx_runt", XM_RXE_RUNT, GM_RXE_FRAG },
347 { "rx_too_long", XM_RXF_LNG_ERR, GM_RXF_LNG_ERR },
348 { "rx_fcs_error", XM_RXF_FCS_ERR, GM_RXF_FCS_ERR },
349};
350
351static int skge_get_stats_count(struct net_device *dev)
352{
353 return ARRAY_SIZE(skge_stats);
354}
355
356static void skge_get_ethtool_stats(struct net_device *dev,
357 struct ethtool_stats *stats, u64 *data)
358{
359 struct skge_port *skge = netdev_priv(dev);
360
361 if (skge->hw->chip_id == CHIP_ID_GENESIS)
362 genesis_get_stats(skge, data);
363 else
364 yukon_get_stats(skge, data);
365}
366
367/* Use hardware MIB variables for critical path statistics and
368 * transmit feedback not reported at interrupt.
369 * Other errors are accounted for in interrupt handler.
370 */
371static struct net_device_stats *skge_get_stats(struct net_device *dev)
372{
373 struct skge_port *skge = netdev_priv(dev);
374 u64 data[ARRAY_SIZE(skge_stats)];
375
376 if (skge->hw->chip_id == CHIP_ID_GENESIS)
377 genesis_get_stats(skge, data);
378 else
379 yukon_get_stats(skge, data);
380
381 skge->net_stats.tx_bytes = data[0];
382 skge->net_stats.rx_bytes = data[1];
383 skge->net_stats.tx_packets = data[2] + data[4] + data[6];
384 skge->net_stats.rx_packets = data[3] + data[5] + data[7];
385 skge->net_stats.multicast = data[5] + data[7];
386 skge->net_stats.collisions = data[10];
387 skge->net_stats.tx_aborted_errors = data[12];
388
389 return &skge->net_stats;
390}
391
392static void skge_get_strings(struct net_device *dev, u32 stringset, u8 *data)
393{
394 int i;
395
396 switch(stringset) {
397 case ETH_SS_STATS:
398 for (i = 0; i < ARRAY_SIZE(skge_stats); i++)
399 memcpy(data + i * ETH_GSTRING_LEN,
400 skge_stats[i].name, ETH_GSTRING_LEN);
401 break;
402 }
403}
404
405static void skge_get_ring_param(struct net_device *dev,
406 struct ethtool_ringparam *p)
407{
408 struct skge_port *skge = netdev_priv(dev);
409
410 p->rx_max_pending = MAX_RX_RING_SIZE;
411 p->tx_max_pending = MAX_TX_RING_SIZE;
412 p->rx_mini_max_pending = 0;
413 p->rx_jumbo_max_pending = 0;
414
415 p->rx_pending = skge->rx_ring.count;
416 p->tx_pending = skge->tx_ring.count;
417 p->rx_mini_pending = 0;
418 p->rx_jumbo_pending = 0;
419}
420
421static int skge_set_ring_param(struct net_device *dev,
422 struct ethtool_ringparam *p)
423{
424 struct skge_port *skge = netdev_priv(dev);
425
426 if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE ||
427 p->tx_pending == 0 || p->tx_pending > MAX_TX_RING_SIZE)
428 return -EINVAL;
429
430 skge->rx_ring.count = p->rx_pending;
431 skge->tx_ring.count = p->tx_pending;
432
433 if (netif_running(dev)) {
434 skge_down(dev);
435 skge_up(dev);
436 }
437
438 return 0;
439}
440
441static u32 skge_get_msglevel(struct net_device *netdev)
442{
443 struct skge_port *skge = netdev_priv(netdev);
444 return skge->msg_enable;
445}
446
447static void skge_set_msglevel(struct net_device *netdev, u32 value)
448{
449 struct skge_port *skge = netdev_priv(netdev);
450 skge->msg_enable = value;
451}
452
453static int skge_nway_reset(struct net_device *dev)
454{
455 struct skge_port *skge = netdev_priv(dev);
456 struct skge_hw *hw = skge->hw;
457 int port = skge->port;
458
459 if (skge->autoneg != AUTONEG_ENABLE || !netif_running(dev))
460 return -EINVAL;
461
462 spin_lock_bh(&hw->phy_lock);
463 if (hw->chip_id == CHIP_ID_GENESIS) {
464 genesis_reset(hw, port);
465 genesis_mac_init(hw, port);
466 } else {
467 yukon_reset(hw, port);
468 yukon_init(hw, port);
469 }
470 spin_unlock_bh(&hw->phy_lock);
471 return 0;
472}
473
474static int skge_set_sg(struct net_device *dev, u32 data)
475{
476 struct skge_port *skge = netdev_priv(dev);
477 struct skge_hw *hw = skge->hw;
478
479 if (hw->chip_id == CHIP_ID_GENESIS && data)
480 return -EOPNOTSUPP;
481 return ethtool_op_set_sg(dev, data);
482}
483
484static int skge_set_tx_csum(struct net_device *dev, u32 data)
485{
486 struct skge_port *skge = netdev_priv(dev);
487 struct skge_hw *hw = skge->hw;
488
489 if (hw->chip_id == CHIP_ID_GENESIS && data)
490 return -EOPNOTSUPP;
491
492 return ethtool_op_set_tx_csum(dev, data);
493}
494
495static u32 skge_get_rx_csum(struct net_device *dev)
496{
497 struct skge_port *skge = netdev_priv(dev);
498
499 return skge->rx_csum;
500}
501
502/* Only Yukon supports checksum offload. */
503static int skge_set_rx_csum(struct net_device *dev, u32 data)
504{
505 struct skge_port *skge = netdev_priv(dev);
506
507 if (skge->hw->chip_id == CHIP_ID_GENESIS && data)
508 return -EOPNOTSUPP;
509
510 skge->rx_csum = data;
511 return 0;
512}
513
514/* Only Yukon II supports TSO (not implemented yet) */
515static int skge_set_tso(struct net_device *dev, u32 data)
516{
517 if (data)
518 return -EOPNOTSUPP;
519 return 0;
520}
521
522static void skge_get_pauseparam(struct net_device *dev,
523 struct ethtool_pauseparam *ecmd)
524{
525 struct skge_port *skge = netdev_priv(dev);
526
527 ecmd->tx_pause = (skge->flow_control == FLOW_MODE_LOC_SEND)
528 || (skge->flow_control == FLOW_MODE_SYMMETRIC);
529 ecmd->rx_pause = (skge->flow_control == FLOW_MODE_REM_SEND)
530 || (skge->flow_control == FLOW_MODE_SYMMETRIC);
531
532 ecmd->autoneg = skge->autoneg;
533}
534
535static int skge_set_pauseparam(struct net_device *dev,
536 struct ethtool_pauseparam *ecmd)
537{
538 struct skge_port *skge = netdev_priv(dev);
539
540 skge->autoneg = ecmd->autoneg;
541 if (ecmd->rx_pause && ecmd->tx_pause)
542 skge->flow_control = FLOW_MODE_SYMMETRIC;
543 else if(ecmd->rx_pause && !ecmd->tx_pause)
544 skge->flow_control = FLOW_MODE_REM_SEND;
545 else if(!ecmd->rx_pause && ecmd->tx_pause)
546 skge->flow_control = FLOW_MODE_LOC_SEND;
547 else
548 skge->flow_control = FLOW_MODE_NONE;
549
550 if (netif_running(dev)) {
551 skge_down(dev);
552 skge_up(dev);
553 }
554 return 0;
555}
556
557/* Chip internal frequency for clock calculations */
558static inline u32 hwkhz(const struct skge_hw *hw)
559{
560 if (hw->chip_id == CHIP_ID_GENESIS)
561 return 53215; /* or: 53.125 MHz */
562 else if (hw->chip_id == CHIP_ID_YUKON_EC)
563 return 125000; /* or: 125.000 MHz */
564 else
565 return 78215; /* or: 78.125 MHz */
566}
567
568/* Chip hz to microseconds */
569static inline u32 skge_clk2usec(const struct skge_hw *hw, u32 ticks)
570{
571 return (ticks * 1000) / hwkhz(hw);
572}
573
574/* Microseconds to chip hz */
575static inline u32 skge_usecs2clk(const struct skge_hw *hw, u32 usec)
576{
577 return hwkhz(hw) * usec / 1000;
578}
579
580static int skge_get_coalesce(struct net_device *dev,
581 struct ethtool_coalesce *ecmd)
582{
583 struct skge_port *skge = netdev_priv(dev);
584 struct skge_hw *hw = skge->hw;
585 int port = skge->port;
586
587 ecmd->rx_coalesce_usecs = 0;
588 ecmd->tx_coalesce_usecs = 0;
589
590 if (skge_read32(hw, B2_IRQM_CTRL) & TIM_START) {
591 u32 delay = skge_clk2usec(hw, skge_read32(hw, B2_IRQM_INI));
592 u32 msk = skge_read32(hw, B2_IRQM_MSK);
593
594 if (msk & rxirqmask[port])
595 ecmd->rx_coalesce_usecs = delay;
596 if (msk & txirqmask[port])
597 ecmd->tx_coalesce_usecs = delay;
598 }
599
600 return 0;
601}
602
603/* Note: interrupt timer is per board, but can turn on/off per port */
604static int skge_set_coalesce(struct net_device *dev,
605 struct ethtool_coalesce *ecmd)
606{
607 struct skge_port *skge = netdev_priv(dev);
608 struct skge_hw *hw = skge->hw;
609 int port = skge->port;
610 u32 msk = skge_read32(hw, B2_IRQM_MSK);
611 u32 delay = 25;
612
613 if (ecmd->rx_coalesce_usecs == 0)
614 msk &= ~rxirqmask[port];
615 else if (ecmd->rx_coalesce_usecs < 25 ||
616 ecmd->rx_coalesce_usecs > 33333)
617 return -EINVAL;
618 else {
619 msk |= rxirqmask[port];
620 delay = ecmd->rx_coalesce_usecs;
621 }
622
623 if (ecmd->tx_coalesce_usecs == 0)
624 msk &= ~txirqmask[port];
625 else if (ecmd->tx_coalesce_usecs < 25 ||
626 ecmd->tx_coalesce_usecs > 33333)
627 return -EINVAL;
628 else {
629 msk |= txirqmask[port];
630 delay = min(delay, ecmd->rx_coalesce_usecs);
631 }
632
633 skge_write32(hw, B2_IRQM_MSK, msk);
634 if (msk == 0)
635 skge_write32(hw, B2_IRQM_CTRL, TIM_STOP);
636 else {
637 skge_write32(hw, B2_IRQM_INI, skge_usecs2clk(hw, delay));
638 skge_write32(hw, B2_IRQM_CTRL, TIM_START);
639 }
640 return 0;
641}
642
643static void skge_led_on(struct skge_hw *hw, int port)
644{
645 if (hw->chip_id == CHIP_ID_GENESIS) {
646 skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_ON);
647 skge_write8(hw, B0_LED, LED_STAT_ON);
648
649 skge_write8(hw, SKGEMAC_REG(port, RX_LED_TST), LED_T_ON);
650 skge_write32(hw, SKGEMAC_REG(port, RX_LED_VAL), 100);
651 skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_START);
652
653 switch (hw->phy_type) {
654 case SK_PHY_BCOM:
655 skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL,
656 PHY_B_PEC_LED_ON);
657 break;
658 case SK_PHY_LONE:
659 skge_xm_phy_write(hw, port, PHY_LONE_LED_CFG,
660 0x0800);
661 break;
662 default:
663 skge_write8(hw, SKGEMAC_REG(port, TX_LED_TST), LED_T_ON);
664 skge_write32(hw, SKGEMAC_REG(port, TX_LED_VAL), 100);
665 skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_START);
666 }
667 } else {
668 skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0);
669 skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER,
670 PHY_M_LED_MO_DUP(MO_LED_ON) |
671 PHY_M_LED_MO_10(MO_LED_ON) |
672 PHY_M_LED_MO_100(MO_LED_ON) |
673 PHY_M_LED_MO_1000(MO_LED_ON) |
674 PHY_M_LED_MO_RX(MO_LED_ON));
675 }
676}
677
678static void skge_led_off(struct skge_hw *hw, int port)
679{
680 if (hw->chip_id == CHIP_ID_GENESIS) {
681 skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_OFF);
682 skge_write8(hw, B0_LED, LED_STAT_OFF);
683
684 skge_write32(hw, SKGEMAC_REG(port, RX_LED_VAL), 0);
685 skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_T_OFF);
686
687 switch (hw->phy_type) {
688 case SK_PHY_BCOM:
689 skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL,
690 PHY_B_PEC_LED_OFF);
691 break;
692 case SK_PHY_LONE:
693 skge_xm_phy_write(hw, port, PHY_LONE_LED_CFG,
694 PHY_L_LC_LEDT);
695 break;
696 default:
697 skge_write32(hw, SKGEMAC_REG(port, TX_LED_VAL), 0);
698 skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_T_OFF);
699 }
700 } else {
701 skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0);
702 skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER,
703 PHY_M_LED_MO_DUP(MO_LED_OFF) |
704 PHY_M_LED_MO_10(MO_LED_OFF) |
705 PHY_M_LED_MO_100(MO_LED_OFF) |
706 PHY_M_LED_MO_1000(MO_LED_OFF) |
707 PHY_M_LED_MO_RX(MO_LED_OFF));
708 }
709}
710
711static void skge_blink_timer(unsigned long data)
712{
713 struct skge_port *skge = (struct skge_port *) data;
714 struct skge_hw *hw = skge->hw;
715 unsigned long flags;
716
717 spin_lock_irqsave(&hw->phy_lock, flags);
718 if (skge->blink_on)
719 skge_led_on(hw, skge->port);
720 else
721 skge_led_off(hw, skge->port);
722 spin_unlock_irqrestore(&hw->phy_lock, flags);
723
724 skge->blink_on = !skge->blink_on;
725 mod_timer(&skge->led_blink, jiffies + BLINK_HZ);
726}
727
728/* blink LED's for finding board */
729static int skge_phys_id(struct net_device *dev, u32 data)
730{
731 struct skge_port *skge = netdev_priv(dev);
732
733 if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
734 data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
735
736 /* start blinking */
737 skge->blink_on = 1;
738 mod_timer(&skge->led_blink, jiffies+1);
739
740 msleep_interruptible(data * 1000);
741 del_timer_sync(&skge->led_blink);
742
743 skge_led_off(skge->hw, skge->port);
744
745 return 0;
746}
747
748static struct ethtool_ops skge_ethtool_ops = {
749 .get_settings = skge_get_settings,
750 .set_settings = skge_set_settings,
751 .get_drvinfo = skge_get_drvinfo,
752 .get_regs_len = skge_get_regs_len,
753 .get_regs = skge_get_regs,
754 .get_wol = skge_get_wol,
755 .set_wol = skge_set_wol,
756 .get_msglevel = skge_get_msglevel,
757 .set_msglevel = skge_set_msglevel,
758 .nway_reset = skge_nway_reset,
759 .get_link = ethtool_op_get_link,
760 .get_ringparam = skge_get_ring_param,
761 .set_ringparam = skge_set_ring_param,
762 .get_pauseparam = skge_get_pauseparam,
763 .set_pauseparam = skge_set_pauseparam,
764 .get_coalesce = skge_get_coalesce,
765 .set_coalesce = skge_set_coalesce,
766 .get_tso = ethtool_op_get_tso,
767 .set_tso = skge_set_tso,
768 .get_sg = ethtool_op_get_sg,
769 .set_sg = skge_set_sg,
770 .get_tx_csum = ethtool_op_get_tx_csum,
771 .set_tx_csum = skge_set_tx_csum,
772 .get_rx_csum = skge_get_rx_csum,
773 .set_rx_csum = skge_set_rx_csum,
774 .get_strings = skge_get_strings,
775 .phys_id = skge_phys_id,
776 .get_stats_count = skge_get_stats_count,
777 .get_ethtool_stats = skge_get_ethtool_stats,
778};
779
780/*
781 * Allocate ring elements and chain them together
782 * One-to-one association of board descriptors with ring elements
783 */
784static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u64 base)
785{
786 struct skge_tx_desc *d;
787 struct skge_element *e;
788 int i;
789
790 ring->start = kmalloc(sizeof(*e)*ring->count, GFP_KERNEL);
791 if (!ring->start)
792 return -ENOMEM;
793
794 for (i = 0, e = ring->start, d = vaddr; i < ring->count; i++, e++, d++) {
795 e->desc = d;
796 if (i == ring->count - 1) {
797 e->next = ring->start;
798 d->next_offset = base;
799 } else {
800 e->next = e + 1;
801 d->next_offset = base + (i+1) * sizeof(*d);
802 }
803 }
804 ring->to_use = ring->to_clean = ring->start;
805
806 return 0;
807}
808
809/* Setup buffer for receiving */
810static inline int skge_rx_alloc(struct skge_port *skge,
811 struct skge_element *e)
812{
813 unsigned long bufsize = skge->netdev->mtu + ETH_HLEN; /* VLAN? */
814 struct skge_rx_desc *rd = e->desc;
815 struct sk_buff *skb;
816 u64 map;
817
818 skb = dev_alloc_skb(bufsize + NET_IP_ALIGN);
819 if (unlikely(!skb)) {
820 printk(KERN_DEBUG PFX "%s: out of memory for receive\n",
821 skge->netdev->name);
822 return -ENOMEM;
823 }
824
825 skb->dev = skge->netdev;
826 skb_reserve(skb, NET_IP_ALIGN);
827
828 map = pci_map_single(skge->hw->pdev, skb->data, bufsize,
829 PCI_DMA_FROMDEVICE);
830
831 rd->dma_lo = map;
832 rd->dma_hi = map >> 32;
833 e->skb = skb;
834 rd->csum1_start = ETH_HLEN;
835 rd->csum2_start = ETH_HLEN;
836 rd->csum1 = 0;
837 rd->csum2 = 0;
838
839 wmb();
840
841 rd->control = BMU_OWN | BMU_STF | BMU_IRQ_EOF | BMU_TCP_CHECK | bufsize;
842 pci_unmap_addr_set(e, mapaddr, map);
843 pci_unmap_len_set(e, maplen, bufsize);
844 return 0;
845}
846
847/* Free all unused buffers in receive ring, assumes receiver stopped */
848static void skge_rx_clean(struct skge_port *skge)
849{
850 struct skge_hw *hw = skge->hw;
851 struct skge_ring *ring = &skge->rx_ring;
852 struct skge_element *e;
853
854 for (e = ring->to_clean; e != ring->to_use; e = e->next) {
855 struct skge_rx_desc *rd = e->desc;
856 rd->control = 0;
857
858 pci_unmap_single(hw->pdev,
859 pci_unmap_addr(e, mapaddr),
860 pci_unmap_len(e, maplen),
861 PCI_DMA_FROMDEVICE);
862 dev_kfree_skb(e->skb);
863 e->skb = NULL;
864 }
865 ring->to_clean = e;
866}
867
868/* Allocate buffers for receive ring
869 * For receive: to_use is refill location
870 * to_clean is next received frame.
871 *
872 * if (to_use == to_clean)
873 * then ring all frames in ring need buffers
874 * if (to_use->next == to_clean)
875 * then ring all frames in ring have buffers
876 */
877static int skge_rx_fill(struct skge_port *skge)
878{
879 struct skge_ring *ring = &skge->rx_ring;
880 struct skge_element *e;
881 int ret = 0;
882
883 for (e = ring->to_use; e->next != ring->to_clean; e = e->next) {
884 if (skge_rx_alloc(skge, e)) {
885 ret = 1;
886 break;
887 }
888
889 }
890 ring->to_use = e;
891
892 return ret;
893}
894
895static void skge_link_up(struct skge_port *skge)
896{
897 netif_carrier_on(skge->netdev);
898 if (skge->tx_avail > MAX_SKB_FRAGS + 1)
899 netif_wake_queue(skge->netdev);
900
901 if (netif_msg_link(skge))
902 printk(KERN_INFO PFX
903 "%s: Link is up at %d Mbps, %s duplex, flow control %s\n",
904 skge->netdev->name, skge->speed,
905 skge->duplex == DUPLEX_FULL ? "full" : "half",
906 (skge->flow_control == FLOW_MODE_NONE) ? "none" :
907 (skge->flow_control == FLOW_MODE_LOC_SEND) ? "tx only" :
908 (skge->flow_control == FLOW_MODE_REM_SEND) ? "rx only" :
909 (skge->flow_control == FLOW_MODE_SYMMETRIC) ? "tx and rx" :
910 "unknown");
911}
912
913static void skge_link_down(struct skge_port *skge)
914{
915 netif_carrier_off(skge->netdev);
916 netif_stop_queue(skge->netdev);
917
918 if (netif_msg_link(skge))
919 printk(KERN_INFO PFX "%s: Link is down.\n", skge->netdev->name);
920}
921
922static u16 skge_xm_phy_read(struct skge_hw *hw, int port, u16 reg)
923{
924 int i;
925 u16 v;
926
927 skge_xm_write16(hw, port, XM_PHY_ADDR, reg | hw->phy_addr);
928 v = skge_xm_read16(hw, port, XM_PHY_DATA);
929 if (hw->phy_type != SK_PHY_XMAC) {
930 for (i = 0; i < PHY_RETRIES; i++) {
931 udelay(1);
932 if (skge_xm_read16(hw, port, XM_MMU_CMD)
933 & XM_MMU_PHY_RDY)
934 goto ready;
935 }
936
937 printk(KERN_WARNING PFX "%s: phy read timed out\n",
938 hw->dev[port]->name);
939 return 0;
940 ready:
941 v = skge_xm_read16(hw, port, XM_PHY_DATA);
942 }
943
944 return v;
945}
946
947static void skge_xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val)
948{
949 int i;
950
951 skge_xm_write16(hw, port, XM_PHY_ADDR, reg | hw->phy_addr);
952 for (i = 0; i < PHY_RETRIES; i++) {
953 if (!(skge_xm_read16(hw, port, XM_MMU_CMD) & XM_MMU_PHY_BUSY))
954 goto ready;
955 cpu_relax();
956 }
957 printk(KERN_WARNING PFX "%s: phy write failed to come ready\n",
958 hw->dev[port]->name);
959
960
961 ready:
962 skge_xm_write16(hw, port, XM_PHY_DATA, val);
963 for (i = 0; i < PHY_RETRIES; i++) {
964 udelay(1);
965 if (!(skge_xm_read16(hw, port, XM_MMU_CMD) & XM_MMU_PHY_BUSY))
966 return;
967 }
968 printk(KERN_WARNING PFX "%s: phy write timed out\n",
969 hw->dev[port]->name);
970}
971
972static void genesis_init(struct skge_hw *hw)
973{
974 /* set blink source counter */
975 skge_write32(hw, B2_BSC_INI, (SK_BLK_DUR * SK_FACT_53) / 100);
976 skge_write8(hw, B2_BSC_CTRL, BSC_START);
977
978 /* configure mac arbiter */
979 skge_write16(hw, B3_MA_TO_CTRL, MA_RST_CLR);
980
981 /* configure mac arbiter timeout values */
982 skge_write8(hw, B3_MA_TOINI_RX1, SK_MAC_TO_53);
983 skge_write8(hw, B3_MA_TOINI_RX2, SK_MAC_TO_53);
984 skge_write8(hw, B3_MA_TOINI_TX1, SK_MAC_TO_53);
985 skge_write8(hw, B3_MA_TOINI_TX2, SK_MAC_TO_53);
986
987 skge_write8(hw, B3_MA_RCINI_RX1, 0);
988 skge_write8(hw, B3_MA_RCINI_RX2, 0);
989 skge_write8(hw, B3_MA_RCINI_TX1, 0);
990 skge_write8(hw, B3_MA_RCINI_TX2, 0);
991
992 /* configure packet arbiter timeout */
993 skge_write16(hw, B3_PA_CTRL, PA_RST_CLR);
994 skge_write16(hw, B3_PA_TOINI_RX1, SK_PKT_TO_MAX);
995 skge_write16(hw, B3_PA_TOINI_TX1, SK_PKT_TO_MAX);
996 skge_write16(hw, B3_PA_TOINI_RX2, SK_PKT_TO_MAX);
997 skge_write16(hw, B3_PA_TOINI_TX2, SK_PKT_TO_MAX);
998}
999
1000static void genesis_reset(struct skge_hw *hw, int port)
1001{
1002 int i;
1003 u64 zero = 0;
1004
1005 /* reset the statistics module */
1006 skge_xm_write32(hw, port, XM_GP_PORT, XM_GP_RES_STAT);
1007 skge_xm_write16(hw, port, XM_IMSK, 0xffff); /* disable XMAC IRQs */
1008 skge_xm_write32(hw, port, XM_MODE, 0); /* clear Mode Reg */
1009 skge_xm_write16(hw, port, XM_TX_CMD, 0); /* reset TX CMD Reg */
1010 skge_xm_write16(hw, port, XM_RX_CMD, 0); /* reset RX CMD Reg */
1011
1012 /* disable all PHY IRQs */
1013 if (hw->phy_type == SK_PHY_BCOM)
1014 skge_xm_write16(hw, port, PHY_BCOM_INT_MASK, 0xffff);
1015
1016 skge_xm_outhash(hw, port, XM_HSM, (u8 *) &zero);
1017 for (i = 0; i < 15; i++)
1018 skge_xm_outaddr(hw, port, XM_EXM(i), (u8 *) &zero);
1019 skge_xm_outhash(hw, port, XM_SRC_CHK, (u8 *) &zero);
1020}
1021
1022
1023static void genesis_mac_init(struct skge_hw *hw, int port)
1024{
1025 struct skge_port *skge = netdev_priv(hw->dev[port]);
1026 int i;
1027 u32 r;
1028 u16 id1;
1029 u16 ctrl1, ctrl2, ctrl3, ctrl4, ctrl5;
1030
1031 /* magic workaround patterns for Broadcom */
1032 static const struct {
1033 u16 reg;
1034 u16 val;
1035 } A1hack[] = {
1036 { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1104 },
1037 { 0x17, 0x0013 }, { 0x15, 0x0404 }, { 0x17, 0x8006 },
1038 { 0x15, 0x0132 }, { 0x17, 0x8006 }, { 0x15, 0x0232 },
1039 { 0x17, 0x800D }, { 0x15, 0x000F }, { 0x18, 0x0420 },
1040 }, C0hack[] = {
1041 { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1204 },
1042 { 0x17, 0x0013 }, { 0x15, 0x0A04 }, { 0x18, 0x0420 },
1043 };
1044
1045
1046 /* initialize Rx, Tx and Link LED */
1047 skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_ON);
1048 skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_LINKSYNC_ON);
1049
1050 skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_START);
1051 skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_START);
1052
1053 /* Unreset the XMAC. */
1054 skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_CLR_MAC_RST);
1055
1056 /*
1057 * Perform additional initialization for external PHYs,
1058 * namely for the 1000baseTX cards that use the XMAC's
1059 * GMII mode.
1060 */
1061 spin_lock_bh(&hw->phy_lock);
1062 if (hw->phy_type != SK_PHY_XMAC) {
1063 /* Take PHY out of reset. */
1064 r = skge_read32(hw, B2_GP_IO);
1065 if (port == 0)
1066 r |= GP_DIR_0|GP_IO_0;
1067 else
1068 r |= GP_DIR_2|GP_IO_2;
1069
1070 skge_write32(hw, B2_GP_IO, r);
1071 skge_read32(hw, B2_GP_IO);
1072
1073 /* Enable GMII mode on the XMAC. */
1074 skge_xm_write16(hw, port, XM_HW_CFG, XM_HW_GMII_MD);
1075
1076 id1 = skge_xm_phy_read(hw, port, PHY_XMAC_ID1);
1077
1078 /* Optimize MDIO transfer by suppressing preamble. */
1079 skge_xm_write16(hw, port, XM_MMU_CMD,
1080 skge_xm_read16(hw, port, XM_MMU_CMD)
1081 | XM_MMU_NO_PRE);
1082
1083 if (id1 == PHY_BCOM_ID1_C0) {
1084 /*
1085 * Workaround BCOM Errata for the C0 type.
1086 * Write magic patterns to reserved registers.
1087 */
1088 for (i = 0; i < ARRAY_SIZE(C0hack); i++)
1089 skge_xm_phy_write(hw, port,
1090 C0hack[i].reg, C0hack[i].val);
1091
1092 } else if (id1 == PHY_BCOM_ID1_A1) {
1093 /*
1094 * Workaround BCOM Errata for the A1 type.
1095 * Write magic patterns to reserved registers.
1096 */
1097 for (i = 0; i < ARRAY_SIZE(A1hack); i++)
1098 skge_xm_phy_write(hw, port,
1099 A1hack[i].reg, A1hack[i].val);
1100 }
1101
1102 /*
1103 * Workaround BCOM Errata (#10523) for all BCom PHYs.
1104 * Disable Power Management after reset.
1105 */
1106 r = skge_xm_phy_read(hw, port, PHY_BCOM_AUX_CTRL);
1107 skge_xm_phy_write(hw, port, PHY_BCOM_AUX_CTRL, r | PHY_B_AC_DIS_PM);
1108 }
1109
1110 /* Dummy read */
1111 skge_xm_read16(hw, port, XM_ISRC);
1112
1113 r = skge_xm_read32(hw, port, XM_MODE);
1114 skge_xm_write32(hw, port, XM_MODE, r|XM_MD_CSA);
1115
1116 /* We don't need the FCS appended to the packet. */
1117 r = skge_xm_read16(hw, port, XM_RX_CMD);
1118 skge_xm_write16(hw, port, XM_RX_CMD, r | XM_RX_STRIP_FCS);
1119
1120 /* We want short frames padded to 60 bytes. */
1121 r = skge_xm_read16(hw, port, XM_TX_CMD);
1122 skge_xm_write16(hw, port, XM_TX_CMD, r | XM_TX_AUTO_PAD);
1123
1124 /*
1125 * Enable the reception of all error frames. This is is
1126 * a necessary evil due to the design of the XMAC. The
1127 * XMAC's receive FIFO is only 8K in size, however jumbo
1128 * frames can be up to 9000 bytes in length. When bad
1129 * frame filtering is enabled, the XMAC's RX FIFO operates
1130 * in 'store and forward' mode. For this to work, the
1131 * entire frame has to fit into the FIFO, but that means
1132 * that jumbo frames larger than 8192 bytes will be
1133 * truncated. Disabling all bad frame filtering causes
1134 * the RX FIFO to operate in streaming mode, in which
1135 * case the XMAC will start transfering frames out of the
1136 * RX FIFO as soon as the FIFO threshold is reached.
1137 */
1138 r = skge_xm_read32(hw, port, XM_MODE);
1139 skge_xm_write32(hw, port, XM_MODE,
1140 XM_MD_RX_CRCE|XM_MD_RX_LONG|XM_MD_RX_RUNT|
1141 XM_MD_RX_ERR|XM_MD_RX_IRLE);
1142
1143 skge_xm_outaddr(hw, port, XM_SA, hw->dev[port]->dev_addr);
1144 skge_xm_outaddr(hw, port, XM_EXM(0), hw->dev[port]->dev_addr);
1145
1146 /*
1147 * Bump up the transmit threshold. This helps hold off transmit
1148 * underruns when we're blasting traffic from both ports at once.
1149 */
1150 skge_xm_write16(hw, port, XM_TX_THR, 512);
1151
1152 /* Configure MAC arbiter */
1153 skge_write16(hw, B3_MA_TO_CTRL, MA_RST_CLR);
1154
1155 /* configure timeout values */
1156 skge_write8(hw, B3_MA_TOINI_RX1, 72);
1157 skge_write8(hw, B3_MA_TOINI_RX2, 72);
1158 skge_write8(hw, B3_MA_TOINI_TX1, 72);
1159 skge_write8(hw, B3_MA_TOINI_TX2, 72);
1160
1161 skge_write8(hw, B3_MA_RCINI_RX1, 0);
1162 skge_write8(hw, B3_MA_RCINI_RX2, 0);
1163 skge_write8(hw, B3_MA_RCINI_TX1, 0);
1164 skge_write8(hw, B3_MA_RCINI_TX2, 0);
1165
1166 /* Configure Rx MAC FIFO */
1167 skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_RST_CLR);
1168 skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_ENA_TIM_PAT);
1169 skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_ENA_OP_MD);
1170
1171 /* Configure Tx MAC FIFO */
1172 skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_RST_CLR);
1173 skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_TX_CTRL_DEF);
1174 skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_ENA_OP_MD);
1175
1176 if (hw->dev[port]->mtu > ETH_DATA_LEN) {
1177 /* Enable frame flushing if jumbo frames used */
1178 skge_write16(hw, SKGEMAC_REG(port,RX_MFF_CTRL1), MFF_ENA_FLUSH);
1179 } else {
1180 /* enable timeout timers if normal frames */
1181 skge_write16(hw, B3_PA_CTRL,
1182 port == 0 ? PA_ENA_TO_TX1 : PA_ENA_TO_TX2);
1183 }
1184
1185
1186 r = skge_xm_read16(hw, port, XM_RX_CMD);
1187 if (hw->dev[port]->mtu > ETH_DATA_LEN)
1188 skge_xm_write16(hw, port, XM_RX_CMD, r | XM_RX_BIG_PK_OK);
1189 else
1190 skge_xm_write16(hw, port, XM_RX_CMD, r & ~(XM_RX_BIG_PK_OK));
1191
1192 switch (hw->phy_type) {
1193 case SK_PHY_XMAC:
1194 if (skge->autoneg == AUTONEG_ENABLE) {
1195 ctrl1 = PHY_X_AN_FD | PHY_X_AN_HD;
1196
1197 switch (skge->flow_control) {
1198 case FLOW_MODE_NONE:
1199 ctrl1 |= PHY_X_P_NO_PAUSE;
1200 break;
1201 case FLOW_MODE_LOC_SEND:
1202 ctrl1 |= PHY_X_P_ASYM_MD;
1203 break;
1204 case FLOW_MODE_SYMMETRIC:
1205 ctrl1 |= PHY_X_P_SYM_MD;
1206 break;
1207 case FLOW_MODE_REM_SEND:
1208 ctrl1 |= PHY_X_P_BOTH_MD;
1209 break;
1210 }
1211
1212 skge_xm_phy_write(hw, port, PHY_XMAC_AUNE_ADV, ctrl1);
1213 ctrl2 = PHY_CT_ANE | PHY_CT_RE_CFG;
1214 } else {
1215 ctrl2 = 0;
1216 if (skge->duplex == DUPLEX_FULL)
1217 ctrl2 |= PHY_CT_DUP_MD;
1218 }
1219
1220 skge_xm_phy_write(hw, port, PHY_XMAC_CTRL, ctrl2);
1221 break;
1222
1223 case SK_PHY_BCOM:
1224 ctrl1 = PHY_CT_SP1000;
1225 ctrl2 = 0;
1226 ctrl3 = PHY_SEL_TYPE;
1227 ctrl4 = PHY_B_PEC_EN_LTR;
1228 ctrl5 = PHY_B_AC_TX_TST;
1229
1230 if (skge->autoneg == AUTONEG_ENABLE) {
1231 /*
1232 * Workaround BCOM Errata #1 for the C5 type.
1233 * 1000Base-T Link Acquisition Failure in Slave Mode
1234 * Set Repeater/DTE bit 10 of the 1000Base-T Control Register
1235 */
1236 ctrl2 |= PHY_B_1000C_RD;
1237 if (skge->advertising & ADVERTISED_1000baseT_Half)
1238 ctrl2 |= PHY_B_1000C_AHD;
1239 if (skge->advertising & ADVERTISED_1000baseT_Full)
1240 ctrl2 |= PHY_B_1000C_AFD;
1241
1242 /* Set Flow-control capabilities */
1243 switch (skge->flow_control) {
1244 case FLOW_MODE_NONE:
1245 ctrl3 |= PHY_B_P_NO_PAUSE;
1246 break;
1247 case FLOW_MODE_LOC_SEND:
1248 ctrl3 |= PHY_B_P_ASYM_MD;
1249 break;
1250 case FLOW_MODE_SYMMETRIC:
1251 ctrl3 |= PHY_B_P_SYM_MD;
1252 break;
1253 case FLOW_MODE_REM_SEND:
1254 ctrl3 |= PHY_B_P_BOTH_MD;
1255 break;
1256 }
1257
1258 /* Restart Auto-negotiation */
1259 ctrl1 |= PHY_CT_ANE | PHY_CT_RE_CFG;
1260 } else {
1261 if (skge->duplex == DUPLEX_FULL)
1262 ctrl1 |= PHY_CT_DUP_MD;
1263
1264 ctrl2 |= PHY_B_1000C_MSE; /* set it to Slave */
1265 }
1266
1267 skge_xm_phy_write(hw, port, PHY_BCOM_1000T_CTRL, ctrl2);
1268 skge_xm_phy_write(hw, port, PHY_BCOM_AUNE_ADV, ctrl3);
1269
1270 if (skge->netdev->mtu > ETH_DATA_LEN) {
1271 ctrl4 |= PHY_B_PEC_HIGH_LA;
1272 ctrl5 |= PHY_B_AC_LONG_PACK;
1273
1274 skge_xm_phy_write(hw, port,PHY_BCOM_AUX_CTRL, ctrl5);
1275 }
1276
1277 skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, ctrl4);
1278 skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, ctrl1);
1279 break;
1280 }
1281 spin_unlock_bh(&hw->phy_lock);
1282
1283 /* Clear MIB counters */
1284 skge_xm_write16(hw, port, XM_STAT_CMD,
1285 XM_SC_CLR_RXC | XM_SC_CLR_TXC);
1286 /* Clear two times according to Errata #3 */
1287 skge_xm_write16(hw, port, XM_STAT_CMD,
1288 XM_SC_CLR_RXC | XM_SC_CLR_TXC);
1289
1290 /* Start polling for link status */
1291 mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ);
1292}
1293
1294static void genesis_stop(struct skge_port *skge)
1295{
1296 struct skge_hw *hw = skge->hw;
1297 int port = skge->port;
1298
1299 /* Clear Tx packet arbiter timeout IRQ */
1300 skge_write16(hw, B3_PA_CTRL,
1301 port == 0 ? PA_CLR_TO_TX1 : PA_CLR_TO_TX2);
1302
1303 /*
1304 * If the transfer stucks at the MAC the STOP command will not
1305 * terminate if we don't flush the XMAC's transmit FIFO !
1306 */
1307 skge_xm_write32(hw, port, XM_MODE,
1308 skge_xm_read32(hw, port, XM_MODE)|XM_MD_FTF);
1309
1310
1311 /* Reset the MAC */
1312 skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_SET_MAC_RST);
1313
1314 /* For external PHYs there must be special handling */
1315 if (hw->phy_type != SK_PHY_XMAC) {
1316 u32 reg = skge_read32(hw, B2_GP_IO);
1317
1318 if (port == 0) {
1319 reg |= GP_DIR_0;
1320 reg &= ~GP_IO_0;
1321 } else {
1322 reg |= GP_DIR_2;
1323 reg &= ~GP_IO_2;
1324 }
1325 skge_write32(hw, B2_GP_IO, reg);
1326 skge_read32(hw, B2_GP_IO);
1327 }
1328
1329 skge_xm_write16(hw, port, XM_MMU_CMD,
1330 skge_xm_read16(hw, port, XM_MMU_CMD)
1331 & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX));
1332
1333 skge_xm_read16(hw, port, XM_MMU_CMD);
1334}
1335
1336
1337static void genesis_get_stats(struct skge_port *skge, u64 *data)
1338{
1339 struct skge_hw *hw = skge->hw;
1340 int port = skge->port;
1341 int i;
1342 unsigned long timeout = jiffies + HZ;
1343
1344 skge_xm_write16(hw, port,
1345 XM_STAT_CMD, XM_SC_SNP_TXC | XM_SC_SNP_RXC);
1346
1347 /* wait for update to complete */
1348 while (skge_xm_read16(hw, port, XM_STAT_CMD)
1349 & (XM_SC_SNP_TXC | XM_SC_SNP_RXC)) {
1350 if (time_after(jiffies, timeout))
1351 break;
1352 udelay(10);
1353 }
1354
1355 /* special case for 64 bit octet counter */
1356 data[0] = (u64) skge_xm_read32(hw, port, XM_TXO_OK_HI) << 32
1357 | skge_xm_read32(hw, port, XM_TXO_OK_LO);
1358 data[1] = (u64) skge_xm_read32(hw, port, XM_RXO_OK_HI) << 32
1359 | skge_xm_read32(hw, port, XM_RXO_OK_LO);
1360
1361 for (i = 2; i < ARRAY_SIZE(skge_stats); i++)
1362 data[i] = skge_xm_read32(hw, port, skge_stats[i].xmac_offset);
1363}
1364
1365static void genesis_mac_intr(struct skge_hw *hw, int port)
1366{
1367 struct skge_port *skge = netdev_priv(hw->dev[port]);
1368 u16 status = skge_xm_read16(hw, port, XM_ISRC);
1369
1370 pr_debug("genesis_intr status %x\n", status);
1371 if (hw->phy_type == SK_PHY_XMAC) {
1372 /* LInk down, start polling for state change */
1373 if (status & XM_IS_INP_ASS) {
1374 skge_xm_write16(hw, port, XM_IMSK,
1375 skge_xm_read16(hw, port, XM_IMSK) | XM_IS_INP_ASS);
1376 mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ);
1377 }
1378 else if (status & XM_IS_AND)
1379 mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ);
1380 }
1381
1382 if (status & XM_IS_TXF_UR) {
1383 skge_xm_write32(hw, port, XM_MODE, XM_MD_FTF);
1384 ++skge->net_stats.tx_fifo_errors;
1385 }
1386 if (status & XM_IS_RXF_OV) {
1387 skge_xm_write32(hw, port, XM_MODE, XM_MD_FRF);
1388 ++skge->net_stats.rx_fifo_errors;
1389 }
1390}
1391
1392static void skge_gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val)
1393{
1394 int i;
1395
1396 skge_gma_write16(hw, port, GM_SMI_DATA, val);
1397 skge_gma_write16(hw, port, GM_SMI_CTRL,
1398 GM_SMI_CT_PHY_AD(hw->phy_addr) | GM_SMI_CT_REG_AD(reg));
1399 for (i = 0; i < PHY_RETRIES; i++) {
1400 udelay(1);
1401
1402 if (!(skge_gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY))
1403 break;
1404 }
1405}
1406
1407static u16 skge_gm_phy_read(struct skge_hw *hw, int port, u16 reg)
1408{
1409 int i;
1410
1411 skge_gma_write16(hw, port, GM_SMI_CTRL,
1412 GM_SMI_CT_PHY_AD(hw->phy_addr)
1413 | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD);
1414
1415 for (i = 0; i < PHY_RETRIES; i++) {
1416 udelay(1);
1417 if (skge_gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_RD_VAL)
1418 goto ready;
1419 }
1420
1421 printk(KERN_WARNING PFX "%s: phy read timeout\n",
1422 hw->dev[port]->name);
1423 return 0;
1424 ready:
1425 return skge_gma_read16(hw, port, GM_SMI_DATA);
1426}
1427
1428static void genesis_link_down(struct skge_port *skge)
1429{
1430 struct skge_hw *hw = skge->hw;
1431 int port = skge->port;
1432
1433 pr_debug("genesis_link_down\n");
1434
1435 skge_xm_write16(hw, port, XM_MMU_CMD,
1436 skge_xm_read16(hw, port, XM_MMU_CMD)
1437 & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX));
1438
1439 /* dummy read to ensure writing */
1440 (void) skge_xm_read16(hw, port, XM_MMU_CMD);
1441
1442 skge_link_down(skge);
1443}
1444
1445static void genesis_link_up(struct skge_port *skge)
1446{
1447 struct skge_hw *hw = skge->hw;
1448 int port = skge->port;
1449 u16 cmd;
1450 u32 mode, msk;
1451
1452 pr_debug("genesis_link_up\n");
1453 cmd = skge_xm_read16(hw, port, XM_MMU_CMD);
1454
1455 /*
1456 * enabling pause frame reception is required for 1000BT
1457 * because the XMAC is not reset if the link is going down
1458 */
1459 if (skge->flow_control == FLOW_MODE_NONE ||
1460 skge->flow_control == FLOW_MODE_LOC_SEND)
1461 cmd |= XM_MMU_IGN_PF;
1462 else
1463 /* Enable Pause Frame Reception */
1464 cmd &= ~XM_MMU_IGN_PF;
1465
1466 skge_xm_write16(hw, port, XM_MMU_CMD, cmd);
1467
1468 mode = skge_xm_read32(hw, port, XM_MODE);
1469 if (skge->flow_control == FLOW_MODE_SYMMETRIC ||
1470 skge->flow_control == FLOW_MODE_LOC_SEND) {
1471 /*
1472 * Configure Pause Frame Generation
1473 * Use internal and external Pause Frame Generation.
1474 * Sending pause frames is edge triggered.
1475 * Send a Pause frame with the maximum pause time if
1476 * internal oder external FIFO full condition occurs.
1477 * Send a zero pause time frame to re-start transmission.
1478 */
1479 /* XM_PAUSE_DA = '010000C28001' (default) */
1480 /* XM_MAC_PTIME = 0xffff (maximum) */
1481 /* remember this value is defined in big endian (!) */
1482 skge_xm_write16(hw, port, XM_MAC_PTIME, 0xffff);
1483
1484 mode |= XM_PAUSE_MODE;
1485 skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_ENA_PAUSE);
1486 } else {
1487 /*
1488 * disable pause frame generation is required for 1000BT
1489 * because the XMAC is not reset if the link is going down
1490 */
1491 /* Disable Pause Mode in Mode Register */
1492 mode &= ~XM_PAUSE_MODE;
1493
1494 skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_DIS_PAUSE);
1495 }
1496
1497 skge_xm_write32(hw, port, XM_MODE, mode);
1498
1499 msk = XM_DEF_MSK;
1500 if (hw->phy_type != SK_PHY_XMAC)
1501 msk |= XM_IS_INP_ASS; /* disable GP0 interrupt bit */
1502
1503 skge_xm_write16(hw, port, XM_IMSK, msk);
1504 skge_xm_read16(hw, port, XM_ISRC);
1505
1506 /* get MMU Command Reg. */
1507 cmd = skge_xm_read16(hw, port, XM_MMU_CMD);
1508 if (hw->phy_type != SK_PHY_XMAC && skge->duplex == DUPLEX_FULL)
1509 cmd |= XM_MMU_GMII_FD;
1510
1511 if (hw->phy_type == SK_PHY_BCOM) {
1512 /*
1513 * Workaround BCOM Errata (#10523) for all BCom Phys
1514 * Enable Power Management after link up
1515 */
1516 skge_xm_phy_write(hw, port, PHY_BCOM_AUX_CTRL,
1517 skge_xm_phy_read(hw, port, PHY_BCOM_AUX_CTRL)
1518 & ~PHY_B_AC_DIS_PM);
1519 skge_xm_phy_write(hw, port, PHY_BCOM_INT_MASK,
1520 PHY_B_DEF_MSK);
1521 }
1522
1523 /* enable Rx/Tx */
1524 skge_xm_write16(hw, port, XM_MMU_CMD,
1525 cmd | XM_MMU_ENA_RX | XM_MMU_ENA_TX);
1526 skge_link_up(skge);
1527}
1528
1529
1530static void genesis_bcom_intr(struct skge_port *skge)
1531{
1532 struct skge_hw *hw = skge->hw;
1533 int port = skge->port;
1534 u16 stat = skge_xm_phy_read(hw, port, PHY_BCOM_INT_STAT);
1535
1536 pr_debug("genesis_bcom intr stat=%x\n", stat);
1537
1538 /* Workaround BCom Errata:
1539 * enable and disable loopback mode if "NO HCD" occurs.
1540 */
1541 if (stat & PHY_B_IS_NO_HDCL) {
1542 u16 ctrl = skge_xm_phy_read(hw, port, PHY_BCOM_CTRL);
1543 skge_xm_phy_write(hw, port, PHY_BCOM_CTRL,
1544 ctrl | PHY_CT_LOOP);
1545 skge_xm_phy_write(hw, port, PHY_BCOM_CTRL,
1546 ctrl & ~PHY_CT_LOOP);
1547 }
1548
1549 stat = skge_xm_phy_read(hw, port, PHY_BCOM_STAT);
1550 if (stat & (PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE)) {
1551 u16 aux = skge_xm_phy_read(hw, port, PHY_BCOM_AUX_STAT);
1552 if ( !(aux & PHY_B_AS_LS) && netif_carrier_ok(skge->netdev))
1553 genesis_link_down(skge);
1554
1555 else if (stat & PHY_B_IS_LST_CHANGE) {
1556 if (aux & PHY_B_AS_AN_C) {
1557 switch (aux & PHY_B_AS_AN_RES_MSK) {
1558 case PHY_B_RES_1000FD:
1559 skge->duplex = DUPLEX_FULL;
1560 break;
1561 case PHY_B_RES_1000HD:
1562 skge->duplex = DUPLEX_HALF;
1563 break;
1564 }
1565
1566 switch (aux & PHY_B_AS_PAUSE_MSK) {
1567 case PHY_B_AS_PAUSE_MSK:
1568 skge->flow_control = FLOW_MODE_SYMMETRIC;
1569 break;
1570 case PHY_B_AS_PRR:
1571 skge->flow_control = FLOW_MODE_REM_SEND;
1572 break;
1573 case PHY_B_AS_PRT:
1574 skge->flow_control = FLOW_MODE_LOC_SEND;
1575 break;
1576 default:
1577 skge->flow_control = FLOW_MODE_NONE;
1578 }
1579 skge->speed = SPEED_1000;
1580 }
1581 genesis_link_up(skge);
1582 }
1583 else
1584 mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ);
1585 }
1586}
1587
1588/* Perodic poll of phy status to check for link transistion */
1589static void skge_link_timer(unsigned long __arg)
1590{
1591 struct skge_port *skge = (struct skge_port *) __arg;
1592 struct skge_hw *hw = skge->hw;
1593 int port = skge->port;
1594
1595 if (hw->chip_id != CHIP_ID_GENESIS || !netif_running(skge->netdev))
1596 return;
1597
1598 spin_lock_bh(&hw->phy_lock);
1599 if (hw->phy_type == SK_PHY_BCOM)
1600 genesis_bcom_intr(skge);
1601 else {
1602 int i;
1603 for (i = 0; i < 3; i++)
1604 if (skge_xm_read16(hw, port, XM_ISRC) & XM_IS_INP_ASS)
1605 break;
1606
1607 if (i == 3)
1608 mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ);
1609 else
1610 genesis_link_up(skge);
1611 }
1612 spin_unlock_bh(&hw->phy_lock);
1613}
1614
1615/* Marvell Phy Initailization */
1616static void yukon_init(struct skge_hw *hw, int port)
1617{
1618 struct skge_port *skge = netdev_priv(hw->dev[port]);
1619 u16 ctrl, ct1000, adv;
1620 u16 ledctrl, ledover;
1621
1622 pr_debug("yukon_init\n");
1623 if (skge->autoneg == AUTONEG_ENABLE) {
1624 u16 ectrl = skge_gm_phy_read(hw, port, PHY_MARV_EXT_CTRL);
1625
1626 ectrl &= ~(PHY_M_EC_M_DSC_MSK | PHY_M_EC_S_DSC_MSK |
1627 PHY_M_EC_MAC_S_MSK);
1628 ectrl |= PHY_M_EC_MAC_S(MAC_TX_CLK_25_MHZ);
1629
1630 /* on PHY 88E1111 there is a change for downshift control */
1631 if (hw->chip_id == CHIP_ID_YUKON_EC)
1632 ectrl |= PHY_M_EC_M_DSC_2(0) | PHY_M_EC_DOWN_S_ENA;
1633 else
1634 ectrl |= PHY_M_EC_M_DSC(0) | PHY_M_EC_S_DSC(1);
1635
1636 skge_gm_phy_write(hw, port, PHY_MARV_EXT_CTRL, ectrl);
1637 }
1638
1639 ctrl = skge_gm_phy_read(hw, port, PHY_MARV_CTRL);
1640 if (skge->autoneg == AUTONEG_DISABLE)
1641 ctrl &= ~PHY_CT_ANE;
1642
1643 ctrl |= PHY_CT_RESET;
1644 skge_gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl);
1645
1646 ctrl = 0;
1647 ct1000 = 0;
1648 adv = PHY_SEL_TYPE;
1649
1650 if (skge->autoneg == AUTONEG_ENABLE) {
1651 if (iscopper(hw)) {
1652 if (skge->advertising & ADVERTISED_1000baseT_Full)
1653 ct1000 |= PHY_M_1000C_AFD;
1654 if (skge->advertising & ADVERTISED_1000baseT_Half)
1655 ct1000 |= PHY_M_1000C_AHD;
1656 if (skge->advertising & ADVERTISED_100baseT_Full)
1657 adv |= PHY_M_AN_100_FD;
1658 if (skge->advertising & ADVERTISED_100baseT_Half)
1659 adv |= PHY_M_AN_100_HD;
1660 if (skge->advertising & ADVERTISED_10baseT_Full)
1661 adv |= PHY_M_AN_10_FD;
1662 if (skge->advertising & ADVERTISED_10baseT_Half)
1663 adv |= PHY_M_AN_10_HD;
1664
1665 /* Set Flow-control capabilities */
1666 switch (skge->flow_control) {
1667 case FLOW_MODE_NONE:
1668 adv |= PHY_B_P_NO_PAUSE;
1669 break;
1670 case FLOW_MODE_LOC_SEND:
1671 adv |= PHY_B_P_ASYM_MD;
1672 break;
1673 case FLOW_MODE_SYMMETRIC:
1674 adv |= PHY_B_P_SYM_MD;
1675 break;
1676 case FLOW_MODE_REM_SEND:
1677 adv |= PHY_B_P_BOTH_MD;
1678 break;
1679 }
1680 } else { /* special defines for FIBER (88E1011S only) */
1681 adv |= PHY_M_AN_1000X_AHD | PHY_M_AN_1000X_AFD;
1682
1683 /* Set Flow-control capabilities */
1684 switch (skge->flow_control) {
1685 case FLOW_MODE_NONE:
1686 adv |= PHY_M_P_NO_PAUSE_X;
1687 break;
1688 case FLOW_MODE_LOC_SEND:
1689 adv |= PHY_M_P_ASYM_MD_X;
1690 break;
1691 case FLOW_MODE_SYMMETRIC:
1692 adv |= PHY_M_P_SYM_MD_X;
1693 break;
1694 case FLOW_MODE_REM_SEND:
1695 adv |= PHY_M_P_BOTH_MD_X;
1696 break;
1697 }
1698 }
1699 /* Restart Auto-negotiation */
1700 ctrl |= PHY_CT_ANE | PHY_CT_RE_CFG;
1701 } else {
1702 /* forced speed/duplex settings */
1703 ct1000 = PHY_M_1000C_MSE;
1704
1705 if (skge->duplex == DUPLEX_FULL)
1706 ctrl |= PHY_CT_DUP_MD;
1707
1708 switch (skge->speed) {
1709 case SPEED_1000:
1710 ctrl |= PHY_CT_SP1000;
1711 break;
1712 case SPEED_100:
1713 ctrl |= PHY_CT_SP100;
1714 break;
1715 }
1716
1717 ctrl |= PHY_CT_RESET;
1718 }
1719
1720 if (hw->chip_id != CHIP_ID_YUKON_FE)
1721 skge_gm_phy_write(hw, port, PHY_MARV_1000T_CTRL, ct1000);
1722
1723 skge_gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, adv);
1724 skge_gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl);
1725
1726 /* Setup Phy LED's */
1727 ledctrl = PHY_M_LED_PULS_DUR(PULS_170MS);
1728 ledover = 0;
1729
1730 if (hw->chip_id == CHIP_ID_YUKON_FE) {
1731 /* on 88E3082 these bits are at 11..9 (shifted left) */
1732 ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) << 1;
1733
1734 skge_gm_phy_write(hw, port, PHY_MARV_FE_LED_PAR,
1735 ((skge_gm_phy_read(hw, port, PHY_MARV_FE_LED_PAR)
1736
1737 & ~PHY_M_FELP_LED1_MSK)
1738 | PHY_M_FELP_LED1_CTRL(LED_PAR_CTRL_ACT_BL)));
1739 } else {
1740 /* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */
1741 ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) | PHY_M_LEDC_TX_CTRL;
1742
1743 /* turn off the Rx LED (LED_RX) */
1744 ledover |= PHY_M_LED_MO_RX(MO_LED_OFF);
1745 }
1746
1747 /* disable blink mode (LED_DUPLEX) on collisions */
1748 ctrl |= PHY_M_LEDC_DP_CTRL;
1749 skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl);
1750
1751 if (skge->autoneg == AUTONEG_DISABLE || skge->speed == SPEED_100) {
1752 /* turn on 100 Mbps LED (LED_LINK100) */
1753 ledover |= PHY_M_LED_MO_100(MO_LED_ON);
1754 }
1755
1756 if (ledover)
1757 skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover);
1758
1759 /* Enable phy interrupt on autonegotiation complete (or link up) */
1760 if (skge->autoneg == AUTONEG_ENABLE)
1761 skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_AN_COMPL);
1762 else
1763 skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK);
1764}
1765
1766static void yukon_reset(struct skge_hw *hw, int port)
1767{
1768 skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0);/* disable PHY IRQs */
1769 skge_gma_write16(hw, port, GM_MC_ADDR_H1, 0); /* clear MC hash */
1770 skge_gma_write16(hw, port, GM_MC_ADDR_H2, 0);
1771 skge_gma_write16(hw, port, GM_MC_ADDR_H3, 0);
1772 skge_gma_write16(hw, port, GM_MC_ADDR_H4, 0);
1773
1774 skge_gma_write16(hw, port, GM_RX_CTRL,
1775 skge_gma_read16(hw, port, GM_RX_CTRL)
1776 | GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA);
1777}
1778
1779static void yukon_mac_init(struct skge_hw *hw, int port)
1780{
1781 struct skge_port *skge = netdev_priv(hw->dev[port]);
1782 int i;
1783 u32 reg;
1784 const u8 *addr = hw->dev[port]->dev_addr;
1785
1786 /* WA code for COMA mode -- set PHY reset */
1787 if (hw->chip_id == CHIP_ID_YUKON_LITE &&
1788 chip_rev(hw) == CHIP_REV_YU_LITE_A3)
1789 skge_write32(hw, B2_GP_IO,
1790 (skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9));
1791
1792 /* hard reset */
1793 skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), GPC_RST_SET);
1794 skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_RST_SET);
1795
1796 /* WA code for COMA mode -- clear PHY reset */
1797 if (hw->chip_id == CHIP_ID_YUKON_LITE &&
1798 chip_rev(hw) == CHIP_REV_YU_LITE_A3)
1799 skge_write32(hw, B2_GP_IO,
1800 (skge_read32(hw, B2_GP_IO) | GP_DIR_9)
1801 & ~GP_IO_9);
1802
1803 /* Set hardware config mode */
1804 reg = GPC_INT_POL_HI | GPC_DIS_FC | GPC_DIS_SLEEP |
1805 GPC_ENA_XC | GPC_ANEG_ADV_ALL_M | GPC_ENA_PAUSE;
1806 reg |= iscopper(hw) ? GPC_HWCFG_GMII_COP : GPC_HWCFG_GMII_FIB;
1807
1808 /* Clear GMC reset */
1809 skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), reg | GPC_RST_SET);
1810 skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), reg | GPC_RST_CLR);
1811 skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_ON | GMC_RST_CLR);
1812 if (skge->autoneg == AUTONEG_DISABLE) {
1813 reg = GM_GPCR_AU_ALL_DIS;
1814 skge_gma_write16(hw, port, GM_GP_CTRL,
1815 skge_gma_read16(hw, port, GM_GP_CTRL) | reg);
1816
1817 switch (skge->speed) {
1818 case SPEED_1000:
1819 reg |= GM_GPCR_SPEED_1000;
1820 /* fallthru */
1821 case SPEED_100:
1822 reg |= GM_GPCR_SPEED_100;
1823 }
1824
1825 if (skge->duplex == DUPLEX_FULL)
1826 reg |= GM_GPCR_DUP_FULL;
1827 } else
1828 reg = GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100 | GM_GPCR_DUP_FULL;
1829 switch (skge->flow_control) {
1830 case FLOW_MODE_NONE:
1831 skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
1832 reg |= GM_GPCR_FC_TX_DIS | GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS;
1833 break;
1834 case FLOW_MODE_LOC_SEND:
1835 /* disable Rx flow-control */
1836 reg |= GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS;
1837 }
1838
1839 skge_gma_write16(hw, port, GM_GP_CTRL, reg);
1840 skge_read16(hw, GMAC_IRQ_SRC);
1841
1842 spin_lock_bh(&hw->phy_lock);
1843 yukon_init(hw, port);
1844 spin_unlock_bh(&hw->phy_lock);
1845
1846 /* MIB clear */
1847 reg = skge_gma_read16(hw, port, GM_PHY_ADDR);
1848 skge_gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR);
1849
1850 for (i = 0; i < GM_MIB_CNT_SIZE; i++)
1851 skge_gma_read16(hw, port, GM_MIB_CNT_BASE + 8*i);
1852 skge_gma_write16(hw, port, GM_PHY_ADDR, reg);
1853
1854 /* transmit control */
1855 skge_gma_write16(hw, port, GM_TX_CTRL, TX_COL_THR(TX_COL_DEF));
1856
1857 /* receive control reg: unicast + multicast + no FCS */
1858 skge_gma_write16(hw, port, GM_RX_CTRL,
1859 GM_RXCR_UCF_ENA | GM_RXCR_CRC_DIS | GM_RXCR_MCF_ENA);
1860
1861 /* transmit flow control */
1862 skge_gma_write16(hw, port, GM_TX_FLOW_CTRL, 0xffff);
1863
1864 /* transmit parameter */
1865 skge_gma_write16(hw, port, GM_TX_PARAM,
1866 TX_JAM_LEN_VAL(TX_JAM_LEN_DEF) |
1867 TX_JAM_IPG_VAL(TX_JAM_IPG_DEF) |
1868 TX_IPG_JAM_DATA(TX_IPG_JAM_DEF));
1869
1870 /* serial mode register */
1871 reg = GM_SMOD_VLAN_ENA | IPG_DATA_VAL(IPG_DATA_DEF);
1872 if (hw->dev[port]->mtu > 1500)
1873 reg |= GM_SMOD_JUMBO_ENA;
1874
1875 skge_gma_write16(hw, port, GM_SERIAL_MODE, reg);
1876
1877 /* physical address: used for pause frames */
1878 skge_gm_set_addr(hw, port, GM_SRC_ADDR_1L, addr);
1879 /* virtual address for data */
1880 skge_gm_set_addr(hw, port, GM_SRC_ADDR_2L, addr);
1881
1882 /* enable interrupt mask for counter overflows */
1883 skge_gma_write16(hw, port, GM_TX_IRQ_MSK, 0);
1884 skge_gma_write16(hw, port, GM_RX_IRQ_MSK, 0);
1885 skge_gma_write16(hw, port, GM_TR_IRQ_MSK, 0);
1886
1887 /* Initialize Mac Fifo */
1888
1889 /* Configure Rx MAC FIFO */
1890 skge_write16(hw, SKGEMAC_REG(port, RX_GMF_FL_MSK), RX_FF_FL_DEF_MSK);
1891 reg = GMF_OPER_ON | GMF_RX_F_FL_ON;
1892 if (hw->chip_id == CHIP_ID_YUKON_LITE &&
1893 chip_rev(hw) == CHIP_REV_YU_LITE_A3)
1894 reg &= ~GMF_RX_F_FL_ON;
1895 skge_write8(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR);
1896 skge_write16(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), reg);
1897 skge_write16(hw, SKGEMAC_REG(port, RX_GMF_FL_THR), RX_GMF_FL_THR_DEF);
1898
1899 /* Configure Tx MAC FIFO */
1900 skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR);
1901 skge_write16(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON);
1902}
1903
1904static void yukon_stop(struct skge_port *skge)
1905{
1906 struct skge_hw *hw = skge->hw;
1907 int port = skge->port;
1908
1909 if (hw->chip_id == CHIP_ID_YUKON_LITE &&
1910 chip_rev(hw) == CHIP_REV_YU_LITE_A3) {
1911 skge_write32(hw, B2_GP_IO,
1912 skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9);
1913 }
1914
1915 skge_gma_write16(hw, port, GM_GP_CTRL,
1916 skge_gma_read16(hw, port, GM_GP_CTRL)
1917 & ~(GM_GPCR_RX_ENA|GM_GPCR_RX_ENA));
1918 skge_gma_read16(hw, port, GM_GP_CTRL);
1919
1920 /* set GPHY Control reset */
1921 skge_gma_write32(hw, port, GPHY_CTRL, GPC_RST_SET);
1922 skge_gma_write32(hw, port, GMAC_CTRL, GMC_RST_SET);
1923}
1924
1925static void yukon_get_stats(struct skge_port *skge, u64 *data)
1926{
1927 struct skge_hw *hw = skge->hw;
1928 int port = skge->port;
1929 int i;
1930
1931 data[0] = (u64) skge_gma_read32(hw, port, GM_TXO_OK_HI) << 32
1932 | skge_gma_read32(hw, port, GM_TXO_OK_LO);
1933 data[1] = (u64) skge_gma_read32(hw, port, GM_RXO_OK_HI) << 32
1934 | skge_gma_read32(hw, port, GM_RXO_OK_LO);
1935
1936 for (i = 2; i < ARRAY_SIZE(skge_stats); i++)
1937 data[i] = skge_gma_read32(hw, port,
1938 skge_stats[i].gma_offset);
1939}
1940
1941static void yukon_mac_intr(struct skge_hw *hw, int port)
1942{
1943 struct skge_port *skge = netdev_priv(hw->dev[port]);
1944 u8 status = skge_read8(hw, SKGEMAC_REG(port, GMAC_IRQ_SRC));
1945
1946 pr_debug("yukon_intr status %x\n", status);
1947 if (status & GM_IS_RX_FF_OR) {
1948 ++skge->net_stats.rx_fifo_errors;
1949 skge_gma_write8(hw, port, RX_GMF_CTRL_T, GMF_CLI_RX_FO);
1950 }
1951 if (status & GM_IS_TX_FF_UR) {
1952 ++skge->net_stats.tx_fifo_errors;
1953 skge_gma_write8(hw, port, TX_GMF_CTRL_T, GMF_CLI_TX_FU);
1954 }
1955
1956}
1957
1958static u16 yukon_speed(const struct skge_hw *hw, u16 aux)
1959{
1960 if (hw->chip_id == CHIP_ID_YUKON_FE)
1961 return (aux & PHY_M_PS_SPEED_100) ? SPEED_100 : SPEED_10;
1962
1963 switch(aux & PHY_M_PS_SPEED_MSK) {
1964 case PHY_M_PS_SPEED_1000:
1965 return SPEED_1000;
1966 case PHY_M_PS_SPEED_100:
1967 return SPEED_100;
1968 default:
1969 return SPEED_10;
1970 }
1971}
1972
1973static void yukon_link_up(struct skge_port *skge)
1974{
1975 struct skge_hw *hw = skge->hw;
1976 int port = skge->port;
1977 u16 reg;
1978
1979 pr_debug("yukon_link_up\n");
1980
1981 /* Enable Transmit FIFO Underrun */
1982 skge_write8(hw, GMAC_IRQ_MSK, GMAC_DEF_MSK);
1983
1984 reg = skge_gma_read16(hw, port, GM_GP_CTRL);
1985 if (skge->duplex == DUPLEX_FULL || skge->autoneg == AUTONEG_ENABLE)
1986 reg |= GM_GPCR_DUP_FULL;
1987
1988 /* enable Rx/Tx */
1989 reg |= GM_GPCR_RX_ENA | GM_GPCR_TX_ENA;
1990 skge_gma_write16(hw, port, GM_GP_CTRL, reg);
1991
1992 skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK);
1993 skge_link_up(skge);
1994}
1995
1996static void yukon_link_down(struct skge_port *skge)
1997{
1998 struct skge_hw *hw = skge->hw;
1999 int port = skge->port;
2000
2001 pr_debug("yukon_link_down\n");
2002 skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0);
2003 skge_gm_phy_write(hw, port, GM_GP_CTRL,
2004 skge_gm_phy_read(hw, port, GM_GP_CTRL)
2005 & ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA));
2006
2007 if (hw->chip_id != CHIP_ID_YUKON_FE &&
2008 skge->flow_control == FLOW_MODE_REM_SEND) {
2009 /* restore Asymmetric Pause bit */
2010 skge_gm_phy_write(hw, port, PHY_MARV_AUNE_ADV,
2011 skge_gm_phy_read(hw, port,
2012 PHY_MARV_AUNE_ADV)
2013 | PHY_M_AN_ASP);
2014
2015 }
2016
2017 yukon_reset(hw, port);
2018 skge_link_down(skge);
2019
2020 yukon_init(hw, port);
2021}
2022
2023static void yukon_phy_intr(struct skge_port *skge)
2024{
2025 struct skge_hw *hw = skge->hw;
2026 int port = skge->port;
2027 const char *reason = NULL;
2028 u16 istatus, phystat;
2029
2030 istatus = skge_gm_phy_read(hw, port, PHY_MARV_INT_STAT);
2031 phystat = skge_gm_phy_read(hw, port, PHY_MARV_PHY_STAT);
2032 pr_debug("yukon phy intr istat=%x phy_stat=%x\n", istatus, phystat);
2033
2034 if (istatus & PHY_M_IS_AN_COMPL) {
2035 if (skge_gm_phy_read(hw, port, PHY_MARV_AUNE_LP)
2036 & PHY_M_AN_RF) {
2037 reason = "remote fault";
2038 goto failed;
2039 }
2040
2041 if (!(hw->chip_id == CHIP_ID_YUKON_FE || hw->chip_id == CHIP_ID_YUKON_EC)
2042 && (skge_gm_phy_read(hw, port, PHY_MARV_1000T_STAT)
2043 & PHY_B_1000S_MSF)) {
2044 reason = "master/slave fault";
2045 goto failed;
2046 }
2047
2048 if (!(phystat & PHY_M_PS_SPDUP_RES)) {
2049 reason = "speed/duplex";
2050 goto failed;
2051 }
2052
2053 skge->duplex = (phystat & PHY_M_PS_FULL_DUP)
2054 ? DUPLEX_FULL : DUPLEX_HALF;
2055 skge->speed = yukon_speed(hw, phystat);
2056
2057 /* Tx & Rx Pause Enabled bits are at 9..8 */
2058 if (hw->chip_id == CHIP_ID_YUKON_XL)
2059 phystat >>= 6;
2060
2061 /* We are using IEEE 802.3z/D5.0 Table 37-4 */
2062 switch (phystat & PHY_M_PS_PAUSE_MSK) {
2063 case PHY_M_PS_PAUSE_MSK:
2064 skge->flow_control = FLOW_MODE_SYMMETRIC;
2065 break;
2066 case PHY_M_PS_RX_P_EN:
2067 skge->flow_control = FLOW_MODE_REM_SEND;
2068 break;
2069 case PHY_M_PS_TX_P_EN:
2070 skge->flow_control = FLOW_MODE_LOC_SEND;
2071 break;
2072 default:
2073 skge->flow_control = FLOW_MODE_NONE;
2074 }
2075
2076 if (skge->flow_control == FLOW_MODE_NONE ||
2077 (skge->speed < SPEED_1000 && skge->duplex == DUPLEX_HALF))
2078 skge_write8(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
2079 else
2080 skge_write8(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_ON);
2081 yukon_link_up(skge);
2082 return;
2083 }
2084
2085 if (istatus & PHY_M_IS_LSP_CHANGE)
2086 skge->speed = yukon_speed(hw, phystat);
2087
2088 if (istatus & PHY_M_IS_DUP_CHANGE)
2089 skge->duplex = (phystat & PHY_M_PS_FULL_DUP) ? DUPLEX_FULL : DUPLEX_HALF;
2090 if (istatus & PHY_M_IS_LST_CHANGE) {
2091 if (phystat & PHY_M_PS_LINK_UP)
2092 yukon_link_up(skge);
2093 else
2094 yukon_link_down(skge);
2095 }
2096 return;
2097 failed:
2098 printk(KERN_ERR PFX "%s: autonegotiation failed (%s)\n",
2099 skge->netdev->name, reason);
2100
2101 /* XXX restart autonegotiation? */
2102}
2103
2104static void skge_ramset(struct skge_hw *hw, u16 q, u32 start, size_t len)
2105{
2106 u32 end;
2107
2108 start /= 8;
2109 len /= 8;
2110 end = start + len - 1;
2111
2112 skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_RST_CLR);
2113 skge_write32(hw, RB_ADDR(q, RB_START), start);
2114 skge_write32(hw, RB_ADDR(q, RB_WP), start);
2115 skge_write32(hw, RB_ADDR(q, RB_RP), start);
2116 skge_write32(hw, RB_ADDR(q, RB_END), end);
2117
2118 if (q == Q_R1 || q == Q_R2) {
2119 /* Set thresholds on receive queue's */
2120 skge_write32(hw, RB_ADDR(q, RB_RX_UTPP),
2121 start + (2*len)/3);
2122 skge_write32(hw, RB_ADDR(q, RB_RX_LTPP),
2123 start + (len/3));
2124 } else {
2125 /* Enable store & forward on Tx queue's because
2126 * Tx FIFO is only 4K on Genesis and 1K on Yukon
2127 */
2128 skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_STFWD);
2129 }
2130
2131 skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_OP_MD);
2132}
2133
2134/* Setup Bus Memory Interface */
2135static void skge_qset(struct skge_port *skge, u16 q,
2136 const struct skge_element *e)
2137{
2138 struct skge_hw *hw = skge->hw;
2139 u32 watermark = 0x600;
2140 u64 base = skge->dma + (e->desc - skge->mem);
2141
2142 /* optimization to reduce window on 32bit/33mhz */
2143 if ((skge_read16(hw, B0_CTST) & (CS_BUS_CLOCK | CS_BUS_SLOT_SZ)) == 0)
2144 watermark /= 2;
2145
2146 skge_write32(hw, Q_ADDR(q, Q_CSR), CSR_CLR_RESET);
2147 skge_write32(hw, Q_ADDR(q, Q_F), watermark);
2148 skge_write32(hw, Q_ADDR(q, Q_DA_H), (u32)(base >> 32));
2149 skge_write32(hw, Q_ADDR(q, Q_DA_L), (u32)base);
2150}
2151
2152static int skge_up(struct net_device *dev)
2153{
2154 struct skge_port *skge = netdev_priv(dev);
2155 struct skge_hw *hw = skge->hw;
2156 int port = skge->port;
2157 u32 chunk, ram_addr;
2158 size_t rx_size, tx_size;
2159 int err;
2160
2161 if (netif_msg_ifup(skge))
2162 printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
2163
2164 rx_size = skge->rx_ring.count * sizeof(struct skge_rx_desc);
2165 tx_size = skge->tx_ring.count * sizeof(struct skge_tx_desc);
2166 skge->mem_size = tx_size + rx_size;
2167 skge->mem = pci_alloc_consistent(hw->pdev, skge->mem_size, &skge->dma);
2168 if (!skge->mem)
2169 return -ENOMEM;
2170
2171 memset(skge->mem, 0, skge->mem_size);
2172
2173 if ((err = skge_ring_alloc(&skge->rx_ring, skge->mem, skge->dma)))
2174 goto free_pci_mem;
2175
2176 if (skge_rx_fill(skge))
2177 goto free_rx_ring;
2178
2179 if ((err = skge_ring_alloc(&skge->tx_ring, skge->mem + rx_size,
2180 skge->dma + rx_size)))
2181 goto free_rx_ring;
2182
2183 skge->tx_avail = skge->tx_ring.count - 1;
2184
2185 /* Initialze MAC */
2186 if (hw->chip_id == CHIP_ID_GENESIS)
2187 genesis_mac_init(hw, port);
2188 else
2189 yukon_mac_init(hw, port);
2190
2191 /* Configure RAMbuffers */
2192 chunk = hw->ram_size / (isdualport(hw) ? 4 : 2);
2193 ram_addr = hw->ram_offset + 2 * chunk * port;
2194
2195 skge_ramset(hw, rxqaddr[port], ram_addr, chunk);
2196 skge_qset(skge, rxqaddr[port], skge->rx_ring.to_clean);
2197
2198 BUG_ON(skge->tx_ring.to_use != skge->tx_ring.to_clean);
2199 skge_ramset(hw, txqaddr[port], ram_addr+chunk, chunk);
2200 skge_qset(skge, txqaddr[port], skge->tx_ring.to_use);
2201
2202 /* Start receiver BMU */
2203 wmb();
2204 skge_write8(hw, Q_ADDR(rxqaddr[port], Q_CSR), CSR_START | CSR_IRQ_CL_F);
2205
2206 pr_debug("skge_up completed\n");
2207 return 0;
2208
2209 free_rx_ring:
2210 skge_rx_clean(skge);
2211 kfree(skge->rx_ring.start);
2212 free_pci_mem:
2213 pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma);
2214
2215 return err;
2216}
2217
2218static int skge_down(struct net_device *dev)
2219{
2220 struct skge_port *skge = netdev_priv(dev);
2221 struct skge_hw *hw = skge->hw;
2222 int port = skge->port;
2223
2224 if (netif_msg_ifdown(skge))
2225 printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
2226
2227 netif_stop_queue(dev);
2228
2229 del_timer_sync(&skge->led_blink);
2230 del_timer_sync(&skge->link_check);
2231
2232 /* Stop transmitter */
2233 skge_write8(hw, Q_ADDR(txqaddr[port], Q_CSR), CSR_STOP);
2234 skge_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL),
2235 RB_RST_SET|RB_DIS_OP_MD);
2236
2237 if (hw->chip_id == CHIP_ID_GENESIS)
2238 genesis_stop(skge);
2239 else
2240 yukon_stop(skge);
2241
2242 /* Disable Force Sync bit and Enable Alloc bit */
2243 skge_write8(hw, SKGEMAC_REG(port, TXA_CTRL),
2244 TXA_DIS_FSYNC | TXA_DIS_ALLOC | TXA_STOP_RC);
2245
2246 /* Stop Interval Timer and Limit Counter of Tx Arbiter */
2247 skge_write32(hw, SKGEMAC_REG(port, TXA_ITI_INI), 0L);
2248 skge_write32(hw, SKGEMAC_REG(port, TXA_LIM_INI), 0L);
2249
2250 /* Reset PCI FIFO */
2251 skge_write32(hw, Q_ADDR(txqaddr[port], Q_CSR), CSR_SET_RESET);
2252 skge_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), RB_RST_SET);
2253
2254 /* Reset the RAM Buffer async Tx queue */
2255 skge_write8(hw, RB_ADDR(port == 0 ? Q_XA1 : Q_XA2, RB_CTRL), RB_RST_SET);
2256 /* stop receiver */
2257 skge_write8(hw, Q_ADDR(rxqaddr[port], Q_CSR), CSR_STOP);
2258 skge_write32(hw, RB_ADDR(port ? Q_R2 : Q_R1, RB_CTRL),
2259 RB_RST_SET|RB_DIS_OP_MD);
2260 skge_write32(hw, Q_ADDR(rxqaddr[port], Q_CSR), CSR_SET_RESET);
2261
2262 if (hw->chip_id == CHIP_ID_GENESIS) {
2263 skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_RST_SET);
2264 skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_RST_SET);
2265 skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_STOP);
2266 skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_STOP);
2267 } else {
2268 skge_write8(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
2269 skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_RST_SET);
2270 }
2271
2272 /* turn off led's */
2273 skge_write16(hw, B0_LED, LED_STAT_OFF);
2274
2275 skge_tx_clean(skge);
2276 skge_rx_clean(skge);
2277
2278 kfree(skge->rx_ring.start);
2279 kfree(skge->tx_ring.start);
2280 pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma);
2281 return 0;
2282}
2283
2284static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev)
2285{
2286 struct skge_port *skge = netdev_priv(dev);
2287 struct skge_hw *hw = skge->hw;
2288 struct skge_ring *ring = &skge->tx_ring;
2289 struct skge_element *e;
2290 struct skge_tx_desc *td;
2291 int i;
2292 u32 control, len;
2293 u64 map;
2294 unsigned long flags;
2295
2296 skb = skb_padto(skb, ETH_ZLEN);
2297 if (!skb)
2298 return NETDEV_TX_OK;
2299
2300 local_irq_save(flags);
2301 if (!spin_trylock(&skge->tx_lock)) {
2302 /* Collision - tell upper layer to requeue */
2303 local_irq_restore(flags);
2304 return NETDEV_TX_LOCKED;
2305 }
2306
2307 if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) {
2308 netif_stop_queue(dev);
2309 spin_unlock_irqrestore(&skge->tx_lock, flags);
2310
2311 printk(KERN_WARNING PFX "%s: ring full when queue awake!\n",
2312 dev->name);
2313 return NETDEV_TX_BUSY;
2314 }
2315
2316 e = ring->to_use;
2317 td = e->desc;
2318 e->skb = skb;
2319 len = skb_headlen(skb);
2320 map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE);
2321 pci_unmap_addr_set(e, mapaddr, map);
2322 pci_unmap_len_set(e, maplen, len);
2323
2324 td->dma_lo = map;
2325 td->dma_hi = map >> 32;
2326
2327 if (skb->ip_summed == CHECKSUM_HW) {
2328 const struct iphdr *ip
2329 = (const struct iphdr *) (skb->data + ETH_HLEN);
2330 int offset = skb->h.raw - skb->data;
2331
2332 /* This seems backwards, but it is what the sk98lin
2333 * does. Looks like hardware is wrong?
2334 */
2335 if (ip->protocol == IPPROTO_UDP
2336 && chip_rev(hw) == 0 && hw->chip_id == CHIP_ID_YUKON)
2337 control = BMU_TCP_CHECK;
2338 else
2339 control = BMU_UDP_CHECK;
2340
2341 td->csum_offs = 0;
2342 td->csum_start = offset;
2343 td->csum_write = offset + skb->csum;
2344 } else
2345 control = BMU_CHECK;
2346
2347 if (!skb_shinfo(skb)->nr_frags) /* single buffer i.e. no fragments */
2348 control |= BMU_EOF| BMU_IRQ_EOF;
2349 else {
2350 struct skge_tx_desc *tf = td;
2351
2352 control |= BMU_STFWD;
2353 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
2354 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
2355
2356 map = pci_map_page(hw->pdev, frag->page, frag->page_offset,
2357 frag->size, PCI_DMA_TODEVICE);
2358
2359 e = e->next;
2360 e->skb = NULL;
2361 tf = e->desc;
2362 tf->dma_lo = map;
2363 tf->dma_hi = (u64) map >> 32;
2364 pci_unmap_addr_set(e, mapaddr, map);
2365 pci_unmap_len_set(e, maplen, frag->size);
2366
2367 tf->control = BMU_OWN | BMU_SW | control | frag->size;
2368 }
2369 tf->control |= BMU_EOF | BMU_IRQ_EOF;
2370 }
2371 /* Make sure all the descriptors written */
2372 wmb();
2373 td->control = BMU_OWN | BMU_SW | BMU_STF | control | len;
2374 wmb();
2375
2376 skge_write8(hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_START);
2377
2378 if (netif_msg_tx_queued(skge))
2379 printk(KERN_DEBUG "%s: tx queued, slot %td, len %d\n",
2380 dev->name, e - ring->start, skb->len);
2381
2382 ring->to_use = e->next;
2383 skge->tx_avail -= skb_shinfo(skb)->nr_frags + 1;
2384 if (skge->tx_avail <= MAX_SKB_FRAGS + 1) {
2385 pr_debug("%s: transmit queue full\n", dev->name);
2386 netif_stop_queue(dev);
2387 }
2388
2389 dev->trans_start = jiffies;
2390 spin_unlock_irqrestore(&skge->tx_lock, flags);
2391
2392 return NETDEV_TX_OK;
2393}
2394
2395static inline void skge_tx_free(struct skge_hw *hw, struct skge_element *e)
2396{
2397 if (e->skb) {
2398 pci_unmap_single(hw->pdev,
2399 pci_unmap_addr(e, mapaddr),
2400 pci_unmap_len(e, maplen),
2401 PCI_DMA_TODEVICE);
2402 dev_kfree_skb_any(e->skb);
2403 e->skb = NULL;
2404 } else {
2405 pci_unmap_page(hw->pdev,
2406 pci_unmap_addr(e, mapaddr),
2407 pci_unmap_len(e, maplen),
2408 PCI_DMA_TODEVICE);
2409 }
2410}
2411
2412static void skge_tx_clean(struct skge_port *skge)
2413{
2414 struct skge_ring *ring = &skge->tx_ring;
2415 struct skge_element *e;
2416 unsigned long flags;
2417
2418 spin_lock_irqsave(&skge->tx_lock, flags);
2419 for (e = ring->to_clean; e != ring->to_use; e = e->next) {
2420 ++skge->tx_avail;
2421 skge_tx_free(skge->hw, e);
2422 }
2423 ring->to_clean = e;
2424 spin_unlock_irqrestore(&skge->tx_lock, flags);
2425}
2426
2427static void skge_tx_timeout(struct net_device *dev)
2428{
2429 struct skge_port *skge = netdev_priv(dev);
2430
2431 if (netif_msg_timer(skge))
2432 printk(KERN_DEBUG PFX "%s: tx timeout\n", dev->name);
2433
2434 skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_STOP);
2435 skge_tx_clean(skge);
2436}
2437
2438static int skge_change_mtu(struct net_device *dev, int new_mtu)
2439{
2440 int err = 0;
2441
2442 if(new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU)
2443 return -EINVAL;
2444
2445 dev->mtu = new_mtu;
2446
2447 if (netif_running(dev)) {
2448 skge_down(dev);
2449 skge_up(dev);
2450 }
2451
2452 return err;
2453}
2454
2455static void genesis_set_multicast(struct net_device *dev)
2456{
2457 struct skge_port *skge = netdev_priv(dev);
2458 struct skge_hw *hw = skge->hw;
2459 int port = skge->port;
2460 int i, count = dev->mc_count;
2461 struct dev_mc_list *list = dev->mc_list;
2462 u32 mode;
2463 u8 filter[8];
2464
2465 mode = skge_xm_read32(hw, port, XM_MODE);
2466 mode |= XM_MD_ENA_HASH;
2467 if (dev->flags & IFF_PROMISC)
2468 mode |= XM_MD_ENA_PROM;
2469 else
2470 mode &= ~XM_MD_ENA_PROM;
2471
2472 if (dev->flags & IFF_ALLMULTI)
2473 memset(filter, 0xff, sizeof(filter));
2474 else {
2475 memset(filter, 0, sizeof(filter));
2476 for(i = 0; list && i < count; i++, list = list->next) {
2477 u32 crc = crc32_le(~0, list->dmi_addr, ETH_ALEN);
2478 u8 bit = 63 - (crc & 63);
2479
2480 filter[bit/8] |= 1 << (bit%8);
2481 }
2482 }
2483
2484 skge_xm_outhash(hw, port, XM_HSM, filter);
2485
2486 skge_xm_write32(hw, port, XM_MODE, mode);
2487}
2488
2489static void yukon_set_multicast(struct net_device *dev)
2490{
2491 struct skge_port *skge = netdev_priv(dev);
2492 struct skge_hw *hw = skge->hw;
2493 int port = skge->port;
2494 struct dev_mc_list *list = dev->mc_list;
2495 u16 reg;
2496 u8 filter[8];
2497
2498 memset(filter, 0, sizeof(filter));
2499
2500 reg = skge_gma_read16(hw, port, GM_RX_CTRL);
2501 reg |= GM_RXCR_UCF_ENA;
2502
2503 if (dev->flags & IFF_PROMISC) /* promiscious */
2504 reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA);
2505 else if (dev->flags & IFF_ALLMULTI) /* all multicast */
2506 memset(filter, 0xff, sizeof(filter));
2507 else if (dev->mc_count == 0) /* no multicast */
2508 reg &= ~GM_RXCR_MCF_ENA;
2509 else {
2510 int i;
2511 reg |= GM_RXCR_MCF_ENA;
2512
2513 for(i = 0; list && i < dev->mc_count; i++, list = list->next) {
2514 u32 bit = ether_crc(ETH_ALEN, list->dmi_addr) & 0x3f;
2515 filter[bit/8] |= 1 << (bit%8);
2516 }
2517 }
2518
2519
2520 skge_gma_write16(hw, port, GM_MC_ADDR_H1,
2521 (u16)filter[0] | ((u16)filter[1] << 8));
2522 skge_gma_write16(hw, port, GM_MC_ADDR_H2,
2523 (u16)filter[2] | ((u16)filter[3] << 8));
2524 skge_gma_write16(hw, port, GM_MC_ADDR_H3,
2525 (u16)filter[4] | ((u16)filter[5] << 8));
2526 skge_gma_write16(hw, port, GM_MC_ADDR_H4,
2527 (u16)filter[6] | ((u16)filter[7] << 8));
2528
2529 skge_gma_write16(hw, port, GM_RX_CTRL, reg);
2530}
2531
2532static inline int bad_phy_status(const struct skge_hw *hw, u32 status)
2533{
2534 if (hw->chip_id == CHIP_ID_GENESIS)
2535 return (status & (XMR_FS_ERR | XMR_FS_2L_VLAN)) != 0;
2536 else
2537 return (status & GMR_FS_ANY_ERR) ||
2538 (status & GMR_FS_RX_OK) == 0;
2539}
2540
2541static void skge_rx_error(struct skge_port *skge, int slot,
2542 u32 control, u32 status)
2543{
2544 if (netif_msg_rx_err(skge))
2545 printk(KERN_DEBUG PFX "%s: rx err, slot %d control 0x%x status 0x%x\n",
2546 skge->netdev->name, slot, control, status);
2547
2548 if ((control & (BMU_EOF|BMU_STF)) != (BMU_STF|BMU_EOF)
2549 || (control & BMU_BBC) > skge->netdev->mtu + VLAN_ETH_HLEN)
2550 skge->net_stats.rx_length_errors++;
2551 else {
2552 if (skge->hw->chip_id == CHIP_ID_GENESIS) {
2553 if (status & (XMR_FS_RUNT|XMR_FS_LNG_ERR))
2554 skge->net_stats.rx_length_errors++;
2555 if (status & XMR_FS_FRA_ERR)
2556 skge->net_stats.rx_frame_errors++;
2557 if (status & XMR_FS_FCS_ERR)
2558 skge->net_stats.rx_crc_errors++;
2559 } else {
2560 if (status & (GMR_FS_LONG_ERR|GMR_FS_UN_SIZE))
2561 skge->net_stats.rx_length_errors++;
2562 if (status & GMR_FS_FRAGMENT)
2563 skge->net_stats.rx_frame_errors++;
2564 if (status & GMR_FS_CRC_ERR)
2565 skge->net_stats.rx_crc_errors++;
2566 }
2567 }
2568}
2569
2570static int skge_poll(struct net_device *dev, int *budget)
2571{
2572 struct skge_port *skge = netdev_priv(dev);
2573 struct skge_hw *hw = skge->hw;
2574 struct skge_ring *ring = &skge->rx_ring;
2575 struct skge_element *e;
2576 unsigned int to_do = min(dev->quota, *budget);
2577 unsigned int work_done = 0;
2578 int done;
2579 static const u32 irqmask[] = { IS_PORT_1, IS_PORT_2 };
2580
2581 for (e = ring->to_clean; e != ring->to_use && work_done < to_do;
2582 e = e->next) {
2583 struct skge_rx_desc *rd = e->desc;
2584 struct sk_buff *skb = e->skb;
2585 u32 control, len, status;
2586
2587 rmb();
2588 control = rd->control;
2589 if (control & BMU_OWN)
2590 break;
2591
2592 len = control & BMU_BBC;
2593 e->skb = NULL;
2594
2595 pci_unmap_single(hw->pdev,
2596 pci_unmap_addr(e, mapaddr),
2597 pci_unmap_len(e, maplen),
2598 PCI_DMA_FROMDEVICE);
2599
2600 status = rd->status;
2601 if ((control & (BMU_EOF|BMU_STF)) != (BMU_STF|BMU_EOF)
2602 || len > dev->mtu + VLAN_ETH_HLEN
2603 || bad_phy_status(hw, status)) {
2604 skge_rx_error(skge, e - ring->start, control, status);
2605 dev_kfree_skb(skb);
2606 continue;
2607 }
2608
2609 if (netif_msg_rx_status(skge))
2610 printk(KERN_DEBUG PFX "%s: rx slot %td status 0x%x len %d\n",
2611 dev->name, e - ring->start, rd->status, len);
2612
2613 skb_put(skb, len);
2614 skb->protocol = eth_type_trans(skb, dev);
2615
2616 if (skge->rx_csum) {
2617 skb->csum = le16_to_cpu(rd->csum2);
2618 skb->ip_summed = CHECKSUM_HW;
2619 }
2620
2621 dev->last_rx = jiffies;
2622 netif_receive_skb(skb);
2623
2624 ++work_done;
2625 }
2626 ring->to_clean = e;
2627
2628 *budget -= work_done;
2629 dev->quota -= work_done;
2630 done = work_done < to_do;
2631
2632 if (skge_rx_fill(skge))
2633 done = 0;
2634
2635 /* restart receiver */
2636 wmb();
2637 skge_write8(hw, Q_ADDR(rxqaddr[skge->port], Q_CSR),
2638 CSR_START | CSR_IRQ_CL_F);
2639
2640 if (done) {
2641 local_irq_disable();
2642 hw->intr_mask |= irqmask[skge->port];
2643 /* Order is important since data can get interrupted */
2644 skge_write32(hw, B0_IMSK, hw->intr_mask);
2645 __netif_rx_complete(dev);
2646 local_irq_enable();
2647 }
2648
2649 return !done;
2650}
2651
2652static inline void skge_tx_intr(struct net_device *dev)
2653{
2654 struct skge_port *skge = netdev_priv(dev);
2655 struct skge_hw *hw = skge->hw;
2656 struct skge_ring *ring = &skge->tx_ring;
2657 struct skge_element *e;
2658
2659 spin_lock(&skge->tx_lock);
2660 for(e = ring->to_clean; e != ring->to_use; e = e->next) {
2661 struct skge_tx_desc *td = e->desc;
2662 u32 control;
2663
2664 rmb();
2665 control = td->control;
2666 if (control & BMU_OWN)
2667 break;
2668
2669 if (unlikely(netif_msg_tx_done(skge)))
2670 printk(KERN_DEBUG PFX "%s: tx done slot %td status 0x%x\n",
2671 dev->name, e - ring->start, td->status);
2672
2673 skge_tx_free(hw, e);
2674 e->skb = NULL;
2675 ++skge->tx_avail;
2676 }
2677 ring->to_clean = e;
2678 skge_write8(hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_IRQ_CL_F);
2679
2680 if (skge->tx_avail > MAX_SKB_FRAGS + 1)
2681 netif_wake_queue(dev);
2682
2683 spin_unlock(&skge->tx_lock);
2684}
2685
2686static void skge_mac_parity(struct skge_hw *hw, int port)
2687{
2688 printk(KERN_ERR PFX "%s: mac data parity error\n",
2689 hw->dev[port] ? hw->dev[port]->name
2690 : (port == 0 ? "(port A)": "(port B"));
2691
2692 if (hw->chip_id == CHIP_ID_GENESIS)
2693 skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1),
2694 MFF_CLR_PERR);
2695 else
2696 /* HW-Bug #8: cleared by GMF_CLI_TX_FC instead of GMF_CLI_TX_PE */
2697 skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T),
2698 (hw->chip_id == CHIP_ID_YUKON && chip_rev(hw) == 0)
2699 ? GMF_CLI_TX_FC : GMF_CLI_TX_PE);
2700}
2701
2702static void skge_pci_clear(struct skge_hw *hw)
2703{
2704 u16 status;
2705
2706 status = skge_read16(hw, SKGEPCI_REG(PCI_STATUS));
2707 skge_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
2708 skge_write16(hw, SKGEPCI_REG(PCI_STATUS),
2709 status | PCI_STATUS_ERROR_BITS);
2710 skge_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
2711}
2712
2713static void skge_mac_intr(struct skge_hw *hw, int port)
2714{
2715 if (hw->chip_id == CHIP_ID_GENESIS)
2716 genesis_mac_intr(hw, port);
2717 else
2718 yukon_mac_intr(hw, port);
2719}
2720
2721/* Handle device specific framing and timeout interrupts */
2722static void skge_error_irq(struct skge_hw *hw)
2723{
2724 u32 hwstatus = skge_read32(hw, B0_HWE_ISRC);
2725
2726 if (hw->chip_id == CHIP_ID_GENESIS) {
2727 /* clear xmac errors */
2728 if (hwstatus & (IS_NO_STAT_M1|IS_NO_TIST_M1))
2729 skge_write16(hw, SKGEMAC_REG(0, RX_MFF_CTRL1), MFF_CLR_INSTAT);
2730 if (hwstatus & (IS_NO_STAT_M2|IS_NO_TIST_M2))
2731 skge_write16(hw, SKGEMAC_REG(0, RX_MFF_CTRL2), MFF_CLR_INSTAT);
2732 } else {
2733 /* Timestamp (unused) overflow */
2734 if (hwstatus & IS_IRQ_TIST_OV)
2735 skge_write8(hw, GMAC_TI_ST_CTRL, GMT_ST_CLR_IRQ);
2736
2737 if (hwstatus & IS_IRQ_SENSOR) {
2738 /* no sensors on 32-bit Yukon */
2739 if (!(skge_read16(hw, B0_CTST) & CS_BUS_SLOT_SZ)) {
2740 printk(KERN_ERR PFX "ignoring bogus sensor interrups\n");
2741 skge_write32(hw, B0_HWE_IMSK,
2742 IS_ERR_MSK & ~IS_IRQ_SENSOR);
2743 } else
2744 printk(KERN_WARNING PFX "sensor interrupt\n");
2745 }
2746
2747
2748 }
2749
2750 if (hwstatus & IS_RAM_RD_PAR) {
2751 printk(KERN_ERR PFX "Ram read data parity error\n");
2752 skge_write16(hw, B3_RI_CTRL, RI_CLR_RD_PERR);
2753 }
2754
2755 if (hwstatus & IS_RAM_WR_PAR) {
2756 printk(KERN_ERR PFX "Ram write data parity error\n");
2757 skge_write16(hw, B3_RI_CTRL, RI_CLR_WR_PERR);
2758 }
2759
2760 if (hwstatus & IS_M1_PAR_ERR)
2761 skge_mac_parity(hw, 0);
2762
2763 if (hwstatus & IS_M2_PAR_ERR)
2764 skge_mac_parity(hw, 1);
2765
2766 if (hwstatus & IS_R1_PAR_ERR)
2767 skge_write32(hw, B0_R1_CSR, CSR_IRQ_CL_P);
2768
2769 if (hwstatus & IS_R2_PAR_ERR)
2770 skge_write32(hw, B0_R2_CSR, CSR_IRQ_CL_P);
2771
2772 if (hwstatus & (IS_IRQ_MST_ERR|IS_IRQ_STAT)) {
2773 printk(KERN_ERR PFX "hardware error detected (status 0x%x)\n",
2774 hwstatus);
2775
2776 skge_pci_clear(hw);
2777
2778 hwstatus = skge_read32(hw, B0_HWE_ISRC);
2779 if (hwstatus & IS_IRQ_STAT) {
2780 printk(KERN_WARNING PFX "IRQ status %x: still set ignoring hardware errors\n",
2781 hwstatus);
2782 hw->intr_mask &= ~IS_HW_ERR;
2783 }
2784 }
2785}
2786
2787/*
2788 * Interrrupt from PHY are handled in tasklet (soft irq)
2789 * because accessing phy registers requires spin wait which might
2790 * cause excess interrupt latency.
2791 */
2792static void skge_extirq(unsigned long data)
2793{
2794 struct skge_hw *hw = (struct skge_hw *) data;
2795 int port;
2796
2797 spin_lock(&hw->phy_lock);
2798 for (port = 0; port < 2; port++) {
2799 struct net_device *dev = hw->dev[port];
2800
2801 if (dev && netif_running(dev)) {
2802 struct skge_port *skge = netdev_priv(dev);
2803
2804 if (hw->chip_id != CHIP_ID_GENESIS)
2805 yukon_phy_intr(skge);
2806 else if (hw->phy_type == SK_PHY_BCOM)
2807 genesis_bcom_intr(skge);
2808 }
2809 }
2810 spin_unlock(&hw->phy_lock);
2811
2812 local_irq_disable();
2813 hw->intr_mask |= IS_EXT_REG;
2814 skge_write32(hw, B0_IMSK, hw->intr_mask);
2815 local_irq_enable();
2816}
2817
2818static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs)
2819{
2820 struct skge_hw *hw = dev_id;
2821 u32 status = skge_read32(hw, B0_SP_ISRC);
2822
2823 if (status == 0 || status == ~0) /* hotplug or shared irq */
2824 return IRQ_NONE;
2825
2826 status &= hw->intr_mask;
2827
2828 if ((status & IS_R1_F) && netif_rx_schedule_prep(hw->dev[0])) {
2829 status &= ~IS_R1_F;
2830 hw->intr_mask &= ~IS_R1_F;
2831 skge_write32(hw, B0_IMSK, hw->intr_mask);
2832 __netif_rx_schedule(hw->dev[0]);
2833 }
2834
2835 if ((status & IS_R2_F) && netif_rx_schedule_prep(hw->dev[1])) {
2836 status &= ~IS_R2_F;
2837 hw->intr_mask &= ~IS_R2_F;
2838 skge_write32(hw, B0_IMSK, hw->intr_mask);
2839 __netif_rx_schedule(hw->dev[1]);
2840 }
2841
2842 if (status & IS_XA1_F)
2843 skge_tx_intr(hw->dev[0]);
2844
2845 if (status & IS_XA2_F)
2846 skge_tx_intr(hw->dev[1]);
2847
2848 if (status & IS_MAC1)
2849 skge_mac_intr(hw, 0);
2850
2851 if (status & IS_MAC2)
2852 skge_mac_intr(hw, 1);
2853
2854 if (status & IS_HW_ERR)
2855 skge_error_irq(hw);
2856
2857 if (status & IS_EXT_REG) {
2858 hw->intr_mask &= ~IS_EXT_REG;
2859 tasklet_schedule(&hw->ext_tasklet);
2860 }
2861
2862 if (status)
2863 skge_write32(hw, B0_IMSK, hw->intr_mask);
2864
2865 return IRQ_HANDLED;
2866}
2867
2868#ifdef CONFIG_NET_POLL_CONTROLLER
2869static void skge_netpoll(struct net_device *dev)
2870{
2871 struct skge_port *skge = netdev_priv(dev);
2872
2873 disable_irq(dev->irq);
2874 skge_intr(dev->irq, skge->hw, NULL);
2875 enable_irq(dev->irq);
2876}
2877#endif
2878
2879static int skge_set_mac_address(struct net_device *dev, void *p)
2880{
2881 struct skge_port *skge = netdev_priv(dev);
2882 struct sockaddr *addr = p;
2883 int err = 0;
2884
2885 if (!is_valid_ether_addr(addr->sa_data))
2886 return -EADDRNOTAVAIL;
2887
2888 skge_down(dev);
2889 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
2890 memcpy_toio(skge->hw->regs + B2_MAC_1 + skge->port*8,
2891 dev->dev_addr, ETH_ALEN);
2892 memcpy_toio(skge->hw->regs + B2_MAC_2 + skge->port*8,
2893 dev->dev_addr, ETH_ALEN);
2894 if (dev->flags & IFF_UP)
2895 err = skge_up(dev);
2896 return err;
2897}
2898
2899static const struct {
2900 u8 id;
2901 const char *name;
2902} skge_chips[] = {
2903 { CHIP_ID_GENESIS, "Genesis" },
2904 { CHIP_ID_YUKON, "Yukon" },
2905 { CHIP_ID_YUKON_LITE, "Yukon-Lite"},
2906 { CHIP_ID_YUKON_LP, "Yukon-LP"},
2907 { CHIP_ID_YUKON_XL, "Yukon-2 XL"},
2908 { CHIP_ID_YUKON_EC, "YUKON-2 EC"},
2909 { CHIP_ID_YUKON_FE, "YUKON-2 FE"},
2910};
2911
2912static const char *skge_board_name(const struct skge_hw *hw)
2913{
2914 int i;
2915 static char buf[16];
2916
2917 for (i = 0; i < ARRAY_SIZE(skge_chips); i++)
2918 if (skge_chips[i].id == hw->chip_id)
2919 return skge_chips[i].name;
2920
2921 snprintf(buf, sizeof buf, "chipid 0x%x", hw->chip_id);
2922 return buf;
2923}
2924
2925
2926/*
2927 * Setup the board data structure, but don't bring up
2928 * the port(s)
2929 */
2930static int skge_reset(struct skge_hw *hw)
2931{
2932 u16 ctst;
2933 u8 t8;
2934 int i, ports;
2935
2936 ctst = skge_read16(hw, B0_CTST);
2937
2938 /* do a SW reset */
2939 skge_write8(hw, B0_CTST, CS_RST_SET);
2940 skge_write8(hw, B0_CTST, CS_RST_CLR);
2941
2942 /* clear PCI errors, if any */
2943 skge_pci_clear(hw);
2944
2945 skge_write8(hw, B0_CTST, CS_MRST_CLR);
2946
2947 /* restore CLK_RUN bits (for Yukon-Lite) */
2948 skge_write16(hw, B0_CTST,
2949 ctst & (CS_CLK_RUN_HOT|CS_CLK_RUN_RST|CS_CLK_RUN_ENA));
2950
2951 hw->chip_id = skge_read8(hw, B2_CHIP_ID);
2952 hw->phy_type = skge_read8(hw, B2_E_1) & 0xf;
2953 hw->pmd_type = skge_read8(hw, B2_PMD_TYP);
2954
2955 switch(hw->chip_id) {
2956 case CHIP_ID_GENESIS:
2957 switch (hw->phy_type) {
2958 case SK_PHY_XMAC:
2959 hw->phy_addr = PHY_ADDR_XMAC;
2960 break;
2961 case SK_PHY_BCOM:
2962 hw->phy_addr = PHY_ADDR_BCOM;
2963 break;
2964 default:
2965 printk(KERN_ERR PFX "%s: unsupported phy type 0x%x\n",
2966 pci_name(hw->pdev), hw->phy_type);
2967 return -EOPNOTSUPP;
2968 }
2969 break;
2970
2971 case CHIP_ID_YUKON:
2972 case CHIP_ID_YUKON_LITE:
2973 case CHIP_ID_YUKON_LP:
2974 if (hw->phy_type < SK_PHY_MARV_COPPER && hw->pmd_type != 'S')
2975 hw->phy_type = SK_PHY_MARV_COPPER;
2976
2977 hw->phy_addr = PHY_ADDR_MARV;
2978 if (!iscopper(hw))
2979 hw->phy_type = SK_PHY_MARV_FIBER;
2980
2981 break;
2982
2983 default:
2984 printk(KERN_ERR PFX "%s: unsupported chip type 0x%x\n",
2985 pci_name(hw->pdev), hw->chip_id);
2986 return -EOPNOTSUPP;
2987 }
2988
2989 hw->mac_cfg = skge_read8(hw, B2_MAC_CFG);
2990 ports = isdualport(hw) ? 2 : 1;
2991
2992 /* read the adapters RAM size */
2993 t8 = skge_read8(hw, B2_E_0);
2994 if (hw->chip_id == CHIP_ID_GENESIS) {
2995 if (t8 == 3) {
2996 /* special case: 4 x 64k x 36, offset = 0x80000 */
2997 hw->ram_size = 0x100000;
2998 hw->ram_offset = 0x80000;
2999 } else
3000 hw->ram_size = t8 * 512;
3001 }
3002 else if (t8 == 0)
3003 hw->ram_size = 0x20000;
3004 else
3005 hw->ram_size = t8 * 4096;
3006
3007 if (hw->chip_id == CHIP_ID_GENESIS)
3008 genesis_init(hw);
3009 else {
3010 /* switch power to VCC (WA for VAUX problem) */
3011 skge_write8(hw, B0_POWER_CTRL,
3012 PC_VAUX_ENA | PC_VCC_ENA | PC_VAUX_OFF | PC_VCC_ON);
3013 for (i = 0; i < ports; i++) {
3014 skge_write16(hw, SKGEMAC_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET);
3015 skge_write16(hw, SKGEMAC_REG(i, GMAC_LINK_CTRL), GMLC_RST_CLR);
3016 }
3017 }
3018
3019 /* turn off hardware timer (unused) */
3020 skge_write8(hw, B2_TI_CTRL, TIM_STOP);
3021 skge_write8(hw, B2_TI_CTRL, TIM_CLR_IRQ);
3022 skge_write8(hw, B0_LED, LED_STAT_ON);
3023
3024 /* enable the Tx Arbiters */
3025 for (i = 0; i < ports; i++)
3026 skge_write8(hw, SKGEMAC_REG(i, TXA_CTRL), TXA_ENA_ARB);
3027
3028 /* Initialize ram interface */
3029 skge_write16(hw, B3_RI_CTRL, RI_RST_CLR);
3030
3031 skge_write8(hw, B3_RI_WTO_R1, SK_RI_TO_53);
3032 skge_write8(hw, B3_RI_WTO_XA1, SK_RI_TO_53);
3033 skge_write8(hw, B3_RI_WTO_XS1, SK_RI_TO_53);
3034 skge_write8(hw, B3_RI_RTO_R1, SK_RI_TO_53);
3035 skge_write8(hw, B3_RI_RTO_XA1, SK_RI_TO_53);
3036 skge_write8(hw, B3_RI_RTO_XS1, SK_RI_TO_53);
3037 skge_write8(hw, B3_RI_WTO_R2, SK_RI_TO_53);
3038 skge_write8(hw, B3_RI_WTO_XA2, SK_RI_TO_53);
3039 skge_write8(hw, B3_RI_WTO_XS2, SK_RI_TO_53);
3040 skge_write8(hw, B3_RI_RTO_R2, SK_RI_TO_53);
3041 skge_write8(hw, B3_RI_RTO_XA2, SK_RI_TO_53);
3042 skge_write8(hw, B3_RI_RTO_XS2, SK_RI_TO_53);
3043
3044 skge_write32(hw, B0_HWE_IMSK, IS_ERR_MSK);
3045
3046 /* Set interrupt moderation for Transmit only
3047 * Receive interrupts avoided by NAPI
3048 */
3049 skge_write32(hw, B2_IRQM_MSK, IS_XA1_F|IS_XA2_F);
3050 skge_write32(hw, B2_IRQM_INI, skge_usecs2clk(hw, 100));
3051 skge_write32(hw, B2_IRQM_CTRL, TIM_START);
3052
3053 hw->intr_mask = IS_HW_ERR | IS_EXT_REG | IS_PORT_1;
3054 if (isdualport(hw))
3055 hw->intr_mask |= IS_PORT_2;
3056 skge_write32(hw, B0_IMSK, hw->intr_mask);
3057
3058 if (hw->chip_id != CHIP_ID_GENESIS)
3059 skge_write8(hw, GMAC_IRQ_MSK, 0);
3060
3061 spin_lock_bh(&hw->phy_lock);
3062 for (i = 0; i < ports; i++) {
3063 if (hw->chip_id == CHIP_ID_GENESIS)
3064 genesis_reset(hw, i);
3065 else
3066 yukon_reset(hw, i);
3067 }
3068 spin_unlock_bh(&hw->phy_lock);
3069
3070 return 0;
3071}
3072
3073/* Initialize network device */
3074static struct net_device *skge_devinit(struct skge_hw *hw, int port)
3075{
3076 struct skge_port *skge;
3077 struct net_device *dev = alloc_etherdev(sizeof(*skge));
3078
3079 if (!dev) {
3080 printk(KERN_ERR "skge etherdev alloc failed");
3081 return NULL;
3082 }
3083
3084 SET_MODULE_OWNER(dev);
3085 SET_NETDEV_DEV(dev, &hw->pdev->dev);
3086 dev->open = skge_up;
3087 dev->stop = skge_down;
3088 dev->hard_start_xmit = skge_xmit_frame;
3089 dev->get_stats = skge_get_stats;
3090 if (hw->chip_id == CHIP_ID_GENESIS)
3091 dev->set_multicast_list = genesis_set_multicast;
3092 else
3093 dev->set_multicast_list = yukon_set_multicast;
3094
3095 dev->set_mac_address = skge_set_mac_address;
3096 dev->change_mtu = skge_change_mtu;
3097 SET_ETHTOOL_OPS(dev, &skge_ethtool_ops);
3098 dev->tx_timeout = skge_tx_timeout;
3099 dev->watchdog_timeo = TX_WATCHDOG;
3100 dev->poll = skge_poll;
3101 dev->weight = NAPI_WEIGHT;
3102#ifdef CONFIG_NET_POLL_CONTROLLER
3103 dev->poll_controller = skge_netpoll;
3104#endif
3105 dev->irq = hw->pdev->irq;
3106 dev->features = NETIF_F_LLTX;
3107
3108 skge = netdev_priv(dev);
3109 skge->netdev = dev;
3110 skge->hw = hw;
3111 skge->msg_enable = netif_msg_init(debug, default_msg);
3112 skge->tx_ring.count = DEFAULT_TX_RING_SIZE;
3113 skge->rx_ring.count = DEFAULT_RX_RING_SIZE;
3114
3115 /* Auto speed and flow control */
3116 skge->autoneg = AUTONEG_ENABLE;
3117 skge->flow_control = FLOW_MODE_SYMMETRIC;
3118 skge->duplex = -1;
3119 skge->speed = -1;
3120 skge->advertising = skge_modes(hw);
3121
3122 hw->dev[port] = dev;
3123
3124 skge->port = port;
3125
3126 spin_lock_init(&skge->tx_lock);
3127
3128 init_timer(&skge->link_check);
3129 skge->link_check.function = skge_link_timer;
3130 skge->link_check.data = (unsigned long) skge;
3131
3132 init_timer(&skge->led_blink);
3133 skge->led_blink.function = skge_blink_timer;
3134 skge->led_blink.data = (unsigned long) skge;
3135
3136 if (hw->chip_id != CHIP_ID_GENESIS) {
3137 dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
3138 skge->rx_csum = 1;
3139 }
3140
3141 /* read the mac address */
3142 memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port*8, ETH_ALEN);
3143
3144 /* device is off until link detection */
3145 netif_carrier_off(dev);
3146 netif_stop_queue(dev);
3147
3148 return dev;
3149}
3150
3151static void __devinit skge_show_addr(struct net_device *dev)
3152{
3153 const struct skge_port *skge = netdev_priv(dev);
3154
3155 if (netif_msg_probe(skge))
3156 printk(KERN_INFO PFX "%s: addr %02x:%02x:%02x:%02x:%02x:%02x\n",
3157 dev->name,
3158 dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
3159 dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
3160}
3161
3162static int __devinit skge_probe(struct pci_dev *pdev,
3163 const struct pci_device_id *ent)
3164{
3165 struct net_device *dev, *dev1;
3166 struct skge_hw *hw;
3167 int err, using_dac = 0;
3168
3169 if ((err = pci_enable_device(pdev))) {
3170 printk(KERN_ERR PFX "%s cannot enable PCI device\n",
3171 pci_name(pdev));
3172 goto err_out;
3173 }
3174
3175 if ((err = pci_request_regions(pdev, DRV_NAME))) {
3176 printk(KERN_ERR PFX "%s cannot obtain PCI resources\n",
3177 pci_name(pdev));
3178 goto err_out_disable_pdev;
3179 }
3180
3181 pci_set_master(pdev);
3182
3183 if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK)))
3184 using_dac = 1;
3185 else if (!(err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) {
3186 printk(KERN_ERR PFX "%s no usable DMA configuration\n",
3187 pci_name(pdev));
3188 goto err_out_free_regions;
3189 }
3190
3191#ifdef __BIG_ENDIAN
3192 /* byte swap decriptors in hardware */
3193 {
3194 u32 reg;
3195
3196 pci_read_config_dword(pdev, PCI_DEV_REG2, &reg);
3197 reg |= PCI_REV_DESC;
3198 pci_write_config_dword(pdev, PCI_DEV_REG2, reg);
3199 }
3200#endif
3201
3202 err = -ENOMEM;
3203 hw = kmalloc(sizeof(*hw), GFP_KERNEL);
3204 if (!hw) {
3205 printk(KERN_ERR PFX "%s: cannot allocate hardware struct\n",
3206 pci_name(pdev));
3207 goto err_out_free_regions;
3208 }
3209
3210 memset(hw, 0, sizeof(*hw));
3211 hw->pdev = pdev;
3212 spin_lock_init(&hw->phy_lock);
3213 tasklet_init(&hw->ext_tasklet, skge_extirq, (unsigned long) hw);
3214
3215 hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000);
3216 if (!hw->regs) {
3217 printk(KERN_ERR PFX "%s: cannot map device registers\n",
3218 pci_name(pdev));
3219 goto err_out_free_hw;
3220 }
3221
3222 if ((err = request_irq(pdev->irq, skge_intr, SA_SHIRQ, DRV_NAME, hw))) {
3223 printk(KERN_ERR PFX "%s: cannot assign irq %d\n",
3224 pci_name(pdev), pdev->irq);
3225 goto err_out_iounmap;
3226 }
3227 pci_set_drvdata(pdev, hw);
3228
3229 err = skge_reset(hw);
3230 if (err)
3231 goto err_out_free_irq;
3232
3233 printk(KERN_INFO PFX "addr 0x%lx irq %d chip %s rev %d\n",
3234 pci_resource_start(pdev, 0), pdev->irq,
3235 skge_board_name(hw), chip_rev(hw));
3236
3237 if ((dev = skge_devinit(hw, 0)) == NULL)
3238 goto err_out_led_off;
3239
3240 if (using_dac)
3241 dev->features |= NETIF_F_HIGHDMA;
3242
3243 if ((err = register_netdev(dev))) {
3244 printk(KERN_ERR PFX "%s: cannot register net device\n",
3245 pci_name(pdev));
3246 goto err_out_free_netdev;
3247 }
3248
3249 skge_show_addr(dev);
3250
3251 if (isdualport(hw) && (dev1 = skge_devinit(hw, 1))) {
3252 if (using_dac)
3253 dev1->features |= NETIF_F_HIGHDMA;
3254
3255 if (register_netdev(dev1) == 0)
3256 skge_show_addr(dev1);
3257 else {
3258 /* Failure to register second port need not be fatal */
3259 printk(KERN_WARNING PFX "register of second port failed\n");
3260 hw->dev[1] = NULL;
3261 free_netdev(dev1);
3262 }
3263 }
3264
3265 return 0;
3266
3267err_out_free_netdev:
3268 free_netdev(dev);
3269err_out_led_off:
3270 skge_write16(hw, B0_LED, LED_STAT_OFF);
3271err_out_free_irq:
3272 free_irq(pdev->irq, hw);
3273err_out_iounmap:
3274 iounmap(hw->regs);
3275err_out_free_hw:
3276 kfree(hw);
3277err_out_free_regions:
3278 pci_release_regions(pdev);
3279err_out_disable_pdev:
3280 pci_disable_device(pdev);
3281 pci_set_drvdata(pdev, NULL);
3282err_out:
3283 return err;
3284}
3285
3286static void __devexit skge_remove(struct pci_dev *pdev)
3287{
3288 struct skge_hw *hw = pci_get_drvdata(pdev);
3289 struct net_device *dev0, *dev1;
3290
3291 if(!hw)
3292 return;
3293
3294 if ((dev1 = hw->dev[1]))
3295 unregister_netdev(dev1);
3296 dev0 = hw->dev[0];
3297 unregister_netdev(dev0);
3298
3299 tasklet_kill(&hw->ext_tasklet);
3300
3301 free_irq(pdev->irq, hw);
3302 pci_release_regions(pdev);
3303 pci_disable_device(pdev);
3304 if (dev1)
3305 free_netdev(dev1);
3306 free_netdev(dev0);
3307 skge_write16(hw, B0_LED, LED_STAT_OFF);
3308 iounmap(hw->regs);
3309 kfree(hw);
3310 pci_set_drvdata(pdev, NULL);
3311}
3312
3313#ifdef CONFIG_PM
3314static int skge_suspend(struct pci_dev *pdev, u32 state)
3315{
3316 struct skge_hw *hw = pci_get_drvdata(pdev);
3317 int i, wol = 0;
3318
3319 for(i = 0; i < 2; i++) {
3320 struct net_device *dev = hw->dev[i];
3321
3322 if (dev) {
3323 struct skge_port *skge = netdev_priv(dev);
3324 if (netif_running(dev)) {
3325 netif_carrier_off(dev);
3326 skge_down(dev);
3327 }
3328 netif_device_detach(dev);
3329 wol |= skge->wol;
3330 }
3331 }
3332
3333 pci_save_state(pdev);
3334 pci_enable_wake(pdev, state, wol);
3335 pci_disable_device(pdev);
3336 pci_set_power_state(pdev, pci_choose_state(pdev, state));
3337
3338 return 0;
3339}
3340
3341static int skge_resume(struct pci_dev *pdev)
3342{
3343 struct skge_hw *hw = pci_get_drvdata(pdev);
3344 int i;
3345
3346 pci_set_power_state(pdev, PCI_D0);
3347 pci_restore_state(pdev);
3348 pci_enable_wake(pdev, PCI_D0, 0);
3349
3350 skge_reset(hw);
3351
3352 for(i = 0; i < 2; i++) {
3353 struct net_device *dev = hw->dev[i];
3354 if (dev) {
3355 netif_device_attach(dev);
3356 if(netif_running(dev))
3357 skge_up(dev);
3358 }
3359 }
3360 return 0;
3361}
3362#endif
3363
3364static struct pci_driver skge_driver = {
3365 .name = DRV_NAME,
3366 .id_table = skge_id_table,
3367 .probe = skge_probe,
3368 .remove = __devexit_p(skge_remove),
3369#ifdef CONFIG_PM
3370 .suspend = skge_suspend,
3371 .resume = skge_resume,
3372#endif
3373};
3374
3375static int __init skge_init_module(void)
3376{
3377 return pci_module_init(&skge_driver);
3378}
3379
3380static void __exit skge_cleanup_module(void)
3381{
3382 pci_unregister_driver(&skge_driver);
3383}
3384
3385module_init(skge_init_module);
3386module_exit(skge_cleanup_module);
diff --git a/drivers/net/skge.h b/drivers/net/skge.h
new file mode 100644
index 000000000000..36c62b68fab4
--- /dev/null
+++ b/drivers/net/skge.h
@@ -0,0 +1,3005 @@
1/*
2 * Definitions for the new Marvell Yukon / SysKonenct driver.
3 */
4#ifndef _SKGE_H
5#define _SKGE_H
6
7/* PCI config registers */
8#define PCI_DEV_REG1 0x40
9#define PCI_DEV_REG2 0x44
10#ifndef PCI_VPD
11#define PCI_VPD 0x50
12#endif
13
14/* PCI_OUR_REG_2 32 bit Our Register 2 */
15enum {
16 PCI_VPD_WR_THR = 0xff<<24, /* Bit 31..24: VPD Write Threshold */
17 PCI_DEV_SEL = 0x7f<<17, /* Bit 23..17: EEPROM Device Select */
18 PCI_VPD_ROM_SZ = 7 <<14, /* Bit 16..14: VPD ROM Size */
19 /* Bit 13..12: reserved */
20 PCI_EN_DUMMY_RD = 1<<3, /* Enable Dummy Read */
21 PCI_REV_DESC = 1<<2, /* Reverse Desc. Bytes */
22 PCI_USEDATA64 = 1<<0, /* Use 64Bit Data bus ext */
23};
24
25/* PCI_VPD_ADR_REG 16 bit VPD Address Register */
26enum {
27 PCI_VPD_FLAG = 1<<15, /* starts VPD rd/wr cycle */
28 PCI_VPD_ADR_MSK =0x7fffL, /* Bit 14.. 0: VPD Address Mask */
29 VPD_RES_ID = 0x82,
30 VPD_RES_READ = 0x90,
31 VPD_RES_WRITE = 0x81,
32 VPD_RES_END = 0x78,
33};
34
35
36#define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \
37 PCI_STATUS_SIG_SYSTEM_ERROR | \
38 PCI_STATUS_REC_MASTER_ABORT | \
39 PCI_STATUS_REC_TARGET_ABORT | \
40 PCI_STATUS_PARITY)
41
42
43enum csr_regs {
44 B0_RAP = 0x0000,
45 B0_CTST = 0x0004,
46 B0_LED = 0x0006,
47 B0_POWER_CTRL = 0x0007,
48 B0_ISRC = 0x0008,
49 B0_IMSK = 0x000c,
50 B0_HWE_ISRC = 0x0010,
51 B0_HWE_IMSK = 0x0014,
52 B0_SP_ISRC = 0x0018,
53 B0_XM1_IMSK = 0x0020,
54 B0_XM1_ISRC = 0x0028,
55 B0_XM1_PHY_ADDR = 0x0030,
56 B0_XM1_PHY_DATA = 0x0034,
57 B0_XM2_IMSK = 0x0040,
58 B0_XM2_ISRC = 0x0048,
59 B0_XM2_PHY_ADDR = 0x0050,
60 B0_XM2_PHY_DATA = 0x0054,
61 B0_R1_CSR = 0x0060,
62 B0_R2_CSR = 0x0064,
63 B0_XS1_CSR = 0x0068,
64 B0_XA1_CSR = 0x006c,
65 B0_XS2_CSR = 0x0070,
66 B0_XA2_CSR = 0x0074,
67
68 B2_MAC_1 = 0x0100,
69 B2_MAC_2 = 0x0108,
70 B2_MAC_3 = 0x0110,
71 B2_CONN_TYP = 0x0118,
72 B2_PMD_TYP = 0x0119,
73 B2_MAC_CFG = 0x011a,
74 B2_CHIP_ID = 0x011b,
75 B2_E_0 = 0x011c,
76 B2_E_1 = 0x011d,
77 B2_E_2 = 0x011e,
78 B2_E_3 = 0x011f,
79 B2_FAR = 0x0120,
80 B2_FDP = 0x0124,
81 B2_LD_CTRL = 0x0128,
82 B2_LD_TEST = 0x0129,
83 B2_TI_INI = 0x0130,
84 B2_TI_VAL = 0x0134,
85 B2_TI_CTRL = 0x0138,
86 B2_TI_TEST = 0x0139,
87 B2_IRQM_INI = 0x0140,
88 B2_IRQM_VAL = 0x0144,
89 B2_IRQM_CTRL = 0x0148,
90 B2_IRQM_TEST = 0x0149,
91 B2_IRQM_MSK = 0x014c,
92 B2_IRQM_HWE_MSK = 0x0150,
93 B2_TST_CTRL1 = 0x0158,
94 B2_TST_CTRL2 = 0x0159,
95 B2_GP_IO = 0x015c,
96 B2_I2C_CTRL = 0x0160,
97 B2_I2C_DATA = 0x0164,
98 B2_I2C_IRQ = 0x0168,
99 B2_I2C_SW = 0x016c,
100 B2_BSC_INI = 0x0170,
101 B2_BSC_VAL = 0x0174,
102 B2_BSC_CTRL = 0x0178,
103 B2_BSC_STAT = 0x0179,
104 B2_BSC_TST = 0x017a,
105
106 B3_RAM_ADDR = 0x0180,
107 B3_RAM_DATA_LO = 0x0184,
108 B3_RAM_DATA_HI = 0x0188,
109 B3_RI_WTO_R1 = 0x0190,
110 B3_RI_WTO_XA1 = 0x0191,
111 B3_RI_WTO_XS1 = 0x0192,
112 B3_RI_RTO_R1 = 0x0193,
113 B3_RI_RTO_XA1 = 0x0194,
114 B3_RI_RTO_XS1 = 0x0195,
115 B3_RI_WTO_R2 = 0x0196,
116 B3_RI_WTO_XA2 = 0x0197,
117 B3_RI_WTO_XS2 = 0x0198,
118 B3_RI_RTO_R2 = 0x0199,
119 B3_RI_RTO_XA2 = 0x019a,
120 B3_RI_RTO_XS2 = 0x019b,
121 B3_RI_TO_VAL = 0x019c,
122 B3_RI_CTRL = 0x01a0,
123 B3_RI_TEST = 0x01a2,
124 B3_MA_TOINI_RX1 = 0x01b0,
125 B3_MA_TOINI_RX2 = 0x01b1,
126 B3_MA_TOINI_TX1 = 0x01b2,
127 B3_MA_TOINI_TX2 = 0x01b3,
128 B3_MA_TOVAL_RX1 = 0x01b4,
129 B3_MA_TOVAL_RX2 = 0x01b5,
130 B3_MA_TOVAL_TX1 = 0x01b6,
131 B3_MA_TOVAL_TX2 = 0x01b7,
132 B3_MA_TO_CTRL = 0x01b8,
133 B3_MA_TO_TEST = 0x01ba,
134 B3_MA_RCINI_RX1 = 0x01c0,
135 B3_MA_RCINI_RX2 = 0x01c1,
136 B3_MA_RCINI_TX1 = 0x01c2,
137 B3_MA_RCINI_TX2 = 0x01c3,
138 B3_MA_RCVAL_RX1 = 0x01c4,
139 B3_MA_RCVAL_RX2 = 0x01c5,
140 B3_MA_RCVAL_TX1 = 0x01c6,
141 B3_MA_RCVAL_TX2 = 0x01c7,
142 B3_MA_RC_CTRL = 0x01c8,
143 B3_MA_RC_TEST = 0x01ca,
144 B3_PA_TOINI_RX1 = 0x01d0,
145 B3_PA_TOINI_RX2 = 0x01d4,
146 B3_PA_TOINI_TX1 = 0x01d8,
147 B3_PA_TOINI_TX2 = 0x01dc,
148 B3_PA_TOVAL_RX1 = 0x01e0,
149 B3_PA_TOVAL_RX2 = 0x01e4,
150 B3_PA_TOVAL_TX1 = 0x01e8,
151 B3_PA_TOVAL_TX2 = 0x01ec,
152 B3_PA_CTRL = 0x01f0,
153 B3_PA_TEST = 0x01f2,
154};
155
156/* B0_CTST 16 bit Control/Status register */
157enum {
158 CS_CLK_RUN_HOT = 1<<13,/* CLK_RUN hot m. (YUKON-Lite only) */
159 CS_CLK_RUN_RST = 1<<12,/* CLK_RUN reset (YUKON-Lite only) */
160 CS_CLK_RUN_ENA = 1<<11,/* CLK_RUN enable (YUKON-Lite only) */
161 CS_VAUX_AVAIL = 1<<10,/* VAUX available (YUKON only) */
162 CS_BUS_CLOCK = 1<<9, /* Bus Clock 0/1 = 33/66 MHz */
163 CS_BUS_SLOT_SZ = 1<<8, /* Slot Size 0/1 = 32/64 bit slot */
164 CS_ST_SW_IRQ = 1<<7, /* Set IRQ SW Request */
165 CS_CL_SW_IRQ = 1<<6, /* Clear IRQ SW Request */
166 CS_STOP_DONE = 1<<5, /* Stop Master is finished */
167 CS_STOP_MAST = 1<<4, /* Command Bit to stop the master */
168 CS_MRST_CLR = 1<<3, /* Clear Master reset */
169 CS_MRST_SET = 1<<2, /* Set Master reset */
170 CS_RST_CLR = 1<<1, /* Clear Software reset */
171 CS_RST_SET = 1, /* Set Software reset */
172
173/* B0_LED 8 Bit LED register */
174/* Bit 7.. 2: reserved */
175 LED_STAT_ON = 1<<1, /* Status LED on */
176 LED_STAT_OFF = 1, /* Status LED off */
177
178/* B0_POWER_CTRL 8 Bit Power Control reg (YUKON only) */
179 PC_VAUX_ENA = 1<<7, /* Switch VAUX Enable */
180 PC_VAUX_DIS = 1<<6, /* Switch VAUX Disable */
181 PC_VCC_ENA = 1<<5, /* Switch VCC Enable */
182 PC_VCC_DIS = 1<<4, /* Switch VCC Disable */
183 PC_VAUX_ON = 1<<3, /* Switch VAUX On */
184 PC_VAUX_OFF = 1<<2, /* Switch VAUX Off */
185 PC_VCC_ON = 1<<1, /* Switch VCC On */
186 PC_VCC_OFF = 1<<0, /* Switch VCC Off */
187};
188
189/* B2_IRQM_MSK 32 bit IRQ Moderation Mask */
190enum {
191 IS_ALL_MSK = 0xbffffffful, /* All Interrupt bits */
192 IS_HW_ERR = 1<<31, /* Interrupt HW Error */
193 /* Bit 30: reserved */
194 IS_PA_TO_RX1 = 1<<29, /* Packet Arb Timeout Rx1 */
195 IS_PA_TO_RX2 = 1<<28, /* Packet Arb Timeout Rx2 */
196 IS_PA_TO_TX1 = 1<<27, /* Packet Arb Timeout Tx1 */
197 IS_PA_TO_TX2 = 1<<26, /* Packet Arb Timeout Tx2 */
198 IS_I2C_READY = 1<<25, /* IRQ on end of I2C Tx */
199 IS_IRQ_SW = 1<<24, /* SW forced IRQ */
200 IS_EXT_REG = 1<<23, /* IRQ from LM80 or PHY (GENESIS only) */
201 /* IRQ from PHY (YUKON only) */
202 IS_TIMINT = 1<<22, /* IRQ from Timer */
203 IS_MAC1 = 1<<21, /* IRQ from MAC 1 */
204 IS_LNK_SYNC_M1 = 1<<20, /* Link Sync Cnt wrap MAC 1 */
205 IS_MAC2 = 1<<19, /* IRQ from MAC 2 */
206 IS_LNK_SYNC_M2 = 1<<18, /* Link Sync Cnt wrap MAC 2 */
207/* Receive Queue 1 */
208 IS_R1_B = 1<<17, /* Q_R1 End of Buffer */
209 IS_R1_F = 1<<16, /* Q_R1 End of Frame */
210 IS_R1_C = 1<<15, /* Q_R1 Encoding Error */
211/* Receive Queue 2 */
212 IS_R2_B = 1<<14, /* Q_R2 End of Buffer */
213 IS_R2_F = 1<<13, /* Q_R2 End of Frame */
214 IS_R2_C = 1<<12, /* Q_R2 Encoding Error */
215/* Synchronous Transmit Queue 1 */
216 IS_XS1_B = 1<<11, /* Q_XS1 End of Buffer */
217 IS_XS1_F = 1<<10, /* Q_XS1 End of Frame */
218 IS_XS1_C = 1<<9, /* Q_XS1 Encoding Error */
219/* Asynchronous Transmit Queue 1 */
220 IS_XA1_B = 1<<8, /* Q_XA1 End of Buffer */
221 IS_XA1_F = 1<<7, /* Q_XA1 End of Frame */
222 IS_XA1_C = 1<<6, /* Q_XA1 Encoding Error */
223/* Synchronous Transmit Queue 2 */
224 IS_XS2_B = 1<<5, /* Q_XS2 End of Buffer */
225 IS_XS2_F = 1<<4, /* Q_XS2 End of Frame */
226 IS_XS2_C = 1<<3, /* Q_XS2 Encoding Error */
227/* Asynchronous Transmit Queue 2 */
228 IS_XA2_B = 1<<2, /* Q_XA2 End of Buffer */
229 IS_XA2_F = 1<<1, /* Q_XA2 End of Frame */
230 IS_XA2_C = 1<<0, /* Q_XA2 Encoding Error */
231
232 IS_PORT_1 = IS_XA1_F| IS_R1_F| IS_MAC1,
233 IS_PORT_2 = IS_XA2_F| IS_R2_F| IS_MAC2,
234};
235
236
237/* B2_IRQM_HWE_MSK 32 bit IRQ Moderation HW Error Mask */
238enum {
239 IS_ERR_MSK = 0x00003fff,/* All Error bits */
240
241 IS_IRQ_TIST_OV = 1<<13, /* Time Stamp Timer Overflow (YUKON only) */
242 IS_IRQ_SENSOR = 1<<12, /* IRQ from Sensor (YUKON only) */
243 IS_IRQ_MST_ERR = 1<<11, /* IRQ master error detected */
244 IS_IRQ_STAT = 1<<10, /* IRQ status exception */
245 IS_NO_STAT_M1 = 1<<9, /* No Rx Status from MAC 1 */
246 IS_NO_STAT_M2 = 1<<8, /* No Rx Status from MAC 2 */
247 IS_NO_TIST_M1 = 1<<7, /* No Time Stamp from MAC 1 */
248 IS_NO_TIST_M2 = 1<<6, /* No Time Stamp from MAC 2 */
249 IS_RAM_RD_PAR = 1<<5, /* RAM Read Parity Error */
250 IS_RAM_WR_PAR = 1<<4, /* RAM Write Parity Error */
251 IS_M1_PAR_ERR = 1<<3, /* MAC 1 Parity Error */
252 IS_M2_PAR_ERR = 1<<2, /* MAC 2 Parity Error */
253 IS_R1_PAR_ERR = 1<<1, /* Queue R1 Parity Error */
254 IS_R2_PAR_ERR = 1<<0, /* Queue R2 Parity Error */
255};
256
257/* B2_TST_CTRL1 8 bit Test Control Register 1 */
258enum {
259 TST_FRC_DPERR_MR = 1<<7, /* force DATAPERR on MST RD */
260 TST_FRC_DPERR_MW = 1<<6, /* force DATAPERR on MST WR */
261 TST_FRC_DPERR_TR = 1<<5, /* force DATAPERR on TRG RD */
262 TST_FRC_DPERR_TW = 1<<4, /* force DATAPERR on TRG WR */
263 TST_FRC_APERR_M = 1<<3, /* force ADDRPERR on MST */
264 TST_FRC_APERR_T = 1<<2, /* force ADDRPERR on TRG */
265 TST_CFG_WRITE_ON = 1<<1, /* Enable Config Reg WR */
266 TST_CFG_WRITE_OFF= 1<<0, /* Disable Config Reg WR */
267};
268
269/* B2_MAC_CFG 8 bit MAC Configuration / Chip Revision */
270enum {
271 CFG_CHIP_R_MSK = 0xf<<4, /* Bit 7.. 4: Chip Revision */
272 /* Bit 3.. 2: reserved */
273 CFG_DIS_M2_CLK = 1<<1, /* Disable Clock for 2nd MAC */
274 CFG_SNG_MAC = 1<<0, /* MAC Config: 0=2 MACs / 1=1 MAC*/
275};
276
277/* B2_CHIP_ID 8 bit Chip Identification Number */
278enum {
279 CHIP_ID_GENESIS = 0x0a, /* Chip ID for GENESIS */
280 CHIP_ID_YUKON = 0xb0, /* Chip ID for YUKON */
281 CHIP_ID_YUKON_LITE = 0xb1, /* Chip ID for YUKON-Lite (Rev. A1-A3) */
282 CHIP_ID_YUKON_LP = 0xb2, /* Chip ID for YUKON-LP */
283 CHIP_ID_YUKON_XL = 0xb3, /* Chip ID for YUKON-2 XL */
284 CHIP_ID_YUKON_EC = 0xb6, /* Chip ID for YUKON-2 EC */
285 CHIP_ID_YUKON_FE = 0xb7, /* Chip ID for YUKON-2 FE */
286
287 CHIP_REV_YU_LITE_A1 = 3, /* Chip Rev. for YUKON-Lite A1,A2 */
288 CHIP_REV_YU_LITE_A3 = 7, /* Chip Rev. for YUKON-Lite A3 */
289};
290
291/* B2_LD_TEST 8 bit EPROM loader test register */
292enum {
293 LD_T_ON = 1<<3, /* Loader Test mode on */
294 LD_T_OFF = 1<<2, /* Loader Test mode off */
295 LD_T_STEP = 1<<1, /* Decrement FPROM addr. Counter */
296 LD_START = 1<<0, /* Start loading FPROM */
297};
298
299/* B2_TI_CTRL 8 bit Timer control */
300/* B2_IRQM_CTRL 8 bit IRQ Moderation Timer Control */
301enum {
302 TIM_START = 1<<2, /* Start Timer */
303 TIM_STOP = 1<<1, /* Stop Timer */
304 TIM_CLR_IRQ = 1<<0, /* Clear Timer IRQ (!IRQM) */
305};
306
307/* B2_TI_TEST 8 Bit Timer Test */
308/* B2_IRQM_TEST 8 bit IRQ Moderation Timer Test */
309/* B28_DPT_TST 8 bit Descriptor Poll Timer Test Reg */
310enum {
311 TIM_T_ON = 1<<2, /* Test mode on */
312 TIM_T_OFF = 1<<1, /* Test mode off */
313 TIM_T_STEP = 1<<0, /* Test step */
314};
315
316/* B28_DPT_INI 32 bit Descriptor Poll Timer Init Val */
317/* B28_DPT_VAL 32 bit Descriptor Poll Timer Curr Val */
318/* B28_DPT_CTRL 8 bit Descriptor Poll Timer Ctrl Reg */
319enum {
320 DPT_MSK = 0x00ffffffL, /* Bit 23.. 0: Desc Poll Timer Bits */
321
322 DPT_START = 1<<1, /* Start Descriptor Poll Timer */
323 DPT_STOP = 1<<0, /* Stop Descriptor Poll Timer */
324};
325
326/* B2_GP_IO 32 bit General Purpose I/O Register */
327enum {
328 GP_DIR_9 = 1<<25, /* IO_9 direct, 0=In/1=Out */
329 GP_DIR_8 = 1<<24, /* IO_8 direct, 0=In/1=Out */
330 GP_DIR_7 = 1<<23, /* IO_7 direct, 0=In/1=Out */
331 GP_DIR_6 = 1<<22, /* IO_6 direct, 0=In/1=Out */
332 GP_DIR_5 = 1<<21, /* IO_5 direct, 0=In/1=Out */
333 GP_DIR_4 = 1<<20, /* IO_4 direct, 0=In/1=Out */
334 GP_DIR_3 = 1<<19, /* IO_3 direct, 0=In/1=Out */
335 GP_DIR_2 = 1<<18, /* IO_2 direct, 0=In/1=Out */
336 GP_DIR_1 = 1<<17, /* IO_1 direct, 0=In/1=Out */
337 GP_DIR_0 = 1<<16, /* IO_0 direct, 0=In/1=Out */
338
339 GP_IO_9 = 1<<9, /* IO_9 pin */
340 GP_IO_8 = 1<<8, /* IO_8 pin */
341 GP_IO_7 = 1<<7, /* IO_7 pin */
342 GP_IO_6 = 1<<6, /* IO_6 pin */
343 GP_IO_5 = 1<<5, /* IO_5 pin */
344 GP_IO_4 = 1<<4, /* IO_4 pin */
345 GP_IO_3 = 1<<3, /* IO_3 pin */
346 GP_IO_2 = 1<<2, /* IO_2 pin */
347 GP_IO_1 = 1<<1, /* IO_1 pin */
348 GP_IO_0 = 1<<0, /* IO_0 pin */
349};
350
351/* Rx/Tx Path related Arbiter Test Registers */
352/* B3_MA_TO_TEST 16 bit MAC Arbiter Timeout Test Reg */
353/* B3_MA_RC_TEST 16 bit MAC Arbiter Recovery Test Reg */
354/* B3_PA_TEST 16 bit Packet Arbiter Test Register */
355/* Bit 15, 11, 7, and 3 are reserved in B3_PA_TEST */
356enum {
357 TX2_T_EV = 1<<15,/* TX2 Timeout/Recv Event occured */
358 TX2_T_ON = 1<<14,/* TX2 Timeout/Recv Timer Test On */
359 TX2_T_OFF = 1<<13,/* TX2 Timeout/Recv Timer Tst Off */
360 TX2_T_STEP = 1<<12,/* TX2 Timeout/Recv Timer Step */
361 TX1_T_EV = 1<<11,/* TX1 Timeout/Recv Event occured */
362 TX1_T_ON = 1<<10,/* TX1 Timeout/Recv Timer Test On */
363 TX1_T_OFF = 1<<9, /* TX1 Timeout/Recv Timer Tst Off */
364 TX1_T_STEP = 1<<8, /* TX1 Timeout/Recv Timer Step */
365 RX2_T_EV = 1<<7, /* RX2 Timeout/Recv Event occured */
366 RX2_T_ON = 1<<6, /* RX2 Timeout/Recv Timer Test On */
367 RX2_T_OFF = 1<<5, /* RX2 Timeout/Recv Timer Tst Off */
368 RX2_T_STEP = 1<<4, /* RX2 Timeout/Recv Timer Step */
369 RX1_T_EV = 1<<3, /* RX1 Timeout/Recv Event occured */
370 RX1_T_ON = 1<<2, /* RX1 Timeout/Recv Timer Test On */
371 RX1_T_OFF = 1<<1, /* RX1 Timeout/Recv Timer Tst Off */
372 RX1_T_STEP = 1<<0, /* RX1 Timeout/Recv Timer Step */
373};
374
375/* Descriptor Bit Definition */
376/* TxCtrl Transmit Buffer Control Field */
377/* RxCtrl Receive Buffer Control Field */
378enum {
379 BMU_OWN = 1<<31, /* OWN bit: 0=host/1=BMU */
380 BMU_STF = 1<<30, /* Start of Frame */
381 BMU_EOF = 1<<29, /* End of Frame */
382 BMU_IRQ_EOB = 1<<28, /* Req "End of Buffer" IRQ */
383 BMU_IRQ_EOF = 1<<27, /* Req "End of Frame" IRQ */
384 /* TxCtrl specific bits */
385 BMU_STFWD = 1<<26, /* (Tx) Store & Forward Frame */
386 BMU_NO_FCS = 1<<25, /* (Tx) Disable MAC FCS (CRC) generation */
387 BMU_SW = 1<<24, /* (Tx) 1 bit res. for SW use */
388 /* RxCtrl specific bits */
389 BMU_DEV_0 = 1<<26, /* (Rx) Transfer data to Dev0 */
390 BMU_STAT_VAL = 1<<25, /* (Rx) Rx Status Valid */
391 BMU_TIST_VAL = 1<<24, /* (Rx) Rx TimeStamp Valid */
392 /* Bit 23..16: BMU Check Opcodes */
393 BMU_CHECK = 0x55<<16, /* Default BMU check */
394 BMU_TCP_CHECK = 0x56<<16, /* Descr with TCP ext */
395 BMU_UDP_CHECK = 0x57<<16, /* Descr with UDP ext (YUKON only) */
396 BMU_BBC = 0xffffL, /* Bit 15.. 0: Buffer Byte Counter */
397};
398
399/* B2_BSC_CTRL 8 bit Blink Source Counter Control */
400enum {
401 BSC_START = 1<<1, /* Start Blink Source Counter */
402 BSC_STOP = 1<<0, /* Stop Blink Source Counter */
403};
404
405/* B2_BSC_STAT 8 bit Blink Source Counter Status */
406enum {
407 BSC_SRC = 1<<0, /* Blink Source, 0=Off / 1=On */
408};
409
410/* B2_BSC_TST 16 bit Blink Source Counter Test Reg */
411enum {
412 BSC_T_ON = 1<<2, /* Test mode on */
413 BSC_T_OFF = 1<<1, /* Test mode off */
414 BSC_T_STEP = 1<<0, /* Test step */
415};
416
417/* B3_RAM_ADDR 32 bit RAM Address, to read or write */
418 /* Bit 31..19: reserved */
419#define RAM_ADR_RAN 0x0007ffffL /* Bit 18.. 0: RAM Address Range */
420/* RAM Interface Registers */
421
422/* B3_RI_CTRL 16 bit RAM Iface Control Register */
423enum {
424 RI_CLR_RD_PERR = 1<<9, /* Clear IRQ RAM Read Parity Err */
425 RI_CLR_WR_PERR = 1<<8, /* Clear IRQ RAM Write Parity Err*/
426
427 RI_RST_CLR = 1<<1, /* Clear RAM Interface Reset */
428 RI_RST_SET = 1<<0, /* Set RAM Interface Reset */
429};
430
431/* B3_RI_TEST 8 bit RAM Iface Test Register */
432enum {
433 RI_T_EV = 1<<3, /* Timeout Event occured */
434 RI_T_ON = 1<<2, /* Timeout Timer Test On */
435 RI_T_OFF = 1<<1, /* Timeout Timer Test Off */
436 RI_T_STEP = 1<<0, /* Timeout Timer Step */
437};
438
439/* MAC Arbiter Registers */
440/* B3_MA_TO_CTRL 16 bit MAC Arbiter Timeout Ctrl Reg */
441enum {
442 MA_FOE_ON = 1<<3, /* XMAC Fast Output Enable ON */
443 MA_FOE_OFF = 1<<2, /* XMAC Fast Output Enable OFF */
444 MA_RST_CLR = 1<<1, /* Clear MAC Arbiter Reset */
445 MA_RST_SET = 1<<0, /* Set MAC Arbiter Reset */
446
447};
448
449/* Timeout values */
450#define SK_MAC_TO_53 72 /* MAC arbiter timeout */
451#define SK_PKT_TO_53 0x2000 /* Packet arbiter timeout */
452#define SK_PKT_TO_MAX 0xffff /* Maximum value */
453#define SK_RI_TO_53 36 /* RAM interface timeout */
454
455
456/* B3_MA_RC_CTRL 16 bit MAC Arbiter Recovery Ctrl Reg */
457enum {
458 MA_ENA_REC_TX2 = 1<<7, /* Enable Recovery Timer TX2 */
459 MA_DIS_REC_TX2 = 1<<6, /* Disable Recovery Timer TX2 */
460 MA_ENA_REC_TX1 = 1<<5, /* Enable Recovery Timer TX1 */
461 MA_DIS_REC_TX1 = 1<<4, /* Disable Recovery Timer TX1 */
462 MA_ENA_REC_RX2 = 1<<3, /* Enable Recovery Timer RX2 */
463 MA_DIS_REC_RX2 = 1<<2, /* Disable Recovery Timer RX2 */
464 MA_ENA_REC_RX1 = 1<<1, /* Enable Recovery Timer RX1 */
465 MA_DIS_REC_RX1 = 1<<0, /* Disable Recovery Timer RX1 */
466};
467
468/* Packet Arbiter Registers */
469/* B3_PA_CTRL 16 bit Packet Arbiter Ctrl Register */
470enum {
471 PA_CLR_TO_TX2 = 1<<13, /* Clear IRQ Packet Timeout TX2 */
472 PA_CLR_TO_TX1 = 1<<12, /* Clear IRQ Packet Timeout TX1 */
473 PA_CLR_TO_RX2 = 1<<11, /* Clear IRQ Packet Timeout RX2 */
474 PA_CLR_TO_RX1 = 1<<10, /* Clear IRQ Packet Timeout RX1 */
475 PA_ENA_TO_TX2 = 1<<9, /* Enable Timeout Timer TX2 */
476 PA_DIS_TO_TX2 = 1<<8, /* Disable Timeout Timer TX2 */
477 PA_ENA_TO_TX1 = 1<<7, /* Enable Timeout Timer TX1 */
478 PA_DIS_TO_TX1 = 1<<6, /* Disable Timeout Timer TX1 */
479 PA_ENA_TO_RX2 = 1<<5, /* Enable Timeout Timer RX2 */
480 PA_DIS_TO_RX2 = 1<<4, /* Disable Timeout Timer RX2 */
481 PA_ENA_TO_RX1 = 1<<3, /* Enable Timeout Timer RX1 */
482 PA_DIS_TO_RX1 = 1<<2, /* Disable Timeout Timer RX1 */
483 PA_RST_CLR = 1<<1, /* Clear MAC Arbiter Reset */
484 PA_RST_SET = 1<<0, /* Set MAC Arbiter Reset */
485};
486
487#define PA_ENA_TO_ALL (PA_ENA_TO_RX1 | PA_ENA_TO_RX2 |\
488 PA_ENA_TO_TX1 | PA_ENA_TO_TX2)
489
490
491/* Transmit Arbiter Registers MAC 1 and 2, use MR_ADDR() to access */
492/* TXA_ITI_INI 32 bit Tx Arb Interval Timer Init Val */
493/* TXA_ITI_VAL 32 bit Tx Arb Interval Timer Value */
494/* TXA_LIM_INI 32 bit Tx Arb Limit Counter Init Val */
495/* TXA_LIM_VAL 32 bit Tx Arb Limit Counter Value */
496
497#define TXA_MAX_VAL 0x00ffffffUL /* Bit 23.. 0: Max TXA Timer/Cnt Val */
498
499/* TXA_CTRL 8 bit Tx Arbiter Control Register */
500enum {
501 TXA_ENA_FSYNC = 1<<7, /* Enable force of sync Tx queue */
502 TXA_DIS_FSYNC = 1<<6, /* Disable force of sync Tx queue */
503 TXA_ENA_ALLOC = 1<<5, /* Enable alloc of free bandwidth */
504 TXA_DIS_ALLOC = 1<<4, /* Disable alloc of free bandwidth */
505 TXA_START_RC = 1<<3, /* Start sync Rate Control */
506 TXA_STOP_RC = 1<<2, /* Stop sync Rate Control */
507 TXA_ENA_ARB = 1<<1, /* Enable Tx Arbiter */
508 TXA_DIS_ARB = 1<<0, /* Disable Tx Arbiter */
509};
510
511/*
512 * Bank 4 - 5
513 */
514/* Transmit Arbiter Registers MAC 1 and 2, use MR_ADDR() to access */
515enum {
516 TXA_ITI_INI = 0x0200,/* 32 bit Tx Arb Interval Timer Init Val*/
517 TXA_ITI_VAL = 0x0204,/* 32 bit Tx Arb Interval Timer Value */
518 TXA_LIM_INI = 0x0208,/* 32 bit Tx Arb Limit Counter Init Val */
519 TXA_LIM_VAL = 0x020c,/* 32 bit Tx Arb Limit Counter Value */
520 TXA_CTRL = 0x0210,/* 8 bit Tx Arbiter Control Register */
521 TXA_TEST = 0x0211,/* 8 bit Tx Arbiter Test Register */
522 TXA_STAT = 0x0212,/* 8 bit Tx Arbiter Status Register */
523};
524
525
526enum {
527 B6_EXT_REG = 0x0300,/* External registers (GENESIS only) */
528 B7_CFG_SPC = 0x0380,/* copy of the Configuration register */
529 B8_RQ1_REGS = 0x0400,/* Receive Queue 1 */
530 B8_RQ2_REGS = 0x0480,/* Receive Queue 2 */
531 B8_TS1_REGS = 0x0600,/* Transmit sync queue 1 */
532 B8_TA1_REGS = 0x0680,/* Transmit async queue 1 */
533 B8_TS2_REGS = 0x0700,/* Transmit sync queue 2 */
534 B8_TA2_REGS = 0x0780,/* Transmit sync queue 2 */
535 B16_RAM_REGS = 0x0800,/* RAM Buffer Registers */
536};
537
538/* Queue Register Offsets, use Q_ADDR() to access */
539enum {
540 B8_Q_REGS = 0x0400, /* base of Queue registers */
541 Q_D = 0x00, /* 8*32 bit Current Descriptor */
542 Q_DA_L = 0x20, /* 32 bit Current Descriptor Address Low dWord */
543 Q_DA_H = 0x24, /* 32 bit Current Descriptor Address High dWord */
544 Q_AC_L = 0x28, /* 32 bit Current Address Counter Low dWord */
545 Q_AC_H = 0x2c, /* 32 bit Current Address Counter High dWord */
546 Q_BC = 0x30, /* 32 bit Current Byte Counter */
547 Q_CSR = 0x34, /* 32 bit BMU Control/Status Register */
548 Q_F = 0x38, /* 32 bit Flag Register */
549 Q_T1 = 0x3c, /* 32 bit Test Register 1 */
550 Q_T1_TR = 0x3c, /* 8 bit Test Register 1 Transfer SM */
551 Q_T1_WR = 0x3d, /* 8 bit Test Register 1 Write Descriptor SM */
552 Q_T1_RD = 0x3e, /* 8 bit Test Register 1 Read Descriptor SM */
553 Q_T1_SV = 0x3f, /* 8 bit Test Register 1 Supervisor SM */
554 Q_T2 = 0x40, /* 32 bit Test Register 2 */
555 Q_T3 = 0x44, /* 32 bit Test Register 3 */
556
557/* Yukon-2 */
558 Q_DONE = 0x24, /* 16 bit Done Index (Yukon-2 only) */
559 Q_WM = 0x40, /* 16 bit FIFO Watermark */
560 Q_AL = 0x42, /* 8 bit FIFO Alignment */
561 Q_RSP = 0x44, /* 16 bit FIFO Read Shadow Pointer */
562 Q_RSL = 0x46, /* 8 bit FIFO Read Shadow Level */
563 Q_RP = 0x48, /* 8 bit FIFO Read Pointer */
564 Q_RL = 0x4a, /* 8 bit FIFO Read Level */
565 Q_WP = 0x4c, /* 8 bit FIFO Write Pointer */
566 Q_WSP = 0x4d, /* 8 bit FIFO Write Shadow Pointer */
567 Q_WL = 0x4e, /* 8 bit FIFO Write Level */
568 Q_WSL = 0x4f, /* 8 bit FIFO Write Shadow Level */
569};
570#define Q_ADDR(reg, offs) (B8_Q_REGS + (reg) + (offs))
571
572/* RAM Buffer Register Offsets */
573enum {
574
575 RB_START = 0x00,/* 32 bit RAM Buffer Start Address */
576 RB_END = 0x04,/* 32 bit RAM Buffer End Address */
577 RB_WP = 0x08,/* 32 bit RAM Buffer Write Pointer */
578 RB_RP = 0x0c,/* 32 bit RAM Buffer Read Pointer */
579 RB_RX_UTPP = 0x10,/* 32 bit Rx Upper Threshold, Pause Packet */
580 RB_RX_LTPP = 0x14,/* 32 bit Rx Lower Threshold, Pause Packet */
581 RB_RX_UTHP = 0x18,/* 32 bit Rx Upper Threshold, High Prio */
582 RB_RX_LTHP = 0x1c,/* 32 bit Rx Lower Threshold, High Prio */
583 /* 0x10 - 0x1f: reserved at Tx RAM Buffer Registers */
584 RB_PC = 0x20,/* 32 bit RAM Buffer Packet Counter */
585 RB_LEV = 0x24,/* 32 bit RAM Buffer Level Register */
586 RB_CTRL = 0x28,/* 32 bit RAM Buffer Control Register */
587 RB_TST1 = 0x29,/* 8 bit RAM Buffer Test Register 1 */
588 RB_TST2 = 0x2a,/* 8 bit RAM Buffer Test Register 2 */
589};
590
591/* Receive and Transmit Queues */
592enum {
593 Q_R1 = 0x0000, /* Receive Queue 1 */
594 Q_R2 = 0x0080, /* Receive Queue 2 */
595 Q_XS1 = 0x0200, /* Synchronous Transmit Queue 1 */
596 Q_XA1 = 0x0280, /* Asynchronous Transmit Queue 1 */
597 Q_XS2 = 0x0300, /* Synchronous Transmit Queue 2 */
598 Q_XA2 = 0x0380, /* Asynchronous Transmit Queue 2 */
599};
600
601/* Different MAC Types */
602enum {
603 SK_MAC_XMAC = 0, /* Xaqti XMAC II */
604 SK_MAC_GMAC = 1, /* Marvell GMAC */
605};
606
607/* Different PHY Types */
608enum {
609 SK_PHY_XMAC = 0,/* integrated in XMAC II */
610 SK_PHY_BCOM = 1,/* Broadcom BCM5400 */
611 SK_PHY_LONE = 2,/* Level One LXT1000 [not supported]*/
612 SK_PHY_NAT = 3,/* National DP83891 [not supported] */
613 SK_PHY_MARV_COPPER= 4,/* Marvell 88E1011S */
614 SK_PHY_MARV_FIBER = 5,/* Marvell 88E1011S working on fiber */
615};
616
617/* PHY addresses (bits 12..8 of PHY address reg) */
618enum {
619 PHY_ADDR_XMAC = 0<<8,
620 PHY_ADDR_BCOM = 1<<8,
621 PHY_ADDR_LONE = 3<<8,
622 PHY_ADDR_NAT = 0<<8,
623/* GPHY address (bits 15..11 of SMI control reg) */
624 PHY_ADDR_MARV = 0,
625};
626
627#define RB_ADDR(offs, queue) (B16_RAM_REGS + (queue) + (offs))
628
629/* Receive MAC FIFO, Receive LED, and Link_Sync regs (GENESIS only) */
630enum {
631 RX_MFF_EA = 0x0c00,/* 32 bit Receive MAC FIFO End Address */
632 RX_MFF_WP = 0x0c04,/* 32 bit Receive MAC FIFO Write Pointer */
633
634 RX_MFF_RP = 0x0c0c,/* 32 bit Receive MAC FIFO Read Pointer */
635 RX_MFF_PC = 0x0c10,/* 32 bit Receive MAC FIFO Packet Cnt */
636 RX_MFF_LEV = 0x0c14,/* 32 bit Receive MAC FIFO Level */
637 RX_MFF_CTRL1 = 0x0c18,/* 16 bit Receive MAC FIFO Control Reg 1*/
638 RX_MFF_STAT_TO = 0x0c1a,/* 8 bit Receive MAC Status Timeout */
639 RX_MFF_TIST_TO = 0x0c1b,/* 8 bit Receive MAC Time Stamp Timeout */
640 RX_MFF_CTRL2 = 0x0c1c,/* 8 bit Receive MAC FIFO Control Reg 2*/
641 RX_MFF_TST1 = 0x0c1d,/* 8 bit Receive MAC FIFO Test Reg 1 */
642 RX_MFF_TST2 = 0x0c1e,/* 8 bit Receive MAC FIFO Test Reg 2 */
643
644 RX_LED_INI = 0x0c20,/* 32 bit Receive LED Cnt Init Value */
645 RX_LED_VAL = 0x0c24,/* 32 bit Receive LED Cnt Current Value */
646 RX_LED_CTRL = 0x0c28,/* 8 bit Receive LED Cnt Control Reg */
647 RX_LED_TST = 0x0c29,/* 8 bit Receive LED Cnt Test Register */
648
649 LNK_SYNC_INI = 0x0c30,/* 32 bit Link Sync Cnt Init Value */
650 LNK_SYNC_VAL = 0x0c34,/* 32 bit Link Sync Cnt Current Value */
651 LNK_SYNC_CTRL = 0x0c38,/* 8 bit Link Sync Cnt Control Register */
652 LNK_SYNC_TST = 0x0c39,/* 8 bit Link Sync Cnt Test Register */
653 LNK_LED_REG = 0x0c3c,/* 8 bit Link LED Register */
654};
655
656/* Receive and Transmit MAC FIFO Registers (GENESIS only) */
657/* RX_MFF_CTRL1 16 bit Receive MAC FIFO Control Reg 1 */
658enum {
659 MFF_ENA_RDY_PAT = 1<<13, /* Enable Ready Patch */
660 MFF_DIS_RDY_PAT = 1<<12, /* Disable Ready Patch */
661 MFF_ENA_TIM_PAT = 1<<11, /* Enable Timing Patch */
662 MFF_DIS_TIM_PAT = 1<<10, /* Disable Timing Patch */
663 MFF_ENA_ALM_FUL = 1<<9, /* Enable AlmostFull Sign */
664 MFF_DIS_ALM_FUL = 1<<8, /* Disable AlmostFull Sign */
665 MFF_ENA_PAUSE = 1<<7, /* Enable Pause Signaling */
666 MFF_DIS_PAUSE = 1<<6, /* Disable Pause Signaling */
667 MFF_ENA_FLUSH = 1<<5, /* Enable Frame Flushing */
668 MFF_DIS_FLUSH = 1<<4, /* Disable Frame Flushing */
669 MFF_ENA_TIST = 1<<3, /* Enable Time Stamp Gener */
670 MFF_DIS_TIST = 1<<2, /* Disable Time Stamp Gener */
671 MFF_CLR_INTIST = 1<<1, /* Clear IRQ No Time Stamp */
672 MFF_CLR_INSTAT = 1<<0, /* Clear IRQ No Status */
673#define MFF_RX_CTRL_DEF MFF_ENA_TIM_PAT
674};
675
676/* TX_MFF_CTRL1 16 bit Transmit MAC FIFO Control Reg 1 */
677enum {
678 MFF_CLR_PERR = 1<<15, /* Clear Parity Error IRQ */
679 /* Bit 14: reserved */
680 MFF_ENA_PKT_REC = 1<<13, /* Enable Packet Recovery */
681 MFF_DIS_PKT_REC = 1<<12, /* Disable Packet Recovery */
682
683 MFF_ENA_W4E = 1<<7, /* Enable Wait for Empty */
684 MFF_DIS_W4E = 1<<6, /* Disable Wait for Empty */
685
686 MFF_ENA_LOOPB = 1<<3, /* Enable Loopback */
687 MFF_DIS_LOOPB = 1<<2, /* Disable Loopback */
688 MFF_CLR_MAC_RST = 1<<1, /* Clear XMAC Reset */
689 MFF_SET_MAC_RST = 1<<0, /* Set XMAC Reset */
690};
691
692#define MFF_TX_CTRL_DEF (MFF_ENA_PKT_REC | MFF_ENA_TIM_PAT | MFF_ENA_FLUSH)
693
694/* RX_MFF_TST2 8 bit Receive MAC FIFO Test Register 2 */
695/* TX_MFF_TST2 8 bit Transmit MAC FIFO Test Register 2 */
696enum {
697 MFF_WSP_T_ON = 1<<6, /* Tx: Write Shadow Ptr TestOn */
698 MFF_WSP_T_OFF = 1<<5, /* Tx: Write Shadow Ptr TstOff */
699 MFF_WSP_INC = 1<<4, /* Tx: Write Shadow Ptr Increment */
700 MFF_PC_DEC = 1<<3, /* Packet Counter Decrement */
701 MFF_PC_T_ON = 1<<2, /* Packet Counter Test On */
702 MFF_PC_T_OFF = 1<<1, /* Packet Counter Test Off */
703 MFF_PC_INC = 1<<0, /* Packet Counter Increment */
704};
705
706/* RX_MFF_TST1 8 bit Receive MAC FIFO Test Register 1 */
707/* TX_MFF_TST1 8 bit Transmit MAC FIFO Test Register 1 */
708enum {
709 MFF_WP_T_ON = 1<<6, /* Write Pointer Test On */
710 MFF_WP_T_OFF = 1<<5, /* Write Pointer Test Off */
711 MFF_WP_INC = 1<<4, /* Write Pointer Increm */
712
713 MFF_RP_T_ON = 1<<2, /* Read Pointer Test On */
714 MFF_RP_T_OFF = 1<<1, /* Read Pointer Test Off */
715 MFF_RP_DEC = 1<<0, /* Read Pointer Decrement */
716};
717
718/* RX_MFF_CTRL2 8 bit Receive MAC FIFO Control Reg 2 */
719/* TX_MFF_CTRL2 8 bit Transmit MAC FIFO Control Reg 2 */
720enum {
721 MFF_ENA_OP_MD = 1<<3, /* Enable Operation Mode */
722 MFF_DIS_OP_MD = 1<<2, /* Disable Operation Mode */
723 MFF_RST_CLR = 1<<1, /* Clear MAC FIFO Reset */
724 MFF_RST_SET = 1<<0, /* Set MAC FIFO Reset */
725};
726
727
728/* Link LED Counter Registers (GENESIS only) */
729
730/* RX_LED_CTRL 8 bit Receive LED Cnt Control Reg */
731/* TX_LED_CTRL 8 bit Transmit LED Cnt Control Reg */
732/* LNK_SYNC_CTRL 8 bit Link Sync Cnt Control Register */
733enum {
734 LED_START = 1<<2, /* Start Timer */
735 LED_STOP = 1<<1, /* Stop Timer */
736 LED_STATE = 1<<0, /* Rx/Tx: LED State, 1=LED on */
737};
738
739/* RX_LED_TST 8 bit Receive LED Cnt Test Register */
740/* TX_LED_TST 8 bit Transmit LED Cnt Test Register */
741/* LNK_SYNC_TST 8 bit Link Sync Cnt Test Register */
742enum {
743 LED_T_ON = 1<<2, /* LED Counter Test mode On */
744 LED_T_OFF = 1<<1, /* LED Counter Test mode Off */
745 LED_T_STEP = 1<<0, /* LED Counter Step */
746};
747
748/* LNK_LED_REG 8 bit Link LED Register */
749enum {
750 LED_BLK_ON = 1<<5, /* Link LED Blinking On */
751 LED_BLK_OFF = 1<<4, /* Link LED Blinking Off */
752 LED_SYNC_ON = 1<<3, /* Use Sync Wire to switch LED */
753 LED_SYNC_OFF = 1<<2, /* Disable Sync Wire Input */
754 LED_ON = 1<<1, /* switch LED on */
755 LED_OFF = 1<<0, /* switch LED off */
756};
757
758/* Receive GMAC FIFO (YUKON and Yukon-2) */
759enum {
760 RX_GMF_EA = 0x0c40,/* 32 bit Rx GMAC FIFO End Address */
761 RX_GMF_AF_THR = 0x0c44,/* 32 bit Rx GMAC FIFO Almost Full Thresh. */
762 RX_GMF_CTRL_T = 0x0c48,/* 32 bit Rx GMAC FIFO Control/Test */
763 RX_GMF_FL_MSK = 0x0c4c,/* 32 bit Rx GMAC FIFO Flush Mask */
764 RX_GMF_FL_THR = 0x0c50,/* 32 bit Rx GMAC FIFO Flush Threshold */
765 RX_GMF_TR_THR = 0x0c54,/* 32 bit Rx Truncation Threshold (Yukon-2) */
766
767 RX_GMF_VLAN = 0x0c5c,/* 32 bit Rx VLAN Type Register (Yukon-2) */
768 RX_GMF_WP = 0x0c60,/* 32 bit Rx GMAC FIFO Write Pointer */
769
770 RX_GMF_WLEV = 0x0c68,/* 32 bit Rx GMAC FIFO Write Level */
771
772 RX_GMF_RP = 0x0c70,/* 32 bit Rx GMAC FIFO Read Pointer */
773
774 RX_GMF_RLEV = 0x0c78,/* 32 bit Rx GMAC FIFO Read Level */
775};
776
777
778/* TXA_TEST 8 bit Tx Arbiter Test Register */
779enum {
780 TXA_INT_T_ON = 1<<5, /* Tx Arb Interval Timer Test On */
781 TXA_INT_T_OFF = 1<<4, /* Tx Arb Interval Timer Test Off */
782 TXA_INT_T_STEP = 1<<3, /* Tx Arb Interval Timer Step */
783 TXA_LIM_T_ON = 1<<2, /* Tx Arb Limit Timer Test On */
784 TXA_LIM_T_OFF = 1<<1, /* Tx Arb Limit Timer Test Off */
785 TXA_LIM_T_STEP = 1<<0, /* Tx Arb Limit Timer Step */
786};
787
788/* TXA_STAT 8 bit Tx Arbiter Status Register */
789enum {
790 TXA_PRIO_XS = 1<<0, /* sync queue has prio to send */
791};
792
793
794/* Q_BC 32 bit Current Byte Counter */
795
796/* BMU Control Status Registers */
797/* B0_R1_CSR 32 bit BMU Ctrl/Stat Rx Queue 1 */
798/* B0_R2_CSR 32 bit BMU Ctrl/Stat Rx Queue 2 */
799/* B0_XA1_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 1 */
800/* B0_XS1_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 1 */
801/* B0_XA2_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 2 */
802/* B0_XS2_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 2 */
803/* Q_CSR 32 bit BMU Control/Status Register */
804
805enum {
806 CSR_SV_IDLE = 1<<24, /* BMU SM Idle */
807
808 CSR_DESC_CLR = 1<<21, /* Clear Reset for Descr */
809 CSR_DESC_SET = 1<<20, /* Set Reset for Descr */
810 CSR_FIFO_CLR = 1<<19, /* Clear Reset for FIFO */
811 CSR_FIFO_SET = 1<<18, /* Set Reset for FIFO */
812 CSR_HPI_RUN = 1<<17, /* Release HPI SM */
813 CSR_HPI_RST = 1<<16, /* Reset HPI SM to Idle */
814 CSR_SV_RUN = 1<<15, /* Release Supervisor SM */
815 CSR_SV_RST = 1<<14, /* Reset Supervisor SM */
816 CSR_DREAD_RUN = 1<<13, /* Release Descr Read SM */
817 CSR_DREAD_RST = 1<<12, /* Reset Descr Read SM */
818 CSR_DWRITE_RUN = 1<<11, /* Release Descr Write SM */
819 CSR_DWRITE_RST = 1<<10, /* Reset Descr Write SM */
820 CSR_TRANS_RUN = 1<<9, /* Release Transfer SM */
821 CSR_TRANS_RST = 1<<8, /* Reset Transfer SM */
822 CSR_ENA_POL = 1<<7, /* Enable Descr Polling */
823 CSR_DIS_POL = 1<<6, /* Disable Descr Polling */
824 CSR_STOP = 1<<5, /* Stop Rx/Tx Queue */
825 CSR_START = 1<<4, /* Start Rx/Tx Queue */
826 CSR_IRQ_CL_P = 1<<3, /* (Rx) Clear Parity IRQ */
827 CSR_IRQ_CL_B = 1<<2, /* Clear EOB IRQ */
828 CSR_IRQ_CL_F = 1<<1, /* Clear EOF IRQ */
829 CSR_IRQ_CL_C = 1<<0, /* Clear ERR IRQ */
830};
831
832#define CSR_SET_RESET (CSR_DESC_SET | CSR_FIFO_SET | CSR_HPI_RST |\
833 CSR_SV_RST | CSR_DREAD_RST | CSR_DWRITE_RST |\
834 CSR_TRANS_RST)
835#define CSR_CLR_RESET (CSR_DESC_CLR | CSR_FIFO_CLR | CSR_HPI_RUN |\
836 CSR_SV_RUN | CSR_DREAD_RUN | CSR_DWRITE_RUN |\
837 CSR_TRANS_RUN)
838
839/* Q_F 32 bit Flag Register */
840enum {
841 F_ALM_FULL = 1<<27, /* Rx FIFO: almost full */
842 F_EMPTY = 1<<27, /* Tx FIFO: empty flag */
843 F_FIFO_EOF = 1<<26, /* Tag (EOF Flag) bit in FIFO */
844 F_WM_REACHED = 1<<25, /* Watermark reached */
845
846 F_FIFO_LEVEL = 0x1fL<<16, /* Bit 23..16: # of Qwords in FIFO */
847 F_WATER_MARK = 0x0007ffL, /* Bit 10.. 0: Watermark */
848};
849
850/* RAM Buffer Register Offsets, use RB_ADDR(Queue, Offs) to access */
851/* RB_START 32 bit RAM Buffer Start Address */
852/* RB_END 32 bit RAM Buffer End Address */
853/* RB_WP 32 bit RAM Buffer Write Pointer */
854/* RB_RP 32 bit RAM Buffer Read Pointer */
855/* RB_RX_UTPP 32 bit Rx Upper Threshold, Pause Pack */
856/* RB_RX_LTPP 32 bit Rx Lower Threshold, Pause Pack */
857/* RB_RX_UTHP 32 bit Rx Upper Threshold, High Prio */
858/* RB_RX_LTHP 32 bit Rx Lower Threshold, High Prio */
859/* RB_PC 32 bit RAM Buffer Packet Counter */
860/* RB_LEV 32 bit RAM Buffer Level Register */
861
862#define RB_MSK 0x0007ffff /* Bit 18.. 0: RAM Buffer Pointer Bits */
863/* RB_TST2 8 bit RAM Buffer Test Register 2 */
864/* RB_TST1 8 bit RAM Buffer Test Register 1 */
865
866/* RB_CTRL 8 bit RAM Buffer Control Register */
867enum {
868 RB_ENA_STFWD = 1<<5, /* Enable Store & Forward */
869 RB_DIS_STFWD = 1<<4, /* Disable Store & Forward */
870 RB_ENA_OP_MD = 1<<3, /* Enable Operation Mode */
871 RB_DIS_OP_MD = 1<<2, /* Disable Operation Mode */
872 RB_RST_CLR = 1<<1, /* Clear RAM Buf STM Reset */
873 RB_RST_SET = 1<<0, /* Set RAM Buf STM Reset */
874};
875
876/* Transmit MAC FIFO and Transmit LED Registers (GENESIS only), */
877enum {
878 TX_MFF_EA = 0x0d00,/* 32 bit Transmit MAC FIFO End Address */
879 TX_MFF_WP = 0x0d04,/* 32 bit Transmit MAC FIFO WR Pointer */
880 TX_MFF_WSP = 0x0d08,/* 32 bit Transmit MAC FIFO WR Shadow Ptr */
881 TX_MFF_RP = 0x0d0c,/* 32 bit Transmit MAC FIFO RD Pointer */
882 TX_MFF_PC = 0x0d10,/* 32 bit Transmit MAC FIFO Packet Cnt */
883 TX_MFF_LEV = 0x0d14,/* 32 bit Transmit MAC FIFO Level */
884 TX_MFF_CTRL1 = 0x0d18,/* 16 bit Transmit MAC FIFO Ctrl Reg 1 */
885 TX_MFF_WAF = 0x0d1a,/* 8 bit Transmit MAC Wait after flush */
886
887 TX_MFF_CTRL2 = 0x0d1c,/* 8 bit Transmit MAC FIFO Ctrl Reg 2 */
888 TX_MFF_TST1 = 0x0d1d,/* 8 bit Transmit MAC FIFO Test Reg 1 */
889 TX_MFF_TST2 = 0x0d1e,/* 8 bit Transmit MAC FIFO Test Reg 2 */
890
891 TX_LED_INI = 0x0d20,/* 32 bit Transmit LED Cnt Init Value */
892 TX_LED_VAL = 0x0d24,/* 32 bit Transmit LED Cnt Current Val */
893 TX_LED_CTRL = 0x0d28,/* 8 bit Transmit LED Cnt Control Reg */
894 TX_LED_TST = 0x0d29,/* 8 bit Transmit LED Cnt Test Reg */
895};
896
897/* Counter and Timer constants, for a host clock of 62.5 MHz */
898#define SK_XMIT_DUR 0x002faf08UL /* 50 ms */
899#define SK_BLK_DUR 0x01dcd650UL /* 500 ms */
900
901#define SK_DPOLL_DEF 0x00ee6b28UL /* 250 ms at 62.5 MHz */
902
903#define SK_DPOLL_MAX 0x00ffffffUL /* 268 ms at 62.5 MHz */
904 /* 215 ms at 78.12 MHz */
905
906#define SK_FACT_62 100 /* is given in percent */
907#define SK_FACT_53 85 /* on GENESIS: 53.12 MHz */
908#define SK_FACT_78 125 /* on YUKON: 78.12 MHz */
909
910
911/* Transmit GMAC FIFO (YUKON only) */
912enum {
913 TX_GMF_EA = 0x0d40,/* 32 bit Tx GMAC FIFO End Address */
914 TX_GMF_AE_THR = 0x0d44,/* 32 bit Tx GMAC FIFO Almost Empty Thresh.*/
915 TX_GMF_CTRL_T = 0x0d48,/* 32 bit Tx GMAC FIFO Control/Test */
916
917 TX_GMF_WP = 0x0d60,/* 32 bit Tx GMAC FIFO Write Pointer */
918 TX_GMF_WSP = 0x0d64,/* 32 bit Tx GMAC FIFO Write Shadow Ptr. */
919 TX_GMF_WLEV = 0x0d68,/* 32 bit Tx GMAC FIFO Write Level */
920
921 TX_GMF_RP = 0x0d70,/* 32 bit Tx GMAC FIFO Read Pointer */
922 TX_GMF_RSTP = 0x0d74,/* 32 bit Tx GMAC FIFO Restart Pointer */
923 TX_GMF_RLEV = 0x0d78,/* 32 bit Tx GMAC FIFO Read Level */
924
925 /* Descriptor Poll Timer Registers */
926 B28_DPT_INI = 0x0e00,/* 24 bit Descriptor Poll Timer Init Val */
927 B28_DPT_VAL = 0x0e04,/* 24 bit Descriptor Poll Timer Curr Val */
928 B28_DPT_CTRL = 0x0e08,/* 8 bit Descriptor Poll Timer Ctrl Reg */
929
930 B28_DPT_TST = 0x0e0a,/* 8 bit Descriptor Poll Timer Test Reg */
931
932 /* Time Stamp Timer Registers (YUKON only) */
933 GMAC_TI_ST_VAL = 0x0e14,/* 32 bit Time Stamp Timer Curr Val */
934 GMAC_TI_ST_CTRL = 0x0e18,/* 8 bit Time Stamp Timer Ctrl Reg */
935 GMAC_TI_ST_TST = 0x0e1a,/* 8 bit Time Stamp Timer Test Reg */
936};
937
938/* Status BMU Registers (Yukon-2 only)*/
939enum {
940 STAT_CTRL = 0x0e80,/* 32 bit Status BMU Control Reg */
941 STAT_LAST_IDX = 0x0e84,/* 16 bit Status BMU Last Index */
942 /* 0x0e85 - 0x0e86: reserved */
943 STAT_LIST_ADDR_LO = 0x0e88,/* 32 bit Status List Start Addr (low) */
944 STAT_LIST_ADDR_HI = 0x0e8c,/* 32 bit Status List Start Addr (high) */
945 STAT_TXA1_RIDX = 0x0e90,/* 16 bit Status TxA1 Report Index Reg */
946 STAT_TXS1_RIDX = 0x0e92,/* 16 bit Status TxS1 Report Index Reg */
947 STAT_TXA2_RIDX = 0x0e94,/* 16 bit Status TxA2 Report Index Reg */
948 STAT_TXS2_RIDX = 0x0e96,/* 16 bit Status TxS2 Report Index Reg */
949 STAT_TX_IDX_TH = 0x0e98,/* 16 bit Status Tx Index Threshold Reg */
950 STAT_PUT_IDX = 0x0e9c,/* 16 bit Status Put Index Reg */
951
952/* FIFO Control/Status Registers (Yukon-2 only)*/
953 STAT_FIFO_WP = 0x0ea0,/* 8 bit Status FIFO Write Pointer Reg */
954 STAT_FIFO_RP = 0x0ea4,/* 8 bit Status FIFO Read Pointer Reg */
955 STAT_FIFO_RSP = 0x0ea6,/* 8 bit Status FIFO Read Shadow Ptr */
956 STAT_FIFO_LEVEL = 0x0ea8,/* 8 bit Status FIFO Level Reg */
957 STAT_FIFO_SHLVL = 0x0eaa,/* 8 bit Status FIFO Shadow Level Reg */
958 STAT_FIFO_WM = 0x0eac,/* 8 bit Status FIFO Watermark Reg */
959 STAT_FIFO_ISR_WM = 0x0ead,/* 8 bit Status FIFO ISR Watermark Reg */
960
961/* Level and ISR Timer Registers (Yukon-2 only)*/
962 STAT_LEV_TIMER_INI = 0x0eb0,/* 32 bit Level Timer Init. Value Reg */
963 STAT_LEV_TIMER_CNT = 0x0eb4,/* 32 bit Level Timer Counter Reg */
964 STAT_LEV_TIMER_CTRL = 0x0eb8,/* 8 bit Level Timer Control Reg */
965 STAT_LEV_TIMER_TEST = 0x0eb9,/* 8 bit Level Timer Test Reg */
966 STAT_TX_TIMER_INI = 0x0ec0,/* 32 bit Tx Timer Init. Value Reg */
967 STAT_TX_TIMER_CNT = 0x0ec4,/* 32 bit Tx Timer Counter Reg */
968 STAT_TX_TIMER_CTRL = 0x0ec8,/* 8 bit Tx Timer Control Reg */
969 STAT_TX_TIMER_TEST = 0x0ec9,/* 8 bit Tx Timer Test Reg */
970 STAT_ISR_TIMER_INI = 0x0ed0,/* 32 bit ISR Timer Init. Value Reg */
971 STAT_ISR_TIMER_CNT = 0x0ed4,/* 32 bit ISR Timer Counter Reg */
972 STAT_ISR_TIMER_CTRL = 0x0ed8,/* 8 bit ISR Timer Control Reg */
973 STAT_ISR_TIMER_TEST = 0x0ed9,/* 8 bit ISR Timer Test Reg */
974
975 ST_LAST_IDX_MASK = 0x007f,/* Last Index Mask */
976 ST_TXRP_IDX_MASK = 0x0fff,/* Tx Report Index Mask */
977 ST_TXTH_IDX_MASK = 0x0fff,/* Tx Threshold Index Mask */
978 ST_WM_IDX_MASK = 0x3f,/* FIFO Watermark Index Mask */
979};
980
981enum {
982 LINKLED_OFF = 0x01,
983 LINKLED_ON = 0x02,
984 LINKLED_LINKSYNC_OFF = 0x04,
985 LINKLED_LINKSYNC_ON = 0x08,
986 LINKLED_BLINK_OFF = 0x10,
987 LINKLED_BLINK_ON = 0x20,
988};
989
990/* GMAC and GPHY Control Registers (YUKON only) */
991enum {
992 GMAC_CTRL = 0x0f00,/* 32 bit GMAC Control Reg */
993 GPHY_CTRL = 0x0f04,/* 32 bit GPHY Control Reg */
994 GMAC_IRQ_SRC = 0x0f08,/* 8 bit GMAC Interrupt Source Reg */
995 GMAC_IRQ_MSK = 0x0f0c,/* 8 bit GMAC Interrupt Mask Reg */
996 GMAC_LINK_CTRL = 0x0f10,/* 16 bit Link Control Reg */
997
998/* Wake-up Frame Pattern Match Control Registers (YUKON only) */
999
1000 WOL_REG_OFFS = 0x20,/* HW-Bug: Address is + 0x20 against spec. */
1001
1002 WOL_CTRL_STAT = 0x0f20,/* 16 bit WOL Control/Status Reg */
1003 WOL_MATCH_CTL = 0x0f22,/* 8 bit WOL Match Control Reg */
1004 WOL_MATCH_RES = 0x0f23,/* 8 bit WOL Match Result Reg */
1005 WOL_MAC_ADDR = 0x0f24,/* 32 bit WOL MAC Address */
1006 WOL_PATT_PME = 0x0f2a,/* 8 bit WOL PME Match Enable (Yukon-2) */
1007 WOL_PATT_ASFM = 0x0f2b,/* 8 bit WOL ASF Match Enable (Yukon-2) */
1008 WOL_PATT_RPTR = 0x0f2c,/* 8 bit WOL Pattern Read Pointer */
1009
1010/* WOL Pattern Length Registers (YUKON only) */
1011
1012 WOL_PATT_LEN_LO = 0x0f30,/* 32 bit WOL Pattern Length 3..0 */
1013 WOL_PATT_LEN_HI = 0x0f34,/* 24 bit WOL Pattern Length 6..4 */
1014
1015/* WOL Pattern Counter Registers (YUKON only) */
1016
1017 WOL_PATT_CNT_0 = 0x0f38,/* 32 bit WOL Pattern Counter 3..0 */
1018 WOL_PATT_CNT_4 = 0x0f3c,/* 24 bit WOL Pattern Counter 6..4 */
1019};
1020
1021enum {
1022 WOL_PATT_RAM_1 = 0x1000,/* WOL Pattern RAM Link 1 */
1023 WOL_PATT_RAM_2 = 0x1400,/* WOL Pattern RAM Link 2 */
1024};
1025
1026enum {
1027 BASE_XMAC_1 = 0x2000,/* XMAC 1 registers */
1028 BASE_GMAC_1 = 0x2800,/* GMAC 1 registers */
1029 BASE_XMAC_2 = 0x3000,/* XMAC 2 registers */
1030 BASE_GMAC_2 = 0x3800,/* GMAC 2 registers */
1031};
1032
1033/*
1034 * Receive Frame Status Encoding
1035 */
1036enum {
1037 XMR_FS_LEN = 0x3fff<<18, /* Bit 31..18: Rx Frame Length */
1038 XMR_FS_2L_VLAN = 1<<17, /* Bit 17: tagged wh 2Lev VLAN ID*/
1039 XMR_FS_1_VLAN = 1<<16, /* Bit 16: tagged wh 1ev VLAN ID*/
1040 XMR_FS_BC = 1<<15, /* Bit 15: Broadcast Frame */
1041 XMR_FS_MC = 1<<14, /* Bit 14: Multicast Frame */
1042 XMR_FS_UC = 1<<13, /* Bit 13: Unicast Frame */
1043
1044 XMR_FS_BURST = 1<<11, /* Bit 11: Burst Mode */
1045 XMR_FS_CEX_ERR = 1<<10, /* Bit 10: Carrier Ext. Error */
1046 XMR_FS_802_3 = 1<<9, /* Bit 9: 802.3 Frame */
1047 XMR_FS_COL_ERR = 1<<8, /* Bit 8: Collision Error */
1048 XMR_FS_CAR_ERR = 1<<7, /* Bit 7: Carrier Event Error */
1049 XMR_FS_LEN_ERR = 1<<6, /* Bit 6: In-Range Length Error */
1050 XMR_FS_FRA_ERR = 1<<5, /* Bit 5: Framing Error */
1051 XMR_FS_RUNT = 1<<4, /* Bit 4: Runt Frame */
1052 XMR_FS_LNG_ERR = 1<<3, /* Bit 3: Giant (Jumbo) Frame */
1053 XMR_FS_FCS_ERR = 1<<2, /* Bit 2: Frame Check Sequ Err */
1054 XMR_FS_ERR = 1<<1, /* Bit 1: Frame Error */
1055 XMR_FS_MCTRL = 1<<0, /* Bit 0: MAC Control Packet */
1056
1057/*
1058 * XMR_FS_ERR will be set if
1059 * XMR_FS_FCS_ERR, XMR_FS_LNG_ERR, XMR_FS_RUNT,
1060 * XMR_FS_FRA_ERR, XMR_FS_LEN_ERR, or XMR_FS_CEX_ERR
1061 * is set. XMR_FS_LNG_ERR and XMR_FS_LEN_ERR will issue
1062 * XMR_FS_ERR unless the corresponding bit in the Receive Command
1063 * Register is set.
1064 */
1065};
1066
1067/*
1068,* XMAC-PHY Registers, indirect addressed over the XMAC
1069 */
1070enum {
1071 PHY_XMAC_CTRL = 0x00,/* 16 bit r/w PHY Control Register */
1072 PHY_XMAC_STAT = 0x01,/* 16 bit r/w PHY Status Register */
1073 PHY_XMAC_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */
1074 PHY_XMAC_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */
1075 PHY_XMAC_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */
1076 PHY_XMAC_AUNE_LP = 0x05,/* 16 bit r/o Link Partner Abi Reg */
1077 PHY_XMAC_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */
1078 PHY_XMAC_NEPG = 0x07,/* 16 bit r/w Next Page Register */
1079 PHY_XMAC_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */
1080
1081 PHY_XMAC_EXT_STAT = 0x0f,/* 16 bit r/o Ext Status Register */
1082 PHY_XMAC_RES_ABI = 0x10,/* 16 bit r/o PHY Resolved Ability */
1083};
1084/*
1085 * Broadcom-PHY Registers, indirect addressed over XMAC
1086 */
1087enum {
1088 PHY_BCOM_CTRL = 0x00,/* 16 bit r/w PHY Control Register */
1089 PHY_BCOM_STAT = 0x01,/* 16 bit r/o PHY Status Register */
1090 PHY_BCOM_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */
1091 PHY_BCOM_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */
1092 PHY_BCOM_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */
1093 PHY_BCOM_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */
1094 PHY_BCOM_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */
1095 PHY_BCOM_NEPG = 0x07,/* 16 bit r/w Next Page Register */
1096 PHY_BCOM_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */
1097 /* Broadcom-specific registers */
1098 PHY_BCOM_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */
1099 PHY_BCOM_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */
1100 PHY_BCOM_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */
1101 PHY_BCOM_P_EXT_CTRL = 0x10,/* 16 bit r/w PHY Extended Ctrl Reg */
1102 PHY_BCOM_P_EXT_STAT = 0x11,/* 16 bit r/o PHY Extended Stat Reg */
1103 PHY_BCOM_RE_CTR = 0x12,/* 16 bit r/w Receive Error Counter */
1104 PHY_BCOM_FC_CTR = 0x13,/* 16 bit r/w False Carrier Sense Cnt */
1105 PHY_BCOM_RNO_CTR = 0x14,/* 16 bit r/w Receiver NOT_OK Cnt */
1106
1107 PHY_BCOM_AUX_CTRL = 0x18,/* 16 bit r/w Auxiliary Control Reg */
1108 PHY_BCOM_AUX_STAT = 0x19,/* 16 bit r/o Auxiliary Stat Summary */
1109 PHY_BCOM_INT_STAT = 0x1a,/* 16 bit r/o Interrupt Status Reg */
1110 PHY_BCOM_INT_MASK = 0x1b,/* 16 bit r/w Interrupt Mask Reg */
1111};
1112
1113/*
1114 * Marvel-PHY Registers, indirect addressed over GMAC
1115 */
1116enum {
1117 PHY_MARV_CTRL = 0x00,/* 16 bit r/w PHY Control Register */
1118 PHY_MARV_STAT = 0x01,/* 16 bit r/o PHY Status Register */
1119 PHY_MARV_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */
1120 PHY_MARV_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */
1121 PHY_MARV_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */
1122 PHY_MARV_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */
1123 PHY_MARV_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */
1124 PHY_MARV_NEPG = 0x07,/* 16 bit r/w Next Page Register */
1125 PHY_MARV_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */
1126 /* Marvel-specific registers */
1127 PHY_MARV_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */
1128 PHY_MARV_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */
1129 PHY_MARV_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */
1130 PHY_MARV_PHY_CTRL = 0x10,/* 16 bit r/w PHY Specific Ctrl Reg */
1131 PHY_MARV_PHY_STAT = 0x11,/* 16 bit r/o PHY Specific Stat Reg */
1132 PHY_MARV_INT_MASK = 0x12,/* 16 bit r/w Interrupt Mask Reg */
1133 PHY_MARV_INT_STAT = 0x13,/* 16 bit r/o Interrupt Status Reg */
1134 PHY_MARV_EXT_CTRL = 0x14,/* 16 bit r/w Ext. PHY Specific Ctrl */
1135 PHY_MARV_RXE_CNT = 0x15,/* 16 bit r/w Receive Error Counter */
1136 PHY_MARV_EXT_ADR = 0x16,/* 16 bit r/w Ext. Ad. for Cable Diag. */
1137 PHY_MARV_PORT_IRQ = 0x17,/* 16 bit r/o Port 0 IRQ (88E1111 only) */
1138 PHY_MARV_LED_CTRL = 0x18,/* 16 bit r/w LED Control Reg */
1139 PHY_MARV_LED_OVER = 0x19,/* 16 bit r/w Manual LED Override Reg */
1140 PHY_MARV_EXT_CTRL_2 = 0x1a,/* 16 bit r/w Ext. PHY Specific Ctrl 2 */
1141 PHY_MARV_EXT_P_STAT = 0x1b,/* 16 bit r/w Ext. PHY Spec. Stat Reg */
1142 PHY_MARV_CABLE_DIAG = 0x1c,/* 16 bit r/o Cable Diagnostic Reg */
1143 PHY_MARV_PAGE_ADDR = 0x1d,/* 16 bit r/w Extended Page Address Reg */
1144 PHY_MARV_PAGE_DATA = 0x1e,/* 16 bit r/w Extended Page Data Reg */
1145
1146/* for 10/100 Fast Ethernet PHY (88E3082 only) */
1147 PHY_MARV_FE_LED_PAR = 0x16,/* 16 bit r/w LED Parallel Select Reg. */
1148 PHY_MARV_FE_LED_SER = 0x17,/* 16 bit r/w LED Stream Select S. LED */
1149 PHY_MARV_FE_VCT_TX = 0x1a,/* 16 bit r/w VCT Reg. for TXP/N Pins */
1150 PHY_MARV_FE_VCT_RX = 0x1b,/* 16 bit r/o VCT Reg. for RXP/N Pins */
1151 PHY_MARV_FE_SPEC_2 = 0x1c,/* 16 bit r/w Specific Control Reg. 2 */
1152};
1153
1154/* Level One-PHY Registers, indirect addressed over XMAC */
1155enum {
1156 PHY_LONE_CTRL = 0x00,/* 16 bit r/w PHY Control Register */
1157 PHY_LONE_STAT = 0x01,/* 16 bit r/o PHY Status Register */
1158 PHY_LONE_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */
1159 PHY_LONE_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */
1160 PHY_LONE_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */
1161 PHY_LONE_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */
1162 PHY_LONE_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */
1163 PHY_LONE_NEPG = 0x07,/* 16 bit r/w Next Page Register */
1164 PHY_LONE_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */
1165 /* Level One-specific registers */
1166 PHY_LONE_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */
1167 PHY_LONE_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */
1168 PHY_LONE_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */
1169 PHY_LONE_PORT_CFG = 0x10,/* 16 bit r/w Port Configuration Reg*/
1170 PHY_LONE_Q_STAT = 0x11,/* 16 bit r/o Quick Status Reg */
1171 PHY_LONE_INT_ENAB = 0x12,/* 16 bit r/w Interrupt Enable Reg */
1172 PHY_LONE_INT_STAT = 0x13,/* 16 bit r/o Interrupt Status Reg */
1173 PHY_LONE_LED_CFG = 0x14,/* 16 bit r/w LED Configuration Reg */
1174 PHY_LONE_PORT_CTRL = 0x15,/* 16 bit r/w Port Control Reg */
1175 PHY_LONE_CIM = 0x16,/* 16 bit r/o CIM Reg */
1176};
1177
1178/* National-PHY Registers, indirect addressed over XMAC */
1179enum {
1180 PHY_NAT_CTRL = 0x00,/* 16 bit r/w PHY Control Register */
1181 PHY_NAT_STAT = 0x01,/* 16 bit r/w PHY Status Register */
1182 PHY_NAT_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */
1183 PHY_NAT_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */
1184 PHY_NAT_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */
1185 PHY_NAT_AUNE_LP = 0x05,/* 16 bit r/o Link Partner Ability Reg */
1186 PHY_NAT_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */
1187 PHY_NAT_NEPG = 0x07,/* 16 bit r/w Next Page Register */
1188 PHY_NAT_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner Reg */
1189 /* National-specific registers */
1190 PHY_NAT_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */
1191 PHY_NAT_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */
1192 PHY_NAT_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Register */
1193 PHY_NAT_EXT_CTRL1 = 0x10,/* 16 bit r/o Extended Control Reg1 */
1194 PHY_NAT_Q_STAT1 = 0x11,/* 16 bit r/o Quick Status Reg1 */
1195 PHY_NAT_10B_OP = 0x12,/* 16 bit r/o 10Base-T Operations Reg */
1196 PHY_NAT_EXT_CTRL2 = 0x13,/* 16 bit r/o Extended Control Reg1 */
1197 PHY_NAT_Q_STAT2 = 0x14,/* 16 bit r/o Quick Status Reg2 */
1198
1199 PHY_NAT_PHY_ADDR = 0x19,/* 16 bit r/o PHY Address Register */
1200};
1201
1202enum {
1203 PHY_CT_RESET = 1<<15, /* Bit 15: (sc) clear all PHY related regs */
1204 PHY_CT_LOOP = 1<<14, /* Bit 14: enable Loopback over PHY */
1205 PHY_CT_SPS_LSB = 1<<13, /* Bit 13: Speed select, lower bit */
1206 PHY_CT_ANE = 1<<12, /* Bit 12: Auto-Negotiation Enabled */
1207 PHY_CT_PDOWN = 1<<11, /* Bit 11: Power Down Mode */
1208 PHY_CT_ISOL = 1<<10, /* Bit 10: Isolate Mode */
1209 PHY_CT_RE_CFG = 1<<9, /* Bit 9: (sc) Restart Auto-Negotiation */
1210 PHY_CT_DUP_MD = 1<<8, /* Bit 8: Duplex Mode */
1211 PHY_CT_COL_TST = 1<<7, /* Bit 7: Collision Test enabled */
1212 PHY_CT_SPS_MSB = 1<<6, /* Bit 6: Speed select, upper bit */
1213};
1214
1215enum {
1216 PHY_CT_SP1000 = PHY_CT_SPS_MSB, /* enable speed of 1000 Mbps */
1217 PHY_CT_SP100 = PHY_CT_SPS_LSB, /* enable speed of 100 Mbps */
1218 PHY_CT_SP10 = 0, /* enable speed of 10 Mbps */
1219};
1220
1221enum {
1222 PHY_ST_EXT_ST = 1<<8, /* Bit 8: Extended Status Present */
1223
1224 PHY_ST_PRE_SUP = 1<<6, /* Bit 6: Preamble Suppression */
1225 PHY_ST_AN_OVER = 1<<5, /* Bit 5: Auto-Negotiation Over */
1226 PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occured */
1227 PHY_ST_AN_CAP = 1<<3, /* Bit 3: Auto-Negotiation Capability */
1228 PHY_ST_LSYNC = 1<<2, /* Bit 2: Link Synchronized */
1229 PHY_ST_JAB_DET = 1<<1, /* Bit 1: Jabber Detected */
1230 PHY_ST_EXT_REG = 1<<0, /* Bit 0: Extended Register available */
1231};
1232
1233enum {
1234 PHY_I1_OUI_MSK = 0x3f<<10, /* Bit 15..10: Organization Unique ID */
1235 PHY_I1_MOD_NUM = 0x3f<<4, /* Bit 9.. 4: Model Number */
1236 PHY_I1_REV_MSK = 0xf, /* Bit 3.. 0: Revision Number */
1237};
1238
1239/* different Broadcom PHY Ids */
1240enum {
1241 PHY_BCOM_ID1_A1 = 0x6041,
1242 PHY_BCOM_ID1_B2 = 0x6043,
1243 PHY_BCOM_ID1_C0 = 0x6044,
1244 PHY_BCOM_ID1_C5 = 0x6047,
1245};
1246
1247/* different Marvell PHY Ids */
1248enum {
1249 PHY_MARV_ID0_VAL= 0x0141, /* Marvell Unique Identifier */
1250 PHY_MARV_ID1_B0 = 0x0C23, /* Yukon (PHY 88E1011) */
1251 PHY_MARV_ID1_B2 = 0x0C25, /* Yukon-Plus (PHY 88E1011) */
1252 PHY_MARV_ID1_C2 = 0x0CC2, /* Yukon-EC (PHY 88E1111) */
1253 PHY_MARV_ID1_Y2 = 0x0C91, /* Yukon-2 (PHY 88E1112) */
1254};
1255
1256enum {
1257 PHY_AN_NXT_PG = 1<<15, /* Bit 15: Request Next Page */
1258 PHY_X_AN_ACK = 1<<14, /* Bit 14: (ro) Acknowledge Received */
1259 PHY_X_AN_RFB = 3<<12,/* Bit 13..12: Remote Fault Bits */
1260
1261 PHY_X_AN_PAUSE = 3<<7,/* Bit 8.. 7: Pause Bits */
1262 PHY_X_AN_HD = 1<<6, /* Bit 6: Half Duplex */
1263 PHY_X_AN_FD = 1<<5, /* Bit 5: Full Duplex */
1264};
1265
1266enum {
1267 PHY_B_AN_RF = 1<<13, /* Bit 13: Remote Fault */
1268
1269 PHY_B_AN_ASP = 1<<11, /* Bit 11: Asymmetric Pause */
1270 PHY_B_AN_PC = 1<<10, /* Bit 10: Pause Capable */
1271 PHY_B_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/
1272};
1273
1274enum {
1275 PHY_L_AN_RF = 1<<13, /* Bit 13: Remote Fault */
1276 /* Bit 12: reserved */
1277 PHY_L_AN_ASP = 1<<11, /* Bit 11: Asymmetric Pause */
1278 PHY_L_AN_PC = 1<<10, /* Bit 10: Pause Capable */
1279
1280 PHY_L_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/
1281};
1282
1283/* PHY_NAT_AUNE_ADV 16 bit r/w Auto-Negotiation Advertisement */
1284/* PHY_NAT_AUNE_LP 16 bit r/o Link Partner Ability Reg *****/
1285/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */
1286enum {
1287 PHY_N_AN_RF = 1<<13, /* Bit 13: Remote Fault */
1288
1289 PHY_N_AN_100F = 1<<11, /* Bit 11: 100Base-T2 FD Support */
1290 PHY_N_AN_100H = 1<<10, /* Bit 10: 100Base-T2 HD Support */
1291
1292 PHY_N_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/
1293};
1294
1295/* field type definition for PHY_x_AN_SEL */
1296enum {
1297 PHY_SEL_TYPE = 1, /* 00001 = Ethernet */
1298};
1299
1300enum {
1301 PHY_ANE_LP_NP = 1<<3, /* Bit 3: Link Partner can Next Page */
1302 PHY_ANE_LOC_NP = 1<<2, /* Bit 2: Local PHY can Next Page */
1303 PHY_ANE_RX_PG = 1<<1, /* Bit 1: Page Received */
1304};
1305
1306enum {
1307 PHY_ANE_PAR_DF = 1<<4, /* Bit 4: Parallel Detection Fault */
1308
1309 PHY_ANE_LP_CAP = 1<<0, /* Bit 0: Link Partner Auto-Neg. Cap. */
1310};
1311
1312enum {
1313 PHY_NP_MORE = 1<<15, /* Bit 15: More, Next Pages to follow */
1314 PHY_NP_ACK1 = 1<<14, /* Bit 14: (ro) Ack1, for receiving a message */
1315 PHY_NP_MSG_VAL = 1<<13, /* Bit 13: Message Page valid */
1316 PHY_NP_ACK2 = 1<<12, /* Bit 12: Ack2, comply with msg content */
1317 PHY_NP_TOG = 1<<11, /* Bit 11: Toggle Bit, ensure sync */
1318 PHY_NP_MSG = 0x07ff, /* Bit 10..0: Message from/to Link Partner */
1319};
1320
1321enum {
1322 PHY_X_EX_FD = 1<<15, /* Bit 15: Device Supports Full Duplex */
1323 PHY_X_EX_HD = 1<<14, /* Bit 14: Device Supports Half Duplex */
1324};
1325
1326enum {
1327 PHY_X_RS_PAUSE = 3<<7,/* Bit 8..7: selected Pause Mode */
1328 PHY_X_RS_HD = 1<<6, /* Bit 6: Half Duplex Mode selected */
1329 PHY_X_RS_FD = 1<<5, /* Bit 5: Full Duplex Mode selected */
1330 PHY_X_RS_ABLMIS = 1<<4, /* Bit 4: duplex or pause cap mismatch */
1331 PHY_X_RS_PAUMIS = 1<<3, /* Bit 3: pause capability mismatch */
1332};
1333
1334/** Remote Fault Bits (PHY_X_AN_RFB) encoding */
1335enum {
1336 X_RFB_OK = 0<<12,/* Bit 13..12 No errors, Link OK */
1337 X_RFB_LF = 1<<12, /* Bit 13..12 Link Failure */
1338 X_RFB_OFF = 2<<12,/* Bit 13..12 Offline */
1339 X_RFB_AN_ERR = 3<<12,/* Bit 13..12 Auto-Negotiation Error */
1340};
1341
1342/* Pause Bits (PHY_X_AN_PAUSE and PHY_X_RS_PAUSE) encoding */
1343enum {
1344 PHY_X_P_NO_PAUSE = 0<<7,/* Bit 8..7: no Pause Mode */
1345 PHY_X_P_SYM_MD = 1<<7, /* Bit 8..7: symmetric Pause Mode */
1346 PHY_X_P_ASYM_MD = 2<<7,/* Bit 8..7: asymmetric Pause Mode */
1347 PHY_X_P_BOTH_MD = 3<<7,/* Bit 8..7: both Pause Mode */
1348};
1349
1350
1351/* Broadcom-Specific */
1352/***** PHY_BCOM_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/
1353enum {
1354 PHY_B_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */
1355 PHY_B_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */
1356 PHY_B_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */
1357 PHY_B_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */
1358 PHY_B_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */
1359 PHY_B_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */
1360};
1361
1362/***** PHY_BCOM_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/
1363/***** PHY_MARV_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/
1364enum {
1365 PHY_B_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */
1366 PHY_B_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */
1367 PHY_B_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */
1368 PHY_B_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status */
1369 PHY_B_1000S_LP_FD = 1<<11, /* Bit 11: Link Partner can FD */
1370 PHY_B_1000S_LP_HD = 1<<10, /* Bit 10: Link Partner can HD */
1371 /* Bit 9..8: reserved */
1372 PHY_B_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */
1373};
1374
1375/***** PHY_BCOM_EXT_STAT 16 bit r/o Extended Status Register *****/
1376enum {
1377 PHY_B_ES_X_FD_CAP = 1<<15, /* Bit 15: 1000Base-X FD capable */
1378 PHY_B_ES_X_HD_CAP = 1<<14, /* Bit 14: 1000Base-X HD capable */
1379 PHY_B_ES_T_FD_CAP = 1<<13, /* Bit 13: 1000Base-T FD capable */
1380 PHY_B_ES_T_HD_CAP = 1<<12, /* Bit 12: 1000Base-T HD capable */
1381};
1382
1383/***** PHY_BCOM_P_EXT_CTRL 16 bit r/w PHY Extended Control Reg *****/
1384enum {
1385 PHY_B_PEC_MAC_PHY = 1<<15, /* Bit 15: 10BIT/GMI-Interface */
1386 PHY_B_PEC_DIS_CROSS = 1<<14, /* Bit 14: Disable MDI Crossover */
1387 PHY_B_PEC_TX_DIS = 1<<13, /* Bit 13: Tx output Disabled */
1388 PHY_B_PEC_INT_DIS = 1<<12, /* Bit 12: Interrupts Disabled */
1389 PHY_B_PEC_F_INT = 1<<11, /* Bit 11: Force Interrupt */
1390 PHY_B_PEC_BY_45 = 1<<10, /* Bit 10: Bypass 4B5B-Decoder */
1391 PHY_B_PEC_BY_SCR = 1<<9, /* Bit 9: Bypass Scrambler */
1392 PHY_B_PEC_BY_MLT3 = 1<<8, /* Bit 8: Bypass MLT3 Encoder */
1393 PHY_B_PEC_BY_RXA = 1<<7, /* Bit 7: Bypass Rx Alignm. */
1394 PHY_B_PEC_RES_SCR = 1<<6, /* Bit 6: Reset Scrambler */
1395 PHY_B_PEC_EN_LTR = 1<<5, /* Bit 5: Ena LED Traffic Mode */
1396 PHY_B_PEC_LED_ON = 1<<4, /* Bit 4: Force LED's on */
1397 PHY_B_PEC_LED_OFF = 1<<3, /* Bit 3: Force LED's off */
1398 PHY_B_PEC_EX_IPG = 1<<2, /* Bit 2: Extend Tx IPG Mode */
1399 PHY_B_PEC_3_LED = 1<<1, /* Bit 1: Three Link LED mode */
1400 PHY_B_PEC_HIGH_LA = 1<<0, /* Bit 0: GMII FIFO Elasticy */
1401};
1402
1403/***** PHY_BCOM_P_EXT_STAT 16 bit r/o PHY Extended Status Reg *****/
1404enum {
1405 PHY_B_PES_CROSS_STAT = 1<<13, /* Bit 13: MDI Crossover Status */
1406 PHY_B_PES_INT_STAT = 1<<12, /* Bit 12: Interrupt Status */
1407 PHY_B_PES_RRS = 1<<11, /* Bit 11: Remote Receiver Stat. */
1408 PHY_B_PES_LRS = 1<<10, /* Bit 10: Local Receiver Stat. */
1409 PHY_B_PES_LOCKED = 1<<9, /* Bit 9: Locked */
1410 PHY_B_PES_LS = 1<<8, /* Bit 8: Link Status */
1411 PHY_B_PES_RF = 1<<7, /* Bit 7: Remote Fault */
1412 PHY_B_PES_CE_ER = 1<<6, /* Bit 6: Carrier Ext Error */
1413 PHY_B_PES_BAD_SSD = 1<<5, /* Bit 5: Bad SSD */
1414 PHY_B_PES_BAD_ESD = 1<<4, /* Bit 4: Bad ESD */
1415 PHY_B_PES_RX_ER = 1<<3, /* Bit 3: Receive Error */
1416 PHY_B_PES_TX_ER = 1<<2, /* Bit 2: Transmit Error */
1417 PHY_B_PES_LOCK_ER = 1<<1, /* Bit 1: Lock Error */
1418 PHY_B_PES_MLT3_ER = 1<<0, /* Bit 0: MLT3 code Error */
1419};
1420
1421/***** PHY_BCOM_FC_CTR 16 bit r/w False Carrier Counter *****/
1422enum {
1423 PHY_B_FC_CTR = 0xff, /* Bit 7..0: False Carrier Counter */
1424
1425/***** PHY_BCOM_RNO_CTR 16 bit r/w Receive NOT_OK Counter *****/
1426 PHY_B_RC_LOC_MSK = 0xff00, /* Bit 15..8: Local Rx NOT_OK cnt */
1427 PHY_B_RC_REM_MSK = 0x00ff, /* Bit 7..0: Remote Rx NOT_OK cnt */
1428
1429/***** PHY_BCOM_AUX_CTRL 16 bit r/w Auxiliary Control Reg *****/
1430 PHY_B_AC_L_SQE = 1<<15, /* Bit 15: Low Squelch */
1431 PHY_B_AC_LONG_PACK = 1<<14, /* Bit 14: Rx Long Packets */
1432 PHY_B_AC_ER_CTRL = 3<<12,/* Bit 13..12: Edgerate Control */
1433 /* Bit 11: reserved */
1434 PHY_B_AC_TX_TST = 1<<10, /* Bit 10: Tx test bit, always 1 */
1435 /* Bit 9.. 8: reserved */
1436 PHY_B_AC_DIS_PRF = 1<<7, /* Bit 7: dis part resp filter */
1437 /* Bit 6: reserved */
1438 PHY_B_AC_DIS_PM = 1<<5, /* Bit 5: dis power management */
1439 /* Bit 4: reserved */
1440 PHY_B_AC_DIAG = 1<<3, /* Bit 3: Diagnostic Mode */
1441};
1442
1443/***** PHY_BCOM_AUX_STAT 16 bit r/o Auxiliary Status Reg *****/
1444enum {
1445 PHY_B_AS_AN_C = 1<<15, /* Bit 15: AutoNeg complete */
1446 PHY_B_AS_AN_CA = 1<<14, /* Bit 14: AN Complete Ack */
1447 PHY_B_AS_ANACK_D = 1<<13, /* Bit 13: AN Ack Detect */
1448 PHY_B_AS_ANAB_D = 1<<12, /* Bit 12: AN Ability Detect */
1449 PHY_B_AS_NPW = 1<<11, /* Bit 11: AN Next Page Wait */
1450 PHY_B_AS_AN_RES_MSK = 7<<8,/* Bit 10..8: AN HDC */
1451 PHY_B_AS_PDF = 1<<7, /* Bit 7: Parallel Detect. Fault */
1452 PHY_B_AS_RF = 1<<6, /* Bit 6: Remote Fault */
1453 PHY_B_AS_ANP_R = 1<<5, /* Bit 5: AN Page Received */
1454 PHY_B_AS_LP_ANAB = 1<<4, /* Bit 4: LP AN Ability */
1455 PHY_B_AS_LP_NPAB = 1<<3, /* Bit 3: LP Next Page Ability */
1456 PHY_B_AS_LS = 1<<2, /* Bit 2: Link Status */
1457 PHY_B_AS_PRR = 1<<1, /* Bit 1: Pause Resolution-Rx */
1458 PHY_B_AS_PRT = 1<<0, /* Bit 0: Pause Resolution-Tx */
1459};
1460#define PHY_B_AS_PAUSE_MSK (PHY_B_AS_PRR | PHY_B_AS_PRT)
1461
1462/***** PHY_BCOM_INT_STAT 16 bit r/o Interrupt Status Reg *****/
1463/***** PHY_BCOM_INT_MASK 16 bit r/w Interrupt Mask Reg *****/
1464enum {
1465 PHY_B_IS_PSE = 1<<14, /* Bit 14: Pair Swap Error */
1466 PHY_B_IS_MDXI_SC = 1<<13, /* Bit 13: MDIX Status Change */
1467 PHY_B_IS_HCT = 1<<12, /* Bit 12: counter above 32k */
1468 PHY_B_IS_LCT = 1<<11, /* Bit 11: counter above 128 */
1469 PHY_B_IS_AN_PR = 1<<10, /* Bit 10: Page Received */
1470 PHY_B_IS_NO_HDCL = 1<<9, /* Bit 9: No HCD Link */
1471 PHY_B_IS_NO_HDC = 1<<8, /* Bit 8: No HCD */
1472 PHY_B_IS_NEG_USHDC = 1<<7, /* Bit 7: Negotiated Unsup. HCD */
1473 PHY_B_IS_SCR_S_ER = 1<<6, /* Bit 6: Scrambler Sync Error */
1474 PHY_B_IS_RRS_CHANGE = 1<<5, /* Bit 5: Remote Rx Stat Change */
1475 PHY_B_IS_LRS_CHANGE = 1<<4, /* Bit 4: Local Rx Stat Change */
1476 PHY_B_IS_DUP_CHANGE = 1<<3, /* Bit 3: Duplex Mode Change */
1477 PHY_B_IS_LSP_CHANGE = 1<<2, /* Bit 2: Link Speed Change */
1478 PHY_B_IS_LST_CHANGE = 1<<1, /* Bit 1: Link Status Changed */
1479 PHY_B_IS_CRC_ER = 1<<0, /* Bit 0: CRC Error */
1480};
1481#define PHY_B_DEF_MSK (~(PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE))
1482
1483/* Pause Bits (PHY_B_AN_ASP and PHY_B_AN_PC) encoding */
1484enum {
1485 PHY_B_P_NO_PAUSE = 0<<10,/* Bit 11..10: no Pause Mode */
1486 PHY_B_P_SYM_MD = 1<<10, /* Bit 11..10: symmetric Pause Mode */
1487 PHY_B_P_ASYM_MD = 2<<10,/* Bit 11..10: asymmetric Pause Mode */
1488 PHY_B_P_BOTH_MD = 3<<10,/* Bit 11..10: both Pause Mode */
1489};
1490/*
1491 * Resolved Duplex mode and Capabilities (Aux Status Summary Reg)
1492 */
1493enum {
1494 PHY_B_RES_1000FD = 7<<8,/* Bit 10..8: 1000Base-T Full Dup. */
1495 PHY_B_RES_1000HD = 6<<8,/* Bit 10..8: 1000Base-T Half Dup. */
1496};
1497
1498/*
1499 * Level One-Specific
1500 */
1501/***** PHY_LONE_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/
1502enum {
1503 PHY_L_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */
1504 PHY_L_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */
1505 PHY_L_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */
1506 PHY_L_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */
1507 PHY_L_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */
1508 PHY_L_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */
1509};
1510
1511/***** PHY_LONE_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/
1512enum {
1513 PHY_L_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */
1514 PHY_L_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */
1515 PHY_L_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */
1516 PHY_L_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status */
1517 PHY_L_1000S_LP_FD = 1<<11, /* Bit 11: Link Partner can FD */
1518 PHY_L_1000S_LP_HD = 1<<10, /* Bit 10: Link Partner can HD */
1519
1520 PHY_L_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */
1521
1522/***** PHY_LONE_EXT_STAT 16 bit r/o Extended Status Register *****/
1523 PHY_L_ES_X_FD_CAP = 1<<15, /* Bit 15: 1000Base-X FD capable */
1524 PHY_L_ES_X_HD_CAP = 1<<14, /* Bit 14: 1000Base-X HD capable */
1525 PHY_L_ES_T_FD_CAP = 1<<13, /* Bit 13: 1000Base-T FD capable */
1526 PHY_L_ES_T_HD_CAP = 1<<12, /* Bit 12: 1000Base-T HD capable */
1527};
1528
1529/***** PHY_LONE_PORT_CFG 16 bit r/w Port Configuration Reg *****/
1530enum {
1531 PHY_L_PC_REP_MODE = 1<<15, /* Bit 15: Repeater Mode */
1532
1533 PHY_L_PC_TX_DIS = 1<<13, /* Bit 13: Tx output Disabled */
1534 PHY_L_PC_BY_SCR = 1<<12, /* Bit 12: Bypass Scrambler */
1535 PHY_L_PC_BY_45 = 1<<11, /* Bit 11: Bypass 4B5B-Decoder */
1536 PHY_L_PC_JAB_DIS = 1<<10, /* Bit 10: Jabber Disabled */
1537 PHY_L_PC_SQE = 1<<9, /* Bit 9: Enable Heartbeat */
1538 PHY_L_PC_TP_LOOP = 1<<8, /* Bit 8: TP Loopback */
1539 PHY_L_PC_SSS = 1<<7, /* Bit 7: Smart Speed Selection */
1540 PHY_L_PC_FIFO_SIZE = 1<<6, /* Bit 6: FIFO Size */
1541 PHY_L_PC_PRE_EN = 1<<5, /* Bit 5: Preamble Enable */
1542 PHY_L_PC_CIM = 1<<4, /* Bit 4: Carrier Integrity Mon */
1543 PHY_L_PC_10_SER = 1<<3, /* Bit 3: Use Serial Output */
1544 PHY_L_PC_ANISOL = 1<<2, /* Bit 2: Unisolate Port */
1545 PHY_L_PC_TEN_BIT = 1<<1, /* Bit 1: 10bit iface mode on */
1546 PHY_L_PC_ALTCLOCK = 1<<0, /* Bit 0: (ro) ALTCLOCK Mode on */
1547};
1548
1549/***** PHY_LONE_Q_STAT 16 bit r/o Quick Status Reg *****/
1550enum {
1551 PHY_L_QS_D_RATE = 3<<14,/* Bit 15..14: Data Rate */
1552 PHY_L_QS_TX_STAT = 1<<13, /* Bit 13: Transmitting */
1553 PHY_L_QS_RX_STAT = 1<<12, /* Bit 12: Receiving */
1554 PHY_L_QS_COL_STAT = 1<<11, /* Bit 11: Collision */
1555 PHY_L_QS_L_STAT = 1<<10, /* Bit 10: Link is up */
1556 PHY_L_QS_DUP_MOD = 1<<9, /* Bit 9: Full/Half Duplex */
1557 PHY_L_QS_AN = 1<<8, /* Bit 8: AutoNeg is On */
1558 PHY_L_QS_AN_C = 1<<7, /* Bit 7: AN is Complete */
1559 PHY_L_QS_LLE = 7<<4,/* Bit 6..4: Line Length Estim. */
1560 PHY_L_QS_PAUSE = 1<<3, /* Bit 3: LP advertised Pause */
1561 PHY_L_QS_AS_PAUSE = 1<<2, /* Bit 2: LP adv. asym. Pause */
1562 PHY_L_QS_ISOLATE = 1<<1, /* Bit 1: CIM Isolated */
1563 PHY_L_QS_EVENT = 1<<0, /* Bit 0: Event has occurred */
1564};
1565
1566/***** PHY_LONE_INT_ENAB 16 bit r/w Interrupt Enable Reg *****/
1567/***** PHY_LONE_INT_STAT 16 bit r/o Interrupt Status Reg *****/
1568enum {
1569 PHY_L_IS_AN_F = 1<<13, /* Bit 13: Auto-Negotiation fault */
1570 PHY_L_IS_CROSS = 1<<11, /* Bit 11: Crossover used */
1571 PHY_L_IS_POL = 1<<10, /* Bit 10: Polarity correct. used */
1572 PHY_L_IS_SS = 1<<9, /* Bit 9: Smart Speed Downgrade */
1573 PHY_L_IS_CFULL = 1<<8, /* Bit 8: Counter Full */
1574 PHY_L_IS_AN_C = 1<<7, /* Bit 7: AutoNeg Complete */
1575 PHY_L_IS_SPEED = 1<<6, /* Bit 6: Speed Changed */
1576 PHY_L_IS_DUP = 1<<5, /* Bit 5: Duplex Changed */
1577 PHY_L_IS_LS = 1<<4, /* Bit 4: Link Status Changed */
1578 PHY_L_IS_ISOL = 1<<3, /* Bit 3: Isolate Occured */
1579 PHY_L_IS_MDINT = 1<<2, /* Bit 2: (ro) STAT: MII Int Pending */
1580 PHY_L_IS_INTEN = 1<<1, /* Bit 1: ENAB: Enable IRQs */
1581 PHY_L_IS_FORCE = 1<<0, /* Bit 0: ENAB: Force Interrupt */
1582};
1583
1584/* int. mask */
1585#define PHY_L_DEF_MSK (PHY_L_IS_LS | PHY_L_IS_ISOL | PHY_L_IS_INTEN)
1586
1587/***** PHY_LONE_LED_CFG 16 bit r/w LED Configuration Reg *****/
1588enum {
1589 PHY_L_LC_LEDC = 3<<14,/* Bit 15..14: Col/Blink/On/Off */
1590 PHY_L_LC_LEDR = 3<<12,/* Bit 13..12: Rx/Blink/On/Off */
1591 PHY_L_LC_LEDT = 3<<10,/* Bit 11..10: Tx/Blink/On/Off */
1592 PHY_L_LC_LEDG = 3<<8,/* Bit 9..8: Giga/Blink/On/Off */
1593 PHY_L_LC_LEDS = 3<<6,/* Bit 7..6: 10-100/Blink/On/Off */
1594 PHY_L_LC_LEDL = 3<<4,/* Bit 5..4: Link/Blink/On/Off */
1595 PHY_L_LC_LEDF = 3<<2,/* Bit 3..2: Duplex/Blink/On/Off */
1596 PHY_L_LC_PSTRECH= 1<<1, /* Bit 1: Strech LED Pulses */
1597 PHY_L_LC_FREQ = 1<<0, /* Bit 0: 30/100 ms */
1598};
1599
1600/***** PHY_LONE_PORT_CTRL 16 bit r/w Port Control Reg *****/
1601enum {
1602 PHY_L_PC_TX_TCLK = 1<<15, /* Bit 15: Enable TX_TCLK */
1603 PHY_L_PC_ALT_NP = 1<<13, /* Bit 14: Alternate Next Page */
1604 PHY_L_PC_GMII_ALT= 1<<12, /* Bit 13: Alternate GMII driver */
1605 PHY_L_PC_TEN_CRS = 1<<10, /* Bit 10: Extend CRS*/
1606};
1607
1608/***** PHY_LONE_CIM 16 bit r/o CIM Reg *****/
1609enum {
1610 PHY_L_CIM_ISOL = 0xff<<8,/* Bit 15..8: Isolate Count */
1611 PHY_L_CIM_FALSE_CAR = 0xff, /* Bit 7..0: False Carrier Count */
1612};
1613
1614/*
1615 * Pause Bits (PHY_L_AN_ASP and PHY_L_AN_PC) encoding
1616 */
1617enum {
1618 PHY_L_P_NO_PAUSE= 0<<10,/* Bit 11..10: no Pause Mode */
1619 PHY_L_P_SYM_MD = 1<<10, /* Bit 11..10: symmetric Pause Mode */
1620 PHY_L_P_ASYM_MD = 2<<10,/* Bit 11..10: asymmetric Pause Mode */
1621 PHY_L_P_BOTH_MD = 3<<10,/* Bit 11..10: both Pause Mode */
1622};
1623
1624/*
1625 * National-Specific
1626 */
1627/***** PHY_NAT_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/
1628enum {
1629 PHY_N_1000C_TEST= 7<<13,/* Bit 15..13: Test Modes */
1630 PHY_N_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */
1631 PHY_N_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */
1632 PHY_N_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */
1633 PHY_N_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */
1634 PHY_N_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */
1635 PHY_N_1000C_APC = 1<<7, /* Bit 7: Asymmetric Pause Cap. */};
1636
1637
1638/***** PHY_NAT_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/
1639enum {
1640 PHY_N_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */
1641 PHY_N_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */
1642 PHY_N_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */
1643 PHY_N_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status*/
1644 PHY_N_1000S_LP_FD= 1<<11, /* Bit 11: Link Partner can FD */
1645 PHY_N_1000S_LP_HD= 1<<10, /* Bit 10: Link Partner can HD */
1646 PHY_N_1000C_LP_APC= 1<<9, /* Bit 9: LP Asym. Pause Cap. */
1647 PHY_N_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */
1648};
1649
1650/***** PHY_NAT_EXT_STAT 16 bit r/o Extended Status Register *****/
1651enum {
1652 PHY_N_ES_X_FD_CAP= 1<<15, /* Bit 15: 1000Base-X FD capable */
1653 PHY_N_ES_X_HD_CAP= 1<<14, /* Bit 14: 1000Base-X HD capable */
1654 PHY_N_ES_T_FD_CAP= 1<<13, /* Bit 13: 1000Base-T FD capable */
1655 PHY_N_ES_T_HD_CAP= 1<<12, /* Bit 12: 1000Base-T HD capable */
1656};
1657
1658/** Marvell-Specific */
1659enum {
1660 PHY_M_AN_NXT_PG = 1<<15, /* Request Next Page */
1661 PHY_M_AN_ACK = 1<<14, /* (ro) Acknowledge Received */
1662 PHY_M_AN_RF = 1<<13, /* Remote Fault */
1663
1664 PHY_M_AN_ASP = 1<<11, /* Asymmetric Pause */
1665 PHY_M_AN_PC = 1<<10, /* MAC Pause implemented */
1666 PHY_M_AN_100_T4 = 1<<9, /* Not cap. 100Base-T4 (always 0) */
1667 PHY_M_AN_100_FD = 1<<8, /* Advertise 100Base-TX Full Duplex */
1668 PHY_M_AN_100_HD = 1<<7, /* Advertise 100Base-TX Half Duplex */
1669 PHY_M_AN_10_FD = 1<<6, /* Advertise 10Base-TX Full Duplex */
1670 PHY_M_AN_10_HD = 1<<5, /* Advertise 10Base-TX Half Duplex */
1671 PHY_M_AN_SEL_MSK =0x1f<<4, /* Bit 4.. 0: Selector Field Mask */
1672};
1673
1674/* special defines for FIBER (88E1011S only) */
1675enum {
1676 PHY_M_AN_ASP_X = 1<<8, /* Asymmetric Pause */
1677 PHY_M_AN_PC_X = 1<<7, /* MAC Pause implemented */
1678 PHY_M_AN_1000X_AHD = 1<<6, /* Advertise 10000Base-X Half Duplex */
1679 PHY_M_AN_1000X_AFD = 1<<5, /* Advertise 10000Base-X Full Duplex */
1680};
1681
1682/* Pause Bits (PHY_M_AN_ASP_X and PHY_M_AN_PC_X) encoding */
1683enum {
1684 PHY_M_P_NO_PAUSE_X = 0<<7,/* Bit 8.. 7: no Pause Mode */
1685 PHY_M_P_SYM_MD_X = 1<<7, /* Bit 8.. 7: symmetric Pause Mode */
1686 PHY_M_P_ASYM_MD_X = 2<<7,/* Bit 8.. 7: asymmetric Pause Mode */
1687 PHY_M_P_BOTH_MD_X = 3<<7,/* Bit 8.. 7: both Pause Mode */
1688};
1689
1690/***** PHY_MARV_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/
1691enum {
1692 PHY_M_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */
1693 PHY_M_1000C_MSE = 1<<12, /* Manual Master/Slave Enable */
1694 PHY_M_1000C_MSC = 1<<11, /* M/S Configuration (1=Master) */
1695 PHY_M_1000C_MPD = 1<<10, /* Multi-Port Device */
1696 PHY_M_1000C_AFD = 1<<9, /* Advertise Full Duplex */
1697 PHY_M_1000C_AHD = 1<<8, /* Advertise Half Duplex */
1698};
1699
1700/***** PHY_MARV_PHY_CTRL 16 bit r/w PHY Specific Ctrl Reg *****/
1701enum {
1702 PHY_M_PC_TX_FFD_MSK = 3<<14,/* Bit 15..14: Tx FIFO Depth Mask */
1703 PHY_M_PC_RX_FFD_MSK = 3<<12,/* Bit 13..12: Rx FIFO Depth Mask */
1704 PHY_M_PC_ASS_CRS_TX = 1<<11, /* Assert CRS on Transmit */
1705 PHY_M_PC_FL_GOOD = 1<<10, /* Force Link Good */
1706 PHY_M_PC_EN_DET_MSK = 3<<8,/* Bit 9.. 8: Energy Detect Mask */
1707 PHY_M_PC_ENA_EXT_D = 1<<7, /* Enable Ext. Distance (10BT) */
1708 PHY_M_PC_MDIX_MSK = 3<<5,/* Bit 6.. 5: MDI/MDIX Config. Mask */
1709 PHY_M_PC_DIS_125CLK = 1<<4, /* Disable 125 CLK */
1710 PHY_M_PC_MAC_POW_UP = 1<<3, /* MAC Power up */
1711 PHY_M_PC_SQE_T_ENA = 1<<2, /* SQE Test Enabled */
1712 PHY_M_PC_POL_R_DIS = 1<<1, /* Polarity Reversal Disabled */
1713 PHY_M_PC_DIS_JABBER = 1<<0, /* Disable Jabber */
1714};
1715
1716enum {
1717 PHY_M_PC_EN_DET = 2<<8, /* Energy Detect (Mode 1) */
1718 PHY_M_PC_EN_DET_PLUS = 3<<8, /* Energy Detect Plus (Mode 2) */
1719};
1720
1721#define PHY_M_PC_MDI_XMODE(x) (((x)<<5) & PHY_M_PC_MDIX_MSK)
1722
1723enum {
1724 PHY_M_PC_MAN_MDI = 0, /* 00 = Manual MDI configuration */
1725 PHY_M_PC_MAN_MDIX = 1, /* 01 = Manual MDIX configuration */
1726 PHY_M_PC_ENA_AUTO = 3, /* 11 = Enable Automatic Crossover */
1727};
1728
1729/* for 10/100 Fast Ethernet PHY (88E3082 only) */
1730enum {
1731 PHY_M_PC_ENA_DTE_DT = 1<<15, /* Enable Data Terminal Equ. (DTE) Detect */
1732 PHY_M_PC_ENA_ENE_DT = 1<<14, /* Enable Energy Detect (sense & pulse) */
1733 PHY_M_PC_DIS_NLP_CK = 1<<13, /* Disable Normal Link Puls (NLP) Check */
1734 PHY_M_PC_ENA_LIP_NP = 1<<12, /* Enable Link Partner Next Page Reg. */
1735 PHY_M_PC_DIS_NLP_GN = 1<<11, /* Disable Normal Link Puls Generation */
1736
1737 PHY_M_PC_DIS_SCRAMB = 1<<9, /* Disable Scrambler */
1738 PHY_M_PC_DIS_FEFI = 1<<8, /* Disable Far End Fault Indic. (FEFI) */
1739
1740 PHY_M_PC_SH_TP_SEL = 1<<6, /* Shielded Twisted Pair Select */
1741 PHY_M_PC_RX_FD_MSK = 3<<2,/* Bit 3.. 2: Rx FIFO Depth Mask */
1742};
1743
1744/***** PHY_MARV_PHY_STAT 16 bit r/o PHY Specific Status Reg *****/
1745enum {
1746 PHY_M_PS_SPEED_MSK = 3<<14, /* Bit 15..14: Speed Mask */
1747 PHY_M_PS_SPEED_1000 = 1<<15, /* 10 = 1000 Mbps */
1748 PHY_M_PS_SPEED_100 = 1<<14, /* 01 = 100 Mbps */
1749 PHY_M_PS_SPEED_10 = 0, /* 00 = 10 Mbps */
1750 PHY_M_PS_FULL_DUP = 1<<13, /* Full Duplex */
1751 PHY_M_PS_PAGE_REC = 1<<12, /* Page Received */
1752 PHY_M_PS_SPDUP_RES = 1<<11, /* Speed & Duplex Resolved */
1753 PHY_M_PS_LINK_UP = 1<<10, /* Link Up */
1754 PHY_M_PS_CABLE_MSK = 7<<7, /* Bit 9.. 7: Cable Length Mask */
1755 PHY_M_PS_MDI_X_STAT = 1<<6, /* MDI Crossover Stat (1=MDIX) */
1756 PHY_M_PS_DOWNS_STAT = 1<<5, /* Downshift Status (1=downsh.) */
1757 PHY_M_PS_ENDET_STAT = 1<<4, /* Energy Detect Status (1=act) */
1758 PHY_M_PS_TX_P_EN = 1<<3, /* Tx Pause Enabled */
1759 PHY_M_PS_RX_P_EN = 1<<2, /* Rx Pause Enabled */
1760 PHY_M_PS_POL_REV = 1<<1, /* Polarity Reversed */
1761 PHY_M_PS_JABBER = 1<<0, /* Jabber */
1762};
1763
1764#define PHY_M_PS_PAUSE_MSK (PHY_M_PS_TX_P_EN | PHY_M_PS_RX_P_EN)
1765
1766/* for 10/100 Fast Ethernet PHY (88E3082 only) */
1767enum {
1768 PHY_M_PS_DTE_DETECT = 1<<15, /* Data Terminal Equipment (DTE) Detected */
1769 PHY_M_PS_RES_SPEED = 1<<14, /* Resolved Speed (1=100 Mbps, 0=10 Mbps */
1770};
1771
1772enum {
1773 PHY_M_IS_AN_ERROR = 1<<15, /* Auto-Negotiation Error */
1774 PHY_M_IS_LSP_CHANGE = 1<<14, /* Link Speed Changed */
1775 PHY_M_IS_DUP_CHANGE = 1<<13, /* Duplex Mode Changed */
1776 PHY_M_IS_AN_PR = 1<<12, /* Page Received */
1777 PHY_M_IS_AN_COMPL = 1<<11, /* Auto-Negotiation Completed */
1778 PHY_M_IS_LST_CHANGE = 1<<10, /* Link Status Changed */
1779 PHY_M_IS_SYMB_ERROR = 1<<9, /* Symbol Error */
1780 PHY_M_IS_FALSE_CARR = 1<<8, /* False Carrier */
1781 PHY_M_IS_FIFO_ERROR = 1<<7, /* FIFO Overflow/Underrun Error */
1782 PHY_M_IS_MDI_CHANGE = 1<<6, /* MDI Crossover Changed */
1783 PHY_M_IS_DOWNSH_DET = 1<<5, /* Downshift Detected */
1784 PHY_M_IS_END_CHANGE = 1<<4, /* Energy Detect Changed */
1785
1786 PHY_M_IS_DTE_CHANGE = 1<<2, /* DTE Power Det. Status Changed */
1787 PHY_M_IS_POL_CHANGE = 1<<1, /* Polarity Changed */
1788 PHY_M_IS_JABBER = 1<<0, /* Jabber */
1789};
1790
1791#define PHY_M_DEF_MSK ( PHY_M_IS_AN_ERROR | PHY_M_IS_LSP_CHANGE | \
1792 PHY_M_IS_LST_CHANGE | PHY_M_IS_FIFO_ERROR)
1793
1794/***** PHY_MARV_EXT_CTRL 16 bit r/w Ext. PHY Specific Ctrl *****/
1795enum {
1796 PHY_M_EC_ENA_BC_EXT = 1<<15, /* Enable Block Carr. Ext. (88E1111 only) */
1797 PHY_M_EC_ENA_LIN_LB = 1<<14, /* Enable Line Loopback (88E1111 only) */
1798
1799 PHY_M_EC_DIS_LINK_P = 1<<12, /* Disable Link Pulses (88E1111 only) */
1800 PHY_M_EC_M_DSC_MSK = 3<<10, /* Bit 11..10: Master Downshift Counter */
1801 /* (88E1011 only) */
1802 PHY_M_EC_S_DSC_MSK = 3<<8,/* Bit 9.. 8: Slave Downshift Counter */
1803 /* (88E1011 only) */
1804 PHY_M_EC_M_DSC_MSK2 = 7<<9,/* Bit 11.. 9: Master Downshift Counter */
1805 /* (88E1111 only) */
1806 PHY_M_EC_DOWN_S_ENA = 1<<8, /* Downshift Enable (88E1111 only) */
1807 /* !!! Errata in spec. (1 = disable) */
1808 PHY_M_EC_RX_TIM_CT = 1<<7, /* RGMII Rx Timing Control*/
1809 PHY_M_EC_MAC_S_MSK = 7<<4,/* Bit 6.. 4: Def. MAC interface speed */
1810 PHY_M_EC_FIB_AN_ENA = 1<<3, /* Fiber Auto-Neg. Enable (88E1011S only) */
1811 PHY_M_EC_DTE_D_ENA = 1<<2, /* DTE Detect Enable (88E1111 only) */
1812 PHY_M_EC_TX_TIM_CT = 1<<1, /* RGMII Tx Timing Control */
1813 PHY_M_EC_TRANS_DIS = 1<<0, /* Transmitter Disable (88E1111 only) */};
1814
1815#define PHY_M_EC_M_DSC(x) ((x)<<10) /* 00=1x; 01=2x; 10=3x; 11=4x */
1816#define PHY_M_EC_S_DSC(x) ((x)<<8) /* 00=dis; 01=1x; 10=2x; 11=3x */
1817#define PHY_M_EC_MAC_S(x) ((x)<<4) /* 01X=0; 110=2.5; 111=25 (MHz) */
1818
1819#define PHY_M_EC_M_DSC_2(x) ((x)<<9) /* 000=1x; 001=2x; 010=3x; 011=4x */
1820 /* 100=5x; 101=6x; 110=7x; 111=8x */
1821enum {
1822 MAC_TX_CLK_0_MHZ = 2,
1823 MAC_TX_CLK_2_5_MHZ = 6,
1824 MAC_TX_CLK_25_MHZ = 7,
1825};
1826
1827/***** PHY_MARV_LED_CTRL 16 bit r/w LED Control Reg *****/
1828enum {
1829 PHY_M_LEDC_DIS_LED = 1<<15, /* Disable LED */
1830 PHY_M_LEDC_PULS_MSK = 7<<12,/* Bit 14..12: Pulse Stretch Mask */
1831 PHY_M_LEDC_F_INT = 1<<11, /* Force Interrupt */
1832 PHY_M_LEDC_BL_R_MSK = 7<<8,/* Bit 10.. 8: Blink Rate Mask */
1833 PHY_M_LEDC_DP_C_LSB = 1<<7, /* Duplex Control (LSB, 88E1111 only) */
1834 PHY_M_LEDC_TX_C_LSB = 1<<6, /* Tx Control (LSB, 88E1111 only) */
1835 PHY_M_LEDC_LK_C_MSK = 7<<3,/* Bit 5.. 3: Link Control Mask */
1836 /* (88E1111 only) */
1837};
1838
1839enum {
1840 PHY_M_LEDC_LINK_MSK = 3<<3,/* Bit 4.. 3: Link Control Mask */
1841 /* (88E1011 only) */
1842 PHY_M_LEDC_DP_CTRL = 1<<2, /* Duplex Control */
1843 PHY_M_LEDC_DP_C_MSB = 1<<2, /* Duplex Control (MSB, 88E1111 only) */
1844 PHY_M_LEDC_RX_CTRL = 1<<1, /* Rx Activity / Link */
1845 PHY_M_LEDC_TX_CTRL = 1<<0, /* Tx Activity / Link */
1846 PHY_M_LEDC_TX_C_MSB = 1<<0, /* Tx Control (MSB, 88E1111 only) */
1847};
1848
1849#define PHY_M_LED_PULS_DUR(x) ( ((x)<<12) & PHY_M_LEDC_PULS_MSK)
1850
1851enum {
1852 PULS_NO_STR = 0,/* no pulse stretching */
1853 PULS_21MS = 1,/* 21 ms to 42 ms */
1854 PULS_42MS = 2,/* 42 ms to 84 ms */
1855 PULS_84MS = 3,/* 84 ms to 170 ms */
1856 PULS_170MS = 4,/* 170 ms to 340 ms */
1857 PULS_340MS = 5,/* 340 ms to 670 ms */
1858 PULS_670MS = 6,/* 670 ms to 1.3 s */
1859 PULS_1300MS = 7,/* 1.3 s to 2.7 s */
1860};
1861
1862#define PHY_M_LED_BLINK_RT(x) ( ((x)<<8) & PHY_M_LEDC_BL_R_MSK)
1863
1864enum {
1865 BLINK_42MS = 0,/* 42 ms */
1866 BLINK_84MS = 1,/* 84 ms */
1867 BLINK_170MS = 2,/* 170 ms */
1868 BLINK_340MS = 3,/* 340 ms */
1869 BLINK_670MS = 4,/* 670 ms */
1870};
1871
1872/***** PHY_MARV_LED_OVER 16 bit r/w Manual LED Override Reg *****/
1873#define PHY_M_LED_MO_SGMII(x) ((x)<<14) /* Bit 15..14: SGMII AN Timer */
1874 /* Bit 13..12: reserved */
1875#define PHY_M_LED_MO_DUP(x) ((x)<<10) /* Bit 11..10: Duplex */
1876#define PHY_M_LED_MO_10(x) ((x)<<8) /* Bit 9.. 8: Link 10 */
1877#define PHY_M_LED_MO_100(x) ((x)<<6) /* Bit 7.. 6: Link 100 */
1878#define PHY_M_LED_MO_1000(x) ((x)<<4) /* Bit 5.. 4: Link 1000 */
1879#define PHY_M_LED_MO_RX(x) ((x)<<2) /* Bit 3.. 2: Rx */
1880#define PHY_M_LED_MO_TX(x) ((x)<<0) /* Bit 1.. 0: Tx */
1881
1882enum {
1883 MO_LED_NORM = 0,
1884 MO_LED_BLINK = 1,
1885 MO_LED_OFF = 2,
1886 MO_LED_ON = 3,
1887};
1888
1889/***** PHY_MARV_EXT_CTRL_2 16 bit r/w Ext. PHY Specific Ctrl 2 *****/
1890enum {
1891 PHY_M_EC2_FI_IMPED = 1<<6, /* Fiber Input Impedance */
1892 PHY_M_EC2_FO_IMPED = 1<<5, /* Fiber Output Impedance */
1893 PHY_M_EC2_FO_M_CLK = 1<<4, /* Fiber Mode Clock Enable */
1894 PHY_M_EC2_FO_BOOST = 1<<3, /* Fiber Output Boost */
1895 PHY_M_EC2_FO_AM_MSK = 7,/* Bit 2.. 0: Fiber Output Amplitude */
1896};
1897
1898/***** PHY_MARV_EXT_P_STAT 16 bit r/w Ext. PHY Specific Status *****/
1899enum {
1900 PHY_M_FC_AUTO_SEL = 1<<15, /* Fiber/Copper Auto Sel. Dis. */
1901 PHY_M_FC_AN_REG_ACC = 1<<14, /* Fiber/Copper AN Reg. Access */
1902 PHY_M_FC_RESOLUTION = 1<<13, /* Fiber/Copper Resolution */
1903 PHY_M_SER_IF_AN_BP = 1<<12, /* Ser. IF AN Bypass Enable */
1904 PHY_M_SER_IF_BP_ST = 1<<11, /* Ser. IF AN Bypass Status */
1905 PHY_M_IRQ_POLARITY = 1<<10, /* IRQ polarity */
1906 PHY_M_DIS_AUT_MED = 1<<9, /* Disable Aut. Medium Reg. Selection */
1907 /* (88E1111 only) */
1908 /* Bit 9.. 4: reserved (88E1011 only) */
1909 PHY_M_UNDOC1 = 1<<7, /* undocumented bit !! */
1910 PHY_M_DTE_POW_STAT = 1<<4, /* DTE Power Status (88E1111 only) */
1911 PHY_M_MODE_MASK = 0xf, /* Bit 3.. 0: copy of HWCFG MODE[3:0] */
1912};
1913
1914/***** PHY_MARV_CABLE_DIAG 16 bit r/o Cable Diagnostic Reg *****/
1915enum {
1916 PHY_M_CABD_ENA_TEST = 1<<15, /* Enable Test (Page 0) */
1917 PHY_M_CABD_DIS_WAIT = 1<<15, /* Disable Waiting Period (Page 1) */
1918 /* (88E1111 only) */
1919 PHY_M_CABD_STAT_MSK = 3<<13, /* Bit 14..13: Status Mask */
1920 PHY_M_CABD_AMPL_MSK = 0x1f<<8,/* Bit 12.. 8: Amplitude Mask */
1921 /* (88E1111 only) */
1922 PHY_M_CABD_DIST_MSK = 0xff, /* Bit 7.. 0: Distance Mask */
1923};
1924
1925/* values for Cable Diagnostic Status (11=fail; 00=OK; 10=open; 01=short) */
1926enum {
1927 CABD_STAT_NORMAL= 0,
1928 CABD_STAT_SHORT = 1,
1929 CABD_STAT_OPEN = 2,
1930 CABD_STAT_FAIL = 3,
1931};
1932
1933/* for 10/100 Fast Ethernet PHY (88E3082 only) */
1934/***** PHY_MARV_FE_LED_PAR 16 bit r/w LED Parallel Select Reg. *****/
1935 /* Bit 15..12: reserved (used internally) */
1936enum {
1937 PHY_M_FELP_LED2_MSK = 0xf<<8, /* Bit 11.. 8: LED2 Mask (LINK) */
1938 PHY_M_FELP_LED1_MSK = 0xf<<4, /* Bit 7.. 4: LED1 Mask (ACT) */
1939 PHY_M_FELP_LED0_MSK = 0xf, /* Bit 3.. 0: LED0 Mask (SPEED) */
1940};
1941
1942#define PHY_M_FELP_LED2_CTRL(x) ( ((x)<<8) & PHY_M_FELP_LED2_MSK)
1943#define PHY_M_FELP_LED1_CTRL(x) ( ((x)<<4) & PHY_M_FELP_LED1_MSK)
1944#define PHY_M_FELP_LED0_CTRL(x) ( ((x)<<0) & PHY_M_FELP_LED0_MSK)
1945
1946enum {
1947 LED_PAR_CTRL_COLX = 0x00,
1948 LED_PAR_CTRL_ERROR = 0x01,
1949 LED_PAR_CTRL_DUPLEX = 0x02,
1950 LED_PAR_CTRL_DP_COL = 0x03,
1951 LED_PAR_CTRL_SPEED = 0x04,
1952 LED_PAR_CTRL_LINK = 0x05,
1953 LED_PAR_CTRL_TX = 0x06,
1954 LED_PAR_CTRL_RX = 0x07,
1955 LED_PAR_CTRL_ACT = 0x08,
1956 LED_PAR_CTRL_LNK_RX = 0x09,
1957 LED_PAR_CTRL_LNK_AC = 0x0a,
1958 LED_PAR_CTRL_ACT_BL = 0x0b,
1959 LED_PAR_CTRL_TX_BL = 0x0c,
1960 LED_PAR_CTRL_RX_BL = 0x0d,
1961 LED_PAR_CTRL_COL_BL = 0x0e,
1962 LED_PAR_CTRL_INACT = 0x0f
1963};
1964
1965/*****,PHY_MARV_FE_SPEC_2 16 bit r/w Specific Control Reg. 2 *****/
1966enum {
1967 PHY_M_FESC_DIS_WAIT = 1<<2, /* Disable TDR Waiting Period */
1968 PHY_M_FESC_ENA_MCLK = 1<<1, /* Enable MAC Rx Clock in sleep mode */
1969 PHY_M_FESC_SEL_CL_A = 1<<0, /* Select Class A driver (100B-TX) */
1970};
1971
1972/* for Yukon-2 Gigabit Ethernet PHY (88E1112 only) */
1973/***** PHY_MARV_PHY_CTRL (page 2) 16 bit r/w MAC Specific Ctrl *****/
1974enum {
1975 PHY_M_MAC_MD_MSK = 7<<7, /* Bit 9.. 7: Mode Select Mask */
1976 PHY_M_MAC_MD_AUTO = 3,/* Auto Copper/1000Base-X */
1977 PHY_M_MAC_MD_COPPER = 5,/* Copper only */
1978 PHY_M_MAC_MD_1000BX = 7,/* 1000Base-X only */
1979};
1980#define PHY_M_MAC_MODE_SEL(x) ( ((x)<<7) & PHY_M_MAC_MD_MSK)
1981
1982/***** PHY_MARV_PHY_CTRL (page 3) 16 bit r/w LED Control Reg. *****/
1983enum {
1984 PHY_M_LEDC_LOS_MSK = 0xf<<12,/* Bit 15..12: LOS LED Ctrl. Mask */
1985 PHY_M_LEDC_INIT_MSK = 0xf<<8, /* Bit 11.. 8: INIT LED Ctrl. Mask */
1986 PHY_M_LEDC_STA1_MSK = 0xf<<4,/* Bit 7.. 4: STAT1 LED Ctrl. Mask */
1987 PHY_M_LEDC_STA0_MSK = 0xf, /* Bit 3.. 0: STAT0 LED Ctrl. Mask */
1988};
1989
1990#define PHY_M_LEDC_LOS_CTRL(x) ( ((x)<<12) & PHY_M_LEDC_LOS_MSK)
1991#define PHY_M_LEDC_INIT_CTRL(x) ( ((x)<<8) & PHY_M_LEDC_INIT_MSK)
1992#define PHY_M_LEDC_STA1_CTRL(x) ( ((x)<<4) & PHY_M_LEDC_STA1_MSK)
1993#define PHY_M_LEDC_STA0_CTRL(x) ( ((x)<<0) & PHY_M_LEDC_STA0_MSK)
1994
1995/* GMAC registers */
1996/* Port Registers */
1997enum {
1998 GM_GP_STAT = 0x0000, /* 16 bit r/o General Purpose Status */
1999 GM_GP_CTRL = 0x0004, /* 16 bit r/w General Purpose Control */
2000 GM_TX_CTRL = 0x0008, /* 16 bit r/w Transmit Control Reg. */
2001 GM_RX_CTRL = 0x000c, /* 16 bit r/w Receive Control Reg. */
2002 GM_TX_FLOW_CTRL = 0x0010, /* 16 bit r/w Transmit Flow-Control */
2003 GM_TX_PARAM = 0x0014, /* 16 bit r/w Transmit Parameter Reg. */
2004 GM_SERIAL_MODE = 0x0018, /* 16 bit r/w Serial Mode Register */
2005/* Source Address Registers */
2006 GM_SRC_ADDR_1L = 0x001c, /* 16 bit r/w Source Address 1 (low) */
2007 GM_SRC_ADDR_1M = 0x0020, /* 16 bit r/w Source Address 1 (middle) */
2008 GM_SRC_ADDR_1H = 0x0024, /* 16 bit r/w Source Address 1 (high) */
2009 GM_SRC_ADDR_2L = 0x0028, /* 16 bit r/w Source Address 2 (low) */
2010 GM_SRC_ADDR_2M = 0x002c, /* 16 bit r/w Source Address 2 (middle) */
2011 GM_SRC_ADDR_2H = 0x0030, /* 16 bit r/w Source Address 2 (high) */
2012
2013/* Multicast Address Hash Registers */
2014 GM_MC_ADDR_H1 = 0x0034, /* 16 bit r/w Multicast Address Hash 1 */
2015 GM_MC_ADDR_H2 = 0x0038, /* 16 bit r/w Multicast Address Hash 2 */
2016 GM_MC_ADDR_H3 = 0x003c, /* 16 bit r/w Multicast Address Hash 3 */
2017 GM_MC_ADDR_H4 = 0x0040, /* 16 bit r/w Multicast Address Hash 4 */
2018
2019/* Interrupt Source Registers */
2020 GM_TX_IRQ_SRC = 0x0044, /* 16 bit r/o Tx Overflow IRQ Source */
2021 GM_RX_IRQ_SRC = 0x0048, /* 16 bit r/o Rx Overflow IRQ Source */
2022 GM_TR_IRQ_SRC = 0x004c, /* 16 bit r/o Tx/Rx Over. IRQ Source */
2023
2024/* Interrupt Mask Registers */
2025 GM_TX_IRQ_MSK = 0x0050, /* 16 bit r/w Tx Overflow IRQ Mask */
2026 GM_RX_IRQ_MSK = 0x0054, /* 16 bit r/w Rx Overflow IRQ Mask */
2027 GM_TR_IRQ_MSK = 0x0058, /* 16 bit r/w Tx/Rx Over. IRQ Mask */
2028
2029/* Serial Management Interface (SMI) Registers */
2030 GM_SMI_CTRL = 0x0080, /* 16 bit r/w SMI Control Register */
2031 GM_SMI_DATA = 0x0084, /* 16 bit r/w SMI Data Register */
2032 GM_PHY_ADDR = 0x0088, /* 16 bit r/w GPHY Address Register */
2033};
2034
2035/* MIB Counters */
2036#define GM_MIB_CNT_BASE 0x0100 /* Base Address of MIB Counters */
2037#define GM_MIB_CNT_SIZE 44 /* Number of MIB Counters */
2038
2039/*
2040 * MIB Counters base address definitions (low word) -
2041 * use offset 4 for access to high word (32 bit r/o)
2042 */
2043enum {
2044 GM_RXF_UC_OK = GM_MIB_CNT_BASE + 0, /* Unicast Frames Received OK */
2045 GM_RXF_BC_OK = GM_MIB_CNT_BASE + 8, /* Broadcast Frames Received OK */
2046 GM_RXF_MPAUSE = GM_MIB_CNT_BASE + 16, /* Pause MAC Ctrl Frames Received */
2047 GM_RXF_MC_OK = GM_MIB_CNT_BASE + 24, /* Multicast Frames Received OK */
2048 GM_RXF_FCS_ERR = GM_MIB_CNT_BASE + 32, /* Rx Frame Check Seq. Error */
2049 /* GM_MIB_CNT_BASE + 40: reserved */
2050 GM_RXO_OK_LO = GM_MIB_CNT_BASE + 48, /* Octets Received OK Low */
2051 GM_RXO_OK_HI = GM_MIB_CNT_BASE + 56, /* Octets Received OK High */
2052 GM_RXO_ERR_LO = GM_MIB_CNT_BASE + 64, /* Octets Received Invalid Low */
2053 GM_RXO_ERR_HI = GM_MIB_CNT_BASE + 72, /* Octets Received Invalid High */
2054 GM_RXF_SHT = GM_MIB_CNT_BASE + 80, /* Frames <64 Byte Received OK */
2055 GM_RXE_FRAG = GM_MIB_CNT_BASE + 88, /* Frames <64 Byte Received with FCS Err */
2056 GM_RXF_64B = GM_MIB_CNT_BASE + 96, /* 64 Byte Rx Frame */
2057 GM_RXF_127B = GM_MIB_CNT_BASE + 104, /* 65-127 Byte Rx Frame */
2058 GM_RXF_255B = GM_MIB_CNT_BASE + 112, /* 128-255 Byte Rx Frame */
2059 GM_RXF_511B = GM_MIB_CNT_BASE + 120, /* 256-511 Byte Rx Frame */
2060 GM_RXF_1023B = GM_MIB_CNT_BASE + 128, /* 512-1023 Byte Rx Frame */
2061 GM_RXF_1518B = GM_MIB_CNT_BASE + 136, /* 1024-1518 Byte Rx Frame */
2062 GM_RXF_MAX_SZ = GM_MIB_CNT_BASE + 144, /* 1519-MaxSize Byte Rx Frame */
2063 GM_RXF_LNG_ERR = GM_MIB_CNT_BASE + 152, /* Rx Frame too Long Error */
2064 GM_RXF_JAB_PKT = GM_MIB_CNT_BASE + 160, /* Rx Jabber Packet Frame */
2065 /* GM_MIB_CNT_BASE + 168: reserved */
2066 GM_RXE_FIFO_OV = GM_MIB_CNT_BASE + 176, /* Rx FIFO overflow Event */
2067 /* GM_MIB_CNT_BASE + 184: reserved */
2068 GM_TXF_UC_OK = GM_MIB_CNT_BASE + 192, /* Unicast Frames Xmitted OK */
2069 GM_TXF_BC_OK = GM_MIB_CNT_BASE + 200, /* Broadcast Frames Xmitted OK */
2070 GM_TXF_MPAUSE = GM_MIB_CNT_BASE + 208, /* Pause MAC Ctrl Frames Xmitted */
2071 GM_TXF_MC_OK = GM_MIB_CNT_BASE + 216, /* Multicast Frames Xmitted OK */
2072 GM_TXO_OK_LO = GM_MIB_CNT_BASE + 224, /* Octets Transmitted OK Low */
2073 GM_TXO_OK_HI = GM_MIB_CNT_BASE + 232, /* Octets Transmitted OK High */
2074 GM_TXF_64B = GM_MIB_CNT_BASE + 240, /* 64 Byte Tx Frame */
2075 GM_TXF_127B = GM_MIB_CNT_BASE + 248, /* 65-127 Byte Tx Frame */
2076 GM_TXF_255B = GM_MIB_CNT_BASE + 256, /* 128-255 Byte Tx Frame */
2077 GM_TXF_511B = GM_MIB_CNT_BASE + 264, /* 256-511 Byte Tx Frame */
2078 GM_TXF_1023B = GM_MIB_CNT_BASE + 272, /* 512-1023 Byte Tx Frame */
2079 GM_TXF_1518B = GM_MIB_CNT_BASE + 280, /* 1024-1518 Byte Tx Frame */
2080 GM_TXF_MAX_SZ = GM_MIB_CNT_BASE + 288, /* 1519-MaxSize Byte Tx Frame */
2081
2082 GM_TXF_COL = GM_MIB_CNT_BASE + 304, /* Tx Collision */
2083 GM_TXF_LAT_COL = GM_MIB_CNT_BASE + 312, /* Tx Late Collision */
2084 GM_TXF_ABO_COL = GM_MIB_CNT_BASE + 320, /* Tx aborted due to Exces. Col. */
2085 GM_TXF_MUL_COL = GM_MIB_CNT_BASE + 328, /* Tx Multiple Collision */
2086 GM_TXF_SNG_COL = GM_MIB_CNT_BASE + 336, /* Tx Single Collision */
2087 GM_TXE_FIFO_UR = GM_MIB_CNT_BASE + 344, /* Tx FIFO Underrun Event */
2088};
2089
2090/* GMAC Bit Definitions */
2091/* GM_GP_STAT 16 bit r/o General Purpose Status Register */
2092enum {
2093 GM_GPSR_SPEED = 1<<15, /* Bit 15: Port Speed (1 = 100 Mbps) */
2094 GM_GPSR_DUPLEX = 1<<14, /* Bit 14: Duplex Mode (1 = Full) */
2095 GM_GPSR_FC_TX_DIS = 1<<13, /* Bit 13: Tx Flow-Control Mode Disabled */
2096 GM_GPSR_LINK_UP = 1<<12, /* Bit 12: Link Up Status */
2097 GM_GPSR_PAUSE = 1<<11, /* Bit 11: Pause State */
2098 GM_GPSR_TX_ACTIVE = 1<<10, /* Bit 10: Tx in Progress */
2099 GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occured */
2100 GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occured */
2101
2102 GM_GPSR_PHY_ST_CH = 1<<5, /* Bit 5: PHY Status Change */
2103 GM_GPSR_GIG_SPEED = 1<<4, /* Bit 4: Gigabit Speed (1 = 1000 Mbps) */
2104 GM_GPSR_PART_MODE = 1<<3, /* Bit 3: Partition mode */
2105 GM_GPSR_FC_RX_DIS = 1<<2, /* Bit 2: Rx Flow-Control Mode Disabled */
2106 GM_GPSR_PROM_EN = 1<<1, /* Bit 1: Promiscuous Mode Enabled */
2107};
2108
2109/* GM_GP_CTRL 16 bit r/w General Purpose Control Register */
2110enum {
2111 GM_GPCR_PROM_ENA = 1<<14, /* Bit 14: Enable Promiscuous Mode */
2112 GM_GPCR_FC_TX_DIS = 1<<13, /* Bit 13: Disable Tx Flow-Control Mode */
2113 GM_GPCR_TX_ENA = 1<<12, /* Bit 12: Enable Transmit */
2114 GM_GPCR_RX_ENA = 1<<11, /* Bit 11: Enable Receive */
2115 GM_GPCR_BURST_ENA = 1<<10, /* Bit 10: Enable Burst Mode */
2116 GM_GPCR_LOOP_ENA = 1<<9, /* Bit 9: Enable MAC Loopback Mode */
2117 GM_GPCR_PART_ENA = 1<<8, /* Bit 8: Enable Partition Mode */
2118 GM_GPCR_GIGS_ENA = 1<<7, /* Bit 7: Gigabit Speed (1000 Mbps) */
2119 GM_GPCR_FL_PASS = 1<<6, /* Bit 6: Force Link Pass */
2120 GM_GPCR_DUP_FULL = 1<<5, /* Bit 5: Full Duplex Mode */
2121 GM_GPCR_FC_RX_DIS = 1<<4, /* Bit 4: Disable Rx Flow-Control Mode */
2122 GM_GPCR_SPEED_100 = 1<<3, /* Bit 3: Port Speed 100 Mbps */
2123 GM_GPCR_AU_DUP_DIS = 1<<2, /* Bit 2: Disable Auto-Update Duplex */
2124 GM_GPCR_AU_FCT_DIS = 1<<1, /* Bit 1: Disable Auto-Update Flow-C. */
2125 GM_GPCR_AU_SPD_DIS = 1<<0, /* Bit 0: Disable Auto-Update Speed */
2126};
2127
2128#define GM_GPCR_SPEED_1000 (GM_GPCR_GIGS_ENA | GM_GPCR_SPEED_100)
2129#define GM_GPCR_AU_ALL_DIS (GM_GPCR_AU_DUP_DIS | GM_GPCR_AU_FCT_DIS|GM_GPCR_AU_SPD_DIS)
2130
2131/* GM_TX_CTRL 16 bit r/w Transmit Control Register */
2132enum {
2133 GM_TXCR_FORCE_JAM = 1<<15, /* Bit 15: Force Jam / Flow-Control */
2134 GM_TXCR_CRC_DIS = 1<<14, /* Bit 14: Disable insertion of CRC */
2135 GM_TXCR_PAD_DIS = 1<<13, /* Bit 13: Disable padding of packets */
2136 GM_TXCR_COL_THR_MSK = 1<<10, /* Bit 12..10: Collision Threshold */
2137};
2138
2139#define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK)
2140#define TX_COL_DEF 0x04
2141
2142/* GM_RX_CTRL 16 bit r/w Receive Control Register */
2143enum {
2144 GM_RXCR_UCF_ENA = 1<<15, /* Bit 15: Enable Unicast filtering */
2145 GM_RXCR_MCF_ENA = 1<<14, /* Bit 14: Enable Multicast filtering */
2146 GM_RXCR_CRC_DIS = 1<<13, /* Bit 13: Remove 4-byte CRC */
2147 GM_RXCR_PASS_FC = 1<<12, /* Bit 12: Pass FC packets to FIFO */
2148};
2149
2150/* GM_TX_PARAM 16 bit r/w Transmit Parameter Register */
2151enum {
2152 GM_TXPA_JAMLEN_MSK = 0x03<<14, /* Bit 15..14: Jam Length */
2153 GM_TXPA_JAMIPG_MSK = 0x1f<<9, /* Bit 13..9: Jam IPG */
2154 GM_TXPA_JAMDAT_MSK = 0x1f<<4, /* Bit 8..4: IPG Jam to Data */
2155
2156 TX_JAM_LEN_DEF = 0x03,
2157 TX_JAM_IPG_DEF = 0x0b,
2158 TX_IPG_JAM_DEF = 0x1c,
2159};
2160
2161#define TX_JAM_LEN_VAL(x) (((x)<<14) & GM_TXPA_JAMLEN_MSK)
2162#define TX_JAM_IPG_VAL(x) (((x)<<9) & GM_TXPA_JAMIPG_MSK)
2163#define TX_IPG_JAM_DATA(x) (((x)<<4) & GM_TXPA_JAMDAT_MSK)
2164
2165
2166/* GM_SERIAL_MODE 16 bit r/w Serial Mode Register */
2167enum {
2168 GM_SMOD_DATABL_MSK = 0x1f<<11, /* Bit 15..11: Data Blinder (r/o) */
2169 GM_SMOD_LIMIT_4 = 1<<10, /* Bit 10: 4 consecutive Tx trials */
2170 GM_SMOD_VLAN_ENA = 1<<9, /* Bit 9: Enable VLAN (Max. Frame Len) */
2171 GM_SMOD_JUMBO_ENA = 1<<8, /* Bit 8: Enable Jumbo (Max. Frame Len) */
2172 GM_SMOD_IPG_MSK = 0x1f /* Bit 4..0: Inter-Packet Gap (IPG) */
2173};
2174
2175#define DATA_BLIND_VAL(x) (((x)<<11) & GM_SMOD_DATABL_MSK)
2176#define DATA_BLIND_DEF 0x04
2177
2178#define IPG_DATA_VAL(x) (x & GM_SMOD_IPG_MSK)
2179#define IPG_DATA_DEF 0x1e
2180
2181/* GM_SMI_CTRL 16 bit r/w SMI Control Register */
2182enum {
2183 GM_SMI_CT_PHY_A_MSK = 0x1f<<11,/* Bit 15..11: PHY Device Address */
2184 GM_SMI_CT_REG_A_MSK = 0x1f<<6,/* Bit 10.. 6: PHY Register Address */
2185 GM_SMI_CT_OP_RD = 1<<5, /* Bit 5: OpCode Read (0=Write)*/
2186 GM_SMI_CT_RD_VAL = 1<<4, /* Bit 4: Read Valid (Read completed) */
2187 GM_SMI_CT_BUSY = 1<<3, /* Bit 3: Busy (Operation in progress) */
2188};
2189
2190#define GM_SMI_CT_PHY_AD(x) (((x)<<11) & GM_SMI_CT_PHY_A_MSK)
2191#define GM_SMI_CT_REG_AD(x) (((x)<<6) & GM_SMI_CT_REG_A_MSK)
2192
2193/* GM_PHY_ADDR 16 bit r/w GPHY Address Register */
2194enum {
2195 GM_PAR_MIB_CLR = 1<<5, /* Bit 5: Set MIB Clear Counter Mode */
2196 GM_PAR_MIB_TST = 1<<4, /* Bit 4: MIB Load Counter (Test Mode) */
2197};
2198
2199/* Receive Frame Status Encoding */
2200enum {
2201 GMR_FS_LEN = 0xffff<<16, /* Bit 31..16: Rx Frame Length */
2202 GMR_FS_VLAN = 1<<13, /* Bit 13: VLAN Packet */
2203 GMR_FS_JABBER = 1<<12, /* Bit 12: Jabber Packet */
2204 GMR_FS_UN_SIZE = 1<<11, /* Bit 11: Undersize Packet */
2205 GMR_FS_MC = 1<<10, /* Bit 10: Multicast Packet */
2206 GMR_FS_BC = 1<<9, /* Bit 9: Broadcast Packet */
2207 GMR_FS_RX_OK = 1<<8, /* Bit 8: Receive OK (Good Packet) */
2208 GMR_FS_GOOD_FC = 1<<7, /* Bit 7: Good Flow-Control Packet */
2209 GMR_FS_BAD_FC = 1<<6, /* Bit 6: Bad Flow-Control Packet */
2210 GMR_FS_MII_ERR = 1<<5, /* Bit 5: MII Error */
2211 GMR_FS_LONG_ERR = 1<<4, /* Bit 4: Too Long Packet */
2212 GMR_FS_FRAGMENT = 1<<3, /* Bit 3: Fragment */
2213
2214 GMR_FS_CRC_ERR = 1<<1, /* Bit 1: CRC Error */
2215 GMR_FS_RX_FF_OV = 1<<0, /* Bit 0: Rx FIFO Overflow */
2216
2217/*
2218 * GMR_FS_ANY_ERR (analogous to XMR_FS_ANY_ERR)
2219 */
2220 GMR_FS_ANY_ERR = GMR_FS_CRC_ERR | GMR_FS_LONG_ERR |
2221 GMR_FS_MII_ERR | GMR_FS_BAD_FC | GMR_FS_GOOD_FC |
2222 GMR_FS_JABBER,
2223/* Rx GMAC FIFO Flush Mask (default) */
2224 RX_FF_FL_DEF_MSK = GMR_FS_CRC_ERR | GMR_FS_RX_FF_OV |GMR_FS_MII_ERR |
2225 GMR_FS_BAD_FC | GMR_FS_GOOD_FC | GMR_FS_UN_SIZE |
2226 GMR_FS_JABBER,
2227};
2228
2229/* RX_GMF_CTRL_T 32 bit Rx GMAC FIFO Control/Test */
2230enum {
2231 GMF_WP_TST_ON = 1<<14, /* Write Pointer Test On */
2232 GMF_WP_TST_OFF = 1<<13, /* Write Pointer Test Off */
2233 GMF_WP_STEP = 1<<12, /* Write Pointer Step/Increment */
2234
2235 GMF_RP_TST_ON = 1<<10, /* Read Pointer Test On */
2236 GMF_RP_TST_OFF = 1<<9, /* Read Pointer Test Off */
2237 GMF_RP_STEP = 1<<8, /* Read Pointer Step/Increment */
2238 GMF_RX_F_FL_ON = 1<<7, /* Rx FIFO Flush Mode On */
2239 GMF_RX_F_FL_OFF = 1<<6, /* Rx FIFO Flush Mode Off */
2240 GMF_CLI_RX_FO = 1<<5, /* Clear IRQ Rx FIFO Overrun */
2241 GMF_CLI_RX_FC = 1<<4, /* Clear IRQ Rx Frame Complete */
2242 GMF_OPER_ON = 1<<3, /* Operational Mode On */
2243 GMF_OPER_OFF = 1<<2, /* Operational Mode Off */
2244 GMF_RST_CLR = 1<<1, /* Clear GMAC FIFO Reset */
2245 GMF_RST_SET = 1<<0, /* Set GMAC FIFO Reset */
2246
2247 RX_GMF_FL_THR_DEF = 0xa, /* flush threshold (default) */
2248};
2249
2250
2251/* TX_GMF_CTRL_T 32 bit Tx GMAC FIFO Control/Test */
2252enum {
2253 GMF_WSP_TST_ON = 1<<18,/* Write Shadow Pointer Test On */
2254 GMF_WSP_TST_OFF = 1<<17,/* Write Shadow Pointer Test Off */
2255 GMF_WSP_STEP = 1<<16,/* Write Shadow Pointer Step/Increment */
2256
2257 GMF_CLI_TX_FU = 1<<6, /* Clear IRQ Tx FIFO Underrun */
2258 GMF_CLI_TX_FC = 1<<5, /* Clear IRQ Tx Frame Complete */
2259 GMF_CLI_TX_PE = 1<<4, /* Clear IRQ Tx Parity Error */
2260};
2261
2262/* GMAC_TI_ST_CTRL 8 bit Time Stamp Timer Ctrl Reg (YUKON only) */
2263enum {
2264 GMT_ST_START = 1<<2, /* Start Time Stamp Timer */
2265 GMT_ST_STOP = 1<<1, /* Stop Time Stamp Timer */
2266 GMT_ST_CLR_IRQ = 1<<0, /* Clear Time Stamp Timer IRQ */
2267};
2268
2269/* GMAC_CTRL 32 bit GMAC Control Reg (YUKON only) */
2270enum {
2271 GMC_H_BURST_ON = 1<<7, /* Half Duplex Burst Mode On */
2272 GMC_H_BURST_OFF = 1<<6, /* Half Duplex Burst Mode Off */
2273 GMC_F_LOOPB_ON = 1<<5, /* FIFO Loopback On */
2274 GMC_F_LOOPB_OFF = 1<<4, /* FIFO Loopback Off */
2275 GMC_PAUSE_ON = 1<<3, /* Pause On */
2276 GMC_PAUSE_OFF = 1<<2, /* Pause Off */
2277 GMC_RST_CLR = 1<<1, /* Clear GMAC Reset */
2278 GMC_RST_SET = 1<<0, /* Set GMAC Reset */
2279};
2280
2281/* GPHY_CTRL 32 bit GPHY Control Reg (YUKON only) */
2282enum {
2283 GPC_SEL_BDT = 1<<28, /* Select Bi-Dir. Transfer for MDC/MDIO */
2284 GPC_INT_POL_HI = 1<<27, /* IRQ Polarity is Active HIGH */
2285 GPC_75_OHM = 1<<26, /* Use 75 Ohm Termination instead of 50 */
2286 GPC_DIS_FC = 1<<25, /* Disable Automatic Fiber/Copper Detection */
2287 GPC_DIS_SLEEP = 1<<24, /* Disable Energy Detect */
2288 GPC_HWCFG_M_3 = 1<<23, /* HWCFG_MODE[3] */
2289 GPC_HWCFG_M_2 = 1<<22, /* HWCFG_MODE[2] */
2290 GPC_HWCFG_M_1 = 1<<21, /* HWCFG_MODE[1] */
2291 GPC_HWCFG_M_0 = 1<<20, /* HWCFG_MODE[0] */
2292 GPC_ANEG_0 = 1<<19, /* ANEG[0] */
2293 GPC_ENA_XC = 1<<18, /* Enable MDI crossover */
2294 GPC_DIS_125 = 1<<17, /* Disable 125 MHz clock */
2295 GPC_ANEG_3 = 1<<16, /* ANEG[3] */
2296 GPC_ANEG_2 = 1<<15, /* ANEG[2] */
2297 GPC_ANEG_1 = 1<<14, /* ANEG[1] */
2298 GPC_ENA_PAUSE = 1<<13, /* Enable Pause (SYM_OR_REM) */
2299 GPC_PHYADDR_4 = 1<<12, /* Bit 4 of Phy Addr */
2300 GPC_PHYADDR_3 = 1<<11, /* Bit 3 of Phy Addr */
2301 GPC_PHYADDR_2 = 1<<10, /* Bit 2 of Phy Addr */
2302 GPC_PHYADDR_1 = 1<<9, /* Bit 1 of Phy Addr */
2303 GPC_PHYADDR_0 = 1<<8, /* Bit 0 of Phy Addr */
2304 /* Bits 7..2: reserved */
2305 GPC_RST_CLR = 1<<1, /* Clear GPHY Reset */
2306 GPC_RST_SET = 1<<0, /* Set GPHY Reset */
2307};
2308
2309#define GPC_HWCFG_GMII_COP (GPC_HWCFG_M_3|GPC_HWCFG_M_2 | GPC_HWCFG_M_1 | GPC_HWCFG_M_0)
2310#define GPC_HWCFG_GMII_FIB (GPC_HWCFG_M_2 | GPC_HWCFG_M_1 | GPC_HWCFG_M_0)
2311#define GPC_ANEG_ADV_ALL_M (GPC_ANEG_3 | GPC_ANEG_2 | GPC_ANEG_1 | GPC_ANEG_0)
2312
2313/* forced speed and duplex mode (don't mix with other ANEG bits) */
2314#define GPC_FRC10MBIT_HALF 0
2315#define GPC_FRC10MBIT_FULL GPC_ANEG_0
2316#define GPC_FRC100MBIT_HALF GPC_ANEG_1
2317#define GPC_FRC100MBIT_FULL (GPC_ANEG_0 | GPC_ANEG_1)
2318
2319/* auto-negotiation with limited advertised speeds */
2320/* mix only with master/slave settings (for copper) */
2321#define GPC_ADV_1000_HALF GPC_ANEG_2
2322#define GPC_ADV_1000_FULL GPC_ANEG_3
2323#define GPC_ADV_ALL (GPC_ANEG_2 | GPC_ANEG_3)
2324
2325/* master/slave settings */
2326/* only for copper with 1000 Mbps */
2327#define GPC_FORCE_MASTER 0
2328#define GPC_FORCE_SLAVE GPC_ANEG_0
2329#define GPC_PREF_MASTER GPC_ANEG_1
2330#define GPC_PREF_SLAVE (GPC_ANEG_1 | GPC_ANEG_0)
2331
2332/* GMAC_IRQ_SRC 8 bit GMAC Interrupt Source Reg (YUKON only) */
2333/* GMAC_IRQ_MSK 8 bit GMAC Interrupt Mask Reg (YUKON only) */
2334enum {
2335 GM_IS_TX_CO_OV = 1<<5, /* Transmit Counter Overflow IRQ */
2336 GM_IS_RX_CO_OV = 1<<4, /* Receive Counter Overflow IRQ */
2337 GM_IS_TX_FF_UR = 1<<3, /* Transmit FIFO Underrun */
2338 GM_IS_TX_COMPL = 1<<2, /* Frame Transmission Complete */
2339 GM_IS_RX_FF_OR = 1<<1, /* Receive FIFO Overrun */
2340 GM_IS_RX_COMPL = 1<<0, /* Frame Reception Complete */
2341
2342#define GMAC_DEF_MSK (GM_IS_TX_CO_OV | GM_IS_RX_CO_OV | GM_IS_TX_FF_UR)
2343
2344/* GMAC_LINK_CTRL 16 bit GMAC Link Control Reg (YUKON only) */
2345 /* Bits 15.. 2: reserved */
2346 GMLC_RST_CLR = 1<<1, /* Clear GMAC Link Reset */
2347 GMLC_RST_SET = 1<<0, /* Set GMAC Link Reset */
2348
2349
2350/* WOL_CTRL_STAT 16 bit WOL Control/Status Reg */
2351 WOL_CTL_LINK_CHG_OCC = 1<<15,
2352 WOL_CTL_MAGIC_PKT_OCC = 1<<14,
2353 WOL_CTL_PATTERN_OCC = 1<<13,
2354 WOL_CTL_CLEAR_RESULT = 1<<12,
2355 WOL_CTL_ENA_PME_ON_LINK_CHG = 1<<11,
2356 WOL_CTL_DIS_PME_ON_LINK_CHG = 1<<10,
2357 WOL_CTL_ENA_PME_ON_MAGIC_PKT = 1<<9,
2358 WOL_CTL_DIS_PME_ON_MAGIC_PKT = 1<<8,
2359 WOL_CTL_ENA_PME_ON_PATTERN = 1<<7,
2360 WOL_CTL_DIS_PME_ON_PATTERN = 1<<6,
2361 WOL_CTL_ENA_LINK_CHG_UNIT = 1<<5,
2362 WOL_CTL_DIS_LINK_CHG_UNIT = 1<<4,
2363 WOL_CTL_ENA_MAGIC_PKT_UNIT = 1<<3,
2364 WOL_CTL_DIS_MAGIC_PKT_UNIT = 1<<2,
2365 WOL_CTL_ENA_PATTERN_UNIT = 1<<1,
2366 WOL_CTL_DIS_PATTERN_UNIT = 1<<0,
2367};
2368
2369#define WOL_CTL_DEFAULT \
2370 (WOL_CTL_DIS_PME_ON_LINK_CHG | \
2371 WOL_CTL_DIS_PME_ON_PATTERN | \
2372 WOL_CTL_DIS_PME_ON_MAGIC_PKT | \
2373 WOL_CTL_DIS_LINK_CHG_UNIT | \
2374 WOL_CTL_DIS_PATTERN_UNIT | \
2375 WOL_CTL_DIS_MAGIC_PKT_UNIT)
2376
2377/* WOL_MATCH_CTL 8 bit WOL Match Control Reg */
2378#define WOL_CTL_PATT_ENA(x) (1 << (x))
2379
2380
2381/* XMAC II registers */
2382enum {
2383 XM_MMU_CMD = 0x0000, /* 16 bit r/w MMU Command Register */
2384 XM_POFF = 0x0008, /* 32 bit r/w Packet Offset Register */
2385 XM_BURST = 0x000c, /* 32 bit r/w Burst Register for half duplex*/
2386 XM_1L_VLAN_TAG = 0x0010, /* 16 bit r/w One Level VLAN Tag ID */
2387 XM_2L_VLAN_TAG = 0x0014, /* 16 bit r/w Two Level VLAN Tag ID */
2388 XM_TX_CMD = 0x0020, /* 16 bit r/w Transmit Command Register */
2389 XM_TX_RT_LIM = 0x0024, /* 16 bit r/w Transmit Retry Limit Register */
2390 XM_TX_STIME = 0x0028, /* 16 bit r/w Transmit Slottime Register */
2391 XM_TX_IPG = 0x002c, /* 16 bit r/w Transmit Inter Packet Gap */
2392 XM_RX_CMD = 0x0030, /* 16 bit r/w Receive Command Register */
2393 XM_PHY_ADDR = 0x0034, /* 16 bit r/w PHY Address Register */
2394 XM_PHY_DATA = 0x0038, /* 16 bit r/w PHY Data Register */
2395 XM_GP_PORT = 0x0040, /* 32 bit r/w General Purpose Port Register */
2396 XM_IMSK = 0x0044, /* 16 bit r/w Interrupt Mask Register */
2397 XM_ISRC = 0x0048, /* 16 bit r/o Interrupt Status Register */
2398 XM_HW_CFG = 0x004c, /* 16 bit r/w Hardware Config Register */
2399 XM_TX_LO_WM = 0x0060, /* 16 bit r/w Tx FIFO Low Water Mark */
2400 XM_TX_HI_WM = 0x0062, /* 16 bit r/w Tx FIFO High Water Mark */
2401 XM_TX_THR = 0x0064, /* 16 bit r/w Tx Request Threshold */
2402 XM_HT_THR = 0x0066, /* 16 bit r/w Host Request Threshold */
2403 XM_PAUSE_DA = 0x0068, /* NA reg r/w Pause Destination Address */
2404 XM_CTL_PARA = 0x0070, /* 32 bit r/w Control Parameter Register */
2405 XM_MAC_OPCODE = 0x0074, /* 16 bit r/w Opcode for MAC control frames */
2406 XM_MAC_PTIME = 0x0076, /* 16 bit r/w Pause time for MAC ctrl frames*/
2407 XM_TX_STAT = 0x0078, /* 32 bit r/o Tx Status LIFO Register */
2408
2409 XM_EXM_START = 0x0080, /* r/w Start Address of the EXM Regs */
2410#define XM_EXM(reg) (XM_EXM_START + ((reg) << 3))
2411};
2412
2413enum {
2414 XM_SRC_CHK = 0x0100, /* NA reg r/w Source Check Address Register */
2415 XM_SA = 0x0108, /* NA reg r/w Station Address Register */
2416 XM_HSM = 0x0110, /* 64 bit r/w Hash Match Address Registers */
2417 XM_RX_LO_WM = 0x0118, /* 16 bit r/w Receive Low Water Mark */
2418 XM_RX_HI_WM = 0x011a, /* 16 bit r/w Receive High Water Mark */
2419 XM_RX_THR = 0x011c, /* 32 bit r/w Receive Request Threshold */
2420 XM_DEV_ID = 0x0120, /* 32 bit r/o Device ID Register */
2421 XM_MODE = 0x0124, /* 32 bit r/w Mode Register */
2422 XM_LSA = 0x0128, /* NA reg r/o Last Source Register */
2423 XM_TS_READ = 0x0130, /* 32 bit r/o Time Stamp Read Register */
2424 XM_TS_LOAD = 0x0134, /* 32 bit r/o Time Stamp Load Value */
2425 XM_STAT_CMD = 0x0200, /* 16 bit r/w Statistics Command Register */
2426 XM_RX_CNT_EV = 0x0204, /* 32 bit r/o Rx Counter Event Register */
2427 XM_TX_CNT_EV = 0x0208, /* 32 bit r/o Tx Counter Event Register */
2428 XM_RX_EV_MSK = 0x020c, /* 32 bit r/w Rx Counter Event Mask */
2429 XM_TX_EV_MSK = 0x0210, /* 32 bit r/w Tx Counter Event Mask */
2430 XM_TXF_OK = 0x0280, /* 32 bit r/o Frames Transmitted OK Conuter */
2431 XM_TXO_OK_HI = 0x0284, /* 32 bit r/o Octets Transmitted OK High Cnt*/
2432 XM_TXO_OK_LO = 0x0288, /* 32 bit r/o Octets Transmitted OK Low Cnt */
2433 XM_TXF_BC_OK = 0x028c, /* 32 bit r/o Broadcast Frames Xmitted OK */
2434 XM_TXF_MC_OK = 0x0290, /* 32 bit r/o Multicast Frames Xmitted OK */
2435 XM_TXF_UC_OK = 0x0294, /* 32 bit r/o Unicast Frames Xmitted OK */
2436 XM_TXF_LONG = 0x0298, /* 32 bit r/o Tx Long Frame Counter */
2437 XM_TXE_BURST = 0x029c, /* 32 bit r/o Tx Burst Event Counter */
2438 XM_TXF_MPAUSE = 0x02a0, /* 32 bit r/o Tx Pause MAC Ctrl Frame Cnt */
2439 XM_TXF_MCTRL = 0x02a4, /* 32 bit r/o Tx MAC Ctrl Frame Counter */
2440 XM_TXF_SNG_COL = 0x02a8, /* 32 bit r/o Tx Single Collision Counter */
2441 XM_TXF_MUL_COL = 0x02ac, /* 32 bit r/o Tx Multiple Collision Counter */
2442 XM_TXF_ABO_COL = 0x02b0, /* 32 bit r/o Tx aborted due to Exces. Col. */
2443 XM_TXF_LAT_COL = 0x02b4, /* 32 bit r/o Tx Late Collision Counter */
2444 XM_TXF_DEF = 0x02b8, /* 32 bit r/o Tx Deferred Frame Counter */
2445 XM_TXF_EX_DEF = 0x02bc, /* 32 bit r/o Tx Excessive Deferall Counter */
2446 XM_TXE_FIFO_UR = 0x02c0, /* 32 bit r/o Tx FIFO Underrun Event Cnt */
2447 XM_TXE_CS_ERR = 0x02c4, /* 32 bit r/o Tx Carrier Sense Error Cnt */
2448 XM_TXP_UTIL = 0x02c8, /* 32 bit r/o Tx Utilization in % */
2449 XM_TXF_64B = 0x02d0, /* 32 bit r/o 64 Byte Tx Frame Counter */
2450 XM_TXF_127B = 0x02d4, /* 32 bit r/o 65-127 Byte Tx Frame Counter */
2451 XM_TXF_255B = 0x02d8, /* 32 bit r/o 128-255 Byte Tx Frame Counter */
2452 XM_TXF_511B = 0x02dc, /* 32 bit r/o 256-511 Byte Tx Frame Counter */
2453 XM_TXF_1023B = 0x02e0, /* 32 bit r/o 512-1023 Byte Tx Frame Counter*/
2454 XM_TXF_MAX_SZ = 0x02e4, /* 32 bit r/o 1024-MaxSize Byte Tx Frame Cnt*/
2455 XM_RXF_OK = 0x0300, /* 32 bit r/o Frames Received OK */
2456 XM_RXO_OK_HI = 0x0304, /* 32 bit r/o Octets Received OK High Cnt */
2457 XM_RXO_OK_LO = 0x0308, /* 32 bit r/o Octets Received OK Low Counter*/
2458 XM_RXF_BC_OK = 0x030c, /* 32 bit r/o Broadcast Frames Received OK */
2459 XM_RXF_MC_OK = 0x0310, /* 32 bit r/o Multicast Frames Received OK */
2460 XM_RXF_UC_OK = 0x0314, /* 32 bit r/o Unicast Frames Received OK */
2461 XM_RXF_MPAUSE = 0x0318, /* 32 bit r/o Rx Pause MAC Ctrl Frame Cnt */
2462 XM_RXF_MCTRL = 0x031c, /* 32 bit r/o Rx MAC Ctrl Frame Counter */
2463 XM_RXF_INV_MP = 0x0320, /* 32 bit r/o Rx invalid Pause Frame Cnt */
2464 XM_RXF_INV_MOC = 0x0324, /* 32 bit r/o Rx Frames with inv. MAC Opcode*/
2465 XM_RXE_BURST = 0x0328, /* 32 bit r/o Rx Burst Event Counter */
2466 XM_RXE_FMISS = 0x032c, /* 32 bit r/o Rx Missed Frames Event Cnt */
2467 XM_RXF_FRA_ERR = 0x0330, /* 32 bit r/o Rx Framing Error Counter */
2468 XM_RXE_FIFO_OV = 0x0334, /* 32 bit r/o Rx FIFO overflow Event Cnt */
2469 XM_RXF_JAB_PKT = 0x0338, /* 32 bit r/o Rx Jabber Packet Frame Cnt */
2470 XM_RXE_CAR_ERR = 0x033c, /* 32 bit r/o Rx Carrier Event Error Cnt */
2471 XM_RXF_LEN_ERR = 0x0340, /* 32 bit r/o Rx in Range Length Error */
2472 XM_RXE_SYM_ERR = 0x0344, /* 32 bit r/o Rx Symbol Error Counter */
2473 XM_RXE_SHT_ERR = 0x0348, /* 32 bit r/o Rx Short Event Error Cnt */
2474 XM_RXE_RUNT = 0x034c, /* 32 bit r/o Rx Runt Event Counter */
2475 XM_RXF_LNG_ERR = 0x0350, /* 32 bit r/o Rx Frame too Long Error Cnt */
2476 XM_RXF_FCS_ERR = 0x0354, /* 32 bit r/o Rx Frame Check Seq. Error Cnt */
2477 XM_RXF_CEX_ERR = 0x035c, /* 32 bit r/o Rx Carrier Ext Error Frame Cnt*/
2478 XM_RXP_UTIL = 0x0360, /* 32 bit r/o Rx Utilization in % */
2479 XM_RXF_64B = 0x0368, /* 32 bit r/o 64 Byte Rx Frame Counter */
2480 XM_RXF_127B = 0x036c, /* 32 bit r/o 65-127 Byte Rx Frame Counter */
2481 XM_RXF_255B = 0x0370, /* 32 bit r/o 128-255 Byte Rx Frame Counter */
2482 XM_RXF_511B = 0x0374, /* 32 bit r/o 256-511 Byte Rx Frame Counter */
2483 XM_RXF_1023B = 0x0378, /* 32 bit r/o 512-1023 Byte Rx Frame Counter*/
2484 XM_RXF_MAX_SZ = 0x037c, /* 32 bit r/o 1024-MaxSize Byte Rx Frame Cnt*/
2485};
2486
2487/* XM_MMU_CMD 16 bit r/w MMU Command Register */
2488enum {
2489 XM_MMU_PHY_RDY = 1<<12,/* Bit 12: PHY Read Ready */
2490 XM_MMU_PHY_BUSY = 1<<11,/* Bit 11: PHY Busy */
2491 XM_MMU_IGN_PF = 1<<10,/* Bit 10: Ignore Pause Frame */
2492 XM_MMU_MAC_LB = 1<<9, /* Bit 9: Enable MAC Loopback */
2493 XM_MMU_FRC_COL = 1<<7, /* Bit 7: Force Collision */
2494 XM_MMU_SIM_COL = 1<<6, /* Bit 6: Simulate Collision */
2495 XM_MMU_NO_PRE = 1<<5, /* Bit 5: No MDIO Preamble */
2496 XM_MMU_GMII_FD = 1<<4, /* Bit 4: GMII uses Full Duplex */
2497 XM_MMU_RAT_CTRL = 1<<3, /* Bit 3: Enable Rate Control */
2498 XM_MMU_GMII_LOOP= 1<<2, /* Bit 2: PHY is in Loopback Mode */
2499 XM_MMU_ENA_RX = 1<<1, /* Bit 1: Enable Receiver */
2500 XM_MMU_ENA_TX = 1<<0, /* Bit 0: Enable Transmitter */
2501};
2502
2503
2504/* XM_TX_CMD 16 bit r/w Transmit Command Register */
2505enum {
2506 XM_TX_BK2BK = 1<<6, /* Bit 6: Ignor Carrier Sense (Tx Bk2Bk)*/
2507 XM_TX_ENC_BYP = 1<<5, /* Bit 5: Set Encoder in Bypass Mode */
2508 XM_TX_SAM_LINE = 1<<4, /* Bit 4: (sc) Start utilization calculation */
2509 XM_TX_NO_GIG_MD = 1<<3, /* Bit 3: Disable Carrier Extension */
2510 XM_TX_NO_PRE = 1<<2, /* Bit 2: Disable Preamble Generation */
2511 XM_TX_NO_CRC = 1<<1, /* Bit 1: Disable CRC Generation */
2512 XM_TX_AUTO_PAD = 1<<0, /* Bit 0: Enable Automatic Padding */
2513};
2514
2515/* XM_TX_RT_LIM 16 bit r/w Transmit Retry Limit Register */
2516#define XM_RT_LIM_MSK 0x1f /* Bit 4..0: Tx Retry Limit */
2517
2518
2519/* XM_TX_STIME 16 bit r/w Transmit Slottime Register */
2520#define XM_STIME_MSK 0x7f /* Bit 6..0: Tx Slottime bits */
2521
2522
2523/* XM_TX_IPG 16 bit r/w Transmit Inter Packet Gap */
2524#define XM_IPG_MSK 0xff /* Bit 7..0: IPG value bits */
2525
2526
2527/* XM_RX_CMD 16 bit r/w Receive Command Register */
2528enum {
2529 XM_RX_LENERR_OK = 1<<8, /* Bit 8 don't set Rx Err bit for */
2530 /* inrange error packets */
2531 XM_RX_BIG_PK_OK = 1<<7, /* Bit 7 don't set Rx Err bit for */
2532 /* jumbo packets */
2533 XM_RX_IPG_CAP = 1<<6, /* Bit 6 repl. type field with IPG */
2534 XM_RX_TP_MD = 1<<5, /* Bit 5: Enable transparent Mode */
2535 XM_RX_STRIP_FCS = 1<<4, /* Bit 4: Enable FCS Stripping */
2536 XM_RX_SELF_RX = 1<<3, /* Bit 3: Enable Rx of own packets */
2537 XM_RX_SAM_LINE = 1<<2, /* Bit 2: (sc) Start utilization calculation */
2538 XM_RX_STRIP_PAD = 1<<1, /* Bit 1: Strip pad bytes of Rx frames */
2539 XM_RX_DIS_CEXT = 1<<0, /* Bit 0: Disable carrier ext. check */
2540};
2541
2542
2543/* XM_PHY_ADDR 16 bit r/w PHY Address Register */
2544#define XM_PHY_ADDR_SZ 0x1f /* Bit 4..0: PHY Address bits */
2545
2546
2547/* XM_GP_PORT 32 bit r/w General Purpose Port Register */
2548enum {
2549 XM_GP_ANIP = 1<<6, /* Bit 6: (ro) Auto-Neg. in progress */
2550 XM_GP_FRC_INT = 1<<5, /* Bit 5: (sc) Force Interrupt */
2551 XM_GP_RES_MAC = 1<<3, /* Bit 3: (sc) Reset MAC and FIFOs */
2552 XM_GP_RES_STAT = 1<<2, /* Bit 2: (sc) Reset the statistics module */
2553 XM_GP_INP_ASS = 1<<0, /* Bit 0: (ro) GP Input Pin asserted */
2554};
2555
2556
2557/* XM_IMSK 16 bit r/w Interrupt Mask Register */
2558/* XM_ISRC 16 bit r/o Interrupt Status Register */
2559enum {
2560 XM_IS_LNK_AE = 1<<14, /* Bit 14: Link Asynchronous Event */
2561 XM_IS_TX_ABORT = 1<<13, /* Bit 13: Transmit Abort, late Col. etc */
2562 XM_IS_FRC_INT = 1<<12, /* Bit 12: Force INT bit set in GP */
2563 XM_IS_INP_ASS = 1<<11, /* Bit 11: Input Asserted, GP bit 0 set */
2564 XM_IS_LIPA_RC = 1<<10, /* Bit 10: Link Partner requests config */
2565 XM_IS_RX_PAGE = 1<<9, /* Bit 9: Page Received */
2566 XM_IS_TX_PAGE = 1<<8, /* Bit 8: Next Page Loaded for Transmit */
2567 XM_IS_AND = 1<<7, /* Bit 7: Auto-Negotiation Done */
2568 XM_IS_TSC_OV = 1<<6, /* Bit 6: Time Stamp Counter Overflow */
2569 XM_IS_RXC_OV = 1<<5, /* Bit 5: Rx Counter Event Overflow */
2570 XM_IS_TXC_OV = 1<<4, /* Bit 4: Tx Counter Event Overflow */
2571 XM_IS_RXF_OV = 1<<3, /* Bit 3: Receive FIFO Overflow */
2572 XM_IS_TXF_UR = 1<<2, /* Bit 2: Transmit FIFO Underrun */
2573 XM_IS_TX_COMP = 1<<1, /* Bit 1: Frame Tx Complete */
2574 XM_IS_RX_COMP = 1<<0, /* Bit 0: Frame Rx Complete */
2575};
2576
2577#define XM_DEF_MSK (~(XM_IS_INP_ASS | XM_IS_LIPA_RC | XM_IS_RX_PAGE | \
2578 XM_IS_AND | XM_IS_RXC_OV | XM_IS_TXC_OV | \
2579 XM_IS_RXF_OV | XM_IS_TXF_UR))
2580
2581
2582/* XM_HW_CFG 16 bit r/w Hardware Config Register */
2583enum {
2584 XM_HW_GEN_EOP = 1<<3, /* Bit 3: generate End of Packet pulse */
2585 XM_HW_COM4SIG = 1<<2, /* Bit 2: use Comma Detect for Sig. Det.*/
2586 XM_HW_GMII_MD = 1<<0, /* Bit 0: GMII Interface selected */
2587};
2588
2589
2590/* XM_TX_LO_WM 16 bit r/w Tx FIFO Low Water Mark */
2591/* XM_TX_HI_WM 16 bit r/w Tx FIFO High Water Mark */
2592#define XM_TX_WM_MSK 0x01ff /* Bit 9.. 0 Tx FIFO Watermark bits */
2593
2594/* XM_TX_THR 16 bit r/w Tx Request Threshold */
2595/* XM_HT_THR 16 bit r/w Host Request Threshold */
2596/* XM_RX_THR 16 bit r/w Rx Request Threshold */
2597#define XM_THR_MSK 0x03ff /* Bit 10.. 0 Rx/Tx Request Threshold bits */
2598
2599
2600/* XM_TX_STAT 32 bit r/o Tx Status LIFO Register */
2601enum {
2602 XM_ST_VALID = (1UL<<31), /* Bit 31: Status Valid */
2603 XM_ST_BYTE_CNT = (0x3fffL<<17), /* Bit 30..17: Tx frame Length */
2604 XM_ST_RETRY_CNT = (0x1fL<<12), /* Bit 16..12: Retry Count */
2605 XM_ST_EX_COL = 1<<11, /* Bit 11: Excessive Collisions */
2606 XM_ST_EX_DEF = 1<<10, /* Bit 10: Excessive Deferral */
2607 XM_ST_BURST = 1<<9, /* Bit 9: p. xmitted in burst md*/
2608 XM_ST_DEFER = 1<<8, /* Bit 8: packet was defered */
2609 XM_ST_BC = 1<<7, /* Bit 7: Broadcast packet */
2610 XM_ST_MC = 1<<6, /* Bit 6: Multicast packet */
2611 XM_ST_UC = 1<<5, /* Bit 5: Unicast packet */
2612 XM_ST_TX_UR = 1<<4, /* Bit 4: FIFO Underrun occured */
2613 XM_ST_CS_ERR = 1<<3, /* Bit 3: Carrier Sense Error */
2614 XM_ST_LAT_COL = 1<<2, /* Bit 2: Late Collision Error */
2615 XM_ST_MUL_COL = 1<<1, /* Bit 1: Multiple Collisions */
2616 XM_ST_SGN_COL = 1<<0, /* Bit 0: Single Collision */
2617};
2618
2619/* XM_RX_LO_WM 16 bit r/w Receive Low Water Mark */
2620/* XM_RX_HI_WM 16 bit r/w Receive High Water Mark */
2621#define XM_RX_WM_MSK 0x03ff /* Bit 11.. 0: Rx FIFO Watermark bits */
2622
2623
2624/* XM_DEV_ID 32 bit r/o Device ID Register */
2625#define XM_DEV_OUI (0x00ffffffUL<<8) /* Bit 31..8: Device OUI */
2626#define XM_DEV_REV (0x07L << 5) /* Bit 7..5: Chip Rev Num */
2627
2628
2629/* XM_MODE 32 bit r/w Mode Register */
2630enum {
2631 XM_MD_ENA_REJ = 1<<26, /* Bit 26: Enable Frame Reject */
2632 XM_MD_SPOE_E = 1<<25, /* Bit 25: Send Pause on Edge */
2633 /* extern generated */
2634 XM_MD_TX_REP = 1<<24, /* Bit 24: Transmit Repeater Mode */
2635 XM_MD_SPOFF_I = 1<<23, /* Bit 23: Send Pause on FIFO full */
2636 /* intern generated */
2637 XM_MD_LE_STW = 1<<22, /* Bit 22: Rx Stat Word in Little Endian */
2638 XM_MD_TX_CONT = 1<<21, /* Bit 21: Send Continuous */
2639 XM_MD_TX_PAUSE = 1<<20, /* Bit 20: (sc) Send Pause Frame */
2640 XM_MD_ATS = 1<<19, /* Bit 19: Append Time Stamp */
2641 XM_MD_SPOL_I = 1<<18, /* Bit 18: Send Pause on Low */
2642 /* intern generated */
2643 XM_MD_SPOH_I = 1<<17, /* Bit 17: Send Pause on High */
2644 /* intern generated */
2645 XM_MD_CAP = 1<<16, /* Bit 16: Check Address Pair */
2646 XM_MD_ENA_HASH = 1<<15, /* Bit 15: Enable Hashing */
2647 XM_MD_CSA = 1<<14, /* Bit 14: Check Station Address */
2648 XM_MD_CAA = 1<<13, /* Bit 13: Check Address Array */
2649 XM_MD_RX_MCTRL = 1<<12, /* Bit 12: Rx MAC Control Frame */
2650 XM_MD_RX_RUNT = 1<<11, /* Bit 11: Rx Runt Frames */
2651 XM_MD_RX_IRLE = 1<<10, /* Bit 10: Rx in Range Len Err Frame */
2652 XM_MD_RX_LONG = 1<<9, /* Bit 9: Rx Long Frame */
2653 XM_MD_RX_CRCE = 1<<8, /* Bit 8: Rx CRC Error Frame */
2654 XM_MD_RX_ERR = 1<<7, /* Bit 7: Rx Error Frame */
2655 XM_MD_DIS_UC = 1<<6, /* Bit 6: Disable Rx Unicast */
2656 XM_MD_DIS_MC = 1<<5, /* Bit 5: Disable Rx Multicast */
2657 XM_MD_DIS_BC = 1<<4, /* Bit 4: Disable Rx Broadcast */
2658 XM_MD_ENA_PROM = 1<<3, /* Bit 3: Enable Promiscuous */
2659 XM_MD_ENA_BE = 1<<2, /* Bit 2: Enable Big Endian */
2660 XM_MD_FTF = 1<<1, /* Bit 1: (sc) Flush Tx FIFO */
2661 XM_MD_FRF = 1<<0, /* Bit 0: (sc) Flush Rx FIFO */
2662};
2663
2664#define XM_PAUSE_MODE (XM_MD_SPOE_E | XM_MD_SPOL_I | XM_MD_SPOH_I)
2665#define XM_DEF_MODE (XM_MD_RX_RUNT | XM_MD_RX_IRLE | XM_MD_RX_LONG |\
2666 XM_MD_RX_CRCE | XM_MD_RX_ERR | XM_MD_CSA | XM_MD_CAA)
2667
2668/* XM_STAT_CMD 16 bit r/w Statistics Command Register */
2669enum {
2670 XM_SC_SNP_RXC = 1<<5, /* Bit 5: (sc) Snap Rx Counters */
2671 XM_SC_SNP_TXC = 1<<4, /* Bit 4: (sc) Snap Tx Counters */
2672 XM_SC_CP_RXC = 1<<3, /* Bit 3: Copy Rx Counters Continuously */
2673 XM_SC_CP_TXC = 1<<2, /* Bit 2: Copy Tx Counters Continuously */
2674 XM_SC_CLR_RXC = 1<<1, /* Bit 1: (sc) Clear Rx Counters */
2675 XM_SC_CLR_TXC = 1<<0, /* Bit 0: (sc) Clear Tx Counters */
2676};
2677
2678
2679/* XM_RX_CNT_EV 32 bit r/o Rx Counter Event Register */
2680/* XM_RX_EV_MSK 32 bit r/w Rx Counter Event Mask */
2681enum {
2682 XMR_MAX_SZ_OV = 1<<31, /* Bit 31: 1024-MaxSize Rx Cnt Ov*/
2683 XMR_1023B_OV = 1<<30, /* Bit 30: 512-1023Byte Rx Cnt Ov*/
2684 XMR_511B_OV = 1<<29, /* Bit 29: 256-511 Byte Rx Cnt Ov*/
2685 XMR_255B_OV = 1<<28, /* Bit 28: 128-255 Byte Rx Cnt Ov*/
2686 XMR_127B_OV = 1<<27, /* Bit 27: 65-127 Byte Rx Cnt Ov */
2687 XMR_64B_OV = 1<<26, /* Bit 26: 64 Byte Rx Cnt Ov */
2688 XMR_UTIL_OV = 1<<25, /* Bit 25: Rx Util Cnt Overflow */
2689 XMR_UTIL_UR = 1<<24, /* Bit 24: Rx Util Cnt Underrun */
2690 XMR_CEX_ERR_OV = 1<<23, /* Bit 23: CEXT Err Cnt Ov */
2691 XMR_FCS_ERR_OV = 1<<21, /* Bit 21: Rx FCS Error Cnt Ov */
2692 XMR_LNG_ERR_OV = 1<<20, /* Bit 20: Rx too Long Err Cnt Ov*/
2693 XMR_RUNT_OV = 1<<19, /* Bit 19: Runt Event Cnt Ov */
2694 XMR_SHT_ERR_OV = 1<<18, /* Bit 18: Rx Short Ev Err Cnt Ov*/
2695 XMR_SYM_ERR_OV = 1<<17, /* Bit 17: Rx Sym Err Cnt Ov */
2696 XMR_CAR_ERR_OV = 1<<15, /* Bit 15: Rx Carr Ev Err Cnt Ov */
2697 XMR_JAB_PKT_OV = 1<<14, /* Bit 14: Rx Jabb Packet Cnt Ov */
2698 XMR_FIFO_OV = 1<<13, /* Bit 13: Rx FIFO Ov Ev Cnt Ov */
2699 XMR_FRA_ERR_OV = 1<<12, /* Bit 12: Rx Framing Err Cnt Ov */
2700 XMR_FMISS_OV = 1<<11, /* Bit 11: Rx Missed Ev Cnt Ov */
2701 XMR_BURST = 1<<10, /* Bit 10: Rx Burst Event Cnt Ov */
2702 XMR_INV_MOC = 1<<9, /* Bit 9: Rx with inv. MAC OC Ov*/
2703 XMR_INV_MP = 1<<8, /* Bit 8: Rx inv Pause Frame Ov */
2704 XMR_MCTRL_OV = 1<<7, /* Bit 7: Rx MAC Ctrl-F Cnt Ov */
2705 XMR_MPAUSE_OV = 1<<6, /* Bit 6: Rx Pause MAC Ctrl-F Ov*/
2706 XMR_UC_OK_OV = 1<<5, /* Bit 5: Rx Unicast Frame CntOv*/
2707 XMR_MC_OK_OV = 1<<4, /* Bit 4: Rx Multicast Cnt Ov */
2708 XMR_BC_OK_OV = 1<<3, /* Bit 3: Rx Broadcast Cnt Ov */
2709 XMR_OK_LO_OV = 1<<2, /* Bit 2: Octets Rx OK Low CntOv*/
2710 XMR_OK_HI_OV = 1<<1, /* Bit 1: Octets Rx OK Hi Cnt Ov*/
2711 XMR_OK_OV = 1<<0, /* Bit 0: Frames Received Ok Ov */
2712};
2713
2714#define XMR_DEF_MSK (XMR_OK_LO_OV | XMR_OK_HI_OV)
2715
2716/* XM_TX_CNT_EV 32 bit r/o Tx Counter Event Register */
2717/* XM_TX_EV_MSK 32 bit r/w Tx Counter Event Mask */
2718enum {
2719 XMT_MAX_SZ_OV = 1<<25, /* Bit 25: 1024-MaxSize Tx Cnt Ov*/
2720 XMT_1023B_OV = 1<<24, /* Bit 24: 512-1023Byte Tx Cnt Ov*/
2721 XMT_511B_OV = 1<<23, /* Bit 23: 256-511 Byte Tx Cnt Ov*/
2722 XMT_255B_OV = 1<<22, /* Bit 22: 128-255 Byte Tx Cnt Ov*/
2723 XMT_127B_OV = 1<<21, /* Bit 21: 65-127 Byte Tx Cnt Ov */
2724 XMT_64B_OV = 1<<20, /* Bit 20: 64 Byte Tx Cnt Ov */
2725 XMT_UTIL_OV = 1<<19, /* Bit 19: Tx Util Cnt Overflow */
2726 XMT_UTIL_UR = 1<<18, /* Bit 18: Tx Util Cnt Underrun */
2727 XMT_CS_ERR_OV = 1<<17, /* Bit 17: Tx Carr Sen Err Cnt Ov*/
2728 XMT_FIFO_UR_OV = 1<<16, /* Bit 16: Tx FIFO Ur Ev Cnt Ov */
2729 XMT_EX_DEF_OV = 1<<15, /* Bit 15: Tx Ex Deferall Cnt Ov */
2730 XMT_DEF = 1<<14, /* Bit 14: Tx Deferred Cnt Ov */
2731 XMT_LAT_COL_OV = 1<<13, /* Bit 13: Tx Late Col Cnt Ov */
2732 XMT_ABO_COL_OV = 1<<12, /* Bit 12: Tx abo dueto Ex Col Ov*/
2733 XMT_MUL_COL_OV = 1<<11, /* Bit 11: Tx Mult Col Cnt Ov */
2734 XMT_SNG_COL = 1<<10, /* Bit 10: Tx Single Col Cnt Ov */
2735 XMT_MCTRL_OV = 1<<9, /* Bit 9: Tx MAC Ctrl Counter Ov*/
2736 XMT_MPAUSE = 1<<8, /* Bit 8: Tx Pause MAC Ctrl-F Ov*/
2737 XMT_BURST = 1<<7, /* Bit 7: Tx Burst Event Cnt Ov */
2738 XMT_LONG = 1<<6, /* Bit 6: Tx Long Frame Cnt Ov */
2739 XMT_UC_OK_OV = 1<<5, /* Bit 5: Tx Unicast Cnt Ov */
2740 XMT_MC_OK_OV = 1<<4, /* Bit 4: Tx Multicast Cnt Ov */
2741 XMT_BC_OK_OV = 1<<3, /* Bit 3: Tx Broadcast Cnt Ov */
2742 XMT_OK_LO_OV = 1<<2, /* Bit 2: Octets Tx OK Low CntOv*/
2743 XMT_OK_HI_OV = 1<<1, /* Bit 1: Octets Tx OK Hi Cnt Ov*/
2744 XMT_OK_OV = 1<<0, /* Bit 0: Frames Tx Ok Ov */
2745};
2746
2747#define XMT_DEF_MSK (XMT_OK_LO_OV | XMT_OK_HI_OV)
2748
2749struct skge_rx_desc {
2750 u32 control;
2751 u32 next_offset;
2752 u32 dma_lo;
2753 u32 dma_hi;
2754 u32 status;
2755 u32 timestamp;
2756 u16 csum2;
2757 u16 csum1;
2758 u16 csum2_start;
2759 u16 csum1_start;
2760};
2761
2762struct skge_tx_desc {
2763 u32 control;
2764 u32 next_offset;
2765 u32 dma_lo;
2766 u32 dma_hi;
2767 u32 status;
2768 u32 csum_offs;
2769 u16 csum_write;
2770 u16 csum_start;
2771 u32 rsvd;
2772};
2773
2774struct skge_element {
2775 struct skge_element *next;
2776 void *desc;
2777 struct sk_buff *skb;
2778 DECLARE_PCI_UNMAP_ADDR(mapaddr);
2779 DECLARE_PCI_UNMAP_LEN(maplen);
2780};
2781
2782struct skge_ring {
2783 struct skge_element *to_clean;
2784 struct skge_element *to_use;
2785 struct skge_element *start;
2786 unsigned long count;
2787};
2788
2789
2790struct skge_hw {
2791 void __iomem *regs;
2792 struct pci_dev *pdev;
2793 u32 intr_mask;
2794 struct net_device *dev[2];
2795
2796 u8 mac_cfg;
2797 u8 chip_id;
2798 u8 phy_type;
2799 u8 pmd_type;
2800 u16 phy_addr;
2801
2802 u32 ram_size;
2803 u32 ram_offset;
2804
2805 struct tasklet_struct ext_tasklet;
2806 spinlock_t phy_lock;
2807};
2808
2809static inline int isdualport(const struct skge_hw *hw)
2810{
2811 return !(hw->mac_cfg & CFG_SNG_MAC);
2812}
2813
2814static inline u8 chip_rev(const struct skge_hw *hw)
2815{
2816 return (hw->mac_cfg & CFG_CHIP_R_MSK) >> 4;
2817}
2818
2819static inline int iscopper(const struct skge_hw *hw)
2820{
2821 return (hw->pmd_type == 'T');
2822}
2823
2824enum {
2825 FLOW_MODE_NONE = 0, /* No Flow-Control */
2826 FLOW_MODE_LOC_SEND = 1, /* Local station sends PAUSE */
2827 FLOW_MODE_REM_SEND = 2, /* Symmetric or just remote */
2828 FLOW_MODE_SYMMETRIC = 3, /* Both stations may send PAUSE */
2829};
2830
2831struct skge_port {
2832 u32 msg_enable;
2833 struct skge_hw *hw;
2834 struct net_device *netdev;
2835 int port;
2836
2837 spinlock_t tx_lock;
2838 u32 tx_avail;
2839 struct skge_ring tx_ring;
2840 struct skge_ring rx_ring;
2841
2842 struct net_device_stats net_stats;
2843
2844 u8 rx_csum;
2845 u8 blink_on;
2846 u8 flow_control;
2847 u8 wol;
2848 u8 autoneg; /* AUTONEG_ENABLE, AUTONEG_DISABLE */
2849 u8 duplex; /* DUPLEX_HALF, DUPLEX_FULL */
2850 u16 speed; /* SPEED_1000, SPEED_100, ... */
2851 u32 advertising;
2852
2853 void *mem; /* PCI memory for rings */
2854 dma_addr_t dma;
2855 unsigned long mem_size;
2856
2857 struct timer_list link_check;
2858 struct timer_list led_blink;
2859};
2860
2861
2862/* Register accessor for memory mapped device */
2863static inline u32 skge_read32(const struct skge_hw *hw, int reg)
2864{
2865 return readl(hw->regs + reg);
2866
2867}
2868
2869static inline u16 skge_read16(const struct skge_hw *hw, int reg)
2870{
2871 return readw(hw->regs + reg);
2872}
2873
2874static inline u8 skge_read8(const struct skge_hw *hw, int reg)
2875{
2876 return readb(hw->regs + reg);
2877}
2878
2879static inline void skge_write32(const struct skge_hw *hw, int reg, u32 val)
2880{
2881 writel(val, hw->regs + reg);
2882}
2883
2884static inline void skge_write16(const struct skge_hw *hw, int reg, u16 val)
2885{
2886 writew(val, hw->regs + reg);
2887}
2888
2889static inline void skge_write8(const struct skge_hw *hw, int reg, u8 val)
2890{
2891 writeb(val, hw->regs + reg);
2892}
2893
2894/* MAC Related Registers inside the device. */
2895#define SKGEMAC_REG(port,reg) (((port)<<7)+(reg))
2896
2897/* PCI config space can be accessed via memory mapped space */
2898#define SKGEPCI_REG(reg) ((reg)+ 0x380)
2899
2900#define SKGEXM_REG(port, reg) \
2901 ((BASE_XMAC_1 + (port) * (BASE_XMAC_2 - BASE_XMAC_1)) | (reg) << 1)
2902
2903static inline u32 skge_xm_read32(const struct skge_hw *hw, int port, int reg)
2904{
2905 return skge_read32(hw, SKGEXM_REG(port,reg));
2906}
2907
2908static inline u16 skge_xm_read16(const struct skge_hw *hw, int port, int reg)
2909{
2910 return skge_read16(hw, SKGEXM_REG(port,reg));
2911}
2912
2913static inline u8 skge_xm_read8(const struct skge_hw *hw, int port, int reg)
2914{
2915 return skge_read8(hw, SKGEXM_REG(port,reg));
2916}
2917
2918static inline void skge_xm_write32(const struct skge_hw *hw, int port, int r, u32 v)
2919{
2920 skge_write32(hw, SKGEXM_REG(port,r), v);
2921}
2922
2923static inline void skge_xm_write16(const struct skge_hw *hw, int port, int r, u16 v)
2924{
2925 skge_write16(hw, SKGEXM_REG(port,r), v);
2926}
2927
2928static inline void skge_xm_write8(const struct skge_hw *hw, int port, int r, u8 v)
2929{
2930 skge_write8(hw, SKGEXM_REG(port,r), v);
2931}
2932
2933static inline void skge_xm_outhash(const struct skge_hw *hw, int port, int reg,
2934 const u8 *hash)
2935{
2936 skge_xm_write16(hw, port, reg,
2937 (u16)hash[0] | ((u16)hash[1] << 8));
2938 skge_xm_write16(hw, port, reg+2,
2939 (u16)hash[2] | ((u16)hash[3] << 8));
2940 skge_xm_write16(hw, port, reg+4,
2941 (u16)hash[4] | ((u16)hash[5] << 8));
2942 skge_xm_write16(hw, port, reg+6,
2943 (u16)hash[6] | ((u16)hash[7] << 8));
2944}
2945
2946static inline void skge_xm_outaddr(const struct skge_hw *hw, int port, int reg,
2947 const u8 *addr)
2948{
2949 skge_xm_write16(hw, port, reg,
2950 (u16)addr[0] | ((u16)addr[1] << 8));
2951 skge_xm_write16(hw, port, reg,
2952 (u16)addr[2] | ((u16)addr[3] << 8));
2953 skge_xm_write16(hw, port, reg,
2954 (u16)addr[4] | ((u16)addr[5] << 8));
2955}
2956
2957
2958#define SKGEGMA_REG(port,reg) \
2959 ((reg) + BASE_GMAC_1 + \
2960 (port) * (BASE_GMAC_2-BASE_GMAC_1))
2961
2962static inline u16 skge_gma_read16(const struct skge_hw *hw, int port, int reg)
2963{
2964 return skge_read16(hw, SKGEGMA_REG(port,reg));
2965}
2966
2967static inline u32 skge_gma_read32(const struct skge_hw *hw, int port, int reg)
2968{
2969 return (u32) skge_read16(hw, SKGEGMA_REG(port,reg))
2970 | ((u32)skge_read16(hw, SKGEGMA_REG(port,reg+4)) << 16);
2971}
2972
2973static inline u8 skge_gma_read8(const struct skge_hw *hw, int port, int reg)
2974{
2975 return skge_read8(hw, SKGEGMA_REG(port,reg));
2976}
2977
2978static inline void skge_gma_write16(const struct skge_hw *hw, int port, int r, u16 v)
2979{
2980 skge_write16(hw, SKGEGMA_REG(port,r), v);
2981}
2982
2983static inline void skge_gma_write32(const struct skge_hw *hw, int port, int r, u32 v)
2984{
2985 skge_write16(hw, SKGEGMA_REG(port, r), (u16) v);
2986 skge_write32(hw, SKGEGMA_REG(port, r+4), (u16)(v >> 16));
2987}
2988
2989static inline void skge_gma_write8(const struct skge_hw *hw, int port, int r, u8 v)
2990{
2991 skge_write8(hw, SKGEGMA_REG(port,r), v);
2992}
2993
2994static inline void skge_gm_set_addr(struct skge_hw *hw, int port, int reg,
2995 const u8 *addr)
2996{
2997 skge_gma_write16(hw, port, reg,
2998 (u16) addr[0] | ((u16) addr[1] << 8));
2999 skge_gma_write16(hw, port, reg+4,
3000 (u16) addr[2] | ((u16) addr[3] << 8));
3001 skge_gma_write16(hw, port, reg+8,
3002 (u16) addr[4] | ((u16) addr[5] << 8));
3003}
3004
3005#endif
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 5e561ba44333..fd80048f7f7a 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -129,7 +129,7 @@ MODULE_PARM_DESC(nowait, "set to 1 for no wait state");
129/* 129/*
130 * Transmit timeout, default 5 seconds. 130 * Transmit timeout, default 5 seconds.
131 */ 131 */
132static int watchdog = 5000; 132static int watchdog = 1000;
133module_param(watchdog, int, 0400); 133module_param(watchdog, int, 0400);
134MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds"); 134MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds");
135 135
@@ -660,15 +660,14 @@ static void smc_hardware_send_pkt(unsigned long data)
660 SMC_outw(((len & 1) ? (0x2000 | buf[len-1]) : 0), ioaddr, DATA_REG); 660 SMC_outw(((len & 1) ? (0x2000 | buf[len-1]) : 0), ioaddr, DATA_REG);
661 661
662 /* 662 /*
663 * If THROTTLE_TX_PKTS is set, we look at the TX_EMPTY flag 663 * If THROTTLE_TX_PKTS is set, we stop the queue here. This will
664 * before queueing this packet for TX, and if it's clear then 664 * have the effect of having at most one packet queued for TX
665 * we stop the queue here. This will have the effect of 665 * in the chip's memory at all time.
666 * having at most 2 packets queued for TX in the chip's memory 666 *
667 * at all time. If THROTTLE_TX_PKTS is not set then the queue 667 * If THROTTLE_TX_PKTS is not set then the queue is stopped only
668 * is stopped only when memory allocation (MC_ALLOC) does not 668 * when memory allocation (MC_ALLOC) does not succeed right away.
669 * succeed right away.
670 */ 669 */
671 if (THROTTLE_TX_PKTS && !(SMC_GET_INT() & IM_TX_EMPTY_INT)) 670 if (THROTTLE_TX_PKTS)
672 netif_stop_queue(dev); 671 netif_stop_queue(dev);
673 672
674 /* queue the packet for TX */ 673 /* queue the packet for TX */
@@ -792,17 +791,20 @@ static void smc_tx(struct net_device *dev)
792 DBG(2, "%s: TX STATUS 0x%04x PNR 0x%02x\n", 791 DBG(2, "%s: TX STATUS 0x%04x PNR 0x%02x\n",
793 dev->name, tx_status, packet_no); 792 dev->name, tx_status, packet_no);
794 793
795 if (!(tx_status & TS_SUCCESS)) 794 if (!(tx_status & ES_TX_SUC))
796 lp->stats.tx_errors++; 795 lp->stats.tx_errors++;
797 if (tx_status & TS_LOSTCAR) 796
797 if (tx_status & ES_LOSTCARR)
798 lp->stats.tx_carrier_errors++; 798 lp->stats.tx_carrier_errors++;
799 799
800 if (tx_status & TS_LATCOL) { 800 if (tx_status & (ES_LATCOL | ES_16COL)) {
801 PRINTK("%s: late collision occurred on last xmit\n", dev->name); 801 PRINTK("%s: %s occurred on last xmit\n", dev->name,
802 (tx_status & ES_LATCOL) ?
803 "late collision" : "too many collisions");
802 lp->stats.tx_window_errors++; 804 lp->stats.tx_window_errors++;
803 if (!(lp->stats.tx_window_errors & 63) && net_ratelimit()) { 805 if (!(lp->stats.tx_window_errors & 63) && net_ratelimit()) {
804 printk(KERN_INFO "%s: unexpectedly large numbers of " 806 printk(KERN_INFO "%s: unexpectedly large number of "
805 "late collisions. Please check duplex " 807 "bad collisions. Please check duplex "
806 "setting.\n", dev->name); 808 "setting.\n", dev->name);
807 } 809 }
808 } 810 }
@@ -1236,7 +1238,7 @@ static void smc_10bt_check_media(struct net_device *dev, int init)
1236 old_carrier = netif_carrier_ok(dev) ? 1 : 0; 1238 old_carrier = netif_carrier_ok(dev) ? 1 : 0;
1237 1239
1238 SMC_SELECT_BANK(0); 1240 SMC_SELECT_BANK(0);
1239 new_carrier = SMC_inw(ioaddr, EPH_STATUS_REG) & ES_LINK_OK ? 1 : 0; 1241 new_carrier = (SMC_GET_EPH_STATUS() & ES_LINK_OK) ? 1 : 0;
1240 SMC_SELECT_BANK(2); 1242 SMC_SELECT_BANK(2);
1241 1243
1242 if (init || (old_carrier != new_carrier)) { 1244 if (init || (old_carrier != new_carrier)) {
@@ -1308,15 +1310,16 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1308 if (!status) 1310 if (!status)
1309 break; 1311 break;
1310 1312
1311 if (status & IM_RCV_INT) { 1313 if (status & IM_TX_INT) {
1312 DBG(3, "%s: RX irq\n", dev->name); 1314 /* do this before RX as it will free memory quickly */
1313 smc_rcv(dev);
1314 } else if (status & IM_TX_INT) {
1315 DBG(3, "%s: TX int\n", dev->name); 1315 DBG(3, "%s: TX int\n", dev->name);
1316 smc_tx(dev); 1316 smc_tx(dev);
1317 SMC_ACK_INT(IM_TX_INT); 1317 SMC_ACK_INT(IM_TX_INT);
1318 if (THROTTLE_TX_PKTS) 1318 if (THROTTLE_TX_PKTS)
1319 netif_wake_queue(dev); 1319 netif_wake_queue(dev);
1320 } else if (status & IM_RCV_INT) {
1321 DBG(3, "%s: RX irq\n", dev->name);
1322 smc_rcv(dev);
1320 } else if (status & IM_ALLOC_INT) { 1323 } else if (status & IM_ALLOC_INT) {
1321 DBG(3, "%s: Allocation irq\n", dev->name); 1324 DBG(3, "%s: Allocation irq\n", dev->name);
1322 tasklet_hi_schedule(&lp->tx_task); 1325 tasklet_hi_schedule(&lp->tx_task);
@@ -1337,7 +1340,10 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1337 /* multiple collisions */ 1340 /* multiple collisions */
1338 lp->stats.collisions += card_stats & 0xF; 1341 lp->stats.collisions += card_stats & 0xF;
1339 } else if (status & IM_RX_OVRN_INT) { 1342 } else if (status & IM_RX_OVRN_INT) {
1340 DBG(1, "%s: RX overrun\n", dev->name); 1343 DBG(1, "%s: RX overrun (EPH_ST 0x%04x)\n", dev->name,
1344 ({ int eph_st; SMC_SELECT_BANK(0);
1345 eph_st = SMC_GET_EPH_STATUS();
1346 SMC_SELECT_BANK(2); eph_st; }) );
1341 SMC_ACK_INT(IM_RX_OVRN_INT); 1347 SMC_ACK_INT(IM_RX_OVRN_INT);
1342 lp->stats.rx_errors++; 1348 lp->stats.rx_errors++;
1343 lp->stats.rx_fifo_errors++; 1349 lp->stats.rx_fifo_errors++;
@@ -1389,7 +1395,7 @@ static void smc_timeout(struct net_device *dev)
1389{ 1395{
1390 struct smc_local *lp = netdev_priv(dev); 1396 struct smc_local *lp = netdev_priv(dev);
1391 void __iomem *ioaddr = lp->base; 1397 void __iomem *ioaddr = lp->base;
1392 int status, mask, meminfo, fifo; 1398 int status, mask, eph_st, meminfo, fifo;
1393 1399
1394 DBG(2, "%s: %s\n", dev->name, __FUNCTION__); 1400 DBG(2, "%s: %s\n", dev->name, __FUNCTION__);
1395 1401
@@ -1398,11 +1404,13 @@ static void smc_timeout(struct net_device *dev)
1398 mask = SMC_GET_INT_MASK(); 1404 mask = SMC_GET_INT_MASK();
1399 fifo = SMC_GET_FIFO(); 1405 fifo = SMC_GET_FIFO();
1400 SMC_SELECT_BANK(0); 1406 SMC_SELECT_BANK(0);
1407 eph_st = SMC_GET_EPH_STATUS();
1401 meminfo = SMC_GET_MIR(); 1408 meminfo = SMC_GET_MIR();
1402 SMC_SELECT_BANK(2); 1409 SMC_SELECT_BANK(2);
1403 spin_unlock_irq(&lp->lock); 1410 spin_unlock_irq(&lp->lock);
1404 PRINTK( "%s: INT 0x%02x MASK 0x%02x MEM 0x%04x FIFO 0x%04x\n", 1411 PRINTK( "%s: TX timeout (INT 0x%02x INTMASK 0x%02x "
1405 dev->name, status, mask, meminfo, fifo ); 1412 "MEM 0x%04x FIFO 0x%04x EPH_ST 0x%04x)\n",
1413 dev->name, status, mask, meminfo, fifo, eph_st );
1406 1414
1407 smc_reset(dev); 1415 smc_reset(dev);
1408 smc_enable(dev); 1416 smc_enable(dev);
@@ -1863,7 +1871,7 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr)
1863 SMC_SELECT_BANK(1); 1871 SMC_SELECT_BANK(1);
1864 val = SMC_GET_BASE(); 1872 val = SMC_GET_BASE();
1865 val = ((val & 0x1F00) >> 3) << SMC_IO_SHIFT; 1873 val = ((val & 0x1F00) >> 3) << SMC_IO_SHIFT;
1866 if (((unsigned long)ioaddr & ((PAGE_SIZE-1)<<SMC_IO_SHIFT)) != val) { /*XXX: WTF? */ 1874 if (((unsigned int)ioaddr & (0x3e0 << SMC_IO_SHIFT)) != val) {
1867 printk("%s: IOADDR %p doesn't match configuration (%x).\n", 1875 printk("%s: IOADDR %p doesn't match configuration (%x).\n",
1868 CARDNAME, ioaddr, val); 1876 CARDNAME, ioaddr, val);
1869 } 1877 }
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index ddd2688e7d33..946528e6b742 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -151,7 +151,7 @@
151 151
152/* We actually can't write halfwords properly if not word aligned */ 152/* We actually can't write halfwords properly if not word aligned */
153static inline void 153static inline void
154SMC_outw(u16 val, unsigned long ioaddr, int reg) 154SMC_outw(u16 val, void __iomem *ioaddr, int reg)
155{ 155{
156 if (reg & 2) { 156 if (reg & 2) {
157 unsigned int v = val << 16; 157 unsigned int v = val << 16;
@@ -317,7 +317,7 @@ static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l)
317#define SMC_insl(a, r, p, l) \ 317#define SMC_insl(a, r, p, l) \
318 smc_pxa_dma_insl(a, lp->physaddr, r, dev->dma, p, l) 318 smc_pxa_dma_insl(a, lp->physaddr, r, dev->dma, p, l)
319static inline void 319static inline void
320smc_pxa_dma_insl(u_long ioaddr, u_long physaddr, int reg, int dma, 320smc_pxa_dma_insl(void __iomem *ioaddr, u_long physaddr, int reg, int dma,
321 u_char *buf, int len) 321 u_char *buf, int len)
322{ 322{
323 dma_addr_t dmabuf; 323 dma_addr_t dmabuf;
@@ -355,7 +355,7 @@ smc_pxa_dma_insl(u_long ioaddr, u_long physaddr, int reg, int dma,
355#define SMC_insw(a, r, p, l) \ 355#define SMC_insw(a, r, p, l) \
356 smc_pxa_dma_insw(a, lp->physaddr, r, dev->dma, p, l) 356 smc_pxa_dma_insw(a, lp->physaddr, r, dev->dma, p, l)
357static inline void 357static inline void
358smc_pxa_dma_insw(u_long ioaddr, u_long physaddr, int reg, int dma, 358smc_pxa_dma_insw(void __iomem *ioaddr, u_long physaddr, int reg, int dma,
359 u_char *buf, int len) 359 u_char *buf, int len)
360{ 360{
361 dma_addr_t dmabuf; 361 dma_addr_t dmabuf;
@@ -681,14 +681,6 @@ static const char * chip_ids[ 16 ] = {
681 681
682 682
683/* 683/*
684 . Transmit status bits
685*/
686#define TS_SUCCESS 0x0001
687#define TS_LOSTCAR 0x0400
688#define TS_LATCOL 0x0200
689#define TS_16COL 0x0010
690
691/*
692 . Receive status bits 684 . Receive status bits
693*/ 685*/
694#define RS_ALGNERR 0x8000 686#define RS_ALGNERR 0x8000
@@ -845,6 +837,7 @@ static const char * chip_ids[ 16 ] = {
845#define SMC_GET_FIFO() SMC_inw( ioaddr, FIFO_REG ) 837#define SMC_GET_FIFO() SMC_inw( ioaddr, FIFO_REG )
846#define SMC_GET_PTR() SMC_inw( ioaddr, PTR_REG ) 838#define SMC_GET_PTR() SMC_inw( ioaddr, PTR_REG )
847#define SMC_SET_PTR(x) SMC_outw( x, ioaddr, PTR_REG ) 839#define SMC_SET_PTR(x) SMC_outw( x, ioaddr, PTR_REG )
840#define SMC_GET_EPH_STATUS() SMC_inw( ioaddr, EPH_STATUS_REG )
848#define SMC_GET_RCR() SMC_inw( ioaddr, RCR_REG ) 841#define SMC_GET_RCR() SMC_inw( ioaddr, RCR_REG )
849#define SMC_SET_RCR(x) SMC_outw( x, ioaddr, RCR_REG ) 842#define SMC_SET_RCR(x) SMC_outw( x, ioaddr, RCR_REG )
850#define SMC_GET_REV() SMC_inw( ioaddr, REV_REG ) 843#define SMC_GET_REV() SMC_inw( ioaddr, REV_REG )
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index 236bdd3f6ba0..12e2b6826fa3 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -2,7 +2,7 @@
2/* 2/*
3 Written 1998-2000 by Donald Becker. 3 Written 1998-2000 by Donald Becker.
4 4
5 Current maintainer is Ion Badulescu <ionut@cs.columbia.edu>. Please 5 Current maintainer is Ion Badulescu <ionut ta badula tod org>. Please
6 send all bug reports to me, and not to Donald Becker, as this code 6 send all bug reports to me, and not to Donald Becker, as this code
7 has been heavily modified from Donald's original version. 7 has been heavily modified from Donald's original version.
8 8
@@ -129,12 +129,18 @@
129 - put the chip to a D3 slumber on driver unload 129 - put the chip to a D3 slumber on driver unload
130 - added config option to enable/disable NAPI 130 - added config option to enable/disable NAPI
131 131
132TODO: bugfixes (no bugs known as of right now) 132 LK1.4.2 (Ion Badulescu)
133 - finally added firmware (GPL'ed by Adaptec)
134 - removed compatibility code for 2.2.x
135
136TODO: - fix forced speed/duplexing code (broken a long time ago, when
137 somebody converted the driver to use the generic MII code)
138 - fix VLAN support
133*/ 139*/
134 140
135#define DRV_NAME "starfire" 141#define DRV_NAME "starfire"
136#define DRV_VERSION "1.03+LK1.4.1" 142#define DRV_VERSION "1.03+LK1.4.2"
137#define DRV_RELDATE "February 10, 2002" 143#define DRV_RELDATE "January 19, 2005"
138 144
139#include <linux/config.h> 145#include <linux/config.h>
140#include <linux/version.h> 146#include <linux/version.h>
@@ -145,25 +151,15 @@ TODO: bugfixes (no bugs known as of right now)
145#include <linux/etherdevice.h> 151#include <linux/etherdevice.h>
146#include <linux/init.h> 152#include <linux/init.h>
147#include <linux/delay.h> 153#include <linux/delay.h>
154#include <linux/crc32.h>
155#include <linux/ethtool.h>
156#include <linux/mii.h>
157#include <linux/if_vlan.h>
148#include <asm/processor.h> /* Processor type for cache alignment. */ 158#include <asm/processor.h> /* Processor type for cache alignment. */
149#include <asm/uaccess.h> 159#include <asm/uaccess.h>
150#include <asm/io.h> 160#include <asm/io.h>
151 161
152/* 162#include "starfire_firmware.h"
153 * Adaptec's license for their drivers (which is where I got the
154 * firmware files) does not allow one to redistribute them. Thus, we can't
155 * include the firmware with this driver.
156 *
157 * However, should a legal-to-distribute firmware become available,
158 * the driver developer would need only to obtain the firmware in the
159 * form of a C header file.
160 * Once that's done, the #undef below must be changed into a #define
161 * for this driver to really use the firmware. Note that Rx/Tx
162 * hardware TCP checksumming is not possible without the firmware.
163 *
164 * WANTED: legal firmware to include with this GPL'd driver.
165 */
166#undef HAS_FIRMWARE
167/* 163/*
168 * The current frame processor firmware fails to checksum a fragment 164 * The current frame processor firmware fails to checksum a fragment
169 * of length 1. If and when this is fixed, the #define below can be removed. 165 * of length 1. If and when this is fixed, the #define below can be removed.
@@ -172,13 +168,7 @@ TODO: bugfixes (no bugs known as of right now)
172/* 168/*
173 * Define this if using the driver with the zero-copy patch 169 * Define this if using the driver with the zero-copy patch
174 */ 170 */
175#if defined(HAS_FIRMWARE) && defined(MAX_SKB_FRAGS)
176#define ZEROCOPY 171#define ZEROCOPY
177#endif
178
179#ifdef HAS_FIRMWARE
180#include "starfire_firmware.h"
181#endif /* HAS_FIRMWARE */
182 172
183#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 173#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
184#define VLAN_SUPPORT 174#define VLAN_SUPPORT
@@ -202,11 +192,7 @@ static int mtu;
202 The Starfire has a 512 element hash table based on the Ethernet CRC. */ 192 The Starfire has a 512 element hash table based on the Ethernet CRC. */
203static int multicast_filter_limit = 512; 193static int multicast_filter_limit = 512;
204/* Whether to do TCP/UDP checksums in hardware */ 194/* Whether to do TCP/UDP checksums in hardware */
205#ifdef HAS_FIRMWARE
206static int enable_hw_cksum = 1; 195static int enable_hw_cksum = 1;
207#else
208static int enable_hw_cksum = 0;
209#endif
210 196
211#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer.*/ 197#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer.*/
212/* 198/*
@@ -291,43 +277,15 @@ static int full_duplex[MAX_UNITS] = {0, };
291#define RX_DESC_ADDR_SIZE RxDescAddr32bit 277#define RX_DESC_ADDR_SIZE RxDescAddr32bit
292#endif 278#endif
293 279
294#ifdef MAX_SKB_FRAGS
295#define skb_first_frag_len(skb) skb_headlen(skb) 280#define skb_first_frag_len(skb) skb_headlen(skb)
296#define skb_num_frags(skb) (skb_shinfo(skb)->nr_frags + 1) 281#define skb_num_frags(skb) (skb_shinfo(skb)->nr_frags + 1)
297#else /* not MAX_SKB_FRAGS */
298#define skb_first_frag_len(skb) (skb->len)
299#define skb_num_frags(skb) 1
300#endif /* not MAX_SKB_FRAGS */
301
302/* 2.2.x compatibility code */
303#if LINUX_VERSION_CODE < 0x20300
304
305#include "starfire-kcomp22.h"
306
307#else /* LINUX_VERSION_CODE > 0x20300 */
308
309#include <linux/crc32.h>
310#include <linux/ethtool.h>
311#include <linux/mii.h>
312
313#include <linux/if_vlan.h>
314
315#define init_tx_timer(dev, func, timeout) \
316 dev->tx_timeout = func; \
317 dev->watchdog_timeo = timeout;
318#define kick_tx_timer(dev, func, timeout)
319
320#define netif_start_if(dev)
321#define netif_stop_if(dev)
322
323#define PCI_SLOT_NAME(pci_dev) pci_name(pci_dev)
324
325#endif /* LINUX_VERSION_CODE > 0x20300 */
326 282
327#ifdef HAVE_NETDEV_POLL 283#ifdef HAVE_NETDEV_POLL
328#define init_poll(dev) \ 284#define init_poll(dev) \
285do { \
329 dev->poll = &netdev_poll; \ 286 dev->poll = &netdev_poll; \
330 dev->weight = max_interrupt_work; 287 dev->weight = max_interrupt_work; \
288} while (0)
331#define netdev_rx(dev, ioaddr) \ 289#define netdev_rx(dev, ioaddr) \
332do { \ 290do { \
333 u32 intr_enable; \ 291 u32 intr_enable; \
@@ -341,7 +299,7 @@ do { \
341 /* Paranoia check */ \ 299 /* Paranoia check */ \
342 intr_enable = readl(ioaddr + IntrEnable); \ 300 intr_enable = readl(ioaddr + IntrEnable); \
343 if (intr_enable & (IntrRxDone | IntrRxEmpty)) { \ 301 if (intr_enable & (IntrRxDone | IntrRxEmpty)) { \
344 printk("%s: interrupt while in polling mode!\n", dev->name); \ 302 printk(KERN_INFO "%s: interrupt while in polling mode!\n", dev->name); \
345 intr_enable &= ~(IntrRxDone | IntrRxEmpty); \ 303 intr_enable &= ~(IntrRxDone | IntrRxEmpty); \
346 writel(intr_enable, ioaddr + IntrEnable); \ 304 writel(intr_enable, ioaddr + IntrEnable); \
347 } \ 305 } \
@@ -371,6 +329,7 @@ KERN_INFO " (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELD
371MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); 329MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
372MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver"); 330MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver");
373MODULE_LICENSE("GPL"); 331MODULE_LICENSE("GPL");
332MODULE_VERSION(DRV_VERSION);
374 333
375module_param(max_interrupt_work, int, 0); 334module_param(max_interrupt_work, int, 0);
376module_param(mtu, int, 0); 335module_param(mtu, int, 0);
@@ -425,7 +384,7 @@ on the 32/64 bitness of the architecture), and relies on automatic
425minimum-length padding. It does not use the completion queue 384minimum-length padding. It does not use the completion queue
426consumer index, but instead checks for non-zero status entries. 385consumer index, but instead checks for non-zero status entries.
427 386
428For receive this driver uses type 0/1/2/3 receive descriptors. The driver 387For receive this driver uses type 2/3 receive descriptors. The driver
429allocates full frame size skbuffs for the Rx ring buffers, so all frames 388allocates full frame size skbuffs for the Rx ring buffers, so all frames
430should fit in a single descriptor. The driver does not use the completion 389should fit in a single descriptor. The driver does not use the completion
431queue consumer index, but instead checks for non-zero status entries. 390queue consumer index, but instead checks for non-zero status entries.
@@ -476,7 +435,7 @@ IVc. Errata
476 435
477*/ 436*/
478 437
479 438
480 439
481enum chip_capability_flags {CanHaveMII=1, }; 440enum chip_capability_flags {CanHaveMII=1, };
482 441
@@ -670,7 +629,6 @@ struct full_rx_done_desc {
670 u32 timestamp; 629 u32 timestamp;
671}; 630};
672/* XXX: this is ugly and I'm not sure it's worth the trouble -Ion */ 631/* XXX: this is ugly and I'm not sure it's worth the trouble -Ion */
673#ifdef HAS_FIRMWARE
674#ifdef VLAN_SUPPORT 632#ifdef VLAN_SUPPORT
675typedef struct full_rx_done_desc rx_done_desc; 633typedef struct full_rx_done_desc rx_done_desc;
676#define RxComplType RxComplType3 634#define RxComplType RxComplType3
@@ -678,15 +636,6 @@ typedef struct full_rx_done_desc rx_done_desc;
678typedef struct csum_rx_done_desc rx_done_desc; 636typedef struct csum_rx_done_desc rx_done_desc;
679#define RxComplType RxComplType2 637#define RxComplType RxComplType2
680#endif /* not VLAN_SUPPORT */ 638#endif /* not VLAN_SUPPORT */
681#else /* not HAS_FIRMWARE */
682#ifdef VLAN_SUPPORT
683typedef struct basic_rx_done_desc rx_done_desc;
684#define RxComplType RxComplType1
685#else /* not VLAN_SUPPORT */
686typedef struct short_rx_done_desc rx_done_desc;
687#define RxComplType RxComplType0
688#endif /* not VLAN_SUPPORT */
689#endif /* not HAS_FIRMWARE */
690 639
691enum rx_done_bits { 640enum rx_done_bits {
692 RxOK=0x20000000, RxFIFOErr=0x10000000, RxBufQ2=0x08000000, 641 RxOK=0x20000000, RxFIFOErr=0x10000000, RxBufQ2=0x08000000,
@@ -898,13 +847,10 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
898 /* enable MWI -- it vastly improves Rx performance on sparc64 */ 847 /* enable MWI -- it vastly improves Rx performance on sparc64 */
899 pci_set_mwi(pdev); 848 pci_set_mwi(pdev);
900 849
901#ifdef MAX_SKB_FRAGS
902 dev->features |= NETIF_F_SG;
903#endif /* MAX_SKB_FRAGS */
904#ifdef ZEROCOPY 850#ifdef ZEROCOPY
905 /* Starfire can do TCP/UDP checksumming */ 851 /* Starfire can do TCP/UDP checksumming */
906 if (enable_hw_cksum) 852 if (enable_hw_cksum)
907 dev->features |= NETIF_F_IP_CSUM; 853 dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
908#endif /* ZEROCOPY */ 854#endif /* ZEROCOPY */
909#ifdef VLAN_SUPPORT 855#ifdef VLAN_SUPPORT
910 dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER; 856 dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER;
@@ -1008,7 +954,8 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
1008 /* The chip-specific entries in the device structure. */ 954 /* The chip-specific entries in the device structure. */
1009 dev->open = &netdev_open; 955 dev->open = &netdev_open;
1010 dev->hard_start_xmit = &start_tx; 956 dev->hard_start_xmit = &start_tx;
1011 init_tx_timer(dev, tx_timeout, TX_TIMEOUT); 957 dev->tx_timeout = tx_timeout;
958 dev->watchdog_timeo = TX_TIMEOUT;
1012 init_poll(dev); 959 init_poll(dev);
1013 dev->stop = &netdev_close; 960 dev->stop = &netdev_close;
1014 dev->get_stats = &get_stats; 961 dev->get_stats = &get_stats;
@@ -1039,7 +986,7 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
1039 if ((mdio_read(dev, phy, MII_BMCR) & BMCR_RESET) == 0) 986 if ((mdio_read(dev, phy, MII_BMCR) & BMCR_RESET) == 0)
1040 break; 987 break;
1041 if (boguscnt == 0) { 988 if (boguscnt == 0) {
1042 printk("%s: PHY reset never completed!\n", dev->name); 989 printk("%s: PHY#%d reset never completed!\n", dev->name, phy);
1043 continue; 990 continue;
1044 } 991 }
1045 mii_status = mdio_read(dev, phy, MII_BMSR); 992 mii_status = mdio_read(dev, phy, MII_BMSR);
@@ -1110,6 +1057,7 @@ static int netdev_open(struct net_device *dev)
1110 size_t tx_done_q_size, rx_done_q_size, tx_ring_size, rx_ring_size; 1057 size_t tx_done_q_size, rx_done_q_size, tx_ring_size, rx_ring_size;
1111 1058
1112 /* Do we ever need to reset the chip??? */ 1059 /* Do we ever need to reset the chip??? */
1060
1113 retval = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev); 1061 retval = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev);
1114 if (retval) 1062 if (retval)
1115 return retval; 1063 return retval;
@@ -1211,7 +1159,6 @@ static int netdev_open(struct net_device *dev)
1211 1159
1212 writel(np->intr_timer_ctrl, ioaddr + IntrTimerCtrl); 1160 writel(np->intr_timer_ctrl, ioaddr + IntrTimerCtrl);
1213 1161
1214 netif_start_if(dev);
1215 netif_start_queue(dev); 1162 netif_start_queue(dev);
1216 1163
1217 if (debug > 1) 1164 if (debug > 1)
@@ -1238,13 +1185,11 @@ static int netdev_open(struct net_device *dev)
1238 writel(ETH_P_8021Q, ioaddr + VlanType); 1185 writel(ETH_P_8021Q, ioaddr + VlanType);
1239#endif /* VLAN_SUPPORT */ 1186#endif /* VLAN_SUPPORT */
1240 1187
1241#ifdef HAS_FIRMWARE
1242 /* Load Rx/Tx firmware into the frame processors */ 1188 /* Load Rx/Tx firmware into the frame processors */
1243 for (i = 0; i < FIRMWARE_RX_SIZE * 2; i++) 1189 for (i = 0; i < FIRMWARE_RX_SIZE * 2; i++)
1244 writel(firmware_rx[i], ioaddr + RxGfpMem + i * 4); 1190 writel(firmware_rx[i], ioaddr + RxGfpMem + i * 4);
1245 for (i = 0; i < FIRMWARE_TX_SIZE * 2; i++) 1191 for (i = 0; i < FIRMWARE_TX_SIZE * 2; i++)
1246 writel(firmware_tx[i], ioaddr + TxGfpMem + i * 4); 1192 writel(firmware_tx[i], ioaddr + TxGfpMem + i * 4);
1247#endif /* HAS_FIRMWARE */
1248 if (enable_hw_cksum) 1193 if (enable_hw_cksum)
1249 /* Enable the Rx and Tx units, and the Rx/Tx frame processors. */ 1194 /* Enable the Rx and Tx units, and the Rx/Tx frame processors. */
1250 writel(TxEnable|TxGFPEnable|RxEnable|RxGFPEnable, ioaddr + GenCtrl); 1195 writel(TxEnable|TxGFPEnable|RxEnable|RxGFPEnable, ioaddr + GenCtrl);
@@ -1378,8 +1323,6 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
1378 u32 status; 1323 u32 status;
1379 int i; 1324 int i;
1380 1325
1381 kick_tx_timer(dev, tx_timeout, TX_TIMEOUT);
1382
1383 /* 1326 /*
1384 * be cautious here, wrapping the queue has weird semantics 1327 * be cautious here, wrapping the queue has weird semantics
1385 * and we may not have enough slots even when it seems we do. 1328 * and we may not have enough slots even when it seems we do.
@@ -1404,7 +1347,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
1404 } 1347 }
1405 1348
1406 if (has_bad_length) 1349 if (has_bad_length)
1407 skb_checksum_help(skb); 1350 skb_checksum_help(skb, 0);
1408 } 1351 }
1409#endif /* ZEROCOPY && HAS_BROKEN_FIRMWARE */ 1352#endif /* ZEROCOPY && HAS_BROKEN_FIRMWARE */
1410 1353
@@ -1433,12 +1376,10 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
1433 np->tx_info[entry].mapping = 1376 np->tx_info[entry].mapping =
1434 pci_map_single(np->pci_dev, skb->data, skb_first_frag_len(skb), PCI_DMA_TODEVICE); 1377 pci_map_single(np->pci_dev, skb->data, skb_first_frag_len(skb), PCI_DMA_TODEVICE);
1435 } else { 1378 } else {
1436#ifdef MAX_SKB_FRAGS
1437 skb_frag_t *this_frag = &skb_shinfo(skb)->frags[i - 1]; 1379 skb_frag_t *this_frag = &skb_shinfo(skb)->frags[i - 1];
1438 status |= this_frag->size; 1380 status |= this_frag->size;
1439 np->tx_info[entry].mapping = 1381 np->tx_info[entry].mapping =
1440 pci_map_single(np->pci_dev, page_address(this_frag->page) + this_frag->page_offset, this_frag->size, PCI_DMA_TODEVICE); 1382 pci_map_single(np->pci_dev, page_address(this_frag->page) + this_frag->page_offset, this_frag->size, PCI_DMA_TODEVICE);
1441#endif /* MAX_SKB_FRAGS */
1442 } 1383 }
1443 1384
1444 np->tx_ring[entry].addr = cpu_to_dma(np->tx_info[entry].mapping); 1385 np->tx_ring[entry].addr = cpu_to_dma(np->tx_info[entry].mapping);
@@ -1531,7 +1472,6 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
1531 np->tx_info[entry].mapping = 0; 1472 np->tx_info[entry].mapping = 0;
1532 np->dirty_tx += np->tx_info[entry].used_slots; 1473 np->dirty_tx += np->tx_info[entry].used_slots;
1533 entry = (entry + np->tx_info[entry].used_slots) % TX_RING_SIZE; 1474 entry = (entry + np->tx_info[entry].used_slots) % TX_RING_SIZE;
1534#ifdef MAX_SKB_FRAGS
1535 { 1475 {
1536 int i; 1476 int i;
1537 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 1477 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
@@ -1543,7 +1483,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
1543 entry++; 1483 entry++;
1544 } 1484 }
1545 } 1485 }
1546#endif /* MAX_SKB_FRAGS */ 1486
1547 dev_kfree_skb_irq(skb); 1487 dev_kfree_skb_irq(skb);
1548 } 1488 }
1549 np->tx_done_q[np->tx_done].status = 0; 1489 np->tx_done_q[np->tx_done].status = 0;
@@ -1603,7 +1543,7 @@ static int __netdev_rx(struct net_device *dev, int *quota)
1603 if (debug > 4) 1543 if (debug > 4)
1604 printk(KERN_DEBUG " netdev_rx() status of %d was %#8.8x.\n", np->rx_done, desc_status); 1544 printk(KERN_DEBUG " netdev_rx() status of %d was %#8.8x.\n", np->rx_done, desc_status);
1605 if (!(desc_status & RxOK)) { 1545 if (!(desc_status & RxOK)) {
1606 /* There was a error. */ 1546 /* There was an error. */
1607 if (debug > 2) 1547 if (debug > 2)
1608 printk(KERN_DEBUG " netdev_rx() Rx error was %#8.8x.\n", desc_status); 1548 printk(KERN_DEBUG " netdev_rx() Rx error was %#8.8x.\n", desc_status);
1609 np->stats.rx_errors++; 1549 np->stats.rx_errors++;
@@ -1656,11 +1596,10 @@ static int __netdev_rx(struct net_device *dev, int *quota)
1656#endif 1596#endif
1657 1597
1658 skb->protocol = eth_type_trans(skb, dev); 1598 skb->protocol = eth_type_trans(skb, dev);
1659#if defined(HAS_FIRMWARE) || defined(VLAN_SUPPORT) 1599#ifdef VLAN_SUPPORT
1660 if (debug > 4) 1600 if (debug > 4)
1661 printk(KERN_DEBUG " netdev_rx() status2 of %d was %#4.4x.\n", np->rx_done, le16_to_cpu(desc->status2)); 1601 printk(KERN_DEBUG " netdev_rx() status2 of %d was %#4.4x.\n", np->rx_done, le16_to_cpu(desc->status2));
1662#endif 1602#endif
1663#ifdef HAS_FIRMWARE
1664 if (le16_to_cpu(desc->status2) & 0x0100) { 1603 if (le16_to_cpu(desc->status2) & 0x0100) {
1665 skb->ip_summed = CHECKSUM_UNNECESSARY; 1604 skb->ip_summed = CHECKSUM_UNNECESSARY;
1666 np->stats.rx_compressed++; 1605 np->stats.rx_compressed++;
@@ -1679,7 +1618,6 @@ static int __netdev_rx(struct net_device *dev, int *quota)
1679 skb->csum = le16_to_cpu(desc->csum); 1618 skb->csum = le16_to_cpu(desc->csum);
1680 printk(KERN_DEBUG "%s: checksum_hw, status2 = %#x\n", dev->name, le16_to_cpu(desc->status2)); 1619 printk(KERN_DEBUG "%s: checksum_hw, status2 = %#x\n", dev->name, le16_to_cpu(desc->status2));
1681 } 1620 }
1682#endif /* HAS_FIRMWARE */
1683#ifdef VLAN_SUPPORT 1621#ifdef VLAN_SUPPORT
1684 if (np->vlgrp && le16_to_cpu(desc->status2) & 0x0200) { 1622 if (np->vlgrp && le16_to_cpu(desc->status2) & 0x0200) {
1685 if (debug > 4) 1623 if (debug > 4)
@@ -1900,9 +1838,6 @@ static struct net_device_stats *get_stats(struct net_device *dev)
1900} 1838}
1901 1839
1902 1840
1903/* Chips may use the upper or lower CRC bits, and may reverse and/or invert
1904 them. Select the endian-ness that results in minimal calculations.
1905*/
1906static void set_rx_mode(struct net_device *dev) 1841static void set_rx_mode(struct net_device *dev)
1907{ 1842{
1908 struct netdev_private *np = netdev_priv(dev); 1843 struct netdev_private *np = netdev_priv(dev);
@@ -1969,6 +1904,8 @@ static void set_rx_mode(struct net_device *dev)
1969 memset(mc_filter, 0, sizeof(mc_filter)); 1904 memset(mc_filter, 0, sizeof(mc_filter));
1970 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1905 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
1971 i++, mclist = mclist->next) { 1906 i++, mclist = mclist->next) {
1907 /* The chip uses the upper 9 CRC bits
1908 as index into the hash table */
1972 int bit_nr = ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 23; 1909 int bit_nr = ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 23;
1973 __u32 *fptr = (__u32 *) &mc_filter[(bit_nr >> 4) & ~1]; 1910 __u32 *fptr = (__u32 *) &mc_filter[(bit_nr >> 4) & ~1];
1974 1911
@@ -2001,7 +1938,7 @@ static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
2001 struct netdev_private *np = netdev_priv(dev); 1938 struct netdev_private *np = netdev_priv(dev);
2002 strcpy(info->driver, DRV_NAME); 1939 strcpy(info->driver, DRV_NAME);
2003 strcpy(info->version, DRV_VERSION); 1940 strcpy(info->version, DRV_VERSION);
2004 strcpy(info->bus_info, PCI_SLOT_NAME(np->pci_dev)); 1941 strcpy(info->bus_info, pci_name(np->pci_dev));
2005} 1942}
2006 1943
2007static int get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) 1944static int get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
@@ -2083,7 +2020,6 @@ static int netdev_close(struct net_device *dev)
2083 int i; 2020 int i;
2084 2021
2085 netif_stop_queue(dev); 2022 netif_stop_queue(dev);
2086 netif_stop_if(dev);
2087 2023
2088 if (debug > 1) { 2024 if (debug > 1) {
2089 printk(KERN_DEBUG "%s: Shutting down ethercard, Intr status %#8.8x.\n", 2025 printk(KERN_DEBUG "%s: Shutting down ethercard, Intr status %#8.8x.\n",
@@ -2184,7 +2120,13 @@ static int __init starfire_init (void)
2184/* when a module, this is printed whether or not devices are found in probe */ 2120/* when a module, this is printed whether or not devices are found in probe */
2185#ifdef MODULE 2121#ifdef MODULE
2186 printk(version); 2122 printk(version);
2123#ifdef HAVE_NETDEV_POLL
2124 printk(KERN_INFO DRV_NAME ": polling (NAPI) enabled\n");
2125#else
2126 printk(KERN_INFO DRV_NAME ": polling (NAPI) disabled\n");
2187#endif 2127#endif
2128#endif
2129
2188#ifndef ADDR_64BITS 2130#ifndef ADDR_64BITS
2189 /* we can do this test only at run-time... sigh */ 2131 /* we can do this test only at run-time... sigh */
2190 if (sizeof(dma_addr_t) == sizeof(u64)) { 2132 if (sizeof(dma_addr_t) == sizeof(u64)) {
@@ -2192,10 +2134,6 @@ static int __init starfire_init (void)
2192 return -ENODEV; 2134 return -ENODEV;
2193 } 2135 }
2194#endif /* not ADDR_64BITS */ 2136#endif /* not ADDR_64BITS */
2195#ifndef HAS_FIRMWARE
2196 /* unconditionally disable hw cksums if firmware is not present */
2197 enable_hw_cksum = 0;
2198#endif /* not HAS_FIRMWARE */
2199 return pci_module_init (&starfire_driver); 2137 return pci_module_init (&starfire_driver);
2200} 2138}
2201 2139
diff --git a/drivers/net/starfire_firmware.h b/drivers/net/starfire_firmware.h
new file mode 100644
index 000000000000..0a668528955d
--- /dev/null
+++ b/drivers/net/starfire_firmware.h
@@ -0,0 +1,346 @@
1/*
2 * Copyright 2003 Adaptec, Inc.
3 *
4 * Please read the following license before using the Adaptec Software
5 * ("Program"). If you do not agree to the license terms, do not use the
6 * Program:
7 *
8 * You agree to be bound by version 2 of the General Public License ("GPL")
9 * dated June 1991, which can be found at http://www.fsf.org/licenses/gpl.html.
10 * If the link is broken, write to Free Software Foundation, 59 Temple Place,
11 * Boston, Massachusetts 02111-1307.
12 *
13 * BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE IT IS LICENSED "AS IS" AND
14 * THERE IS NO WARRANTY FOR THE PROGRAM, INCLUDING BUT NOT LIMITED TO THE
15 * IMPLIED WARRANTIES OF MERCHANTIBILITY OR FITNESS FOR A PARTICULAR PURPOSE
16 * (TO THE EXTENT PERMITTED BY APPLICABLE LAW). USE OF THE PROGRAM IS AT YOUR
17 * OWN RISK. IN NO EVENT WILL ADAPTEC OR ITS LICENSORS BE LIABLE TO YOU FOR
18 * DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
19 * ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM.
20 *
21 */
22
23static const u32 firmware_rx[] = {
24 0x010003dc, 0x00000000,
25 0x04000421, 0x00000086,
26 0x80000015, 0x0000180e,
27 0x81000015, 0x00006664,
28 0x1a0040ab, 0x00000b06,
29 0x14200011, 0x00000000,
30 0x14204022, 0x0000aaaa,
31 0x14204022, 0x00000300,
32 0x14204022, 0x00000000,
33 0x1a0040ab, 0x00000b14,
34 0x14200011, 0x00000000,
35 0x83000015, 0x00000002,
36 0x04000021, 0x00000000,
37 0x00000010, 0x00000000,
38 0x04000421, 0x00000087,
39 0x00000010, 0x00000000,
40 0x00000010, 0x00000000,
41 0x00008015, 0x00000000,
42 0x0000003e, 0x00000000,
43 0x00000010, 0x00000000,
44 0x82000015, 0x00004000,
45 0x009e8050, 0x00000000,
46 0x03008015, 0x00000000,
47 0x86008015, 0x00000000,
48 0x82000015, 0x00008000,
49 0x0100001c, 0x00000000,
50 0x000050a0, 0x0000010c,
51 0x4e20d011, 0x00006008,
52 0x1420d012, 0x00004008,
53 0x0000f090, 0x00007000,
54 0x0000c8b0, 0x00003000,
55 0x00004040, 0x00000000,
56 0x00108015, 0x00000000,
57 0x00a2c150, 0x00004000,
58 0x00a400b0, 0x00000014,
59 0x00000020, 0x00000000,
60 0x2500400d, 0x00002525,
61 0x00047220, 0x00003100,
62 0x00934070, 0x00000000,
63 0x00000020, 0x00000000,
64 0x00924460, 0x00000184,
65 0x2b20c011, 0x00000000,
66 0x0000c420, 0x00000540,
67 0x36014018, 0x0000422d,
68 0x14200011, 0x00000000,
69 0x00924460, 0x00000183,
70 0x3200001f, 0x00000034,
71 0x02ac0015, 0x00000002,
72 0x00a60110, 0x00000008,
73 0x42200011, 0x00000000,
74 0x00924060, 0x00000103,
75 0x0000001e, 0x00000000,
76 0x00000020, 0x00000100,
77 0x0000001e, 0x00000000,
78 0x00924460, 0x00000086,
79 0x00004080, 0x00000000,
80 0x0092c070, 0x00000000,
81 0x00924060, 0x00000100,
82 0x0000c890, 0x00005000,
83 0x00a6c110, 0x00000000,
84 0x00b0c090, 0x00000012,
85 0x021c0015, 0x00000000,
86 0x3200001f, 0x00000034,
87 0x00924460, 0x00000510,
88 0x44210011, 0x00000000,
89 0x42000011, 0x00000000,
90 0x83000015, 0x00000040,
91 0x00924460, 0x00000508,
92 0x45014018, 0x00004545,
93 0x00808050, 0x00000000,
94 0x62208012, 0x00000000,
95 0x82000015, 0x00000800,
96 0x15200011, 0x00000000,
97 0x00000010, 0x00000000,
98 0x00000010, 0x00000000,
99 0x00000010, 0x00000000,
100 0x00000010, 0x00000000,
101 0x00000010, 0x00000000,
102 0x80000015, 0x0000eea4,
103 0x81000015, 0x0000005f,
104 0x00000060, 0x00000000,
105 0x00004120, 0x00000000,
106 0x00004a00, 0x00004000,
107 0x00924460, 0x00000190,
108 0x5601401a, 0x00005956,
109 0x14000011, 0x00000000,
110 0x00934050, 0x00000018,
111 0x00930050, 0x00000018,
112 0x3601403a, 0x0000002d,
113 0x000643a9, 0x00000000,
114 0x0000c420, 0x00000140,
115 0x5601401a, 0x00005956,
116 0x14000011, 0x00000000,
117 0x00000010, 0x00000000,
118 0x00000010, 0x00000000,
119 0x000642a9, 0x00000000,
120 0x00024420, 0x00000183,
121 0x5601401a, 0x00005956,
122 0x82000015, 0x00002000,
123 0x15200011, 0x00000000,
124 0x82000015, 0x00000010,
125 0x15200011, 0x00000000,
126 0x82000015, 0x00000010,
127 0x15200011, 0x00000000,
128}; /* 104 Rx instructions */
129#define FIRMWARE_RX_SIZE 104
130
131static const u32 firmware_tx[] = {
132 0x010003dc, 0x00000000,
133 0x04000421, 0x00000086,
134 0x80000015, 0x0000180e,
135 0x81000015, 0x00006664,
136 0x1a0040ab, 0x00000b06,
137 0x14200011, 0x00000000,
138 0x14204022, 0x0000aaaa,
139 0x14204022, 0x00000300,
140 0x14204022, 0x00000000,
141 0x1a0040ab, 0x00000b14,
142 0x14200011, 0x00000000,
143 0x83000015, 0x00000002,
144 0x04000021, 0x00000000,
145 0x00000010, 0x00000000,
146 0x04000421, 0x00000087,
147 0x00000010, 0x00000000,
148 0x00000010, 0x00000000,
149 0x00008015, 0x00000000,
150 0x0000003e, 0x00000000,
151 0x00000010, 0x00000000,
152 0x82000015, 0x00004000,
153 0x009e8050, 0x00000000,
154 0x03008015, 0x00000000,
155 0x86008015, 0x00000000,
156 0x82000015, 0x00008000,
157 0x0100001c, 0x00000000,
158 0x000050a0, 0x0000010c,
159 0x4e20d011, 0x00006008,
160 0x1420d012, 0x00004008,
161 0x0000f090, 0x00007000,
162 0x0000c8b0, 0x00003000,
163 0x00004040, 0x00000000,
164 0x00108015, 0x00000000,
165 0x00a2c150, 0x00004000,
166 0x00a400b0, 0x00000014,
167 0x00000020, 0x00000000,
168 0x2500400d, 0x00002525,
169 0x00047220, 0x00003100,
170 0x00934070, 0x00000000,
171 0x00000020, 0x00000000,
172 0x00924460, 0x00000184,
173 0x2b20c011, 0x00000000,
174 0x0000c420, 0x00000540,
175 0x36014018, 0x0000422d,
176 0x14200011, 0x00000000,
177 0x00924460, 0x00000183,
178 0x3200001f, 0x00000034,
179 0x02ac0015, 0x00000002,
180 0x00a60110, 0x00000008,
181 0x42200011, 0x00000000,
182 0x00924060, 0x00000103,
183 0x0000001e, 0x00000000,
184 0x00000020, 0x00000100,
185 0x0000001e, 0x00000000,
186 0x00924460, 0x00000086,
187 0x00004080, 0x00000000,
188 0x0092c070, 0x00000000,
189 0x00924060, 0x00000100,
190 0x0000c890, 0x00005000,
191 0x00a6c110, 0x00000000,
192 0x00b0c090, 0x00000012,
193 0x021c0015, 0x00000000,
194 0x3200001f, 0x00000034,
195 0x00924460, 0x00000510,
196 0x44210011, 0x00000000,
197 0x42000011, 0x00000000,
198 0x83000015, 0x00000040,
199 0x00924460, 0x00000508,
200 0x45014018, 0x00004545,
201 0x00808050, 0x00000000,
202 0x62208012, 0x00000000,
203 0x82000015, 0x00000800,
204 0x15200011, 0x00000000,
205 0x00000010, 0x00000000,
206 0x00000010, 0x00000000,
207 0x00000010, 0x00000000,
208 0x00000010, 0x00000000,
209 0x00000010, 0x00000000,
210 0x80000015, 0x0000eea4,
211 0x81000015, 0x0000005f,
212 0x00000060, 0x00000000,
213 0x00004120, 0x00000000,
214 0x00004a00, 0x00004000,
215 0x00924460, 0x00000190,
216 0x5601401a, 0x00005956,
217 0x14000011, 0x00000000,
218 0x00934050, 0x00000018,
219 0x00930050, 0x00000018,
220 0x3601403a, 0x0000002d,
221 0x000643a9, 0x00000000,
222 0x0000c420, 0x00000140,
223 0x5601401a, 0x00005956,
224 0x14000011, 0x00000000,
225 0x00000010, 0x00000000,
226 0x00000010, 0x00000000,
227 0x000642a9, 0x00000000,
228 0x00024420, 0x00000183,
229 0x5601401a, 0x00005956,
230 0x82000015, 0x00002000,
231 0x15200011, 0x00000000,
232 0x82000015, 0x00000010,
233 0x15200011, 0x00000000,
234 0x82000015, 0x00000010,
235 0x15200011, 0x00000000,
236}; /* 104 Tx instructions */
237#define FIRMWARE_TX_SIZE 104
238#if 0
239static const u32 firmware_wol[] = {
240 0x010003dc, 0x00000000,
241 0x19000421, 0x00000087,
242 0x80000015, 0x00001a1a,
243 0x81000015, 0x00001a1a,
244 0x1a0040ab, 0x00000b06,
245 0x15200011, 0x00000000,
246 0x15204022, 0x0000aaaa,
247 0x15204022, 0x00000300,
248 0x15204022, 0x00000000,
249 0x1a0040ab, 0x00000b15,
250 0x15200011, 0x00000000,
251 0x83000015, 0x00000002,
252 0x04000021, 0x00000000,
253 0x00000010, 0x00000000,
254 0x04000421, 0x00000087,
255 0x00000010, 0x00000000,
256 0x00000010, 0x00000000,
257 0x00008015, 0x00000000,
258 0x0000003e, 0x00000000,
259 0x00000010, 0x00000000,
260 0x00000010, 0x00000000,
261 0x82000015, 0x00004000,
262 0x82000015, 0x00008000,
263 0x0000000c, 0x00000000,
264 0x00000010, 0x00000000,
265 0x00004080, 0x00000100,
266 0x1f20c011, 0x00001122,
267 0x2720f011, 0x00003011,
268 0x19200071, 0x00000000,
269 0x1a200051, 0x00000000,
270 0x00000010, 0x00000000,
271 0x00000010, 0x00000000,
272 0x1d2040a4, 0x00003344,
273 0x1d2040a2, 0x00005566,
274 0x000040a0, 0x00000100,
275 0x00108050, 0x00000001,
276 0x1a208012, 0x00000006,
277 0x82000015, 0x00008080,
278 0x010003dc, 0x00000000,
279 0x1d2040a4, 0x00002233,
280 0x1d2040a4, 0x00004455,
281 0x2d208011, 0x00000005,
282 0x1d2040a4, 0x00006611,
283 0x00108050, 0x00000001,
284 0x27200011, 0x00000000,
285 0x1d2050a4, 0x00006600,
286 0x82000015, 0x00008080,
287 0x010003dc, 0x00000000,
288 0x00000050, 0x00000000,
289 0x1b200031, 0x00000000,
290 0x0000001e, 0x00000000,
291 0x0000001e, 0x00000000,
292 0x0000001e, 0x00000000,
293 0x0000001e, 0x00000000,
294 0x00924460, 0x00000086,
295 0x00004080, 0x00000000,
296 0x0092c070, 0x00000000,
297 0x00924060, 0x00000100,
298 0x0000c890, 0x00005000,
299 0x00a6c110, 0x00000000,
300 0x00b0c090, 0x00000012,
301 0x021c0015, 0x00000000,
302 0x3200001f, 0x00000034,
303 0x00924460, 0x00000510,
304 0x44210011, 0x00000000,
305 0x42000011, 0x00000000,
306 0x83000015, 0x00000040,
307 0x00924460, 0x00000508,
308 0x476a0012, 0x00000100,
309 0x83000015, 0x00000008,
310 0x16200011, 0x00000000,
311 0x001e8050, 0x00000000,
312 0x001e8050, 0x00000000,
313 0x00808050, 0x00000000,
314 0x03008015, 0x00000000,
315 0x62208012, 0x00000000,
316 0x82000015, 0x00000800,
317 0x16200011, 0x00000000,
318 0x80000015, 0x0000eea4,
319 0x81000015, 0x0000005f,
320 0x00000020, 0x00000000,
321 0x00004120, 0x00000000,
322 0x00004a00, 0x00004000,
323 0x00924460, 0x00000190,
324 0x5c01401a, 0x0000595c,
325 0x15000011, 0x00000000,
326 0x00934050, 0x00000018,
327 0x00930050, 0x00000018,
328 0x3601403a, 0x0000002d,
329 0x00064029, 0x00000000,
330 0x0000c420, 0x00000140,
331 0x5c01401a, 0x0000595c,
332 0x15000011, 0x00000000,
333 0x00000010, 0x00000000,
334 0x00000010, 0x00000000,
335 0x00064029, 0x00000000,
336 0x00024420, 0x00000183,
337 0x5c01401a, 0x0000595c,
338 0x82000015, 0x00002000,
339 0x16200011, 0x00000000,
340 0x82000015, 0x00000010,
341 0x16200011, 0x00000000,
342 0x82000015, 0x00000010,
343 0x16200011, 0x00000000,
344}; /* 104 WoL instructions */
345#define FIRMWARE_WOL_SIZE 104
346#endif
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index f10dd74988c4..a0b8848049c9 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -7,7 +7,12 @@
7 * Copyright (C) 2005 Broadcom Corporation. 7 * Copyright (C) 2005 Broadcom Corporation.
8 * 8 *
9 * Firmware is: 9 * Firmware is:
10 * Copyright (C) 2000-2003 Broadcom Corporation. 10 * Derived from proprietary unpublished source code,
11 * Copyright (C) 2000-2003 Broadcom Corporation.
12 *
13 * Permission is hereby granted for the distribution of this firmware
14 * data in hexadecimal or equivalent format, provided this copyright
15 * notice is accompanying it.
11 */ 16 */
12 17
13#include <linux/config.h> 18#include <linux/config.h>
@@ -61,8 +66,8 @@
61 66
62#define DRV_MODULE_NAME "tg3" 67#define DRV_MODULE_NAME "tg3"
63#define PFX DRV_MODULE_NAME ": " 68#define PFX DRV_MODULE_NAME ": "
64#define DRV_MODULE_VERSION "3.29" 69#define DRV_MODULE_VERSION "3.31"
65#define DRV_MODULE_RELDATE "May 23, 2005" 70#define DRV_MODULE_RELDATE "June 8, 2005"
66 71
67#define TG3_DEF_MAC_MODE 0 72#define TG3_DEF_MAC_MODE 0
68#define TG3_DEF_RX_MODE 0 73#define TG3_DEF_RX_MODE 0
@@ -133,6 +138,8 @@
133/* number of ETHTOOL_GSTATS u64's */ 138/* number of ETHTOOL_GSTATS u64's */
134#define TG3_NUM_STATS (sizeof(struct tg3_ethtool_stats)/sizeof(u64)) 139#define TG3_NUM_STATS (sizeof(struct tg3_ethtool_stats)/sizeof(u64))
135 140
141#define TG3_NUM_TEST 6
142
136static char version[] __devinitdata = 143static char version[] __devinitdata =
137 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; 144 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
138 145
@@ -316,6 +323,17 @@ static struct {
316 { "nic_tx_threshold_hit" } 323 { "nic_tx_threshold_hit" }
317}; 324};
318 325
326static struct {
327 const char string[ETH_GSTRING_LEN];
328} ethtool_test_keys[TG3_NUM_TEST] = {
329 { "nvram test (online) " },
330 { "link test (online) " },
331 { "register test (offline)" },
332 { "memory test (offline)" },
333 { "loopback test (offline)" },
334 { "interrupt test (offline)" },
335};
336
319static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val) 337static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val)
320{ 338{
321 if ((tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) != 0) { 339 if ((tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) != 0) {
@@ -3070,7 +3088,7 @@ static irqreturn_t tg3_test_isr(int irq, void *dev_id,
3070} 3088}
3071 3089
3072static int tg3_init_hw(struct tg3 *); 3090static int tg3_init_hw(struct tg3 *);
3073static int tg3_halt(struct tg3 *, int); 3091static int tg3_halt(struct tg3 *, int, int);
3074 3092
3075#ifdef CONFIG_NET_POLL_CONTROLLER 3093#ifdef CONFIG_NET_POLL_CONTROLLER
3076static void tg3_poll_controller(struct net_device *dev) 3094static void tg3_poll_controller(struct net_device *dev)
@@ -3094,7 +3112,7 @@ static void tg3_reset_task(void *_data)
3094 restart_timer = tp->tg3_flags2 & TG3_FLG2_RESTART_TIMER; 3112 restart_timer = tp->tg3_flags2 & TG3_FLG2_RESTART_TIMER;
3095 tp->tg3_flags2 &= ~TG3_FLG2_RESTART_TIMER; 3113 tp->tg3_flags2 &= ~TG3_FLG2_RESTART_TIMER;
3096 3114
3097 tg3_halt(tp, 0); 3115 tg3_halt(tp, RESET_KIND_SHUTDOWN, 0);
3098 tg3_init_hw(tp); 3116 tg3_init_hw(tp);
3099 3117
3100 tg3_netif_start(tp); 3118 tg3_netif_start(tp);
@@ -3440,7 +3458,7 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu)
3440 spin_lock_irq(&tp->lock); 3458 spin_lock_irq(&tp->lock);
3441 spin_lock(&tp->tx_lock); 3459 spin_lock(&tp->tx_lock);
3442 3460
3443 tg3_halt(tp, 1); 3461 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
3444 3462
3445 tg3_set_mtu(dev, tp, new_mtu); 3463 tg3_set_mtu(dev, tp, new_mtu);
3446 3464
@@ -4131,19 +4149,19 @@ static void tg3_stop_fw(struct tg3 *tp)
4131} 4149}
4132 4150
4133/* tp->lock is held. */ 4151/* tp->lock is held. */
4134static int tg3_halt(struct tg3 *tp, int silent) 4152static int tg3_halt(struct tg3 *tp, int kind, int silent)
4135{ 4153{
4136 int err; 4154 int err;
4137 4155
4138 tg3_stop_fw(tp); 4156 tg3_stop_fw(tp);
4139 4157
4140 tg3_write_sig_pre_reset(tp, RESET_KIND_SHUTDOWN); 4158 tg3_write_sig_pre_reset(tp, kind);
4141 4159
4142 tg3_abort_hw(tp, silent); 4160 tg3_abort_hw(tp, silent);
4143 err = tg3_chip_reset(tp); 4161 err = tg3_chip_reset(tp);
4144 4162
4145 tg3_write_sig_legacy(tp, RESET_KIND_SHUTDOWN); 4163 tg3_write_sig_legacy(tp, kind);
4146 tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN); 4164 tg3_write_sig_post_reset(tp, kind);
4147 4165
4148 if (err) 4166 if (err)
4149 return err; 4167 return err;
@@ -4357,7 +4375,12 @@ static int tg3_load_firmware_cpu(struct tg3 *tp, u32 cpu_base, u32 cpu_scratch_b
4357 */ 4375 */
4358 tp->tg3_flags |= TG3_FLAG_PCIX_TARGET_HWBUG; 4376 tp->tg3_flags |= TG3_FLAG_PCIX_TARGET_HWBUG;
4359 4377
4378 /* It is possible that bootcode is still loading at this point.
4379 * Get the nvram lock first before halting the cpu.
4380 */
4381 tg3_nvram_lock(tp);
4360 err = tg3_halt_cpu(tp, cpu_base); 4382 err = tg3_halt_cpu(tp, cpu_base);
4383 tg3_nvram_unlock(tp);
4361 if (err) 4384 if (err)
4362 goto out; 4385 goto out;
4363 4386
@@ -5881,6 +5904,9 @@ static int tg3_test_interrupt(struct tg3 *tp)
5881 int err, i; 5904 int err, i;
5882 u32 int_mbox = 0; 5905 u32 int_mbox = 0;
5883 5906
5907 if (!netif_running(dev))
5908 return -ENODEV;
5909
5884 tg3_disable_ints(tp); 5910 tg3_disable_ints(tp);
5885 5911
5886 free_irq(tp->pdev->irq, dev); 5912 free_irq(tp->pdev->irq, dev);
@@ -5984,7 +6010,7 @@ static int tg3_test_msi(struct tg3 *tp)
5984 spin_lock_irq(&tp->lock); 6010 spin_lock_irq(&tp->lock);
5985 spin_lock(&tp->tx_lock); 6011 spin_lock(&tp->tx_lock);
5986 6012
5987 tg3_halt(tp, 1); 6013 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
5988 err = tg3_init_hw(tp); 6014 err = tg3_init_hw(tp);
5989 6015
5990 spin_unlock(&tp->tx_lock); 6016 spin_unlock(&tp->tx_lock);
@@ -6060,7 +6086,7 @@ static int tg3_open(struct net_device *dev)
6060 6086
6061 err = tg3_init_hw(tp); 6087 err = tg3_init_hw(tp);
6062 if (err) { 6088 if (err) {
6063 tg3_halt(tp, 1); 6089 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
6064 tg3_free_rings(tp); 6090 tg3_free_rings(tp);
6065 } else { 6091 } else {
6066 if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS) 6092 if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)
@@ -6104,7 +6130,7 @@ static int tg3_open(struct net_device *dev)
6104 pci_disable_msi(tp->pdev); 6130 pci_disable_msi(tp->pdev);
6105 tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI; 6131 tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI;
6106 } 6132 }
6107 tg3_halt(tp, 1); 6133 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
6108 tg3_free_rings(tp); 6134 tg3_free_rings(tp);
6109 tg3_free_consistent(tp); 6135 tg3_free_consistent(tp);
6110 6136
@@ -6377,7 +6403,7 @@ static int tg3_close(struct net_device *dev)
6377 6403
6378 tg3_disable_ints(tp); 6404 tg3_disable_ints(tp);
6379 6405
6380 tg3_halt(tp, 1); 6406 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
6381 tg3_free_rings(tp); 6407 tg3_free_rings(tp);
6382 tp->tg3_flags &= 6408 tp->tg3_flags &=
6383 ~(TG3_FLAG_INIT_COMPLETE | 6409 ~(TG3_FLAG_INIT_COMPLETE |
@@ -7097,7 +7123,7 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e
7097 tp->tx_pending = ering->tx_pending; 7123 tp->tx_pending = ering->tx_pending;
7098 7124
7099 if (netif_running(dev)) { 7125 if (netif_running(dev)) {
7100 tg3_halt(tp, 1); 7126 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
7101 tg3_init_hw(tp); 7127 tg3_init_hw(tp);
7102 tg3_netif_start(tp); 7128 tg3_netif_start(tp);
7103 } 7129 }
@@ -7140,7 +7166,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
7140 tp->tg3_flags &= ~TG3_FLAG_TX_PAUSE; 7166 tp->tg3_flags &= ~TG3_FLAG_TX_PAUSE;
7141 7167
7142 if (netif_running(dev)) { 7168 if (netif_running(dev)) {
7143 tg3_halt(tp, 1); 7169 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
7144 tg3_init_hw(tp); 7170 tg3_init_hw(tp);
7145 tg3_netif_start(tp); 7171 tg3_netif_start(tp);
7146 } 7172 }
@@ -7199,12 +7225,20 @@ static int tg3_get_stats_count (struct net_device *dev)
7199 return TG3_NUM_STATS; 7225 return TG3_NUM_STATS;
7200} 7226}
7201 7227
7228static int tg3_get_test_count (struct net_device *dev)
7229{
7230 return TG3_NUM_TEST;
7231}
7232
7202static void tg3_get_strings (struct net_device *dev, u32 stringset, u8 *buf) 7233static void tg3_get_strings (struct net_device *dev, u32 stringset, u8 *buf)
7203{ 7234{
7204 switch (stringset) { 7235 switch (stringset) {
7205 case ETH_SS_STATS: 7236 case ETH_SS_STATS:
7206 memcpy(buf, &ethtool_stats_keys, sizeof(ethtool_stats_keys)); 7237 memcpy(buf, &ethtool_stats_keys, sizeof(ethtool_stats_keys));
7207 break; 7238 break;
7239 case ETH_SS_TEST:
7240 memcpy(buf, &ethtool_test_keys, sizeof(ethtool_test_keys));
7241 break;
7208 default: 7242 default:
7209 WARN_ON(1); /* we need a WARN() */ 7243 WARN_ON(1); /* we need a WARN() */
7210 break; 7244 break;
@@ -7218,6 +7252,516 @@ static void tg3_get_ethtool_stats (struct net_device *dev,
7218 memcpy(tmp_stats, tg3_get_estats(tp), sizeof(tp->estats)); 7252 memcpy(tmp_stats, tg3_get_estats(tp), sizeof(tp->estats));
7219} 7253}
7220 7254
7255#define NVRAM_TEST_SIZE 0x100
7256
7257static int tg3_test_nvram(struct tg3 *tp)
7258{
7259 u32 *buf, csum;
7260 int i, j, err = 0;
7261
7262 buf = kmalloc(NVRAM_TEST_SIZE, GFP_KERNEL);
7263 if (buf == NULL)
7264 return -ENOMEM;
7265
7266 for (i = 0, j = 0; i < NVRAM_TEST_SIZE; i += 4, j++) {
7267 u32 val;
7268
7269 if ((err = tg3_nvram_read(tp, i, &val)) != 0)
7270 break;
7271 buf[j] = cpu_to_le32(val);
7272 }
7273 if (i < NVRAM_TEST_SIZE)
7274 goto out;
7275
7276 err = -EIO;
7277 if (cpu_to_be32(buf[0]) != TG3_EEPROM_MAGIC)
7278 goto out;
7279
7280 /* Bootstrap checksum at offset 0x10 */
7281 csum = calc_crc((unsigned char *) buf, 0x10);
7282 if(csum != cpu_to_le32(buf[0x10/4]))
7283 goto out;
7284
7285 /* Manufacturing block starts at offset 0x74, checksum at 0xfc */
7286 csum = calc_crc((unsigned char *) &buf[0x74/4], 0x88);
7287 if (csum != cpu_to_le32(buf[0xfc/4]))
7288 goto out;
7289
7290 err = 0;
7291
7292out:
7293 kfree(buf);
7294 return err;
7295}
7296
7297#define TG3_SERDES_TIMEOUT_SEC 2
7298#define TG3_COPPER_TIMEOUT_SEC 6
7299
7300static int tg3_test_link(struct tg3 *tp)
7301{
7302 int i, max;
7303
7304 if (!netif_running(tp->dev))
7305 return -ENODEV;
7306
7307 if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)
7308 max = TG3_SERDES_TIMEOUT_SEC;
7309 else
7310 max = TG3_COPPER_TIMEOUT_SEC;
7311
7312 for (i = 0; i < max; i++) {
7313 if (netif_carrier_ok(tp->dev))
7314 return 0;
7315
7316 if (msleep_interruptible(1000))
7317 break;
7318 }
7319
7320 return -EIO;
7321}
7322
7323/* Only test the commonly used registers */
7324static int tg3_test_registers(struct tg3 *tp)
7325{
7326 int i, is_5705;
7327 u32 offset, read_mask, write_mask, val, save_val, read_val;
7328 static struct {
7329 u16 offset;
7330 u16 flags;
7331#define TG3_FL_5705 0x1
7332#define TG3_FL_NOT_5705 0x2
7333#define TG3_FL_NOT_5788 0x4
7334 u32 read_mask;
7335 u32 write_mask;
7336 } reg_tbl[] = {
7337 /* MAC Control Registers */
7338 { MAC_MODE, TG3_FL_NOT_5705,
7339 0x00000000, 0x00ef6f8c },
7340 { MAC_MODE, TG3_FL_5705,
7341 0x00000000, 0x01ef6b8c },
7342 { MAC_STATUS, TG3_FL_NOT_5705,
7343 0x03800107, 0x00000000 },
7344 { MAC_STATUS, TG3_FL_5705,
7345 0x03800100, 0x00000000 },
7346 { MAC_ADDR_0_HIGH, 0x0000,
7347 0x00000000, 0x0000ffff },
7348 { MAC_ADDR_0_LOW, 0x0000,
7349 0x00000000, 0xffffffff },
7350 { MAC_RX_MTU_SIZE, 0x0000,
7351 0x00000000, 0x0000ffff },
7352 { MAC_TX_MODE, 0x0000,
7353 0x00000000, 0x00000070 },
7354 { MAC_TX_LENGTHS, 0x0000,
7355 0x00000000, 0x00003fff },
7356 { MAC_RX_MODE, TG3_FL_NOT_5705,
7357 0x00000000, 0x000007fc },
7358 { MAC_RX_MODE, TG3_FL_5705,
7359 0x00000000, 0x000007dc },
7360 { MAC_HASH_REG_0, 0x0000,
7361 0x00000000, 0xffffffff },
7362 { MAC_HASH_REG_1, 0x0000,
7363 0x00000000, 0xffffffff },
7364 { MAC_HASH_REG_2, 0x0000,
7365 0x00000000, 0xffffffff },
7366 { MAC_HASH_REG_3, 0x0000,
7367 0x00000000, 0xffffffff },
7368
7369 /* Receive Data and Receive BD Initiator Control Registers. */
7370 { RCVDBDI_JUMBO_BD+0, TG3_FL_NOT_5705,
7371 0x00000000, 0xffffffff },
7372 { RCVDBDI_JUMBO_BD+4, TG3_FL_NOT_5705,
7373 0x00000000, 0xffffffff },
7374 { RCVDBDI_JUMBO_BD+8, TG3_FL_NOT_5705,
7375 0x00000000, 0x00000003 },
7376 { RCVDBDI_JUMBO_BD+0xc, TG3_FL_NOT_5705,
7377 0x00000000, 0xffffffff },
7378 { RCVDBDI_STD_BD+0, 0x0000,
7379 0x00000000, 0xffffffff },
7380 { RCVDBDI_STD_BD+4, 0x0000,
7381 0x00000000, 0xffffffff },
7382 { RCVDBDI_STD_BD+8, 0x0000,
7383 0x00000000, 0xffff0002 },
7384 { RCVDBDI_STD_BD+0xc, 0x0000,
7385 0x00000000, 0xffffffff },
7386
7387 /* Receive BD Initiator Control Registers. */
7388 { RCVBDI_STD_THRESH, TG3_FL_NOT_5705,
7389 0x00000000, 0xffffffff },
7390 { RCVBDI_STD_THRESH, TG3_FL_5705,
7391 0x00000000, 0x000003ff },
7392 { RCVBDI_JUMBO_THRESH, TG3_FL_NOT_5705,
7393 0x00000000, 0xffffffff },
7394
7395 /* Host Coalescing Control Registers. */
7396 { HOSTCC_MODE, TG3_FL_NOT_5705,
7397 0x00000000, 0x00000004 },
7398 { HOSTCC_MODE, TG3_FL_5705,
7399 0x00000000, 0x000000f6 },
7400 { HOSTCC_RXCOL_TICKS, TG3_FL_NOT_5705,
7401 0x00000000, 0xffffffff },
7402 { HOSTCC_RXCOL_TICKS, TG3_FL_5705,
7403 0x00000000, 0x000003ff },
7404 { HOSTCC_TXCOL_TICKS, TG3_FL_NOT_5705,
7405 0x00000000, 0xffffffff },
7406 { HOSTCC_TXCOL_TICKS, TG3_FL_5705,
7407 0x00000000, 0x000003ff },
7408 { HOSTCC_RXMAX_FRAMES, TG3_FL_NOT_5705,
7409 0x00000000, 0xffffffff },
7410 { HOSTCC_RXMAX_FRAMES, TG3_FL_5705 | TG3_FL_NOT_5788,
7411 0x00000000, 0x000000ff },
7412 { HOSTCC_TXMAX_FRAMES, TG3_FL_NOT_5705,
7413 0x00000000, 0xffffffff },
7414 { HOSTCC_TXMAX_FRAMES, TG3_FL_5705 | TG3_FL_NOT_5788,
7415 0x00000000, 0x000000ff },
7416 { HOSTCC_RXCOAL_TICK_INT, TG3_FL_NOT_5705,
7417 0x00000000, 0xffffffff },
7418 { HOSTCC_TXCOAL_TICK_INT, TG3_FL_NOT_5705,
7419 0x00000000, 0xffffffff },
7420 { HOSTCC_RXCOAL_MAXF_INT, TG3_FL_NOT_5705,
7421 0x00000000, 0xffffffff },
7422 { HOSTCC_RXCOAL_MAXF_INT, TG3_FL_5705 | TG3_FL_NOT_5788,
7423 0x00000000, 0x000000ff },
7424 { HOSTCC_TXCOAL_MAXF_INT, TG3_FL_NOT_5705,
7425 0x00000000, 0xffffffff },
7426 { HOSTCC_TXCOAL_MAXF_INT, TG3_FL_5705 | TG3_FL_NOT_5788,
7427 0x00000000, 0x000000ff },
7428 { HOSTCC_STAT_COAL_TICKS, TG3_FL_NOT_5705,
7429 0x00000000, 0xffffffff },
7430 { HOSTCC_STATS_BLK_HOST_ADDR, TG3_FL_NOT_5705,
7431 0x00000000, 0xffffffff },
7432 { HOSTCC_STATS_BLK_HOST_ADDR+4, TG3_FL_NOT_5705,
7433 0x00000000, 0xffffffff },
7434 { HOSTCC_STATUS_BLK_HOST_ADDR, 0x0000,
7435 0x00000000, 0xffffffff },
7436 { HOSTCC_STATUS_BLK_HOST_ADDR+4, 0x0000,
7437 0x00000000, 0xffffffff },
7438 { HOSTCC_STATS_BLK_NIC_ADDR, 0x0000,
7439 0xffffffff, 0x00000000 },
7440 { HOSTCC_STATUS_BLK_NIC_ADDR, 0x0000,
7441 0xffffffff, 0x00000000 },
7442
7443 /* Buffer Manager Control Registers. */
7444 { BUFMGR_MB_POOL_ADDR, 0x0000,
7445 0x00000000, 0x007fff80 },
7446 { BUFMGR_MB_POOL_SIZE, 0x0000,
7447 0x00000000, 0x007fffff },
7448 { BUFMGR_MB_RDMA_LOW_WATER, 0x0000,
7449 0x00000000, 0x0000003f },
7450 { BUFMGR_MB_MACRX_LOW_WATER, 0x0000,
7451 0x00000000, 0x000001ff },
7452 { BUFMGR_MB_HIGH_WATER, 0x0000,
7453 0x00000000, 0x000001ff },
7454 { BUFMGR_DMA_DESC_POOL_ADDR, TG3_FL_NOT_5705,
7455 0xffffffff, 0x00000000 },
7456 { BUFMGR_DMA_DESC_POOL_SIZE, TG3_FL_NOT_5705,
7457 0xffffffff, 0x00000000 },
7458
7459 /* Mailbox Registers */
7460 { GRCMBOX_RCVSTD_PROD_IDX+4, 0x0000,
7461 0x00000000, 0x000001ff },
7462 { GRCMBOX_RCVJUMBO_PROD_IDX+4, TG3_FL_NOT_5705,
7463 0x00000000, 0x000001ff },
7464 { GRCMBOX_RCVRET_CON_IDX_0+4, 0x0000,
7465 0x00000000, 0x000007ff },
7466 { GRCMBOX_SNDHOST_PROD_IDX_0+4, 0x0000,
7467 0x00000000, 0x000001ff },
7468
7469 { 0xffff, 0x0000, 0x00000000, 0x00000000 },
7470 };
7471
7472 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)
7473 is_5705 = 1;
7474 else
7475 is_5705 = 0;
7476
7477 for (i = 0; reg_tbl[i].offset != 0xffff; i++) {
7478 if (is_5705 && (reg_tbl[i].flags & TG3_FL_NOT_5705))
7479 continue;
7480
7481 if (!is_5705 && (reg_tbl[i].flags & TG3_FL_5705))
7482 continue;
7483
7484 if ((tp->tg3_flags2 & TG3_FLG2_IS_5788) &&
7485 (reg_tbl[i].flags & TG3_FL_NOT_5788))
7486 continue;
7487
7488 offset = (u32) reg_tbl[i].offset;
7489 read_mask = reg_tbl[i].read_mask;
7490 write_mask = reg_tbl[i].write_mask;
7491
7492 /* Save the original register content */
7493 save_val = tr32(offset);
7494
7495 /* Determine the read-only value. */
7496 read_val = save_val & read_mask;
7497
7498 /* Write zero to the register, then make sure the read-only bits
7499 * are not changed and the read/write bits are all zeros.
7500 */
7501 tw32(offset, 0);
7502
7503 val = tr32(offset);
7504
7505 /* Test the read-only and read/write bits. */
7506 if (((val & read_mask) != read_val) || (val & write_mask))
7507 goto out;
7508
7509 /* Write ones to all the bits defined by RdMask and WrMask, then
7510 * make sure the read-only bits are not changed and the
7511 * read/write bits are all ones.
7512 */
7513 tw32(offset, read_mask | write_mask);
7514
7515 val = tr32(offset);
7516
7517 /* Test the read-only bits. */
7518 if ((val & read_mask) != read_val)
7519 goto out;
7520
7521 /* Test the read/write bits. */
7522 if ((val & write_mask) != write_mask)
7523 goto out;
7524
7525 tw32(offset, save_val);
7526 }
7527
7528 return 0;
7529
7530out:
7531 printk(KERN_ERR PFX "Register test failed at offset %x\n", offset);
7532 tw32(offset, save_val);
7533 return -EIO;
7534}
7535
7536static int tg3_do_mem_test(struct tg3 *tp, u32 offset, u32 len)
7537{
7538 static u32 test_pattern[] = { 0x00000000, 0xffffffff, 0xaa55a55a };
7539 int i;
7540 u32 j;
7541
7542 for (i = 0; i < sizeof(test_pattern)/sizeof(u32); i++) {
7543 for (j = 0; j < len; j += 4) {
7544 u32 val;
7545
7546 tg3_write_mem(tp, offset + j, test_pattern[i]);
7547 tg3_read_mem(tp, offset + j, &val);
7548 if (val != test_pattern[i])
7549 return -EIO;
7550 }
7551 }
7552 return 0;
7553}
7554
7555static int tg3_test_memory(struct tg3 *tp)
7556{
7557 static struct mem_entry {
7558 u32 offset;
7559 u32 len;
7560 } mem_tbl_570x[] = {
7561 { 0x00000000, 0x01000},
7562 { 0x00002000, 0x1c000},
7563 { 0xffffffff, 0x00000}
7564 }, mem_tbl_5705[] = {
7565 { 0x00000100, 0x0000c},
7566 { 0x00000200, 0x00008},
7567 { 0x00000b50, 0x00400},
7568 { 0x00004000, 0x00800},
7569 { 0x00006000, 0x01000},
7570 { 0x00008000, 0x02000},
7571 { 0x00010000, 0x0e000},
7572 { 0xffffffff, 0x00000}
7573 };
7574 struct mem_entry *mem_tbl;
7575 int err = 0;
7576 int i;
7577
7578 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)
7579 mem_tbl = mem_tbl_5705;
7580 else
7581 mem_tbl = mem_tbl_570x;
7582
7583 for (i = 0; mem_tbl[i].offset != 0xffffffff; i++) {
7584 if ((err = tg3_do_mem_test(tp, mem_tbl[i].offset,
7585 mem_tbl[i].len)) != 0)
7586 break;
7587 }
7588
7589 return err;
7590}
7591
7592static int tg3_test_loopback(struct tg3 *tp)
7593{
7594 u32 mac_mode, send_idx, rx_start_idx, rx_idx, tx_idx, opaque_key;
7595 u32 desc_idx;
7596 struct sk_buff *skb, *rx_skb;
7597 u8 *tx_data;
7598 dma_addr_t map;
7599 int num_pkts, tx_len, rx_len, i, err;
7600 struct tg3_rx_buffer_desc *desc;
7601
7602 if (!netif_running(tp->dev))
7603 return -ENODEV;
7604
7605 err = -EIO;
7606
7607 tg3_abort_hw(tp, 1);
7608
7609 /* Clearing this flag to keep interrupts disabled */
7610 tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;
7611 tg3_reset_hw(tp);
7612
7613 mac_mode = (tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK) |
7614 MAC_MODE_PORT_INT_LPBACK | MAC_MODE_LINK_POLARITY |
7615 MAC_MODE_PORT_MODE_GMII;
7616 tw32(MAC_MODE, mac_mode);
7617
7618 tx_len = 1514;
7619 skb = dev_alloc_skb(tx_len);
7620 tx_data = skb_put(skb, tx_len);
7621 memcpy(tx_data, tp->dev->dev_addr, 6);
7622 memset(tx_data + 6, 0x0, 8);
7623
7624 tw32(MAC_RX_MTU_SIZE, tx_len + 4);
7625
7626 for (i = 14; i < tx_len; i++)
7627 tx_data[i] = (u8) (i & 0xff);
7628
7629 map = pci_map_single(tp->pdev, skb->data, tx_len, PCI_DMA_TODEVICE);
7630
7631 tw32_f(HOSTCC_MODE, tp->coalesce_mode | HOSTCC_MODE_ENABLE |
7632 HOSTCC_MODE_NOW);
7633
7634 udelay(10);
7635
7636 rx_start_idx = tp->hw_status->idx[0].rx_producer;
7637
7638 send_idx = 0;
7639 num_pkts = 0;
7640
7641 tg3_set_txd(tp, send_idx, map, tx_len, 0, 1);
7642
7643 send_idx++;
7644 num_pkts++;
7645
7646 tw32_tx_mbox(MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW, send_idx);
7647 tr32(MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW);
7648
7649 udelay(10);
7650
7651 for (i = 0; i < 10; i++) {
7652 tw32_f(HOSTCC_MODE, tp->coalesce_mode | HOSTCC_MODE_ENABLE |
7653 HOSTCC_MODE_NOW);
7654
7655 udelay(10);
7656
7657 tx_idx = tp->hw_status->idx[0].tx_consumer;
7658 rx_idx = tp->hw_status->idx[0].rx_producer;
7659 if ((tx_idx == send_idx) &&
7660 (rx_idx == (rx_start_idx + num_pkts)))
7661 break;
7662 }
7663
7664 pci_unmap_single(tp->pdev, map, tx_len, PCI_DMA_TODEVICE);
7665 dev_kfree_skb(skb);
7666
7667 if (tx_idx != send_idx)
7668 goto out;
7669
7670 if (rx_idx != rx_start_idx + num_pkts)
7671 goto out;
7672
7673 desc = &tp->rx_rcb[rx_start_idx];
7674 desc_idx = desc->opaque & RXD_OPAQUE_INDEX_MASK;
7675 opaque_key = desc->opaque & RXD_OPAQUE_RING_MASK;
7676 if (opaque_key != RXD_OPAQUE_RING_STD)
7677 goto out;
7678
7679 if ((desc->err_vlan & RXD_ERR_MASK) != 0 &&
7680 (desc->err_vlan != RXD_ERR_ODD_NIBBLE_RCVD_MII))
7681 goto out;
7682
7683 rx_len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4;
7684 if (rx_len != tx_len)
7685 goto out;
7686
7687 rx_skb = tp->rx_std_buffers[desc_idx].skb;
7688
7689 map = pci_unmap_addr(&tp->rx_std_buffers[desc_idx], mapping);
7690 pci_dma_sync_single_for_cpu(tp->pdev, map, rx_len, PCI_DMA_FROMDEVICE);
7691
7692 for (i = 14; i < tx_len; i++) {
7693 if (*(rx_skb->data + i) != (u8) (i & 0xff))
7694 goto out;
7695 }
7696 err = 0;
7697
7698 /* tg3_free_rings will unmap and free the rx_skb */
7699out:
7700 return err;
7701}
7702
7703static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
7704 u64 *data)
7705{
7706 struct tg3 *tp = netdev_priv(dev);
7707
7708 memset(data, 0, sizeof(u64) * TG3_NUM_TEST);
7709
7710 if (tg3_test_nvram(tp) != 0) {
7711 etest->flags |= ETH_TEST_FL_FAILED;
7712 data[0] = 1;
7713 }
7714 if (tg3_test_link(tp) != 0) {
7715 etest->flags |= ETH_TEST_FL_FAILED;
7716 data[1] = 1;
7717 }
7718 if (etest->flags & ETH_TEST_FL_OFFLINE) {
7719 if (netif_running(dev))
7720 tg3_netif_stop(tp);
7721
7722 spin_lock_irq(&tp->lock);
7723 spin_lock(&tp->tx_lock);
7724
7725 tg3_halt(tp, RESET_KIND_SUSPEND, 1);
7726 tg3_nvram_lock(tp);
7727 tg3_halt_cpu(tp, RX_CPU_BASE);
7728 if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
7729 tg3_halt_cpu(tp, TX_CPU_BASE);
7730 tg3_nvram_unlock(tp);
7731
7732 if (tg3_test_registers(tp) != 0) {
7733 etest->flags |= ETH_TEST_FL_FAILED;
7734 data[2] = 1;
7735 }
7736 if (tg3_test_memory(tp) != 0) {
7737 etest->flags |= ETH_TEST_FL_FAILED;
7738 data[3] = 1;
7739 }
7740 if (tg3_test_loopback(tp) != 0) {
7741 etest->flags |= ETH_TEST_FL_FAILED;
7742 data[4] = 1;
7743 }
7744
7745 spin_unlock(&tp->tx_lock);
7746 spin_unlock_irq(&tp->lock);
7747 if (tg3_test_interrupt(tp) != 0) {
7748 etest->flags |= ETH_TEST_FL_FAILED;
7749 data[5] = 1;
7750 }
7751 spin_lock_irq(&tp->lock);
7752 spin_lock(&tp->tx_lock);
7753
7754 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
7755 if (netif_running(dev)) {
7756 tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;
7757 tg3_init_hw(tp);
7758 tg3_netif_start(tp);
7759 }
7760 spin_unlock(&tp->tx_lock);
7761 spin_unlock_irq(&tp->lock);
7762 }
7763}
7764
7221static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 7765static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
7222{ 7766{
7223 struct mii_ioctl_data *data = if_mii(ifr); 7767 struct mii_ioctl_data *data = if_mii(ifr);
@@ -7331,6 +7875,8 @@ static struct ethtool_ops tg3_ethtool_ops = {
7331 .get_tso = ethtool_op_get_tso, 7875 .get_tso = ethtool_op_get_tso,
7332 .set_tso = tg3_set_tso, 7876 .set_tso = tg3_set_tso,
7333#endif 7877#endif
7878 .self_test_count = tg3_get_test_count,
7879 .self_test = tg3_self_test,
7334 .get_strings = tg3_get_strings, 7880 .get_strings = tg3_get_strings,
7335 .get_stats_count = tg3_get_stats_count, 7881 .get_stats_count = tg3_get_stats_count,
7336 .get_ethtool_stats = tg3_get_ethtool_stats, 7882 .get_ethtool_stats = tg3_get_ethtool_stats,
@@ -8014,6 +8560,16 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
8014 8560
8015 case NIC_SRAM_DATA_CFG_LED_MODE_MAC: 8561 case NIC_SRAM_DATA_CFG_LED_MODE_MAC:
8016 tp->led_ctrl = LED_CTRL_MODE_MAC; 8562 tp->led_ctrl = LED_CTRL_MODE_MAC;
8563
8564 /* Default to PHY_1_MODE if 0 (MAC_MODE) is
8565 * read on some older 5700/5701 bootcode.
8566 */
8567 if (GET_ASIC_REV(tp->pci_chip_rev_id) ==
8568 ASIC_REV_5700 ||
8569 GET_ASIC_REV(tp->pci_chip_rev_id) ==
8570 ASIC_REV_5701)
8571 tp->led_ctrl = LED_CTRL_MODE_PHY_1;
8572
8017 break; 8573 break;
8018 8574
8019 case SHASTA_EXT_LED_SHARED: 8575 case SHASTA_EXT_LED_SHARED:
@@ -9139,10 +9695,24 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
9139 } 9695 }
9140 if ((tp->dma_rwctrl & DMA_RWCTRL_WRITE_BNDRY_MASK) != 9696 if ((tp->dma_rwctrl & DMA_RWCTRL_WRITE_BNDRY_MASK) !=
9141 DMA_RWCTRL_WRITE_BNDRY_16) { 9697 DMA_RWCTRL_WRITE_BNDRY_16) {
9698 static struct pci_device_id dma_wait_state_chipsets[] = {
9699 { PCI_DEVICE(PCI_VENDOR_ID_APPLE,
9700 PCI_DEVICE_ID_APPLE_UNI_N_PCI15) },
9701 { },
9702 };
9703
9142 /* DMA test passed without adjusting DMA boundary, 9704 /* DMA test passed without adjusting DMA boundary,
9143 * just restore the calculated DMA boundary 9705 * now look for chipsets that are known to expose the
9706 * DMA bug without failing the test.
9144 */ 9707 */
9145 tp->dma_rwctrl = saved_dma_rwctrl; 9708 if (pci_dev_present(dma_wait_state_chipsets)) {
9709 tp->dma_rwctrl &= ~DMA_RWCTRL_WRITE_BNDRY_MASK;
9710 tp->dma_rwctrl |= DMA_RWCTRL_WRITE_BNDRY_16;
9711 }
9712 else
9713 /* Safe to use the calculated DMA boundary. */
9714 tp->dma_rwctrl = saved_dma_rwctrl;
9715
9146 tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl); 9716 tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl);
9147 } 9717 }
9148 9718
@@ -9478,7 +10048,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
9478 (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { 10048 (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) {
9479 pci_save_state(tp->pdev); 10049 pci_save_state(tp->pdev);
9480 tw32(MEMARB_MODE, MEMARB_MODE_ENABLE); 10050 tw32(MEMARB_MODE, MEMARB_MODE_ENABLE);
9481 tg3_halt(tp, 1); 10051 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
9482 } 10052 }
9483 10053
9484 err = tg3_test_dma(tp); 10054 err = tg3_test_dma(tp);
@@ -9605,7 +10175,7 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
9605 10175
9606 spin_lock_irq(&tp->lock); 10176 spin_lock_irq(&tp->lock);
9607 spin_lock(&tp->tx_lock); 10177 spin_lock(&tp->tx_lock);
9608 tg3_halt(tp, 1); 10178 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
9609 spin_unlock(&tp->tx_lock); 10179 spin_unlock(&tp->tx_lock);
9610 spin_unlock_irq(&tp->lock); 10180 spin_unlock_irq(&tp->lock);
9611 10181
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index a7ffa64502dd..cf31c0629852 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -193,6 +193,12 @@ static int aui[MAX_TLAN_BOARDS];
193static int duplex[MAX_TLAN_BOARDS]; 193static int duplex[MAX_TLAN_BOARDS];
194static int speed[MAX_TLAN_BOARDS]; 194static int speed[MAX_TLAN_BOARDS];
195static int boards_found; 195static int boards_found;
196module_param_array(aui, int, NULL, 0);
197module_param_array(duplex, int, NULL, 0);
198module_param_array(speed, int, NULL, 0);
199MODULE_PARM_DESC(aui, "ThunderLAN use AUI port(s) (0-1)");
200MODULE_PARM_DESC(duplex, "ThunderLAN duplex setting(s) (0-default, 1-half, 2-full)");
201MODULE_PARM_DESC(speed, "ThunderLAN port speen setting(s) (0,10,100)");
196 202
197MODULE_AUTHOR("Maintainer: Samuel Chessman <chessman@tux.org>"); 203MODULE_AUTHOR("Maintainer: Samuel Chessman <chessman@tux.org>");
198MODULE_DESCRIPTION("Driver for TI ThunderLAN based ethernet PCI adapters"); 204MODULE_DESCRIPTION("Driver for TI ThunderLAN based ethernet PCI adapters");
@@ -204,8 +210,13 @@ MODULE_LICENSE("GPL");
204 210
205/* Turn on debugging. See Documentation/networking/tlan.txt for details */ 211/* Turn on debugging. See Documentation/networking/tlan.txt for details */
206static int debug; 212static int debug;
213module_param(debug, int, 0);
214MODULE_PARM_DESC(debug, "ThunderLAN debug mask");
207 215
208static int bbuf; 216static int bbuf;
217module_param(bbuf, int, 0);
218MODULE_PARM_DESC(bbuf, "ThunderLAN use big buffer (0-1)");
219
209static u8 *TLanPadBuffer; 220static u8 *TLanPadBuffer;
210static dma_addr_t TLanPadBufferDMA; 221static dma_addr_t TLanPadBufferDMA;
211static char TLanSignature[] = "TLAN"; 222static char TLanSignature[] = "TLAN";
@@ -2381,6 +2392,7 @@ TLan_FinishReset( struct net_device *dev )
2381 TLan_SetTimer( dev, (10*HZ), TLAN_TIMER_FINISH_RESET ); 2392 TLan_SetTimer( dev, (10*HZ), TLAN_TIMER_FINISH_RESET );
2382 return; 2393 return;
2383 } 2394 }
2395 TLan_SetMulticastList(dev);
2384 2396
2385} /* TLan_FinishReset */ 2397} /* TLan_FinishReset */
2386 2398
@@ -2807,7 +2819,7 @@ void TLan_PhyMonitor( struct net_device *dev )
2807 if (priv->link) { 2819 if (priv->link) {
2808 priv->link = 0; 2820 priv->link = 0;
2809 printk(KERN_DEBUG "TLAN: %s has lost link\n", dev->name); 2821 printk(KERN_DEBUG "TLAN: %s has lost link\n", dev->name);
2810 dev->flags &= ~IFF_RUNNING; 2822 netif_carrier_off(dev);
2811 TLan_SetTimer( dev, (2*HZ), TLAN_TIMER_LINK_BEAT ); 2823 TLan_SetTimer( dev, (2*HZ), TLAN_TIMER_LINK_BEAT );
2812 return; 2824 return;
2813 } 2825 }
@@ -2817,7 +2829,7 @@ void TLan_PhyMonitor( struct net_device *dev )
2817 if ((phy_status & MII_GS_LINK) && !priv->link) { 2829 if ((phy_status & MII_GS_LINK) && !priv->link) {
2818 priv->link = 1; 2830 priv->link = 1;
2819 printk(KERN_DEBUG "TLAN: %s has reestablished link\n", dev->name); 2831 printk(KERN_DEBUG "TLAN: %s has reestablished link\n", dev->name);
2820 dev->flags |= IFF_RUNNING; 2832 netif_carrier_on(dev);
2821 } 2833 }
2822 2834
2823 /* Setup a new monitor */ 2835 /* Setup a new monitor */
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index c098863bdd9d..3873917a9c22 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -888,11 +888,6 @@ static int tok_open(struct net_device *dev)
888 ti->sap_status = CLOSED; /* CLOSED or OPEN */ 888 ti->sap_status = CLOSED; /* CLOSED or OPEN */
889 ti->open_failure = NO; /* NO or YES */ 889 ti->open_failure = NO; /* NO or YES */
890 ti->open_mode = MANUAL; /* MANUAL or AUTOMATIC */ 890 ti->open_mode = MANUAL; /* MANUAL or AUTOMATIC */
891 /* 12/2000 not typical Linux, but we can use RUNNING to let us know when
892 the network has crapped out or cables are disconnected. Useful because
893 the IFF_UP flag stays up the whole time, until ifconfig tr0 down.
894 */
895 dev->flags &= ~IFF_RUNNING;
896 891
897 ti->sram_phys &= ~1; /* to reverse what we do in tok_close */ 892 ti->sram_phys &= ~1; /* to reverse what we do in tok_close */
898 /* init the spinlock */ 893 /* init the spinlock */
@@ -1242,7 +1237,7 @@ irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1242 ti->open_status = CLOSED; 1237 ti->open_status = CLOSED;
1243 ti->sap_status = CLOSED; 1238 ti->sap_status = CLOSED;
1244 ti->open_mode = AUTOMATIC; 1239 ti->open_mode = AUTOMATIC;
1245 dev->flags &= ~IFF_RUNNING; 1240 netif_carrier_off(dev);
1246 netif_stop_queue(dev); 1241 netif_stop_queue(dev);
1247 ti->open_action = RESTART; 1242 ti->open_action = RESTART;
1248 outb(0, dev->base_addr + ADAPTRESET); 1243 outb(0, dev->base_addr + ADAPTRESET);
@@ -1323,7 +1318,7 @@ irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1323 break; 1318 break;
1324 } 1319 }
1325 netif_wake_queue(dev); 1320 netif_wake_queue(dev);
1326 dev->flags |= IFF_RUNNING;/*BMS 12/2000*/ 1321 netif_carrier_on(dev);
1327 break; 1322 break;
1328 case DIR_INTERRUPT: 1323 case DIR_INTERRUPT:
1329 case DIR_MOD_OPEN_PARAMS: 1324 case DIR_MOD_OPEN_PARAMS:
@@ -1427,7 +1422,7 @@ irqreturn_t tok_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1427 ring_status); 1422 ring_status);
1428 if(ring_status& (REMOVE_RECV|AUTO_REMOVAL|LOBE_FAULT)){ 1423 if(ring_status& (REMOVE_RECV|AUTO_REMOVAL|LOBE_FAULT)){
1429 netif_stop_queue(dev); 1424 netif_stop_queue(dev);
1430 dev->flags &= ~IFF_RUNNING;/*not typical Linux*/ 1425 netif_carrier_off(dev);
1431 DPRINTK("Remove received, or Auto-removal error" 1426 DPRINTK("Remove received, or Auto-removal error"
1432 ", or Lobe fault\n"); 1427 ", or Lobe fault\n");
1433 DPRINTK("We'll try to reopen the closed adapter" 1428 DPRINTK("We'll try to reopen the closed adapter"
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index 921a573372e9..7ff814fd65d0 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -235,7 +235,7 @@ static int dma[MAX_CARDS+1];
235static int irq[MAX_CARDS+1] = { -1, -1, -1, -1, -1, -1, 0, }; 235static int irq[MAX_CARDS+1] = { -1, -1, -1, -1, -1, -1, 0, };
236 236
237/* for class stuff*/ 237/* for class stuff*/
238static struct class_simple *cosa_class; 238static struct class *cosa_class;
239 239
240#ifdef MODULE 240#ifdef MODULE
241module_param_array(io, int, NULL, 0); 241module_param_array(io, int, NULL, 0);
@@ -394,19 +394,19 @@ static int __init cosa_init(void)
394 goto out; 394 goto out;
395 } 395 }
396 devfs_mk_dir("cosa"); 396 devfs_mk_dir("cosa");
397 cosa_class = class_simple_create(THIS_MODULE, "cosa"); 397 cosa_class = class_create(THIS_MODULE, "cosa");
398 if (IS_ERR(cosa_class)) { 398 if (IS_ERR(cosa_class)) {
399 err = PTR_ERR(cosa_class); 399 err = PTR_ERR(cosa_class);
400 goto out_chrdev; 400 goto out_chrdev;
401 } 401 }
402 for (i=0; i<nr_cards; i++) { 402 for (i=0; i<nr_cards; i++) {
403 class_simple_device_add(cosa_class, MKDEV(cosa_major, i), 403 class_device_create(cosa_class, MKDEV(cosa_major, i),
404 NULL, "cosa%d", i); 404 NULL, "cosa%d", i);
405 err = devfs_mk_cdev(MKDEV(cosa_major, i), 405 err = devfs_mk_cdev(MKDEV(cosa_major, i),
406 S_IFCHR|S_IRUSR|S_IWUSR, 406 S_IFCHR|S_IRUSR|S_IWUSR,
407 "cosa/%d", i); 407 "cosa/%d", i);
408 if (err) { 408 if (err) {
409 class_simple_device_remove(MKDEV(cosa_major, i)); 409 class_device_destroy(cosa_class, MKDEV(cosa_major, i));
410 goto out_chrdev; 410 goto out_chrdev;
411 } 411 }
412 } 412 }
@@ -427,10 +427,10 @@ static void __exit cosa_exit(void)
427 printk(KERN_INFO "Unloading the cosa module\n"); 427 printk(KERN_INFO "Unloading the cosa module\n");
428 428
429 for (i=0; i<nr_cards; i++) { 429 for (i=0; i<nr_cards; i++) {
430 class_simple_device_remove(MKDEV(cosa_major, i)); 430 class_device_destroy(cosa_class, MKDEV(cosa_major, i));
431 devfs_remove("cosa/%d", i); 431 devfs_remove("cosa/%d", i);
432 } 432 }
433 class_simple_destroy(cosa_class); 433 class_destroy(cosa_class);
434 devfs_remove("cosa"); 434 devfs_remove("cosa");
435 for (cosa=cosa_cards; nr_cards--; cosa++) { 435 for (cosa=cosa_cards; nr_cards--; cosa++) {
436 /* Clean up the per-channel data */ 436 /* Clean up the per-channel data */
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index 7f450b51a6cb..a5d6891c9d4c 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -2,7 +2,7 @@
2 * Generic HDLC support routines for Linux 2 * Generic HDLC support routines for Linux
3 * Frame Relay support 3 * Frame Relay support
4 * 4 *
5 * Copyright (C) 1999 - 2003 Krzysztof Halasa <khc@pm.waw.pl> 5 * Copyright (C) 1999 - 2005 Krzysztof Halasa <khc@pm.waw.pl>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of version 2 of the GNU General Public License 8 * under the terms of version 2 of the GNU General Public License
@@ -27,6 +27,10 @@
27 active = open and "link reliable" 27 active = open and "link reliable"
28 exist = new = not used 28 exist = new = not used
29 29
30 CCITT LMI: ITU-T Q.933 Annex A
31 ANSI LMI: ANSI T1.617 Annex D
32 CISCO LMI: the original, aka "Gang of Four" LMI
33
30*/ 34*/
31 35
32#include <linux/module.h> 36#include <linux/module.h>
@@ -49,45 +53,41 @@
49#undef DEBUG_ECN 53#undef DEBUG_ECN
50#undef DEBUG_LINK 54#undef DEBUG_LINK
51 55
52#define MAXLEN_LMISTAT 20 /* max size of status enquiry frame */ 56#define FR_UI 0x03
53 57#define FR_PAD 0x00
54#define PVC_STATE_NEW 0x01 58
55#define PVC_STATE_ACTIVE 0x02 59#define NLPID_IP 0xCC
56#define PVC_STATE_FECN 0x08 /* FECN condition */ 60#define NLPID_IPV6 0x8E
57#define PVC_STATE_BECN 0x10 /* BECN condition */ 61#define NLPID_SNAP 0x80
58 62#define NLPID_PAD 0x00
59 63#define NLPID_CCITT_ANSI_LMI 0x08
60#define FR_UI 0x03 64#define NLPID_CISCO_LMI 0x09
61#define FR_PAD 0x00 65
62 66
63#define NLPID_IP 0xCC 67#define LMI_CCITT_ANSI_DLCI 0 /* LMI DLCI */
64#define NLPID_IPV6 0x8E 68#define LMI_CISCO_DLCI 1023
65#define NLPID_SNAP 0x80 69
66#define NLPID_PAD 0x00 70#define LMI_CALLREF 0x00 /* Call Reference */
67#define NLPID_Q933 0x08 71#define LMI_ANSI_LOCKSHIFT 0x95 /* ANSI locking shift */
68 72#define LMI_ANSI_CISCO_REPTYPE 0x01 /* report type */
69 73#define LMI_CCITT_REPTYPE 0x51
70#define LMI_DLCI 0 /* LMI DLCI */ 74#define LMI_ANSI_CISCO_ALIVE 0x03 /* keep alive */
71#define LMI_PROTO 0x08 75#define LMI_CCITT_ALIVE 0x53
72#define LMI_CALLREF 0x00 /* Call Reference */ 76#define LMI_ANSI_CISCO_PVCSTAT 0x07 /* PVC status */
73#define LMI_ANSI_LOCKSHIFT 0x95 /* ANSI lockshift */ 77#define LMI_CCITT_PVCSTAT 0x57
74#define LMI_REPTYPE 1 /* report type */ 78
75#define LMI_CCITT_REPTYPE 0x51 79#define LMI_FULLREP 0x00 /* full report */
76#define LMI_ALIVE 3 /* keep alive */ 80#define LMI_INTEGRITY 0x01 /* link integrity report */
77#define LMI_CCITT_ALIVE 0x53 81#define LMI_SINGLE 0x02 /* single PVC report */
78#define LMI_PVCSTAT 7 /* pvc status */ 82
79#define LMI_CCITT_PVCSTAT 0x57
80#define LMI_FULLREP 0 /* full report */
81#define LMI_INTEGRITY 1 /* link integrity report */
82#define LMI_SINGLE 2 /* single pvc report */
83#define LMI_STATUS_ENQUIRY 0x75 83#define LMI_STATUS_ENQUIRY 0x75
84#define LMI_STATUS 0x7D /* reply */ 84#define LMI_STATUS 0x7D /* reply */
85 85
86#define LMI_REPT_LEN 1 /* report type element length */ 86#define LMI_REPT_LEN 1 /* report type element length */
87#define LMI_INTEG_LEN 2 /* link integrity element length */ 87#define LMI_INTEG_LEN 2 /* link integrity element length */
88 88
89#define LMI_LENGTH 13 /* standard LMI frame length */ 89#define LMI_CCITT_CISCO_LENGTH 13 /* LMI frame lengths */
90#define LMI_ANSI_LENGTH 14 90#define LMI_ANSI_LENGTH 14
91 91
92 92
93typedef struct { 93typedef struct {
@@ -223,51 +223,34 @@ static inline struct net_device** get_dev_p(pvc_device *pvc, int type)
223} 223}
224 224
225 225
226static inline u16 status_to_dlci(u8 *status, int *active, int *new)
227{
228 *new = (status[2] & 0x08) ? 1 : 0;
229 *active = (status[2] & 0x02) ? 1 : 0;
230
231 return ((status[0] & 0x3F) << 4) | ((status[1] & 0x78) >> 3);
232}
233
234
235static inline void dlci_to_status(u16 dlci, u8 *status, int active, int new)
236{
237 status[0] = (dlci >> 4) & 0x3F;
238 status[1] = ((dlci << 3) & 0x78) | 0x80;
239 status[2] = 0x80;
240
241 if (new)
242 status[2] |= 0x08;
243 else if (active)
244 status[2] |= 0x02;
245}
246
247
248
249static int fr_hard_header(struct sk_buff **skb_p, u16 dlci) 226static int fr_hard_header(struct sk_buff **skb_p, u16 dlci)
250{ 227{
251 u16 head_len; 228 u16 head_len;
252 struct sk_buff *skb = *skb_p; 229 struct sk_buff *skb = *skb_p;
253 230
254 switch (skb->protocol) { 231 switch (skb->protocol) {
255 case __constant_ntohs(ETH_P_IP): 232 case __constant_ntohs(NLPID_CCITT_ANSI_LMI):
256 head_len = 4; 233 head_len = 4;
257 skb_push(skb, head_len); 234 skb_push(skb, head_len);
258 skb->data[3] = NLPID_IP; 235 skb->data[3] = NLPID_CCITT_ANSI_LMI;
259 break; 236 break;
260 237
261 case __constant_ntohs(ETH_P_IPV6): 238 case __constant_ntohs(NLPID_CISCO_LMI):
262 head_len = 4; 239 head_len = 4;
263 skb_push(skb, head_len); 240 skb_push(skb, head_len);
264 skb->data[3] = NLPID_IPV6; 241 skb->data[3] = NLPID_CISCO_LMI;
265 break; 242 break;
266 243
267 case __constant_ntohs(LMI_PROTO): 244 case __constant_ntohs(ETH_P_IP):
245 head_len = 4;
246 skb_push(skb, head_len);
247 skb->data[3] = NLPID_IP;
248 break;
249
250 case __constant_ntohs(ETH_P_IPV6):
268 head_len = 4; 251 head_len = 4;
269 skb_push(skb, head_len); 252 skb_push(skb, head_len);
270 skb->data[3] = LMI_PROTO; 253 skb->data[3] = NLPID_IPV6;
271 break; 254 break;
272 255
273 case __constant_ntohs(ETH_P_802_3): 256 case __constant_ntohs(ETH_P_802_3):
@@ -461,13 +444,14 @@ static void fr_lmi_send(struct net_device *dev, int fullrep)
461 hdlc_device *hdlc = dev_to_hdlc(dev); 444 hdlc_device *hdlc = dev_to_hdlc(dev);
462 struct sk_buff *skb; 445 struct sk_buff *skb;
463 pvc_device *pvc = hdlc->state.fr.first_pvc; 446 pvc_device *pvc = hdlc->state.fr.first_pvc;
464 int len = (hdlc->state.fr.settings.lmi == LMI_ANSI) ? LMI_ANSI_LENGTH 447 int lmi = hdlc->state.fr.settings.lmi;
465 : LMI_LENGTH; 448 int dce = hdlc->state.fr.settings.dce;
466 int stat_len = 3; 449 int len = lmi == LMI_ANSI ? LMI_ANSI_LENGTH : LMI_CCITT_CISCO_LENGTH;
450 int stat_len = (lmi == LMI_CISCO) ? 6 : 3;
467 u8 *data; 451 u8 *data;
468 int i = 0; 452 int i = 0;
469 453
470 if (hdlc->state.fr.settings.dce && fullrep) { 454 if (dce && fullrep) {
471 len += hdlc->state.fr.dce_pvc_count * (2 + stat_len); 455 len += hdlc->state.fr.dce_pvc_count * (2 + stat_len);
472 if (len > HDLC_MAX_MRU) { 456 if (len > HDLC_MAX_MRU) {
473 printk(KERN_WARNING "%s: Too many PVCs while sending " 457 printk(KERN_WARNING "%s: Too many PVCs while sending "
@@ -484,29 +468,31 @@ static void fr_lmi_send(struct net_device *dev, int fullrep)
484 } 468 }
485 memset(skb->data, 0, len); 469 memset(skb->data, 0, len);
486 skb_reserve(skb, 4); 470 skb_reserve(skb, 4);
487 skb->protocol = __constant_htons(LMI_PROTO); 471 if (lmi == LMI_CISCO) {
488 fr_hard_header(&skb, LMI_DLCI); 472 skb->protocol = __constant_htons(NLPID_CISCO_LMI);
473 fr_hard_header(&skb, LMI_CISCO_DLCI);
474 } else {
475 skb->protocol = __constant_htons(NLPID_CCITT_ANSI_LMI);
476 fr_hard_header(&skb, LMI_CCITT_ANSI_DLCI);
477 }
489 data = skb->tail; 478 data = skb->tail;
490 data[i++] = LMI_CALLREF; 479 data[i++] = LMI_CALLREF;
491 data[i++] = hdlc->state.fr.settings.dce 480 data[i++] = dce ? LMI_STATUS : LMI_STATUS_ENQUIRY;
492 ? LMI_STATUS : LMI_STATUS_ENQUIRY; 481 if (lmi == LMI_ANSI)
493 if (hdlc->state.fr.settings.lmi == LMI_ANSI)
494 data[i++] = LMI_ANSI_LOCKSHIFT; 482 data[i++] = LMI_ANSI_LOCKSHIFT;
495 data[i++] = (hdlc->state.fr.settings.lmi == LMI_CCITT) 483 data[i++] = lmi == LMI_CCITT ? LMI_CCITT_REPTYPE :
496 ? LMI_CCITT_REPTYPE : LMI_REPTYPE; 484 LMI_ANSI_CISCO_REPTYPE;
497 data[i++] = LMI_REPT_LEN; 485 data[i++] = LMI_REPT_LEN;
498 data[i++] = fullrep ? LMI_FULLREP : LMI_INTEGRITY; 486 data[i++] = fullrep ? LMI_FULLREP : LMI_INTEGRITY;
499 487 data[i++] = lmi == LMI_CCITT ? LMI_CCITT_ALIVE : LMI_ANSI_CISCO_ALIVE;
500 data[i++] = (hdlc->state.fr.settings.lmi == LMI_CCITT)
501 ? LMI_CCITT_ALIVE : LMI_ALIVE;
502 data[i++] = LMI_INTEG_LEN; 488 data[i++] = LMI_INTEG_LEN;
503 data[i++] = hdlc->state.fr.txseq =fr_lmi_nextseq(hdlc->state.fr.txseq); 489 data[i++] = hdlc->state.fr.txseq =fr_lmi_nextseq(hdlc->state.fr.txseq);
504 data[i++] = hdlc->state.fr.rxseq; 490 data[i++] = hdlc->state.fr.rxseq;
505 491
506 if (hdlc->state.fr.settings.dce && fullrep) { 492 if (dce && fullrep) {
507 while (pvc) { 493 while (pvc) {
508 data[i++] = (hdlc->state.fr.settings.lmi == LMI_CCITT) 494 data[i++] = lmi == LMI_CCITT ? LMI_CCITT_PVCSTAT :
509 ? LMI_CCITT_PVCSTAT : LMI_PVCSTAT; 495 LMI_ANSI_CISCO_PVCSTAT;
510 data[i++] = stat_len; 496 data[i++] = stat_len;
511 497
512 /* LMI start/restart */ 498 /* LMI start/restart */
@@ -523,8 +509,20 @@ static void fr_lmi_send(struct net_device *dev, int fullrep)
523 fr_log_dlci_active(pvc); 509 fr_log_dlci_active(pvc);
524 } 510 }
525 511
526 dlci_to_status(pvc->dlci, data + i, 512 if (lmi == LMI_CISCO) {
527 pvc->state.active, pvc->state.new); 513 data[i] = pvc->dlci >> 8;
514 data[i + 1] = pvc->dlci & 0xFF;
515 } else {
516 data[i] = (pvc->dlci >> 4) & 0x3F;
517 data[i + 1] = ((pvc->dlci << 3) & 0x78) | 0x80;
518 data[i + 2] = 0x80;
519 }
520
521 if (pvc->state.new)
522 data[i + 2] |= 0x08;
523 else if (pvc->state.active)
524 data[i + 2] |= 0x02;
525
528 i += stat_len; 526 i += stat_len;
529 pvc = pvc->next; 527 pvc = pvc->next;
530 } 528 }
@@ -569,6 +567,8 @@ static void fr_set_link_state(int reliable, struct net_device *dev)
569 pvc_carrier(0, pvc); 567 pvc_carrier(0, pvc);
570 pvc->state.exist = pvc->state.active = 0; 568 pvc->state.exist = pvc->state.active = 0;
571 pvc->state.new = 0; 569 pvc->state.new = 0;
570 if (!hdlc->state.fr.settings.dce)
571 pvc->state.bandwidth = 0;
572 pvc = pvc->next; 572 pvc = pvc->next;
573 } 573 }
574 } 574 }
@@ -583,11 +583,12 @@ static void fr_timer(unsigned long arg)
583 int i, cnt = 0, reliable; 583 int i, cnt = 0, reliable;
584 u32 list; 584 u32 list;
585 585
586 if (hdlc->state.fr.settings.dce) 586 if (hdlc->state.fr.settings.dce) {
587 reliable = hdlc->state.fr.request && 587 reliable = hdlc->state.fr.request &&
588 time_before(jiffies, hdlc->state.fr.last_poll + 588 time_before(jiffies, hdlc->state.fr.last_poll +
589 hdlc->state.fr.settings.t392 * HZ); 589 hdlc->state.fr.settings.t392 * HZ);
590 else { 590 hdlc->state.fr.request = 0;
591 } else {
591 hdlc->state.fr.last_errors <<= 1; /* Shift the list */ 592 hdlc->state.fr.last_errors <<= 1; /* Shift the list */
592 if (hdlc->state.fr.request) { 593 if (hdlc->state.fr.request) {
593 if (hdlc->state.fr.reliable) 594 if (hdlc->state.fr.reliable)
@@ -634,65 +635,88 @@ static void fr_timer(unsigned long arg)
634static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb) 635static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
635{ 636{
636 hdlc_device *hdlc = dev_to_hdlc(dev); 637 hdlc_device *hdlc = dev_to_hdlc(dev);
637 int stat_len;
638 pvc_device *pvc; 638 pvc_device *pvc;
639 int reptype = -1, error, no_ram;
640 u8 rxseq, txseq; 639 u8 rxseq, txseq;
641 int i; 640 int lmi = hdlc->state.fr.settings.lmi;
641 int dce = hdlc->state.fr.settings.dce;
642 int stat_len = (lmi == LMI_CISCO) ? 6 : 3, reptype, error, no_ram, i;
642 643
643 if (skb->len < ((hdlc->state.fr.settings.lmi == LMI_ANSI) 644 if (skb->len < (lmi == LMI_ANSI ? LMI_ANSI_LENGTH :
644 ? LMI_ANSI_LENGTH : LMI_LENGTH)) { 645 LMI_CCITT_CISCO_LENGTH)) {
645 printk(KERN_INFO "%s: Short LMI frame\n", dev->name); 646 printk(KERN_INFO "%s: Short LMI frame\n", dev->name);
646 return 1; 647 return 1;
647 } 648 }
648 649
649 if (skb->data[5] != (!hdlc->state.fr.settings.dce ? 650 if (skb->data[3] != (lmi == LMI_CISCO ? NLPID_CISCO_LMI :
650 LMI_STATUS : LMI_STATUS_ENQUIRY)) { 651 NLPID_CCITT_ANSI_LMI)) {
651 printk(KERN_INFO "%s: LMI msgtype=%x, Not LMI status %s\n", 652 printk(KERN_INFO "%s: Received non-LMI frame with LMI"
652 dev->name, skb->data[2], 653 " DLCI\n", dev->name);
653 hdlc->state.fr.settings.dce ? "enquiry" : "reply"); 654 return 1;
655 }
656
657 if (skb->data[4] != LMI_CALLREF) {
658 printk(KERN_INFO "%s: Invalid LMI Call reference (0x%02X)\n",
659 dev->name, skb->data[4]);
660 return 1;
661 }
662
663 if (skb->data[5] != (dce ? LMI_STATUS_ENQUIRY : LMI_STATUS)) {
664 printk(KERN_INFO "%s: Invalid LMI Message type (0x%02X)\n",
665 dev->name, skb->data[5]);
654 return 1; 666 return 1;
655 } 667 }
656 668
657 i = (hdlc->state.fr.settings.lmi == LMI_ANSI) ? 7 : 6; 669 if (lmi == LMI_ANSI) {
670 if (skb->data[6] != LMI_ANSI_LOCKSHIFT) {
671 printk(KERN_INFO "%s: Not ANSI locking shift in LMI"
672 " message (0x%02X)\n", dev->name, skb->data[6]);
673 return 1;
674 }
675 i = 7;
676 } else
677 i = 6;
658 678
659 if (skb->data[i] != 679 if (skb->data[i] != (lmi == LMI_CCITT ? LMI_CCITT_REPTYPE :
660 ((hdlc->state.fr.settings.lmi == LMI_CCITT) 680 LMI_ANSI_CISCO_REPTYPE)) {
661 ? LMI_CCITT_REPTYPE : LMI_REPTYPE)) { 681 printk(KERN_INFO "%s: Not an LMI Report type IE (0x%02X)\n",
662 printk(KERN_INFO "%s: Not a report type=%x\n",
663 dev->name, skb->data[i]); 682 dev->name, skb->data[i]);
664 return 1; 683 return 1;
665 } 684 }
666 i++;
667 685
668 i++; /* Skip length field */ 686 if (skb->data[++i] != LMI_REPT_LEN) {
687 printk(KERN_INFO "%s: Invalid LMI Report type IE length"
688 " (%u)\n", dev->name, skb->data[i]);
689 return 1;
690 }
669 691
670 reptype = skb->data[i++]; 692 reptype = skb->data[++i];
693 if (reptype != LMI_INTEGRITY && reptype != LMI_FULLREP) {
694 printk(KERN_INFO "%s: Unsupported LMI Report type (0x%02X)\n",
695 dev->name, reptype);
696 return 1;
697 }
671 698
672 if (skb->data[i]!= 699 if (skb->data[++i] != (lmi == LMI_CCITT ? LMI_CCITT_ALIVE :
673 ((hdlc->state.fr.settings.lmi == LMI_CCITT) 700 LMI_ANSI_CISCO_ALIVE)) {
674 ? LMI_CCITT_ALIVE : LMI_ALIVE)) { 701 printk(KERN_INFO "%s: Not an LMI Link integrity verification"
675 printk(KERN_INFO "%s: Unsupported status element=%x\n", 702 " IE (0x%02X)\n", dev->name, skb->data[i]);
676 dev->name, skb->data[i]);
677 return 1; 703 return 1;
678 } 704 }
679 i++;
680 705
681 i++; /* Skip length field */ 706 if (skb->data[++i] != LMI_INTEG_LEN) {
707 printk(KERN_INFO "%s: Invalid LMI Link integrity verification"
708 " IE length (%u)\n", dev->name, skb->data[i]);
709 return 1;
710 }
711 i++;
682 712
683 hdlc->state.fr.rxseq = skb->data[i++]; /* TX sequence from peer */ 713 hdlc->state.fr.rxseq = skb->data[i++]; /* TX sequence from peer */
684 rxseq = skb->data[i++]; /* Should confirm our sequence */ 714 rxseq = skb->data[i++]; /* Should confirm our sequence */
685 715
686 txseq = hdlc->state.fr.txseq; 716 txseq = hdlc->state.fr.txseq;
687 717
688 if (hdlc->state.fr.settings.dce) { 718 if (dce)
689 if (reptype != LMI_FULLREP && reptype != LMI_INTEGRITY) {
690 printk(KERN_INFO "%s: Unsupported report type=%x\n",
691 dev->name, reptype);
692 return 1;
693 }
694 hdlc->state.fr.last_poll = jiffies; 719 hdlc->state.fr.last_poll = jiffies;
695 }
696 720
697 error = 0; 721 error = 0;
698 if (!hdlc->state.fr.reliable) 722 if (!hdlc->state.fr.reliable)
@@ -703,7 +727,7 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
703 error = 1; 727 error = 1;
704 } 728 }
705 729
706 if (hdlc->state.fr.settings.dce) { 730 if (dce) {
707 if (hdlc->state.fr.fullrep_sent && !error) { 731 if (hdlc->state.fr.fullrep_sent && !error) {
708/* Stop sending full report - the last one has been confirmed by DTE */ 732/* Stop sending full report - the last one has been confirmed by DTE */
709 hdlc->state.fr.fullrep_sent = 0; 733 hdlc->state.fr.fullrep_sent = 0;
@@ -725,6 +749,7 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
725 hdlc->state.fr.dce_changed = 0; 749 hdlc->state.fr.dce_changed = 0;
726 } 750 }
727 751
752 hdlc->state.fr.request = 1; /* got request */
728 fr_lmi_send(dev, reptype == LMI_FULLREP ? 1 : 0); 753 fr_lmi_send(dev, reptype == LMI_FULLREP ? 1 : 0);
729 return 0; 754 return 0;
730 } 755 }
@@ -739,7 +764,6 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
739 if (reptype != LMI_FULLREP) 764 if (reptype != LMI_FULLREP)
740 return 0; 765 return 0;
741 766
742 stat_len = 3;
743 pvc = hdlc->state.fr.first_pvc; 767 pvc = hdlc->state.fr.first_pvc;
744 768
745 while (pvc) { 769 while (pvc) {
@@ -750,24 +774,35 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
750 no_ram = 0; 774 no_ram = 0;
751 while (skb->len >= i + 2 + stat_len) { 775 while (skb->len >= i + 2 + stat_len) {
752 u16 dlci; 776 u16 dlci;
777 u32 bw;
753 unsigned int active, new; 778 unsigned int active, new;
754 779
755 if (skb->data[i] != ((hdlc->state.fr.settings.lmi == LMI_CCITT) 780 if (skb->data[i] != (lmi == LMI_CCITT ? LMI_CCITT_PVCSTAT :
756 ? LMI_CCITT_PVCSTAT : LMI_PVCSTAT)) { 781 LMI_ANSI_CISCO_PVCSTAT)) {
757 printk(KERN_WARNING "%s: Invalid PVCSTAT ID: %x\n", 782 printk(KERN_INFO "%s: Not an LMI PVC status IE"
758 dev->name, skb->data[i]); 783 " (0x%02X)\n", dev->name, skb->data[i]);
759 return 1; 784 return 1;
760 } 785 }
761 i++;
762 786
763 if (skb->data[i] != stat_len) { 787 if (skb->data[++i] != stat_len) {
764 printk(KERN_WARNING "%s: Invalid PVCSTAT length: %x\n", 788 printk(KERN_INFO "%s: Invalid LMI PVC status IE length"
765 dev->name, skb->data[i]); 789 " (%u)\n", dev->name, skb->data[i]);
766 return 1; 790 return 1;
767 } 791 }
768 i++; 792 i++;
769 793
770 dlci = status_to_dlci(skb->data + i, &active, &new); 794 new = !! (skb->data[i + 2] & 0x08);
795 active = !! (skb->data[i + 2] & 0x02);
796 if (lmi == LMI_CISCO) {
797 dlci = (skb->data[i] << 8) | skb->data[i + 1];
798 bw = (skb->data[i + 3] << 16) |
799 (skb->data[i + 4] << 8) |
800 (skb->data[i + 5]);
801 } else {
802 dlci = ((skb->data[i] & 0x3F) << 4) |
803 ((skb->data[i + 1] & 0x78) >> 3);
804 bw = 0;
805 }
771 806
772 pvc = add_pvc(dev, dlci); 807 pvc = add_pvc(dev, dlci);
773 808
@@ -783,9 +818,11 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
783 pvc->state.deleted = 0; 818 pvc->state.deleted = 0;
784 if (active != pvc->state.active || 819 if (active != pvc->state.active ||
785 new != pvc->state.new || 820 new != pvc->state.new ||
821 bw != pvc->state.bandwidth ||
786 !pvc->state.exist) { 822 !pvc->state.exist) {
787 pvc->state.new = new; 823 pvc->state.new = new;
788 pvc->state.active = active; 824 pvc->state.active = active;
825 pvc->state.bandwidth = bw;
789 pvc_carrier(active, pvc); 826 pvc_carrier(active, pvc);
790 fr_log_dlci_active(pvc); 827 fr_log_dlci_active(pvc);
791 } 828 }
@@ -801,6 +838,7 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
801 pvc_carrier(0, pvc); 838 pvc_carrier(0, pvc);
802 pvc->state.active = pvc->state.new = 0; 839 pvc->state.active = pvc->state.new = 0;
803 pvc->state.exist = 0; 840 pvc->state.exist = 0;
841 pvc->state.bandwidth = 0;
804 fr_log_dlci_active(pvc); 842 fr_log_dlci_active(pvc);
805 } 843 }
806 pvc = pvc->next; 844 pvc = pvc->next;
@@ -829,22 +867,15 @@ static int fr_rx(struct sk_buff *skb)
829 867
830 dlci = q922_to_dlci(skb->data); 868 dlci = q922_to_dlci(skb->data);
831 869
832 if (dlci == LMI_DLCI) { 870 if ((dlci == LMI_CCITT_ANSI_DLCI &&
833 if (hdlc->state.fr.settings.lmi == LMI_NONE) 871 (hdlc->state.fr.settings.lmi == LMI_ANSI ||
834 goto rx_error; /* LMI packet with no LMI? */ 872 hdlc->state.fr.settings.lmi == LMI_CCITT)) ||
835 873 (dlci == LMI_CISCO_DLCI &&
836 if (data[3] == LMI_PROTO) { 874 hdlc->state.fr.settings.lmi == LMI_CISCO)) {
837 if (fr_lmi_recv(ndev, skb)) 875 if (fr_lmi_recv(ndev, skb))
838 goto rx_error; 876 goto rx_error;
839 else { 877 dev_kfree_skb_any(skb);
840 dev_kfree_skb_any(skb); 878 return NET_RX_SUCCESS;
841 return NET_RX_SUCCESS;
842 }
843 }
844
845 printk(KERN_INFO "%s: Received non-LMI frame with LMI DLCI\n",
846 ndev->name);
847 goto rx_error;
848 } 879 }
849 880
850 pvc = find_pvc(hdlc, dlci); 881 pvc = find_pvc(hdlc, dlci);
@@ -1170,7 +1201,8 @@ int hdlc_fr_ioctl(struct net_device *dev, struct ifreq *ifr)
1170 1201
1171 if ((new_settings.lmi != LMI_NONE && 1202 if ((new_settings.lmi != LMI_NONE &&
1172 new_settings.lmi != LMI_ANSI && 1203 new_settings.lmi != LMI_ANSI &&
1173 new_settings.lmi != LMI_CCITT) || 1204 new_settings.lmi != LMI_CCITT &&
1205 new_settings.lmi != LMI_CISCO) ||
1174 new_settings.t391 < 1 || 1206 new_settings.t391 < 1 ||
1175 new_settings.t392 < 2 || 1207 new_settings.t392 < 2 ||
1176 new_settings.n391 < 1 || 1208 new_settings.n391 < 1 ||
diff --git a/drivers/net/wan/hdlc_generic.c b/drivers/net/wan/hdlc_generic.c
index 6ed064cb4469..a63f6a2cc4f7 100644
--- a/drivers/net/wan/hdlc_generic.c
+++ b/drivers/net/wan/hdlc_generic.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Generic HDLC support routines for Linux 2 * Generic HDLC support routines for Linux
3 * 3 *
4 * Copyright (C) 1999 - 2003 Krzysztof Halasa <khc@pm.waw.pl> 4 * Copyright (C) 1999 - 2005 Krzysztof Halasa <khc@pm.waw.pl>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2 of the GNU General Public License 7 * under the terms of version 2 of the GNU General Public License
@@ -38,7 +38,7 @@
38#include <linux/hdlc.h> 38#include <linux/hdlc.h>
39 39
40 40
41static const char* version = "HDLC support module revision 1.17"; 41static const char* version = "HDLC support module revision 1.18";
42 42
43#undef DEBUG_LINK 43#undef DEBUG_LINK
44 44
@@ -126,10 +126,13 @@ void hdlc_set_carrier(int on, struct net_device *dev)
126 if (!hdlc->open) 126 if (!hdlc->open)
127 goto carrier_exit; 127 goto carrier_exit;
128 128
129 if (hdlc->carrier) 129 if (hdlc->carrier) {
130 printk(KERN_INFO "%s: Carrier detected\n", dev->name);
130 __hdlc_set_carrier_on(dev); 131 __hdlc_set_carrier_on(dev);
131 else 132 } else {
133 printk(KERN_INFO "%s: Carrier lost\n", dev->name);
132 __hdlc_set_carrier_off(dev); 134 __hdlc_set_carrier_off(dev);
135 }
133 136
134carrier_exit: 137carrier_exit:
135 spin_unlock_irqrestore(&hdlc->state_lock, flags); 138 spin_unlock_irqrestore(&hdlc->state_lock, flags);
@@ -157,8 +160,11 @@ int hdlc_open(struct net_device *dev)
157 160
158 spin_lock_irq(&hdlc->state_lock); 161 spin_lock_irq(&hdlc->state_lock);
159 162
160 if (hdlc->carrier) 163 if (hdlc->carrier) {
164 printk(KERN_INFO "%s: Carrier detected\n", dev->name);
161 __hdlc_set_carrier_on(dev); 165 __hdlc_set_carrier_on(dev);
166 } else
167 printk(KERN_INFO "%s: No carrier\n", dev->name);
162 168
163 hdlc->open = 1; 169 hdlc->open = 1;
164 170
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 15e545f66cd7..2b948ea397d5 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -723,7 +723,7 @@ static void lmc_watchdog (unsigned long data) /*fold00*/
723 /* lmc_reset (sc); Why reset??? The link can go down ok */ 723 /* lmc_reset (sc); Why reset??? The link can go down ok */
724 724
725 /* Inform the world that link has been lost */ 725 /* Inform the world that link has been lost */
726 dev->flags &= ~IFF_RUNNING; 726 netif_carrier_off(dev);
727 } 727 }
728 728
729 /* 729 /*
@@ -736,7 +736,7 @@ static void lmc_watchdog (unsigned long data) /*fold00*/
736 /* lmc_reset (sc); Again why reset??? */ 736 /* lmc_reset (sc); Again why reset??? */
737 737
738 /* Inform the world that link protocol is back up. */ 738 /* Inform the world that link protocol is back up. */
739 dev->flags |= IFF_RUNNING; 739 netif_carrier_on(dev);
740 740
741 /* Now we have to tell the syncppp that we had an outage 741 /* Now we have to tell the syncppp that we had an outage
742 * and that it should deal. Calling sppp_reopen here 742 * and that it should deal. Calling sppp_reopen here
@@ -1168,8 +1168,6 @@ static void lmc_running_reset (struct net_device *dev) /*fold00*/
1168 sc->lmc_media->set_link_status (sc, 1); 1168 sc->lmc_media->set_link_status (sc, 1);
1169 sc->lmc_media->set_status (sc, NULL); 1169 sc->lmc_media->set_status (sc, NULL);
1170 1170
1171 //dev->flags |= IFF_RUNNING;
1172
1173 netif_wake_queue(dev); 1171 netif_wake_queue(dev);
1174 1172
1175 sc->lmc_txfull = 0; 1173 sc->lmc_txfull = 0;
@@ -1233,8 +1231,6 @@ static int lmc_ifdown (struct net_device *dev) /*fold00*/
1233 csr6 &= ~LMC_DEC_SR; /* Turn off the Receive bit */ 1231 csr6 &= ~LMC_DEC_SR; /* Turn off the Receive bit */
1234 LMC_CSR_WRITE (sc, csr_command, csr6); 1232 LMC_CSR_WRITE (sc, csr_command, csr6);
1235 1233
1236 dev->flags &= ~IFF_RUNNING;
1237
1238 sc->stats.rx_missed_errors += 1234 sc->stats.rx_missed_errors +=
1239 LMC_CSR_READ (sc, csr_missed_frames) & 0xffff; 1235 LMC_CSR_READ (sc, csr_missed_frames) & 0xffff;
1240 1236
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 463c789cdc77..fb10a2db63ad 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -754,7 +754,7 @@ typedef struct {
754 u8 zero; 754 u8 zero;
755 u8 ssidLen; 755 u8 ssidLen;
756 u8 ssid[32]; 756 u8 ssid[32];
757 u16 rssi; 757 u16 dBm;
758#define CAP_ESS (1<<0) 758#define CAP_ESS (1<<0)
759#define CAP_IBSS (1<<1) 759#define CAP_IBSS (1<<1)
760#define CAP_PRIVACY (1<<4) 760#define CAP_PRIVACY (1<<4)
@@ -1125,6 +1125,9 @@ static int micsetup(struct airo_info *ai);
1125static int encapsulate(struct airo_info *ai, etherHead *pPacket, MICBuffer *buffer, int len); 1125static int encapsulate(struct airo_info *ai, etherHead *pPacket, MICBuffer *buffer, int len);
1126static int decapsulate(struct airo_info *ai, MICBuffer *mic, etherHead *pPacket, u16 payLen); 1126static int decapsulate(struct airo_info *ai, MICBuffer *mic, etherHead *pPacket, u16 payLen);
1127 1127
1128static u8 airo_rssi_to_dbm (tdsRssiEntry *rssi_rid, u8 rssi);
1129static u8 airo_dbm_to_pct (tdsRssiEntry *rssi_rid, u8 dbm);
1130
1128#include <linux/crypto.h> 1131#include <linux/crypto.h>
1129#endif 1132#endif
1130 1133
@@ -1713,6 +1716,7 @@ static int readBSSListRid(struct airo_info *ai, int first,
1713 list->fh.dwell = le16_to_cpu(list->fh.dwell); 1716 list->fh.dwell = le16_to_cpu(list->fh.dwell);
1714 list->dsChannel = le16_to_cpu(list->dsChannel); 1717 list->dsChannel = le16_to_cpu(list->dsChannel);
1715 list->atimWindow = le16_to_cpu(list->atimWindow); 1718 list->atimWindow = le16_to_cpu(list->atimWindow);
1719 list->dBm = le16_to_cpu(list->dBm);
1716 return rc; 1720 return rc;
1717} 1721}
1718 1722
@@ -3245,7 +3249,10 @@ badrx:
3245 wstats.level = 0x100 - apriv->rssi[hdr.rssi[1]].rssidBm; 3249 wstats.level = 0x100 - apriv->rssi[hdr.rssi[1]].rssidBm;
3246 else 3250 else
3247 wstats.level = (hdr.rssi[1] + 321) / 2; 3251 wstats.level = (hdr.rssi[1] + 321) / 2;
3248 wstats.updated = 3; 3252 wstats.noise = apriv->wstats.qual.noise;
3253 wstats.updated = IW_QUAL_LEVEL_UPDATED
3254 | IW_QUAL_QUAL_UPDATED
3255 | IW_QUAL_NOISE_UPDATED;
3249 /* Update spy records */ 3256 /* Update spy records */
3250 wireless_spy_update(dev, sa, &wstats); 3257 wireless_spy_update(dev, sa, &wstats);
3251 } 3258 }
@@ -3588,7 +3595,10 @@ void mpi_receive_802_11 (struct airo_info *ai)
3588 wstats.level = 0x100 - ai->rssi[hdr.rssi[1]].rssidBm; 3595 wstats.level = 0x100 - ai->rssi[hdr.rssi[1]].rssidBm;
3589 else 3596 else
3590 wstats.level = (hdr.rssi[1] + 321) / 2; 3597 wstats.level = (hdr.rssi[1] + 321) / 2;
3591 wstats.updated = 3; 3598 wstats.noise = ai->wstats.qual.noise;
3599 wstats.updated = IW_QUAL_QUAL_UPDATED
3600 | IW_QUAL_LEVEL_UPDATED
3601 | IW_QUAL_NOISE_UPDATED;
3592 /* Update spy records */ 3602 /* Update spy records */
3593 wireless_spy_update(ai->dev, sa, &wstats); 3603 wireless_spy_update(ai->dev, sa, &wstats);
3594 } 3604 }
@@ -3679,7 +3689,7 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
3679 status = PC4500_readrid(ai,RID_RSSI,&rssi_rid,sizeof(rssi_rid),lock); 3689 status = PC4500_readrid(ai,RID_RSSI,&rssi_rid,sizeof(rssi_rid),lock);
3680 if ( status == SUCCESS ) { 3690 if ( status == SUCCESS ) {
3681 if (ai->rssi || (ai->rssi = kmalloc(512, GFP_KERNEL)) != NULL) 3691 if (ai->rssi || (ai->rssi = kmalloc(512, GFP_KERNEL)) != NULL)
3682 memcpy(ai->rssi, (u8*)&rssi_rid + 2, 512); 3692 memcpy(ai->rssi, (u8*)&rssi_rid + 2, 512); /* Skip RID length member */
3683 } 3693 }
3684 else { 3694 else {
3685 if (ai->rssi) { 3695 if (ai->rssi) {
@@ -5348,7 +5358,7 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
5348 (int)BSSList_rid.bssid[5], 5358 (int)BSSList_rid.bssid[5],
5349 (int)BSSList_rid.ssidLen, 5359 (int)BSSList_rid.ssidLen,
5350 BSSList_rid.ssid, 5360 BSSList_rid.ssid,
5351 (int)BSSList_rid.rssi); 5361 (int)BSSList_rid.dBm);
5352 ptr += sprintf(ptr, " channel = %d %s %s %s %s\n", 5362 ptr += sprintf(ptr, " channel = %d %s %s %s %s\n",
5353 (int)BSSList_rid.dsChannel, 5363 (int)BSSList_rid.dsChannel,
5354 BSSList_rid.cap & CAP_ESS ? "ESS" : "", 5364 BSSList_rid.cap & CAP_ESS ? "ESS" : "",
@@ -5593,6 +5603,29 @@ static void __exit airo_cleanup_module( void )
5593 * would not work at all... - Jean II 5603 * would not work at all... - Jean II
5594 */ 5604 */
5595 5605
5606static u8 airo_rssi_to_dbm (tdsRssiEntry *rssi_rid, u8 rssi)
5607{
5608 if( !rssi_rid )
5609 return 0;
5610
5611 return (0x100 - rssi_rid[rssi].rssidBm);
5612}
5613
5614static u8 airo_dbm_to_pct (tdsRssiEntry *rssi_rid, u8 dbm)
5615{
5616 int i;
5617
5618 if( !rssi_rid )
5619 return 0;
5620
5621 for( i = 0; i < 256; i++ )
5622 if (rssi_rid[i].rssidBm == dbm)
5623 return rssi_rid[i].rssipct;
5624
5625 return 0;
5626}
5627
5628
5596static int airo_get_quality (StatusRid *status_rid, CapabilityRid *cap_rid) 5629static int airo_get_quality (StatusRid *status_rid, CapabilityRid *cap_rid)
5597{ 5630{
5598 int quality = 0; 5631 int quality = 0;
@@ -6443,11 +6476,29 @@ static int airo_get_range(struct net_device *dev,
6443 } 6476 }
6444 range->num_frequency = k; 6477 range->num_frequency = k;
6445 6478
6479 range->sensitivity = 65535;
6480
6446 /* Hum... Should put the right values there */ 6481 /* Hum... Should put the right values there */
6447 range->max_qual.qual = airo_get_max_quality(&cap_rid); 6482 if (local->rssi)
6448 range->max_qual.level = 0x100 - 120; /* -120 dBm */ 6483 range->max_qual.qual = 100; /* % */
6484 else
6485 range->max_qual.qual = airo_get_max_quality(&cap_rid);
6486 range->max_qual.level = 0; /* 0 means we use dBm */
6449 range->max_qual.noise = 0; 6487 range->max_qual.noise = 0;
6450 range->sensitivity = 65535; 6488 range->max_qual.updated = 0;
6489
6490 /* Experimental measurements - boundary 11/5.5 Mb/s */
6491 /* Note : with or without the (local->rssi), results
6492 * are somewhat different. - Jean II */
6493 if (local->rssi) {
6494 range->avg_qual.qual = 50; /* % */
6495 range->avg_qual.level = 186; /* -70 dBm */
6496 } else {
6497 range->avg_qual.qual = airo_get_avg_quality(&cap_rid);
6498 range->avg_qual.level = 176; /* -80 dBm */
6499 }
6500 range->avg_qual.noise = 0;
6501 range->avg_qual.updated = 0;
6451 6502
6452 for(i = 0 ; i < 8 ; i++) { 6503 for(i = 0 ; i < 8 ; i++) {
6453 range->bitrate[i] = cap_rid.supportedRates[i] * 500000; 6504 range->bitrate[i] = cap_rid.supportedRates[i] * 500000;
@@ -6508,15 +6559,6 @@ static int airo_get_range(struct net_device *dev,
6508 range->max_retry = 65535; 6559 range->max_retry = 65535;
6509 range->min_r_time = 1024; 6560 range->min_r_time = 1024;
6510 range->max_r_time = 65535 * 1024; 6561 range->max_r_time = 65535 * 1024;
6511 /* Experimental measurements - boundary 11/5.5 Mb/s */
6512 /* Note : with or without the (local->rssi), results
6513 * are somewhat different. - Jean II */
6514 range->avg_qual.qual = airo_get_avg_quality(&cap_rid);
6515 if (local->rssi)
6516 range->avg_qual.level = 186; /* -70 dBm */
6517 else
6518 range->avg_qual.level = 176; /* -80 dBm */
6519 range->avg_qual.noise = 0;
6520 6562
6521 /* Event capability (kernel + driver) */ 6563 /* Event capability (kernel + driver) */
6522 range->event_capa[0] = (IW_EVENT_CAPA_K_0 | 6564 range->event_capa[0] = (IW_EVENT_CAPA_K_0 |
@@ -6676,12 +6718,18 @@ static int airo_get_aplist(struct net_device *dev,
6676 loseSync = 0; 6718 loseSync = 0;
6677 memcpy(address[i].sa_data, BSSList.bssid, ETH_ALEN); 6719 memcpy(address[i].sa_data, BSSList.bssid, ETH_ALEN);
6678 address[i].sa_family = ARPHRD_ETHER; 6720 address[i].sa_family = ARPHRD_ETHER;
6679 if (local->rssi) 6721 if (local->rssi) {
6680 qual[i].level = 0x100 - local->rssi[BSSList.rssi].rssidBm; 6722 qual[i].level = 0x100 - BSSList.dBm;
6681 else 6723 qual[i].qual = airo_dbm_to_pct( local->rssi, BSSList.dBm );
6682 qual[i].level = (BSSList.rssi + 321) / 2; 6724 qual[i].updated = IW_QUAL_QUAL_UPDATED;
6683 qual[i].qual = qual[i].noise = 0; 6725 } else {
6684 qual[i].updated = 2; 6726 qual[i].level = (BSSList.dBm + 321) / 2;
6727 qual[i].qual = 0;
6728 qual[i].updated = IW_QUAL_QUAL_INVALID;
6729 }
6730 qual[i].noise = local->wstats.qual.noise;
6731 qual[i].updated = IW_QUAL_LEVEL_UPDATED
6732 | IW_QUAL_NOISE_UPDATED;
6685 if (BSSList.index == 0xffff) 6733 if (BSSList.index == 0xffff)
6686 break; 6734 break;
6687 } 6735 }
@@ -6760,7 +6808,7 @@ static int airo_set_scan(struct net_device *dev,
6760static inline char *airo_translate_scan(struct net_device *dev, 6808static inline char *airo_translate_scan(struct net_device *dev,
6761 char *current_ev, 6809 char *current_ev,
6762 char *end_buf, 6810 char *end_buf,
6763 BSSListRid *list) 6811 BSSListRid *bss)
6764{ 6812{
6765 struct airo_info *ai = dev->priv; 6813 struct airo_info *ai = dev->priv;
6766 struct iw_event iwe; /* Temporary buffer */ 6814 struct iw_event iwe; /* Temporary buffer */
@@ -6771,22 +6819,22 @@ static inline char *airo_translate_scan(struct net_device *dev,
6771 /* First entry *MUST* be the AP MAC address */ 6819 /* First entry *MUST* be the AP MAC address */
6772 iwe.cmd = SIOCGIWAP; 6820 iwe.cmd = SIOCGIWAP;
6773 iwe.u.ap_addr.sa_family = ARPHRD_ETHER; 6821 iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
6774 memcpy(iwe.u.ap_addr.sa_data, list->bssid, ETH_ALEN); 6822 memcpy(iwe.u.ap_addr.sa_data, bss->bssid, ETH_ALEN);
6775 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_ADDR_LEN); 6823 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_ADDR_LEN);
6776 6824
6777 /* Other entries will be displayed in the order we give them */ 6825 /* Other entries will be displayed in the order we give them */
6778 6826
6779 /* Add the ESSID */ 6827 /* Add the ESSID */
6780 iwe.u.data.length = list->ssidLen; 6828 iwe.u.data.length = bss->ssidLen;
6781 if(iwe.u.data.length > 32) 6829 if(iwe.u.data.length > 32)
6782 iwe.u.data.length = 32; 6830 iwe.u.data.length = 32;
6783 iwe.cmd = SIOCGIWESSID; 6831 iwe.cmd = SIOCGIWESSID;
6784 iwe.u.data.flags = 1; 6832 iwe.u.data.flags = 1;
6785 current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, list->ssid); 6833 current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, bss->ssid);
6786 6834
6787 /* Add mode */ 6835 /* Add mode */
6788 iwe.cmd = SIOCGIWMODE; 6836 iwe.cmd = SIOCGIWMODE;
6789 capabilities = le16_to_cpu(list->cap); 6837 capabilities = le16_to_cpu(bss->cap);
6790 if(capabilities & (CAP_ESS | CAP_IBSS)) { 6838 if(capabilities & (CAP_ESS | CAP_IBSS)) {
6791 if(capabilities & CAP_ESS) 6839 if(capabilities & CAP_ESS)
6792 iwe.u.mode = IW_MODE_MASTER; 6840 iwe.u.mode = IW_MODE_MASTER;
@@ -6797,19 +6845,25 @@ static inline char *airo_translate_scan(struct net_device *dev,
6797 6845
6798 /* Add frequency */ 6846 /* Add frequency */
6799 iwe.cmd = SIOCGIWFREQ; 6847 iwe.cmd = SIOCGIWFREQ;
6800 iwe.u.freq.m = le16_to_cpu(list->dsChannel); 6848 iwe.u.freq.m = le16_to_cpu(bss->dsChannel);
6801 iwe.u.freq.m = frequency_list[iwe.u.freq.m] * 100000; 6849 iwe.u.freq.m = frequency_list[iwe.u.freq.m] * 100000;
6802 iwe.u.freq.e = 1; 6850 iwe.u.freq.e = 1;
6803 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_FREQ_LEN); 6851 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_FREQ_LEN);
6804 6852
6805 /* Add quality statistics */ 6853 /* Add quality statistics */
6806 iwe.cmd = IWEVQUAL; 6854 iwe.cmd = IWEVQUAL;
6807 if (ai->rssi) 6855 if (ai->rssi) {
6808 iwe.u.qual.level = 0x100 - ai->rssi[list->rssi].rssidBm; 6856 iwe.u.qual.level = 0x100 - bss->dBm;
6809 else 6857 iwe.u.qual.qual = airo_dbm_to_pct( ai->rssi, bss->dBm );
6810 iwe.u.qual.level = (list->rssi + 321) / 2; 6858 iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED;
6811 iwe.u.qual.noise = 0; 6859 } else {
6812 iwe.u.qual.qual = 0; 6860 iwe.u.qual.level = (bss->dBm + 321) / 2;
6861 iwe.u.qual.qual = 0;
6862 iwe.u.qual.updated = IW_QUAL_QUAL_INVALID;
6863 }
6864 iwe.u.qual.noise = ai->wstats.qual.noise;
6865 iwe.u.qual.updated = IW_QUAL_LEVEL_UPDATED
6866 | IW_QUAL_NOISE_UPDATED;
6813 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_QUAL_LEN); 6867 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_QUAL_LEN);
6814 6868
6815 /* Add encryption capability */ 6869 /* Add encryption capability */
@@ -6819,7 +6873,7 @@ static inline char *airo_translate_scan(struct net_device *dev,
6819 else 6873 else
6820 iwe.u.data.flags = IW_ENCODE_DISABLED; 6874 iwe.u.data.flags = IW_ENCODE_DISABLED;
6821 iwe.u.data.length = 0; 6875 iwe.u.data.length = 0;
6822 current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, list->ssid); 6876 current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, bss->ssid);
6823 6877
6824 /* Rate : stuffing multiple values in a single event require a bit 6878 /* Rate : stuffing multiple values in a single event require a bit
6825 * more of magic - Jean II */ 6879 * more of magic - Jean II */
@@ -6831,10 +6885,10 @@ static inline char *airo_translate_scan(struct net_device *dev,
6831 /* Max 8 values */ 6885 /* Max 8 values */
6832 for(i = 0 ; i < 8 ; i++) { 6886 for(i = 0 ; i < 8 ; i++) {
6833 /* NULL terminated */ 6887 /* NULL terminated */
6834 if(list->rates[i] == 0) 6888 if(bss->rates[i] == 0)
6835 break; 6889 break;
6836 /* Bit rate given in 500 kb/s units (+ 0x80) */ 6890 /* Bit rate given in 500 kb/s units (+ 0x80) */
6837 iwe.u.bitrate.value = ((list->rates[i] & 0x7f) * 500000); 6891 iwe.u.bitrate.value = ((bss->rates[i] & 0x7f) * 500000);
6838 /* Add new value to event */ 6892 /* Add new value to event */
6839 current_val = iwe_stream_add_value(current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN); 6893 current_val = iwe_stream_add_value(current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
6840 } 6894 }
@@ -7153,18 +7207,22 @@ static void airo_read_wireless_stats(struct airo_info *local)
7153 /* The status */ 7207 /* The status */
7154 local->wstats.status = status_rid.mode; 7208 local->wstats.status = status_rid.mode;
7155 7209
7156 /* Signal quality and co. But where is the noise level ??? */ 7210 /* Signal quality and co */
7157 local->wstats.qual.qual = airo_get_quality(&status_rid, &cap_rid); 7211 if (local->rssi) {
7158 if (local->rssi) 7212 local->wstats.qual.level = airo_rssi_to_dbm( local->rssi, status_rid.sigQuality );
7159 local->wstats.qual.level = 0x100 - local->rssi[status_rid.sigQuality].rssidBm; 7213 /* normalizedSignalStrength appears to be a percentage */
7160 else 7214 local->wstats.qual.qual = status_rid.normalizedSignalStrength;
7215 } else {
7161 local->wstats.qual.level = (status_rid.normalizedSignalStrength + 321) / 2; 7216 local->wstats.qual.level = (status_rid.normalizedSignalStrength + 321) / 2;
7217 local->wstats.qual.qual = airo_get_quality(&status_rid, &cap_rid);
7218 }
7219 local->wstats.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED;
7162 if (status_rid.len >= 124) { 7220 if (status_rid.len >= 124) {
7163 local->wstats.qual.noise = 256 - status_rid.noisedBm; 7221 local->wstats.qual.noise = 0x100 - status_rid.noisedBm;
7164 local->wstats.qual.updated = 7; 7222 local->wstats.qual.updated |= IW_QUAL_NOISE_UPDATED;
7165 } else { 7223 } else {
7166 local->wstats.qual.noise = 0; 7224 local->wstats.qual.noise = 0;
7167 local->wstats.qual.updated = 3; 7225 local->wstats.qual.updated |= IW_QUAL_NOISE_INVALID;
7168 } 7226 }
7169 7227
7170 /* Packets discarded in the wireless adapter due to wireless 7228 /* Packets discarded in the wireless adapter due to wireless
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index a91b507e0a7a..a4ed28d9c783 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -321,6 +321,7 @@ static struct {
321 { 0x01bf, 0x3302, NULL, ATMEL_FW_TYPE_502E, "Belkin F5D6020-V2" }, 321 { 0x01bf, 0x3302, NULL, ATMEL_FW_TYPE_502E, "Belkin F5D6020-V2" },
322 { 0, 0, "BT/Voyager 1020 Laptop Adapter", ATMEL_FW_TYPE_502, "BT Voyager 1020" }, 322 { 0, 0, "BT/Voyager 1020 Laptop Adapter", ATMEL_FW_TYPE_502, "BT Voyager 1020" },
323 { 0, 0, "IEEE 802.11b/Wireless LAN PC Card", ATMEL_FW_TYPE_502, "Siemens Gigaset PC Card II" }, 323 { 0, 0, "IEEE 802.11b/Wireless LAN PC Card", ATMEL_FW_TYPE_502, "Siemens Gigaset PC Card II" },
324 { 0, 0, "IEEE 802.11b/Wireless LAN Card S", ATMEL_FW_TYPE_504_2958, "Siemens Gigaset PC Card II" },
324 { 0, 0, "CNet/CNWLC 11Mbps Wireless PC Card V-5", ATMEL_FW_TYPE_502E, "CNet CNWLC-811ARL" }, 325 { 0, 0, "CNet/CNWLC 11Mbps Wireless PC Card V-5", ATMEL_FW_TYPE_502E, "CNet CNWLC-811ARL" },
325 { 0, 0, "Wireless/PC_CARD", ATMEL_FW_TYPE_502D, "Planet WL-3552" }, 326 { 0, 0, "Wireless/PC_CARD", ATMEL_FW_TYPE_502D, "Planet WL-3552" },
326 { 0, 0, "OEM/11Mbps Wireless LAN PC Card V-3", ATMEL_FW_TYPE_502, "OEM 11Mbps WLAN PCMCIA Card" }, 327 { 0, 0, "OEM/11Mbps Wireless LAN PC Card V-3", ATMEL_FW_TYPE_502, "OEM 11Mbps WLAN PCMCIA Card" },
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index a3a32430ae9d..b1078baa1d5e 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -492,6 +492,9 @@ EXPORT_SYMBOL(orinoco_debug);
492static int suppress_linkstatus; /* = 0 */ 492static int suppress_linkstatus; /* = 0 */
493module_param(suppress_linkstatus, bool, 0644); 493module_param(suppress_linkstatus, bool, 0644);
494MODULE_PARM_DESC(suppress_linkstatus, "Don't log link status changes"); 494MODULE_PARM_DESC(suppress_linkstatus, "Don't log link status changes");
495static int ignore_disconnect; /* = 0 */
496module_param(ignore_disconnect, int, 0644);
497MODULE_PARM_DESC(ignore_disconnect, "Don't report lost link to the network layer");
495 498
496/********************************************************************/ 499/********************************************************************/
497/* Compile time configuration and compatibility stuff */ 500/* Compile time configuration and compatibility stuff */
@@ -604,7 +607,6 @@ struct hermes_rx_descriptor {
604static int orinoco_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 607static int orinoco_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
605static int __orinoco_program_rids(struct net_device *dev); 608static int __orinoco_program_rids(struct net_device *dev);
606static void __orinoco_set_multicast_list(struct net_device *dev); 609static void __orinoco_set_multicast_list(struct net_device *dev);
607static int orinoco_debug_dump_recs(struct net_device *dev);
608 610
609/********************************************************************/ 611/********************************************************************/
610/* Internal helper functions */ 612/* Internal helper functions */
@@ -655,7 +657,7 @@ static int orinoco_open(struct net_device *dev)
655 return err; 657 return err;
656} 658}
657 659
658int orinoco_stop(struct net_device *dev) 660static int orinoco_stop(struct net_device *dev)
659{ 661{
660 struct orinoco_private *priv = netdev_priv(dev); 662 struct orinoco_private *priv = netdev_priv(dev);
661 int err = 0; 663 int err = 0;
@@ -686,7 +688,7 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev)
686 struct orinoco_private *priv = netdev_priv(dev); 688 struct orinoco_private *priv = netdev_priv(dev);
687 hermes_t *hw = &priv->hw; 689 hermes_t *hw = &priv->hw;
688 struct iw_statistics *wstats = &priv->wstats; 690 struct iw_statistics *wstats = &priv->wstats;
689 int err = 0; 691 int err;
690 unsigned long flags; 692 unsigned long flags;
691 693
692 if (! netif_device_present(dev)) { 694 if (! netif_device_present(dev)) {
@@ -695,9 +697,21 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev)
695 return NULL; /* FIXME: Can we do better than this? */ 697 return NULL; /* FIXME: Can we do better than this? */
696 } 698 }
697 699
700 /* If busy, return the old stats. Returning NULL may cause
701 * the interface to disappear from /proc/net/wireless */
698 if (orinoco_lock(priv, &flags) != 0) 702 if (orinoco_lock(priv, &flags) != 0)
699 return NULL; /* FIXME: Erg, we've been signalled, how 703 return wstats;
700 * do we propagate this back up? */ 704
705 /* We can't really wait for the tallies inquiry command to
706 * complete, so we just use the previous results and trigger
707 * a new tallies inquiry command for next time - Jean II */
708 /* FIXME: Really we should wait for the inquiry to come back -
709 * as it is the stats we give don't make a whole lot of sense.
710 * Unfortunately, it's not clear how to do that within the
711 * wireless extensions framework: I think we're in user
712 * context, but a lock seems to be held by the time we get in
713 * here so we're not safe to sleep here. */
714 hermes_inquire(hw, HERMES_INQ_TALLIES);
701 715
702 if (priv->iw_mode == IW_MODE_ADHOC) { 716 if (priv->iw_mode == IW_MODE_ADHOC) {
703 memset(&wstats->qual, 0, sizeof(wstats->qual)); 717 memset(&wstats->qual, 0, sizeof(wstats->qual));
@@ -716,25 +730,16 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev)
716 730
717 err = HERMES_READ_RECORD(hw, USER_BAP, 731 err = HERMES_READ_RECORD(hw, USER_BAP,
718 HERMES_RID_COMMSQUALITY, &cq); 732 HERMES_RID_COMMSQUALITY, &cq);
719 733
720 wstats->qual.qual = (int)le16_to_cpu(cq.qual); 734 if (!err) {
721 wstats->qual.level = (int)le16_to_cpu(cq.signal) - 0x95; 735 wstats->qual.qual = (int)le16_to_cpu(cq.qual);
722 wstats->qual.noise = (int)le16_to_cpu(cq.noise) - 0x95; 736 wstats->qual.level = (int)le16_to_cpu(cq.signal) - 0x95;
723 wstats->qual.updated = 7; 737 wstats->qual.noise = (int)le16_to_cpu(cq.noise) - 0x95;
738 wstats->qual.updated = 7;
739 }
724 } 740 }
725 741
726 /* We can't really wait for the tallies inquiry command to
727 * complete, so we just use the previous results and trigger
728 * a new tallies inquiry command for next time - Jean II */
729 /* FIXME: We're in user context (I think?), so we should just
730 wait for the tallies to come through */
731 err = hermes_inquire(hw, HERMES_INQ_TALLIES);
732
733 orinoco_unlock(priv, &flags); 742 orinoco_unlock(priv, &flags);
734
735 if (err)
736 return NULL;
737
738 return wstats; 743 return wstats;
739} 744}
740 745
@@ -1275,9 +1280,10 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw)
1275 len = sizeof(tallies); 1280 len = sizeof(tallies);
1276 } 1281 }
1277 1282
1278 /* Read directly the data (no seek) */ 1283 err = hermes_bap_pread(hw, IRQ_BAP, &tallies, len,
1279 hermes_read_words(hw, HERMES_DATA1, (void *) &tallies, 1284 infofid, sizeof(info));
1280 len / 2); /* FIXME: blech! */ 1285 if (err)
1286 break;
1281 1287
1282 /* Increment our various counters */ 1288 /* Increment our various counters */
1283 /* wstats->discard.nwid - no wrong BSSID stuff */ 1289 /* wstats->discard.nwid - no wrong BSSID stuff */
@@ -1307,8 +1313,10 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw)
1307 break; 1313 break;
1308 } 1314 }
1309 1315
1310 hermes_read_words(hw, HERMES_DATA1, (void *) &linkstatus, 1316 err = hermes_bap_pread(hw, IRQ_BAP, &linkstatus, len,
1311 len / 2); 1317 infofid, sizeof(info));
1318 if (err)
1319 break;
1312 newstatus = le16_to_cpu(linkstatus.linkstatus); 1320 newstatus = le16_to_cpu(linkstatus.linkstatus);
1313 1321
1314 connected = (newstatus == HERMES_LINKSTATUS_CONNECTED) 1322 connected = (newstatus == HERMES_LINKSTATUS_CONNECTED)
@@ -1317,7 +1325,7 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw)
1317 1325
1318 if (connected) 1326 if (connected)
1319 netif_carrier_on(dev); 1327 netif_carrier_on(dev);
1320 else 1328 else if (!ignore_disconnect)
1321 netif_carrier_off(dev); 1329 netif_carrier_off(dev);
1322 1330
1323 if (newstatus != priv->last_linkstatus) 1331 if (newstatus != priv->last_linkstatus)
@@ -1350,6 +1358,8 @@ int __orinoco_up(struct net_device *dev)
1350 struct hermes *hw = &priv->hw; 1358 struct hermes *hw = &priv->hw;
1351 int err; 1359 int err;
1352 1360
1361 netif_carrier_off(dev); /* just to make sure */
1362
1353 err = __orinoco_program_rids(dev); 1363 err = __orinoco_program_rids(dev);
1354 if (err) { 1364 if (err) {
1355 printk(KERN_ERR "%s: Error %d configuring card\n", 1365 printk(KERN_ERR "%s: Error %d configuring card\n",
@@ -1413,7 +1423,7 @@ int orinoco_reinit_firmware(struct net_device *dev)
1413 return err; 1423 return err;
1414 1424
1415 err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); 1425 err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);
1416 if (err == -EIO) { 1426 if (err == -EIO && priv->nicbuf_size > TX_NICBUF_SIZE_BUG) {
1417 /* Try workaround for old Symbol firmware bug */ 1427 /* Try workaround for old Symbol firmware bug */
1418 printk(KERN_WARNING "%s: firmware ALLOC bug detected " 1428 printk(KERN_WARNING "%s: firmware ALLOC bug detected "
1419 "(old Symbol firmware?). Trying to work around... ", 1429 "(old Symbol firmware?). Trying to work around... ",
@@ -1610,17 +1620,15 @@ static int __orinoco_program_rids(struct net_device *dev)
1610 return err; 1620 return err;
1611 } 1621 }
1612 /* Set the channel/frequency */ 1622 /* Set the channel/frequency */
1613 if (priv->channel == 0) { 1623 if (priv->channel != 0 && priv->iw_mode != IW_MODE_INFRA) {
1614 printk(KERN_DEBUG "%s: Channel is 0 in __orinoco_program_rids()\n", dev->name); 1624 err = hermes_write_wordrec(hw, USER_BAP,
1615 if (priv->createibss) 1625 HERMES_RID_CNFOWNCHANNEL,
1616 priv->channel = 10; 1626 priv->channel);
1617 } 1627 if (err) {
1618 err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFOWNCHANNEL, 1628 printk(KERN_ERR "%s: Error %d setting channel %d\n",
1619 priv->channel); 1629 dev->name, err, priv->channel);
1620 if (err) { 1630 return err;
1621 printk(KERN_ERR "%s: Error %d setting channel\n", 1631 }
1622 dev->name, err);
1623 return err;
1624 } 1632 }
1625 1633
1626 if (priv->has_ibss) { 1634 if (priv->has_ibss) {
@@ -1916,7 +1924,7 @@ static void orinoco_reset(struct net_device *dev)
1916{ 1924{
1917 struct orinoco_private *priv = netdev_priv(dev); 1925 struct orinoco_private *priv = netdev_priv(dev);
1918 struct hermes *hw = &priv->hw; 1926 struct hermes *hw = &priv->hw;
1919 int err = 0; 1927 int err;
1920 unsigned long flags; 1928 unsigned long flags;
1921 1929
1922 if (orinoco_lock(priv, &flags) != 0) 1930 if (orinoco_lock(priv, &flags) != 0)
@@ -1938,20 +1946,20 @@ static void orinoco_reset(struct net_device *dev)
1938 1946
1939 orinoco_unlock(priv, &flags); 1947 orinoco_unlock(priv, &flags);
1940 1948
1941 if (priv->hard_reset) 1949 if (priv->hard_reset) {
1942 err = (*priv->hard_reset)(priv); 1950 err = (*priv->hard_reset)(priv);
1943 if (err) { 1951 if (err) {
1944 printk(KERN_ERR "%s: orinoco_reset: Error %d " 1952 printk(KERN_ERR "%s: orinoco_reset: Error %d "
1945 "performing hard reset\n", dev->name, err); 1953 "performing hard reset\n", dev->name, err);
1946 /* FIXME: shutdown of some sort */ 1954 goto disable;
1947 return; 1955 }
1948 } 1956 }
1949 1957
1950 err = orinoco_reinit_firmware(dev); 1958 err = orinoco_reinit_firmware(dev);
1951 if (err) { 1959 if (err) {
1952 printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n", 1960 printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n",
1953 dev->name, err); 1961 dev->name, err);
1954 return; 1962 goto disable;
1955 } 1963 }
1956 1964
1957 spin_lock_irq(&priv->lock); /* This has to be called from user context */ 1965 spin_lock_irq(&priv->lock); /* This has to be called from user context */
@@ -1972,6 +1980,10 @@ static void orinoco_reset(struct net_device *dev)
1972 spin_unlock_irq(&priv->lock); 1980 spin_unlock_irq(&priv->lock);
1973 1981
1974 return; 1982 return;
1983 disable:
1984 hermes_set_irqmask(hw, 0);
1985 netif_device_detach(dev);
1986 printk(KERN_ERR "%s: Device has been disabled!\n", dev->name);
1975} 1987}
1976 1988
1977/********************************************************************/ 1989/********************************************************************/
@@ -2056,7 +2068,7 @@ irqreturn_t orinoco_interrupt(int irq, void *dev_id, struct pt_regs *regs)
2056 if (events & HERMES_EV_ALLOC) 2068 if (events & HERMES_EV_ALLOC)
2057 __orinoco_ev_alloc(dev, hw); 2069 __orinoco_ev_alloc(dev, hw);
2058 2070
2059 hermes_write_regn(hw, EVACK, events); 2071 hermes_write_regn(hw, EVACK, evstat);
2060 2072
2061 evstat = hermes_read_regn(hw, EVSTAT); 2073 evstat = hermes_read_regn(hw, EVSTAT);
2062 events = evstat & hw->inten; 2074 events = evstat & hw->inten;
@@ -2215,6 +2227,8 @@ static int determine_firmware(struct net_device *dev)
2215 firmver >= 0x31000; 2227 firmver >= 0x31000;
2216 priv->has_preamble = (firmver >= 0x20000); 2228 priv->has_preamble = (firmver >= 0x20000);
2217 priv->ibss_port = 4; 2229 priv->ibss_port = 4;
2230 priv->broken_disableport = (firmver == 0x25013) ||
2231 (firmver >= 0x30000 && firmver <= 0x31000);
2218 /* Tested with Intel firmware : 0x20015 => Jean II */ 2232 /* Tested with Intel firmware : 0x20015 => Jean II */
2219 /* Tested with 3Com firmware : 0x15012 & 0x22001 => Jean II */ 2233 /* Tested with 3Com firmware : 0x15012 & 0x22001 => Jean II */
2220 break; 2234 break;
@@ -2267,7 +2281,7 @@ static int orinoco_init(struct net_device *dev)
2267 priv->nicbuf_size = IEEE802_11_FRAME_LEN + ETH_HLEN; 2281 priv->nicbuf_size = IEEE802_11_FRAME_LEN + ETH_HLEN;
2268 2282
2269 /* Initialize the firmware */ 2283 /* Initialize the firmware */
2270 err = hermes_init(hw); 2284 err = orinoco_reinit_firmware(dev);
2271 if (err != 0) { 2285 if (err != 0) {
2272 printk(KERN_ERR "%s: failed to initialize firmware (err = %d)\n", 2286 printk(KERN_ERR "%s: failed to initialize firmware (err = %d)\n",
2273 dev->name, err); 2287 dev->name, err);
@@ -2400,31 +2414,12 @@ static int orinoco_init(struct net_device *dev)
2400 /* By default use IEEE/IBSS ad-hoc mode if we have it */ 2414 /* By default use IEEE/IBSS ad-hoc mode if we have it */
2401 priv->prefer_port3 = priv->has_port3 && (! priv->has_ibss); 2415 priv->prefer_port3 = priv->has_port3 && (! priv->has_ibss);
2402 set_port_type(priv); 2416 set_port_type(priv);
2403 priv->channel = 10; /* default channel, more-or-less arbitrary */ 2417 priv->channel = 0; /* use firmware default */
2404 2418
2405 priv->promiscuous = 0; 2419 priv->promiscuous = 0;
2406 priv->wep_on = 0; 2420 priv->wep_on = 0;
2407 priv->tx_key = 0; 2421 priv->tx_key = 0;
2408 2422
2409 err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);
2410 if (err == -EIO) {
2411 /* Try workaround for old Symbol firmware bug */
2412 printk(KERN_WARNING "%s: firmware ALLOC bug detected "
2413 "(old Symbol firmware?). Trying to work around... ",
2414 dev->name);
2415
2416 priv->nicbuf_size = TX_NICBUF_SIZE_BUG;
2417 err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);
2418 if (err)
2419 printk("failed!\n");
2420 else
2421 printk("ok.\n");
2422 }
2423 if (err) {
2424 printk("%s: Error %d allocating Tx buffer\n", dev->name, err);
2425 goto out;
2426 }
2427
2428 /* Make the hardware available, as long as it hasn't been 2423 /* Make the hardware available, as long as it hasn't been
2429 * removed elsewhere (e.g. by PCMCIA hot unplug) */ 2424 * removed elsewhere (e.g. by PCMCIA hot unplug) */
2430 spin_lock_irq(&priv->lock); 2425 spin_lock_irq(&priv->lock);
@@ -2450,7 +2445,7 @@ struct net_device *alloc_orinocodev(int sizeof_card,
2450 priv = netdev_priv(dev); 2445 priv = netdev_priv(dev);
2451 priv->ndev = dev; 2446 priv->ndev = dev;
2452 if (sizeof_card) 2447 if (sizeof_card)
2453 priv->card = (void *)((unsigned long)netdev_priv(dev) 2448 priv->card = (void *)((unsigned long)priv
2454 + sizeof(struct orinoco_private)); 2449 + sizeof(struct orinoco_private));
2455 else 2450 else
2456 priv->card = NULL; 2451 priv->card = NULL;
@@ -2555,6 +2550,7 @@ static int orinoco_hw_get_essid(struct orinoco_private *priv, int *active,
2555 } 2550 }
2556 2551
2557 len = le16_to_cpu(essidbuf.len); 2552 len = le16_to_cpu(essidbuf.len);
2553 BUG_ON(len > IW_ESSID_MAX_SIZE);
2558 2554
2559 memset(buf, 0, IW_ESSID_MAX_SIZE+1); 2555 memset(buf, 0, IW_ESSID_MAX_SIZE+1);
2560 memcpy(buf, p, len); 2556 memcpy(buf, p, len);
@@ -2923,13 +2919,14 @@ static int orinoco_ioctl_setessid(struct net_device *dev, struct iw_point *erq)
2923 memset(&essidbuf, 0, sizeof(essidbuf)); 2919 memset(&essidbuf, 0, sizeof(essidbuf));
2924 2920
2925 if (erq->flags) { 2921 if (erq->flags) {
2926 if (erq->length > IW_ESSID_MAX_SIZE) 2922 /* iwconfig includes the NUL in the specified length */
2923 if (erq->length > IW_ESSID_MAX_SIZE+1)
2927 return -E2BIG; 2924 return -E2BIG;
2928 2925
2929 if (copy_from_user(&essidbuf, erq->pointer, erq->length)) 2926 if (copy_from_user(&essidbuf, erq->pointer, erq->length))
2930 return -EFAULT; 2927 return -EFAULT;
2931 2928
2932 essidbuf[erq->length] = '\0'; 2929 essidbuf[IW_ESSID_MAX_SIZE] = '\0';
2933 } 2930 }
2934 2931
2935 if (orinoco_lock(priv, &flags) != 0) 2932 if (orinoco_lock(priv, &flags) != 0)
@@ -3855,7 +3852,6 @@ orinoco_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
3855 { SIOCIWFIRSTPRIV + 0x7, 0, 3852 { SIOCIWFIRSTPRIV + 0x7, 0,
3856 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 3853 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
3857 "get_ibssport" }, 3854 "get_ibssport" },
3858 { SIOCIWLASTPRIV, 0, 0, "dump_recs" },
3859 }; 3855 };
3860 3856
3861 wrq->u.data.length = sizeof(privtab) / sizeof(privtab[0]); 3857 wrq->u.data.length = sizeof(privtab) / sizeof(privtab[0]);
@@ -3943,14 +3939,6 @@ orinoco_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
3943 err = orinoco_ioctl_getibssport(dev, wrq); 3939 err = orinoco_ioctl_getibssport(dev, wrq);
3944 break; 3940 break;
3945 3941
3946 case SIOCIWLASTPRIV:
3947 err = orinoco_debug_dump_recs(dev);
3948 if (err)
3949 printk(KERN_ERR "%s: Unable to dump records (%d)\n",
3950 dev->name, err);
3951 break;
3952
3953
3954 default: 3942 default:
3955 err = -EOPNOTSUPP; 3943 err = -EOPNOTSUPP;
3956 } 3944 }
@@ -3964,187 +3952,6 @@ orinoco_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
3964 return err; 3952 return err;
3965} 3953}
3966 3954
3967struct {
3968 u16 rid;
3969 char *name;
3970 int displaytype;
3971#define DISPLAY_WORDS 0
3972#define DISPLAY_BYTES 1
3973#define DISPLAY_STRING 2
3974#define DISPLAY_XSTRING 3
3975} record_table[] = {
3976#define DEBUG_REC(name,type) { HERMES_RID_##name, #name, DISPLAY_##type }
3977 DEBUG_REC(CNFPORTTYPE,WORDS),
3978 DEBUG_REC(CNFOWNMACADDR,BYTES),
3979 DEBUG_REC(CNFDESIREDSSID,STRING),
3980 DEBUG_REC(CNFOWNCHANNEL,WORDS),
3981 DEBUG_REC(CNFOWNSSID,STRING),
3982 DEBUG_REC(CNFOWNATIMWINDOW,WORDS),
3983 DEBUG_REC(CNFSYSTEMSCALE,WORDS),
3984 DEBUG_REC(CNFMAXDATALEN,WORDS),
3985 DEBUG_REC(CNFPMENABLED,WORDS),
3986 DEBUG_REC(CNFPMEPS,WORDS),
3987 DEBUG_REC(CNFMULTICASTRECEIVE,WORDS),
3988 DEBUG_REC(CNFMAXSLEEPDURATION,WORDS),
3989 DEBUG_REC(CNFPMHOLDOVERDURATION,WORDS),
3990 DEBUG_REC(CNFOWNNAME,STRING),
3991 DEBUG_REC(CNFOWNDTIMPERIOD,WORDS),
3992 DEBUG_REC(CNFMULTICASTPMBUFFERING,WORDS),
3993 DEBUG_REC(CNFWEPENABLED_AGERE,WORDS),
3994 DEBUG_REC(CNFMANDATORYBSSID_SYMBOL,WORDS),
3995 DEBUG_REC(CNFWEPDEFAULTKEYID,WORDS),
3996 DEBUG_REC(CNFDEFAULTKEY0,BYTES),
3997 DEBUG_REC(CNFDEFAULTKEY1,BYTES),
3998 DEBUG_REC(CNFMWOROBUST_AGERE,WORDS),
3999 DEBUG_REC(CNFDEFAULTKEY2,BYTES),
4000 DEBUG_REC(CNFDEFAULTKEY3,BYTES),
4001 DEBUG_REC(CNFWEPFLAGS_INTERSIL,WORDS),
4002 DEBUG_REC(CNFWEPKEYMAPPINGTABLE,WORDS),
4003 DEBUG_REC(CNFAUTHENTICATION,WORDS),
4004 DEBUG_REC(CNFMAXASSOCSTA,WORDS),
4005 DEBUG_REC(CNFKEYLENGTH_SYMBOL,WORDS),
4006 DEBUG_REC(CNFTXCONTROL,WORDS),
4007 DEBUG_REC(CNFROAMINGMODE,WORDS),
4008 DEBUG_REC(CNFHOSTAUTHENTICATION,WORDS),
4009 DEBUG_REC(CNFRCVCRCERROR,WORDS),
4010 DEBUG_REC(CNFMMLIFE,WORDS),
4011 DEBUG_REC(CNFALTRETRYCOUNT,WORDS),
4012 DEBUG_REC(CNFBEACONINT,WORDS),
4013 DEBUG_REC(CNFAPPCFINFO,WORDS),
4014 DEBUG_REC(CNFSTAPCFINFO,WORDS),
4015 DEBUG_REC(CNFPRIORITYQUSAGE,WORDS),
4016 DEBUG_REC(CNFTIMCTRL,WORDS),
4017 DEBUG_REC(CNFTHIRTY2TALLY,WORDS),
4018 DEBUG_REC(CNFENHSECURITY,WORDS),
4019 DEBUG_REC(CNFGROUPADDRESSES,BYTES),
4020 DEBUG_REC(CNFCREATEIBSS,WORDS),
4021 DEBUG_REC(CNFFRAGMENTATIONTHRESHOLD,WORDS),
4022 DEBUG_REC(CNFRTSTHRESHOLD,WORDS),
4023 DEBUG_REC(CNFTXRATECONTROL,WORDS),
4024 DEBUG_REC(CNFPROMISCUOUSMODE,WORDS),
4025 DEBUG_REC(CNFBASICRATES_SYMBOL,WORDS),
4026 DEBUG_REC(CNFPREAMBLE_SYMBOL,WORDS),
4027 DEBUG_REC(CNFSHORTPREAMBLE,WORDS),
4028 DEBUG_REC(CNFWEPKEYS_AGERE,BYTES),
4029 DEBUG_REC(CNFEXCLUDELONGPREAMBLE,WORDS),
4030 DEBUG_REC(CNFTXKEY_AGERE,WORDS),
4031 DEBUG_REC(CNFAUTHENTICATIONRSPTO,WORDS),
4032 DEBUG_REC(CNFBASICRATES,WORDS),
4033 DEBUG_REC(CNFSUPPORTEDRATES,WORDS),
4034 DEBUG_REC(CNFTICKTIME,WORDS),
4035 DEBUG_REC(CNFSCANREQUEST,WORDS),
4036 DEBUG_REC(CNFJOINREQUEST,WORDS),
4037 DEBUG_REC(CNFAUTHENTICATESTATION,WORDS),
4038 DEBUG_REC(CNFCHANNELINFOREQUEST,WORDS),
4039 DEBUG_REC(MAXLOADTIME,WORDS),
4040 DEBUG_REC(DOWNLOADBUFFER,WORDS),
4041 DEBUG_REC(PRIID,WORDS),
4042 DEBUG_REC(PRISUPRANGE,WORDS),
4043 DEBUG_REC(CFIACTRANGES,WORDS),
4044 DEBUG_REC(NICSERNUM,XSTRING),
4045 DEBUG_REC(NICID,WORDS),
4046 DEBUG_REC(MFISUPRANGE,WORDS),
4047 DEBUG_REC(CFISUPRANGE,WORDS),
4048 DEBUG_REC(CHANNELLIST,WORDS),
4049 DEBUG_REC(REGULATORYDOMAINS,WORDS),
4050 DEBUG_REC(TEMPTYPE,WORDS),
4051/* DEBUG_REC(CIS,BYTES), */
4052 DEBUG_REC(STAID,WORDS),
4053 DEBUG_REC(CURRENTSSID,STRING),
4054 DEBUG_REC(CURRENTBSSID,BYTES),
4055 DEBUG_REC(COMMSQUALITY,WORDS),
4056 DEBUG_REC(CURRENTTXRATE,WORDS),
4057 DEBUG_REC(CURRENTBEACONINTERVAL,WORDS),
4058 DEBUG_REC(CURRENTSCALETHRESHOLDS,WORDS),
4059 DEBUG_REC(PROTOCOLRSPTIME,WORDS),
4060 DEBUG_REC(SHORTRETRYLIMIT,WORDS),
4061 DEBUG_REC(LONGRETRYLIMIT,WORDS),
4062 DEBUG_REC(MAXTRANSMITLIFETIME,WORDS),
4063 DEBUG_REC(MAXRECEIVELIFETIME,WORDS),
4064 DEBUG_REC(CFPOLLABLE,WORDS),
4065 DEBUG_REC(AUTHENTICATIONALGORITHMS,WORDS),
4066 DEBUG_REC(PRIVACYOPTIONIMPLEMENTED,WORDS),
4067 DEBUG_REC(OWNMACADDR,BYTES),
4068 DEBUG_REC(SCANRESULTSTABLE,WORDS),
4069 DEBUG_REC(PHYTYPE,WORDS),
4070 DEBUG_REC(CURRENTCHANNEL,WORDS),
4071 DEBUG_REC(CURRENTPOWERSTATE,WORDS),
4072 DEBUG_REC(CCAMODE,WORDS),
4073 DEBUG_REC(SUPPORTEDDATARATES,WORDS),
4074 DEBUG_REC(BUILDSEQ,BYTES),
4075 DEBUG_REC(FWID,XSTRING)
4076#undef DEBUG_REC
4077};
4078
4079#define DEBUG_LTV_SIZE 128
4080
4081static int orinoco_debug_dump_recs(struct net_device *dev)
4082{
4083 struct orinoco_private *priv = netdev_priv(dev);
4084 hermes_t *hw = &priv->hw;
4085 u8 *val8;
4086 u16 *val16;
4087 int i,j;
4088 u16 length;
4089 int err;
4090
4091 /* I'm not sure: we might have a lock here, so we'd better go
4092 atomic, just in case. */
4093 val8 = kmalloc(DEBUG_LTV_SIZE + 2, GFP_ATOMIC);
4094 if (! val8)
4095 return -ENOMEM;
4096 val16 = (u16 *)val8;
4097
4098 for (i = 0; i < ARRAY_SIZE(record_table); i++) {
4099 u16 rid = record_table[i].rid;
4100 int len;
4101
4102 memset(val8, 0, DEBUG_LTV_SIZE + 2);
4103
4104 err = hermes_read_ltv(hw, USER_BAP, rid, DEBUG_LTV_SIZE,
4105 &length, val8);
4106 if (err) {
4107 DEBUG(0, "Error %d reading RID 0x%04x\n", err, rid);
4108 continue;
4109 }
4110 val16 = (u16 *)val8;
4111 if (length == 0)
4112 continue;
4113
4114 printk(KERN_DEBUG "%-15s (0x%04x): length=%d (%d bytes)\tvalue=",
4115 record_table[i].name,
4116 rid, length, (length-1)*2);
4117 len = min(((int)length-1)*2, DEBUG_LTV_SIZE);
4118
4119 switch (record_table[i].displaytype) {
4120 case DISPLAY_WORDS:
4121 for (j = 0; j < len / 2; j++)
4122 printk("%04X-", le16_to_cpu(val16[j]));
4123 break;
4124
4125 case DISPLAY_BYTES:
4126 default:
4127 for (j = 0; j < len; j++)
4128 printk("%02X:", val8[j]);
4129 break;
4130
4131 case DISPLAY_STRING:
4132 len = min(len, le16_to_cpu(val16[0])+2);
4133 val8[len] = '\0';
4134 printk("\"%s\"", (char *)&val16[1]);
4135 break;
4136
4137 case DISPLAY_XSTRING:
4138 printk("'%s'", (char *)val8);
4139 }
4140
4141 printk("\n");
4142 }
4143
4144 kfree(val8);
4145
4146 return 0;
4147}
4148 3955
4149/********************************************************************/ 3956/********************************************************************/
4150/* Debugging */ 3957/* Debugging */
@@ -4218,7 +4025,6 @@ EXPORT_SYMBOL(free_orinocodev);
4218 4025
4219EXPORT_SYMBOL(__orinoco_up); 4026EXPORT_SYMBOL(__orinoco_up);
4220EXPORT_SYMBOL(__orinoco_down); 4027EXPORT_SYMBOL(__orinoco_down);
4221EXPORT_SYMBOL(orinoco_stop);
4222EXPORT_SYMBOL(orinoco_reinit_firmware); 4028EXPORT_SYMBOL(orinoco_reinit_firmware);
4223 4029
4224EXPORT_SYMBOL(orinoco_interrupt); 4030EXPORT_SYMBOL(orinoco_interrupt);
diff --git a/drivers/net/wireless/orinoco.h b/drivers/net/wireless/orinoco.h
index 13e42c2afb27..f749b50d1088 100644
--- a/drivers/net/wireless/orinoco.h
+++ b/drivers/net/wireless/orinoco.h
@@ -119,7 +119,6 @@ extern struct net_device *alloc_orinocodev(int sizeof_card,
119extern void free_orinocodev(struct net_device *dev); 119extern void free_orinocodev(struct net_device *dev);
120extern int __orinoco_up(struct net_device *dev); 120extern int __orinoco_up(struct net_device *dev);
121extern int __orinoco_down(struct net_device *dev); 121extern int __orinoco_down(struct net_device *dev);
122extern int orinoco_stop(struct net_device *dev);
123extern int orinoco_reinit_firmware(struct net_device *dev); 122extern int orinoco_reinit_firmware(struct net_device *dev);
124extern irqreturn_t orinoco_interrupt(int irq, void * dev_id, struct pt_regs *regs); 123extern irqreturn_t orinoco_interrupt(int irq, void * dev_id, struct pt_regs *regs);
125 124
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index 55720dc6ec43..745a14183634 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -62,7 +62,7 @@ static int task_exit_notify(struct notifier_block * self, unsigned long val, voi
62 /* To avoid latency problems, we only process the current CPU, 62 /* To avoid latency problems, we only process the current CPU,
63 * hoping that most samples for the task are on this CPU 63 * hoping that most samples for the task are on this CPU
64 */ 64 */
65 sync_buffer(_smp_processor_id()); 65 sync_buffer(raw_smp_processor_id());
66 return 0; 66 return 0;
67} 67}
68 68
@@ -86,7 +86,7 @@ static int munmap_notify(struct notifier_block * self, unsigned long val, void *
86 /* To avoid latency problems, we only process the current CPU, 86 /* To avoid latency problems, we only process the current CPU,
87 * hoping that most samples for the task are on this CPU 87 * hoping that most samples for the task are on this CPU
88 */ 88 */
89 sync_buffer(_smp_processor_id()); 89 sync_buffer(raw_smp_processor_id());
90 return 0; 90 return 0;
91 } 91 }
92 92
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
index 9e9dab7fe86a..30af105271a2 100644
--- a/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * CompactPCI Hot Plug Driver 2 * CompactPCI Hot Plug Driver
3 * 3 *
4 * Copyright (C) 2002 SOMA Networks, Inc. 4 * Copyright (C) 2002,2005 SOMA Networks, Inc.
5 * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com) 5 * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com)
6 * Copyright (C) 2001 IBM Corp. 6 * Copyright (C) 2001 IBM Corp.
7 * 7 *
@@ -45,10 +45,10 @@
45 45
46#define dbg(format, arg...) \ 46#define dbg(format, arg...) \
47 do { \ 47 do { \
48 if(cpci_debug) \ 48 if (cpci_debug) \
49 printk (KERN_DEBUG "%s: " format "\n", \ 49 printk (KERN_DEBUG "%s: " format "\n", \
50 MY_NAME , ## arg); \ 50 MY_NAME , ## arg); \
51 } while(0) 51 } while (0)
52#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) 52#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
53#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) 53#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
54#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg) 54#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
@@ -111,10 +111,8 @@ enable_slot(struct hotplug_slot *hotplug_slot)
111 111
112 dbg("%s - physical_slot = %s", __FUNCTION__, hotplug_slot->name); 112 dbg("%s - physical_slot = %s", __FUNCTION__, hotplug_slot->name);
113 113
114 if(controller->ops->set_power) { 114 if (controller->ops->set_power)
115 retval = controller->ops->set_power(slot, 1); 115 retval = controller->ops->set_power(slot, 1);
116 }
117
118 return retval; 116 return retval;
119} 117}
120 118
@@ -126,37 +124,41 @@ disable_slot(struct hotplug_slot *hotplug_slot)
126 124
127 dbg("%s - physical_slot = %s", __FUNCTION__, hotplug_slot->name); 125 dbg("%s - physical_slot = %s", __FUNCTION__, hotplug_slot->name);
128 126
127 down_write(&list_rwsem);
128
129 /* Unconfigure device */ 129 /* Unconfigure device */
130 dbg("%s - unconfiguring slot %s", 130 dbg("%s - unconfiguring slot %s",
131 __FUNCTION__, slot->hotplug_slot->name); 131 __FUNCTION__, slot->hotplug_slot->name);
132 if((retval = cpci_unconfigure_slot(slot))) { 132 if ((retval = cpci_unconfigure_slot(slot))) {
133 err("%s - could not unconfigure slot %s", 133 err("%s - could not unconfigure slot %s",
134 __FUNCTION__, slot->hotplug_slot->name); 134 __FUNCTION__, slot->hotplug_slot->name);
135 return retval; 135 goto disable_error;
136 } 136 }
137 dbg("%s - finished unconfiguring slot %s", 137 dbg("%s - finished unconfiguring slot %s",
138 __FUNCTION__, slot->hotplug_slot->name); 138 __FUNCTION__, slot->hotplug_slot->name);
139 139
140 /* Clear EXT (by setting it) */ 140 /* Clear EXT (by setting it) */
141 if(cpci_clear_ext(slot)) { 141 if (cpci_clear_ext(slot)) {
142 err("%s - could not clear EXT for slot %s", 142 err("%s - could not clear EXT for slot %s",
143 __FUNCTION__, slot->hotplug_slot->name); 143 __FUNCTION__, slot->hotplug_slot->name);
144 retval = -ENODEV; 144 retval = -ENODEV;
145 goto disable_error;
145 } 146 }
146 cpci_led_on(slot); 147 cpci_led_on(slot);
147 148
148 if(controller->ops->set_power) { 149 if (controller->ops->set_power)
149 retval = controller->ops->set_power(slot, 0); 150 if ((retval = controller->ops->set_power(slot, 0)))
150 } 151 goto disable_error;
151 152
152 if(update_adapter_status(slot->hotplug_slot, 0)) { 153 if (update_adapter_status(slot->hotplug_slot, 0))
153 warn("failure to update adapter file"); 154 warn("failure to update adapter file");
154 }
155 155
156 if(slot->extracting) { 156 if (slot->extracting) {
157 slot->extracting = 0; 157 slot->extracting = 0;
158 atomic_dec(&extracting); 158 atomic_dec(&extracting);
159 } 159 }
160disable_error:
161 up_write(&list_rwsem);
160 return retval; 162 return retval;
161} 163}
162 164
@@ -165,9 +167,8 @@ cpci_get_power_status(struct slot *slot)
165{ 167{
166 u8 power = 1; 168 u8 power = 1;
167 169
168 if(controller->ops->get_power) { 170 if (controller->ops->get_power)
169 power = controller->ops->get_power(slot); 171 power = controller->ops->get_power(slot);
170 }
171 return power; 172 return power;
172} 173}
173 174
@@ -216,6 +217,8 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
216 kfree(slot->hotplug_slot->info); 217 kfree(slot->hotplug_slot->info);
217 kfree(slot->hotplug_slot->name); 218 kfree(slot->hotplug_slot->name);
218 kfree(slot->hotplug_slot); 219 kfree(slot->hotplug_slot);
220 if (slot->dev)
221 pci_dev_put(slot->dev);
219 kfree(slot); 222 kfree(slot);
220} 223}
221 224
@@ -237,9 +240,8 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last)
237 int status = -ENOMEM; 240 int status = -ENOMEM;
238 int i; 241 int i;
239 242
240 if(!(controller && bus)) { 243 if (!(controller && bus))
241 return -ENODEV; 244 return -ENODEV;
242 }
243 245
244 /* 246 /*
245 * Create a structure for each slot, and register that slot 247 * Create a structure for each slot, and register that slot
@@ -316,32 +318,30 @@ int
316cpci_hp_unregister_bus(struct pci_bus *bus) 318cpci_hp_unregister_bus(struct pci_bus *bus)
317{ 319{
318 struct slot *slot; 320 struct slot *slot;
319 struct list_head *tmp; 321 struct slot *tmp;
320 struct list_head *next; 322 int status = 0;
321 int status;
322 323
323 down_write(&list_rwsem); 324 down_write(&list_rwsem);
324 if(!slots) { 325 if (!slots) {
325 up_write(&list_rwsem); 326 up_write(&list_rwsem);
326 return -1; 327 return -1;
327 } 328 }
328 list_for_each_safe(tmp, next, &slot_list) { 329 list_for_each_entry_safe(slot, tmp, &slot_list, slot_list) {
329 slot = list_entry(tmp, struct slot, slot_list); 330 if (slot->bus == bus) {
330 if(slot->bus == bus) { 331 list_del(&slot->slot_list);
332 slots--;
333
331 dbg("deregistering slot %s", slot->hotplug_slot->name); 334 dbg("deregistering slot %s", slot->hotplug_slot->name);
332 status = pci_hp_deregister(slot->hotplug_slot); 335 status = pci_hp_deregister(slot->hotplug_slot);
333 if(status) { 336 if (status) {
334 err("pci_hp_deregister failed with error %d", 337 err("pci_hp_deregister failed with error %d",
335 status); 338 status);
336 return status; 339 break;
337 } 340 }
338
339 list_del(&slot->slot_list);
340 slots--;
341 } 341 }
342 } 342 }
343 up_write(&list_rwsem); 343 up_write(&list_rwsem);
344 return 0; 344 return status;
345} 345}
346 346
347/* This is the interrupt mode interrupt handler */ 347/* This is the interrupt mode interrupt handler */
@@ -351,7 +351,7 @@ cpci_hp_intr(int irq, void *data, struct pt_regs *regs)
351 dbg("entered cpci_hp_intr"); 351 dbg("entered cpci_hp_intr");
352 352
353 /* Check to see if it was our interrupt */ 353 /* Check to see if it was our interrupt */
354 if((controller->irq_flags & SA_SHIRQ) && 354 if ((controller->irq_flags & SA_SHIRQ) &&
355 !controller->ops->check_irq(controller->dev_id)) { 355 !controller->ops->check_irq(controller->dev_id)) {
356 dbg("exited cpci_hp_intr, not our interrupt"); 356 dbg("exited cpci_hp_intr, not our interrupt");
357 return IRQ_NONE; 357 return IRQ_NONE;
@@ -373,38 +373,30 @@ cpci_hp_intr(int irq, void *data, struct pt_regs *regs)
373 * INS bits of the cold-inserted devices. 373 * INS bits of the cold-inserted devices.
374 */ 374 */
375static int 375static int
376init_slots(void) 376init_slots(int clear_ins)
377{ 377{
378 struct slot *slot; 378 struct slot *slot;
379 struct list_head *tmp;
380 struct pci_dev* dev; 379 struct pci_dev* dev;
381 380
382 dbg("%s - enter", __FUNCTION__); 381 dbg("%s - enter", __FUNCTION__);
383 down_read(&list_rwsem); 382 down_read(&list_rwsem);
384 if(!slots) { 383 if (!slots) {
385 up_read(&list_rwsem); 384 up_read(&list_rwsem);
386 return -1; 385 return -1;
387 } 386 }
388 list_for_each(tmp, &slot_list) { 387 list_for_each_entry(slot, &slot_list, slot_list) {
389 slot = list_entry(tmp, struct slot, slot_list);
390 dbg("%s - looking at slot %s", 388 dbg("%s - looking at slot %s",
391 __FUNCTION__, slot->hotplug_slot->name); 389 __FUNCTION__, slot->hotplug_slot->name);
392 if(cpci_check_and_clear_ins(slot)) { 390 if (clear_ins && cpci_check_and_clear_ins(slot))
393 dbg("%s - cleared INS for slot %s", 391 dbg("%s - cleared INS for slot %s",
394 __FUNCTION__, slot->hotplug_slot->name); 392 __FUNCTION__, slot->hotplug_slot->name);
395 dev = pci_find_slot(slot->bus->number, PCI_DEVFN(slot->number, 0)); 393 dev = pci_get_slot(slot->bus, PCI_DEVFN(slot->number, 0));
396 if(dev) { 394 if (dev) {
397 if(update_adapter_status(slot->hotplug_slot, 1)) { 395 if (update_adapter_status(slot->hotplug_slot, 1))
398 warn("failure to update adapter file"); 396 warn("failure to update adapter file");
399 } 397 if (update_latch_status(slot->hotplug_slot, 1))
400 if(update_latch_status(slot->hotplug_slot, 1)) { 398 warn("failure to update latch file");
401 warn("failure to update latch file"); 399 slot->dev = dev;
402 }
403 slot->dev = dev;
404 } else {
405 err("%s - no driver attached to device in slot %s",
406 __FUNCTION__, slot->hotplug_slot->name);
407 }
408 } 400 }
409 } 401 }
410 up_read(&list_rwsem); 402 up_read(&list_rwsem);
@@ -416,26 +408,28 @@ static int
416check_slots(void) 408check_slots(void)
417{ 409{
418 struct slot *slot; 410 struct slot *slot;
419 struct list_head *tmp;
420 int extracted; 411 int extracted;
421 int inserted; 412 int inserted;
422 u16 hs_csr; 413 u16 hs_csr;
423 414
424 down_read(&list_rwsem); 415 down_read(&list_rwsem);
425 if(!slots) { 416 if (!slots) {
426 up_read(&list_rwsem); 417 up_read(&list_rwsem);
427 err("no slots registered, shutting down"); 418 err("no slots registered, shutting down");
428 return -1; 419 return -1;
429 } 420 }
430 extracted = inserted = 0; 421 extracted = inserted = 0;
431 list_for_each(tmp, &slot_list) { 422 list_for_each_entry(slot, &slot_list, slot_list) {
432 slot = list_entry(tmp, struct slot, slot_list);
433 dbg("%s - looking at slot %s", 423 dbg("%s - looking at slot %s",
434 __FUNCTION__, slot->hotplug_slot->name); 424 __FUNCTION__, slot->hotplug_slot->name);
435 if(cpci_check_and_clear_ins(slot)) { 425 if (cpci_check_and_clear_ins(slot)) {
436 /* Some broken hardware (e.g. PLX 9054AB) asserts ENUM# twice... */ 426 /*
437 if(slot->dev) { 427 * Some broken hardware (e.g. PLX 9054AB) asserts
438 warn("slot %s already inserted", slot->hotplug_slot->name); 428 * ENUM# twice...
429 */
430 if (slot->dev) {
431 warn("slot %s already inserted",
432 slot->hotplug_slot->name);
439 inserted++; 433 inserted++;
440 continue; 434 continue;
441 } 435 }
@@ -452,7 +446,7 @@ check_slots(void)
452 /* Configure device */ 446 /* Configure device */
453 dbg("%s - configuring slot %s", 447 dbg("%s - configuring slot %s",
454 __FUNCTION__, slot->hotplug_slot->name); 448 __FUNCTION__, slot->hotplug_slot->name);
455 if(cpci_configure_slot(slot)) { 449 if (cpci_configure_slot(slot)) {
456 err("%s - could not configure slot %s", 450 err("%s - could not configure slot %s",
457 __FUNCTION__, slot->hotplug_slot->name); 451 __FUNCTION__, slot->hotplug_slot->name);
458 continue; 452 continue;
@@ -465,13 +459,11 @@ check_slots(void)
465 dbg("%s - slot %s HS_CSR (2) = %04x", 459 dbg("%s - slot %s HS_CSR (2) = %04x",
466 __FUNCTION__, slot->hotplug_slot->name, hs_csr); 460 __FUNCTION__, slot->hotplug_slot->name, hs_csr);
467 461
468 if(update_latch_status(slot->hotplug_slot, 1)) { 462 if (update_latch_status(slot->hotplug_slot, 1))
469 warn("failure to update latch file"); 463 warn("failure to update latch file");
470 }
471 464
472 if(update_adapter_status(slot->hotplug_slot, 1)) { 465 if (update_adapter_status(slot->hotplug_slot, 1))
473 warn("failure to update adapter file"); 466 warn("failure to update adapter file");
474 }
475 467
476 cpci_led_off(slot); 468 cpci_led_off(slot);
477 469
@@ -481,7 +473,7 @@ check_slots(void)
481 __FUNCTION__, slot->hotplug_slot->name, hs_csr); 473 __FUNCTION__, slot->hotplug_slot->name, hs_csr);
482 474
483 inserted++; 475 inserted++;
484 } else if(cpci_check_ext(slot)) { 476 } else if (cpci_check_ext(slot)) {
485 /* Process extraction request */ 477 /* Process extraction request */
486 dbg("%s - slot %s extracted", 478 dbg("%s - slot %s extracted",
487 __FUNCTION__, slot->hotplug_slot->name); 479 __FUNCTION__, slot->hotplug_slot->name);
@@ -491,27 +483,25 @@ check_slots(void)
491 dbg("%s - slot %s HS_CSR = %04x", 483 dbg("%s - slot %s HS_CSR = %04x",
492 __FUNCTION__, slot->hotplug_slot->name, hs_csr); 484 __FUNCTION__, slot->hotplug_slot->name, hs_csr);
493 485
494 if(!slot->extracting) { 486 if (!slot->extracting) {
495 if(update_latch_status(slot->hotplug_slot, 0)) { 487 if (update_latch_status(slot->hotplug_slot, 0)) {
496 warn("failure to update latch file"); 488 warn("failure to update latch file");
497
498 } 489 }
499 atomic_inc(&extracting);
500 slot->extracting = 1; 490 slot->extracting = 1;
491 atomic_inc(&extracting);
501 } 492 }
502 extracted++; 493 extracted++;
503 } else if(slot->extracting) { 494 } else if (slot->extracting) {
504 hs_csr = cpci_get_hs_csr(slot); 495 hs_csr = cpci_get_hs_csr(slot);
505 if(hs_csr == 0xffff) { 496 if (hs_csr == 0xffff) {
506 /* 497 /*
507 * Hmmm, we're likely hosed at this point, should we 498 * Hmmm, we're likely hosed at this point, should we
508 * bother trying to tell the driver or not? 499 * bother trying to tell the driver or not?
509 */ 500 */
510 err("card in slot %s was improperly removed", 501 err("card in slot %s was improperly removed",
511 slot->hotplug_slot->name); 502 slot->hotplug_slot->name);
512 if(update_adapter_status(slot->hotplug_slot, 0)) { 503 if (update_adapter_status(slot->hotplug_slot, 0))
513 warn("failure to update adapter file"); 504 warn("failure to update adapter file");
514 }
515 slot->extracting = 0; 505 slot->extracting = 0;
516 atomic_dec(&extracting); 506 atomic_dec(&extracting);
517 } 507 }
@@ -520,10 +510,9 @@ check_slots(void)
520 up_read(&list_rwsem); 510 up_read(&list_rwsem);
521 dbg("inserted=%d, extracted=%d, extracting=%d", 511 dbg("inserted=%d, extracted=%d, extracting=%d",
522 inserted, extracted, atomic_read(&extracting)); 512 inserted, extracted, atomic_read(&extracting));
523 if(inserted || extracted) { 513 if (inserted || extracted)
524 return extracted; 514 return extracted;
525 } 515 else if (!atomic_read(&extracting)) {
526 else if(!atomic_read(&extracting)) {
527 err("cannot find ENUM# source, shutting down"); 516 err("cannot find ENUM# source, shutting down");
528 return -1; 517 return -1;
529 } 518 }
@@ -541,12 +530,12 @@ event_thread(void *data)
541 unlock_kernel(); 530 unlock_kernel();
542 531
543 dbg("%s - event thread started", __FUNCTION__); 532 dbg("%s - event thread started", __FUNCTION__);
544 while(1) { 533 while (1) {
545 dbg("event thread sleeping"); 534 dbg("event thread sleeping");
546 down_interruptible(&event_semaphore); 535 down_interruptible(&event_semaphore);
547 dbg("event thread woken, thread_finished = %d", 536 dbg("event thread woken, thread_finished = %d",
548 thread_finished); 537 thread_finished);
549 if(thread_finished || signal_pending(current)) 538 if (thread_finished || signal_pending(current))
550 break; 539 break;
551 do { 540 do {
552 rc = check_slots(); 541 rc = check_slots();
@@ -558,7 +547,9 @@ event_thread(void *data)
558 thread_finished = 1; 547 thread_finished = 1;
559 break; 548 break;
560 } 549 }
561 } while(atomic_read(&extracting) != 0); 550 } while (atomic_read(&extracting) && !thread_finished);
551 if (thread_finished)
552 break;
562 553
563 /* Re-enable ENUM# interrupt */ 554 /* Re-enable ENUM# interrupt */
564 dbg("%s - re-enabling irq", __FUNCTION__); 555 dbg("%s - re-enabling irq", __FUNCTION__);
@@ -579,21 +570,21 @@ poll_thread(void *data)
579 daemonize("cpci_hp_polld"); 570 daemonize("cpci_hp_polld");
580 unlock_kernel(); 571 unlock_kernel();
581 572
582 while(1) { 573 while (1) {
583 if(thread_finished || signal_pending(current)) 574 if (thread_finished || signal_pending(current))
584 break; 575 break;
585 if(controller->ops->query_enum()) { 576 if (controller->ops->query_enum()) {
586 do { 577 do {
587 rc = check_slots(); 578 rc = check_slots();
588 if(rc > 0) { 579 if (rc > 0) {
589 /* Give userspace a chance to handle extraction */ 580 /* Give userspace a chance to handle extraction */
590 msleep(500); 581 msleep(500);
591 } else if(rc < 0) { 582 } else if (rc < 0) {
592 dbg("%s - error checking slots", __FUNCTION__); 583 dbg("%s - error checking slots", __FUNCTION__);
593 thread_finished = 1; 584 thread_finished = 1;
594 break; 585 break;
595 } 586 }
596 } while(atomic_read(&extracting) != 0); 587 } while (atomic_read(&extracting) && !thread_finished);
597 } 588 }
598 msleep(100); 589 msleep(100);
599 } 590 }
@@ -612,12 +603,11 @@ cpci_start_thread(void)
612 init_MUTEX_LOCKED(&thread_exit); 603 init_MUTEX_LOCKED(&thread_exit);
613 thread_finished = 0; 604 thread_finished = 0;
614 605
615 if(controller->irq) { 606 if (controller->irq)
616 pid = kernel_thread(event_thread, NULL, 0); 607 pid = kernel_thread(event_thread, NULL, 0);
617 } else { 608 else
618 pid = kernel_thread(poll_thread, NULL, 0); 609 pid = kernel_thread(poll_thread, NULL, 0);
619 } 610 if (pid < 0) {
620 if(pid < 0) {
621 err("Can't start up our thread"); 611 err("Can't start up our thread");
622 return -1; 612 return -1;
623 } 613 }
@@ -630,9 +620,8 @@ cpci_stop_thread(void)
630{ 620{
631 thread_finished = 1; 621 thread_finished = 1;
632 dbg("thread finish command given"); 622 dbg("thread finish command given");
633 if(controller->irq) { 623 if (controller->irq)
634 up(&event_semaphore); 624 up(&event_semaphore);
635 }
636 dbg("wait for thread to exit"); 625 dbg("wait for thread to exit");
637 down(&thread_exit); 626 down(&thread_exit);
638} 627}
@@ -642,45 +631,67 @@ cpci_hp_register_controller(struct cpci_hp_controller *new_controller)
642{ 631{
643 int status = 0; 632 int status = 0;
644 633
645 if(!controller) { 634 if (controller)
646 controller = new_controller; 635 return -1;
647 if(controller->irq) { 636 if (!(new_controller && new_controller->ops))
648 if(request_irq(controller->irq, 637 return -EINVAL;
649 cpci_hp_intr, 638 if (new_controller->irq) {
650 controller->irq_flags, 639 if (!(new_controller->ops->enable_irq &&
651 MY_NAME, controller->dev_id)) { 640 new_controller->ops->disable_irq))
652 err("Can't get irq %d for the hotplug cPCI controller", controller->irq); 641 status = -EINVAL;
653 status = -ENODEV; 642 if (request_irq(new_controller->irq,
654 } 643 cpci_hp_intr,
655 dbg("%s - acquired controller irq %d", __FUNCTION__, 644 new_controller->irq_flags,
656 controller->irq); 645 MY_NAME,
646 new_controller->dev_id)) {
647 err("Can't get irq %d for the hotplug cPCI controller",
648 new_controller->irq);
649 status = -ENODEV;
657 } 650 }
658 } else { 651 dbg("%s - acquired controller irq %d",
659 err("cPCI hotplug controller already registered"); 652 __FUNCTION__, new_controller->irq);
660 status = -1;
661 } 653 }
654 if (!status)
655 controller = new_controller;
662 return status; 656 return status;
663} 657}
664 658
659static void
660cleanup_slots(void)
661{
662 struct slot *slot;
663 struct slot *tmp;
664
665 /*
666 * Unregister all of our slots with the pci_hotplug subsystem,
667 * and free up all memory that we had allocated.
668 */
669 down_write(&list_rwsem);
670 if (!slots)
671 goto cleanup_null;
672 list_for_each_entry_safe(slot, tmp, &slot_list, slot_list) {
673 list_del(&slot->slot_list);
674 pci_hp_deregister(slot->hotplug_slot);
675 }
676cleanup_null:
677 up_write(&list_rwsem);
678 return;
679}
680
665int 681int
666cpci_hp_unregister_controller(struct cpci_hp_controller *old_controller) 682cpci_hp_unregister_controller(struct cpci_hp_controller *old_controller)
667{ 683{
668 int status = 0; 684 int status = 0;
669 685
670 if(controller) { 686 if (controller) {
671 if(atomic_read(&extracting) != 0) { 687 if (!thread_finished)
672 return -EBUSY;
673 }
674 if(!thread_finished) {
675 cpci_stop_thread(); 688 cpci_stop_thread();
676 } 689 if (controller->irq)
677 if(controller->irq) {
678 free_irq(controller->irq, controller->dev_id); 690 free_irq(controller->irq, controller->dev_id);
679 }
680 controller = NULL; 691 controller = NULL;
681 } else { 692 cleanup_slots();
693 } else
682 status = -ENODEV; 694 status = -ENODEV;
683 }
684 return status; 695 return status;
685} 696}
686 697
@@ -691,32 +702,28 @@ cpci_hp_start(void)
691 int status; 702 int status;
692 703
693 dbg("%s - enter", __FUNCTION__); 704 dbg("%s - enter", __FUNCTION__);
694 if(!controller) { 705 if (!controller)
695 return -ENODEV; 706 return -ENODEV;
696 }
697 707
698 down_read(&list_rwsem); 708 down_read(&list_rwsem);
699 if(list_empty(&slot_list)) { 709 if (list_empty(&slot_list)) {
700 up_read(&list_rwsem); 710 up_read(&list_rwsem);
701 return -ENODEV; 711 return -ENODEV;
702 } 712 }
703 up_read(&list_rwsem); 713 up_read(&list_rwsem);
704 714
705 if(first) { 715 status = init_slots(first);
706 status = init_slots(); 716 if (first)
707 if(status) {
708 return status;
709 }
710 first = 0; 717 first = 0;
711 } 718 if (status)
719 return status;
712 720
713 status = cpci_start_thread(); 721 status = cpci_start_thread();
714 if(status) { 722 if (status)
715 return status; 723 return status;
716 }
717 dbg("%s - thread started", __FUNCTION__); 724 dbg("%s - thread started", __FUNCTION__);
718 725
719 if(controller->irq) { 726 if (controller->irq) {
720 /* Start enum interrupt processing */ 727 /* Start enum interrupt processing */
721 dbg("%s - enabling irq", __FUNCTION__); 728 dbg("%s - enabling irq", __FUNCTION__);
722 controller->ops->enable_irq(); 729 controller->ops->enable_irq();
@@ -728,13 +735,9 @@ cpci_hp_start(void)
728int 735int
729cpci_hp_stop(void) 736cpci_hp_stop(void)
730{ 737{
731 if(!controller) { 738 if (!controller)
732 return -ENODEV; 739 return -ENODEV;
733 } 740 if (controller->irq) {
734 if(atomic_read(&extracting) != 0) {
735 return -EBUSY;
736 }
737 if(controller->irq) {
738 /* Stop enum interrupt processing */ 741 /* Stop enum interrupt processing */
739 dbg("%s - disabling irq", __FUNCTION__); 742 dbg("%s - disabling irq", __FUNCTION__);
740 controller->ops->disable_irq(); 743 controller->ops->disable_irq();
@@ -743,34 +746,6 @@ cpci_hp_stop(void)
743 return 0; 746 return 0;
744} 747}
745 748
746static void __exit
747cleanup_slots(void)
748{
749 struct list_head *tmp;
750 struct slot *slot;
751
752 /*
753 * Unregister all of our slots with the pci_hotplug subsystem,
754 * and free up all memory that we had allocated.
755 */
756 down_write(&list_rwsem);
757 if(!slots) {
758 goto null_cleanup;
759 }
760 list_for_each(tmp, &slot_list) {
761 slot = list_entry(tmp, struct slot, slot_list);
762 list_del(&slot->slot_list);
763 pci_hp_deregister(slot->hotplug_slot);
764 kfree(slot->hotplug_slot->info);
765 kfree(slot->hotplug_slot->name);
766 kfree(slot->hotplug_slot);
767 kfree(slot);
768 }
769 null_cleanup:
770 up_write(&list_rwsem);
771 return;
772}
773
774int __init 749int __init
775cpci_hotplug_init(int debug) 750cpci_hotplug_init(int debug)
776{ 751{
@@ -784,7 +759,8 @@ cpci_hotplug_exit(void)
784 /* 759 /*
785 * Clean everything up. 760 * Clean everything up.
786 */ 761 */
787 cleanup_slots(); 762 cpci_hp_stop();
763 cpci_hp_unregister_controller(controller);
788} 764}
789 765
790EXPORT_SYMBOL_GPL(cpci_hp_register_controller); 766EXPORT_SYMBOL_GPL(cpci_hp_register_controller);
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index 69eb4fc54f2f..225b5e551dd6 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * CompactPCI Hot Plug Driver PCI functions 2 * CompactPCI Hot Plug Driver PCI functions
3 * 3 *
4 * Copyright (C) 2002 by SOMA Networks, Inc. 4 * Copyright (C) 2002,2005 by SOMA Networks, Inc.
5 * 5 *
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
@@ -38,10 +38,10 @@ extern int cpci_debug;
38 38
39#define dbg(format, arg...) \ 39#define dbg(format, arg...) \
40 do { \ 40 do { \
41 if(cpci_debug) \ 41 if (cpci_debug) \
42 printk (KERN_DEBUG "%s: " format "\n", \ 42 printk (KERN_DEBUG "%s: " format "\n", \
43 MY_NAME , ## arg); \ 43 MY_NAME , ## arg); \
44 } while(0) 44 } while (0)
45#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) 45#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
46#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) 46#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
47#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg) 47#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
@@ -57,16 +57,15 @@ u8 cpci_get_attention_status(struct slot* slot)
57 hs_cap = pci_bus_find_capability(slot->bus, 57 hs_cap = pci_bus_find_capability(slot->bus,
58 slot->devfn, 58 slot->devfn,
59 PCI_CAP_ID_CHSWP); 59 PCI_CAP_ID_CHSWP);
60 if(!hs_cap) { 60 if (!hs_cap)
61 return 0; 61 return 0;
62 }
63 62
64 if(pci_bus_read_config_word(slot->bus, 63 if (pci_bus_read_config_word(slot->bus,
65 slot->devfn, 64 slot->devfn,
66 hs_cap + 2, 65 hs_cap + 2,
67 &hs_csr)) { 66 &hs_csr))
68 return 0; 67 return 0;
69 } 68
70 return hs_csr & 0x0008 ? 1 : 0; 69 return hs_csr & 0x0008 ? 1 : 0;
71} 70}
72 71
@@ -78,27 +77,22 @@ int cpci_set_attention_status(struct slot* slot, int status)
78 hs_cap = pci_bus_find_capability(slot->bus, 77 hs_cap = pci_bus_find_capability(slot->bus,
79 slot->devfn, 78 slot->devfn,
80 PCI_CAP_ID_CHSWP); 79 PCI_CAP_ID_CHSWP);
81 if(!hs_cap) { 80 if (!hs_cap)
82 return 0; 81 return 0;
83 } 82 if (pci_bus_read_config_word(slot->bus,
84
85 if(pci_bus_read_config_word(slot->bus,
86 slot->devfn, 83 slot->devfn,
87 hs_cap + 2, 84 hs_cap + 2,
88 &hs_csr)) { 85 &hs_csr))
89 return 0; 86 return 0;
90 } 87 if (status)
91 if(status) {
92 hs_csr |= HS_CSR_LOO; 88 hs_csr |= HS_CSR_LOO;
93 } else { 89 else
94 hs_csr &= ~HS_CSR_LOO; 90 hs_csr &= ~HS_CSR_LOO;
95 } 91 if (pci_bus_write_config_word(slot->bus,
96 if(pci_bus_write_config_word(slot->bus,
97 slot->devfn, 92 slot->devfn,
98 hs_cap + 2, 93 hs_cap + 2,
99 hs_csr)) { 94 hs_csr))
100 return 0; 95 return 0;
101 }
102 return 1; 96 return 1;
103} 97}
104 98
@@ -110,16 +104,13 @@ u16 cpci_get_hs_csr(struct slot* slot)
110 hs_cap = pci_bus_find_capability(slot->bus, 104 hs_cap = pci_bus_find_capability(slot->bus,
111 slot->devfn, 105 slot->devfn,
112 PCI_CAP_ID_CHSWP); 106 PCI_CAP_ID_CHSWP);
113 if(!hs_cap) { 107 if (!hs_cap)
114 return 0xFFFF; 108 return 0xFFFF;
115 } 109 if (pci_bus_read_config_word(slot->bus,
116
117 if(pci_bus_read_config_word(slot->bus,
118 slot->devfn, 110 slot->devfn,
119 hs_cap + 2, 111 hs_cap + 2,
120 &hs_csr)) { 112 &hs_csr))
121 return 0xFFFF; 113 return 0xFFFF;
122 }
123 return hs_csr; 114 return hs_csr;
124} 115}
125 116
@@ -132,24 +123,22 @@ int cpci_check_and_clear_ins(struct slot* slot)
132 hs_cap = pci_bus_find_capability(slot->bus, 123 hs_cap = pci_bus_find_capability(slot->bus,
133 slot->devfn, 124 slot->devfn,
134 PCI_CAP_ID_CHSWP); 125 PCI_CAP_ID_CHSWP);
135 if(!hs_cap) { 126 if (!hs_cap)
136 return 0; 127 return 0;
137 } 128 if (pci_bus_read_config_word(slot->bus,
138 if(pci_bus_read_config_word(slot->bus,
139 slot->devfn, 129 slot->devfn,
140 hs_cap + 2, 130 hs_cap + 2,
141 &hs_csr)) { 131 &hs_csr))
142 return 0; 132 return 0;
143 } 133 if (hs_csr & HS_CSR_INS) {
144 if(hs_csr & HS_CSR_INS) {
145 /* Clear INS (by setting it) */ 134 /* Clear INS (by setting it) */
146 if(pci_bus_write_config_word(slot->bus, 135 if (pci_bus_write_config_word(slot->bus,
147 slot->devfn, 136 slot->devfn,
148 hs_cap + 2, 137 hs_cap + 2,
149 hs_csr)) { 138 hs_csr))
150 ins = 0; 139 ins = 0;
151 } 140 else
152 ins = 1; 141 ins = 1;
153 } 142 }
154 return ins; 143 return ins;
155} 144}
@@ -163,18 +152,15 @@ int cpci_check_ext(struct slot* slot)
163 hs_cap = pci_bus_find_capability(slot->bus, 152 hs_cap = pci_bus_find_capability(slot->bus,
164 slot->devfn, 153 slot->devfn,
165 PCI_CAP_ID_CHSWP); 154 PCI_CAP_ID_CHSWP);
166 if(!hs_cap) { 155 if (!hs_cap)
167 return 0; 156 return 0;
168 } 157 if (pci_bus_read_config_word(slot->bus,
169 if(pci_bus_read_config_word(slot->bus,
170 slot->devfn, 158 slot->devfn,
171 hs_cap + 2, 159 hs_cap + 2,
172 &hs_csr)) { 160 &hs_csr))
173 return 0; 161 return 0;
174 } 162 if (hs_csr & HS_CSR_EXT)
175 if(hs_csr & HS_CSR_EXT) {
176 ext = 1; 163 ext = 1;
177 }
178 return ext; 164 return ext;
179} 165}
180 166
@@ -186,23 +172,20 @@ int cpci_clear_ext(struct slot* slot)
186 hs_cap = pci_bus_find_capability(slot->bus, 172 hs_cap = pci_bus_find_capability(slot->bus,
187 slot->devfn, 173 slot->devfn,
188 PCI_CAP_ID_CHSWP); 174 PCI_CAP_ID_CHSWP);
189 if(!hs_cap) { 175 if (!hs_cap)
190 return -ENODEV; 176 return -ENODEV;
191 } 177 if (pci_bus_read_config_word(slot->bus,
192 if(pci_bus_read_config_word(slot->bus,
193 slot->devfn, 178 slot->devfn,
194 hs_cap + 2, 179 hs_cap + 2,
195 &hs_csr)) { 180 &hs_csr))
196 return -ENODEV; 181 return -ENODEV;
197 } 182 if (hs_csr & HS_CSR_EXT) {
198 if(hs_csr & HS_CSR_EXT) {
199 /* Clear EXT (by setting it) */ 183 /* Clear EXT (by setting it) */
200 if(pci_bus_write_config_word(slot->bus, 184 if (pci_bus_write_config_word(slot->bus,
201 slot->devfn, 185 slot->devfn,
202 hs_cap + 2, 186 hs_cap + 2,
203 hs_csr)) { 187 hs_csr))
204 return -ENODEV; 188 return -ENODEV;
205 }
206 } 189 }
207 return 0; 190 return 0;
208} 191}
@@ -215,18 +198,16 @@ int cpci_led_on(struct slot* slot)
215 hs_cap = pci_bus_find_capability(slot->bus, 198 hs_cap = pci_bus_find_capability(slot->bus,
216 slot->devfn, 199 slot->devfn,
217 PCI_CAP_ID_CHSWP); 200 PCI_CAP_ID_CHSWP);
218 if(!hs_cap) { 201 if (!hs_cap)
219 return -ENODEV; 202 return -ENODEV;
220 } 203 if (pci_bus_read_config_word(slot->bus,
221 if(pci_bus_read_config_word(slot->bus,
222 slot->devfn, 204 slot->devfn,
223 hs_cap + 2, 205 hs_cap + 2,
224 &hs_csr)) { 206 &hs_csr))
225 return -ENODEV; 207 return -ENODEV;
226 } 208 if ((hs_csr & HS_CSR_LOO) != HS_CSR_LOO) {
227 if((hs_csr & HS_CSR_LOO) != HS_CSR_LOO) {
228 hs_csr |= HS_CSR_LOO; 209 hs_csr |= HS_CSR_LOO;
229 if(pci_bus_write_config_word(slot->bus, 210 if (pci_bus_write_config_word(slot->bus,
230 slot->devfn, 211 slot->devfn,
231 hs_cap + 2, 212 hs_cap + 2,
232 hs_csr)) { 213 hs_csr)) {
@@ -246,18 +227,16 @@ int cpci_led_off(struct slot* slot)
246 hs_cap = pci_bus_find_capability(slot->bus, 227 hs_cap = pci_bus_find_capability(slot->bus,
247 slot->devfn, 228 slot->devfn,
248 PCI_CAP_ID_CHSWP); 229 PCI_CAP_ID_CHSWP);
249 if(!hs_cap) { 230 if (!hs_cap)
250 return -ENODEV; 231 return -ENODEV;
251 } 232 if (pci_bus_read_config_word(slot->bus,
252 if(pci_bus_read_config_word(slot->bus,
253 slot->devfn, 233 slot->devfn,
254 hs_cap + 2, 234 hs_cap + 2,
255 &hs_csr)) { 235 &hs_csr))
256 return -ENODEV; 236 return -ENODEV;
257 } 237 if (hs_csr & HS_CSR_LOO) {
258 if(hs_csr & HS_CSR_LOO) {
259 hs_csr &= ~HS_CSR_LOO; 238 hs_csr &= ~HS_CSR_LOO;
260 if(pci_bus_write_config_word(slot->bus, 239 if (pci_bus_write_config_word(slot->bus,
261 slot->devfn, 240 slot->devfn,
262 hs_cap + 2, 241 hs_cap + 2,
263 hs_csr)) { 242 hs_csr)) {
@@ -274,19 +253,6 @@ int cpci_led_off(struct slot* slot)
274 * Device configuration functions 253 * Device configuration functions
275 */ 254 */
276 255
277static void cpci_enable_device(struct pci_dev *dev)
278{
279 struct pci_bus *bus;
280
281 pci_enable_device(dev);
282 if(dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
283 bus = dev->subordinate;
284 list_for_each_entry(dev, &bus->devices, bus_list) {
285 cpci_enable_device(dev);
286 }
287 }
288}
289
290int cpci_configure_slot(struct slot* slot) 256int cpci_configure_slot(struct slot* slot)
291{ 257{
292 unsigned char busnr; 258 unsigned char busnr;
@@ -294,14 +260,14 @@ int cpci_configure_slot(struct slot* slot)
294 260
295 dbg("%s - enter", __FUNCTION__); 261 dbg("%s - enter", __FUNCTION__);
296 262
297 if(slot->dev == NULL) { 263 if (slot->dev == NULL) {
298 dbg("pci_dev null, finding %02x:%02x:%x", 264 dbg("pci_dev null, finding %02x:%02x:%x",
299 slot->bus->number, PCI_SLOT(slot->devfn), PCI_FUNC(slot->devfn)); 265 slot->bus->number, PCI_SLOT(slot->devfn), PCI_FUNC(slot->devfn));
300 slot->dev = pci_find_slot(slot->bus->number, slot->devfn); 266 slot->dev = pci_get_slot(slot->bus, slot->devfn);
301 } 267 }
302 268
303 /* Still NULL? Well then scan for it! */ 269 /* Still NULL? Well then scan for it! */
304 if(slot->dev == NULL) { 270 if (slot->dev == NULL) {
305 int n; 271 int n;
306 dbg("pci_dev still null"); 272 dbg("pci_dev still null");
307 273
@@ -311,10 +277,10 @@ int cpci_configure_slot(struct slot* slot)
311 */ 277 */
312 n = pci_scan_slot(slot->bus, slot->devfn); 278 n = pci_scan_slot(slot->bus, slot->devfn);
313 dbg("%s: pci_scan_slot returned %d", __FUNCTION__, n); 279 dbg("%s: pci_scan_slot returned %d", __FUNCTION__, n);
314 if(n > 0) 280 if (n > 0)
315 pci_bus_add_devices(slot->bus); 281 pci_bus_add_devices(slot->bus);
316 slot->dev = pci_find_slot(slot->bus->number, slot->devfn); 282 slot->dev = pci_get_slot(slot->bus, slot->devfn);
317 if(slot->dev == NULL) { 283 if (slot->dev == NULL) {
318 err("Could not find PCI device for slot %02x", slot->number); 284 err("Could not find PCI device for slot %02x", slot->number);
319 return 1; 285 return 1;
320 } 286 }
@@ -329,8 +295,6 @@ int cpci_configure_slot(struct slot* slot)
329 295
330 pci_bus_assign_resources(slot->dev->bus); 296 pci_bus_assign_resources(slot->dev->bus);
331 297
332 cpci_enable_device(slot->dev);
333
334 dbg("%s - exit", __FUNCTION__); 298 dbg("%s - exit", __FUNCTION__);
335 return 0; 299 return 0;
336} 300}
@@ -341,19 +305,22 @@ int cpci_unconfigure_slot(struct slot* slot)
341 struct pci_dev *dev; 305 struct pci_dev *dev;
342 306
343 dbg("%s - enter", __FUNCTION__); 307 dbg("%s - enter", __FUNCTION__);
344 if(!slot->dev) { 308 if (!slot->dev) {
345 err("No device for slot %02x\n", slot->number); 309 err("No device for slot %02x\n", slot->number);
346 return -ENODEV; 310 return -ENODEV;
347 } 311 }
348 312
349 for (i = 0; i < 8; i++) { 313 for (i = 0; i < 8; i++) {
350 dev = pci_find_slot(slot->bus->number, 314 dev = pci_get_slot(slot->bus,
351 PCI_DEVFN(PCI_SLOT(slot->devfn), i)); 315 PCI_DEVFN(PCI_SLOT(slot->devfn), i));
352 if(dev) { 316 if (dev) {
353 pci_remove_bus_device(dev); 317 pci_remove_bus_device(dev);
354 slot->dev = NULL; 318 pci_dev_put(dev);
355 } 319 }
356 } 320 }
321 pci_dev_put(slot->dev);
322 slot->dev = NULL;
323
357 dbg("%s - exit", __FUNCTION__); 324 dbg("%s - exit", __FUNCTION__);
358 return 0; 325 return 0;
359} 326}
diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c
index 41c7971d06c5..4c11048ad51b 100644
--- a/drivers/pci/hotplug/cpqphp_sysfs.c
+++ b/drivers/pci/hotplug/cpqphp_sysfs.c
@@ -38,7 +38,7 @@
38 38
39/* A few routines that create sysfs entries for the hot plug controller */ 39/* A few routines that create sysfs entries for the hot plug controller */
40 40
41static ssize_t show_ctrl (struct device *dev, char *buf) 41static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, char *buf)
42{ 42{
43 struct pci_dev *pci_dev; 43 struct pci_dev *pci_dev;
44 struct controller *ctrl; 44 struct controller *ctrl;
@@ -82,7 +82,7 @@ static ssize_t show_ctrl (struct device *dev, char *buf)
82} 82}
83static DEVICE_ATTR (ctrl, S_IRUGO, show_ctrl, NULL); 83static DEVICE_ATTR (ctrl, S_IRUGO, show_ctrl, NULL);
84 84
85static ssize_t show_dev (struct device *dev, char *buf) 85static ssize_t show_dev (struct device *dev, struct device_attribute *attr, char *buf)
86{ 86{
87 struct pci_dev *pci_dev; 87 struct pci_dev *pci_dev;
88 struct controller *ctrl; 88 struct controller *ctrl;
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
index c802f6270b89..c4282902cb52 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -73,7 +73,7 @@ static ssize_t hotplug_slot_attr_show(struct kobject *kobj,
73{ 73{
74 struct hotplug_slot *slot = to_hotplug_slot(kobj); 74 struct hotplug_slot *slot = to_hotplug_slot(kobj);
75 struct hotplug_slot_attribute *attribute = to_hotplug_attr(attr); 75 struct hotplug_slot_attribute *attribute = to_hotplug_attr(attr);
76 return attribute->show ? attribute->show(slot, buf) : 0; 76 return attribute->show ? attribute->show(slot, buf) : -EIO;
77} 77}
78 78
79static ssize_t hotplug_slot_attr_store(struct kobject *kobj, 79static ssize_t hotplug_slot_attr_store(struct kobject *kobj,
@@ -81,7 +81,7 @@ static ssize_t hotplug_slot_attr_store(struct kobject *kobj,
81{ 81{
82 struct hotplug_slot *slot = to_hotplug_slot(kobj); 82 struct hotplug_slot *slot = to_hotplug_slot(kobj);
83 struct hotplug_slot_attribute *attribute = to_hotplug_attr(attr); 83 struct hotplug_slot_attribute *attribute = to_hotplug_attr(attr);
84 return attribute->store ? attribute->store(slot, buf, len) : 0; 84 return attribute->store ? attribute->store(slot, buf, len) : -EIO;
85} 85}
86 86
87static struct sysfs_ops hotplug_slot_sysfs_ops = { 87static struct sysfs_ops hotplug_slot_sysfs_ops = {
diff --git a/drivers/pci/hotplug/rpadlpar_sysfs.c b/drivers/pci/hotplug/rpadlpar_sysfs.c
index 3285b822478d..752e6513c447 100644
--- a/drivers/pci/hotplug/rpadlpar_sysfs.c
+++ b/drivers/pci/hotplug/rpadlpar_sysfs.c
@@ -48,7 +48,7 @@ dlpar_attr_store(struct kobject * kobj, struct attribute * attr,
48 struct dlpar_io_attr *dlpar_attr = container_of(attr, 48 struct dlpar_io_attr *dlpar_attr = container_of(attr,
49 struct dlpar_io_attr, attr); 49 struct dlpar_io_attr, attr);
50 return dlpar_attr->store ? 50 return dlpar_attr->store ?
51 dlpar_attr->store(dlpar_attr, buf, nbytes) : 0; 51 dlpar_attr->store(dlpar_attr, buf, nbytes) : -EIO;
52} 52}
53 53
54static struct sysfs_ops dlpar_attr_sysfs_ops = { 54static struct sysfs_ops dlpar_attr_sysfs_ops = {
diff --git a/drivers/pci/hotplug/shpchp_sysfs.c b/drivers/pci/hotplug/shpchp_sysfs.c
index 9a1ee132d12c..c9445ebda5c7 100644
--- a/drivers/pci/hotplug/shpchp_sysfs.c
+++ b/drivers/pci/hotplug/shpchp_sysfs.c
@@ -38,7 +38,7 @@
38 38
39/* A few routines that create sysfs entries for the hot plug controller */ 39/* A few routines that create sysfs entries for the hot plug controller */
40 40
41static ssize_t show_ctrl (struct device *dev, char *buf) 41static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, char *buf)
42{ 42{
43 struct pci_dev *pci_dev; 43 struct pci_dev *pci_dev;
44 struct controller *ctrl; 44 struct controller *ctrl;
@@ -82,7 +82,7 @@ static ssize_t show_ctrl (struct device *dev, char *buf)
82} 82}
83static DEVICE_ATTR (ctrl, S_IRUGO, show_ctrl, NULL); 83static DEVICE_ATTR (ctrl, S_IRUGO, show_ctrl, NULL);
84 84
85static ssize_t show_dev (struct device *dev, char *buf) 85static ssize_t show_dev (struct device *dev, struct device_attribute *attr, char *buf)
86{ 86{
87 struct pci_dev *pci_dev; 87 struct pci_dev *pci_dev;
88 struct controller *ctrl; 88 struct controller *ctrl;
diff --git a/drivers/pci/hotplug/shpchprm_acpi.c b/drivers/pci/hotplug/shpchprm_acpi.c
index 243a51d88b86..7957cdc72cd0 100644
--- a/drivers/pci/hotplug/shpchprm_acpi.c
+++ b/drivers/pci/hotplug/shpchprm_acpi.c
@@ -1626,7 +1626,7 @@ int shpchprm_set_hpp(
1626 pci_bus->number = func->bus; 1626 pci_bus->number = func->bus;
1627 devfn = PCI_DEVFN(func->device, func->function); 1627 devfn = PCI_DEVFN(func->device, func->function);
1628 1628
1629 ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->bus); 1629 ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->slot_bus);
1630 1630
1631 if (ab) { 1631 if (ab) {
1632 if (ab->_hpp) { 1632 if (ab->_hpp) {
@@ -1681,7 +1681,7 @@ void shpchprm_enable_card(
1681 | PCI_COMMAND_IO | PCI_COMMAND_MEMORY; 1681 | PCI_COMMAND_IO | PCI_COMMAND_MEMORY;
1682 bcmd = bcommand = bcommand | PCI_BRIDGE_CTL_NO_ISA; 1682 bcmd = bcommand = bcommand | PCI_BRIDGE_CTL_NO_ISA;
1683 1683
1684 ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->bus); 1684 ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->slot_bus);
1685 if (ab) { 1685 if (ab) {
1686 if (ab->_hpp) { 1686 if (ab->_hpp) {
1687 if (ab->_hpp->enable_perr) { 1687 if (ab->_hpp->enable_perr) {
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index fe98553c978f..e65bf2b395aa 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -335,13 +335,14 @@ pci_driver_attr_show(struct kobject * kobj, struct attribute *attr, char *buf)
335{ 335{
336 struct device_driver *driver = kobj_to_pci_driver(kobj); 336 struct device_driver *driver = kobj_to_pci_driver(kobj);
337 struct driver_attribute *dattr = attr_to_driver_attribute(attr); 337 struct driver_attribute *dattr = attr_to_driver_attribute(attr);
338 ssize_t ret = 0; 338 ssize_t ret;
339 339
340 if (get_driver(driver)) { 340 if (!get_driver(driver))
341 if (dattr->show) 341 return -ENODEV;
342 ret = dattr->show(driver, buf); 342
343 put_driver(driver); 343 ret = dattr->show ? dattr->show(driver, buf) : -EIO;
344 } 344
345 put_driver(driver);
345 return ret; 346 return ret;
346} 347}
347 348
@@ -351,13 +352,14 @@ pci_driver_attr_store(struct kobject * kobj, struct attribute *attr,
351{ 352{
352 struct device_driver *driver = kobj_to_pci_driver(kobj); 353 struct device_driver *driver = kobj_to_pci_driver(kobj);
353 struct driver_attribute *dattr = attr_to_driver_attribute(attr); 354 struct driver_attribute *dattr = attr_to_driver_attribute(attr);
354 ssize_t ret = 0; 355 ssize_t ret;
355 356
356 if (get_driver(driver)) { 357 if (!get_driver(driver))
357 if (dattr->store) 358 return -ENODEV;
358 ret = dattr->store(driver, buf, count); 359
359 put_driver(driver); 360 ret = dattr->store ? dattr->store(driver, buf, count) : -EIO;
360 } 361
362 put_driver(driver);
361 return ret; 363 return ret;
362} 364}
363 365
@@ -393,7 +395,10 @@ int pci_register_driver(struct pci_driver *drv)
393 drv->driver.bus = &pci_bus_type; 395 drv->driver.bus = &pci_bus_type;
394 drv->driver.probe = pci_device_probe; 396 drv->driver.probe = pci_device_probe;
395 drv->driver.remove = pci_device_remove; 397 drv->driver.remove = pci_device_remove;
396 drv->driver.shutdown = pci_device_shutdown, 398 /* FIXME, once all of the existing PCI drivers have been fixed to set
399 * the pci shutdown function, this test can go away. */
400 if (!drv->driver.shutdown)
401 drv->driver.shutdown = pci_device_shutdown;
397 drv->driver.owner = drv->owner; 402 drv->driver.owner = drv->owner;
398 drv->driver.kobj.ktype = &pci_driver_kobj_type; 403 drv->driver.kobj.ktype = &pci_driver_kobj_type;
399 pci_init_dynids(&drv->dynids); 404 pci_init_dynids(&drv->dynids);
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 6ca0061137a6..a15f94072a6f 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -29,7 +29,7 @@ static int sysfs_initialized; /* = 0 */
29/* show configuration fields */ 29/* show configuration fields */
30#define pci_config_attr(field, format_string) \ 30#define pci_config_attr(field, format_string) \
31static ssize_t \ 31static ssize_t \
32field##_show(struct device *dev, char *buf) \ 32field##_show(struct device *dev, struct device_attribute *attr, char *buf) \
33{ \ 33{ \
34 struct pci_dev *pdev; \ 34 struct pci_dev *pdev; \
35 \ 35 \
@@ -44,7 +44,7 @@ pci_config_attr(subsystem_device, "0x%04x\n");
44pci_config_attr(class, "0x%06x\n"); 44pci_config_attr(class, "0x%06x\n");
45pci_config_attr(irq, "%u\n"); 45pci_config_attr(irq, "%u\n");
46 46
47static ssize_t local_cpus_show(struct device *dev, char *buf) 47static ssize_t local_cpus_show(struct device *dev, struct device_attribute *attr, char *buf)
48{ 48{
49 cpumask_t mask = pcibus_to_cpumask(to_pci_dev(dev)->bus); 49 cpumask_t mask = pcibus_to_cpumask(to_pci_dev(dev)->bus);
50 int len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask); 50 int len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask);
@@ -54,7 +54,7 @@ static ssize_t local_cpus_show(struct device *dev, char *buf)
54 54
55/* show resources */ 55/* show resources */
56static ssize_t 56static ssize_t
57resource_show(struct device * dev, char * buf) 57resource_show(struct device * dev, struct device_attribute *attr, char * buf)
58{ 58{
59 struct pci_dev * pci_dev = to_pci_dev(dev); 59 struct pci_dev * pci_dev = to_pci_dev(dev);
60 char * str = buf; 60 char * str = buf;
@@ -73,7 +73,7 @@ resource_show(struct device * dev, char * buf)
73 return (str - buf); 73 return (str - buf);
74} 74}
75 75
76static ssize_t modalias_show(struct device *dev, char *buf) 76static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf)
77{ 77{
78 struct pci_dev *pci_dev = to_pci_dev(dev); 78 struct pci_dev *pci_dev = to_pci_dev(dev);
79 79
@@ -339,16 +339,17 @@ pci_create_resource_files(struct pci_dev *pdev)
339 if (!pci_resource_len(pdev, i)) 339 if (!pci_resource_len(pdev, i))
340 continue; 340 continue;
341 341
342 res_attr = kmalloc(sizeof(*res_attr) + 10, GFP_ATOMIC); 342 /* allocate attribute structure, piggyback attribute name */
343 res_attr = kcalloc(1, sizeof(*res_attr) + 10, GFP_ATOMIC);
343 if (res_attr) { 344 if (res_attr) {
344 memset(res_attr, 0, sizeof(*res_attr) + 10); 345 char *res_attr_name = (char *)(res_attr + 1);
346
345 pdev->res_attr[i] = res_attr; 347 pdev->res_attr[i] = res_attr;
346 /* Allocated above after the res_attr struct */ 348 sprintf(res_attr_name, "resource%d", i);
347 res_attr->attr.name = (char *)(res_attr + 1); 349 res_attr->attr.name = res_attr_name;
348 sprintf(res_attr->attr.name, "resource%d", i);
349 res_attr->size = pci_resource_len(pdev, i);
350 res_attr->attr.mode = S_IRUSR | S_IWUSR; 350 res_attr->attr.mode = S_IRUSR | S_IWUSR;
351 res_attr->attr.owner = THIS_MODULE; 351 res_attr->attr.owner = THIS_MODULE;
352 res_attr->size = pci_resource_len(pdev, i);
352 res_attr->mmap = pci_mmap_resource; 353 res_attr->mmap = pci_mmap_resource;
353 res_attr->private = &pdev->resource[i]; 354 res_attr->private = &pdev->resource[i];
354 sysfs_create_bin_file(&pdev->dev.kobj, res_attr); 355 sysfs_create_bin_file(&pdev->dev.kobj, res_attr);
diff --git a/drivers/pci/pci.ids b/drivers/pci/pci.ids
index 93481b41b613..1d2ef1e2ffc6 100644
--- a/drivers/pci/pci.ids
+++ b/drivers/pci/pci.ids
@@ -7173,6 +7173,7 @@
7173 080f Sentry5 DDR/SDR RAM Controller 7173 080f Sentry5 DDR/SDR RAM Controller
7174 0811 Sentry5 External Interface Core 7174 0811 Sentry5 External Interface Core
7175 0816 BCM3302 Sentry5 MIPS32 CPU 7175 0816 BCM3302 Sentry5 MIPS32 CPU
7176 1600 NetXtreme BCM5752 Gigabit Ethernet PCI Express
7176 1644 NetXtreme BCM5700 Gigabit Ethernet 7177 1644 NetXtreme BCM5700 Gigabit Ethernet
7177 1014 0277 Broadcom Vigil B5700 1000Base-T 7178 1014 0277 Broadcom Vigil B5700 1000Base-T
7178 1028 00d1 Broadcom BCM5700 7179 1028 00d1 Broadcom BCM5700
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index 576285765e98..f5c5f10a3d2f 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -232,19 +232,16 @@ static void pcie_device_init(struct pci_dev *parent, struct pcie_device *dev,
232 /* Initialize generic device interface */ 232 /* Initialize generic device interface */
233 device = &dev->device; 233 device = &dev->device;
234 memset(device, 0, sizeof(struct device)); 234 memset(device, 0, sizeof(struct device));
235 INIT_LIST_HEAD(&device->node);
236 INIT_LIST_HEAD(&device->children);
237 INIT_LIST_HEAD(&device->bus_list);
238 device->bus = &pcie_port_bus_type; 235 device->bus = &pcie_port_bus_type;
239 device->driver = NULL; 236 device->driver = NULL;
240 device->driver_data = NULL; 237 device->driver_data = NULL;
241 device->release = release_pcie_device; /* callback to free pcie dev */ 238 device->release = release_pcie_device; /* callback to free pcie dev */
242 sprintf(&device->bus_id[0], "pcie%02x", 239 sprintf(&device->bus_id[0], "pcie%02x",
243 get_descriptor_id(port_type, service_type)); 240 get_descriptor_id(port_type, service_type));
244 device->parent = &parent->dev; 241 device->parent = &parent->dev;
245} 242}
246 243
247static struct pcie_device* alloc_pcie_device(struct pci_dev *parent, 244static struct pcie_device* alloc_pcie_device(struct pci_dev *parent,
248 int port_type, int service_type, int irq, int irq_mode) 245 int port_type, int service_type, int irq, int irq_mode)
249{ 246{
250 struct pcie_device *device; 247 struct pcie_device *device;
@@ -270,9 +267,9 @@ int pcie_port_device_probe(struct pci_dev *dev)
270 pci_read_config_word(dev, pos + PCIE_CAPABILITIES_REG, &reg); 267 pci_read_config_word(dev, pos + PCIE_CAPABILITIES_REG, &reg);
271 type = (reg >> 4) & PORT_TYPE_MASK; 268 type = (reg >> 4) & PORT_TYPE_MASK;
272 if ( type == PCIE_RC_PORT || type == PCIE_SW_UPSTREAM_PORT || 269 if ( type == PCIE_RC_PORT || type == PCIE_SW_UPSTREAM_PORT ||
273 type == PCIE_SW_DOWNSTREAM_PORT ) 270 type == PCIE_SW_DOWNSTREAM_PORT )
274 return 0; 271 return 0;
275 272
276 return -ENODEV; 273 return -ENODEV;
277} 274}
278 275
@@ -283,8 +280,8 @@ int pcie_port_device_register(struct pci_dev *dev)
283 u16 reg16; 280 u16 reg16;
284 281
285 /* Get port type */ 282 /* Get port type */
286 pci_read_config_word(dev, 283 pci_read_config_word(dev,
287 pci_find_capability(dev, PCI_CAP_ID_EXP) + 284 pci_find_capability(dev, PCI_CAP_ID_EXP) +
288 PCIE_CAPABILITIES_REG, &reg16); 285 PCIE_CAPABILITIES_REG, &reg16);
289 type = (reg16 >> 4) & PORT_TYPE_MASK; 286 type = (reg16 >> 4) & PORT_TYPE_MASK;
290 287
@@ -299,11 +296,11 @@ int pcie_port_device_register(struct pci_dev *dev)
299 if (capabilities & (1 << i)) { 296 if (capabilities & (1 << i)) {
300 child = alloc_pcie_device( 297 child = alloc_pcie_device(
301 dev, /* parent */ 298 dev, /* parent */
302 type, /* port type */ 299 type, /* port type */
303 i, /* service type */ 300 i, /* service type */
304 vectors[i], /* irq */ 301 vectors[i], /* irq */
305 irq_mode /* interrupt mode */); 302 irq_mode /* interrupt mode */);
306 if (child) { 303 if (child) {
307 status = device_register(&child->device); 304 status = device_register(&child->device);
308 if (status) { 305 if (status) {
309 kfree(child); 306 kfree(child);
@@ -317,84 +314,78 @@ int pcie_port_device_register(struct pci_dev *dev)
317} 314}
318 315
319#ifdef CONFIG_PM 316#ifdef CONFIG_PM
320int pcie_port_device_suspend(struct pci_dev *dev, pm_message_t state) 317static int suspend_iter(struct device *dev, void *data)
321{ 318{
322 struct list_head *head, *tmp;
323 struct device *parent, *child;
324 struct device_driver *driver;
325 struct pcie_port_service_driver *service_driver; 319 struct pcie_port_service_driver *service_driver;
320 u32 state = (u32)data;
321
322 if ((dev->bus == &pcie_port_bus_type) &&
323 (dev->driver)) {
324 service_driver = to_service_driver(dev->driver);
325 if (service_driver->suspend)
326 service_driver->suspend(to_pcie_device(dev), state);
327 }
328 return 0;
329}
326 330
327 parent = &dev->dev; 331int pcie_port_device_suspend(struct pci_dev *dev, u32 state)
328 head = &parent->children; 332{
329 tmp = head->next; 333 device_for_each_child(&dev->dev, (void *)state, suspend_iter);
330 while (head != tmp) { 334 return 0;
331 child = container_of(tmp, struct device, node);
332 tmp = tmp->next;
333 if (child->bus != &pcie_port_bus_type)
334 continue;
335 driver = child->driver;
336 if (!driver)
337 continue;
338 service_driver = to_service_driver(driver);
339 if (service_driver->suspend)
340 service_driver->suspend(to_pcie_device(child), state);
341 }
342 return 0;
343} 335}
344 336
345int pcie_port_device_resume(struct pci_dev *dev) 337static int resume_iter(struct device *dev, void *data)
346{ 338{
347 struct list_head *head, *tmp;
348 struct device *parent, *child;
349 struct device_driver *driver;
350 struct pcie_port_service_driver *service_driver; 339 struct pcie_port_service_driver *service_driver;
351 340
352 parent = &dev->dev; 341 if ((dev->bus == &pcie_port_bus_type) &&
353 head = &parent->children; 342 (dev->driver)) {
354 tmp = head->next; 343 service_driver = to_service_driver(dev->driver);
355 while (head != tmp) { 344 if (service_driver->resume)
356 child = container_of(tmp, struct device, node); 345 service_driver->resume(to_pcie_device(dev));
357 tmp = tmp->next;
358 if (child->bus != &pcie_port_bus_type)
359 continue;
360 driver = child->driver;
361 if (!driver)
362 continue;
363 service_driver = to_service_driver(driver);
364 if (service_driver->resume)
365 service_driver->resume(to_pcie_device(child));
366 } 346 }
367 return 0; 347 return 0;
348}
368 349
350int pcie_port_device_resume(struct pci_dev *dev)
351{
352 device_for_each_child(&dev->dev, NULL, resume_iter);
353 return 0;
369} 354}
370#endif 355#endif
371 356
372void pcie_port_device_remove(struct pci_dev *dev) 357static int remove_iter(struct device *dev, void *data)
373{ 358{
374 struct list_head *head, *tmp;
375 struct device *parent, *child;
376 struct device_driver *driver;
377 struct pcie_port_service_driver *service_driver; 359 struct pcie_port_service_driver *service_driver;
378 int interrupt_mode = PCIE_PORT_INTx_MODE;
379 360
380 parent = &dev->dev; 361 if (dev->bus == &pcie_port_bus_type) {
381 head = &parent->children; 362 if (dev->driver) {
382 tmp = head->next; 363 service_driver = to_service_driver(dev->driver);
383 while (head != tmp) { 364 if (service_driver->remove)
384 child = container_of(tmp, struct device, node); 365 service_driver->remove(to_pcie_device(dev));
385 tmp = tmp->next;
386 if (child->bus != &pcie_port_bus_type)
387 continue;
388 driver = child->driver;
389 if (driver) {
390 service_driver = to_service_driver(driver);
391 if (service_driver->remove)
392 service_driver->remove(to_pcie_device(child));
393 } 366 }
394 interrupt_mode = (to_pcie_device(child))->interrupt_mode; 367 *(unsigned long*)data = (unsigned long)dev;
395 put_device(child); 368 return 1;
396 device_unregister(child);
397 } 369 }
370 return 0;
371}
372
373void pcie_port_device_remove(struct pci_dev *dev)
374{
375 struct device *device;
376 unsigned long device_addr;
377 int interrupt_mode = PCIE_PORT_INTx_MODE;
378 int status;
379
380 do {
381 status = device_for_each_child(&dev->dev, &device_addr, remove_iter);
382 if (status) {
383 device = (struct device*)device_addr;
384 interrupt_mode = (to_pcie_device(device))->interrupt_mode;
385 put_device(device);
386 device_unregister(device);
387 }
388 } while (status);
398 /* Switch to INTx by default if MSI enabled */ 389 /* Switch to INTx by default if MSI enabled */
399 if (interrupt_mode == PCIE_PORT_MSIX_MODE) 390 if (interrupt_mode == PCIE_PORT_MSIX_MODE)
400 pci_disable_msix(dev); 391 pci_disable_msix(dev);
@@ -423,7 +414,7 @@ int pcie_port_service_register(struct pcie_port_service_driver *new)
423 new->driver.resume = pcie_port_resume_service; 414 new->driver.resume = pcie_port_resume_service;
424 415
425 return driver_register(&new->driver); 416 return driver_register(&new->driver);
426} 417}
427 418
428void pcie_port_service_unregister(struct pcie_port_service_driver *new) 419void pcie_port_service_unregister(struct pcie_port_service_driver *new)
429{ 420{
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index b7ae87823c69..fd48b201eb53 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -125,7 +125,7 @@ static inline unsigned int pci_calc_resource_flags(unsigned int flags)
125/* 125/*
126 * Find the extent of a PCI decode.. 126 * Find the extent of a PCI decode..
127 */ 127 */
128static u32 pci_size(u32 base, u32 maxbase, unsigned long mask) 128static u32 pci_size(u32 base, u32 maxbase, u32 mask)
129{ 129{
130 u32 size = mask & maxbase; /* Find the significant bits */ 130 u32 size = mask & maxbase; /* Find the significant bits */
131 if (!size) 131 if (!size)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 026aa04669a2..968033fd29f0 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -18,6 +18,7 @@
18#include <linux/pci.h> 18#include <linux/pci.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/acpi.h>
21#include "pci.h" 22#include "pci.h"
22 23
23/* Deal with broken BIOS'es that neglect to enable passive release, 24/* Deal with broken BIOS'es that neglect to enable passive release,
@@ -455,24 +456,16 @@ static void __init quirk_amd_8131_ioapic(struct pci_dev *dev)
455} 456}
456DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_APIC, quirk_amd_8131_ioapic ); 457DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_APIC, quirk_amd_8131_ioapic );
457 458
459static void __init quirk_svw_msi(struct pci_dev *dev)
460{
461 pci_msi_quirk = 1;
462 printk(KERN_WARNING "PCI: MSI quirk detected. pci_msi_quirk set.\n");
463}
464DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_svw_msi );
458#endif /* CONFIG_X86_IO_APIC */ 465#endif /* CONFIG_X86_IO_APIC */
459 466
460 467
461/* 468/*
462 * Via 686A/B: The PCI_INTERRUPT_LINE register for the on-chip
463 * devices, USB0/1, AC97, MC97, and ACPI, has an unusual feature:
464 * when written, it makes an internal connection to the PIC.
465 * For these devices, this register is defined to be 4 bits wide.
466 * Normally this is fine. However for IO-APIC motherboards, or
467 * non-x86 architectures (yes Via exists on PPC among other places),
468 * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get
469 * interrupts delivered properly.
470 *
471 * TODO: When we have device-specific interrupt routers,
472 * quirk_via_irqpic will go away from quirks.
473 */
474
475/*
476 * FIXME: it is questionable that quirk_via_acpi 469 * FIXME: it is questionable that quirk_via_acpi
477 * is needed. It shows up as an ISA bridge, and does not 470 * is needed. It shows up as an ISA bridge, and does not
478 * support the PCI_INTERRUPT_LINE register at all. Therefore 471 * support the PCI_INTERRUPT_LINE register at all. Therefore
@@ -495,6 +488,31 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_vi
495DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi ); 488DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi );
496 489
497/* 490/*
491 * Via 686A/B: The PCI_INTERRUPT_LINE register for the on-chip
492 * devices, USB0/1, AC97, MC97, and ACPI, has an unusual feature:
493 * when written, it makes an internal connection to the PIC.
494 * For these devices, this register is defined to be 4 bits wide.
495 * Normally this is fine. However for IO-APIC motherboards, or
496 * non-x86 architectures (yes Via exists on PPC among other places),
497 * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get
498 * interrupts delivered properly.
499 */
500static void quirk_via_irq(struct pci_dev *dev)
501{
502 u8 irq, new_irq;
503
504 new_irq = dev->irq & 0xf;
505 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
506 if (new_irq != irq) {
507 printk(KERN_INFO "PCI: Via IRQ fixup for %s, from %d to %d\n",
508 pci_name(dev), irq, new_irq);
509 udelay(15); /* unknown if delay really needed */
510 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
511 }
512}
513DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_irq);
514
515/*
498 * PIIX3 USB: We have to disable USB interrupts that are 516 * PIIX3 USB: We have to disable USB interrupts that are
499 * hardwired to PIRQD# and may be shared with an 517 * hardwired to PIRQD# and may be shared with an
500 * external device. 518 * external device.
@@ -683,19 +701,6 @@ static void __init quirk_disable_pxb(struct pci_dev *pdev)
683} 701}
684DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, quirk_disable_pxb ); 702DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, quirk_disable_pxb );
685 703
686/*
687 * VIA northbridges care about PCI_INTERRUPT_LINE
688 */
689int via_interrupt_line_quirk;
690
691static void __devinit quirk_via_bridge(struct pci_dev *pdev)
692{
693 if(pdev->devfn == 0) {
694 printk(KERN_INFO "PCI: Via IRQ fixup\n");
695 via_interrupt_line_quirk = 1;
696 }
697}
698DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_bridge );
699 704
700/* 705/*
701 * Serverworks CSB5 IDE does not fully support native mode 706 * Serverworks CSB5 IDE does not fully support native mode
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 6375ebc85020..14e4124e1523 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -171,19 +171,21 @@ config PCMCIA_PROBE
171config M32R_PCC 171config M32R_PCC
172 bool "M32R PCMCIA I/F" 172 bool "M32R PCMCIA I/F"
173 depends on M32R && CHIP_M32700 && PCMCIA 173 depends on M32R && CHIP_M32700 && PCMCIA
174 select PCCARD_NONSTATIC
174 help 175 help
175 Say Y here to use the M32R PCMCIA controller. 176 Say Y here to use the M32R PCMCIA controller.
176 177
177config M32R_CFC 178config M32R_CFC
178 bool "M32R CF I/F Controller" 179 bool "M32R CF I/F Controller"
179 depends on M32R && (PLAT_USRV || PLAT_M32700UT || PLAT_MAPPI2 || PLAT_OPSPUT) 180 depends on M32R && (PLAT_USRV || PLAT_M32700UT || PLAT_MAPPI2 || PLAT_MAPPI3 || PLAT_OPSPUT)
181 select PCCARD_NONSTATIC
180 help 182 help
181 Say Y here to use the M32R CompactFlash controller. 183 Say Y here to use the M32R CompactFlash controller.
182 184
183config M32R_CFC_NUM 185config M32R_CFC_NUM
184 int "M32R CF I/F number" 186 int "M32R CF I/F number"
185 depends on M32R_CFC 187 depends on M32R_CFC
186 default "1" if PLAT_USRV || PLAT_M32700UT || PLAT_MAPPI2 || PLAT_OPSPUT 188 default "1" if PLAT_USRV || PLAT_M32700UT || PLAT_MAPPI2 || PLAT_MAPPI3 || PLAT_OPSPUT
187 help 189 help
188 Set the number of M32R CF slots. 190 Set the number of M32R CF slots.
189 191
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index c4ade288c5da..569e55feecfd 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -604,14 +604,14 @@ static int pcmcia_bus_match(struct device * dev, struct device_driver * drv) {
604/************************ per-device sysfs output ***************************/ 604/************************ per-device sysfs output ***************************/
605 605
606#define pcmcia_device_attr(field, test, format) \ 606#define pcmcia_device_attr(field, test, format) \
607static ssize_t field##_show (struct device *dev, char *buf) \ 607static ssize_t field##_show (struct device *dev, struct device_attribute *attr, char *buf) \
608{ \ 608{ \
609 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \ 609 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \
610 return p_dev->test ? sprintf (buf, format, p_dev->field) : -ENODEV; \ 610 return p_dev->test ? sprintf (buf, format, p_dev->field) : -ENODEV; \
611} 611}
612 612
613#define pcmcia_device_stringattr(name, field) \ 613#define pcmcia_device_stringattr(name, field) \
614static ssize_t name##_show (struct device *dev, char *buf) \ 614static ssize_t name##_show (struct device *dev, struct device_attribute *attr, char *buf) \
615{ \ 615{ \
616 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \ 616 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \
617 return p_dev->field ? sprintf (buf, "%s\n", p_dev->field) : -ENODEV; \ 617 return p_dev->field ? sprintf (buf, "%s\n", p_dev->field) : -ENODEV; \
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c
index 581bfa95429e..b1111c6bf062 100644
--- a/drivers/pcmcia/m32r_cfc.c
+++ b/drivers/pcmcia/m32r_cfc.c
@@ -24,9 +24,9 @@
24#include <linux/workqueue.h> 24#include <linux/workqueue.h>
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/bitops.h>
27#include <asm/irq.h> 28#include <asm/irq.h>
28#include <asm/io.h> 29#include <asm/io.h>
29#include <asm/bitops.h>
30#include <asm/system.h> 30#include <asm/system.h>
31 31
32#include <pcmcia/version.h> 32#include <pcmcia/version.h>
@@ -444,7 +444,7 @@ static int _pcc_get_status(u_short sock, u_int *value)
444 debug(3, "m32r_cfc: _pcc_get_status: " 444 debug(3, "m32r_cfc: _pcc_get_status: "
445 "power off (CPCR=0x%08x)\n", status); 445 "power off (CPCR=0x%08x)\n", status);
446 } 446 }
447#elif defined(CONFIG_PLAT_MAPPI2) 447#elif defined(CONFIG_PLAT_MAPPI2) || defined(CONFIG_PLAT_MAPPI3)
448 if ( status ) { 448 if ( status ) {
449 status = pcc_get(sock, (unsigned int)PLD_CPCR); 449 status = pcc_get(sock, (unsigned int)PLD_CPCR);
450 if (status == 0) { /* power off */ 450 if (status == 0) { /* power off */
@@ -452,18 +452,23 @@ static int _pcc_get_status(u_short sock, u_int *value)
452 pcc_set(sock, (unsigned int)PLD_CFBUFCR,0); /* force buffer off for ZA-36 */ 452 pcc_set(sock, (unsigned int)PLD_CFBUFCR,0); /* force buffer off for ZA-36 */
453 udelay(50); 453 udelay(50);
454 } 454 }
455 status = pcc_get(sock, (unsigned int)PLD_CFBUFCR); 455 *value |= SS_POWERON;
456 if (status != 0) { /* buffer off */ 456
457 pcc_set(sock, (unsigned int)PLD_CFBUFCR,0); 457 pcc_set(sock, (unsigned int)PLD_CFBUFCR,0);
458 udelay(50); 458 udelay(50);
459 pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0101); 459 pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0101);
460 udelay(25); /* for IDE reset */ 460 udelay(25); /* for IDE reset */
461 pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0100); 461 pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0100);
462 mdelay(2); /* for IDE reset */ 462 mdelay(2); /* for IDE reset */
463 } else { 463
464 *value |= SS_POWERON; 464 *value |= SS_READY;
465 *value |= SS_READY; 465 *value |= SS_3VCARD;
466 } 466 } else {
467 /* disable CF power */
468 pcc_set(sock, (unsigned int)PLD_CPCR, 0);
469 udelay(100);
470 debug(3, "m32r_cfc: _pcc_get_status: "
471 "power off (CPCR=0x%08x)\n", status);
467 } 472 }
468#else 473#else
469#error no platform configuration 474#error no platform configuration
@@ -479,14 +484,13 @@ static int _pcc_get_socket(u_short sock, socket_state_t *state)
479{ 484{
480// pcc_socket_t *t = &socket[sock]; 485// pcc_socket_t *t = &socket[sock];
481 486
482#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT)
483 state->flags = 0; 487 state->flags = 0;
484 state->csc_mask = SS_DETECT; 488 state->csc_mask = SS_DETECT;
485 state->csc_mask |= SS_READY; 489 state->csc_mask |= SS_READY;
486 state->io_irq = 0; 490 state->io_irq = 0;
487 state->Vcc = 33; /* 3.3V fixed */ 491 state->Vcc = 33; /* 3.3V fixed */
488 state->Vpp = 33; 492 state->Vpp = 33;
489#endif 493
490 debug(3, "m32r_cfc: GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, " 494 debug(3, "m32r_cfc: GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, "
491 "io_irq %d, csc_mask %#2.2x\n", sock, state->flags, 495 "io_irq %d, csc_mask %#2.2x\n", sock, state->flags,
492 state->Vcc, state->Vpp, state->io_irq, state->csc_mask); 496 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
@@ -497,32 +501,17 @@ static int _pcc_get_socket(u_short sock, socket_state_t *state)
497 501
498static int _pcc_set_socket(u_short sock, socket_state_t *state) 502static int _pcc_set_socket(u_short sock, socket_state_t *state)
499{ 503{
500#if defined(CONFIG_PLAT_MAPPI2)
501 u_long reg = 0;
502#endif
503 debug(3, "m32r_cfc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " 504 debug(3, "m32r_cfc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
504 "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags, 505 "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags,
505 state->Vcc, state->Vpp, state->io_irq, state->csc_mask); 506 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
506 507
507#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT) 508#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT) || defined(CONFIG_PLAT_MAPPI2) || defined(CONFIG_PLAT_MAPPI3)
508 if (state->Vcc) { 509 if (state->Vcc) {
509 if ((state->Vcc != 50) && (state->Vcc != 33)) 510 if ((state->Vcc != 50) && (state->Vcc != 33))
510 return -EINVAL; 511 return -EINVAL;
511 /* accept 5V and 3.3V */ 512 /* accept 5V and 3.3V */
512 } 513 }
513#elif defined(CONFIG_PLAT_MAPPI2)
514 if (state->Vcc) {
515 /*
516 * 5V only
517 */
518 if (state->Vcc == 50) {
519 reg |= PCCSIGCR_VEN;
520 } else {
521 return -EINVAL;
522 }
523 }
524#endif 514#endif
525
526 if (state->flags & SS_RESET) { 515 if (state->flags & SS_RESET) {
527 debug(3, ":RESET\n"); 516 debug(3, ":RESET\n");
528 pcc_set(sock,(unsigned int)PLD_CFRSTCR,0x101); 517 pcc_set(sock,(unsigned int)PLD_CFRSTCR,0x101);
@@ -788,7 +777,7 @@ static int __init init_m32r_pcc(void)
788 return ret; 777 return ret;
789 } 778 }
790 779
791#if defined(CONFIG_PLAT_MAPPI2) 780#if defined(CONFIG_PLAT_MAPPI2) || defined(CONFIG_PLAT_MAPPI3)
792 pcc_set(0, (unsigned int)PLD_CFCR0, 0x0f0f); 781 pcc_set(0, (unsigned int)PLD_CFCR0, 0x0f0f);
793 pcc_set(0, (unsigned int)PLD_CFCR1, 0x0200); 782 pcc_set(0, (unsigned int)PLD_CFCR1, 0x0200);
794#endif 783#endif
@@ -825,7 +814,7 @@ static int __init init_m32r_pcc(void)
825 for (i = 0 ; i < pcc_sockets ; i++) { 814 for (i = 0 ; i < pcc_sockets ; i++) {
826 socket[i].socket.dev.dev = &pcc_device.dev; 815 socket[i].socket.dev.dev = &pcc_device.dev;
827 socket[i].socket.ops = &pcc_operations; 816 socket[i].socket.ops = &pcc_operations;
828 socket[i].socket.resource_ops = &pccard_static_ops; 817 socket[i].socket.resource_ops = &pccard_nonstatic_ops;
829 socket[i].socket.owner = THIS_MODULE; 818 socket[i].socket.owner = THIS_MODULE;
830 socket[i].number = i; 819 socket[i].number = i;
831 ret = pcmcia_register_socket(&socket[i].socket); 820 ret = pcmcia_register_socket(&socket[i].socket);
diff --git a/drivers/pcmcia/m32r_cfc.h b/drivers/pcmcia/m32r_cfc.h
index 17c1db7ae155..8146e3bee2e8 100644
--- a/drivers/pcmcia/m32r_cfc.h
+++ b/drivers/pcmcia/m32r_cfc.h
@@ -71,11 +71,15 @@
71 71
72#define CFC_IOPORT_BASE 0x1000 72#define CFC_IOPORT_BASE 0x1000
73 73
74#if !defined(CONFIG_PLAT_USRV) 74#if defined(CONFIG_PLAT_MAPPI3)
75#define CFC_ATTR_MAPBASE 0x14014000
76#define CFC_IO_MAPBASE_BYTE 0xb4012000
77#define CFC_IO_MAPBASE_WORD 0xb4002000
78#elif !defined(CONFIG_PLAT_USRV)
75#define CFC_ATTR_MAPBASE 0x0c014000 79#define CFC_ATTR_MAPBASE 0x0c014000
76#define CFC_IO_MAPBASE_BYTE 0xac012000 80#define CFC_IO_MAPBASE_BYTE 0xac012000
77#define CFC_IO_MAPBASE_WORD 0xac002000 81#define CFC_IO_MAPBASE_WORD 0xac002000
78#else /* CONFIG_PLAT_USRV */ 82#else
79#define CFC_ATTR_MAPBASE 0x04014000 83#define CFC_ATTR_MAPBASE 0x04014000
80#define CFC_IO_MAPBASE_BYTE 0xa4012000 84#define CFC_IO_MAPBASE_BYTE 0xa4012000
81#define CFC_IO_MAPBASE_WORD 0xa4002000 85#define CFC_IO_MAPBASE_WORD 0xa4002000
diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c
index 97eeecfaef1b..3252662958d3 100644
--- a/drivers/pnp/card.c
+++ b/drivers/pnp/card.c
@@ -140,7 +140,7 @@ static void pnp_release_card(struct device *dmdev)
140} 140}
141 141
142 142
143static ssize_t pnp_show_card_name(struct device *dmdev, char *buf) 143static ssize_t pnp_show_card_name(struct device *dmdev, struct device_attribute *attr, char *buf)
144{ 144{
145 char *str = buf; 145 char *str = buf;
146 struct pnp_card *card = to_pnp_card(dmdev); 146 struct pnp_card *card = to_pnp_card(dmdev);
@@ -150,7 +150,7 @@ static ssize_t pnp_show_card_name(struct device *dmdev, char *buf)
150 150
151static DEVICE_ATTR(name,S_IRUGO,pnp_show_card_name,NULL); 151static DEVICE_ATTR(name,S_IRUGO,pnp_show_card_name,NULL);
152 152
153static ssize_t pnp_show_card_ids(struct device *dmdev, char *buf) 153static ssize_t pnp_show_card_ids(struct device *dmdev, struct device_attribute *attr, char *buf)
154{ 154{
155 char *str = buf; 155 char *str = buf;
156 struct pnp_card *card = to_pnp_card(dmdev); 156 struct pnp_card *card = to_pnp_card(dmdev);
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index d64c1ca4fa76..1d037c2a82ac 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -160,10 +160,16 @@ struct bus_type pnp_bus_type = {
160}; 160};
161 161
162 162
163static int count_devices(struct device * dev, void * c)
164{
165 int * count = c;
166 (*count)++;
167 return 0;
168}
169
163int pnp_register_driver(struct pnp_driver *drv) 170int pnp_register_driver(struct pnp_driver *drv)
164{ 171{
165 int count; 172 int count;
166 struct list_head *pos;
167 173
168 pnp_dbg("the driver '%s' has been registered", drv->name); 174 pnp_dbg("the driver '%s' has been registered", drv->name);
169 175
@@ -177,9 +183,7 @@ int pnp_register_driver(struct pnp_driver *drv)
177 /* get the number of initial matches */ 183 /* get the number of initial matches */
178 if (count >= 0){ 184 if (count >= 0){
179 count = 0; 185 count = 0;
180 list_for_each(pos,&drv->driver.devices){ 186 driver_for_each_device(&drv->driver, NULL, &count, count_devices);
181 count++;
182 }
183 } 187 }
184 return count; 188 return count;
185} 189}
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index 53fac8ba5d5c..a2d8ce7fef9c 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -205,7 +205,7 @@ static void pnp_print_option(pnp_info_buffer_t *buffer, char *space,
205} 205}
206 206
207 207
208static ssize_t pnp_show_options(struct device *dmdev, char *buf) 208static ssize_t pnp_show_options(struct device *dmdev, struct device_attribute *attr, char *buf)
209{ 209{
210 struct pnp_dev *dev = to_pnp_dev(dmdev); 210 struct pnp_dev *dev = to_pnp_dev(dmdev);
211 struct pnp_option * independent = dev->independent; 211 struct pnp_option * independent = dev->independent;
@@ -236,7 +236,7 @@ static ssize_t pnp_show_options(struct device *dmdev, char *buf)
236static DEVICE_ATTR(options,S_IRUGO,pnp_show_options,NULL); 236static DEVICE_ATTR(options,S_IRUGO,pnp_show_options,NULL);
237 237
238 238
239static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf) 239static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_attribute *attr, char *buf)
240{ 240{
241 struct pnp_dev *dev = to_pnp_dev(dmdev); 241 struct pnp_dev *dev = to_pnp_dev(dmdev);
242 int i, ret; 242 int i, ret;
@@ -308,7 +308,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, char *buf)
308extern struct semaphore pnp_res_mutex; 308extern struct semaphore pnp_res_mutex;
309 309
310static ssize_t 310static ssize_t
311pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count) 311pnp_set_current_resources(struct device * dmdev, struct device_attribute *attr, const char * ubuf, size_t count)
312{ 312{
313 struct pnp_dev *dev = to_pnp_dev(dmdev); 313 struct pnp_dev *dev = to_pnp_dev(dmdev);
314 char *buf = (void *)ubuf; 314 char *buf = (void *)ubuf;
@@ -444,7 +444,7 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count
444static DEVICE_ATTR(resources,S_IRUGO | S_IWUSR, 444static DEVICE_ATTR(resources,S_IRUGO | S_IWUSR,
445 pnp_show_current_resources,pnp_set_current_resources); 445 pnp_show_current_resources,pnp_set_current_resources);
446 446
447static ssize_t pnp_show_current_ids(struct device *dmdev, char *buf) 447static ssize_t pnp_show_current_ids(struct device *dmdev, struct device_attribute *attr, char *buf)
448{ 448{
449 char *str = buf; 449 char *str = buf;
450 struct pnp_dev *dev = to_pnp_dev(dmdev); 450 struct pnp_dev *dev = to_pnp_dev(dmdev);
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index 1aedc48e5f85..d948566bb24a 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -615,7 +615,7 @@ dasd_device_from_cdev(struct ccw_device *cdev)
615 * readonly controls the readonly status of a dasd 615 * readonly controls the readonly status of a dasd
616 */ 616 */
617static ssize_t 617static ssize_t
618dasd_ro_show(struct device *dev, char *buf) 618dasd_ro_show(struct device *dev, struct device_attribute *attr, char *buf)
619{ 619{
620 struct dasd_devmap *devmap; 620 struct dasd_devmap *devmap;
621 int ro_flag; 621 int ro_flag;
@@ -629,7 +629,7 @@ dasd_ro_show(struct device *dev, char *buf)
629} 629}
630 630
631static ssize_t 631static ssize_t
632dasd_ro_store(struct device *dev, const char *buf, size_t count) 632dasd_ro_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
633{ 633{
634 struct dasd_devmap *devmap; 634 struct dasd_devmap *devmap;
635 int ro_flag; 635 int ro_flag;
@@ -656,7 +656,7 @@ static DEVICE_ATTR(readonly, 0644, dasd_ro_show, dasd_ro_store);
656 * to talk to the device 656 * to talk to the device
657 */ 657 */
658static ssize_t 658static ssize_t
659dasd_use_diag_show(struct device *dev, char *buf) 659dasd_use_diag_show(struct device *dev, struct device_attribute *attr, char *buf)
660{ 660{
661 struct dasd_devmap *devmap; 661 struct dasd_devmap *devmap;
662 int use_diag; 662 int use_diag;
@@ -670,7 +670,7 @@ dasd_use_diag_show(struct device *dev, char *buf)
670} 670}
671 671
672static ssize_t 672static ssize_t
673dasd_use_diag_store(struct device *dev, const char *buf, size_t count) 673dasd_use_diag_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
674{ 674{
675 struct dasd_devmap *devmap; 675 struct dasd_devmap *devmap;
676 ssize_t rc; 676 ssize_t rc;
@@ -698,7 +698,7 @@ static
698DEVICE_ATTR(use_diag, 0644, dasd_use_diag_show, dasd_use_diag_store); 698DEVICE_ATTR(use_diag, 0644, dasd_use_diag_show, dasd_use_diag_store);
699 699
700static ssize_t 700static ssize_t
701dasd_discipline_show(struct device *dev, char *buf) 701dasd_discipline_show(struct device *dev, struct device_attribute *attr, char *buf)
702{ 702{
703 struct dasd_devmap *devmap; 703 struct dasd_devmap *devmap;
704 char *dname; 704 char *dname;
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index a66b17b65296..16ab8d363ac6 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -45,16 +45,16 @@ static struct block_device_operations dcssblk_devops = {
45 .release = dcssblk_release, 45 .release = dcssblk_release,
46}; 46};
47 47
48static ssize_t dcssblk_add_store(struct device * dev, const char * buf, 48static ssize_t dcssblk_add_store(struct device * dev, struct device_attribute *attr, const char * buf,
49 size_t count); 49 size_t count);
50static ssize_t dcssblk_remove_store(struct device * dev, const char * buf, 50static ssize_t dcssblk_remove_store(struct device * dev, struct device_attribute *attr, const char * buf,
51 size_t count); 51 size_t count);
52static ssize_t dcssblk_save_store(struct device * dev, const char * buf, 52static ssize_t dcssblk_save_store(struct device * dev, struct device_attribute *attr, const char * buf,
53 size_t count); 53 size_t count);
54static ssize_t dcssblk_save_show(struct device *dev, char *buf); 54static ssize_t dcssblk_save_show(struct device *dev, struct device_attribute *attr, char *buf);
55static ssize_t dcssblk_shared_store(struct device * dev, const char * buf, 55static ssize_t dcssblk_shared_store(struct device * dev, struct device_attribute *attr, const char * buf,
56 size_t count); 56 size_t count);
57static ssize_t dcssblk_shared_show(struct device *dev, char *buf); 57static ssize_t dcssblk_shared_show(struct device *dev, struct device_attribute *attr, char *buf);
58 58
59static DEVICE_ATTR(add, S_IWUSR, NULL, dcssblk_add_store); 59static DEVICE_ATTR(add, S_IWUSR, NULL, dcssblk_add_store);
60static DEVICE_ATTR(remove, S_IWUSR, NULL, dcssblk_remove_store); 60static DEVICE_ATTR(remove, S_IWUSR, NULL, dcssblk_remove_store);
@@ -195,7 +195,7 @@ dcssblk_segment_warn(int rc, char* seg_name)
195 * operation (show + store) 195 * operation (show + store)
196 */ 196 */
197static ssize_t 197static ssize_t
198dcssblk_shared_show(struct device *dev, char *buf) 198dcssblk_shared_show(struct device *dev, struct device_attribute *attr, char *buf)
199{ 199{
200 struct dcssblk_dev_info *dev_info; 200 struct dcssblk_dev_info *dev_info;
201 201
@@ -204,7 +204,7 @@ dcssblk_shared_show(struct device *dev, char *buf)
204} 204}
205 205
206static ssize_t 206static ssize_t
207dcssblk_shared_store(struct device *dev, const char *inbuf, size_t count) 207dcssblk_shared_store(struct device *dev, struct device_attribute *attr, const char *inbuf, size_t count)
208{ 208{
209 struct dcssblk_dev_info *dev_info; 209 struct dcssblk_dev_info *dev_info;
210 int rc; 210 int rc;
@@ -288,7 +288,7 @@ out:
288 * (show + store) 288 * (show + store)
289 */ 289 */
290static ssize_t 290static ssize_t
291dcssblk_save_show(struct device *dev, char *buf) 291dcssblk_save_show(struct device *dev, struct device_attribute *attr, char *buf)
292{ 292{
293 struct dcssblk_dev_info *dev_info; 293 struct dcssblk_dev_info *dev_info;
294 294
@@ -297,7 +297,7 @@ dcssblk_save_show(struct device *dev, char *buf)
297} 297}
298 298
299static ssize_t 299static ssize_t
300dcssblk_save_store(struct device *dev, const char *inbuf, size_t count) 300dcssblk_save_store(struct device *dev, struct device_attribute *attr, const char *inbuf, size_t count)
301{ 301{
302 struct dcssblk_dev_info *dev_info; 302 struct dcssblk_dev_info *dev_info;
303 303
@@ -343,7 +343,7 @@ dcssblk_save_store(struct device *dev, const char *inbuf, size_t count)
343 * device attribute for adding devices 343 * device attribute for adding devices
344 */ 344 */
345static ssize_t 345static ssize_t
346dcssblk_add_store(struct device *dev, const char *buf, size_t count) 346dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
347{ 347{
348 int rc, i; 348 int rc, i;
349 struct dcssblk_dev_info *dev_info; 349 struct dcssblk_dev_info *dev_info;
@@ -517,7 +517,7 @@ out_nobuf:
517 * device attribute for removing devices 517 * device attribute for removing devices
518 */ 518 */
519static ssize_t 519static ssize_t
520dcssblk_remove_store(struct device *dev, const char *buf, size_t count) 520dcssblk_remove_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
521{ 521{
522 struct dcssblk_dev_info *dev_info; 522 struct dcssblk_dev_info *dev_info;
523 int rc, i; 523 int rc, i;
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index 8e16a9716686..d5eefeaba50c 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -1084,7 +1084,7 @@ raw3270_probe (struct ccw_device *cdev)
1084 * Additional attributes for a 3270 device 1084 * Additional attributes for a 3270 device
1085 */ 1085 */
1086static ssize_t 1086static ssize_t
1087raw3270_model_show(struct device *dev, char *buf) 1087raw3270_model_show(struct device *dev, struct device_attribute *attr, char *buf)
1088{ 1088{
1089 return snprintf(buf, PAGE_SIZE, "%i\n", 1089 return snprintf(buf, PAGE_SIZE, "%i\n",
1090 ((struct raw3270 *) dev->driver_data)->model); 1090 ((struct raw3270 *) dev->driver_data)->model);
@@ -1092,7 +1092,7 @@ raw3270_model_show(struct device *dev, char *buf)
1092static DEVICE_ATTR(model, 0444, raw3270_model_show, 0); 1092static DEVICE_ATTR(model, 0444, raw3270_model_show, 0);
1093 1093
1094static ssize_t 1094static ssize_t
1095raw3270_rows_show(struct device *dev, char *buf) 1095raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf)
1096{ 1096{
1097 return snprintf(buf, PAGE_SIZE, "%i\n", 1097 return snprintf(buf, PAGE_SIZE, "%i\n",
1098 ((struct raw3270 *) dev->driver_data)->rows); 1098 ((struct raw3270 *) dev->driver_data)->rows);
@@ -1100,7 +1100,7 @@ raw3270_rows_show(struct device *dev, char *buf)
1100static DEVICE_ATTR(rows, 0444, raw3270_rows_show, 0); 1100static DEVICE_ATTR(rows, 0444, raw3270_rows_show, 0);
1101 1101
1102static ssize_t 1102static ssize_t
1103raw3270_columns_show(struct device *dev, char *buf) 1103raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *buf)
1104{ 1104{
1105 return snprintf(buf, PAGE_SIZE, "%i\n", 1105 return snprintf(buf, PAGE_SIZE, "%i\n",
1106 ((struct raw3270 *) dev->driver_data)->cols); 1106 ((struct raw3270 *) dev->driver_data)->cols);
diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c
index 0f8ffd4167ca..ed0cb1f15b4c 100644
--- a/drivers/s390/char/tape_class.c
+++ b/drivers/s390/char/tape_class.c
@@ -16,7 +16,7 @@ MODULE_DESCRIPTION(
16); 16);
17MODULE_LICENSE("GPL"); 17MODULE_LICENSE("GPL");
18 18
19struct class_simple *tape_class; 19static struct class *tape_class;
20 20
21/* 21/*
22 * Register a tape device and return a pointer to the cdev structure. 22 * Register a tape device and return a pointer to the cdev structure.
@@ -70,7 +70,7 @@ struct tape_class_device *register_tape_dev(
70 if (rc) 70 if (rc)
71 goto fail_with_cdev; 71 goto fail_with_cdev;
72 72
73 tcd->class_device = class_simple_device_add( 73 tcd->class_device = class_device_create(
74 tape_class, 74 tape_class,
75 tcd->char_device->dev, 75 tcd->char_device->dev,
76 device, 76 device,
@@ -101,7 +101,7 @@ void unregister_tape_dev(struct tape_class_device *tcd)
101 &tcd->class_device->dev->kobj, 101 &tcd->class_device->dev->kobj,
102 tcd->mode_name 102 tcd->mode_name
103 ); 103 );
104 class_simple_device_remove(tcd->char_device->dev); 104 class_device_destroy(tape_class, tcd->char_device->dev);
105 cdev_del(tcd->char_device); 105 cdev_del(tcd->char_device);
106 kfree(tcd); 106 kfree(tcd);
107 } 107 }
@@ -111,14 +111,14 @@ EXPORT_SYMBOL(unregister_tape_dev);
111 111
112static int __init tape_init(void) 112static int __init tape_init(void)
113{ 113{
114 tape_class = class_simple_create(THIS_MODULE, "tape390"); 114 tape_class = class_create(THIS_MODULE, "tape390");
115 115
116 return 0; 116 return 0;
117} 117}
118 118
119static void __exit tape_exit(void) 119static void __exit tape_exit(void)
120{ 120{
121 class_simple_destroy(tape_class); 121 class_destroy(tape_class);
122 tape_class = NULL; 122 tape_class = NULL;
123} 123}
124 124
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index e51046ab8adc..b4df4a515b12 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -107,7 +107,7 @@ busid_to_int(char *bus_id)
107 * replaced by a link to the cdev tree. 107 * replaced by a link to the cdev tree.
108 */ 108 */
109static ssize_t 109static ssize_t
110tape_medium_state_show(struct device *dev, char *buf) 110tape_medium_state_show(struct device *dev, struct device_attribute *attr, char *buf)
111{ 111{
112 struct tape_device *tdev; 112 struct tape_device *tdev;
113 113
@@ -119,7 +119,7 @@ static
119DEVICE_ATTR(medium_state, 0444, tape_medium_state_show, NULL); 119DEVICE_ATTR(medium_state, 0444, tape_medium_state_show, NULL);
120 120
121static ssize_t 121static ssize_t
122tape_first_minor_show(struct device *dev, char *buf) 122tape_first_minor_show(struct device *dev, struct device_attribute *attr, char *buf)
123{ 123{
124 struct tape_device *tdev; 124 struct tape_device *tdev;
125 125
@@ -131,7 +131,7 @@ static
131DEVICE_ATTR(first_minor, 0444, tape_first_minor_show, NULL); 131DEVICE_ATTR(first_minor, 0444, tape_first_minor_show, NULL);
132 132
133static ssize_t 133static ssize_t
134tape_state_show(struct device *dev, char *buf) 134tape_state_show(struct device *dev, struct device_attribute *attr, char *buf)
135{ 135{
136 struct tape_device *tdev; 136 struct tape_device *tdev;
137 137
@@ -144,7 +144,7 @@ static
144DEVICE_ATTR(state, 0444, tape_state_show, NULL); 144DEVICE_ATTR(state, 0444, tape_state_show, NULL);
145 145
146static ssize_t 146static ssize_t
147tape_operation_show(struct device *dev, char *buf) 147tape_operation_show(struct device *dev, struct device_attribute *attr, char *buf)
148{ 148{
149 struct tape_device *tdev; 149 struct tape_device *tdev;
150 ssize_t rc; 150 ssize_t rc;
@@ -171,7 +171,7 @@ static
171DEVICE_ATTR(operation, 0444, tape_operation_show, NULL); 171DEVICE_ATTR(operation, 0444, tape_operation_show, NULL);
172 172
173static ssize_t 173static ssize_t
174tape_blocksize_show(struct device *dev, char *buf) 174tape_blocksize_show(struct device *dev, struct device_attribute *attr, char *buf)
175{ 175{
176 struct tape_device *tdev; 176 struct tape_device *tdev;
177 177
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index edf50d2bd10b..f7717327d15e 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -548,7 +548,7 @@ vmlogrdr_read (struct file *filp, char *data, size_t count, loff_t * ppos)
548} 548}
549 549
550static ssize_t 550static ssize_t
551vmlogrdr_autopurge_store(struct device * dev, const char * buf, size_t count) { 551vmlogrdr_autopurge_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t count) {
552 struct vmlogrdr_priv_t *priv = dev->driver_data; 552 struct vmlogrdr_priv_t *priv = dev->driver_data;
553 ssize_t ret = count; 553 ssize_t ret = count;
554 554
@@ -567,7 +567,7 @@ vmlogrdr_autopurge_store(struct device * dev, const char * buf, size_t count) {
567 567
568 568
569static ssize_t 569static ssize_t
570vmlogrdr_autopurge_show(struct device *dev, char *buf) { 570vmlogrdr_autopurge_show(struct device *dev, struct device_attribute *attr, char *buf) {
571 struct vmlogrdr_priv_t *priv = dev->driver_data; 571 struct vmlogrdr_priv_t *priv = dev->driver_data;
572 return sprintf(buf, "%u\n", priv->autopurge); 572 return sprintf(buf, "%u\n", priv->autopurge);
573} 573}
@@ -578,7 +578,7 @@ static DEVICE_ATTR(autopurge, 0644, vmlogrdr_autopurge_show,
578 578
579 579
580static ssize_t 580static ssize_t
581vmlogrdr_purge_store(struct device * dev, const char * buf, size_t count) { 581vmlogrdr_purge_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t count) {
582 582
583 char cp_command[80]; 583 char cp_command[80];
584 char cp_response[80]; 584 char cp_response[80];
@@ -619,7 +619,7 @@ static DEVICE_ATTR(purge, 0200, NULL, vmlogrdr_purge_store);
619 619
620 620
621static ssize_t 621static ssize_t
622vmlogrdr_autorecording_store(struct device *dev, const char *buf, 622vmlogrdr_autorecording_store(struct device *dev, struct device_attribute *attr, const char *buf,
623 size_t count) { 623 size_t count) {
624 struct vmlogrdr_priv_t *priv = dev->driver_data; 624 struct vmlogrdr_priv_t *priv = dev->driver_data;
625 ssize_t ret = count; 625 ssize_t ret = count;
@@ -639,7 +639,7 @@ vmlogrdr_autorecording_store(struct device *dev, const char *buf,
639 639
640 640
641static ssize_t 641static ssize_t
642vmlogrdr_autorecording_show(struct device *dev, char *buf) { 642vmlogrdr_autorecording_show(struct device *dev, struct device_attribute *attr, char *buf) {
643 struct vmlogrdr_priv_t *priv = dev->driver_data; 643 struct vmlogrdr_priv_t *priv = dev->driver_data;
644 return sprintf(buf, "%u\n", priv->autorecording); 644 return sprintf(buf, "%u\n", priv->autorecording);
645} 645}
@@ -650,7 +650,7 @@ static DEVICE_ATTR(autorecording, 0644, vmlogrdr_autorecording_show,
650 650
651 651
652static ssize_t 652static ssize_t
653vmlogrdr_recording_store(struct device * dev, const char * buf, size_t count) { 653vmlogrdr_recording_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t count) {
654 654
655 struct vmlogrdr_priv_t *priv = dev->driver_data; 655 struct vmlogrdr_priv_t *priv = dev->driver_data;
656 ssize_t ret; 656 ssize_t ret;
@@ -703,7 +703,7 @@ static struct attribute_group vmlogrdr_attr_group = {
703 .attrs = vmlogrdr_attrs, 703 .attrs = vmlogrdr_attrs,
704}; 704};
705 705
706static struct class_simple *vmlogrdr_class; 706static struct class *vmlogrdr_class;
707static struct device_driver vmlogrdr_driver = { 707static struct device_driver vmlogrdr_driver = {
708 .name = "vmlogrdr", 708 .name = "vmlogrdr",
709 .bus = &iucv_bus, 709 .bus = &iucv_bus,
@@ -727,7 +727,7 @@ vmlogrdr_register_driver(void) {
727 goto unregdriver; 727 goto unregdriver;
728 } 728 }
729 729
730 vmlogrdr_class = class_simple_create(THIS_MODULE, "vmlogrdr"); 730 vmlogrdr_class = class_create(THIS_MODULE, "vmlogrdr");
731 if (IS_ERR(vmlogrdr_class)) { 731 if (IS_ERR(vmlogrdr_class)) {
732 printk(KERN_ERR "vmlogrdr: failed to create class.\n"); 732 printk(KERN_ERR "vmlogrdr: failed to create class.\n");
733 ret=PTR_ERR(vmlogrdr_class); 733 ret=PTR_ERR(vmlogrdr_class);
@@ -746,7 +746,7 @@ unregdriver:
746 746
747static void 747static void
748vmlogrdr_unregister_driver(void) { 748vmlogrdr_unregister_driver(void) {
749 class_simple_destroy(vmlogrdr_class); 749 class_destroy(vmlogrdr_class);
750 vmlogrdr_class = NULL; 750 vmlogrdr_class = NULL;
751 driver_remove_file(&vmlogrdr_driver, &driver_attr_recording_status); 751 driver_remove_file(&vmlogrdr_driver, &driver_attr_recording_status);
752 driver_unregister(&vmlogrdr_driver); 752 driver_unregister(&vmlogrdr_driver);
@@ -786,7 +786,7 @@ vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) {
786 device_unregister(dev); 786 device_unregister(dev);
787 return ret; 787 return ret;
788 } 788 }
789 priv->class_device = class_simple_device_add( 789 priv->class_device = class_device_create(
790 vmlogrdr_class, 790 vmlogrdr_class,
791 MKDEV(vmlogrdr_major, priv->minor_num), 791 MKDEV(vmlogrdr_major, priv->minor_num),
792 dev, 792 dev,
@@ -806,7 +806,7 @@ vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) {
806 806
807static int 807static int
808vmlogrdr_unregister_device(struct vmlogrdr_priv_t *priv ) { 808vmlogrdr_unregister_device(struct vmlogrdr_priv_t *priv ) {
809 class_simple_device_remove(MKDEV(vmlogrdr_major, priv->minor_num)); 809 class_device_destroy(vmlogrdr_class, MKDEV(vmlogrdr_major, priv->minor_num));
810 if (priv->device != NULL) { 810 if (priv->device != NULL) {
811 sysfs_remove_group(&priv->device->kobj, &vmlogrdr_attr_group); 811 sysfs_remove_group(&priv->device->kobj, &vmlogrdr_attr_group);
812 device_unregister(priv->device); 812 device_unregister(priv->device);
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c
index 4a06c7d0e5e4..aac83ce6469c 100644
--- a/drivers/s390/cio/blacklist.c
+++ b/drivers/s390/cio/blacklist.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * drivers/s390/cio/blacklist.c 2 * drivers/s390/cio/blacklist.c
3 * S/390 common I/O routines -- blacklisting of specific devices 3 * S/390 common I/O routines -- blacklisting of specific devices
4 * $Revision: 1.33 $ 4 * $Revision: 1.34 $
5 * 5 *
6 * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, 6 * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
7 * IBM Corporation 7 * IBM Corporation
@@ -289,7 +289,7 @@ static int cio_ignore_read (char *page, char **start, off_t off,
289 len = 0; 289 len = 0;
290 for (devno = off; /* abuse the page variable 290 for (devno = off; /* abuse the page variable
291 * as counter, see fs/proc/generic.c */ 291 * as counter, see fs/proc/generic.c */
292 devno <= __MAX_SUBCHANNELS && len + entry_size < count; devno++) { 292 devno < __MAX_SUBCHANNELS && len + entry_size < count; devno++) {
293 if (!test_bit(devno, bl_dev)) 293 if (!test_bit(devno, bl_dev))
294 continue; 294 continue;
295 len += sprintf(page + len, "0.0.%04lx", devno); 295 len += sprintf(page + len, "0.0.%04lx", devno);
@@ -302,7 +302,7 @@ static int cio_ignore_read (char *page, char **start, off_t off,
302 len += sprintf(page + len, "\n"); 302 len += sprintf(page + len, "\n");
303 } 303 }
304 304
305 if (devno <= __MAX_SUBCHANNELS) 305 if (devno < __MAX_SUBCHANNELS)
306 *eof = 1; 306 *eof = 1;
307 *start = (char *) (devno - off); /* number of checked entries */ 307 *start = (char *) (devno - off); /* number of checked entries */
308 return len; 308 return len;
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index 21a75ee28b80..306525acb9f8 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -77,7 +77,7 @@ __ccwgroup_remove_symlinks(struct ccwgroup_device *gdev)
77 * longer needed or accidentially created. Saves memory :) 77 * longer needed or accidentially created. Saves memory :)
78 */ 78 */
79static ssize_t 79static ssize_t
80ccwgroup_ungroup_store(struct device *dev, const char *buf, size_t count) 80ccwgroup_ungroup_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
81{ 81{
82 struct ccwgroup_device *gdev; 82 struct ccwgroup_device *gdev;
83 83
@@ -310,7 +310,7 @@ ccwgroup_set_offline(struct ccwgroup_device *gdev)
310} 310}
311 311
312static ssize_t 312static ssize_t
313ccwgroup_online_store (struct device *dev, const char *buf, size_t count) 313ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
314{ 314{
315 struct ccwgroup_device *gdev; 315 struct ccwgroup_device *gdev;
316 struct ccwgroup_driver *gdrv; 316 struct ccwgroup_driver *gdrv;
@@ -338,7 +338,7 @@ ccwgroup_online_store (struct device *dev, const char *buf, size_t count)
338} 338}
339 339
340static ssize_t 340static ssize_t
341ccwgroup_online_show (struct device *dev, char *buf) 341ccwgroup_online_show (struct device *dev, struct device_attribute *attr, char *buf)
342{ 342{
343 int online; 343 int online;
344 344
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index b35fe12e6bfc..b86f94ecd874 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -852,7 +852,7 @@ out:
852 * Files for the channel path entries. 852 * Files for the channel path entries.
853 */ 853 */
854static ssize_t 854static ssize_t
855chp_status_show(struct device *dev, char *buf) 855chp_status_show(struct device *dev, struct device_attribute *attr, char *buf)
856{ 856{
857 struct channel_path *chp = container_of(dev, struct channel_path, dev); 857 struct channel_path *chp = container_of(dev, struct channel_path, dev);
858 858
@@ -863,7 +863,7 @@ chp_status_show(struct device *dev, char *buf)
863} 863}
864 864
865static ssize_t 865static ssize_t
866chp_status_write(struct device *dev, const char *buf, size_t count) 866chp_status_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
867{ 867{
868 struct channel_path *cp = container_of(dev, struct channel_path, dev); 868 struct channel_path *cp = container_of(dev, struct channel_path, dev);
869 char cmd[10]; 869 char cmd[10];
@@ -888,7 +888,7 @@ chp_status_write(struct device *dev, const char *buf, size_t count)
888static DEVICE_ATTR(status, 0644, chp_status_show, chp_status_write); 888static DEVICE_ATTR(status, 0644, chp_status_show, chp_status_write);
889 889
890static ssize_t 890static ssize_t
891chp_type_show(struct device *dev, char *buf) 891chp_type_show(struct device *dev, struct device_attribute *attr, char *buf)
892{ 892{
893 struct channel_path *chp = container_of(dev, struct channel_path, dev); 893 struct channel_path *chp = container_of(dev, struct channel_path, dev);
894 894
diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c
index 49def26ba383..8cc4f1a940dc 100644
--- a/drivers/s390/cio/cmf.c
+++ b/drivers/s390/cio/cmf.c
@@ -796,7 +796,7 @@ cmb_show_attr(struct device *dev, char *buf, enum cmb_index idx)
796} 796}
797 797
798static ssize_t 798static ssize_t
799cmb_show_avg_sample_interval(struct device *dev, char *buf) 799cmb_show_avg_sample_interval(struct device *dev, struct device_attribute *attr, char *buf)
800{ 800{
801 struct ccw_device *cdev; 801 struct ccw_device *cdev;
802 long interval; 802 long interval;
@@ -813,7 +813,7 @@ cmb_show_avg_sample_interval(struct device *dev, char *buf)
813} 813}
814 814
815static ssize_t 815static ssize_t
816cmb_show_avg_utilization(struct device *dev, char *buf) 816cmb_show_avg_utilization(struct device *dev, struct device_attribute *attr, char *buf)
817{ 817{
818 struct cmbdata data; 818 struct cmbdata data;
819 u64 utilization; 819 u64 utilization;
@@ -842,12 +842,12 @@ cmb_show_avg_utilization(struct device *dev, char *buf)
842} 842}
843 843
844#define cmf_attr(name) \ 844#define cmf_attr(name) \
845static ssize_t show_ ## name (struct device * dev, char * buf) \ 845static ssize_t show_ ## name (struct device * dev, struct device_attribute *attr, char * buf) \
846{ return cmb_show_attr((dev), buf, cmb_ ## name); } \ 846{ return cmb_show_attr((dev), buf, cmb_ ## name); } \
847static DEVICE_ATTR(name, 0444, show_ ## name, NULL); 847static DEVICE_ATTR(name, 0444, show_ ## name, NULL);
848 848
849#define cmf_attr_avg(name) \ 849#define cmf_attr_avg(name) \
850static ssize_t show_avg_ ## name (struct device * dev, char * buf) \ 850static ssize_t show_avg_ ## name (struct device * dev, struct device_attribute *attr, char * buf) \
851{ return cmb_show_attr((dev), buf, cmb_ ## name); } \ 851{ return cmb_show_attr((dev), buf, cmb_ ## name); } \
852static DEVICE_ATTR(avg_ ## name, 0444, show_avg_ ## name, NULL); 852static DEVICE_ATTR(avg_ ## name, 0444, show_avg_ ## name, NULL);
853 853
@@ -902,12 +902,12 @@ static struct attribute_group cmf_attr_group_ext = {
902 .attrs = cmf_attributes_ext, 902 .attrs = cmf_attributes_ext,
903}; 903};
904 904
905static ssize_t cmb_enable_show(struct device *dev, char *buf) 905static ssize_t cmb_enable_show(struct device *dev, struct device_attribute *attr, char *buf)
906{ 906{
907 return sprintf(buf, "%d\n", to_ccwdev(dev)->private->cmb ? 1 : 0); 907 return sprintf(buf, "%d\n", to_ccwdev(dev)->private->cmb ? 1 : 0);
908} 908}
909 909
910static ssize_t cmb_enable_store(struct device *dev, const char *buf, size_t c) 910static ssize_t cmb_enable_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t c)
911{ 911{
912 struct ccw_device *cdev; 912 struct ccw_device *cdev;
913 int ret; 913 int ret;
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index df0325505e4e..809e1108a06e 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -204,7 +204,7 @@ module_exit(cleanup_ccw_bus_type);
204 * TODO: Split chpids and pimpampom up? Where is "in use" in the tree? 204 * TODO: Split chpids and pimpampom up? Where is "in use" in the tree?
205 */ 205 */
206static ssize_t 206static ssize_t
207chpids_show (struct device * dev, char * buf) 207chpids_show (struct device * dev, struct device_attribute *attr, char * buf)
208{ 208{
209 struct subchannel *sch = to_subchannel(dev); 209 struct subchannel *sch = to_subchannel(dev);
210 struct ssd_info *ssd = &sch->ssd_info; 210 struct ssd_info *ssd = &sch->ssd_info;
@@ -219,7 +219,7 @@ chpids_show (struct device * dev, char * buf)
219} 219}
220 220
221static ssize_t 221static ssize_t
222pimpampom_show (struct device * dev, char * buf) 222pimpampom_show (struct device * dev, struct device_attribute *attr, char * buf)
223{ 223{
224 struct subchannel *sch = to_subchannel(dev); 224 struct subchannel *sch = to_subchannel(dev);
225 struct pmcw *pmcw = &sch->schib.pmcw; 225 struct pmcw *pmcw = &sch->schib.pmcw;
@@ -229,7 +229,7 @@ pimpampom_show (struct device * dev, char * buf)
229} 229}
230 230
231static ssize_t 231static ssize_t
232devtype_show (struct device *dev, char *buf) 232devtype_show (struct device *dev, struct device_attribute *attr, char *buf)
233{ 233{
234 struct ccw_device *cdev = to_ccwdev(dev); 234 struct ccw_device *cdev = to_ccwdev(dev);
235 struct ccw_device_id *id = &(cdev->id); 235 struct ccw_device_id *id = &(cdev->id);
@@ -242,7 +242,7 @@ devtype_show (struct device *dev, char *buf)
242} 242}
243 243
244static ssize_t 244static ssize_t
245cutype_show (struct device *dev, char *buf) 245cutype_show (struct device *dev, struct device_attribute *attr, char *buf)
246{ 246{
247 struct ccw_device *cdev = to_ccwdev(dev); 247 struct ccw_device *cdev = to_ccwdev(dev);
248 struct ccw_device_id *id = &(cdev->id); 248 struct ccw_device_id *id = &(cdev->id);
@@ -252,7 +252,7 @@ cutype_show (struct device *dev, char *buf)
252} 252}
253 253
254static ssize_t 254static ssize_t
255online_show (struct device *dev, char *buf) 255online_show (struct device *dev, struct device_attribute *attr, char *buf)
256{ 256{
257 struct ccw_device *cdev = to_ccwdev(dev); 257 struct ccw_device *cdev = to_ccwdev(dev);
258 258
@@ -350,7 +350,7 @@ ccw_device_set_online(struct ccw_device *cdev)
350} 350}
351 351
352static ssize_t 352static ssize_t
353online_store (struct device *dev, const char *buf, size_t count) 353online_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
354{ 354{
355 struct ccw_device *cdev = to_ccwdev(dev); 355 struct ccw_device *cdev = to_ccwdev(dev);
356 int i, force, ret; 356 int i, force, ret;
@@ -422,7 +422,7 @@ online_store (struct device *dev, const char *buf, size_t count)
422} 422}
423 423
424static ssize_t 424static ssize_t
425available_show (struct device *dev, char *buf) 425available_show (struct device *dev, struct device_attribute *attr, char *buf)
426{ 426{
427 struct ccw_device *cdev = to_ccwdev(dev); 427 struct ccw_device *cdev = to_ccwdev(dev);
428 struct subchannel *sch; 428 struct subchannel *sch;
diff --git a/drivers/s390/net/Makefile b/drivers/s390/net/Makefile
index 7cabb80a2e41..90d4d0ef3dd4 100644
--- a/drivers/s390/net/Makefile
+++ b/drivers/s390/net/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_NETIUCV) += netiucv.o fsm.o
9obj-$(CONFIG_SMSGIUCV) += smsgiucv.o 9obj-$(CONFIG_SMSGIUCV) += smsgiucv.o
10obj-$(CONFIG_CTC) += ctc.o fsm.o cu3088.o 10obj-$(CONFIG_CTC) += ctc.o fsm.o cu3088.o
11obj-$(CONFIG_LCS) += lcs.o cu3088.o 11obj-$(CONFIG_LCS) += lcs.o cu3088.o
12qeth-y := qeth_main.o qeth_mpc.o qeth_sys.o qeth_eddp.o qeth_tso.o 12obj-$(CONFIG_CLAW) += claw.o cu3088.o
13qeth-y := qeth_main.o qeth_mpc.o qeth_sys.o qeth_eddp.o
13qeth-$(CONFIG_PROC_FS) += qeth_proc.o 14qeth-$(CONFIG_PROC_FS) += qeth_proc.o
14obj-$(CONFIG_QETH) += qeth.o 15obj-$(CONFIG_QETH) += qeth.o
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c
index 06804d39a9c6..a99927d54ebb 100644
--- a/drivers/s390/net/claw.c
+++ b/drivers/s390/net/claw.c
@@ -241,20 +241,20 @@ static struct sk_buff *claw_pack_skb(struct claw_privbk *privptr);
241static void dumpit (char *buf, int len); 241static void dumpit (char *buf, int len);
242#endif 242#endif
243/* sysfs Functions */ 243/* sysfs Functions */
244static ssize_t claw_hname_show(struct device *dev, char *buf); 244static ssize_t claw_hname_show(struct device *dev, struct device_attribute *attr, char *buf);
245static ssize_t claw_hname_write(struct device *dev, 245static ssize_t claw_hname_write(struct device *dev, struct device_attribute *attr,
246 const char *buf, size_t count); 246 const char *buf, size_t count);
247static ssize_t claw_adname_show(struct device *dev, char *buf); 247static ssize_t claw_adname_show(struct device *dev, struct device_attribute *attr, char *buf);
248static ssize_t claw_adname_write(struct device *dev, 248static ssize_t claw_adname_write(struct device *dev, struct device_attribute *attr,
249 const char *buf, size_t count); 249 const char *buf, size_t count);
250static ssize_t claw_apname_show(struct device *dev, char *buf); 250static ssize_t claw_apname_show(struct device *dev, struct device_attribute *attr, char *buf);
251static ssize_t claw_apname_write(struct device *dev, 251static ssize_t claw_apname_write(struct device *dev, struct device_attribute *attr,
252 const char *buf, size_t count); 252 const char *buf, size_t count);
253static ssize_t claw_wbuff_show(struct device *dev, char *buf); 253static ssize_t claw_wbuff_show(struct device *dev, struct device_attribute *attr, char *buf);
254static ssize_t claw_wbuff_write(struct device *dev, 254static ssize_t claw_wbuff_write(struct device *dev, struct device_attribute *attr,
255 const char *buf, size_t count); 255 const char *buf, size_t count);
256static ssize_t claw_rbuff_show(struct device *dev, char *buf); 256static ssize_t claw_rbuff_show(struct device *dev, struct device_attribute *attr, char *buf);
257static ssize_t claw_rbuff_write(struct device *dev, 257static ssize_t claw_rbuff_write(struct device *dev, struct device_attribute *attr,
258 const char *buf, size_t count); 258 const char *buf, size_t count);
259static int claw_add_files(struct device *dev); 259static int claw_add_files(struct device *dev);
260static void claw_remove_files(struct device *dev); 260static void claw_remove_files(struct device *dev);
@@ -4149,7 +4149,7 @@ claw_remove_device(struct ccwgroup_device *cgdev)
4149 * sysfs attributes 4149 * sysfs attributes
4150 */ 4150 */
4151static ssize_t 4151static ssize_t
4152claw_hname_show(struct device *dev, char *buf) 4152claw_hname_show(struct device *dev, struct device_attribute *attr, char *buf)
4153{ 4153{
4154 struct claw_privbk *priv; 4154 struct claw_privbk *priv;
4155 struct claw_env * p_env; 4155 struct claw_env * p_env;
@@ -4162,7 +4162,7 @@ claw_hname_show(struct device *dev, char *buf)
4162} 4162}
4163 4163
4164static ssize_t 4164static ssize_t
4165claw_hname_write(struct device *dev, const char *buf, size_t count) 4165claw_hname_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
4166{ 4166{
4167 struct claw_privbk *priv; 4167 struct claw_privbk *priv;
4168 struct claw_env * p_env; 4168 struct claw_env * p_env;
@@ -4186,7 +4186,7 @@ claw_hname_write(struct device *dev, const char *buf, size_t count)
4186static DEVICE_ATTR(host_name, 0644, claw_hname_show, claw_hname_write); 4186static DEVICE_ATTR(host_name, 0644, claw_hname_show, claw_hname_write);
4187 4187
4188static ssize_t 4188static ssize_t
4189claw_adname_show(struct device *dev, char *buf) 4189claw_adname_show(struct device *dev, struct device_attribute *attr, char *buf)
4190{ 4190{
4191 struct claw_privbk *priv; 4191 struct claw_privbk *priv;
4192 struct claw_env * p_env; 4192 struct claw_env * p_env;
@@ -4199,7 +4199,7 @@ claw_adname_show(struct device *dev, char *buf)
4199} 4199}
4200 4200
4201static ssize_t 4201static ssize_t
4202claw_adname_write(struct device *dev, const char *buf, size_t count) 4202claw_adname_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
4203{ 4203{
4204 struct claw_privbk *priv; 4204 struct claw_privbk *priv;
4205 struct claw_env * p_env; 4205 struct claw_env * p_env;
@@ -4223,7 +4223,7 @@ claw_adname_write(struct device *dev, const char *buf, size_t count)
4223static DEVICE_ATTR(adapter_name, 0644, claw_adname_show, claw_adname_write); 4223static DEVICE_ATTR(adapter_name, 0644, claw_adname_show, claw_adname_write);
4224 4224
4225static ssize_t 4225static ssize_t
4226claw_apname_show(struct device *dev, char *buf) 4226claw_apname_show(struct device *dev, struct device_attribute *attr, char *buf)
4227{ 4227{
4228 struct claw_privbk *priv; 4228 struct claw_privbk *priv;
4229 struct claw_env * p_env; 4229 struct claw_env * p_env;
@@ -4237,7 +4237,7 @@ claw_apname_show(struct device *dev, char *buf)
4237} 4237}
4238 4238
4239static ssize_t 4239static ssize_t
4240claw_apname_write(struct device *dev, const char *buf, size_t count) 4240claw_apname_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
4241{ 4241{
4242 struct claw_privbk *priv; 4242 struct claw_privbk *priv;
4243 struct claw_env * p_env; 4243 struct claw_env * p_env;
@@ -4271,7 +4271,7 @@ claw_apname_write(struct device *dev, const char *buf, size_t count)
4271static DEVICE_ATTR(api_type, 0644, claw_apname_show, claw_apname_write); 4271static DEVICE_ATTR(api_type, 0644, claw_apname_show, claw_apname_write);
4272 4272
4273static ssize_t 4273static ssize_t
4274claw_wbuff_show(struct device *dev, char *buf) 4274claw_wbuff_show(struct device *dev, struct device_attribute *attr, char *buf)
4275{ 4275{
4276 struct claw_privbk *priv; 4276 struct claw_privbk *priv;
4277 struct claw_env * p_env; 4277 struct claw_env * p_env;
@@ -4284,7 +4284,7 @@ claw_wbuff_show(struct device *dev, char *buf)
4284} 4284}
4285 4285
4286static ssize_t 4286static ssize_t
4287claw_wbuff_write(struct device *dev, const char *buf, size_t count) 4287claw_wbuff_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
4288{ 4288{
4289 struct claw_privbk *priv; 4289 struct claw_privbk *priv;
4290 struct claw_env * p_env; 4290 struct claw_env * p_env;
@@ -4312,7 +4312,7 @@ claw_wbuff_write(struct device *dev, const char *buf, size_t count)
4312static DEVICE_ATTR(write_buffer, 0644, claw_wbuff_show, claw_wbuff_write); 4312static DEVICE_ATTR(write_buffer, 0644, claw_wbuff_show, claw_wbuff_write);
4313 4313
4314static ssize_t 4314static ssize_t
4315claw_rbuff_show(struct device *dev, char *buf) 4315claw_rbuff_show(struct device *dev, struct device_attribute *attr, char *buf)
4316{ 4316{
4317 struct claw_privbk *priv; 4317 struct claw_privbk *priv;
4318 struct claw_env * p_env; 4318 struct claw_env * p_env;
@@ -4325,7 +4325,7 @@ claw_rbuff_show(struct device *dev, char *buf)
4325} 4325}
4326 4326
4327static ssize_t 4327static ssize_t
4328claw_rbuff_write(struct device *dev, const char *buf, size_t count) 4328claw_rbuff_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
4329{ 4329{
4330 struct claw_privbk *priv; 4330 struct claw_privbk *priv;
4331 struct claw_env *p_env; 4331 struct claw_env *p_env;
diff --git a/drivers/s390/net/ctcdbug.h b/drivers/s390/net/ctcdbug.h
index ef8883951720..7fe2ebd1792d 100644
--- a/drivers/s390/net/ctcdbug.h
+++ b/drivers/s390/net/ctcdbug.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * linux/drivers/s390/net/ctcdbug.h ($Revision: 1.4 $) 3 * linux/drivers/s390/net/ctcdbug.h ($Revision: 1.5 $)
4 * 4 *
5 * CTC / ESCON network driver - s390 dbf exploit. 5 * CTC / ESCON network driver - s390 dbf exploit.
6 * 6 *
@@ -9,7 +9,7 @@
9 * Author(s): Original Code written by 9 * Author(s): Original Code written by
10 * Peter Tiedemann (ptiedem@de.ibm.com) 10 * Peter Tiedemann (ptiedem@de.ibm.com)
11 * 11 *
12 * $Revision: 1.4 $ $Date: 2004/10/15 09:26:58 $ 12 * $Revision: 1.5 $ $Date: 2005/02/27 19:46:44 $
13 * 13 *
14 * This program is free software; you can redistribute it and/or modify 14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by 15 * it under the terms of the GNU General Public License as published by
@@ -25,9 +25,11 @@
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 */ 27 */
28 28#ifndef _CTCDBUG_H_
29#define _CTCDBUG_H_
29 30
30#include <asm/debug.h> 31#include <asm/debug.h>
32#include "ctcmain.h"
31/** 33/**
32 * Debug Facility stuff 34 * Debug Facility stuff
33 */ 35 */
@@ -41,7 +43,7 @@
41#define CTC_DBF_DATA_LEN 128 43#define CTC_DBF_DATA_LEN 128
42#define CTC_DBF_DATA_INDEX 3 44#define CTC_DBF_DATA_INDEX 3
43#define CTC_DBF_DATA_NR_AREAS 1 45#define CTC_DBF_DATA_NR_AREAS 1
44#define CTC_DBF_DATA_LEVEL 2 46#define CTC_DBF_DATA_LEVEL 3
45 47
46#define CTC_DBF_TRACE_NAME "ctc_trace" 48#define CTC_DBF_TRACE_NAME "ctc_trace"
47#define CTC_DBF_TRACE_LEN 16 49#define CTC_DBF_TRACE_LEN 16
@@ -121,3 +123,5 @@ hex_dump(unsigned char *buf, size_t len)
121 printk("\n"); 123 printk("\n");
122} 124}
123 125
126
127#endif
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c
index 7266bf5ea659..96ca863eaff2 100644
--- a/drivers/s390/net/ctcmain.c
+++ b/drivers/s390/net/ctcmain.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: ctcmain.c,v 1.72 2005/03/17 10:51:52 ptiedem Exp $ 2 * $Id: ctcmain.c,v 1.74 2005/03/24 09:04:17 mschwide Exp $
3 * 3 *
4 * CTC / ESCON network driver 4 * CTC / ESCON network driver
5 * 5 *
@@ -37,12 +37,11 @@
37 * along with this program; if not, write to the Free Software 37 * along with this program; if not, write to the Free Software
38 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 38 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
39 * 39 *
40 * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.72 $ 40 * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.74 $
41 * 41 *
42 */ 42 */
43 43
44#undef DEBUG 44#undef DEBUG
45
46#include <linux/module.h> 45#include <linux/module.h>
47#include <linux/init.h> 46#include <linux/init.h>
48#include <linux/kernel.h> 47#include <linux/kernel.h>
@@ -74,288 +73,13 @@
74#include "ctctty.h" 73#include "ctctty.h"
75#include "fsm.h" 74#include "fsm.h"
76#include "cu3088.h" 75#include "cu3088.h"
76
77#include "ctcdbug.h" 77#include "ctcdbug.h"
78#include "ctcmain.h"
78 79
79MODULE_AUTHOR("(C) 2000 IBM Corp. by Fritz Elfert (felfert@millenux.com)"); 80MODULE_AUTHOR("(C) 2000 IBM Corp. by Fritz Elfert (felfert@millenux.com)");
80MODULE_DESCRIPTION("Linux for S/390 CTC/Escon Driver"); 81MODULE_DESCRIPTION("Linux for S/390 CTC/Escon Driver");
81MODULE_LICENSE("GPL"); 82MODULE_LICENSE("GPL");
82
83/**
84 * CCW commands, used in this driver.
85 */
86#define CCW_CMD_WRITE 0x01
87#define CCW_CMD_READ 0x02
88#define CCW_CMD_SET_EXTENDED 0xc3
89#define CCW_CMD_PREPARE 0xe3
90
91#define CTC_PROTO_S390 0
92#define CTC_PROTO_LINUX 1
93#define CTC_PROTO_LINUX_TTY 2
94#define CTC_PROTO_OS390 3
95#define CTC_PROTO_MAX 3
96
97#define CTC_BUFSIZE_LIMIT 65535
98#define CTC_BUFSIZE_DEFAULT 32768
99
100#define CTC_TIMEOUT_5SEC 5000
101
102#define CTC_INITIAL_BLOCKLEN 2
103
104#define READ 0
105#define WRITE 1
106
107#define CTC_ID_SIZE BUS_ID_SIZE+3
108
109
110struct ctc_profile {
111 unsigned long maxmulti;
112 unsigned long maxcqueue;
113 unsigned long doios_single;
114 unsigned long doios_multi;
115 unsigned long txlen;
116 unsigned long tx_time;
117 struct timespec send_stamp;
118};
119
120/**
121 * Definition of one channel
122 */
123struct channel {
124
125 /**
126 * Pointer to next channel in list.
127 */
128 struct channel *next;
129 char id[CTC_ID_SIZE];
130 struct ccw_device *cdev;
131
132 /**
133 * Type of this channel.
134 * CTC/A or Escon for valid channels.
135 */
136 enum channel_types type;
137
138 /**
139 * Misc. flags. See CHANNEL_FLAGS_... below
140 */
141 __u32 flags;
142
143 /**
144 * The protocol of this channel
145 */
146 __u16 protocol;
147
148 /**
149 * I/O and irq related stuff
150 */
151 struct ccw1 *ccw;
152 struct irb *irb;
153
154 /**
155 * RX/TX buffer size
156 */
157 int max_bufsize;
158
159 /**
160 * Transmit/Receive buffer.
161 */
162 struct sk_buff *trans_skb;
163
164 /**
165 * Universal I/O queue.
166 */
167 struct sk_buff_head io_queue;
168
169 /**
170 * TX queue for collecting skb's during busy.
171 */
172 struct sk_buff_head collect_queue;
173
174 /**
175 * Amount of data in collect_queue.
176 */
177 int collect_len;
178
179 /**
180 * spinlock for collect_queue and collect_len
181 */
182 spinlock_t collect_lock;
183
184 /**
185 * Timer for detecting unresposive
186 * I/O operations.
187 */
188 fsm_timer timer;
189
190 /**
191 * Retry counter for misc. operations.
192 */
193 int retry;
194
195 /**
196 * The finite state machine of this channel
197 */
198 fsm_instance *fsm;
199
200 /**
201 * The corresponding net_device this channel
202 * belongs to.
203 */
204 struct net_device *netdev;
205
206 struct ctc_profile prof;
207
208 unsigned char *trans_skb_data;
209
210 __u16 logflags;
211};
212
213#define CHANNEL_FLAGS_READ 0
214#define CHANNEL_FLAGS_WRITE 1
215#define CHANNEL_FLAGS_INUSE 2
216#define CHANNEL_FLAGS_BUFSIZE_CHANGED 4
217#define CHANNEL_FLAGS_FAILED 8
218#define CHANNEL_FLAGS_WAITIRQ 16
219#define CHANNEL_FLAGS_RWMASK 1
220#define CHANNEL_DIRECTION(f) (f & CHANNEL_FLAGS_RWMASK)
221
222#define LOG_FLAG_ILLEGALPKT 1
223#define LOG_FLAG_ILLEGALSIZE 2
224#define LOG_FLAG_OVERRUN 4
225#define LOG_FLAG_NOMEM 8
226
227#define CTC_LOGLEVEL_INFO 1
228#define CTC_LOGLEVEL_NOTICE 2
229#define CTC_LOGLEVEL_WARN 4
230#define CTC_LOGLEVEL_EMERG 8
231#define CTC_LOGLEVEL_ERR 16
232#define CTC_LOGLEVEL_DEBUG 32
233#define CTC_LOGLEVEL_CRIT 64
234
235#define CTC_LOGLEVEL_DEFAULT \
236(CTC_LOGLEVEL_INFO | CTC_LOGLEVEL_NOTICE | CTC_LOGLEVEL_WARN | CTC_LOGLEVEL_CRIT)
237
238#define CTC_LOGLEVEL_MAX ((CTC_LOGLEVEL_CRIT<<1)-1)
239
240static int loglevel = CTC_LOGLEVEL_DEFAULT;
241
242#define ctc_pr_debug(fmt, arg...) \
243do { if (loglevel & CTC_LOGLEVEL_DEBUG) printk(KERN_DEBUG fmt,##arg); } while (0)
244
245#define ctc_pr_info(fmt, arg...) \
246do { if (loglevel & CTC_LOGLEVEL_INFO) printk(KERN_INFO fmt,##arg); } while (0)
247
248#define ctc_pr_notice(fmt, arg...) \
249do { if (loglevel & CTC_LOGLEVEL_NOTICE) printk(KERN_NOTICE fmt,##arg); } while (0)
250
251#define ctc_pr_warn(fmt, arg...) \
252do { if (loglevel & CTC_LOGLEVEL_WARN) printk(KERN_WARNING fmt,##arg); } while (0)
253
254#define ctc_pr_emerg(fmt, arg...) \
255do { if (loglevel & CTC_LOGLEVEL_EMERG) printk(KERN_EMERG fmt,##arg); } while (0)
256
257#define ctc_pr_err(fmt, arg...) \
258do { if (loglevel & CTC_LOGLEVEL_ERR) printk(KERN_ERR fmt,##arg); } while (0)
259
260#define ctc_pr_crit(fmt, arg...) \
261do { if (loglevel & CTC_LOGLEVEL_CRIT) printk(KERN_CRIT fmt,##arg); } while (0)
262
263/**
264 * Linked list of all detected channels.
265 */
266static struct channel *channels = NULL;
267
268struct ctc_priv {
269 struct net_device_stats stats;
270 unsigned long tbusy;
271 /**
272 * The finite state machine of this interface.
273 */
274 fsm_instance *fsm;
275 /**
276 * The protocol of this device
277 */
278 __u16 protocol;
279 /**
280 * Timer for restarting after I/O Errors
281 */
282 fsm_timer restart_timer;
283
284 int buffer_size;
285
286 struct channel *channel[2];
287};
288
289/**
290 * Definition of our link level header.
291 */
292struct ll_header {
293 __u16 length;
294 __u16 type;
295 __u16 unused;
296};
297#define LL_HEADER_LENGTH (sizeof(struct ll_header))
298
299/**
300 * Compatibility macros for busy handling
301 * of network devices.
302 */
303static __inline__ void
304ctc_clear_busy(struct net_device * dev)
305{
306 clear_bit(0, &(((struct ctc_priv *) dev->priv)->tbusy));
307 if (((struct ctc_priv *)dev->priv)->protocol != CTC_PROTO_LINUX_TTY)
308 netif_wake_queue(dev);
309}
310
311static __inline__ int
312ctc_test_and_set_busy(struct net_device * dev)
313{
314 if (((struct ctc_priv *)dev->priv)->protocol != CTC_PROTO_LINUX_TTY)
315 netif_stop_queue(dev);
316 return test_and_set_bit(0, &((struct ctc_priv *) dev->priv)->tbusy);
317}
318
319/**
320 * Print Banner.
321 */
322static void
323print_banner(void)
324{
325 static int printed = 0;
326 char vbuf[] = "$Revision: 1.72 $";
327 char *version = vbuf;
328
329 if (printed)
330 return;
331 if ((version = strchr(version, ':'))) {
332 char *p = strchr(version + 1, '$');
333 if (p)
334 *p = '\0';
335 } else
336 version = " ??? ";
337 printk(KERN_INFO "CTC driver Version%s"
338#ifdef DEBUG
339 " (DEBUG-VERSION, " __DATE__ __TIME__ ")"
340#endif
341 " initialized\n", version);
342 printed = 1;
343}
344
345/**
346 * Return type of a detected device.
347 */
348static enum channel_types
349get_channel_type(struct ccw_device_id *id)
350{
351 enum channel_types type = (enum channel_types) id->driver_info;
352
353 if (type == channel_type_ficon)
354 type = channel_type_escon;
355
356 return type;
357}
358
359/** 83/**
360 * States of the interface statemachine. 84 * States of the interface statemachine.
361 */ 85 */
@@ -371,7 +95,7 @@ enum dev_states {
371 /** 95 /**
372 * MUST be always the last element!! 96 * MUST be always the last element!!
373 */ 97 */
374 NR_DEV_STATES 98 CTC_NR_DEV_STATES
375}; 99};
376 100
377static const char *dev_state_names[] = { 101static const char *dev_state_names[] = {
@@ -399,7 +123,7 @@ enum dev_events {
399 /** 123 /**
400 * MUST be always the last element!! 124 * MUST be always the last element!!
401 */ 125 */
402 NR_DEV_EVENTS 126 CTC_NR_DEV_EVENTS
403}; 127};
404 128
405static const char *dev_event_names[] = { 129static const char *dev_event_names[] = {
@@ -476,40 +200,6 @@ enum ch_events {
476 NR_CH_EVENTS, 200 NR_CH_EVENTS,
477}; 201};
478 202
479static const char *ch_event_names[] = {
480 "ccw_device success",
481 "ccw_device busy",
482 "ccw_device enodev",
483 "ccw_device ioerr",
484 "ccw_device unknown",
485
486 "Status ATTN & BUSY",
487 "Status ATTN",
488 "Status BUSY",
489
490 "Unit check remote reset",
491 "Unit check remote system reset",
492 "Unit check TX timeout",
493 "Unit check TX parity",
494 "Unit check Hardware failure",
495 "Unit check RX parity",
496 "Unit check ZERO",
497 "Unit check Unknown",
498
499 "SubChannel check Unknown",
500
501 "Machine check failure",
502 "Machine check operational",
503
504 "IRQ normal",
505 "IRQ final",
506
507 "Timer",
508
509 "Start",
510 "Stop",
511};
512
513/** 203/**
514 * States of the channel statemachine. 204 * States of the channel statemachine.
515 */ 205 */
@@ -545,6 +235,87 @@ enum ch_states {
545 NR_CH_STATES, 235 NR_CH_STATES,
546}; 236};
547 237
238static int loglevel = CTC_LOGLEVEL_DEFAULT;
239
240/**
241 * Linked list of all detected channels.
242 */
243static struct channel *channels = NULL;
244
245/**
246 * Print Banner.
247 */
248static void
249print_banner(void)
250{
251 static int printed = 0;
252 char vbuf[] = "$Revision: 1.74 $";
253 char *version = vbuf;
254
255 if (printed)
256 return;
257 if ((version = strchr(version, ':'))) {
258 char *p = strchr(version + 1, '$');
259 if (p)
260 *p = '\0';
261 } else
262 version = " ??? ";
263 printk(KERN_INFO "CTC driver Version%s"
264#ifdef DEBUG
265 " (DEBUG-VERSION, " __DATE__ __TIME__ ")"
266#endif
267 " initialized\n", version);
268 printed = 1;
269}
270
271/**
272 * Return type of a detected device.
273 */
274static enum channel_types
275get_channel_type(struct ccw_device_id *id)
276{
277 enum channel_types type = (enum channel_types) id->driver_info;
278
279 if (type == channel_type_ficon)
280 type = channel_type_escon;
281
282 return type;
283}
284
285static const char *ch_event_names[] = {
286 "ccw_device success",
287 "ccw_device busy",
288 "ccw_device enodev",
289 "ccw_device ioerr",
290 "ccw_device unknown",
291
292 "Status ATTN & BUSY",
293 "Status ATTN",
294 "Status BUSY",
295
296 "Unit check remote reset",
297 "Unit check remote system reset",
298 "Unit check TX timeout",
299 "Unit check TX parity",
300 "Unit check Hardware failure",
301 "Unit check RX parity",
302 "Unit check ZERO",
303 "Unit check Unknown",
304
305 "SubChannel check Unknown",
306
307 "Machine check failure",
308 "Machine check operational",
309
310 "IRQ normal",
311 "IRQ final",
312
313 "Timer",
314
315 "Start",
316 "Stop",
317};
318
548static const char *ch_state_names[] = { 319static const char *ch_state_names[] = {
549 "Idle", 320 "Idle",
550 "Stopped", 321 "Stopped",
@@ -1934,7 +1705,6 @@ add_channel(struct ccw_device *cdev, enum channel_types type)
1934 ch->cdev = cdev; 1705 ch->cdev = cdev;
1935 snprintf(ch->id, CTC_ID_SIZE, "ch-%s", cdev->dev.bus_id); 1706 snprintf(ch->id, CTC_ID_SIZE, "ch-%s", cdev->dev.bus_id);
1936 ch->type = type; 1707 ch->type = type;
1937 loglevel = CTC_LOGLEVEL_DEFAULT;
1938 ch->fsm = init_fsm(ch->id, ch_state_names, 1708 ch->fsm = init_fsm(ch->id, ch_state_names,
1939 ch_event_names, NR_CH_STATES, NR_CH_EVENTS, 1709 ch_event_names, NR_CH_STATES, NR_CH_EVENTS,
1940 ch_fsm, CH_FSM_LEN, GFP_KERNEL); 1710 ch_fsm, CH_FSM_LEN, GFP_KERNEL);
@@ -2697,8 +2467,9 @@ ctc_stats(struct net_device * dev)
2697/* 2467/*
2698 * sysfs attributes 2468 * sysfs attributes
2699 */ 2469 */
2470
2700static ssize_t 2471static ssize_t
2701buffer_show(struct device *dev, char *buf) 2472buffer_show(struct device *dev, struct device_attribute *attr, char *buf)
2702{ 2473{
2703 struct ctc_priv *priv; 2474 struct ctc_priv *priv;
2704 2475
@@ -2710,62 +2481,66 @@ buffer_show(struct device *dev, char *buf)
2710} 2481}
2711 2482
2712static ssize_t 2483static ssize_t
2713buffer_write(struct device *dev, const char *buf, size_t count) 2484buffer_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
2714{ 2485{
2715 struct ctc_priv *priv; 2486 struct ctc_priv *priv;
2716 struct net_device *ndev; 2487 struct net_device *ndev;
2717 int bs1; 2488 int bs1;
2489 char buffer[16];
2718 2490
2719 DBF_TEXT(trace, 3, __FUNCTION__); 2491 DBF_TEXT(trace, 3, __FUNCTION__);
2492 DBF_TEXT(trace, 3, buf);
2720 priv = dev->driver_data; 2493 priv = dev->driver_data;
2721 if (!priv) 2494 if (!priv) {
2495 DBF_TEXT(trace, 3, "bfnopriv");
2722 return -ENODEV; 2496 return -ENODEV;
2497 }
2498
2499 sscanf(buf, "%u", &bs1);
2500 if (bs1 > CTC_BUFSIZE_LIMIT)
2501 goto einval;
2502 if (bs1 < (576 + LL_HEADER_LENGTH + 2))
2503 goto einval;
2504 priv->buffer_size = bs1; // just to overwrite the default
2505
2723 ndev = priv->channel[READ]->netdev; 2506 ndev = priv->channel[READ]->netdev;
2724 if (!ndev) 2507 if (!ndev) {
2508 DBF_TEXT(trace, 3, "bfnondev");
2725 return -ENODEV; 2509 return -ENODEV;
2726 sscanf(buf, "%u", &bs1); 2510 }
2727 2511
2728 if (bs1 > CTC_BUFSIZE_LIMIT)
2729 return -EINVAL;
2730 if ((ndev->flags & IFF_RUNNING) && 2512 if ((ndev->flags & IFF_RUNNING) &&
2731 (bs1 < (ndev->mtu + LL_HEADER_LENGTH + 2))) 2513 (bs1 < (ndev->mtu + LL_HEADER_LENGTH + 2)))
2732 return -EINVAL; 2514 goto einval;
2733 if (bs1 < (576 + LL_HEADER_LENGTH + 2))
2734 return -EINVAL;
2735 2515
2736 priv->buffer_size = bs1; 2516 priv->channel[READ]->max_bufsize = bs1;
2737 priv->channel[READ]->max_bufsize = 2517 priv->channel[WRITE]->max_bufsize = bs1;
2738 priv->channel[WRITE]->max_bufsize = bs1;
2739 if (!(ndev->flags & IFF_RUNNING)) 2518 if (!(ndev->flags & IFF_RUNNING))
2740 ndev->mtu = bs1 - LL_HEADER_LENGTH - 2; 2519 ndev->mtu = bs1 - LL_HEADER_LENGTH - 2;
2741 priv->channel[READ]->flags |= CHANNEL_FLAGS_BUFSIZE_CHANGED; 2520 priv->channel[READ]->flags |= CHANNEL_FLAGS_BUFSIZE_CHANGED;
2742 priv->channel[WRITE]->flags |= CHANNEL_FLAGS_BUFSIZE_CHANGED; 2521 priv->channel[WRITE]->flags |= CHANNEL_FLAGS_BUFSIZE_CHANGED;
2743 2522
2523 sprintf(buffer, "%d",priv->buffer_size);
2524 DBF_TEXT(trace, 3, buffer);
2744 return count; 2525 return count;
2745 2526
2527einval:
2528 DBF_TEXT(trace, 3, "buff_err");
2529 return -EINVAL;
2746} 2530}
2747 2531
2748static ssize_t 2532static ssize_t
2749loglevel_show(struct device *dev, char *buf) 2533loglevel_show(struct device *dev, struct device_attribute *attr, char *buf)
2750{ 2534{
2751 struct ctc_priv *priv;
2752
2753 priv = dev->driver_data;
2754 if (!priv)
2755 return -ENODEV;
2756 return sprintf(buf, "%d\n", loglevel); 2535 return sprintf(buf, "%d\n", loglevel);
2757} 2536}
2758 2537
2759static ssize_t 2538static ssize_t
2760loglevel_write(struct device *dev, const char *buf, size_t count) 2539loglevel_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
2761{ 2540{
2762 struct ctc_priv *priv;
2763 int ll1; 2541 int ll1;
2764 2542
2765 DBF_TEXT(trace, 5, __FUNCTION__); 2543 DBF_TEXT(trace, 5, __FUNCTION__);
2766 priv = dev->driver_data;
2767 if (!priv)
2768 return -ENODEV;
2769 sscanf(buf, "%i", &ll1); 2544 sscanf(buf, "%i", &ll1);
2770 2545
2771 if ((ll1 > CTC_LOGLEVEL_MAX) || (ll1 < 0)) 2546 if ((ll1 > CTC_LOGLEVEL_MAX) || (ll1 < 0))
@@ -2814,7 +2589,7 @@ ctc_print_statistics(struct ctc_priv *priv)
2814} 2589}
2815 2590
2816static ssize_t 2591static ssize_t
2817stats_show(struct device *dev, char *buf) 2592stats_show(struct device *dev, struct device_attribute *attr, char *buf)
2818{ 2593{
2819 struct ctc_priv *priv = dev->driver_data; 2594 struct ctc_priv *priv = dev->driver_data;
2820 if (!priv) 2595 if (!priv)
@@ -2824,7 +2599,7 @@ stats_show(struct device *dev, char *buf)
2824} 2599}
2825 2600
2826static ssize_t 2601static ssize_t
2827stats_write(struct device *dev, const char *buf, size_t count) 2602stats_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
2828{ 2603{
2829 struct ctc_priv *priv = dev->driver_data; 2604 struct ctc_priv *priv = dev->driver_data;
2830 if (!priv) 2605 if (!priv)
@@ -2835,27 +2610,6 @@ stats_write(struct device *dev, const char *buf, size_t count)
2835 return count; 2610 return count;
2836} 2611}
2837 2612
2838static DEVICE_ATTR(buffer, 0644, buffer_show, buffer_write);
2839static DEVICE_ATTR(loglevel, 0644, loglevel_show, loglevel_write);
2840static DEVICE_ATTR(stats, 0644, stats_show, stats_write);
2841
2842static int
2843ctc_add_attributes(struct device *dev)
2844{
2845// device_create_file(dev, &dev_attr_buffer);
2846 device_create_file(dev, &dev_attr_loglevel);
2847 device_create_file(dev, &dev_attr_stats);
2848 return 0;
2849}
2850
2851static void
2852ctc_remove_attributes(struct device *dev)
2853{
2854 device_remove_file(dev, &dev_attr_stats);
2855 device_remove_file(dev, &dev_attr_loglevel);
2856// device_remove_file(dev, &dev_attr_buffer);
2857}
2858
2859 2613
2860static void 2614static void
2861ctc_netdev_unregister(struct net_device * dev) 2615ctc_netdev_unregister(struct net_device * dev)
@@ -2899,54 +2653,8 @@ ctc_free_netdevice(struct net_device * dev, int free_dev)
2899#endif 2653#endif
2900} 2654}
2901 2655
2902/**
2903 * Initialize everything of the net device except the name and the
2904 * channel structs.
2905 */
2906static struct net_device *
2907ctc_init_netdevice(struct net_device * dev, int alloc_device,
2908 struct ctc_priv *privptr)
2909{
2910 if (!privptr)
2911 return NULL;
2912
2913 DBF_TEXT(setup, 3, __FUNCTION__);
2914 if (alloc_device) {
2915 dev = kmalloc(sizeof (struct net_device), GFP_KERNEL);
2916 if (!dev)
2917 return NULL;
2918 memset(dev, 0, sizeof (struct net_device));
2919 }
2920
2921 dev->priv = privptr;
2922 privptr->fsm = init_fsm("ctcdev", dev_state_names,
2923 dev_event_names, NR_DEV_STATES, NR_DEV_EVENTS,
2924 dev_fsm, DEV_FSM_LEN, GFP_KERNEL);
2925 if (privptr->fsm == NULL) {
2926 if (alloc_device)
2927 kfree(dev);
2928 return NULL;
2929 }
2930 fsm_newstate(privptr->fsm, DEV_STATE_STOPPED);
2931 fsm_settimer(privptr->fsm, &privptr->restart_timer);
2932 if (dev->mtu == 0)
2933 dev->mtu = CTC_BUFSIZE_DEFAULT - LL_HEADER_LENGTH - 2;
2934 dev->hard_start_xmit = ctc_tx;
2935 dev->open = ctc_open;
2936 dev->stop = ctc_close;
2937 dev->get_stats = ctc_stats;
2938 dev->change_mtu = ctc_change_mtu;
2939 dev->hard_header_len = LL_HEADER_LENGTH + 2;
2940 dev->addr_len = 0;
2941 dev->type = ARPHRD_SLIP;
2942 dev->tx_queue_len = 100;
2943 dev->flags = IFF_POINTOPOINT | IFF_NOARP;
2944 SET_MODULE_OWNER(dev);
2945 return dev;
2946}
2947
2948static ssize_t 2656static ssize_t
2949ctc_proto_show(struct device *dev, char *buf) 2657ctc_proto_show(struct device *dev, struct device_attribute *attr, char *buf)
2950{ 2658{
2951 struct ctc_priv *priv; 2659 struct ctc_priv *priv;
2952 2660
@@ -2958,7 +2666,7 @@ ctc_proto_show(struct device *dev, char *buf)
2958} 2666}
2959 2667
2960static ssize_t 2668static ssize_t
2961ctc_proto_store(struct device *dev, const char *buf, size_t count) 2669ctc_proto_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
2962{ 2670{
2963 struct ctc_priv *priv; 2671 struct ctc_priv *priv;
2964 int value; 2672 int value;
@@ -2977,10 +2685,9 @@ ctc_proto_store(struct device *dev, const char *buf, size_t count)
2977 return count; 2685 return count;
2978} 2686}
2979 2687
2980static DEVICE_ATTR(protocol, 0644, ctc_proto_show, ctc_proto_store);
2981 2688
2982static ssize_t 2689static ssize_t
2983ctc_type_show(struct device *dev, char *buf) 2690ctc_type_show(struct device *dev, struct device_attribute *attr, char *buf)
2984{ 2691{
2985 struct ccwgroup_device *cgdev; 2692 struct ccwgroup_device *cgdev;
2986 2693
@@ -2991,8 +2698,13 @@ ctc_type_show(struct device *dev, char *buf)
2991 return sprintf(buf, "%s\n", cu3088_type[cgdev->cdev[0]->id.driver_info]); 2698 return sprintf(buf, "%s\n", cu3088_type[cgdev->cdev[0]->id.driver_info]);
2992} 2699}
2993 2700
2701static DEVICE_ATTR(buffer, 0644, buffer_show, buffer_write);
2702static DEVICE_ATTR(protocol, 0644, ctc_proto_show, ctc_proto_store);
2994static DEVICE_ATTR(type, 0444, ctc_type_show, NULL); 2703static DEVICE_ATTR(type, 0444, ctc_type_show, NULL);
2995 2704
2705static DEVICE_ATTR(loglevel, 0644, loglevel_show, loglevel_write);
2706static DEVICE_ATTR(stats, 0644, stats_show, stats_write);
2707
2996static struct attribute *ctc_attr[] = { 2708static struct attribute *ctc_attr[] = {
2997 &dev_attr_protocol.attr, 2709 &dev_attr_protocol.attr,
2998 &dev_attr_type.attr, 2710 &dev_attr_type.attr,
@@ -3005,6 +2717,21 @@ static struct attribute_group ctc_attr_group = {
3005}; 2717};
3006 2718
3007static int 2719static int
2720ctc_add_attributes(struct device *dev)
2721{
2722 device_create_file(dev, &dev_attr_loglevel);
2723 device_create_file(dev, &dev_attr_stats);
2724 return 0;
2725}
2726
2727static void
2728ctc_remove_attributes(struct device *dev)
2729{
2730 device_remove_file(dev, &dev_attr_stats);
2731 device_remove_file(dev, &dev_attr_loglevel);
2732}
2733
2734static int
3008ctc_add_files(struct device *dev) 2735ctc_add_files(struct device *dev)
3009{ 2736{
3010 pr_debug("%s() called\n", __FUNCTION__); 2737 pr_debug("%s() called\n", __FUNCTION__);
@@ -3028,15 +2755,15 @@ ctc_remove_files(struct device *dev)
3028 * 2755 *
3029 * @returns 0 on success, !0 on failure. 2756 * @returns 0 on success, !0 on failure.
3030 */ 2757 */
3031
3032static int 2758static int
3033ctc_probe_device(struct ccwgroup_device *cgdev) 2759ctc_probe_device(struct ccwgroup_device *cgdev)
3034{ 2760{
3035 struct ctc_priv *priv; 2761 struct ctc_priv *priv;
3036 int rc; 2762 int rc;
2763 char buffer[16];
3037 2764
3038 pr_debug("%s() called\n", __FUNCTION__); 2765 pr_debug("%s() called\n", __FUNCTION__);
3039 DBF_TEXT(trace, 3, __FUNCTION__); 2766 DBF_TEXT(setup, 3, __FUNCTION__);
3040 2767
3041 if (!get_device(&cgdev->dev)) 2768 if (!get_device(&cgdev->dev))
3042 return -ENODEV; 2769 return -ENODEV;
@@ -3060,10 +2787,70 @@ ctc_probe_device(struct ccwgroup_device *cgdev)
3060 cgdev->cdev[1]->handler = ctc_irq_handler; 2787 cgdev->cdev[1]->handler = ctc_irq_handler;
3061 cgdev->dev.driver_data = priv; 2788 cgdev->dev.driver_data = priv;
3062 2789
2790 sprintf(buffer, "%p", priv);
2791 DBF_TEXT(data, 3, buffer);
2792
2793 sprintf(buffer, "%u", (unsigned int)sizeof(struct ctc_priv));
2794 DBF_TEXT(data, 3, buffer);
2795
2796 sprintf(buffer, "%p", &channels);
2797 DBF_TEXT(data, 3, buffer);
2798
2799 sprintf(buffer, "%u", (unsigned int)sizeof(struct channel));
2800 DBF_TEXT(data, 3, buffer);
2801
3063 return 0; 2802 return 0;
3064} 2803}
3065 2804
3066/** 2805/**
2806 * Initialize everything of the net device except the name and the
2807 * channel structs.
2808 */
2809static struct net_device *
2810ctc_init_netdevice(struct net_device * dev, int alloc_device,
2811 struct ctc_priv *privptr)
2812{
2813 if (!privptr)
2814 return NULL;
2815
2816 DBF_TEXT(setup, 3, __FUNCTION__);
2817
2818 if (alloc_device) {
2819 dev = kmalloc(sizeof (struct net_device), GFP_KERNEL);
2820 if (!dev)
2821 return NULL;
2822 memset(dev, 0, sizeof (struct net_device));
2823 }
2824
2825 dev->priv = privptr;
2826 privptr->fsm = init_fsm("ctcdev", dev_state_names,
2827 dev_event_names, CTC_NR_DEV_STATES, CTC_NR_DEV_EVENTS,
2828 dev_fsm, DEV_FSM_LEN, GFP_KERNEL);
2829 if (privptr->fsm == NULL) {
2830 if (alloc_device)
2831 kfree(dev);
2832 return NULL;
2833 }
2834 fsm_newstate(privptr->fsm, DEV_STATE_STOPPED);
2835 fsm_settimer(privptr->fsm, &privptr->restart_timer);
2836 if (dev->mtu == 0)
2837 dev->mtu = CTC_BUFSIZE_DEFAULT - LL_HEADER_LENGTH - 2;
2838 dev->hard_start_xmit = ctc_tx;
2839 dev->open = ctc_open;
2840 dev->stop = ctc_close;
2841 dev->get_stats = ctc_stats;
2842 dev->change_mtu = ctc_change_mtu;
2843 dev->hard_header_len = LL_HEADER_LENGTH + 2;
2844 dev->addr_len = 0;
2845 dev->type = ARPHRD_SLIP;
2846 dev->tx_queue_len = 100;
2847 dev->flags = IFF_POINTOPOINT | IFF_NOARP;
2848 SET_MODULE_OWNER(dev);
2849 return dev;
2850}
2851
2852
2853/**
3067 * 2854 *
3068 * Setup an interface. 2855 * Setup an interface.
3069 * 2856 *
@@ -3081,6 +2868,7 @@ ctc_new_device(struct ccwgroup_device *cgdev)
3081 struct ctc_priv *privptr; 2868 struct ctc_priv *privptr;
3082 struct net_device *dev; 2869 struct net_device *dev;
3083 int ret; 2870 int ret;
2871 char buffer[16];
3084 2872
3085 pr_debug("%s() called\n", __FUNCTION__); 2873 pr_debug("%s() called\n", __FUNCTION__);
3086 DBF_TEXT(setup, 3, __FUNCTION__); 2874 DBF_TEXT(setup, 3, __FUNCTION__);
@@ -3089,6 +2877,9 @@ ctc_new_device(struct ccwgroup_device *cgdev)
3089 if (!privptr) 2877 if (!privptr)
3090 return -ENODEV; 2878 return -ENODEV;
3091 2879
2880 sprintf(buffer, "%d", privptr->buffer_size);
2881 DBF_TEXT(setup, 3, buffer);
2882
3092 type = get_channel_type(&cgdev->cdev[0]->id); 2883 type = get_channel_type(&cgdev->cdev[0]->id);
3093 2884
3094 snprintf(read_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[0]->dev.bus_id); 2885 snprintf(read_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[0]->dev.bus_id);
@@ -3177,9 +2968,10 @@ ctc_shutdown_device(struct ccwgroup_device *cgdev)
3177 struct ctc_priv *priv; 2968 struct ctc_priv *priv;
3178 struct net_device *ndev; 2969 struct net_device *ndev;
3179 2970
3180 DBF_TEXT(trace, 3, __FUNCTION__); 2971 DBF_TEXT(setup, 3, __FUNCTION__);
3181 pr_debug("%s() called\n", __FUNCTION__); 2972 pr_debug("%s() called\n", __FUNCTION__);
3182 2973
2974
3183 priv = cgdev->dev.driver_data; 2975 priv = cgdev->dev.driver_data;
3184 ndev = NULL; 2976 ndev = NULL;
3185 if (!priv) 2977 if (!priv)
@@ -3215,7 +3007,6 @@ ctc_shutdown_device(struct ccwgroup_device *cgdev)
3215 channel_remove(priv->channel[READ]); 3007 channel_remove(priv->channel[READ]);
3216 if (priv->channel[WRITE]) 3008 if (priv->channel[WRITE])
3217 channel_remove(priv->channel[WRITE]); 3009 channel_remove(priv->channel[WRITE]);
3218
3219 priv->channel[READ] = priv->channel[WRITE] = NULL; 3010 priv->channel[READ] = priv->channel[WRITE] = NULL;
3220 3011
3221 return 0; 3012 return 0;
@@ -3228,7 +3019,7 @@ ctc_remove_device(struct ccwgroup_device *cgdev)
3228 struct ctc_priv *priv; 3019 struct ctc_priv *priv;
3229 3020
3230 pr_debug("%s() called\n", __FUNCTION__); 3021 pr_debug("%s() called\n", __FUNCTION__);
3231 DBF_TEXT(trace, 3, __FUNCTION__); 3022 DBF_TEXT(setup, 3, __FUNCTION__);
3232 3023
3233 priv = cgdev->dev.driver_data; 3024 priv = cgdev->dev.driver_data;
3234 if (!priv) 3025 if (!priv)
@@ -3265,6 +3056,7 @@ static struct ccwgroup_driver ctc_group_driver = {
3265static void __exit 3056static void __exit
3266ctc_exit(void) 3057ctc_exit(void)
3267{ 3058{
3059 DBF_TEXT(setup, 3, __FUNCTION__);
3268 unregister_cu3088_discipline(&ctc_group_driver); 3060 unregister_cu3088_discipline(&ctc_group_driver);
3269 ctc_tty_cleanup(); 3061 ctc_tty_cleanup();
3270 ctc_unregister_dbf_views(); 3062 ctc_unregister_dbf_views();
@@ -3282,6 +3074,10 @@ ctc_init(void)
3282{ 3074{
3283 int ret = 0; 3075 int ret = 0;
3284 3076
3077 loglevel = CTC_LOGLEVEL_DEFAULT;
3078
3079 DBF_TEXT(setup, 3, __FUNCTION__);
3080
3285 print_banner(); 3081 print_banner();
3286 3082
3287 ret = ctc_register_dbf_views(); 3083 ret = ctc_register_dbf_views();
diff --git a/drivers/s390/net/ctcmain.h b/drivers/s390/net/ctcmain.h
new file mode 100644
index 000000000000..ba3605f16335
--- /dev/null
+++ b/drivers/s390/net/ctcmain.h
@@ -0,0 +1,276 @@
1/*
2 * $Id: ctcmain.h,v 1.4 2005/03/24 09:04:17 mschwide Exp $
3 *
4 * CTC / ESCON network driver
5 *
6 * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation
7 * Author(s): Fritz Elfert (elfert@de.ibm.com, felfert@millenux.com)
8 Peter Tiedemann (ptiedem@de.ibm.com)
9 *
10 *
11 * Documentation used:
12 * - Principles of Operation (IBM doc#: SA22-7201-06)
13 * - Common IO/-Device Commands and Self Description (IBM doc#: SA22-7204-02)
14 * - Common IO/-Device Commands and Self Description (IBM doc#: SN22-5535)
15 * - ESCON Channel-to-Channel Adapter (IBM doc#: SA22-7203-00)
16 * - ESCON I/O Interface (IBM doc#: SA22-7202-029
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2, or (at your option)
21 * any later version.
22 *
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
27 *
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 *
32 * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.4 $
33 *
34 */
35
36#ifndef _CTCMAIN_H_
37#define _CTCMAIN_H_
38
39#include <asm/ccwdev.h>
40#include <asm/ccwgroup.h>
41
42#include "ctctty.h"
43#include "fsm.h"
44#include "cu3088.h"
45
46
47/**
48 * CCW commands, used in this driver.
49 */
50#define CCW_CMD_WRITE 0x01
51#define CCW_CMD_READ 0x02
52#define CCW_CMD_SET_EXTENDED 0xc3
53#define CCW_CMD_PREPARE 0xe3
54
55#define CTC_PROTO_S390 0
56#define CTC_PROTO_LINUX 1
57#define CTC_PROTO_LINUX_TTY 2
58#define CTC_PROTO_OS390 3
59#define CTC_PROTO_MAX 3
60
61#define CTC_BUFSIZE_LIMIT 65535
62#define CTC_BUFSIZE_DEFAULT 32768
63
64#define CTC_TIMEOUT_5SEC 5000
65
66#define CTC_INITIAL_BLOCKLEN 2
67
68#define READ 0
69#define WRITE 1
70
71#define CTC_ID_SIZE BUS_ID_SIZE+3
72
73
74struct ctc_profile {
75 unsigned long maxmulti;
76 unsigned long maxcqueue;
77 unsigned long doios_single;
78 unsigned long doios_multi;
79 unsigned long txlen;
80 unsigned long tx_time;
81 struct timespec send_stamp;
82};
83
84/**
85 * Definition of one channel
86 */
87struct channel {
88
89 /**
90 * Pointer to next channel in list.
91 */
92 struct channel *next;
93 char id[CTC_ID_SIZE];
94 struct ccw_device *cdev;
95
96 /**
97 * Type of this channel.
98 * CTC/A or Escon for valid channels.
99 */
100 enum channel_types type;
101
102 /**
103 * Misc. flags. See CHANNEL_FLAGS_... below
104 */
105 __u32 flags;
106
107 /**
108 * The protocol of this channel
109 */
110 __u16 protocol;
111
112 /**
113 * I/O and irq related stuff
114 */
115 struct ccw1 *ccw;
116 struct irb *irb;
117
118 /**
119 * RX/TX buffer size
120 */
121 int max_bufsize;
122
123 /**
124 * Transmit/Receive buffer.
125 */
126 struct sk_buff *trans_skb;
127
128 /**
129 * Universal I/O queue.
130 */
131 struct sk_buff_head io_queue;
132
133 /**
134 * TX queue for collecting skb's during busy.
135 */
136 struct sk_buff_head collect_queue;
137
138 /**
139 * Amount of data in collect_queue.
140 */
141 int collect_len;
142
143 /**
144 * spinlock for collect_queue and collect_len
145 */
146 spinlock_t collect_lock;
147
148 /**
149 * Timer for detecting unresposive
150 * I/O operations.
151 */
152 fsm_timer timer;
153
154 /**
155 * Retry counter for misc. operations.
156 */
157 int retry;
158
159 /**
160 * The finite state machine of this channel
161 */
162 fsm_instance *fsm;
163
164 /**
165 * The corresponding net_device this channel
166 * belongs to.
167 */
168 struct net_device *netdev;
169
170 struct ctc_profile prof;
171
172 unsigned char *trans_skb_data;
173
174 __u16 logflags;
175};
176
177#define CHANNEL_FLAGS_READ 0
178#define CHANNEL_FLAGS_WRITE 1
179#define CHANNEL_FLAGS_INUSE 2
180#define CHANNEL_FLAGS_BUFSIZE_CHANGED 4
181#define CHANNEL_FLAGS_FAILED 8
182#define CHANNEL_FLAGS_WAITIRQ 16
183#define CHANNEL_FLAGS_RWMASK 1
184#define CHANNEL_DIRECTION(f) (f & CHANNEL_FLAGS_RWMASK)
185
186#define LOG_FLAG_ILLEGALPKT 1
187#define LOG_FLAG_ILLEGALSIZE 2
188#define LOG_FLAG_OVERRUN 4
189#define LOG_FLAG_NOMEM 8
190
191#define CTC_LOGLEVEL_INFO 1
192#define CTC_LOGLEVEL_NOTICE 2
193#define CTC_LOGLEVEL_WARN 4
194#define CTC_LOGLEVEL_EMERG 8
195#define CTC_LOGLEVEL_ERR 16
196#define CTC_LOGLEVEL_DEBUG 32
197#define CTC_LOGLEVEL_CRIT 64
198
199#define CTC_LOGLEVEL_DEFAULT \
200(CTC_LOGLEVEL_INFO | CTC_LOGLEVEL_NOTICE | CTC_LOGLEVEL_WARN | CTC_LOGLEVEL_CRIT)
201
202#define CTC_LOGLEVEL_MAX ((CTC_LOGLEVEL_CRIT<<1)-1)
203
204#define ctc_pr_debug(fmt, arg...) \
205do { if (loglevel & CTC_LOGLEVEL_DEBUG) printk(KERN_DEBUG fmt,##arg); } while (0)
206
207#define ctc_pr_info(fmt, arg...) \
208do { if (loglevel & CTC_LOGLEVEL_INFO) printk(KERN_INFO fmt,##arg); } while (0)
209
210#define ctc_pr_notice(fmt, arg...) \
211do { if (loglevel & CTC_LOGLEVEL_NOTICE) printk(KERN_NOTICE fmt,##arg); } while (0)
212
213#define ctc_pr_warn(fmt, arg...) \
214do { if (loglevel & CTC_LOGLEVEL_WARN) printk(KERN_WARNING fmt,##arg); } while (0)
215
216#define ctc_pr_emerg(fmt, arg...) \
217do { if (loglevel & CTC_LOGLEVEL_EMERG) printk(KERN_EMERG fmt,##arg); } while (0)
218
219#define ctc_pr_err(fmt, arg...) \
220do { if (loglevel & CTC_LOGLEVEL_ERR) printk(KERN_ERR fmt,##arg); } while (0)
221
222#define ctc_pr_crit(fmt, arg...) \
223do { if (loglevel & CTC_LOGLEVEL_CRIT) printk(KERN_CRIT fmt,##arg); } while (0)
224
225struct ctc_priv {
226 struct net_device_stats stats;
227 unsigned long tbusy;
228 /**
229 * The finite state machine of this interface.
230 */
231 fsm_instance *fsm;
232 /**
233 * The protocol of this device
234 */
235 __u16 protocol;
236 /**
237 * Timer for restarting after I/O Errors
238 */
239 fsm_timer restart_timer;
240
241 int buffer_size;
242
243 struct channel *channel[2];
244};
245
246/**
247 * Definition of our link level header.
248 */
249struct ll_header {
250 __u16 length;
251 __u16 type;
252 __u16 unused;
253};
254#define LL_HEADER_LENGTH (sizeof(struct ll_header))
255
256/**
257 * Compatibility macros for busy handling
258 * of network devices.
259 */
260static __inline__ void
261ctc_clear_busy(struct net_device * dev)
262{
263 clear_bit(0, &(((struct ctc_priv *) dev->priv)->tbusy));
264 if (((struct ctc_priv *)dev->priv)->protocol != CTC_PROTO_LINUX_TTY)
265 netif_wake_queue(dev);
266}
267
268static __inline__ int
269ctc_test_and_set_busy(struct net_device * dev)
270{
271 if (((struct ctc_priv *)dev->priv)->protocol != CTC_PROTO_LINUX_TTY)
272 netif_stop_queue(dev);
273 return test_and_set_bit(0, &((struct ctc_priv *) dev->priv)->tbusy);
274}
275
276#endif
diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c
index 9257d60c7833..3080393e823d 100644
--- a/drivers/s390/net/ctctty.c
+++ b/drivers/s390/net/ctctty.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: ctctty.c,v 1.26 2004/08/04 11:06:55 mschwide Exp $ 2 * $Id: ctctty.c,v 1.29 2005/04/05 08:50:44 mschwide Exp $
3 * 3 *
4 * CTC / ESCON network driver, tty interface. 4 * CTC / ESCON network driver, tty interface.
5 * 5 *
@@ -1056,8 +1056,7 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp)
1056 info->tty = 0; 1056 info->tty = 0;
1057 tty->closing = 0; 1057 tty->closing = 0;
1058 if (info->blocked_open) { 1058 if (info->blocked_open) {
1059 set_current_state(TASK_INTERRUPTIBLE); 1059 msleep_interruptible(500);
1060 schedule_timeout(HZ/2);
1061 wake_up_interruptible(&info->open_wait); 1060 wake_up_interruptible(&info->open_wait);
1062 } 1061 }
1063 info->flags &= ~(CTC_ASYNC_NORMAL_ACTIVE | CTC_ASYNC_CLOSING); 1062 info->flags &= ~(CTC_ASYNC_NORMAL_ACTIVE | CTC_ASYNC_CLOSING);
diff --git a/drivers/s390/net/cu3088.c b/drivers/s390/net/cu3088.c
index 1b0a9f16024c..0075894c71db 100644
--- a/drivers/s390/net/cu3088.c
+++ b/drivers/s390/net/cu3088.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cu3088.c,v 1.34 2004/06/15 13:16:27 pavlic Exp $ 2 * $Id: cu3088.c,v 1.35 2005/03/30 19:28:52 richtera Exp $
3 * 3 *
4 * CTC / LCS ccw_device driver 4 * CTC / LCS ccw_device driver
5 * 5 *
@@ -39,6 +39,7 @@ const char *cu3088_type[] = {
39 "FICON channel", 39 "FICON channel",
40 "P390 LCS card", 40 "P390 LCS card",
41 "OSA LCS card", 41 "OSA LCS card",
42 "CLAW channel device",
42 "unknown channel type", 43 "unknown channel type",
43 "unsupported channel type", 44 "unsupported channel type",
44}; 45};
@@ -51,6 +52,7 @@ static struct ccw_device_id cu3088_ids[] = {
51 { CCW_DEVICE(0x3088, 0x1e), .driver_info = channel_type_ficon }, 52 { CCW_DEVICE(0x3088, 0x1e), .driver_info = channel_type_ficon },
52 { CCW_DEVICE(0x3088, 0x01), .driver_info = channel_type_p390 }, 53 { CCW_DEVICE(0x3088, 0x01), .driver_info = channel_type_p390 },
53 { CCW_DEVICE(0x3088, 0x60), .driver_info = channel_type_osa2 }, 54 { CCW_DEVICE(0x3088, 0x60), .driver_info = channel_type_osa2 },
55 { CCW_DEVICE(0x3088, 0x61), .driver_info = channel_type_claw },
54 { /* end of list */ } 56 { /* end of list */ }
55}; 57};
56 58
diff --git a/drivers/s390/net/cu3088.h b/drivers/s390/net/cu3088.h
index 0ec49a8b3adc..1753661f702a 100644
--- a/drivers/s390/net/cu3088.h
+++ b/drivers/s390/net/cu3088.h
@@ -23,6 +23,9 @@ enum channel_types {
23 /* Device is a OSA2 card */ 23 /* Device is a OSA2 card */
24 channel_type_osa2, 24 channel_type_osa2,
25 25
26 /* Device is a CLAW channel device */
27 channel_type_claw,
28
26 /* Device is a channel, but we don't know 29 /* Device is a channel, but we don't know
27 * anything about it */ 30 * anything about it */
28 channel_type_unknown, 31 channel_type_unknown,
diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c
index 1ac6563ee3e0..e08e74e16124 100644
--- a/drivers/s390/net/iucv.c
+++ b/drivers/s390/net/iucv.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: iucv.c,v 1.43 2005/02/09 14:47:43 braunu Exp $ 2 * $Id: iucv.c,v 1.45 2005/04/26 22:59:06 braunu Exp $
3 * 3 *
4 * IUCV network driver 4 * IUCV network driver
5 * 5 *
@@ -29,7 +29,7 @@
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 * 31 *
32 * RELEASE-TAG: IUCV lowlevel driver $Revision: 1.43 $ 32 * RELEASE-TAG: IUCV lowlevel driver $Revision: 1.45 $
33 * 33 *
34 */ 34 */
35 35
@@ -355,7 +355,7 @@ do { \
355static void 355static void
356iucv_banner(void) 356iucv_banner(void)
357{ 357{
358 char vbuf[] = "$Revision: 1.43 $"; 358 char vbuf[] = "$Revision: 1.45 $";
359 char *version = vbuf; 359 char *version = vbuf;
360 360
361 if ((version = strchr(version, ':'))) { 361 if ((version = strchr(version, ':'))) {
@@ -2553,12 +2553,12 @@ EXPORT_SYMBOL (iucv_resume);
2553#endif 2553#endif
2554EXPORT_SYMBOL (iucv_reply_prmmsg); 2554EXPORT_SYMBOL (iucv_reply_prmmsg);
2555EXPORT_SYMBOL (iucv_send); 2555EXPORT_SYMBOL (iucv_send);
2556#if 0
2557EXPORT_SYMBOL (iucv_send2way); 2556EXPORT_SYMBOL (iucv_send2way);
2558EXPORT_SYMBOL (iucv_send2way_array); 2557EXPORT_SYMBOL (iucv_send2way_array);
2559EXPORT_SYMBOL (iucv_send_array);
2560EXPORT_SYMBOL (iucv_send2way_prmmsg); 2558EXPORT_SYMBOL (iucv_send2way_prmmsg);
2561EXPORT_SYMBOL (iucv_send2way_prmmsg_array); 2559EXPORT_SYMBOL (iucv_send2way_prmmsg_array);
2560#if 0
2561EXPORT_SYMBOL (iucv_send_array);
2562EXPORT_SYMBOL (iucv_send_prmmsg); 2562EXPORT_SYMBOL (iucv_send_prmmsg);
2563EXPORT_SYMBOL (iucv_setmask); 2563EXPORT_SYMBOL (iucv_setmask);
2564#endif 2564#endif
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 0f76e945b984..ab086242d305 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -11,7 +11,7 @@
11 * Frank Pavlic (pavlic@de.ibm.com) and 11 * Frank Pavlic (pavlic@de.ibm.com) and
12 * Martin Schwidefsky <schwidefsky@de.ibm.com> 12 * Martin Schwidefsky <schwidefsky@de.ibm.com>
13 * 13 *
14 * $Revision: 1.96 $ $Date: 2004/11/11 13:42:33 $ 14 * $Revision: 1.98 $ $Date: 2005/04/18 13:41:29 $
15 * 15 *
16 * This program is free software; you can redistribute it and/or modify 16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by 17 * it under the terms of the GNU General Public License as published by
@@ -59,7 +59,7 @@
59/** 59/**
60 * initialization string for output 60 * initialization string for output
61 */ 61 */
62#define VERSION_LCS_C "$Revision: 1.96 $" 62#define VERSION_LCS_C "$Revision: 1.98 $"
63 63
64static char version[] __initdata = "LCS driver ("VERSION_LCS_C "/" VERSION_LCS_H ")"; 64static char version[] __initdata = "LCS driver ("VERSION_LCS_C "/" VERSION_LCS_H ")";
65static char debug_buffer[255]; 65static char debug_buffer[255];
@@ -1098,14 +1098,6 @@ lcs_check_multicast_support(struct lcs_card *card)
1098 PRINT_ERR("Query IPAssist failed. Assuming unsupported!\n"); 1098 PRINT_ERR("Query IPAssist failed. Assuming unsupported!\n");
1099 return -EOPNOTSUPP; 1099 return -EOPNOTSUPP;
1100 } 1100 }
1101 /* Print out supported assists: IPv6 */
1102 PRINT_INFO("LCS device %s %s IPv6 support\n", card->dev->name,
1103 (card->ip_assists_supported & LCS_IPASS_IPV6_SUPPORT) ?
1104 "with" : "without");
1105 /* Print out supported assist: Multicast */
1106 PRINT_INFO("LCS device %s %s Multicast support\n", card->dev->name,
1107 (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT) ?
1108 "with" : "without");
1109 if (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT) 1101 if (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT)
1110 return 0; 1102 return 0;
1111 return -EOPNOTSUPP; 1103 return -EOPNOTSUPP;
@@ -1160,7 +1152,7 @@ list_modified:
1160 } 1152 }
1161 } 1153 }
1162 /* re-insert all entries from the failed_list into ipm_list */ 1154 /* re-insert all entries from the failed_list into ipm_list */
1163 list_for_each_entry(ipm, &failed_list, list) { 1155 list_for_each_entry_safe(ipm, tmp, &failed_list, list) {
1164 list_del_init(&ipm->list); 1156 list_del_init(&ipm->list);
1165 list_add_tail(&ipm->list, &card->ipm_list); 1157 list_add_tail(&ipm->list, &card->ipm_list);
1166 } 1158 }
@@ -1992,7 +1984,7 @@ lcs_open_device(struct net_device *dev)
1992 * show function for portno called by cat or similar things 1984 * show function for portno called by cat or similar things
1993 */ 1985 */
1994static ssize_t 1986static ssize_t
1995lcs_portno_show (struct device *dev, char *buf) 1987lcs_portno_show (struct device *dev, struct device_attribute *attr, char *buf)
1996{ 1988{
1997 struct lcs_card *card; 1989 struct lcs_card *card;
1998 1990
@@ -2008,7 +2000,7 @@ lcs_portno_show (struct device *dev, char *buf)
2008 * store the value which is piped to file portno 2000 * store the value which is piped to file portno
2009 */ 2001 */
2010static ssize_t 2002static ssize_t
2011lcs_portno_store (struct device *dev, const char *buf, size_t count) 2003lcs_portno_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
2012{ 2004{
2013 struct lcs_card *card; 2005 struct lcs_card *card;
2014 int value; 2006 int value;
@@ -2029,7 +2021,7 @@ lcs_portno_store (struct device *dev, const char *buf, size_t count)
2029static DEVICE_ATTR(portno, 0644, lcs_portno_show, lcs_portno_store); 2021static DEVICE_ATTR(portno, 0644, lcs_portno_show, lcs_portno_store);
2030 2022
2031static ssize_t 2023static ssize_t
2032lcs_type_show(struct device *dev, char *buf) 2024lcs_type_show(struct device *dev, struct device_attribute *attr, char *buf)
2033{ 2025{
2034 struct ccwgroup_device *cgdev; 2026 struct ccwgroup_device *cgdev;
2035 2027
@@ -2043,7 +2035,7 @@ lcs_type_show(struct device *dev, char *buf)
2043static DEVICE_ATTR(type, 0444, lcs_type_show, NULL); 2035static DEVICE_ATTR(type, 0444, lcs_type_show, NULL);
2044 2036
2045static ssize_t 2037static ssize_t
2046lcs_timeout_show(struct device *dev, char *buf) 2038lcs_timeout_show(struct device *dev, struct device_attribute *attr, char *buf)
2047{ 2039{
2048 struct lcs_card *card; 2040 struct lcs_card *card;
2049 2041
@@ -2053,7 +2045,7 @@ lcs_timeout_show(struct device *dev, char *buf)
2053} 2045}
2054 2046
2055static ssize_t 2047static ssize_t
2056lcs_timeout_store (struct device *dev, const char *buf, size_t count) 2048lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
2057{ 2049{
2058 struct lcs_card *card; 2050 struct lcs_card *card;
2059 int value; 2051 int value;
@@ -2198,30 +2190,39 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
2198 if (!dev) 2190 if (!dev)
2199 goto out; 2191 goto out;
2200 card->dev = dev; 2192 card->dev = dev;
2201netdev_out:
2202 card->dev->priv = card; 2193 card->dev->priv = card;
2203 card->dev->open = lcs_open_device; 2194 card->dev->open = lcs_open_device;
2204 card->dev->stop = lcs_stop_device; 2195 card->dev->stop = lcs_stop_device;
2205 card->dev->hard_start_xmit = lcs_start_xmit; 2196 card->dev->hard_start_xmit = lcs_start_xmit;
2206 card->dev->get_stats = lcs_getstats; 2197 card->dev->get_stats = lcs_getstats;
2207 SET_MODULE_OWNER(dev); 2198 SET_MODULE_OWNER(dev);
2208 if (lcs_register_netdev(ccwgdev) != 0)
2209 goto out;
2210 memcpy(card->dev->dev_addr, card->mac, LCS_MAC_LENGTH); 2199 memcpy(card->dev->dev_addr, card->mac, LCS_MAC_LENGTH);
2211#ifdef CONFIG_IP_MULTICAST 2200#ifdef CONFIG_IP_MULTICAST
2212 if (!lcs_check_multicast_support(card)) 2201 if (!lcs_check_multicast_support(card))
2213 card->dev->set_multicast_list = lcs_set_multicast_list; 2202 card->dev->set_multicast_list = lcs_set_multicast_list;
2214#endif 2203#endif
2215 netif_stop_queue(card->dev); 2204netdev_out:
2216 lcs_set_allowed_threads(card,0xffffffff); 2205 lcs_set_allowed_threads(card,0xffffffff);
2217 if (recover_state == DEV_STATE_RECOVER) { 2206 if (recover_state == DEV_STATE_RECOVER) {
2218 lcs_set_multicast_list(card->dev); 2207 lcs_set_multicast_list(card->dev);
2219 card->dev->flags |= IFF_UP; 2208 card->dev->flags |= IFF_UP;
2220 netif_wake_queue(card->dev); 2209 netif_wake_queue(card->dev);
2221 card->state = DEV_STATE_UP; 2210 card->state = DEV_STATE_UP;
2222 } else 2211 } else {
2223 lcs_stopcard(card); 2212 lcs_stopcard(card);
2213 }
2224 2214
2215 if (lcs_register_netdev(ccwgdev) != 0)
2216 goto out;
2217
2218 /* Print out supported assists: IPv6 */
2219 PRINT_INFO("LCS device %s %s IPv6 support\n", card->dev->name,
2220 (card->ip_assists_supported & LCS_IPASS_IPV6_SUPPORT) ?
2221 "with" : "without");
2222 /* Print out supported assist: Multicast */
2223 PRINT_INFO("LCS device %s %s Multicast support\n", card->dev->name,
2224 (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT) ?
2225 "with" : "without");
2225 return 0; 2226 return 0;
2226out: 2227out:
2227 2228
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 16e8e69afb10..3fd4fb754b2d 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -1356,7 +1356,7 @@ netiucv_change_mtu (struct net_device * dev, int new_mtu)
1356 *****************************************************************************/ 1356 *****************************************************************************/
1357 1357
1358static ssize_t 1358static ssize_t
1359user_show (struct device *dev, char *buf) 1359user_show (struct device *dev, struct device_attribute *attr, char *buf)
1360{ 1360{
1361 struct netiucv_priv *priv = dev->driver_data; 1361 struct netiucv_priv *priv = dev->driver_data;
1362 1362
@@ -1365,7 +1365,7 @@ user_show (struct device *dev, char *buf)
1365} 1365}
1366 1366
1367static ssize_t 1367static ssize_t
1368user_write (struct device *dev, const char *buf, size_t count) 1368user_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1369{ 1369{
1370 struct netiucv_priv *priv = dev->driver_data; 1370 struct netiucv_priv *priv = dev->driver_data;
1371 struct net_device *ndev = priv->conn->netdev; 1371 struct net_device *ndev = priv->conn->netdev;
@@ -1422,7 +1422,7 @@ user_write (struct device *dev, const char *buf, size_t count)
1422static DEVICE_ATTR(user, 0644, user_show, user_write); 1422static DEVICE_ATTR(user, 0644, user_show, user_write);
1423 1423
1424static ssize_t 1424static ssize_t
1425buffer_show (struct device *dev, char *buf) 1425buffer_show (struct device *dev, struct device_attribute *attr, char *buf)
1426{ 1426{
1427 struct netiucv_priv *priv = dev->driver_data; 1427 struct netiucv_priv *priv = dev->driver_data;
1428 1428
@@ -1431,7 +1431,7 @@ buffer_show (struct device *dev, char *buf)
1431} 1431}
1432 1432
1433static ssize_t 1433static ssize_t
1434buffer_write (struct device *dev, const char *buf, size_t count) 1434buffer_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1435{ 1435{
1436 struct netiucv_priv *priv = dev->driver_data; 1436 struct netiucv_priv *priv = dev->driver_data;
1437 struct net_device *ndev = priv->conn->netdev; 1437 struct net_device *ndev = priv->conn->netdev;
@@ -1486,7 +1486,7 @@ buffer_write (struct device *dev, const char *buf, size_t count)
1486static DEVICE_ATTR(buffer, 0644, buffer_show, buffer_write); 1486static DEVICE_ATTR(buffer, 0644, buffer_show, buffer_write);
1487 1487
1488static ssize_t 1488static ssize_t
1489dev_fsm_show (struct device *dev, char *buf) 1489dev_fsm_show (struct device *dev, struct device_attribute *attr, char *buf)
1490{ 1490{
1491 struct netiucv_priv *priv = dev->driver_data; 1491 struct netiucv_priv *priv = dev->driver_data;
1492 1492
@@ -1497,7 +1497,7 @@ dev_fsm_show (struct device *dev, char *buf)
1497static DEVICE_ATTR(device_fsm_state, 0444, dev_fsm_show, NULL); 1497static DEVICE_ATTR(device_fsm_state, 0444, dev_fsm_show, NULL);
1498 1498
1499static ssize_t 1499static ssize_t
1500conn_fsm_show (struct device *dev, char *buf) 1500conn_fsm_show (struct device *dev, struct device_attribute *attr, char *buf)
1501{ 1501{
1502 struct netiucv_priv *priv = dev->driver_data; 1502 struct netiucv_priv *priv = dev->driver_data;
1503 1503
@@ -1508,7 +1508,7 @@ conn_fsm_show (struct device *dev, char *buf)
1508static DEVICE_ATTR(connection_fsm_state, 0444, conn_fsm_show, NULL); 1508static DEVICE_ATTR(connection_fsm_state, 0444, conn_fsm_show, NULL);
1509 1509
1510static ssize_t 1510static ssize_t
1511maxmulti_show (struct device *dev, char *buf) 1511maxmulti_show (struct device *dev, struct device_attribute *attr, char *buf)
1512{ 1512{
1513 struct netiucv_priv *priv = dev->driver_data; 1513 struct netiucv_priv *priv = dev->driver_data;
1514 1514
@@ -1517,7 +1517,7 @@ maxmulti_show (struct device *dev, char *buf)
1517} 1517}
1518 1518
1519static ssize_t 1519static ssize_t
1520maxmulti_write (struct device *dev, const char *buf, size_t count) 1520maxmulti_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1521{ 1521{
1522 struct netiucv_priv *priv = dev->driver_data; 1522 struct netiucv_priv *priv = dev->driver_data;
1523 1523
@@ -1529,7 +1529,7 @@ maxmulti_write (struct device *dev, const char *buf, size_t count)
1529static DEVICE_ATTR(max_tx_buffer_used, 0644, maxmulti_show, maxmulti_write); 1529static DEVICE_ATTR(max_tx_buffer_used, 0644, maxmulti_show, maxmulti_write);
1530 1530
1531static ssize_t 1531static ssize_t
1532maxcq_show (struct device *dev, char *buf) 1532maxcq_show (struct device *dev, struct device_attribute *attr, char *buf)
1533{ 1533{
1534 struct netiucv_priv *priv = dev->driver_data; 1534 struct netiucv_priv *priv = dev->driver_data;
1535 1535
@@ -1538,7 +1538,7 @@ maxcq_show (struct device *dev, char *buf)
1538} 1538}
1539 1539
1540static ssize_t 1540static ssize_t
1541maxcq_write (struct device *dev, const char *buf, size_t count) 1541maxcq_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1542{ 1542{
1543 struct netiucv_priv *priv = dev->driver_data; 1543 struct netiucv_priv *priv = dev->driver_data;
1544 1544
@@ -1550,7 +1550,7 @@ maxcq_write (struct device *dev, const char *buf, size_t count)
1550static DEVICE_ATTR(max_chained_skbs, 0644, maxcq_show, maxcq_write); 1550static DEVICE_ATTR(max_chained_skbs, 0644, maxcq_show, maxcq_write);
1551 1551
1552static ssize_t 1552static ssize_t
1553sdoio_show (struct device *dev, char *buf) 1553sdoio_show (struct device *dev, struct device_attribute *attr, char *buf)
1554{ 1554{
1555 struct netiucv_priv *priv = dev->driver_data; 1555 struct netiucv_priv *priv = dev->driver_data;
1556 1556
@@ -1559,7 +1559,7 @@ sdoio_show (struct device *dev, char *buf)
1559} 1559}
1560 1560
1561static ssize_t 1561static ssize_t
1562sdoio_write (struct device *dev, const char *buf, size_t count) 1562sdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1563{ 1563{
1564 struct netiucv_priv *priv = dev->driver_data; 1564 struct netiucv_priv *priv = dev->driver_data;
1565 1565
@@ -1571,7 +1571,7 @@ sdoio_write (struct device *dev, const char *buf, size_t count)
1571static DEVICE_ATTR(tx_single_write_ops, 0644, sdoio_show, sdoio_write); 1571static DEVICE_ATTR(tx_single_write_ops, 0644, sdoio_show, sdoio_write);
1572 1572
1573static ssize_t 1573static ssize_t
1574mdoio_show (struct device *dev, char *buf) 1574mdoio_show (struct device *dev, struct device_attribute *attr, char *buf)
1575{ 1575{
1576 struct netiucv_priv *priv = dev->driver_data; 1576 struct netiucv_priv *priv = dev->driver_data;
1577 1577
@@ -1580,7 +1580,7 @@ mdoio_show (struct device *dev, char *buf)
1580} 1580}
1581 1581
1582static ssize_t 1582static ssize_t
1583mdoio_write (struct device *dev, const char *buf, size_t count) 1583mdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1584{ 1584{
1585 struct netiucv_priv *priv = dev->driver_data; 1585 struct netiucv_priv *priv = dev->driver_data;
1586 1586
@@ -1592,7 +1592,7 @@ mdoio_write (struct device *dev, const char *buf, size_t count)
1592static DEVICE_ATTR(tx_multi_write_ops, 0644, mdoio_show, mdoio_write); 1592static DEVICE_ATTR(tx_multi_write_ops, 0644, mdoio_show, mdoio_write);
1593 1593
1594static ssize_t 1594static ssize_t
1595txlen_show (struct device *dev, char *buf) 1595txlen_show (struct device *dev, struct device_attribute *attr, char *buf)
1596{ 1596{
1597 struct netiucv_priv *priv = dev->driver_data; 1597 struct netiucv_priv *priv = dev->driver_data;
1598 1598
@@ -1601,7 +1601,7 @@ txlen_show (struct device *dev, char *buf)
1601} 1601}
1602 1602
1603static ssize_t 1603static ssize_t
1604txlen_write (struct device *dev, const char *buf, size_t count) 1604txlen_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1605{ 1605{
1606 struct netiucv_priv *priv = dev->driver_data; 1606 struct netiucv_priv *priv = dev->driver_data;
1607 1607
@@ -1613,7 +1613,7 @@ txlen_write (struct device *dev, const char *buf, size_t count)
1613static DEVICE_ATTR(netto_bytes, 0644, txlen_show, txlen_write); 1613static DEVICE_ATTR(netto_bytes, 0644, txlen_show, txlen_write);
1614 1614
1615static ssize_t 1615static ssize_t
1616txtime_show (struct device *dev, char *buf) 1616txtime_show (struct device *dev, struct device_attribute *attr, char *buf)
1617{ 1617{
1618 struct netiucv_priv *priv = dev->driver_data; 1618 struct netiucv_priv *priv = dev->driver_data;
1619 1619
@@ -1622,7 +1622,7 @@ txtime_show (struct device *dev, char *buf)
1622} 1622}
1623 1623
1624static ssize_t 1624static ssize_t
1625txtime_write (struct device *dev, const char *buf, size_t count) 1625txtime_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1626{ 1626{
1627 struct netiucv_priv *priv = dev->driver_data; 1627 struct netiucv_priv *priv = dev->driver_data;
1628 1628
@@ -1634,7 +1634,7 @@ txtime_write (struct device *dev, const char *buf, size_t count)
1634static DEVICE_ATTR(max_tx_io_time, 0644, txtime_show, txtime_write); 1634static DEVICE_ATTR(max_tx_io_time, 0644, txtime_show, txtime_write);
1635 1635
1636static ssize_t 1636static ssize_t
1637txpend_show (struct device *dev, char *buf) 1637txpend_show (struct device *dev, struct device_attribute *attr, char *buf)
1638{ 1638{
1639 struct netiucv_priv *priv = dev->driver_data; 1639 struct netiucv_priv *priv = dev->driver_data;
1640 1640
@@ -1643,7 +1643,7 @@ txpend_show (struct device *dev, char *buf)
1643} 1643}
1644 1644
1645static ssize_t 1645static ssize_t
1646txpend_write (struct device *dev, const char *buf, size_t count) 1646txpend_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1647{ 1647{
1648 struct netiucv_priv *priv = dev->driver_data; 1648 struct netiucv_priv *priv = dev->driver_data;
1649 1649
@@ -1655,7 +1655,7 @@ txpend_write (struct device *dev, const char *buf, size_t count)
1655static DEVICE_ATTR(tx_pending, 0644, txpend_show, txpend_write); 1655static DEVICE_ATTR(tx_pending, 0644, txpend_show, txpend_write);
1656 1656
1657static ssize_t 1657static ssize_t
1658txmpnd_show (struct device *dev, char *buf) 1658txmpnd_show (struct device *dev, struct device_attribute *attr, char *buf)
1659{ 1659{
1660 struct netiucv_priv *priv = dev->driver_data; 1660 struct netiucv_priv *priv = dev->driver_data;
1661 1661
@@ -1664,7 +1664,7 @@ txmpnd_show (struct device *dev, char *buf)
1664} 1664}
1665 1665
1666static ssize_t 1666static ssize_t
1667txmpnd_write (struct device *dev, const char *buf, size_t count) 1667txmpnd_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1668{ 1668{
1669 struct netiucv_priv *priv = dev->driver_data; 1669 struct netiucv_priv *priv = dev->driver_data;
1670 1670
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index a341041a6cf7..a755b57db46b 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -24,7 +24,7 @@
24 24
25#include "qeth_mpc.h" 25#include "qeth_mpc.h"
26 26
27#define VERSION_QETH_H "$Revision: 1.135 $" 27#define VERSION_QETH_H "$Revision: 1.139 $"
28 28
29#ifdef CONFIG_QETH_IPV6 29#ifdef CONFIG_QETH_IPV6
30#define QETH_VERSION_IPV6 ":IPv6" 30#define QETH_VERSION_IPV6 ":IPv6"
@@ -288,7 +288,8 @@ qeth_is_ipa_enabled(struct qeth_ipa_info *ipa, enum qeth_ipa_funcs func)
288#define QETH_TX_TIMEOUT 100 * HZ 288#define QETH_TX_TIMEOUT 100 * HZ
289#define QETH_HEADER_SIZE 32 289#define QETH_HEADER_SIZE 32
290#define MAX_PORTNO 15 290#define MAX_PORTNO 15
291#define QETH_FAKE_LL_LEN ETH_HLEN 291#define QETH_FAKE_LL_LEN_ETH ETH_HLEN
292#define QETH_FAKE_LL_LEN_TR (sizeof(struct trh_hdr)-TR_MAXRIFLEN+sizeof(struct trllc))
292#define QETH_FAKE_LL_V6_ADDR_POS 24 293#define QETH_FAKE_LL_V6_ADDR_POS 24
293 294
294/*IPv6 address autoconfiguration stuff*/ 295/*IPv6 address autoconfiguration stuff*/
@@ -369,6 +370,25 @@ struct qeth_hdr {
369 } hdr; 370 } hdr;
370} __attribute__ ((packed)); 371} __attribute__ ((packed));
371 372
373/*TCP Segmentation Offload header*/
374struct qeth_hdr_ext_tso {
375 __u16 hdr_tot_len;
376 __u8 imb_hdr_no;
377 __u8 reserved;
378 __u8 hdr_type;
379 __u8 hdr_version;
380 __u16 hdr_len;
381 __u32 payload_len;
382 __u16 mss;
383 __u16 dg_hdr_len;
384 __u8 padding[16];
385} __attribute__ ((packed));
386
387struct qeth_hdr_tso {
388 struct qeth_hdr hdr; /*hdr->hdr.l3.xxx*/
389 struct qeth_hdr_ext_tso ext;
390} __attribute__ ((packed));
391
372 392
373/* flags for qeth_hdr.flags */ 393/* flags for qeth_hdr.flags */
374#define QETH_HDR_PASSTHRU 0x10 394#define QETH_HDR_PASSTHRU 0x10
@@ -866,6 +886,7 @@ qeth_push_skb(struct qeth_card *card, struct sk_buff **skb, int size)
866 return hdr; 886 return hdr;
867} 887}
868 888
889
869inline static int 890inline static int
870qeth_get_hlen(__u8 link_type) 891qeth_get_hlen(__u8 link_type)
871{ 892{
@@ -873,19 +894,19 @@ qeth_get_hlen(__u8 link_type)
873 switch (link_type) { 894 switch (link_type) {
874 case QETH_LINK_TYPE_HSTR: 895 case QETH_LINK_TYPE_HSTR:
875 case QETH_LINK_TYPE_LANE_TR: 896 case QETH_LINK_TYPE_LANE_TR:
876 return sizeof(struct qeth_hdr) + TR_HLEN; 897 return sizeof(struct qeth_hdr_tso) + TR_HLEN;
877 default: 898 default:
878#ifdef CONFIG_QETH_VLAN 899#ifdef CONFIG_QETH_VLAN
879 return sizeof(struct qeth_hdr) + VLAN_ETH_HLEN; 900 return sizeof(struct qeth_hdr_tso) + VLAN_ETH_HLEN;
880#else 901#else
881 return sizeof(struct qeth_hdr) + ETH_HLEN; 902 return sizeof(struct qeth_hdr_tso) + ETH_HLEN;
882#endif 903#endif
883 } 904 }
884#else /* CONFIG_QETH_IPV6 */ 905#else /* CONFIG_QETH_IPV6 */
885#ifdef CONFIG_QETH_VLAN 906#ifdef CONFIG_QETH_VLAN
886 return sizeof(struct qeth_hdr) + VLAN_HLEN; 907 return sizeof(struct qeth_hdr_tso) + VLAN_HLEN;
887#else 908#else
888 return sizeof(struct qeth_hdr); 909 return sizeof(struct qeth_hdr_tso);
889#endif 910#endif
890#endif /* CONFIG_QETH_IPV6 */ 911#endif /* CONFIG_QETH_IPV6 */
891} 912}
diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c
index 7ee1c06ed68a..f94f1f25eec6 100644
--- a/drivers/s390/net/qeth_eddp.c
+++ b/drivers/s390/net/qeth_eddp.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * linux/drivers/s390/net/qeth_eddp.c ($Revision: 1.11 $) 3 * linux/drivers/s390/net/qeth_eddp.c ($Revision: 1.13 $)
4 * 4 *
5 * Enhanced Device Driver Packing (EDDP) support for the qeth driver. 5 * Enhanced Device Driver Packing (EDDP) support for the qeth driver.
6 * 6 *
@@ -8,7 +8,7 @@
8 * 8 *
9 * Author(s): Thomas Spatzier <tspat@de.ibm.com> 9 * Author(s): Thomas Spatzier <tspat@de.ibm.com>
10 * 10 *
11 * $Revision: 1.11 $ $Date: 2005/03/24 09:04:18 $ 11 * $Revision: 1.13 $ $Date: 2005/05/04 20:19:18 $
12 * 12 *
13 */ 13 */
14#include <linux/config.h> 14#include <linux/config.h>
@@ -85,7 +85,7 @@ void
85qeth_eddp_buf_release_contexts(struct qeth_qdio_out_buffer *buf) 85qeth_eddp_buf_release_contexts(struct qeth_qdio_out_buffer *buf)
86{ 86{
87 struct qeth_eddp_context_reference *ref; 87 struct qeth_eddp_context_reference *ref;
88 88
89 QETH_DBF_TEXT(trace, 6, "eddprctx"); 89 QETH_DBF_TEXT(trace, 6, "eddprctx");
90 while (!list_empty(&buf->ctx_list)){ 90 while (!list_empty(&buf->ctx_list)){
91 ref = list_entry(buf->ctx_list.next, 91 ref = list_entry(buf->ctx_list.next,
@@ -139,7 +139,7 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
139 "buffer!\n"); 139 "buffer!\n");
140 goto out; 140 goto out;
141 } 141 }
142 } 142 }
143 /* check if the whole next skb fits into current buffer */ 143 /* check if the whole next skb fits into current buffer */
144 if ((QETH_MAX_BUFFER_ELEMENTS(queue->card) - 144 if ((QETH_MAX_BUFFER_ELEMENTS(queue->card) -
145 buf->next_element_to_fill) 145 buf->next_element_to_fill)
@@ -152,7 +152,7 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
152 * and increment ctx's refcnt */ 152 * and increment ctx's refcnt */
153 must_refcnt = 1; 153 must_refcnt = 1;
154 continue; 154 continue;
155 } 155 }
156 if (must_refcnt){ 156 if (must_refcnt){
157 must_refcnt = 0; 157 must_refcnt = 0;
158 if (qeth_eddp_buf_ref_context(buf, ctx)){ 158 if (qeth_eddp_buf_ref_context(buf, ctx)){
@@ -202,40 +202,29 @@ out:
202 return flush_cnt; 202 return flush_cnt;
203} 203}
204 204
205static inline int
206qeth_get_skb_data_len(struct sk_buff *skb)
207{
208 int len = skb->len;
209 int i;
210
211 for (i = 0; i < skb_shinfo(skb)->nr_frags; ++i)
212 len -= skb_shinfo(skb)->frags[i].size;
213 return len;
214}
215
216static inline void 205static inline void
217qeth_eddp_create_segment_hdrs(struct qeth_eddp_context *ctx, 206qeth_eddp_create_segment_hdrs(struct qeth_eddp_context *ctx,
218 struct qeth_eddp_data *eddp) 207 struct qeth_eddp_data *eddp, int data_len)
219{ 208{
220 u8 *page; 209 u8 *page;
221 int page_remainder; 210 int page_remainder;
222 int page_offset; 211 int page_offset;
223 int hdr_len; 212 int pkt_len;
224 struct qeth_eddp_element *element; 213 struct qeth_eddp_element *element;
225 214
226 QETH_DBF_TEXT(trace, 5, "eddpcrsh"); 215 QETH_DBF_TEXT(trace, 5, "eddpcrsh");
227 page = ctx->pages[ctx->offset >> PAGE_SHIFT]; 216 page = ctx->pages[ctx->offset >> PAGE_SHIFT];
228 page_offset = ctx->offset % PAGE_SIZE; 217 page_offset = ctx->offset % PAGE_SIZE;
229 element = &ctx->elements[ctx->num_elements]; 218 element = &ctx->elements[ctx->num_elements];
230 hdr_len = eddp->nhl + eddp->thl; 219 pkt_len = eddp->nhl + eddp->thl + data_len;
231 /* FIXME: layer2 and VLAN !!! */ 220 /* FIXME: layer2 and VLAN !!! */
232 if (eddp->qh.hdr.l2.id == QETH_HEADER_TYPE_LAYER2) 221 if (eddp->qh.hdr.l2.id == QETH_HEADER_TYPE_LAYER2)
233 hdr_len += ETH_HLEN; 222 pkt_len += ETH_HLEN;
234 if (eddp->mac.h_proto == __constant_htons(ETH_P_8021Q)) 223 if (eddp->mac.h_proto == __constant_htons(ETH_P_8021Q))
235 hdr_len += VLAN_HLEN; 224 pkt_len += VLAN_HLEN;
236 /* does complete header fit in current page ? */ 225 /* does complete packet fit in current page ? */
237 page_remainder = PAGE_SIZE - page_offset; 226 page_remainder = PAGE_SIZE - page_offset;
238 if (page_remainder < (sizeof(struct qeth_hdr) + hdr_len)){ 227 if (page_remainder < (sizeof(struct qeth_hdr) + pkt_len)){
239 /* no -> go to start of next page */ 228 /* no -> go to start of next page */
240 ctx->offset += page_remainder; 229 ctx->offset += page_remainder;
241 page = ctx->pages[ctx->offset >> PAGE_SHIFT]; 230 page = ctx->pages[ctx->offset >> PAGE_SHIFT];
@@ -281,7 +270,7 @@ qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len,
281 int left_in_frag; 270 int left_in_frag;
282 int copy_len; 271 int copy_len;
283 u8 *src; 272 u8 *src;
284 273
285 QETH_DBF_TEXT(trace, 5, "eddpcdtc"); 274 QETH_DBF_TEXT(trace, 5, "eddpcdtc");
286 if (skb_shinfo(eddp->skb)->nr_frags == 0) { 275 if (skb_shinfo(eddp->skb)->nr_frags == 0) {
287 memcpy(dst, eddp->skb->data + eddp->skb_offset, len); 276 memcpy(dst, eddp->skb->data + eddp->skb_offset, len);
@@ -292,7 +281,7 @@ qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len,
292 while (len > 0) { 281 while (len > 0) {
293 if (eddp->frag < 0) { 282 if (eddp->frag < 0) {
294 /* we're in skb->data */ 283 /* we're in skb->data */
295 left_in_frag = qeth_get_skb_data_len(eddp->skb) 284 left_in_frag = (eddp->skb->len - eddp->skb->data_len)
296 - eddp->skb_offset; 285 - eddp->skb_offset;
297 src = eddp->skb->data + eddp->skb_offset; 286 src = eddp->skb->data + eddp->skb_offset;
298 } else { 287 } else {
@@ -424,7 +413,7 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
424 struct tcphdr *tcph; 413 struct tcphdr *tcph;
425 int data_len; 414 int data_len;
426 u32 hcsum; 415 u32 hcsum;
427 416
428 QETH_DBF_TEXT(trace, 5, "eddpftcp"); 417 QETH_DBF_TEXT(trace, 5, "eddpftcp");
429 eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl; 418 eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl;
430 tcph = eddp->skb->h.th; 419 tcph = eddp->skb->h.th;
@@ -464,7 +453,7 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
464 else 453 else
465 hcsum = qeth_eddp_check_tcp6_hdr(eddp, data_len); 454 hcsum = qeth_eddp_check_tcp6_hdr(eddp, data_len);
466 /* fill the next segment into the context */ 455 /* fill the next segment into the context */
467 qeth_eddp_create_segment_hdrs(ctx, eddp); 456 qeth_eddp_create_segment_hdrs(ctx, eddp, data_len);
468 qeth_eddp_create_segment_data_tcp(ctx, eddp, data_len, hcsum); 457 qeth_eddp_create_segment_data_tcp(ctx, eddp, data_len, hcsum);
469 if (eddp->skb_offset >= eddp->skb->len) 458 if (eddp->skb_offset >= eddp->skb->len)
470 break; 459 break;
@@ -474,13 +463,13 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
474 eddp->th.tcp.h.seq += data_len; 463 eddp->th.tcp.h.seq += data_len;
475 } 464 }
476} 465}
477 466
478static inline int 467static inline int
479qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, 468qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
480 struct sk_buff *skb, struct qeth_hdr *qhdr) 469 struct sk_buff *skb, struct qeth_hdr *qhdr)
481{ 470{
482 struct qeth_eddp_data *eddp = NULL; 471 struct qeth_eddp_data *eddp = NULL;
483 472
484 QETH_DBF_TEXT(trace, 5, "eddpficx"); 473 QETH_DBF_TEXT(trace, 5, "eddpficx");
485 /* create our segmentation headers and copy original headers */ 474 /* create our segmentation headers and copy original headers */
486 if (skb->protocol == ETH_P_IP) 475 if (skb->protocol == ETH_P_IP)
@@ -520,7 +509,7 @@ qeth_eddp_calc_num_pages(struct qeth_eddp_context *ctx, struct sk_buff *skb,
520 int hdr_len) 509 int hdr_len)
521{ 510{
522 int skbs_per_page; 511 int skbs_per_page;
523 512
524 QETH_DBF_TEXT(trace, 5, "eddpcanp"); 513 QETH_DBF_TEXT(trace, 5, "eddpcanp");
525 /* can we put multiple skbs in one page? */ 514 /* can we put multiple skbs in one page? */
526 skbs_per_page = PAGE_SIZE / (skb_shinfo(skb)->tso_size + hdr_len); 515 skbs_per_page = PAGE_SIZE / (skb_shinfo(skb)->tso_size + hdr_len);
@@ -600,7 +589,7 @@ qeth_eddp_create_context_tcp(struct qeth_card *card, struct sk_buff *skb,
600 struct qeth_hdr *qhdr) 589 struct qeth_hdr *qhdr)
601{ 590{
602 struct qeth_eddp_context *ctx = NULL; 591 struct qeth_eddp_context *ctx = NULL;
603 592
604 QETH_DBF_TEXT(trace, 5, "creddpct"); 593 QETH_DBF_TEXT(trace, 5, "creddpct");
605 if (skb->protocol == ETH_P_IP) 594 if (skb->protocol == ETH_P_IP)
606 ctx = qeth_eddp_create_context_generic(card, skb, 595 ctx = qeth_eddp_create_context_generic(card, skb,
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index 607b92542df6..208127a5033a 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.206 $) 3 * linux/drivers/s390/net/qeth_main.c ($Revision: 1.214 $)
4 * 4 *
5 * Linux on zSeries OSA Express and HiperSockets support 5 * Linux on zSeries OSA Express and HiperSockets support
6 * 6 *
@@ -12,7 +12,7 @@
12 * Frank Pavlic (pavlic@de.ibm.com) and 12 * Frank Pavlic (pavlic@de.ibm.com) and
13 * Thomas Spatzier <tspat@de.ibm.com> 13 * Thomas Spatzier <tspat@de.ibm.com>
14 * 14 *
15 * $Revision: 1.206 $ $Date: 2005/03/24 09:04:18 $ 15 * $Revision: 1.214 $ $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
@@ -80,7 +80,7 @@ qeth_eyecatcher(void)
80#include "qeth_eddp.h" 80#include "qeth_eddp.h"
81#include "qeth_tso.h" 81#include "qeth_tso.h"
82 82
83#define VERSION_QETH_C "$Revision: 1.206 $" 83#define VERSION_QETH_C "$Revision: 1.214 $"
84static const char *version = "qeth S/390 OSA-Express driver"; 84static const char *version = "qeth S/390 OSA-Express driver";
85 85
86/** 86/**
@@ -158,6 +158,9 @@ qeth_irq_tasklet(unsigned long);
158static int 158static int
159qeth_set_online(struct ccwgroup_device *); 159qeth_set_online(struct ccwgroup_device *);
160 160
161static int
162__qeth_set_online(struct ccwgroup_device *gdev, int recovery_mode);
163
161static struct qeth_ipaddr * 164static struct qeth_ipaddr *
162qeth_get_addr_buffer(enum qeth_prot_versions); 165qeth_get_addr_buffer(enum qeth_prot_versions);
163 166
@@ -510,10 +513,10 @@ qeth_irq_tasklet(unsigned long data)
510 wake_up(&card->wait_q); 513 wake_up(&card->wait_q);
511} 514}
512 515
513static int qeth_stop_card(struct qeth_card *); 516static int qeth_stop_card(struct qeth_card *, int);
514 517
515static int 518static int
516qeth_set_offline(struct ccwgroup_device *cgdev) 519__qeth_set_offline(struct ccwgroup_device *cgdev, int recovery_mode)
517{ 520{
518 struct qeth_card *card = (struct qeth_card *) cgdev->dev.driver_data; 521 struct qeth_card *card = (struct qeth_card *) cgdev->dev.driver_data;
519 int rc = 0; 522 int rc = 0;
@@ -523,7 +526,7 @@ qeth_set_offline(struct ccwgroup_device *cgdev)
523 QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); 526 QETH_DBF_HEX(setup, 3, &card, sizeof(void *));
524 527
525 recover_flag = card->state; 528 recover_flag = card->state;
526 if (qeth_stop_card(card) == -ERESTARTSYS){ 529 if (qeth_stop_card(card, recovery_mode) == -ERESTARTSYS){
527 PRINT_WARN("Stopping card %s interrupted by user!\n", 530 PRINT_WARN("Stopping card %s interrupted by user!\n",
528 CARD_BUS_ID(card)); 531 CARD_BUS_ID(card));
529 return -ERESTARTSYS; 532 return -ERESTARTSYS;
@@ -540,6 +543,12 @@ qeth_set_offline(struct ccwgroup_device *cgdev)
540} 543}
541 544
542static int 545static int
546qeth_set_offline(struct ccwgroup_device *cgdev)
547{
548 return __qeth_set_offline(cgdev, 0);
549}
550
551static int
543qeth_wait_for_threads(struct qeth_card *card, unsigned long threads); 552qeth_wait_for_threads(struct qeth_card *card, unsigned long threads);
544 553
545 554
@@ -953,8 +962,8 @@ qeth_recover(void *ptr)
953 PRINT_WARN("Recovery of device %s started ...\n", 962 PRINT_WARN("Recovery of device %s started ...\n",
954 CARD_BUS_ID(card)); 963 CARD_BUS_ID(card));
955 card->use_hard_stop = 1; 964 card->use_hard_stop = 1;
956 qeth_set_offline(card->gdev); 965 __qeth_set_offline(card->gdev,1);
957 rc = qeth_set_online(card->gdev); 966 rc = __qeth_set_online(card->gdev,1);
958 if (!rc) 967 if (!rc)
959 PRINT_INFO("Device %s successfully recovered!\n", 968 PRINT_INFO("Device %s successfully recovered!\n",
960 CARD_BUS_ID(card)); 969 CARD_BUS_ID(card));
@@ -2152,9 +2161,15 @@ qeth_get_next_skb(struct qeth_card *card, struct qdio_buffer *buffer,
2152 if (!skb_len) 2161 if (!skb_len)
2153 return NULL; 2162 return NULL;
2154 if (card->options.fake_ll){ 2163 if (card->options.fake_ll){
2155 if (!(skb = qeth_get_skb(skb_len + QETH_FAKE_LL_LEN))) 2164 if(card->dev->type == ARPHRD_IEEE802_TR){
2156 goto no_mem; 2165 if (!(skb = qeth_get_skb(skb_len+QETH_FAKE_LL_LEN_TR)))
2157 skb_pull(skb, QETH_FAKE_LL_LEN); 2166 goto no_mem;
2167 skb_reserve(skb,QETH_FAKE_LL_LEN_TR);
2168 } else {
2169 if (!(skb = qeth_get_skb(skb_len+QETH_FAKE_LL_LEN_ETH)))
2170 goto no_mem;
2171 skb_reserve(skb,QETH_FAKE_LL_LEN_ETH);
2172 }
2158 } else if (!(skb = qeth_get_skb(skb_len))) 2173 } else if (!(skb = qeth_get_skb(skb_len)))
2159 goto no_mem; 2174 goto no_mem;
2160 data_ptr = element->addr + offset; 2175 data_ptr = element->addr + offset;
@@ -2229,14 +2244,68 @@ qeth_type_trans(struct sk_buff *skb, struct net_device *dev)
2229} 2244}
2230 2245
2231static inline void 2246static inline void
2232qeth_rebuild_skb_fake_ll(struct qeth_card *card, struct sk_buff *skb, 2247qeth_rebuild_skb_fake_ll_tr(struct qeth_card *card, struct sk_buff *skb,
2248 struct qeth_hdr *hdr)
2249{
2250 struct trh_hdr *fake_hdr;
2251 struct trllc *fake_llc;
2252 struct iphdr *ip_hdr;
2253
2254 QETH_DBF_TEXT(trace,5,"skbfktr");
2255 skb->mac.raw = skb->data - QETH_FAKE_LL_LEN_TR;
2256 /* this is a fake ethernet header */
2257 fake_hdr = (struct trh_hdr *) skb->mac.raw;
2258
2259 /* the destination MAC address */
2260 switch (skb->pkt_type){
2261 case PACKET_MULTICAST:
2262 switch (skb->protocol){
2263#ifdef CONFIG_QETH_IPV6
2264 case __constant_htons(ETH_P_IPV6):
2265 ndisc_mc_map((struct in6_addr *)
2266 skb->data + QETH_FAKE_LL_V6_ADDR_POS,
2267 fake_hdr->daddr, card->dev, 0);
2268 break;
2269#endif /* CONFIG_QETH_IPV6 */
2270 case __constant_htons(ETH_P_IP):
2271 ip_hdr = (struct iphdr *)skb->data;
2272 ip_tr_mc_map(ip_hdr->daddr, fake_hdr->daddr);
2273 break;
2274 default:
2275 memcpy(fake_hdr->daddr, card->dev->dev_addr, TR_ALEN);
2276 }
2277 break;
2278 case PACKET_BROADCAST:
2279 memset(fake_hdr->daddr, 0xff, TR_ALEN);
2280 break;
2281 default:
2282 memcpy(fake_hdr->daddr, card->dev->dev_addr, TR_ALEN);
2283 }
2284 /* the source MAC address */
2285 if (hdr->hdr.l3.ext_flags & QETH_HDR_EXT_SRC_MAC_ADDR)
2286 memcpy(fake_hdr->saddr, &hdr->hdr.l3.dest_addr[2], TR_ALEN);
2287 else
2288 memset(fake_hdr->saddr, 0, TR_ALEN);
2289 fake_hdr->rcf=0;
2290 fake_llc = (struct trllc*)&(fake_hdr->rcf);
2291 fake_llc->dsap = EXTENDED_SAP;
2292 fake_llc->ssap = EXTENDED_SAP;
2293 fake_llc->llc = UI_CMD;
2294 fake_llc->protid[0] = 0;
2295 fake_llc->protid[1] = 0;
2296 fake_llc->protid[2] = 0;
2297 fake_llc->ethertype = ETH_P_IP;
2298}
2299
2300static inline void
2301qeth_rebuild_skb_fake_ll_eth(struct qeth_card *card, struct sk_buff *skb,
2233 struct qeth_hdr *hdr) 2302 struct qeth_hdr *hdr)
2234{ 2303{
2235 struct ethhdr *fake_hdr; 2304 struct ethhdr *fake_hdr;
2236 struct iphdr *ip_hdr; 2305 struct iphdr *ip_hdr;
2237 2306
2238 QETH_DBF_TEXT(trace,5,"skbfake"); 2307 QETH_DBF_TEXT(trace,5,"skbfketh");
2239 skb->mac.raw = skb->data - QETH_FAKE_LL_LEN; 2308 skb->mac.raw = skb->data - QETH_FAKE_LL_LEN_ETH;
2240 /* this is a fake ethernet header */ 2309 /* this is a fake ethernet header */
2241 fake_hdr = (struct ethhdr *) skb->mac.raw; 2310 fake_hdr = (struct ethhdr *) skb->mac.raw;
2242 2311
@@ -2253,10 +2322,7 @@ qeth_rebuild_skb_fake_ll(struct qeth_card *card, struct sk_buff *skb,
2253#endif /* CONFIG_QETH_IPV6 */ 2322#endif /* CONFIG_QETH_IPV6 */
2254 case __constant_htons(ETH_P_IP): 2323 case __constant_htons(ETH_P_IP):
2255 ip_hdr = (struct iphdr *)skb->data; 2324 ip_hdr = (struct iphdr *)skb->data;
2256 if (card->dev->type == ARPHRD_IEEE802_TR) 2325 ip_eth_mc_map(ip_hdr->daddr, fake_hdr->h_dest);
2257 ip_tr_mc_map(ip_hdr->daddr, fake_hdr->h_dest);
2258 else
2259 ip_eth_mc_map(ip_hdr->daddr, fake_hdr->h_dest);
2260 break; 2326 break;
2261 default: 2327 default:
2262 memcpy(fake_hdr->h_dest, card->dev->dev_addr, ETH_ALEN); 2328 memcpy(fake_hdr->h_dest, card->dev->dev_addr, ETH_ALEN);
@@ -2278,6 +2344,16 @@ qeth_rebuild_skb_fake_ll(struct qeth_card *card, struct sk_buff *skb,
2278} 2344}
2279 2345
2280static inline void 2346static inline void
2347qeth_rebuild_skb_fake_ll(struct qeth_card *card, struct sk_buff *skb,
2348 struct qeth_hdr *hdr)
2349{
2350 if (card->dev->type == ARPHRD_IEEE802_TR)
2351 qeth_rebuild_skb_fake_ll_tr(card, skb, hdr);
2352 else
2353 qeth_rebuild_skb_fake_ll_eth(card, skb, hdr);
2354}
2355
2356static inline void
2281qeth_rebuild_skb_vlan(struct qeth_card *card, struct sk_buff *skb, 2357qeth_rebuild_skb_vlan(struct qeth_card *card, struct sk_buff *skb,
2282 struct qeth_hdr *hdr) 2358 struct qeth_hdr *hdr)
2283{ 2359{
@@ -3440,16 +3516,25 @@ qeth_fake_header(struct sk_buff *skb, struct net_device *dev,
3440 unsigned short type, void *daddr, void *saddr, 3516 unsigned short type, void *daddr, void *saddr,
3441 unsigned len) 3517 unsigned len)
3442{ 3518{
3443 struct ethhdr *hdr; 3519 if(dev->type == ARPHRD_IEEE802_TR){
3520 struct trh_hdr *hdr;
3521 hdr = (struct trh_hdr *)skb_push(skb, QETH_FAKE_LL_LEN_TR);
3522 memcpy(hdr->saddr, dev->dev_addr, TR_ALEN);
3523 memcpy(hdr->daddr, "FAKELL", TR_ALEN);
3524 return QETH_FAKE_LL_LEN_TR;
3525
3526 } else {
3527 struct ethhdr *hdr;
3528 hdr = (struct ethhdr *)skb_push(skb, QETH_FAKE_LL_LEN_ETH);
3529 memcpy(hdr->h_source, dev->dev_addr, ETH_ALEN);
3530 memcpy(hdr->h_dest, "FAKELL", ETH_ALEN);
3531 if (type != ETH_P_802_3)
3532 hdr->h_proto = htons(type);
3533 else
3534 hdr->h_proto = htons(len);
3535 return QETH_FAKE_LL_LEN_ETH;
3444 3536
3445 hdr = (struct ethhdr *)skb_push(skb, QETH_FAKE_LL_LEN); 3537 }
3446 memcpy(hdr->h_source, dev->dev_addr, ETH_ALEN);
3447 memcpy(hdr->h_dest, "FAKELL", ETH_ALEN);
3448 if (type != ETH_P_802_3)
3449 hdr->h_proto = htons(type);
3450 else
3451 hdr->h_proto = htons(len);
3452 return QETH_FAKE_LL_LEN;
3453} 3538}
3454 3539
3455static inline int 3540static inline int
@@ -3710,16 +3795,12 @@ static inline int
3710qeth_prepare_skb(struct qeth_card *card, struct sk_buff **skb, 3795qeth_prepare_skb(struct qeth_card *card, struct sk_buff **skb,
3711 struct qeth_hdr **hdr, int ipv) 3796 struct qeth_hdr **hdr, int ipv)
3712{ 3797{
3713 int rc = 0;
3714#ifdef CONFIG_QETH_VLAN 3798#ifdef CONFIG_QETH_VLAN
3715 u16 *tag; 3799 u16 *tag;
3716#endif 3800#endif
3717 3801
3718 QETH_DBF_TEXT(trace, 6, "prepskb"); 3802 QETH_DBF_TEXT(trace, 6, "prepskb");
3719 3803
3720 rc = qeth_realloc_headroom(card, skb, sizeof(struct qeth_hdr));
3721 if (rc)
3722 return rc;
3723#ifdef CONFIG_QETH_VLAN 3804#ifdef CONFIG_QETH_VLAN
3724 if (card->vlangrp && vlan_tx_tag_present(*skb) && 3805 if (card->vlangrp && vlan_tx_tag_present(*skb) &&
3725 ((ipv == 6) || card->options.layer2) ) { 3806 ((ipv == 6) || card->options.layer2) ) {
@@ -3882,9 +3963,15 @@ qeth_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
3882 memcpy(hdr->hdr.l3.dest_addr, &skb->nh.ipv6h->daddr, 16); 3963 memcpy(hdr->hdr.l3.dest_addr, &skb->nh.ipv6h->daddr, 16);
3883 } 3964 }
3884 } else { /* passthrough */ 3965 } else { /* passthrough */
3885 if (!memcmp(skb->data + sizeof(struct qeth_hdr), 3966 if((skb->dev->type == ARPHRD_IEEE802_TR) &&
3967 !memcmp(skb->data + sizeof(struct qeth_hdr) +
3968 sizeof(__u16), skb->dev->broadcast, 6)) {
3969 hdr->hdr.l3.flags = QETH_CAST_BROADCAST |
3970 QETH_HDR_PASSTHRU;
3971 } else if (!memcmp(skb->data + sizeof(struct qeth_hdr),
3886 skb->dev->broadcast, 6)) { /* broadcast? */ 3972 skb->dev->broadcast, 6)) { /* broadcast? */
3887 hdr->hdr.l3.flags = QETH_CAST_BROADCAST | QETH_HDR_PASSTHRU; 3973 hdr->hdr.l3.flags = QETH_CAST_BROADCAST |
3974 QETH_HDR_PASSTHRU;
3888 } else { 3975 } else {
3889 hdr->hdr.l3.flags = (cast_type == RTN_MULTICAST) ? 3976 hdr->hdr.l3.flags = (cast_type == RTN_MULTICAST) ?
3890 QETH_CAST_MULTICAST | QETH_HDR_PASSTHRU : 3977 QETH_CAST_MULTICAST | QETH_HDR_PASSTHRU :
@@ -3894,67 +3981,29 @@ qeth_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
3894} 3981}
3895 3982
3896static inline void 3983static inline void
3897__qeth_fill_buffer_frag(struct sk_buff *skb, struct qdio_buffer *buffer,
3898 int *next_element_to_fill)
3899{
3900 int length = skb->len;
3901 struct skb_frag_struct *frag;
3902 int fragno;
3903 unsigned long addr;
3904 int element;
3905 int first_lap = 1;
3906
3907 fragno = skb_shinfo(skb)->nr_frags; /* start with last frag */
3908 element = *next_element_to_fill + fragno;
3909 while (length > 0) {
3910 if (fragno > 0) {
3911 frag = &skb_shinfo(skb)->frags[fragno - 1];
3912 addr = (page_to_pfn(frag->page) << PAGE_SHIFT) +
3913 frag->page_offset;
3914 buffer->element[element].addr = (char *)addr;
3915 buffer->element[element].length = frag->size;
3916 length -= frag->size;
3917 if (first_lap)
3918 buffer->element[element].flags =
3919 SBAL_FLAGS_LAST_FRAG;
3920 else
3921 buffer->element[element].flags =
3922 SBAL_FLAGS_MIDDLE_FRAG;
3923 } else {
3924 buffer->element[element].addr = skb->data;
3925 buffer->element[element].length = length;
3926 length = 0;
3927 buffer->element[element].flags =
3928 SBAL_FLAGS_FIRST_FRAG;
3929 }
3930 element--;
3931 fragno--;
3932 first_lap = 0;
3933 }
3934 *next_element_to_fill += skb_shinfo(skb)->nr_frags + 1;
3935}
3936
3937static inline void
3938__qeth_fill_buffer(struct sk_buff *skb, struct qdio_buffer *buffer, 3984__qeth_fill_buffer(struct sk_buff *skb, struct qdio_buffer *buffer,
3939 int *next_element_to_fill) 3985 int is_tso, int *next_element_to_fill)
3940{ 3986{
3941 int length = skb->len; 3987 int length = skb->len;
3942 int length_here; 3988 int length_here;
3943 int element; 3989 int element;
3944 char *data; 3990 char *data;
3945 int first_lap = 1; 3991 int first_lap ;
3946 3992
3947 element = *next_element_to_fill; 3993 element = *next_element_to_fill;
3948 data = skb->data; 3994 data = skb->data;
3995 first_lap = (is_tso == 0 ? 1 : 0);
3996
3949 while (length > 0) { 3997 while (length > 0) {
3950 /* length_here is the remaining amount of data in this page */ 3998 /* length_here is the remaining amount of data in this page */
3951 length_here = PAGE_SIZE - ((unsigned long) data % PAGE_SIZE); 3999 length_here = PAGE_SIZE - ((unsigned long) data % PAGE_SIZE);
3952 if (length < length_here) 4000 if (length < length_here)
3953 length_here = length; 4001 length_here = length;
4002
3954 buffer->element[element].addr = data; 4003 buffer->element[element].addr = data;
3955 buffer->element[element].length = length_here; 4004 buffer->element[element].length = length_here;
3956 length -= length_here; 4005 length -= length_here;
3957 if (!length){ 4006 if (!length) {
3958 if (first_lap) 4007 if (first_lap)
3959 buffer->element[element].flags = 0; 4008 buffer->element[element].flags = 0;
3960 else 4009 else
@@ -3981,17 +4030,35 @@ qeth_fill_buffer(struct qeth_qdio_out_q *queue,
3981 struct sk_buff *skb) 4030 struct sk_buff *skb)
3982{ 4031{
3983 struct qdio_buffer *buffer; 4032 struct qdio_buffer *buffer;
3984 int flush_cnt = 0; 4033 struct qeth_hdr_tso *hdr;
4034 int flush_cnt = 0, hdr_len, large_send = 0;
3985 4035
3986 QETH_DBF_TEXT(trace, 6, "qdfillbf"); 4036 QETH_DBF_TEXT(trace, 6, "qdfillbf");
4037
3987 buffer = buf->buffer; 4038 buffer = buf->buffer;
3988 atomic_inc(&skb->users); 4039 atomic_inc(&skb->users);
3989 skb_queue_tail(&buf->skb_list, skb); 4040 skb_queue_tail(&buf->skb_list, skb);
4041
4042 hdr = (struct qeth_hdr_tso *) skb->data;
4043 /*check first on TSO ....*/
4044 if (hdr->hdr.hdr.l3.id == QETH_HEADER_TYPE_TSO) {
4045 int element = buf->next_element_to_fill;
4046
4047 hdr_len = sizeof(struct qeth_hdr_tso) + hdr->ext.dg_hdr_len;
4048 /*fill first buffer entry only with header information */
4049 buffer->element[element].addr = skb->data;
4050 buffer->element[element].length = hdr_len;
4051 buffer->element[element].flags = SBAL_FLAGS_FIRST_FRAG;
4052 buf->next_element_to_fill++;
4053 skb->data += hdr_len;
4054 skb->len -= hdr_len;
4055 large_send = 1;
4056 }
3990 if (skb_shinfo(skb)->nr_frags == 0) 4057 if (skb_shinfo(skb)->nr_frags == 0)
3991 __qeth_fill_buffer(skb, buffer, 4058 __qeth_fill_buffer(skb, buffer, large_send,
3992 (int *)&buf->next_element_to_fill); 4059 (int *)&buf->next_element_to_fill);
3993 else 4060 else
3994 __qeth_fill_buffer_frag(skb, buffer, 4061 __qeth_fill_buffer_frag(skb, buffer, large_send,
3995 (int *)&buf->next_element_to_fill); 4062 (int *)&buf->next_element_to_fill);
3996 4063
3997 if (!queue->do_pack) { 4064 if (!queue->do_pack) {
@@ -4184,6 +4251,25 @@ out:
4184} 4251}
4185 4252
4186static inline int 4253static inline int
4254qeth_get_elements_no(struct qeth_card *card, void *hdr, struct sk_buff *skb)
4255{
4256 int elements_needed = 0;
4257
4258 if (skb_shinfo(skb)->nr_frags > 0) {
4259 elements_needed = (skb_shinfo(skb)->nr_frags + 1);
4260 }
4261 if (elements_needed == 0 )
4262 elements_needed = 1 + (((((unsigned long) hdr) % PAGE_SIZE)
4263 + skb->len) >> PAGE_SHIFT);
4264 if (elements_needed > QETH_MAX_BUFFER_ELEMENTS(card)){
4265 PRINT_ERR("qeth_do_send_packet: invalid size of "
4266 "IP packet. Discarded.");
4267 return 0;
4268 }
4269 return elements_needed;
4270}
4271
4272static inline int
4187qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) 4273qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4188{ 4274{
4189 int ipv = 0; 4275 int ipv = 0;
@@ -4205,7 +4291,11 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4205 dev_kfree_skb_irq(skb); 4291 dev_kfree_skb_irq(skb);
4206 return 0; 4292 return 0;
4207 } 4293 }
4208 skb_pull(skb, QETH_FAKE_LL_LEN); 4294 if(card->dev->type == ARPHRD_IEEE802_TR){
4295 skb_pull(skb, QETH_FAKE_LL_LEN_TR);
4296 } else {
4297 skb_pull(skb, QETH_FAKE_LL_LEN_ETH);
4298 }
4209 } 4299 }
4210 } 4300 }
4211 cast_type = qeth_get_cast_type(card, skb); 4301 cast_type = qeth_get_cast_type(card, skb);
@@ -4221,19 +4311,25 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4221 if (skb_shinfo(skb)->tso_size) 4311 if (skb_shinfo(skb)->tso_size)
4222 large_send = card->options.large_send; 4312 large_send = card->options.large_send;
4223 4313
4224 if ((rc = qeth_prepare_skb(card, &skb, &hdr, ipv))){
4225 QETH_DBF_TEXT_(trace, 4, "pskbe%d", rc);
4226 return rc;
4227 }
4228 /*are we able to do TSO ? If so ,prepare and send it from here */ 4314 /*are we able to do TSO ? If so ,prepare and send it from here */
4229 if ((large_send == QETH_LARGE_SEND_TSO) && 4315 if ((large_send == QETH_LARGE_SEND_TSO) &&
4230 (cast_type == RTN_UNSPEC)) { 4316 (cast_type == RTN_UNSPEC)) {
4231 rc = qeth_tso_send_packet(card, skb, queue, 4317 rc = qeth_tso_prepare_packet(card, skb, ipv, cast_type);
4232 ipv, cast_type); 4318 if (rc) {
4233 goto do_statistics; 4319 card->stats.tx_dropped++;
4320 card->stats.tx_errors++;
4321 dev_kfree_skb_any(skb);
4322 return NETDEV_TX_OK;
4323 }
4324 elements_needed++;
4325 } else {
4326 if ((rc = qeth_prepare_skb(card, &skb, &hdr, ipv))) {
4327 QETH_DBF_TEXT_(trace, 4, "pskbe%d", rc);
4328 return rc;
4329 }
4330 qeth_fill_header(card, hdr, skb, ipv, cast_type);
4234 } 4331 }
4235 4332
4236 qeth_fill_header(card, hdr, skb, ipv, cast_type);
4237 if (large_send == QETH_LARGE_SEND_EDDP) { 4333 if (large_send == QETH_LARGE_SEND_EDDP) {
4238 ctx = qeth_eddp_create_context(card, skb, hdr); 4334 ctx = qeth_eddp_create_context(card, skb, hdr);
4239 if (ctx == NULL) { 4335 if (ctx == NULL) {
@@ -4241,7 +4337,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4241 return -EINVAL; 4337 return -EINVAL;
4242 } 4338 }
4243 } else { 4339 } else {
4244 elements_needed = qeth_get_elements_no(card,(void*) hdr, skb); 4340 elements_needed += qeth_get_elements_no(card,(void*) hdr, skb);
4245 if (!elements_needed) 4341 if (!elements_needed)
4246 return -EINVAL; 4342 return -EINVAL;
4247 } 4343 }
@@ -4252,12 +4348,12 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4252 else 4348 else
4253 rc = qeth_do_send_packet_fast(card, queue, skb, hdr, 4349 rc = qeth_do_send_packet_fast(card, queue, skb, hdr,
4254 elements_needed, ctx); 4350 elements_needed, ctx);
4255do_statistics:
4256 if (!rc){ 4351 if (!rc){
4257 card->stats.tx_packets++; 4352 card->stats.tx_packets++;
4258 card->stats.tx_bytes += skb->len; 4353 card->stats.tx_bytes += skb->len;
4259#ifdef CONFIG_QETH_PERF_STATS 4354#ifdef CONFIG_QETH_PERF_STATS
4260 if (skb_shinfo(skb)->tso_size) { 4355 if (skb_shinfo(skb)->tso_size &&
4356 !(large_send == QETH_LARGE_SEND_NO)) {
4261 card->perf_stats.large_send_bytes += skb->len; 4357 card->perf_stats.large_send_bytes += skb->len;
4262 card->perf_stats.large_send_cnt++; 4358 card->perf_stats.large_send_cnt++;
4263 } 4359 }
@@ -7154,7 +7250,7 @@ qeth_wait_for_threads(struct qeth_card *card, unsigned long threads)
7154} 7250}
7155 7251
7156static int 7252static int
7157qeth_stop_card(struct qeth_card *card) 7253qeth_stop_card(struct qeth_card *card, int recovery_mode)
7158{ 7254{
7159 int rc = 0; 7255 int rc = 0;
7160 7256
@@ -7167,9 +7263,13 @@ qeth_stop_card(struct qeth_card *card)
7167 if (card->read.state == CH_STATE_UP && 7263 if (card->read.state == CH_STATE_UP &&
7168 card->write.state == CH_STATE_UP && 7264 card->write.state == CH_STATE_UP &&
7169 (card->state == CARD_STATE_UP)) { 7265 (card->state == CARD_STATE_UP)) {
7170 rtnl_lock(); 7266 if(recovery_mode) {
7171 dev_close(card->dev); 7267 qeth_stop(card->dev);
7172 rtnl_unlock(); 7268 } else {
7269 rtnl_lock();
7270 dev_close(card->dev);
7271 rtnl_unlock();
7272 }
7173 if (!card->use_hard_stop) { 7273 if (!card->use_hard_stop) {
7174 __u8 *mac = &card->dev->dev_addr[0]; 7274 __u8 *mac = &card->dev->dev_addr[0];
7175 rc = qeth_layer2_send_delmac(card, mac); 7275 rc = qeth_layer2_send_delmac(card, mac);
@@ -7341,13 +7441,17 @@ qeth_register_netdev(struct qeth_card *card)
7341} 7441}
7342 7442
7343static void 7443static void
7344qeth_start_again(struct qeth_card *card) 7444qeth_start_again(struct qeth_card *card, int recovery_mode)
7345{ 7445{
7346 QETH_DBF_TEXT(setup ,2, "startag"); 7446 QETH_DBF_TEXT(setup ,2, "startag");
7347 7447
7348 rtnl_lock(); 7448 if(recovery_mode) {
7349 dev_open(card->dev); 7449 qeth_open(card->dev);
7350 rtnl_unlock(); 7450 } else {
7451 rtnl_lock();
7452 dev_open(card->dev);
7453 rtnl_unlock();
7454 }
7351 /* this also sets saved unicast addresses */ 7455 /* this also sets saved unicast addresses */
7352 qeth_set_multicast_list(card->dev); 7456 qeth_set_multicast_list(card->dev);
7353} 7457}
@@ -7404,7 +7508,7 @@ static void qeth_make_parameters_consistent(struct qeth_card *card)
7404 7508
7405 7509
7406static int 7510static int
7407qeth_set_online(struct ccwgroup_device *gdev) 7511__qeth_set_online(struct ccwgroup_device *gdev, int recovery_mode)
7408{ 7512{
7409 struct qeth_card *card = gdev->dev.driver_data; 7513 struct qeth_card *card = gdev->dev.driver_data;
7410 int rc = 0; 7514 int rc = 0;
@@ -7464,12 +7568,12 @@ qeth_set_online(struct ccwgroup_device *gdev)
7464 * we can also use this state for recovery purposes*/ 7568 * we can also use this state for recovery purposes*/
7465 qeth_set_allowed_threads(card, 0xffffffff, 0); 7569 qeth_set_allowed_threads(card, 0xffffffff, 0);
7466 if (recover_flag == CARD_STATE_RECOVER) 7570 if (recover_flag == CARD_STATE_RECOVER)
7467 qeth_start_again(card); 7571 qeth_start_again(card, recovery_mode);
7468 qeth_notify_processes(); 7572 qeth_notify_processes();
7469 return 0; 7573 return 0;
7470out_remove: 7574out_remove:
7471 card->use_hard_stop = 1; 7575 card->use_hard_stop = 1;
7472 qeth_stop_card(card); 7576 qeth_stop_card(card, 0);
7473 ccw_device_set_offline(CARD_DDEV(card)); 7577 ccw_device_set_offline(CARD_DDEV(card));
7474 ccw_device_set_offline(CARD_WDEV(card)); 7578 ccw_device_set_offline(CARD_WDEV(card));
7475 ccw_device_set_offline(CARD_RDEV(card)); 7579 ccw_device_set_offline(CARD_RDEV(card));
@@ -7480,6 +7584,12 @@ out_remove:
7480 return -ENODEV; 7584 return -ENODEV;
7481} 7585}
7482 7586
7587static int
7588qeth_set_online(struct ccwgroup_device *gdev)
7589{
7590 return __qeth_set_online(gdev, 0);
7591}
7592
7483static struct ccw_device_id qeth_ids[] = { 7593static struct ccw_device_id qeth_ids[] = {
7484 {CCW_DEVICE(0x1731, 0x01), driver_info:QETH_CARD_TYPE_OSAE}, 7594 {CCW_DEVICE(0x1731, 0x01), driver_info:QETH_CARD_TYPE_OSAE},
7485 {CCW_DEVICE(0x1731, 0x05), driver_info:QETH_CARD_TYPE_IQD}, 7595 {CCW_DEVICE(0x1731, 0x05), driver_info:QETH_CARD_TYPE_IQD},
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c
index 240348398211..98bedb0cb387 100644
--- a/drivers/s390/net/qeth_sys.c
+++ b/drivers/s390/net/qeth_sys.c
@@ -30,7 +30,7 @@ const char *VERSION_QETH_SYS_C = "$Revision: 1.51 $";
30//low/high watermark 30//low/high watermark
31 31
32static ssize_t 32static ssize_t
33qeth_dev_state_show(struct device *dev, char *buf) 33qeth_dev_state_show(struct device *dev, struct device_attribute *attr, char *buf)
34{ 34{
35 struct qeth_card *card = dev->driver_data; 35 struct qeth_card *card = dev->driver_data;
36 if (!card) 36 if (!card)
@@ -58,7 +58,7 @@ qeth_dev_state_show(struct device *dev, char *buf)
58static DEVICE_ATTR(state, 0444, qeth_dev_state_show, NULL); 58static DEVICE_ATTR(state, 0444, qeth_dev_state_show, NULL);
59 59
60static ssize_t 60static ssize_t
61qeth_dev_chpid_show(struct device *dev, char *buf) 61qeth_dev_chpid_show(struct device *dev, struct device_attribute *attr, char *buf)
62{ 62{
63 struct qeth_card *card = dev->driver_data; 63 struct qeth_card *card = dev->driver_data;
64 if (!card) 64 if (!card)
@@ -70,7 +70,7 @@ qeth_dev_chpid_show(struct device *dev, char *buf)
70static DEVICE_ATTR(chpid, 0444, qeth_dev_chpid_show, NULL); 70static DEVICE_ATTR(chpid, 0444, qeth_dev_chpid_show, NULL);
71 71
72static ssize_t 72static ssize_t
73qeth_dev_if_name_show(struct device *dev, char *buf) 73qeth_dev_if_name_show(struct device *dev, struct device_attribute *attr, char *buf)
74{ 74{
75 struct qeth_card *card = dev->driver_data; 75 struct qeth_card *card = dev->driver_data;
76 if (!card) 76 if (!card)
@@ -81,7 +81,7 @@ qeth_dev_if_name_show(struct device *dev, char *buf)
81static DEVICE_ATTR(if_name, 0444, qeth_dev_if_name_show, NULL); 81static DEVICE_ATTR(if_name, 0444, qeth_dev_if_name_show, NULL);
82 82
83static ssize_t 83static ssize_t
84qeth_dev_card_type_show(struct device *dev, char *buf) 84qeth_dev_card_type_show(struct device *dev, struct device_attribute *attr, char *buf)
85{ 85{
86 struct qeth_card *card = dev->driver_data; 86 struct qeth_card *card = dev->driver_data;
87 if (!card) 87 if (!card)
@@ -93,7 +93,7 @@ qeth_dev_card_type_show(struct device *dev, char *buf)
93static DEVICE_ATTR(card_type, 0444, qeth_dev_card_type_show, NULL); 93static DEVICE_ATTR(card_type, 0444, qeth_dev_card_type_show, NULL);
94 94
95static ssize_t 95static ssize_t
96qeth_dev_portno_show(struct device *dev, char *buf) 96qeth_dev_portno_show(struct device *dev, struct device_attribute *attr, char *buf)
97{ 97{
98 struct qeth_card *card = dev->driver_data; 98 struct qeth_card *card = dev->driver_data;
99 if (!card) 99 if (!card)
@@ -103,7 +103,7 @@ qeth_dev_portno_show(struct device *dev, char *buf)
103} 103}
104 104
105static ssize_t 105static ssize_t
106qeth_dev_portno_store(struct device *dev, const char *buf, size_t count) 106qeth_dev_portno_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
107{ 107{
108 struct qeth_card *card = dev->driver_data; 108 struct qeth_card *card = dev->driver_data;
109 char *tmp; 109 char *tmp;
@@ -129,7 +129,7 @@ qeth_dev_portno_store(struct device *dev, const char *buf, size_t count)
129static DEVICE_ATTR(portno, 0644, qeth_dev_portno_show, qeth_dev_portno_store); 129static DEVICE_ATTR(portno, 0644, qeth_dev_portno_show, qeth_dev_portno_store);
130 130
131static ssize_t 131static ssize_t
132qeth_dev_portname_show(struct device *dev, char *buf) 132qeth_dev_portname_show(struct device *dev, struct device_attribute *attr, char *buf)
133{ 133{
134 struct qeth_card *card = dev->driver_data; 134 struct qeth_card *card = dev->driver_data;
135 char portname[9] = {0, }; 135 char portname[9] = {0, };
@@ -146,7 +146,7 @@ qeth_dev_portname_show(struct device *dev, char *buf)
146} 146}
147 147
148static ssize_t 148static ssize_t
149qeth_dev_portname_store(struct device *dev, const char *buf, size_t count) 149qeth_dev_portname_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
150{ 150{
151 struct qeth_card *card = dev->driver_data; 151 struct qeth_card *card = dev->driver_data;
152 char *tmp; 152 char *tmp;
@@ -177,7 +177,7 @@ static DEVICE_ATTR(portname, 0644, qeth_dev_portname_show,
177 qeth_dev_portname_store); 177 qeth_dev_portname_store);
178 178
179static ssize_t 179static ssize_t
180qeth_dev_checksum_show(struct device *dev, char *buf) 180qeth_dev_checksum_show(struct device *dev, struct device_attribute *attr, char *buf)
181{ 181{
182 struct qeth_card *card = dev->driver_data; 182 struct qeth_card *card = dev->driver_data;
183 183
@@ -188,7 +188,7 @@ qeth_dev_checksum_show(struct device *dev, char *buf)
188} 188}
189 189
190static ssize_t 190static ssize_t
191qeth_dev_checksum_store(struct device *dev, const char *buf, size_t count) 191qeth_dev_checksum_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
192{ 192{
193 struct qeth_card *card = dev->driver_data; 193 struct qeth_card *card = dev->driver_data;
194 char *tmp; 194 char *tmp;
@@ -218,7 +218,7 @@ static DEVICE_ATTR(checksumming, 0644, qeth_dev_checksum_show,
218 qeth_dev_checksum_store); 218 qeth_dev_checksum_store);
219 219
220static ssize_t 220static ssize_t
221qeth_dev_prioqing_show(struct device *dev, char *buf) 221qeth_dev_prioqing_show(struct device *dev, struct device_attribute *attr, char *buf)
222{ 222{
223 struct qeth_card *card = dev->driver_data; 223 struct qeth_card *card = dev->driver_data;
224 224
@@ -237,7 +237,7 @@ qeth_dev_prioqing_show(struct device *dev, char *buf)
237} 237}
238 238
239static ssize_t 239static ssize_t
240qeth_dev_prioqing_store(struct device *dev, const char *buf, size_t count) 240qeth_dev_prioqing_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
241{ 241{
242 struct qeth_card *card = dev->driver_data; 242 struct qeth_card *card = dev->driver_data;
243 char *tmp; 243 char *tmp;
@@ -290,7 +290,7 @@ static DEVICE_ATTR(priority_queueing, 0644, qeth_dev_prioqing_show,
290 qeth_dev_prioqing_store); 290 qeth_dev_prioqing_store);
291 291
292static ssize_t 292static ssize_t
293qeth_dev_bufcnt_show(struct device *dev, char *buf) 293qeth_dev_bufcnt_show(struct device *dev, struct device_attribute *attr, char *buf)
294{ 294{
295 struct qeth_card *card = dev->driver_data; 295 struct qeth_card *card = dev->driver_data;
296 296
@@ -301,7 +301,7 @@ qeth_dev_bufcnt_show(struct device *dev, char *buf)
301} 301}
302 302
303static ssize_t 303static ssize_t
304qeth_dev_bufcnt_store(struct device *dev, const char *buf, size_t count) 304qeth_dev_bufcnt_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
305{ 305{
306 struct qeth_card *card = dev->driver_data; 306 struct qeth_card *card = dev->driver_data;
307 char *tmp; 307 char *tmp;
@@ -360,7 +360,7 @@ qeth_dev_route_show(struct qeth_card *card, struct qeth_routing_info *route,
360} 360}
361 361
362static ssize_t 362static ssize_t
363qeth_dev_route4_show(struct device *dev, char *buf) 363qeth_dev_route4_show(struct device *dev, struct device_attribute *attr, char *buf)
364{ 364{
365 struct qeth_card *card = dev->driver_data; 365 struct qeth_card *card = dev->driver_data;
366 366
@@ -410,7 +410,7 @@ qeth_dev_route_store(struct qeth_card *card, struct qeth_routing_info *route,
410} 410}
411 411
412static ssize_t 412static ssize_t
413qeth_dev_route4_store(struct device *dev, const char *buf, size_t count) 413qeth_dev_route4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
414{ 414{
415 struct qeth_card *card = dev->driver_data; 415 struct qeth_card *card = dev->driver_data;
416 416
@@ -425,7 +425,7 @@ static DEVICE_ATTR(route4, 0644, qeth_dev_route4_show, qeth_dev_route4_store);
425 425
426#ifdef CONFIG_QETH_IPV6 426#ifdef CONFIG_QETH_IPV6
427static ssize_t 427static ssize_t
428qeth_dev_route6_show(struct device *dev, char *buf) 428qeth_dev_route6_show(struct device *dev, struct device_attribute *attr, char *buf)
429{ 429{
430 struct qeth_card *card = dev->driver_data; 430 struct qeth_card *card = dev->driver_data;
431 431
@@ -439,7 +439,7 @@ qeth_dev_route6_show(struct device *dev, char *buf)
439} 439}
440 440
441static ssize_t 441static ssize_t
442qeth_dev_route6_store(struct device *dev, const char *buf, size_t count) 442qeth_dev_route6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
443{ 443{
444 struct qeth_card *card = dev->driver_data; 444 struct qeth_card *card = dev->driver_data;
445 445
@@ -461,7 +461,7 @@ static DEVICE_ATTR(route6, 0644, qeth_dev_route6_show, qeth_dev_route6_store);
461#endif 461#endif
462 462
463static ssize_t 463static ssize_t
464qeth_dev_add_hhlen_show(struct device *dev, char *buf) 464qeth_dev_add_hhlen_show(struct device *dev, struct device_attribute *attr, char *buf)
465{ 465{
466 struct qeth_card *card = dev->driver_data; 466 struct qeth_card *card = dev->driver_data;
467 467
@@ -472,7 +472,7 @@ qeth_dev_add_hhlen_show(struct device *dev, char *buf)
472} 472}
473 473
474static ssize_t 474static ssize_t
475qeth_dev_add_hhlen_store(struct device *dev, const char *buf, size_t count) 475qeth_dev_add_hhlen_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
476{ 476{
477 struct qeth_card *card = dev->driver_data; 477 struct qeth_card *card = dev->driver_data;
478 char *tmp; 478 char *tmp;
@@ -499,7 +499,7 @@ static DEVICE_ATTR(add_hhlen, 0644, qeth_dev_add_hhlen_show,
499 qeth_dev_add_hhlen_store); 499 qeth_dev_add_hhlen_store);
500 500
501static ssize_t 501static ssize_t
502qeth_dev_fake_ll_show(struct device *dev, char *buf) 502qeth_dev_fake_ll_show(struct device *dev, struct device_attribute *attr, char *buf)
503{ 503{
504 struct qeth_card *card = dev->driver_data; 504 struct qeth_card *card = dev->driver_data;
505 505
@@ -510,7 +510,7 @@ qeth_dev_fake_ll_show(struct device *dev, char *buf)
510} 510}
511 511
512static ssize_t 512static ssize_t
513qeth_dev_fake_ll_store(struct device *dev, const char *buf, size_t count) 513qeth_dev_fake_ll_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
514{ 514{
515 struct qeth_card *card = dev->driver_data; 515 struct qeth_card *card = dev->driver_data;
516 char *tmp; 516 char *tmp;
@@ -536,7 +536,7 @@ static DEVICE_ATTR(fake_ll, 0644, qeth_dev_fake_ll_show,
536 qeth_dev_fake_ll_store); 536 qeth_dev_fake_ll_store);
537 537
538static ssize_t 538static ssize_t
539qeth_dev_fake_broadcast_show(struct device *dev, char *buf) 539qeth_dev_fake_broadcast_show(struct device *dev, struct device_attribute *attr, char *buf)
540{ 540{
541 struct qeth_card *card = dev->driver_data; 541 struct qeth_card *card = dev->driver_data;
542 542
@@ -547,7 +547,7 @@ qeth_dev_fake_broadcast_show(struct device *dev, char *buf)
547} 547}
548 548
549static ssize_t 549static ssize_t
550qeth_dev_fake_broadcast_store(struct device *dev, const char *buf, size_t count) 550qeth_dev_fake_broadcast_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
551{ 551{
552 struct qeth_card *card = dev->driver_data; 552 struct qeth_card *card = dev->driver_data;
553 char *tmp; 553 char *tmp;
@@ -574,7 +574,7 @@ static DEVICE_ATTR(fake_broadcast, 0644, qeth_dev_fake_broadcast_show,
574 qeth_dev_fake_broadcast_store); 574 qeth_dev_fake_broadcast_store);
575 575
576static ssize_t 576static ssize_t
577qeth_dev_recover_store(struct device *dev, const char *buf, size_t count) 577qeth_dev_recover_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
578{ 578{
579 struct qeth_card *card = dev->driver_data; 579 struct qeth_card *card = dev->driver_data;
580 char *tmp; 580 char *tmp;
@@ -596,7 +596,7 @@ qeth_dev_recover_store(struct device *dev, const char *buf, size_t count)
596static DEVICE_ATTR(recover, 0200, NULL, qeth_dev_recover_store); 596static DEVICE_ATTR(recover, 0200, NULL, qeth_dev_recover_store);
597 597
598static ssize_t 598static ssize_t
599qeth_dev_broadcast_mode_show(struct device *dev, char *buf) 599qeth_dev_broadcast_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
600{ 600{
601 struct qeth_card *card = dev->driver_data; 601 struct qeth_card *card = dev->driver_data;
602 602
@@ -613,7 +613,7 @@ qeth_dev_broadcast_mode_show(struct device *dev, char *buf)
613} 613}
614 614
615static ssize_t 615static ssize_t
616qeth_dev_broadcast_mode_store(struct device *dev, const char *buf, size_t count) 616qeth_dev_broadcast_mode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
617{ 617{
618 struct qeth_card *card = dev->driver_data; 618 struct qeth_card *card = dev->driver_data;
619 char *tmp; 619 char *tmp;
@@ -651,7 +651,7 @@ static DEVICE_ATTR(broadcast_mode, 0644, qeth_dev_broadcast_mode_show,
651 qeth_dev_broadcast_mode_store); 651 qeth_dev_broadcast_mode_store);
652 652
653static ssize_t 653static ssize_t
654qeth_dev_canonical_macaddr_show(struct device *dev, char *buf) 654qeth_dev_canonical_macaddr_show(struct device *dev, struct device_attribute *attr, char *buf)
655{ 655{
656 struct qeth_card *card = dev->driver_data; 656 struct qeth_card *card = dev->driver_data;
657 657
@@ -667,7 +667,7 @@ qeth_dev_canonical_macaddr_show(struct device *dev, char *buf)
667} 667}
668 668
669static ssize_t 669static ssize_t
670qeth_dev_canonical_macaddr_store(struct device *dev, const char *buf, 670qeth_dev_canonical_macaddr_store(struct device *dev, struct device_attribute *attr, const char *buf,
671 size_t count) 671 size_t count)
672{ 672{
673 struct qeth_card *card = dev->driver_data; 673 struct qeth_card *card = dev->driver_data;
@@ -703,7 +703,7 @@ static DEVICE_ATTR(canonical_macaddr, 0644, qeth_dev_canonical_macaddr_show,
703 qeth_dev_canonical_macaddr_store); 703 qeth_dev_canonical_macaddr_store);
704 704
705static ssize_t 705static ssize_t
706qeth_dev_layer2_show(struct device *dev, char *buf) 706qeth_dev_layer2_show(struct device *dev, struct device_attribute *attr, char *buf)
707{ 707{
708 struct qeth_card *card = dev->driver_data; 708 struct qeth_card *card = dev->driver_data;
709 709
@@ -714,7 +714,7 @@ qeth_dev_layer2_show(struct device *dev, char *buf)
714} 714}
715 715
716static ssize_t 716static ssize_t
717qeth_dev_layer2_store(struct device *dev, const char *buf, size_t count) 717qeth_dev_layer2_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
718{ 718{
719 struct qeth_card *card = dev->driver_data; 719 struct qeth_card *card = dev->driver_data;
720 char *tmp; 720 char *tmp;
@@ -742,7 +742,7 @@ static DEVICE_ATTR(layer2, 0644, qeth_dev_layer2_show,
742 qeth_dev_layer2_store); 742 qeth_dev_layer2_store);
743 743
744static ssize_t 744static ssize_t
745qeth_dev_large_send_show(struct device *dev, char *buf) 745qeth_dev_large_send_show(struct device *dev, struct device_attribute *attr, char *buf)
746{ 746{
747 struct qeth_card *card = dev->driver_data; 747 struct qeth_card *card = dev->driver_data;
748 748
@@ -762,7 +762,7 @@ qeth_dev_large_send_show(struct device *dev, char *buf)
762} 762}
763 763
764static ssize_t 764static ssize_t
765qeth_dev_large_send_store(struct device *dev, const char *buf, size_t count) 765qeth_dev_large_send_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
766{ 766{
767 struct qeth_card *card = dev->driver_data; 767 struct qeth_card *card = dev->driver_data;
768 enum qeth_large_send_types type; 768 enum qeth_large_send_types type;
@@ -832,7 +832,7 @@ qeth_dev_blkt_store(struct qeth_card *card, const char *buf, size_t count,
832} 832}
833 833
834static ssize_t 834static ssize_t
835qeth_dev_blkt_total_show(struct device *dev, char *buf) 835qeth_dev_blkt_total_show(struct device *dev, struct device_attribute *attr, char *buf)
836{ 836{
837 struct qeth_card *card = dev->driver_data; 837 struct qeth_card *card = dev->driver_data;
838 838
@@ -841,7 +841,7 @@ qeth_dev_blkt_total_show(struct device *dev, char *buf)
841 841
842 842
843static ssize_t 843static ssize_t
844qeth_dev_blkt_total_store(struct device *dev, const char *buf, size_t count) 844qeth_dev_blkt_total_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
845{ 845{
846 struct qeth_card *card = dev->driver_data; 846 struct qeth_card *card = dev->driver_data;
847 847
@@ -855,7 +855,7 @@ static DEVICE_ATTR(total, 0644, qeth_dev_blkt_total_show,
855 qeth_dev_blkt_total_store); 855 qeth_dev_blkt_total_store);
856 856
857static ssize_t 857static ssize_t
858qeth_dev_blkt_inter_show(struct device *dev, char *buf) 858qeth_dev_blkt_inter_show(struct device *dev, struct device_attribute *attr, char *buf)
859{ 859{
860 struct qeth_card *card = dev->driver_data; 860 struct qeth_card *card = dev->driver_data;
861 861
@@ -864,7 +864,7 @@ qeth_dev_blkt_inter_show(struct device *dev, char *buf)
864 864
865 865
866static ssize_t 866static ssize_t
867qeth_dev_blkt_inter_store(struct device *dev, const char *buf, size_t count) 867qeth_dev_blkt_inter_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
868{ 868{
869 struct qeth_card *card = dev->driver_data; 869 struct qeth_card *card = dev->driver_data;
870 870
@@ -876,7 +876,7 @@ static DEVICE_ATTR(inter, 0644, qeth_dev_blkt_inter_show,
876 qeth_dev_blkt_inter_store); 876 qeth_dev_blkt_inter_store);
877 877
878static ssize_t 878static ssize_t
879qeth_dev_blkt_inter_jumbo_show(struct device *dev, char *buf) 879qeth_dev_blkt_inter_jumbo_show(struct device *dev, struct device_attribute *attr, char *buf)
880{ 880{
881 struct qeth_card *card = dev->driver_data; 881 struct qeth_card *card = dev->driver_data;
882 882
@@ -886,7 +886,7 @@ qeth_dev_blkt_inter_jumbo_show(struct device *dev, char *buf)
886 886
887 887
888static ssize_t 888static ssize_t
889qeth_dev_blkt_inter_jumbo_store(struct device *dev, const char *buf, size_t count) 889qeth_dev_blkt_inter_jumbo_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
890{ 890{
891 struct qeth_card *card = dev->driver_data; 891 struct qeth_card *card = dev->driver_data;
892 892
@@ -956,7 +956,7 @@ qeth_check_layer2(struct qeth_card *card)
956 956
957 957
958static ssize_t 958static ssize_t
959qeth_dev_ipato_enable_show(struct device *dev, char *buf) 959qeth_dev_ipato_enable_show(struct device *dev, struct device_attribute *attr, char *buf)
960{ 960{
961 struct qeth_card *card = dev->driver_data; 961 struct qeth_card *card = dev->driver_data;
962 962
@@ -969,7 +969,7 @@ qeth_dev_ipato_enable_show(struct device *dev, char *buf)
969} 969}
970 970
971static ssize_t 971static ssize_t
972qeth_dev_ipato_enable_store(struct device *dev, const char *buf, size_t count) 972qeth_dev_ipato_enable_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
973{ 973{
974 struct qeth_card *card = dev->driver_data; 974 struct qeth_card *card = dev->driver_data;
975 char *tmp; 975 char *tmp;
@@ -1004,7 +1004,7 @@ static QETH_DEVICE_ATTR(ipato_enable, enable, 0644,
1004 qeth_dev_ipato_enable_store); 1004 qeth_dev_ipato_enable_store);
1005 1005
1006static ssize_t 1006static ssize_t
1007qeth_dev_ipato_invert4_show(struct device *dev, char *buf) 1007qeth_dev_ipato_invert4_show(struct device *dev, struct device_attribute *attr, char *buf)
1008{ 1008{
1009 struct qeth_card *card = dev->driver_data; 1009 struct qeth_card *card = dev->driver_data;
1010 1010
@@ -1018,7 +1018,7 @@ qeth_dev_ipato_invert4_show(struct device *dev, char *buf)
1018} 1018}
1019 1019
1020static ssize_t 1020static ssize_t
1021qeth_dev_ipato_invert4_store(struct device *dev, const char *buf, size_t count) 1021qeth_dev_ipato_invert4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1022{ 1022{
1023 struct qeth_card *card = dev->driver_data; 1023 struct qeth_card *card = dev->driver_data;
1024 char *tmp; 1024 char *tmp;
@@ -1084,7 +1084,7 @@ qeth_dev_ipato_add_show(char *buf, struct qeth_card *card,
1084} 1084}
1085 1085
1086static ssize_t 1086static ssize_t
1087qeth_dev_ipato_add4_show(struct device *dev, char *buf) 1087qeth_dev_ipato_add4_show(struct device *dev, struct device_attribute *attr, char *buf)
1088{ 1088{
1089 struct qeth_card *card = dev->driver_data; 1089 struct qeth_card *card = dev->driver_data;
1090 1090
@@ -1153,7 +1153,7 @@ qeth_dev_ipato_add_store(const char *buf, size_t count,
1153} 1153}
1154 1154
1155static ssize_t 1155static ssize_t
1156qeth_dev_ipato_add4_store(struct device *dev, const char *buf, size_t count) 1156qeth_dev_ipato_add4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1157{ 1157{
1158 struct qeth_card *card = dev->driver_data; 1158 struct qeth_card *card = dev->driver_data;
1159 1159
@@ -1186,7 +1186,7 @@ qeth_dev_ipato_del_store(const char *buf, size_t count,
1186} 1186}
1187 1187
1188static ssize_t 1188static ssize_t
1189qeth_dev_ipato_del4_store(struct device *dev, const char *buf, size_t count) 1189qeth_dev_ipato_del4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1190{ 1190{
1191 struct qeth_card *card = dev->driver_data; 1191 struct qeth_card *card = dev->driver_data;
1192 1192
@@ -1201,7 +1201,7 @@ static QETH_DEVICE_ATTR(ipato_del4, del4, 0200, NULL,
1201 1201
1202#ifdef CONFIG_QETH_IPV6 1202#ifdef CONFIG_QETH_IPV6
1203static ssize_t 1203static ssize_t
1204qeth_dev_ipato_invert6_show(struct device *dev, char *buf) 1204qeth_dev_ipato_invert6_show(struct device *dev, struct device_attribute *attr, char *buf)
1205{ 1205{
1206 struct qeth_card *card = dev->driver_data; 1206 struct qeth_card *card = dev->driver_data;
1207 1207
@@ -1215,7 +1215,7 @@ qeth_dev_ipato_invert6_show(struct device *dev, char *buf)
1215} 1215}
1216 1216
1217static ssize_t 1217static ssize_t
1218qeth_dev_ipato_invert6_store(struct device *dev, const char *buf, size_t count) 1218qeth_dev_ipato_invert6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1219{ 1219{
1220 struct qeth_card *card = dev->driver_data; 1220 struct qeth_card *card = dev->driver_data;
1221 char *tmp; 1221 char *tmp;
@@ -1247,7 +1247,7 @@ static QETH_DEVICE_ATTR(ipato_invert6, invert6, 0644,
1247 1247
1248 1248
1249static ssize_t 1249static ssize_t
1250qeth_dev_ipato_add6_show(struct device *dev, char *buf) 1250qeth_dev_ipato_add6_show(struct device *dev, struct device_attribute *attr, char *buf)
1251{ 1251{
1252 struct qeth_card *card = dev->driver_data; 1252 struct qeth_card *card = dev->driver_data;
1253 1253
@@ -1258,7 +1258,7 @@ qeth_dev_ipato_add6_show(struct device *dev, char *buf)
1258} 1258}
1259 1259
1260static ssize_t 1260static ssize_t
1261qeth_dev_ipato_add6_store(struct device *dev, const char *buf, size_t count) 1261qeth_dev_ipato_add6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1262{ 1262{
1263 struct qeth_card *card = dev->driver_data; 1263 struct qeth_card *card = dev->driver_data;
1264 1264
@@ -1273,7 +1273,7 @@ static QETH_DEVICE_ATTR(ipato_add6, add6, 0644,
1273 qeth_dev_ipato_add6_store); 1273 qeth_dev_ipato_add6_store);
1274 1274
1275static ssize_t 1275static ssize_t
1276qeth_dev_ipato_del6_store(struct device *dev, const char *buf, size_t count) 1276qeth_dev_ipato_del6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1277{ 1277{
1278 struct qeth_card *card = dev->driver_data; 1278 struct qeth_card *card = dev->driver_data;
1279 1279
@@ -1341,7 +1341,7 @@ qeth_dev_vipa_add_show(char *buf, struct qeth_card *card,
1341} 1341}
1342 1342
1343static ssize_t 1343static ssize_t
1344qeth_dev_vipa_add4_show(struct device *dev, char *buf) 1344qeth_dev_vipa_add4_show(struct device *dev, struct device_attribute *attr, char *buf)
1345{ 1345{
1346 struct qeth_card *card = dev->driver_data; 1346 struct qeth_card *card = dev->driver_data;
1347 1347
@@ -1381,7 +1381,7 @@ qeth_dev_vipa_add_store(const char *buf, size_t count,
1381} 1381}
1382 1382
1383static ssize_t 1383static ssize_t
1384qeth_dev_vipa_add4_store(struct device *dev, const char *buf, size_t count) 1384qeth_dev_vipa_add4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1385{ 1385{
1386 struct qeth_card *card = dev->driver_data; 1386 struct qeth_card *card = dev->driver_data;
1387 1387
@@ -1413,7 +1413,7 @@ qeth_dev_vipa_del_store(const char *buf, size_t count,
1413} 1413}
1414 1414
1415static ssize_t 1415static ssize_t
1416qeth_dev_vipa_del4_store(struct device *dev, const char *buf, size_t count) 1416qeth_dev_vipa_del4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1417{ 1417{
1418 struct qeth_card *card = dev->driver_data; 1418 struct qeth_card *card = dev->driver_data;
1419 1419
@@ -1428,7 +1428,7 @@ static QETH_DEVICE_ATTR(vipa_del4, del4, 0200, NULL,
1428 1428
1429#ifdef CONFIG_QETH_IPV6 1429#ifdef CONFIG_QETH_IPV6
1430static ssize_t 1430static ssize_t
1431qeth_dev_vipa_add6_show(struct device *dev, char *buf) 1431qeth_dev_vipa_add6_show(struct device *dev, struct device_attribute *attr, char *buf)
1432{ 1432{
1433 struct qeth_card *card = dev->driver_data; 1433 struct qeth_card *card = dev->driver_data;
1434 1434
@@ -1439,7 +1439,7 @@ qeth_dev_vipa_add6_show(struct device *dev, char *buf)
1439} 1439}
1440 1440
1441static ssize_t 1441static ssize_t
1442qeth_dev_vipa_add6_store(struct device *dev, const char *buf, size_t count) 1442qeth_dev_vipa_add6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1443{ 1443{
1444 struct qeth_card *card = dev->driver_data; 1444 struct qeth_card *card = dev->driver_data;
1445 1445
@@ -1454,7 +1454,7 @@ static QETH_DEVICE_ATTR(vipa_add6, add6, 0644,
1454 qeth_dev_vipa_add6_store); 1454 qeth_dev_vipa_add6_store);
1455 1455
1456static ssize_t 1456static ssize_t
1457qeth_dev_vipa_del6_store(struct device *dev, const char *buf, size_t count) 1457qeth_dev_vipa_del6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1458{ 1458{
1459 struct qeth_card *card = dev->driver_data; 1459 struct qeth_card *card = dev->driver_data;
1460 1460
@@ -1522,7 +1522,7 @@ qeth_dev_rxip_add_show(char *buf, struct qeth_card *card,
1522} 1522}
1523 1523
1524static ssize_t 1524static ssize_t
1525qeth_dev_rxip_add4_show(struct device *dev, char *buf) 1525qeth_dev_rxip_add4_show(struct device *dev, struct device_attribute *attr, char *buf)
1526{ 1526{
1527 struct qeth_card *card = dev->driver_data; 1527 struct qeth_card *card = dev->driver_data;
1528 1528
@@ -1562,7 +1562,7 @@ qeth_dev_rxip_add_store(const char *buf, size_t count,
1562} 1562}
1563 1563
1564static ssize_t 1564static ssize_t
1565qeth_dev_rxip_add4_store(struct device *dev, const char *buf, size_t count) 1565qeth_dev_rxip_add4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1566{ 1566{
1567 struct qeth_card *card = dev->driver_data; 1567 struct qeth_card *card = dev->driver_data;
1568 1568
@@ -1594,7 +1594,7 @@ qeth_dev_rxip_del_store(const char *buf, size_t count,
1594} 1594}
1595 1595
1596static ssize_t 1596static ssize_t
1597qeth_dev_rxip_del4_store(struct device *dev, const char *buf, size_t count) 1597qeth_dev_rxip_del4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1598{ 1598{
1599 struct qeth_card *card = dev->driver_data; 1599 struct qeth_card *card = dev->driver_data;
1600 1600
@@ -1609,7 +1609,7 @@ static QETH_DEVICE_ATTR(rxip_del4, del4, 0200, NULL,
1609 1609
1610#ifdef CONFIG_QETH_IPV6 1610#ifdef CONFIG_QETH_IPV6
1611static ssize_t 1611static ssize_t
1612qeth_dev_rxip_add6_show(struct device *dev, char *buf) 1612qeth_dev_rxip_add6_show(struct device *dev, struct device_attribute *attr, char *buf)
1613{ 1613{
1614 struct qeth_card *card = dev->driver_data; 1614 struct qeth_card *card = dev->driver_data;
1615 1615
@@ -1620,7 +1620,7 @@ qeth_dev_rxip_add6_show(struct device *dev, char *buf)
1620} 1620}
1621 1621
1622static ssize_t 1622static ssize_t
1623qeth_dev_rxip_add6_store(struct device *dev, const char *buf, size_t count) 1623qeth_dev_rxip_add6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1624{ 1624{
1625 struct qeth_card *card = dev->driver_data; 1625 struct qeth_card *card = dev->driver_data;
1626 1626
@@ -1635,7 +1635,7 @@ static QETH_DEVICE_ATTR(rxip_add6, add6, 0644,
1635 qeth_dev_rxip_add6_store); 1635 qeth_dev_rxip_add6_store);
1636 1636
1637static ssize_t 1637static ssize_t
1638qeth_dev_rxip_del6_store(struct device *dev, const char *buf, size_t count) 1638qeth_dev_rxip_del6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1639{ 1639{
1640 struct qeth_card *card = dev->driver_data; 1640 struct qeth_card *card = dev->driver_data;
1641 1641
diff --git a/drivers/s390/net/qeth_tso.c b/drivers/s390/net/qeth_tso.c
deleted file mode 100644
index c91976274e7b..000000000000
--- a/drivers/s390/net/qeth_tso.c
+++ /dev/null
@@ -1,285 +0,0 @@
1/*
2 * linux/drivers/s390/net/qeth_tso.c ($Revision: 1.6 $)
3 *
4 * Header file for qeth TCP Segmentation Offload support.
5 *
6 * Copyright 2004 IBM Corporation
7 *
8 * Author(s): Frank Pavlic <pavlic@de.ibm.com>
9 *
10 * $Revision: 1.6 $ $Date: 2005/03/24 09:04:18 $
11 *
12 */
13
14#include <linux/skbuff.h>
15#include <linux/tcp.h>
16#include <linux/ip.h>
17#include <linux/ipv6.h>
18#include <net/ip6_checksum.h>
19#include "qeth.h"
20#include "qeth_mpc.h"
21#include "qeth_tso.h"
22
23/**
24 * skb already partially prepared
25 * classic qdio header in skb->data
26 * */
27static inline struct qeth_hdr_tso *
28qeth_tso_prepare_skb(struct qeth_card *card, struct sk_buff **skb)
29{
30 int rc = 0;
31
32 QETH_DBF_TEXT(trace, 5, "tsoprsk");
33 rc = qeth_realloc_headroom(card, skb,sizeof(struct qeth_hdr_ext_tso));
34 if (rc)
35 return NULL;
36
37 return qeth_push_skb(card, skb, sizeof(struct qeth_hdr_ext_tso));
38}
39
40/**
41 * fill header for a TSO packet
42 */
43static inline void
44qeth_tso_fill_header(struct qeth_card *card, struct sk_buff *skb)
45{
46 struct qeth_hdr_tso *hdr;
47 struct tcphdr *tcph;
48 struct iphdr *iph;
49
50 QETH_DBF_TEXT(trace, 5, "tsofhdr");
51
52 hdr = (struct qeth_hdr_tso *) skb->data;
53 iph = skb->nh.iph;
54 tcph = skb->h.th;
55 /*fix header to TSO values ...*/
56 hdr->hdr.hdr.l3.id = QETH_HEADER_TYPE_TSO;
57 /*set values which are fix for the first approach ...*/
58 hdr->ext.hdr_tot_len = (__u16) sizeof(struct qeth_hdr_ext_tso);
59 hdr->ext.imb_hdr_no = 1;
60 hdr->ext.hdr_type = 1;
61 hdr->ext.hdr_version = 1;
62 hdr->ext.hdr_len = 28;
63 /*insert non-fix values */
64 hdr->ext.mss = skb_shinfo(skb)->tso_size;
65 hdr->ext.dg_hdr_len = (__u16)(iph->ihl*4 + tcph->doff*4);
66 hdr->ext.payload_len = (__u16)(skb->len - hdr->ext.dg_hdr_len -
67 sizeof(struct qeth_hdr_tso));
68}
69
70/**
71 * change some header values as requested by hardware
72 */
73static inline void
74qeth_tso_set_tcpip_header(struct qeth_card *card, struct sk_buff *skb)
75{
76 struct iphdr *iph;
77 struct ipv6hdr *ip6h;
78 struct tcphdr *tcph;
79
80 iph = skb->nh.iph;
81 ip6h = skb->nh.ipv6h;
82 tcph = skb->h.th;
83
84 tcph->check = 0;
85 if (skb->protocol == ETH_P_IPV6) {
86 ip6h->payload_len = 0;
87 tcph->check = ~csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr,
88 0, IPPROTO_TCP, 0);
89 return;
90 }
91 /*OSA want us to set these values ...*/
92 tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr,
93 0, IPPROTO_TCP, 0);
94 iph->tot_len = 0;
95 iph->check = 0;
96}
97
98static inline struct qeth_hdr_tso *
99qeth_tso_prepare_packet(struct qeth_card *card, struct sk_buff *skb,
100 int ipv, int cast_type)
101{
102 struct qeth_hdr_tso *hdr;
103 int rc = 0;
104
105 QETH_DBF_TEXT(trace, 5, "tsoprep");
106
107 /*get headroom for tso qdio header */
108 hdr = (struct qeth_hdr_tso *) qeth_tso_prepare_skb(card, &skb);
109 if (hdr == NULL) {
110 QETH_DBF_TEXT_(trace, 4, "2err%d", rc);
111 return NULL;
112 }
113 memset(hdr, 0, sizeof(struct qeth_hdr_tso));
114 /*fill first 32 bytes of qdio header as used
115 *FIXME: TSO has two struct members
116 * with different names but same size
117 * */
118 qeth_fill_header(card, &hdr->hdr, skb, ipv, cast_type);
119 qeth_tso_fill_header(card, skb);
120 qeth_tso_set_tcpip_header(card, skb);
121 return hdr;
122}
123
124static inline int
125qeth_tso_get_queue_buffer(struct qeth_qdio_out_q *queue)
126{
127 struct qeth_qdio_out_buffer *buffer;
128 int flush_cnt = 0;
129
130 QETH_DBF_TEXT(trace, 5, "tsobuf");
131
132 /* force to non-packing*/
133 if (queue->do_pack)
134 queue->do_pack = 0;
135 buffer = &queue->bufs[queue->next_buf_to_fill];
136 /* get a new buffer if current is already in use*/
137 if ((atomic_read(&buffer->state) == QETH_QDIO_BUF_EMPTY) &&
138 (buffer->next_element_to_fill > 0)) {
139 atomic_set(&buffer->state, QETH_QDIO_BUF_PRIMED);
140 queue->next_buf_to_fill = (queue->next_buf_to_fill + 1) %
141 QDIO_MAX_BUFFERS_PER_Q;
142 flush_cnt++;
143 }
144 return flush_cnt;
145}
146
147static inline void
148__qeth_tso_fill_buffer_frag(struct qeth_qdio_out_buffer *buf,
149 struct sk_buff *skb)
150{
151 struct skb_frag_struct *frag;
152 struct qdio_buffer *buffer;
153 int fragno, cnt, element;
154 unsigned long addr;
155
156 QETH_DBF_TEXT(trace, 6, "tsfilfrg");
157
158 /*initialize variables ...*/
159 fragno = skb_shinfo(skb)->nr_frags;
160 buffer = buf->buffer;
161 element = buf->next_element_to_fill;
162 /*fill buffer elements .....*/
163 for (cnt = 0; cnt < fragno; cnt++) {
164 frag = &skb_shinfo(skb)->frags[cnt];
165 addr = (page_to_pfn(frag->page) << PAGE_SHIFT) +
166 frag->page_offset;
167 buffer->element[element].addr = (char *)addr;
168 buffer->element[element].length = frag->size;
169 if (cnt < (fragno - 1))
170 buffer->element[element].flags =
171 SBAL_FLAGS_MIDDLE_FRAG;
172 else
173 buffer->element[element].flags =
174 SBAL_FLAGS_LAST_FRAG;
175 element++;
176 }
177 buf->next_element_to_fill = element;
178}
179
180static inline int
181qeth_tso_fill_buffer(struct qeth_qdio_out_buffer *buf,
182 struct sk_buff *skb)
183{
184 int length, length_here, element;
185 int hdr_len;
186 struct qdio_buffer *buffer;
187 struct qeth_hdr_tso *hdr;
188 char *data;
189
190 QETH_DBF_TEXT(trace, 3, "tsfilbuf");
191
192 /*increment user count and queue skb ...*/
193 atomic_inc(&skb->users);
194 skb_queue_tail(&buf->skb_list, skb);
195
196 /*initialize all variables...*/
197 buffer = buf->buffer;
198 hdr = (struct qeth_hdr_tso *)skb->data;
199 hdr_len = sizeof(struct qeth_hdr_tso) + hdr->ext.dg_hdr_len;
200 data = skb->data + hdr_len;
201 length = skb->len - hdr_len;
202 element = buf->next_element_to_fill;
203 /*fill first buffer entry only with header information */
204 buffer->element[element].addr = skb->data;
205 buffer->element[element].length = hdr_len;
206 buffer->element[element].flags = SBAL_FLAGS_FIRST_FRAG;
207 buf->next_element_to_fill++;
208
209 if (skb_shinfo(skb)->nr_frags > 0) {
210 __qeth_tso_fill_buffer_frag(buf, skb);
211 goto out;
212 }
213
214 /*start filling buffer entries ...*/
215 element++;
216 while (length > 0) {
217 /* length_here is the remaining amount of data in this page */
218 length_here = PAGE_SIZE - ((unsigned long) data % PAGE_SIZE);
219 if (length < length_here)
220 length_here = length;
221 buffer->element[element].addr = data;
222 buffer->element[element].length = length_here;
223 length -= length_here;
224 if (!length)
225 buffer->element[element].flags =
226 SBAL_FLAGS_LAST_FRAG;
227 else
228 buffer->element[element].flags =
229 SBAL_FLAGS_MIDDLE_FRAG;
230 data += length_here;
231 element++;
232 }
233 /*set the buffer to primed ...*/
234 buf->next_element_to_fill = element;
235out:
236 atomic_set(&buf->state, QETH_QDIO_BUF_PRIMED);
237 return 1;
238}
239
240int
241qeth_tso_send_packet(struct qeth_card *card, struct sk_buff *skb,
242 struct qeth_qdio_out_q *queue, int ipv, int cast_type)
243{
244 int flush_cnt = 0;
245 struct qeth_hdr_tso *hdr;
246 struct qeth_qdio_out_buffer *buffer;
247 int start_index;
248
249 QETH_DBF_TEXT(trace, 3, "tsosend");
250
251 if (!(hdr = qeth_tso_prepare_packet(card, skb, ipv, cast_type)))
252 return -ENOMEM;
253 /*check if skb fits in one SBAL ...*/
254 if (!(qeth_get_elements_no(card, (void*)hdr, skb)))
255 return -EINVAL;
256 /*lock queue, force switching to non-packing and send it ...*/
257 while (atomic_compare_and_swap(QETH_OUT_Q_UNLOCKED,
258 QETH_OUT_Q_LOCKED,
259 &queue->state));
260 start_index = queue->next_buf_to_fill;
261 buffer = &queue->bufs[queue->next_buf_to_fill];
262 /*check if card is too busy ...*/
263 if (atomic_read(&buffer->state) != QETH_QDIO_BUF_EMPTY){
264 card->stats.tx_dropped++;
265 goto out;
266 }
267 /*let's force to non-packing and get a new SBAL*/
268 flush_cnt += qeth_tso_get_queue_buffer(queue);
269 buffer = &queue->bufs[queue->next_buf_to_fill];
270 if (atomic_read(&buffer->state) != QETH_QDIO_BUF_EMPTY) {
271 card->stats.tx_dropped++;
272 goto out;
273 }
274 flush_cnt += qeth_tso_fill_buffer(buffer, skb);
275 queue->next_buf_to_fill = (queue->next_buf_to_fill + 1) %
276 QDIO_MAX_BUFFERS_PER_Q;
277out:
278 atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED);
279 if (flush_cnt)
280 qeth_flush_buffers(queue, 0, start_index, flush_cnt);
281 /*do some statistics */
282 card->stats.tx_packets++;
283 card->stats.tx_bytes += skb->len;
284 return 0;
285}
diff --git a/drivers/s390/net/qeth_tso.h b/drivers/s390/net/qeth_tso.h
index 83504dee3f57..ad33e6f466f1 100644
--- a/drivers/s390/net/qeth_tso.h
+++ b/drivers/s390/net/qeth_tso.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.4 $) 2 * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.7 $)
3 * 3 *
4 * Header file for qeth TCP Segmentation Offload support. 4 * Header file for qeth TCP Segmentation Offload support.
5 * 5 *
@@ -7,52 +7,148 @@
7 * 7 *
8 * Author(s): Frank Pavlic <pavlic@de.ibm.com> 8 * Author(s): Frank Pavlic <pavlic@de.ibm.com>
9 * 9 *
10 * $Revision: 1.4 $ $Date: 2005/03/24 09:04:18 $ 10 * $Revision: 1.7 $ $Date: 2005/05/04 20:19:18 $
11 * 11 *
12 */ 12 */
13#ifndef __QETH_TSO_H__ 13#ifndef __QETH_TSO_H__
14#define __QETH_TSO_H__ 14#define __QETH_TSO_H__
15 15
16#include <linux/skbuff.h>
17#include <linux/tcp.h>
18#include <linux/ip.h>
19#include <linux/ipv6.h>
20#include <net/ip6_checksum.h>
21#include "qeth.h"
22#include "qeth_mpc.h"
16 23
17extern int
18qeth_tso_send_packet(struct qeth_card *, struct sk_buff *,
19 struct qeth_qdio_out_q *, int , int);
20 24
21struct qeth_hdr_ext_tso { 25static inline struct qeth_hdr_tso *
22 __u16 hdr_tot_len; 26qeth_tso_prepare_skb(struct qeth_card *card, struct sk_buff **skb)
23 __u8 imb_hdr_no; 27{
24 __u8 reserved; 28 QETH_DBF_TEXT(trace, 5, "tsoprsk");
25 __u8 hdr_type; 29 return qeth_push_skb(card, skb, sizeof(struct qeth_hdr_tso));
26 __u8 hdr_version; 30}
27 __u16 hdr_len; 31
28 __u32 payload_len; 32/**
29 __u16 mss; 33 * fill header for a TSO packet
30 __u16 dg_hdr_len; 34 */
31 __u8 padding[16]; 35static inline void
32} __attribute__ ((packed)); 36qeth_tso_fill_header(struct qeth_card *card, struct sk_buff *skb)
37{
38 struct qeth_hdr_tso *hdr;
39 struct tcphdr *tcph;
40 struct iphdr *iph;
41
42 QETH_DBF_TEXT(trace, 5, "tsofhdr");
43
44 hdr = (struct qeth_hdr_tso *) skb->data;
45 iph = skb->nh.iph;
46 tcph = skb->h.th;
47 /*fix header to TSO values ...*/
48 hdr->hdr.hdr.l3.id = QETH_HEADER_TYPE_TSO;
49 /*set values which are fix for the first approach ...*/
50 hdr->ext.hdr_tot_len = (__u16) sizeof(struct qeth_hdr_ext_tso);
51 hdr->ext.imb_hdr_no = 1;
52 hdr->ext.hdr_type = 1;
53 hdr->ext.hdr_version = 1;
54 hdr->ext.hdr_len = 28;
55 /*insert non-fix values */
56 hdr->ext.mss = skb_shinfo(skb)->tso_size;
57 hdr->ext.dg_hdr_len = (__u16)(iph->ihl*4 + tcph->doff*4);
58 hdr->ext.payload_len = (__u16)(skb->len - hdr->ext.dg_hdr_len -
59 sizeof(struct qeth_hdr_tso));
60}
61
62/**
63 * change some header values as requested by hardware
64 */
65static inline void
66qeth_tso_set_tcpip_header(struct qeth_card *card, struct sk_buff *skb)
67{
68 struct iphdr *iph;
69 struct ipv6hdr *ip6h;
70 struct tcphdr *tcph;
33 71
34struct qeth_hdr_tso { 72 iph = skb->nh.iph;
35 struct qeth_hdr hdr; /*hdr->hdr.l3.xxx*/ 73 ip6h = skb->nh.ipv6h;
36 struct qeth_hdr_ext_tso ext; 74 tcph = skb->h.th;
37} __attribute__ ((packed));
38 75
39/*some helper functions*/ 76 tcph->check = 0;
77 if (skb->protocol == ETH_P_IPV6) {
78 ip6h->payload_len = 0;
79 tcph->check = ~csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr,
80 0, IPPROTO_TCP, 0);
81 return;
82 }
83 /*OSA want us to set these values ...*/
84 tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr,
85 0, IPPROTO_TCP, 0);
86 iph->tot_len = 0;
87 iph->check = 0;
88}
40 89
41static inline int 90static inline int
42qeth_get_elements_no(struct qeth_card *card, void *hdr, struct sk_buff *skb) 91qeth_tso_prepare_packet(struct qeth_card *card, struct sk_buff *skb,
92 int ipv, int cast_type)
93{
94 struct qeth_hdr_tso *hdr;
95
96 QETH_DBF_TEXT(trace, 5, "tsoprep");
97
98 hdr = (struct qeth_hdr_tso *) qeth_tso_prepare_skb(card, &skb);
99 if (hdr == NULL) {
100 QETH_DBF_TEXT(trace, 4, "tsoperr");
101 return -ENOMEM;
102 }
103 memset(hdr, 0, sizeof(struct qeth_hdr_tso));
104 /*fill first 32 bytes of qdio header as used
105 *FIXME: TSO has two struct members
106 * with different names but same size
107 * */
108 qeth_fill_header(card, &hdr->hdr, skb, ipv, cast_type);
109 qeth_tso_fill_header(card, skb);
110 qeth_tso_set_tcpip_header(card, skb);
111 return 0;
112}
113
114static inline void
115__qeth_fill_buffer_frag(struct sk_buff *skb, struct qdio_buffer *buffer,
116 int is_tso, int *next_element_to_fill)
43{ 117{
44 int elements_needed = 0; 118 struct skb_frag_struct *frag;
45 119 int fragno;
46 if (skb_shinfo(skb)->nr_frags > 0) 120 unsigned long addr;
47 elements_needed = (skb_shinfo(skb)->nr_frags + 1); 121 int element, cnt, dlen;
48 if (elements_needed == 0 ) 122
49 elements_needed = 1 + (((((unsigned long) hdr) % PAGE_SIZE) 123 fragno = skb_shinfo(skb)->nr_frags;
50 + skb->len) >> PAGE_SHIFT); 124 element = *next_element_to_fill;
51 if (elements_needed > QETH_MAX_BUFFER_ELEMENTS(card)){ 125 dlen = 0;
52 PRINT_ERR("qeth_do_send_packet: invalid size of " 126
53 "IP packet. Discarded."); 127 if (is_tso)
54 return 0; 128 buffer->element[element].flags =
129 SBAL_FLAGS_MIDDLE_FRAG;
130 else
131 buffer->element[element].flags =
132 SBAL_FLAGS_FIRST_FRAG;
133 if ( (dlen = (skb->len - skb->data_len)) ) {
134 buffer->element[element].addr = skb->data;
135 buffer->element[element].length = dlen;
136 element++;
137 }
138 for (cnt = 0; cnt < fragno; cnt++) {
139 frag = &skb_shinfo(skb)->frags[cnt];
140 addr = (page_to_pfn(frag->page) << PAGE_SHIFT) +
141 frag->page_offset;
142 buffer->element[element].addr = (char *)addr;
143 buffer->element[element].length = frag->size;
144 if (cnt < (fragno - 1))
145 buffer->element[element].flags =
146 SBAL_FLAGS_MIDDLE_FRAG;
147 else
148 buffer->element[element].flags =
149 SBAL_FLAGS_LAST_FRAG;
150 element++;
55 } 151 }
56 return elements_needed; 152 *next_element_to_fill = element;
57} 153}
58#endif /* __QETH_TSO_H__ */ 154#endif /* __QETH_TSO_H__ */
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 68d151aaa474..e17b4d58a9f6 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -97,11 +97,6 @@ MODULE_PARM_DESC(loglevel,
97 "FC ERP QDIO CIO Config FSF SCSI Other, " 97 "FC ERP QDIO CIO Config FSF SCSI Other, "
98 "levels: 0=none 1=normal 2=devel 3=trace"); 98 "levels: 0=none 1=normal 2=devel 3=trace");
99 99
100#ifdef ZFCP_PRINT_FLAGS
101u32 flags_dump = 0;
102module_param(flags_dump, uint, 0);
103#endif
104
105/****************************************************************/ 100/****************************************************************/
106/************** Functions without logging ***********************/ 101/************** Functions without logging ***********************/
107/****************************************************************/ 102/****************************************************************/
@@ -223,13 +218,20 @@ zfcp_in_els_dbf_event(struct zfcp_adapter *adapter, const char *text,
223 * Parse "device=..." parameter string. 218 * Parse "device=..." parameter string.
224 */ 219 */
225static int __init 220static int __init
226zfcp_device_setup(char *str) 221zfcp_device_setup(char *devstr)
227{ 222{
228 char *tmp; 223 char *tmp, *str;
224 size_t len;
229 225
230 if (!str) 226 if (!devstr)
231 return 0; 227 return 0;
232 228
229 len = strlen(devstr) + 1;
230 str = (char *) kmalloc(len, GFP_KERNEL);
231 if (!str)
232 goto err_out;
233 memcpy(str, devstr, len);
234
233 tmp = strchr(str, ','); 235 tmp = strchr(str, ',');
234 if (!tmp) 236 if (!tmp)
235 goto err_out; 237 goto err_out;
@@ -246,10 +248,12 @@ zfcp_device_setup(char *str)
246 zfcp_data.init_fcp_lun = simple_strtoull(tmp, &tmp, 0); 248 zfcp_data.init_fcp_lun = simple_strtoull(tmp, &tmp, 0);
247 if (*tmp != '\0') 249 if (*tmp != '\0')
248 goto err_out; 250 goto err_out;
251 kfree(str);
249 return 1; 252 return 1;
250 253
251 err_out: 254 err_out:
252 ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str); 255 ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str);
256 kfree(str);
253 return 0; 257 return 0;
254} 258}
255 259
@@ -525,7 +529,7 @@ zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
525 529
526 out: 530 out:
527 if (fsf_req != NULL) 531 if (fsf_req != NULL)
528 zfcp_fsf_req_cleanup(fsf_req); 532 zfcp_fsf_req_free(fsf_req);
529 533
530 if ((adapter != NULL) && (retval != -ENXIO)) 534 if ((adapter != NULL) && (retval != -ENXIO))
531 zfcp_adapter_put(adapter); 535 zfcp_adapter_put(adapter);
@@ -1154,7 +1158,7 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
1154 INIT_LIST_HEAD(&adapter->port_remove_lh); 1158 INIT_LIST_HEAD(&adapter->port_remove_lh);
1155 1159
1156 /* initialize list of fsf requests */ 1160 /* initialize list of fsf requests */
1157 rwlock_init(&adapter->fsf_req_list_lock); 1161 spin_lock_init(&adapter->fsf_req_list_lock);
1158 INIT_LIST_HEAD(&adapter->fsf_req_list_head); 1162 INIT_LIST_HEAD(&adapter->fsf_req_list_head);
1159 1163
1160 /* initialize abort lock */ 1164 /* initialize abort lock */
@@ -1239,9 +1243,9 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
1239 zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev); 1243 zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev);
1240 dev_set_drvdata(&adapter->ccw_device->dev, NULL); 1244 dev_set_drvdata(&adapter->ccw_device->dev, NULL);
1241 /* sanity check: no pending FSF requests */ 1245 /* sanity check: no pending FSF requests */
1242 read_lock_irqsave(&adapter->fsf_req_list_lock, flags); 1246 spin_lock_irqsave(&adapter->fsf_req_list_lock, flags);
1243 retval = !list_empty(&adapter->fsf_req_list_head); 1247 retval = !list_empty(&adapter->fsf_req_list_head);
1244 read_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); 1248 spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
1245 if (retval) { 1249 if (retval) {
1246 ZFCP_LOG_NORMAL("bug: adapter %s (%p) still in use, " 1250 ZFCP_LOG_NORMAL("bug: adapter %s (%p) still in use, "
1247 "%i requests outstanding\n", 1251 "%i requests outstanding\n",
@@ -1483,19 +1487,15 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter,
1483 fcp_rscn_element++; 1487 fcp_rscn_element++;
1484 switch (fcp_rscn_element->addr_format) { 1488 switch (fcp_rscn_element->addr_format) {
1485 case ZFCP_PORT_ADDRESS: 1489 case ZFCP_PORT_ADDRESS:
1486 ZFCP_LOG_FLAGS(1, "ZFCP_PORT_ADDRESS\n");
1487 range_mask = ZFCP_PORTS_RANGE_PORT; 1490 range_mask = ZFCP_PORTS_RANGE_PORT;
1488 break; 1491 break;
1489 case ZFCP_AREA_ADDRESS: 1492 case ZFCP_AREA_ADDRESS:
1490 ZFCP_LOG_FLAGS(1, "ZFCP_AREA_ADDRESS\n");
1491 range_mask = ZFCP_PORTS_RANGE_AREA; 1493 range_mask = ZFCP_PORTS_RANGE_AREA;
1492 break; 1494 break;
1493 case ZFCP_DOMAIN_ADDRESS: 1495 case ZFCP_DOMAIN_ADDRESS:
1494 ZFCP_LOG_FLAGS(1, "ZFCP_DOMAIN_ADDRESS\n");
1495 range_mask = ZFCP_PORTS_RANGE_DOMAIN; 1496 range_mask = ZFCP_PORTS_RANGE_DOMAIN;
1496 break; 1497 break;
1497 case ZFCP_FABRIC_ADDRESS: 1498 case ZFCP_FABRIC_ADDRESS:
1498 ZFCP_LOG_FLAGS(1, "ZFCP_FABRIC_ADDRESS\n");
1499 range_mask = ZFCP_PORTS_RANGE_FABRIC; 1499 range_mask = ZFCP_PORTS_RANGE_FABRIC;
1500 break; 1500 break;
1501 default: 1501 default:
@@ -1762,7 +1762,10 @@ static void zfcp_ns_gid_pn_handler(unsigned long data)
1762 ct_iu_req = zfcp_sg_to_address(ct->req); 1762 ct_iu_req = zfcp_sg_to_address(ct->req);
1763 ct_iu_resp = zfcp_sg_to_address(ct->resp); 1763 ct_iu_resp = zfcp_sg_to_address(ct->resp);
1764 1764
1765 if ((ct->status != 0) || zfcp_check_ct_response(&ct_iu_resp->header)) { 1765 if (ct->status != 0)
1766 goto failed;
1767
1768 if (zfcp_check_ct_response(&ct_iu_resp->header)) {
1766 /* FIXME: do we need some specific erp entry points */ 1769 /* FIXME: do we need some specific erp entry points */
1767 atomic_set_mask(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status); 1770 atomic_set_mask(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status);
1768 goto failed; 1771 goto failed;
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index c5daf372f853..4103b5be7683 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -62,9 +62,6 @@
62#include <linux/syscalls.h> 62#include <linux/syscalls.h>
63#include <linux/ioctl.h> 63#include <linux/ioctl.h>
64 64
65/************************ DEBUG FLAGS *****************************************/
66
67#define ZFCP_PRINT_FLAGS
68 65
69/********************* GENERAL DEFINES *********************************/ 66/********************* GENERAL DEFINES *********************************/
70 67
@@ -152,8 +149,10 @@ typedef u32 scsi_lun_t;
152#define FSF_QTCB_UNSOLICITED_STATUS 0x6305 149#define FSF_QTCB_UNSOLICITED_STATUS 0x6305
153#define ZFCP_STATUS_READ_FAILED_THRESHOLD 3 150#define ZFCP_STATUS_READ_FAILED_THRESHOLD 3
154#define ZFCP_STATUS_READS_RECOM FSF_STATUS_READS_RECOM 151#define ZFCP_STATUS_READS_RECOM FSF_STATUS_READS_RECOM
155#define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES 6 152
156#define ZFCP_EXCHANGE_CONFIG_DATA_SLEEP 50 153/* Do 1st retry in 1 second, then double the timeout for each following retry */
154#define ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP 100
155#define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES 7
157 156
158/* timeout value for "default timer" for fsf requests */ 157/* timeout value for "default timer" for fsf requests */
159#define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ); 158#define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ);
@@ -472,17 +471,6 @@ do { \
472 ZFCP_LOG(ZFCP_LOG_LEVEL_TRACE, fmt , ##args) 471 ZFCP_LOG(ZFCP_LOG_LEVEL_TRACE, fmt , ##args)
473#endif 472#endif
474 473
475#ifndef ZFCP_PRINT_FLAGS
476# define ZFCP_LOG_FLAGS(level, fmt, args...)
477#else
478extern u32 flags_dump;
479# define ZFCP_LOG_FLAGS(level, fmt, args...) \
480do { \
481 if (level <= flags_dump) \
482 _ZFCP_LOG(fmt, ##args); \
483} while (0)
484#endif
485
486/*************** ADAPTER/PORT/UNIT AND FSF_REQ STATUS FLAGS ******************/ 474/*************** ADAPTER/PORT/UNIT AND FSF_REQ STATUS FLAGS ******************/
487 475
488/* 476/*
@@ -502,6 +490,7 @@ do { \
502#define ZFCP_STATUS_COMMON_CLOSING 0x02000000 490#define ZFCP_STATUS_COMMON_CLOSING 0x02000000
503#define ZFCP_STATUS_COMMON_ERP_INUSE 0x01000000 491#define ZFCP_STATUS_COMMON_ERP_INUSE 0x01000000
504#define ZFCP_STATUS_COMMON_ACCESS_DENIED 0x00800000 492#define ZFCP_STATUS_COMMON_ACCESS_DENIED 0x00800000
493#define ZFCP_STATUS_COMMON_ACCESS_BOXED 0x00400000
505 494
506/* adapter status */ 495/* adapter status */
507#define ZFCP_STATUS_ADAPTER_QDIOUP 0x00000002 496#define ZFCP_STATUS_ADAPTER_QDIOUP 0x00000002
@@ -763,6 +752,7 @@ typedef void (*zfcp_send_els_handler_t)(unsigned long);
763/** 752/**
764 * struct zfcp_send_els - used to pass parameters to function zfcp_fsf_send_els 753 * struct zfcp_send_els - used to pass parameters to function zfcp_fsf_send_els
765 * @adapter: adapter where request is sent from 754 * @adapter: adapter where request is sent from
755 * @port: port where ELS is destinated (port reference count has to be increased)
766 * @d_id: destiniation id of port where request is sent to 756 * @d_id: destiniation id of port where request is sent to
767 * @req: scatter-gather list for request 757 * @req: scatter-gather list for request
768 * @resp: scatter-gather list for response 758 * @resp: scatter-gather list for response
@@ -777,6 +767,7 @@ typedef void (*zfcp_send_els_handler_t)(unsigned long);
777 */ 767 */
778struct zfcp_send_els { 768struct zfcp_send_els {
779 struct zfcp_adapter *adapter; 769 struct zfcp_adapter *adapter;
770 struct zfcp_port *port;
780 fc_id_t d_id; 771 fc_id_t d_id;
781 struct scatterlist *req; 772 struct scatterlist *req;
782 struct scatterlist *resp; 773 struct scatterlist *resp;
@@ -871,7 +862,7 @@ struct zfcp_adapter {
871 u32 ports; /* number of remote ports */ 862 u32 ports; /* number of remote ports */
872 struct timer_list scsi_er_timer; /* SCSI err recovery watch */ 863 struct timer_list scsi_er_timer; /* SCSI err recovery watch */
873 struct list_head fsf_req_list_head; /* head of FSF req list */ 864 struct list_head fsf_req_list_head; /* head of FSF req list */
874 rwlock_t fsf_req_list_lock; /* lock for ops on list of 865 spinlock_t fsf_req_list_lock; /* lock for ops on list of
875 FSF requests */ 866 FSF requests */
876 atomic_t fsf_reqs_active; /* # active FSF reqs */ 867 atomic_t fsf_reqs_active; /* # active FSF reqs */
877 struct zfcp_qdio_queue request_queue; /* request queue */ 868 struct zfcp_qdio_queue request_queue; /* request queue */
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 53ebc1cdfe2d..0cf31f7d1c0f 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -35,7 +35,7 @@
35 35
36#include "zfcp_ext.h" 36#include "zfcp_ext.h"
37 37
38static int zfcp_erp_adisc(struct zfcp_adapter *, fc_id_t); 38static int zfcp_erp_adisc(struct zfcp_port *);
39static void zfcp_erp_adisc_handler(unsigned long); 39static void zfcp_erp_adisc_handler(unsigned long);
40 40
41static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *, int); 41static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *, int);
@@ -295,12 +295,12 @@ zfcp_erp_unit_shutdown(struct zfcp_unit *unit, int clear_mask)
295 295
296/** 296/**
297 * zfcp_erp_adisc - send ADISC ELS command 297 * zfcp_erp_adisc - send ADISC ELS command
298 * @adapter: adapter structure 298 * @port: port structure
299 * @d_id: d_id of port where ADISC is sent to
300 */ 299 */
301int 300int
302zfcp_erp_adisc(struct zfcp_adapter *adapter, fc_id_t d_id) 301zfcp_erp_adisc(struct zfcp_port *port)
303{ 302{
303 struct zfcp_adapter *adapter = port->adapter;
304 struct zfcp_send_els *send_els; 304 struct zfcp_send_els *send_els;
305 struct zfcp_ls_adisc *adisc; 305 struct zfcp_ls_adisc *adisc;
306 void *address = NULL; 306 void *address = NULL;
@@ -332,7 +332,8 @@ zfcp_erp_adisc(struct zfcp_adapter *adapter, fc_id_t d_id)
332 send_els->req_count = send_els->resp_count = 1; 332 send_els->req_count = send_els->resp_count = 1;
333 333
334 send_els->adapter = adapter; 334 send_els->adapter = adapter;
335 send_els->d_id = d_id; 335 send_els->port = port;
336 send_els->d_id = port->d_id;
336 send_els->handler = zfcp_erp_adisc_handler; 337 send_els->handler = zfcp_erp_adisc_handler;
337 send_els->handler_data = (unsigned long) send_els; 338 send_els->handler_data = (unsigned long) send_els;
338 339
@@ -350,7 +351,7 @@ zfcp_erp_adisc(struct zfcp_adapter *adapter, fc_id_t d_id)
350 ZFCP_LOG_INFO("ADISC request from s_id 0x%08x to d_id 0x%08x " 351 ZFCP_LOG_INFO("ADISC request from s_id 0x%08x to d_id 0x%08x "
351 "(wwpn=0x%016Lx, wwnn=0x%016Lx, " 352 "(wwpn=0x%016Lx, wwnn=0x%016Lx, "
352 "hard_nport_id=0x%08x, nport_id=0x%08x)\n", 353 "hard_nport_id=0x%08x, nport_id=0x%08x)\n",
353 adapter->s_id, d_id, (wwn_t) adisc->wwpn, 354 adapter->s_id, send_els->d_id, (wwn_t) adisc->wwpn,
354 (wwn_t) adisc->wwnn, adisc->hard_nport_id, 355 (wwn_t) adisc->wwnn, adisc->hard_nport_id,
355 adisc->nport_id); 356 adisc->nport_id);
356 357
@@ -367,7 +368,7 @@ zfcp_erp_adisc(struct zfcp_adapter *adapter, fc_id_t d_id)
367 retval = zfcp_fsf_send_els(send_els); 368 retval = zfcp_fsf_send_els(send_els);
368 if (retval != 0) { 369 if (retval != 0) {
369 ZFCP_LOG_NORMAL("error: initiation of Send ELS failed for port " 370 ZFCP_LOG_NORMAL("error: initiation of Send ELS failed for port "
370 "0x%08x on adapter %s\n", d_id, 371 "0x%08x on adapter %s\n", send_els->d_id,
371 zfcp_get_busid_by_adapter(adapter)); 372 zfcp_get_busid_by_adapter(adapter));
372 del_timer(send_els->timer); 373 del_timer(send_els->timer);
373 goto freemem; 374 goto freemem;
@@ -411,14 +412,9 @@ zfcp_erp_adisc_handler(unsigned long data)
411 del_timer(send_els->timer); 412 del_timer(send_els->timer);
412 413
413 adapter = send_els->adapter; 414 adapter = send_els->adapter;
415 port = send_els->port;
414 d_id = send_els->d_id; 416 d_id = send_els->d_id;
415 417
416 read_lock(&zfcp_data.config_lock);
417 port = zfcp_get_port_by_did(send_els->adapter, send_els->d_id);
418 read_unlock(&zfcp_data.config_lock);
419
420 BUG_ON(port == NULL);
421
422 /* request rejected or timed out */ 418 /* request rejected or timed out */
423 if (send_els->status != 0) { 419 if (send_els->status != 0) {
424 ZFCP_LOG_NORMAL("ELS request rejected/timed out, " 420 ZFCP_LOG_NORMAL("ELS request rejected/timed out, "
@@ -482,7 +478,7 @@ zfcp_test_link(struct zfcp_port *port)
482 int retval; 478 int retval;
483 479
484 zfcp_port_get(port); 480 zfcp_port_get(port);
485 retval = zfcp_erp_adisc(port->adapter, port->d_id); 481 retval = zfcp_erp_adisc(port);
486 if (retval != 0) { 482 if (retval != 0) {
487 zfcp_port_put(port); 483 zfcp_port_put(port);
488 ZFCP_LOG_NORMAL("reopen needed for port 0x%016Lx " 484 ZFCP_LOG_NORMAL("reopen needed for port 0x%016Lx "
@@ -895,7 +891,7 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action)
895 891
896 if (erp_action->fsf_req) { 892 if (erp_action->fsf_req) {
897 /* take lock to ensure that request is not being deleted meanwhile */ 893 /* take lock to ensure that request is not being deleted meanwhile */
898 write_lock(&adapter->fsf_req_list_lock); 894 spin_lock(&adapter->fsf_req_list_lock);
899 /* check whether fsf req does still exist */ 895 /* check whether fsf req does still exist */
900 list_for_each_entry(fsf_req, &adapter->fsf_req_list_head, list) 896 list_for_each_entry(fsf_req, &adapter->fsf_req_list_head, list)
901 if (fsf_req == erp_action->fsf_req) 897 if (fsf_req == erp_action->fsf_req)
@@ -938,7 +934,7 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action)
938 */ 934 */
939 erp_action->fsf_req = NULL; 935 erp_action->fsf_req = NULL;
940 } 936 }
941 write_unlock(&adapter->fsf_req_list_lock); 937 spin_unlock(&adapter->fsf_req_list_lock);
942 } else 938 } else
943 debug_text_event(adapter->erp_dbf, 3, "a_ca_noreq"); 939 debug_text_event(adapter->erp_dbf, 3, "a_ca_noreq");
944 940
@@ -2286,12 +2282,12 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
2286{ 2282{
2287 int retval = ZFCP_ERP_SUCCEEDED; 2283 int retval = ZFCP_ERP_SUCCEEDED;
2288 int retries; 2284 int retries;
2285 int sleep = ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP;
2289 struct zfcp_adapter *adapter = erp_action->adapter; 2286 struct zfcp_adapter *adapter = erp_action->adapter;
2290 2287
2291 atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, &adapter->status); 2288 atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, &adapter->status);
2292 retries = ZFCP_EXCHANGE_CONFIG_DATA_RETRIES;
2293 2289
2294 do { 2290 for (retries = ZFCP_EXCHANGE_CONFIG_DATA_RETRIES; retries; retries--) {
2295 atomic_clear_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, 2291 atomic_clear_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
2296 &adapter->status); 2292 &adapter->status);
2297 ZFCP_LOG_DEBUG("Doing exchange config data\n"); 2293 ZFCP_LOG_DEBUG("Doing exchange config data\n");
@@ -2329,16 +2325,17 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
2329 zfcp_get_busid_by_adapter(adapter)); 2325 zfcp_get_busid_by_adapter(adapter));
2330 break; 2326 break;
2331 } 2327 }
2332 if (atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, 2328
2333 &adapter->status)) { 2329 if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
2334 ZFCP_LOG_DEBUG("host connection still initialising... " 2330 &adapter->status))
2335 "waiting and retrying...\n"); 2331 break;
2336 /* sleep a little bit before retry */ 2332
2337 msleep(jiffies_to_msecs(ZFCP_EXCHANGE_CONFIG_DATA_SLEEP)); 2333 ZFCP_LOG_DEBUG("host connection still initialising... "
2338 } 2334 "waiting and retrying...\n");
2339 } while ((retries--) && 2335 /* sleep a little bit before retry */
2340 atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, 2336 msleep(jiffies_to_msecs(sleep));
2341 &adapter->status)); 2337 sleep *= 2;
2338 }
2342 2339
2343 if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, 2340 if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK,
2344 &adapter->status)) { 2341 &adapter->status)) {
@@ -3485,6 +3482,45 @@ zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action)
3485} 3482}
3486 3483
3487/* 3484/*
3485 * function: zfcp_erp_port_boxed
3486 *
3487 * purpose:
3488 */
3489void
3490zfcp_erp_port_boxed(struct zfcp_port *port)
3491{
3492 struct zfcp_adapter *adapter = port->adapter;
3493 unsigned long flags;
3494
3495 debug_text_event(adapter->erp_dbf, 3, "p_access_boxed");
3496 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t));
3497 read_lock_irqsave(&zfcp_data.config_lock, flags);
3498 zfcp_erp_modify_port_status(port,
3499 ZFCP_STATUS_COMMON_ACCESS_BOXED,
3500 ZFCP_SET);
3501 read_unlock_irqrestore(&zfcp_data.config_lock, flags);
3502 zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED);
3503}
3504
3505/*
3506 * function: zfcp_erp_unit_boxed
3507 *
3508 * purpose:
3509 */
3510void
3511zfcp_erp_unit_boxed(struct zfcp_unit *unit)
3512{
3513 struct zfcp_adapter *adapter = unit->port->adapter;
3514
3515 debug_text_event(adapter->erp_dbf, 3, "u_access_boxed");
3516 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t));
3517 zfcp_erp_modify_unit_status(unit,
3518 ZFCP_STATUS_COMMON_ACCESS_BOXED,
3519 ZFCP_SET);
3520 zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED);
3521}
3522
3523/*
3488 * function: zfcp_erp_port_access_denied 3524 * function: zfcp_erp_port_access_denied
3489 * 3525 *
3490 * purpose: 3526 * purpose:
@@ -3495,11 +3531,13 @@ zfcp_erp_port_access_denied(struct zfcp_port *port)
3495 struct zfcp_adapter *adapter = port->adapter; 3531 struct zfcp_adapter *adapter = port->adapter;
3496 unsigned long flags; 3532 unsigned long flags;
3497 3533
3498 debug_text_event(adapter->erp_dbf, 3, "p_access_block"); 3534 debug_text_event(adapter->erp_dbf, 3, "p_access_denied");
3499 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); 3535 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t));
3500 read_lock_irqsave(&zfcp_data.config_lock, flags); 3536 read_lock_irqsave(&zfcp_data.config_lock, flags);
3501 zfcp_erp_modify_port_status(port, ZFCP_STATUS_COMMON_ERP_FAILED | 3537 zfcp_erp_modify_port_status(port,
3502 ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); 3538 ZFCP_STATUS_COMMON_ERP_FAILED |
3539 ZFCP_STATUS_COMMON_ACCESS_DENIED,
3540 ZFCP_SET);
3503 read_unlock_irqrestore(&zfcp_data.config_lock, flags); 3541 read_unlock_irqrestore(&zfcp_data.config_lock, flags);
3504} 3542}
3505 3543
@@ -3513,10 +3551,12 @@ zfcp_erp_unit_access_denied(struct zfcp_unit *unit)
3513{ 3551{
3514 struct zfcp_adapter *adapter = unit->port->adapter; 3552 struct zfcp_adapter *adapter = unit->port->adapter;
3515 3553
3516 debug_text_event(adapter->erp_dbf, 3, "u_access_block"); 3554 debug_text_event(adapter->erp_dbf, 3, "u_access_denied");
3517 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); 3555 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t));
3518 zfcp_erp_modify_unit_status(unit, ZFCP_STATUS_COMMON_ERP_FAILED | 3556 zfcp_erp_modify_unit_status(unit,
3519 ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); 3557 ZFCP_STATUS_COMMON_ERP_FAILED |
3558 ZFCP_STATUS_COMMON_ACCESS_DENIED,
3559 ZFCP_SET);
3520} 3560}
3521 3561
3522/* 3562/*
@@ -3530,7 +3570,7 @@ zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter)
3530 struct zfcp_port *port; 3570 struct zfcp_port *port;
3531 unsigned long flags; 3571 unsigned long flags;
3532 3572
3533 debug_text_event(adapter->erp_dbf, 3, "a_access_unblock"); 3573 debug_text_event(adapter->erp_dbf, 3, "a_access_recover");
3534 debug_event(adapter->erp_dbf, 3, &adapter->name, 8); 3574 debug_event(adapter->erp_dbf, 3, &adapter->name, 8);
3535 3575
3536 read_lock_irqsave(&zfcp_data.config_lock, flags); 3576 read_lock_irqsave(&zfcp_data.config_lock, flags);
@@ -3553,10 +3593,12 @@ zfcp_erp_port_access_changed(struct zfcp_port *port)
3553 struct zfcp_adapter *adapter = port->adapter; 3593 struct zfcp_adapter *adapter = port->adapter;
3554 struct zfcp_unit *unit; 3594 struct zfcp_unit *unit;
3555 3595
3556 debug_text_event(adapter->erp_dbf, 3, "p_access_unblock"); 3596 debug_text_event(adapter->erp_dbf, 3, "p_access_recover");
3557 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); 3597 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t));
3558 3598
3559 if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, 3599 if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED,
3600 &port->status) &&
3601 !atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_BOXED,
3560 &port->status)) { 3602 &port->status)) {
3561 if (!atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) 3603 if (!atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status))
3562 list_for_each_entry(unit, &port->unit_list_head, list) 3604 list_for_each_entry(unit, &port->unit_list_head, list)
@@ -3583,10 +3625,13 @@ zfcp_erp_unit_access_changed(struct zfcp_unit *unit)
3583{ 3625{
3584 struct zfcp_adapter *adapter = unit->port->adapter; 3626 struct zfcp_adapter *adapter = unit->port->adapter;
3585 3627
3586 debug_text_event(adapter->erp_dbf, 3, "u_access_unblock"); 3628 debug_text_event(adapter->erp_dbf, 3, "u_access_recover");
3587 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); 3629 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t));
3588 3630
3589 if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &unit->status)) 3631 if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED,
3632 &unit->status) &&
3633 !atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_BOXED,
3634 &unit->status))
3590 return; 3635 return;
3591 3636
3592 ZFCP_LOG_NORMAL("reopen of unit 0x%016Lx on port 0x%016Lx " 3637 ZFCP_LOG_NORMAL("reopen of unit 0x%016Lx on port 0x%016Lx "
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index d5fd43352071..42df7e57eeae 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -116,7 +116,7 @@ extern int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *,
116 struct timer_list*, int); 116 struct timer_list*, int);
117extern int zfcp_fsf_req_complete(struct zfcp_fsf_req *); 117extern int zfcp_fsf_req_complete(struct zfcp_fsf_req *);
118extern void zfcp_fsf_incoming_els(struct zfcp_fsf_req *); 118extern void zfcp_fsf_incoming_els(struct zfcp_fsf_req *);
119extern void zfcp_fsf_req_cleanup(struct zfcp_fsf_req *); 119extern void zfcp_fsf_req_free(struct zfcp_fsf_req *);
120extern struct zfcp_fsf_req *zfcp_fsf_send_fcp_command_task_management( 120extern struct zfcp_fsf_req *zfcp_fsf_send_fcp_command_task_management(
121 struct zfcp_adapter *, struct zfcp_unit *, u8, int); 121 struct zfcp_adapter *, struct zfcp_unit *, u8, int);
122extern struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command( 122extern struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command(
@@ -171,6 +171,8 @@ extern int zfcp_erp_async_handler(struct zfcp_erp_action *, unsigned long);
171 171
172extern int zfcp_test_link(struct zfcp_port *); 172extern int zfcp_test_link(struct zfcp_port *);
173 173
174extern void zfcp_erp_port_boxed(struct zfcp_port *);
175extern void zfcp_erp_unit_boxed(struct zfcp_unit *);
174extern void zfcp_erp_port_access_denied(struct zfcp_port *); 176extern void zfcp_erp_port_access_denied(struct zfcp_port *);
175extern void zfcp_erp_unit_access_denied(struct zfcp_unit *); 177extern void zfcp_erp_unit_access_denied(struct zfcp_unit *);
176extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *); 178extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 148b11c822bf..0d9f20edc490 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -61,7 +61,6 @@ static int zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *);
61static int zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *); 61static int zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *);
62static int zfcp_fsf_req_dispatch(struct zfcp_fsf_req *); 62static int zfcp_fsf_req_dispatch(struct zfcp_fsf_req *);
63static void zfcp_fsf_req_dismiss(struct zfcp_fsf_req *); 63static void zfcp_fsf_req_dismiss(struct zfcp_fsf_req *);
64static void zfcp_fsf_req_free(struct zfcp_fsf_req *);
65 64
66/* association between FSF command and FSF QTCB type */ 65/* association between FSF command and FSF QTCB type */
67static u32 fsf_qtcb_type[] = { 66static u32 fsf_qtcb_type[] = {
@@ -149,13 +148,13 @@ zfcp_fsf_req_alloc(mempool_t *pool, int req_flags)
149 * 148 *
150 * locks: none 149 * locks: none
151 */ 150 */
152static void 151void
153zfcp_fsf_req_free(struct zfcp_fsf_req *fsf_req) 152zfcp_fsf_req_free(struct zfcp_fsf_req *fsf_req)
154{ 153{
155 if (likely(fsf_req->pool != NULL)) 154 if (likely(fsf_req->pool != NULL))
156 mempool_free(fsf_req, fsf_req->pool); 155 mempool_free(fsf_req, fsf_req->pool);
157 else 156 else
158 kfree(fsf_req); 157 kfree(fsf_req);
159} 158}
160 159
161/* 160/*
@@ -170,30 +169,21 @@ zfcp_fsf_req_free(struct zfcp_fsf_req *fsf_req)
170int 169int
171zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter) 170zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter)
172{ 171{
173 int retval = 0;
174 struct zfcp_fsf_req *fsf_req, *tmp; 172 struct zfcp_fsf_req *fsf_req, *tmp;
173 unsigned long flags;
174 LIST_HEAD(remove_queue);
175 175
176 list_for_each_entry_safe(fsf_req, tmp, &adapter->fsf_req_list_head, 176 spin_lock_irqsave(&adapter->fsf_req_list_lock, flags);
177 list) 177 list_splice_init(&adapter->fsf_req_list_head, &remove_queue);
178 zfcp_fsf_req_dismiss(fsf_req); 178 atomic_set(&adapter->fsf_reqs_active, 0);
179 /* wait_event_timeout? */ 179 spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
180 while (!list_empty(&adapter->fsf_req_list_head)) {
181 ZFCP_LOG_DEBUG("fsf req list of adapter %s not yet empty\n",
182 zfcp_get_busid_by_adapter(adapter));
183 /* wait for woken intiators to clean up their requests */
184 msleep(jiffies_to_msecs(ZFCP_FSFREQ_CLEANUP_TIMEOUT));
185 }
186 180
187 /* consistency check */ 181 list_for_each_entry_safe(fsf_req, tmp, &remove_queue, list) {
188 if (atomic_read(&adapter->fsf_reqs_active)) { 182 list_del(&fsf_req->list);
189 ZFCP_LOG_NORMAL("bug: There are still %d FSF requests pending " 183 zfcp_fsf_req_dismiss(fsf_req);
190 "on adapter %s after cleanup.\n",
191 atomic_read(&adapter->fsf_reqs_active),
192 zfcp_get_busid_by_adapter(adapter));
193 atomic_set(&adapter->fsf_reqs_active, 0);
194 } 184 }
195 185
196 return retval; 186 return 0;
197} 187}
198 188
199/* 189/*
@@ -226,10 +216,6 @@ zfcp_fsf_req_complete(struct zfcp_fsf_req *fsf_req)
226{ 216{
227 int retval = 0; 217 int retval = 0;
228 int cleanup; 218 int cleanup;
229 struct zfcp_adapter *adapter = fsf_req->adapter;
230
231 /* do some statistics */
232 atomic_dec(&adapter->fsf_reqs_active);
233 219
234 if (unlikely(fsf_req->fsf_command == FSF_QTCB_UNSOLICITED_STATUS)) { 220 if (unlikely(fsf_req->fsf_command == FSF_QTCB_UNSOLICITED_STATUS)) {
235 ZFCP_LOG_DEBUG("Status read response received\n"); 221 ZFCP_LOG_DEBUG("Status read response received\n");
@@ -260,7 +246,7 @@ zfcp_fsf_req_complete(struct zfcp_fsf_req *fsf_req)
260 * lock must not be held here since it will be 246 * lock must not be held here since it will be
261 * grabed by the called routine, too 247 * grabed by the called routine, too
262 */ 248 */
263 zfcp_fsf_req_cleanup(fsf_req); 249 zfcp_fsf_req_free(fsf_req);
264 } else { 250 } else {
265 /* notify initiator waiting for the requests completion */ 251 /* notify initiator waiting for the requests completion */
266 ZFCP_LOG_TRACE("waking initiator of FSF request %p\n",fsf_req); 252 ZFCP_LOG_TRACE("waking initiator of FSF request %p\n",fsf_req);
@@ -346,15 +332,10 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
346 switch (fsf_req->qtcb->prefix.prot_status) { 332 switch (fsf_req->qtcb->prefix.prot_status) {
347 333
348 case FSF_PROT_GOOD: 334 case FSF_PROT_GOOD:
349 ZFCP_LOG_TRACE("FSF_PROT_GOOD\n");
350 break;
351
352 case FSF_PROT_FSF_STATUS_PRESENTED: 335 case FSF_PROT_FSF_STATUS_PRESENTED:
353 ZFCP_LOG_TRACE("FSF_PROT_FSF_STATUS_PRESENTED\n");
354 break; 336 break;
355 337
356 case FSF_PROT_QTCB_VERSION_ERROR: 338 case FSF_PROT_QTCB_VERSION_ERROR:
357 ZFCP_LOG_FLAGS(0, "FSF_PROT_QTCB_VERSION_ERROR\n");
358 ZFCP_LOG_NORMAL("error: The adapter %s contains " 339 ZFCP_LOG_NORMAL("error: The adapter %s contains "
359 "microcode of version 0x%x, the device driver " 340 "microcode of version 0x%x, the device driver "
360 "only supports 0x%x. Aborting.\n", 341 "only supports 0x%x. Aborting.\n",
@@ -371,7 +352,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
371 break; 352 break;
372 353
373 case FSF_PROT_SEQ_NUMB_ERROR: 354 case FSF_PROT_SEQ_NUMB_ERROR:
374 ZFCP_LOG_FLAGS(0, "FSF_PROT_SEQ_NUMB_ERROR\n");
375 ZFCP_LOG_NORMAL("bug: Sequence number mismatch between " 355 ZFCP_LOG_NORMAL("bug: Sequence number mismatch between "
376 "driver (0x%x) and adapter %s (0x%x). " 356 "driver (0x%x) and adapter %s (0x%x). "
377 "Restarting all operations on this adapter.\n", 357 "Restarting all operations on this adapter.\n",
@@ -390,7 +370,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
390 break; 370 break;
391 371
392 case FSF_PROT_UNSUPP_QTCB_TYPE: 372 case FSF_PROT_UNSUPP_QTCB_TYPE:
393 ZFCP_LOG_FLAGS(0, "FSF_PROT_UNSUP_QTCB_TYPE\n");
394 ZFCP_LOG_NORMAL("error: Packet header type used by the " 373 ZFCP_LOG_NORMAL("error: Packet header type used by the "
395 "device driver is incompatible with " 374 "device driver is incompatible with "
396 "that used on adapter %s. " 375 "that used on adapter %s. "
@@ -405,7 +384,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
405 break; 384 break;
406 385
407 case FSF_PROT_HOST_CONNECTION_INITIALIZING: 386 case FSF_PROT_HOST_CONNECTION_INITIALIZING:
408 ZFCP_LOG_FLAGS(1, "FSF_PROT_HOST_CONNECTION_INITIALIZING\n");
409 zfcp_cmd_dbf_event_fsf("hconinit", fsf_req, 387 zfcp_cmd_dbf_event_fsf("hconinit", fsf_req,
410 &fsf_req->qtcb->prefix.prot_status_qual, 388 &fsf_req->qtcb->prefix.prot_status_qual,
411 sizeof (union fsf_prot_status_qual)); 389 sizeof (union fsf_prot_status_qual));
@@ -416,7 +394,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
416 break; 394 break;
417 395
418 case FSF_PROT_DUPLICATE_REQUEST_ID: 396 case FSF_PROT_DUPLICATE_REQUEST_ID:
419 ZFCP_LOG_FLAGS(0, "FSF_PROT_DUPLICATE_REQUEST_IDS\n");
420 if (fsf_req->qtcb) { 397 if (fsf_req->qtcb) {
421 ZFCP_LOG_NORMAL("bug: The request identifier 0x%Lx " 398 ZFCP_LOG_NORMAL("bug: The request identifier 0x%Lx "
422 "to the adapter %s is ambiguous. " 399 "to the adapter %s is ambiguous. "
@@ -445,7 +422,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
445 break; 422 break;
446 423
447 case FSF_PROT_LINK_DOWN: 424 case FSF_PROT_LINK_DOWN:
448 ZFCP_LOG_FLAGS(1, "FSF_PROT_LINK_DOWN\n");
449 /* 425 /*
450 * 'test and set' is not atomic here - 426 * 'test and set' is not atomic here -
451 * it's ok as long as calls to our response queue handler 427 * it's ok as long as calls to our response queue handler
@@ -502,13 +478,11 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
502 ZFCP_STATUS_COMMON_ERP_FAILED, 478 ZFCP_STATUS_COMMON_ERP_FAILED,
503 &adapter->status); 479 &adapter->status);
504 zfcp_erp_adapter_reopen(adapter, 0); 480 zfcp_erp_adapter_reopen(adapter, 0);
505 debug_text_event(adapter->erp_dbf, 1, "prot_link_down");
506 } 481 }
507 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 482 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
508 break; 483 break;
509 484
510 case FSF_PROT_REEST_QUEUE: 485 case FSF_PROT_REEST_QUEUE:
511 ZFCP_LOG_FLAGS(1, "FSF_PROT_REEST_QUEUE\n");
512 debug_text_event(adapter->erp_dbf, 1, "prot_reest_queue"); 486 debug_text_event(adapter->erp_dbf, 1, "prot_reest_queue");
513 ZFCP_LOG_INFO("The local link to adapter with " 487 ZFCP_LOG_INFO("The local link to adapter with "
514 "%s was re-plugged. " 488 "%s was re-plugged. "
@@ -528,7 +502,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
528 break; 502 break;
529 503
530 case FSF_PROT_ERROR_STATE: 504 case FSF_PROT_ERROR_STATE:
531 ZFCP_LOG_FLAGS(0, "FSF_PROT_ERROR_STATE\n");
532 ZFCP_LOG_NORMAL("error: The adapter %s " 505 ZFCP_LOG_NORMAL("error: The adapter %s "
533 "has entered the error state. " 506 "has entered the error state. "
534 "Restarting all operations on this " 507 "Restarting all operations on this "
@@ -589,7 +562,6 @@ zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *fsf_req)
589 /* evaluate FSF Status */ 562 /* evaluate FSF Status */
590 switch (fsf_req->qtcb->header.fsf_status) { 563 switch (fsf_req->qtcb->header.fsf_status) {
591 case FSF_UNKNOWN_COMMAND: 564 case FSF_UNKNOWN_COMMAND:
592 ZFCP_LOG_FLAGS(0, "FSF_UNKNOWN_COMMAND\n");
593 ZFCP_LOG_NORMAL("bug: Command issued by the device driver is " 565 ZFCP_LOG_NORMAL("bug: Command issued by the device driver is "
594 "not known by the adapter %s " 566 "not known by the adapter %s "
595 "Stopping all operations on this adapter. " 567 "Stopping all operations on this adapter. "
@@ -606,14 +578,12 @@ zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *fsf_req)
606 break; 578 break;
607 579
608 case FSF_FCP_RSP_AVAILABLE: 580 case FSF_FCP_RSP_AVAILABLE:
609 ZFCP_LOG_FLAGS(2, "FSF_FCP_RSP_AVAILABLE\n");
610 ZFCP_LOG_DEBUG("FCP Sense data will be presented to the " 581 ZFCP_LOG_DEBUG("FCP Sense data will be presented to the "
611 "SCSI stack.\n"); 582 "SCSI stack.\n");
612 debug_text_event(fsf_req->adapter->erp_dbf, 3, "fsf_s_rsp"); 583 debug_text_event(fsf_req->adapter->erp_dbf, 3, "fsf_s_rsp");
613 break; 584 break;
614 585
615 case FSF_ADAPTER_STATUS_AVAILABLE: 586 case FSF_ADAPTER_STATUS_AVAILABLE:
616 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
617 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_astatus"); 587 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_astatus");
618 zfcp_fsf_fsfstatus_qual_eval(fsf_req); 588 zfcp_fsf_fsfstatus_qual_eval(fsf_req);
619 break; 589 break;
@@ -647,11 +617,9 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req)
647 617
648 switch (fsf_req->qtcb->header.fsf_status_qual.word[0]) { 618 switch (fsf_req->qtcb->header.fsf_status_qual.word[0]) {
649 case FSF_SQ_FCP_RSP_AVAILABLE: 619 case FSF_SQ_FCP_RSP_AVAILABLE:
650 ZFCP_LOG_FLAGS(2, "FSF_SQ_FCP_RSP_AVAILABLE\n");
651 debug_text_event(fsf_req->adapter->erp_dbf, 4, "fsf_sq_rsp"); 620 debug_text_event(fsf_req->adapter->erp_dbf, 4, "fsf_sq_rsp");
652 break; 621 break;
653 case FSF_SQ_RETRY_IF_POSSIBLE: 622 case FSF_SQ_RETRY_IF_POSSIBLE:
654 ZFCP_LOG_FLAGS(2, "FSF_SQ_RETRY_IF_POSSIBLE\n");
655 /* The SCSI-stack may now issue retries or escalate */ 623 /* The SCSI-stack may now issue retries or escalate */
656 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_sq_retry"); 624 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_sq_retry");
657 zfcp_cmd_dbf_event_fsf("sqretry", fsf_req, 625 zfcp_cmd_dbf_event_fsf("sqretry", fsf_req,
@@ -660,7 +628,6 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req)
660 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 628 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
661 break; 629 break;
662 case FSF_SQ_COMMAND_ABORTED: 630 case FSF_SQ_COMMAND_ABORTED:
663 ZFCP_LOG_FLAGS(2, "FSF_SQ_COMMAND_ABORTED\n");
664 /* Carry the aborted state on to upper layer */ 631 /* Carry the aborted state on to upper layer */
665 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_sq_abort"); 632 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_sq_abort");
666 zfcp_cmd_dbf_event_fsf("sqabort", fsf_req, 633 zfcp_cmd_dbf_event_fsf("sqabort", fsf_req,
@@ -670,7 +637,6 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req)
670 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 637 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
671 break; 638 break;
672 case FSF_SQ_NO_RECOM: 639 case FSF_SQ_NO_RECOM:
673 ZFCP_LOG_FLAGS(0, "FSF_SQ_NO_RECOM\n");
674 debug_text_exception(fsf_req->adapter->erp_dbf, 0, 640 debug_text_exception(fsf_req->adapter->erp_dbf, 0,
675 "fsf_sq_no_rec"); 641 "fsf_sq_no_rec");
676 ZFCP_LOG_NORMAL("bug: No recommendation could be given for a" 642 ZFCP_LOG_NORMAL("bug: No recommendation could be given for a"
@@ -684,7 +650,6 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req)
684 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 650 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
685 break; 651 break;
686 case FSF_SQ_ULP_PROGRAMMING_ERROR: 652 case FSF_SQ_ULP_PROGRAMMING_ERROR:
687 ZFCP_LOG_FLAGS(0, "FSF_SQ_ULP_PROGRAMMING_ERROR\n");
688 ZFCP_LOG_NORMAL("error: not enough SBALs for data transfer " 653 ZFCP_LOG_NORMAL("error: not enough SBALs for data transfer "
689 "(adapter %s)\n", 654 "(adapter %s)\n",
690 zfcp_get_busid_by_adapter(fsf_req->adapter)); 655 zfcp_get_busid_by_adapter(fsf_req->adapter));
@@ -740,72 +705,58 @@ zfcp_fsf_req_dispatch(struct zfcp_fsf_req *fsf_req)
740 switch (fsf_req->fsf_command) { 705 switch (fsf_req->fsf_command) {
741 706
742 case FSF_QTCB_FCP_CMND: 707 case FSF_QTCB_FCP_CMND:
743 ZFCP_LOG_FLAGS(3, "FSF_QTCB_FCP_CMND\n");
744 zfcp_fsf_send_fcp_command_handler(fsf_req); 708 zfcp_fsf_send_fcp_command_handler(fsf_req);
745 break; 709 break;
746 710
747 case FSF_QTCB_ABORT_FCP_CMND: 711 case FSF_QTCB_ABORT_FCP_CMND:
748 ZFCP_LOG_FLAGS(2, "FSF_QTCB_ABORT_FCP_CMND\n");
749 zfcp_fsf_abort_fcp_command_handler(fsf_req); 712 zfcp_fsf_abort_fcp_command_handler(fsf_req);
750 break; 713 break;
751 714
752 case FSF_QTCB_SEND_GENERIC: 715 case FSF_QTCB_SEND_GENERIC:
753 ZFCP_LOG_FLAGS(2, "FSF_QTCB_SEND_GENERIC\n");
754 zfcp_fsf_send_ct_handler(fsf_req); 716 zfcp_fsf_send_ct_handler(fsf_req);
755 break; 717 break;
756 718
757 case FSF_QTCB_OPEN_PORT_WITH_DID: 719 case FSF_QTCB_OPEN_PORT_WITH_DID:
758 ZFCP_LOG_FLAGS(2, "FSF_QTCB_OPEN_PORT_WITH_DID\n");
759 zfcp_fsf_open_port_handler(fsf_req); 720 zfcp_fsf_open_port_handler(fsf_req);
760 break; 721 break;
761 722
762 case FSF_QTCB_OPEN_LUN: 723 case FSF_QTCB_OPEN_LUN:
763 ZFCP_LOG_FLAGS(2, "FSF_QTCB_OPEN_LUN\n");
764 zfcp_fsf_open_unit_handler(fsf_req); 724 zfcp_fsf_open_unit_handler(fsf_req);
765 break; 725 break;
766 726
767 case FSF_QTCB_CLOSE_LUN: 727 case FSF_QTCB_CLOSE_LUN:
768 ZFCP_LOG_FLAGS(2, "FSF_QTCB_CLOSE_LUN\n");
769 zfcp_fsf_close_unit_handler(fsf_req); 728 zfcp_fsf_close_unit_handler(fsf_req);
770 break; 729 break;
771 730
772 case FSF_QTCB_CLOSE_PORT: 731 case FSF_QTCB_CLOSE_PORT:
773 ZFCP_LOG_FLAGS(2, "FSF_QTCB_CLOSE_PORT\n");
774 zfcp_fsf_close_port_handler(fsf_req); 732 zfcp_fsf_close_port_handler(fsf_req);
775 break; 733 break;
776 734
777 case FSF_QTCB_CLOSE_PHYSICAL_PORT: 735 case FSF_QTCB_CLOSE_PHYSICAL_PORT:
778 ZFCP_LOG_FLAGS(2, "FSF_QTCB_CLOSE_PHYSICAL_PORT\n");
779 zfcp_fsf_close_physical_port_handler(fsf_req); 736 zfcp_fsf_close_physical_port_handler(fsf_req);
780 break; 737 break;
781 738
782 case FSF_QTCB_EXCHANGE_CONFIG_DATA: 739 case FSF_QTCB_EXCHANGE_CONFIG_DATA:
783 ZFCP_LOG_FLAGS(2, "FSF_QTCB_EXCHANGE_CONFIG_DATA\n");
784 zfcp_fsf_exchange_config_data_handler(fsf_req); 740 zfcp_fsf_exchange_config_data_handler(fsf_req);
785 break; 741 break;
786 742
787 case FSF_QTCB_EXCHANGE_PORT_DATA: 743 case FSF_QTCB_EXCHANGE_PORT_DATA:
788 ZFCP_LOG_FLAGS(2, "FSF_QTCB_EXCHANGE_PORT_DATA\n");
789 zfcp_fsf_exchange_port_data_handler(fsf_req); 744 zfcp_fsf_exchange_port_data_handler(fsf_req);
790 break; 745 break;
791 746
792 case FSF_QTCB_SEND_ELS: 747 case FSF_QTCB_SEND_ELS:
793 ZFCP_LOG_FLAGS(2, "FSF_QTCB_SEND_ELS\n");
794 zfcp_fsf_send_els_handler(fsf_req); 748 zfcp_fsf_send_els_handler(fsf_req);
795 break; 749 break;
796 750
797 case FSF_QTCB_DOWNLOAD_CONTROL_FILE: 751 case FSF_QTCB_DOWNLOAD_CONTROL_FILE:
798 ZFCP_LOG_FLAGS(2, "FSF_QTCB_DOWNLOAD_CONTROL_FILE\n");
799 zfcp_fsf_control_file_handler(fsf_req); 752 zfcp_fsf_control_file_handler(fsf_req);
800 break; 753 break;
801 754
802 case FSF_QTCB_UPLOAD_CONTROL_FILE: 755 case FSF_QTCB_UPLOAD_CONTROL_FILE:
803 ZFCP_LOG_FLAGS(2, "FSF_QTCB_UPLOAD_CONTROL_FILE\n");
804 zfcp_fsf_control_file_handler(fsf_req); 756 zfcp_fsf_control_file_handler(fsf_req);
805 break; 757 break;
806 758
807 default: 759 default:
808 ZFCP_LOG_FLAGS(2, "FSF_QTCB_UNKNOWN\n");
809 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 760 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
810 ZFCP_LOG_NORMAL("bug: Command issued by the device driver is " 761 ZFCP_LOG_NORMAL("bug: Command issued by the device driver is "
811 "not supported by the adapter %s\n", 762 "not supported by the adapter %s\n",
@@ -929,13 +880,11 @@ zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *fsf_req)
929 switch (status_buffer->status_subtype) { 880 switch (status_buffer->status_subtype) {
930 881
931 case FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT: 882 case FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT:
932 ZFCP_LOG_FLAGS(2, "FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT\n");
933 debug_text_event(adapter->erp_dbf, 3, "unsol_pc_phys:"); 883 debug_text_event(adapter->erp_dbf, 3, "unsol_pc_phys:");
934 zfcp_erp_port_reopen(port, 0); 884 zfcp_erp_port_reopen(port, 0);
935 break; 885 break;
936 886
937 case FSF_STATUS_READ_SUB_ERROR_PORT: 887 case FSF_STATUS_READ_SUB_ERROR_PORT:
938 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_SUB_ERROR_PORT\n");
939 debug_text_event(adapter->erp_dbf, 1, "unsol_pc_err:"); 888 debug_text_event(adapter->erp_dbf, 1, "unsol_pc_err:");
940 zfcp_erp_port_shutdown(port, 0); 889 zfcp_erp_port_shutdown(port, 0);
941 break; 890 break;
@@ -973,14 +922,13 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
973 922
974 if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { 923 if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) {
975 mempool_free(status_buffer, adapter->pool.data_status_read); 924 mempool_free(status_buffer, adapter->pool.data_status_read);
976 zfcp_fsf_req_cleanup(fsf_req); 925 zfcp_fsf_req_free(fsf_req);
977 goto out; 926 goto out;
978 } 927 }
979 928
980 switch (status_buffer->status_type) { 929 switch (status_buffer->status_type) {
981 930
982 case FSF_STATUS_READ_PORT_CLOSED: 931 case FSF_STATUS_READ_PORT_CLOSED:
983 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_PORT_CLOSED\n");
984 debug_text_event(adapter->erp_dbf, 3, "unsol_pclosed:"); 932 debug_text_event(adapter->erp_dbf, 3, "unsol_pclosed:");
985 debug_event(adapter->erp_dbf, 3, 933 debug_event(adapter->erp_dbf, 3,
986 &status_buffer->d_id, sizeof (u32)); 934 &status_buffer->d_id, sizeof (u32));
@@ -988,13 +936,11 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
988 break; 936 break;
989 937
990 case FSF_STATUS_READ_INCOMING_ELS: 938 case FSF_STATUS_READ_INCOMING_ELS:
991 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_INCOMING_ELS\n");
992 debug_text_event(adapter->erp_dbf, 3, "unsol_els:"); 939 debug_text_event(adapter->erp_dbf, 3, "unsol_els:");
993 zfcp_fsf_incoming_els(fsf_req); 940 zfcp_fsf_incoming_els(fsf_req);
994 break; 941 break;
995 942
996 case FSF_STATUS_READ_SENSE_DATA_AVAIL: 943 case FSF_STATUS_READ_SENSE_DATA_AVAIL:
997 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_SENSE_DATA_AVAIL\n");
998 debug_text_event(adapter->erp_dbf, 3, "unsol_sense:"); 944 debug_text_event(adapter->erp_dbf, 3, "unsol_sense:");
999 ZFCP_LOG_INFO("unsolicited sense data received (adapter %s)\n", 945 ZFCP_LOG_INFO("unsolicited sense data received (adapter %s)\n",
1000 zfcp_get_busid_by_adapter(adapter)); 946 zfcp_get_busid_by_adapter(adapter));
@@ -1003,7 +949,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
1003 break; 949 break;
1004 950
1005 case FSF_STATUS_READ_BIT_ERROR_THRESHOLD: 951 case FSF_STATUS_READ_BIT_ERROR_THRESHOLD:
1006 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_BIT_ERROR_THRESHOLD\n");
1007 debug_text_event(adapter->erp_dbf, 3, "unsol_bit_err:"); 952 debug_text_event(adapter->erp_dbf, 3, "unsol_bit_err:");
1008 ZFCP_LOG_NORMAL("Bit error threshold data received:\n"); 953 ZFCP_LOG_NORMAL("Bit error threshold data received:\n");
1009 ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL, 954 ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,
@@ -1012,7 +957,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
1012 break; 957 break;
1013 958
1014 case FSF_STATUS_READ_LINK_DOWN: 959 case FSF_STATUS_READ_LINK_DOWN:
1015 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_LINK_DOWN\n");
1016 debug_text_event(adapter->erp_dbf, 0, "unsol_link_down:"); 960 debug_text_event(adapter->erp_dbf, 0, "unsol_link_down:");
1017 ZFCP_LOG_INFO("Local link to adapter %s is down\n", 961 ZFCP_LOG_INFO("Local link to adapter %s is down\n",
1018 zfcp_get_busid_by_adapter(adapter)); 962 zfcp_get_busid_by_adapter(adapter));
@@ -1022,7 +966,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
1022 break; 966 break;
1023 967
1024 case FSF_STATUS_READ_LINK_UP: 968 case FSF_STATUS_READ_LINK_UP:
1025 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_LINK_UP\n");
1026 debug_text_event(adapter->erp_dbf, 2, "unsol_link_up:"); 969 debug_text_event(adapter->erp_dbf, 2, "unsol_link_up:");
1027 ZFCP_LOG_INFO("Local link to adapter %s was replugged. " 970 ZFCP_LOG_INFO("Local link to adapter %s was replugged. "
1028 "Restarting operations on this adapter\n", 971 "Restarting operations on this adapter\n",
@@ -1037,7 +980,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
1037 break; 980 break;
1038 981
1039 case FSF_STATUS_READ_CFDC_UPDATED: 982 case FSF_STATUS_READ_CFDC_UPDATED:
1040 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_CFDC_UPDATED\n");
1041 debug_text_event(adapter->erp_dbf, 2, "unsol_cfdc_update:"); 983 debug_text_event(adapter->erp_dbf, 2, "unsol_cfdc_update:");
1042 ZFCP_LOG_INFO("CFDC has been updated on the adapter %s\n", 984 ZFCP_LOG_INFO("CFDC has been updated on the adapter %s\n",
1043 zfcp_get_busid_by_adapter(adapter)); 985 zfcp_get_busid_by_adapter(adapter));
@@ -1045,7 +987,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
1045 break; 987 break;
1046 988
1047 case FSF_STATUS_READ_CFDC_HARDENED: 989 case FSF_STATUS_READ_CFDC_HARDENED:
1048 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_CFDC_HARDENED\n");
1049 debug_text_event(adapter->erp_dbf, 2, "unsol_cfdc_harden:"); 990 debug_text_event(adapter->erp_dbf, 2, "unsol_cfdc_harden:");
1050 switch (status_buffer->status_subtype) { 991 switch (status_buffer->status_subtype) {
1051 case FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE: 992 case FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE:
@@ -1078,7 +1019,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
1078 break; 1019 break;
1079 } 1020 }
1080 mempool_free(status_buffer, adapter->pool.data_status_read); 1021 mempool_free(status_buffer, adapter->pool.data_status_read);
1081 zfcp_fsf_req_cleanup(fsf_req); 1022 zfcp_fsf_req_free(fsf_req);
1082 /* 1023 /*
1083 * recycle buffer and start new request repeat until outbound 1024 * recycle buffer and start new request repeat until outbound
1084 * queue is empty or adapter shutdown is requested 1025 * queue is empty or adapter shutdown is requested
@@ -1214,7 +1155,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1214 1155
1215 case FSF_PORT_HANDLE_NOT_VALID: 1156 case FSF_PORT_HANDLE_NOT_VALID:
1216 if (status_qual >> 4 != status_qual % 0xf) { 1157 if (status_qual >> 4 != status_qual % 0xf) {
1217 ZFCP_LOG_FLAGS(2, "FSF_PORT_HANDLE_NOT_VALID\n");
1218 debug_text_event(new_fsf_req->adapter->erp_dbf, 3, 1158 debug_text_event(new_fsf_req->adapter->erp_dbf, 3,
1219 "fsf_s_phand_nv0"); 1159 "fsf_s_phand_nv0");
1220 /* 1160 /*
@@ -1223,7 +1163,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1223 * fine. 1163 * fine.
1224 */ 1164 */
1225 } else { 1165 } else {
1226 ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n");
1227 ZFCP_LOG_INFO("Temporary port identifier 0x%x for " 1166 ZFCP_LOG_INFO("Temporary port identifier 0x%x for "
1228 "port 0x%016Lx on adapter %s invalid. " 1167 "port 0x%016Lx on adapter %s invalid. "
1229 "This may happen occasionally.\n", 1168 "This may happen occasionally.\n",
@@ -1246,7 +1185,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1246 case FSF_LUN_HANDLE_NOT_VALID: 1185 case FSF_LUN_HANDLE_NOT_VALID:
1247 if (status_qual >> 4 != status_qual % 0xf) { 1186 if (status_qual >> 4 != status_qual % 0xf) {
1248 /* 2 */ 1187 /* 2 */
1249 ZFCP_LOG_FLAGS(0, "FSF_LUN_HANDLE_NOT_VALID\n");
1250 debug_text_event(new_fsf_req->adapter->erp_dbf, 3, 1188 debug_text_event(new_fsf_req->adapter->erp_dbf, 3,
1251 "fsf_s_lhand_nv0"); 1189 "fsf_s_lhand_nv0");
1252 /* 1190 /*
@@ -1255,7 +1193,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1255 * This is fine. 1193 * This is fine.
1256 */ 1194 */
1257 } else { 1195 } else {
1258 ZFCP_LOG_FLAGS(1, "FSF_LUN_HANDLE_NOT_VALID\n");
1259 ZFCP_LOG_INFO 1196 ZFCP_LOG_INFO
1260 ("Warning: Temporary LUN identifier 0x%x of LUN " 1197 ("Warning: Temporary LUN identifier 0x%x of LUN "
1261 "0x%016Lx on port 0x%016Lx on adapter %s is " 1198 "0x%016Lx on port 0x%016Lx on adapter %s is "
@@ -1279,7 +1216,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1279 break; 1216 break;
1280 1217
1281 case FSF_FCP_COMMAND_DOES_NOT_EXIST: 1218 case FSF_FCP_COMMAND_DOES_NOT_EXIST:
1282 ZFCP_LOG_FLAGS(2, "FSF_FCP_COMMAND_DOES_NOT_EXIST\n");
1283 retval = 0; 1219 retval = 0;
1284 debug_text_event(new_fsf_req->adapter->erp_dbf, 3, 1220 debug_text_event(new_fsf_req->adapter->erp_dbf, 3,
1285 "fsf_s_no_exist"); 1221 "fsf_s_no_exist");
@@ -1287,50 +1223,37 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1287 break; 1223 break;
1288 1224
1289 case FSF_PORT_BOXED: 1225 case FSF_PORT_BOXED:
1290 /* 2 */
1291 ZFCP_LOG_FLAGS(0, "FSF_PORT_BOXED\n");
1292 ZFCP_LOG_INFO("Remote port 0x%016Lx on adapter %s needs to " 1226 ZFCP_LOG_INFO("Remote port 0x%016Lx on adapter %s needs to "
1293 "be reopened\n", unit->port->wwpn, 1227 "be reopened\n", unit->port->wwpn,
1294 zfcp_get_busid_by_unit(unit)); 1228 zfcp_get_busid_by_unit(unit));
1295 debug_text_event(new_fsf_req->adapter->erp_dbf, 2, 1229 debug_text_event(new_fsf_req->adapter->erp_dbf, 2,
1296 "fsf_s_pboxed"); 1230 "fsf_s_pboxed");
1297 zfcp_erp_port_reopen(unit->port, 0); 1231 zfcp_erp_port_boxed(unit->port);
1298 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR 1232 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
1299 | ZFCP_STATUS_FSFREQ_RETRY; 1233 | ZFCP_STATUS_FSFREQ_RETRY;
1300 break; 1234 break;
1301 1235
1302 case FSF_LUN_BOXED: 1236 case FSF_LUN_BOXED:
1303 ZFCP_LOG_FLAGS(0, "FSF_LUN_BOXED\n");
1304 ZFCP_LOG_INFO( 1237 ZFCP_LOG_INFO(
1305 "unit 0x%016Lx on port 0x%016Lx on adapter %s needs " 1238 "unit 0x%016Lx on port 0x%016Lx on adapter %s needs "
1306 "to be reopened\n", 1239 "to be reopened\n",
1307 unit->fcp_lun, unit->port->wwpn, 1240 unit->fcp_lun, unit->port->wwpn,
1308 zfcp_get_busid_by_unit(unit)); 1241 zfcp_get_busid_by_unit(unit));
1309 debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); 1242 debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed");
1310 zfcp_erp_unit_reopen(unit, 0); 1243 zfcp_erp_unit_boxed(unit);
1311 zfcp_cmd_dbf_event_fsf("unitbox", new_fsf_req,
1312 &new_fsf_req->qtcb->header.fsf_status_qual,
1313 sizeof(union fsf_status_qual));
1314 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR 1244 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
1315 | ZFCP_STATUS_FSFREQ_RETRY; 1245 | ZFCP_STATUS_FSFREQ_RETRY;
1316 break; 1246 break;
1317 1247
1318 case FSF_ADAPTER_STATUS_AVAILABLE: 1248 case FSF_ADAPTER_STATUS_AVAILABLE:
1319 /* 2 */
1320 ZFCP_LOG_FLAGS(0, "FSF_ADAPTER_STATUS_AVAILABLE\n");
1321 switch (new_fsf_req->qtcb->header.fsf_status_qual.word[0]) { 1249 switch (new_fsf_req->qtcb->header.fsf_status_qual.word[0]) {
1322 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 1250 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
1323 ZFCP_LOG_FLAGS(2,
1324 "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
1325 debug_text_event(new_fsf_req->adapter->erp_dbf, 1, 1251 debug_text_event(new_fsf_req->adapter->erp_dbf, 1,
1326 "fsf_sq_ltest"); 1252 "fsf_sq_ltest");
1327 /* reopening link to port */ 1253 zfcp_test_link(unit->port);
1328 zfcp_erp_port_reopen(unit->port, 0);
1329 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1254 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1330 break; 1255 break;
1331 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 1256 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
1332 ZFCP_LOG_FLAGS(2,
1333 "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
1334 /* SCSI stack will escalate */ 1257 /* SCSI stack will escalate */
1335 debug_text_event(new_fsf_req->adapter->erp_dbf, 1, 1258 debug_text_event(new_fsf_req->adapter->erp_dbf, 1,
1336 "fsf_sq_ulp"); 1259 "fsf_sq_ulp");
@@ -1350,8 +1273,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1350 break; 1273 break;
1351 1274
1352 case FSF_GOOD: 1275 case FSF_GOOD:
1353 /* 3 */
1354 ZFCP_LOG_FLAGS(0, "FSF_GOOD\n");
1355 retval = 0; 1276 retval = 0;
1356 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED; 1277 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED;
1357 break; 1278 break;
@@ -1553,12 +1474,10 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1553 switch (header->fsf_status) { 1474 switch (header->fsf_status) {
1554 1475
1555 case FSF_GOOD: 1476 case FSF_GOOD:
1556 ZFCP_LOG_FLAGS(2,"FSF_GOOD\n");
1557 retval = 0; 1477 retval = 0;
1558 break; 1478 break;
1559 1479
1560 case FSF_SERVICE_CLASS_NOT_SUPPORTED: 1480 case FSF_SERVICE_CLASS_NOT_SUPPORTED:
1561 ZFCP_LOG_FLAGS(2, "FSF_SERVICE_CLASS_NOT_SUPPORTED\n");
1562 if (adapter->fc_service_class <= 3) { 1481 if (adapter->fc_service_class <= 3) {
1563 ZFCP_LOG_INFO("error: adapter %s does not support fc " 1482 ZFCP_LOG_INFO("error: adapter %s does not support fc "
1564 "class %d.\n", 1483 "class %d.\n",
@@ -1578,17 +1497,14 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1578 break; 1497 break;
1579 1498
1580 case FSF_ADAPTER_STATUS_AVAILABLE: 1499 case FSF_ADAPTER_STATUS_AVAILABLE:
1581 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
1582 switch (header->fsf_status_qual.word[0]){ 1500 switch (header->fsf_status_qual.word[0]){
1583 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 1501 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
1584 ZFCP_LOG_FLAGS(2,"FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
1585 /* reopening link to port */ 1502 /* reopening link to port */
1586 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest"); 1503 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest");
1587 zfcp_test_link(port); 1504 zfcp_test_link(port);
1588 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1505 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1589 break; 1506 break;
1590 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 1507 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
1591 ZFCP_LOG_FLAGS(2,"FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
1592 /* ERP strategy will escalate */ 1508 /* ERP strategy will escalate */
1593 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp"); 1509 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp");
1594 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1510 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
@@ -1602,7 +1518,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1602 break; 1518 break;
1603 1519
1604 case FSF_ACCESS_DENIED: 1520 case FSF_ACCESS_DENIED:
1605 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n");
1606 ZFCP_LOG_NORMAL("access denied, cannot send generic service " 1521 ZFCP_LOG_NORMAL("access denied, cannot send generic service "
1607 "command (adapter %s, port d_id=0x%08x)\n", 1522 "command (adapter %s, port d_id=0x%08x)\n",
1608 zfcp_get_busid_by_port(port), port->d_id); 1523 zfcp_get_busid_by_port(port), port->d_id);
@@ -1625,7 +1540,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1625 break; 1540 break;
1626 1541
1627 case FSF_GENERIC_COMMAND_REJECTED: 1542 case FSF_GENERIC_COMMAND_REJECTED:
1628 ZFCP_LOG_FLAGS(2, "FSF_GENERIC_COMMAND_REJECTED\n");
1629 ZFCP_LOG_INFO("generic service command rejected " 1543 ZFCP_LOG_INFO("generic service command rejected "
1630 "(adapter %s, port d_id=0x%08x)\n", 1544 "(adapter %s, port d_id=0x%08x)\n",
1631 zfcp_get_busid_by_port(port), port->d_id); 1545 zfcp_get_busid_by_port(port), port->d_id);
@@ -1638,7 +1552,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1638 break; 1552 break;
1639 1553
1640 case FSF_PORT_HANDLE_NOT_VALID: 1554 case FSF_PORT_HANDLE_NOT_VALID:
1641 ZFCP_LOG_FLAGS(2, "FSF_PORT_HANDLE_NOT_VALID\n");
1642 ZFCP_LOG_DEBUG("Temporary port identifier 0x%x for port " 1555 ZFCP_LOG_DEBUG("Temporary port identifier 0x%x for port "
1643 "0x%016Lx on adapter %s invalid. This may " 1556 "0x%016Lx on adapter %s invalid. This may "
1644 "happen occasionally.\n", port->handle, 1557 "happen occasionally.\n", port->handle,
@@ -1653,12 +1566,11 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1653 break; 1566 break;
1654 1567
1655 case FSF_PORT_BOXED: 1568 case FSF_PORT_BOXED:
1656 ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n");
1657 ZFCP_LOG_INFO("port needs to be reopened " 1569 ZFCP_LOG_INFO("port needs to be reopened "
1658 "(adapter %s, port d_id=0x%08x)\n", 1570 "(adapter %s, port d_id=0x%08x)\n",
1659 zfcp_get_busid_by_port(port), port->d_id); 1571 zfcp_get_busid_by_port(port), port->d_id);
1660 debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); 1572 debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed");
1661 zfcp_erp_port_reopen(port, 0); 1573 zfcp_erp_port_boxed(port);
1662 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR 1574 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
1663 | ZFCP_STATUS_FSFREQ_RETRY; 1575 | ZFCP_STATUS_FSFREQ_RETRY;
1664 break; 1576 break;
@@ -1666,7 +1578,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1666 /* following states should never occure, all cases avoided 1578 /* following states should never occure, all cases avoided
1667 in zfcp_fsf_send_ct - but who knows ... */ 1579 in zfcp_fsf_send_ct - but who knows ... */
1668 case FSF_PAYLOAD_SIZE_MISMATCH: 1580 case FSF_PAYLOAD_SIZE_MISMATCH:
1669 ZFCP_LOG_FLAGS(2, "FSF_PAYLOAD_SIZE_MISMATCH\n");
1670 ZFCP_LOG_INFO("payload size mismatch (adapter: %s, " 1581 ZFCP_LOG_INFO("payload size mismatch (adapter: %s, "
1671 "req_buf_length=%d, resp_buf_length=%d)\n", 1582 "req_buf_length=%d, resp_buf_length=%d)\n",
1672 zfcp_get_busid_by_adapter(adapter), 1583 zfcp_get_busid_by_adapter(adapter),
@@ -1674,7 +1585,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1674 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1585 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1675 break; 1586 break;
1676 case FSF_REQUEST_SIZE_TOO_LARGE: 1587 case FSF_REQUEST_SIZE_TOO_LARGE:
1677 ZFCP_LOG_FLAGS(2, "FSF_REQUEST_SIZE_TOO_LARGE\n");
1678 ZFCP_LOG_INFO("request size too large (adapter: %s, " 1588 ZFCP_LOG_INFO("request size too large (adapter: %s, "
1679 "req_buf_length=%d)\n", 1589 "req_buf_length=%d)\n",
1680 zfcp_get_busid_by_adapter(adapter), 1590 zfcp_get_busid_by_adapter(adapter),
@@ -1682,7 +1592,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1682 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1592 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1683 break; 1593 break;
1684 case FSF_RESPONSE_SIZE_TOO_LARGE: 1594 case FSF_RESPONSE_SIZE_TOO_LARGE:
1685 ZFCP_LOG_FLAGS(2, "FSF_RESPONSE_SIZE_TOO_LARGE\n");
1686 ZFCP_LOG_INFO("response size too large (adapter: %s, " 1595 ZFCP_LOG_INFO("response size too large (adapter: %s, "
1687 "resp_buf_length=%d)\n", 1596 "resp_buf_length=%d)\n",
1688 zfcp_get_busid_by_adapter(adapter), 1597 zfcp_get_busid_by_adapter(adapter),
@@ -1690,7 +1599,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1690 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1599 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1691 break; 1600 break;
1692 case FSF_SBAL_MISMATCH: 1601 case FSF_SBAL_MISMATCH:
1693 ZFCP_LOG_FLAGS(2, "FSF_SBAL_MISMATCH\n");
1694 ZFCP_LOG_INFO("SBAL mismatch (adapter: %s, req_buf_length=%d, " 1602 ZFCP_LOG_INFO("SBAL mismatch (adapter: %s, req_buf_length=%d, "
1695 "resp_buf_length=%d)\n", 1603 "resp_buf_length=%d)\n",
1696 zfcp_get_busid_by_adapter(adapter), 1604 zfcp_get_busid_by_adapter(adapter),
@@ -1846,8 +1754,8 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
1846static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) 1754static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1847{ 1755{
1848 struct zfcp_adapter *adapter; 1756 struct zfcp_adapter *adapter;
1849 fc_id_t d_id;
1850 struct zfcp_port *port; 1757 struct zfcp_port *port;
1758 fc_id_t d_id;
1851 struct fsf_qtcb_header *header; 1759 struct fsf_qtcb_header *header;
1852 struct fsf_qtcb_bottom_support *bottom; 1760 struct fsf_qtcb_bottom_support *bottom;
1853 struct zfcp_send_els *send_els; 1761 struct zfcp_send_els *send_els;
@@ -1856,6 +1764,7 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1856 1764
1857 send_els = fsf_req->data.send_els; 1765 send_els = fsf_req->data.send_els;
1858 adapter = send_els->adapter; 1766 adapter = send_els->adapter;
1767 port = send_els->port;
1859 d_id = send_els->d_id; 1768 d_id = send_els->d_id;
1860 header = &fsf_req->qtcb->header; 1769 header = &fsf_req->qtcb->header;
1861 bottom = &fsf_req->qtcb->bottom.support; 1770 bottom = &fsf_req->qtcb->bottom.support;
@@ -1866,12 +1775,10 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1866 switch (header->fsf_status) { 1775 switch (header->fsf_status) {
1867 1776
1868 case FSF_GOOD: 1777 case FSF_GOOD:
1869 ZFCP_LOG_FLAGS(2, "FSF_GOOD\n");
1870 retval = 0; 1778 retval = 0;
1871 break; 1779 break;
1872 1780
1873 case FSF_SERVICE_CLASS_NOT_SUPPORTED: 1781 case FSF_SERVICE_CLASS_NOT_SUPPORTED:
1874 ZFCP_LOG_FLAGS(2, "FSF_SERVICE_CLASS_NOT_SUPPORTED\n");
1875 if (adapter->fc_service_class <= 3) { 1782 if (adapter->fc_service_class <= 3) {
1876 ZFCP_LOG_INFO("error: adapter %s does " 1783 ZFCP_LOG_INFO("error: adapter %s does "
1877 "not support fibrechannel class %d.\n", 1784 "not support fibrechannel class %d.\n",
@@ -1891,22 +1798,14 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1891 break; 1798 break;
1892 1799
1893 case FSF_ADAPTER_STATUS_AVAILABLE: 1800 case FSF_ADAPTER_STATUS_AVAILABLE:
1894 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
1895 switch (header->fsf_status_qual.word[0]){ 1801 switch (header->fsf_status_qual.word[0]){
1896 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 1802 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
1897 ZFCP_LOG_FLAGS(2,"FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
1898 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest"); 1803 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest");
1899 if (send_els->ls_code != ZFCP_LS_ADISC) { 1804 if (port && (send_els->ls_code != ZFCP_LS_ADISC))
1900 read_lock(&zfcp_data.config_lock); 1805 zfcp_test_link(port);
1901 port = zfcp_get_port_by_did(adapter, d_id);
1902 if (port)
1903 zfcp_test_link(port);
1904 read_unlock(&zfcp_data.config_lock);
1905 }
1906 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1806 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1907 break; 1807 break;
1908 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 1808 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
1909 ZFCP_LOG_FLAGS(2,"FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
1910 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp"); 1809 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp");
1911 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1810 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1912 retval = 1811 retval =
@@ -1915,7 +1814,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1915 &header->fsf_status_qual.word[2]); 1814 &header->fsf_status_qual.word[2]);
1916 break; 1815 break;
1917 case FSF_SQ_RETRY_IF_POSSIBLE: 1816 case FSF_SQ_RETRY_IF_POSSIBLE:
1918 ZFCP_LOG_FLAGS(2, "FSF_SQ_RETRY_IF_POSSIBLE\n");
1919 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_retry"); 1817 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_retry");
1920 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1818 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1921 break; 1819 break;
@@ -1928,7 +1826,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1928 break; 1826 break;
1929 1827
1930 case FSF_ELS_COMMAND_REJECTED: 1828 case FSF_ELS_COMMAND_REJECTED:
1931 ZFCP_LOG_FLAGS(2, "FSF_ELS_COMMAND_REJECTED\n");
1932 ZFCP_LOG_INFO("ELS has been rejected because command filter " 1829 ZFCP_LOG_INFO("ELS has been rejected because command filter "
1933 "prohibited sending " 1830 "prohibited sending "
1934 "(adapter: %s, port d_id: 0x%08x)\n", 1831 "(adapter: %s, port d_id: 0x%08x)\n",
@@ -1937,7 +1834,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1937 break; 1834 break;
1938 1835
1939 case FSF_PAYLOAD_SIZE_MISMATCH: 1836 case FSF_PAYLOAD_SIZE_MISMATCH:
1940 ZFCP_LOG_FLAGS(2, "FSF_PAYLOAD_SIZE_MISMATCH\n");
1941 ZFCP_LOG_INFO( 1837 ZFCP_LOG_INFO(
1942 "ELS request size and ELS response size must be either " 1838 "ELS request size and ELS response size must be either "
1943 "both 0, or both greater than 0 " 1839 "both 0, or both greater than 0 "
@@ -1948,7 +1844,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1948 break; 1844 break;
1949 1845
1950 case FSF_REQUEST_SIZE_TOO_LARGE: 1846 case FSF_REQUEST_SIZE_TOO_LARGE:
1951 ZFCP_LOG_FLAGS(2, "FSF_REQUEST_SIZE_TOO_LARGE\n");
1952 ZFCP_LOG_INFO( 1847 ZFCP_LOG_INFO(
1953 "Length of the ELS request buffer, " 1848 "Length of the ELS request buffer, "
1954 "specified in QTCB bottom, " 1849 "specified in QTCB bottom, "
@@ -1960,7 +1855,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1960 break; 1855 break;
1961 1856
1962 case FSF_RESPONSE_SIZE_TOO_LARGE: 1857 case FSF_RESPONSE_SIZE_TOO_LARGE:
1963 ZFCP_LOG_FLAGS(2, "FSF_RESPONSE_SIZE_TOO_LARGE\n");
1964 ZFCP_LOG_INFO( 1858 ZFCP_LOG_INFO(
1965 "Length of the ELS response buffer, " 1859 "Length of the ELS response buffer, "
1966 "specified in QTCB bottom, " 1860 "specified in QTCB bottom, "
@@ -1973,7 +1867,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1973 1867
1974 case FSF_SBAL_MISMATCH: 1868 case FSF_SBAL_MISMATCH:
1975 /* should never occure, avoided in zfcp_fsf_send_els */ 1869 /* should never occure, avoided in zfcp_fsf_send_els */
1976 ZFCP_LOG_FLAGS(2, "FSF_SBAL_MISMATCH\n");
1977 ZFCP_LOG_INFO("SBAL mismatch (adapter: %s, req_buf_length=%d, " 1870 ZFCP_LOG_INFO("SBAL mismatch (adapter: %s, req_buf_length=%d, "
1978 "resp_buf_length=%d)\n", 1871 "resp_buf_length=%d)\n",
1979 zfcp_get_busid_by_adapter(adapter), 1872 zfcp_get_busid_by_adapter(adapter),
@@ -1982,7 +1875,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1982 break; 1875 break;
1983 1876
1984 case FSF_ACCESS_DENIED: 1877 case FSF_ACCESS_DENIED:
1985 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n");
1986 ZFCP_LOG_NORMAL("access denied, cannot send ELS command " 1878 ZFCP_LOG_NORMAL("access denied, cannot send ELS command "
1987 "(adapter %s, port d_id=0x%08x)\n", 1879 "(adapter %s, port d_id=0x%08x)\n",
1988 zfcp_get_busid_by_adapter(adapter), d_id); 1880 zfcp_get_busid_by_adapter(adapter), d_id);
@@ -2000,11 +1892,8 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
2000 } 1892 }
2001 } 1893 }
2002 debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); 1894 debug_text_event(adapter->erp_dbf, 1, "fsf_s_access");
2003 read_lock(&zfcp_data.config_lock);
2004 port = zfcp_get_port_by_did(adapter, d_id);
2005 if (port != NULL) 1895 if (port != NULL)
2006 zfcp_erp_port_access_denied(port); 1896 zfcp_erp_port_access_denied(port);
2007 read_unlock(&zfcp_data.config_lock);
2008 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1897 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2009 break; 1898 break;
2010 1899
@@ -2195,14 +2084,11 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req)
2195 switch (fsf_req->qtcb->header.fsf_status) { 2084 switch (fsf_req->qtcb->header.fsf_status) {
2196 2085
2197 case FSF_GOOD: 2086 case FSF_GOOD:
2198 ZFCP_LOG_FLAGS(2, "FSF_GOOD\n");
2199
2200 if (zfcp_fsf_exchange_config_evaluate(fsf_req, 1)) 2087 if (zfcp_fsf_exchange_config_evaluate(fsf_req, 1))
2201 return -EIO; 2088 return -EIO;
2202 2089
2203 switch (adapter->fc_topology) { 2090 switch (adapter->fc_topology) {
2204 case FSF_TOPO_P2P: 2091 case FSF_TOPO_P2P:
2205 ZFCP_LOG_FLAGS(1, "FSF_TOPO_P2P\n");
2206 ZFCP_LOG_NORMAL("Point-to-Point fibrechannel " 2092 ZFCP_LOG_NORMAL("Point-to-Point fibrechannel "
2207 "configuration detected at adapter %s\n" 2093 "configuration detected at adapter %s\n"
2208 "Peer WWNN 0x%016llx, " 2094 "Peer WWNN 0x%016llx, "
@@ -2216,7 +2102,6 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req)
2216 "top-p-to-p"); 2102 "top-p-to-p");
2217 break; 2103 break;
2218 case FSF_TOPO_AL: 2104 case FSF_TOPO_AL:
2219 ZFCP_LOG_FLAGS(1, "FSF_TOPO_AL\n");
2220 ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " 2105 ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel "
2221 "topology detected at adapter %s " 2106 "topology detected at adapter %s "
2222 "unsupported, shutting down adapter\n", 2107 "unsupported, shutting down adapter\n",
@@ -2226,7 +2111,6 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req)
2226 zfcp_erp_adapter_shutdown(adapter, 0); 2111 zfcp_erp_adapter_shutdown(adapter, 0);
2227 return -EIO; 2112 return -EIO;
2228 case FSF_TOPO_FABRIC: 2113 case FSF_TOPO_FABRIC:
2229 ZFCP_LOG_FLAGS(1, "FSF_TOPO_FABRIC\n");
2230 ZFCP_LOG_INFO("Switched fabric fibrechannel " 2114 ZFCP_LOG_INFO("Switched fabric fibrechannel "
2231 "network detected at adapter %s.\n", 2115 "network detected at adapter %s.\n",
2232 zfcp_get_busid_by_adapter(adapter)); 2116 zfcp_get_busid_by_adapter(adapter));
@@ -2357,7 +2241,7 @@ zfcp_fsf_exchange_port_data(struct zfcp_adapter *adapter,
2357 wait_event(fsf_req->completion_wq, 2241 wait_event(fsf_req->completion_wq,
2358 fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); 2242 fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED);
2359 del_timer_sync(timer); 2243 del_timer_sync(timer);
2360 zfcp_fsf_req_cleanup(fsf_req); 2244 zfcp_fsf_req_free(fsf_req);
2361 out: 2245 out:
2362 kfree(timer); 2246 kfree(timer);
2363 return retval; 2247 return retval;
@@ -2379,7 +2263,6 @@ zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req)
2379 2263
2380 switch (fsf_req->qtcb->header.fsf_status) { 2264 switch (fsf_req->qtcb->header.fsf_status) {
2381 case FSF_GOOD: 2265 case FSF_GOOD:
2382 ZFCP_LOG_FLAGS(2,"FSF_GOOD\n");
2383 bottom = &fsf_req->qtcb->bottom.port; 2266 bottom = &fsf_req->qtcb->bottom.port;
2384 memcpy(data, bottom, sizeof(*data)); 2267 memcpy(data, bottom, sizeof(*data));
2385 break; 2268 break;
@@ -2481,7 +2364,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2481 switch (header->fsf_status) { 2364 switch (header->fsf_status) {
2482 2365
2483 case FSF_PORT_ALREADY_OPEN: 2366 case FSF_PORT_ALREADY_OPEN:
2484 ZFCP_LOG_FLAGS(0, "FSF_PORT_ALREADY_OPEN\n");
2485 ZFCP_LOG_NORMAL("bug: remote port 0x%016Lx on adapter %s " 2367 ZFCP_LOG_NORMAL("bug: remote port 0x%016Lx on adapter %s "
2486 "is already open.\n", 2368 "is already open.\n",
2487 port->wwpn, zfcp_get_busid_by_port(port)); 2369 port->wwpn, zfcp_get_busid_by_port(port));
@@ -2494,7 +2376,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2494 break; 2376 break;
2495 2377
2496 case FSF_ACCESS_DENIED: 2378 case FSF_ACCESS_DENIED:
2497 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n");
2498 ZFCP_LOG_NORMAL("Access denied, cannot open port 0x%016Lx " 2379 ZFCP_LOG_NORMAL("Access denied, cannot open port 0x%016Lx "
2499 "on adapter %s\n", 2380 "on adapter %s\n",
2500 port->wwpn, zfcp_get_busid_by_port(port)); 2381 port->wwpn, zfcp_get_busid_by_port(port));
@@ -2517,7 +2398,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2517 break; 2398 break;
2518 2399
2519 case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED: 2400 case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED:
2520 ZFCP_LOG_FLAGS(1, "FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED\n");
2521 ZFCP_LOG_INFO("error: The FSF adapter is out of resources. " 2401 ZFCP_LOG_INFO("error: The FSF adapter is out of resources. "
2522 "The remote port 0x%016Lx on adapter %s " 2402 "The remote port 0x%016Lx on adapter %s "
2523 "could not be opened. Disabling it.\n", 2403 "could not be opened. Disabling it.\n",
@@ -2529,11 +2409,8 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2529 break; 2409 break;
2530 2410
2531 case FSF_ADAPTER_STATUS_AVAILABLE: 2411 case FSF_ADAPTER_STATUS_AVAILABLE:
2532 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
2533 switch (header->fsf_status_qual.word[0]) { 2412 switch (header->fsf_status_qual.word[0]) {
2534 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 2413 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
2535 ZFCP_LOG_FLAGS(2,
2536 "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
2537 debug_text_event(fsf_req->adapter->erp_dbf, 1, 2414 debug_text_event(fsf_req->adapter->erp_dbf, 1,
2538 "fsf_sq_ltest"); 2415 "fsf_sq_ltest");
2539 /* ERP strategy will escalate */ 2416 /* ERP strategy will escalate */
@@ -2546,7 +2423,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2546 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 2423 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2547 break; 2424 break;
2548 case FSF_SQ_NO_RETRY_POSSIBLE: 2425 case FSF_SQ_NO_RETRY_POSSIBLE:
2549 ZFCP_LOG_FLAGS(0, "FSF_SQ_NO_RETRY_POSSIBLE\n");
2550 ZFCP_LOG_NORMAL("The remote port 0x%016Lx on " 2426 ZFCP_LOG_NORMAL("The remote port 0x%016Lx on "
2551 "adapter %s could not be opened. " 2427 "adapter %s could not be opened. "
2552 "Disabling it.\n", 2428 "Disabling it.\n",
@@ -2572,7 +2448,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2572 break; 2448 break;
2573 2449
2574 case FSF_GOOD: 2450 case FSF_GOOD:
2575 ZFCP_LOG_FLAGS(3, "FSF_GOOD\n");
2576 /* save port handle assigned by FSF */ 2451 /* save port handle assigned by FSF */
2577 port->handle = header->port_handle; 2452 port->handle = header->port_handle;
2578 ZFCP_LOG_INFO("The remote port 0x%016Lx via adapter %s " 2453 ZFCP_LOG_INFO("The remote port 0x%016Lx via adapter %s "
@@ -2582,6 +2457,9 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2582 /* mark port as open */ 2457 /* mark port as open */
2583 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN | 2458 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN |
2584 ZFCP_STATUS_PORT_PHYS_OPEN, &port->status); 2459 ZFCP_STATUS_PORT_PHYS_OPEN, &port->status);
2460 atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED |
2461 ZFCP_STATUS_COMMON_ACCESS_BOXED,
2462 &port->status);
2585 retval = 0; 2463 retval = 0;
2586 /* check whether D_ID has changed during open */ 2464 /* check whether D_ID has changed during open */
2587 /* 2465 /*
@@ -2630,7 +2508,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2630 2508
2631 case FSF_UNKNOWN_OP_SUBTYPE: 2509 case FSF_UNKNOWN_OP_SUBTYPE:
2632 /* should never occure, subtype not set in zfcp_fsf_open_port */ 2510 /* should never occure, subtype not set in zfcp_fsf_open_port */
2633 ZFCP_LOG_FLAGS(2, "FSF_UNKNOWN_OP_SUBTYPE\n");
2634 ZFCP_LOG_INFO("unknown operation subtype (adapter: %s, " 2511 ZFCP_LOG_INFO("unknown operation subtype (adapter: %s, "
2635 "op_subtype=0x%x)\n", 2512 "op_subtype=0x%x)\n",
2636 zfcp_get_busid_by_port(port), 2513 zfcp_get_busid_by_port(port),
@@ -2739,7 +2616,6 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req)
2739 switch (fsf_req->qtcb->header.fsf_status) { 2616 switch (fsf_req->qtcb->header.fsf_status) {
2740 2617
2741 case FSF_PORT_HANDLE_NOT_VALID: 2618 case FSF_PORT_HANDLE_NOT_VALID:
2742 ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n");
2743 ZFCP_LOG_INFO("Temporary port identifier 0x%x for port " 2619 ZFCP_LOG_INFO("Temporary port identifier 0x%x for port "
2744 "0x%016Lx on adapter %s invalid. This may happen " 2620 "0x%016Lx on adapter %s invalid. This may happen "
2745 "occasionally.\n", port->handle, 2621 "occasionally.\n", port->handle,
@@ -2755,7 +2631,6 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req)
2755 break; 2631 break;
2756 2632
2757 case FSF_ADAPTER_STATUS_AVAILABLE: 2633 case FSF_ADAPTER_STATUS_AVAILABLE:
2758 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
2759 /* Note: FSF has actually closed the port in this case. 2634 /* Note: FSF has actually closed the port in this case.
2760 * The status code is just daft. Fingers crossed for a change 2635 * The status code is just daft. Fingers crossed for a change
2761 */ 2636 */
@@ -2763,7 +2638,6 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req)
2763 break; 2638 break;
2764 2639
2765 case FSF_GOOD: 2640 case FSF_GOOD:
2766 ZFCP_LOG_FLAGS(3, "FSF_GOOD\n");
2767 ZFCP_LOG_TRACE("remote port 0x016%Lx on adapter %s closed, " 2641 ZFCP_LOG_TRACE("remote port 0x016%Lx on adapter %s closed, "
2768 "port handle 0x%x\n", port->wwpn, 2642 "port handle 0x%x\n", port->wwpn,
2769 zfcp_get_busid_by_port(port), port->handle); 2643 zfcp_get_busid_by_port(port), port->handle);
@@ -2884,7 +2758,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req)
2884 switch (header->fsf_status) { 2758 switch (header->fsf_status) {
2885 2759
2886 case FSF_PORT_HANDLE_NOT_VALID: 2760 case FSF_PORT_HANDLE_NOT_VALID:
2887 ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n");
2888 ZFCP_LOG_INFO("Temporary port identifier 0x%x invalid" 2761 ZFCP_LOG_INFO("Temporary port identifier 0x%x invalid"
2889 "(adapter %s, port 0x%016Lx). " 2762 "(adapter %s, port 0x%016Lx). "
2890 "This may happen occasionally.\n", 2763 "This may happen occasionally.\n",
@@ -2902,7 +2775,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req)
2902 break; 2775 break;
2903 2776
2904 case FSF_ACCESS_DENIED: 2777 case FSF_ACCESS_DENIED:
2905 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n");
2906 ZFCP_LOG_NORMAL("Access denied, cannot close " 2778 ZFCP_LOG_NORMAL("Access denied, cannot close "
2907 "physical port 0x%016Lx on adapter %s\n", 2779 "physical port 0x%016Lx on adapter %s\n",
2908 port->wwpn, zfcp_get_busid_by_port(port)); 2780 port->wwpn, zfcp_get_busid_by_port(port));
@@ -2925,32 +2797,26 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req)
2925 break; 2797 break;
2926 2798
2927 case FSF_PORT_BOXED: 2799 case FSF_PORT_BOXED:
2928 ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n");
2929 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter " 2800 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter "
2930 "%s needs to be reopened but it was attempted " 2801 "%s needs to be reopened but it was attempted "
2931 "to close it physically.\n", 2802 "to close it physically.\n",
2932 port->wwpn, 2803 port->wwpn,
2933 zfcp_get_busid_by_port(port)); 2804 zfcp_get_busid_by_port(port));
2934 debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_pboxed"); 2805 debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_pboxed");
2935 zfcp_erp_port_reopen(port, 0); 2806 zfcp_erp_port_boxed(port);
2936 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 2807 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
2937 ZFCP_STATUS_FSFREQ_RETRY; 2808 ZFCP_STATUS_FSFREQ_RETRY;
2938 break; 2809 break;
2939 2810
2940 case FSF_ADAPTER_STATUS_AVAILABLE: 2811 case FSF_ADAPTER_STATUS_AVAILABLE:
2941 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
2942 switch (header->fsf_status_qual.word[0]) { 2812 switch (header->fsf_status_qual.word[0]) {
2943 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 2813 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
2944 ZFCP_LOG_FLAGS(2,
2945 "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
2946 debug_text_event(fsf_req->adapter->erp_dbf, 1, 2814 debug_text_event(fsf_req->adapter->erp_dbf, 1,
2947 "fsf_sq_ltest"); 2815 "fsf_sq_ltest");
2948 /* This will now be escalated by ERP */ 2816 /* This will now be escalated by ERP */
2949 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 2817 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2950 break; 2818 break;
2951 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 2819 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
2952 ZFCP_LOG_FLAGS(2,
2953 "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
2954 /* ERP strategy will escalate */ 2820 /* ERP strategy will escalate */
2955 debug_text_event(fsf_req->adapter->erp_dbf, 1, 2821 debug_text_event(fsf_req->adapter->erp_dbf, 1,
2956 "fsf_sq_ulp"); 2822 "fsf_sq_ulp");
@@ -2970,7 +2836,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req)
2970 break; 2836 break;
2971 2837
2972 case FSF_GOOD: 2838 case FSF_GOOD:
2973 ZFCP_LOG_FLAGS(3, "FSF_GOOD\n");
2974 ZFCP_LOG_DEBUG("Remote port 0x%016Lx via adapter %s " 2839 ZFCP_LOG_DEBUG("Remote port 0x%016Lx via adapter %s "
2975 "physically closed, port handle 0x%x\n", 2840 "physically closed, port handle 0x%x\n",
2976 port->wwpn, 2841 port->wwpn,
@@ -3116,7 +2981,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3116 switch (header->fsf_status) { 2981 switch (header->fsf_status) {
3117 2982
3118 case FSF_PORT_HANDLE_NOT_VALID: 2983 case FSF_PORT_HANDLE_NOT_VALID:
3119 ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n");
3120 ZFCP_LOG_INFO("Temporary port identifier 0x%x " 2984 ZFCP_LOG_INFO("Temporary port identifier 0x%x "
3121 "for port 0x%016Lx on adapter %s invalid " 2985 "for port 0x%016Lx on adapter %s invalid "
3122 "This may happen occasionally\n", 2986 "This may happen occasionally\n",
@@ -3132,7 +2996,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3132 break; 2996 break;
3133 2997
3134 case FSF_LUN_ALREADY_OPEN: 2998 case FSF_LUN_ALREADY_OPEN:
3135 ZFCP_LOG_FLAGS(0, "FSF_LUN_ALREADY_OPEN\n");
3136 ZFCP_LOG_NORMAL("bug: Attempted to open unit 0x%016Lx on " 2999 ZFCP_LOG_NORMAL("bug: Attempted to open unit 0x%016Lx on "
3137 "remote port 0x%016Lx on adapter %s twice.\n", 3000 "remote port 0x%016Lx on adapter %s twice.\n",
3138 unit->fcp_lun, 3001 unit->fcp_lun,
@@ -3143,7 +3006,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3143 break; 3006 break;
3144 3007
3145 case FSF_ACCESS_DENIED: 3008 case FSF_ACCESS_DENIED:
3146 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n");
3147 ZFCP_LOG_NORMAL("Access denied, cannot open unit 0x%016Lx on " 3009 ZFCP_LOG_NORMAL("Access denied, cannot open unit 0x%016Lx on "
3148 "remote port 0x%016Lx on adapter %s\n", 3010 "remote port 0x%016Lx on adapter %s\n",
3149 unit->fcp_lun, unit->port->wwpn, 3011 unit->fcp_lun, unit->port->wwpn,
@@ -3169,18 +3031,16 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3169 break; 3031 break;
3170 3032
3171 case FSF_PORT_BOXED: 3033 case FSF_PORT_BOXED:
3172 ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n");
3173 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s " 3034 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s "
3174 "needs to be reopened\n", 3035 "needs to be reopened\n",
3175 unit->port->wwpn, zfcp_get_busid_by_unit(unit)); 3036 unit->port->wwpn, zfcp_get_busid_by_unit(unit));
3176 debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); 3037 debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed");
3177 zfcp_erp_port_reopen(unit->port, 0); 3038 zfcp_erp_port_boxed(unit->port);
3178 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 3039 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
3179 ZFCP_STATUS_FSFREQ_RETRY; 3040 ZFCP_STATUS_FSFREQ_RETRY;
3180 break; 3041 break;
3181 3042
3182 case FSF_LUN_SHARING_VIOLATION: 3043 case FSF_LUN_SHARING_VIOLATION:
3183 ZFCP_LOG_FLAGS(2, "FSF_LUN_SHARING_VIOLATION\n");
3184 if (header->fsf_status_qual.word[0] != 0) { 3044 if (header->fsf_status_qual.word[0] != 0) {
3185 ZFCP_LOG_NORMAL("FCP-LUN 0x%Lx at the remote port " 3045 ZFCP_LOG_NORMAL("FCP-LUN 0x%Lx at the remote port "
3186 "with WWPN 0x%Lx " 3046 "with WWPN 0x%Lx "
@@ -3224,7 +3084,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3224 break; 3084 break;
3225 3085
3226 case FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED: 3086 case FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED:
3227 ZFCP_LOG_FLAGS(1, "FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED\n");
3228 ZFCP_LOG_INFO("error: The adapter ran out of resources. " 3087 ZFCP_LOG_INFO("error: The adapter ran out of resources. "
3229 "There is no handle (temporary port identifier) " 3088 "There is no handle (temporary port identifier) "
3230 "available for unit 0x%016Lx on port 0x%016Lx " 3089 "available for unit 0x%016Lx on port 0x%016Lx "
@@ -3239,20 +3098,15 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3239 break; 3098 break;
3240 3099
3241 case FSF_ADAPTER_STATUS_AVAILABLE: 3100 case FSF_ADAPTER_STATUS_AVAILABLE:
3242 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
3243 switch (header->fsf_status_qual.word[0]) { 3101 switch (header->fsf_status_qual.word[0]) {
3244 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 3102 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
3245 ZFCP_LOG_FLAGS(2,
3246 "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
3247 /* Re-establish link to port */ 3103 /* Re-establish link to port */
3248 debug_text_event(adapter->erp_dbf, 1, 3104 debug_text_event(adapter->erp_dbf, 1,
3249 "fsf_sq_ltest"); 3105 "fsf_sq_ltest");
3250 zfcp_erp_port_reopen(unit->port, 0); 3106 zfcp_test_link(unit->port);
3251 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 3107 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
3252 break; 3108 break;
3253 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 3109 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
3254 ZFCP_LOG_FLAGS(2,
3255 "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
3256 /* ERP strategy will escalate */ 3110 /* ERP strategy will escalate */
3257 debug_text_event(adapter->erp_dbf, 1, 3111 debug_text_event(adapter->erp_dbf, 1,
3258 "fsf_sq_ulp"); 3112 "fsf_sq_ulp");
@@ -3271,7 +3125,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3271 break; 3125 break;
3272 3126
3273 case FSF_INVALID_COMMAND_OPTION: 3127 case FSF_INVALID_COMMAND_OPTION:
3274 ZFCP_LOG_FLAGS(2, "FSF_INVALID_COMMAND_OPTION\n");
3275 ZFCP_LOG_NORMAL( 3128 ZFCP_LOG_NORMAL(
3276 "Invalid option 0x%x has been specified " 3129 "Invalid option 0x%x has been specified "
3277 "in QTCB bottom sent to the adapter %s\n", 3130 "in QTCB bottom sent to the adapter %s\n",
@@ -3282,7 +3135,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3282 break; 3135 break;
3283 3136
3284 case FSF_GOOD: 3137 case FSF_GOOD:
3285 ZFCP_LOG_FLAGS(3, "FSF_GOOD\n");
3286 /* save LUN handle assigned by FSF */ 3138 /* save LUN handle assigned by FSF */
3287 unit->handle = header->lun_handle; 3139 unit->handle = header->lun_handle;
3288 ZFCP_LOG_TRACE("unit 0x%016Lx on remote port 0x%016Lx on " 3140 ZFCP_LOG_TRACE("unit 0x%016Lx on remote port 0x%016Lx on "
@@ -3293,7 +3145,9 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3293 unit->handle); 3145 unit->handle);
3294 /* mark unit as open */ 3146 /* mark unit as open */
3295 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status); 3147 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status);
3296 3148 atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED |
3149 ZFCP_STATUS_COMMON_ACCESS_BOXED,
3150 &unit->status);
3297 if (adapter->supported_features & FSF_FEATURE_LUN_SHARING){ 3151 if (adapter->supported_features & FSF_FEATURE_LUN_SHARING){
3298 if (!exclusive) 3152 if (!exclusive)
3299 atomic_set_mask(ZFCP_STATUS_UNIT_SHARED, 3153 atomic_set_mask(ZFCP_STATUS_UNIT_SHARED,
@@ -3437,7 +3291,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req)
3437 switch (fsf_req->qtcb->header.fsf_status) { 3291 switch (fsf_req->qtcb->header.fsf_status) {
3438 3292
3439 case FSF_PORT_HANDLE_NOT_VALID: 3293 case FSF_PORT_HANDLE_NOT_VALID:
3440 ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n");
3441 ZFCP_LOG_INFO("Temporary port identifier 0x%x for port " 3294 ZFCP_LOG_INFO("Temporary port identifier 0x%x for port "
3442 "0x%016Lx on adapter %s invalid. This may " 3295 "0x%016Lx on adapter %s invalid. This may "
3443 "happen in rare circumstances\n", 3296 "happen in rare circumstances\n",
@@ -3458,7 +3311,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req)
3458 break; 3311 break;
3459 3312
3460 case FSF_LUN_HANDLE_NOT_VALID: 3313 case FSF_LUN_HANDLE_NOT_VALID:
3461 ZFCP_LOG_FLAGS(1, "FSF_LUN_HANDLE_NOT_VALID\n");
3462 ZFCP_LOG_INFO("Temporary LUN identifier 0x%x of unit " 3314 ZFCP_LOG_INFO("Temporary LUN identifier 0x%x of unit "
3463 "0x%016Lx on port 0x%016Lx on adapter %s is " 3315 "0x%016Lx on port 0x%016Lx on adapter %s is "
3464 "invalid. This may happen occasionally.\n", 3316 "invalid. This may happen occasionally.\n",
@@ -3480,32 +3332,26 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req)
3480 break; 3332 break;
3481 3333
3482 case FSF_PORT_BOXED: 3334 case FSF_PORT_BOXED:
3483 ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n");
3484 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s " 3335 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s "
3485 "needs to be reopened\n", 3336 "needs to be reopened\n",
3486 unit->port->wwpn, 3337 unit->port->wwpn,
3487 zfcp_get_busid_by_unit(unit)); 3338 zfcp_get_busid_by_unit(unit));
3488 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); 3339 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed");
3489 zfcp_erp_port_reopen(unit->port, 0); 3340 zfcp_erp_port_boxed(unit->port);
3490 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 3341 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
3491 ZFCP_STATUS_FSFREQ_RETRY; 3342 ZFCP_STATUS_FSFREQ_RETRY;
3492 break; 3343 break;
3493 3344
3494 case FSF_ADAPTER_STATUS_AVAILABLE: 3345 case FSF_ADAPTER_STATUS_AVAILABLE:
3495 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
3496 switch (fsf_req->qtcb->header.fsf_status_qual.word[0]) { 3346 switch (fsf_req->qtcb->header.fsf_status_qual.word[0]) {
3497 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 3347 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
3498 ZFCP_LOG_FLAGS(2,
3499 "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
3500 /* re-establish link to port */ 3348 /* re-establish link to port */
3501 debug_text_event(fsf_req->adapter->erp_dbf, 1, 3349 debug_text_event(fsf_req->adapter->erp_dbf, 1,
3502 "fsf_sq_ltest"); 3350 "fsf_sq_ltest");
3503 zfcp_erp_port_reopen(unit->port, 0); 3351 zfcp_test_link(unit->port);
3504 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 3352 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
3505 break; 3353 break;
3506 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 3354 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
3507 ZFCP_LOG_FLAGS(2,
3508 "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
3509 /* ERP strategy will escalate */ 3355 /* ERP strategy will escalate */
3510 debug_text_event(fsf_req->adapter->erp_dbf, 1, 3356 debug_text_event(fsf_req->adapter->erp_dbf, 1,
3511 "fsf_sq_ulp"); 3357 "fsf_sq_ulp");
@@ -3526,7 +3372,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req)
3526 break; 3372 break;
3527 3373
3528 case FSF_GOOD: 3374 case FSF_GOOD:
3529 ZFCP_LOG_FLAGS(3, "FSF_GOOD\n");
3530 ZFCP_LOG_TRACE("unit 0x%016Lx on port 0x%016Lx on adapter %s " 3375 ZFCP_LOG_TRACE("unit 0x%016Lx on port 0x%016Lx on adapter %s "
3531 "closed, port handle 0x%x\n", 3376 "closed, port handle 0x%x\n",
3532 unit->fcp_lun, 3377 unit->fcp_lun,
@@ -3622,7 +3467,6 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
3622 */ 3467 */
3623 switch (scsi_cmnd->sc_data_direction) { 3468 switch (scsi_cmnd->sc_data_direction) {
3624 case DMA_NONE: 3469 case DMA_NONE:
3625 ZFCP_LOG_FLAGS(3, "DMA_NONE\n");
3626 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; 3470 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND;
3627 /* 3471 /*
3628 * FIXME(qdio): 3472 * FIXME(qdio):
@@ -3632,19 +3476,16 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
3632 sbtype = SBAL_FLAGS0_TYPE_READ; 3476 sbtype = SBAL_FLAGS0_TYPE_READ;
3633 break; 3477 break;
3634 case DMA_FROM_DEVICE: 3478 case DMA_FROM_DEVICE:
3635 ZFCP_LOG_FLAGS(3, "DMA_FROM_DEVICE\n");
3636 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_READ; 3479 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_READ;
3637 sbtype = SBAL_FLAGS0_TYPE_READ; 3480 sbtype = SBAL_FLAGS0_TYPE_READ;
3638 fcp_cmnd_iu->rddata = 1; 3481 fcp_cmnd_iu->rddata = 1;
3639 break; 3482 break;
3640 case DMA_TO_DEVICE: 3483 case DMA_TO_DEVICE:
3641 ZFCP_LOG_FLAGS(3, "DMA_TO_DEVICE\n");
3642 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_WRITE; 3484 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_WRITE;
3643 sbtype = SBAL_FLAGS0_TYPE_WRITE; 3485 sbtype = SBAL_FLAGS0_TYPE_WRITE;
3644 fcp_cmnd_iu->wddata = 1; 3486 fcp_cmnd_iu->wddata = 1;
3645 break; 3487 break;
3646 case DMA_BIDIRECTIONAL: 3488 case DMA_BIDIRECTIONAL:
3647 ZFCP_LOG_FLAGS(0, "DMA_BIDIRECTIONAL not supported\n");
3648 default: 3489 default:
3649 /* 3490 /*
3650 * dummy, catch this condition earlier 3491 * dummy, catch this condition earlier
@@ -3877,7 +3718,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3877 switch (header->fsf_status) { 3718 switch (header->fsf_status) {
3878 3719
3879 case FSF_PORT_HANDLE_NOT_VALID: 3720 case FSF_PORT_HANDLE_NOT_VALID:
3880 ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n");
3881 ZFCP_LOG_INFO("Temporary port identifier 0x%x for port " 3721 ZFCP_LOG_INFO("Temporary port identifier 0x%x for port "
3882 "0x%016Lx on adapter %s invalid\n", 3722 "0x%016Lx on adapter %s invalid\n",
3883 unit->port->handle, 3723 unit->port->handle,
@@ -3892,7 +3732,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3892 break; 3732 break;
3893 3733
3894 case FSF_LUN_HANDLE_NOT_VALID: 3734 case FSF_LUN_HANDLE_NOT_VALID:
3895 ZFCP_LOG_FLAGS(1, "FSF_LUN_HANDLE_NOT_VALID\n");
3896 ZFCP_LOG_INFO("Temporary LUN identifier 0x%x for unit " 3735 ZFCP_LOG_INFO("Temporary LUN identifier 0x%x for unit "
3897 "0x%016Lx on port 0x%016Lx on adapter %s is " 3736 "0x%016Lx on port 0x%016Lx on adapter %s is "
3898 "invalid. This may happen occasionally.\n", 3737 "invalid. This may happen occasionally.\n",
@@ -3911,7 +3750,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3911 break; 3750 break;
3912 3751
3913 case FSF_HANDLE_MISMATCH: 3752 case FSF_HANDLE_MISMATCH:
3914 ZFCP_LOG_FLAGS(0, "FSF_HANDLE_MISMATCH\n");
3915 ZFCP_LOG_NORMAL("bug: The port handle 0x%x has changed " 3753 ZFCP_LOG_NORMAL("bug: The port handle 0x%x has changed "
3916 "unexpectedly. (adapter %s, port 0x%016Lx, " 3754 "unexpectedly. (adapter %s, port 0x%016Lx, "
3917 "unit 0x%016Lx)\n", 3755 "unit 0x%016Lx)\n",
@@ -3934,7 +3772,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3934 break; 3772 break;
3935 3773
3936 case FSF_SERVICE_CLASS_NOT_SUPPORTED: 3774 case FSF_SERVICE_CLASS_NOT_SUPPORTED:
3937 ZFCP_LOG_FLAGS(0, "FSF_SERVICE_CLASS_NOT_SUPPORTED\n");
3938 if (fsf_req->adapter->fc_service_class <= 3) { 3775 if (fsf_req->adapter->fc_service_class <= 3) {
3939 ZFCP_LOG_NORMAL("error: The adapter %s does " 3776 ZFCP_LOG_NORMAL("error: The adapter %s does "
3940 "not support fibrechannel class %d.\n", 3777 "not support fibrechannel class %d.\n",
@@ -3959,7 +3796,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3959 break; 3796 break;
3960 3797
3961 case FSF_FCPLUN_NOT_VALID: 3798 case FSF_FCPLUN_NOT_VALID:
3962 ZFCP_LOG_FLAGS(0, "FSF_FCPLUN_NOT_VALID\n");
3963 ZFCP_LOG_NORMAL("bug: unit 0x%016Lx on port 0x%016Lx on " 3799 ZFCP_LOG_NORMAL("bug: unit 0x%016Lx on port 0x%016Lx on "
3964 "adapter %s does not have correct unit " 3800 "adapter %s does not have correct unit "
3965 "handle 0x%x\n", 3801 "handle 0x%x\n",
@@ -3982,7 +3818,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3982 break; 3818 break;
3983 3819
3984 case FSF_ACCESS_DENIED: 3820 case FSF_ACCESS_DENIED:
3985 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n");
3986 ZFCP_LOG_NORMAL("Access denied, cannot send FCP command to " 3821 ZFCP_LOG_NORMAL("Access denied, cannot send FCP command to "
3987 "unit 0x%016Lx on port 0x%016Lx on " 3822 "unit 0x%016Lx on port 0x%016Lx on "
3988 "adapter %s\n", unit->fcp_lun, unit->port->wwpn, 3823 "adapter %s\n", unit->fcp_lun, unit->port->wwpn,
@@ -4006,7 +3841,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
4006 break; 3841 break;
4007 3842
4008 case FSF_DIRECTION_INDICATOR_NOT_VALID: 3843 case FSF_DIRECTION_INDICATOR_NOT_VALID:
4009 ZFCP_LOG_FLAGS(0, "FSF_DIRECTION_INDICATOR_NOT_VALID\n");
4010 ZFCP_LOG_INFO("bug: Invalid data direction given for unit " 3844 ZFCP_LOG_INFO("bug: Invalid data direction given for unit "
4011 "0x%016Lx on port 0x%016Lx on adapter %s " 3845 "0x%016Lx on port 0x%016Lx on adapter %s "
4012 "(debug info %d)\n", 3846 "(debug info %d)\n",
@@ -4026,7 +3860,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
4026 break; 3860 break;
4027 3861
4028 case FSF_CMND_LENGTH_NOT_VALID: 3862 case FSF_CMND_LENGTH_NOT_VALID:
4029 ZFCP_LOG_FLAGS(0, "FSF_CMND_LENGTH_NOT_VALID\n");
4030 ZFCP_LOG_NORMAL 3863 ZFCP_LOG_NORMAL
4031 ("bug: An invalid control-data-block length field " 3864 ("bug: An invalid control-data-block length field "
4032 "was found in a command for unit 0x%016Lx on port " 3865 "was found in a command for unit 0x%016Lx on port "
@@ -4046,69 +3879,43 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
4046 break; 3879 break;
4047 3880
4048 case FSF_PORT_BOXED: 3881 case FSF_PORT_BOXED:
4049 ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n");
4050 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s " 3882 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s "
4051 "needs to be reopened\n", 3883 "needs to be reopened\n",
4052 unit->port->wwpn, zfcp_get_busid_by_unit(unit)); 3884 unit->port->wwpn, zfcp_get_busid_by_unit(unit));
4053 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); 3885 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed");
4054 zfcp_erp_port_reopen(unit->port, 0); 3886 zfcp_erp_port_boxed(unit->port);
4055 zfcp_cmd_dbf_event_fsf("portbox", fsf_req,
4056 &header->fsf_status_qual,
4057 sizeof (union fsf_status_qual));
4058 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 3887 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
4059 ZFCP_STATUS_FSFREQ_RETRY; 3888 ZFCP_STATUS_FSFREQ_RETRY;
4060 break; 3889 break;
4061 3890
4062 case FSF_LUN_BOXED: 3891 case FSF_LUN_BOXED:
4063 ZFCP_LOG_FLAGS(0, "FSF_LUN_BOXED\n");
4064 ZFCP_LOG_NORMAL("unit needs to be reopened (adapter %s, " 3892 ZFCP_LOG_NORMAL("unit needs to be reopened (adapter %s, "
4065 "wwpn=0x%016Lx, fcp_lun=0x%016Lx)\n", 3893 "wwpn=0x%016Lx, fcp_lun=0x%016Lx)\n",
4066 zfcp_get_busid_by_unit(unit), 3894 zfcp_get_busid_by_unit(unit),
4067 unit->port->wwpn, unit->fcp_lun); 3895 unit->port->wwpn, unit->fcp_lun);
4068 debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); 3896 debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed");
4069 zfcp_erp_unit_reopen(unit, 0); 3897 zfcp_erp_unit_boxed(unit);
4070 zfcp_cmd_dbf_event_fsf("unitbox", fsf_req,
4071 &header->fsf_status_qual,
4072 sizeof(union fsf_status_qual));
4073 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR 3898 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
4074 | ZFCP_STATUS_FSFREQ_RETRY; 3899 | ZFCP_STATUS_FSFREQ_RETRY;
4075 break; 3900 break;
4076 3901
4077 case FSF_ADAPTER_STATUS_AVAILABLE: 3902 case FSF_ADAPTER_STATUS_AVAILABLE:
4078 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
4079 switch (header->fsf_status_qual.word[0]) { 3903 switch (header->fsf_status_qual.word[0]) {
4080 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 3904 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
4081 ZFCP_LOG_FLAGS(2,
4082 "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
4083 /* re-establish link to port */ 3905 /* re-establish link to port */
4084 debug_text_event(fsf_req->adapter->erp_dbf, 1, 3906 debug_text_event(fsf_req->adapter->erp_dbf, 1,
4085 "fsf_sq_ltest"); 3907 "fsf_sq_ltest");
4086 zfcp_erp_port_reopen(unit->port, 0); 3908 zfcp_test_link(unit->port);
4087 zfcp_cmd_dbf_event_fsf(
4088 "sqltest",
4089 fsf_req,
4090 &header->fsf_status_qual,
4091 sizeof (union fsf_status_qual));
4092 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
4093 break; 3909 break;
4094 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 3910 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
4095 ZFCP_LOG_FLAGS(3,
4096 "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
4097 /* FIXME(hw) need proper specs for proper action */ 3911 /* FIXME(hw) need proper specs for proper action */
4098 /* let scsi stack deal with retries and escalation */ 3912 /* let scsi stack deal with retries and escalation */
4099 debug_text_event(fsf_req->adapter->erp_dbf, 1, 3913 debug_text_event(fsf_req->adapter->erp_dbf, 1,
4100 "fsf_sq_ulp"); 3914 "fsf_sq_ulp");
4101 zfcp_cmd_dbf_event_fsf(
4102 "sqdeperp",
4103 fsf_req,
4104 &header->fsf_status_qual,
4105 sizeof (union fsf_status_qual));
4106 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
4107 break; 3915 break;
4108 default: 3916 default:
4109 /* FIXME: shall we consider this a successful transfer? */
4110 ZFCP_LOG_NORMAL 3917 ZFCP_LOG_NORMAL
4111 ("bug: Wrong status qualifier 0x%x arrived.\n", 3918 ("Unknown status qualifier 0x%x arrived.\n",
4112 header->fsf_status_qual.word[0]); 3919 header->fsf_status_qual.word[0]);
4113 debug_text_event(fsf_req->adapter->erp_dbf, 0, 3920 debug_text_event(fsf_req->adapter->erp_dbf, 0,
4114 "fsf_sq_inval:"); 3921 "fsf_sq_inval:");
@@ -4117,14 +3924,13 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
4117 sizeof(u32)); 3924 sizeof(u32));
4118 break; 3925 break;
4119 } 3926 }
3927 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
4120 break; 3928 break;
4121 3929
4122 case FSF_GOOD: 3930 case FSF_GOOD:
4123 ZFCP_LOG_FLAGS(3, "FSF_GOOD\n");
4124 break; 3931 break;
4125 3932
4126 case FSF_FCP_RSP_AVAILABLE: 3933 case FSF_FCP_RSP_AVAILABLE:
4127 ZFCP_LOG_FLAGS(2, "FSF_FCP_RSP_AVAILABLE\n");
4128 break; 3934 break;
4129 3935
4130 default: 3936 default:
@@ -4217,14 +4023,12 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
4217 ZFCP_LOG_DEBUG("rsp_len is valid\n"); 4023 ZFCP_LOG_DEBUG("rsp_len is valid\n");
4218 switch (fcp_rsp_info[3]) { 4024 switch (fcp_rsp_info[3]) {
4219 case RSP_CODE_GOOD: 4025 case RSP_CODE_GOOD:
4220 ZFCP_LOG_FLAGS(3, "RSP_CODE_GOOD\n");
4221 /* ok, continue */ 4026 /* ok, continue */
4222 ZFCP_LOG_TRACE("no failure or Task Management " 4027 ZFCP_LOG_TRACE("no failure or Task Management "
4223 "Function complete\n"); 4028 "Function complete\n");
4224 set_host_byte(&scpnt->result, DID_OK); 4029 set_host_byte(&scpnt->result, DID_OK);
4225 break; 4030 break;
4226 case RSP_CODE_LENGTH_MISMATCH: 4031 case RSP_CODE_LENGTH_MISMATCH:
4227 ZFCP_LOG_FLAGS(0, "RSP_CODE_LENGTH_MISMATCH\n");
4228 /* hardware bug */ 4032 /* hardware bug */
4229 ZFCP_LOG_NORMAL("bug: FCP response code indictates " 4033 ZFCP_LOG_NORMAL("bug: FCP response code indictates "
4230 "that the fibrechannel protocol data " 4034 "that the fibrechannel protocol data "
@@ -4242,7 +4046,6 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
4242 set_host_byte(&scpnt->result, DID_ERROR); 4046 set_host_byte(&scpnt->result, DID_ERROR);
4243 goto skip_fsfstatus; 4047 goto skip_fsfstatus;
4244 case RSP_CODE_FIELD_INVALID: 4048 case RSP_CODE_FIELD_INVALID:
4245 ZFCP_LOG_FLAGS(0, "RSP_CODE_FIELD_INVALID\n");
4246 /* driver or hardware bug */ 4049 /* driver or hardware bug */
4247 ZFCP_LOG_NORMAL("bug: FCP response code indictates " 4050 ZFCP_LOG_NORMAL("bug: FCP response code indictates "
4248 "that the fibrechannel protocol data " 4051 "that the fibrechannel protocol data "
@@ -4261,7 +4064,6 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
4261 zfcp_cmd_dbf_event_fsf("codeinv", fsf_req, NULL, 0); 4064 zfcp_cmd_dbf_event_fsf("codeinv", fsf_req, NULL, 0);
4262 goto skip_fsfstatus; 4065 goto skip_fsfstatus;
4263 case RSP_CODE_RO_MISMATCH: 4066 case RSP_CODE_RO_MISMATCH:
4264 ZFCP_LOG_FLAGS(0, "RSP_CODE_RO_MISMATCH\n");
4265 /* hardware bug */ 4067 /* hardware bug */
4266 ZFCP_LOG_NORMAL("bug: The FCP response code indicates " 4068 ZFCP_LOG_NORMAL("bug: The FCP response code indicates "
4267 "that conflicting values for the " 4069 "that conflicting values for the "
@@ -4407,13 +4209,11 @@ zfcp_fsf_send_fcp_command_task_management_handler(struct zfcp_fsf_req *fsf_req)
4407 /* check FCP_RSP_INFO */ 4209 /* check FCP_RSP_INFO */
4408 switch (fcp_rsp_info[3]) { 4210 switch (fcp_rsp_info[3]) {
4409 case RSP_CODE_GOOD: 4211 case RSP_CODE_GOOD:
4410 ZFCP_LOG_FLAGS(3, "RSP_CODE_GOOD\n");
4411 /* ok, continue */ 4212 /* ok, continue */
4412 ZFCP_LOG_DEBUG("no failure or Task Management " 4213 ZFCP_LOG_DEBUG("no failure or Task Management "
4413 "Function complete\n"); 4214 "Function complete\n");
4414 break; 4215 break;
4415 case RSP_CODE_TASKMAN_UNSUPP: 4216 case RSP_CODE_TASKMAN_UNSUPP:
4416 ZFCP_LOG_FLAGS(0, "RSP_CODE_TASKMAN_UNSUPP\n");
4417 ZFCP_LOG_NORMAL("bug: A reuested task management function " 4217 ZFCP_LOG_NORMAL("bug: A reuested task management function "
4418 "is not supported on the target device " 4218 "is not supported on the target device "
4419 "unit 0x%016Lx, port 0x%016Lx, adapter %s\n ", 4219 "unit 0x%016Lx, port 0x%016Lx, adapter %s\n ",
@@ -4423,7 +4223,6 @@ zfcp_fsf_send_fcp_command_task_management_handler(struct zfcp_fsf_req *fsf_req)
4423 fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP; 4223 fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP;
4424 break; 4224 break;
4425 case RSP_CODE_TASKMAN_FAILED: 4225 case RSP_CODE_TASKMAN_FAILED:
4426 ZFCP_LOG_FLAGS(0, "RSP_CODE_TASKMAN_FAILED\n");
4427 ZFCP_LOG_NORMAL("bug: A reuested task management function " 4226 ZFCP_LOG_NORMAL("bug: A reuested task management function "
4428 "failed to complete successfully. " 4227 "failed to complete successfully. "
4429 "unit 0x%016Lx, port 0x%016Lx, adapter %s.\n", 4228 "unit 0x%016Lx, port 0x%016Lx, adapter %s.\n",
@@ -4610,7 +4409,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4610 switch (header->fsf_status) { 4409 switch (header->fsf_status) {
4611 4410
4612 case FSF_GOOD: 4411 case FSF_GOOD:
4613 ZFCP_LOG_FLAGS(2, "FSF_GOOD\n");
4614 ZFCP_LOG_NORMAL( 4412 ZFCP_LOG_NORMAL(
4615 "The FSF request has been successfully completed " 4413 "The FSF request has been successfully completed "
4616 "on the adapter %s\n", 4414 "on the adapter %s\n",
@@ -4618,7 +4416,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4618 break; 4416 break;
4619 4417
4620 case FSF_OPERATION_PARTIALLY_SUCCESSFUL: 4418 case FSF_OPERATION_PARTIALLY_SUCCESSFUL:
4621 ZFCP_LOG_FLAGS(2, "FSF_OPERATION_PARTIALLY_SUCCESSFUL\n");
4622 if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) { 4419 if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) {
4623 switch (header->fsf_status_qual.word[0]) { 4420 switch (header->fsf_status_qual.word[0]) {
4624 4421
@@ -4655,7 +4452,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4655 break; 4452 break;
4656 4453
4657 case FSF_AUTHORIZATION_FAILURE: 4454 case FSF_AUTHORIZATION_FAILURE:
4658 ZFCP_LOG_FLAGS(2, "FSF_AUTHORIZATION_FAILURE\n");
4659 ZFCP_LOG_NORMAL( 4455 ZFCP_LOG_NORMAL(
4660 "Adapter %s does not accept privileged commands\n", 4456 "Adapter %s does not accept privileged commands\n",
4661 zfcp_get_busid_by_adapter(adapter)); 4457 zfcp_get_busid_by_adapter(adapter));
@@ -4664,7 +4460,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4664 break; 4460 break;
4665 4461
4666 case FSF_CFDC_ERROR_DETECTED: 4462 case FSF_CFDC_ERROR_DETECTED:
4667 ZFCP_LOG_FLAGS(2, "FSF_CFDC_ERROR_DETECTED\n");
4668 ZFCP_LOG_NORMAL( 4463 ZFCP_LOG_NORMAL(
4669 "Error at position %d in the CFDC, " 4464 "Error at position %d in the CFDC, "
4670 "CFDC is discarded by the adapter %s\n", 4465 "CFDC is discarded by the adapter %s\n",
@@ -4675,7 +4470,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4675 break; 4470 break;
4676 4471
4677 case FSF_CONTROL_FILE_UPDATE_ERROR: 4472 case FSF_CONTROL_FILE_UPDATE_ERROR:
4678 ZFCP_LOG_FLAGS(2, "FSF_CONTROL_FILE_UPDATE_ERROR\n");
4679 ZFCP_LOG_NORMAL( 4473 ZFCP_LOG_NORMAL(
4680 "Adapter %s cannot harden the control file, " 4474 "Adapter %s cannot harden the control file, "
4681 "file is discarded\n", 4475 "file is discarded\n",
@@ -4685,7 +4479,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4685 break; 4479 break;
4686 4480
4687 case FSF_CONTROL_FILE_TOO_LARGE: 4481 case FSF_CONTROL_FILE_TOO_LARGE:
4688 ZFCP_LOG_FLAGS(2, "FSF_CONTROL_FILE_TOO_LARGE\n");
4689 ZFCP_LOG_NORMAL( 4482 ZFCP_LOG_NORMAL(
4690 "Control file is too large, file is discarded " 4483 "Control file is too large, file is discarded "
4691 "by the adapter %s\n", 4484 "by the adapter %s\n",
@@ -4695,7 +4488,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4695 break; 4488 break;
4696 4489
4697 case FSF_ACCESS_CONFLICT_DETECTED: 4490 case FSF_ACCESS_CONFLICT_DETECTED:
4698 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_CONFLICT_DETECTED\n");
4699 if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) 4491 if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE)
4700 ZFCP_LOG_NORMAL( 4492 ZFCP_LOG_NORMAL(
4701 "CFDC has been discarded by the adapter %s, " 4493 "CFDC has been discarded by the adapter %s, "
@@ -4708,7 +4500,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4708 break; 4500 break;
4709 4501
4710 case FSF_CONFLICTS_OVERRULED: 4502 case FSF_CONFLICTS_OVERRULED:
4711 ZFCP_LOG_FLAGS(2, "FSF_CONFLICTS_OVERRULED\n");
4712 if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) 4503 if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE)
4713 ZFCP_LOG_NORMAL( 4504 ZFCP_LOG_NORMAL(
4714 "CFDC has been activated on the adapter %s, " 4505 "CFDC has been activated on the adapter %s, "
@@ -4721,7 +4512,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4721 break; 4512 break;
4722 4513
4723 case FSF_UNKNOWN_OP_SUBTYPE: 4514 case FSF_UNKNOWN_OP_SUBTYPE:
4724 ZFCP_LOG_FLAGS(2, "FSF_UNKNOWN_OP_SUBTYPE\n");
4725 ZFCP_LOG_NORMAL("unknown operation subtype (adapter: %s, " 4515 ZFCP_LOG_NORMAL("unknown operation subtype (adapter: %s, "
4726 "op_subtype=0x%x)\n", 4516 "op_subtype=0x%x)\n",
4727 zfcp_get_busid_by_adapter(adapter), 4517 zfcp_get_busid_by_adapter(adapter),
@@ -4731,7 +4521,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4731 break; 4521 break;
4732 4522
4733 case FSF_INVALID_COMMAND_OPTION: 4523 case FSF_INVALID_COMMAND_OPTION:
4734 ZFCP_LOG_FLAGS(2, "FSF_INVALID_COMMAND_OPTION\n");
4735 ZFCP_LOG_NORMAL( 4524 ZFCP_LOG_NORMAL(
4736 "Invalid option 0x%x has been specified " 4525 "Invalid option 0x%x has been specified "
4737 "in QTCB bottom sent to the adapter %s\n", 4526 "in QTCB bottom sent to the adapter %s\n",
@@ -4800,7 +4589,7 @@ zfcp_fsf_req_wait_and_cleanup(struct zfcp_fsf_req *fsf_req,
4800 *status = fsf_req->status; 4589 *status = fsf_req->status;
4801 4590
4802 /* cleanup request */ 4591 /* cleanup request */
4803 zfcp_fsf_req_cleanup(fsf_req); 4592 zfcp_fsf_req_free(fsf_req);
4804 out: 4593 out:
4805 return retval; 4594 return retval;
4806} 4595}
@@ -4999,9 +4788,9 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer)
4999 inc_seq_no = 0; 4788 inc_seq_no = 0;
5000 4789
5001 /* put allocated FSF request at list tail */ 4790 /* put allocated FSF request at list tail */
5002 write_lock_irqsave(&adapter->fsf_req_list_lock, flags); 4791 spin_lock_irqsave(&adapter->fsf_req_list_lock, flags);
5003 list_add_tail(&fsf_req->list, &adapter->fsf_req_list_head); 4792 list_add_tail(&fsf_req->list, &adapter->fsf_req_list_head);
5004 write_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); 4793 spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
5005 4794
5006 /* figure out expiration time of timeout and start timeout */ 4795 /* figure out expiration time of timeout and start timeout */
5007 if (unlikely(timer)) { 4796 if (unlikely(timer)) {
@@ -5045,9 +4834,9 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer)
5045 */ 4834 */
5046 if (timer) 4835 if (timer)
5047 del_timer(timer); 4836 del_timer(timer);
5048 write_lock_irqsave(&adapter->fsf_req_list_lock, flags); 4837 spin_lock_irqsave(&adapter->fsf_req_list_lock, flags);
5049 list_del(&fsf_req->list); 4838 list_del(&fsf_req->list);
5050 write_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); 4839 spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
5051 /* 4840 /*
5052 * adjust the number of free SBALs in request queue as well as 4841 * adjust the number of free SBALs in request queue as well as
5053 * position of first one 4842 * position of first one
@@ -5085,25 +4874,4 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer)
5085 return retval; 4874 return retval;
5086} 4875}
5087 4876
5088/*
5089 * function: zfcp_fsf_req_cleanup
5090 *
5091 * purpose: cleans up an FSF request and removes it from the specified list
5092 *
5093 * returns:
5094 *
5095 * assumption: no pending SB in SBALEs other than QTCB
5096 */
5097void
5098zfcp_fsf_req_cleanup(struct zfcp_fsf_req *fsf_req)
5099{
5100 struct zfcp_adapter *adapter = fsf_req->adapter;
5101 unsigned long flags;
5102
5103 write_lock_irqsave(&adapter->fsf_req_list_lock, flags);
5104 list_del(&fsf_req->list);
5105 write_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
5106 zfcp_fsf_req_free(fsf_req);
5107}
5108
5109#undef ZFCP_LOG_AREA 4877#undef ZFCP_LOG_AREA
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index 06e862d7bc90..24e16ec331d9 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -229,52 +229,14 @@ zfcp_qdio_handler_error_check(struct zfcp_adapter *adapter,
229 ZFCP_LOG_TRACE("status is" 229 ZFCP_LOG_TRACE("status is"
230 " QDIO_STATUS_OUTBOUND_INT \n"); 230 " QDIO_STATUS_OUTBOUND_INT \n");
231 } 231 }
232 } // if (ZFCP_LOG_CHECK(ZFCP_LOG_LEVEL_TRACE)) 232 }
233 if (unlikely(status & QDIO_STATUS_LOOK_FOR_ERROR)) { 233 if (unlikely(status & QDIO_STATUS_LOOK_FOR_ERROR)) {
234 retval = -EIO; 234 retval = -EIO;
235 235
236 ZFCP_LOG_FLAGS(1, "QDIO_STATUS_LOOK_FOR_ERROR \n");
237
238 ZFCP_LOG_INFO("QDIO problem occurred (status=0x%x, " 236 ZFCP_LOG_INFO("QDIO problem occurred (status=0x%x, "
239 "qdio_error=0x%x, siga_error=0x%x)\n", 237 "qdio_error=0x%x, siga_error=0x%x)\n",
240 status, qdio_error, siga_error); 238 status, qdio_error, siga_error);
241 239
242 if (status & QDIO_STATUS_ACTIVATE_CHECK_CONDITION) {
243 ZFCP_LOG_FLAGS(2,
244 "QDIO_STATUS_ACTIVATE_CHECK_CONDITION\n");
245 }
246 if (status & QDIO_STATUS_MORE_THAN_ONE_QDIO_ERROR) {
247 ZFCP_LOG_FLAGS(2,
248 "QDIO_STATUS_MORE_THAN_ONE_QDIO_ERROR\n");
249 }
250 if (status & QDIO_STATUS_MORE_THAN_ONE_SIGA_ERROR) {
251 ZFCP_LOG_FLAGS(2,
252 "QDIO_STATUS_MORE_THAN_ONE_SIGA_ERROR\n");
253 }
254
255 if (siga_error & QDIO_SIGA_ERROR_ACCESS_EXCEPTION) {
256 ZFCP_LOG_FLAGS(2, "QDIO_SIGA_ERROR_ACCESS_EXCEPTION\n");
257 }
258
259 if (siga_error & QDIO_SIGA_ERROR_B_BIT_SET) {
260 ZFCP_LOG_FLAGS(2, "QDIO_SIGA_ERROR_B_BIT_SET\n");
261 }
262
263 switch (qdio_error) {
264 case 0:
265 ZFCP_LOG_FLAGS(3, "QDIO_OK");
266 break;
267 case SLSB_P_INPUT_ERROR:
268 ZFCP_LOG_FLAGS(1, "SLSB_P_INPUT_ERROR\n");
269 break;
270 case SLSB_P_OUTPUT_ERROR:
271 ZFCP_LOG_FLAGS(1, "SLSB_P_OUTPUT_ERROR\n");
272 break;
273 default:
274 ZFCP_LOG_NORMAL("bug: unknown QDIO error 0x%x\n",
275 qdio_error);
276 break;
277 }
278 /* Restarting IO on the failed adapter from scratch */ 240 /* Restarting IO on the failed adapter from scratch */
279 debug_text_event(adapter->erp_dbf, 1, "qdio_err"); 241 debug_text_event(adapter->erp_dbf, 1, "qdio_err");
280 /* 242 /*
@@ -484,37 +446,37 @@ int
484zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr) 446zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr)
485{ 447{
486 struct zfcp_fsf_req *fsf_req; 448 struct zfcp_fsf_req *fsf_req;
487 int retval = 0;
488 449
489 /* invalid (per convention used in this driver) */ 450 /* invalid (per convention used in this driver) */
490 if (unlikely(!sbale_addr)) { 451 if (unlikely(!sbale_addr)) {
491 ZFCP_LOG_NORMAL("bug: invalid reqid\n"); 452 ZFCP_LOG_NORMAL("bug: invalid reqid\n");
492 retval = -EINVAL; 453 return -EINVAL;
493 goto out;
494 } 454 }
495 455
496 /* valid request id and thus (hopefully :) valid fsf_req address */ 456 /* valid request id and thus (hopefully :) valid fsf_req address */
497 fsf_req = (struct zfcp_fsf_req *) sbale_addr; 457 fsf_req = (struct zfcp_fsf_req *) sbale_addr;
498 458
459 /* serialize with zfcp_fsf_req_dismiss_all */
460 spin_lock(&adapter->fsf_req_list_lock);
461 if (list_empty(&adapter->fsf_req_list_head)) {
462 spin_unlock(&adapter->fsf_req_list_lock);
463 return 0;
464 }
465 list_del(&fsf_req->list);
466 atomic_dec(&adapter->fsf_reqs_active);
467 spin_unlock(&adapter->fsf_req_list_lock);
468
499 if (unlikely(adapter != fsf_req->adapter)) { 469 if (unlikely(adapter != fsf_req->adapter)) {
500 ZFCP_LOG_NORMAL("bug: invalid reqid (fsf_req=%p, " 470 ZFCP_LOG_NORMAL("bug: invalid reqid (fsf_req=%p, "
501 "fsf_req->adapter=%p, adapter=%p)\n", 471 "fsf_req->adapter=%p, adapter=%p)\n",
502 fsf_req, fsf_req->adapter, adapter); 472 fsf_req, fsf_req->adapter, adapter);
503 retval = -EINVAL; 473 return -EINVAL;
504 goto out;
505 }
506
507 ZFCP_LOG_TRACE("fsf_req at %p, QTCB at %p\n", fsf_req, fsf_req->qtcb);
508 if (likely(fsf_req->qtcb)) {
509 ZFCP_LOG_TRACE("hex dump of QTCB:\n");
510 ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE, (char *) fsf_req->qtcb,
511 sizeof(struct fsf_qtcb));
512 } 474 }
513 475
514 /* finish the FSF request */ 476 /* finish the FSF request */
515 zfcp_fsf_req_complete(fsf_req); 477 zfcp_fsf_req_complete(fsf_req);
516 out: 478
517 return retval; 479 return 0;
518} 480}
519 481
520/** 482/**
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index e21b547fd427..b61d309352c3 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -433,7 +433,7 @@ zfcp_port_lookup(struct zfcp_adapter *adapter, int channel, scsi_id_t id)
433 * FAILED - otherwise 433 * FAILED - otherwise
434 */ 434 */
435int 435int
436zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) 436__zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
437{ 437{
438 int retval = SUCCESS; 438 int retval = SUCCESS;
439 struct zfcp_fsf_req *new_fsf_req, *old_fsf_req; 439 struct zfcp_fsf_req *new_fsf_req, *old_fsf_req;
@@ -575,7 +575,7 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
575 *(u64 *) & new_fsf_req->qtcb->header.fsf_status_qual.word[0]; 575 *(u64 *) & new_fsf_req->qtcb->header.fsf_status_qual.word[0];
576 dbf_fsf_qual[1] = 576 dbf_fsf_qual[1] =
577 *(u64 *) & new_fsf_req->qtcb->header.fsf_status_qual.word[2]; 577 *(u64 *) & new_fsf_req->qtcb->header.fsf_status_qual.word[2];
578 zfcp_fsf_req_cleanup(new_fsf_req); 578 zfcp_fsf_req_free(new_fsf_req);
579#else 579#else
580 retval = zfcp_fsf_req_wait_and_cleanup(new_fsf_req, 580 retval = zfcp_fsf_req_wait_and_cleanup(new_fsf_req,
581 ZFCP_UNINTERRUPTIBLE, &status); 581 ZFCP_UNINTERRUPTIBLE, &status);
@@ -611,6 +611,17 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
611 return retval; 611 return retval;
612} 612}
613 613
614int
615zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
616{
617 int rc;
618 struct Scsi_Host *scsi_host = scpnt->device->host;
619 spin_lock_irq(scsi_host->host_lock);
620 rc = __zfcp_scsi_eh_abort_handler(scpnt);
621 spin_unlock_irq(scsi_host->host_lock);
622 return rc;
623}
624
614/* 625/*
615 * function: zfcp_scsi_eh_device_reset_handler 626 * function: zfcp_scsi_eh_device_reset_handler
616 * 627 *
@@ -625,8 +636,6 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt)
625 struct zfcp_unit *unit = (struct zfcp_unit *) scpnt->device->hostdata; 636 struct zfcp_unit *unit = (struct zfcp_unit *) scpnt->device->hostdata;
626 struct Scsi_Host *scsi_host = scpnt->device->host; 637 struct Scsi_Host *scsi_host = scpnt->device->host;
627 638
628 spin_unlock_irq(scsi_host->host_lock);
629
630 if (!unit) { 639 if (!unit) {
631 ZFCP_LOG_NORMAL("bug: Tried reset for nonexistent unit\n"); 640 ZFCP_LOG_NORMAL("bug: Tried reset for nonexistent unit\n");
632 retval = SUCCESS; 641 retval = SUCCESS;
@@ -669,7 +678,6 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt)
669 retval = SUCCESS; 678 retval = SUCCESS;
670 } 679 }
671 out: 680 out:
672 spin_lock_irq(scsi_host->host_lock);
673 return retval; 681 return retval;
674} 682}
675 683
@@ -723,8 +731,6 @@ zfcp_scsi_eh_bus_reset_handler(struct scsi_cmnd *scpnt)
723 struct zfcp_unit *unit; 731 struct zfcp_unit *unit;
724 struct Scsi_Host *scsi_host = scpnt->device->host; 732 struct Scsi_Host *scsi_host = scpnt->device->host;
725 733
726 spin_unlock_irq(scsi_host->host_lock);
727
728 unit = (struct zfcp_unit *) scpnt->device->hostdata; 734 unit = (struct zfcp_unit *) scpnt->device->hostdata;
729 ZFCP_LOG_NORMAL("bus reset because of problems with " 735 ZFCP_LOG_NORMAL("bus reset because of problems with "
730 "unit 0x%016Lx\n", unit->fcp_lun); 736 "unit 0x%016Lx\n", unit->fcp_lun);
@@ -732,7 +738,6 @@ zfcp_scsi_eh_bus_reset_handler(struct scsi_cmnd *scpnt)
732 zfcp_erp_wait(unit->port->adapter); 738 zfcp_erp_wait(unit->port->adapter);
733 retval = SUCCESS; 739 retval = SUCCESS;
734 740
735 spin_lock_irq(scsi_host->host_lock);
736 return retval; 741 return retval;
737} 742}
738 743
@@ -750,8 +755,6 @@ zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
750 struct zfcp_unit *unit; 755 struct zfcp_unit *unit;
751 struct Scsi_Host *scsi_host = scpnt->device->host; 756 struct Scsi_Host *scsi_host = scpnt->device->host;
752 757
753 spin_unlock_irq(scsi_host->host_lock);
754
755 unit = (struct zfcp_unit *) scpnt->device->hostdata; 758 unit = (struct zfcp_unit *) scpnt->device->hostdata;
756 ZFCP_LOG_NORMAL("host reset because of problems with " 759 ZFCP_LOG_NORMAL("host reset because of problems with "
757 "unit 0x%016Lx\n", unit->fcp_lun); 760 "unit 0x%016Lx\n", unit->fcp_lun);
@@ -759,7 +762,6 @@ zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
759 zfcp_erp_wait(unit->port->adapter); 762 zfcp_erp_wait(unit->port->adapter);
760 retval = SUCCESS; 763 retval = SUCCESS;
761 764
762 spin_lock_irq(scsi_host->host_lock);
763 return retval; 765 return retval;
764} 766}
765 767
@@ -922,7 +924,7 @@ struct fc_function_template zfcp_transport_functions = {
922 * Generates attribute for a unit. 924 * Generates attribute for a unit.
923 */ 925 */
924#define ZFCP_DEFINE_SCSI_ATTR(_name, _format, _value) \ 926#define ZFCP_DEFINE_SCSI_ATTR(_name, _format, _value) \
925static ssize_t zfcp_sysfs_scsi_##_name##_show(struct device *dev, \ 927static ssize_t zfcp_sysfs_scsi_##_name##_show(struct device *dev, struct device_attribute *attr, \
926 char *buf) \ 928 char *buf) \
927{ \ 929{ \
928 struct scsi_device *sdev; \ 930 struct scsi_device *sdev; \
diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c
index 23e2dca55bb8..e7345a74800a 100644
--- a/drivers/s390/scsi/zfcp_sysfs_adapter.c
+++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c
@@ -50,7 +50,7 @@ static const char fc_topologies[5][25] = {
50 * Generates attributes for an adapter. 50 * Generates attributes for an adapter.
51 */ 51 */
52#define ZFCP_DEFINE_ADAPTER_ATTR(_name, _format, _value) \ 52#define ZFCP_DEFINE_ADAPTER_ATTR(_name, _format, _value) \
53static ssize_t zfcp_sysfs_adapter_##_name##_show(struct device *dev, \ 53static ssize_t zfcp_sysfs_adapter_##_name##_show(struct device *dev, struct device_attribute *attr, \
54 char *buf) \ 54 char *buf) \
55{ \ 55{ \
56 struct zfcp_adapter *adapter; \ 56 struct zfcp_adapter *adapter; \
@@ -90,7 +90,7 @@ ZFCP_DEFINE_ADAPTER_ATTR(in_recovery, "%d\n", atomic_test_mask
90 * Store function of the "port_add" attribute of an adapter. 90 * Store function of the "port_add" attribute of an adapter.
91 */ 91 */
92static ssize_t 92static ssize_t
93zfcp_sysfs_port_add_store(struct device *dev, const char *buf, size_t count) 93zfcp_sysfs_port_add_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
94{ 94{
95 wwn_t wwpn; 95 wwn_t wwpn;
96 char *endp; 96 char *endp;
@@ -135,7 +135,7 @@ static DEVICE_ATTR(port_add, S_IWUSR, NULL, zfcp_sysfs_port_add_store);
135 * Store function of the "port_remove" attribute of an adapter. 135 * Store function of the "port_remove" attribute of an adapter.
136 */ 136 */
137static ssize_t 137static ssize_t
138zfcp_sysfs_port_remove_store(struct device *dev, const char *buf, size_t count) 138zfcp_sysfs_port_remove_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
139{ 139{
140 struct zfcp_adapter *adapter; 140 struct zfcp_adapter *adapter;
141 struct zfcp_port *port; 141 struct zfcp_port *port;
@@ -196,7 +196,7 @@ static DEVICE_ATTR(port_remove, S_IWUSR, NULL, zfcp_sysfs_port_remove_store);
196 * started for the belonging adapter. 196 * started for the belonging adapter.
197 */ 197 */
198static ssize_t 198static ssize_t
199zfcp_sysfs_adapter_failed_store(struct device *dev, 199zfcp_sysfs_adapter_failed_store(struct device *dev, struct device_attribute *attr,
200 const char *buf, size_t count) 200 const char *buf, size_t count)
201{ 201{
202 struct zfcp_adapter *adapter; 202 struct zfcp_adapter *adapter;
@@ -236,7 +236,7 @@ zfcp_sysfs_adapter_failed_store(struct device *dev,
236 * "0" if adapter is working, otherwise "1". 236 * "0" if adapter is working, otherwise "1".
237 */ 237 */
238static ssize_t 238static ssize_t
239zfcp_sysfs_adapter_failed_show(struct device *dev, char *buf) 239zfcp_sysfs_adapter_failed_show(struct device *dev, struct device_attribute *attr, char *buf)
240{ 240{
241 struct zfcp_adapter *adapter; 241 struct zfcp_adapter *adapter;
242 242
diff --git a/drivers/s390/scsi/zfcp_sysfs_port.c b/drivers/s390/scsi/zfcp_sysfs_port.c
index 6aafb2abb4b5..7a84c7d474d9 100644
--- a/drivers/s390/scsi/zfcp_sysfs_port.c
+++ b/drivers/s390/scsi/zfcp_sysfs_port.c
@@ -53,7 +53,7 @@ zfcp_sysfs_port_release(struct device *dev)
53 * Generates attributes for a port. 53 * Generates attributes for a port.
54 */ 54 */
55#define ZFCP_DEFINE_PORT_ATTR(_name, _format, _value) \ 55#define ZFCP_DEFINE_PORT_ATTR(_name, _format, _value) \
56static ssize_t zfcp_sysfs_port_##_name##_show(struct device *dev, \ 56static ssize_t zfcp_sysfs_port_##_name##_show(struct device *dev, struct device_attribute *attr, \
57 char *buf) \ 57 char *buf) \
58{ \ 58{ \
59 struct zfcp_port *port; \ 59 struct zfcp_port *port; \
@@ -82,7 +82,7 @@ ZFCP_DEFINE_PORT_ATTR(access_denied, "%d\n", atomic_test_mask
82 * Store function of the "unit_add" attribute of a port. 82 * Store function of the "unit_add" attribute of a port.
83 */ 83 */
84static ssize_t 84static ssize_t
85zfcp_sysfs_unit_add_store(struct device *dev, const char *buf, size_t count) 85zfcp_sysfs_unit_add_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
86{ 86{
87 fcp_lun_t fcp_lun; 87 fcp_lun_t fcp_lun;
88 char *endp; 88 char *endp;
@@ -125,7 +125,7 @@ static DEVICE_ATTR(unit_add, S_IWUSR, NULL, zfcp_sysfs_unit_add_store);
125 * @count: number of bytes in buffer 125 * @count: number of bytes in buffer
126 */ 126 */
127static ssize_t 127static ssize_t
128zfcp_sysfs_unit_remove_store(struct device *dev, const char *buf, size_t count) 128zfcp_sysfs_unit_remove_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
129{ 129{
130 struct zfcp_port *port; 130 struct zfcp_port *port;
131 struct zfcp_unit *unit; 131 struct zfcp_unit *unit;
@@ -186,7 +186,7 @@ static DEVICE_ATTR(unit_remove, S_IWUSR, NULL, zfcp_sysfs_unit_remove_store);
186 * started for the belonging port. 186 * started for the belonging port.
187 */ 187 */
188static ssize_t 188static ssize_t
189zfcp_sysfs_port_failed_store(struct device *dev, const char *buf, size_t count) 189zfcp_sysfs_port_failed_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
190{ 190{
191 struct zfcp_port *port; 191 struct zfcp_port *port;
192 unsigned int val; 192 unsigned int val;
@@ -224,7 +224,7 @@ zfcp_sysfs_port_failed_store(struct device *dev, const char *buf, size_t count)
224 * "0" if port is working, otherwise "1". 224 * "0" if port is working, otherwise "1".
225 */ 225 */
226static ssize_t 226static ssize_t
227zfcp_sysfs_port_failed_show(struct device *dev, char *buf) 227zfcp_sysfs_port_failed_show(struct device *dev, struct device_attribute *attr, char *buf)
228{ 228{
229 struct zfcp_port *port; 229 struct zfcp_port *port;
230 230
diff --git a/drivers/s390/scsi/zfcp_sysfs_unit.c b/drivers/s390/scsi/zfcp_sysfs_unit.c
index 87c0b461831f..0556642c9e1d 100644
--- a/drivers/s390/scsi/zfcp_sysfs_unit.c
+++ b/drivers/s390/scsi/zfcp_sysfs_unit.c
@@ -53,7 +53,7 @@ zfcp_sysfs_unit_release(struct device *dev)
53 * Generates attribute for a unit. 53 * Generates attribute for a unit.
54 */ 54 */
55#define ZFCP_DEFINE_UNIT_ATTR(_name, _format, _value) \ 55#define ZFCP_DEFINE_UNIT_ATTR(_name, _format, _value) \
56static ssize_t zfcp_sysfs_unit_##_name##_show(struct device *dev, \ 56static ssize_t zfcp_sysfs_unit_##_name##_show(struct device *dev, struct device_attribute *attr, \
57 char *buf) \ 57 char *buf) \
58{ \ 58{ \
59 struct zfcp_unit *unit; \ 59 struct zfcp_unit *unit; \
@@ -86,7 +86,7 @@ ZFCP_DEFINE_UNIT_ATTR(access_readonly, "%d\n", atomic_test_mask
86 * started for the belonging unit. 86 * started for the belonging unit.
87 */ 87 */
88static ssize_t 88static ssize_t
89zfcp_sysfs_unit_failed_store(struct device *dev, const char *buf, size_t count) 89zfcp_sysfs_unit_failed_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
90{ 90{
91 struct zfcp_unit *unit; 91 struct zfcp_unit *unit;
92 unsigned int val; 92 unsigned int val;
@@ -123,7 +123,7 @@ zfcp_sysfs_unit_failed_store(struct device *dev, const char *buf, size_t count)
123 * "0" if unit is working, otherwise "1". 123 * "0" if unit is working, otherwise "1".
124 */ 124 */
125static ssize_t 125static ssize_t
126zfcp_sysfs_unit_failed_show(struct device *dev, char *buf) 126zfcp_sysfs_unit_failed_show(struct device *dev, struct device_attribute *attr, char *buf)
127{ 127{
128 struct zfcp_unit *unit; 128 struct zfcp_unit *unit;
129 129
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index a2b18f5a4f93..34dbc37a79d4 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -1695,8 +1695,6 @@ static int twa_scsi_eh_reset(struct scsi_cmnd *SCpnt)
1695 1695
1696 tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; 1696 tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
1697 1697
1698 spin_unlock_irq(tw_dev->host->host_lock);
1699
1700 tw_dev->num_resets++; 1698 tw_dev->num_resets++;
1701 1699
1702 printk(KERN_WARNING "3w-9xxx: scsi%d: WARNING: (0x%02X:0x%04X): Unit #%d: Command (0x%x) timed out, resetting card.\n", tw_dev->host->host_no, TW_DRIVER, 0x2c, SCpnt->device->id, SCpnt->cmnd[0]); 1700 printk(KERN_WARNING "3w-9xxx: scsi%d: WARNING: (0x%02X:0x%04X): Unit #%d: Command (0x%x) timed out, resetting card.\n", tw_dev->host->host_no, TW_DRIVER, 0x2c, SCpnt->device->id, SCpnt->cmnd[0]);
@@ -1709,7 +1707,6 @@ static int twa_scsi_eh_reset(struct scsi_cmnd *SCpnt)
1709 1707
1710 retval = SUCCESS; 1708 retval = SUCCESS;
1711out: 1709out:
1712 spin_lock_irq(tw_dev->host->host_lock);
1713 return retval; 1710 return retval;
1714} /* End twa_scsi_eh_reset() */ 1711} /* End twa_scsi_eh_reset() */
1715 1712
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index 48f9ece1cbd0..b6dc576da430 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -1430,8 +1430,6 @@ static int tw_scsi_eh_reset(struct scsi_cmnd *SCpnt)
1430 1430
1431 tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; 1431 tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
1432 1432
1433 spin_unlock_irq(tw_dev->host->host_lock);
1434
1435 tw_dev->num_resets++; 1433 tw_dev->num_resets++;
1436 1434
1437 printk(KERN_WARNING "3w-xxxx: scsi%d: WARNING: Unit #%d: Command (0x%x) timed out, resetting card.\n", tw_dev->host->host_no, SCpnt->device->id, SCpnt->cmnd[0]); 1435 printk(KERN_WARNING "3w-xxxx: scsi%d: WARNING: Unit #%d: Command (0x%x) timed out, resetting card.\n", tw_dev->host->host_no, SCpnt->device->id, SCpnt->cmnd[0]);
@@ -1444,7 +1442,6 @@ static int tw_scsi_eh_reset(struct scsi_cmnd *SCpnt)
1444 1442
1445 retval = SUCCESS; 1443 retval = SUCCESS;
1446out: 1444out:
1447 spin_lock_irq(tw_dev->host->host_lock);
1448 return retval; 1445 return retval;
1449} /* End tw_scsi_eh_reset() */ 1446} /* End tw_scsi_eh_reset() */
1450 1447
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index 4b1bb529f676..a7620fc368e7 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -170,7 +170,6 @@ MODULE_LICENSE("GPL");
170STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); 170STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *));
171STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); 171STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt);
172STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); 172STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt);
173STATIC int NCR_700_dev_reset(struct scsi_cmnd * SCpnt);
174STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt); 173STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt);
175STATIC void NCR_700_chip_setup(struct Scsi_Host *host); 174STATIC void NCR_700_chip_setup(struct Scsi_Host *host);
176STATIC void NCR_700_chip_reset(struct Scsi_Host *host); 175STATIC void NCR_700_chip_reset(struct Scsi_Host *host);
@@ -330,7 +329,6 @@ NCR_700_detect(struct scsi_host_template *tpnt,
330 /* Fill in the missing routines from the host template */ 329 /* Fill in the missing routines from the host template */
331 tpnt->queuecommand = NCR_700_queuecommand; 330 tpnt->queuecommand = NCR_700_queuecommand;
332 tpnt->eh_abort_handler = NCR_700_abort; 331 tpnt->eh_abort_handler = NCR_700_abort;
333 tpnt->eh_device_reset_handler = NCR_700_dev_reset;
334 tpnt->eh_bus_reset_handler = NCR_700_bus_reset; 332 tpnt->eh_bus_reset_handler = NCR_700_bus_reset;
335 tpnt->eh_host_reset_handler = NCR_700_host_reset; 333 tpnt->eh_host_reset_handler = NCR_700_host_reset;
336 tpnt->can_queue = NCR_700_COMMAND_SLOTS_PER_HOST; 334 tpnt->can_queue = NCR_700_COMMAND_SLOTS_PER_HOST;
@@ -1959,34 +1957,31 @@ NCR_700_bus_reset(struct scsi_cmnd * SCp)
1959 printk(KERN_INFO "scsi%d (%d:%d) New error handler wants BUS reset, cmd %p\n\t", 1957 printk(KERN_INFO "scsi%d (%d:%d) New error handler wants BUS reset, cmd %p\n\t",
1960 SCp->device->host->host_no, SCp->device->id, SCp->device->lun, SCp); 1958 SCp->device->host->host_no, SCp->device->id, SCp->device->lun, SCp);
1961 scsi_print_command(SCp); 1959 scsi_print_command(SCp);
1960
1962 /* In theory, eh_complete should always be null because the 1961 /* In theory, eh_complete should always be null because the
1963 * eh is single threaded, but just in case we're handling a 1962 * eh is single threaded, but just in case we're handling a
1964 * reset via sg or something */ 1963 * reset via sg or something */
1965 while(hostdata->eh_complete != NULL) { 1964 spin_lock_irq(SCp->device->host->host_lock);
1965 while (hostdata->eh_complete != NULL) {
1966 spin_unlock_irq(SCp->device->host->host_lock); 1966 spin_unlock_irq(SCp->device->host->host_lock);
1967 msleep_interruptible(100); 1967 msleep_interruptible(100);
1968 spin_lock_irq(SCp->device->host->host_lock); 1968 spin_lock_irq(SCp->device->host->host_lock);
1969 } 1969 }
1970
1970 hostdata->eh_complete = &complete; 1971 hostdata->eh_complete = &complete;
1971 NCR_700_internal_bus_reset(SCp->device->host); 1972 NCR_700_internal_bus_reset(SCp->device->host);
1973
1972 spin_unlock_irq(SCp->device->host->host_lock); 1974 spin_unlock_irq(SCp->device->host->host_lock);
1973 wait_for_completion(&complete); 1975 wait_for_completion(&complete);
1974 spin_lock_irq(SCp->device->host->host_lock); 1976 spin_lock_irq(SCp->device->host->host_lock);
1977
1975 hostdata->eh_complete = NULL; 1978 hostdata->eh_complete = NULL;
1976 /* Revalidate the transport parameters of the failing device */ 1979 /* Revalidate the transport parameters of the failing device */
1977 if(hostdata->fast) 1980 if(hostdata->fast)
1978 spi_schedule_dv_device(SCp->device); 1981 spi_schedule_dv_device(SCp->device);
1979 return SUCCESS;
1980}
1981 1982
1982STATIC int 1983 spin_unlock_irq(SCp->device->host->host_lock);
1983NCR_700_dev_reset(struct scsi_cmnd * SCp) 1984 return SUCCESS;
1984{
1985 printk(KERN_INFO "scsi%d (%d:%d) New error handler wants device reset\n\t",
1986 SCp->device->host->host_no, SCp->device->id, SCp->device->lun);
1987 scsi_print_command(SCp);
1988
1989 return FAILED;
1990} 1985}
1991 1986
1992STATIC int 1987STATIC int
@@ -1996,8 +1991,13 @@ NCR_700_host_reset(struct scsi_cmnd * SCp)
1996 SCp->device->host->host_no, SCp->device->id, SCp->device->lun); 1991 SCp->device->host->host_no, SCp->device->id, SCp->device->lun);
1997 scsi_print_command(SCp); 1992 scsi_print_command(SCp);
1998 1993
1994 spin_lock_irq(SCp->device->host->host_lock);
1995
1999 NCR_700_internal_bus_reset(SCp->device->host); 1996 NCR_700_internal_bus_reset(SCp->device->host);
2000 NCR_700_chip_reset(SCp->device->host); 1997 NCR_700_chip_reset(SCp->device->host);
1998
1999 spin_unlock_irq(SCp->device->host->host_lock);
2000
2001 return SUCCESS; 2001 return SUCCESS;
2002} 2002}
2003 2003
@@ -2125,7 +2125,7 @@ static int NCR_700_change_queue_type(struct scsi_device *SDp, int tag_type)
2125} 2125}
2126 2126
2127static ssize_t 2127static ssize_t
2128NCR_700_show_active_tags(struct device *dev, char *buf) 2128NCR_700_show_active_tags(struct device *dev, struct device_attribute *attr, char *buf)
2129{ 2129{
2130 struct scsi_device *SDp = to_scsi_device(dev); 2130 struct scsi_device *SDp = to_scsi_device(dev);
2131 2131
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index 15e4b122d56e..9d6040bfa064 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -2746,9 +2746,15 @@ static int BusLogic_host_reset(struct scsi_cmnd * SCpnt)
2746 2746
2747 unsigned int id = SCpnt->device->id; 2747 unsigned int id = SCpnt->device->id;
2748 struct BusLogic_TargetStatistics *stats = &HostAdapter->TargetStatistics[id]; 2748 struct BusLogic_TargetStatistics *stats = &HostAdapter->TargetStatistics[id];
2749 int rc;
2750
2751 spin_lock_irq(SCpnt->device->host->host_lock);
2752
2749 BusLogic_IncrementErrorCounter(&stats->HostAdapterResetsRequested); 2753 BusLogic_IncrementErrorCounter(&stats->HostAdapterResetsRequested);
2750 2754
2751 return BusLogic_ResetHostAdapter(HostAdapter, false); 2755 rc = BusLogic_ResetHostAdapter(HostAdapter, false);
2756 spin_unlock_irq(SCpnt->device->host->host_lock);
2757 return rc;
2752} 2758}
2753 2759
2754/* 2760/*
diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c
index 56a695c6ab52..5beed4f6d985 100644
--- a/drivers/scsi/FlashPoint.c
+++ b/drivers/scsi/FlashPoint.c
@@ -22,8 +22,6 @@
22#ifndef CONFIG_SCSI_OMIT_FLASHPOINT 22#ifndef CONFIG_SCSI_OMIT_FLASHPOINT
23 23
24 24
25#define UNIX
26#define FW_TYPE _SCCB_MGR_
27#define MAX_CARDS 8 25#define MAX_CARDS 8
28#undef BUSTYPE_PCI 26#undef BUSTYPE_PCI
29 27
@@ -34,8 +32,6 @@
34#define OS_OutPortByte(port, value) outb(value, port) 32#define OS_OutPortByte(port, value) outb(value, port)
35#define OS_OutPortWord(port, value) outw(value, port) 33#define OS_OutPortWord(port, value) outw(value, port)
36#define OS_OutPortLong(port, value) outl(value, port) 34#define OS_OutPortLong(port, value) outl(value, port)
37#define OS_Lock(x)
38#define OS_UnLock(x)
39 35
40 36
41/* 37/*
@@ -51,164 +47,17 @@
51#define SccbMgr_isr FlashPoint_HandleInterrupt 47#define SccbMgr_isr FlashPoint_HandleInterrupt
52 48
53 49
54/*
55 Define name replacements to avoid kernel namespace pollution.
56*/
57
58#define BL_Card FPT_BL_Card
59#define BusMasterInit FPT_BusMasterInit
60#define CalcCrc16 FPT_CalcCrc16
61#define CalcLrc FPT_CalcLrc
62#define ChkIfChipInitialized FPT_ChkIfChipInitialized
63#define DiagBusMaster FPT_DiagBusMaster
64#define DiagEEPROM FPT_DiagEEPROM
65#define DiagXbow FPT_DiagXbow
66#define GetTarLun FPT_GetTarLun
67#define RNVRamData FPT_RNVRamData
68#define RdStack FPT_RdStack
69#define SccbMgrTableInitAll FPT_SccbMgrTableInitAll
70#define SccbMgrTableInitCard FPT_SccbMgrTableInitCard
71#define SccbMgrTableInitTarget FPT_SccbMgrTableInitTarget
72#define SccbMgr_bad_isr FPT_SccbMgr_bad_isr
73#define SccbMgr_scsi_reset FPT_SccbMgr_scsi_reset
74#define SccbMgr_timer_expired FPT_SccbMgr_timer_expired
75#define SendMsg FPT_SendMsg
76#define Wait FPT_Wait
77#define Wait1Second FPT_Wait1Second
78#define WrStack FPT_WrStack
79#define XbowInit FPT_XbowInit
80#define autoCmdCmplt FPT_autoCmdCmplt
81#define autoLoadDefaultMap FPT_autoLoadDefaultMap
82#define busMstrDataXferStart FPT_busMstrDataXferStart
83#define busMstrSGDataXferStart FPT_busMstrSGDataXferStart
84#define busMstrTimeOut FPT_busMstrTimeOut
85#define dataXferProcessor FPT_dataXferProcessor
86#define default_intena FPT_default_intena
87#define hostDataXferAbort FPT_hostDataXferAbort
88#define hostDataXferRestart FPT_hostDataXferRestart
89#define inisci FPT_inisci
90#define mbCards FPT_mbCards
91#define nvRamInfo FPT_nvRamInfo
92#define phaseBusFree FPT_phaseBusFree
93#define phaseChkFifo FPT_phaseChkFifo
94#define phaseCommand FPT_phaseCommand
95#define phaseDataIn FPT_phaseDataIn
96#define phaseDataOut FPT_phaseDataOut
97#define phaseDecode FPT_phaseDecode
98#define phaseIllegal FPT_phaseIllegal
99#define phaseMsgIn FPT_phaseMsgIn
100#define phaseMsgOut FPT_phaseMsgOut
101#define phaseStatus FPT_phaseStatus
102#define queueAddSccb FPT_queueAddSccb
103#define queueCmdComplete FPT_queueCmdComplete
104#define queueDisconnect FPT_queueDisconnect
105#define queueFindSccb FPT_queueFindSccb
106#define queueFlushSccb FPT_queueFlushSccb
107#define queueFlushTargSccb FPT_queueFlushTargSccb
108#define queueSearchSelect FPT_queueSearchSelect
109#define queueSelectFail FPT_queueSelectFail
110#define s_PhaseTbl FPT_s_PhaseTbl
111#define scamHAString FPT_scamHAString
112#define scamInfo FPT_scamInfo
113#define scarb FPT_scarb
114#define scasid FPT_scasid
115#define scbusf FPT_scbusf
116#define sccbMgrTbl FPT_sccbMgrTbl
117#define schkdd FPT_schkdd
118#define scini FPT_scini
119#define sciso FPT_sciso
120#define scmachid FPT_scmachid
121#define scsavdi FPT_scsavdi
122#define scsel FPT_scsel
123#define scsell FPT_scsell
124#define scsendi FPT_scsendi
125#define scvalq FPT_scvalq
126#define scwirod FPT_scwirod
127#define scwiros FPT_scwiros
128#define scwtsel FPT_scwtsel
129#define scxferc FPT_scxferc
130#define sdecm FPT_sdecm
131#define sfm FPT_sfm
132#define shandem FPT_shandem
133#define sinits FPT_sinits
134#define sisyncn FPT_sisyncn
135#define sisyncr FPT_sisyncr
136#define siwidn FPT_siwidn
137#define siwidr FPT_siwidr
138#define sres FPT_sres
139#define sresb FPT_sresb
140#define ssel FPT_ssel
141#define ssenss FPT_ssenss
142#define sssyncv FPT_sssyncv
143#define stsyncn FPT_stsyncn
144#define stwidn FPT_stwidn
145#define sxfrp FPT_sxfrp
146#define utilEERead FPT_utilEERead
147#define utilEEReadOrg FPT_utilEEReadOrg
148#define utilEESendCmdAddr FPT_utilEESendCmdAddr
149#define utilEEWrite FPT_utilEEWrite
150#define utilEEWriteOnOff FPT_utilEEWriteOnOff
151#define utilUpdateResidual FPT_utilUpdateResidual
152
153
154/*----------------------------------------------------------------------
155 *
156 *
157 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
158 *
159 * This file is available under both the GNU General Public License
160 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
161 *
162 * $Workfile: globals.h $
163 *
164 * Description: Common shared global defines.
165 *
166 * $Date: 1996/09/04 01:26:13 $
167 *
168 * $Revision: 1.11 $
169 *
170 *----------------------------------------------------------------------*/
171#ifndef __GLOBALS_H__
172#define __GLOBALS_H__
173
174#define _UCB_MGR_ 1
175#define _SCCB_MGR_ 2
176
177/*#include <osflags.h>*/
178
179#define MAX_CDBLEN 12 50#define MAX_CDBLEN 12
180 51
181#define SCAM_LEV_2 1 52#define SCAM_LEV_2 1
182 53
183#define CRCMASK 0xA001 54#define CRCMASK 0xA001
184 55
185/* In your osflags.h file, please ENSURE that only ONE OS FLAG
186 is on at a time !!! Also, please make sure you turn set the
187 variable FW_TYPE to either _UCB_MGR_ or _SCCB_MGR_ !!! */
188
189#if defined(DOS) || defined(WIN95_16) || defined(OS2) || defined(OTHER_16)
190 #define COMPILER_16_BIT 1
191#elif defined(NETWARE) || defined(NT) || defined(WIN95_32) || defined(UNIX) || defined(OTHER_32) || defined(SOLARIS_REAL_MODE)
192 #define COMPILER_32_BIT 1
193#endif
194
195
196#define BL_VENDOR_ID 0x104B 56#define BL_VENDOR_ID 0x104B
197#define FP_DEVICE_ID 0x8130 57#define FP_DEVICE_ID 0x8130
198#define MM_DEVICE_ID 0x1040 58#define MM_DEVICE_ID 0x1040
199 59
200 60
201#ifndef FALSE
202#define FALSE 0
203#endif
204#ifndef TRUE
205#define TRUE (!(FALSE))
206#endif
207
208#ifndef NULL
209#define NULL 0
210#endif
211
212#define FAILURE 0xFFFFFFFFL 61#define FAILURE 0xFFFFFFFFL
213 62
214 63
@@ -222,27 +71,11 @@ typedef unsigned long * PULONG;
222typedef void * PVOID; 71typedef void * PVOID;
223 72
224 73
225#if defined(COMPILER_16_BIT)
226typedef unsigned char far * uchar_ptr;
227typedef unsigned short far * ushort_ptr;
228typedef unsigned long far * ulong_ptr;
229#endif /* 16_BIT_COMPILER */
230
231#if defined(COMPILER_32_BIT)
232typedef unsigned char * uchar_ptr; 74typedef unsigned char * uchar_ptr;
233typedef unsigned short * ushort_ptr; 75typedef unsigned short * ushort_ptr;
234typedef unsigned long * ulong_ptr; 76typedef unsigned long * ulong_ptr;
235#endif /* 32_BIT_COMPILER */
236 77
237 78
238/* NEW TYPE DEFINITIONS (shared with Mylex North)
239
240** Use following type defines to avoid confusion in 16 and 32-bit
241** environments. Avoid using 'int' as it denotes 16 bits in 16-bit
242** environment and 32 in 32-bit environments.
243
244*/
245
246#define s08bits char 79#define s08bits char
247#define s16bits short 80#define s16bits short
248#define s32bits long 81#define s32bits long
@@ -251,195 +84,19 @@ typedef unsigned long * ulong_ptr;
251#define u16bits unsigned s16bits 84#define u16bits unsigned s16bits
252#define u32bits unsigned s32bits 85#define u32bits unsigned s32bits
253 86
254#if defined(COMPILER_16_BIT)
255
256typedef u08bits far * pu08bits;
257typedef u16bits far * pu16bits;
258typedef u32bits far * pu32bits;
259
260#endif /* COMPILER_16_BIT */
261
262#if defined(COMPILER_32_BIT)
263
264typedef u08bits * pu08bits; 87typedef u08bits * pu08bits;
265typedef u16bits * pu16bits; 88typedef u16bits * pu16bits;
266typedef u32bits * pu32bits; 89typedef u32bits * pu32bits;
267 90
268#endif /* COMPILER_32_BIT */
269
270 91
271#define BIT(x) ((UCHAR)(1<<(x))) /* single-bit mask in bit position x */ 92#define BIT(x) ((UCHAR)(1<<(x))) /* single-bit mask in bit position x */
272#define BITW(x) ((USHORT)(1<<(x))) /* single-bit mask in bit position x */ 93#define BITW(x) ((USHORT)(1<<(x))) /* single-bit mask in bit position x */
273 94
274 95
275 96
276#if defined(DOS)
277/*#include <dos.h>*/
278 #undef inportb /* undefine for Borland Lib */
279 #undef inport /* they may have define I/O function in LIB */
280 #undef outportb
281 #undef outport
282
283 #define OS_InPortByte(ioport) inportb(ioport)
284 #define OS_InPortWord(ioport) inport(ioport)
285 #define OS_InPortLong(ioport) inportq(ioport, val)
286 #define OS_OutPortByte(ioport, val) outportb(ioport, val)
287 #define OS_OutPortWord(ioport, val) outport(ioport, val)
288 #define OS_OutPortLong(ioport) outportq(ioport, val)
289#endif /* DOS */
290
291#if defined(NETWARE) || defined(OTHER_32) || defined(OTHER_16)
292 extern u08bits OS_InPortByte(u32bits ioport);
293 extern u16bits OS_InPortWord(u32bits ioport);
294 extern u32bits OS_InPortLong(u32bits ioport);
295
296 extern OS_InPortByteBuffer(u32bits ioport, pu08bits buffer, u32bits count);
297 extern OS_InPortWordBuffer(u32bits ioport, pu16bits buffer, u32bits count);
298 extern OS_OutPortByte(u32bits ioport, u08bits val);
299 extern OS_OutPortWord(u32bits ioport, u16bits val);
300 extern OS_OutPortLong(u32bits ioport, u32bits val);
301 extern OS_OutPortByteBuffer(u32bits ioport, pu08bits buffer, u32bits count);
302 extern OS_OutPortWordBuffer(u32bits ioport, pu16bits buffer, u32bits count);
303#endif /* NETWARE || OTHER_32 || OTHER_16 */
304
305#if defined (NT) || defined(WIN95_32) || defined(WIN95_16)
306 #if defined(NT)
307
308 extern __declspec(dllimport) u08bits ScsiPortReadPortUchar(pu08bits ioport);
309 extern __declspec(dllimport) u16bits ScsiPortReadPortUshort(pu16bits ioport);
310 extern __declspec(dllimport) u32bits ScsiPortReadPortUlong(pu32bits ioport);
311 extern __declspec(dllimport) void ScsiPortWritePortUchar(pu08bits ioport, u08bits val);
312 extern __declspec(dllimport) void ScsiPortWritePortUshort(pu16bits port, u16bits val);
313 extern __declspec(dllimport) void ScsiPortWritePortUlong(pu32bits port, u32bits val);
314
315 #else
316
317 extern u08bits ScsiPortReadPortUchar(pu08bits ioport);
318 extern u16bits ScsiPortReadPortUshort(pu16bits ioport);
319 extern u32bits ScsiPortReadPortUlong(pu32bits ioport);
320 extern void ScsiPortWritePortUchar(pu08bits ioport, u08bits val);
321 extern void ScsiPortWritePortUshort(pu16bits port, u16bits val);
322 extern void ScsiPortWritePortUlong(pu32bits port, u32bits val);
323 #endif
324 97
325 98typedef struct _SCCB *PSCCB;
326 #define OS_InPortByte(ioport) ScsiPortReadPortUchar((pu08bits) ioport) 99typedef void (*CALL_BK_FN)(PSCCB);
327 #define OS_InPortWord(ioport) ScsiPortReadPortUshort((pu16bits) ioport)
328 #define OS_InPortLong(ioport) ScsiPortReadPortUlong((pu32bits) ioport)
329
330 #define OS_OutPortByte(ioport, val) ScsiPortWritePortUchar((pu08bits) ioport, (u08bits) val)
331 #define OS_OutPortWord(ioport, val) ScsiPortWritePortUshort((pu16bits) ioport, (u16bits) val)
332 #define OS_OutPortLong(ioport, val) ScsiPortWritePortUlong((pu32bits) ioport, (u32bits) val)
333 #define OS_OutPortByteBuffer(ioport, buffer, count) \
334 ScsiPortWritePortBufferUchar((pu08bits)&port, (pu08bits) buffer, (u32bits) count)
335 #define OS_OutPortWordBuffer(ioport, buffer, count) \
336 ScsiPortWritePortBufferUshort((pu16bits)&port, (pu16bits) buffer, (u32bits) count)
337
338 #define OS_Lock(x)
339 #define OS_UnLock(x)
340#endif /* NT || WIN95_32 || WIN95_16 */
341
342#if defined (UNIX) && !defined(OS_InPortByte)
343 #define OS_InPortByte(ioport) inb((u16bits)ioport)
344 #define OS_InPortWord(ioport) inw((u16bits)ioport)
345 #define OS_InPortLong(ioport) inl((u16bits)ioport)
346 #define OS_OutPortByte(ioport,val) outb((u16bits)ioport, (u08bits)val)
347 #define OS_OutPortWord(ioport,val) outw((u16bits)ioport, (u16bits)val)
348 #define OS_OutPortLong(ioport,val) outl((u16bits)ioport, (u32bits)val)
349
350 #define OS_Lock(x)
351 #define OS_UnLock(x)
352#endif /* UNIX */
353
354
355#if defined(OS2)
356 extern u08bits inb(u32bits ioport);
357 extern u16bits inw(u32bits ioport);
358 extern void outb(u32bits ioport, u08bits val);
359 extern void outw(u32bits ioport, u16bits val);
360
361 #define OS_InPortByte(ioport) inb(ioport)
362 #define OS_InPortWord(ioport) inw(ioport)
363 #define OS_OutPortByte(ioport, val) outb(ioport, val)
364 #define OS_OutPortWord(ioport, val) outw(ioport, val)
365 extern u32bits OS_InPortLong(u32bits ioport);
366 extern void OS_OutPortLong(u32bits ioport, u32bits val);
367
368 #define OS_Lock(x)
369 #define OS_UnLock(x)
370#endif /* OS2 */
371
372#if defined(SOLARIS_REAL_MODE)
373
374extern unsigned char inb(unsigned long ioport);
375extern unsigned short inw(unsigned long ioport);
376
377#define OS_InPortByte(ioport) inb(ioport)
378#define OS_InPortWord(ioport) inw(ioport)
379
380extern void OS_OutPortByte(unsigned long ioport, unsigned char val);
381extern void OS_OutPortWord(unsigned long ioport, unsigned short val);
382extern unsigned long OS_InPortLong(unsigned long ioport);
383extern void OS_OutPortLong(unsigned long ioport, unsigned long val);
384
385#define OS_Lock(x)
386#define OS_UnLock(x)
387
388#endif /* SOLARIS_REAL_MODE */
389
390#endif /* __GLOBALS_H__ */
391
392/*----------------------------------------------------------------------
393 *
394 *
395 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
396 *
397 * This file is available under both the GNU General Public License
398 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
399 *
400 * $Workfile: sccbmgr.h $
401 *
402 * Description: Common shared SCCB Interface defines and SCCB
403 * Manager specifics defines.
404 *
405 * $Date: 1996/10/24 23:09:33 $
406 *
407 * $Revision: 1.14 $
408 *
409 *----------------------------------------------------------------------*/
410
411#ifndef __SCCB_H__
412#define __SCCB_H__
413
414/*#include <osflags.h>*/
415/*#include <globals.h>*/
416
417#if defined(BUGBUG)
418#define debug_size 32
419#endif
420
421#if defined(DOS)
422
423 typedef struct _SCCB near *PSCCB;
424 #if (FW_TYPE == _SCCB_MGR_)
425 typedef void (*CALL_BK_FN)(PSCCB);
426 #endif
427
428#elif defined(OS2)
429
430 typedef struct _SCCB far *PSCCB;
431 #if (FW_TYPE == _SCCB_MGR_)
432 typedef void (far *CALL_BK_FN)(PSCCB);
433 #endif
434
435#else
436
437 typedef struct _SCCB *PSCCB;
438 #if (FW_TYPE == _SCCB_MGR_)
439 typedef void (*CALL_BK_FN)(PSCCB);
440 #endif
441
442#endif
443 100
444 101
445typedef struct SCCBMgr_info { 102typedef struct SCCBMgr_info {
@@ -466,25 +123,13 @@ typedef struct SCCBMgr_info {
466 ULONG si_secondary_range; 123 ULONG si_secondary_range;
467} SCCBMGR_INFO; 124} SCCBMGR_INFO;
468 125
469#if defined(DOS) 126typedef SCCBMGR_INFO * PSCCBMGR_INFO;
470 typedef SCCBMGR_INFO * PSCCBMGR_INFO;
471#else
472 #if defined (COMPILER_16_BIT)
473 typedef SCCBMGR_INFO far * PSCCBMGR_INFO;
474 #else
475 typedef SCCBMGR_INFO * PSCCBMGR_INFO;
476 #endif
477#endif // defined(DOS)
478 127
479 128
480 129#define SCSI_PARITY_ENA 0x0001
481 130#define LOW_BYTE_TERM 0x0010
482#if (FW_TYPE==_SCCB_MGR_) 131#define HIGH_BYTE_TERM 0x0020
483 #define SCSI_PARITY_ENA 0x0001 132#define BUSTYPE_PCI 0x3
484 #define LOW_BYTE_TERM 0x0010
485 #define HIGH_BYTE_TERM 0x0020
486 #define BUSTYPE_PCI 0x3
487#endif
488 133
489#define SUPPORT_16TAR_32LUN 0x0002 134#define SUPPORT_16TAR_32LUN 0x0002
490#define SOFT_RESET 0x0004 135#define SOFT_RESET 0x0004
@@ -553,9 +198,6 @@ typedef struct _SCCB {
553 UCHAR Save_CdbLen; 198 UCHAR Save_CdbLen;
554 UCHAR Sccb_XferState; 199 UCHAR Sccb_XferState;
555 ULONG Sccb_SGoffset; 200 ULONG Sccb_SGoffset;
556#if (FW_TYPE == _UCB_MGR_)
557 PUCB Sccb_ucb_ptr;
558#endif
559 } SCCB; 201 } SCCB;
560 202
561#define SCCB_SIZE sizeof(SCCB) 203#define SCCB_SIZE sizeof(SCCB)
@@ -626,25 +268,9 @@ typedef struct _SCCB {
626 268
627 269
628 270
629#if (FW_TYPE==_UCB_MGR_) 271#define SCCB_INVALID_DIRECTION 0x18 /* Invalid target direction */
630 #define HBA_AUTO_SENSE_FAIL 0x1B 272#define SCCB_DUPLICATE_SCCB 0x19 /* Duplicate SCCB */
631 #define HBA_TQ_REJECTED 0x1C 273#define SCCB_SCSI_RST 0x35 /* SCSI RESET detected. */
632 #define HBA_UNSUPPORTED_MSG 0x1D
633 #define HBA_HW_ERROR 0x20
634 #define HBA_ATN_NOT_RESPONDED 0x21
635 #define HBA_SCSI_RESET_BY_ADAPTER 0x22
636 #define HBA_SCSI_RESET_BY_TARGET 0x23
637 #define HBA_WRONG_CONNECTION 0x24
638 #define HBA_BUS_DEVICE_RESET 0x25
639 #define HBA_ABORT_QUEUE 0x26
640
641#else // these are not defined in BUDI/UCB
642
643 #define SCCB_INVALID_DIRECTION 0x18 /* Invalid target direction */
644 #define SCCB_DUPLICATE_SCCB 0x19 /* Duplicate SCCB */
645 #define SCCB_SCSI_RST 0x35 /* SCSI RESET detected. */
646
647#endif // (FW_TYPE==_UCB_MGR_)
648 274
649 275
650#define SCCB_IN_PROCESS 0x00 276#define SCCB_IN_PROCESS 0x00
@@ -657,115 +283,20 @@ typedef struct _SCCB {
657#define SCCB_SIZE sizeof(SCCB) 283#define SCCB_SIZE sizeof(SCCB)
658 284
659 285
660
661
662#if (FW_TYPE == _UCB_MGR_)
663 void SccbMgr_start_sccb(CARD_HANDLE pCurrCard, PUCB p_ucb);
664 s32bits SccbMgr_abort_sccb(CARD_HANDLE pCurrCard, PUCB p_ucb);
665 u08bits SccbMgr_my_int(CARD_HANDLE pCurrCard);
666 s32bits SccbMgr_isr(CARD_HANDLE pCurrCard);
667 void SccbMgr_scsi_reset(CARD_HANDLE pCurrCard);
668 void SccbMgr_timer_expired(CARD_HANDLE pCurrCard);
669 void SccbMgr_unload_card(CARD_HANDLE pCurrCard);
670 void SccbMgr_restore_foreign_state(CARD_HANDLE pCurrCard);
671 void SccbMgr_restore_native_state(CARD_HANDLE pCurrCard);
672 void SccbMgr_save_foreign_state(PADAPTER_INFO pAdapterInfo);
673
674#endif
675
676
677#if (FW_TYPE == _SCCB_MGR_)
678
679 #if defined (DOS)
680 int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo);
681 USHORT SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo);
682 void SccbMgr_start_sccb(USHORT pCurrCard, PSCCB p_SCCB);
683 int SccbMgr_abort_sccb(USHORT pCurrCard, PSCCB p_SCCB);
684 UCHAR SccbMgr_my_int(USHORT pCurrCard);
685 int SccbMgr_isr(USHORT pCurrCard);
686 void SccbMgr_scsi_reset(USHORT pCurrCard);
687 void SccbMgr_timer_expired(USHORT pCurrCard);
688 USHORT SccbMgr_status(USHORT pCurrCard);
689 void SccbMgr_unload_card(USHORT pCurrCard);
690
691 #else //non-DOS
692
693 int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo);
694 ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo);
695 void SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_SCCB);
696 int SccbMgr_abort_sccb(ULONG pCurrCard, PSCCB p_SCCB);
697 UCHAR SccbMgr_my_int(ULONG pCurrCard);
698 int SccbMgr_isr(ULONG pCurrCard);
699 void SccbMgr_scsi_reset(ULONG pCurrCard);
700 void SccbMgr_enable_int(ULONG pCurrCard);
701 void SccbMgr_disable_int(ULONG pCurrCard);
702 void SccbMgr_timer_expired(ULONG pCurrCard);
703 void SccbMgr_unload_card(ULONG pCurrCard);
704
705 #endif
706#endif // (FW_TYPE == _SCCB_MGR_)
707
708#endif /* __SCCB_H__ */
709
710/*----------------------------------------------------------------------
711 *
712 *
713 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
714 *
715 * This file is available under both the GNU General Public License
716 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
717 *
718 * $Workfile: blx30.h $
719 *
720 * Description: This module contains SCCB/UCB Manager implementation
721 * specific stuff.
722 *
723 * $Date: 1996/11/13 18:34:22 $
724 *
725 * $Revision: 1.10 $
726 *
727 *----------------------------------------------------------------------*/
728
729
730#ifndef __blx30_H__
731#define __blx30_H__
732
733/*#include <globals.h>*/
734
735#define ORION_FW_REV 3110 286#define ORION_FW_REV 3110
736 287
737
738
739
740#define HARP_REVD 1 288#define HARP_REVD 1
741 289
742 290
743#if defined(DOS)
744#define QUEUE_DEPTH 8+1 /*1 for Normal disconnect 0 for Q'ing. */
745#else
746#define QUEUE_DEPTH 254+1 /*1 for Normal disconnect 32 for Q'ing. */ 291#define QUEUE_DEPTH 254+1 /*1 for Normal disconnect 32 for Q'ing. */
747#endif // defined(DOS)
748 292
749#define MAX_MB_CARDS 4 /* Max. no of cards suppoerted on Mother Board */ 293#define MAX_MB_CARDS 4 /* Max. no of cards suppoerted on Mother Board */
750 294
751#define WIDE_SCSI 1 295#define WIDE_SCSI 1
752 296
753#if defined(WIDE_SCSI) 297#define MAX_SCSI_TAR 16
754 #if defined(DOS) 298#define MAX_LUN 32
755 #define MAX_SCSI_TAR 16 299#define LUN_MASK 0x1f
756 #define MAX_LUN 8
757 #define LUN_MASK 0x07
758 #else
759 #define MAX_SCSI_TAR 16
760 #define MAX_LUN 32
761 #define LUN_MASK 0x1f
762
763 #endif
764#else
765 #define MAX_SCSI_TAR 8
766 #define MAX_LUN 8
767 #define LUN_MASK 0x07
768#endif
769 300
770#if defined(HARP_REVA) 301#if defined(HARP_REVA)
771#define SG_BUF_CNT 15 /*Number of prefetched elements. */ 302#define SG_BUF_CNT 15 /*Number of prefetched elements. */
@@ -778,116 +309,12 @@ typedef struct _SCCB {
778#define SG_ELEMENT_MASK 0xFFFFFFFFL 309#define SG_ELEMENT_MASK 0xFFFFFFFFL
779 310
780 311
781#if (FW_TYPE == _UCB_MGR_) 312#define RD_HARPOON(ioport) OS_InPortByte((u32bits)ioport)
782 #define OPC_DECODE_NORMAL 0x0f7f 313#define RDW_HARPOON(ioport) OS_InPortWord((u32bits)ioport)
783#endif // _UCB_MGR_ 314#define RD_HARP32(ioport,offset,data) (data = OS_InPortLong((u32bits)(ioport + offset)))
784 315#define WR_HARPOON(ioport,val) OS_OutPortByte((u32bits)ioport,(u08bits) val)
785 316#define WRW_HARPOON(ioport,val) OS_OutPortWord((u32bits)ioport,(u16bits)val)
786 317#define WR_HARP32(ioport,offset,data) OS_OutPortLong((u32bits)(ioport + offset), data)
787#if defined(DOS)
788
789/*#include <dos.h>*/
790 #define RD_HARPOON(ioport) (OS_InPortByte(ioport))
791 #define RDW_HARPOON(ioport) (OS_InPortWord(ioport))
792 #define WR_HARPOON(ioport,val) (OS_OutPortByte(ioport,val))
793 #define WRW_HARPOON(ioport,val) (OS_OutPortWord(ioport,val))
794
795 #define RD_HARP32(port,offset,data) asm{db 66h; \
796 push ax; \
797 mov dx,port; \
798 add dx, offset; \
799 db 66h; \
800 in ax,dx; \
801 db 66h; \
802 mov word ptr data,ax;\
803 db 66h; \
804 pop ax}
805
806 #define WR_HARP32(port,offset,data) asm{db 66h; \
807 push ax; \
808 mov dx,port; \
809 add dx, offset; \
810 db 66h; \
811 mov ax,word ptr data;\
812 db 66h; \
813 out dx,ax; \
814 db 66h; \
815 pop ax}
816#endif /* DOS */
817
818#if defined(NETWARE) || defined(OTHER_32) || defined(OTHER_16)
819 #define RD_HARPOON(ioport) OS_InPortByte((unsigned long)ioport)
820 #define RDW_HARPOON(ioport) OS_InPortWord((unsigned long)ioport)
821 #define RD_HARP32(ioport,offset,data) (data = OS_InPortLong(ioport + offset))
822 #define WR_HARPOON(ioport,val) OS_OutPortByte((ULONG)ioport,(UCHAR) val)
823 #define WRW_HARPOON(ioport,val) OS_OutPortWord((ULONG)ioport,(USHORT)val)
824 #define WR_HARP32(ioport,offset,data) OS_OutPortLong((ioport + offset), data)
825#endif /* NETWARE || OTHER_32 || OTHER_16 */
826
827#if defined(NT) || defined(WIN95_32) || defined(WIN95_16)
828 #define RD_HARPOON(ioport) OS_InPortByte((ULONG)ioport)
829 #define RDW_HARPOON(ioport) OS_InPortWord((ULONG)ioport)
830 #define RD_HARP32(ioport,offset,data) (data = OS_InPortLong((ULONG)(ioport + offset)))
831 #define WR_HARPOON(ioport,val) OS_OutPortByte((ULONG)ioport,(UCHAR) val)
832 #define WRW_HARPOON(ioport,val) OS_OutPortWord((ULONG)ioport,(USHORT)val)
833 #define WR_HARP32(ioport,offset,data) OS_OutPortLong((ULONG)(ioport + offset), data)
834#endif /* NT || WIN95_32 || WIN95_16 */
835
836#if defined (UNIX)
837 #define RD_HARPOON(ioport) OS_InPortByte((u32bits)ioport)
838 #define RDW_HARPOON(ioport) OS_InPortWord((u32bits)ioport)
839 #define RD_HARP32(ioport,offset,data) (data = OS_InPortLong((u32bits)(ioport + offset)))
840 #define WR_HARPOON(ioport,val) OS_OutPortByte((u32bits)ioport,(u08bits) val)
841 #define WRW_HARPOON(ioport,val) OS_OutPortWord((u32bits)ioport,(u16bits)val)
842 #define WR_HARP32(ioport,offset,data) OS_OutPortLong((u32bits)(ioport + offset), data)
843#endif /* UNIX */
844
845#if defined(OS2)
846 #define RD_HARPOON(ioport) OS_InPortByte((unsigned long)ioport)
847 #define RDW_HARPOON(ioport) OS_InPortWord((unsigned long)ioport)
848 #define RD_HARP32(ioport,offset,data) (data = OS_InPortLong((ULONG)(ioport + offset)))
849 #define WR_HARPOON(ioport,val) OS_OutPortByte((ULONG)ioport,(UCHAR) val)
850 #define WRW_HARPOON(ioport,val) OS_OutPortWord((ULONG)ioport,(USHORT)val)
851 #define WR_HARP32(ioport,offset,data) OS_OutPortLong(((ULONG)(ioport + offset)), data)
852#endif /* OS2 */
853
854#if defined(SOLARIS_REAL_MODE)
855
856 #define RD_HARPOON(ioport) OS_InPortByte((unsigned long)ioport)
857 #define RDW_HARPOON(ioport) OS_InPortWord((unsigned long)ioport)
858 #define RD_HARP32(ioport,offset,data) (data = OS_InPortLong((ULONG)(ioport + offset)))
859 #define WR_HARPOON(ioport,val) OS_OutPortByte((ULONG)ioport,(UCHAR) val)
860 #define WRW_HARPOON(ioport,val) OS_OutPortWord((ULONG)ioport,(USHORT)val)
861 #define WR_HARP32(ioport,offset,data) OS_OutPortLong((ULONG)(ioport + offset), (ULONG)data)
862
863#endif /* SOLARIS_REAL_MODE */
864
865#endif /* __BLX30_H__ */
866
867
868/*----------------------------------------------------------------------
869 *
870 *
871 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
872 *
873 * This file is available under both the GNU General Public License
874 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
875 *
876 * $Workfile: target.h $
877 *
878 * Description: Definitions for Target related structures
879 *
880 * $Date: 1996/12/11 22:06:20 $
881 *
882 * $Revision: 1.9 $
883 *
884 *----------------------------------------------------------------------*/
885
886#ifndef __TARGET__
887#define __TARGET__
888
889/*#include <globals.h>*/
890/*#include <blx30.h>*/
891 318
892 319
893#define TAR_SYNC_MASK (BIT(7)+BIT(6)) 320#define TAR_SYNC_MASK (BIT(7)+BIT(6))
@@ -919,16 +346,7 @@ typedef struct _SCCB {
919#define EE_WIDE_SCSI BIT(7) 346#define EE_WIDE_SCSI BIT(7)
920 347
921 348
922#if defined(DOS) 349typedef struct SCCBMgr_tar_info *PSCCBMgr_tar_info;
923 typedef struct SCCBMgr_tar_info near *PSCCBMgr_tar_info;
924
925#elif defined(OS2)
926 typedef struct SCCBMgr_tar_info far *PSCCBMgr_tar_info;
927
928#else
929 typedef struct SCCBMgr_tar_info *PSCCBMgr_tar_info;
930
931#endif
932 350
933 351
934typedef struct SCCBMgr_tar_info { 352typedef struct SCCBMgr_tar_info {
@@ -949,11 +367,7 @@ typedef struct SCCBMgr_tar_info {
949typedef struct NVRAMInfo { 367typedef struct NVRAMInfo {
950 UCHAR niModel; /* Model No. of card */ 368 UCHAR niModel; /* Model No. of card */
951 UCHAR niCardNo; /* Card no. */ 369 UCHAR niCardNo; /* Card no. */
952#if defined(DOS)
953 USHORT niBaseAddr; /* Port Address of card */
954#else
955 ULONG niBaseAddr; /* Port Address of card */ 370 ULONG niBaseAddr; /* Port Address of card */
956#endif
957 UCHAR niSysConf; /* Adapter Configuration byte - Byte 16 of eeprom map */ 371 UCHAR niSysConf; /* Adapter Configuration byte - Byte 16 of eeprom map */
958 UCHAR niScsiConf; /* SCSI Configuration byte - Byte 17 of eeprom map */ 372 UCHAR niScsiConf; /* SCSI Configuration byte - Byte 17 of eeprom map */
959 UCHAR niScamConf; /* SCAM Configuration byte - Byte 20 of eeprom map */ 373 UCHAR niScamConf; /* SCAM Configuration byte - Byte 20 of eeprom map */
@@ -962,13 +376,7 @@ typedef struct NVRAMInfo {
962 UCHAR niScamTbl[MAX_SCSI_TAR][4]; /* Compressed Scam name string of Targets */ 376 UCHAR niScamTbl[MAX_SCSI_TAR][4]; /* Compressed Scam name string of Targets */
963}NVRAMINFO; 377}NVRAMINFO;
964 378
965#if defined(DOS)
966typedef NVRAMINFO near *PNVRamInfo;
967#elif defined (OS2)
968typedef NVRAMINFO far *PNVRamInfo;
969#else
970typedef NVRAMINFO *PNVRamInfo; 379typedef NVRAMINFO *PNVRamInfo;
971#endif
972 380
973#define MODEL_LT 1 381#define MODEL_LT 1
974#define MODEL_DL 2 382#define MODEL_DL 2
@@ -978,17 +386,9 @@ typedef NVRAMINFO *PNVRamInfo;
978 386
979typedef struct SCCBcard { 387typedef struct SCCBcard {
980 PSCCB currentSCCB; 388 PSCCB currentSCCB;
981#if (FW_TYPE==_SCCB_MGR_)
982 PSCCBMGR_INFO cardInfo; 389 PSCCBMGR_INFO cardInfo;
983#else
984 PADAPTER_INFO cardInfo;
985#endif
986 390
987#if defined(DOS)
988 USHORT ioPort;
989#else
990 ULONG ioPort; 391 ULONG ioPort;
991#endif
992 392
993 USHORT cmdCounter; 393 USHORT cmdCounter;
994 UCHAR discQCount; 394 UCHAR discQCount;
@@ -1002,13 +402,7 @@ typedef struct SCCBcard {
1002 402
1003}SCCBCARD; 403}SCCBCARD;
1004 404
1005#if defined(DOS)
1006typedef struct SCCBcard near *PSCCBcard;
1007#elif defined (OS2)
1008typedef struct SCCBcard far *PSCCBcard;
1009#else
1010typedef struct SCCBcard *PSCCBcard; 405typedef struct SCCBcard *PSCCBcard;
1011#endif
1012 406
1013 407
1014#define F_TAG_STARTED 0x01 408#define F_TAG_STARTED 0x01
@@ -1063,29 +457,6 @@ typedef struct SCCBscam_info {
1063 457
1064} SCCBSCAM_INFO, *PSCCBSCAM_INFO; 458} SCCBSCAM_INFO, *PSCCBSCAM_INFO;
1065 459
1066#endif
1067/*----------------------------------------------------------------------
1068 *
1069 *
1070 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
1071 *
1072 * This file is available under both the GNU General Public License
1073 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
1074 *
1075 * $Workfile: scsi2.h $
1076 *
1077 * Description: Register definitions for HARPOON ASIC.
1078 *
1079 * $Date: 1996/11/13 18:32:57 $
1080 *
1081 * $Revision: 1.4 $
1082 *
1083 *----------------------------------------------------------------------*/
1084
1085#ifndef __SCSI_H__
1086#define __SCSI_H__
1087
1088
1089 460
1090#define SCSI_TEST_UNIT_READY 0x00 461#define SCSI_TEST_UNIT_READY 0x00
1091#define SCSI_REZERO_UNIT 0x01 462#define SCSI_REZERO_UNIT 0x01
@@ -1195,29 +566,6 @@ typedef struct SCCBscam_info {
1195#define SYNC5MBS 0x32 566#define SYNC5MBS 0x32
1196#define MAX_OFFSET 0x0F /* Maxbyteoffset for Sync Xfers */ 567#define MAX_OFFSET 0x0F /* Maxbyteoffset for Sync Xfers */
1197 568
1198#endif
1199/*----------------------------------------------------------------------
1200 *
1201 *
1202 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
1203 *
1204 * This file is available under both the GNU General Public License
1205 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
1206 *
1207 * $Workfile: eeprom.h $
1208 *
1209 * Description: Definitions for EEPROM related structures
1210 *
1211 * $Date: 1996/11/13 18:28:39 $
1212 *
1213 * $Revision: 1.4 $
1214 *
1215 *----------------------------------------------------------------------*/
1216
1217#ifndef __EEPROM__
1218#define __EEPROM__
1219
1220/*#include <globals.h>*/
1221 569
1222#define EEPROM_WD_CNT 256 570#define EEPROM_WD_CNT 256
1223 571
@@ -1280,31 +628,6 @@ typedef struct SCCBscam_info {
1280 #define DISC_ENABLE_BIT BIT(6) 628 #define DISC_ENABLE_BIT BIT(6)
1281 629
1282 630
1283#endif
1284/*----------------------------------------------------------------------
1285 *
1286 *
1287 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
1288 *
1289 * This file is available under both the GNU General Public License
1290 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
1291 *
1292 * $Workfile: harpoon.h $
1293 *
1294 * Description: Register definitions for HARPOON ASIC.
1295 *
1296 * $Date: 1997/07/09 21:44:36 $
1297 *
1298 * $Revision: 1.9 $
1299 *
1300 *----------------------------------------------------------------------*/
1301
1302
1303/*#include <globals.h>*/
1304
1305#ifndef __HARPOON__
1306#define __HARPOON__
1307
1308 631
1309 #define hp_vendor_id_0 0x00 /* LSB */ 632 #define hp_vendor_id_0 0x00 /* LSB */
1310 #define ORION_VEND_0 0x4B 633 #define ORION_VEND_0 0x4B
@@ -1578,8 +901,6 @@ typedef struct SCCBscam_info {
1578 901
1579 902
1580 903
1581 extern USHORT default_intena;
1582
1583 #define hp_intena 0x40 904 #define hp_intena 0x40
1584 905
1585 #define RESET BITW(7) 906 #define RESET BITW(7)
@@ -1972,15 +1293,6 @@ typedef struct SCCBscam_info {
1972 xfercnt <<= 16,\ 1293 xfercnt <<= 16,\
1973 xfercnt |= RDW_HARPOON((USHORT)(port+hp_xfercnt_0))) 1294 xfercnt |= RDW_HARPOON((USHORT)(port+hp_xfercnt_0)))
1974 */ 1295 */
1975#if defined(DOS)
1976#define HP_SETUP_ADDR_CNT(port,addr,count) (WRW_HARPOON((USHORT)(port+hp_host_addr_lo), (USHORT)(addr & 0x0000FFFFL)),\
1977 addr >>= 16,\
1978 WRW_HARPOON((USHORT)(port+hp_host_addr_hmi), (USHORT)(addr & 0x0000FFFFL)),\
1979 WR_HARP32(port,hp_xfercnt_0,count),\
1980 WRW_HARPOON((USHORT)(port+hp_xfer_cnt_lo), (USHORT)(count & 0x0000FFFFL)),\
1981 count >>= 16,\
1982 WR_HARPOON(port+hp_xfer_cnt_hi, (count & 0xFF)))
1983#else
1984#define HP_SETUP_ADDR_CNT(port,addr,count) (WRW_HARPOON((port+hp_host_addr_lo), (USHORT)(addr & 0x0000FFFFL)),\ 1296#define HP_SETUP_ADDR_CNT(port,addr,count) (WRW_HARPOON((port+hp_host_addr_lo), (USHORT)(addr & 0x0000FFFFL)),\
1985 addr >>= 16,\ 1297 addr >>= 16,\
1986 WRW_HARPOON((port+hp_host_addr_hmi), (USHORT)(addr & 0x0000FFFFL)),\ 1298 WRW_HARPOON((port+hp_host_addr_hmi), (USHORT)(addr & 0x0000FFFFL)),\
@@ -1988,7 +1300,6 @@ typedef struct SCCBscam_info {
1988 WRW_HARPOON((port+hp_xfer_cnt_lo), (USHORT)(count & 0x0000FFFFL)),\ 1300 WRW_HARPOON((port+hp_xfer_cnt_lo), (USHORT)(count & 0x0000FFFFL)),\
1989 count >>= 16,\ 1301 count >>= 16,\
1990 WR_HARPOON(port+hp_xfer_cnt_hi, (count & 0xFF))) 1302 WR_HARPOON(port+hp_xfer_cnt_hi, (count & 0xFF)))
1991#endif
1992 1303
1993#define ACCEPT_MSG(port) {while(RD_HARPOON(port+hp_scsisig) & SCSI_REQ){}\ 1304#define ACCEPT_MSG(port) {while(RD_HARPOON(port+hp_scsisig) & SCSI_REQ){}\
1994 WR_HARPOON(port+hp_scsisig, S_ILL_PH);} 1305 WR_HARPOON(port+hp_scsisig, S_ILL_PH);}
@@ -2020,383 +1331,145 @@ typedef struct SCCBscam_info {
2020 1331
2021 1332
2022 1333
2023#endif
2024
2025 1334
2026#if (FW_TYPE==_UCB_MGR_)
2027void ReadNVRam(PSCCBcard pCurrCard,PUCB p_ucb);
2028void WriteNVRam(PSCCBcard pCurrCard,PUCB p_ucb);
2029void UpdateCheckSum(u32bits baseport);
2030#endif // (FW_TYPE==_UCB_MGR_)
2031
2032#if defined(DOS)
2033UCHAR sfm(USHORT port, PSCCB pcurrSCCB);
2034void scsiStartAuto(USHORT port);
2035UCHAR sisyncn(USHORT port, UCHAR p_card, UCHAR syncFlag);
2036void ssel(USHORT port, UCHAR p_card);
2037void sres(USHORT port, UCHAR p_card, PSCCBcard pCurrCard);
2038void sdecm(UCHAR message, USHORT port, UCHAR p_card);
2039void shandem(USHORT port, UCHAR p_card,PSCCB pCurrSCCB);
2040void stsyncn(USHORT port, UCHAR p_card);
2041void sisyncr(USHORT port,UCHAR sync_pulse, UCHAR offset);
2042void sssyncv(USHORT p_port, UCHAR p_id, UCHAR p_sync_value, PSCCBMgr_tar_info currTar_Info);
2043void sresb(USHORT port, UCHAR p_card);
2044void sxfrp(USHORT p_port, UCHAR p_card);
2045void schkdd(USHORT port, UCHAR p_card);
2046UCHAR RdStack(USHORT port, UCHAR index);
2047void WrStack(USHORT portBase, UCHAR index, UCHAR data);
2048UCHAR ChkIfChipInitialized(USHORT ioPort);
2049
2050#if defined(V302)
2051UCHAR GetTarLun(USHORT port, UCHAR p_card, UCHAR our_target, PSCCBcard pCurrCard, PUCHAR tag, PUCHAR lun);
2052#endif
2053
2054void SendMsg(USHORT port, UCHAR message);
2055void queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg, UCHAR error_code);
2056UCHAR scsellDOS(USHORT p_port, UCHAR targ_id);
2057#else
2058UCHAR sfm(ULONG port, PSCCB pcurrSCCB);
2059void scsiStartAuto(ULONG port); 1335void scsiStartAuto(ULONG port);
2060UCHAR sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag); 1336static UCHAR FPT_sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag);
2061void ssel(ULONG port, UCHAR p_card); 1337static void FPT_ssel(ULONG port, UCHAR p_card);
2062void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard); 1338static void FPT_sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard);
2063void sdecm(UCHAR message, ULONG port, UCHAR p_card); 1339static void FPT_shandem(ULONG port, UCHAR p_card,PSCCB pCurrSCCB);
2064void shandem(ULONG port, UCHAR p_card,PSCCB pCurrSCCB); 1340static void FPT_stsyncn(ULONG port, UCHAR p_card);
2065void stsyncn(ULONG port, UCHAR p_card); 1341static void FPT_sisyncr(ULONG port,UCHAR sync_pulse, UCHAR offset);
2066void sisyncr(ULONG port,UCHAR sync_pulse, UCHAR offset); 1342static void FPT_sssyncv(ULONG p_port, UCHAR p_id, UCHAR p_sync_value,
2067void sssyncv(ULONG p_port, UCHAR p_id, UCHAR p_sync_value, PSCCBMgr_tar_info currTar_Info); 1343 PSCCBMgr_tar_info currTar_Info);
2068void sresb(ULONG port, UCHAR p_card); 1344static void FPT_sresb(ULONG port, UCHAR p_card);
2069void sxfrp(ULONG p_port, UCHAR p_card); 1345static void FPT_sxfrp(ULONG p_port, UCHAR p_card);
2070void schkdd(ULONG port, UCHAR p_card); 1346static void FPT_schkdd(ULONG port, UCHAR p_card);
2071UCHAR RdStack(ULONG port, UCHAR index); 1347static UCHAR FPT_RdStack(ULONG port, UCHAR index);
2072void WrStack(ULONG portBase, UCHAR index, UCHAR data); 1348static void FPT_WrStack(ULONG portBase, UCHAR index, UCHAR data);
2073UCHAR ChkIfChipInitialized(ULONG ioPort); 1349static UCHAR FPT_ChkIfChipInitialized(ULONG ioPort);
2074
2075#if defined(V302)
2076UCHAR GetTarLun(ULONG port, UCHAR p_card, UCHAR our_target, PSCCBcard pCurrCard, PUCHAR tar, PUCHAR lun);
2077#endif
2078 1350
2079void SendMsg(ULONG port, UCHAR message); 1351static void FPT_SendMsg(ULONG port, UCHAR message);
2080void queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg, UCHAR error_code); 1352static void FPT_queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg,
2081#endif 1353 UCHAR error_code);
2082 1354
2083void ssenss(PSCCBcard pCurrCard); 1355static void FPT_sinits(PSCCB p_sccb, UCHAR p_card);
2084void sinits(PSCCB p_sccb, UCHAR p_card); 1356static void FPT_RNVRamData(PNVRamInfo pNvRamInfo);
2085void RNVRamData(PNVRamInfo pNvRamInfo);
2086
2087#if defined(WIDE_SCSI)
2088 #if defined(DOS)
2089 UCHAR siwidn(USHORT port, UCHAR p_card);
2090 void stwidn(USHORT port, UCHAR p_card);
2091 void siwidr(USHORT port, UCHAR width);
2092 #else
2093 UCHAR siwidn(ULONG port, UCHAR p_card);
2094 void stwidn(ULONG port, UCHAR p_card);
2095 void siwidr(ULONG port, UCHAR width);
2096 #endif
2097#endif
2098 1357
1358static UCHAR FPT_siwidn(ULONG port, UCHAR p_card);
1359static void FPT_stwidn(ULONG port, UCHAR p_card);
1360static void FPT_siwidr(ULONG port, UCHAR width);
2099 1361
2100void queueSelectFail(PSCCBcard pCurrCard, UCHAR p_card);
2101void queueDisconnect(PSCCB p_SCCB, UCHAR p_card);
2102void queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_SCCB, UCHAR p_card);
2103void queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card);
2104void queueFlushSccb(UCHAR p_card, UCHAR error_code);
2105void queueAddSccb(PSCCB p_SCCB, UCHAR card);
2106UCHAR queueFindSccb(PSCCB p_SCCB, UCHAR p_card);
2107void utilUpdateResidual(PSCCB p_SCCB);
2108USHORT CalcCrc16(UCHAR buffer[]);
2109UCHAR CalcLrc(UCHAR buffer[]);
2110
2111
2112#if defined(DOS)
2113void Wait1Second(USHORT p_port);
2114void Wait(USHORT p_port, UCHAR p_delay);
2115void utilEEWriteOnOff(USHORT p_port,UCHAR p_mode);
2116void utilEEWrite(USHORT p_port, USHORT ee_data, USHORT ee_addr);
2117USHORT utilEERead(USHORT p_port, USHORT ee_addr);
2118USHORT utilEEReadOrg(USHORT p_port, USHORT ee_addr);
2119void utilEESendCmdAddr(USHORT p_port, UCHAR ee_cmd, USHORT ee_addr);
2120#else
2121void Wait1Second(ULONG p_port);
2122void Wait(ULONG p_port, UCHAR p_delay);
2123void utilEEWriteOnOff(ULONG p_port,UCHAR p_mode);
2124void utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr);
2125USHORT utilEERead(ULONG p_port, USHORT ee_addr);
2126USHORT utilEEReadOrg(ULONG p_port, USHORT ee_addr);
2127void utilEESendCmdAddr(ULONG p_port, UCHAR ee_cmd, USHORT ee_addr);
2128#endif
2129 1362
1363static void FPT_queueSelectFail(PSCCBcard pCurrCard, UCHAR p_card);
1364static void FPT_queueDisconnect(PSCCB p_SCCB, UCHAR p_card);
1365static void FPT_queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_SCCB,
1366 UCHAR p_card);
1367static void FPT_queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card);
1368static void FPT_queueFlushSccb(UCHAR p_card, UCHAR error_code);
1369static void FPT_queueAddSccb(PSCCB p_SCCB, UCHAR card);
1370static UCHAR FPT_queueFindSccb(PSCCB p_SCCB, UCHAR p_card);
1371static void FPT_utilUpdateResidual(PSCCB p_SCCB);
1372static USHORT FPT_CalcCrc16(UCHAR buffer[]);
1373static UCHAR FPT_CalcLrc(UCHAR buffer[]);
2130 1374
2131 1375
2132#if defined(OS2) 1376static void FPT_Wait1Second(ULONG p_port);
2133 void far phaseDataOut(ULONG port, UCHAR p_card); 1377static void FPT_Wait(ULONG p_port, UCHAR p_delay);
2134 void far phaseDataIn(ULONG port, UCHAR p_card); 1378static void FPT_utilEEWriteOnOff(ULONG p_port,UCHAR p_mode);
2135 void far phaseCommand(ULONG port, UCHAR p_card); 1379static void FPT_utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr);
2136 void far phaseStatus(ULONG port, UCHAR p_card); 1380static USHORT FPT_utilEERead(ULONG p_port, USHORT ee_addr);
2137 void far phaseMsgOut(ULONG port, UCHAR p_card); 1381static USHORT FPT_utilEEReadOrg(ULONG p_port, USHORT ee_addr);
2138 void far phaseMsgIn(ULONG port, UCHAR p_card); 1382static void FPT_utilEESendCmdAddr(ULONG p_port, UCHAR ee_cmd, USHORT ee_addr);
2139 void far phaseIllegal(ULONG port, UCHAR p_card);
2140#else
2141 #if defined(DOS)
2142 void phaseDataOut(USHORT port, UCHAR p_card);
2143 void phaseDataIn(USHORT port, UCHAR p_card);
2144 void phaseCommand(USHORT port, UCHAR p_card);
2145 void phaseStatus(USHORT port, UCHAR p_card);
2146 void phaseMsgOut(USHORT port, UCHAR p_card);
2147 void phaseMsgIn(USHORT port, UCHAR p_card);
2148 void phaseIllegal(USHORT port, UCHAR p_card);
2149 #else
2150 void phaseDataOut(ULONG port, UCHAR p_card);
2151 void phaseDataIn(ULONG port, UCHAR p_card);
2152 void phaseCommand(ULONG port, UCHAR p_card);
2153 void phaseStatus(ULONG port, UCHAR p_card);
2154 void phaseMsgOut(ULONG port, UCHAR p_card);
2155 void phaseMsgIn(ULONG port, UCHAR p_card);
2156 void phaseIllegal(ULONG port, UCHAR p_card);
2157 #endif
2158#endif
2159 1383
2160#if defined(DOS)
2161void phaseDecode(USHORT port, UCHAR p_card);
2162void phaseChkFifo(USHORT port, UCHAR p_card);
2163void phaseBusFree(USHORT p_port, UCHAR p_card);
2164#else
2165void phaseDecode(ULONG port, UCHAR p_card);
2166void phaseChkFifo(ULONG port, UCHAR p_card);
2167void phaseBusFree(ULONG p_port, UCHAR p_card);
2168#endif
2169
2170
2171
2172
2173#if defined(DOS)
2174void XbowInit(USHORT port, UCHAR scamFlg);
2175void BusMasterInit(USHORT p_port);
2176int DiagXbow(USHORT port);
2177int DiagBusMaster(USHORT port);
2178void DiagEEPROM(USHORT p_port);
2179#else
2180void XbowInit(ULONG port, UCHAR scamFlg);
2181void BusMasterInit(ULONG p_port);
2182int DiagXbow(ULONG port);
2183int DiagBusMaster(ULONG port);
2184void DiagEEPROM(ULONG p_port);
2185#endif
2186 1384
2187 1385
1386static void FPT_phaseDataOut(ULONG port, UCHAR p_card);
1387static void FPT_phaseDataIn(ULONG port, UCHAR p_card);
1388static void FPT_phaseCommand(ULONG port, UCHAR p_card);
1389static void FPT_phaseStatus(ULONG port, UCHAR p_card);
1390static void FPT_phaseMsgOut(ULONG port, UCHAR p_card);
1391static void FPT_phaseMsgIn(ULONG port, UCHAR p_card);
1392static void FPT_phaseIllegal(ULONG port, UCHAR p_card);
2188 1393
1394static void FPT_phaseDecode(ULONG port, UCHAR p_card);
1395static void FPT_phaseChkFifo(ULONG port, UCHAR p_card);
1396static void FPT_phaseBusFree(ULONG p_port, UCHAR p_card);
2189 1397
2190#if defined(DOS)
2191void busMstrAbort(USHORT port);
2192UCHAR busMstrTimeOut(USHORT port);
2193void dataXferProcessor(USHORT port, PSCCBcard pCurrCard);
2194void busMstrSGDataXferStart(USHORT port, PSCCB pCurrSCCB);
2195void busMstrDataXferStart(USHORT port, PSCCB pCurrSCCB);
2196void hostDataXferAbort(USHORT port, UCHAR p_card, PSCCB pCurrSCCB);
2197#else
2198void busMstrAbort(ULONG port);
2199UCHAR busMstrTimeOut(ULONG port);
2200void dataXferProcessor(ULONG port, PSCCBcard pCurrCard);
2201void busMstrSGDataXferStart(ULONG port, PSCCB pCurrSCCB);
2202void busMstrDataXferStart(ULONG port, PSCCB pCurrSCCB);
2203void hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB);
2204#endif
2205void hostDataXferRestart(PSCCB currSCCB);
2206 1398
2207 1399
2208#if defined (DOS)
2209UCHAR SccbMgr_bad_isr(USHORT p_port, UCHAR p_card, PSCCBcard pCurrCard, USHORT p_int);
2210#else
2211UCHAR SccbMgr_bad_isr(ULONG p_port, UCHAR p_card, PSCCBcard pCurrCard, USHORT p_int);
2212 1400
2213#endif 1401static void FPT_XbowInit(ULONG port, UCHAR scamFlg);
1402static void FPT_BusMasterInit(ULONG p_port);
1403static void FPT_DiagEEPROM(ULONG p_port);
2214 1404
2215void SccbMgrTableInitAll(void);
2216void SccbMgrTableInitCard(PSCCBcard pCurrCard, UCHAR p_card);
2217void SccbMgrTableInitTarget(UCHAR p_card, UCHAR target);
2218
2219
2220
2221void scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up);
2222
2223#if defined(DOS)
2224int scarb(USHORT p_port, UCHAR p_sel_type);
2225void scbusf(USHORT p_port);
2226void scsel(USHORT p_port);
2227void scasid(UCHAR p_card, USHORT p_port);
2228UCHAR scxferc(USHORT p_port, UCHAR p_data);
2229UCHAR scsendi(USHORT p_port, UCHAR p_id_string[]);
2230UCHAR sciso(USHORT p_port, UCHAR p_id_string[]);
2231void scwirod(USHORT p_port, UCHAR p_data_bit);
2232void scwiros(USHORT p_port, UCHAR p_data_bit);
2233UCHAR scvalq(UCHAR p_quintet);
2234UCHAR scsell(USHORT p_port, UCHAR targ_id);
2235void scwtsel(USHORT p_port);
2236void inisci(UCHAR p_card, USHORT p_port, UCHAR p_our_id);
2237void scsavdi(UCHAR p_card, USHORT p_port);
2238#else
2239int scarb(ULONG p_port, UCHAR p_sel_type);
2240void scbusf(ULONG p_port);
2241void scsel(ULONG p_port);
2242void scasid(UCHAR p_card, ULONG p_port);
2243UCHAR scxferc(ULONG p_port, UCHAR p_data);
2244UCHAR scsendi(ULONG p_port, UCHAR p_id_string[]);
2245UCHAR sciso(ULONG p_port, UCHAR p_id_string[]);
2246void scwirod(ULONG p_port, UCHAR p_data_bit);
2247void scwiros(ULONG p_port, UCHAR p_data_bit);
2248UCHAR scvalq(UCHAR p_quintet);
2249UCHAR scsell(ULONG p_port, UCHAR targ_id);
2250void scwtsel(ULONG p_port);
2251void inisci(UCHAR p_card, ULONG p_port, UCHAR p_our_id);
2252void scsavdi(UCHAR p_card, ULONG p_port);
2253#endif
2254UCHAR scmachid(UCHAR p_card, UCHAR p_id_string[]);
2255
2256
2257#if defined(DOS)
2258void autoCmdCmplt(USHORT p_port, UCHAR p_card);
2259void autoLoadDefaultMap(USHORT p_port);
2260#else
2261void autoCmdCmplt(ULONG p_port, UCHAR p_card);
2262void autoLoadDefaultMap(ULONG p_port);
2263#endif
2264
2265
2266
2267#if (FW_TYPE==_SCCB_MGR_)
2268 void OS_start_timer(unsigned long ioport, unsigned long timeout);
2269 void OS_stop_timer(unsigned long ioport, unsigned long timeout);
2270 void OS_disable_int(unsigned char intvec);
2271 void OS_enable_int(unsigned char intvec);
2272 void OS_delay(unsigned long count);
2273 int OS_VirtToPhys(u32bits CardHandle, u32bits *physaddr, u32bits *virtaddr);
2274 #if !(defined(UNIX) || defined(OS2) || defined(SOLARIS_REAL_MODE))
2275 void OS_Lock(PSCCBMGR_INFO pCardInfo);
2276 void OS_UnLock(PSCCBMGR_INFO pCardInfo);
2277#endif // if FW_TYPE == ...
2278
2279#endif
2280
2281extern SCCBCARD BL_Card[MAX_CARDS];
2282extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
2283
2284
2285#if defined(OS2)
2286 extern void (far *s_PhaseTbl[8]) (ULONG, UCHAR);
2287#else
2288 #if defined(DOS)
2289 extern void (*s_PhaseTbl[8]) (USHORT, UCHAR);
2290 #else
2291 extern void (*s_PhaseTbl[8]) (ULONG, UCHAR);
2292 #endif
2293#endif
2294 1405
2295extern SCCBSCAM_INFO scamInfo[MAX_SCSI_TAR];
2296extern NVRAMINFO nvRamInfo[MAX_MB_CARDS];
2297#if defined(DOS) || defined(OS2)
2298extern UCHAR temp_id_string[ID_STRING_LENGTH];
2299#endif
2300extern UCHAR scamHAString[];
2301 1406
2302 1407
2303extern UCHAR mbCards; 1408void busMstrAbort(ULONG port);
2304#if defined(BUGBUG) 1409static void FPT_dataXferProcessor(ULONG port, PSCCBcard pCurrCard);
2305extern UCHAR debug_int[MAX_CARDS][debug_size]; 1410static void FPT_busMstrSGDataXferStart(ULONG port, PSCCB pCurrSCCB);
2306extern UCHAR debug_index[MAX_CARDS]; 1411static void FPT_busMstrDataXferStart(ULONG port, PSCCB pCurrSCCB);
2307void Debug_Load(UCHAR p_card, UCHAR p_bug_data); 1412static void FPT_hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB);
2308#endif 1413static void FPT_hostDataXferRestart(PSCCB currSCCB);
2309 1414
2310#if (FW_TYPE==_SCCB_MGR_)
2311#if defined(DOS)
2312 extern UCHAR first_time;
2313#endif
2314#endif /* (FW_TYPE==_SCCB_MGR_) */
2315 1415
2316#if (FW_TYPE==_UCB_MGR_) 1416static UCHAR FPT_SccbMgr_bad_isr(ULONG p_port, UCHAR p_card,
2317#if defined(DOS) 1417 PSCCBcard pCurrCard, USHORT p_int);
2318 extern u08bits first_time;
2319#endif
2320#endif /* (FW_TYPE==_UCB_MGR_) */
2321 1418
2322#if defined(BUGBUG) 1419static void FPT_SccbMgrTableInitAll(void);
2323void Debug_Load(UCHAR p_card, UCHAR p_bug_data); 1420static void FPT_SccbMgrTableInitCard(PSCCBcard pCurrCard, UCHAR p_card);
2324#endif 1421static void FPT_SccbMgrTableInitTarget(UCHAR p_card, UCHAR target);
2325 1422
2326extern unsigned int SccbGlobalFlags;
2327 1423
2328 1424
2329#ident "$Id: sccb.c 1.18 1997/06/10 16:47:04 mohan Exp $" 1425static void FPT_scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up);
2330/*----------------------------------------------------------------------
2331 *
2332 *
2333 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
2334 *
2335 * This file is available under both the GNU General Public License
2336 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
2337 *
2338 * $Workfile: sccb.c $
2339 *
2340 * Description: Functions relating to handling of the SCCB interface
2341 * between the device driver and the HARPOON.
2342 *
2343 * $Date: 1997/06/10 16:47:04 $
2344 *
2345 * $Revision: 1.18 $
2346 *
2347 *----------------------------------------------------------------------*/
2348 1426
2349/*#include <globals.h>*/ 1427static int FPT_scarb(ULONG p_port, UCHAR p_sel_type);
1428static void FPT_scbusf(ULONG p_port);
1429static void FPT_scsel(ULONG p_port);
1430static void FPT_scasid(UCHAR p_card, ULONG p_port);
1431static UCHAR FPT_scxferc(ULONG p_port, UCHAR p_data);
1432static UCHAR FPT_scsendi(ULONG p_port, UCHAR p_id_string[]);
1433static UCHAR FPT_sciso(ULONG p_port, UCHAR p_id_string[]);
1434static void FPT_scwirod(ULONG p_port, UCHAR p_data_bit);
1435static void FPT_scwiros(ULONG p_port, UCHAR p_data_bit);
1436static UCHAR FPT_scvalq(UCHAR p_quintet);
1437static UCHAR FPT_scsell(ULONG p_port, UCHAR targ_id);
1438static void FPT_scwtsel(ULONG p_port);
1439static void FPT_inisci(UCHAR p_card, ULONG p_port, UCHAR p_our_id);
1440static void FPT_scsavdi(UCHAR p_card, ULONG p_port);
1441static UCHAR FPT_scmachid(UCHAR p_card, UCHAR p_id_string[]);
2350 1442
2351#if (FW_TYPE==_UCB_MGR_)
2352 /*#include <budi.h>*/
2353 /*#include <budioctl.h>*/
2354#endif
2355 1443
2356/*#include <sccbmgr.h>*/ 1444static void FPT_autoCmdCmplt(ULONG p_port, UCHAR p_card);
2357/*#include <blx30.h>*/ 1445static void FPT_autoLoadDefaultMap(ULONG p_port);
2358/*#include <target.h>*/
2359/*#include <eeprom.h>*/
2360/*#include <scsi2.h>*/
2361/*#include <harpoon.h>*/
2362 1446
2363 1447
2364 1448
2365#if (FW_TYPE==_SCCB_MGR_) 1449void OS_start_timer(unsigned long ioport, unsigned long timeout);
2366#define mOS_Lock(card) OS_Lock((PSCCBMGR_INFO)(((PSCCBcard)card)->cardInfo)) 1450void OS_stop_timer(unsigned long ioport, unsigned long timeout);
2367#define mOS_UnLock(card) OS_UnLock((PSCCBMGR_INFO)(((PSCCBcard)card)->cardInfo)) 1451void OS_disable_int(unsigned char intvec);
2368#else /* FW_TYPE==_UCB_MGR_ */ 1452void OS_enable_int(unsigned char intvec);
2369#define mOS_Lock(card) OS_Lock((u32bits)(((PSCCBcard)card)->ioPort)) 1453void OS_delay(unsigned long count);
2370#define mOS_UnLock(card) OS_UnLock((u32bits)(((PSCCBcard)card)->ioPort)) 1454int OS_VirtToPhys(u32bits CardHandle, u32bits *physaddr, u32bits *virtaddr);
2371#endif
2372 1455
1456static SCCBMGR_TAR_INFO FPT_sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR] = { { { 0 } } };
1457static SCCBCARD FPT_BL_Card[MAX_CARDS] = { { 0 } };
1458static SCCBSCAM_INFO FPT_scamInfo[MAX_SCSI_TAR] = { { { 0 } } };
1459static NVRAMINFO FPT_nvRamInfo[MAX_MB_CARDS] = { { 0 } };
2373 1460
2374/*
2375extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
2376extern SCCBCARD BL_Card[MAX_CARDS];
2377 1461
2378extern NVRAMINFO nvRamInfo[MAX_MB_CARDS]; 1462static UCHAR FPT_mbCards = 0;
2379extern UCHAR mbCards; 1463static UCHAR FPT_scamHAString[] = {0x63, 0x07, 'B', 'U', 'S', 'L', 'O', 'G', 'I', 'C', \
1464 ' ', 'B', 'T', '-', '9', '3', '0', \
1465 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, \
1466 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20};
2380 1467
2381#if defined (OS2) 1468static USHORT FPT_default_intena = 0;
2382 extern void (far *s_PhaseTbl[8]) (ULONG, UCHAR);
2383#else
2384 #if defined(DOS)
2385 extern void (*s_PhaseTbl[8]) (USHORT, UCHAR);
2386 #else
2387 extern void (*s_PhaseTbl[8]) (ULONG, UCHAR);
2388 #endif
2389#endif
2390 1469
2391 1470
2392#if defined(BUGBUG) 1471static void (*FPT_s_PhaseTbl[8]) (ULONG, UCHAR)= { 0 };
2393extern UCHAR debug_int[MAX_CARDS][debug_size];
2394extern UCHAR debug_index[MAX_CARDS];
2395void Debug_Load(UCHAR p_card, UCHAR p_bug_data);
2396#endif
2397*/
2398 1472
2399#if (FW_TYPE==_SCCB_MGR_)
2400 1473
2401/*--------------------------------------------------------------------- 1474/*---------------------------------------------------------------------
2402 * 1475 *
@@ -2406,27 +1479,16 @@ void Debug_Load(UCHAR p_card, UCHAR p_bug_data);
2406 * 1479 *
2407 *---------------------------------------------------------------------*/ 1480 *---------------------------------------------------------------------*/
2408 1481
2409int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo) 1482static int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo)
2410{ 1483{
2411#if defined(DOS)
2412#else
2413 static UCHAR first_time = 1; 1484 static UCHAR first_time = 1;
2414#endif
2415 1485
2416 UCHAR i,j,id,ScamFlg; 1486 UCHAR i,j,id,ScamFlg;
2417 USHORT temp,temp2,temp3,temp4,temp5,temp6; 1487 USHORT temp,temp2,temp3,temp4,temp5,temp6;
2418#if defined(DOS)
2419 USHORT ioport;
2420#else
2421 ULONG ioport; 1488 ULONG ioport;
2422#endif
2423 PNVRamInfo pCurrNvRam; 1489 PNVRamInfo pCurrNvRam;
2424 1490
2425#if defined(DOS)
2426 ioport = (USHORT)pCardInfo->si_baseaddr;
2427#else
2428 ioport = pCardInfo->si_baseaddr; 1491 ioport = pCardInfo->si_baseaddr;
2429#endif
2430 1492
2431 1493
2432 if (RD_HARPOON(ioport+hp_vendor_id_0) != ORION_VEND_0) 1494 if (RD_HARPOON(ioport+hp_vendor_id_0) != ORION_VEND_0)
@@ -2455,36 +1517,31 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo)
2455 1517
2456 if (first_time) 1518 if (first_time)
2457 { 1519 {
2458 SccbMgrTableInitAll(); 1520 FPT_SccbMgrTableInitAll();
2459 first_time = 0; 1521 first_time = 0;
2460 mbCards = 0; 1522 FPT_mbCards = 0;
2461 } 1523 }
2462 1524
2463 if(RdStack(ioport, 0) != 0x00) { 1525 if(FPT_RdStack(ioport, 0) != 0x00) {
2464 if(ChkIfChipInitialized(ioport) == FALSE) 1526 if(FPT_ChkIfChipInitialized(ioport) == 0)
2465 { 1527 {
2466 pCurrNvRam = NULL; 1528 pCurrNvRam = NULL;
2467 WR_HARPOON(ioport+hp_semaphore, 0x00); 1529 WR_HARPOON(ioport+hp_semaphore, 0x00);
2468 XbowInit(ioport, 0); /*Must Init the SCSI before attempting */ 1530 FPT_XbowInit(ioport, 0); /*Must Init the SCSI before attempting */
2469 DiagEEPROM(ioport); 1531 FPT_DiagEEPROM(ioport);
2470 } 1532 }
2471 else 1533 else
2472 { 1534 {
2473 if(mbCards < MAX_MB_CARDS) { 1535 if(FPT_mbCards < MAX_MB_CARDS) {
2474 pCurrNvRam = &nvRamInfo[mbCards]; 1536 pCurrNvRam = &FPT_nvRamInfo[FPT_mbCards];
2475 mbCards++; 1537 FPT_mbCards++;
2476 pCurrNvRam->niBaseAddr = ioport; 1538 pCurrNvRam->niBaseAddr = ioport;
2477 RNVRamData(pCurrNvRam); 1539 FPT_RNVRamData(pCurrNvRam);
2478 }else 1540 }else
2479 return((int) FAILURE); 1541 return((int) FAILURE);
2480 } 1542 }
2481 }else 1543 }else
2482 pCurrNvRam = NULL; 1544 pCurrNvRam = NULL;
2483#if defined (NO_BIOS_OPTION)
2484 pCurrNvRam = NULL;
2485 XbowInit(ioport, 0); /*Must Init the SCSI before attempting */
2486 DiagEEPROM(ioport);
2487#endif /* No BIOS Option */
2488 1545
2489 WR_HARPOON(ioport+hp_clkctrl_0, CLKCTRL_DEFAULT); 1546 WR_HARPOON(ioport+hp_clkctrl_0, CLKCTRL_DEFAULT);
2490 WR_HARPOON(ioport+hp_sys_ctrl, 0x00); 1547 WR_HARPOON(ioport+hp_sys_ctrl, 0x00);
@@ -2492,7 +1549,7 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo)
2492 if(pCurrNvRam) 1549 if(pCurrNvRam)
2493 pCardInfo->si_id = pCurrNvRam->niAdapId; 1550 pCardInfo->si_id = pCurrNvRam->niAdapId;
2494 else 1551 else
2495 pCardInfo->si_id = (UCHAR)(utilEERead(ioport, (ADAPTER_SCSI_ID/2)) & 1552 pCardInfo->si_id = (UCHAR)(FPT_utilEERead(ioport, (ADAPTER_SCSI_ID/2)) &
2496 (UCHAR)0x0FF); 1553 (UCHAR)0x0FF);
2497 1554
2498 pCardInfo->si_lun = 0x00; 1555 pCardInfo->si_lun = 0x00;
@@ -2510,7 +1567,7 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo)
2510 temp = ((temp & 0x03) + ((temp << 4) & 0xc0)) + 1567 temp = ((temp & 0x03) + ((temp << 4) & 0xc0)) +
2511 (((temp << 4) & 0x0300) + ((temp << 8) & 0xc000)); 1568 (((temp << 4) & 0x0300) + ((temp << 8) & 0xc000));
2512 }else 1569 }else
2513 temp = utilEERead(ioport, (USHORT)((SYNC_RATE_TBL/2)+id)); 1570 temp = FPT_utilEERead(ioport, (USHORT)((SYNC_RATE_TBL/2)+id));
2514 1571
2515 for (i = 0; i < 2; temp >>=8,i++) { 1572 for (i = 0; i < 2; temp >>=8,i++) {
2516 1573
@@ -2549,12 +1606,12 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo)
2549 if(pCurrNvRam) 1606 if(pCurrNvRam)
2550 i = pCurrNvRam->niSysConf; 1607 i = pCurrNvRam->niSysConf;
2551 else 1608 else
2552 i = (UCHAR)(utilEERead(ioport, (SYSTEM_CONFIG/2))); 1609 i = (UCHAR)(FPT_utilEERead(ioport, (SYSTEM_CONFIG/2)));
2553 1610
2554 if(pCurrNvRam) 1611 if(pCurrNvRam)
2555 ScamFlg = pCurrNvRam->niScamConf; 1612 ScamFlg = pCurrNvRam->niScamConf;
2556 else 1613 else
2557 ScamFlg = (UCHAR) utilEERead(ioport, SCAM_CONFIG/2); 1614 ScamFlg = (UCHAR) FPT_utilEERead(ioport, SCAM_CONFIG/2);
2558 1615
2559 pCardInfo->si_flags = 0x0000; 1616 pCardInfo->si_flags = 0x0000;
2560 1617
@@ -2613,9 +1670,9 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo)
2613 break; 1670 break;
2614 } 1671 }
2615 }else{ 1672 }else{
2616 temp = utilEERead(ioport, (MODEL_NUMB_0/2)); 1673 temp = FPT_utilEERead(ioport, (MODEL_NUMB_0/2));
2617 pCardInfo->si_card_model[0] = (UCHAR)(temp >> 8); 1674 pCardInfo->si_card_model[0] = (UCHAR)(temp >> 8);
2618 temp = utilEERead(ioport, (MODEL_NUMB_2/2)); 1675 temp = FPT_utilEERead(ioport, (MODEL_NUMB_2/2));
2619 1676
2620 pCardInfo->si_card_model[1] = (UCHAR)(temp & 0x00FF); 1677 pCardInfo->si_card_model[1] = (UCHAR)(temp & 0x00FF);
2621 pCardInfo->si_card_model[2] = (UCHAR)(temp >> 8); 1678 pCardInfo->si_card_model[2] = (UCHAR)(temp >> 8);
@@ -2677,29 +1734,17 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo)
2677 1734
2678 SGRAM_ACCESS(ioport); 1735 SGRAM_ACCESS(ioport);
2679 1736
2680 s_PhaseTbl[0] = phaseDataOut; 1737 FPT_s_PhaseTbl[0] = FPT_phaseDataOut;
2681 s_PhaseTbl[1] = phaseDataIn; 1738 FPT_s_PhaseTbl[1] = FPT_phaseDataIn;
2682 s_PhaseTbl[2] = phaseIllegal; 1739 FPT_s_PhaseTbl[2] = FPT_phaseIllegal;
2683 s_PhaseTbl[3] = phaseIllegal; 1740 FPT_s_PhaseTbl[3] = FPT_phaseIllegal;
2684 s_PhaseTbl[4] = phaseCommand; 1741 FPT_s_PhaseTbl[4] = FPT_phaseCommand;
2685 s_PhaseTbl[5] = phaseStatus; 1742 FPT_s_PhaseTbl[5] = FPT_phaseStatus;
2686 s_PhaseTbl[6] = phaseMsgOut; 1743 FPT_s_PhaseTbl[6] = FPT_phaseMsgOut;
2687 s_PhaseTbl[7] = phaseMsgIn; 1744 FPT_s_PhaseTbl[7] = FPT_phaseMsgIn;
2688 1745
2689 pCardInfo->si_present = 0x01; 1746 pCardInfo->si_present = 0x01;
2690 1747
2691#if defined(BUGBUG)
2692
2693
2694 for (i = 0; i < MAX_CARDS; i++) {
2695
2696 for (id=0; id<debug_size; id++)
2697 debug_int[i][id] = (UCHAR)0x00;
2698 debug_index[i] = 0;
2699 }
2700
2701#endif
2702
2703 return(0); 1748 return(0);
2704} 1749}
2705 1750
@@ -2712,27 +1757,15 @@ int SccbMgr_sense_adapter(PSCCBMGR_INFO pCardInfo)
2712 * 1757 *
2713 *---------------------------------------------------------------------*/ 1758 *---------------------------------------------------------------------*/
2714 1759
2715#if defined(DOS) 1760static ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
2716USHORT SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
2717#else
2718ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
2719#endif
2720{ 1761{
2721 PSCCBcard CurrCard = NULL; 1762 PSCCBcard CurrCard = NULL;
2722 PNVRamInfo pCurrNvRam; 1763 PNVRamInfo pCurrNvRam;
2723 UCHAR i,j,thisCard, ScamFlg; 1764 UCHAR i,j,thisCard, ScamFlg;
2724 USHORT temp,sync_bit_map,id; 1765 USHORT temp,sync_bit_map,id;
2725#if defined(DOS)
2726 USHORT ioport;
2727#else
2728 ULONG ioport; 1766 ULONG ioport;
2729#endif
2730 1767
2731#if defined(DOS)
2732 ioport = (USHORT)pCardInfo->si_baseaddr;
2733#else
2734 ioport = pCardInfo->si_baseaddr; 1768 ioport = pCardInfo->si_baseaddr;
2735#endif
2736 1769
2737 for(thisCard =0; thisCard <= MAX_CARDS; thisCard++) { 1770 for(thisCard =0; thisCard <= MAX_CARDS; thisCard++) {
2738 1771
@@ -2741,24 +1774,24 @@ ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
2741 return(FAILURE); 1774 return(FAILURE);
2742 } 1775 }
2743 1776
2744 if (BL_Card[thisCard].ioPort == ioport) { 1777 if (FPT_BL_Card[thisCard].ioPort == ioport) {
2745 1778
2746 CurrCard = &BL_Card[thisCard]; 1779 CurrCard = &FPT_BL_Card[thisCard];
2747 SccbMgrTableInitCard(CurrCard,thisCard); 1780 FPT_SccbMgrTableInitCard(CurrCard,thisCard);
2748 break; 1781 break;
2749 } 1782 }
2750 1783
2751 else if (BL_Card[thisCard].ioPort == 0x00) { 1784 else if (FPT_BL_Card[thisCard].ioPort == 0x00) {
2752 1785
2753 BL_Card[thisCard].ioPort = ioport; 1786 FPT_BL_Card[thisCard].ioPort = ioport;
2754 CurrCard = &BL_Card[thisCard]; 1787 CurrCard = &FPT_BL_Card[thisCard];
2755 1788
2756 if(mbCards) 1789 if(FPT_mbCards)
2757 for(i = 0; i < mbCards; i++){ 1790 for(i = 0; i < FPT_mbCards; i++){
2758 if(CurrCard->ioPort == nvRamInfo[i].niBaseAddr) 1791 if(CurrCard->ioPort == FPT_nvRamInfo[i].niBaseAddr)
2759 CurrCard->pNvRamInfo = &nvRamInfo[i]; 1792 CurrCard->pNvRamInfo = &FPT_nvRamInfo[i];
2760 } 1793 }
2761 SccbMgrTableInitCard(CurrCard,thisCard); 1794 FPT_SccbMgrTableInitCard(CurrCard,thisCard);
2762 CurrCard->cardIndex = thisCard; 1795 CurrCard->cardIndex = thisCard;
2763 CurrCard->cardInfo = pCardInfo; 1796 CurrCard->cardInfo = pCardInfo;
2764 1797
@@ -2772,22 +1805,14 @@ ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
2772 ScamFlg = pCurrNvRam->niScamConf; 1805 ScamFlg = pCurrNvRam->niScamConf;
2773 } 1806 }
2774 else{ 1807 else{
2775 ScamFlg = (UCHAR) utilEERead(ioport, SCAM_CONFIG/2); 1808 ScamFlg = (UCHAR) FPT_utilEERead(ioport, SCAM_CONFIG/2);
2776 } 1809 }
2777 1810
2778 1811
2779 BusMasterInit(ioport); 1812 FPT_BusMasterInit(ioport);
2780 XbowInit(ioport, ScamFlg); 1813 FPT_XbowInit(ioport, ScamFlg);
2781
2782#if defined (NO_BIOS_OPTION)
2783 1814
2784 1815 FPT_autoLoadDefaultMap(ioport);
2785 if (DiagXbow(ioport)) return(FAILURE);
2786 if (DiagBusMaster(ioport)) return(FAILURE);
2787
2788#endif /* No BIOS Option */
2789
2790 autoLoadDefaultMap(ioport);
2791 1816
2792 1817
2793 for (i = 0,id = 0x01; i != pCardInfo->si_id; i++,id <<= 1){} 1818 for (i = 0,id = 0x01; i != pCardInfo->si_id; i++,id <<= 1){}
@@ -2814,9 +1839,9 @@ ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
2814 1839
2815 if (!(pCardInfo->si_flags & SOFT_RESET)) { 1840 if (!(pCardInfo->si_flags & SOFT_RESET)) {
2816 1841
2817 sresb(ioport,thisCard); 1842 FPT_sresb(ioport,thisCard);
2818 1843
2819 scini(thisCard, pCardInfo->si_id, 0); 1844 FPT_scini(thisCard, pCardInfo->si_id, 0);
2820 } 1845 }
2821 1846
2822 1847
@@ -2829,7 +1854,7 @@ ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
2829 CurrCard->globalFlags |= F_GREEN_PC; 1854 CurrCard->globalFlags |= F_GREEN_PC;
2830 } 1855 }
2831 else{ 1856 else{
2832 if (utilEERead(ioport, (SYSTEM_CONFIG/2)) & GREEN_PC_ENA) 1857 if (FPT_utilEERead(ioport, (SYSTEM_CONFIG/2)) & GREEN_PC_ENA)
2833 CurrCard->globalFlags |= F_GREEN_PC; 1858 CurrCard->globalFlags |= F_GREEN_PC;
2834 } 1859 }
2835 1860
@@ -2840,7 +1865,7 @@ ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
2840 CurrCard->globalFlags |= F_DO_RENEGO; 1865 CurrCard->globalFlags |= F_DO_RENEGO;
2841 } 1866 }
2842 else{ 1867 else{
2843 if (utilEERead(ioport, (SCSI_CONFIG/2)) & RENEGO_ENA) 1868 if (FPT_utilEERead(ioport, (SCSI_CONFIG/2)) & RENEGO_ENA)
2844 CurrCard->globalFlags |= F_DO_RENEGO; 1869 CurrCard->globalFlags |= F_DO_RENEGO;
2845 } 1870 }
2846 1871
@@ -2849,7 +1874,7 @@ ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
2849 CurrCard->globalFlags |= F_CONLUN_IO; 1874 CurrCard->globalFlags |= F_CONLUN_IO;
2850 } 1875 }
2851 else{ 1876 else{
2852 if (utilEERead(ioport, (SCSI_CONFIG/2)) & CONNIO_ENA) 1877 if (FPT_utilEERead(ioport, (SCSI_CONFIG/2)) & CONNIO_ENA)
2853 CurrCard->globalFlags |= F_CONLUN_IO; 1878 CurrCard->globalFlags |= F_CONLUN_IO;
2854 } 1879 }
2855 1880
@@ -2859,7 +1884,7 @@ ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
2859 for (i = 0,id = 1; i < MAX_SCSI_TAR; i++, id <<= 1) { 1884 for (i = 0,id = 1; i < MAX_SCSI_TAR; i++, id <<= 1) {
2860 1885
2861 if (temp & id) 1886 if (temp & id)
2862 sccbMgrTbl[thisCard][i].TarStatus |= TAR_ALLOW_DISC; 1887 FPT_sccbMgrTbl[thisCard][i].TarStatus |= TAR_ALLOW_DISC;
2863 } 1888 }
2864 1889
2865 sync_bit_map = 0x0001; 1890 sync_bit_map = 0x0001;
@@ -2871,39 +1896,34 @@ ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
2871 temp = ((temp & 0x03) + ((temp << 4) & 0xc0)) + 1896 temp = ((temp & 0x03) + ((temp << 4) & 0xc0)) +
2872 (((temp << 4) & 0x0300) + ((temp << 8) & 0xc000)); 1897 (((temp << 4) & 0x0300) + ((temp << 8) & 0xc000));
2873 }else 1898 }else
2874 temp = utilEERead(ioport, (USHORT)((SYNC_RATE_TBL/2)+id)); 1899 temp = FPT_utilEERead(ioport, (USHORT)((SYNC_RATE_TBL/2)+id));
2875 1900
2876 for (i = 0; i < 2; temp >>=8,i++) { 1901 for (i = 0; i < 2; temp >>=8,i++) {
2877 1902
2878 if (pCardInfo->si_per_targ_init_sync & sync_bit_map) { 1903 if (pCardInfo->si_per_targ_init_sync & sync_bit_map) {
2879 1904
2880 sccbMgrTbl[thisCard][id*2+i].TarEEValue = (UCHAR)temp; 1905 FPT_sccbMgrTbl[thisCard][id*2+i].TarEEValue = (UCHAR)temp;
2881 } 1906 }
2882 1907
2883 else { 1908 else {
2884 sccbMgrTbl[thisCard][id*2+i].TarStatus |= SYNC_SUPPORTED; 1909 FPT_sccbMgrTbl[thisCard][id*2+i].TarStatus |= SYNC_SUPPORTED;
2885 sccbMgrTbl[thisCard][id*2+i].TarEEValue = 1910 FPT_sccbMgrTbl[thisCard][id*2+i].TarEEValue =
2886 (UCHAR)(temp & ~EE_SYNC_MASK); 1911 (UCHAR)(temp & ~EE_SYNC_MASK);
2887 } 1912 }
2888 1913
2889#if defined(WIDE_SCSI)
2890/* if ((pCardInfo->si_per_targ_wide_nego & sync_bit_map) || 1914/* if ((pCardInfo->si_per_targ_wide_nego & sync_bit_map) ||
2891 (id*2+i >= 8)){ 1915 (id*2+i >= 8)){
2892*/ 1916*/
2893 if (pCardInfo->si_per_targ_wide_nego & sync_bit_map){ 1917 if (pCardInfo->si_per_targ_wide_nego & sync_bit_map){
2894 1918
2895 sccbMgrTbl[thisCard][id*2+i].TarEEValue |= EE_WIDE_SCSI; 1919 FPT_sccbMgrTbl[thisCard][id*2+i].TarEEValue |= EE_WIDE_SCSI;
2896 1920
2897 } 1921 }
2898 1922
2899 else { /* NARROW SCSI */ 1923 else { /* NARROW SCSI */
2900 sccbMgrTbl[thisCard][id*2+i].TarStatus |= WIDE_NEGOCIATED; 1924 FPT_sccbMgrTbl[thisCard][id*2+i].TarStatus |= WIDE_NEGOCIATED;
2901 } 1925 }
2902 1926
2903#else
2904 sccbMgrTbl[thisCard][id*2+i].TarStatus |= WIDE_NEGOCIATED;
2905#endif
2906
2907 1927
2908 sync_bit_map <<= 1; 1928 sync_bit_map <<= 1;
2909 1929
@@ -2915,1285 +1935,97 @@ ULONG SccbMgr_config_adapter(PSCCBMGR_INFO pCardInfo)
2915 WR_HARPOON((ioport+hp_semaphore), 1935 WR_HARPOON((ioport+hp_semaphore),
2916 (UCHAR)(RD_HARPOON((ioport+hp_semaphore)) | SCCB_MGR_PRESENT)); 1936 (UCHAR)(RD_HARPOON((ioport+hp_semaphore)) | SCCB_MGR_PRESENT));
2917 1937
2918#if defined(DOS)
2919 return((USHORT)CurrCard);
2920#else
2921 return((ULONG)CurrCard); 1938 return((ULONG)CurrCard);
2922#endif
2923} 1939}
2924 1940
2925#else /* end (FW_TYPE==_SCCB_MGR_) */ 1941static void SccbMgr_unload_card(ULONG pCurrCard)
2926
2927
2928
2929STATIC s16bits FP_PresenceCheck(PMGR_INFO pMgrInfo)
2930{
2931 PMGR_ENTRYPNTS pMgr_EntryPnts = &pMgrInfo->mi_Functions;
2932
2933 pMgr_EntryPnts->UCBMgr_probe_adapter = probe_adapter;
2934 pMgr_EntryPnts->UCBMgr_init_adapter = init_adapter;
2935 pMgr_EntryPnts->UCBMgr_start_UCB = SccbMgr_start_sccb;
2936 pMgr_EntryPnts->UCBMgr_build_UCB = build_UCB;
2937 pMgr_EntryPnts->UCBMgr_abort_UCB = SccbMgr_abort_sccb;
2938 pMgr_EntryPnts->UCBMgr_my_int = SccbMgr_my_int;
2939 pMgr_EntryPnts->UCBMgr_isr = SccbMgr_isr;
2940 pMgr_EntryPnts->UCBMgr_scsi_reset = SccbMgr_scsi_reset;
2941 pMgr_EntryPnts->UCBMgr_timer_expired = SccbMgr_timer_expired;
2942#ifndef NO_IOCTLS
2943 pMgr_EntryPnts->UCBMgr_unload_card = SccbMgr_unload_card;
2944 pMgr_EntryPnts->UCBMgr_save_foreign_state =
2945 SccbMgr_save_foreign_state;
2946 pMgr_EntryPnts->UCBMgr_restore_foreign_state =
2947 SccbMgr_restore_foreign_state;
2948 pMgr_EntryPnts->UCBMgr_restore_native_state =
2949 SccbMgr_restore_native_state;
2950#endif /*NO_IOCTLS*/
2951
2952 pMgrInfo->mi_SGListFormat=0x01;
2953 pMgrInfo->mi_DataPtrFormat=0x01;
2954 pMgrInfo->mi_MaxSGElements= (u16bits) 0xffffffff;
2955 pMgrInfo->mi_MgrPrivateLen=sizeof(SCCB);
2956 pMgrInfo->mi_PCIVendorID=BL_VENDOR_ID;
2957 pMgrInfo->mi_PCIDeviceID=FP_DEVICE_ID;
2958 pMgrInfo->mi_MgrAttributes= ATTR_IO_MAPPED +
2959 ATTR_PHYSICAL_ADDRESS +
2960 ATTR_VIRTUAL_ADDRESS +
2961 ATTR_OVERLAPPED_IO_IOCTLS_OK;
2962 pMgrInfo->mi_IoRangeLen = 256;
2963 return(0);
2964}
2965
2966
2967
2968/*---------------------------------------------------------------------
2969 *
2970 * Function: probe_adapter
2971 *
2972 * Description: Setup and/or Search for cards and return info to caller.
2973 *
2974 *---------------------------------------------------------------------*/
2975STATIC s32bits probe_adapter(PADAPTER_INFO pAdapterInfo)
2976{
2977 u16bits temp,temp2,temp3,temp4;
2978 u08bits i,j,id;
2979
2980#if defined(DOS)
2981#else
2982 static u08bits first_time = 1;
2983#endif
2984 BASE_PORT ioport;
2985 PNVRamInfo pCurrNvRam;
2986
2987 ioport = (BASE_PORT)pAdapterInfo->ai_baseaddr;
2988
2989
2990
2991 if (RD_HARPOON(ioport+hp_vendor_id_0) != ORION_VEND_0)
2992 return(1);
2993
2994 if ((RD_HARPOON(ioport+hp_vendor_id_1) != ORION_VEND_1))
2995 return(2);
2996
2997 if ((RD_HARPOON(ioport+hp_device_id_0) != ORION_DEV_0))
2998 return(3);
2999
3000 if ((RD_HARPOON(ioport+hp_device_id_1) != ORION_DEV_1))
3001 return(4);
3002
3003
3004 if (RD_HARPOON(ioport+hp_rev_num) != 0x0f){
3005
3006
3007/* For new Harpoon then check for sub_device ID LSB
3008 the bits(0-3) must be all ZERO for compatible with
3009 current version of SCCBMgr, else skip this Harpoon
3010 device. */
3011
3012 if (RD_HARPOON(ioport+hp_sub_device_id_0) & 0x0f)
3013 return(5);
3014 }
3015
3016 if (first_time) {
3017
3018 SccbMgrTableInitAll();
3019 first_time = 0;
3020 mbCards = 0;
3021 }
3022
3023 if(RdStack(ioport, 0) != 0x00) {
3024 if(ChkIfChipInitialized(ioport) == FALSE)
3025 {
3026 pCurrNvRam = NULL;
3027 WR_HARPOON(ioport+hp_semaphore, 0x00);
3028 XbowInit(ioport, 0); /*Must Init the SCSI before attempting */
3029 DiagEEPROM(ioport);
3030 }
3031 else
3032 {
3033 if(mbCards < MAX_MB_CARDS) {
3034 pCurrNvRam = &nvRamInfo[mbCards];
3035 mbCards++;
3036 pCurrNvRam->niBaseAddr = ioport;
3037 RNVRamData(pCurrNvRam);
3038 }else
3039 return((int) FAILURE);
3040 }
3041 }else
3042 pCurrNvRam = NULL;
3043
3044#if defined (NO_BIOS_OPTION)
3045 pCurrNvRam = NULL;
3046 XbowInit(ioport, 0); /*Must Init the SCSI before attempting */
3047 DiagEEPROM(ioport);
3048#endif /* No BIOS Option */
3049
3050 WR_HARPOON(ioport+hp_clkctrl_0, CLKCTRL_DEFAULT);
3051 WR_HARPOON(ioport+hp_sys_ctrl, 0x00);
3052
3053 if(pCurrNvRam)
3054 pAdapterInfo->ai_id = pCurrNvRam->niAdapId;
3055 else
3056 pAdapterInfo->ai_id = (u08bits)(utilEERead(ioport, (ADAPTER_SCSI_ID/2)) &
3057 (u08bits)0x0FF);
3058
3059 pAdapterInfo->ai_lun = 0x00;
3060 pAdapterInfo->ai_fw_revision[0] = '3';
3061 pAdapterInfo->ai_fw_revision[1] = '1';
3062 pAdapterInfo->ai_fw_revision[2] = '1';
3063 pAdapterInfo->ai_fw_revision[3] = ' ';
3064 pAdapterInfo->ai_NumChannels = 1;
3065
3066 temp2 = 0x0000;
3067 temp3 = 0x0000;
3068 temp4 = 0x0000;
3069
3070 for (id = 0; id < (16/2); id++) {
3071
3072 if(pCurrNvRam){
3073 temp = (USHORT) pCurrNvRam->niSyncTbl[id];
3074 temp = ((temp & 0x03) + ((temp << 4) & 0xc0)) +
3075 (((temp << 4) & 0x0300) + ((temp << 8) & 0xc000));
3076 }else
3077 temp = utilEERead(ioport, (u16bits)((SYNC_RATE_TBL/2)+id));
3078
3079 for (i = 0; i < 2; temp >>=8,i++) {
3080
3081 if ((temp & 0x03) != AUTO_RATE_00) {
3082
3083 temp2 >>= 0x01;
3084 temp2 |= 0x8000;
3085 }
3086
3087 else {
3088 temp2 >>= 0x01;
3089 }
3090
3091 if (temp & DISC_ENABLE_BIT) {
3092
3093 temp3 >>= 0x01;
3094 temp3 |= 0x8000;
3095 }
3096
3097 else {
3098 temp3 >>= 0x01;
3099 }
3100
3101 if (temp & WIDE_NEGO_BIT) {
3102
3103 temp4 >>= 0x01;
3104 temp4 |= 0x8000;
3105 }
3106
3107 else {
3108 temp4 >>= 0x01;
3109 }
3110
3111 }
3112 }
3113
3114 pAdapterInfo->ai_per_targ_init_sync = temp2;
3115 pAdapterInfo->ai_per_targ_no_disc = temp3;
3116 pAdapterInfo->ai_per_targ_wide_nego = temp4;
3117 if(pCurrNvRam)
3118 i = pCurrNvRam->niSysConf;
3119 else
3120 i = (u08bits)(utilEERead(ioport, (SYSTEM_CONFIG/2)));
3121
3122 /*
3123 ** interrupts always level-triggered for FlashPoint
3124 */
3125 pAdapterInfo->ai_stateinfo |= LEVEL_TRIG;
3126
3127 if (i & 0x01)
3128 pAdapterInfo->ai_stateinfo |= SCSI_PARITY_ENA;
3129
3130 if (i & 0x02) /* SCSI Bus reset in AutoSCSI Set ? */
3131 {
3132 if(pCurrNvRam)
3133 {
3134 j = pCurrNvRam->niScamConf;
3135 }
3136 else
3137 {
3138 j = (u08bits) utilEERead(ioport, SCAM_CONFIG/2);
3139 }
3140 if(j & SCAM_ENABLED)
3141 {
3142 if(j & SCAM_LEVEL2)
3143 {
3144 pAdapterInfo->ai_stateinfo |= SCAM2_ENA;
3145 }
3146 else
3147 {
3148 pAdapterInfo->ai_stateinfo |= SCAM1_ENA;
3149 }
3150 }
3151 }
3152 j = (RD_HARPOON(ioport+hp_bm_ctrl) & ~SCSI_TERM_ENA_L);
3153 if (i & 0x04) {
3154 j |= SCSI_TERM_ENA_L;
3155 pAdapterInfo->ai_stateinfo |= LOW_BYTE_TERM_ENA;
3156 }
3157 WR_HARPOON(ioport+hp_bm_ctrl, j );
3158
3159 j = (RD_HARPOON(ioport+hp_ee_ctrl) & ~SCSI_TERM_ENA_H);
3160 if (i & 0x08) {
3161 j |= SCSI_TERM_ENA_H;
3162 pAdapterInfo->ai_stateinfo |= HIGH_BYTE_TERM_ENA;
3163 }
3164 WR_HARPOON(ioport+hp_ee_ctrl, j );
3165
3166 if(RD_HARPOON(ioport + hp_page_ctrl) & BIOS_SHADOW)
3167 {
3168 pAdapterInfo->ai_FlashRomSize = 64 * 1024; /* 64k ROM */
3169 }
3170 else
3171 {
3172 pAdapterInfo->ai_FlashRomSize = 32 * 1024; /* 32k ROM */
3173 }
3174
3175 pAdapterInfo->ai_stateinfo |= (FAST20_ENA | TAG_QUEUE_ENA);
3176 if (!(RD_HARPOON(ioport+hp_page_ctrl) & NARROW_SCSI_CARD))
3177 {
3178 pAdapterInfo->ai_attributes |= (WIDE_CAPABLE | FAST20_CAPABLE
3179 | SCAM2_CAPABLE
3180 | TAG_QUEUE_CAPABLE
3181 | SUPRESS_UNDERRRUNS_CAPABLE
3182 | SCSI_PARITY_CAPABLE);
3183 pAdapterInfo->ai_MaxTarg = 16;
3184 pAdapterInfo->ai_MaxLun = 32;
3185 }
3186 else
3187 {
3188 pAdapterInfo->ai_attributes |= (FAST20_CAPABLE | SCAM2_CAPABLE
3189 | TAG_QUEUE_CAPABLE
3190 | SUPRESS_UNDERRRUNS_CAPABLE
3191 | SCSI_PARITY_CAPABLE);
3192 pAdapterInfo->ai_MaxTarg = 8;
3193 pAdapterInfo->ai_MaxLun = 8;
3194 }
3195
3196 pAdapterInfo->ai_product_family = HARPOON_FAMILY;
3197 pAdapterInfo->ai_HBAbustype = BUSTYPE_PCI;
3198
3199 for (i=0;i<CARD_MODEL_NAMELEN;i++)
3200 {
3201 pAdapterInfo->ai_card_model[i]=' '; /* initialize the ai_card_model */
3202 }
3203
3204 if(pCurrNvRam){
3205 pAdapterInfo->ai_card_model[0] = '9';
3206 switch(pCurrNvRam->niModel & 0x0f){
3207 case MODEL_LT:
3208 pAdapterInfo->ai_card_model[1] = '3';
3209 pAdapterInfo->ai_card_model[2] = '0';
3210 break;
3211 case MODEL_LW:
3212 pAdapterInfo->ai_card_model[1] = '5';
3213 pAdapterInfo->ai_card_model[2] = '0';
3214 break;
3215 case MODEL_DL:
3216 pAdapterInfo->ai_card_model[1] = '3';
3217 pAdapterInfo->ai_card_model[2] = '2';
3218 break;
3219 case MODEL_DW:
3220 pAdapterInfo->ai_card_model[1] = '5';
3221 pAdapterInfo->ai_card_model[2] = '2';
3222 break;
3223 }
3224 }else{
3225 temp = utilEERead(ioport, (MODEL_NUMB_0/2));
3226 pAdapterInfo->ai_card_model[0] = (u08bits)(temp >> 8);
3227 temp = utilEERead(ioport, (MODEL_NUMB_2/2));
3228
3229 pAdapterInfo->ai_card_model[1] = (u08bits)(temp & 0x00FF);
3230 pAdapterInfo->ai_card_model[2] = (u08bits)(temp >> 8);
3231 }
3232
3233
3234
3235 pAdapterInfo->ai_FiberProductType = 0;
3236
3237 pAdapterInfo->ai_secondary_range = 0;
3238
3239 for (i=0;i<WORLD_WIDE_NAMELEN;i++)
3240 {
3241 pAdapterInfo->ai_worldwidename[i]='\0';
3242 }
3243
3244 for (i=0;i<VENDOR_NAMELEN;i++)
3245 {
3246 pAdapterInfo->ai_vendorstring[i]='\0';
3247 }
3248 pAdapterInfo->ai_vendorstring[0]='B';
3249 pAdapterInfo->ai_vendorstring[1]='U';
3250 pAdapterInfo->ai_vendorstring[2]='S';
3251 pAdapterInfo->ai_vendorstring[3]='L';
3252 pAdapterInfo->ai_vendorstring[4]='O';
3253 pAdapterInfo->ai_vendorstring[5]='G';
3254 pAdapterInfo->ai_vendorstring[6]='I';
3255 pAdapterInfo->ai_vendorstring[7]='C';
3256
3257 for (i=0;i<FAMILY_NAMELEN;i++)
3258 {
3259 pAdapterInfo->ai_AdapterFamilyString[i]='\0';
3260 }
3261 pAdapterInfo->ai_AdapterFamilyString[0]='F';
3262 pAdapterInfo->ai_AdapterFamilyString[1]='L';
3263 pAdapterInfo->ai_AdapterFamilyString[2]='A';
3264 pAdapterInfo->ai_AdapterFamilyString[3]='S';
3265 pAdapterInfo->ai_AdapterFamilyString[4]='H';
3266 pAdapterInfo->ai_AdapterFamilyString[5]='P';
3267 pAdapterInfo->ai_AdapterFamilyString[6]='O';
3268 pAdapterInfo->ai_AdapterFamilyString[7]='I';
3269 pAdapterInfo->ai_AdapterFamilyString[8]='N';
3270 pAdapterInfo->ai_AdapterFamilyString[9]='T';
3271
3272 ARAM_ACCESS(ioport);
3273
3274 for ( i = 0; i < 4; i++ ) {
3275
3276 pAdapterInfo->ai_XlatInfo[i] =
3277 RD_HARPOON(ioport+hp_aramBase+BIOS_DATA_OFFSET+i);
3278 }
3279
3280 /* return with -1 if no sort, else return with
3281 logical card number sorted by BIOS (zero-based) */
3282
3283
3284 pAdapterInfo->ai_relative_cardnum =
3285 (u08bits)(RD_HARPOON(ioport+hp_aramBase+BIOS_RELATIVE_CARD)-1);
3286
3287 SGRAM_ACCESS(ioport);
3288
3289 s_PhaseTbl[0] = phaseDataOut;
3290 s_PhaseTbl[1] = phaseDataIn;
3291 s_PhaseTbl[2] = phaseIllegal;
3292 s_PhaseTbl[3] = phaseIllegal;
3293 s_PhaseTbl[4] = phaseCommand;
3294 s_PhaseTbl[5] = phaseStatus;
3295 s_PhaseTbl[6] = phaseMsgOut;
3296 s_PhaseTbl[7] = phaseMsgIn;
3297
3298 pAdapterInfo->ai_present = 0x01;
3299
3300#if defined(BUGBUG)
3301
3302
3303 for (i = 0; i < MAX_CARDS; i++) {
3304
3305 for (id=0; id<debug_size; id++)
3306 debug_int[i][id] = (u08bits)0x00;
3307 debug_index[i] = 0;
3308 }
3309
3310#endif
3311
3312 return(0);
3313}
3314
3315
3316
3317
3318
3319/*---------------------------------------------------------------------
3320 *
3321 * Function: init_adapter, exported to BUDI via UCBMgr_init_adapter entry
3322 *
3323 *
3324 * Description: Setup adapter for normal operation (hard reset).
3325 *
3326 *---------------------------------------------------------------------*/
3327STATIC CARD_HANDLE init_adapter(PADAPTER_INFO pCardInfo)
3328{
3329 PSCCBcard CurrCard;
3330 PNVRamInfo pCurrNvRam;
3331 u08bits i,j,thisCard, ScamFlg;
3332 u16bits temp,sync_bit_map,id;
3333 BASE_PORT ioport;
3334
3335 ioport = (BASE_PORT)pCardInfo->ai_baseaddr;
3336
3337 for(thisCard =0; thisCard <= MAX_CARDS; thisCard++) {
3338
3339 if (thisCard == MAX_CARDS) {
3340
3341 return(FAILURE);
3342 }
3343
3344 if (BL_Card[thisCard].ioPort == ioport) {
3345
3346 CurrCard = &BL_Card[thisCard];
3347 SccbMgrTableInitCard(CurrCard,thisCard);
3348 break;
3349 }
3350
3351 else if (BL_Card[thisCard].ioPort == 0x00) {
3352
3353 BL_Card[thisCard].ioPort = ioport;
3354 CurrCard = &BL_Card[thisCard];
3355
3356 if(mbCards)
3357 for(i = 0; i < mbCards; i++){
3358 if(CurrCard->ioPort == nvRamInfo[i].niBaseAddr)
3359 CurrCard->pNvRamInfo = &nvRamInfo[i];
3360 }
3361 SccbMgrTableInitCard(CurrCard,thisCard);
3362 CurrCard->cardIndex = thisCard;
3363 CurrCard->cardInfo = pCardInfo;
3364
3365 break;
3366 }
3367 }
3368
3369 pCurrNvRam = CurrCard->pNvRamInfo;
3370
3371
3372 if(pCurrNvRam){
3373 ScamFlg = pCurrNvRam->niScamConf;
3374 }
3375 else{
3376 ScamFlg = (UCHAR) utilEERead(ioport, SCAM_CONFIG/2);
3377 }
3378
3379
3380 BusMasterInit(ioport);
3381 XbowInit(ioport, ScamFlg);
3382
3383#if defined (NO_BIOS_OPTION)
3384
3385
3386 if (DiagXbow(ioport)) return(FAILURE);
3387 if (DiagBusMaster(ioport)) return(FAILURE);
3388
3389#endif /* No BIOS Option */
3390
3391 autoLoadDefaultMap(ioport);
3392
3393
3394 for (i = 0,id = 0x01; i != pCardInfo->ai_id; i++,id <<= 1){}
3395
3396 WR_HARPOON(ioport+hp_selfid_0, id);
3397 WR_HARPOON(ioport+hp_selfid_1, 0x00);
3398 WR_HARPOON(ioport+hp_arb_id, pCardInfo->ai_id);
3399 CurrCard->ourId = (unsigned char) pCardInfo->ai_id;
3400
3401 i = (u08bits) pCardInfo->ai_stateinfo;
3402 if (i & SCSI_PARITY_ENA)
3403 WR_HARPOON(ioport+hp_portctrl_1,(HOST_MODE8 | CHK_SCSI_P));
3404
3405 j = (RD_HARPOON(ioport+hp_bm_ctrl) & ~SCSI_TERM_ENA_L);
3406 if (i & LOW_BYTE_TERM_ENA)
3407 j |= SCSI_TERM_ENA_L;
3408 WR_HARPOON(ioport+hp_bm_ctrl, j);
3409
3410 j = (RD_HARPOON(ioport+hp_ee_ctrl) & ~SCSI_TERM_ENA_H);
3411 if (i & HIGH_BYTE_TERM_ENA)
3412 j |= SCSI_TERM_ENA_H;
3413 WR_HARPOON(ioport+hp_ee_ctrl, j );
3414
3415
3416 if (!(pCardInfo->ai_stateinfo & NO_RESET_IN_INIT)) {
3417
3418 sresb(ioport,thisCard);
3419
3420 scini(thisCard, (u08bits) pCardInfo->ai_id, 0);
3421 }
3422
3423
3424
3425 if (pCardInfo->ai_stateinfo & SUPRESS_UNDERRRUNS_ENA)
3426 CurrCard->globalFlags |= F_NO_FILTER;
3427
3428 if(pCurrNvRam){
3429 if(pCurrNvRam->niSysConf & 0x10)
3430 CurrCard->globalFlags |= F_GREEN_PC;
3431 }
3432 else{
3433 if (utilEERead(ioport, (SYSTEM_CONFIG/2)) & GREEN_PC_ENA)
3434 CurrCard->globalFlags |= F_GREEN_PC;
3435 }
3436
3437 /* Set global flag to indicate Re-Negotiation to be done on all
3438 ckeck condition */
3439 if(pCurrNvRam){
3440 if(pCurrNvRam->niScsiConf & 0x04)
3441 CurrCard->globalFlags |= F_DO_RENEGO;
3442 }
3443 else{
3444 if (utilEERead(ioport, (SCSI_CONFIG/2)) & RENEGO_ENA)
3445 CurrCard->globalFlags |= F_DO_RENEGO;
3446 }
3447
3448 if(pCurrNvRam){
3449 if(pCurrNvRam->niScsiConf & 0x08)
3450 CurrCard->globalFlags |= F_CONLUN_IO;
3451 }
3452 else{
3453 if (utilEERead(ioport, (SCSI_CONFIG/2)) & CONNIO_ENA)
3454 CurrCard->globalFlags |= F_CONLUN_IO;
3455 }
3456
3457 temp = pCardInfo->ai_per_targ_no_disc;
3458
3459 for (i = 0,id = 1; i < MAX_SCSI_TAR; i++, id <<= 1) {
3460
3461 if (temp & id)
3462 sccbMgrTbl[thisCard][i].TarStatus |= TAR_ALLOW_DISC;
3463 }
3464
3465 sync_bit_map = 0x0001;
3466
3467 for (id = 0; id < (MAX_SCSI_TAR/2); id++){
3468
3469 if(pCurrNvRam){
3470 temp = (USHORT) pCurrNvRam->niSyncTbl[id];
3471 temp = ((temp & 0x03) + ((temp << 4) & 0xc0)) +
3472 (((temp << 4) & 0x0300) + ((temp << 8) & 0xc000));
3473 }else
3474 temp = utilEERead(ioport, (u16bits)((SYNC_RATE_TBL/2)+id));
3475
3476 for (i = 0; i < 2; temp >>=8,i++){
3477
3478 if (pCardInfo->ai_per_targ_init_sync & sync_bit_map){
3479
3480 sccbMgrTbl[thisCard][id*2+i].TarEEValue = (u08bits)temp;
3481 }
3482
3483 else {
3484 sccbMgrTbl[thisCard][id*2+i].TarStatus |= SYNC_SUPPORTED;
3485 sccbMgrTbl[thisCard][id*2+i].TarEEValue =
3486 (u08bits)(temp & ~EE_SYNC_MASK);
3487 }
3488
3489#if defined(WIDE_SCSI)
3490/* if ((pCardInfo->ai_per_targ_wide_nego & sync_bit_map) ||
3491 (id*2+i >= 8)){
3492*/
3493 if (pCardInfo->ai_per_targ_wide_nego & sync_bit_map){
3494
3495 sccbMgrTbl[thisCard][id*2+i].TarEEValue |= EE_WIDE_SCSI;
3496
3497 }
3498
3499 else { /* NARROW SCSI */
3500 sccbMgrTbl[thisCard][id*2+i].TarStatus |= WIDE_NEGOCIATED;
3501 }
3502
3503#else
3504 sccbMgrTbl[thisCard][id*2+i].TarStatus |= WIDE_NEGOCIATED;
3505#endif
3506
3507
3508 sync_bit_map <<= 1;
3509 }
3510 }
3511
3512
3513 pCardInfo->ai_SGListFormat=0x01;
3514 pCardInfo->ai_DataPtrFormat=0x01;
3515 pCardInfo->ai_AEN_mask &= SCSI_RESET_COMPLETE;
3516
3517 WR_HARPOON((ioport+hp_semaphore),
3518 (u08bits)(RD_HARPOON((ioport+hp_semaphore)) | SCCB_MGR_PRESENT));
3519
3520 return((u32bits)CurrCard);
3521
3522}
3523
3524
3525/*---------------------------------------------------------------------
3526 *
3527 * Function: build_ucb, exported to BUDI via UCBMgr_build_ucb entry
3528 *
3529 * Description: prepare fw portion of ucb. do not start, resource not guaranteed
3530 * so don't manipulate anything that's derived from states which
3531 * may change
3532 *
3533 *---------------------------------------------------------------------*/
3534void build_UCB(CARD_HANDLE pCurrCard, PUCB p_ucb)
3535{
3536
3537 u08bits thisCard;
3538 u08bits i,j;
3539
3540 PSCCB p_sccb;
3541
3542
3543 thisCard = ((PSCCBcard) pCurrCard)->cardIndex;
3544
3545
3546 p_sccb=(PSCCB)p_ucb->UCB_MgrPrivatePtr;
3547
3548
3549 p_sccb->Sccb_ucb_ptr=p_ucb;
3550
3551 switch (p_ucb->UCB_opcode & (OPC_DEVICE_RESET+OPC_XFER_SG+OPC_CHK_RESIDUAL))
3552 {
3553 case OPC_DEVICE_RESET:
3554 p_sccb->OperationCode=RESET_COMMAND;
3555 break;
3556 case OPC_XFER_SG:
3557 p_sccb->OperationCode=SCATTER_GATHER_COMMAND;
3558 break;
3559 case OPC_XFER_SG+OPC_CHK_RESIDUAL:
3560 p_sccb->OperationCode=RESIDUAL_SG_COMMAND;
3561 break;
3562 case OPC_CHK_RESIDUAL:
3563
3564 p_sccb->OperationCode=RESIDUAL_COMMAND;
3565 break;
3566 default:
3567 p_sccb->OperationCode=SCSI_INITIATOR_COMMAND;
3568 break;
3569 }
3570
3571 if (p_ucb->UCB_opcode & OPC_TQ_ENABLE)
3572 {
3573 p_sccb->ControlByte = (u08bits)((p_ucb->UCB_opcode & OPC_TQ_MASK)>>2) | F_USE_CMD_Q;
3574 }
3575 else
3576 {
3577 p_sccb->ControlByte = 0;
3578 }
3579
3580
3581 p_sccb->CdbLength = (u08bits)p_ucb->UCB_cdblen;
3582
3583 if (p_ucb->UCB_opcode & OPC_NO_AUTO_SENSE)
3584 {
3585 p_sccb->RequestSenseLength = 0;
3586 }
3587 else
3588 {
3589 p_sccb->RequestSenseLength = (unsigned char) p_ucb->UCB_senselen;
3590 }
3591
3592
3593 if (p_ucb->UCB_opcode & OPC_XFER_SG)
3594 {
3595 p_sccb->DataPointer=p_ucb->UCB_virt_dataptr;
3596 p_sccb->DataLength = (((u32bits)p_ucb->UCB_NumSgElements)<<3);
3597 }
3598 else
3599 {
3600 p_sccb->DataPointer=p_ucb->UCB_phys_dataptr;
3601 p_sccb->DataLength=p_ucb->UCB_datalen;
3602 };
3603
3604 p_sccb->HostStatus=0;
3605 p_sccb->TargetStatus=0;
3606 p_sccb->TargID=(unsigned char)p_ucb->UCB_targid;
3607 p_sccb->Lun=(unsigned char) p_ucb->UCB_lun;
3608 p_sccb->SccbIOPort=((PSCCBcard)pCurrCard)->ioPort;
3609
3610 j=p_ucb->UCB_cdblen;
3611 for (i=0;i<j;i++)
3612 {
3613 p_sccb->Cdb[i] = p_ucb->UCB_cdb[i];
3614 }
3615
3616 p_sccb->SensePointer=p_ucb->UCB_phys_senseptr;
3617
3618 sinits(p_sccb,thisCard);
3619
3620}
3621#ifndef NO_IOCTLS
3622
3623/*---------------------------------------------------------------------
3624 *
3625 * Function: GetDevSyncRate
3626 *
3627 *---------------------------------------------------------------------*/
3628STATIC int GetDevSyncRate(PSCCBcard pCurrCard,PUCB p_ucb)
3629{
3630 struct _SYNC_RATE_INFO * pSyncStr;
3631 PSCCBMgr_tar_info currTar_Info;
3632 BASE_PORT ioport;
3633 u08bits scsiID, j;
3634
3635#if (FW_TYPE != _SCCB_MGR_)
3636 if( p_ucb->UCB_targid >= pCurrCard->cardInfo->ai_MaxTarg )
3637 {
3638 return(1);
3639 }
3640#endif
3641
3642 ioport = pCurrCard->ioPort;
3643 pSyncStr = (struct _SYNC_RATE_INFO *) p_ucb->UCB_virt_dataptr;
3644 scsiID = (u08bits) p_ucb->UCB_targid;
3645 currTar_Info = &sccbMgrTbl[pCurrCard->cardIndex][scsiID];
3646 j = currTar_Info->TarSyncCtrl;
3647
3648 switch (currTar_Info->TarEEValue & EE_SYNC_MASK)
3649 {
3650 case EE_SYNC_ASYNC:
3651 pSyncStr->RequestMegaXferRate = 0x00;
3652 break;
3653 case EE_SYNC_5MB:
3654 pSyncStr->RequestMegaXferRate = (j & NARROW_SCSI) ? 50 : 100;
3655 break;
3656 case EE_SYNC_10MB:
3657 pSyncStr->RequestMegaXferRate = (j & NARROW_SCSI) ? 100 : 200;
3658 break;
3659 case EE_SYNC_20MB:
3660 pSyncStr->RequestMegaXferRate = (j & NARROW_SCSI) ? 200 : 400;
3661 break;
3662 }
3663
3664 switch ((j >> 5) & 0x07)
3665 {
3666 case 0x00:
3667 if((j & 0x07) == 0x00)
3668 {
3669 pSyncStr->ActualMegaXferRate = 0x00; /* Async Mode */
3670 }
3671 else
3672 {
3673 pSyncStr->ActualMegaXferRate = (j & NARROW_SCSI) ? 200 : 400;
3674 }
3675 break;
3676 case 0x01:
3677 pSyncStr->ActualMegaXferRate = (j & NARROW_SCSI) ? 100 : 200;
3678 break;
3679 case 0x02:
3680 pSyncStr->ActualMegaXferRate = (j & NARROW_SCSI) ? 66 : 122;
3681 break;
3682 case 0x03:
3683 pSyncStr->ActualMegaXferRate = (j & NARROW_SCSI) ? 50 : 100;
3684 break;
3685 case 0x04:
3686 pSyncStr->ActualMegaXferRate = (j & NARROW_SCSI) ? 40 : 80;
3687 break;
3688 case 0x05:
3689 pSyncStr->ActualMegaXferRate = (j & NARROW_SCSI) ? 33 : 66;
3690 break;
3691 case 0x06:
3692 pSyncStr->ActualMegaXferRate = (j & NARROW_SCSI) ? 28 : 56;
3693 break;
3694 case 0x07:
3695 pSyncStr->ActualMegaXferRate = (j & NARROW_SCSI) ? 25 : 50;
3696 break;
3697 }
3698 pSyncStr->NegotiatedOffset = j & 0x0f;
3699
3700 return(0);
3701}
3702
3703/*---------------------------------------------------------------------
3704 *
3705 * Function: SetDevSyncRate
3706 *
3707 *---------------------------------------------------------------------*/
3708STATIC int SetDevSyncRate(PSCCBcard pCurrCard, PUCB p_ucb)
3709{
3710 struct _SYNC_RATE_INFO * pSyncStr;
3711 PSCCBMgr_tar_info currTar_Info;
3712 BASE_PORT ioPort;
3713 u08bits scsiID, i, j, syncVal;
3714 u16bits syncOffset, actualXferRate;
3715 union {
3716 u08bits tempb[2];
3717 u16bits tempw;
3718 }temp2;
3719
3720#if (FW_TYPE != _SCCB_MGR_)
3721 if( p_ucb->UCB_targid >= pCurrCard->cardInfo->ai_MaxTarg )
3722 {
3723 return(1);
3724 }
3725#endif
3726
3727 ioPort = pCurrCard->ioPort;
3728 pSyncStr = (struct _SYNC_RATE_INFO *) p_ucb->UCB_virt_dataptr;
3729 scsiID = (u08bits) p_ucb->UCB_targid;
3730 currTar_Info = &sccbMgrTbl[pCurrCard->cardIndex][scsiID];
3731 i = RD_HARPOON(ioPort+hp_xfer_pad); /* Save current value */
3732 WR_HARPOON(ioPort+hp_xfer_pad, (i | ID_UNLOCK));
3733 WR_HARPOON(ioPort+hp_select_id, ((scsiID << 4) | scsiID));
3734 j = RD_HARPOON(ioPort+hp_synctarg_0);
3735 WR_HARPOON(ioPort+hp_xfer_pad, i); /* restore value */
3736
3737 actualXferRate = pSyncStr->ActualMegaXferRate;
3738 if(!(j & NARROW_SCSI))
3739 {
3740 actualXferRate <<= 1;
3741 }
3742 if(actualXferRate == 0x00)
3743 {
3744 syncVal = EE_SYNC_ASYNC; /* Async Mode */
3745 }
3746 if(actualXferRate == 0x0200)
3747 {
3748 syncVal = EE_SYNC_20MB; /* 20/40 MB Mode */
3749 }
3750 if(actualXferRate > 0x0050 && actualXferRate < 0x0200 )
3751 {
3752 syncVal = EE_SYNC_10MB; /* 10/20 MB Mode */
3753 }
3754 else
3755 {
3756 syncVal = EE_SYNC_5MB; /* 5/10 MB Mode */
3757 }
3758 if(currTar_Info->TarEEValue && EE_SYNC_MASK == syncVal)
3759 return(0);
3760 currTar_Info->TarEEValue = (currTar_Info->TarEEValue & !EE_SYNC_MASK)
3761 | syncVal;
3762 syncOffset = (SYNC_RATE_TBL + scsiID) / 2;
3763 temp2.tempw = utilEERead(ioPort, syncOffset);
3764 if(scsiID & 0x01)
3765 {
3766 temp2.tempb[0] = (temp2.tempb[0] & !EE_SYNC_MASK) | syncVal;
3767 }
3768 else
3769 {
3770 temp2.tempb[1] = (temp2.tempb[1] & !EE_SYNC_MASK) | syncVal;
3771 }
3772 utilEEWriteOnOff(ioPort, 1);
3773 utilEEWrite(ioPort, temp2.tempw, syncOffset);
3774 utilEEWriteOnOff(ioPort, 0);
3775 UpdateCheckSum(ioPort);
3776
3777 return(0);
3778}
3779/*---------------------------------------------------------------------
3780 *
3781 * Function: GetDevWideMode
3782 *
3783 *---------------------------------------------------------------------*/
3784int GetDevWideMode(PSCCBcard pCurrCard,PUCB p_ucb)
3785{
3786 u08bits *pData;
3787
3788 pData = (u08bits *)p_ucb->UCB_virt_dataptr;
3789 if(sccbMgrTbl[pCurrCard->cardIndex][p_ucb->UCB_targid].TarEEValue
3790 & EE_WIDE_SCSI)
3791 {
3792 *pData = 1;
3793 }
3794 else
3795 {
3796 *pData = 0;
3797 }
3798
3799 return(0);
3800}
3801
3802/*---------------------------------------------------------------------
3803 *
3804 * Function: SetDevWideMode
3805 *
3806 *---------------------------------------------------------------------*/
3807int SetDevWideMode(PSCCBcard pCurrCard,PUCB p_ucb)
3808{
3809 u08bits *pData;
3810 PSCCBMgr_tar_info currTar_Info;
3811 BASE_PORT ioPort;
3812 u08bits scsiID, scsiWideMode;
3813 u16bits syncOffset;
3814 union {
3815 u08bits tempb[2];
3816 u16bits tempw;
3817 }temp2;
3818
3819#if (FW_TYPE != _SCCB_MGR_)
3820 if( !(pCurrCard->cardInfo->ai_attributes & WIDE_CAPABLE) )
3821 {
3822 return(1);
3823 }
3824
3825 if( p_ucb->UCB_targid >= pCurrCard->cardInfo->ai_MaxTarg )
3826 {
3827 return(1);
3828 }
3829#endif
3830
3831 ioPort = pCurrCard->ioPort;
3832 pData = (u08bits *)p_ucb->UCB_virt_dataptr;
3833 scsiID = (u08bits) p_ucb->UCB_targid;
3834 currTar_Info = &sccbMgrTbl[pCurrCard->cardIndex][scsiID];
3835
3836 if(*pData)
3837 {
3838 if(currTar_Info->TarEEValue & EE_WIDE_SCSI)
3839 {
3840 return(0);
3841 }
3842 else
3843 {
3844 scsiWideMode = EE_WIDE_SCSI;
3845 }
3846 }
3847 else
3848 {
3849 if(!(currTar_Info->TarEEValue & EE_WIDE_SCSI))
3850 {
3851 return(0);
3852 }
3853 else
3854 {
3855 scsiWideMode = 0;
3856 }
3857 }
3858 currTar_Info->TarEEValue = (currTar_Info->TarEEValue & !EE_WIDE_SCSI)
3859 | scsiWideMode;
3860
3861 syncOffset = (SYNC_RATE_TBL + scsiID) / 2;
3862 temp2.tempw = utilEERead(ioPort, syncOffset);
3863 if(scsiID & 0x01)
3864 {
3865 temp2.tempb[0] = (temp2.tempb[0] & !EE_WIDE_SCSI) | scsiWideMode;
3866 }
3867 else
3868 {
3869 temp2.tempb[1] = (temp2.tempb[1] & !EE_WIDE_SCSI) | scsiWideMode;
3870 }
3871 utilEEWriteOnOff(ioPort, 1);
3872 utilEEWrite(ioPort, temp2.tempw, syncOffset);
3873 utilEEWriteOnOff(ioPort, 0);
3874 UpdateCheckSum(ioPort);
3875
3876 return(0);
3877}
3878
3879/*---------------------------------------------------------------------
3880 *
3881 * Function: ReadNVRam
3882 *
3883 *---------------------------------------------------------------------*/
3884void ReadNVRam(PSCCBcard pCurrCard,PUCB p_ucb)
3885{
3886 u08bits *pdata;
3887 u16bits i,numwrds,numbytes,offset,temp;
3888 u08bits OneMore = FALSE;
3889#if defined(DOS)
3890 u16bits ioport;
3891#else
3892 u32bits ioport;
3893#endif
3894
3895 numbytes = (u16bits) p_ucb->UCB_datalen;
3896 ioport = pCurrCard->ioPort;
3897 pdata = (u08bits *) p_ucb->UCB_virt_dataptr;
3898 offset = (u16bits) (p_ucb->UCB_IOCTLParams[0]);
3899
3900
3901
3902 if (offset & 0x1)
3903 {
3904 *((u16bits*) pdata) = utilEERead(ioport,(u16bits)((offset - 1) / 2)); /* 16 bit read */
3905 *pdata = *(pdata + 1);
3906 ++offset;
3907 ++pdata;
3908 --numbytes;
3909 }
3910
3911 numwrds = numbytes / 2;
3912 if (numbytes & 1)
3913 OneMore = TRUE;
3914
3915 for (i = 0; i < numwrds; i++)
3916 {
3917 *((u16bits*) pdata) = utilEERead(ioport,(u16bits)(offset / 2));
3918 pdata += 2;
3919 offset += 2;
3920 }
3921 if (OneMore)
3922 {
3923 --pdata;
3924 -- offset;
3925 temp = utilEERead(ioport,(u16bits)(offset / 2));
3926 *pdata = (u08bits) (temp);
3927 }
3928
3929} /* end proc ReadNVRam */
3930
3931
3932/*---------------------------------------------------------------------
3933 *
3934 * Function: WriteNVRam
3935 *
3936 *---------------------------------------------------------------------*/
3937void WriteNVRam(PSCCBcard pCurrCard,PUCB p_ucb)
3938{
3939 u08bits *pdata;
3940 u16bits i,numwrds,numbytes,offset, eeprom_end;
3941 u08bits OneMore = FALSE;
3942 union {
3943 u08bits tempb[2];
3944 u16bits tempw;
3945 } temp2;
3946
3947#if defined(DOS)
3948 u16bits ioport;
3949#else
3950 u32bits ioport;
3951#endif
3952
3953 numbytes = (u16bits) p_ucb->UCB_datalen;
3954 ioport = pCurrCard->ioPort;
3955 pdata = (u08bits *) p_ucb->UCB_virt_dataptr;
3956 offset = (u16bits) (p_ucb->UCB_IOCTLParams[0]);
3957
3958 if (RD_HARPOON(ioport+hp_page_ctrl) & NARROW_SCSI_CARD)
3959 eeprom_end = 512;
3960 else
3961 eeprom_end = 768;
3962
3963 if(offset > eeprom_end)
3964 return;
3965
3966 if((offset + numbytes) > eeprom_end)
3967 numbytes = eeprom_end - offset;
3968
3969 utilEEWriteOnOff(ioport,1); /* Enable write access to the EEPROM */
3970
3971
3972
3973 if (offset & 0x1)
3974 {
3975 temp2.tempw = utilEERead(ioport,(u16bits)((offset - 1) / 2)); /* 16 bit read */
3976 temp2.tempb[1] = *pdata;
3977 utilEEWrite(ioport, temp2.tempw, (u16bits)((offset -1) / 2));
3978 *pdata = *(pdata + 1);
3979 ++offset;
3980 ++pdata;
3981 --numbytes;
3982 }
3983
3984 numwrds = numbytes / 2;
3985 if (numbytes & 1)
3986 OneMore = TRUE;
3987
3988 for (i = 0; i < numwrds; i++)
3989 {
3990 utilEEWrite(ioport, *((pu16bits)pdata),(u16bits)(offset / 2));
3991 pdata += 2;
3992 offset += 2;
3993 }
3994 if (OneMore)
3995 {
3996
3997 temp2.tempw = utilEERead(ioport,(u16bits)(offset / 2));
3998 temp2.tempb[0] = *pdata;
3999 utilEEWrite(ioport, temp2.tempw, (u16bits)(offset / 2));
4000 }
4001 utilEEWriteOnOff(ioport,0); /* Turn off write access */
4002 UpdateCheckSum((u32bits)ioport);
4003
4004} /* end proc WriteNVRam */
4005
4006
4007
4008/*---------------------------------------------------------------------
4009 *
4010 * Function: UpdateCheckSum
4011 *
4012 * Description: Update Check Sum in EEPROM
4013 *
4014 *---------------------------------------------------------------------*/
4015
4016
4017void UpdateCheckSum(u32bits baseport)
4018{
4019 USHORT i,sum_data, eeprom_end;
4020
4021 sum_data = 0x0000;
4022
4023
4024 if (RD_HARPOON(baseport+hp_page_ctrl) & NARROW_SCSI_CARD)
4025 eeprom_end = 512;
4026 else
4027 eeprom_end = 768;
4028
4029 for (i = 1; i < eeprom_end/2; i++)
4030 {
4031 sum_data += utilEERead(baseport, i);
4032 }
4033
4034 utilEEWriteOnOff(baseport,1); /* Enable write access to the EEPROM */
4035
4036 utilEEWrite(baseport, sum_data, EEPROM_CHECK_SUM/2);
4037 utilEEWriteOnOff(baseport,0); /* Turn off write access */
4038}
4039
4040void SccbMgr_save_foreign_state(PADAPTER_INFO pAdapterInfo)
4041{
4042}
4043
4044
4045void SccbMgr_restore_foreign_state(CARD_HANDLE pCurrCard)
4046{
4047}
4048
4049void SccbMgr_restore_native_state(CARD_HANDLE pCurrCard)
4050{
4051}
4052
4053#endif /* NO_IOCTLS */
4054
4055#endif /* (FW_TYPE==_UCB_MGR_) */
4056
4057#ifndef NO_IOCTLS
4058#if (FW_TYPE==_UCB_MGR_)
4059void SccbMgr_unload_card(CARD_HANDLE pCurrCard)
4060#else
4061#if defined(DOS)
4062void SccbMgr_unload_card(USHORT pCurrCard)
4063#else
4064void SccbMgr_unload_card(ULONG pCurrCard)
4065#endif
4066#endif
4067{ 1942{
4068 UCHAR i; 1943 UCHAR i;
4069#if defined(DOS)
4070 USHORT portBase;
4071 USHORT regOffset;
4072#else
4073 ULONG portBase; 1944 ULONG portBase;
4074 ULONG regOffset; 1945 ULONG regOffset;
4075#endif
4076 ULONG scamData; 1946 ULONG scamData;
4077#if defined(OS2)
4078 ULONG far *pScamTbl;
4079#else
4080 ULONG *pScamTbl; 1947 ULONG *pScamTbl;
4081#endif
4082 PNVRamInfo pCurrNvRam; 1948 PNVRamInfo pCurrNvRam;
4083 1949
4084 pCurrNvRam = ((PSCCBcard)pCurrCard)->pNvRamInfo; 1950 pCurrNvRam = ((PSCCBcard)pCurrCard)->pNvRamInfo;
4085 1951
4086 if(pCurrNvRam){ 1952 if(pCurrNvRam){
4087 WrStack(pCurrNvRam->niBaseAddr, 0, pCurrNvRam->niModel); 1953 FPT_WrStack(pCurrNvRam->niBaseAddr, 0, pCurrNvRam->niModel);
4088 WrStack(pCurrNvRam->niBaseAddr, 1, pCurrNvRam->niSysConf); 1954 FPT_WrStack(pCurrNvRam->niBaseAddr, 1, pCurrNvRam->niSysConf);
4089 WrStack(pCurrNvRam->niBaseAddr, 2, pCurrNvRam->niScsiConf); 1955 FPT_WrStack(pCurrNvRam->niBaseAddr, 2, pCurrNvRam->niScsiConf);
4090 WrStack(pCurrNvRam->niBaseAddr, 3, pCurrNvRam->niScamConf); 1956 FPT_WrStack(pCurrNvRam->niBaseAddr, 3, pCurrNvRam->niScamConf);
4091 WrStack(pCurrNvRam->niBaseAddr, 4, pCurrNvRam->niAdapId); 1957 FPT_WrStack(pCurrNvRam->niBaseAddr, 4, pCurrNvRam->niAdapId);
4092 1958
4093 for(i = 0; i < MAX_SCSI_TAR / 2; i++) 1959 for(i = 0; i < MAX_SCSI_TAR / 2; i++)
4094 WrStack(pCurrNvRam->niBaseAddr, (UCHAR)(i+5), pCurrNvRam->niSyncTbl[i]); 1960 FPT_WrStack(pCurrNvRam->niBaseAddr, (UCHAR)(i+5), pCurrNvRam->niSyncTbl[i]);
4095 1961
4096 portBase = pCurrNvRam->niBaseAddr; 1962 portBase = pCurrNvRam->niBaseAddr;
4097 1963
4098 for(i = 0; i < MAX_SCSI_TAR; i++){ 1964 for(i = 0; i < MAX_SCSI_TAR; i++){
4099 regOffset = hp_aramBase + 64 + i*4; 1965 regOffset = hp_aramBase + 64 + i*4;
4100#if defined(OS2)
4101 pScamTbl = (ULONG far *) &pCurrNvRam->niScamTbl[i];
4102#else
4103 pScamTbl = (ULONG *) &pCurrNvRam->niScamTbl[i]; 1966 pScamTbl = (ULONG *) &pCurrNvRam->niScamTbl[i];
4104#endif
4105 scamData = *pScamTbl; 1967 scamData = *pScamTbl;
4106 WR_HARP32(portBase, regOffset, scamData); 1968 WR_HARP32(portBase, regOffset, scamData);
4107 } 1969 }
4108 1970
4109 }else{ 1971 }else{
4110 WrStack(((PSCCBcard)pCurrCard)->ioPort, 0, 0); 1972 FPT_WrStack(((PSCCBcard)pCurrCard)->ioPort, 0, 0);
4111 } 1973 }
4112} 1974}
4113#endif /* NO_IOCTLS */
4114 1975
4115 1976
4116void RNVRamData(PNVRamInfo pNvRamInfo) 1977static void FPT_RNVRamData(PNVRamInfo pNvRamInfo)
4117{ 1978{
4118 UCHAR i; 1979 UCHAR i;
4119#if defined(DOS)
4120 USHORT portBase;
4121 USHORT regOffset;
4122#else
4123 ULONG portBase; 1980 ULONG portBase;
4124 ULONG regOffset; 1981 ULONG regOffset;
4125#endif
4126 ULONG scamData; 1982 ULONG scamData;
4127#if defined (OS2)
4128 ULONG far *pScamTbl;
4129#else
4130 ULONG *pScamTbl; 1983 ULONG *pScamTbl;
4131#endif
4132 1984
4133 pNvRamInfo->niModel = RdStack(pNvRamInfo->niBaseAddr, 0); 1985 pNvRamInfo->niModel = FPT_RdStack(pNvRamInfo->niBaseAddr, 0);
4134 pNvRamInfo->niSysConf = RdStack(pNvRamInfo->niBaseAddr, 1); 1986 pNvRamInfo->niSysConf = FPT_RdStack(pNvRamInfo->niBaseAddr, 1);
4135 pNvRamInfo->niScsiConf = RdStack(pNvRamInfo->niBaseAddr, 2); 1987 pNvRamInfo->niScsiConf = FPT_RdStack(pNvRamInfo->niBaseAddr, 2);
4136 pNvRamInfo->niScamConf = RdStack(pNvRamInfo->niBaseAddr, 3); 1988 pNvRamInfo->niScamConf = FPT_RdStack(pNvRamInfo->niBaseAddr, 3);
4137 pNvRamInfo->niAdapId = RdStack(pNvRamInfo->niBaseAddr, 4); 1989 pNvRamInfo->niAdapId = FPT_RdStack(pNvRamInfo->niBaseAddr, 4);
4138 1990
4139 for(i = 0; i < MAX_SCSI_TAR / 2; i++) 1991 for(i = 0; i < MAX_SCSI_TAR / 2; i++)
4140 pNvRamInfo->niSyncTbl[i] = RdStack(pNvRamInfo->niBaseAddr, (UCHAR)(i+5)); 1992 pNvRamInfo->niSyncTbl[i] = FPT_RdStack(pNvRamInfo->niBaseAddr, (UCHAR)(i+5));
4141 1993
4142 portBase = pNvRamInfo->niBaseAddr; 1994 portBase = pNvRamInfo->niBaseAddr;
4143 1995
4144 for(i = 0; i < MAX_SCSI_TAR; i++){ 1996 for(i = 0; i < MAX_SCSI_TAR; i++){
4145 regOffset = hp_aramBase + 64 + i*4; 1997 regOffset = hp_aramBase + 64 + i*4;
4146 RD_HARP32(portBase, regOffset, scamData); 1998 RD_HARP32(portBase, regOffset, scamData);
4147#if defined(OS2)
4148 pScamTbl = (ULONG far *) &pNvRamInfo->niScamTbl[i];
4149#else
4150 pScamTbl = (ULONG *) &pNvRamInfo->niScamTbl[i]; 1999 pScamTbl = (ULONG *) &pNvRamInfo->niScamTbl[i];
4151#endif
4152 *pScamTbl = scamData; 2000 *pScamTbl = scamData;
4153 } 2001 }
4154 2002
4155} 2003}
4156 2004
4157#if defined(DOS) 2005static UCHAR FPT_RdStack(ULONG portBase, UCHAR index)
4158UCHAR RdStack(USHORT portBase, UCHAR index)
4159#else
4160UCHAR RdStack(ULONG portBase, UCHAR index)
4161#endif
4162{ 2006{
4163 WR_HARPOON(portBase + hp_stack_addr, index); 2007 WR_HARPOON(portBase + hp_stack_addr, index);
4164 return(RD_HARPOON(portBase + hp_stack_data)); 2008 return(RD_HARPOON(portBase + hp_stack_data));
4165} 2009}
4166 2010
4167#if defined(DOS) 2011static void FPT_WrStack(ULONG portBase, UCHAR index, UCHAR data)
4168void WrStack(USHORT portBase, UCHAR index, UCHAR data)
4169#else
4170void WrStack(ULONG portBase, UCHAR index, UCHAR data)
4171#endif
4172{ 2012{
4173 WR_HARPOON(portBase + hp_stack_addr, index); 2013 WR_HARPOON(portBase + hp_stack_addr, index);
4174 WR_HARPOON(portBase + hp_stack_data, data); 2014 WR_HARPOON(portBase + hp_stack_data, data);
4175} 2015}
4176 2016
4177 2017
4178#if (FW_TYPE==_UCB_MGR_) 2018static UCHAR FPT_ChkIfChipInitialized(ULONG ioPort)
4179u08bits ChkIfChipInitialized(BASE_PORT ioPort)
4180#else
4181#if defined(DOS)
4182UCHAR ChkIfChipInitialized(USHORT ioPort)
4183#else
4184UCHAR ChkIfChipInitialized(ULONG ioPort)
4185#endif
4186#endif
4187{ 2019{
4188 if((RD_HARPOON(ioPort + hp_arb_id) & 0x0f) != RdStack(ioPort, 4)) 2020 if((RD_HARPOON(ioPort + hp_arb_id) & 0x0f) != FPT_RdStack(ioPort, 4))
4189 return(FALSE); 2021 return(0);
4190 if((RD_HARPOON(ioPort + hp_clkctrl_0) & CLKCTRL_DEFAULT) 2022 if((RD_HARPOON(ioPort + hp_clkctrl_0) & CLKCTRL_DEFAULT)
4191 != CLKCTRL_DEFAULT) 2023 != CLKCTRL_DEFAULT)
4192 return(FALSE); 2024 return(0);
4193 if((RD_HARPOON(ioPort + hp_seltimeout) == TO_250ms) || 2025 if((RD_HARPOON(ioPort + hp_seltimeout) == TO_250ms) ||
4194 (RD_HARPOON(ioPort + hp_seltimeout) == TO_290ms)) 2026 (RD_HARPOON(ioPort + hp_seltimeout) == TO_290ms))
4195 return(TRUE); 2027 return(1);
4196 return(FALSE); 2028 return(0);
4197 2029
4198} 2030}
4199/*--------------------------------------------------------------------- 2031/*---------------------------------------------------------------------
@@ -4205,185 +2037,29 @@ UCHAR ChkIfChipInitialized(ULONG ioPort)
4205 * callback function. 2037 * callback function.
4206 * 2038 *
4207 *---------------------------------------------------------------------*/ 2039 *---------------------------------------------------------------------*/
4208#if (FW_TYPE==_UCB_MGR_) 2040static void SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4209void SccbMgr_start_sccb(CARD_HANDLE pCurrCard, PUCB p_ucb)
4210#else
4211#if defined(DOS)
4212void SccbMgr_start_sccb(USHORT pCurrCard, PSCCB p_Sccb)
4213#else
4214void SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4215#endif
4216#endif
4217{ 2041{
4218#if defined(DOS)
4219 USHORT ioport;
4220#else
4221 ULONG ioport; 2042 ULONG ioport;
4222#endif
4223 UCHAR thisCard, lun; 2043 UCHAR thisCard, lun;
4224 PSCCB pSaveSccb; 2044 PSCCB pSaveSccb;
4225 CALL_BK_FN callback; 2045 CALL_BK_FN callback;
4226 2046
4227#if (FW_TYPE==_UCB_MGR_)
4228 PSCCB p_Sccb;
4229#endif
4230
4231 mOS_Lock((PSCCBcard)pCurrCard);
4232 thisCard = ((PSCCBcard) pCurrCard)->cardIndex; 2047 thisCard = ((PSCCBcard) pCurrCard)->cardIndex;
4233 ioport = ((PSCCBcard) pCurrCard)->ioPort; 2048 ioport = ((PSCCBcard) pCurrCard)->ioPort;
4234 2049
4235#if (FW_TYPE==_UCB_MGR_)
4236 p_Sccb = (PSCCB)p_ucb->UCB_MgrPrivatePtr;
4237#endif
4238
4239 if((p_Sccb->TargID > MAX_SCSI_TAR) || (p_Sccb->Lun > MAX_LUN)) 2050 if((p_Sccb->TargID > MAX_SCSI_TAR) || (p_Sccb->Lun > MAX_LUN))
4240 { 2051 {
4241 2052
4242#if (FW_TYPE==_UCB_MGR_)
4243 p_ucb->UCB_hbastat = SCCB_COMPLETE;
4244 p_ucb->UCB_status=SCCB_ERROR;
4245 callback = (CALL_BK_FN)p_ucb->UCB_callback;
4246 if (callback)
4247 callback(p_ucb);
4248#endif
4249
4250#if (FW_TYPE==_SCCB_MGR_)
4251 p_Sccb->HostStatus = SCCB_COMPLETE; 2053 p_Sccb->HostStatus = SCCB_COMPLETE;
4252 p_Sccb->SccbStatus = SCCB_ERROR; 2054 p_Sccb->SccbStatus = SCCB_ERROR;
4253 callback = (CALL_BK_FN)p_Sccb->SccbCallback; 2055 callback = (CALL_BK_FN)p_Sccb->SccbCallback;
4254 if (callback) 2056 if (callback)
4255 callback(p_Sccb); 2057 callback(p_Sccb);
4256#endif
4257 2058
4258 mOS_UnLock((PSCCBcard)pCurrCard);
4259 return; 2059 return;
4260 } 2060 }
4261 2061
4262#if (FW_TYPE==_SCCB_MGR_) 2062 FPT_sinits(p_Sccb,thisCard);
4263 sinits(p_Sccb,thisCard);
4264#endif
4265
4266
4267#if (FW_TYPE==_UCB_MGR_)
4268#ifndef NO_IOCTLS
4269
4270 if (p_ucb->UCB_opcode & OPC_IOCTL)
4271 {
4272
4273 switch (p_ucb->UCB_IOCTLCommand)
4274 {
4275 case READ_NVRAM:
4276 ReadNVRam((PSCCBcard)pCurrCard,p_ucb);
4277 p_ucb->UCB_status=UCB_SUCCESS;
4278 callback = (CALL_BK_FN)p_ucb->UCB_callback;
4279 if (callback)
4280 callback(p_ucb);
4281 mOS_UnLock((PSCCBcard)pCurrCard);
4282 return;
4283
4284 case WRITE_NVRAM:
4285 WriteNVRam((PSCCBcard)pCurrCard,p_ucb);
4286 p_ucb->UCB_status=UCB_SUCCESS;
4287 callback = (CALL_BK_FN)p_ucb->UCB_callback;
4288 if (callback)
4289 callback(p_ucb);
4290 mOS_UnLock((PSCCBcard)pCurrCard);
4291 return;
4292
4293 case SEND_SCSI_PASSTHRU:
4294#if (FW_TYPE != _SCCB_MGR_)
4295 if( p_ucb->UCB_targid >=
4296 ((PSCCBcard)pCurrCard)->cardInfo->ai_MaxTarg )
4297 {
4298 p_ucb->UCB_status = UCB_ERROR;
4299 p_ucb->UCB_hbastat = HASTAT_HW_ERROR;
4300 callback = (CALL_BK_FN)p_ucb->UCB_callback;
4301 if (callback)
4302 callback(p_ucb);
4303 mOS_UnLock((PSCCBcard)pCurrCard);
4304 return;
4305 }
4306#endif
4307 break;
4308
4309 case HARD_RESET:
4310 p_ucb->UCB_status = UCB_INVALID;
4311 callback = (CALL_BK_FN)p_ucb->UCB_callback;
4312 if (callback)
4313 callback(p_ucb);
4314 mOS_UnLock((PSCCBcard)pCurrCard);
4315 return;
4316 case GET_DEVICE_SYNCRATE:
4317 if( !GetDevSyncRate((PSCCBcard)pCurrCard,p_ucb) )
4318 {
4319 p_ucb->UCB_status = UCB_SUCCESS;
4320 }
4321 else
4322 {
4323 p_ucb->UCB_status = UCB_ERROR;
4324 p_ucb->UCB_hbastat = HASTAT_HW_ERROR;
4325 }
4326 callback = (CALL_BK_FN)p_ucb->UCB_callback;
4327 if (callback)
4328 callback(p_ucb);
4329 mOS_UnLock((PSCCBcard)pCurrCard);
4330 return;
4331 case SET_DEVICE_SYNCRATE:
4332 if( !SetDevSyncRate((PSCCBcard)pCurrCard,p_ucb) )
4333 {
4334 p_ucb->UCB_status = UCB_SUCCESS;
4335 }
4336 else
4337 {
4338 p_ucb->UCB_status = UCB_ERROR;
4339 p_ucb->UCB_hbastat = HASTAT_HW_ERROR;
4340 }
4341 callback = (CALL_BK_FN)p_ucb->UCB_callback;
4342 if (callback)
4343 callback(p_ucb);
4344 mOS_UnLock((PSCCBcard)pCurrCard);
4345 return;
4346 case GET_WIDE_MODE:
4347 if( !GetDevWideMode((PSCCBcard)pCurrCard,p_ucb) )
4348 {
4349 p_ucb->UCB_status = UCB_SUCCESS;
4350 }
4351 else
4352 {
4353 p_ucb->UCB_status = UCB_ERROR;
4354 p_ucb->UCB_hbastat = HASTAT_HW_ERROR;
4355 }
4356 callback = (CALL_BK_FN)p_ucb->UCB_callback;
4357 if (callback)
4358 callback(p_ucb);
4359 mOS_UnLock((PSCCBcard)pCurrCard);
4360 return;
4361 case SET_WIDE_MODE:
4362 if( !SetDevWideMode((PSCCBcard)pCurrCard,p_ucb) )
4363 {
4364 p_ucb->UCB_status = UCB_SUCCESS;
4365 }
4366 else
4367 {
4368 p_ucb->UCB_status = UCB_ERROR;
4369 p_ucb->UCB_hbastat = HASTAT_HW_ERROR;
4370 }
4371 callback = (CALL_BK_FN)p_ucb->UCB_callback;
4372 if (callback)
4373 callback(p_ucb);
4374 mOS_UnLock((PSCCBcard)pCurrCard);
4375 return;
4376 default:
4377 p_ucb->UCB_status=UCB_INVALID;
4378 callback = (CALL_BK_FN)p_ucb->UCB_callback;
4379 if (callback)
4380 callback(p_ucb);
4381 mOS_UnLock((PSCCBcard)pCurrCard);
4382 return;
4383 }
4384 }
4385#endif /* NO_IOCTLS */
4386#endif /* (FW_TYPE==_UCB_MGR_) */
4387 2063
4388 2064
4389 if (!((PSCCBcard) pCurrCard)->cmdCounter) 2065 if (!((PSCCBcard) pCurrCard)->cmdCounter)
@@ -4408,12 +2084,12 @@ void SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4408 { 2084 {
4409 pSaveSccb = ((PSCCBcard) pCurrCard)->currentSCCB; 2085 pSaveSccb = ((PSCCBcard) pCurrCard)->currentSCCB;
4410 ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb; 2086 ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;
4411 queueSelectFail(&BL_Card[thisCard], thisCard); 2087 FPT_queueSelectFail(&FPT_BL_Card[thisCard], thisCard);
4412 ((PSCCBcard) pCurrCard)->currentSCCB = pSaveSccb; 2088 ((PSCCBcard) pCurrCard)->currentSCCB = pSaveSccb;
4413 } 2089 }
4414 else 2090 else
4415 { 2091 {
4416 queueAddSccb(p_Sccb,thisCard); 2092 FPT_queueAddSccb(p_Sccb,thisCard);
4417 } 2093 }
4418 } 2094 }
4419 2095
@@ -4423,12 +2099,12 @@ void SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4423 { 2099 {
4424 pSaveSccb = ((PSCCBcard) pCurrCard)->currentSCCB; 2100 pSaveSccb = ((PSCCBcard) pCurrCard)->currentSCCB;
4425 ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb; 2101 ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;
4426 queueSelectFail(&BL_Card[thisCard], thisCard); 2102 FPT_queueSelectFail(&FPT_BL_Card[thisCard], thisCard);
4427 ((PSCCBcard) pCurrCard)->currentSCCB = pSaveSccb; 2103 ((PSCCBcard) pCurrCard)->currentSCCB = pSaveSccb;
4428 } 2104 }
4429 else 2105 else
4430 { 2106 {
4431 queueAddSccb(p_Sccb,thisCard); 2107 FPT_queueAddSccb(p_Sccb,thisCard);
4432 } 2108 }
4433 } 2109 }
4434 2110
@@ -4437,23 +2113,17 @@ void SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4437 MDISABLE_INT(ioport); 2113 MDISABLE_INT(ioport);
4438 2114
4439 if((((PSCCBcard) pCurrCard)->globalFlags & F_CONLUN_IO) && 2115 if((((PSCCBcard) pCurrCard)->globalFlags & F_CONLUN_IO) &&
4440 ((sccbMgrTbl[thisCard][p_Sccb->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)) 2116 ((FPT_sccbMgrTbl[thisCard][p_Sccb->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))
4441 lun = p_Sccb->Lun; 2117 lun = p_Sccb->Lun;
4442 else 2118 else
4443 lun = 0; 2119 lun = 0;
4444 if ((((PSCCBcard) pCurrCard)->currentSCCB == NULL) && 2120 if ((((PSCCBcard) pCurrCard)->currentSCCB == NULL) &&
4445 (sccbMgrTbl[thisCard][p_Sccb->TargID].TarSelQ_Cnt == 0) && 2121 (FPT_sccbMgrTbl[thisCard][p_Sccb->TargID].TarSelQ_Cnt == 0) &&
4446 (sccbMgrTbl[thisCard][p_Sccb->TargID].TarLUNBusy[lun] 2122 (FPT_sccbMgrTbl[thisCard][p_Sccb->TargID].TarLUNBusy[lun]
4447 == FALSE)) { 2123 == 0)) {
4448 2124
4449 ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb; 2125 ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;
4450 mOS_UnLock((PSCCBcard)pCurrCard); 2126 FPT_ssel(p_Sccb->SccbIOPort,thisCard);
4451#if defined(DOS)
4452 ssel((USHORT)p_Sccb->SccbIOPort,thisCard);
4453#else
4454 ssel(p_Sccb->SccbIOPort,thisCard);
4455#endif
4456 mOS_Lock((PSCCBcard)pCurrCard);
4457 } 2127 }
4458 2128
4459 else { 2129 else {
@@ -4462,12 +2132,12 @@ void SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4462 { 2132 {
4463 pSaveSccb = ((PSCCBcard) pCurrCard)->currentSCCB; 2133 pSaveSccb = ((PSCCBcard) pCurrCard)->currentSCCB;
4464 ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb; 2134 ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;
4465 queueSelectFail(&BL_Card[thisCard], thisCard); 2135 FPT_queueSelectFail(&FPT_BL_Card[thisCard], thisCard);
4466 ((PSCCBcard) pCurrCard)->currentSCCB = pSaveSccb; 2136 ((PSCCBcard) pCurrCard)->currentSCCB = pSaveSccb;
4467 } 2137 }
4468 else 2138 else
4469 { 2139 {
4470 queueAddSccb(p_Sccb,thisCard); 2140 FPT_queueAddSccb(p_Sccb,thisCard);
4471 } 2141 }
4472 } 2142 }
4473 2143
@@ -4475,7 +2145,6 @@ void SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4475 MENABLE_INT(ioport); 2145 MENABLE_INT(ioport);
4476 } 2146 }
4477 2147
4478 mOS_UnLock((PSCCBcard)pCurrCard);
4479} 2148}
4480 2149
4481 2150
@@ -4488,22 +2157,9 @@ void SccbMgr_start_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4488 * callback function. 2157 * callback function.
4489 * 2158 *
4490 *---------------------------------------------------------------------*/ 2159 *---------------------------------------------------------------------*/
4491#if (FW_TYPE==_UCB_MGR_) 2160static int SccbMgr_abort_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4492s32bits SccbMgr_abort_sccb(CARD_HANDLE pCurrCard, PUCB p_ucb)
4493#else
4494#if defined(DOS)
4495int SccbMgr_abort_sccb(USHORT pCurrCard, PSCCB p_Sccb)
4496#else
4497int SccbMgr_abort_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4498#endif
4499#endif
4500
4501{ 2161{
4502#if defined(DOS)
4503 USHORT ioport;
4504#else
4505 ULONG ioport; 2162 ULONG ioport;
4506#endif
4507 2163
4508 UCHAR thisCard; 2164 UCHAR thisCard;
4509 CALL_BK_FN callback; 2165 CALL_BK_FN callback;
@@ -4512,53 +2168,31 @@ int SccbMgr_abort_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4512 PSCCBMgr_tar_info currTar_Info; 2168 PSCCBMgr_tar_info currTar_Info;
4513 2169
4514 2170
4515#if (FW_TYPE==_UCB_MGR_)
4516 PSCCB p_Sccb;
4517 p_Sccb=(PSCCB)p_ucb->UCB_MgrPrivatePtr;
4518#endif
4519
4520 ioport = ((PSCCBcard) pCurrCard)->ioPort; 2171 ioport = ((PSCCBcard) pCurrCard)->ioPort;
4521 2172
4522 thisCard = ((PSCCBcard)pCurrCard)->cardIndex; 2173 thisCard = ((PSCCBcard)pCurrCard)->cardIndex;
4523 2174
4524 mOS_Lock((PSCCBcard)pCurrCard); 2175 if (!(RD_HARPOON(ioport+hp_page_ctrl) & G_INT_DISABLE))
4525
4526 if (RD_HARPOON(ioport+hp_page_ctrl) & G_INT_DISABLE)
4527 { 2176 {
4528 mOS_UnLock((PSCCBcard)pCurrCard);
4529 }
4530 2177
4531 else 2178 if (FPT_queueFindSccb(p_Sccb,thisCard))
4532 {
4533
4534 if (queueFindSccb(p_Sccb,thisCard))
4535 { 2179 {
4536 2180
4537 mOS_UnLock((PSCCBcard)pCurrCard);
4538
4539 ((PSCCBcard)pCurrCard)->cmdCounter--; 2181 ((PSCCBcard)pCurrCard)->cmdCounter--;
4540 2182
4541 if (!((PSCCBcard)pCurrCard)->cmdCounter) 2183 if (!((PSCCBcard)pCurrCard)->cmdCounter)
4542 WR_HARPOON(ioport+hp_semaphore,(RD_HARPOON(ioport+hp_semaphore) 2184 WR_HARPOON(ioport+hp_semaphore,(RD_HARPOON(ioport+hp_semaphore)
4543 & (UCHAR)(~(SCCB_MGR_ACTIVE | TICKLE_ME)) )); 2185 & (UCHAR)(~(SCCB_MGR_ACTIVE | TICKLE_ME)) ));
4544 2186
4545#if (FW_TYPE==_SCCB_MGR_)
4546 p_Sccb->SccbStatus = SCCB_ABORT; 2187 p_Sccb->SccbStatus = SCCB_ABORT;
4547 callback = p_Sccb->SccbCallback; 2188 callback = p_Sccb->SccbCallback;
4548 callback(p_Sccb); 2189 callback(p_Sccb);
4549#else
4550 p_ucb->UCB_status=SCCB_ABORT;
4551 callback = (CALL_BK_FN)p_ucb->UCB_callback;
4552 callback(p_ucb);
4553#endif
4554 2190
4555 return(0); 2191 return(0);
4556 } 2192 }
4557 2193
4558 else 2194 else
4559 { 2195 {
4560 mOS_UnLock((PSCCBcard)pCurrCard);
4561
4562 if (((PSCCBcard)pCurrCard)->currentSCCB == p_Sccb) 2196 if (((PSCCBcard)pCurrCard)->currentSCCB == p_Sccb)
4563 { 2197 {
4564 p_Sccb->SccbStatus = SCCB_ABORT; 2198 p_Sccb->SccbStatus = SCCB_ABORT;
@@ -4579,21 +2213,18 @@ int SccbMgr_abort_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4579 { 2213 {
4580 p_Sccb->SccbStatus = SCCB_ABORT; 2214 p_Sccb->SccbStatus = SCCB_ABORT;
4581 p_Sccb->Sccb_scsistat = ABORT_ST; 2215 p_Sccb->Sccb_scsistat = ABORT_ST;
4582#if (FW_TYPE==_UCB_MGR_)
4583 p_ucb->UCB_status=SCCB_ABORT;
4584#endif
4585 p_Sccb->Sccb_scsimsg = SMABORT_TAG; 2216 p_Sccb->Sccb_scsimsg = SMABORT_TAG;
4586 2217
4587 if(((PSCCBcard) pCurrCard)->currentSCCB == NULL) 2218 if(((PSCCBcard) pCurrCard)->currentSCCB == NULL)
4588 { 2219 {
4589 ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb; 2220 ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;
4590 ssel(ioport, thisCard); 2221 FPT_ssel(ioport, thisCard);
4591 } 2222 }
4592 else 2223 else
4593 { 2224 {
4594 pSaveSCCB = ((PSCCBcard) pCurrCard)->currentSCCB; 2225 pSaveSCCB = ((PSCCBcard) pCurrCard)->currentSCCB;
4595 ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb; 2226 ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;
4596 queueSelectFail((PSCCBcard) pCurrCard, thisCard); 2227 FPT_queueSelectFail((PSCCBcard) pCurrCard, thisCard);
4597 ((PSCCBcard) pCurrCard)->currentSCCB = pSaveSCCB; 2228 ((PSCCBcard) pCurrCard)->currentSCCB = pSaveSCCB;
4598 } 2229 }
4599 } 2230 }
@@ -4602,9 +2233,9 @@ int SccbMgr_abort_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4602 } 2233 }
4603 else 2234 else
4604 { 2235 {
4605 currTar_Info = &sccbMgrTbl[thisCard][p_Sccb->TargID]; 2236 currTar_Info = &FPT_sccbMgrTbl[thisCard][p_Sccb->TargID];
4606 2237
4607 if(BL_Card[thisCard].discQ_Tbl[currTar_Info->LunDiscQ_Idx[p_Sccb->Lun]] 2238 if(FPT_BL_Card[thisCard].discQ_Tbl[currTar_Info->LunDiscQ_Idx[p_Sccb->Lun]]
4608 == p_Sccb) 2239 == p_Sccb)
4609 { 2240 {
4610 p_Sccb->SccbStatus = SCCB_ABORT; 2241 p_Sccb->SccbStatus = SCCB_ABORT;
@@ -4626,37 +2257,20 @@ int SccbMgr_abort_sccb(ULONG pCurrCard, PSCCB p_Sccb)
4626 * interrupt for this card and disable the IRQ Pin if so. 2257 * interrupt for this card and disable the IRQ Pin if so.
4627 * 2258 *
4628 *---------------------------------------------------------------------*/ 2259 *---------------------------------------------------------------------*/
4629#if (FW_TYPE==_UCB_MGR_) 2260static UCHAR SccbMgr_my_int(ULONG pCurrCard)
4630u08bits SccbMgr_my_int(CARD_HANDLE pCurrCard)
4631#else
4632#if defined(DOS)
4633UCHAR SccbMgr_my_int(USHORT pCurrCard)
4634#else
4635UCHAR SccbMgr_my_int(ULONG pCurrCard)
4636#endif
4637#endif
4638{ 2261{
4639#if defined(DOS)
4640 USHORT ioport;
4641#else
4642 ULONG ioport; 2262 ULONG ioport;
4643#endif
4644 2263
4645 ioport = ((PSCCBcard)pCurrCard)->ioPort; 2264 ioport = ((PSCCBcard)pCurrCard)->ioPort;
4646 2265
4647 if (RD_HARPOON(ioport+hp_int_status) & INT_ASSERTED) 2266 if (RD_HARPOON(ioport+hp_int_status) & INT_ASSERTED)
4648 { 2267 {
4649 2268 return(1);
4650#if defined(DOS)
4651 MDISABLE_INT(ioport);
4652#endif
4653
4654 return(TRUE);
4655 } 2269 }
4656 2270
4657 else 2271 else
4658 2272
4659 return(FALSE); 2273 return(0);
4660} 2274}
4661 2275
4662 2276
@@ -4670,37 +2284,19 @@ UCHAR SccbMgr_my_int(ULONG pCurrCard)
4670 * us. 2284 * us.
4671 * 2285 *
4672 *---------------------------------------------------------------------*/ 2286 *---------------------------------------------------------------------*/
4673#if (FW_TYPE==_UCB_MGR_) 2287static int SccbMgr_isr(ULONG pCurrCard)
4674s32bits SccbMgr_isr(CARD_HANDLE pCurrCard)
4675#else
4676#if defined(DOS)
4677int SccbMgr_isr(USHORT pCurrCard)
4678#else
4679int SccbMgr_isr(ULONG pCurrCard)
4680#endif
4681#endif
4682{ 2288{
4683 PSCCB currSCCB; 2289 PSCCB currSCCB;
4684 UCHAR thisCard,result,bm_status, bm_int_st; 2290 UCHAR thisCard,result,bm_status, bm_int_st;
4685 USHORT hp_int; 2291 USHORT hp_int;
4686 UCHAR i, target; 2292 UCHAR i, target;
4687#if defined(DOS)
4688 USHORT ioport;
4689#else
4690 ULONG ioport; 2293 ULONG ioport;
4691#endif
4692
4693 mOS_Lock((PSCCBcard)pCurrCard);
4694 2294
4695 thisCard = ((PSCCBcard)pCurrCard)->cardIndex; 2295 thisCard = ((PSCCBcard)pCurrCard)->cardIndex;
4696 ioport = ((PSCCBcard)pCurrCard)->ioPort; 2296 ioport = ((PSCCBcard)pCurrCard)->ioPort;
4697 2297
4698 MDISABLE_INT(ioport); 2298 MDISABLE_INT(ioport);
4699 2299
4700#if defined(BUGBUG)
4701 WR_HARPOON(ioport+hp_user_defined_D, RD_HARPOON(ioport+hp_int_status));
4702#endif
4703
4704 if ((bm_int_st=RD_HARPOON(ioport+hp_int_status)) & EXT_STATUS_ON) 2300 if ((bm_int_st=RD_HARPOON(ioport+hp_int_status)) & EXT_STATUS_ON)
4705 bm_status = RD_HARPOON(ioport+hp_ext_status) & (UCHAR)BAD_EXT_STATUS; 2301 bm_status = RD_HARPOON(ioport+hp_ext_status) & (UCHAR)BAD_EXT_STATUS;
4706 else 2302 else
@@ -4708,33 +2304,20 @@ int SccbMgr_isr(ULONG pCurrCard)
4708 2304
4709 WR_HARPOON(ioport+hp_int_mask, (INT_CMD_COMPL | SCSI_INTERRUPT)); 2305 WR_HARPOON(ioport+hp_int_mask, (INT_CMD_COMPL | SCSI_INTERRUPT));
4710 2306
4711 mOS_UnLock((PSCCBcard)pCurrCard); 2307 while ((hp_int = RDW_HARPOON((ioport+hp_intstat)) & FPT_default_intena) |
4712
4713 while ((hp_int = RDW_HARPOON((ioport+hp_intstat)) & default_intena) |
4714 bm_status) 2308 bm_status)
4715 { 2309 {
4716 2310
4717 currSCCB = ((PSCCBcard)pCurrCard)->currentSCCB; 2311 currSCCB = ((PSCCBcard)pCurrCard)->currentSCCB;
4718 2312
4719#if defined(BUGBUG)
4720 Debug_Load(thisCard,(UCHAR) 0XFF);
4721 Debug_Load(thisCard,bm_int_st);
4722
4723 Debug_Load(thisCard,hp_int_0);
4724 Debug_Load(thisCard,hp_int_1);
4725#endif
4726
4727
4728 if (hp_int & (FIFO | TIMEOUT | RESET | SCAM_SEL) || bm_status) { 2313 if (hp_int & (FIFO | TIMEOUT | RESET | SCAM_SEL) || bm_status) {
4729 result = SccbMgr_bad_isr(ioport,thisCard,((PSCCBcard)pCurrCard),hp_int); 2314 result = FPT_SccbMgr_bad_isr(ioport,thisCard,((PSCCBcard)pCurrCard),hp_int);
4730 WRW_HARPOON((ioport+hp_intstat), (FIFO | TIMEOUT | RESET | SCAM_SEL)); 2315 WRW_HARPOON((ioport+hp_intstat), (FIFO | TIMEOUT | RESET | SCAM_SEL));
4731 bm_status = 0; 2316 bm_status = 0;
4732 2317
4733 if (result) { 2318 if (result) {
4734 2319
4735 mOS_Lock((PSCCBcard)pCurrCard);
4736 MENABLE_INT(ioport); 2320 MENABLE_INT(ioport);
4737 mOS_UnLock((PSCCBcard)pCurrCard);
4738 return(result); 2321 return(result);
4739 } 2322 }
4740 } 2323 }
@@ -4753,7 +2336,7 @@ int SccbMgr_isr(ULONG pCurrCard)
4753 2336
4754 if (((PSCCBcard)pCurrCard)->globalFlags & F_HOST_XFER_ACT) 2337 if (((PSCCBcard)pCurrCard)->globalFlags & F_HOST_XFER_ACT)
4755 2338
4756 phaseChkFifo(ioport, thisCard); 2339 FPT_phaseChkFifo(ioport, thisCard);
4757 2340
4758/* WRW_HARPOON((ioport+hp_intstat), 2341/* WRW_HARPOON((ioport+hp_intstat),
4759 (BUS_FREE | ICMD_COMP | ITAR_DISC | XFER_CNT_0)); 2342 (BUS_FREE | ICMD_COMP | ITAR_DISC | XFER_CNT_0));
@@ -4761,7 +2344,7 @@ int SccbMgr_isr(ULONG pCurrCard)
4761 2344
4762 WRW_HARPOON((ioport+hp_intstat), CLR_ALL_INT_1); 2345 WRW_HARPOON((ioport+hp_intstat), CLR_ALL_INT_1);
4763 2346
4764 autoCmdCmplt(ioport,thisCard); 2347 FPT_autoCmdCmplt(ioport,thisCard);
4765 2348
4766 } 2349 }
4767 2350
@@ -4771,7 +2354,7 @@ int SccbMgr_isr(ULONG pCurrCard)
4771 2354
4772 if (((PSCCBcard)pCurrCard)->globalFlags & F_HOST_XFER_ACT) { 2355 if (((PSCCBcard)pCurrCard)->globalFlags & F_HOST_XFER_ACT) {
4773 2356
4774 phaseChkFifo(ioport, thisCard); 2357 FPT_phaseChkFifo(ioport, thisCard);
4775 2358
4776 } 2359 }
4777 2360
@@ -4784,7 +2367,7 @@ int SccbMgr_isr(ULONG pCurrCard)
4784 } 2367 }
4785 2368
4786 currSCCB->Sccb_scsistat = DISCONNECT_ST; 2369 currSCCB->Sccb_scsistat = DISCONNECT_ST;
4787 queueDisconnect(currSCCB,thisCard); 2370 FPT_queueDisconnect(currSCCB,thisCard);
4788 2371
4789 /* Wait for the BusFree before starting a new command. We 2372 /* Wait for the BusFree before starting a new command. We
4790 must also check for being reselected since the BusFree 2373 must also check for being reselected since the BusFree
@@ -4803,9 +2386,7 @@ int SccbMgr_isr(ULONG pCurrCard)
4803 */ 2386 */
4804 if (!(RDW_HARPOON((ioport+hp_intstat)) & (BUS_FREE | RSEL))) 2387 if (!(RDW_HARPOON((ioport+hp_intstat)) & (BUS_FREE | RSEL)))
4805 { 2388 {
4806 mOS_Lock((PSCCBcard)pCurrCard);
4807 MENABLE_INT(ioport); 2389 MENABLE_INT(ioport);
4808 mOS_UnLock((PSCCBcard)pCurrCard);
4809 return 0xFE; 2390 return 0xFE;
4810 } 2391 }
4811 2392
@@ -4825,7 +2406,7 @@ int SccbMgr_isr(ULONG pCurrCard)
4825 { 2406 {
4826 if (((PSCCBcard)pCurrCard)->globalFlags & F_HOST_XFER_ACT) 2407 if (((PSCCBcard)pCurrCard)->globalFlags & F_HOST_XFER_ACT)
4827 { 2408 {
4828 phaseChkFifo(ioport, thisCard); 2409 FPT_phaseChkFifo(ioport, thisCard);
4829 } 2410 }
4830 2411
4831 if (RD_HARPOON(ioport+hp_gp_reg_1) == SMSAVE_DATA_PTR) 2412 if (RD_HARPOON(ioport+hp_gp_reg_1) == SMSAVE_DATA_PTR)
@@ -4837,11 +2418,11 @@ int SccbMgr_isr(ULONG pCurrCard)
4837 2418
4838 WRW_HARPOON((ioport+hp_intstat), (BUS_FREE | ITAR_DISC)); 2419 WRW_HARPOON((ioport+hp_intstat), (BUS_FREE | ITAR_DISC));
4839 currSCCB->Sccb_scsistat = DISCONNECT_ST; 2420 currSCCB->Sccb_scsistat = DISCONNECT_ST;
4840 queueDisconnect(currSCCB,thisCard); 2421 FPT_queueDisconnect(currSCCB,thisCard);
4841 } 2422 }
4842 2423
4843 sres(ioport,thisCard,((PSCCBcard)pCurrCard)); 2424 FPT_sres(ioport,thisCard,((PSCCBcard)pCurrCard));
4844 phaseDecode(ioport,thisCard); 2425 FPT_phaseDecode(ioport,thisCard);
4845 2426
4846 } 2427 }
4847 2428
@@ -4850,7 +2431,7 @@ int SccbMgr_isr(ULONG pCurrCard)
4850 { 2431 {
4851 2432
4852 WRW_HARPOON((ioport+hp_intstat), (IDO_STRT | XFER_CNT_0)); 2433 WRW_HARPOON((ioport+hp_intstat), (IDO_STRT | XFER_CNT_0));
4853 phaseDecode(ioport,thisCard); 2434 FPT_phaseDecode(ioport,thisCard);
4854 2435
4855 } 2436 }
4856 2437
@@ -4860,7 +2441,7 @@ int SccbMgr_isr(ULONG pCurrCard)
4860 WRW_HARPOON((ioport+hp_intstat), (PHASE | IUNKWN | PROG_HLT)); 2441 WRW_HARPOON((ioport+hp_intstat), (PHASE | IUNKWN | PROG_HLT));
4861 if ((RD_HARPOON(ioport+hp_prgmcnt_0) & (UCHAR)0x3f)< (UCHAR)SELCHK) 2442 if ((RD_HARPOON(ioport+hp_prgmcnt_0) & (UCHAR)0x3f)< (UCHAR)SELCHK)
4862 { 2443 {
4863 phaseDecode(ioport,thisCard); 2444 FPT_phaseDecode(ioport,thisCard);
4864 } 2445 }
4865 else 2446 else
4866 { 2447 {
@@ -4885,7 +2466,7 @@ int SccbMgr_isr(ULONG pCurrCard)
4885 2466
4886 WRW_HARPOON((ioport+hp_intstat), XFER_CNT_0); 2467 WRW_HARPOON((ioport+hp_intstat), XFER_CNT_0);
4887 2468
4888 schkdd(ioport,thisCard); 2469 FPT_schkdd(ioport,thisCard);
4889 2470
4890 } 2471 }
4891 2472
@@ -4896,10 +2477,10 @@ int SccbMgr_isr(ULONG pCurrCard)
4896 2477
4897 if (((PSCCBcard)pCurrCard)->globalFlags & F_HOST_XFER_ACT) { 2478 if (((PSCCBcard)pCurrCard)->globalFlags & F_HOST_XFER_ACT) {
4898 2479
4899 hostDataXferAbort(ioport,thisCard,currSCCB); 2480 FPT_hostDataXferAbort(ioport,thisCard,currSCCB);
4900 } 2481 }
4901 2482
4902 phaseBusFree(ioport,thisCard); 2483 FPT_phaseBusFree(ioport,thisCard);
4903 } 2484 }
4904 2485
4905 2486
@@ -4919,12 +2500,12 @@ int SccbMgr_isr(ULONG pCurrCard)
4919 2500
4920 if (((PSCCBcard)pCurrCard)->currentSCCB == NULL) { 2501 if (((PSCCBcard)pCurrCard)->currentSCCB == NULL) {
4921 2502
4922 queueSearchSelect(((PSCCBcard)pCurrCard),thisCard); 2503 FPT_queueSearchSelect(((PSCCBcard)pCurrCard),thisCard);
4923 } 2504 }
4924 2505
4925 if (((PSCCBcard)pCurrCard)->currentSCCB != NULL) { 2506 if (((PSCCBcard)pCurrCard)->currentSCCB != NULL) {
4926 ((PSCCBcard)pCurrCard)->globalFlags &= ~F_NEW_SCCB_CMD; 2507 ((PSCCBcard)pCurrCard)->globalFlags &= ~F_NEW_SCCB_CMD;
4927 ssel(ioport,thisCard); 2508 FPT_ssel(ioport,thisCard);
4928 } 2509 }
4929 2510
4930 break; 2511 break;
@@ -4933,9 +2514,7 @@ int SccbMgr_isr(ULONG pCurrCard)
4933 2514
4934 } /*end while */ 2515 } /*end while */
4935 2516
4936 mOS_Lock((PSCCBcard)pCurrCard);
4937 MENABLE_INT(ioport); 2517 MENABLE_INT(ioport);
4938 mOS_UnLock((PSCCBcard)pCurrCard);
4939 2518
4940 return(0); 2519 return(0);
4941} 2520}
@@ -4950,18 +2529,12 @@ int SccbMgr_isr(ULONG pCurrCard)
4950 * processing time. 2529 * processing time.
4951 * 2530 *
4952 *---------------------------------------------------------------------*/ 2531 *---------------------------------------------------------------------*/
4953#if defined(DOS) 2532static UCHAR FPT_SccbMgr_bad_isr(ULONG p_port, UCHAR p_card,
4954UCHAR SccbMgr_bad_isr(USHORT p_port, UCHAR p_card, PSCCBcard pCurrCard, USHORT p_int) 2533 PSCCBcard pCurrCard, USHORT p_int)
4955#else
4956UCHAR SccbMgr_bad_isr(ULONG p_port, UCHAR p_card, PSCCBcard pCurrCard, USHORT p_int)
4957#endif
4958{ 2534{
4959#if defined(HARP_REVX) 2535 UCHAR temp, ScamFlg;
4960 ULONG timer; 2536 PSCCBMgr_tar_info currTar_Info;
4961#endif 2537 PNVRamInfo pCurrNvRam;
4962UCHAR temp, ScamFlg;
4963PSCCBMgr_tar_info currTar_Info;
4964PNVRamInfo pCurrNvRam;
4965 2538
4966 2539
4967 if (RD_HARPOON(p_port+hp_ext_status) & 2540 if (RD_HARPOON(p_port+hp_ext_status) &
@@ -4971,7 +2544,7 @@ PNVRamInfo pCurrNvRam;
4971 if (pCurrCard->globalFlags & F_HOST_XFER_ACT) 2544 if (pCurrCard->globalFlags & F_HOST_XFER_ACT)
4972 { 2545 {
4973 2546
4974 hostDataXferAbort(p_port,p_card, pCurrCard->currentSCCB); 2547 FPT_hostDataXferAbort(p_port,p_card, pCurrCard->currentSCCB);
4975 } 2548 }
4976 2549
4977 if (RD_HARPOON(p_port+hp_pci_stat_cfg) & REC_MASTER_ABORT) 2550 if (RD_HARPOON(p_port+hp_pci_stat_cfg) & REC_MASTER_ABORT)
@@ -4990,7 +2563,7 @@ PNVRamInfo pCurrNvRam;
4990 if (!pCurrCard->currentSCCB->HostStatus) 2563 if (!pCurrCard->currentSCCB->HostStatus)
4991 pCurrCard->currentSCCB->HostStatus = SCCB_BM_ERR; 2564 pCurrCard->currentSCCB->HostStatus = SCCB_BM_ERR;
4992 2565
4993 sxfrp(p_port,p_card); 2566 FPT_sxfrp(p_port,p_card);
4994 2567
4995 temp = (UCHAR)(RD_HARPOON(p_port+hp_ee_ctrl) & 2568 temp = (UCHAR)(RD_HARPOON(p_port+hp_ee_ctrl) &
4996 (EXT_ARB_ACK | SCSI_TERM_ENA_H)); 2569 (EXT_ARB_ACK | SCSI_TERM_ENA_H));
@@ -4999,7 +2572,7 @@ PNVRamInfo pCurrNvRam;
4999 2572
5000 if (!(RDW_HARPOON((p_port+hp_intstat)) & (BUS_FREE | RESET))) 2573 if (!(RDW_HARPOON((p_port+hp_intstat)) & (BUS_FREE | RESET)))
5001 { 2574 {
5002 phaseDecode(p_port,p_card); 2575 FPT_phaseDecode(p_port,p_card);
5003 } 2576 }
5004 } 2577 }
5005 } 2578 }
@@ -5014,13 +2587,13 @@ PNVRamInfo pCurrNvRam;
5014 2587
5015 if (pCurrCard->globalFlags & F_HOST_XFER_ACT) 2588 if (pCurrCard->globalFlags & F_HOST_XFER_ACT)
5016 2589
5017 hostDataXferAbort(p_port,p_card, pCurrCard->currentSCCB); 2590 FPT_hostDataXferAbort(p_port,p_card, pCurrCard->currentSCCB);
5018 } 2591 }
5019 2592
5020 2593
5021 DISABLE_AUTO(p_port); 2594 DISABLE_AUTO(p_port);
5022 2595
5023 sresb(p_port,p_card); 2596 FPT_sresb(p_port,p_card);
5024 2597
5025 while(RD_HARPOON(p_port+hp_scsictrl_0) & SCSI_RST) {} 2598 while(RD_HARPOON(p_port+hp_scsictrl_0) & SCSI_RST) {}
5026 2599
@@ -5029,12 +2602,12 @@ PNVRamInfo pCurrNvRam;
5029 ScamFlg = pCurrNvRam->niScamConf; 2602 ScamFlg = pCurrNvRam->niScamConf;
5030 } 2603 }
5031 else{ 2604 else{
5032 ScamFlg = (UCHAR) utilEERead(p_port, SCAM_CONFIG/2); 2605 ScamFlg = (UCHAR) FPT_utilEERead(p_port, SCAM_CONFIG/2);
5033 } 2606 }
5034 2607
5035 XbowInit(p_port, ScamFlg); 2608 FPT_XbowInit(p_port, ScamFlg);
5036 2609
5037 scini(p_card, pCurrCard->ourId, 0); 2610 FPT_scini(p_card, pCurrCard->ourId, 0);
5038 2611
5039 return(0xFF); 2612 return(0xFF);
5040 } 2613 }
@@ -5044,34 +2617,8 @@ PNVRamInfo pCurrNvRam;
5044 2617
5045 WRW_HARPOON((p_port+hp_intstat), FIFO); 2618 WRW_HARPOON((p_port+hp_intstat), FIFO);
5046 2619
5047#if defined(HARP_REVX)
5048
5049 for (timer=0x00FFFFFFL; timer != 0x00000000L; timer--) {
5050
5051 if (RD_HARPOON(p_port+hp_xferstat) & FIFO_EMPTY)
5052 break;
5053
5054 if (RDW_HARPOON((p_port+hp_intstat)) & BUS_FREE)
5055 break;
5056 }
5057
5058
5059 if ( (RD_HARPOON(p_port+hp_xferstat) & FIFO_EMPTY) &&
5060 (RD_HARPOON(p_port+hp_fiforead) !=
5061 RD_HARPOON(p_port+hp_fifowrite)) &&
5062 (RD_HARPOON(p_port+hp_xfercnt_0))
5063 )
5064
5065 WR_HARPOON((p_port+hp_xferstat), 0x01);
5066
5067/* else
5068 */
5069/* sxfrp(p_port,p_card);
5070 */
5071#else
5072 if (pCurrCard->currentSCCB != NULL) 2620 if (pCurrCard->currentSCCB != NULL)
5073 sxfrp(p_port,p_card); 2621 FPT_sxfrp(p_port,p_card);
5074#endif
5075 } 2622 }
5076 2623
5077 else if (p_int & TIMEOUT) 2624 else if (p_int & TIMEOUT)
@@ -5085,12 +2632,12 @@ PNVRamInfo pCurrNvRam;
5085 pCurrCard->currentSCCB->HostStatus = SCCB_SELECTION_TIMEOUT; 2632 pCurrCard->currentSCCB->HostStatus = SCCB_SELECTION_TIMEOUT;
5086 2633
5087 2634
5088 currTar_Info = &sccbMgrTbl[p_card][pCurrCard->currentSCCB->TargID]; 2635 currTar_Info = &FPT_sccbMgrTbl[p_card][pCurrCard->currentSCCB->TargID];
5089 if((pCurrCard->globalFlags & F_CONLUN_IO) && 2636 if((pCurrCard->globalFlags & F_CONLUN_IO) &&
5090 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)) 2637 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))
5091 currTar_Info->TarLUNBusy[pCurrCard->currentSCCB->Lun] = FALSE; 2638 currTar_Info->TarLUNBusy[pCurrCard->currentSCCB->Lun] = 0;
5092 else 2639 else
5093 currTar_Info->TarLUNBusy[0] = FALSE; 2640 currTar_Info->TarLUNBusy[0] = 0;
5094 2641
5095 2642
5096 if (currTar_Info->TarEEValue & EE_SYNC_MASK) 2643 if (currTar_Info->TarEEValue & EE_SYNC_MASK)
@@ -5104,26 +2651,23 @@ PNVRamInfo pCurrNvRam;
5104 currTar_Info->TarStatus &= ~TAR_WIDE_MASK; 2651 currTar_Info->TarStatus &= ~TAR_WIDE_MASK;
5105 } 2652 }
5106 2653
5107 sssyncv(p_port, pCurrCard->currentSCCB->TargID, NARROW_SCSI,currTar_Info); 2654 FPT_sssyncv(p_port, pCurrCard->currentSCCB->TargID, NARROW_SCSI,currTar_Info);
5108 2655
5109 queueCmdComplete(pCurrCard, pCurrCard->currentSCCB, p_card); 2656 FPT_queueCmdComplete(pCurrCard, pCurrCard->currentSCCB, p_card);
5110 2657
5111 } 2658 }
5112 2659
5113#if defined(SCAM_LEV_2)
5114
5115 else if (p_int & SCAM_SEL) 2660 else if (p_int & SCAM_SEL)
5116 { 2661 {
5117 2662
5118 scarb(p_port,LEVEL2_TAR); 2663 FPT_scarb(p_port,LEVEL2_TAR);
5119 scsel(p_port); 2664 FPT_scsel(p_port);
5120 scasid(p_card, p_port); 2665 FPT_scasid(p_card, p_port);
5121 2666
5122 scbusf(p_port); 2667 FPT_scbusf(p_port);
5123 2668
5124 WRW_HARPOON((p_port+hp_intstat), SCAM_SEL); 2669 WRW_HARPOON((p_port+hp_intstat), SCAM_SEL);
5125 } 2670 }
5126#endif
5127 2671
5128 return(0x00); 2672 return(0x00);
5129} 2673}
@@ -5131,126 +2675,25 @@ PNVRamInfo pCurrNvRam;
5131 2675
5132/*--------------------------------------------------------------------- 2676/*---------------------------------------------------------------------
5133 * 2677 *
5134 * Function: SccbMgr_scsi_reset
5135 *
5136 * Description: A SCSI bus reset will be generated and all outstanding
5137 * Sccbs will be returned via the callback.
5138 *
5139 *---------------------------------------------------------------------*/
5140#if (FW_TYPE==_UCB_MGR_)
5141void SccbMgr_scsi_reset(CARD_HANDLE pCurrCard)
5142#else
5143#if defined(DOS)
5144void SccbMgr_scsi_reset(USHORT pCurrCard)
5145#else
5146void SccbMgr_scsi_reset(ULONG pCurrCard)
5147#endif
5148#endif
5149{
5150 UCHAR thisCard;
5151
5152 thisCard = ((PSCCBcard)pCurrCard)->cardIndex;
5153
5154 mOS_Lock((PSCCBcard)pCurrCard);
5155
5156 if (((PSCCBcard) pCurrCard)->globalFlags & F_GREEN_PC)
5157 {
5158 WR_HARPOON(((PSCCBcard) pCurrCard)->ioPort+hp_clkctrl_0, CLKCTRL_DEFAULT);
5159 WR_HARPOON(((PSCCBcard) pCurrCard)->ioPort+hp_sys_ctrl, 0x00);
5160 }
5161
5162 sresb(((PSCCBcard)pCurrCard)->ioPort,thisCard);
5163
5164 if (RD_HARPOON(((PSCCBcard)pCurrCard)->ioPort+hp_ext_status) & BM_CMD_BUSY)
5165 {
5166 WR_HARPOON(((PSCCBcard) pCurrCard)->ioPort+hp_page_ctrl,
5167 (RD_HARPOON(((PSCCBcard) pCurrCard)->ioPort+hp_page_ctrl)
5168 & ~SCATTER_EN));
5169
5170 WR_HARPOON(((PSCCBcard) pCurrCard)->ioPort+hp_sg_addr,0x00);
5171
5172 ((PSCCBcard) pCurrCard)->globalFlags &= ~F_HOST_XFER_ACT;
5173 busMstrTimeOut(((PSCCBcard) pCurrCard)->ioPort);
5174
5175 WR_HARPOON(((PSCCBcard) pCurrCard)->ioPort+hp_int_mask,
5176 (INT_CMD_COMPL | SCSI_INTERRUPT));
5177 }
5178
5179/*
5180 if (utilEERead(((PSCCBcard)pCurrCard)->ioPort, (SCAM_CONFIG/2))
5181 & SCAM_ENABLED)
5182*/
5183 scini(thisCard, ((PSCCBcard)pCurrCard)->ourId, 0);
5184
5185#if (FW_TYPE==_UCB_MGR_)
5186 ((PSCCBcard)pCurrCard)->cardInfo->ai_AEN_routine(0x01,pCurrCard,0,0,0,0);
5187#endif
5188
5189 mOS_UnLock((PSCCBcard)pCurrCard);
5190}
5191
5192
5193/*---------------------------------------------------------------------
5194 *
5195 * Function: SccbMgr_timer_expired
5196 *
5197 * Description: This function allow me to kill my own job that has not
5198 * yet completed, and has cause a timeout to occur. This
5199 * timeout has caused the upper level driver to call this
5200 * function.
5201 *
5202 *---------------------------------------------------------------------*/
5203
5204#if (FW_TYPE==_UCB_MGR_)
5205void SccbMgr_timer_expired(CARD_HANDLE pCurrCard)
5206#else
5207#if defined(DOS)
5208void SccbMgr_timer_expired(USHORT pCurrCard)
5209#else
5210void SccbMgr_timer_expired(ULONG pCurrCard)
5211#endif
5212#endif
5213{
5214}
5215
5216#if defined(DOS)
5217/*---------------------------------------------------------------------
5218 *
5219 * Function: SccbMgr_status
5220 *
5221 * Description: This function returns the number of outstanding SCCB's.
5222 * This is specific to the DOS enviroment, which needs this
5223 * to help them keep protected and real mode commands staight.
5224 *
5225 *---------------------------------------------------------------------*/
5226
5227USHORT SccbMgr_status(USHORT pCurrCard)
5228{
5229 return(BL_Card[pCurrCard].cmdCounter);
5230}
5231#endif
5232
5233/*---------------------------------------------------------------------
5234 *
5235 * Function: SccbMgrTableInit 2678 * Function: SccbMgrTableInit
5236 * 2679 *
5237 * Description: Initialize all Sccb manager data structures. 2680 * Description: Initialize all Sccb manager data structures.
5238 * 2681 *
5239 *---------------------------------------------------------------------*/ 2682 *---------------------------------------------------------------------*/
5240 2683
5241void SccbMgrTableInitAll() 2684static void FPT_SccbMgrTableInitAll()
5242{ 2685{
5243 UCHAR thisCard; 2686 UCHAR thisCard;
5244 2687
5245 for (thisCard = 0; thisCard < MAX_CARDS; thisCard++) 2688 for (thisCard = 0; thisCard < MAX_CARDS; thisCard++)
5246 { 2689 {
5247 SccbMgrTableInitCard(&BL_Card[thisCard],thisCard); 2690 FPT_SccbMgrTableInitCard(&FPT_BL_Card[thisCard],thisCard);
5248 2691
5249 BL_Card[thisCard].ioPort = 0x00; 2692 FPT_BL_Card[thisCard].ioPort = 0x00;
5250 BL_Card[thisCard].cardInfo = NULL; 2693 FPT_BL_Card[thisCard].cardInfo = NULL;
5251 BL_Card[thisCard].cardIndex = 0xFF; 2694 FPT_BL_Card[thisCard].cardIndex = 0xFF;
5252 BL_Card[thisCard].ourId = 0x00; 2695 FPT_BL_Card[thisCard].ourId = 0x00;
5253 BL_Card[thisCard].pNvRamInfo = NULL; 2696 FPT_BL_Card[thisCard].pNvRamInfo = NULL;
5254 } 2697 }
5255} 2698}
5256 2699
@@ -5263,20 +2706,20 @@ void SccbMgrTableInitAll()
5263 * 2706 *
5264 *---------------------------------------------------------------------*/ 2707 *---------------------------------------------------------------------*/
5265 2708
5266void SccbMgrTableInitCard(PSCCBcard pCurrCard, UCHAR p_card) 2709static void FPT_SccbMgrTableInitCard(PSCCBcard pCurrCard, UCHAR p_card)
5267{ 2710{
5268 UCHAR scsiID, qtag; 2711 UCHAR scsiID, qtag;
5269 2712
5270 for (qtag = 0; qtag < QUEUE_DEPTH; qtag++) 2713 for (qtag = 0; qtag < QUEUE_DEPTH; qtag++)
5271 { 2714 {
5272 BL_Card[p_card].discQ_Tbl[qtag] = NULL; 2715 FPT_BL_Card[p_card].discQ_Tbl[qtag] = NULL;
5273 } 2716 }
5274 2717
5275 for (scsiID = 0; scsiID < MAX_SCSI_TAR; scsiID++) 2718 for (scsiID = 0; scsiID < MAX_SCSI_TAR; scsiID++)
5276 { 2719 {
5277 sccbMgrTbl[p_card][scsiID].TarStatus = 0; 2720 FPT_sccbMgrTbl[p_card][scsiID].TarStatus = 0;
5278 sccbMgrTbl[p_card][scsiID].TarEEValue = 0; 2721 FPT_sccbMgrTbl[p_card][scsiID].TarEEValue = 0;
5279 SccbMgrTableInitTarget(p_card, scsiID); 2722 FPT_SccbMgrTableInitTarget(p_card, scsiID);
5280 } 2723 }
5281 2724
5282 pCurrCard->scanIndex = 0x00; 2725 pCurrCard->scanIndex = 0x00;
@@ -5298,13 +2741,13 @@ void SccbMgrTableInitCard(PSCCBcard pCurrCard, UCHAR p_card)
5298 * 2741 *
5299 *---------------------------------------------------------------------*/ 2742 *---------------------------------------------------------------------*/
5300 2743
5301void SccbMgrTableInitTarget(UCHAR p_card, UCHAR target) 2744static void FPT_SccbMgrTableInitTarget(UCHAR p_card, UCHAR target)
5302{ 2745{
5303 2746
5304 UCHAR lun, qtag; 2747 UCHAR lun, qtag;
5305 PSCCBMgr_tar_info currTar_Info; 2748 PSCCBMgr_tar_info currTar_Info;
5306 2749
5307 currTar_Info = &sccbMgrTbl[p_card][target]; 2750 currTar_Info = &FPT_sccbMgrTbl[p_card][target];
5308 2751
5309 currTar_Info->TarSelQ_Cnt = 0; 2752 currTar_Info->TarSelQ_Cnt = 0;
5310 currTar_Info->TarSyncCtrl = 0; 2753 currTar_Info->TarSyncCtrl = 0;
@@ -5312,160 +2755,28 @@ void SccbMgrTableInitTarget(UCHAR p_card, UCHAR target)
5312 currTar_Info->TarSelQ_Head = NULL; 2755 currTar_Info->TarSelQ_Head = NULL;
5313 currTar_Info->TarSelQ_Tail = NULL; 2756 currTar_Info->TarSelQ_Tail = NULL;
5314 currTar_Info->TarTagQ_Cnt = 0; 2757 currTar_Info->TarTagQ_Cnt = 0;
5315 currTar_Info->TarLUN_CA = FALSE; 2758 currTar_Info->TarLUN_CA = 0;
5316 2759
5317 2760
5318 for (lun = 0; lun < MAX_LUN; lun++) 2761 for (lun = 0; lun < MAX_LUN; lun++)
5319 { 2762 {
5320 currTar_Info->TarLUNBusy[lun] = FALSE; 2763 currTar_Info->TarLUNBusy[lun] = 0;
5321 currTar_Info->LunDiscQ_Idx[lun] = 0; 2764 currTar_Info->LunDiscQ_Idx[lun] = 0;
5322 } 2765 }
5323 2766
5324 for (qtag = 0; qtag < QUEUE_DEPTH; qtag++) 2767 for (qtag = 0; qtag < QUEUE_DEPTH; qtag++)
5325 { 2768 {
5326 if(BL_Card[p_card].discQ_Tbl[qtag] != NULL) 2769 if(FPT_BL_Card[p_card].discQ_Tbl[qtag] != NULL)
5327 { 2770 {
5328 if(BL_Card[p_card].discQ_Tbl[qtag]->TargID == target) 2771 if(FPT_BL_Card[p_card].discQ_Tbl[qtag]->TargID == target)
5329 { 2772 {
5330 BL_Card[p_card].discQ_Tbl[qtag] = NULL; 2773 FPT_BL_Card[p_card].discQ_Tbl[qtag] = NULL;
5331 BL_Card[p_card].discQCount--; 2774 FPT_BL_Card[p_card].discQCount--;
5332 } 2775 }
5333 } 2776 }
5334 } 2777 }
5335} 2778}
5336 2779
5337#if defined(BUGBUG)
5338
5339/*****************************************************************
5340 * Save the current byte in the debug array
5341 *****************************************************************/
5342
5343
5344void Debug_Load(UCHAR p_card, UCHAR p_bug_data)
5345{
5346 debug_int[p_card][debug_index[p_card]] = p_bug_data;
5347 debug_index[p_card]++;
5348
5349 if (debug_index[p_card] == debug_size)
5350
5351 debug_index[p_card] = 0;
5352}
5353
5354#endif
5355#ident "$Id: sccb_dat.c 1.10 1997/02/22 03:16:02 awin Exp $"
5356/*----------------------------------------------------------------------
5357 *
5358 *
5359 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
5360 *
5361 * This file is available under both the GNU General Public License
5362 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
5363 *
5364 * $Workfile: sccb_dat.c $
5365 *
5366 * Description: Functions relating to handling of the SCCB interface
5367 * between the device driver and the HARPOON.
5368 *
5369 * $Date: 1997/02/22 03:16:02 $
5370 *
5371 * $Revision: 1.10 $
5372 *
5373 *----------------------------------------------------------------------*/
5374
5375/*#include <globals.h>*/
5376
5377#if (FW_TYPE==_UCB_MGR_)
5378 /*#include <budi.h>*/
5379#endif
5380
5381/*#include <sccbmgr.h>*/
5382/*#include <blx30.h>*/
5383/*#include <target.h>*/
5384/*#include <harpoon.h>*/
5385
5386/*
5387** IMPORTANT NOTE!!!
5388**
5389** You MUST preassign all data to a valid value or zero. This is
5390** required due to the MS compiler bug under OS/2 and Solaris Real-Mode
5391** driver environment.
5392*/
5393
5394
5395SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR] = { { { 0 } } };
5396SCCBCARD BL_Card[MAX_CARDS] = { { 0 } };
5397SCCBSCAM_INFO scamInfo[MAX_SCSI_TAR] = { { { 0 } } };
5398NVRAMINFO nvRamInfo[MAX_MB_CARDS] = { { 0 } };
5399
5400
5401#if defined(OS2)
5402void (far *s_PhaseTbl[8]) (ULONG, UCHAR) = { 0 };
5403UCHAR temp_id_string[ID_STRING_LENGTH] = { 0 };
5404#elif defined(SOLARIS_REAL_MODE) || defined(__STDC__)
5405void (*s_PhaseTbl[8]) (ULONG, UCHAR) = { 0 };
5406#else
5407void (*s_PhaseTbl[8]) ();
5408#endif
5409
5410#if defined(DOS)
5411UCHAR first_time = 0;
5412#endif
5413
5414UCHAR mbCards = 0;
5415UCHAR scamHAString[] = {0x63, 0x07, 'B', 'U', 'S', 'L', 'O', 'G', 'I', 'C', \
5416 ' ', 'B', 'T', '-', '9', '3', '0', \
5417 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, \
5418 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20};
5419
5420USHORT default_intena = 0;
5421
5422#if defined(BUGBUG)
5423UCHAR debug_int[MAX_CARDS][debug_size] = { 0 };
5424UCHAR debug_index[MAX_CARDS] = { 0 };
5425UCHAR reserved_1[3] = { 0 };
5426#endif
5427#ident "$Id: scsi.c 1.23 1997/07/09 21:42:54 mohan Exp $"
5428/*----------------------------------------------------------------------
5429 *
5430 *
5431 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
5432 *
5433 * This file is available under both the GNU General Public License
5434 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
5435 *
5436 * $Workfile: scsi.c $
5437 *
5438 * Description: Functions for handling SCSI bus functions such as
5439 * selection/reselection, sync negotiation, message-in
5440 * decoding.
5441 *
5442 * $Date: 1997/07/09 21:42:54 $
5443 *
5444 * $Revision: 1.23 $
5445 *
5446 *----------------------------------------------------------------------*/
5447
5448/*#include <globals.h>*/
5449
5450#if (FW_TYPE==_UCB_MGR_)
5451 /*#include <budi.h>*/
5452#endif
5453
5454/*#include <sccbmgr.h>*/
5455/*#include <blx30.h>*/
5456/*#include <target.h>*/
5457/*#include <scsi2.h>*/
5458/*#include <eeprom.h>*/
5459/*#include <harpoon.h>*/
5460
5461
5462/*
5463extern SCCBCARD BL_Card[MAX_CARDS];
5464extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
5465#if defined(BUGBUG)
5466void Debug_Load(UCHAR p_card, UCHAR p_bug_data);
5467#endif
5468*/
5469 2780
5470/*--------------------------------------------------------------------- 2781/*---------------------------------------------------------------------
5471 * 2782 *
@@ -5476,11 +2787,7 @@ void Debug_Load(UCHAR p_card, UCHAR p_bug_data);
5476 * 2787 *
5477 *---------------------------------------------------------------------*/ 2788 *---------------------------------------------------------------------*/
5478 2789
5479#if defined(DOS) 2790static UCHAR FPT_sfm(ULONG port, PSCCB pCurrSCCB)
5480UCHAR sfm(USHORT port, PSCCB pCurrSCCB)
5481#else
5482UCHAR sfm(ULONG port, PSCCB pCurrSCCB)
5483#endif
5484{ 2791{
5485 UCHAR message; 2792 UCHAR message;
5486 USHORT TimeOutLoop; 2793 USHORT TimeOutLoop;
@@ -5547,42 +2854,27 @@ UCHAR sfm(ULONG port, PSCCB pCurrSCCB)
5547 2854
5548/*--------------------------------------------------------------------- 2855/*---------------------------------------------------------------------
5549 * 2856 *
5550 * Function: ssel 2857 * Function: FPT_ssel
5551 * 2858 *
5552 * Description: Load up automation and select target device. 2859 * Description: Load up automation and select target device.
5553 * 2860 *
5554 *---------------------------------------------------------------------*/ 2861 *---------------------------------------------------------------------*/
5555 2862
5556#if defined(DOS) 2863static void FPT_ssel(ULONG port, UCHAR p_card)
5557void ssel(USHORT port, UCHAR p_card)
5558#else
5559void ssel(ULONG port, UCHAR p_card)
5560#endif
5561{ 2864{
5562 2865
5563#if defined(DOS)
5564 UCHAR auto_loaded, i, target, *theCCB; 2866 UCHAR auto_loaded, i, target, *theCCB;
5565#elif defined(OS2)
5566 UCHAR auto_loaded, i, target;
5567 UCHAR far *theCCB;
5568#else
5569 UCHAR auto_loaded, i, target, *theCCB;
5570#endif
5571 2867
5572#if defined(DOS)
5573 USHORT cdb_reg;
5574#else
5575 ULONG cdb_reg; 2868 ULONG cdb_reg;
5576#endif
5577 PSCCBcard CurrCard; 2869 PSCCBcard CurrCard;
5578 PSCCB currSCCB; 2870 PSCCB currSCCB;
5579 PSCCBMgr_tar_info currTar_Info; 2871 PSCCBMgr_tar_info currTar_Info;
5580 UCHAR lastTag, lun; 2872 UCHAR lastTag, lun;
5581 2873
5582 CurrCard = &BL_Card[p_card]; 2874 CurrCard = &FPT_BL_Card[p_card];
5583 currSCCB = CurrCard->currentSCCB; 2875 currSCCB = CurrCard->currentSCCB;
5584 target = currSCCB->TargID; 2876 target = currSCCB->TargID;
5585 currTar_Info = &sccbMgrTbl[p_card][target]; 2877 currTar_Info = &FPT_sccbMgrTbl[p_card][target];
5586 lastTag = CurrCard->tagQ_Lst; 2878 lastTag = CurrCard->tagQ_Lst;
5587 2879
5588 ARAM_ACCESS(port); 2880 ARAM_ACCESS(port);
@@ -5599,60 +2891,53 @@ void ssel(ULONG port, UCHAR p_card)
5599 lun = 0; 2891 lun = 0;
5600 2892
5601 2893
5602#if defined(DOS)
5603 currTar_Info->TarLUNBusy[lun] = TRUE;
5604
5605#else
5606
5607 if (CurrCard->globalFlags & F_TAG_STARTED) 2894 if (CurrCard->globalFlags & F_TAG_STARTED)
5608 { 2895 {
5609 if (!(currSCCB->ControlByte & F_USE_CMD_Q)) 2896 if (!(currSCCB->ControlByte & F_USE_CMD_Q))
5610 { 2897 {
5611 if ((currTar_Info->TarLUN_CA == FALSE) 2898 if ((currTar_Info->TarLUN_CA == 0)
5612 && ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) 2899 && ((currTar_Info->TarStatus & TAR_TAG_Q_MASK)
5613 == TAG_Q_TRYING)) 2900 == TAG_Q_TRYING))
5614 { 2901 {
5615 2902
5616 if (currTar_Info->TarTagQ_Cnt !=0) 2903 if (currTar_Info->TarTagQ_Cnt !=0)
5617 { 2904 {
5618 currTar_Info->TarLUNBusy[lun] = TRUE; 2905 currTar_Info->TarLUNBusy[lun] = 1;
5619 queueSelectFail(CurrCard,p_card); 2906 FPT_queueSelectFail(CurrCard,p_card);
5620 SGRAM_ACCESS(port); 2907 SGRAM_ACCESS(port);
5621 return; 2908 return;
5622 } 2909 }
5623 2910
5624 else { 2911 else {
5625 currTar_Info->TarLUNBusy[lun] = TRUE; 2912 currTar_Info->TarLUNBusy[lun] = 1;
5626 } 2913 }
5627 2914
5628 } /*End non-tagged */ 2915 } /*End non-tagged */
5629 2916
5630 else { 2917 else {
5631 currTar_Info->TarLUNBusy[lun] = TRUE; 2918 currTar_Info->TarLUNBusy[lun] = 1;
5632 } 2919 }
5633 2920
5634 } /*!Use cmd Q Tagged */ 2921 } /*!Use cmd Q Tagged */
5635 2922
5636 else { 2923 else {
5637 if (currTar_Info->TarLUN_CA == TRUE) 2924 if (currTar_Info->TarLUN_CA == 1)
5638 { 2925 {
5639 queueSelectFail(CurrCard,p_card); 2926 FPT_queueSelectFail(CurrCard,p_card);
5640 SGRAM_ACCESS(port); 2927 SGRAM_ACCESS(port);
5641 return; 2928 return;
5642 } 2929 }
5643 2930
5644 currTar_Info->TarLUNBusy[lun] = TRUE; 2931 currTar_Info->TarLUNBusy[lun] = 1;
5645 2932
5646 } /*else use cmd Q tagged */ 2933 } /*else use cmd Q tagged */
5647 2934
5648 } /*if glob tagged started */ 2935 } /*if glob tagged started */
5649 2936
5650 else { 2937 else {
5651 currTar_Info->TarLUNBusy[lun] = TRUE; 2938 currTar_Info->TarLUNBusy[lun] = 1;
5652 } 2939 }
5653 2940
5654#endif /* DOS */
5655
5656 2941
5657 2942
5658 if((((CurrCard->globalFlags & F_CONLUN_IO) && 2943 if((((CurrCard->globalFlags & F_CONLUN_IO) &&
@@ -5661,8 +2946,8 @@ void ssel(ULONG port, UCHAR p_card)
5661 { 2946 {
5662 if(CurrCard->discQCount >= QUEUE_DEPTH) 2947 if(CurrCard->discQCount >= QUEUE_DEPTH)
5663 { 2948 {
5664 currTar_Info->TarLUNBusy[lun] = TRUE; 2949 currTar_Info->TarLUNBusy[lun] = 1;
5665 queueSelectFail(CurrCard,p_card); 2950 FPT_queueSelectFail(CurrCard,p_card);
5666 SGRAM_ACCESS(port); 2951 SGRAM_ACCESS(port);
5667 return; 2952 return;
5668 } 2953 }
@@ -5680,8 +2965,8 @@ void ssel(ULONG port, UCHAR p_card)
5680 } 2965 }
5681 if(i == QUEUE_DEPTH) 2966 if(i == QUEUE_DEPTH)
5682 { 2967 {
5683 currTar_Info->TarLUNBusy[lun] = TRUE; 2968 currTar_Info->TarLUNBusy[lun] = 1;
5684 queueSelectFail(CurrCard,p_card); 2969 FPT_queueSelectFail(CurrCard,p_card);
5685 SGRAM_ACCESS(port); 2970 SGRAM_ACCESS(port);
5686 return; 2971 return;
5687 } 2972 }
@@ -5689,7 +2974,7 @@ void ssel(ULONG port, UCHAR p_card)
5689 2974
5690 2975
5691 2976
5692 auto_loaded = FALSE; 2977 auto_loaded = 0;
5693 2978
5694 WR_HARPOON(port+hp_select_id, target); 2979 WR_HARPOON(port+hp_select_id, target);
5695 WR_HARPOON(port+hp_gp_reg_3, target); /* Use by new automation logic */ 2980 WR_HARPOON(port+hp_gp_reg_3, target); /* Use by new automation logic */
@@ -5703,7 +2988,7 @@ void ssel(ULONG port, UCHAR p_card)
5703 currSCCB->Sccb_scsimsg = SMDEV_RESET; 2988 currSCCB->Sccb_scsimsg = SMDEV_RESET;
5704 2989
5705 WR_HARPOON(port+hp_autostart_3, (SELECT+SELCHK_STRT)); 2990 WR_HARPOON(port+hp_autostart_3, (SELECT+SELCHK_STRT));
5706 auto_loaded = TRUE; 2991 auto_loaded = 1;
5707 currSCCB->Sccb_scsistat = SELECT_BDR_ST; 2992 currSCCB->Sccb_scsistat = SELECT_BDR_ST;
5708 2993
5709 if (currTar_Info->TarEEValue & EE_SYNC_MASK) 2994 if (currTar_Info->TarEEValue & EE_SYNC_MASK)
@@ -5712,16 +2997,13 @@ void ssel(ULONG port, UCHAR p_card)
5712 currTar_Info->TarStatus &= ~TAR_SYNC_MASK; 2997 currTar_Info->TarStatus &= ~TAR_SYNC_MASK;
5713 } 2998 }
5714 2999
5715#if defined(WIDE_SCSI)
5716
5717 if (currTar_Info->TarEEValue & EE_WIDE_SCSI) 3000 if (currTar_Info->TarEEValue & EE_WIDE_SCSI)
5718 { 3001 {
5719 currTar_Info->TarStatus &= ~TAR_WIDE_MASK; 3002 currTar_Info->TarStatus &= ~TAR_WIDE_MASK;
5720 } 3003 }
5721#endif
5722 3004
5723 sssyncv(port, target, NARROW_SCSI,currTar_Info); 3005 FPT_sssyncv(port, target, NARROW_SCSI,currTar_Info);
5724 SccbMgrTableInitTarget(p_card, target); 3006 FPT_SccbMgrTableInitTarget(p_card, target);
5725 3007
5726 } 3008 }
5727 3009
@@ -5740,24 +3022,18 @@ void ssel(ULONG port, UCHAR p_card)
5740 WRW_HARPOON((port+SYNC_MSGS+4), (BRH_OP+ALWAYS+NP )); 3022 WRW_HARPOON((port+SYNC_MSGS+4), (BRH_OP+ALWAYS+NP ));
5741 3023
5742 WR_HARPOON(port+hp_autostart_3, (SELECT+SELCHK_STRT)); 3024 WR_HARPOON(port+hp_autostart_3, (SELECT+SELCHK_STRT));
5743 auto_loaded = TRUE; 3025 auto_loaded = 1;
5744 3026
5745 } 3027 }
5746 3028
5747#if defined(WIDE_SCSI)
5748
5749
5750 else if (!(currTar_Info->TarStatus & WIDE_NEGOCIATED)) { 3029 else if (!(currTar_Info->TarStatus & WIDE_NEGOCIATED)) {
5751 auto_loaded = siwidn(port,p_card); 3030 auto_loaded = FPT_siwidn(port,p_card);
5752 currSCCB->Sccb_scsistat = SELECT_WN_ST; 3031 currSCCB->Sccb_scsistat = SELECT_WN_ST;
5753 } 3032 }
5754 3033
5755#endif
5756
5757
5758 else if (!((currTar_Info->TarStatus & TAR_SYNC_MASK) 3034 else if (!((currTar_Info->TarStatus & TAR_SYNC_MASK)
5759 == SYNC_SUPPORTED)) { 3035 == SYNC_SUPPORTED)) {
5760 auto_loaded = sisyncn(port,p_card, FALSE); 3036 auto_loaded = FPT_sisyncn(port,p_card, 0);
5761 currSCCB->Sccb_scsistat = SELECT_SN_ST; 3037 currSCCB->Sccb_scsistat = SELECT_SN_ST;
5762 } 3038 }
5763 3039
@@ -5765,7 +3041,6 @@ void ssel(ULONG port, UCHAR p_card)
5765 if (!auto_loaded) 3041 if (!auto_loaded)
5766 { 3042 {
5767 3043
5768#if !defined(DOS)
5769 if (currSCCB->ControlByte & F_USE_CMD_Q) 3044 if (currSCCB->ControlByte & F_USE_CMD_Q)
5770 { 3045 {
5771 3046
@@ -5789,7 +3064,7 @@ void ssel(ULONG port, UCHAR p_card)
5789 the wheels fall off. */ 3064 the wheels fall off. */
5790 currSCCB->Sccb_scsistat = SELECT_ST; 3065 currSCCB->Sccb_scsistat = SELECT_ST;
5791 3066
5792 currTar_Info->TarLUNBusy[lun] = TRUE; 3067 currTar_Info->TarLUNBusy[lun] = 1;
5793 } 3068 }
5794 3069
5795 else 3070 else
@@ -5818,8 +3093,8 @@ void ssel(ULONG port, UCHAR p_card)
5818 3093
5819 if ( i == QUEUE_DEPTH ) 3094 if ( i == QUEUE_DEPTH )
5820 { 3095 {
5821 currTar_Info->TarLUNBusy[lun] = TRUE; 3096 currTar_Info->TarLUNBusy[lun] = 1;
5822 queueSelectFail(CurrCard,p_card); 3097 FPT_queueSelectFail(CurrCard,p_card);
5823 SGRAM_ACCESS(port); 3098 SGRAM_ACCESS(port);
5824 return; 3099 return;
5825 } 3100 }
@@ -5832,7 +3107,6 @@ void ssel(ULONG port, UCHAR p_card)
5832 3107
5833 else 3108 else
5834 { 3109 {
5835#endif /* !DOS */
5836 3110
5837 WRW_HARPOON((port+ID_MSG_STRT),BRH_OP+ALWAYS+NTCMD); 3111 WRW_HARPOON((port+ID_MSG_STRT),BRH_OP+ALWAYS+NTCMD);
5838 3112
@@ -5842,16 +3116,10 @@ void ssel(ULONG port, UCHAR p_card)
5842 currSCCB->Sccb_scsistat = SELECT_ST; 3116 currSCCB->Sccb_scsistat = SELECT_ST;
5843 3117
5844 WR_HARPOON(port+hp_autostart_3, (SELECT+SELCHK_STRT)); 3118 WR_HARPOON(port+hp_autostart_3, (SELECT+SELCHK_STRT));
5845#if !defined(DOS)
5846 } 3119 }
5847#endif
5848 3120
5849 3121
5850#if defined(OS2)
5851 theCCB = (UCHAR far *)&currSCCB->Cdb[0];
5852#else
5853 theCCB = (UCHAR *)&currSCCB->Cdb[0]; 3122 theCCB = (UCHAR *)&currSCCB->Cdb[0];
5854#endif
5855 3123
5856 cdb_reg = port + CMD_STRT; 3124 cdb_reg = port + CMD_STRT;
5857 3125
@@ -5867,10 +3135,8 @@ void ssel(ULONG port, UCHAR p_card)
5867 3135
5868 } /* auto_loaded */ 3136 } /* auto_loaded */
5869 3137
5870#if defined(WIDE_SCSI)
5871 WRW_HARPOON((port+hp_fiforead), (USHORT) 0x00); 3138 WRW_HARPOON((port+hp_fiforead), (USHORT) 0x00);
5872 WR_HARPOON(port+hp_xferstat, 0x00); 3139 WR_HARPOON(port+hp_xferstat, 0x00);
5873#endif
5874 3140
5875 WRW_HARPOON((port+hp_intstat), (PROG_HLT | TIMEOUT | SEL | BUS_FREE)); 3141 WRW_HARPOON((port+hp_intstat), (PROG_HLT | TIMEOUT | SEL | BUS_FREE));
5876 3142
@@ -5899,30 +3165,16 @@ void ssel(ULONG port, UCHAR p_card)
5899 3165
5900/*--------------------------------------------------------------------- 3166/*---------------------------------------------------------------------
5901 * 3167 *
5902 * Function: sres 3168 * Function: FPT_sres
5903 * 3169 *
5904 * Description: Hookup the correct CCB and handle the incoming messages. 3170 * Description: Hookup the correct CCB and handle the incoming messages.
5905 * 3171 *
5906 *---------------------------------------------------------------------*/ 3172 *---------------------------------------------------------------------*/
5907 3173
5908#if defined(DOS) 3174static void FPT_sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
5909void sres(USHORT port, UCHAR p_card, PSCCBcard pCurrCard)
5910#else
5911void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
5912#endif
5913{ 3175{
5914 3176
5915#if defined(V302)
5916#ifdef DOS
5917 UCHAR our_target,message, msgRetryCount;
5918 extern UCHAR lun, tag;
5919#else
5920 UCHAR our_target,message,lun,tag, msgRetryCount;
5921#endif
5922
5923#else /* V302 */
5924 UCHAR our_target, message, lun = 0, tag, msgRetryCount; 3177 UCHAR our_target, message, lun = 0, tag, msgRetryCount;
5925#endif /* V302 */
5926 3178
5927 3179
5928 PSCCBMgr_tar_info currTar_Info; 3180 PSCCBMgr_tar_info currTar_Info;
@@ -5933,7 +3185,7 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
5933 3185
5934 if(pCurrCard->currentSCCB != NULL) 3186 if(pCurrCard->currentSCCB != NULL)
5935 { 3187 {
5936 currTar_Info = &sccbMgrTbl[p_card][pCurrCard->currentSCCB->TargID]; 3188 currTar_Info = &FPT_sccbMgrTbl[p_card][pCurrCard->currentSCCB->TargID];
5937 DISABLE_AUTO(port); 3189 DISABLE_AUTO(port);
5938 3190
5939 3191
@@ -5954,7 +3206,7 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
5954 if(((pCurrCard->globalFlags & F_CONLUN_IO) && 3206 if(((pCurrCard->globalFlags & F_CONLUN_IO) &&
5955 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))) 3207 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)))
5956 { 3208 {
5957 currTar_Info->TarLUNBusy[currSCCB->Lun] = FALSE; 3209 currTar_Info->TarLUNBusy[currSCCB->Lun] = 0;
5958 if(currSCCB->Sccb_scsistat != ABORT_ST) 3210 if(currSCCB->Sccb_scsistat != ABORT_ST)
5959 { 3211 {
5960 pCurrCard->discQCount--; 3212 pCurrCard->discQCount--;
@@ -5964,7 +3216,7 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
5964 } 3216 }
5965 else 3217 else
5966 { 3218 {
5967 currTar_Info->TarLUNBusy[0] = FALSE; 3219 currTar_Info->TarLUNBusy[0] = 0;
5968 if(currSCCB->Sccb_tag) 3220 if(currSCCB->Sccb_tag)
5969 { 3221 {
5970 if(currSCCB->Sccb_scsistat != ABORT_ST) 3222 if(currSCCB->Sccb_scsistat != ABORT_ST)
@@ -5982,29 +3234,21 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
5982 } 3234 }
5983 } 3235 }
5984 3236
5985 queueSelectFail(&BL_Card[p_card],p_card); 3237 FPT_queueSelectFail(&FPT_BL_Card[p_card],p_card);
5986 } 3238 }
5987 3239
5988#if defined(WIDE_SCSI)
5989 WRW_HARPOON((port+hp_fiforead), (USHORT) 0x00); 3240 WRW_HARPOON((port+hp_fiforead), (USHORT) 0x00);
5990#endif
5991 3241
5992 3242
5993 our_target = (UCHAR)(RD_HARPOON(port+hp_select_id) >> 4); 3243 our_target = (UCHAR)(RD_HARPOON(port+hp_select_id) >> 4);
5994 currTar_Info = &sccbMgrTbl[p_card][our_target]; 3244 currTar_Info = &FPT_sccbMgrTbl[p_card][our_target];
5995 3245
5996 3246
5997 msgRetryCount = 0; 3247 msgRetryCount = 0;
5998 do 3248 do
5999 { 3249 {
6000 3250
6001#if defined(V302) 3251 currTar_Info = &FPT_sccbMgrTbl[p_card][our_target];
6002
6003 message = GetTarLun(port, p_card, our_target, pCurrCard, &tag, &lun);
6004
6005#else /* V302 */
6006
6007 currTar_Info = &sccbMgrTbl[p_card][our_target];
6008 tag = 0; 3252 tag = 0;
6009 3253
6010 3254
@@ -6022,7 +3266,7 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
6022 if ((RD_HARPOON(port+hp_scsisig) & S_SCSI_PHZ) == S_MSGI_PH) 3266 if ((RD_HARPOON(port+hp_scsisig) & S_SCSI_PHZ) == S_MSGI_PH)
6023 { 3267 {
6024 3268
6025 message = sfm(port,pCurrCard->currentSCCB); 3269 message = FPT_sfm(port,pCurrCard->currentSCCB);
6026 if (message) 3270 if (message)
6027 { 3271 {
6028 3272
@@ -6030,7 +3274,6 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
6030 { 3274 {
6031 lun = message & (UCHAR)LUN_MASK; 3275 lun = message & (UCHAR)LUN_MASK;
6032 3276
6033#if !defined(DOS)
6034 if ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == TAG_Q_TRYING) 3277 if ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == TAG_Q_TRYING)
6035 { 3278 {
6036 if (currTar_Info->TarTagQ_Cnt != 0) 3279 if (currTar_Info->TarTagQ_Cnt != 0)
@@ -6041,21 +3284,21 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
6041 ACCEPT_MSG(port); /*Release the ACK for ID msg. */ 3284 ACCEPT_MSG(port); /*Release the ACK for ID msg. */
6042 3285
6043 3286
6044 message = sfm(port,pCurrCard->currentSCCB); 3287 message = FPT_sfm(port,pCurrCard->currentSCCB);
6045 if (message) 3288 if (message)
6046 { 3289 {
6047 ACCEPT_MSG(port); 3290 ACCEPT_MSG(port);
6048 } 3291 }
6049 3292
6050 else 3293 else
6051 message = FALSE; 3294 message = 0;
6052 3295
6053 if(message != FALSE) 3296 if(message != 0)
6054 { 3297 {
6055 tag = sfm(port,pCurrCard->currentSCCB); 3298 tag = FPT_sfm(port,pCurrCard->currentSCCB);
6056 3299
6057 if (!(tag)) 3300 if (!(tag))
6058 message = FALSE; 3301 message = 0;
6059 } 3302 }
6060 3303
6061 } /*C.A. exists! */ 3304 } /*C.A. exists! */
@@ -6063,7 +3306,6 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
6063 } /*End Q cnt != 0 */ 3306 } /*End Q cnt != 0 */
6064 3307
6065 } /*End Tag cmds supported! */ 3308 } /*End Tag cmds supported! */
6066#endif /* !DOS */
6067 3309
6068 } /*End valid ID message. */ 3310 } /*End valid ID message. */
6069 3311
@@ -6078,7 +3320,7 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
6078 else 3320 else
6079 { 3321 {
6080 3322
6081 message = FALSE; 3323 message = 0;
6082 } 3324 }
6083 } 3325 }
6084 else 3326 else
@@ -6091,49 +3333,47 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
6091 3333
6092 return; 3334 return;
6093 } 3335 }
6094
6095#endif /* V302 */
6096 3336
6097 if(message == FALSE) 3337 if(message == 0)
6098 { 3338 {
6099 msgRetryCount++; 3339 msgRetryCount++;
6100 if(msgRetryCount == 1) 3340 if(msgRetryCount == 1)
6101 { 3341 {
6102 SendMsg(port, SMPARITY); 3342 FPT_SendMsg(port, SMPARITY);
6103 } 3343 }
6104 else 3344 else
6105 { 3345 {
6106 SendMsg(port, SMDEV_RESET); 3346 FPT_SendMsg(port, SMDEV_RESET);
6107 3347
6108 sssyncv(port, our_target, NARROW_SCSI,currTar_Info); 3348 FPT_sssyncv(port, our_target, NARROW_SCSI,currTar_Info);
6109 3349
6110 if (sccbMgrTbl[p_card][our_target].TarEEValue & EE_SYNC_MASK) 3350 if (FPT_sccbMgrTbl[p_card][our_target].TarEEValue & EE_SYNC_MASK)
6111 { 3351 {
6112 3352
6113 sccbMgrTbl[p_card][our_target].TarStatus &= ~TAR_SYNC_MASK; 3353 FPT_sccbMgrTbl[p_card][our_target].TarStatus &= ~TAR_SYNC_MASK;
6114 3354
6115 } 3355 }
6116 3356
6117 if (sccbMgrTbl[p_card][our_target].TarEEValue & EE_WIDE_SCSI) 3357 if (FPT_sccbMgrTbl[p_card][our_target].TarEEValue & EE_WIDE_SCSI)
6118 { 3358 {
6119 3359
6120 sccbMgrTbl[p_card][our_target].TarStatus &= ~TAR_WIDE_MASK; 3360 FPT_sccbMgrTbl[p_card][our_target].TarStatus &= ~TAR_WIDE_MASK;
6121 } 3361 }
6122 3362
6123 3363
6124 queueFlushTargSccb(p_card, our_target, SCCB_COMPLETE); 3364 FPT_queueFlushTargSccb(p_card, our_target, SCCB_COMPLETE);
6125 SccbMgrTableInitTarget(p_card,our_target); 3365 FPT_SccbMgrTableInitTarget(p_card,our_target);
6126 return; 3366 return;
6127 } 3367 }
6128 } 3368 }
6129 }while(message == FALSE); 3369 }while(message == 0);
6130 3370
6131 3371
6132 3372
6133 if(((pCurrCard->globalFlags & F_CONLUN_IO) && 3373 if(((pCurrCard->globalFlags & F_CONLUN_IO) &&
6134 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))) 3374 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)))
6135 { 3375 {
6136 currTar_Info->TarLUNBusy[lun] = TRUE; 3376 currTar_Info->TarLUNBusy[lun] = 1;
6137 pCurrCard->currentSCCB = pCurrCard->discQ_Tbl[currTar_Info->LunDiscQ_Idx[lun]]; 3377 pCurrCard->currentSCCB = pCurrCard->discQ_Tbl[currTar_Info->LunDiscQ_Idx[lun]];
6138 if(pCurrCard->currentSCCB != NULL) 3378 if(pCurrCard->currentSCCB != NULL)
6139 { 3379 {
@@ -6146,7 +3386,7 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
6146 } 3386 }
6147 else 3387 else
6148 { 3388 {
6149 currTar_Info->TarLUNBusy[0] = TRUE; 3389 currTar_Info->TarLUNBusy[0] = 1;
6150 3390
6151 3391
6152 if (tag) 3392 if (tag)
@@ -6182,7 +3422,7 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
6182 /* During Abort Tag command, the target could have got re-selected 3422 /* During Abort Tag command, the target could have got re-selected
6183 and completed the command. Check the select Q and remove the CCB 3423 and completed the command. Check the select Q and remove the CCB
6184 if it is in the Select Q */ 3424 if it is in the Select Q */
6185 queueFindSccb(pCurrCard->currentSCCB, p_card); 3425 FPT_queueFindSccb(pCurrCard->currentSCCB, p_card);
6186 } 3426 }
6187 } 3427 }
6188 3428
@@ -6192,106 +3432,7 @@ void sres(ULONG port, UCHAR p_card, PSCCBcard pCurrCard)
6192 (RD_HARPOON(port+hp_scsisig) & SCSI_BSY)) ; 3432 (RD_HARPOON(port+hp_scsisig) & SCSI_BSY)) ;
6193} 3433}
6194 3434
6195#if defined(V302) 3435static void FPT_SendMsg(ULONG port, UCHAR message)
6196
6197#if defined(DOS)
6198UCHAR GetTarLun(USHORT port, UCHAR p_card, UCHAR our_target, PSCCBcard pCurrCard, PUCHAR tag, PUCHAR lun)
6199#else
6200UCHAR GetTarLun(ULONG port, UCHAR p_card, UCHAR our_target, PSCCBcard pCurrCard, PUCHAR tag, PUCHAR lun)
6201#endif
6202{
6203 UCHAR message;
6204 PSCCBMgr_tar_info currTar_Info;
6205
6206
6207 currTar_Info = &sccbMgrTbl[p_card][our_target];
6208 *tag = 0;
6209
6210
6211 while(!(RD_HARPOON(port+hp_scsisig) & SCSI_REQ))
6212 {
6213 if (! (RD_HARPOON(port+hp_scsisig) & SCSI_BSY))
6214 {
6215
6216 WRW_HARPOON((port+hp_intstat), PHASE);
6217 return(TRUE);
6218 }
6219 }
6220
6221 WRW_HARPOON((port+hp_intstat), PHASE);
6222 if ((RD_HARPOON(port+hp_scsisig) & S_SCSI_PHZ) == S_MSGI_PH)
6223 {
6224
6225 message = sfm(port,pCurrCard->currentSCCB);
6226 if (message)
6227 {
6228
6229 if (message <= (0x80 | LUN_MASK))
6230 {
6231 *lun = message & (UCHAR)LUN_MASK;
6232
6233#if !defined(DOS)
6234 if ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == TAG_Q_TRYING)
6235 {
6236 if (currTar_Info->TarTagQ_Cnt != 0)
6237 {
6238
6239 if (!(currTar_Info->TarLUN_CA))
6240 {
6241 ACCEPT_MSG(port); /*Release the ACK for ID msg. */
6242
6243
6244 message = sfm(port,pCurrCard->currentSCCB);
6245 if (message)
6246 {
6247 ACCEPT_MSG(port);
6248 }
6249
6250 else
6251 return(FALSE);
6252
6253 *tag = sfm(port,pCurrCard->currentSCCB);
6254
6255 if (!(*tag)) return(FALSE);
6256
6257 } /*C.A. exists! */
6258
6259 } /*End Q cnt != 0 */
6260
6261 } /*End Tag cmds supported! */
6262#endif /* !DOS */
6263
6264 } /*End valid ID message. */
6265
6266 else
6267 {
6268
6269 ACCEPT_MSG_ATN(port);
6270 }
6271
6272 } /* End good id message. */
6273
6274 else
6275 {
6276
6277 return(FALSE);
6278 }
6279 }
6280 else
6281 {
6282 ACCEPT_MSG_ATN(port);
6283 return(TRUE);
6284 }
6285 return(TRUE);
6286}
6287
6288#endif /* V302 */
6289
6290#if defined(DOS)
6291void SendMsg(USHORT port, UCHAR message)
6292#else
6293void SendMsg(ULONG port, UCHAR message)
6294#endif
6295{ 3436{
6296 while(!(RD_HARPOON(port+hp_scsisig) & SCSI_REQ)) 3437 while(!(RD_HARPOON(port+hp_scsisig) & SCSI_REQ))
6297 { 3438 {
@@ -6334,26 +3475,22 @@ void SendMsg(ULONG port, UCHAR message)
6334 3475
6335/*--------------------------------------------------------------------- 3476/*---------------------------------------------------------------------
6336 * 3477 *
6337 * Function: sdecm 3478 * Function: FPT_sdecm
6338 * 3479 *
6339 * Description: Determine the proper responce to the message from the 3480 * Description: Determine the proper responce to the message from the
6340 * target device. 3481 * target device.
6341 * 3482 *
6342 *---------------------------------------------------------------------*/ 3483 *---------------------------------------------------------------------*/
6343#if defined(DOS) 3484static void FPT_sdecm(UCHAR message, ULONG port, UCHAR p_card)
6344void sdecm(UCHAR message, USHORT port, UCHAR p_card)
6345#else
6346void sdecm(UCHAR message, ULONG port, UCHAR p_card)
6347#endif
6348{ 3485{
6349 PSCCB currSCCB; 3486 PSCCB currSCCB;
6350 PSCCBcard CurrCard; 3487 PSCCBcard CurrCard;
6351 PSCCBMgr_tar_info currTar_Info; 3488 PSCCBMgr_tar_info currTar_Info;
6352 3489
6353 CurrCard = &BL_Card[p_card]; 3490 CurrCard = &FPT_BL_Card[p_card];
6354 currSCCB = CurrCard->currentSCCB; 3491 currSCCB = CurrCard->currentSCCB;
6355 3492
6356 currTar_Info = &sccbMgrTbl[p_card][currSCCB->TargID]; 3493 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID];
6357 3494
6358 if (message == SMREST_DATA_PTR) 3495 if (message == SMREST_DATA_PTR)
6359 { 3496 {
@@ -6361,7 +3498,7 @@ void sdecm(UCHAR message, ULONG port, UCHAR p_card)
6361 { 3498 {
6362 currSCCB->Sccb_ATC = currSCCB->Sccb_savedATC; 3499 currSCCB->Sccb_ATC = currSCCB->Sccb_savedATC;
6363 3500
6364 hostDataXferRestart(currSCCB); 3501 FPT_hostDataXferRestart(currSCCB);
6365 } 3502 }
6366 3503
6367 ACCEPT_MSG(port); 3504 ACCEPT_MSG(port);
@@ -6417,7 +3554,6 @@ void sdecm(UCHAR message, ULONG port, UCHAR p_card)
6417 currTar_Info->TarEEValue &= ~EE_SYNC_MASK; 3554 currTar_Info->TarEEValue &= ~EE_SYNC_MASK;
6418 } 3555 }
6419 3556
6420#if defined(WIDE_SCSI)
6421 else if ((currSCCB->Sccb_scsistat == SELECT_WN_ST)) 3557 else if ((currSCCB->Sccb_scsistat == SELECT_WN_ST))
6422 { 3558 {
6423 3559
@@ -6428,7 +3564,6 @@ void sdecm(UCHAR message, ULONG port, UCHAR p_card)
6428 currTar_Info->TarEEValue &= ~EE_WIDE_SCSI; 3564 currTar_Info->TarEEValue &= ~EE_WIDE_SCSI;
6429 3565
6430 } 3566 }
6431#endif
6432 3567
6433 else if ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == TAG_Q_TRYING ) 3568 else if ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) == TAG_Q_TRYING )
6434 { 3569 {
@@ -6460,9 +3595,9 @@ void sdecm(UCHAR message, ULONG port, UCHAR p_card)
6460 3595
6461 if((CurrCard->globalFlags & F_CONLUN_IO) && 3596 if((CurrCard->globalFlags & F_CONLUN_IO) &&
6462 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)) 3597 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))
6463 currTar_Info->TarLUNBusy[currSCCB->Lun] = TRUE; 3598 currTar_Info->TarLUNBusy[currSCCB->Lun] = 1;
6464 else 3599 else
6465 currTar_Info->TarLUNBusy[0] = TRUE; 3600 currTar_Info->TarLUNBusy[0] = 1;
6466 3601
6467 3602
6468 currSCCB->ControlByte &= ~(UCHAR)F_USE_CMD_Q; 3603 currSCCB->ControlByte &= ~(UCHAR)F_USE_CMD_Q;
@@ -6490,7 +3625,7 @@ void sdecm(UCHAR message, ULONG port, UCHAR p_card)
6490 { 3625 {
6491 3626
6492 ACCEPT_MSG(port); 3627 ACCEPT_MSG(port);
6493 shandem(port,p_card,currSCCB); 3628 FPT_shandem(port,p_card,currSCCB);
6494 } 3629 }
6495 3630
6496 else if (message == SMIGNORWR) 3631 else if (message == SMIGNORWR)
@@ -6498,7 +3633,7 @@ void sdecm(UCHAR message, ULONG port, UCHAR p_card)
6498 3633
6499 ACCEPT_MSG(port); /* ACK the RESIDUE MSG */ 3634 ACCEPT_MSG(port); /* ACK the RESIDUE MSG */
6500 3635
6501 message = sfm(port,currSCCB); 3636 message = FPT_sfm(port,currSCCB);
6502 3637
6503 if(currSCCB->Sccb_scsimsg != SMPARITY) 3638 if(currSCCB->Sccb_scsimsg != SMPARITY)
6504 ACCEPT_MSG(port); 3639 ACCEPT_MSG(port);
@@ -6520,25 +3655,21 @@ void sdecm(UCHAR message, ULONG port, UCHAR p_card)
6520 3655
6521/*--------------------------------------------------------------------- 3656/*---------------------------------------------------------------------
6522 * 3657 *
6523 * Function: shandem 3658 * Function: FPT_shandem
6524 * 3659 *
6525 * Description: Decide what to do with the extended message. 3660 * Description: Decide what to do with the extended message.
6526 * 3661 *
6527 *---------------------------------------------------------------------*/ 3662 *---------------------------------------------------------------------*/
6528#if defined(DOS) 3663static void FPT_shandem(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
6529void shandem(USHORT port, UCHAR p_card, PSCCB pCurrSCCB)
6530#else
6531void shandem(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
6532#endif
6533{ 3664{
6534 UCHAR length,message; 3665 UCHAR length,message;
6535 3666
6536 length = sfm(port,pCurrSCCB); 3667 length = FPT_sfm(port,pCurrSCCB);
6537 if (length) 3668 if (length)
6538 { 3669 {
6539 3670
6540 ACCEPT_MSG(port); 3671 ACCEPT_MSG(port);
6541 message = sfm(port,pCurrSCCB); 3672 message = FPT_sfm(port,pCurrSCCB);
6542 if (message) 3673 if (message)
6543 { 3674 {
6544 3675
@@ -6549,7 +3680,7 @@ void shandem(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
6549 { 3680 {
6550 3681
6551 ACCEPT_MSG(port); 3682 ACCEPT_MSG(port);
6552 stsyncn(port,p_card); 3683 FPT_stsyncn(port,p_card);
6553 } 3684 }
6554 else 3685 else
6555 { 3686 {
@@ -6558,7 +3689,6 @@ void shandem(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
6558 ACCEPT_MSG_ATN(port); 3689 ACCEPT_MSG_ATN(port);
6559 } 3690 }
6560 } 3691 }
6561#if defined(WIDE_SCSI)
6562 else if (message == SMWDTR) 3692 else if (message == SMWDTR)
6563 { 3693 {
6564 3694
@@ -6566,7 +3696,7 @@ void shandem(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
6566 { 3696 {
6567 3697
6568 ACCEPT_MSG(port); 3698 ACCEPT_MSG(port);
6569 stwidn(port,p_card); 3699 FPT_stwidn(port,p_card);
6570 } 3700 }
6571 else 3701 else
6572 { 3702 {
@@ -6577,7 +3707,6 @@ void shandem(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
6577 WR_HARPOON(port+hp_autostart_1, (AUTO_IMMED+DISCONNECT_START)); 3707 WR_HARPOON(port+hp_autostart_1, (AUTO_IMMED+DISCONNECT_START));
6578 } 3708 }
6579 } 3709 }
6580#endif
6581 else 3710 else
6582 { 3711 {
6583 3712
@@ -6603,24 +3732,20 @@ void shandem(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
6603 3732
6604/*--------------------------------------------------------------------- 3733/*---------------------------------------------------------------------
6605 * 3734 *
6606 * Function: sisyncn 3735 * Function: FPT_sisyncn
6607 * 3736 *
6608 * Description: Read in a message byte from the SCSI bus, and check 3737 * Description: Read in a message byte from the SCSI bus, and check
6609 * for a parity error. 3738 * for a parity error.
6610 * 3739 *
6611 *---------------------------------------------------------------------*/ 3740 *---------------------------------------------------------------------*/
6612 3741
6613#if defined(DOS) 3742static UCHAR FPT_sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag)
6614UCHAR sisyncn(USHORT port, UCHAR p_card, UCHAR syncFlag)
6615#else
6616UCHAR sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag)
6617#endif
6618{ 3743{
6619 PSCCB currSCCB; 3744 PSCCB currSCCB;
6620 PSCCBMgr_tar_info currTar_Info; 3745 PSCCBMgr_tar_info currTar_Info;
6621 3746
6622 currSCCB = BL_Card[p_card].currentSCCB; 3747 currSCCB = FPT_BL_Card[p_card].currentSCCB;
6623 currTar_Info = &sccbMgrTbl[p_card][currSCCB->TargID]; 3748 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID];
6624 3749
6625 if (!((currTar_Info->TarStatus & TAR_SYNC_MASK) == SYNC_TRYING)) { 3750 if (!((currTar_Info->TarStatus & TAR_SYNC_MASK) == SYNC_TRYING)) {
6626 3751
@@ -6656,7 +3781,7 @@ UCHAR sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag)
6656 WRW_HARPOON((port+SYNC_MSGS+12),(BRH_OP+ALWAYS+NP )); 3781 WRW_HARPOON((port+SYNC_MSGS+12),(BRH_OP+ALWAYS+NP ));
6657 3782
6658 3783
6659 if(syncFlag == FALSE) 3784 if(syncFlag == 0)
6660 { 3785 {
6661 WR_HARPOON(port+hp_autostart_3, (SELECT+SELCHK_STRT)); 3786 WR_HARPOON(port+hp_autostart_3, (SELECT+SELCHK_STRT));
6662 currTar_Info->TarStatus = ((currTar_Info->TarStatus & 3787 currTar_Info->TarStatus = ((currTar_Info->TarStatus &
@@ -6668,14 +3793,14 @@ UCHAR sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag)
6668 } 3793 }
6669 3794
6670 3795
6671 return(TRUE); 3796 return(1);
6672 } 3797 }
6673 3798
6674 else { 3799 else {
6675 3800
6676 currTar_Info->TarStatus |= (UCHAR)SYNC_SUPPORTED; 3801 currTar_Info->TarStatus |= (UCHAR)SYNC_SUPPORTED;
6677 currTar_Info->TarEEValue &= ~EE_SYNC_MASK; 3802 currTar_Info->TarEEValue &= ~EE_SYNC_MASK;
6678 return(FALSE); 3803 return(0);
6679 } 3804 }
6680} 3805}
6681 3806
@@ -6683,26 +3808,22 @@ UCHAR sisyncn(ULONG port, UCHAR p_card, UCHAR syncFlag)
6683 3808
6684/*--------------------------------------------------------------------- 3809/*---------------------------------------------------------------------
6685 * 3810 *
6686 * Function: stsyncn 3811 * Function: FPT_stsyncn
6687 * 3812 *
6688 * Description: The has sent us a Sync Nego message so handle it as 3813 * Description: The has sent us a Sync Nego message so handle it as
6689 * necessary. 3814 * necessary.
6690 * 3815 *
6691 *---------------------------------------------------------------------*/ 3816 *---------------------------------------------------------------------*/
6692#if defined(DOS) 3817static void FPT_stsyncn(ULONG port, UCHAR p_card)
6693void stsyncn(USHORT port, UCHAR p_card)
6694#else
6695void stsyncn(ULONG port, UCHAR p_card)
6696#endif
6697{ 3818{
6698 UCHAR sync_msg,offset,sync_reg,our_sync_msg; 3819 UCHAR sync_msg,offset,sync_reg,our_sync_msg;
6699 PSCCB currSCCB; 3820 PSCCB currSCCB;
6700 PSCCBMgr_tar_info currTar_Info; 3821 PSCCBMgr_tar_info currTar_Info;
6701 3822
6702 currSCCB = BL_Card[p_card].currentSCCB; 3823 currSCCB = FPT_BL_Card[p_card].currentSCCB;
6703 currTar_Info = &sccbMgrTbl[p_card][currSCCB->TargID]; 3824 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID];
6704 3825
6705 sync_msg = sfm(port,currSCCB); 3826 sync_msg = FPT_sfm(port,currSCCB);
6706 3827
6707 if((sync_msg == 0x00) && (currSCCB->Sccb_scsimsg == SMPARITY)) 3828 if((sync_msg == 0x00) && (currSCCB->Sccb_scsimsg == SMPARITY))
6708 { 3829 {
@@ -6713,7 +3834,7 @@ void stsyncn(ULONG port, UCHAR p_card)
6713 ACCEPT_MSG(port); 3834 ACCEPT_MSG(port);
6714 3835
6715 3836
6716 offset = sfm(port,currSCCB); 3837 offset = FPT_sfm(port,currSCCB);
6717 3838
6718 if((offset == 0x00) && (currSCCB->Sccb_scsimsg == SMPARITY)) 3839 if((offset == 0x00) && (currSCCB->Sccb_scsimsg == SMPARITY))
6719 { 3840 {
@@ -6783,7 +3904,6 @@ void stsyncn(ULONG port, UCHAR p_card)
6783 } 3904 }
6784 3905
6785 3906
6786#if defined(WIDE_SCSI)
6787 if (currTar_Info->TarStatus & WIDE_ENABLED) 3907 if (currTar_Info->TarStatus & WIDE_ENABLED)
6788 3908
6789 sync_reg |= offset; 3909 sync_reg |= offset;
@@ -6792,11 +3912,7 @@ void stsyncn(ULONG port, UCHAR p_card)
6792 3912
6793 sync_reg |= (offset | NARROW_SCSI); 3913 sync_reg |= (offset | NARROW_SCSI);
6794 3914
6795#else 3915 FPT_sssyncv(port,currSCCB->TargID,sync_reg,currTar_Info);
6796 sync_reg |= (offset | NARROW_SCSI);
6797#endif
6798
6799 sssyncv(port,currSCCB->TargID,sync_reg,currTar_Info);
6800 3916
6801 3917
6802 if (currSCCB->Sccb_scsistat == SELECT_SN_ST) { 3918 if (currSCCB->Sccb_scsistat == SELECT_SN_ST) {
@@ -6815,7 +3931,7 @@ void stsyncn(ULONG port, UCHAR p_card)
6815 3931
6816 ACCEPT_MSG_ATN(port); 3932 ACCEPT_MSG_ATN(port);
6817 3933
6818 sisyncr(port,sync_msg,offset); 3934 FPT_sisyncr(port,sync_msg,offset);
6819 3935
6820 currTar_Info->TarStatus = ((currTar_Info->TarStatus & 3936 currTar_Info->TarStatus = ((currTar_Info->TarStatus &
6821 ~(UCHAR)TAR_SYNC_MASK) | (UCHAR)SYNC_SUPPORTED); 3937 ~(UCHAR)TAR_SYNC_MASK) | (UCHAR)SYNC_SUPPORTED);
@@ -6825,16 +3941,12 @@ void stsyncn(ULONG port, UCHAR p_card)
6825 3941
6826/*--------------------------------------------------------------------- 3942/*---------------------------------------------------------------------
6827 * 3943 *
6828 * Function: sisyncr 3944 * Function: FPT_sisyncr
6829 * 3945 *
6830 * Description: Answer the targets sync message. 3946 * Description: Answer the targets sync message.
6831 * 3947 *
6832 *---------------------------------------------------------------------*/ 3948 *---------------------------------------------------------------------*/
6833#if defined(DOS) 3949static void FPT_sisyncr(ULONG port,UCHAR sync_pulse, UCHAR offset)
6834void sisyncr(USHORT port,UCHAR sync_pulse, UCHAR offset)
6835#else
6836void sisyncr(ULONG port,UCHAR sync_pulse, UCHAR offset)
6837#endif
6838{ 3950{
6839 ARAM_ACCESS(port); 3951 ARAM_ACCESS(port);
6840 WRW_HARPOON((port+SYNC_MSGS+0), (MPM_OP+AMSG_OUT+SMEXT )); 3952 WRW_HARPOON((port+SYNC_MSGS+0), (MPM_OP+AMSG_OUT+SMEXT ));
@@ -6856,28 +3968,22 @@ void sisyncr(ULONG port,UCHAR sync_pulse, UCHAR offset)
6856 3968
6857 3969
6858 3970
6859#if defined(WIDE_SCSI)
6860
6861/*--------------------------------------------------------------------- 3971/*---------------------------------------------------------------------
6862 * 3972 *
6863 * Function: siwidn 3973 * Function: FPT_siwidn
6864 * 3974 *
6865 * Description: Read in a message byte from the SCSI bus, and check 3975 * Description: Read in a message byte from the SCSI bus, and check
6866 * for a parity error. 3976 * for a parity error.
6867 * 3977 *
6868 *---------------------------------------------------------------------*/ 3978 *---------------------------------------------------------------------*/
6869 3979
6870#if defined(DOS) 3980static UCHAR FPT_siwidn(ULONG port, UCHAR p_card)
6871UCHAR siwidn(USHORT port, UCHAR p_card)
6872#else
6873UCHAR siwidn(ULONG port, UCHAR p_card)
6874#endif
6875{ 3981{
6876 PSCCB currSCCB; 3982 PSCCB currSCCB;
6877 PSCCBMgr_tar_info currTar_Info; 3983 PSCCBMgr_tar_info currTar_Info;
6878 3984
6879 currSCCB = BL_Card[p_card].currentSCCB; 3985 currSCCB = FPT_BL_Card[p_card].currentSCCB;
6880 currTar_Info = &sccbMgrTbl[p_card][currSCCB->TargID]; 3986 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID];
6881 3987
6882 if (!((currTar_Info->TarStatus & TAR_WIDE_MASK) == WIDE_NEGOCIATED)) { 3988 if (!((currTar_Info->TarStatus & TAR_WIDE_MASK) == WIDE_NEGOCIATED)) {
6883 3989
@@ -6900,7 +4006,7 @@ UCHAR siwidn(ULONG port, UCHAR p_card)
6900 currTar_Info->TarStatus = ((currTar_Info->TarStatus & 4006 currTar_Info->TarStatus = ((currTar_Info->TarStatus &
6901 ~(UCHAR)TAR_WIDE_MASK) | (UCHAR)WIDE_ENABLED); 4007 ~(UCHAR)TAR_WIDE_MASK) | (UCHAR)WIDE_ENABLED);
6902 4008
6903 return(TRUE); 4009 return(1);
6904 } 4010 }
6905 4011
6906 else { 4012 else {
@@ -6909,7 +4015,7 @@ UCHAR siwidn(ULONG port, UCHAR p_card)
6909 ~(UCHAR)TAR_WIDE_MASK) | WIDE_NEGOCIATED); 4015 ~(UCHAR)TAR_WIDE_MASK) | WIDE_NEGOCIATED);
6910 4016
6911 currTar_Info->TarEEValue &= ~EE_WIDE_SCSI; 4017 currTar_Info->TarEEValue &= ~EE_WIDE_SCSI;
6912 return(FALSE); 4018 return(0);
6913 } 4019 }
6914} 4020}
6915 4021
@@ -6917,26 +4023,22 @@ UCHAR siwidn(ULONG port, UCHAR p_card)
6917 4023
6918/*--------------------------------------------------------------------- 4024/*---------------------------------------------------------------------
6919 * 4025 *
6920 * Function: stwidn 4026 * Function: FPT_stwidn
6921 * 4027 *
6922 * Description: The has sent us a Wide Nego message so handle it as 4028 * Description: The has sent us a Wide Nego message so handle it as
6923 * necessary. 4029 * necessary.
6924 * 4030 *
6925 *---------------------------------------------------------------------*/ 4031 *---------------------------------------------------------------------*/
6926#if defined(DOS) 4032static void FPT_stwidn(ULONG port, UCHAR p_card)
6927void stwidn(USHORT port, UCHAR p_card)
6928#else
6929void stwidn(ULONG port, UCHAR p_card)
6930#endif
6931{ 4033{
6932 UCHAR width; 4034 UCHAR width;
6933 PSCCB currSCCB; 4035 PSCCB currSCCB;
6934 PSCCBMgr_tar_info currTar_Info; 4036 PSCCBMgr_tar_info currTar_Info;
6935 4037
6936 currSCCB = BL_Card[p_card].currentSCCB; 4038 currSCCB = FPT_BL_Card[p_card].currentSCCB;
6937 currTar_Info = &sccbMgrTbl[p_card][currSCCB->TargID]; 4039 currTar_Info = &FPT_sccbMgrTbl[p_card][currSCCB->TargID];
6938 4040
6939 width = sfm(port,currSCCB); 4041 width = FPT_sfm(port,currSCCB);
6940 4042
6941 if((width == 0x00) && (currSCCB->Sccb_scsimsg == SMPARITY)) 4043 if((width == 0x00) && (currSCCB->Sccb_scsimsg == SMPARITY))
6942 { 4044 {
@@ -6958,7 +4060,7 @@ void stwidn(ULONG port, UCHAR p_card)
6958 } 4060 }
6959 4061
6960 4062
6961 sssyncv(port,currSCCB->TargID,width,currTar_Info); 4063 FPT_sssyncv(port,currSCCB->TargID,width,currTar_Info);
6962 4064
6963 4065
6964 if (currSCCB->Sccb_scsistat == SELECT_WN_ST) 4066 if (currSCCB->Sccb_scsistat == SELECT_WN_ST)
@@ -6972,7 +4074,7 @@ void stwidn(ULONG port, UCHAR p_card)
6972 { 4074 {
6973 ACCEPT_MSG_ATN(port); 4075 ACCEPT_MSG_ATN(port);
6974 ARAM_ACCESS(port); 4076 ARAM_ACCESS(port);
6975 sisyncn(port,p_card, TRUE); 4077 FPT_sisyncn(port,p_card, 1);
6976 currSCCB->Sccb_scsistat = SELECT_SN_ST; 4078 currSCCB->Sccb_scsistat = SELECT_SN_ST;
6977 SGRAM_ACCESS(port); 4079 SGRAM_ACCESS(port);
6978 } 4080 }
@@ -6993,7 +4095,7 @@ void stwidn(ULONG port, UCHAR p_card)
6993 else 4095 else
6994 width = SM8BIT; 4096 width = SM8BIT;
6995 4097
6996 siwidr(port,width); 4098 FPT_siwidr(port,width);
6997 4099
6998 currTar_Info->TarStatus |= (WIDE_NEGOCIATED | WIDE_ENABLED); 4100 currTar_Info->TarStatus |= (WIDE_NEGOCIATED | WIDE_ENABLED);
6999 } 4101 }
@@ -7002,16 +4104,12 @@ void stwidn(ULONG port, UCHAR p_card)
7002 4104
7003/*--------------------------------------------------------------------- 4105/*---------------------------------------------------------------------
7004 * 4106 *
7005 * Function: siwidr 4107 * Function: FPT_siwidr
7006 * 4108 *
7007 * Description: Answer the targets Wide nego message. 4109 * Description: Answer the targets Wide nego message.
7008 * 4110 *
7009 *---------------------------------------------------------------------*/ 4111 *---------------------------------------------------------------------*/
7010#if defined(DOS) 4112static void FPT_siwidr(ULONG port, UCHAR width)
7011void siwidr(USHORT port, UCHAR width)
7012#else
7013void siwidr(ULONG port, UCHAR width)
7014#endif
7015{ 4113{
7016 ARAM_ACCESS(port); 4114 ARAM_ACCESS(port);
7017 WRW_HARPOON((port+SYNC_MSGS+0), (MPM_OP+AMSG_OUT+SMEXT )); 4115 WRW_HARPOON((port+SYNC_MSGS+0), (MPM_OP+AMSG_OUT+SMEXT ));
@@ -7030,23 +4128,18 @@ void siwidr(ULONG port, UCHAR width)
7030 while (!(RDW_HARPOON((port+hp_intstat)) & (BUS_FREE | AUTO_INT))) {} 4128 while (!(RDW_HARPOON((port+hp_intstat)) & (BUS_FREE | AUTO_INT))) {}
7031} 4129}
7032 4130
7033#endif
7034
7035 4131
7036 4132
7037/*--------------------------------------------------------------------- 4133/*---------------------------------------------------------------------
7038 * 4134 *
7039 * Function: sssyncv 4135 * Function: FPT_sssyncv
7040 * 4136 *
7041 * Description: Write the desired value to the Sync Register for the 4137 * Description: Write the desired value to the Sync Register for the
7042 * ID specified. 4138 * ID specified.
7043 * 4139 *
7044 *---------------------------------------------------------------------*/ 4140 *---------------------------------------------------------------------*/
7045#if defined(DOS) 4141static void FPT_sssyncv(ULONG p_port, UCHAR p_id, UCHAR p_sync_value,
7046void sssyncv(USHORT p_port, UCHAR p_id, UCHAR p_sync_value,PSCCBMgr_tar_info currTar_Info) 4142 PSCCBMgr_tar_info currTar_Info)
7047#else
7048void sssyncv(ULONG p_port, UCHAR p_id, UCHAR p_sync_value,PSCCBMgr_tar_info currTar_Info)
7049#endif
7050{ 4143{
7051 UCHAR index; 4144 UCHAR index;
7052 4145
@@ -7112,16 +4205,12 @@ void sssyncv(ULONG p_port, UCHAR p_id, UCHAR p_sync_value,PSCCBMgr_tar_info curr
7112 4205
7113/*--------------------------------------------------------------------- 4206/*---------------------------------------------------------------------
7114 * 4207 *
7115 * Function: sresb 4208 * Function: FPT_sresb
7116 * 4209 *
7117 * Description: Reset the desired card's SCSI bus. 4210 * Description: Reset the desired card's SCSI bus.
7118 * 4211 *
7119 *---------------------------------------------------------------------*/ 4212 *---------------------------------------------------------------------*/
7120#if defined(DOS) 4213static void FPT_sresb(ULONG port, UCHAR p_card)
7121void sresb(USHORT port, UCHAR p_card)
7122#else
7123void sresb(ULONG port, UCHAR p_card)
7124#endif
7125{ 4214{
7126 UCHAR scsiID, i; 4215 UCHAR scsiID, i;
7127 4216
@@ -7145,7 +4234,7 @@ void sresb(ULONG port, UCHAR p_card)
7145 4234
7146 WR_HARPOON(port+hp_scsictrl_0, ENA_SCAM_SEL); 4235 WR_HARPOON(port+hp_scsictrl_0, ENA_SCAM_SEL);
7147 4236
7148 Wait(port, TO_5ms); 4237 FPT_Wait(port, TO_5ms);
7149 4238
7150 WRW_HARPOON((port+hp_intstat), CLR_ALL_INT); 4239 WRW_HARPOON((port+hp_intstat), CLR_ALL_INT);
7151 4240
@@ -7153,7 +4242,7 @@ void sresb(ULONG port, UCHAR p_card)
7153 4242
7154 for (scsiID = 0; scsiID < MAX_SCSI_TAR; scsiID++) 4243 for (scsiID = 0; scsiID < MAX_SCSI_TAR; scsiID++)
7155 { 4244 {
7156 currTar_Info = &sccbMgrTbl[p_card][scsiID]; 4245 currTar_Info = &FPT_sccbMgrTbl[p_card][scsiID];
7157 4246
7158 if (currTar_Info->TarEEValue & EE_SYNC_MASK) 4247 if (currTar_Info->TarEEValue & EE_SYNC_MASK)
7159 { 4248 {
@@ -7166,21 +4255,21 @@ void sresb(ULONG port, UCHAR p_card)
7166 currTar_Info->TarStatus &= ~TAR_WIDE_MASK; 4255 currTar_Info->TarStatus &= ~TAR_WIDE_MASK;
7167 } 4256 }
7168 4257
7169 sssyncv(port, scsiID, NARROW_SCSI,currTar_Info); 4258 FPT_sssyncv(port, scsiID, NARROW_SCSI,currTar_Info);
7170 4259
7171 SccbMgrTableInitTarget(p_card, scsiID); 4260 FPT_SccbMgrTableInitTarget(p_card, scsiID);
7172 } 4261 }
7173 4262
7174 BL_Card[p_card].scanIndex = 0x00; 4263 FPT_BL_Card[p_card].scanIndex = 0x00;
7175 BL_Card[p_card].currentSCCB = NULL; 4264 FPT_BL_Card[p_card].currentSCCB = NULL;
7176 BL_Card[p_card].globalFlags &= ~(F_TAG_STARTED | F_HOST_XFER_ACT 4265 FPT_BL_Card[p_card].globalFlags &= ~(F_TAG_STARTED | F_HOST_XFER_ACT
7177 | F_NEW_SCCB_CMD); 4266 | F_NEW_SCCB_CMD);
7178 BL_Card[p_card].cmdCounter = 0x00; 4267 FPT_BL_Card[p_card].cmdCounter = 0x00;
7179 BL_Card[p_card].discQCount = 0x00; 4268 FPT_BL_Card[p_card].discQCount = 0x00;
7180 BL_Card[p_card].tagQ_Lst = 0x01; 4269 FPT_BL_Card[p_card].tagQ_Lst = 0x01;
7181 4270
7182 for(i = 0; i < QUEUE_DEPTH; i++) 4271 for(i = 0; i < QUEUE_DEPTH; i++)
7183 BL_Card[p_card].discQ_Tbl[i] = NULL; 4272 FPT_BL_Card[p_card].discQ_Tbl[i] = NULL;
7184 4273
7185 WR_HARPOON(port+hp_page_ctrl, 4274 WR_HARPOON(port+hp_page_ctrl,
7186 (RD_HARPOON(port+hp_page_ctrl) & ~G_INT_DISABLE)); 4275 (RD_HARPOON(port+hp_page_ctrl) & ~G_INT_DISABLE));
@@ -7189,12 +4278,12 @@ void sresb(ULONG port, UCHAR p_card)
7189 4278
7190/*--------------------------------------------------------------------- 4279/*---------------------------------------------------------------------
7191 * 4280 *
7192 * Function: ssenss 4281 * Function: FPT_ssenss
7193 * 4282 *
7194 * Description: Setup for the Auto Sense command. 4283 * Description: Setup for the Auto Sense command.
7195 * 4284 *
7196 *---------------------------------------------------------------------*/ 4285 *---------------------------------------------------------------------*/
7197void ssenss(PSCCBcard pCurrCard) 4286static void FPT_ssenss(PSCCBcard pCurrCard)
7198{ 4287{
7199 UCHAR i; 4288 UCHAR i;
7200 PSCCB currSCCB; 4289 PSCCB currSCCB;
@@ -7236,27 +4325,23 @@ void ssenss(PSCCBcard pCurrCard)
7236 4325
7237/*--------------------------------------------------------------------- 4326/*---------------------------------------------------------------------
7238 * 4327 *
7239 * Function: sxfrp 4328 * Function: FPT_sxfrp
7240 * 4329 *
7241 * Description: Transfer data into the bit bucket until the device 4330 * Description: Transfer data into the bit bucket until the device
7242 * decides to switch phase. 4331 * decides to switch phase.
7243 * 4332 *
7244 *---------------------------------------------------------------------*/ 4333 *---------------------------------------------------------------------*/
7245 4334
7246#if defined(DOS) 4335static void FPT_sxfrp(ULONG p_port, UCHAR p_card)
7247void sxfrp(USHORT p_port, UCHAR p_card)
7248#else
7249void sxfrp(ULONG p_port, UCHAR p_card)
7250#endif
7251{ 4336{
7252 UCHAR curr_phz; 4337 UCHAR curr_phz;
7253 4338
7254 4339
7255 DISABLE_AUTO(p_port); 4340 DISABLE_AUTO(p_port);
7256 4341
7257 if (BL_Card[p_card].globalFlags & F_HOST_XFER_ACT) { 4342 if (FPT_BL_Card[p_card].globalFlags & F_HOST_XFER_ACT) {
7258 4343
7259 hostDataXferAbort(p_port,p_card,BL_Card[p_card].currentSCCB); 4344 FPT_hostDataXferAbort(p_port,p_card,FPT_BL_Card[p_card].currentSCCB);
7260 4345
7261 } 4346 }
7262 4347
@@ -7322,25 +4407,21 @@ void sxfrp(ULONG p_port, UCHAR p_card)
7322 4407
7323/*--------------------------------------------------------------------- 4408/*---------------------------------------------------------------------
7324 * 4409 *
7325 * Function: schkdd 4410 * Function: FPT_schkdd
7326 * 4411 *
7327 * Description: Make sure data has been flushed from both FIFOs and abort 4412 * Description: Make sure data has been flushed from both FIFOs and abort
7328 * the operations if necessary. 4413 * the operations if necessary.
7329 * 4414 *
7330 *---------------------------------------------------------------------*/ 4415 *---------------------------------------------------------------------*/
7331 4416
7332#if defined(DOS) 4417static void FPT_schkdd(ULONG port, UCHAR p_card)
7333void schkdd(USHORT port, UCHAR p_card)
7334#else
7335void schkdd(ULONG port, UCHAR p_card)
7336#endif
7337{ 4418{
7338 USHORT TimeOutLoop; 4419 USHORT TimeOutLoop;
7339 UCHAR sPhase; 4420 UCHAR sPhase;
7340 4421
7341 PSCCB currSCCB; 4422 PSCCB currSCCB;
7342 4423
7343 currSCCB = BL_Card[p_card].currentSCCB; 4424 currSCCB = FPT_BL_Card[p_card].currentSCCB;
7344 4425
7345 4426
7346 if ((currSCCB->Sccb_scsistat != DATA_OUT_ST) && 4427 if ((currSCCB->Sccb_scsistat != DATA_OUT_ST) &&
@@ -7378,7 +4459,7 @@ void schkdd(ULONG port, UCHAR p_card)
7378 } 4459 }
7379 4460
7380 4461
7381 hostDataXferAbort(port,p_card,currSCCB); 4462 FPT_hostDataXferAbort(port,p_card,currSCCB);
7382 4463
7383 4464
7384 while (RD_HARPOON(port+hp_scsisig) & SCSI_ACK) {} 4465 while (RD_HARPOON(port+hp_scsisig) & SCSI_ACK) {}
@@ -7412,21 +4493,21 @@ void schkdd(ULONG port, UCHAR p_card)
7412 if (!(currSCCB->Sccb_XferState & F_ALL_XFERRED)) 4493 if (!(currSCCB->Sccb_XferState & F_ALL_XFERRED))
7413 { 4494 {
7414 if (currSCCB->Sccb_XferState & F_HOST_XFER_DIR) { 4495 if (currSCCB->Sccb_XferState & F_HOST_XFER_DIR) {
7415 phaseDataIn(port,p_card); 4496 FPT_phaseDataIn(port,p_card);
7416 } 4497 }
7417 4498
7418 else { 4499 else {
7419 phaseDataOut(port,p_card); 4500 FPT_phaseDataOut(port,p_card);
7420 } 4501 }
7421 } 4502 }
7422 else 4503 else
7423 { 4504 {
7424 sxfrp(port,p_card); 4505 FPT_sxfrp(port,p_card);
7425 if (!(RDW_HARPOON((port+hp_intstat)) & 4506 if (!(RDW_HARPOON((port+hp_intstat)) &
7426 (BUS_FREE | ICMD_COMP | ITAR_DISC | RESET))) 4507 (BUS_FREE | ICMD_COMP | ITAR_DISC | RESET)))
7427 { 4508 {
7428 WRW_HARPOON((port+hp_intstat), AUTO_INT); 4509 WRW_HARPOON((port+hp_intstat), AUTO_INT);
7429 phaseDecode(port,p_card); 4510 FPT_phaseDecode(port,p_card);
7430 } 4511 }
7431 } 4512 }
7432 4513
@@ -7440,13 +4521,13 @@ void schkdd(ULONG port, UCHAR p_card)
7440 4521
7441/*--------------------------------------------------------------------- 4522/*---------------------------------------------------------------------
7442 * 4523 *
7443 * Function: sinits 4524 * Function: FPT_sinits
7444 * 4525 *
7445 * Description: Setup SCCB manager fields in this SCCB. 4526 * Description: Setup SCCB manager fields in this SCCB.
7446 * 4527 *
7447 *---------------------------------------------------------------------*/ 4528 *---------------------------------------------------------------------*/
7448 4529
7449void sinits(PSCCB p_sccb, UCHAR p_card) 4530static void FPT_sinits(PSCCB p_sccb, UCHAR p_card)
7450{ 4531{
7451 PSCCBMgr_tar_info currTar_Info; 4532 PSCCBMgr_tar_info currTar_Info;
7452 4533
@@ -7454,7 +4535,7 @@ void sinits(PSCCB p_sccb, UCHAR p_card)
7454 { 4535 {
7455 return; 4536 return;
7456 } 4537 }
7457 currTar_Info = &sccbMgrTbl[p_card][p_sccb->TargID]; 4538 currTar_Info = &FPT_sccbMgrTbl[p_card][p_sccb->TargID];
7458 4539
7459 p_sccb->Sccb_XferState = 0x00; 4540 p_sccb->Sccb_XferState = 0x00;
7460 p_sccb->Sccb_XferCnt = p_sccb->DataLength; 4541 p_sccb->Sccb_XferCnt = p_sccb->DataLength;
@@ -7485,7 +4566,7 @@ void sinits(PSCCB p_sccb, UCHAR p_card)
7485 else send Cmd with Disconnect Disable */ 4566 else send Cmd with Disconnect Disable */
7486 4567
7487/* 4568/*
7488 if (((!(BL_Card[p_card].globalFlags & F_SINGLE_DEVICE)) && 4569 if (((!(FPT_BL_Card[p_card].globalFlags & F_SINGLE_DEVICE)) &&
7489 (currTar_Info->TarStatus & TAR_ALLOW_DISC)) || 4570 (currTar_Info->TarStatus & TAR_ALLOW_DISC)) ||
7490 (currTar_Info->TarStatus & TAG_Q_TRYING)) { 4571 (currTar_Info->TarStatus & TAG_Q_TRYING)) {
7491*/ 4572*/
@@ -7518,55 +4599,6 @@ void sinits(PSCCB p_sccb, UCHAR p_card)
7518} 4599}
7519 4600
7520 4601
7521#ident "$Id: phase.c 1.11 1997/01/31 02:08:49 mohan Exp $"
7522/*----------------------------------------------------------------------
7523 *
7524 *
7525 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
7526 *
7527 * This file is available under both the GNU General Public License
7528 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
7529 *
7530 * $Workfile: phase.c $
7531 *
7532 * Description: Functions to initially handle the SCSI bus phase when
7533 * the target asserts request (and the automation is not
7534 * enabled to handle the situation).
7535 *
7536 * $Date: 1997/01/31 02:08:49 $
7537 *
7538 * $Revision: 1.11 $
7539 *
7540 *----------------------------------------------------------------------*/
7541
7542/*#include <globals.h>*/
7543
7544#if (FW_TYPE==_UCB_MGR_)
7545 /*#include <budi.h>*/
7546#endif
7547
7548/*#include <sccbmgr.h>*/
7549/*#include <blx30.h>*/
7550/*#include <target.h>*/
7551/*#include <scsi2.h>*/
7552/*#include <harpoon.h>*/
7553
7554
7555/*
7556extern SCCBCARD BL_Card[MAX_CARDS];
7557extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
7558
7559#if defined(OS2)
7560 extern void (far *s_PhaseTbl[8]) (ULONG, UCHAR);
7561#else
7562 #if defined(DOS)
7563 extern void (*s_PhaseTbl[8]) (USHORT, UCHAR);
7564 #else
7565 extern void (*s_PhaseTbl[8]) (ULONG, UCHAR);
7566 #endif
7567#endif
7568*/
7569
7570/*--------------------------------------------------------------------- 4602/*---------------------------------------------------------------------
7571 * 4603 *
7572 * Function: Phase Decode 4604 * Function: Phase Decode
@@ -7575,29 +4607,17 @@ extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
7575 * 4607 *
7576 *---------------------------------------------------------------------*/ 4608 *---------------------------------------------------------------------*/
7577 4609
7578#if defined(DOS) 4610static void FPT_phaseDecode(ULONG p_port, UCHAR p_card)
7579void phaseDecode(USHORT p_port, UCHAR p_card)
7580#else
7581void phaseDecode(ULONG p_port, UCHAR p_card)
7582#endif
7583{ 4611{
7584 unsigned char phase_ref; 4612 unsigned char phase_ref;
7585#if defined(OS2) 4613 void (*phase) (ULONG, UCHAR);
7586 void (far *phase) (ULONG, UCHAR);
7587#else
7588 #if defined(DOS)
7589 void (*phase) (USHORT, UCHAR);
7590 #else
7591 void (*phase) (ULONG, UCHAR);
7592 #endif
7593#endif
7594 4614
7595 4615
7596 DISABLE_AUTO(p_port); 4616 DISABLE_AUTO(p_port);
7597 4617
7598 phase_ref = (UCHAR) (RD_HARPOON(p_port+hp_scsisig) & S_SCSI_PHZ); 4618 phase_ref = (UCHAR) (RD_HARPOON(p_port+hp_scsisig) & S_SCSI_PHZ);
7599 4619
7600 phase = s_PhaseTbl[phase_ref]; 4620 phase = FPT_s_PhaseTbl[phase_ref];
7601 4621
7602 (*phase)(p_port, p_card); /* Call the correct phase func */ 4622 (*phase)(p_port, p_card); /* Call the correct phase func */
7603} 4623}
@@ -7612,20 +4632,12 @@ void phaseDecode(ULONG p_port, UCHAR p_card)
7612 * 4632 *
7613 *---------------------------------------------------------------------*/ 4633 *---------------------------------------------------------------------*/
7614 4634
7615#if defined(OS2) 4635static void FPT_phaseDataOut(ULONG port, UCHAR p_card)
7616void far phaseDataOut(ULONG port, UCHAR p_card)
7617#else
7618#if defined(DOS)
7619void phaseDataOut(USHORT port, UCHAR p_card)
7620#else
7621void phaseDataOut(ULONG port, UCHAR p_card)
7622#endif
7623#endif
7624{ 4636{
7625 4637
7626 PSCCB currSCCB; 4638 PSCCB currSCCB;
7627 4639
7628 currSCCB = BL_Card[p_card].currentSCCB; 4640 currSCCB = FPT_BL_Card[p_card].currentSCCB;
7629 if (currSCCB == NULL) 4641 if (currSCCB == NULL)
7630 { 4642 {
7631 return; /* Exit if No SCCB record */ 4643 return; /* Exit if No SCCB record */
@@ -7640,14 +4652,7 @@ void phaseDataOut(ULONG port, UCHAR p_card)
7640 4652
7641 WR_HARPOON(port+hp_autostart_0, (END_DATA+END_DATA_START)); 4653 WR_HARPOON(port+hp_autostart_0, (END_DATA+END_DATA_START));
7642 4654
7643 dataXferProcessor(port, &BL_Card[p_card]); 4655 FPT_dataXferProcessor(port, &FPT_BL_Card[p_card]);
7644
7645#if defined(NOBUGBUG)
7646 if (RDW_HARPOON((port+hp_intstat)) & XFER_CNT_0)
7647 WRW_HARPOON((port+hp_intstat), XFER_CNT_0);
7648
7649#endif
7650
7651 4656
7652 if (currSCCB->Sccb_XferCnt == 0) { 4657 if (currSCCB->Sccb_XferCnt == 0) {
7653 4658
@@ -7656,9 +4661,9 @@ void phaseDataOut(ULONG port, UCHAR p_card)
7656 (currSCCB->HostStatus == SCCB_COMPLETE)) 4661 (currSCCB->HostStatus == SCCB_COMPLETE))
7657 currSCCB->HostStatus = SCCB_DATA_OVER_RUN; 4662 currSCCB->HostStatus = SCCB_DATA_OVER_RUN;
7658 4663
7659 sxfrp(port,p_card); 4664 FPT_sxfrp(port,p_card);
7660 if (!(RDW_HARPOON((port+hp_intstat)) & (BUS_FREE | RESET))) 4665 if (!(RDW_HARPOON((port+hp_intstat)) & (BUS_FREE | RESET)))
7661 phaseDecode(port,p_card); 4666 FPT_phaseDecode(port,p_card);
7662 } 4667 }
7663} 4668}
7664 4669
@@ -7671,20 +4676,12 @@ void phaseDataOut(ULONG port, UCHAR p_card)
7671 * 4676 *
7672 *---------------------------------------------------------------------*/ 4677 *---------------------------------------------------------------------*/
7673 4678
7674#if defined(OS2) 4679static void FPT_phaseDataIn(ULONG port, UCHAR p_card)
7675void far phaseDataIn(ULONG port, UCHAR p_card)
7676#else
7677#if defined(DOS)
7678void phaseDataIn(USHORT port, UCHAR p_card)
7679#else
7680void phaseDataIn(ULONG port, UCHAR p_card)
7681#endif
7682#endif
7683{ 4680{
7684 4681
7685 PSCCB currSCCB; 4682 PSCCB currSCCB;
7686 4683
7687 currSCCB = BL_Card[p_card].currentSCCB; 4684 currSCCB = FPT_BL_Card[p_card].currentSCCB;
7688 4685
7689 if (currSCCB == NULL) 4686 if (currSCCB == NULL)
7690 { 4687 {
@@ -7702,7 +4699,7 @@ void phaseDataIn(ULONG port, UCHAR p_card)
7702 4699
7703 WR_HARPOON(port+hp_autostart_0, (END_DATA+END_DATA_START)); 4700 WR_HARPOON(port+hp_autostart_0, (END_DATA+END_DATA_START));
7704 4701
7705 dataXferProcessor(port, &BL_Card[p_card]); 4702 FPT_dataXferProcessor(port, &FPT_BL_Card[p_card]);
7706 4703
7707 if (currSCCB->Sccb_XferCnt == 0) { 4704 if (currSCCB->Sccb_XferCnt == 0) {
7708 4705
@@ -7711,9 +4708,9 @@ void phaseDataIn(ULONG port, UCHAR p_card)
7711 (currSCCB->HostStatus == SCCB_COMPLETE)) 4708 (currSCCB->HostStatus == SCCB_COMPLETE))
7712 currSCCB->HostStatus = SCCB_DATA_OVER_RUN; 4709 currSCCB->HostStatus = SCCB_DATA_OVER_RUN;
7713 4710
7714 sxfrp(port,p_card); 4711 FPT_sxfrp(port,p_card);
7715 if (!(RDW_HARPOON((port+hp_intstat)) & (BUS_FREE | RESET))) 4712 if (!(RDW_HARPOON((port+hp_intstat)) & (BUS_FREE | RESET)))
7716 phaseDecode(port,p_card); 4713 FPT_phaseDecode(port,p_card);
7717 4714
7718 } 4715 }
7719} 4716}
@@ -7726,25 +4723,13 @@ void phaseDataIn(ULONG port, UCHAR p_card)
7726 * 4723 *
7727 *---------------------------------------------------------------------*/ 4724 *---------------------------------------------------------------------*/
7728 4725
7729#if defined(OS2) 4726static void FPT_phaseCommand(ULONG p_port, UCHAR p_card)
7730void far phaseCommand(ULONG p_port, UCHAR p_card)
7731#else
7732#if defined(DOS)
7733void phaseCommand(USHORT p_port, UCHAR p_card)
7734#else
7735void phaseCommand(ULONG p_port, UCHAR p_card)
7736#endif
7737#endif
7738{ 4727{
7739 PSCCB currSCCB; 4728 PSCCB currSCCB;
7740#if defined(DOS)
7741 USHORT cdb_reg;
7742#else
7743 ULONG cdb_reg; 4729 ULONG cdb_reg;
7744#endif
7745 UCHAR i; 4730 UCHAR i;
7746 4731
7747 currSCCB = BL_Card[p_card].currentSCCB; 4732 currSCCB = FPT_BL_Card[p_card].currentSCCB;
7748 4733
7749 if (currSCCB->OperationCode == RESET_COMMAND) { 4734 if (currSCCB->OperationCode == RESET_COMMAND) {
7750 4735
@@ -7790,15 +4775,7 @@ void phaseCommand(ULONG p_port, UCHAR p_card)
7790 * 4775 *
7791 *---------------------------------------------------------------------*/ 4776 *---------------------------------------------------------------------*/
7792 4777
7793#if defined(OS2) 4778static void FPT_phaseStatus(ULONG port, UCHAR p_card)
7794void far phaseStatus(ULONG port, UCHAR p_card)
7795#else
7796#if defined(DOS)
7797void phaseStatus(USHORT port, UCHAR p_card)
7798#else
7799void phaseStatus(ULONG port, UCHAR p_card)
7800#endif
7801#endif
7802{ 4779{
7803 /* Start-up the automation to finish off this command and let the 4780 /* Start-up the automation to finish off this command and let the
7804 isr handle the interrupt for command complete when it comes in. 4781 isr handle the interrupt for command complete when it comes in.
@@ -7820,21 +4797,13 @@ void phaseStatus(ULONG port, UCHAR p_card)
7820 * 4797 *
7821 *---------------------------------------------------------------------*/ 4798 *---------------------------------------------------------------------*/
7822 4799
7823#if defined(OS2) 4800static void FPT_phaseMsgOut(ULONG port, UCHAR p_card)
7824void far phaseMsgOut(ULONG port, UCHAR p_card)
7825#else
7826#if defined(DOS)
7827void phaseMsgOut(USHORT port, UCHAR p_card)
7828#else
7829void phaseMsgOut(ULONG port, UCHAR p_card)
7830#endif
7831#endif
7832{ 4801{
7833 UCHAR message,scsiID; 4802 UCHAR message,scsiID;
7834 PSCCB currSCCB; 4803 PSCCB currSCCB;
7835 PSCCBMgr_tar_info currTar_Info; 4804 PSCCBMgr_tar_info currTar_Info;
7836 4805
7837 currSCCB = BL_Card[p_card].currentSCCB; 4806 currSCCB = FPT_BL_Card[p_card].currentSCCB;
7838 4807
7839 if (currSCCB != NULL) { 4808 if (currSCCB != NULL) {
7840 4809
@@ -7845,34 +4814,34 @@ void phaseMsgOut(ULONG port, UCHAR p_card)
7845 { 4814 {
7846 4815
7847 4816
7848 currTar_Info = &sccbMgrTbl[p_card][scsiID]; 4817 currTar_Info = &FPT_sccbMgrTbl[p_card][scsiID];
7849 currTar_Info->TarSyncCtrl = 0; 4818 currTar_Info->TarSyncCtrl = 0;
7850 sssyncv(port, scsiID, NARROW_SCSI,currTar_Info); 4819 FPT_sssyncv(port, scsiID, NARROW_SCSI,currTar_Info);
7851 4820
7852 if (sccbMgrTbl[p_card][scsiID].TarEEValue & EE_SYNC_MASK) 4821 if (FPT_sccbMgrTbl[p_card][scsiID].TarEEValue & EE_SYNC_MASK)
7853 { 4822 {
7854 4823
7855 sccbMgrTbl[p_card][scsiID].TarStatus &= ~TAR_SYNC_MASK; 4824 FPT_sccbMgrTbl[p_card][scsiID].TarStatus &= ~TAR_SYNC_MASK;
7856 4825
7857 } 4826 }
7858 4827
7859 if (sccbMgrTbl[p_card][scsiID].TarEEValue & EE_WIDE_SCSI) 4828 if (FPT_sccbMgrTbl[p_card][scsiID].TarEEValue & EE_WIDE_SCSI)
7860 { 4829 {
7861 4830
7862 sccbMgrTbl[p_card][scsiID].TarStatus &= ~TAR_WIDE_MASK; 4831 FPT_sccbMgrTbl[p_card][scsiID].TarStatus &= ~TAR_WIDE_MASK;
7863 } 4832 }
7864 4833
7865 4834
7866 queueFlushSccb(p_card,SCCB_COMPLETE); 4835 FPT_queueFlushSccb(p_card,SCCB_COMPLETE);
7867 SccbMgrTableInitTarget(p_card,scsiID); 4836 FPT_SccbMgrTableInitTarget(p_card,scsiID);
7868 } 4837 }
7869 else if (currSCCB->Sccb_scsistat == ABORT_ST) 4838 else if (currSCCB->Sccb_scsistat == ABORT_ST)
7870 { 4839 {
7871 currSCCB->HostStatus = SCCB_COMPLETE; 4840 currSCCB->HostStatus = SCCB_COMPLETE;
7872 if(BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] != NULL) 4841 if(FPT_BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] != NULL)
7873 { 4842 {
7874 BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] = NULL; 4843 FPT_BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] = NULL;
7875 sccbMgrTbl[p_card][scsiID].TarTagQ_Cnt--; 4844 FPT_sccbMgrTbl[p_card][scsiID].TarTagQ_Cnt--;
7876 } 4845 }
7877 4846
7878 } 4847 }
@@ -7885,7 +4854,7 @@ void phaseMsgOut(ULONG port, UCHAR p_card)
7885 { 4854 {
7886 currSCCB->Sccb_MGRFlags |= F_DEV_SELECTED; 4855 currSCCB->Sccb_MGRFlags |= F_DEV_SELECTED;
7887 4856
7888 ssel(port,p_card); 4857 FPT_ssel(port,p_card);
7889 return; 4858 return;
7890 } 4859 }
7891 } 4860 }
@@ -7895,7 +4864,7 @@ void phaseMsgOut(ULONG port, UCHAR p_card)
7895 4864
7896 if (message == SMABORT) 4865 if (message == SMABORT)
7897 4866
7898 queueFlushSccb(p_card,SCCB_COMPLETE); 4867 FPT_queueFlushSccb(p_card,SCCB_COMPLETE);
7899 } 4868 }
7900 4869
7901 } 4870 }
@@ -7930,25 +4899,25 @@ void phaseMsgOut(ULONG port, UCHAR p_card)
7930 if (currSCCB != NULL) 4899 if (currSCCB != NULL)
7931 { 4900 {
7932 4901
7933 if((BL_Card[p_card].globalFlags & F_CONLUN_IO) && 4902 if((FPT_BL_Card[p_card].globalFlags & F_CONLUN_IO) &&
7934 ((sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)) 4903 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))
7935 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = FALSE; 4904 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = 0;
7936 else 4905 else
7937 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = FALSE; 4906 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = 0;
7938 4907
7939 queueCmdComplete(&BL_Card[p_card],currSCCB, p_card); 4908 FPT_queueCmdComplete(&FPT_BL_Card[p_card],currSCCB, p_card);
7940 } 4909 }
7941 4910
7942 else 4911 else
7943 { 4912 {
7944 BL_Card[p_card].globalFlags |= F_NEW_SCCB_CMD; 4913 FPT_BL_Card[p_card].globalFlags |= F_NEW_SCCB_CMD;
7945 } 4914 }
7946 } 4915 }
7947 4916
7948 else 4917 else
7949 { 4918 {
7950 4919
7951 sxfrp(port,p_card); 4920 FPT_sxfrp(port,p_card);
7952 } 4921 }
7953 } 4922 }
7954 4923
@@ -7962,7 +4931,7 @@ void phaseMsgOut(ULONG port, UCHAR p_card)
7962 } 4931 }
7963 else 4932 else
7964 { 4933 {
7965 sxfrp(port,p_card); 4934 FPT_sxfrp(port,p_card);
7966 } 4935 }
7967 } 4936 }
7968} 4937}
@@ -7976,25 +4945,17 @@ void phaseMsgOut(ULONG port, UCHAR p_card)
7976 * 4945 *
7977 *---------------------------------------------------------------------*/ 4946 *---------------------------------------------------------------------*/
7978 4947
7979#if defined(OS2) 4948static void FPT_phaseMsgIn(ULONG port, UCHAR p_card)
7980void far phaseMsgIn(ULONG port, UCHAR p_card)
7981#else
7982#if defined(DOS)
7983void phaseMsgIn(USHORT port, UCHAR p_card)
7984#else
7985void phaseMsgIn(ULONG port, UCHAR p_card)
7986#endif
7987#endif
7988{ 4949{
7989 UCHAR message; 4950 UCHAR message;
7990 PSCCB currSCCB; 4951 PSCCB currSCCB;
7991 4952
7992 currSCCB = BL_Card[p_card].currentSCCB; 4953 currSCCB = FPT_BL_Card[p_card].currentSCCB;
7993 4954
7994 if (BL_Card[p_card].globalFlags & F_HOST_XFER_ACT) 4955 if (FPT_BL_Card[p_card].globalFlags & F_HOST_XFER_ACT)
7995 { 4956 {
7996 4957
7997 phaseChkFifo(port, p_card); 4958 FPT_phaseChkFifo(port, p_card);
7998 } 4959 }
7999 4960
8000 message = RD_HARPOON(port+hp_scsidata_0); 4961 message = RD_HARPOON(port+hp_scsidata_0);
@@ -8008,12 +4969,12 @@ void phaseMsgIn(ULONG port, UCHAR p_card)
8008 else 4969 else
8009 { 4970 {
8010 4971
8011 message = sfm(port,currSCCB); 4972 message = FPT_sfm(port,currSCCB);
8012 if (message) 4973 if (message)
8013 { 4974 {
8014 4975
8015 4976
8016 sdecm(message,port,p_card); 4977 FPT_sdecm(message,port,p_card);
8017 4978
8018 } 4979 }
8019 else 4980 else
@@ -8037,19 +4998,11 @@ void phaseMsgIn(ULONG port, UCHAR p_card)
8037 * 4998 *
8038 *---------------------------------------------------------------------*/ 4999 *---------------------------------------------------------------------*/
8039 5000
8040#if defined(OS2) 5001static void FPT_phaseIllegal(ULONG port, UCHAR p_card)
8041void far phaseIllegal(ULONG port, UCHAR p_card)
8042#else
8043#if defined(DOS)
8044void phaseIllegal(USHORT port, UCHAR p_card)
8045#else
8046void phaseIllegal(ULONG port, UCHAR p_card)
8047#endif
8048#endif
8049{ 5002{
8050 PSCCB currSCCB; 5003 PSCCB currSCCB;
8051 5004
8052 currSCCB = BL_Card[p_card].currentSCCB; 5005 currSCCB = FPT_BL_Card[p_card].currentSCCB;
8053 5006
8054 WR_HARPOON(port+hp_scsisig, RD_HARPOON(port+hp_scsisig)); 5007 WR_HARPOON(port+hp_scsisig, RD_HARPOON(port+hp_scsisig));
8055 if (currSCCB != NULL) { 5008 if (currSCCB != NULL) {
@@ -8073,16 +5026,12 @@ void phaseIllegal(ULONG port, UCHAR p_card)
8073 * 5026 *
8074 *---------------------------------------------------------------------*/ 5027 *---------------------------------------------------------------------*/
8075 5028
8076#if defined(DOS) 5029static void FPT_phaseChkFifo(ULONG port, UCHAR p_card)
8077void phaseChkFifo(USHORT port, UCHAR p_card)
8078#else
8079void phaseChkFifo(ULONG port, UCHAR p_card)
8080#endif
8081{ 5030{
8082 ULONG xfercnt; 5031 ULONG xfercnt;
8083 PSCCB currSCCB; 5032 PSCCB currSCCB;
8084 5033
8085 currSCCB = BL_Card[p_card].currentSCCB; 5034 currSCCB = FPT_BL_Card[p_card].currentSCCB;
8086 5035
8087 if (currSCCB->Sccb_scsistat == DATA_IN_ST) 5036 if (currSCCB->Sccb_scsistat == DATA_IN_ST)
8088 { 5037 {
@@ -8104,9 +5053,9 @@ void phaseChkFifo(ULONG port, UCHAR p_card)
8104 WRW_HARPOON((port+hp_intstat), PARITY); 5053 WRW_HARPOON((port+hp_intstat), PARITY);
8105 } 5054 }
8106 5055
8107 hostDataXferAbort(port,p_card,currSCCB); 5056 FPT_hostDataXferAbort(port,p_card,currSCCB);
8108 5057
8109 dataXferProcessor(port, &BL_Card[p_card]); 5058 FPT_dataXferProcessor(port, &FPT_BL_Card[p_card]);
8110 5059
8111 while((!(RD_HARPOON(port+hp_xferstat) & FIFO_EMPTY)) && 5060 while((!(RD_HARPOON(port+hp_xferstat) & FIFO_EMPTY)) &&
8112 (RD_HARPOON(port+hp_ext_status) & BM_CMD_BUSY)) {} 5061 (RD_HARPOON(port+hp_ext_status) & BM_CMD_BUSY)) {}
@@ -8116,22 +5065,7 @@ void phaseChkFifo(ULONG port, UCHAR p_card)
8116 5065
8117 5066
8118 5067
8119#if defined(DOS)
8120 asm { mov dx,port;
8121 add dx,hp_xfercnt_2;
8122 in al,dx;
8123 dec dx;
8124 xor ah,ah;
8125 mov word ptr xfercnt+2,ax;
8126 in al,dx;
8127 dec dx;
8128 mov ah,al;
8129 in al,dx;
8130 mov word ptr xfercnt,ax;
8131 }
8132#else
8133 GET_XFER_CNT(port,xfercnt); 5068 GET_XFER_CNT(port,xfercnt);
8134#endif
8135 5069
8136 5070
8137 WR_HARPOON(port+hp_xfercnt_0, 0x00); 5071 WR_HARPOON(port+hp_xfercnt_0, 0x00);
@@ -8151,7 +5085,7 @@ void phaseChkFifo(ULONG port, UCHAR p_card)
8151 } 5085 }
8152 5086
8153 5087
8154 hostDataXferAbort(port,p_card,currSCCB); 5088 FPT_hostDataXferAbort(port,p_card,currSCCB);
8155 5089
8156 5090
8157 WR_HARPOON(port+hp_fifowrite, 0x00); 5091 WR_HARPOON(port+hp_fifowrite, 0x00);
@@ -8170,15 +5104,11 @@ void phaseChkFifo(ULONG port, UCHAR p_card)
8170 * because of command complete or from a disconnect. 5104 * because of command complete or from a disconnect.
8171 * 5105 *
8172 *---------------------------------------------------------------------*/ 5106 *---------------------------------------------------------------------*/
8173#if defined(DOS) 5107static void FPT_phaseBusFree(ULONG port, UCHAR p_card)
8174void phaseBusFree(USHORT port, UCHAR p_card)
8175#else
8176void phaseBusFree(ULONG port, UCHAR p_card)
8177#endif
8178{ 5108{
8179 PSCCB currSCCB; 5109 PSCCB currSCCB;
8180 5110
8181 currSCCB = BL_Card[p_card].currentSCCB; 5111 currSCCB = FPT_BL_Card[p_card].currentSCCB;
8182 5112
8183 if (currSCCB != NULL) 5113 if (currSCCB != NULL)
8184 { 5114 {
@@ -8189,35 +5119,34 @@ void phaseBusFree(ULONG port, UCHAR p_card)
8189 if (currSCCB->OperationCode == RESET_COMMAND) 5119 if (currSCCB->OperationCode == RESET_COMMAND)
8190 { 5120 {
8191 5121
8192 if((BL_Card[p_card].globalFlags & F_CONLUN_IO) && 5122 if((FPT_BL_Card[p_card].globalFlags & F_CONLUN_IO) &&
8193 ((sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)) 5123 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))
8194 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = FALSE; 5124 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = 0;
8195 else 5125 else
8196 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = FALSE; 5126 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = 0;
8197 5127
8198 queueCmdComplete(&BL_Card[p_card], currSCCB, p_card); 5128 FPT_queueCmdComplete(&FPT_BL_Card[p_card], currSCCB, p_card);
8199 5129
8200 queueSearchSelect(&BL_Card[p_card],p_card); 5130 FPT_queueSearchSelect(&FPT_BL_Card[p_card],p_card);
8201 5131
8202 } 5132 }
8203 5133
8204 else if(currSCCB->Sccb_scsistat == SELECT_SN_ST) 5134 else if(currSCCB->Sccb_scsistat == SELECT_SN_ST)
8205 { 5135 {
8206 sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |= 5136 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |=
8207 (UCHAR)SYNC_SUPPORTED; 5137 (UCHAR)SYNC_SUPPORTED;
8208 sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= ~EE_SYNC_MASK; 5138 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= ~EE_SYNC_MASK;
8209 } 5139 }
8210 5140
8211 else if(currSCCB->Sccb_scsistat == SELECT_WN_ST) 5141 else if(currSCCB->Sccb_scsistat == SELECT_WN_ST)
8212 { 5142 {
8213 sccbMgrTbl[p_card][currSCCB->TargID].TarStatus = 5143 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus =
8214 (sccbMgrTbl[p_card][currSCCB->TargID]. 5144 (FPT_sccbMgrTbl[p_card][currSCCB->TargID].
8215 TarStatus & ~WIDE_ENABLED) | WIDE_NEGOCIATED; 5145 TarStatus & ~WIDE_ENABLED) | WIDE_NEGOCIATED;
8216 5146
8217 sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= ~EE_WIDE_SCSI; 5147 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= ~EE_WIDE_SCSI;
8218 } 5148 }
8219 5149
8220#if !defined(DOS)
8221 else if(currSCCB->Sccb_scsistat == SELECT_Q_ST) 5150 else if(currSCCB->Sccb_scsistat == SELECT_Q_ST)
8222 { 5151 {
8223 /* Make sure this is not a phony BUS_FREE. If we were 5152 /* Make sure this is not a phony BUS_FREE. If we were
@@ -8227,8 +5156,8 @@ void phaseBusFree(ULONG port, UCHAR p_card)
8227 if ((!(RD_HARPOON(port+hp_scsisig) & SCSI_BSY)) || 5156 if ((!(RD_HARPOON(port+hp_scsisig) & SCSI_BSY)) ||
8228 (RDW_HARPOON((port+hp_intstat)) & RSEL)) 5157 (RDW_HARPOON((port+hp_intstat)) & RSEL))
8229 { 5158 {
8230 sccbMgrTbl[p_card][currSCCB->TargID].TarStatus &= ~TAR_TAG_Q_MASK; 5159 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus &= ~TAR_TAG_Q_MASK;
8231 sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |= TAG_Q_REJECT; 5160 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |= TAG_Q_REJECT;
8232 } 5161 }
8233 5162
8234 else 5163 else
@@ -8236,7 +5165,6 @@ void phaseBusFree(ULONG port, UCHAR p_card)
8236 return; 5165 return;
8237 } 5166 }
8238 } 5167 }
8239#endif
8240 5168
8241 else 5169 else
8242 { 5170 {
@@ -8248,18 +5176,18 @@ void phaseBusFree(ULONG port, UCHAR p_card)
8248 currSCCB->HostStatus = SCCB_PHASE_SEQUENCE_FAIL; 5176 currSCCB->HostStatus = SCCB_PHASE_SEQUENCE_FAIL;
8249 } 5177 }
8250 5178
8251 if((BL_Card[p_card].globalFlags & F_CONLUN_IO) && 5179 if((FPT_BL_Card[p_card].globalFlags & F_CONLUN_IO) &&
8252 ((sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)) 5180 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))
8253 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = FALSE; 5181 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = 0;
8254 else 5182 else
8255 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = FALSE; 5183 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = 0;
8256 5184
8257 queueCmdComplete(&BL_Card[p_card], currSCCB, p_card); 5185 FPT_queueCmdComplete(&FPT_BL_Card[p_card], currSCCB, p_card);
8258 return; 5186 return;
8259 } 5187 }
8260 5188
8261 5189
8262 BL_Card[p_card].globalFlags |= F_NEW_SCCB_CMD; 5190 FPT_BL_Card[p_card].globalFlags |= F_NEW_SCCB_CMD;
8263 5191
8264 } /*end if !=null */ 5192 } /*end if !=null */
8265} 5193}
@@ -8267,44 +5195,6 @@ void phaseBusFree(ULONG port, UCHAR p_card)
8267 5195
8268 5196
8269 5197
8270#ident "$Id: automate.c 1.14 1997/01/31 02:11:46 mohan Exp $"
8271/*----------------------------------------------------------------------
8272 *
8273 *
8274 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
8275 *
8276 * This file is available under both the GNU General Public License
8277 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
8278 *
8279 * $Workfile: automate.c $
8280 *
8281 * Description: Functions relating to programming the automation of
8282 * the HARPOON.
8283 *
8284 * $Date: 1997/01/31 02:11:46 $
8285 *
8286 * $Revision: 1.14 $
8287 *
8288 *----------------------------------------------------------------------*/
8289
8290/*#include <globals.h>*/
8291
8292#if (FW_TYPE==_UCB_MGR_)
8293 /*#include <budi.h>*/
8294#endif
8295
8296/*#include <sccbmgr.h>*/
8297/*#include <blx30.h>*/
8298/*#include <target.h>*/
8299/*#include <scsi2.h>*/
8300/*#include <harpoon.h>*/
8301
8302/*
8303extern SCCBCARD BL_Card[MAX_CARDS];
8304extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
8305extern SCCBCARD BL_Card[MAX_CARDS];
8306*/
8307
8308/*--------------------------------------------------------------------- 5198/*---------------------------------------------------------------------
8309 * 5199 *
8310 * Function: Auto Load Default Map 5200 * Function: Auto Load Default Map
@@ -8312,17 +5202,9 @@ extern SCCBCARD BL_Card[MAX_CARDS];
8312 * Description: Load the Automation RAM with the defualt map values. 5202 * Description: Load the Automation RAM with the defualt map values.
8313 * 5203 *
8314 *---------------------------------------------------------------------*/ 5204 *---------------------------------------------------------------------*/
8315#if defined(DOS) 5205static void FPT_autoLoadDefaultMap(ULONG p_port)
8316void autoLoadDefaultMap(USHORT p_port)
8317#else
8318void autoLoadDefaultMap(ULONG p_port)
8319#endif
8320{ 5206{
8321#if defined(DOS)
8322 USHORT map_addr;
8323#else
8324 ULONG map_addr; 5207 ULONG map_addr;
8325#endif
8326 5208
8327 ARAM_ACCESS(p_port); 5209 ARAM_ACCESS(p_port);
8328 map_addr = p_port + hp_aramBase; 5210 map_addr = p_port + hp_aramBase;
@@ -8428,86 +5310,82 @@ void autoLoadDefaultMap(ULONG p_port)
8428 * 5310 *
8429 *---------------------------------------------------------------------*/ 5311 *---------------------------------------------------------------------*/
8430 5312
8431#if defined(DOS) 5313static void FPT_autoCmdCmplt(ULONG p_port, UCHAR p_card)
8432void autoCmdCmplt(USHORT p_port, UCHAR p_card)
8433#else
8434void autoCmdCmplt(ULONG p_port, UCHAR p_card)
8435#endif
8436{ 5314{
8437 PSCCB currSCCB; 5315 PSCCB currSCCB;
8438 UCHAR status_byte; 5316 UCHAR status_byte;
8439 5317
8440 currSCCB = BL_Card[p_card].currentSCCB; 5318 currSCCB = FPT_BL_Card[p_card].currentSCCB;
8441 5319
8442 status_byte = RD_HARPOON(p_port+hp_gp_reg_0); 5320 status_byte = RD_HARPOON(p_port+hp_gp_reg_0);
8443 5321
8444 sccbMgrTbl[p_card][currSCCB->TargID].TarLUN_CA = FALSE; 5322 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUN_CA = 0;
8445 5323
8446 if (status_byte != SSGOOD) { 5324 if (status_byte != SSGOOD) {
8447 5325
8448 if (status_byte == SSQ_FULL) { 5326 if (status_byte == SSQ_FULL) {
8449 5327
8450 5328
8451 if(((BL_Card[p_card].globalFlags & F_CONLUN_IO) && 5329 if(((FPT_BL_Card[p_card].globalFlags & F_CONLUN_IO) &&
8452 ((sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))) 5330 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)))
8453 { 5331 {
8454 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = TRUE; 5332 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = 1;
8455 if(BL_Card[p_card].discQCount != 0) 5333 if(FPT_BL_Card[p_card].discQCount != 0)
8456 BL_Card[p_card].discQCount--; 5334 FPT_BL_Card[p_card].discQCount--;
8457 BL_Card[p_card].discQ_Tbl[sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[currSCCB->Lun]] = NULL; 5335 FPT_BL_Card[p_card].discQ_Tbl[FPT_sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[currSCCB->Lun]] = NULL;
8458 } 5336 }
8459 else 5337 else
8460 { 5338 {
8461 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = TRUE; 5339 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = 1;
8462 if(currSCCB->Sccb_tag) 5340 if(currSCCB->Sccb_tag)
8463 { 5341 {
8464 if(BL_Card[p_card].discQCount != 0) 5342 if(FPT_BL_Card[p_card].discQCount != 0)
8465 BL_Card[p_card].discQCount--; 5343 FPT_BL_Card[p_card].discQCount--;
8466 BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] = NULL; 5344 FPT_BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] = NULL;
8467 }else 5345 }else
8468 { 5346 {
8469 if(BL_Card[p_card].discQCount != 0) 5347 if(FPT_BL_Card[p_card].discQCount != 0)
8470 BL_Card[p_card].discQCount--; 5348 FPT_BL_Card[p_card].discQCount--;
8471 BL_Card[p_card].discQ_Tbl[sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[0]] = NULL; 5349 FPT_BL_Card[p_card].discQ_Tbl[FPT_sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[0]] = NULL;
8472 } 5350 }
8473 } 5351 }
8474 5352
8475 currSCCB->Sccb_MGRFlags |= F_STATUSLOADED; 5353 currSCCB->Sccb_MGRFlags |= F_STATUSLOADED;
8476 5354
8477 queueSelectFail(&BL_Card[p_card],p_card); 5355 FPT_queueSelectFail(&FPT_BL_Card[p_card],p_card);
8478 5356
8479 return; 5357 return;
8480 } 5358 }
8481 5359
8482 if(currSCCB->Sccb_scsistat == SELECT_SN_ST) 5360 if(currSCCB->Sccb_scsistat == SELECT_SN_ST)
8483 { 5361 {
8484 sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |= 5362 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus |=
8485 (UCHAR)SYNC_SUPPORTED; 5363 (UCHAR)SYNC_SUPPORTED;
8486 5364
8487 sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= ~EE_SYNC_MASK; 5365 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= ~EE_SYNC_MASK;
8488 BL_Card[p_card].globalFlags |= F_NEW_SCCB_CMD; 5366 FPT_BL_Card[p_card].globalFlags |= F_NEW_SCCB_CMD;
8489 5367
8490 if(((BL_Card[p_card].globalFlags & F_CONLUN_IO) && 5368 if(((FPT_BL_Card[p_card].globalFlags & F_CONLUN_IO) &&
8491 ((sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))) 5369 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)))
8492 { 5370 {
8493 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = TRUE; 5371 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = 1;
8494 if(BL_Card[p_card].discQCount != 0) 5372 if(FPT_BL_Card[p_card].discQCount != 0)
8495 BL_Card[p_card].discQCount--; 5373 FPT_BL_Card[p_card].discQCount--;
8496 BL_Card[p_card].discQ_Tbl[sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[currSCCB->Lun]] = NULL; 5374 FPT_BL_Card[p_card].discQ_Tbl[FPT_sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[currSCCB->Lun]] = NULL;
8497 } 5375 }
8498 else 5376 else
8499 { 5377 {
8500 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = TRUE; 5378 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = 1;
8501 if(currSCCB->Sccb_tag) 5379 if(currSCCB->Sccb_tag)
8502 { 5380 {
8503 if(BL_Card[p_card].discQCount != 0) 5381 if(FPT_BL_Card[p_card].discQCount != 0)
8504 BL_Card[p_card].discQCount--; 5382 FPT_BL_Card[p_card].discQCount--;
8505 BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] = NULL; 5383 FPT_BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] = NULL;
8506 }else 5384 }else
8507 { 5385 {
8508 if(BL_Card[p_card].discQCount != 0) 5386 if(FPT_BL_Card[p_card].discQCount != 0)
8509 BL_Card[p_card].discQCount--; 5387 FPT_BL_Card[p_card].discQCount--;
8510 BL_Card[p_card].discQ_Tbl[sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[0]] = NULL; 5388 FPT_BL_Card[p_card].discQ_Tbl[FPT_sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[0]] = NULL;
8511 } 5389 }
8512 } 5390 }
8513 return; 5391 return;
@@ -8517,34 +5395,34 @@ void autoCmdCmplt(ULONG p_port, UCHAR p_card)
8517 if(currSCCB->Sccb_scsistat == SELECT_WN_ST) 5395 if(currSCCB->Sccb_scsistat == SELECT_WN_ST)
8518 { 5396 {
8519 5397
8520 sccbMgrTbl[p_card][currSCCB->TargID].TarStatus = 5398 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus =
8521 (sccbMgrTbl[p_card][currSCCB->TargID]. 5399 (FPT_sccbMgrTbl[p_card][currSCCB->TargID].
8522 TarStatus & ~WIDE_ENABLED) | WIDE_NEGOCIATED; 5400 TarStatus & ~WIDE_ENABLED) | WIDE_NEGOCIATED;
8523 5401
8524 sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= ~EE_WIDE_SCSI; 5402 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue &= ~EE_WIDE_SCSI;
8525 BL_Card[p_card].globalFlags |= F_NEW_SCCB_CMD; 5403 FPT_BL_Card[p_card].globalFlags |= F_NEW_SCCB_CMD;
8526 5404
8527 if(((BL_Card[p_card].globalFlags & F_CONLUN_IO) && 5405 if(((FPT_BL_Card[p_card].globalFlags & F_CONLUN_IO) &&
8528 ((sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))) 5406 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)))
8529 { 5407 {
8530 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = TRUE; 5408 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = 1;
8531 if(BL_Card[p_card].discQCount != 0) 5409 if(FPT_BL_Card[p_card].discQCount != 0)
8532 BL_Card[p_card].discQCount--; 5410 FPT_BL_Card[p_card].discQCount--;
8533 BL_Card[p_card].discQ_Tbl[sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[currSCCB->Lun]] = NULL; 5411 FPT_BL_Card[p_card].discQ_Tbl[FPT_sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[currSCCB->Lun]] = NULL;
8534 } 5412 }
8535 else 5413 else
8536 { 5414 {
8537 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = TRUE; 5415 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = 1;
8538 if(currSCCB->Sccb_tag) 5416 if(currSCCB->Sccb_tag)
8539 { 5417 {
8540 if(BL_Card[p_card].discQCount != 0) 5418 if(FPT_BL_Card[p_card].discQCount != 0)
8541 BL_Card[p_card].discQCount--; 5419 FPT_BL_Card[p_card].discQCount--;
8542 BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] = NULL; 5420 FPT_BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] = NULL;
8543 }else 5421 }else
8544 { 5422 {
8545 if(BL_Card[p_card].discQCount != 0) 5423 if(FPT_BL_Card[p_card].discQCount != 0)
8546 BL_Card[p_card].discQCount--; 5424 FPT_BL_Card[p_card].discQCount--;
8547 BL_Card[p_card].discQ_Tbl[sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[0]] = NULL; 5425 FPT_BL_Card[p_card].discQ_Tbl[FPT_sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[0]] = NULL;
8548 } 5426 }
8549 } 5427 }
8550 return; 5428 return;
@@ -8553,15 +5431,15 @@ void autoCmdCmplt(ULONG p_port, UCHAR p_card)
8553 5431
8554 if (status_byte == SSCHECK) 5432 if (status_byte == SSCHECK)
8555 { 5433 {
8556 if(BL_Card[p_card].globalFlags & F_DO_RENEGO) 5434 if(FPT_BL_Card[p_card].globalFlags & F_DO_RENEGO)
8557 { 5435 {
8558 if (sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue & EE_SYNC_MASK) 5436 if (FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue & EE_SYNC_MASK)
8559 { 5437 {
8560 sccbMgrTbl[p_card][currSCCB->TargID].TarStatus &= ~TAR_SYNC_MASK; 5438 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus &= ~TAR_SYNC_MASK;
8561 } 5439 }
8562 if (sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue & EE_WIDE_SCSI) 5440 if (FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarEEValue & EE_WIDE_SCSI)
8563 { 5441 {
8564 sccbMgrTbl[p_card][currSCCB->TargID].TarStatus &= ~TAR_WIDE_MASK; 5442 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus &= ~TAR_WIDE_MASK;
8565 } 5443 }
8566 } 5444 }
8567 } 5445 }
@@ -8573,135 +5451,61 @@ void autoCmdCmplt(ULONG p_port, UCHAR p_card)
8573 5451
8574 if (status_byte == SSCHECK) { 5452 if (status_byte == SSCHECK) {
8575 5453
8576 sccbMgrTbl[p_card][currSCCB->TargID].TarLUN_CA 5454 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUN_CA
8577 = TRUE; 5455 = 1;
8578 5456
8579 5457
8580#if (FW_TYPE==_SCCB_MGR_)
8581 if (currSCCB->RequestSenseLength != NO_AUTO_REQUEST_SENSE) { 5458 if (currSCCB->RequestSenseLength != NO_AUTO_REQUEST_SENSE) {
8582 5459
8583 if (currSCCB->RequestSenseLength == 0) 5460 if (currSCCB->RequestSenseLength == 0)
8584 currSCCB->RequestSenseLength = 14; 5461 currSCCB->RequestSenseLength = 14;
8585 5462
8586 ssenss(&BL_Card[p_card]); 5463 FPT_ssenss(&FPT_BL_Card[p_card]);
8587 BL_Card[p_card].globalFlags |= F_NEW_SCCB_CMD; 5464 FPT_BL_Card[p_card].globalFlags |= F_NEW_SCCB_CMD;
8588 5465
8589 if(((BL_Card[p_card].globalFlags & F_CONLUN_IO) && 5466 if(((FPT_BL_Card[p_card].globalFlags & F_CONLUN_IO) &&
8590 ((sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))) 5467 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)))
8591 { 5468 {
8592 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = TRUE; 5469 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = 1;
8593 if(BL_Card[p_card].discQCount != 0) 5470 if(FPT_BL_Card[p_card].discQCount != 0)
8594 BL_Card[p_card].discQCount--; 5471 FPT_BL_Card[p_card].discQCount--;
8595 BL_Card[p_card].discQ_Tbl[sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[currSCCB->Lun]] = NULL; 5472 FPT_BL_Card[p_card].discQ_Tbl[FPT_sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[currSCCB->Lun]] = NULL;
8596 } 5473 }
8597 else 5474 else
8598 { 5475 {
8599 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = TRUE; 5476 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = 1;
8600 if(currSCCB->Sccb_tag) 5477 if(currSCCB->Sccb_tag)
8601 { 5478 {
8602 if(BL_Card[p_card].discQCount != 0) 5479 if(FPT_BL_Card[p_card].discQCount != 0)
8603 BL_Card[p_card].discQCount--; 5480 FPT_BL_Card[p_card].discQCount--;
8604 BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] = NULL; 5481 FPT_BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] = NULL;
8605 }else 5482 }else
8606 { 5483 {
8607 if(BL_Card[p_card].discQCount != 0) 5484 if(FPT_BL_Card[p_card].discQCount != 0)
8608 BL_Card[p_card].discQCount--; 5485 FPT_BL_Card[p_card].discQCount--;
8609 BL_Card[p_card].discQ_Tbl[sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[0]] = NULL; 5486 FPT_BL_Card[p_card].discQ_Tbl[FPT_sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[0]] = NULL;
8610 } 5487 }
8611 } 5488 }
8612 return; 5489 return;
8613 } 5490 }
8614#else
8615 if ((!(currSCCB->Sccb_ucb_ptr->UCB_opcode & OPC_NO_AUTO_SENSE)) &&
8616 (currSCCB->RequestSenseLength))
8617 {
8618 ssenss(&BL_Card[p_card]);
8619 BL_Card[p_card].globalFlags |= F_NEW_SCCB_CMD;
8620
8621 if(((BL_Card[p_card].globalFlags & F_CONLUN_IO) &&
8622 ((sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)))
8623 {
8624 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = TRUE;
8625 if(BL_Card[p_card].discQCount != 0)
8626 BL_Card[p_card].discQCount--;
8627 BL_Card[p_card].discQ_Tbl[sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[currSCCB->Lun]] = NULL;
8628 }
8629 else
8630 {
8631 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = TRUE;
8632 if(currSCCB->Sccb_tag)
8633 {
8634 if(BL_Card[p_card].discQCount != 0)
8635 BL_Card[p_card].discQCount--;
8636 BL_Card[p_card].discQ_Tbl[currSCCB->Sccb_tag] = NULL;
8637 }else
8638 {
8639 if(BL_Card[p_card].discQCount != 0)
8640 BL_Card[p_card].discQCount--;
8641 BL_Card[p_card].discQ_Tbl[sccbMgrTbl[p_card][currSCCB->TargID].LunDiscQ_Idx[0]] = NULL;
8642 }
8643 }
8644 return;
8645 }
8646
8647#endif
8648 } 5491 }
8649 } 5492 }
8650 } 5493 }
8651 5494
8652 5495
8653 if((BL_Card[p_card].globalFlags & F_CONLUN_IO) && 5496 if((FPT_BL_Card[p_card].globalFlags & F_CONLUN_IO) &&
8654 ((sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)) 5497 ((FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))
8655 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = FALSE; 5498 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[currSCCB->Lun] = 0;
8656 else 5499 else
8657 sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = FALSE; 5500 FPT_sccbMgrTbl[p_card][currSCCB->TargID].TarLUNBusy[0] = 0;
8658 5501
8659 5502
8660 queueCmdComplete(&BL_Card[p_card], currSCCB, p_card); 5503 FPT_queueCmdComplete(&FPT_BL_Card[p_card], currSCCB, p_card);
8661} 5504}
8662#ident "$Id: busmstr.c 1.8 1997/01/31 02:10:27 mohan Exp $"
8663/*----------------------------------------------------------------------
8664 *
8665 *
8666 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
8667 *
8668 * This file is available under both the GNU General Public License
8669 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
8670 *
8671 * $Workfile: busmstr.c $
8672 *
8673 * Description: Functions to start, stop, and abort BusMaster operations.
8674 *
8675 * $Date: 1997/01/31 02:10:27 $
8676 *
8677 * $Revision: 1.8 $
8678 *
8679 *----------------------------------------------------------------------*/
8680
8681/*#include <globals.h>*/
8682
8683#if (FW_TYPE==_UCB_MGR_)
8684 /*#include <budi.h>*/
8685#endif
8686
8687/*#include <sccbmgr.h>*/
8688/*#include <blx30.h>*/
8689/*#include <target.h>*/
8690/*#include <scsi2.h>*/
8691/*#include <harpoon.h>*/
8692
8693
8694/*
8695extern SCCBCARD BL_Card[MAX_CARDS];
8696extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
8697*/
8698 5505
8699#define SHORT_WAIT 0x0000000F 5506#define SHORT_WAIT 0x0000000F
8700#define LONG_WAIT 0x0000FFFFL 5507#define LONG_WAIT 0x0000FFFFL
8701 5508
8702#if defined(BUGBUG)
8703void Debug_Load(UCHAR p_card, UCHAR p_bug_data);
8704#endif
8705 5509
8706/*--------------------------------------------------------------------- 5510/*---------------------------------------------------------------------
8707 * 5511 *
@@ -8721,11 +5525,7 @@ void Debug_Load(UCHAR p_card, UCHAR p_bug_data);
8721 * 5525 *
8722 *---------------------------------------------------------------------*/ 5526 *---------------------------------------------------------------------*/
8723 5527
8724#if defined(DOS) 5528static void FPT_dataXferProcessor(ULONG port, PSCCBcard pCurrCard)
8725void dataXferProcessor(USHORT port, PSCCBcard pCurrCard)
8726#else
8727void dataXferProcessor(ULONG port, PSCCBcard pCurrCard)
8728#endif
8729{ 5529{
8730 PSCCB currSCCB; 5530 PSCCB currSCCB;
8731 5531
@@ -8741,7 +5541,7 @@ void dataXferProcessor(ULONG port, PSCCBcard pCurrCard)
8741 } 5541 }
8742 pCurrCard->globalFlags |= F_HOST_XFER_ACT; 5542 pCurrCard->globalFlags |= F_HOST_XFER_ACT;
8743 5543
8744 busMstrSGDataXferStart(port, currSCCB); 5544 FPT_busMstrSGDataXferStart(port, currSCCB);
8745 } 5545 }
8746 5546
8747 else 5547 else
@@ -8750,7 +5550,7 @@ void dataXferProcessor(ULONG port, PSCCBcard pCurrCard)
8750 { 5550 {
8751 pCurrCard->globalFlags |= F_HOST_XFER_ACT; 5551 pCurrCard->globalFlags |= F_HOST_XFER_ACT;
8752 5552
8753 busMstrDataXferStart(port, currSCCB); 5553 FPT_busMstrDataXferStart(port, currSCCB);
8754 } 5554 }
8755 } 5555 }
8756} 5556}
@@ -8763,20 +5563,12 @@ void dataXferProcessor(ULONG port, PSCCBcard pCurrCard)
8763 * Description: 5563 * Description:
8764 * 5564 *
8765 *---------------------------------------------------------------------*/ 5565 *---------------------------------------------------------------------*/
8766#if defined(DOS) 5566static void FPT_busMstrSGDataXferStart(ULONG p_port, PSCCB pcurrSCCB)
8767void busMstrSGDataXferStart(USHORT p_port, PSCCB pcurrSCCB)
8768#else
8769void busMstrSGDataXferStart(ULONG p_port, PSCCB pcurrSCCB)
8770#endif
8771{ 5567{
8772 ULONG count,addr,tmpSGCnt; 5568 ULONG count,addr,tmpSGCnt;
8773 UINT sg_index; 5569 UINT sg_index;
8774 UCHAR sg_count, i; 5570 UCHAR sg_count, i;
8775#if defined(DOS)
8776 USHORT reg_offset;
8777#else
8778 ULONG reg_offset; 5571 ULONG reg_offset;
8779#endif
8780 5572
8781 5573
8782 if (pcurrSCCB->Sccb_XferState & F_HOST_XFER_DIR) { 5574 if (pcurrSCCB->Sccb_XferState & F_HOST_XFER_DIR) {
@@ -8802,17 +5594,6 @@ void busMstrSGDataXferStart(ULONG p_port, PSCCB pcurrSCCB)
8802 while ((sg_count < (UCHAR)SG_BUF_CNT) && 5594 while ((sg_count < (UCHAR)SG_BUF_CNT) &&
8803 ((ULONG)(sg_index * (UINT)SG_ELEMENT_SIZE) < pcurrSCCB->DataLength) ) { 5595 ((ULONG)(sg_index * (UINT)SG_ELEMENT_SIZE) < pcurrSCCB->DataLength) ) {
8804 5596
8805#if defined(COMPILER_16_BIT) && !defined(DOS)
8806 tmpSGCnt += *(((ULONG far *)pcurrSCCB->DataPointer)+
8807 (sg_index * 2));
8808
8809 count |= *(((ULONG far *)pcurrSCCB->DataPointer)+
8810 (sg_index * 2));
8811
8812 addr = *(((ULONG far *)pcurrSCCB->DataPointer)+
8813 ((sg_index * 2) + 1));
8814
8815#else
8816 tmpSGCnt += *(((ULONG *)pcurrSCCB->DataPointer)+ 5597 tmpSGCnt += *(((ULONG *)pcurrSCCB->DataPointer)+
8817 (sg_index * 2)); 5598 (sg_index * 2));
8818 5599
@@ -8821,7 +5602,6 @@ void busMstrSGDataXferStart(ULONG p_port, PSCCB pcurrSCCB)
8821 5602
8822 addr = *(((ULONG *)pcurrSCCB->DataPointer)+ 5603 addr = *(((ULONG *)pcurrSCCB->DataPointer)+
8823 ((sg_index * 2) + 1)); 5604 ((sg_index * 2) + 1));
8824#endif
8825 5605
8826 5606
8827 if ((!sg_count) && (pcurrSCCB->Sccb_SGoffset)) { 5607 if ((!sg_count) && (pcurrSCCB->Sccb_SGoffset)) {
@@ -8888,11 +5668,7 @@ void busMstrSGDataXferStart(ULONG p_port, PSCCB pcurrSCCB)
8888 * Description: 5668 * Description:
8889 * 5669 *
8890 *---------------------------------------------------------------------*/ 5670 *---------------------------------------------------------------------*/
8891#if defined(DOS) 5671static void FPT_busMstrDataXferStart(ULONG p_port, PSCCB pcurrSCCB)
8892void busMstrDataXferStart(USHORT p_port, PSCCB pcurrSCCB)
8893#else
8894void busMstrDataXferStart(ULONG p_port, PSCCB pcurrSCCB)
8895#endif
8896{ 5672{
8897 ULONG addr,count; 5673 ULONG addr,count;
8898 5674
@@ -8909,37 +5685,7 @@ void busMstrDataXferStart(ULONG p_port, PSCCB pcurrSCCB)
8909 5685
8910 } 5686 }
8911 5687
8912#if defined(DOS)
8913 asm { mov dx,p_port;
8914 mov ax,word ptr count;
8915 add dx,hp_xfer_cnt_lo;
8916 out dx,al;
8917 inc dx;
8918 xchg ah,al
8919 out dx,al;
8920 inc dx;
8921 mov ax,word ptr count+2;
8922 out dx,al;
8923 inc dx;
8924 inc dx;
8925 mov ax,word ptr addr;
8926 out dx,al;
8927 inc dx;
8928 xchg ah,al
8929 out dx,al;
8930 inc dx;
8931 mov ax,word ptr addr+2;
8932 out dx,al;
8933 inc dx;
8934 xchg ah,al
8935 out dx,al;
8936 }
8937
8938 WR_HARP32(p_port,hp_xfercnt_0,count);
8939
8940#else
8941 HP_SETUP_ADDR_CNT(p_port,addr,count); 5688 HP_SETUP_ADDR_CNT(p_port,addr,count);
8942#endif
8943 5689
8944 5690
8945 if (pcurrSCCB->Sccb_XferState & F_HOST_XFER_DIR) { 5691 if (pcurrSCCB->Sccb_XferState & F_HOST_XFER_DIR) {
@@ -8975,11 +5721,7 @@ void busMstrDataXferStart(ULONG p_port, PSCCB pcurrSCCB)
8975 * command busy is also time out, it'll just give up. 5721 * command busy is also time out, it'll just give up.
8976 * 5722 *
8977 *---------------------------------------------------------------------*/ 5723 *---------------------------------------------------------------------*/
8978#if defined(DOS) 5724static UCHAR FPT_busMstrTimeOut(ULONG p_port)
8979UCHAR busMstrTimeOut(USHORT p_port)
8980#else
8981UCHAR busMstrTimeOut(ULONG p_port)
8982#endif
8983{ 5725{
8984 ULONG timeout; 5726 ULONG timeout;
8985 5727
@@ -9001,11 +5743,11 @@ UCHAR busMstrTimeOut(ULONG p_port)
9001 RD_HARPOON(p_port+hp_int_status); /*Clear command complete */ 5743 RD_HARPOON(p_port+hp_int_status); /*Clear command complete */
9002 5744
9003 if (RD_HARPOON(p_port+hp_ext_status) & BM_CMD_BUSY) { 5745 if (RD_HARPOON(p_port+hp_ext_status) & BM_CMD_BUSY) {
9004 return(TRUE); 5746 return(1);
9005 } 5747 }
9006 5748
9007 else { 5749 else {
9008 return(FALSE); 5750 return(0);
9009 } 5751 }
9010} 5752}
9011 5753
@@ -9017,18 +5759,14 @@ UCHAR busMstrTimeOut(ULONG p_port)
9017 * Description: Abort any in progress transfer. 5759 * Description: Abort any in progress transfer.
9018 * 5760 *
9019 *---------------------------------------------------------------------*/ 5761 *---------------------------------------------------------------------*/
9020#if defined(DOS) 5762static void FPT_hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
9021void hostDataXferAbort(USHORT port, UCHAR p_card, PSCCB pCurrSCCB)
9022#else
9023void hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
9024#endif
9025{ 5763{
9026 5764
9027 ULONG timeout; 5765 ULONG timeout;
9028 ULONG remain_cnt; 5766 ULONG remain_cnt;
9029 UINT sg_ptr; 5767 UINT sg_ptr;
9030 5768
9031 BL_Card[p_card].globalFlags &= ~F_HOST_XFER_ACT; 5769 FPT_BL_Card[p_card].globalFlags &= ~F_HOST_XFER_ACT;
9032 5770
9033 if (pCurrSCCB->Sccb_XferState & F_AUTO_SENSE) { 5771 if (pCurrSCCB->Sccb_XferState & F_AUTO_SENSE) {
9034 5772
@@ -9044,7 +5782,7 @@ void hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
9044 5782
9045 if (RD_HARPOON(port+hp_ext_status) & BM_CMD_BUSY) { 5783 if (RD_HARPOON(port+hp_ext_status) & BM_CMD_BUSY) {
9046 5784
9047 if (busMstrTimeOut(port)) { 5785 if (FPT_busMstrTimeOut(port)) {
9048 5786
9049 if (pCurrSCCB->HostStatus == 0x00) 5787 if (pCurrSCCB->HostStatus == 0x00)
9050 5788
@@ -9060,10 +5798,6 @@ void hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
9060 5798
9061 { 5799 {
9062 pCurrSCCB->HostStatus = SCCB_BM_ERR; 5800 pCurrSCCB->HostStatus = SCCB_BM_ERR;
9063#if defined(BUGBUG)
9064 WR_HARPOON(port+hp_dual_addr_lo,
9065 RD_HARPOON(port+hp_ext_status));
9066#endif
9067 } 5801 }
9068 } 5802 }
9069 } 5803 }
@@ -9092,22 +5826,12 @@ void hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
9092 5826
9093 sg_ptr--; 5827 sg_ptr--;
9094 5828
9095#if defined(COMPILER_16_BIT) && !defined(DOS)
9096 if (remain_cnt > (ULONG)(*(((ULONG far *)pCurrSCCB->
9097 DataPointer) + (sg_ptr * 2)))) {
9098
9099 remain_cnt -= (ULONG)(*(((ULONG far *)pCurrSCCB->
9100 DataPointer) + (sg_ptr * 2)));
9101 }
9102
9103#else
9104 if (remain_cnt > (ULONG)(*(((ULONG *)pCurrSCCB-> 5829 if (remain_cnt > (ULONG)(*(((ULONG *)pCurrSCCB->
9105 DataPointer) + (sg_ptr * 2)))) { 5830 DataPointer) + (sg_ptr * 2)))) {
9106 5831
9107 remain_cnt -= (ULONG)(*(((ULONG *)pCurrSCCB-> 5832 remain_cnt -= (ULONG)(*(((ULONG *)pCurrSCCB->
9108 DataPointer) + (sg_ptr * 2))); 5833 DataPointer) + (sg_ptr * 2)));
9109 } 5834 }
9110#endif
9111 5835
9112 else { 5836 else {
9113 5837
@@ -9147,7 +5871,7 @@ void hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
9147 5871
9148 if (RD_HARPOON(port+hp_ext_status) & BM_CMD_BUSY) { 5872 if (RD_HARPOON(port+hp_ext_status) & BM_CMD_BUSY) {
9149 5873
9150 busMstrTimeOut(port); 5874 FPT_busMstrTimeOut(port);
9151 } 5875 }
9152 5876
9153 else { 5877 else {
@@ -9159,10 +5883,6 @@ void hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
9159 if (pCurrSCCB->HostStatus == 0x00) { 5883 if (pCurrSCCB->HostStatus == 0x00) {
9160 5884
9161 pCurrSCCB->HostStatus = SCCB_BM_ERR; 5885 pCurrSCCB->HostStatus = SCCB_BM_ERR;
9162#if defined(BUGBUG)
9163 WR_HARPOON(port+hp_dual_addr_lo,
9164 RD_HARPOON(port+hp_ext_status));
9165#endif
9166 } 5886 }
9167 } 5887 }
9168 } 5888 }
@@ -9203,7 +5923,7 @@ void hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
9203 pCurrSCCB->HostStatus = SCCB_BM_ERR; 5923 pCurrSCCB->HostStatus = SCCB_BM_ERR;
9204 } 5924 }
9205 5925
9206 busMstrTimeOut(port); 5926 FPT_busMstrTimeOut(port);
9207 } 5927 }
9208 } 5928 }
9209 5929
@@ -9214,10 +5934,6 @@ void hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
9214 if (pCurrSCCB->HostStatus == 0x00) { 5934 if (pCurrSCCB->HostStatus == 0x00) {
9215 5935
9216 pCurrSCCB->HostStatus = SCCB_BM_ERR; 5936 pCurrSCCB->HostStatus = SCCB_BM_ERR;
9217#if defined(BUGBUG)
9218 WR_HARPOON(port+hp_dual_addr_lo,
9219 RD_HARPOON(port+hp_ext_status));
9220#endif
9221 } 5937 }
9222 } 5938 }
9223 } 5939 }
@@ -9241,7 +5957,7 @@ void hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
9241 pCurrSCCB->HostStatus = SCCB_BM_ERR; 5957 pCurrSCCB->HostStatus = SCCB_BM_ERR;
9242 } 5958 }
9243 5959
9244 busMstrTimeOut(port); 5960 FPT_busMstrTimeOut(port);
9245 } 5961 }
9246 } 5962 }
9247 5963
@@ -9253,10 +5969,6 @@ void hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
9253 if (pCurrSCCB->HostStatus == 0x00) { 5969 if (pCurrSCCB->HostStatus == 0x00) {
9254 5970
9255 pCurrSCCB->HostStatus = SCCB_BM_ERR; 5971 pCurrSCCB->HostStatus = SCCB_BM_ERR;
9256#if defined(BUGBUG)
9257 WR_HARPOON(port+hp_dual_addr_lo,
9258 RD_HARPOON(port+hp_ext_status));
9259#endif
9260 } 5972 }
9261 } 5973 }
9262 5974
@@ -9305,15 +6017,11 @@ void hostDataXferAbort(ULONG port, UCHAR p_card, PSCCB pCurrSCCB)
9305 * pointers message. 6017 * pointers message.
9306 * 6018 *
9307 *---------------------------------------------------------------------*/ 6019 *---------------------------------------------------------------------*/
9308void hostDataXferRestart(PSCCB currSCCB) 6020static void FPT_hostDataXferRestart(PSCCB currSCCB)
9309{ 6021{
9310 ULONG data_count; 6022 ULONG data_count;
9311 UINT sg_index; 6023 UINT sg_index;
9312#if defined(COMPILER_16_BIT) && !defined(DOS)
9313 ULONG far *sg_ptr;
9314#else
9315 ULONG *sg_ptr; 6024 ULONG *sg_ptr;
9316#endif
9317 6025
9318 if (currSCCB->Sccb_XferState & F_SG_XFER) { 6026 if (currSCCB->Sccb_XferState & F_SG_XFER) {
9319 6027
@@ -9322,11 +6030,7 @@ void hostDataXferRestart(PSCCB currSCCB)
9322 sg_index = 0xffff; /*Index by long words into sg list. */ 6030 sg_index = 0xffff; /*Index by long words into sg list. */
9323 data_count = 0; /*Running count of SG xfer counts. */ 6031 data_count = 0; /*Running count of SG xfer counts. */
9324 6032
9325#if defined(COMPILER_16_BIT) && !defined(DOS)
9326 sg_ptr = (ULONG far *)currSCCB->DataPointer;
9327#else
9328 sg_ptr = (ULONG *)currSCCB->DataPointer; 6033 sg_ptr = (ULONG *)currSCCB->DataPointer;
9329#endif
9330 6034
9331 while (data_count < currSCCB->Sccb_ATC) { 6035 while (data_count < currSCCB->Sccb_ATC) {
9332 6036
@@ -9351,78 +6055,28 @@ void hostDataXferRestart(PSCCB currSCCB)
9351 currSCCB->Sccb_XferCnt = currSCCB->DataLength - currSCCB->Sccb_ATC; 6055 currSCCB->Sccb_XferCnt = currSCCB->DataLength - currSCCB->Sccb_ATC;
9352 } 6056 }
9353} 6057}
9354#ident "$Id: scam.c 1.17 1997/03/20 23:49:37 mohan Exp $"
9355/*----------------------------------------------------------------------
9356 *
9357 *
9358 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
9359 *
9360 * This file is available under both the GNU General Public License
9361 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
9362 *
9363 * $Workfile: scam.c $
9364 *
9365 * Description: Functions relating to handling of the SCAM selection
9366 * and the determination of the SCSI IDs to be assigned
9367 * to all perspective SCSI targets.
9368 *
9369 * $Date: 1997/03/20 23:49:37 $
9370 *
9371 * $Revision: 1.17 $
9372 *
9373 *----------------------------------------------------------------------*/
9374 6058
9375/*#include <globals.h>*/
9376
9377#if (FW_TYPE==_UCB_MGR_)
9378 /*#include <budi.h>*/
9379#endif
9380 6059
9381/*#include <sccbmgr.h>*/
9382/*#include <blx30.h>*/
9383/*#include <target.h>*/
9384/*#include <scsi2.h>*/
9385/*#include <eeprom.h>*/
9386/*#include <harpoon.h>*/
9387 6060
9388
9389
9390/*
9391extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
9392extern SCCBCARD BL_Card[MAX_CARDS];
9393extern SCCBSCAM_INFO scamInfo[MAX_SCSI_TAR];
9394extern NVRAMINFO nvRamInfo[MAX_MB_CARDS];
9395#if defined(DOS) || defined(OS2)
9396extern UCHAR temp_id_string[ID_STRING_LENGTH];
9397#endif
9398extern UCHAR scamHAString[];
9399*/
9400/*--------------------------------------------------------------------- 6061/*---------------------------------------------------------------------
9401 * 6062 *
9402 * Function: scini 6063 * Function: FPT_scini
9403 * 6064 *
9404 * Description: Setup all data structures necessary for SCAM selection. 6065 * Description: Setup all data structures necessary for SCAM selection.
9405 * 6066 *
9406 *---------------------------------------------------------------------*/ 6067 *---------------------------------------------------------------------*/
9407 6068
9408void scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up) 6069static void FPT_scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up)
9409{ 6070{
9410 6071
9411#if defined(SCAM_LEV_2)
9412 UCHAR loser,assigned_id; 6072 UCHAR loser,assigned_id;
9413#endif
9414#if defined(DOS)
9415
9416 USHORT p_port;
9417#else
9418 ULONG p_port; 6073 ULONG p_port;
9419#endif
9420 6074
9421 UCHAR i,k,ScamFlg ; 6075 UCHAR i,k,ScamFlg ;
9422 PSCCBcard currCard; 6076 PSCCBcard currCard;
9423 PNVRamInfo pCurrNvRam; 6077 PNVRamInfo pCurrNvRam;
9424 6078
9425 currCard = &BL_Card[p_card]; 6079 currCard = &FPT_BL_Card[p_card];
9426 p_port = currCard->ioPort; 6080 p_port = currCard->ioPort;
9427 pCurrNvRam = currCard->pNvRamInfo; 6081 pCurrNvRam = currCard->pNvRamInfo;
9428 6082
@@ -9432,72 +6086,68 @@ void scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up)
9432 i = pCurrNvRam->niSysConf; 6086 i = pCurrNvRam->niSysConf;
9433 } 6087 }
9434 else{ 6088 else{
9435 ScamFlg = (UCHAR) utilEERead(p_port, SCAM_CONFIG/2); 6089 ScamFlg = (UCHAR) FPT_utilEERead(p_port, SCAM_CONFIG/2);
9436 i = (UCHAR)(utilEERead(p_port, (SYSTEM_CONFIG/2))); 6090 i = (UCHAR)(FPT_utilEERead(p_port, (SYSTEM_CONFIG/2)));
9437 } 6091 }
9438 if(!(i & 0x02)) /* check if reset bus in AutoSCSI parameter set */ 6092 if(!(i & 0x02)) /* check if reset bus in AutoSCSI parameter set */
9439 return; 6093 return;
9440 6094
9441 inisci(p_card,p_port, p_our_id); 6095 FPT_inisci(p_card,p_port, p_our_id);
9442 6096
9443 /* Force to wait 1 sec after SCSI bus reset. Some SCAM device FW 6097 /* Force to wait 1 sec after SCSI bus reset. Some SCAM device FW
9444 too slow to return to SCAM selection */ 6098 too slow to return to SCAM selection */
9445 6099
9446 /* if (p_power_up) 6100 /* if (p_power_up)
9447 Wait1Second(p_port); 6101 FPT_Wait1Second(p_port);
9448 else 6102 else
9449 Wait(p_port, TO_250ms); */ 6103 FPT_Wait(p_port, TO_250ms); */
9450
9451 Wait1Second(p_port);
9452 6104
9453#if defined(SCAM_LEV_2) 6105 FPT_Wait1Second(p_port);
9454 6106
9455 if ((ScamFlg & SCAM_ENABLED) && (ScamFlg & SCAM_LEVEL2)) 6107 if ((ScamFlg & SCAM_ENABLED) && (ScamFlg & SCAM_LEVEL2))
9456 { 6108 {
9457 while (!(scarb(p_port,INIT_SELTD))) {} 6109 while (!(FPT_scarb(p_port,INIT_SELTD))) {}
9458 6110
9459 scsel(p_port); 6111 FPT_scsel(p_port);
9460 6112
9461 do { 6113 do {
9462 scxferc(p_port,SYNC_PTRN); 6114 FPT_scxferc(p_port,SYNC_PTRN);
9463 scxferc(p_port,DOM_MSTR); 6115 FPT_scxferc(p_port,DOM_MSTR);
9464 loser = scsendi(p_port,&scamInfo[p_our_id].id_string[0]); 6116 loser = FPT_scsendi(p_port,&FPT_scamInfo[p_our_id].id_string[0]);
9465 } while ( loser == 0xFF ); 6117 } while ( loser == 0xFF );
9466 6118
9467 scbusf(p_port); 6119 FPT_scbusf(p_port);
9468 6120
9469 if ((p_power_up) && (!loser)) 6121 if ((p_power_up) && (!loser))
9470 { 6122 {
9471 sresb(p_port,p_card); 6123 FPT_sresb(p_port,p_card);
9472 Wait(p_port, TO_250ms); 6124 FPT_Wait(p_port, TO_250ms);
9473 6125
9474 while (!(scarb(p_port,INIT_SELTD))) {} 6126 while (!(FPT_scarb(p_port,INIT_SELTD))) {}
9475 6127
9476 scsel(p_port); 6128 FPT_scsel(p_port);
9477 6129
9478 do { 6130 do {
9479 scxferc(p_port, SYNC_PTRN); 6131 FPT_scxferc(p_port, SYNC_PTRN);
9480 scxferc(p_port, DOM_MSTR); 6132 FPT_scxferc(p_port, DOM_MSTR);
9481 loser = scsendi(p_port,&scamInfo[p_our_id]. 6133 loser = FPT_scsendi(p_port,&FPT_scamInfo[p_our_id].
9482 id_string[0]); 6134 id_string[0]);
9483 } while ( loser == 0xFF ); 6135 } while ( loser == 0xFF );
9484 6136
9485 scbusf(p_port); 6137 FPT_scbusf(p_port);
9486 } 6138 }
9487 } 6139 }
9488 6140
9489 else 6141 else
9490 { 6142 {
9491 loser = FALSE; 6143 loser = 0;
9492 } 6144 }
9493 6145
9494 6146
9495 if (!loser) 6147 if (!loser)
9496 { 6148 {
9497 6149
9498#endif /* SCAM_LEV_2 */ 6150 FPT_scamInfo[p_our_id].state = ID_ASSIGNED;
9499
9500 scamInfo[p_our_id].state = ID_ASSIGNED;
9501 6151
9502 6152
9503 if (ScamFlg & SCAM_ENABLED) 6153 if (ScamFlg & SCAM_ENABLED)
@@ -9505,18 +6155,18 @@ void scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up)
9505 6155
9506 for (i=0; i < MAX_SCSI_TAR; i++) 6156 for (i=0; i < MAX_SCSI_TAR; i++)
9507 { 6157 {
9508 if ((scamInfo[i].state == ID_UNASSIGNED) || 6158 if ((FPT_scamInfo[i].state == ID_UNASSIGNED) ||
9509 (scamInfo[i].state == ID_UNUSED)) 6159 (FPT_scamInfo[i].state == ID_UNUSED))
9510 { 6160 {
9511 if (scsell(p_port,i)) 6161 if (FPT_scsell(p_port,i))
9512 { 6162 {
9513 scamInfo[i].state = LEGACY; 6163 FPT_scamInfo[i].state = LEGACY;
9514 if ((scamInfo[i].id_string[0] != 0xFF) || 6164 if ((FPT_scamInfo[i].id_string[0] != 0xFF) ||
9515 (scamInfo[i].id_string[1] != 0xFA)) 6165 (FPT_scamInfo[i].id_string[1] != 0xFA))
9516 { 6166 {
9517 6167
9518 scamInfo[i].id_string[0] = 0xFF; 6168 FPT_scamInfo[i].id_string[0] = 0xFF;
9519 scamInfo[i].id_string[1] = 0xFA; 6169 FPT_scamInfo[i].id_string[1] = 0xFA;
9520 if(pCurrNvRam == NULL) 6170 if(pCurrNvRam == NULL)
9521 currCard->globalFlags |= F_UPDATE_EEPROM; 6171 currCard->globalFlags |= F_UPDATE_EEPROM;
9522 } 6172 }
@@ -9524,45 +6174,43 @@ void scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up)
9524 } 6174 }
9525 } 6175 }
9526 6176
9527 sresb(p_port,p_card); 6177 FPT_sresb(p_port,p_card);
9528 Wait1Second(p_port); 6178 FPT_Wait1Second(p_port);
9529 while (!(scarb(p_port,INIT_SELTD))) {} 6179 while (!(FPT_scarb(p_port,INIT_SELTD))) {}
9530 scsel(p_port); 6180 FPT_scsel(p_port);
9531 scasid(p_card, p_port); 6181 FPT_scasid(p_card, p_port);
9532 } 6182 }
9533 6183
9534#if defined(SCAM_LEV_2)
9535
9536 } 6184 }
9537 6185
9538 else if ((loser) && (ScamFlg & SCAM_ENABLED)) 6186 else if ((loser) && (ScamFlg & SCAM_ENABLED))
9539 { 6187 {
9540 scamInfo[p_our_id].id_string[0] = SLV_TYPE_CODE0; 6188 FPT_scamInfo[p_our_id].id_string[0] = SLV_TYPE_CODE0;
9541 assigned_id = FALSE; 6189 assigned_id = 0;
9542 scwtsel(p_port); 6190 FPT_scwtsel(p_port);
9543 6191
9544 do { 6192 do {
9545 while (scxferc(p_port,0x00) != SYNC_PTRN) {} 6193 while (FPT_scxferc(p_port,0x00) != SYNC_PTRN) {}
9546 6194
9547 i = scxferc(p_port,0x00); 6195 i = FPT_scxferc(p_port,0x00);
9548 if (i == ASSIGN_ID) 6196 if (i == ASSIGN_ID)
9549 { 6197 {
9550 if (!(scsendi(p_port,&scamInfo[p_our_id].id_string[0]))) 6198 if (!(FPT_scsendi(p_port,&FPT_scamInfo[p_our_id].id_string[0])))
9551 { 6199 {
9552 i = scxferc(p_port,0x00); 6200 i = FPT_scxferc(p_port,0x00);
9553 if (scvalq(i)) 6201 if (FPT_scvalq(i))
9554 { 6202 {
9555 k = scxferc(p_port,0x00); 6203 k = FPT_scxferc(p_port,0x00);
9556 6204
9557 if (scvalq(k)) 6205 if (FPT_scvalq(k))
9558 { 6206 {
9559 currCard->ourId = 6207 currCard->ourId =
9560 ((UCHAR)(i<<3)+(k & (UCHAR)7)) & (UCHAR) 0x3F; 6208 ((UCHAR)(i<<3)+(k & (UCHAR)7)) & (UCHAR) 0x3F;
9561 inisci(p_card, p_port, p_our_id); 6209 FPT_inisci(p_card, p_port, p_our_id);
9562 scamInfo[currCard->ourId].state = ID_ASSIGNED; 6210 FPT_scamInfo[currCard->ourId].state = ID_ASSIGNED;
9563 scamInfo[currCard->ourId].id_string[0] 6211 FPT_scamInfo[currCard->ourId].id_string[0]
9564 = SLV_TYPE_CODE0; 6212 = SLV_TYPE_CODE0;
9565 assigned_id = TRUE; 6213 assigned_id = 1;
9566 } 6214 }
9567 } 6215 }
9568 } 6216 }
@@ -9570,43 +6218,31 @@ void scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up)
9570 6218
9571 else if (i == SET_P_FLAG) 6219 else if (i == SET_P_FLAG)
9572 { 6220 {
9573 if (!(scsendi(p_port, 6221 if (!(FPT_scsendi(p_port,
9574 &scamInfo[p_our_id].id_string[0]))) 6222 &FPT_scamInfo[p_our_id].id_string[0])))
9575 scamInfo[p_our_id].id_string[0] |= 0x80; 6223 FPT_scamInfo[p_our_id].id_string[0] |= 0x80;
9576 } 6224 }
9577 }while (!assigned_id); 6225 }while (!assigned_id);
9578 6226
9579 while (scxferc(p_port,0x00) != CFG_CMPLT) {} 6227 while (FPT_scxferc(p_port,0x00) != CFG_CMPLT) {}
9580 } 6228 }
9581 6229
9582#endif /* SCAM_LEV_2 */
9583 if (ScamFlg & SCAM_ENABLED) 6230 if (ScamFlg & SCAM_ENABLED)
9584 { 6231 {
9585 scbusf(p_port); 6232 FPT_scbusf(p_port);
9586 if (currCard->globalFlags & F_UPDATE_EEPROM) 6233 if (currCard->globalFlags & F_UPDATE_EEPROM)
9587 { 6234 {
9588 scsavdi(p_card, p_port); 6235 FPT_scsavdi(p_card, p_port);
9589 currCard->globalFlags &= ~F_UPDATE_EEPROM; 6236 currCard->globalFlags &= ~F_UPDATE_EEPROM;
9590 } 6237 }
9591 } 6238 }
9592 6239
9593 6240
9594#if defined(DOS)
9595 for (i=0; i < MAX_SCSI_TAR; i++)
9596 {
9597 if (((ScamFlg & SCAM_ENABLED) && (scamInfo[i].state == LEGACY))
9598 || (i != p_our_id))
9599 {
9600 scsellDOS(p_port,i);
9601 }
9602 }
9603#endif
9604
9605/* 6241/*
9606 for (i=0,k=0; i < MAX_SCSI_TAR; i++) 6242 for (i=0,k=0; i < MAX_SCSI_TAR; i++)
9607 { 6243 {
9608 if ((scamInfo[i].state == ID_ASSIGNED) || 6244 if ((FPT_scamInfo[i].state == ID_ASSIGNED) ||
9609 (scamInfo[i].state == LEGACY)) 6245 (FPT_scamInfo[i].state == LEGACY))
9610 k++; 6246 k++;
9611 } 6247 }
9612 6248
@@ -9620,17 +6256,13 @@ void scini(UCHAR p_card, UCHAR p_our_id, UCHAR p_power_up)
9620 6256
9621/*--------------------------------------------------------------------- 6257/*---------------------------------------------------------------------
9622 * 6258 *
9623 * Function: scarb 6259 * Function: FPT_scarb
9624 * 6260 *
9625 * Description: Gain control of the bus and wait SCAM select time (250ms) 6261 * Description: Gain control of the bus and wait SCAM select time (250ms)
9626 * 6262 *
9627 *---------------------------------------------------------------------*/ 6263 *---------------------------------------------------------------------*/
9628 6264
9629#if defined(DOS) 6265static int FPT_scarb(ULONG p_port, UCHAR p_sel_type)
9630int scarb(USHORT p_port, UCHAR p_sel_type)
9631#else
9632int scarb(ULONG p_port, UCHAR p_sel_type)
9633#endif
9634{ 6266{
9635 if (p_sel_type == INIT_SELTD) 6267 if (p_sel_type == INIT_SELTD)
9636 { 6268 {
@@ -9639,10 +6271,10 @@ int scarb(ULONG p_port, UCHAR p_sel_type)
9639 6271
9640 6272
9641 if (RD_HARPOON(p_port+hp_scsisig) & SCSI_SEL) 6273 if (RD_HARPOON(p_port+hp_scsisig) & SCSI_SEL)
9642 return(FALSE); 6274 return(0);
9643 6275
9644 if (RD_HARPOON(p_port+hp_scsidata_0) != 00) 6276 if (RD_HARPOON(p_port+hp_scsidata_0) != 00)
9645 return(FALSE); 6277 return(0);
9646 6278
9647 WR_HARPOON(p_port+hp_scsisig, (RD_HARPOON(p_port+hp_scsisig) | SCSI_BSY)); 6279 WR_HARPOON(p_port+hp_scsisig, (RD_HARPOON(p_port+hp_scsisig) | SCSI_BSY));
9648 6280
@@ -9650,7 +6282,7 @@ int scarb(ULONG p_port, UCHAR p_sel_type)
9650 6282
9651 WR_HARPOON(p_port+hp_scsisig, (RD_HARPOON(p_port+hp_scsisig) & 6283 WR_HARPOON(p_port+hp_scsisig, (RD_HARPOON(p_port+hp_scsisig) &
9652 ~SCSI_BSY)); 6284 ~SCSI_BSY));
9653 return(FALSE); 6285 return(0);
9654 } 6286 }
9655 6287
9656 6288
@@ -9660,7 +6292,7 @@ int scarb(ULONG p_port, UCHAR p_sel_type)
9660 6292
9661 WR_HARPOON(p_port+hp_scsisig, (RD_HARPOON(p_port+hp_scsisig) & 6293 WR_HARPOON(p_port+hp_scsisig, (RD_HARPOON(p_port+hp_scsisig) &
9662 ~(SCSI_BSY | SCSI_SEL))); 6294 ~(SCSI_BSY | SCSI_SEL)));
9663 return(FALSE); 6295 return(0);
9664 } 6296 }
9665 } 6297 }
9666 6298
@@ -9669,9 +6301,7 @@ int scarb(ULONG p_port, UCHAR p_sel_type)
9669 & ~ACTdeassert)); 6301 & ~ACTdeassert));
9670 WR_HARPOON(p_port+hp_scsireset, SCAM_EN); 6302 WR_HARPOON(p_port+hp_scsireset, SCAM_EN);
9671 WR_HARPOON(p_port+hp_scsidata_0, 0x00); 6303 WR_HARPOON(p_port+hp_scsidata_0, 0x00);
9672#if defined(WIDE_SCSI)
9673 WR_HARPOON(p_port+hp_scsidata_1, 0x00); 6304 WR_HARPOON(p_port+hp_scsidata_1, 0x00);
9674#endif
9675 WR_HARPOON(p_port+hp_portctrl_0, SCSI_BUS_EN); 6305 WR_HARPOON(p_port+hp_portctrl_0, SCSI_BUS_EN);
9676 6306
9677 WR_HARPOON(p_port+hp_scsisig, (RD_HARPOON(p_port+hp_scsisig) | SCSI_MSG)); 6307 WR_HARPOON(p_port+hp_scsisig, (RD_HARPOON(p_port+hp_scsisig) | SCSI_MSG));
@@ -9679,25 +6309,21 @@ int scarb(ULONG p_port, UCHAR p_sel_type)
9679 WR_HARPOON(p_port+hp_scsisig, (RD_HARPOON(p_port+hp_scsisig) 6309 WR_HARPOON(p_port+hp_scsisig, (RD_HARPOON(p_port+hp_scsisig)
9680 & ~SCSI_BSY)); 6310 & ~SCSI_BSY));
9681 6311
9682 Wait(p_port,TO_250ms); 6312 FPT_Wait(p_port,TO_250ms);
9683 6313
9684 return(TRUE); 6314 return(1);
9685} 6315}
9686 6316
9687 6317
9688/*--------------------------------------------------------------------- 6318/*---------------------------------------------------------------------
9689 * 6319 *
9690 * Function: scbusf 6320 * Function: FPT_scbusf
9691 * 6321 *
9692 * Description: Release the SCSI bus and disable SCAM selection. 6322 * Description: Release the SCSI bus and disable SCAM selection.
9693 * 6323 *
9694 *---------------------------------------------------------------------*/ 6324 *---------------------------------------------------------------------*/
9695 6325
9696#if defined(DOS) 6326static void FPT_scbusf(ULONG p_port)
9697void scbusf(USHORT p_port)
9698#else
9699void scbusf(ULONG p_port)
9700#endif
9701{ 6327{
9702 WR_HARPOON(p_port+hp_page_ctrl, 6328 WR_HARPOON(p_port+hp_page_ctrl,
9703 (RD_HARPOON(p_port+hp_page_ctrl) | G_INT_DISABLE)); 6329 (RD_HARPOON(p_port+hp_page_ctrl) | G_INT_DISABLE));
@@ -9717,11 +6343,7 @@ void scbusf(ULONG p_port)
9717 WR_HARPOON(p_port+hp_clkctrl_0, (RD_HARPOON(p_port+hp_clkctrl_0) 6343 WR_HARPOON(p_port+hp_clkctrl_0, (RD_HARPOON(p_port+hp_clkctrl_0)
9718 | ACTdeassert)); 6344 | ACTdeassert));
9719 6345
9720#if defined(SCAM_LEV_2)
9721 WRW_HARPOON((p_port+hp_intstat), (BUS_FREE | AUTO_INT | SCAM_SEL)); 6346 WRW_HARPOON((p_port+hp_intstat), (BUS_FREE | AUTO_INT | SCAM_SEL));
9722#else
9723 WRW_HARPOON((p_port+hp_intstat), (BUS_FREE | AUTO_INT));
9724#endif
9725 6347
9726 WR_HARPOON(p_port+hp_page_ctrl, 6348 WR_HARPOON(p_port+hp_page_ctrl,
9727 (RD_HARPOON(p_port+hp_page_ctrl) & ~G_INT_DISABLE)); 6349 (RD_HARPOON(p_port+hp_page_ctrl) & ~G_INT_DISABLE));
@@ -9731,35 +6353,24 @@ void scbusf(ULONG p_port)
9731 6353
9732/*--------------------------------------------------------------------- 6354/*---------------------------------------------------------------------
9733 * 6355 *
9734 * Function: scasid 6356 * Function: FPT_scasid
9735 * 6357 *
9736 * Description: Assign an ID to all the SCAM devices. 6358 * Description: Assign an ID to all the SCAM devices.
9737 * 6359 *
9738 *---------------------------------------------------------------------*/ 6360 *---------------------------------------------------------------------*/
9739 6361
9740#if defined(DOS) 6362static void FPT_scasid(UCHAR p_card, ULONG p_port)
9741void scasid(UCHAR p_card, USHORT p_port)
9742#else
9743void scasid(UCHAR p_card, ULONG p_port)
9744#endif
9745{ 6363{
9746#if defined(DOS) || defined(OS2)
9747 /* Use external defined in global space area, instead of Stack
9748 space. WIN/95 DOS doesnot work TINY mode. The OS doesnot intialize
9749 SS equal to DS. Thus the array allocated on stack doesnot get
9750 access correctly */
9751#else
9752 UCHAR temp_id_string[ID_STRING_LENGTH]; 6364 UCHAR temp_id_string[ID_STRING_LENGTH];
9753#endif
9754 6365
9755 UCHAR i,k,scam_id; 6366 UCHAR i,k,scam_id;
9756 UCHAR crcBytes[3]; 6367 UCHAR crcBytes[3];
9757 PNVRamInfo pCurrNvRam; 6368 PNVRamInfo pCurrNvRam;
9758 ushort_ptr pCrcBytes; 6369 ushort_ptr pCrcBytes;
9759 6370
9760 pCurrNvRam = BL_Card[p_card].pNvRamInfo; 6371 pCurrNvRam = FPT_BL_Card[p_card].pNvRamInfo;
9761 6372
9762 i=FALSE; 6373 i=0;
9763 6374
9764 while (!i) 6375 while (!i)
9765 { 6376 {
@@ -9769,36 +6380,36 @@ void scasid(UCHAR p_card, ULONG p_port)
9769 temp_id_string[k] = (UCHAR) 0x00; 6380 temp_id_string[k] = (UCHAR) 0x00;
9770 } 6381 }
9771 6382
9772 scxferc(p_port,SYNC_PTRN); 6383 FPT_scxferc(p_port,SYNC_PTRN);
9773 scxferc(p_port,ASSIGN_ID); 6384 FPT_scxferc(p_port,ASSIGN_ID);
9774 6385
9775 if (!(sciso(p_port,&temp_id_string[0]))) 6386 if (!(FPT_sciso(p_port,&temp_id_string[0])))
9776 { 6387 {
9777 if(pCurrNvRam){ 6388 if(pCurrNvRam){
9778 pCrcBytes = (ushort_ptr)&crcBytes[0]; 6389 pCrcBytes = (ushort_ptr)&crcBytes[0];
9779 *pCrcBytes = CalcCrc16(&temp_id_string[0]); 6390 *pCrcBytes = FPT_CalcCrc16(&temp_id_string[0]);
9780 crcBytes[2] = CalcLrc(&temp_id_string[0]); 6391 crcBytes[2] = FPT_CalcLrc(&temp_id_string[0]);
9781 temp_id_string[1] = crcBytes[2]; 6392 temp_id_string[1] = crcBytes[2];
9782 temp_id_string[2] = crcBytes[0]; 6393 temp_id_string[2] = crcBytes[0];
9783 temp_id_string[3] = crcBytes[1]; 6394 temp_id_string[3] = crcBytes[1];
9784 for(k = 4; k < ID_STRING_LENGTH; k++) 6395 for(k = 4; k < ID_STRING_LENGTH; k++)
9785 temp_id_string[k] = (UCHAR) 0x00; 6396 temp_id_string[k] = (UCHAR) 0x00;
9786 } 6397 }
9787 i = scmachid(p_card,temp_id_string); 6398 i = FPT_scmachid(p_card,temp_id_string);
9788 6399
9789 if (i == CLR_PRIORITY) 6400 if (i == CLR_PRIORITY)
9790 { 6401 {
9791 scxferc(p_port,MISC_CODE); 6402 FPT_scxferc(p_port,MISC_CODE);
9792 scxferc(p_port,CLR_P_FLAG); 6403 FPT_scxferc(p_port,CLR_P_FLAG);
9793 i = FALSE; /*Not the last ID yet. */ 6404 i = 0; /*Not the last ID yet. */
9794 } 6405 }
9795 6406
9796 else if (i != NO_ID_AVAIL) 6407 else if (i != NO_ID_AVAIL)
9797 { 6408 {
9798 if (i < 8 ) 6409 if (i < 8 )
9799 scxferc(p_port,ID_0_7); 6410 FPT_scxferc(p_port,ID_0_7);
9800 else 6411 else
9801 scxferc(p_port,ID_8_F); 6412 FPT_scxferc(p_port,ID_8_F);
9802 6413
9803 scam_id = (i & (UCHAR) 0x07); 6414 scam_id = (i & (UCHAR) 0x07);
9804 6415
@@ -9807,21 +6418,21 @@ void scasid(UCHAR p_card, ULONG p_port)
9807 if (!( k & i )) 6418 if (!( k & i ))
9808 scam_id += 0x08; /*Count number of zeros in DB0-3. */ 6419 scam_id += 0x08; /*Count number of zeros in DB0-3. */
9809 6420
9810 scxferc(p_port,scam_id); 6421 FPT_scxferc(p_port,scam_id);
9811 6422
9812 i = FALSE; /*Not the last ID yet. */ 6423 i = 0; /*Not the last ID yet. */
9813 } 6424 }
9814 } 6425 }
9815 6426
9816 else 6427 else
9817 { 6428 {
9818 i = TRUE; 6429 i = 1;
9819 } 6430 }
9820 6431
9821 } /*End while */ 6432 } /*End while */
9822 6433
9823 scxferc(p_port,SYNC_PTRN); 6434 FPT_scxferc(p_port,SYNC_PTRN);
9824 scxferc(p_port,CFG_CMPLT); 6435 FPT_scxferc(p_port,CFG_CMPLT);
9825} 6436}
9826 6437
9827 6438
@@ -9830,21 +6441,17 @@ void scasid(UCHAR p_card, ULONG p_port)
9830 6441
9831/*--------------------------------------------------------------------- 6442/*---------------------------------------------------------------------
9832 * 6443 *
9833 * Function: scsel 6444 * Function: FPT_scsel
9834 * 6445 *
9835 * Description: Select all the SCAM devices. 6446 * Description: Select all the SCAM devices.
9836 * 6447 *
9837 *---------------------------------------------------------------------*/ 6448 *---------------------------------------------------------------------*/
9838 6449
9839#if defined(DOS) 6450static void FPT_scsel(ULONG p_port)
9840void scsel(USHORT p_port)
9841#else
9842void scsel(ULONG p_port)
9843#endif
9844{ 6451{
9845 6452
9846 WR_HARPOON(p_port+hp_scsisig, SCSI_SEL); 6453 WR_HARPOON(p_port+hp_scsisig, SCSI_SEL);
9847 scwiros(p_port, SCSI_MSG); 6454 FPT_scwiros(p_port, SCSI_MSG);
9848 6455
9849 WR_HARPOON(p_port+hp_scsisig, (SCSI_SEL | SCSI_BSY)); 6456 WR_HARPOON(p_port+hp_scsisig, (SCSI_SEL | SCSI_BSY));
9850 6457
@@ -9855,11 +6462,11 @@ void scsel(ULONG p_port)
9855 6462
9856 6463
9857 WR_HARPOON(p_port+hp_scsisig, (SCSI_BSY | SCSI_IOBIT | SCSI_CD)); 6464 WR_HARPOON(p_port+hp_scsisig, (SCSI_BSY | SCSI_IOBIT | SCSI_CD));
9858 scwiros(p_port, SCSI_SEL); 6465 FPT_scwiros(p_port, SCSI_SEL);
9859 6466
9860 WR_HARPOON(p_port+hp_scsidata_0, (UCHAR)(RD_HARPOON(p_port+hp_scsidata_0) & 6467 WR_HARPOON(p_port+hp_scsidata_0, (UCHAR)(RD_HARPOON(p_port+hp_scsidata_0) &
9861 ~(UCHAR)BIT(6))); 6468 ~(UCHAR)BIT(6)));
9862 scwirod(p_port, BIT(6)); 6469 FPT_scwirod(p_port, BIT(6));
9863 6470
9864 WR_HARPOON(p_port+hp_scsisig, (SCSI_SEL | SCSI_BSY | SCSI_IOBIT | SCSI_CD)); 6471 WR_HARPOON(p_port+hp_scsisig, (SCSI_SEL | SCSI_BSY | SCSI_IOBIT | SCSI_CD));
9865} 6472}
@@ -9868,17 +6475,13 @@ void scsel(ULONG p_port)
9868 6475
9869/*--------------------------------------------------------------------- 6476/*---------------------------------------------------------------------
9870 * 6477 *
9871 * Function: scxferc 6478 * Function: FPT_scxferc
9872 * 6479 *
9873 * Description: Handshake the p_data (DB4-0) across the bus. 6480 * Description: Handshake the p_data (DB4-0) across the bus.
9874 * 6481 *
9875 *---------------------------------------------------------------------*/ 6482 *---------------------------------------------------------------------*/
9876 6483
9877#if defined(DOS) 6484static UCHAR FPT_scxferc(ULONG p_port, UCHAR p_data)
9878UCHAR scxferc(USHORT p_port, UCHAR p_data)
9879#else
9880UCHAR scxferc(ULONG p_port, UCHAR p_data)
9881#endif
9882{ 6485{
9883 UCHAR curr_data, ret_data; 6486 UCHAR curr_data, ret_data;
9884 6487
@@ -9890,7 +6493,7 @@ UCHAR scxferc(ULONG p_port, UCHAR p_data)
9890 6493
9891 WR_HARPOON(p_port+hp_scsidata_0, curr_data); 6494 WR_HARPOON(p_port+hp_scsidata_0, curr_data);
9892 6495
9893 scwirod(p_port,BIT(7)); /*Wait for DB7 to be released. */ 6496 FPT_scwirod(p_port,BIT(7)); /*Wait for DB7 to be released. */
9894 while (!(RD_HARPOON(p_port+hp_scsidata_0) & BIT(5))); 6497 while (!(RD_HARPOON(p_port+hp_scsidata_0) & BIT(5)));
9895 6498
9896 ret_data = (RD_HARPOON(p_port+hp_scsidata_0) & (UCHAR) 0x1F); 6499 ret_data = (RD_HARPOON(p_port+hp_scsidata_0) & (UCHAR) 0x1F);
@@ -9903,7 +6506,7 @@ UCHAR scxferc(ULONG p_port, UCHAR p_data)
9903 6506
9904 WR_HARPOON(p_port+hp_scsidata_0, curr_data); 6507 WR_HARPOON(p_port+hp_scsidata_0, curr_data);
9905 6508
9906 scwirod(p_port,BIT(5)); /*Wait for DB5 to be released. */ 6509 FPT_scwirod(p_port,BIT(5)); /*Wait for DB5 to be released. */
9907 6510
9908 curr_data &= ~(BIT(4)|BIT(3)|BIT(2)|BIT(1)|BIT(0)); /*Release data bits */ 6511 curr_data &= ~(BIT(4)|BIT(3)|BIT(2)|BIT(1)|BIT(0)); /*Release data bits */
9909 curr_data |= BIT(7); 6512 curr_data |= BIT(7);
@@ -9914,7 +6517,7 @@ UCHAR scxferc(ULONG p_port, UCHAR p_data)
9914 6517
9915 WR_HARPOON(p_port+hp_scsidata_0, curr_data); 6518 WR_HARPOON(p_port+hp_scsidata_0, curr_data);
9916 6519
9917 scwirod(p_port,BIT(6)); /*Wait for DB6 to be released. */ 6520 FPT_scwirod(p_port,BIT(6)); /*Wait for DB6 to be released. */
9918 6521
9919 return(ret_data); 6522 return(ret_data);
9920} 6523}
@@ -9922,39 +6525,35 @@ UCHAR scxferc(ULONG p_port, UCHAR p_data)
9922 6525
9923/*--------------------------------------------------------------------- 6526/*---------------------------------------------------------------------
9924 * 6527 *
9925 * Function: scsendi 6528 * Function: FPT_scsendi
9926 * 6529 *
9927 * Description: Transfer our Identification string to determine if we 6530 * Description: Transfer our Identification string to determine if we
9928 * will be the dominant master. 6531 * will be the dominant master.
9929 * 6532 *
9930 *---------------------------------------------------------------------*/ 6533 *---------------------------------------------------------------------*/
9931 6534
9932#if defined(DOS) 6535static UCHAR FPT_scsendi(ULONG p_port, UCHAR p_id_string[])
9933UCHAR scsendi(USHORT p_port, UCHAR p_id_string[])
9934#else
9935UCHAR scsendi(ULONG p_port, UCHAR p_id_string[])
9936#endif
9937{ 6536{
9938 UCHAR ret_data,byte_cnt,bit_cnt,defer; 6537 UCHAR ret_data,byte_cnt,bit_cnt,defer;
9939 6538
9940 defer = FALSE; 6539 defer = 0;
9941 6540
9942 for (byte_cnt = 0; byte_cnt < ID_STRING_LENGTH; byte_cnt++) { 6541 for (byte_cnt = 0; byte_cnt < ID_STRING_LENGTH; byte_cnt++) {
9943 6542
9944 for (bit_cnt = 0x80; bit_cnt != 0 ; bit_cnt >>= 1) { 6543 for (bit_cnt = 0x80; bit_cnt != 0 ; bit_cnt >>= 1) {
9945 6544
9946 if (defer) 6545 if (defer)
9947 ret_data = scxferc(p_port,00); 6546 ret_data = FPT_scxferc(p_port,00);
9948 6547
9949 else if (p_id_string[byte_cnt] & bit_cnt) 6548 else if (p_id_string[byte_cnt] & bit_cnt)
9950 6549
9951 ret_data = scxferc(p_port,02); 6550 ret_data = FPT_scxferc(p_port,02);
9952 6551
9953 else { 6552 else {
9954 6553
9955 ret_data = scxferc(p_port,01); 6554 ret_data = FPT_scxferc(p_port,01);
9956 if (ret_data & 02) 6555 if (ret_data & 02)
9957 defer = TRUE; 6556 defer = 1;
9958 } 6557 }
9959 6558
9960 if ((ret_data & 0x1C) == 0x10) 6559 if ((ret_data & 0x1C) == 0x10)
@@ -9980,17 +6579,13 @@ UCHAR scsendi(ULONG p_port, UCHAR p_id_string[])
9980 6579
9981/*--------------------------------------------------------------------- 6580/*---------------------------------------------------------------------
9982 * 6581 *
9983 * Function: sciso 6582 * Function: FPT_sciso
9984 * 6583 *
9985 * Description: Transfer the Identification string. 6584 * Description: Transfer the Identification string.
9986 * 6585 *
9987 *---------------------------------------------------------------------*/ 6586 *---------------------------------------------------------------------*/
9988 6587
9989#if defined(DOS) 6588static UCHAR FPT_sciso(ULONG p_port, UCHAR p_id_string[])
9990UCHAR sciso(USHORT p_port, UCHAR p_id_string[])
9991#else
9992UCHAR sciso(ULONG p_port, UCHAR p_id_string[])
9993#endif
9994{ 6589{
9995 UCHAR ret_data,the_data,byte_cnt,bit_cnt; 6590 UCHAR ret_data,the_data,byte_cnt,bit_cnt;
9996 6591
@@ -10000,7 +6595,7 @@ UCHAR sciso(ULONG p_port, UCHAR p_id_string[])
10000 6595
10001 for (bit_cnt = 0; bit_cnt < 8; bit_cnt++) { 6596 for (bit_cnt = 0; bit_cnt < 8; bit_cnt++) {
10002 6597
10003 ret_data = scxferc(p_port,0); 6598 ret_data = FPT_scxferc(p_port,0);
10004 6599
10005 if (ret_data & 0xFC) 6600 if (ret_data & 0xFC)
10006 return(0xFF); 6601 return(0xFF);
@@ -10020,8 +6615,8 @@ UCHAR sciso(ULONG p_port, UCHAR p_id_string[])
10020 { 6615 {
10021 byte_cnt = 0; 6616 byte_cnt = 0;
10022 bit_cnt = 0; 6617 bit_cnt = 0;
10023 scxferc(p_port, SYNC_PTRN); 6618 FPT_scxferc(p_port, SYNC_PTRN);
10024 scxferc(p_port, ASSIGN_ID); 6619 FPT_scxferc(p_port, ASSIGN_ID);
10025 continue; 6620 continue;
10026 } 6621 }
10027*/ 6622*/
@@ -10044,18 +6639,14 @@ UCHAR sciso(ULONG p_port, UCHAR p_id_string[])
10044 6639
10045/*--------------------------------------------------------------------- 6640/*---------------------------------------------------------------------
10046 * 6641 *
10047 * Function: scwirod 6642 * Function: FPT_scwirod
10048 * 6643 *
10049 * Description: Sample the SCSI data bus making sure the signal has been 6644 * Description: Sample the SCSI data bus making sure the signal has been
10050 * deasserted for the correct number of consecutive samples. 6645 * deasserted for the correct number of consecutive samples.
10051 * 6646 *
10052 *---------------------------------------------------------------------*/ 6647 *---------------------------------------------------------------------*/
10053 6648
10054#if defined(DOS) 6649static void FPT_scwirod(ULONG p_port, UCHAR p_data_bit)
10055void scwirod(USHORT p_port, UCHAR p_data_bit)
10056#else
10057void scwirod(ULONG p_port, UCHAR p_data_bit)
10058#endif
10059{ 6650{
10060 UCHAR i; 6651 UCHAR i;
10061 6652
@@ -10077,18 +6668,14 @@ void scwirod(ULONG p_port, UCHAR p_data_bit)
10077 6668
10078/*--------------------------------------------------------------------- 6669/*---------------------------------------------------------------------
10079 * 6670 *
10080 * Function: scwiros 6671 * Function: FPT_scwiros
10081 * 6672 *
10082 * Description: Sample the SCSI Signal lines making sure the signal has been 6673 * Description: Sample the SCSI Signal lines making sure the signal has been
10083 * deasserted for the correct number of consecutive samples. 6674 * deasserted for the correct number of consecutive samples.
10084 * 6675 *
10085 *---------------------------------------------------------------------*/ 6676 *---------------------------------------------------------------------*/
10086 6677
10087#if defined(DOS) 6678static void FPT_scwiros(ULONG p_port, UCHAR p_data_bit)
10088void scwiros(USHORT p_port, UCHAR p_data_bit)
10089#else
10090void scwiros(ULONG p_port, UCHAR p_data_bit)
10091#endif
10092{ 6679{
10093 UCHAR i; 6680 UCHAR i;
10094 6681
@@ -10109,13 +6696,13 @@ void scwiros(ULONG p_port, UCHAR p_data_bit)
10109 6696
10110/*--------------------------------------------------------------------- 6697/*---------------------------------------------------------------------
10111 * 6698 *
10112 * Function: scvalq 6699 * Function: FPT_scvalq
10113 * 6700 *
10114 * Description: Make sure we received a valid data byte. 6701 * Description: Make sure we received a valid data byte.
10115 * 6702 *
10116 *---------------------------------------------------------------------*/ 6703 *---------------------------------------------------------------------*/
10117 6704
10118UCHAR scvalq(UCHAR p_quintet) 6705static UCHAR FPT_scvalq(UCHAR p_quintet)
10119{ 6706{
10120 UCHAR count; 6707 UCHAR count;
10121 6708
@@ -10125,16 +6712,16 @@ UCHAR scvalq(UCHAR p_quintet)
10125 } 6712 }
10126 6713
10127 if (p_quintet & 0x18) 6714 if (p_quintet & 0x18)
10128 return(FALSE); 6715 return(0);
10129 6716
10130 else 6717 else
10131 return(TRUE); 6718 return(1);
10132} 6719}
10133 6720
10134 6721
10135/*--------------------------------------------------------------------- 6722/*---------------------------------------------------------------------
10136 * 6723 *
10137 * Function: scsell 6724 * Function: FPT_scsell
10138 * 6725 *
10139 * Description: Select the specified device ID using a selection timeout 6726 * Description: Select the specified device ID using a selection timeout
10140 * less than 4ms. If somebody responds then it is a legacy 6727 * less than 4ms. If somebody responds then it is a legacy
@@ -10142,17 +6729,9 @@ UCHAR scvalq(UCHAR p_quintet)
10142 * 6729 *
10143 *---------------------------------------------------------------------*/ 6730 *---------------------------------------------------------------------*/
10144 6731
10145#if defined(DOS) 6732static UCHAR FPT_scsell(ULONG p_port, UCHAR targ_id)
10146UCHAR scsell(USHORT p_port, UCHAR targ_id)
10147#else
10148UCHAR scsell(ULONG p_port, UCHAR targ_id)
10149#endif
10150{ 6733{
10151#if defined(DOS)
10152 USHORT i;
10153#else
10154 ULONG i; 6734 ULONG i;
10155#endif
10156 6735
10157 WR_HARPOON(p_port+hp_page_ctrl, 6736 WR_HARPOON(p_port+hp_page_ctrl,
10158 (RD_HARPOON(p_port+hp_page_ctrl) | G_INT_DISABLE)); 6737 (RD_HARPOON(p_port+hp_page_ctrl) | G_INT_DISABLE));
@@ -10182,7 +6761,7 @@ UCHAR scsell(ULONG p_port, UCHAR targ_id)
10182 (RESET | PROG_HLT | TIMEOUT | AUTO_INT))) {} 6761 (RESET | PROG_HLT | TIMEOUT | AUTO_INT))) {}
10183 6762
10184 if (RDW_HARPOON((p_port+hp_intstat)) & RESET) 6763 if (RDW_HARPOON((p_port+hp_intstat)) & RESET)
10185 Wait(p_port, TO_250ms); 6764 FPT_Wait(p_port, TO_250ms);
10186 6765
10187 DISABLE_AUTO(p_port); 6766 DISABLE_AUTO(p_port);
10188 6767
@@ -10199,7 +6778,7 @@ UCHAR scsell(ULONG p_port, UCHAR targ_id)
10199 WR_HARPOON(p_port+hp_page_ctrl, 6778 WR_HARPOON(p_port+hp_page_ctrl,
10200 (RD_HARPOON(p_port+hp_page_ctrl) & ~G_INT_DISABLE)); 6779 (RD_HARPOON(p_port+hp_page_ctrl) & ~G_INT_DISABLE));
10201 6780
10202 return(FALSE); /*No legacy device */ 6781 return(0); /*No legacy device */
10203 } 6782 }
10204 6783
10205 else { 6784 else {
@@ -10217,108 +6796,19 @@ UCHAR scsell(ULONG p_port, UCHAR targ_id)
10217 WR_HARPOON(p_port+hp_page_ctrl, 6796 WR_HARPOON(p_port+hp_page_ctrl,
10218 (RD_HARPOON(p_port+hp_page_ctrl) & ~G_INT_DISABLE)); 6797 (RD_HARPOON(p_port+hp_page_ctrl) & ~G_INT_DISABLE));
10219 6798
10220 return(TRUE); /*Found one of them oldies! */ 6799 return(1); /*Found one of them oldies! */
10221 } 6800 }
10222} 6801}
10223 6802
10224#if defined(DOS)
10225/*--------------------------------------------------------------------- 6803/*---------------------------------------------------------------------
10226 * 6804 *
10227 * Function: scsell for DOS 6805 * Function: FPT_scwtsel
10228 *
10229 * Description: Select the specified device ID using a selection timeout
10230 * less than 2ms. This was specially required to solve
10231 * the problem with Plextor 12X CD-ROM drive. This drive
10232 * was responding the Selection at the end of 4ms and
10233 * hanging the system.
10234 *
10235 *---------------------------------------------------------------------*/
10236
10237UCHAR scsellDOS(USHORT p_port, UCHAR targ_id)
10238{
10239 USHORT i;
10240
10241 WR_HARPOON(p_port+hp_page_ctrl,
10242 (RD_HARPOON(p_port+hp_page_ctrl) | G_INT_DISABLE));
10243
10244 ARAM_ACCESS(p_port);
10245
10246 WR_HARPOON(p_port+hp_addstat,(RD_HARPOON(p_port+hp_addstat) | SCAM_TIMER));
10247 WR_HARPOON(p_port+hp_seltimeout,TO_2ms);
10248
10249
10250 for (i = p_port+CMD_STRT; i < p_port+CMD_STRT+12; i+=2) {
10251 WRW_HARPOON(i, (MPM_OP+ACOMMAND));
10252 }
10253 WRW_HARPOON(i, (BRH_OP+ALWAYS+ NP));
10254
10255 WRW_HARPOON((p_port+hp_intstat),
10256 (RESET | TIMEOUT | SEL | BUS_FREE | AUTO_INT));
10257
10258 WR_HARPOON(p_port+hp_select_id, targ_id);
10259
10260 WR_HARPOON(p_port+hp_portctrl_0, SCSI_PORT);
10261 WR_HARPOON(p_port+hp_autostart_3, (SELECT | CMD_ONLY_STRT));
10262 WR_HARPOON(p_port+hp_scsictrl_0, (SEL_TAR | ENA_RESEL));
10263
10264
10265 while (!(RDW_HARPOON((p_port+hp_intstat)) &
10266 (RESET | PROG_HLT | TIMEOUT | AUTO_INT))) {}
10267
10268 if (RDW_HARPOON((p_port+hp_intstat)) & RESET)
10269 Wait(p_port, TO_250ms);
10270
10271 DISABLE_AUTO(p_port);
10272
10273 WR_HARPOON(p_port+hp_addstat,(RD_HARPOON(p_port+hp_addstat) & ~SCAM_TIMER));
10274 WR_HARPOON(p_port+hp_seltimeout,TO_290ms);
10275
10276 SGRAM_ACCESS(p_port);
10277
10278 if (RDW_HARPOON((p_port+hp_intstat)) & (RESET | TIMEOUT) ) {
10279
10280 WRW_HARPOON((p_port+hp_intstat),
10281 (RESET | TIMEOUT | SEL | BUS_FREE | PHASE));
10282
10283 WR_HARPOON(p_port+hp_page_ctrl,
10284 (RD_HARPOON(p_port+hp_page_ctrl) & ~G_INT_DISABLE));
10285
10286 return(FALSE); /*No legacy device */
10287 }
10288
10289 else {
10290
10291 while(!(RDW_HARPOON((p_port+hp_intstat)) & BUS_FREE)) {
10292 if (RD_HARPOON(p_port+hp_scsisig) & SCSI_REQ)
10293 {
10294 WR_HARPOON(p_port+hp_scsisig, (SCSI_ACK + S_ILL_PH));
10295 ACCEPT_MSG(p_port);
10296 }
10297 }
10298
10299 WRW_HARPOON((p_port+hp_intstat), CLR_ALL_INT_1);
10300
10301 WR_HARPOON(p_port+hp_page_ctrl,
10302 (RD_HARPOON(p_port+hp_page_ctrl) & ~G_INT_DISABLE));
10303
10304 return(TRUE); /*Found one of them oldies! */
10305 }
10306}
10307#endif /* DOS */
10308
10309/*---------------------------------------------------------------------
10310 *
10311 * Function: scwtsel
10312 * 6806 *
10313 * Description: Wait to be selected by another SCAM initiator. 6807 * Description: Wait to be selected by another SCAM initiator.
10314 * 6808 *
10315 *---------------------------------------------------------------------*/ 6809 *---------------------------------------------------------------------*/
10316 6810
10317#if defined(DOS) 6811static void FPT_scwtsel(ULONG p_port)
10318void scwtsel(USHORT p_port)
10319#else
10320void scwtsel(ULONG p_port)
10321#endif
10322{ 6812{
10323 while(!(RDW_HARPOON((p_port+hp_intstat)) & SCAM_SEL)) {} 6813 while(!(RDW_HARPOON((p_port+hp_intstat)) & SCAM_SEL)) {}
10324} 6814}
@@ -10326,23 +6816,19 @@ void scwtsel(ULONG p_port)
10326 6816
10327/*--------------------------------------------------------------------- 6817/*---------------------------------------------------------------------
10328 * 6818 *
10329 * Function: inisci 6819 * Function: FPT_inisci
10330 * 6820 *
10331 * Description: Setup the data Structure with the info from the EEPROM. 6821 * Description: Setup the data Structure with the info from the EEPROM.
10332 * 6822 *
10333 *---------------------------------------------------------------------*/ 6823 *---------------------------------------------------------------------*/
10334 6824
10335#if defined(DOS) 6825static void FPT_inisci(UCHAR p_card, ULONG p_port, UCHAR p_our_id)
10336void inisci(UCHAR p_card, USHORT p_port, UCHAR p_our_id)
10337#else
10338void inisci(UCHAR p_card, ULONG p_port, UCHAR p_our_id)
10339#endif
10340{ 6826{
10341 UCHAR i,k,max_id; 6827 UCHAR i,k,max_id;
10342 USHORT ee_data; 6828 USHORT ee_data;
10343 PNVRamInfo pCurrNvRam; 6829 PNVRamInfo pCurrNvRam;
10344 6830
10345 pCurrNvRam = BL_Card[p_card].pNvRamInfo; 6831 pCurrNvRam = FPT_BL_Card[p_card].pNvRamInfo;
10346 6832
10347 if (RD_HARPOON(p_port+hp_page_ctrl) & NARROW_SCSI_CARD) 6833 if (RD_HARPOON(p_port+hp_page_ctrl) & NARROW_SCSI_CARD)
10348 max_id = 0x08; 6834 max_id = 0x08;
@@ -10354,14 +6840,14 @@ void inisci(UCHAR p_card, ULONG p_port, UCHAR p_our_id)
10354 for(i = 0; i < max_id; i++){ 6840 for(i = 0; i < max_id; i++){
10355 6841
10356 for(k = 0; k < 4; k++) 6842 for(k = 0; k < 4; k++)
10357 scamInfo[i].id_string[k] = pCurrNvRam->niScamTbl[i][k]; 6843 FPT_scamInfo[i].id_string[k] = pCurrNvRam->niScamTbl[i][k];
10358 for(k = 4; k < ID_STRING_LENGTH; k++) 6844 for(k = 4; k < ID_STRING_LENGTH; k++)
10359 scamInfo[i].id_string[k] = (UCHAR) 0x00; 6845 FPT_scamInfo[i].id_string[k] = (UCHAR) 0x00;
10360 6846
10361 if(scamInfo[i].id_string[0] == 0x00) 6847 if(FPT_scamInfo[i].id_string[0] == 0x00)
10362 scamInfo[i].state = ID_UNUSED; /*Default to unused ID. */ 6848 FPT_scamInfo[i].state = ID_UNUSED; /*Default to unused ID. */
10363 else 6849 else
10364 scamInfo[i].state = ID_UNASSIGNED; /*Default to unassigned ID. */ 6850 FPT_scamInfo[i].state = ID_UNASSIGNED; /*Default to unassigned ID. */
10365 6851
10366 } 6852 }
10367 }else { 6853 }else {
@@ -10369,38 +6855,38 @@ void inisci(UCHAR p_card, ULONG p_port, UCHAR p_our_id)
10369 { 6855 {
10370 for (k=0; k < ID_STRING_LENGTH; k+=2) 6856 for (k=0; k < ID_STRING_LENGTH; k+=2)
10371 { 6857 {
10372 ee_data = utilEERead(p_port, (USHORT)((EE_SCAMBASE/2) + 6858 ee_data = FPT_utilEERead(p_port, (USHORT)((EE_SCAMBASE/2) +
10373 (USHORT) (i*((USHORT)ID_STRING_LENGTH/2)) + (USHORT)(k/2))); 6859 (USHORT) (i*((USHORT)ID_STRING_LENGTH/2)) + (USHORT)(k/2)));
10374 scamInfo[i].id_string[k] = (UCHAR) ee_data; 6860 FPT_scamInfo[i].id_string[k] = (UCHAR) ee_data;
10375 ee_data >>= 8; 6861 ee_data >>= 8;
10376 scamInfo[i].id_string[k+1] = (UCHAR) ee_data; 6862 FPT_scamInfo[i].id_string[k+1] = (UCHAR) ee_data;
10377 } 6863 }
10378 6864
10379 if ((scamInfo[i].id_string[0] == 0x00) || 6865 if ((FPT_scamInfo[i].id_string[0] == 0x00) ||
10380 (scamInfo[i].id_string[0] == 0xFF)) 6866 (FPT_scamInfo[i].id_string[0] == 0xFF))
10381 6867
10382 scamInfo[i].state = ID_UNUSED; /*Default to unused ID. */ 6868 FPT_scamInfo[i].state = ID_UNUSED; /*Default to unused ID. */
10383 6869
10384 else 6870 else
10385 scamInfo[i].state = ID_UNASSIGNED; /*Default to unassigned ID. */ 6871 FPT_scamInfo[i].state = ID_UNASSIGNED; /*Default to unassigned ID. */
10386 6872
10387 } 6873 }
10388 } 6874 }
10389 for(k = 0; k < ID_STRING_LENGTH; k++) 6875 for(k = 0; k < ID_STRING_LENGTH; k++)
10390 scamInfo[p_our_id].id_string[k] = scamHAString[k]; 6876 FPT_scamInfo[p_our_id].id_string[k] = FPT_scamHAString[k];
10391 6877
10392} 6878}
10393 6879
10394/*--------------------------------------------------------------------- 6880/*---------------------------------------------------------------------
10395 * 6881 *
10396 * Function: scmachid 6882 * Function: FPT_scmachid
10397 * 6883 *
10398 * Description: Match the Device ID string with our values stored in 6884 * Description: Match the Device ID string with our values stored in
10399 * the EEPROM. 6885 * the EEPROM.
10400 * 6886 *
10401 *---------------------------------------------------------------------*/ 6887 *---------------------------------------------------------------------*/
10402 6888
10403UCHAR scmachid(UCHAR p_card, UCHAR p_id_string[]) 6889static UCHAR FPT_scmachid(UCHAR p_card, UCHAR p_id_string[])
10404{ 6890{
10405 6891
10406 UCHAR i,k,match; 6892 UCHAR i,k,match;
@@ -10408,28 +6894,20 @@ UCHAR scmachid(UCHAR p_card, UCHAR p_id_string[])
10408 6894
10409 for (i=0; i < MAX_SCSI_TAR; i++) { 6895 for (i=0; i < MAX_SCSI_TAR; i++) {
10410 6896
10411#if !defined(SCAM_LEV_2) 6897 match = 1;
10412 if (scamInfo[i].state == ID_UNASSIGNED)
10413 {
10414#endif
10415 match = TRUE;
10416 6898
10417 for (k=0; k < ID_STRING_LENGTH; k++) 6899 for (k=0; k < ID_STRING_LENGTH; k++)
10418 { 6900 {
10419 if (p_id_string[k] != scamInfo[i].id_string[k]) 6901 if (p_id_string[k] != FPT_scamInfo[i].id_string[k])
10420 match = FALSE; 6902 match = 0;
10421 } 6903 }
10422 6904
10423 if (match) 6905 if (match)
10424 { 6906 {
10425 scamInfo[i].state = ID_ASSIGNED; 6907 FPT_scamInfo[i].state = ID_ASSIGNED;
10426 return(i); 6908 return(i);
10427 } 6909 }
10428 6910
10429#if !defined(SCAM_LEV_2)
10430 }
10431#endif
10432
10433 } 6911 }
10434 6912
10435 6913
@@ -10448,17 +6926,17 @@ UCHAR scmachid(UCHAR p_card, UCHAR p_id_string[])
10448 { 6926 {
10449 i--; 6927 i--;
10450 6928
10451 if (scamInfo[match].state == ID_UNUSED) 6929 if (FPT_scamInfo[match].state == ID_UNUSED)
10452 { 6930 {
10453 for (k=0; k < ID_STRING_LENGTH; k++) 6931 for (k=0; k < ID_STRING_LENGTH; k++)
10454 { 6932 {
10455 scamInfo[match].id_string[k] = p_id_string[k]; 6933 FPT_scamInfo[match].id_string[k] = p_id_string[k];
10456 } 6934 }
10457 6935
10458 scamInfo[match].state = ID_ASSIGNED; 6936 FPT_scamInfo[match].state = ID_ASSIGNED;
10459 6937
10460 if(BL_Card[p_card].pNvRamInfo == NULL) 6938 if(FPT_BL_Card[p_card].pNvRamInfo == NULL)
10461 BL_Card[p_card].globalFlags |= F_UPDATE_EEPROM; 6939 FPT_BL_Card[p_card].globalFlags |= F_UPDATE_EEPROM;
10462 return(match); 6940 return(match);
10463 6941
10464 } 6942 }
@@ -10498,17 +6976,17 @@ UCHAR scmachid(UCHAR p_card, UCHAR p_id_string[])
10498 6976
10499 i--; 6977 i--;
10500 6978
10501 if (scamInfo[match].state == ID_UNASSIGNED) 6979 if (FPT_scamInfo[match].state == ID_UNASSIGNED)
10502 { 6980 {
10503 for (k=0; k < ID_STRING_LENGTH; k++) 6981 for (k=0; k < ID_STRING_LENGTH; k++)
10504 { 6982 {
10505 scamInfo[match].id_string[k] = p_id_string[k]; 6983 FPT_scamInfo[match].id_string[k] = p_id_string[k];
10506 } 6984 }
10507 6985
10508 scamInfo[match].id_string[0] |= BIT(7); 6986 FPT_scamInfo[match].id_string[0] |= BIT(7);
10509 scamInfo[match].state = ID_ASSIGNED; 6987 FPT_scamInfo[match].state = ID_ASSIGNED;
10510 if(BL_Card[p_card].pNvRamInfo == NULL) 6988 if(FPT_BL_Card[p_card].pNvRamInfo == NULL)
10511 BL_Card[p_card].globalFlags |= F_UPDATE_EEPROM; 6989 FPT_BL_Card[p_card].globalFlags |= F_UPDATE_EEPROM;
10512 return(match); 6990 return(match);
10513 6991
10514 } 6992 }
@@ -10531,17 +7009,13 @@ UCHAR scmachid(UCHAR p_card, UCHAR p_id_string[])
10531 7009
10532/*--------------------------------------------------------------------- 7010/*---------------------------------------------------------------------
10533 * 7011 *
10534 * Function: scsavdi 7012 * Function: FPT_scsavdi
10535 * 7013 *
10536 * Description: Save off the device SCAM ID strings. 7014 * Description: Save off the device SCAM ID strings.
10537 * 7015 *
10538 *---------------------------------------------------------------------*/ 7016 *---------------------------------------------------------------------*/
10539 7017
10540#if defined(DOS) 7018static void FPT_scsavdi(UCHAR p_card, ULONG p_port)
10541void scsavdi(UCHAR p_card, USHORT p_port)
10542#else
10543void scsavdi(UCHAR p_card, ULONG p_port)
10544#endif
10545{ 7019{
10546 UCHAR i,k,max_id; 7020 UCHAR i,k,max_id;
10547 USHORT ee_data,sum_data; 7021 USHORT ee_data,sum_data;
@@ -10551,11 +7025,11 @@ void scsavdi(UCHAR p_card, ULONG p_port)
10551 7025
10552 for (i = 1; i < EE_SCAMBASE/2; i++) 7026 for (i = 1; i < EE_SCAMBASE/2; i++)
10553 { 7027 {
10554 sum_data += utilEERead(p_port, i); 7028 sum_data += FPT_utilEERead(p_port, i);
10555 } 7029 }
10556 7030
10557 7031
10558 utilEEWriteOnOff(p_port,1); /* Enable write access to the EEPROM */ 7032 FPT_utilEEWriteOnOff(p_port,1); /* Enable write access to the EEPROM */
10559 7033
10560 if (RD_HARPOON(p_port+hp_page_ctrl) & NARROW_SCSI_CARD) 7034 if (RD_HARPOON(p_port+hp_page_ctrl) & NARROW_SCSI_CARD)
10561 max_id = 0x08; 7035 max_id = 0x08;
@@ -10568,64 +7042,29 @@ void scsavdi(UCHAR p_card, ULONG p_port)
10568 7042
10569 for (k=0; k < ID_STRING_LENGTH; k+=2) 7043 for (k=0; k < ID_STRING_LENGTH; k+=2)
10570 { 7044 {
10571 ee_data = scamInfo[i].id_string[k+1]; 7045 ee_data = FPT_scamInfo[i].id_string[k+1];
10572 ee_data <<= 8; 7046 ee_data <<= 8;
10573 ee_data |= scamInfo[i].id_string[k]; 7047 ee_data |= FPT_scamInfo[i].id_string[k];
10574 sum_data += ee_data; 7048 sum_data += ee_data;
10575 utilEEWrite(p_port, ee_data, (USHORT)((EE_SCAMBASE/2) + 7049 FPT_utilEEWrite(p_port, ee_data, (USHORT)((EE_SCAMBASE/2) +
10576 (USHORT)(i*((USHORT)ID_STRING_LENGTH/2)) + (USHORT)(k/2))); 7050 (USHORT)(i*((USHORT)ID_STRING_LENGTH/2)) + (USHORT)(k/2)));
10577 } 7051 }
10578 } 7052 }
10579 7053
10580 7054
10581 utilEEWrite(p_port, sum_data, EEPROM_CHECK_SUM/2); 7055 FPT_utilEEWrite(p_port, sum_data, EEPROM_CHECK_SUM/2);
10582 utilEEWriteOnOff(p_port,0); /* Turn off write access */ 7056 FPT_utilEEWriteOnOff(p_port,0); /* Turn off write access */
10583} 7057}
10584#ident "$Id: diagnose.c 1.10 1997/06/10 16:51:47 mohan Exp $"
10585/*----------------------------------------------------------------------
10586 *
10587 *
10588 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
10589 *
10590 * This file is available under both the GNU General Public License
10591 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
10592 *
10593 * $Workfile: diagnose.c $
10594 *
10595 * Description: Diagnostic funtions for testing the integrity of
10596 * the HARPOON.
10597 *
10598 * $Date: 1997/06/10 16:51:47 $
10599 *
10600 * $Revision: 1.10 $
10601 *
10602 *----------------------------------------------------------------------*/
10603
10604/*#include <globals.h>*/
10605
10606#if (FW_TYPE==_UCB_MGR_)
10607 /*#include <budi.h>*/
10608#endif
10609
10610/*#include <sccbmgr.h>*/
10611/*#include <blx30.h>*/
10612/*#include <target.h>*/
10613/*#include <eeprom.h>*/
10614/*#include <harpoon.h>*/
10615 7058
10616/*--------------------------------------------------------------------- 7059/*---------------------------------------------------------------------
10617 * 7060 *
10618 * Function: XbowInit 7061 * Function: FPT_XbowInit
10619 * 7062 *
10620 * Description: Setup the Xbow for normal operation. 7063 * Description: Setup the Xbow for normal operation.
10621 * 7064 *
10622 *---------------------------------------------------------------------*/ 7065 *---------------------------------------------------------------------*/
10623 7066
10624#if defined(DOS) 7067static void FPT_XbowInit(ULONG port, UCHAR ScamFlg)
10625void XbowInit(USHORT port, UCHAR ScamFlg)
10626#else
10627void XbowInit(ULONG port, UCHAR ScamFlg)
10628#endif
10629{ 7068{
10630UCHAR i; 7069UCHAR i;
10631 7070
@@ -10647,18 +7086,13 @@ UCHAR i;
10647 7086
10648 WRW_HARPOON((port+hp_intstat), CLR_ALL_INT); 7087 WRW_HARPOON((port+hp_intstat), CLR_ALL_INT);
10649 7088
10650#if defined(SCAM_LEV_2) 7089 FPT_default_intena = RESET | RSEL | PROG_HLT | TIMEOUT |
10651 default_intena = RESET | RSEL | PROG_HLT | TIMEOUT |
10652 BUS_FREE | XFER_CNT_0 | AUTO_INT; 7090 BUS_FREE | XFER_CNT_0 | AUTO_INT;
10653 7091
10654 if ((ScamFlg & SCAM_ENABLED) && (ScamFlg & SCAM_LEVEL2)) 7092 if ((ScamFlg & SCAM_ENABLED) && (ScamFlg & SCAM_LEVEL2))
10655 default_intena |= SCAM_SEL; 7093 FPT_default_intena |= SCAM_SEL;
10656 7094
10657#else 7095 WRW_HARPOON((port+hp_intena), FPT_default_intena);
10658 default_intena = RESET | RSEL | PROG_HLT | TIMEOUT |
10659 BUS_FREE | XFER_CNT_0 | AUTO_INT;
10660#endif
10661 WRW_HARPOON((port+hp_intena), default_intena);
10662 7096
10663 WR_HARPOON(port+hp_seltimeout,TO_290ms); 7097 WR_HARPOON(port+hp_seltimeout,TO_290ms);
10664 7098
@@ -10667,26 +7101,6 @@ UCHAR i;
10667 if (RD_HARPOON(port+hp_page_ctrl) & NARROW_SCSI_CARD) 7101 if (RD_HARPOON(port+hp_page_ctrl) & NARROW_SCSI_CARD)
10668 WR_HARPOON(port+hp_addstat,SCSI_MODE8); 7102 WR_HARPOON(port+hp_addstat,SCSI_MODE8);
10669 7103
10670#if defined(NO_BIOS_OPTION)
10671
10672 WR_HARPOON(port+hp_synctarg_0,NARROW_SCSI);
10673 WR_HARPOON(port+hp_synctarg_1,NARROW_SCSI);
10674 WR_HARPOON(port+hp_synctarg_2,NARROW_SCSI);
10675 WR_HARPOON(port+hp_synctarg_3,NARROW_SCSI);
10676 WR_HARPOON(port+hp_synctarg_4,NARROW_SCSI);
10677 WR_HARPOON(port+hp_synctarg_5,NARROW_SCSI);
10678 WR_HARPOON(port+hp_synctarg_6,NARROW_SCSI);
10679 WR_HARPOON(port+hp_synctarg_7,NARROW_SCSI);
10680 WR_HARPOON(port+hp_synctarg_8,NARROW_SCSI);
10681 WR_HARPOON(port+hp_synctarg_9,NARROW_SCSI);
10682 WR_HARPOON(port+hp_synctarg_10,NARROW_SCSI);
10683 WR_HARPOON(port+hp_synctarg_11,NARROW_SCSI);
10684 WR_HARPOON(port+hp_synctarg_12,NARROW_SCSI);
10685 WR_HARPOON(port+hp_synctarg_13,NARROW_SCSI);
10686 WR_HARPOON(port+hp_synctarg_14,NARROW_SCSI);
10687 WR_HARPOON(port+hp_synctarg_15,NARROW_SCSI);
10688
10689#endif
10690 WR_HARPOON(port+hp_page_ctrl, i); 7104 WR_HARPOON(port+hp_page_ctrl, i);
10691 7105
10692} 7106}
@@ -10694,17 +7108,13 @@ UCHAR i;
10694 7108
10695/*--------------------------------------------------------------------- 7109/*---------------------------------------------------------------------
10696 * 7110 *
10697 * Function: BusMasterInit 7111 * Function: FPT_BusMasterInit
10698 * 7112 *
10699 * Description: Initialize the BusMaster for normal operations. 7113 * Description: Initialize the BusMaster for normal operations.
10700 * 7114 *
10701 *---------------------------------------------------------------------*/ 7115 *---------------------------------------------------------------------*/
10702 7116
10703#if defined(DOS) 7117static void FPT_BusMasterInit(ULONG p_port)
10704void BusMasterInit(USHORT p_port)
10705#else
10706void BusMasterInit(ULONG p_port)
10707#endif
10708{ 7118{
10709 7119
10710 7120
@@ -10719,13 +7129,6 @@ void BusMasterInit(ULONG p_port)
10719 WR_HARPOON(p_port+hp_ee_ctrl, (SCSI_TERM_ENA_H)); 7129 WR_HARPOON(p_port+hp_ee_ctrl, (SCSI_TERM_ENA_H));
10720 7130
10721 7131
10722#if defined(NT)
10723
10724 WR_HARPOON(p_port+hp_pci_cmd_cfg, (RD_HARPOON(p_port+hp_pci_cmd_cfg)
10725 & ~MEM_SPACE_ENA));
10726
10727#endif
10728
10729 RD_HARPOON(p_port+hp_int_status); /*Clear interrupts. */ 7132 RD_HARPOON(p_port+hp_int_status); /*Clear interrupts. */
10730 WR_HARPOON(p_port+hp_int_mask, (INT_CMD_COMPL | SCSI_INTERRUPT)); 7133 WR_HARPOON(p_port+hp_int_mask, (INT_CMD_COMPL | SCSI_INTERRUPT));
10731 WR_HARPOON(p_port+hp_page_ctrl, (RD_HARPOON(p_port+hp_page_ctrl) & 7134 WR_HARPOON(p_port+hp_page_ctrl, (RD_HARPOON(p_port+hp_page_ctrl) &
@@ -10735,147 +7138,14 @@ void BusMasterInit(ULONG p_port)
10735 7138
10736/*--------------------------------------------------------------------- 7139/*---------------------------------------------------------------------
10737 * 7140 *
10738 * Function: DiagXbow 7141 * Function: FPT_DiagEEPROM
10739 *
10740 * Description: Test Xbow integrity. Non-zero return indicates an error.
10741 *
10742 *---------------------------------------------------------------------*/
10743
10744#if defined(DOS)
10745int DiagXbow(USHORT port)
10746#else
10747int DiagXbow(ULONG port)
10748#endif
10749{
10750 unsigned char fifo_cnt,loop_cnt;
10751
10752 unsigned char fifodata[5];
10753 fifodata[0] = 0x00;
10754 fifodata[1] = 0xFF;
10755 fifodata[2] = 0x55;
10756 fifodata[3] = 0xAA;
10757 fifodata[4] = 0x00;
10758
10759
10760 WRW_HARPOON((port+hp_intstat), CLR_ALL_INT);
10761 WRW_HARPOON((port+hp_intena), 0x0000);
10762
10763 WR_HARPOON(port+hp_seltimeout,TO_5ms);
10764
10765 WR_HARPOON(port+hp_portctrl_0,START_TO);
10766
10767
10768 for(fifodata[4] = 0x01; fifodata[4] != (UCHAR) 0; fifodata[4] = fifodata[4] << 1) {
10769
10770 WR_HARPOON(port+hp_selfid_0,fifodata[4]);
10771 WR_HARPOON(port+hp_selfid_1,fifodata[4]);
10772
10773 if ((RD_HARPOON(port+hp_selfid_0) != fifodata[4]) ||
10774 (RD_HARPOON(port+hp_selfid_1) != fifodata[4]))
10775 return(1);
10776 }
10777
10778
10779 for(loop_cnt = 0; loop_cnt < 4; loop_cnt++) {
10780
10781 WR_HARPOON(port+hp_portctrl_0,(HOST_PORT | HOST_WRT | START_TO));
10782
10783
10784 for (fifo_cnt = 0; fifo_cnt < FIFO_LEN; fifo_cnt++) {
10785
10786 WR_HARPOON(port+hp_fifodata_0, fifodata[loop_cnt]);
10787 }
10788
10789
10790 if (!(RD_HARPOON(port+hp_xferstat) & FIFO_FULL))
10791 return(1);
10792
10793
10794 WR_HARPOON(port+hp_portctrl_0,(HOST_PORT | START_TO));
10795
10796 for (fifo_cnt = 0; fifo_cnt < FIFO_LEN; fifo_cnt++) {
10797
10798 if (RD_HARPOON(port+hp_fifodata_0) != fifodata[loop_cnt])
10799 return(1);
10800 }
10801
10802
10803 if (!(RD_HARPOON(port+hp_xferstat) & FIFO_EMPTY))
10804 return(1);
10805 }
10806
10807
10808 while(!(RDW_HARPOON((port+hp_intstat)) & TIMEOUT)) {}
10809
10810
10811 WR_HARPOON(port+hp_seltimeout,TO_290ms);
10812
10813 WRW_HARPOON((port+hp_intstat), CLR_ALL_INT);
10814
10815 WRW_HARPOON((port+hp_intena), default_intena);
10816
10817 return(0);
10818}
10819
10820
10821/*---------------------------------------------------------------------
10822 *
10823 * Function: DiagBusMaster
10824 *
10825 * Description: Test BusMaster integrity. Non-zero return indicates an
10826 * error.
10827 *
10828 *---------------------------------------------------------------------*/
10829
10830#if defined(DOS)
10831int DiagBusMaster(USHORT port)
10832#else
10833int DiagBusMaster(ULONG port)
10834#endif
10835{
10836 UCHAR testdata;
10837
10838 for(testdata = (UCHAR) 1; testdata != (UCHAR)0; testdata = testdata << 1) {
10839
10840 WR_HARPOON(port+hp_xfer_cnt_lo,testdata);
10841 WR_HARPOON(port+hp_xfer_cnt_mi,testdata);
10842 WR_HARPOON(port+hp_xfer_cnt_hi,testdata);
10843 WR_HARPOON(port+hp_host_addr_lo,testdata);
10844 WR_HARPOON(port+hp_host_addr_lmi,testdata);
10845 WR_HARPOON(port+hp_host_addr_hmi,testdata);
10846 WR_HARPOON(port+hp_host_addr_hi,testdata);
10847
10848 if ((RD_HARPOON(port+hp_xfer_cnt_lo) != testdata) ||
10849 (RD_HARPOON(port+hp_xfer_cnt_mi) != testdata) ||
10850 (RD_HARPOON(port+hp_xfer_cnt_hi) != testdata) ||
10851 (RD_HARPOON(port+hp_host_addr_lo) != testdata) ||
10852 (RD_HARPOON(port+hp_host_addr_lmi) != testdata) ||
10853 (RD_HARPOON(port+hp_host_addr_hmi) != testdata) ||
10854 (RD_HARPOON(port+hp_host_addr_hi) != testdata))
10855
10856 return(1);
10857 }
10858 RD_HARPOON(port+hp_int_status); /*Clear interrupts. */
10859 return(0);
10860}
10861
10862
10863
10864/*---------------------------------------------------------------------
10865 *
10866 * Function: DiagEEPROM
10867 * 7142 *
10868 * Description: Verfiy checksum and 'Key' and initialize the EEPROM if 7143 * Description: Verfiy checksum and 'Key' and initialize the EEPROM if
10869 * necessary. 7144 * necessary.
10870 * 7145 *
10871 *---------------------------------------------------------------------*/ 7146 *---------------------------------------------------------------------*/
10872 7147
10873#if defined(DOS) 7148static void FPT_DiagEEPROM(ULONG p_port)
10874void DiagEEPROM(USHORT p_port)
10875#else
10876void DiagEEPROM(ULONG p_port)
10877#endif
10878
10879{ 7149{
10880 USHORT index,temp,max_wd_cnt; 7150 USHORT index,temp,max_wd_cnt;
10881 7151
@@ -10884,185 +7154,148 @@ void DiagEEPROM(ULONG p_port)
10884 else 7154 else
10885 max_wd_cnt = EEPROM_WD_CNT * 2; 7155 max_wd_cnt = EEPROM_WD_CNT * 2;
10886 7156
10887 temp = utilEERead(p_port, FW_SIGNATURE/2); 7157 temp = FPT_utilEERead(p_port, FW_SIGNATURE/2);
10888 7158
10889 if (temp == 0x4641) { 7159 if (temp == 0x4641) {
10890 7160
10891 for (index = 2; index < max_wd_cnt; index++) { 7161 for (index = 2; index < max_wd_cnt; index++) {
10892 7162
10893 temp += utilEERead(p_port, index); 7163 temp += FPT_utilEERead(p_port, index);
10894 7164
10895 } 7165 }
10896 7166
10897 if (temp == utilEERead(p_port, EEPROM_CHECK_SUM/2)) { 7167 if (temp == FPT_utilEERead(p_port, EEPROM_CHECK_SUM/2)) {
10898 7168
10899 return; /*EEPROM is Okay so return now! */ 7169 return; /*EEPROM is Okay so return now! */
10900 } 7170 }
10901 } 7171 }
10902 7172
10903 7173
10904 utilEEWriteOnOff(p_port,(UCHAR)1); 7174 FPT_utilEEWriteOnOff(p_port,(UCHAR)1);
10905 7175
10906 for (index = 0; index < max_wd_cnt; index++) { 7176 for (index = 0; index < max_wd_cnt; index++) {
10907 7177
10908 utilEEWrite(p_port, 0x0000, index); 7178 FPT_utilEEWrite(p_port, 0x0000, index);
10909 } 7179 }
10910 7180
10911 temp = 0; 7181 temp = 0;
10912 7182
10913 utilEEWrite(p_port, 0x4641, FW_SIGNATURE/2); 7183 FPT_utilEEWrite(p_port, 0x4641, FW_SIGNATURE/2);
10914 temp += 0x4641; 7184 temp += 0x4641;
10915 utilEEWrite(p_port, 0x3920, MODEL_NUMB_0/2); 7185 FPT_utilEEWrite(p_port, 0x3920, MODEL_NUMB_0/2);
10916 temp += 0x3920; 7186 temp += 0x3920;
10917 utilEEWrite(p_port, 0x3033, MODEL_NUMB_2/2); 7187 FPT_utilEEWrite(p_port, 0x3033, MODEL_NUMB_2/2);
10918 temp += 0x3033; 7188 temp += 0x3033;
10919 utilEEWrite(p_port, 0x2020, MODEL_NUMB_4/2); 7189 FPT_utilEEWrite(p_port, 0x2020, MODEL_NUMB_4/2);
10920 temp += 0x2020; 7190 temp += 0x2020;
10921 utilEEWrite(p_port, 0x70D3, SYSTEM_CONFIG/2); 7191 FPT_utilEEWrite(p_port, 0x70D3, SYSTEM_CONFIG/2);
10922 temp += 0x70D3; 7192 temp += 0x70D3;
10923 utilEEWrite(p_port, 0x0010, BIOS_CONFIG/2); 7193 FPT_utilEEWrite(p_port, 0x0010, BIOS_CONFIG/2);
10924 temp += 0x0010; 7194 temp += 0x0010;
10925 utilEEWrite(p_port, 0x0003, SCAM_CONFIG/2); 7195 FPT_utilEEWrite(p_port, 0x0003, SCAM_CONFIG/2);
10926 temp += 0x0003; 7196 temp += 0x0003;
10927 utilEEWrite(p_port, 0x0007, ADAPTER_SCSI_ID/2); 7197 FPT_utilEEWrite(p_port, 0x0007, ADAPTER_SCSI_ID/2);
10928 temp += 0x0007; 7198 temp += 0x0007;
10929 7199
10930 utilEEWrite(p_port, 0x0000, IGNORE_B_SCAN/2); 7200 FPT_utilEEWrite(p_port, 0x0000, IGNORE_B_SCAN/2);
10931 temp += 0x0000; 7201 temp += 0x0000;
10932 utilEEWrite(p_port, 0x0000, SEND_START_ENA/2); 7202 FPT_utilEEWrite(p_port, 0x0000, SEND_START_ENA/2);
10933 temp += 0x0000; 7203 temp += 0x0000;
10934 utilEEWrite(p_port, 0x0000, DEVICE_ENABLE/2); 7204 FPT_utilEEWrite(p_port, 0x0000, DEVICE_ENABLE/2);
10935 temp += 0x0000; 7205 temp += 0x0000;
10936 7206
10937 utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL01/2); 7207 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL01/2);
10938 temp += 0x4242; 7208 temp += 0x4242;
10939 utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL23/2); 7209 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL23/2);
10940 temp += 0x4242; 7210 temp += 0x4242;
10941 utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL45/2); 7211 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL45/2);
10942 temp += 0x4242; 7212 temp += 0x4242;
10943 utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL67/2); 7213 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL67/2);
10944 temp += 0x4242; 7214 temp += 0x4242;
10945 utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL89/2); 7215 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL89/2);
10946 temp += 0x4242; 7216 temp += 0x4242;
10947 utilEEWrite(p_port, 0x4242, SYNC_RATE_TBLab/2); 7217 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBLab/2);
10948 temp += 0x4242; 7218 temp += 0x4242;
10949 utilEEWrite(p_port, 0x4242, SYNC_RATE_TBLcd/2); 7219 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBLcd/2);
10950 temp += 0x4242; 7220 temp += 0x4242;
10951 utilEEWrite(p_port, 0x4242, SYNC_RATE_TBLef/2); 7221 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBLef/2);
10952 temp += 0x4242; 7222 temp += 0x4242;
10953 7223
10954 7224
10955 utilEEWrite(p_port, 0x6C46, 64/2); /*PRODUCT ID */ 7225 FPT_utilEEWrite(p_port, 0x6C46, 64/2); /*PRODUCT ID */
10956 temp += 0x6C46; 7226 temp += 0x6C46;
10957 utilEEWrite(p_port, 0x7361, 66/2); /* FlashPoint LT */ 7227 FPT_utilEEWrite(p_port, 0x7361, 66/2); /* FlashPoint LT */
10958 temp += 0x7361; 7228 temp += 0x7361;
10959 utilEEWrite(p_port, 0x5068, 68/2); 7229 FPT_utilEEWrite(p_port, 0x5068, 68/2);
10960 temp += 0x5068; 7230 temp += 0x5068;
10961 utilEEWrite(p_port, 0x696F, 70/2); 7231 FPT_utilEEWrite(p_port, 0x696F, 70/2);
10962 temp += 0x696F; 7232 temp += 0x696F;
10963 utilEEWrite(p_port, 0x746E, 72/2); 7233 FPT_utilEEWrite(p_port, 0x746E, 72/2);
10964 temp += 0x746E; 7234 temp += 0x746E;
10965 utilEEWrite(p_port, 0x4C20, 74/2); 7235 FPT_utilEEWrite(p_port, 0x4C20, 74/2);
10966 temp += 0x4C20; 7236 temp += 0x4C20;
10967 utilEEWrite(p_port, 0x2054, 76/2); 7237 FPT_utilEEWrite(p_port, 0x2054, 76/2);
10968 temp += 0x2054; 7238 temp += 0x2054;
10969 utilEEWrite(p_port, 0x2020, 78/2); 7239 FPT_utilEEWrite(p_port, 0x2020, 78/2);
10970 temp += 0x2020; 7240 temp += 0x2020;
10971 7241
10972 index = ((EE_SCAMBASE/2)+(7*16)); 7242 index = ((EE_SCAMBASE/2)+(7*16));
10973 utilEEWrite(p_port, (0x0700+TYPE_CODE0), index); 7243 FPT_utilEEWrite(p_port, (0x0700+TYPE_CODE0), index);
10974 temp += (0x0700+TYPE_CODE0); 7244 temp += (0x0700+TYPE_CODE0);
10975 index++; 7245 index++;
10976 utilEEWrite(p_port, 0x5542, index); /*Vendor ID code */ 7246 FPT_utilEEWrite(p_port, 0x5542, index); /*Vendor ID code */
10977 temp += 0x5542; /* BUSLOGIC */ 7247 temp += 0x5542; /* BUSLOGIC */
10978 index++; 7248 index++;
10979 utilEEWrite(p_port, 0x4C53, index); 7249 FPT_utilEEWrite(p_port, 0x4C53, index);
10980 temp += 0x4C53; 7250 temp += 0x4C53;
10981 index++; 7251 index++;
10982 utilEEWrite(p_port, 0x474F, index); 7252 FPT_utilEEWrite(p_port, 0x474F, index);
10983 temp += 0x474F; 7253 temp += 0x474F;
10984 index++; 7254 index++;
10985 utilEEWrite(p_port, 0x4349, index); 7255 FPT_utilEEWrite(p_port, 0x4349, index);
10986 temp += 0x4349; 7256 temp += 0x4349;
10987 index++; 7257 index++;
10988 utilEEWrite(p_port, 0x5442, index); /*Vendor unique code */ 7258 FPT_utilEEWrite(p_port, 0x5442, index); /*Vendor unique code */
10989 temp += 0x5442; /* BT- 930 */ 7259 temp += 0x5442; /* BT- 930 */
10990 index++; 7260 index++;
10991 utilEEWrite(p_port, 0x202D, index); 7261 FPT_utilEEWrite(p_port, 0x202D, index);
10992 temp += 0x202D; 7262 temp += 0x202D;
10993 index++; 7263 index++;
10994 utilEEWrite(p_port, 0x3339, index); 7264 FPT_utilEEWrite(p_port, 0x3339, index);
10995 temp += 0x3339; 7265 temp += 0x3339;
10996 index++; /*Serial # */ 7266 index++; /*Serial # */
10997 utilEEWrite(p_port, 0x2030, index); /* 01234567 */ 7267 FPT_utilEEWrite(p_port, 0x2030, index); /* 01234567 */
10998 temp += 0x2030; 7268 temp += 0x2030;
10999 index++; 7269 index++;
11000 utilEEWrite(p_port, 0x5453, index); 7270 FPT_utilEEWrite(p_port, 0x5453, index);
11001 temp += 0x5453; 7271 temp += 0x5453;
11002 index++; 7272 index++;
11003 utilEEWrite(p_port, 0x5645, index); 7273 FPT_utilEEWrite(p_port, 0x5645, index);
11004 temp += 0x5645; 7274 temp += 0x5645;
11005 index++; 7275 index++;
11006 utilEEWrite(p_port, 0x2045, index); 7276 FPT_utilEEWrite(p_port, 0x2045, index);
11007 temp += 0x2045; 7277 temp += 0x2045;
11008 index++; 7278 index++;
11009 utilEEWrite(p_port, 0x202F, index); 7279 FPT_utilEEWrite(p_port, 0x202F, index);
11010 temp += 0x202F; 7280 temp += 0x202F;
11011 index++; 7281 index++;
11012 utilEEWrite(p_port, 0x4F4A, index); 7282 FPT_utilEEWrite(p_port, 0x4F4A, index);
11013 temp += 0x4F4A; 7283 temp += 0x4F4A;
11014 index++; 7284 index++;
11015 utilEEWrite(p_port, 0x204E, index); 7285 FPT_utilEEWrite(p_port, 0x204E, index);
11016 temp += 0x204E; 7286 temp += 0x204E;
11017 index++; 7287 index++;
11018 utilEEWrite(p_port, 0x3539, index); 7288 FPT_utilEEWrite(p_port, 0x3539, index);
11019 temp += 0x3539; 7289 temp += 0x3539;
11020 7290
11021 7291
11022 7292
11023 utilEEWrite(p_port, temp, EEPROM_CHECK_SUM/2); 7293 FPT_utilEEWrite(p_port, temp, EEPROM_CHECK_SUM/2);
11024 7294
11025 utilEEWriteOnOff(p_port,(UCHAR)0); 7295 FPT_utilEEWriteOnOff(p_port,(UCHAR)0);
11026 7296
11027} 7297}
11028 7298
11029#ident "$Id: utility.c 1.23 1997/06/10 16:55:06 mohan Exp $"
11030/*----------------------------------------------------------------------
11031 *
11032 *
11033 * Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
11034 *
11035 * This file is available under both the GNU General Public License
11036 * and a BSD-style copyright; see LICENSE.FlashPoint for details.
11037 *
11038 * $Workfile: utility.c $
11039 *
11040 * Description: Utility functions relating to queueing and EEPROM
11041 * manipulation and any other garbage functions.
11042 *
11043 * $Date: 1997/06/10 16:55:06 $
11044 *
11045 * $Revision: 1.23 $
11046 *
11047 *----------------------------------------------------------------------*/
11048/*#include <globals.h>*/
11049
11050#if (FW_TYPE==_UCB_MGR_)
11051 /*#include <budi.h>*/
11052#endif
11053
11054/*#include <sccbmgr.h>*/
11055/*#include <blx30.h>*/
11056/*#include <target.h>*/
11057/*#include <scsi2.h>*/
11058/*#include <harpoon.h>*/
11059
11060
11061/*
11062extern SCCBCARD BL_Card[MAX_CARDS];
11063extern SCCBMGR_TAR_INFO sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR];
11064extern unsigned int SccbGlobalFlags;
11065*/
11066 7299
11067/*--------------------------------------------------------------------- 7300/*---------------------------------------------------------------------
11068 * 7301 *
@@ -11072,7 +7305,7 @@ extern unsigned int SccbGlobalFlags;
11072 * 7305 *
11073 *---------------------------------------------------------------------*/ 7306 *---------------------------------------------------------------------*/
11074 7307
11075void queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card) 7308static void FPT_queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card)
11076{ 7309{
11077 UCHAR scan_ptr, lun; 7310 UCHAR scan_ptr, lun;
11078 PSCCBMgr_tar_info currTar_Info; 7311 PSCCBMgr_tar_info currTar_Info;
@@ -11081,7 +7314,7 @@ void queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card)
11081 scan_ptr = pCurrCard->scanIndex; 7314 scan_ptr = pCurrCard->scanIndex;
11082 do 7315 do
11083 { 7316 {
11084 currTar_Info = &sccbMgrTbl[p_card][scan_ptr]; 7317 currTar_Info = &FPT_sccbMgrTbl[p_card][scan_ptr];
11085 if((pCurrCard->globalFlags & F_CONLUN_IO) && 7318 if((pCurrCard->globalFlags & F_CONLUN_IO) &&
11086 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)) 7319 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))
11087 { 7320 {
@@ -11094,7 +7327,7 @@ void queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card)
11094 7327
11095 for(lun=0; lun < MAX_LUN; lun++) 7328 for(lun=0; lun < MAX_LUN; lun++)
11096 { 7329 {
11097 if(currTar_Info->TarLUNBusy[lun] == FALSE) 7330 if(currTar_Info->TarLUNBusy[lun] == 0)
11098 { 7331 {
11099 7332
11100 pCurrCard->currentSCCB = currTar_Info->TarSelQ_Head; 7333 pCurrCard->currentSCCB = currTar_Info->TarSelQ_Head;
@@ -11153,7 +7386,7 @@ void queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card)
11153 else 7386 else
11154 { 7387 {
11155 if ((currTar_Info->TarSelQ_Cnt != 0) && 7388 if ((currTar_Info->TarSelQ_Cnt != 0) &&
11156 (currTar_Info->TarLUNBusy[0] == FALSE)) 7389 (currTar_Info->TarLUNBusy[0] == 0))
11157 { 7390 {
11158 7391
11159 pCurrCard->currentSCCB = currTar_Info->TarSelQ_Head; 7392 pCurrCard->currentSCCB = currTar_Info->TarSelQ_Head;
@@ -11203,7 +7436,7 @@ void queueSearchSelect(PSCCBcard pCurrCard, UCHAR p_card)
11203 * 7436 *
11204 *---------------------------------------------------------------------*/ 7437 *---------------------------------------------------------------------*/
11205 7438
11206void queueSelectFail(PSCCBcard pCurrCard, UCHAR p_card) 7439static void FPT_queueSelectFail(PSCCBcard pCurrCard, UCHAR p_card)
11207{ 7440{
11208 UCHAR thisTarg; 7441 UCHAR thisTarg;
11209 PSCCBMgr_tar_info currTar_Info; 7442 PSCCBMgr_tar_info currTar_Info;
@@ -11211,7 +7444,7 @@ void queueSelectFail(PSCCBcard pCurrCard, UCHAR p_card)
11211 if (pCurrCard->currentSCCB != NULL) 7444 if (pCurrCard->currentSCCB != NULL)
11212 { 7445 {
11213 thisTarg = (UCHAR)(((PSCCB)(pCurrCard->currentSCCB))->TargID); 7446 thisTarg = (UCHAR)(((PSCCB)(pCurrCard->currentSCCB))->TargID);
11214 currTar_Info = &sccbMgrTbl[p_card][thisTarg]; 7447 currTar_Info = &FPT_sccbMgrTbl[p_card][thisTarg];
11215 7448
11216 pCurrCard->currentSCCB->Sccb_backlink = (PSCCB)NULL; 7449 pCurrCard->currentSCCB->Sccb_backlink = (PSCCB)NULL;
11217 7450
@@ -11242,103 +7475,10 @@ void queueSelectFail(PSCCBcard pCurrCard, UCHAR p_card)
11242 * 7475 *
11243 *---------------------------------------------------------------------*/ 7476 *---------------------------------------------------------------------*/
11244 7477
11245void queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_sccb, UCHAR p_card) 7478static void FPT_queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_sccb,
7479 UCHAR p_card)
11246{ 7480{
11247 7481
11248#if (FW_TYPE==_UCB_MGR_)
11249
11250 u08bits SCSIcmd;
11251 CALL_BK_FN callback;
11252 PSCCBMgr_tar_info currTar_Info;
11253
11254 PUCB p_ucb;
11255 p_ucb=p_sccb->Sccb_ucb_ptr;
11256
11257 SCSIcmd = p_sccb->Cdb[0];
11258
11259
11260 if (!(p_sccb->Sccb_XferState & F_ALL_XFERRED))
11261 {
11262
11263 if ((p_ucb->UCB_opcode & OPC_CHK_UNDER_OVER_RUN) &&
11264 (p_sccb->HostStatus == SCCB_COMPLETE) &&
11265 (p_sccb->TargetStatus != SSCHECK))
11266
11267 if ((SCSIcmd == SCSI_READ) ||
11268 (SCSIcmd == SCSI_WRITE) ||
11269 (SCSIcmd == SCSI_READ_EXTENDED) ||
11270 (SCSIcmd == SCSI_WRITE_EXTENDED) ||
11271 (SCSIcmd == SCSI_WRITE_AND_VERIFY) ||
11272 (SCSIcmd == SCSI_START_STOP_UNIT) ||
11273 (pCurrCard->globalFlags & F_NO_FILTER)
11274 )
11275 p_sccb->HostStatus = SCCB_DATA_UNDER_RUN;
11276 }
11277
11278 p_ucb->UCB_status=SCCB_SUCCESS;
11279
11280 if ((p_ucb->UCB_hbastat=p_sccb->HostStatus) || (p_ucb->UCB_scsistat=p_sccb->TargetStatus))
11281 {
11282 p_ucb->UCB_status=SCCB_ERROR;
11283 }
11284
11285 if ((p_sccb->OperationCode == RESIDUAL_SG_COMMAND) ||
11286 (p_sccb->OperationCode == RESIDUAL_COMMAND))
11287 {
11288
11289 utilUpdateResidual(p_sccb);
11290
11291 p_ucb->UCB_datalen=p_sccb->DataLength;
11292 }
11293
11294 pCurrCard->cmdCounter--;
11295 if (!pCurrCard->cmdCounter)
11296 {
11297
11298 if (pCurrCard->globalFlags & F_GREEN_PC)
11299 {
11300 WR_HARPOON(pCurrCard->ioPort+hp_clkctrl_0,(PWR_DWN | CLKCTRL_DEFAULT));
11301 WR_HARPOON(pCurrCard->ioPort+hp_sys_ctrl, STOP_CLK);
11302 }
11303
11304 WR_HARPOON(pCurrCard->ioPort+hp_semaphore,
11305 (RD_HARPOON(pCurrCard->ioPort+hp_semaphore) & ~SCCB_MGR_ACTIVE));
11306 }
11307
11308 if(pCurrCard->discQCount != 0)
11309 {
11310 currTar_Info = &sccbMgrTbl[p_card][p_sccb->TargID];
11311 if(((pCurrCard->globalFlags & F_CONLUN_IO) &&
11312 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)))
11313 {
11314 pCurrCard->discQCount--;
11315 pCurrCard->discQ_Tbl[currTar_Info->LunDiscQ_Idx[p_sccb->Lun]] = NULL;
11316 }
11317 else
11318 {
11319 if(p_sccb->Sccb_tag)
11320 {
11321 pCurrCard->discQCount--;
11322 pCurrCard->discQ_Tbl[p_sccb->Sccb_tag] = NULL;
11323 }else
11324 {
11325 pCurrCard->discQCount--;
11326 pCurrCard->discQ_Tbl[currTar_Info->LunDiscQ_Idx[0]] = NULL;
11327 }
11328 }
11329
11330 }
11331 callback = (CALL_BK_FN)p_ucb->UCB_callback;
11332 callback(p_ucb);
11333 pCurrCard->globalFlags |= F_NEW_SCCB_CMD;
11334 pCurrCard->currentSCCB = NULL;
11335}
11336
11337
11338
11339
11340#else
11341
11342 UCHAR i, SCSIcmd; 7482 UCHAR i, SCSIcmd;
11343 CALL_BK_FN callback; 7483 CALL_BK_FN callback;
11344 PSCCBMgr_tar_info currTar_Info; 7484 PSCCBMgr_tar_info currTar_Info;
@@ -11383,7 +7523,7 @@ void queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_sccb, UCHAR p_card)
11383 if ((p_sccb->OperationCode == RESIDUAL_SG_COMMAND) || 7523 if ((p_sccb->OperationCode == RESIDUAL_SG_COMMAND) ||
11384 (p_sccb->OperationCode == RESIDUAL_COMMAND)) { 7524 (p_sccb->OperationCode == RESIDUAL_COMMAND)) {
11385 7525
11386 utilUpdateResidual(p_sccb); 7526 FPT_utilUpdateResidual(p_sccb);
11387 } 7527 }
11388 7528
11389 pCurrCard->cmdCounter--; 7529 pCurrCard->cmdCounter--;
@@ -11401,7 +7541,7 @@ void queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_sccb, UCHAR p_card)
11401 7541
11402 if(pCurrCard->discQCount != 0) 7542 if(pCurrCard->discQCount != 0)
11403 { 7543 {
11404 currTar_Info = &sccbMgrTbl[p_card][p_sccb->TargID]; 7544 currTar_Info = &FPT_sccbMgrTbl[p_card][p_sccb->TargID];
11405 if(((pCurrCard->globalFlags & F_CONLUN_IO) && 7545 if(((pCurrCard->globalFlags & F_CONLUN_IO) &&
11406 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))) 7546 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)))
11407 { 7547 {
@@ -11428,7 +7568,6 @@ void queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_sccb, UCHAR p_card)
11428 pCurrCard->globalFlags |= F_NEW_SCCB_CMD; 7568 pCurrCard->globalFlags |= F_NEW_SCCB_CMD;
11429 pCurrCard->currentSCCB = NULL; 7569 pCurrCard->currentSCCB = NULL;
11430} 7570}
11431#endif /* ( if FW_TYPE==...) */
11432 7571
11433 7572
11434/*--------------------------------------------------------------------- 7573/*---------------------------------------------------------------------
@@ -11438,30 +7577,30 @@ void queueCmdComplete(PSCCBcard pCurrCard, PSCCB p_sccb, UCHAR p_card)
11438 * Description: Add SCCB to our disconnect array. 7577 * Description: Add SCCB to our disconnect array.
11439 * 7578 *
11440 *---------------------------------------------------------------------*/ 7579 *---------------------------------------------------------------------*/
11441void queueDisconnect(PSCCB p_sccb, UCHAR p_card) 7580static void FPT_queueDisconnect(PSCCB p_sccb, UCHAR p_card)
11442{ 7581{
11443 PSCCBMgr_tar_info currTar_Info; 7582 PSCCBMgr_tar_info currTar_Info;
11444 7583
11445 currTar_Info = &sccbMgrTbl[p_card][p_sccb->TargID]; 7584 currTar_Info = &FPT_sccbMgrTbl[p_card][p_sccb->TargID];
11446 7585
11447 if(((BL_Card[p_card].globalFlags & F_CONLUN_IO) && 7586 if(((FPT_BL_Card[p_card].globalFlags & F_CONLUN_IO) &&
11448 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))) 7587 ((currTar_Info->TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING)))
11449 { 7588 {
11450 BL_Card[p_card].discQ_Tbl[currTar_Info->LunDiscQ_Idx[p_sccb->Lun]] = p_sccb; 7589 FPT_BL_Card[p_card].discQ_Tbl[currTar_Info->LunDiscQ_Idx[p_sccb->Lun]] = p_sccb;
11451 } 7590 }
11452 else 7591 else
11453 { 7592 {
11454 if (p_sccb->Sccb_tag) 7593 if (p_sccb->Sccb_tag)
11455 { 7594 {
11456 BL_Card[p_card].discQ_Tbl[p_sccb->Sccb_tag] = p_sccb; 7595 FPT_BL_Card[p_card].discQ_Tbl[p_sccb->Sccb_tag] = p_sccb;
11457 sccbMgrTbl[p_card][p_sccb->TargID].TarLUNBusy[0] = FALSE; 7596 FPT_sccbMgrTbl[p_card][p_sccb->TargID].TarLUNBusy[0] = 0;
11458 sccbMgrTbl[p_card][p_sccb->TargID].TarTagQ_Cnt++; 7597 FPT_sccbMgrTbl[p_card][p_sccb->TargID].TarTagQ_Cnt++;
11459 }else 7598 }else
11460 { 7599 {
11461 BL_Card[p_card].discQ_Tbl[currTar_Info->LunDiscQ_Idx[0]] = p_sccb; 7600 FPT_BL_Card[p_card].discQ_Tbl[currTar_Info->LunDiscQ_Idx[0]] = p_sccb;
11462 } 7601 }
11463 } 7602 }
11464 BL_Card[p_card].currentSCCB = NULL; 7603 FPT_BL_Card[p_card].currentSCCB = NULL;
11465} 7604}
11466 7605
11467 7606
@@ -11473,29 +7612,29 @@ void queueDisconnect(PSCCB p_sccb, UCHAR p_card)
11473 * 7612 *
11474 *---------------------------------------------------------------------*/ 7613 *---------------------------------------------------------------------*/
11475 7614
11476void queueFlushSccb(UCHAR p_card, UCHAR error_code) 7615static void FPT_queueFlushSccb(UCHAR p_card, UCHAR error_code)
11477{ 7616{
11478 UCHAR qtag,thisTarg; 7617 UCHAR qtag,thisTarg;
11479 PSCCB currSCCB; 7618 PSCCB currSCCB;
11480 PSCCBMgr_tar_info currTar_Info; 7619 PSCCBMgr_tar_info currTar_Info;
11481 7620
11482 currSCCB = BL_Card[p_card].currentSCCB; 7621 currSCCB = FPT_BL_Card[p_card].currentSCCB;
11483 if(currSCCB != NULL) 7622 if(currSCCB != NULL)
11484 { 7623 {
11485 thisTarg = (UCHAR)currSCCB->TargID; 7624 thisTarg = (UCHAR)currSCCB->TargID;
11486 currTar_Info = &sccbMgrTbl[p_card][thisTarg]; 7625 currTar_Info = &FPT_sccbMgrTbl[p_card][thisTarg];
11487 7626
11488 for (qtag=0; qtag<QUEUE_DEPTH; qtag++) { 7627 for (qtag=0; qtag<QUEUE_DEPTH; qtag++) {
11489 7628
11490 if (BL_Card[p_card].discQ_Tbl[qtag] && 7629 if (FPT_BL_Card[p_card].discQ_Tbl[qtag] &&
11491 (BL_Card[p_card].discQ_Tbl[qtag]->TargID == thisTarg)) 7630 (FPT_BL_Card[p_card].discQ_Tbl[qtag]->TargID == thisTarg))
11492 { 7631 {
11493 7632
11494 BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = (UCHAR)error_code; 7633 FPT_BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = (UCHAR)error_code;
11495 7634
11496 queueCmdComplete(&BL_Card[p_card],BL_Card[p_card].discQ_Tbl[qtag], p_card); 7635 FPT_queueCmdComplete(&FPT_BL_Card[p_card],FPT_BL_Card[p_card].discQ_Tbl[qtag], p_card);
11497 7636
11498 BL_Card[p_card].discQ_Tbl[qtag] = NULL; 7637 FPT_BL_Card[p_card].discQ_Tbl[qtag] = NULL;
11499 currTar_Info->TarTagQ_Cnt--; 7638 currTar_Info->TarTagQ_Cnt--;
11500 7639
11501 } 7640 }
@@ -11512,24 +7651,25 @@ void queueFlushSccb(UCHAR p_card, UCHAR error_code)
11512 * 7651 *
11513 *---------------------------------------------------------------------*/ 7652 *---------------------------------------------------------------------*/
11514 7653
11515void queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg, UCHAR error_code) 7654static void FPT_queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg,
7655 UCHAR error_code)
11516{ 7656{
11517 UCHAR qtag; 7657 UCHAR qtag;
11518 PSCCBMgr_tar_info currTar_Info; 7658 PSCCBMgr_tar_info currTar_Info;
11519 7659
11520 currTar_Info = &sccbMgrTbl[p_card][thisTarg]; 7660 currTar_Info = &FPT_sccbMgrTbl[p_card][thisTarg];
11521 7661
11522 for (qtag=0; qtag<QUEUE_DEPTH; qtag++) { 7662 for (qtag=0; qtag<QUEUE_DEPTH; qtag++) {
11523 7663
11524 if (BL_Card[p_card].discQ_Tbl[qtag] && 7664 if (FPT_BL_Card[p_card].discQ_Tbl[qtag] &&
11525 (BL_Card[p_card].discQ_Tbl[qtag]->TargID == thisTarg)) 7665 (FPT_BL_Card[p_card].discQ_Tbl[qtag]->TargID == thisTarg))
11526 { 7666 {
11527 7667
11528 BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = (UCHAR)error_code; 7668 FPT_BL_Card[p_card].discQ_Tbl[qtag]->HostStatus = (UCHAR)error_code;
11529 7669
11530 queueCmdComplete(&BL_Card[p_card],BL_Card[p_card].discQ_Tbl[qtag], p_card); 7670 FPT_queueCmdComplete(&FPT_BL_Card[p_card],FPT_BL_Card[p_card].discQ_Tbl[qtag], p_card);
11531 7671
11532 BL_Card[p_card].discQ_Tbl[qtag] = NULL; 7672 FPT_BL_Card[p_card].discQ_Tbl[qtag] = NULL;
11533 currTar_Info->TarTagQ_Cnt--; 7673 currTar_Info->TarTagQ_Cnt--;
11534 7674
11535 } 7675 }
@@ -11541,10 +7681,10 @@ void queueFlushTargSccb(UCHAR p_card, UCHAR thisTarg, UCHAR error_code)
11541 7681
11542 7682
11543 7683
11544void queueAddSccb(PSCCB p_SCCB, UCHAR p_card) 7684static void FPT_queueAddSccb(PSCCB p_SCCB, UCHAR p_card)
11545{ 7685{
11546 PSCCBMgr_tar_info currTar_Info; 7686 PSCCBMgr_tar_info currTar_Info;
11547 currTar_Info = &sccbMgrTbl[p_card][p_SCCB->TargID]; 7687 currTar_Info = &FPT_sccbMgrTbl[p_card][p_SCCB->TargID];
11548 7688
11549 p_SCCB->Sccb_forwardlink = NULL; 7689 p_SCCB->Sccb_forwardlink = NULL;
11550 7690
@@ -11575,12 +7715,12 @@ void queueAddSccb(PSCCB p_SCCB, UCHAR p_card)
11575 * 7715 *
11576 *---------------------------------------------------------------------*/ 7716 *---------------------------------------------------------------------*/
11577 7717
11578UCHAR queueFindSccb(PSCCB p_SCCB, UCHAR p_card) 7718static UCHAR FPT_queueFindSccb(PSCCB p_SCCB, UCHAR p_card)
11579{ 7719{
11580 PSCCB q_ptr; 7720 PSCCB q_ptr;
11581 PSCCBMgr_tar_info currTar_Info; 7721 PSCCBMgr_tar_info currTar_Info;
11582 7722
11583 currTar_Info = &sccbMgrTbl[p_card][p_SCCB->TargID]; 7723 currTar_Info = &FPT_sccbMgrTbl[p_card][p_SCCB->TargID];
11584 7724
11585 q_ptr = currTar_Info->TarSelQ_Head; 7725 q_ptr = currTar_Info->TarSelQ_Head;
11586 7726
@@ -11609,7 +7749,7 @@ UCHAR queueFindSccb(PSCCB p_SCCB, UCHAR p_card)
11609 7749
11610 currTar_Info->TarSelQ_Cnt--; 7750 currTar_Info->TarSelQ_Cnt--;
11611 7751
11612 return(TRUE); 7752 return(1);
11613 } 7753 }
11614 7754
11615 else { 7755 else {
@@ -11618,7 +7758,7 @@ UCHAR queueFindSccb(PSCCB p_SCCB, UCHAR p_card)
11618 } 7758 }
11619 7759
11620 7760
11621 return(FALSE); 7761 return(0);
11622 7762
11623} 7763}
11624 7764
@@ -11636,15 +7776,11 @@ UCHAR queueFindSccb(PSCCB p_SCCB, UCHAR p_card)
11636 * 7776 *
11637 *---------------------------------------------------------------------*/ 7777 *---------------------------------------------------------------------*/
11638 7778
11639void utilUpdateResidual(PSCCB p_SCCB) 7779static void FPT_utilUpdateResidual(PSCCB p_SCCB)
11640{ 7780{
11641 ULONG partial_cnt; 7781 ULONG partial_cnt;
11642 UINT sg_index; 7782 UINT sg_index;
11643#if defined(COMPILER_16_BIT) && !defined(DOS)
11644 ULONG far *sg_ptr;
11645#else
11646 ULONG *sg_ptr; 7783 ULONG *sg_ptr;
11647#endif
11648 7784
11649 if (p_SCCB->Sccb_XferState & F_ALL_XFERRED) { 7785 if (p_SCCB->Sccb_XferState & F_ALL_XFERRED) {
11650 7786
@@ -11657,11 +7793,7 @@ void utilUpdateResidual(PSCCB p_SCCB)
11657 7793
11658 sg_index = p_SCCB->Sccb_sgseg; 7794 sg_index = p_SCCB->Sccb_sgseg;
11659 7795
11660#if defined(COMPILER_16_BIT) && !defined(DOS)
11661 sg_ptr = (ULONG far *)p_SCCB->DataPointer;
11662#else
11663 sg_ptr = (ULONG *)p_SCCB->DataPointer; 7796 sg_ptr = (ULONG *)p_SCCB->DataPointer;
11664#endif
11665 7797
11666 if (p_SCCB->Sccb_SGoffset) { 7798 if (p_SCCB->Sccb_SGoffset) {
11667 7799
@@ -11694,17 +7826,13 @@ void utilUpdateResidual(PSCCB p_SCCB)
11694 * 7826 *
11695 *---------------------------------------------------------------------*/ 7827 *---------------------------------------------------------------------*/
11696 7828
11697#if defined(DOS) 7829static void FPT_Wait1Second(ULONG p_port)
11698void Wait1Second(USHORT p_port)
11699#else
11700void Wait1Second(ULONG p_port)
11701#endif
11702{ 7830{
11703 UCHAR i; 7831 UCHAR i;
11704 7832
11705 for(i=0; i < 4; i++) { 7833 for(i=0; i < 4; i++) {
11706 7834
11707 Wait(p_port, TO_250ms); 7835 FPT_Wait(p_port, TO_250ms);
11708 7836
11709 if ((RD_HARPOON(p_port+hp_scsictrl_0) & SCSI_RST)) 7837 if ((RD_HARPOON(p_port+hp_scsictrl_0) & SCSI_RST))
11710 break; 7838 break;
@@ -11717,17 +7845,13 @@ void Wait1Second(ULONG p_port)
11717 7845
11718/*--------------------------------------------------------------------- 7846/*---------------------------------------------------------------------
11719 * 7847 *
11720 * Function: Wait 7848 * Function: FPT_Wait
11721 * 7849 *
11722 * Description: Wait the desired delay. 7850 * Description: Wait the desired delay.
11723 * 7851 *
11724 *---------------------------------------------------------------------*/ 7852 *---------------------------------------------------------------------*/
11725 7853
11726#if defined(DOS) 7854static void FPT_Wait(ULONG p_port, UCHAR p_delay)
11727void Wait(USHORT p_port, UCHAR p_delay)
11728#else
11729void Wait(ULONG p_port, UCHAR p_delay)
11730#endif
11731{ 7855{
11732 UCHAR old_timer; 7856 UCHAR old_timer;
11733 UCHAR green_flag; 7857 UCHAR green_flag;
@@ -11739,7 +7863,7 @@ void Wait(ULONG p_port, UCHAR p_delay)
11739 7863
11740 WR_HARPOON(p_port+hp_seltimeout,p_delay); 7864 WR_HARPOON(p_port+hp_seltimeout,p_delay);
11741 WRW_HARPOON((p_port+hp_intstat), TIMEOUT); 7865 WRW_HARPOON((p_port+hp_intstat), TIMEOUT);
11742 WRW_HARPOON((p_port+hp_intena), (default_intena & ~TIMEOUT)); 7866 WRW_HARPOON((p_port+hp_intena), (FPT_default_intena & ~TIMEOUT));
11743 7867
11744 7868
11745 WR_HARPOON(p_port+hp_portctrl_0, 7869 WR_HARPOON(p_port+hp_portctrl_0,
@@ -11758,7 +7882,7 @@ void Wait(ULONG p_port, UCHAR p_delay)
11758 (RD_HARPOON(p_port+hp_portctrl_0) & ~START_TO)); 7882 (RD_HARPOON(p_port+hp_portctrl_0) & ~START_TO));
11759 7883
11760 WRW_HARPOON((p_port+hp_intstat), TIMEOUT); 7884 WRW_HARPOON((p_port+hp_intstat), TIMEOUT);
11761 WRW_HARPOON((p_port+hp_intena), default_intena); 7885 WRW_HARPOON((p_port+hp_intena), FPT_default_intena);
11762 7886
11763 WR_HARPOON(p_port+hp_clkctrl_0,green_flag); 7887 WR_HARPOON(p_port+hp_clkctrl_0,green_flag);
11764 7888
@@ -11775,11 +7899,7 @@ void Wait(ULONG p_port, UCHAR p_delay)
11775 * 7899 *
11776 *---------------------------------------------------------------------*/ 7900 *---------------------------------------------------------------------*/
11777 7901
11778#if defined(DOS) 7902static void FPT_utilEEWriteOnOff(ULONG p_port,UCHAR p_mode)
11779void utilEEWriteOnOff(USHORT p_port,UCHAR p_mode)
11780#else
11781void utilEEWriteOnOff(ULONG p_port,UCHAR p_mode)
11782#endif
11783{ 7903{
11784 UCHAR ee_value; 7904 UCHAR ee_value;
11785 7905
@@ -11787,12 +7907,12 @@ void utilEEWriteOnOff(ULONG p_port,UCHAR p_mode)
11787 7907
11788 if (p_mode) 7908 if (p_mode)
11789 7909
11790 utilEESendCmdAddr(p_port, EWEN, EWEN_ADDR); 7910 FPT_utilEESendCmdAddr(p_port, EWEN, EWEN_ADDR);
11791 7911
11792 else 7912 else
11793 7913
11794 7914
11795 utilEESendCmdAddr(p_port, EWDS, EWDS_ADDR); 7915 FPT_utilEESendCmdAddr(p_port, EWDS, EWDS_ADDR);
11796 7916
11797 WR_HARPOON(p_port+hp_ee_ctrl, (ee_value | SEE_MS)); /*Turn off CS */ 7917 WR_HARPOON(p_port+hp_ee_ctrl, (ee_value | SEE_MS)); /*Turn off CS */
11798 WR_HARPOON(p_port+hp_ee_ctrl, ee_value); /*Turn off Master Select */ 7918 WR_HARPOON(p_port+hp_ee_ctrl, ee_value); /*Turn off Master Select */
@@ -11808,11 +7928,7 @@ void utilEEWriteOnOff(ULONG p_port,UCHAR p_mode)
11808 * 7928 *
11809 *---------------------------------------------------------------------*/ 7929 *---------------------------------------------------------------------*/
11810 7930
11811#if defined(DOS) 7931static void FPT_utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr)
11812void utilEEWrite(USHORT p_port, USHORT ee_data, USHORT ee_addr)
11813#else
11814void utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr)
11815#endif
11816{ 7932{
11817 7933
11818 UCHAR ee_value; 7934 UCHAR ee_value;
@@ -11823,7 +7939,7 @@ void utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr)
11823 7939
11824 7940
11825 7941
11826 utilEESendCmdAddr(p_port, EE_WRITE, ee_addr); 7942 FPT_utilEESendCmdAddr(p_port, EE_WRITE, ee_addr);
11827 7943
11828 7944
11829 ee_value |= (SEE_MS + SEE_CS); 7945 ee_value |= (SEE_MS + SEE_CS);
@@ -11847,7 +7963,7 @@ void utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr)
11847 ee_value &= (EXT_ARB_ACK | SCSI_TERM_ENA_H); 7963 ee_value &= (EXT_ARB_ACK | SCSI_TERM_ENA_H);
11848 WR_HARPOON(p_port+hp_ee_ctrl, (ee_value | SEE_MS)); 7964 WR_HARPOON(p_port+hp_ee_ctrl, (ee_value | SEE_MS));
11849 7965
11850 Wait(p_port, TO_10ms); 7966 FPT_Wait(p_port, TO_10ms);
11851 7967
11852 WR_HARPOON(p_port+hp_ee_ctrl, (ee_value | SEE_MS | SEE_CS)); /* Set CS to EEPROM */ 7968 WR_HARPOON(p_port+hp_ee_ctrl, (ee_value | SEE_MS | SEE_CS)); /* Set CS to EEPROM */
11853 WR_HARPOON(p_port+hp_ee_ctrl, (ee_value | SEE_MS)); /* Turn off CS */ 7969 WR_HARPOON(p_port+hp_ee_ctrl, (ee_value | SEE_MS)); /* Turn off CS */
@@ -11863,19 +7979,15 @@ void utilEEWrite(ULONG p_port, USHORT ee_data, USHORT ee_addr)
11863 * 7979 *
11864 *---------------------------------------------------------------------*/ 7980 *---------------------------------------------------------------------*/
11865 7981
11866#if defined(DOS) 7982static USHORT FPT_utilEERead(ULONG p_port, USHORT ee_addr)
11867USHORT utilEERead(USHORT p_port, USHORT ee_addr)
11868#else
11869USHORT utilEERead(ULONG p_port, USHORT ee_addr)
11870#endif
11871{ 7983{
11872 USHORT i, ee_data1, ee_data2; 7984 USHORT i, ee_data1, ee_data2;
11873 7985
11874 i = 0; 7986 i = 0;
11875 ee_data1 = utilEEReadOrg(p_port, ee_addr); 7987 ee_data1 = FPT_utilEEReadOrg(p_port, ee_addr);
11876 do 7988 do
11877 { 7989 {
11878 ee_data2 = utilEEReadOrg(p_port, ee_addr); 7990 ee_data2 = FPT_utilEEReadOrg(p_port, ee_addr);
11879 7991
11880 if(ee_data1 == ee_data2) 7992 if(ee_data1 == ee_data2)
11881 return(ee_data1); 7993 return(ee_data1);
@@ -11897,11 +8009,7 @@ USHORT utilEERead(ULONG p_port, USHORT ee_addr)
11897 * 8009 *
11898 *---------------------------------------------------------------------*/ 8010 *---------------------------------------------------------------------*/
11899 8011
11900#if defined(DOS) 8012static USHORT FPT_utilEEReadOrg(ULONG p_port, USHORT ee_addr)
11901USHORT utilEEReadOrg(USHORT p_port, USHORT ee_addr)
11902#else
11903USHORT utilEEReadOrg(ULONG p_port, USHORT ee_addr)
11904#endif
11905{ 8013{
11906 8014
11907 UCHAR ee_value; 8015 UCHAR ee_value;
@@ -11911,7 +8019,7 @@ USHORT utilEEReadOrg(ULONG p_port, USHORT ee_addr)
11911 (SEE_MS | SEE_CS)); 8019 (SEE_MS | SEE_CS));
11912 8020
11913 8021
11914 utilEESendCmdAddr(p_port, EE_READ, ee_addr); 8022 FPT_utilEESendCmdAddr(p_port, EE_READ, ee_addr);
11915 8023
11916 8024
11917 ee_value |= (SEE_MS + SEE_CS); 8025 ee_value |= (SEE_MS + SEE_CS);
@@ -11949,11 +8057,7 @@ USHORT utilEEReadOrg(ULONG p_port, USHORT ee_addr)
11949 * 8057 *
11950 *---------------------------------------------------------------------*/ 8058 *---------------------------------------------------------------------*/
11951 8059
11952#if defined(DOS) 8060static void FPT_utilEESendCmdAddr(ULONG p_port, UCHAR ee_cmd, USHORT ee_addr)
11953void utilEESendCmdAddr(USHORT p_port, UCHAR ee_cmd, USHORT ee_addr)
11954#else
11955void utilEESendCmdAddr(ULONG p_port, UCHAR ee_cmd, USHORT ee_addr)
11956#endif
11957{ 8061{
11958 UCHAR ee_value; 8062 UCHAR ee_value;
11959 UCHAR narrow_flg; 8063 UCHAR narrow_flg;
@@ -12016,7 +8120,7 @@ void utilEESendCmdAddr(ULONG p_port, UCHAR ee_cmd, USHORT ee_addr)
12016 } 8120 }
12017} 8121}
12018 8122
12019USHORT CalcCrc16(UCHAR buffer[]) 8123static USHORT FPT_CalcCrc16(UCHAR buffer[])
12020{ 8124{
12021 USHORT crc=0; 8125 USHORT crc=0;
12022 int i,j; 8126 int i,j;
@@ -12036,7 +8140,7 @@ USHORT CalcCrc16(UCHAR buffer[])
12036 return(crc); 8140 return(crc);
12037} 8141}
12038 8142
12039UCHAR CalcLrc(UCHAR buffer[]) 8143static UCHAR FPT_CalcLrc(UCHAR buffer[])
12040{ 8144{
12041 int i; 8145 int i;
12042 UCHAR lrc; 8146 UCHAR lrc;
@@ -12109,33 +8213,6 @@ FlashPoint__HandleInterrupt(FlashPoint_CardHandle_T CardHandle)
12109#define FlashPoint_HandleInterrupt FlashPoint__HandleInterrupt 8213#define FlashPoint_HandleInterrupt FlashPoint__HandleInterrupt
12110 8214
12111 8215
12112/*
12113 FlashPoint_InquireTargetInfo returns the Synchronous Period, Synchronous
12114 Offset, and Wide Transfers Active information for TargetID on CardHandle.
12115*/
12116
12117void FlashPoint_InquireTargetInfo(FlashPoint_CardHandle_T CardHandle,
12118 int TargetID,
12119 unsigned char *SynchronousPeriod,
12120 unsigned char *SynchronousOffset,
12121 unsigned char *WideTransfersActive)
12122{
12123 SCCBMGR_TAR_INFO *TargetInfo =
12124 &sccbMgrTbl[((SCCBCARD *)CardHandle)->cardIndex][TargetID];
12125 if ((TargetInfo->TarSyncCtrl & SYNC_OFFSET) > 0)
12126 {
12127 *SynchronousPeriod = 5 * ((TargetInfo->TarSyncCtrl >> 5) + 1);
12128 *SynchronousOffset = TargetInfo->TarSyncCtrl & SYNC_OFFSET;
12129 }
12130 else
12131 {
12132 *SynchronousPeriod = 0;
12133 *SynchronousOffset = 0;
12134 }
12135 *WideTransfersActive = (TargetInfo->TarSyncCtrl & NARROW_SCSI ? 0 : 1);
12136}
12137
12138
12139#else /* CONFIG_SCSI_OMIT_FLASHPOINT */ 8216#else /* CONFIG_SCSI_OMIT_FLASHPOINT */
12140 8217
12141 8218
@@ -12151,9 +8228,6 @@ extern int FlashPoint_AbortCCB(FlashPoint_CardHandle_T, struct BusLogic_CCB *);
12151extern boolean FlashPoint_InterruptPending(FlashPoint_CardHandle_T); 8228extern boolean FlashPoint_InterruptPending(FlashPoint_CardHandle_T);
12152extern int FlashPoint_HandleInterrupt(FlashPoint_CardHandle_T); 8229extern int FlashPoint_HandleInterrupt(FlashPoint_CardHandle_T);
12153extern void FlashPoint_ReleaseHostAdapter(FlashPoint_CardHandle_T); 8230extern void FlashPoint_ReleaseHostAdapter(FlashPoint_CardHandle_T);
12154extern void FlashPoint_InquireTargetInfo(FlashPoint_CardHandle_T,
12155 int, unsigned char *,
12156 unsigned char *, unsigned char *);
12157 8231
12158 8232
12159#endif /* CONFIG_SCSI_OMIT_FLASHPOINT */ 8233#endif /* CONFIG_SCSI_OMIT_FLASHPOINT */
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 1811cb240315..96df148ed969 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -137,6 +137,24 @@ config CHR_DEV_SG
137 137
138 If unsure, say N. 138 If unsure, say N.
139 139
140config CHR_DEV_SCH
141 tristate "SCSI media changer support"
142 depends on SCSI
143 ---help---
144 This is a driver for SCSI media changers. Most common devices are
145 tape libraries and MOD/CDROM jukeboxes. *Real* jukeboxes, you
146 don't need this for those tiny 6-slot cdrom changers. Media
147 changers are listed as "Type: Medium Changer" in /proc/scsi/scsi.
148 If you have such hardware and want to use it with linux, say Y
149 here. Check <file:Documentation/scsi-changer.txt> for details.
150
151 If you want to compile this as a module ( = code which can be
152 inserted in and removed from the running kernel whenever you want),
153 say M here and read <file:Documentation/modules.txt> and
154 <file:Documentation/scsi.txt>. The module will be called ch.o.
155 If unsure, say N.
156
157
140comment "Some SCSI devices (e.g. CD jukebox) support multiple LUNs" 158comment "Some SCSI devices (e.g. CD jukebox) support multiple LUNs"
141 depends on SCSI 159 depends on SCSI
142 160
@@ -1192,28 +1210,6 @@ config SCSI_PAS16
1192 To compile this driver as a module, choose M here: the 1210 To compile this driver as a module, choose M here: the
1193 module will be called pas16. 1211 module will be called pas16.
1194 1212
1195config SCSI_PCI2000
1196 tristate "PCI2000 support"
1197 depends on PCI && SCSI && BROKEN
1198 help
1199 This is support for the PCI2000I EIDE interface card which acts as a
1200 SCSI host adapter. Please read the SCSI-HOWTO, available from
1201 <http://www.tldp.org/docs.html#howto>.
1202
1203 To compile this driver as a module, choose M here: the
1204 module will be called pci2000.
1205
1206config SCSI_PCI2220I
1207 tristate "PCI2220i support"
1208 depends on PCI && SCSI && BROKEN
1209 help
1210 This is support for the PCI2220i EIDE interface card which acts as a
1211 SCSI host adapter. Please read the SCSI-HOWTO, available from
1212 <http://www.tldp.org/docs.html#howto>.
1213
1214 To compile this driver as a module, choose M here: the
1215 module will be called pci2220i.
1216
1217config SCSI_PSI240I 1213config SCSI_PSI240I
1218 tristate "PSI240i support" 1214 tristate "PSI240i support"
1219 depends on ISA && SCSI 1215 depends on ISA && SCSI
@@ -1752,7 +1748,7 @@ config SCSI_NCR53C7xx_FAST
1752 1748
1753config SUN3_SCSI 1749config SUN3_SCSI
1754 tristate "Sun3 NCR5380 SCSI" 1750 tristate "Sun3 NCR5380 SCSI"
1755 depends on SUN3 && SCSI 1751 depends on SUN3 && SCSI && BROKEN
1756 help 1752 help
1757 This option will enable support for the OBIO (onboard io) NCR5380 1753 This option will enable support for the OBIO (onboard io) NCR5380
1758 SCSI controller found in the Sun 3/50 and 3/60, as well as for 1754 SCSI controller found in the Sun 3/50 and 3/60, as well as for
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index 9cb9fe7d623a..3746fb9fa2f5 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -50,8 +50,6 @@ obj-$(CONFIG_MVME16x_SCSI) += mvme16x.o 53c7xx.o
50obj-$(CONFIG_BVME6000_SCSI) += bvme6000.o 53c7xx.o 50obj-$(CONFIG_BVME6000_SCSI) += bvme6000.o 53c7xx.o
51obj-$(CONFIG_SCSI_SIM710) += 53c700.o sim710.o 51obj-$(CONFIG_SCSI_SIM710) += 53c700.o sim710.o
52obj-$(CONFIG_SCSI_ADVANSYS) += advansys.o 52obj-$(CONFIG_SCSI_ADVANSYS) += advansys.o
53obj-$(CONFIG_SCSI_PCI2000) += pci2000.o
54obj-$(CONFIG_SCSI_PCI2220I) += pci2220i.o
55obj-$(CONFIG_SCSI_PSI240I) += psi240i.o 53obj-$(CONFIG_SCSI_PSI240I) += psi240i.o
56obj-$(CONFIG_SCSI_BUSLOGIC) += BusLogic.o 54obj-$(CONFIG_SCSI_BUSLOGIC) += BusLogic.o
57obj-$(CONFIG_SCSI_DPT_I2O) += dpt_i2o.o 55obj-$(CONFIG_SCSI_DPT_I2O) += dpt_i2o.o
@@ -142,6 +140,7 @@ obj-$(CONFIG_CHR_DEV_OSST) += osst.o
142obj-$(CONFIG_BLK_DEV_SD) += sd_mod.o 140obj-$(CONFIG_BLK_DEV_SD) += sd_mod.o
143obj-$(CONFIG_BLK_DEV_SR) += sr_mod.o 141obj-$(CONFIG_BLK_DEV_SR) += sr_mod.o
144obj-$(CONFIG_CHR_DEV_SG) += sg.o 142obj-$(CONFIG_CHR_DEV_SG) += sg.o
143obj-$(CONFIG_CHR_DEV_SCH) += ch.o
145 144
146scsi_mod-y += scsi.o hosts.o scsi_ioctl.o constants.o \ 145scsi_mod-y += scsi.o hosts.o scsi_ioctl.o constants.o \
147 scsicam.o scsi_error.o scsi_lib.o \ 146 scsicam.o scsi_error.o scsi_lib.o \
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 770fa841e389..f8ec6fe7d858 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -2825,39 +2825,17 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) {
2825 * Locks: host lock taken by caller 2825 * Locks: host lock taken by caller
2826 */ 2826 */
2827 2827
2828static int NCR5380_bus_reset(Scsi_Cmnd * cmd) { 2828static int NCR5380_bus_reset(Scsi_Cmnd * cmd)
2829 NCR5380_local_declare(); 2829{
2830 NCR5380_setup(cmd->device->host); 2830 struct Scsi_Host *instance = cmd->device->host;
2831
2832 NCR5380_print_status(cmd->device->host);
2833 do_reset(cmd->device->host);
2834 return SUCCESS;
2835}
2836
2837/*
2838 * Function : int NCR5380_device_reset (Scsi_Cmnd *cmd)
2839 *
2840 * Purpose : reset a SCSI device
2841 *
2842 * Returns : FAILED
2843 *
2844 * Locks: io_request_lock held by caller
2845 */
2846 2831
2847static int NCR5380_device_reset(Scsi_Cmnd * cmd) { 2832 NCR5380_local_declare();
2848 return FAILED; 2833 NCR5380_setup(instance);
2849} 2834 NCR5380_print_status(instance);
2850 2835
2851/* 2836 spin_lock_irq(instance->host_lock);
2852 * Function : int NCR5380_host_reset (Scsi_Cmnd *cmd) 2837 do_reset(instance);
2853 * 2838 spin_unlock_irq(instance->host_lock);
2854 * Purpose : reset a SCSI device
2855 *
2856 * Returns : FAILED
2857 *
2858 * Locks: io_request_lock held by caller
2859 */
2860 2839
2861static int NCR5380_host_reset(Scsi_Cmnd * cmd) { 2840 return SUCCESS;
2862 return FAILED;
2863} 2841}
diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h
index b5103f94d627..c3462e358d1c 100644
--- a/drivers/scsi/NCR5380.h
+++ b/drivers/scsi/NCR5380.h
@@ -306,8 +306,6 @@ static void NCR5380_print(struct Scsi_Host *instance);
306#endif 306#endif
307static int NCR5380_abort(Scsi_Cmnd * cmd); 307static int NCR5380_abort(Scsi_Cmnd * cmd);
308static int NCR5380_bus_reset(Scsi_Cmnd * cmd); 308static int NCR5380_bus_reset(Scsi_Cmnd * cmd);
309static int NCR5380_host_reset(Scsi_Cmnd * cmd);
310static int NCR5380_device_reset(Scsi_Cmnd * cmd);
311static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)); 309static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *));
312static int NCR5380_proc_info(struct Scsi_Host *instance, char *buffer, char **start, 310static int NCR5380_proc_info(struct Scsi_Host *instance, char *buffer, char **start,
313off_t offset, int length, int inout); 311off_t offset, int length, int inout);
diff --git a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c
index 74b93564a258..6ceabbd42a3d 100644
--- a/drivers/scsi/NCR53C9x.c
+++ b/drivers/scsi/NCR53C9x.c
@@ -94,7 +94,7 @@ enum {
94}; 94};
95 95
96/* The master ring of all esp hosts we are managing in this driver. */ 96/* The master ring of all esp hosts we are managing in this driver. */
97struct NCR_ESP *espchain; 97static struct NCR_ESP *espchain;
98int nesps = 0, esps_in_use = 0, esps_running = 0; 98int nesps = 0, esps_in_use = 0, esps_running = 0;
99 99
100irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs); 100irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs);
@@ -1467,14 +1467,12 @@ int esp_reset(Scsi_Cmnd *SCptr)
1467{ 1467{
1468 struct NCR_ESP *esp = (struct NCR_ESP *) SCptr->device->host->hostdata; 1468 struct NCR_ESP *esp = (struct NCR_ESP *) SCptr->device->host->hostdata;
1469 1469
1470 spin_lock_irq(esp->ehost->host_lock);
1470 (void) esp_do_resetbus(esp, esp->eregs); 1471 (void) esp_do_resetbus(esp, esp->eregs);
1471
1472 spin_unlock_irq(esp->ehost->host_lock); 1472 spin_unlock_irq(esp->ehost->host_lock);
1473 1473
1474 wait_event(esp->reset_queue, (esp->resetting_bus == 0)); 1474 wait_event(esp->reset_queue, (esp->resetting_bus == 0));
1475 1475
1476 spin_lock_irq(esp->ehost->host_lock);
1477
1478 return SUCCESS; 1476 return SUCCESS;
1479} 1477}
1480 1478
diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c
index c685d546f838..b2002ba6e2aa 100644
--- a/drivers/scsi/NCR53c406a.c
+++ b/drivers/scsi/NCR53c406a.c
@@ -722,15 +722,12 @@ static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
722 return 0; 722 return 0;
723} 723}
724 724
725static int NCR53c406a_abort(Scsi_Cmnd * SCpnt)
726{
727 DEB(printk("NCR53c406a_abort called\n"));
728 return FAILED; /* Don't know how to abort */
729}
730
731static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt) 725static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt)
732{ 726{
733 DEB(printk("NCR53c406a_reset called\n")); 727 DEB(printk("NCR53c406a_reset called\n"));
728
729 spin_lock_irq(SCpnt->device->host->host_lock);
730
734 outb(C4_IMG, CONFIG4); /* Select reg set 0 */ 731 outb(C4_IMG, CONFIG4); /* Select reg set 0 */
735 outb(CHIP_RESET, CMD_REG); 732 outb(CHIP_RESET, CMD_REG);
736 outb(SCSI_NOP, CMD_REG); /* required after reset */ 733 outb(SCSI_NOP, CMD_REG); /* required after reset */
@@ -738,17 +735,10 @@ static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt)
738 chip_init(); 735 chip_init();
739 736
740 rtrc(2); 737 rtrc(2);
741 return SUCCESS;
742}
743 738
744static int NCR53c406a_device_reset(Scsi_Cmnd * SCpnt) 739 spin_unlock_irq(SCpnt->device->host->host_lock);
745{
746 return FAILED;
747}
748 740
749static int NCR53c406a_bus_reset(Scsi_Cmnd * SCpnt) 741 return SUCCESS;
750{
751 return FAILED;
752} 742}
753 743
754static int NCR53c406a_biosparm(struct scsi_device *disk, 744static int NCR53c406a_biosparm(struct scsi_device *disk,
@@ -1075,9 +1065,6 @@ static Scsi_Host_Template driver_template =
1075 .release = NCR53c406a_release, 1065 .release = NCR53c406a_release,
1076 .info = NCR53c406a_info /* info */, 1066 .info = NCR53c406a_info /* info */,
1077 .queuecommand = NCR53c406a_queue /* queuecommand */, 1067 .queuecommand = NCR53c406a_queue /* queuecommand */,
1078 .eh_abort_handler = NCR53c406a_abort /* abort */,
1079 .eh_bus_reset_handler = NCR53c406a_bus_reset /* reset */,
1080 .eh_device_reset_handler = NCR53c406a_device_reset /* reset */,
1081 .eh_host_reset_handler = NCR53c406a_host_reset /* reset */, 1068 .eh_host_reset_handler = NCR53c406a_host_reset /* reset */,
1082 .bios_param = NCR53c406a_biosparm /* biosparm */, 1069 .bios_param = NCR53c406a_biosparm /* biosparm */,
1083 .can_queue = 1 /* can_queue */, 1070 .can_queue = 1 /* can_queue */,
diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c
index 9928a2fbce0c..f7a1751e892d 100644
--- a/drivers/scsi/a2091.c
+++ b/drivers/scsi/a2091.c
@@ -221,7 +221,14 @@ int __init a2091_detect(Scsi_Host_Template *tpnt)
221static int a2091_bus_reset(Scsi_Cmnd *cmd) 221static int a2091_bus_reset(Scsi_Cmnd *cmd)
222{ 222{
223 /* FIXME perform bus-specific reset */ 223 /* FIXME perform bus-specific reset */
224
225 /* FIXME 2: kill this function, and let midlayer fall back
226 to the same action, calling wd33c93_host_reset() */
227
228 spin_lock_irq(cmd->device->host->host_lock);
224 wd33c93_host_reset(cmd); 229 wd33c93_host_reset(cmd);
230 spin_unlock_irq(cmd->device->host->host_lock);
231
225 return SUCCESS; 232 return SUCCESS;
226} 233}
227 234
diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c
index f8a89ec25042..306caf56f3d9 100644
--- a/drivers/scsi/a3000.c
+++ b/drivers/scsi/a3000.c
@@ -208,7 +208,14 @@ fail_register:
208static int a3000_bus_reset(Scsi_Cmnd *cmd) 208static int a3000_bus_reset(Scsi_Cmnd *cmd)
209{ 209{
210 /* FIXME perform bus-specific reset */ 210 /* FIXME perform bus-specific reset */
211
212 /* FIXME 2: kill this entire function, which should
213 cause mid-layer to call wd33c93_host_reset anyway? */
214
215 spin_lock_irq(cmd->device->host->host_lock);
211 wd33c93_host_reset(cmd); 216 wd33c93_host_reset(cmd);
217 spin_unlock_irq(cmd->device->host->host_lock);
218
212 return SUCCESS; 219 return SUCCESS;
213} 220}
214 221
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index f3fc35386060..f02c99641467 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -53,10 +53,6 @@
53#define INQD_PDT_DMASK 0x1F /* Peripheral Device Type Mask */ 53#define INQD_PDT_DMASK 0x1F /* Peripheral Device Type Mask */
54#define INQD_PDT_QMASK 0xE0 /* Peripheral Device Qualifer Mask */ 54#define INQD_PDT_QMASK 0xE0 /* Peripheral Device Qualifer Mask */
55 55
56#define MAX_FIB_DATA (sizeof(struct hw_fib) - sizeof(FIB_HEADER))
57
58#define MAX_DRIVER_SG_SEGMENT_COUNT 17
59
60/* 56/*
61 * Sense codes 57 * Sense codes
62 */ 58 */
@@ -158,6 +154,13 @@ MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC. 0
158module_param(commit, int, 0); 154module_param(commit, int, 0);
159MODULE_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the adapter for foreign arrays.\nThis is typically needed in systems that do not have a BIOS. 0=off, 1=on"); 155MODULE_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the adapter for foreign arrays.\nThis is typically needed in systems that do not have a BIOS. 0=off, 1=on");
160 156
157int numacb = -1;
158module_param(numacb, int, S_IRUGO|S_IWUSR);
159MODULE_PARM_DESC(numacb, "Request a limit to the number of adapter control blocks (FIB) allocated. Valid\nvalues are 512 and down. Default is to use suggestion from Firmware.");
160
161int acbsize = -1;
162module_param(acbsize, int, S_IRUGO|S_IWUSR);
163MODULE_PARM_DESC(acbsize, "Request a specific adapter control block (FIB) size. Valid values are 512,\n2048, 4096 and 8192. Default is to use suggestion from Firmware.");
161/** 164/**
162 * aac_get_config_status - check the adapter configuration 165 * aac_get_config_status - check the adapter configuration
163 * @common: adapter to query 166 * @common: adapter to query
@@ -462,7 +465,7 @@ static int probe_container(struct aac_dev *dev, int cid)
462 1, 1, 465 1, 1,
463 NULL, NULL); 466 NULL, NULL);
464 if (status < 0) { 467 if (status < 0) {
465 printk(KERN_WARNING "aacraid: probe_containers query failed.\n"); 468 printk(KERN_WARNING "aacraid: probe_container query failed.\n");
466 goto error; 469 goto error;
467 } 470 }
468 471
@@ -562,10 +565,10 @@ static void setinqstr(int devtype, void *data, int tindex)
562 inqstrcpy ("V1.0", str->prl); 565 inqstrcpy ("V1.0", str->prl);
563} 566}
564 567
565void set_sense(u8 *sense_buf, u8 sense_key, u8 sense_code, 568static void set_sense(u8 *sense_buf, u8 sense_key, u8 sense_code,
566 u8 a_sense_code, u8 incorrect_length, 569 u8 a_sense_code, u8 incorrect_length,
567 u8 bit_pointer, u16 field_pointer, 570 u8 bit_pointer, u16 field_pointer,
568 u32 residue) 571 u32 residue)
569{ 572{
570 sense_buf[0] = 0xF0; /* Sense data valid, err code 70h (current error) */ 573 sense_buf[0] = 0xF0; /* Sense data valid, err code 70h (current error) */
571 sense_buf[1] = 0; /* Segment number, always zero */ 574 sense_buf[1] = 0; /* Segment number, always zero */
@@ -605,35 +608,63 @@ void set_sense(u8 *sense_buf, u8 sense_key, u8 sense_code,
605int aac_get_adapter_info(struct aac_dev* dev) 608int aac_get_adapter_info(struct aac_dev* dev)
606{ 609{
607 struct fib* fibptr; 610 struct fib* fibptr;
608 struct aac_adapter_info* info;
609 int rcode; 611 int rcode;
610 u32 tmp; 612 u32 tmp;
613 struct aac_adapter_info * info;
614
611 if (!(fibptr = fib_alloc(dev))) 615 if (!(fibptr = fib_alloc(dev)))
612 return -ENOMEM; 616 return -ENOMEM;
613 617
614 fib_init(fibptr); 618 fib_init(fibptr);
615 info = (struct aac_adapter_info*) fib_data(fibptr); 619 info = (struct aac_adapter_info *) fib_data(fibptr);
616 620 memset(info,0,sizeof(*info));
617 memset(info,0,sizeof(struct aac_adapter_info));
618 621
619 rcode = fib_send(RequestAdapterInfo, 622 rcode = fib_send(RequestAdapterInfo,
620 fibptr, 623 fibptr,
621 sizeof(struct aac_adapter_info), 624 sizeof(*info),
622 FsaNormal, 625 FsaNormal,
623 1, 1, 626 1, 1,
624 NULL, 627 NULL,
625 NULL); 628 NULL);
629
630 if (rcode < 0) {
631 fib_complete(fibptr);
632 fib_free(fibptr);
633 return rcode;
634 }
635 memcpy(&dev->adapter_info, info, sizeof(*info));
636
637 if (dev->adapter_info.options & AAC_OPT_SUPPLEMENT_ADAPTER_INFO) {
638 struct aac_supplement_adapter_info * info;
626 639
627 memcpy(&dev->adapter_info, info, sizeof(struct aac_adapter_info)); 640 fib_init(fibptr);
641
642 info = (struct aac_supplement_adapter_info *) fib_data(fibptr);
643
644 memset(info,0,sizeof(*info));
645
646 rcode = fib_send(RequestSupplementAdapterInfo,
647 fibptr,
648 sizeof(*info),
649 FsaNormal,
650 1, 1,
651 NULL,
652 NULL);
653
654 if (rcode >= 0)
655 memcpy(&dev->supplement_adapter_info, info, sizeof(*info));
656 }
628 657
629 tmp = le32_to_cpu(dev->adapter_info.kernelrev); 658 tmp = le32_to_cpu(dev->adapter_info.kernelrev);
630 printk(KERN_INFO "%s%d: kernel %d.%d-%d[%d]\n", 659 printk(KERN_INFO "%s%d: kernel %d.%d-%d[%d] %.*s\n",
631 dev->name, 660 dev->name,
632 dev->id, 661 dev->id,
633 tmp>>24, 662 tmp>>24,
634 (tmp>>16)&0xff, 663 (tmp>>16)&0xff,
635 tmp&0xff, 664 tmp&0xff,
636 le32_to_cpu(dev->adapter_info.kernelbuild)); 665 le32_to_cpu(dev->adapter_info.kernelbuild),
666 (int)sizeof(dev->supplement_adapter_info.BuildDate),
667 dev->supplement_adapter_info.BuildDate);
637 tmp = le32_to_cpu(dev->adapter_info.monitorrev); 668 tmp = le32_to_cpu(dev->adapter_info.monitorrev);
638 printk(KERN_INFO "%s%d: monitor %d.%d-%d[%d]\n", 669 printk(KERN_INFO "%s%d: monitor %d.%d-%d[%d]\n",
639 dev->name, dev->id, 670 dev->name, dev->id,
@@ -707,6 +738,38 @@ int aac_get_adapter_info(struct aac_dev* dev)
707 rcode = -ENOMEM; 738 rcode = -ENOMEM;
708 } 739 }
709 } 740 }
741 /*
742 * 57 scatter gather elements
743 */
744 dev->scsi_host_ptr->sg_tablesize = (dev->max_fib_size -
745 sizeof(struct aac_fibhdr) -
746 sizeof(struct aac_write) + sizeof(struct sgmap)) /
747 sizeof(struct sgmap);
748 if (dev->dac_support) {
749 /*
750 * 38 scatter gather elements
751 */
752 dev->scsi_host_ptr->sg_tablesize =
753 (dev->max_fib_size -
754 sizeof(struct aac_fibhdr) -
755 sizeof(struct aac_write64) +
756 sizeof(struct sgmap64)) /
757 sizeof(struct sgmap64);
758 }
759 dev->scsi_host_ptr->max_sectors = AAC_MAX_32BIT_SGBCOUNT;
760 if(!(dev->adapter_info.options & AAC_OPT_NEW_COMM)) {
761 /*
762 * Worst case size that could cause sg overflow when
763 * we break up SG elements that are larger than 64KB.
764 * Would be nice if we could tell the SCSI layer what
765 * the maximum SG element size can be. Worst case is
766 * (sg_tablesize-1) 4KB elements with one 64KB
767 * element.
768 * 32bit -> 468 or 238KB 64bit -> 424 or 212KB
769 */
770 dev->scsi_host_ptr->max_sectors =
771 (dev->scsi_host_ptr->sg_tablesize * 8) + 112;
772 }
710 773
711 fib_complete(fibptr); 774 fib_complete(fibptr);
712 fib_free(fibptr); 775 fib_free(fibptr);
@@ -747,8 +810,10 @@ static void read_callback(void *context, struct fib * fibptr)
747 if (le32_to_cpu(readreply->status) == ST_OK) 810 if (le32_to_cpu(readreply->status) == ST_OK)
748 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD; 811 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
749 else { 812 else {
750 printk(KERN_WARNING "read_callback: read failed, status = %d\n", 813#ifdef AAC_DETAILED_STATUS_INFO
751 le32_to_cpu(readreply->status)); 814 printk(KERN_WARNING "read_callback: io failed, status = %d\n",
815 le32_to_cpu(readreply->status));
816#endif
752 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION; 817 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION;
753 set_sense((u8 *) &dev->fsa_dev[cid].sense_data, 818 set_sense((u8 *) &dev->fsa_dev[cid].sense_data,
754 HARDWARE_ERROR, 819 HARDWARE_ERROR,
@@ -813,7 +878,7 @@ static void write_callback(void *context, struct fib * fibptr)
813 aac_io_done(scsicmd); 878 aac_io_done(scsicmd);
814} 879}
815 880
816int aac_read(struct scsi_cmnd * scsicmd, int cid) 881static int aac_read(struct scsi_cmnd * scsicmd, int cid)
817{ 882{
818 u32 lba; 883 u32 lba;
819 u32 count; 884 u32 count;
@@ -842,7 +907,8 @@ int aac_read(struct scsi_cmnd * scsicmd, int cid)
842 lba = (scsicmd->cmnd[2] << 24) | (scsicmd->cmnd[3] << 16) | (scsicmd->cmnd[4] << 8) | scsicmd->cmnd[5]; 907 lba = (scsicmd->cmnd[2] << 24) | (scsicmd->cmnd[3] << 16) | (scsicmd->cmnd[4] << 8) | scsicmd->cmnd[5];
843 count = (scsicmd->cmnd[7] << 8) | scsicmd->cmnd[8]; 908 count = (scsicmd->cmnd[7] << 8) | scsicmd->cmnd[8];
844 } 909 }
845 dprintk((KERN_DEBUG "aac_read[cpu %d]: lba = %u, t = %ld.\n", smp_processor_id(), lba, jiffies)); 910 dprintk((KERN_DEBUG "aac_read[cpu %d]: lba = %u, t = %ld.\n",
911 smp_processor_id(), (unsigned long long)lba, jiffies));
846 /* 912 /*
847 * Alocate and initialize a Fib 913 * Alocate and initialize a Fib
848 */ 914 */
@@ -852,7 +918,7 @@ int aac_read(struct scsi_cmnd * scsicmd, int cid)
852 918
853 fib_init(cmd_fibcontext); 919 fib_init(cmd_fibcontext);
854 920
855 if(dev->dac_support == 1) { 921 if (dev->dac_support == 1) {
856 struct aac_read64 *readcmd; 922 struct aac_read64 *readcmd;
857 readcmd = (struct aac_read64 *) fib_data(cmd_fibcontext); 923 readcmd = (struct aac_read64 *) fib_data(cmd_fibcontext);
858 readcmd->command = cpu_to_le32(VM_CtHostRead64); 924 readcmd->command = cpu_to_le32(VM_CtHostRead64);
@@ -886,14 +952,11 @@ int aac_read(struct scsi_cmnd * scsicmd, int cid)
886 readcmd->block = cpu_to_le32(lba); 952 readcmd->block = cpu_to_le32(lba);
887 readcmd->count = cpu_to_le32(count * 512); 953 readcmd->count = cpu_to_le32(count * 512);
888 954
889 if (count * 512 > (64 * 1024))
890 BUG();
891
892 aac_build_sg(scsicmd, &readcmd->sg); 955 aac_build_sg(scsicmd, &readcmd->sg);
893 fibsize = sizeof(struct aac_read) + 956 fibsize = sizeof(struct aac_read) +
894 ((le32_to_cpu(readcmd->sg.count) - 1) * 957 ((le32_to_cpu(readcmd->sg.count) - 1) *
895 sizeof (struct sgentry)); 958 sizeof (struct sgentry));
896 BUG_ON (fibsize > (sizeof(struct hw_fib) - 959 BUG_ON (fibsize > (dev->max_fib_size -
897 sizeof(struct aac_fibhdr))); 960 sizeof(struct aac_fibhdr)));
898 /* 961 /*
899 * Now send the Fib to the adapter 962 * Now send the Fib to the adapter
@@ -976,7 +1039,7 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
976 fibsize = sizeof(struct aac_write64) + 1039 fibsize = sizeof(struct aac_write64) +
977 ((le32_to_cpu(writecmd->sg.count) - 1) * 1040 ((le32_to_cpu(writecmd->sg.count) - 1) *
978 sizeof (struct sgentry64)); 1041 sizeof (struct sgentry64));
979 BUG_ON (fibsize > (sizeof(struct hw_fib) - 1042 BUG_ON (fibsize > (dev->max_fib_size -
980 sizeof(struct aac_fibhdr))); 1043 sizeof(struct aac_fibhdr)));
981 /* 1044 /*
982 * Now send the Fib to the adapter 1045 * Now send the Fib to the adapter
@@ -998,15 +1061,11 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
998 writecmd->sg.count = cpu_to_le32(1); 1061 writecmd->sg.count = cpu_to_le32(1);
999 /* ->stable is not used - it did mean which type of write */ 1062 /* ->stable is not used - it did mean which type of write */
1000 1063
1001 if (count * 512 > (64 * 1024)) {
1002 BUG();
1003 }
1004
1005 aac_build_sg(scsicmd, &writecmd->sg); 1064 aac_build_sg(scsicmd, &writecmd->sg);
1006 fibsize = sizeof(struct aac_write) + 1065 fibsize = sizeof(struct aac_write) +
1007 ((le32_to_cpu(writecmd->sg.count) - 1) * 1066 ((le32_to_cpu(writecmd->sg.count) - 1) *
1008 sizeof (struct sgentry)); 1067 sizeof (struct sgentry));
1009 BUG_ON (fibsize > (sizeof(struct hw_fib) - 1068 BUG_ON (fibsize > (dev->max_fib_size -
1010 sizeof(struct aac_fibhdr))); 1069 sizeof(struct aac_fibhdr)));
1011 /* 1070 /*
1012 * Now send the Fib to the adapter 1071 * Now send the Fib to the adapter
@@ -1025,7 +1084,6 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
1025 */ 1084 */
1026 if (status == -EINPROGRESS) 1085 if (status == -EINPROGRESS)
1027 { 1086 {
1028 dprintk("write queued.\n");
1029 return 0; 1087 return 0;
1030 } 1088 }
1031 1089
@@ -1111,7 +1169,7 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd, int cid)
1111 return SCSI_MLQUEUE_DEVICE_BUSY; 1169 return SCSI_MLQUEUE_DEVICE_BUSY;
1112 1170
1113 /* 1171 /*
1114 * Alocate and initialize a Fib 1172 * Allocate and initialize a Fib
1115 */ 1173 */
1116 if (!(cmd_fibcontext = 1174 if (!(cmd_fibcontext =
1117 fib_alloc((struct aac_dev *)scsicmd->device->host->hostdata))) 1175 fib_alloc((struct aac_dev *)scsicmd->device->host->hostdata)))
@@ -1403,7 +1461,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1403 /* 1461 /*
1404 * Unhandled commands 1462 * Unhandled commands
1405 */ 1463 */
1406 printk(KERN_WARNING "Unhandled SCSI Command: 0x%x.\n", scsicmd->cmnd[0]); 1464 dprintk((KERN_WARNING "Unhandled SCSI Command: 0x%x.\n", scsicmd->cmnd[0]));
1407 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION; 1465 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION;
1408 set_sense((u8 *) &dev->fsa_dev[cid].sense_data, 1466 set_sense((u8 *) &dev->fsa_dev[cid].sense_data,
1409 ILLEGAL_REQUEST, SENCODE_INVALID_COMMAND, 1467 ILLEGAL_REQUEST, SENCODE_INVALID_COMMAND,
@@ -1818,7 +1876,7 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
1818 fibsize = sizeof (struct aac_srb) - sizeof (struct sgentry) + 1876 fibsize = sizeof (struct aac_srb) - sizeof (struct sgentry) +
1819 ((le32_to_cpu(srbcmd->sg.count) & 0xff) * 1877 ((le32_to_cpu(srbcmd->sg.count) & 0xff) *
1820 sizeof (struct sgentry64)); 1878 sizeof (struct sgentry64));
1821 BUG_ON (fibsize > (sizeof(struct hw_fib) - 1879 BUG_ON (fibsize > (dev->max_fib_size -
1822 sizeof(struct aac_fibhdr))); 1880 sizeof(struct aac_fibhdr)));
1823 1881
1824 /* 1882 /*
@@ -1840,7 +1898,7 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
1840 fibsize = sizeof (struct aac_srb) + 1898 fibsize = sizeof (struct aac_srb) +
1841 (((le32_to_cpu(srbcmd->sg.count) & 0xff) - 1) * 1899 (((le32_to_cpu(srbcmd->sg.count) & 0xff) - 1) *
1842 sizeof (struct sgentry)); 1900 sizeof (struct sgentry));
1843 BUG_ON (fibsize > (sizeof(struct hw_fib) - 1901 BUG_ON (fibsize > (dev->max_fib_size -
1844 sizeof(struct aac_fibhdr))); 1902 sizeof(struct aac_fibhdr)));
1845 1903
1846 /* 1904 /*
@@ -1893,7 +1951,9 @@ static unsigned long aac_build_sg(struct scsi_cmnd* scsicmd, struct sgmap* psg)
1893 } 1951 }
1894 /* hba wants the size to be exact */ 1952 /* hba wants the size to be exact */
1895 if(byte_count > scsicmd->request_bufflen){ 1953 if(byte_count > scsicmd->request_bufflen){
1896 psg->sg[i-1].count -= (byte_count - scsicmd->request_bufflen); 1954 u32 temp = le32_to_cpu(psg->sg[i-1].count) -
1955 (byte_count - scsicmd->request_bufflen);
1956 psg->sg[i-1].count = cpu_to_le32(temp);
1897 byte_count = scsicmd->request_bufflen; 1957 byte_count = scsicmd->request_bufflen;
1898 } 1958 }
1899 /* Check for command underflow */ 1959 /* Check for command underflow */
@@ -1922,7 +1982,7 @@ static unsigned long aac_build_sg64(struct scsi_cmnd* scsicmd, struct sgmap64* p
1922{ 1982{
1923 struct aac_dev *dev; 1983 struct aac_dev *dev;
1924 unsigned long byte_count = 0; 1984 unsigned long byte_count = 0;
1925 u64 le_addr; 1985 u64 addr;
1926 1986
1927 dev = (struct aac_dev *)scsicmd->device->host->hostdata; 1987 dev = (struct aac_dev *)scsicmd->device->host->hostdata;
1928 // Get rid of old data 1988 // Get rid of old data
@@ -1943,16 +2003,18 @@ static unsigned long aac_build_sg64(struct scsi_cmnd* scsicmd, struct sgmap64* p
1943 byte_count = 0; 2003 byte_count = 0;
1944 2004
1945 for (i = 0; i < sg_count; i++) { 2005 for (i = 0; i < sg_count; i++) {
1946 le_addr = cpu_to_le64(sg_dma_address(sg)); 2006 addr = sg_dma_address(sg);
1947 psg->sg[i].addr[1] = (u32)(le_addr>>32); 2007 psg->sg[i].addr[0] = cpu_to_le32(addr & 0xffffffff);
1948 psg->sg[i].addr[0] = (u32)(le_addr & 0xffffffff); 2008 psg->sg[i].addr[1] = cpu_to_le32(addr>>32);
1949 psg->sg[i].count = cpu_to_le32(sg_dma_len(sg)); 2009 psg->sg[i].count = cpu_to_le32(sg_dma_len(sg));
1950 byte_count += sg_dma_len(sg); 2010 byte_count += sg_dma_len(sg);
1951 sg++; 2011 sg++;
1952 } 2012 }
1953 /* hba wants the size to be exact */ 2013 /* hba wants the size to be exact */
1954 if(byte_count > scsicmd->request_bufflen){ 2014 if(byte_count > scsicmd->request_bufflen){
1955 psg->sg[i-1].count -= (byte_count - scsicmd->request_bufflen); 2015 u32 temp = le32_to_cpu(psg->sg[i-1].count) -
2016 (byte_count - scsicmd->request_bufflen);
2017 psg->sg[i-1].count = cpu_to_le32(temp);
1956 byte_count = scsicmd->request_bufflen; 2018 byte_count = scsicmd->request_bufflen;
1957 } 2019 }
1958 /* Check for command underflow */ 2020 /* Check for command underflow */
@@ -1962,15 +2024,14 @@ static unsigned long aac_build_sg64(struct scsi_cmnd* scsicmd, struct sgmap64* p
1962 } 2024 }
1963 } 2025 }
1964 else if(scsicmd->request_bufflen) { 2026 else if(scsicmd->request_bufflen) {
1965 dma_addr_t addr; 2027 u64 addr;
1966 addr = pci_map_single(dev->pdev, 2028 addr = pci_map_single(dev->pdev,
1967 scsicmd->request_buffer, 2029 scsicmd->request_buffer,
1968 scsicmd->request_bufflen, 2030 scsicmd->request_bufflen,
1969 scsicmd->sc_data_direction); 2031 scsicmd->sc_data_direction);
1970 psg->count = cpu_to_le32(1); 2032 psg->count = cpu_to_le32(1);
1971 le_addr = cpu_to_le64(addr); 2033 psg->sg[0].addr[0] = cpu_to_le32(addr & 0xffffffff);
1972 psg->sg[0].addr[1] = (u32)(le_addr>>32); 2034 psg->sg[0].addr[1] = cpu_to_le32(addr >> 32);
1973 psg->sg[0].addr[0] = (u32)(le_addr & 0xffffffff);
1974 psg->sg[0].count = cpu_to_le32(scsicmd->request_bufflen); 2035 psg->sg[0].count = cpu_to_le32(scsicmd->request_bufflen);
1975 scsicmd->SCp.dma_handle = addr; 2036 scsicmd->SCp.dma_handle = addr;
1976 byte_count = scsicmd->request_bufflen; 2037 byte_count = scsicmd->request_bufflen;
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 700d90331c1c..42484417cef7 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -8,12 +8,18 @@
8 8
9#define MAXIMUM_NUM_CONTAINERS 32 9#define MAXIMUM_NUM_CONTAINERS 32
10 10
11#define AAC_NUM_FIB (256 + 64) 11#define AAC_NUM_MGT_FIB 8
12#define AAC_NUM_IO_FIB 100 12#define AAC_NUM_IO_FIB (512 - AAC_NUM_MGT_FIB)
13#define AAC_NUM_FIB (AAC_NUM_IO_FIB + AAC_NUM_MGT_FIB)
13 14
14#define AAC_MAX_LUN (8) 15#define AAC_MAX_LUN (8)
15 16
16#define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff) 17#define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff)
18/*
19 * max_sectors is an unsigned short, otherwise limit is 0x100000000 / 512
20 * Linux has starvation problems if we permit larger than 4MB I/O ...
21 */
22#define AAC_MAX_32BIT_SGBCOUNT ((unsigned short)8192)
17 23
18/* 24/*
19 * These macros convert from physical channels to virtual channels 25 * These macros convert from physical channels to virtual channels
@@ -89,11 +95,21 @@ struct diskparm
89 * on 64 bit systems not all cards support the 64 bit version 95 * on 64 bit systems not all cards support the 64 bit version
90 */ 96 */
91struct sgentry { 97struct sgentry {
98 __le32 addr; /* 32-bit address. */
99 __le32 count; /* Length. */
100};
101
102struct user_sgentry {
92 u32 addr; /* 32-bit address. */ 103 u32 addr; /* 32-bit address. */
93 u32 count; /* Length. */ 104 u32 count; /* Length. */
94}; 105};
95 106
96struct sgentry64 { 107struct sgentry64 {
108 __le32 addr[2]; /* 64-bit addr. 2 pieces for data alignment */
109 __le32 count; /* Length. */
110};
111
112struct user_sgentry64 {
97 u32 addr[2]; /* 64-bit addr. 2 pieces for data alignment */ 113 u32 addr[2]; /* 64-bit addr. 2 pieces for data alignment */
98 u32 count; /* Length. */ 114 u32 count; /* Length. */
99}; 115};
@@ -106,15 +122,25 @@ struct sgentry64 {
106 */ 122 */
107 123
108struct sgmap { 124struct sgmap {
109 u32 count; 125 __le32 count;
110 struct sgentry sg[1]; 126 struct sgentry sg[1];
111}; 127};
112 128
113struct sgmap64 { 129struct user_sgmap {
114 u32 count; 130 u32 count;
131 struct user_sgentry sg[1];
132};
133
134struct sgmap64 {
135 __le32 count;
115 struct sgentry64 sg[1]; 136 struct sgentry64 sg[1];
116}; 137};
117 138
139struct user_sgmap64 {
140 u32 count;
141 struct user_sgentry64 sg[1];
142};
143
118struct creation_info 144struct creation_info
119{ 145{
120 u8 buildnum; /* e.g., 588 */ 146 u8 buildnum; /* e.g., 588 */
@@ -123,14 +149,14 @@ struct creation_info
123 * 2 = API 149 * 2 = API
124 */ 150 */
125 u8 year; /* e.g., 1997 = 97 */ 151 u8 year; /* e.g., 1997 = 97 */
126 u32 date; /* 152 __le32 date; /*
127 * unsigned Month :4; // 1 - 12 153 * unsigned Month :4; // 1 - 12
128 * unsigned Day :6; // 1 - 32 154 * unsigned Day :6; // 1 - 32
129 * unsigned Hour :6; // 0 - 23 155 * unsigned Hour :6; // 0 - 23
130 * unsigned Minute :6; // 0 - 60 156 * unsigned Minute :6; // 0 - 60
131 * unsigned Second :6; // 0 - 60 157 * unsigned Second :6; // 0 - 60
132 */ 158 */
133 u32 serial[2]; /* e.g., 0x1DEADB0BFAFAF001 */ 159 __le32 serial[2]; /* e.g., 0x1DEADB0BFAFAF001 */
134}; 160};
135 161
136 162
@@ -175,8 +201,8 @@ struct creation_info
175 */ 201 */
176 202
177struct aac_entry { 203struct aac_entry {
178 u32 size; /* Size in bytes of Fib which this QE points to */ 204 __le32 size; /* Size in bytes of Fib which this QE points to */
179 u32 addr; /* Receiver address of the FIB */ 205 __le32 addr; /* Receiver address of the FIB */
180}; 206};
181 207
182/* 208/*
@@ -185,9 +211,10 @@ struct aac_entry {
185 */ 211 */
186 212
187struct aac_qhdr { 213struct aac_qhdr {
188 u64 header_addr; /* Address to hand the adapter to access to this queue head */ 214 __le64 header_addr;/* Address to hand the adapter to access
189 u32 *producer; /* The producer index for this queue (host address) */ 215 to this queue head */
190 u32 *consumer; /* The consumer index for this queue (host address) */ 216 __le32 *producer; /* The producer index for this queue (host address) */
217 __le32 *consumer; /* The consumer index for this queue (host address) */
191}; 218};
192 219
193/* 220/*
@@ -261,29 +288,30 @@ enum aac_queue_types {
261 */ 288 */
262 289
263struct aac_fibhdr { 290struct aac_fibhdr {
264 u32 XferState; // Current transfer state for this CCB 291 __le32 XferState; /* Current transfer state for this CCB */
265 u16 Command; // Routing information for the destination 292 __le16 Command; /* Routing information for the destination */
266 u8 StructType; // Type FIB 293 u8 StructType; /* Type FIB */
267 u8 Flags; // Flags for FIB 294 u8 Flags; /* Flags for FIB */
268 u16 Size; // Size of this FIB in bytes 295 __le16 Size; /* Size of this FIB in bytes */
269 u16 SenderSize; // Size of the FIB in the sender (for response sizing) 296 __le16 SenderSize; /* Size of the FIB in the sender
270 u32 SenderFibAddress; // Host defined data in the FIB 297 (for response sizing) */
271 u32 ReceiverFibAddress; // Logical address of this FIB for the adapter 298 __le32 SenderFibAddress; /* Host defined data in the FIB */
272 u32 SenderData; // Place holder for the sender to store data 299 __le32 ReceiverFibAddress;/* Logical address of this FIB for
300 the adapter */
301 u32 SenderData; /* Place holder for the sender to store data */
273 union { 302 union {
274 struct { 303 struct {
275 u32 _ReceiverTimeStart; // Timestamp for receipt of fib 304 __le32 _ReceiverTimeStart; /* Timestamp for
276 u32 _ReceiverTimeDone; // Timestamp for completion of fib 305 receipt of fib */
306 __le32 _ReceiverTimeDone; /* Timestamp for
307 completion of fib */
277 } _s; 308 } _s;
278 } _u; 309 } _u;
279}; 310};
280 311
281#define FIB_DATA_SIZE_IN_BYTES (512 - sizeof(struct aac_fibhdr))
282
283
284struct hw_fib { 312struct hw_fib {
285 struct aac_fibhdr header; 313 struct aac_fibhdr header;
286 u8 data[FIB_DATA_SIZE_IN_BYTES]; // Command specific data 314 u8 data[512-sizeof(struct aac_fibhdr)]; // Command specific data
287}; 315};
288 316
289/* 317/*
@@ -345,11 +373,12 @@ struct hw_fib {
345#define RequestAdapterInfo 703 373#define RequestAdapterInfo 703
346#define IsAdapterPaused 704 374#define IsAdapterPaused 704
347#define SendHostTime 705 375#define SendHostTime 705
348#define LastMiscCommand 706 376#define RequestSupplementAdapterInfo 706
377#define LastMiscCommand 707
349 378
350// 379/*
351// Commands that will target the failover level on the FSA adapter 380 * Commands that will target the failover level on the FSA adapter
352// 381 */
353 382
354enum fib_xfer_state { 383enum fib_xfer_state {
355 HostOwned = (1<<0), 384 HostOwned = (1<<0),
@@ -382,22 +411,32 @@ enum fib_xfer_state {
382 */ 411 */
383 412
384#define ADAPTER_INIT_STRUCT_REVISION 3 413#define ADAPTER_INIT_STRUCT_REVISION 3
414#define ADAPTER_INIT_STRUCT_REVISION_4 4 // rocket science
385 415
386struct aac_init 416struct aac_init
387{ 417{
388 u32 InitStructRevision; 418 __le32 InitStructRevision;
389 u32 MiniPortRevision; 419 __le32 MiniPortRevision;
390 u32 fsrev; 420 __le32 fsrev;
391 u32 CommHeaderAddress; 421 __le32 CommHeaderAddress;
392 u32 FastIoCommAreaAddress; 422 __le32 FastIoCommAreaAddress;
393 u32 AdapterFibsPhysicalAddress; 423 __le32 AdapterFibsPhysicalAddress;
394 u32 AdapterFibsVirtualAddress; 424 __le32 AdapterFibsVirtualAddress;
395 u32 AdapterFibsSize; 425 __le32 AdapterFibsSize;
396 u32 AdapterFibAlign; 426 __le32 AdapterFibAlign;
397 u32 printfbuf; 427 __le32 printfbuf;
398 u32 printfbufsiz; 428 __le32 printfbufsiz;
399 u32 HostPhysMemPages; // number of 4k pages of host physical memory 429 __le32 HostPhysMemPages; /* number of 4k pages of host
400 u32 HostElapsedSeconds; // number of seconds since 1970. 430 physical memory */
431 __le32 HostElapsedSeconds; /* number of seconds since 1970. */
432 /*
433 * ADAPTER_INIT_STRUCT_REVISION_4 begins here
434 */
435 __le32 InitFlags; /* flags for supported features */
436#define INITFLAGS_NEW_COMM_SUPPORTED 0x00000001
437 __le32 MaxIoCommands; /* max outstanding commands */
438 __le32 MaxIoSize; /* largest I/O command */
439 __le32 MaxFibSize; /* largest FIB to adapter */
401}; 440};
402 441
403enum aac_log_level { 442enum aac_log_level {
@@ -421,7 +460,7 @@ struct adapter_ops
421{ 460{
422 void (*adapter_interrupt)(struct aac_dev *dev); 461 void (*adapter_interrupt)(struct aac_dev *dev);
423 void (*adapter_notify)(struct aac_dev *dev, u32 event); 462 void (*adapter_notify)(struct aac_dev *dev, u32 event);
424 int (*adapter_sync_cmd)(struct aac_dev *dev, u32 command, u32 p1, u32 *status); 463 int (*adapter_sync_cmd)(struct aac_dev *dev, u32 command, u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6, u32 *status, u32 *r1, u32 *r2, u32 *r3, u32 *r4);
425 int (*adapter_check_health)(struct aac_dev *dev); 464 int (*adapter_check_health)(struct aac_dev *dev);
426}; 465};
427 466
@@ -541,6 +580,7 @@ struct sa_drawbridge_CSR {
541#define Mailbox3 SaDbCSR.MAILBOX3 580#define Mailbox3 SaDbCSR.MAILBOX3
542#define Mailbox4 SaDbCSR.MAILBOX4 581#define Mailbox4 SaDbCSR.MAILBOX4
543#define Mailbox5 SaDbCSR.MAILBOX5 582#define Mailbox5 SaDbCSR.MAILBOX5
583#define Mailbox6 SaDbCSR.MAILBOX6
544#define Mailbox7 SaDbCSR.MAILBOX7 584#define Mailbox7 SaDbCSR.MAILBOX7
545 585
546#define DoorbellReg_p SaDbCSR.PRISETIRQ 586#define DoorbellReg_p SaDbCSR.PRISETIRQ
@@ -763,29 +803,48 @@ struct fib {
763 803
764struct aac_adapter_info 804struct aac_adapter_info
765{ 805{
766 u32 platform; 806 __le32 platform;
767 u32 cpu; 807 __le32 cpu;
768 u32 subcpu; 808 __le32 subcpu;
769 u32 clock; 809 __le32 clock;
770 u32 execmem; 810 __le32 execmem;
771 u32 buffermem; 811 __le32 buffermem;
772 u32 totalmem; 812 __le32 totalmem;
773 u32 kernelrev; 813 __le32 kernelrev;
774 u32 kernelbuild; 814 __le32 kernelbuild;
775 u32 monitorrev; 815 __le32 monitorrev;
776 u32 monitorbuild; 816 __le32 monitorbuild;
777 u32 hwrev; 817 __le32 hwrev;
778 u32 hwbuild; 818 __le32 hwbuild;
779 u32 biosrev; 819 __le32 biosrev;
780 u32 biosbuild; 820 __le32 biosbuild;
781 u32 cluster; 821 __le32 cluster;
782 u32 clusterchannelmask; 822 __le32 clusterchannelmask;
783 u32 serial[2]; 823 __le32 serial[2];
784 u32 battery; 824 __le32 battery;
785 u32 options; 825 __le32 options;
786 u32 OEM; 826 __le32 OEM;
787}; 827};
788 828
829struct aac_supplement_adapter_info
830{
831 u8 AdapterTypeText[17+1];
832 u8 Pad[2];
833 __le32 FlashMemoryByteSize;
834 __le32 FlashImageId;
835 __le32 MaxNumberPorts;
836 __le32 Version;
837 __le32 FeatureBits;
838 u8 SlotNumber;
839 u8 ReservedPad0[0];
840 u8 BuildDate[12];
841 __le32 CurrentNumberPorts;
842 __le32 ReservedGrowth[24];
843};
844#define AAC_FEATURE_FALCON 0x00000010
845#define AAC_SIS_VERSION_V3 3
846#define AAC_SIS_SLOT_UNKNOWN 0xFF
847
789/* 848/*
790 * Battery platforms 849 * Battery platforms
791 */ 850 */
@@ -831,6 +890,12 @@ struct aac_dev
831 890
832 u16 irq_mask; 891 u16 irq_mask;
833 /* 892 /*
893 * negotiated FIB settings
894 */
895 unsigned max_fib_size;
896 unsigned sg_tablesize;
897
898 /*
834 * Map for 128 fib objects (64k) 899 * Map for 128 fib objects (64k)
835 */ 900 */
836 dma_addr_t hw_fib_pa; 901 dma_addr_t hw_fib_pa;
@@ -889,12 +954,14 @@ struct aac_dev
889 u32 aif_thread; 954 u32 aif_thread;
890 struct completion aif_completion; 955 struct completion aif_completion;
891 struct aac_adapter_info adapter_info; 956 struct aac_adapter_info adapter_info;
957 struct aac_supplement_adapter_info supplement_adapter_info;
892 /* These are in adapter info but they are in the io flow so 958 /* These are in adapter info but they are in the io flow so
893 * lets break them out so we don't have to do an AND to check them 959 * lets break them out so we don't have to do an AND to check them
894 */ 960 */
895 u8 nondasd_support; 961 u8 nondasd_support;
896 u8 dac_support; 962 u8 dac_support;
897 u8 raid_scsi_mode; 963 u8 raid_scsi_mode;
964 u8 printf_enabled;
898}; 965};
899 966
900#define aac_adapter_interrupt(dev) \ 967#define aac_adapter_interrupt(dev) \
@@ -903,6 +970,8 @@ struct aac_dev
903#define aac_adapter_notify(dev, event) \ 970#define aac_adapter_notify(dev, event) \
904 (dev)->a_ops.adapter_notify(dev, event) 971 (dev)->a_ops.adapter_notify(dev, event)
905 972
973#define aac_adapter_sync_cmd(dev, command, p1, p2, p3, p4, p5, p6, status, r1, r2, r3, r4) \
974 (dev)->a_ops.adapter_sync_cmd(dev, command, p1, p2, p3, p4, p5, p6, status, r1, r2, r3, r4)
906 975
907#define aac_adapter_check_health(dev) \ 976#define aac_adapter_check_health(dev) \
908 (dev)->a_ops.adapter_check_health(dev) 977 (dev)->a_ops.adapter_check_health(dev)
@@ -1016,83 +1085,102 @@ struct aac_dev
1016 1085
1017struct aac_read 1086struct aac_read
1018{ 1087{
1019 u32 command; 1088 __le32 command;
1020 u32 cid; 1089 __le32 cid;
1021 u32 block; 1090 __le32 block;
1022 u32 count; 1091 __le32 count;
1023 struct sgmap sg; // Must be last in struct because it is variable 1092 struct sgmap sg; // Must be last in struct because it is variable
1024}; 1093};
1025 1094
1026struct aac_read64 1095struct aac_read64
1027{ 1096{
1028 u32 command; 1097 __le32 command;
1029 u16 cid; 1098 __le16 cid;
1030 u16 sector_count; 1099 __le16 sector_count;
1031 u32 block; 1100 __le32 block;
1032 u16 pad; 1101 __le16 pad;
1033 u16 flags; 1102 __le16 flags;
1034 struct sgmap64 sg; // Must be last in struct because it is variable 1103 struct sgmap64 sg; // Must be last in struct because it is variable
1035}; 1104};
1036 1105
1037struct aac_read_reply 1106struct aac_read_reply
1038{ 1107{
1039 u32 status; 1108 __le32 status;
1040 u32 count; 1109 __le32 count;
1041}; 1110};
1042 1111
1043struct aac_write 1112struct aac_write
1044{ 1113{
1045 u32 command; 1114 __le32 command;
1046 u32 cid; 1115 __le32 cid;
1047 u32 block; 1116 __le32 block;
1048 u32 count; 1117 __le32 count;
1049 u32 stable; // Not used 1118 __le32 stable; // Not used
1050 struct sgmap sg; // Must be last in struct because it is variable 1119 struct sgmap sg; // Must be last in struct because it is variable
1051}; 1120};
1052 1121
1053struct aac_write64 1122struct aac_write64
1054{ 1123{
1055 u32 command; 1124 __le32 command;
1056 u16 cid; 1125 __le16 cid;
1057 u16 sector_count; 1126 __le16 sector_count;
1058 u32 block; 1127 __le32 block;
1059 u16 pad; 1128 __le16 pad;
1060 u16 flags; 1129 __le16 flags;
1061 struct sgmap64 sg; // Must be last in struct because it is variable 1130 struct sgmap64 sg; // Must be last in struct because it is variable
1062}; 1131};
1063struct aac_write_reply 1132struct aac_write_reply
1064{ 1133{
1065 u32 status; 1134 __le32 status;
1066 u32 count; 1135 __le32 count;
1067 u32 committed; 1136 __le32 committed;
1068}; 1137};
1069 1138
1070#define CT_FLUSH_CACHE 129 1139#define CT_FLUSH_CACHE 129
1071struct aac_synchronize { 1140struct aac_synchronize {
1072 u32 command; /* VM_ContainerConfig */ 1141 __le32 command; /* VM_ContainerConfig */
1073 u32 type; /* CT_FLUSH_CACHE */ 1142 __le32 type; /* CT_FLUSH_CACHE */
1074 u32 cid; 1143 __le32 cid;
1075 u32 parm1; 1144 __le32 parm1;
1076 u32 parm2; 1145 __le32 parm2;
1077 u32 parm3; 1146 __le32 parm3;
1078 u32 parm4; 1147 __le32 parm4;
1079 u32 count; /* sizeof(((struct aac_synchronize_reply *)NULL)->data) */ 1148 __le32 count; /* sizeof(((struct aac_synchronize_reply *)NULL)->data) */
1080}; 1149};
1081 1150
1082struct aac_synchronize_reply { 1151struct aac_synchronize_reply {
1083 u32 dummy0; 1152 __le32 dummy0;
1084 u32 dummy1; 1153 __le32 dummy1;
1085 u32 status; /* CT_OK */ 1154 __le32 status; /* CT_OK */
1086 u32 parm1; 1155 __le32 parm1;
1087 u32 parm2; 1156 __le32 parm2;
1088 u32 parm3; 1157 __le32 parm3;
1089 u32 parm4; 1158 __le32 parm4;
1090 u32 parm5; 1159 __le32 parm5;
1091 u8 data[16]; 1160 u8 data[16];
1092}; 1161};
1093 1162
1094struct aac_srb 1163struct aac_srb
1095{ 1164{
1165 __le32 function;
1166 __le32 channel;
1167 __le32 id;
1168 __le32 lun;
1169 __le32 timeout;
1170 __le32 flags;
1171 __le32 count; // Data xfer size
1172 __le32 retry_limit;
1173 __le32 cdb_size;
1174 u8 cdb[16];
1175 struct sgmap sg;
1176};
1177
1178/*
1179 * This and assocated data structs are used by the
1180 * ioctl caller and are in cpu order.
1181 */
1182struct user_aac_srb
1183{
1096 u32 function; 1184 u32 function;
1097 u32 channel; 1185 u32 channel;
1098 u32 id; 1186 u32 id;
@@ -1103,20 +1191,18 @@ struct aac_srb
1103 u32 retry_limit; 1191 u32 retry_limit;
1104 u32 cdb_size; 1192 u32 cdb_size;
1105 u8 cdb[16]; 1193 u8 cdb[16];
1106 struct sgmap sg; 1194 struct user_sgmap sg;
1107}; 1195};
1108 1196
1109
1110
1111#define AAC_SENSE_BUFFERSIZE 30 1197#define AAC_SENSE_BUFFERSIZE 30
1112 1198
1113struct aac_srb_reply 1199struct aac_srb_reply
1114{ 1200{
1115 u32 status; 1201 __le32 status;
1116 u32 srb_status; 1202 __le32 srb_status;
1117 u32 scsi_status; 1203 __le32 scsi_status;
1118 u32 data_xfer_length; 1204 __le32 data_xfer_length;
1119 u32 sense_data_size; 1205 __le32 sense_data_size;
1120 u8 sense_data[AAC_SENSE_BUFFERSIZE]; // Can this be SCSI_SENSE_BUFFERSIZE 1206 u8 sense_data[AAC_SENSE_BUFFERSIZE]; // Can this be SCSI_SENSE_BUFFERSIZE
1121}; 1207};
1122/* 1208/*
@@ -1223,14 +1309,14 @@ struct aac_srb_reply
1223 */ 1309 */
1224 1310
1225struct aac_fsinfo { 1311struct aac_fsinfo {
1226 u32 fsTotalSize; /* Consumed by fs, incl. metadata */ 1312 __le32 fsTotalSize; /* Consumed by fs, incl. metadata */
1227 u32 fsBlockSize; 1313 __le32 fsBlockSize;
1228 u32 fsFragSize; 1314 __le32 fsFragSize;
1229 u32 fsMaxExtendSize; 1315 __le32 fsMaxExtendSize;
1230 u32 fsSpaceUnits; 1316 __le32 fsSpaceUnits;
1231 u32 fsMaxNumFiles; 1317 __le32 fsMaxNumFiles;
1232 u32 fsNumFreeFiles; 1318 __le32 fsNumFreeFiles;
1233 u32 fsInodeDensity; 1319 __le32 fsInodeDensity;
1234}; /* valid iff ObjType == FT_FILESYS && !(ContentState & FSCS_NOTCLEAN) */ 1320}; /* valid iff ObjType == FT_FILESYS && !(ContentState & FSCS_NOTCLEAN) */
1235 1321
1236union aac_contentinfo { 1322union aac_contentinfo {
@@ -1243,32 +1329,32 @@ union aac_contentinfo {
1243 1329
1244#define CT_GET_CONFIG_STATUS 147 1330#define CT_GET_CONFIG_STATUS 147
1245struct aac_get_config_status { 1331struct aac_get_config_status {
1246 u32 command; /* VM_ContainerConfig */ 1332 __le32 command; /* VM_ContainerConfig */
1247 u32 type; /* CT_GET_CONFIG_STATUS */ 1333 __le32 type; /* CT_GET_CONFIG_STATUS */
1248 u32 parm1; 1334 __le32 parm1;
1249 u32 parm2; 1335 __le32 parm2;
1250 u32 parm3; 1336 __le32 parm3;
1251 u32 parm4; 1337 __le32 parm4;
1252 u32 parm5; 1338 __le32 parm5;
1253 u32 count; /* sizeof(((struct aac_get_config_status_resp *)NULL)->data) */ 1339 __le32 count; /* sizeof(((struct aac_get_config_status_resp *)NULL)->data) */
1254}; 1340};
1255 1341
1256#define CFACT_CONTINUE 0 1342#define CFACT_CONTINUE 0
1257#define CFACT_PAUSE 1 1343#define CFACT_PAUSE 1
1258#define CFACT_ABORT 2 1344#define CFACT_ABORT 2
1259struct aac_get_config_status_resp { 1345struct aac_get_config_status_resp {
1260 u32 response; /* ST_OK */ 1346 __le32 response; /* ST_OK */
1261 u32 dummy0; 1347 __le32 dummy0;
1262 u32 status; /* CT_OK */ 1348 __le32 status; /* CT_OK */
1263 u32 parm1; 1349 __le32 parm1;
1264 u32 parm2; 1350 __le32 parm2;
1265 u32 parm3; 1351 __le32 parm3;
1266 u32 parm4; 1352 __le32 parm4;
1267 u32 parm5; 1353 __le32 parm5;
1268 struct { 1354 struct {
1269 u32 action; /* CFACT_CONTINUE, CFACT_PAUSE or CFACT_ABORT */ 1355 __le32 action; /* CFACT_CONTINUE, CFACT_PAUSE or CFACT_ABORT */
1270 u16 flags; 1356 __le16 flags;
1271 s16 count; 1357 __le16 count;
1272 } data; 1358 } data;
1273}; 1359};
1274 1360
@@ -1279,26 +1365,26 @@ struct aac_get_config_status_resp {
1279#define CT_COMMIT_CONFIG 152 1365#define CT_COMMIT_CONFIG 152
1280 1366
1281struct aac_commit_config { 1367struct aac_commit_config {
1282 u32 command; /* VM_ContainerConfig */ 1368 __le32 command; /* VM_ContainerConfig */
1283 u32 type; /* CT_COMMIT_CONFIG */ 1369 __le32 type; /* CT_COMMIT_CONFIG */
1284}; 1370};
1285 1371
1286/* 1372/*
1287 * Query for Container Configuration Count 1373 * Query for Container Configuration Status
1288 */ 1374 */
1289 1375
1290#define CT_GET_CONTAINER_COUNT 4 1376#define CT_GET_CONTAINER_COUNT 4
1291struct aac_get_container_count { 1377struct aac_get_container_count {
1292 u32 command; /* VM_ContainerConfig */ 1378 __le32 command; /* VM_ContainerConfig */
1293 u32 type; /* CT_GET_CONTAINER_COUNT */ 1379 __le32 type; /* CT_GET_CONTAINER_COUNT */
1294}; 1380};
1295 1381
1296struct aac_get_container_count_resp { 1382struct aac_get_container_count_resp {
1297 u32 response; /* ST_OK */ 1383 __le32 response; /* ST_OK */
1298 u32 dummy0; 1384 __le32 dummy0;
1299 u32 MaxContainers; 1385 __le32 MaxContainers;
1300 u32 ContainerSwitchEntries; 1386 __le32 ContainerSwitchEntries;
1301 u32 MaxPartitions; 1387 __le32 MaxPartitions;
1302}; 1388};
1303 1389
1304 1390
@@ -1308,15 +1394,19 @@ struct aac_get_container_count_resp {
1308 */ 1394 */
1309 1395
1310struct aac_mntent { 1396struct aac_mntent {
1311 u32 oid; 1397 __le32 oid;
1312 u8 name[16]; // if applicable 1398 u8 name[16]; /* if applicable */
1313 struct creation_info create_info; // if applicable 1399 struct creation_info create_info; /* if applicable */
1314 u32 capacity; 1400 __le32 capacity;
1315 u32 vol; // substrate structure 1401 __le32 vol; /* substrate structure */
1316 u32 obj; // FT_FILESYS, FT_DATABASE, etc. 1402 __le32 obj; /* FT_FILESYS,
1317 u32 state; // unready for mounting, readonly, etc. 1403 FT_DATABASE, etc. */
1318 union aac_contentinfo fileinfo; // Info specific to content manager (eg, filesystem) 1404 __le32 state; /* unready for mounting,
1319 u32 altoid; // != oid <==> snapshot or broken mirror exists 1405 readonly, etc. */
1406 union aac_contentinfo fileinfo; /* Info specific to content
1407 manager (eg, filesystem) */
1408 __le32 altoid; /* != oid <==> snapshot or
1409 broken mirror exists */
1320}; 1410};
1321 1411
1322#define FSCS_NOTCLEAN 0x0001 /* fsck is neccessary before mounting */ 1412#define FSCS_NOTCLEAN 0x0001 /* fsck is neccessary before mounting */
@@ -1324,40 +1414,40 @@ struct aac_mntent {
1324#define FSCS_HIDDEN 0x0004 /* should be ignored - set during a clear */ 1414#define FSCS_HIDDEN 0x0004 /* should be ignored - set during a clear */
1325 1415
1326struct aac_query_mount { 1416struct aac_query_mount {
1327 u32 command; 1417 __le32 command;
1328 u32 type; 1418 __le32 type;
1329 u32 count; 1419 __le32 count;
1330}; 1420};
1331 1421
1332struct aac_mount { 1422struct aac_mount {
1333 u32 status; 1423 __le32 status;
1334 u32 type; /* should be same as that requested */ 1424 __le32 type; /* should be same as that requested */
1335 u32 count; 1425 __le32 count;
1336 struct aac_mntent mnt[1]; 1426 struct aac_mntent mnt[1];
1337}; 1427};
1338 1428
1339#define CT_READ_NAME 130 1429#define CT_READ_NAME 130
1340struct aac_get_name { 1430struct aac_get_name {
1341 u32 command; /* VM_ContainerConfig */ 1431 __le32 command; /* VM_ContainerConfig */
1342 u32 type; /* CT_READ_NAME */ 1432 __le32 type; /* CT_READ_NAME */
1343 u32 cid; 1433 __le32 cid;
1344 u32 parm1; 1434 __le32 parm1;
1345 u32 parm2; 1435 __le32 parm2;
1346 u32 parm3; 1436 __le32 parm3;
1347 u32 parm4; 1437 __le32 parm4;
1348 u32 count; /* sizeof(((struct aac_get_name_resp *)NULL)->data) */ 1438 __le32 count; /* sizeof(((struct aac_get_name_resp *)NULL)->data) */
1349}; 1439};
1350 1440
1351#define CT_OK 218 1441#define CT_OK 218
1352struct aac_get_name_resp { 1442struct aac_get_name_resp {
1353 u32 dummy0; 1443 __le32 dummy0;
1354 u32 dummy1; 1444 __le32 dummy1;
1355 u32 status; /* CT_OK */ 1445 __le32 status; /* CT_OK */
1356 u32 parm1; 1446 __le32 parm1;
1357 u32 parm2; 1447 __le32 parm2;
1358 u32 parm3; 1448 __le32 parm3;
1359 u32 parm4; 1449 __le32 parm4;
1360 u32 parm5; 1450 __le32 parm5;
1361 u8 data[16]; 1451 u8 data[16];
1362}; 1452};
1363 1453
@@ -1366,8 +1456,8 @@ struct aac_get_name_resp {
1366 */ 1456 */
1367 1457
1368struct aac_close { 1458struct aac_close {
1369 u32 command; 1459 __le32 command;
1370 u32 cid; 1460 __le32 cid;
1371}; 1461};
1372 1462
1373struct aac_query_disk 1463struct aac_query_disk
@@ -1434,6 +1524,7 @@ struct revision
1434#define FSACTL_GET_PCI_INFO CTL_CODE(2119, METHOD_BUFFERED) 1524#define FSACTL_GET_PCI_INFO CTL_CODE(2119, METHOD_BUFFERED)
1435#define FSACTL_FORCE_DELETE_DISK CTL_CODE(2120, METHOD_NEITHER) 1525#define FSACTL_FORCE_DELETE_DISK CTL_CODE(2120, METHOD_NEITHER)
1436#define FSACTL_GET_CONTAINERS 2131 1526#define FSACTL_GET_CONTAINERS 2131
1527#define FSACTL_SEND_LARGE_FIB CTL_CODE(2138, METHOD_BUFFERED)
1437 1528
1438 1529
1439struct aac_common 1530struct aac_common
@@ -1573,8 +1664,8 @@ extern struct aac_common aac_config;
1573 */ 1664 */
1574 1665
1575struct aac_aifcmd { 1666struct aac_aifcmd {
1576 u32 command; /* Tell host what type of notify this is */ 1667 __le32 command; /* Tell host what type of notify this is */
1577 u32 seqnum; /* To allow ordering of reports (if necessary) */ 1668 __le32 seqnum; /* To allow ordering of reports (if necessary) */
1578 u8 data[1]; /* Undefined length (from kernel viewpoint) */ 1669 u8 data[1]; /* Undefined length (from kernel viewpoint) */
1579}; 1670};
1580 1671
@@ -1597,7 +1688,6 @@ int fib_setup(struct aac_dev *dev);
1597void fib_map_free(struct aac_dev *dev); 1688void fib_map_free(struct aac_dev *dev);
1598void fib_free(struct fib * context); 1689void fib_free(struct fib * context);
1599void fib_init(struct fib * context); 1690void fib_init(struct fib * context);
1600void fib_dealloc(struct fib * context);
1601void aac_printf(struct aac_dev *dev, u32 val); 1691void aac_printf(struct aac_dev *dev, u32 val);
1602int fib_send(u16 command, struct fib * context, unsigned long size, int priority, int wait, int reply, fib_callback callback, void *ctxt); 1692int fib_send(u16 command, struct fib * context, unsigned long size, int priority, int wait, int reply, fib_callback callback, void *ctxt);
1603int aac_consumer_get(struct aac_dev * dev, struct aac_queue * q, struct aac_entry **entry); 1693int aac_consumer_get(struct aac_dev * dev, struct aac_queue * q, struct aac_entry **entry);
@@ -1621,3 +1711,5 @@ int fib_adapter_complete(struct fib * fibptr, unsigned short size);
1621struct aac_driver_ident* aac_get_driver_ident(int devtype); 1711struct aac_driver_ident* aac_get_driver_ident(int devtype);
1622int aac_get_adapter_info(struct aac_dev* dev); 1712int aac_get_adapter_info(struct aac_dev* dev);
1623int aac_send_shutdown(struct aac_dev *dev); 1713int aac_send_shutdown(struct aac_dev *dev);
1714extern int numacb;
1715extern int acbsize;
diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
index 30dd1f7120f4..1fef92d55dee 100644
--- a/drivers/scsi/aacraid/commctrl.c
+++ b/drivers/scsi/aacraid/commctrl.c
@@ -51,15 +51,22 @@
51 * This routine sends a fib to the adapter on behalf of a user level 51 * This routine sends a fib to the adapter on behalf of a user level
52 * program. 52 * program.
53 */ 53 */
54# define AAC_DEBUG_PREAMBLE KERN_INFO
55# define AAC_DEBUG_POSTAMBLE
54 56
55static int ioctl_send_fib(struct aac_dev * dev, void __user *arg) 57static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
56{ 58{
57 struct hw_fib * kfib; 59 struct hw_fib * kfib;
58 struct fib *fibptr; 60 struct fib *fibptr;
61 struct hw_fib * hw_fib = (struct hw_fib *)0;
62 dma_addr_t hw_fib_pa = (dma_addr_t)0LL;
63 unsigned size;
64 int retval;
59 65
60 fibptr = fib_alloc(dev); 66 fibptr = fib_alloc(dev);
61 if(fibptr == NULL) 67 if(fibptr == NULL) {
62 return -ENOMEM; 68 return -ENOMEM;
69 }
63 70
64 kfib = fibptr->hw_fib; 71 kfib = fibptr->hw_fib;
65 /* 72 /*
@@ -74,19 +81,24 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
74 * will not overrun the buffer when we copy the memory. Return 81 * will not overrun the buffer when we copy the memory. Return
75 * an error if we would. 82 * an error if we would.
76 */ 83 */
77 if (le16_to_cpu(kfib->header.Size) > 84 size = le16_to_cpu(kfib->header.Size) + sizeof(struct aac_fibhdr);
78 sizeof(struct hw_fib) - sizeof(struct aac_fibhdr)) { 85 if (size < le16_to_cpu(kfib->header.SenderSize))
79 fib_free(fibptr); 86 size = le16_to_cpu(kfib->header.SenderSize);
80 return -EINVAL; 87 if (size > dev->max_fib_size) {
88 /* Highjack the hw_fib */
89 hw_fib = fibptr->hw_fib;
90 hw_fib_pa = fibptr->hw_fib_pa;
91 fibptr->hw_fib = kfib = pci_alloc_consistent(dev->pdev, size, &fibptr->hw_fib_pa);
92 memset(((char *)kfib) + dev->max_fib_size, 0, size - dev->max_fib_size);
93 memcpy(kfib, hw_fib, dev->max_fib_size);
81 } 94 }
82 95
83 if (copy_from_user(kfib, arg, le16_to_cpu(kfib->header.Size) + 96 if (copy_from_user(kfib, arg, size)) {
84 sizeof(struct aac_fibhdr))) { 97 retval = -EFAULT;
85 fib_free(fibptr); 98 goto cleanup;
86 return -EFAULT;
87 } 99 }
88 100
89 if (kfib->header.Command == cpu_to_le32(TakeABreakPt)) { 101 if (kfib->header.Command == cpu_to_le16(TakeABreakPt)) {
90 aac_adapter_interrupt(dev); 102 aac_adapter_interrupt(dev);
91 /* 103 /*
92 * Since we didn't really send a fib, zero out the state to allow 104 * Since we didn't really send a fib, zero out the state to allow
@@ -94,16 +106,15 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
94 */ 106 */
95 kfib->header.XferState = 0; 107 kfib->header.XferState = 0;
96 } else { 108 } else {
97 int retval = fib_send(kfib->header.Command, fibptr, 109 retval = fib_send(le16_to_cpu(kfib->header.Command), fibptr,
98 le16_to_cpu(kfib->header.Size) , FsaNormal, 110 le16_to_cpu(kfib->header.Size) , FsaNormal,
99 1, 1, NULL, NULL); 111 1, 1, NULL, NULL);
100 if (retval) { 112 if (retval) {
101 fib_free(fibptr); 113 goto cleanup;
102 return retval;
103 } 114 }
104 if (fib_complete(fibptr) != 0) { 115 if (fib_complete(fibptr) != 0) {
105 fib_free(fibptr); 116 retval = -EINVAL;
106 return -EINVAL; 117 goto cleanup;
107 } 118 }
108 } 119 }
109 /* 120 /*
@@ -114,12 +125,17 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
114 * was already included by the adapter.) 125 * was already included by the adapter.)
115 */ 126 */
116 127
117 if (copy_to_user(arg, (void *)kfib, kfib->header.Size)) { 128 retval = 0;
118 fib_free(fibptr); 129 if (copy_to_user(arg, (void *)kfib, size))
119 return -EFAULT; 130 retval = -EFAULT;
131cleanup:
132 if (hw_fib) {
133 pci_free_consistent(dev->pdev, size, kfib, fibptr->hw_fib_pa);
134 fibptr->hw_fib_pa = hw_fib_pa;
135 fibptr->hw_fib = hw_fib;
120 } 136 }
121 fib_free(fibptr); 137 fib_free(fibptr);
122 return 0; 138 return retval;
123} 139}
124 140
125/** 141/**
@@ -391,26 +407,28 @@ static int check_revision(struct aac_dev *dev, void __user *arg)
391 struct revision response; 407 struct revision response;
392 408
393 response.compat = 1; 409 response.compat = 1;
394 response.version = dev->adapter_info.kernelrev; 410 response.version = le32_to_cpu(dev->adapter_info.kernelrev);
395 response.build = dev->adapter_info.kernelbuild; 411 response.build = le32_to_cpu(dev->adapter_info.kernelbuild);
396 412
397 if (copy_to_user(arg, &response, sizeof(response))) 413 if (copy_to_user(arg, &response, sizeof(response)))
398 return -EFAULT; 414 return -EFAULT;
399 return 0; 415 return 0;
400} 416}
401 417
418
402/** 419/**
403 * 420 *
404 * aac_send_raw_scb 421 * aac_send_raw_scb
405 * 422 *
406 */ 423 */
407 424
408int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) 425static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
409{ 426{
410 struct fib* srbfib; 427 struct fib* srbfib;
411 int status; 428 int status;
412 struct aac_srb *srbcmd; 429 struct aac_srb *srbcmd = NULL;
413 struct aac_srb __user *user_srb = arg; 430 struct user_aac_srb *user_srbcmd = NULL;
431 struct user_aac_srb __user *user_srb = arg;
414 struct aac_srb_reply __user *user_reply; 432 struct aac_srb_reply __user *user_reply;
415 struct aac_srb_reply* reply; 433 struct aac_srb_reply* reply;
416 u32 fibsize = 0; 434 u32 fibsize = 0;
@@ -426,50 +444,59 @@ int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
426 444
427 445
428 if (!capable(CAP_SYS_ADMIN)){ 446 if (!capable(CAP_SYS_ADMIN)){
429 printk(KERN_DEBUG"aacraid: No permission to send raw srb\n"); 447 dprintk((KERN_DEBUG"aacraid: No permission to send raw srb\n"));
430 return -EPERM; 448 return -EPERM;
431 } 449 }
432 /* 450 /*
433 * Allocate and initialize a Fib then setup a BlockWrite command 451 * Allocate and initialize a Fib then setup a BlockWrite command
434 */ 452 */
435 if (!(srbfib = fib_alloc(dev))) { 453 if (!(srbfib = fib_alloc(dev))) {
436 return -1; 454 return -ENOMEM;
437 } 455 }
438 fib_init(srbfib); 456 fib_init(srbfib);
439 457
440 srbcmd = (struct aac_srb*) fib_data(srbfib); 458 srbcmd = (struct aac_srb*) fib_data(srbfib);
441 459
460 memset(sg_list, 0, sizeof(sg_list)); /* cleanup may take issue */
442 if(copy_from_user(&fibsize, &user_srb->count,sizeof(u32))){ 461 if(copy_from_user(&fibsize, &user_srb->count,sizeof(u32))){
443 printk(KERN_DEBUG"aacraid: Could not copy data size from user\n"); 462 dprintk((KERN_DEBUG"aacraid: Could not copy data size from user\n"));
444 rcode = -EFAULT; 463 rcode = -EFAULT;
445 goto cleanup; 464 goto cleanup;
446 } 465 }
447 466
448 if (fibsize > FIB_DATA_SIZE_IN_BYTES) { 467 if (fibsize > (dev->max_fib_size - sizeof(struct aac_fibhdr))) {
449 rcode = -EINVAL; 468 rcode = -EINVAL;
450 goto cleanup; 469 goto cleanup;
451 } 470 }
452 471
453 if(copy_from_user(srbcmd, user_srb,fibsize)){ 472 user_srbcmd = kmalloc(GFP_KERNEL, fibsize);
454 printk(KERN_DEBUG"aacraid: Could not copy srb from user\n"); 473 if (!user_srbcmd) {
474 dprintk((KERN_DEBUG"aacraid: Could not make a copy of the srb\n"));
475 rcode = -ENOMEM;
476 goto cleanup;
477 }
478 if(copy_from_user(user_srbcmd, user_srb,fibsize)){
479 dprintk((KERN_DEBUG"aacraid: Could not copy srb from user\n"));
455 rcode = -EFAULT; 480 rcode = -EFAULT;
456 goto cleanup; 481 goto cleanup;
457 } 482 }
458 483
459 user_reply = arg+fibsize; 484 user_reply = arg+fibsize;
460 485
461 flags = srbcmd->flags; 486 flags = user_srbcmd->flags; /* from user in cpu order */
462 // Fix up srb for endian and force some values 487 // Fix up srb for endian and force some values
488
463 srbcmd->function = cpu_to_le32(SRBF_ExecuteScsi); // Force this 489 srbcmd->function = cpu_to_le32(SRBF_ExecuteScsi); // Force this
464 srbcmd->channel = cpu_to_le32(srbcmd->channel); 490 srbcmd->channel = cpu_to_le32(user_srbcmd->channel);
465 srbcmd->id = cpu_to_le32(srbcmd->id); 491 srbcmd->id = cpu_to_le32(user_srbcmd->id);
466 srbcmd->lun = cpu_to_le32(srbcmd->lun); 492 srbcmd->lun = cpu_to_le32(user_srbcmd->lun);
467 srbcmd->flags = cpu_to_le32(srbcmd->flags); 493 srbcmd->timeout = cpu_to_le32(user_srbcmd->timeout);
468 srbcmd->timeout = cpu_to_le32(srbcmd->timeout); 494 srbcmd->flags = cpu_to_le32(flags);
469 srbcmd->retry_limit =cpu_to_le32(0); // Obsolete parameter 495 srbcmd->retry_limit = 0; // Obsolete parameter
470 srbcmd->cdb_size = cpu_to_le32(srbcmd->cdb_size); 496 srbcmd->cdb_size = cpu_to_le32(user_srbcmd->cdb_size);
497 memcpy(srbcmd->cdb, user_srbcmd->cdb, sizeof(srbcmd->cdb));
471 498
472 switch (srbcmd->flags & (SRB_DataIn | SRB_DataOut)) { 499 switch (flags & (SRB_DataIn | SRB_DataOut)) {
473 case SRB_DataOut: 500 case SRB_DataOut:
474 data_dir = DMA_TO_DEVICE; 501 data_dir = DMA_TO_DEVICE;
475 break; 502 break;
@@ -482,118 +509,148 @@ int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
482 default: 509 default:
483 data_dir = DMA_NONE; 510 data_dir = DMA_NONE;
484 } 511 }
512 if (user_srbcmd->sg.count > (sizeof(sg_list)/sizeof(sg_list[0]))) {
513 dprintk((KERN_DEBUG"aacraid: too many sg entries %d\n",
514 le32_to_cpu(srbcmd->sg.count)));
515 rcode = -EINVAL;
516 goto cleanup;
517 }
485 if (dev->dac_support == 1) { 518 if (dev->dac_support == 1) {
486 struct sgmap64* psg = (struct sgmap64*)&srbcmd->sg; 519 struct user_sgmap64* upsg = (struct user_sgmap64*)&user_srbcmd->sg;
520 struct sgmap64* psg = (struct sgmap64*)&user_srbcmd->sg;
521 struct user_sgmap* usg;
487 byte_count = 0; 522 byte_count = 0;
488 523
489 /* 524 /*
490 * This should also catch if user used the 32 bit sgmap 525 * This should also catch if user used the 32 bit sgmap
491 */ 526 */
492 actual_fibsize = sizeof(struct aac_srb) - 527 actual_fibsize = sizeof(struct aac_srb) -
493 sizeof(struct sgentry) + ((srbcmd->sg.count & 0xff) * 528 sizeof(struct sgentry) +
494 sizeof(struct sgentry64)); 529 ((upsg->count & 0xff) *
530 sizeof(struct sgentry));
495 if(actual_fibsize != fibsize){ // User made a mistake - should not continue 531 if(actual_fibsize != fibsize){ // User made a mistake - should not continue
496 printk(KERN_DEBUG"aacraid: Bad Size specified in Raw SRB command\n"); 532 dprintk((KERN_DEBUG"aacraid: Bad Size specified in Raw SRB command\n"));
497 rcode = -EINVAL; 533 rcode = -EINVAL;
498 goto cleanup; 534 goto cleanup;
499 } 535 }
500 if ((data_dir == DMA_NONE) && psg->count) { 536 usg = kmalloc(actual_fibsize - sizeof(struct aac_srb)
501 printk(KERN_DEBUG"aacraid: SG with no direction specified in Raw SRB command\n"); 537 + sizeof(struct sgmap), GFP_KERNEL);
538 if (!usg) {
539 dprintk((KERN_DEBUG"aacraid: Allocation error in Raw SRB command\n"));
540 rcode = -ENOMEM;
541 goto cleanup;
542 }
543 memcpy (usg, upsg, actual_fibsize - sizeof(struct aac_srb)
544 + sizeof(struct sgmap));
545 actual_fibsize = sizeof(struct aac_srb) -
546 sizeof(struct sgentry) + ((usg->count & 0xff) *
547 sizeof(struct sgentry64));
548 if ((data_dir == DMA_NONE) && upsg->count) {
549 kfree (usg);
550 dprintk((KERN_DEBUG"aacraid: SG with no direction specified in Raw SRB command\n"));
502 rcode = -EINVAL; 551 rcode = -EINVAL;
503 goto cleanup; 552 goto cleanup;
504 } 553 }
505 554
506 for (i = 0; i < psg->count; i++) { 555 for (i = 0; i < usg->count; i++) {
507 dma_addr_t addr; 556 u64 addr;
508 u64 le_addr;
509 void* p; 557 void* p;
510 p = kmalloc(psg->sg[i].count,GFP_KERNEL|__GFP_DMA); 558 /* Does this really need to be GFP_DMA? */
559 p = kmalloc(usg->sg[i].count,GFP_KERNEL|__GFP_DMA);
511 if(p == 0) { 560 if(p == 0) {
512 printk(KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n", 561 kfree (usg);
513 psg->sg[i].count,i,psg->count); 562 dprintk((KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n",
563 usg->sg[i].count,i,usg->count));
514 rcode = -ENOMEM; 564 rcode = -ENOMEM;
515 goto cleanup; 565 goto cleanup;
516 } 566 }
517 sg_user[i] = (void __user *)psg->sg[i].addr; 567 sg_user[i] = (void __user *)usg->sg[i].addr;
518 sg_list[i] = p; // save so we can clean up later 568 sg_list[i] = p; // save so we can clean up later
519 sg_indx = i; 569 sg_indx = i;
520 570
521 if( flags & SRB_DataOut ){ 571 if( flags & SRB_DataOut ){
522 if(copy_from_user(p,sg_user[i],psg->sg[i].count)){ 572 if(copy_from_user(p,sg_user[i],upsg->sg[i].count)){
523 printk(KERN_DEBUG"aacraid: Could not copy sg data from user\n"); 573 kfree (usg);
574 dprintk((KERN_DEBUG"aacraid: Could not copy sg data from user\n"));
524 rcode = -EFAULT; 575 rcode = -EFAULT;
525 goto cleanup; 576 goto cleanup;
526 } 577 }
527 } 578 }
528 addr = pci_map_single(dev->pdev, p, psg->sg[i].count, data_dir); 579 addr = pci_map_single(dev->pdev, p, usg->sg[i].count, data_dir);
529 580
530 le_addr = cpu_to_le64(addr); 581 psg->sg[i].addr[0] = cpu_to_le32(addr & 0xffffffff);
531 psg->sg[i].addr[1] = (u32)(le_addr>>32); 582 psg->sg[i].addr[1] = cpu_to_le32(addr>>32);
532 psg->sg[i].addr[0] = (u32)(le_addr & 0xffffffff); 583 psg->sg[i].count = cpu_to_le32(usg->sg[i].count);
533 psg->sg[i].count = cpu_to_le32(psg->sg[i].count); 584 byte_count += usg->sg[i].count;
534 byte_count += psg->sg[i].count;
535 } 585 }
586 kfree (usg);
536 587
537 srbcmd->count = cpu_to_le32(byte_count); 588 srbcmd->count = cpu_to_le32(byte_count);
589 psg->count = cpu_to_le32(sg_indx+1);
538 status = fib_send(ScsiPortCommand64, srbfib, actual_fibsize, FsaNormal, 1, 1,NULL,NULL); 590 status = fib_send(ScsiPortCommand64, srbfib, actual_fibsize, FsaNormal, 1, 1,NULL,NULL);
539 } else { 591 } else {
592 struct user_sgmap* upsg = &user_srbcmd->sg;
540 struct sgmap* psg = &srbcmd->sg; 593 struct sgmap* psg = &srbcmd->sg;
541 byte_count = 0; 594 byte_count = 0;
542 595
543 actual_fibsize = sizeof (struct aac_srb) + 596 actual_fibsize = sizeof (struct aac_srb) + (((user_srbcmd->sg.count & 0xff) - 1) * sizeof (struct sgentry));
544 (((le32_to_cpu(srbcmd->sg.count) & 0xff) - 1) *
545 sizeof (struct sgentry));
546 if(actual_fibsize != fibsize){ // User made a mistake - should not continue 597 if(actual_fibsize != fibsize){ // User made a mistake - should not continue
547 printk(KERN_DEBUG"aacraid: Bad Size specified in Raw SRB command\n"); 598 dprintk((KERN_DEBUG"aacraid: Bad Size specified in Raw SRB command\n"));
548 rcode = -EINVAL; 599 rcode = -EINVAL;
549 goto cleanup; 600 goto cleanup;
550 } 601 }
551 if ((data_dir == DMA_NONE) && psg->count) { 602 if ((data_dir == DMA_NONE) && upsg->count) {
552 printk(KERN_DEBUG"aacraid: SG with no direction specified in Raw SRB command\n"); 603 dprintk((KERN_DEBUG"aacraid: SG with no direction specified in Raw SRB command\n"));
553 rcode = -EINVAL; 604 rcode = -EINVAL;
554 goto cleanup; 605 goto cleanup;
555 } 606 }
556 for (i = 0; i < psg->count; i++) { 607 for (i = 0; i < upsg->count; i++) {
557 dma_addr_t addr; 608 dma_addr_t addr;
558 void* p; 609 void* p;
559 p = kmalloc(psg->sg[i].count,GFP_KERNEL); 610 p = kmalloc(upsg->sg[i].count, GFP_KERNEL);
560 if(p == 0) { 611 if(p == 0) {
561 printk(KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n", 612 dprintk((KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n",
562 psg->sg[i].count,i,psg->count); 613 upsg->sg[i].count, i, upsg->count));
563 rcode = -ENOMEM; 614 rcode = -ENOMEM;
564 goto cleanup; 615 goto cleanup;
565 } 616 }
566 sg_user[i] = (void __user *)(psg->sg[i].addr); 617 sg_user[i] = (void __user *)upsg->sg[i].addr;
567 sg_list[i] = p; // save so we can clean up later 618 sg_list[i] = p; // save so we can clean up later
568 sg_indx = i; 619 sg_indx = i;
569 620
570 if( flags & SRB_DataOut ){ 621 if( flags & SRB_DataOut ){
571 if(copy_from_user(p,sg_user[i],psg->sg[i].count)){ 622 if(copy_from_user(p, sg_user[i],
572 printk(KERN_DEBUG"aacraid: Could not copy sg data from user\n"); 623 upsg->sg[i].count)) {
624 dprintk((KERN_DEBUG"aacraid: Could not copy sg data from user\n"));
573 rcode = -EFAULT; 625 rcode = -EFAULT;
574 goto cleanup; 626 goto cleanup;
575 } 627 }
576 } 628 }
577 addr = pci_map_single(dev->pdev, p, psg->sg[i].count, data_dir); 629 addr = pci_map_single(dev->pdev, p,
630 upsg->sg[i].count, data_dir);
578 631
579 psg->sg[i].addr = cpu_to_le32(addr); 632 psg->sg[i].addr = cpu_to_le32(addr);
580 psg->sg[i].count = cpu_to_le32(psg->sg[i].count); 633 psg->sg[i].count = cpu_to_le32(upsg->sg[i].count);
581 byte_count += psg->sg[i].count; 634 byte_count += upsg->sg[i].count;
582 } 635 }
583 srbcmd->count = cpu_to_le32(byte_count); 636 srbcmd->count = cpu_to_le32(byte_count);
637 psg->count = cpu_to_le32(sg_indx+1);
584 status = fib_send(ScsiPortCommand, srbfib, actual_fibsize, FsaNormal, 1, 1, NULL, NULL); 638 status = fib_send(ScsiPortCommand, srbfib, actual_fibsize, FsaNormal, 1, 1, NULL, NULL);
585 } 639 }
586 640
587 if (status != 0){ 641 if (status != 0){
588 printk(KERN_DEBUG"aacraid: Could not send raw srb fib to hba\n"); 642 dprintk((KERN_DEBUG"aacraid: Could not send raw srb fib to hba\n"));
589 rcode = -1; 643 rcode = -ENXIO;
590 goto cleanup; 644 goto cleanup;
591 } 645 }
592 646
593 if( flags & SRB_DataIn ) { 647 if( flags & SRB_DataIn ) {
594 for(i = 0 ; i <= sg_indx; i++){ 648 for(i = 0 ; i <= sg_indx; i++){
595 if(copy_to_user(sg_user[i],sg_list[i],le32_to_cpu(srbcmd->sg.sg[i].count))){ 649 byte_count = le32_to_cpu((dev->dac_support == 1)
596 printk(KERN_DEBUG"aacraid: Could not copy sg data to user\n"); 650 ? ((struct sgmap64*)&srbcmd->sg)->sg[i].count
651 : srbcmd->sg.sg[i].count);
652 if(copy_to_user(sg_user[i], sg_list[i], byte_count)){
653 dprintk((KERN_DEBUG"aacraid: Could not copy sg data to user\n"));
597 rcode = -EFAULT; 654 rcode = -EFAULT;
598 goto cleanup; 655 goto cleanup;
599 656
@@ -603,12 +660,13 @@ int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
603 660
604 reply = (struct aac_srb_reply *) fib_data(srbfib); 661 reply = (struct aac_srb_reply *) fib_data(srbfib);
605 if(copy_to_user(user_reply,reply,sizeof(struct aac_srb_reply))){ 662 if(copy_to_user(user_reply,reply,sizeof(struct aac_srb_reply))){
606 printk(KERN_DEBUG"aacraid: Could not copy reply to user\n"); 663 dprintk((KERN_DEBUG"aacraid: Could not copy reply to user\n"));
607 rcode = -EFAULT; 664 rcode = -EFAULT;
608 goto cleanup; 665 goto cleanup;
609 } 666 }
610 667
611cleanup: 668cleanup:
669 kfree(user_srbcmd);
612 for(i=0; i <= sg_indx; i++){ 670 for(i=0; i <= sg_indx; i++){
613 kfree(sg_list[i]); 671 kfree(sg_list[i]);
614 } 672 }
@@ -618,14 +676,13 @@ cleanup:
618 return rcode; 676 return rcode;
619} 677}
620 678
621
622struct aac_pci_info { 679struct aac_pci_info {
623 u32 bus; 680 u32 bus;
624 u32 slot; 681 u32 slot;
625}; 682};
626 683
627 684
628int aac_get_pci_info(struct aac_dev* dev, void __user *arg) 685static int aac_get_pci_info(struct aac_dev* dev, void __user *arg)
629{ 686{
630 struct aac_pci_info pci_info; 687 struct aac_pci_info pci_info;
631 688
@@ -633,11 +690,11 @@ int aac_get_pci_info(struct aac_dev* dev, void __user *arg)
633 pci_info.slot = PCI_SLOT(dev->pdev->devfn); 690 pci_info.slot = PCI_SLOT(dev->pdev->devfn);
634 691
635 if (copy_to_user(arg, &pci_info, sizeof(struct aac_pci_info))) { 692 if (copy_to_user(arg, &pci_info, sizeof(struct aac_pci_info))) {
636 printk(KERN_DEBUG "aacraid: Could not copy pci info\n"); 693 dprintk((KERN_DEBUG "aacraid: Could not copy pci info\n"));
637 return -EFAULT; 694 return -EFAULT;
638 } 695 }
639 return 0; 696 return 0;
640 } 697}
641 698
642 699
643int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg) 700int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg)
@@ -656,6 +713,7 @@ int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg)
656 case FSACTL_MINIPORT_REV_CHECK: 713 case FSACTL_MINIPORT_REV_CHECK:
657 status = check_revision(dev, arg); 714 status = check_revision(dev, arg);
658 break; 715 break;
716 case FSACTL_SEND_LARGE_FIB:
659 case FSACTL_SENDFIB: 717 case FSACTL_SENDFIB:
660 status = ioctl_send_fib(dev, arg); 718 status = ioctl_send_fib(dev, arg);
661 break; 719 break;
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index 6832a55ca907..43557bf661f6 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -39,6 +39,7 @@
39#include <linux/blkdev.h> 39#include <linux/blkdev.h>
40#include <linux/completion.h> 40#include <linux/completion.h>
41#include <linux/mm.h> 41#include <linux/mm.h>
42#include <scsi/scsi_host.h>
42#include <asm/semaphore.h> 43#include <asm/semaphore.h>
43 44
44#include "aacraid.h" 45#include "aacraid.h"
@@ -49,8 +50,8 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
49{ 50{
50 unsigned char *base; 51 unsigned char *base;
51 unsigned long size, align; 52 unsigned long size, align;
52 unsigned long fibsize = 4096; 53 const unsigned long fibsize = 4096;
53 unsigned long printfbufsiz = 256; 54 const unsigned long printfbufsiz = 256;
54 struct aac_init *init; 55 struct aac_init *init;
55 dma_addr_t phys; 56 dma_addr_t phys;
56 57
@@ -74,6 +75,8 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
74 init = dev->init; 75 init = dev->init;
75 76
76 init->InitStructRevision = cpu_to_le32(ADAPTER_INIT_STRUCT_REVISION); 77 init->InitStructRevision = cpu_to_le32(ADAPTER_INIT_STRUCT_REVISION);
78 if (dev->max_fib_size != sizeof(struct hw_fib))
79 init->InitStructRevision = cpu_to_le32(ADAPTER_INIT_STRUCT_REVISION_4);
77 init->MiniPortRevision = cpu_to_le32(Sa_MINIPORT_REVISION); 80 init->MiniPortRevision = cpu_to_le32(Sa_MINIPORT_REVISION);
78 init->fsrev = cpu_to_le32(dev->fsrev); 81 init->fsrev = cpu_to_le32(dev->fsrev);
79 82
@@ -110,6 +113,10 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
110 init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES); 113 init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES);
111 } 114 }
112 115
116 init->InitFlags = 0;
117 init->MaxIoCommands = cpu_to_le32(dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB);
118 init->MaxIoSize = cpu_to_le32(dev->scsi_host_ptr->max_sectors << 9);
119 init->MaxFibSize = cpu_to_le32(dev->max_fib_size);
113 120
114 /* 121 /*
115 * Increment the base address by the amount already used 122 * Increment the base address by the amount already used
@@ -152,8 +159,8 @@ static void aac_queue_init(struct aac_dev * dev, struct aac_queue * q, u32 *mem,
152 init_waitqueue_head(&q->qfull); 159 init_waitqueue_head(&q->qfull);
153 spin_lock_init(&q->lockdata); 160 spin_lock_init(&q->lockdata);
154 q->lock = &q->lockdata; 161 q->lock = &q->lockdata;
155 q->headers.producer = mem; 162 q->headers.producer = (__le32 *)mem;
156 q->headers.consumer = mem+1; 163 q->headers.consumer = (__le32 *)(mem+1);
157 *(q->headers.producer) = cpu_to_le32(qsize); 164 *(q->headers.producer) = cpu_to_le32(qsize);
158 *(q->headers.consumer) = cpu_to_le32(qsize); 165 *(q->headers.consumer) = cpu_to_le32(qsize);
159 q->entries = qsize; 166 q->entries = qsize;
@@ -173,6 +180,8 @@ int aac_send_shutdown(struct aac_dev * dev)
173 int status; 180 int status;
174 181
175 fibctx = fib_alloc(dev); 182 fibctx = fib_alloc(dev);
183 if (!fibctx)
184 return -ENOMEM;
176 fib_init(fibctx); 185 fib_init(fibctx);
177 186
178 cmd = (struct aac_close *) fib_data(fibctx); 187 cmd = (struct aac_close *) fib_data(fibctx);
@@ -204,7 +213,7 @@ int aac_send_shutdown(struct aac_dev * dev)
204 * 0 - If there were errors initing. This is a fatal error. 213 * 0 - If there were errors initing. This is a fatal error.
205 */ 214 */
206 215
207int aac_comm_init(struct aac_dev * dev) 216static int aac_comm_init(struct aac_dev * dev)
208{ 217{
209 unsigned long hdrsize = (sizeof(u32) * NUMBER_OF_COMM_QUEUES) * 2; 218 unsigned long hdrsize = (sizeof(u32) * NUMBER_OF_COMM_QUEUES) * 2;
210 unsigned long queuesize = sizeof(struct aac_entry) * TOTAL_QUEUE_ENTRIES; 219 unsigned long queuesize = sizeof(struct aac_entry) * TOTAL_QUEUE_ENTRIES;
@@ -293,6 +302,79 @@ int aac_comm_init(struct aac_dev * dev)
293 302
294struct aac_dev *aac_init_adapter(struct aac_dev *dev) 303struct aac_dev *aac_init_adapter(struct aac_dev *dev)
295{ 304{
305 u32 status[5];
306 struct Scsi_Host * host = dev->scsi_host_ptr;
307
308 /*
309 * Check the preferred comm settings, defaults from template.
310 */
311 dev->max_fib_size = sizeof(struct hw_fib);
312 dev->sg_tablesize = host->sg_tablesize = (dev->max_fib_size
313 - sizeof(struct aac_fibhdr)
314 - sizeof(struct aac_write) + sizeof(struct sgmap))
315 / sizeof(struct sgmap);
316 if ((!aac_adapter_sync_cmd(dev, GET_COMM_PREFERRED_SETTINGS,
317 0, 0, 0, 0, 0, 0,
318 status+0, status+1, status+2, status+3, status+4))
319 && (status[0] == 0x00000001)) {
320 /*
321 * status[1] >> 16 maximum command size in KB
322 * status[1] & 0xFFFF maximum FIB size
323 * status[2] >> 16 maximum SG elements to driver
324 * status[2] & 0xFFFF maximum SG elements from driver
325 * status[3] & 0xFFFF maximum number FIBs outstanding
326 */
327 host->max_sectors = (status[1] >> 16) << 1;
328 dev->max_fib_size = status[1] & 0xFFFF;
329 host->sg_tablesize = status[2] >> 16;
330 dev->sg_tablesize = status[2] & 0xFFFF;
331 host->can_queue = (status[3] & 0xFFFF) - AAC_NUM_MGT_FIB;
332 /*
333 * NOTE:
334 * All these overrides are based on a fixed internal
335 * knowledge and understanding of existing adapters,
336 * acbsize should be set with caution.
337 */
338 if (acbsize == 512) {
339 host->max_sectors = AAC_MAX_32BIT_SGBCOUNT;
340 dev->max_fib_size = 512;
341 dev->sg_tablesize = host->sg_tablesize
342 = (512 - sizeof(struct aac_fibhdr)
343 - sizeof(struct aac_write) + sizeof(struct sgmap))
344 / sizeof(struct sgmap);
345 host->can_queue = AAC_NUM_IO_FIB;
346 } else if (acbsize == 2048) {
347 host->max_sectors = 512;
348 dev->max_fib_size = 2048;
349 host->sg_tablesize = 65;
350 dev->sg_tablesize = 81;
351 host->can_queue = 512 - AAC_NUM_MGT_FIB;
352 } else if (acbsize == 4096) {
353 host->max_sectors = 1024;
354 dev->max_fib_size = 4096;
355 host->sg_tablesize = 129;
356 dev->sg_tablesize = 166;
357 host->can_queue = 256 - AAC_NUM_MGT_FIB;
358 } else if (acbsize == 8192) {
359 host->max_sectors = 2048;
360 dev->max_fib_size = 8192;
361 host->sg_tablesize = 257;
362 dev->sg_tablesize = 337;
363 host->can_queue = 128 - AAC_NUM_MGT_FIB;
364 } else if (acbsize > 0) {
365 printk("Illegal acbsize=%d ignored\n", acbsize);
366 }
367 }
368 {
369
370 if (numacb > 0) {
371 if (numacb < host->can_queue)
372 host->can_queue = numacb;
373 else
374 printk("numacb=%d ignored\n", numacb);
375 }
376 }
377
296 /* 378 /*
297 * Ok now init the communication subsystem 379 * Ok now init the communication subsystem
298 */ 380 */
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 3f36dbaa2bb3..5322865942e2 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -25,7 +25,7 @@
25 * commsup.c 25 * commsup.c
26 * 26 *
27 * Abstract: Contain all routines that are required for FSA host/adapter 27 * Abstract: Contain all routines that are required for FSA host/adapter
28 * commuication. 28 * communication.
29 * 29 *
30 */ 30 */
31 31
@@ -38,6 +38,7 @@
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/completion.h> 39#include <linux/completion.h>
40#include <linux/blkdev.h> 40#include <linux/blkdev.h>
41#include <scsi/scsi_host.h>
41#include <asm/semaphore.h> 42#include <asm/semaphore.h>
42 43
43#include "aacraid.h" 44#include "aacraid.h"
@@ -52,7 +53,13 @@
52 53
53static int fib_map_alloc(struct aac_dev *dev) 54static int fib_map_alloc(struct aac_dev *dev)
54{ 55{
55 if((dev->hw_fib_va = pci_alloc_consistent(dev->pdev, sizeof(struct hw_fib) * AAC_NUM_FIB, &dev->hw_fib_pa))==NULL) 56 dprintk((KERN_INFO
57 "allocate hardware fibs pci_alloc_consistent(%p, %d * (%d + %d), %p)\n",
58 dev->pdev, dev->max_fib_size, dev->scsi_host_ptr->can_queue,
59 AAC_NUM_MGT_FIB, &dev->hw_fib_pa));
60 if((dev->hw_fib_va = pci_alloc_consistent(dev->pdev, dev->max_fib_size
61 * (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB),
62 &dev->hw_fib_pa))==NULL)
56 return -ENOMEM; 63 return -ENOMEM;
57 return 0; 64 return 0;
58} 65}
@@ -67,7 +74,7 @@ static int fib_map_alloc(struct aac_dev *dev)
67 74
68void fib_map_free(struct aac_dev *dev) 75void fib_map_free(struct aac_dev *dev)
69{ 76{
70 pci_free_consistent(dev->pdev, sizeof(struct hw_fib) * AAC_NUM_FIB, dev->hw_fib_va, dev->hw_fib_pa); 77 pci_free_consistent(dev->pdev, dev->max_fib_size * (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB), dev->hw_fib_va, dev->hw_fib_pa);
71} 78}
72 79
73/** 80/**
@@ -84,17 +91,22 @@ int fib_setup(struct aac_dev * dev)
84 struct hw_fib *hw_fib_va; 91 struct hw_fib *hw_fib_va;
85 dma_addr_t hw_fib_pa; 92 dma_addr_t hw_fib_pa;
86 int i; 93 int i;
87 94
88 if(fib_map_alloc(dev)<0) 95 while (((i = fib_map_alloc(dev)) == -ENOMEM)
96 && (dev->scsi_host_ptr->can_queue > (64 - AAC_NUM_MGT_FIB))) {
97 dev->init->MaxIoCommands = cpu_to_le32((dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB) >> 1);
98 dev->scsi_host_ptr->can_queue = le32_to_cpu(dev->init->MaxIoCommands) - AAC_NUM_MGT_FIB;
99 }
100 if (i<0)
89 return -ENOMEM; 101 return -ENOMEM;
90 102
91 hw_fib_va = dev->hw_fib_va; 103 hw_fib_va = dev->hw_fib_va;
92 hw_fib_pa = dev->hw_fib_pa; 104 hw_fib_pa = dev->hw_fib_pa;
93 memset(hw_fib_va, 0, sizeof(struct hw_fib) * AAC_NUM_FIB); 105 memset(hw_fib_va, 0, dev->max_fib_size * (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB));
94 /* 106 /*
95 * Initialise the fibs 107 * Initialise the fibs
96 */ 108 */
97 for (i = 0, fibptr = &dev->fibs[i]; i < AAC_NUM_FIB; i++, fibptr++) 109 for (i = 0, fibptr = &dev->fibs[i]; i < (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); i++, fibptr++)
98 { 110 {
99 fibptr->dev = dev; 111 fibptr->dev = dev;
100 fibptr->hw_fib = hw_fib_va; 112 fibptr->hw_fib = hw_fib_va;
@@ -102,16 +114,16 @@ int fib_setup(struct aac_dev * dev)
102 fibptr->next = fibptr+1; /* Forward chain the fibs */ 114 fibptr->next = fibptr+1; /* Forward chain the fibs */
103 init_MUTEX_LOCKED(&fibptr->event_wait); 115 init_MUTEX_LOCKED(&fibptr->event_wait);
104 spin_lock_init(&fibptr->event_lock); 116 spin_lock_init(&fibptr->event_lock);
105 hw_fib_va->header.XferState = 0xffffffff; 117 hw_fib_va->header.XferState = cpu_to_le32(0xffffffff);
106 hw_fib_va->header.SenderSize = cpu_to_le16(sizeof(struct hw_fib)); 118 hw_fib_va->header.SenderSize = cpu_to_le16(dev->max_fib_size);
107 fibptr->hw_fib_pa = hw_fib_pa; 119 fibptr->hw_fib_pa = hw_fib_pa;
108 hw_fib_va = (struct hw_fib *)((unsigned char *)hw_fib_va + sizeof(struct hw_fib)); 120 hw_fib_va = (struct hw_fib *)((unsigned char *)hw_fib_va + dev->max_fib_size);
109 hw_fib_pa = hw_fib_pa + sizeof(struct hw_fib); 121 hw_fib_pa = hw_fib_pa + dev->max_fib_size;
110 } 122 }
111 /* 123 /*
112 * Add the fib chain to the free list 124 * Add the fib chain to the free list
113 */ 125 */
114 dev->fibs[AAC_NUM_FIB-1].next = NULL; 126 dev->fibs[dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB - 1].next = NULL;
115 /* 127 /*
116 * Enable this to debug out of queue space 128 * Enable this to debug out of queue space
117 */ 129 */
@@ -124,7 +136,7 @@ int fib_setup(struct aac_dev * dev)
124 * @dev: Adapter to allocate the fib for 136 * @dev: Adapter to allocate the fib for
125 * 137 *
126 * Allocate a fib from the adapter fib pool. If the pool is empty we 138 * Allocate a fib from the adapter fib pool. If the pool is empty we
127 * wait for fibs to become free. 139 * return NULL.
128 */ 140 */
129 141
130struct fib * fib_alloc(struct aac_dev *dev) 142struct fib * fib_alloc(struct aac_dev *dev)
@@ -133,10 +145,10 @@ struct fib * fib_alloc(struct aac_dev *dev)
133 unsigned long flags; 145 unsigned long flags;
134 spin_lock_irqsave(&dev->fib_lock, flags); 146 spin_lock_irqsave(&dev->fib_lock, flags);
135 fibptr = dev->free_fib; 147 fibptr = dev->free_fib;
136 /* Cannot sleep here or you get hangs. Instead we did the 148 if(!fibptr){
137 maths at compile time. */ 149 spin_unlock_irqrestore(&dev->fib_lock, flags);
138 if(!fibptr) 150 return fibptr;
139 BUG(); 151 }
140 dev->free_fib = fibptr->next; 152 dev->free_fib = fibptr->next;
141 spin_unlock_irqrestore(&dev->fib_lock, flags); 153 spin_unlock_irqrestore(&dev->fib_lock, flags);
142 /* 154 /*
@@ -196,11 +208,11 @@ void fib_init(struct fib *fibptr)
196 struct hw_fib *hw_fib = fibptr->hw_fib; 208 struct hw_fib *hw_fib = fibptr->hw_fib;
197 209
198 hw_fib->header.StructType = FIB_MAGIC; 210 hw_fib->header.StructType = FIB_MAGIC;
199 hw_fib->header.Size = cpu_to_le16(sizeof(struct hw_fib)); 211 hw_fib->header.Size = cpu_to_le16(fibptr->dev->max_fib_size);
200 hw_fib->header.XferState = cpu_to_le32(HostOwned | FibInitialized | FibEmpty | FastResponseCapable); 212 hw_fib->header.XferState = cpu_to_le32(HostOwned | FibInitialized | FibEmpty | FastResponseCapable);
201 hw_fib->header.SenderFibAddress = cpu_to_le32(fibptr->hw_fib_pa); 213 hw_fib->header.SenderFibAddress = cpu_to_le32(fibptr->hw_fib_pa);
202 hw_fib->header.ReceiverFibAddress = cpu_to_le32(fibptr->hw_fib_pa); 214 hw_fib->header.ReceiverFibAddress = cpu_to_le32(fibptr->hw_fib_pa);
203 hw_fib->header.SenderSize = cpu_to_le16(sizeof(struct hw_fib)); 215 hw_fib->header.SenderSize = cpu_to_le16(fibptr->dev->max_fib_size);
204} 216}
205 217
206/** 218/**
@@ -211,7 +223,7 @@ void fib_init(struct fib *fibptr)
211 * caller. 223 * caller.
212 */ 224 */
213 225
214void fib_dealloc(struct fib * fibptr) 226static void fib_dealloc(struct fib * fibptr)
215{ 227{
216 struct hw_fib *hw_fib = fibptr->hw_fib; 228 struct hw_fib *hw_fib = fibptr->hw_fib;
217 if(hw_fib->header.StructType != FIB_MAGIC) 229 if(hw_fib->header.StructType != FIB_MAGIC)
@@ -279,7 +291,7 @@ static int aac_get_entry (struct aac_dev * dev, u32 qid, struct aac_entry **entr
279 } 291 }
280 292
281 if ((*index + 1) == le32_to_cpu(*(q->headers.consumer))) { /* Queue is full */ 293 if ((*index + 1) == le32_to_cpu(*(q->headers.consumer))) { /* Queue is full */
282 printk(KERN_WARNING "Queue %d full, %d outstanding.\n", 294 printk(KERN_WARNING "Queue %d full, %u outstanding.\n",
283 qid, q->numpending); 295 qid, q->numpending);
284 return 0; 296 return 0;
285 } else { 297 } else {
@@ -658,9 +670,8 @@ int fib_adapter_complete(struct fib * fibptr, unsigned short size)
658 } 670 }
659 if (aac_insert_entry(dev, index, AdapHighRespQueue, (nointr & (int)aac_config.irq_mod)) != 0) { 671 if (aac_insert_entry(dev, index, AdapHighRespQueue, (nointr & (int)aac_config.irq_mod)) != 0) {
660 } 672 }
661 } 673 } else if (hw_fib->header.XferState &
662 else if (hw_fib->header.XferState & NormalPriority) 674 cpu_to_le32(NormalPriority)) {
663 {
664 u32 index; 675 u32 index;
665 676
666 if (size) { 677 if (size) {
@@ -744,22 +755,25 @@ int fib_complete(struct fib * fibptr)
744 755
745void aac_printf(struct aac_dev *dev, u32 val) 756void aac_printf(struct aac_dev *dev, u32 val)
746{ 757{
747 int length = val & 0xffff;
748 int level = (val >> 16) & 0xffff;
749 char *cp = dev->printfbuf; 758 char *cp = dev->printfbuf;
750 759 if (dev->printf_enabled)
751 /* 760 {
752 * The size of the printfbuf is set in port.c 761 int length = val & 0xffff;
753 * There is no variable or define for it 762 int level = (val >> 16) & 0xffff;
754 */ 763
755 if (length > 255) 764 /*
756 length = 255; 765 * The size of the printfbuf is set in port.c
757 if (cp[length] != 0) 766 * There is no variable or define for it
758 cp[length] = 0; 767 */
759 if (level == LOG_AAC_HIGH_ERROR) 768 if (length > 255)
760 printk(KERN_WARNING "aacraid:%s", cp); 769 length = 255;
761 else 770 if (cp[length] != 0)
762 printk(KERN_INFO "aacraid:%s", cp); 771 cp[length] = 0;
772 if (level == LOG_AAC_HIGH_ERROR)
773 printk(KERN_WARNING "aacraid:%s", cp);
774 else
775 printk(KERN_INFO "aacraid:%s", cp);
776 }
763 memset(cp, 0, 256); 777 memset(cp, 0, 256);
764} 778}
765 779
@@ -832,8 +846,8 @@ int aac_command_thread(struct aac_dev * dev)
832 aifcmd = (struct aac_aifcmd *) hw_fib->data; 846 aifcmd = (struct aac_aifcmd *) hw_fib->data;
833 if (aifcmd->command == cpu_to_le32(AifCmdDriverNotify)) { 847 if (aifcmd->command == cpu_to_le32(AifCmdDriverNotify)) {
834 /* Handle Driver Notify Events */ 848 /* Handle Driver Notify Events */
835 *(u32 *)hw_fib->data = cpu_to_le32(ST_OK); 849 *(__le32 *)hw_fib->data = cpu_to_le32(ST_OK);
836 fib_adapter_complete(fib, sizeof(u32)); 850 fib_adapter_complete(fib, (u16)sizeof(u32));
837 } else { 851 } else {
838 struct list_head *entry; 852 struct list_head *entry;
839 /* The u32 here is important and intended. We are using 853 /* The u32 here is important and intended. We are using
@@ -916,7 +930,7 @@ int aac_command_thread(struct aac_dev * dev)
916 /* 930 /*
917 * Set the status of this FIB 931 * Set the status of this FIB
918 */ 932 */
919 *(u32 *)hw_fib->data = cpu_to_le32(ST_OK); 933 *(__le32 *)hw_fib->data = cpu_to_le32(ST_OK);
920 fib_adapter_complete(fib, sizeof(u32)); 934 fib_adapter_complete(fib, sizeof(u32));
921 spin_unlock_irqrestore(&dev->fib_lock, flagv); 935 spin_unlock_irqrestore(&dev->fib_lock, flagv);
922 } 936 }
diff --git a/drivers/scsi/aacraid/dpcsup.c b/drivers/scsi/aacraid/dpcsup.c
index 8480b427a6d9..be2e98de9fab 100644
--- a/drivers/scsi/aacraid/dpcsup.c
+++ b/drivers/scsi/aacraid/dpcsup.c
@@ -99,7 +99,7 @@ unsigned int aac_response_normal(struct aac_queue * q)
99 /* 99 /*
100 * Doctor the fib 100 * Doctor the fib
101 */ 101 */
102 *(u32 *)hwfib->data = cpu_to_le32(ST_OK); 102 *(__le32 *)hwfib->data = cpu_to_le32(ST_OK);
103 hwfib->header.XferState |= cpu_to_le32(AdapterProcessed); 103 hwfib->header.XferState |= cpu_to_le32(AdapterProcessed);
104 } 104 }
105 105
@@ -107,7 +107,7 @@ unsigned int aac_response_normal(struct aac_queue * q)
107 107
108 if (hwfib->header.Command == cpu_to_le16(NuFileSystem)) 108 if (hwfib->header.Command == cpu_to_le16(NuFileSystem))
109 { 109 {
110 u32 *pstatus = (u32 *)hwfib->data; 110 __le32 *pstatus = (__le32 *)hwfib->data;
111 if (*pstatus & cpu_to_le32(0xffff0000)) 111 if (*pstatus & cpu_to_le32(0xffff0000))
112 *pstatus = cpu_to_le32(ST_OK); 112 *pstatus = cpu_to_le32(ST_OK);
113 } 113 }
@@ -205,7 +205,7 @@ unsigned int aac_command_normal(struct aac_queue *q)
205 /* 205 /*
206 * Set the status of this FIB 206 * Set the status of this FIB
207 */ 207 */
208 *(u32 *)hw_fib->data = cpu_to_le32(ST_OK); 208 *(__le32 *)hw_fib->data = cpu_to_le32(ST_OK);
209 fib_adapter_complete(fib, sizeof(u32)); 209 fib_adapter_complete(fib, sizeof(u32));
210 spin_lock_irqsave(q->lock, flags); 210 spin_lock_irqsave(q->lock, flags);
211 } 211 }
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 242fa77513f5..f7e9c89c4915 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -215,7 +215,7 @@ static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd
215 * Returns a static string describing the device in question 215 * Returns a static string describing the device in question
216 */ 216 */
217 217
218const char *aac_info(struct Scsi_Host *shost) 218static const char *aac_info(struct Scsi_Host *shost)
219{ 219{
220 struct aac_dev *dev = (struct aac_dev *)shost->hostdata; 220 struct aac_dev *dev = (struct aac_dev *)shost->hostdata;
221 return aac_drivers[dev->cardtype].name; 221 return aac_drivers[dev->cardtype].name;
@@ -288,7 +288,7 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev,
288 * translations ( 64/32, 128/32, 255/63 ). 288 * translations ( 64/32, 128/32, 255/63 ).
289 */ 289 */
290 buf = scsi_bios_ptable(bdev); 290 buf = scsi_bios_ptable(bdev);
291 if(*(unsigned short *)(buf + 0x40) == cpu_to_le16(0xaa55)) { 291 if(*(__le16 *)(buf + 0x40) == cpu_to_le16(0xaa55)) {
292 struct partition *first = (struct partition * )buf; 292 struct partition *first = (struct partition * )buf;
293 struct partition *entry = first; 293 struct partition *entry = first;
294 int saved_cylinders = param->cylinders; 294 int saved_cylinders = param->cylinders;
@@ -347,10 +347,16 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev,
347 347
348static int aac_slave_configure(struct scsi_device *sdev) 348static int aac_slave_configure(struct scsi_device *sdev)
349{ 349{
350 struct Scsi_Host *host = sdev->host;
351
350 if (sdev->tagged_supported) 352 if (sdev->tagged_supported)
351 scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, 128); 353 scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, 128);
352 else 354 else
353 scsi_adjust_queue_depth(sdev, 0, 1); 355 scsi_adjust_queue_depth(sdev, 0, 1);
356
357 if (host->max_sectors < AAC_MAX_32BIT_SGBCOUNT)
358 blk_queue_max_segment_size(sdev->request_queue, 65536);
359
354 return 0; 360 return 0;
355} 361}
356 362
@@ -361,14 +367,6 @@ static int aac_ioctl(struct scsi_device *sdev, int cmd, void __user * arg)
361} 367}
362 368
363/* 369/*
364 * XXX: does aac really need no error handling??
365 */
366static int aac_eh_abort(struct scsi_cmnd *cmd)
367{
368 return FAILED;
369}
370
371/*
372 * aac_eh_reset - Reset command handling 370 * aac_eh_reset - Reset command handling
373 * @scsi_cmd: SCSI command block causing the reset 371 * @scsi_cmd: SCSI command block causing the reset
374 * 372 *
@@ -386,10 +384,13 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)
386 AAC_DRIVERNAME); 384 AAC_DRIVERNAME);
387 385
388 386
387 spin_lock_irq(host->host_lock);
388
389 aac = (struct aac_dev *)host->hostdata; 389 aac = (struct aac_dev *)host->hostdata;
390 if (aac_adapter_check_health(aac)) { 390 if (aac_adapter_check_health(aac)) {
391 printk(KERN_ERR "%s: Host adapter appears dead\n", 391 printk(KERN_ERR "%s: Host adapter appears dead\n",
392 AAC_DRIVERNAME); 392 AAC_DRIVERNAME);
393 spin_unlock_irq(host->host_lock);
393 return -ENODEV; 394 return -ENODEV;
394 } 395 }
395 /* 396 /*
@@ -420,6 +421,7 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)
420 ssleep(1); 421 ssleep(1);
421 spin_lock_irq(host->host_lock); 422 spin_lock_irq(host->host_lock);
422 } 423 }
424 spin_unlock_irq(host->host_lock);
423 printk(KERN_ERR "%s: SCSI bus appears hung\n", AAC_DRIVERNAME); 425 printk(KERN_ERR "%s: SCSI bus appears hung\n", AAC_DRIVERNAME);
424 return -ETIMEDOUT; 426 return -ETIMEDOUT;
425} 427}
@@ -439,11 +441,11 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)
439static int aac_cfg_open(struct inode *inode, struct file *file) 441static int aac_cfg_open(struct inode *inode, struct file *file)
440{ 442{
441 struct aac_dev *aac; 443 struct aac_dev *aac;
442 unsigned minor = iminor(inode); 444 unsigned minor_number = iminor(inode);
443 int err = -ENODEV; 445 int err = -ENODEV;
444 446
445 list_for_each_entry(aac, &aac_devices, entry) { 447 list_for_each_entry(aac, &aac_devices, entry) {
446 if (aac->id == minor) { 448 if (aac->id == minor_number) {
447 file->private_data = aac; 449 file->private_data = aac;
448 err = 0; 450 err = 0;
449 break; 451 break;
@@ -489,6 +491,7 @@ static long aac_compat_do_ioctl(struct aac_dev *dev, unsigned cmd, unsigned long
489 case FSACTL_DELETE_DISK: 491 case FSACTL_DELETE_DISK:
490 case FSACTL_FORCE_DELETE_DISK: 492 case FSACTL_FORCE_DELETE_DISK:
491 case FSACTL_GET_CONTAINERS: 493 case FSACTL_GET_CONTAINERS:
494 case FSACTL_SEND_LARGE_FIB:
492 ret = aac_do_ioctl(dev, cmd, (void __user *)arg); 495 ret = aac_do_ioctl(dev, cmd, (void __user *)arg);
493 break; 496 break;
494 497
@@ -526,6 +529,134 @@ static long aac_compat_cfg_ioctl(struct file *file, unsigned cmd, unsigned long
526} 529}
527#endif 530#endif
528 531
532static ssize_t aac_show_model(struct class_device *class_dev,
533 char *buf)
534{
535 struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
536 int len;
537
538 len = snprintf(buf, PAGE_SIZE, "%s\n",
539 aac_drivers[dev->cardtype].model);
540 return len;
541}
542
543static ssize_t aac_show_vendor(struct class_device *class_dev,
544 char *buf)
545{
546 struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
547 int len;
548
549 len = snprintf(buf, PAGE_SIZE, "%s\n",
550 aac_drivers[dev->cardtype].vname);
551 return len;
552}
553
554static ssize_t aac_show_kernel_version(struct class_device *class_dev,
555 char *buf)
556{
557 struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
558 int len, tmp;
559
560 tmp = le32_to_cpu(dev->adapter_info.kernelrev);
561 len = snprintf(buf, PAGE_SIZE, "%d.%d-%d[%d]\n",
562 tmp >> 24, (tmp >> 16) & 0xff, tmp & 0xff,
563 le32_to_cpu(dev->adapter_info.kernelbuild));
564 return len;
565}
566
567static ssize_t aac_show_monitor_version(struct class_device *class_dev,
568 char *buf)
569{
570 struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
571 int len, tmp;
572
573 tmp = le32_to_cpu(dev->adapter_info.monitorrev);
574 len = snprintf(buf, PAGE_SIZE, "%d.%d-%d[%d]\n",
575 tmp >> 24, (tmp >> 16) & 0xff, tmp & 0xff,
576 le32_to_cpu(dev->adapter_info.monitorbuild));
577 return len;
578}
579
580static ssize_t aac_show_bios_version(struct class_device *class_dev,
581 char *buf)
582{
583 struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
584 int len, tmp;
585
586 tmp = le32_to_cpu(dev->adapter_info.biosrev);
587 len = snprintf(buf, PAGE_SIZE, "%d.%d-%d[%d]\n",
588 tmp >> 24, (tmp >> 16) & 0xff, tmp & 0xff,
589 le32_to_cpu(dev->adapter_info.biosbuild));
590 return len;
591}
592
593static ssize_t aac_show_serial_number(struct class_device *class_dev,
594 char *buf)
595{
596 struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
597 int len = 0;
598
599 if (le32_to_cpu(dev->adapter_info.serial[0]) != 0xBAD0)
600 len = snprintf(buf, PAGE_SIZE, "%x\n",
601 le32_to_cpu(dev->adapter_info.serial[0]));
602 return len;
603}
604
605
606static struct class_device_attribute aac_model = {
607 .attr = {
608 .name = "model",
609 .mode = S_IRUGO,
610 },
611 .show = aac_show_model,
612};
613static struct class_device_attribute aac_vendor = {
614 .attr = {
615 .name = "vendor",
616 .mode = S_IRUGO,
617 },
618 .show = aac_show_vendor,
619};
620static struct class_device_attribute aac_kernel_version = {
621 .attr = {
622 .name = "hba_kernel_version",
623 .mode = S_IRUGO,
624 },
625 .show = aac_show_kernel_version,
626};
627static struct class_device_attribute aac_monitor_version = {
628 .attr = {
629 .name = "hba_monitor_version",
630 .mode = S_IRUGO,
631 },
632 .show = aac_show_monitor_version,
633};
634static struct class_device_attribute aac_bios_version = {
635 .attr = {
636 .name = "hba_bios_version",
637 .mode = S_IRUGO,
638 },
639 .show = aac_show_bios_version,
640};
641static struct class_device_attribute aac_serial_number = {
642 .attr = {
643 .name = "serial_number",
644 .mode = S_IRUGO,
645 },
646 .show = aac_show_serial_number,
647};
648
649static struct class_device_attribute *aac_attrs[] = {
650 &aac_model,
651 &aac_vendor,
652 &aac_kernel_version,
653 &aac_monitor_version,
654 &aac_bios_version,
655 &aac_serial_number,
656 NULL
657};
658
659
529static struct file_operations aac_cfg_fops = { 660static struct file_operations aac_cfg_fops = {
530 .owner = THIS_MODULE, 661 .owner = THIS_MODULE,
531 .ioctl = aac_cfg_ioctl, 662 .ioctl = aac_cfg_ioctl,
@@ -538,7 +669,7 @@ static struct file_operations aac_cfg_fops = {
538static struct scsi_host_template aac_driver_template = { 669static struct scsi_host_template aac_driver_template = {
539 .module = THIS_MODULE, 670 .module = THIS_MODULE,
540 .name = "AAC", 671 .name = "AAC",
541 .proc_name = "aacraid", 672 .proc_name = AAC_DRIVERNAME,
542 .info = aac_info, 673 .info = aac_info,
543 .ioctl = aac_ioctl, 674 .ioctl = aac_ioctl,
544#ifdef CONFIG_COMPAT 675#ifdef CONFIG_COMPAT
@@ -546,8 +677,8 @@ static struct scsi_host_template aac_driver_template = {
546#endif 677#endif
547 .queuecommand = aac_queuecommand, 678 .queuecommand = aac_queuecommand,
548 .bios_param = aac_biosparm, 679 .bios_param = aac_biosparm,
680 .shost_attrs = aac_attrs,
549 .slave_configure = aac_slave_configure, 681 .slave_configure = aac_slave_configure,
550 .eh_abort_handler = aac_eh_abort,
551 .eh_host_reset_handler = aac_eh_reset, 682 .eh_host_reset_handler = aac_eh_reset,
552 .can_queue = AAC_NUM_IO_FIB, 683 .can_queue = AAC_NUM_IO_FIB,
553 .this_id = 16, 684 .this_id = 16,
@@ -612,7 +743,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
612 aac->cardtype = index; 743 aac->cardtype = index;
613 INIT_LIST_HEAD(&aac->entry); 744 INIT_LIST_HEAD(&aac->entry);
614 745
615 aac->fibs = kmalloc(sizeof(struct fib) * AAC_NUM_FIB, GFP_KERNEL); 746 aac->fibs = kmalloc(sizeof(struct fib) * (shost->can_queue + AAC_NUM_MGT_FIB), GFP_KERNEL);
616 if (!aac->fibs) 747 if (!aac->fibs)
617 goto out_free_host; 748 goto out_free_host;
618 spin_lock_init(&aac->fib_lock); 749 spin_lock_init(&aac->fib_lock);
@@ -632,6 +763,24 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
632 aac_get_adapter_info(aac); 763 aac_get_adapter_info(aac);
633 764
634 /* 765 /*
766 * Lets override negotiations and drop the maximum SG limit to 34
767 */
768 if ((aac_drivers[index].quirks & AAC_QUIRK_34SG) &&
769 (aac->scsi_host_ptr->sg_tablesize > 34)) {
770 aac->scsi_host_ptr->sg_tablesize = 34;
771 aac->scsi_host_ptr->max_sectors
772 = (aac->scsi_host_ptr->sg_tablesize * 8) + 112;
773 }
774
775 /*
776 * Firware printf works only with older firmware.
777 */
778 if (aac_drivers[index].quirks & AAC_QUIRK_34SG)
779 aac->printf_enabled = 1;
780 else
781 aac->printf_enabled = 0;
782
783 /*
635 * max channel will be the physical channels plus 1 virtual channel 784 * max channel will be the physical channels plus 1 virtual channel
636 * all containers are on the virtual channel 0 785 * all containers are on the virtual channel 0
637 * physical channels are address by their actual physical number+1 786 * physical channels are address by their actual physical number+1
diff --git a/drivers/scsi/aacraid/rkt.c b/drivers/scsi/aacraid/rkt.c
index 1b8ed47cfe30..7d68b7825137 100644
--- a/drivers/scsi/aacraid/rkt.c
+++ b/drivers/scsi/aacraid/rkt.c
@@ -98,7 +98,9 @@ static irqreturn_t aac_rkt_intr(int irq, void *dev_id, struct pt_regs *regs)
98 * for its completion. 98 * for its completion.
99 */ 99 */
100 100
101static int rkt_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *status) 101static int rkt_sync_cmd(struct aac_dev *dev, u32 command,
102 u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6,
103 u32 *status, u32 *r1, u32 *r2, u32 *r3, u32 *r4)
102{ 104{
103 unsigned long start; 105 unsigned long start;
104 int ok; 106 int ok;
@@ -107,12 +109,12 @@ static int rkt_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *status)
107 */ 109 */
108 rkt_writel(dev, InboundMailbox0, command); 110 rkt_writel(dev, InboundMailbox0, command);
109 /* 111 /*
110 * Write the parameters into Mailboxes 1 - 4 112 * Write the parameters into Mailboxes 1 - 6
111 */ 113 */
112 rkt_writel(dev, InboundMailbox1, p1); 114 rkt_writel(dev, InboundMailbox1, p1);
113 rkt_writel(dev, InboundMailbox2, 0); 115 rkt_writel(dev, InboundMailbox2, p2);
114 rkt_writel(dev, InboundMailbox3, 0); 116 rkt_writel(dev, InboundMailbox3, p3);
115 rkt_writel(dev, InboundMailbox4, 0); 117 rkt_writel(dev, InboundMailbox4, p4);
116 /* 118 /*
117 * Clear the synch command doorbell to start on a clean slate. 119 * Clear the synch command doorbell to start on a clean slate.
118 */ 120 */
@@ -169,6 +171,14 @@ static int rkt_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *status)
169 */ 171 */
170 if (status) 172 if (status)
171 *status = rkt_readl(dev, IndexRegs.Mailbox[0]); 173 *status = rkt_readl(dev, IndexRegs.Mailbox[0]);
174 if (r1)
175 *r1 = rkt_readl(dev, IndexRegs.Mailbox[1]);
176 if (r2)
177 *r2 = rkt_readl(dev, IndexRegs.Mailbox[2]);
178 if (r3)
179 *r3 = rkt_readl(dev, IndexRegs.Mailbox[3]);
180 if (r4)
181 *r4 = rkt_readl(dev, IndexRegs.Mailbox[4]);
172 /* 182 /*
173 * Clear the synch command doorbell. 183 * Clear the synch command doorbell.
174 */ 184 */
@@ -190,8 +200,8 @@ static int rkt_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *status)
190 200
191static void aac_rkt_interrupt_adapter(struct aac_dev *dev) 201static void aac_rkt_interrupt_adapter(struct aac_dev *dev)
192{ 202{
193 u32 ret; 203 rkt_sync_cmd(dev, BREAKPOINT_REQUEST, 0, 0, 0, 0, 0, 0,
194 rkt_sync_cmd(dev, BREAKPOINT_REQUEST, 0, &ret); 204 NULL, NULL, NULL, NULL, NULL);
195} 205}
196 206
197/** 207/**
@@ -220,7 +230,8 @@ static void aac_rkt_notify_adapter(struct aac_dev *dev, u32 event)
220 rkt_writel(dev, MUnit.IDR,INBOUNDDOORBELL_3); 230 rkt_writel(dev, MUnit.IDR,INBOUNDDOORBELL_3);
221 break; 231 break;
222 case HostShutdown: 232 case HostShutdown:
223// rkt_sync_cmd(dev, HOST_CRASHING, 0, 0, 0, 0, &ret); 233// rkt_sync_cmd(dev, HOST_CRASHING, 0, 0, 0, 0, 0, 0,
234// NULL, NULL, NULL, NULL, NULL);
224 break; 235 break;
225 case FastIo: 236 case FastIo:
226 rkt_writel(dev, MUnit.IDR,INBOUNDDOORBELL_6); 237 rkt_writel(dev, MUnit.IDR,INBOUNDDOORBELL_6);
@@ -243,17 +254,11 @@ static void aac_rkt_notify_adapter(struct aac_dev *dev, u32 event)
243 254
244static void aac_rkt_start_adapter(struct aac_dev *dev) 255static void aac_rkt_start_adapter(struct aac_dev *dev)
245{ 256{
246 u32 status;
247 struct aac_init *init; 257 struct aac_init *init;
248 258
249 init = dev->init; 259 init = dev->init;
250 init->HostElapsedSeconds = cpu_to_le32(get_seconds()); 260 init->HostElapsedSeconds = cpu_to_le32(get_seconds());
251 /* 261 /*
252 * Tell the adapter we are back and up and running so it will scan
253 * its command queues and enable our interrupts
254 */
255 dev->irq_mask = (DoorBellPrintfReady | OUTBOUNDDOORBELL_1 | OUTBOUNDDOORBELL_2 | OUTBOUNDDOORBELL_3 | OUTBOUNDDOORBELL_4);
256 /*
257 * First clear out all interrupts. Then enable the one's that we 262 * First clear out all interrupts. Then enable the one's that we
258 * can handle. 263 * can handle.
259 */ 264 */
@@ -263,7 +268,8 @@ static void aac_rkt_start_adapter(struct aac_dev *dev)
263 rkt_writeb(dev, MUnit.OIMR, dev->OIMR = 0xfb); 268 rkt_writeb(dev, MUnit.OIMR, dev->OIMR = 0xfb);
264 269
265 // We can only use a 32 bit address here 270 // We can only use a 32 bit address here
266 rkt_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS, (u32)(ulong)dev->init_pa, &status); 271 rkt_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS, (u32)(ulong)dev->init_pa,
272 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL);
267} 273}
268 274
269/** 275/**
@@ -288,8 +294,8 @@ static int aac_rkt_check_health(struct aac_dev *dev)
288 if (status & KERNEL_PANIC) { 294 if (status & KERNEL_PANIC) {
289 char * buffer; 295 char * buffer;
290 struct POSTSTATUS { 296 struct POSTSTATUS {
291 u32 Post_Command; 297 __le32 Post_Command;
292 u32 Post_Address; 298 __le32 Post_Address;
293 } * post; 299 } * post;
294 dma_addr_t paddr, baddr; 300 dma_addr_t paddr, baddr;
295 int ret; 301 int ret;
@@ -310,7 +316,8 @@ static int aac_rkt_check_health(struct aac_dev *dev)
310 post->Post_Command = cpu_to_le32(COMMAND_POST_RESULTS); 316 post->Post_Command = cpu_to_le32(COMMAND_POST_RESULTS);
311 post->Post_Address = cpu_to_le32(baddr); 317 post->Post_Address = cpu_to_le32(baddr);
312 rkt_writel(dev, MUnit.IMRx[0], paddr); 318 rkt_writel(dev, MUnit.IMRx[0], paddr);
313 rkt_sync_cmd(dev, COMMAND_POST_RESULTS, baddr, &status); 319 rkt_sync_cmd(dev, COMMAND_POST_RESULTS, baddr, 0, 0, 0, 0, 0,
320 NULL, NULL, NULL, NULL, NULL);
314 pci_free_consistent(dev->pdev, sizeof(struct POSTSTATUS), 321 pci_free_consistent(dev->pdev, sizeof(struct POSTSTATUS),
315 post, paddr); 322 post, paddr);
316 if ((buffer[0] == '0') && (buffer[1] == 'x')) { 323 if ((buffer[0] == '0') && (buffer[1] == 'x')) {
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
index 630b99e1fe83..1ff25f49fada 100644
--- a/drivers/scsi/aacraid/rx.c
+++ b/drivers/scsi/aacraid/rx.c
@@ -63,7 +63,7 @@ static irqreturn_t aac_rx_intr(int irq, void *dev_id, struct pt_regs *regs)
63 { 63 {
64 bellbits = rx_readl(dev, OutboundDoorbellReg); 64 bellbits = rx_readl(dev, OutboundDoorbellReg);
65 if (bellbits & DoorBellPrintfReady) { 65 if (bellbits & DoorBellPrintfReady) {
66 aac_printf(dev, le32_to_cpu(rx_readl (dev, IndexRegs.Mailbox[5]))); 66 aac_printf(dev, rx_readl(dev, IndexRegs.Mailbox[5]));
67 rx_writel(dev, MUnit.ODR,DoorBellPrintfReady); 67 rx_writel(dev, MUnit.ODR,DoorBellPrintfReady);
68 rx_writel(dev, InboundDoorbellReg,DoorBellPrintfDone); 68 rx_writel(dev, InboundDoorbellReg,DoorBellPrintfDone);
69 } 69 }
@@ -98,7 +98,9 @@ static irqreturn_t aac_rx_intr(int irq, void *dev_id, struct pt_regs *regs)
98 * for its completion. 98 * for its completion.
99 */ 99 */
100 100
101static int rx_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *status) 101static int rx_sync_cmd(struct aac_dev *dev, u32 command,
102 u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6,
103 u32 *status, u32 * r1, u32 * r2, u32 * r3, u32 * r4)
102{ 104{
103 unsigned long start; 105 unsigned long start;
104 int ok; 106 int ok;
@@ -107,12 +109,12 @@ static int rx_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *status)
107 */ 109 */
108 rx_writel(dev, InboundMailbox0, command); 110 rx_writel(dev, InboundMailbox0, command);
109 /* 111 /*
110 * Write the parameters into Mailboxes 1 - 4 112 * Write the parameters into Mailboxes 1 - 6
111 */ 113 */
112 rx_writel(dev, InboundMailbox1, p1); 114 rx_writel(dev, InboundMailbox1, p1);
113 rx_writel(dev, InboundMailbox2, 0); 115 rx_writel(dev, InboundMailbox2, p2);
114 rx_writel(dev, InboundMailbox3, 0); 116 rx_writel(dev, InboundMailbox3, p3);
115 rx_writel(dev, InboundMailbox4, 0); 117 rx_writel(dev, InboundMailbox4, p4);
116 /* 118 /*
117 * Clear the synch command doorbell to start on a clean slate. 119 * Clear the synch command doorbell to start on a clean slate.
118 */ 120 */
@@ -120,7 +122,7 @@ static int rx_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *status)
120 /* 122 /*
121 * Disable doorbell interrupts 123 * Disable doorbell interrupts
122 */ 124 */
123 rx_writeb(dev, MUnit.OIMR, dev->OIMR |= 0x04); 125 rx_writeb(dev, MUnit.OIMR, dev->OIMR = 0xff);
124 /* 126 /*
125 * Force the completion of the mask register write before issuing 127 * Force the completion of the mask register write before issuing
126 * the interrupt. 128 * the interrupt.
@@ -169,6 +171,14 @@ static int rx_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *status)
169 */ 171 */
170 if (status) 172 if (status)
171 *status = rx_readl(dev, IndexRegs.Mailbox[0]); 173 *status = rx_readl(dev, IndexRegs.Mailbox[0]);
174 if (r1)
175 *r1 = rx_readl(dev, IndexRegs.Mailbox[1]);
176 if (r2)
177 *r2 = rx_readl(dev, IndexRegs.Mailbox[2]);
178 if (r3)
179 *r3 = rx_readl(dev, IndexRegs.Mailbox[3]);
180 if (r4)
181 *r4 = rx_readl(dev, IndexRegs.Mailbox[4]);
172 /* 182 /*
173 * Clear the synch command doorbell. 183 * Clear the synch command doorbell.
174 */ 184 */
@@ -190,8 +200,7 @@ static int rx_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *status)
190 200
191static void aac_rx_interrupt_adapter(struct aac_dev *dev) 201static void aac_rx_interrupt_adapter(struct aac_dev *dev)
192{ 202{
193 u32 ret; 203 rx_sync_cmd(dev, BREAKPOINT_REQUEST, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL);
194 rx_sync_cmd(dev, BREAKPOINT_REQUEST, 0, &ret);
195} 204}
196 205
197/** 206/**
@@ -220,7 +229,8 @@ static void aac_rx_notify_adapter(struct aac_dev *dev, u32 event)
220 rx_writel(dev, MUnit.IDR,INBOUNDDOORBELL_3); 229 rx_writel(dev, MUnit.IDR,INBOUNDDOORBELL_3);
221 break; 230 break;
222 case HostShutdown: 231 case HostShutdown:
223// rx_sync_cmd(dev, HOST_CRASHING, 0, 0, 0, 0, &ret); 232// rx_sync_cmd(dev, HOST_CRASHING, 0, 0, 0, 0, 0, 0,
233// NULL, NULL, NULL, NULL, NULL);
224 break; 234 break;
225 case FastIo: 235 case FastIo:
226 rx_writel(dev, MUnit.IDR,INBOUNDDOORBELL_6); 236 rx_writel(dev, MUnit.IDR,INBOUNDDOORBELL_6);
@@ -243,17 +253,11 @@ static void aac_rx_notify_adapter(struct aac_dev *dev, u32 event)
243 253
244static void aac_rx_start_adapter(struct aac_dev *dev) 254static void aac_rx_start_adapter(struct aac_dev *dev)
245{ 255{
246 u32 status;
247 struct aac_init *init; 256 struct aac_init *init;
248 257
249 init = dev->init; 258 init = dev->init;
250 init->HostElapsedSeconds = cpu_to_le32(get_seconds()); 259 init->HostElapsedSeconds = cpu_to_le32(get_seconds());
251 /* 260 /*
252 * Tell the adapter we are back and up and running so it will scan
253 * its command queues and enable our interrupts
254 */
255 dev->irq_mask = (DoorBellPrintfReady | OUTBOUNDDOORBELL_1 | OUTBOUNDDOORBELL_2 | OUTBOUNDDOORBELL_3 | OUTBOUNDDOORBELL_4);
256 /*
257 * First clear out all interrupts. Then enable the one's that we 261 * First clear out all interrupts. Then enable the one's that we
258 * can handle. 262 * can handle.
259 */ 263 */
@@ -263,7 +267,8 @@ static void aac_rx_start_adapter(struct aac_dev *dev)
263 rx_writeb(dev, MUnit.OIMR, dev->OIMR = 0xfb); 267 rx_writeb(dev, MUnit.OIMR, dev->OIMR = 0xfb);
264 268
265 // We can only use a 32 bit address here 269 // We can only use a 32 bit address here
266 rx_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS, (u32)(ulong)dev->init_pa, &status); 270 rx_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS, (u32)(ulong)dev->init_pa,
271 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL);
267} 272}
268 273
269/** 274/**
@@ -288,8 +293,8 @@ static int aac_rx_check_health(struct aac_dev *dev)
288 if (status & KERNEL_PANIC) { 293 if (status & KERNEL_PANIC) {
289 char * buffer; 294 char * buffer;
290 struct POSTSTATUS { 295 struct POSTSTATUS {
291 u32 Post_Command; 296 __le32 Post_Command;
292 u32 Post_Address; 297 __le32 Post_Address;
293 } * post; 298 } * post;
294 dma_addr_t paddr, baddr; 299 dma_addr_t paddr, baddr;
295 int ret; 300 int ret;
@@ -310,7 +315,8 @@ static int aac_rx_check_health(struct aac_dev *dev)
310 post->Post_Command = cpu_to_le32(COMMAND_POST_RESULTS); 315 post->Post_Command = cpu_to_le32(COMMAND_POST_RESULTS);
311 post->Post_Address = cpu_to_le32(baddr); 316 post->Post_Address = cpu_to_le32(baddr);
312 rx_writel(dev, MUnit.IMRx[0], paddr); 317 rx_writel(dev, MUnit.IMRx[0], paddr);
313 rx_sync_cmd(dev, COMMAND_POST_RESULTS, baddr, &status); 318 rx_sync_cmd(dev, COMMAND_POST_RESULTS, baddr, 0, 0, 0, 0, 0,
319 NULL, NULL, NULL, NULL, NULL);
314 pci_free_consistent(dev->pdev, sizeof(struct POSTSTATUS), 320 pci_free_consistent(dev->pdev, sizeof(struct POSTSTATUS),
315 post, paddr); 321 post, paddr);
316 if ((buffer[0] == '0') && (buffer[1] == 'x')) { 322 if ((buffer[0] == '0') && (buffer[1] == 'x')) {
diff --git a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c
index bd6c30723fba..0680249ab861 100644
--- a/drivers/scsi/aacraid/sa.c
+++ b/drivers/scsi/aacraid/sa.c
@@ -89,7 +89,7 @@ static irqreturn_t aac_sa_intr(int irq, void *dev_id, struct pt_regs *regs)
89 * Notify the adapter of an event 89 * Notify the adapter of an event
90 */ 90 */
91 91
92void aac_sa_notify_adapter(struct aac_dev *dev, u32 event) 92static void aac_sa_notify_adapter(struct aac_dev *dev, u32 event)
93{ 93{
94 switch (event) { 94 switch (event) {
95 95
@@ -106,7 +106,10 @@ void aac_sa_notify_adapter(struct aac_dev *dev, u32 event)
106 sa_writew(dev, DoorbellReg_s,DOORBELL_3); 106 sa_writew(dev, DoorbellReg_s,DOORBELL_3);
107 break; 107 break;
108 case HostShutdown: 108 case HostShutdown:
109 //sa_sync_cmd(dev, HOST_CRASHING, 0, &ret); 109 /*
110 sa_sync_cmd(dev, HOST_CRASHING, 0, 0, 0, 0, 0, 0,
111 NULL, NULL, NULL, NULL, NULL);
112 */
110 break; 113 break;
111 case FastIo: 114 case FastIo:
112 sa_writew(dev, DoorbellReg_s,DOORBELL_6); 115 sa_writew(dev, DoorbellReg_s,DOORBELL_6);
@@ -132,7 +135,9 @@ void aac_sa_notify_adapter(struct aac_dev *dev, u32 event)
132 * for its completion. 135 * for its completion.
133 */ 136 */
134 137
135static int sa_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *ret) 138static int sa_sync_cmd(struct aac_dev *dev, u32 command,
139 u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6,
140 u32 *ret, u32 *r1, u32 *r2, u32 *r3, u32 *r4)
136{ 141{
137 unsigned long start; 142 unsigned long start;
138 int ok; 143 int ok;
@@ -144,9 +149,10 @@ static int sa_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *ret)
144 * Write the parameters into Mailboxes 1 - 4 149 * Write the parameters into Mailboxes 1 - 4
145 */ 150 */
146 sa_writel(dev, Mailbox1, p1); 151 sa_writel(dev, Mailbox1, p1);
147 sa_writel(dev, Mailbox2, 0); 152 sa_writel(dev, Mailbox2, p2);
148 sa_writel(dev, Mailbox3, 0); 153 sa_writel(dev, Mailbox3, p3);
149 sa_writel(dev, Mailbox4, 0); 154 sa_writel(dev, Mailbox4, p4);
155
150 /* 156 /*
151 * Clear the synch command doorbell to start on a clean slate. 157 * Clear the synch command doorbell to start on a clean slate.
152 */ 158 */
@@ -188,6 +194,14 @@ static int sa_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *ret)
188 */ 194 */
189 if (ret) 195 if (ret)
190 *ret = sa_readl(dev, Mailbox0); 196 *ret = sa_readl(dev, Mailbox0);
197 if (r1)
198 *r1 = sa_readl(dev, Mailbox1);
199 if (r2)
200 *r2 = sa_readl(dev, Mailbox2);
201 if (r3)
202 *r3 = sa_readl(dev, Mailbox3);
203 if (r4)
204 *r4 = sa_readl(dev, Mailbox4);
191 return 0; 205 return 0;
192} 206}
193 207
@@ -201,7 +215,8 @@ static int sa_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *ret)
201static void aac_sa_interrupt_adapter (struct aac_dev *dev) 215static void aac_sa_interrupt_adapter (struct aac_dev *dev)
202{ 216{
203 u32 ret; 217 u32 ret;
204 sa_sync_cmd(dev, BREAKPOINT_REQUEST, 0, &ret); 218 sa_sync_cmd(dev, BREAKPOINT_REQUEST, 0, 0, 0, 0, 0, 0,
219 &ret, NULL, NULL, NULL, NULL);
205} 220}
206 221
207/** 222/**
@@ -230,10 +245,12 @@ static void aac_sa_start_adapter(struct aac_dev *dev)
230 * First clear out all interrupts. Then enable the one's that 245 * First clear out all interrupts. Then enable the one's that
231 * we can handle. 246 * we can handle.
232 */ 247 */
233 sa_writew(dev, SaDbCSR.PRISETIRQMASK, cpu_to_le16(0xffff)); 248 sa_writew(dev, SaDbCSR.PRISETIRQMASK, 0xffff);
234 sa_writew(dev, SaDbCSR.PRICLEARIRQMASK, (PrintfReady | DOORBELL_1 | DOORBELL_2 | DOORBELL_3 | DOORBELL_4)); 249 sa_writew(dev, SaDbCSR.PRICLEARIRQMASK, (PrintfReady | DOORBELL_1 | DOORBELL_2 | DOORBELL_3 | DOORBELL_4));
235 /* We can only use a 32 bit address here */ 250 /* We can only use a 32 bit address here */
236 sa_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS, (u32)(ulong)dev->init_pa, &ret); 251 sa_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS,
252 (u32)(ulong)dev->init_pa, 0, 0, 0, 0, 0,
253 &ret, NULL, NULL, NULL, NULL);
237} 254}
238 255
239/** 256/**
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index 88d119f4b970..630b11575230 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -1225,8 +1225,6 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
1225 } 1225 }
1226 1226
1227 DO_UNLOCK(flags); 1227 DO_UNLOCK(flags);
1228
1229 spin_lock_irq(shpnt->host_lock);
1230 return ret; 1228 return ret;
1231} 1229}
1232 1230
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index e9920a009593..9ec4641a6348 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -1348,20 +1348,6 @@ static int aha1542_restart(struct Scsi_Host *shost)
1348 return 0; 1348 return 0;
1349} 1349}
1350 1350
1351static int aha1542_abort(Scsi_Cmnd * SCpnt)
1352{
1353
1354 /*
1355 * The abort command does not leave the device in a clean state where
1356 * it is available to be used again. Until this gets worked out, we
1357 * will leave it commented out.
1358 */
1359
1360 printk(KERN_ERR "aha1542.c: Unable to abort command for target %d\n",
1361 SCpnt->device->id);
1362 return FAILED;
1363}
1364
1365/* 1351/*
1366 * This is a device reset. This is handled by sending a special command 1352 * This is a device reset. This is handled by sending a special command
1367 * to the device. 1353 * to the device.
@@ -1478,8 +1464,8 @@ static int aha1542_bus_reset(Scsi_Cmnd * SCpnt)
1478 * check for timeout, and if we are doing something like this 1464 * check for timeout, and if we are doing something like this
1479 * we are pretty desperate anyways. 1465 * we are pretty desperate anyways.
1480 */ 1466 */
1481 spin_unlock_irq(SCpnt->device->host->host_lock);
1482 ssleep(4); 1467 ssleep(4);
1468
1483 spin_lock_irq(SCpnt->device->host->host_lock); 1469 spin_lock_irq(SCpnt->device->host->host_lock);
1484 1470
1485 WAIT(STATUS(SCpnt->device->host->io_port), 1471 WAIT(STATUS(SCpnt->device->host->io_port),
@@ -1517,9 +1503,11 @@ static int aha1542_bus_reset(Scsi_Cmnd * SCpnt)
1517 } 1503 }
1518 } 1504 }
1519 1505
1506 spin_unlock_irq(SCpnt->device->host->host_lock);
1520 return SUCCESS; 1507 return SUCCESS;
1521 1508
1522fail: 1509fail:
1510 spin_unlock_irq(SCpnt->device->host->host_lock);
1523 return FAILED; 1511 return FAILED;
1524} 1512}
1525 1513
@@ -1542,7 +1530,6 @@ static int aha1542_host_reset(Scsi_Cmnd * SCpnt)
1542 * check for timeout, and if we are doing something like this 1530 * check for timeout, and if we are doing something like this
1543 * we are pretty desperate anyways. 1531 * we are pretty desperate anyways.
1544 */ 1532 */
1545 spin_unlock_irq(SCpnt->device->host->host_lock);
1546 ssleep(4); 1533 ssleep(4);
1547 spin_lock_irq(SCpnt->device->host->host_lock); 1534 spin_lock_irq(SCpnt->device->host->host_lock);
1548 1535
@@ -1586,9 +1573,11 @@ static int aha1542_host_reset(Scsi_Cmnd * SCpnt)
1586 } 1573 }
1587 } 1574 }
1588 1575
1576 spin_unlock_irq(SCpnt->device->host->host_lock);
1589 return SUCCESS; 1577 return SUCCESS;
1590 1578
1591fail: 1579fail:
1580 spin_unlock_irq(SCpnt->device->host->host_lock);
1592 return FAILED; 1581 return FAILED;
1593} 1582}
1594 1583
@@ -1817,7 +1806,6 @@ static Scsi_Host_Template driver_template = {
1817 .detect = aha1542_detect, 1806 .detect = aha1542_detect,
1818 .release = aha1542_release, 1807 .release = aha1542_release,
1819 .queuecommand = aha1542_queuecommand, 1808 .queuecommand = aha1542_queuecommand,
1820 .eh_abort_handler = aha1542_abort,
1821 .eh_device_reset_handler= aha1542_dev_reset, 1809 .eh_device_reset_handler= aha1542_dev_reset,
1822 .eh_bus_reset_handler = aha1542_bus_reset, 1810 .eh_bus_reset_handler = aha1542_bus_reset,
1823 .eh_host_reset_handler = aha1542_host_reset, 1811 .eh_host_reset_handler = aha1542_host_reset,
diff --git a/drivers/scsi/aha1542.h b/drivers/scsi/aha1542.h
index c402351dc79a..3821ee17f471 100644
--- a/drivers/scsi/aha1542.h
+++ b/drivers/scsi/aha1542.h
@@ -133,7 +133,6 @@ struct ccb { /* Command Control Block 5.3 */
133 133
134static int aha1542_detect(Scsi_Host_Template *); 134static int aha1542_detect(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_abort(Scsi_Cmnd * SCpnt);
137static int aha1542_bus_reset(Scsi_Cmnd * SCpnt); 136static int aha1542_bus_reset(Scsi_Cmnd * SCpnt);
138static int aha1542_dev_reset(Scsi_Cmnd * SCpnt); 137static int aha1542_dev_reset(Scsi_Cmnd * SCpnt);
139static int aha1542_host_reset(Scsi_Cmnd * SCpnt); 138static int aha1542_host_reset(Scsi_Cmnd * SCpnt);
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c
index da5bd33d982d..9a547ca9c864 100644
--- a/drivers/scsi/ahci.c
+++ b/drivers/scsi/ahci.c
@@ -32,13 +32,14 @@
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/interrupt.h> 33#include <linux/interrupt.h>
34#include <linux/sched.h> 34#include <linux/sched.h>
35#include <linux/dma-mapping.h>
35#include "scsi.h" 36#include "scsi.h"
36#include <scsi/scsi_host.h> 37#include <scsi/scsi_host.h>
37#include <linux/libata.h> 38#include <linux/libata.h>
38#include <asm/io.h> 39#include <asm/io.h>
39 40
40#define DRV_NAME "ahci" 41#define DRV_NAME "ahci"
41#define DRV_VERSION "1.00" 42#define DRV_VERSION "1.01"
42 43
43 44
44enum { 45enum {
@@ -49,6 +50,7 @@ enum {
49 AHCI_CMD_SLOT_SZ = 32 * 32, 50 AHCI_CMD_SLOT_SZ = 32 * 32,
50 AHCI_RX_FIS_SZ = 256, 51 AHCI_RX_FIS_SZ = 256,
51 AHCI_CMD_TBL_HDR = 0x80, 52 AHCI_CMD_TBL_HDR = 0x80,
53 AHCI_CMD_TBL_CDB = 0x40,
52 AHCI_CMD_TBL_SZ = AHCI_CMD_TBL_HDR + (AHCI_MAX_SG * 16), 54 AHCI_CMD_TBL_SZ = AHCI_CMD_TBL_HDR + (AHCI_MAX_SG * 16),
53 AHCI_PORT_PRIV_DMA_SZ = AHCI_CMD_SLOT_SZ + AHCI_CMD_TBL_SZ + 55 AHCI_PORT_PRIV_DMA_SZ = AHCI_CMD_SLOT_SZ + AHCI_CMD_TBL_SZ +
54 AHCI_RX_FIS_SZ, 56 AHCI_RX_FIS_SZ,
@@ -133,6 +135,9 @@ enum {
133 PORT_CMD_ICC_ACTIVE = (0x1 << 28), /* Put i/f in active state */ 135 PORT_CMD_ICC_ACTIVE = (0x1 << 28), /* Put i/f in active state */
134 PORT_CMD_ICC_PARTIAL = (0x2 << 28), /* Put i/f in partial state */ 136 PORT_CMD_ICC_PARTIAL = (0x2 << 28), /* Put i/f in partial state */
135 PORT_CMD_ICC_SLUMBER = (0x6 << 28), /* Put i/f in slumber state */ 137 PORT_CMD_ICC_SLUMBER = (0x6 << 28), /* Put i/f in slumber state */
138
139 /* hpriv->flags bits */
140 AHCI_FLAG_MSI = (1 << 0),
136}; 141};
137 142
138struct ahci_cmd_hdr { 143struct ahci_cmd_hdr {
@@ -182,6 +187,7 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc);
182static u8 ahci_check_status(struct ata_port *ap); 187static u8 ahci_check_status(struct ata_port *ap);
183static u8 ahci_check_err(struct ata_port *ap); 188static u8 ahci_check_err(struct ata_port *ap);
184static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); 189static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
190static void ahci_remove_one (struct pci_dev *pdev);
185 191
186static Scsi_Host_Template ahci_sht = { 192static Scsi_Host_Template ahci_sht = {
187 .module = THIS_MODULE, 193 .module = THIS_MODULE,
@@ -271,7 +277,7 @@ static struct pci_driver ahci_pci_driver = {
271 .name = DRV_NAME, 277 .name = DRV_NAME,
272 .id_table = ahci_pci_tbl, 278 .id_table = ahci_pci_tbl,
273 .probe = ahci_init_one, 279 .probe = ahci_init_one,
274 .remove = ata_pci_remove_one, 280 .remove = ahci_remove_one,
275}; 281};
276 282
277 283
@@ -289,6 +295,8 @@ static void ahci_host_stop(struct ata_host_set *host_set)
289{ 295{
290 struct ahci_host_priv *hpriv = host_set->private_data; 296 struct ahci_host_priv *hpriv = host_set->private_data;
291 kfree(hpriv); 297 kfree(hpriv);
298
299 ata_host_stop(host_set);
292} 300}
293 301
294static int ahci_port_start(struct ata_port *ap) 302static int ahci_port_start(struct ata_port *ap)
@@ -503,7 +511,8 @@ static void ahci_fill_sg(struct ata_queued_cmd *qc)
503 511
504static void ahci_qc_prep(struct ata_queued_cmd *qc) 512static void ahci_qc_prep(struct ata_queued_cmd *qc)
505{ 513{
506 struct ahci_port_priv *pp = qc->ap->private_data; 514 struct ata_port *ap = qc->ap;
515 struct ahci_port_priv *pp = ap->private_data;
507 u32 opts; 516 u32 opts;
508 const u32 cmd_fis_len = 5; /* five dwords */ 517 const u32 cmd_fis_len = 5; /* five dwords */
509 518
@@ -515,18 +524,8 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc)
515 opts = (qc->n_elem << 16) | cmd_fis_len; 524 opts = (qc->n_elem << 16) | cmd_fis_len;
516 if (qc->tf.flags & ATA_TFLAG_WRITE) 525 if (qc->tf.flags & ATA_TFLAG_WRITE)
517 opts |= AHCI_CMD_WRITE; 526 opts |= AHCI_CMD_WRITE;
518 527 if (is_atapi_taskfile(&qc->tf))
519 switch (qc->tf.protocol) {
520 case ATA_PROT_ATAPI:
521 case ATA_PROT_ATAPI_NODATA:
522 case ATA_PROT_ATAPI_DMA:
523 opts |= AHCI_CMD_ATAPI; 528 opts |= AHCI_CMD_ATAPI;
524 break;
525
526 default:
527 /* do nothing */
528 break;
529 }
530 529
531 pp->cmd_slot[0].opts = cpu_to_le32(opts); 530 pp->cmd_slot[0].opts = cpu_to_le32(opts);
532 pp->cmd_slot[0].status = 0; 531 pp->cmd_slot[0].status = 0;
@@ -538,6 +537,10 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc)
538 * a SATA Register - Host to Device command FIS. 537 * a SATA Register - Host to Device command FIS.
539 */ 538 */
540 ata_tf_to_fis(&qc->tf, pp->cmd_tbl, 0); 539 ata_tf_to_fis(&qc->tf, pp->cmd_tbl, 0);
540 if (opts & AHCI_CMD_ATAPI) {
541 memset(pp->cmd_tbl + AHCI_CMD_TBL_CDB, 0, 32);
542 memcpy(pp->cmd_tbl + AHCI_CMD_TBL_CDB, qc->cdb, ap->cdb_len);
543 }
541 544
542 if (!(qc->flags & ATA_QCFLAG_DMAMAP)) 545 if (!(qc->flags & ATA_QCFLAG_DMAMAP))
543 return; 546 return;
@@ -792,8 +795,6 @@ static int ahci_host_init(struct ata_probe_ent *probe_ent)
792 return rc; 795 return rc;
793 } 796 }
794 } 797 }
795
796 hpriv->flags |= HOST_CAP_64;
797 } else { 798 } else {
798 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 799 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
799 if (rc) { 800 if (rc) {
@@ -876,15 +877,19 @@ static int ahci_host_init(struct ata_probe_ent *probe_ent)
876} 877}
877 878
878/* move to PCI layer, integrate w/ MSI stuff */ 879/* move to PCI layer, integrate w/ MSI stuff */
879static void pci_enable_intx(struct pci_dev *pdev) 880static void pci_intx(struct pci_dev *pdev, int enable)
880{ 881{
881 u16 pci_command; 882 u16 pci_command, new;
882 883
883 pci_read_config_word(pdev, PCI_COMMAND, &pci_command); 884 pci_read_config_word(pdev, PCI_COMMAND, &pci_command);
884 if (pci_command & PCI_COMMAND_INTX_DISABLE) { 885
885 pci_command &= ~PCI_COMMAND_INTX_DISABLE; 886 if (enable)
887 new = pci_command & ~PCI_COMMAND_INTX_DISABLE;
888 else
889 new = pci_command | PCI_COMMAND_INTX_DISABLE;
890
891 if (new != pci_command)
886 pci_write_config_word(pdev, PCI_COMMAND, pci_command); 892 pci_write_config_word(pdev, PCI_COMMAND, pci_command);
887 }
888} 893}
889 894
890static void ahci_print_info(struct ata_probe_ent *probe_ent) 895static void ahci_print_info(struct ata_probe_ent *probe_ent)
@@ -966,7 +971,7 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
966 unsigned long base; 971 unsigned long base;
967 void *mmio_base; 972 void *mmio_base;
968 unsigned int board_idx = (unsigned int) ent->driver_data; 973 unsigned int board_idx = (unsigned int) ent->driver_data;
969 int pci_dev_busy = 0; 974 int have_msi, pci_dev_busy = 0;
970 int rc; 975 int rc;
971 976
972 VPRINTK("ENTER\n"); 977 VPRINTK("ENTER\n");
@@ -984,12 +989,17 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
984 goto err_out; 989 goto err_out;
985 } 990 }
986 991
987 pci_enable_intx(pdev); 992 if (pci_enable_msi(pdev) == 0)
993 have_msi = 1;
994 else {
995 pci_intx(pdev, 1);
996 have_msi = 0;
997 }
988 998
989 probe_ent = kmalloc(sizeof(*probe_ent), GFP_KERNEL); 999 probe_ent = kmalloc(sizeof(*probe_ent), GFP_KERNEL);
990 if (probe_ent == NULL) { 1000 if (probe_ent == NULL) {
991 rc = -ENOMEM; 1001 rc = -ENOMEM;
992 goto err_out_regions; 1002 goto err_out_msi;
993 } 1003 }
994 1004
995 memset(probe_ent, 0, sizeof(*probe_ent)); 1005 memset(probe_ent, 0, sizeof(*probe_ent));
@@ -1022,6 +1032,9 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1022 probe_ent->mmio_base = mmio_base; 1032 probe_ent->mmio_base = mmio_base;
1023 probe_ent->private_data = hpriv; 1033 probe_ent->private_data = hpriv;
1024 1034
1035 if (have_msi)
1036 hpriv->flags |= AHCI_FLAG_MSI;
1037
1025 /* initialize adapter */ 1038 /* initialize adapter */
1026 rc = ahci_host_init(probe_ent); 1039 rc = ahci_host_init(probe_ent);
1027 if (rc) 1040 if (rc)
@@ -1041,7 +1054,11 @@ err_out_iounmap:
1041 iounmap(mmio_base); 1054 iounmap(mmio_base);
1042err_out_free_ent: 1055err_out_free_ent:
1043 kfree(probe_ent); 1056 kfree(probe_ent);
1044err_out_regions: 1057err_out_msi:
1058 if (have_msi)
1059 pci_disable_msi(pdev);
1060 else
1061 pci_intx(pdev, 0);
1045 pci_release_regions(pdev); 1062 pci_release_regions(pdev);
1046err_out: 1063err_out:
1047 if (!pci_dev_busy) 1064 if (!pci_dev_busy)
@@ -1049,6 +1066,42 @@ err_out:
1049 return rc; 1066 return rc;
1050} 1067}
1051 1068
1069static void ahci_remove_one (struct pci_dev *pdev)
1070{
1071 struct device *dev = pci_dev_to_dev(pdev);
1072 struct ata_host_set *host_set = dev_get_drvdata(dev);
1073 struct ahci_host_priv *hpriv = host_set->private_data;
1074 struct ata_port *ap;
1075 unsigned int i;
1076 int have_msi;
1077
1078 for (i = 0; i < host_set->n_ports; i++) {
1079 ap = host_set->ports[i];
1080
1081 scsi_remove_host(ap->host);
1082 }
1083
1084 have_msi = hpriv->flags & AHCI_FLAG_MSI;
1085 free_irq(host_set->irq, host_set);
1086
1087 for (i = 0; i < host_set->n_ports; i++) {
1088 ap = host_set->ports[i];
1089
1090 ata_scsi_release(ap->host);
1091 scsi_host_put(ap->host);
1092 }
1093
1094 host_set->ops->host_stop(host_set);
1095 kfree(host_set);
1096
1097 if (have_msi)
1098 pci_disable_msi(pdev);
1099 else
1100 pci_intx(pdev, 0);
1101 pci_release_regions(pdev);
1102 pci_disable_device(pdev);
1103 dev_set_drvdata(dev, NULL);
1104}
1052 1105
1053static int __init ahci_init(void) 1106static int __init ahci_init(void)
1054{ 1107{
diff --git a/drivers/scsi/aic7xxx/aic7770_osm.c b/drivers/scsi/aic7xxx/aic7770_osm.c
index 682ca0b32b44..d4ed5e9f830a 100644
--- a/drivers/scsi/aic7xxx/aic7770_osm.c
+++ b/drivers/scsi/aic7xxx/aic7770_osm.c
@@ -44,88 +44,46 @@
44#include <linux/device.h> 44#include <linux/device.h>
45#include <linux/eisa.h> 45#include <linux/eisa.h>
46 46
47#define EISA_MFCTR_CHAR0(ID) (char)(((ID>>26) & 0x1F) | '@') /* Bits 26-30 */
48#define EISA_MFCTR_CHAR1(ID) (char)(((ID>>21) & 0x1F) | '@') /* Bits 21-25 */
49#define EISA_MFCTR_CHAR2(ID) (char)(((ID>>16) & 0x1F) | '@') /* Bits 16-20 */
50#define EISA_PRODUCT_ID(ID) (short)((ID>>4) & 0xFFF) /* Bits 4-15 */
51#define EISA_REVISION_ID(ID) (uint8_t)(ID & 0x0F) /* Bits 0-3 */
52
53static int aic7770_eisa_dev_probe(struct device *dev);
54static int aic7770_eisa_dev_remove(struct device *dev);
55static struct eisa_driver aic7770_driver = {
56 .driver = {
57 .name = "aic7xxx",
58 .probe = aic7770_eisa_dev_probe,
59 .remove = aic7770_eisa_dev_remove,
60 }
61};
62
63typedef struct device *aic7770_dev_t;
64
65static int aic7770_linux_config(struct aic7770_identity *entry,
66 aic7770_dev_t dev, u_int eisaBase);
67
68int 47int
69ahc_linux_eisa_init(void) 48aic7770_map_registers(struct ahc_softc *ahc, u_int port)
70{ 49{
71 struct eisa_device_id *eid;
72 struct aic7770_identity *id;
73 int i;
74
75 if (aic7xxx_probe_eisa_vl == 0)
76 return -ENODEV;
77
78 /* 50 /*
79 * Linux requires the EISA IDs to be specified in 51 * Lock out other contenders for our i/o space.
80 * the EISA ID string format. Perform the conversion
81 * and setup a table with a NUL terminal entry.
82 */ 52 */
83 aic7770_driver.id_table = malloc(sizeof(struct eisa_device_id) * 53 if (request_region(port, AHC_EISA_IOSIZE, "aic7xxx") == 0)
84 (ahc_num_aic7770_devs + 1), 54 return (ENOMEM);
85 M_DEVBUF, M_NOWAIT); 55 ahc->tag = BUS_SPACE_PIO;
86 if (aic7770_driver.id_table == NULL) 56 ahc->bsh.ioport = port;
87 return -ENOMEM; 57 return (0);
88
89 for (eid = (struct eisa_device_id *)aic7770_driver.id_table,
90 id = aic7770_ident_table, i = 0;
91 i < ahc_num_aic7770_devs; eid++, id++, i++) {
92
93 sprintf(eid->sig, "%c%c%c%03X%01X",
94 EISA_MFCTR_CHAR0(id->full_id),
95 EISA_MFCTR_CHAR1(id->full_id),
96 EISA_MFCTR_CHAR2(id->full_id),
97 EISA_PRODUCT_ID(id->full_id),
98 EISA_REVISION_ID(id->full_id));
99 eid->driver_data = i;
100 }
101 eid->sig[0] = 0;
102
103 return eisa_driver_register(&aic7770_driver);
104} 58}
105 59
106void 60int
107ahc_linux_eisa_exit(void) 61aic7770_map_int(struct ahc_softc *ahc, u_int irq)
108{ 62{
109 if(aic7xxx_probe_eisa_vl != 0 && aic7770_driver.id_table != NULL) { 63 int error;
110 eisa_driver_unregister(&aic7770_driver); 64 int shared;
111 free(aic7770_driver.id_table, M_DEVBUF); 65
112 } 66 shared = 0;
67 if ((ahc->flags & AHC_EDGE_INTERRUPT) == 0)
68 shared = SA_SHIRQ;
69
70 error = request_irq(irq, ahc_linux_isr, shared, "aic7xxx", ahc);
71 if (error == 0)
72 ahc->platform_data->irq = irq;
73
74 return (-error);
113} 75}
114 76
115static int 77static int
116aic7770_linux_config(struct aic7770_identity *entry, aic7770_dev_t dev, 78aic7770_probe(struct device *dev)
117 u_int eisaBase)
118{ 79{
80 struct eisa_device *edev = to_eisa_device(dev);
81 u_int eisaBase = edev->base_addr+AHC_EISA_SLOT_OFFSET;
119 struct ahc_softc *ahc; 82 struct ahc_softc *ahc;
120 char buf[80]; 83 char buf[80];
121 char *name; 84 char *name;
122 int error; 85 int error;
123 86
124 /*
125 * Allocate a softc for this card and
126 * set it up for attachment by our
127 * common detect routine.
128 */
129 sprintf(buf, "ahc_eisa:%d", eisaBase >> 12); 87 sprintf(buf, "ahc_eisa:%d", eisaBase >> 12);
130 name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); 88 name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT);
131 if (name == NULL) 89 if (name == NULL)
@@ -134,81 +92,62 @@ aic7770_linux_config(struct aic7770_identity *entry, aic7770_dev_t dev,
134 ahc = ahc_alloc(&aic7xxx_driver_template, name); 92 ahc = ahc_alloc(&aic7xxx_driver_template, name);
135 if (ahc == NULL) 93 if (ahc == NULL)
136 return (ENOMEM); 94 return (ENOMEM);
137 error = aic7770_config(ahc, entry, eisaBase); 95 error = aic7770_config(ahc, aic7770_ident_table + edev->id.driver_data,
96 eisaBase);
138 if (error != 0) { 97 if (error != 0) {
139 ahc->bsh.ioport = 0; 98 ahc->bsh.ioport = 0;
140 ahc_free(ahc); 99 ahc_free(ahc);
141 return (error); 100 return (error);
142 } 101 }
143 102
144 dev->driver_data = (void *)ahc; 103 dev_set_drvdata(dev, ahc);
104
145 if (aic7xxx_detect_complete) 105 if (aic7xxx_detect_complete)
146 error = ahc_linux_register_host(ahc, &aic7xxx_driver_template); 106 error = ahc_linux_register_host(ahc, &aic7xxx_driver_template);
147 return (error); 107 return (error);
148} 108}
149 109
150int 110static int
151aic7770_map_registers(struct ahc_softc *ahc, u_int port) 111aic7770_remove(struct device *dev)
152{
153 /*
154 * Lock out other contenders for our i/o space.
155 */
156 if (request_region(port, AHC_EISA_IOSIZE, "aic7xxx") == 0)
157 return (ENOMEM);
158 ahc->tag = BUS_SPACE_PIO;
159 ahc->bsh.ioport = port;
160 return (0);
161}
162
163int
164aic7770_map_int(struct ahc_softc *ahc, u_int irq)
165{ 112{
166 int error; 113 struct ahc_softc *ahc = dev_get_drvdata(dev);
167 int shared; 114 u_long s;
168 115
169 shared = 0; 116 ahc_lock(ahc, &s);
170 if ((ahc->flags & AHC_EDGE_INTERRUPT) == 0) 117 ahc_intr_enable(ahc, FALSE);
171 shared = SA_SHIRQ; 118 ahc_unlock(ahc, &s);
172 119
173 error = request_irq(irq, ahc_linux_isr, shared, "aic7xxx", ahc); 120 ahc_free(ahc);
174 if (error == 0) 121 return 0;
175 ahc->platform_data->irq = irq;
176
177 return (-error);
178} 122}
179 123
180static int 124static struct eisa_device_id aic7770_ids[] = {
181aic7770_eisa_dev_probe(struct device *dev) 125 { "ADP7771", 0 }, /* AHA 274x */
126 { "ADP7756", 1 }, /* AHA 284x BIOS enabled */
127 { "ADP7757", 2 }, /* AHA 284x BIOS disabled */
128 { "ADP7782", 3 }, /* AHA 274x Olivetti OEM */
129 { "ADP7783", 4 }, /* AHA 274x Olivetti OEM (Differential) */
130 { "ADP7770", 5 }, /* AIC7770 generic */
131 { "" }
132};
133
134static struct eisa_driver aic7770_driver = {
135 .id_table = aic7770_ids,
136 .driver = {
137 .name = "aic7xxx",
138 .probe = aic7770_probe,
139 .remove = aic7770_remove,
140 }
141};
142
143int
144ahc_linux_eisa_init(void)
182{ 145{
183 struct eisa_device *edev; 146 return eisa_driver_register(&aic7770_driver);
184
185 edev = to_eisa_device(dev);
186 return (aic7770_linux_config(aic7770_ident_table + edev->id.driver_data,
187 dev, edev->base_addr+AHC_EISA_SLOT_OFFSET));
188} 147}
189 148
190static int 149void
191aic7770_eisa_dev_remove(struct device *dev) 150ahc_linux_eisa_exit(void)
192{ 151{
193 struct ahc_softc *ahc; 152 eisa_driver_unregister(&aic7770_driver);
194 u_long l;
195
196 /*
197 * We should be able to just perform
198 * the free directly, but check our
199 * list for extra sanity.
200 */
201 ahc_list_lock(&l);
202 ahc = ahc_find_softc((struct ahc_softc *)dev->driver_data);
203 if (ahc != NULL) {
204 u_long s;
205
206 ahc_lock(ahc, &s);
207 ahc_intr_enable(ahc, FALSE);
208 ahc_unlock(ahc, &s);
209 ahc_free(ahc);
210 }
211 ahc_list_unlock(&l);
212
213 return (0);
214} 153}
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 550c9921691a..5f526dd0aaa1 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -1511,17 +1511,17 @@ ahd_linux_dev_reset(Scsi_Cmnd *cmd)
1511 ahd_name(ahd), cmd->device->channel, cmd->device->id, 1511 ahd_name(ahd), cmd->device->channel, cmd->device->id,
1512 cmd->device->lun, cmd); 1512 cmd->device->lun, cmd);
1513#endif 1513#endif
1514 ahd_midlayer_entrypoint_lock(ahd, &s); 1514 ahd_lock(ahd, &s);
1515 1515
1516 dev = ahd_linux_get_device(ahd, cmd->device->channel, cmd->device->id, 1516 dev = ahd_linux_get_device(ahd, cmd->device->channel, cmd->device->id,
1517 cmd->device->lun, /*alloc*/FALSE); 1517 cmd->device->lun, /*alloc*/FALSE);
1518 if (dev == NULL) { 1518 if (dev == NULL) {
1519 ahd_midlayer_entrypoint_unlock(ahd, &s); 1519 ahd_unlock(ahd, &s);
1520 kfree(recovery_cmd); 1520 kfree(recovery_cmd);
1521 return (FAILED); 1521 return (FAILED);
1522 } 1522 }
1523 if ((scb = ahd_get_scb(ahd, AHD_NEVER_COL_IDX)) == NULL) { 1523 if ((scb = ahd_get_scb(ahd, AHD_NEVER_COL_IDX)) == NULL) {
1524 ahd_midlayer_entrypoint_unlock(ahd, &s); 1524 ahd_unlock(ahd, &s);
1525 kfree(recovery_cmd); 1525 kfree(recovery_cmd);
1526 return (FAILED); 1526 return (FAILED);
1527 } 1527 }
@@ -1570,7 +1570,7 @@ ahd_linux_dev_reset(Scsi_Cmnd *cmd)
1570 spin_lock_irq(&ahd->platform_data->spin_lock); 1570 spin_lock_irq(&ahd->platform_data->spin_lock);
1571 ahd_schedule_runq(ahd); 1571 ahd_schedule_runq(ahd);
1572 ahd_linux_run_complete_queue(ahd); 1572 ahd_linux_run_complete_queue(ahd);
1573 ahd_midlayer_entrypoint_unlock(ahd, &s); 1573 ahd_unlock(ahd, &s);
1574 printf("%s: Device reset returning 0x%x\n", ahd_name(ahd), retval); 1574 printf("%s: Device reset returning 0x%x\n", ahd_name(ahd), retval);
1575 return (retval); 1575 return (retval);
1576} 1576}
@@ -1591,11 +1591,11 @@ ahd_linux_bus_reset(Scsi_Cmnd *cmd)
1591 printf("%s: Bus reset called for cmd %p\n", 1591 printf("%s: Bus reset called for cmd %p\n",
1592 ahd_name(ahd), cmd); 1592 ahd_name(ahd), cmd);
1593#endif 1593#endif
1594 ahd_midlayer_entrypoint_lock(ahd, &s); 1594 ahd_lock(ahd, &s);
1595 found = ahd_reset_channel(ahd, cmd->device->channel + 'A', 1595 found = ahd_reset_channel(ahd, cmd->device->channel + 'A',
1596 /*initiate reset*/TRUE); 1596 /*initiate reset*/TRUE);
1597 ahd_linux_run_complete_queue(ahd); 1597 ahd_linux_run_complete_queue(ahd);
1598 ahd_midlayer_entrypoint_unlock(ahd, &s); 1598 ahd_unlock(ahd, &s);
1599 1599
1600 if (bootverbose) 1600 if (bootverbose)
1601 printf("%s: SCSI bus reset delivered. " 1601 printf("%s: SCSI bus reset delivered. "
@@ -2488,7 +2488,7 @@ ahd_linux_dv_thread(void *data)
2488 sprintf(current->comm, "ahd_dv_%d", ahd->unit); 2488 sprintf(current->comm, "ahd_dv_%d", ahd->unit);
2489#else 2489#else
2490 daemonize("ahd_dv_%d", ahd->unit); 2490 daemonize("ahd_dv_%d", ahd->unit);
2491 current->flags |= PF_FREEZE; 2491 current->flags |= PF_NOFREEZE;
2492#endif 2492#endif
2493 unlock_kernel(); 2493 unlock_kernel();
2494 2494
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h
index 605f92b6c5ca..7823e52e99ab 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.h
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.h
@@ -112,23 +112,6 @@ typedef Scsi_Cmnd *ahd_io_ctx_t;
112#define ahd_le32toh(x) le32_to_cpu(x) 112#define ahd_le32toh(x) le32_to_cpu(x)
113#define ahd_le64toh(x) le64_to_cpu(x) 113#define ahd_le64toh(x) le64_to_cpu(x)
114 114
115#ifndef LITTLE_ENDIAN
116#define LITTLE_ENDIAN 1234
117#endif
118
119#ifndef BIG_ENDIAN
120#define BIG_ENDIAN 4321
121#endif
122
123#ifndef BYTE_ORDER
124#if defined(__BIG_ENDIAN)
125#define BYTE_ORDER BIG_ENDIAN
126#endif
127#if defined(__LITTLE_ENDIAN)
128#define BYTE_ORDER LITTLE_ENDIAN
129#endif
130#endif /* BYTE_ORDER */
131
132/************************* Configuration Data *********************************/ 115/************************* Configuration Data *********************************/
133extern uint32_t aic79xx_allow_memio; 116extern uint32_t aic79xx_allow_memio;
134extern int aic79xx_detect_complete; 117extern int aic79xx_detect_complete;
diff --git a/drivers/scsi/aic7xxx/aic7xxx.h b/drivers/scsi/aic7xxx/aic7xxx.h
index 8ff16fd8ed49..0948d50ae75c 100644
--- a/drivers/scsi/aic7xxx/aic7xxx.h
+++ b/drivers/scsi/aic7xxx/aic7xxx.h
@@ -346,7 +346,6 @@ typedef enum {
346 * controller. 346 * controller.
347 */ 347 */
348 AHC_NEWEEPROM_FMT = 0x4000, 348 AHC_NEWEEPROM_FMT = 0x4000,
349 AHC_RESOURCE_SHORTAGE = 0x8000,
350 AHC_TQINFIFO_BLOCKED = 0x10000, /* Blocked waiting for ATIOs */ 349 AHC_TQINFIFO_BLOCKED = 0x10000, /* Blocked waiting for ATIOs */
351 AHC_INT50_SPEEDFLEX = 0x20000, /* 350 AHC_INT50_SPEEDFLEX = 0x20000, /*
352 * Internal 50pin connector 351 * Internal 50pin connector
@@ -1200,7 +1199,6 @@ void ahc_pause_and_flushwork(struct ahc_softc *ahc);
1200int ahc_suspend(struct ahc_softc *ahc); 1199int ahc_suspend(struct ahc_softc *ahc);
1201int ahc_resume(struct ahc_softc *ahc); 1200int ahc_resume(struct ahc_softc *ahc);
1202void ahc_softc_insert(struct ahc_softc *); 1201void ahc_softc_insert(struct ahc_softc *);
1203struct ahc_softc *ahc_find_softc(struct ahc_softc *ahc);
1204void ahc_set_unit(struct ahc_softc *, int); 1202void ahc_set_unit(struct ahc_softc *, int);
1205void ahc_set_name(struct ahc_softc *, char *); 1203void ahc_set_name(struct ahc_softc *, char *);
1206void ahc_alloc_scbs(struct ahc_softc *ahc); 1204void ahc_alloc_scbs(struct ahc_softc *ahc);
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index 9a6b4a570aa7..8a2bb6f8d77b 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -3934,22 +3934,6 @@ ahc_softc_insert(struct ahc_softc *ahc)
3934 ahc->init_level++; 3934 ahc->init_level++;
3935} 3935}
3936 3936
3937/*
3938 * Verify that the passed in softc pointer is for a
3939 * controller that is still configured.
3940 */
3941struct ahc_softc *
3942ahc_find_softc(struct ahc_softc *ahc)
3943{
3944 struct ahc_softc *list_ahc;
3945
3946 TAILQ_FOREACH(list_ahc, &ahc_tailq, links) {
3947 if (list_ahc == ahc)
3948 return (ahc);
3949 }
3950 return (NULL);
3951}
3952
3953void 3937void
3954ahc_set_unit(struct ahc_softc *ahc, int unit) 3938ahc_set_unit(struct ahc_softc *ahc, int unit)
3955{ 3939{
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index c13e56320010..b89094db14c1 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -122,8 +122,6 @@
122#include "aic7xxx_osm.h" 122#include "aic7xxx_osm.h"
123#include "aic7xxx_inline.h" 123#include "aic7xxx_inline.h"
124#include <scsi/scsicam.h> 124#include <scsi/scsicam.h>
125#include <scsi/scsi_transport.h>
126#include <scsi/scsi_transport_spi.h>
127 125
128static struct scsi_transport_template *ahc_linux_transport_template = NULL; 126static struct scsi_transport_template *ahc_linux_transport_template = NULL;
129 127
@@ -332,22 +330,6 @@ static uint32_t aic7xxx_extended;
332static uint32_t aic7xxx_pci_parity = ~0; 330static uint32_t aic7xxx_pci_parity = ~0;
333 331
334/* 332/*
335 * Certain newer motherboards have put new PCI based devices into the
336 * IO spaces that used to typically be occupied by VLB or EISA cards.
337 * This overlap can cause these newer motherboards to lock up when scanned
338 * for older EISA and VLB devices. Setting this option to non-0 will
339 * cause the driver to skip scanning for any VLB or EISA controllers and
340 * only support the PCI controllers. NOTE: this means that if the kernel
341 * os compiled with PCI support disabled, then setting this to non-0
342 * would result in never finding any devices :)
343 */
344#ifndef CONFIG_AIC7XXX_PROBE_EISA_VL
345uint32_t aic7xxx_probe_eisa_vl;
346#else
347uint32_t aic7xxx_probe_eisa_vl = ~0;
348#endif
349
350/*
351 * There are lots of broken chipsets in the world. Some of them will 333 * There are lots of broken chipsets in the world. Some of them will
352 * violate the PCI spec when we issue byte sized memory writes to our 334 * violate the PCI spec when we issue byte sized memory writes to our
353 * controller. I/O mapped register access, if allowed by the given 335 * controller. I/O mapped register access, if allowed by the given
@@ -423,7 +405,7 @@ MODULE_PARM_DESC(aic7xxx,
423); 405);
424 406
425static void ahc_linux_handle_scsi_status(struct ahc_softc *, 407static void ahc_linux_handle_scsi_status(struct ahc_softc *,
426 struct ahc_linux_device *, 408 struct scsi_device *,
427 struct scb *); 409 struct scb *);
428static void ahc_linux_queue_cmd_complete(struct ahc_softc *ahc, 410static void ahc_linux_queue_cmd_complete(struct ahc_softc *ahc,
429 struct scsi_cmnd *cmd); 411 struct scsi_cmnd *cmd);
@@ -434,17 +416,7 @@ static int ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag);
434static void ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc); 416static void ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc);
435static u_int ahc_linux_user_tagdepth(struct ahc_softc *ahc, 417static u_int ahc_linux_user_tagdepth(struct ahc_softc *ahc,
436 struct ahc_devinfo *devinfo); 418 struct ahc_devinfo *devinfo);
437static void ahc_linux_device_queue_depth(struct ahc_softc *ahc, 419static void ahc_linux_device_queue_depth(struct scsi_device *);
438 struct ahc_linux_device *dev);
439static struct ahc_linux_target* ahc_linux_alloc_target(struct ahc_softc*,
440 u_int, u_int);
441static void ahc_linux_free_target(struct ahc_softc*,
442 struct ahc_linux_target*);
443static struct ahc_linux_device* ahc_linux_alloc_device(struct ahc_softc*,
444 struct ahc_linux_target*,
445 u_int);
446static void ahc_linux_free_device(struct ahc_softc*,
447 struct ahc_linux_device*);
448static int ahc_linux_run_command(struct ahc_softc*, 420static int ahc_linux_run_command(struct ahc_softc*,
449 struct ahc_linux_device *, 421 struct ahc_linux_device *,
450 struct scsi_cmnd *); 422 struct scsi_cmnd *);
@@ -454,32 +426,12 @@ static int aic7xxx_setup(char *s);
454static int ahc_linux_next_unit(void); 426static int ahc_linux_next_unit(void);
455 427
456/********************************* Inlines ************************************/ 428/********************************* Inlines ************************************/
457static __inline struct ahc_linux_device*
458 ahc_linux_get_device(struct ahc_softc *ahc, u_int channel,
459 u_int target, u_int lun);
460static __inline void ahc_linux_unmap_scb(struct ahc_softc*, struct scb*); 429static __inline void ahc_linux_unmap_scb(struct ahc_softc*, struct scb*);
461 430
462static __inline int ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb, 431static __inline int ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb,
463 struct ahc_dma_seg *sg, 432 struct ahc_dma_seg *sg,
464 dma_addr_t addr, bus_size_t len); 433 dma_addr_t addr, bus_size_t len);
465 434
466static __inline struct ahc_linux_device*
467ahc_linux_get_device(struct ahc_softc *ahc, u_int channel, u_int target,
468 u_int lun)
469{
470 struct ahc_linux_target *targ;
471 struct ahc_linux_device *dev;
472 u_int target_offset;
473
474 target_offset = target;
475 if (channel != 0)
476 target_offset += 8;
477 targ = ahc->platform_data->targets[target_offset];
478 BUG_ON(targ == NULL);
479 dev = targ->devices[lun];
480 return dev;
481}
482
483static __inline void 435static __inline void
484ahc_linux_unmap_scb(struct ahc_softc *ahc, struct scb *scb) 436ahc_linux_unmap_scb(struct ahc_softc *ahc, struct scb *scb)
485{ 437{
@@ -533,17 +485,6 @@ ahc_linux_detect(struct scsi_host_template *template)
533 int found = 0; 485 int found = 0;
534 486
535 /* 487 /*
536 * Sanity checking of Linux SCSI data structures so
537 * that some of our hacks^H^H^H^H^Hassumptions aren't
538 * violated.
539 */
540 if (offsetof(struct ahc_cmd_internal, end)
541 > offsetof(struct scsi_cmnd, host_scribble)) {
542 printf("ahc_linux_detect: SCSI data structures changed.\n");
543 printf("ahc_linux_detect: Unable to attach\n");
544 return (0);
545 }
546 /*
547 * If we've been passed any parameters, process them now. 488 * If we've been passed any parameters, process them now.
548 */ 489 */
549 if (aic7xxx) 490 if (aic7xxx)
@@ -611,7 +552,7 @@ static int
611ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) 552ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
612{ 553{
613 struct ahc_softc *ahc; 554 struct ahc_softc *ahc;
614 struct ahc_linux_device *dev; 555 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device);
615 556
616 ahc = *(struct ahc_softc **)cmd->device->host->hostdata; 557 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
617 558
@@ -629,132 +570,177 @@ ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
629 if (ahc->platform_data->qfrozen != 0) 570 if (ahc->platform_data->qfrozen != 0)
630 return SCSI_MLQUEUE_HOST_BUSY; 571 return SCSI_MLQUEUE_HOST_BUSY;
631 572
632 dev = ahc_linux_get_device(ahc, cmd->device->channel, cmd->device->id,
633 cmd->device->lun);
634 BUG_ON(dev == NULL);
635
636 cmd->result = CAM_REQ_INPROG << 16; 573 cmd->result = CAM_REQ_INPROG << 16;
637 574
638 return ahc_linux_run_command(ahc, dev, cmd); 575 return ahc_linux_run_command(ahc, dev, cmd);
639} 576}
640 577
641static int 578static inline struct scsi_target **
642ahc_linux_slave_alloc(struct scsi_device *device) 579ahc_linux_target_in_softc(struct scsi_target *starget)
643{ 580{
644 struct ahc_softc *ahc; 581 struct ahc_softc *ahc =
645 struct ahc_linux_target *targ; 582 *((struct ahc_softc **)dev_to_shost(&starget->dev)->hostdata);
646 struct scsi_target *starget = device->sdev_target;
647 struct ahc_linux_device *dev;
648 unsigned int target_offset; 583 unsigned int target_offset;
584
585 target_offset = starget->id;
586 if (starget->channel != 0)
587 target_offset += 8;
588
589 return &ahc->platform_data->starget[target_offset];
590}
591
592static int
593ahc_linux_target_alloc(struct scsi_target *starget)
594{
595 struct ahc_softc *ahc =
596 *((struct ahc_softc **)dev_to_shost(&starget->dev)->hostdata);
597 struct seeprom_config *sc = ahc->seep_config;
649 unsigned long flags; 598 unsigned long flags;
650 int retval = -ENOMEM; 599 struct scsi_target **ahc_targp = ahc_linux_target_in_softc(starget);
600 struct ahc_linux_target *targ = scsi_transport_target_data(starget);
601 unsigned short scsirate;
602 struct ahc_devinfo devinfo;
603 struct ahc_initiator_tinfo *tinfo;
604 struct ahc_tmode_tstate *tstate;
605 char channel = starget->channel + 'A';
606 unsigned int our_id = ahc->our_id;
607 unsigned int target_offset;
651 608
652 target_offset = starget->id; 609 target_offset = starget->id;
653 if (starget->channel != 0) 610 if (starget->channel != 0)
654 target_offset += 8; 611 target_offset += 8;
612
613 if (starget->channel)
614 our_id = ahc->our_id_b;
655 615
656 ahc = *((struct ahc_softc **)device->host->hostdata);
657 if (bootverbose)
658 printf("%s: Slave Alloc %d\n", ahc_name(ahc), device->id);
659 ahc_lock(ahc, &flags); 616 ahc_lock(ahc, &flags);
660 targ = ahc->platform_data->targets[target_offset];
661 if (targ == NULL) {
662 struct seeprom_config *sc;
663 617
664 targ = ahc_linux_alloc_target(ahc, starget->channel, 618 BUG_ON(*ahc_targp != NULL);
665 starget->id);
666 sc = ahc->seep_config;
667 if (targ == NULL)
668 goto out;
669 619
670 if (sc) { 620 *ahc_targp = starget;
671 unsigned short scsirate; 621 memset(targ, 0, sizeof(*targ));
672 struct ahc_devinfo devinfo;
673 struct ahc_initiator_tinfo *tinfo;
674 struct ahc_tmode_tstate *tstate;
675 char channel = starget->channel + 'A';
676 unsigned int our_id = ahc->our_id;
677
678 if (starget->channel)
679 our_id = ahc->our_id_b;
680 622
681 if ((ahc->features & AHC_ULTRA2) != 0) { 623 if (sc) {
682 scsirate = sc->device_flags[target_offset] & CFXFER; 624 int maxsync = AHC_SYNCRATE_DT;
683 } else { 625 int ultra = 0;
684 scsirate = (sc->device_flags[target_offset] & CFXFER) << 4; 626 int flags = sc->device_flags[target_offset];
685 if (sc->device_flags[target_offset] & CFSYNCH) 627
686 scsirate |= SOFS; 628 if (ahc->flags & AHC_NEWEEPROM_FMT) {
687 } 629 if (flags & CFSYNCHISULTRA)
688 if (sc->device_flags[target_offset] & CFWIDEB) { 630 ultra = 1;
689 scsirate |= WIDEXFER; 631 } else if (flags & CFULTRAEN)
690 spi_max_width(starget) = 1; 632 ultra = 1;
691 } else 633 /* AIC nutcase; 10MHz appears as ultra = 1, CFXFER = 0x04
692 spi_max_width(starget) = 0; 634 * change it to ultra=0, CFXFER = 0 */
693 spi_min_period(starget) = 635 if(ultra && (flags & CFXFER) == 0x04) {
694 ahc_find_period(ahc, scsirate, AHC_SYNCRATE_DT); 636 ultra = 0;
695 tinfo = ahc_fetch_transinfo(ahc, channel, ahc->our_id, 637 flags &= ~CFXFER;
696 targ->target, &tstate);
697 ahc_compile_devinfo(&devinfo, our_id, targ->target,
698 CAM_LUN_WILDCARD, channel,
699 ROLE_INITIATOR);
700 ahc_set_syncrate(ahc, &devinfo, NULL, 0, 0, 0,
701 AHC_TRANS_GOAL, /*paused*/FALSE);
702 ahc_set_width(ahc, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
703 AHC_TRANS_GOAL, /*paused*/FALSE);
704 } 638 }
705 639
706 } 640 if ((ahc->features & AHC_ULTRA2) != 0) {
707 dev = targ->devices[device->lun]; 641 scsirate = (flags & CFXFER) | (ultra ? 0x8 : 0);
708 if (dev == NULL) { 642 } else {
709 dev = ahc_linux_alloc_device(ahc, targ, device->lun); 643 scsirate = (flags & CFXFER) << 4;
710 if (dev == NULL) 644 maxsync = ultra ? AHC_SYNCRATE_ULTRA :
711 goto out; 645 AHC_SYNCRATE_FAST;
646 }
647 spi_max_width(starget) = (flags & CFWIDEB) ? 1 : 0;
648 if (!(flags & CFSYNCH))
649 spi_max_offset(starget) = 0;
650 spi_min_period(starget) =
651 ahc_find_period(ahc, scsirate, maxsync);
652
653 tinfo = ahc_fetch_transinfo(ahc, channel, ahc->our_id,
654 starget->id, &tstate);
712 } 655 }
713 retval = 0; 656 ahc_compile_devinfo(&devinfo, our_id, starget->id,
714 657 CAM_LUN_WILDCARD, channel,
715 out: 658 ROLE_INITIATOR);
659 ahc_set_syncrate(ahc, &devinfo, NULL, 0, 0, 0,
660 AHC_TRANS_GOAL, /*paused*/FALSE);
661 ahc_set_width(ahc, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
662 AHC_TRANS_GOAL, /*paused*/FALSE);
716 ahc_unlock(ahc, &flags); 663 ahc_unlock(ahc, &flags);
717 return retval; 664
665 return 0;
666}
667
668static void
669ahc_linux_target_destroy(struct scsi_target *starget)
670{
671 struct scsi_target **ahc_targp = ahc_linux_target_in_softc(starget);
672
673 *ahc_targp = NULL;
718} 674}
719 675
720static int 676static int
721ahc_linux_slave_configure(struct scsi_device *device) 677ahc_linux_slave_alloc(struct scsi_device *sdev)
678{
679 struct ahc_softc *ahc =
680 *((struct ahc_softc **)sdev->host->hostdata);
681 struct scsi_target *starget = sdev->sdev_target;
682 struct ahc_linux_target *targ = scsi_transport_target_data(starget);
683 struct ahc_linux_device *dev;
684
685 if (bootverbose)
686 printf("%s: Slave Alloc %d\n", ahc_name(ahc), sdev->id);
687
688 BUG_ON(targ->sdev[sdev->lun] != NULL);
689
690 dev = scsi_transport_device_data(sdev);
691 memset(dev, 0, sizeof(*dev));
692
693 /*
694 * We start out life using untagged
695 * transactions of which we allow one.
696 */
697 dev->openings = 1;
698
699 /*
700 * Set maxtags to 0. This will be changed if we
701 * later determine that we are dealing with
702 * a tagged queuing capable device.
703 */
704 dev->maxtags = 0;
705
706 targ->sdev[sdev->lun] = sdev;
707
708 return 0;
709}
710
711static int
712ahc_linux_slave_configure(struct scsi_device *sdev)
722{ 713{
723 struct ahc_softc *ahc; 714 struct ahc_softc *ahc;
724 struct ahc_linux_device *dev;
725 715
726 ahc = *((struct ahc_softc **)device->host->hostdata); 716 ahc = *((struct ahc_softc **)sdev->host->hostdata);
727 717
728 if (bootverbose) 718 if (bootverbose)
729 printf("%s: Slave Configure %d\n", ahc_name(ahc), device->id); 719 printf("%s: Slave Configure %d\n", ahc_name(ahc), sdev->id);
730 720
731 dev = ahc_linux_get_device(ahc, device->channel, device->id, 721 ahc_linux_device_queue_depth(sdev);
732 device->lun);
733 dev->scsi_device = device;
734 ahc_linux_device_queue_depth(ahc, dev);
735 722
736 /* Initial Domain Validation */ 723 /* Initial Domain Validation */
737 if (!spi_initial_dv(device->sdev_target)) 724 if (!spi_initial_dv(sdev->sdev_target))
738 spi_dv_device(device); 725 spi_dv_device(sdev);
739 726
740 return 0; 727 return 0;
741} 728}
742 729
743static void 730static void
744ahc_linux_slave_destroy(struct scsi_device *device) 731ahc_linux_slave_destroy(struct scsi_device *sdev)
745{ 732{
746 struct ahc_softc *ahc; 733 struct ahc_softc *ahc;
747 struct ahc_linux_device *dev; 734 struct ahc_linux_device *dev = scsi_transport_device_data(sdev);
735 struct ahc_linux_target *targ = scsi_transport_target_data(sdev->sdev_target);
748 736
749 ahc = *((struct ahc_softc **)device->host->hostdata); 737 ahc = *((struct ahc_softc **)sdev->host->hostdata);
750 if (bootverbose) 738 if (bootverbose)
751 printf("%s: Slave Destroy %d\n", ahc_name(ahc), device->id); 739 printf("%s: Slave Destroy %d\n", ahc_name(ahc), sdev->id);
752 dev = ahc_linux_get_device(ahc, device->channel,
753 device->id, device->lun);
754 740
755 BUG_ON(dev->active); 741 BUG_ON(dev->active);
756 742
757 ahc_linux_free_device(ahc, dev); 743 targ->sdev[sdev->lun] = NULL;
758} 744}
759 745
760#if defined(__i386__) 746#if defined(__i386__)
@@ -843,10 +829,14 @@ ahc_linux_bus_reset(struct scsi_cmnd *cmd)
843{ 829{
844 struct ahc_softc *ahc; 830 struct ahc_softc *ahc;
845 int found; 831 int found;
832 unsigned long flags;
846 833
847 ahc = *(struct ahc_softc **)cmd->device->host->hostdata; 834 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
835
836 ahc_lock(ahc, &flags);
848 found = ahc_reset_channel(ahc, cmd->device->channel + 'A', 837 found = ahc_reset_channel(ahc, cmd->device->channel + 'A',
849 /*initiate reset*/TRUE); 838 /*initiate reset*/TRUE);
839 ahc_unlock(ahc, &flags);
850 840
851 if (bootverbose) 841 if (bootverbose)
852 printf("%s: SCSI bus reset delivered. " 842 printf("%s: SCSI bus reset delivered. "
@@ -874,6 +864,8 @@ struct scsi_host_template aic7xxx_driver_template = {
874 .slave_alloc = ahc_linux_slave_alloc, 864 .slave_alloc = ahc_linux_slave_alloc,
875 .slave_configure = ahc_linux_slave_configure, 865 .slave_configure = ahc_linux_slave_configure,
876 .slave_destroy = ahc_linux_slave_destroy, 866 .slave_destroy = ahc_linux_slave_destroy,
867 .target_alloc = ahc_linux_target_alloc,
868 .target_destroy = ahc_linux_target_destroy,
877}; 869};
878 870
879/**************************** Tasklet Handler *********************************/ 871/**************************** Tasklet Handler *********************************/
@@ -1112,8 +1104,6 @@ aic7xxx_setup(char *s)
1112 { "debug", &ahc_debug }, 1104 { "debug", &ahc_debug },
1113#endif 1105#endif
1114 { "reverse_scan", &aic7xxx_reverse_scan }, 1106 { "reverse_scan", &aic7xxx_reverse_scan },
1115 { "no_probe", &aic7xxx_probe_eisa_vl },
1116 { "probe_eisa_vl", &aic7xxx_probe_eisa_vl },
1117 { "periodic_otag", &aic7xxx_periodic_otag }, 1107 { "periodic_otag", &aic7xxx_periodic_otag },
1118 { "pci_parity", &aic7xxx_pci_parity }, 1108 { "pci_parity", &aic7xxx_pci_parity },
1119 { "seltime", &aic7xxx_seltime }, 1109 { "seltime", &aic7xxx_seltime },
@@ -1335,8 +1325,7 @@ ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg)
1335void 1325void
1336ahc_platform_free(struct ahc_softc *ahc) 1326ahc_platform_free(struct ahc_softc *ahc)
1337{ 1327{
1338 struct ahc_linux_target *targ; 1328 struct scsi_target *starget;
1339 struct ahc_linux_device *dev;
1340 int i, j; 1329 int i, j;
1341 1330
1342 if (ahc->platform_data != NULL) { 1331 if (ahc->platform_data != NULL) {
@@ -1347,22 +1336,17 @@ ahc_platform_free(struct ahc_softc *ahc)
1347 1336
1348 /* destroy all of the device and target objects */ 1337 /* destroy all of the device and target objects */
1349 for (i = 0; i < AHC_NUM_TARGETS; i++) { 1338 for (i = 0; i < AHC_NUM_TARGETS; i++) {
1350 targ = ahc->platform_data->targets[i]; 1339 starget = ahc->platform_data->starget[i];
1351 if (targ != NULL) { 1340 if (starget != NULL) {
1352 /* Keep target around through the loop. */
1353 targ->refcount++;
1354 for (j = 0; j < AHC_NUM_LUNS; j++) { 1341 for (j = 0; j < AHC_NUM_LUNS; j++) {
1342 struct ahc_linux_target *targ =
1343 scsi_transport_target_data(starget);
1355 1344
1356 if (targ->devices[j] == NULL) 1345 if (targ->sdev[j] == NULL)
1357 continue; 1346 continue;
1358 dev = targ->devices[j]; 1347 targ->sdev[j] = NULL;
1359 ahc_linux_free_device(ahc, dev);
1360 } 1348 }
1361 /* 1349 ahc->platform_data->starget[i] = NULL;
1362 * Forcibly free the target now that
1363 * all devices are gone.
1364 */
1365 ahc_linux_free_target(ahc, targ);
1366 } 1350 }
1367 } 1351 }
1368 1352
@@ -1395,15 +1379,25 @@ void
1395ahc_platform_set_tags(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, 1379ahc_platform_set_tags(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
1396 ahc_queue_alg alg) 1380 ahc_queue_alg alg)
1397{ 1381{
1382 struct scsi_target *starget;
1383 struct ahc_linux_target *targ;
1398 struct ahc_linux_device *dev; 1384 struct ahc_linux_device *dev;
1385 struct scsi_device *sdev;
1386 u_int target_offset;
1399 int was_queuing; 1387 int was_queuing;
1400 int now_queuing; 1388 int now_queuing;
1401 1389
1402 dev = ahc_linux_get_device(ahc, devinfo->channel - 'A', 1390 target_offset = devinfo->target;
1403 devinfo->target, 1391 if (devinfo->channel != 'A')
1404 devinfo->lun); 1392 target_offset += 8;
1405 if (dev == NULL) 1393 starget = ahc->platform_data->starget[target_offset];
1394 targ = scsi_transport_target_data(starget);
1395 BUG_ON(targ == NULL);
1396 sdev = targ->sdev[devinfo->lun];
1397 if (sdev == NULL)
1406 return; 1398 return;
1399 dev = scsi_transport_device_data(sdev);
1400
1407 was_queuing = dev->flags & (AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED); 1401 was_queuing = dev->flags & (AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED);
1408 switch (alg) { 1402 switch (alg) {
1409 default: 1403 default:
@@ -1454,30 +1448,28 @@ ahc_platform_set_tags(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
1454 dev->maxtags = 0; 1448 dev->maxtags = 0;
1455 dev->openings = 1 - dev->active; 1449 dev->openings = 1 - dev->active;
1456 } 1450 }
1457 if (dev->scsi_device != NULL) { 1451 switch ((dev->flags & (AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED))) {
1458 switch ((dev->flags & (AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED))) { 1452 case AHC_DEV_Q_BASIC:
1459 case AHC_DEV_Q_BASIC: 1453 scsi_adjust_queue_depth(sdev,
1460 scsi_adjust_queue_depth(dev->scsi_device, 1454 MSG_SIMPLE_TASK,
1461 MSG_SIMPLE_TASK, 1455 dev->openings + dev->active);
1462 dev->openings + dev->active); 1456 break;
1463 break; 1457 case AHC_DEV_Q_TAGGED:
1464 case AHC_DEV_Q_TAGGED: 1458 scsi_adjust_queue_depth(sdev,
1465 scsi_adjust_queue_depth(dev->scsi_device, 1459 MSG_ORDERED_TASK,
1466 MSG_ORDERED_TASK, 1460 dev->openings + dev->active);
1467 dev->openings + dev->active); 1461 break;
1468 break; 1462 default:
1469 default: 1463 /*
1470 /* 1464 * We allow the OS to queue 2 untagged transactions to
1471 * We allow the OS to queue 2 untagged transactions to 1465 * us at any time even though we can only execute them
1472 * us at any time even though we can only execute them 1466 * serially on the controller/device. This should
1473 * serially on the controller/device. This should 1467 * remove some latency.
1474 * remove some latency. 1468 */
1475 */ 1469 scsi_adjust_queue_depth(sdev,
1476 scsi_adjust_queue_depth(dev->scsi_device, 1470 /*NON-TAGGED*/0,
1477 /*NON-TAGGED*/0, 1471 /*queue depth*/2);
1478 /*queue depth*/2); 1472 break;
1479 break;
1480 }
1481 } 1473 }
1482} 1474}
1483 1475
@@ -1523,22 +1515,20 @@ ahc_linux_user_tagdepth(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
1523 * Determines the queue depth for a given device. 1515 * Determines the queue depth for a given device.
1524 */ 1516 */
1525static void 1517static void
1526ahc_linux_device_queue_depth(struct ahc_softc *ahc, 1518ahc_linux_device_queue_depth(struct scsi_device *sdev)
1527 struct ahc_linux_device *dev)
1528{ 1519{
1529 struct ahc_devinfo devinfo; 1520 struct ahc_devinfo devinfo;
1530 u_int tags; 1521 u_int tags;
1522 struct ahc_softc *ahc = *((struct ahc_softc **)sdev->host->hostdata);
1531 1523
1532 ahc_compile_devinfo(&devinfo, 1524 ahc_compile_devinfo(&devinfo,
1533 dev->target->channel == 0 1525 sdev->sdev_target->channel == 0
1534 ? ahc->our_id : ahc->our_id_b, 1526 ? ahc->our_id : ahc->our_id_b,
1535 dev->target->target, dev->lun, 1527 sdev->sdev_target->id, sdev->lun,
1536 dev->target->channel == 0 ? 'A' : 'B', 1528 sdev->sdev_target->channel == 0 ? 'A' : 'B',
1537 ROLE_INITIATOR); 1529 ROLE_INITIATOR);
1538 tags = ahc_linux_user_tagdepth(ahc, &devinfo); 1530 tags = ahc_linux_user_tagdepth(ahc, &devinfo);
1539 if (tags != 0 1531 if (tags != 0 && sdev->tagged_supported != 0) {
1540 && dev->scsi_device != NULL
1541 && dev->scsi_device->tagged_supported != 0) {
1542 1532
1543 ahc_set_tags(ahc, &devinfo, AHC_QUEUE_TAGGED); 1533 ahc_set_tags(ahc, &devinfo, AHC_QUEUE_TAGGED);
1544 ahc_print_devinfo(ahc, &devinfo); 1534 ahc_print_devinfo(ahc, &devinfo);
@@ -1587,10 +1577,9 @@ ahc_linux_run_command(struct ahc_softc *ahc, struct ahc_linux_device *dev,
1587 /* 1577 /*
1588 * Get an scb to use. 1578 * Get an scb to use.
1589 */ 1579 */
1590 if ((scb = ahc_get_scb(ahc)) == NULL) { 1580 scb = ahc_get_scb(ahc);
1591 ahc->flags |= AHC_RESOURCE_SHORTAGE; 1581 if (!scb)
1592 return SCSI_MLQUEUE_HOST_BUSY; 1582 return SCSI_MLQUEUE_HOST_BUSY;
1593 }
1594 1583
1595 scb->io_ctx = cmd; 1584 scb->io_ctx = cmd;
1596 scb->platform_data->dev = dev; 1585 scb->platform_data->dev = dev;
@@ -1767,106 +1756,6 @@ ahc_platform_flushwork(struct ahc_softc *ahc)
1767 1756
1768} 1757}
1769 1758
1770static struct ahc_linux_target*
1771ahc_linux_alloc_target(struct ahc_softc *ahc, u_int channel, u_int target)
1772{
1773 struct ahc_linux_target *targ;
1774 u_int target_offset;
1775
1776 target_offset = target;
1777 if (channel != 0)
1778 target_offset += 8;
1779
1780 targ = malloc(sizeof(*targ), M_DEVBUG, M_NOWAIT);
1781 if (targ == NULL)
1782 return (NULL);
1783 memset(targ, 0, sizeof(*targ));
1784 targ->channel = channel;
1785 targ->target = target;
1786 targ->ahc = ahc;
1787 ahc->platform_data->targets[target_offset] = targ;
1788 return (targ);
1789}
1790
1791static void
1792ahc_linux_free_target(struct ahc_softc *ahc, struct ahc_linux_target *targ)
1793{
1794 struct ahc_devinfo devinfo;
1795 struct ahc_initiator_tinfo *tinfo;
1796 struct ahc_tmode_tstate *tstate;
1797 u_int our_id;
1798 u_int target_offset;
1799 char channel;
1800
1801 /*
1802 * Force a negotiation to async/narrow on any
1803 * future command to this device unless a bus
1804 * reset occurs between now and that command.
1805 */
1806 channel = 'A' + targ->channel;
1807 our_id = ahc->our_id;
1808 target_offset = targ->target;
1809 if (targ->channel != 0) {
1810 target_offset += 8;
1811 our_id = ahc->our_id_b;
1812 }
1813 tinfo = ahc_fetch_transinfo(ahc, channel, our_id,
1814 targ->target, &tstate);
1815 ahc_compile_devinfo(&devinfo, our_id, targ->target, CAM_LUN_WILDCARD,
1816 channel, ROLE_INITIATOR);
1817 ahc_set_syncrate(ahc, &devinfo, NULL, 0, 0, 0,
1818 AHC_TRANS_GOAL, /*paused*/FALSE);
1819 ahc_set_width(ahc, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
1820 AHC_TRANS_GOAL, /*paused*/FALSE);
1821 ahc_update_neg_request(ahc, &devinfo, tstate, tinfo, AHC_NEG_ALWAYS);
1822 ahc->platform_data->targets[target_offset] = NULL;
1823 free(targ, M_DEVBUF);
1824}
1825
1826static struct ahc_linux_device*
1827ahc_linux_alloc_device(struct ahc_softc *ahc,
1828 struct ahc_linux_target *targ, u_int lun)
1829{
1830 struct ahc_linux_device *dev;
1831
1832 dev = malloc(sizeof(*dev), M_DEVBUG, M_NOWAIT);
1833 if (dev == NULL)
1834 return (NULL);
1835 memset(dev, 0, sizeof(*dev));
1836 dev->lun = lun;
1837 dev->target = targ;
1838
1839 /*
1840 * We start out life using untagged
1841 * transactions of which we allow one.
1842 */
1843 dev->openings = 1;
1844
1845 /*
1846 * Set maxtags to 0. This will be changed if we
1847 * later determine that we are dealing with
1848 * a tagged queuing capable device.
1849 */
1850 dev->maxtags = 0;
1851
1852 targ->refcount++;
1853 targ->devices[lun] = dev;
1854 return (dev);
1855}
1856
1857static void
1858ahc_linux_free_device(struct ahc_softc *ahc, struct ahc_linux_device *dev)
1859{
1860 struct ahc_linux_target *targ;
1861
1862 targ = dev->target;
1863 targ->devices[dev->lun] = NULL;
1864 free(dev, M_DEVBUF);
1865 targ->refcount--;
1866 if (targ->refcount == 0)
1867 ahc_linux_free_target(ahc, targ);
1868}
1869
1870void 1759void
1871ahc_send_async(struct ahc_softc *ahc, char channel, 1760ahc_send_async(struct ahc_softc *ahc, char channel,
1872 u_int target, u_int lun, ac_code code, void *arg) 1761 u_int target, u_int lun, ac_code code, void *arg)
@@ -1875,11 +1764,15 @@ ahc_send_async(struct ahc_softc *ahc, char channel,
1875 case AC_TRANSFER_NEG: 1764 case AC_TRANSFER_NEG:
1876 { 1765 {
1877 char buf[80]; 1766 char buf[80];
1767 struct scsi_target *starget;
1878 struct ahc_linux_target *targ; 1768 struct ahc_linux_target *targ;
1879 struct info_str info; 1769 struct info_str info;
1880 struct ahc_initiator_tinfo *tinfo; 1770 struct ahc_initiator_tinfo *tinfo;
1881 struct ahc_tmode_tstate *tstate; 1771 struct ahc_tmode_tstate *tstate;
1882 int target_offset; 1772 int target_offset;
1773 unsigned int target_ppr_options;
1774
1775 BUG_ON(target == CAM_TARGET_WILDCARD);
1883 1776
1884 info.buffer = buf; 1777 info.buffer = buf;
1885 info.length = sizeof(buf); 1778 info.length = sizeof(buf);
@@ -1908,32 +1801,30 @@ ahc_send_async(struct ahc_softc *ahc, char channel,
1908 target_offset = target; 1801 target_offset = target;
1909 if (channel == 'B') 1802 if (channel == 'B')
1910 target_offset += 8; 1803 target_offset += 8;
1911 targ = ahc->platform_data->targets[target_offset]; 1804 starget = ahc->platform_data->starget[target_offset];
1805 targ = scsi_transport_target_data(starget);
1912 if (targ == NULL) 1806 if (targ == NULL)
1913 break; 1807 break;
1914 if (tinfo->curr.period == targ->last_tinfo.period 1808
1915 && tinfo->curr.width == targ->last_tinfo.width 1809 target_ppr_options =
1916 && tinfo->curr.offset == targ->last_tinfo.offset 1810 (spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0)
1917 && tinfo->curr.ppr_options == targ->last_tinfo.ppr_options) 1811 + (spi_qas(starget) ? MSG_EXT_PPR_QAS_REQ : 0)
1812 + (spi_iu(starget) ? MSG_EXT_PPR_IU_REQ : 0);
1813
1814 if (tinfo->curr.period == spi_period(starget)
1815 && tinfo->curr.width == spi_width(starget)
1816 && tinfo->curr.offset == spi_offset(starget)
1817 && tinfo->curr.ppr_options == target_ppr_options)
1918 if (bootverbose == 0) 1818 if (bootverbose == 0)
1919 break; 1819 break;
1920 1820
1921 targ->last_tinfo.period = tinfo->curr.period; 1821 spi_period(starget) = tinfo->curr.period;
1922 targ->last_tinfo.width = tinfo->curr.width; 1822 spi_width(starget) = tinfo->curr.width;
1923 targ->last_tinfo.offset = tinfo->curr.offset; 1823 spi_offset(starget) = tinfo->curr.offset;
1924 targ->last_tinfo.ppr_options = tinfo->curr.ppr_options; 1824 spi_dt(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_DT_REQ;
1925 1825 spi_qas(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_QAS_REQ;
1926 printf("(%s:%c:", ahc_name(ahc), channel); 1826 spi_iu(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_IU_REQ;
1927 if (target == CAM_TARGET_WILDCARD) 1827 spi_display_xfer_agreement(starget);
1928 printf("*): ");
1929 else
1930 printf("%d): ", target);
1931 ahc_format_transinfo(&info, &tinfo->curr);
1932 if (info.pos < info.length)
1933 *info.buffer = '\0';
1934 else
1935 buf[info.length - 1] = '\0';
1936 printf("%s", buf);
1937 break; 1828 break;
1938 } 1829 }
1939 case AC_SENT_BDR: 1830 case AC_SENT_BDR:
@@ -2038,7 +1929,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
2038 ahc_set_transaction_status(scb, CAM_REQ_CMP); 1929 ahc_set_transaction_status(scb, CAM_REQ_CMP);
2039 } 1930 }
2040 } else if (ahc_get_transaction_status(scb) == CAM_SCSI_STATUS_ERROR) { 1931 } else if (ahc_get_transaction_status(scb) == CAM_SCSI_STATUS_ERROR) {
2041 ahc_linux_handle_scsi_status(ahc, dev, scb); 1932 ahc_linux_handle_scsi_status(ahc, cmd->device, scb);
2042 } 1933 }
2043 1934
2044 if (dev->openings == 1 1935 if (dev->openings == 1
@@ -2077,14 +1968,15 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
2077 1968
2078static void 1969static void
2079ahc_linux_handle_scsi_status(struct ahc_softc *ahc, 1970ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
2080 struct ahc_linux_device *dev, struct scb *scb) 1971 struct scsi_device *sdev, struct scb *scb)
2081{ 1972{
2082 struct ahc_devinfo devinfo; 1973 struct ahc_devinfo devinfo;
1974 struct ahc_linux_device *dev = scsi_transport_device_data(sdev);
2083 1975
2084 ahc_compile_devinfo(&devinfo, 1976 ahc_compile_devinfo(&devinfo,
2085 ahc->our_id, 1977 ahc->our_id,
2086 dev->target->target, dev->lun, 1978 sdev->sdev_target->id, sdev->lun,
2087 dev->target->channel == 0 ? 'A' : 'B', 1979 sdev->sdev_target->channel == 0 ? 'A' : 'B',
2088 ROLE_INITIATOR); 1980 ROLE_INITIATOR);
2089 1981
2090 /* 1982 /*
@@ -2361,6 +2253,8 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2361 printf(" 0x%x", cmd->cmnd[cdb_byte]); 2253 printf(" 0x%x", cmd->cmnd[cdb_byte]);
2362 printf("\n"); 2254 printf("\n");
2363 2255
2256 spin_lock_irq(&ahc->platform_data->spin_lock);
2257
2364 /* 2258 /*
2365 * First determine if we currently own this command. 2259 * First determine if we currently own this command.
2366 * Start by searching the device queue. If not found 2260 * Start by searching the device queue. If not found
@@ -2368,8 +2262,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2368 * at all, and the system wanted us to just abort the 2262 * at all, and the system wanted us to just abort the
2369 * command, return success. 2263 * command, return success.
2370 */ 2264 */
2371 dev = ahc_linux_get_device(ahc, cmd->device->channel, cmd->device->id, 2265 dev = scsi_transport_device_data(cmd->device);
2372 cmd->device->lun);
2373 2266
2374 if (dev == NULL) { 2267 if (dev == NULL) {
2375 /* 2268 /*
@@ -2616,6 +2509,8 @@ done:
2616 } 2509 }
2617 spin_lock_irq(&ahc->platform_data->spin_lock); 2510 spin_lock_irq(&ahc->platform_data->spin_lock);
2618 } 2511 }
2512
2513 spin_unlock_irq(&ahc->platform_data->spin_lock);
2619 return (retval); 2514 return (retval);
2620} 2515}
2621 2516
@@ -2626,18 +2521,6 @@ ahc_platform_dump_card_state(struct ahc_softc *ahc)
2626 2521
2627static void ahc_linux_exit(void); 2522static void ahc_linux_exit(void);
2628 2523
2629static void ahc_linux_get_width(struct scsi_target *starget)
2630{
2631 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
2632 struct ahc_softc *ahc = *((struct ahc_softc **)shost->hostdata);
2633 struct ahc_tmode_tstate *tstate;
2634 struct ahc_initiator_tinfo *tinfo
2635 = ahc_fetch_transinfo(ahc,
2636 starget->channel + 'A',
2637 shost->this_id, starget->id, &tstate);
2638 spi_width(starget) = tinfo->curr.width;
2639}
2640
2641static void ahc_linux_set_width(struct scsi_target *starget, int width) 2524static void ahc_linux_set_width(struct scsi_target *starget, int width)
2642{ 2525{
2643 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 2526 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
@@ -2652,18 +2535,6 @@ static void ahc_linux_set_width(struct scsi_target *starget, int width)
2652 ahc_unlock(ahc, &flags); 2535 ahc_unlock(ahc, &flags);
2653} 2536}
2654 2537
2655static void ahc_linux_get_period(struct scsi_target *starget)
2656{
2657 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
2658 struct ahc_softc *ahc = *((struct ahc_softc **)shost->hostdata);
2659 struct ahc_tmode_tstate *tstate;
2660 struct ahc_initiator_tinfo *tinfo
2661 = ahc_fetch_transinfo(ahc,
2662 starget->channel + 'A',
2663 shost->this_id, starget->id, &tstate);
2664 spi_period(starget) = tinfo->curr.period;
2665}
2666
2667static void ahc_linux_set_period(struct scsi_target *starget, int period) 2538static void ahc_linux_set_period(struct scsi_target *starget, int period)
2668{ 2539{
2669 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 2540 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
@@ -2674,9 +2545,9 @@ static void ahc_linux_set_period(struct scsi_target *starget, int period)
2674 starget->channel + 'A', 2545 starget->channel + 'A',
2675 shost->this_id, starget->id, &tstate); 2546 shost->this_id, starget->id, &tstate);
2676 struct ahc_devinfo devinfo; 2547 struct ahc_devinfo devinfo;
2677 unsigned int ppr_options = tinfo->curr.ppr_options; 2548 unsigned int ppr_options = tinfo->goal.ppr_options;
2678 unsigned long flags; 2549 unsigned long flags;
2679 unsigned long offset = tinfo->curr.offset; 2550 unsigned long offset = tinfo->goal.offset;
2680 struct ahc_syncrate *syncrate; 2551 struct ahc_syncrate *syncrate;
2681 2552
2682 if (offset == 0) 2553 if (offset == 0)
@@ -2692,7 +2563,6 @@ static void ahc_linux_set_period(struct scsi_target *starget, int period)
2692 2563
2693 /* all PPR requests apart from QAS require wide transfers */ 2564 /* all PPR requests apart from QAS require wide transfers */
2694 if (ppr_options & ~MSG_EXT_PPR_QAS_REQ) { 2565 if (ppr_options & ~MSG_EXT_PPR_QAS_REQ) {
2695 ahc_linux_get_width(starget);
2696 if (spi_width(starget) == 0) 2566 if (spi_width(starget) == 0)
2697 ppr_options &= MSG_EXT_PPR_QAS_REQ; 2567 ppr_options &= MSG_EXT_PPR_QAS_REQ;
2698 } 2568 }
@@ -2704,18 +2574,6 @@ static void ahc_linux_set_period(struct scsi_target *starget, int period)
2704 ahc_unlock(ahc, &flags); 2574 ahc_unlock(ahc, &flags);
2705} 2575}
2706 2576
2707static void ahc_linux_get_offset(struct scsi_target *starget)
2708{
2709 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
2710 struct ahc_softc *ahc = *((struct ahc_softc **)shost->hostdata);
2711 struct ahc_tmode_tstate *tstate;
2712 struct ahc_initiator_tinfo *tinfo
2713 = ahc_fetch_transinfo(ahc,
2714 starget->channel + 'A',
2715 shost->this_id, starget->id, &tstate);
2716 spi_offset(starget) = tinfo->curr.offset;
2717}
2718
2719static void ahc_linux_set_offset(struct scsi_target *starget, int offset) 2577static void ahc_linux_set_offset(struct scsi_target *starget, int offset)
2720{ 2578{
2721 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 2579 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
@@ -2735,8 +2593,8 @@ static void ahc_linux_set_offset(struct scsi_target *starget, int offset)
2735 starget->channel + 'A', ROLE_INITIATOR); 2593 starget->channel + 'A', ROLE_INITIATOR);
2736 if (offset != 0) { 2594 if (offset != 0) {
2737 syncrate = ahc_find_syncrate(ahc, &period, &ppr_options, AHC_SYNCRATE_DT); 2595 syncrate = ahc_find_syncrate(ahc, &period, &ppr_options, AHC_SYNCRATE_DT);
2738 period = tinfo->curr.period; 2596 period = tinfo->goal.period;
2739 ppr_options = tinfo->curr.ppr_options; 2597 ppr_options = tinfo->goal.ppr_options;
2740 } 2598 }
2741 ahc_lock(ahc, &flags); 2599 ahc_lock(ahc, &flags);
2742 ahc_set_syncrate(ahc, &devinfo, syncrate, period, offset, 2600 ahc_set_syncrate(ahc, &devinfo, syncrate, period, offset,
@@ -2744,18 +2602,6 @@ static void ahc_linux_set_offset(struct scsi_target *starget, int offset)
2744 ahc_unlock(ahc, &flags); 2602 ahc_unlock(ahc, &flags);
2745} 2603}
2746 2604
2747static void ahc_linux_get_dt(struct scsi_target *starget)
2748{
2749 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
2750 struct ahc_softc *ahc = *((struct ahc_softc **)shost->hostdata);
2751 struct ahc_tmode_tstate *tstate;
2752 struct ahc_initiator_tinfo *tinfo
2753 = ahc_fetch_transinfo(ahc,
2754 starget->channel + 'A',
2755 shost->this_id, starget->id, &tstate);
2756 spi_dt(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_DT_REQ;
2757}
2758
2759static void ahc_linux_set_dt(struct scsi_target *starget, int dt) 2605static void ahc_linux_set_dt(struct scsi_target *starget, int dt)
2760{ 2606{
2761 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 2607 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
@@ -2766,9 +2612,9 @@ static void ahc_linux_set_dt(struct scsi_target *starget, int dt)
2766 starget->channel + 'A', 2612 starget->channel + 'A',
2767 shost->this_id, starget->id, &tstate); 2613 shost->this_id, starget->id, &tstate);
2768 struct ahc_devinfo devinfo; 2614 struct ahc_devinfo devinfo;
2769 unsigned int ppr_options = tinfo->curr.ppr_options 2615 unsigned int ppr_options = tinfo->goal.ppr_options
2770 & ~MSG_EXT_PPR_DT_REQ; 2616 & ~MSG_EXT_PPR_DT_REQ;
2771 unsigned int period = tinfo->curr.period; 2617 unsigned int period = tinfo->goal.period;
2772 unsigned long flags; 2618 unsigned long flags;
2773 struct ahc_syncrate *syncrate; 2619 struct ahc_syncrate *syncrate;
2774 2620
@@ -2782,23 +2628,11 @@ static void ahc_linux_set_dt(struct scsi_target *starget, int dt)
2782 starget->channel + 'A', ROLE_INITIATOR); 2628 starget->channel + 'A', ROLE_INITIATOR);
2783 syncrate = ahc_find_syncrate(ahc, &period, &ppr_options,AHC_SYNCRATE_DT); 2629 syncrate = ahc_find_syncrate(ahc, &period, &ppr_options,AHC_SYNCRATE_DT);
2784 ahc_lock(ahc, &flags); 2630 ahc_lock(ahc, &flags);
2785 ahc_set_syncrate(ahc, &devinfo, syncrate, period, tinfo->curr.offset, 2631 ahc_set_syncrate(ahc, &devinfo, syncrate, period, tinfo->goal.offset,
2786 ppr_options, AHC_TRANS_GOAL, FALSE); 2632 ppr_options, AHC_TRANS_GOAL, FALSE);
2787 ahc_unlock(ahc, &flags); 2633 ahc_unlock(ahc, &flags);
2788} 2634}
2789 2635
2790static void ahc_linux_get_qas(struct scsi_target *starget)
2791{
2792 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
2793 struct ahc_softc *ahc = *((struct ahc_softc **)shost->hostdata);
2794 struct ahc_tmode_tstate *tstate;
2795 struct ahc_initiator_tinfo *tinfo
2796 = ahc_fetch_transinfo(ahc,
2797 starget->channel + 'A',
2798 shost->this_id, starget->id, &tstate);
2799 spi_dt(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_QAS_REQ;
2800}
2801
2802static void ahc_linux_set_qas(struct scsi_target *starget, int qas) 2636static void ahc_linux_set_qas(struct scsi_target *starget, int qas)
2803{ 2637{
2804 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 2638 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
@@ -2809,9 +2643,9 @@ static void ahc_linux_set_qas(struct scsi_target *starget, int qas)
2809 starget->channel + 'A', 2643 starget->channel + 'A',
2810 shost->this_id, starget->id, &tstate); 2644 shost->this_id, starget->id, &tstate);
2811 struct ahc_devinfo devinfo; 2645 struct ahc_devinfo devinfo;
2812 unsigned int ppr_options = tinfo->curr.ppr_options 2646 unsigned int ppr_options = tinfo->goal.ppr_options
2813 & ~MSG_EXT_PPR_QAS_REQ; 2647 & ~MSG_EXT_PPR_QAS_REQ;
2814 unsigned int period = tinfo->curr.period; 2648 unsigned int period = tinfo->goal.period;
2815 unsigned long flags; 2649 unsigned long flags;
2816 struct ahc_syncrate *syncrate; 2650 struct ahc_syncrate *syncrate;
2817 2651
@@ -2822,23 +2656,11 @@ static void ahc_linux_set_qas(struct scsi_target *starget, int qas)
2822 starget->channel + 'A', ROLE_INITIATOR); 2656 starget->channel + 'A', ROLE_INITIATOR);
2823 syncrate = ahc_find_syncrate(ahc, &period, &ppr_options, AHC_SYNCRATE_DT); 2657 syncrate = ahc_find_syncrate(ahc, &period, &ppr_options, AHC_SYNCRATE_DT);
2824 ahc_lock(ahc, &flags); 2658 ahc_lock(ahc, &flags);
2825 ahc_set_syncrate(ahc, &devinfo, syncrate, period, tinfo->curr.offset, 2659 ahc_set_syncrate(ahc, &devinfo, syncrate, period, tinfo->goal.offset,
2826 ppr_options, AHC_TRANS_GOAL, FALSE); 2660 ppr_options, AHC_TRANS_GOAL, FALSE);
2827 ahc_unlock(ahc, &flags); 2661 ahc_unlock(ahc, &flags);
2828} 2662}
2829 2663
2830static void ahc_linux_get_iu(struct scsi_target *starget)
2831{
2832 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
2833 struct ahc_softc *ahc = *((struct ahc_softc **)shost->hostdata);
2834 struct ahc_tmode_tstate *tstate;
2835 struct ahc_initiator_tinfo *tinfo
2836 = ahc_fetch_transinfo(ahc,
2837 starget->channel + 'A',
2838 shost->this_id, starget->id, &tstate);
2839 spi_dt(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_IU_REQ;
2840}
2841
2842static void ahc_linux_set_iu(struct scsi_target *starget, int iu) 2664static void ahc_linux_set_iu(struct scsi_target *starget, int iu)
2843{ 2665{
2844 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 2666 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
@@ -2849,9 +2671,9 @@ static void ahc_linux_set_iu(struct scsi_target *starget, int iu)
2849 starget->channel + 'A', 2671 starget->channel + 'A',
2850 shost->this_id, starget->id, &tstate); 2672 shost->this_id, starget->id, &tstate);
2851 struct ahc_devinfo devinfo; 2673 struct ahc_devinfo devinfo;
2852 unsigned int ppr_options = tinfo->curr.ppr_options 2674 unsigned int ppr_options = tinfo->goal.ppr_options
2853 & ~MSG_EXT_PPR_IU_REQ; 2675 & ~MSG_EXT_PPR_IU_REQ;
2854 unsigned int period = tinfo->curr.period; 2676 unsigned int period = tinfo->goal.period;
2855 unsigned long flags; 2677 unsigned long flags;
2856 struct ahc_syncrate *syncrate; 2678 struct ahc_syncrate *syncrate;
2857 2679
@@ -2862,28 +2684,22 @@ static void ahc_linux_set_iu(struct scsi_target *starget, int iu)
2862 starget->channel + 'A', ROLE_INITIATOR); 2684 starget->channel + 'A', ROLE_INITIATOR);
2863 syncrate = ahc_find_syncrate(ahc, &period, &ppr_options, AHC_SYNCRATE_DT); 2685 syncrate = ahc_find_syncrate(ahc, &period, &ppr_options, AHC_SYNCRATE_DT);
2864 ahc_lock(ahc, &flags); 2686 ahc_lock(ahc, &flags);
2865 ahc_set_syncrate(ahc, &devinfo, syncrate, period, tinfo->curr.offset, 2687 ahc_set_syncrate(ahc, &devinfo, syncrate, period, tinfo->goal.offset,
2866 ppr_options, AHC_TRANS_GOAL, FALSE); 2688 ppr_options, AHC_TRANS_GOAL, FALSE);
2867 ahc_unlock(ahc, &flags); 2689 ahc_unlock(ahc, &flags);
2868} 2690}
2869 2691
2870static struct spi_function_template ahc_linux_transport_functions = { 2692static struct spi_function_template ahc_linux_transport_functions = {
2871 .get_offset = ahc_linux_get_offset,
2872 .set_offset = ahc_linux_set_offset, 2693 .set_offset = ahc_linux_set_offset,
2873 .show_offset = 1, 2694 .show_offset = 1,
2874 .get_period = ahc_linux_get_period,
2875 .set_period = ahc_linux_set_period, 2695 .set_period = ahc_linux_set_period,
2876 .show_period = 1, 2696 .show_period = 1,
2877 .get_width = ahc_linux_get_width,
2878 .set_width = ahc_linux_set_width, 2697 .set_width = ahc_linux_set_width,
2879 .show_width = 1, 2698 .show_width = 1,
2880 .get_dt = ahc_linux_get_dt,
2881 .set_dt = ahc_linux_set_dt, 2699 .set_dt = ahc_linux_set_dt,
2882 .show_dt = 1, 2700 .show_dt = 1,
2883 .get_iu = ahc_linux_get_iu,
2884 .set_iu = ahc_linux_set_iu, 2701 .set_iu = ahc_linux_set_iu,
2885 .show_iu = 1, 2702 .show_iu = 1,
2886 .get_qas = ahc_linux_get_qas,
2887 .set_qas = ahc_linux_set_qas, 2703 .set_qas = ahc_linux_set_qas,
2888 .show_qas = 1, 2704 .show_qas = 1,
2889}; 2705};
@@ -2896,6 +2712,10 @@ ahc_linux_init(void)
2896 ahc_linux_transport_template = spi_attach_transport(&ahc_linux_transport_functions); 2712 ahc_linux_transport_template = spi_attach_transport(&ahc_linux_transport_functions);
2897 if (!ahc_linux_transport_template) 2713 if (!ahc_linux_transport_template)
2898 return -ENODEV; 2714 return -ENODEV;
2715 scsi_transport_reserve_target(ahc_linux_transport_template,
2716 sizeof(struct ahc_linux_target));
2717 scsi_transport_reserve_device(ahc_linux_transport_template,
2718 sizeof(struct ahc_linux_device));
2899 if (ahc_linux_detect(&aic7xxx_driver_template)) 2719 if (ahc_linux_detect(&aic7xxx_driver_template))
2900 return 0; 2720 return 0;
2901 spi_release_transport(ahc_linux_transport_template); 2721 spi_release_transport(ahc_linux_transport_template);
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index 30c200d5bcd5..8ffe2d3e1d95 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -79,6 +79,8 @@
79#include <scsi/scsi_device.h> 79#include <scsi/scsi_device.h>
80#include <scsi/scsi_host.h> 80#include <scsi/scsi_host.h>
81#include <scsi/scsi_tcq.h> 81#include <scsi/scsi_tcq.h>
82#include <scsi/scsi_transport.h>
83#include <scsi/scsi_transport_spi.h>
82 84
83/* Core SCSI definitions */ 85/* Core SCSI definitions */
84#define AIC_LIB_PREFIX ahc 86#define AIC_LIB_PREFIX ahc
@@ -127,23 +129,6 @@ typedef struct scsi_cmnd *ahc_io_ctx_t;
127#define ahc_le32toh(x) le32_to_cpu(x) 129#define ahc_le32toh(x) le32_to_cpu(x)
128#define ahc_le64toh(x) le64_to_cpu(x) 130#define ahc_le64toh(x) le64_to_cpu(x)
129 131
130#ifndef LITTLE_ENDIAN
131#define LITTLE_ENDIAN 1234
132#endif
133
134#ifndef BIG_ENDIAN
135#define BIG_ENDIAN 4321
136#endif
137
138#ifndef BYTE_ORDER
139#if defined(__BIG_ENDIAN)
140#define BYTE_ORDER BIG_ENDIAN
141#endif
142#if defined(__LITTLE_ENDIAN)
143#define BYTE_ORDER LITTLE_ENDIAN
144#endif
145#endif /* BYTE_ORDER */
146
147/************************* Configuration Data *********************************/ 132/************************* Configuration Data *********************************/
148extern u_int aic7xxx_no_probe; 133extern u_int aic7xxx_no_probe;
149extern u_int aic7xxx_allow_memio; 134extern u_int aic7xxx_allow_memio;
@@ -283,35 +268,6 @@ ahc_scb_timer_reset(struct scb *scb, u_int usec)
283 268
284#define AIC7XXX_DRIVER_VERSION "6.2.36" 269#define AIC7XXX_DRIVER_VERSION "6.2.36"
285 270
286/**************************** Front End Queues ********************************/
287/*
288 * Data structure used to cast the Linux struct scsi_cmnd to something
289 * that allows us to use the queue macros. The linux structure has
290 * plenty of space to hold the links fields as required by the queue
291 * macros, but the queue macors require them to have the correct type.
292 */
293struct ahc_cmd_internal {
294 /* Area owned by the Linux scsi layer. */
295 uint8_t private[offsetof(struct scsi_cmnd, SCp.Status)];
296 union {
297 STAILQ_ENTRY(ahc_cmd) ste;
298 LIST_ENTRY(ahc_cmd) le;
299 TAILQ_ENTRY(ahc_cmd) tqe;
300 } links;
301 uint32_t end;
302};
303
304struct ahc_cmd {
305 union {
306 struct ahc_cmd_internal icmd;
307 struct scsi_cmnd scsi_cmd;
308 } un;
309};
310
311#define acmd_icmd(cmd) ((cmd)->un.icmd)
312#define acmd_scsi_cmd(cmd) ((cmd)->un.scsi_cmd)
313#define acmd_links un.icmd.links
314
315/*************************** Device Data Structures ***************************/ 271/*************************** Device Data Structures ***************************/
316/* 272/*
317 * A per probed device structure used to deal with some error recovery 273 * A per probed device structure used to deal with some error recovery
@@ -320,7 +276,6 @@ struct ahc_cmd {
320 * after a successfully completed inquiry command to the target when 276 * after a successfully completed inquiry command to the target when
321 * that inquiry data indicates a lun is present. 277 * that inquiry data indicates a lun is present.
322 */ 278 */
323TAILQ_HEAD(ahc_busyq, ahc_cmd);
324typedef enum { 279typedef enum {
325 AHC_DEV_FREEZE_TIL_EMPTY = 0x02, /* Freeze queue until active == 0 */ 280 AHC_DEV_FREEZE_TIL_EMPTY = 0x02, /* Freeze queue until active == 0 */
326 AHC_DEV_Q_BASIC = 0x10, /* Allow basic device queuing */ 281 AHC_DEV_Q_BASIC = 0x10, /* Allow basic device queuing */
@@ -330,8 +285,6 @@ typedef enum {
330 285
331struct ahc_linux_target; 286struct ahc_linux_target;
332struct ahc_linux_device { 287struct ahc_linux_device {
333 TAILQ_ENTRY(ahc_linux_device) links;
334
335 /* 288 /*
336 * The number of transactions currently 289 * The number of transactions currently
337 * queued to the device. 290 * queued to the device.
@@ -401,17 +354,10 @@ struct ahc_linux_device {
401 */ 354 */
402 u_int commands_since_idle_or_otag; 355 u_int commands_since_idle_or_otag;
403#define AHC_OTAG_THRESH 500 356#define AHC_OTAG_THRESH 500
404
405 int lun;
406 struct scsi_device *scsi_device;
407 struct ahc_linux_target *target;
408}; 357};
409 358
410struct ahc_linux_target { 359struct ahc_linux_target {
411 struct ahc_linux_device *devices[AHC_NUM_LUNS]; 360 struct scsi_device *sdev[AHC_NUM_LUNS];
412 int channel;
413 int target;
414 int refcount;
415 struct ahc_transinfo last_tinfo; 361 struct ahc_transinfo last_tinfo;
416 struct ahc_softc *ahc; 362 struct ahc_softc *ahc;
417}; 363};
@@ -445,7 +391,7 @@ struct ahc_platform_data {
445 /* 391 /*
446 * Fields accessed from interrupt context. 392 * Fields accessed from interrupt context.
447 */ 393 */
448 struct ahc_linux_target *targets[AHC_NUM_TARGETS]; 394 struct scsi_target *starget[AHC_NUM_TARGETS];
449 395
450 spinlock_t spin_lock; 396 spinlock_t spin_lock;
451 u_int qfrozen; 397 u_int qfrozen;
@@ -659,7 +605,6 @@ typedef enum
659 605
660/**************************** VL/EISA Routines ********************************/ 606/**************************** VL/EISA Routines ********************************/
661#ifdef CONFIG_EISA 607#ifdef CONFIG_EISA
662extern uint32_t aic7xxx_probe_eisa_vl;
663int ahc_linux_eisa_init(void); 608int ahc_linux_eisa_init(void);
664void ahc_linux_eisa_exit(void); 609void ahc_linux_eisa_exit(void);
665int aic7770_map_registers(struct ahc_softc *ahc, 610int aic7770_map_registers(struct ahc_softc *ahc,
@@ -924,7 +869,6 @@ ahc_notify_xfer_settings_change(struct ahc_softc *ahc,
924static __inline void 869static __inline void
925ahc_platform_scb_free(struct ahc_softc *ahc, struct scb *scb) 870ahc_platform_scb_free(struct ahc_softc *ahc, struct scb *scb)
926{ 871{
927 ahc->flags &= ~AHC_RESOURCE_SHORTAGE;
928} 872}
929 873
930int ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg); 874int ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg);
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
index 2a0ebce83e7a..89d737ee551a 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
@@ -140,27 +140,17 @@ struct pci_driver aic7xxx_pci_driver = {
140static void 140static void
141ahc_linux_pci_dev_remove(struct pci_dev *pdev) 141ahc_linux_pci_dev_remove(struct pci_dev *pdev)
142{ 142{
143 struct ahc_softc *ahc; 143 struct ahc_softc *ahc = pci_get_drvdata(pdev);
144 u_long l; 144 u_long s;
145 145
146 /* 146 ahc_list_lock(&s);
147 * We should be able to just perform 147 TAILQ_REMOVE(&ahc_tailq, ahc, links);
148 * the free directly, but check our 148 ahc_list_unlock(&s);
149 * list for extra sanity.
150 */
151 ahc_list_lock(&l);
152 ahc = ahc_find_softc((struct ahc_softc *)pci_get_drvdata(pdev));
153 if (ahc != NULL) {
154 u_long s;
155 149
156 TAILQ_REMOVE(&ahc_tailq, ahc, links); 150 ahc_lock(ahc, &s);
157 ahc_list_unlock(&l); 151 ahc_intr_enable(ahc, FALSE);
158 ahc_lock(ahc, &s); 152 ahc_unlock(ahc, &s);
159 ahc_intr_enable(ahc, FALSE); 153 ahc_free(ahc);
160 ahc_unlock(ahc, &s);
161 ahc_free(ahc);
162 } else
163 ahc_list_unlock(&l);
164} 154}
165 155
166static int 156static int
@@ -174,22 +164,6 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
174 char *name; 164 char *name;
175 int error; 165 int error;
176 166
177 /*
178 * Some BIOSen report the same device multiple times.
179 */
180 TAILQ_FOREACH(ahc, &ahc_tailq, links) {
181 struct pci_dev *probed_pdev;
182
183 probed_pdev = ahc->dev_softc;
184 if (probed_pdev->bus->number == pdev->bus->number
185 && probed_pdev->devfn == pdev->devfn)
186 break;
187 }
188 if (ahc != NULL) {
189 /* Skip duplicate. */
190 return (-ENODEV);
191 }
192
193 pci = pdev; 167 pci = pdev;
194 entry = ahc_find_pci_device(pci); 168 entry = ahc_find_pci_device(pci);
195 if (entry == NULL) 169 if (entry == NULL)
diff --git a/drivers/scsi/aic7xxx/aic7xxx_proc.c b/drivers/scsi/aic7xxx/aic7xxx_proc.c
index 5fece859fbd9..ab4469d83fb1 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_proc.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_proc.c
@@ -50,7 +50,7 @@ static void ahc_dump_target_state(struct ahc_softc *ahc,
50 u_int our_id, char channel, 50 u_int our_id, char channel,
51 u_int target_id, u_int target_offset); 51 u_int target_id, u_int target_offset);
52static void ahc_dump_device_state(struct info_str *info, 52static void ahc_dump_device_state(struct info_str *info,
53 struct ahc_linux_device *dev); 53 struct scsi_device *dev);
54static int ahc_proc_write_seeprom(struct ahc_softc *ahc, 54static int ahc_proc_write_seeprom(struct ahc_softc *ahc,
55 char *buffer, int length); 55 char *buffer, int length);
56 56
@@ -142,6 +142,7 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info,
142 u_int target_offset) 142 u_int target_offset)
143{ 143{
144 struct ahc_linux_target *targ; 144 struct ahc_linux_target *targ;
145 struct scsi_target *starget;
145 struct ahc_initiator_tinfo *tinfo; 146 struct ahc_initiator_tinfo *tinfo;
146 struct ahc_tmode_tstate *tstate; 147 struct ahc_tmode_tstate *tstate;
147 int lun; 148 int lun;
@@ -153,7 +154,8 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info,
153 copy_info(info, "Target %d Negotiation Settings\n", target_id); 154 copy_info(info, "Target %d Negotiation Settings\n", target_id);
154 copy_info(info, "\tUser: "); 155 copy_info(info, "\tUser: ");
155 ahc_format_transinfo(info, &tinfo->user); 156 ahc_format_transinfo(info, &tinfo->user);
156 targ = ahc->platform_data->targets[target_offset]; 157 starget = ahc->platform_data->starget[target_offset];
158 targ = scsi_transport_target_data(starget);
157 if (targ == NULL) 159 if (targ == NULL)
158 return; 160 return;
159 161
@@ -163,22 +165,25 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info,
163 ahc_format_transinfo(info, &tinfo->curr); 165 ahc_format_transinfo(info, &tinfo->curr);
164 166
165 for (lun = 0; lun < AHC_NUM_LUNS; lun++) { 167 for (lun = 0; lun < AHC_NUM_LUNS; lun++) {
166 struct ahc_linux_device *dev; 168 struct scsi_device *sdev;
167 169
168 dev = targ->devices[lun]; 170 sdev = targ->sdev[lun];
169 171
170 if (dev == NULL) 172 if (sdev == NULL)
171 continue; 173 continue;
172 174
173 ahc_dump_device_state(info, dev); 175 ahc_dump_device_state(info, sdev);
174 } 176 }
175} 177}
176 178
177static void 179static void
178ahc_dump_device_state(struct info_str *info, struct ahc_linux_device *dev) 180ahc_dump_device_state(struct info_str *info, struct scsi_device *sdev)
179{ 181{
182 struct ahc_linux_device *dev = scsi_transport_device_data(sdev);
183
180 copy_info(info, "\tChannel %c Target %d Lun %d Settings\n", 184 copy_info(info, "\tChannel %c Target %d Lun %d Settings\n",
181 dev->target->channel + 'A', dev->target->target, dev->lun); 185 sdev->sdev_target->channel + 'A',
186 sdev->sdev_target->id, sdev->lun);
182 187
183 copy_info(info, "\t\tCommands Queued %ld\n", dev->commands_issued); 188 copy_info(info, "\t\tCommands Queued %ld\n", dev->commands_issued);
184 copy_info(info, "\t\tCommands Active %d\n", dev->active); 189 copy_info(info, "\t\tCommands Active %d\n", dev->active);
@@ -292,20 +297,13 @@ int
292ahc_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start, 297ahc_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
293 off_t offset, int length, int inout) 298 off_t offset, int length, int inout)
294{ 299{
295 struct ahc_softc *ahc; 300 struct ahc_softc *ahc = *(struct ahc_softc **)shost->hostdata;
296 struct info_str info; 301 struct info_str info;
297 char ahc_info[256]; 302 char ahc_info[256];
298 u_long s;
299 u_int max_targ; 303 u_int max_targ;
300 u_int i; 304 u_int i;
301 int retval; 305 int retval;
302 306
303 retval = -EINVAL;
304 ahc_list_lock(&s);
305 ahc = ahc_find_softc(*(struct ahc_softc **)shost->hostdata);
306 if (ahc == NULL)
307 goto done;
308
309 /* Has data been written to the file? */ 307 /* Has data been written to the file? */
310 if (inout == TRUE) { 308 if (inout == TRUE) {
311 retval = ahc_proc_write_seeprom(ahc, buffer, length); 309 retval = ahc_proc_write_seeprom(ahc, buffer, length);
@@ -367,6 +365,5 @@ ahc_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
367 } 365 }
368 retval = info.pos > info.offset ? info.pos - info.offset : 0; 366 retval = info.pos > info.offset ? info.pos - info.offset : 0;
369done: 367done:
370 ahc_list_unlock(&s);
371 return (retval); 368 return (retval);
372} 369}
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
index 9e9d0c40187e..fac091e7093c 100644
--- a/drivers/scsi/aic7xxx_old.c
+++ b/drivers/scsi/aic7xxx_old.c
@@ -10358,7 +10358,7 @@ aic7xxx_queue(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *))
10358 * Returns an enumerated type that indicates the status of the operation. 10358 * Returns an enumerated type that indicates the status of the operation.
10359 *-F*************************************************************************/ 10359 *-F*************************************************************************/
10360static int 10360static int
10361aic7xxx_bus_device_reset(Scsi_Cmnd *cmd) 10361__aic7xxx_bus_device_reset(Scsi_Cmnd *cmd)
10362{ 10362{
10363 struct aic7xxx_host *p; 10363 struct aic7xxx_host *p;
10364 struct aic7xxx_scb *scb; 10364 struct aic7xxx_scb *scb;
@@ -10551,6 +10551,18 @@ aic7xxx_bus_device_reset(Scsi_Cmnd *cmd)
10551 return SUCCESS; 10551 return SUCCESS;
10552} 10552}
10553 10553
10554static int
10555aic7xxx_bus_device_reset(Scsi_Cmnd *cmd)
10556{
10557 int rc;
10558
10559 spin_lock_irq(cmd->device->host->host_lock);
10560 rc = __aic7xxx_bus_device_reset(cmd);
10561 spin_unlock_irq(cmd->device->host->host_lock);
10562
10563 return rc;
10564}
10565
10554 10566
10555/*+F************************************************************************* 10567/*+F*************************************************************************
10556 * Function: 10568 * Function:
@@ -10585,7 +10597,7 @@ aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd)
10585 * Abort the current SCSI command(s). 10597 * Abort the current SCSI command(s).
10586 *-F*************************************************************************/ 10598 *-F*************************************************************************/
10587static int 10599static int
10588aic7xxx_abort(Scsi_Cmnd *cmd) 10600__aic7xxx_abort(Scsi_Cmnd *cmd)
10589{ 10601{
10590 struct aic7xxx_scb *scb = NULL; 10602 struct aic7xxx_scb *scb = NULL;
10591 struct aic7xxx_host *p; 10603 struct aic7xxx_host *p;
@@ -10802,6 +10814,19 @@ success:
10802 return SUCCESS; 10814 return SUCCESS;
10803} 10815}
10804 10816
10817static int
10818aic7xxx_abort(Scsi_Cmnd *cmd)
10819{
10820 int rc;
10821
10822 spin_lock_irq(cmd->device->host->host_lock);
10823 rc = __aic7xxx_abort(cmd);
10824 spin_unlock_irq(cmd->device->host->host_lock);
10825
10826 return rc;
10827}
10828
10829
10805/*+F************************************************************************* 10830/*+F*************************************************************************
10806 * Function: 10831 * Function:
10807 * aic7xxx_reset 10832 * aic7xxx_reset
@@ -10820,6 +10845,8 @@ aic7xxx_reset(Scsi_Cmnd *cmd)
10820 struct aic_dev_data *aic_dev; 10845 struct aic_dev_data *aic_dev;
10821 10846
10822 p = (struct aic7xxx_host *) cmd->device->host->hostdata; 10847 p = (struct aic7xxx_host *) cmd->device->host->hostdata;
10848 spin_lock_irq(p->host->host_lock);
10849
10823 aic_dev = AIC_DEV(cmd); 10850 aic_dev = AIC_DEV(cmd);
10824 if(aic7xxx_position(cmd) < p->scb_data->numscbs) 10851 if(aic7xxx_position(cmd) < p->scb_data->numscbs)
10825 { 10852 {
@@ -10859,6 +10886,7 @@ aic7xxx_reset(Scsi_Cmnd *cmd)
10859 * longer have it. 10886 * longer have it.
10860 */ 10887 */
10861 unpause_sequencer(p, FALSE); 10888 unpause_sequencer(p, FALSE);
10889 spin_unlock_irq(p->host->host_lock);
10862 return SUCCESS; 10890 return SUCCESS;
10863 } 10891 }
10864 10892
@@ -10882,7 +10910,6 @@ aic7xxx_reset(Scsi_Cmnd *cmd)
10882 unpause_sequencer(p, FALSE); 10910 unpause_sequencer(p, FALSE);
10883 spin_unlock_irq(p->host->host_lock); 10911 spin_unlock_irq(p->host->host_lock);
10884 ssleep(2); 10912 ssleep(2);
10885 spin_lock_irq(p->host->host_lock);
10886 return SUCCESS; 10913 return SUCCESS;
10887} 10914}
10888 10915
diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c
index 27271bfc01d7..26498553a7cc 100644
--- a/drivers/scsi/arm/cumana_1.c
+++ b/drivers/scsi/arm/cumana_1.c
@@ -244,9 +244,7 @@ static Scsi_Host_Template cumanascsi_template = {
244 .info = cumanascsi_info, 244 .info = cumanascsi_info,
245 .queuecommand = cumanascsi_queue_command, 245 .queuecommand = cumanascsi_queue_command,
246 .eh_abort_handler = NCR5380_abort, 246 .eh_abort_handler = NCR5380_abort,
247 .eh_device_reset_handler= NCR5380_device_reset,
248 .eh_bus_reset_handler = NCR5380_bus_reset, 247 .eh_bus_reset_handler = NCR5380_bus_reset,
249 .eh_host_reset_handler = NCR5380_host_reset,
250 .can_queue = 16, 248 .can_queue = 16,
251 .this_id = 7, 249 .this_id = 7,
252 .sg_tablesize = SG_ALL, 250 .sg_tablesize = SG_ALL,
diff --git a/drivers/scsi/arm/ecoscsi.c b/drivers/scsi/arm/ecoscsi.c
index 303648a84709..f8a7fdd3c465 100644
--- a/drivers/scsi/arm/ecoscsi.c
+++ b/drivers/scsi/arm/ecoscsi.c
@@ -162,9 +162,7 @@ static Scsi_Host_Template ecoscsi_template = {
162 .info = ecoscsi_info, 162 .info = ecoscsi_info,
163 .queuecommand = ecoscsi_queue_command, 163 .queuecommand = ecoscsi_queue_command,
164 .eh_abort_handler = NCR5380_abort, 164 .eh_abort_handler = NCR5380_abort,
165 .eh_device_reset_handler= NCR5380_device_reset,
166 .eh_bus_reset_handler = NCR5380_bus_reset, 165 .eh_bus_reset_handler = NCR5380_bus_reset,
167 .eh_host_reset_handler = NCR5380_host_reset,
168 .can_queue = 16, 166 .can_queue = 16,
169 .this_id = 7, 167 .this_id = 7,
170 .sg_tablesize = SG_ALL, 168 .sg_tablesize = SG_ALL,
diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c
index 78b7e543471b..ce711f166cfb 100644
--- a/drivers/scsi/arm/eesox.c
+++ b/drivers/scsi/arm/eesox.c
@@ -466,7 +466,7 @@ int eesoxscsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_
466 return pos; 466 return pos;
467} 467}
468 468
469static ssize_t eesoxscsi_show_term(struct device *dev, char *buf) 469static ssize_t eesoxscsi_show_term(struct device *dev, struct device_attribute *attr, char *buf)
470{ 470{
471 struct expansion_card *ec = ECARD_DEV(dev); 471 struct expansion_card *ec = ECARD_DEV(dev);
472 struct Scsi_Host *host = ecard_get_drvdata(ec); 472 struct Scsi_Host *host = ecard_get_drvdata(ec);
@@ -475,7 +475,7 @@ static ssize_t eesoxscsi_show_term(struct device *dev, char *buf)
475 return sprintf(buf, "%d\n", info->control & EESOX_TERM_ENABLE ? 1 : 0); 475 return sprintf(buf, "%d\n", info->control & EESOX_TERM_ENABLE ? 1 : 0);
476} 476}
477 477
478static ssize_t eesoxscsi_store_term(struct device *dev, const char *buf, size_t len) 478static ssize_t eesoxscsi_store_term(struct device *dev, struct device_attribute *attr, const char *buf, size_t len)
479{ 479{
480 struct expansion_card *ec = ECARD_DEV(dev); 480 struct expansion_card *ec = ECARD_DEV(dev);
481 struct Scsi_Host *host = ecard_get_drvdata(ec); 481 struct Scsi_Host *host = ecard_get_drvdata(ec);
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index 3838f88e1fe0..4772fb317f3e 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -2659,6 +2659,8 @@ int fas216_eh_host_reset(Scsi_Cmnd *SCpnt)
2659{ 2659{
2660 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2660 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
2661 2661
2662 spin_lock_irq(info->host->host_lock);
2663
2662 fas216_checkmagic(info); 2664 fas216_checkmagic(info);
2663 2665
2664 printk("scsi%d.%c: %s: resetting host\n", 2666 printk("scsi%d.%c: %s: resetting host\n",
@@ -2686,6 +2688,7 @@ int fas216_eh_host_reset(Scsi_Cmnd *SCpnt)
2686 2688
2687 fas216_init_chip(info); 2689 fas216_init_chip(info);
2688 2690
2691 spin_unlock_irq(info->host->host_lock);
2689 return SUCCESS; 2692 return SUCCESS;
2690} 2693}
2691 2694
diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c
index ff2554f4cb80..de24bb991f1d 100644
--- a/drivers/scsi/arm/oak.c
+++ b/drivers/scsi/arm/oak.c
@@ -118,9 +118,7 @@ static Scsi_Host_Template oakscsi_template = {
118 .info = oakscsi_info, 118 .info = oakscsi_info,
119 .queuecommand = oakscsi_queue_command, 119 .queuecommand = oakscsi_queue_command,
120 .eh_abort_handler = NCR5380_abort, 120 .eh_abort_handler = NCR5380_abort,
121 .eh_device_reset_handler= NCR5380_device_reset,
122 .eh_bus_reset_handler = NCR5380_bus_reset, 121 .eh_bus_reset_handler = NCR5380_bus_reset,
123 .eh_host_reset_handler = NCR5380_host_reset,
124 .can_queue = 16, 122 .can_queue = 16,
125 .this_id = 7, 123 .this_id = 7,
126 .sg_tablesize = SG_ALL, 124 .sg_tablesize = SG_ALL,
diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c
index 54f23be6460f..abda216113f1 100644
--- a/drivers/scsi/arm/powertec.c
+++ b/drivers/scsi/arm/powertec.c
@@ -269,7 +269,7 @@ int powertecscsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, o
269 return pos; 269 return pos;
270} 270}
271 271
272static ssize_t powertecscsi_show_term(struct device *dev, char *buf) 272static ssize_t powertecscsi_show_term(struct device *dev, struct device_attribute *attr, char *buf)
273{ 273{
274 struct expansion_card *ec = ECARD_DEV(dev); 274 struct expansion_card *ec = ECARD_DEV(dev);
275 struct Scsi_Host *host = ecard_get_drvdata(ec); 275 struct Scsi_Host *host = ecard_get_drvdata(ec);
@@ -279,7 +279,7 @@ static ssize_t powertecscsi_show_term(struct device *dev, char *buf)
279} 279}
280 280
281static ssize_t 281static ssize_t
282powertecscsi_store_term(struct device *dev, const char *buf, size_t len) 282powertecscsi_store_term(struct device *dev, struct device_attribute *attr, const char *buf, size_t len)
283{ 283{
284 struct expansion_card *ec = ECARD_DEV(dev); 284 struct expansion_card *ec = ECARD_DEV(dev);
285 struct Scsi_Host *host = ecard_get_drvdata(ec); 285 struct Scsi_Host *host = ecard_get_drvdata(ec);
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index 3867f91ef8c7..3be546439252 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -153,6 +153,7 @@ static struct ata_port_operations piix_pata_ops = {
153 153
154 .port_start = ata_port_start, 154 .port_start = ata_port_start,
155 .port_stop = ata_port_stop, 155 .port_stop = ata_port_stop,
156 .host_stop = ata_host_stop,
156}; 157};
157 158
158static struct ata_port_operations piix_sata_ops = { 159static struct ata_port_operations piix_sata_ops = {
@@ -180,6 +181,7 @@ static struct ata_port_operations piix_sata_ops = {
180 181
181 .port_start = ata_port_start, 182 .port_start = ata_port_start,
182 .port_stop = ata_port_stop, 183 .port_stop = ata_port_stop,
184 .host_stop = ata_host_stop,
183}; 185};
184 186
185static struct ata_port_info piix_port_info[] = { 187static struct ata_port_info piix_port_info[] = {
@@ -663,15 +665,6 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
663 return ata_pci_init_one(pdev, port_info, n_ports); 665 return ata_pci_init_one(pdev, port_info, n_ports);
664} 666}
665 667
666/**
667 * piix_init -
668 *
669 * LOCKING:
670 *
671 * RETURNS:
672 *
673 */
674
675static int __init piix_init(void) 668static int __init piix_init(void)
676{ 669{
677 int rc; 670 int rc;
@@ -687,13 +680,6 @@ static int __init piix_init(void)
687 return 0; 680 return 0;
688} 681}
689 682
690/**
691 * piix_exit -
692 *
693 * LOCKING:
694 *
695 */
696
697static void __exit piix_exit(void) 683static void __exit piix_exit(void)
698{ 684{
699 pci_unregister_driver(&piix_pci_driver); 685 pci_unregister_driver(&piix_pci_driver);
diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
index 45b75ddacaab..e6153fe5842a 100644
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -3146,8 +3146,8 @@ static const char *atp870u_info(struct Scsi_Host *notused)
3146} 3146}
3147 3147
3148#define BLS buffer + len + size 3148#define BLS buffer + len + size
3149int atp870u_proc_info(struct Scsi_Host *HBAptr, char *buffer, 3149static int atp870u_proc_info(struct Scsi_Host *HBAptr, char *buffer,
3150 char **start, off_t offset, int length, int inout) 3150 char **start, off_t offset, int length, int inout)
3151{ 3151{
3152 static u8 buff[512]; 3152 static u8 buff[512];
3153 int size = 0; 3153 int size = 0;
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
new file mode 100644
index 000000000000..3900e28ac7d6
--- /dev/null
+++ b/drivers/scsi/ch.c
@@ -0,0 +1,1026 @@
1/*
2 * SCSI Media Changer device driver for Linux 2.6
3 *
4 * (c) 1996-2003 Gerd Knorr <kraxel@bytesex.org>
5 *
6 */
7
8#define VERSION "0.25"
9
10#include <linux/config.h>
11#include <linux/module.h>
12#include <linux/init.h>
13#include <linux/fs.h>
14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/mm.h>
17#include <linux/major.h>
18#include <linux/string.h>
19#include <linux/errno.h>
20#include <linux/interrupt.h>
21#include <linux/blkdev.h>
22#include <linux/completion.h>
23#include <linux/devfs_fs_kernel.h>
24#include <linux/ioctl32.h>
25#include <linux/compat.h>
26#include <linux/chio.h> /* here are all the ioctls */
27
28#include <scsi/scsi.h>
29#include <scsi/scsi_cmnd.h>
30#include <scsi/scsi_driver.h>
31#include <scsi/scsi_ioctl.h>
32#include <scsi/scsi_host.h>
33#include <scsi/scsi_device.h>
34#include <scsi/scsi_request.h>
35#include <scsi/scsi_dbg.h>
36
37#define CH_DT_MAX 16
38#define CH_TYPES 8
39
40MODULE_DESCRIPTION("device driver for scsi media changer devices");
41MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org>");
42MODULE_LICENSE("GPL");
43
44static int init = 1;
45module_param(init, int, 0444);
46MODULE_PARM_DESC(init, \
47 "initialize element status on driver load (default: on)");
48
49static int timeout_move = 300;
50module_param(timeout_move, int, 0644);
51MODULE_PARM_DESC(timeout_move,"timeout for move commands "
52 "(default: 300 seconds)");
53
54static int timeout_init = 3600;
55module_param(timeout_init, int, 0644);
56MODULE_PARM_DESC(timeout_init,"timeout for INITIALIZE ELEMENT STATUS "
57 "(default: 3600 seconds)");
58
59static int verbose = 1;
60module_param(verbose, int, 0644);
61MODULE_PARM_DESC(verbose,"be verbose (default: on)");
62
63static int debug = 0;
64module_param(debug, int, 0644);
65MODULE_PARM_DESC(debug,"enable/disable debug messages, also prints more "
66 "detailed sense codes on scsi errors (default: off)");
67
68static int dt_id[CH_DT_MAX] = { [ 0 ... (CH_DT_MAX-1) ] = -1 };
69static int dt_lun[CH_DT_MAX];
70module_param_array(dt_id, int, NULL, 0444);
71module_param_array(dt_lun, int, NULL, 0444);
72
73/* tell the driver about vendor-specific slots */
74static int vendor_firsts[CH_TYPES-4];
75static int vendor_counts[CH_TYPES-4];
76module_param_array(vendor_firsts, int, NULL, 0444);
77module_param_array(vendor_counts, int, NULL, 0444);
78
79static char *vendor_labels[CH_TYPES-4] = {
80 "v0", "v1", "v2", "v3"
81};
82// module_param_string_array(vendor_labels, NULL, 0444);
83
84#define dprintk(fmt, arg...) if (debug) \
85 printk(KERN_DEBUG "%s: " fmt, ch->name , ## arg)
86#define vprintk(fmt, arg...) if (verbose) \
87 printk(KERN_INFO "%s: " fmt, ch->name , ## arg)
88
89/* ------------------------------------------------------------------- */
90
91#define MAX_RETRIES 1
92
93static int ch_probe(struct device *);
94static int ch_remove(struct device *);
95static int ch_open(struct inode * inode, struct file * filp);
96static int ch_release(struct inode * inode, struct file * filp);
97static int ch_ioctl(struct inode * inode, struct file * filp,
98 unsigned int cmd, unsigned long arg);
99#ifdef CONFIG_COMPAT
100static long ch_ioctl_compat(struct file * filp,
101 unsigned int cmd, unsigned long arg);
102#endif
103
104static struct class * ch_sysfs_class;
105
106typedef struct {
107 struct list_head list;
108 int minor;
109 char name[8];
110 struct scsi_device *device;
111 struct scsi_device **dt; /* ptrs to data transfer elements */
112 u_int firsts[CH_TYPES];
113 u_int counts[CH_TYPES];
114 u_int unit_attention;
115 u_int voltags;
116 struct semaphore lock;
117} scsi_changer;
118
119static LIST_HEAD(ch_devlist);
120static spinlock_t ch_devlist_lock = SPIN_LOCK_UNLOCKED;
121static int ch_devcount;
122
123static struct scsi_driver ch_template =
124{
125 .owner = THIS_MODULE,
126 .gendrv = {
127 .name = "ch",
128 .probe = ch_probe,
129 .remove = ch_remove,
130 },
131};
132
133static struct file_operations changer_fops =
134{
135 .owner = THIS_MODULE,
136 .open = ch_open,
137 .release = ch_release,
138 .ioctl = ch_ioctl,
139#ifdef CONFIG_COMPAT
140 .compat_ioctl = ch_ioctl_compat,
141#endif
142};
143
144static struct {
145 unsigned char sense;
146 unsigned char asc;
147 unsigned char ascq;
148 int errno;
149} err[] = {
150/* Just filled in what looks right. Hav'nt checked any standard paper for
151 these errno assignments, so they may be wrong... */
152 {
153 .sense = ILLEGAL_REQUEST,
154 .asc = 0x21,
155 .ascq = 0x01,
156 .errno = EBADSLT, /* Invalid element address */
157 },{
158 .sense = ILLEGAL_REQUEST,
159 .asc = 0x28,
160 .ascq = 0x01,
161 .errno = EBADE, /* Import or export element accessed */
162 },{
163 .sense = ILLEGAL_REQUEST,
164 .asc = 0x3B,
165 .ascq = 0x0D,
166 .errno = EXFULL, /* Medium destination element full */
167 },{
168 .sense = ILLEGAL_REQUEST,
169 .asc = 0x3B,
170 .ascq = 0x0E,
171 .errno = EBADE, /* Medium source element empty */
172 },{
173 .sense = ILLEGAL_REQUEST,
174 .asc = 0x20,
175 .ascq = 0x00,
176 .errno = EBADRQC, /* Invalid command operation code */
177 },{
178 /* end of list */
179 }
180};
181
182/* ------------------------------------------------------------------- */
183
184static int ch_find_errno(unsigned char *sense_buffer)
185{
186 int i,errno = 0;
187
188 /* Check to see if additional sense information is available */
189 if (sense_buffer[7] > 5 &&
190 sense_buffer[12] != 0) {
191 for (i = 0; err[i].errno != 0; i++) {
192 if (err[i].sense == sense_buffer[ 2] &&
193 err[i].asc == sense_buffer[12] &&
194 err[i].ascq == sense_buffer[13]) {
195 errno = -err[i].errno;
196 break;
197 }
198 }
199 }
200 if (errno == 0)
201 errno = -EIO;
202 return errno;
203}
204
205static int
206ch_do_scsi(scsi_changer *ch, unsigned char *cmd,
207 void *buffer, unsigned buflength,
208 enum dma_data_direction direction)
209{
210 int errno, retries = 0, timeout;
211 struct scsi_request *sr;
212
213 sr = scsi_allocate_request(ch->device, GFP_KERNEL);
214 if (NULL == sr)
215 return -ENOMEM;
216
217 timeout = (cmd[0] == INITIALIZE_ELEMENT_STATUS)
218 ? timeout_init : timeout_move;
219
220 retry:
221 errno = 0;
222 if (debug) {
223 dprintk("command: ");
224 __scsi_print_command(cmd);
225 }
226
227 scsi_wait_req(sr, cmd, buffer, buflength,
228 timeout * HZ, MAX_RETRIES);
229
230 dprintk("result: 0x%x\n",sr->sr_result);
231 if (driver_byte(sr->sr_result) & DRIVER_SENSE) {
232 if (debug)
233 scsi_print_req_sense(ch->name, sr);
234 errno = ch_find_errno(sr->sr_sense_buffer);
235
236 switch(sr->sr_sense_buffer[2] & 0xf) {
237 case UNIT_ATTENTION:
238 ch->unit_attention = 1;
239 if (retries++ < 3)
240 goto retry;
241 break;
242 }
243 }
244 scsi_release_request(sr);
245 return errno;
246}
247
248/* ------------------------------------------------------------------------ */
249
250static int
251ch_elem_to_typecode(scsi_changer *ch, u_int elem)
252{
253 int i;
254
255 for (i = 0; i < CH_TYPES; i++) {
256 if (elem >= ch->firsts[i] &&
257 elem < ch->firsts[i] +
258 ch->counts[i])
259 return i+1;
260 }
261 return 0;
262}
263
264static int
265ch_read_element_status(scsi_changer *ch, u_int elem, char *data)
266{
267 u_char cmd[12];
268 u_char *buffer;
269 int result;
270
271 buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
272 if(!buffer)
273 return -ENOMEM;
274
275 retry:
276 memset(cmd,0,sizeof(cmd));
277 cmd[0] = READ_ELEMENT_STATUS;
278 cmd[1] = (ch->device->lun << 5) |
279 (ch->voltags ? 0x10 : 0) |
280 ch_elem_to_typecode(ch,elem);
281 cmd[2] = (elem >> 8) & 0xff;
282 cmd[3] = elem & 0xff;
283 cmd[5] = 1;
284 cmd[9] = 255;
285 if (0 == (result = ch_do_scsi(ch, cmd, buffer, 256, DMA_FROM_DEVICE))) {
286 if (((buffer[16] << 8) | buffer[17]) != elem) {
287 dprintk("asked for element 0x%02x, got 0x%02x\n",
288 elem,(buffer[16] << 8) | buffer[17]);
289 kfree(buffer);
290 return -EIO;
291 }
292 memcpy(data,buffer+16,16);
293 } else {
294 if (ch->voltags) {
295 ch->voltags = 0;
296 vprintk("device has no volume tag support\n");
297 goto retry;
298 }
299 dprintk("READ ELEMENT STATUS for element 0x%x failed\n",elem);
300 }
301 kfree(buffer);
302 return result;
303}
304
305static int
306ch_init_elem(scsi_changer *ch)
307{
308 int err;
309 u_char cmd[6];
310
311 vprintk("INITIALIZE ELEMENT STATUS, may take some time ...\n");
312 memset(cmd,0,sizeof(cmd));
313 cmd[0] = INITIALIZE_ELEMENT_STATUS;
314 cmd[1] = ch->device->lun << 5;
315 err = ch_do_scsi(ch, cmd, NULL, 0, DMA_NONE);
316 vprintk("... finished\n");
317 return err;
318}
319
320static int
321ch_readconfig(scsi_changer *ch)
322{
323 u_char cmd[10], data[16];
324 u_char *buffer;
325 int result,id,lun,i;
326 u_int elem;
327
328 buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
329 if (!buffer)
330 return -ENOMEM;
331 memset(buffer,0,512);
332
333 memset(cmd,0,sizeof(cmd));
334 cmd[0] = MODE_SENSE;
335 cmd[1] = ch->device->lun << 5;
336 cmd[2] = 0x1d;
337 cmd[4] = 255;
338 result = ch_do_scsi(ch, cmd, buffer, 255, DMA_FROM_DEVICE);
339 if (0 != result) {
340 cmd[1] |= (1<<3);
341 result = ch_do_scsi(ch, cmd, buffer, 255, DMA_FROM_DEVICE);
342 }
343 if (0 == result) {
344 ch->firsts[CHET_MT] =
345 (buffer[buffer[3]+ 6] << 8) | buffer[buffer[3]+ 7];
346 ch->counts[CHET_MT] =
347 (buffer[buffer[3]+ 8] << 8) | buffer[buffer[3]+ 9];
348 ch->firsts[CHET_ST] =
349 (buffer[buffer[3]+10] << 8) | buffer[buffer[3]+11];
350 ch->counts[CHET_ST] =
351 (buffer[buffer[3]+12] << 8) | buffer[buffer[3]+13];
352 ch->firsts[CHET_IE] =
353 (buffer[buffer[3]+14] << 8) | buffer[buffer[3]+15];
354 ch->counts[CHET_IE] =
355 (buffer[buffer[3]+16] << 8) | buffer[buffer[3]+17];
356 ch->firsts[CHET_DT] =
357 (buffer[buffer[3]+18] << 8) | buffer[buffer[3]+19];
358 ch->counts[CHET_DT] =
359 (buffer[buffer[3]+20] << 8) | buffer[buffer[3]+21];
360 vprintk("type #1 (mt): 0x%x+%d [medium transport]\n",
361 ch->firsts[CHET_MT],
362 ch->counts[CHET_MT]);
363 vprintk("type #2 (st): 0x%x+%d [storage]\n",
364 ch->firsts[CHET_ST],
365 ch->counts[CHET_ST]);
366 vprintk("type #3 (ie): 0x%x+%d [import/export]\n",
367 ch->firsts[CHET_IE],
368 ch->counts[CHET_IE]);
369 vprintk("type #4 (dt): 0x%x+%d [data transfer]\n",
370 ch->firsts[CHET_DT],
371 ch->counts[CHET_DT]);
372 } else {
373 vprintk("reading element address assigment page failed!\n");
374 }
375
376 /* vendor specific element types */
377 for (i = 0; i < 4; i++) {
378 if (0 == vendor_counts[i])
379 continue;
380 if (NULL == vendor_labels[i])
381 continue;
382 ch->firsts[CHET_V1+i] = vendor_firsts[i];
383 ch->counts[CHET_V1+i] = vendor_counts[i];
384 vprintk("type #%d (v%d): 0x%x+%d [%s, vendor specific]\n",
385 i+5,i+1,vendor_firsts[i],vendor_counts[i],
386 vendor_labels[i]);
387 }
388
389 /* look up the devices of the data transfer elements */
390 ch->dt = kmalloc(ch->counts[CHET_DT]*sizeof(struct scsi_device),
391 GFP_KERNEL);
392 for (elem = 0; elem < ch->counts[CHET_DT]; elem++) {
393 id = -1;
394 lun = 0;
395 if (elem < CH_DT_MAX && -1 != dt_id[elem]) {
396 id = dt_id[elem];
397 lun = dt_lun[elem];
398 vprintk("dt 0x%x: [insmod option] ",
399 elem+ch->firsts[CHET_DT]);
400 } else if (0 != ch_read_element_status
401 (ch,elem+ch->firsts[CHET_DT],data)) {
402 vprintk("dt 0x%x: READ ELEMENT STATUS failed\n",
403 elem+ch->firsts[CHET_DT]);
404 } else {
405 vprintk("dt 0x%x: ",elem+ch->firsts[CHET_DT]);
406 if (data[6] & 0x80) {
407 if (verbose)
408 printk("not this SCSI bus\n");
409 ch->dt[elem] = NULL;
410 } else if (0 == (data[6] & 0x30)) {
411 if (verbose)
412 printk("ID/LUN unknown\n");
413 ch->dt[elem] = NULL;
414 } else {
415 id = ch->device->id;
416 lun = 0;
417 if (data[6] & 0x20) id = data[7];
418 if (data[6] & 0x10) lun = data[6] & 7;
419 }
420 }
421 if (-1 != id) {
422 if (verbose)
423 printk("ID %i, LUN %i, ",id,lun);
424 ch->dt[elem] =
425 scsi_device_lookup(ch->device->host,
426 ch->device->channel,
427 id,lun);
428 if (!ch->dt[elem]) {
429 /* should not happen */
430 if (verbose)
431 printk("Huh? device not found!\n");
432 } else {
433 if (verbose)
434 printk("name: %8.8s %16.16s %4.4s\n",
435 ch->dt[elem]->vendor,
436 ch->dt[elem]->model,
437 ch->dt[elem]->rev);
438 }
439 }
440 }
441 ch->voltags = 1;
442 kfree(buffer);
443
444 return 0;
445}
446
447/* ------------------------------------------------------------------------ */
448
449static int
450ch_position(scsi_changer *ch, u_int trans, u_int elem, int rotate)
451{
452 u_char cmd[10];
453
454 dprintk("position: 0x%x\n",elem);
455 if (0 == trans)
456 trans = ch->firsts[CHET_MT];
457 memset(cmd,0,sizeof(cmd));
458 cmd[0] = POSITION_TO_ELEMENT;
459 cmd[1] = ch->device->lun << 5;
460 cmd[2] = (trans >> 8) & 0xff;
461 cmd[3] = trans & 0xff;
462 cmd[4] = (elem >> 8) & 0xff;
463 cmd[5] = elem & 0xff;
464 cmd[8] = rotate ? 1 : 0;
465 return ch_do_scsi(ch, cmd, NULL, 0, DMA_NONE);
466}
467
468static int
469ch_move(scsi_changer *ch, u_int trans, u_int src, u_int dest, int rotate)
470{
471 u_char cmd[12];
472
473 dprintk("move: 0x%x => 0x%x\n",src,dest);
474 if (0 == trans)
475 trans = ch->firsts[CHET_MT];
476 memset(cmd,0,sizeof(cmd));
477 cmd[0] = MOVE_MEDIUM;
478 cmd[1] = ch->device->lun << 5;
479 cmd[2] = (trans >> 8) & 0xff;
480 cmd[3] = trans & 0xff;
481 cmd[4] = (src >> 8) & 0xff;
482 cmd[5] = src & 0xff;
483 cmd[6] = (dest >> 8) & 0xff;
484 cmd[7] = dest & 0xff;
485 cmd[10] = rotate ? 1 : 0;
486 return ch_do_scsi(ch, cmd, NULL,0, DMA_NONE);
487}
488
489static int
490ch_exchange(scsi_changer *ch, u_int trans, u_int src,
491 u_int dest1, u_int dest2, int rotate1, int rotate2)
492{
493 u_char cmd[12];
494
495 dprintk("exchange: 0x%x => 0x%x => 0x%x\n",
496 src,dest1,dest2);
497 if (0 == trans)
498 trans = ch->firsts[CHET_MT];
499 memset(cmd,0,sizeof(cmd));
500 cmd[0] = EXCHANGE_MEDIUM;
501 cmd[1] = ch->device->lun << 5;
502 cmd[2] = (trans >> 8) & 0xff;
503 cmd[3] = trans & 0xff;
504 cmd[4] = (src >> 8) & 0xff;
505 cmd[5] = src & 0xff;
506 cmd[6] = (dest1 >> 8) & 0xff;
507 cmd[7] = dest1 & 0xff;
508 cmd[8] = (dest2 >> 8) & 0xff;
509 cmd[9] = dest2 & 0xff;
510 cmd[10] = (rotate1 ? 1 : 0) | (rotate2 ? 2 : 0);
511
512 return ch_do_scsi(ch, cmd, NULL,0, DMA_NONE);
513}
514
515static void
516ch_check_voltag(char *tag)
517{
518 int i;
519
520 for (i = 0; i < 32; i++) {
521 /* restrict to ascii */
522 if (tag[i] >= 0x7f || tag[i] < 0x20)
523 tag[i] = ' ';
524 /* don't allow search wildcards */
525 if (tag[i] == '?' ||
526 tag[i] == '*')
527 tag[i] = ' ';
528 }
529}
530
531static int
532ch_set_voltag(scsi_changer *ch, u_int elem,
533 int alternate, int clear, u_char *tag)
534{
535 u_char cmd[12];
536 u_char *buffer;
537 int result;
538
539 buffer = kmalloc(512, GFP_KERNEL);
540 if (!buffer)
541 return -ENOMEM;
542 memset(buffer,0,512);
543
544 dprintk("%s %s voltag: 0x%x => \"%s\"\n",
545 clear ? "clear" : "set",
546 alternate ? "alternate" : "primary",
547 elem, tag);
548 memset(cmd,0,sizeof(cmd));
549 cmd[0] = SEND_VOLUME_TAG;
550 cmd[1] = (ch->device->lun << 5) |
551 ch_elem_to_typecode(ch,elem);
552 cmd[2] = (elem >> 8) & 0xff;
553 cmd[3] = elem & 0xff;
554 cmd[5] = clear
555 ? (alternate ? 0x0d : 0x0c)
556 : (alternate ? 0x0b : 0x0a);
557
558 cmd[9] = 255;
559
560 memcpy(buffer,tag,32);
561 ch_check_voltag(buffer);
562
563 result = ch_do_scsi(ch, cmd, buffer, 256, DMA_TO_DEVICE);
564 kfree(buffer);
565 return result;
566}
567
568static int ch_gstatus(scsi_changer *ch, int type, unsigned char *dest)
569{
570 int retval = 0;
571 u_char data[16];
572 unsigned int i;
573
574 down(&ch->lock);
575 for (i = 0; i < ch->counts[type]; i++) {
576 if (0 != ch_read_element_status
577 (ch, ch->firsts[type]+i,data)) {
578 retval = -EIO;
579 break;
580 }
581 put_user(data[2], dest+i);
582 if (data[2] & CESTATUS_EXCEPT)
583 vprintk("element 0x%x: asc=0x%x, ascq=0x%x\n",
584 ch->firsts[type]+i,
585 (int)data[4],(int)data[5]);
586 retval = ch_read_element_status
587 (ch, ch->firsts[type]+i,data);
588 if (0 != retval)
589 break;
590 }
591 up(&ch->lock);
592 return retval;
593}
594
595/* ------------------------------------------------------------------------ */
596
597static int
598ch_release(struct inode *inode, struct file *file)
599{
600 scsi_changer *ch = file->private_data;
601
602 scsi_device_put(ch->device);
603 file->private_data = NULL;
604 return 0;
605}
606
607static int
608ch_open(struct inode *inode, struct file *file)
609{
610 scsi_changer *tmp, *ch;
611 int minor = iminor(inode);
612
613 spin_lock(&ch_devlist_lock);
614 ch = NULL;
615 list_for_each_entry(tmp,&ch_devlist,list) {
616 if (tmp->minor == minor)
617 ch = tmp;
618 }
619 if (NULL == ch || scsi_device_get(ch->device)) {
620 spin_unlock(&ch_devlist_lock);
621 return -ENXIO;
622 }
623 spin_unlock(&ch_devlist_lock);
624
625 file->private_data = ch;
626 return 0;
627}
628
629static int
630ch_checkrange(scsi_changer *ch, unsigned int type, unsigned int unit)
631{
632 if (type >= CH_TYPES || unit >= ch->counts[type])
633 return -1;
634 return 0;
635}
636
637static int ch_ioctl(struct inode * inode, struct file * file,
638 unsigned int cmd, unsigned long arg)
639{
640 scsi_changer *ch = file->private_data;
641 int retval;
642
643 switch (cmd) {
644 case CHIOGPARAMS:
645 {
646 struct changer_params params;
647
648 params.cp_curpicker = 0;
649 params.cp_npickers = ch->counts[CHET_MT];
650 params.cp_nslots = ch->counts[CHET_ST];
651 params.cp_nportals = ch->counts[CHET_IE];
652 params.cp_ndrives = ch->counts[CHET_DT];
653
654 if (copy_to_user((void *) arg, &params, sizeof(params)))
655 return -EFAULT;
656 return 0;
657 }
658 case CHIOGVPARAMS:
659 {
660 struct changer_vendor_params vparams;
661
662 memset(&vparams,0,sizeof(vparams));
663 if (ch->counts[CHET_V1]) {
664 vparams.cvp_n1 = ch->counts[CHET_V1];
665 strncpy(vparams.cvp_label1,vendor_labels[0],16);
666 }
667 if (ch->counts[CHET_V2]) {
668 vparams.cvp_n2 = ch->counts[CHET_V2];
669 strncpy(vparams.cvp_label2,vendor_labels[1],16);
670 }
671 if (ch->counts[CHET_V3]) {
672 vparams.cvp_n3 = ch->counts[CHET_V3];
673 strncpy(vparams.cvp_label3,vendor_labels[2],16);
674 }
675 if (ch->counts[CHET_V4]) {
676 vparams.cvp_n4 = ch->counts[CHET_V4];
677 strncpy(vparams.cvp_label4,vendor_labels[3],16);
678 }
679 if (copy_to_user((void *) arg, &vparams, sizeof(vparams)))
680 return -EFAULT;
681 return 0;
682 }
683
684 case CHIOPOSITION:
685 {
686 struct changer_position pos;
687
688 if (copy_from_user(&pos, (void*)arg, sizeof (pos)))
689 return -EFAULT;
690
691 if (0 != ch_checkrange(ch, pos.cp_type, pos.cp_unit)) {
692 dprintk("CHIOPOSITION: invalid parameter\n");
693 return -EBADSLT;
694 }
695 down(&ch->lock);
696 retval = ch_position(ch,0,
697 ch->firsts[pos.cp_type] + pos.cp_unit,
698 pos.cp_flags & CP_INVERT);
699 up(&ch->lock);
700 return retval;
701 }
702
703 case CHIOMOVE:
704 {
705 struct changer_move mv;
706
707 if (copy_from_user(&mv, (void*)arg, sizeof (mv)))
708 return -EFAULT;
709
710 if (0 != ch_checkrange(ch, mv.cm_fromtype, mv.cm_fromunit) ||
711 0 != ch_checkrange(ch, mv.cm_totype, mv.cm_tounit )) {
712 dprintk("CHIOMOVE: invalid parameter\n");
713 return -EBADSLT;
714 }
715
716 down(&ch->lock);
717 retval = ch_move(ch,0,
718 ch->firsts[mv.cm_fromtype] + mv.cm_fromunit,
719 ch->firsts[mv.cm_totype] + mv.cm_tounit,
720 mv.cm_flags & CM_INVERT);
721 up(&ch->lock);
722 return retval;
723 }
724
725 case CHIOEXCHANGE:
726 {
727 struct changer_exchange mv;
728
729 if (copy_from_user(&mv, (void*)arg, sizeof (mv)))
730 return -EFAULT;
731
732 if (0 != ch_checkrange(ch, mv.ce_srctype, mv.ce_srcunit ) ||
733 0 != ch_checkrange(ch, mv.ce_fdsttype, mv.ce_fdstunit) ||
734 0 != ch_checkrange(ch, mv.ce_sdsttype, mv.ce_sdstunit)) {
735 dprintk("CHIOEXCHANGE: invalid parameter\n");
736 return -EBADSLT;
737 }
738
739 down(&ch->lock);
740 retval = ch_exchange
741 (ch,0,
742 ch->firsts[mv.ce_srctype] + mv.ce_srcunit,
743 ch->firsts[mv.ce_fdsttype] + mv.ce_fdstunit,
744 ch->firsts[mv.ce_sdsttype] + mv.ce_sdstunit,
745 mv.ce_flags & CE_INVERT1, mv.ce_flags & CE_INVERT2);
746 up(&ch->lock);
747 return retval;
748 }
749
750 case CHIOGSTATUS:
751 {
752 struct changer_element_status ces;
753
754 if (copy_from_user(&ces, (void*)arg, sizeof (ces)))
755 return -EFAULT;
756 if (ces.ces_type < 0 || ces.ces_type >= CH_TYPES)
757 return -EINVAL;
758
759 return ch_gstatus(ch, ces.ces_type, ces.ces_data);
760 }
761
762 case CHIOGELEM:
763 {
764 struct changer_get_element cge;
765 u_char cmd[12];
766 u_char *buffer;
767 unsigned int elem;
768 int result,i;
769
770 if (copy_from_user(&cge, (void*)arg, sizeof (cge)))
771 return -EFAULT;
772
773 if (0 != ch_checkrange(ch, cge.cge_type, cge.cge_unit))
774 return -EINVAL;
775 elem = ch->firsts[cge.cge_type] + cge.cge_unit;
776
777 buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
778 if (!buffer)
779 return -ENOMEM;
780 down(&ch->lock);
781
782 voltag_retry:
783 memset(cmd,0,sizeof(cmd));
784 cmd[0] = READ_ELEMENT_STATUS;
785 cmd[1] = (ch->device->lun << 5) |
786 (ch->voltags ? 0x10 : 0) |
787 ch_elem_to_typecode(ch,elem);
788 cmd[2] = (elem >> 8) & 0xff;
789 cmd[3] = elem & 0xff;
790 cmd[5] = 1;
791 cmd[9] = 255;
792
793 if (0 == (result = ch_do_scsi(ch, cmd, buffer, 256, DMA_FROM_DEVICE))) {
794 cge.cge_status = buffer[18];
795 cge.cge_flags = 0;
796 if (buffer[18] & CESTATUS_EXCEPT) {
797 cge.cge_errno = EIO;
798 }
799 if (buffer[25] & 0x80) {
800 cge.cge_flags |= CGE_SRC;
801 if (buffer[25] & 0x40)
802 cge.cge_flags |= CGE_INVERT;
803 elem = (buffer[26]<<8) | buffer[27];
804 for (i = 0; i < 4; i++) {
805 if (elem >= ch->firsts[i] &&
806 elem < ch->firsts[i] + ch->counts[i]) {
807 cge.cge_srctype = i;
808 cge.cge_srcunit = elem-ch->firsts[i];
809 }
810 }
811 }
812 if ((buffer[22] & 0x30) == 0x30) {
813 cge.cge_flags |= CGE_IDLUN;
814 cge.cge_id = buffer[23];
815 cge.cge_lun = buffer[22] & 7;
816 }
817 if (buffer[9] & 0x80) {
818 cge.cge_flags |= CGE_PVOLTAG;
819 memcpy(cge.cge_pvoltag,buffer+28,36);
820 }
821 if (buffer[9] & 0x40) {
822 cge.cge_flags |= CGE_AVOLTAG;
823 memcpy(cge.cge_avoltag,buffer+64,36);
824 }
825 } else if (ch->voltags) {
826 ch->voltags = 0;
827 vprintk("device has no volume tag support\n");
828 goto voltag_retry;
829 }
830 kfree(buffer);
831 up(&ch->lock);
832
833 if (copy_to_user((void*)arg, &cge, sizeof (cge)))
834 return -EFAULT;
835 return result;
836 }
837
838 case CHIOINITELEM:
839 {
840 down(&ch->lock);
841 retval = ch_init_elem(ch);
842 up(&ch->lock);
843 return retval;
844 }
845
846 case CHIOSVOLTAG:
847 {
848 struct changer_set_voltag csv;
849 int elem;
850
851 if (copy_from_user(&csv, (void*)arg, sizeof(csv)))
852 return -EFAULT;
853
854 if (0 != ch_checkrange(ch, csv.csv_type, csv.csv_unit)) {
855 dprintk("CHIOSVOLTAG: invalid parameter\n");
856 return -EBADSLT;
857 }
858 elem = ch->firsts[csv.csv_type] + csv.csv_unit;
859 down(&ch->lock);
860 retval = ch_set_voltag(ch, elem,
861 csv.csv_flags & CSV_AVOLTAG,
862 csv.csv_flags & CSV_CLEARTAG,
863 csv.csv_voltag);
864 up(&ch->lock);
865 return retval;
866 }
867
868 default:
869 return scsi_ioctl(ch->device, cmd, (void*)arg);
870
871 }
872}
873
874#ifdef CONFIG_COMPAT
875
876struct changer_element_status32 {
877 int ces_type;
878 compat_uptr_t ces_data;
879};
880#define CHIOGSTATUS32 _IOW('c', 8,struct changer_element_status32)
881
882static long ch_ioctl_compat(struct file * file,
883 unsigned int cmd, unsigned long arg)
884{
885 scsi_changer *ch = file->private_data;
886
887 switch (cmd) {
888 case CHIOGPARAMS:
889 case CHIOGVPARAMS:
890 case CHIOPOSITION:
891 case CHIOMOVE:
892 case CHIOEXCHANGE:
893 case CHIOGELEM:
894 case CHIOINITELEM:
895 case CHIOSVOLTAG:
896 /* compatible */
897 return ch_ioctl(NULL /* inode, unused */,
898 file, cmd, arg);
899 case CHIOGSTATUS32:
900 {
901 struct changer_element_status32 ces32;
902 unsigned char *data;
903
904 if (copy_from_user(&ces32, (void*)arg, sizeof (ces32)))
905 return -EFAULT;
906 if (ces32.ces_type < 0 || ces32.ces_type >= CH_TYPES)
907 return -EINVAL;
908
909 data = compat_ptr(ces32.ces_data);
910 return ch_gstatus(ch, ces32.ces_type, data);
911 }
912 default:
913 // return scsi_ioctl_compat(ch->device, cmd, (void*)arg);
914 return -ENOIOCTLCMD;
915
916 }
917}
918#endif
919
920/* ------------------------------------------------------------------------ */
921
922static int ch_probe(struct device *dev)
923{
924 struct scsi_device *sd = to_scsi_device(dev);
925 scsi_changer *ch;
926
927 if (sd->type != TYPE_MEDIUM_CHANGER)
928 return -ENODEV;
929
930 ch = kmalloc(sizeof(*ch), GFP_KERNEL);
931 if (NULL == ch)
932 return -ENOMEM;
933
934 memset(ch,0,sizeof(*ch));
935 ch->minor = ch_devcount;
936 sprintf(ch->name,"ch%d",ch->minor);
937 init_MUTEX(&ch->lock);
938 ch->device = sd;
939 ch_readconfig(ch);
940 if (init)
941 ch_init_elem(ch);
942
943 devfs_mk_cdev(MKDEV(SCSI_CHANGER_MAJOR,ch->minor),
944 S_IFCHR | S_IRUGO | S_IWUGO, ch->name);
945 class_device_create(ch_sysfs_class,
946 MKDEV(SCSI_CHANGER_MAJOR,ch->minor),
947 dev, "s%s", ch->name);
948
949 printk(KERN_INFO "Attached scsi changer %s "
950 "at scsi%d, channel %d, id %d, lun %d\n",
951 ch->name, sd->host->host_no, sd->channel, sd->id, sd->lun);
952
953 spin_lock(&ch_devlist_lock);
954 list_add_tail(&ch->list,&ch_devlist);
955 ch_devcount++;
956 spin_unlock(&ch_devlist_lock);
957 return 0;
958}
959
960static int ch_remove(struct device *dev)
961{
962 struct scsi_device *sd = to_scsi_device(dev);
963 scsi_changer *tmp, *ch;
964
965 spin_lock(&ch_devlist_lock);
966 ch = NULL;
967 list_for_each_entry(tmp,&ch_devlist,list) {
968 if (tmp->device == sd)
969 ch = tmp;
970 }
971 BUG_ON(NULL == ch);
972 list_del(&ch->list);
973 spin_unlock(&ch_devlist_lock);
974
975 class_device_destroy(ch_sysfs_class,
976 MKDEV(SCSI_CHANGER_MAJOR,ch->minor));
977 devfs_remove(ch->name);
978 kfree(ch->dt);
979 kfree(ch);
980 ch_devcount--;
981 return 0;
982}
983
984static int __init init_ch_module(void)
985{
986 int rc;
987
988 printk(KERN_INFO "SCSI Media Changer driver v" VERSION " \n");
989 ch_sysfs_class = class_create(THIS_MODULE, "scsi_changer");
990 if (IS_ERR(ch_sysfs_class)) {
991 rc = PTR_ERR(ch_sysfs_class);
992 return rc;
993 }
994 rc = register_chrdev(SCSI_CHANGER_MAJOR,"ch",&changer_fops);
995 if (rc < 0) {
996 printk("Unable to get major %d for SCSI-Changer\n",
997 SCSI_CHANGER_MAJOR);
998 goto fail1;
999 }
1000 rc = scsi_register_driver(&ch_template.gendrv);
1001 if (rc < 0)
1002 goto fail2;
1003 return 0;
1004
1005 fail2:
1006 unregister_chrdev(SCSI_CHANGER_MAJOR, "ch");
1007 fail1:
1008 class_destroy(ch_sysfs_class);
1009 return rc;
1010}
1011
1012static void __exit exit_ch_module(void)
1013{
1014 scsi_unregister_driver(&ch_template.gendrv);
1015 unregister_chrdev(SCSI_CHANGER_MAJOR, "ch");
1016 class_destroy(ch_sysfs_class);
1017}
1018
1019module_init(init_ch_module);
1020module_exit(exit_ch_module);
1021
1022/*
1023 * Local variables:
1024 * c-basic-offset: 8
1025 * End:
1026 */
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index cca41cf8d3e7..ae13c002f60d 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -1310,7 +1310,7 @@ static void reset_dev_param(struct AdapterCtlBlk *acb)
1310 * @cmd - some command for this host (for fetching hooks) 1310 * @cmd - some command for this host (for fetching hooks)
1311 * Returns: SUCCESS (0x2002) on success, else FAILED (0x2003). 1311 * Returns: SUCCESS (0x2002) on success, else FAILED (0x2003).
1312 */ 1312 */
1313static int dc395x_eh_bus_reset(struct scsi_cmnd *cmd) 1313static int __dc395x_eh_bus_reset(struct scsi_cmnd *cmd)
1314{ 1314{
1315 struct AdapterCtlBlk *acb = 1315 struct AdapterCtlBlk *acb =
1316 (struct AdapterCtlBlk *)cmd->device->host->hostdata; 1316 (struct AdapterCtlBlk *)cmd->device->host->hostdata;
@@ -1356,6 +1356,16 @@ static int dc395x_eh_bus_reset(struct scsi_cmnd *cmd)
1356 return SUCCESS; 1356 return SUCCESS;
1357} 1357}
1358 1358
1359static int dc395x_eh_bus_reset(struct scsi_cmnd *cmd)
1360{
1361 int rc;
1362
1363 spin_lock_irq(cmd->device->host->host_lock);
1364 rc = __dc395x_eh_bus_reset(cmd);
1365 spin_unlock_irq(cmd->device->host->host_lock);
1366
1367 return rc;
1368}
1359 1369
1360/* 1370/*
1361 * abort an errant SCSI command 1371 * abort an errant SCSI command
diff --git a/drivers/scsi/dmx3191d.c b/drivers/scsi/dmx3191d.c
index 1d2242403db8..7905b904e01d 100644
--- a/drivers/scsi/dmx3191d.c
+++ b/drivers/scsi/dmx3191d.c
@@ -61,8 +61,6 @@ static struct scsi_host_template dmx3191d_driver_template = {
61 .queuecommand = NCR5380_queue_command, 61 .queuecommand = NCR5380_queue_command,
62 .eh_abort_handler = NCR5380_abort, 62 .eh_abort_handler = NCR5380_abort,
63 .eh_bus_reset_handler = NCR5380_bus_reset, 63 .eh_bus_reset_handler = NCR5380_bus_reset,
64 .eh_device_reset_handler= NCR5380_device_reset,
65 .eh_host_reset_handler = NCR5380_host_reset,
66 .can_queue = 32, 64 .can_queue = 32,
67 .this_id = 7, 65 .this_id = 7,
68 .sg_tablesize = SG_ALL, 66 .sg_tablesize = SG_ALL,
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 53c9b93013f1..9cc0015b717d 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -113,7 +113,6 @@ static struct i2o_sys_tbl *sys_tbl = NULL;
113static int sys_tbl_ind = 0; 113static int sys_tbl_ind = 0;
114static int sys_tbl_len = 0; 114static int sys_tbl_len = 0;
115 115
116static adpt_hba* hbas[DPTI_MAX_HBA];
117static adpt_hba* hba_chain = NULL; 116static adpt_hba* hba_chain = NULL;
118static int hba_count = 0; 117static int hba_count = 0;
119 118
@@ -691,7 +690,7 @@ static int adpt_device_reset(struct scsi_cmnd* cmd)
691 u32 msg[4]; 690 u32 msg[4];
692 u32 rcode; 691 u32 rcode;
693 int old_state; 692 int old_state;
694 struct adpt_device* d = (void*) cmd->device->hostdata; 693 struct adpt_device* d = cmd->device->hostdata;
695 694
696 pHba = (void*) cmd->device->host->hostdata[0]; 695 pHba = (void*) cmd->device->host->hostdata[0];
697 printk(KERN_INFO"%s: Trying to reset device\n",pHba->name); 696 printk(KERN_INFO"%s: Trying to reset device\n",pHba->name);
@@ -707,7 +706,7 @@ static int adpt_device_reset(struct scsi_cmnd* cmd)
707 706
708 old_state = d->state; 707 old_state = d->state;
709 d->state |= DPTI_DEV_RESET; 708 d->state |= DPTI_DEV_RESET;
710 if( (rcode = adpt_i2o_post_wait(pHba, (void*)msg,sizeof(msg), FOREVER)) ){ 709 if( (rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER)) ){
711 d->state = old_state; 710 d->state = old_state;
712 if(rcode == -EOPNOTSUPP ){ 711 if(rcode == -EOPNOTSUPP ){
713 printk(KERN_INFO"%s: Device reset not supported\n",pHba->name); 712 printk(KERN_INFO"%s: Device reset not supported\n",pHba->name);
@@ -737,7 +736,7 @@ static int adpt_bus_reset(struct scsi_cmnd* cmd)
737 msg[1] = (I2O_HBA_BUS_RESET<<24|HOST_TID<<12|pHba->channel[cmd->device->channel].tid); 736 msg[1] = (I2O_HBA_BUS_RESET<<24|HOST_TID<<12|pHba->channel[cmd->device->channel].tid);
738 msg[2] = 0; 737 msg[2] = 0;
739 msg[3] = 0; 738 msg[3] = 0;
740 if(adpt_i2o_post_wait(pHba, (void*)msg,sizeof(msg), FOREVER) ){ 739 if(adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER) ){
741 printk(KERN_WARNING"%s: Bus reset failed.\n",pHba->name); 740 printk(KERN_WARNING"%s: Bus reset failed.\n",pHba->name);
742 return FAILED; 741 return FAILED;
743 } else { 742 } else {
@@ -747,7 +746,7 @@ static int adpt_bus_reset(struct scsi_cmnd* cmd)
747} 746}
748 747
749// This version of reset is called by the eh_error_handler 748// This version of reset is called by the eh_error_handler
750static int adpt_reset(struct scsi_cmnd* cmd) 749static int __adpt_reset(struct scsi_cmnd* cmd)
751{ 750{
752 adpt_hba* pHba; 751 adpt_hba* pHba;
753 int rcode; 752 int rcode;
@@ -763,6 +762,17 @@ static int adpt_reset(struct scsi_cmnd* cmd)
763 } 762 }
764} 763}
765 764
765static int adpt_reset(struct scsi_cmnd* cmd)
766{
767 int rc;
768
769 spin_lock_irq(cmd->device->host->host_lock);
770 rc = __adpt_reset(cmd);
771 spin_unlock_irq(cmd->device->host->host_lock);
772
773 return rc;
774}
775
766// This version of reset is called by the ioctls and indirectly from eh_error_handler via adpt_reset 776// This version of reset is called by the ioctls and indirectly from eh_error_handler via adpt_reset
767static int adpt_hba_reset(adpt_hba* pHba) 777static int adpt_hba_reset(adpt_hba* pHba)
768{ 778{
@@ -875,7 +885,6 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
875 void __iomem *msg_addr_virt = NULL; 885 void __iomem *msg_addr_virt = NULL;
876 886
877 int raptorFlag = FALSE; 887 int raptorFlag = FALSE;
878 int i;
879 888
880 if(pci_enable_device(pDev)) { 889 if(pci_enable_device(pDev)) {
881 return -EINVAL; 890 return -EINVAL;
@@ -935,12 +944,6 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
935 memset(pHba, 0, sizeof(adpt_hba)); 944 memset(pHba, 0, sizeof(adpt_hba));
936 945
937 down(&adpt_configuration_lock); 946 down(&adpt_configuration_lock);
938 for(i=0;i<DPTI_MAX_HBA;i++) {
939 if(hbas[i]==NULL) {
940 hbas[i]=pHba;
941 break;
942 }
943 }
944 947
945 if(hba_chain != NULL){ 948 if(hba_chain != NULL){
946 for(p = hba_chain; p->next; p = p->next); 949 for(p = hba_chain; p->next; p = p->next);
@@ -950,7 +953,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
950 } 953 }
951 pHba->next = NULL; 954 pHba->next = NULL;
952 pHba->unit = hba_count; 955 pHba->unit = hba_count;
953 sprintf(pHba->name, "dpti%d", i); 956 sprintf(pHba->name, "dpti%d", hba_count);
954 hba_count++; 957 hba_count++;
955 958
956 up(&adpt_configuration_lock); 959 up(&adpt_configuration_lock);
@@ -1015,11 +1018,6 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
1015 if(pHba->host){ 1018 if(pHba->host){
1016 free_irq(pHba->host->irq, pHba); 1019 free_irq(pHba->host->irq, pHba);
1017 } 1020 }
1018 for(i=0;i<DPTI_MAX_HBA;i++) {
1019 if(hbas[i]==pHba) {
1020 hbas[i] = NULL;
1021 }
1022 }
1023 p2 = NULL; 1021 p2 = NULL;
1024 for( p1 = hba_chain; p1; p2 = p1,p1=p1->next){ 1022 for( p1 = hba_chain; p1; p2 = p1,p1=p1->next){
1025 if(p1 == pHba) { 1023 if(p1 == pHba) {
@@ -1076,12 +1074,7 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
1076 1074
1077static int adpt_init(void) 1075static int adpt_init(void)
1078{ 1076{
1079 int i;
1080
1081 printk("Loading Adaptec I2O RAID: Version " DPT_I2O_VERSION "\n"); 1077 printk("Loading Adaptec I2O RAID: Version " DPT_I2O_VERSION "\n");
1082 for (i = 0; i < DPTI_MAX_HBA; i++) {
1083 hbas[i] = NULL;
1084 }
1085#ifdef REBOOT_NOTIFIER 1078#ifdef REBOOT_NOTIFIER
1086 register_reboot_notifier(&adpt_reboot_notifier); 1079 register_reboot_notifier(&adpt_reboot_notifier);
1087#endif 1080#endif
@@ -1454,7 +1447,7 @@ static int adpt_i2o_parse_lct(adpt_hba* pHba)
1454 return -ENOMEM; 1447 return -ENOMEM;
1455 } 1448 }
1456 1449
1457 d->controller = (void*)pHba; 1450 d->controller = pHba;
1458 d->next = NULL; 1451 d->next = NULL;
1459 1452
1460 memcpy(&d->lct_data, &lct->lct_entry[i], sizeof(i2o_lct_entry)); 1453 memcpy(&d->lct_data, &lct->lct_entry[i], sizeof(i2o_lct_entry));
@@ -2000,7 +1993,7 @@ static irqreturn_t adpt_isr(int irq, void *dev_id, struct pt_regs *regs)
2000 struct scsi_cmnd* cmd; 1993 struct scsi_cmnd* cmd;
2001 adpt_hba* pHba = dev_id; 1994 adpt_hba* pHba = dev_id;
2002 u32 m; 1995 u32 m;
2003 ulong reply; 1996 void __iomem *reply;
2004 u32 status=0; 1997 u32 status=0;
2005 u32 context; 1998 u32 context;
2006 ulong flags = 0; 1999 ulong flags = 0;
@@ -2025,11 +2018,11 @@ static irqreturn_t adpt_isr(int irq, void *dev_id, struct pt_regs *regs)
2025 goto out; 2018 goto out;
2026 } 2019 }
2027 } 2020 }
2028 reply = (ulong)bus_to_virt(m); 2021 reply = bus_to_virt(m);
2029 2022
2030 if (readl(reply) & MSG_FAIL) { 2023 if (readl(reply) & MSG_FAIL) {
2031 u32 old_m = readl(reply+28); 2024 u32 old_m = readl(reply+28);
2032 ulong msg; 2025 void __iomem *msg;
2033 u32 old_context; 2026 u32 old_context;
2034 PDEBUG("%s: Failed message\n",pHba->name); 2027 PDEBUG("%s: Failed message\n",pHba->name);
2035 if(old_m >= 0x100000){ 2028 if(old_m >= 0x100000){
@@ -2038,16 +2031,16 @@ static irqreturn_t adpt_isr(int irq, void *dev_id, struct pt_regs *regs)
2038 continue; 2031 continue;
2039 } 2032 }
2040 // Transaction context is 0 in failed reply frame 2033 // Transaction context is 0 in failed reply frame
2041 msg = (ulong)(pHba->msg_addr_virt + old_m); 2034 msg = pHba->msg_addr_virt + old_m;
2042 old_context = readl(msg+12); 2035 old_context = readl(msg+12);
2043 writel(old_context, reply+12); 2036 writel(old_context, reply+12);
2044 adpt_send_nop(pHba, old_m); 2037 adpt_send_nop(pHba, old_m);
2045 } 2038 }
2046 context = readl(reply+8); 2039 context = readl(reply+8);
2047 if(context & 0x40000000){ // IOCTL 2040 if(context & 0x40000000){ // IOCTL
2048 ulong p = (ulong)(readl(reply+12)); 2041 void *p = (void *)readl(reply+12);
2049 if( p != 0) { 2042 if( p != NULL) {
2050 memcpy((void*)p, (void*)reply, REPLY_FRAME_SIZE * 4); 2043 memcpy_fromio(p, reply, REPLY_FRAME_SIZE * 4);
2051 } 2044 }
2052 // All IOCTLs will also be post wait 2045 // All IOCTLs will also be post wait
2053 } 2046 }
@@ -2231,7 +2224,7 @@ static s32 adpt_scsi_register(adpt_hba* pHba,struct scsi_host_template * sht)
2231} 2224}
2232 2225
2233 2226
2234static s32 adpt_i2o_to_scsi(ulong reply, struct scsi_cmnd* cmd) 2227static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd)
2235{ 2228{
2236 adpt_hba* pHba; 2229 adpt_hba* pHba;
2237 u32 hba_status; 2230 u32 hba_status;
@@ -2323,7 +2316,7 @@ static s32 adpt_i2o_to_scsi(ulong reply, struct scsi_cmnd* cmd)
2323 u32 len = sizeof(cmd->sense_buffer); 2316 u32 len = sizeof(cmd->sense_buffer);
2324 len = (len > 40) ? 40 : len; 2317 len = (len > 40) ? 40 : len;
2325 // Copy over the sense data 2318 // Copy over the sense data
2326 memcpy(cmd->sense_buffer, (void*)(reply+28) , len); 2319 memcpy_fromio(cmd->sense_buffer, (reply+28) , len);
2327 if(cmd->sense_buffer[0] == 0x70 /* class 7 */ && 2320 if(cmd->sense_buffer[0] == 0x70 /* class 7 */ &&
2328 cmd->sense_buffer[2] == DATA_PROTECT ){ 2321 cmd->sense_buffer[2] == DATA_PROTECT ){
2329 /* This is to handle an array failed */ 2322 /* This is to handle an array failed */
@@ -2438,7 +2431,7 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba)
2438 return -ENOMEM; 2431 return -ENOMEM;
2439 } 2432 }
2440 2433
2441 d->controller = (void*)pHba; 2434 d->controller = pHba;
2442 d->next = NULL; 2435 d->next = NULL;
2443 2436
2444 memcpy(&d->lct_data, &lct->lct_entry[i], sizeof(i2o_lct_entry)); 2437 memcpy(&d->lct_data, &lct->lct_entry[i], sizeof(i2o_lct_entry));
@@ -2985,8 +2978,8 @@ static int adpt_i2o_build_sys_table(void)
2985 sys_tbl->iops[count].frame_size = pHba->status_block->inbound_frame_size; 2978 sys_tbl->iops[count].frame_size = pHba->status_block->inbound_frame_size;
2986 sys_tbl->iops[count].last_changed = sys_tbl_ind - 1; // ?? 2979 sys_tbl->iops[count].last_changed = sys_tbl_ind - 1; // ??
2987 sys_tbl->iops[count].iop_capabilities = pHba->status_block->iop_capabilities; 2980 sys_tbl->iops[count].iop_capabilities = pHba->status_block->iop_capabilities;
2988 sys_tbl->iops[count].inbound_low = (u32)virt_to_bus((void*)pHba->post_port); 2981 sys_tbl->iops[count].inbound_low = (u32)virt_to_bus(pHba->post_port);
2989 sys_tbl->iops[count].inbound_high = (u32)((u64)virt_to_bus((void*)pHba->post_port)>>32); 2982 sys_tbl->iops[count].inbound_high = (u32)((u64)virt_to_bus(pHba->post_port)>>32);
2990 2983
2991 count++; 2984 count++;
2992 } 2985 }
diff --git a/drivers/scsi/dpti.h b/drivers/scsi/dpti.h
index 426e15dd490e..9821783c0164 100644
--- a/drivers/scsi/dpti.h
+++ b/drivers/scsi/dpti.h
@@ -296,7 +296,7 @@ static s32 adpt_i2o_status_get(adpt_hba* pHba);
296static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba); 296static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba);
297static s32 adpt_i2o_hrt_get(adpt_hba* pHba); 297static s32 adpt_i2o_hrt_get(adpt_hba* pHba);
298static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_device* dptdevice); 298static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_device* dptdevice);
299static s32 adpt_i2o_to_scsi(ulong reply, struct scsi_cmnd* cmd); 299static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd);
300static s32 adpt_scsi_register(adpt_hba* pHba,struct scsi_host_template * sht); 300static s32 adpt_scsi_register(adpt_hba* pHba,struct scsi_host_template * sht);
301static s32 adpt_hba_reset(adpt_hba* pHba); 301static s32 adpt_hba_reset(adpt_hba* pHba);
302static s32 adpt_i2o_reset_hba(adpt_hba* pHba); 302static s32 adpt_i2o_reset_hba(adpt_hba* pHba);
diff --git a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c
index da1aaa413fed..ab9de39bb50b 100644
--- a/drivers/scsi/dtc.c
+++ b/drivers/scsi/dtc.c
@@ -482,8 +482,6 @@ static Scsi_Host_Template driver_template = {
482 .queuecommand = dtc_queue_command, 482 .queuecommand = dtc_queue_command,
483 .eh_abort_handler = dtc_abort, 483 .eh_abort_handler = dtc_abort,
484 .eh_bus_reset_handler = dtc_bus_reset, 484 .eh_bus_reset_handler = dtc_bus_reset,
485 .eh_device_reset_handler = dtc_device_reset,
486 .eh_host_reset_handler = dtc_host_reset,
487 .bios_param = dtc_biosparam, 485 .bios_param = dtc_biosparam,
488 .can_queue = CAN_QUEUE, 486 .can_queue = CAN_QUEUE,
489 .this_id = 7, 487 .this_id = 7,
diff --git a/drivers/scsi/dtc.h b/drivers/scsi/dtc.h
index c4bcdbf338a2..ed73629eb2f9 100644
--- a/drivers/scsi/dtc.h
+++ b/drivers/scsi/dtc.h
@@ -34,8 +34,6 @@ static int dtc_biosparam(struct scsi_device *, struct block_device *,
34static int dtc_detect(Scsi_Host_Template *); 34static int dtc_detect(Scsi_Host_Template *);
35static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 35static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
36static int dtc_bus_reset(Scsi_Cmnd *); 36static int dtc_bus_reset(Scsi_Cmnd *);
37static int dtc_device_reset(Scsi_Cmnd *);
38static int dtc_host_reset(Scsi_Cmnd *);
39 37
40#ifndef CMD_PER_LUN 38#ifndef CMD_PER_LUN
41#define CMD_PER_LUN 2 39#define CMD_PER_LUN 2
@@ -86,8 +84,6 @@ static int dtc_host_reset(Scsi_Cmnd *);
86#define NCR5380_queue_command dtc_queue_command 84#define NCR5380_queue_command dtc_queue_command
87#define NCR5380_abort dtc_abort 85#define NCR5380_abort dtc_abort
88#define NCR5380_bus_reset dtc_bus_reset 86#define NCR5380_bus_reset dtc_bus_reset
89#define NCR5380_device_reset dtc_device_reset
90#define NCR5380_host_reset dtc_host_reset
91#define NCR5380_proc_info dtc_proc_info 87#define NCR5380_proc_info dtc_proc_info
92 88
93/* 15 12 11 10 89/* 15 12 11 10
diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c
index 81d16cfbe69e..1bb8727eea3e 100644
--- a/drivers/scsi/eata.c
+++ b/drivers/scsi/eata.c
@@ -518,8 +518,6 @@ static struct scsi_host_template driver_template = {
518 .release = eata2x_release, 518 .release = eata2x_release,
519 .queuecommand = eata2x_queuecommand, 519 .queuecommand = eata2x_queuecommand,
520 .eh_abort_handler = eata2x_eh_abort, 520 .eh_abort_handler = eata2x_eh_abort,
521 .eh_device_reset_handler = NULL,
522 .eh_bus_reset_handler = NULL,
523 .eh_host_reset_handler = eata2x_eh_host_reset, 521 .eh_host_reset_handler = eata2x_eh_host_reset,
524 .bios_param = eata2x_bios_param, 522 .bios_param = eata2x_bios_param,
525 .slave_configure = eata2x_slave_configure, 523 .slave_configure = eata2x_slave_configure,
@@ -1950,16 +1948,20 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg)
1950 ha->board_name, SCarg->device->channel, SCarg->device->id, 1948 ha->board_name, SCarg->device->channel, SCarg->device->id,
1951 SCarg->device->lun, SCarg->pid); 1949 SCarg->device->lun, SCarg->pid);
1952 1950
1951 spin_lock_irq(shost->host_lock);
1952
1953 if (SCarg->host_scribble == NULL) 1953 if (SCarg->host_scribble == NULL)
1954 printk("%s: reset, pid %ld inactive.\n", ha->board_name, SCarg->pid); 1954 printk("%s: reset, pid %ld inactive.\n", ha->board_name, SCarg->pid);
1955 1955
1956 if (ha->in_reset) { 1956 if (ha->in_reset) {
1957 printk("%s: reset, exit, already in reset.\n", ha->board_name); 1957 printk("%s: reset, exit, already in reset.\n", ha->board_name);
1958 spin_unlock_irq(shost->host_lock);
1958 return FAILED; 1959 return FAILED;
1959 } 1960 }
1960 1961
1961 if (wait_on_busy(shost->io_port, MAXLOOP)) { 1962 if (wait_on_busy(shost->io_port, MAXLOOP)) {
1962 printk("%s: reset, exit, timeout error.\n", ha->board_name); 1963 printk("%s: reset, exit, timeout error.\n", ha->board_name);
1964 spin_unlock_irq(shost->host_lock);
1963 return FAILED; 1965 return FAILED;
1964 } 1966 }
1965 1967
@@ -2014,6 +2016,7 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg)
2014 2016
2015 if (do_dma(shost->io_port, 0, RESET_PIO)) { 2017 if (do_dma(shost->io_port, 0, RESET_PIO)) {
2016 printk("%s: reset, cannot reset, timeout error.\n", ha->board_name); 2018 printk("%s: reset, cannot reset, timeout error.\n", ha->board_name);
2019 spin_unlock_irq(shost->host_lock);
2017 return FAILED; 2020 return FAILED;
2018 } 2021 }
2019 2022
@@ -2026,9 +2029,12 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg)
2026 ha->in_reset = 1; 2029 ha->in_reset = 1;
2027 2030
2028 spin_unlock_irq(shost->host_lock); 2031 spin_unlock_irq(shost->host_lock);
2032
2033 /* FIXME: use a sleep instead */
2029 time = jiffies; 2034 time = jiffies;
2030 while ((jiffies - time) < (10 * HZ) && limit++ < 200000) 2035 while ((jiffies - time) < (10 * HZ) && limit++ < 200000)
2031 udelay(100L); 2036 udelay(100L);
2037
2032 spin_lock_irq(shost->host_lock); 2038 spin_lock_irq(shost->host_lock);
2033 2039
2034 printk("%s: reset, interrupts disabled, loops %d.\n", ha->board_name, limit); 2040 printk("%s: reset, interrupts disabled, loops %d.\n", ha->board_name, limit);
@@ -2078,6 +2084,7 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg)
2078 else 2084 else
2079 printk("%s: reset, exit.\n", ha->board_name); 2085 printk("%s: reset, exit.\n", ha->board_name);
2080 2086
2087 spin_unlock_irq(shost->host_lock);
2081 return SUCCESS; 2088 return SUCCESS;
2082} 2089}
2083 2090
diff --git a/drivers/scsi/eata_pio.c b/drivers/scsi/eata_pio.c
index 0ee49dc50b85..04a06b71a5e2 100644
--- a/drivers/scsi/eata_pio.c
+++ b/drivers/scsi/eata_pio.c
@@ -486,8 +486,11 @@ static int eata_pio_host_reset(struct scsi_cmnd *cmd)
486 486
487 DBG(DBG_ABNORM, printk(KERN_WARNING "eata_pio_reset called pid:%ld target:" " %x lun: %x reason %x\n", cmd->pid, cmd->device->id, cmd->device->lun, cmd->abort_reason)); 487 DBG(DBG_ABNORM, printk(KERN_WARNING "eata_pio_reset called pid:%ld target:" " %x lun: %x reason %x\n", cmd->pid, cmd->device->id, cmd->device->lun, cmd->abort_reason));
488 488
489 spin_lock_irq(host->host_lock);
490
489 if (HD(cmd)->state == RESET) { 491 if (HD(cmd)->state == RESET) {
490 printk(KERN_WARNING "eata_pio_reset: exit, already in reset.\n"); 492 printk(KERN_WARNING "eata_pio_reset: exit, already in reset.\n");
493 spin_unlock_irq(host->host_lock);
491 return FAILED; 494 return FAILED;
492 } 495 }
493 496
@@ -536,6 +539,8 @@ static int eata_pio_host_reset(struct scsi_cmnd *cmd)
536 539
537 HD(cmd)->state = 0; 540 HD(cmd)->state = 0;
538 541
542 spin_unlock_irq(host->host_lock);
543
539 if (success) { /* hmmm... */ 544 if (success) { /* hmmm... */
540 DBG(DBG_ABNORM, printk(KERN_WARNING "eata_pio_reset: exit, success.\n")); 545 DBG(DBG_ABNORM, printk(KERN_WARNING "eata_pio_reset: exit, success.\n"));
541 return SUCCESS; 546 return SUCCESS;
diff --git a/drivers/scsi/fcal.c b/drivers/scsi/fcal.c
index 0dad89d4cb3e..a6f120dcdfc3 100644
--- a/drivers/scsi/fcal.c
+++ b/drivers/scsi/fcal.c
@@ -311,7 +311,6 @@ static Scsi_Host_Template driver_template = {
311 .use_clustering = ENABLE_CLUSTERING, 311 .use_clustering = ENABLE_CLUSTERING,
312 .eh_abort_handler = fcp_scsi_abort, 312 .eh_abort_handler = fcp_scsi_abort,
313 .eh_device_reset_handler = fcp_scsi_dev_reset, 313 .eh_device_reset_handler = fcp_scsi_dev_reset,
314 .eh_bus_reset_handler = fcp_scsi_bus_reset,
315 .eh_host_reset_handler = fcp_scsi_host_reset, 314 .eh_host_reset_handler = fcp_scsi_host_reset,
316}; 315};
317#include "scsi_module.c" 316#include "scsi_module.c"
diff --git a/drivers/scsi/fd_mcs.c b/drivers/scsi/fd_mcs.c
index 770930e2aec3..fa652f8aa643 100644
--- a/drivers/scsi/fd_mcs.c
+++ b/drivers/scsi/fd_mcs.c
@@ -1241,18 +1241,9 @@ static int fd_mcs_abort(Scsi_Cmnd * SCpnt)
1241 return SUCCESS; 1241 return SUCCESS;
1242} 1242}
1243 1243
1244static int fd_mcs_host_reset(Scsi_Cmnd * SCpnt)
1245{
1246 return FAILED;
1247}
1248
1249static int fd_mcs_device_reset(Scsi_Cmnd * SCpnt)
1250{
1251 return FAILED;
1252}
1253
1254static int fd_mcs_bus_reset(Scsi_Cmnd * SCpnt) { 1244static int fd_mcs_bus_reset(Scsi_Cmnd * SCpnt) {
1255 struct Scsi_Host *shpnt = SCpnt->device->host; 1245 struct Scsi_Host *shpnt = SCpnt->device->host;
1246 unsigned long flags;
1256 1247
1257#if DEBUG_RESET 1248#if DEBUG_RESET
1258 static int called_once = 0; 1249 static int called_once = 0;
@@ -1269,6 +1260,8 @@ static int fd_mcs_bus_reset(Scsi_Cmnd * SCpnt) {
1269 called_once = 1; 1260 called_once = 1;
1270#endif 1261#endif
1271 1262
1263 spin_lock_irqsave(shpnt->host_lock, flags);
1264
1272 outb(1, SCSI_Cntl_port); 1265 outb(1, SCSI_Cntl_port);
1273 do_pause(2); 1266 do_pause(2);
1274 outb(0, SCSI_Cntl_port); 1267 outb(0, SCSI_Cntl_port);
@@ -1276,6 +1269,8 @@ static int fd_mcs_bus_reset(Scsi_Cmnd * SCpnt) {
1276 outb(0, SCSI_Mode_Cntl_port); 1269 outb(0, SCSI_Mode_Cntl_port);
1277 outb(PARITY_MASK, TMC_Cntl_port); 1270 outb(PARITY_MASK, TMC_Cntl_port);
1278 1271
1272 spin_unlock_irqrestore(shpnt->host_lock, flags);
1273
1279 /* Unless this is the very first call (i.e., SCPnt == NULL), everything 1274 /* Unless this is the very first call (i.e., SCPnt == NULL), everything
1280 is probably hosed at this point. We will, however, try to keep 1275 is probably hosed at this point. We will, however, try to keep
1281 things going by informing the high-level code that we need help. */ 1276 things going by informing the high-level code that we need help. */
@@ -1357,8 +1352,6 @@ static Scsi_Host_Template driver_template = {
1357 .queuecommand = fd_mcs_queue, 1352 .queuecommand = fd_mcs_queue,
1358 .eh_abort_handler = fd_mcs_abort, 1353 .eh_abort_handler = fd_mcs_abort,
1359 .eh_bus_reset_handler = fd_mcs_bus_reset, 1354 .eh_bus_reset_handler = fd_mcs_bus_reset,
1360 .eh_host_reset_handler = fd_mcs_host_reset,
1361 .eh_device_reset_handler = fd_mcs_device_reset,
1362 .bios_param = fd_mcs_biosparam, 1355 .bios_param = fd_mcs_biosparam,
1363 .can_queue = 1, 1356 .can_queue = 1,
1364 .this_id = 7, 1357 .this_id = 7,
diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c
index a843c080c1d8..4ba6a15cf43d 100644
--- a/drivers/scsi/fdomain.c
+++ b/drivers/scsi/fdomain.c
@@ -1543,12 +1543,18 @@ static int fdomain_16x0_abort(struct scsi_cmnd *SCpnt)
1543 1543
1544int fdomain_16x0_bus_reset(struct scsi_cmnd *SCpnt) 1544int fdomain_16x0_bus_reset(struct scsi_cmnd *SCpnt)
1545{ 1545{
1546 unsigned long flags;
1547
1548 local_irq_save(flags);
1549
1546 outb(1, port_base + SCSI_Cntl); 1550 outb(1, port_base + SCSI_Cntl);
1547 do_pause( 2 ); 1551 do_pause( 2 );
1548 outb(0, port_base + SCSI_Cntl); 1552 outb(0, port_base + SCSI_Cntl);
1549 do_pause( 115 ); 1553 do_pause( 115 );
1550 outb(0, port_base + SCSI_Mode_Cntl); 1554 outb(0, port_base + SCSI_Mode_Cntl);
1551 outb(PARITY_MASK, port_base + TMC_Cntl); 1555 outb(PARITY_MASK, port_base + TMC_Cntl);
1556
1557 local_irq_restore(flags);
1552 return SUCCESS; 1558 return SUCCESS;
1553} 1559}
1554 1560
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index ca9d5bd26ca3..a3aa729b9d3c 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -908,8 +908,6 @@ static Scsi_Host_Template driver_template = {
908 .queuecommand = generic_NCR5380_queue_command, 908 .queuecommand = generic_NCR5380_queue_command,
909 .eh_abort_handler = generic_NCR5380_abort, 909 .eh_abort_handler = generic_NCR5380_abort,
910 .eh_bus_reset_handler = generic_NCR5380_bus_reset, 910 .eh_bus_reset_handler = generic_NCR5380_bus_reset,
911 .eh_device_reset_handler = generic_NCR5380_device_reset,
912 .eh_host_reset_handler = generic_NCR5380_host_reset,
913 .bios_param = NCR5380_BIOSPARAM, 911 .bios_param = NCR5380_BIOSPARAM,
914 .can_queue = CAN_QUEUE, 912 .can_queue = CAN_QUEUE,
915 .this_id = 7, 913 .this_id = 7,
diff --git a/drivers/scsi/g_NCR5380.h b/drivers/scsi/g_NCR5380.h
index 0c04cefb2a88..c8adc5a94884 100644
--- a/drivers/scsi/g_NCR5380.h
+++ b/drivers/scsi/g_NCR5380.h
@@ -49,8 +49,6 @@ static int generic_NCR5380_detect(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 *);
52static int generic_NCR5380_host_reset(Scsi_Cmnd *);
53static int generic_NCR5380_device_reset(Scsi_Cmnd *);
54static const char* generic_NCR5380_info(struct Scsi_Host *); 52static const char* generic_NCR5380_info(struct Scsi_Host *);
55 53
56#ifndef CMD_PER_LUN 54#ifndef CMD_PER_LUN
@@ -114,8 +112,6 @@ static const char* generic_NCR5380_info(struct Scsi_Host *);
114#define NCR5380_queue_command generic_NCR5380_queue_command 112#define NCR5380_queue_command generic_NCR5380_queue_command
115#define NCR5380_abort generic_NCR5380_abort 113#define NCR5380_abort generic_NCR5380_abort
116#define NCR5380_bus_reset generic_NCR5380_bus_reset 114#define NCR5380_bus_reset generic_NCR5380_bus_reset
117#define NCR5380_device_reset generic_NCR5380_device_reset
118#define NCR5380_host_reset generic_NCR5380_host_reset
119#define NCR5380_pread generic_NCR5380_pread 115#define NCR5380_pread generic_NCR5380_pread
120#define NCR5380_pwrite generic_NCR5380_pwrite 116#define NCR5380_pwrite generic_NCR5380_pwrite
121#define NCR5380_proc_info notyet_generic_proc_info 117#define NCR5380_proc_info notyet_generic_proc_info
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index a9eaab9fbd5e..4552cccd2834 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -4703,19 +4703,6 @@ static const char *gdth_info(struct Scsi_Host *shp)
4703 return ((const char *)ha->binfo.type_string); 4703 return ((const char *)ha->binfo.type_string);
4704} 4704}
4705 4705
4706/* new error handling */
4707static int gdth_eh_abort(Scsi_Cmnd *scp)
4708{
4709 TRACE2(("gdth_eh_abort()\n"));
4710 return FAILED;
4711}
4712
4713static int gdth_eh_device_reset(Scsi_Cmnd *scp)
4714{
4715 TRACE2(("gdth_eh_device_reset()\n"));
4716 return FAILED;
4717}
4718
4719static int gdth_eh_bus_reset(Scsi_Cmnd *scp) 4706static int gdth_eh_bus_reset(Scsi_Cmnd *scp)
4720{ 4707{
4721 int i, hanum; 4708 int i, hanum;
@@ -4770,13 +4757,6 @@ static int gdth_eh_bus_reset(Scsi_Cmnd *scp)
4770 return SUCCESS; 4757 return SUCCESS;
4771} 4758}
4772 4759
4773static int gdth_eh_host_reset(Scsi_Cmnd *scp)
4774{
4775 TRACE2(("gdth_eh_host_reset()\n"));
4776 return FAILED;
4777}
4778
4779
4780#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 4760#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
4781static int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,sector_t cap,int *ip) 4761static int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,sector_t cap,int *ip)
4782#else 4762#else
@@ -5713,10 +5693,7 @@ static Scsi_Host_Template driver_template = {
5713 .release = gdth_release, 5693 .release = gdth_release,
5714 .info = gdth_info, 5694 .info = gdth_info,
5715 .queuecommand = gdth_queuecommand, 5695 .queuecommand = gdth_queuecommand,
5716 .eh_abort_handler = gdth_eh_abort,
5717 .eh_device_reset_handler = gdth_eh_device_reset,
5718 .eh_bus_reset_handler = gdth_eh_bus_reset, 5696 .eh_bus_reset_handler = gdth_eh_bus_reset,
5719 .eh_host_reset_handler = gdth_eh_host_reset,
5720 .bios_param = gdth_bios_param, 5697 .bios_param = gdth_bios_param,
5721 .can_queue = GDTH_MAXCMDS, 5698 .can_queue = GDTH_MAXCMDS,
5722 .this_id = -1, 5699 .this_id = -1,
diff --git a/drivers/scsi/gvp11.c b/drivers/scsi/gvp11.c
index 30cbf73c7433..d12342fa8199 100644
--- a/drivers/scsi/gvp11.c
+++ b/drivers/scsi/gvp11.c
@@ -345,7 +345,15 @@ release:
345static int gvp11_bus_reset(Scsi_Cmnd *cmd) 345static int gvp11_bus_reset(Scsi_Cmnd *cmd)
346{ 346{
347 /* FIXME perform bus-specific reset */ 347 /* FIXME perform bus-specific reset */
348
349 /* FIXME 2: shouldn't we no-op this function (return
350 FAILED), and fall back to host reset function,
351 wd33c93_host_reset ? */
352
353 spin_lock_irq(cmd->device->host->host_lock);
348 wd33c93_host_reset(cmd); 354 wd33c93_host_reset(cmd);
355 spin_unlock_irq(cmd->device->host->host_lock);
356
349 return SUCCESS; 357 return SUCCESS;
350} 358}
351 359
diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c
index a3fdead9bce9..b5dc35355570 100644
--- a/drivers/scsi/ibmmca.c
+++ b/drivers/scsi/ibmmca.c
@@ -2118,7 +2118,7 @@ static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
2118 return 0; 2118 return 0;
2119} 2119}
2120 2120
2121static int ibmmca_abort(Scsi_Cmnd * cmd) 2121static int __ibmmca_abort(Scsi_Cmnd * cmd)
2122{ 2122{
2123 /* Abort does not work, as the adapter never generates an interrupt on 2123 /* Abort does not work, as the adapter never generates an interrupt on
2124 * whatever situation is simulated, even when really pending commands 2124 * whatever situation is simulated, even when really pending commands
@@ -2225,7 +2225,19 @@ static int ibmmca_abort(Scsi_Cmnd * cmd)
2225 } 2225 }
2226} 2226}
2227 2227
2228static int ibmmca_host_reset(Scsi_Cmnd * cmd) 2228static int ibmmca_abort(Scsi_Cmnd * cmd)
2229{
2230 struct Scsi_Host *shpnt = cmd->device->host;
2231 int rc;
2232
2233 spin_lock_irq(shpnt->host_lock);
2234 rc = __ibmmca_abort(cmd);
2235 spin_unlock_irq(shpnt->host_lock);
2236
2237 return rc;
2238}
2239
2240static int __ibmmca_host_reset(Scsi_Cmnd * cmd)
2229{ 2241{
2230 struct Scsi_Host *shpnt; 2242 struct Scsi_Host *shpnt;
2231 Scsi_Cmnd *cmd_aid; 2243 Scsi_Cmnd *cmd_aid;
@@ -2312,6 +2324,18 @@ static int ibmmca_host_reset(Scsi_Cmnd * cmd)
2312 return SUCCESS; 2324 return SUCCESS;
2313} 2325}
2314 2326
2327static int ibmmca_host_reset(Scsi_Cmnd * cmd)
2328{
2329 struct Scsi_Host *shpnt = cmd->device->host;
2330 int rc;
2331
2332 spin_lock_irq(shpnt->host_lock);
2333 rc = __ibmmca_host_reset(cmd);
2334 spin_unlock_irq(shpnt->host_lock);
2335
2336 return rc;
2337}
2338
2315static int ibmmca_biosparam(struct scsi_device *sdev, struct block_device *bdev, sector_t capacity, int *info) 2339static int ibmmca_biosparam(struct scsi_device *sdev, struct block_device *bdev, sector_t capacity, int *info)
2316{ 2340{
2317 int size = capacity; 2341 int size = capacity;
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index e89f76e5dd53..d89b8eb3cdf3 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -874,9 +874,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
874 return FAILED; 874 return FAILED;
875 } 875 }
876 876
877 spin_unlock_irq(hostdata->host->host_lock);
878 wait_for_completion(&evt->comp); 877 wait_for_completion(&evt->comp);
879 spin_lock_irq(hostdata->host->host_lock);
880 878
881 /* make sure we got a good response */ 879 /* make sure we got a good response */
882 if (unlikely(srp_rsp.srp.generic.type != SRP_RSP_TYPE)) { 880 if (unlikely(srp_rsp.srp.generic.type != SRP_RSP_TYPE)) {
@@ -978,9 +976,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
978 return FAILED; 976 return FAILED;
979 } 977 }
980 978
981 spin_unlock_irq(hostdata->host->host_lock);
982 wait_for_completion(&evt->comp); 979 wait_for_completion(&evt->comp);
983 spin_lock_irq(hostdata->host->host_lock);
984 980
985 /* make sure we got a good response */ 981 /* make sure we got a good response */
986 if (unlikely(srp_rsp.srp.generic.type != SRP_RSP_TYPE)) { 982 if (unlikely(srp_rsp.srp.generic.type != SRP_RSP_TYPE)) {
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 2e2486b035dd..3d62c9bcbff7 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -46,6 +46,7 @@
46#include <linux/slab.h> 46#include <linux/slab.h>
47#include <linux/ide.h> 47#include <linux/ide.h>
48#include <linux/scatterlist.h> 48#include <linux/scatterlist.h>
49#include <linux/delay.h>
49 50
50#include <asm/io.h> 51#include <asm/io.h>
51#include <asm/bitops.h> 52#include <asm/bitops.h>
@@ -179,8 +180,18 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne
179 return; 180 return;
180 } 181 }
181 count = min(pc->sg->length - pc->b_count, bcount); 182 count = min(pc->sg->length - pc->b_count, bcount);
182 buf = page_address(pc->sg->page) + pc->sg->offset; 183 if (PageHighMem(pc->sg->page)) {
183 drive->hwif->atapi_input_bytes(drive, buf + pc->b_count, count); 184 unsigned long flags;
185
186 local_irq_save(flags);
187 buf = kmap_atomic(pc->sg->page, KM_IRQ0) + pc->sg->offset;
188 drive->hwif->atapi_input_bytes(drive, buf + pc->b_count, count);
189 kunmap_atomic(buf - pc->sg->offset, KM_IRQ0);
190 local_irq_restore(flags);
191 } else {
192 buf = page_address(pc->sg->page) + pc->sg->offset;
193 drive->hwif->atapi_input_bytes(drive, buf + pc->b_count, count);
194 }
184 bcount -= count; pc->b_count += count; 195 bcount -= count; pc->b_count += count;
185 if (pc->b_count == pc->sg->length) { 196 if (pc->b_count == pc->sg->length) {
186 pc->sg++; 197 pc->sg++;
@@ -201,8 +212,18 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign
201 return; 212 return;
202 } 213 }
203 count = min(pc->sg->length - pc->b_count, bcount); 214 count = min(pc->sg->length - pc->b_count, bcount);
204 buf = page_address(pc->sg->page) + pc->sg->offset; 215 if (PageHighMem(pc->sg->page)) {
205 drive->hwif->atapi_output_bytes(drive, buf + pc->b_count, count); 216 unsigned long flags;
217
218 local_irq_save(flags);
219 buf = kmap_atomic(pc->sg->page, KM_IRQ0) + pc->sg->offset;
220 drive->hwif->atapi_output_bytes(drive, buf + pc->b_count, count);
221 kunmap_atomic(buf - pc->sg->offset, KM_IRQ0);
222 local_irq_restore(flags);
223 } else {
224 buf = page_address(pc->sg->page) + pc->sg->offset;
225 drive->hwif->atapi_output_bytes(drive, buf + pc->b_count, count);
226 }
206 bcount -= count; pc->b_count += count; 227 bcount -= count; pc->b_count += count;
207 if (pc->b_count == pc->sg->length) { 228 if (pc->b_count == pc->sg->length) {
208 pc->sg++; 229 pc->sg++;
@@ -713,7 +734,6 @@ static void idescsi_add_settings(ide_drive_t *drive)
713 */ 734 */
714static void idescsi_setup (ide_drive_t *drive, idescsi_scsi_t *scsi) 735static void idescsi_setup (ide_drive_t *drive, idescsi_scsi_t *scsi)
715{ 736{
716 DRIVER(drive)->busy++;
717 if (drive->id && (drive->id->config & 0x0060) == 0x20) 737 if (drive->id && (drive->id->config & 0x0060) == 0x20)
718 set_bit (IDESCSI_DRQ_INTERRUPT, &scsi->flags); 738 set_bit (IDESCSI_DRQ_INTERRUPT, &scsi->flags);
719 set_bit(IDESCSI_TRANSFORM, &scsi->transform); 739 set_bit(IDESCSI_TRANSFORM, &scsi->transform);
@@ -722,17 +742,16 @@ static void idescsi_setup (ide_drive_t *drive, idescsi_scsi_t *scsi)
722 set_bit(IDESCSI_LOG_CMD, &scsi->log); 742 set_bit(IDESCSI_LOG_CMD, &scsi->log);
723#endif /* IDESCSI_DEBUG_LOG */ 743#endif /* IDESCSI_DEBUG_LOG */
724 idescsi_add_settings(drive); 744 idescsi_add_settings(drive);
725 DRIVER(drive)->busy--;
726} 745}
727 746
728static int idescsi_cleanup (ide_drive_t *drive) 747static int ide_scsi_remove(struct device *dev)
729{ 748{
749 ide_drive_t *drive = to_ide_device(dev);
730 struct Scsi_Host *scsihost = drive->driver_data; 750 struct Scsi_Host *scsihost = drive->driver_data;
731 struct ide_scsi_obj *scsi = scsihost_to_idescsi(scsihost); 751 struct ide_scsi_obj *scsi = scsihost_to_idescsi(scsihost);
732 struct gendisk *g = scsi->disk; 752 struct gendisk *g = scsi->disk;
733 753
734 if (ide_unregister_subdriver(drive)) 754 ide_unregister_subdriver(drive, scsi->driver);
735 return 1;
736 755
737 ide_unregister_region(g); 756 ide_unregister_region(g);
738 757
@@ -746,7 +765,7 @@ static int idescsi_cleanup (ide_drive_t *drive)
746 return 0; 765 return 0;
747} 766}
748 767
749static int idescsi_attach(ide_drive_t *drive); 768static int ide_scsi_probe(struct device *);
750 769
751#ifdef CONFIG_PROC_FS 770#ifdef CONFIG_PROC_FS
752static ide_proc_entry_t idescsi_proc[] = { 771static ide_proc_entry_t idescsi_proc[] = {
@@ -757,24 +776,22 @@ static ide_proc_entry_t idescsi_proc[] = {
757# define idescsi_proc NULL 776# define idescsi_proc NULL
758#endif 777#endif
759 778
760/*
761 * IDE subdriver functions, registered with ide.c
762 */
763static ide_driver_t idescsi_driver = { 779static ide_driver_t idescsi_driver = {
764 .owner = THIS_MODULE, 780 .owner = THIS_MODULE,
765 .name = "ide-scsi", 781 .gen_driver = {
782 .name = "ide-scsi",
783 .bus = &ide_bus_type,
784 .probe = ide_scsi_probe,
785 .remove = ide_scsi_remove,
786 },
766 .version = IDESCSI_VERSION, 787 .version = IDESCSI_VERSION,
767 .media = ide_scsi, 788 .media = ide_scsi,
768 .busy = 0,
769 .supports_dsc_overlap = 0, 789 .supports_dsc_overlap = 0,
770 .proc = idescsi_proc, 790 .proc = idescsi_proc,
771 .attach = idescsi_attach,
772 .cleanup = idescsi_cleanup,
773 .do_request = idescsi_do_request, 791 .do_request = idescsi_do_request,
774 .end_request = idescsi_end_request, 792 .end_request = idescsi_end_request,
775 .error = idescsi_atapi_error, 793 .error = idescsi_atapi_error,
776 .abort = idescsi_atapi_abort, 794 .abort = idescsi_atapi_abort,
777 .drives = LIST_HEAD_INIT(idescsi_driver.drives),
778}; 795};
779 796
780static int idescsi_ide_open(struct inode *inode, struct file *filp) 797static int idescsi_ide_open(struct inode *inode, struct file *filp)
@@ -821,8 +838,6 @@ static struct block_device_operations idescsi_ops = {
821 .ioctl = idescsi_ide_ioctl, 838 .ioctl = idescsi_ide_ioctl,
822}; 839};
823 840
824static int idescsi_attach(ide_drive_t *drive);
825
826static int idescsi_slave_configure(struct scsi_device * sdp) 841static int idescsi_slave_configure(struct scsi_device * sdp)
827{ 842{
828 /* Configure detected device */ 843 /* Configure detected device */
@@ -1012,11 +1027,13 @@ static int idescsi_eh_reset (struct scsi_cmnd *cmd)
1012 return FAILED; 1027 return FAILED;
1013 } 1028 }
1014 1029
1015 spin_lock_irq(&ide_lock); 1030 spin_lock_irq(cmd->device->host->host_lock);
1031 spin_lock(&ide_lock);
1016 1032
1017 if (!scsi->pc || (req = scsi->pc->rq) != HWGROUP(drive)->rq || !HWGROUP(drive)->handler) { 1033 if (!scsi->pc || (req = scsi->pc->rq) != HWGROUP(drive)->rq || !HWGROUP(drive)->handler) {
1018 printk (KERN_WARNING "ide-scsi: No active request in idescsi_eh_reset\n"); 1034 printk (KERN_WARNING "ide-scsi: No active request in idescsi_eh_reset\n");
1019 spin_unlock(&ide_lock); 1035 spin_unlock(&ide_lock);
1036 spin_unlock_irq(cmd->device->host->host_lock);
1020 return FAILED; 1037 return FAILED;
1021 } 1038 }
1022 1039
@@ -1038,16 +1055,15 @@ static int idescsi_eh_reset (struct scsi_cmnd *cmd)
1038 HWGROUP(drive)->rq = NULL; 1055 HWGROUP(drive)->rq = NULL;
1039 HWGROUP(drive)->handler = NULL; 1056 HWGROUP(drive)->handler = NULL;
1040 HWGROUP(drive)->busy = 1; /* will set this to zero when ide reset finished */ 1057 HWGROUP(drive)->busy = 1; /* will set this to zero when ide reset finished */
1041 spin_unlock_irq(&ide_lock); 1058 spin_unlock(&ide_lock);
1042 1059
1043 ide_do_reset(drive); 1060 ide_do_reset(drive);
1044 1061
1045 /* ide_do_reset starts a polling handler which restarts itself every 50ms until the reset finishes */ 1062 /* ide_do_reset starts a polling handler which restarts itself every 50ms until the reset finishes */
1046 1063
1047 do { 1064 do {
1048 set_current_state(TASK_UNINTERRUPTIBLE);
1049 spin_unlock_irq(cmd->device->host->host_lock); 1065 spin_unlock_irq(cmd->device->host->host_lock);
1050 schedule_timeout(HZ/20); 1066 msleep(50);
1051 spin_lock_irq(cmd->device->host->host_lock); 1067 spin_lock_irq(cmd->device->host->host_lock);
1052 } while ( HWGROUP(drive)->handler ); 1068 } while ( HWGROUP(drive)->handler );
1053 1069
@@ -1058,6 +1074,7 @@ static int idescsi_eh_reset (struct scsi_cmnd *cmd)
1058 ret = FAILED; 1074 ret = FAILED;
1059 } 1075 }
1060 1076
1077 spin_unlock_irq(cmd->device->host->host_lock);
1061 return ret; 1078 return ret;
1062} 1079}
1063 1080
@@ -1095,8 +1112,9 @@ static struct scsi_host_template idescsi_template = {
1095 .proc_name = "ide-scsi", 1112 .proc_name = "ide-scsi",
1096}; 1113};
1097 1114
1098static int idescsi_attach(ide_drive_t *drive) 1115static int ide_scsi_probe(struct device *dev)
1099{ 1116{
1117 ide_drive_t *drive = to_ide_device(dev);
1100 idescsi_scsi_t *idescsi; 1118 idescsi_scsi_t *idescsi;
1101 struct Scsi_Host *host; 1119 struct Scsi_Host *host;
1102 struct gendisk *g; 1120 struct gendisk *g;
@@ -1112,7 +1130,7 @@ static int idescsi_attach(ide_drive_t *drive)
1112 !drive->present || 1130 !drive->present ||
1113 drive->media == ide_disk || 1131 drive->media == ide_disk ||
1114 !(host = scsi_host_alloc(&idescsi_template,sizeof(idescsi_scsi_t)))) 1132 !(host = scsi_host_alloc(&idescsi_template,sizeof(idescsi_scsi_t))))
1115 return 1; 1133 return -ENODEV;
1116 1134
1117 g = alloc_disk(1 << PARTN_BITS); 1135 g = alloc_disk(1 << PARTN_BITS);
1118 if (!g) 1136 if (!g)
@@ -1138,20 +1156,19 @@ static int idescsi_attach(ide_drive_t *drive)
1138 idescsi->host = host; 1156 idescsi->host = host;
1139 idescsi->disk = g; 1157 idescsi->disk = g;
1140 g->private_data = &idescsi->driver; 1158 g->private_data = &idescsi->driver;
1141 err = ide_register_subdriver(drive, &idescsi_driver); 1159 ide_register_subdriver(drive, &idescsi_driver);
1160 err = 0;
1161 idescsi_setup(drive, idescsi);
1162 g->fops = &idescsi_ops;
1163 ide_register_region(g);
1164 err = scsi_add_host(host, &drive->gendev);
1142 if (!err) { 1165 if (!err) {
1143 idescsi_setup (drive, idescsi); 1166 scsi_scan_host(host);
1144 g->fops = &idescsi_ops; 1167 return 0;
1145 ide_register_region(g);
1146 err = scsi_add_host(host, &drive->gendev);
1147 if (!err) {
1148 scsi_scan_host(host);
1149 return 0;
1150 }
1151 /* fall through on error */
1152 ide_unregister_region(g);
1153 ide_unregister_subdriver(drive);
1154 } 1168 }
1169 /* fall through on error */
1170 ide_unregister_region(g);
1171 ide_unregister_subdriver(drive, &idescsi_driver);
1155 1172
1156 put_disk(g); 1173 put_disk(g);
1157out_host_put: 1174out_host_put:
@@ -1161,12 +1178,12 @@ out_host_put:
1161 1178
1162static int __init init_idescsi_module(void) 1179static int __init init_idescsi_module(void)
1163{ 1180{
1164 return ide_register_driver(&idescsi_driver); 1181 return driver_register(&idescsi_driver.gen_driver);
1165} 1182}
1166 1183
1167static void __exit exit_idescsi_module(void) 1184static void __exit exit_idescsi_module(void)
1168{ 1185{
1169 ide_unregister_driver(&idescsi_driver); 1186 driver_unregister(&idescsi_driver.gen_driver);
1170} 1187}
1171 1188
1172module_init(init_idescsi_module); 1189module_init(init_idescsi_module);
diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c
index be7f2ca0183f..65e845665b85 100644
--- a/drivers/scsi/imm.c
+++ b/drivers/scsi/imm.c
@@ -18,6 +18,7 @@
18#include <linux/blkdev.h> 18#include <linux/blkdev.h>
19#include <linux/parport.h> 19#include <linux/parport.h>
20#include <linux/workqueue.h> 20#include <linux/workqueue.h>
21#include <linux/delay.h>
21#include <asm/io.h> 22#include <asm/io.h>
22 23
23#include <scsi/scsi.h> 24#include <scsi/scsi.h>
@@ -610,9 +611,9 @@ static int imm_init(imm_struct *dev)
610 if (imm_connect(dev, 0) != 1) 611 if (imm_connect(dev, 0) != 1)
611 return -EIO; 612 return -EIO;
612 imm_reset_pulse(dev->base); 613 imm_reset_pulse(dev->base);
613 udelay(1000); /* Delay to allow devices to settle */ 614 mdelay(1); /* Delay to allow devices to settle */
614 imm_disconnect(dev); 615 imm_disconnect(dev);
615 udelay(1000); /* Another delay to allow devices to settle */ 616 mdelay(1); /* Another delay to allow devices to settle */
616 return device_check(dev); 617 return device_check(dev);
617} 618}
618 619
@@ -1026,9 +1027,9 @@ static int imm_reset(struct scsi_cmnd *cmd)
1026 1027
1027 imm_connect(dev, CONNECT_NORMAL); 1028 imm_connect(dev, CONNECT_NORMAL);
1028 imm_reset_pulse(dev->base); 1029 imm_reset_pulse(dev->base);
1029 udelay(1000); /* device settle delay */ 1030 mdelay(1); /* device settle delay */
1030 imm_disconnect(dev); 1031 imm_disconnect(dev);
1031 udelay(1000); /* device settle delay */ 1032 mdelay(1); /* device settle delay */
1032 return SUCCESS; 1033 return SUCCESS;
1033} 1034}
1034 1035
diff --git a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c
index 0bb0369efb2d..aed7e64865fa 100644
--- a/drivers/scsi/in2000.c
+++ b/drivers/scsi/in2000.c
@@ -1644,14 +1644,16 @@ static int in2000_bus_reset(Scsi_Cmnd * cmd)
1644 struct Scsi_Host *instance; 1644 struct Scsi_Host *instance;
1645 struct IN2000_hostdata *hostdata; 1645 struct IN2000_hostdata *hostdata;
1646 int x; 1646 int x;
1647 unsigned long flags;
1647 1648
1648 instance = cmd->device->host; 1649 instance = cmd->device->host;
1649 hostdata = (struct IN2000_hostdata *) instance->hostdata; 1650 hostdata = (struct IN2000_hostdata *) instance->hostdata;
1650 1651
1651 printk(KERN_WARNING "scsi%d: Reset. ", instance->host_no); 1652 printk(KERN_WARNING "scsi%d: Reset. ", instance->host_no);
1652 1653
1653 /* do scsi-reset here */ 1654 spin_lock_irqsave(instance->host_lock, flags);
1654 1655
1656 /* do scsi-reset here */
1655 reset_hardware(instance, RESET_CARD_AND_BUS); 1657 reset_hardware(instance, RESET_CARD_AND_BUS);
1656 for (x = 0; x < 8; x++) { 1658 for (x = 0; x < 8; x++) {
1657 hostdata->busy[x] = 0; 1659 hostdata->busy[x] = 0;
@@ -1668,21 +1670,12 @@ static int in2000_bus_reset(Scsi_Cmnd * cmd)
1668 hostdata->outgoing_len = 0; 1670 hostdata->outgoing_len = 0;
1669 1671
1670 cmd->result = DID_RESET << 16; 1672 cmd->result = DID_RESET << 16;
1671 return SUCCESS;
1672}
1673 1673
1674static int in2000_host_reset(Scsi_Cmnd * cmd) 1674 spin_unlock_irqrestore(instance->host_lock, flags);
1675{ 1675 return SUCCESS;
1676 return FAILED;
1677}
1678
1679static int in2000_device_reset(Scsi_Cmnd * cmd)
1680{
1681 return FAILED;
1682} 1676}
1683 1677
1684 1678static int __in2000_abort(Scsi_Cmnd * cmd)
1685static int in2000_abort(Scsi_Cmnd * cmd)
1686{ 1679{
1687 struct Scsi_Host *instance; 1680 struct Scsi_Host *instance;
1688 struct IN2000_hostdata *hostdata; 1681 struct IN2000_hostdata *hostdata;
@@ -1803,6 +1796,16 @@ static int in2000_abort(Scsi_Cmnd * cmd)
1803 return SUCCESS; 1796 return SUCCESS;
1804} 1797}
1805 1798
1799static int in2000_abort(Scsi_Cmnd * cmd)
1800{
1801 int rc;
1802
1803 spin_lock_irq(cmd->device->host->host_lock);
1804 rc = __in2000_abort(cmd);
1805 spin_unlock_irq(cmd->device->host->host_lock);
1806
1807 return rc;
1808}
1806 1809
1807 1810
1808#define MAX_IN2000_HOSTS 3 1811#define MAX_IN2000_HOSTS 3
@@ -2311,8 +2314,6 @@ static Scsi_Host_Template driver_template = {
2311 .queuecommand = in2000_queuecommand, 2314 .queuecommand = in2000_queuecommand,
2312 .eh_abort_handler = in2000_abort, 2315 .eh_abort_handler = in2000_abort,
2313 .eh_bus_reset_handler = in2000_bus_reset, 2316 .eh_bus_reset_handler = in2000_bus_reset,
2314 .eh_device_reset_handler = in2000_device_reset,
2315 .eh_host_reset_handler = in2000_host_reset,
2316 .bios_param = in2000_biosparam, 2317 .bios_param = in2000_biosparam,
2317 .can_queue = IN2000_CAN_Q, 2318 .can_queue = IN2000_CAN_Q,
2318 .this_id = IN2000_HOST_ID, 2319 .this_id = IN2000_HOST_ID,
diff --git a/drivers/scsi/in2000.h b/drivers/scsi/in2000.h
index 019e45df3016..a240b52554d8 100644
--- a/drivers/scsi/in2000.h
+++ b/drivers/scsi/in2000.h
@@ -401,9 +401,7 @@ static int in2000_abort(Scsi_Cmnd *);
401static void in2000_setup(char *, int *) in2000__INIT; 401static void in2000_setup(char *, int *) in2000__INIT;
402static int in2000_biosparam(struct scsi_device *, struct block_device *, 402static int in2000_biosparam(struct scsi_device *, struct block_device *,
403 sector_t, int *); 403 sector_t, int *);
404static int in2000_host_reset(Scsi_Cmnd *);
405static int in2000_bus_reset(Scsi_Cmnd *); 404static int in2000_bus_reset(Scsi_Cmnd *);
406static int in2000_device_reset(Scsi_Cmnd *);
407 405
408 406
409#define IN2000_CAN_Q 16 407#define IN2000_CAN_Q 16
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index a7b74d8c53b9..f7ddc9f1ba41 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -3014,7 +3014,11 @@ static int i91u_bus_reset(struct scsi_cmnd * SCpnt)
3014 HCS *pHCB; 3014 HCS *pHCB;
3015 3015
3016 pHCB = (HCS *) SCpnt->device->host->base; 3016 pHCB = (HCS *) SCpnt->device->host->base;
3017
3018 spin_lock_irq(SCpnt->device->host->host_lock);
3017 tul_reset_scsi(pHCB, 0); 3019 tul_reset_scsi(pHCB, 0);
3020 spin_unlock_irq(SCpnt->device->host->host_lock);
3021
3018 return SUCCESS; 3022 return SUCCESS;
3019} 3023}
3020 3024
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 5441531c0d8e..80d022625c82 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -1053,7 +1053,7 @@ static void ipr_log_array_error(struct ipr_ioa_cfg *ioa_cfg,
1053 array_entry->dev_res_addr.lun); 1053 array_entry->dev_res_addr.lun);
1054 } 1054 }
1055 1055
1056 if (array_entry->dev_res_addr.bus >= IPR_MAX_NUM_BUSES) { 1056 if (array_entry->expected_dev_res_addr.bus >= IPR_MAX_NUM_BUSES) {
1057 ipr_err("Expected Location: unknown\n"); 1057 ipr_err("Expected Location: unknown\n");
1058 } else { 1058 } else {
1059 ipr_err("Expected Location: %d:%d:%d:%d\n", 1059 ipr_err("Expected Location: %d:%d:%d:%d\n",
@@ -2716,7 +2716,7 @@ static int ipr_change_queue_type(struct scsi_device *sdev, int tag_type)
2716 * Return value: 2716 * Return value:
2717 * number of bytes printed to buffer 2717 * number of bytes printed to buffer
2718 **/ 2718 **/
2719static ssize_t ipr_show_adapter_handle(struct device *dev, char *buf) 2719static ssize_t ipr_show_adapter_handle(struct device *dev, struct device_attribute *attr, char *buf)
2720{ 2720{
2721 struct scsi_device *sdev = to_scsi_device(dev); 2721 struct scsi_device *sdev = to_scsi_device(dev);
2722 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)sdev->host->hostdata; 2722 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)sdev->host->hostdata;
@@ -2885,7 +2885,7 @@ static int ipr_slave_alloc(struct scsi_device *sdev)
2885 * Return value: 2885 * Return value:
2886 * SUCCESS / FAILED 2886 * SUCCESS / FAILED
2887 **/ 2887 **/
2888static int ipr_eh_host_reset(struct scsi_cmnd * scsi_cmd) 2888static int __ipr_eh_host_reset(struct scsi_cmnd * scsi_cmd)
2889{ 2889{
2890 struct ipr_ioa_cfg *ioa_cfg; 2890 struct ipr_ioa_cfg *ioa_cfg;
2891 int rc; 2891 int rc;
@@ -2905,6 +2905,17 @@ static int ipr_eh_host_reset(struct scsi_cmnd * scsi_cmd)
2905 return rc; 2905 return rc;
2906} 2906}
2907 2907
2908static int ipr_eh_host_reset(struct scsi_cmnd * cmd)
2909{
2910 int rc;
2911
2912 spin_lock_irq(cmd->device->host->host_lock);
2913 rc = __ipr_eh_host_reset(cmd);
2914 spin_unlock_irq(cmd->device->host->host_lock);
2915
2916 return rc;
2917}
2918
2908/** 2919/**
2909 * ipr_eh_dev_reset - Reset the device 2920 * ipr_eh_dev_reset - Reset the device
2910 * @scsi_cmd: scsi command struct 2921 * @scsi_cmd: scsi command struct
@@ -2916,7 +2927,7 @@ static int ipr_eh_host_reset(struct scsi_cmnd * scsi_cmd)
2916 * Return value: 2927 * Return value:
2917 * SUCCESS / FAILED 2928 * SUCCESS / FAILED
2918 **/ 2929 **/
2919static int ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd) 2930static int __ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd)
2920{ 2931{
2921 struct ipr_cmnd *ipr_cmd; 2932 struct ipr_cmnd *ipr_cmd;
2922 struct ipr_ioa_cfg *ioa_cfg; 2933 struct ipr_ioa_cfg *ioa_cfg;
@@ -2970,6 +2981,17 @@ static int ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd)
2970 return (IPR_IOASC_SENSE_KEY(ioasc) ? FAILED : SUCCESS); 2981 return (IPR_IOASC_SENSE_KEY(ioasc) ? FAILED : SUCCESS);
2971} 2982}
2972 2983
2984static int ipr_eh_dev_reset(struct scsi_cmnd * cmd)
2985{
2986 int rc;
2987
2988 spin_lock_irq(cmd->device->host->host_lock);
2989 rc = __ipr_eh_dev_reset(cmd);
2990 spin_unlock_irq(cmd->device->host->host_lock);
2991
2992 return rc;
2993}
2994
2973/** 2995/**
2974 * ipr_bus_reset_done - Op done function for bus reset. 2996 * ipr_bus_reset_done - Op done function for bus reset.
2975 * @ipr_cmd: ipr command struct 2997 * @ipr_cmd: ipr command struct
@@ -3068,6 +3090,12 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd)
3068 ioa_cfg = (struct ipr_ioa_cfg *)scsi_cmd->device->host->hostdata; 3090 ioa_cfg = (struct ipr_ioa_cfg *)scsi_cmd->device->host->hostdata;
3069 res = scsi_cmd->device->hostdata; 3091 res = scsi_cmd->device->hostdata;
3070 3092
3093 /* If we are currently going through reset/reload, return failed.
3094 * This will force the mid-layer to call ipr_eh_host_reset,
3095 * which will then go to sleep and wait for the reset to complete
3096 */
3097 if (ioa_cfg->in_reset_reload || ioa_cfg->ioa_is_dead)
3098 return FAILED;
3071 if (!res || (!ipr_is_gscsi(res) && !ipr_is_vset_device(res))) 3099 if (!res || (!ipr_is_gscsi(res) && !ipr_is_vset_device(res)))
3072 return FAILED; 3100 return FAILED;
3073 3101
@@ -3118,23 +3146,17 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd)
3118 **/ 3146 **/
3119static int ipr_eh_abort(struct scsi_cmnd * scsi_cmd) 3147static int ipr_eh_abort(struct scsi_cmnd * scsi_cmd)
3120{ 3148{
3121 struct ipr_ioa_cfg *ioa_cfg; 3149 unsigned long flags;
3150 int rc;
3122 3151
3123 ENTER; 3152 ENTER;
3124 ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata;
3125 3153
3126 /* If we are currently going through reset/reload, return failed. This will force the 3154 spin_lock_irqsave(scsi_cmd->device->host->host_lock, flags);
3127 mid-layer to call ipr_eh_host_reset, which will then go to sleep and wait for the 3155 rc = ipr_cancel_op(scsi_cmd);
3128 reset to complete */ 3156 spin_unlock_irqrestore(scsi_cmd->device->host->host_lock, flags);
3129 if (ioa_cfg->in_reset_reload)
3130 return FAILED;
3131 if (ioa_cfg->ioa_is_dead)
3132 return FAILED;
3133 if (!scsi_cmd->device->hostdata)
3134 return FAILED;
3135 3157
3136 LEAVE; 3158 LEAVE;
3137 return ipr_cancel_op(scsi_cmd); 3159 return rc;
3138} 3160}
3139 3161
3140/** 3162/**
@@ -5886,6 +5908,7 @@ static void __ipr_remove(struct pci_dev *pdev)
5886 5908
5887 spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags); 5909 spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags);
5888 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload); 5910 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
5911 flush_scheduled_work();
5889 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags); 5912 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags);
5890 5913
5891 spin_lock(&ipr_driver_lock); 5914 spin_lock(&ipr_driver_lock);
@@ -5916,8 +5939,6 @@ static void ipr_remove(struct pci_dev *pdev)
5916 5939
5917 ENTER; 5940 ENTER;
5918 5941
5919 ioa_cfg->allow_cmds = 0;
5920 flush_scheduled_work();
5921 ipr_remove_trace_file(&ioa_cfg->host->shost_classdev.kobj, 5942 ipr_remove_trace_file(&ioa_cfg->host->shost_classdev.kobj,
5922 &ipr_trace_attr); 5943 &ipr_trace_attr);
5923 ipr_remove_dump_file(&ioa_cfg->host->shost_classdev.kobj, 5944 ipr_remove_dump_file(&ioa_cfg->host->shost_classdev.kobj,
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 446f4259285b..cbff3ea3cd89 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -36,8 +36,8 @@
36/* 36/*
37 * Literals 37 * Literals
38 */ 38 */
39#define IPR_DRIVER_VERSION "2.0.13" 39#define IPR_DRIVER_VERSION "2.0.14"
40#define IPR_DRIVER_DATE "(February 21, 2005)" 40#define IPR_DRIVER_DATE "(May 2, 2005)"
41 41
42/* 42/*
43 * IPR_DBG_TRACE: Setting this to 1 will turn on some general function tracing 43 * IPR_DBG_TRACE: Setting this to 1 will turn on some general function tracing
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index fbc2cb6667a1..6dfcb4fbccdd 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -819,12 +819,15 @@ ips_eh_abort(Scsi_Cmnd * SC)
819 ips_ha_t *ha; 819 ips_ha_t *ha;
820 ips_copp_wait_item_t *item; 820 ips_copp_wait_item_t *item;
821 int ret; 821 int ret;
822 unsigned long cpu_flags;
823 struct Scsi_Host *host;
822 824
823 METHOD_TRACE("ips_eh_abort", 1); 825 METHOD_TRACE("ips_eh_abort", 1);
824 826
825 if (!SC) 827 if (!SC)
826 return (FAILED); 828 return (FAILED);
827 829
830 host = SC->device->host;
828 ha = (ips_ha_t *) SC->device->host->hostdata; 831 ha = (ips_ha_t *) SC->device->host->hostdata;
829 832
830 if (!ha) 833 if (!ha)
@@ -833,6 +836,8 @@ ips_eh_abort(Scsi_Cmnd * SC)
833 if (!ha->active) 836 if (!ha->active)
834 return (FAILED); 837 return (FAILED);
835 838
839 IPS_LOCK_SAVE(host->host_lock, cpu_flags);
840
836 /* See if the command is on the copp queue */ 841 /* See if the command is on the copp queue */
837 item = ha->copp_waitlist.head; 842 item = ha->copp_waitlist.head;
838 while ((item) && (item->scsi_cmd != SC)) 843 while ((item) && (item->scsi_cmd != SC))
@@ -851,6 +856,8 @@ ips_eh_abort(Scsi_Cmnd * SC)
851 /* command must have already been sent */ 856 /* command must have already been sent */
852 ret = (FAILED); 857 ret = (FAILED);
853 } 858 }
859
860 IPS_UNLOCK_RESTORE(host->host_lock, cpu_flags);
854 return ret; 861 return ret;
855} 862}
856 863
@@ -866,7 +873,7 @@ ips_eh_abort(Scsi_Cmnd * SC)
866/* */ 873/* */
867/****************************************************************************/ 874/****************************************************************************/
868static int 875static int
869ips_eh_reset(Scsi_Cmnd * SC) 876__ips_eh_reset(Scsi_Cmnd * SC)
870{ 877{
871 int ret; 878 int ret;
872 int i; 879 int i;
@@ -1053,6 +1060,18 @@ ips_eh_reset(Scsi_Cmnd * SC)
1053 1060
1054} 1061}
1055 1062
1063static int
1064ips_eh_reset(Scsi_Cmnd * SC)
1065{
1066 int rc;
1067
1068 spin_lock_irq(SC->device->host->host_lock);
1069 rc = __ips_eh_reset(SC);
1070 spin_unlock_irq(SC->device->host->host_lock);
1071
1072 return rc;
1073}
1074
1056/****************************************************************************/ 1075/****************************************************************************/
1057/* */ 1076/* */
1058/* Routine Name: ips_queue */ 1077/* Routine Name: ips_queue */
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index ee9b96da841e..36b401fee1f1 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -186,6 +186,28 @@ static void ata_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf)
186 ata_wait_idle(ap); 186 ata_wait_idle(ap);
187} 187}
188 188
189
190/**
191 * ata_tf_load - send taskfile registers to host controller
192 * @ap: Port to which output is sent
193 * @tf: ATA taskfile register set
194 *
195 * Outputs ATA taskfile to standard ATA host controller using MMIO
196 * or PIO as indicated by the ATA_FLAG_MMIO flag.
197 * Writes the control, feature, nsect, lbal, lbam, and lbah registers.
198 * Optionally (ATA_TFLAG_LBA48) writes hob_feature, hob_nsect,
199 * hob_lbal, hob_lbam, and hob_lbah.
200 *
201 * This function waits for idle (!BUSY and !DRQ) after writing
202 * registers. If the control register has a new value, this
203 * function also waits for idle after writing control and before
204 * writing the remaining registers.
205 *
206 * May be used as the tf_load() entry in ata_port_operations.
207 *
208 * LOCKING:
209 * Inherited from caller.
210 */
189void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf) 211void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf)
190{ 212{
191 if (ap->flags & ATA_FLAG_MMIO) 213 if (ap->flags & ATA_FLAG_MMIO)
@@ -195,11 +217,11 @@ void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf)
195} 217}
196 218
197/** 219/**
198 * ata_exec_command - issue ATA command to host controller 220 * ata_exec_command_pio - issue ATA command to host controller
199 * @ap: port to which command is being issued 221 * @ap: port to which command is being issued
200 * @tf: ATA taskfile register set 222 * @tf: ATA taskfile register set
201 * 223 *
202 * Issues PIO/MMIO write to ATA command register, with proper 224 * Issues PIO write to ATA command register, with proper
203 * synchronization with interrupt handler / other threads. 225 * synchronization with interrupt handler / other threads.
204 * 226 *
205 * LOCKING: 227 * LOCKING:
@@ -235,6 +257,18 @@ static void ata_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf)
235 ata_pause(ap); 257 ata_pause(ap);
236} 258}
237 259
260
261/**
262 * ata_exec_command - issue ATA command to host controller
263 * @ap: port to which command is being issued
264 * @tf: ATA taskfile register set
265 *
266 * Issues PIO/MMIO write to ATA command register, with proper
267 * synchronization with interrupt handler / other threads.
268 *
269 * LOCKING:
270 * spin_lock_irqsave(host_set lock)
271 */
238void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf) 272void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf)
239{ 273{
240 if (ap->flags & ATA_FLAG_MMIO) 274 if (ap->flags & ATA_FLAG_MMIO)
@@ -305,7 +339,7 @@ void ata_tf_to_host_nolock(struct ata_port *ap, struct ata_taskfile *tf)
305} 339}
306 340
307/** 341/**
308 * ata_tf_read - input device's ATA taskfile shadow registers 342 * ata_tf_read_pio - input device's ATA taskfile shadow registers
309 * @ap: Port from which input is read 343 * @ap: Port from which input is read
310 * @tf: ATA taskfile register set for storing input 344 * @tf: ATA taskfile register set for storing input
311 * 345 *
@@ -368,6 +402,23 @@ static void ata_tf_read_mmio(struct ata_port *ap, struct ata_taskfile *tf)
368 } 402 }
369} 403}
370 404
405
406/**
407 * ata_tf_read - input device's ATA taskfile shadow registers
408 * @ap: Port from which input is read
409 * @tf: ATA taskfile register set for storing input
410 *
411 * Reads ATA taskfile registers for currently-selected device
412 * into @tf.
413 *
414 * Reads nsect, lbal, lbam, lbah, and device. If ATA_TFLAG_LBA48
415 * is set, also reads the hob registers.
416 *
417 * May be used as the tf_read() entry in ata_port_operations.
418 *
419 * LOCKING:
420 * Inherited from caller.
421 */
371void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) 422void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
372{ 423{
373 if (ap->flags & ATA_FLAG_MMIO) 424 if (ap->flags & ATA_FLAG_MMIO)
@@ -381,7 +432,7 @@ void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
381 * @ap: port where the device is 432 * @ap: port where the device is
382 * 433 *
383 * Reads ATA taskfile status register for currently-selected device 434 * Reads ATA taskfile status register for currently-selected device
384 * and return it's value. This also clears pending interrupts 435 * and return its value. This also clears pending interrupts
385 * from this device 436 * from this device
386 * 437 *
387 * LOCKING: 438 * LOCKING:
@@ -397,7 +448,7 @@ static u8 ata_check_status_pio(struct ata_port *ap)
397 * @ap: port where the device is 448 * @ap: port where the device is
398 * 449 *
399 * Reads ATA taskfile status register for currently-selected device 450 * Reads ATA taskfile status register for currently-selected device
400 * via MMIO and return it's value. This also clears pending interrupts 451 * via MMIO and return its value. This also clears pending interrupts
401 * from this device 452 * from this device
402 * 453 *
403 * LOCKING: 454 * LOCKING:
@@ -408,6 +459,20 @@ static u8 ata_check_status_mmio(struct ata_port *ap)
408 return readb((void __iomem *) ap->ioaddr.status_addr); 459 return readb((void __iomem *) ap->ioaddr.status_addr);
409} 460}
410 461
462
463/**
464 * ata_check_status - Read device status reg & clear interrupt
465 * @ap: port where the device is
466 *
467 * Reads ATA taskfile status register for currently-selected device
468 * and return its value. This also clears pending interrupts
469 * from this device
470 *
471 * May be used as the check_status() entry in ata_port_operations.
472 *
473 * LOCKING:
474 * Inherited from caller.
475 */
411u8 ata_check_status(struct ata_port *ap) 476u8 ata_check_status(struct ata_port *ap)
412{ 477{
413 if (ap->flags & ATA_FLAG_MMIO) 478 if (ap->flags & ATA_FLAG_MMIO)
@@ -415,6 +480,20 @@ u8 ata_check_status(struct ata_port *ap)
415 return ata_check_status_pio(ap); 480 return ata_check_status_pio(ap);
416} 481}
417 482
483
484/**
485 * ata_altstatus - Read device alternate status reg
486 * @ap: port where the device is
487 *
488 * Reads ATA taskfile alternate status register for
489 * currently-selected device and return its value.
490 *
491 * Note: may NOT be used as the check_altstatus() entry in
492 * ata_port_operations.
493 *
494 * LOCKING:
495 * Inherited from caller.
496 */
418u8 ata_altstatus(struct ata_port *ap) 497u8 ata_altstatus(struct ata_port *ap)
419{ 498{
420 if (ap->ops->check_altstatus) 499 if (ap->ops->check_altstatus)
@@ -425,6 +504,20 @@ u8 ata_altstatus(struct ata_port *ap)
425 return inb(ap->ioaddr.altstatus_addr); 504 return inb(ap->ioaddr.altstatus_addr);
426} 505}
427 506
507
508/**
509 * ata_chk_err - Read device error reg
510 * @ap: port where the device is
511 *
512 * Reads ATA taskfile error register for
513 * currently-selected device and return its value.
514 *
515 * Note: may NOT be used as the check_err() entry in
516 * ata_port_operations.
517 *
518 * LOCKING:
519 * Inherited from caller.
520 */
428u8 ata_chk_err(struct ata_port *ap) 521u8 ata_chk_err(struct ata_port *ap)
429{ 522{
430 if (ap->ops->check_err) 523 if (ap->ops->check_err)
@@ -873,10 +966,24 @@ void ata_dev_id_string(u16 *id, unsigned char *s,
873 } 966 }
874} 967}
875 968
969
970/**
971 * ata_noop_dev_select - Select device 0/1 on ATA bus
972 * @ap: ATA channel to manipulate
973 * @device: ATA device (numbered from zero) to select
974 *
975 * This function performs no actual function.
976 *
977 * May be used as the dev_select() entry in ata_port_operations.
978 *
979 * LOCKING:
980 * caller.
981 */
876void ata_noop_dev_select (struct ata_port *ap, unsigned int device) 982void ata_noop_dev_select (struct ata_port *ap, unsigned int device)
877{ 983{
878} 984}
879 985
986
880/** 987/**
881 * ata_std_dev_select - Select device 0/1 on ATA bus 988 * ata_std_dev_select - Select device 0/1 on ATA bus
882 * @ap: ATA channel to manipulate 989 * @ap: ATA channel to manipulate
@@ -884,7 +991,9 @@ void ata_noop_dev_select (struct ata_port *ap, unsigned int device)
884 * 991 *
885 * Use the method defined in the ATA specification to 992 * Use the method defined in the ATA specification to
886 * make either device 0, or device 1, active on the 993 * make either device 0, or device 1, active on the
887 * ATA channel. 994 * ATA channel. Works with both PIO and MMIO.
995 *
996 * May be used as the dev_select() entry in ata_port_operations.
888 * 997 *
889 * LOCKING: 998 * LOCKING:
890 * caller. 999 * caller.
@@ -1186,11 +1295,47 @@ err_out:
1186 DPRINTK("EXIT, err\n"); 1295 DPRINTK("EXIT, err\n");
1187} 1296}
1188 1297
1298
1299static inline u8 ata_dev_knobble(struct ata_port *ap)
1300{
1301 return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id)));
1302}
1303
1304/**
1305 * ata_dev_config - Run device specific handlers and check for
1306 * SATA->PATA bridges
1307 * @ap: Bus
1308 * @i: Device
1309 *
1310 * LOCKING:
1311 */
1312
1313void ata_dev_config(struct ata_port *ap, unsigned int i)
1314{
1315 /* limit bridge transfers to udma5, 200 sectors */
1316 if (ata_dev_knobble(ap)) {
1317 printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
1318 ap->id, ap->device->devno);
1319 ap->udma_mask &= ATA_UDMA5;
1320 ap->host->max_sectors = ATA_MAX_SECTORS;
1321 ap->host->hostt->max_sectors = ATA_MAX_SECTORS;
1322 ap->device->flags |= ATA_DFLAG_LOCK_SECTORS;
1323 }
1324
1325 if (ap->ops->dev_config)
1326 ap->ops->dev_config(ap, &ap->device[i]);
1327}
1328
1189/** 1329/**
1190 * ata_bus_probe - Reset and probe ATA bus 1330 * ata_bus_probe - Reset and probe ATA bus
1191 * @ap: Bus to probe 1331 * @ap: Bus to probe
1192 * 1332 *
1333 * Master ATA bus probing function. Initiates a hardware-dependent
1334 * bus reset, then attempts to identify any devices found on
1335 * the bus.
1336 *
1193 * LOCKING: 1337 * LOCKING:
1338 * PCI/etc. bus probe sem.
1194 * 1339 *
1195 * RETURNS: 1340 * RETURNS:
1196 * Zero on success, non-zero on error. 1341 * Zero on success, non-zero on error.
@@ -1208,8 +1353,7 @@ static int ata_bus_probe(struct ata_port *ap)
1208 ata_dev_identify(ap, i); 1353 ata_dev_identify(ap, i);
1209 if (ata_dev_present(&ap->device[i])) { 1354 if (ata_dev_present(&ap->device[i])) {
1210 found = 1; 1355 found = 1;
1211 if (ap->ops->dev_config) 1356 ata_dev_config(ap,i);
1212 ap->ops->dev_config(ap, &ap->device[i]);
1213 } 1357 }
1214 } 1358 }
1215 1359
@@ -1229,10 +1373,14 @@ err_out:
1229} 1373}
1230 1374
1231/** 1375/**
1232 * ata_port_probe - 1376 * ata_port_probe - Mark port as enabled
1233 * @ap: 1377 * @ap: Port for which we indicate enablement
1234 * 1378 *
1235 * LOCKING: 1379 * Modify @ap data structure such that the system
1380 * thinks that the entire port is enabled.
1381 *
1382 * LOCKING: host_set lock, or some other form of
1383 * serialization.
1236 */ 1384 */
1237 1385
1238void ata_port_probe(struct ata_port *ap) 1386void ata_port_probe(struct ata_port *ap)
@@ -1241,10 +1389,15 @@ void ata_port_probe(struct ata_port *ap)
1241} 1389}
1242 1390
1243/** 1391/**
1244 * __sata_phy_reset - 1392 * __sata_phy_reset - Wake/reset a low-level SATA PHY
1245 * @ap: 1393 * @ap: SATA port associated with target SATA PHY.
1394 *
1395 * This function issues commands to standard SATA Sxxx
1396 * PHY registers, to wake up the phy (and device), and
1397 * clear any reset condition.
1246 * 1398 *
1247 * LOCKING: 1399 * LOCKING:
1400 * PCI/etc. bus probe sem.
1248 * 1401 *
1249 */ 1402 */
1250void __sata_phy_reset(struct ata_port *ap) 1403void __sata_phy_reset(struct ata_port *ap)
@@ -1289,10 +1442,14 @@ void __sata_phy_reset(struct ata_port *ap)
1289} 1442}
1290 1443
1291/** 1444/**
1292 * __sata_phy_reset - 1445 * sata_phy_reset - Reset SATA bus.
1293 * @ap: 1446 * @ap: SATA port associated with target SATA PHY.
1447 *
1448 * This function resets the SATA bus, and then probes
1449 * the bus for devices.
1294 * 1450 *
1295 * LOCKING: 1451 * LOCKING:
1452 * PCI/etc. bus probe sem.
1296 * 1453 *
1297 */ 1454 */
1298void sata_phy_reset(struct ata_port *ap) 1455void sata_phy_reset(struct ata_port *ap)
@@ -1304,10 +1461,16 @@ void sata_phy_reset(struct ata_port *ap)
1304} 1461}
1305 1462
1306/** 1463/**
1307 * ata_port_disable - 1464 * ata_port_disable - Disable port.
1308 * @ap: 1465 * @ap: Port to be disabled.
1309 * 1466 *
1310 * LOCKING: 1467 * Modify @ap data structure such that the system
1468 * thinks that the entire port is disabled, and should
1469 * never attempt to probe or communicate with devices
1470 * on this port.
1471 *
1472 * LOCKING: host_set lock, or some other form of
1473 * serialization.
1311 */ 1474 */
1312 1475
1313void ata_port_disable(struct ata_port *ap) 1476void ata_port_disable(struct ata_port *ap)
@@ -1416,7 +1579,10 @@ static void ata_host_set_dma(struct ata_port *ap, u8 xfer_mode,
1416 * ata_set_mode - Program timings and issue SET FEATURES - XFER 1579 * ata_set_mode - Program timings and issue SET FEATURES - XFER
1417 * @ap: port on which timings will be programmed 1580 * @ap: port on which timings will be programmed
1418 * 1581 *
1582 * Set ATA device disk transfer mode (PIO3, UDMA6, etc.).
1583 *
1419 * LOCKING: 1584 * LOCKING:
1585 * PCI/etc. bus probe sem.
1420 * 1586 *
1421 */ 1587 */
1422static void ata_set_mode(struct ata_port *ap) 1588static void ata_set_mode(struct ata_port *ap)
@@ -1467,7 +1633,10 @@ err_out:
1467 * @tmout_pat: impatience timeout 1633 * @tmout_pat: impatience timeout
1468 * @tmout: overall timeout 1634 * @tmout: overall timeout
1469 * 1635 *
1470 * LOCKING: 1636 * Sleep until ATA Status register bit BSY clears,
1637 * or a timeout occurs.
1638 *
1639 * LOCKING: None.
1471 * 1640 *
1472 */ 1641 */
1473 1642
@@ -1553,10 +1722,14 @@ static void ata_bus_post_reset(struct ata_port *ap, unsigned int devmask)
1553} 1722}
1554 1723
1555/** 1724/**
1556 * ata_bus_edd - 1725 * ata_bus_edd - Issue EXECUTE DEVICE DIAGNOSTIC command.
1557 * @ap: 1726 * @ap: Port to reset and probe
1727 *
1728 * Use the EXECUTE DEVICE DIAGNOSTIC command to reset and
1729 * probe the bus. Not often used these days.
1558 * 1730 *
1559 * LOCKING: 1731 * LOCKING:
1732 * PCI/etc. bus probe sem.
1560 * 1733 *
1561 */ 1734 */
1562 1735
@@ -1633,8 +1806,8 @@ static unsigned int ata_bus_softreset(struct ata_port *ap,
1633 * the device is ATA or ATAPI. 1806 * the device is ATA or ATAPI.
1634 * 1807 *
1635 * LOCKING: 1808 * LOCKING:
1636 * Inherited from caller. Some functions called by this function 1809 * PCI/etc. bus probe sem.
1637 * obtain the host_set lock. 1810 * Obtains host_set lock.
1638 * 1811 *
1639 * SIDE EFFECTS: 1812 * SIDE EFFECTS:
1640 * Sets ATA_FLAG_PORT_DISABLED if bus reset fails. 1813 * Sets ATA_FLAG_PORT_DISABLED if bus reset fails.
@@ -1876,7 +2049,11 @@ static int fgb(u32 bitmap)
1876 * @xfer_mode_out: (output) SET FEATURES - XFER MODE code 2049 * @xfer_mode_out: (output) SET FEATURES - XFER MODE code
1877 * @xfer_shift_out: (output) bit shift that selects this mode 2050 * @xfer_shift_out: (output) bit shift that selects this mode
1878 * 2051 *
2052 * Based on host and device capabilities, determine the
2053 * maximum transfer mode that is amenable to all.
2054 *
1879 * LOCKING: 2055 * LOCKING:
2056 * PCI/etc. bus probe sem.
1880 * 2057 *
1881 * RETURNS: 2058 * RETURNS:
1882 * Zero on success, negative on error. 2059 * Zero on success, negative on error.
@@ -1909,7 +2086,11 @@ static int ata_choose_xfer_mode(struct ata_port *ap,
1909 * @ap: Port associated with device @dev 2086 * @ap: Port associated with device @dev
1910 * @dev: Device to which command will be sent 2087 * @dev: Device to which command will be sent
1911 * 2088 *
2089 * Issue SET FEATURES - XFER MODE command to device @dev
2090 * on port @ap.
2091 *
1912 * LOCKING: 2092 * LOCKING:
2093 * PCI/etc. bus probe sem.
1913 */ 2094 */
1914 2095
1915static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev) 2096static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev)
@@ -1947,10 +2128,13 @@ static void ata_dev_set_xfermode(struct ata_port *ap, struct ata_device *dev)
1947} 2128}
1948 2129
1949/** 2130/**
1950 * ata_sg_clean - 2131 * ata_sg_clean - Unmap DMA memory associated with command
1951 * @qc: 2132 * @qc: Command containing DMA memory to be released
2133 *
2134 * Unmap all mapped DMA memory associated with this command.
1952 * 2135 *
1953 * LOCKING: 2136 * LOCKING:
2137 * spin_lock_irqsave(host_set lock)
1954 */ 2138 */
1955 2139
1956static void ata_sg_clean(struct ata_queued_cmd *qc) 2140static void ata_sg_clean(struct ata_queued_cmd *qc)
@@ -1981,7 +2165,11 @@ static void ata_sg_clean(struct ata_queued_cmd *qc)
1981 * ata_fill_sg - Fill PCI IDE PRD table 2165 * ata_fill_sg - Fill PCI IDE PRD table
1982 * @qc: Metadata associated with taskfile to be transferred 2166 * @qc: Metadata associated with taskfile to be transferred
1983 * 2167 *
2168 * Fill PCI IDE PRD (scatter-gather) table with segments
2169 * associated with the current disk command.
2170 *
1984 * LOCKING: 2171 * LOCKING:
2172 * spin_lock_irqsave(host_set lock)
1985 * 2173 *
1986 */ 2174 */
1987static void ata_fill_sg(struct ata_queued_cmd *qc) 2175static void ata_fill_sg(struct ata_queued_cmd *qc)
@@ -2028,7 +2216,13 @@ static void ata_fill_sg(struct ata_queued_cmd *qc)
2028 * ata_check_atapi_dma - Check whether ATAPI DMA can be supported 2216 * ata_check_atapi_dma - Check whether ATAPI DMA can be supported
2029 * @qc: Metadata associated with taskfile to check 2217 * @qc: Metadata associated with taskfile to check
2030 * 2218 *
2219 * Allow low-level driver to filter ATA PACKET commands, returning
2220 * a status indicating whether or not it is OK to use DMA for the
2221 * supplied PACKET command.
2222 *
2031 * LOCKING: 2223 * LOCKING:
2224 * spin_lock_irqsave(host_set lock)
2225 *
2032 * RETURNS: 0 when ATAPI DMA can be used 2226 * RETURNS: 0 when ATAPI DMA can be used
2033 * nonzero otherwise 2227 * nonzero otherwise
2034 */ 2228 */
@@ -2046,6 +2240,8 @@ int ata_check_atapi_dma(struct ata_queued_cmd *qc)
2046 * ata_qc_prep - Prepare taskfile for submission 2240 * ata_qc_prep - Prepare taskfile for submission
2047 * @qc: Metadata associated with taskfile to be prepared 2241 * @qc: Metadata associated with taskfile to be prepared
2048 * 2242 *
2243 * Prepare ATA taskfile for submission.
2244 *
2049 * LOCKING: 2245 * LOCKING:
2050 * spin_lock_irqsave(host_set lock) 2246 * spin_lock_irqsave(host_set lock)
2051 */ 2247 */
@@ -2057,6 +2253,32 @@ void ata_qc_prep(struct ata_queued_cmd *qc)
2057 ata_fill_sg(qc); 2253 ata_fill_sg(qc);
2058} 2254}
2059 2255
2256/**
2257 * ata_sg_init_one - Associate command with memory buffer
2258 * @qc: Command to be associated
2259 * @buf: Memory buffer
2260 * @buflen: Length of memory buffer, in bytes.
2261 *
2262 * Initialize the data-related elements of queued_cmd @qc
2263 * to point to a single memory buffer, @buf of byte length @buflen.
2264 *
2265 * LOCKING:
2266 * spin_lock_irqsave(host_set lock)
2267 */
2268
2269
2270
2271/**
2272 * ata_sg_init_one - Prepare a one-entry scatter-gather list.
2273 * @qc: Queued command
2274 * @buf: transfer buffer
2275 * @buflen: length of buf
2276 *
2277 * Builds a single-entry scatter-gather list to initiate a
2278 * transfer utilizing the specified buffer.
2279 *
2280 * LOCKING:
2281 */
2060void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen) 2282void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen)
2061{ 2283{
2062 struct scatterlist *sg; 2284 struct scatterlist *sg;
@@ -2071,9 +2293,35 @@ void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen)
2071 sg = qc->sg; 2293 sg = qc->sg;
2072 sg->page = virt_to_page(buf); 2294 sg->page = virt_to_page(buf);
2073 sg->offset = (unsigned long) buf & ~PAGE_MASK; 2295 sg->offset = (unsigned long) buf & ~PAGE_MASK;
2074 sg_dma_len(sg) = buflen; 2296 sg->length = buflen;
2075} 2297}
2076 2298
2299/**
2300 * ata_sg_init - Associate command with scatter-gather table.
2301 * @qc: Command to be associated
2302 * @sg: Scatter-gather table.
2303 * @n_elem: Number of elements in s/g table.
2304 *
2305 * Initialize the data-related elements of queued_cmd @qc
2306 * to point to a scatter-gather table @sg, containing @n_elem
2307 * elements.
2308 *
2309 * LOCKING:
2310 * spin_lock_irqsave(host_set lock)
2311 */
2312
2313
2314/**
2315 * ata_sg_init - Assign a scatter gather list to a queued command
2316 * @qc: Queued command
2317 * @sg: Scatter-gather list
2318 * @n_elem: length of sg list
2319 *
2320 * Attaches a scatter-gather list to a queued command.
2321 *
2322 * LOCKING:
2323 */
2324
2077void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, 2325void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
2078 unsigned int n_elem) 2326 unsigned int n_elem)
2079{ 2327{
@@ -2083,14 +2331,16 @@ void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
2083} 2331}
2084 2332
2085/** 2333/**
2086 * ata_sg_setup_one - 2334 * ata_sg_setup_one - DMA-map the memory buffer associated with a command.
2087 * @qc: 2335 * @qc: Command with memory buffer to be mapped.
2336 *
2337 * DMA-map the memory buffer associated with queued_cmd @qc.
2088 * 2338 *
2089 * LOCKING: 2339 * LOCKING:
2090 * spin_lock_irqsave(host_set lock) 2340 * spin_lock_irqsave(host_set lock)
2091 * 2341 *
2092 * RETURNS: 2342 * RETURNS:
2093 * 2343 * Zero on success, negative on error.
2094 */ 2344 */
2095 2345
2096static int ata_sg_setup_one(struct ata_queued_cmd *qc) 2346static int ata_sg_setup_one(struct ata_queued_cmd *qc)
@@ -2101,11 +2351,12 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
2101 dma_addr_t dma_address; 2351 dma_addr_t dma_address;
2102 2352
2103 dma_address = dma_map_single(ap->host_set->dev, qc->buf_virt, 2353 dma_address = dma_map_single(ap->host_set->dev, qc->buf_virt,
2104 sg_dma_len(sg), dir); 2354 sg->length, dir);
2105 if (dma_mapping_error(dma_address)) 2355 if (dma_mapping_error(dma_address))
2106 return -1; 2356 return -1;
2107 2357
2108 sg_dma_address(sg) = dma_address; 2358 sg_dma_address(sg) = dma_address;
2359 sg_dma_len(sg) = sg->length;
2109 2360
2110 DPRINTK("mapped buffer of %d bytes for %s\n", sg_dma_len(sg), 2361 DPRINTK("mapped buffer of %d bytes for %s\n", sg_dma_len(sg),
2111 qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read"); 2362 qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read");
@@ -2114,13 +2365,16 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
2114} 2365}
2115 2366
2116/** 2367/**
2117 * ata_sg_setup - 2368 * ata_sg_setup - DMA-map the scatter-gather table associated with a command.
2118 * @qc: 2369 * @qc: Command with scatter-gather table to be mapped.
2370 *
2371 * DMA-map the scatter-gather table associated with queued_cmd @qc.
2119 * 2372 *
2120 * LOCKING: 2373 * LOCKING:
2121 * spin_lock_irqsave(host_set lock) 2374 * spin_lock_irqsave(host_set lock)
2122 * 2375 *
2123 * RETURNS: 2376 * RETURNS:
2377 * Zero on success, negative on error.
2124 * 2378 *
2125 */ 2379 */
2126 2380
@@ -2150,6 +2404,7 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)
2150 * @ap: 2404 * @ap:
2151 * 2405 *
2152 * LOCKING: 2406 * LOCKING:
2407 * None. (executing in kernel thread context)
2153 * 2408 *
2154 * RETURNS: 2409 * RETURNS:
2155 * 2410 *
@@ -2197,6 +2452,7 @@ static unsigned long ata_pio_poll(struct ata_port *ap)
2197 * @ap: 2452 * @ap:
2198 * 2453 *
2199 * LOCKING: 2454 * LOCKING:
2455 * None. (executing in kernel thread context)
2200 */ 2456 */
2201 2457
2202static void ata_pio_complete (struct ata_port *ap) 2458static void ata_pio_complete (struct ata_port *ap)
@@ -2239,6 +2495,18 @@ static void ata_pio_complete (struct ata_port *ap)
2239 ata_qc_complete(qc, drv_stat); 2495 ata_qc_complete(qc, drv_stat);
2240} 2496}
2241 2497
2498
2499/**
2500 * swap_buf_le16 -
2501 * @buf: Buffer to swap
2502 * @buf_words: Number of 16-bit words in buffer.
2503 *
2504 * Swap halves of 16-bit words if needed to convert from
2505 * little-endian byte order to native cpu byte order, or
2506 * vice-versa.
2507 *
2508 * LOCKING:
2509 */
2242void swap_buf_le16(u16 *buf, unsigned int buf_words) 2510void swap_buf_le16(u16 *buf, unsigned int buf_words)
2243{ 2511{
2244#ifdef __BIG_ENDIAN 2512#ifdef __BIG_ENDIAN
@@ -2310,7 +2578,7 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)
2310 qc->cursect++; 2578 qc->cursect++;
2311 qc->cursg_ofs++; 2579 qc->cursg_ofs++;
2312 2580
2313 if ((qc->cursg_ofs * ATA_SECT_SIZE) == sg_dma_len(&sg[qc->cursg])) { 2581 if ((qc->cursg_ofs * ATA_SECT_SIZE) == (&sg[qc->cursg])->length) {
2314 qc->cursg++; 2582 qc->cursg++;
2315 qc->cursg_ofs = 0; 2583 qc->cursg_ofs = 0;
2316 } 2584 }
@@ -2339,7 +2607,6 @@ static void __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes)
2339next_sg: 2607next_sg:
2340 sg = &qc->sg[qc->cursg]; 2608 sg = &qc->sg[qc->cursg];
2341 2609
2342next_page:
2343 page = sg->page; 2610 page = sg->page;
2344 offset = sg->offset + qc->cursg_ofs; 2611 offset = sg->offset + qc->cursg_ofs;
2345 2612
@@ -2347,7 +2614,8 @@ next_page:
2347 page = nth_page(page, (offset >> PAGE_SHIFT)); 2614 page = nth_page(page, (offset >> PAGE_SHIFT));
2348 offset %= PAGE_SIZE; 2615 offset %= PAGE_SIZE;
2349 2616
2350 count = min(sg_dma_len(sg) - qc->cursg_ofs, bytes); 2617 /* don't overrun current sg */
2618 count = min(sg->length - qc->cursg_ofs, bytes);
2351 2619
2352 /* don't cross page boundaries */ 2620 /* don't cross page boundaries */
2353 count = min(count, (unsigned int)PAGE_SIZE - offset); 2621 count = min(count, (unsigned int)PAGE_SIZE - offset);
@@ -2358,7 +2626,7 @@ next_page:
2358 qc->curbytes += count; 2626 qc->curbytes += count;
2359 qc->cursg_ofs += count; 2627 qc->cursg_ofs += count;
2360 2628
2361 if (qc->cursg_ofs == sg_dma_len(sg)) { 2629 if (qc->cursg_ofs == sg->length) {
2362 qc->cursg++; 2630 qc->cursg++;
2363 qc->cursg_ofs = 0; 2631 qc->cursg_ofs = 0;
2364 } 2632 }
@@ -2371,8 +2639,6 @@ next_page:
2371 kunmap(page); 2639 kunmap(page);
2372 2640
2373 if (bytes) { 2641 if (bytes) {
2374 if (qc->cursg_ofs < sg_dma_len(sg))
2375 goto next_page;
2376 goto next_sg; 2642 goto next_sg;
2377 } 2643 }
2378} 2644}
@@ -2414,6 +2680,7 @@ err_out:
2414 * @ap: 2680 * @ap:
2415 * 2681 *
2416 * LOCKING: 2682 * LOCKING:
2683 * None. (executing in kernel thread context)
2417 */ 2684 */
2418 2685
2419static void ata_pio_block(struct ata_port *ap) 2686static void ata_pio_block(struct ata_port *ap)
@@ -2582,6 +2849,7 @@ static void atapi_request_sense(struct ata_port *ap, struct ata_device *dev,
2582 * transaction completed successfully. 2849 * transaction completed successfully.
2583 * 2850 *
2584 * LOCKING: 2851 * LOCKING:
2852 * Inherited from SCSI layer (none, can sleep)
2585 */ 2853 */
2586 2854
2587static void ata_qc_timeout(struct ata_queued_cmd *qc) 2855static void ata_qc_timeout(struct ata_queued_cmd *qc)
@@ -2691,6 +2959,7 @@ out:
2691 * @dev: Device from whom we request an available command structure 2959 * @dev: Device from whom we request an available command structure
2692 * 2960 *
2693 * LOCKING: 2961 * LOCKING:
2962 * None.
2694 */ 2963 */
2695 2964
2696static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) 2965static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
@@ -2716,6 +2985,7 @@ static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
2716 * @dev: Device from whom we request an available command structure 2985 * @dev: Device from whom we request an available command structure
2717 * 2986 *
2718 * LOCKING: 2987 * LOCKING:
2988 * None.
2719 */ 2989 */
2720 2990
2721struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, 2991struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
@@ -2780,6 +3050,7 @@ static void __ata_qc_complete(struct ata_queued_cmd *qc)
2780 * in case something prevents using it. 3050 * in case something prevents using it.
2781 * 3051 *
2782 * LOCKING: 3052 * LOCKING:
3053 * spin_lock_irqsave(host_set lock)
2783 * 3054 *
2784 */ 3055 */
2785void ata_qc_free(struct ata_queued_cmd *qc) 3056void ata_qc_free(struct ata_queued_cmd *qc)
@@ -2793,9 +3064,13 @@ void ata_qc_free(struct ata_queued_cmd *qc)
2793/** 3064/**
2794 * ata_qc_complete - Complete an active ATA command 3065 * ata_qc_complete - Complete an active ATA command
2795 * @qc: Command to complete 3066 * @qc: Command to complete
2796 * @drv_stat: ATA status register contents 3067 * @drv_stat: ATA Status register contents
3068 *
3069 * Indicate to the mid and upper layers that an ATA
3070 * command has completed, with either an ok or not-ok status.
2797 * 3071 *
2798 * LOCKING: 3072 * LOCKING:
3073 * spin_lock_irqsave(host_set lock)
2799 * 3074 *
2800 */ 3075 */
2801 3076
@@ -2891,6 +3166,7 @@ err_out:
2891 return -1; 3166 return -1;
2892} 3167}
2893 3168
3169
2894/** 3170/**
2895 * ata_qc_issue_prot - issue taskfile to device in proto-dependent manner 3171 * ata_qc_issue_prot - issue taskfile to device in proto-dependent manner
2896 * @qc: command to issue to device 3172 * @qc: command to issue to device
@@ -2900,6 +3176,8 @@ err_out:
2900 * classes called "protocols", and issuing each type of protocol 3176 * classes called "protocols", and issuing each type of protocol
2901 * is slightly different. 3177 * is slightly different.
2902 * 3178 *
3179 * May be used as the qc_issue() entry in ata_port_operations.
3180 *
2903 * LOCKING: 3181 * LOCKING:
2904 * spin_lock_irqsave(host_set lock) 3182 * spin_lock_irqsave(host_set lock)
2905 * 3183 *
@@ -2957,7 +3235,7 @@ int ata_qc_issue_prot(struct ata_queued_cmd *qc)
2957} 3235}
2958 3236
2959/** 3237/**
2960 * ata_bmdma_setup - Set up PCI IDE BMDMA transaction 3238 * ata_bmdma_setup_mmio - Set up PCI IDE BMDMA transaction
2961 * @qc: Info associated with this ATA transaction. 3239 * @qc: Info associated with this ATA transaction.
2962 * 3240 *
2963 * LOCKING: 3241 * LOCKING:
@@ -3064,6 +3342,18 @@ static void ata_bmdma_start_pio (struct ata_queued_cmd *qc)
3064 ap->ioaddr.bmdma_addr + ATA_DMA_CMD); 3342 ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
3065} 3343}
3066 3344
3345
3346/**
3347 * ata_bmdma_start - Start a PCI IDE BMDMA transaction
3348 * @qc: Info associated with this ATA transaction.
3349 *
3350 * Writes the ATA_DMA_START flag to the DMA command register.
3351 *
3352 * May be used as the bmdma_start() entry in ata_port_operations.
3353 *
3354 * LOCKING:
3355 * spin_lock_irqsave(host_set lock)
3356 */
3067void ata_bmdma_start(struct ata_queued_cmd *qc) 3357void ata_bmdma_start(struct ata_queued_cmd *qc)
3068{ 3358{
3069 if (qc->ap->flags & ATA_FLAG_MMIO) 3359 if (qc->ap->flags & ATA_FLAG_MMIO)
@@ -3072,6 +3362,20 @@ void ata_bmdma_start(struct ata_queued_cmd *qc)
3072 ata_bmdma_start_pio(qc); 3362 ata_bmdma_start_pio(qc);
3073} 3363}
3074 3364
3365
3366/**
3367 * ata_bmdma_setup - Set up PCI IDE BMDMA transaction
3368 * @qc: Info associated with this ATA transaction.
3369 *
3370 * Writes address of PRD table to device's PRD Table Address
3371 * register, sets the DMA control register, and calls
3372 * ops->exec_command() to start the transfer.
3373 *
3374 * May be used as the bmdma_setup() entry in ata_port_operations.
3375 *
3376 * LOCKING:
3377 * spin_lock_irqsave(host_set lock)
3378 */
3075void ata_bmdma_setup(struct ata_queued_cmd *qc) 3379void ata_bmdma_setup(struct ata_queued_cmd *qc)
3076{ 3380{
3077 if (qc->ap->flags & ATA_FLAG_MMIO) 3381 if (qc->ap->flags & ATA_FLAG_MMIO)
@@ -3080,6 +3384,19 @@ void ata_bmdma_setup(struct ata_queued_cmd *qc)
3080 ata_bmdma_setup_pio(qc); 3384 ata_bmdma_setup_pio(qc);
3081} 3385}
3082 3386
3387
3388/**
3389 * ata_bmdma_irq_clear - Clear PCI IDE BMDMA interrupt.
3390 * @ap: Port associated with this ATA transaction.
3391 *
3392 * Clear interrupt and error flags in DMA status register.
3393 *
3394 * May be used as the irq_clear() entry in ata_port_operations.
3395 *
3396 * LOCKING:
3397 * spin_lock_irqsave(host_set lock)
3398 */
3399
3083void ata_bmdma_irq_clear(struct ata_port *ap) 3400void ata_bmdma_irq_clear(struct ata_port *ap)
3084{ 3401{
3085 if (ap->flags & ATA_FLAG_MMIO) { 3402 if (ap->flags & ATA_FLAG_MMIO) {
@@ -3092,6 +3409,19 @@ void ata_bmdma_irq_clear(struct ata_port *ap)
3092 3409
3093} 3410}
3094 3411
3412
3413/**
3414 * ata_bmdma_status - Read PCI IDE BMDMA status
3415 * @ap: Port associated with this ATA transaction.
3416 *
3417 * Read and return BMDMA status register.
3418 *
3419 * May be used as the bmdma_status() entry in ata_port_operations.
3420 *
3421 * LOCKING:
3422 * spin_lock_irqsave(host_set lock)
3423 */
3424
3095u8 ata_bmdma_status(struct ata_port *ap) 3425u8 ata_bmdma_status(struct ata_port *ap)
3096{ 3426{
3097 u8 host_stat; 3427 u8 host_stat;
@@ -3103,6 +3433,19 @@ u8 ata_bmdma_status(struct ata_port *ap)
3103 return host_stat; 3433 return host_stat;
3104} 3434}
3105 3435
3436
3437/**
3438 * ata_bmdma_stop - Stop PCI IDE BMDMA transfer
3439 * @ap: Port associated with this ATA transaction.
3440 *
3441 * Clears the ATA_DMA_START flag in the dma control register
3442 *
3443 * May be used as the bmdma_stop() entry in ata_port_operations.
3444 *
3445 * LOCKING:
3446 * spin_lock_irqsave(host_set lock)
3447 */
3448
3106void ata_bmdma_stop(struct ata_port *ap) 3449void ata_bmdma_stop(struct ata_port *ap)
3107{ 3450{
3108 if (ap->flags & ATA_FLAG_MMIO) { 3451 if (ap->flags & ATA_FLAG_MMIO) {
@@ -3202,13 +3545,18 @@ idle_irq:
3202 3545
3203/** 3546/**
3204 * ata_interrupt - Default ATA host interrupt handler 3547 * ata_interrupt - Default ATA host interrupt handler
3205 * @irq: irq line 3548 * @irq: irq line (unused)
3206 * @dev_instance: pointer to our host information structure 3549 * @dev_instance: pointer to our ata_host_set information structure
3207 * @regs: unused 3550 * @regs: unused
3208 * 3551 *
3552 * Default interrupt handler for PCI IDE devices. Calls
3553 * ata_host_intr() for each port that is not disabled.
3554 *
3209 * LOCKING: 3555 * LOCKING:
3556 * Obtains host_set lock during operation.
3210 * 3557 *
3211 * RETURNS: 3558 * RETURNS:
3559 * IRQ_NONE or IRQ_HANDLED.
3212 * 3560 *
3213 */ 3561 */
3214 3562
@@ -3301,6 +3649,19 @@ err_out:
3301 ata_qc_complete(qc, ATA_ERR); 3649 ata_qc_complete(qc, ATA_ERR);
3302} 3650}
3303 3651
3652
3653/**
3654 * ata_port_start - Set port up for dma.
3655 * @ap: Port to initialize
3656 *
3657 * Called just after data structures for each port are
3658 * initialized. Allocates space for PRD table.
3659 *
3660 * May be used as the port_start() entry in ata_port_operations.
3661 *
3662 * LOCKING:
3663 */
3664
3304int ata_port_start (struct ata_port *ap) 3665int ata_port_start (struct ata_port *ap)
3305{ 3666{
3306 struct device *dev = ap->host_set->dev; 3667 struct device *dev = ap->host_set->dev;
@@ -3314,6 +3675,18 @@ int ata_port_start (struct ata_port *ap)
3314 return 0; 3675 return 0;
3315} 3676}
3316 3677
3678
3679/**
3680 * ata_port_stop - Undo ata_port_start()
3681 * @ap: Port to shut down
3682 *
3683 * Frees the PRD table.
3684 *
3685 * May be used as the port_stop() entry in ata_port_operations.
3686 *
3687 * LOCKING:
3688 */
3689
3317void ata_port_stop (struct ata_port *ap) 3690void ata_port_stop (struct ata_port *ap)
3318{ 3691{
3319 struct device *dev = ap->host_set->dev; 3692 struct device *dev = ap->host_set->dev;
@@ -3321,6 +3694,13 @@ void ata_port_stop (struct ata_port *ap)
3321 dma_free_coherent(dev, ATA_PRD_TBL_SZ, ap->prd, ap->prd_dma); 3694 dma_free_coherent(dev, ATA_PRD_TBL_SZ, ap->prd, ap->prd_dma);
3322} 3695}
3323 3696
3697void ata_host_stop (struct ata_host_set *host_set)
3698{
3699 if (host_set->mmio_base)
3700 iounmap(host_set->mmio_base);
3701}
3702
3703
3324/** 3704/**
3325 * ata_host_remove - Unregister SCSI host structure with upper layers 3705 * ata_host_remove - Unregister SCSI host structure with upper layers
3326 * @ap: Port to unregister 3706 * @ap: Port to unregister
@@ -3349,7 +3729,11 @@ static void ata_host_remove(struct ata_port *ap, unsigned int do_unregister)
3349 * @ent: Probe information provided by low-level driver 3729 * @ent: Probe information provided by low-level driver
3350 * @port_no: Port number associated with this ata_port 3730 * @port_no: Port number associated with this ata_port
3351 * 3731 *
3732 * Initialize a new ata_port structure, and its associated
3733 * scsi_host.
3734 *
3352 * LOCKING: 3735 * LOCKING:
3736 * Inherited from caller.
3353 * 3737 *
3354 */ 3738 */
3355 3739
@@ -3404,9 +3788,13 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
3404 * @host_set: Collections of ports to which we add 3788 * @host_set: Collections of ports to which we add
3405 * @port_no: Port number associated with this host 3789 * @port_no: Port number associated with this host
3406 * 3790 *
3791 * Attach low-level ATA driver to system.
3792 *
3407 * LOCKING: 3793 * LOCKING:
3794 * PCI/etc. bus probe sem.
3408 * 3795 *
3409 * RETURNS: 3796 * RETURNS:
3797 * New ata_port on success, for NULL on error.
3410 * 3798 *
3411 */ 3799 */
3412 3800
@@ -3439,12 +3827,22 @@ err_out:
3439} 3827}
3440 3828
3441/** 3829/**
3442 * ata_device_add - 3830 * ata_device_add - Register hardware device with ATA and SCSI layers
3443 * @ent: 3831 * @ent: Probe information describing hardware device to be registered
3832 *
3833 * This function processes the information provided in the probe
3834 * information struct @ent, allocates the necessary ATA and SCSI
3835 * host information structures, initializes them, and registers
3836 * everything with requisite kernel subsystems.
3837 *
3838 * This function requests irqs, probes the ATA bus, and probes
3839 * the SCSI bus.
3444 * 3840 *
3445 * LOCKING: 3841 * LOCKING:
3842 * PCI/etc. bus probe sem.
3446 * 3843 *
3447 * RETURNS: 3844 * RETURNS:
3845 * Number of ports registered. Zero on error (no ports registered).
3448 * 3846 *
3449 */ 3847 */
3450 3848
@@ -3596,7 +3994,15 @@ int ata_scsi_release(struct Scsi_Host *host)
3596/** 3994/**
3597 * ata_std_ports - initialize ioaddr with standard port offsets. 3995 * ata_std_ports - initialize ioaddr with standard port offsets.
3598 * @ioaddr: IO address structure to be initialized 3996 * @ioaddr: IO address structure to be initialized
3997 *
3998 * Utility function which initializes data_addr, error_addr,
3999 * feature_addr, nsect_addr, lbal_addr, lbam_addr, lbah_addr,
4000 * device_addr, status_addr, and command_addr to standard offsets
4001 * relative to cmd_addr.
4002 *
4003 * Does not set ctl_addr, altstatus_addr, bmdma_addr, or scr_addr.
3599 */ 4004 */
4005
3600void ata_std_ports(struct ata_ioports *ioaddr) 4006void ata_std_ports(struct ata_ioports *ioaddr)
3601{ 4007{
3602 ioaddr->data_addr = ioaddr->cmd_addr + ATA_REG_DATA; 4008 ioaddr->data_addr = ioaddr->cmd_addr + ATA_REG_DATA;
@@ -3638,6 +4044,20 @@ ata_probe_ent_alloc(struct device *dev, struct ata_port_info *port)
3638 return probe_ent; 4044 return probe_ent;
3639} 4045}
3640 4046
4047
4048
4049/**
4050 * ata_pci_init_native_mode - Initialize native-mode driver
4051 * @pdev: pci device to be initialized
4052 * @port: array[2] of pointers to port info structures.
4053 *
4054 * Utility function which allocates and initializes an
4055 * ata_probe_ent structure for a standard dual-port
4056 * PIO-based IDE controller. The returned ata_probe_ent
4057 * structure can be passed to ata_device_add(). The returned
4058 * ata_probe_ent structure should then be freed with kfree().
4059 */
4060
3641#ifdef CONFIG_PCI 4061#ifdef CONFIG_PCI
3642struct ata_probe_ent * 4062struct ata_probe_ent *
3643ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port) 4063ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port)
@@ -3719,10 +4139,19 @@ ata_pci_init_legacy_mode(struct pci_dev *pdev, struct ata_port_info **port,
3719 * @port_info: Information from low-level host driver 4139 * @port_info: Information from low-level host driver
3720 * @n_ports: Number of ports attached to host controller 4140 * @n_ports: Number of ports attached to host controller
3721 * 4141 *
4142 * This is a helper function which can be called from a driver's
4143 * xxx_init_one() probe function if the hardware uses traditional
4144 * IDE taskfile registers.
4145 *
4146 * This function calls pci_enable_device(), reserves its register
4147 * regions, sets the dma mask, enables bus master mode, and calls
4148 * ata_device_add()
4149 *
3722 * LOCKING: 4150 * LOCKING:
3723 * Inherited from PCI layer (may sleep). 4151 * Inherited from PCI layer (may sleep).
3724 * 4152 *
3725 * RETURNS: 4153 * RETURNS:
4154 * Zero on success, negative on errno-based value on error.
3726 * 4155 *
3727 */ 4156 */
3728 4157
@@ -3877,10 +4306,6 @@ void ata_pci_remove_one (struct pci_dev *pdev)
3877 } 4306 }
3878 4307
3879 free_irq(host_set->irq, host_set); 4308 free_irq(host_set->irq, host_set);
3880 if (host_set->ops->host_stop)
3881 host_set->ops->host_stop(host_set);
3882 if (host_set->mmio_base)
3883 iounmap(host_set->mmio_base);
3884 4309
3885 for (i = 0; i < host_set->n_ports; i++) { 4310 for (i = 0; i < host_set->n_ports; i++) {
3886 ap = host_set->ports[i]; 4311 ap = host_set->ports[i];
@@ -3899,6 +4324,9 @@ void ata_pci_remove_one (struct pci_dev *pdev)
3899 scsi_host_put(ap->host); 4324 scsi_host_put(ap->host);
3900 } 4325 }
3901 4326
4327 if (host_set->ops->host_stop)
4328 host_set->ops->host_stop(host_set);
4329
3902 kfree(host_set); 4330 kfree(host_set);
3903 4331
3904 pci_release_regions(pdev); 4332 pci_release_regions(pdev);
@@ -3942,15 +4370,6 @@ int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits)
3942#endif /* CONFIG_PCI */ 4370#endif /* CONFIG_PCI */
3943 4371
3944 4372
3945/**
3946 * ata_init -
3947 *
3948 * LOCKING:
3949 *
3950 * RETURNS:
3951 *
3952 */
3953
3954static int __init ata_init(void) 4373static int __init ata_init(void)
3955{ 4374{
3956 ata_wq = create_workqueue("ata"); 4375 ata_wq = create_workqueue("ata");
@@ -3996,6 +4415,7 @@ EXPORT_SYMBOL_GPL(ata_chk_err);
3996EXPORT_SYMBOL_GPL(ata_exec_command); 4415EXPORT_SYMBOL_GPL(ata_exec_command);
3997EXPORT_SYMBOL_GPL(ata_port_start); 4416EXPORT_SYMBOL_GPL(ata_port_start);
3998EXPORT_SYMBOL_GPL(ata_port_stop); 4417EXPORT_SYMBOL_GPL(ata_port_stop);
4418EXPORT_SYMBOL_GPL(ata_host_stop);
3999EXPORT_SYMBOL_GPL(ata_interrupt); 4419EXPORT_SYMBOL_GPL(ata_interrupt);
4000EXPORT_SYMBOL_GPL(ata_qc_prep); 4420EXPORT_SYMBOL_GPL(ata_qc_prep);
4001EXPORT_SYMBOL_GPL(ata_bmdma_setup); 4421EXPORT_SYMBOL_GPL(ata_bmdma_setup);
@@ -4016,6 +4436,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_release);
4016EXPORT_SYMBOL_GPL(ata_host_intr); 4436EXPORT_SYMBOL_GPL(ata_host_intr);
4017EXPORT_SYMBOL_GPL(ata_dev_classify); 4437EXPORT_SYMBOL_GPL(ata_dev_classify);
4018EXPORT_SYMBOL_GPL(ata_dev_id_string); 4438EXPORT_SYMBOL_GPL(ata_dev_id_string);
4439EXPORT_SYMBOL_GPL(ata_dev_config);
4019EXPORT_SYMBOL_GPL(ata_scsi_simulate); 4440EXPORT_SYMBOL_GPL(ata_scsi_simulate);
4020 4441
4021#ifdef CONFIG_PCI 4442#ifdef CONFIG_PCI
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 072b6e5b139e..cdc0a10a606c 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -1249,7 +1249,7 @@ unsigned int ata_scsiop_inq_83(struct ata_scsi_args *args, u8 *rbuf,
1249} 1249}
1250 1250
1251/** 1251/**
1252 * ata_scsiop_noop - 1252 * ata_scsiop_noop - Command handler that simply returns success.
1253 * @args: device IDENTIFY data / SCSI command of interest. 1253 * @args: device IDENTIFY data / SCSI command of interest.
1254 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent. 1254 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
1255 * @buflen: Response buffer length. 1255 * @buflen: Response buffer length.
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h
index c595f5f58c16..2ae37ee12fc0 100644
--- a/drivers/scsi/libata.h
+++ b/drivers/scsi/libata.h
@@ -26,7 +26,7 @@
26#define __LIBATA_H__ 26#define __LIBATA_H__
27 27
28#define DRV_NAME "libata" 28#define DRV_NAME "libata"
29#define DRV_VERSION "1.10" /* must be exactly four chars */ 29#define DRV_VERSION "1.11" /* must be exactly four chars */
30 30
31struct ata_scsi_args { 31struct ata_scsi_args {
32 u16 *id; 32 u16 *id;
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 42fab03ad2ba..f2aff3f4042b 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -798,7 +798,7 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))
798} 798}
799 799
800static int 800static int
801lpfc_abort_handler(struct scsi_cmnd *cmnd) 801__lpfc_abort_handler(struct scsi_cmnd *cmnd)
802{ 802{
803 struct lpfc_hba *phba = 803 struct lpfc_hba *phba =
804 (struct lpfc_hba *)cmnd->device->host->hostdata[0]; 804 (struct lpfc_hba *)cmnd->device->host->hostdata[0];
@@ -918,7 +918,17 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
918} 918}
919 919
920static int 920static int
921lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) 921lpfc_abort_handler(struct scsi_cmnd *cmnd)
922{
923 int rc;
924 spin_lock_irq(cmnd->device->host->host_lock);
925 rc = __lpfc_abort_handler(cmnd);
926 spin_unlock_irq(cmnd->device->host->host_lock);
927 return rc;
928}
929
930static int
931__lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
922{ 932{
923 struct Scsi_Host *shost = cmnd->device->host; 933 struct Scsi_Host *shost = cmnd->device->host;
924 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; 934 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0];
@@ -1030,11 +1040,21 @@ out:
1030 return ret; 1040 return ret;
1031} 1041}
1032 1042
1043static int
1044lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
1045{
1046 int rc;
1047 spin_lock_irq(cmnd->device->host->host_lock);
1048 rc = __lpfc_reset_lun_handler(cmnd);
1049 spin_unlock_irq(cmnd->device->host->host_lock);
1050 return rc;
1051}
1052
1033/* 1053/*
1034 * Note: midlayer calls this function with the host_lock held 1054 * Note: midlayer calls this function with the host_lock held
1035 */ 1055 */
1036static int 1056static int
1037lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) 1057__lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
1038{ 1058{
1039 struct Scsi_Host *shost = cmnd->device->host; 1059 struct Scsi_Host *shost = cmnd->device->host;
1040 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; 1060 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0];
@@ -1124,6 +1144,16 @@ out:
1124} 1144}
1125 1145
1126static int 1146static int
1147lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
1148{
1149 int rc;
1150 spin_lock_irq(cmnd->device->host->host_lock);
1151 rc = __lpfc_reset_bus_handler(cmnd);
1152 spin_unlock_irq(cmnd->device->host->host_lock);
1153 return rc;
1154}
1155
1156static int
1127lpfc_slave_alloc(struct scsi_device *sdev) 1157lpfc_slave_alloc(struct scsi_device *sdev)
1128{ 1158{
1129 struct lpfc_hba *phba = (struct lpfc_hba *)sdev->host->hostdata[0]; 1159 struct lpfc_hba *phba = (struct lpfc_hba *)sdev->host->hostdata[0];
diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c
index 3ef2a1443996..edd47d1f0b17 100644
--- a/drivers/scsi/mac53c94.c
+++ b/drivers/scsi/mac53c94.c
@@ -98,16 +98,14 @@ static int mac53c94_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *
98 return 0; 98 return 0;
99} 99}
100 100
101static int mac53c94_abort(struct scsi_cmnd *cmd)
102{
103 return FAILED;
104}
105
106static int mac53c94_host_reset(struct scsi_cmnd *cmd) 101static int mac53c94_host_reset(struct scsi_cmnd *cmd)
107{ 102{
108 struct fsc_state *state = (struct fsc_state *) cmd->device->host->hostdata; 103 struct fsc_state *state = (struct fsc_state *) cmd->device->host->hostdata;
109 struct mac53c94_regs __iomem *regs = state->regs; 104 struct mac53c94_regs __iomem *regs = state->regs;
110 struct dbdma_regs __iomem *dma = state->dma; 105 struct dbdma_regs __iomem *dma = state->dma;
106 unsigned long flags;
107
108 spin_lock_irqsave(cmd->device->host->host_lock, flags);
111 109
112 writel((RUN|PAUSE|FLUSH|WAKE) << 16, &dma->control); 110 writel((RUN|PAUSE|FLUSH|WAKE) << 16, &dma->control);
113 writeb(CMD_SCSI_RESET, &regs->command); /* assert RST */ 111 writeb(CMD_SCSI_RESET, &regs->command); /* assert RST */
@@ -116,6 +114,8 @@ static int mac53c94_host_reset(struct scsi_cmnd *cmd)
116 udelay(20); 114 udelay(20);
117 mac53c94_init(state); 115 mac53c94_init(state);
118 writeb(CMD_NOP, &regs->command); 116 writeb(CMD_NOP, &regs->command);
117
118 spin_unlock_irqrestore(cmd->device->host->host_lock, flags);
119 return SUCCESS; 119 return SUCCESS;
120} 120}
121 121
@@ -416,7 +416,6 @@ static struct scsi_host_template mac53c94_template = {
416 .proc_name = "53c94", 416 .proc_name = "53c94",
417 .name = "53C94", 417 .name = "53C94",
418 .queuecommand = mac53c94_queue, 418 .queuecommand = mac53c94_queue,
419 .eh_abort_handler = mac53c94_abort,
420 .eh_host_reset_handler = mac53c94_host_reset, 419 .eh_host_reset_handler = mac53c94_host_reset,
421 .can_queue = 1, 420 .can_queue = 1,
422 .this_id = 7, 421 .this_id = 7,
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index d5fd17ef74db..92d2c8379abf 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -591,8 +591,6 @@ static Scsi_Host_Template driver_template = {
591 .queuecommand = macscsi_queue_command, 591 .queuecommand = macscsi_queue_command,
592 .eh_abort_handler = macscsi_abort, 592 .eh_abort_handler = macscsi_abort,
593 .eh_bus_reset_handler = macscsi_bus_reset, 593 .eh_bus_reset_handler = macscsi_bus_reset,
594 .eh_device_reset_handler = macscsi_device_reset,
595 .eh_host_reset_handler = macscsi_host_reset,
596 .can_queue = CAN_QUEUE, 594 .can_queue = CAN_QUEUE,
597 .this_id = 7, 595 .this_id = 7,
598 .sg_tablesize = SG_ALL, 596 .sg_tablesize = SG_ALL,
diff --git a/drivers/scsi/mac_scsi.h b/drivers/scsi/mac_scsi.h
index 23ab2c18a016..d26e331c6c12 100644
--- a/drivers/scsi/mac_scsi.h
+++ b/drivers/scsi/mac_scsi.h
@@ -72,8 +72,6 @@
72#define NCR5380_queue_command macscsi_queue_command 72#define NCR5380_queue_command macscsi_queue_command
73#define NCR5380_abort macscsi_abort 73#define NCR5380_abort macscsi_abort
74#define NCR5380_bus_reset macscsi_bus_reset 74#define NCR5380_bus_reset macscsi_bus_reset
75#define NCR5380_device_reset macscsi_device_reset
76#define NCR5380_host_reset macscsi_host_reset
77#define NCR5380_proc_info macscsi_proc_info 75#define NCR5380_proc_info macscsi_proc_info
78 76
79#define BOARD_NORMAL 0 77#define BOARD_NORMAL 0
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 8d707b29027d..ec81532eb845 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -1938,7 +1938,7 @@ megaraid_abort(Scsi_Cmnd *cmd)
1938 1938
1939 1939
1940static int 1940static int
1941megaraid_reset(Scsi_Cmnd *cmd) 1941__megaraid_reset(Scsi_Cmnd *cmd)
1942{ 1942{
1943 adapter_t *adapter; 1943 adapter_t *adapter;
1944 megacmd_t mc; 1944 megacmd_t mc;
@@ -1972,6 +1972,18 @@ megaraid_reset(Scsi_Cmnd *cmd)
1972 return rval; 1972 return rval;
1973} 1973}
1974 1974
1975static int
1976megaraid_reset(Scsi_Cmnd *cmd)
1977{
1978 adapter_t *adapter = (adapter_t *)cmd->device->host->hostdata;
1979 int rc;
1980
1981 spin_lock_irq(&adapter->lock);
1982 rc = __megaraid_reset(cmd);
1983 spin_unlock_irq(&adapter->lock);
1984
1985 return rc;
1986}
1975 1987
1976 1988
1977/** 1989/**
diff --git a/drivers/scsi/megaraid/mega_common.h b/drivers/scsi/megaraid/mega_common.h
index 18969a4946b7..69df1a9b935d 100644
--- a/drivers/scsi/megaraid/mega_common.h
+++ b/drivers/scsi/megaraid/mega_common.h
@@ -27,6 +27,7 @@
27#include <linux/list.h> 27#include <linux/list.h>
28#include <linux/version.h> 28#include <linux/version.h>
29#include <linux/moduleparam.h> 29#include <linux/moduleparam.h>
30#include <linux/dma-mapping.h>
30#include <asm/semaphore.h> 31#include <asm/semaphore.h>
31#include <scsi/scsi.h> 32#include <scsi/scsi.h>
32#include <scsi/scsi_cmnd.h> 33#include <scsi/scsi_cmnd.h>
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index 138fa4815833..cbe430246276 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -10,7 +10,7 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 * 11 *
12 * FILE : megaraid_mbox.c 12 * FILE : megaraid_mbox.c
13 * Version : v2.20.4.5 (Feb 03 2005) 13 * Version : v2.20.4.6 (Mar 07 2005)
14 * 14 *
15 * Authors: 15 * Authors:
16 * Atul Mukker <Atul.Mukker@lsil.com> 16 * Atul Mukker <Atul.Mukker@lsil.com>
@@ -124,7 +124,7 @@ static irqreturn_t megaraid_isr(int, void *, struct pt_regs *);
124static void megaraid_mbox_dpc(unsigned long); 124static void megaraid_mbox_dpc(unsigned long);
125 125
126static ssize_t megaraid_sysfs_show_app_hndl(struct class_device *, char *); 126static ssize_t megaraid_sysfs_show_app_hndl(struct class_device *, char *);
127static ssize_t megaraid_sysfs_show_ldnum(struct device *, char *); 127static ssize_t megaraid_sysfs_show_ldnum(struct device *, struct device_attribute *attr, char *);
128 128
129static int megaraid_cmm_register(adapter_t *); 129static int megaraid_cmm_register(adapter_t *);
130static int megaraid_cmm_unregister(adapter_t *); 130static int megaraid_cmm_unregister(adapter_t *);
@@ -202,7 +202,7 @@ MODULE_PARM_DESC(debug_level, "Debug level for driver (default=0)");
202 * ### global data ### 202 * ### global data ###
203 */ 203 */
204static uint8_t megaraid_mbox_version[8] = 204static uint8_t megaraid_mbox_version[8] =
205 { 0x02, 0x20, 0x04, 0x05, 2, 3, 20, 5 }; 205 { 0x02, 0x20, 0x04, 0x06, 3, 7, 20, 5 };
206 206
207 207
208/* 208/*
@@ -229,9 +229,9 @@ static struct pci_device_id pci_id_table_g[] = {
229 }, 229 },
230 { 230 {
231 PCI_VENDOR_ID_LSI_LOGIC, 231 PCI_VENDOR_ID_LSI_LOGIC,
232 PCI_DEVICE_ID_PERC4_QC, 232 PCI_DEVICE_ID_VERDE,
233 PCI_VENDOR_ID_DELL, 233 PCI_ANY_ID,
234 PCI_SUBSYS_ID_PERC4_QC, 234 PCI_ANY_ID,
235 }, 235 },
236 { 236 {
237 PCI_VENDOR_ID_DELL, 237 PCI_VENDOR_ID_DELL,
@@ -271,15 +271,9 @@ static struct pci_device_id pci_id_table_g[] = {
271 }, 271 },
272 { 272 {
273 PCI_VENDOR_ID_LSI_LOGIC, 273 PCI_VENDOR_ID_LSI_LOGIC,
274 PCI_DEVICE_ID_PERC4E_DC_320_2E, 274 PCI_DEVICE_ID_DOBSON,
275 PCI_VENDOR_ID_DELL, 275 PCI_ANY_ID,
276 PCI_SUBSYS_ID_PERC4E_DC_320_2E, 276 PCI_ANY_ID,
277 },
278 {
279 PCI_VENDOR_ID_LSI_LOGIC,
280 PCI_DEVICE_ID_PERC4E_SC_320_1E,
281 PCI_VENDOR_ID_DELL,
282 PCI_SUBSYS_ID_PERC4E_SC_320_1E,
283 }, 277 },
284 { 278 {
285 PCI_VENDOR_ID_AMI, 279 PCI_VENDOR_ID_AMI,
@@ -331,36 +325,6 @@ static struct pci_device_id pci_id_table_g[] = {
331 }, 325 },
332 { 326 {
333 PCI_VENDOR_ID_LSI_LOGIC, 327 PCI_VENDOR_ID_LSI_LOGIC,
334 PCI_DEVICE_ID_MEGARAID_SCSI_320_0x,
335 PCI_VENDOR_ID_LSI_LOGIC,
336 PCI_SUBSYS_ID_MEGARAID_SCSI_320_0x,
337 },
338 {
339 PCI_VENDOR_ID_LSI_LOGIC,
340 PCI_DEVICE_ID_MEGARAID_SCSI_320_2x,
341 PCI_VENDOR_ID_LSI_LOGIC,
342 PCI_SUBSYS_ID_MEGARAID_SCSI_320_2x,
343 },
344 {
345 PCI_VENDOR_ID_LSI_LOGIC,
346 PCI_DEVICE_ID_MEGARAID_SCSI_320_4x,
347 PCI_VENDOR_ID_LSI_LOGIC,
348 PCI_SUBSYS_ID_MEGARAID_SCSI_320_4x,
349 },
350 {
351 PCI_VENDOR_ID_LSI_LOGIC,
352 PCI_DEVICE_ID_MEGARAID_SCSI_320_1E,
353 PCI_VENDOR_ID_LSI_LOGIC,
354 PCI_SUBSYS_ID_MEGARAID_SCSI_320_1E,
355 },
356 {
357 PCI_VENDOR_ID_LSI_LOGIC,
358 PCI_DEVICE_ID_MEGARAID_SCSI_320_2E,
359 PCI_VENDOR_ID_LSI_LOGIC,
360 PCI_SUBSYS_ID_MEGARAID_SCSI_320_2E,
361 },
362 {
363 PCI_VENDOR_ID_LSI_LOGIC,
364 PCI_DEVICE_ID_MEGARAID_I4_133_RAID, 328 PCI_DEVICE_ID_MEGARAID_I4_133_RAID,
365 PCI_VENDOR_ID_LSI_LOGIC, 329 PCI_VENDOR_ID_LSI_LOGIC,
366 PCI_SUBSYS_ID_MEGARAID_I4_133_RAID, 330 PCI_SUBSYS_ID_MEGARAID_I4_133_RAID,
@@ -379,21 +343,9 @@ static struct pci_device_id pci_id_table_g[] = {
379 }, 343 },
380 { 344 {
381 PCI_VENDOR_ID_LSI_LOGIC, 345 PCI_VENDOR_ID_LSI_LOGIC,
382 PCI_DEVICE_ID_MEGARAID_SATA_300_4x, 346 PCI_DEVICE_ID_LINDSAY,
383 PCI_VENDOR_ID_LSI_LOGIC, 347 PCI_ANY_ID,
384 PCI_SUBSYS_ID_MEGARAID_SATA_300_4x, 348 PCI_ANY_ID,
385 },
386 {
387 PCI_VENDOR_ID_LSI_LOGIC,
388 PCI_DEVICE_ID_MEGARAID_SATA_300_8x,
389 PCI_VENDOR_ID_LSI_LOGIC,
390 PCI_SUBSYS_ID_MEGARAID_SATA_300_8x,
391 },
392 {
393 PCI_VENDOR_ID_LSI_LOGIC,
394 PCI_DEVICE_ID_INTEL_RAID_SRCU42X,
395 PCI_VENDOR_ID_INTEL,
396 PCI_SUBSYS_ID_INTEL_RAID_SRCU42X,
397 }, 349 },
398 { 350 {
399 PCI_VENDOR_ID_LSI_LOGIC, 351 PCI_VENDOR_ID_LSI_LOGIC,
@@ -403,58 +355,10 @@ static struct pci_device_id pci_id_table_g[] = {
403 }, 355 },
404 { 356 {
405 PCI_VENDOR_ID_LSI_LOGIC, 357 PCI_VENDOR_ID_LSI_LOGIC,
406 PCI_DEVICE_ID_INTEL_RAID_SRCU42E,
407 PCI_VENDOR_ID_INTEL,
408 PCI_SUBSYS_ID_INTEL_RAID_SRCU42E,
409 },
410 {
411 PCI_VENDOR_ID_LSI_LOGIC,
412 PCI_DEVICE_ID_INTEL_RAID_SRCZCRX,
413 PCI_VENDOR_ID_INTEL,
414 PCI_SUBSYS_ID_INTEL_RAID_SRCZCRX,
415 },
416 {
417 PCI_VENDOR_ID_LSI_LOGIC,
418 PCI_DEVICE_ID_INTEL_RAID_SRCS28X,
419 PCI_VENDOR_ID_INTEL,
420 PCI_SUBSYS_ID_INTEL_RAID_SRCS28X,
421 },
422 {
423 PCI_VENDOR_ID_LSI_LOGIC,
424 PCI_DEVICE_ID_INTEL_RAID_SROMBU42E_ALIEF,
425 PCI_VENDOR_ID_INTEL,
426 PCI_SUBSYS_ID_INTEL_RAID_SROMBU42E_ALIEF,
427 },
428 {
429 PCI_VENDOR_ID_LSI_LOGIC,
430 PCI_DEVICE_ID_INTEL_RAID_SROMBU42E_HARWICH,
431 PCI_VENDOR_ID_INTEL,
432 PCI_SUBSYS_ID_INTEL_RAID_SROMBU42E_HARWICH,
433 },
434 {
435 PCI_VENDOR_ID_LSI_LOGIC,
436 PCI_DEVICE_ID_INTEL_RAID_SRCU41L_LAKE_SHETEK, 358 PCI_DEVICE_ID_INTEL_RAID_SRCU41L_LAKE_SHETEK,
437 PCI_VENDOR_ID_INTEL, 359 PCI_VENDOR_ID_INTEL,
438 PCI_SUBSYS_ID_INTEL_RAID_SRCU41L_LAKE_SHETEK, 360 PCI_SUBSYS_ID_INTEL_RAID_SRCU41L_LAKE_SHETEK,
439 }, 361 },
440 {
441 PCI_VENDOR_ID_LSI_LOGIC,
442 PCI_DEVICE_ID_FSC_MEGARAID_PCI_EXPRESS_ROMB,
443 PCI_SUBSYS_ID_FSC,
444 PCI_SUBSYS_ID_FSC_MEGARAID_PCI_EXPRESS_ROMB,
445 },
446 {
447 PCI_VENDOR_ID_LSI_LOGIC,
448 PCI_DEVICE_ID_MEGARAID_ACER_ROMB_2E,
449 PCI_VENDOR_ID_AI,
450 PCI_SUBSYS_ID_MEGARAID_ACER_ROMB_2E,
451 },
452 {
453 PCI_VENDOR_ID_LSI_LOGIC,
454 PCI_DEVICE_ID_MEGARAID_NEC_ROMB_2E,
455 PCI_VENDOR_ID_NEC,
456 PCI_SUBSYS_ID_MEGARAID_NEC_ROMB_2E,
457 },
458 {0} /* Terminating entry */ 362 {0} /* Terminating entry */
459}; 363};
460MODULE_DEVICE_TABLE(pci, pci_id_table_g); 364MODULE_DEVICE_TABLE(pci, pci_id_table_g);
@@ -539,7 +443,8 @@ megaraid_init(void)
539 443
540 444
541 // register as a PCI hot-plug driver module 445 // register as a PCI hot-plug driver module
542 if ((rval = pci_module_init(&megaraid_pci_driver_g))) { 446 rval = pci_register_driver(&megaraid_pci_driver_g);
447 if (rval < 0) {
543 con_log(CL_ANN, (KERN_WARNING 448 con_log(CL_ANN, (KERN_WARNING
544 "megaraid: could not register hotplug support.\n")); 449 "megaraid: could not register hotplug support.\n"));
545 } 450 }
@@ -619,7 +524,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
619 524
620 // Setup the default DMA mask. This would be changed later on 525 // Setup the default DMA mask. This would be changed later on
621 // depending on hardware capabilities 526 // depending on hardware capabilities
622 if (pci_set_dma_mask(adapter->pdev, 0xFFFFFFFF) != 0) { 527 if (pci_set_dma_mask(adapter->pdev, DMA_32BIT_MASK) != 0) {
623 528
624 con_log(CL_ANN, (KERN_WARNING 529 con_log(CL_ANN, (KERN_WARNING
625 "megaraid: pci_set_dma_mask failed:%d\n", __LINE__)); 530 "megaraid: pci_set_dma_mask failed:%d\n", __LINE__));
@@ -1031,7 +936,7 @@ megaraid_init_mbox(adapter_t *adapter)
1031 936
1032 // Set the DMA mask to 64-bit. All supported controllers as capable of 937 // Set the DMA mask to 64-bit. All supported controllers as capable of
1033 // DMA in this range 938 // DMA in this range
1034 if (pci_set_dma_mask(adapter->pdev, 0xFFFFFFFFFFFFFFFFULL) != 0) { 939 if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) != 0) {
1035 940
1036 con_log(CL_ANN, (KERN_WARNING 941 con_log(CL_ANN, (KERN_WARNING
1037 "megaraid: could not set DMA mask for 64-bit.\n")); 942 "megaraid: could not set DMA mask for 64-bit.\n"));
@@ -2661,7 +2566,7 @@ megaraid_mbox_dpc(unsigned long devp)
2661 * aborted. All the commands issued to the F/W must complete. 2566 * aborted. All the commands issued to the F/W must complete.
2662 **/ 2567 **/
2663static int 2568static int
2664megaraid_abort_handler(struct scsi_cmnd *scp) 2569__megaraid_abort_handler(struct scsi_cmnd *scp)
2665{ 2570{
2666 adapter_t *adapter; 2571 adapter_t *adapter;
2667 mraid_device_t *raid_dev; 2572 mraid_device_t *raid_dev;
@@ -2794,6 +2699,21 @@ megaraid_abort_handler(struct scsi_cmnd *scp)
2794 return FAILED; 2699 return FAILED;
2795} 2700}
2796 2701
2702static int
2703megaraid_abort_handler(struct scsi_cmnd *scp)
2704{
2705 adapter_t *adapter;
2706 int rc;
2707
2708 adapter = SCP2ADAPTER(scp);
2709
2710 spin_lock_irq(adapter->host_lock);
2711 rc = __megaraid_abort_handler(scp);
2712 spin_unlock_irq(adapter->host_lock);
2713
2714 return rc;
2715}
2716
2797 2717
2798/** 2718/**
2799 * megaraid_reset_handler - device reset hadler for mailbox based driver 2719 * megaraid_reset_handler - device reset hadler for mailbox based driver
@@ -2806,7 +2726,7 @@ megaraid_abort_handler(struct scsi_cmnd *scp)
2806 * host 2726 * host
2807 **/ 2727 **/
2808static int 2728static int
2809megaraid_reset_handler(struct scsi_cmnd *scp) 2729__megaraid_reset_handler(struct scsi_cmnd *scp)
2810{ 2730{
2811 adapter_t *adapter; 2731 adapter_t *adapter;
2812 scb_t *scb; 2732 scb_t *scb;
@@ -2927,6 +2847,18 @@ megaraid_reset_handler(struct scsi_cmnd *scp)
2927 return rval; 2847 return rval;
2928} 2848}
2929 2849
2850static int
2851megaraid_reset_handler(struct scsi_cmnd *cmd)
2852{
2853 int rc;
2854
2855 spin_lock_irq(cmd->device->host->host_lock);
2856 rc = __megaraid_reset_handler(cmd);
2857 spin_unlock_irq(cmd->device->host->host_lock);
2858
2859 return rc;
2860}
2861
2930 2862
2931/* 2863/*
2932 * START: internal commands library 2864 * START: internal commands library
@@ -4213,7 +4145,7 @@ megaraid_sysfs_show_app_hndl(struct class_device *cdev, char *buf)
4213 * @param buf : buffer to send data to 4145 * @param buf : buffer to send data to
4214 */ 4146 */
4215static ssize_t 4147static ssize_t
4216megaraid_sysfs_show_ldnum(struct device *dev, char *buf) 4148megaraid_sysfs_show_ldnum(struct device *dev, struct device_attribute *attr, char *buf)
4217{ 4149{
4218 struct scsi_device *sdev = to_scsi_device(dev); 4150 struct scsi_device *sdev = to_scsi_device(dev);
4219 adapter_t *adapter = (adapter_t *)SCSIHOST2ADAP(sdev->host); 4151 adapter_t *adapter = (adapter_t *)SCSIHOST2ADAP(sdev->host);
diff --git a/drivers/scsi/megaraid/megaraid_mbox.h b/drivers/scsi/megaraid/megaraid_mbox.h
index 07510009d110..644b91bdb028 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.h
+++ b/drivers/scsi/megaraid/megaraid_mbox.h
@@ -21,8 +21,8 @@
21#include "megaraid_ioctl.h" 21#include "megaraid_ioctl.h"
22 22
23 23
24#define MEGARAID_VERSION "2.20.4.5" 24#define MEGARAID_VERSION "2.20.4.6"
25#define MEGARAID_EXT_VERSION "(Release Date: Thu Feb 03 12:27:22 EST 2005)" 25#define MEGARAID_EXT_VERSION "(Release Date: Mon Mar 07 12:27:22 EST 2005)"
26 26
27 27
28/* 28/*
@@ -37,8 +37,7 @@
37#define PCI_DEVICE_ID_PERC4_DC 0x1960 37#define PCI_DEVICE_ID_PERC4_DC 0x1960
38#define PCI_SUBSYS_ID_PERC4_DC 0x0518 38#define PCI_SUBSYS_ID_PERC4_DC 0x0518
39 39
40#define PCI_DEVICE_ID_PERC4_QC 0x0407 40#define PCI_DEVICE_ID_VERDE 0x0407
41#define PCI_SUBSYS_ID_PERC4_QC 0x0531
42 41
43#define PCI_DEVICE_ID_PERC4_DI_EVERGLADES 0x000F 42#define PCI_DEVICE_ID_PERC4_DI_EVERGLADES 0x000F
44#define PCI_SUBSYS_ID_PERC4_DI_EVERGLADES 0x014A 43#define PCI_SUBSYS_ID_PERC4_DI_EVERGLADES 0x014A
@@ -58,11 +57,7 @@
58#define PCI_DEVICE_ID_PERC4E_DI_GUADALUPE 0x0013 57#define PCI_DEVICE_ID_PERC4E_DI_GUADALUPE 0x0013
59#define PCI_SUBSYS_ID_PERC4E_DI_GUADALUPE 0x0170 58#define PCI_SUBSYS_ID_PERC4E_DI_GUADALUPE 0x0170
60 59
61#define PCI_DEVICE_ID_PERC4E_DC_320_2E 0x0408 60#define PCI_DEVICE_ID_DOBSON 0x0408
62#define PCI_SUBSYS_ID_PERC4E_DC_320_2E 0x0002
63
64#define PCI_DEVICE_ID_PERC4E_SC_320_1E 0x0408
65#define PCI_SUBSYS_ID_PERC4E_SC_320_1E 0x0001
66 61
67#define PCI_DEVICE_ID_MEGARAID_SCSI_320_0 0x1960 62#define PCI_DEVICE_ID_MEGARAID_SCSI_320_0 0x1960
68#define PCI_SUBSYS_ID_MEGARAID_SCSI_320_0 0xA520 63#define PCI_SUBSYS_ID_MEGARAID_SCSI_320_0 0xA520
@@ -73,21 +68,6 @@
73#define PCI_DEVICE_ID_MEGARAID_SCSI_320_2 0x1960 68#define PCI_DEVICE_ID_MEGARAID_SCSI_320_2 0x1960
74#define PCI_SUBSYS_ID_MEGARAID_SCSI_320_2 0x0518 69#define PCI_SUBSYS_ID_MEGARAID_SCSI_320_2 0x0518
75 70
76#define PCI_DEVICE_ID_MEGARAID_SCSI_320_0x 0x0407
77#define PCI_SUBSYS_ID_MEGARAID_SCSI_320_0x 0x0530
78
79#define PCI_DEVICE_ID_MEGARAID_SCSI_320_2x 0x0407
80#define PCI_SUBSYS_ID_MEGARAID_SCSI_320_2x 0x0532
81
82#define PCI_DEVICE_ID_MEGARAID_SCSI_320_4x 0x0407
83#define PCI_SUBSYS_ID_MEGARAID_SCSI_320_4x 0x0531
84
85#define PCI_DEVICE_ID_MEGARAID_SCSI_320_1E 0x0408
86#define PCI_SUBSYS_ID_MEGARAID_SCSI_320_1E 0x0001
87
88#define PCI_DEVICE_ID_MEGARAID_SCSI_320_2E 0x0408
89#define PCI_SUBSYS_ID_MEGARAID_SCSI_320_2E 0x0002
90
91#define PCI_DEVICE_ID_MEGARAID_I4_133_RAID 0x1960 71#define PCI_DEVICE_ID_MEGARAID_I4_133_RAID 0x1960
92#define PCI_SUBSYS_ID_MEGARAID_I4_133_RAID 0x0522 72#define PCI_SUBSYS_ID_MEGARAID_I4_133_RAID 0x0522
93 73
@@ -97,52 +77,18 @@
97#define PCI_DEVICE_ID_MEGARAID_SATA_150_6 0x1960 77#define PCI_DEVICE_ID_MEGARAID_SATA_150_6 0x1960
98#define PCI_SUBSYS_ID_MEGARAID_SATA_150_6 0x0523 78#define PCI_SUBSYS_ID_MEGARAID_SATA_150_6 0x0523
99 79
100#define PCI_DEVICE_ID_MEGARAID_SATA_300_4x 0x0409 80#define PCI_DEVICE_ID_LINDSAY 0x0409
101#define PCI_SUBSYS_ID_MEGARAID_SATA_300_4x 0x3004
102
103#define PCI_DEVICE_ID_MEGARAID_SATA_300_8x 0x0409
104#define PCI_SUBSYS_ID_MEGARAID_SATA_300_8x 0x3008
105
106#define PCI_DEVICE_ID_INTEL_RAID_SRCU42X 0x0407
107#define PCI_SUBSYS_ID_INTEL_RAID_SRCU42X 0x0532
108 81
109#define PCI_DEVICE_ID_INTEL_RAID_SRCS16 0x1960 82#define PCI_DEVICE_ID_INTEL_RAID_SRCS16 0x1960
110#define PCI_SUBSYS_ID_INTEL_RAID_SRCS16 0x0523 83#define PCI_SUBSYS_ID_INTEL_RAID_SRCS16 0x0523
111 84
112#define PCI_DEVICE_ID_INTEL_RAID_SRCU42E 0x0408
113#define PCI_SUBSYS_ID_INTEL_RAID_SRCU42E 0x0002
114
115#define PCI_DEVICE_ID_INTEL_RAID_SRCZCRX 0x0407
116#define PCI_SUBSYS_ID_INTEL_RAID_SRCZCRX 0x0530
117
118#define PCI_DEVICE_ID_INTEL_RAID_SRCS28X 0x0409
119#define PCI_SUBSYS_ID_INTEL_RAID_SRCS28X 0x3008
120
121#define PCI_DEVICE_ID_INTEL_RAID_SROMBU42E_ALIEF 0x0408
122#define PCI_SUBSYS_ID_INTEL_RAID_SROMBU42E_ALIEF 0x3431
123
124#define PCI_DEVICE_ID_INTEL_RAID_SROMBU42E_HARWICH 0x0408
125#define PCI_SUBSYS_ID_INTEL_RAID_SROMBU42E_HARWICH 0x3499
126
127#define PCI_DEVICE_ID_INTEL_RAID_SRCU41L_LAKE_SHETEK 0x1960 85#define PCI_DEVICE_ID_INTEL_RAID_SRCU41L_LAKE_SHETEK 0x1960
128#define PCI_SUBSYS_ID_INTEL_RAID_SRCU41L_LAKE_SHETEK 0x0520 86#define PCI_SUBSYS_ID_INTEL_RAID_SRCU41L_LAKE_SHETEK 0x0520
129 87
130#define PCI_DEVICE_ID_FSC_MEGARAID_PCI_EXPRESS_ROMB 0x0408
131#define PCI_SUBSYS_ID_FSC_MEGARAID_PCI_EXPRESS_ROMB 0x1065
132
133#define PCI_DEVICE_ID_MEGARAID_ACER_ROMB_2E 0x0408
134#define PCI_SUBSYS_ID_MEGARAID_ACER_ROMB_2E 0x004D
135
136#define PCI_SUBSYS_ID_PERC3_QC 0x0471 88#define PCI_SUBSYS_ID_PERC3_QC 0x0471
137#define PCI_SUBSYS_ID_PERC3_DC 0x0493 89#define PCI_SUBSYS_ID_PERC3_DC 0x0493
138#define PCI_SUBSYS_ID_PERC3_SC 0x0475 90#define PCI_SUBSYS_ID_PERC3_SC 0x0475
139 91
140#define PCI_DEVICE_ID_MEGARAID_NEC_ROMB_2E 0x0408
141#define PCI_SUBSYS_ID_MEGARAID_NEC_ROMB_2E 0x8287
142
143#ifndef PCI_SUBSYS_ID_FSC
144#define PCI_SUBSYS_ID_FSC 0x1734
145#endif
146 92
147#define MBOX_MAX_SCSI_CMDS 128 // number of cmds reserved for kernel 93#define MBOX_MAX_SCSI_CMDS 128 // number of cmds reserved for kernel
148#define MBOX_MAX_USER_CMDS 32 // number of cmds for applications 94#define MBOX_MAX_USER_CMDS 32 // number of cmds for applications
diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c
index 9f1b550713ec..37d110e864c4 100644
--- a/drivers/scsi/megaraid/megaraid_mm.c
+++ b/drivers/scsi/megaraid/megaraid_mm.c
@@ -10,13 +10,12 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 * 11 *
12 * FILE : megaraid_mm.c 12 * FILE : megaraid_mm.c
13 * Version : v2.20.2.5 (Jan 21 2005) 13 * Version : v2.20.2.6 (Mar 7 2005)
14 * 14 *
15 * Common management module 15 * Common management module
16 */ 16 */
17 17
18#include "megaraid_mm.h" 18#include "megaraid_mm.h"
19#include <linux/smp_lock.h>
20 19
21 20
22// Entry points for char node driver 21// Entry points for char node driver
@@ -61,7 +60,7 @@ EXPORT_SYMBOL(mraid_mm_unregister_adp);
61EXPORT_SYMBOL(mraid_mm_adapter_app_handle); 60EXPORT_SYMBOL(mraid_mm_adapter_app_handle);
62 61
63static int majorno; 62static int majorno;
64static uint32_t drvr_ver = 0x02200201; 63static uint32_t drvr_ver = 0x02200206;
65 64
66static int adapters_count_g; 65static int adapters_count_g;
67static struct list_head adapters_list_g; 66static struct list_head adapters_list_g;
@@ -1231,9 +1230,9 @@ mraid_mm_compat_ioctl(struct file *filep, unsigned int cmd,
1231 unsigned long arg) 1230 unsigned long arg)
1232{ 1231{
1233 int err; 1232 int err;
1234 lock_kernel(); 1233
1235 err = mraid_mm_ioctl(NULL, filep, cmd, arg); 1234 err = mraid_mm_ioctl(NULL, filep, cmd, arg);
1236 unlock_kernel(); 1235
1237 return err; 1236 return err;
1238} 1237}
1239#endif 1238#endif
diff --git a/drivers/scsi/megaraid/megaraid_mm.h b/drivers/scsi/megaraid/megaraid_mm.h
index 948a0012ab8c..7e36c46e7c43 100644
--- a/drivers/scsi/megaraid/megaraid_mm.h
+++ b/drivers/scsi/megaraid/megaraid_mm.h
@@ -29,9 +29,9 @@
29#include "megaraid_ioctl.h" 29#include "megaraid_ioctl.h"
30 30
31 31
32#define LSI_COMMON_MOD_VERSION "2.20.2.5" 32#define LSI_COMMON_MOD_VERSION "2.20.2.6"
33#define LSI_COMMON_MOD_EXT_VERSION \ 33#define LSI_COMMON_MOD_EXT_VERSION \
34 "(Release Date: Fri Jan 21 00:01:03 EST 2005)" 34 "(Release Date: Mon Mar 7 00:01:03 EST 2005)"
35 35
36 36
37#define LSI_DBGLVL dbglevel 37#define LSI_DBGLVL dbglevel
diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c
index f6da46d672f1..b05737ae5eff 100644
--- a/drivers/scsi/mesh.c
+++ b/drivers/scsi/mesh.c
@@ -1715,9 +1715,12 @@ static int mesh_host_reset(struct scsi_cmnd *cmd)
1715 struct mesh_state *ms = (struct mesh_state *) cmd->device->host->hostdata; 1715 struct mesh_state *ms = (struct mesh_state *) cmd->device->host->hostdata;
1716 volatile struct mesh_regs __iomem *mr = ms->mesh; 1716 volatile struct mesh_regs __iomem *mr = ms->mesh;
1717 volatile struct dbdma_regs __iomem *md = ms->dma; 1717 volatile struct dbdma_regs __iomem *md = ms->dma;
1718 unsigned long flags;
1718 1719
1719 printk(KERN_DEBUG "mesh_host_reset\n"); 1720 printk(KERN_DEBUG "mesh_host_reset\n");
1720 1721
1722 spin_lock_irqsave(ms->host->host_lock, flags);
1723
1721 /* Reset the controller & dbdma channel */ 1724 /* Reset the controller & dbdma channel */
1722 out_le32(&md->control, (RUN|PAUSE|FLUSH|WAKE) << 16); /* stop dma */ 1725 out_le32(&md->control, (RUN|PAUSE|FLUSH|WAKE) << 16); /* stop dma */
1723 out_8(&mr->exception, 0xff); /* clear all exception bits */ 1726 out_8(&mr->exception, 0xff); /* clear all exception bits */
@@ -1739,6 +1742,7 @@ static int mesh_host_reset(struct scsi_cmnd *cmd)
1739 /* Complete pending commands */ 1742 /* Complete pending commands */
1740 handle_reset(ms); 1743 handle_reset(ms);
1741 1744
1745 spin_unlock_irqrestore(ms->host->host_lock, flags);
1742 return SUCCESS; 1746 return SUCCESS;
1743} 1747}
1744 1748
diff --git a/drivers/scsi/mvme147.c b/drivers/scsi/mvme147.c
index e73b33f293a0..2fb31ee6d9f5 100644
--- a/drivers/scsi/mvme147.c
+++ b/drivers/scsi/mvme147.c
@@ -116,7 +116,14 @@ int mvme147_detect(Scsi_Host_Template *tpnt)
116static int mvme147_bus_reset(Scsi_Cmnd *cmd) 116static int mvme147_bus_reset(Scsi_Cmnd *cmd)
117{ 117{
118 /* FIXME perform bus-specific reset */ 118 /* FIXME perform bus-specific reset */
119
120 /* FIXME 2: kill this function, and let midlayer fallback to
121 the same result, calling wd33c93_host_reset() */
122
123 spin_lock_irq(cmd->device->host->host_lock);
119 wd33c93_host_reset(cmd); 124 wd33c93_host_reset(cmd);
125 spin_unlock_irq(cmd->device->host->host_lock);
126
120 return SUCCESS; 127 return SUCCESS;
121} 128}
122 129
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index d28c0d99c344..5159ceea319e 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -294,7 +294,6 @@ static struct scsi_host_template nsp32_template = {
294 .this_id = NSP32_HOST_SCSIID, 294 .this_id = NSP32_HOST_SCSIID,
295 .use_clustering = DISABLE_CLUSTERING, 295 .use_clustering = DISABLE_CLUSTERING,
296 .eh_abort_handler = nsp32_eh_abort, 296 .eh_abort_handler = nsp32_eh_abort,
297/* .eh_device_reset_handler = NULL, */
298 .eh_bus_reset_handler = nsp32_eh_bus_reset, 297 .eh_bus_reset_handler = nsp32_eh_bus_reset,
299 .eh_host_reset_handler = nsp32_eh_host_reset, 298 .eh_host_reset_handler = nsp32_eh_host_reset,
300#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,74)) 299#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,74))
@@ -2988,6 +2987,8 @@ static int nsp32_eh_bus_reset(struct scsi_cmnd *SCpnt)
2988 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; 2987 nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata;
2989 unsigned int base = SCpnt->device->host->io_port; 2988 unsigned int base = SCpnt->device->host->io_port;
2990 2989
2990 spin_lock_irq(SCpnt->device->host->host_lock);
2991
2991 nsp32_msg(KERN_INFO, "Bus Reset"); 2992 nsp32_msg(KERN_INFO, "Bus Reset");
2992 nsp32_dbg(NSP32_DEBUG_BUSRESET, "SCpnt=0x%x", SCpnt); 2993 nsp32_dbg(NSP32_DEBUG_BUSRESET, "SCpnt=0x%x", SCpnt);
2993 2994
@@ -2995,6 +2996,7 @@ static int nsp32_eh_bus_reset(struct scsi_cmnd *SCpnt)
2995 nsp32_do_bus_reset(data); 2996 nsp32_do_bus_reset(data);
2996 nsp32_write2(base, IRQ_CONTROL, 0); 2997 nsp32_write2(base, IRQ_CONTROL, 0);
2997 2998
2999 spin_unlock_irq(SCpnt->device->host->host_lock);
2998 return SUCCESS; /* SCSI bus reset is succeeded at any time. */ 3000 return SUCCESS; /* SCSI bus reset is succeeded at any time. */
2999} 3001}
3000 3002
@@ -3049,11 +3051,14 @@ static int nsp32_eh_host_reset(struct scsi_cmnd *SCpnt)
3049 nsp32_msg(KERN_INFO, "Host Reset"); 3051 nsp32_msg(KERN_INFO, "Host Reset");
3050 nsp32_dbg(NSP32_DEBUG_BUSRESET, "SCpnt=0x%x", SCpnt); 3052 nsp32_dbg(NSP32_DEBUG_BUSRESET, "SCpnt=0x%x", SCpnt);
3051 3053
3054 spin_lock_irq(SCpnt->device->host->host_lock);
3055
3052 nsp32hw_init(data); 3056 nsp32hw_init(data);
3053 nsp32_write2(base, IRQ_CONTROL, IRQ_CONTROL_ALL_IRQ_MASK); 3057 nsp32_write2(base, IRQ_CONTROL, IRQ_CONTROL_ALL_IRQ_MASK);
3054 nsp32_do_bus_reset(data); 3058 nsp32_do_bus_reset(data);
3055 nsp32_write2(base, IRQ_CONTROL, 0); 3059 nsp32_write2(base, IRQ_CONTROL, 0);
3056 3060
3061 spin_unlock_irq(SCpnt->device->host->host_lock);
3057 return SUCCESS; /* Host reset is succeeded at any time. */ 3062 return SUCCESS; /* Host reset is succeeded at any time. */
3058} 3063}
3059 3064
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index c585c7bef247..89a4a0615c22 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -5608,13 +5608,13 @@ static ssize_t osst_filemark_cnt_show(struct class_device *class_dev, char *buf)
5608 5608
5609CLASS_DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL); 5609CLASS_DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL);
5610 5610
5611static struct class_simple * osst_sysfs_class; 5611static struct class *osst_sysfs_class;
5612 5612
5613static int osst_sysfs_valid = 0; 5613static int osst_sysfs_valid = 0;
5614 5614
5615static void osst_sysfs_init(void) 5615static void osst_sysfs_init(void)
5616{ 5616{
5617 osst_sysfs_class = class_simple_create(THIS_MODULE, "onstream_tape"); 5617 osst_sysfs_class = class_create(THIS_MODULE, "onstream_tape");
5618 if ( IS_ERR(osst_sysfs_class) ) 5618 if ( IS_ERR(osst_sysfs_class) )
5619 printk(KERN_WARNING "osst :W: Unable to register sysfs class\n"); 5619 printk(KERN_WARNING "osst :W: Unable to register sysfs class\n");
5620 else 5620 else
@@ -5627,7 +5627,7 @@ static void osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape *
5627 5627
5628 if (!osst_sysfs_valid) return; 5628 if (!osst_sysfs_valid) return;
5629 5629
5630 osst_class_member = class_simple_device_add(osst_sysfs_class, dev, device, "%s", name); 5630 osst_class_member = class_device_create(osst_sysfs_class, dev, device, "%s", name);
5631 if (IS_ERR(osst_class_member)) { 5631 if (IS_ERR(osst_class_member)) {
5632 printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name); 5632 printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name);
5633 return; 5633 return;
@@ -5645,13 +5645,13 @@ static void osst_sysfs_destroy(dev_t dev)
5645{ 5645{
5646 if (!osst_sysfs_valid) return; 5646 if (!osst_sysfs_valid) return;
5647 5647
5648 class_simple_device_remove(dev); 5648 class_device_destroy(osst_sysfs_class, dev);
5649} 5649}
5650 5650
5651static void osst_sysfs_cleanup(void) 5651static void osst_sysfs_cleanup(void)
5652{ 5652{
5653 if (osst_sysfs_valid) { 5653 if (osst_sysfs_valid) {
5654 class_simple_destroy(osst_sysfs_class); 5654 class_destroy(osst_sysfs_class);
5655 osst_sysfs_valid = 0; 5655 osst_sysfs_valid = 0;
5656 } 5656 }
5657} 5657}
diff --git a/drivers/scsi/pas16.c b/drivers/scsi/pas16.c
index 7976947c0322..363e0ebd4a39 100644
--- a/drivers/scsi/pas16.c
+++ b/drivers/scsi/pas16.c
@@ -621,8 +621,6 @@ static Scsi_Host_Template driver_template = {
621 .queuecommand = pas16_queue_command, 621 .queuecommand = pas16_queue_command,
622 .eh_abort_handler = pas16_abort, 622 .eh_abort_handler = pas16_abort,
623 .eh_bus_reset_handler = pas16_bus_reset, 623 .eh_bus_reset_handler = pas16_bus_reset,
624 .eh_device_reset_handler = pas16_device_reset,
625 .eh_host_reset_handler = pas16_host_reset,
626 .bios_param = pas16_biosparam, 624 .bios_param = pas16_biosparam,
627 .can_queue = CAN_QUEUE, 625 .can_queue = CAN_QUEUE,
628 .this_id = 7, 626 .this_id = 7,
diff --git a/drivers/scsi/pas16.h b/drivers/scsi/pas16.h
index 58d4d67aed24..65ce1cc40d9a 100644
--- a/drivers/scsi/pas16.h
+++ b/drivers/scsi/pas16.h
@@ -120,8 +120,6 @@ static int pas16_biosparam(struct scsi_device *, struct block_device *,
120static int pas16_detect(Scsi_Host_Template *); 120static int pas16_detect(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 *);
123static int pas16_host_reset(Scsi_Cmnd *);
124static int pas16_device_reset(Scsi_Cmnd *);
125 123
126#ifndef CMD_PER_LUN 124#ifndef CMD_PER_LUN
127#define CMD_PER_LUN 2 125#define CMD_PER_LUN 2
@@ -164,9 +162,7 @@ static int pas16_device_reset(Scsi_Cmnd *);
164#define do_NCR5380_intr do_pas16_intr 162#define do_NCR5380_intr do_pas16_intr
165#define NCR5380_queue_command pas16_queue_command 163#define NCR5380_queue_command pas16_queue_command
166#define NCR5380_abort pas16_abort 164#define NCR5380_abort pas16_abort
167#define NCR5380_device_reset pas16_device_reset
168#define NCR5380_bus_reset pas16_bus_reset 165#define NCR5380_bus_reset pas16_bus_reset
169#define NCR5380_host_reset pas16_host_reset
170#define NCR5380_proc_info pas16_proc_info 166#define NCR5380_proc_info pas16_proc_info
171 167
172/* 15 14 12 10 7 5 3 168/* 15 14 12 10 7 5 3
diff --git a/drivers/scsi/pci2000.c b/drivers/scsi/pci2000.c
deleted file mode 100644
index 377a4666b568..000000000000
--- a/drivers/scsi/pci2000.c
+++ /dev/null
@@ -1,836 +0,0 @@
1/****************************************************************************
2 * Perceptive Solutions, Inc. PCI-2000 device driver for Linux.
3 *
4 * pci2000.c - Linux Host Driver for PCI-2000 IntelliCache SCSI Adapters
5 *
6 * Copyright (c) 1997-1999 Perceptive Solutions, Inc.
7 * All Rights Reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that redistributions of source
11 * code retain the above copyright notice and this comment without
12 * modification.
13 *
14 * Technical updates and product information at:
15 * http://www.psidisk.com
16 *
17 * Please send questions, comments, bug reports to:
18 * tech@psidisk.com Technical Support
19 *
20 *
21 * Revisions 1.10 Jan-21-1999
22 * - Fixed sign on message to reflect proper controller name.
23 * - Added support for RAID status monitoring and control.
24 *
25 * Revisions 1.11 Mar-22-1999
26 * - Fixed control timeout to not lock up the entire system if
27 * controller goes offline completely.
28 *
29 * Revisions 1.12 Mar-26-1999
30 * - Fixed spinlock and PCI configuration.
31 *
32 * Revisions 1.20 Mar-27-2000
33 * - Added support for dynamic DMA
34 *
35 ****************************************************************************/
36#define PCI2000_VERSION "1.20"
37
38#include <linux/blkdev.h>
39#include <linux/interrupt.h>
40#include <linux/module.h>
41#include <linux/kernel.h>
42#include <linux/types.h>
43#include <linux/string.h>
44#include <linux/pci.h>
45#include <linux/ioport.h>
46#include <linux/delay.h>
47#include <linux/sched.h>
48#include <linux/proc_fs.h>
49#include <linux/stat.h>
50#include <linux/spinlock.h>
51
52#include <asm/dma.h>
53#include <asm/system.h>
54#include <asm/io.h>
55
56#include "scsi.h"
57#include <scsi/scsi_host.h>
58#include "pci2000.h"
59#include "psi_roy.h"
60
61
62//#define DEBUG 1
63
64#ifdef DEBUG
65#define DEB(x) x
66#define STOP_HERE {int st;for(st=0;st<100;st++){st=1;}}
67#else
68#define DEB(x)
69#define STOP_HERE
70#endif
71
72typedef struct
73 {
74 unsigned int address;
75 unsigned int length;
76 } SCATGATH, *PSCATGATH;
77
78typedef struct
79 {
80 Scsi_Cmnd *SCpnt;
81 PSCATGATH scatGath;
82 dma_addr_t scatGathDma;
83 UCHAR *cdb;
84 dma_addr_t cdbDma;
85 UCHAR tag;
86 } DEV2000, *PDEV2000;
87
88typedef struct
89 {
90 ULONG basePort;
91 ULONG mb0;
92 ULONG mb1;
93 ULONG mb2;
94 ULONG mb3;
95 ULONG mb4;
96 ULONG cmd;
97 ULONG tag;
98 ULONG irqOwned;
99 struct pci_dev *pdev;
100 DEV2000 dev[MAX_BUS][MAX_UNITS];
101 } ADAPTER2000, *PADAPTER2000;
102
103#define HOSTDATA(host) ((PADAPTER2000)&host->hostdata)
104#define consistentLen (MAX_BUS * MAX_UNITS * (16 * sizeof (SCATGATH) + MAX_COMMAND_SIZE))
105
106
107static struct Scsi_Host *PsiHost[MAXADAPTER] = {NULL,}; // One for each adapter
108static int NumAdapters = 0;
109/****************************************************************
110 * Name: WaitReady :LOCAL
111 *
112 * Description: Wait for controller ready.
113 *
114 * Parameters: padapter - Pointer adapter data structure.
115 *
116 * Returns: TRUE on not ready.
117 *
118 ****************************************************************/
119static int WaitReady (PADAPTER2000 padapter)
120 {
121 ULONG z;
122
123 for ( z = 0; z < (TIMEOUT_COMMAND * 4); z++ )
124 {
125 if ( !inb_p (padapter->cmd) )
126 return FALSE;
127 udelay (250);
128 };
129 return TRUE;
130 }
131/****************************************************************
132 * Name: WaitReadyLong :LOCAL
133 *
134 * Description: Wait for controller ready.
135 *
136 * Parameters: padapter - Pointer adapter data structure.
137 *
138 * Returns: TRUE on not ready.
139 *
140 ****************************************************************/
141static int WaitReadyLong (PADAPTER2000 padapter)
142 {
143 ULONG z;
144
145 for ( z = 0; z < (5000 * 4); z++ )
146 {
147 if ( !inb_p (padapter->cmd) )
148 return FALSE;
149 udelay (250);
150 };
151 return TRUE;
152 }
153/****************************************************************
154 * Name: OpDone :LOCAL
155 *
156 * Description: Clean up operation and issue done to caller.
157 *
158 * Parameters: SCpnt - Pointer to SCSI command structure.
159 * status - Caller status.
160 *
161 * Returns: Nothing.
162 *
163 ****************************************************************/
164static void OpDone (Scsi_Cmnd *SCpnt, ULONG status)
165 {
166 SCpnt->result = status;
167 SCpnt->scsi_done (SCpnt);
168 }
169/****************************************************************
170 * Name: Command :LOCAL
171 *
172 * Description: Issue queued command to the PCI-2000.
173 *
174 * Parameters: padapter - Pointer to adapter information structure.
175 * cmd - PCI-2000 command byte.
176 *
177 * Returns: Non-zero command tag if operation is accepted.
178 *
179 ****************************************************************/
180static UCHAR Command (PADAPTER2000 padapter, UCHAR cmd)
181 {
182 outb_p (cmd, padapter->cmd);
183 if ( WaitReady (padapter) )
184 return 0;
185
186 if ( inw_p (padapter->mb0) )
187 return 0;
188
189 return inb_p (padapter->mb1);
190 }
191/****************************************************************
192 * Name: BuildSgList :LOCAL
193 *
194 * Description: Build the scatter gather list for controller.
195 *
196 * Parameters: SCpnt - Pointer to SCSI command structure.
197 * padapter - Pointer to adapter information structure.
198 * pdev - Pointer to adapter device structure.
199 *
200 * Returns: Non-zero in not scatter gather.
201 *
202 ****************************************************************/
203static int BuildSgList (Scsi_Cmnd *SCpnt, PADAPTER2000 padapter, PDEV2000 pdev)
204 {
205 int z;
206 int zc;
207 struct scatterlist *sg;
208
209 if ( SCpnt->use_sg )
210 {
211 sg = (struct scatterlist *)SCpnt->request_buffer;
212 zc = pci_map_sg (padapter->pdev, sg, SCpnt->use_sg, SCpnt->sc_data_direction);
213 for ( z = 0; z < zc; z++ )
214 {
215 pdev->scatGath[z].address = cpu_to_le32 (sg_dma_address (sg));
216 pdev->scatGath[z].length = cpu_to_le32 (sg_dma_len (sg++));
217 }
218 outl (pdev->scatGathDma, padapter->mb2);
219 outl ((zc << 24) | SCpnt->request_bufflen, padapter->mb3);
220 return FALSE;
221 }
222 if ( !SCpnt->request_bufflen)
223 {
224 outl (0, padapter->mb2);
225 outl (0, padapter->mb3);
226 return TRUE;
227 }
228 SCpnt->SCp.have_data_in = pci_map_single (padapter->pdev,
229 SCpnt->request_buffer, SCpnt->request_bufflen,
230 SCpnt->sc_data_direction);
231 outl (SCpnt->SCp.have_data_in, padapter->mb2);
232 outl (SCpnt->request_bufflen, padapter->mb3);
233 return TRUE;
234 }
235/*********************************************************************
236 * Name: PsiRaidCmd
237 *
238 * Description: Execute a simple command.
239 *
240 * Parameters: padapter - Pointer to adapter control structure.
241 * cmd - Roy command byte.
242 *
243 * Returns: Return error status.
244 *
245 ********************************************************************/
246static int PsiRaidCmd (PADAPTER2000 padapter, char cmd)
247 {
248 if ( WaitReady (padapter) ) // test for command register ready
249 return DID_TIME_OUT;
250 outb_p (cmd, padapter->cmd); // issue command
251 if ( WaitReadyLong (padapter) ) // wait for adapter ready
252 return DID_TIME_OUT;
253 return DID_OK;
254 }
255/****************************************************************
256 * Name: Irq_Handler :LOCAL
257 *
258 * Description: Interrupt handler.
259 *
260 * Parameters: irq - Hardware IRQ number.
261 * dev_id -
262 * regs -
263 *
264 * Returns: TRUE if drive is not ready in time.
265 *
266 ****************************************************************/
267static irqreturn_t Irq_Handler (int irq, void *dev_id, struct pt_regs *regs)
268 {
269 struct Scsi_Host *shost = NULL; // Pointer to host data block
270 PADAPTER2000 padapter; // Pointer to adapter control structure
271 PDEV2000 pdev;
272 Scsi_Cmnd *SCpnt;
273 UCHAR tag = 0;
274 UCHAR tag0;
275 ULONG error;
276 int pun;
277 int bus;
278 int z;
279 unsigned long flags;
280 int handled = 0;
281
282 DEB(printk ("\npci2000 received interrupt "));
283 for ( z = 0; z < NumAdapters; z++ ) // scan for interrupt to process
284 {
285 if ( PsiHost[z]->irq == (UCHAR)(irq & 0xFF) )
286 {
287 tag = inb_p (HOSTDATA(PsiHost[z])->tag);
288 if ( tag )
289 {
290 shost = PsiHost[z];
291 break;
292 }
293 }
294 }
295
296 if ( !shost )
297 {
298 DEB (printk ("\npci2000: not my interrupt"));
299 goto out;
300 }
301
302 handled = 1;
303 spin_lock_irqsave(shost->host_lock, flags);
304 padapter = HOSTDATA(shost);
305
306 tag0 = tag & 0x7F; // mask off the error bit
307 for ( bus = 0; bus < MAX_BUS; bus++ ) // scan the busses
308 {
309 for ( pun = 0; pun < MAX_UNITS; pun++ ) // scan the targets
310 {
311 pdev = &padapter->dev[bus][pun];
312 if ( !pdev->tag )
313 continue;
314 if ( pdev->tag == tag0 ) // is this it?
315 {
316 pdev->tag = 0;
317 SCpnt = pdev->SCpnt;
318 goto unmapProceed;
319 }
320 }
321 }
322
323 outb_p (0xFF, padapter->tag); // clear the op interrupt
324 outb_p (CMD_DONE, padapter->cmd); // complete the op
325 goto irq_return; // done, but, with what?
326
327unmapProceed:;
328 if ( !bus )
329 {
330 switch ( SCpnt->cmnd[0] )
331 {
332 case SCSIOP_TEST_UNIT_READY:
333 pci_unmap_single (padapter->pdev, SCpnt->SCp.have_data_in, sizeof (SCpnt->sense_buffer), PCI_DMA_FROMDEVICE);
334 goto irqProceed;
335 case SCSIOP_READ_CAPACITY:
336 pci_unmap_single (padapter->pdev, SCpnt->SCp.have_data_in, 8, PCI_DMA_FROMDEVICE);
337 goto irqProceed;
338 case SCSIOP_VERIFY:
339 case SCSIOP_START_STOP_UNIT:
340 case SCSIOP_MEDIUM_REMOVAL:
341 goto irqProceed;
342 }
343 }
344 if ( SCpnt->SCp.have_data_in )
345 pci_unmap_single (padapter->pdev, SCpnt->SCp.have_data_in, SCpnt->request_bufflen, SCpnt->sc_data_direction);
346 else
347 {
348 if ( SCpnt->use_sg )
349 pci_unmap_sg (padapter->pdev, (struct scatterlist *)SCpnt->request_buffer, SCpnt->use_sg, SCpnt->sc_data_direction);
350 }
351
352irqProceed:;
353 if ( tag & ERR08_TAGGED ) // is there an error here?
354 {
355 if ( WaitReady (padapter) )
356 {
357 OpDone (SCpnt, DID_TIME_OUT << 16);
358 goto irq_return;
359 }
360
361 outb_p (tag0, padapter->mb0); // get real error code
362 outb_p (CMD_ERROR, padapter->cmd);
363 if ( WaitReady (padapter) ) // wait for controller to suck up the op
364 {
365 OpDone (SCpnt, DID_TIME_OUT << 16);
366 goto irq_return;
367 }
368
369 error = inl (padapter->mb0); // get error data
370 outb_p (0xFF, padapter->tag); // clear the op interrupt
371 outb_p (CMD_DONE, padapter->cmd); // complete the op
372
373 DEB (printk ("status: %lX ", error));
374 if ( error == 0x00020002 ) // is this error a check condition?
375 {
376 if ( bus ) // are we doint SCSI commands?
377 {
378 OpDone (SCpnt, (DID_OK << 16) | 2);
379 goto irq_return;
380 }
381 if ( *SCpnt->cmnd == SCSIOP_TEST_UNIT_READY )
382 OpDone (SCpnt, (DRIVER_SENSE << 24) | (DID_OK << 16) | 2); // test caller we have sense data too
383 else
384 OpDone (SCpnt, DID_ERROR << 16);
385 goto irq_return;
386 }
387 OpDone (SCpnt, DID_ERROR << 16);
388 goto irq_return;
389 }
390
391 outb_p (0xFF, padapter->tag); // clear the op interrupt
392 outb_p (CMD_DONE, padapter->cmd); // complete the op
393 OpDone (SCpnt, DID_OK << 16);
394
395irq_return:
396 spin_unlock_irqrestore(shost->host_lock, flags);
397out:
398 return IRQ_RETVAL(handled);
399}
400/****************************************************************
401 * Name: Pci2000_QueueCommand
402 *
403 * Description: Process a queued command from the SCSI manager.
404 *
405 * Parameters: SCpnt - Pointer to SCSI command structure.
406 * done - Pointer to done function to call.
407 *
408 * Returns: Status code.
409 *
410 ****************************************************************/
411int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
412 {
413 UCHAR *cdb = (UCHAR *)SCpnt->cmnd; // Pointer to SCSI CDB
414 PADAPTER2000 padapter = HOSTDATA(SCpnt->device->host); // Pointer to adapter control structure
415 int rc = -1; // command return code
416 UCHAR bus = SCpnt->device->channel;
417 UCHAR pun = SCpnt->device->id;
418 UCHAR lun = SCpnt->device->lun;
419 UCHAR cmd;
420 PDEV2000 pdev = &padapter->dev[bus][pun];
421
422 if ( !done )
423 {
424 printk("pci2000_queuecommand: %02X: done can't be NULL\n", *cdb);
425 return 0;
426 }
427
428 SCpnt->scsi_done = done;
429 SCpnt->SCp.have_data_in = 0;
430 pdev->SCpnt = SCpnt; // Save this command data
431
432 if ( WaitReady (padapter) )
433 {
434 rc = DID_ERROR;
435 goto finished;
436 }
437
438 outw_p (pun | (lun << 8), padapter->mb0);
439
440 if ( bus )
441 {
442 DEB (if(*cdb) printk ("\nCDB: %X- %X %X %X %X %X %X %X %X %X %X ", SCpnt->cmd_len, cdb[0], cdb[1], cdb[2], cdb[3], cdb[4], cdb[5], cdb[6], cdb[7], cdb[8], cdb[9]));
443 DEB (if(*cdb) printk ("\ntimeout_per_command: %d, timeout_total: %d, timeout: %d", SCpnt->timeout_per_command,
444 SCpnt->timeout_total, SCpnt->timeout));
445 outl (SCpnt->timeout_per_command, padapter->mb1);
446 outb_p (CMD_SCSI_TIMEOUT, padapter->cmd);
447 if ( WaitReady (padapter) )
448 {
449 rc = DID_ERROR;
450 goto finished;
451 }
452
453 outw_p (pun | (lun << 8), padapter->mb0);
454 outw_p (SCpnt->cmd_len << 8, padapter->mb0 + 2);
455 memcpy (pdev->cdb, cdb, MAX_COMMAND_SIZE);
456
457 outl (pdev->cdbDma, padapter->mb1);
458 if ( BuildSgList (SCpnt, padapter, pdev) )
459 cmd = CMD_SCSI_THRU;
460 else
461 cmd = CMD_SCSI_THRU_SG;
462 if ( (pdev->tag = Command (padapter, cmd)) == 0 )
463 rc = DID_TIME_OUT;
464 goto finished;
465 }
466 else
467 {
468 if ( lun )
469 {
470 rc = DID_BAD_TARGET;
471 goto finished;
472 }
473 }
474
475 switch ( *cdb )
476 {
477 case SCSIOP_INQUIRY: // inquiry CDB
478 if ( cdb[2] == SC_MY_RAID )
479 {
480 switch ( cdb[3] )
481 {
482 case MY_SCSI_REBUILD:
483 OpDone (SCpnt, PsiRaidCmd (padapter, CMD_RAID_REBUILD) << 16);
484 return 0;
485 case MY_SCSI_ALARMMUTE:
486 OpDone (SCpnt, PsiRaidCmd (padapter, CMD_RAID_MUTE) << 16);
487 return 0;
488 case MY_SCSI_DEMOFAIL:
489 OpDone (SCpnt, PsiRaidCmd (padapter, CMD_RAID_FAIL) << 16);
490 return 0;
491 default:
492 if ( SCpnt->use_sg )
493 {
494 rc = DID_ERROR;
495 goto finished;
496 }
497 else
498 {
499 SCpnt->SCp.have_data_in = pci_map_single (padapter->pdev, SCpnt->request_buffer, SCpnt->request_bufflen,
500 SCpnt->sc_data_direction);
501 outl (SCpnt->SCp.have_data_in, padapter->mb2);
502 }
503 outl (cdb[5], padapter->mb0);
504 outl (cdb[3], padapter->mb3);
505 cmd = CMD_DASD_RAID_RQ;
506 break;
507 }
508 break;
509 }
510
511 if ( SCpnt->use_sg )
512 {
513 SCpnt->SCp.have_data_in = pci_map_single (padapter->pdev,
514 ((struct scatterlist *)SCpnt->request_buffer)->address,
515 SCpnt->request_bufflen,
516 SCpnt->sc_data_direction);
517 }
518 else
519 {
520 SCpnt->SCp.have_data_in = pci_map_single (padapter->pdev, SCpnt->request_buffer,
521 SCpnt->request_bufflen,
522 SCpnt->sc_data_direction);
523 }
524 outl (SCpnt->SCp.have_data_in, padapter->mb2);
525 outl (SCpnt->request_bufflen, padapter->mb3);
526 cmd = CMD_DASD_SCSI_INQ;
527 break;
528
529 case SCSIOP_TEST_UNIT_READY: // test unit ready CDB
530 SCpnt->SCp.have_data_in = pci_map_single (padapter->pdev, SCpnt->sense_buffer, sizeof (SCpnt->sense_buffer), PCI_DMA_FROMDEVICE);
531 outl (SCpnt->SCp.have_data_in, padapter->mb2);
532 outl (sizeof (SCpnt->sense_buffer), padapter->mb3);
533 cmd = CMD_TEST_READY;
534 break;
535
536 case SCSIOP_READ_CAPACITY: // read capacity CDB
537 if ( SCpnt->use_sg )
538 {
539 SCpnt->SCp.have_data_in = pci_map_single (padapter->pdev, ((struct scatterlist *)(SCpnt->request_buffer))->address,
540 8, PCI_DMA_FROMDEVICE);
541 }
542 else
543 SCpnt->SCp.have_data_in = pci_map_single (padapter->pdev, SCpnt->request_buffer, 8, PCI_DMA_FROMDEVICE);
544 outl (SCpnt->SCp.have_data_in, padapter->mb2);
545 outl (8, padapter->mb3);
546 cmd = CMD_DASD_CAP;
547 break;
548 case SCSIOP_VERIFY: // verify CDB
549 outw_p ((USHORT)cdb[8] | ((USHORT)cdb[7] << 8), padapter->mb0 + 2);
550 outl (XSCSI2LONG (&cdb[2]), padapter->mb1);
551 cmd = CMD_READ_SG;
552 break;
553 case SCSIOP_READ: // read10 CDB
554 outw_p ((USHORT)cdb[8] | ((USHORT)cdb[7] << 8), padapter->mb0 + 2);
555 outl (XSCSI2LONG (&cdb[2]), padapter->mb1);
556 if ( BuildSgList (SCpnt, padapter, pdev) )
557 cmd = CMD_READ;
558 else
559 cmd = CMD_READ_SG;
560 break;
561 case SCSIOP_READ6: // read6 CDB
562 outw_p (cdb[4], padapter->mb0 + 2);
563 outl ((SCSI2LONG (&cdb[1])) & 0x001FFFFF, padapter->mb1);
564 if ( BuildSgList (SCpnt, padapter, pdev) )
565 cmd = CMD_READ;
566 else
567 cmd = CMD_READ_SG;
568 break;
569 case SCSIOP_WRITE: // write10 CDB
570 outw_p ((USHORT)cdb[8] | ((USHORT)cdb[7] << 8), padapter->mb0 + 2);
571 outl (XSCSI2LONG (&cdb[2]), padapter->mb1);
572 if ( BuildSgList (SCpnt, padapter, pdev) )
573 cmd = CMD_WRITE;
574 else
575 cmd = CMD_WRITE_SG;
576 break;
577 case SCSIOP_WRITE6: // write6 CDB
578 outw_p (cdb[4], padapter->mb0 + 2);
579 outl ((SCSI2LONG (&cdb[1])) & 0x001FFFFF, padapter->mb1);
580 if ( BuildSgList (SCpnt, padapter, pdev) )
581 cmd = CMD_WRITE;
582 else
583 cmd = CMD_WRITE_SG;
584 break;
585 case SCSIOP_START_STOP_UNIT:
586 cmd = CMD_EJECT_MEDIA;
587 break;
588 case SCSIOP_MEDIUM_REMOVAL:
589 switch ( cdb[4] )
590 {
591 case 0:
592 cmd = CMD_UNLOCK_DOOR;
593 break;
594 case 1:
595 cmd = CMD_LOCK_DOOR;
596 break;
597 default:
598 cmd = 0;
599 break;
600 }
601 if ( cmd )
602 break;
603 default:
604 DEB (printk ("pci2000_queuecommand: Unsupported command %02X\n", *cdb));
605 OpDone (SCpnt, DID_ERROR << 16);
606 return 0;
607 }
608
609 if ( (pdev->tag = Command (padapter, cmd)) == 0 )
610 rc = DID_TIME_OUT;
611finished:;
612 if ( rc != -1 )
613 OpDone (SCpnt, rc << 16);
614 return 0;
615 }
616/****************************************************************
617 * Name: Pci2000_Detect
618 *
619 * Description: Detect and initialize our boards.
620 *
621 * Parameters: tpnt - Pointer to SCSI host template structure.
622 *
623 * Returns: Number of adapters installed.
624 *
625 ****************************************************************/
626int Pci2000_Detect (Scsi_Host_Template *tpnt)
627 {
628 int found = 0;
629 int installed = 0;
630 struct Scsi_Host *pshost;
631 PADAPTER2000 padapter;
632 int z, zz;
633 int setirq;
634 struct pci_dev *pdev = NULL;
635 UCHAR *consistent;
636 dma_addr_t consistentDma;
637
638 while ( (pdev = pci_find_device (VENDOR_PSI, DEVICE_ROY_1, pdev)) != NULL )
639 {
640 if (pci_enable_device(pdev))
641 continue;
642 pshost = scsi_register (tpnt, sizeof(ADAPTER2000));
643 if(pshost == NULL)
644 continue;
645 padapter = HOSTDATA(pshost);
646
647 padapter->basePort = pci_resource_start (pdev, 1);
648 DEB (printk ("\nBase Regs = %#04X", padapter->basePort)); // get the base I/O port address
649 padapter->mb0 = padapter->basePort + RTR_MAILBOX; // get the 32 bit mail boxes
650 padapter->mb1 = padapter->basePort + RTR_MAILBOX + 4;
651 padapter->mb2 = padapter->basePort + RTR_MAILBOX + 8;
652 padapter->mb3 = padapter->basePort + RTR_MAILBOX + 12;
653 padapter->mb4 = padapter->basePort + RTR_MAILBOX + 16;
654 padapter->cmd = padapter->basePort + RTR_LOCAL_DOORBELL; // command register
655 padapter->tag = padapter->basePort + RTR_PCI_DOORBELL; // tag/response register
656 padapter->pdev = pdev;
657
658 if ( WaitReady (padapter) )
659 goto unregister;
660 outb_p (0x84, padapter->mb0);
661 outb_p (CMD_SPECIFY, padapter->cmd);
662 if ( WaitReady (padapter) )
663 goto unregister;
664
665 consistent = pci_alloc_consistent (pdev, consistentLen, &consistentDma);
666 if ( !consistent )
667 {
668 printk ("Unable to allocate DMA memory for PCI-2000 controller.\n");
669 goto unregister;
670 }
671
672 scsi_set_device(pshost, &pdev->dev);
673 pshost->irq = pdev->irq;
674 setirq = 1;
675 padapter->irqOwned = 0;
676 for ( z = 0; z < installed; z++ ) // scan for shared interrupts
677 {
678 if ( PsiHost[z]->irq == pshost->irq ) // if shared then, don't posses
679 setirq = 0;
680 }
681 if ( setirq ) // if not shared, posses
682 {
683 if ( request_irq (pshost->irq, Irq_Handler, SA_SHIRQ, "pci2000", padapter) < 0 )
684 {
685 if ( request_irq (pshost->irq, Irq_Handler, SA_INTERRUPT | SA_SHIRQ, "pci2000", padapter) < 0 )
686 {
687 printk ("Unable to allocate IRQ for PCI-2000 controller.\n");
688 pci_free_consistent (pdev, consistentLen, consistent, consistentDma);
689 goto unregister;
690 }
691 }
692 padapter->irqOwned = pshost->irq; // set IRQ as owned
693 }
694 PsiHost[installed] = pshost; // save SCSI_HOST pointer
695
696 pshost->io_port = padapter->basePort;
697 pshost->n_io_port = 0xFF;
698 pshost->unique_id = padapter->basePort;
699 pshost->max_id = 16;
700 pshost->max_channel = 1;
701
702 for ( zz = 0; zz < MAX_BUS; zz++ )
703 for ( z = 0; z < MAX_UNITS; z++ )
704 {
705 padapter->dev[zz][z].tag = 0;
706 padapter->dev[zz][z].scatGath = (PSCATGATH)consistent;
707 padapter->dev[zz][z].scatGathDma = consistentDma;
708 consistent += 16 * sizeof (SCATGATH);
709 consistentDma += 16 * sizeof (SCATGATH);
710 padapter->dev[zz][z].cdb = (UCHAR *)consistent;
711 padapter->dev[zz][z].cdbDma = consistentDma;
712 consistent += MAX_COMMAND_SIZE;
713 consistentDma += MAX_COMMAND_SIZE;
714 }
715
716 printk("\nPSI-2000 Intelligent Storage SCSI CONTROLLER: at I/O = %lX IRQ = %d\n", padapter->basePort, pshost->irq);
717 printk("Version %s, Compiled %s %s\n\n", PCI2000_VERSION, __DATE__, __TIME__);
718 found++;
719 if ( ++installed < MAXADAPTER )
720 continue;
721 break;
722unregister:;
723 scsi_unregister (pshost);
724 found++;
725 }
726 NumAdapters = installed;
727 return installed;
728 }
729/****************************************************************
730 * Name: Pci2000_Abort
731 *
732 * Description: Process the Abort command from the SCSI manager.
733 *
734 * Parameters: SCpnt - Pointer to SCSI command structure.
735 *
736 * Returns: Allways snooze.
737 *
738 ****************************************************************/
739int Pci2000_Abort (Scsi_Cmnd *SCpnt)
740 {
741 DEB (printk ("pci2000_abort\n"));
742 return SCSI_ABORT_SNOOZE;
743 }
744/****************************************************************
745 * Name: Pci2000_Reset
746 *
747 * Description: Process the Reset command from the SCSI manager.
748 *
749 * Parameters: SCpnt - Pointer to SCSI command structure.
750 * flags - Flags about the reset command
751 *
752 * Returns: No active command at this time, so this means
753 * that each time we got some kind of response the
754 * last time through. Tell the mid-level code to
755 * request sense information in order to decide what
756 * to do next.
757 *
758 ****************************************************************/
759int Pci2000_Reset (Scsi_Cmnd *SCpnt, unsigned int reset_flags)
760 {
761 return SCSI_RESET_PUNT;
762 }
763/****************************************************************
764 * Name: Pci2000_Release
765 *
766 * Description: Release resources allocated for a single each adapter.
767 *
768 * Parameters: pshost - Pointer to SCSI command structure.
769 *
770 * Returns: zero.
771 *
772 ****************************************************************/
773int Pci2000_Release (struct Scsi_Host *pshost)
774 {
775 PADAPTER2000 padapter = HOSTDATA (pshost);
776
777 if ( padapter->irqOwned )
778 free_irq (pshost->irq, padapter);
779 pci_free_consistent (padapter->pdev, consistentLen, padapter->dev[0][0].scatGath, padapter->dev[0][0].scatGathDma);
780 release_region (pshost->io_port, pshost->n_io_port);
781 scsi_unregister(pshost);
782 return 0;
783 }
784
785/****************************************************************
786 * Name: Pci2000_BiosParam
787 *
788 * Description: Process the biosparam request from the SCSI manager to
789 * return C/H/S data.
790 *
791 * Parameters: disk - Pointer to SCSI disk structure.
792 * dev - Major/minor number from kernel.
793 * geom - Pointer to integer array to place geometry data.
794 *
795 * Returns: zero.
796 *
797 ****************************************************************/
798int Pci2000_BiosParam (struct scsi_device *sdev, struct block_device *dev,
799 sector_t capacity, int geom[])
800 {
801 PADAPTER2000 padapter;
802
803 padapter = HOSTDATA(sdev->host);
804
805 if ( WaitReady (padapter) )
806 return 0;
807 outb_p (sdev->id, padapter->mb0);
808 outb_p (CMD_GET_PARMS, padapter->cmd);
809 if ( WaitReady (padapter) )
810 return 0;
811
812 geom[0] = inb_p (padapter->mb2 + 3);
813 geom[1] = inb_p (padapter->mb2 + 2);
814 geom[2] = inw_p (padapter->mb2);
815 return 0;
816 }
817
818
819MODULE_LICENSE("Dual BSD/GPL");
820
821static Scsi_Host_Template driver_template = {
822 .proc_name = "pci2000",
823 .name = "PCI-2000 SCSI Intelligent Disk Controller",
824 .detect = Pci2000_Detect,
825 .release = Pci2000_Release,
826 .queuecommand = Pci2000_QueueCommand,
827 .abort = Pci2000_Abort,
828 .reset = Pci2000_Reset,
829 .bios_param = Pci2000_BiosParam,
830 .can_queue = 16,
831 .this_id = -1,
832 .sg_tablesize = 16,
833 .cmd_per_lun = 1,
834 .use_clustering = DISABLE_CLUSTERING,
835};
836#include "scsi_module.c"
diff --git a/drivers/scsi/pci2220i.c b/drivers/scsi/pci2220i.c
deleted file mode 100644
index e395e4203154..000000000000
--- a/drivers/scsi/pci2220i.c
+++ /dev/null
@@ -1,2915 +0,0 @@
1/****************************************************************************
2 * Perceptive Solutions, Inc. PCI-2220I device driver for Linux.
3 *
4 * pci2220i.c - Linux Host Driver for PCI-2220I EIDE RAID Adapters
5 *
6 * Copyright (c) 1997-1999 Perceptive Solutions, Inc.
7 * All Rights Reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that redistributions of source
11 * code retain the above copyright notice and this comment without
12 * modification.
13 *
14 * Technical updates and product information at:
15 * http://www.psidisk.com
16 *
17 * Please send questions, comments, bug reports to:
18 * tech@psidisk.com Technical Support
19 *
20 *
21 * Revisions 1.10 Mar-26-1999
22 * - Updated driver for RAID and hot reconstruct support.
23 *
24 * Revisions 1.11 Mar-26-1999
25 * - Fixed spinlock and PCI configuration.
26 *
27 * Revision 2.00 December-1-1999
28 * - Added code for the PCI-2240I controller
29 * - Added code for ATAPI devices.
30 * - Double buffer for scatter/gather support
31 *
32 * Revision 2.10 March-27-2000
33 * - Added support for dynamic DMA
34 *
35 ****************************************************************************/
36
37#error Convert me to understand page+offset based scatterlists
38
39//#define DEBUG 1
40
41#include <linux/interrupt.h>
42#include <linux/module.h>
43#include <linux/kernel.h>
44#include <linux/types.h>
45#include <linux/string.h>
46#include <linux/slab.h>
47#include <linux/pci.h>
48#include <linux/ioport.h>
49#include <linux/delay.h>
50#include <linux/sched.h>
51#include <linux/proc_fs.h>
52#include <linux/stat.h>
53#include <linux/blkdev.h>
54#include <linux/timer.h>
55#include <linux/spinlock.h>
56
57#include <asm/dma.h>
58#include <asm/system.h>
59#include <asm/io.h>
60
61#include "scsi.h"
62#include <scsi/scsi_host.h>
63#include "pci2220i.h"
64#include "psi_dale.h"
65
66
67#define PCI2220I_VERSION "2.10"
68#define READ_CMD IDE_CMD_READ_MULTIPLE
69#define WRITE_CMD IDE_CMD_WRITE_MULTIPLE
70#define MAX_BUS_MASTER_BLOCKS SECTORSXFER // This is the maximum we can bus master
71
72#ifdef DEBUG
73#define DEB(x) x
74#define STOP_HERE() {int st;for(st=0;st<100;st++){st=1;}}
75#else
76#define DEB(x)
77#define STOP_HERE()
78#endif
79
80#define MAXADAPTER 4 // Increase this and the sizes of the arrays below, if you need more.
81
82
83typedef struct
84 {
85 UCHAR byte6; // device select register image
86 UCHAR spigot; // spigot number
87 UCHAR spigots[2]; // RAID spigots
88 UCHAR deviceID[2]; // device ID codes
89 USHORT sectors; // number of sectors per track
90 USHORT heads; // number of heads
91 USHORT cylinders; // number of cylinders for this device
92 USHORT spareword; // placeholder
93 ULONG blocks; // number of blocks on device
94 DISK_MIRROR DiskMirror[2]; // RAID status and control
95 ULONG lastsectorlba[2]; // last addressable sector on the drive
96 USHORT raid; // RAID active flag
97 USHORT mirrorRecon;
98 UCHAR reconOn;
99 USHORT reconCount;
100 USHORT reconIsStarting; // indicate hot reconstruct is starting
101 UCHAR cmdDrqInt; // flag for command interrupt
102 UCHAR packet; // command packet size in bytes
103 } OUR_DEVICE, *POUR_DEVICE;
104
105typedef struct
106 {
107 USHORT bigD; // identity is a PCI-2240I if true, otherwise a PCI-2220I
108 USHORT atapi; // this interface is for ATAPI devices only
109 ULONG regDmaDesc; // address of the DMA discriptor register for direction of transfer
110 ULONG regDmaCmdStat; // Byte #1 of DMA command status register
111 ULONG regDmaAddrPci; // 32 bit register for PCI address of DMA
112 ULONG regDmaAddrLoc; // 32 bit register for local bus address of DMA
113 ULONG regDmaCount; // 32 bit register for DMA transfer count
114 ULONG regDmaMode; // 32 bit register for DMA mode control
115 ULONG regRemap; // 32 bit local space remap
116 ULONG regDesc; // 32 bit local region descriptor
117 ULONG regRange; // 32 bit local range
118 ULONG regIrqControl; // 16 bit Interrupt enable/disable and status
119 ULONG regScratchPad; // scratch pad I/O base address
120 ULONG regBase; // Base I/O register for data space
121 ULONG regData; // data register I/O address
122 ULONG regError; // error register I/O address
123 ULONG regSectCount; // sector count register I/O address
124 ULONG regLba0; // least significant byte of LBA
125 ULONG regLba8; // next least significant byte of LBA
126 ULONG regLba16; // next most significan byte of LBA
127 ULONG regLba24; // head and most 4 significant bits of LBA
128 ULONG regStatCmd; // status on read and command on write register
129 ULONG regStatSel; // board status on read and spigot select on write register
130 ULONG regFail; // fail bits control register
131 ULONG regAltStat; // alternate status and drive control register
132 ULONG basePort; // PLX base I/O port
133 USHORT timingMode; // timing mode currently set for adapter
134 USHORT timingPIO; // TRUE if PIO timing is active
135 struct pci_dev *pcidev;
136 ULONG timingAddress; // address to use on adapter for current timing mode
137 ULONG irqOwned; // owned IRQ or zero if shared
138 UCHAR numberOfDrives; // saved number of drives on this controller
139 UCHAR failRegister; // current inverted data in fail register
140 OUR_DEVICE device[BIGD_MAXDRIVES];
141 DISK_MIRROR *raidData[BIGD_MAXDRIVES];
142 ULONG startSector;
143 USHORT sectorCount;
144 ULONG readCount;
145 UCHAR *currentSgBuffer;
146 ULONG currentSgCount;
147 USHORT nextSg;
148 UCHAR cmd;
149 Scsi_Cmnd *SCpnt;
150 POUR_DEVICE pdev; // current device opearating on
151 USHORT devInReconIndex;
152 USHORT expectingIRQ;
153 USHORT reconOn; // Hot reconstruct is to be done.
154 USHORT reconPhase; // Hot reconstruct operation is in progress.
155 ULONG reconSize;
156 USHORT demoFail; // flag for RAID failure demonstration
157 USHORT survivor;
158 USHORT failinprog;
159 struct timer_list reconTimer;
160 struct timer_list timer;
161 UCHAR *kBuffer;
162 dma_addr_t kBufferDma;
163 UCHAR reqSense;
164 UCHAR atapiCdb[16];
165 UCHAR atapiSpecial;
166 } ADAPTER2220I, *PADAPTER2220I;
167
168#define HOSTDATA(host) ((PADAPTER2220I)&host->hostdata)
169
170#define RECON_PHASE_READY 0x01
171#define RECON_PHASE_COPY 0x02
172#define RECON_PHASE_UPDATE 0x03
173#define RECON_PHASE_LAST 0x04
174#define RECON_PHASE_END 0x07
175#define RECON_PHASE_MARKING 0x80
176#define RECON_PHASE_FAILOVER 0xFF
177
178static struct Scsi_Host *PsiHost[MAXADAPTER] = {NULL,}; // One for each adapter
179static int NumAdapters = 0;
180static int Installed = 0;
181static SETUP DaleSetup;
182static DISK_MIRROR DiskMirror[BIGD_MAXDRIVES];
183static ULONG ModeArray[] = {DALE_DATA_MODE2, DALE_DATA_MODE3, DALE_DATA_MODE4, DALE_DATA_MODE5};
184static ULONG ModeArray2[] = {BIGD_DATA_MODE2, BIGD_DATA_MODE3, BIGD_DATA_MODE4, BIGD_DATA_MODE5};
185
186static void ReconTimerExpiry (unsigned long data);
187
188/*******************************************************************************************************
189 * Name: Alarm
190 *
191 * Description: Sound the for the given device
192 *
193 * Parameters: padapter - Pointer adapter data structure.
194 * device - Device number.
195 *
196 * Returns: Nothing.
197 *
198 ******************************************************************************************************/
199static void Alarm (PADAPTER2220I padapter, UCHAR device)
200 {
201 UCHAR zc;
202
203 if ( padapter->bigD )
204 {
205 zc = device | (FAIL_ANY | FAIL_AUDIBLE);
206 if ( padapter->failRegister & FAIL_ANY )
207 zc |= FAIL_MULTIPLE;
208
209 padapter->failRegister = zc;
210 outb_p (~zc, padapter->regFail);
211 }
212 else
213 outb_p (0x3C | (1 << device), padapter->regFail); // sound alarm and set fail light
214 }
215/****************************************************************
216 * Name: MuteAlarm :LOCAL
217 *
218 * Description: Mute the audible alarm.
219 *
220 * Parameters: padapter - Pointer adapter data structure.
221 *
222 * Returns: TRUE if drive does not assert DRQ in time.
223 *
224 ****************************************************************/
225static void MuteAlarm (PADAPTER2220I padapter)
226 {
227 UCHAR old;
228
229 if ( padapter->bigD )
230 {
231 padapter->failRegister &= ~FAIL_AUDIBLE;
232 outb_p (~padapter->failRegister, padapter->regFail);
233 }
234 else
235 {
236 old = (inb_p (padapter->regStatSel) >> 3) | (inb_p (padapter->regStatSel) & 0x83);
237 outb_p (old | 0x40, padapter->regFail);
238 }
239 }
240/****************************************************************
241 * Name: WaitReady :LOCAL
242 *
243 * Description: Wait for device ready.
244 *
245 * Parameters: padapter - Pointer adapter data structure.
246 *
247 * Returns: TRUE if drive does not assert DRQ in time.
248 *
249 ****************************************************************/
250static int WaitReady (PADAPTER2220I padapter)
251 {
252 ULONG z;
253 UCHAR status;
254
255 for ( z = 0; z < (TIMEOUT_READY * 4); z++ )
256 {
257 status = inb_p (padapter->regStatCmd);
258 if ( (status & (IDE_STATUS_DRDY | IDE_STATUS_BUSY)) == IDE_STATUS_DRDY )
259 return 0;
260 udelay (250);
261 }
262 return status;
263 }
264/****************************************************************
265 * Name: WaitReadyReset :LOCAL
266 *
267 * Description: Wait for device ready.
268 *
269 * Parameters: padapter - Pointer adapter data structure.
270 *
271 * Returns: TRUE if drive does not assert DRQ in time.
272 *
273 ****************************************************************/
274static int WaitReadyReset (PADAPTER2220I padapter)
275 {
276 ULONG z;
277 UCHAR status;
278
279 for ( z = 0; z < (125 * 16); z++ ) // wait up to 1/4 second
280 {
281 status = inb_p (padapter->regStatCmd);
282 if ( (status & (IDE_STATUS_DRDY | IDE_STATUS_BUSY)) == IDE_STATUS_DRDY )
283 {
284 DEB (printk ("\nPCI2220I: Reset took %ld mSec to be ready", z / 8));
285 return 0;
286 }
287 udelay (125);
288 }
289 DEB (printk ("\nPCI2220I: Reset took more than 2 Seconds to come ready, Disk Failure"));
290 return status;
291 }
292/****************************************************************
293 * Name: WaitDrq :LOCAL
294 *
295 * Description: Wait for device ready for data transfer.
296 *
297 * Parameters: padapter - Pointer adapter data structure.
298 *
299 * Returns: TRUE if drive does not assert DRQ in time.
300 *
301 ****************************************************************/
302static int WaitDrq (PADAPTER2220I padapter)
303 {
304 ULONG z;
305 UCHAR status;
306
307 for ( z = 0; z < (TIMEOUT_DRQ * 4); z++ )
308 {
309 status = inb_p (padapter->regStatCmd);
310 if ( status & IDE_STATUS_DRQ )
311 return 0;
312 udelay (250);
313 }
314 return status;
315 }
316/****************************************************************
317 * Name: AtapiWaitReady :LOCAL
318 *
319 * Description: Wait for device busy and DRQ to be cleared.
320 *
321 * Parameters: padapter - Pointer adapter data structure.
322 * msec - Number of milliseconds to wait.
323 *
324 * Returns: TRUE if drive does not clear busy in time.
325 *
326 ****************************************************************/
327static int AtapiWaitReady (PADAPTER2220I padapter, int msec)
328 {
329 int z;
330
331 for ( z = 0; z < (msec * 16); z++ )
332 {
333 if ( !(inb_p (padapter->regStatCmd) & (IDE_STATUS_BUSY | IDE_STATUS_DRQ)) )
334 return FALSE;
335 udelay (125);
336 }
337 return TRUE;
338 }
339/****************************************************************
340 * Name: AtapiWaitDrq :LOCAL
341 *
342 * Description: Wait for device ready for data transfer.
343 *
344 * Parameters: padapter - Pointer adapter data structure.
345 * msec - Number of milliseconds to wait.
346 *
347 * Returns: TRUE if drive does not assert DRQ in time.
348 *
349 ****************************************************************/
350static int AtapiWaitDrq (PADAPTER2220I padapter, int msec)
351 {
352 ULONG z;
353
354 for ( z = 0; z < (msec * 16); z++ )
355 {
356 if ( inb_p (padapter->regStatCmd) & IDE_STATUS_DRQ )
357 return 0;
358 udelay (128);
359 }
360 return TRUE;
361 }
362/****************************************************************
363 * Name: HardReset :LOCAL
364 *
365 * Description: Wait for device ready for data transfer.
366 *
367 * Parameters: padapter - Pointer adapter data structure.
368 * pdev - Pointer to device.
369 * spigot - Spigot number.
370 *
371 * Returns: TRUE if drive does not assert DRQ in time.
372 *
373 ****************************************************************/
374static int HardReset (PADAPTER2220I padapter, POUR_DEVICE pdev, UCHAR spigot)
375 {
376 DEB (printk ("\npci2220i:RESET spigot = %X devices = %d, %d", spigot, pdev->deviceID[0], pdev->deviceID[1]));
377 mdelay (100); // just wait 100 mSec to let drives flush
378 SelectSpigot (padapter, spigot | SEL_IRQ_OFF);
379
380 outb_p (0x0E, padapter->regAltStat); // reset the suvivor
381 udelay (100); // wait a little
382 outb_p (0x08, padapter->regAltStat); // clear the reset
383 udelay (100);
384
385 outb_p (0xA0, padapter->regLba24); // select the master drive
386 if ( WaitReadyReset (padapter) )
387 {
388 DEB (printk ("\npci2220i: master not ready after reset"));
389 return TRUE;
390 }
391 outb_p (0xB0, padapter->regLba24); // try the slave drive
392 if ( (inb_p (padapter->regStatCmd) & (IDE_STATUS_DRDY | IDE_STATUS_BUSY)) == IDE_STATUS_DRDY )
393 {
394 DEB (printk ("\nPCI2220I: initializing slave drive on spigot %X", spigot));
395 outb_p (SECTORSXFER, padapter->regSectCount);
396 WriteCommand (padapter, IDE_CMD_SET_MULTIPLE);
397 if ( WaitReady (padapter) )
398 {
399 DEB (printk ("\npci2220i: slave not ready after set multiple"));
400 return TRUE;
401 }
402 }
403
404 outb_p (0xA0, padapter->regLba24); // select the drive
405 outb_p (SECTORSXFER, padapter->regSectCount);
406 WriteCommand (padapter, IDE_CMD_SET_MULTIPLE);
407 if ( WaitReady (padapter) )
408 {
409 DEB (printk ("\npci2220i: master not ready after set multiple"));
410 return TRUE;
411 }
412 return FALSE;
413 }
414/****************************************************************
415 * Name: AtapiReset :LOCAL
416 *
417 * Description: Wait for device ready for data transfer.
418 *
419 * Parameters: padapter - Pointer adapter data structure.
420 * pdev - Pointer to device.
421 *
422 * Returns: TRUE if drive does not come ready.
423 *
424 ****************************************************************/
425static int AtapiReset (PADAPTER2220I padapter, POUR_DEVICE pdev)
426 {
427 SelectSpigot (padapter, pdev->spigot);
428 AtapiDevice (padapter, pdev->byte6);
429 AtapiCountLo (padapter, 0);
430 AtapiCountHi (padapter, 0);
431 WriteCommand (padapter, IDE_COMMAND_ATAPI_RESET);
432 udelay (125);
433 if ( AtapiWaitReady (padapter, 1000) )
434 return TRUE;
435 if ( inb_p (padapter->regStatCmd) || (inb_p (padapter->regLba8) != 0x14) || (inb_p (padapter->regLba16) != 0xEB) )
436 return TRUE;
437 return FALSE;
438 }
439/****************************************************************
440 * Name: WalkScatGath :LOCAL
441 *
442 * Description: Transfer data to/from scatter/gather buffers.
443 *
444 * Parameters: padapter - Pointer adapter data structure.
445 * datain - TRUE if data read.
446 * length - Number of bytes to transfer.
447 *
448 * Returns: Nothing.
449 *
450 ****************************************************************/
451static void WalkScatGath (PADAPTER2220I padapter, UCHAR datain, ULONG length)
452 {
453 ULONG count;
454 UCHAR *buffer = padapter->kBuffer;
455
456 while ( length )
457 {
458 count = ( length > padapter->currentSgCount ) ? padapter->currentSgCount : length;
459
460 if ( datain )
461 memcpy (padapter->currentSgBuffer, buffer, count);
462 else
463 memcpy (buffer, padapter->currentSgBuffer, count);
464
465 padapter->currentSgCount -= count;
466 if ( !padapter->currentSgCount )
467 {
468 if ( padapter->nextSg < padapter->SCpnt->use_sg )
469 {
470 padapter->currentSgBuffer = ((struct scatterlist *)padapter->SCpnt->request_buffer)[padapter->nextSg].address;
471 padapter->currentSgCount = ((struct scatterlist *)padapter->SCpnt->request_buffer)[padapter->nextSg].length;
472 padapter->nextSg++;
473 }
474 }
475 else
476 padapter->currentSgBuffer += count;
477
478 length -= count;
479 buffer += count;
480 }
481 }
482/****************************************************************
483 * Name: BusMaster :LOCAL
484 *
485 * Description: Do a bus master I/O.
486 *
487 * Parameters: padapter - Pointer adapter data structure.
488 * datain - TRUE if data read.
489 * irq - TRUE if bus master interrupt expected.
490 *
491 * Returns: Nothing.
492 *
493 ****************************************************************/
494static void BusMaster (PADAPTER2220I padapter, UCHAR datain, UCHAR irq)
495 {
496 ULONG zl;
497
498 zl = ( padapter->sectorCount > MAX_BUS_MASTER_BLOCKS ) ? MAX_BUS_MASTER_BLOCKS : padapter->sectorCount;
499 padapter->sectorCount -= zl;
500 zl *= (ULONG)BYTES_PER_SECTOR;
501
502 if ( datain )
503 {
504 padapter->readCount = zl;
505 outb_p (8, padapter->regDmaDesc); // read operation
506 if ( padapter->bigD )
507 {
508 if ( irq && !padapter->sectorCount )
509 outb_p (0x0C, padapter->regDmaMode); // interrupt on
510 else
511 outb_p (0x08, padapter->regDmaMode); // no interrupt
512 }
513 else
514 {
515 if ( irq && !padapter->sectorCount )
516 outb_p (0x05, padapter->regDmaMode); // interrupt on
517 else
518 outb_p (0x01, padapter->regDmaMode); // no interrupt
519 }
520 }
521 else
522 {
523 outb_p (0x00, padapter->regDmaDesc); // write operation
524 if ( padapter->bigD )
525 outb_p (0x08, padapter->regDmaMode); // no interrupt
526 else
527 outb_p (0x01, padapter->regDmaMode); // no interrupt
528 WalkScatGath (padapter, FALSE, zl);
529 }
530
531 outl (padapter->timingAddress, padapter->regDmaAddrLoc);
532 outl (padapter->kBufferDma, padapter->regDmaAddrPci);
533 outl (zl, padapter->regDmaCount);
534 outb_p (0x03, padapter->regDmaCmdStat); // kick the DMA engine in gear
535 }
536/****************************************************************
537 * Name: AtapiBusMaster :LOCAL
538 *
539 * Description: Do a bus master I/O.
540 *
541 * Parameters: padapter - Pointer adapter data structure.
542 * datain - TRUE if data read.
543 * length - Number of bytes to transfer.
544 *
545 * Returns: Nothing.
546 *
547 ****************************************************************/
548static void AtapiBusMaster (PADAPTER2220I padapter, UCHAR datain, ULONG length)
549 {
550 outl (padapter->timingAddress, padapter->regDmaAddrLoc);
551 outl (padapter->kBufferDma, padapter->regDmaAddrPci);
552 outl (length, padapter->regDmaCount);
553 if ( datain )
554 {
555 if ( padapter->readCount )
556 WalkScatGath (padapter, TRUE, padapter->readCount);
557 outb_p (0x08, padapter->regDmaDesc); // read operation
558 outb_p (0x08, padapter->regDmaMode); // no interrupt
559 padapter->readCount = length;
560 }
561 else
562 {
563 outb_p (0x00, padapter->regDmaDesc); // write operation
564 outb_p (0x08, padapter->regDmaMode); // no interrupt
565 if ( !padapter->atapiSpecial )
566 WalkScatGath (padapter, FALSE, length);
567 }
568 outb_p (0x03, padapter->regDmaCmdStat); // kick the DMA engine in gear
569 }
570/****************************************************************
571 * Name: WriteData :LOCAL
572 *
573 * Description: Write data to device.
574 *
575 * Parameters: padapter - Pointer adapter data structure.
576 *
577 * Returns: TRUE if drive does not assert DRQ in time.
578 *
579 ****************************************************************/
580static int WriteData (PADAPTER2220I padapter)
581 {
582 ULONG zl;
583
584 if ( !WaitDrq (padapter) )
585 {
586 if ( padapter->timingPIO )
587 {
588 zl = (padapter->sectorCount > MAX_BUS_MASTER_BLOCKS) ? MAX_BUS_MASTER_BLOCKS : padapter->sectorCount;
589 WalkScatGath (padapter, FALSE, zl * BYTES_PER_SECTOR);
590 outsw (padapter->regData, padapter->kBuffer, zl * (BYTES_PER_SECTOR / 2));
591 padapter->sectorCount -= zl;
592 }
593 else
594 BusMaster (padapter, 0, 0);
595 return 0;
596 }
597 padapter->cmd = 0; // null out the command byte
598 return 1;
599 }
600/****************************************************************
601 * Name: WriteDataBoth :LOCAL
602 *
603 * Description: Write data to device.
604 *
605 * Parameters: padapter - Pointer to adapter structure.
606 * pdev - Pointer to device structure
607 *
608 * Returns: Index + 1 of drive not failed or zero for OK.
609 *
610 ****************************************************************/
611static int WriteDataBoth (PADAPTER2220I padapter, POUR_DEVICE pdev)
612 {
613 ULONG zl;
614 UCHAR status0, status1;
615
616 SelectSpigot (padapter, pdev->spigots[0]);
617 status0 = WaitDrq (padapter);
618 if ( !status0 )
619 {
620 SelectSpigot (padapter, pdev->spigots[1]);
621 status1 = WaitDrq (padapter);
622 if ( !status1 )
623 {
624 SelectSpigot (padapter, pdev->spigots[0] | pdev->spigots[1] | padapter->bigD);
625 if ( padapter->timingPIO )
626 {
627 zl = (padapter->sectorCount > MAX_BUS_MASTER_BLOCKS) ? MAX_BUS_MASTER_BLOCKS : padapter->sectorCount;
628 WalkScatGath (padapter, FALSE, zl * BYTES_PER_SECTOR);
629 outsw (padapter->regData, padapter->kBuffer, zl * (BYTES_PER_SECTOR / 2));
630 padapter->sectorCount -= zl;
631 }
632 else
633 BusMaster (padapter, 0, 0);
634 return 0;
635 }
636 }
637 padapter->cmd = 0; // null out the command byte
638 if ( status0 )
639 return 2;
640 return 1;
641 }
642/****************************************************************
643 * Name: IdeCmd :LOCAL
644 *
645 * Description: Process an IDE command.
646 *
647 * Parameters: padapter - Pointer adapter data structure.
648 * pdev - Pointer to device.
649 *
650 * Returns: Zero if no error or status register contents on error.
651 *
652 ****************************************************************/
653static UCHAR IdeCmd (PADAPTER2220I padapter, POUR_DEVICE pdev)
654 {
655 UCHAR status;
656
657 SelectSpigot (padapter, pdev->spigot | padapter->bigD); // select the spigot
658 outb_p (pdev->byte6 | ((UCHAR *)(&padapter->startSector))[3], padapter->regLba24); // select the drive
659 status = WaitReady (padapter);
660 if ( !status )
661 {
662 outb_p (padapter->sectorCount, padapter->regSectCount);
663 outb_p (((UCHAR *)(&padapter->startSector))[0], padapter->regLba0);
664 outb_p (((UCHAR *)(&padapter->startSector))[1], padapter->regLba8);
665 outb_p (((UCHAR *)(&padapter->startSector))[2], padapter->regLba16);
666 padapter->expectingIRQ = TRUE;
667 WriteCommand (padapter, padapter->cmd);
668 return 0;
669 }
670
671 padapter->cmd = 0; // null out the command byte
672 return status;
673 }
674/****************************************************************
675 * Name: IdeCmdBoth :LOCAL
676 *
677 * Description: Process an IDE command to both drivers.
678 *
679 * Parameters: padapter - Pointer adapter data structure.
680 * pdev - Pointer to device structure
681 *
682 * Returns: Index + 1 of drive not failed or zero for OK.
683 *
684 ****************************************************************/
685static UCHAR IdeCmdBoth (PADAPTER2220I padapter, POUR_DEVICE pdev)
686 {
687 UCHAR status0;
688 UCHAR status1;
689
690 SelectSpigot (padapter, pdev->spigots[0] | pdev->spigots[1]); // select the spigots
691 outb_p (padapter->pdev->byte6 | ((UCHAR *)(&padapter->startSector))[3], padapter->regLba24);// select the drive
692 SelectSpigot (padapter, pdev->spigots[0]);
693 status0 = WaitReady (padapter);
694 if ( !status0 )
695 {
696 SelectSpigot (padapter, pdev->spigots[1]);
697 status1 = WaitReady (padapter);
698 if ( !status1 )
699 {
700 SelectSpigot (padapter, pdev->spigots[0] | pdev->spigots[1] | padapter->bigD);
701 outb_p (padapter->sectorCount, padapter->regSectCount);
702 outb_p (((UCHAR *)(&padapter->startSector))[0], padapter->regLba0);
703 outb_p (((UCHAR *)(&padapter->startSector))[1], padapter->regLba8);
704 outb_p (((UCHAR *)(&padapter->startSector))[2], padapter->regLba16);
705 padapter->expectingIRQ = TRUE;
706 WriteCommand (padapter, padapter->cmd);
707 return 0;
708 }
709 }
710 padapter->cmd = 0; // null out the command byte
711 if ( status0 )
712 return 2;
713 return 1;
714 }
715/****************************************************************
716 * Name: OpDone :LOCAL
717 *
718 * Description: Complete an operatoin done sequence.
719 *
720 * Parameters: padapter - Pointer to host data block.
721 * spigot - Spigot select code.
722 * device - Device byte code.
723 *
724 * Returns: Nothing.
725 *
726 ****************************************************************/
727static void OpDone (PADAPTER2220I padapter, ULONG result)
728 {
729 Scsi_Cmnd *SCpnt = padapter->SCpnt;
730
731 if ( padapter->reconPhase )
732 {
733 padapter->reconPhase = 0;
734 if ( padapter->SCpnt )
735 {
736 Pci2220i_QueueCommand (SCpnt, SCpnt->scsi_done);
737 }
738 else
739 {
740 if ( padapter->reconOn )
741 {
742 ReconTimerExpiry ((unsigned long)padapter);
743 }
744 }
745 }
746 else
747 {
748 padapter->cmd = 0;
749 padapter->SCpnt = NULL;
750 padapter->pdev = NULL;
751 SCpnt->result = result;
752 SCpnt->scsi_done (SCpnt);
753 if ( padapter->reconOn && !padapter->reconTimer.data )
754 {
755 padapter->reconTimer.expires = jiffies + (HZ / 4); // start in 1/4 second
756 padapter->reconTimer.data = (unsigned long)padapter;
757 add_timer (&padapter->reconTimer);
758 }
759 }
760 }
761/****************************************************************
762 * Name: InlineIdentify :LOCAL
763 *
764 * Description: Do an intline inquiry on a drive.
765 *
766 * Parameters: padapter - Pointer to host data block.
767 * spigot - Spigot select code.
768 * device - Device byte code.
769 *
770 * Returns: Last addressable sector or zero if none.
771 *
772 ****************************************************************/
773static ULONG InlineIdentify (PADAPTER2220I padapter, UCHAR spigot, UCHAR device)
774 {
775 PIDENTIFY_DATA pid = (PIDENTIFY_DATA)padapter->kBuffer;
776
777 SelectSpigot (padapter, spigot | SEL_IRQ_OFF); // select the spigot
778 outb_p ((device << 4) | 0xA0, padapter->regLba24); // select the drive
779 if ( WaitReady (padapter) )
780 return 0;
781 WriteCommand (padapter, IDE_COMMAND_IDENTIFY);
782 if ( WaitDrq (padapter) )
783 return 0;
784 insw (padapter->regData, padapter->kBuffer, sizeof (IDENTIFY_DATA) >> 1);
785 return (pid->LBATotalSectors - 1);
786 }
787/****************************************************************
788 * Name: AtapiIdentify :LOCAL
789 *
790 * Description: Do an intline inquiry on a drive.
791 *
792 * Parameters: padapter - Pointer to host data block.
793 * pdev - Pointer to device table.
794 *
795 * Returns: TRUE on error.
796 *
797 ****************************************************************/
798static ULONG AtapiIdentify (PADAPTER2220I padapter, POUR_DEVICE pdev)
799 {
800 ATAPI_GENERAL_0 ag0;
801 USHORT zs;
802 int z;
803
804 AtapiDevice (padapter, pdev->byte6);
805 WriteCommand (padapter, IDE_COMMAND_ATAPI_IDENTIFY);
806 if ( AtapiWaitDrq (padapter, 3000) )
807 return TRUE;
808
809 *(USHORT *)&ag0 = inw_p (padapter->regData);
810 for ( z = 0; z < 255; z++ )
811 zs = inw_p (padapter->regData);
812
813 if ( ag0.ProtocolType == 2 )
814 {
815 if ( ag0.CmdDrqType == 1 )
816 pdev->cmdDrqInt = TRUE;
817 switch ( ag0.CmdPacketSize )
818 {
819 case 0:
820 pdev->packet = 6;
821 break;
822 case 1:
823 pdev->packet = 8;
824 break;
825 default:
826 pdev->packet = 6;
827 break;
828 }
829 return FALSE;
830 }
831 return TRUE;
832 }
833/****************************************************************
834 * Name: Atapi2Scsi
835 *
836 * Description: Convert ATAPI data to SCSI data.
837 *
838 * Parameters: padapter - Pointer adapter data structure.
839 * SCpnt - Pointer to SCSI command structure.
840 *
841 * Returns: Nothing.
842 *
843 ****************************************************************/
844void Atapi2Scsi (PADAPTER2220I padapter, Scsi_Cmnd *SCpnt)
845 {
846 UCHAR *buff = padapter->currentSgBuffer;
847
848 switch ( SCpnt->cmnd[0] )
849 {
850 case SCSIOP_MODE_SENSE:
851 buff[0] = padapter->kBuffer[1];
852 buff[1] = padapter->kBuffer[2];
853 buff[2] = padapter->kBuffer[3];
854 buff[3] = padapter->kBuffer[7];
855 memcpy (&buff[4], &padapter->kBuffer[8], padapter->atapiCdb[8] - 8);
856 break;
857 case SCSIOP_INQUIRY:
858 padapter->kBuffer[2] = 2;
859 memcpy (buff, padapter->kBuffer, padapter->currentSgCount);
860 break;
861 default:
862 if ( padapter->readCount )
863 WalkScatGath (padapter, TRUE, padapter->readCount);
864 break;
865 }
866 }
867/****************************************************************
868 * Name: Scsi2Atapi
869 *
870 * Description: Convert SCSI packet command to Atapi packet command.
871 *
872 * Parameters: padapter - Pointer adapter data structure.
873 * SCpnt - Pointer to SCSI command structure.
874 *
875 * Returns: Nothing.
876 *
877 ****************************************************************/
878static void Scsi2Atapi (PADAPTER2220I padapter, Scsi_Cmnd *SCpnt)
879 {
880 UCHAR *cdb = SCpnt->cmnd;
881 UCHAR *buff = padapter->currentSgBuffer;
882
883 switch (cdb[0])
884 {
885 case SCSIOP_READ6:
886 padapter->atapiCdb[0] = SCSIOP_READ;
887 padapter->atapiCdb[1] = cdb[1] & 0xE0;
888 padapter->atapiCdb[3] = cdb[1] & 0x1F;
889 padapter->atapiCdb[4] = cdb[2];
890 padapter->atapiCdb[5] = cdb[3];
891 padapter->atapiCdb[8] = cdb[4];
892 padapter->atapiCdb[9] = cdb[5];
893 break;
894 case SCSIOP_WRITE6:
895 padapter->atapiCdb[0] = SCSIOP_WRITE;
896 padapter->atapiCdb[1] = cdb[1] & 0xE0;
897 padapter->atapiCdb[3] = cdb[1] & 0x1F;
898 padapter->atapiCdb[4] = cdb[2];
899 padapter->atapiCdb[5] = cdb[3];
900 padapter->atapiCdb[8] = cdb[4];
901 padapter->atapiCdb[9] = cdb[5];
902 break;
903 case SCSIOP_MODE_SENSE:
904 padapter->atapiCdb[0] = SCSIOP_MODE_SENSE10;
905 padapter->atapiCdb[2] = cdb[2];
906 padapter->atapiCdb[8] = cdb[4] + 4;
907 break;
908
909 case SCSIOP_MODE_SELECT:
910 padapter->atapiSpecial = TRUE;
911 padapter->atapiCdb[0] = SCSIOP_MODE_SELECT10;
912 padapter->atapiCdb[1] = cdb[1] | 0x10;
913 memcpy (padapter->kBuffer, buff, 4);
914 padapter->kBuffer[4] = padapter->kBuffer[5] = 0;
915 padapter->kBuffer[6] = padapter->kBuffer[7] = 0;
916 memcpy (&padapter->kBuffer[8], &buff[4], cdb[4] - 4);
917 padapter->atapiCdb[8] = cdb[4] + 4;
918 break;
919 }
920 }
921/****************************************************************
922 * Name: AtapiSendCdb
923 *
924 * Description: Send the CDB packet to the device.
925 *
926 * Parameters: padapter - Pointer adapter data structure.
927 * pdev - Pointer to device.
928 * cdb - Pointer to 16 byte SCSI cdb.
929 *
930 * Returns: Nothing.
931 *
932 ****************************************************************/
933static void AtapiSendCdb (PADAPTER2220I padapter, POUR_DEVICE pdev, CHAR *cdb)
934 {
935 DEB (printk ("\nPCI2242I: CDB: %X %X %X %X %X %X %X %X %X %X %X %X", cdb[0], cdb[1], cdb[2], cdb[3], cdb[4], cdb[5], cdb[6], cdb[7], cdb[8], cdb[9], cdb[10], cdb[11]));
936 outsw (padapter->regData, cdb, pdev->packet);
937 }
938/****************************************************************
939 * Name: AtapiRequestSense
940 *
941 * Description: Send the CDB packet to the device.
942 *
943 * Parameters: padapter - Pointer adapter data structure.
944 * pdev - Pointer to device.
945 * SCpnt - Pointer to SCSI command structure.
946 * pass - If true then this is the second pass to send cdb.
947 *
948 * Returns: TRUE on error.
949 *
950 ****************************************************************/
951static int AtapiRequestSense (PADAPTER2220I padapter, POUR_DEVICE pdev, Scsi_Cmnd *SCpnt, UCHAR pass)
952 {
953 UCHAR cdb[16] = {SCSIOP_REQUEST_SENSE,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0};
954
955 DEB (printk ("\nPCI2242I: AUTO REQUEST SENSE"));
956 cdb[4] = (UCHAR)(sizeof (SCpnt->sense_buffer));
957 if ( !pass )
958 {
959 padapter->reqSense = TRUE;
960 AtapiCountLo (padapter, cdb[4]);
961 AtapiCountHi (padapter, 0);
962 outb_p (0, padapter->regError);
963 WriteCommand (padapter, IDE_COMMAND_ATAPI_PACKET);
964 if ( pdev->cmdDrqInt )
965 return FALSE;
966
967 if ( AtapiWaitDrq (padapter, 500) )
968 return TRUE;
969 }
970 AtapiSendCdb (padapter, pdev, cdb);
971 return FALSE;
972 }
973/****************************************************************
974 * Name: InlineReadSignature :LOCAL
975 *
976 * Description: Do an inline read RAID sigature.
977 *
978 * Parameters: padapter - Pointer adapter data structure.
979 * pdev - Pointer to device.
980 * index - index of data to read.
981 *
982 * Returns: Zero if no error or status register contents on error.
983 *
984 ****************************************************************/
985static UCHAR InlineReadSignature (PADAPTER2220I padapter, POUR_DEVICE pdev, int index)
986 {
987 UCHAR status;
988 ULONG zl = pdev->lastsectorlba[index];
989
990 SelectSpigot (padapter, pdev->spigots[index] | SEL_IRQ_OFF); // select the spigot without interrupts
991 outb_p (pdev->byte6 | ((UCHAR *)&zl)[3], padapter->regLba24);
992 status = WaitReady (padapter);
993 if ( !status )
994 {
995 outb_p (((UCHAR *)&zl)[2], padapter->regLba16);
996 outb_p (((UCHAR *)&zl)[1], padapter->regLba8);
997 outb_p (((UCHAR *)&zl)[0], padapter->regLba0);
998 outb_p (1, padapter->regSectCount);
999 WriteCommand (padapter, IDE_COMMAND_READ);
1000 status = WaitDrq (padapter);
1001 if ( !status )
1002 {
1003 insw (padapter->regData, padapter->kBuffer, BYTES_PER_SECTOR / 2);
1004 ((ULONG *)(&pdev->DiskMirror[index]))[0] = ((ULONG *)(&padapter->kBuffer[DISK_MIRROR_POSITION]))[0];
1005 ((ULONG *)(&pdev->DiskMirror[index]))[1] = ((ULONG *)(&padapter->kBuffer[DISK_MIRROR_POSITION]))[1];
1006 // some drives assert DRQ before IRQ so let's make sure we clear the IRQ
1007 WaitReady (padapter);
1008 return 0;
1009 }
1010 }
1011 return status;
1012 }
1013/****************************************************************
1014 * Name: DecodeError :LOCAL
1015 *
1016 * Description: Decode and process device errors.
1017 *
1018 * Parameters: padapter - Pointer to adapter data.
1019 * status - Status register code.
1020 *
1021 * Returns: The driver status code.
1022 *
1023 ****************************************************************/
1024static ULONG DecodeError (PADAPTER2220I padapter, UCHAR status)
1025 {
1026 UCHAR error;
1027
1028 padapter->expectingIRQ = 0;
1029 if ( status & IDE_STATUS_WRITE_FAULT )
1030 {
1031 return DID_PARITY << 16;
1032 }
1033 if ( status & IDE_STATUS_BUSY )
1034 return DID_BUS_BUSY << 16;
1035
1036 error = inb_p (padapter->regError);
1037 DEB(printk ("\npci2220i error register: %x", error));
1038 switch ( error )
1039 {
1040 case IDE_ERROR_AMNF:
1041 case IDE_ERROR_TKONF:
1042 case IDE_ERROR_ABRT:
1043 case IDE_ERROR_IDFN:
1044 case IDE_ERROR_UNC:
1045 case IDE_ERROR_BBK:
1046 default:
1047 return DID_ERROR << 16;
1048 }
1049 return DID_ERROR << 16;
1050 }
1051/****************************************************************
1052 * Name: StartTimer :LOCAL
1053 *
1054 * Description: Start the timer.
1055 *
1056 * Parameters: ipadapter - Pointer adapter data structure.
1057 *
1058 * Returns: Nothing.
1059 *
1060 ****************************************************************/
1061static void StartTimer (PADAPTER2220I padapter)
1062 {
1063 padapter->timer.expires = jiffies + TIMEOUT_DATA;
1064 add_timer (&padapter->timer);
1065 }
1066/****************************************************************
1067 * Name: WriteSignature :LOCAL
1068 *
1069 * Description: Start the timer.
1070 *
1071 * Parameters: padapter - Pointer adapter data structure.
1072 * pdev - Pointer to our device.
1073 * spigot - Selected spigot.
1074 * index - index of mirror signature on device.
1075 *
1076 * Returns: TRUE on any error.
1077 *
1078 ****************************************************************/
1079static int WriteSignature (PADAPTER2220I padapter, POUR_DEVICE pdev, UCHAR spigot, int index)
1080 {
1081 ULONG zl;
1082
1083 SelectSpigot (padapter, spigot);
1084 zl = pdev->lastsectorlba[index];
1085 outb_p (pdev->byte6 | ((UCHAR *)&zl)[3], padapter->regLba24);
1086 outb_p (((UCHAR *)&zl)[2], padapter->regLba16);
1087 outb_p (((UCHAR *)&zl)[1], padapter->regLba8);
1088 outb_p (((UCHAR *)&zl)[0], padapter->regLba0);
1089 outb_p (1, padapter->regSectCount);
1090
1091 WriteCommand (padapter, IDE_COMMAND_WRITE);
1092 if ( WaitDrq (padapter) )
1093 return TRUE;
1094 StartTimer (padapter);
1095 padapter->expectingIRQ = TRUE;
1096
1097 ((ULONG *)(&padapter->kBuffer[DISK_MIRROR_POSITION]))[0] = ((ULONG *)(&pdev->DiskMirror[index]))[0];
1098 ((ULONG *)(&padapter->kBuffer[DISK_MIRROR_POSITION]))[1] = ((ULONG *)(&pdev->DiskMirror[index]))[1];
1099 outsw (padapter->regData, padapter->kBuffer, BYTES_PER_SECTOR / 2);
1100 return FALSE;
1101 }
1102/*******************************************************************************************************
1103 * Name: InitFailover
1104 *
1105 * Description: This is the beginning of the failover routine
1106 *
1107 * Parameters: SCpnt - Pointer to SCSI command structure.
1108 * padapter - Pointer adapter data structure.
1109 * pdev - Pointer to our device.
1110 *
1111 * Returns: TRUE on error.
1112 *
1113 ******************************************************************************************************/
1114static int InitFailover (PADAPTER2220I padapter, POUR_DEVICE pdev)
1115 {
1116 UCHAR spigot;
1117
1118 DEB (printk ("\npci2220i: Initialize failover process - survivor = %d", pdev->deviceID[padapter->survivor]));
1119 pdev->raid = FALSE; //initializes system for non raid mode
1120 pdev->reconOn = FALSE;
1121 spigot = pdev->spigots[padapter->survivor];
1122
1123 if ( pdev->DiskMirror[padapter->survivor].status & UCBF_REBUILD )
1124 {
1125 DEB (printk ("\n failed, is survivor"));
1126 return (TRUE);
1127 }
1128
1129 if ( HardReset (padapter, pdev, spigot) )
1130 {
1131 DEB (printk ("\n failed, reset"));
1132 return TRUE;
1133 }
1134
1135 Alarm (padapter, pdev->deviceID[padapter->survivor ^ 1]);
1136 pdev->DiskMirror[padapter->survivor].status = UCBF_MIRRORED | UCBF_SURVIVOR; //clear present status
1137
1138 if ( WriteSignature (padapter, pdev, spigot, padapter->survivor) )
1139 {
1140 DEB (printk ("\n failed, write signature"));
1141 return TRUE;
1142 }
1143 padapter->failinprog = TRUE;
1144 return FALSE;
1145 }
1146/****************************************************************
1147 * Name: TimerExpiry :LOCAL
1148 *
1149 * Description: Timer expiry routine.
1150 *
1151 * Parameters: data - Pointer adapter data structure.
1152 *
1153 * Returns: Nothing.
1154 *
1155 ****************************************************************/
1156static void TimerExpiry (unsigned long data)
1157 {
1158 PADAPTER2220I padapter = (PADAPTER2220I)data;
1159 struct Scsi_Host *host = padapter->SCpnt->device->host;
1160 POUR_DEVICE pdev = padapter->pdev;
1161 UCHAR status = IDE_STATUS_BUSY;
1162 UCHAR temp, temp1;
1163 unsigned long flags;
1164
1165 /*
1166 * Disable interrupts, if they aren't already disabled and acquire
1167 * the I/O spinlock.
1168 */
1169 spin_lock_irqsave (host->host_lock, flags);
1170 DEB (printk ("\nPCI2220I: Timeout expired "));
1171
1172 if ( padapter->failinprog )
1173 {
1174 DEB (printk ("in failover process"));
1175 OpDone (padapter, DecodeError (padapter, inb_p (padapter->regStatCmd)));
1176 goto timerExpiryDone;
1177 }
1178
1179 while ( padapter->reconPhase )
1180 {
1181 DEB (printk ("in recon phase %X", padapter->reconPhase));
1182 switch ( padapter->reconPhase )
1183 {
1184 case RECON_PHASE_MARKING:
1185 case RECON_PHASE_LAST:
1186 padapter->survivor = ( pdev->spigot == pdev->spigots[0] ) ? 1 : 0;
1187 DEB (printk ("\npci2220i: FAILURE 1"));
1188 if ( InitFailover (padapter, pdev) )
1189 OpDone (padapter, DID_ERROR << 16);
1190 goto timerExpiryDone;
1191
1192 case RECON_PHASE_READY:
1193 OpDone (padapter, DID_ERROR << 16);
1194 goto timerExpiryDone;
1195
1196 case RECON_PHASE_COPY:
1197 padapter->survivor = ( pdev->spigot == pdev->spigots[0] ) ? 0 : 1;
1198 DEB (printk ("\npci2220i: FAILURE 2"));
1199 DEB (printk ("\n spig/stat = %X", inb_p (padapter->regStatSel));
1200 if ( InitFailover (padapter, pdev) )
1201 OpDone (padapter, DID_ERROR << 16);
1202 goto timerExpiryDone;
1203
1204 case RECON_PHASE_UPDATE:
1205 padapter->survivor = ( pdev->spigot == pdev->spigots[0] ) ? 0 : 1;
1206 DEB (printk ("\npci2220i: FAILURE 3")));
1207 if ( InitFailover (padapter, pdev) )
1208 OpDone (padapter, DID_ERROR << 16);
1209 goto timerExpiryDone;
1210
1211 case RECON_PHASE_END:
1212 padapter->survivor = ( pdev->spigot == pdev->spigots[0] ) ? 0 : 1;
1213 DEB (printk ("\npci2220i: FAILURE 4"));
1214 if ( InitFailover (padapter, pdev) )
1215 OpDone (padapter, DID_ERROR << 16);
1216 goto timerExpiryDone;
1217
1218 default:
1219 goto timerExpiryDone;
1220 }
1221 }
1222
1223 while ( padapter->cmd )
1224 {
1225 outb_p (0x08, padapter->regDmaCmdStat); // cancel interrupt from DMA engine
1226 if ( pdev->raid )
1227 {
1228 if ( padapter->cmd == WRITE_CMD )
1229 {
1230 DEB (printk ("in RAID write operation"));
1231 temp = ( pdev->spigot & (SEL_1 | SEL_2) ) ? SEL_1 : SEL_3;
1232 if ( inb_p (padapter->regStatSel) & temp )
1233 {
1234 DEB (printk ("\npci2220i: Determined A OK"));
1235 SelectSpigot (padapter, temp | SEL_IRQ_OFF); // Masking the interrupt during spigot select
1236 temp = inb_p (padapter->regStatCmd);
1237 }
1238 else
1239 temp = IDE_STATUS_BUSY;
1240
1241 temp1 = ( pdev->spigot & (SEL_1 | SEL_2) ) ? SEL_2 : SEL_4;
1242 if ( inb (padapter->regStatSel) & temp1 )
1243 {
1244 DEB (printk ("\npci2220i: Determined B OK"));
1245 SelectSpigot (padapter, temp1 | SEL_IRQ_OFF); // Masking the interrupt during spigot select
1246 temp1 = inb_p (padapter->regStatCmd);
1247 }
1248 else
1249 temp1 = IDE_STATUS_BUSY;
1250
1251 if ( (temp & IDE_STATUS_BUSY) || (temp1 & IDE_STATUS_BUSY) )
1252 {
1253 DEB (printk ("\npci2220i: Status A: %X B: %X", temp & 0xFF, temp1 & 0xFF));
1254 if ( (temp & IDE_STATUS_BUSY) && (temp1 & IDE_STATUS_BUSY) )
1255 {
1256 status = temp;
1257 break;
1258 }
1259 else
1260 {
1261 if ( temp & IDE_STATUS_BUSY )
1262 padapter->survivor = 1;
1263 else
1264 padapter->survivor = 0;
1265 if ( InitFailover (padapter, pdev) )
1266 {
1267 status = inb_p (padapter->regStatCmd);
1268 break;
1269 }
1270 goto timerExpiryDone;
1271 }
1272 }
1273 }
1274 else
1275 {
1276 DEB (printk ("in RAID read operation"));
1277 padapter->survivor = ( pdev->spigot == pdev->spigots[0] ) ? 0 : 1;
1278 DEB (printk ("\npci2220i: FAILURE 6"));
1279 if ( InitFailover (padapter, pdev) )
1280 {
1281 status = inb_p (padapter->regStatCmd);
1282 break;
1283 }
1284 goto timerExpiryDone;
1285 }
1286 }
1287 else
1288 {
1289 DEB (printk ("in I/O operation"));
1290 status = inb_p (padapter->regStatCmd);
1291 }
1292 break;
1293 }
1294
1295 OpDone (padapter, DecodeError (padapter, status));
1296
1297timerExpiryDone:;
1298 /*
1299 * Release the I/O spinlock and restore the original flags
1300 * which will enable interrupts if and only if they were
1301 * enabled on entry.
1302 */
1303 spin_unlock_irqrestore (host->host_lock, flags);
1304 }
1305/****************************************************************
1306 * Name: SetReconstruct :LOCAL
1307 *
1308 * Description: Set the reconstruct up.
1309 *
1310 * Parameters: pdev - Pointer to device structure.
1311 * index - Mirror index number.
1312 *
1313 * Returns: Number of sectors on new disk required.
1314 *
1315 ****************************************************************/
1316static LONG SetReconstruct (POUR_DEVICE pdev, int index)
1317 {
1318 pdev->DiskMirror[index].status = UCBF_MIRRORED; // setup the flags
1319 pdev->DiskMirror[index ^ 1].status = UCBF_MIRRORED | UCBF_REBUILD;
1320 pdev->DiskMirror[index ^ 1].reconstructPoint = 0; // start the reconstruct
1321 pdev->reconCount = 1990; // mark target drive early
1322 return pdev->DiskMirror[index].reconstructPoint;
1323 }
1324/****************************************************************
1325 * Name: ReconTimerExpiry :LOCAL
1326 *
1327 * Description: Reconstruct timer expiry routine.
1328 *
1329 * Parameters: data - Pointer adapter data structure.
1330 *
1331 * Returns: Nothing.
1332 *
1333 ****************************************************************/
1334static void ReconTimerExpiry (unsigned long data)
1335 {
1336 PADAPTER2220I padapter = (PADAPTER2220I)data;
1337 struct Scsi_Host *host = padapter->SCpnt->device->host;
1338 POUR_DEVICE pdev;
1339 ULONG testsize = 0;
1340 PIDENTIFY_DATA pid;
1341 USHORT minmode;
1342 ULONG zl;
1343 UCHAR zc;
1344 USHORT z;
1345 unsigned long flags;
1346
1347 /*
1348 * Disable interrupts, if they aren't already disabled and acquire
1349 * the I/O spinlock.
1350 */
1351 spin_lock_irqsave(host->host_lock, flags);
1352
1353 if ( padapter->SCpnt )
1354 goto reconTimerExpiry;
1355
1356 padapter->reconTimer.data = 0;
1357 for ( z = padapter->devInReconIndex + 1; z < BIGD_MAXDRIVES; z++ )
1358 {
1359 if ( padapter->device[z].reconOn )
1360 break;
1361 }
1362 if ( z < BIGD_MAXDRIVES )
1363 pdev = &padapter->device[z];
1364 else
1365 {
1366 for ( z = 0; z < BIGD_MAXDRIVES; z++ )
1367 {
1368 if ( padapter->device[z].reconOn )
1369 break;
1370 }
1371 if ( z < BIGD_MAXDRIVES )
1372 pdev = &padapter->device[z];
1373 else
1374 {
1375 padapter->reconOn = FALSE;
1376 goto reconTimerExpiry;
1377 }
1378 }
1379
1380 padapter->devInReconIndex = z;
1381 pid = (PIDENTIFY_DATA)padapter->kBuffer;
1382 padapter->pdev = pdev;
1383 if ( pdev->reconIsStarting )
1384 {
1385 pdev->reconIsStarting = FALSE;
1386 pdev->reconOn = FALSE;
1387
1388 while ( (pdev->DiskMirror[0].signature == SIGNATURE) && (pdev->DiskMirror[1].signature == SIGNATURE) &&
1389 (pdev->DiskMirror[0].pairIdentifier == (pdev->DiskMirror[1].pairIdentifier ^ 1)) )
1390 {
1391 if ( (pdev->DiskMirror[0].status & UCBF_MATCHED) && (pdev->DiskMirror[1].status & UCBF_MATCHED) )
1392 break;
1393
1394 if ( pdev->DiskMirror[0].status & UCBF_SURVIVOR ) // is first drive survivor?
1395 testsize = SetReconstruct (pdev, 0);
1396 else
1397 if ( pdev->DiskMirror[1].status & UCBF_SURVIVOR ) // is second drive survivor?
1398 testsize = SetReconstruct (pdev, 1);
1399
1400 if ( (pdev->DiskMirror[0].status & UCBF_REBUILD) || (pdev->DiskMirror[1].status & UCBF_REBUILD) )
1401 {
1402 if ( pdev->DiskMirror[0].status & UCBF_REBUILD )
1403 pdev->mirrorRecon = 0;
1404 else
1405 pdev->mirrorRecon = 1;
1406 pdev->reconOn = TRUE;
1407 }
1408 break;
1409 }
1410
1411 if ( !pdev->reconOn )
1412 goto reconTimerExpiry;
1413
1414 if ( padapter->bigD )
1415 {
1416 padapter->failRegister = 0;
1417 outb_p (~padapter->failRegister, padapter->regFail);
1418 }
1419 else
1420 {
1421 zc = ((inb_p (padapter->regStatSel) >> 3) | inb_p (padapter->regStatSel)) & 0x83; // mute the alarm
1422 outb_p (0xFF, padapter->regFail);
1423 }
1424
1425 while ( 1 )
1426 {
1427 DEB (printk ("\npci2220i: hard reset issue"));
1428 if ( HardReset (padapter, pdev, pdev->spigots[pdev->mirrorRecon]) )
1429 {
1430 DEB (printk ("\npci2220i: sub 1"));
1431 break;
1432 }
1433
1434 pdev->lastsectorlba[pdev->mirrorRecon] = InlineIdentify (padapter, pdev->spigots[pdev->mirrorRecon], pdev->deviceID[pdev->mirrorRecon] & 1);
1435
1436 if ( pdev->lastsectorlba[pdev->mirrorRecon] < testsize )
1437 {
1438 DEB (printk ("\npci2220i: sub 2 %ld %ld", pdev->lastsectorlba[pdev->mirrorRecon], testsize));
1439 break;
1440 }
1441
1442 // test LBA and multiper sector transfer compatibility
1443 if (!pid->SupportLBA || (pid->NumSectorsPerInt < SECTORSXFER) || !pid->Valid_64_70 )
1444 {
1445 DEB (printk ("\npci2220i: sub 3"));
1446 break;
1447 }
1448
1449 // test PIO/bus matering mode compatibility
1450 if ( (pid->MinPIOCycleWithoutFlow > 240) && !pid->SupportIORDYDisable && !padapter->timingPIO )
1451 {
1452 DEB (printk ("\npci2220i: sub 4"));
1453 break;
1454 }
1455
1456 if ( pid->MinPIOCycleWithoutFlow <= 120 ) // setup timing mode of drive
1457 minmode = 5;
1458 else
1459 {
1460 if ( pid->MinPIOCylceWithFlow <= 150 )
1461 minmode = 4;
1462 else
1463 {
1464 if ( pid->MinPIOCylceWithFlow <= 180 )
1465 minmode = 3;
1466 else
1467 {
1468 if ( pid->MinPIOCylceWithFlow <= 240 )
1469 minmode = 2;
1470 else
1471 {
1472 DEB (printk ("\npci2220i: sub 5"));
1473 break;
1474 }
1475 }
1476 }
1477 }
1478
1479 if ( padapter->timingMode > minmode ) // set minimum timing mode
1480 padapter->timingMode = minmode;
1481 if ( padapter->timingMode >= 2 )
1482 padapter->timingAddress = ModeArray[padapter->timingMode - 2];
1483 else
1484 padapter->timingPIO = TRUE;
1485
1486 padapter->reconOn = TRUE;
1487 break;
1488 }
1489
1490 if ( !pdev->reconOn )
1491 {
1492 padapter->survivor = pdev->mirrorRecon ^ 1;
1493 padapter->reconPhase = RECON_PHASE_FAILOVER;
1494 DEB (printk ("\npci2220i: FAILURE 7"));
1495 InitFailover (padapter, pdev);
1496 goto reconTimerExpiry;
1497 }
1498
1499 pdev->raid = TRUE;
1500
1501 if ( WriteSignature (padapter, pdev, pdev->spigot, pdev->mirrorRecon ^ 1) )
1502 goto reconTimerExpiry;
1503 padapter->reconPhase = RECON_PHASE_MARKING;
1504 goto reconTimerExpiry;
1505 }
1506
1507 //**********************************
1508 // reconstruct copy starts here
1509 //**********************************
1510 if ( pdev->reconCount++ > 2000 )
1511 {
1512 pdev->reconCount = 0;
1513 if ( WriteSignature (padapter, pdev, pdev->spigots[pdev->mirrorRecon], pdev->mirrorRecon) )
1514 {
1515 padapter->survivor = pdev->mirrorRecon ^ 1;
1516 padapter->reconPhase = RECON_PHASE_FAILOVER;
1517 DEB (printk ("\npci2220i: FAILURE 8"));
1518 InitFailover (padapter, pdev);
1519 goto reconTimerExpiry;
1520 }
1521 padapter->reconPhase = RECON_PHASE_UPDATE;
1522 goto reconTimerExpiry;
1523 }
1524
1525 zl = pdev->DiskMirror[pdev->mirrorRecon].reconstructPoint;
1526 padapter->reconSize = pdev->DiskMirror[pdev->mirrorRecon ^ 1].reconstructPoint - zl;
1527 if ( padapter->reconSize > MAX_BUS_MASTER_BLOCKS )
1528 padapter->reconSize = MAX_BUS_MASTER_BLOCKS;
1529
1530 if ( padapter->reconSize )
1531 {
1532 SelectSpigot (padapter, pdev->spigots[0] | pdev->spigots[1]); // select the spigots
1533 outb_p (pdev->byte6 | ((UCHAR *)(&zl))[3], padapter->regLba24); // select the drive
1534 SelectSpigot (padapter, pdev->spigot);
1535 if ( WaitReady (padapter) )
1536 goto reconTimerExpiry;
1537
1538 SelectSpigot (padapter, pdev->spigots[pdev->mirrorRecon]);
1539 if ( WaitReady (padapter) )
1540 {
1541 padapter->survivor = pdev->mirrorRecon ^ 1;
1542 padapter->reconPhase = RECON_PHASE_FAILOVER;
1543 DEB (printk ("\npci2220i: FAILURE 9"));
1544 InitFailover (padapter, pdev);
1545 goto reconTimerExpiry;
1546 }
1547
1548 SelectSpigot (padapter, pdev->spigots[0] | pdev->spigots[1]);
1549 outb_p (padapter->reconSize & 0xFF, padapter->regSectCount);
1550 outb_p (((UCHAR *)(&zl))[0], padapter->regLba0);
1551 outb_p (((UCHAR *)(&zl))[1], padapter->regLba8);
1552 outb_p (((UCHAR *)(&zl))[2], padapter->regLba16);
1553 padapter->expectingIRQ = TRUE;
1554 padapter->reconPhase = RECON_PHASE_READY;
1555 SelectSpigot (padapter, pdev->spigots[pdev->mirrorRecon]);
1556 WriteCommand (padapter, WRITE_CMD);
1557 StartTimer (padapter);
1558 SelectSpigot (padapter, pdev->spigot);
1559 WriteCommand (padapter, READ_CMD);
1560 goto reconTimerExpiry;
1561 }
1562
1563 pdev->DiskMirror[pdev->mirrorRecon].status = UCBF_MIRRORED | UCBF_MATCHED;
1564 pdev->DiskMirror[pdev->mirrorRecon ^ 1].status = UCBF_MIRRORED | UCBF_MATCHED;
1565 if ( WriteSignature (padapter, pdev, pdev->spigot, pdev->mirrorRecon ^ 1) )
1566 goto reconTimerExpiry;
1567 padapter->reconPhase = RECON_PHASE_LAST;
1568
1569reconTimerExpiry:;
1570 /*
1571 * Release the I/O spinlock and restore the original flags
1572 * which will enable interrupts if and only if they were
1573 * enabled on entry.
1574 */
1575 spin_unlock_irqrestore(host->host_lock, flags);
1576 }
1577/****************************************************************
1578 * Name: Irq_Handler :LOCAL
1579 *
1580 * Description: Interrupt handler.
1581 *
1582 * Parameters: irq - Hardware IRQ number.
1583 * dev_id -
1584 * regs -
1585 *
1586 * Returns: TRUE if drive is not ready in time.
1587 *
1588 ****************************************************************/
1589static irqreturn_t Irq_Handler (int irq, void *dev_id, struct pt_regs *regs)
1590 {
1591 struct Scsi_Host *shost = NULL; // Pointer to host data block
1592 PADAPTER2220I padapter; // Pointer to adapter control structure
1593 POUR_DEVICE pdev;
1594 Scsi_Cmnd *SCpnt;
1595 UCHAR status;
1596 UCHAR status1;
1597 ATAPI_STATUS statusa;
1598 ATAPI_REASON reasona;
1599 ATAPI_ERROR errora;
1600 int z;
1601 ULONG zl;
1602 unsigned long flags;
1603 int handled = 0;
1604
1605// DEB (printk ("\npci2220i received interrupt\n"));
1606
1607 for ( z = 0; z < NumAdapters; z++ ) // scan for interrupt to process
1608 {
1609 if ( PsiHost[z]->irq == (UCHAR)(irq & 0xFF) )
1610 {
1611 if ( inw_p (HOSTDATA(PsiHost[z])->regIrqControl) & 0x8000 )
1612 {
1613 shost = PsiHost[z];
1614 break;
1615 }
1616 }
1617 }
1618
1619 if ( !shost )
1620 {
1621 DEB (printk ("\npci2220i: not my interrupt"));
1622 goto out;
1623 }
1624
1625 handled = 1;
1626 spin_lock_irqsave(shost->host_lock, flags);
1627 padapter = HOSTDATA(shost);
1628 pdev = padapter->pdev;
1629 SCpnt = padapter->SCpnt;
1630 outb_p (0x08, padapter->regDmaCmdStat); // cancel interrupt from DMA engine
1631
1632 if ( padapter->atapi && SCpnt )
1633 {
1634 *(char *)&statusa = inb_p (padapter->regStatCmd); // read the device status
1635 *(char *)&reasona = inb_p (padapter->regSectCount); // read the device interrupt reason
1636
1637 if ( !statusa.bsy )
1638 {
1639 if ( statusa.drq ) // test for transfer phase
1640 {
1641 if ( !reasona.cod ) // test for data phase
1642 {
1643 z = (ULONG)inb_p (padapter->regLba8) | (ULONG)(inb_p (padapter->regLba16) << 8);
1644 if ( padapter->reqSense )
1645 insw (padapter->regData, SCpnt->sense_buffer, z / 2);
1646 else
1647 AtapiBusMaster (padapter, reasona.io, z);
1648 goto irq_return;
1649 }
1650 if ( reasona.cod && !reasona.io ) // test for command packet phase
1651 {
1652 if ( padapter->reqSense )
1653 AtapiRequestSense (padapter, pdev, SCpnt, TRUE);
1654 else
1655 AtapiSendCdb (padapter, pdev, padapter->atapiCdb);
1656 goto irq_return;
1657 }
1658 }
1659 else
1660 {
1661 if ( reasona.io && statusa.drdy ) // test for status phase
1662 {
1663 Atapi2Scsi (padapter, SCpnt);
1664 if ( statusa.check )
1665 {
1666 *(UCHAR *)&errora = inb_p (padapter->regError); // read the device error
1667 if ( errora.senseKey )
1668 {
1669 if ( padapter->reqSense || AtapiRequestSense (padapter, pdev, SCpnt, FALSE) )
1670 OpDone (padapter, DID_ERROR << 16);
1671 }
1672 else
1673 {
1674 if ( errora.ili || errora.abort )
1675 OpDone (padapter, DID_ERROR << 16);
1676 else
1677 OpDone (padapter, DID_OK << 16);
1678 }
1679 }
1680 else
1681 if ( padapter->reqSense )
1682 {
1683 DEB (printk ("PCI2242I: Sense codes - %X %X %X ", ((UCHAR *)SCpnt->sense_buffer)[0], ((UCHAR *)SCpnt->sense_buffer)[12], ((UCHAR *)SCpnt->sense_buffer)[13]));
1684 OpDone (padapter, (DRIVER_SENSE << 24) | (DID_OK << 16) | 2);
1685 }
1686 else
1687 OpDone (padapter, DID_OK << 16);
1688 }
1689 }
1690 }
1691 goto irq_return;
1692 }
1693
1694 if ( !padapter->expectingIRQ || !(SCpnt || padapter->reconPhase) )
1695 {
1696 DEB(printk ("\npci2220i Unsolicited interrupt\n"));
1697 STOP_HERE ();
1698 goto irq_return;
1699 }
1700 padapter->expectingIRQ = 0;
1701
1702 if ( padapter->failinprog )
1703 {
1704 DEB (printk ("\npci2220i interrupt failover complete"));
1705 padapter->failinprog = FALSE;
1706 status = inb_p (padapter->regStatCmd); // read the device status
1707 if ( status & (IDE_STATUS_ERROR | IDE_STATUS_WRITE_FAULT) )
1708 {
1709 DEB (printk ("\npci2220i: interrupt failover error from drive %X", status));
1710 padapter->cmd = 0;
1711 }
1712 else
1713 {
1714 DEB (printk ("\npci2220i: restarting failed opertation."));
1715 pdev->spigot = (padapter->survivor) ? pdev->spigots[1] : pdev->spigots[0];
1716 del_timer (&padapter->timer);
1717 if ( padapter->reconPhase )
1718 OpDone (padapter, DID_OK << 16);
1719 else
1720 Pci2220i_QueueCommand (SCpnt, SCpnt->scsi_done);
1721 goto irq_return;
1722 }
1723 }
1724
1725 if ( padapter->reconPhase )
1726 {
1727 switch ( padapter->reconPhase )
1728 {
1729 case RECON_PHASE_MARKING:
1730 case RECON_PHASE_LAST:
1731 status = inb_p (padapter->regStatCmd); // read the device status
1732 del_timer (&padapter->timer);
1733 if ( padapter->reconPhase == RECON_PHASE_LAST )
1734 {
1735 if ( status & (IDE_STATUS_ERROR | IDE_STATUS_WRITE_FAULT) )
1736 {
1737 padapter->survivor = ( pdev->spigot == pdev->spigots[0] ) ? 1 : 0;
1738 DEB (printk ("\npci2220i: FAILURE 10"));
1739 if ( InitFailover (padapter, pdev) )
1740 OpDone (padapter, DecodeError (padapter, status));
1741 goto irq_return;
1742 }
1743 if ( WriteSignature (padapter, pdev, pdev->spigots[pdev->mirrorRecon], pdev->mirrorRecon) )
1744 {
1745 padapter->survivor = ( pdev->spigot == pdev->spigots[0] ) ? 0 : 1;
1746 DEB (printk ("\npci2220i: FAILURE 11"));
1747 if ( InitFailover (padapter, pdev) )
1748 OpDone (padapter, DecodeError (padapter, status));
1749 goto irq_return;
1750 }
1751 padapter->reconPhase = RECON_PHASE_END;
1752 goto irq_return;
1753 }
1754 OpDone (padapter, DID_OK << 16);
1755 goto irq_return;
1756
1757 case RECON_PHASE_READY:
1758 status = inb_p (padapter->regStatCmd); // read the device status
1759 if ( status & (IDE_STATUS_ERROR | IDE_STATUS_WRITE_FAULT) )
1760 {
1761 del_timer (&padapter->timer);
1762 OpDone (padapter, DecodeError (padapter, status));
1763 goto irq_return;
1764 }
1765 SelectSpigot (padapter, pdev->spigots[pdev->mirrorRecon]);
1766 if ( WaitDrq (padapter) )
1767 {
1768 del_timer (&padapter->timer);
1769 padapter->survivor = ( pdev->spigot == pdev->spigots[0] ) ? 0 : 1;
1770 DEB (printk ("\npci2220i: FAILURE 12"));
1771 if ( InitFailover (padapter, pdev) )
1772 OpDone (padapter, DecodeError (padapter, status));
1773 goto irq_return;
1774 }
1775 SelectSpigot (padapter, pdev->spigot | SEL_COPY | padapter->bigD);
1776 padapter->reconPhase = RECON_PHASE_COPY;
1777 padapter->expectingIRQ = TRUE;
1778 if ( padapter->timingPIO )
1779 {
1780 insw (padapter->regData, padapter->kBuffer, padapter->reconSize * (BYTES_PER_SECTOR / 2));
1781 }
1782 else
1783 {
1784 if ( (padapter->timingMode > 3) )
1785 {
1786 if ( padapter->bigD )
1787 outl (BIGD_DATA_MODE3, padapter->regDmaAddrLoc);
1788 else
1789 outl (DALE_DATA_MODE3, padapter->regDmaAddrLoc);
1790 }
1791 else
1792 outl (padapter->timingAddress, padapter->regDmaAddrLoc);
1793 outl (padapter->kBufferDma, padapter->regDmaAddrPci);
1794 outl (padapter->reconSize * BYTES_PER_SECTOR, padapter->regDmaCount);
1795 outb_p (8, padapter->regDmaDesc); // read operation
1796 if ( padapter->bigD )
1797 outb_p (8, padapter->regDmaMode); // no interrupt
1798 else
1799 outb_p (1, padapter->regDmaMode); // no interrupt
1800 outb_p (0x03, padapter->regDmaCmdStat); // kick the DMA engine in gear
1801 }
1802 goto irq_return;
1803
1804 case RECON_PHASE_COPY:
1805 pdev->DiskMirror[pdev->mirrorRecon].reconstructPoint += padapter->reconSize;
1806
1807 case RECON_PHASE_UPDATE:
1808 SelectSpigot (padapter, pdev->spigots[pdev->mirrorRecon] | SEL_IRQ_OFF);
1809 status = inb_p (padapter->regStatCmd); // read the device status
1810 del_timer (&padapter->timer);
1811 if ( status & (IDE_STATUS_ERROR | IDE_STATUS_WRITE_FAULT) )
1812 {
1813 padapter->survivor = ( pdev->spigot == pdev->spigots[0] ) ? 0 : 1;
1814 DEB (printk ("\npci2220i: FAILURE 13"));
1815 DEB (printk ("\n status register = %X error = %X", status, inb_p (padapter->regError)));
1816 if ( InitFailover (padapter, pdev) )
1817 OpDone (padapter, DecodeError (padapter, status));
1818 goto irq_return;
1819 }
1820 OpDone (padapter, DID_OK << 16);
1821 goto irq_return;
1822
1823 case RECON_PHASE_END:
1824 status = inb_p (padapter->regStatCmd); // read the device status
1825 del_timer (&padapter->timer);
1826 if ( status & (IDE_STATUS_ERROR | IDE_STATUS_WRITE_FAULT) )
1827 {
1828 padapter->survivor = ( pdev->spigot == pdev->spigots[0] ) ? 0 : 1;
1829 DEB (printk ("\npci2220i: FAILURE 14"));
1830 if ( InitFailover (padapter, pdev) )
1831 OpDone (padapter, DecodeError (padapter, status));
1832 goto irq_return;
1833 }
1834 pdev->reconOn = 0;
1835 if ( padapter->bigD )
1836 {
1837 for ( z = 0; z < padapter->numberOfDrives; z++ )
1838 {
1839 if ( padapter->device[z].DiskMirror[0].status & UCBF_SURVIVOR )
1840 {
1841 Alarm (padapter, padapter->device[z].deviceID[0] ^ 2);
1842 MuteAlarm (padapter);
1843 }
1844 if ( padapter->device[z].DiskMirror[1].status & UCBF_SURVIVOR )
1845 {
1846 Alarm (padapter, padapter->device[z].deviceID[1] ^ 2);
1847 MuteAlarm (padapter);
1848 }
1849 }
1850 }
1851 OpDone (padapter, DID_OK << 16);
1852 goto irq_return;
1853
1854 default:
1855 goto irq_return;
1856 }
1857 }
1858
1859 switch ( padapter->cmd ) // decide how to handle the interrupt
1860 {
1861 case READ_CMD:
1862 if ( padapter->sectorCount )
1863 {
1864 status = inb_p (padapter->regStatCmd); // read the device status
1865 if ( status & (IDE_STATUS_ERROR | IDE_STATUS_WRITE_FAULT) )
1866 {
1867 if ( pdev->raid )
1868 {
1869 padapter->survivor = ( pdev->spigot == pdev->spigots[0] ) ? 1 : 0;
1870 del_timer (&padapter->timer);
1871 DEB (printk ("\npci2220i: FAILURE 15"));
1872 if ( !InitFailover (padapter, pdev) )
1873 goto irq_return;
1874 }
1875 break;
1876 }
1877 if ( padapter->timingPIO )
1878 {
1879 insw (padapter->regData, padapter->kBuffer, padapter->readCount / 2);
1880 padapter->sectorCount -= padapter->readCount / BYTES_PER_SECTOR;
1881 WalkScatGath (padapter, TRUE, padapter->readCount);
1882 if ( !padapter->sectorCount )
1883 {
1884 status = 0;
1885 break;
1886 }
1887 }
1888 else
1889 {
1890 if ( padapter->readCount )
1891 WalkScatGath (padapter, TRUE, padapter->readCount);
1892 BusMaster (padapter, 1, 1);
1893 }
1894 padapter->expectingIRQ = TRUE;
1895 goto irq_return;
1896 }
1897 if ( padapter->readCount && !padapter->timingPIO )
1898 WalkScatGath (padapter, TRUE, padapter->readCount);
1899 status = 0;
1900 break;
1901
1902 case WRITE_CMD:
1903 if ( pdev->raid )
1904 {
1905 SelectSpigot (padapter, pdev->spigots[0] | SEL_IRQ_OFF);
1906 status = inb_p (padapter->regStatCmd); // read the device status
1907 SelectSpigot (padapter, pdev->spigots[1] | SEL_IRQ_OFF);
1908 status1 = inb_p (padapter->regStatCmd); // read the device status
1909 }
1910 else
1911 SelectSpigot (padapter, pdev->spigot | SEL_IRQ_OFF);
1912 status = inb_p (padapter->regStatCmd); // read the device status
1913 status1 = 0;
1914
1915 if ( status & (IDE_STATUS_ERROR | IDE_STATUS_WRITE_FAULT) )
1916 {
1917 if ( pdev->raid && !(status1 & (IDE_STATUS_ERROR | IDE_STATUS_WRITE_FAULT)) )
1918 {
1919 padapter->survivor = 1;
1920 del_timer (&padapter->timer);
1921 SelectSpigot (padapter, pdev->spigot | SEL_IRQ_OFF);
1922 DEB (printk ("\npci2220i: FAILURE 16 status = %X error = %X", status, inb_p (padapter->regError)));
1923 if ( !InitFailover (padapter, pdev) )
1924 goto irq_return;
1925 }
1926 break;
1927 }
1928 if ( pdev->raid )
1929 {
1930 if ( status1 & (IDE_STATUS_ERROR | IDE_STATUS_WRITE_FAULT) )
1931 {
1932 padapter->survivor = 0;
1933 del_timer (&padapter->timer);
1934 DEB (printk ("\npci2220i: FAILURE 17 status = %X error = %X", status1, inb_p (padapter->regError)));
1935 if ( !InitFailover (padapter, pdev) )
1936 goto irq_return;
1937 status = status1;
1938 break;
1939 }
1940 if ( padapter->sectorCount )
1941 {
1942 status = WriteDataBoth (padapter, pdev);
1943 if ( status )
1944 {
1945 padapter->survivor = status >> 1;
1946 del_timer (&padapter->timer);
1947 DEB (printk ("\npci2220i: FAILURE 18"));
1948 if ( !InitFailover (padapter, pdev) )
1949 goto irq_return;
1950 SelectSpigot (padapter, pdev->spigots[status] | SEL_IRQ_OFF);
1951 status = inb_p (padapter->regStatCmd); // read the device status
1952 break;
1953 }
1954 padapter->expectingIRQ = TRUE;
1955 goto irq_return;
1956 }
1957 status = 0;
1958 break;
1959 }
1960 if ( padapter->sectorCount )
1961 {
1962 SelectSpigot (padapter, pdev->spigot | padapter->bigD);
1963 status = WriteData (padapter);
1964 if ( status )
1965 break;
1966 padapter->expectingIRQ = TRUE;
1967 goto irq_return;
1968 }
1969 status = 0;
1970 break;
1971
1972 case IDE_COMMAND_IDENTIFY:
1973 {
1974 PINQUIRYDATA pinquiryData = SCpnt->request_buffer;
1975 PIDENTIFY_DATA pid = (PIDENTIFY_DATA)padapter->kBuffer;
1976
1977 status = inb_p (padapter->regStatCmd);
1978 if ( status & IDE_STATUS_DRQ )
1979 {
1980 insw (padapter->regData, pid, sizeof (IDENTIFY_DATA) >> 1);
1981
1982 memset (pinquiryData, 0, SCpnt->request_bufflen); // Zero INQUIRY data structure.
1983 pinquiryData->DeviceType = 0;
1984 pinquiryData->Versions = 2;
1985 pinquiryData->AdditionalLength = 35 - 4;
1986
1987 // Fill in vendor identification fields.
1988 for ( z = 0; z < 20; z += 2 )
1989 {
1990 pinquiryData->VendorId[z] = ((UCHAR *)pid->ModelNumber)[z + 1];
1991 pinquiryData->VendorId[z + 1] = ((UCHAR *)pid->ModelNumber)[z];
1992 }
1993
1994 // Initialize unused portion of product id.
1995 for ( z = 0; z < 4; z++ )
1996 pinquiryData->ProductId[12 + z] = ' ';
1997
1998 // Move firmware revision from IDENTIFY data to
1999 // product revision in INQUIRY data.
2000 for ( z = 0; z < 4; z += 2 )
2001 {
2002 pinquiryData->ProductRevisionLevel[z] = ((UCHAR *)pid->FirmwareRevision)[z + 1];
2003 pinquiryData->ProductRevisionLevel[z + 1] = ((UCHAR *)pid->FirmwareRevision)[z];
2004 }
2005 if ( pdev == padapter->device )
2006 *((USHORT *)(&pinquiryData->VendorSpecific)) = DEVICE_DALE_1;
2007
2008 status = 0;
2009 }
2010 break;
2011 }
2012
2013 default:
2014 status = 0;
2015 break;
2016 }
2017
2018 del_timer (&padapter->timer);
2019 if ( status )
2020 {
2021 DEB (printk ("\npci2220i Interrupt handler return error"));
2022 zl = DecodeError (padapter, status);
2023 }
2024 else
2025 zl = DID_OK << 16;
2026
2027 OpDone (padapter, zl);
2028irq_return:
2029 spin_unlock_irqrestore(shost->host_lock, flags);
2030out:
2031 return IRQ_RETVAL(handled);
2032}
2033
2034/****************************************************************
2035 * Name: Pci2220i_QueueCommand
2036 *
2037 * Description: Process a queued command from the SCSI manager.
2038 *
2039 * Parameters: SCpnt - Pointer to SCSI command structure.
2040 * done - Pointer to done function to call.
2041 *
2042 * Returns: Status code.
2043 *
2044 ****************************************************************/
2045int Pci2220i_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
2046 {
2047 UCHAR *cdb = (UCHAR *)SCpnt->cmnd; // Pointer to SCSI CDB
2048 PADAPTER2220I padapter = HOSTDATA(SCpnt->device->host); // Pointer to adapter control structure
2049 POUR_DEVICE pdev = &padapter->device[SCpnt->device->id];// Pointer to device information
2050 UCHAR rc; // command return code
2051 int z;
2052 PDEVICE_RAID1 pdr;
2053
2054 SCpnt->scsi_done = done;
2055 padapter->SCpnt = SCpnt; // Save this command data
2056 padapter->readCount = 0;
2057
2058 if ( SCpnt->use_sg )
2059 {
2060 padapter->currentSgBuffer = ((struct scatterlist *)SCpnt->request_buffer)[0].address;
2061 padapter->currentSgCount = ((struct scatterlist *)SCpnt->request_buffer)[0].length;
2062 }
2063 else
2064 {
2065 padapter->currentSgBuffer = SCpnt->request_buffer;
2066 padapter->currentSgCount = SCpnt->request_bufflen;
2067 }
2068 padapter->nextSg = 1;
2069
2070 if ( !done )
2071 {
2072 printk("pci2220i_queuecommand: %02X: done can't be NULL\n", *cdb);
2073 return 0;
2074 }
2075
2076 if ( padapter->atapi )
2077 {
2078 UCHAR zlo, zhi;
2079
2080 DEB (printk ("\nPCI2242I: ID %d, LUN %d opcode %X ", SCpnt->device->id, SCpnt->device->lun, *cdb));
2081 padapter->pdev = pdev;
2082 if ( !pdev->byte6 || SCpnt->device->lun )
2083 {
2084 OpDone (padapter, DID_BAD_TARGET << 16);
2085 return 0;
2086 }
2087
2088 padapter->atapiSpecial = FALSE;
2089 padapter->reqSense = FALSE;
2090 memset (padapter->atapiCdb, 0, 16);
2091 SelectSpigot (padapter, pdev->spigot); // select the spigot
2092 AtapiDevice (padapter, pdev->byte6); // select the drive
2093 if ( AtapiWaitReady (padapter, 100) )
2094 {
2095 OpDone (padapter, DID_NO_CONNECT << 16);
2096 return 0;
2097 }
2098
2099 switch ( cdb[0] )
2100 {
2101 case SCSIOP_MODE_SENSE:
2102 case SCSIOP_MODE_SELECT:
2103 Scsi2Atapi (padapter, SCpnt);
2104 z = SCpnt->request_bufflen + 4;
2105 break;
2106 case SCSIOP_READ6:
2107 case SCSIOP_WRITE6:
2108 Scsi2Atapi (padapter, SCpnt);
2109 z = SCpnt->request_bufflen;
2110 break;
2111 default:
2112 memcpy (padapter->atapiCdb, cdb, SCpnt->cmd_len);
2113 z = SCpnt->request_bufflen;
2114 break;
2115 }
2116 if ( z > ATAPI_TRANSFER )
2117 z = ATAPI_TRANSFER;
2118 zlo = (UCHAR)(z & 0xFF);
2119 zhi = (UCHAR)(z >> 8);
2120
2121 AtapiCountLo (padapter, zlo);
2122 AtapiCountHi (padapter, zhi);
2123 outb_p (0, padapter->regError);
2124 WriteCommand (padapter, IDE_COMMAND_ATAPI_PACKET);
2125 if ( pdev->cmdDrqInt )
2126 return 0;
2127
2128 if ( AtapiWaitDrq (padapter, 500) )
2129 {
2130 OpDone (padapter, DID_ERROR << 16);
2131 return 0;
2132 }
2133 AtapiSendCdb (padapter, pdev, padapter->atapiCdb);
2134 return 0;
2135 }
2136
2137 if ( padapter->reconPhase )
2138 return 0;
2139 if ( padapter->reconTimer.data )
2140 {
2141 del_timer (&padapter->reconTimer);
2142 padapter->reconTimer.data = 0;
2143 }
2144
2145 if ( (SCpnt->device->id >= padapter->numberOfDrives) || SCpnt->device->lun )
2146 {
2147 OpDone (padapter, DID_BAD_TARGET << 16);
2148 return 0;
2149 }
2150
2151 switch ( *cdb )
2152 {
2153 case SCSIOP_INQUIRY: // inquiry CDB
2154 {
2155 if ( cdb[2] == SC_MY_RAID )
2156 {
2157 switch ( cdb[3] )
2158 {
2159 case MY_SCSI_REBUILD:
2160 for ( z = 0; z < padapter->numberOfDrives; z++ )
2161 {
2162 pdev = &padapter->device[z];
2163 if ( ((pdev->DiskMirror[0].status & UCBF_SURVIVOR) && (pdev->DiskMirror[1].status & UCBF_MIRRORED)) ||
2164 ((pdev->DiskMirror[1].status & UCBF_SURVIVOR) && (pdev->DiskMirror[0].status & UCBF_MIRRORED)) )
2165 {
2166 padapter->reconOn = pdev->reconOn = pdev->reconIsStarting = TRUE;
2167 }
2168 }
2169 OpDone (padapter, DID_OK << 16);
2170 break;
2171 case MY_SCSI_ALARMMUTE:
2172 MuteAlarm (padapter);
2173 OpDone (padapter, DID_OK << 16);
2174 break;
2175 case MY_SCSI_DEMOFAIL:
2176 padapter->demoFail = TRUE;
2177 OpDone (padapter, DID_OK << 16);
2178 break;
2179 default:
2180 z = cdb[5]; // get index
2181 pdr = (PDEVICE_RAID1)SCpnt->request_buffer;
2182 if ( padapter->raidData[z] )
2183 {
2184 memcpy (&pdr->DiskRaid1, padapter->raidData[z], sizeof (DISK_MIRROR));
2185 if ( padapter->raidData[z]->reconstructPoint > padapter->raidData[z ^ 2]->reconstructPoint )
2186 pdr->TotalSectors = padapter->raidData[z]->reconstructPoint;
2187 else
2188 pdr->TotalSectors = padapter->raidData[z ^ 2]->reconstructPoint;
2189 }
2190 else
2191 memset (pdr, 0, sizeof (DEVICE_RAID1));
2192 OpDone (padapter, DID_OK << 16);
2193 break;
2194 }
2195 return 0;
2196 }
2197 padapter->cmd = IDE_COMMAND_IDENTIFY;
2198 break;
2199 }
2200
2201 case SCSIOP_TEST_UNIT_READY: // test unit ready CDB
2202 OpDone (padapter, DID_OK << 16);
2203 return 0;
2204 case SCSIOP_READ_CAPACITY: // read capctiy CDB
2205 {
2206 PREAD_CAPACITY_DATA pdata = (PREAD_CAPACITY_DATA)SCpnt->request_buffer;
2207
2208 pdata->blksiz = 0x20000;
2209 XANY2SCSI ((UCHAR *)&pdata->blks, pdev->blocks);
2210 OpDone (padapter, DID_OK << 16);
2211 return 0;
2212 }
2213 case SCSIOP_VERIFY: // verify CDB
2214 padapter->startSector = XSCSI2LONG (&cdb[2]);
2215 padapter->sectorCount = (UCHAR)((USHORT)cdb[8] | ((USHORT)cdb[7] << 8));
2216 padapter->cmd = IDE_COMMAND_VERIFY;
2217 break;
2218 case SCSIOP_READ: // read10 CDB
2219 padapter->startSector = XSCSI2LONG (&cdb[2]);
2220 padapter->sectorCount = (USHORT)cdb[8] | ((USHORT)cdb[7] << 8);
2221 padapter->cmd = READ_CMD;
2222 break;
2223 case SCSIOP_READ6: // read6 CDB
2224 padapter->startSector = SCSI2LONG (&cdb[1]);
2225 padapter->sectorCount = cdb[4];
2226 padapter->cmd = READ_CMD;
2227 break;
2228 case SCSIOP_WRITE: // write10 CDB
2229 padapter->startSector = XSCSI2LONG (&cdb[2]);
2230 padapter->sectorCount = (USHORT)cdb[8] | ((USHORT)cdb[7] << 8);
2231 padapter->cmd = WRITE_CMD;
2232 break;
2233 case SCSIOP_WRITE6: // write6 CDB
2234 padapter->startSector = SCSI2LONG (&cdb[1]);
2235 padapter->sectorCount = cdb[4];
2236 padapter->cmd = WRITE_CMD;
2237 break;
2238 default:
2239 DEB (printk ("pci2220i_queuecommand: Unsupported command %02X\n", *cdb));
2240 OpDone (padapter, DID_ERROR << 16);
2241 return 0;
2242 }
2243
2244 if ( padapter->reconPhase )
2245 return 0;
2246
2247 padapter->pdev = pdev;
2248
2249 while ( padapter->demoFail )
2250 {
2251 pdev = padapter->pdev = &padapter->device[0];
2252 padapter->demoFail = FALSE;
2253 if ( !pdev->raid ||
2254 (pdev->DiskMirror[0].status & UCBF_SURVIVOR) ||
2255 (pdev->DiskMirror[1].status & UCBF_SURVIVOR) )
2256 {
2257 break;
2258 }
2259 if ( pdev->DiskMirror[0].status & UCBF_REBUILD )
2260 padapter->survivor = 1;
2261 else
2262 padapter->survivor = 0;
2263 DEB (printk ("\npci2220i: FAILURE 19"));
2264 if ( InitFailover (padapter, pdev) )
2265 break;
2266 return 0;
2267 }
2268
2269 StartTimer (padapter);
2270 if ( pdev->raid && (padapter->cmd == WRITE_CMD) )
2271 {
2272 rc = IdeCmdBoth (padapter, pdev);
2273 if ( !rc )
2274 rc = WriteDataBoth (padapter, pdev);
2275 if ( rc )
2276 {
2277 del_timer (&padapter->timer);
2278 padapter->expectingIRQ = 0;
2279 padapter->survivor = rc >> 1;
2280 DEB (printk ("\npci2220i: FAILURE 20"));
2281 if ( InitFailover (padapter, pdev) )
2282 {
2283 OpDone (padapter, DID_ERROR << 16);
2284 return 0;
2285 }
2286 }
2287 }
2288 else
2289 {
2290 rc = IdeCmd (padapter, pdev);
2291 if ( (padapter->cmd == WRITE_CMD) && !rc )
2292 rc = WriteData (padapter);
2293 if ( rc )
2294 {
2295 del_timer (&padapter->timer);
2296 padapter->expectingIRQ = 0;
2297 if ( pdev->raid )
2298 {
2299 padapter->survivor = (pdev->spigot ^ 3) >> 1;
2300 DEB (printk ("\npci2220i: FAILURE 21"));
2301 if ( !InitFailover (padapter, pdev) )
2302 return 0;
2303 }
2304 OpDone (padapter, DID_ERROR << 16);
2305 return 0;
2306 }
2307 }
2308 return 0;
2309 }
2310/****************************************************************
2311 * Name: ReadFlash
2312 *
2313 * Description: Read information from controller Flash memory.
2314 *
2315 * Parameters: padapter - Pointer to host interface data structure.
2316 * pdata - Pointer to data structures.
2317 * base - base address in Flash.
2318 * length - lenght of data space in bytes.
2319 *
2320 * Returns: Nothing.
2321 *
2322 ****************************************************************/
2323static VOID ReadFlash (PADAPTER2220I padapter, VOID *pdata, ULONG base, ULONG length)
2324 {
2325 ULONG oldremap;
2326 UCHAR olddesc;
2327 ULONG z;
2328 UCHAR *pd = (UCHAR *)pdata;
2329
2330 oldremap = inl (padapter->regRemap); // save values to restore later
2331 olddesc = inb_p (padapter->regDesc);
2332
2333 outl (base | 1, padapter->regRemap); // remap to Flash space as specified
2334 outb_p (0x40, padapter->regDesc); // describe remap region as 8 bit
2335 for ( z = 0; z < length; z++) // get "length" data count
2336 *pd++ = inb_p (padapter->regBase + z); // read in the data
2337
2338 outl (oldremap, padapter->regRemap); // restore remap register values
2339 outb_p (olddesc, padapter->regDesc);
2340 }
2341/****************************************************************
2342 * Name: GetRegs
2343 *
2344 * Description: Initialize the regester information.
2345 *
2346 * Parameters: pshost - Pointer to SCSI host data structure.
2347 * bigd - PCI-2240I identifier
2348 * pcidev - Pointer to device data structure.
2349 *
2350 * Returns: TRUE if failure to install.
2351 *
2352 ****************************************************************/
2353static USHORT GetRegs (struct Scsi_Host *pshost, BOOL bigd, struct pci_dev *pcidev)
2354 {
2355 PADAPTER2220I padapter;
2356 int setirq;
2357 int z;
2358 USHORT zr, zl;
2359 UCHAR *consistent;
2360 dma_addr_t consistentDma;
2361
2362 padapter = HOSTDATA(pshost);
2363 memset (padapter, 0, sizeof (ADAPTER2220I));
2364 memset (&DaleSetup, 0, sizeof (DaleSetup));
2365 memset (DiskMirror, 0, sizeof (DiskMirror));
2366
2367 zr = pci_resource_start (pcidev, 1);
2368 zl = pci_resource_start (pcidev, 2);
2369
2370 padapter->basePort = zr;
2371 padapter->regRemap = zr + RTR_LOCAL_REMAP; // 32 bit local space remap
2372 padapter->regDesc = zr + RTR_REGIONS; // 32 bit local region descriptor
2373 padapter->regRange = zr + RTR_LOCAL_RANGE; // 32 bit local range
2374 padapter->regIrqControl = zr + RTR_INT_CONTROL_STATUS; // 16 bit interrupt control and status
2375 padapter->regScratchPad = zr + RTR_MAILBOX; // 16 byte scratchpad I/O base address
2376
2377 padapter->regBase = zl;
2378 padapter->regData = zl + REG_DATA; // data register I/O address
2379 padapter->regError = zl + REG_ERROR; // error register I/O address
2380 padapter->regSectCount = zl + REG_SECTOR_COUNT; // sector count register I/O address
2381 padapter->regLba0 = zl + REG_LBA_0; // least significant byte of LBA
2382 padapter->regLba8 = zl + REG_LBA_8; // next least significant byte of LBA
2383 padapter->regLba16 = zl + REG_LBA_16; // next most significan byte of LBA
2384 padapter->regLba24 = zl + REG_LBA_24; // head and most 4 significant bits of LBA
2385 padapter->regStatCmd = zl + REG_STAT_CMD; // status on read and command on write register
2386 padapter->regStatSel = zl + REG_STAT_SEL; // board status on read and spigot select on write register
2387 padapter->regFail = zl + REG_FAIL;
2388 padapter->regAltStat = zl + REG_ALT_STAT;
2389 padapter->pcidev = pcidev;
2390
2391 if ( bigd )
2392 {
2393 padapter->regDmaDesc = zr + RTR_DMA0_DESC_PTR; // address of the DMA discriptor register for direction of transfer
2394 padapter->regDmaCmdStat = zr + RTR_DMA_COMMAND_STATUS; // Byte #0 of DMA command status register
2395 padapter->regDmaAddrPci = zr + RTR_DMA0_PCI_ADDR; // 32 bit register for PCI address of DMA
2396 padapter->regDmaAddrLoc = zr + RTR_DMA0_LOCAL_ADDR; // 32 bit register for local bus address of DMA
2397 padapter->regDmaCount = zr + RTR_DMA0_COUNT; // 32 bit register for DMA transfer count
2398 padapter->regDmaMode = zr + RTR_DMA0_MODE + 1; // 32 bit register for DMA mode control
2399 padapter->bigD = SEL_NEW_SPEED_1; // set spigot speed control bit
2400 }
2401 else
2402 {
2403 padapter->regDmaDesc = zl + RTL_DMA1_DESC_PTR; // address of the DMA discriptor register for direction of transfer
2404 padapter->regDmaCmdStat = zl + RTL_DMA_COMMAND_STATUS + 1; // Byte #1 of DMA command status register
2405 padapter->regDmaAddrPci = zl + RTL_DMA1_PCI_ADDR; // 32 bit register for PCI address of DMA
2406 padapter->regDmaAddrLoc = zl + RTL_DMA1_LOCAL_ADDR; // 32 bit register for local bus address of DMA
2407 padapter->regDmaCount = zl + RTL_DMA1_COUNT; // 32 bit register for DMA transfer count
2408 padapter->regDmaMode = zl + RTL_DMA1_MODE + 1; // 32 bit register for DMA mode control
2409 }
2410
2411 padapter->numberOfDrives = inb_p (padapter->regScratchPad + BIGD_NUM_DRIVES);
2412 if ( !bigd && !padapter->numberOfDrives ) // if no devices on this board
2413 return TRUE;
2414
2415 pshost->irq = pcidev->irq;
2416 setirq = 1;
2417 for ( z = 0; z < Installed; z++ ) // scan for shared interrupts
2418 {
2419 if ( PsiHost[z]->irq == pshost->irq ) // if shared then, don't posses
2420 setirq = 0;
2421 }
2422 if ( setirq ) // if not shared, posses
2423 {
2424 if ( request_irq (pshost->irq, Irq_Handler, SA_SHIRQ, "pci2220i", padapter) < 0 )
2425 {
2426 if ( request_irq (pshost->irq, Irq_Handler, SA_INTERRUPT | SA_SHIRQ, "pci2220i", padapter) < 0 )
2427 {
2428 printk ("Unable to allocate IRQ for PCI-2220I controller.\n");
2429 return TRUE;
2430 }
2431 }
2432 padapter->irqOwned = pshost->irq; // set IRQ as owned
2433 }
2434
2435 if ( padapter->numberOfDrives )
2436 consistent = pci_alloc_consistent (pcidev, SECTORSXFER * BYTES_PER_SECTOR, &consistentDma);
2437 else
2438 consistent = pci_alloc_consistent (pcidev, ATAPI_TRANSFER, &consistentDma);
2439 if ( !consistent )
2440 {
2441 printk ("Unable to allocate DMA buffer for PCI-2220I controller.\n");
2442 free_irq (pshost->irq, padapter);
2443 return TRUE;
2444 }
2445 padapter->kBuffer = consistent;
2446 padapter->kBufferDma = consistentDma;
2447
2448 PsiHost[Installed] = pshost; // save SCSI_HOST pointer
2449 pshost->io_port = padapter->basePort;
2450 pshost->n_io_port = 0xFF;
2451 pshost->unique_id = padapter->regBase;
2452
2453 outb_p (0x01, padapter->regRange); // fix our range register because other drivers want to tromp on it
2454
2455 padapter->timingMode = inb_p (padapter->regScratchPad + DALE_TIMING_MODE);
2456 if ( padapter->timingMode >= 2 )
2457 {
2458 if ( bigd )
2459 padapter->timingAddress = ModeArray2[padapter->timingMode - 2];
2460 else
2461 padapter->timingAddress = ModeArray[padapter->timingMode - 2];
2462 }
2463 else
2464 padapter->timingPIO = TRUE;
2465
2466 ReadFlash (padapter, &DaleSetup, DALE_FLASH_SETUP, sizeof (SETUP));
2467 ReadFlash (padapter, &DiskMirror, DALE_FLASH_RAID, sizeof (DiskMirror));
2468
2469 return FALSE;
2470 }
2471/****************************************************************
2472 * Name: SetupFinish
2473 *
2474 * Description: Complete the driver initialization process for a card
2475 *
2476 * Parameters: padapter - Pointer to SCSI host data structure.
2477 * str - Pointer to board type string.
2478 *
2479 * Returns: Nothing.
2480 *
2481 ****************************************************************/
2482VOID SetupFinish (PADAPTER2220I padapter, char *str, int irq)
2483 {
2484 init_timer (&padapter->timer);
2485 padapter->timer.function = TimerExpiry;
2486 padapter->timer.data = (unsigned long)padapter;
2487 init_timer (&padapter->reconTimer);
2488 padapter->reconTimer.function = ReconTimerExpiry;
2489 padapter->reconTimer.data = (unsigned long)padapter;
2490 printk("\nPCI-%sI EIDE CONTROLLER: at I/O = %lX/%lX IRQ = %d\n", str, padapter->basePort, padapter->regBase, irq);
2491 printk("Version %s, Compiled %s %s\n\n", PCI2220I_VERSION, __DATE__, __TIME__);
2492 }
2493/****************************************************************
2494 * Name: Pci2220i_Detect
2495 *
2496 * Description: Detect and initialize our boards.
2497 *
2498 * Parameters: tpnt - Pointer to SCSI host template structure.
2499 *
2500 * Returns: Number of adapters installed.
2501 *
2502 ****************************************************************/
2503int Pci2220i_Detect (Scsi_Host_Template *tpnt)
2504 {
2505 struct Scsi_Host *pshost;
2506 PADAPTER2220I padapter;
2507 POUR_DEVICE pdev;
2508 int unit;
2509 int z;
2510 USHORT raidon;
2511 UCHAR spigot1, spigot2;
2512 UCHAR device;
2513 struct pci_dev *pcidev = NULL;
2514
2515 while ( (pcidev = pci_find_device (VENDOR_PSI, DEVICE_DALE_1, pcidev)) != NULL )
2516 {
2517 if (pci_enable_device(pcidev))
2518 continue;
2519 pshost = scsi_register (tpnt, sizeof(ADAPTER2220I));
2520 if(pshost==NULL)
2521 continue;
2522
2523 padapter = HOSTDATA(pshost);
2524
2525 if ( GetRegs (pshost, FALSE, pcidev) )
2526 goto unregister;
2527
2528 scsi_set_device(pshost, &pcidev->dev);
2529 pshost->max_id = padapter->numberOfDrives;
2530 for ( z = 0; z < padapter->numberOfDrives; z++ )
2531 {
2532 unit = inb_p (padapter->regScratchPad + DALE_CHANNEL_DEVICE_0 + z) & 0x0F;
2533 pdev = &padapter->device[z];
2534 pdev->byte6 = (UCHAR)(((unit & 1) << 4) | 0xE0);
2535 pdev->spigot = (UCHAR)(1 << (unit >> 1));
2536 pdev->sectors = DaleSetup.setupDevice[unit].sectors;
2537 pdev->heads = DaleSetup.setupDevice[unit].heads;
2538 pdev->cylinders = DaleSetup.setupDevice[unit].cylinders;
2539 pdev->blocks = DaleSetup.setupDevice[unit].blocks;
2540
2541 if ( !z )
2542 {
2543 DiskMirror[0].status = inb_p (padapter->regScratchPad + DALE_RAID_0_STATUS);
2544 DiskMirror[1].status = inb_p (padapter->regScratchPad + DALE_RAID_1_STATUS);
2545 if ( (DiskMirror[0].signature == SIGNATURE) && (DiskMirror[1].signature == SIGNATURE) &&
2546 (DiskMirror[0].pairIdentifier == (DiskMirror[1].pairIdentifier ^ 1)) )
2547 {
2548 raidon = TRUE;
2549 if ( unit > (unit ^ 2) )
2550 unit = unit ^ 2;
2551 }
2552 else
2553 raidon = FALSE;
2554
2555 memcpy (pdev->DiskMirror, DiskMirror, sizeof (DiskMirror));
2556 padapter->raidData[0] = &pdev->DiskMirror[0];
2557 padapter->raidData[2] = &pdev->DiskMirror[1];
2558
2559 spigot1 = spigot2 = FALSE;
2560 pdev->spigots[0] = 1;
2561 pdev->spigots[1] = 2;
2562 pdev->lastsectorlba[0] = InlineIdentify (padapter, 1, 0);
2563 pdev->lastsectorlba[1] = InlineIdentify (padapter, 2, 0);
2564
2565 if ( !(pdev->DiskMirror[1].status & UCBF_SURVIVOR) && pdev->lastsectorlba[0] )
2566 spigot1 = TRUE;
2567 if ( !(pdev->DiskMirror[0].status & UCBF_SURVIVOR) && pdev->lastsectorlba[1] )
2568 spigot2 = TRUE;
2569 if ( pdev->DiskMirror[0].status & DiskMirror[1].status & UCBF_SURVIVOR )
2570 spigot1 = TRUE;
2571
2572 if ( spigot1 && (pdev->DiskMirror[0].status & UCBF_REBUILD) )
2573 InlineReadSignature (padapter, pdev, 0);
2574 if ( spigot2 && (pdev->DiskMirror[1].status & UCBF_REBUILD) )
2575 InlineReadSignature (padapter, pdev, 1);
2576
2577 if ( spigot1 && spigot2 && raidon )
2578 {
2579 pdev->raid = 1;
2580 if ( pdev->DiskMirror[0].status & UCBF_REBUILD )
2581 pdev->spigot = 2;
2582 else
2583 pdev->spigot = 1;
2584 if ( (pdev->DiskMirror[0].status & UCBF_REBUILD) || (pdev->DiskMirror[1].status & UCBF_REBUILD) )
2585 padapter->reconOn = pdev->reconOn = pdev->reconIsStarting = TRUE;
2586 }
2587 else
2588 {
2589 if ( spigot1 )
2590 {
2591 if ( pdev->DiskMirror[0].status & UCBF_REBUILD )
2592 goto unregister;
2593 pdev->DiskMirror[0].status = UCBF_MIRRORED | UCBF_SURVIVOR;
2594 pdev->spigot = 1;
2595 }
2596 else
2597 {
2598 if ( pdev->DiskMirror[1].status & UCBF_REBUILD )
2599 goto unregister;
2600 pdev->DiskMirror[1].status = UCBF_MIRRORED | UCBF_SURVIVOR;
2601 pdev->spigot = 2;
2602 }
2603 if ( DaleSetup.rebootRebuild && raidon )
2604 padapter->reconOn = pdev->reconOn = pdev->reconIsStarting = TRUE;
2605 }
2606
2607 if ( raidon )
2608 break;
2609 }
2610 }
2611
2612 SetupFinish (padapter, "2220", pshost->irq);
2613
2614 if ( ++Installed < MAXADAPTER )
2615 continue;
2616 break;
2617unregister:;
2618 scsi_unregister (pshost);
2619 }
2620
2621 while ( (pcidev = pci_find_device (VENDOR_PSI, DEVICE_BIGD_1, pcidev)) != NULL )
2622 {
2623 pshost = scsi_register (tpnt, sizeof(ADAPTER2220I));
2624 padapter = HOSTDATA(pshost);
2625
2626 if ( GetRegs (pshost, TRUE, pcidev) )
2627 goto unregister1;
2628
2629 for ( z = 0; z < BIGD_MAXDRIVES; z++ )
2630 DiskMirror[z].status = inb_p (padapter->regScratchPad + BIGD_RAID_0_STATUS + z);
2631
2632 scsi_set_pci_device(pshost, pcidev);
2633 pshost->max_id = padapter->numberOfDrives;
2634 padapter->failRegister = inb_p (padapter->regScratchPad + BIGD_ALARM_IMAGE);
2635 for ( z = 0; z < padapter->numberOfDrives; z++ )
2636 {
2637 unit = inb_p (padapter->regScratchPad + BIGD_DEVICE_0 + z);
2638 pdev = &padapter->device[z];
2639 pdev->byte6 = (UCHAR)(((unit & 1) << 4) | 0xE0);
2640 pdev->spigot = (UCHAR)(1 << (unit >> 1));
2641 pdev->sectors = DaleSetup.setupDevice[unit].sectors;
2642 pdev->heads = DaleSetup.setupDevice[unit].heads;
2643 pdev->cylinders = DaleSetup.setupDevice[unit].cylinders;
2644 pdev->blocks = DaleSetup.setupDevice[unit].blocks;
2645
2646 if ( (DiskMirror[unit].signature == SIGNATURE) && (DiskMirror[unit ^ 2].signature == SIGNATURE) &&
2647 (DiskMirror[unit].pairIdentifier == (DiskMirror[unit ^ 2].pairIdentifier ^ 1)) )
2648 {
2649 raidon = TRUE;
2650 if ( unit > (unit ^ 2) )
2651 unit = unit ^ 2;
2652 }
2653 else
2654 raidon = FALSE;
2655
2656 spigot1 = spigot2 = FALSE;
2657 memcpy (&pdev->DiskMirror[0], &DiskMirror[unit], sizeof (DISK_MIRROR));
2658 memcpy (&pdev->DiskMirror[1], &DiskMirror[unit ^ 2], sizeof (DISK_MIRROR));
2659 padapter->raidData[unit] = &pdev->DiskMirror[0];
2660 padapter->raidData[unit ^ 2] = &pdev->DiskMirror[1];
2661 pdev->spigots[0] = 1 << (unit >> 1);
2662 pdev->spigots[1] = 1 << ((unit ^ 2) >> 1);
2663 pdev->deviceID[0] = unit;
2664 pdev->deviceID[1] = unit ^ 2;
2665 pdev->lastsectorlba[0] = InlineIdentify (padapter, pdev->spigots[0], unit & 1);
2666 pdev->lastsectorlba[1] = InlineIdentify (padapter, pdev->spigots[1], unit & 1);
2667
2668 if ( !(pdev->DiskMirror[1].status & UCBF_SURVIVOR) && pdev->lastsectorlba[0] )
2669 spigot1 = TRUE;
2670 if ( !(pdev->DiskMirror[0].status & UCBF_SURVIVOR) && pdev->lastsectorlba[1] )
2671 spigot2 = TRUE;
2672 if ( pdev->DiskMirror[0].status & pdev->DiskMirror[1].status & UCBF_SURVIVOR )
2673 spigot1 = TRUE;
2674
2675 if ( spigot1 && (pdev->DiskMirror[0].status & UCBF_REBUILD) )
2676 InlineReadSignature (padapter, pdev, 0);
2677 if ( spigot2 && (pdev->DiskMirror[1].status & UCBF_REBUILD) )
2678 InlineReadSignature (padapter, pdev, 1);
2679
2680 if ( spigot1 && spigot2 && raidon )
2681 {
2682 pdev->raid = 1;
2683 if ( pdev->DiskMirror[0].status & UCBF_REBUILD )
2684 pdev->spigot = pdev->spigots[1];
2685 else
2686 pdev->spigot = pdev->spigots[0];
2687 if ( (pdev->DiskMirror[0].status & UCBF_REBUILD) || (pdev->DiskMirror[1].status & UCBF_REBUILD) )
2688 padapter->reconOn = pdev->reconOn = pdev->reconIsStarting = TRUE;
2689 }
2690 else
2691 {
2692 if ( spigot1 )
2693 {
2694 if ( pdev->DiskMirror[0].status & UCBF_REBUILD )
2695 goto unregister1;
2696 pdev->DiskMirror[0].status = UCBF_MIRRORED | UCBF_SURVIVOR;
2697 pdev->spigot = pdev->spigots[0];
2698 }
2699 else
2700 {
2701 if ( pdev->DiskMirror[1].status & UCBF_REBUILD )
2702 goto unregister;
2703 pdev->DiskMirror[1].status = UCBF_MIRRORED | UCBF_SURVIVOR;
2704 pdev->spigot = pdev->spigots[1];
2705 }
2706 if ( DaleSetup.rebootRebuild && raidon )
2707 padapter->reconOn = pdev->reconOn = pdev->reconIsStarting = TRUE;
2708 }
2709 }
2710
2711 if ( !padapter->numberOfDrives ) // If no ATA devices then scan ATAPI
2712 {
2713 unit = 0;
2714 for ( spigot1 = 0; spigot1 < 4; spigot1++ )
2715 {
2716 for ( device = 0; device < 2; device++ )
2717 {
2718 DEB (printk ("\nPCI2242I: scanning for ID %d ", (spigot1 * 2) + device));
2719 pdev = &(padapter->device[(spigot1 * 2) + device]);
2720 pdev->byte6 = 0x0A | (device << 4);
2721 pdev->spigot = 1 << spigot1;
2722 if ( !AtapiReset (padapter, pdev) )
2723 {
2724 DEB (printk (" Device found "));
2725 if ( !AtapiIdentify (padapter, pdev) )
2726 {
2727 DEB (printk (" Device verified"));
2728 unit++;
2729 continue;
2730 }
2731 }
2732 pdev->spigot = pdev->byte6 = 0;
2733 }
2734 }
2735
2736 if ( unit )
2737 {
2738 padapter->atapi = TRUE;
2739 padapter->timingAddress = DALE_DATA_MODE3;
2740 outw_p (0x0900, padapter->regIrqControl); // Turn our interrupts on
2741 outw_p (0x0C41, padapter->regDmaMode - 1); // setup for 16 bits, ready enabled, done IRQ enabled, no incriment
2742 outb_p (0xFF, padapter->regFail); // all fail lights and alarm off
2743 pshost->max_id = 8;
2744 }
2745 }
2746 SetupFinish (padapter, "2240", pshost->irq);
2747
2748 if ( ++Installed < MAXADAPTER )
2749 continue;
2750 break;
2751unregister1:;
2752 scsi_unregister (pshost);
2753 }
2754
2755 NumAdapters = Installed;
2756 return Installed;
2757 }
2758/****************************************************************
2759 * Name: Pci2220i_Abort
2760 *
2761 * Description: Process the Abort command from the SCSI manager.
2762 *
2763 * Parameters: SCpnt - Pointer to SCSI command structure.
2764 *
2765 * Returns: Allways snooze.
2766 *
2767 ****************************************************************/
2768int Pci2220i_Abort (Scsi_Cmnd *SCpnt)
2769 {
2770 PADAPTER2220I padapter = HOSTDATA(SCpnt->device->host); // Pointer to adapter control structure
2771 POUR_DEVICE pdev = &padapter->device[SCpnt->device->id];// Pointer to device information
2772
2773 if ( !padapter->SCpnt )
2774 return SCSI_ABORT_NOT_RUNNING;
2775
2776 if ( padapter->atapi )
2777 {
2778 if ( AtapiReset (padapter, pdev) )
2779 return SCSI_ABORT_ERROR;
2780 OpDone (padapter, DID_ABORT << 16);
2781 return SCSI_ABORT_SUCCESS;
2782 }
2783 return SCSI_ABORT_SNOOZE;
2784 }
2785/****************************************************************
2786 * Name: Pci2220i_Reset
2787 *
2788 * Description: Process the Reset command from the SCSI manager.
2789 *
2790 * Parameters: SCpnt - Pointer to SCSI command structure.
2791 * flags - Flags about the reset command
2792 *
2793 * Returns: No active command at this time, so this means
2794 * that each time we got some kind of response the
2795 * last time through. Tell the mid-level code to
2796 * request sense information in order to decide what
2797 * to do next.
2798 *
2799 ****************************************************************/
2800int Pci2220i_Reset (Scsi_Cmnd *SCpnt, unsigned int reset_flags)
2801 {
2802 PADAPTER2220I padapter = HOSTDATA(SCpnt->device->host); // Pointer to adapter control structure
2803 POUR_DEVICE pdev = &padapter->device[SCpnt->device->id];// Pointer to device information
2804
2805 if ( padapter->atapi )
2806 {
2807 if ( AtapiReset (padapter, pdev) )
2808 return SCSI_RESET_ERROR;
2809 return SCSI_RESET_SUCCESS;
2810 }
2811 return SCSI_RESET_PUNT;
2812 }
2813/****************************************************************
2814 * Name: Pci2220i_Release
2815 *
2816 * Description: Release resources allocated for a single each adapter.
2817 *
2818 * Parameters: pshost - Pointer to SCSI command structure.
2819 *
2820 * Returns: zero.
2821 *
2822 ****************************************************************/
2823int Pci2220i_Release (struct Scsi_Host *pshost)
2824 {
2825 PADAPTER2220I padapter = HOSTDATA (pshost);
2826 USHORT z;
2827
2828 if ( padapter->reconOn )
2829 {
2830 padapter->reconOn = FALSE; // shut down the hot reconstruct
2831 if ( padapter->reconPhase )
2832 mdelay (300);
2833 if ( padapter->reconTimer.data ) // is the timer running?
2834 {
2835 del_timer (&padapter->reconTimer);
2836 padapter->reconTimer.data = 0;
2837 }
2838 }
2839
2840 // save RAID status on the board
2841 if ( padapter->bigD )
2842 {
2843 outb_p (padapter->failRegister, padapter->regScratchPad + BIGD_ALARM_IMAGE);
2844 for ( z = 0; z < BIGD_MAXDRIVES; z++ )
2845 {
2846 if ( padapter->raidData )
2847 outb_p (padapter->raidData[z]->status, padapter->regScratchPad + BIGD_RAID_0_STATUS + z);
2848 else
2849 outb_p (0, padapter->regScratchPad + BIGD_RAID_0_STATUS);
2850 }
2851 }
2852 else
2853 {
2854 outb_p (padapter->device[0].DiskMirror[0].status, padapter->regScratchPad + DALE_RAID_0_STATUS);
2855 outb_p (padapter->device[0].DiskMirror[1].status, padapter->regScratchPad + DALE_RAID_1_STATUS);
2856 }
2857
2858 if ( padapter->irqOwned )
2859 free_irq (pshost->irq, padapter);
2860 release_region (pshost->io_port, pshost->n_io_port);
2861 if ( padapter->numberOfDrives )
2862 pci_free_consistent (padapter->pcidev, SECTORSXFER * BYTES_PER_SECTOR, padapter->kBuffer, padapter->kBufferDma);
2863 else
2864 pci_free_consistent (padapter->pcidev, ATAPI_TRANSFER, padapter->kBuffer, padapter->kBufferDma);
2865 scsi_unregister(pshost);
2866 return 0;
2867 }
2868
2869/****************************************************************
2870 * Name: Pci2220i_BiosParam
2871 *
2872 * Description: Process the biosparam request from the SCSI manager to
2873 * return C/H/S data.
2874 *
2875 * Parameters: disk - Pointer to SCSI disk structure.
2876 * dev - Major/minor number from kernel.
2877 * geom - Pointer to integer array to place geometry data.
2878 *
2879 * Returns: zero.
2880 *
2881 ****************************************************************/
2882int Pci2220i_BiosParam (struct scsi_device *sdev, struct block_device *dev,
2883 sector_t capacity, int geom[])
2884 {
2885 POUR_DEVICE pdev;
2886
2887 if ( !(HOSTDATA(sdev->host))->atapi )
2888 {
2889 pdev = &(HOSTDATA(sdev->host)->device[sdev->id]);
2890
2891 geom[0] = pdev->heads;
2892 geom[1] = pdev->sectors;
2893 geom[2] = pdev->cylinders;
2894 }
2895 return 0;
2896 }
2897
2898MODULE_LICENSE("Dual BSD/GPL");
2899
2900static Scsi_Host_Template driver_template = {
2901 .proc_name = "pci2220i",
2902 .name = "PCI-2220I/PCI-2240I",
2903 .detect = Pci2220i_Detect,
2904 .release = Pci2220i_Release,
2905 .queuecommand = Pci2220i_QueueCommand,
2906 .abort = Pci2220i_Abort,
2907 .reset = Pci2220i_Reset,
2908 .bios_param = Pci2220i_BiosParam,
2909 .can_queue = 1,
2910 .this_id = -1,
2911 .sg_tablesize = SG_ALL,
2912 .cmd_per_lun = 1,
2913 .use_clustering = DISABLE_CLUSTERING,
2914};
2915#include "scsi_module.c"
diff --git a/drivers/scsi/pci2220i.h b/drivers/scsi/pci2220i.h
deleted file mode 100644
index 6926056c2aee..000000000000
--- a/drivers/scsi/pci2220i.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/****************************************************************************
2 * Perceptive Solutions, Inc. PCI-2220I device driver for Linux.
3 *
4 * pci2220i.h - Linux Host Driver for PCI-2220i EIDE Adapters
5 *
6 * Copyright (c) 1997-1999 Perceptive Solutions, Inc.
7 * All Rights Reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that redistributions of source
11 * code retain the above copyright notice and this comment without
12 * modification.
13 *
14 * Technical updates and product information at:
15 * http://www.psidisk.com
16 *
17 * Please send questions, comments, bug reports to:
18 * tech@psidisk.com Technical Support
19 *
20 ****************************************************************************/
21#ifndef _PCI2220I_H
22#define _PCI2220I_H
23
24#ifndef LINUX_VERSION_CODE
25#include <linux/version.h>
26#endif
27#define LINUXVERSION(v,p,s) (((v)<<16) + ((p)<<8) + (s))
28
29// function prototypes
30int Pci2220i_Detect (Scsi_Host_Template *tpnt);
31int Pci2220i_Command (Scsi_Cmnd *SCpnt);
32int Pci2220i_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *));
33int Pci2220i_Abort (Scsi_Cmnd *SCpnt);
34int Pci2220i_Reset (Scsi_Cmnd *SCpnt, unsigned int flags);
35int Pci2220i_Release (struct Scsi_Host *pshost);
36int Pci2220i_BiosParam (struct scsi_device *sdev,
37 struct block_device *dev,
38 sector_t capacity, int geom[]);
39#endif
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 496c412c8854..3dddb323e718 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -92,9 +92,7 @@ static Scsi_Host_Template nsp_driver_template = {
92#endif 92#endif
93 .info = nsp_info, 93 .info = nsp_info,
94 .queuecommand = nsp_queuecommand, 94 .queuecommand = nsp_queuecommand,
95/* .eh_strategy_handler = nsp_eh_strategy,*/
96/* .eh_abort_handler = nsp_eh_abort,*/ 95/* .eh_abort_handler = nsp_eh_abort,*/
97/* .eh_device_reset_handler = nsp_eh_device_reset,*/
98 .eh_bus_reset_handler = nsp_eh_bus_reset, 96 .eh_bus_reset_handler = nsp_eh_bus_reset,
99 .eh_host_reset_handler = nsp_eh_host_reset, 97 .eh_host_reset_handler = nsp_eh_host_reset,
100 .can_queue = 1, 98 .can_queue = 1,
@@ -1536,11 +1534,6 @@ nsp_proc_info(
1536/* error handler */ 1534/* error handler */
1537/*---------------------------------------------------------------*/ 1535/*---------------------------------------------------------------*/
1538 1536
1539/*static int nsp_eh_strategy(struct Scsi_Host *Shost)
1540{
1541 return FAILED;
1542}*/
1543
1544/* 1537/*
1545static int nsp_eh_abort(Scsi_Cmnd *SCpnt) 1538static int nsp_eh_abort(Scsi_Cmnd *SCpnt)
1546{ 1539{
@@ -1549,14 +1542,6 @@ static int nsp_eh_abort(Scsi_Cmnd *SCpnt)
1549 return nsp_eh_bus_reset(SCpnt); 1542 return nsp_eh_bus_reset(SCpnt);
1550}*/ 1543}*/
1551 1544
1552/*
1553static int nsp_eh_device_reset(Scsi_Cmnd *SCpnt)
1554{
1555 nsp_dbg(NSP_DEBUG_BUSRESET, "%s: SCpnt=0x%p", SCpnt);
1556
1557 return FAILED;
1558}*/
1559
1560static int nsp_bus_reset(nsp_hw_data *data) 1545static int nsp_bus_reset(nsp_hw_data *data)
1561{ 1546{
1562 unsigned int base = data->BaseAddress; 1547 unsigned int base = data->BaseAddress;
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 4766bcd63692..a0175f5d11cd 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -81,8 +81,6 @@ static Scsi_Host_Template qlogicfas_driver_template = {
81 .queuecommand = qlogicfas408_queuecommand, 81 .queuecommand = qlogicfas408_queuecommand,
82 .eh_abort_handler = qlogicfas408_abort, 82 .eh_abort_handler = qlogicfas408_abort,
83 .eh_bus_reset_handler = qlogicfas408_bus_reset, 83 .eh_bus_reset_handler = qlogicfas408_bus_reset,
84 .eh_device_reset_handler= qlogicfas408_device_reset,
85 .eh_host_reset_handler = qlogicfas408_host_reset,
86 .bios_param = qlogicfas408_biosparam, 84 .bios_param = qlogicfas408_biosparam,
87 .can_queue = 1, 85 .can_queue = 1,
88 .this_id = -1, 86 .this_id = -1,
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index 8457d0d7748a..1667da9508b4 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -627,7 +627,9 @@ SYM53C500_host_reset(struct scsi_cmnd *SCpnt)
627 int port_base = SCpnt->device->host->io_port; 627 int port_base = SCpnt->device->host->io_port;
628 628
629 DEB(printk("SYM53C500_host_reset called\n")); 629 DEB(printk("SYM53C500_host_reset called\n"));
630 spin_lock_irq(SCpnt->device->host->host_lock);
630 SYM53C500_int_host_reset(port_base); 631 SYM53C500_int_host_reset(port_base);
632 spin_unlock_irq(SCpnt->device->host->host_lock);
631 633
632 return SUCCESS; 634 return SUCCESS;
633} 635}
diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c
index c01b7191fcf5..623082d3a83f 100644
--- a/drivers/scsi/pluto.c
+++ b/drivers/scsi/pluto.c
@@ -354,7 +354,6 @@ static Scsi_Host_Template driver_template = {
354 .use_clustering = ENABLE_CLUSTERING, 354 .use_clustering = ENABLE_CLUSTERING,
355 .eh_abort_handler = fcp_scsi_abort, 355 .eh_abort_handler = fcp_scsi_abort,
356 .eh_device_reset_handler = fcp_scsi_dev_reset, 356 .eh_device_reset_handler = fcp_scsi_dev_reset,
357 .eh_bus_reset_handler = fcp_scsi_bus_reset,
358 .eh_host_reset_handler = fcp_scsi_host_reset, 357 .eh_host_reset_handler = fcp_scsi_host_reset,
359}; 358};
360 359
diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c
index 96b4522523d9..fafcf5d185e7 100644
--- a/drivers/scsi/ppa.c
+++ b/drivers/scsi/ppa.c
@@ -17,6 +17,7 @@
17#include <linux/blkdev.h> 17#include <linux/blkdev.h>
18#include <linux/parport.h> 18#include <linux/parport.h>
19#include <linux/workqueue.h> 19#include <linux/workqueue.h>
20#include <linux/delay.h>
20#include <asm/io.h> 21#include <asm/io.h>
21 22
22#include <scsi/scsi.h> 23#include <scsi/scsi.h>
@@ -891,9 +892,9 @@ static int ppa_reset(struct scsi_cmnd *cmd)
891 892
892 ppa_connect(dev, CONNECT_NORMAL); 893 ppa_connect(dev, CONNECT_NORMAL);
893 ppa_reset_pulse(dev->base); 894 ppa_reset_pulse(dev->base);
894 udelay(1000); /* device settle delay */ 895 mdelay(1); /* device settle delay */
895 ppa_disconnect(dev); 896 ppa_disconnect(dev);
896 udelay(1000); /* device settle delay */ 897 mdelay(1); /* device settle delay */
897 return SUCCESS; 898 return SUCCESS;
898} 899}
899 900
diff --git a/drivers/scsi/psi_dale.h b/drivers/scsi/psi_dale.h
deleted file mode 100644
index d672e3b01982..000000000000
--- a/drivers/scsi/psi_dale.h
+++ /dev/null
@@ -1,564 +0,0 @@
1/****************************************************************************
2 * Perceptive Solutions, Inc. PCI-2220I device driver for Linux.
3 *
4 * psi_dalei.h - Linux Host Driver for PCI-2220i EIDE Adapters
5 *
6 * Copyright (c) 1997-1999 Perceptive Solutions, Inc.
7 * All Rights Reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that redistributions of source
11 * code retain the above copyright notice and this comment without
12 * modification.
13 *
14 * Technical updates and product information at:
15 * http://www.psidisk.com
16 *
17 * Please send questions, comments, bug reports to:
18 * tech@psidisk.com Technical Support
19 *
20 ****************************************************************************/
21
22/************************************************/
23/* Some defines that we like */
24/************************************************/
25#define CHAR char
26#define UCHAR unsigned char
27#define SHORT short
28#define USHORT unsigned short
29#define BOOL unsigned short
30#define LONG long
31#define ULONG unsigned long
32#define VOID void
33
34/************************************************/
35/* Dale PCI setup */
36/************************************************/
37#define VENDOR_PSI 0x1256
38#define DEVICE_DALE_1 0x4401 /* 'D1' */
39#define DEVICE_BIGD_1 0x4201 /* 'B1' */
40#define DEVICE_BIGD_2 0x4202 /* 'B2' */
41
42/************************************************/
43/* Misc konstants */
44/************************************************/
45#define DALE_MAXDRIVES 4
46#define BIGD_MAXDRIVES 8
47#define SECTORSXFER 8
48#define ATAPI_TRANSFER 8192
49#define BYTES_PER_SECTOR 512
50#define DEFAULT_TIMING_MODE 5
51
52/************************************************/
53/* EEPROM locations */
54/************************************************/
55#define DALE_FLASH_PAGE_SIZE 128 // number of bytes per page
56#define DALE_FLASH_SIZE 65536L
57
58#define DALE_FLASH_BIOS 0x00080000L // BIOS base address
59#define DALE_FLASH_SETUP 0x00088000L // SETUP PROGRAM base address offset from BIOS
60#define DALE_FLASH_RAID 0x00088400L // RAID signature storage
61#define DALE_FLASH_FACTORY 0x00089000L // FACTORY data base address offset from BIOS
62
63#define DALE_FLASH_BIOS_SIZE 32768U // size of FLASH BIOS REGION
64
65/************************************************/
66/* DALE Register address offsets */
67/************************************************/
68#define REG_DATA 0x80
69#define REG_ERROR 0x84
70#define REG_SECTOR_COUNT 0x88
71#define REG_LBA_0 0x8C
72#define REG_LBA_8 0x90
73#define REG_LBA_16 0x94
74#define REG_LBA_24 0x98
75#define REG_STAT_CMD 0x9C
76#define REG_STAT_SEL 0xA0
77#define REG_FAIL 0xB0
78#define REG_ALT_STAT 0xB8
79#define REG_DRIVE_ADRS 0xBC
80
81#define DALE_DATA_SLOW 0x00040000L
82#define DALE_DATA_MODE2 0x00040000L
83#define DALE_DATA_MODE3 0x00050000L
84#define DALE_DATA_MODE4 0x00060000L
85#define DALE_DATA_MODE5 0x00070000L
86
87#define BIGD_DATA_SLOW 0x00000000L
88#define BIGD_DATA_MODE0 0x00000000L
89#define BIGD_DATA_MODE2 0x00000000L
90#define BIGD_DATA_MODE3 0x00000008L
91#define BIGD_DATA_MODE4 0x00000010L
92#define BIGD_DATA_MODE5 0x00000020L
93
94#define RTR_LOCAL_RANGE 0x000
95#define RTR_LOCAL_REMAP 0x004
96#define RTR_EXP_RANGE 0x010
97#define RTR_EXP_REMAP 0x014
98#define RTR_REGIONS 0x018
99#define RTR_DM_MASK 0x01C
100#define RTR_DM_LOCAL_BASE 0x020
101#define RTR_DM_IO_BASE 0x024
102#define RTR_DM_PCI_REMAP 0x028
103#define RTR_DM_IO_CONFIG 0x02C
104#define RTR_MAILBOX 0x040
105#define RTR_LOCAL_DOORBELL 0x060
106#define RTR_PCI_DOORBELL 0x064
107#define RTR_INT_CONTROL_STATUS 0x068
108#define RTR_EEPROM_CONTROL_STATUS 0x06C
109
110#define RTR_DMA0_MODE 0x0080
111#define RTR_DMA0_PCI_ADDR 0x0084
112#define RTR_DMA0_LOCAL_ADDR 0x0088
113#define RTR_DMA0_COUNT 0x008C
114#define RTR_DMA0_DESC_PTR 0x0090
115#define RTR_DMA1_MODE 0x0094
116#define RTR_DMA1_PCI_ADDR 0x0098
117#define RTR_DMA1_LOCAL_ADDR 0x009C
118#define RTR_DMA1_COUNT 0x00A0
119#define RTR_DMA1_DESC_PTR 0x00A4
120#define RTR_DMA_COMMAND_STATUS 0x00A8
121#define RTR_DMA_ARB0 0x00AC
122#define RTR_DMA_ARB1 0x00B0
123
124#define RTL_DMA0_MODE 0x00
125#define RTL_DMA0_PCI_ADDR 0x04
126#define RTL_DMA0_LOCAL_ADDR 0x08
127#define RTL_DMA0_COUNT 0x0C
128#define RTL_DMA0_DESC_PTR 0x10
129#define RTL_DMA1_MODE 0x14
130#define RTL_DMA1_PCI_ADDR 0x18
131#define RTL_DMA1_LOCAL_ADDR 0x1C
132#define RTL_DMA1_COUNT 0x20
133#define RTL_DMA1_DESC_PTR 0x24
134#define RTL_DMA_COMMAND_STATUS 0x28
135#define RTL_DMA_ARB0 0x2C
136#define RTL_DMA_ARB1 0x30
137
138/************************************************/
139/* Dale Scratchpad locations */
140/************************************************/
141#define DALE_CHANNEL_DEVICE_0 0 // device channel locations
142#define DALE_CHANNEL_DEVICE_1 1
143#define DALE_CHANNEL_DEVICE_2 2
144#define DALE_CHANNEL_DEVICE_3 3
145
146#define DALE_SCRATCH_DEVICE_0 4 // device type codes
147#define DALE_SCRATCH_DEVICE_1 5
148#define DALE_SCRATCH_DEVICE_2 6
149#define DALE_SCRATCH_DEVICE_3 7
150
151#define DALE_RAID_0_STATUS 8
152#define DALE_RAID_1_STATUS 9
153
154#define DALE_TIMING_MODE 12 // bus master timing mode (2, 3, 4, 5)
155#define DALE_NUM_DRIVES 13 // number of addressable drives on this board
156#define DALE_RAID_ON 14 // RAID status On
157#define DALE_LAST_ERROR 15 // Last error code from BIOS
158
159/************************************************/
160/* BigD Scratchpad locations */
161/************************************************/
162#define BIGD_DEVICE_0 0 // device channel locations
163#define BIGD_DEVICE_1 1
164#define BIGD_DEVICE_2 2
165#define BIGD_DEVICE_3 3
166
167#define BIGD_DEVICE_4 4 // device type codes
168#define BIGD_DEVICE_5 5
169#define BIGD_DEVICE_6 6
170#define BIGD_DEVICE_7 7
171
172#define BIGD_ALARM_IMAGE 11 // ~image of alarm fail register
173#define BIGD_TIMING_MODE 12 // bus master timing mode (2, 3, 4, 5)
174#define BIGD_NUM_DRIVES 13 // number of addressable drives on this board
175#define BIGD_RAID_ON 14 // RAID status is on for the whole board
176#define BIGD_LAST_ERROR 15 // Last error code from BIOS
177
178#define BIGD_RAID_0_STATUS 16
179#define BIGD_RAID_1_STATUS 17
180#define BIGD_RAID_2_STATUS 18
181#define BIGD_RAID_3_STATUS 19
182#define BIGD_RAID_4_STATUS 20
183#define BIGD_RAID_5_STATUS 21
184#define BIGD_RAID_6_STATUS 22
185#define BIGD_RAID_7_STATUS 23
186
187/************************************************/
188/* Dale cable select bits */
189/************************************************/
190#define SEL_NONE 0x00
191#define SEL_1 0x01
192#define SEL_2 0x02
193#define SEL_3 0x04
194#define SEL_4 0x08
195#define SEL_NEW_SPEED_1 0x20
196#define SEL_COPY 0x40
197#define SEL_IRQ_OFF 0x80
198
199/************************************************/
200/* Device/Geometry controls */
201/************************************************/
202#define GEOMETRY_NONE 0x0 // No device
203#define GEOMETRY_SET 0x1 // Geometry set
204#define GEOMETRY_LBA 0x2 // Geometry set in default LBA mode
205#define GEOMETRY_PHOENIX 0x3 // Geometry set in Pheonix BIOS compatibility mode
206
207#define DEVICE_NONE 0x0 // No device present
208#define DEVICE_INACTIVE 0x1 // device present but not registered active
209#define DEVICE_ATAPI 0x2 // ATAPI device (CD_ROM, Tape, Etc...)
210#define DEVICE_DASD_NONLBA 0x3 // Non LBA incompatible device
211#define DEVICE_DASD_LBA 0x4 // LBA compatible device
212
213/************************************************/
214/* BigD fail register bits */
215/************************************************/
216#define FAIL_NONE 0x00
217#define FAIL_0 0x01
218#define FAIL_1 0x02
219#define FAIL_2 0x04
220#define FAIL_MULTIPLE 0x08
221#define FAIL_GOOD 0x20
222#define FAIL_AUDIBLE 0x40
223#define FAIL_ANY 0x80
224
225/************************************************/
226/* Setup Structure Definitions */
227/************************************************/
228typedef struct // device setup parameters
229 {
230 UCHAR geometryControl; // geometry control flags
231 UCHAR device; // device code
232 USHORT sectors; // number of sectors per track
233 USHORT heads; // number of heads
234 USHORT cylinders; // number of cylinders for this device
235 ULONG blocks; // number of blocks on device
236 ULONG realCapacity; // number of real blocks on this device for drive changed testing
237 } SETUP_DEVICE, *PSETUP_DEVICE;
238
239typedef struct // master setup structure
240 {
241 USHORT startupDelay;
242 BOOL promptBIOS;
243 BOOL fastFormat;
244 BOOL shareInterrupt;
245 BOOL rebootRebuild;
246 USHORT timingMode;
247 USHORT spare5;
248 USHORT spare6;
249 SETUP_DEVICE setupDevice[BIGD_MAXDRIVES];
250 } SETUP, *PSETUP;
251
252/************************************************/
253/* RAID Structure Definitions */
254/************************************************/
255typedef struct
256 {
257 UCHAR signature; // 0x55 our mirror signature
258 UCHAR status; // current status bits
259 UCHAR pairIdentifier; // unique identifier for pair
260 ULONG reconstructPoint; // recontruction point for hot reconstruct
261 } DISK_MIRROR;
262
263typedef struct DEVICE_RAID1
264 {
265 long TotalSectors;
266 DISK_MIRROR DiskRaid1;
267 } DEVICE_RAID1, *PDEVICE_RAID1;
268
269#define DISK_MIRROR_POSITION 0x01A8
270#define SIGNATURE 0x55
271
272#define MASK_SERIAL_NUMBER 0x0FFE // mask for serial number matching
273#define MASK_SERIAL_UNIT 0x0001 // mask for unit portion of serial number
274
275// Status bits
276#define UCBF_MIRRORED 0x0010 // drive has a pair
277#define UCBF_MATCHED 0x0020 // drive pair is matched
278#define UCBF_SURVIVOR 0x0040 // this unit is a survivor of a pair
279#define UCBF_REBUILD 0x0080 // rebuild in progress on this device
280
281// SCSI controls for RAID
282#define SC_MY_RAID 0xBF // our special CDB command byte for Win95... interface
283#define MY_SCSI_QUERY1 0x32 // byte 1 subcommand to query driver for RAID 1 informatation
284#define MY_SCSI_REBUILD 0x40 // byte 1 subcommand to reconstruct a mirrored pair
285#define MY_SCSI_DEMOFAIL 0x54 // byte 1 subcommand for RAID failure demonstration
286#define MY_SCSI_ALARMMUTE 0x60 // byte 1 subcommand to mute any alarm currently on
287
288/************************************************/
289/* Timeout konstants */
290/************************************************/
291#define TIMEOUT_READY 100 // 100 mSec
292#define TIMEOUT_DRQ 300 // 300 mSec
293#define TIMEOUT_DATA (3 * HZ) // 3 seconds
294
295/************************************************/
296/* Misc. macros */
297/************************************************/
298#define ANY2SCSI(up, p) \
299((UCHAR *)up)[0] = (((ULONG)(p)) >> 8); \
300((UCHAR *)up)[1] = ((ULONG)(p));
301
302#define SCSI2LONG(up) \
303( (((long)*(((UCHAR *)up))) << 16) \
304+ (((long)(((UCHAR *)up)[1])) << 8) \
305+ ((long)(((UCHAR *)up)[2])) )
306
307#define XANY2SCSI(up, p) \
308((UCHAR *)up)[0] = ((long)(p)) >> 24; \
309((UCHAR *)up)[1] = ((long)(p)) >> 16; \
310((UCHAR *)up)[2] = ((long)(p)) >> 8; \
311((UCHAR *)up)[3] = ((long)(p));
312
313#define XSCSI2LONG(up) \
314( (((long)(((UCHAR *)up)[0])) << 24) \
315+ (((long)(((UCHAR *)up)[1])) << 16) \
316+ (((long)(((UCHAR *)up)[2])) << 8) \
317+ ((long)(((UCHAR *)up)[3])) )
318
319#define SelectSpigot(padapter,spigot) outb_p (spigot, padapter->regStatSel)
320#define WriteCommand(padapter,cmd) outb_p (cmd, padapter->regStatCmd)
321#define AtapiDevice(padapter,b) outb_p (b, padapter->regLba24);
322#define AtapiCountLo(padapter,b) outb_p (b, padapter->regLba8)
323#define AtapiCountHi(padapter,b) outb_p (b, padapter->regLba16)
324
325/************************************************/
326/* SCSI CDB operation codes */
327/************************************************/
328#define SCSIOP_TEST_UNIT_READY 0x00
329#define SCSIOP_REZERO_UNIT 0x01
330#define SCSIOP_REWIND 0x01
331#define SCSIOP_REQUEST_BLOCK_ADDR 0x02
332#define SCSIOP_REQUEST_SENSE 0x03
333#define SCSIOP_FORMAT_UNIT 0x04
334#define SCSIOP_READ_BLOCK_LIMITS 0x05
335#define SCSIOP_REASSIGN_BLOCKS 0x07
336#define SCSIOP_READ6 0x08
337#define SCSIOP_RECEIVE 0x08
338#define SCSIOP_WRITE6 0x0A
339#define SCSIOP_PRINT 0x0A
340#define SCSIOP_SEND 0x0A
341#define SCSIOP_SEEK6 0x0B
342#define SCSIOP_TRACK_SELECT 0x0B
343#define SCSIOP_SLEW_PRINT 0x0B
344#define SCSIOP_SEEK_BLOCK 0x0C
345#define SCSIOP_PARTITION 0x0D
346#define SCSIOP_READ_REVERSE 0x0F
347#define SCSIOP_WRITE_FILEMARKS 0x10
348#define SCSIOP_FLUSH_BUFFER 0x10
349#define SCSIOP_SPACE 0x11
350#define SCSIOP_INQUIRY 0x12
351#define SCSIOP_VERIFY6 0x13
352#define SCSIOP_RECOVER_BUF_DATA 0x14
353#define SCSIOP_MODE_SELECT 0x15
354#define SCSIOP_RESERVE_UNIT 0x16
355#define SCSIOP_RELEASE_UNIT 0x17
356#define SCSIOP_COPY 0x18
357#define SCSIOP_ERASE 0x19
358#define SCSIOP_MODE_SENSE 0x1A
359#define SCSIOP_START_STOP_UNIT 0x1B
360#define SCSIOP_STOP_PRINT 0x1B
361#define SCSIOP_LOAD_UNLOAD 0x1B
362#define SCSIOP_RECEIVE_DIAGNOSTIC 0x1C
363#define SCSIOP_SEND_DIAGNOSTIC 0x1D
364#define SCSIOP_MEDIUM_REMOVAL 0x1E
365#define SCSIOP_READ_CAPACITY 0x25
366#define SCSIOP_READ 0x28
367#define SCSIOP_WRITE 0x2A
368#define SCSIOP_SEEK 0x2B
369#define SCSIOP_LOCATE 0x2B
370#define SCSIOP_WRITE_VERIFY 0x2E
371#define SCSIOP_VERIFY 0x2F
372#define SCSIOP_SEARCH_DATA_HIGH 0x30
373#define SCSIOP_SEARCH_DATA_EQUAL 0x31
374#define SCSIOP_SEARCH_DATA_LOW 0x32
375#define SCSIOP_SET_LIMITS 0x33
376#define SCSIOP_READ_POSITION 0x34
377#define SCSIOP_SYNCHRONIZE_CACHE 0x35
378#define SCSIOP_COMPARE 0x39
379#define SCSIOP_COPY_COMPARE 0x3A
380#define SCSIOP_WRITE_DATA_BUFF 0x3B
381#define SCSIOP_READ_DATA_BUFF 0x3C
382#define SCSIOP_CHANGE_DEFINITION 0x40
383#define SCSIOP_READ_SUB_CHANNEL 0x42
384#define SCSIOP_READ_TOC 0x43
385#define SCSIOP_READ_HEADER 0x44
386#define SCSIOP_PLAY_AUDIO 0x45
387#define SCSIOP_PLAY_AUDIO_MSF 0x47
388#define SCSIOP_PLAY_TRACK_INDEX 0x48
389#define SCSIOP_PLAY_TRACK_RELATIVE 0x49
390#define SCSIOP_PAUSE_RESUME 0x4B
391#define SCSIOP_LOG_SELECT 0x4C
392#define SCSIOP_LOG_SENSE 0x4D
393#define SCSIOP_MODE_SELECT10 0x55
394#define SCSIOP_MODE_SENSE10 0x5A
395#define SCSIOP_LOAD_UNLOAD_SLOT 0xA6
396#define SCSIOP_MECHANISM_STATUS 0xBD
397#define SCSIOP_READ_CD 0xBE
398
399// IDE command definitions
400#define IDE_COMMAND_ATAPI_RESET 0x08
401#define IDE_COMMAND_READ 0x20
402#define IDE_COMMAND_WRITE 0x30
403#define IDE_COMMAND_RECALIBRATE 0x10
404#define IDE_COMMAND_SEEK 0x70
405#define IDE_COMMAND_SET_PARAMETERS 0x91
406#define IDE_COMMAND_VERIFY 0x40
407#define IDE_COMMAND_ATAPI_PACKET 0xA0
408#define IDE_COMMAND_ATAPI_IDENTIFY 0xA1
409#define IDE_CMD_READ_MULTIPLE 0xC4
410#define IDE_CMD_WRITE_MULTIPLE 0xC5
411#define IDE_CMD_SET_MULTIPLE 0xC6
412#define IDE_COMMAND_IDENTIFY 0xEC
413
414// IDE status definitions
415#define IDE_STATUS_ERROR 0x01
416#define IDE_STATUS_INDEX 0x02
417#define IDE_STATUS_CORRECTED_ERROR 0x04
418#define IDE_STATUS_DRQ 0x08
419#define IDE_STATUS_DSC 0x10
420#define IDE_STATUS_WRITE_FAULT 0x20
421#define IDE_STATUS_DRDY 0x40
422#define IDE_STATUS_BUSY 0x80
423
424typedef struct _ATAPI_STATUS
425 {
426 CHAR check :1;
427 CHAR reserved1 :1;
428 CHAR corr :1;
429 CHAR drq :1;
430 CHAR dsc :1;
431 CHAR reserved2 :1;
432 CHAR drdy :1;
433 CHAR bsy :1;
434 } ATAPI_STATUS;
435
436typedef struct _ATAPI_REASON
437 {
438 CHAR cod :1;
439 CHAR io :1;
440 CHAR reserved1 :6;
441 } ATAPI_REASON;
442
443typedef struct _ATAPI_ERROR
444 {
445 CHAR ili :1;
446 CHAR eom :1;
447 CHAR abort :1;
448 CHAR mcr :1;
449 CHAR senseKey :4;
450 } ATAPI_ERROR;
451
452// IDE error definitions
453#define IDE_ERROR_AMNF 0x01
454#define IDE_ERROR_TKONF 0x02
455#define IDE_ERROR_ABRT 0x04
456#define IDE_ERROR_MCR 0x08
457#define IDE_ERROR_IDFN 0x10
458#define IDE_ERROR_MC 0x20
459#define IDE_ERROR_UNC 0x40
460#define IDE_ERROR_BBK 0x80
461
462// SCSI read capacity structure
463typedef struct _READ_CAPACITY_DATA
464 {
465 ULONG blks; /* total blocks (converted to little endian) */
466 ULONG blksiz; /* size of each (converted to little endian) */
467 } READ_CAPACITY_DATA, *PREAD_CAPACITY_DATA;
468
469// SCSI inquiry data
470typedef struct _INQUIRYDATA
471 {
472 UCHAR DeviceType :5;
473 UCHAR DeviceTypeQualifier :3;
474 UCHAR DeviceTypeModifier :7;
475 UCHAR RemovableMedia :1;
476 UCHAR Versions;
477 UCHAR ResponseDataFormat;
478 UCHAR AdditionalLength;
479 UCHAR Reserved[2];
480 UCHAR SoftReset :1;
481 UCHAR CommandQueue :1;
482 UCHAR Reserved2 :1;
483 UCHAR LinkedCommands :1;
484 UCHAR Synchronous :1;
485 UCHAR Wide16Bit :1;
486 UCHAR Wide32Bit :1;
487 UCHAR RelativeAddressing :1;
488 UCHAR VendorId[8];
489 UCHAR ProductId[16];
490 UCHAR ProductRevisionLevel[4];
491 UCHAR VendorSpecific[20];
492 UCHAR Reserved3[40];
493 } INQUIRYDATA, *PINQUIRYDATA;
494
495// IDE IDENTIFY data
496#pragma pack (1)
497typedef struct _IDENTIFY_DATA
498 {
499 USHORT GeneralConfiguration; // 0
500 USHORT NumberOfCylinders; // 1
501 USHORT Reserved1; // 2
502 USHORT NumberOfHeads; // 3
503 USHORT UnformattedBytesPerTrack; // 4
504 USHORT UnformattedBytesPerSector; // 5
505 USHORT SectorsPerTrack; // 6
506 USHORT NumBytesISG; // 7 Byte Len - inter-sector gap
507 USHORT NumBytesSync; // 8 - sync field
508 USHORT NumWordsVUS; // 9 Len - Vendor Unique Info
509 USHORT SerialNumber[10]; // 10
510 USHORT BufferType; // 20
511 USHORT BufferSectorSize; // 21
512 USHORT NumberOfEccBytes; // 22
513 USHORT FirmwareRevision[4]; // 23
514 USHORT ModelNumber[20]; // 27
515 USHORT NumSectorsPerInt :8; // 47 Multiple Mode - Sec/Blk
516 USHORT Reserved2 :8; // 47
517 USHORT DoubleWordMode; // 48 flag for double word mode capable
518 USHORT VendorUnique1 :8; // 49
519 USHORT SupportDMA :1; // 49 DMA supported
520 USHORT SupportLBA :1; // 49 LBA supported
521 USHORT SupportIORDYDisable :1; // 49 IORDY can be disabled
522 USHORT SupportIORDY :1; // 49 IORDY supported
523 USHORT ReservedPsuedoDMA :1; // 49 reserved for pseudo DMA mode support
524 USHORT Reserved3 :3; // 49
525 USHORT Reserved4; // 50
526 USHORT Reserved5 :8; // 51 Transfer Cycle Timing - PIO
527 USHORT PIOCycleTime :8; // 51 Transfer Cycle Timing - PIO
528 USHORT Reserved6 :8; // 52 - DMA
529 USHORT DMACycleTime :8; // 52 - DMA
530 USHORT Valid_54_58 :1; // 53 words 54 - 58 are valid
531 USHORT Valid_64_70 :1; // 53 words 64 - 70 are valid
532 USHORT Reserved7 :14; // 53
533 USHORT LogNumCyl; // 54 Current Translation - Num Cyl
534 USHORT LogNumHeads; // 55 Num Heads
535 USHORT LogSectorsPerTrack; // 56 Sec/Trk
536 ULONG LogTotalSectors; // 57 Total Sec
537 USHORT CurrentNumSecPerInt :8; // 59 current setting for number of sectors per interrupt
538 USHORT ValidNumSecPerInt :1; // 59 Current setting is valid for number of sectors per interrupt
539 USHORT Reserved8 :7; // 59
540 ULONG LBATotalSectors; // 60 LBA Mode - Sectors
541 USHORT DMASWordFlags; // 62
542 USHORT DMAMWordFlags; // 63
543 USHORT AdvancedPIOSupport :8; // 64 Flow control PIO transfer modes supported
544 USHORT Reserved9 :8; // 64
545 USHORT MinMultiDMACycle; // 65 minimum multiword DMA transfer cycle time per word
546 USHORT RecomendDMACycle; // 66 Manufacturer's recommende multiword DMA transfer cycle time
547 USHORT MinPIOCycleWithoutFlow; // 67 Minimum PIO transfer cycle time without flow control
548 USHORT MinPIOCylceWithFlow; // 68 Minimum PIO transfer cycle time with IORDY flow control
549 USHORT ReservedSpace[256-69]; // 69
550 } IDENTIFY_DATA, *PIDENTIFY_DATA;
551
552// ATAPI configuration bits
553typedef struct _ATAPI_GENERAL_0
554 {
555 USHORT CmdPacketSize :2; // Command packet size
556 USHORT Reserved1 :3;
557 USHORT CmdDrqType :2;
558 USHORT Removable :1;
559 USHORT DeviceType :5;
560 USHORT Reserved2 :1;
561 USHORT ProtocolType :2;
562 } ATAPI_GENERAL_0;
563
564#pragma pack ()
diff --git a/drivers/scsi/psi_roy.h b/drivers/scsi/psi_roy.h
deleted file mode 100644
index c55b9c04c32a..000000000000
--- a/drivers/scsi/psi_roy.h
+++ /dev/null
@@ -1,331 +0,0 @@
1/****************************************************************************
2 * Perceptive Solutions, Inc. PCI-2000 device driver for Linux.
3 *
4 * psi_roy.h - Linux Host Driver for PCI-2000 IntelliCache SCSI Adapters
5 *
6 * Copyright (c) 1997-1999 Perceptive Solutions, Inc.
7 * All Rights Reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that redistributions of source
11 * code retain the above copyright notice and this comment without
12 * modification.
13 *
14 * Technical updates and product information at:
15 * http://www.psidisk.com
16 *
17 * Please send questions, comments, bug reports to:
18 * tech@psidisk.com Technical Support
19 *
20 ****************************************************************************/
21
22#ifndef ROY_HOST
23#define ROY_HOST
24
25/************************************************/
26/* PCI setup */
27/************************************************/
28#define VENDOR_PSI 0x1256
29#define DEVICE_ROY_1 0x5201 /* 'R1' */
30
31/************************************************/
32/* controller constants */
33/************************************************/
34#define MAXADAPTER 4 // Increase this and the sizes of the arrays below, if you need more.
35#define MAX_BUS 2
36#define MAX_UNITS 16
37#define TIMEOUT_COMMAND 400 // number of milliSecondos for command busy timeout
38
39/************************************************/
40/* I/O address offsets */
41/************************************************/
42#define RTR_MAILBOX 0x040
43#define RTR_LOCAL_DOORBELL 0x060
44#define RTR_PCI_DOORBELL 0x064
45
46/************************************************/
47/* */
48/* Host command codes */
49/* */
50/************************************************/
51#define CMD_READ_CHS 0x01 /* read sectors as specified (CHS mode) */
52#define CMD_READ 0x02 /* read sectors as specified (RBA mode) */
53#define CMD_READ_SG 0x03 /* read sectors using scatter/gather list */
54#define CMD_WRITE_CHS 0x04 /* write sectors as specified (CHS mode) */
55#define CMD_WRITE 0x05 /* write sectors as specified (RBA mode) */
56#define CMD_WRITE_SG 0x06 /* write sectors using scatter/gather list (LBA mode) */
57#define CMD_READ_CHS_SG 0x07 /* read sectors using scatter/gather list (CHS mode) */
58#define CMD_WRITE_CHS_SG 0x08 /* write sectors using scatter/gather list (CHS mode) */
59#define CMD_VERIFY_CHS 0x09 /* verify data on sectors as specified (CHS mode) */
60#define CMD_VERIFY 0x0A /* verify data on sectors as specified (RBA mode) */
61#define CMD_DASD_CDB 0x0B /* process CDB for a DASD device */
62#define CMD_DASD_CDB_SG 0x0C /* process CDB for a DASD device with scatter/gather */
63
64#define CMD_READ_ABS 0x10 /* read absolute disk */
65#define CMD_WRITE_ABS 0x11 /* write absolute disk */
66#define CMD_VERIFY_ABS 0x12 /* verify absolute disk */
67#define CMD_TEST_READY 0x13 /* test unit ready and return status code */
68#define CMD_LOCK_DOOR 0x14 /* lock device door */
69#define CMD_UNLOCK_DOOR 0x15 /* unlock device door */
70#define CMD_EJECT_MEDIA 0x16 /* eject the media */
71#define CMD_UPDATE_CAP 0x17 /* update capacity information */
72#define CMD_TEST_PRIV 0x18 /* test and setup private format media */
73
74
75#define CMD_SCSI_THRU 0x30 /* SCSI pass through CDB */
76#define CMD_SCSI_THRU_SG 0x31 /* SCSI pass through CDB with scatter/gather */
77#define CMD_SCSI_REQ_SENSE 0x32 /* SCSI pass through request sense after check condition */
78
79#define CMD_DASD_RAID_RQ 0x35 /* request DASD RAID drive data */
80#define CMD_DASD_RAID_RQ0 0x31 /* byte 1 subcommand to query for RAID 0 informatation */
81#define CMD_DASD_RAID_RQ1 0x32 /* byte 1 subcommand to query for RAID 1 informatation */
82#define CMD_DASD_RAID_RQ5 0x33 /* byte 1 subcommand to query for RAID 5 informatation */
83
84#define CMD_DASD_SCSI_INQ 0x36 /* do DASD inquire and return in SCSI format */
85#define CMD_DASD_CAP 0x37 /* read DASD capacity */
86#define CMD_DASD_INQ 0x38 /* do DASD inquire for type data and return SCSI/EIDE inquiry */
87#define CMD_SCSI_INQ 0x39 /* do SCSI inquire */
88#define CMD_READ_SETUP 0x3A /* Get setup structures from controller */
89#define CMD_WRITE_SETUP 0x3B /* Put setup structures in controller and burn in flash */
90#define CMD_READ_CONFIG 0x3C /* Get the entire configuration and setup structures */
91#define CMD_WRITE_CONFIG 0x3D /* Put the entire configuration and setup structures in flash */
92
93#define CMD_TEXT_DEVICE 0x3E /* obtain device text */
94#define CMD_TEXT_SIGNON 0x3F /* get sign on banner */
95
96#define CMD_QUEUE 0x40 /* any command below this generates a queue tag interrupt to host*/
97
98#define CMD_PREFETCH 0x40 /* prefetch sectors as specified */
99#define CMD_TEST_WRITE 0x41 /* Test a device for write protect */
100#define CMD_LAST_STATUS 0x42 /* get last command status and error data*/
101#define CMD_ABORT 0x43 /* abort command as specified */
102#define CMD_ERROR 0x44 /* fetch error code from a tagged op */
103#define CMD_DONE 0x45 /* done with operation */
104#define CMD_DIAGNOSTICS 0x46 /* execute controller diagnostics and wait for results */
105#define CMD_FEATURE_MODE 0x47 /* feature mode control word */
106#define CMD_DASD_INQUIRE 0x48 /* inquire as to DASD SCSI device (32 possible) */
107#define CMD_FEATURE_QUERY 0x49 /* query the feature control word */
108#define CMD_DASD_EJECT 0x4A /* Eject removable media for DASD type */
109#define CMD_DASD_LOCK 0x4B /* Lock removable media for DASD type */
110#define CMD_DASD_TYPE 0x4C /* obtain DASD device type */
111#define CMD_NUM_DEV 0x4D /* obtain the number of devices connected to the controller */
112#define CMD_GET_PARMS 0x4E /* obtain device parameters */
113#define CMD_SPECIFY 0x4F /* specify operating system for scatter/gather operations */
114
115#define CMD_RAID_GET_DEV 0x50 /* read RAID device geometry */
116#define CMD_RAID_READ 0x51 /* read RAID 1 parameter block */
117#define CMD_RAID_WRITE 0x52 /* write RAID 1 parameter block */
118#define CMD_RAID_LITEUP 0x53 /* Light up the drive light for identification */
119#define CMD_RAID_REBUILD 0x54 /* issue a RAID 1 pair rebuild */
120#define CMD_RAID_MUTE 0x55 /* mute RAID failure alarm */
121#define CMD_RAID_FAIL 0x56 /* induce a RAID failure */
122#define CMD_RAID_STATUS 0x57 /* get status of RAID pair */
123#define CMD_RAID_STOP 0x58 /* stop any reconstruct in progress */
124#define CMD_RAID_START 0x59 /* start reconstruct */
125#define CMD_RAID0_READ 0x5A /* read RAID 0 parameter block */
126#define CMD_RAID0_WRITE 0x5B /* write RAID 0 parameter block */
127#define CMD_RAID5_READ 0x5C /* read RAID 5 parameter block */
128#define CMD_RAID5_WRITE 0x5D /* write RAID 5 parameter block */
129
130#define CMD_ERASE_TABLES 0x5F /* erase partition table and RAID signatutures */
131
132#define CMD_SCSI_GET 0x60 /* get SCSI pass through devices */
133#define CMD_SCSI_TIMEOUT 0x61 /* set SCSI pass through timeout */
134#define CMD_SCSI_ERROR 0x62 /* get SCSI pass through request sense length and residual data count */
135#define CMD_GET_SPARMS 0x63 /* get SCSI bus and user parms */
136#define CMD_SCSI_ABORT 0x64 /* abort by setting time-out to zero */
137
138#define CMD_CHIRP_CHIRP 0x77 /* make a chirp chirp sound */
139#define CMD_GET_LAST_DONE 0x78 /* get tag of last done in progress */
140#define CMD_GET_FEATURES 0x79 /* get feature code and ESN */
141#define CMD_CLEAR_CACHE 0x7A /* Clear cache on specified device */
142#define CMD_BIOS_TEST 0x7B /* Test whether or not to load BIOS */
143#define CMD_WAIT_FLUSH 0x7C /* wait for cache flushed and invalidate read cache */
144#define CMD_RESET_BUS 0x7D /* reset the SCSI bus */
145#define CMD_STARTUP_QRY 0x7E /* startup in progress query */
146#define CMD_RESET 0x7F /* reset the controller */
147
148#define CMD_RESTART_RESET 0x80 /* reload and restart the controller at any reset issued */
149#define CMD_SOFT_RESET 0x81 /* do a soft reset NOW! */
150
151/************************************************/
152/* */
153/* Host return errors */
154/* */
155/************************************************/
156#define ERR08_TAGGED 0x80 /* doorbell error ored with tag */
157
158#define ERR16_NONE 0x0000 /* no errors */
159#define ERR16_SC_COND_MET 0x0004 /* SCSI status - Condition Met */
160#define ERR16_CMD 0x0101 /* command error */
161#define ERR16_SC_CHECK_COND 0x0002 /* SCSI status - Check Condition */
162#define ERR16_CMD_NOT 0x0201 /* command not supported */
163#define ERR16_NO_DEVICE 0x0301 /* invalid device selection */
164#define ERR16_SECTOR 0x0202 /* bad sector */
165#define ERR16_PROTECT 0x0303 /* write protected */
166#define ERR16_NOSECTOR 0x0404 /* sector not found */
167#define ERR16_MEDIA 0x0C0C /* invalid media */
168#define ERR16_CONTROL 0x2020 /* controller error */
169#define ERR16_CONTROL_DMA 0x2120 /* controller DMA engine error */
170#define ERR16_NO_ALARM 0x2220 /* alarm is not active */
171#define ERR16_OP_BUSY 0x2320 /* operation busy */
172#define ERR16_SEEK 0x4040 /* seek failure */
173#define ERR16_DEVICE_FAIL 0x4140 /* device has failed */
174#define ERR16_TIMEOUT 0x8080 /* timeout error */
175#define ERR16_DEV_NOT_READY 0xAAAA /* drive not ready */
176#define ERR16_UNDEFINED 0xBBBB /* undefined error */
177#define ERR16_WRITE_FAULT 0xCCCC /* write fault */
178#define ERR16_INVALID_DEV 0x4001 /* invalid device access */
179#define ERR16_DEVICE_BUSY 0x4002 /* device is busy */
180#define ERR16_MEMORY 0x4003 /* device pass thru requires too much memory */
181#define ERR16_NO_FEATURE 0x40FA /* feature no implemented */
182#define ERR16_NOTAG 0x40FD /* no tag space available */
183#define ERR16_NOT_READY 0x40FE /* controller not ready error */
184#define ERR16_SETUP_FLASH 0x5050 /* error when writing setup to flash memory */
185#define ERR16_SETUP_SIZE 0x5051 /* setup block size error */
186#define ERR16_SENSE 0xFFFF /* sense opereration failed */
187#define ERR16_SC_BUSY 0x0008 /* SCSI status - Busy */
188#define ERR16_SC_RES_CONFL 0x0018 /* SCSI status - Reservation Conflict */
189#define ERR16_SC_CMD_TERM 0x0022 /* SCSI status - Command Terminated */
190#define ERR16_SC_OTHER 0x00FF /* SCSI status - not recognized (any value masked) */
191#define ERR16_MEDIA_CHANGED 0x8001 /* devices media has been changed */
192
193#define ERR32_NONE 0x00000000 /* no errors */
194#define ERR32_SC_COND_MET 0x00000004 /* SCSI status - Condition Met */
195#define ERR32_CMD 0x00010101 /* command error */
196#define ERR32_SC_CHECK_COND 0x00020002 /* SCSI status - Check Condition */
197#define ERR32_CMD_NOT 0x00030201 /* command not supported */
198#define ERR32_NO_DEVICE 0x00040301 /* invalid device selection */
199#define ERR32_SECTOR 0x00050202 /* bad sector */
200#define ERR32_PROTECT 0x00060303 /* write protected */
201#define ERR32_NOSECTOR 0x00070404 /* sector not found */
202#define ERR32_MEDIA 0x00080C0C /* invalid media */
203#define ERR32_CONTROL 0x00092020 /* controller error */
204#define ERR32_CONTROL_DMA 0x000A2120 /* Controller DMA error */
205#define ERR32_NO_ALARM 0x000B2220 /* alarm is not active */
206#define ERR32_OP_BUSY 0x000C2320 /* operation busy */
207#define ERR32_SEEK 0x000D4040 /* seek failure */
208#define ERR32_DEVICE_FAIL 0x000E4140 /* device has failed */
209#define ERR32_TIMEOUT 0x000F8080 /* timeout error */
210#define ERR32_DEV_NOT_READY 0x0010AAAA /* drive not ready */
211#define ERR32_UNDEFINED 0x0011BBBB /* undefined error */
212#define ERR32_WRITE_FAULT 0x0012CCCC /* write fault */
213#define ERR32_INVALID_DEV 0x00134001 /* invalid device access */
214#define ERR32_DEVICE_BUSY 0x00144002 /* device is busy */
215#define ERR32_MEMORY 0x00154003 /* device pass thru requires too much memory */
216#define ERR32_NO_FEATURE 0x001640FA /* feature no implemented */
217#define ERR32_NOTAG 0x001740FD /* no tag space available */
218#define ERR32_NOT_READY 0x001840FE /* controller not ready error */
219#define ERR32_SETUP_FLASH 0x00195050 /* error when writing setup to flash memory */
220#define ERR32_SETUP_SIZE 0x001A5051 /* setup block size error */
221#define ERR32_SENSE 0x001BFFFF /* sense opereration failed */
222#define ERR32_SC_BUSY 0x001C0008 /* SCSI status - Busy */
223#define ERR32_SC_RES_CONFL 0x001D0018 /* SCSI status - Reservation Conflict */
224#define ERR32_SC_CMD_TERM 0x001E0022 /* SCSI status - Command Terminated */
225#define ERR32_SC_OTHER 0x001F00FF /* SCSI status - not recognized (any value masked) */
226#define ERR32_MEDIA_CHANGED 0x00208001 /* devices media has been changed */
227
228/************************************************/
229/* */
230/* Host Operating System specification codes */
231/* */
232/************************************************/
233#define SPEC_INTERRUPT 0x80 /* specification requires host interrupt */
234#define SPEC_BACKWARD_SG 0x40 /* specification requires scatter/gather items reversed */
235#define SPEC_DOS_BLOCK 0x01 /* DOS DASD blocking on pass through */
236#define SPEC_OS2_V3 0x02 /* OS/2 Warp */
237#define SPCE_SCO_3242 0x04 /* SCO 3.4.2.2 */
238#define SPEC_QNX_4X 0x05 /* QNX 4.XX */
239#define SPEC_NOVELL_NWPA 0x08 /* Novell NWPA scatter/gather support */
240
241/************************************************/
242/* */
243/* Inquire structures */
244/* */
245/************************************************/
246typedef struct _CNT_SCSI_INQ
247 {
248 UCHAR devt; /* 00: device type */
249 UCHAR devtm; /* 01: device type modifier */
250 UCHAR svers; /* 02: SCSI version */
251 UCHAR rfmt; /* 03: response data format */
252 UCHAR adlen; /* 04: additional length of data */
253 UCHAR res1; /* 05: */
254 UCHAR res2; /* 06: */
255 UCHAR fncs; /* 07: functional capabilities */
256 UCHAR vid[8]; /* 08: vendor ID */
257 UCHAR pid[16]; /* 10: product ID */
258 UCHAR rev[4]; /* 20: product revision */
259 } CNT_SCSI_INQ;
260
261typedef struct _CNT_IDE_INQ
262 {
263 USHORT GeneralConfiguration; /* 00 */
264 USHORT NumberOfCylinders; /* 02 */
265 USHORT Reserved1; /* 04 */
266 USHORT NumberOfHeads; /* 06 */
267 USHORT UnformattedBytesPerTrack; /* 08 */
268 USHORT UnformattedBytesPerSector; /* 0A */
269 USHORT SectorsPerTrack; /* 0C */
270 USHORT VendorUnique1[3]; /* 0E */
271 USHORT SerialNumber[10]; /* 14 */
272 USHORT BufferType; /* 28 */
273 USHORT BufferSectorSize; /* 2A */
274 USHORT NumberOfEccBytes; /* 2C */
275 USHORT FirmwareRevision[4]; /* 2E */
276 USHORT ModelNumber[20]; /* 36 */
277 UCHAR MaximumBlockTransfer; /* 5E */
278 UCHAR VendorUnique2; /* 5F */
279 USHORT DoubleWordIo; /* 60 */
280 USHORT Capabilities; /* 62 */
281 USHORT Reserved2; /* 64 */
282 UCHAR VendorUnique3; /* 66 */
283 UCHAR PioCycleTimingMode; /* 67 */
284 UCHAR VendorUnique4; /* 68 */
285 UCHAR DmaCycleTimingMode; /* 69 */
286 USHORT TranslationFieldsValid; /* 6A */
287 USHORT NumberOfCurrentCylinders; /* 6C */
288 USHORT NumberOfCurrentHeads; /* 6E */
289 USHORT CurrentSectorsPerTrack; /* 70 */
290 ULONG CurrentSectorCapacity; /* 72 */
291 } CNT_IDE_INQ;
292
293typedef struct _DASD_INQUIRE
294 {
295 ULONG type; /* 0 = SCSI, 1 = IDE */
296 union
297 {
298 CNT_SCSI_INQ scsi; /* SCSI inquire data */
299 CNT_IDE_INQ ide; /* IDE inquire data */
300 } inq;
301 } DASD_INQUIRE;
302
303/************************************************/
304/* */
305/* Device Codes */
306/* */
307/************************************************/
308#define DEVC_DASD 0x00 /* Direct-access Storage Device */
309#define DEVC_SEQACESS 0x01 /* Sequential-access device */
310#define DEVC_PRINTER 0x02 /* Printer device */
311#define DEVC_PROCESSOR 0x03 /* Processor device */
312#define DEVC_WRITEONCE 0x04 /* Write-once device */
313#define DEVC_CDROM 0x05 /* CD-ROM device */
314#define DEVC_SCANNER 0x06 /* Scanner device */
315#define DEVC_OPTICAL 0x07 /* Optical memory device */
316#define DEVC_MEDCHGR 0x08 /* Medium changer device */
317#define DEVC_DASD_REMOVABLE 0x80 /* Direct-access storage device, Removable */
318#define DEVC_NONE 0xFF /* no device */
319
320// SCSI controls for RAID
321#define SC_MY_RAID 0xBF // our special CDB command byte for Win95... interface
322#define MY_SCSI_QUERY0 0x31 // byte 1 subcommand to query driver for RAID 0 informatation
323#define MY_SCSI_QUERY1 0x32 // byte 1 subcommand to query driver for RAID 1 informatation
324#define MY_SCSI_QUERY5 0x33 // byte 1 subcommand to query driver for RAID 5 informatation
325#define MY_SCSI_REBUILD 0x40 // byte 1 subcommand to reconstruct a mirrored pair
326#define MY_SCSI_DEMOFAIL 0x54 // byte 1 subcommand for RAID failure demonstration
327#define MY_SCSI_ALARMMUTE 0x60 // byte 1 subcommand to mute any alarm currently on
328
329
330#endif
331
diff --git a/drivers/scsi/ql1040_fw.h b/drivers/scsi/ql1040_fw.h
index 89d8e09ec387..aaf9284a8b7d 100644
--- a/drivers/scsi/ql1040_fw.h
+++ b/drivers/scsi/ql1040_fw.h
@@ -25,17 +25,17 @@
25 */ 25 */
26 26
27/* 27/*
28 * Firmware Version 7.65.00 (14:17 Jul 20, 1999) 28 * Firmware Version 7.65.06 (14:38 Jan 07, 2002)
29 */ 29 */
30 30
31static unsigned char firmware_version[] = {7,65,0}; 31static unsigned char firmware_version[] = {7,65,6};
32 32
33#define FW_VERSION_STRING "7.65.0" 33#define FW_VERSION_STRING "7.65.06"
34 34
35static unsigned short risc_code_addr01 = 0x1000 ; 35static unsigned short risc_code_addr01 = 0x1000 ;
36 36
37static unsigned short risc_code01[] = { 37static unsigned short risc_code01[] = {
38 0x0078, 0x103a, 0x0000, 0x4057, 0x0000, 0x2043, 0x4f50, 0x5952, 38 0x0078, 0x103a, 0x0000, 0x4158, 0x0000, 0x2043, 0x4f50, 0x5952,
39 0x4947, 0x4854, 0x2031, 0x3939, 0x3520, 0x514c, 0x4f47, 0x4943, 39 0x4947, 0x4854, 0x2031, 0x3939, 0x3520, 0x514c, 0x4f47, 0x4943,
40 0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350, 40 0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
41 0x3130, 0x3230, 0x2049, 0x2f54, 0x2046, 0x6972, 0x6d77, 0x6172, 41 0x3130, 0x3230, 0x2049, 0x2f54, 0x2046, 0x6972, 0x6d77, 0x6172,
@@ -45,7 +45,7 @@ static unsigned short risc_code01[] = {
45 0x3031, 0x2024, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x0048, 45 0x3031, 0x2024, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x0048,
46 0x1045, 0x0038, 0x104b, 0x0078, 0x1047, 0x0028, 0x104b, 0x20b9, 46 0x1045, 0x0038, 0x104b, 0x0078, 0x1047, 0x0028, 0x104b, 0x20b9,
47 0x1212, 0x0078, 0x104d, 0x20b9, 0x2222, 0x20c1, 0x0008, 0x2071, 47 0x1212, 0x0078, 0x104d, 0x20b9, 0x2222, 0x20c1, 0x0008, 0x2071,
48 0x0010, 0x70c3, 0x0004, 0x20c9, 0x77ff, 0x2089, 0x1186, 0x70c7, 48 0x0010, 0x70c3, 0x0004, 0x20c9, 0x78ff, 0x2089, 0x1186, 0x70c7,
49 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 0x0007, 0x3f00, 49 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 0x0007, 0x3f00,
50 0x70d6, 0x20c1, 0x0008, 0x2019, 0x0000, 0x2009, 0xfeff, 0x2100, 50 0x70d6, 0x20c1, 0x0008, 0x2019, 0x0000, 0x2009, 0xfeff, 0x2100,
51 0x200b, 0xa5a5, 0xa1ec, 0x7fff, 0x2d64, 0x206b, 0x0a0a, 0xaddc, 51 0x200b, 0xa5a5, 0xa1ec, 0x7fff, 0x2d64, 0x206b, 0x0a0a, 0xaddc,
@@ -59,62 +59,62 @@ static unsigned short risc_code01[] = {
59 0x118e, 0x284a, 0x263a, 0x98c0, 0xa188, 0x1000, 0x212c, 0x200b, 59 0x118e, 0x284a, 0x263a, 0x98c0, 0xa188, 0x1000, 0x212c, 0x200b,
60 0xa5a5, 0x2114, 0xa286, 0xa5a5, 0x0040, 0x10bc, 0x250a, 0xa18a, 60 0xa5a5, 0x2114, 0xa286, 0xa5a5, 0x0040, 0x10bc, 0x250a, 0xa18a,
61 0x1000, 0x98c1, 0x0078, 0x10c1, 0x250a, 0x0078, 0x10c1, 0x2c6a, 61 0x1000, 0x98c1, 0x0078, 0x10c1, 0x250a, 0x0078, 0x10c1, 0x2c6a,
62 0x2a5a, 0x2130, 0xa18a, 0x0040, 0x2128, 0xa1a2, 0x5100, 0x8424, 62 0x2a5a, 0x2130, 0xa18a, 0x0040, 0x2128, 0xa1a2, 0x5200, 0x8424,
63 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 0xa192, 0x7800, 0x2009, 63 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 0xa192, 0x7900, 0x2009,
64 0x0000, 0x2001, 0x0031, 0x1078, 0x1cba, 0x2218, 0x2079, 0x5100, 64 0x0000, 0x2001, 0x0031, 0x1078, 0x1d26, 0x2218, 0x2079, 0x5200,
65 0x2fa0, 0x2408, 0x2011, 0x0000, 0x20a9, 0x0040, 0x42a4, 0x8109, 65 0x2fa0, 0x2408, 0x2011, 0x0000, 0x20a9, 0x0040, 0x42a4, 0x8109,
66 0x00c0, 0x10dc, 0x7ef2, 0x8528, 0x7de6, 0x7cea, 0x7bee, 0x7883, 66 0x00c0, 0x10dc, 0x7ef2, 0x8528, 0x7de6, 0x7cea, 0x7bee, 0x7883,
67 0x0000, 0x2031, 0x0030, 0x78cf, 0x0101, 0x780b, 0x0002, 0x780f, 67 0x0000, 0x2031, 0x0030, 0x78cf, 0x0101, 0x780b, 0x0002, 0x780f,
68 0x0002, 0x784f, 0x0003, 0x2069, 0x5140, 0x2001, 0x04fd, 0x2004, 68 0x0002, 0x784f, 0x0003, 0x2069, 0x5240, 0x2001, 0x04fd, 0x2004,
69 0xa082, 0x0005, 0x0048, 0x1104, 0x0038, 0x1100, 0x0078, 0x1108, 69 0xa082, 0x0005, 0x0048, 0x1104, 0x0038, 0x1100, 0x0078, 0x1108,
70 0x681b, 0x003c, 0x0078, 0x110a, 0x00a8, 0x1108, 0x681b, 0x003c, 70 0x681b, 0x003c, 0x0078, 0x110a, 0x00a8, 0x1108, 0x681b, 0x003c,
71 0x681b, 0x0028, 0x6807, 0x0007, 0x680b, 0x00fa, 0x680f, 0x0008, 71 0x681b, 0x0028, 0x6807, 0x0007, 0x680b, 0x00fa, 0x680f, 0x0008,
72 0x6813, 0x0005, 0x6823, 0x0000, 0x6827, 0x0006, 0x6817, 0x0008, 72 0x6813, 0x0005, 0x6823, 0x0000, 0x6827, 0x0006, 0x6817, 0x0008,
73 0x682b, 0x0000, 0x681f, 0x0019, 0x2069, 0x5380, 0x2011, 0x0020, 73 0x682b, 0x0000, 0x681f, 0x0019, 0x2069, 0x5480, 0x2011, 0x0020,
74 0x2009, 0x0010, 0x680b, 0x080c, 0x680f, 0x0019, 0x6803, 0xfd00, 74 0x2009, 0x0010, 0x680b, 0x080c, 0x680f, 0x0019, 0x6803, 0xfd00,
75 0x6807, 0x0018, 0x6a1a, 0x2d00, 0xa0e8, 0x0008, 0xa290, 0x0004, 75 0x6807, 0x0018, 0x6a1a, 0x2d00, 0xa0e8, 0x0008, 0xa290, 0x0004,
76 0x8109, 0x00c0, 0x1122, 0x2069, 0x5400, 0x2009, 0x0002, 0x20a9, 76 0x8109, 0x00c0, 0x1122, 0x2069, 0x5500, 0x2009, 0x0002, 0x20a9,
77 0x0100, 0x6837, 0x0000, 0x680b, 0x0040, 0x7bf0, 0xa386, 0xfeff, 77 0x0100, 0x6837, 0x0000, 0x680b, 0x0040, 0x7bf0, 0xa386, 0xfeff,
78 0x00c0, 0x1148, 0x6817, 0x0100, 0x681f, 0x0064, 0x0078, 0x114c, 78 0x00c0, 0x1148, 0x6817, 0x0100, 0x681f, 0x0064, 0x0078, 0x114c,
79 0x6817, 0x0064, 0x681f, 0x0002, 0xade8, 0x0010, 0x0070, 0x1152, 79 0x6817, 0x0064, 0x681f, 0x0002, 0xade8, 0x0010, 0x0070, 0x1152,
80 0x0078, 0x1139, 0x8109, 0x00c0, 0x1137, 0x1078, 0x220a, 0x1078, 80 0x0078, 0x1139, 0x8109, 0x00c0, 0x1137, 0x1078, 0x22a7, 0x1078,
81 0x482c, 0x1078, 0x1963, 0x1078, 0x4d22, 0x3200, 0xa085, 0x000d, 81 0x493d, 0x1078, 0x19b5, 0x1078, 0x4e33, 0x3200, 0xa085, 0x000d,
82 0x2090, 0x70c3, 0x0000, 0x0090, 0x116c, 0x70c0, 0xa086, 0x0002, 82 0x2090, 0x70c3, 0x0000, 0x0090, 0x116c, 0x70c0, 0xa086, 0x0002,
83 0x00c0, 0x116c, 0x1078, 0x1284, 0x1078, 0x1196, 0x78cc, 0xa005, 83 0x00c0, 0x116c, 0x1078, 0x1284, 0x1078, 0x1196, 0x78cc, 0xa005,
84 0x00c0, 0x117a, 0x1078, 0x1ce3, 0x0010, 0x1180, 0x0068, 0x1180, 84 0x00c0, 0x117a, 0x1078, 0x1d4f, 0x0010, 0x1180, 0x0068, 0x1180,
85 0x1078, 0x20e9, 0x0010, 0x1180, 0x0068, 0x1180, 0x1078, 0x1a48, 85 0x1078, 0x2186, 0x0010, 0x1180, 0x0068, 0x1180, 0x1078, 0x1ab9,
86 0x00e0, 0x116c, 0x1078, 0x4ba9, 0x0078, 0x116c, 0x118e, 0x1190, 86 0x00e0, 0x116c, 0x1078, 0x4cba, 0x0078, 0x116c, 0x118e, 0x1190,
87 0x240b, 0x240b, 0x48ad, 0x48ad, 0x240b, 0x240b, 0x0078, 0x118e, 87 0x24ac, 0x24ac, 0x49be, 0x49be, 0x24ac, 0x24ac, 0x0078, 0x118e,
88 0x0078, 0x1190, 0x0078, 0x1192, 0x0078, 0x1194, 0x0068, 0x1201, 88 0x0078, 0x1190, 0x0078, 0x1192, 0x0078, 0x1194, 0x0068, 0x1201,
89 0x2061, 0x0000, 0x6018, 0xa084, 0x0001, 0x00c0, 0x1201, 0x7814, 89 0x2061, 0x0000, 0x6018, 0xa084, 0x0001, 0x00c0, 0x1201, 0x7814,
90 0xa005, 0x00c0, 0x11a7, 0x0010, 0x1202, 0x0078, 0x1201, 0x2009, 90 0xa005, 0x00c0, 0x11a7, 0x0010, 0x1202, 0x0078, 0x1201, 0x2009,
91 0x515b, 0x2104, 0xa005, 0x00c0, 0x1201, 0x2009, 0x5164, 0x200b, 91 0x525b, 0x2104, 0xa005, 0x00c0, 0x1201, 0x2009, 0x5264, 0x200b,
92 0x0000, 0x7914, 0xa186, 0x0042, 0x00c0, 0x11cc, 0x7816, 0x2009, 92 0x0000, 0x7914, 0xa186, 0x0042, 0x00c0, 0x11cc, 0x7816, 0x2009,
93 0x5162, 0x2164, 0x200b, 0x0000, 0x6018, 0x70c6, 0x6014, 0x70ca, 93 0x5262, 0x2164, 0x200b, 0x0000, 0x6018, 0x70c6, 0x6014, 0x70ca,
94 0x611c, 0xa18c, 0xff00, 0x6020, 0xa084, 0x00ff, 0xa105, 0x70ce, 94 0x611c, 0xa18c, 0xff00, 0x6020, 0xa084, 0x00ff, 0xa105, 0x70ce,
95 0x1078, 0x1948, 0x0078, 0x11ff, 0x7814, 0xa086, 0x0018, 0x00c0, 95 0x1078, 0x199a, 0x0078, 0x11ff, 0x7814, 0xa086, 0x0018, 0x00c0,
96 0x11d3, 0x1078, 0x165a, 0x7817, 0x0000, 0x2009, 0x5162, 0x2104, 96 0x11d3, 0x1078, 0x1678, 0x7817, 0x0000, 0x2009, 0x5262, 0x2104,
97 0xa065, 0x0040, 0x11ef, 0x0c7e, 0x609c, 0x2060, 0x1078, 0x19b3, 97 0xa065, 0x0040, 0x11ef, 0x0c7e, 0x609c, 0x2060, 0x1078, 0x1a17,
98 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1730, 0x2009, 0x000c, 0x6007, 98 0x0c7f, 0x609f, 0x0000, 0x1078, 0x174e, 0x2009, 0x000c, 0x6007,
99 0x0103, 0x1078, 0x1924, 0x00c0, 0x11fb, 0x1078, 0x1948, 0x2009, 99 0x0103, 0x1078, 0x1976, 0x00c0, 0x11fb, 0x1078, 0x199a, 0x2009,
100 0x5162, 0x200b, 0x0000, 0x2009, 0x515c, 0x2104, 0x200b, 0x0000, 100 0x5262, 0x200b, 0x0000, 0x2009, 0x525c, 0x2104, 0x200b, 0x0000,
101 0xa005, 0x0040, 0x11ff, 0x2001, 0x4005, 0x0078, 0x1286, 0x0078, 101 0xa005, 0x0040, 0x11ff, 0x2001, 0x4005, 0x0078, 0x1286, 0x0078,
102 0x1284, 0x007c, 0x70c3, 0x0000, 0x70c7, 0x0000, 0x70cb, 0x0000, 102 0x1284, 0x007c, 0x70c3, 0x0000, 0x70c7, 0x0000, 0x70cb, 0x0000,
103 0x70cf, 0x0000, 0x70c0, 0xa0bc, 0xffc0, 0x00c0, 0x1252, 0x2038, 103 0x70cf, 0x0000, 0x70c0, 0xa0bc, 0xffc0, 0x00c0, 0x1252, 0x2038,
104 0x0079, 0x1212, 0x1284, 0x12e5, 0x12a9, 0x12fe, 0x130d, 0x1313, 104 0x0079, 0x1212, 0x1284, 0x12e5, 0x12a9, 0x12fe, 0x130d, 0x1313,
105 0x12a0, 0x1748, 0x1317, 0x1298, 0x12ad, 0x12af, 0x12b1, 0x12b3, 105 0x12a0, 0x1766, 0x1317, 0x1298, 0x12ad, 0x12af, 0x12b1, 0x12b3,
106 0x174d, 0x1298, 0x1329, 0x1360, 0x1672, 0x1742, 0x12b5, 0x1591, 106 0x176b, 0x1298, 0x1329, 0x1365, 0x1690, 0x1760, 0x12b5, 0x15af,
107 0x15ad, 0x15c9, 0x15f4, 0x154a, 0x1558, 0x156c, 0x1580, 0x13df, 107 0x15cb, 0x15e7, 0x1612, 0x1568, 0x1576, 0x158a, 0x159e, 0x13e9,
108 0x1298, 0x138d, 0x1393, 0x1398, 0x139d, 0x13a3, 0x13a8, 0x13ad, 108 0x1298, 0x1397, 0x139d, 0x13a2, 0x13a7, 0x13ad, 0x13b2, 0x13b7,
109 0x13b2, 0x13b7, 0x13bb, 0x13d0, 0x13dc, 0x1298, 0x1298, 0x1298, 109 0x13bc, 0x13c1, 0x13c5, 0x13da, 0x13e6, 0x1298, 0x1298, 0x1298,
110 0x1298, 0x13eb, 0x13f4, 0x1403, 0x1429, 0x1433, 0x143a, 0x1480, 110 0x1298, 0x13f5, 0x13fe, 0x140d, 0x1451, 0x145b, 0x1462, 0x14a8,
111 0x148f, 0x149e, 0x14b0, 0x152a, 0x153a, 0x1298, 0x1298, 0x1298, 111 0x14b7, 0x14c6, 0x14d8, 0x1548, 0x1558, 0x1298, 0x1298, 0x1298,
112 0x1298, 0x153f, 0xa0bc, 0xffa0, 0x00c0, 0x1298, 0x2038, 0xa084, 112 0x1298, 0x155d, 0xa0bc, 0xffa0, 0x00c0, 0x1298, 0x2038, 0xa084,
113 0x001f, 0x0079, 0x125b, 0x1786, 0x1789, 0x1799, 0x1298, 0x1298, 113 0x001f, 0x0079, 0x125b, 0x17a4, 0x17a7, 0x17b7, 0x1298, 0x1298,
114 0x18df, 0x18fc, 0x1298, 0x1298, 0x1298, 0x1900, 0x1908, 0x1298, 114 0x1931, 0x194e, 0x1298, 0x1298, 0x1298, 0x1952, 0x195a, 0x1298,
115 0x1298, 0x1298, 0x1298, 0x12db, 0x12f4, 0x131f, 0x1356, 0x1668, 115 0x1298, 0x1298, 0x1298, 0x12db, 0x12f4, 0x131f, 0x135b, 0x1686,
116 0x1764, 0x1778, 0x1298, 0x1829, 0x190e, 0x18bb, 0x18c5, 0x18c9, 116 0x1782, 0x1796, 0x1298, 0x1847, 0x1960, 0x190d, 0x1917, 0x191b,
117 0x18d7, 0x1298, 0x1298, 0x72ca, 0x71c6, 0x2001, 0x4006, 0x0078, 117 0x1929, 0x1298, 0x1298, 0x72ca, 0x71c6, 0x2001, 0x4006, 0x0078,
118 0x1286, 0x73ce, 0x72ca, 0x71c6, 0x2001, 0x4000, 0x70c2, 0x0068, 118 0x1286, 0x73ce, 0x72ca, 0x71c6, 0x2001, 0x4000, 0x70c2, 0x0068,
119 0x1287, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x5000, 0x00e0, 119 0x1287, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x5000, 0x00e0,
120 0x128f, 0x00e0, 0x1291, 0x0068, 0x1291, 0x2091, 0x4080, 0x007c, 120 0x128f, 0x00e0, 0x1291, 0x0068, 0x1291, 0x2091, 0x4080, 0x007c,
@@ -126,1974 +126,2005 @@ static unsigned short risc_code01[] = {
126 0x0007, 0x3f00, 0x70d6, 0x2079, 0x0000, 0x781b, 0x0001, 0x2031, 126 0x0007, 0x3f00, 0x70d6, 0x2079, 0x0000, 0x781b, 0x0001, 0x2031,
127 0x0030, 0x2059, 0x1000, 0x2029, 0x0457, 0x2051, 0x0470, 0x2061, 127 0x0030, 0x2059, 0x1000, 0x2029, 0x0457, 0x2051, 0x0470, 0x2061,
128 0x0472, 0x20b9, 0xffff, 0x20c1, 0x0000, 0x2091, 0x5000, 0x2091, 128 0x0472, 0x20b9, 0xffff, 0x20c1, 0x0000, 0x2091, 0x5000, 0x2091,
129 0x4080, 0x0078, 0x0455, 0x1078, 0x1b53, 0x00c0, 0x129c, 0x75d8, 129 0x4080, 0x0078, 0x0455, 0x1078, 0x1bc4, 0x00c0, 0x129c, 0x75d8,
130 0x74dc, 0x75da, 0x74de, 0x0078, 0x12e8, 0x2029, 0x0000, 0x2520, 130 0x74dc, 0x75da, 0x74de, 0x0078, 0x12e8, 0x2029, 0x0000, 0x2520,
131 0x71d0, 0x73c8, 0x72cc, 0x70c4, 0x1078, 0x1a8d, 0x0040, 0x1284, 131 0x71d0, 0x73c8, 0x72cc, 0x70c4, 0x1078, 0x1afe, 0x0040, 0x1284,
132 0x70c3, 0x4002, 0x0078, 0x1284, 0x1078, 0x1b53, 0x00c0, 0x129c, 132 0x70c3, 0x4002, 0x0078, 0x1284, 0x1078, 0x1bc4, 0x00c0, 0x129c,
133 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x1301, 0x2029, 0x0000, 133 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x1301, 0x2029, 0x0000,
134 0x2520, 0x71d0, 0x73c8, 0x72cc, 0x70c4, 0x1078, 0x1aed, 0x0040, 134 0x2520, 0x71d0, 0x73c8, 0x72cc, 0x70c4, 0x1078, 0x1b5e, 0x0040,
135 0x1284, 0x70c3, 0x4002, 0x0078, 0x1284, 0x71c4, 0x70c8, 0x2114, 135 0x1284, 0x70c3, 0x4002, 0x0078, 0x1284, 0x71c4, 0x70c8, 0x2114,
136 0x200a, 0x0078, 0x1282, 0x71c4, 0x2114, 0x0078, 0x1282, 0x70c7, 136 0x200a, 0x0078, 0x1282, 0x71c4, 0x2114, 0x0078, 0x1282, 0x70c7,
137 0x0007, 0x70cb, 0x0041, 0x70cf, 0x0000, 0x0078, 0x1284, 0x1078, 137 0x0007, 0x70cb, 0x0041, 0x70cf, 0x0006, 0x0078, 0x1284, 0x1078,
138 0x1b53, 0x00c0, 0x129c, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078, 138 0x1bc4, 0x00c0, 0x129c, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078,
139 0x132c, 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d0, 139 0x132c, 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d0,
140 0x70c6, 0x72ca, 0x73ce, 0x74d2, 0xa005, 0x0040, 0x1350, 0x8001, 140 0x70c6, 0x72ca, 0x73ce, 0x74d2, 0xa005, 0x0040, 0x1355, 0xa40a,
141 0x7892, 0xa084, 0xfc00, 0x0040, 0x1345, 0x78cc, 0xa085, 0x0001, 141 0x0040, 0x133c, 0x00c8, 0x1346, 0x8001, 0x7892, 0xa084, 0xfc00,
142 0x78ce, 0x2001, 0x4005, 0x0078, 0x1286, 0x7a9a, 0x7b9e, 0x7da2, 142 0x0040, 0x134a, 0x78cc, 0xa085, 0x0001, 0x78ce, 0x2001, 0x4005,
143 0x7ea6, 0x7c96, 0x78cc, 0xa084, 0xfffc, 0x78ce, 0x0078, 0x1354, 143 0x0078, 0x1286, 0x7a9a, 0x7b9e, 0x7da2, 0x7ea6, 0x7c96, 0x78cc,
144 0x78cc, 0xa085, 0x0001, 0x78ce, 0x0078, 0x1284, 0x1078, 0x1b53, 144 0xa084, 0xfffc, 0x78ce, 0x0078, 0x1359, 0x78cc, 0xa085, 0x0001,
145 0x00c0, 0x129c, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078, 0x1363, 145 0x78ce, 0x0078, 0x1284, 0x1078, 0x1bc4, 0x00c0, 0x129c, 0x75d8,
146 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d4, 0x70c6, 146 0x76dc, 0x75da, 0x76de, 0x0078, 0x1368, 0x2029, 0x0000, 0x2530,
147 0x72ca, 0x73ce, 0x74d6, 0xa005, 0x0040, 0x1387, 0x8001, 0x78ae, 147 0x70c4, 0x72c8, 0x73cc, 0x74d4, 0x70c6, 0x72ca, 0x73ce, 0x74d6,
148 0xa084, 0xfc00, 0x0040, 0x137c, 0x78cc, 0xa085, 0x0100, 0x78ce, 148 0xa005, 0x0040, 0x1391, 0xa40a, 0x0040, 0x1378, 0x00c8, 0x1382,
149 0x2001, 0x4005, 0x0078, 0x1286, 0x7ab6, 0x7bba, 0x7dbe, 0x7ec2, 149 0x8001, 0x78ae, 0xa084, 0xfc00, 0x0040, 0x1386, 0x78cc, 0xa085,
150 0x7cb2, 0x78cc, 0xa084, 0xfcff, 0x78ce, 0x0078, 0x138b, 0x78cc, 150 0x0100, 0x78ce, 0x2001, 0x4005, 0x0078, 0x1286, 0x7ab6, 0x7bba,
151 0xa085, 0x0100, 0x78ce, 0x0078, 0x1284, 0x2009, 0x5161, 0x210c, 151 0x7dbe, 0x7ec2, 0x7cb2, 0x78cc, 0xa084, 0xfcff, 0x78ce, 0x0078,
152 0x7aec, 0x0078, 0x1282, 0x2009, 0x5141, 0x210c, 0x0078, 0x1283, 152 0x1395, 0x78cc, 0xa085, 0x0100, 0x78ce, 0x0078, 0x1284, 0x2009,
153 0x2009, 0x5142, 0x210c, 0x0078, 0x1283, 0x2061, 0x5140, 0x610c, 153 0x5261, 0x210c, 0x7aec, 0x0078, 0x1282, 0x2009, 0x5241, 0x210c,
154 0x6210, 0x0078, 0x1282, 0x2009, 0x5145, 0x210c, 0x0078, 0x1283, 154 0x0078, 0x1283, 0x2009, 0x5242, 0x210c, 0x0078, 0x1283, 0x2061,
155 0x2009, 0x5146, 0x210c, 0x0078, 0x1283, 0x2009, 0x5148, 0x210c, 155 0x5240, 0x610c, 0x6210, 0x0078, 0x1282, 0x2009, 0x5245, 0x210c,
156 0x0078, 0x1283, 0x2009, 0x5149, 0x210c, 0x0078, 0x1283, 0x7908, 156 0x0078, 0x1283, 0x2009, 0x5246, 0x210c, 0x0078, 0x1283, 0x2009,
157 0x7a0c, 0x0078, 0x1282, 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003, 157 0x5248, 0x210c, 0x0078, 0x1283, 0x2009, 0x5249, 0x210c, 0x0078,
158 0x8003, 0x8003, 0xa0e8, 0x5380, 0x6a00, 0x6804, 0xa084, 0x0008, 158 0x1283, 0x7908, 0x7a0c, 0x0078, 0x1282, 0x71c4, 0x8107, 0xa084,
159 0x0040, 0x13cd, 0x6b08, 0x0078, 0x13ce, 0x6b0c, 0x0078, 0x1281, 159 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e8, 0x5480, 0x6a00, 0x6804,
160 0x77c4, 0x1078, 0x1973, 0x2091, 0x8000, 0x6b1c, 0x6a14, 0x2091, 160 0xa084, 0x0008, 0x0040, 0x13d7, 0x6b08, 0x0078, 0x13d8, 0x6b0c,
161 0x8001, 0x2708, 0x0078, 0x1281, 0x794c, 0x0078, 0x1283, 0x77c4, 161 0x0078, 0x1281, 0x77c4, 0x1078, 0x19c5, 0x2091, 0x8000, 0x6b1c,
162 0x1078, 0x1973, 0x2091, 0x8000, 0x6908, 0x6a18, 0x6b10, 0x2091, 162 0x6a14, 0x2091, 0x8001, 0x2708, 0x0078, 0x1281, 0x794c, 0x0078,
163 0x8001, 0x0078, 0x1281, 0x71c4, 0xa182, 0x0010, 0x00c8, 0x127c, 163 0x1283, 0x77c4, 0x1078, 0x19c5, 0x2091, 0x8000, 0x6908, 0x6a18,
164 0x1078, 0x22e2, 0x0078, 0x1281, 0x71c4, 0xa182, 0x0010, 0x00c8, 164 0x6b10, 0x2091, 0x8001, 0x0078, 0x1281, 0x71c4, 0xa182, 0x0010,
165 0x127c, 0x2011, 0x5141, 0x2204, 0x007e, 0x2112, 0x1078, 0x229b, 165 0x00c8, 0x127c, 0x1078, 0x237f, 0x0078, 0x1281, 0x71c4, 0xa182,
166 0x017f, 0x0078, 0x1283, 0x71c4, 0x2011, 0x1421, 0x20a9, 0x0008, 166 0x0010, 0x00c8, 0x127c, 0x2011, 0x5241, 0x2204, 0x007e, 0x2112,
167 0x2204, 0xa106, 0x0040, 0x1413, 0x8210, 0x0070, 0x1411, 0x0078, 167 0x1078, 0x2338, 0x017f, 0x0078, 0x1283, 0x71c4, 0x2019, 0x0100,
168 0x1408, 0x0078, 0x127c, 0xa292, 0x1421, 0x027e, 0x2011, 0x5142, 168 0x2304, 0xa082, 0x0006, 0x0048, 0x141b, 0x2011, 0x1449, 0x20a9,
169 0x2204, 0x2112, 0x017f, 0x007e, 0x1078, 0x22a7, 0x017f, 0x0078, 169 0x0008, 0x0078, 0x141f, 0x2011, 0x1441, 0x20a9, 0x0008, 0x2204,
170 0xa106, 0x0040, 0x142a, 0x8210, 0x0070, 0x1428, 0x0078, 0x141f,
171 0x0078, 0x127c, 0x2304, 0xa082, 0x0006, 0x0048, 0x1433, 0xa292,
172 0x1449, 0x0078, 0x1435, 0xa292, 0x1441, 0x027e, 0x2011, 0x5242,
173 0x2204, 0x2112, 0x017f, 0x007e, 0x1078, 0x2344, 0x017f, 0x0078,
170 0x1283, 0x03e8, 0x00fa, 0x01f4, 0x02ee, 0x0064, 0x0019, 0x0032, 174 0x1283, 0x03e8, 0x00fa, 0x01f4, 0x02ee, 0x0064, 0x0019, 0x0032,
171 0x004b, 0x2061, 0x5140, 0x610c, 0x6210, 0x70c4, 0x600e, 0x70c8, 175 0x004b, 0x03e8, 0x00fa, 0x01f4, 0x02ee, 0x0004, 0x0001, 0x0002,
172 0x6012, 0x0078, 0x1282, 0x2061, 0x5140, 0x6114, 0x70c4, 0x6016, 176 0x0003, 0x2061, 0x5240, 0x610c, 0x6210, 0x70c4, 0x600e, 0x70c8,
173 0x0078, 0x1283, 0x2061, 0x5140, 0x71c4, 0x2011, 0x0004, 0x601f, 177 0x6012, 0x0078, 0x1282, 0x2061, 0x5240, 0x6114, 0x70c4, 0x6016,
174 0x0019, 0x2019, 0x1212, 0xa186, 0x0028, 0x0040, 0x145b, 0x2011, 178 0x0078, 0x1283, 0x2061, 0x5240, 0x71c4, 0x2011, 0x0004, 0x601f,
179 0x0019, 0x2019, 0x1212, 0xa186, 0x0028, 0x0040, 0x1483, 0x2011,
175 0x0005, 0x601f, 0x0019, 0x2019, 0x1212, 0xa186, 0x0032, 0x0040, 180 0x0005, 0x601f, 0x0019, 0x2019, 0x1212, 0xa186, 0x0032, 0x0040,
176 0x145b, 0x2011, 0x0006, 0x601f, 0x000c, 0x2019, 0x2222, 0xa186, 181 0x1483, 0x2011, 0x0006, 0x601f, 0x000c, 0x2019, 0x2222, 0xa186,
177 0x003c, 0x00c0, 0x127c, 0x6018, 0x007e, 0x611a, 0x7800, 0xa084, 182 0x003c, 0x00c0, 0x127c, 0x6018, 0x007e, 0x611a, 0x7800, 0xa084,
178 0x0001, 0x00c0, 0x1476, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 183 0x0001, 0x00c0, 0x149e, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005,
179 0x0048, 0x146e, 0x0038, 0x1472, 0x0078, 0x1476, 0x0028, 0x1472, 184 0x0048, 0x1496, 0x0038, 0x149a, 0x0078, 0x149e, 0x0028, 0x149a,
180 0x0078, 0x1476, 0x2019, 0x2222, 0x0078, 0x1478, 0x2019, 0x1212, 185 0x0078, 0x149e, 0x2019, 0x2222, 0x0078, 0x14a0, 0x2019, 0x1212,
181 0x23b8, 0x1078, 0x22b8, 0x1078, 0x4d22, 0x017f, 0x0078, 0x1283, 186 0x23b8, 0x1078, 0x2355, 0x1078, 0x4e33, 0x017f, 0x0078, 0x1283,
182 0x71c4, 0xa184, 0xffcf, 0x00c0, 0x127c, 0x2011, 0x5148, 0x2204, 187 0x71c4, 0xa184, 0xffcf, 0x00c0, 0x127c, 0x2011, 0x5248, 0x2204,
183 0x2112, 0x007e, 0x1078, 0x22da, 0x017f, 0x0078, 0x1283, 0x71c4, 188 0x2112, 0x007e, 0x1078, 0x2377, 0x017f, 0x0078, 0x1283, 0x71c4,
184 0xa182, 0x0010, 0x00c8, 0x127c, 0x2011, 0x5149, 0x2204, 0x007e, 189 0xa182, 0x0010, 0x00c8, 0x127c, 0x2011, 0x5249, 0x2204, 0x007e,
185 0x2112, 0x1078, 0x22c9, 0x017f, 0x0078, 0x1283, 0x71c4, 0x72c8, 190 0x2112, 0x1078, 0x2366, 0x017f, 0x0078, 0x1283, 0x71c4, 0x72c8,
186 0xa184, 0xfffd, 0x00c0, 0x127b, 0xa284, 0xfffd, 0x00c0, 0x127b, 191 0xa184, 0xfffd, 0x00c0, 0x127b, 0xa284, 0xfffd, 0x00c0, 0x127b,
187 0x2100, 0x7908, 0x780a, 0x2200, 0x7a0c, 0x780e, 0x0078, 0x1282, 192 0x2100, 0x7908, 0x780a, 0x2200, 0x7a0c, 0x780e, 0x0078, 0x1282,
188 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e8, 193 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e8,
189 0x5380, 0x2019, 0x0000, 0x72c8, 0xa284, 0x0080, 0x0040, 0x14c6, 194 0x5480, 0x2019, 0x0000, 0x72c8, 0xd2bc, 0x0040, 0x14e9, 0xa39d,
190 0x6c14, 0x84ff, 0x00c0, 0x14c6, 0x6817, 0x0040, 0xa284, 0x0040, 195 0x0010, 0xd2b4, 0x0040, 0x14ee, 0xa39d, 0x0008, 0x6800, 0x007e,
191 0x0040, 0x14d0, 0x6c10, 0x84ff, 0x00c0, 0x14d0, 0x6813, 0x0001, 196 0xa226, 0x0040, 0x1511, 0x6a02, 0xa484, 0x2000, 0x0040, 0x14fa,
192 0x6800, 0x007e, 0xa226, 0x0040, 0x14f3, 0x6a02, 0xa484, 0x2000, 197 0xa39d, 0x0010, 0xa484, 0x1000, 0x0040, 0x1500, 0xa39d, 0x0008,
193 0x0040, 0x14dc, 0xa39d, 0x0010, 0xa484, 0x1000, 0x0040, 0x14e2, 198 0xa484, 0x4000, 0x0040, 0x1511, 0x810f, 0xa284, 0x4000, 0x0040,
194 0xa39d, 0x0008, 0xa484, 0x4000, 0x0040, 0x14f3, 0x810f, 0xa284, 199 0x150d, 0x1078, 0x2399, 0x0078, 0x1511, 0x1078, 0x238b, 0x0078,
195 0x4000, 0x0040, 0x14ef, 0x1078, 0x22fc, 0x0078, 0x14f3, 0x1078, 200 0x1511, 0x72cc, 0x6808, 0xa206, 0x0040, 0x1540, 0xa2a4, 0x00ff,
196 0x22ee, 0x0078, 0x14f3, 0x72cc, 0x6808, 0xa206, 0x0040, 0x1522, 201 0x2061, 0x5240, 0x6118, 0xa186, 0x0028, 0x0040, 0x1527, 0xa186,
197 0xa2a4, 0x00ff, 0x2061, 0x5140, 0x6118, 0xa186, 0x0028, 0x0040, 202 0x0032, 0x0040, 0x152d, 0xa186, 0x003c, 0x0040, 0x1533, 0xa482,
198 0x1509, 0xa186, 0x0032, 0x0040, 0x150f, 0xa186, 0x003c, 0x0040, 203 0x0064, 0x0048, 0x153d, 0x0078, 0x1537, 0xa482, 0x0050, 0x0048,
199 0x1515, 0xa482, 0x0064, 0x0048, 0x151f, 0x0078, 0x1519, 0xa482, 204 0x153d, 0x0078, 0x1537, 0xa482, 0x0043, 0x0048, 0x153d, 0x71c4,
200 0x0050, 0x0048, 0x151f, 0x0078, 0x1519, 0xa482, 0x0043, 0x0048, 205 0x71c6, 0x027f, 0x72ca, 0x0078, 0x127d, 0x6a0a, 0xa39d, 0x000a,
201 0x151f, 0x71c4, 0x71c6, 0x027f, 0x72ca, 0x0078, 0x127d, 0x6a0a, 206 0x6804, 0xa305, 0x6806, 0x027f, 0x6b0c, 0x71c4, 0x0078, 0x1281,
202 0xa39d, 0x000a, 0x6804, 0xa305, 0x6806, 0x027f, 0x6b0c, 0x71c4, 207 0x77c4, 0x1078, 0x19c5, 0x2091, 0x8000, 0x6a14, 0x6b1c, 0x2091,
203 0x0078, 0x1281, 0x77c4, 0x1078, 0x1973, 0x2091, 0x8000, 0x6a14, 208 0x8001, 0x70c8, 0x6816, 0x70cc, 0x681e, 0x2708, 0x0078, 0x1281,
204 0x6b1c, 0x2091, 0x8001, 0x70c8, 0x6816, 0x70cc, 0x681e, 0x2708, 209 0x70c4, 0x794c, 0x784e, 0x0078, 0x1283, 0x71c4, 0x72c8, 0x73cc,
205 0x0078, 0x1281, 0x70c4, 0x794c, 0x784e, 0x0078, 0x1283, 0x71c4, 210 0xa182, 0x0010, 0x00c8, 0x127c, 0x1078, 0x23a7, 0x0078, 0x1281,
206 0x72c8, 0x73cc, 0xa182, 0x0010, 0x00c8, 0x127c, 0x1078, 0x230a, 211 0x77c4, 0x1078, 0x19c5, 0x2091, 0x8000, 0x6a08, 0xa295, 0x0002,
207 0x0078, 0x1281, 0x77c4, 0x1078, 0x1973, 0x2091, 0x8000, 0x6a08, 212 0x6a0a, 0x2091, 0x8001, 0x2708, 0x0078, 0x1282, 0x77c4, 0x1078,
208 0xa295, 0x0002, 0x6a0a, 0x2091, 0x8001, 0x2708, 0x0078, 0x1282, 213 0x19c5, 0x2091, 0x8000, 0x6a08, 0xa294, 0xfff9, 0x6a0a, 0x6804,
209 0x77c4, 0x1078, 0x1973, 0x2091, 0x8000, 0x6a08, 0xa294, 0xfff9, 214 0xa005, 0x0040, 0x1585, 0x1078, 0x226f, 0x2091, 0x8001, 0x2708,
210 0x6a0a, 0x6804, 0xa005, 0x0040, 0x1567, 0x1078, 0x21d2, 0x2091, 215 0x0078, 0x1282, 0x77c4, 0x1078, 0x19c5, 0x2091, 0x8000, 0x6a08,
211 0x8001, 0x2708, 0x0078, 0x1282, 0x77c4, 0x1078, 0x1973, 0x2091, 216 0xa295, 0x0004, 0x6a0a, 0x6804, 0xa005, 0x0040, 0x1599, 0x1078,
212 0x8000, 0x6a08, 0xa295, 0x0004, 0x6a0a, 0x6804, 0xa005, 0x0040, 217 0x226f, 0x2091, 0x8001, 0x2708, 0x0078, 0x1282, 0x77c4, 0x2041,
213 0x157b, 0x1078, 0x21d2, 0x2091, 0x8001, 0x2708, 0x0078, 0x1282, 218 0x0001, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 0x1078,
214 0x77c4, 0x2041, 0x0001, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, 219 0x19d2, 0x2091, 0x8001, 0x2708, 0x6a08, 0x0078, 0x1282, 0x77c4,
215 0x8000, 0x1078, 0x1980, 0x2091, 0x8001, 0x2708, 0x6a08, 0x0078, 220 0x72c8, 0x73cc, 0x77c6, 0x72ca, 0x73ce, 0x1078, 0x1a52, 0x00c0,
216 0x1282, 0x77c4, 0x72c8, 0x73cc, 0x77c6, 0x72ca, 0x73ce, 0x1078, 221 0x15c7, 0x6818, 0xa005, 0x0040, 0x15c7, 0x2708, 0x1078, 0x23b7,
217 0x19e1, 0x00c0, 0x15a9, 0x6818, 0xa005, 0x0040, 0x15a9, 0x2708, 222 0x00c0, 0x15c7, 0x7817, 0x0015, 0x2091, 0x8001, 0x007c, 0x2091,
218 0x1078, 0x231a, 0x00c0, 0x15a9, 0x7817, 0x0015, 0x2091, 0x8001, 223 0x8001, 0x0078, 0x1284, 0x77c4, 0x77c6, 0x2041, 0x0021, 0x2049,
219 0x007c, 0x2091, 0x8001, 0x0078, 0x1284, 0x77c4, 0x77c6, 0x2041, 224 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 0x1078, 0x19d2, 0x2061,
220 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 0x1078, 225 0x5240, 0x606f, 0x0003, 0x6782, 0x6093, 0x000f, 0x6073, 0x0000,
221 0x1980, 0x2061, 0x5140, 0x606f, 0x0003, 0x6782, 0x6093, 0x000f, 226 0x7817, 0x0016, 0x1078, 0x226f, 0x2091, 0x8001, 0x007c, 0x77c8,
222 0x6073, 0x0000, 0x7817, 0x0016, 0x1078, 0x21d2, 0x2091, 0x8001, 227 0x77ca, 0x77c4, 0x77c6, 0xa7bc, 0xff00, 0x2091, 0x8000, 0x2061,
223 0x007c, 0x77c8, 0x77ca, 0x77c4, 0x77c6, 0xa7bc, 0xff00, 0x2091, 228 0x5240, 0x606f, 0x0002, 0x6073, 0x0000, 0x6782, 0x6093, 0x000f,
224 0x8000, 0x2061, 0x5140, 0x606f, 0x0002, 0x6073, 0x0000, 0x6782, 229 0x7817, 0x0017, 0x1078, 0x226f, 0x2091, 0x8001, 0x2041, 0x0021,
225 0x6093, 0x000f, 0x7817, 0x0017, 0x1078, 0x21d2, 0x2091, 0x8001, 230 0x2049, 0x0004, 0x2051, 0x0010, 0x2091, 0x8000, 0x1078, 0x19d2,
226 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0010, 0x2091, 0x8000, 231 0x70c8, 0x6836, 0x8738, 0xa784, 0x001f, 0x00c0, 0x1606, 0x2091,
227 0x1078, 0x1980, 0x70c8, 0x6836, 0x8738, 0xa784, 0x001f, 0x00c0, 232 0x8001, 0x007c, 0x78cc, 0xa084, 0x0003, 0x00c0, 0x1636, 0x2039,
228 0x15e8, 0x2091, 0x8001, 0x007c, 0x78cc, 0xa084, 0x0003, 0x00c0, 233 0x0000, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 0x1078,
229 0x1618, 0x2039, 0x0000, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 234 0x19c5, 0x2091, 0x8000, 0x6808, 0xa80d, 0x690a, 0x2091, 0x8001,
230 0x0008, 0x1078, 0x1973, 0x2091, 0x8000, 0x6808, 0xa80d, 0x690a, 235 0x8738, 0xa784, 0x001f, 0x00c0, 0x161f, 0xa7bc, 0xff00, 0x873f,
231 0x2091, 0x8001, 0x8738, 0xa784, 0x001f, 0x00c0, 0x1601, 0xa7bc, 236 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0, 0x161f, 0x2091, 0x8000,
232 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0, 0x1601, 237 0x2069, 0x0100, 0x6830, 0xa084, 0x0040, 0x0040, 0x165f, 0x684b,
233 0x2091, 0x8000, 0x2069, 0x0100, 0x6830, 0xa084, 0x0040, 0x0040, 238 0x0004, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0004, 0x0040, 0x164c,
234 0x1641, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0004, 239 0x0070, 0x164c, 0x0078, 0x1643, 0x684b, 0x0009, 0x20a9, 0x0014,
235 0x0040, 0x162e, 0x0070, 0x162e, 0x0078, 0x1625, 0x684b, 0x0009, 240 0x6848, 0xa084, 0x0001, 0x0040, 0x1659, 0x0070, 0x1659, 0x0078,
236 0x20a9, 0x0014, 0x6848, 0xa084, 0x0001, 0x0040, 0x163b, 0x0070, 241 0x1650, 0x20a9, 0x00fa, 0x0070, 0x165f, 0x0078, 0x165b, 0x2079,
237 0x163b, 0x0078, 0x1632, 0x20a9, 0x00fa, 0x0070, 0x1641, 0x0078, 242 0x5200, 0x7817, 0x0018, 0x2061, 0x5240, 0x606f, 0x0001, 0x6073,
238 0x163d, 0x2079, 0x5100, 0x7817, 0x0018, 0x2061, 0x5140, 0x606f, 243 0x0000, 0x6093, 0x000f, 0x78cc, 0xa085, 0x0002, 0x78ce, 0x6808,
239 0x0001, 0x6073, 0x0000, 0x6093, 0x000f, 0x78cc, 0xa085, 0x0002, 244 0xa084, 0xfffd, 0x680a, 0x681b, 0x0048, 0x2091, 0x8001, 0x007c,
240 0x78ce, 0x6808, 0xa084, 0xfffd, 0x680a, 0x681b, 0x0048, 0x2091, 245 0x78cc, 0xa084, 0xfffd, 0x78ce, 0xa084, 0x0001, 0x00c0, 0x1682,
241 0x8001, 0x007c, 0x78cc, 0xa084, 0xfffd, 0x78ce, 0xa084, 0x0001, 246 0x1078, 0x1a9c, 0x71c4, 0x71c6, 0x794a, 0x007c, 0x1078, 0x1bc4,
242 0x00c0, 0x1664, 0x1078, 0x1a2b, 0x71c4, 0x71c6, 0x794a, 0x007c, 247 0x00c0, 0x129c, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x1693,
243 0x1078, 0x1b53, 0x00c0, 0x129c, 0x75d8, 0x74dc, 0x75da, 0x74de, 248 0x2029, 0x0000, 0x2520, 0x71c4, 0x73c8, 0x72cc, 0x71c6, 0x73ca,
244 0x0078, 0x1675, 0x2029, 0x0000, 0x2520, 0x71c4, 0x73c8, 0x72cc, 249 0x72ce, 0x2079, 0x5200, 0x2091, 0x8000, 0x1078, 0x1980, 0x2091,
245 0x71c6, 0x73ca, 0x72ce, 0x2079, 0x5100, 0x2091, 0x8000, 0x1078, 250 0x8001, 0x0040, 0x174a, 0x20a9, 0x0005, 0x20a1, 0x5218, 0x2091,
246 0x192e, 0x2091, 0x8001, 0x0040, 0x172c, 0x20a9, 0x0005, 0x20a1, 251 0x8000, 0x41a1, 0x2091, 0x8001, 0x2009, 0x0020, 0x1078, 0x197b,
247 0x5118, 0x2091, 0x8000, 0x41a1, 0x2091, 0x8001, 0x2009, 0x0020, 252 0x0040, 0x16b6, 0x1078, 0x199a, 0x0078, 0x174a, 0x6004, 0xa084,
248 0x1078, 0x1929, 0x0040, 0x1698, 0x1078, 0x1948, 0x0078, 0x172c, 253 0xff00, 0x8007, 0x8009, 0x0040, 0x1719, 0x0c7e, 0x2c68, 0x2091,
249 0x6004, 0xa084, 0xff00, 0x8007, 0x8009, 0x0040, 0x16fb, 0x0c7e, 254 0x8000, 0x1078, 0x1980, 0x2091, 0x8001, 0x0040, 0x16ea, 0x2c00,
250 0x2c68, 0x2091, 0x8000, 0x1078, 0x192e, 0x2091, 0x8001, 0x0040, 255 0x689e, 0x8109, 0x00c0, 0x16be, 0x609f, 0x0000, 0x0c7f, 0x0c7e,
251 0x16cc, 0x2c00, 0x689e, 0x8109, 0x00c0, 0x16a0, 0x609f, 0x0000, 256 0x7218, 0x731c, 0x7420, 0x7524, 0x2c68, 0x689c, 0xa065, 0x0040,
252 0x0c7f, 0x0c7e, 0x7218, 0x731c, 0x7420, 0x7524, 0x2c68, 0x689c, 257 0x1718, 0x2009, 0x0020, 0x1078, 0x197b, 0x00c0, 0x1701, 0x6004,
253 0xa065, 0x0040, 0x16fa, 0x2009, 0x0020, 0x1078, 0x1929, 0x00c0, 258 0xa084, 0x00ff, 0xa086, 0x0002, 0x00c0, 0x16ea, 0x2d00, 0x6002,
254 0x16e3, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0002, 0x00c0, 0x16cc, 259 0x0078, 0x16d0, 0x0c7f, 0x0c7e, 0x609c, 0x2060, 0x1078, 0x1a17,
255 0x2d00, 0x6002, 0x0078, 0x16b2, 0x0c7f, 0x0c7e, 0x609c, 0x2060, 260 0x0c7f, 0x609f, 0x0000, 0x1078, 0x174e, 0x2009, 0x000c, 0x6008,
256 0x1078, 0x19b3, 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1730, 0x2009, 261 0xa085, 0x0200, 0x600a, 0x1078, 0x1976, 0x1078, 0x199a, 0x0078,
257 0x000c, 0x6008, 0xa085, 0x0200, 0x600a, 0x1078, 0x1924, 0x1078, 262 0x174a, 0x0c7f, 0x0c7e, 0x609c, 0x2060, 0x1078, 0x1a17, 0x0c7f,
258 0x1948, 0x0078, 0x172c, 0x0c7f, 0x0c7e, 0x609c, 0x2060, 0x1078, 263 0x609f, 0x0000, 0x1078, 0x174e, 0x2009, 0x000c, 0x6007, 0x0103,
259 0x19b3, 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1730, 0x2009, 0x000c, 264 0x601b, 0x0003, 0x1078, 0x1976, 0x1078, 0x199a, 0x0078, 0x174a,
260 0x6007, 0x0103, 0x601b, 0x0003, 0x1078, 0x1924, 0x1078, 0x1948, 265 0x0c7f, 0x74c4, 0x73c8, 0x72cc, 0x6014, 0x2091, 0x8000, 0x7817,
261 0x0078, 0x172c, 0x0c7f, 0x74c4, 0x73c8, 0x72cc, 0x6014, 0x2091, 266 0x0012, 0x0e7e, 0x2071, 0x5240, 0x706f, 0x0005, 0x7073, 0x0000,
262 0x8000, 0x7817, 0x0012, 0x0e7e, 0x2071, 0x5140, 0x706f, 0x0005, 267 0x7376, 0x727a, 0x747e, 0x7082, 0x7087, 0x0000, 0x2c00, 0x708a,
263 0x7073, 0x0000, 0x7376, 0x727a, 0x747e, 0x7082, 0x7087, 0x0000, 268 0x708f, 0x0000, 0xa02e, 0x2530, 0x611c, 0x61a2, 0xa184, 0x0060,
264 0x2c00, 0x708a, 0x708f, 0x0000, 0xa02e, 0x2530, 0x611c, 0x61a2, 269 0x0040, 0x173c, 0x1078, 0x48d3, 0x0e7f, 0x6596, 0x65a6, 0x669a,
265 0xa184, 0x0060, 0x0040, 0x171e, 0x1078, 0x47c2, 0x0e7f, 0x6596, 270 0x66aa, 0x60af, 0x0000, 0x60b3, 0x0000, 0x1078, 0x226f, 0x2091,
266 0x65a6, 0x669a, 0x66aa, 0x60af, 0x0000, 0x60b3, 0x0000, 0x1078, 271 0x8001, 0x007c, 0x70c3, 0x4005, 0x0078, 0x1287, 0x20a9, 0x0005,
267 0x21d2, 0x2091, 0x8001, 0x007c, 0x70c3, 0x4005, 0x0078, 0x1287, 272 0x2099, 0x5218, 0x2091, 0x8000, 0x530a, 0x2091, 0x8001, 0x2100,
268 0x20a9, 0x0005, 0x2099, 0x5118, 0x2091, 0x8000, 0x530a, 0x2091, 273 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x007c,
269 0x8001, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 274 0x71c4, 0x70c7, 0x0000, 0x7906, 0x0078, 0x1284, 0x71c4, 0x71c6,
270 0x0000, 0x007c, 0x71c4, 0x70c7, 0x0000, 0x7906, 0x0078, 0x1284, 275 0x2168, 0x0078, 0x176d, 0x2069, 0x1000, 0x690c, 0xa016, 0x2d04,
271 0x71c4, 0x71c6, 0x2168, 0x0078, 0x174f, 0x2069, 0x1000, 0x690c, 276 0xa210, 0x8d68, 0x8109, 0x00c0, 0x176f, 0xa285, 0x0000, 0x00c0,
272 0xa016, 0x2d04, 0xa210, 0x8d68, 0x8109, 0x00c0, 0x1751, 0xa285, 277 0x177d, 0x70c3, 0x4000, 0x0078, 0x177f, 0x70c3, 0x4003, 0x70ca,
273 0x0000, 0x00c0, 0x175f, 0x70c3, 0x4000, 0x0078, 0x1761, 0x70c3, 278 0x0078, 0x1287, 0x2011, 0x5267, 0x220c, 0x70c4, 0x8003, 0x0048,
274 0x4003, 0x70ca, 0x0078, 0x1287, 0x2011, 0x5167, 0x220c, 0x70c4, 279 0x178f, 0x1078, 0x3c51, 0xa184, 0x7fff, 0x0078, 0x1793, 0x1078,
275 0x8003, 0x0048, 0x1771, 0x1078, 0x3b7f, 0xa184, 0x7fff, 0x0078, 280 0x3c44, 0xa185, 0x8000, 0x2012, 0x0078, 0x1283, 0x71c4, 0x1078,
276 0x1775, 0x1078, 0x3b72, 0xa185, 0x8000, 0x2012, 0x0078, 0x1283, 281 0x3c3b, 0x6100, 0x2001, 0x5267, 0x2004, 0xa084, 0x8000, 0xa10d,
277 0x71c4, 0x1078, 0x3b69, 0x6100, 0x2001, 0x5167, 0x2004, 0xa084, 282 0x6204, 0x6308, 0x0078, 0x1281, 0x79e4, 0x0078, 0x1283, 0x71c4,
278 0x8000, 0xa10d, 0x6204, 0x6308, 0x0078, 0x1281, 0x79e4, 0x0078, 283 0x71c6, 0x2198, 0x20a1, 0x0042, 0x20a9, 0x0004, 0x53a3, 0x21a0,
279 0x1283, 0x71c4, 0x71c6, 0x2198, 0x20a1, 0x0042, 0x20a9, 0x0004, 284 0x2099, 0x0042, 0x20a9, 0x0004, 0x53a3, 0x0078, 0x1284, 0x70c4,
280 0x53a3, 0x21a0, 0x2099, 0x0042, 0x20a9, 0x0004, 0x53a3, 0x0078, 285 0x2068, 0x2079, 0x5200, 0x2091, 0x8000, 0x1078, 0x1980, 0x2091,
281 0x1284, 0x70c4, 0x2068, 0x2079, 0x5100, 0x2091, 0x8000, 0x1078, 286 0x8001, 0x0040, 0x1843, 0x6007, 0x0001, 0x600b, 0x0000, 0x602b,
282 0x192e, 0x2091, 0x8001, 0x0040, 0x1825, 0x6007, 0x0001, 0x600b, 287 0x0000, 0x601b, 0x0006, 0x6a10, 0xa28c, 0x000f, 0xa284, 0x00f0,
283 0x0000, 0x602b, 0x0000, 0x601b, 0x0006, 0x6a10, 0xa28c, 0x000f, 288 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0x6016, 0xa284, 0x0800,
284 0xa284, 0x00f0, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0x6016, 289 0x0040, 0x17de, 0x601b, 0x000a, 0x0078, 0x17e4, 0xa284, 0x1000,
285 0xa284, 0x0800, 0x0040, 0x17c0, 0x601b, 0x000a, 0x0078, 0x17c6, 290 0x0040, 0x17e4, 0x601b, 0x000c, 0xa284, 0x0300, 0x0040, 0x17ed,
286 0xa284, 0x1000, 0x0040, 0x17c6, 0x601b, 0x000c, 0xa284, 0x0300, 291 0x602b, 0x0001, 0x8004, 0x8004, 0x8004, 0xa085, 0x0001, 0x601e,
287 0x0040, 0x17cf, 0x602b, 0x0001, 0x8004, 0x8004, 0x8004, 0xa085, 292 0x6023, 0x0000, 0x6027, 0x0000, 0xa284, 0x0400, 0x0040, 0x17fa,
288 0x0001, 0x601e, 0x6023, 0x0000, 0x6027, 0x0000, 0xa284, 0x0400, 293 0x602b, 0x0000, 0x20a9, 0x0006, 0xac80, 0x000b, 0x20a0, 0xad80,
289 0x0040, 0x17dc, 0x602b, 0x0000, 0x20a9, 0x0006, 0xac80, 0x000b, 294 0x0005, 0x2098, 0x53a3, 0xa284, 0x0300, 0x00c0, 0x180f, 0x6046,
290 0x20a0, 0xad80, 0x0005, 0x2098, 0x53a3, 0xa284, 0x0300, 0x00c0, 295 0x604a, 0x604e, 0x6052, 0x6096, 0x609a, 0x0078, 0x1819, 0x6800,
291 0x17f1, 0x6046, 0x604a, 0x604e, 0x6052, 0x6096, 0x609a, 0x0078, 296 0x6046, 0x6804, 0x604a, 0x6e08, 0x664e, 0x6d0c, 0x6552, 0x6596,
292 0x17fb, 0x6800, 0x6046, 0x6804, 0x604a, 0x6e08, 0x664e, 0x6d0c, 297 0x669a, 0x6014, 0x2091, 0x8000, 0x7817, 0x0042, 0x2c08, 0x2061,
293 0x6552, 0x6596, 0x669a, 0x6014, 0x2091, 0x8000, 0x7817, 0x0042, 298 0x5240, 0x606f, 0x0005, 0x6073, 0x0000, 0x6077, 0x0000, 0x607b,
294 0x2c08, 0x2061, 0x5140, 0x606f, 0x0005, 0x6073, 0x0000, 0x6077, 299 0x0000, 0x607f, 0x0000, 0x6082, 0x618a, 0xa284, 0x0400, 0x608e,
295 0x0000, 0x607b, 0x0000, 0x607f, 0x0000, 0x6082, 0x618a, 0xa284, 300 0x2091, 0x8001, 0x0e7e, 0x2071, 0x0020, 0x7007, 0x000a, 0x7007,
296 0x0400, 0x608e, 0x2091, 0x8001, 0x0e7e, 0x2071, 0x0020, 0x7007, 301 0x0002, 0x7003, 0x0000, 0x0e7f, 0x2091, 0x8000, 0x1078, 0x226f,
297 0x000a, 0x7007, 0x0002, 0x7003, 0x0000, 0x0e7f, 0x2091, 0x8000, 302 0x2091, 0x8001, 0x007c, 0x70c3, 0x4005, 0x0078, 0x1287, 0x0c7e,
298 0x1078, 0x21d2, 0x2091, 0x8001, 0x007c, 0x70c3, 0x4005, 0x0078, 303 0x0d7e, 0x0e7e, 0x0f7e, 0x2091, 0x8000, 0x2071, 0x5240, 0x2079,
299 0x1287, 0x0c7e, 0x0d7e, 0x0e7e, 0x0f7e, 0x2091, 0x8000, 0x2071, 304 0x0100, 0x2061, 0x0010, 0x70a0, 0xa06d, 0x0040, 0x1903, 0x6a04,
300 0x5140, 0x2079, 0x0100, 0x2061, 0x0010, 0x70a0, 0xa06d, 0x0040, 305 0xa294, 0x00ff, 0xa286, 0x0007, 0x0040, 0x1862, 0xa286, 0x000f,
301 0x18b1, 0x6a04, 0xa294, 0x00ff, 0xa286, 0x0007, 0x0040, 0x1844, 306 0x00c0, 0x1903, 0x691c, 0xa184, 0x00c0, 0x0040, 0x1903, 0xa184,
302 0xa286, 0x000f, 0x00c0, 0x18b1, 0x691c, 0xa184, 0x0080, 0x00c0, 307 0x0080, 0x00c0, 0x18d3, 0x6824, 0xa084, 0xff00, 0xa085, 0x0019,
303 0x18b1, 0x6824, 0xa18c, 0xff00, 0xa085, 0x0019, 0x6826, 0x71b0, 308 0x6826, 0x71b0, 0x81ff, 0x0040, 0x1889, 0x0d7e, 0x2069, 0x0020,
304 0x81ff, 0x0040, 0x1867, 0x0d7e, 0x2069, 0x0020, 0x6807, 0x0010, 309 0x6807, 0x0010, 0x6908, 0x6808, 0xa106, 0x00c0, 0x187a, 0x690c,
305 0x6908, 0x6808, 0xa106, 0x00c0, 0x1858, 0x690c, 0x680c, 0xa106, 310 0x680c, 0xa106, 0x00c0, 0x187f, 0xa184, 0x00ff, 0x00c0, 0x187f,
306 0x00c0, 0x185d, 0xa184, 0x00ff, 0x00c0, 0x185d, 0x0d7f, 0x78b8, 311 0x0d7f, 0x78b8, 0xa084, 0x801f, 0x00c0, 0x1889, 0x7848, 0xa085,
307 0xa084, 0x801f, 0x00c0, 0x1867, 0x7848, 0xa085, 0x000c, 0x784a, 312 0x000c, 0x784a, 0x71b0, 0x81ff, 0x0040, 0x18ac, 0x70b3, 0x0000,
308 0x71b0, 0x81ff, 0x0040, 0x188a, 0x70b3, 0x0000, 0x0d7e, 0x2069, 313 0x0d7e, 0x2069, 0x0020, 0x6807, 0x0018, 0x6804, 0xa084, 0x0008,
309 0x0020, 0x6807, 0x0018, 0x6804, 0xa084, 0x0008, 0x00c0, 0x187b, 314 0x00c0, 0x189d, 0x6807, 0x0008, 0x6804, 0xa084, 0x0008, 0x00c0,
310 0x6807, 0x0008, 0x6804, 0xa084, 0x0008, 0x00c0, 0x1882, 0x6807, 315 0x18a4, 0x6807, 0x0002, 0x0d7f, 0x61c4, 0x62c8, 0x63cc, 0x61c6,
311 0x0002, 0x0d7f, 0x61c4, 0x62c8, 0x63cc, 0x61c6, 0x62ca, 0x63ce, 316 0x62ca, 0x63ce, 0x0e7e, 0x2071, 0x5200, 0x7266, 0x736a, 0xae80,
312 0x0e7e, 0x2071, 0x5100, 0x7266, 0x736a, 0xae80, 0x0019, 0x0e7f, 317 0x0019, 0x0e7f, 0x7848, 0xa084, 0x000c, 0x00c0, 0x18ba, 0x1078,
313 0x7848, 0xa084, 0x000c, 0x00c0, 0x1898, 0x1078, 0x46db, 0x78a3, 318 0x47e1, 0x78a3, 0x0000, 0x7858, 0xa084, 0xedff, 0x785a, 0x70b4,
314 0x0000, 0x7858, 0xa084, 0xedff, 0x785a, 0x70b4, 0xa080, 0x00df, 319 0xa080, 0x00da, 0x781a, 0x0f7f, 0x0e7f, 0x0d7f, 0x0c7f, 0x2091,
315 0x781a, 0x0f7f, 0x0e7f, 0x0d7f, 0x0c7f, 0x2091, 0x8001, 0x0078, 320 0x8001, 0x0078, 0x1284, 0x6824, 0xa084, 0xff00, 0xa085, 0x0019,
316 0x1284, 0x0f7f, 0x0e7f, 0x0d7f, 0x0c7f, 0x2091, 0x8001, 0x2001, 321 0x6826, 0x78b8, 0xa084, 0x801f, 0x00c0, 0x18d9, 0x7848, 0xa085,
317 0x4005, 0x0078, 0x1286, 0x7980, 0x71c6, 0x71c4, 0xa182, 0x0003, 322 0x000c, 0x784a, 0x7848, 0xa084, 0x000c, 0x00c0, 0x18e2, 0x71b0,
318 0x00c8, 0x127c, 0x7982, 0x0078, 0x1284, 0x7980, 0x71c6, 0x0078, 323 0x81ff, 0x0040, 0x1901, 0x70b3, 0x0000, 0x0d7e, 0x2069, 0x0020,
319 0x1284, 0x7974, 0x71c6, 0x71c4, 0x7976, 0x7978, 0x71ca, 0x71c8, 324 0x6807, 0x0018, 0x6804, 0xa084, 0x0008, 0x00c0, 0x18f2, 0x6807,
320 0x797a, 0x797c, 0x71ce, 0x71cc, 0x797e, 0x0078, 0x1284, 0x7974, 325 0x0008, 0x6804, 0xa084, 0x0008, 0x00c0, 0x18f9, 0x6807, 0x0002,
321 0x71c6, 0x7978, 0x71ca, 0x797c, 0x71ce, 0x0078, 0x1284, 0x7900, 326 0x0d7f, 0x0078, 0x18cb, 0x0f7f, 0x0e7f, 0x0d7f, 0x0c7f, 0x2091,
322 0x71c6, 0x71c4, 0x7902, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 327 0x8001, 0x2001, 0x4005, 0x0078, 0x1286, 0x7980, 0x71c6, 0x71c4,
323 0x0048, 0x18ee, 0x0038, 0x18f0, 0x0078, 0x18fa, 0x00a8, 0x18fa, 328 0xa182, 0x0003, 0x00c8, 0x127c, 0x7982, 0x0078, 0x1284, 0x7980,
324 0xa18c, 0x0001, 0x00c0, 0x18f8, 0x20b9, 0x2222, 0x0078, 0x18fa, 329 0x71c6, 0x0078, 0x1284, 0x7974, 0x71c6, 0x71c4, 0x7976, 0x7978,
325 0x20b9, 0x1212, 0x0078, 0x1284, 0x7900, 0x71c6, 0x0078, 0x1284, 330 0x71ca, 0x71c8, 0x797a, 0x797c, 0x71ce, 0x71cc, 0x797e, 0x0078,
326 0x2009, 0x5174, 0x2104, 0x70c6, 0x70c4, 0x200a, 0x0078, 0x1284, 331 0x1284, 0x7974, 0x71c6, 0x7978, 0x71ca, 0x797c, 0x71ce, 0x0078,
327 0x2009, 0x5174, 0x2104, 0x70c6, 0x0078, 0x1284, 0x71c4, 0x8107, 332 0x1284, 0x7900, 0x71c6, 0x71c4, 0x7902, 0x2001, 0x04fd, 0x2004,
328 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e8, 0x5380, 0x6a14, 333 0xa082, 0x0005, 0x0048, 0x1940, 0x0038, 0x1942, 0x0078, 0x194c,
329 0xd2b4, 0x0040, 0x191f, 0x2011, 0x0001, 0x0078, 0x1921, 0x2011, 334 0x00a8, 0x194c, 0xa18c, 0x0001, 0x00c0, 0x194a, 0x20b9, 0x2222,
330 0x0000, 0x6b0c, 0x0078, 0x1281, 0xac80, 0x0001, 0x1078, 0x1b0f, 335 0x0078, 0x194c, 0x20b9, 0x1212, 0x0078, 0x1284, 0x7900, 0x71c6,
331 0x007c, 0xac80, 0x0001, 0x1078, 0x1aaf, 0x007c, 0x7850, 0xa065, 336 0x0078, 0x1284, 0x2009, 0x5274, 0x2104, 0x70c6, 0x70c4, 0x200a,
332 0x0040, 0x1936, 0x2c04, 0x7852, 0x2063, 0x0000, 0x007c, 0x0f7e, 337 0x0078, 0x1284, 0x2009, 0x5274, 0x2104, 0x70c6, 0x0078, 0x1284,
333 0x2079, 0x5100, 0x7850, 0xa06d, 0x0040, 0x1946, 0x2d04, 0x7852, 338 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e8,
334 0x6803, 0x0000, 0x6807, 0x0000, 0x680b, 0x0000, 0x0f7f, 0x007c, 339 0x5480, 0x6a14, 0xd2b4, 0x0040, 0x1971, 0x2011, 0x0001, 0x0078,
335 0x2091, 0x8000, 0x0f7e, 0x2079, 0x5100, 0x7850, 0x2062, 0x2c00, 340 0x1973, 0x2011, 0x0000, 0x6b0c, 0x0078, 0x1281, 0xac80, 0x0001,
336 0xa005, 0x00c0, 0x1955, 0x1078, 0x23eb, 0x7852, 0x0f7f, 0x2091, 341 0x1078, 0x1b80, 0x007c, 0xac80, 0x0001, 0x1078, 0x1b20, 0x007c,
337 0x8001, 0x007c, 0x0f7e, 0x2079, 0x5100, 0x7850, 0x206a, 0x2d00, 342 0x7850, 0xa065, 0x0040, 0x1988, 0x2c04, 0x7852, 0x2063, 0x0000,
338 0x7852, 0x0f7f, 0x007c, 0x2011, 0x7800, 0x7a52, 0x7bec, 0x8319, 343 0x007c, 0x0f7e, 0x2079, 0x5200, 0x7850, 0xa06d, 0x0040, 0x1998,
339 0x0040, 0x1970, 0xa280, 0x0031, 0x2012, 0x2010, 0x0078, 0x1967, 344 0x2d04, 0x7852, 0x6803, 0x0000, 0x6807, 0x0000, 0x680b, 0x0000,
340 0x2013, 0x0000, 0x007c, 0xa784, 0x0f00, 0x800b, 0xa784, 0x001f, 345 0x0f7f, 0x007c, 0x2091, 0x8000, 0x0f7e, 0x2079, 0x5200, 0x7850,
341 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xa0e8, 0x5400, 0x007c, 346 0x2062, 0x2c00, 0xa005, 0x00c0, 0x19a7, 0x1078, 0x248c, 0x7852,
342 0x1078, 0x1973, 0x2900, 0x682a, 0x2a00, 0x682e, 0x6808, 0xa084, 347 0x0f7f, 0x2091, 0x8001, 0x007c, 0x0f7e, 0x2079, 0x5200, 0x7850,
343 0xffef, 0xa80d, 0x690a, 0x2009, 0x5152, 0x210c, 0x6804, 0xa005, 348 0x206a, 0x2d00, 0x7852, 0x0f7f, 0x007c, 0x2011, 0x7900, 0x7a52,
344 0x0040, 0x19b2, 0xa116, 0x00c0, 0x199d, 0x2060, 0x6000, 0x6806, 349 0x7bec, 0x8319, 0x0040, 0x19c2, 0xa280, 0x0031, 0x2012, 0x2010,
345 0x017e, 0x200b, 0x0000, 0x0078, 0x19a0, 0x2009, 0x0000, 0x017e, 350 0x0078, 0x19b9, 0x2013, 0x0000, 0x007c, 0xa784, 0x0f00, 0x800b,
346 0x6804, 0xa065, 0x0040, 0x19af, 0x6000, 0x6806, 0x1078, 0x19c0, 351 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xa0e8,
347 0x1078, 0x1c5f, 0x6810, 0x8001, 0x6812, 0x00c0, 0x19a0, 0x017f, 352 0x5500, 0x007c, 0x1078, 0x19c5, 0x2900, 0x682a, 0x2a00, 0x682e,
348 0x6902, 0x6906, 0x007c, 0xa065, 0x0040, 0x19bf, 0x609c, 0x609f, 353 0x6808, 0xa084, 0xffef, 0xa80d, 0x690a, 0x2009, 0x5252, 0x210c,
349 0x0000, 0x2008, 0x1078, 0x1948, 0x2100, 0x0078, 0x19b3, 0x007c, 354 0x6804, 0xa005, 0x0040, 0x1a04, 0xa116, 0x00c0, 0x19ef, 0x2060,
350 0x6007, 0x0103, 0x608f, 0x0000, 0x20a9, 0x001c, 0xac80, 0x0005, 355 0x6000, 0x6806, 0x017e, 0x200b, 0x0000, 0x0078, 0x19f2, 0x2009,
351 0x20a0, 0x2001, 0x0000, 0x40a4, 0x6828, 0x601a, 0x682c, 0x6022, 356 0x0000, 0x017e, 0x6804, 0xa065, 0x0040, 0x1a01, 0x6000, 0x6806,
352 0x007c, 0x0e7e, 0x2071, 0x5140, 0x704c, 0xa08c, 0x0200, 0x00c0, 357 0x1078, 0x1a31, 0x1078, 0x1ccb, 0x6810, 0x8001, 0x6812, 0x00c0,
353 0x19df, 0xa088, 0x5180, 0x2d0a, 0x8000, 0x704e, 0xa006, 0x0e7f, 358 0x19f2, 0x017f, 0x6902, 0x6906, 0x007c, 0xa065, 0x0040, 0x1a16,
354 0x007c, 0x1078, 0x1973, 0x2091, 0x8000, 0x6804, 0x781e, 0xa065, 359 0x2008, 0x609c, 0xa005, 0x0040, 0x1a13, 0x2062, 0x609f, 0x0000,
355 0x0040, 0x1a2a, 0x0078, 0x19f2, 0x2c00, 0x781e, 0x6000, 0xa065, 360 0xa065, 0x0078, 0x1a09, 0x7850, 0x7952, 0x2062, 0x007c, 0xa065,
356 0x0040, 0x1a2a, 0x600c, 0xa306, 0x00c0, 0x19ec, 0x6010, 0xa206, 361 0x0040, 0x1a30, 0x2008, 0x609c, 0xa005, 0x0040, 0x1a25, 0x2062,
357 0x00c0, 0x19ec, 0x2c28, 0x2001, 0x5152, 0x2004, 0xac06, 0x00c0, 362 0x609f, 0x0000, 0xa065, 0x0078, 0x1a1b, 0x0f7e, 0x2079, 0x5200,
358 0x1a03, 0x0078, 0x1a28, 0x6804, 0xac06, 0x00c0, 0x1a10, 0x6000, 363 0x2091, 0x8000, 0x7850, 0x7952, 0x0f7f, 0x2062, 0x2091, 0x8001,
359 0xa065, 0x6806, 0x00c0, 0x1a1a, 0x6803, 0x0000, 0x0078, 0x1a1a, 364 0x007c, 0x6007, 0x0103, 0x608f, 0x0000, 0x20a9, 0x001c, 0xac80,
360 0x6400, 0x781c, 0x2060, 0x6402, 0xa486, 0x0000, 0x00c0, 0x1a1a, 365 0x0005, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x6828, 0x601a, 0x682c,
361 0x2c00, 0x6802, 0x2560, 0x1078, 0x19c0, 0x601b, 0x0005, 0x6023, 366 0x6022, 0x007c, 0x0e7e, 0x2071, 0x5240, 0x704c, 0xa08c, 0x0200,
362 0x0020, 0x1078, 0x1c5f, 0x6810, 0x8001, 0x1050, 0x23eb, 0x6812, 367 0x00c0, 0x1a50, 0xa088, 0x5280, 0x2d0a, 0x8000, 0x704e, 0xa006,
363 0xa085, 0xffff, 0x007c, 0x2039, 0x0000, 0x2041, 0x0021, 0x2049, 368 0x0e7f, 0x007c, 0x1078, 0x19c5, 0x2091, 0x8000, 0x6804, 0x781e,
364 0x0004, 0x2051, 0x0008, 0x2091, 0x8000, 0x1078, 0x1980, 0x8738, 369 0xa065, 0x0040, 0x1a9b, 0x0078, 0x1a63, 0x2c00, 0x781e, 0x6000,
365 0xa784, 0x001f, 0x00c0, 0x1a35, 0xa7bc, 0xff00, 0x873f, 0x8738, 370 0xa065, 0x0040, 0x1a9b, 0x600c, 0xa306, 0x00c0, 0x1a5d, 0x6010,
366 0x873f, 0xa784, 0x0f00, 0x00c0, 0x1a35, 0x2091, 0x8001, 0x007c, 371 0xa206, 0x00c0, 0x1a5d, 0x2c28, 0x2001, 0x5252, 0x2004, 0xac06,
367 0x2061, 0x0000, 0x6018, 0xa084, 0x0001, 0x00c0, 0x1a59, 0x2091, 372 0x00c0, 0x1a74, 0x0078, 0x1a99, 0x6804, 0xac06, 0x00c0, 0x1a81,
368 0x8000, 0x78e0, 0x78e3, 0x0000, 0x2091, 0x8001, 0xa005, 0x00c0, 373 0x6000, 0xa065, 0x6806, 0x00c0, 0x1a8b, 0x6803, 0x0000, 0x0078,
369 0x1a5a, 0x007c, 0xa08c, 0xfff0, 0x0040, 0x1a60, 0x1078, 0x23eb, 374 0x1a8b, 0x6400, 0x781c, 0x2060, 0x6402, 0xa486, 0x0000, 0x00c0,
370 0x0079, 0x1a62, 0x1a72, 0x1a75, 0x1a7b, 0x1a7f, 0x1a73, 0x1a83, 375 0x1a8b, 0x2c00, 0x6802, 0x2560, 0x1078, 0x1a31, 0x601b, 0x0005,
371 0x1a89, 0x1a73, 0x1a73, 0x1c29, 0x1c4d, 0x1c51, 0x1a73, 0x1a73, 376 0x6023, 0x0020, 0x1078, 0x1ccb, 0x6810, 0x8001, 0x1050, 0x248c,
372 0x1a73, 0x1a73, 0x007c, 0x1078, 0x23eb, 0x1078, 0x1a2b, 0x2001, 377 0x6812, 0xa085, 0xffff, 0x007c, 0x2039, 0x0000, 0x2041, 0x0021,
373 0x8001, 0x0078, 0x1c57, 0x2001, 0x8003, 0x0078, 0x1c57, 0x2001, 378 0x2049, 0x0004, 0x2051, 0x0008, 0x2091, 0x8000, 0x1078, 0x19d2,
374 0x8004, 0x0078, 0x1c57, 0x1078, 0x1a2b, 0x2001, 0x8006, 0x0078, 379 0x8738, 0xa784, 0x001f, 0x00c0, 0x1aa6, 0xa7bc, 0xff00, 0x873f,
375 0x1c57, 0x2001, 0x8007, 0x0078, 0x1c57, 0x2030, 0x2138, 0xa782, 380 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0, 0x1aa6, 0x2091, 0x8001,
376 0x0021, 0x0048, 0x1a95, 0x2009, 0x0020, 0x2600, 0x1078, 0x1aaf, 381 0x007c, 0x2061, 0x0000, 0x6018, 0xa084, 0x0001, 0x00c0, 0x1aca,
377 0x00c0, 0x1aae, 0xa7ba, 0x0020, 0x0048, 0x1aad, 0x0040, 0x1aad, 382 0x2091, 0x8000, 0x78e0, 0x78e3, 0x0000, 0x2091, 0x8001, 0xa005,
378 0x2708, 0xa6b0, 0x0020, 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, 383 0x00c0, 0x1acb, 0x007c, 0xa08c, 0xfff0, 0x0040, 0x1ad1, 0x1078,
379 0x0000, 0xa5a9, 0x0000, 0x0078, 0x1a8f, 0xa006, 0x007c, 0x81ff, 384 0x248c, 0x0079, 0x1ad3, 0x1ae3, 0x1ae6, 0x1aec, 0x1af0, 0x1ae4,
380 0x0040, 0x1aea, 0x2099, 0x0030, 0x20a0, 0x700c, 0xa084, 0x00ff, 385 0x1af4, 0x1afa, 0x1ae4, 0x1ae4, 0x1c95, 0x1cb9, 0x1cbd, 0x1ae4,
381 0x0040, 0x1ac1, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 386 0x1ae4, 0x1ae4, 0x1ae4, 0x007c, 0x1078, 0x248c, 0x1078, 0x1a9c,
382 0x1abc, 0x21a8, 0x7017, 0x0000, 0x810b, 0x7112, 0x721a, 0x731e, 387 0x2001, 0x8001, 0x0078, 0x1cc3, 0x2001, 0x8003, 0x0078, 0x1cc3,
383 0x7422, 0x7526, 0x780c, 0xa085, 0x0001, 0x7002, 0x7007, 0x0001, 388 0x2001, 0x8004, 0x0078, 0x1cc3, 0x1078, 0x1a9c, 0x2001, 0x8006,
384 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x00c8, 0x1ade, 0x2009, 389 0x0078, 0x1cc3, 0x2001, 0x8007, 0x0078, 0x1cc3, 0x2030, 0x2138,
385 0x0022, 0x2104, 0xa084, 0x4000, 0x00c0, 0x1ad0, 0x7008, 0x800b, 390 0xa782, 0x0021, 0x0048, 0x1b06, 0x2009, 0x0020, 0x2600, 0x1078,
386 0x00c8, 0x1ad0, 0x7007, 0x0002, 0xa08c, 0x01e0, 0x00c0, 0x1aea, 391 0x1b20, 0x00c0, 0x1b1f, 0xa7ba, 0x0020, 0x0048, 0x1b1e, 0x0040,
387 0x53a5, 0xa006, 0x7003, 0x0000, 0x007c, 0x2030, 0x2138, 0xa782, 392 0x1b1e, 0x2708, 0xa6b0, 0x0020, 0xa290, 0x0040, 0xa399, 0x0000,
388 0x0021, 0x0048, 0x1af5, 0x2009, 0x0020, 0x2600, 0x1078, 0x1b0f, 393 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x0078, 0x1b00, 0xa006, 0x007c,
389 0x00c0, 0x1b0e, 0xa7ba, 0x0020, 0x0048, 0x1b0d, 0x0040, 0x1b0d, 394 0x81ff, 0x0040, 0x1b5b, 0x2099, 0x0030, 0x20a0, 0x700c, 0xa084,
390 0x2708, 0xa6b0, 0x0020, 0xa290, 0x0040, 0xa399, 0x0000, 0xa4a1, 395 0x00ff, 0x0040, 0x1b32, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004,
391 0x0000, 0xa5a9, 0x0000, 0x0078, 0x1aef, 0xa006, 0x007c, 0x81ff, 396 0x00c0, 0x1b2d, 0x21a8, 0x7017, 0x0000, 0x810b, 0x7112, 0x721a,
392 0x0040, 0x1b50, 0x2098, 0x20a1, 0x0030, 0x700c, 0xa084, 0x00ff, 397 0x731e, 0x7422, 0x7526, 0x780c, 0xa085, 0x0001, 0x7002, 0x7007,
393 0x0040, 0x1b21, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 398 0x0001, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x00c8, 0x1b4f,
394 0x1b1c, 0x21a8, 0x7017, 0x0000, 0x810b, 0x7112, 0x721a, 0x731e, 399 0x2009, 0x0022, 0x2104, 0xa084, 0x4000, 0x00c0, 0x1b41, 0x7008,
395 0x7422, 0x7526, 0x780c, 0xa085, 0x0000, 0x7002, 0x53a6, 0x7007, 400 0x800b, 0x00c8, 0x1b41, 0x7007, 0x0002, 0xa08c, 0x01e0, 0x00c0,
396 0x0001, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x00c8, 0x1b3f, 401 0x1b5b, 0x53a5, 0xa006, 0x7003, 0x0000, 0x007c, 0x2030, 0x2138,
397 0x2009, 0x0022, 0x2104, 0xa084, 0x4000, 0x00c0, 0x1b31, 0x7010, 402 0xa782, 0x0021, 0x0048, 0x1b66, 0x2009, 0x0020, 0x2600, 0x1078,
398 0xa084, 0xf000, 0x0040, 0x1b48, 0x7007, 0x0008, 0x0078, 0x1b4c, 403 0x1b80, 0x00c0, 0x1b7f, 0xa7ba, 0x0020, 0x0048, 0x1b7e, 0x0040,
399 0x7108, 0x8103, 0x00c8, 0x1b31, 0x7007, 0x0002, 0xa184, 0x01e0, 404 0x1b7e, 0x2708, 0xa6b0, 0x0020, 0xa290, 0x0040, 0xa399, 0x0000,
400 0x7003, 0x0000, 0x007c, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0004, 405 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x0078, 0x1b60, 0xa006, 0x007c,
401 0x00c8, 0x1b5c, 0x0078, 0x1b5f, 0xa006, 0x0078, 0x1b61, 0xa085, 406 0x81ff, 0x0040, 0x1bc1, 0x2098, 0x20a1, 0x0030, 0x700c, 0xa084,
402 0x0001, 0x007c, 0x0e7e, 0x2071, 0x5100, 0x2d08, 0x7058, 0x6802, 407 0x00ff, 0x0040, 0x1b92, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004,
403 0xa005, 0x00c0, 0x1b6c, 0x715e, 0x715a, 0x0e7f, 0x007c, 0x2c08, 408 0x00c0, 0x1b8d, 0x21a8, 0x7017, 0x0000, 0x810b, 0x7112, 0x721a,
404 0x7858, 0x6002, 0xa005, 0x00c0, 0x1b76, 0x795e, 0x795a, 0x007c, 409 0x731e, 0x7422, 0x7526, 0x780c, 0xa085, 0x0000, 0x7002, 0x53a6,
405 0x2091, 0x8000, 0x6003, 0x0000, 0x2c08, 0x785c, 0xa065, 0x00c0, 410 0x7007, 0x0001, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x00c8,
406 0x1b84, 0x795a, 0x0078, 0x1b85, 0x6102, 0x795e, 0x2091, 0x8001, 411 0x1bb0, 0x2009, 0x0022, 0x2104, 0xa084, 0x4000, 0x00c0, 0x1ba2,
407 0x1078, 0x21ef, 0x007c, 0x0e7e, 0x2071, 0x5100, 0x7058, 0xa06d, 412 0x7010, 0xa084, 0xf000, 0x0040, 0x1bb9, 0x7007, 0x0008, 0x0078,
408 0x0040, 0x1b99, 0x6800, 0x705a, 0xa005, 0x00c0, 0x1b98, 0x705e, 413 0x1bbd, 0x7108, 0x8103, 0x00c8, 0x1ba2, 0x7007, 0x0002, 0xa184,
409 0x8dff, 0x0e7f, 0x007c, 0x0d7e, 0x0c7e, 0x0f7e, 0x2079, 0x5100, 414 0x01e0, 0x7003, 0x0000, 0x007c, 0x2001, 0x04fd, 0x2004, 0xa082,
410 0xaf80, 0x0016, 0x2060, 0x6000, 0xa005, 0x0040, 0x1bc9, 0x2068, 415 0x0004, 0x00c8, 0x1bcd, 0x0078, 0x1bd0, 0xa006, 0x0078, 0x1bd2,
411 0x6814, 0xa306, 0x00c0, 0x1bb2, 0x6828, 0xa084, 0x00ff, 0xa406, 416 0xa085, 0x0001, 0x007c, 0x0e7e, 0x2071, 0x5200, 0x2d08, 0x7058,
412 0x0040, 0x1bb5, 0x2d60, 0x0078, 0x1ba3, 0x6800, 0xa005, 0x6002, 417 0x6802, 0xa005, 0x00c0, 0x1bdd, 0x715e, 0x715a, 0x0e7f, 0x007c,
413 0x00c0, 0x1bc1, 0xaf80, 0x0016, 0xac06, 0x0040, 0x1bc0, 0x2c00, 418 0x2c08, 0x7858, 0x6002, 0xa005, 0x00c0, 0x1be7, 0x795e, 0x795a,
414 0x785e, 0x0d7e, 0x689c, 0xa005, 0x0040, 0x1bc8, 0x1078, 0x19b3, 419 0x007c, 0x2091, 0x8000, 0x6114, 0x1078, 0x2180, 0x6900, 0xa184,
415 0x007f, 0x0f7f, 0x0c7f, 0x0d7f, 0xa005, 0x007c, 0x0d7e, 0x0c7e, 420 0x0100, 0x00c0, 0x2035, 0xa184, 0x0200, 0x00c0, 0x2031, 0x681c,
416 0x0f7e, 0x2079, 0x5100, 0xaf80, 0x0016, 0x2060, 0x6000, 0xa005, 421 0xa005, 0x00c0, 0x203d, 0x6003, 0x0000, 0x2c08, 0x785c, 0xa065,
417 0x0040, 0x1bf8, 0x2068, 0x6814, 0xa084, 0x00ff, 0xa306, 0x0040, 422 0x00c0, 0x1c05, 0x795a, 0x0078, 0x1c06, 0x6102, 0x795e, 0x2091,
418 0x1be4, 0x2d60, 0x0078, 0x1bd6, 0x6800, 0xa005, 0x6002, 0x00c0, 423 0x8001, 0x1078, 0x228c, 0x007c, 0x0e7e, 0x2071, 0x5200, 0x7058,
419 0x1bf0, 0xaf80, 0x0016, 0xac06, 0x0040, 0x1bef, 0x2c00, 0x785e, 424 0xa06d, 0x0040, 0x1c1a, 0x6800, 0x705a, 0xa005, 0x00c0, 0x1c19,
420 0x0d7e, 0x689c, 0xa005, 0x0040, 0x1bf7, 0x1078, 0x19b3, 0x007f, 425 0x705e, 0x8dff, 0x0e7f, 0x007c, 0x0d7e, 0x0c7e, 0x0f7e, 0x2079,
421 0x0f7f, 0x0c7f, 0x0d7f, 0xa005, 0x007c, 0x0d7e, 0x0c7e, 0x0f7e, 426 0x5200, 0xaf80, 0x0016, 0x2060, 0x6000, 0xa005, 0x0040, 0x1c43,
422 0x2079, 0x5100, 0xaf80, 0x0016, 0x2060, 0x6000, 0xa06d, 0x0040, 427 0x2068, 0x6814, 0xa306, 0x00c0, 0x1c33, 0x6828, 0xa084, 0x00ff,
423 0x1c24, 0x6814, 0xa306, 0x0040, 0x1c10, 0x2d60, 0x0078, 0x1c05, 428 0xa406, 0x0040, 0x1c36, 0x2d60, 0x0078, 0x1c24, 0x6800, 0xa005,
424 0x6800, 0xa005, 0x6002, 0x00c0, 0x1c1c, 0xaf80, 0x0016, 0xac06, 429 0x6002, 0x00c0, 0x1c42, 0xaf80, 0x0016, 0xac06, 0x0040, 0x1c41,
425 0x0040, 0x1c1b, 0x2c00, 0x785e, 0x0d7e, 0x689c, 0xa005, 0x0040, 430 0x2c00, 0x785e, 0x2d00, 0x0f7f, 0x0c7f, 0x0d7f, 0xa005, 0x007c,
426 0x1c23, 0x1078, 0x19b3, 0x007f, 0x0f7f, 0x0c7f, 0x0d7f, 0xa005, 431 0x0d7e, 0x0c7e, 0x0f7e, 0x2079, 0x5200, 0xaf80, 0x0016, 0x2060,
427 0x007c, 0x2091, 0x8000, 0x2069, 0x5140, 0x6800, 0xa086, 0x0000, 432 0x6000, 0xa005, 0x0040, 0x1c6b, 0x2068, 0x6814, 0xa084, 0x00ff,
428 0x0040, 0x1c37, 0x2091, 0x8001, 0x78e3, 0x0009, 0x007c, 0x6880, 433 0xa306, 0x0040, 0x1c5e, 0x2d60, 0x0078, 0x1c50, 0x6800, 0xa005,
429 0xa0bc, 0xff00, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0010, 434 0x6002, 0x00c0, 0x1c6a, 0xaf80, 0x0016, 0xac06, 0x0040, 0x1c69,
430 0x1078, 0x1980, 0x8738, 0xa784, 0x001f, 0x00c0, 0x1c40, 0x2091, 435 0x2c00, 0x785e, 0x2d00, 0x0f7f, 0x0c7f, 0x0d7f, 0xa005, 0x007c,
431 0x8001, 0x2001, 0x800a, 0x0078, 0x1c57, 0x2001, 0x800c, 0x0078, 436 0x0d7e, 0x0c7e, 0x0f7e, 0x2079, 0x5200, 0xaf80, 0x0016, 0x2060,
432 0x1c57, 0x1078, 0x1a2b, 0x2001, 0x800d, 0x0078, 0x1c57, 0x70c2, 437 0x6000, 0xa06d, 0x0040, 0x1c90, 0x6814, 0xa306, 0x0040, 0x1c83,
433 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x4080, 0x007c, 0x6004, 438 0x2d60, 0x0078, 0x1c78, 0x6800, 0xa005, 0x6002, 0x00c0, 0x1c8f,
434 0x2c08, 0x2063, 0x0000, 0x7884, 0x8000, 0x7886, 0x7888, 0xa005, 439 0xaf80, 0x0016, 0xac06, 0x0040, 0x1c8e, 0x2c00, 0x785e, 0x2d00,
435 0x798a, 0x0040, 0x1c6e, 0x2c02, 0x0078, 0x1c6f, 0x798e, 0x007c, 440 0x0f7f, 0x0c7f, 0x0d7f, 0xa005, 0x007c, 0x2091, 0x8000, 0x2069,
436 0x6807, 0x0103, 0x0c7e, 0x2061, 0x5100, 0x2d08, 0x206b, 0x0000, 441 0x5240, 0x6800, 0xa086, 0x0000, 0x0040, 0x1ca3, 0x2091, 0x8001,
437 0x6084, 0x8000, 0x6086, 0x6088, 0xa005, 0x618a, 0x0040, 0x1c83, 442 0x78e3, 0x0009, 0x007c, 0x6880, 0xa0bc, 0xff00, 0x2041, 0x0021,
438 0x2d02, 0x0078, 0x1c84, 0x618e, 0x0c7f, 0x007c, 0x1078, 0x1c97, 443 0x2049, 0x0004, 0x2051, 0x0010, 0x1078, 0x19d2, 0x8738, 0xa784,
439 0x0040, 0x1c96, 0x0c7e, 0x609c, 0xa065, 0x0040, 0x1c91, 0x1078, 444 0x001f, 0x00c0, 0x1cac, 0x2091, 0x8001, 0x2001, 0x800a, 0x0078,
440 0x19b3, 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1948, 0x007c, 0x788c, 445 0x1cc3, 0x2001, 0x800c, 0x0078, 0x1cc3, 0x1078, 0x1a9c, 0x2001,
441 0xa065, 0x0040, 0x1ca9, 0x2091, 0x8000, 0x7884, 0x8001, 0x7886, 446 0x800d, 0x0078, 0x1cc3, 0x70c2, 0x2061, 0x0000, 0x601b, 0x0001,
442 0x2c04, 0x788e, 0xa005, 0x00c0, 0x1ca7, 0x788a, 0x8000, 0x2091, 447 0x2091, 0x4080, 0x007c, 0x6004, 0x2c08, 0x2063, 0x0000, 0x7884,
443 0x8001, 0x007c, 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086, 0x818e, 448 0x8000, 0x7886, 0x7888, 0xa005, 0x798a, 0x0040, 0x1cda, 0x2c02,
444 0x00c8, 0x1cb3, 0xa200, 0x0070, 0x1cb7, 0x0078, 0x1cae, 0x8086, 449 0x0078, 0x1cdb, 0x798e, 0x007c, 0x6807, 0x0103, 0x0c7e, 0x2061,
445 0x818e, 0x007c, 0x157e, 0x20a9, 0x0010, 0xa005, 0x0040, 0x1cdd, 450 0x5200, 0x2d08, 0x206b, 0x0000, 0x6084, 0x8000, 0x6086, 0x6088,
446 0xa11a, 0x00c8, 0x1cdd, 0x8213, 0x818d, 0x0048, 0x1cce, 0xa11a, 451 0xa005, 0x618a, 0x0040, 0x1cef, 0x2d02, 0x0078, 0x1cf0, 0x618e,
447 0x00c8, 0x1ccf, 0x0070, 0x1cd5, 0x0078, 0x1cc3, 0xa11a, 0x2308, 452 0x0c7f, 0x007c, 0x1078, 0x1d03, 0x0040, 0x1d02, 0x0c7e, 0x609c,
448 0x8210, 0x0070, 0x1cd5, 0x0078, 0x1cc3, 0x007e, 0x3200, 0xa084, 453 0xa065, 0x0040, 0x1cfd, 0x1078, 0x1a17, 0x0c7f, 0x609f, 0x0000,
449 0xf7ff, 0x2080, 0x007f, 0x157f, 0x007c, 0x007e, 0x3200, 0xa085, 454 0x1078, 0x199a, 0x007c, 0x788c, 0xa065, 0x0040, 0x1d15, 0x2091,
450 0x0800, 0x0078, 0x1cd9, 0x7994, 0x70d0, 0xa106, 0x0040, 0x1d51, 455 0x8000, 0x7884, 0x8001, 0x7886, 0x2c04, 0x788e, 0xa005, 0x00c0,
451 0x2091, 0x8000, 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0, 0x1d51, 456 0x1d13, 0x788a, 0x8000, 0x2091, 0x8001, 0x007c, 0x20a9, 0x0010,
452 0x7008, 0x7208, 0xa206, 0x00c0, 0x1d51, 0xa286, 0x0008, 0x00c0, 457 0xa006, 0x8004, 0x8086, 0x818e, 0x00c8, 0x1d1f, 0xa200, 0x0070,
453 0x1d51, 0x2071, 0x0010, 0x1078, 0x192e, 0x0040, 0x1d51, 0x7a9c, 458 0x1d23, 0x0078, 0x1d1a, 0x8086, 0x818e, 0x007c, 0x157e, 0x20a9,
454 0x7b98, 0x7ca4, 0x7da0, 0xa184, 0xff00, 0x0040, 0x1d1f, 0x2031, 459 0x0010, 0xa005, 0x0040, 0x1d49, 0xa11a, 0x00c8, 0x1d49, 0x8213,
455 0x0000, 0x810b, 0x86b5, 0x810b, 0x86b5, 0x810b, 0x86b5, 0x810b, 460 0x818d, 0x0048, 0x1d3a, 0xa11a, 0x00c8, 0x1d3b, 0x0070, 0x1d41,
456 0x86b5, 0x810b, 0x86b5, 0x810b, 0x86b5, 0x2100, 0xa210, 0x2600, 461 0x0078, 0x1d2f, 0xa11a, 0x2308, 0x8210, 0x0070, 0x1d41, 0x0078,
457 0xa319, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x0078, 0x1d29, 0x8107, 462 0x1d2f, 0x007e, 0x3200, 0xa084, 0xf7ff, 0x2080, 0x007f, 0x157f,
458 0x8004, 0x8004, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 463 0x007c, 0x007e, 0x3200, 0xa085, 0x0800, 0x0078, 0x1d45, 0x7994,
459 0x0000, 0x2009, 0x0020, 0x1078, 0x1929, 0x2091, 0x8001, 0x0040, 464 0x70d0, 0xa106, 0x0040, 0x1dbd, 0x2091, 0x8000, 0x2071, 0x0020,
460 0x1d48, 0x1078, 0x1948, 0x78a8, 0x8000, 0x78aa, 0xa086, 0x0002, 465 0x7004, 0xa005, 0x00c0, 0x1dbd, 0x7008, 0x7208, 0xa206, 0x00c0,
461 0x00c0, 0x1d51, 0x2091, 0x8000, 0x78e3, 0x0002, 0x78ab, 0x0000, 466 0x1dbd, 0xa286, 0x0008, 0x00c0, 0x1dbd, 0x2071, 0x0010, 0x1078,
462 0x78cc, 0xa085, 0x0003, 0x78ce, 0x2091, 0x8001, 0x0078, 0x1d51, 467 0x1980, 0x0040, 0x1dbd, 0x7a9c, 0x7b98, 0x7ca4, 0x7da0, 0xa184,
463 0x78ab, 0x0000, 0x1078, 0x20ac, 0x6004, 0xa084, 0x000f, 0x0079, 468 0xff00, 0x0040, 0x1d8b, 0x2031, 0x0000, 0x810b, 0x86b5, 0x810b,
464 0x1d56, 0x2071, 0x0010, 0x2091, 0x8001, 0x007c, 0x1d66, 0x1d88, 469 0x86b5, 0x810b, 0x86b5, 0x810b, 0x86b5, 0x810b, 0x86b5, 0x810b,
465 0x1dae, 0x1d66, 0x1dcb, 0x1d75, 0x1f2c, 0x1f47, 0x1d66, 0x1d82, 470 0x86b5, 0x2100, 0xa210, 0x2600, 0xa319, 0xa4a1, 0x0000, 0xa5a9,
466 0x1da8, 0x1e13, 0x1e82, 0x1ed2, 0x1ee4, 0x1f43, 0x2039, 0x0400, 471 0x0000, 0x0078, 0x1d95, 0x8107, 0x8004, 0x8004, 0xa210, 0xa399,
467 0x78dc, 0xa705, 0x78de, 0x6008, 0xa705, 0x600a, 0x1078, 0x1fc7, 472 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x2009, 0x0020, 0x1078,
468 0x609c, 0x78da, 0x1078, 0x2094, 0x007c, 0x78dc, 0xa084, 0x0100, 473 0x197b, 0x2091, 0x8001, 0x0040, 0x1db4, 0x1078, 0x199a, 0x78a8,
469 0x0040, 0x1d7c, 0x0078, 0x1d66, 0x601c, 0xa085, 0x0080, 0x601e, 474 0x8000, 0x78aa, 0xa086, 0x0002, 0x00c0, 0x1dbd, 0x2091, 0x8000,
470 0x0078, 0x1d8f, 0x1078, 0x1b53, 0x00c0, 0x1d66, 0x1078, 0x20c6, 475 0x78e3, 0x0002, 0x78ab, 0x0000, 0x78cc, 0xa085, 0x0003, 0x78ce,
471 0x78dc, 0xa084, 0x0100, 0x0040, 0x1d8f, 0x0078, 0x1d66, 0x78df, 476 0x2091, 0x8001, 0x0078, 0x1dbd, 0x78ab, 0x0000, 0x1078, 0x2149,
472 0x0000, 0x6004, 0x8007, 0xa084, 0x00ff, 0x78d2, 0x8001, 0x609f, 477 0x6004, 0xa084, 0x000f, 0x0079, 0x1dc2, 0x2071, 0x0010, 0x2091,
473 0x0000, 0x0040, 0x1da5, 0x1078, 0x1fc7, 0x0040, 0x1da5, 0x78dc, 478 0x8001, 0x007c, 0x1dd2, 0x1df4, 0x1e1a, 0x1dd2, 0x1e37, 0x1de1,
474 0xa085, 0x0100, 0x78de, 0x0078, 0x1da7, 0x1078, 0x1feb, 0x007c, 479 0x1fc9, 0x1fe4, 0x1dd2, 0x1dee, 0x1e14, 0x1e7f, 0x1eee, 0x1f57,
475 0x1078, 0x1b53, 0x00c0, 0x1d66, 0x1078, 0x20c2, 0x78dc, 0xa08c, 480 0x1f69, 0x1fe0, 0x2039, 0x0400, 0x78dc, 0xa705, 0x78de, 0x6008,
476 0x0e00, 0x00c0, 0x1db7, 0xa084, 0x0100, 0x00c0, 0x1db9, 0x0078, 481 0xa705, 0x600a, 0x1078, 0x2064, 0x609c, 0x78da, 0x1078, 0x2131,
477 0x1d66, 0x1078, 0x1fc7, 0x00c0, 0x1dca, 0x6104, 0xa18c, 0x00ff, 482 0x007c, 0x78dc, 0xa084, 0x0100, 0x0040, 0x1de8, 0x0078, 0x1dd2,
478 0xa186, 0x0007, 0x0040, 0x1f84, 0xa186, 0x000f, 0x0040, 0x1f84, 483 0x601c, 0xa085, 0x0080, 0x601e, 0x0078, 0x1dfb, 0x1078, 0x1bc4,
479 0x1078, 0x1feb, 0x007c, 0x78dc, 0xa084, 0x0100, 0x0040, 0x1dd2, 484 0x00c0, 0x1dd2, 0x1078, 0x2163, 0x78dc, 0xa084, 0x0100, 0x0040,
480 0x0078, 0x1d66, 0x78df, 0x0000, 0x6714, 0x2011, 0x0001, 0x20a9, 485 0x1dfb, 0x0078, 0x1dd2, 0x78df, 0x0000, 0x6004, 0x8007, 0xa084,
481 0x0001, 0x6018, 0xa084, 0x00ff, 0xa005, 0x0040, 0x1df5, 0x2011, 486 0x00ff, 0x78d2, 0x8001, 0x609f, 0x0000, 0x0040, 0x1e11, 0x1078,
482 0x0001, 0xa7bc, 0xff00, 0x20a9, 0x0020, 0xa08e, 0x0001, 0x0040, 487 0x2064, 0x0040, 0x1e11, 0x78dc, 0xa085, 0x0100, 0x78de, 0x0078,
483 0x1df5, 0x2039, 0x0000, 0x2011, 0x0002, 0x20a9, 0x0100, 0xa08e, 488 0x1e13, 0x1078, 0x2088, 0x007c, 0x1078, 0x1bc4, 0x00c0, 0x1dd2,
484 0x0002, 0x0040, 0x1df5, 0x0078, 0x1e10, 0x1078, 0x1973, 0x2091, 489 0x1078, 0x215f, 0x78dc, 0xa08c, 0x0e00, 0x00c0, 0x1e23, 0xa084,
485 0x8000, 0x682b, 0x0000, 0x682f, 0x0000, 0x6808, 0xa084, 0xffde, 490 0x0100, 0x00c0, 0x1e25, 0x0078, 0x1dd2, 0x1078, 0x2064, 0x00c0,
486 0x680a, 0xade8, 0x0010, 0x2091, 0x8001, 0x0070, 0x1e09, 0x0078, 491 0x1e36, 0x6104, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x2021,
487 0x1df7, 0x8211, 0x0040, 0x1e10, 0x20a9, 0x0100, 0x0078, 0x1df7, 492 0xa186, 0x000f, 0x0040, 0x2021, 0x1078, 0x2088, 0x007c, 0x78dc,
488 0x1078, 0x1948, 0x007c, 0x2001, 0x5167, 0x2004, 0xa084, 0x8000, 493 0xa084, 0x0100, 0x0040, 0x1e3e, 0x0078, 0x1dd2, 0x78df, 0x0000,
489 0x0040, 0x1fac, 0x6114, 0x1078, 0x20e3, 0x6900, 0xa184, 0x0001, 494 0x6714, 0x2011, 0x0001, 0x20a9, 0x0001, 0x6018, 0xa084, 0x00ff,
490 0x0040, 0x1e34, 0x6028, 0xa084, 0x00ff, 0x00c0, 0x1fa4, 0x6800, 495 0xa005, 0x0040, 0x1e61, 0x2011, 0x0001, 0xa7bc, 0xff00, 0x20a9,
491 0xa084, 0x0001, 0x0040, 0x1fac, 0x6803, 0x0000, 0x680b, 0x0000, 496 0x0020, 0xa08e, 0x0001, 0x0040, 0x1e61, 0x2039, 0x0000, 0x2011,
492 0x6807, 0x0000, 0x0078, 0x1fb4, 0x2011, 0x0001, 0x6020, 0xd0f4, 497 0x0002, 0x20a9, 0x0100, 0xa08e, 0x0002, 0x0040, 0x1e61, 0x0078,
493 0x0040, 0x1e3c, 0xa295, 0x0002, 0xd0c4, 0x0040, 0x1e41, 0xa295, 498 0x1e7c, 0x1078, 0x19c5, 0x2091, 0x8000, 0x682b, 0x0000, 0x682f,
494 0x0008, 0xd0cc, 0x0040, 0x1e46, 0xa295, 0x0400, 0x601c, 0xa084, 499 0x0000, 0x6808, 0xa084, 0xffde, 0x680a, 0xade8, 0x0010, 0x2091,
495 0x0002, 0x0040, 0x1e4d, 0xa295, 0x0004, 0x602c, 0xa08c, 0x00ff, 500 0x8001, 0x0070, 0x1e75, 0x0078, 0x1e63, 0x8211, 0x0040, 0x1e7c,
496 0xa182, 0x0002, 0x0048, 0x1fb0, 0xa182, 0x001b, 0x00c8, 0x1fb0, 501 0x20a9, 0x0100, 0x0078, 0x1e63, 0x1078, 0x199a, 0x007c, 0x2001,
497 0x0040, 0x1fb0, 0x690e, 0x602c, 0x8007, 0xa08c, 0x00ff, 0xa182, 502 0x5267, 0x2004, 0xa084, 0x8000, 0x0040, 0x2049, 0x6114, 0x1078,
498 0x0002, 0x0048, 0x1fb0, 0xa182, 0x001b, 0x00c8, 0x1fb0, 0x0040, 503 0x2180, 0x6900, 0xa184, 0x0001, 0x0040, 0x1ea0, 0x6028, 0xa084,
499 0x1fb0, 0x6912, 0x6030, 0xa005, 0x00c0, 0x1e70, 0x2001, 0x001e, 504 0x00ff, 0x00c0, 0x2041, 0x6800, 0xa084, 0x0001, 0x0040, 0x2049,
500 0x8000, 0x6816, 0x6028, 0xa084, 0x00ff, 0x0040, 0x1fac, 0x6806, 505 0x6803, 0x0000, 0x680b, 0x0000, 0x6807, 0x0000, 0x0078, 0x2051,
501 0x6028, 0x8007, 0xa084, 0x00ff, 0x0040, 0x1fac, 0x680a, 0x6a02, 506 0x2011, 0x0001, 0x6020, 0xd0f4, 0x0040, 0x1ea8, 0xa295, 0x0002,
502 0x0078, 0x1fb4, 0x2001, 0x5167, 0x2004, 0xa084, 0x8000, 0x0040, 507 0xd0c4, 0x0040, 0x1ead, 0xa295, 0x0008, 0xd0cc, 0x0040, 0x1eb2,
503 0x1fac, 0x6114, 0x1078, 0x20e3, 0x2091, 0x8000, 0x6a04, 0x6b08, 508 0xa295, 0x0400, 0x601c, 0xa084, 0x0002, 0x0040, 0x1eb9, 0xa295,
504 0x6418, 0xa484, 0x0003, 0x0040, 0x1ea8, 0x6128, 0xa18c, 0x00ff, 509 0x0004, 0x602c, 0xa08c, 0x00ff, 0xa182, 0x0002, 0x0048, 0x204d,
505 0x8001, 0x00c0, 0x1ea1, 0x2100, 0xa210, 0x0048, 0x1ece, 0x0078, 510 0xa182, 0x001b, 0x00c8, 0x204d, 0x0040, 0x204d, 0x690e, 0x602c,
506 0x1ea8, 0x8001, 0x00c0, 0x1ece, 0x2100, 0xa212, 0x0048, 0x1ece, 511 0x8007, 0xa08c, 0x00ff, 0xa182, 0x0002, 0x0048, 0x204d, 0xa182,
507 0xa484, 0x000c, 0x0040, 0x1ec2, 0x6128, 0x810f, 0xa18c, 0x00ff, 512 0x001b, 0x00c8, 0x204d, 0x0040, 0x204d, 0x6912, 0x6030, 0xa005,
508 0xa082, 0x0004, 0x00c0, 0x1eba, 0x2100, 0xa318, 0x0048, 0x1ece, 513 0x00c0, 0x1edc, 0x2001, 0x001e, 0x8000, 0x6816, 0x6028, 0xa084,
509 0x0078, 0x1ec2, 0xa082, 0x0004, 0x00c0, 0x1ece, 0x2100, 0xa31a, 514 0x00ff, 0x0040, 0x2049, 0x6806, 0x6028, 0x8007, 0xa084, 0x00ff,
510 0x0048, 0x1ece, 0x6030, 0xa005, 0x0040, 0x1ec8, 0x8000, 0x6816, 515 0x0040, 0x2049, 0x680a, 0x6a02, 0x0078, 0x2051, 0x2001, 0x5240,
511 0x6a06, 0x6b0a, 0x2091, 0x8001, 0x0078, 0x1fb4, 0x2091, 0x8001, 516 0x2004, 0xa086, 0x0007, 0x00c0, 0x1f53, 0x2001, 0x5267, 0x2004,
512 0x0078, 0x1fb0, 0x6114, 0x1078, 0x20e3, 0x2091, 0x8000, 0x6b08, 517 0xa084, 0x8000, 0x0040, 0x2049, 0x6114, 0x1078, 0x2180, 0x2001,
513 0x8318, 0x0048, 0x1ee0, 0x6b0a, 0x2091, 0x8001, 0x0078, 0x1fc3, 518 0x5252, 0x2004, 0x2010, 0x82ff, 0x0040, 0x1f0e, 0xa080, 0x0005,
514 0x2091, 0x8001, 0x0078, 0x1fb0, 0x6024, 0x8007, 0xa084, 0x00ff, 519 0x2004, 0xa084, 0x00ff, 0xa106, 0x00c0, 0x1f53, 0x2091, 0x8000,
515 0x0040, 0x1f02, 0xa086, 0x0080, 0x00c0, 0x1f2a, 0x20a9, 0x0008, 520 0x6a04, 0x6b08, 0x6418, 0xa484, 0x0003, 0x0040, 0x1f2d, 0x6128,
516 0x2069, 0x7510, 0x2091, 0x8000, 0x6800, 0xa084, 0xfcff, 0x6802, 521 0xa18c, 0x00ff, 0x8001, 0x00c0, 0x1f23, 0x2100, 0xa210, 0x0048,
517 0xade8, 0x0008, 0x0070, 0x1efe, 0x0078, 0x1ef4, 0x2091, 0x8001, 522 0x1f53, 0x0078, 0x1f2d, 0x8001, 0x00c0, 0x1f53, 0x2100, 0xa212,
518 0x0078, 0x1fb4, 0x6028, 0xa015, 0x0040, 0x1f2a, 0x6114, 0x1078, 523 0x0048, 0x1f53, 0x82ff, 0x0040, 0x1f53, 0xa484, 0x000c, 0x0040,
519 0x20e3, 0x0d7e, 0xade8, 0x0007, 0x2091, 0x8000, 0x6800, 0xa00d, 524 0x1f47, 0x6128, 0x810f, 0xa18c, 0x00ff, 0xa082, 0x0004, 0x00c0,
520 0x0040, 0x1f27, 0xa206, 0x0040, 0x1f18, 0x2168, 0x0078, 0x1f0e, 525 0x1f3f, 0x2100, 0xa318, 0x0048, 0x1f53, 0x0078, 0x1f47, 0xa082,
521 0x0c7e, 0x2160, 0x6000, 0x6802, 0x1078, 0x1948, 0x0c7f, 0x0d7f, 526 0x0004, 0x00c0, 0x1f53, 0x2100, 0xa31a, 0x0048, 0x1f53, 0x6030,
522 0x6808, 0x8000, 0x680a, 0x2091, 0x8001, 0x0078, 0x1fc3, 0x2091, 527 0xa005, 0x0040, 0x1f4d, 0x8000, 0x6816, 0x6a06, 0x6b0a, 0x2091,
523 0x8001, 0x0d7f, 0x0078, 0x1fac, 0x6114, 0x1078, 0x20e3, 0x6800, 528 0x8001, 0x0078, 0x2051, 0x2091, 0x8001, 0x0078, 0x204d, 0x6114,
524 0xa084, 0x0001, 0x0040, 0x1f9c, 0x2091, 0x8000, 0x6a04, 0x8210, 529 0x1078, 0x2180, 0x2091, 0x8000, 0x6b08, 0x8318, 0x0048, 0x1f65,
525 0x0048, 0x1f3f, 0x6a06, 0x2091, 0x8001, 0x0078, 0x1fc3, 0x2091, 530 0x6b0a, 0x2091, 0x8001, 0x0078, 0x2060, 0x2091, 0x8001, 0x0078,
526 0x8001, 0x0078, 0x1fb0, 0x1078, 0x1b53, 0x00c0, 0x1d66, 0x6114, 531 0x204d, 0x6024, 0x8007, 0xa084, 0x00ff, 0x0040, 0x1f87, 0xa086,
527 0x1078, 0x20e3, 0x60be, 0x60bb, 0x0000, 0x6900, 0xa184, 0x0008, 532 0x0080, 0x00c0, 0x1fc7, 0x20a9, 0x0008, 0x2069, 0x7610, 0x2091,
528 0x0040, 0x1f56, 0x6020, 0xa085, 0x0100, 0x6022, 0xa184, 0x0001, 533 0x8000, 0x6800, 0xa084, 0xfcff, 0x6802, 0xade8, 0x0008, 0x0070,
529 0x0040, 0x1fac, 0xa184, 0x0100, 0x00c0, 0x1f98, 0xa184, 0x0200, 534 0x1f83, 0x0078, 0x1f79, 0x2091, 0x8001, 0x0078, 0x2051, 0x6028,
530 0x00c0, 0x1f94, 0x681c, 0xa005, 0x00c0, 0x1fa0, 0x6004, 0xa084, 535 0xa015, 0x0040, 0x1fc7, 0x6114, 0x1078, 0x2180, 0x0c7e, 0x0d7e,
531 0x00ff, 0xa086, 0x000f, 0x00c0, 0x1f6f, 0x1078, 0x20c6, 0x78df, 536 0xade8, 0x0007, 0x2091, 0x8000, 0x6800, 0xa00d, 0x0040, 0x1fc3,
532 0x0000, 0x6004, 0x8007, 0xa084, 0x00ff, 0x78d2, 0x8001, 0x609f, 537 0xa206, 0x0040, 0x1f9e, 0x2168, 0x0078, 0x1f94, 0x2160, 0x6000,
533 0x0000, 0x0040, 0x1f84, 0x1078, 0x1fc7, 0x0040, 0x1f84, 0x78dc, 538 0x6802, 0x2c68, 0x1078, 0x19ac, 0x0d7f, 0x6818, 0xa00d, 0x0040,
534 0xa085, 0x0100, 0x78de, 0x007c, 0x78d7, 0x0000, 0x78db, 0x0000, 539 0x1fbb, 0x2060, 0x6200, 0x6a1a, 0x6a1c, 0x6202, 0x681e, 0x1078,
535 0x6024, 0xa084, 0xff00, 0x6026, 0x1078, 0x39de, 0x0040, 0x1ce3, 540 0x1989, 0x2da0, 0x2198, 0x20a9, 0x0031, 0x53a3, 0x2d60, 0x1078,
536 0x1078, 0x1b78, 0x0078, 0x1ce3, 0x2009, 0x0017, 0x0078, 0x1fb6, 541 0x1ccb, 0x0078, 0x1fbe, 0x6808, 0x8000, 0x680a, 0x2091, 0x8001,
537 0x2009, 0x000e, 0x0078, 0x1fb6, 0x2009, 0x0007, 0x0078, 0x1fb6, 542 0x0c7f, 0x0078, 0x2060, 0x2091, 0x8001, 0x0d7f, 0x0c7f, 0x0078,
538 0x2009, 0x0035, 0x0078, 0x1fb6, 0x2009, 0x003e, 0x0078, 0x1fb6, 543 0x2049, 0x6114, 0x1078, 0x2180, 0x6800, 0xa084, 0x0001, 0x0040,
539 0x2009, 0x0004, 0x0078, 0x1fb6, 0x2009, 0x0006, 0x0078, 0x1fb6, 544 0x2039, 0x2091, 0x8000, 0x6a04, 0x8210, 0x0048, 0x1fdc, 0x6a06,
540 0x2009, 0x0016, 0x0078, 0x1fb6, 0x2009, 0x0001, 0x6024, 0xa084, 545 0x2091, 0x8001, 0x0078, 0x2060, 0x2091, 0x8001, 0x0078, 0x204d,
541 0xff00, 0xa105, 0x6026, 0x2091, 0x8000, 0x1078, 0x1c5f, 0x2091, 546 0x1078, 0x1bc4, 0x00c0, 0x1dd2, 0x6114, 0x1078, 0x2180, 0x60be,
542 0x8001, 0x0078, 0x1ce3, 0x1078, 0x1948, 0x0078, 0x1ce3, 0x78d4, 547 0x60bb, 0x0000, 0x6900, 0xa184, 0x0008, 0x0040, 0x1ff3, 0x6020,
543 0xa06d, 0x00c0, 0x1fd2, 0x2c00, 0x78d6, 0x78da, 0x609f, 0x0000, 548 0xa085, 0x0100, 0x6022, 0xa184, 0x0001, 0x0040, 0x2049, 0xa184,
544 0x0078, 0x1fde, 0x2c00, 0x689e, 0x609f, 0x0000, 0x78d6, 0x2d00, 549 0x0100, 0x00c0, 0x2035, 0xa184, 0x0200, 0x00c0, 0x2031, 0x681c,
545 0x6002, 0x78d8, 0xad06, 0x00c0, 0x1fde, 0x6002, 0x78d0, 0x8001, 550 0xa005, 0x00c0, 0x203d, 0x6004, 0xa084, 0x00ff, 0xa086, 0x000f,
546 0x78d2, 0x00c0, 0x1fea, 0x78dc, 0xa084, 0xfeff, 0x78de, 0x78d8, 551 0x00c0, 0x200c, 0x1078, 0x2163, 0x78df, 0x0000, 0x6004, 0x8007,
547 0x2060, 0xa006, 0x007c, 0xa02e, 0x2530, 0x611c, 0x61a2, 0xa184, 552 0xa084, 0x00ff, 0x78d2, 0x8001, 0x609f, 0x0000, 0x0040, 0x2021,
548 0xe1ff, 0x601e, 0xa184, 0x0060, 0x0040, 0x1ffa, 0x0e7e, 0x1078, 553 0x1078, 0x2064, 0x0040, 0x2021, 0x78dc, 0xa085, 0x0100, 0x78de,
549 0x47c2, 0x0e7f, 0x6596, 0x65a6, 0x669a, 0x66aa, 0x60af, 0x0000, 554 0x007c, 0x78d7, 0x0000, 0x78db, 0x0000, 0x6024, 0xa084, 0xff00,
550 0x60b3, 0x0000, 0x6714, 0x1078, 0x1973, 0x2091, 0x8000, 0x60a0, 555 0x6026, 0x1078, 0x3aac, 0x0040, 0x1d4f, 0x1078, 0x1be9, 0x0078,
551 0xa084, 0x8000, 0x00c0, 0x2021, 0x6808, 0xa084, 0x0001, 0x0040, 556 0x1d4f, 0x2009, 0x0017, 0x0078, 0x2053, 0x2009, 0x000e, 0x0078,
552 0x2021, 0x2091, 0x8001, 0x1078, 0x19c0, 0x2091, 0x8000, 0x1078, 557 0x2053, 0x2009, 0x0007, 0x0078, 0x2053, 0x2009, 0x0035, 0x0078,
553 0x1c5f, 0x2091, 0x8001, 0x78d7, 0x0000, 0x78db, 0x0000, 0x0078, 558 0x2053, 0x2009, 0x003e, 0x0078, 0x2053, 0x2009, 0x0004, 0x0078,
554 0x2093, 0x6024, 0xa096, 0x0001, 0x00c0, 0x2028, 0x8000, 0x6026, 559 0x2053, 0x2009, 0x0006, 0x0078, 0x2053, 0x2009, 0x0016, 0x0078,
555 0x6a10, 0x6814, 0x2091, 0x8001, 0xa202, 0x0048, 0x2037, 0x0040, 560 0x2053, 0x2009, 0x0001, 0x6024, 0xa084, 0xff00, 0xa105, 0x6026,
556 0x2037, 0x2039, 0x0200, 0x1078, 0x2094, 0x0078, 0x2093, 0x2c08, 561 0x2091, 0x8000, 0x1078, 0x1ccb, 0x2091, 0x8001, 0x0078, 0x1d4f,
557 0x2091, 0x8000, 0x60a0, 0xa084, 0x8000, 0x0040, 0x2064, 0x6800, 562 0x1078, 0x199a, 0x0078, 0x1d4f, 0x78d4, 0xa06d, 0x00c0, 0x206f,
558 0xa065, 0x0040, 0x2069, 0x6a04, 0x0e7e, 0x2071, 0x5140, 0x7000, 563 0x2c00, 0x78d6, 0x78da, 0x609f, 0x0000, 0x0078, 0x207b, 0x2c00,
559 0xa084, 0x0001, 0x0040, 0x205e, 0x7048, 0xa206, 0x00c0, 0x205e, 564 0x689e, 0x609f, 0x0000, 0x78d6, 0x2d00, 0x6002, 0x78d8, 0xad06,
560 0x6b04, 0x231c, 0x2160, 0x6302, 0x2300, 0xa005, 0x00c0, 0x2059, 565 0x00c0, 0x207b, 0x6002, 0x78d0, 0x8001, 0x78d2, 0x00c0, 0x2087,
561 0x6902, 0x2260, 0x6102, 0x0e7f, 0x0078, 0x2070, 0x2160, 0x6202, 566 0x78dc, 0xa084, 0xfeff, 0x78de, 0x78d8, 0x2060, 0xa006, 0x007c,
562 0x6906, 0x0e7f, 0x0078, 0x2070, 0x6800, 0xa065, 0x0040, 0x2069, 567 0xa02e, 0x2530, 0x611c, 0x61a2, 0xa184, 0xe1ff, 0x601e, 0xa184,
563 0x6102, 0x6902, 0x00c0, 0x206d, 0x6906, 0x2160, 0x6003, 0x0000, 568 0x0060, 0x0040, 0x2097, 0x0e7e, 0x1078, 0x48d3, 0x0e7f, 0x6596,
564 0x2160, 0x60a0, 0xa084, 0x8000, 0x0040, 0x207a, 0x6808, 0xa084, 569 0x65a6, 0x669a, 0x66aa, 0x60af, 0x0000, 0x60b3, 0x0000, 0x6714,
565 0xfffc, 0x680a, 0x6810, 0x8000, 0x6812, 0x2091, 0x8001, 0x6808, 570 0x1078, 0x19c5, 0x2091, 0x8000, 0x60a0, 0xa084, 0x8000, 0x00c0,
566 0xa08c, 0x0040, 0x0040, 0x2089, 0xa086, 0x0040, 0x680a, 0x1078, 571 0x20be, 0x6808, 0xa084, 0x0001, 0x0040, 0x20be, 0x2091, 0x8001,
567 0x19d1, 0x2091, 0x8000, 0x1078, 0x21d2, 0x2091, 0x8001, 0x78db, 572 0x1078, 0x1a31, 0x2091, 0x8000, 0x1078, 0x1ccb, 0x2091, 0x8001,
568 0x0000, 0x78d7, 0x0000, 0x007c, 0x6008, 0xa705, 0x600a, 0x2091, 573 0x78d7, 0x0000, 0x78db, 0x0000, 0x0078, 0x2130, 0x6024, 0xa096,
569 0x8000, 0x1078, 0x1c5f, 0x2091, 0x8001, 0x78d8, 0xa065, 0x0040, 574 0x0001, 0x00c0, 0x20c5, 0x8000, 0x6026, 0x6a10, 0x6814, 0x2091,
570 0x20a7, 0x609c, 0x78da, 0x609f, 0x0000, 0x0078, 0x2097, 0x78d7, 575 0x8001, 0xa202, 0x0048, 0x20d4, 0x0040, 0x20d4, 0x2039, 0x0200,
571 0x0000, 0x78db, 0x0000, 0x007c, 0x7990, 0x7894, 0x8000, 0xa10a, 576 0x1078, 0x2131, 0x0078, 0x2130, 0x2c08, 0x2091, 0x8000, 0x60a0,
572 0x00c8, 0x20b3, 0xa006, 0x7896, 0x70d2, 0x7804, 0xa005, 0x0040, 577 0xa084, 0x8000, 0x0040, 0x2101, 0x6800, 0xa065, 0x0040, 0x2106,
573 0x20c1, 0x8001, 0x7806, 0x00c0, 0x20c1, 0x0068, 0x20c1, 0x2091, 578 0x6a04, 0x0e7e, 0x2071, 0x5240, 0x7000, 0xa084, 0x0001, 0x0040,
574 0x4080, 0x007c, 0x2039, 0x20da, 0x0078, 0x20c8, 0x2039, 0x20e0, 579 0x20fb, 0x7048, 0xa206, 0x00c0, 0x20fb, 0x6b04, 0x231c, 0x2160,
575 0x2704, 0xa005, 0x0040, 0x20d9, 0xac00, 0x2068, 0x6b08, 0x6c0c, 580 0x6302, 0x2300, 0xa005, 0x00c0, 0x20f6, 0x6902, 0x2260, 0x6102,
576 0x6910, 0x6a14, 0x690a, 0x6a0e, 0x6b12, 0x6c16, 0x8738, 0x0078, 581 0x0e7f, 0x0078, 0x210d, 0x2160, 0x6202, 0x6906, 0x0e7f, 0x0078,
577 0x20c8, 0x007c, 0x0003, 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 582 0x210d, 0x6800, 0xa065, 0x0040, 0x2106, 0x6102, 0x6902, 0x00c0,
578 0x0015, 0x001b, 0x0000, 0x0c7e, 0x1078, 0x3b69, 0x2c68, 0x0c7f, 583 0x210a, 0x6906, 0x2160, 0x6003, 0x0000, 0x2160, 0x60a0, 0xa084,
579 0x007c, 0x0010, 0x215a, 0x0068, 0x215a, 0x2029, 0x0000, 0x78cb, 584 0x8000, 0x0040, 0x2117, 0x6808, 0xa084, 0xfffc, 0x680a, 0x6810,
580 0x0000, 0x788c, 0xa065, 0x0040, 0x2153, 0x2009, 0x5174, 0x2104, 585 0x8000, 0x6812, 0x2091, 0x8001, 0x6808, 0xa08c, 0x0040, 0x0040,
581 0xa084, 0x0001, 0x0040, 0x2121, 0x6004, 0xa086, 0x0103, 0x00c0, 586 0x2126, 0xa086, 0x0040, 0x680a, 0x1078, 0x1a42, 0x2091, 0x8000,
582 0x2121, 0x6018, 0xa005, 0x00c0, 0x2121, 0x6014, 0xa005, 0x00c0, 587 0x1078, 0x226f, 0x2091, 0x8001, 0x78db, 0x0000, 0x78d7, 0x0000,
583 0x2121, 0x0d7e, 0x2069, 0x0000, 0x6818, 0xa084, 0x0001, 0x00c0, 588 0x007c, 0x6008, 0xa705, 0x600a, 0x2091, 0x8000, 0x1078, 0x1ccb,
584 0x2120, 0x600c, 0x70c6, 0x6010, 0x70ca, 0x70c3, 0x8020, 0x681b, 589 0x2091, 0x8001, 0x78d8, 0xa065, 0x0040, 0x2144, 0x609c, 0x78da,
585 0x0001, 0x2091, 0x4080, 0x0d7f, 0x1078, 0x1c86, 0x0078, 0x2158, 590 0x609f, 0x0000, 0x0078, 0x2134, 0x78d7, 0x0000, 0x78db, 0x0000,
586 0x0d7f, 0x1078, 0x215b, 0x0040, 0x2153, 0x6204, 0xa294, 0x00ff, 591 0x007c, 0x7990, 0x7894, 0x8000, 0xa10a, 0x00c8, 0x2150, 0xa006,
587 0xa296, 0x0003, 0x0040, 0x2133, 0x6204, 0xa296, 0x0110, 0x00c0, 592 0x7896, 0x70d2, 0x7804, 0xa005, 0x0040, 0x215e, 0x8001, 0x7806,
588 0x2141, 0x78cb, 0x0001, 0x6204, 0xa294, 0xff00, 0x8217, 0x8211, 593 0x00c0, 0x215e, 0x0068, 0x215e, 0x2091, 0x4080, 0x007c, 0x2039,
589 0x0040, 0x2141, 0x85ff, 0x00c0, 0x2153, 0x8210, 0xa202, 0x00c8, 594 0x2177, 0x0078, 0x2165, 0x2039, 0x217d, 0x2704, 0xa005, 0x0040,
590 0x2153, 0x057e, 0x1078, 0x216a, 0x057f, 0x0040, 0x214e, 0x78e0, 595 0x2176, 0xac00, 0x2068, 0x6b08, 0x6c0c, 0x6910, 0x6a14, 0x690a,
591 0xa086, 0x0003, 0x0040, 0x2153, 0x0078, 0x2141, 0x8528, 0x78c8, 596 0x6a0e, 0x6b12, 0x6c16, 0x8738, 0x0078, 0x2165, 0x007c, 0x0003,
592 0xa005, 0x0040, 0x20f1, 0x85ff, 0x0040, 0x215a, 0x2091, 0x4080, 597 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0015, 0x001b, 0x0000,
593 0x78b0, 0x70d6, 0x007c, 0x7bac, 0x79b0, 0x70d4, 0xa102, 0x00c0, 598 0x0c7e, 0x1078, 0x3c3b, 0x2c68, 0x0c7f, 0x007c, 0x0010, 0x21f7,
594 0x2164, 0x2300, 0xa005, 0x007c, 0x0048, 0x2168, 0xa302, 0x007c, 599 0x0068, 0x21f7, 0x2029, 0x0000, 0x78cb, 0x0000, 0x788c, 0xa065,
595 0x8002, 0x007c, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x00c8, 600 0x0040, 0x21f0, 0x2009, 0x5274, 0x2104, 0xa084, 0x0001, 0x0040,
596 0x2184, 0x2091, 0x8000, 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0, 601 0x21be, 0x6004, 0xa086, 0x0103, 0x00c0, 0x21be, 0x6018, 0xa005,
597 0x21b9, 0x7008, 0x7208, 0xa206, 0x00c0, 0x21b9, 0xa286, 0x0008, 602 0x00c0, 0x21be, 0x6014, 0xa005, 0x00c0, 0x21be, 0x0d7e, 0x2069,
598 0x00c0, 0x21b9, 0x2071, 0x0010, 0x1078, 0x21be, 0x2009, 0x0020, 603 0x0000, 0x6818, 0xa084, 0x0001, 0x00c0, 0x21bd, 0x600c, 0x70c6,
599 0x6004, 0xa086, 0x0103, 0x00c0, 0x2193, 0x6028, 0xa005, 0x00c0, 604 0x6010, 0x70ca, 0x70c3, 0x8020, 0x681b, 0x0001, 0x2091, 0x4080,
600 0x2193, 0x2009, 0x000c, 0x1078, 0x1924, 0x0040, 0x21ac, 0x78c4, 605 0x0d7f, 0x1078, 0x1cf2, 0x0078, 0x21f5, 0x0d7f, 0x1078, 0x21f8,
601 0x8000, 0x78c6, 0xa086, 0x0002, 0x00c0, 0x21b9, 0x2091, 0x8000, 606 0x0040, 0x21f0, 0x6204, 0xa294, 0x00ff, 0xa296, 0x0003, 0x0040,
602 0x78e3, 0x0003, 0x78c7, 0x0000, 0x78cc, 0xa085, 0x0300, 0x78ce, 607 0x21d0, 0x6204, 0xa296, 0x0110, 0x00c0, 0x21de, 0x78cb, 0x0001,
603 0x2091, 0x8001, 0x0078, 0x21b9, 0x78c7, 0x0000, 0x1078, 0x1c86, 608 0x6204, 0xa294, 0xff00, 0x8217, 0x8211, 0x0040, 0x21de, 0x85ff,
604 0x79ac, 0x78b0, 0x8000, 0xa10a, 0x00c8, 0x21b7, 0xa006, 0x78b2, 609 0x00c0, 0x21f0, 0x8210, 0xa202, 0x00c8, 0x21f0, 0x057e, 0x1078,
605 0xa006, 0x2071, 0x0010, 0x2091, 0x8001, 0x007c, 0x8107, 0x8004, 610 0x2207, 0x057f, 0x0040, 0x21eb, 0x78e0, 0xa086, 0x0003, 0x0040,
606 0x8004, 0x7ab8, 0x7bb4, 0x7cc0, 0x7dbc, 0xa210, 0xa399, 0x0000, 611 0x21f0, 0x0078, 0x21de, 0x8528, 0x78c8, 0xa005, 0x0040, 0x218e,
607 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x007c, 0x2009, 0x515b, 0x2091, 612 0x85ff, 0x0040, 0x21f7, 0x2091, 0x4080, 0x78b0, 0x70d6, 0x007c,
608 0x8000, 0x200a, 0x0f7e, 0x0e7e, 0x2071, 0x5140, 0x7000, 0xa086, 613 0x7bac, 0x79b0, 0x70d4, 0xa102, 0x00c0, 0x2201, 0x2300, 0xa005,
609 0x0000, 0x00c0, 0x21ec, 0x2009, 0x5112, 0x2104, 0xa005, 0x00c0, 614 0x007c, 0x0048, 0x2205, 0xa302, 0x007c, 0x8002, 0x007c, 0x2001,
610 0x21ec, 0x2079, 0x0100, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x21ec, 615 0x04fd, 0x2004, 0xa082, 0x0005, 0x00c8, 0x2221, 0x2091, 0x8000,
611 0x0018, 0x21ec, 0x781b, 0x004b, 0x0e7f, 0x0f7f, 0x007c, 0x0f7e, 616 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0, 0x2256, 0x7008, 0x7208,
612 0x0e7e, 0x2071, 0x5140, 0x2091, 0x8000, 0x7000, 0xa086, 0x0000, 617 0xa206, 0x00c0, 0x2256, 0xa286, 0x0008, 0x00c0, 0x2256, 0x2071,
613 0x00c0, 0x2205, 0x2079, 0x0100, 0x7830, 0xa084, 0x00c0, 0x00c0, 618 0x0010, 0x1078, 0x225b, 0x2009, 0x0020, 0x6004, 0xa086, 0x0103,
614 0x2205, 0x0018, 0x2205, 0x781b, 0x004d, 0x2091, 0x8001, 0x0e7f, 619 0x00c0, 0x2230, 0x6028, 0xa005, 0x00c0, 0x2230, 0x2009, 0x000c,
615 0x0f7f, 0x007c, 0x127e, 0x2091, 0x2300, 0x2071, 0x5140, 0x2079, 620 0x1078, 0x1976, 0x0040, 0x2249, 0x78c4, 0x8000, 0x78c6, 0xa086,
616 0x0100, 0x784b, 0x000f, 0x0098, 0x2218, 0x7838, 0x0078, 0x2211, 621 0x0002, 0x00c0, 0x2256, 0x2091, 0x8000, 0x78e3, 0x0003, 0x78c7,
617 0x20a9, 0x0040, 0x7800, 0xa082, 0x0004, 0x0048, 0x2221, 0x20a9, 622 0x0000, 0x78cc, 0xa085, 0x0300, 0x78ce, 0x2091, 0x8001, 0x0078,
618 0x0060, 0x789b, 0x0000, 0x78af, 0x0000, 0x78af, 0x0000, 0x0070, 623 0x2256, 0x78c7, 0x0000, 0x1078, 0x1cf2, 0x79ac, 0x78b0, 0x8000,
619 0x222b, 0x0078, 0x2223, 0x7800, 0xa082, 0x0004, 0x0048, 0x223a, 624 0xa10a, 0x00c8, 0x2254, 0xa006, 0x78b2, 0xa006, 0x2071, 0x0010,
620 0x70b7, 0x0096, 0x2019, 0x4ee7, 0x1078, 0x2276, 0x702f, 0x8001, 625 0x2091, 0x8001, 0x007c, 0x8107, 0x8004, 0x8004, 0x7ab8, 0x7bb4,
621 0x0078, 0x2246, 0x70b7, 0x0000, 0x2019, 0x4d5f, 0x1078, 0x2276, 626 0x7cc0, 0x7dbc, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9,
622 0x2019, 0x4d9e, 0x1078, 0x2276, 0x702f, 0x8000, 0x7003, 0x0000, 627 0x0000, 0x007c, 0x2009, 0x525b, 0x2091, 0x8000, 0x200a, 0x0f7e,
623 0x1078, 0x237f, 0x7004, 0xa084, 0x000f, 0x017e, 0x2009, 0x04fd, 628 0x0e7e, 0x2071, 0x5240, 0x7000, 0xa086, 0x0000, 0x00c0, 0x2289,
624 0x210c, 0xa18a, 0x0005, 0x0048, 0x225b, 0x0038, 0x2261, 0xa085, 629 0x2009, 0x5212, 0x2104, 0xa005, 0x00c0, 0x2289, 0x2079, 0x0100,
625 0x6280, 0x0078, 0x2263, 0x0028, 0x2261, 0xa085, 0x6280, 0x0078, 630 0x7830, 0xa084, 0x00c0, 0x00c0, 0x2289, 0x0018, 0x2289, 0x781b,
626 0x2263, 0xa085, 0x62c0, 0x017f, 0x7806, 0x780f, 0xb204, 0x7843, 631 0x004b, 0x0e7f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x5240,
627 0x00d8, 0x7853, 0x0080, 0x780b, 0x0008, 0x7047, 0x0008, 0x7053, 632 0x2091, 0x8000, 0x7000, 0xa086, 0x0000, 0x00c0, 0x22a2, 0x2079,
628 0x517f, 0x704f, 0x0000, 0x127f, 0x2000, 0x007c, 0x137e, 0x147e, 633 0x0100, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x22a2, 0x0018, 0x22a2,
629 0x157e, 0x047e, 0x20a1, 0x012b, 0x2304, 0xa005, 0x789a, 0x0040, 634 0x781b, 0x004d, 0x2091, 0x8001, 0x0e7f, 0x0f7f, 0x007c, 0x127e,
630 0x2296, 0x8318, 0x2324, 0x8318, 0x2398, 0x24a8, 0xa484, 0xff00, 635 0x2091, 0x2300, 0x2071, 0x5240, 0x2079, 0x0100, 0x784b, 0x000f,
631 0x0040, 0x228e, 0xa482, 0x0100, 0x20a9, 0x0100, 0x2020, 0x53a6, 636 0x0098, 0x22b5, 0x7838, 0x0078, 0x22ae, 0x20a9, 0x0040, 0x7800,
632 0xa005, 0x00c0, 0x2285, 0x3318, 0x0078, 0x227c, 0x047f, 0x157f, 637 0xa082, 0x0004, 0x0048, 0x22be, 0x20a9, 0x0060, 0x789b, 0x0000,
633 0x147f, 0x137f, 0x007c, 0xa18c, 0x000f, 0x2011, 0x0101, 0x2204, 638 0x78af, 0x0000, 0x78af, 0x0000, 0x0070, 0x22c8, 0x0078, 0x22c0,
634 0xa084, 0xfff0, 0xa105, 0x2012, 0x1078, 0x237f, 0x007c, 0x2011, 639 0x7800, 0xa082, 0x0004, 0x0048, 0x22d7, 0x70b7, 0x0093, 0x2019,
635 0x0101, 0x20a9, 0x0009, 0x810b, 0x0070, 0x22b0, 0x0078, 0x22ab, 640 0x4ff0, 0x1078, 0x2313, 0x702f, 0x8001, 0x0078, 0x22e3, 0x70b7,
636 0xa18c, 0x0e00, 0x2204, 0xa084, 0xf1ff, 0xa105, 0x2012, 0x007c, 641 0x0000, 0x2019, 0x4e70, 0x1078, 0x2313, 0x2019, 0x4eaf, 0x1078,
637 0x2009, 0x0101, 0x20a9, 0x0005, 0x8213, 0x0070, 0x22c1, 0x0078, 642 0x2313, 0x702f, 0x8000, 0x7003, 0x0000, 0x1078, 0x2420, 0x7004,
638 0x22bc, 0xa294, 0x00e0, 0x2104, 0xa084, 0xff1f, 0xa205, 0x200a, 643 0xa084, 0x000f, 0x017e, 0x2009, 0x04fd, 0x210c, 0xa18a, 0x0005,
639 0x007c, 0x2011, 0x0101, 0x20a9, 0x000c, 0x810b, 0x0070, 0x22d2, 644 0x0048, 0x22f8, 0x0038, 0x22fe, 0xa085, 0x6280, 0x0078, 0x2300,
640 0x0078, 0x22cd, 0xa18c, 0xf000, 0x2204, 0xa084, 0x0fff, 0xa105, 645 0x0028, 0x22fe, 0xa085, 0x6280, 0x0078, 0x2300, 0xa085, 0x62c0,
641 0x2012, 0x007c, 0x2011, 0x0102, 0x2204, 0xa084, 0xffcf, 0xa105, 646 0x017f, 0x7806, 0x780f, 0xb204, 0x7843, 0x00d8, 0x7853, 0x0080,
642 0x2012, 0x007c, 0x8103, 0x8003, 0xa080, 0x0020, 0x0c7e, 0x2061, 647 0x780b, 0x0008, 0x7047, 0x0008, 0x7053, 0x527f, 0x704f, 0x0000,
643 0x0100, 0x609a, 0x62ac, 0x63ac, 0x0c7f, 0x007c, 0x8103, 0x8003, 648 0x127f, 0x2000, 0x007c, 0x137e, 0x147e, 0x157e, 0x047e, 0x20a1,
644 0xa080, 0x0022, 0x0c7e, 0x2061, 0x0100, 0x609a, 0x60a4, 0xa084, 649 0x012b, 0x2304, 0xa005, 0x789a, 0x0040, 0x2333, 0x8318, 0x2324,
645 0xffdf, 0x60ae, 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080, 0x0022, 650 0x8318, 0x2398, 0x24a8, 0xa484, 0xff00, 0x0040, 0x232b, 0xa482,
646 0x0c7e, 0x2061, 0x0100, 0x609a, 0x60a4, 0xa085, 0x0020, 0x60ae, 651 0x0100, 0x20a9, 0x0100, 0x2020, 0x53a6, 0xa005, 0x00c0, 0x2322,
647 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080, 0x0020, 0x0c7e, 0x2061, 652 0x3318, 0x0078, 0x2319, 0x047f, 0x157f, 0x147f, 0x137f, 0x007c,
648 0x0100, 0x609a, 0x60a4, 0x62ae, 0x2010, 0x60a4, 0x63ae, 0x2018, 653 0xa18c, 0x000f, 0x2011, 0x0101, 0x2204, 0xa084, 0xfff0, 0xa105,
649 0x0c7f, 0x007c, 0x2091, 0x8000, 0x0c7e, 0x0e7e, 0x6818, 0xa005, 654 0x2012, 0x1078, 0x2420, 0x007c, 0x2011, 0x0101, 0x20a9, 0x0009,
650 0x0040, 0x235d, 0x2061, 0x7500, 0x1078, 0x2365, 0x0040, 0x2349, 655 0x810b, 0x0070, 0x234d, 0x0078, 0x2348, 0xa18c, 0x0e00, 0x2204,
651 0x20a9, 0x0000, 0x2061, 0x7400, 0x0c7e, 0x1078, 0x2365, 0x0040, 656 0xa084, 0xf1ff, 0xa105, 0x2012, 0x007c, 0x2009, 0x0101, 0x20a9,
652 0x2339, 0x0c7f, 0x8c60, 0x0070, 0x2337, 0x0078, 0x232c, 0x0078, 657 0x0005, 0x8213, 0x0070, 0x235e, 0x0078, 0x2359, 0xa294, 0x00e0,
653 0x235d, 0x007f, 0xa082, 0x7400, 0x2071, 0x5140, 0x7086, 0x7182, 658 0x2104, 0xa084, 0xff1f, 0xa205, 0x200a, 0x007c, 0x2011, 0x0101,
654 0x2001, 0x0004, 0x706e, 0x7093, 0x000f, 0x1078, 0x21cd, 0x0078, 659 0x20a9, 0x000c, 0x810b, 0x0070, 0x236f, 0x0078, 0x236a, 0xa18c,
655 0x2359, 0x60c0, 0xa005, 0x00c0, 0x235d, 0x2071, 0x5140, 0x7182, 660 0xf000, 0x2204, 0xa084, 0x0fff, 0xa105, 0x2012, 0x007c, 0x2011,
656 0x2c00, 0x708a, 0x2001, 0x0006, 0x706e, 0x7093, 0x000f, 0x1078, 661 0x0102, 0x2204, 0xa084, 0xffcf, 0xa105, 0x2012, 0x007c, 0x8103,
657 0x21cd, 0x2001, 0x0000, 0x0078, 0x235f, 0x2001, 0x0001, 0x2091, 662 0x8003, 0xa080, 0x0020, 0x0c7e, 0x2061, 0x0100, 0x609a, 0x62ac,
658 0x8001, 0xa005, 0x0e7f, 0x0c7f, 0x007c, 0x2c04, 0xa005, 0x0040, 663 0x63ac, 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080, 0x0022, 0x0c7e,
659 0x237c, 0x2060, 0x600c, 0xa306, 0x00c0, 0x2379, 0x6010, 0xa206, 664 0x2061, 0x0100, 0x609a, 0x60a4, 0xa084, 0xffdf, 0x60ae, 0x0c7f,
660 0x00c0, 0x2379, 0x6014, 0xa106, 0x00c0, 0x2379, 0xa006, 0x0078, 665 0x007c, 0x8103, 0x8003, 0xa080, 0x0022, 0x0c7e, 0x2061, 0x0100,
661 0x237e, 0x6000, 0x0078, 0x2366, 0xa085, 0x0001, 0x007c, 0x2011, 666 0x609a, 0x60a4, 0xa085, 0x0020, 0x60ae, 0x0c7f, 0x007c, 0x8103,
662 0x5141, 0x220c, 0xa18c, 0x000f, 0x2011, 0x013b, 0x2204, 0xa084, 667 0x8003, 0xa080, 0x0020, 0x0c7e, 0x2061, 0x0100, 0x609a, 0x60a4,
663 0x0100, 0x0040, 0x2395, 0x2021, 0xff04, 0x2122, 0x810b, 0x810b, 668 0x62ae, 0x2010, 0x60a4, 0x63ae, 0x2018, 0x0c7f, 0x007c, 0x2091,
664 0x810b, 0x810b, 0xa18d, 0x0f00, 0x2104, 0x007c, 0x0e7e, 0x68e4, 669 0x8000, 0x0c7e, 0x0e7e, 0x6818, 0xa005, 0x0040, 0x23fe, 0x2061,
665 0xa08c, 0x0020, 0x0040, 0x23e9, 0xa084, 0x0006, 0x00c0, 0x23e9, 670 0x7600, 0x1078, 0x2406, 0x0040, 0x23e8, 0x20a9, 0x0000, 0x2061,
666 0x6014, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0f0, 671 0x7500, 0x0c7e, 0x1078, 0x2406, 0x0040, 0x23d6, 0x0c7f, 0x8c60,
667 0x5380, 0x7004, 0xa084, 0x000a, 0x00c0, 0x23e9, 0x7108, 0xa194, 672 0x0070, 0x23d4, 0x0078, 0x23c9, 0x0078, 0x23fe, 0x007f, 0xa082,
668 0xff00, 0x0040, 0x23e9, 0xa18c, 0x00ff, 0x2001, 0x000c, 0xa106, 673 0x7500, 0x2071, 0x5240, 0x7086, 0x7182, 0x2001, 0x0004, 0x706e,
669 0x0040, 0x23d0, 0x2001, 0x0012, 0xa106, 0x0040, 0x23d4, 0x2001, 674 0x7093, 0x000f, 0x7073, 0x0000, 0x1078, 0x226a, 0x0078, 0x23fa,
670 0x0014, 0xa106, 0x0040, 0x23d8, 0x2001, 0x0019, 0xa106, 0x0040, 675 0x60c0, 0xa005, 0x00c0, 0x23fe, 0x2071, 0x5240, 0x7182, 0x2c00,
671 0x23dc, 0x2001, 0x0032, 0xa106, 0x0040, 0x23e0, 0x0078, 0x23e4, 676 0x708a, 0x2001, 0x0006, 0x706e, 0x7093, 0x000f, 0x7073, 0x0000,
672 0x2009, 0x0012, 0x0078, 0x23e6, 0x2009, 0x0014, 0x0078, 0x23e6, 677 0x1078, 0x226a, 0x2001, 0x0000, 0x0078, 0x2400, 0x2001, 0x0001,
673 0x2009, 0x0019, 0x0078, 0x23e6, 0x2009, 0x0020, 0x0078, 0x23e6, 678 0x2091, 0x8001, 0xa005, 0x0e7f, 0x0c7f, 0x007c, 0x2c04, 0xa005,
674 0x2009, 0x003f, 0x0078, 0x23e6, 0x2011, 0x0000, 0x2100, 0xa205, 679 0x0040, 0x241d, 0x2060, 0x600c, 0xa306, 0x00c0, 0x241a, 0x6010,
675 0x700a, 0x0e7f, 0x007c, 0x0068, 0x23eb, 0x2091, 0x8000, 0x2071, 680 0xa206, 0x00c0, 0x241a, 0x6014, 0xa106, 0x00c0, 0x241a, 0xa006,
676 0x0000, 0x007e, 0x7018, 0xa084, 0x0001, 0x00c0, 0x23f2, 0x007f, 681 0x0078, 0x241f, 0x6000, 0x0078, 0x2407, 0xa085, 0x0001, 0x007c,
677 0x2071, 0x0010, 0x70ca, 0x007f, 0x70c6, 0x70c3, 0x8002, 0x70db, 682 0x2011, 0x5241, 0x220c, 0xa18c, 0x000f, 0x2011, 0x013b, 0x2204,
678 0x0741, 0x70df, 0x0000, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 683 0xa084, 0x0100, 0x0040, 0x2436, 0x2021, 0xff04, 0x2122, 0x810b,
679 0x4080, 0x0078, 0x2409, 0x107e, 0x007e, 0x127e, 0x2091, 0x2300, 684 0x810b, 0x810b, 0x810b, 0xa18d, 0x0f00, 0x2104, 0x007c, 0x0e7e,
680 0x7f3c, 0x7e58, 0x7c30, 0x7d38, 0x77c2, 0x74c6, 0x76ca, 0x75ce, 685 0x68e4, 0xa08c, 0x0020, 0x0040, 0x248a, 0xa084, 0x0006, 0x00c0,
681 0xa594, 0x003f, 0xa49c, 0x0003, 0xa484, 0x000f, 0x0079, 0x2420, 686 0x248a, 0x6014, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003,
682 0x2432, 0x2432, 0x2432, 0x276c, 0x393b, 0x2430, 0x2461, 0x246b, 687 0xa0f0, 0x5480, 0x7004, 0xa084, 0x000a, 0x00c0, 0x248a, 0x7108,
683 0x2430, 0x2430, 0x2430, 0x2430, 0x2430, 0x2430, 0x2430, 0x2430, 688 0xa194, 0xff00, 0x0040, 0x248a, 0xa18c, 0x00ff, 0x2001, 0x000c,
684 0x1078, 0x23eb, 0x8507, 0xa084, 0x001f, 0x0079, 0x2437, 0x2475, 689 0xa106, 0x0040, 0x2471, 0x2001, 0x0012, 0xa106, 0x0040, 0x2475,
685 0x276c, 0x2926, 0x2a23, 0x2a4b, 0x2ced, 0x2f98, 0x2fdb, 0x3026, 690 0x2001, 0x0014, 0xa106, 0x0040, 0x2479, 0x2001, 0x0019, 0xa106,
686 0x30ab, 0x3163, 0x320c, 0x2461, 0x2848, 0x2f6d, 0x2457, 0x3cc8, 691 0x0040, 0x247d, 0x2001, 0x0032, 0xa106, 0x0040, 0x2481, 0x0078,
687 0x3ce8, 0x3eae, 0x3eba, 0x3f8f, 0x2457, 0x2457, 0x4062, 0x4066, 692 0x2485, 0x2009, 0x0012, 0x0078, 0x2487, 0x2009, 0x0014, 0x0078,
688 0x3cc6, 0x2457, 0x3e19, 0x2457, 0x3b8c, 0x246b, 0x2457, 0x1078, 693 0x2487, 0x2009, 0x0019, 0x0078, 0x2487, 0x2009, 0x0020, 0x0078,
689 0x23eb, 0x0018, 0x2410, 0x127f, 0x2091, 0x8001, 0x007f, 0x107f, 694 0x2487, 0x2009, 0x003f, 0x0078, 0x2487, 0x2011, 0x0000, 0x2100,
690 0x007c, 0x2019, 0x4e3b, 0x1078, 0x2276, 0x702f, 0x0001, 0x781b, 695 0xa205, 0x700a, 0x0e7f, 0x007c, 0x0068, 0x248c, 0x2091, 0x8000,
691 0x004f, 0x0078, 0x2459, 0x2019, 0x4d9e, 0x1078, 0x2276, 0x702f, 696 0x2071, 0x0000, 0x007e, 0x7018, 0xa084, 0x0001, 0x00c0, 0x2493,
692 0x8000, 0x781b, 0x00d0, 0x0078, 0x2459, 0x7242, 0x2009, 0x510f, 697 0x007f, 0x2071, 0x0010, 0x70ca, 0x007f, 0x70c6, 0x70c3, 0x8002,
693 0x200b, 0x0000, 0xa584, 0x0001, 0x00c0, 0x3ba0, 0x0040, 0x2492, 698 0x70db, 0x0741, 0x70df, 0x0006, 0x2071, 0x0000, 0x701b, 0x0001,
694 0x1078, 0x23eb, 0x7003, 0x0000, 0x704b, 0x0000, 0x7043, 0x0000, 699 0x2091, 0x4080, 0x0078, 0x24aa, 0x107e, 0x007e, 0x127e, 0x2091,
695 0x7037, 0x0000, 0x1078, 0x3912, 0x0018, 0x2410, 0x2009, 0x510f, 700 0x2300, 0x7f3c, 0x7e58, 0x7c30, 0x7d38, 0x77c2, 0x74c6, 0x76ca,
696 0x200b, 0x0000, 0x7068, 0xa005, 0x00c0, 0x255d, 0x706c, 0xa084, 701 0x75ce, 0xa594, 0x003f, 0xa49c, 0x0003, 0xa484, 0x000f, 0x0079,
697 0x0007, 0x0079, 0x249b, 0x2594, 0x24a3, 0x24af, 0x24cc, 0x24ee, 702 0x24c1, 0x24d3, 0x24d3, 0x24d3, 0x280d, 0x3a09, 0x24d1, 0x2502,
698 0x253b, 0x2514, 0x24a3, 0x1078, 0x38fa, 0x2009, 0x0048, 0x1078, 703 0x250c, 0x24d1, 0x24d1, 0x24d1, 0x24d1, 0x24d1, 0x24d1, 0x24d1,
699 0x2e39, 0x00c0, 0x24ad, 0x7003, 0x0004, 0x0078, 0x2459, 0x1078, 704 0x24d1, 0x1078, 0x248c, 0x8507, 0xa084, 0x001f, 0x0079, 0x24d8,
700 0x38fa, 0x00c0, 0x24ca, 0x7080, 0x8007, 0x7882, 0x789b, 0x0010, 705 0x2516, 0x280d, 0x29c7, 0x2ac4, 0x2aec, 0x2d8c, 0x3037, 0x309a,
701 0x78ab, 0x000c, 0x789b, 0x0060, 0x78ab, 0x0001, 0x785b, 0x0004, 706 0x30fb, 0x3180, 0x3238, 0x32d6, 0x2502, 0x28e9, 0x300c, 0x24f8,
702 0x2009, 0x00e0, 0x1078, 0x2e2d, 0x00c0, 0x24ca, 0x7003, 0x0004, 707 0x3dac, 0x3dcc, 0x3f8f, 0x3f9b, 0x4074, 0x24f8, 0x24f8, 0x4149,
703 0x7093, 0x000f, 0x0078, 0x2459, 0x1078, 0x38fa, 0x00c0, 0x24ec, 708 0x414d, 0x3daa, 0x24f8, 0x3efa, 0x24f8, 0x3c5e, 0x250c, 0x24f8,
704 0x7180, 0x8107, 0x7882, 0x789b, 0x0010, 0xa18c, 0x001f, 0xa18d, 709 0x1078, 0x248c, 0x0018, 0x24b1, 0x127f, 0x2091, 0x8001, 0x007f,
705 0x00c0, 0x79aa, 0x78ab, 0x0006, 0x789b, 0x0060, 0x78ab, 0x0002, 710 0x107f, 0x007c, 0x2019, 0x4f49, 0x1078, 0x2313, 0x702f, 0x0001,
706 0x785b, 0x0004, 0x2009, 0x00e0, 0x1078, 0x2e2d, 0x00c0, 0x24ec, 711 0x781b, 0x004f, 0x0078, 0x24fa, 0x2019, 0x4eaf, 0x1078, 0x2313,
707 0x7003, 0x0004, 0x7093, 0x000f, 0x0078, 0x2459, 0x1078, 0x38fa, 712 0x702f, 0x8000, 0x781b, 0x00cd, 0x0078, 0x24fa, 0x7242, 0x2009,
708 0x00c0, 0x2512, 0x7180, 0x8107, 0x7882, 0x789b, 0x0010, 0xa18c, 713 0x520f, 0x200b, 0x0000, 0xa584, 0x0001, 0x00c0, 0x3c72, 0x0040,
709 0x001f, 0xa18d, 0x00c0, 0x79aa, 0x78ab, 0x0020, 0x7184, 0x79aa, 714 0x2533, 0x1078, 0x248c, 0x7003, 0x0000, 0x704b, 0x0000, 0x7043,
710 0x78ab, 0x000d, 0x789b, 0x0060, 0x78ab, 0x0004, 0x785b, 0x0004, 715 0x0000, 0x7037, 0x0000, 0x1078, 0x39e0, 0x0018, 0x24b1, 0x2009,
711 0x2009, 0x00e0, 0x1078, 0x2e2d, 0x00c0, 0x2512, 0x7003, 0x0004, 716 0x520f, 0x200b, 0x0000, 0x7068, 0xa005, 0x00c0, 0x25fe, 0x706c,
712 0x7093, 0x000f, 0x0078, 0x2459, 0x1078, 0x38fa, 0x00c0, 0x2539, 717 0xa084, 0x0007, 0x0079, 0x253c, 0x2635, 0x2544, 0x2550, 0x256d,
713 0x7180, 0x8107, 0x7882, 0x789b, 0x0010, 0xa18c, 0x001f, 0xa18d, 718 0x258f, 0x25dc, 0x25b5, 0x2544, 0x1078, 0x39c8, 0x2009, 0x0048,
714 0x00c0, 0x79aa, 0x78ab, 0x0006, 0x789b, 0x0060, 0x78ab, 0x0002, 719 0x1078, 0x2ed8, 0x00c0, 0x254e, 0x7003, 0x0004, 0x0078, 0x24fa,
715 0x785b, 0x0004, 0x2009, 0x00e0, 0x1078, 0x2e2d, 0x00c0, 0x2539, 720 0x1078, 0x39c8, 0x00c0, 0x256b, 0x7080, 0x8007, 0x7882, 0x789b,
716 0x7088, 0x708b, 0x0000, 0x2068, 0x704a, 0x7003, 0x0002, 0x7093, 721 0x0010, 0x78ab, 0x000c, 0x789b, 0x0060, 0x78ab, 0x0001, 0x785b,
717 0x000f, 0x0078, 0x2459, 0x1078, 0x38fa, 0x00c0, 0x2459, 0x7088, 722 0x0004, 0x2009, 0x00dd, 0x1078, 0x2ecc, 0x00c0, 0x256b, 0x7003,
718 0x2068, 0x6f14, 0x1078, 0x37ef, 0x2c50, 0x1078, 0x39ac, 0x789b, 723 0x0004, 0x7093, 0x000f, 0x0078, 0x24fa, 0x1078, 0x39c8, 0x00c0,
719 0x0010, 0x6814, 0xa084, 0x001f, 0xa085, 0x0080, 0x78aa, 0x6e1c, 724 0x258d, 0x7180, 0x8107, 0x7882, 0x789b, 0x0010, 0xa18c, 0x001f,
720 0x2041, 0x0001, 0x708c, 0xa084, 0x0400, 0x2001, 0x0004, 0x0040, 725 0xa18d, 0x00c0, 0x79aa, 0x78ab, 0x0006, 0x789b, 0x0060, 0x78ab,
721 0x255b, 0x2001, 0x0006, 0x0078, 0x267c, 0x1078, 0x38fa, 0x00c0, 726 0x0002, 0x785b, 0x0004, 0x2009, 0x00dd, 0x1078, 0x2ecc, 0x00c0,
722 0x2459, 0x789b, 0x0010, 0x7068, 0x2068, 0x6f14, 0x1078, 0x37ef, 727 0x258d, 0x7003, 0x0004, 0x7093, 0x000f, 0x0078, 0x24fa, 0x1078,
723 0x2c50, 0x1078, 0x39ac, 0x6008, 0xa085, 0x0010, 0x600a, 0x6824, 728 0x39c8, 0x00c0, 0x25b3, 0x7180, 0x8107, 0x7882, 0x789b, 0x0010,
724 0xa005, 0x0040, 0x257b, 0xa082, 0x0006, 0x0048, 0x2579, 0x0078, 729 0xa18c, 0x001f, 0xa18d, 0x00c0, 0x79aa, 0x78ab, 0x0020, 0x7184,
725 0x257b, 0x6827, 0x0005, 0x6b14, 0xa39c, 0x001f, 0xa39d, 0x00c0, 730 0x79aa, 0x78ab, 0x000d, 0x789b, 0x0060, 0x78ab, 0x0004, 0x785b,
726 0x7058, 0xa084, 0x8000, 0x0040, 0x2589, 0xa684, 0x0001, 0x0040, 731 0x0004, 0x2009, 0x00dd, 0x1078, 0x2ecc, 0x00c0, 0x25b3, 0x7003,
727 0x258b, 0xa39c, 0xffbf, 0x7baa, 0x2031, 0x0020, 0x2041, 0x0001, 732 0x0004, 0x7093, 0x000f, 0x0078, 0x24fa, 0x1078, 0x39c8, 0x00c0,
728 0x2001, 0x0003, 0x0078, 0x267c, 0x0018, 0x2410, 0x744c, 0xa485, 733 0x25da, 0x7180, 0x8107, 0x7882, 0x789b, 0x0010, 0xa18c, 0x001f,
729 0x0000, 0x0040, 0x25ae, 0xa080, 0x5180, 0x2030, 0x7150, 0x8108, 734 0xa18d, 0x00c0, 0x79aa, 0x78ab, 0x0006, 0x789b, 0x0060, 0x78ab,
730 0xa12a, 0x0048, 0x25a5, 0x2009, 0x5180, 0x2164, 0x6504, 0x85ff, 735 0x0002, 0x785b, 0x0004, 0x2009, 0x00dd, 0x1078, 0x2ecc, 0x00c0,
731 0x00c0, 0x25bf, 0x8421, 0x00c0, 0x259f, 0x7152, 0x7003, 0x0000, 736 0x25da, 0x7088, 0x708b, 0x0000, 0x2068, 0x704a, 0x7003, 0x0002,
732 0x704b, 0x0000, 0x7040, 0xa005, 0x0040, 0x3ba0, 0x0078, 0x2459, 737 0x7093, 0x000f, 0x0078, 0x24fa, 0x1078, 0x39c8, 0x00c0, 0x24fa,
733 0x764c, 0xa6b0, 0x5180, 0x7150, 0x2600, 0x0078, 0x25aa, 0x7152, 738 0x7088, 0x2068, 0x6f14, 0x1078, 0x38bd, 0x2c50, 0x1078, 0x3a7a,
734 0x2568, 0x2558, 0x754a, 0x2c50, 0x6034, 0xa085, 0x0000, 0x00c0, 739 0x789b, 0x0010, 0x6814, 0xa084, 0x001f, 0xa085, 0x0080, 0x78aa,
735 0x25bc, 0x6708, 0x773a, 0xa784, 0x033f, 0x0040, 0x25f5, 0xa784, 740 0x6e1c, 0x2041, 0x0001, 0x708c, 0xa084, 0x0400, 0x2001, 0x0004,
736 0x0021, 0x00c0, 0x25bc, 0xa784, 0x0002, 0x0040, 0x25de, 0xa784, 741 0x0040, 0x25fc, 0x2001, 0x0006, 0x0078, 0x271d, 0x1078, 0x39c8,
737 0x0004, 0x0040, 0x25bc, 0xa7bc, 0xfffb, 0x670a, 0xa784, 0x0008, 742 0x00c0, 0x24fa, 0x789b, 0x0010, 0x7068, 0x2068, 0x6f14, 0x1078,
738 0x00c0, 0x25bc, 0xa784, 0x0010, 0x00c0, 0x25bc, 0xa784, 0x0200, 743 0x38bd, 0x2c50, 0x1078, 0x3a7a, 0x6008, 0xa085, 0x0010, 0x600a,
739 0x00c0, 0x25bc, 0xa784, 0x0100, 0x0040, 0x25f5, 0x6018, 0xa005, 744 0x6824, 0xa005, 0x0040, 0x261c, 0xa082, 0x0006, 0x0048, 0x261a,
740 0x00c0, 0x25bc, 0xa7bc, 0xfeff, 0x670a, 0x6823, 0x0000, 0x6e1c, 745 0x0078, 0x261c, 0x6827, 0x0005, 0x6b14, 0xa39c, 0x001f, 0xa39d,
741 0xa684, 0x000e, 0x6118, 0x0040, 0x2605, 0x601c, 0xa102, 0x0048, 746 0x00c0, 0x7058, 0xa084, 0x8000, 0x0040, 0x262a, 0xa684, 0x0001,
742 0x2608, 0x0040, 0x2608, 0x0078, 0x25b8, 0x81ff, 0x00c0, 0x25b8, 747 0x0040, 0x262c, 0xa39c, 0xffbf, 0x7baa, 0x2031, 0x0020, 0x2041,
743 0x68c3, 0x0000, 0xa784, 0x0080, 0x00c0, 0x2610, 0x700c, 0x6022, 748 0x0001, 0x2001, 0x0003, 0x0078, 0x271d, 0x0018, 0x24b1, 0x744c,
744 0xa7bc, 0xff7f, 0x670a, 0x1078, 0x39ac, 0x0018, 0x2410, 0x789b, 749 0xa485, 0x0000, 0x0040, 0x264f, 0xa080, 0x5280, 0x2030, 0x7150,
745 0x0010, 0xa046, 0x1078, 0x38fa, 0x00c0, 0x2459, 0x6b14, 0xa39c, 750 0x8108, 0xa12a, 0x0048, 0x2646, 0x2009, 0x5280, 0x2164, 0x6504,
746 0x001f, 0xa39d, 0x00c0, 0x7058, 0xa084, 0x8000, 0x0040, 0x262c, 751 0x85ff, 0x00c0, 0x2660, 0x8421, 0x00c0, 0x2640, 0x7152, 0x7003,
747 0xa684, 0x0001, 0x0040, 0x262e, 0xa39c, 0xffbf, 0xa684, 0x0010, 752 0x0000, 0x704b, 0x0000, 0x7040, 0xa005, 0x0040, 0x3c72, 0x0078,
748 0x0040, 0x2634, 0xa39d, 0x0020, 0x7baa, 0x8840, 0xa684, 0x000e, 753 0x24fa, 0x764c, 0xa6b0, 0x5280, 0x7150, 0x2600, 0x0078, 0x264b,
749 0x00c0, 0x263f, 0xa7bd, 0x0010, 0x670a, 0x0078, 0x267a, 0x7158, 754 0x7152, 0x2568, 0x2558, 0x754a, 0x2c50, 0x6034, 0xa085, 0x0000,
750 0xa18c, 0x0800, 0x0040, 0x3401, 0x2011, 0x0020, 0xa684, 0x0008, 755 0x00c0, 0x265d, 0x6708, 0x773a, 0xa784, 0x033f, 0x0040, 0x2696,
751 0x00c0, 0x2650, 0x8210, 0xa684, 0x0002, 0x00c0, 0x2650, 0x8210, 756 0xa784, 0x0021, 0x00c0, 0x265d, 0xa784, 0x0002, 0x0040, 0x267f,
752 0x7aaa, 0x8840, 0x1078, 0x3912, 0x6a14, 0x610c, 0x8108, 0xa18c, 757 0xa784, 0x0004, 0x0040, 0x265d, 0xa7bc, 0xfffb, 0x670a, 0xa784,
753 0x00ff, 0xa1e0, 0x7400, 0x2c64, 0x8cff, 0x0040, 0x2671, 0x6014, 758 0x0008, 0x00c0, 0x265d, 0xa784, 0x0010, 0x00c0, 0x265d, 0xa784,
754 0xa206, 0x00c0, 0x265b, 0x60b8, 0x8001, 0x60ba, 0x00c0, 0x2656, 759 0x0200, 0x00c0, 0x265d, 0xa784, 0x0100, 0x0040, 0x2696, 0x6018,
755 0x0c7e, 0x2a60, 0x6008, 0xa085, 0x0100, 0x600a, 0x0c7f, 0x0078, 760 0xa005, 0x00c0, 0x265d, 0xa7bc, 0xfeff, 0x670a, 0x6823, 0x0000,
756 0x2594, 0x1078, 0x38fa, 0x00c0, 0x2459, 0x2a60, 0x610e, 0x79aa, 761 0x6e1c, 0xa684, 0x000e, 0x6118, 0x0040, 0x26a6, 0x601c, 0xa102,
757 0x8840, 0x7132, 0x2001, 0x0001, 0x007e, 0x715c, 0xa184, 0x0018, 762 0x0048, 0x26a9, 0x0040, 0x26a9, 0x0078, 0x2659, 0x81ff, 0x00c0,
758 0x0040, 0x2697, 0xa184, 0x0010, 0x0040, 0x268a, 0x1078, 0x3604, 763 0x2659, 0x68c3, 0x0000, 0xa784, 0x0080, 0x00c0, 0x26b1, 0x700c,
759 0x00c0, 0x26ba, 0xa184, 0x0008, 0x0040, 0x2697, 0x69a0, 0xa184, 764 0x6022, 0xa7bc, 0xff7f, 0x670a, 0x1078, 0x3a7a, 0x0018, 0x24b1,
760 0x0600, 0x00c0, 0x2697, 0x1078, 0x34f1, 0x0078, 0x26ba, 0x69a0, 765 0x789b, 0x0010, 0xa046, 0x1078, 0x39c8, 0x00c0, 0x24fa, 0x6b14,
761 0xa184, 0x0800, 0x0040, 0x26ae, 0x0c7e, 0x027e, 0x2960, 0x6000, 766 0xa39c, 0x001f, 0xa39d, 0x00c0, 0x7058, 0xa084, 0x8000, 0x0040,
762 0xa085, 0x2000, 0x6002, 0x6104, 0xa18d, 0x0010, 0x6106, 0x027f, 767 0x26cd, 0xa684, 0x0001, 0x0040, 0x26cf, 0xa39c, 0xffbf, 0xa684,
763 0x0c7f, 0x1078, 0x3604, 0x00c0, 0x26ba, 0x69a0, 0xa184, 0x0200, 768 0x0010, 0x0040, 0x26d5, 0xa39d, 0x0020, 0x7baa, 0x8840, 0xa684,
764 0x0040, 0x26b6, 0x1078, 0x3540, 0x0078, 0x26ba, 0xa184, 0x0400, 769 0x000e, 0x00c0, 0x26e0, 0xa7bd, 0x0010, 0x670a, 0x0078, 0x271b,
765 0x00c0, 0x2693, 0x69a0, 0xa184, 0x1000, 0x0040, 0x26c5, 0x6914, 770 0x7158, 0xa18c, 0x0800, 0x0040, 0x34cb, 0x2011, 0x0020, 0xa684,
766 0xa18c, 0xff00, 0x810f, 0x1078, 0x22ee, 0x007f, 0x7002, 0xa68c, 771 0x0008, 0x00c0, 0x26f1, 0x8210, 0xa684, 0x0002, 0x00c0, 0x26f1,
767 0x00e0, 0xa684, 0x0060, 0x0040, 0x26d3, 0xa086, 0x0060, 0x00c0, 772 0x8210, 0x7aaa, 0x8840, 0x1078, 0x39e0, 0x6a14, 0x610c, 0x8108,
768 0x26d3, 0xa18d, 0x4000, 0x88ff, 0x0040, 0x26d8, 0xa18d, 0x0004, 773 0xa18c, 0x00ff, 0xa1e0, 0x7500, 0x2c64, 0x8cff, 0x0040, 0x2712,
769 0x795a, 0x69b6, 0x789b, 0x0060, 0x2800, 0x78aa, 0x789b, 0x0061, 774 0x6014, 0xa206, 0x00c0, 0x26fc, 0x60b8, 0x8001, 0x60ba, 0x00c0,
770 0x6818, 0xa08d, 0x8000, 0xa084, 0x7fff, 0x691a, 0xa68c, 0x0080, 775 0x26f7, 0x0c7e, 0x2a60, 0x6008, 0xa085, 0x0100, 0x600a, 0x0c7f,
771 0x0040, 0x26f7, 0x7097, 0x0000, 0xa08a, 0x000d, 0x0050, 0x26f5, 776 0x0078, 0x2635, 0x1078, 0x39c8, 0x00c0, 0x24fa, 0x2a60, 0x610e,
772 0xa08a, 0x000c, 0x7196, 0x2001, 0x000c, 0x800c, 0x719a, 0x78aa, 777 0x79aa, 0x8840, 0x7132, 0x2001, 0x0001, 0x007e, 0x715c, 0xa184,
773 0x8008, 0x810c, 0x0040, 0x3407, 0xa18c, 0x00f8, 0x00c0, 0x3407, 778 0x0018, 0x0040, 0x2738, 0xa184, 0x0010, 0x0040, 0x272b, 0x1078,
774 0x157e, 0x137e, 0x147e, 0x20a1, 0x012b, 0x789b, 0x0000, 0x8000, 779 0x36d0, 0x00c0, 0x275b, 0xa184, 0x0008, 0x0040, 0x2738, 0x69a0,
775 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 780 0xa184, 0x0600, 0x00c0, 0x2738, 0x1078, 0x35bb, 0x0078, 0x275b,
776 0x6814, 0x8007, 0x7882, 0x6d94, 0x7dd6, 0x7dde, 0x6e98, 0x7ed2, 781 0x69a0, 0xa184, 0x0800, 0x0040, 0x274f, 0x0c7e, 0x027e, 0x2960,
777 0x7eda, 0x1078, 0x38fa, 0x00c0, 0x272e, 0x702c, 0x8003, 0x0048, 782 0x6000, 0xa085, 0x2000, 0x6002, 0x6104, 0xa18d, 0x0010, 0x6106,
778 0x2727, 0x2019, 0x4d9e, 0x1078, 0x2276, 0x702f, 0x8000, 0x7830, 783 0x027f, 0x0c7f, 0x1078, 0x36d0, 0x00c0, 0x275b, 0x69a0, 0xa184,
779 0xa084, 0x00c0, 0x00c0, 0x272e, 0x0098, 0x2736, 0x6008, 0xa084, 784 0x0200, 0x0040, 0x2757, 0x1078, 0x360c, 0x0078, 0x275b, 0xa184,
780 0xffef, 0x600a, 0x1078, 0x3912, 0x0078, 0x2482, 0x7200, 0xa284, 785 0x0400, 0x00c0, 0x2734, 0x69a0, 0xa184, 0x1000, 0x0040, 0x2766,
781 0x0007, 0xa086, 0x0001, 0x00c0, 0x2743, 0x781b, 0x004f, 0x1078, 786 0x6914, 0xa18c, 0xff00, 0x810f, 0x1078, 0x238b, 0x007f, 0x7002,
782 0x3912, 0x0078, 0x2754, 0x6ab4, 0xa295, 0x2000, 0x7a5a, 0x781b, 787 0xa68c, 0x00e0, 0xa684, 0x0060, 0x0040, 0x2774, 0xa086, 0x0060,
783 0x004f, 0x1078, 0x3912, 0x7200, 0x2500, 0xa605, 0x0040, 0x2754, 788 0x00c0, 0x2774, 0xa18d, 0x4000, 0x88ff, 0x0040, 0x2779, 0xa18d,
784 0xa284, 0x0007, 0x1079, 0x2762, 0xad80, 0x0009, 0x7036, 0xa284, 789 0x0004, 0x795a, 0x69b6, 0x789b, 0x0060, 0x2800, 0x78aa, 0x789b,
785 0x0007, 0xa086, 0x0001, 0x00c0, 0x2459, 0x6018, 0x8000, 0x601a, 790 0x0061, 0x6818, 0xa08d, 0x8000, 0xa084, 0x7fff, 0x691a, 0xa68c,
786 0x0078, 0x2459, 0x276a, 0x4a3a, 0x4a3a, 0x4a29, 0x4a3a, 0x276a, 791 0x0080, 0x0040, 0x2798, 0x7097, 0x0000, 0xa08a, 0x000d, 0x0050,
787 0x4a29, 0x276a, 0x1078, 0x23eb, 0x1078, 0x38fa, 0x0f7e, 0x2079, 792 0x2796, 0xa08a, 0x000c, 0x7196, 0x2001, 0x000c, 0x800c, 0x719a,
788 0x5100, 0x78cc, 0x0f7f, 0xa084, 0x0001, 0x0040, 0x2790, 0x706c, 793 0x78aa, 0x8008, 0x810c, 0x0040, 0x34d1, 0xa18c, 0x00f8, 0x00c0,
789 0xa086, 0x0001, 0x00c0, 0x277f, 0x706e, 0x0078, 0x2823, 0x706c, 794 0x34d1, 0x157e, 0x137e, 0x147e, 0x20a1, 0x012b, 0x789b, 0x0000,
790 0xa086, 0x0005, 0x00c0, 0x278e, 0x7088, 0x2068, 0x681b, 0x0004, 795 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f,
791 0x6817, 0x0000, 0x6820, 0xa085, 0x0008, 0x6822, 0x706f, 0x0000, 796 0x157f, 0x6814, 0x8007, 0x7882, 0x6d94, 0x7dd6, 0x7dde, 0x6e98,
792 0x2011, 0x0004, 0x716c, 0xa186, 0x0001, 0x0040, 0x27b1, 0xa186, 797 0x7ed2, 0x7eda, 0x1078, 0x39c8, 0x00c0, 0x27cf, 0x702c, 0x8003,
793 0x0007, 0x00c0, 0x27a1, 0x2009, 0x5138, 0x200b, 0x0005, 0x0078, 798 0x0048, 0x27c8, 0x2019, 0x4eaf, 0x1078, 0x2313, 0x702f, 0x8000,
794 0x27b1, 0x2009, 0x5113, 0x2104, 0x2009, 0x5112, 0x200a, 0x2009, 799 0x7830, 0xa084, 0x00c0, 0x00c0, 0x27cf, 0x0098, 0x27d7, 0x6008,
795 0x5138, 0x200b, 0x0001, 0x706f, 0x0000, 0x7073, 0x0001, 0x0078, 800 0xa084, 0xffef, 0x600a, 0x1078, 0x39e0, 0x0078, 0x2523, 0x7200,
796 0x27b3, 0x706f, 0x0000, 0x1078, 0x4776, 0x157e, 0x20a9, 0x0010, 801 0xa284, 0x0007, 0xa086, 0x0001, 0x00c0, 0x27e4, 0x781b, 0x004f,
797 0x2039, 0x0000, 0x1078, 0x36e2, 0xa7b8, 0x0100, 0x0070, 0x27c2, 802 0x1078, 0x39e0, 0x0078, 0x27f5, 0x6ab4, 0xa295, 0x2000, 0x7a5a,
798 0x0078, 0x27ba, 0x157f, 0x7000, 0x0079, 0x27c6, 0x27f4, 0x27db, 803 0x781b, 0x004f, 0x1078, 0x39e0, 0x7200, 0x2500, 0xa605, 0x0040,
799 0x27db, 0x27ce, 0x27f4, 0x27f4, 0x27f4, 0x27f4, 0x2021, 0x515a, 804 0x27f5, 0xa284, 0x0007, 0x1079, 0x2803, 0xad80, 0x0009, 0x7036,
800 0x2404, 0xa005, 0x0040, 0x27f4, 0xad06, 0x00c0, 0x27db, 0x6800, 805 0xa284, 0x0007, 0xa086, 0x0001, 0x00c0, 0x24fa, 0x6018, 0x8000,
801 0x2022, 0x0078, 0x27eb, 0x6820, 0xa084, 0x0001, 0x00c0, 0x27e7, 806 0x601a, 0x0078, 0x24fa, 0x280b, 0x4b4b, 0x4b4b, 0x4b3a, 0x4b4b,
802 0x6f14, 0x1078, 0x37ef, 0x1078, 0x33d8, 0x0078, 0x27eb, 0x7060, 807 0x280b, 0x4b3a, 0x280b, 0x1078, 0x248c, 0x1078, 0x39c8, 0x0f7e,
803 0x2060, 0x6800, 0x6002, 0x6a1a, 0x6817, 0x0000, 0x6820, 0xa085, 808 0x2079, 0x5200, 0x78cc, 0x0f7f, 0xa084, 0x0001, 0x0040, 0x2831,
804 0x0008, 0x6822, 0x1078, 0x1c70, 0x2021, 0x7500, 0x1078, 0x2830, 809 0x706c, 0xa086, 0x0001, 0x00c0, 0x2820, 0x706e, 0x0078, 0x28c4,
805 0x2021, 0x515a, 0x1078, 0x2830, 0x157e, 0x20a9, 0x0000, 0x2021, 810 0x706c, 0xa086, 0x0005, 0x00c0, 0x282f, 0x7088, 0x2068, 0x681b,
806 0x7400, 0x1078, 0x2830, 0x8420, 0x0070, 0x2808, 0x0078, 0x2801, 811 0x0004, 0x6817, 0x0000, 0x6820, 0xa085, 0x0008, 0x6822, 0x706f,
807 0x2061, 0x5400, 0x2021, 0x0002, 0x20a9, 0x0100, 0x6018, 0x6110, 812 0x0000, 0x2011, 0x0004, 0x716c, 0xa186, 0x0001, 0x0040, 0x2852,
808 0x81ff, 0x0040, 0x2817, 0xa102, 0x0050, 0x2817, 0x6012, 0x601b, 813 0xa186, 0x0007, 0x00c0, 0x2842, 0x2009, 0x5238, 0x200b, 0x0005,
809 0x0000, 0xace0, 0x0010, 0x0070, 0x281f, 0x0078, 0x280e, 0x8421, 814 0x0078, 0x2852, 0x2009, 0x5213, 0x2104, 0x2009, 0x5212, 0x200a,
810 0x00c0, 0x280c, 0x157f, 0x709c, 0xa084, 0x8000, 0x0040, 0x282a, 815 0x2009, 0x5238, 0x200b, 0x0001, 0x706f, 0x0000, 0x7073, 0x0001,
811 0x1078, 0x3a00, 0x7003, 0x0000, 0x704b, 0x0000, 0x0078, 0x2459, 816 0x0078, 0x2854, 0x706f, 0x0000, 0x1078, 0x4887, 0x157e, 0x20a9,
812 0x047e, 0x2404, 0xa005, 0x0040, 0x2844, 0x2068, 0x6800, 0x007e, 817 0x0010, 0x2039, 0x0000, 0x1078, 0x37b0, 0xa7b8, 0x0100, 0x0070,
813 0x6a1a, 0x6817, 0x0000, 0x6820, 0xa085, 0x0008, 0x6822, 0x1078, 818 0x2863, 0x0078, 0x285b, 0x157f, 0x7000, 0x0079, 0x2867, 0x2895,
814 0x1c70, 0x007f, 0x0078, 0x2832, 0x047f, 0x2023, 0x0000, 0x007c, 819 0x287c, 0x287c, 0x286f, 0x2895, 0x2895, 0x2895, 0x2895, 0x2021,
815 0xa282, 0x0003, 0x0050, 0x284e, 0x1078, 0x23eb, 0x2300, 0x0079, 820 0x525a, 0x2404, 0xa005, 0x0040, 0x2895, 0xad06, 0x00c0, 0x287c,
816 0x2851, 0x2854, 0x28c7, 0x28e4, 0xa282, 0x0002, 0x0040, 0x285a, 821 0x6800, 0x2022, 0x0078, 0x288c, 0x6820, 0xa084, 0x0001, 0x00c0,
817 0x1078, 0x23eb, 0x706c, 0x706f, 0x0000, 0x7093, 0x0000, 0x0079, 822 0x2888, 0x6f14, 0x1078, 0x38bd, 0x1078, 0x34a2, 0x0078, 0x288c,
818 0x2861, 0x2869, 0x2869, 0x286b, 0x289f, 0x340d, 0x2869, 0x289f, 823 0x7060, 0x2060, 0x6800, 0x6002, 0x6a1a, 0x6817, 0x0000, 0x6820,
819 0x2869, 0x1078, 0x23eb, 0x7780, 0x1078, 0x36e2, 0x7780, 0xa7bc, 824 0xa085, 0x0008, 0x6822, 0x1078, 0x1cdc, 0x2021, 0x7600, 0x1078,
820 0x0f00, 0x1078, 0x37ef, 0x6018, 0xa005, 0x0040, 0x2896, 0x2021, 825 0x28d1, 0x2021, 0x525a, 0x1078, 0x28d1, 0x157e, 0x20a9, 0x0000,
821 0x7500, 0x2009, 0x0004, 0x2011, 0x0010, 0x1078, 0x28ff, 0x0040, 826 0x2021, 0x7500, 0x1078, 0x28d1, 0x8420, 0x0070, 0x28a9, 0x0078,
822 0x2896, 0x157e, 0x20a9, 0x0000, 0x2021, 0x7400, 0x047e, 0x2009, 827 0x28a2, 0x2061, 0x5500, 0x2021, 0x0002, 0x20a9, 0x0100, 0x6018,
823 0x0004, 0x2011, 0x0010, 0x1078, 0x28ff, 0x047f, 0x0040, 0x2895, 828 0x6110, 0x81ff, 0x0040, 0x28b8, 0xa102, 0x0050, 0x28b8, 0x6012,
824 0x8420, 0x0070, 0x2895, 0x0078, 0x2886, 0x157f, 0x8738, 0xa784, 829 0x601b, 0x0000, 0xace0, 0x0010, 0x0070, 0x28c0, 0x0078, 0x28af,
825 0x001f, 0x00c0, 0x2871, 0x0078, 0x2482, 0x0078, 0x2482, 0x7780, 830 0x8421, 0x00c0, 0x28ad, 0x157f, 0x709c, 0xa084, 0x8000, 0x0040,
826 0x1078, 0x37ef, 0x6018, 0xa005, 0x0040, 0x28c5, 0x2021, 0x7500, 831 0x28cb, 0x1078, 0x3ace, 0x7003, 0x0000, 0x704b, 0x0000, 0x0078,
827 0x2009, 0x0005, 0x2011, 0x0020, 0x1078, 0x28ff, 0x0040, 0x28c5, 832 0x24fa, 0x047e, 0x2404, 0xa005, 0x0040, 0x28e5, 0x2068, 0x6800,
828 0x157e, 0x20a9, 0x0000, 0x2021, 0x7400, 0x047e, 0x2009, 0x0005, 833 0x007e, 0x6a1a, 0x6817, 0x0000, 0x6820, 0xa085, 0x0008, 0x6822,
829 0x2011, 0x0020, 0x1078, 0x28ff, 0x047f, 0x0040, 0x28c4, 0x8420, 834 0x1078, 0x1cdc, 0x007f, 0x0078, 0x28d3, 0x047f, 0x2023, 0x0000,
830 0x0070, 0x28c4, 0x0078, 0x28b5, 0x157f, 0x0078, 0x2482, 0x2200, 835 0x007c, 0xa282, 0x0003, 0x0050, 0x28ef, 0x1078, 0x248c, 0x2300,
831 0x0079, 0x28ca, 0x28cd, 0x28cf, 0x28cf, 0x1078, 0x23eb, 0x2009, 836 0x0079, 0x28f2, 0x28f5, 0x2968, 0x2985, 0xa282, 0x0002, 0x0040,
832 0x0012, 0x706c, 0xa086, 0x0002, 0x0040, 0x28d8, 0x2009, 0x000e, 837 0x28fb, 0x1078, 0x248c, 0x706c, 0x706f, 0x0000, 0x7093, 0x0000,
833 0x6818, 0xa084, 0x8000, 0x0040, 0x28de, 0x691a, 0x706f, 0x0000, 838 0x0079, 0x2902, 0x290a, 0x290a, 0x290c, 0x2940, 0x34d7, 0x290a,
834 0x7073, 0x0001, 0x0078, 0x3888, 0x2200, 0x0079, 0x28e7, 0x28ec, 839 0x2940, 0x290a, 0x1078, 0x248c, 0x7780, 0x1078, 0x37b0, 0x7780,
835 0x28cf, 0x28ea, 0x1078, 0x23eb, 0x1078, 0x4776, 0x7000, 0xa086, 840 0xa7bc, 0x0f00, 0x1078, 0x38bd, 0x6018, 0xa005, 0x0040, 0x2937,
836 0x0001, 0x00c0, 0x339d, 0x1078, 0x33ee, 0x6008, 0xa084, 0xffef, 841 0x2021, 0x7600, 0x2009, 0x0004, 0x2011, 0x0010, 0x1078, 0x29a0,
837 0x600a, 0x1078, 0x3390, 0x0040, 0x339d, 0x0078, 0x2594, 0x2404, 842 0x0040, 0x2937, 0x157e, 0x20a9, 0x0000, 0x2021, 0x7500, 0x047e,
838 0xa005, 0x0040, 0x2922, 0x2068, 0x2d04, 0x007e, 0x6814, 0xa706, 843 0x2009, 0x0004, 0x2011, 0x0010, 0x1078, 0x29a0, 0x047f, 0x0040,
839 0x0040, 0x290e, 0x2d20, 0x007f, 0x0078, 0x2900, 0x007f, 0x2022, 844 0x2936, 0x8420, 0x0070, 0x2936, 0x0078, 0x2927, 0x157f, 0x8738,
840 0x691a, 0x6817, 0x0000, 0x6820, 0xa205, 0x6822, 0x1078, 0x1c70, 845 0xa784, 0x001f, 0x00c0, 0x2912, 0x0078, 0x2523, 0x0078, 0x2523,
841 0x6010, 0x8001, 0x6012, 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 846 0x7780, 0x1078, 0x38bd, 0x6018, 0xa005, 0x0040, 0x2966, 0x2021,
842 0x33ee, 0x007c, 0xa085, 0x0001, 0x0078, 0x2921, 0x2300, 0x0079, 847 0x7600, 0x2009, 0x0005, 0x2011, 0x0020, 0x1078, 0x29a0, 0x0040,
843 0x2929, 0x292e, 0x292c, 0x29c7, 0x1078, 0x23eb, 0x78ec, 0xa084, 848 0x2966, 0x157e, 0x20a9, 0x0000, 0x2021, 0x7500, 0x047e, 0x2009,
844 0x0001, 0x00c0, 0x2942, 0x7000, 0xa086, 0x0004, 0x00c0, 0x293a, 849 0x0005, 0x2011, 0x0020, 0x1078, 0x29a0, 0x047f, 0x0040, 0x2965,
845 0x0078, 0x2965, 0x1078, 0x33ee, 0x6008, 0xa084, 0xffef, 0x600a, 850 0x8420, 0x0070, 0x2965, 0x0078, 0x2956, 0x157f, 0x0078, 0x2523,
846 0x0078, 0x339d, 0x78e4, 0xa005, 0x00d0, 0x2965, 0x0018, 0x2459, 851 0x2200, 0x0079, 0x296b, 0x296e, 0x2970, 0x2970, 0x1078, 0x248c,
847 0x2008, 0xa084, 0x0030, 0x00c0, 0x2951, 0x781b, 0x004f, 0x0078, 852 0x2009, 0x0012, 0x706c, 0xa086, 0x0002, 0x0040, 0x2979, 0x2009,
848 0x2459, 0x78ec, 0xa084, 0x0003, 0x0040, 0x294d, 0x2100, 0xa084, 853 0x000e, 0x6818, 0xa084, 0x8000, 0x0040, 0x297f, 0x691a, 0x706f,
849 0x0007, 0x0079, 0x295b, 0x299e, 0x29a9, 0x298f, 0x2963, 0x38ed, 854 0x0000, 0x7073, 0x0001, 0x0078, 0x3956, 0x2200, 0x0079, 0x2988,
850 0x38ed, 0x2963, 0x29b8, 0x1078, 0x23eb, 0x7000, 0xa086, 0x0004, 855 0x298d, 0x2970, 0x298b, 0x1078, 0x248c, 0x1078, 0x4887, 0x7000,
851 0x00c0, 0x297f, 0x706c, 0xa086, 0x0002, 0x00c0, 0x2975, 0x2011, 856 0xa086, 0x0001, 0x00c0, 0x3467, 0x1078, 0x34b8, 0x6008, 0xa084,
852 0x0002, 0x2019, 0x0000, 0x0078, 0x2848, 0x706c, 0xa086, 0x0006, 857 0xffef, 0x600a, 0x1078, 0x345a, 0x0040, 0x3467, 0x0078, 0x2635,
853 0x0040, 0x296f, 0x706c, 0xa086, 0x0004, 0x0040, 0x296f, 0x79e4, 858 0x2404, 0xa005, 0x0040, 0x29c3, 0x2068, 0x2d04, 0x007e, 0x6814,
854 0xa184, 0x0030, 0x0040, 0x2989, 0x78ec, 0xa084, 0x0003, 0x00c0, 859 0xa706, 0x0040, 0x29af, 0x2d20, 0x007f, 0x0078, 0x29a1, 0x007f,
855 0x298b, 0x0078, 0x2f6d, 0x2001, 0x0003, 0x0078, 0x2d01, 0x6818, 860 0x2022, 0x691a, 0x6817, 0x0000, 0x6820, 0xa205, 0x6822, 0x1078,
856 0xa084, 0x8000, 0x0040, 0x2996, 0x681b, 0x001d, 0x1078, 0x36c1, 861 0x1cdc, 0x6010, 0x8001, 0x6012, 0x6008, 0xa084, 0xffef, 0x600a,
857 0x782b, 0x3008, 0x781b, 0x0056, 0x0078, 0x2459, 0x6818, 0xa084, 862 0x1078, 0x34b8, 0x007c, 0xa085, 0x0001, 0x0078, 0x29c2, 0x2300,
858 0x8000, 0x0040, 0x29a5, 0x681b, 0x001d, 0x1078, 0x36c1, 0x0078, 863 0x0079, 0x29ca, 0x29cf, 0x29cd, 0x2a68, 0x1078, 0x248c, 0x78ec,
859 0x38b8, 0x6818, 0xa084, 0x8000, 0x0040, 0x29b0, 0x681b, 0x001d, 864 0xa084, 0x0001, 0x00c0, 0x29e3, 0x7000, 0xa086, 0x0004, 0x00c0,
860 0x1078, 0x36c1, 0x782b, 0x3008, 0x781b, 0x00cd, 0x0078, 0x2459, 865 0x29db, 0x0078, 0x2a06, 0x1078, 0x34b8, 0x6008, 0xa084, 0xffef,
861 0x6818, 0xa084, 0x8000, 0x0040, 0x29bf, 0x681b, 0x001d, 0x1078, 866 0x600a, 0x0078, 0x3467, 0x78e4, 0xa005, 0x00d0, 0x2a06, 0x0018,
862 0x36c1, 0x782b, 0x3008, 0x781b, 0x008e, 0x0078, 0x2459, 0xa584, 867 0x24fa, 0x2008, 0xa084, 0x0030, 0x00c0, 0x29f2, 0x781b, 0x004f,
863 0x000f, 0x00c0, 0x29e4, 0x7000, 0x0079, 0x29ce, 0x2482, 0x29d8, 868 0x0078, 0x24fa, 0x78ec, 0xa084, 0x0003, 0x0040, 0x29ee, 0x2100,
864 0x29d6, 0x339d, 0x339d, 0x339d, 0x339d, 0x29d6, 0x1078, 0x23eb, 869 0xa084, 0x0007, 0x0079, 0x29fc, 0x2a3f, 0x2a4a, 0x2a30, 0x2a04,
865 0x1078, 0x33ee, 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x3390, 870 0x39bb, 0x39bb, 0x2a04, 0x2a59, 0x1078, 0x248c, 0x7000, 0xa086,
866 0x0040, 0x339d, 0x0078, 0x2594, 0x78e4, 0xa005, 0x00d0, 0x2965, 871 0x0004, 0x00c0, 0x2a20, 0x706c, 0xa086, 0x0002, 0x00c0, 0x2a16,
867 0x0018, 0x2965, 0x2008, 0xa084, 0x0030, 0x00c0, 0x29f3, 0x781b, 872 0x2011, 0x0002, 0x2019, 0x0000, 0x0078, 0x28e9, 0x706c, 0xa086,
868 0x004f, 0x0078, 0x2459, 0x78ec, 0xa084, 0x0003, 0x0040, 0x29ef, 873 0x0006, 0x0040, 0x2a10, 0x706c, 0xa086, 0x0004, 0x0040, 0x2a10,
869 0x2100, 0xa184, 0x0007, 0x0079, 0x29fd, 0x2a0f, 0x2a13, 0x2a07, 874 0x79e4, 0xa184, 0x0030, 0x0040, 0x2a2a, 0x78ec, 0xa084, 0x0003,
870 0x2a05, 0x38ed, 0x38ed, 0x2a05, 0x38e3, 0x1078, 0x23eb, 0x1078, 875 0x00c0, 0x2a2c, 0x0078, 0x300c, 0x2001, 0x0003, 0x0078, 0x2da0,
871 0x36c9, 0x782b, 0x3008, 0x781b, 0x0056, 0x0078, 0x2459, 0x1078, 876 0x6818, 0xa084, 0x8000, 0x0040, 0x2a37, 0x681b, 0x001d, 0x1078,
872 0x36c9, 0x0078, 0x38b8, 0x1078, 0x36c9, 0x782b, 0x3008, 0x781b, 877 0x378f, 0x782b, 0x3008, 0x781b, 0x0056, 0x0078, 0x24fa, 0x6818,
873 0x00cd, 0x0078, 0x2459, 0x1078, 0x36c9, 0x782b, 0x3008, 0x781b, 878 0xa084, 0x8000, 0x0040, 0x2a46, 0x681b, 0x001d, 0x1078, 0x378f,
874 0x008e, 0x0078, 0x2459, 0x2300, 0x0079, 0x2a26, 0x2a2b, 0x2a29, 879 0x0078, 0x3986, 0x6818, 0xa084, 0x8000, 0x0040, 0x2a51, 0x681b,
875 0x2a2d, 0x1078, 0x23eb, 0x0078, 0x30ab, 0x681b, 0x0008, 0x78a3, 880 0x001d, 0x1078, 0x378f, 0x782b, 0x3008, 0x781b, 0x00ca, 0x0078,
876 0x0000, 0x79e4, 0xa184, 0x0030, 0x0040, 0x30ab, 0x78ec, 0xa084, 881 0x24fa, 0x6818, 0xa084, 0x8000, 0x0040, 0x2a60, 0x681b, 0x001d,
877 0x0003, 0x0040, 0x30ab, 0xa184, 0x0007, 0x0079, 0x2a3f, 0x2a47, 882 0x1078, 0x378f, 0x782b, 0x3008, 0x781b, 0x008f, 0x0078, 0x24fa,
878 0x2a13, 0x298f, 0x3888, 0x38ed, 0x38ed, 0x2a47, 0x38e3, 0x1078, 883 0xa584, 0x000f, 0x00c0, 0x2a85, 0x7000, 0x0079, 0x2a6f, 0x2523,
879 0x389c, 0x0078, 0x2459, 0xa282, 0x0005, 0x0050, 0x2a51, 0x1078, 884 0x2a79, 0x2a77, 0x3467, 0x3467, 0x3467, 0x3467, 0x2a77, 0x1078,
880 0x23eb, 0x2300, 0x0079, 0x2a54, 0x2a57, 0x2cae, 0x2cbc, 0x2200, 885 0x248c, 0x1078, 0x34b8, 0x6008, 0xa084, 0xffef, 0x600a, 0x1078,
881 0x0079, 0x2a5a, 0x2a74, 0x2a61, 0x2a74, 0x2a5f, 0x2c93, 0x1078, 886 0x345a, 0x0040, 0x3467, 0x0078, 0x2635, 0x78e4, 0xa005, 0x00d0,
882 0x23eb, 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa082, 0x0020, 887 0x2a06, 0x0018, 0x2a06, 0x2008, 0xa084, 0x0030, 0x00c0, 0x2a94,
883 0x0048, 0x369d, 0xa08a, 0x0004, 0x00c8, 0x369d, 0x0079, 0x2a70, 888 0x781b, 0x004f, 0x0078, 0x24fa, 0x78ec, 0xa084, 0x0003, 0x0040,
884 0x369d, 0x369d, 0x369d, 0x364b, 0x789b, 0x0018, 0x79a8, 0xa184, 889 0x2a90, 0x2100, 0xa184, 0x0007, 0x0079, 0x2a9e, 0x2ab0, 0x2ab4,
885 0x0080, 0x0040, 0x2a85, 0x0078, 0x369d, 0x7000, 0xa005, 0x00c0, 890 0x2aa8, 0x2aa6, 0x39bb, 0x39bb, 0x2aa6, 0x39b1, 0x1078, 0x248c,
886 0x2a7b, 0x2011, 0x0004, 0x0078, 0x321f, 0xa184, 0x00ff, 0xa08a, 891 0x1078, 0x3797, 0x782b, 0x3008, 0x781b, 0x0056, 0x0078, 0x24fa,
887 0x0010, 0x00c8, 0x369d, 0x0079, 0x2a8d, 0x2a9f, 0x2a9d, 0x2ab7, 892 0x1078, 0x3797, 0x0078, 0x3986, 0x1078, 0x3797, 0x782b, 0x3008,
888 0x2abb, 0x2b78, 0x369d, 0x369d, 0x2b7a, 0x369d, 0x369d, 0x2c8f, 893 0x781b, 0x00ca, 0x0078, 0x24fa, 0x1078, 0x3797, 0x782b, 0x3008,
889 0x2c8f, 0x369d, 0x369d, 0x369d, 0x2c91, 0x1078, 0x23eb, 0xa684, 894 0x781b, 0x008f, 0x0078, 0x24fa, 0x2300, 0x0079, 0x2ac7, 0x2acc,
890 0x1000, 0x0040, 0x2aac, 0x2001, 0x0500, 0x8000, 0x8000, 0x783a, 895 0x2aca, 0x2ace, 0x1078, 0x248c, 0x0078, 0x3180, 0x681b, 0x0008,
891 0x781b, 0x008c, 0x0078, 0x2459, 0x6818, 0xa084, 0x8000, 0x0040, 896 0x78a3, 0x0000, 0x79e4, 0xa184, 0x0030, 0x0040, 0x3180, 0x78ec,
892 0x2ab5, 0x681b, 0x001d, 0x0078, 0x2aa3, 0x0078, 0x3888, 0x681b, 897 0xa084, 0x0003, 0x0040, 0x3180, 0xa184, 0x0007, 0x0079, 0x2ae0,
893 0x001d, 0x0078, 0x36ad, 0x6920, 0x6922, 0xa684, 0x1800, 0x00c0, 898 0x2ae8, 0x2ab4, 0x2a30, 0x3956, 0x39bb, 0x39bb, 0x2ae8, 0x39b1,
894 0x2afc, 0x6820, 0xa084, 0x0001, 0x00c0, 0x2b04, 0x6818, 0xa086, 899 0x1078, 0x396a, 0x0078, 0x24fa, 0xa282, 0x0005, 0x0050, 0x2af2,
895 0x0008, 0x00c0, 0x2acd, 0x681b, 0x0000, 0xa684, 0x0400, 0x0040, 900 0x1078, 0x248c, 0x2300, 0x0079, 0x2af5, 0x2af8, 0x2d4d, 0x2d5b,
896 0x2b74, 0xa684, 0x0080, 0x0040, 0x2af8, 0x7097, 0x0000, 0x6818, 901 0x2200, 0x0079, 0x2afb, 0x2b15, 0x2b02, 0x2b15, 0x2b00, 0x2d32,
897 0xa084, 0x003f, 0xa08a, 0x000d, 0x0050, 0x2af8, 0xa08a, 0x000c, 902 0x1078, 0x248c, 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa082,
898 0x7196, 0x2001, 0x000c, 0x800c, 0x719a, 0x789b, 0x0061, 0x78aa, 903 0x0020, 0x0048, 0x376b, 0xa08a, 0x0004, 0x00c8, 0x376b, 0x0079,
904 0x2b11, 0x376b, 0x376b, 0x376b, 0x3719, 0x789b, 0x0018, 0x79a8,
905 0xa184, 0x0080, 0x0040, 0x2b26, 0x0078, 0x376b, 0x7000, 0xa005,
906 0x00c0, 0x2b1c, 0x2011, 0x0004, 0x0078, 0x32e9, 0xa184, 0x00ff,
907 0xa08a, 0x0010, 0x00c8, 0x376b, 0x0079, 0x2b2e, 0x2b40, 0x2b3e,
908 0x2b58, 0x2b5c, 0x2c17, 0x376b, 0x376b, 0x2c19, 0x376b, 0x376b,
909 0x2d2e, 0x2d2e, 0x376b, 0x376b, 0x376b, 0x2d30, 0x1078, 0x248c,
910 0xa684, 0x1000, 0x0040, 0x2b4d, 0x2001, 0x0500, 0x8000, 0x8000,
911 0x783a, 0x781b, 0x008d, 0x0078, 0x24fa, 0x6818, 0xa084, 0x8000,
912 0x0040, 0x2b56, 0x681b, 0x001d, 0x0078, 0x2b44, 0x0078, 0x3956,
913 0x681b, 0x001d, 0x0078, 0x377b, 0x6920, 0x6922, 0xa684, 0x1800,
914 0x00c0, 0x2b9d, 0x6820, 0xa084, 0x0001, 0x00c0, 0x2ba5, 0x6818,
915 0xa086, 0x0008, 0x00c0, 0x2b6e, 0x681b, 0x0000, 0xa684, 0x0400,
916 0x0040, 0x2c13, 0xa684, 0x0080, 0x0040, 0x2b99, 0x7097, 0x0000,
917 0x6818, 0xa084, 0x003f, 0xa08a, 0x000d, 0x0050, 0x2b99, 0xa08a,
918 0x000c, 0x7196, 0x2001, 0x000c, 0x800c, 0x719a, 0x789b, 0x0061,
919 0x78aa, 0x157e, 0x137e, 0x147e, 0x20a1, 0x012b, 0x789b, 0x0000,
920 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f,
921 0x157f, 0x781b, 0x0058, 0x0078, 0x24fa, 0xa684, 0x1000, 0x0040,
922 0x2ba5, 0x781b, 0x0065, 0x0078, 0x24fa, 0xa684, 0x0060, 0x0040,
923 0x2c0f, 0xa684, 0x0800, 0x0040, 0x2c0f, 0xa684, 0x8000, 0x00c0,
924 0x2bb3, 0x0078, 0x2bcb, 0xa6b4, 0x7fff, 0x7e5a, 0x6eb6, 0x7adc,
925 0x79d8, 0x78d0, 0x801b, 0x00c8, 0x2bbe, 0x8000, 0xa084, 0x003f,
926 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94,
927 0x2200, 0xa303, 0x68ae, 0xa684, 0x4000, 0x0040, 0x2bd3, 0xa6b4,
928 0xbfff, 0x7e5a, 0x6eb6, 0x7000, 0xa086, 0x0003, 0x00c0, 0x2be0,
929 0x1078, 0x493d, 0x1078, 0x4b3a, 0x781b, 0x0064, 0x0078, 0x24fa,
930 0xa006, 0x1078, 0x4c41, 0x6ab0, 0x69ac, 0x6c98, 0x6b94, 0x2200,
931 0xa105, 0x0040, 0x2bef, 0x2200, 0xa422, 0x2100, 0xa31b, 0x6caa,
932 0x7cd2, 0x7cda, 0x6ba6, 0x7bd6, 0x7bde, 0x2300, 0xa405, 0x00c0,
933 0x2c01, 0xa6b5, 0x4000, 0x7e5a, 0x6eb6, 0x781b, 0x0064, 0x0078,
934 0x24fa, 0x781b, 0x0064, 0x2200, 0xa115, 0x00c0, 0x2c0b, 0x1078,
935 0x4b4b, 0x0078, 0x24fa, 0x1078, 0x4b96, 0x0078, 0x24fa, 0x781b,
936 0x0065, 0x0078, 0x24fa, 0x781b, 0x0058, 0x0078, 0x24fa, 0x1078,
937 0x248c, 0x0078, 0x2c7a, 0x6920, 0xa184, 0x0100, 0x0040, 0x2c31,
938 0xa18c, 0xfeff, 0x6922, 0x0c7e, 0x7054, 0x2060, 0x6000, 0xa084,
939 0xefff, 0x6002, 0x6004, 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x0078,
940 0x2c69, 0xa184, 0x0200, 0x0040, 0x2c69, 0xa18c, 0xfdff, 0x6922,
941 0x0c7e, 0x7054, 0x2060, 0x6000, 0xa084, 0xdfff, 0x6002, 0x6004,
942 0xa084, 0xffef, 0x6006, 0x2008, 0x2c48, 0x0c7f, 0xa184, 0x0008,
943 0x0040, 0x2c69, 0x1078, 0x38b9, 0x1078, 0x35bb, 0x88ff, 0x0040,
944 0x2c69, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, 0xa6b5, 0x0004,
945 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x2c63, 0x782b, 0x3008, 0x781b,
946 0x0056, 0x0078, 0x24fa, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078,
947 0x24fa, 0x7e58, 0xa684, 0x0400, 0x00c0, 0x2c72, 0x781b, 0x0058,
948 0x0078, 0x24fa, 0x781b, 0x0065, 0x0078, 0x24fa, 0x0078, 0x3773,
949 0x0078, 0x3773, 0x2019, 0x0000, 0x7990, 0xa18c, 0x0007, 0x00c0,
950 0x2c88, 0x6820, 0xa084, 0x0100, 0x0040, 0x2c78, 0x2009, 0x0008,
951 0x789b, 0x0010, 0x78a8, 0xa094, 0x00ff, 0xa286, 0x0001, 0x00c0,
952 0x2cbf, 0x2300, 0x7ca8, 0xa400, 0x2018, 0xa102, 0x0040, 0x2cb7,
953 0x0048, 0x2c9c, 0x0078, 0x2cb9, 0xa380, 0x0002, 0xa102, 0x00c8,
954 0x2cb7, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0c7e, 0x7054, 0x2060,
955 0x6000, 0xa084, 0xefef, 0x6002, 0x6004, 0xa084, 0xffe5, 0x6006,
956 0x0c7f, 0x7e58, 0xa6b4, 0xfffb, 0x7e5a, 0x0078, 0x2c6a, 0x0078,
957 0x2c1b, 0x24a8, 0x7aa8, 0x00f0, 0x2cb9, 0x0078, 0x2c8a, 0xa284,
958 0x00f0, 0xa086, 0x0020, 0x00c0, 0x2d1f, 0x8318, 0x8318, 0x2300,
959 0xa102, 0x0040, 0x2ccf, 0x0048, 0x2ccf, 0x0078, 0x2d1c, 0xa286,
960 0x0023, 0x0040, 0x2c78, 0x681c, 0xa084, 0xfff1, 0x681e, 0x7e58,
961 0xa684, 0xfff1, 0xa085, 0x0010, 0x2030, 0x7e5a, 0x6008, 0xa085,
962 0x0010, 0x600a, 0x0c7e, 0x7054, 0x2060, 0x6004, 0x2008, 0x2c48,
963 0x0c7f, 0xa184, 0x0010, 0x0040, 0x2cf3, 0x1078, 0x38b9, 0x1078,
964 0x36d0, 0x0078, 0x2d02, 0x0c7e, 0x7054, 0x2060, 0x6004, 0x2008,
965 0x2c48, 0x0c7f, 0xa184, 0x0008, 0x0040, 0x2c69, 0x1078, 0x38b9,
966 0x1078, 0x35bb, 0x88ff, 0x0040, 0x2c69, 0x789b, 0x0060, 0x2800,
967 0x78aa, 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x2d16,
968 0x782b, 0x3008, 0x781b, 0x0056, 0x0078, 0x24fa, 0x782b, 0x3008,
969 0x781b, 0x0065, 0x0078, 0x24fa, 0x7aa8, 0x0078, 0x2c8a, 0x8318,
970 0x2300, 0xa102, 0x0040, 0x2d28, 0x0048, 0x2d28, 0x0078, 0x2c8a,
971 0xa284, 0x0080, 0x00c0, 0x377b, 0x0078, 0x3773, 0x0078, 0x377b,
972 0x0078, 0x376b, 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa08e,
973 0x0001, 0x0040, 0x2d3d, 0x1078, 0x248c, 0x7aa8, 0xa294, 0x00ff,
974 0x78a8, 0xa084, 0x00ff, 0xa08a, 0x0004, 0x00c8, 0x376b, 0x0079,
975 0x2d49, 0x376b, 0x3508, 0x376b, 0x3665, 0xa282, 0x0000, 0x00c0,
976 0x2d53, 0x1078, 0x248c, 0x1078, 0x378f, 0x782b, 0x3008, 0x781b,
977 0x0065, 0x0078, 0x24fa, 0xa282, 0x0003, 0x00c0, 0x2d61, 0x1078,
978 0x248c, 0xa484, 0x8000, 0x00c0, 0x2d84, 0x706c, 0xa005, 0x0040,
979 0x2d6b, 0x1078, 0x248c, 0x6f14, 0x7782, 0xa7bc, 0x0f00, 0x1078,
980 0x38bd, 0x6008, 0xa085, 0x0021, 0x600a, 0x8738, 0xa784, 0x001f,
981 0x00c0, 0x2d6f, 0x1078, 0x3793, 0x706f, 0x0002, 0x2009, 0x5238,
982 0x200b, 0x0009, 0x0078, 0x2d86, 0x1078, 0x379f, 0x782b, 0x3008,
983 0x781b, 0x0065, 0x0078, 0x24fa, 0xa282, 0x0004, 0x0050, 0x2d92,
984 0x1078, 0x248c, 0x2300, 0x0079, 0x2d95, 0x2d98, 0x2e81, 0x2eb4,
985 0xa286, 0x0003, 0x0040, 0x2d9e, 0x1078, 0x248c, 0x2001, 0x0000,
986 0x007e, 0x68c0, 0xa005, 0x0040, 0x2da7, 0x7003, 0x0003, 0x68a0,
987 0xa084, 0x2000, 0x0040, 0x2db0, 0x6008, 0xa085, 0x0002, 0x600a,
988 0x007f, 0x703e, 0x7000, 0xa084, 0x0007, 0x0079, 0x2db7, 0x2523,
989 0x2dc1, 0x2dc1, 0x2fb6, 0x2ff2, 0x2523, 0x2ff2, 0x2dbf, 0x1078,
990 0x248c, 0xa684, 0x1000, 0x00c0, 0x2dc9, 0x1078, 0x4887, 0x0040,
991 0x2e5b, 0x7868, 0xa08c, 0x00ff, 0x0040, 0x2e11, 0xa186, 0x0008,
992 0x00c0, 0x2de0, 0x1078, 0x34b8, 0x6008, 0xa084, 0xffef, 0x600a,
993 0x1078, 0x345a, 0x0040, 0x2e11, 0x1078, 0x4887, 0x0078, 0x2df8,
994 0xa186, 0x0028, 0x00c0, 0x2e11, 0x1078, 0x4887, 0x6008, 0xa084,
995 0xffef, 0x600a, 0x6018, 0xa005, 0x0040, 0x2df8, 0x8001, 0x601a,
996 0xa005, 0x0040, 0x2df8, 0x8001, 0xa005, 0x0040, 0x2df8, 0x601e,
997 0x6820, 0xa084, 0x0001, 0x0040, 0x2523, 0x6820, 0xa084, 0xfffe,
998 0x6822, 0x7060, 0x0c7e, 0x2060, 0x6800, 0x6002, 0x0c7f, 0x6004,
999 0x6802, 0xa005, 0x2d00, 0x00c0, 0x2e0e, 0x6002, 0x6006, 0x0078,
1000 0x2523, 0x017e, 0x1078, 0x2ee5, 0x017f, 0xa684, 0xdf00, 0x681e,
1001 0x682b, 0x0000, 0x6f14, 0x81ff, 0x0040, 0x2e5b, 0xa186, 0x0002,
1002 0x00c0, 0x2e5b, 0xa684, 0x0800, 0x00c0, 0x2e2e, 0xa684, 0x0060,
1003 0x0040, 0x2e2e, 0x78d8, 0x7adc, 0x682e, 0x6a32, 0x6820, 0xa084,
1004 0x0800, 0x00c0, 0x2e5b, 0x8717, 0xa294, 0x000f, 0x8213, 0x8213,
1005 0x8213, 0xa290, 0x5480, 0xa290, 0x0000, 0x221c, 0xa384, 0x0100,
1006 0x00c0, 0x2e44, 0x0078, 0x2e4a, 0x8210, 0x2204, 0xa085, 0x0018,
1007 0x2012, 0x8211, 0xa384, 0x0400, 0x0040, 0x2e57, 0x68a0, 0xa084,
1008 0x0100, 0x00c0, 0x2e57, 0x1078, 0x2f69, 0x0078, 0x2523, 0x6008,
1009 0xa085, 0x0002, 0x600a, 0x6916, 0x6818, 0xa084, 0x8000, 0x0040,
1010 0x2e63, 0x703c, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x1078, 0x34a9,
1011 0x1078, 0x34b8, 0x00c0, 0x2e70, 0x6008, 0xa084, 0xffef, 0x600a,
1012 0x6820, 0xa084, 0x0001, 0x00c0, 0x2e79, 0x1078, 0x34a2, 0x0078,
1013 0x2e7d, 0x7060, 0x2060, 0x6800, 0x6002, 0x1078, 0x1cdc, 0x0078,
1014 0x2523, 0xa282, 0x0004, 0x0048, 0x2e87, 0x1078, 0x248c, 0x2200,
1015 0x0079, 0x2e8a, 0x2e85, 0x2e8e, 0x2e9b, 0x2e8e, 0x7000, 0xa086,
1016 0x0005, 0x0040, 0x2e97, 0x1078, 0x378f, 0x782b, 0x3008, 0x781b,
1017 0x0065, 0x0078, 0x24fa, 0x7890, 0x8007, 0x8001, 0xa084, 0x0007,
1018 0xa080, 0x0018, 0x789a, 0x79a8, 0xa18c, 0x00ff, 0xa186, 0x0003,
1019 0x0040, 0x2eb0, 0xa186, 0x0000, 0x0040, 0x2eb0, 0x0078, 0x376b,
1020 0x781b, 0x0065, 0x0078, 0x24fa, 0x6820, 0xa085, 0x0004, 0x6822,
1021 0x82ff, 0x00c0, 0x2ebf, 0x1078, 0x378f, 0x0078, 0x2ec6, 0x8211,
1022 0x0040, 0x2ec4, 0x1078, 0x248c, 0x1078, 0x379f, 0x782b, 0x3008,
1023 0x781b, 0x0065, 0x0078, 0x24fa, 0x702c, 0x8003, 0x0048, 0x2ed6,
1024 0x2019, 0x4eaf, 0x1078, 0x2313, 0x702f, 0x8000, 0x1078, 0x39e0,
1025 0x7830, 0xa084, 0x00c0, 0x00c0, 0x2ee2, 0x0018, 0x2ee2, 0x791a,
1026 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0xa684, 0x0060, 0x00c0,
1027 0x2eef, 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x2f68, 0xa684,
1028 0x0800, 0x00c0, 0x2f11, 0x68b4, 0xa084, 0x4800, 0xa635, 0xa684,
1029 0x0800, 0x00c0, 0x2f11, 0x6998, 0x6a94, 0x692e, 0x6a32, 0x703c,
1030 0xa005, 0x00c0, 0x2f09, 0x2200, 0xa105, 0x0040, 0x2f10, 0x703f,
1031 0x0015, 0x7000, 0xa086, 0x0006, 0x0040, 0x2f10, 0x1078, 0x4887,
1032 0x007c, 0xa684, 0x0020, 0x0040, 0x2f33, 0xa684, 0x4000, 0x0040,
1033 0x2f1f, 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x2f09, 0x68b4,
1034 0xa084, 0x4800, 0xa635, 0xa684, 0x4000, 0x00c0, 0x2f19, 0x703c,
1035 0xa005, 0x00c0, 0x2f2d, 0x703f, 0x0015, 0x79d8, 0x7adc, 0x692e,
1036 0x6a32, 0x0078, 0x2f09, 0xa684, 0x4000, 0x0040, 0x2f3d, 0x682f,
1037 0x0000, 0x6833, 0x0000, 0x0078, 0x2f09, 0x68b4, 0xa084, 0x4800,
1038 0xa635, 0xa684, 0x4000, 0x00c0, 0x2f37, 0x703c, 0xa005, 0x00c0,
1039 0x2f4b, 0x703f, 0x0015, 0x79d8, 0x7adc, 0x78d0, 0x80fb, 0x00c8,
1040 0x2f52, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x692e,
1041 0x6a32, 0x2100, 0xa205, 0x00c0, 0x2f5f, 0x0078, 0x2f09, 0x7000,
1042 0xa086, 0x0006, 0x0040, 0x2f68, 0x1078, 0x4c41, 0x0078, 0x2f09,
1043 0x007c, 0x6008, 0xa085, 0x0200, 0x600a, 0xa384, 0x0200, 0x0040,
1044 0x2f75, 0x6008, 0xa085, 0x0002, 0x600a, 0x681b, 0x0006, 0x688f,
1045 0x0000, 0x6893, 0x0000, 0x6a30, 0x692c, 0x6a3e, 0x6942, 0x682f,
1046 0x0003, 0x6833, 0x0000, 0x6837, 0x0020, 0x6897, 0x0000, 0x689b,
1047 0x0020, 0x68b3, 0x0000, 0x68af, 0x0000, 0x7000, 0x0079, 0x2f90,
1048 0x2523, 0x2f9a, 0x2fa3, 0x2f98, 0x2f98, 0x2f98, 0x2f98, 0x2f98,
1049 0x1078, 0x248c, 0x6820, 0xa084, 0x0001, 0x00c0, 0x2fa3, 0x1078,
1050 0x34a2, 0x0078, 0x2fa9, 0x7060, 0x2c50, 0x2060, 0x6800, 0x6002,
1051 0x2a60, 0x2021, 0x525a, 0x2404, 0xa005, 0x0040, 0x2fb2, 0x2020,
1052 0x0078, 0x2fab, 0x2d22, 0x206b, 0x0000, 0x007c, 0x1078, 0x34a9,
1053 0x1078, 0x34b8, 0x6008, 0xa084, 0xfdff, 0x600a, 0x682b, 0x0000,
1054 0x789b, 0x000e, 0x6f14, 0x6817, 0x0002, 0x1078, 0x4c89, 0xa684,
1055 0x0800, 0x0040, 0x2fcf, 0x691c, 0xa18d, 0x2000, 0x691e, 0x6818,
1056 0xa084, 0x8000, 0x0040, 0x2fdf, 0x7868, 0xa08c, 0x00ff, 0x0040,
1057 0x2fdd, 0x681b, 0x001e, 0x0078, 0x2fdf, 0x681b, 0x0000, 0x2021,
1058 0x525a, 0x2404, 0xad06, 0x0040, 0x2fe6, 0x7460, 0x6800, 0x2022,
1059 0x68c3, 0x0000, 0x6a3c, 0x6940, 0x6a32, 0x692e, 0x1078, 0x1cdc,
1060 0x0078, 0x2523, 0x1078, 0x2ee5, 0x682b, 0x0000, 0x2001, 0x000e,
1061 0x6f14, 0x1078, 0x39e6, 0xa08c, 0x00ff, 0x6916, 0x6818, 0xa084,
1062 0x8000, 0x0040, 0x3005, 0x703c, 0x681a, 0xa68c, 0xdf00, 0x691e,
1063 0x706f, 0x0000, 0x0078, 0x2523, 0x7000, 0xa005, 0x00c0, 0x3012,
1064 0x0078, 0x2523, 0xa006, 0x1078, 0x4887, 0x6817, 0x0000, 0x681b,
1065 0x0014, 0xa68c, 0xdf00, 0x691e, 0x682b, 0x0000, 0x6820, 0xa085,
1066 0x00ff, 0x6822, 0x7000, 0x0079, 0x3025, 0x2523, 0x302f, 0x302f,
1067 0x3031, 0x3031, 0x3031, 0x3031, 0x302d, 0x1078, 0x248c, 0x1078,
1068 0x34b8, 0x6008, 0xa084, 0xffef, 0x600a, 0x0078, 0x3472, 0x2300,
1069 0x0079, 0x303a, 0x303d, 0x303f, 0x3098, 0x1078, 0x248c, 0xa684,
1070 0x8000, 0x00c0, 0x307d, 0x7000, 0x0079, 0x3046, 0x2523, 0x3050,
1071 0x3050, 0x306c, 0x3050, 0x3079, 0x306c, 0x304e, 0x1078, 0x248c,
1072 0xa684, 0x0060, 0xa086, 0x0060, 0x00c0, 0x3068, 0xa6b4, 0xffdf,
1073 0xa6b4, 0xbfff, 0xa6b5, 0x2000, 0x7e5a, 0x6eb6, 0x681c, 0xa084,
1074 0xffdf, 0x681e, 0x1078, 0x4887, 0x1078, 0x4b4b, 0x0078, 0x3956,
1075 0xa684, 0x2000, 0x0040, 0x305a, 0x6818, 0xa084, 0x8000, 0x0040,
1076 0x3079, 0x681b, 0x0015, 0xa684, 0x4000, 0x0040, 0x3079, 0x681b,
1077 0x0007, 0x1078, 0x396a, 0x0078, 0x24fa, 0xa6b4, 0x7fff, 0x7e5a,
1078 0x7adc, 0x79d8, 0x78d0, 0x79d2, 0x801b, 0x00c8, 0x3088, 0x8000,
1079 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302,
1080 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x781b, 0x0065, 0x007c,
1081 0x1078, 0x248c, 0x2300, 0x0079, 0x309d, 0x30a0, 0x30a2, 0x30eb,
1082 0x1078, 0x248c, 0xa684, 0x8000, 0x00c0, 0x30da, 0x7000, 0x0079,
1083 0x30a9, 0x2523, 0x30b3, 0x30b3, 0x30cf, 0x30b3, 0x30d6, 0x30cf,
1084 0x30b1, 0x1078, 0x248c, 0xa684, 0x0060, 0xa086, 0x0060, 0x00c0,
1085 0x30cb, 0xa6b4, 0xffbf, 0xa6b4, 0xbfff, 0xa6b5, 0x2000, 0x7e5a,
1086 0x6eb6, 0x681c, 0xa084, 0xffbf, 0x681e, 0x1078, 0x4887, 0x1078,
1087 0x4b4b, 0x0078, 0x3956, 0xa684, 0x2000, 0x0040, 0x30bd, 0x6818,
1088 0xa084, 0x8000, 0x0040, 0x30d6, 0x681b, 0x0007, 0x781b, 0x00ca,
1089 0x0078, 0x24fa, 0xa6b4, 0x7fff, 0x7e5a, 0x7adc, 0x79d8, 0x6b98,
1090 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x79d2,
1091 0x781b, 0x0065, 0x007c, 0x6820, 0xa085, 0x0004, 0x6822, 0x1078,
1092 0x3921, 0xa6b5, 0x0800, 0x1078, 0x378f, 0x782b, 0x3008, 0x781b,
1093 0x0065, 0x0078, 0x24fa, 0x2300, 0x0079, 0x30fe, 0x3101, 0x3103,
1094 0x3105, 0x1078, 0x248c, 0x0078, 0x377b, 0xa684, 0x0400, 0x00c0,
1095 0x312e, 0x79e4, 0xa184, 0x0020, 0x0040, 0x3115, 0x78ec, 0xa084,
1096 0x0003, 0x0040, 0x3115, 0x782b, 0x3009, 0x789b, 0x0060, 0x78ab,
1097 0x0000, 0xa684, 0xfffb, 0x785a, 0x79e4, 0xa184, 0x0020, 0x0040,
1098 0x3126, 0x78ec, 0xa084, 0x0003, 0x00c0, 0x312a, 0x2001, 0x0014,
1099 0x0078, 0x2da0, 0xa184, 0x0007, 0x0079, 0x3166, 0x7a90, 0xa294,
1100 0x0007, 0x789b, 0x0060, 0x79a8, 0x81ff, 0x0040, 0x3164, 0x789b,
1101 0x0010, 0x7ba8, 0xa384, 0x0001, 0x00c0, 0x3155, 0x7ba8, 0x7ba8,
1102 0xa386, 0x0001, 0x00c0, 0x3148, 0x2009, 0xfff7, 0x0078, 0x314e,
1103 0xa386, 0x0003, 0x00c0, 0x3155, 0x2009, 0xffef, 0x0c7e, 0x7054,
1104 0x2060, 0x6004, 0xa104, 0x6006, 0x0c7f, 0x789b, 0x0060, 0x78ab,
1105 0x0000, 0xa684, 0xfffb, 0x785a, 0x782b, 0x3009, 0x6920, 0xa18c,
1106 0xfdff, 0xa18c, 0xfeff, 0x6922, 0x0078, 0x3956, 0x2a3f, 0x2a4a,
1107 0x3170, 0x3178, 0x316e, 0x316e, 0x3956, 0x3956, 0x1078, 0x248c,
1108 0x6920, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x6922, 0x0078, 0x3960,
1109 0x6920, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x6922, 0x0078, 0x3956,
1110 0x79e4, 0xa184, 0x0030, 0x0040, 0x318a, 0x78ec, 0xa084, 0x0003,
1111 0x00c0, 0x31b1, 0x7000, 0xa086, 0x0004, 0x00c0, 0x31a4, 0x706c,
1112 0xa086, 0x0002, 0x00c0, 0x319a, 0x2011, 0x0002, 0x2019, 0x0000,
1113 0x0078, 0x28e9, 0x706c, 0xa086, 0x0006, 0x0040, 0x3194, 0x706c,
1114 0xa086, 0x0004, 0x0040, 0x3194, 0x7000, 0xa086, 0x0000, 0x0040,
1115 0x24fa, 0x6818, 0xa085, 0x8000, 0x681a, 0x2001, 0x0014, 0x0078,
1116 0x2da0, 0xa184, 0x0007, 0x0079, 0x31b5, 0x3956, 0x3956, 0x31bd,
1117 0x3956, 0x39bb, 0x39bb, 0x3956, 0x3956, 0xa684, 0x0080, 0x0040,
1118 0x31ec, 0x7194, 0x81ff, 0x0040, 0x31ec, 0xa182, 0x000d, 0x00d0,
1119 0x31cd, 0x7097, 0x0000, 0x0078, 0x31d2, 0xa182, 0x000c, 0x7096,
1120 0x2009, 0x000c, 0x789b, 0x0061, 0x79aa, 0x157e, 0x137e, 0x147e,
1121 0x7098, 0x8114, 0xa210, 0x729a, 0xa080, 0x000b, 0xad00, 0x2098,
1122 0x20a1, 0x012b, 0x789b, 0x0000, 0x8108, 0x81ac, 0x53a6, 0x147f,
1123 0x137f, 0x157f, 0x0078, 0x3960, 0xa684, 0x0400, 0x00c0, 0x322d,
1124 0x6820, 0xa084, 0x0001, 0x0040, 0x3960, 0xa68c, 0x0060, 0xa684,
1125 0x0060, 0x0040, 0x3201, 0xa086, 0x0060, 0x00c0, 0x3201, 0xa18d,
1126 0x4000, 0xa18c, 0xfffb, 0x795a, 0x69b6, 0x789b, 0x0060, 0x78ab,
1127 0x0000, 0x789b, 0x0061, 0x6818, 0xa085, 0x8000, 0x681a, 0x78aa,
1128 0x8008, 0x810c, 0x0040, 0x34d1, 0xa18c, 0x00f8, 0x00c0, 0x34d1,
899 0x157e, 0x137e, 0x147e, 0x20a1, 0x012b, 0x789b, 0x0000, 0x8000, 1129 0x157e, 0x137e, 0x147e, 0x20a1, 0x012b, 0x789b, 0x0000, 0x8000,
900 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 1130 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f,
901 0x781b, 0x0058, 0x0078, 0x2459, 0xa684, 0x1000, 0x0040, 0x2b04, 1131 0x6814, 0x8007, 0x7882, 0x0078, 0x3960, 0x6818, 0xa084, 0x8000,
902 0x781b, 0x0065, 0x0078, 0x2459, 0xa684, 0x0060, 0x0040, 0x2b70, 1132 0x0040, 0x3234, 0x681b, 0x0008, 0x781b, 0x00c0, 0x0078, 0x24fa,
903 0xa684, 0x0800, 0x0040, 0x2b70, 0xa684, 0x8000, 0x00c0, 0x2b12, 1133 0x2300, 0x0079, 0x323b, 0x3240, 0x32d4, 0x323e, 0x1078, 0x248c,
904 0x0078, 0x2b2c, 0xa6b4, 0x7fff, 0x7e5a, 0x6eb6, 0x789b, 0x0076, 1134 0x7000, 0xa084, 0x0007, 0x0079, 0x3245, 0x2523, 0x324f, 0x3284,
905 0x7aac, 0x79ac, 0x78ac, 0x801b, 0x00c8, 0x2b1f, 0x8000, 0xa084, 1135 0x325a, 0x324d, 0x2523, 0x324d, 0x324d, 0x1078, 0x248c, 0x681c,
906 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2, 1136 0xa084, 0x2000, 0x0040, 0x3268, 0x6008, 0xa085, 0x0002, 0x600a,
907 0x6b94, 0x2200, 0xa303, 0x68ae, 0xa684, 0x4000, 0x0040, 0x2b34, 1137 0x0078, 0x3268, 0x68c0, 0xa005, 0x00c0, 0x3284, 0x6920, 0xa18d,
908 0xa6b4, 0xbfff, 0x7e5a, 0x6eb6, 0x7000, 0xa086, 0x0003, 0x00c0, 1138 0x0001, 0x6922, 0x68c3, 0x0001, 0x6800, 0x706a, 0x0078, 0x327e,
909 0x2b41, 0x1078, 0x482c, 0x1078, 0x4a29, 0x781b, 0x0064, 0x0078, 1139 0x6920, 0xa18d, 0x0001, 0x6922, 0x6800, 0x6006, 0xa005, 0x00c0,
910 0x2459, 0xa006, 0x1078, 0x4b30, 0x6ab0, 0x69ac, 0x6c98, 0x6b94, 1140 0x3272, 0x6002, 0x681c, 0xa084, 0x000e, 0x0040, 0x327e, 0x7014,
911 0x2200, 0xa105, 0x0040, 0x2b50, 0x2200, 0xa422, 0x2100, 0xa31b, 1141 0x68ba, 0x7130, 0xa188, 0x7500, 0x0078, 0x3280, 0x2009, 0x7600,
912 0x6caa, 0x7cd2, 0x7cda, 0x6ba6, 0x7bd6, 0x7bde, 0x2300, 0xa405, 1142 0x2104, 0x6802, 0x2d0a, 0x7162, 0x6eb6, 0xa684, 0x0060, 0x0040,
913 0x00c0, 0x2b62, 0xa6b5, 0x4000, 0x7e5a, 0x6eb6, 0x781b, 0x0064, 1143 0x32d2, 0xa684, 0x0800, 0x00c0, 0x3298, 0xa684, 0x7fff, 0x68b6,
914 0x0078, 0x2459, 0x781b, 0x0064, 0x2200, 0xa115, 0x00c0, 0x2b6c, 1144 0x6894, 0x68a6, 0x6898, 0x68aa, 0x1078, 0x4887, 0x0078, 0x32d2,
915 0x1078, 0x4a3a, 0x0078, 0x2459, 0x1078, 0x4a85, 0x0078, 0x2459, 1145 0xa684, 0x0020, 0x0040, 0x32ad, 0x68c0, 0xa005, 0x0040, 0x32a4,
916 0x781b, 0x0065, 0x0078, 0x2459, 0x781b, 0x0058, 0x0078, 0x2459, 1146 0x1078, 0x4c89, 0x0078, 0x32a7, 0xa006, 0x1078, 0x4c41, 0x79d8,
917 0x1078, 0x23eb, 0x0078, 0x2bdb, 0x6920, 0xa184, 0x0100, 0x0040, 1147 0x7adc, 0x69aa, 0x6aa6, 0x0078, 0x32b3, 0x1078, 0x38ca, 0x69aa,
918 0x2b92, 0xa18c, 0xfeff, 0x6922, 0x0c7e, 0x7054, 0x2060, 0x6000, 1148 0x6aa6, 0x1078, 0x4c41, 0xa684, 0x8000, 0x0040, 0x32d2, 0xa684,
919 0xa084, 0xefff, 0x6002, 0x6004, 0xa084, 0xfff5, 0x6006, 0x0c7f, 1149 0x7fff, 0x68b6, 0x7adc, 0x79d8, 0xa684, 0x0020, 0x00c0, 0x32ca,
920 0x0078, 0x2bca, 0xa184, 0x0200, 0x0040, 0x2bca, 0xa18c, 0xfdff, 1150 0x78d0, 0x801b, 0x00c8, 0x32c5, 0x8000, 0xa084, 0x003f, 0xa108,
921 0x6922, 0x0c7e, 0x7054, 0x2060, 0x6000, 0xa084, 0xdfff, 0x6002, 1151 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200,
922 0x6004, 0xa084, 0xffef, 0x6006, 0x2008, 0x2c48, 0x0c7f, 0xa184, 1152 0xa303, 0x68ae, 0x0078, 0x2523, 0x0078, 0x377b, 0x7037, 0x0000,
923 0x0008, 0x0040, 0x2bca, 0x1078, 0x37eb, 0x1078, 0x34f1, 0x88ff, 1153 0xa282, 0x0006, 0x0050, 0x32de, 0x1078, 0x248c, 0x7000, 0xa084,
924 0x0040, 0x2bca, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, 0xa6b5, 1154 0x0007, 0x10c0, 0x3a8c, 0x2300, 0x0079, 0x32e6, 0x32e9, 0x3312,
925 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x2bc4, 0x782b, 0x3008, 1155 0x3326, 0x2200, 0x0079, 0x32ec, 0x3310, 0x377b, 0x32f2, 0x3310,
926 0x781b, 0x0056, 0x0078, 0x2459, 0x782b, 0x3008, 0x781b, 0x0065, 1156 0x3342, 0x3384, 0x7003, 0x0005, 0x2001, 0x7710, 0x2068, 0x704a,
927 0x0078, 0x2459, 0x7e58, 0xa684, 0x0400, 0x00c0, 0x2bd3, 0x781b, 1157 0x157e, 0x20a9, 0x0031, 0x2003, 0x0000, 0x8000, 0x0070, 0x3302,
928 0x0058, 0x0078, 0x2459, 0x781b, 0x0065, 0x0078, 0x2459, 0x0078, 1158 0x0078, 0x32fb, 0x157f, 0xad80, 0x0009, 0x7036, 0x6817, 0x0000,
929 0x36a5, 0x0078, 0x36a5, 0x2019, 0x0000, 0x7990, 0xa18c, 0x0007, 1159 0x68b7, 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, 0x0078, 0x376b,
930 0x00c0, 0x2be9, 0x6820, 0xa084, 0x0100, 0x0040, 0x2bd9, 0x2009, 1160 0x1078, 0x248c, 0x7003, 0x0005, 0x2001, 0x7710, 0x2068, 0x704a,
931 0x0008, 0x789b, 0x0010, 0x78a8, 0xa094, 0x00ff, 0xa286, 0x0001, 1161 0xad80, 0x0009, 0x7036, 0x2200, 0x0079, 0x331e, 0x377b, 0x3324,
932 0x00c0, 0x2c20, 0x2300, 0x7ca8, 0xa400, 0x2018, 0xa102, 0x0040, 1162 0x3324, 0x3342, 0x3324, 0x377b, 0x1078, 0x248c, 0x7003, 0x0005,
933 0x2c18, 0x0048, 0x2bfd, 0x0078, 0x2c1a, 0xa380, 0x0002, 0xa102, 1163 0x2001, 0x7710, 0x2068, 0x704a, 0xad80, 0x0009, 0x7036, 0x2200,
934 0x00c8, 0x2c18, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0c7e, 0x7054, 1164 0x0079, 0x3332, 0x333a, 0x3338, 0x3338, 0x333a, 0x3338, 0x333a,
935 0x2060, 0x6000, 0xa084, 0xefef, 0x6002, 0x6004, 0xa084, 0xffe5, 1165 0x1078, 0x248c, 0x1078, 0x379f, 0x782b, 0x3008, 0x781b, 0x0065,
936 0x6006, 0x0c7f, 0x7e58, 0xa6b4, 0xfffb, 0x7e5a, 0x0078, 0x2bcb, 1166 0x0078, 0x24fa, 0x7003, 0x0002, 0x7a80, 0xa294, 0x0f00, 0x789b,
937 0x0078, 0x2b7c, 0x24a8, 0x7aa8, 0x00f0, 0x2c1a, 0x0078, 0x2beb, 1167 0x0018, 0x7ca8, 0xa484, 0x001f, 0xa215, 0x2069, 0x7600, 0x2d04,
938 0xa284, 0x00f0, 0xa086, 0x0020, 0x00c0, 0x2c80, 0x8318, 0x8318, 1168 0x2d08, 0x7162, 0x2068, 0xa005, 0x0040, 0x335d, 0x6814, 0xa206,
939 0x2300, 0xa102, 0x0040, 0x2c30, 0x0048, 0x2c30, 0x0078, 0x2c7d, 1169 0x0040, 0x3379, 0x6800, 0x0078, 0x3350, 0x7003, 0x0005, 0x2001,
940 0xa286, 0x0023, 0x0040, 0x2bd9, 0x681c, 0xa084, 0xfff1, 0x681e, 1170 0x7710, 0x2068, 0x704a, 0x7036, 0x157e, 0x20a9, 0x0031, 0x2003,
941 0x7e58, 0xa684, 0xfff1, 0xa085, 0x0010, 0x2030, 0x7e5a, 0x6008, 1171 0x0000, 0x8000, 0x0070, 0x336e, 0x0078, 0x3367, 0x157f, 0xad80,
942 0xa085, 0x0010, 0x600a, 0x0c7e, 0x7054, 0x2060, 0x6004, 0x2008, 1172 0x0009, 0x7036, 0x6a16, 0x68b7, 0x0700, 0x6823, 0x0800, 0x6827,
943 0x2c48, 0x0c7f, 0xa184, 0x0010, 0x0040, 0x2c54, 0x1078, 0x37eb, 1173 0x0003, 0x6eb4, 0x7e5a, 0x6820, 0xa084, 0x0c00, 0x0040, 0x33d3,
944 0x1078, 0x3604, 0x0078, 0x2c63, 0x0c7e, 0x7054, 0x2060, 0x6004, 1174 0x1078, 0x3797, 0x0078, 0x33d3, 0x7003, 0x0002, 0x7a80, 0xa294,
945 0x2008, 0x2c48, 0x0c7f, 0xa184, 0x0008, 0x0040, 0x2bca, 0x1078, 1175 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, 0x001f, 0xa215, 0x79a8,
946 0x37eb, 0x1078, 0x34f1, 0x88ff, 0x0040, 0x2bca, 0x789b, 0x0060, 1176 0x79a8, 0xa18c, 0x00ff, 0xa1e8, 0x7500, 0x2d04, 0x2d08, 0x7162,
947 0x2800, 0x78aa, 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 1177 0x2068, 0xa005, 0x0040, 0x33a3, 0x6814, 0xa206, 0x0040, 0x33be,
948 0x2c77, 0x782b, 0x3008, 0x781b, 0x0056, 0x0078, 0x2459, 0x782b, 1178 0x6800, 0x0078, 0x3396, 0x7003, 0x0005, 0x2001, 0x7710, 0x2068,
949 0x3008, 0x781b, 0x0065, 0x0078, 0x2459, 0x7aa8, 0x0078, 0x2beb, 1179 0x704a, 0x157e, 0x20a9, 0x0031, 0x2003, 0x0000, 0x8000, 0x0070,
950 0x8318, 0x2300, 0xa102, 0x0040, 0x2c89, 0x0048, 0x2c89, 0x0078, 1180 0x33b3, 0x0078, 0x33ac, 0x157f, 0xad80, 0x0009, 0x7036, 0x6a16,
951 0x2beb, 0xa284, 0x0080, 0x00c0, 0x36ad, 0x0078, 0x36a5, 0x0078, 1181 0x68b7, 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, 0x6eb4, 0x7e5a,
952 0x36ad, 0x0078, 0x369d, 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff, 1182 0x6820, 0xa084, 0x0c00, 0x0040, 0x33d3, 0xa084, 0x0800, 0x0040,
953 0xa08e, 0x0001, 0x0040, 0x2c9e, 0x1078, 0x23eb, 0x7aa8, 0xa294, 1183 0x33cd, 0x1078, 0x379b, 0x0078, 0x33d3, 0x1078, 0x3797, 0x708b,
954 0x00ff, 0x78a8, 0xa084, 0x00ff, 0xa08a, 0x0004, 0x00c8, 0x369d, 1184 0x0000, 0x0078, 0x33d3, 0x027e, 0x8207, 0xa084, 0x000f, 0x8003,
955 0x0079, 0x2caa, 0x369d, 0x343e, 0x369d, 0x3599, 0xa282, 0x0000, 1185 0x8003, 0x8003, 0xa080, 0x5480, 0x2060, 0x7056, 0x6000, 0x705a,
956 0x00c0, 0x2cb4, 0x1078, 0x23eb, 0x1078, 0x36c1, 0x782b, 0x3008, 1186 0x6004, 0x705e, 0xa684, 0x0060, 0x0040, 0x342b, 0x6b98, 0x6c94,
957 0x781b, 0x0065, 0x0078, 0x2459, 0xa282, 0x0003, 0x00c0, 0x2cc2, 1187 0x69ac, 0x68b0, 0xa105, 0x00c0, 0x340d, 0x7bd2, 0x7bda, 0x7cd6,
958 0x1078, 0x23eb, 0xa484, 0x8000, 0x00c0, 0x2ce5, 0x706c, 0xa005, 1188 0x7cde, 0xa6b4, 0xb7ff, 0x7e5a, 0xa684, 0x0060, 0xa086, 0x0060,
959 0x0040, 0x2ccc, 0x1078, 0x23eb, 0x6f14, 0x7782, 0xa7bc, 0x0f00, 1189 0x0040, 0x342b, 0x68c0, 0xa005, 0x0040, 0x3406, 0x7003, 0x0003,
960 0x1078, 0x37ef, 0x6008, 0xa085, 0x0021, 0x600a, 0x8738, 0xa784, 1190 0x682b, 0x0000, 0x1078, 0x4b3a, 0x0078, 0x3408, 0x1078, 0x4b4b,
961 0x001f, 0x00c0, 0x2cd0, 0x1078, 0x36c5, 0x706f, 0x0002, 0x2009, 1191 0xa6b5, 0x2000, 0x7e5a, 0x0078, 0x342b, 0x68b0, 0xa31a, 0x2100,
962 0x5138, 0x200b, 0x0009, 0x0078, 0x2ce7, 0x1078, 0x36d1, 0x782b, 1192 0xa423, 0x2400, 0xa305, 0x0040, 0x342b, 0x7bd2, 0x7bda, 0x7cd6,
963 0x3008, 0x781b, 0x0065, 0x0078, 0x2459, 0xa282, 0x0004, 0x0050, 1193 0x7cde, 0x68b0, 0xa6b4, 0xbfff, 0x7e5a, 0x007e, 0x68c0, 0xa005,
964 0x2cf3, 0x1078, 0x23eb, 0x2300, 0x0079, 0x2cf6, 0x2cf9, 0x2de2, 1194 0x007f, 0x0040, 0x3429, 0x7003, 0x0003, 0x1078, 0x4b3a, 0x0078,
965 0x2e15, 0xa286, 0x0003, 0x0040, 0x2cff, 0x1078, 0x23eb, 0x2001, 1195 0x342b, 0x1078, 0x4b96, 0x077f, 0x1078, 0x38bd, 0x2009, 0x0065,
966 0x0000, 0x007e, 0x68c0, 0xa005, 0x0040, 0x2d08, 0x7003, 0x0003, 1196 0xa684, 0x0004, 0x0040, 0x344c, 0x78e4, 0xa084, 0x0030, 0x0040,
967 0x68a0, 0xa084, 0x2000, 0x0040, 0x2d11, 0x6008, 0xa085, 0x0002, 1197 0x3444, 0x78ec, 0xa084, 0x0003, 0x0040, 0x3444, 0x782b, 0x3008,
968 0x600a, 0x007f, 0x703e, 0x7000, 0xa084, 0x0007, 0x0079, 0x2d18, 1198 0x2009, 0x0065, 0x0078, 0x344c, 0x0f7e, 0x2079, 0x5200, 0x1078,
969 0x2482, 0x2d22, 0x2d22, 0x2f17, 0x2f53, 0x2482, 0x2f53, 0x2d20, 1199 0x4887, 0x0f7f, 0x0040, 0x2523, 0x791a, 0x2d00, 0x704a, 0x8207,
970 0x1078, 0x23eb, 0xa684, 0x1000, 0x00c0, 0x2d2a, 0x1078, 0x4776, 1200 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x5480, 0x2048,
971 0x0040, 0x2dbc, 0x7868, 0xa08c, 0x00ff, 0x0040, 0x2d72, 0xa186, 1201 0x0078, 0x24fa, 0x6020, 0xa005, 0x0040, 0x3466, 0x8001, 0x6022,
972 0x0008, 0x00c0, 0x2d41, 0x1078, 0x33ee, 0x6008, 0xa084, 0xffef, 1202 0x6008, 0xa085, 0x0008, 0x600a, 0x7010, 0x6026, 0x007c, 0xa006,
973 0x600a, 0x1078, 0x3390, 0x0040, 0x2d72, 0x1078, 0x4776, 0x0078, 1203 0x1078, 0x4887, 0x6817, 0x0000, 0x681b, 0x0001, 0x6823, 0x0040,
974 0x2d59, 0xa186, 0x0028, 0x00c0, 0x2d72, 0x1078, 0x4776, 0x6008, 1204 0x681f, 0x0100, 0x7000, 0xa084, 0x0007, 0x0079, 0x3477, 0x2523,
975 0xa084, 0xffef, 0x600a, 0x6018, 0xa005, 0x0040, 0x2d59, 0x8001, 1205 0x3481, 0x3481, 0x349e, 0x3489, 0x3487, 0x3489, 0x347f, 0x1078,
976 0x601a, 0xa005, 0x0040, 0x2d59, 0x8001, 0xa005, 0x0040, 0x2d59, 1206 0x248c, 0x1078, 0x34a9, 0x1078, 0x34a2, 0x1078, 0x1cdc, 0x0078,
977 0x601e, 0x6820, 0xa084, 0x0001, 0x0040, 0x2482, 0x6820, 0xa084, 1207 0x2523, 0x706c, 0x706f, 0x0000, 0x7093, 0x0000, 0x0079, 0x3490,
978 0xfffe, 0x6822, 0x7060, 0x0c7e, 0x2060, 0x6800, 0x6002, 0x0c7f, 1208 0x349a, 0x349a, 0x3498, 0x3498, 0x3498, 0x349a, 0x3498, 0x349a,
979 0x6004, 0x6802, 0xa005, 0x2d00, 0x00c0, 0x2d6f, 0x6002, 0x6006, 1209 0x0079, 0x2902, 0x706f, 0x0000, 0x0078, 0x2523, 0x681b, 0x0000,
980 0x0078, 0x2482, 0x017e, 0x1078, 0x2e46, 0x017f, 0xa684, 0xdf00, 1210 0x0078, 0x2fb6, 0x6800, 0xa005, 0x00c0, 0x34a7, 0x6002, 0x6006,
981 0x681e, 0x682b, 0x0000, 0x6f14, 0x81ff, 0x0040, 0x2dbc, 0xa186, 1211 0x007c, 0x6010, 0xa005, 0x0040, 0x34b2, 0x8001, 0x00d0, 0x34b2,
982 0x0002, 0x00c0, 0x2dbc, 0xa684, 0x0800, 0x00c0, 0x2d8f, 0xa684, 1212 0x1078, 0x248c, 0x6012, 0x6008, 0xa084, 0xffef, 0x600a, 0x007c,
983 0x0060, 0x0040, 0x2d8f, 0x78d8, 0x7adc, 0x682e, 0x6a32, 0x6820, 1213 0x6018, 0xa005, 0x0040, 0x34be, 0x8001, 0x601a, 0x007c, 0x1078,
984 0xa084, 0x0800, 0x00c0, 0x2dbc, 0x8717, 0xa294, 0x000f, 0x8213, 1214 0x39e0, 0x681b, 0x0018, 0x0078, 0x34f5, 0x1078, 0x39e0, 0x681b,
985 0x8213, 0x8213, 0xa290, 0x5380, 0xa290, 0x0000, 0x221c, 0xa384, 1215 0x0019, 0x0078, 0x34f5, 0x1078, 0x39e0, 0x681b, 0x001a, 0x0078,
986 0x0100, 0x00c0, 0x2da5, 0x0078, 0x2dab, 0x8210, 0x2204, 0xa085, 1216 0x34f5, 0x1078, 0x39e0, 0x681b, 0x0003, 0x0078, 0x34f5, 0x7780,
987 0x0018, 0x2012, 0x8211, 0xa384, 0x0400, 0x0040, 0x2db8, 0x68a0, 1217 0x1078, 0x38bd, 0x7184, 0xa18c, 0x00ff, 0xa1e8, 0x7500, 0x2d04,
988 0xa084, 0x0100, 0x00c0, 0x2db8, 0x1078, 0x2eca, 0x0078, 0x2482, 1218 0x2d08, 0x2068, 0xa005, 0x00c0, 0x34e7, 0x0078, 0x2523, 0x6814,
989 0x6008, 0xa085, 0x0002, 0x600a, 0x6916, 0x6818, 0xa084, 0x8000, 1219 0x7280, 0xa206, 0x0040, 0x34ef, 0x6800, 0x0078, 0x34e0, 0x6800,
990 0x0040, 0x2dc4, 0x703c, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x1078, 1220 0x200a, 0x681b, 0x0005, 0x708b, 0x0000, 0x1078, 0x34a9, 0x6820,
991 0x33df, 0x1078, 0x33ee, 0x00c0, 0x2dd1, 0x6008, 0xa084, 0xffef, 1221 0xa084, 0x0001, 0x00c0, 0x34fe, 0x1078, 0x34a2, 0x1078, 0x34b8,
992 0x600a, 0x6820, 0xa084, 0x0001, 0x00c0, 0x2dda, 0x1078, 0x33d8, 1222 0x681f, 0x0000, 0x6823, 0x0020, 0x1078, 0x1cdc, 0x0078, 0x2523,
993 0x0078, 0x2dde, 0x7060, 0x2060, 0x6800, 0x6002, 0x1078, 0x1c70, 1223 0xa282, 0x0003, 0x00c0, 0x376b, 0x7da8, 0xa5ac, 0x00ff, 0x7ca8,
994 0x0078, 0x2482, 0xa282, 0x0004, 0x0048, 0x2de8, 0x1078, 0x23eb, 1224 0xa4a4, 0x00ff, 0x6920, 0xa18d, 0x0080, 0x6922, 0xa184, 0x0100,
995 0x2200, 0x0079, 0x2deb, 0x2de6, 0x2def, 0x2dfc, 0x2def, 0x7000, 1225 0x0040, 0x356c, 0xa18c, 0xfeff, 0x6922, 0xa4a4, 0x00ff, 0x0040,
996 0xa086, 0x0005, 0x0040, 0x2df8, 0x1078, 0x36c1, 0x782b, 0x3008, 1226 0x3556, 0xa482, 0x000c, 0x0048, 0x3529, 0x0040, 0x3529, 0x2021,
997 0x781b, 0x0065, 0x0078, 0x2459, 0x7890, 0x8007, 0x8001, 0xa084, 1227 0x000c, 0x852b, 0x852b, 0x1078, 0x382e, 0x0040, 0x3533, 0x1078,
998 0x0007, 0xa080, 0x0018, 0x789a, 0x79a8, 0xa18c, 0x00ff, 0xa186, 1228 0x3627, 0x0078, 0x355f, 0x1078, 0x37e9, 0x0c7e, 0x2960, 0x6004,
999 0x0003, 0x0040, 0x2e11, 0xa186, 0x0000, 0x0040, 0x2e11, 0x0078, 1229 0xa084, 0xfff5, 0x6006, 0x1078, 0x3652, 0x0c7f, 0x6920, 0xa18d,
1000 0x369d, 0x781b, 0x0065, 0x0078, 0x2459, 0x6820, 0xa085, 0x0004, 1230 0x0100, 0x6922, 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400,
1001 0x6822, 0x82ff, 0x00c0, 0x2e20, 0x1078, 0x36c1, 0x0078, 0x2e27, 1231 0x00c0, 0x3550, 0x782b, 0x3008, 0x781b, 0x0056, 0x0078, 0x24fa,
1002 0x8211, 0x0040, 0x2e25, 0x1078, 0x23eb, 0x1078, 0x36d1, 0x782b, 1232 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x24fa, 0x0c7e, 0x2960,
1003 0x3008, 0x781b, 0x0065, 0x0078, 0x2459, 0x702c, 0x8003, 0x0048, 1233 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078, 0x3652, 0x0c7f, 0x7e58,
1004 0x2e37, 0x2019, 0x4d9e, 0x1078, 0x2276, 0x702f, 0x8000, 0x1078, 1234 0xa684, 0x0400, 0x00c0, 0x3568, 0x781b, 0x0058, 0x0078, 0x24fa,
1005 0x3912, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x2e43, 0x0018, 0x2e43, 1235 0x781b, 0x0065, 0x0078, 0x24fa, 0x0c7e, 0x7054, 0x2060, 0x6100,
1006 0x791a, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0xa684, 0x0060, 1236 0xa18c, 0x1000, 0x0040, 0x35ac, 0x6208, 0x8217, 0xa294, 0x00ff,
1007 0x00c0, 0x2e50, 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x2ec9, 1237 0xa282, 0x000c, 0x0048, 0x3580, 0x0040, 0x3580, 0x2011, 0x000c,
1008 0xa684, 0x0800, 0x00c0, 0x2e72, 0x68b4, 0xa084, 0x4800, 0xa635, 1238 0x2400, 0xa202, 0x00c8, 0x3585, 0x2220, 0x6208, 0xa294, 0x00ff,
1009 0xa684, 0x0800, 0x00c0, 0x2e72, 0x6998, 0x6a94, 0x692e, 0x6a32, 1239 0x7018, 0xa086, 0x0028, 0x00c0, 0x3595, 0xa282, 0x0019, 0x00c8,
1010 0x703c, 0xa005, 0x00c0, 0x2e6a, 0x2200, 0xa105, 0x0040, 0x2e71, 1240 0x359b, 0x2011, 0x0019, 0x0078, 0x359b, 0xa282, 0x000c, 0x00c8,
1011 0x703f, 0x0015, 0x7000, 0xa086, 0x0006, 0x0040, 0x2e71, 0x1078, 1241 0x359b, 0x2011, 0x000c, 0x2200, 0xa502, 0x00c8, 0x35a0, 0x2228,
1012 0x4776, 0x007c, 0xa684, 0x0020, 0x0040, 0x2e94, 0xa684, 0x4000, 1242 0x1078, 0x37ed, 0x852b, 0x852b, 0x1078, 0x382e, 0x0040, 0x35ac,
1013 0x0040, 0x2e80, 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x2e6a, 1243 0x1078, 0x3627, 0x0078, 0x35b0, 0x1078, 0x37e9, 0x1078, 0x3652,
1014 0x68b4, 0xa084, 0x4800, 0xa635, 0xa684, 0x4000, 0x00c0, 0x2e7a, 1244 0x7858, 0xa085, 0x0004, 0x785a, 0x0c7f, 0x782b, 0x3008, 0x781b,
1015 0x703c, 0xa005, 0x00c0, 0x2e8e, 0x703f, 0x0015, 0x79d8, 0x7adc, 1245 0x0065, 0x0078, 0x24fa, 0x0c7e, 0x2960, 0x6000, 0xd0e4, 0x00c0,
1016 0x692e, 0x6a32, 0x0078, 0x2e6a, 0xa684, 0x4000, 0x0040, 0x2e9e, 1246 0x35d5, 0xd0b4, 0x00c0, 0x35cf, 0x6010, 0xa084, 0x000f, 0x00c0,
1017 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x2e6a, 0x68b4, 0xa084, 1247 0x35cf, 0x6104, 0xa18c, 0xfff5, 0x6106, 0x0c7f, 0x007c, 0x2011,
1018 0x4800, 0xa635, 0xa684, 0x4000, 0x00c0, 0x2e98, 0x703c, 0xa005, 1248 0x0032, 0x2019, 0x0000, 0x0078, 0x35fc, 0x68a0, 0xa084, 0x0200,
1019 0x00c0, 0x2eac, 0x703f, 0x0015, 0x79d8, 0x7adc, 0x78d0, 0x80fb, 1249 0x00c0, 0x35cf, 0x6208, 0xa294, 0x00ff, 0x7018, 0xa086, 0x0028,
1020 0x00c8, 0x2eb3, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 1250 0x00c0, 0x35ea, 0xa282, 0x0019, 0x00c8, 0x35f0, 0x2011, 0x0019,
1021 0x692e, 0x6a32, 0x2100, 0xa205, 0x00c0, 0x2ec0, 0x0078, 0x2e6a, 1251 0x0078, 0x35f0, 0xa282, 0x000c, 0x00c8, 0x35f0, 0x2011, 0x000c,
1022 0x7000, 0xa086, 0x0006, 0x0040, 0x2ec9, 0x1078, 0x4b30, 0x0078, 1252 0x6308, 0x831f, 0xa39c, 0x00ff, 0xa382, 0x000c, 0x0048, 0x35fc,
1023 0x2e6a, 0x007c, 0x6008, 0xa085, 0x0200, 0x600a, 0xa384, 0x0200, 1253 0x0040, 0x35fc, 0x2019, 0x000c, 0x78ab, 0x0001, 0x78ab, 0x0003,
1024 0x0040, 0x2ed6, 0x6008, 0xa085, 0x0002, 0x600a, 0x681b, 0x0006, 1254 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005, 0x6820, 0xa085,
1025 0x688f, 0x0000, 0x6893, 0x0000, 0x6a30, 0x692c, 0x6a3e, 0x6942, 1255 0x0100, 0x6822, 0x0c7f, 0x007c, 0x0c7e, 0x2960, 0xa18c, 0xfff5,
1026 0x682f, 0x0003, 0x6833, 0x0000, 0x6837, 0x0020, 0x6897, 0x0000, 1256 0x6106, 0x2011, 0x0032, 0x2019, 0x0000, 0x0078, 0x3617, 0x78ab,
1027 0x689b, 0x0020, 0x68b3, 0x0000, 0x68af, 0x0000, 0x7000, 0x0079, 1257 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0,
1028 0x2ef1, 0x2482, 0x2efb, 0x2f04, 0x2ef9, 0x2ef9, 0x2ef9, 0x2ef9, 1258 0x0005, 0x6820, 0xa085, 0x0100, 0x6822, 0x0c7f, 0x007c, 0x0c7e,
1029 0x2ef9, 0x1078, 0x23eb, 0x6820, 0xa084, 0x0001, 0x00c0, 0x2f04, 1259 0x7154, 0x2160, 0x1078, 0x362e, 0x0c7f, 0x007c, 0x2008, 0xa084,
1030 0x1078, 0x33d8, 0x0078, 0x2f0a, 0x7060, 0x2c50, 0x2060, 0x6800, 1260 0xfff0, 0xa425, 0x7c86, 0x6018, 0x789a, 0x7cae, 0x6412, 0x78a4,
1031 0x6002, 0x2a60, 0x2021, 0x515a, 0x2404, 0xa005, 0x0040, 0x2f13, 1261 0xa084, 0xfff8, 0xa18c, 0x0007, 0xa105, 0x78a6, 0x6016, 0x788a,
1032 0x2020, 0x0078, 0x2f0c, 0x2d22, 0x206b, 0x0000, 0x007c, 0x1078, 1262 0xa4a4, 0x000f, 0x8427, 0x8204, 0x8004, 0xa084, 0x00ff, 0xa405,
1033 0x33df, 0x1078, 0x33ee, 0x6008, 0xa084, 0xfdff, 0x600a, 0x682b, 1263 0x600e, 0x78ec, 0xd08c, 0x00c0, 0x3651, 0x6004, 0xa084, 0xfff5,
1034 0x0000, 0x789b, 0x000e, 0x6f14, 0x6817, 0x0002, 0x1078, 0x4b78, 1264 0x6006, 0x007c, 0x0c7e, 0x7054, 0x2060, 0x1078, 0x3659, 0x0c7f,
1035 0xa684, 0x0800, 0x0040, 0x2f30, 0x691c, 0xa18d, 0x2000, 0x691e, 1265 0x007c, 0x6018, 0x789a, 0x78a4, 0xa084, 0xfff0, 0x78a6, 0x6012,
1036 0x6818, 0xa084, 0x8000, 0x0040, 0x2f40, 0x7868, 0xa08c, 0x00ff, 1266 0x7884, 0xa084, 0xfff0, 0x7886, 0x007c, 0xa282, 0x0002, 0x00c0,
1037 0x0040, 0x2f3e, 0x681b, 0x001e, 0x0078, 0x2f40, 0x681b, 0x0000, 1267 0x376b, 0x7aa8, 0x6920, 0xa18d, 0x0080, 0x6922, 0xa184, 0x0200,
1038 0x2021, 0x515a, 0x2404, 0xad06, 0x0040, 0x2f47, 0x7460, 0x6800, 1268 0x0040, 0x36ae, 0xa18c, 0xfdff, 0x6922, 0xa294, 0x00ff, 0xa282,
1039 0x2022, 0x68c3, 0x0000, 0x6a3c, 0x6940, 0x6a32, 0x692e, 0x1078, 1269 0x0002, 0x00c8, 0x376b, 0x1078, 0x36f9, 0x1078, 0x3652, 0xa980,
1040 0x1c70, 0x0078, 0x2482, 0x1078, 0x2e46, 0x682b, 0x0000, 0x2001, 1270 0x0001, 0x200c, 0x1078, 0x38b9, 0x1078, 0x35bb, 0x88ff, 0x0040,
1041 0x000e, 0x6f14, 0x1078, 0x3918, 0xa08c, 0x00ff, 0x6916, 0x6818, 1271 0x36a1, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, 0xa6b5, 0x0004,
1042 0xa084, 0x8000, 0x0040, 0x2f66, 0x703c, 0x681a, 0xa68c, 0xdf00, 1272 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x369b, 0x782b, 0x3008, 0x781b,
1043 0x691e, 0x706f, 0x0000, 0x0078, 0x2482, 0x7000, 0xa005, 0x00c0, 1273 0x0056, 0x0078, 0x24fa, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078,
1044 0x2f73, 0x0078, 0x2482, 0xa006, 0x1078, 0x4776, 0x6817, 0x0000, 1274 0x24fa, 0x7e58, 0xa684, 0x0400, 0x00c0, 0x36aa, 0x781b, 0x0058,
1045 0x681b, 0x0014, 0xa68c, 0xdf00, 0x691e, 0x682b, 0x0000, 0x6820, 1275 0x0078, 0x24fa, 0x781b, 0x0065, 0x0078, 0x24fa, 0xa282, 0x0002,
1046 0xa085, 0x00ff, 0x6822, 0x7000, 0x0079, 0x2f86, 0x2482, 0x2f90, 1276 0x00c8, 0x36b6, 0xa284, 0x0001, 0x0040, 0x36c0, 0x7154, 0xa188,
1047 0x2f90, 0x2f92, 0x2f92, 0x2f92, 0x2f92, 0x2f8e, 0x1078, 0x23eb, 1277 0x0000, 0x210c, 0xa18c, 0x2000, 0x00c0, 0x36c0, 0x2011, 0x0000,
1048 0x1078, 0x33ee, 0x6008, 0xa084, 0xffef, 0x600a, 0x0078, 0x33a8, 1278 0x1078, 0x37db, 0x1078, 0x36f9, 0x1078, 0x3652, 0x7858, 0xa085,
1049 0x2300, 0x0079, 0x2f9b, 0x2f9e, 0x2fa0, 0x2fd9, 0x1078, 0x23eb, 1279 0x0004, 0x785a, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x24fa,
1050 0x7000, 0x0079, 0x2fa3, 0x2482, 0x2fad, 0x2fad, 0x2fc8, 0x2fad, 1280 0x0c7e, 0x027e, 0x2960, 0x6000, 0x2011, 0x0001, 0xd0ec, 0x00c0,
1051 0x2fd5, 0x2fc8, 0x2fab, 0x1078, 0x23eb, 0xa684, 0x0060, 0xa086, 1281 0x36e9, 0xd0bc, 0x00c0, 0x36e7, 0x6014, 0xa084, 0x0040, 0x00c0,
1052 0x0060, 0x00c0, 0x2fc4, 0xa6b4, 0xffdf, 0xa6b4, 0xbfff, 0xa6b5, 1282 0x36e7, 0xa18c, 0xffef, 0x6106, 0xa006, 0x0078, 0x36f6, 0x2011,
1053 0x2000, 0x7e5a, 0x681c, 0xa084, 0xffdf, 0x681e, 0x1078, 0x4776, 1283 0x0000, 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa,
1054 0x1078, 0x4a3a, 0x0078, 0x3888, 0xa684, 0x2000, 0x0040, 0x2fb7, 1284 0xa8c0, 0x0004, 0x6820, 0xa085, 0x0200, 0x6822, 0x027f, 0x0c7f,
1055 0x6818, 0xa084, 0x8000, 0x0040, 0x2fd5, 0x681b, 0x0015, 0xa684, 1285 0x007c, 0x0c7e, 0x7054, 0x2060, 0x1078, 0x3700, 0x0c7f, 0x007c,
1056 0x4000, 0x0040, 0x2fd5, 0x681b, 0x0007, 0x1078, 0x389c, 0x0078, 1286 0x82ff, 0x0040, 0x3705, 0x2011, 0x0040, 0x6018, 0xa080, 0x0002,
1057 0x2459, 0x1078, 0x23eb, 0x2300, 0x0079, 0x2fde, 0x2fe1, 0x2fe3, 1287 0x789a, 0x78a4, 0xa084, 0xffbf, 0xa205, 0x78a6, 0x788a, 0x6016,
1058 0x3016, 0x1078, 0x23eb, 0x7000, 0x0079, 0x2fe6, 0x2482, 0x2ff0, 1288 0x78ec, 0xd08c, 0x00c0, 0x3718, 0x6004, 0xa084, 0xffef, 0x6006,
1059 0x2ff0, 0x300b, 0x2ff0, 0x3012, 0x300b, 0x2fee, 0x1078, 0x23eb, 1289 0x007c, 0x007e, 0x7000, 0xa086, 0x0003, 0x0040, 0x3722, 0x007f,
1060 0xa684, 0x0060, 0xa086, 0x0060, 0x00c0, 0x3007, 0xa6b4, 0xffbf, 1290 0x0078, 0x3725, 0x007f, 0x0078, 0x3767, 0xa684, 0x0020, 0x0040,
1061 0xa6b4, 0xbfff, 0xa6b5, 0x2000, 0x7e5a, 0x681c, 0xa084, 0xffbf, 1291 0x3767, 0x7888, 0xa084, 0x0040, 0x0040, 0x3767, 0x7bb8, 0xa384,
1062 0x681e, 0x1078, 0x4776, 0x1078, 0x4a3a, 0x0078, 0x3888, 0xa684, 1292 0x003f, 0x831b, 0x00c8, 0x3735, 0x8000, 0xa005, 0x0040, 0x374b,
1063 0x2000, 0x0040, 0x2ffa, 0x6818, 0xa084, 0x8000, 0x0040, 0x3012, 1293 0x831b, 0x00c8, 0x373e, 0x8001, 0x0040, 0x3763, 0xa684, 0x4000,
1064 0x681b, 0x0007, 0x781b, 0x00cd, 0x0078, 0x2459, 0x6820, 0xa085, 1294 0x0040, 0x374b, 0x78b8, 0x801b, 0x00c8, 0x3747, 0x8000, 0xa084,
1065 0x0004, 0x6822, 0x1078, 0x3853, 0xa6b5, 0x0800, 0x1078, 0x36c1, 1295 0x003f, 0x00c0, 0x3763, 0xa6b4, 0xbfff, 0x7e5a, 0x79d8, 0x7adc,
1066 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2459, 0x2300, 0x0079, 1296 0x2001, 0x0001, 0xa108, 0x00c8, 0x3757, 0xa291, 0x0000, 0x79d2,
1067 0x3029, 0x302c, 0x302e, 0x3030, 0x1078, 0x23eb, 0x0078, 0x36ad, 1297 0x79da, 0x7ad6, 0x7ade, 0x1078, 0x4c41, 0x781b, 0x0064, 0x1078,
1068 0xa684, 0x0400, 0x00c0, 0x3059, 0x79e4, 0xa184, 0x0020, 0x0040, 1298 0x4ac6, 0x0078, 0x24fa, 0x781b, 0x0064, 0x0078, 0x24fa, 0x781b,
1069 0x3040, 0x78ec, 0xa084, 0x0003, 0x0040, 0x3040, 0x782b, 0x3009, 1299 0x0065, 0x0078, 0x24fa, 0x1078, 0x37a3, 0x782b, 0x3008, 0x781b,
1070 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, 0x79e4, 1300 0x0065, 0x0078, 0x24fa, 0x1078, 0x378f, 0x782b, 0x3008, 0x781b,
1071 0xa184, 0x0020, 0x0040, 0x3051, 0x78ec, 0xa084, 0x0003, 0x00c0, 1301 0x0065, 0x0078, 0x24fa, 0x6827, 0x0002, 0x1078, 0x3797, 0x78e4,
1072 0x3055, 0x2001, 0x0014, 0x0078, 0x2d01, 0xa184, 0x0007, 0x0079, 1302 0xa084, 0x0030, 0x0040, 0x2523, 0x78ec, 0xa084, 0x0003, 0x0040,
1073 0x3091, 0x7a90, 0xa294, 0x0007, 0x789b, 0x0060, 0x79a8, 0x81ff, 1303 0x2523, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x24fa, 0x2001,
1074 0x0040, 0x308f, 0x789b, 0x0010, 0x7ba8, 0xa384, 0x0001, 0x00c0, 1304 0x0005, 0x0078, 0x37a5, 0x2001, 0x000c, 0x0078, 0x37a5, 0x2001,
1075 0x3080, 0x7ba8, 0x7ba8, 0xa386, 0x0001, 0x00c0, 0x3073, 0x2009, 1305 0x0006, 0x0078, 0x37a5, 0x2001, 0x000d, 0x0078, 0x37a5, 0x2001,
1076 0xfff7, 0x0078, 0x3079, 0xa386, 0x0003, 0x00c0, 0x3080, 0x2009, 1306 0x0009, 0x0078, 0x37a5, 0x2001, 0x0007, 0x789b, 0x0010, 0x78aa,
1077 0xffef, 0x0c7e, 0x7054, 0x2060, 0x6004, 0xa104, 0x6006, 0x0c7f, 1307 0x789b, 0x0060, 0x78ab, 0x0001, 0xa6b5, 0x0004, 0x7e5a, 0x007c,
1078 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, 0x782b, 1308 0x077e, 0x873f, 0xa7bc, 0x000f, 0x873b, 0x873b, 0x8703, 0xa0e0,
1079 0x3009, 0x6920, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x6922, 0x0078, 1309 0x5480, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, 0xa184, 0x000f, 0x0040,
1080 0x3888, 0x299e, 0x29a9, 0x309b, 0x30a3, 0x3099, 0x3099, 0x3888, 1310 0x37c9, 0xa184, 0xfff0, 0x78a6, 0x6012, 0x6004, 0xa085, 0x0008,
1081 0x3888, 0x1078, 0x23eb, 0x6920, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 1311 0x6006, 0x8738, 0x8738, 0x7f9a, 0x79a4, 0xa184, 0x0040, 0x0040,
1082 0x6922, 0x0078, 0x3892, 0x6920, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 1312 0x37d9, 0xa184, 0xffbf, 0x78a6, 0x6016, 0x6004, 0xa085, 0x0010,
1083 0x6922, 0x0078, 0x3888, 0x79e4, 0xa184, 0x0030, 0x0040, 0x30b5, 1313 0x6006, 0x077f, 0x007c, 0x789b, 0x0010, 0x78ab, 0x0001, 0x78ab,
1084 0x78ec, 0xa084, 0x0003, 0x00c0, 0x30dc, 0x7000, 0xa086, 0x0004, 1314 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0060, 0x78ab, 0x0004,
1085 0x00c0, 0x30cf, 0x706c, 0xa086, 0x0002, 0x00c0, 0x30c5, 0x2011, 1315 0x007c, 0x2021, 0x0000, 0x2029, 0x0032, 0x789b, 0x0010, 0x78ab,
1086 0x0002, 0x2019, 0x0000, 0x0078, 0x2848, 0x706c, 0xa086, 0x0006, 1316 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa, 0x7caa, 0x789b,
1087 0x0040, 0x30bf, 0x706c, 0xa086, 0x0004, 0x0040, 0x30bf, 0x7000, 1317 0x0060, 0x78ab, 0x0005, 0x007c, 0x157e, 0x8007, 0xa084, 0x00ff,
1088 0xa086, 0x0000, 0x0040, 0x2459, 0x6818, 0xa085, 0x8000, 0x681a, 1318 0x8003, 0x8003, 0xa080, 0x0020, 0x789a, 0x79a4, 0xa18c, 0xfff0,
1089 0x2001, 0x0014, 0x0078, 0x2d01, 0xa184, 0x0007, 0x0079, 0x30e0, 1319 0x2001, 0x5246, 0x2004, 0xa082, 0x0028, 0x0040, 0x3817, 0x2021,
1090 0x3888, 0x3888, 0x30e8, 0x3888, 0x38ed, 0x38ed, 0x3888, 0x3888, 1320 0x38a0, 0x2019, 0x0014, 0x20a9, 0x000c, 0x0078, 0x381d, 0x2021,
1091 0xa684, 0x0080, 0x0040, 0x3117, 0x7194, 0x81ff, 0x0040, 0x3117, 1321 0x38ac, 0x2019, 0x0019, 0x20a9, 0x000d, 0x2011, 0x0064, 0x2404,
1092 0xa182, 0x000d, 0x00d0, 0x30f8, 0x7097, 0x0000, 0x0078, 0x30fd, 1322 0xa084, 0xfff0, 0xa106, 0x0040, 0x382c, 0x8420, 0x2300, 0xa210,
1093 0xa182, 0x000c, 0x7096, 0x2009, 0x000c, 0x789b, 0x0061, 0x79aa, 1323 0x0070, 0x382c, 0x0078, 0x381f, 0x157f, 0x007c, 0x157e, 0x2009,
1094 0x157e, 0x137e, 0x147e, 0x7098, 0x8114, 0xa210, 0x729a, 0xa080, 1324 0x5246, 0x210c, 0xa182, 0x0032, 0x0048, 0x3842, 0x0040, 0x3846,
1095 0x000b, 0xad00, 0x2098, 0x20a1, 0x012b, 0x789b, 0x0000, 0x8108, 1325 0x2009, 0x3892, 0x2019, 0x0011, 0x20a9, 0x000e, 0x2011, 0x0032,
1096 0x81ac, 0x53a6, 0x147f, 0x137f, 0x157f, 0x0078, 0x3892, 0xa684, 1326 0x0078, 0x3858, 0xa182, 0x0028, 0x0040, 0x3850, 0x2009, 0x38a0,
1097 0x0400, 0x00c0, 0x3158, 0x6820, 0xa084, 0x0001, 0x0040, 0x3892, 1327 0x2019, 0x0014, 0x20a9, 0x000c, 0x2011, 0x0064, 0x0078, 0x3858,
1098 0xa68c, 0x0060, 0xa684, 0x0060, 0x0040, 0x312c, 0xa086, 0x0060, 1328 0x2009, 0x38ac, 0x2019, 0x0019, 0x20a9, 0x000d, 0x2011, 0x0064,
1099 0x00c0, 0x312c, 0xa18d, 0x4000, 0xa18c, 0xfffb, 0x795a, 0x69b6, 1329 0x2200, 0xa502, 0x0040, 0x3868, 0x0048, 0x3868, 0x8108, 0x2300,
1100 0x789b, 0x0060, 0x78ab, 0x0000, 0x789b, 0x0061, 0x6818, 0xa085, 1330 0xa210, 0x0070, 0x3865, 0x0078, 0x3858, 0x157f, 0xa006, 0x007c,
1101 0x8000, 0x681a, 0x78aa, 0x8008, 0x810c, 0x0040, 0x3407, 0xa18c, 1331 0x157f, 0xa582, 0x0064, 0x00c8, 0x3877, 0x7808, 0xa085, 0x0070,
1102 0x00f8, 0x00c0, 0x3407, 0x157e, 0x137e, 0x147e, 0x20a1, 0x012b, 1332 0x780a, 0x7044, 0xa085, 0x0070, 0x7046, 0x0078, 0x3877, 0x78ec,
1103 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 1333 0xa084, 0x0300, 0x0040, 0x387f, 0x2104, 0x0078, 0x3890, 0x2104,
1104 0x147f, 0x137f, 0x157f, 0x6814, 0x8007, 0x7882, 0x0078, 0x3892, 1334 0xa09e, 0x1102, 0x00c0, 0x3890, 0x2001, 0x04fd, 0x2004, 0xa082,
1105 0x6818, 0xa084, 0x8000, 0x0040, 0x315f, 0x681b, 0x0008, 0x781b, 1335 0x0005, 0x0048, 0x388f, 0x2001, 0x1201, 0x0078, 0x3890, 0x2104,
1106 0x00c3, 0x0078, 0x2459, 0x2300, 0x0079, 0x3166, 0x316b, 0x320a, 1336 0xa005, 0x007c, 0x1102, 0x3002, 0x3202, 0x4203, 0x4403, 0x5404,
1107 0x3169, 0x1078, 0x23eb, 0x7000, 0xa084, 0x0007, 0x0079, 0x3170, 1337 0x5604, 0x6605, 0x6805, 0x7806, 0x7a06, 0x0c07, 0x0c07, 0x0e07,
1108 0x2482, 0x317a, 0x31af, 0x3185, 0x3178, 0x2482, 0x3178, 0x3178, 1338 0x3202, 0x4202, 0x5202, 0x6202, 0x7202, 0x6605, 0x7605, 0x7805,
1109 0x1078, 0x23eb, 0x681c, 0xa084, 0x2000, 0x0040, 0x3193, 0x6008, 1339 0x7a05, 0x7c05, 0x7e05, 0x7f05, 0x2202, 0x3202, 0x4202, 0x5202,
1110 0xa085, 0x0002, 0x600a, 0x0078, 0x3193, 0x68c0, 0xa005, 0x00c0, 1340 0x5404, 0x6404, 0x7404, 0x7604, 0x7804, 0x7a04, 0x7c04, 0x7e04,
1111 0x31af, 0x6920, 0xa18d, 0x0001, 0x6922, 0x68c3, 0x0001, 0x6800, 1341 0x7f04, 0x789b, 0x0010, 0xa046, 0x007c, 0xa784, 0x0f00, 0x800b,
1112 0x706a, 0x0078, 0x31a9, 0x6920, 0xa18d, 0x0001, 0x6922, 0x6800, 1342 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xa0e0,
1113 0x6006, 0xa005, 0x00c0, 0x319d, 0x6002, 0x681c, 0xa084, 0x000e, 1343 0x5500, 0x007c, 0x79d8, 0x7adc, 0x78d0, 0x801b, 0x00c8, 0x38d1,
1114 0x0040, 0x31a9, 0x7014, 0x68ba, 0x7130, 0xa188, 0x7400, 0x0078, 1344 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x007c, 0x0f7e,
1115 0x31ab, 0x2009, 0x7500, 0x2104, 0x6802, 0x2d0a, 0x7162, 0x6eb6, 1345 0x2079, 0x0100, 0x2009, 0x5240, 0x2091, 0x8000, 0x2104, 0x0079,
1116 0xa684, 0x0060, 0x0040, 0x3208, 0xa684, 0x0800, 0x00c0, 0x31c3, 1346 0x38e1, 0x3917, 0x38eb, 0x38eb, 0x38eb, 0x38eb, 0x38eb, 0x38eb,
1117 0xa684, 0x7fff, 0x68b6, 0x6894, 0x68a6, 0x6898, 0x68aa, 0x1078, 1347 0x391b, 0x1078, 0x248c, 0x784b, 0x0004, 0x7848, 0xa084, 0x0004,
1118 0x4776, 0x0078, 0x3208, 0xa684, 0x0020, 0x0040, 0x31d8, 0x68c0, 1348 0x00c0, 0x38ed, 0x784b, 0x0008, 0x7848, 0xa084, 0x0008, 0x00c0,
1119 0xa005, 0x0040, 0x31cf, 0x1078, 0x4b78, 0x0078, 0x31d2, 0xa006, 1349 0x38f4, 0x68b4, 0xa085, 0x4000, 0x68b6, 0x7858, 0xa085, 0x4000,
1120 0x1078, 0x4b30, 0x79d8, 0x7adc, 0x69aa, 0x6aa6, 0x0078, 0x31de, 1350 0x785a, 0x7830, 0xa084, 0x0080, 0x00c0, 0x3917, 0x0018, 0x3917,
1121 0x1078, 0x37fc, 0x69aa, 0x6aa6, 0x1078, 0x4b30, 0xa684, 0x8000, 1351 0x681c, 0xa084, 0x0020, 0x00c0, 0x3915, 0x0e7e, 0x2071, 0x5240,
1122 0x0040, 0x3208, 0xa684, 0x7fff, 0x68b6, 0x2001, 0x0076, 0x1078, 1352 0x1078, 0x396a, 0x0e7f, 0x0078, 0x3917, 0x781b, 0x00ca, 0x2091,
1123 0x3918, 0x2010, 0x2001, 0x0078, 0x1078, 0x3918, 0x2008, 0xa684, 1353 0x8001, 0x0f7f, 0x007c, 0x70b3, 0x0000, 0x1078, 0x3b44, 0x0078,
1124 0x0020, 0x00c0, 0x3200, 0x2001, 0x007a, 0x1078, 0x3918, 0x801b, 1354 0x3917, 0x0c7e, 0x6814, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003,
1125 0x00c8, 0x31fb, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 1355 0x8003, 0xa0e0, 0x5480, 0x6004, 0xa084, 0x000a, 0x00c0, 0x3954,
1126 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 1356 0x6108, 0xa194, 0xff00, 0x0040, 0x3954, 0xa18c, 0x00ff, 0x2001,
1127 0x0078, 0x2482, 0x0078, 0x36ad, 0x7037, 0x0000, 0xa282, 0x0006, 1357 0x0019, 0xa106, 0x0040, 0x3943, 0x2001, 0x0032, 0xa106, 0x0040,
1128 0x0050, 0x3214, 0x1078, 0x23eb, 0x7000, 0xa084, 0x0007, 0x10c0, 1358 0x3947, 0x0078, 0x394b, 0x2009, 0x0020, 0x0078, 0x394d, 0x2009,
1129 0x39be, 0x2300, 0x0079, 0x321c, 0x321f, 0x3248, 0x325c, 0x2200, 1359 0x003f, 0x0078, 0x394d, 0x2011, 0x0000, 0x2100, 0xa205, 0x600a,
1130 0x0079, 0x3222, 0x3246, 0x36ad, 0x3228, 0x3246, 0x3278, 0x32ba, 1360 0x6004, 0xa085, 0x0002, 0x6006, 0x0c7f, 0x007c, 0x781b, 0x0065,
1131 0x7003, 0x0005, 0x2001, 0x7610, 0x2068, 0x704a, 0x157e, 0x20a9, 1361 0x0078, 0x24fa, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x24fa,
1132 0x0031, 0x2003, 0x0000, 0x8000, 0x0070, 0x3238, 0x0078, 0x3231, 1362 0x781b, 0x0058, 0x0078, 0x24fa, 0x782b, 0x3008, 0x781b, 0x0056,
1133 0x157f, 0xad80, 0x0009, 0x7036, 0x6817, 0x0000, 0x68b7, 0x0700, 1363 0x0078, 0x24fa, 0x2009, 0x5220, 0x210c, 0xa186, 0x0000, 0x0040,
1134 0x6823, 0x0800, 0x6827, 0x0003, 0x0078, 0x369d, 0x1078, 0x23eb, 1364 0x397e, 0xa186, 0x0001, 0x0040, 0x3981, 0x2009, 0x5238, 0x200b,
1135 0x7003, 0x0005, 0x2001, 0x7610, 0x2068, 0x704a, 0xad80, 0x0009, 1365 0x000b, 0x706f, 0x0001, 0x781b, 0x0048, 0x007c, 0x781b, 0x00c4,
1136 0x7036, 0x2200, 0x0079, 0x3254, 0x36ad, 0x325a, 0x325a, 0x3278, 1366 0x007c, 0x2009, 0x5238, 0x200b, 0x000a, 0x007c, 0x2009, 0x5220,
1137 0x325a, 0x36ad, 0x1078, 0x23eb, 0x7003, 0x0005, 0x2001, 0x7610, 1367 0x210c, 0xa186, 0x0000, 0x0040, 0x39a1, 0xa186, 0x0001, 0x0040,
1138 0x2068, 0x704a, 0xad80, 0x0009, 0x7036, 0x2200, 0x0079, 0x3268, 1368 0x399b, 0x2009, 0x5238, 0x200b, 0x000b, 0x706f, 0x0001, 0x781b,
1139 0x3270, 0x326e, 0x326e, 0x3270, 0x326e, 0x3270, 0x1078, 0x23eb, 1369 0x0048, 0x0078, 0x24fa, 0x2009, 0x5238, 0x200b, 0x000a, 0x0078,
1140 0x1078, 0x36d1, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2459, 1370 0x24fa, 0x782b, 0x3008, 0x781b, 0x00c4, 0x0078, 0x24fa, 0x781b,
1141 0x7003, 0x0002, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 1371 0x00ca, 0x0078, 0x24fa, 0x782b, 0x3008, 0x781b, 0x00ca, 0x0078,
1142 0xa484, 0x001f, 0xa215, 0x2069, 0x7500, 0x2d04, 0x2d08, 0x7162, 1372 0x24fa, 0x781b, 0x008f, 0x0078, 0x24fa, 0x782b, 0x3008, 0x781b,
1143 0x2068, 0xa005, 0x0040, 0x3293, 0x6814, 0xa206, 0x0040, 0x32af, 1373 0x008f, 0x0078, 0x24fa, 0x6818, 0xa084, 0x8000, 0x0040, 0x39c2,
1144 0x6800, 0x0078, 0x3286, 0x7003, 0x0005, 0x2001, 0x7610, 0x2068, 1374 0x681b, 0x001d, 0x706f, 0x0001, 0x781b, 0x0048, 0x0078, 0x24fa,
1145 0x704a, 0x7036, 0x157e, 0x20a9, 0x0031, 0x2003, 0x0000, 0x8000, 1375 0x007e, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x39de, 0x7808, 0xa084,
1146 0x0070, 0x32a4, 0x0078, 0x329d, 0x157f, 0xad80, 0x0009, 0x7036, 1376 0xfffc, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005, 0x78ec, 0xa084,
1147 0x6a16, 0x68b7, 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, 0x6eb4, 1377 0x0021, 0x0040, 0x39de, 0x7044, 0x780a, 0xa005, 0x007f, 0x007c,
1148 0x7e5a, 0x6820, 0xa084, 0x0c00, 0x0040, 0x3309, 0x1078, 0x36c9, 1378 0x7044, 0xa085, 0x0002, 0x7046, 0x780a, 0x007c, 0x007e, 0x7830,
1149 0x0078, 0x3309, 0x7003, 0x0002, 0x7a80, 0xa294, 0x0f00, 0x789b, 1379 0xa084, 0x0040, 0x00c0, 0x39e7, 0x0098, 0x39f2, 0x007f, 0x789a,
1150 0x0018, 0x7ca8, 0xa484, 0x001f, 0xa215, 0x79a8, 0x79a8, 0xa18c, 1380 0x78ac, 0x007c, 0x7808, 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005,
1151 0x00ff, 0xa1e8, 0x7400, 0x2d04, 0x2d08, 0x7162, 0x2068, 0xa005, 1381 0x0005, 0x0005, 0x78ec, 0xa084, 0x0021, 0x0040, 0x3a01, 0x0098,
1152 0x0040, 0x32d9, 0x6814, 0xa206, 0x0040, 0x32f4, 0x6800, 0x0078, 1382 0x39ff, 0x007f, 0x789a, 0x78ac, 0x007e, 0x7044, 0x780a, 0x007f,
1153 0x32cc, 0x7003, 0x0005, 0x2001, 0x7610, 0x2068, 0x704a, 0x157e, 1383 0x007c, 0x78ec, 0xa084, 0x0002, 0x00c0, 0x4871, 0xa784, 0x007d,
1154 0x20a9, 0x0031, 0x2003, 0x0000, 0x8000, 0x0070, 0x32e9, 0x0078, 1384 0x00c0, 0x3a15, 0x2700, 0x1078, 0x248c, 0xa784, 0x0001, 0x00c0,
1155 0x32e2, 0x157f, 0xad80, 0x0009, 0x7036, 0x6a16, 0x68b7, 0x0700, 1385 0x300c, 0xa784, 0x0070, 0x0040, 0x3a25, 0x0c7e, 0x2d60, 0x2f68,
1156 0x6823, 0x0800, 0x6827, 0x0003, 0x6eb4, 0x7e5a, 0x6820, 0xa084, 1386 0x1078, 0x2437, 0x2d78, 0x2c68, 0x0c7f, 0xa784, 0x0008, 0x0040,
1157 0x0c00, 0x0040, 0x3309, 0xa084, 0x0800, 0x0040, 0x3303, 0x1078, 1387 0x3a32, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x2523,
1158 0x36cd, 0x0078, 0x3309, 0x1078, 0x36c9, 0x708b, 0x0000, 0x0078, 1388 0x0078, 0x3956, 0xa784, 0x0004, 0x0040, 0x3a65, 0x78b8, 0xa084,
1159 0x3309, 0x027e, 0x8207, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 1389 0x4001, 0x0040, 0x3a65, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003,
1160 0xa080, 0x5380, 0x2060, 0x7056, 0x6000, 0x705a, 0x6004, 0x705e, 1390 0x0040, 0x2523, 0x78e4, 0xa084, 0x0007, 0xa086, 0x0001, 0x00c0,
1161 0xa684, 0x0060, 0x0040, 0x3361, 0x6b98, 0x6c94, 0x69ac, 0x68b0, 1391 0x3a65, 0x78c0, 0xa085, 0x4800, 0x2030, 0x7e5a, 0x781b, 0x00ca,
1162 0xa105, 0x00c0, 0x3343, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0xa6b4, 1392 0x0078, 0x24fa, 0x784b, 0x0008, 0x6818, 0xa084, 0x8000, 0x0040,
1163 0xb7ff, 0x7e5a, 0xa684, 0x0060, 0xa086, 0x0060, 0x0040, 0x3361, 1393 0x3a61, 0x681b, 0x0015, 0xa684, 0x4000, 0x0040, 0x3a61, 0x681b,
1164 0x68c0, 0xa005, 0x0040, 0x333c, 0x7003, 0x0003, 0x682b, 0x0000, 1394 0x0007, 0x1078, 0x396a, 0x0078, 0x24fa, 0x681b, 0x0003, 0x7858,
1165 0x1078, 0x4a29, 0x0078, 0x333e, 0x1078, 0x4a3a, 0xa6b5, 0x2000, 1395 0xa084, 0x3f00, 0x681e, 0x682f, 0x0000, 0x6833, 0x0000, 0x784b,
1166 0x7e5a, 0x0078, 0x3361, 0x68b0, 0xa31a, 0x2100, 0xa423, 0x2400, 1396 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x2a06, 0x0018, 0x24fa,
1167 0xa305, 0x0040, 0x3361, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0x68b0, 1397 0x0078, 0x3773, 0x6b14, 0x8307, 0xa084, 0x000f, 0x8003, 0x8003,
1168 0xa6b4, 0xbfff, 0x7e5a, 0x007e, 0x68c0, 0xa005, 0x007f, 0x0040, 1398 0x8003, 0xa080, 0x5480, 0x2060, 0x2048, 0x7056, 0x6000, 0x705a,
1169 0x335f, 0x7003, 0x0003, 0x1078, 0x4a29, 0x0078, 0x3361, 0x1078, 1399 0x6004, 0x705e, 0x2a60, 0x007c, 0x0079, 0x3a8e, 0x3a96, 0x3a97,
1170 0x4a85, 0x077f, 0x1078, 0x37ef, 0x2009, 0x0065, 0xa684, 0x0004, 1400 0x3a96, 0x3a99, 0x3a96, 0x3a96, 0x3a96, 0x3a9e, 0x007c, 0x1078,
1171 0x0040, 0x3382, 0x78e4, 0xa084, 0x0030, 0x0040, 0x337a, 0x78ec, 1401 0x34b8, 0x1078, 0x4887, 0x7038, 0x600a, 0x007c, 0x70a0, 0xa005,
1172 0xa084, 0x0003, 0x0040, 0x337a, 0x782b, 0x3008, 0x2009, 0x0065, 1402 0x0040, 0x3aab, 0x2068, 0x1078, 0x1bd3, 0x1078, 0x47fe, 0x1078,
1173 0x0078, 0x3382, 0x0f7e, 0x2079, 0x5100, 0x1078, 0x4776, 0x0f7f, 1403 0x4805, 0x70a3, 0x0000, 0x007c, 0x0e7e, 0x2091, 0x8000, 0x2071,
1174 0x0040, 0x2482, 0x791a, 0x2d00, 0x704a, 0x8207, 0xa084, 0x000f, 1404 0x5240, 0x7000, 0xa086, 0x0007, 0x00c0, 0x3ac2, 0x6110, 0x70bc,
1175 0x8003, 0x8003, 0x8003, 0xa080, 0x5380, 0x2048, 0x0078, 0x2459, 1405 0xa106, 0x00c0, 0x3ac2, 0x0e7f, 0x1078, 0x1be0, 0x1078, 0x3ac8,
1176 0x6020, 0xa005, 0x0040, 0x339c, 0x8001, 0x6022, 0x6008, 0xa085, 1406 0xa006, 0x007c, 0x2091, 0x8001, 0x0e7f, 0xa085, 0x0001, 0x007c,
1177 0x0008, 0x600a, 0x7010, 0x6026, 0x007c, 0xa006, 0x1078, 0x4776, 1407 0x0f7e, 0x0e7e, 0x2071, 0x5240, 0x0078, 0x2297, 0x785b, 0x0000,
1178 0x6817, 0x0000, 0x681b, 0x0001, 0x6823, 0x0040, 0x681f, 0x0100, 1408 0x70af, 0x000e, 0x2009, 0x0100, 0x017e, 0x70a0, 0xa06d, 0x0040,
1179 0x7000, 0xa084, 0x0007, 0x0079, 0x33ad, 0x2482, 0x33b7, 0x33b7, 1409 0x3add, 0x70a3, 0x0000, 0x0078, 0x3ae3, 0x70b3, 0x0000, 0x1078,
1180 0x33d4, 0x33bf, 0x33bd, 0x33bf, 0x33b5, 0x1078, 0x23eb, 0x1078, 1410 0x1c0c, 0x0040, 0x3ae9, 0x70ac, 0x6826, 0x1078, 0x3bc6, 0x0078,
1181 0x33df, 0x1078, 0x33d8, 0x1078, 0x1c70, 0x0078, 0x2482, 0x706c, 1411 0x3add, 0x017f, 0x157e, 0x0c7e, 0x0d7e, 0x20a9, 0x0008, 0x2061,
1182 0x706f, 0x0000, 0x7093, 0x0000, 0x0079, 0x33c6, 0x33d0, 0x33d0, 1412 0x7610, 0x6000, 0xa105, 0x6002, 0x601c, 0xa06d, 0x0040, 0x3b01,
1183 0x33ce, 0x33ce, 0x33ce, 0x33d0, 0x33ce, 0x33d0, 0x0079, 0x2861, 1413 0x6800, 0x601e, 0x1078, 0x19ac, 0x6008, 0x8000, 0x600a, 0x0078,
1184 0x706f, 0x0000, 0x0078, 0x2482, 0x681b, 0x0000, 0x0078, 0x2f17, 1414 0x3af4, 0x6018, 0xa06d, 0x0040, 0x3b0b, 0x6800, 0x601a, 0x1078,
1185 0x6800, 0xa005, 0x00c0, 0x33dd, 0x6002, 0x6006, 0x007c, 0x6010, 1415 0x19ac, 0x0078, 0x3b01, 0xace0, 0x0008, 0x0070, 0x3b11, 0x0078,
1186 0xa005, 0x0040, 0x33e8, 0x8001, 0x00d0, 0x33e8, 0x1078, 0x23eb, 1416 0x3af1, 0x709c, 0xa084, 0x8000, 0x0040, 0x3b18, 0x1078, 0x3c44,
1187 0x6012, 0x6008, 0xa084, 0xffef, 0x600a, 0x007c, 0x6018, 0xa005, 1417 0x0d7f, 0x0c7f, 0x157f, 0x007c, 0x127e, 0x2091, 0x2300, 0x6804,
1188 0x0040, 0x33f4, 0x8001, 0x601a, 0x007c, 0x1078, 0x3912, 0x681b, 1418 0xa084, 0x000f, 0x0079, 0x3b24, 0x3b34, 0x3b34, 0x3b34, 0x3b34,
1189 0x0018, 0x0078, 0x342b, 0x1078, 0x3912, 0x681b, 0x0019, 0x0078, 1419 0x3b34, 0x3b34, 0x3b36, 0x3b3c, 0x3b34, 0x3b34, 0x3b34, 0x3b34,
1190 0x342b, 0x1078, 0x3912, 0x681b, 0x001a, 0x0078, 0x342b, 0x1078, 1420 0x3b34, 0x3b3e, 0x3b34, 0x3b36, 0x1078, 0x248c, 0x1078, 0x45d3,
1191 0x3912, 0x681b, 0x0003, 0x0078, 0x342b, 0x7780, 0x1078, 0x37ef, 1421 0x1078, 0x19ac, 0x0078, 0x3b42, 0x6827, 0x000b, 0x1078, 0x45d3,
1192 0x7184, 0xa18c, 0x00ff, 0xa1e8, 0x7400, 0x2d04, 0x2d08, 0x2068, 1422 0x1078, 0x3bc6, 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x0098,
1193 0xa005, 0x00c0, 0x341d, 0x0078, 0x2482, 0x6814, 0x7280, 0xa206, 1423 0x3b60, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x3b60, 0x0d7e, 0x1078,
1194 0x0040, 0x3425, 0x6800, 0x0078, 0x3416, 0x6800, 0x200a, 0x681b, 1424 0x4812, 0x2d00, 0x682e, 0x2009, 0x0004, 0x2001, 0x0000, 0x6827,
1195 0x0005, 0x708b, 0x0000, 0x1078, 0x33df, 0x6820, 0xa084, 0x0001, 1425 0x0084, 0x1078, 0x47c7, 0x1078, 0x3bc6, 0x0d7f, 0x0078, 0x3b94,
1196 0x00c0, 0x3434, 0x1078, 0x33d8, 0x1078, 0x33ee, 0x681f, 0x0000, 1426 0x7948, 0xa185, 0x4000, 0x784a, 0x0098, 0x3b69, 0x794a, 0x0078,
1197 0x6823, 0x0020, 0x1078, 0x1c70, 0x0078, 0x2482, 0xa282, 0x0003, 1427 0x3b4e, 0x7828, 0xa086, 0x1834, 0x00c0, 0x3b72, 0xa185, 0x0004,
1198 0x00c0, 0x369d, 0x7da8, 0xa5ac, 0x00ff, 0x7ca8, 0xa4a4, 0x00ff, 1428 0x0078, 0x3b79, 0x7828, 0xa086, 0x1814, 0x00c0, 0x3b66, 0xa185,
1199 0x6920, 0xa18d, 0x0080, 0x6922, 0xa184, 0x0100, 0x0040, 0x34a2, 1429 0x000c, 0x784a, 0x789b, 0x000e, 0x78ab, 0x0002, 0x7858, 0xa084,
1200 0xa18c, 0xfeff, 0x6922, 0xa4a4, 0x00ff, 0x0040, 0x348c, 0xa482, 1430 0x00ff, 0xa085, 0x0400, 0x785a, 0x70b4, 0xa080, 0x0091, 0x781a,
1201 0x000c, 0x0048, 0x345f, 0x0040, 0x345f, 0x2021, 0x000c, 0x852b, 1431 0x6827, 0x0284, 0x682c, 0x6836, 0x6830, 0x683a, 0x2009, 0x0004,
1202 0x852b, 0x1078, 0x3760, 0x0040, 0x3469, 0x1078, 0x355b, 0x0078, 1432 0x2001, 0x0000, 0x1078, 0x47c7, 0x127f, 0x007c, 0x0d7e, 0x6b14,
1203 0x3495, 0x1078, 0x371b, 0x0c7e, 0x2960, 0x6004, 0xa084, 0xfff5, 1433 0x1078, 0x1c70, 0x0040, 0x3ba3, 0x2068, 0x6827, 0x0002, 0x1078,
1204 0x6006, 0x1078, 0x3586, 0x0c7f, 0x6920, 0xa18d, 0x0100, 0x6922, 1434 0x3bc6, 0x0078, 0x3b98, 0x0d7f, 0x007c, 0x0d7e, 0x6b14, 0x6c28,
1205 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x3486, 1435 0xa4a4, 0x00ff, 0x1078, 0x1c1c, 0x0040, 0x3bb3, 0x2068, 0x6827,
1206 0x782b, 0x3008, 0x781b, 0x0056, 0x0078, 0x2459, 0x782b, 0x3008, 1436 0x0002, 0x1078, 0x3bc6, 0x0d7f, 0x007c, 0x0d7e, 0x6b14, 0xa39c,
1207 0x781b, 0x0065, 0x0078, 0x2459, 0x0c7e, 0x2960, 0x6004, 0xa084, 1437 0x00ff, 0x1078, 0x1c48, 0x0040, 0x3bc4, 0x2068, 0x6827, 0x0002,
1208 0xfff5, 0x6006, 0x1078, 0x3586, 0x0c7f, 0x7e58, 0xa684, 0x0400, 1438 0x1078, 0x3bc6, 0x0078, 0x3bb9, 0x0d7f, 0x007c, 0x0c7e, 0x6914,
1209 0x00c0, 0x349e, 0x781b, 0x0058, 0x0078, 0x2459, 0x781b, 0x0065, 1439 0x1078, 0x3c3b, 0x6904, 0xa18c, 0x00ff, 0xa186, 0x0006, 0x0040,
1210 0x0078, 0x2459, 0x0c7e, 0x7054, 0x2060, 0x6100, 0xa18c, 0x1000, 1440 0x3be1, 0xa186, 0x000d, 0x0040, 0x3c00, 0xa186, 0x0017, 0x00c0,
1211 0x0040, 0x34e2, 0x6208, 0x8217, 0xa294, 0x00ff, 0xa282, 0x000c, 1441 0x3bdd, 0x1078, 0x19ac, 0x0078, 0x3bdf, 0x1078, 0x1cde, 0x0c7f,
1212 0x0048, 0x34b6, 0x0040, 0x34b6, 0x2011, 0x000c, 0x2400, 0xa202, 1442 0x007c, 0x6004, 0x8001, 0x0048, 0x3bfe, 0x6006, 0x2009, 0x0000,
1213 0x00c8, 0x34bb, 0x2220, 0x6208, 0xa294, 0x00ff, 0x7018, 0xa086, 1443 0xa684, 0x0001, 0x00c0, 0x3bee, 0xa18d, 0x8000, 0xa684, 0x0004,
1214 0x0028, 0x00c0, 0x34cb, 0xa282, 0x0019, 0x00c8, 0x34d1, 0x2011, 1444 0x0040, 0x3bf4, 0xa18d, 0x0002, 0x691e, 0x6823, 0x0000, 0x7104,
1215 0x0019, 0x0078, 0x34d1, 0xa282, 0x000c, 0x00c8, 0x34d1, 0x2011, 1445 0x810f, 0x6818, 0xa105, 0x681a, 0x0078, 0x3bdd, 0x1078, 0x248c,
1216 0x000c, 0x2200, 0xa502, 0x00c8, 0x34d6, 0x2228, 0x1078, 0x371f, 1446 0x6018, 0xa005, 0x00c0, 0x3c0f, 0x6008, 0x8001, 0x0048, 0x3c0f,
1217 0x852b, 0x852b, 0x1078, 0x3760, 0x0040, 0x34e2, 0x1078, 0x355b, 1447 0x600a, 0x601c, 0x6802, 0x2d00, 0x601e, 0x0078, 0x3c25, 0xac88,
1218 0x0078, 0x34e6, 0x1078, 0x371b, 0x1078, 0x3586, 0x7858, 0xa085, 1448 0x0006, 0x2104, 0xa005, 0x0040, 0x3c18, 0x2008, 0x0078, 0x3c11,
1219 0x0004, 0x785a, 0x0c7f, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 1449 0x6802, 0x2d0a, 0x6008, 0x8001, 0x0048, 0x3bdf, 0x600a, 0x6018,
1220 0x2459, 0x0c7e, 0x2960, 0x6000, 0xa084, 0x1000, 0x00c0, 0x3509, 1450 0x2068, 0x6800, 0x601a, 0x0078, 0x3c09, 0x157e, 0x137e, 0x147e,
1221 0x6010, 0xa084, 0x000f, 0x00c0, 0x3503, 0x6104, 0xa18c, 0xfff5, 1451 0x0c7e, 0x0d7e, 0x1078, 0x1989, 0x00c0, 0x3c30, 0x1078, 0x248c,
1222 0x6106, 0x0c7f, 0x007c, 0x2011, 0x0032, 0x2019, 0x0000, 0x0078, 1452 0x2da0, 0x137f, 0x20a9, 0x0031, 0x53a3, 0x0c7f, 0x147f, 0x137f,
1223 0x3530, 0x68a0, 0xa084, 0x0200, 0x00c0, 0x3503, 0x6208, 0xa294, 1453 0x157f, 0x0078, 0x3bdd, 0xa184, 0x001f, 0x8003, 0x8003, 0x8003,
1224 0x00ff, 0x7018, 0xa086, 0x0028, 0x00c0, 0x351e, 0xa282, 0x0019, 1454 0xa080, 0x7610, 0x2060, 0x007c, 0x2019, 0x5251, 0x2304, 0xa085,
1225 0x00c8, 0x3524, 0x2011, 0x0019, 0x0078, 0x3524, 0xa282, 0x000c, 1455 0x0001, 0x201a, 0x2019, 0x0102, 0x2304, 0xa085, 0x0001, 0x201a,
1226 0x00c8, 0x3524, 0x2011, 0x000c, 0x6308, 0x831f, 0xa39c, 0x00ff, 1456 0x007c, 0x2019, 0x5251, 0x2304, 0xa084, 0xfffe, 0x201a, 0x2019,
1227 0xa382, 0x000c, 0x0048, 0x3530, 0x0040, 0x3530, 0x2019, 0x000c, 1457 0x0102, 0x2304, 0xa084, 0xfffe, 0x201a, 0x007c, 0x7990, 0xa18c,
1228 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 1458 0xfff8, 0x7992, 0x70b4, 0xa080, 0x00d8, 0x781a, 0x0078, 0x24fa,
1229 0xa8c0, 0x0005, 0x6820, 0xa085, 0x0100, 0x6822, 0x0c7f, 0x007c, 1459 0x70a3, 0x0000, 0x7003, 0x0000, 0x7043, 0x0001, 0x7037, 0x0000,
1230 0x0c7e, 0x2960, 0xa18c, 0xfff5, 0x6106, 0x2011, 0x0032, 0x2019, 1460 0x0018, 0x24b1, 0x1078, 0x1c0c, 0x0040, 0x3c99, 0x2009, 0x520f,
1231 0x0000, 0x0078, 0x354b, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 1461 0x200b, 0x0000, 0x68bc, 0x2060, 0x6100, 0xa184, 0x0300, 0x0040,
1232 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005, 0x6820, 0xa085, 0x0100, 1462 0x3c8d, 0x6827, 0x000e, 0xa084, 0x0200, 0x0040, 0x3c89, 0x6827,
1233 0x6822, 0x0c7f, 0x007c, 0x0c7e, 0x7154, 0x2160, 0x1078, 0x3562, 1463 0x0017, 0x1078, 0x3bc6, 0x0078, 0x3c68, 0x7000, 0xa086, 0x0007,
1234 0x0c7f, 0x007c, 0x2008, 0xa084, 0xfff0, 0xa425, 0x7c86, 0x6018, 1464 0x00c0, 0x3d0d, 0x2d00, 0x70a2, 0xad80, 0x000f, 0x7036, 0x0078,
1235 0x789a, 0x7cae, 0x6412, 0x78a4, 0xa084, 0xfff8, 0xa18c, 0x0007, 1465 0x3ca0, 0x7040, 0xa086, 0x0001, 0x0040, 0x2533, 0x0078, 0x24fa,
1236 0xa105, 0x78a6, 0x6016, 0x788a, 0xa4a4, 0x000f, 0x8427, 0x8204, 1466 0x2031, 0x0000, 0x691c, 0xa184, 0x0002, 0x0040, 0x3ca9, 0xa6b5,
1237 0x8004, 0xa084, 0x00ff, 0xa405, 0x600e, 0x78ec, 0xd08c, 0x00c0, 1467 0x0004, 0xa184, 0x00c0, 0x8003, 0x8003, 0x8007, 0xa080, 0x3da6,
1238 0x3585, 0x6004, 0xa084, 0xfff5, 0x6006, 0x007c, 0x0c7e, 0x7054, 1468 0x2004, 0xa635, 0x6820, 0xa084, 0x0400, 0x0040, 0x3cc1, 0x789b,
1239 0x2060, 0x1078, 0x358d, 0x0c7f, 0x007c, 0x6018, 0x789a, 0x78a4, 1469 0x0018, 0x78ab, 0x0003, 0x789b, 0x0081, 0x78ab, 0x0001, 0xa6b5,
1240 0xa084, 0xfff0, 0x78a6, 0x6012, 0x7884, 0xa084, 0xfff0, 0x7886, 1470 0x5000, 0x6820, 0xa084, 0x8000, 0x0040, 0x3ccf, 0xa6b5, 0x0400,
1241 0x007c, 0xa282, 0x0002, 0x00c0, 0x369d, 0x7aa8, 0x6920, 0xa18d, 1471 0x789b, 0x000e, 0x6824, 0x8007, 0x78aa, 0x0078, 0x3cef, 0x681c,
1242 0x0080, 0x6922, 0xa184, 0x0200, 0x0040, 0x35e2, 0xa18c, 0xfdff, 1472 0xd0fc, 0x00c0, 0x3cdd, 0xa6b5, 0x0800, 0x6820, 0xd0c4, 0x0040,
1243 0x6922, 0xa294, 0x00ff, 0xa282, 0x0002, 0x00c8, 0x369d, 0x1078, 1473 0x3cef, 0xa6b5, 0x4000, 0x0078, 0x3cef, 0x6820, 0xd0c4, 0x0040,
1244 0x362b, 0x1078, 0x3586, 0xa980, 0x0001, 0x200c, 0x1078, 0x37eb, 1474 0x3ce5, 0xa6b5, 0x4000, 0x0078, 0x3cef, 0x789b, 0x0018, 0x78ab,
1245 0x1078, 0x34f1, 0x88ff, 0x0040, 0x35d5, 0x789b, 0x0060, 0x2800, 1475 0x0002, 0x789b, 0x0081, 0x78ab, 0x0001, 0xa6b5, 0x1000, 0xa684,
1246 0x78aa, 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 1476 0x0200, 0x0040, 0x3d09, 0x682c, 0x78d2, 0x6830, 0x78d6, 0xa684,
1247 0x35cf, 0x782b, 0x3008, 0x781b, 0x0056, 0x0078, 0x2459, 0x782b, 1477 0x0100, 0x0040, 0x3d07, 0x682c, 0xa084, 0x0001, 0x0040, 0x3d07,
1248 0x3008, 0x781b, 0x0065, 0x0078, 0x2459, 0x7e58, 0xa684, 0x0400, 1478 0x7888, 0xa084, 0x0040, 0x0040, 0x3d07, 0xa6b5, 0x8000, 0x1078,
1249 0x00c0, 0x35de, 0x781b, 0x0058, 0x0078, 0x2459, 0x781b, 0x0065, 1479 0x47f6, 0x7e5a, 0x6eb6, 0x0078, 0x4835, 0x1078, 0x39c8, 0x00c0,
1250 0x0078, 0x2459, 0xa282, 0x0002, 0x00c8, 0x35ea, 0xa284, 0x0001, 1480 0x3da0, 0x702c, 0x8004, 0x0048, 0x3d1b, 0x2019, 0x4f49, 0x1078,
1251 0x0040, 0x35f4, 0x7154, 0xa188, 0x0000, 0x210c, 0xa18c, 0x2000, 1481 0x2313, 0x702f, 0x0001, 0x2041, 0x0001, 0x2031, 0x1000, 0x789b,
1252 0x00c0, 0x35f4, 0x2011, 0x0000, 0x1078, 0x370d, 0x1078, 0x362b, 1482 0x0018, 0x6814, 0xa084, 0x001f, 0xa085, 0x0080, 0x78aa, 0x691c,
1253 0x1078, 0x3586, 0x7858, 0xa085, 0x0004, 0x785a, 0x782b, 0x3008, 1483 0xa184, 0x0002, 0x0040, 0x3d34, 0xa6b5, 0x0004, 0x78ab, 0x0020,
1254 0x781b, 0x0065, 0x0078, 0x2459, 0x0c7e, 0x027e, 0x2960, 0x6000, 1484 0x6828, 0x78aa, 0xa8c0, 0x0002, 0x681c, 0xd0f4, 0x0040, 0x3d3d,
1255 0x2011, 0x0001, 0xa084, 0x2000, 0x00c0, 0x361b, 0x6014, 0xa084, 1485 0x2c50, 0x1078, 0x3a7a, 0x1078, 0x4702, 0x6820, 0xa084, 0x8000,
1256 0x0040, 0x00c0, 0x3619, 0xa18c, 0xffef, 0x6106, 0xa006, 0x0078, 1486 0x0040, 0x3d4b, 0xa6b5, 0x0400, 0x789b, 0x000e, 0x6824, 0x8007,
1257 0x3628, 0x2011, 0x0000, 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, 1487 0x78aa, 0x0078, 0x3d52, 0x681c, 0xa084, 0x8000, 0x00c0, 0x3d52,
1258 0x0003, 0x7aaa, 0xa8c0, 0x0004, 0x6820, 0xa085, 0x0200, 0x6822, 1488 0xa6b5, 0x0800, 0x6820, 0xa084, 0x0100, 0x0040, 0x3d59, 0xa6b5,
1259 0x027f, 0x0c7f, 0x007c, 0x0c7e, 0x7054, 0x2060, 0x1078, 0x3632, 1489 0x4000, 0x681c, 0xa084, 0x00c0, 0x8003, 0x8003, 0x8007, 0xa080,
1260 0x0c7f, 0x007c, 0x82ff, 0x0040, 0x3637, 0x2011, 0x0040, 0x6018, 1490 0x3da6, 0x2004, 0xa635, 0xa684, 0x0100, 0x0040, 0x3d73, 0x682c,
1261 0xa080, 0x0002, 0x789a, 0x78a4, 0xa084, 0xffbf, 0xa205, 0x78a6, 1491 0xa084, 0x0001, 0x0040, 0x3d73, 0x7888, 0xa084, 0x0040, 0x0040,
1262 0x788a, 0x6016, 0x78ec, 0xd08c, 0x00c0, 0x364a, 0x6004, 0xa084, 1492 0x3d73, 0xa6b5, 0x8000, 0x789b, 0x007e, 0x7eae, 0x6eb6, 0x6814,
1263 0xffef, 0x6006, 0x007c, 0x007e, 0x7000, 0xa086, 0x0003, 0x0040, 1493 0x8007, 0x78aa, 0x7882, 0x2810, 0x7aaa, 0x7830, 0xa084, 0x00c0,
1264 0x3654, 0x007f, 0x0078, 0x3657, 0x007f, 0x0078, 0x3699, 0xa684, 1494 0x00c0, 0x3da0, 0x0018, 0x3da0, 0x70b4, 0xa080, 0x00dd, 0x781a,
1265 0x0020, 0x0040, 0x3699, 0x7888, 0xa084, 0x0040, 0x0040, 0x3699, 1495 0x1078, 0x39e0, 0xa684, 0x0200, 0x0040, 0x3d94, 0x682c, 0x78d2,
1266 0x7bb8, 0xa384, 0x003f, 0x831b, 0x00c8, 0x3667, 0x8000, 0xa005, 1496 0x6830, 0x78d6, 0x1078, 0x47f6, 0x2d00, 0x70a2, 0x704a, 0x6810,
1267 0x0040, 0x367d, 0x831b, 0x00c8, 0x3670, 0x8001, 0x0040, 0x3695, 1497 0x70be, 0x7003, 0x0007, 0xad80, 0x000f, 0x7036, 0x0078, 0x24fa,
1268 0xa684, 0x4000, 0x0040, 0x367d, 0x78b8, 0x801b, 0x00c8, 0x3679, 1498 0x1078, 0x1bd3, 0x1078, 0x39e0, 0x0078, 0x24fa, 0x0000, 0x0300,
1269 0x8000, 0xa084, 0x003f, 0x00c0, 0x3695, 0xa6b4, 0xbfff, 0x7e5a, 1499 0x0200, 0x0000, 0x1078, 0x248c, 0x2300, 0x0079, 0x3daf, 0x3db2,
1270 0x79d8, 0x7adc, 0x2001, 0x0001, 0xa108, 0x00c8, 0x3689, 0xa291, 1500 0x3db2, 0x3db4, 0x1078, 0x248c, 0x1078, 0x4805, 0x6924, 0xa184,
1271 0x0000, 0x79d2, 0x79da, 0x7ad6, 0x7ade, 0x1078, 0x4b30, 0x781b, 1501 0x00ff, 0xa086, 0x000a, 0x0040, 0x3dc6, 0xa184, 0xff00, 0xa085,
1272 0x0064, 0x1078, 0x49b5, 0x0078, 0x2459, 0x781b, 0x0064, 0x0078, 1502 0x000a, 0x6826, 0x1078, 0x1bd3, 0x0078, 0x3c68, 0x2001, 0x000a,
1273 0x2459, 0x781b, 0x0065, 0x0078, 0x2459, 0x1078, 0x36d5, 0x782b, 1503 0x1078, 0x4797, 0x0078, 0x3c68, 0xa282, 0x0005, 0x0050, 0x3dd2,
1274 0x3008, 0x781b, 0x0065, 0x0078, 0x2459, 0x1078, 0x36c1, 0x782b, 1504 0x1078, 0x248c, 0x7000, 0xa084, 0x0007, 0x10c0, 0x3a8c, 0x1078,
1275 0x3008, 0x781b, 0x0065, 0x0078, 0x2459, 0x6827, 0x0002, 0x1078, 1505 0x1989, 0x00c0, 0x3df4, 0x2069, 0xffff, 0xa684, 0x0004, 0x0040,
1276 0x36c9, 0x78e4, 0xa084, 0x0030, 0x0040, 0x2482, 0x78ec, 0xa084, 1506 0x3de5, 0x2001, 0x2800, 0x0078, 0x3de7, 0x2001, 0x0800, 0x71b4,
1277 0x0003, 0x0040, 0x2482, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 1507 0xa188, 0x0091, 0x789b, 0x000e, 0x8007, 0x78aa, 0x2031, 0x0400,
1278 0x2459, 0x2001, 0x0005, 0x0078, 0x36d7, 0x2001, 0x000c, 0x0078, 1508 0x7e5a, 0x791a, 0x0078, 0x24fa, 0x6807, 0x0106, 0x680b, 0x0000,
1279 0x36d7, 0x2001, 0x0006, 0x0078, 0x36d7, 0x2001, 0x000d, 0x0078, 1509 0x689f, 0x0000, 0x6827, 0x0000, 0xa386, 0x0002, 0x00c0, 0x3e15,
1280 0x36d7, 0x2001, 0x0009, 0x0078, 0x36d7, 0x2001, 0x0007, 0x789b, 1510 0xa286, 0x0002, 0x00c0, 0x3e15, 0x78a0, 0xa005, 0x00c0, 0x3e15,
1281 0x0010, 0x78aa, 0x789b, 0x0060, 0x78ab, 0x0001, 0xa6b5, 0x0004, 1511 0xa484, 0x8000, 0x00c0, 0x3e15, 0x78e4, 0xa084, 0x0008, 0x0040,
1282 0x7e5a, 0x007c, 0x077e, 0x873f, 0xa7bc, 0x000f, 0x873b, 0x873b, 1512 0x3e15, 0xa6b5, 0x0008, 0x2019, 0x0000, 0x1078, 0x4217, 0x2d00,
1283 0x8703, 0xa0e0, 0x5380, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, 0xa184, 1513 0x70a2, 0x704a, 0x7003, 0x0007, 0x7037, 0x0000, 0x6824, 0xa084,
1284 0x000f, 0x0040, 0x36fb, 0xa184, 0xfff0, 0x78a6, 0x6012, 0x6004, 1514 0x0080, 0x0040, 0x3e27, 0x1078, 0x42cd, 0x0078, 0x24fa, 0x2300,
1285 0xa085, 0x0008, 0x6006, 0x8738, 0x8738, 0x7f9a, 0x79a4, 0xa184, 1515 0x0079, 0x3e2a, 0x3e2d, 0x3eae, 0x3ec7, 0x2200, 0x0079, 0x3e30,
1286 0x0040, 0x0040, 0x370b, 0xa184, 0xffbf, 0x78a6, 0x6016, 0x6004, 1516 0x3e35, 0x3e45, 0x3e6b, 0x3e77, 0x3e9a, 0x2029, 0x0001, 0xa026,
1287 0xa085, 0x0010, 0x6006, 0x077f, 0x007c, 0x789b, 0x0010, 0x78ab, 1517 0x2011, 0x0000, 0x1078, 0x43f3, 0x0079, 0x3e3e, 0x3e43, 0x24fa,
1288 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0060, 1518 0x3c68, 0x3e43, 0x3e43, 0x1078, 0x248c, 0x7990, 0xa18c, 0x0007,
1289 0x78ab, 0x0004, 0x007c, 0x2021, 0x0000, 0x2029, 0x0032, 0x789b, 1519 0x00c0, 0x3e4c, 0x2009, 0x0008, 0x2011, 0x0001, 0xa684, 0x0004,
1290 0x0010, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa, 1520 0x0040, 0x3e54, 0x2011, 0x0003, 0x2220, 0xa12a, 0x2011, 0x0001,
1291 0x7caa, 0x789b, 0x0060, 0x78ab, 0x0005, 0x007c, 0x157e, 0x8007, 1521 0x1078, 0x43f3, 0x0079, 0x3e5c, 0x3e61, 0x24fa, 0x3c68, 0x3e69,
1292 0xa084, 0x00ff, 0x8003, 0x8003, 0xa080, 0x0020, 0x789a, 0x79a4, 1522 0x3e63, 0x0078, 0x483b, 0x70ab, 0x3e67, 0x0078, 0x24fa, 0x0078,
1293 0xa18c, 0xfff0, 0x2001, 0x5146, 0x2004, 0xa082, 0x0028, 0x0040, 1523 0x3e61, 0x1078, 0x248c, 0xa684, 0x0010, 0x0040, 0x3e75, 0x1078,
1294 0x3749, 0x2021, 0x37d2, 0x2019, 0x0014, 0x20a9, 0x000c, 0x0078, 1524 0x429c, 0x0040, 0x3e75, 0x0078, 0x24fa, 0x0078, 0x430d, 0x6000,
1295 0x374f, 0x2021, 0x37de, 0x2019, 0x0019, 0x20a9, 0x000d, 0x2011, 1525 0xa084, 0x0002, 0x0040, 0x3e94, 0x70b4, 0xa080, 0x00cd, 0x781a,
1296 0x0064, 0x2404, 0xa084, 0xfff0, 0xa106, 0x0040, 0x375e, 0x8420, 1526 0x0d7e, 0x1078, 0x4812, 0x2d00, 0x682e, 0x6827, 0x0000, 0x1078,
1297 0x2300, 0xa210, 0x0070, 0x375e, 0x0078, 0x3751, 0x157f, 0x007c, 1527 0x3bc6, 0x0d7f, 0x1078, 0x19ac, 0x7003, 0x0000, 0x7037, 0x0000,
1298 0x157e, 0x2009, 0x5146, 0x210c, 0xa182, 0x0032, 0x0048, 0x3774, 1528 0x704b, 0x0000, 0x0078, 0x3c68, 0xa684, 0x0004, 0x00c0, 0x3e9a,
1299 0x0040, 0x3778, 0x2009, 0x37c4, 0x2019, 0x0011, 0x20a9, 0x000e, 1529 0x0078, 0x483b, 0x6000, 0xa084, 0x0004, 0x00c0, 0x3eac, 0x6000,
1300 0x2011, 0x0032, 0x0078, 0x378a, 0xa182, 0x0028, 0x0040, 0x3782, 1530 0xa084, 0x0001, 0x0040, 0x3eac, 0x70ab, 0x3eac, 0x2001, 0x0007,
1301 0x2009, 0x37d2, 0x2019, 0x0014, 0x20a9, 0x000c, 0x2011, 0x0064, 1531 0x1078, 0x478f, 0x0078, 0x4841, 0x0078, 0x483b, 0x2200, 0x0079,
1302 0x0078, 0x378a, 0x2009, 0x37de, 0x2019, 0x0019, 0x20a9, 0x000d, 1532 0x3eb1, 0x3eb6, 0x3eb8, 0x3eb6, 0x3eb6, 0x3eb6, 0x1078, 0x248c,
1303 0x2011, 0x0064, 0x2200, 0xa502, 0x0040, 0x379a, 0x0048, 0x379a, 1533 0x70a7, 0x3ebc, 0x0078, 0x4847, 0x78e4, 0xa084, 0x0008, 0x00c0,
1304 0x8108, 0x2300, 0xa210, 0x0070, 0x3797, 0x0078, 0x378a, 0x157f, 1534 0x3eb8, 0x1078, 0x4781, 0x70ab, 0x3ec5, 0x0078, 0x483b, 0x2200,
1305 0xa006, 0x007c, 0x157f, 0xa582, 0x0064, 0x00c8, 0x37a9, 0x7808, 1535 0x0079, 0x3eca, 0x3ecf, 0x3ed1, 0x3ed1, 0x3ecf, 0x3ecf, 0x1078,
1306 0xa085, 0x0070, 0x780a, 0x7044, 0xa085, 0x0070, 0x7046, 0x0078, 1536 0x248c, 0x78e4, 0xa084, 0x0008, 0x0040, 0x3ee6, 0x70a7, 0x3eda,
1307 0x37a9, 0x78ec, 0xa084, 0x0300, 0x0040, 0x37b1, 0x2104, 0x0078, 1537 0x0078, 0x4847, 0x2011, 0x0004, 0x1078, 0x43ed, 0x0079, 0x3ee0,
1308 0x37c2, 0x2104, 0xa09e, 0x1102, 0x00c0, 0x37c2, 0x2001, 0x04fd, 1538 0x3ee6, 0x24fa, 0x3c68, 0x3ee6, 0x3ef0, 0x3ef4, 0x70ab, 0x3eee,
1309 0x2004, 0xa082, 0x0005, 0x0048, 0x37c1, 0x2001, 0x1201, 0x0078, 1539 0x2001, 0x0003, 0x1078, 0x478f, 0x0078, 0x4841, 0x0078, 0x483b,
1310 0x37c2, 0x2104, 0xa005, 0x007c, 0x1102, 0x3002, 0x3202, 0x4203, 1540 0x70ab, 0x3ee6, 0x0078, 0x24fa, 0x70ab, 0x3ef8, 0x0078, 0x24fa,
1311 0x4403, 0x5404, 0x5604, 0x6605, 0x6805, 0x7806, 0x7a06, 0x0c07, 1541 0x0078, 0x3eee, 0xa282, 0x0003, 0x0050, 0x3f00, 0x1078, 0x248c,
1312 0x0c07, 0x0e07, 0x3202, 0x4202, 0x5202, 0x6202, 0x7202, 0x6605, 1542 0xa386, 0x0002, 0x00c0, 0x3f19, 0xa286, 0x0002, 0x00c0, 0x3f1f,
1313 0x7605, 0x7805, 0x7a05, 0x7c05, 0x7e05, 0x7f05, 0x2202, 0x3202, 1543 0x78a0, 0xa005, 0x00c0, 0x3f1f, 0xa484, 0x8000, 0x00c0, 0x3f1f,
1314 0x4202, 0x5202, 0x5404, 0x6404, 0x7404, 0x7604, 0x7804, 0x7a04, 1544 0x78e4, 0xa084, 0x0008, 0x0040, 0x3f19, 0xa6b5, 0x0008, 0x2019,
1315 0x7c04, 0x7e04, 0x7f04, 0x789b, 0x0010, 0xa046, 0x007c, 0xa784, 1545 0x0000, 0xa684, 0x0008, 0x0040, 0x3f1f, 0x1078, 0x4279, 0x6810,
1316 0x0f00, 0x800b, 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, 0x8003, 1546 0x70be, 0x7003, 0x0007, 0x2300, 0x0079, 0x3f26, 0x3f29, 0x3f56,
1317 0xa105, 0xa0e0, 0x5400, 0x007c, 0x79d8, 0x7adc, 0x78d0, 0x801b, 1547 0x3f5e, 0x2200, 0x0079, 0x3f2c, 0x3f31, 0x3f2f, 0x3f4a, 0x1078,
1318 0x00c8, 0x3803, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 1548 0x248c, 0x7990, 0xa1ac, 0x0007, 0xa026, 0x2011, 0x0001, 0x1078,
1319 0x007c, 0x0f7e, 0x2079, 0x0100, 0x2009, 0x5140, 0x2091, 0x8000, 1549 0x43f3, 0x0079, 0x3f3b, 0x3f40, 0x24fa, 0x3c68, 0x3f48, 0x3f42,
1320 0x2104, 0x0079, 0x3813, 0x3849, 0x381d, 0x381d, 0x381d, 0x381d, 1550 0x0078, 0x483b, 0x70ab, 0x3f46, 0x0078, 0x24fa, 0x0078, 0x3f40,
1321 0x381d, 0x381d, 0x384d, 0x1078, 0x23eb, 0x784b, 0x0004, 0x7848, 1551 0x1078, 0x248c, 0xa684, 0x0010, 0x0040, 0x3f54, 0x1078, 0x429c,
1322 0xa084, 0x0004, 0x00c0, 0x381f, 0x784b, 0x0008, 0x7848, 0xa084, 1552 0x0040, 0x3f54, 0x0078, 0x24fa, 0x0078, 0x430d, 0x2200, 0x0079,
1323 0x0008, 0x00c0, 0x3826, 0x68b4, 0xa085, 0x4000, 0x68b6, 0x7858, 1553 0x3f59, 0x3f5c, 0x3f5c, 0x3f5c, 0x1078, 0x248c, 0x2200, 0x0079,
1324 0xa085, 0x4000, 0x785a, 0x7830, 0xa084, 0x0080, 0x00c0, 0x3849, 1554 0x3f61, 0x3f64, 0x3f66, 0x3f66, 0x1078, 0x248c, 0x78e4, 0xa084,
1325 0x0018, 0x3849, 0x681c, 0xa084, 0x0020, 0x00c0, 0x3847, 0x0e7e, 1555 0x0008, 0x0040, 0x3f7b, 0x70a7, 0x3f6f, 0x0078, 0x4847, 0x2011,
1326 0x2071, 0x5140, 0x1078, 0x389c, 0x0e7f, 0x0078, 0x3849, 0x781b, 1556 0x0004, 0x1078, 0x43ed, 0x0079, 0x3f75, 0x3f7b, 0x24fa, 0x3c68,
1327 0x00cd, 0x2091, 0x8001, 0x0f7f, 0x007c, 0x70b3, 0x0000, 0x1078, 1557 0x3f7b, 0x3f85, 0x3f89, 0x70ab, 0x3f83, 0x2001, 0x0003, 0x1078,
1328 0x3a76, 0x0078, 0x3849, 0x0c7e, 0x6814, 0x8007, 0xa084, 0x000f, 1558 0x478f, 0x0078, 0x4841, 0x0078, 0x483b, 0x70ab, 0x3f7b, 0x0078,
1329 0x8003, 0x8003, 0x8003, 0xa0e0, 0x5380, 0x6004, 0xa084, 0x000a, 1559 0x24fa, 0x70ab, 0x3f8d, 0x0078, 0x24fa, 0x0078, 0x3f83, 0x2300,
1330 0x00c0, 0x3886, 0x6108, 0xa194, 0xff00, 0x0040, 0x3886, 0xa18c, 1560 0x0079, 0x3f92, 0x3f97, 0x3f99, 0x3f95, 0x1078, 0x248c, 0x70a4,
1331 0x00ff, 0x2001, 0x0019, 0xa106, 0x0040, 0x3875, 0x2001, 0x0032, 1561 0x007a, 0x70a4, 0x007a, 0xa282, 0x0002, 0x0050, 0x3fa1, 0x1078,
1332 0xa106, 0x0040, 0x3879, 0x0078, 0x387d, 0x2009, 0x0020, 0x0078, 1562 0x248c, 0xa684, 0x0200, 0x0040, 0x3fab, 0x1078, 0x47fe, 0x1078,
1333 0x387f, 0x2009, 0x003f, 0x0078, 0x387f, 0x2011, 0x0000, 0x2100, 1563 0x43d5, 0x1078, 0x4805, 0x2300, 0x0079, 0x3fae, 0x3fb1, 0x3fd9,
1334 0xa205, 0x600a, 0x6004, 0xa085, 0x0002, 0x6006, 0x0c7f, 0x007c, 1564 0x403f, 0xad86, 0xffff, 0x0040, 0x3c68, 0xa286, 0x0001, 0x0040,
1335 0x781b, 0x0065, 0x0078, 0x2459, 0x782b, 0x3008, 0x781b, 0x0065, 1565 0x3fbb, 0x1078, 0x248c, 0xa684, 0x0200, 0x0040, 0x3fc3, 0x1078,
1336 0x0078, 0x2459, 0x781b, 0x0058, 0x0078, 0x2459, 0x782b, 0x3008, 1566 0x47fe, 0x1078, 0x4805, 0x2001, 0x0001, 0x1078, 0x4797, 0x78b8,
1337 0x781b, 0x0056, 0x0078, 0x2459, 0x2009, 0x5120, 0x210c, 0xa186, 1567 0xa084, 0xc001, 0x0040, 0x3fd5, 0x7848, 0xa085, 0x0008, 0x784a,
1338 0x0000, 0x0040, 0x38b0, 0xa186, 0x0001, 0x0040, 0x38b3, 0x2009, 1568 0x7848, 0xa084, 0x0008, 0x00c0, 0x3fd0, 0x7003, 0x0000, 0x0078,
1339 0x5138, 0x200b, 0x000b, 0x706f, 0x0001, 0x781b, 0x0048, 0x007c, 1569 0x3c68, 0x2200, 0x0079, 0x3fdc, 0x3fde, 0x400f, 0x70a7, 0x3fe2,
1340 0x781b, 0x00c7, 0x007c, 0x2009, 0x5138, 0x200b, 0x000a, 0x007c, 1570 0x0078, 0x4847, 0x2011, 0x000d, 0x1078, 0x43ed, 0x0079, 0x3fe8,
1341 0x2009, 0x5120, 0x210c, 0xa186, 0x0000, 0x0040, 0x38d3, 0xa186, 1571 0x3fef, 0x24fa, 0x3c68, 0x3ff7, 0x3fff, 0x4005, 0x4007, 0xa6b4,
1342 0x0001, 0x0040, 0x38cd, 0x2009, 0x5138, 0x200b, 0x000b, 0x706f, 1572 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a, 0x0078, 0x4835, 0xa6b4,
1343 0x0001, 0x781b, 0x0048, 0x0078, 0x2459, 0x2009, 0x5138, 0x200b, 1573 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a, 0x0078, 0x4835, 0x70ab,
1344 0x000a, 0x0078, 0x2459, 0x782b, 0x3008, 0x781b, 0x00c7, 0x0078, 1574 0x4003, 0x0078, 0x24fa, 0x0078, 0x3fef, 0x1078, 0x248c, 0x70ab,
1345 0x2459, 0x781b, 0x00cd, 0x0078, 0x2459, 0x782b, 0x3008, 0x781b, 1575 0x400b, 0x0078, 0x24fa, 0x1078, 0x484d, 0x0078, 0x24fa, 0x70a7,
1346 0x00cd, 0x0078, 0x2459, 0x781b, 0x008e, 0x0078, 0x2459, 0x782b, 1576 0x4013, 0x0078, 0x4847, 0x2011, 0x0012, 0x1078, 0x43ed, 0x0079,
1347 0x3008, 0x781b, 0x008e, 0x0078, 0x2459, 0x6818, 0xa084, 0x8000, 1577 0x4019, 0x401f, 0x24fa, 0x3c68, 0x402b, 0x4033, 0x4039, 0xa6b4,
1348 0x0040, 0x38f4, 0x681b, 0x001d, 0x706f, 0x0001, 0x781b, 0x0048, 1578 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a, 0x70b4, 0xa080, 0x00aa,
1349 0x0078, 0x2459, 0x007e, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x3910, 1579 0x781a, 0x0078, 0x24fa, 0xa6b4, 0x00ff, 0xa6b5, 0x0400, 0x6eb6,
1350 0x7808, 0xa084, 0xfffc, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005, 1580 0x7e5a, 0x0078, 0x4835, 0x70ab, 0x4037, 0x0078, 0x24fa, 0x0078,
1351 0x78ec, 0xa084, 0x0021, 0x0040, 0x3910, 0x7044, 0x780a, 0xa005, 1581 0x401f, 0x70ab, 0x403d, 0x0078, 0x24fa, 0x0078, 0x402b, 0xa286,
1352 0x007f, 0x007c, 0x7044, 0xa085, 0x0002, 0x7046, 0x780a, 0x007c, 1582 0x0001, 0x0040, 0x4045, 0x1078, 0x248c, 0x70a7, 0x4049, 0x0078,
1353 0x007e, 0x7830, 0xa084, 0x0040, 0x00c0, 0x3919, 0x0098, 0x3924, 1583 0x4847, 0x2011, 0x0015, 0x1078, 0x43ed, 0x0079, 0x404f, 0x4054,
1354 0x007f, 0x789a, 0x78ac, 0x007c, 0x7808, 0xa084, 0xfffd, 0x780a, 1584 0x24fa, 0x3c68, 0x4062, 0x406e, 0xa6b4, 0x00ff, 0xa6b5, 0x0400,
1355 0x0005, 0x0005, 0x0005, 0x0005, 0x78ec, 0xa084, 0x0021, 0x0040, 1585 0x6eb6, 0x7e5a, 0x783b, 0x1301, 0x70b4, 0xa080, 0x00b5, 0x781a,
1356 0x3933, 0x0098, 0x3931, 0x007f, 0x789a, 0x78ac, 0x007e, 0x7044, 1586 0x0078, 0x24fa, 0xa6b4, 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a,
1357 0x780a, 0x007f, 0x007c, 0x78ec, 0xa084, 0x0002, 0x00c0, 0x4760, 1587 0x70b4, 0xa080, 0x00aa, 0x781a, 0x0078, 0x24fa, 0x70ab, 0x4072,
1358 0xa784, 0x007d, 0x00c0, 0x3947, 0x2700, 0x1078, 0x23eb, 0xa784, 1588 0x0078, 0x24fa, 0x0078, 0x4054, 0xa282, 0x0003, 0x0050, 0x407a,
1359 0x0001, 0x00c0, 0x2f6d, 0xa784, 0x0070, 0x0040, 0x3957, 0x0c7e, 1589 0x1078, 0x248c, 0x2300, 0x0079, 0x407d, 0x4080, 0x40b7, 0x4114,
1360 0x2d60, 0x2f68, 0x1078, 0x2396, 0x2d78, 0x2c68, 0x0c7f, 0xa784, 1590 0xa286, 0x0001, 0x0040, 0x4086, 0x1078, 0x248c, 0x6804, 0xa084,
1361 0x0008, 0x0040, 0x3964, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 1591 0x00ff, 0xa086, 0x0006, 0x00c0, 0x4093, 0x1078, 0x3bc6, 0x7003,
1362 0x0040, 0x2482, 0x0078, 0x3888, 0xa784, 0x0004, 0x0040, 0x3997, 1592 0x0000, 0x0078, 0x3c68, 0x683b, 0x0000, 0x6837, 0x0000, 0xa684,
1363 0x78b8, 0xa084, 0x4001, 0x0040, 0x3997, 0x784b, 0x0008, 0x78ec, 1593 0x0200, 0x0040, 0x40a1, 0x1078, 0x47fe, 0x1078, 0x43d5, 0x1078,
1364 0xa084, 0x0003, 0x0040, 0x2482, 0x78e4, 0xa084, 0x0007, 0xa086, 1594 0x4805, 0x2001, 0x0001, 0x1078, 0x4797, 0x78b8, 0xa084, 0xc001,
1365 0x0001, 0x00c0, 0x3997, 0x78c0, 0xa085, 0x4800, 0x2030, 0x7e5a, 1595 0x0040, 0x40b3, 0x7848, 0xa085, 0x0008, 0x784a, 0x7848, 0xa084,
1366 0x781b, 0x00cd, 0x0078, 0x2459, 0x784b, 0x0008, 0x6818, 0xa084, 1596 0x0008, 0x00c0, 0x40ae, 0x7003, 0x0000, 0x0078, 0x3c68, 0x2200,
1367 0x8000, 0x0040, 0x3993, 0x681b, 0x0015, 0xa684, 0x4000, 0x0040, 1597 0x0079, 0x40ba, 0x40bc, 0x40ef, 0x70a7, 0x40c0, 0x0078, 0x4847,
1368 0x3993, 0x681b, 0x0007, 0x1078, 0x389c, 0x0078, 0x2459, 0x681b, 1598 0x2011, 0x000d, 0x1078, 0x43ed, 0x0079, 0x40c6, 0x40cd, 0x24fa,
1369 0x0003, 0x7858, 0xa084, 0x3f00, 0x681e, 0x682f, 0x0000, 0x6833, 1599 0x3c68, 0x40d5, 0x40dd, 0x40e3, 0x40e5, 0xa6b4, 0x00ff, 0xa6b5,
1370 0x0000, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x2965, 1600 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x4835, 0xa6b4, 0x00ff, 0xa6b5,
1371 0x0018, 0x2459, 0x0078, 0x36a5, 0x6b14, 0x8307, 0xa084, 0x000f, 1601 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x4835, 0x70ab, 0x40e1, 0x0078,
1372 0x8003, 0x8003, 0x8003, 0xa080, 0x5380, 0x2060, 0x2048, 0x7056, 1602 0x24fa, 0x0078, 0x40cd, 0x1078, 0x248c, 0x70ab, 0x40eb, 0x1078,
1373 0x6000, 0x705a, 0x6004, 0x705e, 0x2a60, 0x007c, 0x0079, 0x39c0, 1603 0x4805, 0x0078, 0x24fa, 0x1078, 0x484d, 0x0078, 0x24fa, 0x70a7,
1374 0x39c8, 0x39c9, 0x39c8, 0x39cb, 0x39c8, 0x39c8, 0x39c8, 0x39d0, 1604 0x40f3, 0x0078, 0x4847, 0x2011, 0x0005, 0x1078, 0x43ed, 0x0079,
1375 0x007c, 0x1078, 0x33ee, 0x1078, 0x4776, 0x7038, 0x600a, 0x007c, 1605 0x40f9, 0x40fe, 0x24fa, 0x3c68, 0x4106, 0x410e, 0xa6b4, 0x00ff,
1376 0x70a0, 0xa005, 0x0040, 0x39dd, 0x2068, 0x1078, 0x1b62, 0x1078, 1606 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x4835, 0xa6b4, 0x00ff,
1377 0x46f8, 0x1078, 0x46ff, 0x70a3, 0x0000, 0x007c, 0x0e7e, 0x2091, 1607 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x4835, 0x70ab, 0x4112,
1378 0x8000, 0x2071, 0x5140, 0x7000, 0xa086, 0x0007, 0x00c0, 0x39f4, 1608 0x0078, 0x24fa, 0x0078, 0x40fe, 0xa286, 0x0001, 0x0040, 0x411a,
1379 0x6110, 0x70bc, 0xa106, 0x00c0, 0x39f4, 0x0e7f, 0x1078, 0x1b6f, 1609 0x1078, 0x248c, 0x70a7, 0x411e, 0x0078, 0x4847, 0x2011, 0x0006,
1380 0x1078, 0x39fa, 0xa006, 0x007c, 0x2091, 0x8001, 0x0e7f, 0xa085, 1610 0x1078, 0x43ed, 0x0079, 0x4124, 0x4129, 0x24fa, 0x3c68, 0x412f,
1381 0x0001, 0x007c, 0x0f7e, 0x0e7e, 0x2071, 0x5140, 0x0078, 0x21fa, 1611 0x4139, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x4835, 0xa6b4,
1382 0x785b, 0x0000, 0x70af, 0x000e, 0x2009, 0x0100, 0x017e, 0x70a0, 1612 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0xa6b5, 0x4000, 0x7e5a, 0x0078,
1383 0xa06d, 0x0040, 0x3a0f, 0x70a3, 0x0000, 0x0078, 0x3a15, 0x70b3, 1613 0x4835, 0x70ab, 0x413d, 0x0078, 0x24fa, 0x0078, 0x4129, 0x2300,
1384 0x0000, 0x1078, 0x1b8b, 0x0040, 0x3a1b, 0x70ac, 0x6826, 0x1078, 1614 0x0079, 0x4142, 0x4147, 0x4145, 0x4145, 0x1078, 0x248c, 0x1078,
1385 0x3af8, 0x0078, 0x3a0f, 0x017f, 0x157e, 0x0c7e, 0x0d7e, 0x20a9, 1615 0x248c, 0x2300, 0x71a8, 0xa005, 0x017a, 0x6810, 0x70be, 0xa282,
1386 0x0008, 0x2061, 0x7510, 0x6000, 0xa105, 0x6002, 0x601c, 0xa06d, 1616 0x0003, 0x0050, 0x4155, 0x1078, 0x248c, 0x2300, 0x0079, 0x4158,
1387 0x0040, 0x3a33, 0x6800, 0x601e, 0x1078, 0x195a, 0x6008, 0x8000, 1617 0x415b, 0x4169, 0x418b, 0xa684, 0x0200, 0x0040, 0x4163, 0x1078,
1388 0x600a, 0x0078, 0x3a26, 0x6018, 0xa06d, 0x0040, 0x3a3d, 0x6800, 1618 0x47fe, 0x1078, 0x4805, 0x2001, 0x0001, 0x1078, 0x4797, 0x0078,
1389 0x601a, 0x1078, 0x195a, 0x0078, 0x3a33, 0xace0, 0x0008, 0x0070, 1619 0x24fa, 0xa296, 0x0002, 0x0040, 0x4172, 0x82ff, 0x0040, 0x4172,
1390 0x3a43, 0x0078, 0x3a23, 0x709c, 0xa084, 0x8000, 0x0040, 0x3a4a, 1620 0x1078, 0x248c, 0x70a7, 0x4176, 0x0078, 0x4847, 0x2011, 0x0018,
1391 0x1078, 0x3b72, 0x0d7f, 0x0c7f, 0x157f, 0x007c, 0x127e, 0x2091, 1621 0x1078, 0x43ed, 0x0079, 0x417c, 0x4181, 0x24fa, 0x3c68, 0x4183,
1392 0x2300, 0x6804, 0xa084, 0x000f, 0x0079, 0x3a56, 0x3a66, 0x3a66, 1622 0x4185, 0x0078, 0x4835, 0x0078, 0x4835, 0x70ab, 0x4189, 0x0078,
1393 0x3a66, 0x3a66, 0x3a66, 0x3a66, 0x3a68, 0x3a6e, 0x3a66, 0x3a66, 1623 0x24fa, 0x0078, 0x4181, 0x2200, 0x0079, 0x418e, 0x4190, 0x41a9,
1394 0x3a66, 0x3a66, 0x3a66, 0x3a70, 0x3a66, 0x3a68, 0x1078, 0x23eb, 1624 0x70a7, 0x4194, 0x0078, 0x4847, 0x2011, 0x0017, 0x1078, 0x43ed,
1395 0x1078, 0x44d0, 0x1078, 0x195a, 0x0078, 0x3a74, 0x6827, 0x000b, 1625 0x0079, 0x419a, 0x419f, 0x24fa, 0x3c68, 0x41a1, 0x41a3, 0x0078,
1396 0x1078, 0x44d0, 0x1078, 0x3af8, 0x127f, 0x007c, 0x127e, 0x2091, 1626 0x4835, 0x0078, 0x4835, 0x70ab, 0x41a7, 0x0078, 0x24fa, 0x0078,
1397 0x2300, 0x0098, 0x3a92, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x3a92, 1627 0x419f, 0xa484, 0x8000, 0x00c0, 0x4205, 0xa684, 0x0100, 0x0040,
1398 0x0d7e, 0x1078, 0x4708, 0x2d00, 0x682e, 0x2009, 0x0004, 0x2001, 1628 0x41b5, 0x1078, 0x47fe, 0x1078, 0x43d5, 0x78d8, 0x78d2, 0x78dc,
1399 0x0000, 0x6827, 0x0084, 0x1078, 0x46c1, 0x1078, 0x3af8, 0x0d7f, 1629 0x78d6, 0xa6b4, 0xefff, 0x7e5a, 0x70a7, 0x41c0, 0x0078, 0x4847,
1400 0x0078, 0x3ac6, 0x7948, 0xa185, 0x4000, 0x784a, 0x0098, 0x3a9b, 1630 0x2011, 0x000d, 0x1078, 0x43ed, 0x0079, 0x41c6, 0x41cd, 0x24fa,
1401 0x794a, 0x0078, 0x3a80, 0x7828, 0xa086, 0x1834, 0x00c0, 0x3aa4, 1631 0x3c68, 0x41cd, 0x41f3, 0x41f9, 0x41fb, 0x78d8, 0x79dc, 0xa105,
1402 0xa185, 0x0004, 0x0078, 0x3aab, 0x7828, 0xa086, 0x1814, 0x00c0, 1632 0x00c0, 0x41df, 0x78b8, 0xa084, 0x001f, 0x00c0, 0x41df, 0x70b3,
1403 0x3a98, 0xa185, 0x000c, 0x784a, 0x789b, 0x000e, 0x78ab, 0x0002, 1633 0x0000, 0x7858, 0xa084, 0xfdff, 0x785a, 0x0078, 0x4835, 0xa684,
1404 0x7858, 0xa084, 0x00ff, 0xa085, 0x0400, 0x785a, 0x70b4, 0xa080, 1634 0x0100, 0x0040, 0x41f1, 0x7848, 0xa085, 0x0008, 0x784a, 0x1078,
1405 0x0091, 0x781a, 0x6827, 0x0284, 0x682c, 0x6836, 0x6830, 0x683a, 1635 0x47bc, 0x682c, 0x78d2, 0x6830, 0x78d6, 0x70b3, 0x0000, 0x1078,
1406 0x2009, 0x0004, 0x2001, 0x0000, 0x1078, 0x46c1, 0x127f, 0x007c, 1636 0x47f6, 0x0078, 0x4835, 0x70ab, 0x41f7, 0x0078, 0x24fa, 0x0078,
1407 0x0d7e, 0x6b14, 0x1078, 0x1bfd, 0x0040, 0x3ad5, 0x2068, 0x6827, 1637 0x41cd, 0x1078, 0x248c, 0x70ab, 0x4201, 0x1078, 0x4805, 0x0078,
1408 0x0002, 0x1078, 0x3af8, 0x0078, 0x3aca, 0x0d7f, 0x007c, 0x0d7e, 1638 0x24fa, 0x1078, 0x484d, 0x0078, 0x24fa, 0x1078, 0x4805, 0x70ab,
1409 0x6b14, 0x6c28, 0xa4a4, 0x00ff, 0x1078, 0x1b9b, 0x0040, 0x3ae5, 1639 0x420f, 0x2001, 0x0003, 0x1078, 0x478f, 0x0078, 0x4841, 0x1078,
1410 0x2068, 0x6827, 0x0002, 0x1078, 0x3af8, 0x0d7f, 0x007c, 0x0d7e, 1640 0x47f6, 0x682c, 0x78d2, 0x6830, 0x78d6, 0x0078, 0x4835, 0x70b8,
1411 0x6b14, 0xa39c, 0x00ff, 0x1078, 0x1bce, 0x0040, 0x3af6, 0x2068, 1641 0x6812, 0x70be, 0x8000, 0x70ba, 0x681b, 0x0000, 0xa684, 0x0008,
1412 0x6827, 0x0002, 0x1078, 0x3af8, 0x0078, 0x3aeb, 0x0d7f, 0x007c, 1642 0x0040, 0x423a, 0x157e, 0x137e, 0x147e, 0x7890, 0x8004, 0x8004,
1413 0x0c7e, 0x6914, 0x1078, 0x3b69, 0x6904, 0xa18c, 0x00ff, 0xa186, 1643 0x8004, 0x8004, 0xa084, 0x000f, 0x681a, 0x80ac, 0x789b, 0x0000,
1414 0x0006, 0x0040, 0x3b13, 0xa186, 0x000d, 0x0040, 0x3b32, 0xa186, 1644 0xaf80, 0x002b, 0x2098, 0xad80, 0x000b, 0x20a0, 0x53a5, 0x147f,
1415 0x0017, 0x00c0, 0x3b0f, 0x1078, 0x195a, 0x0078, 0x3b11, 0x1078, 1645 0x137f, 0x157f, 0xa6c4, 0x0f00, 0xa684, 0x0002, 0x00c0, 0x4249,
1416 0x1c72, 0x0c7f, 0x007c, 0x6004, 0x8001, 0x0048, 0x3b30, 0x6006, 1646 0x692c, 0x810d, 0x810d, 0x810d, 0xa184, 0x0007, 0x2008, 0x0078,
1417 0x2009, 0x0000, 0xa684, 0x0001, 0x00c0, 0x3b20, 0xa18d, 0x8000, 1647 0x425c, 0x789b, 0x0010, 0x79ac, 0xa184, 0x0020, 0x0040, 0x425c,
1418 0xa684, 0x0004, 0x0040, 0x3b26, 0xa18d, 0x0002, 0x691e, 0x6823, 1648 0x017e, 0x2009, 0x0005, 0x2001, 0x3d00, 0x1078, 0x47c7, 0x6824,
1419 0x0000, 0x7104, 0x810f, 0x6818, 0xa105, 0x681a, 0x0078, 0x3b0f, 1649 0xa085, 0x003b, 0x6826, 0x017f, 0xa184, 0x001f, 0xa805, 0x6816,
1420 0x1078, 0x23eb, 0x6018, 0xa005, 0x00c0, 0x3b41, 0x6008, 0x8001, 1650 0x1078, 0x3c3b, 0x68be, 0xa684, 0x0004, 0x0040, 0x426d, 0xa18c,
1421 0x0048, 0x3b41, 0x600a, 0x601c, 0x6802, 0x2d00, 0x601e, 0x0078, 1651 0xff00, 0x78a8, 0xa084, 0x00ff, 0xa105, 0x682a, 0xa6b4, 0x00ff,
1422 0x3b57, 0xac88, 0x0006, 0x2104, 0xa005, 0x0040, 0x3b4a, 0x2008, 1652 0x6000, 0xa084, 0x0008, 0x0040, 0x4277, 0xa6b5, 0x4000, 0x6eb6,
1423 0x0078, 0x3b43, 0x6802, 0x2d0a, 0x6008, 0x8001, 0x0048, 0x3b11, 1653 0x007c, 0x157e, 0x137e, 0x147e, 0x6918, 0x7890, 0x8004, 0x8004,
1424 0x600a, 0x6018, 0x2068, 0x6800, 0x601a, 0x0078, 0x3b3b, 0x157e, 1654 0x8004, 0x8004, 0xa084, 0x000f, 0x007e, 0xa100, 0x681a, 0x007f,
1425 0x137e, 0x147e, 0x0c7e, 0x0d7e, 0x1078, 0x1937, 0x2da0, 0x137f, 1655 0x8000, 0x8004, 0x0040, 0x4298, 0x20a8, 0x8104, 0xa080, 0x000b,
1426 0x20a9, 0x0031, 0x53a3, 0x0c7f, 0x147f, 0x137f, 0x157f, 0x0078, 1656 0xad00, 0x20a0, 0x789b, 0x0000, 0xaf80, 0x002b, 0x2098, 0x53a5,
1427 0x3b0f, 0xa184, 0x001f, 0x8003, 0x8003, 0x8003, 0xa080, 0x7510, 1657 0x147f, 0x137f, 0x157f, 0x007c, 0x682c, 0xa084, 0x0020, 0x00c0,
1428 0x2060, 0x007c, 0x2019, 0x5151, 0x2304, 0xa085, 0x0001, 0x201a, 1658 0x42a4, 0x620c, 0x0078, 0x42a5, 0x6210, 0x6b18, 0x2300, 0xa202,
1429 0x2019, 0x0102, 0x2304, 0xa085, 0x0001, 0x201a, 0x007c, 0x2019, 1659 0x0040, 0x42c5, 0x2018, 0xa382, 0x000e, 0x0048, 0x42b5, 0x0040,
1430 0x5151, 0x2304, 0xa084, 0xfffe, 0x201a, 0x2019, 0x0102, 0x2304, 1660 0x42b5, 0x2019, 0x000e, 0x0078, 0x42b9, 0x7858, 0xa084, 0xffef,
1431 0xa084, 0xfffe, 0x201a, 0x007c, 0x7990, 0xa18c, 0xfff8, 0x7992, 1661 0x785a, 0x783b, 0x1b01, 0x7893, 0x0000, 0x7ba2, 0x70b4, 0xa080,
1432 0x70b4, 0xa080, 0x00dd, 0x781a, 0x0078, 0x2459, 0x70a3, 0x0000, 1662 0x008e, 0x781a, 0xa085, 0x0001, 0x007c, 0x7858, 0xa084, 0xffef,
1433 0x7003, 0x0000, 0x7043, 0x0001, 0x7037, 0x0000, 0x0018, 0x2410, 1663 0x785a, 0x7893, 0x0000, 0xa006, 0x007c, 0x6904, 0xa18c, 0x00ff,
1434 0x1078, 0x1b8b, 0x0040, 0x3bc7, 0x2009, 0x510f, 0x200b, 0x0000, 1664 0xa196, 0x0007, 0x0040, 0x42da, 0xa196, 0x000f, 0x0040, 0x42da,
1435 0x68bc, 0x2060, 0x6100, 0xa184, 0x0300, 0x0040, 0x3bbb, 0x6827, 1665 0x6807, 0x0117, 0x6914, 0x1078, 0x3c3b, 0x6100, 0x8104, 0x00c8,
1436 0x000e, 0xa084, 0x0200, 0x0040, 0x3bb7, 0x6827, 0x0017, 0x1078, 1666 0x42f5, 0x601c, 0xa005, 0x0040, 0x42e9, 0x2001, 0x0800, 0x0078,
1437 0x3af8, 0x0078, 0x3b96, 0x7000, 0xa086, 0x0007, 0x00c0, 0x3c29, 1667 0x42f7, 0x0d7e, 0x6824, 0x007e, 0x1078, 0x4812, 0x007f, 0x6826,
1438 0x2d00, 0x70a2, 0xad80, 0x000f, 0x7036, 0x0078, 0x3bce, 0x7040, 1668 0x2d00, 0x682e, 0x1078, 0x3bc6, 0x0d7f, 0x2001, 0x0200, 0x6924,
1439 0xa086, 0x0001, 0x0040, 0x2492, 0x0078, 0x2459, 0x2031, 0x0000, 1669 0xa18c, 0x00ff, 0xa10d, 0x6926, 0x8007, 0x789b, 0x000e, 0x78aa,
1440 0x691c, 0xa184, 0x0002, 0x0040, 0x3bd7, 0xa6b5, 0x0004, 0xa184, 1670 0x6820, 0xa085, 0x8000, 0x6822, 0x2031, 0x0400, 0x6eb6, 0x7e5a,
1441 0x00c0, 0x8003, 0x8003, 0x8007, 0xa080, 0x3cc2, 0x2004, 0xa635, 1671 0x71b4, 0xa188, 0x0091, 0x791a, 0x007c, 0xa6c4, 0x0f00, 0xa684,
1442 0x6820, 0xa084, 0x0400, 0x0040, 0x3bef, 0x789b, 0x0018, 0x78ab, 1672 0x0002, 0x00c0, 0x4321, 0x692c, 0x810d, 0x810d, 0x810d, 0xa184,
1443 0x0003, 0x789b, 0x0081, 0x78ab, 0x0001, 0xa6b5, 0x1000, 0x6820, 1673 0x0007, 0x2008, 0xa805, 0x6816, 0x1078, 0x3c3b, 0x68be, 0x0078,
1444 0xa084, 0x8000, 0x00c0, 0x3bfd, 0x681c, 0xa084, 0x8000, 0x00c0, 1674 0x4324, 0x6914, 0x1078, 0x3c3b, 0x6100, 0x8104, 0x00c8, 0x4382,
1445 0x3c04, 0xa6b5, 0x0800, 0x0078, 0x3c04, 0xa6b5, 0x0400, 0x789b, 1675 0xa184, 0x0300, 0x0040, 0x4330, 0x6807, 0x0117, 0x0078, 0x434e,
1446 0x000e, 0x6824, 0x8007, 0x78aa, 0x6820, 0xa084, 0x0100, 0x0040, 1676 0x6004, 0xa005, 0x00c0, 0x4357, 0x6807, 0x0117, 0x601c, 0xa005,
1447 0x3c0b, 0xa6b5, 0x4000, 0xa684, 0x0200, 0x0040, 0x3c25, 0x682c, 1677 0x00c0, 0x4344, 0x0d7e, 0x1078, 0x4812, 0x6827, 0x0034, 0x2d00,
1448 0x78d2, 0x6830, 0x78d6, 0xa684, 0x0100, 0x0040, 0x3c23, 0x682c, 1678 0x682e, 0x1078, 0x3bc6, 0x0d7f, 0xa684, 0x0004, 0x0040, 0x434e,
1449 0xa084, 0x0001, 0x0040, 0x3c23, 0x7888, 0xa084, 0x0040, 0x0040, 1679 0x2031, 0x0400, 0x2001, 0x2800, 0x0078, 0x4352, 0x2031, 0x0400,
1450 0x3c23, 0xa6b5, 0x8000, 0x1078, 0x46f0, 0x7e5a, 0x6eb6, 0x0078, 1680 0x2001, 0x0800, 0x71b4, 0xa188, 0x0091, 0x0078, 0x43b0, 0x6018,
1451 0x4727, 0x1078, 0x38fa, 0x00c0, 0x3cbc, 0x702c, 0x8004, 0x0048, 1681 0xa005, 0x00c0, 0x4344, 0x601c, 0xa005, 0x00c0, 0x4344, 0x689f,
1452 0x3c37, 0x2019, 0x4e3b, 0x1078, 0x2276, 0x702f, 0x0001, 0x2041, 1682 0x0000, 0x6827, 0x003d, 0xa684, 0x0001, 0x0040, 0x43be, 0xd694,
1453 0x0001, 0x2031, 0x1000, 0x789b, 0x0018, 0x6814, 0xa084, 0x001f, 1683 0x00c0, 0x437b, 0x6100, 0xd1d4, 0x0040, 0x437b, 0x692c, 0xa18c,
1454 0xa085, 0x0080, 0x78aa, 0x691c, 0xa184, 0x0002, 0x0040, 0x3c50, 1684 0x00ff, 0x0040, 0x43be, 0xa186, 0x0003, 0x0040, 0x43be, 0xa186,
1455 0xa6b5, 0x0004, 0x78ab, 0x0020, 0x6828, 0x78aa, 0xa8c0, 0x0002, 1685 0x0012, 0x0040, 0x43be, 0xa6b5, 0x0800, 0x71b4, 0xa188, 0x00ae,
1456 0x681c, 0xd0f4, 0x0040, 0x3c59, 0x2c50, 0x1078, 0x39ac, 0x1078, 1686 0x0078, 0x43b9, 0x6807, 0x0117, 0x2031, 0x0400, 0x692c, 0xa18c,
1457 0x45ff, 0x6820, 0xa084, 0x8000, 0x0040, 0x3c67, 0xa6b5, 0x0400, 1687 0x00ff, 0xa186, 0x0012, 0x00c0, 0x4393, 0x2001, 0x43cb, 0x2009,
1458 0x789b, 0x000e, 0x6824, 0x8007, 0x78aa, 0x0078, 0x3c6e, 0x681c, 1688 0x0001, 0x0078, 0x43a4, 0xa186, 0x0003, 0x00c0, 0x439d, 0x2001,
1459 0xa084, 0x8000, 0x00c0, 0x3c6e, 0xa6b5, 0x0800, 0x6820, 0xa084, 1689 0x43cc, 0x2009, 0x0012, 0x0078, 0x43a4, 0x2001, 0x0200, 0x71b4,
1460 0x0100, 0x0040, 0x3c75, 0xa6b5, 0x4000, 0x681c, 0xa084, 0x00c0, 1690 0xa188, 0x0091, 0x0078, 0x43b0, 0x1078, 0x47e1, 0x78a3, 0x0000,
1461 0x8003, 0x8003, 0x8007, 0xa080, 0x3cc2, 0x2004, 0xa635, 0xa684, 1691 0x681c, 0xa085, 0x0040, 0x681e, 0x71b4, 0xa188, 0x00da, 0xa006,
1462 0x0100, 0x0040, 0x3c8f, 0x682c, 0xa084, 0x0001, 0x0040, 0x3c8f, 1692 0x6826, 0x8007, 0x789b, 0x000e, 0x78aa, 0x6820, 0xa085, 0x8000,
1463 0x7888, 0xa084, 0x0040, 0x0040, 0x3c8f, 0xa6b5, 0x8000, 0x789b, 1693 0x6822, 0x6eb6, 0x7e5a, 0x791a, 0x0078, 0x24fa, 0x6eb6, 0x1078,
1464 0x007e, 0x7eae, 0x6eb6, 0x6814, 0x8007, 0x78aa, 0x7882, 0x2810, 1694 0x3bc6, 0x6810, 0x70be, 0x7003, 0x0007, 0x70a3, 0x0000, 0x704b,
1465 0x7aaa, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x3cbc, 0x0018, 0x3cbc, 1695 0x0000, 0x0078, 0x24fa, 0x0023, 0x0070, 0x0005, 0x0000, 0x0a00,
1466 0x70b4, 0xa080, 0x00e2, 0x781a, 0x1078, 0x3912, 0xa684, 0x0200, 1696 0x0000, 0x0000, 0x0025, 0x0000, 0x0000, 0x683b, 0x0000, 0x6837,
1467 0x0040, 0x3cb0, 0x682c, 0x78d2, 0x6830, 0x78d6, 0x1078, 0x46f0, 1697 0x0000, 0xa684, 0x0200, 0x0040, 0x43ec, 0x78b8, 0xa08c, 0x001f,
1468 0x2d00, 0x70a2, 0x704a, 0x6810, 0x70be, 0x7003, 0x0007, 0xad80, 1698 0xa084, 0x8000, 0x0040, 0x43e5, 0x8108, 0x78d8, 0xa100, 0x6836,
1469 0x000f, 0x7036, 0x0078, 0x2459, 0x1078, 0x1b62, 0x1078, 0x3912, 1699 0x78dc, 0xa081, 0x0000, 0x683a, 0x007c, 0x7990, 0x810f, 0xa5ac,
1470 0x0078, 0x2459, 0x0000, 0x0300, 0x0200, 0x0000, 0x1078, 0x23eb, 1700 0x0007, 0x2021, 0x0000, 0xa480, 0x0010, 0x789a, 0x79a8, 0xa18c,
1471 0x2300, 0x0079, 0x3ccb, 0x3cce, 0x3cce, 0x3cd0, 0x1078, 0x23eb, 1701 0x00ff, 0xa184, 0x0080, 0x00c0, 0x441b, 0xa182, 0x0020, 0x00c8,
1472 0x1078, 0x46ff, 0x6924, 0xa184, 0x00ff, 0xa086, 0x000a, 0x0040, 1702 0x4439, 0xa182, 0x0012, 0x00c8, 0x4781, 0x2100, 0x1079, 0x4409,
1473 0x3ce2, 0xa184, 0xff00, 0xa085, 0x000a, 0x6826, 0x1078, 0x1b62, 1703 0x007c, 0x4781, 0x45eb, 0x4781, 0x4781, 0x4446, 0x4449, 0x4483,
1474 0x0078, 0x3b96, 0x2001, 0x000a, 0x1078, 0x4691, 0x0078, 0x3b96, 1704 0x44b9, 0x44ed, 0x44f0, 0x4781, 0x4781, 0x44a4, 0x4514, 0x454e,
1475 0xa282, 0x0005, 0x0050, 0x3cee, 0x1078, 0x23eb, 0x7000, 0xa084, 1705 0x4781, 0x4781, 0x4574, 0xa184, 0x0020, 0x00c0, 0x45a8, 0xa18c,
1476 0x0007, 0x10c0, 0x39be, 0x1078, 0x1937, 0x00c0, 0x3d0d, 0xa684, 1706 0x001f, 0x6814, 0xa084, 0x001f, 0xa106, 0x0040, 0x4436, 0x70b4,
1477 0x0004, 0x0040, 0x3cff, 0x2001, 0x2800, 0x0078, 0x3d01, 0x2001, 1707 0xa080, 0x00cd, 0x781a, 0x2001, 0x0014, 0x1078, 0x4797, 0x1078,
1478 0x0800, 0x71b4, 0xa188, 0x0091, 0x789b, 0x000e, 0x78aa, 0x2031, 1708 0x4805, 0x7003, 0x0000, 0x2001, 0x0002, 0x007c, 0x2001, 0x0000,
1479 0x0400, 0x7e5a, 0x791a, 0x0078, 0x2459, 0x6807, 0x0106, 0x680b, 1709 0x007c, 0xa182, 0x0024, 0x00c8, 0x4781, 0xa184, 0x0003, 0x1079,
1480 0x0000, 0x689f, 0x0000, 0x6827, 0x0000, 0xa386, 0x0002, 0x00c0, 1710 0x4409, 0x007c, 0x4781, 0x4781, 0x4781, 0x4781, 0x1078, 0x4781,
1481 0x3d2e, 0xa286, 0x0002, 0x00c0, 0x3d2e, 0x78a0, 0xa005, 0x00c0, 1711 0x007c, 0x2200, 0x0079, 0x444c, 0x4577, 0x4577, 0x4470, 0x4470,
1482 0x3d2e, 0xa484, 0x8000, 0x00c0, 0x3d2e, 0x78e4, 0xa084, 0x0008, 1712 0x4470, 0x4470, 0x4470, 0x4470, 0x4470, 0x4470, 0x446e, 0x4470,
1483 0x0040, 0x3d2e, 0xa6b5, 0x0008, 0x2019, 0x0000, 0x1078, 0x411e, 1713 0x4465, 0x4470, 0x4470, 0x4470, 0x4470, 0x4470, 0x4478, 0x447b,
1484 0x2d00, 0x70a2, 0x704a, 0x7003, 0x0007, 0x7037, 0x0000, 0x6824, 1714 0x4577, 0x447b, 0x4470, 0x4470, 0x4470, 0x0c7e, 0x077e, 0x6f14,
1485 0xa084, 0x0080, 0x0040, 0x3d40, 0x1078, 0x41d0, 0x0078, 0x2459, 1715 0x1078, 0x37b0, 0x077f, 0x0c7f, 0x0078, 0x4470, 0x1078, 0x468e,
1486 0x2300, 0x0079, 0x3d43, 0x3d46, 0x3dc7, 0x3de6, 0x2200, 0x0079, 1716 0x6827, 0x02b3, 0x2009, 0x000b, 0x2001, 0x4800, 0x0078, 0x45ab,
1487 0x3d49, 0x3d4e, 0x3d5e, 0x3d84, 0x3d90, 0x3db3, 0x2029, 0x0001, 1717 0x1078, 0x4773, 0x007c, 0x6827, 0x0093, 0x2009, 0x000b, 0x2001,
1488 0xa026, 0x2011, 0x0000, 0x1078, 0x42f1, 0x0079, 0x3d57, 0x3d5c, 1718 0x4800, 0x0078, 0x4593, 0x2d58, 0x6804, 0xa084, 0x00ff, 0xa086,
1489 0x2459, 0x3b96, 0x3d5c, 0x3d5c, 0x1078, 0x23eb, 0x7990, 0xa18c, 1719 0x0006, 0x00c0, 0x448d, 0x6807, 0x0117, 0x6827, 0x0002, 0x1078,
1490 0x0007, 0x00c0, 0x3d65, 0x2009, 0x0008, 0x2011, 0x0001, 0xa684, 1720 0x4812, 0x6827, 0x0036, 0x6932, 0x2d00, 0x682e, 0x0d7e, 0x1078,
1491 0x0004, 0x0040, 0x3d6d, 0x2011, 0x0003, 0x2220, 0xa12a, 0x2011, 1721 0x3b96, 0x1078, 0x45d3, 0x2b68, 0x1078, 0x3bc6, 0x0d7f, 0x1078,
1492 0x0001, 0x1078, 0x42f1, 0x0079, 0x3d75, 0x3d7a, 0x2459, 0x3b96, 1722 0x3bc6, 0x2001, 0x0002, 0x007c, 0x1078, 0x45d3, 0x2001, 0x0017,
1493 0x3d82, 0x3d7c, 0x0078, 0x472d, 0x70ab, 0x3d80, 0x0078, 0x2459, 1723 0x1078, 0x4797, 0x70a3, 0x0000, 0x2009, 0x5238, 0x200b, 0x0006,
1494 0x0078, 0x3d7a, 0x1078, 0x23eb, 0xa684, 0x0010, 0x0040, 0x3d8e, 1724 0x70af, 0x0017, 0x2009, 0x0200, 0x1078, 0x3ad4, 0x2001, 0x0001,
1495 0x1078, 0x419f, 0x0040, 0x3d8e, 0x0078, 0x2459, 0x0078, 0x420c, 1725 0x007c, 0x2200, 0x0079, 0x44bc, 0x4577, 0x45a8, 0x45a8, 0x45a8,
1496 0x6000, 0xa084, 0x0002, 0x0040, 0x3dad, 0x70b4, 0xa080, 0x00d2, 1726 0x44dd, 0x45ba, 0x44e5, 0x45ba, 0x45ba, 0x45bd, 0x45bd, 0x45c2,
1497 0x781a, 0x0d7e, 0x1078, 0x4708, 0x2d00, 0x682e, 0x6827, 0x0000, 1727 0x45c2, 0x44d5, 0x44d5, 0x45a8, 0x45a8, 0x45ba, 0x45a8, 0x44e5,
1498 0x1078, 0x3af8, 0x0d7f, 0x1078, 0x195a, 0x7003, 0x0000, 0x7037, 1728 0x4577, 0x44e5, 0x44e5, 0x44e5, 0x44e5, 0x6827, 0x0084, 0x2009,
1499 0x0000, 0x704b, 0x0000, 0x0078, 0x3b96, 0xa684, 0x0004, 0x00c0, 1729 0x000b, 0x2001, 0x4300, 0x0078, 0x45cc, 0x6827, 0x000d, 0x2009,
1500 0x3db3, 0x0078, 0x472d, 0x6000, 0xa084, 0x0004, 0x00c0, 0x3dc5, 1730 0x000b, 0x2001, 0x4300, 0x0078, 0x45ab, 0x6827, 0x0093, 0x2009,
1501 0x6000, 0xa084, 0x0001, 0x0040, 0x3dc5, 0x70ab, 0x3dc5, 0x2001, 1731 0x000b, 0x2001, 0x4300, 0x0078, 0x4593, 0x2001, 0x0000, 0x007c,
1502 0x0007, 0x1078, 0x4689, 0x0078, 0x4733, 0x0078, 0x472d, 0x2200, 1732 0x2200, 0x0079, 0x44f3, 0x4577, 0x450c, 0x450c, 0x450c, 0x450c,
1503 0x0079, 0x3dca, 0x3dcf, 0x3dcf, 0x3dcf, 0x3dd1, 0x3dcf, 0x1078, 1733 0x45ba, 0x45ba, 0x45ba, 0x45ba, 0x45ba, 0x45ba, 0x45ba, 0x45ba,
1504 0x23eb, 0x70a7, 0x3dd5, 0x0078, 0x4739, 0x2011, 0x0018, 0x1078, 1734 0x450c, 0x450c, 0x450c, 0x450c, 0x45ba, 0x450c, 0x450c, 0x45ba,
1505 0x42eb, 0x0079, 0x3ddb, 0x3de0, 0x2459, 0x3b96, 0x3de2, 0x3de4, 1735 0x45ba, 0x45ba, 0x45ba, 0x4577, 0x6827, 0x0093, 0x2009, 0x000b,
1506 0x1078, 0x23eb, 0x1078, 0x23eb, 0x1078, 0x23eb, 0x2200, 0x0079, 1736 0x2001, 0x4300, 0x0078, 0x4593, 0xa684, 0x0004, 0x00c0, 0x4528,
1507 0x3de9, 0x3dee, 0x3df0, 0x3df0, 0x3dee, 0x3dee, 0x1078, 0x23eb, 1737 0x6804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x4781, 0x1078,
1508 0x78e4, 0xa084, 0x0008, 0x0040, 0x3e05, 0x70a7, 0x3df9, 0x0078, 1738 0x45d3, 0x6807, 0x0117, 0x1078, 0x3bc6, 0x2001, 0x0002, 0x007c,
1509 0x4739, 0x2011, 0x0004, 0x1078, 0x42eb, 0x0079, 0x3dff, 0x3e05, 1739 0x6000, 0xa084, 0x0004, 0x0040, 0x4781, 0x2d58, 0x6804, 0xa084,
1510 0x2459, 0x3b96, 0x3e05, 0x3e0f, 0x3e13, 0x70ab, 0x3e0d, 0x2001, 1740 0x00ff, 0xa086, 0x0006, 0x00c0, 0x4537, 0x6807, 0x0117, 0x6827,
1511 0x0003, 0x1078, 0x4689, 0x0078, 0x4733, 0x0078, 0x472d, 0x70ab, 1741 0x0002, 0x1078, 0x4812, 0x6827, 0x0036, 0x6932, 0x2d00, 0x682e,
1512 0x3e05, 0x0078, 0x2459, 0x70ab, 0x3e17, 0x0078, 0x2459, 0x0078, 1742 0x0d7e, 0x1078, 0x3ba5, 0x1078, 0x45d3, 0x2b68, 0x1078, 0x3bc6,
1513 0x3e0d, 0xa282, 0x0003, 0x0050, 0x3e1f, 0x1078, 0x23eb, 0xa386, 1743 0x0d7f, 0x1078, 0x3bc6, 0x2001, 0x0002, 0x007c, 0x6000, 0xa084,
1514 0x0002, 0x00c0, 0x3e38, 0xa286, 0x0002, 0x00c0, 0x3e3e, 0x78a0, 1744 0x0004, 0x0040, 0x4781, 0x6a04, 0xa294, 0x00ff, 0xa286, 0x0006,
1515 0xa005, 0x00c0, 0x3e3e, 0xa484, 0x8000, 0x00c0, 0x3e3e, 0x78e4, 1745 0x00c0, 0x455c, 0x6807, 0x0117, 0x6827, 0x0002, 0x2d58, 0x1078,
1516 0xa084, 0x0008, 0x0040, 0x3e38, 0xa6b5, 0x0008, 0x2019, 0x0000, 1746 0x4812, 0x6827, 0x0036, 0x6932, 0x2d00, 0x682e, 0x0d7e, 0x1078,
1517 0xa684, 0x0008, 0x0040, 0x3e3e, 0x1078, 0x417c, 0x6810, 0x70be, 1747 0x3bb5, 0x1078, 0x45d3, 0x2b68, 0x1078, 0x3bc6, 0x0d7f, 0x1078,
1518 0x7003, 0x0007, 0x2300, 0x0079, 0x3e45, 0x3e48, 0x3e75, 0x3e7d, 1748 0x3bc6, 0x2001, 0x0002, 0x007c, 0x1078, 0x4781, 0x007c, 0x70b4,
1519 0x2200, 0x0079, 0x3e4b, 0x3e50, 0x3e4e, 0x3e69, 0x1078, 0x23eb, 1749 0xa080, 0x00cd, 0x781a, 0x2001, 0x0001, 0x1078, 0x4797, 0x1078,
1520 0x7990, 0xa1ac, 0x0007, 0xa026, 0x2011, 0x0001, 0x1078, 0x42f1, 1750 0x4805, 0x7003, 0x0000, 0x2001, 0x0002, 0x007c, 0x1078, 0x47c7,
1521 0x0079, 0x3e5a, 0x3e5f, 0x2459, 0x3b96, 0x3e67, 0x3e61, 0x0078, 1751 0x1078, 0x47fe, 0x1078, 0x43d5, 0x1078, 0x42cd, 0x1078, 0x4805,
1522 0x472d, 0x70ab, 0x3e65, 0x0078, 0x2459, 0x0078, 0x3e5f, 0x1078, 1752 0x2001, 0x0001, 0x007c, 0x1078, 0x47c7, 0x1078, 0x47fe, 0x1078,
1523 0x23eb, 0xa684, 0x0010, 0x0040, 0x3e73, 0x1078, 0x419f, 0x0040, 1753 0x43d5, 0x70b4, 0xa080, 0x00cd, 0x781a, 0x2001, 0x0013, 0x1078,
1524 0x3e73, 0x0078, 0x2459, 0x0078, 0x420c, 0x2200, 0x0079, 0x3e78, 1754 0x4797, 0x1078, 0x4805, 0x7003, 0x0000, 0x2001, 0x0002, 0x007c,
1525 0x3e7b, 0x3e7b, 0x3e7b, 0x1078, 0x23eb, 0x2200, 0x0079, 0x3e80, 1755 0x1078, 0x4781, 0x007c, 0x1078, 0x47c7, 0x1078, 0x47fe, 0x1078,
1526 0x3e83, 0x3e85, 0x3e85, 0x1078, 0x23eb, 0x78e4, 0xa084, 0x0008, 1756 0x43d5, 0x1078, 0x42cd, 0x1078, 0x4805, 0x1078, 0x484d, 0x2001,
1527 0x0040, 0x3e9a, 0x70a7, 0x3e8e, 0x0078, 0x4739, 0x2011, 0x0004, 1757 0x0001, 0x007c, 0x2001, 0x0003, 0x007c, 0x1078, 0x468e, 0x2001,
1528 0x1078, 0x42eb, 0x0079, 0x3e94, 0x3e9a, 0x2459, 0x3b96, 0x3e9a, 1758 0x0000, 0x007c, 0x0c7e, 0x077e, 0x6f14, 0x1078, 0x37b0, 0x077f,
1529 0x3ea4, 0x3ea8, 0x70ab, 0x3ea2, 0x2001, 0x0003, 0x1078, 0x4689, 1759 0x0c7f, 0x2001, 0x0000, 0x007c, 0x1078, 0x47c7, 0x1078, 0x4781,
1530 0x0078, 0x4733, 0x0078, 0x472d, 0x70ab, 0x3e9a, 0x0078, 0x2459, 1760 0x2001, 0x0006, 0x007c, 0x6904, 0xa18c, 0x00ff, 0xa186, 0x0007,
1531 0x70ab, 0x3eac, 0x0078, 0x2459, 0x0078, 0x3ea2, 0x2300, 0x0079, 1761 0x0040, 0x45de, 0xa186, 0x000f, 0x00c0, 0x45e2, 0x1078, 0x47fe,
1532 0x3eb1, 0x3eb6, 0x3eb8, 0x3eb4, 0x1078, 0x23eb, 0x70a4, 0x007a, 1762 0x1078, 0x43d5, 0x70b4, 0xa080, 0x00cd, 0x781a, 0x1078, 0x4805,
1533 0x70a4, 0x007a, 0xa282, 0x0002, 0x0050, 0x3ec0, 0x1078, 0x23eb, 1763 0x7003, 0x0000, 0x007c, 0x7aa8, 0xa294, 0x00ff, 0x78a8, 0xa084,
1534 0xa684, 0x0200, 0x0040, 0x3eca, 0x1078, 0x46f8, 0x1078, 0x42d3, 1764 0x00ff, 0xa08a, 0x0004, 0x00c8, 0x4781, 0x1079, 0x45f8, 0x007c,
1535 0x1078, 0x46ff, 0x2300, 0x0079, 0x3ecd, 0x3ed0, 0x3ef4, 0x3f5a, 1765 0x4781, 0x45fc, 0x4781, 0x4695, 0xa282, 0x0003, 0x0040, 0x4603,
1536 0xa286, 0x0001, 0x0040, 0x3ed6, 0x1078, 0x23eb, 0xa684, 0x0200, 1766 0x1078, 0x4781, 0x007c, 0x7da8, 0xa5ac, 0x00ff, 0x7ca8, 0xa4a4,
1537 0x0040, 0x3ede, 0x1078, 0x46f8, 0x1078, 0x46ff, 0x2001, 0x0001, 1767 0x00ff, 0x69b8, 0xa184, 0x0100, 0x0040, 0x4642, 0xa18c, 0xfeff,
1538 0x1078, 0x4691, 0x78b8, 0xa084, 0xc001, 0x0040, 0x3ef0, 0x7848, 1768 0x69ba, 0x78a0, 0xa005, 0x00c0, 0x4642, 0xa4a4, 0x00ff, 0x0040,
1539 0xa085, 0x0008, 0x784a, 0x7848, 0xa084, 0x0008, 0x00c0, 0x3eeb, 1769 0x4636, 0xa482, 0x000c, 0x0040, 0x461f, 0x00c8, 0x4629, 0x852b,
1540 0x7003, 0x0000, 0x0078, 0x3b96, 0x2200, 0x0079, 0x3ef7, 0x3ef9, 1770 0x852b, 0x1078, 0x382e, 0x0040, 0x4629, 0x1078, 0x3627, 0x0078,
1541 0x3f2a, 0x70a7, 0x3efd, 0x0078, 0x4739, 0x2011, 0x000d, 0x1078, 1771 0x4638, 0x1078, 0x4760, 0x1078, 0x3652, 0x69b8, 0xa18d, 0x0100,
1542 0x42eb, 0x0079, 0x3f03, 0x3f0a, 0x2459, 0x3b96, 0x3f12, 0x3f1a, 1772 0x69ba, 0xa6b5, 0x1000, 0x7e5a, 0x0078, 0x463b, 0x1078, 0x3652,
1543 0x3f20, 0x3f22, 0xa6b4, 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a, 1773 0xa6b4, 0xefff, 0x7e5a, 0x70b4, 0xa080, 0x0091, 0x781a, 0x2001,
1544 0x0078, 0x4727, 0xa6b4, 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a, 1774 0x0001, 0x007c, 0x0c7e, 0x1078, 0x4682, 0x6200, 0xd2e4, 0x0040,
1545 0x0078, 0x4727, 0x70ab, 0x3f1e, 0x0078, 0x2459, 0x0078, 0x3f0a, 1775 0x4673, 0x6208, 0x8217, 0xa294, 0x00ff, 0xa282, 0x000c, 0x0048,
1546 0x1078, 0x23eb, 0x70ab, 0x3f26, 0x0078, 0x2459, 0x1078, 0x473f, 1776 0x4655, 0x0040, 0x4655, 0x2011, 0x000c, 0x2400, 0xa202, 0x00c8,
1547 0x0078, 0x2459, 0x70a7, 0x3f2e, 0x0078, 0x4739, 0x2011, 0x0012, 1777 0x465a, 0x2220, 0x6208, 0xa294, 0x00ff, 0x701c, 0xa202, 0x00c8,
1548 0x1078, 0x42eb, 0x0079, 0x3f34, 0x3f3a, 0x2459, 0x3b96, 0x3f46, 1778 0x4662, 0x721c, 0x2200, 0xa502, 0x00c8, 0x4667, 0x2228, 0x1078,
1549 0x3f4e, 0x3f54, 0xa6b4, 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a, 1779 0x4764, 0x852b, 0x852b, 0x1078, 0x382e, 0x0040, 0x4673, 0x1078,
1550 0x70b4, 0xa080, 0x00a6, 0x781a, 0x0078, 0x2459, 0xa6b4, 0x00ff, 1780 0x362e, 0x0078, 0x4677, 0x1078, 0x4760, 0x1078, 0x3659, 0xa6b5,
1551 0xa6b5, 0x0400, 0x6eb6, 0x7e5a, 0x0078, 0x4727, 0x70ab, 0x3f52, 1781 0x1000, 0x7e5a, 0x70b4, 0xa080, 0x00b9, 0x781a, 0x2001, 0x0004,
1552 0x0078, 0x2459, 0x0078, 0x3f3a, 0x70ab, 0x3f58, 0x0078, 0x2459, 1782 0x0c7f, 0x007c, 0x007e, 0x6814, 0x8007, 0xa084, 0x000f, 0x8003,
1553 0x0078, 0x3f46, 0xa286, 0x0001, 0x0040, 0x3f60, 0x1078, 0x23eb, 1783 0x8003, 0x8003, 0xa0e0, 0x5480, 0x007f, 0x007c, 0x0c7e, 0x1078,
1554 0x70a7, 0x3f64, 0x0078, 0x4739, 0x2011, 0x0015, 0x1078, 0x42eb, 1784 0x4682, 0x1078, 0x3659, 0x0c7f, 0x007c, 0xa282, 0x0002, 0x00c0,
1555 0x0079, 0x3f6a, 0x3f6f, 0x2459, 0x3b96, 0x3f7d, 0x3f89, 0xa6b4, 1785 0x4781, 0x7aa8, 0xa294, 0x00ff, 0x69b8, 0xa184, 0x0200, 0x0040,
1556 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a, 0x783b, 0x1301, 0x70b4, 1786 0x46cc, 0xa18c, 0xfdff, 0x69ba, 0x78a0, 0xa005, 0x00c0, 0x46cc,
1557 0xa080, 0x00b4, 0x781a, 0x0078, 0x2459, 0xa6b4, 0x00ff, 0xa6b5, 1787 0xa282, 0x0002, 0x00c8, 0x376b, 0x1078, 0x472a, 0x1078, 0x36f9,
1558 0x0400, 0x6eb6, 0x7e5a, 0x70b4, 0xa080, 0x00a6, 0x781a, 0x0078, 1788 0x1078, 0x3652, 0xa684, 0x0100, 0x0040, 0x46c2, 0x682c, 0xa084,
1559 0x2459, 0x70ab, 0x3f8d, 0x0078, 0x2459, 0x0078, 0x3f6f, 0xa282, 1789 0x0001, 0x0040, 0x46c2, 0xc6fc, 0x7888, 0xa084, 0x0040, 0x0040,
1560 0x0003, 0x0050, 0x3f95, 0x1078, 0x23eb, 0x2300, 0x0079, 0x3f98, 1790 0x46c2, 0xc6fd, 0xa6b5, 0x1000, 0x7e5a, 0x70b4, 0xa080, 0x0091,
1561 0x3f9b, 0x3fd2, 0x402d, 0xa286, 0x0001, 0x0040, 0x3fa1, 0x1078, 1791 0x781a, 0x2001, 0x0001, 0x007c, 0x0c7e, 0x1078, 0x4682, 0xa284,
1562 0x23eb, 0x6804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x3fae, 1792 0xfffe, 0x0040, 0x46d7, 0x2011, 0x0001, 0x0078, 0x46db, 0xa284,
1563 0x1078, 0x3af8, 0x7003, 0x0000, 0x0078, 0x3b96, 0x683b, 0x0000, 1793 0x0001, 0x0040, 0x46e1, 0x6100, 0xd1ec, 0x00c0, 0x46e1, 0x2011,
1564 0x6837, 0x0000, 0xa684, 0x0200, 0x0040, 0x3fbc, 0x1078, 0x46f8, 1794 0x0000, 0x1078, 0x471c, 0x1078, 0x3700, 0x1078, 0x3659, 0xa684,
1565 0x1078, 0x42d3, 0x1078, 0x46ff, 0x2001, 0x0001, 0x1078, 0x4691, 1795 0x0100, 0x0040, 0x46f7, 0x682c, 0xa084, 0x0001, 0x0040, 0x46f7,
1566 0x78b8, 0xa084, 0xc001, 0x0040, 0x3fce, 0x7848, 0xa085, 0x0008, 1796 0xc6fc, 0x7888, 0xa084, 0x0040, 0x0040, 0x46f7, 0xc6fd, 0xa6b5,
1567 0x784a, 0x7848, 0xa084, 0x0008, 0x00c0, 0x3fc9, 0x7003, 0x0000, 1797 0x1000, 0x7e5a, 0x70b4, 0xa080, 0x00b9, 0x781a, 0x2001, 0x0004,
1568 0x0078, 0x3b96, 0x2200, 0x0079, 0x3fd5, 0x3fd7, 0x4008, 0x70a7, 1798 0x0c7f, 0x007c, 0x0c7e, 0x2960, 0x6000, 0x2011, 0x0001, 0xa084,
1569 0x3fdb, 0x0078, 0x4739, 0x2011, 0x000d, 0x1078, 0x42eb, 0x0079, 1799 0x2000, 0x00c0, 0x470d, 0x2011, 0x0000, 0x78ab, 0x0001, 0x78ab,
1570 0x3fe1, 0x3fe8, 0x2459, 0x3b96, 0x3ff0, 0x3ff8, 0x3ffe, 0x4000, 1800 0x0002, 0x78ab, 0x0003, 0x7aaa, 0xa8c0, 0x0004, 0x68b8, 0xa085,
1571 0xa6b4, 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x4727, 1801 0x0200, 0x68ba, 0x0c7f, 0x007c, 0x789b, 0x0018, 0x78ab, 0x0001,
1572 0xa6b4, 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x4727, 1802 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0081, 0x78ab,
1573 0x70ab, 0x3ffc, 0x0078, 0x2459, 0x0078, 0x3fe8, 0x1078, 0x23eb, 1803 0x0004, 0x007c, 0x0c7e, 0x7054, 0x2060, 0x6000, 0xa084, 0x1000,
1574 0x70ab, 0x4004, 0x0078, 0x2459, 0x1078, 0x473f, 0x0078, 0x2459, 1804 0x00c0, 0x4738, 0x2029, 0x0032, 0x2021, 0x0000, 0x0078, 0x4758,
1575 0x70a7, 0x400c, 0x0078, 0x4739, 0x2011, 0x0005, 0x1078, 0x42eb, 1805 0x6508, 0xa5ac, 0x00ff, 0x7018, 0xa086, 0x0028, 0x00c0, 0x4748,
1576 0x0079, 0x4012, 0x4017, 0x2459, 0x3b96, 0x401f, 0x4027, 0xa6b4, 1806 0xa582, 0x0019, 0x00c8, 0x474e, 0x2029, 0x0019, 0x0078, 0x474e,
1577 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x4727, 0xa6b4, 1807 0xa582, 0x000c, 0x00c8, 0x474e, 0x2029, 0x000c, 0x6408, 0x8427,
1578 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x4727, 0x70ab, 1808 0xa4a4, 0x00ff, 0xa482, 0x000c, 0x0048, 0x4758, 0x2021, 0x000c,
1579 0x402b, 0x0078, 0x2459, 0x0078, 0x4017, 0xa286, 0x0001, 0x0040, 1809 0x1078, 0x4764, 0x68b8, 0xa085, 0x0100, 0x68ba, 0x0c7f, 0x007c,
1580 0x4033, 0x1078, 0x23eb, 0x70a7, 0x4037, 0x0078, 0x4739, 0x2011, 1810 0x2021, 0x0000, 0x2029, 0x0032, 0x789b, 0x0018, 0x78ab, 0x0001,
1581 0x0006, 0x1078, 0x42eb, 0x0079, 0x403d, 0x4042, 0x2459, 0x3b96, 1811 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa, 0x7caa, 0x789b, 0x0081,
1582 0x4048, 0x4052, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x4727, 1812 0x78ab, 0x0005, 0x007c, 0x2001, 0x0003, 0x1078, 0x478f, 0xa6b5,
1583 0xa6b4, 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0xa6b5, 0x4000, 0x7e5a, 1813 0x1000, 0x7e5a, 0x70b4, 0xa080, 0x00b9, 0x781a, 0x2001, 0x0005,
1584 0x0078, 0x4727, 0x70ab, 0x4056, 0x0078, 0x2459, 0x0078, 0x4042, 1814 0x007c, 0x2001, 0x0007, 0x1078, 0x478f, 0xa6b5, 0x1000, 0x7e5a,
1585 0x2300, 0x0079, 0x405b, 0x4060, 0x405e, 0x405e, 0x1078, 0x23eb, 1815 0x70b4, 0xa080, 0x00b9, 0x781a, 0x2001, 0x0004, 0x007c, 0x789b,
1586 0x1078, 0x23eb, 0x2300, 0x71a8, 0xa005, 0x017a, 0x6810, 0x70be, 1816 0x0018, 0x78aa, 0x789b, 0x0081, 0x78ab, 0x0001, 0x007c, 0x6904,
1587 0xa282, 0x0003, 0x0050, 0x406e, 0x1078, 0x23eb, 0x2300, 0x0079, 1817 0xa18c, 0x00ff, 0xa196, 0x0007, 0x0040, 0x47a5, 0xa196, 0x000f,
1588 0x4071, 0x4074, 0x4082, 0x40a4, 0xa684, 0x0200, 0x0040, 0x407c, 1818 0x0040, 0x47a5, 0x1078, 0x19ac, 0x007c, 0x6924, 0xa194, 0x003f,
1589 0x1078, 0x46f8, 0x1078, 0x46ff, 0x2001, 0x0001, 0x1078, 0x4691, 1819 0x00c0, 0x47ae, 0xa18c, 0xffc0, 0xa105, 0x6826, 0x1078, 0x3bc6,
1590 0x0078, 0x2459, 0xa296, 0x0002, 0x0040, 0x408b, 0x82ff, 0x0040, 1820 0x691c, 0xa184, 0x0100, 0x0040, 0x47bb, 0x6914, 0x1078, 0x3c3b,
1591 0x408b, 0x1078, 0x23eb, 0x70a7, 0x408f, 0x0078, 0x4739, 0x2011, 1821 0x6204, 0x8210, 0x6206, 0x007c, 0x692c, 0x6834, 0x682e, 0xa112,
1592 0x0018, 0x1078, 0x42eb, 0x0079, 0x4095, 0x409a, 0x2459, 0x3b96, 1822 0x6930, 0x6838, 0x6832, 0xa11b, 0xa200, 0xa301, 0x007c, 0x0c7e,
1593 0x409c, 0x409e, 0x0078, 0x4727, 0x0078, 0x4727, 0x70ab, 0x40a2, 1823 0xade0, 0x0018, 0x6003, 0x0070, 0x6106, 0x600b, 0x0000, 0x600f,
1594 0x0078, 0x2459, 0x0078, 0x409a, 0x2200, 0x0079, 0x40a7, 0x40a9, 1824 0x0a00, 0x6013, 0x0000, 0x6017, 0x0000, 0x8007, 0x601a, 0x601f,
1595 0x40c2, 0x70a7, 0x40ad, 0x0078, 0x4739, 0x2011, 0x0017, 0x1078, 1825 0x0000, 0x6023, 0x0000, 0x0c7f, 0x6824, 0xa085, 0x0080, 0x6826,
1596 0x42eb, 0x0079, 0x40b3, 0x40b8, 0x2459, 0x3b96, 0x40ba, 0x40bc, 1826 0x007c, 0x157e, 0x137e, 0x147e, 0x2098, 0xaf80, 0x002d, 0x20a0,
1597 0x0078, 0x4727, 0x0078, 0x4727, 0x70ab, 0x40c0, 0x0078, 0x2459, 1827 0x81ac, 0x0040, 0x47ec, 0x53a6, 0xa184, 0x0001, 0x0040, 0x47f2,
1598 0x0078, 0x40b8, 0xa484, 0x8000, 0x00c0, 0x410c, 0xa684, 0x0100, 1828 0x3304, 0x78be, 0x147f, 0x137f, 0x157f, 0x007c, 0x70b0, 0xa005,
1599 0x0040, 0x40d6, 0x1078, 0x46f8, 0x1078, 0x42d3, 0x1078, 0x46ff, 1829 0x10c0, 0x248c, 0x70b3, 0x8000, 0x0078, 0x4b4b, 0x71b0, 0x81ff,
1600 0x7848, 0xa085, 0x000c, 0x784a, 0x0078, 0x40da, 0x78d8, 0x78d2, 1830 0x0040, 0x4804, 0x1078, 0x4c41, 0x007c, 0x71b0, 0x81ff, 0x0040,
1601 0x78dc, 0x78d6, 0xa6b4, 0xefff, 0x7e5a, 0x70a7, 0x40e1, 0x0078, 1831 0x4811, 0x7848, 0xa085, 0x0008, 0x784a, 0x70b3, 0x0000, 0x1078,
1602 0x4739, 0x2011, 0x000d, 0x1078, 0x42eb, 0x0079, 0x40e7, 0x40ee, 1832 0x4887, 0x007c, 0x0c7e, 0x0d7e, 0x1078, 0x1989, 0x00c0, 0x481a,
1603 0x2459, 0x3b96, 0x40ee, 0x40fc, 0x4102, 0x4104, 0xa684, 0x0100, 1833 0x1078, 0x248c, 0x0c7f, 0x157e, 0x137e, 0x147e, 0x2da0, 0x2c98,
1604 0x0040, 0x40fa, 0x1078, 0x46b6, 0x682c, 0x78d2, 0x6830, 0x78d6, 1834 0x20a9, 0x0031, 0x53a3, 0x147f, 0x137f, 0x157f, 0x6807, 0x010d,
1605 0x1078, 0x46f0, 0x0078, 0x4727, 0x70ab, 0x4100, 0x0078, 0x2459, 1835 0x680b, 0x0000, 0x7004, 0x8007, 0x681a, 0x6823, 0x0000, 0x681f,
1606 0x0078, 0x40ee, 0x1078, 0x23eb, 0x70ab, 0x4108, 0x0078, 0x2459, 1836 0x0000, 0x689f, 0x0000, 0x0c7f, 0x007c, 0x70b4, 0xa080, 0x0091,
1607 0x1078, 0x473f, 0x0078, 0x2459, 0x1078, 0x46ff, 0x70ab, 0x4116, 1837 0x781a, 0x0078, 0x24fa, 0x70b4, 0xa080, 0x0081, 0x781a, 0x0078,
1608 0x2001, 0x0003, 0x1078, 0x4689, 0x0078, 0x4733, 0x1078, 0x46f0, 1838 0x24fa, 0x70b4, 0xa080, 0x00b9, 0x781a, 0x0078, 0x24fa, 0x70b4,
1609 0x682c, 0x78d2, 0x6830, 0x78d6, 0x0078, 0x4727, 0x70b8, 0x6812, 1839 0xa080, 0x00c3, 0x781a, 0x0078, 0x24fa, 0x6904, 0xa18c, 0x00ff,
1610 0x70be, 0x8000, 0x70ba, 0x681b, 0x0000, 0xa684, 0x0008, 0x0040, 1840 0xa196, 0x0007, 0x0040, 0x485a, 0xa196, 0x000f, 0x0040, 0x485a,
1611 0x4141, 0x157e, 0x137e, 0x147e, 0x7890, 0x8004, 0x8004, 0x8004, 1841 0x6807, 0x0117, 0x6824, 0xa084, 0x00ff, 0xa085, 0x0200, 0x6826,
1612 0x8004, 0xa084, 0x000f, 0x681a, 0x80ac, 0x789b, 0x0000, 0xaf80, 1842 0x8007, 0x789b, 0x000e, 0x78aa, 0x6820, 0xa085, 0x8000, 0x6822,
1613 0x002b, 0x2098, 0xad80, 0x000b, 0x20a0, 0x53a5, 0x147f, 0x137f, 1843 0x2031, 0x0400, 0x6eb6, 0x7e5a, 0x71b4, 0xa188, 0x0091, 0x791a,
1614 0x157f, 0xa6c4, 0x0f00, 0xa684, 0x0002, 0x00c0, 0x4150, 0x692c, 1844 0x007c, 0x1078, 0x4805, 0x7848, 0xa085, 0x000c, 0x784a, 0x70b4,
1615 0x810d, 0x810d, 0x810d, 0xa184, 0x0007, 0x2008, 0x0078, 0x415f, 1845 0xa080, 0x00cd, 0x781a, 0x2009, 0x000b, 0x2001, 0x4400, 0x1078,
1616 0x789b, 0x0010, 0x79ac, 0xa184, 0x0020, 0x0040, 0x415f, 0x017e, 1846 0x47c7, 0x2001, 0x0013, 0x1078, 0x4797, 0x0078, 0x3c68, 0x127e,
1617 0x2009, 0x0005, 0x2001, 0x3d00, 0x1078, 0x46c1, 0x017f, 0xa184, 1847 0x2091, 0x2200, 0x2049, 0x4887, 0x7000, 0x7204, 0xa205, 0x720c,
1618 0x001f, 0xa805, 0x6816, 0x1078, 0x3b69, 0x68be, 0xa684, 0x0004, 1848 0xa215, 0x7008, 0xa084, 0xfff7, 0xa205, 0x0040, 0x4899, 0x0078,
1619 0x0040, 0x4170, 0xa18c, 0xff00, 0x78a8, 0xa084, 0x00ff, 0xa105, 1849 0x489e, 0x7003, 0x0000, 0x127f, 0x2000, 0x007c, 0x7000, 0xa084,
1620 0x682a, 0xa6b4, 0x00ff, 0x6000, 0xa084, 0x0008, 0x0040, 0x417a, 1850 0x0001, 0x00c0, 0x48cc, 0x7108, 0x8103, 0x00c8, 0x48ab, 0x1078,
1621 0xa6b5, 0x4000, 0x6eb6, 0x007c, 0x157e, 0x137e, 0x147e, 0x6918, 1851 0x49ce, 0x0078, 0x48a3, 0x700c, 0xa08c, 0x00ff, 0x0040, 0x48cc,
1622 0x7890, 0x8004, 0x8004, 0x8004, 0x8004, 0xa084, 0x000f, 0x007e, 1852 0x7004, 0x8004, 0x00c8, 0x48c3, 0x7014, 0xa005, 0x00c0, 0x48bf,
1623 0xa100, 0x681a, 0x007f, 0x8000, 0x8004, 0x0040, 0x419b, 0x20a8, 1853 0x7010, 0xa005, 0x0040, 0x48c3, 0xa102, 0x00c8, 0x48a3, 0x7007,
1624 0x8104, 0xa080, 0x000b, 0xad00, 0x20a0, 0x789b, 0x0000, 0xaf80, 1854 0x0010, 0x0078, 0x48cc, 0x8aff, 0x0040, 0x48cc, 0x1078, 0x4c18,
1625 0x002b, 0x2098, 0x53a5, 0x147f, 0x137f, 0x157f, 0x007c, 0x682c, 1855 0x00c0, 0x48c6, 0x0040, 0x48a3, 0x1078, 0x4957, 0x7003, 0x0000,
1626 0xa084, 0x0020, 0x00c0, 0x41a7, 0x620c, 0x0078, 0x41a8, 0x6210, 1856 0x127f, 0x2000, 0x007c, 0x017e, 0x6104, 0xa18c, 0x00ff, 0xa186,
1627 0x6b18, 0x2300, 0xa202, 0x0040, 0x41c8, 0x2018, 0xa382, 0x000e, 1857 0x0007, 0x0040, 0x48df, 0xa18e, 0x000f, 0x00c0, 0x48e2, 0x6040,
1628 0x0048, 0x41b8, 0x0040, 0x41b8, 0x2019, 0x000e, 0x0078, 0x41bc, 1858 0x0078, 0x48e3, 0x6428, 0x017f, 0x84ff, 0x0040, 0x490d, 0x2c70,
1629 0x7858, 0xa084, 0xffef, 0x785a, 0x783b, 0x1b01, 0x7893, 0x0000, 1859 0x7004, 0xa0bc, 0x000f, 0xa7b8, 0x491d, 0x273c, 0x87fb, 0x00c0,
1630 0x7ba2, 0x70b4, 0xa080, 0x008e, 0x781a, 0xa085, 0x0001, 0x007c, 1860 0x48fb, 0x0048, 0x48f5, 0x1078, 0x248c, 0x609c, 0xa075, 0x0040,
1631 0x7858, 0xa084, 0xffef, 0x785a, 0x7893, 0x0000, 0xa006, 0x007c, 1861 0x490d, 0x0078, 0x48e8, 0x2704, 0xae68, 0x6808, 0xa630, 0x680c,
1632 0x6904, 0xa18c, 0x00ff, 0xa196, 0x0007, 0x0040, 0x41dd, 0xa196, 1862 0xa529, 0x8421, 0x0040, 0x490d, 0x8738, 0x2704, 0xa005, 0x00c0,
1633 0x000f, 0x0040, 0x41dd, 0x6807, 0x0117, 0x6914, 0x1078, 0x3b69, 1863 0x48fc, 0x709c, 0xa075, 0x00c0, 0x48e8, 0x007c, 0x0000, 0x0005,
1634 0x6100, 0x8104, 0x00c8, 0x41f8, 0x601c, 0xa005, 0x0040, 0x41ec, 1864 0x0009, 0x000d, 0x0011, 0x0015, 0x0019, 0x001d, 0x0000, 0x0003,
1635 0x2001, 0x0800, 0x0078, 0x41fa, 0x0d7e, 0x6824, 0x007e, 0x1078, 1865 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0000, 0x4912, 0x490f,
1636 0x4708, 0x007f, 0x6826, 0x2d00, 0x682e, 0x1078, 0x3af8, 0x0d7f, 1866 0x0000, 0x0000, 0x8000, 0x0000, 0x4912, 0x0000, 0x491a, 0x4917,
1637 0x2001, 0x0200, 0x6826, 0x8007, 0x789b, 0x000e, 0x78aa, 0x6820, 1867 0x0000, 0x0000, 0x0000, 0x0000, 0x491a, 0x0000, 0x4915, 0x4915,
1638 0xa085, 0x8000, 0x6822, 0x2031, 0x0400, 0x6eb6, 0x7e5a, 0x71b4, 1868 0x0000, 0x0000, 0x8000, 0x0000, 0x4915, 0x0000, 0x491b, 0x491b,
1639 0xa188, 0x0091, 0x791a, 0x007c, 0xa6c4, 0x0f00, 0xa684, 0x0002, 1869 0x0000, 0x0000, 0x0000, 0x0000, 0x491b, 0x127e, 0x2091, 0x2200,
1640 0x00c0, 0x4220, 0x692c, 0x810d, 0x810d, 0x810d, 0xa184, 0x0007, 1870 0x2079, 0x5200, 0x2071, 0x0010, 0x7007, 0x000a, 0x7007, 0x0002,
1641 0x2008, 0xa805, 0x6816, 0x1078, 0x3b69, 0x68be, 0x0078, 0x4223, 1871 0x7003, 0x0000, 0x2071, 0x0020, 0x7007, 0x000a, 0x7007, 0x0002,
1642 0x6914, 0x1078, 0x3b69, 0x6100, 0x8104, 0x00c8, 0x4280, 0xa184, 1872 0x7003, 0x0000, 0x2049, 0x0000, 0x127f, 0x2000, 0x007c, 0x2049,
1643 0x0300, 0x0040, 0x422f, 0x6807, 0x0117, 0x0078, 0x424d, 0x6004, 1873 0x4957, 0x2019, 0x0000, 0x7004, 0x8004, 0x00c8, 0x49aa, 0x7007,
1644 0xa005, 0x00c0, 0x4256, 0x6807, 0x0117, 0x601c, 0xa005, 0x00c0, 1874 0x0012, 0x7108, 0x7008, 0xa106, 0x00c0, 0x4961, 0xa184, 0x01e0,
1645 0x4243, 0x0d7e, 0x1078, 0x4708, 0x6827, 0x0034, 0x2d00, 0x682e, 1875 0x0040, 0x496c, 0x1078, 0x248c, 0x2001, 0x04fd, 0x2004, 0xa082,
1646 0x1078, 0x3af8, 0x0d7f, 0xa684, 0x0004, 0x0040, 0x424d, 0x2031, 1876 0x0005, 0x00c8, 0x4977, 0xa184, 0x4000, 0x00c0, 0x4961, 0xa19c,
1647 0x0400, 0x2001, 0x2800, 0x0078, 0x4251, 0x2031, 0x0400, 0x2001, 1877 0x300c, 0xa386, 0x2004, 0x0040, 0x4985, 0xa386, 0x0008, 0x0040,
1648 0x0800, 0x71b4, 0xa188, 0x0091, 0x0078, 0x42ae, 0x6018, 0xa005, 1878 0x4990, 0xa386, 0x200c, 0x00c0, 0x4961, 0x7200, 0x8204, 0x0048,
1649 0x00c0, 0x4243, 0x601c, 0xa005, 0x00c0, 0x4243, 0x689f, 0x0000, 1879 0x4990, 0x730c, 0xa384, 0x00ff, 0x0040, 0x4990, 0x1078, 0x248c,
1650 0x6827, 0x003d, 0xa684, 0x0001, 0x0040, 0x42bc, 0xd694, 0x00c0, 1880 0x7007, 0x0012, 0x7000, 0xa084, 0x0001, 0x00c0, 0x49aa, 0x7008,
1651 0x4279, 0x6100, 0xd1d4, 0x0040, 0x4279, 0x692c, 0x81ff, 0x0040, 1881 0xa084, 0x01e0, 0x00c0, 0x49aa, 0x7310, 0x7014, 0xa305, 0x0040,
1652 0x42bc, 0xa186, 0x0003, 0x0040, 0x42bc, 0xa186, 0x0012, 0x0040, 1882 0x49aa, 0x710c, 0xa184, 0x0300, 0x00c0, 0x49aa, 0xa184, 0x00ff,
1653 0x42bc, 0xa6b5, 0x0800, 0x71b4, 0xa188, 0x00af, 0x0078, 0x42b7, 1883 0x00c0, 0x4957, 0x7007, 0x0012, 0x7007, 0x0008, 0x7004, 0xa084,
1654 0x6807, 0x0117, 0x2031, 0x0400, 0x692c, 0xa18c, 0x00ff, 0xa186, 1884 0x0008, 0x00c0, 0x49ae, 0x7007, 0x0012, 0x7108, 0x8103, 0x0048,
1655 0x0012, 0x00c0, 0x4291, 0x2001, 0x42c9, 0x2009, 0x0001, 0x0078, 1885 0x49b3, 0x7003, 0x0000, 0x2049, 0x0000, 0x007c, 0x107e, 0x007e,
1656 0x42a2, 0xa186, 0x0003, 0x00c0, 0x429b, 0x2001, 0x42ca, 0x2009, 1886 0x127e, 0x157e, 0x2091, 0x2200, 0x7108, 0x1078, 0x49ce, 0x157f,
1657 0x0012, 0x0078, 0x42a2, 0x2001, 0x0200, 0x71b4, 0xa188, 0x0091, 1887 0x127f, 0x2091, 0x8001, 0x007f, 0x107f, 0x007c, 0x7204, 0x7500,
1658 0x0078, 0x42ae, 0x1078, 0x46db, 0x78a3, 0x0000, 0x681c, 0xa085, 1888 0x730c, 0xa384, 0x0300, 0x00c0, 0x49f5, 0xa184, 0x01e0, 0x00c0,
1659 0x0040, 0x681e, 0x71b4, 0xa188, 0x00df, 0xa006, 0x6826, 0x8007, 1889 0x4a19, 0x7108, 0xa184, 0x01e0, 0x00c0, 0x4a19, 0x2001, 0x04fd,
1660 0x789b, 0x000e, 0x78aa, 0x6820, 0xa085, 0x8000, 0x6822, 0x6eb6, 1890 0x2004, 0xa082, 0x0005, 0x00c8, 0x49e9, 0xa184, 0x4000, 0x00c0,
1661 0x7e5a, 0x791a, 0x0078, 0x2459, 0x6eb6, 0x1078, 0x3af8, 0x6810, 1891 0x49d9, 0xa184, 0x0007, 0x0079, 0x49ed, 0x49f7, 0x4a09, 0x49f5,
1662 0x70be, 0x7003, 0x0007, 0x70a3, 0x0000, 0x704b, 0x0000, 0x0078, 1892 0x4a09, 0x49f5, 0x4a55, 0x49f5, 0x4a53, 0x1078, 0x248c, 0x7004,
1663 0x2459, 0x0023, 0x0070, 0x0005, 0x0000, 0x0a00, 0x0000, 0x0000, 1893 0xa084, 0x0010, 0xa085, 0x0002, 0x7006, 0x8aff, 0x00c0, 0x4a04,
1664 0x0025, 0x0000, 0x0000, 0x683b, 0x0000, 0x6837, 0x0000, 0xa684, 1894 0x2049, 0x0000, 0x0078, 0x4a08, 0x1078, 0x4c18, 0x00c0, 0x4a04,
1665 0x0200, 0x0040, 0x42ea, 0x78b8, 0xa08c, 0x001f, 0xa084, 0x8000, 1895 0x007c, 0x7004, 0xa084, 0x0010, 0xa085, 0x0002, 0x7006, 0x8aff,
1666 0x0040, 0x42e3, 0x8108, 0x78d8, 0xa100, 0x6836, 0x78dc, 0xa081, 1896 0x00c0, 0x4a14, 0x0078, 0x4a18, 0x1078, 0x4c18, 0x00c0, 0x4a14,
1667 0x0000, 0x683a, 0x007c, 0x7990, 0x810f, 0xa5ac, 0x0007, 0x2021, 1897 0x007c, 0x7007, 0x0012, 0x7108, 0x00e0, 0x4a1c, 0x2091, 0x6000,
1668 0x0000, 0xa480, 0x0010, 0x789a, 0x79a8, 0xa18c, 0x00ff, 0xa184, 1898 0x00e0, 0x4a20, 0x2091, 0x6000, 0x7007, 0x0012, 0x7007, 0x0008,
1669 0x0080, 0x00c0, 0x4319, 0xa182, 0x0020, 0x00c8, 0x4337, 0xa182, 1899 0x7004, 0xa084, 0x0008, 0x00c0, 0x4a28, 0x7007, 0x0012, 0x7108,
1670 0x0012, 0x00c8, 0x467b, 0x2100, 0x1079, 0x4307, 0x007c, 0x467b, 1900 0x8103, 0x0048, 0x4a2d, 0x7003, 0x0000, 0x7000, 0xa005, 0x00c0,
1671 0x44e8, 0x467b, 0x467b, 0x4344, 0x4347, 0x4381, 0x43b7, 0x43eb, 1901 0x4a41, 0x7004, 0xa005, 0x00c0, 0x4a41, 0x700c, 0xa005, 0x0040,
1672 0x43ee, 0x467b, 0x467b, 0x43a2, 0x4412, 0x444c, 0x467b, 0x467b, 1902 0x4a43, 0x0078, 0x4a24, 0x2049, 0x0000, 0x1078, 0x38d7, 0x6818,
1673 0x4473, 0xa184, 0x0020, 0x00c0, 0x44a7, 0xa18c, 0x001f, 0x6814, 1903 0xa084, 0x8000, 0x0040, 0x4a4e, 0x681b, 0x0002, 0x007c, 0x1078,
1674 0xa084, 0x001f, 0xa106, 0x0040, 0x4334, 0x70b4, 0xa080, 0x00d2, 1904 0x248c, 0x1078, 0x248c, 0x1078, 0x4ab1, 0x7210, 0x7114, 0x700c,
1675 0x781a, 0x2001, 0x0014, 0x1078, 0x4691, 0x1078, 0x46ff, 0x7003, 1905 0xa09c, 0x00ff, 0x2800, 0xa300, 0xa211, 0xa189, 0x0000, 0x1078,
1676 0x0000, 0x2001, 0x0002, 0x007c, 0x2001, 0x0000, 0x007c, 0xa182, 1906 0x4ab1, 0x2704, 0x2c58, 0xac60, 0x6308, 0x2200, 0xa322, 0x630c,
1677 0x0024, 0x00c8, 0x467b, 0xa184, 0x0003, 0x1079, 0x4307, 0x007c, 1907 0x2100, 0xa31b, 0x2400, 0xa305, 0x0040, 0x4a78, 0x00c8, 0x4a78,
1678 0x467b, 0x467b, 0x467b, 0x467b, 0x1078, 0x467b, 0x007c, 0x2200, 1908 0x8412, 0x8210, 0x830a, 0xa189, 0x0000, 0x2b60, 0x0078, 0x4a5f,
1679 0x0079, 0x434a, 0x4476, 0x4476, 0x436e, 0x436e, 0x436e, 0x436e, 1909 0x2b60, 0x8a07, 0x007e, 0x6004, 0xa084, 0x0008, 0x0040, 0x4a84,
1680 0x436e, 0x436e, 0x436e, 0x436e, 0x436c, 0x436e, 0x4363, 0x436e, 1910 0xa7ba, 0x4917, 0x0078, 0x4a86, 0xa7ba, 0x490f, 0x007f, 0xa73d,
1681 0x436e, 0x436e, 0x436e, 0x436e, 0x4376, 0x4379, 0x4476, 0x4379, 1911 0x2c00, 0x6886, 0x6f8a, 0x6c92, 0x6b8e, 0x7007, 0x0012, 0x1078,
1682 0x436e, 0x436e, 0x436e, 0x0c7e, 0x077e, 0x6f14, 0x1078, 0x36e2, 1912 0x4957, 0x007c, 0x8738, 0x2704, 0xa005, 0x00c0, 0x4aa5, 0x609c,
1683 0x077f, 0x0c7f, 0x0078, 0x436e, 0x1078, 0x458b, 0x6827, 0x02b3, 1913 0xa005, 0x0040, 0x4aae, 0x2060, 0x6004, 0xa084, 0x000f, 0xa080,
1684 0x2009, 0x000b, 0x2001, 0x4800, 0x0078, 0x44aa, 0x1078, 0x4670, 1914 0x491d, 0x203c, 0x87fb, 0x1040, 0x248c, 0x8a51, 0x0040, 0x4aad,
1685 0x007c, 0x6827, 0x0093, 0x2009, 0x000b, 0x2001, 0x4800, 0x0078, 1915 0x7008, 0xa084, 0x0003, 0xa086, 0x0003, 0x007c, 0x2051, 0x0000,
1686 0x4492, 0x2d58, 0x6804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 1916 0x007c, 0x8a50, 0x8739, 0x2704, 0xa004, 0x00c0, 0x4ac5, 0x6000,
1687 0x438b, 0x6807, 0x0117, 0x6827, 0x0002, 0x1078, 0x4708, 0x6827, 1917 0xa064, 0x00c0, 0x4abc, 0x2d60, 0x6004, 0xa084, 0x000f, 0xa080,
1688 0x0036, 0x6932, 0x2d00, 0x682e, 0x0d7e, 0x1078, 0x3ac8, 0x1078, 1918 0x492d, 0x203c, 0x87fb, 0x1040, 0x248c, 0x007c, 0x127e, 0x0d7e,
1689 0x44d0, 0x2b68, 0x1078, 0x3af8, 0x0d7f, 0x1078, 0x3af8, 0x2001, 1919 0x2091, 0x2200, 0x0d7f, 0x6884, 0x2060, 0x6888, 0x6b8c, 0x6c90,
1690 0x0002, 0x007c, 0x1078, 0x44d0, 0x2001, 0x0017, 0x1078, 0x4691, 1920 0x8057, 0xaad4, 0x00ff, 0xa084, 0x00ff, 0x007e, 0x6804, 0xa084,
1691 0x70a3, 0x0000, 0x2009, 0x5138, 0x200b, 0x0006, 0x70af, 0x0017, 1921 0x0008, 0x007f, 0x0040, 0x4ae0, 0xa0b8, 0x4917, 0x0078, 0x4ae2,
1692 0x2009, 0x0200, 0x1078, 0x3a06, 0x2001, 0x0001, 0x007c, 0x2200, 1922 0xa0b8, 0x490f, 0x7e08, 0xa6b5, 0x000c, 0x6904, 0xa18c, 0x00ff,
1693 0x0079, 0x43ba, 0x4476, 0x44a7, 0x44a7, 0x44a7, 0x43db, 0x44b7, 1923 0xa186, 0x0007, 0x0040, 0x4af0, 0xa18e, 0x000f, 0x00c0, 0x4af9,
1694 0x43e3, 0x44b7, 0x44b7, 0x44ba, 0x44ba, 0x44bf, 0x44bf, 0x43d3, 1924 0x681c, 0xa084, 0x0040, 0x0040, 0x4b00, 0xa6b5, 0x0001, 0x0078,
1695 0x43d3, 0x44a7, 0x44a7, 0x44b7, 0x44a7, 0x43e3, 0x4476, 0x43e3, 1925 0x4b00, 0x681c, 0xa084, 0x0040, 0x0040, 0x4b00, 0xa6b5, 0x0001,
1696 0x43e3, 0x43e3, 0x43e3, 0x6827, 0x0084, 0x2009, 0x000b, 0x2001, 1926 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x4b02, 0x2400,
1697 0x4300, 0x0078, 0x44c9, 0x6827, 0x000d, 0x2009, 0x000b, 0x2001, 1927 0xa305, 0x00c0, 0x4b0d, 0x0078, 0x4b33, 0x2c58, 0x2704, 0x6104,
1698 0x4300, 0x0078, 0x44aa, 0x6827, 0x0093, 0x2009, 0x000b, 0x2001, 1928 0xac60, 0x6000, 0xa400, 0x701a, 0x6004, 0xa301, 0x701e, 0xa184,
1699 0x4300, 0x0078, 0x4492, 0x2001, 0x0000, 0x007c, 0x2200, 0x0079, 1929 0x0008, 0x0040, 0x4b23, 0x6010, 0xa081, 0x0000, 0x7022, 0x6014,
1700 0x43f1, 0x4476, 0x440a, 0x440a, 0x440a, 0x440a, 0x44b7, 0x44b7, 1930 0xa081, 0x0000, 0x7026, 0x6208, 0x2400, 0xa202, 0x7012, 0x620c,
1701 0x44b7, 0x44b7, 0x44b7, 0x44b7, 0x44b7, 0x44b7, 0x440a, 0x440a, 1931 0x2300, 0xa203, 0x7016, 0x7602, 0x7007, 0x0001, 0x2b60, 0x1078,
1702 0x440a, 0x440a, 0x44b7, 0x440a, 0x440a, 0x44b7, 0x44b7, 0x44b7, 1932 0x4a92, 0x0078, 0x4b35, 0x1078, 0x4c18, 0x00c0, 0x4b33, 0x127f,
1703 0x44b7, 0x4476, 0x6827, 0x0093, 0x2009, 0x000b, 0x2001, 0x4300, 1933 0x2000, 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x7007,
1704 0x0078, 0x4492, 0xa684, 0x0004, 0x00c0, 0x4426, 0x6804, 0xa084, 1934 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x4b41, 0x7003, 0x0008,
1705 0x00ff, 0xa086, 0x0006, 0x00c0, 0x467b, 0x1078, 0x44d0, 0x6807, 1935 0x127f, 0x2000, 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f,
1706 0x0117, 0x1078, 0x3af8, 0x2001, 0x0002, 0x007c, 0x6000, 0xa084, 1936 0x2049, 0x4b4b, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0,
1707 0x0004, 0x0040, 0x467b, 0x2d58, 0x6804, 0xa084, 0x00ff, 0xa086, 1937 0x4b54, 0x7e08, 0xa6b5, 0x000c, 0x6904, 0xa18c, 0x00ff, 0xa186,
1708 0x0006, 0x00c0, 0x4435, 0x6807, 0x0117, 0x6827, 0x0002, 0x1078, 1938 0x0007, 0x0040, 0x4b67, 0xa18e, 0x000f, 0x00c0, 0x4b72, 0x681c,
1709 0x4708, 0x6827, 0x0036, 0x6932, 0x2d00, 0x682e, 0x0d7e, 0x1078, 1939 0xa084, 0x0040, 0x0040, 0x4b6e, 0xa6b5, 0x0001, 0x6840, 0x2050,
1710 0x3ad7, 0x1078, 0x44d0, 0x2b68, 0x1078, 0x3af8, 0x0d7f, 0x1078, 1940 0x0078, 0x4b7b, 0x681c, 0xa084, 0x0020, 0x00c0, 0x4b79, 0xa6b5,
1711 0x3af8, 0x2001, 0x0002, 0x007c, 0x6000, 0xa084, 0x0004, 0x0040, 1941 0x0001, 0x6828, 0x2050, 0x2d60, 0x6004, 0xa0bc, 0x000f, 0xa7b8,
1712 0x467b, 0x2d58, 0x6a04, 0xa294, 0x00ff, 0xa286, 0x0006, 0x00c0, 1942 0x491d, 0x273c, 0x87fb, 0x00c0, 0x4b8f, 0x0048, 0x4b89, 0x1078,
1713 0x445b, 0x6807, 0x0117, 0x6827, 0x0002, 0x2d58, 0x1078, 0x4708, 1943 0x248c, 0x689c, 0xa065, 0x0040, 0x4b93, 0x0078, 0x4b7c, 0x1078,
1714 0x6827, 0x0036, 0x6932, 0x2d00, 0x682e, 0x0d7e, 0x1078, 0x3ae7, 1944 0x4c18, 0x00c0, 0x4b8f, 0x127f, 0x2000, 0x007c, 0x127e, 0x007e,
1715 0x1078, 0x44d0, 0x2b68, 0x1078, 0x3af8, 0x0d7f, 0x1078, 0x3af8, 1945 0x017e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x037f, 0x047f, 0x7e08,
1716 0x2001, 0x0002, 0x007c, 0x1078, 0x467b, 0x007c, 0x70b4, 0xa080, 1946 0xa6b5, 0x000c, 0x6904, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040,
1717 0x00d2, 0x781a, 0x2001, 0x0001, 0x1078, 0x4691, 0x1078, 0x46ff, 1947 0x4bad, 0xa18e, 0x000f, 0x00c0, 0x4bb6, 0x681c, 0xa084, 0x0040,
1718 0x7003, 0x0000, 0x2001, 0x0002, 0x007c, 0x1078, 0x46c1, 0x1078, 1948 0x0040, 0x4bbd, 0xa6b5, 0x0001, 0x0078, 0x4bbd, 0x681c, 0xa084,
1719 0x46f8, 0x1078, 0x42d3, 0x1078, 0x41d0, 0x1078, 0x46ff, 0x2001, 1949 0x0040, 0x0040, 0x4bbd, 0xa6b5, 0x0001, 0x2049, 0x4b96, 0x017e,
1720 0x0001, 0x007c, 0x1078, 0x46c1, 0x1078, 0x46f8, 0x1078, 0x42d3, 1950 0x6904, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x4bcb, 0xa18e,
1721 0x70b4, 0xa080, 0x00d2, 0x781a, 0x2001, 0x0013, 0x1078, 0x4691, 1951 0x000f, 0x00c0, 0x4bce, 0x6840, 0x0078, 0x4bcf, 0x6828, 0x017f,
1722 0x1078, 0x46ff, 0x7003, 0x0000, 0x2001, 0x0002, 0x007c, 0x1078, 1952 0xa055, 0x0040, 0x4c15, 0x2d70, 0x2e60, 0x7004, 0xa0bc, 0x000f,
1723 0x467b, 0x007c, 0x1078, 0x46c1, 0x1078, 0x46f8, 0x1078, 0x42d3, 1953 0xa7b8, 0x491d, 0x273c, 0x87fb, 0x00c0, 0x4be9, 0x0048, 0x4be2,
1724 0x1078, 0x41d0, 0x1078, 0x46ff, 0x2001, 0x0001, 0x007c, 0x2001, 1954 0x1078, 0x248c, 0x709c, 0xa075, 0x2060, 0x0040, 0x4c15, 0x0078,
1725 0x0003, 0x007c, 0x1078, 0x458b, 0x2001, 0x0000, 0x007c, 0x0c7e, 1955 0x4bd5, 0x2704, 0xae68, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0048,
1726 0x077e, 0x6f14, 0x1078, 0x36e2, 0x077f, 0x0c7f, 0x2001, 0x0000, 1956 0x4c02, 0x8a51, 0x00c0, 0x4bf6, 0x1078, 0x248c, 0x8738, 0x2704,
1727 0x007c, 0x1078, 0x46c1, 0x1078, 0x467b, 0x2001, 0x0006, 0x007c, 1957 0xa005, 0x00c0, 0x4bea, 0x709c, 0xa075, 0x2060, 0x0040, 0x4c15,
1728 0x6904, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x44db, 0xa186, 1958 0x0078, 0x4bd5, 0x8422, 0x8420, 0x831a, 0xa399, 0x0000, 0x6908,
1729 0x000f, 0x00c0, 0x44df, 0x1078, 0x46f8, 0x1078, 0x42d3, 0x70b4, 1959 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x00c8, 0x4c11, 0x1078,
1730 0xa080, 0x00d2, 0x781a, 0x1078, 0x46ff, 0x7003, 0x0000, 0x007c, 1960 0x248c, 0x2071, 0x0020, 0x0078, 0x4b00, 0x127f, 0x2000, 0x007c,
1731 0x7aa8, 0xa294, 0x00ff, 0x78a8, 0xa084, 0x00ff, 0xa08a, 0x0004, 1961 0x7008, 0xa084, 0x0003, 0xa086, 0x0003, 0x0040, 0x4c40, 0x2704,
1732 0x00c8, 0x467b, 0x1079, 0x44f5, 0x007c, 0x467b, 0x44f9, 0x467b, 1962 0xac08, 0x2104, 0x701a, 0x8108, 0x2104, 0x701e, 0x8108, 0x2104,
1733 0x4592, 0xa282, 0x0003, 0x0040, 0x4500, 0x1078, 0x467b, 0x007c, 1963 0x7012, 0x8108, 0x2104, 0x7016, 0x6004, 0xa084, 0x0008, 0x0040,
1734 0x7da8, 0xa5ac, 0x00ff, 0x7ca8, 0xa4a4, 0x00ff, 0x69b8, 0xa184, 1964 0x4c37, 0x8108, 0x2104, 0x7022, 0x8108, 0x2104, 0x7026, 0x7602,
1735 0x0100, 0x0040, 0x453f, 0xa18c, 0xfeff, 0x69ba, 0x78a0, 0xa005, 1965 0x7004, 0xa084, 0x0010, 0xa085, 0x0001, 0x7006, 0x1078, 0x4a92,
1736 0x00c0, 0x453f, 0xa4a4, 0x00ff, 0x0040, 0x4533, 0xa482, 0x000c, 1966 0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091, 0x2200, 0x2049, 0x4c41,
1737 0x0040, 0x451c, 0x00c8, 0x4526, 0x852b, 0x852b, 0x1078, 0x3760, 1967 0x0d7f, 0x087f, 0x7108, 0xa184, 0x0003, 0x00c0, 0x4c6b, 0x017e,
1738 0x0040, 0x4526, 0x1078, 0x355b, 0x0078, 0x4535, 0x1078, 0x465d, 1968 0x6904, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x4c5b, 0xa18e,
1739 0x1078, 0x3586, 0x69b8, 0xa18d, 0x0100, 0x69ba, 0xa6b5, 0x1000, 1969 0x000f, 0x00c0, 0x4c5e, 0x6840, 0x0078, 0x4c5f, 0x6828, 0x017f,
1740 0x7e5a, 0x0078, 0x4538, 0x1078, 0x3586, 0xa6b4, 0xefff, 0x7e5a, 1970 0xa005, 0x0040, 0x4c79, 0x0078, 0x489e, 0x0020, 0x4c6b, 0x1078,
1741 0x70b4, 0xa080, 0x0091, 0x781a, 0x2001, 0x0001, 0x007c, 0x0c7e, 1971 0x4a55, 0x0078, 0x4c79, 0x00a0, 0x4c72, 0x7108, 0x1078, 0x49ce,
1742 0x1078, 0x457f, 0x6200, 0xd2e4, 0x0040, 0x4570, 0x6208, 0x8217, 1972 0x0078, 0x4c4a, 0x7007, 0x0010, 0x00a0, 0x4c74, 0x7108, 0x1078,
1743 0xa294, 0x00ff, 0xa282, 0x000c, 0x0048, 0x4552, 0x0040, 0x4552, 1973 0x49ce, 0x7008, 0xa086, 0x0008, 0x00c0, 0x4c4a, 0x7000, 0xa005,
1744 0x2011, 0x000c, 0x2400, 0xa202, 0x00c8, 0x4557, 0x2220, 0x6208, 1974 0x00c0, 0x4c4a, 0x7003, 0x0000, 0x2049, 0x0000, 0x127f, 0x2000,
1745 0xa294, 0x00ff, 0x701c, 0xa202, 0x00c8, 0x455f, 0x721c, 0x2200, 1975 0x007c, 0x127e, 0x147e, 0x137e, 0x157e, 0x0c7e, 0x0d7e, 0x2091,
1746 0xa502, 0x00c8, 0x4564, 0x2228, 0x1078, 0x4661, 0x852b, 0x852b, 1976 0x2200, 0x0d7f, 0x2049, 0x4c89, 0xad80, 0x0011, 0x20a0, 0x2099,
1747 0x1078, 0x3760, 0x0040, 0x4570, 0x1078, 0x3562, 0x0078, 0x4574, 1977 0x0031, 0x700c, 0xa084, 0x00ff, 0x682a, 0x7007, 0x0008, 0x7007,
1748 0x1078, 0x465d, 0x1078, 0x358d, 0xa6b5, 0x1000, 0x7e5a, 0x70b4, 1978 0x0002, 0x7003, 0x0001, 0x0040, 0x4ca8, 0x8000, 0x80ac, 0x53a5,
1749 0xa080, 0x00be, 0x781a, 0x2001, 0x0004, 0x0c7f, 0x007c, 0x007e, 1979 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x4caa, 0x0c7f,
1750 0x6814, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e0, 1980 0x2049, 0x0000, 0x7003, 0x0000, 0x157f, 0x137f, 0x147f, 0x127f,
1751 0x5380, 0x007f, 0x007c, 0x0c7e, 0x1078, 0x457f, 0x1078, 0x358d, 1981 0x2000, 0x007c, 0x2091, 0x6000, 0x2091, 0x8000, 0x78cc, 0xa005,
1752 0x0c7f, 0x007c, 0xa282, 0x0002, 0x00c0, 0x467b, 0x7aa8, 0xa294, 1982 0x0040, 0x4cd1, 0x7994, 0x70d0, 0xa106, 0x00c0, 0x4cd1, 0x7804,
1753 0x00ff, 0x69b8, 0xa184, 0x0200, 0x0040, 0x45c9, 0xa18c, 0xfdff, 1983 0xa005, 0x0040, 0x4cd1, 0x7807, 0x0000, 0x0068, 0x4cd1, 0x2091,
1754 0x69ba, 0x78a0, 0xa005, 0x00c0, 0x45c9, 0xa282, 0x0002, 0x00c8, 1984 0x4080, 0x7820, 0x8001, 0x7822, 0x00c0, 0x4d2c, 0x7824, 0x7822,
1755 0x369d, 0x1078, 0x4627, 0x1078, 0x362b, 0x1078, 0x3586, 0xa684, 1985 0x2069, 0x5240, 0x6800, 0xa084, 0x0007, 0x0040, 0x4cef, 0xa086,
1756 0x0100, 0x0040, 0x45bf, 0x682c, 0xa084, 0x0001, 0x0040, 0x45bf, 1986 0x0002, 0x0040, 0x4cef, 0x6834, 0xa00d, 0x0040, 0x4cef, 0x2104,
1757 0xc6fc, 0x7888, 0xa084, 0x0040, 0x0040, 0x45bf, 0xc6fd, 0xa6b5, 1987 0xa005, 0x0040, 0x4cef, 0x8001, 0x200a, 0x0040, 0x4dd4, 0x7848,
1758 0x1000, 0x7e5a, 0x70b4, 0xa080, 0x0091, 0x781a, 0x2001, 0x0001, 1988 0xa005, 0x0040, 0x4cfd, 0x8001, 0x784a, 0x00c0, 0x4cfd, 0x2009,
1759 0x007c, 0x0c7e, 0x1078, 0x457f, 0xa284, 0xfffe, 0x0040, 0x45d4, 1989 0x0102, 0x6844, 0x200a, 0x1078, 0x226f, 0x6890, 0xa005, 0x0040,
1760 0x2011, 0x0001, 0x0078, 0x45d8, 0xa284, 0x0001, 0x0040, 0x45de, 1990 0x4d09, 0x8001, 0x6892, 0x00c0, 0x4d09, 0x686f, 0x0000, 0x6873,
1761 0x6100, 0xd1ec, 0x00c0, 0x45de, 0x2011, 0x0000, 0x1078, 0x4619, 1991 0x0001, 0x2061, 0x5500, 0x20a9, 0x0100, 0x2009, 0x0002, 0x6034,
1762 0x1078, 0x3632, 0x1078, 0x358d, 0xa684, 0x0100, 0x0040, 0x45f4, 1992 0xa005, 0x0040, 0x4d1f, 0x8001, 0x6036, 0x00c0, 0x4d1f, 0x6010,
1763 0x682c, 0xa084, 0x0001, 0x0040, 0x45f4, 0xc6fc, 0x7888, 0xa084, 1993 0xa005, 0x0040, 0x4d1f, 0x017e, 0x1078, 0x226f, 0x017f, 0xace0,
1764 0x0040, 0x0040, 0x45f4, 0xc6fd, 0xa6b5, 0x1000, 0x7e5a, 0x70b4, 1994 0x0010, 0x0070, 0x4d25, 0x0078, 0x4d0f, 0x8109, 0x0040, 0x4d2c,
1765 0xa080, 0x00be, 0x781a, 0x2001, 0x0004, 0x0c7f, 0x007c, 0x0c7e, 1995 0x20a9, 0x0100, 0x0078, 0x4d0f, 0x1078, 0x4d39, 0x1078, 0x4d5e,
1766 0x2960, 0x6000, 0x2011, 0x0001, 0xa084, 0x2000, 0x00c0, 0x460a, 1996 0x2009, 0x5251, 0x2104, 0x2009, 0x0102, 0x200a, 0x2091, 0x8001,
1767 0x2011, 0x0000, 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003, 1997 0x007c, 0x7834, 0x8001, 0x7836, 0x00c0, 0x4d5d, 0x7838, 0x7836,
1768 0x7aaa, 0xa8c0, 0x0004, 0x68b8, 0xa085, 0x0200, 0x68ba, 0x0c7f, 1998 0x2091, 0x8000, 0x7844, 0xa005, 0x00c0, 0x4d48, 0x2001, 0x0101,
1769 0x007c, 0x789b, 0x0018, 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, 1999 0x8001, 0x7846, 0xa080, 0x7500, 0x2040, 0x2004, 0xa065, 0x0040,
1770 0x0003, 0x7aaa, 0x789b, 0x0081, 0x78ab, 0x0004, 0x007c, 0x0c7e, 2000 0x4d5d, 0x6024, 0xa005, 0x0040, 0x4d59, 0x8001, 0x6026, 0x0040,
1771 0x7054, 0x2060, 0x6000, 0xa084, 0x1000, 0x00c0, 0x4635, 0x2029, 2001 0x4d8d, 0x6000, 0x2c40, 0x0078, 0x4d4e, 0x007c, 0x7828, 0x8001,
1772 0x0032, 0x2021, 0x0000, 0x0078, 0x4655, 0x6508, 0xa5ac, 0x00ff, 2002 0x782a, 0x00c0, 0x4d8c, 0x782c, 0x782a, 0x7830, 0xa005, 0x00c0,
1773 0x7018, 0xa086, 0x0028, 0x00c0, 0x4645, 0xa582, 0x0019, 0x00c8, 2003 0x4d6b, 0x2001, 0x0200, 0x8001, 0x7832, 0x8003, 0x8003, 0x8003,
1774 0x464b, 0x2029, 0x0019, 0x0078, 0x464b, 0xa582, 0x000c, 0x00c8, 2004 0x8003, 0xa090, 0x5500, 0xa298, 0x0002, 0x2304, 0xa084, 0x0008,
1775 0x464b, 0x2029, 0x000c, 0x6408, 0x8427, 0xa4a4, 0x00ff, 0xa482, 2005 0x0040, 0x4d8c, 0xa290, 0x0009, 0x2204, 0xa005, 0x0040, 0x4d84,
1776 0x000c, 0x0048, 0x4655, 0x2021, 0x000c, 0x1078, 0x4661, 0x68b8, 2006 0x8001, 0x2012, 0x00c0, 0x4d8c, 0x2304, 0xa084, 0xfff7, 0xa085,
1777 0xa085, 0x0100, 0x68ba, 0x0c7f, 0x007c, 0x2021, 0x0000, 0x2029, 2007 0x0080, 0x201a, 0x1078, 0x226f, 0x007c, 0x2069, 0x5240, 0x6800,
1778 0x0032, 0x789b, 0x0018, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 2008 0xa005, 0x0040, 0x4d97, 0x6848, 0xac06, 0x0040, 0x4dd4, 0x601b,
1779 0x0001, 0x7daa, 0x7caa, 0x789b, 0x0081, 0x78ab, 0x0005, 0x007c, 2009 0x0006, 0x60b4, 0xa084, 0x3f00, 0x601e, 0x6020, 0xa084, 0x00ff,
1780 0x2001, 0x0003, 0x1078, 0x4689, 0x70b4, 0xa080, 0x00be, 0x781a, 2010 0xa085, 0x0060, 0x6022, 0x6000, 0x2042, 0x6714, 0x6f82, 0x1078,
1781 0x2001, 0x0005, 0x007c, 0x2001, 0x0007, 0x1078, 0x4689, 0xa6b5, 2011 0x19c5, 0x6818, 0xa005, 0x0040, 0x4daf, 0x8001, 0x681a, 0x6808,
1782 0x1000, 0x7e5a, 0x70b4, 0xa080, 0x00be, 0x781a, 0x2001, 0x0004, 2012 0xa084, 0xffef, 0x680a, 0x6810, 0x8001, 0x00d0, 0x4db9, 0x1078,
1783 0x007c, 0x789b, 0x0018, 0x78aa, 0x789b, 0x0081, 0x78ab, 0x0001, 2013 0x248c, 0x6812, 0x602f, 0x0000, 0x6033, 0x0000, 0x2c68, 0x1078,
1784 0x007c, 0x6904, 0xa18c, 0x00ff, 0xa196, 0x0007, 0x0040, 0x469f, 2014 0x1cdc, 0x2069, 0x5240, 0x7944, 0xa184, 0x0100, 0x2001, 0x0006,
1785 0xa196, 0x000f, 0x0040, 0x469f, 0x1078, 0x195a, 0x007c, 0x6924, 2015 0x686e, 0x00c0, 0x4dcf, 0x6986, 0x2001, 0x0004, 0x686e, 0x1078,
1786 0xa194, 0x003f, 0x00c0, 0x46a8, 0xa18c, 0xffc0, 0xa105, 0x6826, 2016 0x226a, 0x2091, 0x8001, 0x007c, 0x2069, 0x0100, 0x2009, 0x5240,
1787 0x1078, 0x3af8, 0x691c, 0xa184, 0x0100, 0x0040, 0x46b5, 0x6914, 2017 0x2104, 0xa084, 0x0007, 0x0040, 0x4e30, 0xa086, 0x0007, 0x00c0,
1788 0x1078, 0x3b69, 0x6204, 0x8210, 0x6206, 0x007c, 0x692c, 0x6834, 2018 0x4dea, 0x0d7e, 0x2009, 0x5252, 0x216c, 0x1078, 0x3b1c, 0x0d7f,
1789 0x682e, 0xa112, 0x6930, 0x6838, 0x6832, 0xa11b, 0xa200, 0xa301, 2019 0x0078, 0x4e30, 0x2009, 0x5252, 0x2164, 0x1078, 0x2437, 0x601b,
1790 0x007c, 0x0c7e, 0xade0, 0x0018, 0x6003, 0x0070, 0x6106, 0x600b, 2020 0x0006, 0x6858, 0xa084, 0x3f00, 0x601e, 0x6020, 0xa084, 0x00ff,
1791 0x0000, 0x600f, 0x0a00, 0x6013, 0x0000, 0x6017, 0x0000, 0x8007, 2021 0xa085, 0x0048, 0x6022, 0x602f, 0x0000, 0x6033, 0x0000, 0x6830,
1792 0x601a, 0x601f, 0x0000, 0x6023, 0x0000, 0x0c7f, 0x6824, 0xa085, 2022 0xa084, 0x0040, 0x0040, 0x4e24, 0x684b, 0x0004, 0x20a9, 0x0014,
1793 0x0080, 0x6826, 0x007c, 0x157e, 0x137e, 0x147e, 0x2098, 0xaf80, 2023 0x6848, 0xa084, 0x0004, 0x0040, 0x4e11, 0x0070, 0x4e11, 0x0078,
1794 0x002d, 0x20a0, 0x81ac, 0x0040, 0x46e6, 0x53a6, 0xa184, 0x0001, 2024 0x4e08, 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0001,
1795 0x0040, 0x46ec, 0x3304, 0x78be, 0x147f, 0x137f, 0x157f, 0x007c, 2025 0x0040, 0x4e1e, 0x0070, 0x4e1e, 0x0078, 0x4e15, 0x20a9, 0x00fa,
1796 0x70b0, 0xa005, 0x10c0, 0x23eb, 0x70b3, 0x8000, 0x0078, 0x4a3a, 2026 0x0070, 0x4e24, 0x0078, 0x4e20, 0x6808, 0xa084, 0xfffd, 0x680a,
1797 0x71b0, 0x81ff, 0x0040, 0x46fe, 0x1078, 0x4b30, 0x007c, 0x71b0, 2027 0x681b, 0x0048, 0x2009, 0x525b, 0x200b, 0x0007, 0x784c, 0x784a,
1798 0x81ff, 0x0040, 0x4707, 0x70b3, 0x0000, 0x1078, 0x4776, 0x007c, 2028 0x2091, 0x8001, 0x007c, 0x2079, 0x5200, 0x1078, 0x4e5e, 0x1078,
1799 0x0c7e, 0x0d7e, 0x1078, 0x1937, 0x0c7f, 0x157e, 0x137e, 0x147e, 2029 0x4e42, 0x1078, 0x4e50, 0x7833, 0x0000, 0x7847, 0x0000, 0x784b,
1800 0x2da0, 0x2c98, 0x20a9, 0x0031, 0x53a3, 0x147f, 0x137f, 0x157f, 2030 0x0000, 0x007c, 0x2019, 0x0003, 0x2011, 0x5246, 0x2204, 0xa086,
1801 0x6807, 0x010d, 0x680b, 0x0000, 0x7004, 0x8007, 0x681a, 0x6823, 2031 0x003c, 0x0040, 0x4e4d, 0x2019, 0x0002, 0x7b2a, 0x7b2e, 0x007c,
1802 0x0000, 0x681f, 0x0000, 0x689f, 0x0000, 0x0c7f, 0x007c, 0x70b4, 2032 0x2019, 0x0039, 0x2011, 0x5246, 0x2204, 0xa086, 0x003c, 0x0040,
1803 0xa080, 0x0091, 0x781a, 0x0078, 0x2459, 0x70b4, 0xa080, 0x0081, 2033 0x4e5b, 0x2019, 0x0027, 0x7b36, 0x7b3a, 0x007c, 0x2019, 0x3971,
1804 0x781a, 0x0078, 0x2459, 0x70b4, 0xa080, 0x00be, 0x781a, 0x0078, 2034 0x2011, 0x5246, 0x2204, 0xa086, 0x003c, 0x0040, 0x4e69, 0x2019,
1805 0x2459, 0x70b4, 0xa080, 0x00c8, 0x781a, 0x0078, 0x2459, 0x6904, 2035 0x2626, 0x7b22, 0x7b26, 0x783f, 0x0000, 0x7843, 0x000a, 0x007c,
1806 0xa18c, 0x00ff, 0xa196, 0x0007, 0x0040, 0x474c, 0xa196, 0x000f, 2036 0x0020, 0x002b, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1807 0x0040, 0x474c, 0x6807, 0x0117, 0x2001, 0x0200, 0x6826, 0x8007, 2037 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1808 0x789b, 0x000e, 0x78aa, 0x6820, 0xa085, 0x8000, 0x6822, 0x2031, 2038 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1809 0x0400, 0x6eb6, 0x7e5a, 0x71b4, 0xa188, 0x0091, 0x791a, 0x007c, 2039 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1810 0x1078, 0x46ff, 0x7848, 0xa085, 0x000c, 0x784a, 0x70b4, 0xa080, 2040 0x0000, 0x0020, 0x0000, 0x0014, 0x0014, 0x9849, 0x0014, 0x0014,
1811 0x00d2, 0x781a, 0x2009, 0x000b, 0x2001, 0x4400, 0x1078, 0x46c1, 2041 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0080, 0x000f, 0x0000,
1812 0x2001, 0x0013, 0x1078, 0x4691, 0x0078, 0x3b96, 0x127e, 0x2091, 2042 0x0201, 0x0604, 0x0c08, 0x2120, 0x4022, 0xf880, 0x0018, 0x300b,
1813 0x2200, 0x2049, 0x4776, 0x7000, 0x7204, 0xa205, 0x720c, 0xa215, 2043 0xa201, 0x0014, 0xa200, 0x0014, 0xa200, 0x0214, 0x0000, 0x006c,
1814 0x7008, 0xa084, 0xfff7, 0xa205, 0x0040, 0x4788, 0x0078, 0x478d, 2044 0x0002, 0x0014, 0x98cd, 0x009e, 0x0093, 0xa202, 0x8838, 0x3806,
1815 0x7003, 0x0000, 0x127f, 0x2000, 0x007c, 0x7000, 0xa084, 0x0001, 2045 0x8839, 0x20c3, 0x0864, 0x9885, 0x28c1, 0x9cae, 0xa203, 0x300c,
1816 0x00c0, 0x47bb, 0x7108, 0x8103, 0x00c8, 0x479a, 0x1078, 0x48bd, 2046 0x2846, 0x8161, 0x846a, 0x8300, 0x1856, 0x883a, 0x9865, 0x28f2,
1817 0x0078, 0x4792, 0x700c, 0xa08c, 0x00ff, 0x0040, 0x47bb, 0x7004, 2047 0x9c91, 0x9858, 0x300c, 0x28e1, 0x9c91, 0x2802, 0xa206, 0x64c3,
1818 0x8004, 0x00c8, 0x47b2, 0x7014, 0xa005, 0x00c0, 0x47ae, 0x7010, 2048 0x282e, 0xa207, 0x64a0, 0x6de0, 0x67a0, 0x6fc0, 0x1814, 0x883b,
1819 0xa005, 0x0040, 0x47b2, 0xa102, 0x00c8, 0x4792, 0x7007, 0x0010, 2049 0x7824, 0x68c1, 0x7864, 0x883e, 0x9879, 0x8576, 0x8677, 0x206b,
1820 0x0078, 0x47bb, 0x8aff, 0x0040, 0x47bb, 0x1078, 0x4b07, 0x00c0, 2050 0x28c1, 0x9cae, 0x2044, 0x2103, 0x20a2, 0x2081, 0x9865, 0xa209,
1821 0x47b5, 0x0040, 0x4792, 0x1078, 0x4846, 0x7003, 0x0000, 0x127f, 2051 0x2901, 0x988d, 0x0014, 0xa205, 0xa300, 0x1872, 0x879a, 0x883c,
1822 0x2000, 0x007c, 0x017e, 0x6104, 0xa18c, 0x00ff, 0xa186, 0x0007, 2052 0x1fe2, 0xc601, 0xa20a, 0x856e, 0x0704, 0x9c91, 0x0014, 0xa204,
1823 0x0040, 0x47ce, 0xa18e, 0x000f, 0x00c0, 0x47d1, 0x6040, 0x0078, 2053 0xa300, 0x3009, 0x19e2, 0xf864, 0x856e, 0x883f, 0x08e6, 0x9891,
1824 0x47d2, 0x6428, 0x017f, 0x84ff, 0x0040, 0x47fc, 0x2c70, 0x7004, 2054 0xf881, 0x988c, 0xc801, 0x0014, 0xf8c1, 0x0016, 0x85b2, 0x80f0,
1825 0xa0bc, 0x000f, 0xa7b8, 0x480c, 0x273c, 0x87fb, 0x00c0, 0x47ea, 2055 0x9532, 0xfb02, 0x1de2, 0x0014, 0x8532, 0xf241, 0x0014, 0x1de2,
1826 0x0048, 0x47e4, 0x1078, 0x23eb, 0x609c, 0xa075, 0x0040, 0x47fc, 2056 0x84a8, 0xd7a0, 0x1fe6, 0x0014, 0xa208, 0x6043, 0x8008, 0x1dc1,
1827 0x0078, 0x47d7, 0x2704, 0xae68, 0x6808, 0xa630, 0x680c, 0xa529, 2057 0x0016, 0x8300, 0x8160, 0x842a, 0xf041, 0x3008, 0x84a8, 0x11d6,
1828 0x8421, 0x0040, 0x47fc, 0x8738, 0x2704, 0xa005, 0x00c0, 0x47eb, 2058 0x7042, 0x20dd, 0x0011, 0x20d5, 0x8822, 0x0016, 0x8000, 0x2847,
1829 0x709c, 0xa075, 0x00c0, 0x47d7, 0x007c, 0x0000, 0x0005, 0x0009, 2059 0x1011, 0x98c0, 0x8000, 0xa000, 0x2802, 0x1011, 0x98c6, 0x9865,
1830 0x000d, 0x0011, 0x0015, 0x0019, 0x001d, 0x0000, 0x0003, 0x0009, 2060 0x283e, 0x1011, 0x98ca, 0xa20b, 0x0017, 0x300c, 0xa300, 0x1de2,
1831 0x000f, 0x0015, 0x001b, 0x0000, 0x0000, 0x4801, 0x47fe, 0x0000, 2061 0xdb81, 0x0014, 0x0210, 0x98d7, 0x0014, 0x26e0, 0x873a, 0xfb02,
1832 0x0000, 0x8000, 0x0000, 0x4801, 0x0000, 0x4809, 0x4806, 0x0000, 2062 0x19f2, 0x1fe2, 0x0014, 0xa20d, 0x3806, 0x0210, 0x9cb3, 0x0704,
1833 0x0000, 0x0000, 0x0000, 0x4809, 0x0000, 0x4804, 0x4804, 0x0000, 2063 0x0000, 0x006c, 0x0002, 0x984f, 0x0014, 0x009e, 0x00a0, 0x0017,
1834 0x0000, 0x8000, 0x0000, 0x4804, 0x0000, 0x480a, 0x480a, 0x0000, 2064 0x60ff, 0x300c, 0x8720, 0xa211, 0x9cd0, 0x8772, 0x8837, 0x2101,
1835 0x0000, 0x0000, 0x0000, 0x480a, 0x127e, 0x2091, 0x2200, 0x2079, 2065 0x987a, 0x10d2, 0x78e2, 0x9cd3, 0x9859, 0xd984, 0xf0e2, 0xf0a1,
1836 0x5100, 0x2071, 0x0010, 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, 2066 0x98cd, 0x0014, 0x8831, 0xd166, 0x8830, 0x800f, 0x9401, 0xb520,
1837 0x0000, 0x2071, 0x0020, 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, 2067 0xc802, 0x8820, 0x987a, 0x2301, 0x987a, 0x10d2, 0x78e4, 0x9cd3,
1838 0x0000, 0x2049, 0x0000, 0x127f, 0x2000, 0x007c, 0x2049, 0x4846, 2068 0x8821, 0x8820, 0x9859, 0xf123, 0xf142, 0xf101, 0x98c6, 0x10d2,
1839 0x2019, 0x0000, 0x7004, 0x8004, 0x00c8, 0x4899, 0x7007, 0x0012, 2069 0x70f6, 0x8832, 0x8203, 0x870c, 0xd99e, 0x6001, 0x0014, 0x6845,
1840 0x7108, 0x7008, 0xa106, 0x00c0, 0x4850, 0xa184, 0x01e0, 0x0040, 2070 0x0214, 0xa21b, 0x9cd0, 0x2001, 0x98c5, 0x8201, 0x1852, 0xd184,
1841 0x485b, 0x1078, 0x23eb, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 2071 0xd163, 0x8834, 0x8001, 0x988d, 0x3027, 0x84a8, 0x1a56, 0x8833,
1842 0x00c8, 0x4866, 0xa184, 0x4000, 0x00c0, 0x4850, 0xa19c, 0x300c, 2072 0x0014, 0xa218, 0x6981, 0x9cbc, 0x6926, 0x6902, 0x1a34, 0x9899,
1843 0xa386, 0x2004, 0x0040, 0x4874, 0xa386, 0x0008, 0x0040, 0x487f, 2073 0x1a14, 0x7021, 0x0014, 0xa300, 0x6141, 0x6964, 0x8010, 0x8592,
1844 0xa386, 0x200c, 0x00c0, 0x4850, 0x7200, 0x8204, 0x0048, 0x487f, 2074 0x8026, 0x84b9, 0x69e4, 0x8023, 0x16e1, 0x8001, 0x10f1, 0x6946,
1845 0x730c, 0xa384, 0x00ff, 0x0040, 0x487f, 0x1078, 0x23eb, 0x7007, 2075 0xa213, 0x1462, 0xa213, 0x8000, 0x16e1, 0x98b5, 0x6969, 0xa214,
1846 0x0012, 0x7000, 0xa084, 0x0001, 0x00c0, 0x4899, 0x7008, 0xa084, 2076 0x61c2, 0x8002, 0x14e1, 0x8004, 0x16e1, 0x0101, 0x300a, 0x8827,
1847 0x01e0, 0x00c0, 0x4899, 0x7310, 0x7014, 0xa305, 0x0040, 0x4899, 2077 0x0014, 0xa217, 0x9cbc, 0x0014, 0xa300, 0x8181, 0x842a, 0x84a8,
1848 0x710c, 0xa184, 0x0300, 0x00c0, 0x4899, 0xa184, 0x00ff, 0x00c0, 2078 0x1ce6, 0x882c, 0x0016, 0xa212, 0x9cd0, 0x10d2, 0x70e4, 0x0004,
1849 0x4846, 0x7007, 0x0012, 0x7007, 0x0008, 0x7004, 0xa084, 0x0008, 2079 0x8007, 0x9424, 0xcc1a, 0x9cd3, 0x98c5, 0x8827, 0x300a, 0x0013,
1850 0x00c0, 0x489d, 0x7007, 0x0012, 0x7108, 0x8103, 0x0048, 0x48a2, 2080 0x8000, 0x84a4, 0x0016, 0x11c2, 0x211e, 0x870e, 0xa21d, 0x0014,
1851 0x7003, 0x0000, 0x2049, 0x0000, 0x007c, 0x107e, 0x007e, 0x127e, 2081 0x878e, 0x0016, 0xa21c, 0x1035, 0x9891, 0xa210, 0xa000, 0x8010,
1852 0x157e, 0x2091, 0x2200, 0x7108, 0x1078, 0x48bd, 0x157f, 0x127f, 2082 0x8592, 0x853b, 0xd044, 0x8022, 0x3807, 0x84bb, 0x98ea, 0x8021,
1853 0x2091, 0x8001, 0x007f, 0x107f, 0x007c, 0x7204, 0x7500, 0x730c, 2083 0x3807, 0x84b9, 0x300c, 0x817e, 0x872b, 0x8772, 0x9891, 0x0000,
1854 0xa384, 0x0300, 0x00c0, 0x48e4, 0xa184, 0x01e0, 0x00c0, 0x4908, 2084 0x0020, 0x002b, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1855 0x7108, 0xa184, 0x01e0, 0x00c0, 0x4908, 0x2001, 0x04fd, 0x2004, 2085 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1856 0xa082, 0x0005, 0x00c8, 0x48d8, 0xa184, 0x4000, 0x00c0, 0x48c8, 2086 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1857 0xa184, 0x0007, 0x0079, 0x48dc, 0x48e6, 0x48f8, 0x48e4, 0x48f8, 2087 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1858 0x48e4, 0x4944, 0x48e4, 0x4942, 0x1078, 0x23eb, 0x7004, 0xa084, 2088 0x0000, 0x0020, 0x0000, 0x0014, 0x0014, 0x9849, 0x0014, 0x0014,
1859 0x0010, 0xa085, 0x0002, 0x7006, 0x8aff, 0x00c0, 0x48f3, 0x2049, 2089 0x98e2, 0x98cd, 0x0014, 0x0014, 0x0014, 0x0080, 0x0137, 0x0000,
1860 0x0000, 0x0078, 0x48f7, 0x1078, 0x4b07, 0x00c0, 0x48f3, 0x007c, 2090 0x0201, 0x0604, 0x0c08, 0x2120, 0x4022, 0xf880, 0x0018, 0x300b,
1861 0x7004, 0xa084, 0x0010, 0xa085, 0x0002, 0x7006, 0x8aff, 0x00c0, 2091 0xa201, 0x0014, 0xa200, 0x0014, 0xa200, 0x0214, 0xa202, 0x8838,
1862 0x4903, 0x0078, 0x4907, 0x1078, 0x4b07, 0x00c0, 0x4903, 0x007c, 2092 0x3806, 0x8839, 0x20c3, 0x0864, 0xa82f, 0x28c1, 0x9cae, 0xa203,
1863 0x7007, 0x0012, 0x7108, 0x00e0, 0x490b, 0x2091, 0x6000, 0x00e0, 2093 0x300c, 0x2846, 0x8161, 0x846a, 0x8300, 0x1856, 0x883a, 0xa804,
1864 0x490f, 0x2091, 0x6000, 0x7007, 0x0012, 0x7007, 0x0008, 0x7004, 2094 0x28f2, 0x9c91, 0xa8f4, 0x300c, 0x28e1, 0x9c91, 0x2802, 0xa206,
1865 0xa084, 0x0008, 0x00c0, 0x4917, 0x7007, 0x0012, 0x7108, 0x8103, 2095 0x64c3, 0x282e, 0xa207, 0x64a0, 0x6de0, 0x67a0, 0x6fc0, 0x1814,
1866 0x0048, 0x491c, 0x7003, 0x0000, 0x7000, 0xa005, 0x00c0, 0x4930, 2096 0x883b, 0x7824, 0x68c1, 0x7864, 0x883e, 0xa802, 0x8576, 0x8677,
1867 0x7004, 0xa005, 0x00c0, 0x4930, 0x700c, 0xa005, 0x0040, 0x4932, 2097 0x206b, 0x28c1, 0x9cae, 0x2044, 0x2103, 0x20a2, 0x2081, 0xa8e4,
1868 0x0078, 0x4913, 0x2049, 0x0000, 0x1078, 0x3809, 0x6818, 0xa084, 2098 0xa209, 0x2901, 0xa809, 0x0014, 0xa205, 0xa300, 0x1872, 0x879a,
1869 0x8000, 0x0040, 0x493d, 0x681b, 0x0002, 0x007c, 0x1078, 0x23eb, 2099 0x883c, 0x1fe2, 0xc601, 0xa20a, 0x856e, 0x0704, 0x9c91, 0x0014,
1870 0x1078, 0x23eb, 0x1078, 0x49a0, 0x7210, 0x7114, 0x700c, 0xa09c, 2100 0xa204, 0xa300, 0x3009, 0x19e2, 0xf864, 0x856e, 0x883f, 0x08e6,
1871 0x00ff, 0x2800, 0xa300, 0xa211, 0xa189, 0x0000, 0x1078, 0x49a0, 2101 0xa8f7, 0xf881, 0xa8f0, 0xc801, 0x0014, 0xf8c1, 0x0016, 0x85b2,
1872 0x2704, 0x2c58, 0xac60, 0x6308, 0x2200, 0xa322, 0x630c, 0x2100, 2102 0x80f0, 0x9532, 0xfb02, 0x1de2, 0x0014, 0x8532, 0xf241, 0x0014,
1873 0xa31b, 0x2400, 0xa305, 0x0040, 0x4967, 0x00c8, 0x4967, 0x8412, 2103 0x1de2, 0x84a8, 0xd7a0, 0x1fe6, 0x0014, 0xa208, 0x6043, 0x8008,
1874 0x8210, 0x830a, 0xa189, 0x0000, 0x2b60, 0x0078, 0x494e, 0x2b60, 2104 0x1dc1, 0x0016, 0x8300, 0x8160, 0x842a, 0xf041, 0x3008, 0x84a8,
1875 0x8a07, 0x007e, 0x6004, 0xa084, 0x0008, 0x0040, 0x4973, 0xa7ba, 2105 0x11d6, 0x7042, 0x20dd, 0x0011, 0x20d5, 0x8822, 0x0016, 0x8000,
1876 0x4806, 0x0078, 0x4975, 0xa7ba, 0x47fe, 0x007f, 0xa73d, 0x2c00, 2106 0x2847, 0x1011, 0xa8fc, 0x8000, 0xa000, 0x2802, 0x1011, 0xa8fd,
1877 0x6886, 0x6f8a, 0x6c92, 0x6b8e, 0x7007, 0x0012, 0x1078, 0x4846, 2107 0xa89b, 0x283e, 0x1011, 0xa8fd, 0xa20b, 0x0017, 0x300c, 0xa300,
1878 0x007c, 0x8738, 0x2704, 0xa005, 0x00c0, 0x4994, 0x609c, 0xa005, 2108 0x1de2, 0xdb81, 0x0014, 0x0210, 0xa801, 0x0014, 0x26e0, 0x873a,
1879 0x0040, 0x499d, 0x2060, 0x6004, 0xa084, 0x000f, 0xa080, 0x480c, 2109 0xfb02, 0x19f2, 0x1fe2, 0x0014, 0xa20d, 0x3806, 0x0210, 0x9cb3,
1880 0x203c, 0x87fb, 0x1040, 0x23eb, 0x8a51, 0x0040, 0x499c, 0x7008, 2110 0x0704, 0x0017, 0x60ff, 0x300c, 0x8720, 0xa211, 0x9d63, 0x8772,
1881 0xa084, 0x0003, 0xa086, 0x0003, 0x007c, 0x2051, 0x0000, 0x007c, 2111 0x8837, 0x2101, 0xa821, 0x10d2, 0x78e2, 0x9d66, 0xa8fc, 0xd984,
1882 0x8a50, 0x8739, 0x2704, 0xa004, 0x00c0, 0x49b4, 0x6000, 0xa064, 2112 0xf0e2, 0xf0a1, 0xa86c, 0x0014, 0x8831, 0xd166, 0x8830, 0x800f,
1883 0x00c0, 0x49ab, 0x2d60, 0x6004, 0xa084, 0x000f, 0xa080, 0x481c, 2113 0x9401, 0xb520, 0xc802, 0x8820, 0xa80f, 0x2301, 0xa80d, 0x10d2,
1884 0x203c, 0x87fb, 0x1040, 0x23eb, 0x007c, 0x127e, 0x0d7e, 0x2091, 2114 0x78e4, 0x9d66, 0x8821, 0x8820, 0xa8e6, 0xf123, 0xf142, 0xf101,
1885 0x2200, 0x0d7f, 0x6884, 0x2060, 0x6888, 0x6b8c, 0x6c90, 0x8057, 2115 0xa84f, 0x10d2, 0x70f6, 0x8832, 0x8203, 0x870c, 0xd99e, 0x6001,
1886 0xaad4, 0x00ff, 0xa084, 0x00ff, 0x007e, 0x6804, 0xa084, 0x0008, 2116 0x0014, 0x6845, 0x0214, 0xa21b, 0x9d63, 0x2001, 0xa840, 0x8201,
1887 0x007f, 0x0040, 0x49cf, 0xa0b8, 0x4806, 0x0078, 0x49d1, 0xa0b8, 2117 0x1852, 0xd184, 0xd163, 0x8834, 0x8001, 0xa801, 0x3027, 0x84a8,
1888 0x47fe, 0x7e08, 0xa6b5, 0x000c, 0x6904, 0xa18c, 0x00ff, 0xa186, 2118 0x1a56, 0x8833, 0x0014, 0xa218, 0x6981, 0x9d4f, 0x6926, 0x6902,
1889 0x0007, 0x0040, 0x49df, 0xa18e, 0x000f, 0x00c0, 0x49e8, 0x681c, 2119 0x1a34, 0xa801, 0x1a14, 0x7021, 0x0014, 0xa300, 0x6141, 0x6964,
1890 0xa084, 0x0040, 0x0040, 0x49ef, 0xa6b5, 0x0001, 0x0078, 0x49ef, 2120 0x8010, 0x8592, 0x8026, 0x84b9, 0x69e4, 0x8023, 0x16e1, 0x8001,
1891 0x681c, 0xa084, 0x0040, 0x0040, 0x49ef, 0xa6b5, 0x0001, 0x7007, 2121 0x10f1, 0x6946, 0xa213, 0x1462, 0xa213, 0x8000, 0x16e1, 0xa807,
1892 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x49f1, 0x2400, 0xa305, 2122 0x6969, 0xa214, 0x61c2, 0x8002, 0x14e1, 0x8004, 0x16e1, 0x0101,
1893 0x00c0, 0x49fc, 0x0078, 0x4a22, 0x2c58, 0x2704, 0x6104, 0xac60, 2123 0x300a, 0x8827, 0x0014, 0xa217, 0x9d4f, 0x0014, 0xa300, 0x8181,
1894 0x6000, 0xa400, 0x701a, 0x6004, 0xa301, 0x701e, 0xa184, 0x0008, 2124 0x842a, 0x84a8, 0x1ce6, 0x882c, 0x0016, 0xa212, 0x9d63, 0x10d2,
1895 0x0040, 0x4a12, 0x6010, 0xa081, 0x0000, 0x7022, 0x6014, 0xa081, 2125 0x70e4, 0x0004, 0x8007, 0x9424, 0xcc1a, 0x9d66, 0xa8f8, 0x8827,
1896 0x0000, 0x7026, 0x6208, 0x2400, 0xa202, 0x7012, 0x620c, 0x2300, 2126 0x300a, 0x0013, 0x8000, 0x84a4, 0x0016, 0x11c2, 0x211e, 0x870e,
1897 0xa203, 0x7016, 0x7602, 0x7007, 0x0001, 0x2b60, 0x1078, 0x4981, 2127 0xa21d, 0x0014, 0x878e, 0x0016, 0xa21c, 0x1035, 0xa8b4, 0xa210,
1898 0x0078, 0x4a24, 0x1078, 0x4b07, 0x00c0, 0x4a22, 0x127f, 0x2000, 2128 0x3807, 0x300c, 0x817e, 0x872b, 0x8772, 0xa8ad, 0x0000, 0x0d0c
1899 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x7007, 0x0004,
1900 0x7004, 0xa084, 0x0004, 0x00c0, 0x4a30, 0x7003, 0x0008, 0x127f,
1901 0x2000, 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x2049,
1902 0x4a3a, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x4a43,
1903 0x7e08, 0xa6b5, 0x000c, 0x6904, 0xa18c, 0x00ff, 0xa186, 0x0007,
1904 0x0040, 0x4a56, 0xa18e, 0x000f, 0x00c0, 0x4a61, 0x681c, 0xa084,
1905 0x0040, 0x0040, 0x4a5d, 0xa6b5, 0x0001, 0x6840, 0x2050, 0x0078,
1906 0x4a6a, 0x681c, 0xa084, 0x0020, 0x00c0, 0x4a68, 0xa6b5, 0x0001,
1907 0x6828, 0x2050, 0x2d60, 0x6004, 0xa0bc, 0x000f, 0xa7b8, 0x480c,
1908 0x273c, 0x87fb, 0x00c0, 0x4a7e, 0x0048, 0x4a78, 0x1078, 0x23eb,
1909 0x689c, 0xa065, 0x0040, 0x4a82, 0x0078, 0x4a6b, 0x1078, 0x4b07,
1910 0x00c0, 0x4a7e, 0x127f, 0x2000, 0x007c, 0x127e, 0x007e, 0x017e,
1911 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x037f, 0x047f, 0x7e08, 0xa6b5,
1912 0x000c, 0x6904, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x4a9c,
1913 0xa18e, 0x000f, 0x00c0, 0x4aa5, 0x681c, 0xa084, 0x0040, 0x0040,
1914 0x4aac, 0xa6b5, 0x0001, 0x0078, 0x4aac, 0x681c, 0xa084, 0x0040,
1915 0x0040, 0x4aac, 0xa6b5, 0x0001, 0x2049, 0x4a85, 0x017e, 0x6904,
1916 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x4aba, 0xa18e, 0x000f,
1917 0x00c0, 0x4abd, 0x6840, 0x0078, 0x4abe, 0x6828, 0x017f, 0xa055,
1918 0x0040, 0x4b04, 0x2d70, 0x2e60, 0x7004, 0xa0bc, 0x000f, 0xa7b8,
1919 0x480c, 0x273c, 0x87fb, 0x00c0, 0x4ad8, 0x0048, 0x4ad1, 0x1078,
1920 0x23eb, 0x709c, 0xa075, 0x2060, 0x0040, 0x4b04, 0x0078, 0x4ac4,
1921 0x2704, 0xae68, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0048, 0x4af1,
1922 0x8a51, 0x00c0, 0x4ae5, 0x1078, 0x23eb, 0x8738, 0x2704, 0xa005,
1923 0x00c0, 0x4ad9, 0x709c, 0xa075, 0x2060, 0x0040, 0x4b04, 0x0078,
1924 0x4ac4, 0x8422, 0x8420, 0x831a, 0xa399, 0x0000, 0x6908, 0x2400,
1925 0xa122, 0x690c, 0x2300, 0xa11b, 0x00c8, 0x4b00, 0x1078, 0x23eb,
1926 0x2071, 0x0020, 0x0078, 0x49ef, 0x127f, 0x2000, 0x007c, 0x7008,
1927 0xa084, 0x0003, 0xa086, 0x0003, 0x0040, 0x4b2f, 0x2704, 0xac08,
1928 0x2104, 0x701a, 0x8108, 0x2104, 0x701e, 0x8108, 0x2104, 0x7012,
1929 0x8108, 0x2104, 0x7016, 0x6004, 0xa084, 0x0008, 0x0040, 0x4b26,
1930 0x8108, 0x2104, 0x7022, 0x8108, 0x2104, 0x7026, 0x7602, 0x7004,
1931 0xa084, 0x0010, 0xa085, 0x0001, 0x7006, 0x1078, 0x4981, 0x007c,
1932 0x127e, 0x007e, 0x0d7e, 0x2091, 0x2200, 0x2049, 0x4b30, 0x0d7f,
1933 0x087f, 0x7108, 0xa184, 0x0003, 0x00c0, 0x4b5a, 0x017e, 0x6904,
1934 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x4b4a, 0xa18e, 0x000f,
1935 0x00c0, 0x4b4d, 0x6840, 0x0078, 0x4b4e, 0x6828, 0x017f, 0xa005,
1936 0x0040, 0x4b68, 0x0078, 0x478d, 0x0020, 0x4b5a, 0x1078, 0x4944,
1937 0x0078, 0x4b68, 0x00a0, 0x4b61, 0x7108, 0x1078, 0x48bd, 0x0078,
1938 0x4b39, 0x7007, 0x0010, 0x00a0, 0x4b63, 0x7108, 0x1078, 0x48bd,
1939 0x7008, 0xa086, 0x0008, 0x00c0, 0x4b39, 0x7000, 0xa005, 0x00c0,
1940 0x4b39, 0x7003, 0x0000, 0x2049, 0x0000, 0x127f, 0x2000, 0x007c,
1941 0x127e, 0x147e, 0x137e, 0x157e, 0x0c7e, 0x0d7e, 0x2091, 0x2200,
1942 0x0d7f, 0x2049, 0x4b78, 0xad80, 0x0011, 0x20a0, 0x2099, 0x0031,
1943 0x700c, 0xa084, 0x00ff, 0x682a, 0x7007, 0x0008, 0x7007, 0x0002,
1944 0x7003, 0x0001, 0x0040, 0x4b97, 0x8000, 0x80ac, 0x53a5, 0x7007,
1945 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x4b99, 0x0c7f, 0x2049,
1946 0x0000, 0x7003, 0x0000, 0x157f, 0x137f, 0x147f, 0x127f, 0x2000,
1947 0x007c, 0x2091, 0x6000, 0x2091, 0x8000, 0x78cc, 0xa005, 0x0040,
1948 0x4bc0, 0x7994, 0x70d0, 0xa106, 0x00c0, 0x4bc0, 0x7804, 0xa005,
1949 0x0040, 0x4bc0, 0x7807, 0x0000, 0x0068, 0x4bc0, 0x2091, 0x4080,
1950 0x7820, 0x8001, 0x7822, 0x00c0, 0x4c1b, 0x7824, 0x7822, 0x2069,
1951 0x5140, 0x6800, 0xa084, 0x0007, 0x0040, 0x4bde, 0xa086, 0x0002,
1952 0x0040, 0x4bde, 0x6834, 0xa00d, 0x0040, 0x4bde, 0x2104, 0xa005,
1953 0x0040, 0x4bde, 0x8001, 0x200a, 0x0040, 0x4cc3, 0x7848, 0xa005,
1954 0x0040, 0x4bec, 0x8001, 0x784a, 0x00c0, 0x4bec, 0x2009, 0x0102,
1955 0x6844, 0x200a, 0x1078, 0x21d2, 0x6890, 0xa005, 0x0040, 0x4bf8,
1956 0x8001, 0x6892, 0x00c0, 0x4bf8, 0x686f, 0x0000, 0x6873, 0x0001,
1957 0x2061, 0x5400, 0x20a9, 0x0100, 0x2009, 0x0002, 0x6034, 0xa005,
1958 0x0040, 0x4c0e, 0x8001, 0x6036, 0x00c0, 0x4c0e, 0x6010, 0xa005,
1959 0x0040, 0x4c0e, 0x017e, 0x1078, 0x21d2, 0x017f, 0xace0, 0x0010,
1960 0x0070, 0x4c14, 0x0078, 0x4bfe, 0x8109, 0x0040, 0x4c1b, 0x20a9,
1961 0x0100, 0x0078, 0x4bfe, 0x1078, 0x4c28, 0x1078, 0x4c4d, 0x2009,
1962 0x5151, 0x2104, 0x2009, 0x0102, 0x200a, 0x2091, 0x8001, 0x007c,
1963 0x7834, 0x8001, 0x7836, 0x00c0, 0x4c4c, 0x7838, 0x7836, 0x2091,
1964 0x8000, 0x7844, 0xa005, 0x00c0, 0x4c37, 0x2001, 0x0101, 0x8001,
1965 0x7846, 0xa080, 0x7400, 0x2040, 0x2004, 0xa065, 0x0040, 0x4c4c,
1966 0x6024, 0xa005, 0x0040, 0x4c48, 0x8001, 0x6026, 0x0040, 0x4c7c,
1967 0x6000, 0x2c40, 0x0078, 0x4c3d, 0x007c, 0x7828, 0x8001, 0x782a,
1968 0x00c0, 0x4c7b, 0x782c, 0x782a, 0x7830, 0xa005, 0x00c0, 0x4c5a,
1969 0x2001, 0x0200, 0x8001, 0x7832, 0x8003, 0x8003, 0x8003, 0x8003,
1970 0xa090, 0x5400, 0xa298, 0x0002, 0x2304, 0xa084, 0x0008, 0x0040,
1971 0x4c7b, 0xa290, 0x0009, 0x2204, 0xa005, 0x0040, 0x4c73, 0x8001,
1972 0x2012, 0x00c0, 0x4c7b, 0x2304, 0xa084, 0xfff7, 0xa085, 0x0080,
1973 0x201a, 0x1078, 0x21d2, 0x007c, 0x2069, 0x5140, 0x6800, 0xa005,
1974 0x0040, 0x4c86, 0x6848, 0xac06, 0x0040, 0x4cc3, 0x601b, 0x0006,
1975 0x60b4, 0xa084, 0x3f00, 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085,
1976 0x0060, 0x6022, 0x6000, 0x2042, 0x6714, 0x6f82, 0x1078, 0x1973,
1977 0x6818, 0xa005, 0x0040, 0x4c9e, 0x8001, 0x681a, 0x6808, 0xa084,
1978 0xffef, 0x680a, 0x6810, 0x8001, 0x00d0, 0x4ca8, 0x1078, 0x23eb,
1979 0x6812, 0x602f, 0x0000, 0x6033, 0x0000, 0x2c68, 0x1078, 0x1c70,
1980 0x2069, 0x5140, 0x7944, 0xa184, 0x0100, 0x2001, 0x0006, 0x686e,
1981 0x00c0, 0x4cbe, 0x6986, 0x2001, 0x0004, 0x686e, 0x1078, 0x21cd,
1982 0x2091, 0x8001, 0x007c, 0x2069, 0x0100, 0x2009, 0x5140, 0x2104,
1983 0xa084, 0x0007, 0x0040, 0x4d1f, 0xa086, 0x0007, 0x00c0, 0x4cd9,
1984 0x0d7e, 0x2009, 0x5152, 0x216c, 0x1078, 0x3a4e, 0x0d7f, 0x0078,
1985 0x4d1f, 0x2009, 0x5152, 0x2164, 0x1078, 0x2396, 0x601b, 0x0006,
1986 0x6858, 0xa084, 0x3f00, 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085,
1987 0x0048, 0x6022, 0x602f, 0x0000, 0x6033, 0x0000, 0x6830, 0xa084,
1988 0x0040, 0x0040, 0x4d13, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848,
1989 0xa084, 0x0004, 0x0040, 0x4d00, 0x0070, 0x4d00, 0x0078, 0x4cf7,
1990 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0001, 0x0040,
1991 0x4d0d, 0x0070, 0x4d0d, 0x0078, 0x4d04, 0x20a9, 0x00fa, 0x0070,
1992 0x4d13, 0x0078, 0x4d0f, 0x6808, 0xa084, 0xfffd, 0x680a, 0x681b,
1993 0x0048, 0x2009, 0x515b, 0x200b, 0x0007, 0x784c, 0x784a, 0x2091,
1994 0x8001, 0x007c, 0x2079, 0x5100, 0x1078, 0x4d4d, 0x1078, 0x4d31,
1995 0x1078, 0x4d3f, 0x7833, 0x0000, 0x7847, 0x0000, 0x784b, 0x0000,
1996 0x007c, 0x2019, 0x0003, 0x2011, 0x5146, 0x2204, 0xa086, 0x003c,
1997 0x0040, 0x4d3c, 0x2019, 0x0002, 0x7b2a, 0x7b2e, 0x007c, 0x2019,
1998 0x0039, 0x2011, 0x5146, 0x2204, 0xa086, 0x003c, 0x0040, 0x4d4a,
1999 0x2019, 0x0027, 0x7b36, 0x7b3a, 0x007c, 0x2019, 0x3971, 0x2011,
2000 0x5146, 0x2204, 0xa086, 0x003c, 0x0040, 0x4d58, 0x2019, 0x2626,
2001 0x7b22, 0x7b26, 0x783f, 0x0000, 0x7843, 0x000a, 0x007c, 0x0020,
2002 0x002b, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
2003 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
2004 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
2005 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
2006 0x0020, 0x0000, 0x0014, 0x0014, 0x9849, 0x0014, 0x0014, 0x0014,
2007 0x0014, 0x0014, 0x0014, 0x0014, 0x0080, 0x000f, 0x0000, 0x0201,
2008 0x0604, 0x0c08, 0x2120, 0x4022, 0xf880, 0x0018, 0x300b, 0xa201,
2009 0x0014, 0xa200, 0x0014, 0xa200, 0x0214, 0x0000, 0x006c, 0x0002,
2010 0x0014, 0x98d0, 0x009e, 0x0096, 0xa202, 0x8838, 0x3806, 0x8839,
2011 0x20c3, 0x0864, 0x9884, 0x28c1, 0x9cb1, 0xa203, 0x300c, 0x2846,
2012 0x8161, 0x846a, 0x8300, 0x1856, 0x883a, 0x9865, 0x28f2, 0x9c90,
2013 0x9858, 0x300c, 0x28e1, 0x9c90, 0x2802, 0xa206, 0x64c3, 0x282d,
2014 0xa207, 0x64a0, 0x67a0, 0x6fc0, 0x1814, 0x883b, 0x7824, 0x68c1,
2015 0x7864, 0x883e, 0x9878, 0x8576, 0x8677, 0x206b, 0x28c1, 0x9cb1,
2016 0x2044, 0x2103, 0x20a2, 0x2081, 0x9865, 0xa209, 0x2901, 0x988c,
2017 0x0014, 0xa205, 0xa300, 0x1872, 0x879a, 0x883c, 0x1fe2, 0xc601,
2018 0xa20a, 0x856e, 0x0704, 0x9c90, 0x0014, 0xa204, 0xa300, 0x3009,
2019 0x19e2, 0xf868, 0x8176, 0x86eb, 0x85eb, 0x872e, 0x87a9, 0x883f,
2020 0x08e6, 0x9890, 0xf881, 0x988b, 0xc801, 0x0014, 0xf8c1, 0x0016,
2021 0x85b2, 0x80f0, 0x9532, 0xfb02, 0x1de2, 0x0014, 0x8532, 0xf241,
2022 0x0014, 0x1de2, 0x84a8, 0xd7a0, 0x1fe6, 0x0014, 0xa208, 0x6043,
2023 0x8008, 0x1dc1, 0x0016, 0x8300, 0x8160, 0x842a, 0xf041, 0x3008,
2024 0x84a8, 0x11d6, 0x7042, 0x20dd, 0x0011, 0x20d5, 0x8822, 0x0016,
2025 0x8000, 0x2847, 0x1011, 0x98c3, 0x8000, 0xa000, 0x2802, 0x1011,
2026 0x98c9, 0x9865, 0x283e, 0x1011, 0x98cd, 0xa20b, 0x0017, 0x300c,
2027 0xa300, 0x1de2, 0xdb81, 0x0014, 0x0210, 0x98da, 0x0014, 0x26e0,
2028 0x873a, 0xfb02, 0x19f2, 0x1fe2, 0x0014, 0xa20d, 0x3806, 0x0210,
2029 0x9cb6, 0x0704, 0x0000, 0x006c, 0x0002, 0x984f, 0x0014, 0x009e,
2030 0x00a5, 0x0017, 0x60ff, 0x300c, 0x8720, 0xa211, 0x9cd5, 0x8772,
2031 0x8837, 0x2101, 0x987a, 0x10d2, 0x78e2, 0x9cd8, 0x9859, 0xd984,
2032 0xf0e2, 0xf0a1, 0x98d2, 0x0014, 0x8831, 0xd166, 0x8830, 0x800f,
2033 0x9401, 0xb520, 0xc802, 0x8820, 0x987a, 0x2301, 0x987a, 0x10d2,
2034 0x78e4, 0x9cd8, 0x8821, 0x8820, 0x9859, 0xf123, 0xf142, 0xf101,
2035 0x98cb, 0x10d2, 0x70f6, 0x8832, 0x8203, 0x870c, 0xd99e, 0x6001,
2036 0x0014, 0x6845, 0x0214, 0xa21b, 0x9cd5, 0x2001, 0x98ca, 0x8201,
2037 0x1852, 0xd184, 0xd163, 0x8834, 0x8001, 0x988d, 0x3027, 0x84a8,
2038 0x1a56, 0x8833, 0x0014, 0xa218, 0x6981, 0x9cc1, 0x692a, 0x6902,
2039 0x1834, 0x989d, 0x1a14, 0x8010, 0x8592, 0x8026, 0x84b9, 0x7021,
2040 0x0014, 0xa300, 0x69e1, 0x9caa, 0x694c, 0xa213, 0x9cba, 0x1462,
2041 0xa213, 0x8000, 0x16e1, 0x98b4, 0x8023, 0x16e1, 0x8001, 0x10f1,
2042 0x0016, 0x6968, 0xa214, 0x9cba, 0x8004, 0x16e1, 0x0101, 0x300a,
2043 0x8827, 0x0014, 0x9cba, 0x0014, 0x61c2, 0x8002, 0x14e1, 0x0016,
2044 0xa217, 0x9cc1, 0x0014, 0xa300, 0x8181, 0x842a, 0x84a8, 0x1ce6,
2045 0x882c, 0x0016, 0xa212, 0x9cd5, 0x10d2, 0x70e4, 0x0004, 0x8007,
2046 0x9424, 0xcc1a, 0x9cd8, 0x98ca, 0x8827, 0x300a, 0x0013, 0x8000,
2047 0x84a4, 0x0016, 0x11c2, 0x211e, 0x870e, 0xa21d, 0x0014, 0x878e,
2048 0x0016, 0xa21c, 0x1035, 0x9891, 0xa210, 0xa000, 0x8010, 0x8592,
2049 0x853b, 0xd044, 0x8022, 0x3807, 0x84bb, 0x98ef, 0x8021, 0x3807,
2050 0x84b9, 0x300c, 0x817e, 0x872b, 0x8772, 0x9891, 0x0000, 0x0020,
2051 0x002b, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
2052 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
2053 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
2054 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
2055 0x0020, 0x0000, 0x0014, 0x0014, 0x9849, 0x0014, 0x0014, 0x98e5,
2056 0x98d0, 0x0014, 0x0014, 0x0014, 0x0080, 0x013f, 0x0000, 0x0201,
2057 0x0604, 0x0c08, 0x2120, 0x4022, 0xf880, 0x0018, 0x300b, 0xa201,
2058 0x0014, 0xa200, 0x0014, 0xa200, 0x0214, 0xa202, 0x8838, 0x3806,
2059 0x8839, 0x20c3, 0x0864, 0xa82e, 0x28c1, 0x9cb1, 0xa203, 0x300c,
2060 0x2846, 0x8161, 0x846a, 0x8300, 0x1856, 0x883a, 0xa804, 0x28f2,
2061 0x9c90, 0xa8f4, 0x300c, 0x28e1, 0x9c90, 0x2802, 0xa206, 0x64c3,
2062 0x282d, 0xa207, 0x64a0, 0x67a0, 0x6fc0, 0x1814, 0x883b, 0x7824,
2063 0x68c1, 0x7864, 0x883e, 0xa802, 0x8576, 0x8677, 0x206b, 0x28c1,
2064 0x9cb1, 0x2044, 0x2103, 0x20a2, 0x2081, 0xa8e5, 0xa209, 0x2901,
2065 0xa809, 0x0014, 0xa205, 0xa300, 0x1872, 0x879a, 0x883c, 0x1fe2,
2066 0xc601, 0xa20a, 0x856e, 0x0704, 0x9c90, 0x0014, 0xa204, 0xa300,
2067 0x3009, 0x19e2, 0xf868, 0x8176, 0x86eb, 0x85eb, 0x872e, 0x87a9,
2068 0x883f, 0x08e6, 0xa8f3, 0xf881, 0xa8ec, 0xc801, 0x0014, 0xf8c1,
2069 0x0016, 0x85b2, 0x80f0, 0x9532, 0xfb02, 0x1de2, 0x0014, 0x8532,
2070 0xf241, 0x0014, 0x1de2, 0x84a8, 0xd7a0, 0x1fe6, 0x0014, 0xa208,
2071 0x6043, 0x8008, 0x1dc1, 0x0016, 0x8300, 0x8160, 0x842a, 0xf041,
2072 0x3008, 0x84a8, 0x11d6, 0x7042, 0x20dd, 0x0011, 0x20d5, 0x8822,
2073 0x0016, 0x8000, 0x2847, 0x1011, 0xa8fc, 0x8000, 0xa000, 0x2802,
2074 0x1011, 0xa8fd, 0xa898, 0x283e, 0x1011, 0xa8fd, 0xa20b, 0x0017,
2075 0x300c, 0xa300, 0x1de2, 0xdb81, 0x0014, 0x0210, 0xa801, 0x0014,
2076 0x26e0, 0x873a, 0xfb02, 0x19f2, 0x1fe2, 0x0014, 0xa20d, 0x3806,
2077 0x0210, 0x9cb6, 0x0704, 0x0017, 0x60ff, 0x300c, 0x8720, 0xa211,
2078 0x9d6b, 0x8772, 0x8837, 0x2101, 0xa821, 0x10d2, 0x78e2, 0x9d6e,
2079 0xa8fc, 0xd984, 0xf0e2, 0xf0a1, 0xa871, 0x0014, 0x8831, 0xd166,
2080 0x8830, 0x800f, 0x9401, 0xb520, 0xc802, 0x8820, 0xa80f, 0x2301,
2081 0xa80d, 0x10d2, 0x78e4, 0x9d6e, 0x8821, 0x8820, 0xa8e6, 0xf123,
2082 0xf142, 0xf101, 0xa854, 0x10d2, 0x70f6, 0x8832, 0x8203, 0x870c,
2083 0xd99e, 0x6001, 0x0014, 0x6845, 0x0214, 0xa21b, 0x9d6b, 0x2001,
2084 0xa845, 0x8201, 0x1852, 0xd184, 0xd163, 0x8834, 0x8001, 0xa801,
2085 0x3027, 0x84a8, 0x1a56, 0x8833, 0x0014, 0xa218, 0x6981, 0x9d57,
2086 0x692a, 0x6902, 0x1834, 0xa805, 0x1a14, 0x8010, 0x8592, 0x8026,
2087 0x84b9, 0x7021, 0x0014, 0xa300, 0x69e1, 0x9d40, 0x694c, 0xa213,
2088 0x9d50, 0x1462, 0xa213, 0x8000, 0x16e1, 0xa80a, 0x8023, 0x16e1,
2089 0x8001, 0x10f1, 0x0016, 0x6968, 0xa214, 0x9d50, 0x8004, 0x16e1,
2090 0x0101, 0x300a, 0x8827, 0x0014, 0x9d50, 0x0014, 0x61c2, 0x8002,
2091 0x14e1, 0x0016, 0xa217, 0x9d57, 0x0014, 0xa300, 0x8181, 0x842a,
2092 0x84a8, 0x1ce6, 0x882c, 0x0016, 0xa212, 0x9d6b, 0x10d2, 0x70e4,
2093 0x0004, 0x8007, 0x9424, 0xcc1a, 0x9d6e, 0xa8f8, 0x8827, 0x300a,
2094 0x0013, 0x8000, 0x84a4, 0x0016, 0x11c2, 0x211e, 0x870e, 0xa21d,
2095 0x0014, 0x878e, 0x0016, 0xa21c, 0x1035, 0xa8af, 0xa210, 0x3807,
2096 0x300c, 0x817e, 0x872b, 0x8772, 0xa8a8, 0x0000, 0xdf21
2097}; 2129};
2098static unsigned short risc_code_length01 = 0x4057; 2130static unsigned short risc_code_length01 = 0x4158;
2099
diff --git a/drivers/scsi/ql12160_fw.h b/drivers/scsi/ql12160_fw.h
index 9db6a208c9f8..d89dac0cc9d4 100644
--- a/drivers/scsi/ql12160_fw.h
+++ b/drivers/scsi/ql12160_fw.h
@@ -22,19 +22,19 @@
22 ************************************************************************/ 22 ************************************************************************/
23 23
24/* 24/*
25 * Firmware Version 10.04.32 (12:03 May 09, 2001) 25 * Firmware Version 10.04.42 (15:44 Apr 18, 2003)
26 */ 26 */
27 27
28#ifdef UNIQUE_FW_NAME 28#ifdef UNIQUE_FW_NAME
29static unsigned char fw12160i_version_str[] = {10,4,32}; 29static unsigned char fw12160i_version_str[] = {10,4,42};
30#else 30#else
31static unsigned char firmware_version[] = {10,4,32}; 31static unsigned char firmware_version[] = {10,4,42};
32#endif 32#endif
33 33
34#ifdef UNIQUE_FW_NAME 34#ifdef UNIQUE_FW_NAME
35#define fw12160i_VERSION_STRING "10.04.32" 35#define fw12160i_VERSION_STRING "10.04.42"
36#else 36#else
37#define FW_VERSION_STRING "10.04.32" 37#define FW_VERSION_STRING "10.04.42"
38#endif 38#endif
39 39
40#ifdef UNIQUE_FW_NAME 40#ifdef UNIQUE_FW_NAME
@@ -48,7 +48,7 @@ static unsigned short fw12160i_code01[] = {
48#else 48#else
49static unsigned short risc_code01[] = { 49static unsigned short risc_code01[] = {
50#endif 50#endif
51 0x0804, 0x1041, 0x0000, 0x35e6, 0x0000, 0x2043, 0x4f50, 0x5952, 51 0x0804, 0x1041, 0x0000, 0x36c9, 0x0000, 0x2043, 0x4f50, 0x5952,
52 0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932, 0x2c31, 52 0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932, 0x2c31,
53 0x3939, 0x332c, 0x3139, 0x3934, 0x2051, 0x4c4f, 0x4749, 0x4320, 53 0x3939, 0x332c, 0x3139, 0x3934, 0x2051, 0x4c4f, 0x4749, 0x4320,
54 0x434f, 0x5250, 0x4f52, 0x4154, 0x494f, 0x4e00, 0x2049, 0x5350, 54 0x434f, 0x5250, 0x4f52, 0x4154, 0x494f, 0x4e00, 0x2049, 0x5350,
@@ -56,112 +56,112 @@ static unsigned short risc_code01[] = {
56 0x6572, 0x7369, 0x6f6e, 0x2031, 0x302e, 0x3034, 0x2020, 0x2043, 56 0x6572, 0x7369, 0x6f6e, 0x2031, 0x302e, 0x3034, 0x2020, 0x2043,
57 0x7573, 0x746f, 0x6d65, 0x7220, 0x4e6f, 0x2e20, 0x3030, 0x2050, 57 0x7573, 0x746f, 0x6d65, 0x7220, 0x4e6f, 0x2e20, 0x3030, 0x2050,
58 0x726f, 0x6475, 0x6374, 0x204e, 0x6f2e, 0x2020, 0x3030, 0x2020, 58 0x726f, 0x6475, 0x6374, 0x204e, 0x6f2e, 0x2020, 0x3030, 0x2020,
59 0x2400, 0x20c9, 0x8fff, 0x2071, 0x0200, 0x70a0, 0x70a2, 0x2001, 59 0x2400, 0x20c9, 0x90ff, 0x2071, 0x0200, 0x70a0, 0x70a2, 0x2001,
60 0x01ff, 0x2004, 0xd0fc, 0x1120, 0x2071, 0x0100, 0x70a0, 0x70a2, 60 0x01ff, 0x2004, 0xd0fc, 0x1120, 0x2071, 0x0100, 0x70a0, 0x70a2,
61 0x20c1, 0x0020, 0x2089, 0x1221, 0x2071, 0x0010, 0x70c3, 0x0004, 61 0x20c1, 0x0020, 0x2089, 0x1221, 0x2071, 0x0010, 0x70c3, 0x0004,
62 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 0x000a, 62 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 0x000a,
63 0x2001, 0x04fd, 0x2004, 0x70d6, 0x2009, 0xfeff, 0x2130, 0x2128, 63 0x2001, 0x04fd, 0x2004, 0x70d6, 0x2009, 0xfeff, 0x2130, 0x2128,
64 0xa1a2, 0x4600, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 64 0xa1a2, 0x4700, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424,
65 0xa192, 0x9000, 0x2009, 0x0000, 0x2001, 0x0032, 0x080c, 0x1de8, 65 0xa192, 0x9100, 0x2009, 0x0000, 0x2001, 0x0032, 0x080c, 0x1e05,
66 0x2218, 0x2079, 0x4600, 0x2fa0, 0x2408, 0x2011, 0x0000, 0x20a9, 66 0x2218, 0x2079, 0x4700, 0x2fa0, 0x2408, 0x2011, 0x0000, 0x20a9,
67 0x0040, 0x42a4, 0x8109, 0x1dd8, 0x2009, 0xff00, 0x3400, 0xa102, 67 0x0040, 0x42a4, 0x8109, 0x1dd8, 0x2009, 0xff00, 0x3400, 0xa102,
68 0x0218, 0x0110, 0x20a8, 0x42a4, 0x781b, 0x0064, 0x7814, 0xc0cd, 68 0x0218, 0x0110, 0x20a8, 0x42a4, 0x781b, 0x0064, 0x7814, 0xc0cd,
69 0xc0d5, 0x7816, 0x2071, 0x0200, 0x00d6, 0x2069, 0x4640, 0x080c, 69 0xc0d5, 0x7816, 0x2071, 0x0200, 0x00d6, 0x2069, 0x4740, 0x080c,
70 0x459a, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1130, 0x2069, 0x4680, 70 0x465c, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1130, 0x2069, 0x4780,
71 0x2071, 0x0100, 0x080c, 0x459a, 0x7814, 0xc0d4, 0x7816, 0x00de, 71 0x2071, 0x0100, 0x080c, 0x465c, 0x7814, 0xc0d4, 0x7816, 0x00de,
72 0x7eca, 0x7cc2, 0x7bc6, 0x7867, 0x0000, 0x7800, 0xc08d, 0x7802, 72 0x7eca, 0x7cc2, 0x7bc6, 0x7867, 0x0000, 0x7800, 0xc08d, 0x7802,
73 0x2031, 0x0030, 0x78af, 0x0101, 0x7823, 0x0002, 0x7827, 0x0002, 73 0x2031, 0x0030, 0x78af, 0x0101, 0x7823, 0x0002, 0x7827, 0x0002,
74 0x2009, 0x0002, 0x2069, 0x4640, 0x681b, 0x0003, 0x6823, 0x0007, 74 0x2009, 0x0002, 0x2069, 0x4740, 0x681b, 0x0003, 0x6823, 0x0007,
75 0x6827, 0x00fa, 0x682b, 0x0008, 0x682f, 0x0028, 0x6837, 0x0006, 75 0x6827, 0x00fa, 0x682b, 0x0008, 0x682f, 0x0028, 0x6837, 0x0006,
76 0x6833, 0x0008, 0x683b, 0x0000, 0x8109, 0x0500, 0x68cf, 0x000a, 76 0x6833, 0x0008, 0x683b, 0x0000, 0x8109, 0x0500, 0x68cf, 0x000a,
77 0x68bf, 0x46c0, 0x2079, 0x4600, 0x68d3, 0x762d, 0x68c3, 0x4bc0, 77 0x68bf, 0x47c0, 0x2079, 0x4700, 0x68d3, 0x762d, 0x68c3, 0x4cc0,
78 0x68c7, 0x4ac0, 0x68cb, 0x8bc0, 0x68a7, 0x8e44, 0x68ab, 0x8e49, 78 0x68c7, 0x4bc0, 0x68cb, 0x8cc0, 0x68a7, 0x8f44, 0x68ab, 0x8f49,
79 0x68af, 0x8e44, 0x68b3, 0x8e44, 0x68a3, 0x0001, 0x2001, 0x01ff, 79 0x68af, 0x8f44, 0x68b3, 0x8f44, 0x68a3, 0x0001, 0x2001, 0x01ff,
80 0x2004, 0xd0fc, 0x11c8, 0x2069, 0x4680, 0x0870, 0x68cf, 0x000a, 80 0x2004, 0xd0fc, 0x11c8, 0x2069, 0x4780, 0x0870, 0x68cf, 0x000a,
81 0x68bf, 0x48c0, 0x68d3, 0x7839, 0x68c3, 0x6bc0, 0x68c7, 0x4b40, 81 0x68bf, 0x49c0, 0x68d3, 0x7839, 0x68c3, 0x6cc0, 0x68c7, 0x4c40,
82 0x68cb, 0x8cd0, 0x68a7, 0x8e49, 0x68ab, 0x8e4e, 0x68af, 0x8e49, 82 0x68cb, 0x8dd0, 0x68a7, 0x8f49, 0x68ab, 0x8f4e, 0x68af, 0x8f49,
83 0x68b3, 0x8e49, 0x68a3, 0x0001, 0x00e6, 0x2069, 0x4ac0, 0x2071, 83 0x68b3, 0x8f49, 0x68a3, 0x0001, 0x00e6, 0x2069, 0x4bc0, 0x2071,
84 0x0200, 0x70ec, 0xd0e4, 0x2019, 0x1809, 0x2021, 0x0009, 0x1120, 84 0x0200, 0x70ec, 0xd0e4, 0x2019, 0x1809, 0x2021, 0x0009, 0x1120,
85 0x2019, 0x180c, 0x2021, 0x000c, 0x080c, 0x1d58, 0x2001, 0x01ff, 85 0x2019, 0x180c, 0x2021, 0x000c, 0x080c, 0x1d75, 0x2001, 0x01ff,
86 0x2004, 0xd0fc, 0x1188, 0x2069, 0x4b40, 0x2071, 0x0100, 0x70ec, 86 0x2004, 0xd0fc, 0x1188, 0x2069, 0x4c40, 0x2071, 0x0100, 0x70ec,
87 0xd0e4, 0x2019, 0x1809, 0x2021, 0x0009, 0x1120, 0x2019, 0x180c, 87 0xd0e4, 0x2019, 0x1809, 0x2021, 0x0009, 0x1120, 0x2019, 0x180c,
88 0x2021, 0x000c, 0x080c, 0x1d58, 0x00ee, 0x2011, 0x0002, 0x2069, 88 0x2021, 0x000c, 0x080c, 0x1d75, 0x00ee, 0x2011, 0x0002, 0x2069,
89 0x4bc0, 0x2009, 0x0002, 0x20a9, 0x0100, 0x6837, 0x0000, 0x680b, 89 0x4cc0, 0x2009, 0x0002, 0x20a9, 0x0100, 0x6837, 0x0000, 0x680b,
90 0x0040, 0x7bc8, 0xa386, 0xfeff, 0x1128, 0x6817, 0x0100, 0x681f, 90 0x0040, 0x7bc8, 0xa386, 0xfeff, 0x1128, 0x6817, 0x0100, 0x681f,
91 0x0064, 0x0020, 0x6817, 0x0064, 0x681f, 0x0002, 0xade8, 0x0010, 91 0x0064, 0x0020, 0x6817, 0x0064, 0x681f, 0x0002, 0xade8, 0x0010,
92 0x1f04, 0x1135, 0x8109, 0x1d38, 0x2001, 0x01ff, 0x2004, 0xd0fc, 92 0x1f04, 0x1135, 0x8109, 0x1d38, 0x2001, 0x01ff, 0x2004, 0xd0fc,
93 0x1128, 0x8211, 0x0118, 0x2069, 0x6bc0, 0x08d8, 0x080c, 0x22cf, 93 0x1128, 0x8211, 0x0118, 0x2069, 0x6cc0, 0x08d8, 0x080c, 0x22f6,
94 0x080c, 0x4015, 0x080c, 0x1b6d, 0x080c, 0x4553, 0x2091, 0x2200, 94 0x080c, 0x403d, 0x080c, 0x1b8c, 0x080c, 0x4615, 0x2091, 0x2200,
95 0x2079, 0x4600, 0x2071, 0x0050, 0x2091, 0x2400, 0x2079, 0x4600, 95 0x2079, 0x4700, 0x2071, 0x0050, 0x2091, 0x2400, 0x2079, 0x4700,
96 0x2071, 0x0020, 0x2091, 0x2600, 0x2079, 0x0200, 0x2071, 0x4640, 96 0x2071, 0x0020, 0x2091, 0x2600, 0x2079, 0x0200, 0x2071, 0x4740,
97 0x2091, 0x2800, 0x2079, 0x0100, 0x2071, 0x4680, 0x2091, 0x2000, 97 0x2091, 0x2800, 0x2079, 0x0100, 0x2071, 0x4780, 0x2091, 0x2000,
98 0x2079, 0x4600, 0x2071, 0x0010, 0x3200, 0xa085, 0x303d, 0x2090, 98 0x2079, 0x4700, 0x2071, 0x0010, 0x3200, 0xa085, 0x303d, 0x2090,
99 0x2071, 0x0010, 0x70c3, 0x0000, 0x1004, 0x118c, 0x70c0, 0xa086, 99 0x2071, 0x0010, 0x70c3, 0x0000, 0x1004, 0x118c, 0x70c0, 0xa086,
100 0x0002, 0x1110, 0x080c, 0x13ba, 0x2039, 0x0000, 0x080c, 0x12ab, 100 0x0002, 0x1110, 0x080c, 0x13ba, 0x2039, 0x0000, 0x080c, 0x12ab,
101 0x78ac, 0xa005, 0x1180, 0x0e04, 0x119a, 0x786c, 0xa065, 0x0110, 101 0x78ac, 0xa005, 0x1180, 0x0e04, 0x119a, 0x786c, 0xa065, 0x0110,
102 0x080c, 0x207a, 0x080c, 0x1e09, 0x0e04, 0x11af, 0x786c, 0xa065, 102 0x080c, 0x20a1, 0x080c, 0x1e26, 0x0e04, 0x11af, 0x786c, 0xa065,
103 0x0110, 0x080c, 0x207a, 0x0e04, 0x11af, 0x2009, 0x4647, 0x2011, 103 0x0110, 0x080c, 0x20a1, 0x0e04, 0x11af, 0x2009, 0x4747, 0x2011,
104 0x4687, 0x2104, 0x220c, 0xa105, 0x0110, 0x080c, 0x1c7c, 0x2071, 104 0x4787, 0x2104, 0x220c, 0xa105, 0x0110, 0x080c, 0x1c9b, 0x2071,
105 0x4640, 0x70a0, 0xa005, 0x01e8, 0x744c, 0xa485, 0x0000, 0x01c8, 105 0x4740, 0x70a0, 0xa005, 0x01e8, 0x744c, 0xa485, 0x0000, 0x01c8,
106 0x2079, 0x0200, 0x2091, 0x8000, 0x72d0, 0xa28c, 0x303d, 0x2190, 106 0x2079, 0x0200, 0x2091, 0x8000, 0x72d0, 0xa28c, 0x303d, 0x2190,
107 0x080c, 0x2720, 0x2091, 0x8000, 0x2091, 0x303d, 0x0e04, 0x11d1, 107 0x080c, 0x274c, 0x2091, 0x8000, 0x2091, 0x303d, 0x0e04, 0x11d1,
108 0x2079, 0x4600, 0x786c, 0xa065, 0x0120, 0x2071, 0x0010, 0x080c, 108 0x2079, 0x4700, 0x786c, 0xa065, 0x0120, 0x2071, 0x0010, 0x080c,
109 0x207a, 0x1d04, 0x11d9, 0x2079, 0x4600, 0x2071, 0x0010, 0x080c, 109 0x20a1, 0x1d04, 0x11d9, 0x2079, 0x4700, 0x2071, 0x0010, 0x080c,
110 0x4370, 0x2071, 0x4680, 0x70a0, 0xa005, 0x0188, 0x704c, 0xa025, 110 0x4429, 0x2071, 0x4780, 0x70a0, 0xa005, 0x0188, 0x704c, 0xa025,
111 0x0170, 0x2079, 0x0100, 0x2091, 0x8000, 0x72d0, 0xa28c, 0x303d, 111 0x0170, 0x2079, 0x0100, 0x2091, 0x8000, 0x72d0, 0xa28c, 0x303d,
112 0x2190, 0x080c, 0x2720, 0x2091, 0x8000, 0x2091, 0x303d, 0x2079, 112 0x2190, 0x080c, 0x274c, 0x2091, 0x8000, 0x2091, 0x303d, 0x2079,
113 0x4600, 0x2071, 0x0010, 0x0e04, 0x11fa, 0x786c, 0xa065, 0x0110, 113 0x4700, 0x2071, 0x0010, 0x0e04, 0x11fa, 0x786c, 0xa065, 0x0110,
114 0x080c, 0x207a, 0x1d04, 0x118e, 0x080c, 0x4370, 0x0804, 0x118e, 114 0x080c, 0x20a1, 0x1d04, 0x118e, 0x080c, 0x4429, 0x0804, 0x118e,
115 0x3c00, 0xa084, 0x0007, 0x0002, 0x120c, 0x120c, 0x120e, 0x120e, 115 0x3c00, 0xa084, 0x0007, 0x0002, 0x120c, 0x120c, 0x120e, 0x120e,
116 0x1213, 0x1213, 0x1218, 0x1218, 0x080c, 0x254c, 0x2091, 0x2400, 116 0x1213, 0x1213, 0x1218, 0x1218, 0x080c, 0x2575, 0x2091, 0x2400,
117 0x080c, 0x40ad, 0x0005, 0x2091, 0x2200, 0x080c, 0x40ad, 0x0005, 117 0x080c, 0x40d5, 0x0005, 0x2091, 0x2200, 0x080c, 0x40d5, 0x0005,
118 0x2091, 0x2200, 0x080c, 0x40ad, 0x2091, 0x2400, 0x080c, 0x40ad, 118 0x2091, 0x2200, 0x080c, 0x40d5, 0x2091, 0x2400, 0x080c, 0x40d5,
119 0x0005, 0x1241, 0x1241, 0x1242, 0x1242, 0x124d, 0x124d, 0x124d, 119 0x0005, 0x1241, 0x1241, 0x1242, 0x1242, 0x124d, 0x124d, 0x124d,
120 0x124d, 0x1256, 0x1256, 0x1261, 0x1261, 0x124d, 0x124d, 0x124d, 120 0x124d, 0x1256, 0x1256, 0x1261, 0x1261, 0x124d, 0x124d, 0x124d,
121 0x124d, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 121 0x124d, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270,
122 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 122 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270, 0x1270,
123 0x1270, 0x0cf8, 0x0006, 0x0106, 0x0126, 0x2091, 0x2800, 0x080c, 123 0x1270, 0x0cf8, 0x0006, 0x0106, 0x0126, 0x2091, 0x2800, 0x080c,
124 0x2569, 0x012e, 0x010e, 0x000e, 0x000d, 0x0006, 0x0106, 0x0126, 124 0x2592, 0x012e, 0x010e, 0x000e, 0x000d, 0x0006, 0x0106, 0x0126,
125 0x080c, 0x1200, 0x012e, 0x010e, 0x000e, 0x000d, 0x0006, 0x0106, 125 0x080c, 0x1200, 0x012e, 0x010e, 0x000e, 0x000d, 0x0006, 0x0106,
126 0x0126, 0x2091, 0x2600, 0x080c, 0x2569, 0x012e, 0x010e, 0x000e, 126 0x0126, 0x2091, 0x2600, 0x080c, 0x2592, 0x012e, 0x010e, 0x000e,
127 0x000d, 0x0006, 0x0106, 0x0126, 0x2091, 0x2600, 0x080c, 0x2569, 127 0x000d, 0x0006, 0x0106, 0x0126, 0x2091, 0x2600, 0x080c, 0x2592,
128 0x2091, 0x2800, 0x080c, 0x2569, 0x012e, 0x010e, 0x000e, 0x000d, 128 0x2091, 0x2800, 0x080c, 0x2592, 0x012e, 0x010e, 0x000e, 0x000d,
129 0x0006, 0x0106, 0x0126, 0x00d6, 0x00e6, 0x00f6, 0x2079, 0x4600, 129 0x0006, 0x0106, 0x0126, 0x00d6, 0x00e6, 0x00f6, 0x2079, 0x4700,
130 0x2071, 0x0200, 0x2069, 0x4640, 0x3d00, 0xd08c, 0x0130, 0x70ec, 130 0x2071, 0x0200, 0x2069, 0x4740, 0x3d00, 0xd08c, 0x0130, 0x70ec,
131 0xa084, 0x1c00, 0x78e2, 0x080c, 0x459a, 0x3d00, 0xd084, 0x0150, 131 0xa084, 0x1c00, 0x78e2, 0x080c, 0x465c, 0x3d00, 0xd084, 0x0150,
132 0x2069, 0x4680, 0x2071, 0x0100, 0x70ec, 0xa084, 0x1c00, 0x78e6, 132 0x2069, 0x4780, 0x2071, 0x0100, 0x70ec, 0xa084, 0x1c00, 0x78e6,
133 0x080c, 0x459a, 0x080c, 0x24fd, 0x00fe, 0x00ee, 0x00de, 0x012e, 133 0x080c, 0x465c, 0x080c, 0x2526, 0x00fe, 0x00ee, 0x00de, 0x012e,
134 0x010e, 0x000e, 0x000d, 0x7008, 0x800b, 0x1240, 0x7007, 0x0002, 134 0x010e, 0x000e, 0x000d, 0x7008, 0x800b, 0x1240, 0x7007, 0x0002,
135 0xa08c, 0x01e0, 0x1120, 0xd09c, 0x0108, 0x0887, 0x0897, 0x70c3, 135 0xa08c, 0x01e0, 0x1120, 0xd09c, 0x0108, 0x0887, 0x0897, 0x70c3,
136 0x4002, 0x0804, 0x13bd, 0x0e04, 0x131e, 0x2061, 0x0000, 0x6018, 136 0x4002, 0x0804, 0x13bd, 0x0e04, 0x131e, 0x2061, 0x0000, 0x6018,
137 0xd084, 0x1904, 0x131e, 0x7828, 0xa005, 0x1120, 0x0004, 0x131f, 137 0xd084, 0x1904, 0x131e, 0x7828, 0xa005, 0x1120, 0x0004, 0x131f,
138 0x0804, 0x131e, 0xd0fc, 0x0130, 0x0006, 0x080c, 0x1b0a, 0x000e, 138 0x0804, 0x131e, 0xd0fc, 0x0130, 0x0006, 0x080c, 0x1b29, 0x000e,
139 0x0150, 0x0028, 0x0006, 0x080c, 0x1aff, 0x000e, 0x0120, 0x2001, 139 0x0150, 0x0028, 0x0006, 0x080c, 0x1b1e, 0x000e, 0x0120, 0x2001,
140 0x4007, 0x0804, 0x13bc, 0x7910, 0xd0fc, 0x1128, 0x2061, 0x4640, 140 0x4007, 0x0804, 0x13bc, 0x7910, 0xd0fc, 0x1128, 0x2061, 0x4740,
141 0xc19c, 0xc7fc, 0x0020, 0x2061, 0x4680, 0xc19d, 0xc7fd, 0x6060, 141 0xc19c, 0xc7fc, 0x0020, 0x2061, 0x4780, 0xc19d, 0xc7fd, 0x6060,
142 0xa005, 0x1904, 0x131e, 0x7912, 0x607e, 0x7828, 0xc0fc, 0xa086, 142 0xa005, 0x1904, 0x131e, 0x7912, 0x607e, 0x7828, 0xc0fc, 0xa086,
143 0x0018, 0x1120, 0x00c6, 0x080c, 0x1916, 0x00ce, 0x782b, 0x0000, 143 0x0018, 0x1120, 0x00c6, 0x080c, 0x1926, 0x00ce, 0x782b, 0x0000,
144 0x6078, 0xa065, 0x01e0, 0x00c6, 0x609c, 0x080c, 0x1bd4, 0x00ce, 144 0x6078, 0xa065, 0x01e0, 0x00c6, 0x609c, 0x080c, 0x1bf3, 0x00ce,
145 0x609f, 0x0000, 0x080c, 0x1a41, 0x2009, 0x0018, 0x6087, 0x0103, 145 0x609f, 0x0000, 0x080c, 0x1a60, 0x2009, 0x0018, 0x6087, 0x0103,
146 0x7810, 0x0006, 0x84ff, 0x1110, 0x85ff, 0x0110, 0xc0c5, 0x7812, 146 0x7810, 0x0006, 0x84ff, 0x1110, 0x85ff, 0x0110, 0xc0c5, 0x7812,
147 0x080c, 0x1b15, 0x000e, 0x7812, 0x1198, 0x080c, 0x1b60, 0x7810, 147 0x080c, 0x1b34, 0x000e, 0x7812, 0x1198, 0x080c, 0x1b7f, 0x7810,
148 0xd09c, 0x1118, 0x2061, 0x4640, 0x0020, 0x2061, 0x4680, 0xc09c, 148 0xd09c, 0x1118, 0x2061, 0x4740, 0x0020, 0x2061, 0x4780, 0xc09c,
149 0x7812, 0x607b, 0x0000, 0x60d0, 0xd0c4, 0x0130, 0xc0c4, 0x60d2, 149 0x7812, 0x607b, 0x0000, 0x60d0, 0xd0c4, 0x0130, 0xc0c4, 0x60d2,
150 0x2001, 0x4005, 0x0804, 0x13bc, 0x0804, 0x13ba, 0x0005, 0xa006, 150 0x2001, 0x4005, 0x0804, 0x13bc, 0x0804, 0x13ba, 0x0005, 0xa006,
151 0x70c2, 0x70c6, 0x70ca, 0x70ce, 0x70da, 0x70c0, 0xa03d, 0xa08a, 151 0x70c2, 0x70c6, 0x70ca, 0x70ce, 0x70da, 0x70c0, 0xa03d, 0xa08a,
152 0x0040, 0x1a04, 0x136c, 0x0002, 0x13ba, 0x1408, 0x13d6, 0x143c, 152 0x0040, 0x1a04, 0x136c, 0x0002, 0x13ba, 0x1408, 0x13d6, 0x143c,
153 0x1470, 0x1470, 0x13ce, 0x1a59, 0x147a, 0x13c8, 0x13da, 0x13db, 153 0x1470, 0x1470, 0x13ce, 0x1a78, 0x147a, 0x13c8, 0x13da, 0x13db,
154 0x13dc, 0x13dd, 0x1a5d, 0x13c8, 0x1487, 0x14db, 0x1931, 0x1a53, 154 0x13dc, 0x13dd, 0x1a7c, 0x13c8, 0x1487, 0x14db, 0x1941, 0x1a72,
155 0x13de, 0x17ba, 0x17f0, 0x1822, 0x1868, 0x1777, 0x1784, 0x1797, 155 0x13de, 0x17c8, 0x17fe, 0x1830, 0x1876, 0x1785, 0x1792, 0x17a5,
156 0x17a9, 0x15b0, 0x13c8, 0x150d, 0x1518, 0x1526, 0x1534, 0x154b, 156 0x17b7, 0x15bf, 0x13c8, 0x150d, 0x1518, 0x1526, 0x1534, 0x154b,
157 0x1559, 0x155c, 0x156a, 0x1578, 0x1582, 0x1596, 0x15a2, 0x13c8, 157 0x1559, 0x155c, 0x156e, 0x157c, 0x1586, 0x15a5, 0x15b1, 0x13c8,
158 0x13c8, 0x13c8, 0x13c8, 0x15bd, 0x15ce, 0x15e8, 0x161c, 0x1645, 158 0x13c8, 0x13c8, 0x13c8, 0x15cc, 0x15dd, 0x15f7, 0x162b, 0x1654,
159 0x1657, 0x165a, 0x1685, 0x16be, 0x16d0, 0x1745, 0x1755, 0x13c8, 159 0x1666, 0x1669, 0x1693, 0x16cc, 0x16de, 0x1753, 0x1763, 0x13c8,
160 0x13c8, 0x13c8, 0x13c8, 0x1767, 0x2100, 0xa08a, 0x0040, 0x1a04, 160 0x13c8, 0x13c8, 0x13c8, 0x1775, 0x2100, 0xa08a, 0x0040, 0x1a04,
161 0x13c8, 0x0002, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x1a7f, 161 0x13c8, 0x0002, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x1a9e,
162 0x1a85, 0x13c8, 0x13c8, 0x13c8, 0x1a89, 0x1ac9, 0x13c8, 0x13c8, 162 0x1aa4, 0x13c8, 0x13c8, 0x13c8, 0x1aa8, 0x1ae8, 0x13c8, 0x13c8,
163 0x13c8, 0x13c8, 0x1403, 0x146b, 0x1482, 0x14d6, 0x192c, 0x13c8, 163 0x13c8, 0x13c8, 0x1403, 0x146b, 0x1482, 0x14d6, 0x193c, 0x13c8,
164 0x13c8, 0x18fb, 0x13c8, 0x1acd, 0x1a71, 0x1a7b, 0x13c8, 0x13c8, 164 0x13c8, 0x190b, 0x13c8, 0x1aec, 0x1a90, 0x1a9a, 0x13c8, 0x13c8,
165 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 165 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8,
166 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 166 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8,
167 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 167 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8, 0x13c8,
@@ -191,7 +191,7 @@ static unsigned short risc_code01[] = {
191 0x0001, 0x7008, 0xd0fc, 0x0de8, 0xa084, 0x01e0, 0x0d48, 0x70c3, 191 0x0001, 0x7008, 0xd0fc, 0x0de8, 0xa084, 0x01e0, 0x0d48, 0x70c3,
192 0x4002, 0x0804, 0x13bd, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0878, 192 0x4002, 0x0804, 0x13bd, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0878,
193 0x71c4, 0x70c8, 0x2114, 0xa79e, 0x0004, 0x1108, 0x200a, 0x72ca, 193 0x71c4, 0x70c8, 0x2114, 0xa79e, 0x0004, 0x1108, 0x200a, 0x72ca,
194 0x0804, 0x13b9, 0x70c7, 0x000a, 0x70cb, 0x0004, 0x70cf, 0x0020, 194 0x0804, 0x13b9, 0x70c7, 0x000a, 0x70cb, 0x0004, 0x70cf, 0x002a,
195 0x0804, 0x13ba, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0018, 0x2029, 195 0x0804, 0x13ba, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0018, 0x2029,
196 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d0, 0x70c6, 0x72ca, 196 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d0, 0x70c6, 0x72ca,
197 0x73ce, 0x74d2, 0xa005, 0x05e8, 0xa40a, 0x0108, 0x1240, 0x8001, 197 0x73ce, 0x74d2, 0xa005, 0x05e8, 0xa40a, 0x0108, 0x1240, 0x8001,
@@ -211,1281 +211,1286 @@ static unsigned short risc_code01[] = {
211 0xc2c5, 0x7a12, 0x7c96, 0x78ac, 0xa084, 0xfcff, 0x78ae, 0x0018, 211 0xc2c5, 0x7a12, 0x7c96, 0x78ac, 0xa084, 0xfcff, 0x78ae, 0x0018,
212 0x78ac, 0xc0c5, 0x78ae, 0x0804, 0x13ba, 0x2009, 0x0000, 0x786c, 212 0x78ac, 0xc0c5, 0x78ae, 0x0804, 0x13ba, 0x2009, 0x0000, 0x786c,
213 0xa065, 0x0118, 0x8108, 0x6000, 0x0cd8, 0x7ac4, 0x0804, 0x13b8, 213 0xa065, 0x0118, 0x8108, 0x6000, 0x0cd8, 0x7ac4, 0x0804, 0x13b8,
214 0x2009, 0x4648, 0x210c, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 214 0x2009, 0x4748, 0x210c, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904,
215 0x13b9, 0x2011, 0x4688, 0x2214, 0x0804, 0x13b8, 0x2009, 0x4649, 215 0x13b9, 0x2011, 0x4788, 0x2214, 0x0804, 0x13b8, 0x2009, 0x4749,
216 0x210c, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b9, 0x2011, 216 0x210c, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b9, 0x2011,
217 0x4689, 0x2214, 0x0804, 0x13b8, 0x2061, 0x4640, 0x6128, 0x622c, 217 0x4789, 0x2214, 0x0804, 0x13b8, 0x2061, 0x4740, 0x6128, 0x622c,
218 0x8214, 0x8214, 0x8214, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1148, 218 0x8214, 0x8214, 0x8214, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1148,
219 0x2061, 0x4680, 0x6328, 0x73da, 0x632c, 0x831c, 0x831c, 0x831c, 219 0x2061, 0x4780, 0x6328, 0x73da, 0x632c, 0x831c, 0x831c, 0x831c,
220 0x73de, 0x0804, 0x13b8, 0x2009, 0x464c, 0x210c, 0x2001, 0x01ff, 220 0x73de, 0x0804, 0x13b8, 0x2009, 0x474c, 0x210c, 0x2001, 0x01ff,
221 0x2004, 0xd0fc, 0x1904, 0x13b9, 0x2011, 0x468c, 0x2214, 0x0804, 221 0x2004, 0xd0fc, 0x1904, 0x13b9, 0x2011, 0x478c, 0x2214, 0x0804,
222 0x13b8, 0x7918, 0x0804, 0x13b9, 0x2009, 0x0202, 0x210c, 0x2001, 222 0x13b8, 0x7918, 0x0804, 0x13b9, 0x2009, 0x0202, 0x210c, 0xa18c,
223 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b9, 0x2011, 0x0102, 0x2214, 223 0x0f30, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b9, 0x2011,
224 0x0804, 0x13b8, 0x2009, 0x464d, 0x210c, 0x2001, 0x01ff, 0x2004, 224 0x0102, 0x2214, 0xa294, 0x0f30, 0x0804, 0x13b8, 0x2009, 0x474d,
225 0xd0fc, 0x1904, 0x13b9, 0x2011, 0x468d, 0x2214, 0x0804, 0x13b8, 225 0x210c, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b9, 0x2011,
226 0x7920, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b9, 0x7a24, 226 0x478d, 0x2214, 0x0804, 0x13b8, 0x7920, 0x2001, 0x01ff, 0x2004,
227 0x0804, 0x13b8, 0x2011, 0x4b40, 0x71c4, 0xd1fc, 0x1110, 0x2011, 227 0xd0fc, 0x1904, 0x13b9, 0x7a24, 0x0804, 0x13b8, 0x2011, 0x4c40,
228 0x4ac0, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa268, 228 0x71c4, 0xd1fc, 0x1110, 0x2011, 0x4bc0, 0x8107, 0xa084, 0x000f,
229 0x6a00, 0x6b08, 0x6c1c, 0x74da, 0x0804, 0x13b7, 0x77c4, 0x080c, 229 0x8003, 0x8003, 0x8003, 0xa268, 0x6a00, 0x6b08, 0x6c1c, 0x74da,
230 0x1b7b, 0x2091, 0x8000, 0x6b1c, 0x6a14, 0x2091, 0x8001, 0x2708, 230 0xd1fc, 0x1118, 0x2021, 0x023b, 0x0010, 0x2021, 0x013b, 0x2424,
231 0x0804, 0x13b7, 0x2061, 0x4640, 0x6118, 0x2001, 0x01ff, 0x2004, 231 0xa4a4, 0x1c00, 0x74de, 0x0804, 0x13b7, 0x77c4, 0x080c, 0x1b9a,
232 0xd0fc, 0x1904, 0x13b9, 0x2061, 0x4680, 0x6218, 0x0804, 0x13b8, 232 0x2091, 0x8000, 0x6b1c, 0x6a14, 0x2091, 0x8001, 0x2708, 0x0804,
233 0x77c4, 0x080c, 0x1b7b, 0x2091, 0x8000, 0x6908, 0x6a18, 0x6b10, 233 0x13b7, 0x2061, 0x4740, 0x6118, 0x2001, 0x01ff, 0x2004, 0xd0fc,
234 0x77da, 0x2091, 0x8001, 0x0804, 0x13b7, 0x71c4, 0x2110, 0xa294, 234 0x1904, 0x13b9, 0x2061, 0x4780, 0x6218, 0x0804, 0x13b8, 0x77c4,
235 0x000f, 0xa282, 0x0010, 0x1a04, 0x13b3, 0x080c, 0x238b, 0xa384, 235 0x080c, 0x1b9a, 0x2091, 0x8000, 0x6908, 0x6a18, 0x6b10, 0x77da,
236 0x4000, 0x0110, 0xa295, 0x0020, 0x0804, 0x13b7, 0x71c4, 0x2100, 236 0x2091, 0x8001, 0x0804, 0x13b7, 0x71c4, 0x2110, 0xa294, 0x000f,
237 0xc0bc, 0xa082, 0x0010, 0x1a04, 0x13b3, 0xd1bc, 0x1120, 0x2011, 237 0xa282, 0x0010, 0x1a04, 0x13b3, 0x080c, 0x23b4, 0xa384, 0x4000,
238 0x4648, 0x2204, 0x0020, 0x2011, 0x4688, 0x2204, 0xc0bd, 0x0006, 238 0x0110, 0xa295, 0x0020, 0x0804, 0x13b7, 0x71c4, 0x2100, 0xc0bc,
239 0x2100, 0xc0bc, 0x2012, 0x080c, 0x2331, 0x001e, 0x0804, 0x13b9, 239 0xa082, 0x0010, 0x1a04, 0x13b3, 0xd1bc, 0x1120, 0x2011, 0x4748,
240 0x71c4, 0x2021, 0x4649, 0x2404, 0x70c6, 0x2019, 0x0000, 0x0030, 240 0x2204, 0x0020, 0x2011, 0x4788, 0x2204, 0xc0bd, 0x0006, 0x2100,
241 0x71c8, 0x2021, 0x4689, 0x2404, 0x70ca, 0xc3fd, 0x2011, 0x1614, 241 0xc0bc, 0x2012, 0x080c, 0x2358, 0x001e, 0x0804, 0x13b9, 0x71c4,
242 0x20a9, 0x0008, 0x2204, 0xa106, 0x0138, 0x8210, 0x1f04, 0x15fa, 242 0x2021, 0x4749, 0x2404, 0x70c6, 0x2019, 0x0000, 0x0030, 0x71c8,
243 0x71c4, 0x72c8, 0x0804, 0x13b2, 0xa292, 0x1614, 0x0026, 0x2122, 243 0x2021, 0x4789, 0x2404, 0x70ca, 0xc3fd, 0x2011, 0x1623, 0x20a9,
244 0x001e, 0x080c, 0x2343, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1110, 244 0x0008, 0x2204, 0xa106, 0x0138, 0x8210, 0x1f04, 0x1609, 0x71c4,
245 0xd3fc, 0x09f0, 0x0804, 0x13ba, 0x03e8, 0x00fa, 0x01f4, 0x02ee, 245 0x72c8, 0x0804, 0x13b2, 0xa292, 0x1623, 0x0026, 0x2122, 0x001e,
246 0x0004, 0x0001, 0x0002, 0x0003, 0x2061, 0x4640, 0x6128, 0x622c, 246 0x080c, 0x236a, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1110, 0xd3fc,
247 0x8214, 0x8214, 0x8214, 0x70c4, 0x602a, 0x70c8, 0x8003, 0x8003, 247 0x09f0, 0x0804, 0x13ba, 0x03e8, 0x00fa, 0x01f4, 0x02ee, 0x0004,
248 0x8003, 0x602e, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x11a0, 0x0026, 248 0x0001, 0x0002, 0x0003, 0x2061, 0x4740, 0x6128, 0x622c, 0x8214,
249 0x0016, 0x2061, 0x4680, 0x6128, 0x622c, 0x8214, 0x8214, 0x8214, 249 0x8214, 0x8214, 0x70c4, 0x602a, 0x70c8, 0x8003, 0x8003, 0x8003,
250 0x70d8, 0x602a, 0x70dc, 0x8003, 0x8003, 0x8003, 0x602e, 0x71da, 250 0x602e, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x11a0, 0x0026, 0x0016,
251 0x72de, 0x001e, 0x002e, 0x0804, 0x13b8, 0x2061, 0x4640, 0x6130, 251 0x2061, 0x4780, 0x6128, 0x622c, 0x8214, 0x8214, 0x8214, 0x70d8,
252 0x70c4, 0x6032, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b9, 252 0x602a, 0x70dc, 0x8003, 0x8003, 0x8003, 0x602e, 0x71da, 0x72de,
253 0x2061, 0x4680, 0x6230, 0x70c8, 0x6032, 0x0804, 0x13b8, 0x7918, 253 0x001e, 0x002e, 0x0804, 0x13b8, 0x2061, 0x4740, 0x6130, 0x70c4,
254 0x0804, 0x13b9, 0x71c4, 0xa184, 0xf0cf, 0x0148, 0x2001, 0x01ff, 254 0x6032, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b9, 0x2061,
255 0x2004, 0xd0fc, 0x1904, 0x13b3, 0x72c8, 0x0804, 0x13b2, 0x0006, 255 0x4780, 0x6230, 0x70c8, 0x6032, 0x0804, 0x13b8, 0x7918, 0x0804,
256 0x2019, 0x0000, 0x080c, 0x237f, 0x2001, 0x01ff, 0x2004, 0xd0fc, 256 0x13b9, 0x71c4, 0xa184, 0xf0cf, 0x0148, 0x2001, 0x01ff, 0x2004,
257 0x0118, 0x001e, 0x0804, 0x13b9, 0x71c8, 0xa184, 0xf0cf, 0x0128, 257 0xd0fc, 0x1904, 0x13b3, 0x72c8, 0x0804, 0x13b2, 0x2019, 0x0000,
258 0x0006, 0x2110, 0x71c4, 0x0804, 0x13b2, 0x0006, 0xc3fd, 0x080c, 258 0x080c, 0x23a6, 0x0036, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x0118,
259 0x237f, 0x002e, 0x001e, 0x0804, 0x13b8, 0x71c4, 0xa182, 0x0010, 259 0x001e, 0x0804, 0x13b9, 0x71c8, 0xa184, 0xf0cf, 0x0128, 0x000e,
260 0x0248, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b3, 0x72c8, 260 0x2110, 0x71c4, 0x0804, 0x13b2, 0xc3fd, 0x080c, 0x23a6, 0x2310,
261 0x0804, 0x13b2, 0x2011, 0x464d, 0x2204, 0x0006, 0x8104, 0x1208, 261 0x001e, 0x0804, 0x13b8, 0x71c4, 0xa182, 0x0010, 0x0248, 0x2001,
262 0x8108, 0x2112, 0x2019, 0x0000, 0x080c, 0x236c, 0x2001, 0x01ff, 262 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b3, 0x72c8, 0x0804, 0x13b2,
263 0x2004, 0xd0fc, 0x0118, 0x001e, 0x0804, 0x13b9, 0x71c8, 0xa182, 263 0x2011, 0x474d, 0x2204, 0x0006, 0x8104, 0x1208, 0x8108, 0x2112,
264 0x0010, 0x0228, 0x0006, 0x2110, 0x71c4, 0x0804, 0x13b2, 0x2011, 264 0x2019, 0x0000, 0x080c, 0x2393, 0x2001, 0x01ff, 0x2004, 0xd0fc,
265 0x468d, 0x2204, 0x0006, 0x8104, 0x1208, 0x8108, 0x2112, 0xc3fd, 265 0x0118, 0x001e, 0x0804, 0x13b9, 0x71c8, 0xa182, 0x0010, 0x0228,
266 0x080c, 0x236c, 0x002e, 0x001e, 0x0804, 0x13b8, 0x71c4, 0x72c8, 266 0x0006, 0x2110, 0x71c4, 0x0804, 0x13b2, 0x2011, 0x478d, 0x2204,
267 0xa184, 0xfffd, 0x1904, 0x13b2, 0xa284, 0xfffd, 0x1904, 0x13b2, 267 0x0006, 0x8104, 0x1208, 0x8108, 0x2112, 0xc3fd, 0x080c, 0x2393,
268 0x2100, 0x7920, 0x7822, 0x2200, 0x7a24, 0x7826, 0x0804, 0x13b8, 268 0x002e, 0x001e, 0x0804, 0x13b8, 0x71c4, 0x72c8, 0xa184, 0xfffd,
269 0x2011, 0x4b40, 0x71c4, 0xd1fc, 0x1110, 0x2011, 0x4ac0, 0x8107, 269 0x1904, 0x13b2, 0xa284, 0xfffd, 0x1904, 0x13b2, 0x2100, 0x7920,
270 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa268, 0x72c8, 0x73cc, 270 0x7822, 0x2200, 0x7a24, 0x7826, 0x0804, 0x13b8, 0x2011, 0x4c40,
271 0x74d8, 0x71c6, 0x6800, 0x70ca, 0x73ce, 0x74da, 0x2091, 0x8000, 271 0x71c4, 0xd1fc, 0x1110, 0x2011, 0x4bc0, 0x8107, 0xa084, 0x000f,
272 0x6a02, 0xd2ac, 0x1118, 0x2021, 0x0000, 0x0090, 0xa484, 0x00ff, 272 0x8003, 0x8003, 0x8003, 0xa268, 0x72c8, 0x73cc, 0x74d8, 0x71c6,
273 0xa082, 0x0002, 0x1a04, 0x1741, 0x843f, 0xa7bc, 0x00ff, 0x0140, 273 0x6800, 0x70ca, 0x73ce, 0x74da, 0x2091, 0x8000, 0x6a02, 0xd2ac,
274 0xa786, 0x0002, 0x1904, 0x1741, 0xa484, 0x00ff, 0x0904, 0x1741, 274 0x1118, 0x2021, 0x0000, 0x0090, 0xa484, 0x00ff, 0xa082, 0x0002,
275 0x2061, 0x0200, 0xd1fc, 0x0110, 0x2061, 0x0100, 0x2029, 0x0009, 275 0x1a04, 0x174f, 0x843f, 0xa7bc, 0x00ff, 0x0140, 0xa786, 0x0002,
276 0x2031, 0x0062, 0x843f, 0xa7bc, 0x00ff, 0x0130, 0x8307, 0xa084, 276 0x1904, 0x174f, 0xa484, 0x00ff, 0x0904, 0x174f, 0x2061, 0x0200,
277 0x00ff, 0x1110, 0xa73d, 0x1138, 0x2041, 0x0019, 0xa384, 0x00ff, 277 0xd1fc, 0x0110, 0x2061, 0x0100, 0x2029, 0x0009, 0x2031, 0x0062,
278 0xa082, 0x001a, 0x0210, 0xa4a4, 0x00ff, 0x8307, 0xa084, 0x00ff, 278 0x843f, 0xa7bc, 0x00ff, 0x0130, 0x8307, 0xa084, 0x00ff, 0x1110,
279 0x0188, 0xa842, 0x02f0, 0xa086, 0x0010, 0x1120, 0xa39c, 0x00ff, 279 0xa73d, 0x1138, 0x2041, 0x0019, 0xa384, 0x00ff, 0xa082, 0x001a,
280 0xa39d, 0x0f00, 0xa3bc, 0x00ff, 0x2500, 0xa702, 0x0290, 0x2600, 280 0x0210, 0xa4a4, 0x00ff, 0x8307, 0xa084, 0x00ff, 0x0188, 0xa842,
281 0xa702, 0x1278, 0x2039, 0x003a, 0x6804, 0xa705, 0x6806, 0x6b0a, 281 0x02f0, 0xa086, 0x0010, 0x1120, 0xa39c, 0x00ff, 0xa39d, 0x0f00,
282 0x6b0c, 0x73ce, 0x681c, 0x70da, 0x6c1e, 0x2091, 0x8001, 0x0804, 282 0xa3bc, 0x00ff, 0x2500, 0xa702, 0x0290, 0x2600, 0xa702, 0x1278,
283 0x13ba, 0x2091, 0x8001, 0x0804, 0x13b4, 0x77c4, 0x080c, 0x1b7b, 283 0x2039, 0x003a, 0x6804, 0xa705, 0x6806, 0x6b0a, 0x6b0c, 0x73ce,
284 0x2091, 0x8000, 0x6a14, 0x6b1c, 0x2091, 0x8001, 0x70c8, 0x6816, 284 0x681c, 0x70da, 0x6c1e, 0x2091, 0x8001, 0x0804, 0x13ba, 0x2091,
285 0x70cc, 0x681e, 0x2708, 0x0804, 0x13b7, 0x70c4, 0x2061, 0x4640, 285 0x8001, 0x0804, 0x13b4, 0x77c4, 0x080c, 0x1b9a, 0x2091, 0x8000,
286 0x6118, 0x601a, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b9, 286 0x6a14, 0x6b1c, 0x2091, 0x8001, 0x70c8, 0x6816, 0x70cc, 0x681e,
287 0x70c8, 0x2061, 0x4680, 0x6218, 0x601a, 0x0804, 0x13b8, 0x71c4, 287 0x2708, 0x0804, 0x13b7, 0x70c4, 0x2061, 0x4740, 0x6118, 0x601a,
288 0x72c8, 0x73cc, 0xa182, 0x0010, 0x1a04, 0x13b3, 0x080c, 0x23af, 288 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x13b9, 0x70c8, 0x2061,
289 0xa384, 0x4000, 0x0110, 0xa295, 0x0020, 0x0804, 0x13b7, 0x77c4, 289 0x4780, 0x6218, 0x601a, 0x0804, 0x13b8, 0x71c4, 0x72c8, 0x73cc,
290 0x080c, 0x1b7b, 0x2091, 0x8000, 0x6a08, 0xc28d, 0x6a0a, 0x2091, 290 0xa182, 0x0010, 0x1a04, 0x13b3, 0x080c, 0x23d8, 0xa384, 0x4000,
291 0x8001, 0x2708, 0x0804, 0x13b8, 0x77c4, 0x080c, 0x1b7b, 0x2091, 291 0x0110, 0xa295, 0x0020, 0x0804, 0x13b7, 0x77c4, 0x080c, 0x1b9a,
292 0x8000, 0x6a08, 0xa294, 0xfff9, 0x6a0a, 0x6804, 0xa005, 0x0110, 292 0x2091, 0x8000, 0x6a08, 0xc28d, 0x6a0a, 0x2091, 0x8001, 0x2708,
293 0x080c, 0x22ae, 0x2091, 0x8001, 0x2708, 0x0804, 0x13b8, 0x77c4, 293 0x0804, 0x13b8, 0x77c4, 0x080c, 0x1b9a, 0x2091, 0x8000, 0x6a08,
294 0x080c, 0x1b7b, 0x2091, 0x8000, 0x6a08, 0xc295, 0x6a0a, 0x6804, 294 0xa294, 0xfff9, 0x6a0a, 0x6804, 0xa005, 0x0110, 0x080c, 0x22d5,
295 0xa005, 0x0110, 0x080c, 0x22ae, 0x2091, 0x8001, 0x2708, 0x0804, 295 0x2091, 0x8001, 0x2708, 0x0804, 0x13b8, 0x77c4, 0x080c, 0x1b9a,
296 0x13b8, 0x77c4, 0x2041, 0x0001, 0x2049, 0x0005, 0x2051, 0x0020, 296 0x2091, 0x8000, 0x6a08, 0xc295, 0x6a0a, 0x6804, 0xa005, 0x0110,
297 0x2091, 0x8000, 0x080c, 0x1b93, 0x2091, 0x8001, 0x2708, 0x6a08, 297 0x080c, 0x22d5, 0x2091, 0x8001, 0x2708, 0x0804, 0x13b8, 0x77c4,
298 0x0804, 0x13b8, 0x77c4, 0xd7fc, 0x0128, 0x080c, 0x1b0a, 0x0138, 298 0x2041, 0x0001, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, 0x8000,
299 0x0804, 0x13bc, 0x080c, 0x1aff, 0x0110, 0x0804, 0x13bc, 0x73c8, 299 0x080c, 0x1bb2, 0x2091, 0x8001, 0x2708, 0x6a08, 0x0804, 0x13b8,
300 0x72cc, 0x77c6, 0x73ca, 0x72ce, 0x080c, 0x1c0b, 0x11e8, 0x6818, 300 0x77c4, 0xd7fc, 0x0128, 0x080c, 0x1b29, 0x0138, 0x0804, 0x13bc,
301 0xa005, 0x01a0, 0x2708, 0x0076, 0x080c, 0x23ce, 0x007e, 0x1170, 301 0x080c, 0x1b1e, 0x0110, 0x0804, 0x13bc, 0x73c8, 0x72cc, 0x77c6,
302 0x2001, 0x0015, 0xd7fc, 0x1118, 0x2061, 0x4640, 0x0018, 0xc0fd, 302 0x73ca, 0x72ce, 0x080c, 0x1c2a, 0x11e8, 0x6818, 0xa005, 0x01a0,
303 0x2061, 0x4680, 0x782a, 0x2091, 0x8001, 0x0005, 0x2091, 0x8001, 303 0x2708, 0x0076, 0x080c, 0x23f7, 0x007e, 0x1170, 0x2001, 0x0015,
304 0x2001, 0x4005, 0x0804, 0x13bc, 0x2091, 0x8001, 0x0804, 0x13ba, 304 0xd7fc, 0x1118, 0x2061, 0x4740, 0x0018, 0xc0fd, 0x2061, 0x4780,
305 0x77c4, 0xd7fc, 0x0128, 0x080c, 0x1b0a, 0x0138, 0x0804, 0x13bc, 305 0x782a, 0x2091, 0x8001, 0x0005, 0x2091, 0x8001, 0x2001, 0x4005,
306 0x080c, 0x1aff, 0x0110, 0x0804, 0x13bc, 0x77c6, 0x2041, 0x0021, 306 0x0804, 0x13bc, 0x2091, 0x8001, 0x0804, 0x13ba, 0x77c4, 0xd7fc,
307 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 0x080c, 0x1b93, 307 0x0128, 0x080c, 0x1b29, 0x0138, 0x0804, 0x13bc, 0x080c, 0x1b1e,
308 0x2009, 0x0016, 0xd7fc, 0x1118, 0x2061, 0x4640, 0x0018, 0x2061, 308 0x0110, 0x0804, 0x13bc, 0x77c6, 0x2041, 0x0021, 0x2049, 0x0005,
309 0x4680, 0xc1fd, 0x6063, 0x0003, 0x607b, 0x0000, 0x6772, 0x607f, 309 0x2051, 0x0020, 0x2091, 0x8000, 0x080c, 0x1bb2, 0x2009, 0x0016,
310 0x000f, 0x792a, 0x61d0, 0xc1c4, 0x61d2, 0x080c, 0x22ae, 0x2091, 310 0xd7fc, 0x1118, 0x2061, 0x4740, 0x0018, 0x2061, 0x4780, 0xc1fd,
311 0x8001, 0x0005, 0x77c8, 0x77ca, 0x77c4, 0x77c6, 0xd7fc, 0x0128, 311 0x6063, 0x0003, 0x607b, 0x0000, 0x6772, 0x607f, 0x000f, 0x792a,
312 0x080c, 0x1b0a, 0x0138, 0x0804, 0x13bc, 0x080c, 0x1aff, 0x0110, 312 0x61d0, 0xc1c4, 0x61d2, 0x080c, 0x22d5, 0x2091, 0x8001, 0x0005,
313 0x0804, 0x13bc, 0xa7bc, 0xff00, 0x2091, 0x8000, 0x2009, 0x0017, 313 0x77c8, 0x77ca, 0x77c4, 0x77c6, 0xd7fc, 0x0128, 0x080c, 0x1b29,
314 0xd7fc, 0x1118, 0x2061, 0x4640, 0x0018, 0x2061, 0x4680, 0xc1fd, 314 0x0138, 0x0804, 0x13bc, 0x080c, 0x1b1e, 0x0110, 0x0804, 0x13bc,
315 0x607b, 0x0000, 0x6063, 0x0002, 0x6772, 0x607f, 0x000f, 0x792a, 315 0xa7bc, 0xff00, 0x2091, 0x8000, 0x2009, 0x0017, 0xd7fc, 0x1118,
316 0x61d0, 0xc1c4, 0x61d2, 0x080c, 0x22ae, 0x2091, 0x8001, 0x2041, 316 0x2061, 0x4740, 0x0018, 0x2061, 0x4780, 0xc1fd, 0x607b, 0x0000,
317 0x0021, 0x2049, 0x0005, 0x2051, 0x0030, 0x2091, 0x8000, 0x70c8, 317 0x6063, 0x0002, 0x6772, 0x607f, 0x000f, 0x792a, 0x61d0, 0xc1c4,
318 0xa005, 0x0118, 0x60d0, 0xc0fd, 0x60d2, 0x080c, 0x1b93, 0x70c8, 318 0x61d2, 0x080c, 0x22d5, 0x2091, 0x8001, 0x2041, 0x0021, 0x2049,
319 0x6836, 0x8738, 0xa784, 0x001f, 0x1dc0, 0x2091, 0x8001, 0x0005, 319 0x0005, 0x2051, 0x0010, 0x2091, 0x8000, 0x70c8, 0xa005, 0x0118,
320 0x2019, 0x0000, 0x72c8, 0xd284, 0x0128, 0x080c, 0x1b0a, 0x0138, 320 0x60d0, 0xc0fd, 0x60d2, 0x080c, 0x1bb2, 0x70c8, 0x6836, 0x8738,
321 0x0804, 0x13bc, 0x080c, 0x1aff, 0x0110, 0x0804, 0x13bc, 0x72c8, 321 0xa784, 0x001f, 0x1dc0, 0x2091, 0x8001, 0x0005, 0x2019, 0x0000,
322 0x72ca, 0x78ac, 0xa084, 0x0003, 0x1508, 0x2039, 0x0000, 0xd284, 322 0x72c8, 0xd284, 0x0128, 0x080c, 0x1b29, 0x0138, 0x0804, 0x13bc,
323 0x0108, 0xc7fd, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 323 0x080c, 0x1b1e, 0x0110, 0x0804, 0x13bc, 0x72c8, 0x72ca, 0x78ac,
324 0x080c, 0x1b7b, 0x2091, 0x8000, 0x6808, 0xc0d4, 0xa80d, 0x690a, 324 0xa084, 0x0003, 0x1518, 0x2039, 0x0000, 0xd284, 0x0108, 0xc7fd,
325 0x2091, 0x8001, 0x8738, 0xa784, 0x001f, 0x1d90, 0xa7bc, 0xff00, 325 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 0x080c, 0x1b9a,
326 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, 0x1d50, 0x2091, 0x8000, 326 0x2091, 0x8000, 0x6808, 0xc0d4, 0xa80d, 0x690a, 0x6837, 0x0000,
327 0x2091, 0x8001, 0x8738, 0xa784, 0x001f, 0x1d80, 0xa7bc, 0xff00,
328 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, 0x1d40, 0x2091, 0x8000,
327 0x72c8, 0x2069, 0x0100, 0xd284, 0x1110, 0x2069, 0x0200, 0x6808, 329 0x72c8, 0x2069, 0x0100, 0xd284, 0x1110, 0x2069, 0x0200, 0x6808,
328 0xa084, 0xfffd, 0x680a, 0x6830, 0xd0b4, 0x01b0, 0x684b, 0x0004, 330 0xa084, 0xfffd, 0x680a, 0x6830, 0xd0b4, 0x01b0, 0x684b, 0x0004,
329 0x20a9, 0x0014, 0x6848, 0xd094, 0x0110, 0x1f04, 0x18b2, 0x684b, 331 0x20a9, 0x0014, 0x6848, 0xd094, 0x0110, 0x1f04, 0x18c2, 0x684b,
330 0x0009, 0x20a9, 0x0014, 0x6848, 0xd084, 0x0110, 0x1f04, 0x18bb, 332 0x0009, 0x20a9, 0x0014, 0x6848, 0xd084, 0x0110, 0x1f04, 0x18cb,
331 0x20a9, 0x00fa, 0x1f04, 0x18c2, 0x2079, 0x4600, 0x2009, 0x0018, 333 0x20a9, 0x00fa, 0x1f04, 0x18d2, 0x2079, 0x4700, 0x2009, 0x0018,
332 0x72c8, 0xd284, 0x1118, 0x2061, 0x4640, 0x0018, 0x2061, 0x4680, 334 0x72c8, 0xd284, 0x1118, 0x2061, 0x4740, 0x0018, 0x2061, 0x4780,
333 0xc1fd, 0x607b, 0x0000, 0x792a, 0x6063, 0x0001, 0x607f, 0x000f, 335 0xc1fd, 0x607b, 0x0000, 0x792a, 0x6063, 0x0001, 0x607f, 0x000f,
334 0x60a3, 0x0000, 0x60a4, 0x60ae, 0x60b2, 0x60d0, 0xd0b4, 0x0160, 336 0x60a3, 0x0000, 0x60a4, 0x60ae, 0x60b2, 0x60d0, 0xd0b4, 0x0160,
335 0xc0b4, 0x60d2, 0x00c6, 0x60b4, 0xa065, 0x6008, 0xc0d4, 0x600a, 337 0xc0b4, 0x60d2, 0x00c6, 0x60b4, 0xa065, 0x6008, 0xc0d4, 0x600a,
336 0x6018, 0x8001, 0x601a, 0x00ce, 0x60d0, 0xa084, 0x7eff, 0x60d2, 338 0x6018, 0x8001, 0x601a, 0x00ce, 0x60d0, 0xa084, 0x7eff, 0x60d2,
337 0x78ac, 0xc08d, 0x78ae, 0x83ff, 0x0108, 0x0005, 0x681b, 0x0054, 339 0x78ac, 0xc08d, 0x78ae, 0x83ff, 0x0108, 0x0005, 0x681b, 0x0054,
338 0x2091, 0x8001, 0x0005, 0x73cc, 0x080c, 0x186a, 0x69ec, 0x6a48, 340 0x2091, 0x8001, 0x0005, 0x73cc, 0x080c, 0x1878, 0x69ec, 0x6a48,
339 0xa185, 0x1800, 0x684a, 0xa185, 0x0040, 0x68ee, 0x73cc, 0x2021, 341 0xa185, 0x1800, 0x684a, 0xa185, 0x0040, 0x68ee, 0x73cc, 0x2021,
340 0x0004, 0x20a9, 0x09ff, 0x1f04, 0x190b, 0x8421, 0x1dd0, 0x8319, 342 0x0004, 0x20a9, 0x09ff, 0x1f04, 0x191b, 0x8421, 0x1dd0, 0x8319,
341 0x1db0, 0x69ee, 0x6a4a, 0x2091, 0x8001, 0x0005, 0xd7fc, 0x1118, 343 0x1db0, 0x69ee, 0x6a4a, 0x2091, 0x8001, 0x0005, 0xd7fc, 0x1118,
342 0x2069, 0x4640, 0x0010, 0x2069, 0x4680, 0x71c4, 0x71c6, 0x6916, 344 0x2069, 0x4740, 0x0010, 0x2069, 0x4780, 0x71c4, 0x71c6, 0x6916,
343 0x81ff, 0x1110, 0x68a3, 0x0001, 0x78ac, 0xc08c, 0x78ae, 0xd084, 345 0x81ff, 0x1110, 0x68a3, 0x0001, 0x78ac, 0xc08c, 0x78ae, 0xd084,
344 0x1110, 0x080c, 0x1c5b, 0x0005, 0x75d8, 0x74dc, 0x75da, 0x74de, 346 0x1110, 0x080c, 0x1c7a, 0x0005, 0x75d8, 0x74dc, 0x75da, 0x74de,
345 0x0010, 0xa02e, 0x2520, 0x71c4, 0x73c8, 0x72cc, 0x71c6, 0x73ca, 347 0x0010, 0xa02e, 0x2520, 0x71c4, 0x73c8, 0x72cc, 0x71c6, 0x73ca,
346 0x72ce, 0x2079, 0x4600, 0x7dde, 0x7cda, 0x7bd6, 0x7ad2, 0x080c, 348 0x72ce, 0x2079, 0x4700, 0x7dde, 0x7cda, 0x7bd6, 0x7ad2, 0x080c,
347 0x1b58, 0x0904, 0x1a3d, 0x20a9, 0x0005, 0x20a1, 0x4614, 0x2091, 349 0x1b77, 0x0904, 0x1a5c, 0x20a9, 0x0005, 0x20a1, 0x4714, 0x2091,
348 0x8000, 0x41a1, 0x2091, 0x8001, 0x2009, 0x0040, 0x080c, 0x1d24, 350 0x8000, 0x41a1, 0x2091, 0x8001, 0x2009, 0x0040, 0x080c, 0x1d41,
349 0x0120, 0x080c, 0x1b60, 0x0804, 0x1a3d, 0x6004, 0xa08c, 0x00ff, 351 0x0120, 0x080c, 0x1b7f, 0x0804, 0x1a5c, 0x6004, 0xa08c, 0x00ff,
350 0xa18e, 0x0009, 0x1120, 0x0006, 0x080c, 0x205f, 0x000e, 0xa084, 352 0xa18e, 0x0009, 0x1120, 0x0006, 0x080c, 0x2086, 0x000e, 0xa084,
351 0xff00, 0x8007, 0x8009, 0x0904, 0x19e1, 0x00c6, 0x2c68, 0x080c, 353 0xff00, 0x8007, 0x8009, 0x0904, 0x19f1, 0x00c6, 0x2c68, 0x080c,
352 0x1b58, 0x05a8, 0x2c00, 0x689e, 0x8109, 0x1dc0, 0x609f, 0x0000, 354 0x1b77, 0x05a8, 0x2c00, 0x689e, 0x8109, 0x1dc0, 0x609f, 0x0000,
353 0x00ce, 0x00c6, 0x7ddc, 0x7cd8, 0x7bd4, 0x7ad0, 0xa290, 0x0040, 355 0x00ce, 0x00c6, 0x7ddc, 0x7cd8, 0x7bd4, 0x7ad0, 0xa290, 0x0040,
354 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x7dde, 0x7cda, 356 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x7dde, 0x7cda,
355 0x7bd6, 0x7ad2, 0x2c68, 0x689c, 0xa065, 0x0904, 0x19e0, 0x2009, 357 0x7bd6, 0x7ad2, 0x2c68, 0x689c, 0xa065, 0x0904, 0x19f0, 0x2009,
356 0x0040, 0x080c, 0x1d24, 0x15a0, 0x6004, 0xa084, 0x00ff, 0xa086, 358 0x0040, 0x080c, 0x1d41, 0x15a0, 0x6004, 0xa084, 0x00ff, 0xa086,
357 0x0002, 0x1168, 0x6004, 0xa084, 0x00ff, 0xa086, 0x000a, 0x1120, 359 0x0002, 0x0150, 0x6004, 0xa084, 0x00ff, 0xa086, 0x000a, 0x1138,
358 0x0016, 0x080c, 0x205c, 0x001e, 0x2d00, 0x6002, 0x0898, 0x00ce, 360 0x0016, 0x080c, 0x2083, 0x001e, 0x2d00, 0x6002, 0x0898, 0x00ce,
359 0x00c6, 0x609c, 0x080c, 0x1bd4, 0x00ce, 0x609f, 0x0000, 0x080c, 361 0x00c6, 0x609c, 0x080c, 0x1bf3, 0x00ce, 0x609f, 0x0000, 0x080c,
360 0x1a41, 0x2009, 0x0018, 0x6008, 0xc0cd, 0x600a, 0x6004, 0x6086, 362 0x1a60, 0x2009, 0x0018, 0x6008, 0xc0cd, 0x600a, 0x6004, 0x6086,
361 0x7810, 0x0006, 0x84ff, 0x1110, 0x85ff, 0x0110, 0xc0c5, 0x7812, 363 0x7810, 0x0006, 0x84ff, 0x1110, 0x85ff, 0x0110, 0xc0c5, 0x7812,
362 0x080c, 0x1b15, 0x000e, 0x7812, 0x080c, 0x1b60, 0x0804, 0x1a3d, 364 0x080c, 0x1b34, 0x000e, 0x7812, 0x080c, 0x1b7f, 0x0804, 0x1a5c,
363 0x00ce, 0x00c6, 0x609c, 0x080c, 0x1bd4, 0x00ce, 0x609f, 0x0000, 365 0x00ce, 0x00c6, 0x609c, 0x080c, 0x1bf3, 0x00ce, 0x609f, 0x0000,
364 0x080c, 0x1a41, 0x2009, 0x0018, 0x6087, 0x0103, 0x601b, 0x0003, 366 0x080c, 0x1a60, 0x2009, 0x0018, 0x6087, 0x0103, 0x601b, 0x0003,
365 0x7810, 0x0006, 0x84ff, 0x1110, 0x85ff, 0x0110, 0xc0c5, 0x7812, 367 0x7810, 0x0006, 0x84ff, 0x1110, 0x85ff, 0x0110, 0xc0c5, 0x7812,
366 0x080c, 0x1b15, 0x000e, 0x7812, 0x080c, 0x1b60, 0x0804, 0x1a3d, 368 0x080c, 0x1b34, 0x000e, 0x7812, 0x080c, 0x1b7f, 0x0804, 0x1a5c,
367 0x00ce, 0x6114, 0xd1fc, 0x0120, 0x080c, 0x1b0a, 0x01f0, 0x0018, 369 0x00ce, 0x6114, 0xd1fc, 0x0120, 0x080c, 0x1b29, 0x01f0, 0x0018,
368 0x080c, 0x1aff, 0x01d0, 0x080c, 0x1a41, 0x2009, 0x0018, 0x6087, 370 0x080c, 0x1b1e, 0x01d0, 0x080c, 0x1a60, 0x2009, 0x0018, 0x6087,
369 0x0103, 0x601b, 0x0021, 0x7810, 0x0006, 0x84ff, 0x1110, 0x85ff, 371 0x0103, 0x601b, 0x0021, 0x7810, 0x0006, 0x84ff, 0x1110, 0x85ff,
370 0x0110, 0xc0c5, 0x7812, 0x080c, 0x1b15, 0x000e, 0x7812, 0x080c, 372 0x0110, 0xc0c5, 0x7812, 0x080c, 0x1b34, 0x000e, 0x7812, 0x080c,
371 0x1b60, 0x2001, 0x4007, 0x0804, 0x13bc, 0x74c4, 0x73c8, 0x72cc, 373 0x1b7f, 0x2001, 0x4007, 0x0804, 0x13bc, 0x6104, 0xa18c, 0x00ff,
372 0x6014, 0x2091, 0x8000, 0x00e6, 0x2009, 0x0012, 0xd0fc, 0x1118, 374 0xa186, 0x0005, 0x1118, 0x601c, 0xc0bd, 0x601e, 0x74c4, 0x73c8,
373 0x2071, 0x4640, 0x0018, 0x2071, 0x4680, 0xc1fd, 0x792a, 0x7063, 375 0x72cc, 0x6014, 0x2091, 0x8000, 0x00e6, 0x2009, 0x0012, 0xd0fc,
374 0x0005, 0x71d0, 0xc1c4, 0x71d2, 0x7366, 0x726a, 0x746e, 0x7072, 376 0x1118, 0x2071, 0x4740, 0x0018, 0x2071, 0x4780, 0xc1fd, 0x792a,
375 0x7077, 0x0000, 0x2c00, 0x707a, 0xa02e, 0x2530, 0x611c, 0xa184, 377 0x7063, 0x0005, 0x71d0, 0xc1c4, 0x71d2, 0x7366, 0x726a, 0x746e,
376 0x0060, 0x0110, 0x080c, 0x3fc1, 0x00ee, 0x6596, 0x65a6, 0x669a, 378 0x7072, 0x7077, 0x0000, 0x2c00, 0x707a, 0xa02e, 0x2530, 0x611c,
377 0x66aa, 0x60af, 0x0000, 0x60b3, 0x0000, 0x6714, 0x6023, 0x0000, 379 0xa184, 0x0060, 0x0110, 0x080c, 0x3fe9, 0x00ee, 0x6596, 0x65a6,
378 0x080c, 0x22ae, 0x2091, 0x8001, 0x0005, 0x70c3, 0x4005, 0x0804, 380 0x669a, 0x66aa, 0x60af, 0x0000, 0x60b3, 0x0000, 0x6714, 0x6023,
379 0x13bd, 0x20a9, 0x0005, 0x2099, 0x4614, 0x2091, 0x8000, 0x530a, 381 0x0000, 0x6024, 0xa096, 0x0001, 0x1110, 0x8000, 0x6026, 0x080c,
380 0x2091, 0x8001, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 382 0x22d5, 0x2091, 0x8001, 0x0005, 0x70c3, 0x4005, 0x0804, 0x13bd,
381 0xa5a9, 0x0000, 0x0005, 0x71c4, 0x70c7, 0x0000, 0x791e, 0x0804, 383 0x20a9, 0x0005, 0x2099, 0x4714, 0x2091, 0x8000, 0x530a, 0x2091,
382 0x13ba, 0x71c4, 0x71c6, 0x2168, 0x0010, 0x2069, 0x1000, 0x690c, 384 0x8001, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9,
383 0xa016, 0x2d04, 0xa210, 0x8d68, 0x8109, 0x1dd8, 0xa285, 0x0000, 385 0x0000, 0x0005, 0x71c4, 0x70c7, 0x0000, 0x791e, 0x0804, 0x13ba,
384 0x1118, 0x70c3, 0x4000, 0x0010, 0x70c3, 0x4003, 0x70ca, 0x0804, 386 0x71c4, 0x71c6, 0x2168, 0x0010, 0x2069, 0x1000, 0x690c, 0xa016,
385 0x13bd, 0x7964, 0x71c6, 0x71c4, 0xa182, 0x0003, 0x1a04, 0x13b3, 387 0x2d04, 0xa210, 0x8d68, 0x8109, 0x1dd8, 0xa285, 0x0000, 0x1118,
386 0x7966, 0x0804, 0x13ba, 0x7964, 0x71c6, 0x0804, 0x13ba, 0x7900, 388 0x70c3, 0x4000, 0x0010, 0x70c3, 0x4003, 0x70ca, 0x0804, 0x13bd,
387 0x71c6, 0x71c4, 0x7902, 0x0804, 0x13ba, 0x7900, 0x71c6, 0x0804, 389 0x7964, 0x71c6, 0x71c4, 0xa182, 0x0003, 0x1a04, 0x13b3, 0x7966,
388 0x13ba, 0x70c4, 0x2011, 0x0000, 0xa08c, 0x000d, 0x0160, 0x810c, 390 0x0804, 0x13ba, 0x7964, 0x71c6, 0x0804, 0x13ba, 0x7900, 0x71c6,
389 0x0230, 0x8210, 0x810c, 0x810c, 0x0210, 0x8210, 0x810c, 0x81ff, 391 0x71c4, 0x7902, 0x0804, 0x13ba, 0x7900, 0x71c6, 0x0804, 0x13ba,
390 0x1904, 0x13b4, 0x8210, 0x7a0e, 0xd28c, 0x0538, 0x7910, 0xc1cd, 392 0x70c4, 0x2011, 0x0000, 0xa08c, 0x000d, 0x0160, 0x810c, 0x0230,
391 0x7912, 0x2009, 0x0021, 0x2019, 0x0003, 0xd284, 0x01c0, 0x8108, 393 0x8210, 0x810c, 0x810c, 0x0210, 0x8210, 0x810c, 0x81ff, 0x1904,
392 0x2019, 0x0041, 0x2011, 0x8e4e, 0x2312, 0x2019, 0x0042, 0x8210, 394 0x13b4, 0x8210, 0x7a0e, 0xd28c, 0x0538, 0x7910, 0xc1cd, 0x7912,
393 0x2312, 0x2019, 0x0043, 0x8210, 0x2312, 0x2019, 0x0046, 0x8210, 395 0x2009, 0x0021, 0x2019, 0x0003, 0xd284, 0x01c0, 0x8108, 0x2019,
394 0x2312, 0x2019, 0x0047, 0x8210, 0x2312, 0x2019, 0x0006, 0x2011, 396 0x0041, 0x2011, 0x8f4e, 0x2312, 0x2019, 0x0042, 0x8210, 0x2312,
395 0x8e53, 0x2112, 0x2011, 0x8e73, 0x2312, 0x7904, 0x7806, 0x0804, 397 0x2019, 0x0043, 0x8210, 0x2312, 0x2019, 0x0046, 0x8210, 0x2312,
396 0x13b9, 0x7804, 0x70c6, 0x0804, 0x13ba, 0x71c4, 0xd1fc, 0x1118, 398 0x2019, 0x0047, 0x8210, 0x2312, 0x2019, 0x0006, 0x2011, 0x8f53,
397 0x2011, 0x4ac0, 0x0010, 0x2011, 0x4b40, 0x8107, 0xa084, 0x000f, 399 0x2112, 0x2011, 0x8f73, 0x2312, 0x7904, 0x7806, 0x0804, 0x13b9,
398 0x8003, 0x8003, 0x8003, 0xa268, 0x2011, 0x0000, 0x6814, 0xd0fc, 400 0x7804, 0x70c6, 0x0804, 0x13ba, 0x71c4, 0xd1fc, 0x1118, 0x2011,
399 0x0110, 0xa295, 0x0200, 0xd0b4, 0x0110, 0xa295, 0x0001, 0x6b0c, 401 0x4bc0, 0x0010, 0x2011, 0x4c40, 0x8107, 0xa084, 0x000f, 0x8003,
400 0x6800, 0x70da, 0x0804, 0x13b7, 0x7814, 0xd0f4, 0x0130, 0x2001, 402 0x8003, 0x8003, 0xa268, 0x2011, 0x0000, 0x6814, 0xd0fc, 0x0110,
401 0x4007, 0x70db, 0x0000, 0xa005, 0x0048, 0xd0fc, 0x0130, 0x2001, 403 0xa295, 0x0200, 0xd0b4, 0x0110, 0xa295, 0x0001, 0x6b0c, 0x6800,
402 0x4007, 0x70db, 0x0001, 0xa005, 0x0008, 0xa006, 0x0005, 0x7814, 404 0x70da, 0x0804, 0x13b7, 0x7814, 0xd0f4, 0x0130, 0x2001, 0x4007,
403 0xd0f4, 0x0130, 0x2001, 0x4007, 0x70db, 0x0000, 0xa005, 0x0008, 405 0x70db, 0x0000, 0xa005, 0x0048, 0xd0fc, 0x0130, 0x2001, 0x4007,
404 0xa006, 0x0005, 0x7814, 0xd0fc, 0x0130, 0x2001, 0x4007, 0x70db, 406 0x70db, 0x0001, 0xa005, 0x0008, 0xa006, 0x0005, 0x7814, 0xd0f4,
405 0x0001, 0xa005, 0x0008, 0xa006, 0x0005, 0x7112, 0x721a, 0x731e, 407 0x0130, 0x2001, 0x4007, 0x70db, 0x0000, 0xa005, 0x0008, 0xa006,
406 0x7810, 0xd0c4, 0x0110, 0x7422, 0x7526, 0xac80, 0x0001, 0x8108, 408 0x0005, 0x7814, 0xd0fc, 0x0130, 0x2001, 0x4007, 0x70db, 0x0001,
407 0x810c, 0x81a9, 0x8098, 0x20a1, 0x0030, 0x7003, 0x0000, 0x6084, 409 0xa005, 0x0008, 0xa006, 0x0005, 0x7112, 0x721a, 0x731e, 0x7810,
408 0x20a2, 0x53a6, 0x7007, 0x0001, 0x7974, 0xa184, 0xff00, 0x0140, 410 0xd0c4, 0x0110, 0x7422, 0x7526, 0xac80, 0x0001, 0x8108, 0x810c,
409 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0018, 411 0x81a9, 0x8098, 0x20a1, 0x0030, 0x7003, 0x0000, 0x6084, 0x20a2,
410 0x8107, 0x8004, 0x8004, 0x797c, 0xa108, 0x7a78, 0xa006, 0xa211, 412 0x53a6, 0x7007, 0x0001, 0x7974, 0xa184, 0xff00, 0x0140, 0x810f,
411 0x7d10, 0xd5c4, 0x0120, 0x7b84, 0xa319, 0x7c80, 0xa421, 0x7008, 413 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0018, 0x8107,
412 0xd0fc, 0x0de8, 0x7003, 0x0001, 0x7007, 0x0006, 0x711a, 0x721e, 414 0x8004, 0x8004, 0x797c, 0xa108, 0x7a78, 0xa006, 0xa211, 0x7d10,
413 0x7d10, 0xd5c4, 0x0110, 0x7322, 0x7426, 0xa084, 0x01e0, 0x0005, 415 0xd5c4, 0x0120, 0x7b84, 0xa319, 0x7c80, 0xa421, 0x7008, 0xd0fc,
414 0x7848, 0xa065, 0x0120, 0x2c04, 0x784a, 0x2063, 0x0000, 0x0005, 416 0x0de8, 0x7003, 0x0001, 0x7007, 0x0006, 0x711a, 0x721e, 0x7d10,
415 0x00f6, 0x2079, 0x4600, 0x7848, 0x2062, 0x2c00, 0xa005, 0x1110, 417 0xd5c4, 0x0110, 0x7322, 0x7426, 0xa084, 0x01e0, 0x0005, 0x7848,
416 0x080c, 0x254c, 0x784a, 0x00fe, 0x0005, 0x2011, 0x9000, 0x7a4a, 418 0xa065, 0x0120, 0x2c04, 0x784a, 0x2063, 0x0000, 0x0005, 0x00f6,
417 0x7bc4, 0x8319, 0x0128, 0xa280, 0x0032, 0x2012, 0x2010, 0x0cc8, 419 0x2079, 0x4700, 0x7848, 0x2062, 0x2c00, 0xa005, 0x1110, 0x080c,
418 0x2013, 0x0000, 0x0005, 0x0016, 0x0026, 0xd7fc, 0x1118, 0x2011, 420 0x2575, 0x784a, 0x00fe, 0x0005, 0x2011, 0x9100, 0x7a4a, 0x7bc4,
419 0x4bc0, 0x0010, 0x2011, 0x6bc0, 0xa784, 0x0f00, 0x800b, 0xa784, 421 0x8319, 0x0128, 0xa280, 0x0032, 0x2012, 0x2010, 0x0cc8, 0x2013,
420 0x001f, 0x0120, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xa268, 422 0x0000, 0x0005, 0x0016, 0x0026, 0xd7fc, 0x1118, 0x2011, 0x4cc0,
421 0x002e, 0x001e, 0x0005, 0x0c39, 0x2900, 0x682a, 0x2a00, 0x682e, 423 0x0010, 0x2011, 0x6cc0, 0xa784, 0x0f00, 0x800b, 0xa784, 0x001f,
422 0x6808, 0xa084, 0xf9ef, 0xa80d, 0x690a, 0x00e6, 0xd7fc, 0x1128, 424 0x0120, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xa268, 0x002e,
423 0x2009, 0x4652, 0x2071, 0x4640, 0x0020, 0x2009, 0x4692, 0x2071, 425 0x001e, 0x0005, 0x0c39, 0x2900, 0x682a, 0x2a00, 0x682e, 0x6808,
424 0x4680, 0x210c, 0x6804, 0xa005, 0x0148, 0xa116, 0x1138, 0x2060, 426 0xa084, 0xf9ef, 0xa80d, 0x690a, 0x00e6, 0xd7fc, 0x1128, 0x2009,
425 0x6000, 0x6806, 0x0016, 0x200b, 0x0000, 0x0018, 0x2009, 0x0000, 427 0x4752, 0x2071, 0x4740, 0x0020, 0x2009, 0x4792, 0x2071, 0x4780,
426 0x0016, 0x6804, 0xa065, 0x0178, 0x6000, 0x6806, 0x0421, 0x080c, 428 0x210c, 0x6804, 0xa005, 0x0148, 0xa116, 0x1138, 0x2060, 0x6000,
427 0x1d95, 0x6810, 0x7908, 0x8109, 0x790a, 0x8001, 0x6812, 0x1d88, 429 0x6806, 0x0016, 0x200b, 0x0000, 0x0018, 0x2009, 0x0000, 0x0016,
428 0x7910, 0xc1a5, 0x7912, 0x001e, 0x6902, 0x6906, 0x2d00, 0x2060, 430 0x6804, 0xa065, 0x0178, 0x6000, 0x6806, 0x0421, 0x080c, 0x1db2,
429 0x080c, 0x2693, 0x00ee, 0x0005, 0xa065, 0x0160, 0x2008, 0x609c, 431 0x6810, 0x7908, 0x8109, 0x790a, 0x8001, 0x6812, 0x1d88, 0x7910,
430 0xa005, 0x0128, 0x2062, 0x609f, 0x0000, 0xa065, 0x0cc0, 0x7848, 432 0xc1a5, 0x7912, 0x001e, 0x6902, 0x6906, 0x2d00, 0x2060, 0x080c,
431 0x794a, 0x2062, 0x0005, 0x6007, 0x0103, 0x608f, 0x0000, 0x20a9, 433 0x26bf, 0x00ee, 0x0005, 0xa065, 0x0160, 0x2008, 0x609c, 0xa005,
432 0x001c, 0xac80, 0x0005, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x6828, 434 0x0128, 0x2062, 0x609f, 0x0000, 0xa065, 0x0cc0, 0x7848, 0x794a,
433 0x601a, 0x682c, 0x6022, 0x0005, 0x00e6, 0xd7fc, 0x1128, 0x2071, 435 0x2062, 0x0005, 0x6007, 0x0103, 0x608f, 0x0000, 0x20a9, 0x001c,
434 0x4640, 0x2031, 0x46c0, 0x0020, 0x2071, 0x4680, 0x2031, 0x48c0, 436 0xac80, 0x0005, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x6828, 0x601a,
435 0x704c, 0xa08c, 0x0200, 0x1128, 0xa608, 0x2d0a, 0x8000, 0x704e, 437 0x682c, 0x6022, 0x0005, 0x00e6, 0xd7fc, 0x1128, 0x2071, 0x4740,
436 0xa006, 0x00ee, 0x0005, 0x00f6, 0xd7fc, 0x1118, 0x2079, 0x4640, 438 0x2031, 0x47c0, 0x0020, 0x2071, 0x4780, 0x2031, 0x49c0, 0x704c,
437 0x0010, 0x2079, 0x4680, 0x080c, 0x1b7b, 0x2091, 0x8000, 0x6804, 439 0xa08c, 0x0200, 0x1128, 0xa608, 0x2d0a, 0x8000, 0x704e, 0xa006,
438 0x780a, 0xa065, 0x05f0, 0x0030, 0x2c00, 0x780a, 0x2060, 0x6000, 440 0x00ee, 0x0005, 0x00f6, 0xd7fc, 0x1118, 0x2079, 0x4740, 0x0010,
439 0xa065, 0x05b8, 0x6010, 0xa306, 0x1db8, 0x600c, 0xa206, 0x1da0, 441 0x2079, 0x4780, 0x080c, 0x1b9a, 0x2091, 0x8000, 0x6804, 0x780a,
440 0x2c28, 0x7848, 0xac06, 0x1108, 0x0448, 0x6804, 0xac06, 0x1140, 442 0xa065, 0x05f0, 0x0030, 0x2c00, 0x780a, 0x2060, 0x6000, 0xa065,
441 0x6000, 0x2060, 0x6806, 0xa005, 0x1118, 0x6803, 0x0000, 0x0048, 443 0x05b8, 0x6010, 0xa306, 0x1db8, 0x600c, 0xa206, 0x1da0, 0x2c28,
442 0x6400, 0x7808, 0x2060, 0x6402, 0xa486, 0x0000, 0x1110, 0x2c00, 444 0x7848, 0xac06, 0x1108, 0x0448, 0x6804, 0xac06, 0x1140, 0x6000,
443 0x6802, 0x2560, 0x080c, 0x1be3, 0x601b, 0x0005, 0x6023, 0x0020, 445 0x2060, 0x6806, 0xa005, 0x1118, 0x6803, 0x0000, 0x0048, 0x6400,
444 0x00fe, 0x080c, 0x1d95, 0x00f6, 0x7908, 0x8109, 0x790a, 0x6810, 446 0x7808, 0x2060, 0x6402, 0xa486, 0x0000, 0x1110, 0x2c00, 0x6802,
445 0x8001, 0x6812, 0x1118, 0x7810, 0xc0a5, 0x7812, 0x2001, 0xffff, 447 0x2560, 0x080c, 0x1c02, 0x601b, 0x0005, 0x6023, 0x0020, 0x00fe,
446 0xa005, 0x00fe, 0x0005, 0x0076, 0x2700, 0x2039, 0x0000, 0xd0fc, 448 0x080c, 0x1db2, 0x00f6, 0x7908, 0x8109, 0x790a, 0x6810, 0x8001,
447 0x0108, 0xc7fd, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 449 0x6812, 0x1118, 0x7810, 0xc0a5, 0x7812, 0x2001, 0xffff, 0xa005,
448 0x2091, 0x8000, 0x080c, 0x1b93, 0x8738, 0xa784, 0x001f, 0x1dd0, 450 0x00fe, 0x0005, 0x0076, 0x2700, 0x2039, 0x0000, 0xd0fc, 0x0108,
449 0xa7bc, 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, 0x1d90, 451 0xc7fd, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 0x2091,
450 0x2091, 0x8001, 0x007e, 0x0005, 0x786c, 0x2009, 0x8e74, 0x210c, 452 0x8000, 0x080c, 0x1bb2, 0x8738, 0xa784, 0x001f, 0x1dd0, 0xa7bc,
451 0xa10d, 0x0118, 0xa065, 0x0804, 0x207a, 0x2061, 0x0000, 0x6018, 453 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, 0x1d90, 0x2091,
452 0xd084, 0x11b8, 0x7810, 0xd08c, 0x0130, 0xc08c, 0x7812, 0xc7fc, 454 0x8001, 0x007e, 0x0005, 0x786c, 0x2009, 0x8f74, 0x210c, 0xa10d,
453 0x2069, 0x4640, 0x0028, 0xc08d, 0x7812, 0x2069, 0x4680, 0xc7fd, 455 0x0118, 0xa065, 0x0804, 0x20a1, 0x2061, 0x0000, 0x6018, 0xd084,
454 0x2091, 0x8000, 0x681c, 0x681f, 0x0000, 0x2091, 0x8001, 0xa005, 456 0x11b8, 0x7810, 0xd08c, 0x0130, 0xc08c, 0x7812, 0xc7fc, 0x2069,
455 0x1108, 0x0005, 0xa08c, 0xfff0, 0x0110, 0x080c, 0x254c, 0x0002, 457 0x4740, 0x0028, 0xc08d, 0x7812, 0x2069, 0x4780, 0xc7fd, 0x2091,
456 0x1cb8, 0x1cbb, 0x1cc1, 0x1cc5, 0x1cb9, 0x1cc9, 0x1cb9, 0x1cb9, 458 0x8000, 0x681c, 0x681f, 0x0000, 0x2091, 0x8001, 0xa005, 0x1108,
457 0x1cb9, 0x1ccf, 0x1cfb, 0x1cfe, 0x1d03, 0x1d0c, 0x1cb9, 0x1cb9, 459 0x0005, 0xa08c, 0xfff0, 0x0110, 0x080c, 0x2575, 0x0002, 0x1cd7,
458 0x0005, 0x080c, 0x254c, 0x080c, 0x1c5b, 0x2001, 0x8001, 0x0804, 460 0x1cda, 0x1ce0, 0x1ce4, 0x1cd8, 0x1ce8, 0x1cd8, 0x1cd8, 0x1cd8,
459 0x1d15, 0x2001, 0x8003, 0x0804, 0x1d15, 0x2001, 0x8004, 0x0804, 461 0x1cee, 0x1d18, 0x1d1b, 0x1d20, 0x1d29, 0x1cd8, 0x1cd8, 0x0005,
460 0x1d15, 0x080c, 0x1c5b, 0x2001, 0x8006, 0x0804, 0x1d15, 0x2091, 462 0x080c, 0x2575, 0x080c, 0x1c7a, 0x2001, 0x8001, 0x0804, 0x1d32,
461 0x8000, 0x0076, 0xd7fc, 0x1128, 0x2069, 0x4640, 0x2039, 0x0009, 463 0x2001, 0x8003, 0x0804, 0x1d32, 0x2001, 0x8004, 0x0804, 0x1d32,
462 0x0020, 0x2069, 0x4680, 0x2039, 0x0009, 0x6800, 0xa086, 0x0000, 464 0x080c, 0x1c7a, 0x2001, 0x8006, 0x0804, 0x1d32, 0x2011, 0x800a,
463 0x0128, 0x000e, 0x6f1e, 0x2091, 0x8001, 0x0005, 0x6870, 0x007e, 465 0x2091, 0x8000, 0xd7fc, 0x1118, 0x2069, 0x4740, 0x0010, 0x2069,
464 0xa0bc, 0xff00, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0010, 466 0x4780, 0x2038, 0x6800, 0xa086, 0x0000, 0x0120, 0x6f1e, 0x2091,
465 0x080c, 0x1b93, 0x8738, 0xa784, 0x001f, 0x1dd0, 0x2091, 0x8001, 467 0x8001, 0x0005, 0x0026, 0x6870, 0xa0bc, 0xff00, 0x2041, 0x0021,
466 0x2001, 0x800a, 0x00d0, 0x2001, 0x800c, 0x00b8, 0x080c, 0x1c5b, 468 0x2049, 0x0004, 0x2051, 0x0010, 0x080c, 0x1bb2, 0x8738, 0xa784,
467 0x2001, 0x800d, 0x0090, 0xd7fc, 0x0110, 0x78e4, 0x0008, 0x78e0, 469 0x001f, 0x1dd0, 0x2091, 0x8001, 0x000e, 0x6970, 0x71c6, 0x00d0,
468 0x70c6, 0x2001, 0x800e, 0x0048, 0xd7fc, 0x0110, 0x78ec, 0x0008, 470 0x2001, 0x800c, 0x00b8, 0x080c, 0x1c7a, 0x2001, 0x800d, 0x0090,
469 0x78e8, 0x70c6, 0x2001, 0x800f, 0x0000, 0x70c2, 0xd7fc, 0x1118, 471 0xd7fc, 0x0110, 0x78e4, 0x0008, 0x78e0, 0x70c6, 0x2001, 0x800e,
470 0x70db, 0x0000, 0x0010, 0x70db, 0x0001, 0x2061, 0x0000, 0x601b, 472 0x0048, 0xd7fc, 0x0110, 0x78ec, 0x0008, 0x78e8, 0x70c6, 0x2001,
471 0x0001, 0x2091, 0x4080, 0x0005, 0xac80, 0x0001, 0x81ff, 0x0518, 473 0x800f, 0x0000, 0x70c2, 0xd7fc, 0x1118, 0x70db, 0x0000, 0x0010,
472 0x2099, 0x0030, 0x20a0, 0x700c, 0xa084, 0x07ff, 0x0100, 0x7018, 474 0x70db, 0x0001, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x4080,
473 0x0006, 0x701c, 0x0006, 0x7020, 0x0006, 0x7024, 0x0006, 0x7112, 475 0x0005, 0xac80, 0x0001, 0x81ff, 0x0518, 0x2099, 0x0030, 0x20a0,
474 0x81ac, 0x721a, 0x731e, 0x7422, 0x7526, 0x7003, 0x0001, 0x7007, 476 0x700c, 0xa084, 0x07ff, 0x0100, 0x7018, 0x0006, 0x701c, 0x0006,
475 0x0001, 0x7008, 0x800b, 0x1ee8, 0x7007, 0x0002, 0xa08c, 0x01e0, 477 0x7020, 0x0006, 0x7024, 0x0006, 0x7112, 0x81ac, 0x721a, 0x731e,
476 0x1110, 0x53a5, 0xa006, 0x7003, 0x0000, 0x7007, 0x0004, 0x000e, 478 0x7422, 0x7526, 0x7003, 0x0001, 0x7007, 0x0001, 0x7008, 0x800b,
477 0x7026, 0x000e, 0x7022, 0x000e, 0x701e, 0x000e, 0x701a, 0x0005, 479 0x1ee8, 0x7007, 0x0002, 0xa08c, 0x01e0, 0x1110, 0x53a5, 0xa006,
478 0x2011, 0x0020, 0x2009, 0x0010, 0x6b0a, 0x6c0e, 0x681f, 0x0201, 480 0x7003, 0x0000, 0x7007, 0x0004, 0x000e, 0x7026, 0x000e, 0x7022,
479 0x6803, 0xfd20, 0x6807, 0x0038, 0x6a1a, 0x2d00, 0xa0e8, 0x0008, 481 0x000e, 0x701e, 0x000e, 0x701a, 0x0005, 0x2011, 0x0020, 0x2009,
480 0xa290, 0x0004, 0x8109, 0x1d80, 0x0005, 0x70ec, 0xd0dc, 0x1520, 482 0x0010, 0x6b0a, 0x6c0e, 0x681f, 0x0201, 0x6803, 0xfd20, 0x6807,
481 0x2029, 0x0001, 0x7814, 0xd0cc, 0x1160, 0x70ec, 0xd0e4, 0x2019, 483 0x0038, 0x6a1a, 0x2d00, 0xa0e8, 0x0008, 0xa290, 0x0004, 0x8109,
482 0x0c0a, 0x2021, 0x000a, 0x1120, 0x2019, 0x0c0c, 0x2021, 0x000c, 484 0x1d80, 0x0005, 0x70ec, 0xd0dc, 0x1520, 0x2029, 0x0001, 0x7814,
483 0x0070, 0x70ec, 0xd0e4, 0x1128, 0x2019, 0x180c, 0x2021, 0x000c, 485 0xd0cc, 0x1160, 0x70ec, 0xd0e4, 0x2019, 0x0c0a, 0x2021, 0x000a,
484 0x0030, 0x2019, 0x1809, 0x2021, 0x0009, 0xa5ad, 0x0200, 0x6b0a, 486 0x1120, 0x2019, 0x0c0c, 0x2021, 0x000c, 0x0070, 0x70ec, 0xd0e4,
485 0x6c0e, 0x6d1e, 0x6807, 0x0038, 0x0005, 0x6004, 0x6086, 0x2c08, 487 0x1128, 0x2019, 0x180c, 0x2021, 0x000c, 0x0030, 0x2019, 0x1809,
486 0x2063, 0x0000, 0x7868, 0xa005, 0x796a, 0x0110, 0x2c02, 0x0008, 488 0x2021, 0x0009, 0xa5ad, 0x0200, 0x6b0a, 0x6c0e, 0x6d1e, 0x6807,
487 0x796e, 0x0005, 0x00c6, 0x2061, 0x4600, 0x6887, 0x0103, 0x2d08, 489 0x0038, 0x0005, 0x6004, 0x6086, 0x2c08, 0x2063, 0x0000, 0x7868,
488 0x206b, 0x0000, 0x6068, 0xa005, 0x616a, 0x0110, 0x2d02, 0x0008, 490 0xa005, 0x796a, 0x0110, 0x2c02, 0x0008, 0x796e, 0x0005, 0x00c6,
489 0x616e, 0x00ce, 0x0005, 0x2091, 0x8000, 0x2c04, 0x786e, 0xa005, 491 0x2061, 0x4700, 0x6887, 0x0103, 0x2d08, 0x206b, 0x0000, 0x6068,
490 0x1108, 0x786a, 0x2091, 0x8001, 0x609c, 0xa005, 0x0188, 0x00c6, 492 0xa005, 0x616a, 0x0110, 0x2d02, 0x0008, 0x616e, 0x00ce, 0x0005,
491 0x2060, 0x2008, 0x609c, 0xa005, 0x0138, 0x2062, 0x609f, 0x0000, 493 0x2091, 0x8000, 0x2c04, 0x786e, 0xa005, 0x1108, 0x786a, 0x2091,
492 0xa065, 0x609c, 0xa005, 0x1dc8, 0x7848, 0x794a, 0x2062, 0x00ce, 494 0x8001, 0x609c, 0xa005, 0x0188, 0x00c6, 0x2060, 0x2008, 0x609c,
493 0x7848, 0x2062, 0x609f, 0x0000, 0xac85, 0x0000, 0x1110, 0x080c, 495 0xa005, 0x0138, 0x2062, 0x609f, 0x0000, 0xa065, 0x609c, 0xa005,
494 0x254c, 0x784a, 0x0005, 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086, 496 0x1dc8, 0x7848, 0x794a, 0x2062, 0x00ce, 0x7848, 0x2062, 0x609f,
495 0x818e, 0x1208, 0xa200, 0x1f04, 0x1ddf, 0x8086, 0x818e, 0x0005, 497 0x0000, 0xac85, 0x0000, 0x1110, 0x080c, 0x2575, 0x784a, 0x0005,
496 0x0156, 0x20a9, 0x0010, 0xa005, 0x01b8, 0xa11a, 0x12a8, 0x8213, 498 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086, 0x818e, 0x1208, 0xa200,
497 0x818d, 0x0228, 0xa11a, 0x1220, 0x1f04, 0x1def, 0x0028, 0xa11a, 499 0x1f04, 0x1dfc, 0x8086, 0x818e, 0x0005, 0x0156, 0x20a9, 0x0010,
498 0x2308, 0x8210, 0x1f04, 0x1def, 0x0006, 0x3200, 0xa084, 0xefff, 500 0xa005, 0x01b8, 0xa11a, 0x12a8, 0x8213, 0x818d, 0x0228, 0xa11a,
499 0x2080, 0x000e, 0x015e, 0x0005, 0x0006, 0x3200, 0xa085, 0x1000, 501 0x1220, 0x1f04, 0x1e0c, 0x0028, 0xa11a, 0x2308, 0x8210, 0x1f04,
500 0x0cb8, 0x7d74, 0x70d0, 0xa506, 0x0904, 0x1ebd, 0x7810, 0x2050, 502 0x1e0c, 0x0006, 0x3200, 0xa084, 0xefff, 0x2080, 0x000e, 0x015e,
501 0x080c, 0x1b58, 0x0904, 0x1ebd, 0xa046, 0x7970, 0x2500, 0x8000, 503 0x0005, 0x0006, 0x3200, 0xa085, 0x1000, 0x0cb8, 0x7d74, 0x70d0,
502 0xa112, 0x2009, 0x0040, 0x1208, 0x0030, 0x72d0, 0xa206, 0x0118, 504 0xa506, 0x0904, 0x1eda, 0x7810, 0x2050, 0x080c, 0x1b77, 0x0904,
503 0x8840, 0x2009, 0x0080, 0x00c6, 0x7112, 0x7007, 0x0001, 0x2099, 505 0x1eda, 0xa046, 0x7970, 0x2500, 0x8000, 0xa112, 0x2009, 0x0040,
504 0x0030, 0x20a9, 0x0020, 0xac80, 0x0001, 0x20a0, 0x2061, 0x0000, 506 0x1208, 0x0030, 0x72d0, 0xa206, 0x0118, 0x8840, 0x2009, 0x0080,
505 0x88ff, 0x0110, 0x080c, 0x1b58, 0x7008, 0xd0fc, 0x0de8, 0x7007, 507 0x00c6, 0x7112, 0x7007, 0x0001, 0x2099, 0x0030, 0x20a9, 0x0020,
506 0x0002, 0x2091, 0x8001, 0xa08c, 0x01e0, 0x1538, 0x53a5, 0x8cff, 508 0xac80, 0x0001, 0x20a0, 0x2061, 0x0000, 0x88ff, 0x0110, 0x080c,
507 0x1120, 0x88ff, 0x0904, 0x1eaa, 0x0050, 0x2c00, 0x788e, 0x20a9, 509 0x1b77, 0x7008, 0xd0fc, 0x0de8, 0x7007, 0x0002, 0x2091, 0x8001,
508 0x0020, 0xac80, 0x0001, 0x20a0, 0x53a5, 0x0804, 0x1eaa, 0xa046, 510 0xa08c, 0x01e0, 0x1538, 0x53a5, 0x8cff, 0x1120, 0x88ff, 0x0904,
509 0x7218, 0x731c, 0xdac4, 0x0110, 0x7420, 0x7524, 0xa292, 0x0040, 511 0x1ec7, 0x0050, 0x2c00, 0x788e, 0x20a9, 0x0020, 0xac80, 0x0001,
510 0xa39b, 0x0000, 0xa4a3, 0x0000, 0xa5ab, 0x0000, 0x721a, 0x731e, 512 0x20a0, 0x53a5, 0x0804, 0x1ec7, 0xa046, 0x7218, 0x731c, 0xdac4,
511 0xdac4, 0x0118, 0x7422, 0x7526, 0xa006, 0x7007, 0x0004, 0x0904, 513 0x0110, 0x7420, 0x7524, 0xa292, 0x0040, 0xa39b, 0x0000, 0xa4a3,
512 0x1eaa, 0x8cff, 0x0110, 0x080c, 0x1b60, 0x00ce, 0x080c, 0x1b60, 514 0x0000, 0xa5ab, 0x0000, 0x721a, 0x731e, 0xdac4, 0x0118, 0x7422,
513 0xa046, 0x7888, 0x8000, 0x788a, 0xa086, 0x0002, 0x01c0, 0x7a7c, 515 0x7526, 0xa006, 0x7007, 0x0004, 0x0904, 0x1ec7, 0x8cff, 0x0110,
514 0x7b78, 0xdac4, 0x0110, 0x7c84, 0x7d80, 0x7974, 0x8107, 0x8004, 516 0x080c, 0x1b7f, 0x00ce, 0x080c, 0x1b7f, 0xa046, 0x7888, 0x8000,
515 0x8004, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 517 0x788a, 0xa086, 0x0002, 0x01c0, 0x7a7c, 0x7b78, 0xdac4, 0x0110,
516 0x721a, 0x731e, 0xdac4, 0x0588, 0x7422, 0x7526, 0x0470, 0x6014, 518 0x7c84, 0x7d80, 0x7974, 0x8107, 0x8004, 0x8004, 0xa210, 0xa399,
517 0xd0fc, 0x1118, 0x2069, 0x4640, 0x0010, 0x2069, 0x4680, 0x2091, 519 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x721a, 0x731e, 0xdac4,
518 0x8000, 0x681f, 0x0002, 0x88ff, 0x0120, 0xa046, 0x788c, 0x2060, 520 0x0588, 0x7422, 0x7526, 0x0470, 0x6014, 0xd0fc, 0x1118, 0x2069,
519 0x0c70, 0x788b, 0x0000, 0x78ac, 0xa085, 0x0003, 0x78ae, 0x2091, 521 0x4740, 0x0010, 0x2069, 0x4780, 0x2091, 0x8000, 0x681f, 0x0002,
520 0x8001, 0x0098, 0x00ce, 0x788b, 0x0000, 0x080c, 0x2035, 0x6004, 522 0x88ff, 0x0120, 0xa046, 0x788c, 0x2060, 0x0c70, 0x788b, 0x0000,
521 0xa084, 0x000f, 0x0059, 0x88ff, 0x0130, 0x788c, 0x2060, 0x6004, 523 0x78ac, 0xa085, 0x0003, 0x78ae, 0x2091, 0x8001, 0x0098, 0x00ce,
522 0xa084, 0x000f, 0x0019, 0x0804, 0x1e09, 0x0005, 0x0002, 0x1ecf, 524 0x788b, 0x0000, 0x080c, 0x205c, 0x6004, 0xa084, 0x000f, 0x0059,
523 0x1eea, 0x1f03, 0x1ecf, 0x1f10, 0x1ee0, 0x1ecf, 0x1ecf, 0x1ecf, 525 0x88ff, 0x0130, 0x788c, 0x2060, 0x6004, 0xa084, 0x000f, 0x0019,
524 0x1ee8, 0x1f01, 0x1ecf, 0x1ecf, 0x1ecf, 0x1ecf, 0x1ecf, 0x2039, 526 0x0804, 0x1e26, 0x0005, 0x0002, 0x1eec, 0x1f07, 0x1f20, 0x1eec,
525 0x0400, 0x78bc, 0xa705, 0x78be, 0x6008, 0xa705, 0x600a, 0x080c, 527 0x1f2d, 0x1efd, 0x1eec, 0x1eec, 0x1eec, 0x1f05, 0x1f1e, 0x1eec,
526 0x1f4c, 0x609c, 0x78ba, 0x609f, 0x0000, 0x080c, 0x2021, 0x0005, 528 0x1eec, 0x1eec, 0x1eec, 0x1eec, 0x2039, 0x0400, 0x78bc, 0xa705,
527 0x78bc, 0xd0c4, 0x0108, 0x0c58, 0x601c, 0xc0bd, 0x601e, 0x0030, 529 0x78be, 0x6008, 0xa705, 0x600a, 0x080c, 0x1f69, 0x609c, 0x78ba,
528 0x080c, 0x205f, 0x78bc, 0xd0c4, 0x0108, 0x0c08, 0x78bf, 0x0000, 530 0x609f, 0x0000, 0x080c, 0x2048, 0x0005, 0x78bc, 0xd0c4, 0x0108,
529 0x6004, 0x8007, 0xa084, 0x00ff, 0x78b2, 0x8001, 0x0138, 0x080c, 531 0x0c58, 0x601c, 0xc0bd, 0x601e, 0x0030, 0x080c, 0x2086, 0x78bc,
530 0x1f4c, 0x0120, 0x78bc, 0xc0c5, 0x78be, 0x0010, 0x0804, 0x1f67, 532 0xd0c4, 0x0108, 0x0c08, 0x78bf, 0x0000, 0x6004, 0x8007, 0xa084,
531 0x0005, 0x080c, 0x205c, 0x78bc, 0xa08c, 0x0e00, 0x1110, 0xd0c4, 533 0x00ff, 0x78b2, 0x8001, 0x0138, 0x080c, 0x1f69, 0x0120, 0x78bc,
532 0x1108, 0x0828, 0x080c, 0x1f4c, 0x1110, 0x0804, 0x1f67, 0x0005, 534 0xc0c5, 0x78be, 0x0010, 0x0804, 0x1f84, 0x0005, 0x080c, 0x2083,
533 0x78bc, 0xd0c4, 0x0110, 0x0804, 0x1ecf, 0x78bf, 0x0000, 0x6714, 535 0x78bc, 0xa08c, 0x0e00, 0x1110, 0xd0c4, 0x1108, 0x0828, 0x080c,
534 0x2011, 0x0001, 0x22a8, 0x6018, 0xa084, 0x00ff, 0xa005, 0x0188, 536 0x1f69, 0x1110, 0x0804, 0x1f84, 0x0005, 0x78bc, 0xd0c4, 0x0110,
535 0xa7bc, 0xff00, 0x20a9, 0x0020, 0xa08e, 0x0001, 0x0150, 0xa7bc, 537 0x0804, 0x1eec, 0x78bf, 0x0000, 0x6714, 0x2011, 0x0001, 0x22a8,
536 0x8000, 0x2011, 0x0002, 0x20a9, 0x0100, 0xa08e, 0x0002, 0x0108, 538 0x6018, 0xa084, 0x00ff, 0xa005, 0x0188, 0xa7bc, 0xff00, 0x20a9,
537 0x00c0, 0x080c, 0x1b7b, 0x2d00, 0x2091, 0x8000, 0x682b, 0x0000, 539 0x0020, 0xa08e, 0x0001, 0x0150, 0xa7bc, 0x8000, 0x2011, 0x0002,
538 0x682f, 0x0000, 0x6808, 0xa084, 0xffde, 0x680a, 0xade8, 0x0010, 540 0x20a9, 0x0100, 0xa08e, 0x0002, 0x0108, 0x00c0, 0x080c, 0x1b9a,
539 0x2091, 0x8001, 0x1f04, 0x1f34, 0x8211, 0x0118, 0x20a9, 0x0100, 541 0x2d00, 0x2091, 0x8000, 0x682b, 0x0000, 0x682f, 0x0000, 0x6808,
540 0x0c58, 0x080c, 0x1b60, 0x0005, 0x609f, 0x0000, 0x78b4, 0xa06d, 542 0xa084, 0xffde, 0x680a, 0xade8, 0x0010, 0x2091, 0x8001, 0x1f04,
541 0x2c00, 0x78b6, 0x1110, 0x78ba, 0x0038, 0x689e, 0x2d00, 0x6002, 543 0x1f51, 0x8211, 0x0118, 0x20a9, 0x0100, 0x0c58, 0x080c, 0x1b7f,
542 0x78b8, 0xad06, 0x1108, 0x6002, 0x78b0, 0x8001, 0x78b2, 0x1130, 544 0x0005, 0x609f, 0x0000, 0x78b4, 0xa06d, 0x2c00, 0x78b6, 0x1110,
543 0x78bc, 0xc0c4, 0x78be, 0x78b8, 0x2060, 0xa006, 0x0005, 0x00e6, 545 0x78ba, 0x0038, 0x689e, 0x2d00, 0x6002, 0x78b8, 0xad06, 0x1108,
544 0xa02e, 0x2530, 0x7dba, 0x7db6, 0x65ae, 0x65b2, 0x601c, 0x60a2, 546 0x6002, 0x78b0, 0x8001, 0x78b2, 0x1130, 0x78bc, 0xc0c4, 0x78be,
545 0x2048, 0xa984, 0xe1ff, 0x601e, 0xa984, 0x0060, 0x0110, 0x080c, 547 0x78b8, 0x2060, 0xa006, 0x0005, 0x00e6, 0xa02e, 0x2530, 0x7dba,
546 0x3fc1, 0x6596, 0x65a6, 0x669a, 0x66aa, 0x6714, 0x2071, 0x4680, 548 0x7db6, 0x65ae, 0x65b2, 0x601c, 0x60a2, 0x2048, 0xa984, 0xe1ff,
547 0xd7fc, 0x1110, 0x2071, 0x4640, 0xa784, 0x0f00, 0x800b, 0xa784, 549 0x601e, 0xa984, 0x0060, 0x0160, 0x080c, 0x3fe9, 0x86ff, 0x1140,
548 0x001f, 0x0120, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0x71c0, 550 0x85ff, 0x1130, 0x2039, 0x0800, 0x080c, 0x2048, 0x0804, 0x2046,
549 0xa168, 0x2700, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 551 0x6596, 0x65a6, 0x669a, 0x66aa, 0x6714, 0x2071, 0x4780, 0xd7fc,
550 0x71c4, 0xa100, 0x60c2, 0x2091, 0x8000, 0x7814, 0xd0c4, 0x0138, 552 0x1110, 0x2071, 0x4740, 0xa784, 0x0f00, 0x800b, 0xa784, 0x001f,
551 0xd7fc, 0x1118, 0xd0f4, 0x1140, 0x0010, 0xd0fc, 0x1128, 0x6e08, 553 0x0120, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0x71c0, 0xa168,
552 0xd684, 0x01f0, 0xd9fc, 0x11e0, 0x2091, 0x8001, 0x080c, 0x1be3, 554 0x2700, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0x71c4,
553 0x2091, 0x8000, 0x080c, 0x1d95, 0x2091, 0x8001, 0x7814, 0xd0c4, 555 0xa100, 0x60c2, 0x2091, 0x8000, 0x7814, 0xd0c4, 0x0138, 0xd7fc,
554 0x0904, 0x201f, 0xd7fc, 0x1120, 0xd0f4, 0x1130, 0x0804, 0x201f, 556 0x1118, 0xd0f4, 0x1140, 0x0010, 0xd0fc, 0x1128, 0x6e08, 0xd684,
555 0xd0fc, 0x1110, 0x0804, 0x201f, 0x601b, 0x0021, 0x0804, 0x201f, 557 0x01f0, 0xd9fc, 0x11e0, 0x2091, 0x8001, 0x080c, 0x1c02, 0x2091,
556 0x6024, 0xa096, 0x0001, 0x1110, 0x8000, 0x6026, 0x6a10, 0x6814, 558 0x8000, 0x080c, 0x1db2, 0x2091, 0x8001, 0x7814, 0xd0c4, 0x0904,
557 0xa202, 0x0268, 0x0160, 0x2091, 0x8001, 0x2039, 0x0200, 0x609c, 559 0x2046, 0xd7fc, 0x1120, 0xd0f4, 0x1130, 0x0804, 0x2046, 0xd0fc,
558 0x78ba, 0x609f, 0x0000, 0x080c, 0x2021, 0x0804, 0x201f, 0x2c08, 560 0x1110, 0x0804, 0x2046, 0x601b, 0x0021, 0x0804, 0x2046, 0x6024,
559 0xd9fc, 0x01f0, 0x6800, 0xa065, 0x01d8, 0x6a04, 0x7000, 0xa084, 561 0xa096, 0x0001, 0x1110, 0x8000, 0x6026, 0x6a10, 0x6814, 0xa202,
560 0x0002, 0x0168, 0x7048, 0xa206, 0x1150, 0x6b04, 0x2160, 0x2304, 562 0x0268, 0x0160, 0x2091, 0x8001, 0x2039, 0x0200, 0x609c, 0x78ba,
561 0x6002, 0xa005, 0x1108, 0x6902, 0x2260, 0x6102, 0x0098, 0x2d00, 563 0x609f, 0x0000, 0x080c, 0x2048, 0x0804, 0x2046, 0x2c08, 0xd9fc,
562 0x2060, 0x080c, 0x2693, 0x6e08, 0x2160, 0x6202, 0x6906, 0x0050, 564 0x01f0, 0x6800, 0xa065, 0x01d8, 0x6a04, 0x7000, 0xa084, 0x0002,
563 0x6800, 0x6902, 0xa065, 0x0110, 0x6102, 0x0008, 0x6906, 0x2160, 565 0x0168, 0x7048, 0xa206, 0x1150, 0x6b04, 0x2160, 0x2304, 0x6002,
564 0x6003, 0x0000, 0x2160, 0xd9fc, 0x0118, 0xa6b4, 0xfffc, 0x6e0a, 566 0xa005, 0x1108, 0x6902, 0x2260, 0x6102, 0x0098, 0x2d00, 0x2060,
565 0x6810, 0x7d08, 0x8528, 0x7d0a, 0x8000, 0x6812, 0x2091, 0x8001, 567 0x080c, 0x26bf, 0x6e08, 0x2160, 0x6202, 0x6906, 0x0050, 0x6800,
566 0xd6b4, 0x0128, 0xa6b6, 0x0040, 0x6e0a, 0x080c, 0x1bf4, 0x00ee, 568 0x6902, 0xa065, 0x0110, 0x6102, 0x0008, 0x6906, 0x2160, 0x6003,
567 0x0005, 0x6008, 0xa705, 0x600a, 0x2091, 0x8000, 0x080c, 0x1d95, 569 0x0000, 0x2160, 0xd9fc, 0x0118, 0xa6b4, 0xfffc, 0x6e0a, 0x6810,
568 0x2091, 0x8001, 0x78b8, 0xa065, 0x0128, 0x609c, 0x78ba, 0x609f, 570 0x7d08, 0x8528, 0x7d0a, 0x8000, 0x6812, 0x2091, 0x8001, 0xd6b4,
569 0x0000, 0x0c78, 0x78b6, 0x78ba, 0x0005, 0x7970, 0x7874, 0x2818, 571 0x0128, 0xa6b6, 0x0040, 0x6e0a, 0x080c, 0x1c13, 0x00ee, 0x0005,
570 0xd384, 0x0118, 0x8000, 0xa112, 0x0220, 0x8000, 0xa112, 0x1278, 572 0x6008, 0xa705, 0x600a, 0x2091, 0x8000, 0x080c, 0x1db2, 0x2091,
571 0xc384, 0x7a7c, 0x721a, 0x7a78, 0x721e, 0xdac4, 0x0120, 0x7a84, 573 0x8001, 0x78b8, 0xa065, 0x0128, 0x609c, 0x78ba, 0x609f, 0x0000,
572 0x7222, 0x7a80, 0x7226, 0xa006, 0xd384, 0x0108, 0x8000, 0x7876, 574 0x0c78, 0x78b6, 0x78ba, 0x0005, 0x7970, 0x7874, 0x2818, 0xd384,
573 0x70d2, 0x781c, 0xa005, 0x0138, 0x8001, 0x781e, 0x1120, 0x0e04, 575 0x0118, 0x8000, 0xa112, 0x0220, 0x8000, 0xa112, 0x1278, 0xc384,
574 0x205b, 0x2091, 0x4080, 0x0005, 0x2039, 0x2071, 0x0010, 0x2039, 576 0x7a7c, 0x721a, 0x7a78, 0x721e, 0xdac4, 0x0120, 0x7a84, 0x7222,
575 0x2077, 0x2704, 0xa005, 0x0160, 0xac00, 0x2068, 0x6908, 0x6810, 577 0x7a80, 0x7226, 0xa006, 0xd384, 0x0108, 0x8000, 0x7876, 0x70d2,
576 0x6912, 0x680a, 0x690c, 0x6814, 0x6916, 0x680e, 0x8738, 0x0c88, 578 0x781c, 0xa005, 0x0138, 0x8001, 0x781e, 0x1120, 0x0e04, 0x2082,
577 0x0005, 0x0003, 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0015, 579 0x2091, 0x4080, 0x0005, 0x2039, 0x2098, 0x0010, 0x2039, 0x209e,
578 0x001b, 0x0000, 0x2041, 0x0000, 0x780c, 0x0002, 0x2223, 0x21fe, 580 0x2704, 0xa005, 0x0160, 0xac00, 0x2068, 0x6908, 0x6810, 0x6912,
579 0x2082, 0x20f2, 0x2039, 0x8e74, 0x2734, 0x7d10, 0x00c0, 0x6084, 581 0x680a, 0x690c, 0x6814, 0x6916, 0x680e, 0x8738, 0x0c88, 0x0005,
580 0xa086, 0x0103, 0x1904, 0x20dc, 0x6114, 0x6018, 0xa105, 0x0120, 582 0x0003, 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0015, 0x001b,
581 0x86ff, 0x11d8, 0x0804, 0x20dc, 0x8603, 0xa080, 0x8e55, 0x620c, 583 0x0000, 0x2041, 0x0000, 0x780c, 0x0002, 0x224a, 0x2225, 0x20a9,
582 0x2202, 0x8000, 0x6210, 0x2202, 0x080c, 0x1db3, 0x8630, 0xa68e, 584 0x2119, 0x2039, 0x8f74, 0x2734, 0x7d10, 0x00c0, 0x6084, 0xa086,
583 0x000f, 0x0904, 0x215d, 0x786c, 0xa065, 0x1d08, 0x7808, 0xa602, 585 0x0103, 0x1904, 0x2103, 0x6114, 0x6018, 0xa105, 0x0120, 0x86ff,
584 0x1220, 0xd5ac, 0x1110, 0x263a, 0x0005, 0xa682, 0x0003, 0x1a04, 586 0x11d8, 0x0804, 0x2103, 0x8603, 0xa080, 0x8f55, 0x620c, 0x2202,
585 0x215d, 0x2091, 0x8000, 0x2069, 0x0000, 0x6818, 0xd084, 0x11f8, 587 0x8000, 0x6210, 0x2202, 0x080c, 0x1dd0, 0x8630, 0xa68e, 0x000f,
586 0x2011, 0x8e55, 0x2204, 0x70c6, 0x8210, 0x2204, 0x70ca, 0xd684, 588 0x0904, 0x2184, 0x786c, 0xa065, 0x1d08, 0x7808, 0xa602, 0x1220,
587 0x1130, 0x8210, 0x2204, 0x70da, 0x8210, 0x2204, 0x70de, 0xa685, 589 0xd5ac, 0x1110, 0x263a, 0x0005, 0xa682, 0x0003, 0x1a04, 0x2184,
588 0x8020, 0x70c2, 0x681b, 0x0001, 0x2091, 0x4080, 0x7810, 0xa084, 590 0x2091, 0x8000, 0x2069, 0x0000, 0x6818, 0xd084, 0x11f8, 0x2011,
589 0xffcf, 0x7812, 0x2091, 0x8001, 0x203b, 0x0000, 0x0005, 0x7810, 591 0x8f55, 0x2204, 0x70c6, 0x8210, 0x2204, 0x70ca, 0xd684, 0x1130,
590 0xc0ad, 0x7812, 0x0804, 0x215d, 0x263a, 0x080c, 0x2229, 0x1904, 592 0x8210, 0x2204, 0x70da, 0x8210, 0x2204, 0x70de, 0xa685, 0x8020,
591 0x2245, 0x786c, 0xa065, 0x1904, 0x2087, 0x2091, 0x8000, 0x7810, 593 0x70c2, 0x681b, 0x0001, 0x2091, 0x4080, 0x7810, 0xa084, 0xffcf,
592 0xa084, 0xffcf, 0x86ff, 0x0108, 0xc0ad, 0x7812, 0x2091, 0x8001, 594 0x7812, 0x2091, 0x8001, 0x203b, 0x0000, 0x0005, 0x7810, 0xc0ad,
593 0x0804, 0x2245, 0x2039, 0x8e74, 0x2734, 0x7d10, 0x00a0, 0x6084, 595 0x7812, 0x0804, 0x2184, 0x263a, 0x080c, 0x2250, 0x1904, 0x226c,
594 0xa086, 0x0103, 0x1904, 0x2147, 0x6114, 0x6018, 0xa105, 0x0120, 596 0x786c, 0xa065, 0x1904, 0x20ae, 0x2091, 0x8000, 0x7810, 0xa084,
595 0x86ff, 0x11b8, 0x0804, 0x2147, 0xa680, 0x8e55, 0x620c, 0x2202, 597 0xffcf, 0x86ff, 0x0108, 0xc0ad, 0x7812, 0x2091, 0x8001, 0x0804,
596 0x080c, 0x1db3, 0x8630, 0xa68e, 0x001e, 0x0904, 0x215d, 0x786c, 598 0x226c, 0x2039, 0x8f74, 0x2734, 0x7d10, 0x00a0, 0x6084, 0xa086,
597 0xa065, 0x1d28, 0x7808, 0xa602, 0x1220, 0xd5ac, 0x1110, 0x263a, 599 0x0103, 0x1904, 0x216e, 0x6114, 0x6018, 0xa105, 0x0120, 0x86ff,
598 0x0005, 0xa682, 0x0006, 0x1a04, 0x215d, 0x2091, 0x8000, 0x2069, 600 0x11b8, 0x0804, 0x216e, 0xa680, 0x8f55, 0x620c, 0x2202, 0x080c,
599 0x0000, 0x6818, 0xd084, 0x11f8, 0x2011, 0x8e55, 0x2009, 0x8e4e, 601 0x1dd0, 0x8630, 0xa68e, 0x001e, 0x0904, 0x2184, 0x786c, 0xa065,
600 0x26a8, 0x211c, 0x2204, 0x201a, 0x8108, 0x8210, 0x1f04, 0x2129, 602 0x1d28, 0x7808, 0xa602, 0x1220, 0xd5ac, 0x1110, 0x263a, 0x0005,
601 0xa685, 0x8030, 0x70c2, 0x681b, 0x0001, 0x2091, 0x4080, 0x7810, 603 0xa682, 0x0006, 0x1a04, 0x2184, 0x2091, 0x8000, 0x2069, 0x0000,
602 0xa084, 0xffcf, 0x7812, 0x2091, 0x8001, 0xa006, 0x2009, 0x8e75, 604 0x6818, 0xd084, 0x11f8, 0x2011, 0x8f55, 0x2009, 0x8f4e, 0x26a8,
603 0x200a, 0x203a, 0x0005, 0x7810, 0xc0ad, 0x7812, 0x00b0, 0x263a, 605 0x211c, 0x2204, 0x201a, 0x8108, 0x8210, 0x1f04, 0x2150, 0xa685,
604 0x080c, 0x2229, 0x1904, 0x2245, 0x786c, 0xa065, 0x1904, 0x20f7, 606 0x8030, 0x70c2, 0x681b, 0x0001, 0x2091, 0x4080, 0x7810, 0xa084,
605 0x2091, 0x8000, 0x7810, 0xa084, 0xffcf, 0x86ff, 0x0108, 0xc0ad, 607 0xffcf, 0x7812, 0x2091, 0x8001, 0xa006, 0x2009, 0x8f75, 0x200a,
606 0x7812, 0x2091, 0x8001, 0x0804, 0x2245, 0x2091, 0x8000, 0x7007, 608 0x203a, 0x0005, 0x7810, 0xc0ad, 0x7812, 0x00b0, 0x263a, 0x080c,
607 0x0004, 0x7994, 0x70d4, 0xa102, 0x0228, 0x0168, 0x7b90, 0xa302, 609 0x2250, 0x1904, 0x226c, 0x786c, 0xa065, 0x1904, 0x211e, 0x2091,
608 0x1150, 0x0010, 0x8002, 0x1138, 0x263a, 0x7810, 0xc0ad, 0x7812, 610 0x8000, 0x7810, 0xa084, 0xffcf, 0x86ff, 0x0108, 0xc0ad, 0x7812,
609 0x2091, 0x8001, 0x0005, 0xa184, 0xff00, 0x0140, 0x810f, 0x810c, 611 0x2091, 0x8001, 0x0804, 0x226c, 0x2091, 0x8000, 0x7007, 0x0004,
610 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0018, 0x8107, 0x8004, 612 0x7994, 0x70d4, 0xa102, 0x0228, 0x0168, 0x7b90, 0xa302, 0x1150,
611 0x8004, 0x7a9c, 0xa210, 0x721a, 0x7a98, 0xa006, 0xa211, 0x721e, 613 0x0010, 0x8002, 0x1138, 0x263a, 0x7810, 0xc0ad, 0x7812, 0x2091,
612 0xd4c4, 0x0130, 0x7aa4, 0xa211, 0x7222, 0x7aa0, 0xa211, 0x7226, 614 0x8001, 0x0005, 0xa184, 0xff00, 0x0140, 0x810f, 0x810c, 0x810c,
613 0x20a1, 0x0030, 0x7003, 0x0000, 0x2009, 0x8e54, 0x260a, 0x8109, 615 0x8004, 0x8004, 0x8007, 0xa100, 0x0018, 0x8107, 0x8004, 0x8004,
614 0x2198, 0x2104, 0xd084, 0x0108, 0x8633, 0xa6b0, 0x0002, 0x26a8, 616 0x7a9c, 0xa210, 0x721a, 0x7a98, 0xa006, 0xa211, 0x721e, 0xd4c4,
615 0x53a6, 0x8603, 0x7012, 0x7007, 0x0001, 0x7990, 0x7894, 0x8000, 617 0x0130, 0x7aa4, 0xa211, 0x7222, 0x7aa0, 0xa211, 0x7226, 0x20a1,
616 0xa10a, 0x1208, 0xa006, 0x2028, 0x7974, 0xa184, 0xff00, 0x0140, 618 0x0030, 0x7003, 0x0000, 0x2009, 0x8f54, 0x260a, 0x8109, 0x2198,
617 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0018, 619 0x2104, 0xd084, 0x0108, 0x8633, 0xa6b0, 0x0002, 0x26a8, 0x53a6,
618 0x8107, 0x8004, 0x8004, 0x797c, 0xa108, 0x7a78, 0xa006, 0xa211, 620 0x8603, 0x7012, 0x7007, 0x0001, 0x7990, 0x7894, 0x8000, 0xa10a,
619 0xd4c4, 0x0120, 0x7b84, 0xa319, 0x7c80, 0xa421, 0x7008, 0xd0fc, 621 0x1208, 0xa006, 0x2028, 0x7974, 0xa184, 0xff00, 0x0140, 0x810f,
620 0x0de8, 0xa084, 0x01e0, 0x01d0, 0x7d10, 0x2031, 0x8e54, 0x2634, 622 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0018, 0x8107,
621 0x78a8, 0x8000, 0x78aa, 0xd08c, 0x1138, 0x7007, 0x0006, 0x7004, 623 0x8004, 0x8004, 0x797c, 0xa108, 0x7a78, 0xa006, 0xa211, 0xd4c4,
622 0xd094, 0x1de8, 0x0804, 0x215f, 0x2069, 0x4647, 0x206b, 0x0003, 624 0x0120, 0x7b84, 0xa319, 0x7c80, 0xa421, 0x7008, 0xd0fc, 0x0de8,
623 0x78ac, 0xa085, 0x0300, 0x78ae, 0xa006, 0x0048, 0x2030, 0x75d6, 625 0xa084, 0x01e0, 0x01d0, 0x7d10, 0x2031, 0x8f54, 0x2634, 0x78a8,
624 0x2091, 0x4080, 0x7d96, 0x7d10, 0xa5ac, 0xffcf, 0x7d12, 0x2091, 626 0x8000, 0x78aa, 0xd08c, 0x1138, 0x7007, 0x0006, 0x7004, 0xd094,
625 0x8001, 0x78aa, 0x7007, 0x0006, 0x263a, 0x7003, 0x0001, 0x711a, 627 0x1de8, 0x0804, 0x2186, 0x2069, 0x4747, 0x206b, 0x0003, 0x78ac,
626 0x721e, 0xd5c4, 0x0110, 0x7322, 0x7426, 0x0005, 0x6084, 0xa086, 628 0xa085, 0x0300, 0x78ae, 0xa006, 0x0048, 0x2030, 0x75d6, 0x2091,
627 0x0103, 0x11d8, 0x6114, 0x6018, 0xa105, 0x11b8, 0x2069, 0x0000, 629 0x4080, 0x7d96, 0x7d10, 0xa5ac, 0xffcf, 0x7d12, 0x2091, 0x8001,
628 0x6818, 0xd084, 0x1190, 0x600c, 0x70c6, 0x6010, 0x70ca, 0x70c3, 630 0x78aa, 0x7007, 0x0006, 0x263a, 0x7003, 0x0001, 0x711a, 0x721e,
629 0x8020, 0x681b, 0x0001, 0x2091, 0x4080, 0x080c, 0x1db3, 0x0e04, 631 0xd5c4, 0x0110, 0x7322, 0x7426, 0x0005, 0x6084, 0xa086, 0x0103,
630 0x221c, 0x786c, 0xa065, 0x1d10, 0x0005, 0x0059, 0x1530, 0x786c, 632 0x11d8, 0x6114, 0x6018, 0xa105, 0x11b8, 0x2069, 0x0000, 0x6818,
631 0xa065, 0x19e0, 0x0410, 0x0029, 0x1500, 0x786c, 0xa065, 0x1dd8, 633 0xd084, 0x1190, 0x600c, 0x70c6, 0x6010, 0x70ca, 0x70c3, 0x8020,
632 0x00e0, 0x6084, 0xa086, 0x0103, 0x1168, 0x6018, 0xc0fc, 0x601a, 634 0x681b, 0x0001, 0x2091, 0x4080, 0x080c, 0x1dd0, 0x0e04, 0x2243,
633 0xa086, 0x0004, 0x1138, 0x7804, 0xd0a4, 0x0120, 0x080c, 0x1db3, 635 0x786c, 0xa065, 0x1d10, 0x0005, 0x0059, 0x1530, 0x786c, 0xa065,
634 0xa006, 0x0005, 0x0079, 0x1118, 0xa085, 0x0001, 0x0005, 0x00b9, 636 0x19e0, 0x0410, 0x0029, 0x1500, 0x786c, 0xa065, 0x1dd8, 0x00e0,
635 0x1110, 0x2041, 0x0001, 0x7d10, 0x0005, 0x88ff, 0x0110, 0x2091, 637 0x6084, 0xa086, 0x0103, 0x1168, 0x6018, 0xc0fc, 0x601a, 0xa086,
636 0x4080, 0x0005, 0x7b90, 0x7994, 0x70d4, 0xa102, 0x1118, 0xa385, 638 0x0004, 0x1138, 0x7804, 0xd0a4, 0x0120, 0x080c, 0x1dd0, 0xa006,
637 0x0000, 0x0005, 0x0210, 0xa302, 0x0005, 0x8002, 0x0005, 0xa184, 639 0x0005, 0x0079, 0x1118, 0xa085, 0x0001, 0x0005, 0x00b9, 0x1110,
638 0xff00, 0x0140, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 640 0x2041, 0x0001, 0x7d10, 0x0005, 0x88ff, 0x0110, 0x2091, 0x4080,
639 0xa100, 0x0018, 0x8107, 0x8004, 0x8004, 0x7a9c, 0x7b98, 0x7ca4, 641 0x0005, 0x7b90, 0x7994, 0x70d4, 0xa102, 0x1118, 0xa385, 0x0000,
640 0x7da0, 0xa210, 0xa006, 0xa319, 0xa421, 0xa529, 0x2009, 0x0018, 642 0x0005, 0x0210, 0xa302, 0x0005, 0x8002, 0x0005, 0xa184, 0xff00,
641 0x6028, 0xa005, 0x0110, 0x2009, 0x0040, 0x080c, 0x1b15, 0x01d0, 643 0x0140, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100,
642 0x78a8, 0x8000, 0x78aa, 0xd08c, 0x1510, 0x6014, 0xd0fc, 0x1118, 644 0x0018, 0x8107, 0x8004, 0x8004, 0x7a9c, 0x7b98, 0x7ca4, 0x7da0,
643 0x2069, 0x4640, 0x0010, 0x2069, 0x4680, 0x2091, 0x8000, 0x681f, 645 0xa210, 0xa006, 0xa319, 0xa421, 0xa529, 0x2009, 0x0018, 0x6028,
644 0x0003, 0x78ab, 0x0000, 0x78ac, 0xa085, 0x0300, 0x78ae, 0x2091, 646 0xa005, 0x0110, 0x2009, 0x0040, 0x080c, 0x1b34, 0x01d0, 0x78a8,
645 0x8001, 0x0068, 0x78ab, 0x0000, 0x080c, 0x1db3, 0x7990, 0x7894, 647 0x8000, 0x78aa, 0xd08c, 0x1510, 0x6014, 0xd0fc, 0x1118, 0x2069,
646 0x8000, 0xa10a, 0x1208, 0xa006, 0x7896, 0x70d6, 0xa006, 0x2071, 648 0x4740, 0x0010, 0x2069, 0x4780, 0x2091, 0x8000, 0x681f, 0x0003,
647 0x0010, 0x2091, 0x8001, 0x0005, 0xd7fc, 0x1118, 0x2009, 0x4658, 649 0x78ab, 0x0000, 0x78ac, 0xa085, 0x0300, 0x78ae, 0x2091, 0x8001,
648 0x0010, 0x2009, 0x4698, 0x2091, 0x8000, 0x200a, 0x00f6, 0x2009, 650 0x0068, 0x78ab, 0x0000, 0x080c, 0x1dd0, 0x7990, 0x7894, 0x8000,
649 0x4680, 0x2079, 0x0100, 0xd7fc, 0x1120, 0x2009, 0x4640, 0x2079, 651 0xa10a, 0x1208, 0xa006, 0x7896, 0x70d6, 0xa006, 0x2071, 0x0010,
650 0x0200, 0x2104, 0xa086, 0x0000, 0x1180, 0xd7fc, 0x1118, 0x2009, 652 0x2091, 0x8001, 0x0005, 0xd7fc, 0x1118, 0x2009, 0x4758, 0x0010,
651 0x4645, 0x0010, 0x2009, 0x4685, 0x2104, 0xa005, 0x1130, 0x7830, 653 0x2009, 0x4798, 0x2091, 0x8000, 0x200a, 0x00f6, 0x2009, 0x4780,
652 0xa084, 0x00c0, 0x1110, 0x781b, 0x0052, 0x00fe, 0x0005, 0x2009, 654 0x2079, 0x0100, 0xd7fc, 0x1120, 0x2009, 0x4740, 0x2079, 0x0200,
653 0x0002, 0x2069, 0x4600, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 655 0x2104, 0xa086, 0x0000, 0x1180, 0xd7fc, 0x1118, 0x2009, 0x4745,
654 0x2324, 0x2071, 0x4680, 0x2079, 0x0100, 0x2021, 0x48bf, 0x784b, 656 0x0010, 0x2009, 0x4785, 0x2104, 0xa005, 0x1130, 0x7830, 0xa084,
655 0x000f, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x0118, 0x2019, 0x3e0f, 657 0x00c0, 0x1110, 0x781b, 0x0052, 0x00fe, 0x0005, 0x2009, 0x0002,
656 0x0030, 0x20a1, 0x012b, 0x2019, 0x3e0f, 0xd184, 0x0110, 0x20a1, 658 0x2069, 0x4700, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1904, 0x234b,
657 0x022b, 0x2304, 0xa005, 0x0140, 0x789a, 0x8318, 0x23ac, 0x8318, 659 0x2071, 0x4780, 0x2079, 0x0100, 0x2021, 0x49bf, 0x784b, 0x000f,
658 0x2398, 0x53a6, 0x3318, 0x0ca8, 0x789b, 0x0000, 0x789b, 0x0020, 660 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x0118, 0x2019, 0x3e37, 0x0030,
659 0x20a9, 0x0010, 0x78af, 0x0000, 0x78af, 0x2020, 0x1f04, 0x2302, 661 0x20a1, 0x012b, 0x2019, 0x3e37, 0xd184, 0x0110, 0x20a1, 0x022b,
660 0x7003, 0x0000, 0x0016, 0xd18c, 0x2009, 0x0000, 0x0108, 0xc1bd, 662 0x2304, 0xa005, 0x0140, 0x789a, 0x8318, 0x23ac, 0x8318, 0x2398,
661 0x080c, 0x2443, 0x001e, 0x7020, 0xa084, 0x000f, 0xa085, 0x6300, 663 0x53a6, 0x3318, 0x0ca8, 0x789b, 0x0000, 0x789b, 0x0020, 0x20a9,
662 0x7806, 0x780f, 0x9000, 0x7843, 0x00d8, 0x7853, 0x0090, 0x780b, 664 0x0010, 0x78af, 0x0000, 0x78af, 0x2020, 0x1f04, 0x2329, 0x7003,
663 0x2f08, 0x7452, 0x704f, 0x0000, 0x8109, 0x0140, 0x2071, 0x4640, 665 0x0000, 0x0016, 0xd18c, 0x2009, 0x0000, 0x0108, 0xc1bd, 0x080c,
664 0x2079, 0x0200, 0x2021, 0x46bf, 0x0804, 0x22df, 0x080c, 0x24fd, 666 0x246c, 0x001e, 0x7020, 0xa084, 0x000f, 0xa085, 0x6300, 0x7806,
665 0x0005, 0x0016, 0x2011, 0x0101, 0xd1bc, 0x1110, 0x2011, 0x0201, 667 0x780f, 0x9000, 0x7843, 0x00d8, 0x7853, 0x0090, 0x780b, 0x2f08,
666 0xa18c, 0x000f, 0x2204, 0xa084, 0xfff0, 0xa105, 0x2012, 0x001e, 668 0x7452, 0x704f, 0x0000, 0x8109, 0x0140, 0x2071, 0x4740, 0x2079,
667 0x080c, 0x2443, 0x0005, 0x2011, 0x0101, 0xd3fc, 0x1110, 0x2011, 669 0x0200, 0x2021, 0x47bf, 0x0804, 0x2306, 0x080c, 0x2526, 0x0005,
668 0x0201, 0x20a9, 0x0009, 0x810b, 0x1f04, 0x234b, 0xa18c, 0x0e00, 670 0x0016, 0x2011, 0x0101, 0xd1bc, 0x1110, 0x2011, 0x0201, 0xa18c,
669 0x2204, 0xa084, 0xf1ff, 0xa105, 0x2012, 0x0005, 0x2019, 0x0002, 671 0x000f, 0x2204, 0xa084, 0xfff0, 0xa105, 0x2012, 0x001e, 0x080c,
670 0x2009, 0x0101, 0x20a9, 0x0005, 0x8213, 0x1f04, 0x235c, 0xa294, 672 0x246c, 0x0005, 0x2011, 0x0101, 0xd3fc, 0x1110, 0x2011, 0x0201,
671 0x00e0, 0x2104, 0xa084, 0xff1f, 0xa205, 0x200a, 0x8319, 0x0118, 673 0x20a9, 0x0009, 0x810b, 0x1f04, 0x2372, 0xa18c, 0x0e00, 0x2204,
672 0x2009, 0x0201, 0x0c78, 0x0005, 0x2011, 0x0101, 0xd3fc, 0x1110, 674 0xa084, 0xf1ff, 0xa105, 0x2012, 0x0005, 0x2019, 0x0002, 0x2009,
673 0x2011, 0x0201, 0x20a9, 0x000c, 0x810b, 0x1f04, 0x2374, 0xa18c, 675 0x0101, 0x20a9, 0x0005, 0x8213, 0x1f04, 0x2383, 0xa294, 0x00e0,
674 0xf000, 0x2204, 0xa084, 0x0fff, 0xa105, 0x2012, 0x0005, 0x2011, 676 0x2104, 0xa084, 0xff1f, 0xa205, 0x200a, 0x8319, 0x0118, 0x2009,
675 0x0102, 0xd3fc, 0x1110, 0x2011, 0x0202, 0x2204, 0xa084, 0xf0cf, 677 0x0201, 0x0c78, 0x0005, 0x2011, 0x0101, 0xd3fc, 0x1110, 0x2011,
676 0xa105, 0x2012, 0x0005, 0x00c6, 0x2061, 0x0100, 0xd1bc, 0x1110, 678 0x0201, 0x20a9, 0x000c, 0x810b, 0x1f04, 0x239b, 0xa18c, 0xf000,
677 0x2061, 0x0200, 0xc1bc, 0x8103, 0x8003, 0xa080, 0x0020, 0x609a, 679 0x2204, 0xa084, 0x0fff, 0xa105, 0x2012, 0x0005, 0x2011, 0x0102,
678 0x62ac, 0x63ac, 0x00ce, 0x0005, 0x00c6, 0x2061, 0x0100, 0xd1bc, 680 0xd3fc, 0x1110, 0x2011, 0x0202, 0x2204, 0xa09c, 0x0f30, 0xa084,
679 0x1110, 0x2061, 0x0200, 0xc1bc, 0x8103, 0x8003, 0xa080, 0x0022, 681 0xf0cf, 0xa105, 0x2012, 0x0005, 0x00c6, 0x2061, 0x0100, 0xd1bc,
680 0x609a, 0x60a4, 0xa084, 0xffdf, 0x60ae, 0x00ce, 0x0005, 0x00c6, 682 0x1110, 0x2061, 0x0200, 0xc1bc, 0x8103, 0x8003, 0xa080, 0x0020,
681 0x2061, 0x0100, 0xd1bc, 0x1110, 0x2061, 0x0200, 0xc1bc, 0x8103, 683 0x609a, 0x62ac, 0x63ac, 0x00ce, 0x0005, 0x00c6, 0x2061, 0x0100,
682 0x8003, 0xa080, 0x0020, 0x609a, 0x60a4, 0xa28c, 0x0020, 0x0118, 684 0xd1bc, 0x1110, 0x2061, 0x0200, 0xc1bc, 0x8103, 0x8003, 0xa080,
683 0xc2ac, 0xa39d, 0x4000, 0xc3ec, 0xd3b4, 0x1108, 0xc3ed, 0x62ae, 685 0x0022, 0x609a, 0x60a4, 0xa084, 0xffdf, 0x60ae, 0x00ce, 0x0005,
684 0x2010, 0x60a4, 0x63ae, 0x2018, 0x00ce, 0x0005, 0x2091, 0x8000, 686 0x00c6, 0x2061, 0x0100, 0xd1bc, 0x1110, 0x2061, 0x0200, 0xc1bc,
685 0x00c6, 0x00e6, 0x6818, 0xa005, 0x0904, 0x2427, 0xd1fc, 0x0118, 687 0x8103, 0x8003, 0xa080, 0x0020, 0x609a, 0x60a4, 0xa28c, 0x0020,
686 0x2061, 0x8dd0, 0x0010, 0x2061, 0x8cc0, 0x080c, 0x242f, 0x0560, 688 0x0118, 0xc2ac, 0xa39d, 0x4000, 0xc3ec, 0xd3b4, 0x1108, 0xc3ed,
687 0x20a9, 0x0101, 0xd1fc, 0x0118, 0x2061, 0x8cd0, 0x0010, 0x2061, 689 0x62ae, 0x2010, 0x60a4, 0x63ae, 0x2018, 0x00ce, 0x0005, 0x2091,
688 0x8bc0, 0x00c6, 0x080c, 0x242f, 0x0128, 0x00ce, 0x8c60, 0x1f04, 690 0x8000, 0x00c6, 0x00e6, 0x6818, 0xa005, 0x0904, 0x2450, 0xd1fc,
689 0x23e9, 0x04a8, 0x000e, 0xd1fc, 0x0128, 0xa082, 0x8cd0, 0x2071, 691 0x0118, 0x2061, 0x8ed0, 0x0010, 0x2061, 0x8dc0, 0x080c, 0x2458,
690 0x4680, 0x0020, 0xa082, 0x8bc0, 0x2071, 0x4640, 0x7076, 0x7172, 692 0x0560, 0x20a9, 0x0101, 0xd1fc, 0x0118, 0x2061, 0x8dd0, 0x0010,
691 0x2138, 0x2001, 0x0004, 0x7062, 0x707f, 0x000f, 0x71d0, 0xc1c4, 693 0x2061, 0x8cc0, 0x00c6, 0x080c, 0x2458, 0x0128, 0x00ce, 0x8c60,
692 0x71d2, 0x080c, 0x22a4, 0x00c0, 0xd1fc, 0x1118, 0x2071, 0x4640, 694 0x1f04, 0x2412, 0x04a8, 0x000e, 0xd1fc, 0x0128, 0xa082, 0x8dd0,
693 0x0010, 0x2071, 0x4680, 0x6020, 0xc0dd, 0x6022, 0x7172, 0x2138, 695 0x2071, 0x4780, 0x0020, 0xa082, 0x8cc0, 0x2071, 0x4740, 0x7076,
694 0x2c00, 0x707a, 0x2001, 0x0006, 0x7062, 0x707f, 0x000f, 0x71d0, 696 0x7172, 0x2138, 0x2001, 0x0004, 0x7062, 0x707f, 0x000f, 0x71d0,
695 0xc1c4, 0x71d2, 0x080c, 0x22a4, 0x2001, 0x0000, 0x0010, 0x2001, 697 0xc1c4, 0x71d2, 0x080c, 0x22cb, 0x00c0, 0xd1fc, 0x1118, 0x2071,
696 0x0001, 0x2091, 0x8001, 0xa005, 0x00ee, 0x00ce, 0x0005, 0x2c04, 698 0x4740, 0x0010, 0x2071, 0x4780, 0x6020, 0xc0dd, 0x6022, 0x7172,
697 0xa005, 0x0170, 0x2060, 0x6010, 0xa306, 0x1140, 0x600c, 0xa206, 699 0x2138, 0x2c00, 0x707a, 0x2001, 0x0006, 0x7062, 0x707f, 0x000f,
698 0x1128, 0x6014, 0xa106, 0x1110, 0xa006, 0x0020, 0x6000, 0x0c80, 700 0x71d0, 0xc1c4, 0x71d2, 0x080c, 0x22cb, 0x2001, 0x0000, 0x0010,
699 0xa085, 0x0001, 0x0005, 0x00f6, 0x00e6, 0x0016, 0x2079, 0x4680, 701 0x2001, 0x0001, 0x2091, 0x8001, 0xa005, 0x00ee, 0x00ce, 0x0005,
700 0x2071, 0x0100, 0xd1bc, 0x1120, 0x2079, 0x4640, 0x2071, 0x0200, 702 0x2c04, 0xa005, 0x0170, 0x2060, 0x6010, 0xa306, 0x1140, 0x600c,
701 0x7920, 0xa18c, 0x000f, 0x70ec, 0xd0c4, 0x1110, 0x001e, 0x0060, 703 0xa206, 0x1128, 0x6014, 0xa106, 0x1110, 0xa006, 0x0020, 0x6000,
702 0x810b, 0x810b, 0x810b, 0x810b, 0x000e, 0xa18d, 0x0800, 0xd0bc, 704 0x0c80, 0xa085, 0x0001, 0x0005, 0x00f6, 0x00e6, 0x0016, 0x2079,
703 0x1110, 0xa18d, 0x0f00, 0x2104, 0x00ee, 0x00fe, 0x0005, 0x2001, 705 0x4780, 0x2071, 0x0100, 0xd1bc, 0x1120, 0x2079, 0x4740, 0x2071,
704 0x4601, 0x2004, 0xd0ac, 0x1138, 0x68e4, 0xd0ac, 0x0120, 0xa084, 706 0x0200, 0x7920, 0xa18c, 0x000f, 0x70ec, 0xd0c4, 0x1110, 0x001e,
705 0x0006, 0x1108, 0x0009, 0x0005, 0x6014, 0x00e6, 0x0036, 0x2018, 707 0x0060, 0x810b, 0x810b, 0x810b, 0x810b, 0x000e, 0xa18d, 0x0800,
706 0x2071, 0x4b40, 0xd0fc, 0x1110, 0x2071, 0x4ac0, 0x8007, 0xa084, 708 0xd0bc, 0x1110, 0xa18d, 0x0f00, 0x2104, 0x00ee, 0x00fe, 0x0005,
707 0x000f, 0x8003, 0x8003, 0x8003, 0xae70, 0x7004, 0xa084, 0x000a, 709 0x2001, 0x4701, 0x2004, 0xd0ac, 0x1138, 0x68e4, 0xd0ac, 0x0120,
708 0x1904, 0x24fa, 0x7108, 0xa194, 0xff00, 0x0904, 0x24fa, 0xa18c, 710 0xa084, 0x0006, 0x1108, 0x0009, 0x0005, 0x6014, 0x00e6, 0x0036,
709 0x00ff, 0x701c, 0xa084, 0xff00, 0x01c0, 0x7004, 0xa085, 0x003a, 711 0x2018, 0x2071, 0x4c40, 0xd0fc, 0x1110, 0x2071, 0x4bc0, 0x8007,
710 0x7006, 0x2001, 0x0009, 0xa102, 0x16d8, 0x2001, 0x000a, 0xa102, 712 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xae70, 0x7004, 0xa084,
711 0x16d0, 0x2001, 0x000c, 0xa102, 0x16c8, 0x701c, 0xa084, 0x00ff, 713 0x000a, 0x1904, 0x2523, 0x7108, 0xa194, 0xff00, 0x0904, 0x2523,
712 0x701e, 0x7004, 0xa084, 0xffdf, 0x7006, 0x2001, 0x000a, 0xa106, 714 0xa18c, 0x00ff, 0x701c, 0xa084, 0xff00, 0x01c0, 0x7004, 0xa085,
713 0x01a8, 0x2001, 0x000c, 0xa106, 0x01a0, 0x2001, 0x0012, 0xa106, 715 0x003a, 0x7006, 0x2001, 0x0009, 0xa102, 0x16d8, 0x2001, 0x000a,
714 0x0198, 0x2001, 0x0014, 0xa106, 0x0190, 0x2001, 0x0019, 0xa106, 716 0xa102, 0x16d0, 0x2001, 0x000c, 0xa102, 0x16c8, 0x701c, 0xa084,
715 0x0188, 0x2001, 0x0032, 0xa106, 0x0180, 0x00d8, 0x2009, 0x000c, 717 0x00ff, 0x701e, 0x7004, 0xa084, 0xffdf, 0x7006, 0x2001, 0x000a,
716 0x00d0, 0x2009, 0x0012, 0x00b8, 0x2009, 0x0014, 0x00a0, 0x2009, 718 0xa106, 0x01a8, 0x2001, 0x000c, 0xa106, 0x01a0, 0x2001, 0x0012,
717 0x0019, 0x0088, 0x2009, 0x0020, 0x0070, 0x2009, 0x003f, 0x0058, 719 0xa106, 0x0198, 0x2001, 0x0014, 0xa106, 0x0190, 0x2001, 0x0019,
718 0x2009, 0x000a, 0x0040, 0x2009, 0x000c, 0x0028, 0x2009, 0x0019, 720 0xa106, 0x0188, 0x2001, 0x0032, 0xa106, 0x0180, 0x00d8, 0x2009,
719 0x0010, 0x2011, 0x0000, 0x2100, 0xa205, 0x700a, 0x7004, 0xa085, 721 0x000c, 0x00d0, 0x2009, 0x0012, 0x00b8, 0x2009, 0x0014, 0x00a0,
720 0x000a, 0x7006, 0x2071, 0x4600, 0x7004, 0xd0bc, 0x0158, 0xd3fc, 722 0x2009, 0x0019, 0x0088, 0x2009, 0x0020, 0x0070, 0x2009, 0x003f,
721 0x1120, 0x73ea, 0x2071, 0x4640, 0x0018, 0x73ee, 0x2071, 0x4680, 723 0x0058, 0x2009, 0x000a, 0x0040, 0x2009, 0x000c, 0x0028, 0x2009,
722 0x701f, 0x000d, 0x003e, 0x00ee, 0x0005, 0x2001, 0x01ff, 0x2004, 724 0x0019, 0x0010, 0x2011, 0x0000, 0x2100, 0xa205, 0x700a, 0x7004,
723 0xd0fc, 0x11d0, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x12a0, 725 0xa085, 0x000a, 0x7006, 0x2071, 0x4700, 0x7004, 0xd0bc, 0x0158,
724 0x2071, 0x0200, 0x71ec, 0xa18c, 0x1c00, 0x810f, 0x810c, 0x810c, 726 0xd3fc, 0x1120, 0x73ea, 0x2071, 0x4740, 0x0018, 0x73ee, 0x2071,
725 0x2079, 0x0100, 0x78ec, 0xa084, 0x1c00, 0x8007, 0x8004, 0x8004, 727 0x4780, 0x701f, 0x000d, 0x003e, 0x00ee, 0x0005, 0x2001, 0x01ff,
726 0xa105, 0xa08a, 0x0007, 0x0208, 0x0005, 0x0002, 0x254b, 0x2532, 728 0x2004, 0xd0fc, 0x11d0, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005,
727 0x254b, 0x2532, 0x2525, 0x253f, 0x2525, 0x7008, 0xa084, 0xc3ff, 729 0x12a0, 0x2071, 0x0200, 0x71ec, 0xa18c, 0x1c00, 0x810f, 0x810c,
728 0xa085, 0x3000, 0x700a, 0x7808, 0xa084, 0xc3ff, 0xa085, 0x3000, 730 0x810c, 0x2079, 0x0100, 0x78ec, 0xa084, 0x1c00, 0x8007, 0x8004,
729 0x780a, 0x0005, 0x7008, 0xa084, 0xc3ff, 0xa085, 0x2000, 0x700a, 731 0x8004, 0xa105, 0xa08a, 0x0007, 0x0208, 0x0005, 0x0002, 0x2574,
730 0x7808, 0xa084, 0xc3ff, 0xa085, 0x2000, 0x780a, 0x0005, 0x7008, 732 0x255b, 0x2574, 0x255b, 0x254e, 0x2568, 0x254e, 0x7008, 0xa084,
731 0xa084, 0xc3ff, 0xa085, 0x0c00, 0x700a, 0x7808, 0xa084, 0xc3ff, 733 0xc3ff, 0xa085, 0x3000, 0x700a, 0x7808, 0xa084, 0xc3ff, 0xa085,
732 0xa085, 0x0c00, 0x780a, 0x0005, 0x0e04, 0x254c, 0x2091, 0x8000, 734 0x3000, 0x780a, 0x0005, 0x7008, 0xa084, 0xc3ff, 0xa085, 0x2000,
733 0x2071, 0x0000, 0x0006, 0x7018, 0xd084, 0x1de8, 0x000e, 0x2071, 735 0x700a, 0x7808, 0xa084, 0xc3ff, 0xa085, 0x2000, 0x780a, 0x0005,
734 0x0010, 0x70ca, 0x000e, 0x70c6, 0x70c3, 0x8002, 0x70db, 0x0a04, 736 0x7008, 0xa084, 0xc3ff, 0xa085, 0x0c00, 0x700a, 0x7808, 0xa084,
735 0x70df, 0x0020, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 737 0xc3ff, 0xa085, 0x0c00, 0x780a, 0x0005, 0x0e04, 0x2575, 0x2091,
736 0x0cf8, 0x7f3c, 0x7e58, 0x7c30, 0x7d38, 0x78a0, 0x708a, 0x758e, 738 0x8000, 0x2071, 0x0000, 0x0006, 0x7018, 0xd084, 0x1de8, 0x000e,
737 0x7492, 0x7696, 0x779a, 0xa594, 0x003f, 0xd4f4, 0x0138, 0xd7bc, 739 0x2071, 0x0010, 0x70ca, 0x000e, 0x70c6, 0x70c3, 0x8002, 0x70db,
738 0x1128, 0xa784, 0x007d, 0x1904, 0x3c74, 0x0871, 0xa49c, 0x000f, 740 0x0a04, 0x70df, 0x002a, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091,
739 0xa382, 0x0004, 0x0320, 0xa3a6, 0x0007, 0x1930, 0x2418, 0x8507, 741 0x4080, 0x0cf8, 0x7f3c, 0x7e58, 0x7c30, 0x7d38, 0x78a0, 0x708a,
740 0xa084, 0x000f, 0x0002, 0x2b49, 0x2c34, 0x2c72, 0x2ed8, 0x3256, 742 0x758e, 0x7492, 0x7696, 0x779a, 0xa594, 0x003f, 0xd4f4, 0x0138,
741 0x32ad, 0x3353, 0x33e2, 0x34b6, 0x3588, 0x259e, 0x259b, 0x2970, 743 0xd7bc, 0x1128, 0xa784, 0x007d, 0x1904, 0x3c9c, 0x0871, 0xa49c,
742 0x2a56, 0x322a, 0x259b, 0x080c, 0x254c, 0x0005, 0xa006, 0x0038, 744 0x000f, 0xa382, 0x0004, 0x0320, 0xa3a6, 0x0007, 0x1930, 0x2418,
743 0x7808, 0xc08d, 0x780a, 0xa006, 0x7002, 0x704a, 0x7042, 0x70ce, 745 0x8507, 0xa084, 0x000f, 0x0002, 0x2b6c, 0x2c57, 0x2c95, 0x2efb,
744 0x705c, 0xa005, 0x1904, 0x26ec, 0x7060, 0xa084, 0x0007, 0x0002, 746 0x3279, 0x32d0, 0x3376, 0x3405, 0x34d9, 0x35ab, 0x25c7, 0x25c4,
745 0x25b8, 0x2626, 0x262e, 0x2637, 0x2640, 0x26d2, 0x2649, 0x2626, 747 0x299e, 0x2a85, 0x324d, 0x25c4, 0x080c, 0x2575, 0x0005, 0xa006,
746 0x7830, 0xd0bc, 0x1d10, 0x71d0, 0xd1bc, 0x19f8, 0xd1b4, 0x1904, 748 0x0038, 0x7808, 0xc08d, 0x780a, 0xa006, 0x7002, 0x704a, 0x7042,
747 0x2603, 0x70a0, 0xa086, 0x0001, 0x09c0, 0x70b0, 0xa06d, 0x6800, 749 0x70ce, 0x705c, 0xa005, 0x1904, 0x2718, 0x7060, 0xa084, 0x0007,
748 0xa065, 0xa055, 0x789b, 0x0080, 0x6b0c, 0x7baa, 0x6808, 0xa045, 750 0x0002, 0x25e1, 0x2652, 0x265a, 0x2663, 0x266c, 0x26fe, 0x2675,
749 0x6d10, 0x6804, 0xa06d, 0xa05d, 0xa886, 0x0001, 0x0118, 0x69bc, 751 0x2652, 0x7830, 0xd0bc, 0x1d10, 0x71d0, 0xd1bc, 0x19f8, 0xd1b4,
750 0x7daa, 0x79aa, 0x68c0, 0xa04d, 0x6e1c, 0x2001, 0x0010, 0x0804, 752 0x1904, 0x262f, 0x70a0, 0xa086, 0x0001, 0x09c0, 0x7014, 0xa005,
751 0x281f, 0x705c, 0xa005, 0x1904, 0x259d, 0x00c6, 0x00d6, 0x70b0, 753 0x19a8, 0x70b0, 0xa06d, 0x6800, 0xa065, 0xa055, 0x789b, 0x0080,
752 0xa06d, 0x6800, 0xa065, 0xa055, 0x789b, 0x0080, 0x6b0c, 0x7baa, 754 0x6b0c, 0x7baa, 0x6808, 0xa045, 0x6d10, 0x6804, 0xa06d, 0xa05d,
753 0x6808, 0xa045, 0x6d10, 0x6804, 0xa06d, 0xa05d, 0xa886, 0x0001, 755 0xa886, 0x0001, 0x0118, 0x69bc, 0x7daa, 0x79aa, 0x68c0, 0xa04d,
754 0x0118, 0x69bc, 0x7daa, 0x79aa, 0x68c0, 0xa04d, 0x6e1c, 0x2001, 756 0x6e1c, 0x2001, 0x0010, 0x0804, 0x284b, 0x705c, 0xa005, 0x1904,
755 0x0020, 0x0804, 0x281f, 0x080c, 0x3c33, 0x1904, 0x259d, 0x781b, 757 0x25c6, 0x00c6, 0x00d6, 0x70b0, 0xa06d, 0x6800, 0xa065, 0xa055,
756 0x0068, 0x70b8, 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, 758 0x789b, 0x0080, 0x6b0c, 0x7baa, 0x6808, 0xa045, 0x6d10, 0x6804,
757 0x6898, 0x78d2, 0x78da, 0x7808, 0xc08d, 0x780a, 0x68bc, 0x703e, 759 0xa06d, 0xa05d, 0xa886, 0x0001, 0x0118, 0x69bc, 0x7daa, 0x79aa,
758 0xc1b4, 0x71d2, 0x70b4, 0xa065, 0x68c0, 0x7056, 0x7003, 0x0002, 760 0x68c0, 0xa04d, 0x6e1c, 0x2001, 0x0020, 0x0804, 0x284b, 0x080c,
759 0x2d00, 0x704a, 0xad80, 0x0009, 0x7042, 0x0005, 0x080c, 0x3c33, 761 0x3c5b, 0x1904, 0x25c6, 0x781b, 0x0068, 0x70b8, 0xa06d, 0x68b4,
760 0x1120, 0x781b, 0x0054, 0x7003, 0x0004, 0x0005, 0x080c, 0x3c33, 762 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0x7808,
761 0x1128, 0x2011, 0x000c, 0x0419, 0x7003, 0x0004, 0x0005, 0x080c, 763 0xc08d, 0x780a, 0x68bc, 0x703e, 0xc1b4, 0x71d2, 0x70b4, 0xa065,
762 0x3c33, 0x1128, 0x2011, 0x0006, 0x00d1, 0x7003, 0x0004, 0x0005, 764 0x68c0, 0x7056, 0x7003, 0x0002, 0x2d00, 0x704a, 0xad80, 0x0009,
763 0x080c, 0x3c33, 0x1128, 0x2011, 0x000d, 0x0089, 0x7003, 0x0004, 765 0x7042, 0x0005, 0x080c, 0x3c5b, 0x1120, 0x781b, 0x0054, 0x7003,
764 0x0005, 0x080c, 0x3c33, 0x1150, 0x2011, 0x0006, 0x0041, 0x7078, 766 0x0004, 0x0005, 0x080c, 0x3c5b, 0x1128, 0x2011, 0x000c, 0x0419,
765 0x707b, 0x0000, 0x2068, 0x704a, 0x7003, 0x0004, 0x0005, 0x7170, 767 0x7003, 0x0004, 0x0005, 0x080c, 0x3c5b, 0x1128, 0x2011, 0x0006,
766 0xc1fc, 0x8107, 0x7882, 0x789b, 0x0080, 0xa286, 0x000c, 0x1120, 768 0x00d1, 0x7003, 0x0004, 0x0005, 0x080c, 0x3c5b, 0x1128, 0x2011,
767 0x7aaa, 0x2001, 0x0001, 0x0098, 0xa18c, 0x001f, 0xa18d, 0x00c0, 769 0x000d, 0x0089, 0x7003, 0x0004, 0x0005, 0x080c, 0x3c5b, 0x1150,
768 0x79aa, 0xa286, 0x000d, 0x0120, 0x7aaa, 0x2001, 0x0002, 0x0038, 770 0x2011, 0x0006, 0x0041, 0x7078, 0x707b, 0x0000, 0x2068, 0x704a,
769 0x78ab, 0x0020, 0x7174, 0x79aa, 0x7aaa, 0x2001, 0x0004, 0x789b, 771 0x7003, 0x0004, 0x0005, 0x7170, 0xc1fc, 0x8107, 0x7882, 0x789b,
770 0x0060, 0x78aa, 0x785b, 0x0004, 0x781b, 0x0113, 0x080c, 0x3c46, 772 0x0080, 0xa286, 0x000c, 0x1120, 0x7aaa, 0x2001, 0x0001, 0x0098,
771 0x707f, 0x000f, 0x70d0, 0xd0b4, 0x0168, 0xc0b4, 0x70d2, 0x00c6, 773 0xa18c, 0x001f, 0xa18d, 0x00c0, 0x79aa, 0xa286, 0x000d, 0x0120,
772 0x70b4, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 774 0x7aaa, 0x2001, 0x0002, 0x0038, 0x78ab, 0x0020, 0x7174, 0x79aa,
773 0x601a, 0x00ce, 0x0005, 0x7014, 0xa005, 0x1138, 0x70d0, 0xd0b4, 775 0x7aaa, 0x2001, 0x0004, 0x789b, 0x0060, 0x78aa, 0x785b, 0x0004,
774 0x0128, 0x70b4, 0xac06, 0x1110, 0x0c29, 0x0005, 0x0016, 0x71a0, 776 0x781b, 0x0113, 0x080c, 0x3c6e, 0x707f, 0x000f, 0x70d0, 0xd0b4,
775 0xa186, 0x0001, 0x0528, 0x00d6, 0x0026, 0x2100, 0x2011, 0x0001, 777 0x0168, 0xc0b4, 0x70d2, 0x00c6, 0x70b4, 0xa065, 0x6008, 0xa084,
776 0xa212, 0x70b0, 0x2068, 0x6800, 0xac06, 0x0120, 0x8211, 0x01b0, 778 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x00ce, 0x0005, 0x7014,
777 0x00c9, 0x0cc8, 0x00c6, 0x2100, 0x2011, 0x0001, 0xa212, 0x70b0, 779 0xa005, 0x1138, 0x70d0, 0xd0b4, 0x0128, 0x70b4, 0xac06, 0x1110,
778 0x2068, 0x6800, 0x2060, 0x6008, 0xa084, 0xfbef, 0x600a, 0x8211, 780 0x0c29, 0x0005, 0x0016, 0x71a0, 0xa186, 0x0001, 0x0528, 0x00d6,
779 0x0110, 0x0041, 0x0cb0, 0x70a3, 0x0001, 0x00ce, 0x002e, 0x00de, 781 0x0026, 0x2100, 0x2011, 0x0001, 0xa212, 0x70b0, 0x2068, 0x6800,
780 0x001e, 0x0005, 0xade8, 0x0005, 0x70a8, 0xad06, 0x1110, 0x70a4, 782 0xac06, 0x0120, 0x8211, 0x01b0, 0x00c9, 0x0cc8, 0x00c6, 0x2100,
781 0x2068, 0x0005, 0x080c, 0x3c33, 0x1904, 0x259d, 0x7078, 0x2068, 783 0x2011, 0x0001, 0xa212, 0x70b0, 0x2068, 0x6800, 0x2060, 0x6008,
782 0x7770, 0x080c, 0x3b6f, 0x2c50, 0x080c, 0x3cce, 0x789b, 0x0080, 784 0xa084, 0xfbef, 0x600a, 0x8211, 0x0110, 0x0041, 0x0cb0, 0x70a3,
783 0x6814, 0xa084, 0x001f, 0xc0bd, 0x78aa, 0x6e1c, 0x2041, 0x0001, 785 0x0001, 0x00ce, 0x002e, 0x00de, 0x001e, 0x0005, 0xade8, 0x0005,
784 0x2001, 0x0004, 0x0804, 0x2824, 0x080c, 0x3c33, 0x1904, 0x259d, 786 0x70a8, 0xad06, 0x1110, 0x70a4, 0x2068, 0x0005, 0x080c, 0x3c5b,
785 0x789b, 0x0080, 0x705c, 0x2068, 0x6f14, 0x70d0, 0xd0b4, 0x0168, 787 0x1904, 0x25c6, 0x7078, 0x2068, 0x7770, 0x080c, 0x3b95, 0x2c50,
786 0xc0b4, 0x70d2, 0x00c6, 0x70b4, 0xa065, 0x6008, 0xa084, 0xfbef, 788 0x080c, 0x3cf6, 0x789b, 0x0080, 0x6814, 0xa084, 0x001f, 0xc0bd,
787 0x600a, 0x6018, 0x8001, 0x601a, 0x00ce, 0x080c, 0x3b6f, 0x2c50, 789 0x78aa, 0x6e1c, 0x2041, 0x0001, 0x2001, 0x0004, 0x0804, 0x2850,
788 0x080c, 0x3cce, 0x6824, 0xa005, 0x0130, 0xa082, 0x0006, 0x0208, 790 0x080c, 0x3c5b, 0x1904, 0x25c6, 0x789b, 0x0080, 0x705c, 0x2068,
789 0x0010, 0x6827, 0x0005, 0x6814, 0xa084, 0x001f, 0xc0bd, 0x78aa, 791 0x6f14, 0x70d0, 0xd0b4, 0x0168, 0xc0b4, 0x70d2, 0x00c6, 0x70b4,
790 0x2031, 0x0020, 0x2041, 0x0001, 0x2001, 0x0003, 0x0804, 0x2824, 792 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a,
791 0xc28d, 0x72d2, 0x72bc, 0xa200, 0xa015, 0x7150, 0x8108, 0xa12a, 793 0x00ce, 0x080c, 0x3b95, 0x2c50, 0x080c, 0x3cf6, 0x6824, 0xa005,
792 0x0208, 0x71bc, 0x2164, 0x6504, 0x85ff, 0x1170, 0x7152, 0x8421, 794 0x0130, 0xa082, 0x0006, 0x0208, 0x0010, 0x6827, 0x0005, 0x6814,
793 0x1da8, 0x70d0, 0xd08c, 0x0128, 0x70cc, 0xa005, 0x1110, 0x70cf, 795 0xa084, 0x001f, 0xc0bd, 0x78aa, 0x2031, 0x0020, 0x2041, 0x0001,
794 0x000a, 0x0005, 0x2200, 0x0c90, 0x70d0, 0xc08c, 0x70d2, 0x70cf, 796 0x2001, 0x0003, 0x0804, 0x2850, 0xc28d, 0x72d2, 0x72bc, 0xa200,
795 0x0000, 0x6034, 0xa005, 0x1db0, 0x6708, 0xa784, 0x073f, 0x01d0, 797 0xa015, 0x7150, 0x8108, 0xa12a, 0x0208, 0x71bc, 0x2164, 0x6504,
796 0xd7d4, 0x1d80, 0xa784, 0x0021, 0x1d68, 0xa784, 0x0002, 0x0130, 798 0x85ff, 0x1170, 0x7152, 0x8421, 0x1da8, 0x70d0, 0xd08c, 0x0128,
797 0xa784, 0x0004, 0x0d38, 0xa7bc, 0xfffb, 0x670a, 0xa784, 0x0218, 799 0x70cc, 0xa005, 0x1110, 0x70cf, 0x000a, 0x0005, 0x2200, 0x0c90,
798 0x1d08, 0xa784, 0x0100, 0x0130, 0x6018, 0xa005, 0x19d8, 0xa7bc, 800 0x70d0, 0xc08c, 0x70d2, 0x70cf, 0x0000, 0x6034, 0xa005, 0x1db0,
799 0xfeff, 0x670a, 0x2568, 0x6823, 0x0000, 0x6e1c, 0xa684, 0x000e, 801 0x6708, 0xa784, 0x073f, 0x01d0, 0xd7d4, 0x1d80, 0xa784, 0x0021,
800 0x6318, 0x0128, 0x601c, 0xa302, 0x0220, 0x0118, 0x0858, 0x83ff, 802 0x1d68, 0xa784, 0x0002, 0x0130, 0xa784, 0x0004, 0x0d38, 0xa7bc,
801 0x1948, 0x2d58, 0x2c50, 0x7152, 0xd7bc, 0x1120, 0x7028, 0x6022, 803 0xfffb, 0x670a, 0xa784, 0x0218, 0x1d08, 0xa784, 0x0100, 0x0130,
802 0x603a, 0x0010, 0xc7bc, 0x670a, 0x68c0, 0xa065, 0xa04d, 0x6100, 804 0x6018, 0xa005, 0x19d8, 0xa7bc, 0xfeff, 0x670a, 0x2568, 0x6823,
803 0x2a60, 0x2041, 0x0001, 0x6b14, 0xa39c, 0x001f, 0xa39d, 0x00c0, 805 0x0000, 0x6e1c, 0xa684, 0x000e, 0x6318, 0x0128, 0x601c, 0xa302,
804 0xd1fc, 0x0110, 0xd684, 0x0110, 0xa39c, 0xffbf, 0xd6a4, 0x0110, 806 0x0220, 0x0118, 0x0858, 0x83ff, 0x1948, 0x2d58, 0x2c50, 0x7152,
805 0xa39d, 0x0020, 0xa684, 0x000e, 0x1904, 0x27d6, 0xc7a5, 0x670a, 807 0xd7bc, 0x1120, 0x7028, 0x6022, 0x603a, 0x0010, 0xc7bc, 0x670a,
806 0x2c00, 0x68c6, 0x77a0, 0xa786, 0x0001, 0x1178, 0x70d0, 0xd0b4, 808 0x68c0, 0xa065, 0xa04d, 0x6100, 0x2a60, 0x2041, 0x0001, 0x6b14,
807 0x1160, 0x7000, 0xa082, 0x0002, 0x1240, 0x7830, 0xd0bc, 0x1128, 809 0xa39c, 0x001f, 0xa39d, 0x00c0, 0xd1fc, 0x0110, 0xd684, 0x0110,
808 0x789b, 0x0080, 0x7baa, 0x0804, 0x281d, 0x8739, 0x77a2, 0x2750, 810 0xa39c, 0xffbf, 0xd6a4, 0x0110, 0xa39d, 0x0020, 0xa684, 0x000e,
809 0x77ac, 0xa7b0, 0x0005, 0x70a8, 0xa606, 0x1108, 0x76a4, 0x76ae, 811 0x1904, 0x2802, 0xc7a5, 0x670a, 0x2c00, 0x68c6, 0x77a0, 0xa786,
810 0x2c3a, 0x8738, 0x2d3a, 0x8738, 0x283a, 0x8738, 0x233a, 0x8738, 812 0x0001, 0x1178, 0x70d0, 0xd0b4, 0x1160, 0x7000, 0xa082, 0x0002,
811 0x253a, 0x7830, 0xd0bc, 0x0150, 0x2091, 0x8000, 0x2091, 0x303d, 813 0x1240, 0x7830, 0xd0bc, 0x1128, 0x789b, 0x0080, 0x7baa, 0x0804,
812 0x70d0, 0xa084, 0x303d, 0x2091, 0x8000, 0x2090, 0xaad5, 0x0000, 814 0x2849, 0x8739, 0x77a2, 0x2750, 0x77ac, 0xa7b0, 0x0005, 0x70a8,
813 0x0120, 0x8421, 0x2200, 0x1904, 0x2725, 0x0005, 0xd1dc, 0x0904, 815 0xa606, 0x1108, 0x76a4, 0x76ae, 0x2c3a, 0x8738, 0x2d3a, 0x8738,
814 0x37ce, 0x2029, 0x0020, 0xd69c, 0x1120, 0x8528, 0xd68c, 0x1108, 816 0x283a, 0x8738, 0x233a, 0x8738, 0x253a, 0x7830, 0xd0bc, 0x0150,
815 0x8528, 0x8840, 0x6f14, 0x610c, 0x8108, 0xa18c, 0x00ff, 0x70c8, 817 0x2091, 0x8000, 0x2091, 0x303d, 0x70d0, 0xa084, 0x303d, 0x2091,
816 0xa160, 0x2c64, 0x8cff, 0x0188, 0x6014, 0xa706, 0x1dd0, 0x60b8, 818 0x8000, 0x2090, 0xaad5, 0x0000, 0x0120, 0x8421, 0x2200, 0x1904,
817 0x8001, 0x60ba, 0x1d88, 0x2a60, 0x6008, 0xa085, 0x0100, 0x600a, 819 0x2751, 0x0005, 0xd1dc, 0x0904, 0x37f1, 0x2029, 0x0020, 0xd69c,
818 0x2200, 0x8421, 0x1904, 0x2725, 0x0005, 0x2a60, 0x610e, 0x69be, 820 0x1120, 0x8528, 0xd68c, 0x1108, 0x8528, 0x8840, 0x6f14, 0x610c,
819 0x2c00, 0x68c6, 0x8840, 0x6008, 0xc0d5, 0x600a, 0x77a0, 0xa786, 821 0x8108, 0xa18c, 0x00ff, 0x70c8, 0xa160, 0x2c64, 0x8cff, 0x0188,
820 0x0001, 0x1904, 0x27ad, 0x70d0, 0xd0b4, 0x1904, 0x27ad, 0x7000, 822 0x6014, 0xa706, 0x1dd0, 0x60b8, 0x8001, 0x60ba, 0x1d88, 0x2a60,
821 0xa082, 0x0002, 0x1a04, 0x27ad, 0x7830, 0xd0bc, 0x1904, 0x27ad, 823 0x6008, 0xa085, 0x0100, 0x600a, 0x2200, 0x8421, 0x1904, 0x2751,
822 0x789b, 0x0080, 0x7baa, 0x7daa, 0x79aa, 0x2001, 0x0002, 0x0006, 824 0x0005, 0x2a60, 0x610e, 0x69be, 0x2c00, 0x68c6, 0x8840, 0x6008,
823 0x6018, 0x8000, 0x601a, 0x0008, 0x0006, 0x2960, 0x6104, 0x2a60, 825 0xc0d5, 0x600a, 0x77a0, 0xa786, 0x0001, 0x1904, 0x27d9, 0x70d0,
824 0x080c, 0x3ce1, 0x1590, 0xa184, 0x0018, 0x0180, 0xa184, 0x0010, 826 0xd0b4, 0x1904, 0x27d9, 0x7000, 0xa082, 0x0002, 0x1a04, 0x27d9,
825 0x0118, 0x080c, 0x3977, 0x1548, 0xa184, 0x0008, 0x0138, 0x69a0, 827 0x7830, 0xd0bc, 0x1904, 0x27d9, 0x789b, 0x0080, 0x7baa, 0x7daa,
826 0xa184, 0x0600, 0x1118, 0x080c, 0x3895, 0x00f8, 0x69a0, 0xa184, 828 0x79aa, 0x2001, 0x0002, 0x0006, 0x6018, 0x8000, 0x601a, 0x0008,
827 0x1e00, 0x0528, 0xa184, 0x0800, 0x0178, 0x00c6, 0x2960, 0x6000, 829 0x0006, 0x2960, 0x6104, 0x2a60, 0x080c, 0x3d09, 0x1590, 0xa184,
828 0xa085, 0x2000, 0x6002, 0x6104, 0xa18d, 0x0010, 0x6106, 0x00ce, 830 0x0018, 0x0180, 0xa184, 0x0010, 0x0118, 0x080c, 0x399a, 0x1548,
829 0x080c, 0x3977, 0x1150, 0x69a0, 0xa184, 0x0200, 0x0118, 0x080c, 831 0xa184, 0x0008, 0x0138, 0x69a0, 0xa184, 0x0600, 0x1118, 0x080c,
830 0x38da, 0x0018, 0xa184, 0x0400, 0x19f0, 0x69a0, 0xa184, 0x1000, 832 0x38b8, 0x00f8, 0x69a0, 0xa184, 0x1e00, 0x0528, 0xa184, 0x0800,
831 0x0130, 0x6914, 0xa18c, 0xff00, 0x810f, 0x080c, 0x239c, 0x002e, 833 0x0178, 0x00c6, 0x2960, 0x6000, 0xa085, 0x2000, 0x6002, 0x6104,
832 0xa68c, 0x00e0, 0xa684, 0x0060, 0x0128, 0xa086, 0x0060, 0x1110, 834 0xa18d, 0x0010, 0x6106, 0x00ce, 0x080c, 0x399a, 0x1150, 0x69a0,
833 0xa18d, 0x4000, 0xa18d, 0x0104, 0x69b6, 0x789b, 0x0060, 0x2800, 835 0xa184, 0x0200, 0x0118, 0x080c, 0x38fd, 0x0018, 0xa184, 0x0400,
834 0x78aa, 0x6818, 0xc0fd, 0x681a, 0xd6bc, 0x0168, 0xc0fc, 0x7083, 836 0x19f0, 0x69a0, 0xa184, 0x1000, 0x0130, 0x6914, 0xa18c, 0xff00,
835 0x0000, 0xa08a, 0x000d, 0x0328, 0xa08a, 0x000c, 0x7182, 0x2001, 837 0x810f, 0x080c, 0x23c5, 0x002e, 0xa68c, 0x00e0, 0xa684, 0x0060,
836 0x000c, 0x800c, 0x7186, 0x78aa, 0x3518, 0x3340, 0x3428, 0x8000, 838 0x0128, 0xa086, 0x0060, 0x1110, 0xa18d, 0x4000, 0xa18d, 0x0104,
837 0x80ac, 0xaf80, 0x002b, 0x20a0, 0x789b, 0x0000, 0xad80, 0x000b, 839 0x69b6, 0x789b, 0x0060, 0x2800, 0x78aa, 0x6818, 0xc0fd, 0x681a,
838 0x2098, 0x53a6, 0x23a8, 0x2898, 0x25a0, 0xa286, 0x0020, 0x1508, 840 0xd6bc, 0x0168, 0xc0fc, 0x7083, 0x0000, 0xa08a, 0x000d, 0x0328,
839 0x70d0, 0xc0b5, 0x70d2, 0x2c00, 0x70b6, 0x2d00, 0x70ba, 0x6814, 841 0xa08a, 0x000c, 0x7182, 0x2001, 0x000c, 0x800c, 0x7186, 0x78aa,
840 0xc0fc, 0x8007, 0x7882, 0xa286, 0x0002, 0x0904, 0x28f5, 0x70a0, 842 0x3518, 0x3340, 0x3428, 0x8000, 0x80ac, 0xaf80, 0x002b, 0x20a0,
841 0x8000, 0x70a2, 0x74b0, 0xa498, 0x0005, 0x70a8, 0xa306, 0x1108, 843 0x789b, 0x0000, 0xad80, 0x000b, 0x2098, 0x53a6, 0x23a8, 0x2898,
842 0x73a4, 0x73b2, 0xa286, 0x0010, 0x0904, 0x259d, 0x00de, 0x00ce, 844 0x25a0, 0xa286, 0x0020, 0x1508, 0x70d0, 0xc0b5, 0x70d2, 0x2c00,
843 0x0005, 0x7000, 0xa005, 0x19e0, 0xa286, 0x0002, 0x1904, 0x290c, 845 0x70b6, 0x2d00, 0x70ba, 0x6814, 0xc0fc, 0x8007, 0x7882, 0xa286,
844 0x080c, 0x3c33, 0x19a8, 0x6814, 0xc0fc, 0x8007, 0x7882, 0x2091, 846 0x0002, 0x0904, 0x2921, 0x70a0, 0x8000, 0x70a2, 0x74b0, 0xa498,
845 0x8000, 0x781b, 0x0068, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, 847 0x0005, 0x70a8, 0xa306, 0x1108, 0x73a4, 0x73b2, 0xa286, 0x0010,
846 0x6898, 0x78d2, 0x78da, 0x2091, 0x8001, 0x7808, 0xc08d, 0x780a, 848 0x0904, 0x25c6, 0x00de, 0x00ce, 0x0005, 0x7000, 0xa005, 0x19e0,
847 0x0126, 0x00d6, 0x00c6, 0x70d0, 0xa084, 0x2e00, 0x2090, 0x00ce, 849 0xa286, 0x0002, 0x1904, 0x2938, 0x080c, 0x3c5b, 0x19a8, 0x6814,
848 0x00de, 0x012e, 0x2900, 0x7056, 0x68bc, 0x703e, 0x7003, 0x0002, 850 0xc0fc, 0x8007, 0x7882, 0x2091, 0x8000, 0x781b, 0x0068, 0x68b4,
849 0x2d00, 0x704a, 0xad80, 0x0009, 0x7042, 0x7830, 0xd0bc, 0x0140, 851 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0x2091,
850 0x2091, 0x303d, 0x70d0, 0xa084, 0x303d, 0x2091, 0x8000, 0x2090, 852 0x8001, 0x7808, 0xc08d, 0x780a, 0x0126, 0x00d6, 0x00c6, 0x70d0,
851 0x70a0, 0xa005, 0x1108, 0x0005, 0x8421, 0x0de8, 0x724c, 0x70bc, 853 0xa084, 0x2e00, 0x2090, 0x00ce, 0x00de, 0x012e, 0x2900, 0x7056,
852 0xa200, 0xa015, 0x0804, 0x2725, 0xa286, 0x0010, 0x1560, 0x080c, 854 0x68bc, 0x703e, 0x7003, 0x0002, 0x2d00, 0x704a, 0xad80, 0x0009,
853 0x3c33, 0x1904, 0x28a0, 0x6814, 0xc0fc, 0x8007, 0x7882, 0x781b, 855 0x7042, 0x7830, 0xd0bc, 0x0140, 0x2091, 0x303d, 0x70d0, 0xa084,
854 0x0068, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 856 0x303d, 0x2091, 0x8000, 0x2090, 0x70a0, 0xa005, 0x1108, 0x0005,
855 0x78da, 0x7808, 0xc08d, 0x780a, 0x70a0, 0x8000, 0x70a2, 0x74b0, 857 0x8421, 0x0de8, 0x724c, 0x70bc, 0xa200, 0xa015, 0x0804, 0x2751,
856 0xa490, 0x0005, 0x70a8, 0xa206, 0x1108, 0x72a4, 0x72b2, 0x2900, 858 0xa286, 0x0010, 0x1560, 0x080c, 0x3c5b, 0x1904, 0x28cc, 0x6814,
857 0x7056, 0x68bc, 0x703e, 0x7003, 0x0002, 0x2d00, 0x704a, 0xad80, 859 0xc0fc, 0x8007, 0x7882, 0x781b, 0x0068, 0x68b4, 0x785a, 0x6894,
858 0x0009, 0x7042, 0x0005, 0x6bb4, 0xa39d, 0x2000, 0x7b5a, 0x6814, 860 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0x7808, 0xc08d, 0x780a,
859 0xc0fc, 0x8007, 0x7882, 0x6b94, 0x7bd6, 0x7bde, 0x6e98, 0x7ed2, 861 0x70a0, 0x8000, 0x70a2, 0x74b0, 0xa490, 0x0005, 0x70a8, 0xa206,
860 0x7eda, 0x781b, 0x0068, 0x2900, 0x7056, 0x7202, 0x7808, 0xc08d, 862 0x1108, 0x72a4, 0x72b2, 0x2900, 0x7056, 0x68bc, 0x703e, 0x7003,
861 0x780a, 0x2300, 0xa605, 0x0170, 0x70d0, 0xa084, 0x2e00, 0xa086, 863 0x0002, 0x2d00, 0x704a, 0xad80, 0x0009, 0x7042, 0x0005, 0x6bb4,
862 0x2600, 0x1118, 0x2009, 0x0000, 0x0010, 0x2009, 0x0001, 0xa284, 864 0xa39d, 0x2000, 0x7b5a, 0x6814, 0xc0fc, 0x8007, 0x7882, 0x6b94,
863 0x000f, 0x0023, 0xad80, 0x0009, 0x7042, 0x0005, 0x296e, 0x41d9, 865 0x7bd6, 0x7bde, 0x6e98, 0x7ed2, 0x7eda, 0x781b, 0x0068, 0x2900,
864 0x41d9, 0x41c7, 0x41d9, 0x296e, 0x296e, 0x296e, 0x080c, 0x254c, 866 0x7056, 0x7202, 0x7808, 0xc08d, 0x780a, 0x2300, 0xa605, 0x0170,
865 0x7808, 0xa084, 0xfffd, 0x780a, 0x00f6, 0x2079, 0x4600, 0x78ac, 867 0x70d0, 0xa084, 0x2e00, 0xa086, 0x2600, 0x1118, 0x2009, 0x0000,
866 0x00fe, 0xd084, 0x01b0, 0x7060, 0xa086, 0x0001, 0x0904, 0x2a32, 868 0x0010, 0x2009, 0x0001, 0xa284, 0x000f, 0x0033, 0xad80, 0x0009,
867 0x7060, 0xa086, 0x0005, 0x1158, 0x7078, 0x2068, 0x681b, 0x0004, 869 0x7042, 0x2d00, 0x704a, 0x0005, 0x299c, 0x4208, 0x4208, 0x41f6,
870 0x4208, 0x299c, 0x299c, 0x299c, 0x080c, 0x2575, 0x7808, 0xa084,
871 0xfffd, 0x780a, 0x00f6, 0x2079, 0x4700, 0x78ac, 0x00fe, 0xd084,
872 0x01c0, 0x7160, 0xa186, 0x0001, 0x0904, 0x2a61, 0xa186, 0x0007,
873 0x0170, 0xa186, 0x0005, 0x1158, 0x7078, 0x2068, 0x681b, 0x0004,
868 0x6817, 0x0000, 0x6820, 0xa084, 0x00ff, 0xc09d, 0x6822, 0x7063, 874 0x6817, 0x0000, 0x6820, 0xa084, 0x00ff, 0xc09d, 0x6822, 0x7063,
869 0x0000, 0x70a3, 0x0000, 0x70a4, 0x70ae, 0x70b2, 0x080c, 0x2682, 875 0x0000, 0x70a3, 0x0000, 0x70a4, 0x70ae, 0x70b2, 0x080c, 0x26ae,
870 0x0156, 0x2011, 0x0004, 0x7160, 0xa186, 0x0001, 0x0160, 0xa186, 876 0x0156, 0x2011, 0x0004, 0x7160, 0xa186, 0x0001, 0x0158, 0xa186,
871 0x0007, 0x1118, 0x701f, 0x0005, 0x0030, 0x701f, 0x0001, 0x70d0, 877 0x0007, 0x1118, 0x701f, 0x0005, 0x0010, 0x701f, 0x0001, 0x70d0,
872 0xc0c5, 0x70d2, 0x0000, 0x2001, 0x460a, 0x2004, 0xa084, 0x00ff, 878 0xc0c5, 0x70d2, 0x2001, 0x470a, 0x2004, 0xa084, 0x00ff, 0xa086,
873 0xa086, 0x0018, 0x0130, 0x7018, 0x7016, 0xa005, 0x1110, 0x70a3, 879 0x0018, 0x0130, 0x7018, 0x7016, 0xa005, 0x1110, 0x70a3, 0x0001,
874 0x0001, 0x0066, 0x080c, 0x3f26, 0x20a9, 0x0010, 0x2039, 0x0000, 880 0x0066, 0x080c, 0x3f4e, 0x20a9, 0x0010, 0x2039, 0x0000, 0x080c,
875 0x080c, 0x3a66, 0xa7b8, 0x0100, 0x1f04, 0x29c0, 0x006e, 0x7000, 881 0x3a8b, 0xa7b8, 0x0100, 0x1f04, 0x29ef, 0x006e, 0x7000, 0x0002,
876 0x0002, 0x29fd, 0x29db, 0x29db, 0x29d3, 0x29fd, 0x29fd, 0x29fd, 882 0x2a2c, 0x2a0a, 0x2a0a, 0x2a02, 0x2a2c, 0x2a2c, 0x2a2c, 0x2a00,
877 0x29d1, 0x080c, 0x254c, 0x705c, 0xa005, 0x0538, 0xad06, 0x1118, 883 0x080c, 0x2575, 0x705c, 0xa005, 0x0538, 0xad06, 0x1118, 0x6800,
878 0x6800, 0x705e, 0x0080, 0x6820, 0xd084, 0x1148, 0x6f14, 0x080c, 884 0x705e, 0x0080, 0x6820, 0xd084, 0x1148, 0x6f14, 0x080c, 0x3b95,
879 0x3b6f, 0x6008, 0xc0d4, 0x600a, 0x080c, 0x37a4, 0x0020, 0x7058, 885 0x6008, 0xc0d4, 0x600a, 0x080c, 0x37c7, 0x0020, 0x7058, 0x2060,
880 0x2060, 0x6800, 0x6002, 0xa684, 0x5f00, 0x681e, 0x6818, 0xd0fc, 886 0x6800, 0x6002, 0xa684, 0x5f00, 0x681e, 0x6818, 0xd0fc, 0x0108,
881 0x0108, 0x6a1a, 0x6817, 0x0000, 0x682b, 0x0000, 0x6820, 0xa084, 887 0x6a1a, 0x6817, 0x0000, 0x682b, 0x0000, 0x6820, 0xa084, 0x00ff,
882 0x00ff, 0xc09d, 0x6822, 0x080c, 0x1da2, 0x2011, 0x0004, 0x74c8, 888 0xc09d, 0x6822, 0x080c, 0x1dbf, 0x2011, 0x0004, 0x74c8, 0xa4a0,
883 0xa4a0, 0x0100, 0x04b1, 0xaea0, 0x0017, 0x0499, 0x20a9, 0x0101, 889 0x0100, 0x04b1, 0xaea0, 0x0017, 0x0499, 0x20a9, 0x0101, 0x74c8,
884 0x74c8, 0x0479, 0x8420, 0x1f04, 0x2a09, 0x70c0, 0x2060, 0x2021, 890 0x0479, 0x8420, 0x1f04, 0x2a38, 0x70c0, 0x2060, 0x2021, 0x0002,
885 0x0002, 0x20a9, 0x0100, 0x6110, 0x81ff, 0x0198, 0x6018, 0x0016, 891 0x20a9, 0x0100, 0x6110, 0x81ff, 0x0198, 0x6018, 0x0016, 0x0006,
886 0x0006, 0x2011, 0x4602, 0x220c, 0xa102, 0x2012, 0x000e, 0x001e, 892 0x2011, 0x4702, 0x220c, 0xa102, 0x2012, 0x000e, 0x001e, 0xa102,
887 0xa102, 0x0338, 0x6012, 0x1128, 0x2011, 0x4604, 0x2204, 0xc0a5, 893 0x0338, 0x6012, 0x1128, 0x2011, 0x4704, 0x2204, 0xc0a5, 0x2012,
888 0x2012, 0x601b, 0x0000, 0xace0, 0x0010, 0x1f04, 0x2a13, 0x8421, 894 0x601b, 0x0000, 0xace0, 0x0010, 0x1f04, 0x2a42, 0x8421, 0x1d00,
889 0x1d00, 0x015e, 0x7063, 0x0000, 0x7003, 0x0000, 0x704b, 0x0000, 895 0x015e, 0x7063, 0x0000, 0x7003, 0x0000, 0x704b, 0x0000, 0x0005,
890 0x0005, 0x0046, 0x2404, 0xa005, 0x01a8, 0x2068, 0x6800, 0x0006, 896 0x0046, 0x2404, 0xa005, 0x01a8, 0x2068, 0x6800, 0x0006, 0x6a1a,
891 0x6a1a, 0x6817, 0x0000, 0x682b, 0x0000, 0x68b4, 0xa084, 0x5f00,
892 0x681e, 0x6820, 0xa084, 0x00ff, 0xc09d, 0x6822, 0x080c, 0x1da2,
893 0x000e, 0x0c48, 0x004e, 0x2023, 0x0000, 0x0005, 0xa282, 0x0003,
894 0x0310, 0x080c, 0x254c, 0x2300, 0x0002, 0x2a60, 0x2add, 0x2af7,
895 0xa282, 0x0002, 0x0110, 0x080c, 0x254c, 0x7060, 0x7063, 0x0000,
896 0x707f, 0x0000, 0x0022, 0x77d0, 0xc7c5, 0x77d2, 0x0002, 0x2a77,
897 0x2a77, 0x2a79, 0x2ab1, 0x37d8, 0x2a77, 0x2ab1, 0x2a77, 0x080c,
898 0x254c, 0x7770, 0x080c, 0x3a66, 0x7770, 0xa7bc, 0x8f00, 0x080c,
899 0x3b6f, 0x6018, 0xa005, 0x0528, 0xd7fc, 0x1118, 0x2021, 0x8cc0,
900 0x0010, 0x2021, 0x8dd0, 0x2009, 0x0005, 0x2011, 0x0010, 0x080c,
901 0x2b11, 0x01b8, 0x0156, 0x20a9, 0x0101, 0xd7fc, 0x1118, 0x2021,
902 0x8bc0, 0x0010, 0x2021, 0x8cd0, 0x0046, 0x2009, 0x0005, 0x2011,
903 0x0010, 0x080c, 0x2b11, 0x004e, 0x0118, 0x8420, 0x1f04, 0x2a9c,
904 0x015e, 0x8738, 0xa784, 0x001f, 0x1990, 0x0804, 0x25a0, 0x0804,
905 0x25a0, 0x7770, 0x080c, 0x3b6f, 0x6018, 0xa005, 0x0520, 0xd7fc,
906 0x1118, 0x2021, 0x8cc0, 0x0010, 0x2021, 0x8dd0, 0x2009, 0x0005,
907 0x2011, 0x0020, 0x080c, 0x2b11, 0x01b0, 0x0156, 0x20a9, 0x0101,
908 0xd7fc, 0x1118, 0x2021, 0x8bc0, 0x0010, 0x2021, 0x8cd0, 0x0046,
909 0x2009, 0x0005, 0x2011, 0x0020, 0x04e1, 0x004e, 0x0118, 0x8420,
910 0x1f04, 0x2acf, 0x015e, 0x0804, 0x25a0, 0x2200, 0x0002, 0x2ae2,
911 0x2ae4, 0x2ae4, 0x080c, 0x254c, 0x2009, 0x0012, 0x7060, 0xa086,
912 0x0002, 0x0110, 0x2009, 0x000e, 0x6818, 0xd0fc, 0x0108, 0x691a,
913 0x7063, 0x0000, 0x70d0, 0xc0c5, 0x70d2, 0x0804, 0x3be5, 0x2200,
914 0x0002, 0x2afe, 0x2ae4, 0x2afc, 0x080c, 0x254c, 0x080c, 0x3f26,
915 0x7000, 0xa086, 0x0002, 0x1904, 0x375d, 0x080c, 0x37be, 0x6008,
916 0xa084, 0xfbef, 0x600a, 0x080c, 0x374f, 0x0904, 0x375d, 0x0804,
917 0x25a0, 0x2404, 0xa005, 0x0590, 0x2068, 0x2d04, 0x0006, 0x6814,
918 0xa706, 0x0118, 0x2d20, 0x000e, 0x0ca8, 0x000e, 0x2022, 0x691a,
919 0x6817, 0x0000, 0x682b, 0x0000, 0x68b4, 0xa084, 0x5f00, 0x681e, 897 0x6817, 0x0000, 0x682b, 0x0000, 0x68b4, 0xa084, 0x5f00, 0x681e,
920 0x6820, 0xa084, 0x00ff, 0xa205, 0x6822, 0x080c, 0x1da2, 0x2021, 898 0x6820, 0xa084, 0x00ff, 0xc09d, 0x6822, 0x080c, 0x1dbf, 0x000e,
921 0x4602, 0x241c, 0x8319, 0x2322, 0x6010, 0x8001, 0x6012, 0x1128, 899 0x0c48, 0x004e, 0x2023, 0x0000, 0x0005, 0xa282, 0x0003, 0x0310,
922 0x2021, 0x4604, 0x2404, 0xc0a5, 0x2022, 0x6008, 0xa084, 0xf9ef, 900 0x080c, 0x2575, 0x2300, 0x0002, 0x2a8f, 0x2b0c, 0x2b1a, 0xa282,
923 0x600a, 0x080c, 0x269e, 0x080c, 0x37be, 0x0005, 0xa085, 0x0001, 901 0x0002, 0x0110, 0x080c, 0x2575, 0x7060, 0x7063, 0x0000, 0x707f,
924 0x0ce0, 0x2300, 0x0002, 0x2b50, 0x2b4e, 0x2bcb, 0x080c, 0x254c, 902 0x0000, 0x0022, 0x77d0, 0xc7c5, 0x77d2, 0x0002, 0x2aa6, 0x2aa6,
925 0x78e4, 0xa005, 0x17b0, 0x3208, 0xa18c, 0x0800, 0x0118, 0x0104, 903 0x2aa8, 0x2ae0, 0x37fb, 0x2aa6, 0x2ae0, 0x2aa6, 0x080c, 0x2575,
926 0x259d, 0x0010, 0x0304, 0x259d, 0x2008, 0xa084, 0x0030, 0x1110, 904 0x7770, 0x080c, 0x3a8b, 0x7770, 0xa7bc, 0x8f00, 0x080c, 0x3b95,
927 0x0804, 0x322a, 0x78ec, 0xa084, 0x0003, 0x0dd0, 0x7884, 0xd0fc, 905 0x6018, 0xa005, 0x0528, 0xd7fc, 0x1118, 0x2021, 0x8dc0, 0x0010,
928 0x1118, 0xa184, 0x0007, 0x0090, 0xa184, 0x0007, 0xa086, 0x0004, 906 0x2021, 0x8ed0, 0x2009, 0x0005, 0x2011, 0x0010, 0x080c, 0x2b34,
929 0x1118, 0x2001, 0x0000, 0x0050, 0xa184, 0x0007, 0xa086, 0x0005, 907 0x01b8, 0x0156, 0x20a9, 0x0101, 0xd7fc, 0x1118, 0x2021, 0x8cc0,
930 0x0118, 0xa184, 0x0007, 0x0010, 0x2001, 0x0001, 0x0002, 0x2bae, 908 0x0010, 0x2021, 0x8dd0, 0x0046, 0x2009, 0x0005, 0x2011, 0x0010,
931 0x2bb7, 0x2ba4, 0x2b87, 0x3c29, 0x3c29, 0x2b87, 0x2bc1, 0x080c, 909 0x080c, 0x2b34, 0x004e, 0x0118, 0x8420, 0x1f04, 0x2acb, 0x015e,
932 0x254c, 0x7000, 0xa086, 0x0004, 0x1190, 0x7060, 0xa086, 0x0002, 910 0x8738, 0xa784, 0x001f, 0x1990, 0x0804, 0x25c9, 0x0804, 0x25c9,
933 0x1130, 0x2011, 0x0002, 0x2019, 0x0000, 0x0804, 0x2a56, 0x7060, 911 0x7770, 0x080c, 0x3b95, 0x6018, 0xa005, 0x0520, 0xd7fc, 0x1118,
934 0xa086, 0x0006, 0x0db0, 0x7060, 0xa086, 0x0004, 0x0d90, 0x79e4, 912 0x2021, 0x8dc0, 0x0010, 0x2021, 0x8ed0, 0x2009, 0x0005, 0x2011,
935 0x2001, 0x0003, 0x0804, 0x2f18, 0x6818, 0xd0fc, 0x0110, 0x681b, 913 0x0020, 0x080c, 0x2b34, 0x01b0, 0x0156, 0x20a9, 0x0101, 0xd7fc,
936 0x001d, 0x080c, 0x3a3c, 0x781b, 0x006e, 0x0005, 0x6818, 0xd0fc, 914 0x1118, 0x2021, 0x8cc0, 0x0010, 0x2021, 0x8dd0, 0x0046, 0x2009,
937 0x0110, 0x681b, 0x001d, 0x080c, 0x3a3c, 0x0804, 0x3c07, 0x6818, 915 0x0005, 0x2011, 0x0020, 0x0481, 0x004e, 0x0118, 0x8420, 0x1f04,
938 0xd0fc, 0x0110, 0x681b, 0x001d, 0x080c, 0x3a3c, 0x781b, 0x00fa, 916 0x2afe, 0x015e, 0x0804, 0x25c9, 0x2200, 0x0002, 0x2b11, 0x2b13,
939 0x0005, 0x6818, 0xd0fc, 0x0110, 0x681b, 0x001d, 0x080c, 0x3a3c, 917 0x2b13, 0x080c, 0x2575, 0x7063, 0x0000, 0x70d0, 0xc0c5, 0x70d2,
940 0x781b, 0x00cb, 0x0005, 0xa584, 0x000f, 0x11c0, 0x7000, 0x0002, 918 0x0804, 0x25c9, 0x2200, 0x0002, 0x2b21, 0x2b13, 0x2b1f, 0x080c,
941 0x25a0, 0x2bd8, 0x2bda, 0x375d, 0x375d, 0x375d, 0x2bd8, 0x2bd8, 919 0x2575, 0x080c, 0x3f4e, 0x7000, 0xa086, 0x0002, 0x1904, 0x3780,
942 0x080c, 0x254c, 0x080c, 0x37be, 0x6008, 0xa084, 0xfbef, 0x600a, 920 0x080c, 0x37e1, 0x6008, 0xa084, 0xfbef, 0x600a, 0x080c, 0x3772,
943 0x080c, 0x374f, 0x0904, 0x375d, 0x0804, 0x25a0, 0x78e4, 0xa005, 921 0x0904, 0x3780, 0x0804, 0x25c9, 0x2404, 0xa005, 0x0590, 0x2068,
944 0x1b04, 0x2b89, 0x3208, 0xa18c, 0x0800, 0x0118, 0x0104, 0x2b89, 922 0x2d04, 0x0006, 0x6814, 0xa706, 0x0118, 0x2d20, 0x000e, 0x0ca8,
945 0x0010, 0x0304, 0x2b89, 0x2008, 0xa084, 0x0030, 0x1118, 0x781b, 923 0x000e, 0x2022, 0x691a, 0x6817, 0x0000, 0x682b, 0x0000, 0x68b4,
946 0x0068, 0x0005, 0x78ec, 0xa084, 0x0003, 0x0dc8, 0x7884, 0xd0fc, 924 0xa084, 0x5f00, 0x681e, 0x6820, 0xa084, 0x00ff, 0xa205, 0x6822,
947 0x1118, 0xa184, 0x0007, 0x0090, 0xa184, 0x0007, 0xa086, 0x0004, 925 0x080c, 0x1dbf, 0x2021, 0x4702, 0x241c, 0x8319, 0x2322, 0x6010,
948 0x1118, 0x2001, 0x0000, 0x0050, 0xa184, 0x0007, 0xa086, 0x0005, 926 0x8001, 0x6012, 0x1128, 0x2021, 0x4704, 0x2404, 0xc0a5, 0x2022,
949 0x0118, 0xa184, 0x0007, 0x0010, 0x2001, 0x0001, 0x0002, 0x2c26, 927 0x6008, 0xa084, 0xf9ef, 0x600a, 0x080c, 0x26ca, 0x080c, 0x37e1,
950 0x2c2a, 0x2c21, 0x2c1f, 0x3c29, 0x3c29, 0x2c1f, 0x3c23, 0x080c, 928 0x0005, 0xa085, 0x0001, 0x0ce0, 0x2300, 0x0002, 0x2b73, 0x2b71,
951 0x254c, 0x080c, 0x3a42, 0x781b, 0x006e, 0x0005, 0x080c, 0x3a42, 929 0x2bee, 0x080c, 0x2575, 0x78e4, 0xa005, 0x17b0, 0x3208, 0xa18c,
952 0x0804, 0x3c07, 0x080c, 0x3a42, 0x781b, 0x00fa, 0x0005, 0x080c, 930 0x0800, 0x0118, 0x0104, 0x25c6, 0x0010, 0x0304, 0x25c6, 0x2008,
953 0x3a42, 0x781b, 0x00cb, 0x0005, 0x2300, 0x0002, 0x2c3b, 0x2c39, 931 0xa084, 0x0030, 0x1110, 0x0804, 0x324d, 0x78ec, 0xa084, 0x0003,
954 0x2c3d, 0x080c, 0x254c, 0x0804, 0x33e2, 0x681b, 0x0016, 0x78a3, 932 0x0dd0, 0x7884, 0xd0fc, 0x1118, 0xa184, 0x0007, 0x0090, 0xa184,
955 0x0000, 0x79e4, 0xa184, 0x0030, 0x0904, 0x33e2, 0x78ec, 0xa084, 933 0x0007, 0xa086, 0x0004, 0x1118, 0x2001, 0x0000, 0x0050, 0xa184,
956 0x0003, 0x0904, 0x33e2, 0xa184, 0x0100, 0x0d98, 0x7884, 0xd0fc, 934 0x0007, 0xa086, 0x0005, 0x0118, 0xa184, 0x0007, 0x0010, 0x2001,
935 0x0001, 0x0002, 0x2bd1, 0x2bda, 0x2bc7, 0x2baa, 0x3c4f, 0x3c4f,
936 0x2baa, 0x2be4, 0x080c, 0x2575, 0x7000, 0xa086, 0x0004, 0x1190,
937 0x7060, 0xa086, 0x0002, 0x1130, 0x2011, 0x0002, 0x2019, 0x0000,
938 0x0804, 0x2a85, 0x7060, 0xa086, 0x0006, 0x0db0, 0x7060, 0xa086,
939 0x0004, 0x0d90, 0x79e4, 0x2001, 0x0003, 0x0804, 0x2f3b, 0x6818,
940 0xd0fc, 0x0110, 0x681b, 0x001d, 0x080c, 0x3a61, 0x781b, 0x006e,
941 0x0005, 0x6818, 0xd0fc, 0x0110, 0x681b, 0x001d, 0x080c, 0x3a61,
942 0x0804, 0x3c2d, 0x6818, 0xd0fc, 0x0110, 0x681b, 0x001d, 0x080c,
943 0x3a61, 0x781b, 0x00fa, 0x0005, 0x6818, 0xd0fc, 0x0110, 0x681b,
944 0x001d, 0x080c, 0x3a61, 0x781b, 0x00cb, 0x0005, 0xa584, 0x000f,
945 0x11c0, 0x7000, 0x0002, 0x25c9, 0x2bfb, 0x2bfd, 0x3780, 0x3780,
946 0x3780, 0x2bfb, 0x2bfb, 0x080c, 0x2575, 0x080c, 0x37e1, 0x6008,
947 0xa084, 0xfbef, 0x600a, 0x080c, 0x3772, 0x0904, 0x3780, 0x0804,
948 0x25c9, 0x78e4, 0xa005, 0x1b04, 0x2bac, 0x3208, 0xa18c, 0x0800,
949 0x0118, 0x0104, 0x2bac, 0x0010, 0x0304, 0x2bac, 0x2008, 0xa084,
950 0x0030, 0x1118, 0x781b, 0x0068, 0x0005, 0x78ec, 0xa084, 0x0003,
951 0x0dc8, 0x7884, 0xd0fc, 0x1118, 0xa184, 0x0007, 0x0090, 0xa184,
952 0x0007, 0xa086, 0x0004, 0x1118, 0x2001, 0x0000, 0x0050, 0xa184,
953 0x0007, 0xa086, 0x0005, 0x0118, 0xa184, 0x0007, 0x0010, 0x2001,
954 0x0001, 0x0002, 0x2c49, 0x2c4d, 0x2c44, 0x2c42, 0x3c4f, 0x3c4f,
955 0x2c42, 0x3c49, 0x080c, 0x2575, 0x080c, 0x3a67, 0x781b, 0x006e,
956 0x0005, 0x080c, 0x3a67, 0x0804, 0x3c2d, 0x080c, 0x3a67, 0x781b,
957 0x00fa, 0x0005, 0x080c, 0x3a67, 0x781b, 0x00cb, 0x0005, 0x2300,
958 0x0002, 0x2c5e, 0x2c5c, 0x2c60, 0x080c, 0x2575, 0x0804, 0x3405,
959 0x681b, 0x0016, 0x78a3, 0x0000, 0x79e4, 0xa184, 0x0030, 0x0904,
960 0x3405, 0x78ec, 0xa084, 0x0003, 0x0904, 0x3405, 0xa184, 0x0100,
961 0x0d98, 0x7884, 0xd0fc, 0x1118, 0xa184, 0x0007, 0x0090, 0xa184,
962 0x0007, 0xa086, 0x0004, 0x1118, 0x2001, 0x0000, 0x0050, 0xa184,
963 0x0007, 0xa086, 0x0005, 0x0118, 0xa184, 0x0007, 0x0010, 0x2001,
964 0x0001, 0x0002, 0x2c92, 0x2c4d, 0x2bc7, 0x3c0b, 0x3c4f, 0x3c4f,
965 0x3c0b, 0x3c49, 0x080c, 0x3c17, 0x0005, 0xa282, 0x0005, 0x0310,
966 0x080c, 0x2575, 0x7898, 0x2040, 0x2300, 0x0002, 0x2ca1, 0x2ecb,
967 0x2ed5, 0x2200, 0x0002, 0x2cbd, 0x2caa, 0x2cbd, 0x2ca8, 0x2ead,
968 0x080c, 0x2575, 0x789b, 0x0018, 0x78a8, 0x2010, 0xa084, 0x00ff,
969 0xa082, 0x0020, 0x0a04, 0x3a30, 0xa08a, 0x0004, 0x1a04, 0x3a30,
970 0x0002, 0x3a30, 0x3a30, 0x3a30, 0x39e4, 0x789b, 0x0018, 0x79a8,
971 0xa184, 0x0080, 0x0148, 0x0804, 0x3a30, 0x7000, 0xa005, 0x1dd8,
972 0x2011, 0x0004, 0x0804, 0x35b7, 0xa184, 0x00ff, 0xa08a, 0x0010,
973 0x1a04, 0x3a30, 0x0002, 0x2ce5, 0x2ce3, 0x2cf7, 0x2cfb, 0x2da9,
974 0x3a30, 0x3a30, 0x2dab, 0x3a30, 0x3a30, 0x2ea9, 0x2ea9, 0x3a30,
975 0x3a30, 0x3a30, 0x2eab, 0x080c, 0x2575, 0xd6e4, 0x0140, 0x2001,
976 0x0300, 0x8000, 0x8000, 0x783a, 0x781b, 0x00c7, 0x0005, 0x6818,
977 0xd0fc, 0x0118, 0x681b, 0x001d, 0x0c90, 0x0804, 0x3c0b, 0x681b,
978 0x001d, 0x0804, 0x3a5b, 0x6920, 0x6922, 0xa684, 0x1800, 0x1904,
979 0x2d4c, 0x6820, 0xd084, 0x1904, 0x2d54, 0x6818, 0xa086, 0x0008,
980 0x1110, 0x681b, 0x0000, 0xd6d4, 0x0568, 0xd6bc, 0x0558, 0x7083,
981 0x0000, 0x6818, 0xa084, 0x003f, 0xa08a, 0x000d, 0x0718, 0xa08a,
982 0x000c, 0x7182, 0x2001, 0x000c, 0x800c, 0x7186, 0x789b, 0x0061,
983 0x78aa, 0x0156, 0x0136, 0x0146, 0x0016, 0x3208, 0xa18c, 0x0600,
984 0x0118, 0x20a1, 0x022b, 0x0010, 0x20a1, 0x012b, 0x001e, 0x789b,
985 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x014e,
986 0x013e, 0x015e, 0x6038, 0xa005, 0x1150, 0x681c, 0xa084, 0x000e,
987 0x0904, 0x3a5b, 0x080c, 0x3a6d, 0x782b, 0x3008, 0x0010, 0x8001,
988 0x603a, 0x781b, 0x0071, 0x0005, 0xd6e4, 0x0130, 0x781b, 0x0083,
989 0x0005, 0x781b, 0x0083, 0x0005, 0xa684, 0x0060, 0x0dd0, 0xd6dc,
990 0x0dc0, 0xd6fc, 0x01a0, 0xc6fc, 0x7e5a, 0x6eb6, 0x7adc, 0x79d8,
991 0x78d0, 0x8007, 0xa084, 0x007f, 0xa108, 0xa291, 0x0000, 0x6b98,
992 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0xd6f4,
993 0x0118, 0xc6f4, 0x7e5a, 0x6eb6, 0x7000, 0xa086, 0x0003, 0x1148,
994 0x0006, 0x080c, 0x3f4e, 0x080c, 0x4208, 0x000e, 0x781b, 0x0080,
995 0x0005, 0xa006, 0x080c, 0x42e8, 0x6ab0, 0x69ac, 0x6c98, 0x6b94,
996 0x2200, 0xa105, 0x0120, 0x2200, 0xa422, 0x2100, 0xa31b, 0x6caa,
997 0x7cd2, 0x7cda, 0x6ba6, 0x7bd6, 0x7bde, 0x2300, 0xa405, 0x1130,
998 0xc6f5, 0x7e5a, 0x6eb6, 0x781b, 0x0080, 0x0005, 0x781b, 0x0080,
999 0x2200, 0xa115, 0x1118, 0x080c, 0x4208, 0x0005, 0x080c, 0x4235,
1000 0x0005, 0x080c, 0x2575, 0x0804, 0x2e3f, 0x00c6, 0x7054, 0x2060,
1001 0x6920, 0xa18c, 0xecff, 0x6922, 0x6000, 0xa084, 0xcfdf, 0x6002,
1002 0x080c, 0x3917, 0xa006, 0x2040, 0x2038, 0x080c, 0x39bf, 0x0804,
1003 0x2e33, 0x00c6, 0x7054, 0x2060, 0x2c48, 0x7aa8, 0xa294, 0x00ff,
1004 0xa286, 0x0004, 0x11d8, 0x6920, 0xd1e4, 0x1170, 0x2039, 0x0000,
1005 0x2041, 0x0000, 0x2031, 0x0000, 0xa006, 0x2010, 0x080c, 0x391a,
1006 0x080c, 0x39bf, 0x0804, 0x2e33, 0xa18c, 0xecff, 0x6922, 0x6104,
1007 0xa18c, 0xffdd, 0x6106, 0x6000, 0xc0ac, 0x6002, 0xa286, 0x0003,
1008 0x01d0, 0x6104, 0xa184, 0x0010, 0x0548, 0x080c, 0x3b91, 0x080c,
1009 0x399a, 0x88ff, 0x0518, 0x00ce, 0x789b, 0x0060, 0x2800, 0x78aa,
1010 0x7e58, 0xc695, 0x7e5a, 0xd6d4, 0x1118, 0x781b, 0x006e, 0x0005,
1011 0x781b, 0x0082, 0x0005, 0x6920, 0xd1cc, 0x0130, 0xa18c, 0xfdff,
1012 0x6922, 0x6000, 0xc0ec, 0x6002, 0x2039, 0x0000, 0x2041, 0x0000,
1013 0x2031, 0x0000, 0xa006, 0x2010, 0x080c, 0x39bf, 0xa286, 0x0001,
1014 0x0158, 0x6104, 0xa184, 0x0008, 0x01b0, 0x080c, 0x3b91, 0x080c,
1015 0x38b8, 0x88ff, 0x1980, 0x0078, 0x6920, 0xd1c4, 0x0130, 0xa18c,
1016 0xfeff, 0x6922, 0x6000, 0xc0e4, 0x6002, 0x2031, 0x0000, 0xa006,
1017 0x2010, 0x080c, 0x391a, 0x00ce, 0x7e58, 0xd6d4, 0x1118, 0x781b,
1018 0x0071, 0x0005, 0x781b, 0x0083, 0x0005, 0x0804, 0x3a57, 0x2808,
1019 0x789b, 0x0080, 0x2019, 0x0080, 0x78a8, 0xa094, 0x00ff, 0xa286,
1020 0x0001, 0x11b8, 0x2300, 0xa102, 0xa086, 0x0001, 0x0904, 0x2dad,
1021 0x7ca8, 0xa4a4, 0x00ff, 0xa480, 0x0002, 0xa300, 0x2018, 0xa102,
1022 0x0a04, 0x2dc1, 0x0904, 0x2dc1, 0x24a8, 0x7aa8, 0x1f04, 0x2e5d,
1023 0x0c18, 0xa284, 0x00f0, 0xa082, 0x0020, 0x06b8, 0x2200, 0xa082,
1024 0x0021, 0x1698, 0x7aa8, 0x8318, 0x8318, 0x2100, 0xa302, 0x0aa0,
1025 0xa286, 0x0023, 0x0950, 0x681c, 0xa084, 0xfff1, 0x681e, 0x7e58,
1026 0xa684, 0xfff1, 0xc0a5, 0x2030, 0x7e5a, 0x6008, 0xc0a5, 0x600a,
1027 0x78a0, 0xa005, 0x0904, 0x2e34, 0x20a8, 0x7998, 0x789b, 0x0060,
1028 0x78aa, 0x2011, 0x0080, 0x799a, 0x78a8, 0x7998, 0x7a9a, 0x78aa,
1029 0x7a98, 0x1f04, 0x2e8b, 0xc695, 0x7e5a, 0xd6d4, 0x1118, 0x781b,
1030 0x006e, 0x0005, 0x781b, 0x0082, 0x0005, 0x8318, 0x2100, 0xa302,
1031 0x0a04, 0x2e44, 0xa284, 0x0080, 0x1904, 0x3a5b, 0x78a0, 0xa005,
1032 0x08c8, 0x0804, 0x3a5b, 0x0804, 0x3a30, 0x7054, 0xa04d, 0x789b,
1033 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa08e, 0x0001, 0x0110, 0x080c,
1034 0x2575, 0x7aa8, 0xa294, 0x00ff, 0x784b, 0x0008, 0x78a8, 0xa084,
1035 0x00ff, 0xa08a, 0x0005, 0x1a04, 0x3a30, 0x0002, 0x3a30, 0x382f,
1036 0x3a30, 0x394a, 0x3d59, 0xa282, 0x0000, 0x1110, 0x080c, 0x2575,
1037 0x080c, 0x3a61, 0x781b, 0x0082, 0x0005, 0xa282, 0x0003, 0x1110,
1038 0x080c, 0x2575, 0xd4fc, 0x11d0, 0x7060, 0xa005, 0x0110, 0x080c,
1039 0x2575, 0x6f14, 0x7772, 0xa7bc, 0x8f00, 0x080c, 0x3b95, 0x6008,
1040 0xa085, 0x0021, 0x600a, 0x8738, 0xa784, 0x001f, 0x1db0, 0x080c,
1041 0x3a64, 0x7063, 0x0002, 0x701f, 0x0009, 0x0010, 0x080c, 0x3a70,
1042 0x781b, 0x0082, 0x0005, 0xa282, 0x0004, 0x0310, 0x080c, 0x2575,
1043 0x2300, 0x0002, 0x2f05, 0x309b, 0x30d7, 0xa286, 0x0003, 0x0598,
1044 0x7200, 0x7cd8, 0x7ddc, 0x7fd0, 0x71d0, 0xd1b4, 0x0528, 0xd1bc,
1045 0x1518, 0x2001, 0x4701, 0x2004, 0xd0c4, 0x11f0, 0x7868, 0xa084,
1046 0x00ff, 0x11d0, 0xa282, 0x0002, 0x12b8, 0x00d6, 0x783b, 0x8300,
1047 0x781b, 0x0059, 0x70b8, 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6,
1048 0x78de, 0x6898, 0x78d2, 0x78da, 0xc1b4, 0x71d2, 0x7003, 0x0030,
1049 0x00de, 0x2001, 0x0000, 0x0058, 0x783b, 0x1300, 0x781b, 0x0057,
1050 0x2001, 0x0000, 0x0020, 0x7200, 0x7cd8, 0x7ddc, 0x7fd0, 0x7046,
1051 0x68a0, 0xd0ec, 0x0118, 0x6008, 0xc08d, 0x600a, 0xa284, 0x000f,
1052 0x0002, 0x307c, 0x2f56, 0x2f53, 0x31a7, 0x3232, 0x25c9, 0x2f51,
1053 0x2f51, 0x080c, 0x2575, 0x6008, 0xc0d4, 0x600a, 0xd6e4, 0x0120,
1054 0x7044, 0xa086, 0x0014, 0x11e8, 0x080c, 0x3f4e, 0x2009, 0x0000,
1055 0x6818, 0xd0fc, 0x0108, 0x7044, 0xa086, 0x0014, 0x0168, 0x6818,
1056 0xa086, 0x0008, 0x1904, 0x303e, 0x7858, 0xd09c, 0x0904, 0x303e,
1057 0x6820, 0xd0ac, 0x0904, 0x303e, 0x681b, 0x0014, 0x2009, 0x0002,
1058 0x04a8, 0x7868, 0xa08c, 0x00ff, 0x0588, 0xa186, 0x0008, 0x1158,
1059 0x6008, 0xc0a4, 0x600a, 0x080c, 0x3772, 0x0540, 0x080c, 0x37e1,
1060 0x080c, 0x3f4e, 0x0060, 0xa186, 0x0028, 0x1500, 0x6018, 0xa005,
1061 0x0d78, 0x8001, 0x0d68, 0x8001, 0x0d58, 0x601e, 0x0c48, 0x6820,
1062 0xd084, 0x0904, 0x25c9, 0xc084, 0x6822, 0x080c, 0x26bf, 0x7058,
1063 0x00c6, 0x2060, 0x6800, 0x6002, 0x00ce, 0x6004, 0x6802, 0xa005,
1064 0x2d00, 0x1108, 0x6002, 0x6006, 0x0804, 0x25c9, 0x0016, 0x81ff,
1065 0x15f0, 0x7000, 0xa086, 0x0030, 0x05d0, 0x71d0, 0xd1bc, 0x15b8,
1066 0xd1b4, 0x11e8, 0x705c, 0xa005, 0x1590, 0x70a0, 0xa086, 0x0001,
1067 0x0570, 0x7003, 0x0000, 0x0046, 0x0056, 0x0076, 0x0066, 0x00c6,
1068 0x00d6, 0x080c, 0x25f1, 0x00de, 0x00ce, 0x006e, 0x007e, 0x005e,
1069 0x004e, 0x71d0, 0xd1b4, 0x11d8, 0x7003, 0x0040, 0x00c0, 0x080c,
1070 0x3c5b, 0x11a8, 0x781b, 0x0068, 0x00d6, 0x70b8, 0xa06d, 0x68b4,
1071 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0xc1b4,
1072 0x71d2, 0x7003, 0x0030, 0x7808, 0xc08d, 0x780a, 0x00de, 0x080c,
1073 0x30ff, 0x001e, 0x81ff, 0x0904, 0x303e, 0xa684, 0xdf00, 0x681e,
1074 0x682b, 0x0000, 0x6f14, 0xa186, 0x0002, 0x1904, 0x303f, 0x6818,
1075 0xa086, 0x0014, 0x1130, 0x2008, 0xd6e4, 0x0118, 0x7868, 0xa08c,
1076 0x00ff, 0x080c, 0x3a7a, 0x080c, 0x26ca, 0x6820, 0xd0dc, 0x1578,
1077 0x8717, 0xa294, 0x000f, 0x8213, 0x8213, 0x8213, 0xb284, 0x0600,
1078 0x0118, 0xa290, 0x4bc0, 0x0010, 0xa290, 0x4c40, 0xa290, 0x0000,
1079 0x221c, 0xd3c4, 0x0170, 0x6820, 0xd0e4, 0x0128, 0xa084, 0xefff,
1080 0x6822, 0xc3ac, 0x2312, 0x8210, 0x2204, 0xa085, 0x0038, 0x2012,
1081 0x8211, 0xd3d4, 0x0138, 0x68a0, 0xd0c4, 0x1120, 0x080c, 0x3167,
1082 0x0804, 0x25c9, 0x6008, 0xc08d, 0x600a, 0x0008, 0x692a, 0x6916,
1083 0x6818, 0xd0fc, 0x0110, 0x7044, 0x681a, 0xa68c, 0xdf00, 0x691e,
1084 0x6410, 0x84ff, 0x0168, 0x2009, 0x4702, 0x2104, 0x8001, 0x200a,
1085 0x8421, 0x6412, 0x1128, 0x2021, 0x4704, 0x2404, 0xc0a5, 0x2022,
1086 0x6018, 0xa005, 0x0118, 0x8001, 0x601a, 0x1118, 0x6008, 0xc0a4,
1087 0x600a, 0x6820, 0xd084, 0x1130, 0x6800, 0xa005, 0x1108, 0x6002,
1088 0x6006, 0x0020, 0x7058, 0x2060, 0x6800, 0x6002, 0x2061, 0x4700,
1089 0x6887, 0x0103, 0x2d08, 0x206b, 0x0000, 0x6068, 0xa005, 0x616a,
1090 0x0110, 0x2d02, 0x0008, 0x616e, 0x7200, 0xa286, 0x0030, 0x0158,
1091 0xa286, 0x0040, 0x1904, 0x25c9, 0x7003, 0x0002, 0x7048, 0x2068,
1092 0x68c4, 0x2060, 0x0005, 0x7003, 0x0002, 0x70b8, 0xa06d, 0x68bc,
1093 0x703e, 0x70b4, 0xa065, 0x68c0, 0x7056, 0x2d00, 0x704a, 0xad80,
1094 0x0009, 0x7042, 0x0005, 0xa282, 0x0004, 0x0210, 0x080c, 0x2575,
1095 0x2200, 0x0002, 0x30a6, 0x30b5, 0x30c1, 0x30b5, 0xa586, 0x1300,
1096 0x0160, 0xa586, 0x8300, 0x1d90, 0x7003, 0x0000, 0x6018, 0x8001,
1097 0x601a, 0x6008, 0xa084, 0xfbef, 0x600a, 0x7000, 0xa086, 0x0005,
1098 0x0128, 0x080c, 0x3a61, 0x781b, 0x0082, 0x0005, 0x781b, 0x0083,
1099 0x0005, 0x7890, 0x8007, 0x8001, 0xa084, 0x0007, 0xa080, 0x0018,
1100 0x789a, 0x79a8, 0xa18c, 0x00ff, 0xa186, 0x0003, 0x0128, 0xa186,
1101 0x0000, 0x0110, 0x0804, 0x3a30, 0x781b, 0x0083, 0x0005, 0x6820,
1102 0xc095, 0x6822, 0x82ff, 0x1118, 0x080c, 0x3a61, 0x0030, 0x8211,
1103 0x0110, 0x080c, 0x2575, 0x080c, 0x3a70, 0x781b, 0x0082, 0x0005,
1104 0x080c, 0x3c6e, 0x7830, 0xa084, 0x00c0, 0x1170, 0x0016, 0x3208,
1105 0xa18c, 0x0800, 0x001e, 0x0118, 0x0104, 0x30fc, 0x0010, 0x0304,
1106 0x30fc, 0x791a, 0xa006, 0x0005, 0xa085, 0x0001, 0x0005, 0xa684,
1107 0x0060, 0x1130, 0x682f, 0x0000, 0x6833, 0x0000, 0x0804, 0x3166,
1108 0xd6dc, 0x1198, 0x68b4, 0xd0dc, 0x1180, 0x6998, 0x6a94, 0x692e,
1109 0x6a32, 0x7044, 0xa005, 0x1130, 0x2200, 0xa105, 0x0904, 0x3f4e,
1110 0x7047, 0x0015, 0x0804, 0x3f4e, 0x0005, 0xd6ac, 0x01f0, 0xd6f4,
1111 0x0130, 0x682f, 0x0000, 0x6833, 0x0000, 0x0804, 0x3f4e, 0x68b4,
1112 0xa084, 0x4000, 0xa635, 0xd6f4, 0x1da0, 0x7044, 0xa005, 0x1110,
1113 0x7047, 0x0015, 0xd6dc, 0x1128, 0x68b4, 0xd0dc, 0x0110, 0x6ca8,
1114 0x6da4, 0x6c2e, 0x6d32, 0x0804, 0x3f4e, 0xd6f4, 0x0130, 0x682f,
1115 0x0000, 0x6833, 0x0000, 0x0804, 0x3f4e, 0x68b4, 0xa084, 0x4800,
1116 0xa635, 0xd6f4, 0x1da0, 0x7044, 0xa005, 0x1110, 0x7047, 0x0015,
1117 0x2408, 0x2510, 0x2700, 0x8007, 0xa084, 0x007f, 0xa108, 0xa291,
1118 0x0000, 0x692e, 0x6a32, 0x2100, 0xa205, 0x1110, 0x0804, 0x3f4e,
1119 0x7000, 0xa086, 0x0006, 0x0110, 0x0804, 0x3f4e, 0x0005, 0x6946,
1120 0x6008, 0xc0cd, 0xd3cc, 0x0108, 0xc08d, 0x600a, 0x6818, 0x683a,
1121 0x681b, 0x0006, 0x688f, 0x0000, 0x6893, 0x0000, 0x6a30, 0x692c,
1122 0x6a3e, 0x6942, 0x682f, 0x0003, 0x6833, 0x0000, 0x6837, 0x0020,
1123 0x6897, 0x0000, 0x689b, 0x0020, 0x7000, 0x0002, 0x25c9, 0x3196,
1124 0x3190, 0x318e, 0x318e, 0x318e, 0x318e, 0x318e, 0x080c, 0x2575,
1125 0x6820, 0xd084, 0x1118, 0x080c, 0x37c7, 0x0030, 0x7058, 0x2c50,
1126 0x2060, 0x6800, 0x6002, 0x2a60, 0xaea0, 0x0017, 0x2404, 0xa005,
1127 0x0110, 0x2020, 0x0cd8, 0x2d22, 0x206b, 0x0000, 0x0005, 0x080c,
1128 0x37cd, 0x080c, 0x37e1, 0x6008, 0xc0cc, 0x600a, 0x682b, 0x0000,
1129 0x789b, 0x000e, 0x6f14, 0x6938, 0x691a, 0x6944, 0x6916, 0x2009,
1130 0x0000, 0xae86, 0x4740, 0x0110, 0x2009, 0x0001, 0x080c, 0x431f,
1131 0xd6dc, 0x01c8, 0x691c, 0xc1ed, 0x691e, 0x6828, 0xa082, 0x000e,
1132 0x0290, 0x6848, 0xa084, 0x000f, 0xa086, 0x000b, 0x1160, 0x685c,
1133 0xa086, 0x0047, 0x1140, 0x2001, 0x4701, 0x2004, 0xd0ac, 0x1118,
1134 0x2700, 0x080c, 0x249e, 0x6818, 0xd0fc, 0x0140, 0x681b, 0x0000,
1135 0x7868, 0xa08c, 0x00ff, 0x0110, 0x681b, 0x001e, 0xaea0, 0x0017,
1136 0x6800, 0x2022, 0x6a3c, 0x6940, 0x6a32, 0x692e, 0x68c0, 0x2060,
1137 0x6000, 0xd0a4, 0x0580, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051,
1138 0x0020, 0x00d6, 0x00f6, 0x0156, 0x0146, 0x2079, 0x4700, 0x080c,
1139 0x1bb2, 0x014e, 0x015e, 0x00fe, 0x70c8, 0x2010, 0x2009, 0x0101,
1140 0x0026, 0x2204, 0xa06d, 0x0140, 0x6814, 0xa706, 0x0110, 0x6800,
1141 0x0cc8, 0x6820, 0xc0d5, 0x6822, 0x002e, 0x8210, 0x8109, 0x1d80,
1142 0x00de, 0x7063, 0x0003, 0x707b, 0x0000, 0x7772, 0x707f, 0x000f,
1143 0x71d0, 0xc1c4, 0x71d2, 0x6818, 0xa086, 0x0002, 0x1138, 0x6817,
1144 0x0000, 0x682b, 0x0000, 0x681c, 0xc0ec, 0x681e, 0x080c, 0x1dbf,
1145 0x0804, 0x25c9, 0x7cd8, 0x7ddc, 0x7fd0, 0x080c, 0x30ff, 0x682b,
1146 0x0000, 0x789b, 0x000e, 0x6f14, 0x080c, 0x3c72, 0xa08c, 0x00ff,
1147 0x6916, 0x6818, 0xd0fc, 0x0110, 0x7044, 0x681a, 0xa68c, 0xdf00,
1148 0x691e, 0x7063, 0x0000, 0x0804, 0x25c9, 0x7000, 0xa005, 0x1110,
1149 0x0804, 0x25c9, 0xa006, 0x080c, 0x3f4e, 0x6920, 0xd1ac, 0x1110,
1150 0x681b, 0x0014, 0xa68c, 0xdf00, 0x691e, 0x682b, 0x0000, 0x6820,
1151 0xa084, 0x00ff, 0x6822, 0x7000, 0x0002, 0x25c9, 0x326f, 0x326f,
1152 0x3272, 0x3272, 0x3272, 0x326d, 0x326d, 0x080c, 0x2575, 0x6818,
1153 0x0804, 0x2f3b, 0x6008, 0xc0a4, 0x600a, 0x6817, 0x0000, 0x0804,
1154 0x3795, 0x2300, 0x0002, 0x327e, 0x3280, 0x32ce, 0x080c, 0x2575,
1155 0xd6fc, 0x1904, 0x2d5b, 0x7000, 0xa00d, 0x0002, 0x25c9, 0x3290,
1156 0x3290, 0x32ba, 0x3290, 0x32cb, 0x328e, 0x328e, 0x080c, 0x2575,
1157 0xa684, 0x0060, 0x0538, 0xa086, 0x0060, 0x1510, 0xc6ac, 0xc6f4,
1158 0xc6ed, 0x7e5a, 0x6eb6, 0x681c, 0xc0ac, 0x681e, 0xa186, 0x0002,
1159 0x0148, 0x080c, 0x3f4e, 0x69ac, 0x68b0, 0xa115, 0x0118, 0x080c,
1160 0x4235, 0x0010, 0x080c, 0x4208, 0x781b, 0x0083, 0x71d0, 0xd1b4,
1161 0x1904, 0x25c6, 0x70a0, 0xa086, 0x0001, 0x1904, 0x260d, 0x0005,
1162 0xd6ec, 0x09f0, 0x6818, 0xd0fc, 0x0170, 0xd6f4, 0x1130, 0x681b,
1163 0x0015, 0x781b, 0x0083, 0x0804, 0x25c6, 0x681b, 0x0007, 0x682f,
1164 0x0000, 0x6833, 0x0000, 0x080c, 0x3c17, 0x0005, 0x080c, 0x2575,
1165 0x2300, 0x0002, 0x32d7, 0x32f9, 0x3351, 0x080c, 0x2575, 0x7000,
1166 0x0002, 0x32e1, 0x32e3, 0x32ea, 0x32e1, 0x32e1, 0x32e1, 0x32e1,
1167 0x32e1, 0x080c, 0x2575, 0x69ac, 0x68b0, 0xa115, 0x0118, 0x080c,
1168 0x4235, 0x0010, 0x080c, 0x4208, 0x681c, 0xc0b4, 0x681e, 0x70d0,
1169 0xd0b4, 0x1904, 0x25c6, 0x70a0, 0xa086, 0x0001, 0x1904, 0x260d,
1170 0x0005, 0xd6fc, 0x1904, 0x3341, 0x7000, 0xa00d, 0x0002, 0x25c9,
1171 0x330f, 0x3309, 0x3339, 0x330f, 0x333e, 0x3307, 0x3307, 0x080c,
1172 0x2575, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0xa684,
1173 0x0060, 0x0538, 0xa086, 0x0060, 0x1510, 0xa6b4, 0xbfbf, 0xc6ed,
1174 0x7e5a, 0x6eb6, 0xa186, 0x0002, 0x0148, 0x080c, 0x3f4e, 0x69ac,
1175 0x68b0, 0xa115, 0x0118, 0x080c, 0x4235, 0x0010, 0x080c, 0x4208,
1176 0x781b, 0x0083, 0x681c, 0xc0b4, 0x681e, 0x71d0, 0xd1b4, 0x1904,
1177 0x25c6, 0x70a0, 0xa086, 0x0001, 0x1904, 0x260d, 0x0005, 0xd6ec,
1178 0x09f0, 0x6818, 0xd0fc, 0x0110, 0x681b, 0x0007, 0x781b, 0x00fb,
1179 0x0005, 0xc6fc, 0x7e5a, 0x7adc, 0x79d8, 0x6b98, 0x2100, 0xa302,
1180 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x79d2, 0x781b, 0x0083,
1181 0x0005, 0xd6dc, 0x0130, 0x782b, 0x3009, 0x781b, 0x0083, 0x0804,
1182 0x25c6, 0x7884, 0xc0ac, 0x7886, 0x78e4, 0xa084, 0x0008, 0x1150,
1183 0xa484, 0x0200, 0x0108, 0xc6f5, 0xc6dd, 0x7e5a, 0x781b, 0x0083,
1184 0x0804, 0x25c6, 0x6820, 0xc095, 0x6822, 0x080c, 0x3c02, 0xc6dd,
1185 0x080c, 0x3a61, 0x781b, 0x0082, 0x0804, 0x25c6, 0x2300, 0x0002,
1186 0x337b, 0x337d, 0x337f, 0x080c, 0x2575, 0x0804, 0x3a5b, 0x7d98,
1187 0xd6d4, 0x15a8, 0x79e4, 0xd1ac, 0x0130, 0x78ec, 0xa084, 0x0003,
1188 0x0110, 0x782b, 0x3009, 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684,
1189 0xfffb, 0x785a, 0x7d9a, 0x79e4, 0xd1ac, 0x0120, 0x78ec, 0xa084,
1190 0x0003, 0x1120, 0x2001, 0x0014, 0x0804, 0x2f3b, 0x7884, 0xd0fc,
957 0x1118, 0xa184, 0x0007, 0x0090, 0xa184, 0x0007, 0xa086, 0x0004, 1191 0x1118, 0xa184, 0x0007, 0x0090, 0xa184, 0x0007, 0xa086, 0x0004,
958 0x1118, 0x2001, 0x0000, 0x0050, 0xa184, 0x0007, 0xa086, 0x0005, 1192 0x1118, 0x2001, 0x0000, 0x0050, 0xa184, 0x0007, 0xa086, 0x0005,
959 0x0118, 0xa184, 0x0007, 0x0010, 0x2001, 0x0001, 0x0002, 0x2c6f, 1193 0x0118, 0xa184, 0x0007, 0x0010, 0x2001, 0x0001, 0x04c2, 0x7a90,
960 0x2c2a, 0x2ba4, 0x3be5, 0x3c29, 0x3c29, 0x3be5, 0x3c23, 0x080c, 1194 0xa294, 0x0007, 0x789b, 0x0060, 0x79a8, 0x81ff, 0x0568, 0x789b,
961 0x3bf1, 0x0005, 0xa282, 0x0005, 0x0310, 0x080c, 0x254c, 0x7898, 1195 0x0080, 0x7ba8, 0xa384, 0x0001, 0x11d0, 0x7ba8, 0x7ba8, 0xa386,
962 0x2040, 0x2300, 0x0002, 0x2c7e, 0x2ea8, 0x2eb2, 0x2200, 0x0002, 1196 0x0004, 0x1118, 0x2009, 0xffdf, 0x0058, 0xa386, 0x0001, 0x1118,
963 0x2c9a, 0x2c87, 0x2c9a, 0x2c85, 0x2e8a, 0x080c, 0x254c, 0x789b, 1197 0x2009, 0xfff7, 0x0028, 0xa386, 0x0003, 0x1148, 0x2009, 0xffef,
964 0x0018, 0x78a8, 0x2010, 0xa084, 0x00ff, 0xa082, 0x0020, 0x0a04, 1198 0x00c6, 0x7054, 0x2060, 0x6004, 0xa104, 0x6006, 0x00ce, 0x789b,
965 0x3a0b, 0xa08a, 0x0004, 0x1a04, 0x3a0b, 0x0002, 0x3a0b, 0x3a0b, 1199 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, 0x782b, 0x3009,
966 0x3a0b, 0x39c1, 0x789b, 0x0018, 0x79a8, 0xa184, 0x0080, 0x0148, 1200 0x6920, 0xa18c, 0xecff, 0x6922, 0x7d9a, 0x0804, 0x3c0b, 0x2bd1,
967 0x0804, 0x3a0b, 0x7000, 0xa005, 0x1dd8, 0x2011, 0x0004, 0x0804, 1201 0x2bda, 0x33f9, 0x33ff, 0x33f7, 0x33f7, 0x3c0b, 0x3c0b, 0x080c,
968 0x3594, 0xa184, 0x00ff, 0xa08a, 0x0010, 0x1a04, 0x3a0b, 0x0002, 1202 0x2575, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0804, 0x3c11, 0x6920,
969 0x2cc2, 0x2cc0, 0x2cd4, 0x2cd8, 0x2d86, 0x3a0b, 0x3a0b, 0x2d88, 1203 0xa18c, 0xfcff, 0x6922, 0x0804, 0x3c0b, 0x79e4, 0xa184, 0x0030,
970 0x3a0b, 0x3a0b, 0x2e86, 0x2e86, 0x3a0b, 0x3a0b, 0x3a0b, 0x2e88, 1204 0x0120, 0x78ec, 0xa084, 0x0003, 0x1570, 0x7000, 0xa086, 0x0004,
971 0x080c, 0x254c, 0xd6e4, 0x0140, 0x2001, 0x0300, 0x8000, 0x8000, 1205 0x1190, 0x7060, 0xa086, 0x0002, 0x1130, 0x2011, 0x0002, 0x2019,
972 0x783a, 0x781b, 0x00c7, 0x0005, 0x6818, 0xd0fc, 0x0118, 0x681b, 1206 0x0000, 0x0804, 0x2a85, 0x7060, 0xa086, 0x0006, 0x0db0, 0x7060,
973 0x001d, 0x0c90, 0x0804, 0x3be5, 0x681b, 0x001d, 0x0804, 0x3a36, 1207 0xa086, 0x0004, 0x0d90, 0x7000, 0xa086, 0x0000, 0x0904, 0x25c6,
974 0x6920, 0x6922, 0xa684, 0x1800, 0x1904, 0x2d29, 0x6820, 0xd084, 1208 0x6920, 0xa184, 0x0420, 0x0128, 0xc1d4, 0x6922, 0x6818, 0x0804,
975 0x1904, 0x2d31, 0x6818, 0xa086, 0x0008, 0x1110, 0x681b, 0x0000, 1209 0x2f3b, 0x6818, 0xa08e, 0x0002, 0x0120, 0xc0fd, 0x681a, 0x2001,
976 0xd6d4, 0x0568, 0xd6bc, 0x0558, 0x7083, 0x0000, 0x6818, 0xa084, 1210 0x0014, 0x0804, 0x2f3b, 0x7884, 0xd0fc, 0x1118, 0xa184, 0x0007,
977 0x003f, 0xa08a, 0x000d, 0x0718, 0xa08a, 0x000c, 0x7182, 0x2001,
978 0x000c, 0x800c, 0x7186, 0x789b, 0x0061, 0x78aa, 0x0156, 0x0136,
979 0x0146, 0x0016, 0x3208, 0xa18c, 0x0600, 0x0118, 0x20a1, 0x022b,
980 0x0010, 0x20a1, 0x012b, 0x001e, 0x789b, 0x0000, 0x8000, 0x80ac,
981 0xad80, 0x000b, 0x2098, 0x53a6, 0x014e, 0x013e, 0x015e, 0x6038,
982 0xa005, 0x1150, 0x681c, 0xa084, 0x000e, 0x0904, 0x3a36, 0x080c,
983 0x3a48, 0x782b, 0x3008, 0x0010, 0x8001, 0x603a, 0x781b, 0x0071,
984 0x0005, 0xd6e4, 0x0130, 0x781b, 0x0083, 0x0005, 0x781b, 0x0083,
985 0x0005, 0xa684, 0x0060, 0x0dd0, 0xd6dc, 0x0dc0, 0xd6fc, 0x01a0,
986 0xc6fc, 0x7e5a, 0x6eb6, 0x7adc, 0x79d8, 0x78d0, 0x8007, 0xa084,
987 0x007f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2,
988 0x6b94, 0x2200, 0xa303, 0x68ae, 0xd6f4, 0x0118, 0xc6f4, 0x7e5a,
989 0x6eb6, 0x7000, 0xa086, 0x0003, 0x1148, 0x0006, 0x080c, 0x3f26,
990 0x080c, 0x41d9, 0x000e, 0x781b, 0x0080, 0x0005, 0xa006, 0x080c,
991 0x42b5, 0x6ab0, 0x69ac, 0x6c98, 0x6b94, 0x2200, 0xa105, 0x0120,
992 0x2200, 0xa422, 0x2100, 0xa31b, 0x6caa, 0x7cd2, 0x7cda, 0x6ba6,
993 0x7bd6, 0x7bde, 0x2300, 0xa405, 0x1130, 0xc6f5, 0x7e5a, 0x6eb6,
994 0x781b, 0x0080, 0x0005, 0x781b, 0x0080, 0x2200, 0xa115, 0x1118,
995 0x080c, 0x41d9, 0x0005, 0x080c, 0x4206, 0x0005, 0x080c, 0x254c,
996 0x0804, 0x2e1c, 0x00c6, 0x7054, 0x2060, 0x6920, 0xa18c, 0xecff,
997 0x6922, 0x6000, 0xa084, 0xcfdf, 0x6002, 0x080c, 0x38f4, 0xa006,
998 0x2040, 0x2038, 0x080c, 0x399c, 0x0804, 0x2e10, 0x00c6, 0x7054,
999 0x2060, 0x2c48, 0x7aa8, 0xa294, 0x00ff, 0xa286, 0x0004, 0x11d8,
1000 0x6920, 0xd1e4, 0x1170, 0x2039, 0x0000, 0x2041, 0x0000, 0x2031,
1001 0x0000, 0xa006, 0x2010, 0x080c, 0x38f7, 0x080c, 0x399c, 0x0804,
1002 0x2e10, 0xa18c, 0xecff, 0x6922, 0x6104, 0xa18c, 0xffdd, 0x6106,
1003 0x6000, 0xc0ac, 0x6002, 0xa286, 0x0003, 0x01d0, 0x6104, 0xa184,
1004 0x0010, 0x0548, 0x080c, 0x3b6b, 0x080c, 0x3977, 0x88ff, 0x0518,
1005 0x00ce, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, 0xc695, 0x7e5a,
1006 0xd6d4, 0x1118, 0x781b, 0x006e, 0x0005, 0x781b, 0x0082, 0x0005,
1007 0x6920, 0xd1cc, 0x0130, 0xa18c, 0xfdff, 0x6922, 0x6000, 0xc0ec,
1008 0x6002, 0x2039, 0x0000, 0x2041, 0x0000, 0x2031, 0x0000, 0xa006,
1009 0x2010, 0x080c, 0x399c, 0xa286, 0x0001, 0x0158, 0x6104, 0xa184,
1010 0x0008, 0x01b0, 0x080c, 0x3b6b, 0x080c, 0x3895, 0x88ff, 0x1980,
1011 0x0078, 0x6920, 0xd1c4, 0x0130, 0xa18c, 0xfeff, 0x6922, 0x6000,
1012 0xc0e4, 0x6002, 0x2031, 0x0000, 0xa006, 0x2010, 0x080c, 0x38f7,
1013 0x00ce, 0x7e58, 0xd6d4, 0x1118, 0x781b, 0x0071, 0x0005, 0x781b,
1014 0x0083, 0x0005, 0x0804, 0x3a32, 0x2808, 0x789b, 0x0080, 0x2019,
1015 0x0080, 0x78a8, 0xa094, 0x00ff, 0xa286, 0x0001, 0x11b8, 0x2300,
1016 0xa102, 0xa086, 0x0001, 0x0904, 0x2d8a, 0x7ca8, 0xa4a4, 0x00ff,
1017 0xa480, 0x0002, 0xa300, 0x2018, 0xa102, 0x0a04, 0x2d9e, 0x0904,
1018 0x2d9e, 0x24a8, 0x7aa8, 0x1f04, 0x2e3a, 0x0c18, 0xa284, 0x00f0,
1019 0xa082, 0x0020, 0x06b8, 0x2200, 0xa082, 0x0021, 0x1698, 0x7aa8,
1020 0x8318, 0x8318, 0x2100, 0xa302, 0x0aa0, 0xa286, 0x0023, 0x0950,
1021 0x681c, 0xa084, 0xfff1, 0x681e, 0x7e58, 0xa684, 0xfff1, 0xc0a5,
1022 0x2030, 0x7e5a, 0x6008, 0xc0a5, 0x600a, 0x78a0, 0x8001, 0x0904,
1023 0x2e10, 0x20a8, 0x7998, 0x789b, 0x0060, 0x78aa, 0x2011, 0x0080,
1024 0x799a, 0x78a8, 0x7998, 0x7a9a, 0x78aa, 0x7a98, 0x1f04, 0x2e68,
1025 0xc695, 0x7e5a, 0xd6d4, 0x1118, 0x781b, 0x006e, 0x0005, 0x781b,
1026 0x0082, 0x0005, 0x8318, 0x2100, 0xa302, 0x0a04, 0x2e21, 0xa284,
1027 0x0080, 0x1904, 0x3a36, 0x78a0, 0xa005, 0x08c8, 0x0804, 0x3a36,
1028 0x0804, 0x3a0b, 0x7054, 0xa04d, 0x789b, 0x0018, 0x78a8, 0xa084,
1029 0x00ff, 0xa08e, 0x0001, 0x0110, 0x080c, 0x254c, 0x7aa8, 0xa294,
1030 0x00ff, 0x784b, 0x0008, 0x78a8, 0xa084, 0x00ff, 0xa08a, 0x0005,
1031 0x1a04, 0x3a0b, 0x0002, 0x3a0b, 0x380c, 0x3a0b, 0x3927, 0x3d31,
1032 0xa282, 0x0000, 0x1110, 0x080c, 0x254c, 0x080c, 0x3a3c, 0x781b,
1033 0x0082, 0x0005, 0xa282, 0x0003, 0x1110, 0x080c, 0x254c, 0xd4fc,
1034 0x11d0, 0x7060, 0xa005, 0x0110, 0x080c, 0x254c, 0x6f14, 0x7772,
1035 0xa7bc, 0x8f00, 0x080c, 0x3b6f, 0x6008, 0xa085, 0x0021, 0x600a,
1036 0x8738, 0xa784, 0x001f, 0x1db0, 0x080c, 0x3a3f, 0x7063, 0x0002,
1037 0x701f, 0x0009, 0x0010, 0x080c, 0x3a4b, 0x781b, 0x0082, 0x0005,
1038 0xa282, 0x0004, 0x0310, 0x080c, 0x254c, 0x2300, 0x0002, 0x2ee2,
1039 0x3078, 0x30b4, 0xa286, 0x0003, 0x0598, 0x7200, 0x7cd8, 0x7ddc,
1040 0x7fd0, 0x71d0, 0xd1b4, 0x0528, 0xd1bc, 0x1518, 0x2001, 0x4601,
1041 0x2004, 0xd0c4, 0x11f0, 0x7868, 0xa084, 0x00ff, 0x11d0, 0xa282,
1042 0x0002, 0x12b8, 0x00d6, 0x783b, 0x8300, 0x781b, 0x0059, 0x70b8,
1043 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2,
1044 0x78da, 0xc1b4, 0x71d2, 0x7003, 0x0030, 0x00de, 0x2001, 0x0000,
1045 0x0058, 0x783b, 0x1300, 0x781b, 0x0057, 0x2001, 0x0000, 0x0020,
1046 0x7200, 0x7cd8, 0x7ddc, 0x7fd0, 0x7046, 0x68a0, 0xd0ec, 0x0118,
1047 0x6008, 0xc08d, 0x600a, 0xa284, 0x000f, 0x0002, 0x3059, 0x2f33,
1048 0x2f30, 0x3184, 0x320f, 0x25a0, 0x2f2e, 0x2f2e, 0x080c, 0x254c,
1049 0x6008, 0xc0d4, 0x600a, 0xd6e4, 0x0120, 0x7044, 0xa086, 0x0014,
1050 0x11e8, 0x080c, 0x3f26, 0x2009, 0x0000, 0x6818, 0xd0fc, 0x0108,
1051 0x7044, 0xa086, 0x0014, 0x0168, 0x6818, 0xa086, 0x0008, 0x1904,
1052 0x301b, 0x7858, 0xd09c, 0x0904, 0x301b, 0x6820, 0xd0ac, 0x0904,
1053 0x301b, 0x681b, 0x0014, 0x2009, 0x0002, 0x04a8, 0x7868, 0xa08c,
1054 0x00ff, 0x0588, 0xa186, 0x0008, 0x1158, 0x6008, 0xc0a4, 0x600a,
1055 0x080c, 0x374f, 0x0540, 0x080c, 0x37be, 0x080c, 0x3f26, 0x0060,
1056 0xa186, 0x0028, 0x1500, 0x6018, 0xa005, 0x0d78, 0x8001, 0x0d68,
1057 0x8001, 0x0d58, 0x601e, 0x0c48, 0x6820, 0xd084, 0x0904, 0x25a0,
1058 0xc084, 0x6822, 0x080c, 0x2693, 0x7058, 0x00c6, 0x2060, 0x6800,
1059 0x6002, 0x00ce, 0x6004, 0x6802, 0xa005, 0x2d00, 0x1108, 0x6002,
1060 0x6006, 0x0804, 0x25a0, 0x0016, 0x81ff, 0x15f0, 0x7000, 0xa086,
1061 0x0030, 0x05d0, 0x71d0, 0xd1bc, 0x15b8, 0xd1b4, 0x11e8, 0x705c,
1062 0xa005, 0x1590, 0x70a0, 0xa086, 0x0001, 0x0570, 0x7003, 0x0000,
1063 0x0046, 0x0056, 0x0076, 0x0066, 0x00c6, 0x00d6, 0x080c, 0x25c5,
1064 0x00de, 0x00ce, 0x006e, 0x007e, 0x005e, 0x004e, 0x71d0, 0xd1b4,
1065 0x11d8, 0x7003, 0x0040, 0x00c0, 0x080c, 0x3c33, 0x11a8, 0x781b,
1066 0x0068, 0x00d6, 0x70b8, 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6,
1067 0x78de, 0x6898, 0x78d2, 0x78da, 0xc1b4, 0x71d2, 0x7003, 0x0030,
1068 0x7808, 0xc08d, 0x780a, 0x00de, 0x080c, 0x30dc, 0x001e, 0x81ff,
1069 0x0904, 0x301b, 0xa684, 0xdf00, 0x681e, 0x682b, 0x0000, 0x6f14,
1070 0xa186, 0x0002, 0x1904, 0x301c, 0x6818, 0xa086, 0x0014, 0x1130,
1071 0x2008, 0xd6e4, 0x0118, 0x7868, 0xa08c, 0x00ff, 0x080c, 0x3a55,
1072 0x080c, 0x269e, 0x6820, 0xd0dc, 0x1578, 0x8717, 0xa294, 0x000f,
1073 0x8213, 0x8213, 0x8213, 0xb284, 0x0600, 0x0118, 0xa290, 0x4ac0,
1074 0x0010, 0xa290, 0x4b40, 0xa290, 0x0000, 0x221c, 0xd3c4, 0x0170,
1075 0x6820, 0xd0e4, 0x0128, 0xa084, 0xefff, 0x6822, 0xc3ac, 0x2312,
1076 0x8210, 0x2204, 0xa085, 0x0038, 0x2012, 0x8211, 0xd3d4, 0x0138,
1077 0x68a0, 0xd0c4, 0x1120, 0x080c, 0x3144, 0x0804, 0x25a0, 0x6008,
1078 0xc08d, 0x600a, 0x0008, 0x692a, 0x6916, 0x6818, 0xd0fc, 0x0110,
1079 0x7044, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x6410, 0x84ff, 0x0168,
1080 0x2009, 0x4602, 0x2104, 0x8001, 0x200a, 0x8421, 0x6412, 0x1128,
1081 0x2021, 0x4604, 0x2404, 0xc0a5, 0x2022, 0x6018, 0xa005, 0x0118,
1082 0x8001, 0x601a, 0x1118, 0x6008, 0xc0a4, 0x600a, 0x6820, 0xd084,
1083 0x1130, 0x6800, 0xa005, 0x1108, 0x6002, 0x6006, 0x0020, 0x7058,
1084 0x2060, 0x6800, 0x6002, 0x2061, 0x4600, 0x6887, 0x0103, 0x2d08,
1085 0x206b, 0x0000, 0x6068, 0xa005, 0x616a, 0x0110, 0x2d02, 0x0008,
1086 0x616e, 0x7200, 0xa286, 0x0030, 0x0158, 0xa286, 0x0040, 0x1904,
1087 0x25a0, 0x7003, 0x0002, 0x7048, 0x2068, 0x68c4, 0x2060, 0x0005,
1088 0x7003, 0x0002, 0x70b8, 0xa06d, 0x68bc, 0x703e, 0x70b4, 0xa065,
1089 0x68c0, 0x7056, 0x2d00, 0x704a, 0xad80, 0x0009, 0x7042, 0x0005,
1090 0xa282, 0x0004, 0x0210, 0x080c, 0x254c, 0x2200, 0x0002, 0x3083,
1091 0x3092, 0x309e, 0x3092, 0xa586, 0x1300, 0x0160, 0xa586, 0x8300,
1092 0x1d90, 0x7003, 0x0000, 0x6018, 0x8001, 0x601a, 0x6008, 0xa084,
1093 0xfbef, 0x600a, 0x7000, 0xa086, 0x0005, 0x0128, 0x080c, 0x3a3c,
1094 0x781b, 0x0082, 0x0005, 0x781b, 0x0083, 0x0005, 0x7890, 0x8007,
1095 0x8001, 0xa084, 0x0007, 0xa080, 0x0018, 0x789a, 0x79a8, 0xa18c,
1096 0x00ff, 0xa186, 0x0003, 0x0128, 0xa186, 0x0000, 0x0110, 0x0804,
1097 0x3a0b, 0x781b, 0x0083, 0x0005, 0x6820, 0xc095, 0x6822, 0x82ff,
1098 0x1118, 0x080c, 0x3a3c, 0x0030, 0x8211, 0x0110, 0x080c, 0x254c,
1099 0x080c, 0x3a4b, 0x781b, 0x0082, 0x0005, 0x080c, 0x3c46, 0x7830,
1100 0xa084, 0x00c0, 0x1170, 0x0016, 0x3208, 0xa18c, 0x0800, 0x001e,
1101 0x0118, 0x0104, 0x30d9, 0x0010, 0x0304, 0x30d9, 0x791a, 0xa006,
1102 0x0005, 0xa085, 0x0001, 0x0005, 0xa684, 0x0060, 0x1130, 0x682f,
1103 0x0000, 0x6833, 0x0000, 0x0804, 0x3143, 0xd6dc, 0x1198, 0x68b4,
1104 0xd0dc, 0x1180, 0x6998, 0x6a94, 0x692e, 0x6a32, 0x7044, 0xa005,
1105 0x1130, 0x2200, 0xa105, 0x0904, 0x3f26, 0x7047, 0x0015, 0x0804,
1106 0x3f26, 0x0005, 0xd6ac, 0x01f0, 0xd6f4, 0x0130, 0x682f, 0x0000,
1107 0x6833, 0x0000, 0x0804, 0x3f26, 0x68b4, 0xa084, 0x4000, 0xa635,
1108 0xd6f4, 0x1da0, 0x7044, 0xa005, 0x1110, 0x7047, 0x0015, 0xd6dc,
1109 0x1128, 0x68b4, 0xd0dc, 0x0110, 0x6ca8, 0x6da4, 0x6c2e, 0x6d32,
1110 0x0804, 0x3f26, 0xd6f4, 0x0130, 0x682f, 0x0000, 0x6833, 0x0000,
1111 0x0804, 0x3f26, 0x68b4, 0xa084, 0x4800, 0xa635, 0xd6f4, 0x1da0,
1112 0x7044, 0xa005, 0x1110, 0x7047, 0x0015, 0x2408, 0x2510, 0x2700,
1113 0x8007, 0xa084, 0x007f, 0xa108, 0xa291, 0x0000, 0x692e, 0x6a32,
1114 0x2100, 0xa205, 0x1110, 0x0804, 0x3f26, 0x7000, 0xa086, 0x0006,
1115 0x0110, 0x0804, 0x3f26, 0x0005, 0x6946, 0x6008, 0xc0cd, 0xd3cc,
1116 0x0108, 0xc08d, 0x600a, 0x6818, 0x683a, 0x681b, 0x0006, 0x688f,
1117 0x0000, 0x6893, 0x0000, 0x6a30, 0x692c, 0x6a3e, 0x6942, 0x682f,
1118 0x0003, 0x6833, 0x0000, 0x6837, 0x0020, 0x6897, 0x0000, 0x689b,
1119 0x0020, 0x7000, 0x0002, 0x25a0, 0x3173, 0x316d, 0x316b, 0x316b,
1120 0x316b, 0x316b, 0x316b, 0x080c, 0x254c, 0x6820, 0xd084, 0x1118,
1121 0x080c, 0x37a4, 0x0030, 0x7058, 0x2c50, 0x2060, 0x6800, 0x6002,
1122 0x2a60, 0xaea0, 0x0017, 0x2404, 0xa005, 0x0110, 0x2020, 0x0cd8,
1123 0x2d22, 0x206b, 0x0000, 0x0005, 0x080c, 0x37aa, 0x080c, 0x37be,
1124 0x6008, 0xc0cc, 0x600a, 0x682b, 0x0000, 0x789b, 0x000e, 0x6f14,
1125 0x6938, 0x691a, 0x6944, 0x6916, 0x2009, 0x0000, 0xae86, 0x4640,
1126 0x0110, 0x2009, 0x0001, 0x080c, 0x42ec, 0xd6dc, 0x01c8, 0x691c,
1127 0xc1ed, 0x691e, 0x6828, 0xa082, 0x000e, 0x0290, 0x6848, 0xa084,
1128 0x000f, 0xa086, 0x000b, 0x1160, 0x685c, 0xa086, 0x0047, 0x1140,
1129 0x2001, 0x4601, 0x2004, 0xd0ac, 0x1118, 0x2700, 0x080c, 0x2475,
1130 0x6818, 0xd0fc, 0x0140, 0x681b, 0x0000, 0x7868, 0xa08c, 0x00ff,
1131 0x0110, 0x681b, 0x001e, 0xaea0, 0x0017, 0x6800, 0x2022, 0x6a3c,
1132 0x6940, 0x6a32, 0x692e, 0x68c0, 0x2060, 0x6000, 0xd0a4, 0x0580,
1133 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x00d6, 0x00f6,
1134 0x0156, 0x0146, 0x2079, 0x4600, 0x080c, 0x1b93, 0x014e, 0x015e,
1135 0x00fe, 0x70c8, 0x2010, 0x2009, 0x0101, 0x0026, 0x2204, 0xa06d,
1136 0x0140, 0x6814, 0xa706, 0x0110, 0x6800, 0x0cc8, 0x6820, 0xc0d5,
1137 0x6822, 0x002e, 0x8210, 0x8109, 0x1d80, 0x00de, 0x7063, 0x0003,
1138 0x707b, 0x0000, 0x7772, 0x707f, 0x000f, 0x71d0, 0xc1c4, 0x71d2,
1139 0x6818, 0xa086, 0x0002, 0x1138, 0x6817, 0x0000, 0x682b, 0x0000,
1140 0x681c, 0xc0ec, 0x681e, 0x080c, 0x1da2, 0x0804, 0x25a0, 0x7cd8,
1141 0x7ddc, 0x7fd0, 0x080c, 0x30dc, 0x682b, 0x0000, 0x789b, 0x000e,
1142 0x6f14, 0x080c, 0x3c4a, 0xa08c, 0x00ff, 0x6916, 0x6818, 0xd0fc,
1143 0x0110, 0x7044, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x7063, 0x0000,
1144 0x0804, 0x25a0, 0x7000, 0xa005, 0x1110, 0x0804, 0x25a0, 0xa006,
1145 0x080c, 0x3f26, 0x6920, 0xd1ac, 0x1110, 0x681b, 0x0014, 0xa68c,
1146 0xdf00, 0x691e, 0x682b, 0x0000, 0x6820, 0xa084, 0x00ff, 0x6822,
1147 0x7000, 0x0002, 0x25a0, 0x324c, 0x324c, 0x324f, 0x324f, 0x324f,
1148 0x324a, 0x324a, 0x080c, 0x254c, 0x6818, 0x0804, 0x2f18, 0x6008,
1149 0xc0a4, 0x600a, 0x6817, 0x0000, 0x0804, 0x3772, 0x2300, 0x0002,
1150 0x325b, 0x325d, 0x32ab, 0x080c, 0x254c, 0xd6fc, 0x1904, 0x2d38,
1151 0x7000, 0xa00d, 0x0002, 0x25a0, 0x326d, 0x326d, 0x3297, 0x326d,
1152 0x32a8, 0x326b, 0x326b, 0x080c, 0x254c, 0xa684, 0x0060, 0x0538,
1153 0xa086, 0x0060, 0x1510, 0xc6ac, 0xc6f4, 0xc6ed, 0x7e5a, 0x6eb6,
1154 0x681c, 0xc0ac, 0x681e, 0xa186, 0x0002, 0x0148, 0x080c, 0x3f26,
1155 0x69ac, 0x68b0, 0xa115, 0x0118, 0x080c, 0x4206, 0x0010, 0x080c,
1156 0x41d9, 0x781b, 0x0083, 0x71d0, 0xd1b4, 0x1904, 0x259d, 0x70a0,
1157 0xa086, 0x0001, 0x1904, 0x25e1, 0x0005, 0xd6ec, 0x09f0, 0x6818,
1158 0xd0fc, 0x0170, 0xd6f4, 0x1130, 0x681b, 0x0015, 0x781b, 0x0083,
1159 0x0804, 0x259d, 0x681b, 0x0007, 0x682f, 0x0000, 0x6833, 0x0000,
1160 0x080c, 0x3bf1, 0x0005, 0x080c, 0x254c, 0x2300, 0x0002, 0x32b4,
1161 0x32d6, 0x332e, 0x080c, 0x254c, 0x7000, 0x0002, 0x32be, 0x32c0,
1162 0x32c7, 0x32be, 0x32be, 0x32be, 0x32be, 0x32be, 0x080c, 0x254c,
1163 0x69ac, 0x68b0, 0xa115, 0x0118, 0x080c, 0x4206, 0x0010, 0x080c,
1164 0x41d9, 0x681c, 0xc0b4, 0x681e, 0x70d0, 0xd0b4, 0x1904, 0x259d,
1165 0x70a0, 0xa086, 0x0001, 0x1904, 0x25e1, 0x0005, 0xd6fc, 0x1904,
1166 0x331e, 0x7000, 0xa00d, 0x0002, 0x25a0, 0x32ec, 0x32e6, 0x3316,
1167 0x32ec, 0x331b, 0x32e4, 0x32e4, 0x080c, 0x254c, 0x6894, 0x78d6,
1168 0x78de, 0x6898, 0x78d2, 0x78da, 0xa684, 0x0060, 0x0538, 0xa086,
1169 0x0060, 0x1510, 0xa6b4, 0xbfbf, 0xc6ed, 0x7e5a, 0x6eb6, 0xa186,
1170 0x0002, 0x0148, 0x080c, 0x3f26, 0x69ac, 0x68b0, 0xa115, 0x0118,
1171 0x080c, 0x4206, 0x0010, 0x080c, 0x41d9, 0x781b, 0x0083, 0x681c,
1172 0xc0b4, 0x681e, 0x71d0, 0xd1b4, 0x1904, 0x259d, 0x70a0, 0xa086,
1173 0x0001, 0x1904, 0x25e1, 0x0005, 0xd6ec, 0x09f0, 0x6818, 0xd0fc,
1174 0x0110, 0x681b, 0x0007, 0x781b, 0x00fb, 0x0005, 0xc6fc, 0x7e5a,
1175 0x7adc, 0x79d8, 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200,
1176 0xa303, 0x68ae, 0x79d2, 0x781b, 0x0083, 0x0005, 0xd6dc, 0x0130,
1177 0x782b, 0x3009, 0x781b, 0x0083, 0x0804, 0x259d, 0x7884, 0xc0ac,
1178 0x7886, 0x78e4, 0xa084, 0x0008, 0x1150, 0xa484, 0x0200, 0x0108,
1179 0xc6f5, 0xc6dd, 0x7e5a, 0x781b, 0x0083, 0x0804, 0x259d, 0x6820,
1180 0xc095, 0x6822, 0x080c, 0x3bdc, 0xc6dd, 0x080c, 0x3a3c, 0x781b,
1181 0x0082, 0x0804, 0x259d, 0x2300, 0x0002, 0x3358, 0x335a, 0x335c,
1182 0x080c, 0x254c, 0x0804, 0x3a36, 0x7d98, 0xd6d4, 0x15a8, 0x79e4,
1183 0xd1ac, 0x0130, 0x78ec, 0xa084, 0x0003, 0x0110, 0x782b, 0x3009,
1184 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, 0x7d9a,
1185 0x79e4, 0xd1ac, 0x0120, 0x78ec, 0xa084, 0x0003, 0x1120, 0x2001,
1186 0x0014, 0x0804, 0x2f18, 0x7884, 0xd0fc, 0x1118, 0xa184, 0x0007,
1187 0x0090, 0xa184, 0x0007, 0xa086, 0x0004, 0x1118, 0x2001, 0x0000, 1211 0x0090, 0xa184, 0x0007, 0xa086, 0x0004, 0x1118, 0x2001, 0x0000,
1188 0x0050, 0xa184, 0x0007, 0xa086, 0x0005, 0x0118, 0xa184, 0x0007, 1212 0x0050, 0xa184, 0x0007, 0xa086, 0x0005, 0x0118, 0xa184, 0x0007,
1189 0x0010, 0x2001, 0x0001, 0x04c2, 0x7a90, 0xa294, 0x0007, 0x789b, 1213 0x0010, 0x2001, 0x0001, 0x0002, 0x3c0b, 0x3c0b, 0x345c, 0x3c0b,
1190 0x0060, 0x79a8, 0x81ff, 0x0568, 0x789b, 0x0080, 0x7ba8, 0xa384, 1214 0x3c4f, 0x3c4f, 0x3c0b, 0x3c0b, 0xd6bc, 0x0570, 0x7180, 0x81ff,
1191 0x0001, 0x11d0, 0x7ba8, 0x7ba8, 0xa386, 0x0004, 0x1118, 0x2009, 1215 0x0558, 0xa182, 0x000d, 0x1318, 0x7083, 0x0000, 0x0028, 0xa182,
1192 0xffdf, 0x0058, 0xa386, 0x0001, 0x1118, 0x2009, 0xfff7, 0x0028, 1216 0x000c, 0x7082, 0x2009, 0x000c, 0x789b, 0x0061, 0x79aa, 0x0156,
1193 0xa386, 0x0003, 0x1148, 0x2009, 0xffef, 0x00c6, 0x7054, 0x2060, 1217 0x0136, 0x0146, 0x7084, 0x8114, 0xa210, 0x7286, 0xa080, 0x000b,
1194 0x6004, 0xa104, 0x6006, 0x00ce, 0x789b, 0x0060, 0x78ab, 0x0000, 1218 0xad00, 0x2098, 0xb284, 0x0600, 0x0118, 0x20a1, 0x022b, 0x0010,
1195 0xa684, 0xfffb, 0x785a, 0x782b, 0x3009, 0x6920, 0xa18c, 0xecff, 1219 0x20a1, 0x012b, 0x789b, 0x0000, 0x8108, 0x81ac, 0x53a6, 0x014e,
1196 0x6922, 0x7d9a, 0x0804, 0x3be5, 0x2bae, 0x2bb7, 0x33d6, 0x33dc, 1220 0x013e, 0x015e, 0x0804, 0x3c11, 0xd6d4, 0x1904, 0x34cf, 0x6820,
1197 0x33d4, 0x33d4, 0x3be5, 0x3be5, 0x080c, 0x254c, 0x6920, 0xa18c, 1221 0xd084, 0x0904, 0x3c11, 0xa68c, 0x0060, 0xa684, 0x0060, 0x0120,
1198 0xfcff, 0x6922, 0x0804, 0x3beb, 0x6920, 0xa18c, 0xfcff, 0x6922, 1222 0xa086, 0x0060, 0x1108, 0xc1f5, 0xc194, 0x795a, 0x69b6, 0x789b,
1199 0x0804, 0x3be5, 0x79e4, 0xa184, 0x0030, 0x0120, 0x78ec, 0xa084, 1223 0x0060, 0x78ab, 0x0000, 0x789b, 0x0061, 0x6818, 0xc0fd, 0x681a,
1200 0x0003, 0x1570, 0x7000, 0xa086, 0x0004, 0x1190, 0x7060, 0xa086, 1224 0x78aa, 0x8008, 0x810c, 0x0904, 0x37f6, 0xa18c, 0x00f8, 0x1904,
1201 0x0002, 0x1130, 0x2011, 0x0002, 0x2019, 0x0000, 0x0804, 0x2a56, 1225 0x37f6, 0x0156, 0x0136, 0x0146, 0x0016, 0x20a1, 0x012b, 0x3208,
1202 0x7060, 0xa086, 0x0006, 0x0db0, 0x7060, 0xa086, 0x0004, 0x0d90, 1226 0xa18c, 0x0600, 0x0110, 0x20a1, 0x022b, 0x001e, 0x789b, 0x0000,
1203 0x7000, 0xa086, 0x0000, 0x0904, 0x259d, 0x6920, 0xa184, 0x0420, 1227 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x014e, 0x013e,
1204 0x0128, 0xc1d4, 0x6922, 0x6818, 0x0804, 0x2f18, 0x6818, 0xa08e, 1228 0x015e, 0x6814, 0xc0fc, 0x8007, 0x7882, 0x0804, 0x3c11, 0x6818,
1205 0x0002, 0x0120, 0xc0fd, 0x681a, 0x2001, 0x0014, 0x0804, 0x2f18, 1229 0xd0fc, 0x0110, 0x681b, 0x0008, 0x080c, 0x3a61, 0x781b, 0x00ed,
1206 0x7884, 0xd0fc, 0x1118, 0xa184, 0x0007, 0x0090, 0xa184, 0x0007, 1230 0x0005, 0x2300, 0x0002, 0x34e0, 0x359d, 0x34de, 0x080c, 0x2575,
1207 0xa086, 0x0004, 0x1118, 0x2001, 0x0000, 0x0050, 0xa184, 0x0007, 1231 0x7cd8, 0x7ddc, 0x7fd0, 0x82ff, 0x1528, 0x7200, 0xa286, 0x0003,
1208 0xa086, 0x0005, 0x0118, 0xa184, 0x0007, 0x0010, 0x2001, 0x0001, 1232 0x0904, 0x2f09, 0x71d0, 0xd1bc, 0x11f8, 0xd1b4, 0x01e8, 0x2001,
1209 0x0002, 0x3be5, 0x3be5, 0x3439, 0x3be5, 0x3c29, 0x3c29, 0x3be5, 1233 0x4701, 0x2004, 0xd0c4, 0x11c0, 0x00d6, 0x783b, 0x8800, 0x781b,
1210 0x3be5, 0xd6bc, 0x0570, 0x7180, 0x81ff, 0x0558, 0xa182, 0x000d, 1234 0x0059, 0x70b8, 0xa06d, 0x68b4, 0xc0a5, 0x785a, 0x6894, 0x78d6,
1211 0x1318, 0x7083, 0x0000, 0x0028, 0xa182, 0x000c, 0x7082, 0x2009, 1235 0x78de, 0x6898, 0x78d2, 0x78da, 0xc1b4, 0x71d2, 0x7003, 0x0030,
1212 0x000c, 0x789b, 0x0061, 0x79aa, 0x0156, 0x0136, 0x0146, 0x7084, 1236 0x00de, 0x0030, 0x7200, 0x0020, 0x783b, 0x1800, 0x781b, 0x0057,
1213 0x8114, 0xa210, 0x7286, 0xa080, 0x000b, 0xad00, 0x2098, 0xb284, 1237 0xa284, 0x000f, 0x0002, 0x3588, 0x3545, 0x351d, 0x2f38, 0x351b,
1214 0x0600, 0x0118, 0x20a1, 0x022b, 0x0010, 0x20a1, 0x012b, 0x789b, 1238 0x3588, 0x351b, 0x351b, 0x080c, 0x2575, 0x681c, 0xd0ec, 0x0118,
1215 0x0000, 0x8108, 0x81ac, 0x53a6, 0x014e, 0x013e, 0x015e, 0x0804, 1239 0x6008, 0xc08d, 0x600a, 0x6920, 0xc185, 0x6922, 0x6800, 0x6006,
1216 0x3beb, 0xd6d4, 0x1904, 0x34ac, 0x6820, 0xd084, 0x0904, 0x3beb, 1240 0xa005, 0x1108, 0x6002, 0x6008, 0xc0d4, 0x600a, 0x681c, 0xa084,
1217 0xa68c, 0x0060, 0xa684, 0x0060, 0x0120, 0xa086, 0x0060, 0x1108, 1241 0x000e, 0x1120, 0x71c8, 0xa188, 0x0100, 0x0028, 0x7030, 0x68ba,
1218 0xc1f5, 0xc194, 0x795a, 0x69b6, 0x789b, 0x0060, 0x78ab, 0x0000, 1242 0x713c, 0x70c8, 0xa108, 0x2104, 0x6802, 0x2d0a, 0x715a, 0xd6dc,
1219 0x789b, 0x0061, 0x6818, 0xc0fd, 0x681a, 0x78aa, 0x8008, 0x810c, 1243 0x1120, 0xc6fc, 0x6eb6, 0x0804, 0x3588, 0x6eb6, 0xa684, 0x0060,
1220 0x0904, 0x37d3, 0xa18c, 0x00f8, 0x1904, 0x37d3, 0x0156, 0x0136, 1244 0x1120, 0xa684, 0x7fff, 0x68b6, 0x04d8, 0xd6dc, 0x1150, 0xa684,
1221 0x0146, 0x0016, 0x20a1, 0x012b, 0x3208, 0xa18c, 0x0600, 0x0110, 1245 0x7fff, 0x68b6, 0x6894, 0x68a6, 0x6898, 0x68aa, 0x080c, 0x3f4e,
1222 0x20a1, 0x022b, 0x001e, 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, 1246 0x0478, 0xd6ac, 0x0140, 0xa006, 0x080c, 0x3f4e, 0x2408, 0x2510,
1223 0x000b, 0x2098, 0x53a6, 0x014e, 0x013e, 0x015e, 0x6814, 0xc0fc, 1247 0x69aa, 0x6aa6, 0x0068, 0x2408, 0x2510, 0x2700, 0x8007, 0xa084,
1224 0x8007, 0x7882, 0x0804, 0x3beb, 0x6818, 0xd0fc, 0x0110, 0x681b, 1248 0x007f, 0xa108, 0xa291, 0x0000, 0x69aa, 0x6aa6, 0x080c, 0x3f4e,
1225 0x0008, 0x080c, 0x3a3c, 0x781b, 0x00ed, 0x0005, 0x2300, 0x0002, 1249 0xd6fc, 0x01b0, 0xa684, 0x7fff, 0x68b6, 0x2510, 0x2408, 0xd6ac,
1226 0x34bd, 0x357a, 0x34bb, 0x080c, 0x254c, 0x7cd8, 0x7ddc, 0x7fd0, 1250 0x1138, 0x2700, 0x8007, 0xa084, 0x007f, 0xa108, 0xa291, 0x0000,
1227 0x82ff, 0x1528, 0x7200, 0xa286, 0x0003, 0x0904, 0x2ee6, 0x71d0, 1251 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae,
1228 0xd1bc, 0x11f8, 0xd1b4, 0x01e8, 0x2001, 0x4601, 0x2004, 0xd0c4, 1252 0x7000, 0xa086, 0x0030, 0x1904, 0x25c9, 0x7003, 0x0002, 0x70b8,
1229 0x11c0, 0x00d6, 0x783b, 0x8800, 0x781b, 0x0059, 0x70b8, 0xa06d, 1253 0xa06d, 0x68bc, 0x703e, 0x70b4, 0xa065, 0x68c0, 0x7056, 0x2d00,
1230 0x68b4, 0xc0a5, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 1254 0x704a, 0xad80, 0x0009, 0x7042, 0x0005, 0xa586, 0x8800, 0x1148,
1231 0x78da, 0xc1b4, 0x71d2, 0x7003, 0x0030, 0x00de, 0x0030, 0x7200, 1255 0x7003, 0x0000, 0x6018, 0x8001, 0x601a, 0x6008, 0xa084, 0xfbef,
1232 0x0020, 0x783b, 0x1800, 0x781b, 0x0057, 0xa284, 0x000f, 0x0002, 1256 0x600a, 0x0804, 0x3a5b, 0x7043, 0x0000, 0xa282, 0x0006, 0x0310,
1233 0x3565, 0x3522, 0x34fa, 0x2f15, 0x34f8, 0x3565, 0x34f8, 0x34f8, 1257 0x080c, 0x2575, 0x2300, 0x0002, 0x35b7, 0x35c8, 0x35d2, 0x2200,
1234 0x080c, 0x254c, 0x681c, 0xd0ec, 0x0118, 0x6008, 0xc08d, 0x600a, 1258 0x0002, 0x35bf, 0x3a5b, 0x35c1, 0x35bf, 0x3603, 0x3651, 0x080c,
1235 0x6920, 0xc185, 0x6922, 0x6800, 0x6006, 0xa005, 0x1108, 0x6002, 1259 0x2575, 0x7a80, 0xa294, 0x0f00, 0x080c, 0x36a5, 0x0804, 0x3a30,
1236 0x6008, 0xc0d4, 0x600a, 0x681c, 0xa084, 0x000e, 0x1120, 0x71c8, 1260 0x00c1, 0x0002, 0x3a5b, 0x35d0, 0x35d0, 0x3603, 0x35d0, 0x3a5b,
1237 0xa188, 0x0100, 0x0028, 0x7030, 0x68ba, 0x713c, 0x70c8, 0xa108, 1261 0x080c, 0x2575, 0x0071, 0x0002, 0x35dc, 0x35da, 0x35da, 0x35dc,
1238 0x2104, 0x6802, 0x2d0a, 0x715a, 0xd6dc, 0x1120, 0xc6fc, 0x6eb6, 1262 0x35da, 0x35dc, 0x080c, 0x2575, 0x080c, 0x3a70, 0x781b, 0x0082,
1239 0x0804, 0x3565, 0x6eb6, 0xa684, 0x0060, 0x1120, 0xa684, 0x7fff, 1263 0x0005, 0x7000, 0xa086, 0x0002, 0x1150, 0x080c, 0x37e1, 0x0010,
1240 0x68b6, 0x04d8, 0xd6dc, 0x1150, 0xa684, 0x7fff, 0x68b6, 0x6894, 1264 0x080c, 0x3f4e, 0x6008, 0xa084, 0xfbef, 0x600a, 0x0020, 0x7000,
1241 0x68a6, 0x6898, 0x68aa, 0x080c, 0x3f26, 0x0478, 0xd6ac, 0x0140, 1265 0xa086, 0x0003, 0x0da8, 0x7003, 0x0005, 0x2001, 0x8ee0, 0xae8e,
1242 0xa006, 0x080c, 0x3f26, 0x2408, 0x2510, 0x69aa, 0x6aa6, 0x0068, 1266 0x4740, 0x0110, 0x2001, 0x8f12, 0x2068, 0x704a, 0xad80, 0x0009,
1243 0x2408, 0x2510, 0x2700, 0x8007, 0xa084, 0x007f, 0xa108, 0xa291, 1267 0x7042, 0x2200, 0x0005, 0x7000, 0xa086, 0x0002, 0x1158, 0x70d0,
1244 0x0000, 0x69aa, 0x6aa6, 0x080c, 0x3f26, 0xd6fc, 0x01b0, 0xa684, 1268 0xc0b5, 0x70d2, 0x2c00, 0x70b6, 0x2d00, 0x70ba, 0x0038, 0x080c,
1245 0x7fff, 0x68b6, 0x2510, 0x2408, 0xd6ac, 0x1138, 0x2700, 0x8007, 1269 0x3f4e, 0x0020, 0x7000, 0xa086, 0x0003, 0x0dc8, 0x7003, 0x0001,
1246 0xa084, 0x007f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302, 1270 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, 0x001f,
1247 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x7000, 0xa086, 0x0030, 1271 0xa215, 0x2069, 0x8dc0, 0xb284, 0x0600, 0x1118, 0xc2fd, 0x2069,
1248 0x1904, 0x25a0, 0x7003, 0x0002, 0x70b8, 0xa06d, 0x68bc, 0x703e, 1272 0x8ed0, 0x2d04, 0x2d08, 0x715a, 0xa06d, 0x0128, 0x6814, 0xa206,
1249 0x70b4, 0xa065, 0x68c0, 0x7056, 0x2d00, 0x704a, 0xad80, 0x0009, 1273 0x0120, 0x6800, 0x0cb8, 0x080c, 0x36a5, 0x6eb4, 0x7e5a, 0x6920,
1250 0x7042, 0x0005, 0xa586, 0x8800, 0x1148, 0x7003, 0x0000, 0x6018, 1274 0xa184, 0x0c00, 0x0904, 0x36cb, 0x7060, 0xa086, 0x0006, 0x1128,
1251 0x8001, 0x601a, 0x6008, 0xa084, 0xfbef, 0x600a, 0x0804, 0x3a36, 1275 0x7070, 0xa206, 0x1110, 0x7062, 0x707a, 0x681b, 0x0005, 0xc1ad,
1252 0x7043, 0x0000, 0xa282, 0x0006, 0x0310, 0x080c, 0x254c, 0x2300, 1276 0x681b, 0x0005, 0xc1ad, 0xc1d4, 0x6922, 0x080c, 0x3a67, 0x0804,
1253 0x0002, 0x3594, 0x35a5, 0x35af, 0x2200, 0x0002, 0x359c, 0x3a36, 1277 0x36cb, 0x7200, 0xa286, 0x0002, 0x1158, 0x70d0, 0xc0b5, 0x70d2,
1254 0x359e, 0x359c, 0x35e0, 0x362e, 0x080c, 0x254c, 0x7a80, 0xa294, 1278 0x2c00, 0x70b6, 0x2d00, 0x70ba, 0x0030, 0x080c, 0x3f4e, 0x0018,
1255 0x0f00, 0x080c, 0x3682, 0x0804, 0x3a0b, 0x00c1, 0x0002, 0x3a36, 1279 0xa286, 0x0003, 0x0dd0, 0x7003, 0x0001, 0x7a80, 0xa294, 0x0f00,
1256 0x35ad, 0x35ad, 0x35e0, 0x35ad, 0x3a36, 0x080c, 0x254c, 0x0071, 1280 0x789b, 0x0018, 0x7ca8, 0xa484, 0x001f, 0xa215, 0xae86, 0x4740,
1257 0x0002, 0x35b9, 0x35b7, 0x35b7, 0x35b9, 0x35b7, 0x35b9, 0x080c, 1281 0x0108, 0xc2fd, 0x79a8, 0x79a8, 0xa18c, 0x00ff, 0x2118, 0x70c8,
1258 0x254c, 0x080c, 0x3a4b, 0x781b, 0x0082, 0x0005, 0x7000, 0xa086, 1282 0xa168, 0x2d04, 0x2d08, 0x715a, 0xa06d, 0x0128, 0x6814, 0xa206,
1259 0x0002, 0x1150, 0x080c, 0x37be, 0x0010, 0x080c, 0x3f26, 0x6008, 1283 0x0118, 0x6800, 0x0cb8, 0x0409, 0x6eb4, 0x6920, 0xa184, 0x0c00,
1260 0xa084, 0xfbef, 0x600a, 0x0020, 0x7000, 0xa086, 0x0003, 0x0da8, 1284 0x0904, 0x36cb, 0xd0dc, 0x0178, 0x7060, 0xa086, 0x0004, 0x1140,
1261 0x7003, 0x0005, 0x2001, 0x8de0, 0xae8e, 0x4640, 0x0110, 0x2001, 1285 0x7070, 0xa206, 0x1128, 0x7074, 0xa306, 0x1110, 0x7062, 0x707a,
1262 0x8e12, 0x2068, 0x704a, 0xad80, 0x0009, 0x7042, 0x2200, 0x0005, 1286 0x080c, 0x3a6d, 0x0480, 0x681b, 0x0005, 0xc1ad, 0xc1d4, 0x6922,
1263 0x7000, 0xa086, 0x0002, 0x1158, 0x70d0, 0xc0b5, 0x70d2, 0x2c00, 1287 0x080c, 0x3a67, 0x707b, 0x0000, 0x0430, 0x7003, 0x0005, 0xb284,
1264 0x70b6, 0x2d00, 0x70ba, 0x0038, 0x080c, 0x3f26, 0x0020, 0x7000, 1288 0x0600, 0x0118, 0x2001, 0x8ee0, 0x0010, 0x2001, 0x8f12, 0x2068,
1265 0xa086, 0x0003, 0x0dc8, 0x7003, 0x0001, 0x7a80, 0xa294, 0x0f00, 1289 0x704a, 0x0156, 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, 0x1f04,
1266 0x789b, 0x0018, 0x7ca8, 0xa484, 0x001f, 0xa215, 0x2069, 0x8cc0, 1290 0x36b4, 0x015e, 0xb284, 0x0600, 0x0110, 0xc2fc, 0x0008, 0xc2fd,
1267 0xb284, 0x0600, 0x1118, 0xc2fd, 0x2069, 0x8dd0, 0x2d04, 0x2d08, 1291 0x6a16, 0xad80, 0x0009, 0x7042, 0x68b7, 0x0700, 0x6823, 0x0800,
1268 0x715a, 0xa06d, 0x0128, 0x6814, 0xa206, 0x0120, 0x6800, 0x0cb8, 1292 0x6827, 0x0003, 0x0005, 0xc6ec, 0xa6ac, 0x0060, 0x0904, 0x3712,
1269 0x080c, 0x3682, 0x6eb4, 0x7e5a, 0x6920, 0xa184, 0x0c00, 0x0904, 1293 0x6b98, 0x6c94, 0x69ac, 0x68b0, 0xa105, 0x11e0, 0x7bd2, 0x7bda,
1270 0x36a8, 0x7060, 0xa086, 0x0006, 0x1128, 0x7070, 0xa206, 0x1110, 1294 0x7cd6, 0x7cde, 0xa586, 0x0060, 0x05c8, 0xd6f4, 0x1108, 0xc6ed,
1271 0x7062, 0x707a, 0x681b, 0x0005, 0xc1ad, 0x681b, 0x0005, 0xc1ad, 1295 0xa6b4, 0xb7ff, 0x7e5a, 0x2009, 0x0083, 0xd69c, 0x0128, 0x2009,
1272 0xc1d4, 0x6922, 0x080c, 0x3a42, 0x0804, 0x36a8, 0x7200, 0xa286, 1296 0x0082, 0x2019, 0x0000, 0x2320, 0x791a, 0xd6ec, 0x0588, 0x080c,
1273 0x0002, 0x1158, 0x70d0, 0xc0b5, 0x70d2, 0x2c00, 0x70b6, 0x2d00, 1297 0x4208, 0x0470, 0x68b0, 0xa31a, 0x2100, 0xa423, 0x2400, 0xa305,
1274 0x70ba, 0x0030, 0x080c, 0x3f26, 0x0018, 0xa286, 0x0003, 0x0dd0, 1298 0x01f8, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0x68b0, 0xd6f4, 0x1108,
1275 0x7003, 0x0001, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 1299 0xc6ed, 0xc6f4, 0x7e5a, 0x2011, 0x0083, 0xd69c, 0x0128, 0x2011,
1276 0xa484, 0x001f, 0xa215, 0xae86, 0x4640, 0x0108, 0xc2fd, 0x79a8, 1300 0x0082, 0x2019, 0x0000, 0x2320, 0x7a1a, 0xd6ec, 0x0188, 0x080c,
1277 0x79a8, 0xa18c, 0x00ff, 0x2118, 0x70c8, 0xa168, 0x2d04, 0x2d08, 1301 0x4235, 0x0070, 0x2019, 0x0000, 0x2320, 0x0010, 0xa6b4, 0xb7ff,
1278 0x715a, 0xa06d, 0x0128, 0x6814, 0xa206, 0x0118, 0x6800, 0x0cb8, 1302 0x7e5a, 0x2009, 0x0083, 0xd69c, 0x0110, 0x2009, 0x0082, 0x791a,
1279 0x0409, 0x6eb4, 0x6920, 0xa184, 0x0c00, 0x0904, 0x36a8, 0xd0dc, 1303 0x68c0, 0x7056, 0x2d00, 0x704a, 0x68c4, 0x2060, 0x71d0, 0x2001,
1280 0x0178, 0x7060, 0xa086, 0x0004, 0x1140, 0x7070, 0xa206, 0x1128, 1304 0x4701, 0x2004, 0xd0c4, 0x15c8, 0x70d4, 0xa02d, 0x01b8, 0xd1bc,
1281 0x7074, 0xa306, 0x1110, 0x7062, 0x707a, 0x080c, 0x3a48, 0x0480, 1305 0x0548, 0x7a80, 0xa294, 0x0f00, 0x70d8, 0xa206, 0x0118, 0x78e0,
1282 0x681b, 0x0005, 0xc1ad, 0xc1d4, 0x6922, 0x080c, 0x3a42, 0x707b, 1306 0xa504, 0x1558, 0x70d6, 0xc1bc, 0x71d2, 0x0438, 0x2031, 0x0001,
1283 0x0000, 0x0430, 0x7003, 0x0005, 0xb284, 0x0600, 0x0118, 0x2001, 1307 0x852c, 0x0218, 0x8633, 0x8210, 0x0cd8, 0x0005, 0x7de0, 0xa594,
1284 0x8de0, 0x0010, 0x2001, 0x8e12, 0x2068, 0x704a, 0x0156, 0x20a9, 1308 0xff00, 0x0130, 0x2011, 0x0008, 0x852f, 0x0c81, 0x8637, 0x0008,
1285 0x0032, 0x2003, 0x0000, 0x8000, 0x1f04, 0x3691, 0x015e, 0xb284, 1309 0x0c69, 0x8217, 0x7880, 0xa084, 0x0f00, 0xa206, 0x0170, 0x72da,
1286 0x0600, 0x0110, 0xc2fc, 0x0008, 0xc2fd, 0x6a16, 0xad80, 0x0009, 1310 0x76d6, 0x0058, 0x7a80, 0xa294, 0x0f00, 0x70d8, 0xa236, 0x0dc0,
1287 0x7042, 0x68b7, 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, 0x0005, 1311 0x78e0, 0xa534, 0x0da8, 0xc1bd, 0x71d2, 0xd1b4, 0x1904, 0x25c6,
1288 0xc6ec, 0xa6ac, 0x0060, 0x0904, 0x36ef, 0x6b98, 0x6c94, 0x69ac, 1312 0x2300, 0xa405, 0x0904, 0x25c6, 0x70a0, 0xa086, 0x0001, 0x1904,
1289 0x68b0, 0xa105, 0x11e0, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0xa586, 1313 0x260d, 0x0005, 0x6020, 0xa005, 0x0150, 0x8001, 0x6022, 0x6008,
1290 0x0060, 0x05c8, 0xd6f4, 0x1108, 0xc6ed, 0xa6b4, 0xb7ff, 0x7e5a, 1314 0xa085, 0x0008, 0x600a, 0x700f, 0x0100, 0x702c, 0x6026, 0x0005,
1291 0x2009, 0x0083, 0xd69c, 0x0128, 0x2009, 0x0082, 0x2019, 0x0000, 1315 0xa006, 0x080c, 0x3f4e, 0x7000, 0xa086, 0x0002, 0x0120, 0x7060,
1292 0x2320, 0x791a, 0xd6ec, 0x0588, 0x080c, 0x41d9, 0x0470, 0x68b0, 1316 0xa086, 0x0005, 0x1150, 0x682b, 0x0000, 0x6817, 0x0000, 0x681b,
1293 0xa31a, 0x2100, 0xa423, 0x2400, 0xa305, 0x01f8, 0x7bd2, 0x7bda, 1317 0x0001, 0x6823, 0x0040, 0x681f, 0x0100, 0x7000, 0xa084, 0x000f,
1294 0x7cd6, 0x7cde, 0x68b0, 0xd6f4, 0x1108, 0xc6ed, 0xc6f4, 0x7e5a, 1318 0x0002, 0x25c9, 0x37a6, 0x37a3, 0x37c3, 0x37af, 0x25c9, 0x37a1,
1295 0x2011, 0x0083, 0xd69c, 0x0128, 0x2011, 0x0082, 0x2019, 0x0000, 1319 0x37a1, 0x080c, 0x2575, 0x0449, 0x0411, 0x0028, 0x0431, 0x7058,
1296 0x2320, 0x7a1a, 0xd6ec, 0x0188, 0x080c, 0x4206, 0x0070, 0x2019, 1320 0x2060, 0x6800, 0x6002, 0x080c, 0x1dbf, 0x0804, 0x25c9, 0x7060,
1297 0x0000, 0x2320, 0x0010, 0xa6b4, 0xb7ff, 0x7e5a, 0x2009, 0x0083, 1321 0x7063, 0x0000, 0x707f, 0x0000, 0x0002, 0x37bf, 0x37bf, 0x37bd,
1298 0xd69c, 0x0110, 0x2009, 0x0082, 0x791a, 0x68c0, 0x7056, 0x2d00, 1322 0x37bd, 0x37bd, 0x37bf, 0x37bd, 0x37bf, 0x0804, 0x2a9a, 0x7063,
1299 0x704a, 0x68c4, 0x2060, 0x71d0, 0x2001, 0x4601, 0x2004, 0xd0c4, 1323 0x0000, 0x0804, 0x25c9, 0x681b, 0x0000, 0x0804, 0x31a7, 0x6800,
1300 0x15c8, 0x70d4, 0xa02d, 0x01b8, 0xd1bc, 0x0548, 0x7a80, 0xa294, 1324 0xa005, 0x1108, 0x6002, 0x6006, 0x0005, 0x6410, 0x84ff, 0x0168,
1301 0x0f00, 0x70d8, 0xa206, 0x0118, 0x78e0, 0xa504, 0x1558, 0x70d6, 1325 0x2009, 0x4702, 0x2104, 0x8001, 0x200a, 0x8421, 0x6412, 0x1128,
1302 0xc1bc, 0x71d2, 0x0438, 0x2031, 0x0001, 0x852c, 0x0218, 0x8633, 1326 0x2021, 0x4704, 0x2404, 0xc0a5, 0x2022, 0x6008, 0xc0a4, 0x600a,
1303 0x8210, 0x0cd8, 0x0005, 0x7de0, 0xa594, 0xff00, 0x0130, 0x2011, 1327 0x0005, 0x6018, 0xa005, 0x0110, 0x8001, 0x601a, 0x0005, 0x080c,
1304 0x0008, 0x852f, 0x0c81, 0x8637, 0x0008, 0x0c69, 0x8217, 0x7880, 1328 0x3c6e, 0x681b, 0x0018, 0x0490, 0x080c, 0x3c6e, 0x681b, 0x0019,
1305 0xa084, 0x0f00, 0xa206, 0x0170, 0x72da, 0x76d6, 0x0058, 0x7a80, 1329 0x0468, 0x080c, 0x3c6e, 0x681b, 0x001a, 0x0440, 0x080c, 0x3c6e,
1306 0xa294, 0x0f00, 0x70d8, 0xa236, 0x0dc0, 0x78e0, 0xa534, 0x0da8, 1330 0x681b, 0x0003, 0x0418, 0x7770, 0x080c, 0x3b95, 0x7174, 0xa18c,
1307 0xc1bd, 0x71d2, 0xd1b4, 0x1904, 0x259d, 0x2300, 0xa405, 0x0904, 1331 0x00ff, 0x3210, 0xa294, 0x0600, 0x0118, 0xa1e8, 0x8cc0, 0x0010,
1308 0x259d, 0x70a0, 0xa086, 0x0001, 0x1904, 0x25e1, 0x0005, 0x6020, 1332 0xa1e8, 0x8dd0, 0x2d04, 0x2d08, 0x2068, 0xa005, 0x1118, 0x707a,
1309 0xa005, 0x0150, 0x8001, 0x6022, 0x6008, 0xa085, 0x0008, 0x600a, 1333 0x0804, 0x25c9, 0x6814, 0x7270, 0xa206, 0x0110, 0x6800, 0x0c98,
1310 0x700f, 0x0100, 0x702c, 0x6026, 0x0005, 0xa006, 0x080c, 0x3f26, 1334 0x6800, 0x200a, 0x681b, 0x0005, 0x707b, 0x0000, 0x080c, 0x37cd,
1311 0x7000, 0xa086, 0x0002, 0x0120, 0x7060, 0xa086, 0x0005, 0x1150, 1335 0x6820, 0xd084, 0x1110, 0x080c, 0x37c7, 0x080c, 0x37e1, 0x681f,
1312 0x682b, 0x0000, 0x6817, 0x0000, 0x681b, 0x0001, 0x6823, 0x0040, 1336 0x0000, 0x6823, 0x0020, 0x080c, 0x1dbf, 0x0804, 0x25c9, 0xa282,
1313 0x681f, 0x0100, 0x7000, 0xa084, 0x000f, 0x0002, 0x25a0, 0x3783, 1337 0x0003, 0x1904, 0x3a35, 0x7da8, 0xa5ac, 0x00ff, 0x7ea8, 0xa6b4,
1314 0x3780, 0x37a0, 0x378c, 0x25a0, 0x377e, 0x377e, 0x080c, 0x254c, 1338 0x00ff, 0x6920, 0xc1bd, 0x6922, 0xd1c4, 0x05b0, 0xc1c4, 0x6922,
1315 0x0449, 0x0411, 0x0028, 0x0431, 0x7058, 0x2060, 0x6800, 0x6002, 1339 0xa6b4, 0x00ff, 0x0530, 0xa682, 0x0018, 0x0218, 0x0110, 0x2031,
1316 0x080c, 0x1da2, 0x0804, 0x25a0, 0x7060, 0x7063, 0x0000, 0x707f, 1340 0x0018, 0xa686, 0x0010, 0x1108, 0x8630, 0x852b, 0x852b, 0x2041,
1317 0x0000, 0x0002, 0x379c, 0x379c, 0x379a, 0x379a, 0x379a, 0x379c, 1341 0x0000, 0x080c, 0x3aee, 0x0118, 0x080c, 0x391a, 0x00a0, 0x080c,
1318 0x379a, 0x379c, 0x0804, 0x2a6b, 0x7063, 0x0000, 0x0804, 0x25a0, 1342 0x3aba, 0x080c, 0x3917, 0x6920, 0xc1c5, 0x6922, 0x7e58, 0xc695,
1319 0x681b, 0x0000, 0x0804, 0x3184, 0x6800, 0xa005, 0x1108, 0x6002, 1343 0x7e5a, 0xd6d4, 0x1118, 0x781b, 0x006e, 0x0005, 0x781b, 0x0082,
1320 0x6006, 0x0005, 0x6410, 0x84ff, 0x0168, 0x2009, 0x4602, 0x2104, 1344 0x0005, 0x080c, 0x3917, 0x7e58, 0xd6d4, 0x1118, 0x781b, 0x0071,
1321 0x8001, 0x200a, 0x8421, 0x6412, 0x1128, 0x2021, 0x4604, 0x2404, 1345 0x0005, 0x781b, 0x0083, 0x0005, 0x00c6, 0x7054, 0x2060, 0x6100,
1322 0xc0a5, 0x2022, 0x6008, 0xc0a4, 0x600a, 0x0005, 0x6018, 0xa005, 1346 0xd1e4, 0x0598, 0x6208, 0x8217, 0xa294, 0x00ff, 0xa282, 0x0018,
1323 0x0110, 0x8001, 0x601a, 0x0005, 0x080c, 0x3c46, 0x681b, 0x0018, 1347 0x0218, 0x0110, 0x2011, 0x0018, 0x2600, 0xa202, 0x1208, 0x2230,
1324 0x0490, 0x080c, 0x3c46, 0x681b, 0x0019, 0x0468, 0x080c, 0x3c46, 1348 0xa686, 0x0010, 0x1108, 0x8630, 0x6208, 0xa294, 0x00ff, 0x78ec,
1325 0x681b, 0x001a, 0x0440, 0x080c, 0x3c46, 0x681b, 0x0003, 0x0418, 1349 0xd0e4, 0x0130, 0xa282, 0x000a, 0x1240, 0x2011, 0x000a, 0x0028,
1326 0x7770, 0x080c, 0x3b6f, 0x7174, 0xa18c, 0x00ff, 0x3210, 0xa294, 1350 0xa282, 0x000c, 0x1210, 0x2011, 0x000c, 0x2200, 0xa502, 0x1208,
1327 0x0600, 0x0118, 0xa1e8, 0x8bc0, 0x0010, 0xa1e8, 0x8cd0, 0x2d04, 1351 0x2228, 0x080c, 0x3abe, 0x852b, 0x852b, 0x2041, 0x0000, 0x080c,
1328 0x2d08, 0x2068, 0xa005, 0x1118, 0x707a, 0x0804, 0x25a0, 0x6814, 1352 0x3aee, 0x0118, 0x080c, 0x391a, 0x0020, 0x080c, 0x3aba, 0x080c,
1329 0x7270, 0xa206, 0x0110, 0x6800, 0x0c98, 0x6800, 0x200a, 0x681b, 1353 0x3917, 0x7858, 0xc095, 0x785a, 0x00ce, 0x781b, 0x0082, 0x0005,
1330 0x0005, 0x707b, 0x0000, 0x080c, 0x37aa, 0x6820, 0xd084, 0x1110, 1354 0x00c6, 0x2960, 0x6000, 0xd0e4, 0x1188, 0xd0b4, 0x1150, 0x6010,
1331 0x080c, 0x37a4, 0x080c, 0x37be, 0x681f, 0x0000, 0x6823, 0x0020, 1355 0xa084, 0x000f, 0x1130, 0x6104, 0xa18c, 0xfff5, 0x6106, 0x00ce,
1332 0x080c, 0x1da2, 0x0804, 0x25a0, 0xa282, 0x0003, 0x1904, 0x3a10, 1356 0x0005, 0x2011, 0x0032, 0x2019, 0x0000, 0x00f0, 0x68a0, 0xd0cc,
1333 0x7da8, 0xa5ac, 0x00ff, 0x7ea8, 0xa6b4, 0x00ff, 0x6920, 0xc1bd, 1357 0x1dc0, 0x6208, 0xa294, 0x00ff, 0x78ec, 0xd0e4, 0x0130, 0xa282,
1334 0x6922, 0xd1c4, 0x05b0, 0xc1c4, 0x6922, 0xa6b4, 0x00ff, 0x0530, 1358 0x000b, 0x1218, 0x2011, 0x000a, 0x0028, 0xa282, 0x000c, 0x1210,
1335 0xa682, 0x0018, 0x0218, 0x0110, 0x2031, 0x0018, 0xa686, 0x0010, 1359 0x2011, 0x000c, 0x6308, 0x831f, 0xa39c, 0x00ff, 0xa382, 0x0018,
1336 0x1108, 0x8630, 0x852b, 0x852b, 0x2041, 0x0000, 0x080c, 0x3ac9, 1360 0x0218, 0x0110, 0x2019, 0x0018, 0x78ab, 0x0001, 0x78ab, 0x0003,
1337 0x0118, 0x080c, 0x38f7, 0x00a0, 0x080c, 0x3a95, 0x080c, 0x38f4, 1361 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005, 0x6820, 0xc0c5,
1338 0x6920, 0xc1c5, 0x6922, 0x7e58, 0xc695, 0x7e5a, 0xd6d4, 0x1118, 1362 0x6822, 0x080c, 0x3a7a, 0x00ce, 0x0005, 0x00c6, 0x2960, 0x6104,
1339 0x781b, 0x006e, 0x0005, 0x781b, 0x0082, 0x0005, 0x080c, 0x38f4, 1363 0xa18c, 0xfff5, 0x6106, 0x2011, 0x0032, 0x2019, 0x0000, 0x0000,
1364 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa,
1365 0xa8c0, 0x0005, 0x6820, 0xc0c5, 0x6822, 0x00ce, 0x0005, 0xa006,
1366 0x2030, 0x2010, 0x00c6, 0x7154, 0x2160, 0x2018, 0x2008, 0xa084,
1367 0xffe0, 0xa635, 0x7e86, 0x6018, 0x789a, 0x7eae, 0x6612, 0x78a4,
1368 0xa084, 0x7770, 0xa18c, 0x000f, 0xa105, 0x2029, 0x4705, 0x252c,
1369 0xd5cc, 0x0140, 0xd3a4, 0x0110, 0xa085, 0x0800, 0xd3fc, 0x0110,
1370 0xa085, 0x8080, 0x78a6, 0x6016, 0x788a, 0xa6b4, 0x001f, 0x8637,
1371 0x8204, 0x8004, 0xa605, 0x600e, 0x6004, 0xa084, 0xffd5, 0x6006,
1372 0x00ce, 0x0005, 0xa282, 0x0002, 0x1904, 0x3a3f, 0x7aa8, 0x6920,
1373 0xc1bd, 0x6922, 0xd1cc, 0x0568, 0xc1cc, 0x6922, 0xa294, 0x00ff,
1374 0xa282, 0x0002, 0x1a04, 0x3a30, 0x080c, 0x39c1, 0x080c, 0x3917,
1375 0xa980, 0x0001, 0x200c, 0x080c, 0x3b91, 0x080c, 0x38b8, 0x88ff,
1376 0x0178, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, 0xc695, 0x7e5a,
1377 0xd6d4, 0x1118, 0x781b, 0x006e, 0x0005, 0x781b, 0x0082, 0x0005,
1340 0x7e58, 0xd6d4, 0x1118, 0x781b, 0x0071, 0x0005, 0x781b, 0x0083, 1378 0x7e58, 0xd6d4, 0x1118, 0x781b, 0x0071, 0x0005, 0x781b, 0x0083,
1341 0x0005, 0x00c6, 0x7054, 0x2060, 0x6100, 0xd1e4, 0x0598, 0x6208, 1379 0x0005, 0xa282, 0x0002, 0x1218, 0xa284, 0x0001, 0x0140, 0x7154,
1342 0x8217, 0xa294, 0x00ff, 0xa282, 0x0018, 0x0218, 0x0110, 0x2011, 1380 0xa188, 0x0000, 0x210c, 0xd1ec, 0x1110, 0x2011, 0x0000, 0x080c,
1343 0x0018, 0x2600, 0xa202, 0x1208, 0x2230, 0xa686, 0x0010, 0x1108, 1381 0x3aac, 0x0479, 0x080c, 0x3917, 0x7858, 0xc095, 0x785a, 0x781b,
1344 0x8630, 0x6208, 0xa294, 0x00ff, 0x78ec, 0xd0e4, 0x0130, 0xa282, 1382 0x0082, 0x0005, 0x00c6, 0x0026, 0x2960, 0x6000, 0x2011, 0x0001,
1345 0x000a, 0x1240, 0x2011, 0x000a, 0x0028, 0xa282, 0x000c, 0x1210, 1383 0xd0ec, 0x1158, 0xd0bc, 0x1138, 0x6014, 0xd0b4, 0x1120, 0xc1a4,
1346 0x2011, 0x000c, 0x2200, 0xa502, 0x1208, 0x2228, 0x080c, 0x3a99, 1384 0x6106, 0xa006, 0x0088, 0x2011, 0x0000, 0x78ab, 0x0001, 0x78ab,
1347 0x852b, 0x852b, 0x2041, 0x0000, 0x080c, 0x3ac9, 0x0118, 0x080c, 1385 0x0002, 0x78ab, 0x0003, 0x7aaa, 0xa8c0, 0x0004, 0x080c, 0x3a7a,
1348 0x38f7, 0x0020, 0x080c, 0x3a95, 0x080c, 0x38f4, 0x7858, 0xc095, 1386 0x6820, 0xa085, 0x0200, 0x6822, 0x002e, 0x00ce, 0x0005, 0x8807,
1349 0x785a, 0x00ce, 0x781b, 0x0082, 0x0005, 0x00c6, 0x2960, 0x6000, 1387 0xa715, 0x00c6, 0x2009, 0x0000, 0x7054, 0x2060, 0x82ff, 0x0110,
1350 0xd0e4, 0x1188, 0xd0b4, 0x1150, 0x6010, 0xa084, 0x000f, 0x1130, 1388 0x2009, 0x0040, 0x6018, 0xa080, 0x0002, 0x789a, 0x78a4, 0xa084,
1351 0x6104, 0xa18c, 0xfff5, 0x6106, 0x00ce, 0x0005, 0x2011, 0x0032, 1389 0xff9f, 0xa105, 0xc0ec, 0xd0b4, 0x1108, 0xc0ed, 0x6100, 0xd1f4,
1352 0x2019, 0x0000, 0x00f0, 0x68a0, 0xd0cc, 0x1dc0, 0x6208, 0xa294, 1390 0x0110, 0xa085, 0x0020, 0x78a6, 0x6016, 0x788a, 0x6004, 0xa084,
1353 0x00ff, 0x78ec, 0xd0e4, 0x0130, 0xa282, 0x000b, 0x1218, 0x2011, 1391 0xffef, 0x6006, 0x00ce, 0x0005, 0x0006, 0x7000, 0xa086, 0x0003,
1354 0x000a, 0x0028, 0xa282, 0x000c, 0x1210, 0x2011, 0x000c, 0x6308, 1392 0x0110, 0x000e, 0x0010, 0x000e, 0x0498, 0xd6ac, 0x0588, 0x7888,
1355 0x831f, 0xa39c, 0x00ff, 0xa382, 0x0018, 0x0218, 0x0110, 0x2019, 1393 0xa084, 0x0040, 0x0568, 0x7bb8, 0x8307, 0xa084, 0x007f, 0x1518,
1356 0x0018, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 1394 0x8207, 0xa084, 0x00ff, 0x0904, 0x3a57, 0xa09a, 0x0004, 0x1a04,
1357 0x7baa, 0xa8c0, 0x0005, 0x6820, 0xc0c5, 0x6822, 0x080c, 0x3a55, 1395 0x3a57, 0xd6f4, 0x11d0, 0x79d8, 0x7adc, 0xa108, 0xa291, 0x0000,
1358 0x00ce, 0x0005, 0x00c6, 0x2960, 0x6104, 0xa18c, 0xfff5, 0x6106, 1396 0x79d2, 0x79da, 0x7ad6, 0x7ade, 0x080c, 0x42e8, 0x781b, 0x0080,
1359 0x2011, 0x0032, 0x2019, 0x0000, 0x0000, 0x78ab, 0x0001, 0x78ab, 1397 0xb284, 0x0600, 0x0118, 0x2001, 0x0000, 0x0010, 0x2001, 0x0001,
1360 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005, 0x6820, 1398 0x080c, 0x419a, 0x0005, 0x080c, 0x2575, 0x781b, 0x0080, 0x0005,
1361 0xc0c5, 0x6822, 0x00ce, 0x0005, 0xa006, 0x2030, 0x2010, 0x00c6, 1399 0x781b, 0x0083, 0x0005, 0x2039, 0x0000, 0x2041, 0x0000, 0x2031,
1362 0x7154, 0x2160, 0x2018, 0x2008, 0xa084, 0xffe0, 0xa635, 0x7e86, 1400 0x0000, 0xa006, 0x2010, 0x080c, 0x391a, 0x080c, 0x39bf, 0x7e58,
1363 0x6018, 0x789a, 0x7eae, 0x6612, 0x78a4, 0xa084, 0x7770, 0xa18c, 1401 0x080c, 0x3a73, 0x781b, 0x0082, 0x0005, 0x0cd1, 0x6820, 0xc0c4,
1364 0x000f, 0xa105, 0x2029, 0x4605, 0x252c, 0xd5cc, 0x0140, 0xd3a4, 1402 0x6822, 0x00c6, 0x7054, 0x2060, 0x080c, 0x3944, 0x00b0, 0x0c81,
1365 0x0110, 0xa085, 0x0800, 0xd3fc, 0x0110, 0xa085, 0x8080, 0x78a6, 1403 0x6820, 0xc0cc, 0x6822, 0x00c6, 0x7054, 0x2060, 0x080c, 0x39de,
1366 0x6016, 0x788a, 0xa6b4, 0x001f, 0x8637, 0x8204, 0x8004, 0xa605, 1404 0x0060, 0x0c31, 0x6820, 0xa084, 0xecff, 0x6822, 0x00c6, 0x7054,
1367 0x600e, 0x6004, 0xa084, 0xffd5, 0x6006, 0x00ce, 0x0005, 0xa282, 1405 0x2060, 0x6004, 0xa084, 0xffc5, 0x6006, 0x00ce, 0x0005, 0x0049,
1368 0x0002, 0x1904, 0x3a1a, 0x7aa8, 0x6920, 0xc1bd, 0x6922, 0xd1cc, 1406 0x781b, 0x0082, 0x0005, 0x6827, 0x0002, 0x0049, 0x781b, 0x0082,
1369 0x0568, 0xc1cc, 0x6922, 0xa294, 0x00ff, 0xa282, 0x0002, 0x1a04, 1407 0x0005, 0x2001, 0x0005, 0x0088, 0x2001, 0x000c, 0x0070, 0x6820,
1370 0x3a0b, 0x080c, 0x399e, 0x080c, 0x38f4, 0xa980, 0x0001, 0x200c, 1408 0xc0d5, 0x6822, 0x2001, 0x0006, 0x0040, 0x2001, 0x000d, 0x0028,
1371 0x080c, 0x3b6b, 0x080c, 0x3895, 0x88ff, 0x0178, 0x789b, 0x0060, 1409 0x2001, 0x0009, 0x0010, 0x2001, 0x0007, 0x789b, 0x007e, 0x78aa,
1372 0x2800, 0x78aa, 0x7e58, 0xc695, 0x7e5a, 0xd6d4, 0x1118, 0x781b, 1410 0xc69d, 0x7e5a, 0x70d0, 0xd0b4, 0x0168, 0xc0b4, 0x70d2, 0x00c6,
1373 0x006e, 0x0005, 0x781b, 0x0082, 0x0005, 0x7e58, 0xd6d4, 0x1118, 1411 0x70b4, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001,
1374 0x781b, 0x0071, 0x0005, 0x781b, 0x0083, 0x0005, 0xa282, 0x0002, 1412 0x601a, 0x00ce, 0x0005, 0x0076, 0x873f, 0xa7bc, 0x000f, 0x873b,
1375 0x1218, 0xa284, 0x0001, 0x0140, 0x7154, 0xa188, 0x0000, 0x210c, 1413 0x873b, 0x8703, 0xa0e0, 0x4bc0, 0xae8e, 0x4740, 0x0110, 0xa0e0,
1376 0xd1ec, 0x1110, 0x2011, 0x0000, 0x080c, 0x3a87, 0x0479, 0x080c, 1414 0x4c40, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, 0xa184, 0x7fe0, 0x78ae,
1377 0x38f4, 0x7858, 0xc095, 0x785a, 0x781b, 0x0082, 0x0005, 0x00c6, 1415 0x6012, 0x79a4, 0xa184, 0x773f, 0x78a6, 0x6016, 0x6004, 0xa085,
1378 0x0026, 0x2960, 0x6000, 0x2011, 0x0001, 0xd0ec, 0x1158, 0xd0bc, 1416 0x0038, 0x6006, 0x007e, 0x0005, 0x789b, 0x0080, 0x78ab, 0x0001,
1379 0x1138, 0x6014, 0xd0b4, 0x1120, 0xc1a4, 0x6106, 0xa006, 0x0088, 1417 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0060, 0x78ab,
1380 0x2011, 0x0000, 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003, 1418 0x0004, 0x0800, 0x2031, 0x0000, 0x2029, 0x0032, 0x789b, 0x0080,
1381 0x7aaa, 0xa8c0, 0x0004, 0x080c, 0x3a55, 0x6820, 0xa085, 0x0200, 1419 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa, 0x7eaa,
1382 0x6822, 0x002e, 0x00ce, 0x0005, 0x8807, 0xa715, 0x00c6, 0x2009, 1420 0x789b, 0x0060, 0x78ab, 0x0005, 0x0804, 0x3a7a, 0x0156, 0x8007,
1383 0x0000, 0x7054, 0x2060, 0x82ff, 0x0110, 0x2009, 0x0040, 0x6018, 1421 0xa084, 0x00ff, 0x8003, 0x8003, 0xa080, 0x0020, 0x789a, 0x79a4,
1384 0xa080, 0x0002, 0x789a, 0x78a4, 0xa084, 0xff9f, 0xa105, 0xc0ec, 1422 0xa18c, 0xffe0, 0x2021, 0x3b7a, 0x2019, 0x0011, 0x20a9, 0x000e,
1385 0xd0b4, 0x1108, 0xc0ed, 0x6100, 0xd1f4, 0x0110, 0xa085, 0x0020, 1423 0x2011, 0x0032, 0x2404, 0xa084, 0xffe0, 0xa106, 0x0128, 0x8420,
1386 0x78a6, 0x6016, 0x788a, 0x6004, 0xa084, 0xffef, 0x6006, 0x00ce, 1424 0x2300, 0xa210, 0x1f04, 0x3ae2, 0x015e, 0x0005, 0x0156, 0x0804,
1387 0x0005, 0x0006, 0x7000, 0xa086, 0x0003, 0x0110, 0x000e, 0x0010, 1425 0x3b30, 0x2021, 0x3b88, 0x20a9, 0x0009, 0x2011, 0x0029, 0xa582,
1388 0x000e, 0x0488, 0xd6ac, 0x0578, 0x7888, 0xa084, 0x0040, 0x0558, 1426 0x0028, 0x0550, 0x8420, 0x95a9, 0x2011, 0x0033, 0xa582, 0x0033,
1389 0x7bb8, 0x8307, 0xa084, 0x007f, 0x1508, 0x8207, 0xa084, 0x00ff, 1427 0x0618, 0x8420, 0x95a9, 0x2019, 0x000a, 0x2011, 0x0065, 0x2200,
1390 0xa09e, 0x0001, 0x1904, 0x3a32, 0xd6f4, 0x11d0, 0x79d8, 0x7adc, 1428 0xa502, 0x02d0, 0x8420, 0x2300, 0xa210, 0x1f04, 0x3b07, 0x015e,
1391 0xa108, 0xa291, 0x0000, 0x79d2, 0x79da, 0x7ad6, 0x7ade, 0x080c, 1429 0x0088, 0x2021, 0x3b7a, 0x2019, 0x0011, 0x20a9, 0x000e, 0x2011,
1392 0x42b5, 0x781b, 0x0080, 0xb284, 0x0600, 0x0118, 0x2001, 0x0000, 1430 0x0033, 0x2200, 0xa502, 0x0240, 0x8420, 0x2300, 0xa210, 0x1f04,
1393 0x0010, 0x2001, 0x0001, 0x080c, 0x4172, 0x0005, 0x080c, 0x254c, 1431 0x3b19, 0x015e, 0xa006, 0x0005, 0x8211, 0x015e, 0xa582, 0x0064,
1394 0x781b, 0x0080, 0x0005, 0x781b, 0x0083, 0x0005, 0x2039, 0x0000, 1432 0x1220, 0x7808, 0xa085, 0x0070, 0x780a, 0x2404, 0xa005, 0x0005,
1395 0x2041, 0x0000, 0x2031, 0x0000, 0xa006, 0x2010, 0x080c, 0x38f7, 1433 0xa886, 0x0002, 0x01e8, 0x2021, 0x3b66, 0x20a9, 0x000d, 0x2011,
1396 0x080c, 0x399c, 0x7e58, 0x080c, 0x3a4e, 0x781b, 0x0082, 0x0005, 1434 0x0028, 0xa582, 0x0028, 0x0d48, 0x8420, 0x2019, 0x0019, 0x2011,
1397 0x0cd1, 0x6820, 0xc0c4, 0x6822, 0x00c6, 0x7054, 0x2060, 0x080c, 1435 0x0033, 0x2200, 0xa502, 0x0e00, 0x8420, 0x2300, 0xa210, 0x1f04,
1398 0x3921, 0x00b0, 0x0c81, 0x6820, 0xc0cc, 0x6822, 0x00c6, 0x7054, 1436 0x3b41, 0x015e, 0x2011, 0x0184, 0xa582, 0x0185, 0x0ab0, 0x0890,
1399 0x2060, 0x080c, 0x39bb, 0x0060, 0x0c31, 0x6820, 0xa084, 0xecff, 1437 0x2021, 0x3b75, 0x20a9, 0x0003, 0x2011, 0x0024, 0xa586, 0x0024,
1400 0x6822, 0x00c6, 0x7054, 0x2060, 0x6004, 0xa084, 0xffc5, 0x6006, 1438 0x0960, 0x8420, 0x2011, 0x0028, 0xa586, 0x0028, 0x0930, 0x8420,
1401 0x00ce, 0x0005, 0x0049, 0x781b, 0x0082, 0x0005, 0x6827, 0x0002, 1439 0x2019, 0x0019, 0x2011, 0x0033, 0x0804, 0x3b19, 0x1021, 0x2202,
1402 0x0049, 0x781b, 0x0082, 0x0005, 0x2001, 0x0005, 0x0088, 0x2001, 1440 0x3403, 0x4604, 0x5805, 0x6a06, 0x7c07, 0x4610, 0x4612, 0x5812,
1403 0x000c, 0x0070, 0x6820, 0xc0d5, 0x6822, 0x2001, 0x0006, 0x0040, 1441 0x5a12, 0x6a14, 0x6c14, 0x6e14, 0x7e17, 0x9021, 0xb002, 0xe204,
1404 0x2001, 0x000d, 0x0028, 0x2001, 0x0009, 0x0010, 0x2001, 0x0007, 1442 0xe210, 0xe210, 0x1209, 0x3002, 0x3202, 0x4203, 0x4403, 0x5404,
1405 0x789b, 0x007e, 0x78aa, 0xc69d, 0x7e5a, 0x70d0, 0xd0b4, 0x0168, 1443 0x5604, 0x6605, 0x6805, 0x7806, 0x7a06, 0x0c07, 0x0c07, 0x0e07,
1406 0xc0b4, 0x70d2, 0x00c6, 0x70b4, 0xa065, 0x6008, 0xa084, 0xfbef, 1444 0x10e1, 0x330a, 0x5805, 0x5a05, 0x6a06, 0x6c06, 0x7c07, 0x7e07,
1407 0x600a, 0x6018, 0x8001, 0x601a, 0x00ce, 0x0005, 0x0076, 0x873f, 1445 0x0e00, 0x789b, 0x0080, 0xa046, 0x0005, 0xa784, 0x0f00, 0x800b,
1408 0xa7bc, 0x000f, 0x873b, 0x873b, 0x8703, 0xa0e0, 0x4ac0, 0xae8e, 1446 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xd7fc,
1409 0x4640, 0x0110, 0xa0e0, 0x4b40, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, 1447 0x0118, 0xa0e0, 0x6cc0, 0x0010, 0xa0e0, 0x4cc0, 0x0005, 0x00e6,
1410 0xa184, 0x7fe0, 0x78ae, 0x6012, 0x79a4, 0xa184, 0x773f, 0x78a6, 1448 0x00f6, 0xd084, 0x0138, 0x2079, 0x0100, 0x2009, 0x4780, 0x2071,
1411 0x6016, 0x6004, 0xa085, 0x0038, 0x6006, 0x007e, 0x0005, 0x789b, 1449 0x4780, 0x0030, 0x2009, 0x4740, 0x2079, 0x0200, 0x2071, 0x4740,
1412 0x0080, 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 1450 0x2091, 0x8000, 0x2104, 0xa084, 0x000f, 0x0002, 0x3bc8, 0x3bc8,
1413 0x789b, 0x0060, 0x78ab, 0x0004, 0x0800, 0x2031, 0x0000, 0x2029, 1451 0x3bc8, 0x3bc8, 0x3bc8, 0x3bc8, 0x3bc6, 0x3bc6, 0x080c, 0x2575,
1414 0x0032, 0x789b, 0x0080, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 1452 0x69b4, 0xc1f5, 0xa18c, 0xff9f, 0x69b6, 0xa005, 0x0580, 0x7858,
1415 0x0001, 0x7daa, 0x7eaa, 0x789b, 0x0060, 0x78ab, 0x0005, 0x0804, 1453 0xa084, 0xff9f, 0xa085, 0x6000, 0x785a, 0x7828, 0xa086, 0x1814,
1416 0x3a55, 0x0156, 0x8007, 0xa084, 0x00ff, 0x8003, 0x8003, 0xa080, 1454 0x1530, 0x784b, 0x0004, 0x7848, 0xa084, 0x0004, 0x1de0, 0x784b,
1417 0x0020, 0x789a, 0x79a4, 0xa18c, 0xffe0, 0x2021, 0x3b54, 0x2019, 1455 0x0008, 0x7848, 0xa084, 0x0008, 0x1de0, 0x7830, 0xd0bc, 0x11b8,
1418 0x0011, 0x20a9, 0x000e, 0x2011, 0x0032, 0x2404, 0xa084, 0xffe0, 1456 0xb284, 0x0800, 0x0118, 0x0104, 0x3bff, 0x0010, 0x0304, 0x3bff,
1419 0xa106, 0x0128, 0x8420, 0x2300, 0xa210, 0x1f04, 0x3abd, 0x015e, 1457 0x79e4, 0xa184, 0x0030, 0x0158, 0x78ec, 0xa084, 0x0003, 0x0138,
1420 0x0005, 0x0156, 0x04f8, 0x2021, 0x3b62, 0x20a9, 0x0009, 0x2011, 1458 0x681c, 0xd0ac, 0x1110, 0x00d9, 0x0010, 0x781b, 0x00fb, 0x00fe,
1421 0x0029, 0xa582, 0x0028, 0x0550, 0x8420, 0x95a9, 0x2011, 0x0033, 1459 0x00ee, 0x0005, 0x2001, 0x4701, 0x2004, 0xd0ac, 0x1118, 0x6814,
1422 0xa582, 0x0033, 0x0618, 0x8420, 0x95a9, 0x2019, 0x000a, 0x2011, 1460 0x080c, 0x249e, 0x0005, 0x781b, 0x0083, 0x0005, 0x781b, 0x0082,
1423 0x0065, 0x2200, 0xa502, 0x02d0, 0x8420, 0x2300, 0xa210, 0x1f04, 1461 0x0005, 0x781b, 0x0071, 0x0005, 0x781b, 0x006e, 0x0005, 0x2009,
1424 0x3ae1, 0x015e, 0x0088, 0x2021, 0x3b54, 0x2019, 0x0011, 0x20a9, 1462 0x4719, 0x210c, 0xa186, 0x0000, 0x0150, 0xa186, 0x0001, 0x0150,
1425 0x000e, 0x2011, 0x0033, 0x2200, 0xa502, 0x0240, 0x8420, 0x2300, 1463 0x701f, 0x000b, 0x7063, 0x0001, 0x781b, 0x0054, 0x0005, 0x781b,
1426 0xa210, 0x1f04, 0x3af3, 0x015e, 0xa006, 0x0005, 0x8211, 0x015e, 1464 0x00f3, 0x0005, 0x701f, 0x000a, 0x0005, 0x2009, 0x4719, 0x210c,
1427 0xa582, 0x0064, 0x1220, 0x7808, 0xa085, 0x0070, 0x780a, 0x2404, 1465 0xa186, 0x0000, 0x0168, 0xa186, 0x0001, 0x0138, 0x701f, 0x000b,
1428 0xa005, 0x0005, 0xa886, 0x0002, 0x01e8, 0x2021, 0x3b40, 0x20a9, 1466 0x7063, 0x0001, 0x781b, 0x0054, 0x0005, 0x701f, 0x000a, 0x0005,
1429 0x000d, 0x2011, 0x0028, 0xa582, 0x0028, 0x0d48, 0x8420, 0x2019, 1467 0x781b, 0x00f2, 0x0005, 0x781b, 0x00fb, 0x0005, 0x781b, 0x00fa,
1430 0x0019, 0x2011, 0x0033, 0x2200, 0xa502, 0x0e00, 0x8420, 0x2300, 1468 0x0005, 0x781b, 0x00cc, 0x0005, 0x781b, 0x00cb, 0x0005, 0x6818,
1431 0xa210, 0x1f04, 0x3b1b, 0x015e, 0x2011, 0x0184, 0xa582, 0x0185, 1469 0xd0fc, 0x0110, 0x681b, 0x001d, 0x701f, 0x000b, 0x7063, 0x0001,
1432 0x0ab0, 0x0890, 0x2021, 0x3b4f, 0x20a9, 0x0003, 0x2011, 0x0024,
1433 0xa586, 0x0024, 0x0960, 0x8420, 0x2011, 0x0028, 0xa586, 0x0028,
1434 0x0930, 0x8420, 0x2019, 0x0019, 0x2011, 0x0033, 0x0804, 0x3af3,
1435 0x1021, 0x2202, 0x3403, 0x4604, 0x5805, 0x6a06, 0x7c07, 0x4610,
1436 0x4612, 0x5812, 0x5a12, 0x6a14, 0x6c14, 0x6e14, 0x7e17, 0x9021,
1437 0xb002, 0xe204, 0xe210, 0xe210, 0x1209, 0x3002, 0x3202, 0x4203,
1438 0x4403, 0x5404, 0x5604, 0x6605, 0x6805, 0x7806, 0x7a06, 0x0c07,
1439 0x0c07, 0x0e07, 0x10e1, 0x330a, 0x5805, 0x5a05, 0x6a06, 0x6c06,
1440 0x7c07, 0x7e07, 0x0e00, 0x789b, 0x0080, 0xa046, 0x0005, 0xa784,
1441 0x0f00, 0x800b, 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, 0x8003,
1442 0xa105, 0xd7fc, 0x0118, 0xa0e0, 0x6bc0, 0x0010, 0xa0e0, 0x4bc0,
1443 0x0005, 0x00e6, 0x00f6, 0xd084, 0x0138, 0x2079, 0x0100, 0x2009,
1444 0x4680, 0x2071, 0x4680, 0x0030, 0x2009, 0x4640, 0x2079, 0x0200,
1445 0x2071, 0x4640, 0x2091, 0x8000, 0x2104, 0xa084, 0x000f, 0x0002,
1446 0x3ba2, 0x3ba2, 0x3ba2, 0x3ba2, 0x3ba2, 0x3ba2, 0x3ba0, 0x3ba0,
1447 0x080c, 0x254c, 0x69b4, 0xc1f5, 0xa18c, 0xff9f, 0x69b6, 0xa005,
1448 0x0580, 0x7858, 0xa084, 0xff9f, 0xa085, 0x6000, 0x785a, 0x7828,
1449 0xa086, 0x1814, 0x1530, 0x784b, 0x0004, 0x7848, 0xa084, 0x0004,
1450 0x1de0, 0x784b, 0x0008, 0x7848, 0xa084, 0x0008, 0x1de0, 0x7830,
1451 0xd0bc, 0x11b8, 0xb284, 0x0800, 0x0118, 0x0104, 0x3bd9, 0x0010,
1452 0x0304, 0x3bd9, 0x79e4, 0xa184, 0x0030, 0x0158, 0x78ec, 0xa084,
1453 0x0003, 0x0138, 0x681c, 0xd0ac, 0x1110, 0x00d9, 0x0010, 0x781b,
1454 0x00fb, 0x00fe, 0x00ee, 0x0005, 0x2001, 0x4601, 0x2004, 0xd0ac,
1455 0x1118, 0x6814, 0x080c, 0x2475, 0x0005, 0x781b, 0x0083, 0x0005,
1456 0x781b, 0x0082, 0x0005, 0x781b, 0x0071, 0x0005, 0x781b, 0x006e,
1457 0x0005, 0x2009, 0x4619, 0x210c, 0xa186, 0x0000, 0x0150, 0xa186,
1458 0x0001, 0x0150, 0x701f, 0x000b, 0x7063, 0x0001, 0x781b, 0x0054,
1459 0x0005, 0x781b, 0x00f3, 0x0005, 0x701f, 0x000a, 0x0005, 0x2009,
1460 0x4619, 0x210c, 0xa186, 0x0000, 0x0168, 0xa186, 0x0001, 0x0138,
1461 0x701f, 0x000b, 0x7063, 0x0001, 0x781b, 0x0054, 0x0005, 0x701f,
1462 0x000a, 0x0005, 0x781b, 0x00f2, 0x0005, 0x781b, 0x00fb, 0x0005,
1463 0x781b, 0x00fa, 0x0005, 0x781b, 0x00cc, 0x0005, 0x781b, 0x00cb,
1464 0x0005, 0x6818, 0xd0fc, 0x0110, 0x681b, 0x001d, 0x7063, 0x0001,
1465 0x781b, 0x0054, 0x0005, 0x7830, 0xa084, 0x00c0, 0x1170, 0x7808, 1470 0x781b, 0x0054, 0x0005, 0x7830, 0xa084, 0x00c0, 0x1170, 0x7808,
1466 0xc08c, 0x780a, 0xe000, 0xe000, 0xe000, 0xe000, 0x78ec, 0xa084, 1471 0xc08c, 0x780a, 0xe000, 0xe000, 0xe000, 0xe000, 0x78ec, 0xa084,
1467 0x0021, 0x0118, 0x7808, 0xc08d, 0x780a, 0x0005, 0x7808, 0xc08d, 1472 0x0021, 0x0118, 0x7808, 0xc08d, 0x780a, 0x0005, 0x7808, 0xc08d,
1468 0x780a, 0x0005, 0x7830, 0xa084, 0x0040, 0x1de0, 0xb284, 0x0800, 1473 0x780a, 0x0005, 0x7830, 0xa084, 0x0040, 0x1de0, 0xb284, 0x0800,
1469 0x0118, 0x1104, 0x3c58, 0x0010, 0x1304, 0x3c58, 0x78ac, 0x0005, 1474 0x0118, 0x1104, 0x3c80, 0x0010, 0x1304, 0x3c80, 0x78ac, 0x0005,
1470 0x7808, 0xa084, 0xfffd, 0x780a, 0xe000, 0xe000, 0xe000, 0xe000, 1475 0x7808, 0xa084, 0xfffd, 0x780a, 0xe000, 0xe000, 0xe000, 0xe000,
1471 0x78ec, 0xa084, 0x0021, 0x0140, 0xb284, 0x0800, 0x0118, 0x1104, 1476 0x78ec, 0xa084, 0x0021, 0x0140, 0xb284, 0x0800, 0x0118, 0x1104,
1472 0x3c67, 0x0010, 0x1304, 0x3c6a, 0x78ac, 0x0006, 0x7808, 0xa085, 1477 0x3c8f, 0x0010, 0x1304, 0x3c92, 0x78ac, 0x0006, 0x7808, 0xa085,
1473 0x0002, 0x780a, 0x000e, 0x0005, 0xa784, 0x0001, 0x1904, 0x322a, 1478 0x0002, 0x780a, 0x000e, 0x0005, 0xa784, 0x0001, 0x1904, 0x324d,
1474 0xa784, 0x0070, 0x0140, 0x00c6, 0x2d60, 0x2f68, 0x080c, 0x2467, 1479 0xa784, 0x0070, 0x0140, 0x00c6, 0x2d60, 0x2f68, 0x080c, 0x2490,
1475 0x2d78, 0x2c68, 0x00ce, 0xa784, 0x0008, 0x0148, 0x784b, 0x0008, 1480 0x2d78, 0x2c68, 0x00ce, 0xa784, 0x0008, 0x0148, 0x784b, 0x0008,
1476 0x78ec, 0xa084, 0x0003, 0x0904, 0x322a, 0x0804, 0x3be5, 0xa784, 1481 0x78ec, 0xa084, 0x0003, 0x0904, 0x324d, 0x0804, 0x3c0b, 0xa784,
1477 0x0004, 0x01c8, 0x78b8, 0xa084, 0x8000, 0x01a8, 0x784b, 0x0008, 1482 0x0004, 0x01c8, 0x78b8, 0xa084, 0x8000, 0x01a8, 0x784b, 0x0008,
1478 0x78ec, 0xa084, 0x0003, 0x0904, 0x322a, 0x78e4, 0xa084, 0x0007, 1483 0x78ec, 0xa084, 0x0003, 0x0904, 0x324d, 0x78e4, 0xa084, 0x0007,
1479 0xa086, 0x0001, 0x1140, 0x78c0, 0xa685, 0x4800, 0x2030, 0x7e5a, 1484 0xa086, 0x0001, 0x1140, 0x78c0, 0xa685, 0x4800, 0x2030, 0x7e5a,
1480 0x781b, 0x00fb, 0x0005, 0xa784, 0x0080, 0x0140, 0x7884, 0xd0fc, 1485 0x781b, 0x00fb, 0x0005, 0xa784, 0x0080, 0x0140, 0x7884, 0xd0fc,
1481 0x0128, 0x080c, 0x3a32, 0x681b, 0x0022, 0x0005, 0x681b, 0x0003, 1486 0x0128, 0x080c, 0x3a57, 0x681b, 0x0022, 0x0005, 0x681b, 0x0003,
1482 0x7858, 0xa084, 0x5f00, 0x681e, 0x682f, 0x0000, 0x6833, 0x0000, 1487 0x7858, 0xa084, 0x5f00, 0x681e, 0x682f, 0x0000, 0x6833, 0x0000,
1483 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0904, 0x2b89, 0xb284, 1488 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0904, 0x2bac, 0xb284,
1484 0x0800, 0x0110, 0x0104, 0x259d, 0x0304, 0x259d, 0x6b14, 0x8307, 1489 0x0800, 0x0110, 0x0104, 0x25c6, 0x0304, 0x25c6, 0x6b14, 0x8307,
1485 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xd3fc, 0x0118, 0xa080, 1490 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xd3fc, 0x0118, 0xa080,
1486 0x4b40, 0x0010, 0xa080, 0x4ac0, 0x2060, 0x2048, 0x7056, 0x2a60, 1491 0x4c40, 0x0010, 0xa080, 0x4bc0, 0x2060, 0x2048, 0x7056, 0x2a60,
1487 0x0005, 0x00c6, 0x2960, 0x6000, 0xd0ac, 0x0904, 0x3d2f, 0x68a0, 1492 0x0005, 0x00c6, 0x2960, 0x6000, 0xd0ac, 0x0904, 0x3d57, 0x68a0,
1488 0xd1ac, 0x1120, 0xa084, 0x0e00, 0x0904, 0x3d2d, 0x6108, 0x8117, 1493 0xd1ac, 0x1120, 0xa084, 0x0e00, 0x0904, 0x3d55, 0x6108, 0x8117,
1489 0xa18c, 0x00ff, 0x631c, 0x832f, 0xd0dc, 0x0110, 0xa39d, 0x0001, 1494 0xa18c, 0x00ff, 0x631c, 0x832f, 0xd0dc, 0x0110, 0xa39d, 0x0001,
1490 0xd0cc, 0x11c8, 0xa584, 0x00ff, 0x0138, 0x78ec, 0xd0e4, 0x0110, 1495 0xd0cc, 0x11c8, 0xa584, 0x00ff, 0x0138, 0x78ec, 0xd0e4, 0x0110,
1491 0x8213, 0x00b8, 0x2029, 0x0000, 0xa182, 0x000c, 0x1290, 0x78ec, 1496 0x8213, 0x00b8, 0x2029, 0x0000, 0xa182, 0x000c, 0x1290, 0x78ec,
@@ -1493,23 +1498,23 @@ static unsigned short risc_code01[] = {
1493 0x2009, 0x000a, 0x0030, 0x2009, 0x0032, 0x2011, 0x0000, 0x2029, 1498 0x2009, 0x000a, 0x0030, 0x2009, 0x0032, 0x2011, 0x0000, 0x2029,
1494 0x0000, 0x78ab, 0x0001, 0x78ab, 0x0006, 0x78ab, 0x0004, 0x79aa, 1499 0x0000, 0x78ab, 0x0001, 0x78ab, 0x0006, 0x78ab, 0x0004, 0x79aa,
1495 0x78ab, 0x0000, 0x7aaa, 0x7baa, 0x7daa, 0xa8c0, 0x0008, 0x6820, 1500 0x78ab, 0x0000, 0x7aaa, 0x7baa, 0x7daa, 0xa8c0, 0x0008, 0x6820,
1496 0xa085, 0x1000, 0x6822, 0x080c, 0x3a55, 0xa085, 0x0001, 0x00ce, 1501 0xa085, 0x1000, 0x6822, 0x080c, 0x3a7a, 0xa085, 0x0001, 0x00ce,
1497 0x0005, 0xa282, 0x0006, 0x1904, 0x3a24, 0x7da8, 0x7eac, 0x8637, 1502 0x0005, 0xa282, 0x0006, 0x1904, 0x3a49, 0x7da8, 0x7eac, 0x8637,
1498 0xa5ac, 0x00ff, 0xa6b4, 0x00ff, 0x7fac, 0x8747, 0xa7bc, 0x00ff, 1503 0xa5ac, 0x00ff, 0xa6b4, 0x00ff, 0x7fac, 0x8747, 0xa7bc, 0x00ff,
1499 0xa8c4, 0x00ff, 0x6920, 0xc1bd, 0x6922, 0xd1e4, 0x0904, 0x3da3, 1504 0xa8c4, 0x00ff, 0x6920, 0xc1bd, 0x6922, 0xd1e4, 0x0904, 0x3dcb,
1500 0xa18c, 0xecff, 0x6922, 0xa782, 0x0002, 0x1a04, 0x39fe, 0xa6b4, 1505 0xa18c, 0xecff, 0x6922, 0xa782, 0x0002, 0x1a04, 0x3a23, 0xa6b4,
1501 0x00ff, 0x0904, 0x3da0, 0xa682, 0x0031, 0x1a04, 0x39fe, 0xa582, 1506 0x00ff, 0x0904, 0x3dc8, 0xa682, 0x0031, 0x1a04, 0x3a23, 0xa582,
1502 0x0009, 0x0a04, 0x39fe, 0xa882, 0x0003, 0x1a04, 0x39fe, 0xa886, 1507 0x0009, 0x0a04, 0x3a23, 0xa882, 0x0003, 0x1a04, 0x3a23, 0xa886,
1503 0x0002, 0x01d0, 0xa886, 0x0000, 0x1904, 0x39fe, 0x2001, 0x000c, 1508 0x0002, 0x01d0, 0xa886, 0x0000, 0x1904, 0x3a23, 0x2001, 0x000c,
1504 0x79ec, 0xd1e4, 0x0110, 0x2001, 0x000a, 0xa502, 0x1290, 0x080c, 1509 0x79ec, 0xd1e4, 0x0110, 0x2001, 0x000a, 0xa502, 0x1290, 0x080c,
1505 0x39fe, 0x00c6, 0x2960, 0x6004, 0xa085, 0x001a, 0x6006, 0x6000, 1510 0x3a23, 0x00c6, 0x2960, 0x6004, 0xa085, 0x001a, 0x6006, 0x6000,
1506 0xc0ac, 0x6002, 0x00ce, 0x0005, 0xa786, 0x0000, 0x0904, 0x39fe, 1511 0xc0ac, 0x6002, 0x00ce, 0x0005, 0xa786, 0x0000, 0x0904, 0x3a23,
1507 0x8634, 0xa682, 0x0018, 0x0228, 0x0120, 0x2031, 0x0018, 0x0804, 1512 0x8634, 0xa682, 0x0018, 0x0228, 0x0120, 0x2031, 0x0018, 0x0804,
1508 0x3df1, 0xa686, 0x0010, 0x1108, 0x8630, 0x852b, 0x852b, 0x080c, 1513 0x3e19, 0xa686, 0x0010, 0x1108, 0x8630, 0x852b, 0x852b, 0x080c,
1509 0x3ac9, 0x0904, 0x39fe, 0x080c, 0x38f7, 0x080c, 0x399c, 0x7e58, 1514 0x3aee, 0x0904, 0x3a23, 0x080c, 0x391a, 0x080c, 0x39bf, 0x7e58,
1510 0xd6d4, 0x1118, 0x781b, 0x0071, 0x0005, 0x781b, 0x0083, 0x0005, 1515 0xd6d4, 0x1118, 0x781b, 0x0071, 0x0005, 0x781b, 0x0083, 0x0005,
1511 0x080c, 0x38f4, 0x0c90, 0xa886, 0x0002, 0x1108, 0x8634, 0x7154, 1516 0x080c, 0x3917, 0x0c90, 0xa886, 0x0002, 0x1108, 0x8634, 0x7154,
1512 0xa188, 0x0000, 0x210c, 0xd1ac, 0x0904, 0x39fe, 0xd1ec, 0x1120, 1517 0xa188, 0x0000, 0x210c, 0xd1ac, 0x0904, 0x3a23, 0xd1ec, 0x1120,
1513 0x2039, 0x0000, 0x2041, 0x0000, 0xd1e4, 0x1120, 0x2031, 0x0000, 1518 0x2039, 0x0000, 0x2041, 0x0000, 0xd1e4, 0x1120, 0x2031, 0x0000,
1514 0x2041, 0x0000, 0xa782, 0x0002, 0x12c8, 0x621c, 0xa284, 0x00ff, 1519 0x2041, 0x0000, 0xa782, 0x0002, 0x12c8, 0x621c, 0xa284, 0x00ff,
1515 0xa706, 0x0110, 0x2039, 0x0000, 0xa605, 0x0190, 0x6108, 0x811f, 1520 0xa706, 0x0110, 0x2039, 0x0000, 0xa605, 0x0190, 0x6108, 0x811f,
@@ -1517,11 +1522,11 @@ static unsigned short risc_code01[] = {
1517 0xa086, 0x0201, 0x0160, 0xa886, 0x0000, 0x0168, 0x2039, 0x0000, 1522 0xa086, 0x0201, 0x0160, 0xa886, 0x0000, 0x0168, 0x2039, 0x0000,
1518 0x2041, 0x0000, 0x2031, 0x0000, 0xa006, 0x2010, 0x0070, 0xa284, 1523 0x2041, 0x0000, 0x2031, 0x0000, 0xa006, 0x2010, 0x0070, 0xa284,
1519 0xff00, 0x1108, 0x2040, 0xa184, 0x00ff, 0xa502, 0x0108, 0x2128, 1524 0xff00, 0x1108, 0x2040, 0xa184, 0x00ff, 0xa502, 0x0108, 0x2128,
1520 0x852b, 0x852b, 0x080c, 0x3ac9, 0x0d58, 0x080c, 0x38f7, 0x080c, 1525 0x852b, 0x852b, 0x080c, 0x3aee, 0x0d58, 0x080c, 0x391a, 0x080c,
1521 0x399c, 0x789b, 0x0080, 0x78ab, 0x0001, 0x78ab, 0x0006, 0x78ab, 1526 0x39bf, 0x789b, 0x0080, 0x78ab, 0x0001, 0x78ab, 0x0006, 0x78ab,
1522 0x0004, 0x7daa, 0x78ab, 0x0000, 0x7eaa, 0x7faa, 0x2800, 0x78aa, 1527 0x0004, 0x7daa, 0x78ab, 0x0000, 0x7eaa, 0x7faa, 0x2800, 0x78aa,
1523 0x789b, 0x0060, 0x78ab, 0x0008, 0x6820, 0xc0e5, 0x6822, 0x080c, 1528 0x789b, 0x0060, 0x78ab, 0x0008, 0x6820, 0xc0e5, 0x6822, 0x080c,
1524 0x3a55, 0x7858, 0xc095, 0x785a, 0x781b, 0x0082, 0x0005, 0x0020, 1529 0x3a7a, 0x7858, 0xc095, 0x785a, 0x781b, 0x0082, 0x0005, 0x0020,
1525 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 1530 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
1526 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 1531 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
1527 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 1532 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
@@ -1559,223 +1564,248 @@ static unsigned short risc_code01[] = {
1559 0x20dd, 0x0011, 0x20d5, 0x8822, 0x0016, 0x0000, 0x0126, 0x70d0, 1564 0x20dd, 0x0011, 0x20d5, 0x8822, 0x0016, 0x0000, 0x0126, 0x70d0,
1560 0xa084, 0x4c00, 0x8004, 0x2090, 0x7204, 0x7008, 0xc09c, 0xa205, 1565 0xa084, 0x4c00, 0x8004, 0x2090, 0x7204, 0x7008, 0xc09c, 0xa205,
1561 0x11a0, 0x720c, 0x82ff, 0x0128, 0x8aff, 0x1178, 0x7200, 0xd284, 1566 0x11a0, 0x720c, 0x82ff, 0x0128, 0x8aff, 0x1178, 0x7200, 0xd284,
1562 0x1160, 0x7804, 0xd0cc, 0x0110, 0x080c, 0x4328, 0x7007, 0x0008, 1567 0x1160, 0x7804, 0xd0cc, 0x0110, 0x080c, 0x435b, 0x7007, 0x0008,
1563 0x7003, 0x0008, 0x012e, 0x2000, 0x0005, 0x7000, 0xa084, 0x0003, 1568 0x7003, 0x0008, 0x012e, 0x2000, 0x0005, 0x7000, 0xa084, 0x0003,
1564 0x7002, 0xc69c, 0xd084, 0x0588, 0x7108, 0xe000, 0x7008, 0xa106, 1569 0x7002, 0xc69c, 0xd084, 0x0588, 0x7108, 0xe000, 0x7008, 0xa106,
1565 0x1dd8, 0xa184, 0x0003, 0x0904, 0x3fa2, 0xa184, 0x01e0, 0x1904, 1570 0x1dd8, 0xa184, 0x0003, 0x0904, 0x3fca, 0xa184, 0x01e0, 0x1904,
1566 0x3fa2, 0xd1f4, 0x1d88, 0xa184, 0x3000, 0xa086, 0x1000, 0x0d60, 1571 0x3fca, 0xd1f4, 0x1d88, 0xa184, 0x3000, 0xa086, 0x1000, 0x0d60,
1567 0x2011, 0x0180, 0x710c, 0x8211, 0x0130, 0x7008, 0xd0f4, 0x1d20, 1572 0x2011, 0x0180, 0x710c, 0x8211, 0x0130, 0x7008, 0xd0f4, 0x1d20,
1568 0x700c, 0xa106, 0x0dc0, 0x7007, 0x0012, 0x7108, 0xe000, 0x7008, 1573 0x700c, 0xa106, 0x0dc0, 0x7007, 0x0012, 0x7108, 0xe000, 0x7008,
1569 0xa106, 0x1dd8, 0xa184, 0x0003, 0x0568, 0xd194, 0x0db0, 0xd1f4, 1574 0xa106, 0x1dd8, 0xa184, 0x0003, 0x0568, 0xd194, 0x0db0, 0xd1f4,
1570 0x0548, 0x7007, 0x0002, 0x0880, 0x0428, 0x7108, 0xd1fc, 0x0130, 1575 0x0548, 0x7007, 0x0002, 0x0880, 0x0428, 0x7108, 0xd1fc, 0x0130,
1571 0x080c, 0x40ae, 0x8aff, 0x0904, 0x3f2c, 0x0cb8, 0x700c, 0xa08c, 1576 0x080c, 0x40d6, 0x8aff, 0x0904, 0x3f54, 0x0cb8, 0x700c, 0xa08c,
1572 0x07ff, 0x01e8, 0x7004, 0xd084, 0x0178, 0x7014, 0xa005, 0x1148, 1577 0x07ff, 0x01e8, 0x7004, 0xd084, 0x0178, 0x7014, 0xa005, 0x1148,
1573 0x7010, 0x7310, 0xa306, 0x1de0, 0x2300, 0xa005, 0x0128, 0xa102, 1578 0x7010, 0x7310, 0xa306, 0x1de0, 0x2300, 0xa005, 0x0128, 0xa102,
1574 0x1e20, 0x7007, 0x0010, 0x0030, 0x8aff, 0x0148, 0x080c, 0x426b, 1579 0x1e20, 0x7007, 0x0010, 0x0030, 0x8aff, 0x0148, 0x080c, 0x429a,
1575 0x1de8, 0x09d8, 0x080c, 0x4034, 0x012e, 0x2000, 0x0005, 0x7204, 1580 0x1de8, 0x09d8, 0x080c, 0x405c, 0x012e, 0x2000, 0x0005, 0x7204,
1576 0x7108, 0xc19c, 0x8103, 0x1218, 0x7007, 0x0002, 0x0cc0, 0xa205, 1581 0x7108, 0xc19c, 0x8103, 0x1218, 0x7007, 0x0002, 0x0cc0, 0xa205,
1577 0x1d88, 0x7007, 0x0008, 0x7003, 0x0008, 0x0006, 0x2001, 0x4601, 1582 0x1d88, 0x7007, 0x0008, 0x7003, 0x0008, 0x0006, 0x2001, 0x4701,
1578 0x2004, 0xd0cc, 0x0110, 0x080c, 0x4328, 0x000e, 0x012e, 0x2000, 1583 0x2004, 0xd0cc, 0x0110, 0x080c, 0x435b, 0x000e, 0x012e, 0x2000,
1579 0x0005, 0x6428, 0x84ff, 0x0508, 0x2c70, 0x7004, 0xa0bc, 0x000f, 1584 0x0005, 0x6428, 0x84ff, 0x0508, 0x2c70, 0x7004, 0xa0bc, 0x000f,
1580 0xa7b8, 0x3ff5, 0x273c, 0x87fb, 0x1148, 0x0210, 0x080c, 0x254c, 1585 0xa7b8, 0x401d, 0x273c, 0x87fb, 0x1148, 0x0210, 0x080c, 0x2575,
1581 0x609c, 0xa075, 0x0190, 0x0c88, 0x2039, 0x3fea, 0x2704, 0xae68, 1586 0x609c, 0xa075, 0x0190, 0x0c88, 0x2039, 0x4012, 0x2704, 0xae68,
1582 0x6808, 0xa630, 0x680c, 0xa529, 0x8421, 0x0138, 0x8738, 0x2704, 1587 0x6808, 0xa630, 0x680c, 0xa529, 0x8421, 0x0138, 0x8738, 0x2704,
1583 0xa005, 0x1da8, 0x709c, 0xa075, 0x1d00, 0x0005, 0x0000, 0x0005, 1588 0xa005, 0x1da8, 0x709c, 0xa075, 0x1d00, 0x0005, 0x0000, 0x0005,
1584 0x0009, 0x000d, 0x0011, 0x0015, 0x0019, 0x001d, 0x0000, 0x0003, 1589 0x0009, 0x000d, 0x0011, 0x0015, 0x0019, 0x001d, 0x0000, 0x0003,
1585 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0000, 0x3fea, 0x3fe7, 1590 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0000, 0x4012, 0x400f,
1586 0x0000, 0x0000, 0x8000, 0x0000, 0x3fea, 0x0000, 0x3ff2, 0x3fef, 1591 0x0000, 0x0000, 0x8000, 0x0000, 0x4012, 0x0000, 0x401a, 0x4017,
1587 0x0000, 0x0000, 0x0000, 0x0000, 0x3ff2, 0x0000, 0x3fed, 0x3fed, 1592 0x0000, 0x0000, 0x0000, 0x0000, 0x401a, 0x0000, 0x4015, 0x4015,
1588 0x0000, 0x0000, 0x8000, 0x0000, 0x3fed, 0x0000, 0x3ff3, 0x3ff3, 1593 0x0000, 0x0000, 0x8000, 0x0000, 0x4015, 0x0000, 0x401b, 0x401b,
1589 0x0000, 0x0000, 0x0000, 0x0000, 0x3ff3, 0x2079, 0x4600, 0x2071, 1594 0x0000, 0x0000, 0x0000, 0x0000, 0x401b, 0x2079, 0x4700, 0x2071,
1590 0x0010, 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, 0x0001, 0x2009, 1595 0x0010, 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, 0x0001, 0x2009,
1591 0x0002, 0x2071, 0x0050, 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, 1596 0x0002, 0x2071, 0x0050, 0x7007, 0x000a, 0x7007, 0x0002, 0x7003,
1592 0x0000, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1128, 0x8109, 0x0118, 1597 0x0000, 0x2001, 0x01ff, 0x2004, 0xd0fc, 0x1128, 0x8109, 0x0118,
1593 0x2071, 0x0020, 0x0c80, 0x0005, 0x7004, 0x8004, 0x1a04, 0x408a, 1598 0x2071, 0x0020, 0x0c80, 0x0005, 0x7004, 0x8004, 0x1a04, 0x40b2,
1594 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0, 0x0120, 0x080c, 1599 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0, 0x0120, 0x080c,
1595 0x40e6, 0x0804, 0x40aa, 0x7007, 0x0012, 0x2019, 0x0000, 0x7108, 1600 0x410e, 0x0804, 0x40d2, 0x7007, 0x0012, 0x2019, 0x0000, 0x7108,
1596 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0, 0x0120, 0x080c, 0x40e6, 1601 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0, 0x0120, 0x080c, 0x410e,
1597 0x0804, 0x40aa, 0xa19c, 0x300c, 0xa386, 0x2004, 0x0190, 0xa386, 1602 0x0804, 0x40d2, 0xa19c, 0x300c, 0xa386, 0x2004, 0x0190, 0xa386,
1598 0x0008, 0x01c0, 0x7004, 0xd084, 0x1148, 0x7108, 0x7008, 0xa106, 1603 0x0008, 0x01c0, 0x7004, 0xd084, 0x1148, 0x7108, 0x7008, 0xa106,
1599 0x1de0, 0xa184, 0x0003, 0x0110, 0x0804, 0x40e6, 0xa386, 0x200c, 1604 0x1de0, 0xa184, 0x0003, 0x0110, 0x0804, 0x410e, 0xa386, 0x200c,
1600 0x19f0, 0x7200, 0x8204, 0x0230, 0x730c, 0xa384, 0x07ff, 0x0110, 1605 0x19f0, 0x7200, 0x8204, 0x0230, 0x730c, 0xa384, 0x07ff, 0x0110,
1601 0x080c, 0x254c, 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0, 1606 0x080c, 0x2575, 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0,
1602 0x0118, 0x080c, 0x40e6, 0x0470, 0x7007, 0x0012, 0x7000, 0xd084, 1607 0x0118, 0x080c, 0x410e, 0x0470, 0x7007, 0x0012, 0x7000, 0xd084,
1603 0x1148, 0x7310, 0x7014, 0xa305, 0x0128, 0x710c, 0xa184, 0x07ff, 1608 0x1148, 0x7310, 0x7014, 0xa305, 0x0128, 0x710c, 0xa184, 0x07ff,
1604 0x1904, 0x4034, 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0, 1609 0x1904, 0x405c, 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0,
1605 0x0118, 0x080c, 0x40e6, 0x00b0, 0x7007, 0x0012, 0x7007, 0x0008, 1610 0x0118, 0x080c, 0x410e, 0x00b0, 0x7007, 0x0012, 0x7007, 0x0008,
1606 0x7004, 0xd09c, 0x1de8, 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184, 1611 0x7004, 0xd09c, 0x1de8, 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184,
1607 0x01e0, 0x0118, 0x080c, 0x40e6, 0x0028, 0x7007, 0x0012, 0x7108, 1612 0x01e0, 0x0118, 0x080c, 0x410e, 0x0028, 0x7007, 0x0012, 0x7108,
1608 0x8103, 0x0e88, 0x7003, 0x0008, 0x0005, 0x7108, 0xa184, 0x01e0, 1613 0x8103, 0x0e88, 0x7003, 0x0008, 0x0005, 0x7108, 0xa184, 0x01e0,
1609 0x15a8, 0x7108, 0xa184, 0x01e0, 0x1588, 0xa184, 0x0007, 0x0002, 1614 0x15a8, 0x7108, 0xa184, 0x01e0, 0x1588, 0xa184, 0x0007, 0x0002,
1610 0x40c2, 0x40d0, 0x40c0, 0x40d0, 0x40c0, 0x4120, 0x40c0, 0x411e, 1615 0x40ea, 0x40f8, 0x40e8, 0x40f8, 0x40e8, 0x4148, 0x40e8, 0x4146,
1611 0x080c, 0x254c, 0x7004, 0xa084, 0x0010, 0xc08d, 0x7006, 0x8aff, 1616 0x080c, 0x2575, 0x7004, 0xa084, 0x0010, 0xc08d, 0x7006, 0x8aff,
1612 0x1118, 0x2049, 0x0000, 0x0005, 0x080c, 0x426b, 0x1de8, 0x0005, 1617 0x1118, 0x2049, 0x0000, 0x0005, 0x080c, 0x429a, 0x1de8, 0x0005,
1613 0x7004, 0xa084, 0x0010, 0xc08d, 0x7006, 0x7004, 0xd084, 0x1140, 1618 0x7004, 0xa084, 0x0010, 0xc08d, 0x7006, 0x7004, 0xd084, 0x1140,
1614 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184, 0x0003, 0x0108, 0x0030, 1619 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184, 0x0003, 0x0108, 0x0030,
1615 0x8aff, 0x0118, 0x080c, 0x426b, 0x1de8, 0x0005, 0x7007, 0x0012, 1620 0x8aff, 0x0118, 0x080c, 0x429a, 0x1de8, 0x0005, 0x7007, 0x0012,
1616 0x7108, 0x1d04, 0x40e9, 0x2091, 0x6000, 0x1d04, 0x40ed, 0x2091, 1621 0x7108, 0x1d04, 0x4111, 0x2091, 0x6000, 0x1d04, 0x4115, 0x2091,
1617 0x6000, 0x7007, 0x0012, 0x7007, 0x0008, 0x7004, 0xd09c, 0x1de8, 1622 0x6000, 0x7007, 0x0012, 0x7007, 0x0008, 0x7004, 0xd09c, 0x1de8,
1618 0x7007, 0x0012, 0x7108, 0xd1fc, 0x1dd8, 0x7003, 0x0000, 0x7000, 1623 0x7007, 0x0012, 0x7108, 0xd1fc, 0x1dd8, 0x7003, 0x0000, 0x7000,
1619 0xa005, 0x1130, 0x7004, 0xa005, 0x1118, 0x700c, 0xa005, 0x0108, 1624 0xa005, 0x1130, 0x7004, 0xa005, 0x1118, 0x700c, 0xa005, 0x0108,
1620 0x0c40, 0x2049, 0x0000, 0xb284, 0x0200, 0x0118, 0x2001, 0x0000, 1625 0x0c40, 0x2049, 0x0000, 0xb284, 0x0200, 0x0118, 0x2001, 0x0000,
1621 0x0010, 0x2001, 0x0001, 0x080c, 0x3b81, 0x681b, 0x0002, 0x2051, 1626 0x0010, 0x2001, 0x0001, 0x080c, 0x3ba7, 0x681b, 0x0002, 0x2051,
1622 0x0000, 0x0005, 0x080c, 0x254c, 0x080c, 0x254c, 0x080c, 0x415f, 1627 0x0000, 0x0005, 0x080c, 0x2575, 0x080c, 0x2575, 0x080c, 0x4187,
1623 0x7210, 0x7114, 0x700c, 0xa09c, 0x07ff, 0x2800, 0xa300, 0xa211, 1628 0x7210, 0x7114, 0x700c, 0xa09c, 0x07ff, 0x2800, 0xa300, 0xa211,
1624 0xa189, 0x0000, 0x04a1, 0x2704, 0x2c58, 0xac60, 0x6308, 0x2200, 1629 0xa189, 0x0000, 0x04a1, 0x2704, 0x2c58, 0xac60, 0x6308, 0x2200,
1625 0xa322, 0x630c, 0x2100, 0xa31b, 0x2400, 0xa305, 0x0140, 0x1238, 1630 0xa322, 0x630c, 0x2100, 0xa31b, 0x2400, 0xa305, 0x0140, 0x1238,
1626 0x8412, 0x8210, 0x830a, 0xa189, 0x0000, 0x2b60, 0x0c58, 0x2b60, 1631 0x8412, 0x8210, 0x830a, 0xa189, 0x0000, 0x2b60, 0x0c58, 0x2b60,
1627 0x8a07, 0x0006, 0x6004, 0xd09c, 0x0118, 0xa7ba, 0x3fef, 0x0010, 1632 0x8a07, 0x0006, 0x6004, 0xd09c, 0x0118, 0xa7ba, 0x4017, 0x0010,
1628 0xa7ba, 0x3fe7, 0x000e, 0xa73d, 0x2c00, 0x6886, 0x6f8a, 0x6c92, 1633 0xa7ba, 0x400f, 0x000e, 0xa73d, 0x2c00, 0x6886, 0x6f8a, 0x6c92,
1629 0x6b8e, 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0, 0x0110, 1634 0x6b8e, 0x7108, 0x7008, 0xa106, 0x1de0, 0xa184, 0x01e0, 0x0110,
1630 0x080c, 0x40e6, 0x7007, 0x0012, 0x080c, 0x4034, 0x0005, 0x8a50, 1635 0x080c, 0x410e, 0x7007, 0x0012, 0x080c, 0x405c, 0x0005, 0x8a50,
1631 0x8739, 0x2704, 0xa004, 0x1168, 0x6000, 0xa064, 0x1108, 0x2d60, 1636 0x8739, 0x2704, 0xa004, 0x1168, 0x6000, 0xa064, 0x1108, 0x2d60,
1632 0x6004, 0xa084, 0x000f, 0xa080, 0x4005, 0x203c, 0x87fb, 0x090c, 1637 0x6004, 0xa084, 0x000f, 0xa080, 0x402d, 0x203c, 0x87fb, 0x090c,
1633 0x254c, 0x0005, 0x0126, 0x00d6, 0x70d0, 0xa084, 0x4c00, 0x8004, 1638 0x2575, 0x0005, 0x0126, 0x00d6, 0x70d0, 0xa084, 0x4c00, 0x8004,
1634 0x2090, 0x00de, 0x6884, 0x2060, 0x6888, 0x6b8c, 0x6c90, 0x8057, 1639 0x2090, 0x00de, 0x6884, 0x2060, 0x6888, 0x6b8c, 0x6c90, 0x8057,
1635 0xaad4, 0x00ff, 0xa084, 0x00ff, 0x0006, 0x6804, 0xa084, 0x0008, 1640 0xaad4, 0x00ff, 0xa084, 0x00ff, 0x0006, 0x6804, 0xa084, 0x0008,
1636 0x000e, 0x0118, 0xa0b8, 0x3fef, 0x0010, 0xa0b8, 0x3fe7, 0xb284, 1641 0x000e, 0x0118, 0xa0b8, 0x4017, 0x0010, 0xa0b8, 0x400f, 0xb284,
1637 0x0200, 0x0110, 0x7e20, 0x0008, 0x7e24, 0xa6b5, 0x000c, 0x681c, 1642 0x0200, 0x0110, 0x7e20, 0x0008, 0x7e24, 0xa6b5, 0x000c, 0x681c,
1638 0xd0b4, 0x0108, 0xc685, 0x2400, 0xa305, 0x0518, 0x2c58, 0x2704, 1643 0xd0b4, 0x0108, 0xc685, 0x2400, 0xa305, 0x0550, 0x2c58, 0x2704,
1639 0x6104, 0xac60, 0x6000, 0xa400, 0x701a, 0x6004, 0xa301, 0x701e, 1644 0x6104, 0xac60, 0x6000, 0xa400, 0x2048, 0xa9cc, 0x0004, 0x0118,
1640 0xd19c, 0x0140, 0x6010, 0xa081, 0x0000, 0x7022, 0x6014, 0xa081, 1645 0x080c, 0x43a3, 0x0400, 0x701a, 0x6004, 0xa301, 0x701e, 0xd19c,
1641 0x0000, 0x7026, 0x6208, 0x2400, 0xa202, 0x7012, 0x620c, 0x2300, 1646 0x0140, 0x6010, 0xa081, 0x0000, 0x7022, 0x6014, 0xa081, 0x0000,
1642 0xa203, 0x7016, 0x7602, 0x7007, 0x0001, 0x2b60, 0x080c, 0x4292, 1647 0x7026, 0x6208, 0x2400, 0xa202, 0x7012, 0x620c, 0x2300, 0xa203,
1643 0x0010, 0x080c, 0x426b, 0x1de8, 0x012e, 0x2000, 0x0005, 0x0126, 1648 0x7016, 0x7602, 0x7007, 0x0001, 0x2b60, 0x080c, 0x42c5, 0x0010,
1644 0x00d6, 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de, 0x7007, 1649 0x080c, 0x429a, 0x1de8, 0x012e, 0x2000, 0x0005, 0x0126, 0x00d6,
1645 0x0004, 0x7004, 0xd094, 0x1de8, 0x7003, 0x0008, 0x012e, 0x2000, 1650 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de, 0x7007, 0x0004,
1646 0x0005, 0x0126, 0x00d6, 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 1651 0x7004, 0xd094, 0x1de8, 0x7003, 0x0008, 0x012e, 0x2000, 0x0005,
1647 0x00de, 0x7e20, 0xb284, 0x0200, 0x1108, 0x7e24, 0xa6b5, 0x000c, 1652 0x0126, 0x00d6, 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de,
1648 0x681c, 0xd0ac, 0x1118, 0xc685, 0x7003, 0x0000, 0x6828, 0x2050, 1653 0x7e20, 0xb284, 0x0200, 0x1108, 0x7e24, 0xa6b5, 0x000c, 0x681c,
1649 0x2d60, 0x6004, 0xa0bc, 0x000f, 0xa7b8, 0x3ff5, 0x273c, 0x87fb, 1654 0xd0ac, 0x1118, 0xc685, 0x7003, 0x0000, 0x6828, 0x2050, 0x2d60,
1650 0x1138, 0x0210, 0x080c, 0x254c, 0x689c, 0xa065, 0x0120, 0x0c88, 1655 0x6004, 0xa0bc, 0x000f, 0xa7b8, 0x401d, 0x273c, 0x87fb, 0x1138,
1651 0x080c, 0x426b, 0x1de8, 0x012e, 0x2000, 0x0005, 0x0126, 0x0006, 1656 0x0210, 0x080c, 0x2575, 0x689c, 0xa065, 0x0120, 0x0c88, 0x080c,
1652 0x0016, 0x00d6, 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x7e20, 1657 0x429a, 0x1de8, 0x012e, 0x2000, 0x0005, 0x0126, 0x0006, 0x0016,
1653 0xb284, 0x0200, 0x1108, 0x7e24, 0x00de, 0x003e, 0x004e, 0xa6b5, 1658 0x00d6, 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x7e20, 0xb284,
1654 0x000c, 0x681c, 0xd0b4, 0x0128, 0xc685, 0x7003, 0x0000, 0x7007, 1659 0x0200, 0x1108, 0x7e24, 0x00de, 0x003e, 0x004e, 0xa6b5, 0x000c,
1655 0x0004, 0x2049, 0x4206, 0x6828, 0xa055, 0x00d6, 0x0904, 0x4267, 1660 0x681c, 0xd0b4, 0x0128, 0xc685, 0x7003, 0x0000, 0x7007, 0x0004,
1656 0x2d70, 0x2e60, 0x7004, 0xa0bc, 0x000f, 0xa7b8, 0x3ff5, 0x273c, 1661 0x2049, 0x4235, 0x6828, 0xa055, 0x00d6, 0x0904, 0x4296, 0x2d70,
1657 0x87fb, 0x1140, 0x0210, 0x080c, 0x254c, 0x709c, 0xa075, 0x2060, 1662 0x2e60, 0x7004, 0xa0bc, 0x000f, 0xa7b8, 0x401d, 0x273c, 0x87fb,
1658 0x0570, 0x0c80, 0x2704, 0xae68, 0x6808, 0xa422, 0x680c, 0xa31b, 1663 0x1140, 0x0210, 0x080c, 0x2575, 0x709c, 0xa075, 0x2060, 0x0570,
1659 0x0268, 0x8a51, 0x1110, 0x080c, 0x254c, 0x8738, 0x2704, 0xa005, 1664 0x0c80, 0x2704, 0xae68, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0268,
1660 0x1d90, 0x709c, 0xa075, 0x2060, 0x01d0, 0x08e0, 0x8422, 0x8420, 1665 0x8a51, 0x1110, 0x080c, 0x2575, 0x8738, 0x2704, 0xa005, 0x1d90,
1661 0x831a, 0xa399, 0x0000, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 1666 0x709c, 0xa075, 0x2060, 0x01d0, 0x08e0, 0x8422, 0x8420, 0x831a,
1662 0xa11b, 0x1210, 0x080c, 0x254c, 0xb284, 0x0200, 0x0118, 0x2071, 1667 0xa399, 0x0000, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b,
1663 0x0050, 0x0010, 0x2071, 0x0020, 0x00de, 0x0804, 0x419b, 0x00de, 1668 0x1210, 0x080c, 0x2575, 0xb284, 0x0200, 0x0118, 0x2071, 0x0050,
1664 0x012e, 0x2000, 0x0005, 0x7008, 0x0006, 0xa084, 0x01e0, 0x000e, 1669 0x0010, 0x2071, 0x0020, 0x00de, 0x0804, 0x41c3, 0x00de, 0x012e,
1665 0x0110, 0xa006, 0x0005, 0xa084, 0x0003, 0xa086, 0x0003, 0x1108, 1670 0x2000, 0x0005, 0x7008, 0x0006, 0xa084, 0x01e0, 0x000e, 0x0110,
1666 0x0005, 0x2704, 0xac78, 0x7800, 0x701a, 0x7804, 0x701e, 0x7808, 1671 0xa006, 0x0005, 0xa084, 0x0003, 0xa086, 0x0003, 0x1108, 0x0005,
1667 0x7012, 0x780c, 0x7016, 0x6004, 0xd09c, 0x0120, 0x7810, 0x7022, 1672 0x2704, 0xac78, 0x7800, 0x2f08, 0xd094, 0x1904, 0x43a6, 0x701a,
1668 0x7814, 0x7026, 0x7602, 0x7004, 0xa084, 0x0010, 0xc085, 0x7006, 1673 0x7804, 0x701e, 0x7808, 0x7012, 0x780c, 0x7016, 0x6004, 0xd09c,
1669 0x2079, 0x4600, 0x8a51, 0x01e8, 0x8738, 0x2704, 0xa005, 0x1168, 1674 0x0120, 0x7810, 0x7022, 0x7814, 0x7026, 0x7602, 0x7004, 0xa084,
1670 0x609c, 0xa005, 0x01b8, 0x2060, 0x6004, 0xa084, 0x000f, 0xa080, 1675 0x0010, 0xc085, 0x7006, 0x2079, 0x4700, 0x8a51, 0x01e8, 0x8738,
1671 0x3ff5, 0x203c, 0x87fb, 0x090c, 0x254c, 0x7008, 0x0006, 0xa084, 1676 0x2704, 0xa005, 0x1168, 0x609c, 0xa005, 0x01b8, 0x2060, 0x6004,
1672 0x01e0, 0x000e, 0x0110, 0xa006, 0x0028, 0xa084, 0x0003, 0xa086, 1677 0xa084, 0x000f, 0xa080, 0x401d, 0x203c, 0x87fb, 0x090c, 0x2575,
1673 0x0003, 0x0005, 0x2051, 0x0000, 0x0005, 0x0126, 0x0006, 0x00d6, 1678 0x7008, 0x0006, 0xa084, 0x01e0, 0x000e, 0x0110, 0xa006, 0x0028,
1674 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de, 0x008e, 0x7108, 1679 0xa084, 0x0003, 0xa086, 0x0003, 0x0005, 0x2051, 0x0000, 0x0005,
1675 0xa184, 0x0003, 0x1128, 0x6828, 0xa005, 0x0178, 0x0804, 0x3f45, 1680 0x0126, 0x0006, 0x00d6, 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090,
1676 0x7108, 0xd1fc, 0x0118, 0x080c, 0x40ae, 0x0c88, 0x7007, 0x0010, 1681 0x00de, 0x008e, 0x7108, 0xa184, 0x0003, 0x1128, 0x6828, 0xa005,
1677 0x7108, 0xd1fc, 0x0de8, 0x080c, 0x40ae, 0x7008, 0xa086, 0x0008, 1682 0x0178, 0x0804, 0x3f6d, 0x7108, 0xd1fc, 0x0118, 0x080c, 0x40d6,
1678 0x1d30, 0x7000, 0xa005, 0x1d18, 0x7003, 0x0000, 0x2049, 0x0000, 1683 0x0c88, 0x7007, 0x0010, 0x7108, 0xd1fc, 0x0de8, 0x080c, 0x40d6,
1679 0x0006, 0x2001, 0x4601, 0x2004, 0xd0cc, 0x0110, 0x080c, 0x4328, 1684 0x7008, 0xa086, 0x0008, 0x1d30, 0x7000, 0xa005, 0x1d18, 0x7003,
1680 0x000e, 0x012e, 0x2000, 0x0005, 0x0126, 0x0146, 0x0136, 0x0156, 1685 0x0000, 0x2049, 0x0000, 0x0006, 0x2001, 0x4701, 0x2004, 0xd0cc,
1681 0x00c6, 0x00d6, 0x70d0, 0xa084, 0x4c00, 0x8004, 0x2090, 0x00de, 1686 0x0110, 0x080c, 0x435b, 0x000e, 0x012e, 0x2000, 0x0005, 0x0126,
1682 0x2049, 0x42ec, 0xad80, 0x0011, 0x20a0, 0xb284, 0x0200, 0x0118, 1687 0x0146, 0x0136, 0x0156, 0x00c6, 0x00d6, 0x70d0, 0xa084, 0x4c00,
1683 0x2099, 0x0032, 0x0010, 0x2099, 0x0031, 0x700c, 0xa084, 0x07ff, 1688 0x8004, 0x2090, 0x00de, 0x2049, 0x431f, 0xad80, 0x0011, 0x20a0,
1684 0x682a, 0x7007, 0x0008, 0x7007, 0x0002, 0x7003, 0x0001, 0x0118, 1689 0xb284, 0x0200, 0x0118, 0x2099, 0x0032, 0x0010, 0x2099, 0x0031,
1685 0x8000, 0x80ac, 0x53a5, 0x700c, 0xa084, 0x07ff, 0x0130, 0x7007, 1690 0x700c, 0xa084, 0x07ff, 0x682a, 0x7007, 0x0008, 0x7007, 0x0002,
1686 0x0004, 0x7004, 0xa084, 0x0004, 0x1de0, 0x00ce, 0x2049, 0x0000, 1691 0x7003, 0x0001, 0x0118, 0x8000, 0x80ac, 0x53a5, 0x700c, 0xa084,
1687 0x7003, 0x0000, 0x015e, 0x013e, 0x014e, 0x012e, 0x2000, 0x0005, 1692 0x07ff, 0x0130, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x1de0,
1688 0x6814, 0xd0fc, 0x0904, 0x436b, 0x7000, 0xd084, 0x05e0, 0x7e24, 1693 0x00ce, 0x2049, 0x0000, 0x7003, 0x0000, 0x015e, 0x013e, 0x014e,
1689 0xa6b5, 0x0004, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x1de0, 1694 0x012e, 0x2000, 0x0005, 0x6814, 0xd0fc, 0x0904, 0x439e, 0x7000,
1690 0x7118, 0x0016, 0x711c, 0x0016, 0x7120, 0x0016, 0x7124, 0x0016, 1695 0xd084, 0x05e0, 0x7e24, 0xa6b5, 0x0004, 0x7007, 0x0004, 0x7004,
1691 0x701b, 0x0000, 0x701f, 0x3fff, 0x7023, 0x0000, 0x7027, 0x0000, 1696 0xa084, 0x0004, 0x1de0, 0x7118, 0x0016, 0x711c, 0x0016, 0x7120,
1692 0x7013, 0x0004, 0x7017, 0x0000, 0x7602, 0x7007, 0x0001, 0x2001, 1697 0x0016, 0x7124, 0x0016, 0x701b, 0x0000, 0x701f, 0x3fff, 0x7023,
1693 0xffff, 0x2009, 0x0031, 0x200a, 0x200a, 0x7108, 0x7008, 0xa106, 1698 0x0000, 0x7027, 0x0000, 0x7013, 0x0004, 0x7017, 0x0000, 0x7602,
1694 0x1de0, 0xd1fc, 0x0dd0, 0x002e, 0x7226, 0x002e, 0x7222, 0x002e, 1699 0x7007, 0x0001, 0x2001, 0xffff, 0x2009, 0x0031, 0x200a, 0x200a,
1695 0x721e, 0x002e, 0x721a, 0x7007, 0x0002, 0x7008, 0xa086, 0x0008, 1700 0x7108, 0x7008, 0xa106, 0x1de0, 0xd1fc, 0x0dd0, 0x002e, 0x7226,
1696 0x0110, 0x0804, 0x40e6, 0x7007, 0x0004, 0x7003, 0x0000, 0x0005, 1701 0x002e, 0x7222, 0x002e, 0x721e, 0x002e, 0x721a, 0x7007, 0x0002,
1697 0x2091, 0x8000, 0x2091, 0x6000, 0x78ac, 0xa005, 0x1168, 0x7974, 1702 0x7008, 0xa086, 0x0008, 0x0110, 0x0804, 0x410e, 0x7007, 0x0004,
1698 0x70d0, 0xa106, 0x1148, 0x781c, 0xa005, 0x0130, 0x781f, 0x0000, 1703 0x7003, 0x0000, 0x0005, 0x2049, 0x41c3, 0x0068, 0x7008, 0xa084,
1699 0x0e04, 0x4384, 0x2091, 0x4080, 0x2069, 0x4680, 0xd7fc, 0x1110, 1704 0x0003, 0x0110, 0xa006, 0x0005, 0xa006, 0x2020, 0x2018, 0x2c58,
1700 0x2069, 0x4640, 0x6800, 0xa084, 0x000f, 0x1198, 0x68d0, 0xd0b4, 1705 0x2160, 0x2049, 0x0000, 0x8b58, 0x6100, 0x2100, 0xa408, 0x711a,
1701 0x0180, 0xd0bc, 0x1170, 0x00f6, 0x2079, 0x0100, 0xd7fc, 0x1110, 1706 0x6004, 0xa301, 0x701e, 0x0006, 0x2b04, 0xa084, 0x0008, 0x0150,
1702 0x2079, 0x0200, 0x7830, 0xa084, 0x00c0, 0x1110, 0x080c, 0x22ae, 1707 0x6010, 0xa081, 0x0000, 0x7022, 0x0006, 0x6014, 0xa081, 0x0000,
1703 0x00fe, 0x7830, 0x8001, 0x7832, 0x1904, 0x440b, 0x7834, 0x7832, 1708 0x7026, 0x0006, 0xa184, 0x0007, 0x2011, 0x0008, 0xa22a, 0x6208,
1704 0x2061, 0x6bc0, 0x2069, 0x4680, 0xc7fd, 0x68cc, 0xa005, 0x0128, 1709 0x2400, 0xa212, 0x0026, 0x620c, 0x2240, 0x2300, 0xa843, 0x002e,
1705 0x8001, 0x68ce, 0x1110, 0x080c, 0x4577, 0x6800, 0xa084, 0x000f, 1710 0x88ff, 0x1170, 0x2500, 0xa202, 0x0108, 0x1250, 0x2220, 0x2041,
1706 0x0168, 0xa086, 0x0001, 0x0150, 0x6840, 0xa00d, 0x0138, 0x2104, 1711 0x0000, 0x2b04, 0xd09c, 0x0110, 0x000e, 0x000e, 0x000e, 0x0450,
1707 0xa005, 0x0120, 0x8001, 0x200a, 0x0904, 0x4514, 0x6814, 0xa005, 1712 0x7512, 0x7017, 0x0000, 0x7602, 0xa986, 0x41c3, 0x1118, 0x7007,
1708 0x01a8, 0x8001, 0x6816, 0x1190, 0x68a3, 0x0001, 0x00f6, 0xd7fc, 1713 0x0001, 0x0028, 0x7004, 0xa084, 0x0010, 0xc085, 0x7006, 0x2500,
1709 0x1118, 0x2079, 0x0200, 0x0010, 0x2079, 0x0100, 0x080c, 0x3c46, 1714 0xa100, 0x701a, 0x2b04, 0xa084, 0x0008, 0x0110, 0x000e, 0x004e,
1710 0x00fe, 0x6860, 0xa005, 0x0110, 0x080c, 0x22ae, 0x687c, 0xa005, 1715 0x001e, 0xa189, 0x0000, 0x711e, 0x2b0c, 0xa18c, 0x0008, 0x0130,
1711 0x0140, 0x8001, 0x687e, 0x1128, 0x6863, 0x0000, 0x68d0, 0xc0c5, 1716 0xa4a1, 0x0000, 0x7422, 0xa081, 0x0000, 0x7026, 0x2500, 0xa222,
1712 0x68d2, 0x68d0, 0xd0fc, 0x01b0, 0xc0fc, 0x68d2, 0x20a9, 0x0200, 1717 0xa8c3, 0x0000, 0x7412, 0x2820, 0x7416, 0x7602, 0xa986, 0x41c3,
1713 0x6034, 0xa005, 0x0158, 0x8001, 0x6036, 0x68d0, 0xc0fd, 0x68d2, 1718 0x1118, 0x7007, 0x0001, 0x0028, 0x7004, 0xa084, 0x0010, 0xc085,
1714 0x1128, 0x6010, 0xa005, 0x0110, 0x080c, 0x22ae, 0xace0, 0x0010, 1719 0x7006, 0x8b59, 0x2b60, 0x2079, 0x4700, 0x080c, 0x42c5, 0xa006,
1715 0x1f04, 0x43f0, 0xd7fc, 0x0138, 0x2061, 0x4bc0, 0x2069, 0x4640, 1720 0x0005, 0x2091, 0x8000, 0x2091, 0x6000, 0x78ac, 0xa005, 0x1168,
1716 0xc7fc, 0x0804, 0x43ad, 0x0459, 0x7838, 0x8001, 0x783a, 0x11a0, 1721 0x7974, 0x70d0, 0xa106, 0x1148, 0x781c, 0xa005, 0x0130, 0x781f,
1717 0x783c, 0x783a, 0x2061, 0x4bc0, 0x2069, 0x4640, 0xc7fc, 0x680c, 1722 0x0000, 0x0e04, 0x443d, 0x2091, 0x4080, 0x2069, 0x4780, 0xc7fd,
1718 0xa005, 0x0110, 0x080c, 0x4487, 0xd7fc, 0x1130, 0x2061, 0x6bc0, 1723 0x6800, 0xa084, 0x000f, 0x1198, 0x68d0, 0xd0b4, 0x0180, 0xd0bc,
1719 0x2069, 0x4680, 0xc7fd, 0x0c98, 0x7810, 0xd0cc, 0x0168, 0xd0ac, 1724 0x1170, 0x00f6, 0x2079, 0x0100, 0xd7fc, 0x1110, 0x2079, 0x0200,
1720 0x1120, 0xd0a4, 0x0148, 0xc0ad, 0x7812, 0x2091, 0x8001, 0x0e04, 1725 0x7830, 0xa084, 0x00c0, 0x1110, 0x080c, 0x22d5, 0x00fe, 0xd7fc,
1721 0x4433, 0x080c, 0x207a, 0x0005, 0x2091, 0x8001, 0x0005, 0x7840, 1726 0x0120, 0x2069, 0x4740, 0xc7fc, 0x0c18, 0x7830, 0x8001, 0x7832,
1722 0x8001, 0x7842, 0x1904, 0x4486, 0x7844, 0x7842, 0x2069, 0x4640, 1727 0x1904, 0x44c7, 0x7834, 0x7832, 0x2061, 0x6cc0, 0x2069, 0x4780,
1723 0xc7fc, 0x2079, 0x0200, 0x68d4, 0xa005, 0x0138, 0x7de0, 0xa504, 1728 0xc7fd, 0x68cc, 0xa005, 0x0128, 0x8001, 0x68ce, 0x1110, 0x080c,
1724 0x1120, 0x68d6, 0x68d0, 0xc0bc, 0x68d2, 0x2079, 0x4600, 0x6810, 1729 0x4639, 0x6800, 0xa084, 0x000f, 0x0168, 0xa086, 0x0001, 0x0150,
1725 0xa005, 0x1110, 0x2001, 0x0101, 0x8001, 0x6812, 0xd7fc, 0x0118, 1730 0x6840, 0xa00d, 0x0138, 0x2104, 0xa005, 0x0120, 0x8001, 0x200a,
1726 0xa080, 0x8cd0, 0x0010, 0xa080, 0x8bc0, 0x2040, 0x2004, 0xa065, 1731 0x0904, 0x45d6, 0x6814, 0xa005, 0x01a8, 0x8001, 0x6816, 0x1190,
1727 0x01e0, 0x6024, 0xa005, 0x01b0, 0x8001, 0x6026, 0x1198, 0x6800, 1732 0x68a3, 0x0001, 0x00f6, 0xd7fc, 0x1118, 0x2079, 0x0200, 0x0010,
1728 0xa005, 0x0130, 0x6848, 0xac06, 0x1118, 0x080c, 0x4514, 0x0068, 1733 0x2079, 0x0100, 0x080c, 0x3c6e, 0x00fe, 0x6860, 0xa005, 0x0110,
1729 0x6860, 0xa005, 0x0118, 0x6027, 0x0001, 0x0020, 0x080c, 0x44c8, 1734 0x080c, 0x22d5, 0x687c, 0xa005, 0x0140, 0x8001, 0x687e, 0x1128,
1730 0x2804, 0x0c28, 0x6000, 0x2c40, 0x0c10, 0xd7fc, 0x1138, 0x2069, 1735 0x6863, 0x0000, 0x68d0, 0xc0c5, 0x68d2, 0x68d0, 0xd0fc, 0x01b0,
1731 0x4680, 0xc7fd, 0x2079, 0x0100, 0x0804, 0x4443, 0x0005, 0x2009, 1736 0xc0fc, 0x68d2, 0x20a9, 0x0200, 0x6034, 0xa005, 0x0158, 0x8001,
1732 0x0000, 0x20a9, 0x0200, 0x6008, 0xd09c, 0x0558, 0x6024, 0xa005, 1737 0x6036, 0x68d0, 0xc0fd, 0x68d2, 0x1128, 0x6010, 0xa005, 0x0110,
1733 0x0118, 0x8001, 0x6026, 0x0418, 0x6008, 0xc09c, 0xd084, 0x1110, 1738 0x080c, 0x22d5, 0xace0, 0x0010, 0x1f04, 0x44ac, 0xd7fc, 0x0138,
1734 0xd0ac, 0x01c0, 0x600a, 0x6004, 0xa005, 0x01d8, 0x00d6, 0x00c6, 1739 0x2061, 0x4cc0, 0x2069, 0x4740, 0xc7fc, 0x0804, 0x4469, 0x0459,
1735 0x0016, 0x2068, 0x6010, 0x8001, 0x6012, 0x080c, 0x37a4, 0x2d00, 1740 0x7838, 0x8001, 0x783a, 0x11a0, 0x783c, 0x783a, 0x2061, 0x4cc0,
1736 0x2c68, 0x2060, 0x080c, 0x1be3, 0x080c, 0x1d95, 0x001e, 0x00ce, 1741 0x2069, 0x4740, 0xc7fc, 0x680c, 0xa005, 0x0110, 0x080c, 0x4543,
1737 0x00de, 0x0038, 0xc0bd, 0x600a, 0xa18d, 0x0001, 0x0010, 0xa18d, 1742 0xd7fc, 0x1130, 0x2061, 0x6cc0, 0x2069, 0x4780, 0xc7fd, 0x0c98,
1738 0x0100, 0xace0, 0x0010, 0x1f04, 0x448b, 0xa184, 0x0001, 0x0130, 1743 0x7810, 0xd0cc, 0x0168, 0xd0ac, 0x1120, 0xd0a4, 0x0148, 0xc0ad,
1739 0xa18c, 0xfffe, 0x690e, 0x080c, 0x22ae, 0x0008, 0x690e, 0x0005, 1744 0x7812, 0x2091, 0x8001, 0x0e04, 0x44ef, 0x080c, 0x20a1, 0x0005,
1740 0x2c00, 0x687a, 0x6714, 0x6f72, 0x6017, 0x0000, 0x602b, 0x0000, 1745 0x2091, 0x8001, 0x0005, 0x7840, 0x8001, 0x7842, 0x1904, 0x4542,
1741 0x601b, 0x0006, 0x60b4, 0xa084, 0x5f00, 0x601e, 0x6020, 0xa084, 1746 0x7844, 0x7842, 0x2069, 0x4740, 0xc7fc, 0x2079, 0x0200, 0x68d4,
1742 0x00ff, 0xa085, 0x0060, 0x6022, 0x6000, 0x2042, 0x6858, 0xac06, 1747 0xa005, 0x0138, 0x7de0, 0xa504, 0x1120, 0x68d6, 0x68d0, 0xc0bc,
1743 0x1110, 0x2800, 0x685a, 0x080c, 0x1b7b, 0x6818, 0xa005, 0x0110, 1748 0x68d2, 0x2079, 0x4700, 0x6810, 0xa005, 0x1110, 0x2001, 0x0101,
1744 0x8001, 0x681a, 0x6808, 0xc0a4, 0x680a, 0x6810, 0x7908, 0x8109, 1749 0x8001, 0x6812, 0xd7fc, 0x0118, 0xa080, 0x8dd0, 0x0010, 0xa080,
1745 0x790a, 0x8001, 0x1310, 0x080c, 0x254c, 0x6812, 0x1118, 0x7910, 1750 0x8cc0, 0x2040, 0x2004, 0xa065, 0x01e0, 0x6024, 0xa005, 0x01b0,
1746 0xc1a5, 0x7912, 0x602f, 0x0000, 0x6033, 0x0000, 0x2c68, 0x080c, 1751 0x8001, 0x6026, 0x1198, 0x6800, 0xa005, 0x0130, 0x6848, 0xac06,
1747 0x1da2, 0xd7fc, 0x1118, 0x2069, 0x4640, 0x0010, 0x2069, 0x4680, 1752 0x1118, 0x080c, 0x45d6, 0x0068, 0x6860, 0xa005, 0x0118, 0x6027,
1748 0x6910, 0xa184, 0x0100, 0x2001, 0x0006, 0x1118, 0x6976, 0x2001, 1753 0x0001, 0x0020, 0x080c, 0x4584, 0x2804, 0x0c28, 0x6000, 0x2c40,
1749 0x0004, 0x080c, 0x22a4, 0x0005, 0x00d6, 0x6948, 0x2160, 0xd7fc, 1754 0x0c10, 0xd7fc, 0x1138, 0x2069, 0x4780, 0xc7fd, 0x2079, 0x0100,
1750 0x1118, 0x2069, 0x0200, 0x0010, 0x2069, 0x0100, 0x080c, 0x2467, 1755 0x0804, 0x44ff, 0x0005, 0x2009, 0x0000, 0x20a9, 0x0200, 0x6008,
1751 0x601b, 0x0006, 0x6858, 0xa084, 0x5f00, 0x601e, 0x6020, 0xa084, 1756 0xd09c, 0x0558, 0x6024, 0xa005, 0x0118, 0x8001, 0x6026, 0x0418,
1752 0x00ff, 0xa085, 0x0048, 0x6022, 0x602f, 0x0000, 0x6033, 0x0000, 1757 0x6008, 0xc09c, 0xd084, 0x1110, 0xd0ac, 0x01c0, 0x600a, 0x6004,
1753 0x6808, 0xa084, 0xfffd, 0x680a, 0x6830, 0xd0b4, 0x01b0, 0x684b, 1758 0xa005, 0x01d8, 0x00d6, 0x00c6, 0x0016, 0x2068, 0x6010, 0x8001,
1754 0x0004, 0x20a9, 0x0014, 0x6848, 0xd094, 0x0110, 0x1f04, 0x453b, 1759 0x6012, 0x080c, 0x37c7, 0x2d00, 0x2c68, 0x2060, 0x080c, 0x1c02,
1755 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xd084, 0x0110, 0x1f04, 1760 0x080c, 0x1db2, 0x001e, 0x00ce, 0x00de, 0x0038, 0xc0bd, 0x600a,
1756 0x4544, 0x20a9, 0x00fa, 0x1f04, 0x454b, 0x681b, 0x0054, 0x00de, 1761 0xa18d, 0x0001, 0x0010, 0xa18d, 0x0100, 0xace0, 0x0010, 0x1f04,
1757 0x6863, 0x0007, 0x0005, 0x2079, 0x4600, 0x00e1, 0x0089, 0x00a9, 1762 0x4547, 0xa184, 0x0001, 0x0130, 0xa18c, 0xfffe, 0x690e, 0x080c,
1758 0x2009, 0x0002, 0x2069, 0x4680, 0x680f, 0x0000, 0x6813, 0x0000, 1763 0x22d5, 0x0008, 0x690e, 0x0005, 0x2c00, 0x687a, 0x6714, 0x6f72,
1759 0x6817, 0x0000, 0x8109, 0x0118, 0x2069, 0x4640, 0x0ca8, 0x0005, 1764 0x6017, 0x0000, 0x602b, 0x0000, 0x601b, 0x0006, 0x60b4, 0xa084,
1760 0x2019, 0x00a3, 0x7b3a, 0x7b3e, 0x0005, 0x2019, 0x0033, 0x7b42, 1765 0x5f00, 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085, 0x0060, 0x6022,
1761 0x7b46, 0x0005, 0x2019, 0x32dd, 0x7b32, 0x7b36, 0x0005, 0x6a4c, 1766 0x6000, 0x2042, 0x2069, 0x4780, 0xd7fc, 0x1110, 0x2069, 0x4740,
1762 0xa285, 0x0000, 0x01f0, 0x6950, 0x6bbc, 0xa300, 0x00c6, 0x2164, 1767 0x6858, 0xac06, 0x1110, 0x2800, 0x685a, 0x080c, 0x1b9a, 0x6818,
1763 0x6304, 0x83ff, 0x1138, 0x8211, 0x0148, 0x8108, 0xa11a, 0x0eb8, 1768 0xa005, 0x0110, 0x8001, 0x681a, 0x6808, 0xc0a4, 0x680a, 0x6810,
1764 0x69bc, 0x0ca8, 0x68cf, 0x000a, 0x00ce, 0x0005, 0x694c, 0x6abc, 1769 0x7908, 0x8109, 0x790a, 0x8001, 0x1310, 0x080c, 0x2575, 0x6812,
1765 0x2264, 0x6008, 0xc0b5, 0x600a, 0x8210, 0x8109, 0x1dc8, 0x694e, 1770 0x1118, 0x7910, 0xc1a5, 0x7912, 0x602f, 0x0000, 0x6033, 0x0000,
1766 0x00ce, 0x0005, 0x1d04, 0x459a, 0x2091, 0x6000, 0x1d04, 0x459e, 1771 0x2c68, 0x080c, 0x1dbf, 0xd7fc, 0x1118, 0x2069, 0x4740, 0x0010,
1767 0x2091, 0x6000, 0x70ec, 0xd0dc, 0x1118, 0xd0d4, 0x0190, 0x0098, 1772 0x2069, 0x4780, 0x6910, 0xa184, 0x0100, 0x2001, 0x0006, 0x1118,
1768 0xae8e, 0x0100, 0x0138, 0x7814, 0xc0f5, 0xc0c5, 0x7816, 0xd0d4, 1773 0x6976, 0x2001, 0x0004, 0x080c, 0x22cb, 0x0005, 0x00d6, 0x6948,
1769 0x1578, 0x0458, 0x7814, 0xc0fd, 0xc0c5, 0x7816, 0xd0d4, 0x1540, 1774 0x2160, 0xd7fc, 0x1118, 0x2069, 0x0200, 0x0010, 0x2069, 0x0100,
1770 0x0420, 0xd0e4, 0x0538, 0x1d04, 0x45bb, 0x2091, 0x6000, 0x2009, 1775 0x080c, 0x2490, 0x601b, 0x0006, 0x6858, 0xa084, 0x5f00, 0x601e,
1771 0x000c, 0x1d04, 0x45c1, 0x2091, 0x6000, 0x8109, 0x1dd0, 0x70e4, 1776 0x6020, 0xa084, 0x00ff, 0xa085, 0x0048, 0x6022, 0x602f, 0x0000,
1772 0xa084, 0x01ff, 0xa086, 0x01ff, 0x1110, 0x70ec, 0x08c8, 0xae8e, 1777 0x6033, 0x0000, 0x6808, 0xa084, 0xfffd, 0x680a, 0x6830, 0xd0b4,
1773 0x0100, 0x0128, 0x7814, 0xc0f4, 0xd0fc, 0x1130, 0x0020, 0x7814, 1778 0x01b0, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848, 0xd094, 0x0110,
1774 0xc0fc, 0xd0f4, 0x1108, 0xc0c4, 0x7816, 0x7804, 0xd08c, 0x0110, 1779 0x1f04, 0x45fd, 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xd084,
1775 0x681f, 0x000c, 0x70a0, 0x70a2, 0x0005, 0x7c12 1780 0x0110, 0x1f04, 0x4606, 0x20a9, 0x00fa, 0x1f04, 0x460d, 0x681b,
1781 0x0054, 0x00de, 0x6863, 0x0007, 0x0005, 0x2079, 0x4700, 0x00e1,
1782 0x0089, 0x00a9, 0x2009, 0x0002, 0x2069, 0x4780, 0x680f, 0x0000,
1783 0x6813, 0x0000, 0x6817, 0x0000, 0x8109, 0x0118, 0x2069, 0x4740,
1784 0x0ca8, 0x0005, 0x2019, 0x00a3, 0x7b3a, 0x7b3e, 0x0005, 0x2019,
1785 0x0033, 0x7b42, 0x7b46, 0x0005, 0x2019, 0x32dd, 0x7b32, 0x7b36,
1786 0x0005, 0x6a4c, 0xa285, 0x0000, 0x01f0, 0x6950, 0x6bbc, 0xa300,
1787 0x00c6, 0x2164, 0x6304, 0x83ff, 0x1138, 0x8211, 0x0148, 0x8108,
1788 0xa11a, 0x0eb8, 0x69bc, 0x0ca8, 0x68cf, 0x000a, 0x00ce, 0x0005,
1789 0x694c, 0x6abc, 0x2264, 0x6008, 0xc0b5, 0x600a, 0x8210, 0x8109,
1790 0x1dc8, 0x694e, 0x00ce, 0x0005, 0x0016, 0x1d04, 0x465d, 0x2091,
1791 0x6000, 0x1d04, 0x4661, 0x2091, 0x6000, 0x70ec, 0xd0dc, 0x1118,
1792 0xd0d4, 0x0190, 0x00a0, 0xae8e, 0x0100, 0x0138, 0x7814, 0xc0f5,
1793 0xc0c5, 0x7816, 0xd0d4, 0x1580, 0x0460, 0x7814, 0xc0fd, 0xc0c5,
1794 0x7816, 0xd0d4, 0x1548, 0x0428, 0xd0e4, 0x0904, 0x46c4, 0x1d04,
1795 0x467f, 0x2091, 0x6000, 0x2009, 0x000c, 0x1d04, 0x4685, 0x2091,
1796 0x6000, 0x8109, 0x1dd0, 0x70e4, 0xa084, 0x01ff, 0xa086, 0x01ff,
1797 0x1110, 0x70ec, 0x08c0, 0xae8e, 0x0100, 0x0128, 0x7814, 0xc0f4,
1798 0xd0fc, 0x1130, 0x0020, 0x7814, 0xc0fc, 0xd0f4, 0x1108, 0xc0c4,
1799 0x7816, 0x7804, 0xd08c, 0x0500, 0x00c6, 0x2061, 0x0000, 0x6018,
1800 0xd084, 0x11b8, 0xae86, 0x0200, 0x00e6, 0x2071, 0x0010, 0x0120,
1801 0x70db, 0x0001, 0x78e4, 0x0018, 0x70db, 0x0000, 0x78e0, 0x70c6,
1802 0x70c3, 0x800e, 0x601b, 0x0001, 0x2091, 0x4080, 0x00ee, 0x00ce,
1803 0x0018, 0x00ce, 0x681f, 0x000c, 0x001e, 0x70a0, 0x70a2, 0x0005,
1804 0x0c26
1776}; 1805};
1777#ifdef UNIQUE_FW_NAME 1806#ifdef UNIQUE_FW_NAME
1778static unsigned short fw12160i_length01 = 0x35e6; 1807static unsigned short fw12160i_length01 = 0x36c9;
1779#else 1808#else
1780static unsigned short risc_code_length01 = 0x35e6; 1809static unsigned short risc_code_length01 = 0x36c9;
1781#endif 1810#endif
1811
diff --git a/drivers/scsi/ql1280_fw.h b/drivers/scsi/ql1280_fw.h
index 2621e99a4311..784f2a04bf28 100644
--- a/drivers/scsi/ql1280_fw.h
+++ b/drivers/scsi/ql1280_fw.h
@@ -23,25 +23,25 @@
23 23
24 24
25/* 25/*
26 * Firmware Version 8.15.00 (14:35 Aug 22, 2000) 26 * Firmware Version 8.15.11 (10:20 Jan 02, 2002)
27 */ 27 */
28 28
29#ifdef UNIQUE_FW_NAME 29#ifdef UNIQUE_FW_NAME
30static unsigned char fw1280ei_version_str[] = {8,15,0}; 30static unsigned char fw1280ei_version_str[] = {8,15,11};
31#else 31#else
32static unsigned char firmware_version[] = {8,15,0}; 32static unsigned char firmware_version[] = {8,15,11};
33#endif 33#endif
34 34
35#ifdef UNIQUE_FW_NAME 35#ifdef UNIQUE_FW_NAME
36#define fw1280ei_VERSION_STRING "8.15.00" 36#define fw1280ei_VERSION_STRING "8.15.11"
37#else 37#else
38#define FW_VERSION_STRING "8.15.00" 38#define FW_VERSION_STRING "8.15.11"
39#endif 39#endif
40 40
41#ifdef UNIQUE_FW_NAME 41#ifdef UNIQUE_FW_NAME
42static unsigned short fw1280ei_addr01 = 0x1000; 42static unsigned short fw1280ei_addr01 = 0x1000 ;
43#else 43#else
44static unsigned short risc_code_addr01 = 0x1000; 44static unsigned short risc_code_addr01 = 0x1000 ;
45#endif 45#endif
46 46
47#ifdef UNIQUE_FW_NAME 47#ifdef UNIQUE_FW_NAME
@@ -49,7 +49,7 @@ static unsigned short fw1280ei_code01[] = {
49#else 49#else
50static unsigned short risc_code01[] = { 50static unsigned short risc_code01[] = {
51#endif 51#endif
52 0x0078, 0x1041, 0x0000, 0x3d3b, 0x0000, 0x2043, 0x4f50, 0x5952, 52 0x0078, 0x1041, 0x0000, 0x3e2e, 0x0000, 0x2043, 0x4f50, 0x5952,
53 0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932, 0x2c31, 53 0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932, 0x2c31,
54 0x3939, 0x332c, 0x3139, 0x3934, 0x2051, 0x4c4f, 0x4749, 0x4320, 54 0x3939, 0x332c, 0x3139, 0x3934, 0x2051, 0x4c4f, 0x4749, 0x4320,
55 0x434f, 0x5250, 0x4f52, 0x4154, 0x494f, 0x4e00, 0x2049, 0x5350, 55 0x434f, 0x5250, 0x4f52, 0x4154, 0x494f, 0x4e00, 0x2049, 0x5350,
@@ -57,7 +57,7 @@ static unsigned short risc_code01[] = {
57 0x6572, 0x7369, 0x6f6e, 0x2030, 0x382e, 0x3135, 0x2020, 0x2043, 57 0x6572, 0x7369, 0x6f6e, 0x2030, 0x382e, 0x3135, 0x2020, 0x2043,
58 0x7573, 0x746f, 0x6d65, 0x7220, 0x4e6f, 0x2e20, 0x3030, 0x2050, 58 0x7573, 0x746f, 0x6d65, 0x7220, 0x4e6f, 0x2e20, 0x3030, 0x2050,
59 0x726f, 0x6475, 0x6374, 0x204e, 0x6f2e, 0x2020, 0x3030, 0x2020, 59 0x726f, 0x6475, 0x6374, 0x204e, 0x6f2e, 0x2020, 0x3030, 0x2020,
60 0x2400, 0x20c9, 0x97ff, 0x2001, 0x04fc, 0x2004, 0xa086, 0x1080, 60 0x2400, 0x20c9, 0x98ff, 0x2001, 0x04fc, 0x2004, 0xa086, 0x1080,
61 0x00c0, 0x1054, 0x2071, 0x0100, 0x70a0, 0x70a2, 0x20c1, 0x0010, 61 0x00c0, 0x1054, 0x2071, 0x0100, 0x70a0, 0x70a2, 0x20c1, 0x0010,
62 0x2089, 0x1374, 0x0078, 0x106d, 0x2001, 0x04fc, 0x2004, 0xa086, 62 0x2089, 0x1374, 0x0078, 0x106d, 0x2001, 0x04fc, 0x2004, 0xa086,
63 0x1280, 0x00c0, 0x1069, 0x2071, 0x0200, 0x70a0, 0x70a2, 0x2071, 63 0x1280, 0x00c0, 0x1069, 0x2071, 0x0200, 0x70a0, 0x70a2, 0x2071,
@@ -70,1660 +70,1670 @@ static unsigned short risc_code01[] = {
70 0xa286, 0xa5a5, 0x0040, 0x10a4, 0xa386, 0x000f, 0x0040, 0x10a0, 70 0xa286, 0xa5a5, 0x0040, 0x10a4, 0xa386, 0x000f, 0x0040, 0x10a0,
71 0x2c6a, 0x2a5a, 0x20c1, 0x0020, 0x2019, 0x000f, 0x0078, 0x1080, 71 0x2c6a, 0x2a5a, 0x20c1, 0x0020, 0x2019, 0x000f, 0x0078, 0x1080,
72 0x2c6a, 0x2a5a, 0x0078, 0x10a2, 0x2c6a, 0x2a5a, 0x2130, 0x2128, 72 0x2c6a, 0x2a5a, 0x0078, 0x10a2, 0x2c6a, 0x2a5a, 0x2130, 0x2128,
73 0xa1a2, 0x4e00, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 73 0xa1a2, 0x4f00, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 0x8424,
74 0xa192, 0x9800, 0x2009, 0x0000, 0x2001, 0x0032, 0x1078, 0x207a, 74 0xa192, 0x9900, 0x2009, 0x0000, 0x2001, 0x0032, 0x1078, 0x20c1,
75 0x2218, 0x2079, 0x4e00, 0x2fa0, 0x2408, 0x2011, 0x0000, 0x20a9, 75 0x2218, 0x2079, 0x4f00, 0x2fa0, 0x2408, 0x2011, 0x0000, 0x20a9,
76 0x0040, 0x42a4, 0x8109, 0x00c0, 0x10bf, 0x2009, 0xff00, 0x3400, 76 0x0040, 0x42a4, 0x8109, 0x00c0, 0x10bf, 0x2009, 0xff00, 0x3400,
77 0xa102, 0x0048, 0x10cf, 0x0040, 0x10cf, 0x20a8, 0x42a4, 0x2001, 77 0xa102, 0x0048, 0x10cf, 0x0040, 0x10cf, 0x20a8, 0x42a4, 0x2001,
78 0x04fc, 0x2004, 0xa086, 0x1080, 0x00c0, 0x10e5, 0x2071, 0x0100, 78 0x04fc, 0x2004, 0xa086, 0x1080, 0x00c0, 0x10e5, 0x2071, 0x0100,
79 0x0d7e, 0x2069, 0x4e40, 0x1078, 0x4cdd, 0x0d7f, 0x7810, 0xc0ed, 79 0x0d7e, 0x2069, 0x4f40, 0x1078, 0x4db0, 0x0d7f, 0x7810, 0xc0ed,
80 0x7812, 0x781b, 0x0064, 0x0078, 0x110a, 0x2001, 0x04fc, 0x2004, 80 0x7812, 0x781b, 0x0064, 0x0078, 0x110a, 0x2001, 0x04fc, 0x2004,
81 0xa086, 0x1280, 0x00c0, 0x1105, 0x7814, 0xc0ed, 0xc0d5, 0x7816, 81 0xa086, 0x1280, 0x00c0, 0x1105, 0x7814, 0xc0ed, 0xc0d5, 0x7816,
82 0x781b, 0x0064, 0x2071, 0x0200, 0x0d7e, 0x2069, 0x4e40, 0x1078, 82 0x781b, 0x0064, 0x2071, 0x0200, 0x0d7e, 0x2069, 0x4f40, 0x1078,
83 0x4cdd, 0x2069, 0x4e80, 0x2071, 0x0100, 0x1078, 0x4cdd, 0x7814, 83 0x4db0, 0x2069, 0x4f80, 0x2071, 0x0100, 0x1078, 0x4db0, 0x7814,
84 0xc0d4, 0x7816, 0x0d7f, 0x0078, 0x110a, 0x7814, 0xc0e5, 0x7816, 84 0xc0d4, 0x7816, 0x0d7f, 0x0078, 0x110a, 0x7814, 0xc0e5, 0x7816,
85 0x781b, 0x003c, 0x7eca, 0x7cc2, 0x7bc6, 0x7867, 0x0000, 0x7800, 85 0x781b, 0x003c, 0x7eca, 0x7cc2, 0x7bc6, 0x7867, 0x0000, 0x7800,
86 0xc08d, 0x7802, 0x2031, 0x0030, 0x78af, 0x0101, 0x7823, 0x0002, 86 0xc08d, 0x7802, 0x2031, 0x0030, 0x78af, 0x0101, 0x7823, 0x0002,
87 0x7827, 0x0002, 0x2009, 0x0002, 0x2069, 0x4e40, 0x681b, 0x0003, 87 0x7827, 0x0002, 0x2009, 0x0002, 0x2069, 0x4f40, 0x681b, 0x0003,
88 0x6823, 0x0007, 0x6827, 0x00fa, 0x682b, 0x0008, 0x682f, 0x0028, 88 0x6823, 0x0007, 0x6827, 0x00fa, 0x682b, 0x0008, 0x682f, 0x0028,
89 0x6837, 0x0000, 0x683b, 0x0006, 0x6833, 0x0008, 0x683f, 0x0000, 89 0x6837, 0x0000, 0x683b, 0x0006, 0x6833, 0x0008, 0x683f, 0x0000,
90 0x8109, 0x0040, 0x115e, 0x68d3, 0x000a, 0x68c3, 0x4ec0, 0x2079, 90 0x8109, 0x0040, 0x115e, 0x68d3, 0x000a, 0x68c3, 0x4fc0, 0x2079,
91 0x4e00, 0x7814, 0xd0e4, 0x00c0, 0x1144, 0xd0ec, 0x00c0, 0x1148, 91 0x4f00, 0x7814, 0xd0e4, 0x00c0, 0x1144, 0xd0ec, 0x00c0, 0x1148,
92 0x68d7, 0x7329, 0x0078, 0x114a, 0x68d7, 0x730d, 0x0078, 0x114a, 92 0x68d7, 0x7329, 0x0078, 0x114a, 0x68d7, 0x730d, 0x0078, 0x114a,
93 0x68d7, 0x732d, 0x68c7, 0x53c0, 0x68cb, 0x52c0, 0x68cf, 0x93c0, 93 0x68d7, 0x732d, 0x68c7, 0x54c0, 0x68cb, 0x53c0, 0x68cf, 0x94c0,
94 0x68ab, 0x9644, 0x68af, 0x9649, 0x68b3, 0x9644, 0x68b7, 0x9644, 94 0x68ab, 0x9744, 0x68af, 0x9749, 0x68b3, 0x9744, 0x68b7, 0x9744,
95 0x68a7, 0x0001, 0x2069, 0x4e80, 0x0078, 0x111e, 0x68d3, 0x000a, 95 0x68a7, 0x0001, 0x2069, 0x4f80, 0x0078, 0x111e, 0x68d3, 0x000a,
96 0x68c3, 0x50c0, 0x7814, 0xd0e4, 0x00c0, 0x116a, 0x68d7, 0x7439, 96 0x68c3, 0x51c0, 0x7814, 0xd0e4, 0x00c0, 0x116a, 0x68d7, 0x7439,
97 0x0078, 0x116c, 0x68d7, 0x7419, 0x68c7, 0x73c0, 0x68cb, 0x5340, 97 0x0078, 0x116c, 0x68d7, 0x7419, 0x68c7, 0x74c0, 0x68cb, 0x5440,
98 0x68cf, 0x94d0, 0x68ab, 0x9649, 0x68af, 0x964e, 0x68b3, 0x9649, 98 0x68cf, 0x95d0, 0x68ab, 0x9749, 0x68af, 0x974e, 0x68b3, 0x9749,
99 0x68b7, 0x9649, 0x68a7, 0x0001, 0x7810, 0xd0ec, 0x00c0, 0x11c2, 99 0x68b7, 0x9749, 0x68a7, 0x0001, 0x7810, 0xd0ec, 0x00c0, 0x11c2,
100 0x7814, 0xd0e4, 0x00c0, 0x11b4, 0x0e7e, 0x2069, 0x52c0, 0x2071, 100 0x7814, 0xd0e4, 0x00c0, 0x11b4, 0x0e7e, 0x2069, 0x53c0, 0x2071,
101 0x0200, 0x70ec, 0xd0e4, 0x00c0, 0x1195, 0x2019, 0x0c0c, 0x2021, 101 0x0200, 0x70ec, 0xd0e4, 0x00c0, 0x1195, 0x2019, 0x0c0c, 0x2021,
102 0x000c, 0x1078, 0x2009, 0x0078, 0x119b, 0x2019, 0x0c0a, 0x2021, 102 0x000c, 0x1078, 0x2050, 0x0078, 0x119b, 0x2019, 0x0c0a, 0x2021,
103 0x000a, 0x1078, 0x2009, 0x2069, 0x5340, 0x2071, 0x0100, 0x70ec, 103 0x000a, 0x1078, 0x2050, 0x2069, 0x5440, 0x2071, 0x0100, 0x70ec,
104 0xd0e4, 0x00c0, 0x11ab, 0x2019, 0x0c0c, 0x2021, 0x000c, 0x1078, 104 0xd0e4, 0x00c0, 0x11ab, 0x2019, 0x0c0c, 0x2021, 0x000c, 0x1078,
105 0x2009, 0x0078, 0x11b1, 0x2019, 0x0c0a, 0x2021, 0x000a, 0x1078, 105 0x2050, 0x0078, 0x11b1, 0x2019, 0x0c0a, 0x2021, 0x000a, 0x1078,
106 0x2009, 0x0e7f, 0x0078, 0x11db, 0x2019, 0x0c0c, 0x2021, 0x000c, 106 0x2050, 0x0e7f, 0x0078, 0x11db, 0x2019, 0x0c0c, 0x2021, 0x000c,
107 0x2069, 0x52c0, 0x1078, 0x2009, 0x2069, 0x5340, 0x1078, 0x2009, 107 0x2069, 0x53c0, 0x1078, 0x2050, 0x2069, 0x5440, 0x1078, 0x2050,
108 0x0078, 0x11db, 0x2069, 0x52c0, 0x0e7e, 0x2071, 0x0100, 0x70ec, 108 0x0078, 0x11db, 0x2069, 0x53c0, 0x0e7e, 0x2071, 0x0100, 0x70ec,
109 0xd0e4, 0x00c0, 0x11d4, 0x2019, 0x0c0c, 0x2021, 0x000c, 0x1078, 109 0xd0e4, 0x00c0, 0x11d4, 0x2019, 0x0c0c, 0x2021, 0x000c, 0x1078,
110 0x2009, 0x0e7f, 0x0078, 0x11db, 0x2019, 0x0c0a, 0x2021, 0x000a, 110 0x2050, 0x0e7f, 0x0078, 0x11db, 0x2019, 0x0c0a, 0x2021, 0x000a,
111 0x1078, 0x2009, 0x0e7f, 0x2011, 0x0002, 0x2069, 0x53c0, 0x2009, 111 0x1078, 0x2050, 0x0e7f, 0x2011, 0x0002, 0x2069, 0x54c0, 0x2009,
112 0x0002, 0x20a9, 0x0100, 0x6837, 0x0000, 0x680b, 0x0040, 0x7bc8, 112 0x0002, 0x20a9, 0x0100, 0x6837, 0x0000, 0x680b, 0x0040, 0x7bc8,
113 0xa386, 0xfeff, 0x00c0, 0x11f2, 0x6817, 0x0100, 0x681f, 0x0064, 113 0xa386, 0xfeff, 0x00c0, 0x11f2, 0x6817, 0x0100, 0x681f, 0x0064,
114 0x0078, 0x11f6, 0x6817, 0x0064, 0x681f, 0x0002, 0xade8, 0x0010, 114 0x0078, 0x11f6, 0x6817, 0x0064, 0x681f, 0x0002, 0xade8, 0x0010,
115 0x00f0, 0x11e3, 0x8109, 0x00c0, 0x11e1, 0x8211, 0x0040, 0x1204, 115 0x00f0, 0x11e3, 0x8109, 0x00c0, 0x11e1, 0x8211, 0x0040, 0x1204,
116 0x2069, 0x73c0, 0x0078, 0x11df, 0x1078, 0x265b, 0x1078, 0x468e, 116 0x2069, 0x74c0, 0x0078, 0x11df, 0x1078, 0x26a2, 0x1078, 0x4712,
117 0x1078, 0x1dd4, 0x1078, 0x4c6f, 0x2091, 0x2100, 0x2079, 0x4e00, 117 0x1078, 0x1e1b, 0x1078, 0x4d42, 0x2091, 0x2100, 0x2079, 0x4f00,
118 0x7810, 0xd0ec, 0x0040, 0x1218, 0x2071, 0x0020, 0x0078, 0x121a, 118 0x7810, 0xd0ec, 0x0040, 0x1218, 0x2071, 0x0020, 0x0078, 0x121a,
119 0x2071, 0x0050, 0x2091, 0x2200, 0x2079, 0x4e00, 0x2071, 0x0020, 119 0x2071, 0x0050, 0x2091, 0x2200, 0x2079, 0x4f00, 0x2071, 0x0020,
120 0x2091, 0x2300, 0x2079, 0x4e00, 0x7810, 0xd0ec, 0x0040, 0x122c, 120 0x2091, 0x2300, 0x2079, 0x4f00, 0x7810, 0xd0ec, 0x0040, 0x122c,
121 0x2079, 0x0100, 0x0078, 0x122e, 0x2079, 0x0200, 0x2071, 0x4e40, 121 0x2079, 0x0100, 0x0078, 0x122e, 0x2079, 0x0200, 0x2071, 0x4f40,
122 0x2091, 0x2400, 0x2079, 0x0100, 0x2071, 0x4e80, 0x2091, 0x2000, 122 0x2091, 0x2400, 0x2079, 0x0100, 0x2071, 0x4f80, 0x2091, 0x2000,
123 0x2079, 0x4e00, 0x2071, 0x0010, 0x3200, 0xa085, 0x303d, 0x2090, 123 0x2079, 0x4f00, 0x2071, 0x0010, 0x3200, 0xa085, 0x303d, 0x2090,
124 0x2071, 0x0010, 0x70c3, 0x0000, 0x0090, 0x124d, 0x70c0, 0xa086, 124 0x2071, 0x0010, 0x70c3, 0x0000, 0x0090, 0x124d, 0x70c0, 0xa086,
125 0x0002, 0x00c0, 0x124d, 0x1078, 0x15ba, 0x2039, 0x0000, 0x7810, 125 0x0002, 0x00c0, 0x124d, 0x1078, 0x15c1, 0x2039, 0x0000, 0x7810,
126 0xd0ec, 0x00c0, 0x12cf, 0x1078, 0x148e, 0x78ac, 0xa005, 0x00c0, 126 0xd0ec, 0x00c0, 0x12cf, 0x1078, 0x148e, 0x78ac, 0xa005, 0x00c0,
127 0x126b, 0x0068, 0x1261, 0x786c, 0xa065, 0x0040, 0x1261, 0x1078, 127 0x126b, 0x0068, 0x1261, 0x786c, 0xa065, 0x0040, 0x1261, 0x1078,
128 0x2395, 0x1078, 0x20a1, 0x0068, 0x1278, 0x786c, 0xa065, 0x0040, 128 0x23dc, 0x1078, 0x20e8, 0x0068, 0x1278, 0x786c, 0xa065, 0x0040,
129 0x126b, 0x1078, 0x2395, 0x0068, 0x1278, 0x2009, 0x4e47, 0x2011, 129 0x126b, 0x1078, 0x23dc, 0x0068, 0x1278, 0x2009, 0x4f47, 0x2011,
130 0x4e87, 0x2104, 0x220c, 0xa105, 0x0040, 0x1278, 0x1078, 0x1f0a, 130 0x4f87, 0x2104, 0x220c, 0xa105, 0x0040, 0x1278, 0x1078, 0x1f51,
131 0x2071, 0x4e40, 0x70a4, 0xa005, 0x0040, 0x129d, 0x7450, 0xa485, 131 0x2071, 0x4f40, 0x70a4, 0xa005, 0x0040, 0x129d, 0x7450, 0xa485,
132 0x0000, 0x0040, 0x129d, 0x2079, 0x0200, 0x2091, 0x8000, 0x72d4, 132 0x0000, 0x0040, 0x129d, 0x2079, 0x0200, 0x2091, 0x8000, 0x72d4,
133 0xa28c, 0x303d, 0x2190, 0x1078, 0x2b6a, 0x2091, 0x8000, 0x2091, 133 0xa28c, 0x303d, 0x2190, 0x1078, 0x2bb1, 0x2091, 0x8000, 0x2091,
134 0x303d, 0x0068, 0x129d, 0x2079, 0x4e00, 0x786c, 0xa065, 0x0040, 134 0x303d, 0x0068, 0x129d, 0x2079, 0x4f00, 0x786c, 0xa065, 0x0040,
135 0x129d, 0x2071, 0x0010, 0x1078, 0x2395, 0x00e0, 0x12a5, 0x2079, 135 0x129d, 0x2071, 0x0010, 0x1078, 0x23dc, 0x00e0, 0x12a5, 0x2079,
136 0x4e00, 0x2071, 0x0010, 0x1078, 0x4a43, 0x2071, 0x4e80, 0x70a4, 136 0x4f00, 0x2071, 0x0010, 0x1078, 0x4b16, 0x2071, 0x4f80, 0x70a4,
137 0xa005, 0x0040, 0x12bd, 0x7050, 0xa025, 0x0040, 0x12bd, 0x2079, 137 0xa005, 0x0040, 0x12bd, 0x7050, 0xa025, 0x0040, 0x12bd, 0x2079,
138 0x0100, 0x2091, 0x8000, 0x72d4, 0xa28c, 0x303d, 0x2190, 0x1078, 138 0x0100, 0x2091, 0x8000, 0x72d4, 0xa28c, 0x303d, 0x2190, 0x1078,
139 0x2b6a, 0x2091, 0x8000, 0x2091, 0x303d, 0x2079, 0x4e00, 0x2071, 139 0x2bb1, 0x2091, 0x8000, 0x2091, 0x303d, 0x2079, 0x4f00, 0x2071,
140 0x0010, 0x0068, 0x12c9, 0x786c, 0xa065, 0x0040, 0x12c9, 0x1078, 140 0x0010, 0x0068, 0x12c9, 0x786c, 0xa065, 0x0040, 0x12c9, 0x1078,
141 0x2395, 0x00e0, 0x1253, 0x1078, 0x4a43, 0x0078, 0x1253, 0x1078, 141 0x23dc, 0x00e0, 0x1253, 0x1078, 0x4b16, 0x0078, 0x1253, 0x1078,
142 0x148e, 0x78ac, 0xa005, 0x00c0, 0x12e7, 0x0068, 0x12dd, 0x786c, 142 0x148e, 0x78ac, 0xa005, 0x00c0, 0x12e7, 0x0068, 0x12dd, 0x786c,
143 0xa065, 0x0040, 0x12dd, 0x1078, 0x2395, 0x1078, 0x20a1, 0x0068, 143 0xa065, 0x0040, 0x12dd, 0x1078, 0x23dc, 0x1078, 0x20e8, 0x0068,
144 0x12f1, 0x786c, 0xa065, 0x0040, 0x12e7, 0x1078, 0x2395, 0x0068, 144 0x12f1, 0x786c, 0xa065, 0x0040, 0x12e7, 0x1078, 0x23dc, 0x0068,
145 0x12f1, 0x2009, 0x4e47, 0x2104, 0xa005, 0x0040, 0x12f1, 0x1078, 145 0x12f1, 0x2009, 0x4f47, 0x2104, 0xa005, 0x0040, 0x12f1, 0x1078,
146 0x1f0a, 0x2071, 0x4e40, 0x70a4, 0xa005, 0x0040, 0x130c, 0x7450, 146 0x1f51, 0x2071, 0x4f40, 0x70a4, 0xa005, 0x0040, 0x130c, 0x7450,
147 0xa485, 0x0000, 0x0040, 0x130c, 0x2079, 0x0100, 0x2091, 0x8000, 147 0xa485, 0x0000, 0x0040, 0x130c, 0x2079, 0x0100, 0x2091, 0x8000,
148 0x72d4, 0xa28c, 0x303d, 0x2190, 0x1078, 0x2b6a, 0x2091, 0x8000, 148 0x72d4, 0xa28c, 0x303d, 0x2190, 0x1078, 0x2bb1, 0x2091, 0x8000,
149 0x2091, 0x303d, 0x2079, 0x4e00, 0x2071, 0x0010, 0x0068, 0x1316, 149 0x2091, 0x303d, 0x2079, 0x4f00, 0x2071, 0x0010, 0x0068, 0x1316,
150 0x786c, 0xa065, 0x0040, 0x1316, 0x1078, 0x2395, 0x00e0, 0x12cf, 150 0x786c, 0xa065, 0x0040, 0x1316, 0x1078, 0x23dc, 0x00e0, 0x12cf,
151 0x1078, 0x4a43, 0x0078, 0x12cf, 0x133c, 0x133c, 0x133e, 0x133e, 151 0x1078, 0x4b16, 0x0078, 0x12cf, 0x133c, 0x133c, 0x133e, 0x133e,
152 0x134b, 0x134b, 0x134b, 0x134b, 0x1356, 0x1356, 0x1363, 0x1363, 152 0x134b, 0x134b, 0x134b, 0x134b, 0x1356, 0x1356, 0x1363, 0x1363,
153 0x134b, 0x134b, 0x134b, 0x134b, 0x133c, 0x133c, 0x133e, 0x133e, 153 0x134b, 0x134b, 0x134b, 0x134b, 0x133c, 0x133c, 0x133e, 0x133e,
154 0x134b, 0x134b, 0x134b, 0x134b, 0x1356, 0x1356, 0x1363, 0x1363, 154 0x134b, 0x134b, 0x134b, 0x134b, 0x1356, 0x1356, 0x1363, 0x1363,
155 0x134b, 0x134b, 0x134b, 0x134b, 0x0078, 0x133c, 0x007e, 0x107e, 155 0x134b, 0x134b, 0x134b, 0x134b, 0x0078, 0x133c, 0x007e, 0x107e,
156 0x127e, 0x2091, 0x2400, 0x1078, 0x298a, 0x127f, 0x107f, 0x007f, 156 0x127e, 0x2091, 0x2400, 0x1078, 0x29d1, 0x127f, 0x107f, 0x007f,
157 0x2091, 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x1078, 0x13c8, 157 0x2091, 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x1078, 0x13c8,
158 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, 0x007e, 0x107e, 158 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, 0x007e, 0x107e,
159 0x127e, 0x2091, 0x2300, 0x1078, 0x298a, 0x127f, 0x107f, 0x007f, 159 0x127e, 0x2091, 0x2300, 0x1078, 0x29d1, 0x127f, 0x107f, 0x007f,
160 0x2091, 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x2091, 0x2300, 160 0x2091, 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x2091, 0x2300,
161 0x1078, 0x298a, 0x2091, 0x2400, 0x1078, 0x298a, 0x127f, 0x107f, 161 0x1078, 0x29d1, 0x2091, 0x2400, 0x1078, 0x29d1, 0x127f, 0x107f,
162 0x007f, 0x2091, 0x8001, 0x007c, 0x1394, 0x1394, 0x1396, 0x1396, 162 0x007f, 0x2091, 0x8001, 0x007c, 0x1394, 0x1394, 0x1396, 0x1396,
163 0x13a3, 0x13a3, 0x13a3, 0x13a3, 0x13ae, 0x13ae, 0x1396, 0x1396, 163 0x13a3, 0x13a3, 0x13a3, 0x13a3, 0x13ae, 0x13ae, 0x1396, 0x1396,
164 0x13a3, 0x13a3, 0x13a3, 0x13a3, 0x13af, 0x13af, 0x13af, 0x13af, 164 0x13a3, 0x13a3, 0x13a3, 0x13a3, 0x13af, 0x13af, 0x13af, 0x13af,
165 0x13af, 0x13af, 0x13af, 0x13af, 0x13af, 0x13af, 0x13af, 0x13af, 165 0x13af, 0x13af, 0x13af, 0x13af, 0x13af, 0x13af, 0x13af, 0x13af,
166 0x13af, 0x13af, 0x13af, 0x13af, 0x0078, 0x1394, 0x007e, 0x107e, 166 0x13af, 0x13af, 0x13af, 0x13af, 0x0078, 0x1394, 0x007e, 0x107e,
167 0x127e, 0x2091, 0x2300, 0x1078, 0x298a, 0x127f, 0x107f, 0x007f, 167 0x127e, 0x2091, 0x2300, 0x1078, 0x29d1, 0x127f, 0x107f, 0x007f,
168 0x2091, 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x1078, 0x13d5, 168 0x2091, 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x1078, 0x13d5,
169 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, 0x007c, 0x107e, 169 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, 0x007c, 0x107e,
170 0x127e, 0x0d7e, 0x0e7e, 0x0f7e, 0x007e, 0x2071, 0x0100, 0x2069, 170 0x127e, 0x0d7e, 0x0e7e, 0x0f7e, 0x007e, 0x2071, 0x0100, 0x2069,
171 0x4e40, 0x2079, 0x4e00, 0x70ec, 0xa084, 0x1c00, 0x78e2, 0x1078, 171 0x4f40, 0x2079, 0x4f00, 0x70ec, 0xa084, 0x1c00, 0x78e2, 0x1078,
172 0x4cdd, 0x007f, 0x0f7f, 0x0e7f, 0x0d7f, 0x127f, 0x107f, 0x007c, 172 0x4db0, 0x007f, 0x0f7f, 0x0e7f, 0x0d7f, 0x127f, 0x107f, 0x007c,
173 0x3c00, 0xa084, 0x0007, 0x0079, 0x13cd, 0x13de, 0x13de, 0x13e0, 173 0x3c00, 0xa084, 0x0007, 0x0079, 0x13cd, 0x13de, 0x13de, 0x13e0,
174 0x13e0, 0x13e5, 0x13e5, 0x13ea, 0x13ea, 0x3c00, 0xa084, 0x0003, 174 0x13e0, 0x13e5, 0x13e5, 0x13ea, 0x13ea, 0x3c00, 0xa084, 0x0003,
175 0x0079, 0x13da, 0x13de, 0x13de, 0x13f3, 0x13f3, 0x1078, 0x296b, 175 0x0079, 0x13da, 0x13de, 0x13de, 0x13f3, 0x13f3, 0x1078, 0x29b2,
176 0x2091, 0x2200, 0x1078, 0x4768, 0x007c, 0x2091, 0x2100, 0x1078, 176 0x2091, 0x2200, 0x1078, 0x47ec, 0x007c, 0x2091, 0x2100, 0x1078,
177 0x4768, 0x007c, 0x2091, 0x2100, 0x1078, 0x4768, 0x2091, 0x2200, 177 0x47ec, 0x007c, 0x2091, 0x2100, 0x1078, 0x47ec, 0x2091, 0x2200,
178 0x1078, 0x4768, 0x007c, 0x2091, 0x2100, 0x1078, 0x4768, 0x007c, 178 0x1078, 0x47ec, 0x007c, 0x2091, 0x2100, 0x1078, 0x47ec, 0x007c,
179 0x1418, 0x1418, 0x141a, 0x141a, 0x1427, 0x1427, 0x1427, 0x1427, 179 0x1418, 0x1418, 0x141a, 0x141a, 0x1427, 0x1427, 0x1427, 0x1427,
180 0x1432, 0x1432, 0x143f, 0x143f, 0x1427, 0x1427, 0x1427, 0x1427, 180 0x1432, 0x1432, 0x143f, 0x143f, 0x1427, 0x1427, 0x1427, 0x1427,
181 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 181 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450,
182 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 182 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450, 0x1450,
183 0x0078, 0x1418, 0x007e, 0x107e, 0x127e, 0x2091, 0x2400, 0x1078, 183 0x0078, 0x1418, 0x007e, 0x107e, 0x127e, 0x2091, 0x2400, 0x1078,
184 0x298a, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, 0x007e, 184 0x29d1, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, 0x007e,
185 0x107e, 0x127e, 0x1078, 0x13c8, 0x127f, 0x107f, 0x007f, 0x2091, 185 0x107e, 0x127e, 0x1078, 0x13c8, 0x127f, 0x107f, 0x007f, 0x2091,
186 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x2091, 0x2300, 0x1078, 186 0x8001, 0x007c, 0x007e, 0x107e, 0x127e, 0x2091, 0x2300, 0x1078,
187 0x298a, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, 0x007e, 187 0x29d1, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, 0x007e,
188 0x107e, 0x127e, 0x2091, 0x2300, 0x1078, 0x298a, 0x2091, 0x2400, 188 0x107e, 0x127e, 0x2091, 0x2300, 0x1078, 0x29d1, 0x2091, 0x2400,
189 0x1078, 0x298a, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c, 189 0x1078, 0x29d1, 0x127f, 0x107f, 0x007f, 0x2091, 0x8001, 0x007c,
190 0x007e, 0x107e, 0x127e, 0x0d7e, 0x0e7e, 0x0f7e, 0x2079, 0x4e00, 190 0x007e, 0x107e, 0x127e, 0x0d7e, 0x0e7e, 0x0f7e, 0x2079, 0x4f00,
191 0x2071, 0x0200, 0x2069, 0x4e40, 0x3d00, 0xd08c, 0x0040, 0x1466, 191 0x2071, 0x0200, 0x2069, 0x4f40, 0x3d00, 0xd08c, 0x0040, 0x1466,
192 0x70ec, 0xa084, 0x1c00, 0x78e2, 0x1078, 0x4cdd, 0x3d00, 0xd084, 192 0x70ec, 0xa084, 0x1c00, 0x78e2, 0x1078, 0x4db0, 0x3d00, 0xd084,
193 0x0040, 0x1474, 0x2069, 0x4e80, 0x2071, 0x0100, 0x70ec, 0xa084, 193 0x0040, 0x1474, 0x2069, 0x4f80, 0x2071, 0x0100, 0x70ec, 0xa084,
194 0x1c00, 0x78e6, 0x1078, 0x4cdd, 0x0f7f, 0x0e7f, 0x0d7f, 0x127f, 194 0x1c00, 0x78e6, 0x1078, 0x4db0, 0x0f7f, 0x0e7f, 0x0d7f, 0x127f,
195 0x107f, 0x007f, 0x007c, 0x7008, 0x800b, 0x00c8, 0x1489, 0x7007, 195 0x107f, 0x007f, 0x007c, 0x7008, 0x800b, 0x00c8, 0x1489, 0x7007,
196 0x0002, 0xa08c, 0x01e0, 0x00c0, 0x148a, 0xd09c, 0x0040, 0x1489, 196 0x0002, 0xa08c, 0x01e0, 0x00c0, 0x148a, 0xd09c, 0x0040, 0x1489,
197 0x087a, 0x097a, 0x70c3, 0x4002, 0x0078, 0x15bd, 0x0068, 0x1513, 197 0x087a, 0x097a, 0x70c3, 0x4002, 0x0078, 0x15c4, 0x0068, 0x151a,
198 0x2061, 0x0000, 0x6018, 0xd084, 0x00c0, 0x1513, 0x7828, 0xa005, 198 0x2061, 0x0000, 0x6018, 0xd084, 0x00c0, 0x151a, 0x7828, 0xa005,
199 0x00c0, 0x149e, 0x0010, 0x1514, 0x0078, 0x1513, 0x7910, 0xd1f4, 199 0x00c0, 0x149e, 0x0010, 0x151b, 0x0078, 0x151a, 0x7910, 0xd1f4,
200 0x0040, 0x14a6, 0x2001, 0x4007, 0x0078, 0x15bc, 0x7914, 0xd1ec, 200 0x0040, 0x14a4, 0x0078, 0x14b9, 0x7914, 0xd1ec, 0x0040, 0x14bd,
201 0x0040, 0x14c1, 0xd0fc, 0x0040, 0x14b7, 0x007e, 0x1078, 0x1d64, 201 0xd0fc, 0x0040, 0x14b3, 0x007e, 0x1078, 0x1dae, 0x007f, 0x0040,
202 0x007f, 0x0040, 0x14c1, 0x2001, 0x4007, 0x0078, 0x15bc, 0x007e, 202 0x14bd, 0x0078, 0x14b9, 0x007e, 0x1078, 0x1da1, 0x007f, 0x0040,
203 0x1078, 0x1d54, 0x007f, 0x0040, 0x14c1, 0x2001, 0x4007, 0x0078, 203 0x14bd, 0x2001, 0x4007, 0x0078, 0x15c3, 0x7910, 0xd0fc, 0x00c0,
204 0x15bc, 0x7910, 0xd0fc, 0x00c0, 0x14cb, 0x2061, 0x4e40, 0xc19c, 204 0x14c7, 0x2061, 0x4f40, 0xc19c, 0xc7fc, 0x0078, 0x14cb, 0x2061,
205 0xc7fc, 0x0078, 0x14cf, 0x2061, 0x4e80, 0xc19d, 0xc7fd, 0x6064, 205 0x4f80, 0xc19d, 0xc7fd, 0x6064, 0xa005, 0x00c0, 0x151a, 0x7912,
206 0xa005, 0x00c0, 0x1513, 0x7912, 0x6083, 0x0000, 0x7828, 0xc0fc, 206 0x6082, 0x7828, 0xc0fc, 0xa086, 0x0018, 0x00c0, 0x14db, 0x0c7e,
207 0xa086, 0x0018, 0x00c0, 0x14e0, 0x0c7e, 0x1078, 0x1b5b, 0x0c7f, 207 0x1078, 0x1b85, 0x0c7f, 0x782b, 0x0000, 0x607c, 0xa065, 0x0040,
208 0x782b, 0x0000, 0x607c, 0xa065, 0x0040, 0x14f9, 0x0c7e, 0x609c, 208 0x1500, 0x0c7e, 0x609c, 0x1078, 0x1e90, 0x0c7f, 0x609f, 0x0000,
209 0x1078, 0x1e49, 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1c84, 0x2009, 209 0x1078, 0x1cd5, 0x2009, 0x0018, 0x6087, 0x0103, 0x7810, 0x007e,
210 0x0018, 0x6087, 0x0103, 0x1078, 0x1d74, 0x00c0, 0x150d, 0x1078, 210 0x84ff, 0x00c0, 0x14f6, 0x85ff, 0x0040, 0x14f8, 0xc0c5, 0x7812,
211 0x1dc6, 0x7810, 0xd09c, 0x00c0, 0x1501, 0x2061, 0x4e40, 0x0078, 211 0x1078, 0x1dbb, 0x007f, 0x7812, 0x00c0, 0x1514, 0x1078, 0x1e0d,
212 0x1505, 0x2061, 0x4e80, 0xc09c, 0x7812, 0x607f, 0x0000, 0x60d4, 212 0x7810, 0xd09c, 0x00c0, 0x1508, 0x2061, 0x4f40, 0x0078, 0x150c,
213 0xd0dc, 0x0040, 0x1511, 0xc0dc, 0x60d6, 0x2001, 0x4005, 0x0078, 213 0x2061, 0x4f80, 0xc09c, 0x7812, 0x607f, 0x0000, 0x60d4, 0xd0dc,
214 0x15bc, 0x0078, 0x15ba, 0x007c, 0x7810, 0xd0f4, 0x0040, 0x151c, 214 0x0040, 0x1518, 0xc0dc, 0x60d6, 0x2001, 0x4005, 0x0078, 0x15c3,
215 0x2001, 0x4007, 0x0078, 0x15bc, 0xa006, 0x70c2, 0x70c6, 0x70ca, 215 0x0078, 0x15c1, 0x007c, 0x7810, 0xd0f4, 0x0040, 0x1523, 0x2001,
216 0x70ce, 0x70da, 0x70c0, 0xa03d, 0xa08a, 0x0040, 0x00c8, 0x152a, 216 0x4007, 0x0078, 0x15c3, 0xa006, 0x70c2, 0x70c6, 0x70ca, 0x70ce,
217 0x0079, 0x1531, 0x2100, 0xa08a, 0x0040, 0x00c8, 0x15c8, 0x0079, 217 0x70da, 0x70c0, 0xa03d, 0xa08a, 0x0040, 0x00c8, 0x1531, 0x0079,
218 0x1571, 0x15ba, 0x1610, 0x15d9, 0x1648, 0x1680, 0x1680, 0x15d0, 218 0x1538, 0x2100, 0xa08a, 0x0040, 0x00c8, 0x15cf, 0x0079, 0x1578,
219 0x1c9c, 0x168b, 0x15c8, 0x15dd, 0x15df, 0x15e1, 0x15e3, 0x1ca1, 219 0x15c1, 0x1617, 0x15e0, 0x164f, 0x1687, 0x1687, 0x15d7, 0x1ced,
220 0x15c8, 0x1699, 0x16f6, 0x1b7b, 0x1c96, 0x15e5, 0x19c0, 0x1a02, 220 0x1692, 0x15cf, 0x15e4, 0x15e6, 0x15e8, 0x15ea, 0x1cf2, 0x15cf,
221 0x1a3d, 0x1a8e, 0x197b, 0x1988, 0x199c, 0x19af, 0x17cb, 0x15c8, 221 0x16a0, 0x16fd, 0x1ba5, 0x1ce7, 0x15ec, 0x19ea, 0x1a2c, 0x1a67,
222 0x172d, 0x173a, 0x1746, 0x1752, 0x1768, 0x1774, 0x1777, 0x1783, 222 0x1ab8, 0x19a5, 0x19b2, 0x19c6, 0x19d9, 0x17eb, 0x15cf, 0x1734,
223 0x178f, 0x1797, 0x17b3, 0x17bf, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 223 0x1741, 0x174d, 0x1759, 0x176f, 0x177b, 0x177e, 0x178a, 0x1796,
224 0x17d8, 0x17ea, 0x1806, 0x183c, 0x1864, 0x1874, 0x1877, 0x18a8, 224 0x179e, 0x17d3, 0x17df, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x17f8,
225 0x18d9, 0x18eb, 0x194a, 0x195a, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 225 0x180a, 0x1826, 0x185c, 0x1884, 0x1894, 0x1897, 0x18c8, 0x18f9,
226 0x196a, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x1cc6, 0x1ccc, 226 0x190b, 0x1974, 0x1984, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x1994,
227 0x15c8, 0x15c8, 0x15c8, 0x1cd0, 0x1d15, 0x15c8, 0x15c8, 0x15c8, 227 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x1d17, 0x1d1d, 0x15cf,
228 0x15c8, 0x160a, 0x167a, 0x1693, 0x16f0, 0x1b75, 0x15c8, 0x15c8, 228 0x15cf, 0x15cf, 0x1d21, 0x1d66, 0x15cf, 0x15cf, 0x15cf, 0x15cf,
229 0x1b3e, 0x15c8, 0x1d19, 0x1cb8, 0x1cc2, 0x15c8, 0x15c8, 0x15c8, 229 0x1611, 0x1681, 0x169a, 0x16f7, 0x1b9f, 0x15cf, 0x15cf, 0x1b68,
230 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 230 0x15cf, 0x1d6a, 0x1d09, 0x1d13, 0x15cf, 0x15cf, 0x15cf, 0x15cf,
231 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 231 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf,
232 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 232 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf,
233 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 0x15c8, 233 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf,
234 0x15c8, 0x72ca, 0x71c6, 0x2001, 0x4006, 0x0078, 0x15bc, 0x73ce, 234 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf, 0x15cf,
235 0x72ca, 0x71c6, 0x2001, 0x4000, 0x70c2, 0x0068, 0x15bd, 0x2061, 235 0x72ca, 0x71c6, 0x2001, 0x4006, 0x0078, 0x15c3, 0x73ce, 0x72ca,
236 0x0000, 0x601b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x007c, 236 0x71c6, 0x2001, 0x4000, 0x70c2, 0x0068, 0x15c4, 0x2061, 0x0000,
237 0x70c3, 0x4001, 0x0078, 0x15bd, 0x70c3, 0x4006, 0x0078, 0x15bd, 237 0x601b, 0x0001, 0x2091, 0x5000, 0x2091, 0x4080, 0x007c, 0x70c3,
238 0x2099, 0x0041, 0x20a1, 0x0041, 0x20a9, 0x0005, 0x53a3, 0x0078, 238 0x4001, 0x0078, 0x15c4, 0x70c3, 0x4006, 0x0078, 0x15c4, 0x2099,
239 0x15ba, 0x70c4, 0x70c3, 0x0004, 0x007a, 0x0078, 0x15ba, 0x0078, 239 0x0041, 0x20a1, 0x0041, 0x20a9, 0x0005, 0x53a3, 0x0078, 0x15c1,
240 0x15ba, 0x0078, 0x15ba, 0x0078, 0x15ba, 0x2091, 0x8000, 0x70c3, 240 0x70c4, 0x70c3, 0x0004, 0x007a, 0x0078, 0x15c1, 0x0078, 0x15c1,
241 0x0004, 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 241 0x0078, 0x15c1, 0x0078, 0x15c1, 0x2091, 0x8000, 0x70c3, 0x0004,
242 0x0008, 0x2001, 0x000f, 0x70d6, 0x2079, 0x0000, 0x781b, 0x0001, 242 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 0x0008,
243 0x2031, 0x0030, 0x2059, 0x1000, 0x2029, 0x041a, 0x2051, 0x0445, 243 0x2001, 0x000f, 0x70d6, 0x2079, 0x0000, 0x781b, 0x0001, 0x2031,
244 0x2061, 0x0447, 0x20c1, 0x0020, 0x2091, 0x5000, 0x2091, 0x4080, 244 0x0030, 0x2059, 0x1000, 0x2029, 0x041a, 0x2051, 0x0445, 0x2061,
245 0x0078, 0x0418, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x1613, 245 0x0447, 0x20c1, 0x0020, 0x2091, 0x5000, 0x2091, 0x4080, 0x0078,
246 0x2029, 0x0000, 0x2520, 0x71d0, 0x72c8, 0x73cc, 0x70c4, 0x20a0, 246 0x0418, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x161a, 0x2029,
247 0x2099, 0x0030, 0x7003, 0x0001, 0x7007, 0x0006, 0x731a, 0x721e, 247 0x0000, 0x2520, 0x71d0, 0x72c8, 0x73cc, 0x70c4, 0x20a0, 0x2099,
248 0x7422, 0x7526, 0x2021, 0x0040, 0x81ff, 0x0040, 0x15ba, 0xa182, 248 0x0030, 0x7003, 0x0001, 0x7007, 0x0006, 0x731a, 0x721e, 0x7422,
249 0x0040, 0x00c8, 0x162d, 0x2120, 0xa006, 0x2008, 0x8403, 0x7012, 249 0x7526, 0x2021, 0x0040, 0x81ff, 0x0040, 0x15c1, 0xa182, 0x0040,
250 0x7007, 0x0004, 0x7007, 0x0001, 0x7008, 0xd0fc, 0x0040, 0x1634, 250 0x00c8, 0x1634, 0x2120, 0xa006, 0x2008, 0x8403, 0x7012, 0x7007,
251 0x7007, 0x0002, 0xa084, 0x01e0, 0x0040, 0x1642, 0x70c3, 0x4002, 251 0x0004, 0x7007, 0x0001, 0x7008, 0xd0fc, 0x0040, 0x163b, 0x7007,
252 0x0078, 0x15bd, 0x24a8, 0x53a5, 0x0078, 0x1624, 0x0078, 0x15ba, 252 0x0002, 0xa084, 0x01e0, 0x0040, 0x1649, 0x70c3, 0x4002, 0x0078,
253 0x2029, 0x0000, 0x2520, 0x71d0, 0x72c8, 0x73cc, 0x70c4, 0x2098, 253 0x15c4, 0x24a8, 0x53a5, 0x0078, 0x162b, 0x0078, 0x15c1, 0x2029,
254 0x20a1, 0x0030, 0x7003, 0x0000, 0x7007, 0x0006, 0x731a, 0x721e, 254 0x0000, 0x2520, 0x71d0, 0x72c8, 0x73cc, 0x70c4, 0x2098, 0x20a1,
255 0x7422, 0x7526, 0x2021, 0x0040, 0x7007, 0x0006, 0x81ff, 0x0040, 255 0x0030, 0x7003, 0x0000, 0x7007, 0x0006, 0x731a, 0x721e, 0x7422,
256 0x15ba, 0xa182, 0x0040, 0x00c8, 0x1667, 0x2120, 0xa006, 0x2008, 256 0x7526, 0x2021, 0x0040, 0x7007, 0x0006, 0x81ff, 0x0040, 0x15c1,
257 0x8403, 0x7012, 0x24a8, 0x53a6, 0x7007, 0x0001, 0x7008, 0xd0fc, 257 0xa182, 0x0040, 0x00c8, 0x166e, 0x2120, 0xa006, 0x2008, 0x8403,
258 0x0040, 0x166e, 0xa084, 0x01e0, 0x0040, 0x165c, 0x70c3, 0x4002, 258 0x7012, 0x24a8, 0x53a6, 0x7007, 0x0001, 0x7008, 0xd0fc, 0x0040,
259 0x0078, 0x15bd, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x164b, 259 0x1675, 0xa084, 0x01e0, 0x0040, 0x1663, 0x70c3, 0x4002, 0x0078,
260 0x71c4, 0x70c8, 0x2114, 0xa79e, 0x0004, 0x00c0, 0x1688, 0x200a, 260 0x15c4, 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x1652, 0x71c4,
261 0x72ca, 0x0078, 0x15b9, 0x70c7, 0x0008, 0x70cb, 0x000f, 0x70cf, 261 0x70c8, 0x2114, 0xa79e, 0x0004, 0x00c0, 0x168f, 0x200a, 0x72ca,
262 0x0000, 0x0078, 0x15ba, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078, 262 0x0078, 0x15c0, 0x70c7, 0x0008, 0x70cb, 0x000f, 0x70cf, 0x000b,
263 0x169c, 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d0, 263 0x0078, 0x15c1, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078, 0x16a3,
264 0x70c6, 0x72ca, 0x73ce, 0x74d2, 0xa005, 0x0040, 0x16eb, 0xa40a, 264 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d0, 0x70c6,
265 0x0040, 0x16ac, 0x00c8, 0x16b5, 0x8001, 0x7872, 0xa084, 0xfc00, 265 0x72ca, 0x73ce, 0x74d2, 0xa005, 0x0040, 0x16f2, 0xa40a, 0x0040,
266 0x0040, 0x16b9, 0x78ac, 0xc085, 0x78ae, 0x2001, 0x4005, 0x0078, 266 0x16b3, 0x00c8, 0x16bc, 0x8001, 0x7872, 0xa084, 0xfc00, 0x0040,
267 0x15bc, 0x7b7e, 0x7a7a, 0x7e86, 0x7d82, 0x7c76, 0xa48c, 0xff00, 267 0x16c0, 0x78ac, 0xc085, 0x78ae, 0x2001, 0x4005, 0x0078, 0x15c3,
268 0x0040, 0x16d1, 0x8407, 0x8004, 0x8004, 0x810c, 0x810c, 0x810f, 268 0x7b7e, 0x7a7a, 0x7e86, 0x7d82, 0x7c76, 0xa48c, 0xff00, 0x0040,
269 0xa118, 0xa291, 0x0000, 0xa6b1, 0x0000, 0xa581, 0x0000, 0x0078, 269 0x16d8, 0x8407, 0x8004, 0x8004, 0x810c, 0x810c, 0x810f, 0xa118,
270 0x16db, 0x8407, 0x8004, 0x8004, 0xa318, 0xa291, 0x0000, 0xa6b1, 270 0xa291, 0x0000, 0xa6b1, 0x0000, 0xa581, 0x0000, 0x0078, 0x16e2,
271 0x0000, 0xa581, 0x0000, 0x731a, 0x721e, 0x7622, 0x7026, 0xa605, 271 0x8407, 0x8004, 0x8004, 0xa318, 0xa291, 0x0000, 0xa6b1, 0x0000,
272 0x0040, 0x16e5, 0x7a10, 0xc2c5, 0x7a12, 0x78ac, 0xa084, 0xfffc, 272 0xa581, 0x0000, 0x731a, 0x721e, 0x7622, 0x7026, 0xa605, 0x0040,
273 0x78ae, 0x0078, 0x16ee, 0x78ac, 0xc085, 0x78ae, 0x0078, 0x15ba, 273 0x16ec, 0x7a10, 0xc2c5, 0x7a12, 0x78ac, 0xa084, 0xfffc, 0x78ae,
274 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078, 0x16f9, 0x2029, 0x0000, 274 0x0078, 0x16f5, 0x78ac, 0xc085, 0x78ae, 0x0078, 0x15c1, 0x75d8,
275 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d4, 0x70c6, 0x72ca, 0x73ce, 275 0x76dc, 0x75da, 0x76de, 0x0078, 0x1700, 0x2029, 0x0000, 0x2530,
276 0x74d6, 0xa005, 0x0040, 0x1728, 0xa40a, 0x0040, 0x1709, 0x00c8, 276 0x70c4, 0x72c8, 0x73cc, 0x74d4, 0x70c6, 0x72ca, 0x73ce, 0x74d6,
277 0x15bc, 0x8001, 0x7892, 0xa084, 0xfc00, 0x0040, 0x1716, 0x78ac, 277 0xa005, 0x0040, 0x172f, 0xa40a, 0x0040, 0x1710, 0x00c8, 0x1719,
278 0xc0c5, 0x78ae, 0x2001, 0x4005, 0x0078, 0x15bc, 0x7a9a, 0x7b9e, 278 0x8001, 0x7892, 0xa084, 0xfc00, 0x0040, 0x171d, 0x78ac, 0xc0c5,
279 0x7da2, 0x7ea6, 0x2600, 0xa505, 0x0040, 0x1721, 0x7a10, 0xc2c5, 279 0x78ae, 0x2001, 0x4005, 0x0078, 0x15c3, 0x7a9a, 0x7b9e, 0x7da2,
280 0x7a12, 0x7c96, 0x78ac, 0xa084, 0xfcff, 0x78ae, 0x0078, 0x172b, 280 0x7ea6, 0x2600, 0xa505, 0x0040, 0x1728, 0x7a10, 0xc2c5, 0x7a12,
281 0x78ac, 0xc0c5, 0x78ae, 0x0078, 0x15ba, 0x2009, 0x0000, 0x786c, 281 0x7c96, 0x78ac, 0xa084, 0xfcff, 0x78ae, 0x0078, 0x1732, 0x78ac,
282 0xa065, 0x0040, 0x1737, 0x8108, 0x6000, 0x0078, 0x1730, 0x7ac4, 282 0xc0c5, 0x78ae, 0x0078, 0x15c1, 0x2009, 0x0000, 0x786c, 0xa065,
283 0x0078, 0x15b8, 0x2009, 0x4e48, 0x210c, 0x7810, 0xd0ec, 0x00c0, 283 0x0040, 0x173e, 0x8108, 0x6000, 0x0078, 0x1737, 0x7ac4, 0x0078,
284 0x15b9, 0x2011, 0x4e88, 0x2214, 0x0078, 0x15b8, 0x2009, 0x4e49, 284 0x15bf, 0x2009, 0x4f48, 0x210c, 0x7810, 0xd0ec, 0x00c0, 0x15c0,
285 0x210c, 0x7810, 0xd0ec, 0x00c0, 0x15b9, 0x2011, 0x4e89, 0x2214, 285 0x2011, 0x4f88, 0x2214, 0x0078, 0x15bf, 0x2009, 0x4f49, 0x210c,
286 0x0078, 0x15b8, 0x2061, 0x4e40, 0x6128, 0x622c, 0x8214, 0x8214, 286 0x7810, 0xd0ec, 0x00c0, 0x15c0, 0x2011, 0x4f89, 0x2214, 0x0078,
287 0x8214, 0x7810, 0xd0ec, 0x00c0, 0x1766, 0x2061, 0x4e80, 0x6328, 287 0x15bf, 0x2061, 0x4f40, 0x6128, 0x622c, 0x8214, 0x8214, 0x8214,
288 0x73da, 0x632c, 0x831c, 0x831c, 0x831c, 0x73de, 0x0078, 0x15b8, 288 0x7810, 0xd0ec, 0x00c0, 0x176d, 0x2061, 0x4f80, 0x6328, 0x73da,
289 0x2009, 0x4e4c, 0x210c, 0x7810, 0xd0ec, 0x00c0, 0x15b9, 0x2011, 289 0x632c, 0x831c, 0x831c, 0x831c, 0x73de, 0x0078, 0x15bf, 0x2009,
290 0x4e8c, 0x2214, 0x0078, 0x15b8, 0x7918, 0x0078, 0x15b9, 0x2009, 290 0x4f4c, 0x210c, 0x7810, 0xd0ec, 0x00c0, 0x15c0, 0x2011, 0x4f8c,
291 0x4e4d, 0x210c, 0x7810, 0xd0ec, 0x00c0, 0x15b9, 0x2011, 0x4e8d, 291 0x2214, 0x0078, 0x15bf, 0x7918, 0x0078, 0x15c0, 0x2009, 0x4f4d,
292 0x2214, 0x0078, 0x15b8, 0x2009, 0x4e4e, 0x210c, 0x7810, 0xd0ec, 292 0x210c, 0x7810, 0xd0ec, 0x00c0, 0x15c0, 0x2011, 0x4f8d, 0x2214,
293 0x00c0, 0x15b9, 0x2011, 0x4e8e, 0x2214, 0x0078, 0x15b8, 0x7920, 293 0x0078, 0x15bf, 0x2009, 0x4f4e, 0x210c, 0x7810, 0xd0ec, 0x00c0,
294 0x7810, 0xd0ec, 0x00c0, 0x15b9, 0x7a24, 0x0078, 0x15b8, 0x71c4, 294 0x15c0, 0x2011, 0x4f8e, 0x2214, 0x0078, 0x15bf, 0x7920, 0x7810,
295 0xd1fc, 0x00c0, 0x179f, 0x2011, 0x52c0, 0x0078, 0x17a1, 0x2011, 295 0xd0ec, 0x00c0, 0x15c0, 0x7a24, 0x0078, 0x15bf, 0x71c4, 0xd1fc,
296 0x5340, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa268, 296 0x00c0, 0x17a6, 0x2011, 0x53c0, 0x0078, 0x17a8, 0x2011, 0x5440,
297 0x6a00, 0x6804, 0xd09c, 0x0040, 0x17b0, 0x6b08, 0x0078, 0x17b1, 297 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa268, 0x6a00,
298 0x6b0c, 0x0078, 0x15b7, 0x77c4, 0x1078, 0x1de4, 0x2091, 0x8000, 298 0x6804, 0xd09c, 0x0040, 0x17b7, 0x6b08, 0x0078, 0x17b8, 0x6b0c,
299 0x6b1c, 0x6a14, 0x2091, 0x8001, 0x2708, 0x0078, 0x15b7, 0x2061, 299 0xd1fc, 0x00c0, 0x17bf, 0x2021, 0x023b, 0x0078, 0x17c1, 0x2021,
300 0x4e40, 0x6118, 0x7810, 0xd0ec, 0x00c0, 0x15b9, 0x2061, 0x4e80, 300 0x013b, 0x2424, 0x7914, 0xd1e4, 0x0040, 0x17cd, 0xd4c4, 0x00c0,
301 0x6218, 0x0078, 0x15b8, 0x77c4, 0x1078, 0x1de4, 0x2091, 0x8000, 301 0x17cc, 0xc4d5, 0x0078, 0x17cd, 0xc4dd, 0xa4a4, 0x1c00, 0x74de,
302 0x6908, 0x6a18, 0x6b10, 0x77da, 0x2091, 0x8001, 0x0078, 0x15b7, 302 0x71c4, 0x0078, 0x15be, 0x77c4, 0x1078, 0x1e2b, 0x2091, 0x8000,
303 0x71c4, 0x2110, 0xa294, 0x000f, 0xa282, 0x0010, 0x00c8, 0x15b2, 303 0x6b1c, 0x6a14, 0x2091, 0x8001, 0x2708, 0x0078, 0x15be, 0x2061,
304 0x1078, 0x277f, 0xa384, 0x4000, 0x0040, 0x17e8, 0xa295, 0x0020, 304 0x4f40, 0x6118, 0x7810, 0xd0ec, 0x00c0, 0x15c0, 0x2061, 0x4f80,
305 0x0078, 0x15b7, 0x71c4, 0x2100, 0xc0bc, 0xa082, 0x0010, 0x00c8, 305 0x6218, 0x0078, 0x15bf, 0x77c4, 0x1078, 0x1e2b, 0x2091, 0x8000,
306 0x15b2, 0xd1bc, 0x00c0, 0x17f9, 0x2011, 0x4e48, 0x2204, 0x0078, 306 0x6908, 0x6a18, 0x6b10, 0x77da, 0x2091, 0x8001, 0x0078, 0x15be,
307 0x17fd, 0x2011, 0x4e88, 0x2204, 0xc0bd, 0x007e, 0x2100, 0xc0bc, 307 0x71c4, 0x2110, 0xa294, 0x000f, 0xa282, 0x0010, 0x00c8, 0x15b9,
308 0x2012, 0x1078, 0x26dc, 0x017f, 0x0078, 0x15b9, 0x71c4, 0x2021, 308 0x1078, 0x27c6, 0xa384, 0x4000, 0x0040, 0x1808, 0xa295, 0x0020,
309 0x4e49, 0x2404, 0x70c6, 0x2019, 0x0000, 0x0078, 0x1815, 0x71c8, 309 0x0078, 0x15be, 0x71c4, 0x2100, 0xc0bc, 0xa082, 0x0010, 0x00c8,
310 0x2021, 0x4e89, 0x2404, 0x70ca, 0xc3fd, 0x2011, 0x1834, 0x20a9, 310 0x15b9, 0xd1bc, 0x00c0, 0x1819, 0x2011, 0x4f48, 0x2204, 0x0078,
311 0x0008, 0x2204, 0xa106, 0x0040, 0x1824, 0x8210, 0x00f0, 0x1819, 311 0x181d, 0x2011, 0x4f88, 0x2204, 0xc0bd, 0x007e, 0x2100, 0xc0bc,
312 0x71c4, 0x72c8, 0x0078, 0x15b1, 0xa292, 0x1834, 0x027e, 0x2122, 312 0x2012, 0x1078, 0x2723, 0x017f, 0x0078, 0x15c0, 0x71c4, 0x2021,
313 0x017f, 0x1078, 0x26fd, 0x7810, 0xd0ec, 0x00c0, 0x1832, 0xd3fc, 313 0x4f49, 0x2404, 0x70c6, 0x2019, 0x0000, 0x0078, 0x1835, 0x71c8,
314 0x0040, 0x180f, 0x0078, 0x15ba, 0x03e8, 0x00fa, 0x01f4, 0x02ee, 314 0x2021, 0x4f89, 0x2404, 0x70ca, 0xc3fd, 0x2011, 0x1854, 0x20a9,
315 0x0004, 0x0001, 0x0002, 0x0003, 0x2061, 0x4e40, 0x6128, 0x622c, 315 0x0008, 0x2204, 0xa106, 0x0040, 0x1844, 0x8210, 0x00f0, 0x1839,
316 0x71c4, 0x72c8, 0x0078, 0x15b8, 0xa292, 0x1854, 0x027e, 0x2122,
317 0x017f, 0x1078, 0x2744, 0x7810, 0xd0ec, 0x00c0, 0x1852, 0xd3fc,
318 0x0040, 0x182f, 0x0078, 0x15c1, 0x03e8, 0x00fa, 0x01f4, 0x02ee,
319 0x0004, 0x0001, 0x0002, 0x0003, 0x2061, 0x4f40, 0x6128, 0x622c,
316 0x8214, 0x8214, 0x8214, 0x70c4, 0x602a, 0x70c8, 0x8003, 0x8003, 320 0x8214, 0x8214, 0x8214, 0x70c4, 0x602a, 0x70c8, 0x8003, 0x8003,
317 0x8003, 0x602e, 0x7810, 0xd0ec, 0x00c0, 0x1862, 0x027e, 0x017e, 321 0x8003, 0x602e, 0x7810, 0xd0ec, 0x00c0, 0x1882, 0x027e, 0x017e,
318 0x2061, 0x4e80, 0x6128, 0x622c, 0x8214, 0x8214, 0x8214, 0x70d8, 322 0x2061, 0x4f80, 0x6128, 0x622c, 0x8214, 0x8214, 0x8214, 0x70d8,
319 0x602a, 0x70dc, 0x8003, 0x8003, 0x8003, 0x602e, 0x71da, 0x72de, 323 0x602a, 0x70dc, 0x8003, 0x8003, 0x8003, 0x602e, 0x71da, 0x72de,
320 0x017f, 0x027f, 0x0078, 0x15b8, 0x2061, 0x4e40, 0x6130, 0x70c4, 324 0x017f, 0x027f, 0x0078, 0x15bf, 0x2061, 0x4f40, 0x6130, 0x70c4,
321 0x6032, 0x7810, 0xd0ec, 0x00c0, 0x15b9, 0x2061, 0x4e80, 0x6230, 325 0x6032, 0x7810, 0xd0ec, 0x00c0, 0x15c0, 0x2061, 0x4f80, 0x6230,
322 0x70c8, 0x6032, 0x0078, 0x15b8, 0x7918, 0x0078, 0x15b9, 0x71c4, 326 0x70c8, 0x6032, 0x0078, 0x15bf, 0x7918, 0x0078, 0x15c0, 0x71c4,
323 0xa184, 0xffcf, 0x0040, 0x1883, 0x7810, 0xd0ec, 0x00c0, 0x15b2, 327 0xa184, 0xffcf, 0x0040, 0x18a3, 0x7810, 0xd0ec, 0x00c0, 0x15b9,
324 0x72c8, 0x0078, 0x15b1, 0x2011, 0x4e4d, 0x2204, 0x2112, 0x007e, 328 0x72c8, 0x0078, 0x15b8, 0x2011, 0x4f4d, 0x2204, 0x2112, 0x007e,
325 0x2019, 0x0000, 0x1078, 0x2764, 0x7810, 0xd0ec, 0x0040, 0x1893, 329 0x2019, 0x0000, 0x1078, 0x27ab, 0x7810, 0xd0ec, 0x0040, 0x18b3,
326 0x017f, 0x0078, 0x15b9, 0x71c8, 0xa184, 0xffcf, 0x0040, 0x189c, 330 0x017f, 0x0078, 0x15c0, 0x71c8, 0xa184, 0xffcf, 0x0040, 0x18bc,
327 0x2110, 0x71c4, 0x0078, 0x15b1, 0x2011, 0x4e8d, 0x2204, 0x2112, 331 0x2110, 0x71c4, 0x0078, 0x15b8, 0x2011, 0x4f8d, 0x2204, 0x2112,
328 0x007e, 0xc3fd, 0x1078, 0x2764, 0x027f, 0x017f, 0x0078, 0x15b8, 332 0x007e, 0xc3fd, 0x1078, 0x27ab, 0x027f, 0x017f, 0x0078, 0x15bf,
329 0x71c4, 0xa182, 0x0010, 0x0048, 0x18b4, 0x7810, 0xd0ec, 0x00c0, 333 0x71c4, 0xa182, 0x0010, 0x0048, 0x18d4, 0x7810, 0xd0ec, 0x00c0,
330 0x15b2, 0x72c8, 0x0078, 0x15b1, 0x2011, 0x4e4e, 0x2204, 0x007e, 334 0x15b9, 0x72c8, 0x0078, 0x15b8, 0x2011, 0x4f4e, 0x2204, 0x007e,
331 0x2112, 0x2019, 0x0000, 0x1078, 0x2742, 0x7810, 0xd0ec, 0x0040, 335 0x2112, 0x2019, 0x0000, 0x1078, 0x2789, 0x7810, 0xd0ec, 0x0040,
332 0x18c4, 0x017f, 0x0078, 0x15b9, 0x71c8, 0xa182, 0x0010, 0x0048, 336 0x18e4, 0x017f, 0x0078, 0x15c0, 0x71c8, 0xa182, 0x0010, 0x0048,
333 0x18cd, 0x2110, 0x71c4, 0x0078, 0x15b1, 0x2011, 0x4e8e, 0x2204, 337 0x18ed, 0x2110, 0x71c4, 0x0078, 0x15b8, 0x2011, 0x4f8e, 0x2204,
334 0x007e, 0x2112, 0xc3fd, 0x1078, 0x2742, 0x027f, 0x017f, 0x0078, 338 0x007e, 0x2112, 0xc3fd, 0x1078, 0x2789, 0x027f, 0x017f, 0x0078,
335 0x15b8, 0x71c4, 0x72c8, 0xa184, 0xfffd, 0x00c0, 0x15b1, 0xa284, 339 0x15bf, 0x71c4, 0x72c8, 0xa184, 0xfffd, 0x00c0, 0x15b8, 0xa284,
336 0xfffd, 0x00c0, 0x15b1, 0x2100, 0x7920, 0x7822, 0x2200, 0x7a24, 340 0xfffd, 0x00c0, 0x15b8, 0x2100, 0x7920, 0x7822, 0x2200, 0x7a24,
337 0x7826, 0x0078, 0x15b8, 0x71c4, 0xd1fc, 0x00c0, 0x18f3, 0x2011, 341 0x7826, 0x0078, 0x15bf, 0x71c4, 0xd1fc, 0x00c0, 0x1913, 0x2011,
338 0x52c0, 0x0078, 0x18f5, 0x2011, 0x5340, 0x8107, 0xa084, 0x000f, 342 0x53c0, 0x0078, 0x1915, 0x2011, 0x5440, 0x8107, 0xa084, 0x000f,
339 0x8003, 0x8003, 0x8003, 0xa268, 0x2019, 0x0000, 0x72c8, 0x2091, 343 0x8003, 0x8003, 0x8003, 0xa268, 0x2019, 0x0000, 0x72c8, 0xd2bc,
340 0x8000, 0x6800, 0x007e, 0xa226, 0x0040, 0x191e, 0x6a02, 0xd4ec, 344 0x0040, 0x1924, 0xa39d, 0x0010, 0xd2b4, 0x0040, 0x1929, 0xa39d,
341 0x0040, 0x190b, 0xc3a5, 0xd4e4, 0x0040, 0x190f, 0xc39d, 0xd4f4, 345 0x0008, 0x2091, 0x8000, 0x6800, 0x007e, 0xa226, 0x0040, 0x1948,
342 0x0040, 0x191e, 0x810f, 0xd2f4, 0x0040, 0x191a, 0x1078, 0x27c1, 346 0x6a02, 0xd4ec, 0x0040, 0x1935, 0xc3a5, 0xd4e4, 0x0040, 0x1939,
343 0x0078, 0x191e, 0x1078, 0x279f, 0x0078, 0x191e, 0x72cc, 0x6808, 347 0xc39d, 0xd4f4, 0x0040, 0x1948, 0x810f, 0xd2f4, 0x0040, 0x1944,
344 0xa206, 0x0040, 0x1940, 0xa2a4, 0x00ff, 0x7814, 0xd0e4, 0x00c0, 348 0x1078, 0x2808, 0x0078, 0x1948, 0x1078, 0x27e6, 0x0078, 0x1948,
345 0x1931, 0xa482, 0x0028, 0x0048, 0x193d, 0x0040, 0x193d, 0x0078, 349 0x72cc, 0x6808, 0xa206, 0x0040, 0x196a, 0xa2a4, 0x00ff, 0x7814,
346 0x1935, 0xa482, 0x0043, 0x0048, 0x193d, 0x71c4, 0x71c6, 0x027f, 350 0xd0e4, 0x00c0, 0x195b, 0xa482, 0x0028, 0x0048, 0x1967, 0x0040,
347 0x72ca, 0x2091, 0x8001, 0x0078, 0x15b3, 0x6a0a, 0xa39d, 0x000a, 351 0x1967, 0x0078, 0x195f, 0xa482, 0x0043, 0x0048, 0x1967, 0x71c4,
348 0x6804, 0xa305, 0x6806, 0x027f, 0x6b0c, 0x71c4, 0x2091, 0x8001, 352 0x71c6, 0x027f, 0x72ca, 0x2091, 0x8001, 0x0078, 0x15ba, 0x6a0a,
349 0x0078, 0x15b7, 0x77c4, 0x1078, 0x1de4, 0x2091, 0x8000, 0x6a14, 353 0xa39d, 0x000a, 0x6804, 0xa305, 0x6806, 0x027f, 0x6b0c, 0x71c4,
350 0x6b1c, 0x2091, 0x8001, 0x70c8, 0x6816, 0x70cc, 0x681e, 0x2708, 354 0x2091, 0x8001, 0x0078, 0x15be, 0x77c4, 0x1078, 0x1e2b, 0x2091,
351 0x0078, 0x15b7, 0x70c4, 0x2061, 0x4e40, 0x6118, 0x601a, 0x7810, 355 0x8000, 0x6a14, 0x6b1c, 0x2091, 0x8001, 0x70c8, 0x6816, 0x70cc,
352 0xd0ec, 0x00c0, 0x15b9, 0x70c8, 0x2061, 0x4e80, 0x6218, 0x601a, 356 0x681e, 0x2708, 0x0078, 0x15be, 0x70c4, 0x2061, 0x4f40, 0x6118,
353 0x0078, 0x15b8, 0x71c4, 0x72c8, 0x73cc, 0xa182, 0x0010, 0x00c8, 357 0x601a, 0x7810, 0xd0ec, 0x00c0, 0x15c0, 0x70c8, 0x2061, 0x4f80,
354 0x15b2, 0x1078, 0x27e3, 0xa384, 0x4000, 0x0040, 0x1979, 0xa295, 358 0x6218, 0x601a, 0x0078, 0x15bf, 0x71c4, 0x72c8, 0x73cc, 0xa182,
355 0x0020, 0x0078, 0x15b7, 0x77c4, 0x1078, 0x1de4, 0x2091, 0x8000, 359 0x0010, 0x00c8, 0x15b9, 0x1078, 0x282a, 0xa384, 0x4000, 0x0040,
356 0x6a08, 0xc28d, 0x6a0a, 0x2091, 0x8001, 0x2708, 0x0078, 0x15b8, 360 0x19a3, 0xa295, 0x0020, 0x0078, 0x15be, 0x77c4, 0x1078, 0x1e2b,
357 0x77c4, 0x1078, 0x1de4, 0x2091, 0x8000, 0x6a08, 0xa294, 0xfff9, 361 0x2091, 0x8000, 0x6a08, 0xc28d, 0x6a0a, 0x2091, 0x8001, 0x2708,
358 0x6a0a, 0x6804, 0xa005, 0x0040, 0x1997, 0x1078, 0x2628, 0x2091, 362 0x0078, 0x15bf, 0x77c4, 0x1078, 0x1e2b, 0x2091, 0x8000, 0x6a08,
359 0x8001, 0x2708, 0x0078, 0x15b8, 0x77c4, 0x1078, 0x1de4, 0x2091, 363 0xa294, 0xfff9, 0x6a0a, 0x6804, 0xa005, 0x0040, 0x19c1, 0x1078,
360 0x8000, 0x6a08, 0xc295, 0x6a0a, 0x6804, 0xa005, 0x0040, 0x19aa, 364 0x266f, 0x2091, 0x8001, 0x2708, 0x0078, 0x15bf, 0x77c4, 0x1078,
361 0x1078, 0x2628, 0x2091, 0x8001, 0x2708, 0x0078, 0x15b8, 0x77c4, 365 0x1e2b, 0x2091, 0x8000, 0x6a08, 0xc295, 0x6a0a, 0x6804, 0xa005,
362 0x2041, 0x0001, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 366 0x0040, 0x19d4, 0x1078, 0x266f, 0x2091, 0x8001, 0x2708, 0x0078,
363 0x1078, 0x1dff, 0x2091, 0x8001, 0x2708, 0x6a08, 0x0078, 0x15b8, 367 0x15bf, 0x77c4, 0x2041, 0x0001, 0x2049, 0x0005, 0x2051, 0x0020,
364 0x77c4, 0x7814, 0xd0e4, 0x00c0, 0x19d4, 0xd7fc, 0x0040, 0x19ce, 368 0x2091, 0x8000, 0x1078, 0x1e46, 0x2091, 0x8001, 0x2708, 0x6a08,
365 0x1078, 0x1d64, 0x0040, 0x19d4, 0x0078, 0x15bc, 0x1078, 0x1d54, 369 0x0078, 0x15bf, 0x77c4, 0x7814, 0xd0e4, 0x00c0, 0x19fe, 0xd7fc,
366 0x0040, 0x19d4, 0x0078, 0x15bc, 0x73c8, 0x72cc, 0x77c6, 0x73ca, 370 0x0040, 0x19f8, 0x1078, 0x1dae, 0x0040, 0x19fe, 0x0078, 0x15c3,
367 0x72ce, 0x1078, 0x1e86, 0x00c0, 0x19fe, 0x6818, 0xa005, 0x0040, 371 0x1078, 0x1da1, 0x0040, 0x19fe, 0x0078, 0x15c3, 0x73c8, 0x72cc,
368 0x19f8, 0x2708, 0x077e, 0x1078, 0x2813, 0x077f, 0x00c0, 0x19f8, 372 0x77c6, 0x73ca, 0x72ce, 0x1078, 0x1ecd, 0x00c0, 0x1a28, 0x6818,
369 0x2001, 0x0015, 0xd7fc, 0x00c0, 0x19f1, 0x2061, 0x4e40, 0x0078, 373 0xa005, 0x0040, 0x1a22, 0x2708, 0x077e, 0x1078, 0x285a, 0x077f,
370 0x19f4, 0xc0fd, 0x2061, 0x4e80, 0x782a, 0x2091, 0x8001, 0x007c, 374 0x00c0, 0x1a22, 0x2001, 0x0015, 0xd7fc, 0x00c0, 0x1a1b, 0x2061,
371 0x2091, 0x8001, 0x2001, 0x4005, 0x0078, 0x15bc, 0x2091, 0x8001, 375 0x4f40, 0x0078, 0x1a1e, 0xc0fd, 0x2061, 0x4f80, 0x782a, 0x2091,
372 0x0078, 0x15ba, 0x77c4, 0x7814, 0xd0e4, 0x00c0, 0x1a16, 0xd7fc, 376 0x8001, 0x007c, 0x2091, 0x8001, 0x2001, 0x4005, 0x0078, 0x15c3,
373 0x0040, 0x1a10, 0x1078, 0x1d64, 0x0040, 0x1a16, 0x0078, 0x15bc, 377 0x2091, 0x8001, 0x0078, 0x15c1, 0x77c4, 0x7814, 0xd0e4, 0x00c0,
374 0x1078, 0x1d54, 0x0040, 0x1a16, 0x0078, 0x15bc, 0x77c6, 0x2041, 378 0x1a40, 0xd7fc, 0x0040, 0x1a3a, 0x1078, 0x1dae, 0x0040, 0x1a40,
375 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 0x1078, 379 0x0078, 0x15c3, 0x1078, 0x1da1, 0x0040, 0x1a40, 0x0078, 0x15c3,
376 0x1dff, 0x2009, 0x0016, 0xd7fc, 0x00c0, 0x1a2a, 0x2061, 0x4e40, 380 0x77c6, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091,
377 0x0078, 0x1a2d, 0x2061, 0x4e80, 0xc1fd, 0x6067, 0x0003, 0x607f, 381 0x8000, 0x1078, 0x1e46, 0x2009, 0x0016, 0xd7fc, 0x00c0, 0x1a54,
378 0x0000, 0x6776, 0x6083, 0x000f, 0x792a, 0x61d4, 0xc1dc, 0x61d6, 382 0x2061, 0x4f40, 0x0078, 0x1a57, 0x2061, 0x4f80, 0xc1fd, 0x6067,
379 0x1078, 0x2628, 0x2091, 0x8001, 0x007c, 0x77c8, 0x77ca, 0x77c4, 383 0x0003, 0x607f, 0x0000, 0x6776, 0x6083, 0x000f, 0x792a, 0x61d4,
380 0x77c6, 0x7814, 0xd0e4, 0x00c0, 0x1a54, 0xd7fc, 0x0040, 0x1a4e, 384 0xc1dc, 0x61d6, 0x1078, 0x266f, 0x2091, 0x8001, 0x007c, 0x77c8,
381 0x1078, 0x1d64, 0x0040, 0x1a54, 0x0078, 0x15bc, 0x1078, 0x1d54, 385 0x77ca, 0x77c4, 0x77c6, 0x7814, 0xd0e4, 0x00c0, 0x1a7e, 0xd7fc,
382 0x0040, 0x1a54, 0x0078, 0x15bc, 0xa7bc, 0xff00, 0x2091, 0x8000, 386 0x0040, 0x1a78, 0x1078, 0x1dae, 0x0040, 0x1a7e, 0x0078, 0x15c3,
383 0x2009, 0x0017, 0xd7fc, 0x00c0, 0x1a61, 0x2061, 0x4e40, 0x0078, 387 0x1078, 0x1da1, 0x0040, 0x1a7e, 0x0078, 0x15c3, 0xa7bc, 0xff00,
384 0x1a64, 0x2061, 0x4e80, 0xc1fd, 0x607f, 0x0000, 0x6067, 0x0002, 388 0x2091, 0x8000, 0x2009, 0x0017, 0xd7fc, 0x00c0, 0x1a8b, 0x2061,
385 0x6776, 0x6083, 0x000f, 0x792a, 0x61d4, 0xc1dc, 0x61d6, 0x1078, 389 0x4f40, 0x0078, 0x1a8e, 0x2061, 0x4f80, 0xc1fd, 0x607f, 0x0000,
386 0x2628, 0x2091, 0x8001, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, 390 0x6067, 0x0002, 0x6776, 0x6083, 0x000f, 0x792a, 0x61d4, 0xc1dc,
387 0x0010, 0x2091, 0x8000, 0x70c8, 0xa005, 0x0040, 0x1a82, 0x60d4, 391 0x61d6, 0x1078, 0x266f, 0x2091, 0x8001, 0x2041, 0x0021, 0x2049,
388 0xc0fd, 0x60d6, 0x1078, 0x1dff, 0x70c8, 0x6836, 0x8738, 0xa784, 392 0x0005, 0x2051, 0x0010, 0x2091, 0x8000, 0x70c8, 0xa005, 0x0040,
389 0x001f, 0x00c0, 0x1a82, 0x2091, 0x8001, 0x007c, 0x2019, 0x0000, 393 0x1aac, 0x60d4, 0xc0fd, 0x60d6, 0x1078, 0x1e46, 0x70c8, 0x6836,
390 0x7814, 0xd0e4, 0x00c0, 0x1aa4, 0x72c8, 0xd284, 0x0040, 0x1a9e, 394 0x8738, 0xa784, 0x001f, 0x00c0, 0x1aac, 0x2091, 0x8001, 0x007c,
391 0x1078, 0x1d64, 0x0040, 0x1aa4, 0x0078, 0x15bc, 0x1078, 0x1d54, 395 0x2019, 0x0000, 0x7814, 0xd0e4, 0x00c0, 0x1ace, 0x72c8, 0xd284,
392 0x0040, 0x1aa4, 0x0078, 0x15bc, 0x72c8, 0x72ca, 0x78ac, 0xa084, 396 0x0040, 0x1ac8, 0x1078, 0x1dae, 0x0040, 0x1ace, 0x0078, 0x15c3,
393 0x0003, 0x00c0, 0x1acf, 0x2039, 0x0000, 0xd284, 0x0040, 0x1ab1, 397 0x1078, 0x1da1, 0x0040, 0x1ace, 0x0078, 0x15c3, 0x72c8, 0x72ca,
394 0xc7fd, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 0x1078, 398 0x78ac, 0xa084, 0x0003, 0x00c0, 0x1af9, 0x2039, 0x0000, 0xd284,
395 0x1de4, 0x2091, 0x8000, 0x6808, 0xc0d4, 0xa80d, 0x690a, 0x2091, 399 0x0040, 0x1adb, 0xc7fd, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051,
396 0x8001, 0x8738, 0xa784, 0x001f, 0x00c0, 0x1ab7, 0xa7bc, 0xff00, 400 0x0008, 0x1078, 0x1e2b, 0x2091, 0x8000, 0x6808, 0xc0d4, 0xa80d,
397 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0, 0x1ab7, 0x2091, 401 0x690a, 0x2091, 0x8001, 0x8738, 0xa784, 0x001f, 0x00c0, 0x1ae1,
398 0x8000, 0x72c8, 0xd284, 0x00c0, 0x1ae1, 0x7810, 0xd0ec, 0x0040, 402 0xa7bc, 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0,
399 0x1add, 0x2069, 0x0100, 0x0078, 0x1ae3, 0x2069, 0x0200, 0x0078, 403 0x1ae1, 0x2091, 0x8000, 0x72c8, 0xd284, 0x00c0, 0x1b0b, 0x7810,
400 0x1ae3, 0x2069, 0x0100, 0x6808, 0xa084, 0xfffd, 0x680a, 0x6830, 404 0xd0ec, 0x0040, 0x1b07, 0x2069, 0x0100, 0x0078, 0x1b0d, 0x2069,
401 0xd0b4, 0x0040, 0x1b03, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848, 405 0x0200, 0x0078, 0x1b0d, 0x2069, 0x0100, 0x6808, 0xa084, 0xfffd,
402 0xd094, 0x0040, 0x1af5, 0x00f0, 0x1aef, 0x684b, 0x0009, 0x20a9, 406 0x680a, 0x6830, 0xd0b4, 0x0040, 0x1b2d, 0x684b, 0x0004, 0x20a9,
403 0x0014, 0x6848, 0xd084, 0x0040, 0x1aff, 0x00f0, 0x1af9, 0x20a9, 407 0x0014, 0x6848, 0xd094, 0x0040, 0x1b1f, 0x00f0, 0x1b19, 0x684b,
404 0x00fa, 0x00f0, 0x1b01, 0x2079, 0x4e00, 0x2009, 0x0018, 0x72c8, 408 0x0009, 0x20a9, 0x0014, 0x6848, 0xd084, 0x0040, 0x1b29, 0x00f0,
405 0xd284, 0x00c0, 0x1b0f, 0x2061, 0x4e40, 0x0078, 0x1b12, 0x2061, 409 0x1b23, 0x20a9, 0x00fa, 0x00f0, 0x1b2b, 0x2079, 0x4f00, 0x2009,
406 0x4e80, 0xc1fd, 0x607f, 0x0000, 0x792a, 0x6067, 0x0001, 0x6083, 410 0x0018, 0x72c8, 0xd284, 0x00c0, 0x1b39, 0x2061, 0x4f40, 0x0078,
407 0x000f, 0x60a7, 0x0000, 0x60a8, 0x60b2, 0x60b6, 0x60d4, 0xd0b4, 411 0x1b3c, 0x2061, 0x4f80, 0xc1fd, 0x607f, 0x0000, 0x792a, 0x6067,
408 0x0040, 0x1b2e, 0xc0b4, 0x60d6, 0x0c7e, 0x60b8, 0xa065, 0x6008, 412 0x0001, 0x6083, 0x000f, 0x60a7, 0x0000, 0x60a8, 0x60b2, 0x60b6,
409 0xc0d4, 0x600a, 0x6018, 0x8001, 0x601a, 0x0c7f, 0x60d4, 0xa084, 413 0x60d4, 0xd0b4, 0x0040, 0x1b58, 0xc0b4, 0x60d6, 0x0c7e, 0x60b8,
410 0x77ff, 0x60d6, 0x78ac, 0xc08d, 0x78ae, 0x83ff, 0x0040, 0x1b39, 414 0xa065, 0x6008, 0xc0d4, 0x600a, 0x6018, 0x8001, 0x601a, 0x0c7f,
411 0x007c, 0x681b, 0x0047, 0x2091, 0x8001, 0x007c, 0x73cc, 0x1078, 415 0x60d4, 0xa084, 0x77ff, 0x60d6, 0x78ac, 0xc08d, 0x78ae, 0x83ff,
412 0x1a90, 0x69ec, 0x6a48, 0xa185, 0x1800, 0x684a, 0xa185, 0x0040, 416 0x0040, 0x1b63, 0x007c, 0x681b, 0x0047, 0x2091, 0x8001, 0x007c,
413 0x68ee, 0x73cc, 0x2021, 0x0004, 0x20a9, 0x09ff, 0x00f0, 0x1b4e, 417 0x73cc, 0x1078, 0x1aba, 0x69ec, 0x6a48, 0xa185, 0x1800, 0x684a,
414 0x8421, 0x00c0, 0x1b4c, 0x8319, 0x00c0, 0x1b4a, 0x69ee, 0x6a4a, 418 0xa185, 0x0040, 0x68ee, 0x73cc, 0x2021, 0x0004, 0x20a9, 0x09ff,
415 0x2091, 0x8001, 0x007c, 0xd7fc, 0x00c0, 0x1b62, 0x2069, 0x4e40, 419 0x00f0, 0x1b78, 0x8421, 0x00c0, 0x1b76, 0x8319, 0x00c0, 0x1b74,
416 0x0078, 0x1b64, 0x2069, 0x4e80, 0x71c4, 0x71c6, 0x6916, 0x81ff, 420 0x69ee, 0x6a4a, 0x2091, 0x8001, 0x007c, 0xd7fc, 0x00c0, 0x1b8c,
417 0x00c0, 0x1b6c, 0x68a7, 0x0001, 0x78ac, 0xc08c, 0x78ae, 0xd084, 421 0x2069, 0x4f40, 0x0078, 0x1b8e, 0x2069, 0x4f80, 0x71c4, 0x71c6,
418 0x00c0, 0x1b74, 0x1078, 0x1ee6, 0x007c, 0x75d8, 0x74dc, 0x75da, 422 0x6916, 0x81ff, 0x00c0, 0x1b96, 0x68a7, 0x0001, 0x78ac, 0xc08c,
419 0x74de, 0x0078, 0x1b7e, 0x2029, 0x0000, 0x2520, 0x71c4, 0x73c8, 423 0x78ae, 0xd084, 0x00c0, 0x1b9e, 0x1078, 0x1f2d, 0x007c, 0x75d8,
420 0x72cc, 0x71c6, 0x73ca, 0x72ce, 0x2079, 0x4e00, 0x7dde, 0x7cda, 424 0x74dc, 0x75da, 0x74de, 0x0078, 0x1ba7, 0xa02e, 0x2520, 0x71c4,
421 0x7bd6, 0x7ad2, 0x1078, 0x1dbd, 0x0040, 0x1c80, 0x20a9, 0x0005, 425 0x73c8, 0x72cc, 0x71c6, 0x73ca, 0x72ce, 0x2079, 0x4f00, 0x7dde,
422 0x20a1, 0x4e14, 0x2091, 0x8000, 0x41a1, 0x2091, 0x8001, 0x2009, 426 0x7cda, 0x7bd6, 0x7ad2, 0x1078, 0x1e04, 0x0040, 0x1cd1, 0x20a9,
423 0x0040, 0x1078, 0x1fd1, 0x0040, 0x1ba1, 0x1078, 0x1dc6, 0x0078, 427 0x0005, 0x20a1, 0x4f14, 0x2091, 0x8000, 0x41a1, 0x2091, 0x8001,
424 0x1c80, 0x6004, 0xa08c, 0x00ff, 0xa18e, 0x0009, 0x00c0, 0x1bac, 428 0x2009, 0x0040, 0x1078, 0x2018, 0x0040, 0x1bca, 0x1078, 0x1e0d,
425 0x007e, 0x1078, 0x2378, 0x007f, 0xa084, 0xff00, 0x8007, 0x8009, 429 0x0078, 0x1cd1, 0x6004, 0xa08c, 0x00ff, 0xa18e, 0x0009, 0x00c0,
426 0x0040, 0x1c20, 0x0c7e, 0x2c68, 0x1078, 0x1dbd, 0x0040, 0x1bf2, 430 0x1bd5, 0x007e, 0x1078, 0x23bf, 0x007f, 0xa084, 0xff00, 0x8007,
427 0x2c00, 0x689e, 0x8109, 0x00c0, 0x1bb3, 0x609f, 0x0000, 0x0c7f, 431 0x8009, 0x0040, 0x1c61, 0x0c7e, 0x2c68, 0x1078, 0x1e04, 0x0040,
428 0x0c7e, 0x7ddc, 0x7cd8, 0x7bd4, 0x7ad0, 0xa290, 0x0040, 0xa399, 432 0x1c1b, 0x2c00, 0x689e, 0x8109, 0x00c0, 0x1bdc, 0x609f, 0x0000,
429 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x7dde, 0x7cda, 0x7bd6, 433 0x0c7f, 0x0c7e, 0x7ddc, 0x7cd8, 0x7bd4, 0x7ad0, 0xa290, 0x0040,
430 0x7ad2, 0x2c68, 0x689c, 0xa065, 0x0040, 0x1c1f, 0x2009, 0x0040, 434 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x7dde, 0x7cda,
431 0x1078, 0x1fd1, 0x00c0, 0x1c09, 0x6004, 0xa084, 0x00ff, 0xa086, 435 0x7bd6, 0x7ad2, 0x2c68, 0x689c, 0xa065, 0x0040, 0x1c60, 0x2009,
432 0x0002, 0x00c0, 0x1bf2, 0x6004, 0xa084, 0x00ff, 0xa086, 0x000a, 436 0x0040, 0x1078, 0x2018, 0x00c0, 0x1c3e, 0x6004, 0xa084, 0x00ff,
433 0x00c0, 0x1bee, 0x017e, 0x1078, 0x2374, 0x017f, 0x2d00, 0x6002, 437 0xa086, 0x0002, 0x00c0, 0x1c1b, 0x6004, 0xa084, 0x00ff, 0xa086,
434 0x0078, 0x1bc1, 0x0c7f, 0x0c7e, 0x609c, 0x1078, 0x1e49, 0x0c7f, 438 0x000a, 0x00c0, 0x1c17, 0x017e, 0x1078, 0x23bb, 0x017f, 0x2d00,
435 0x609f, 0x0000, 0x1078, 0x1c84, 0x2009, 0x0018, 0x6008, 0xc0cd, 439 0x6002, 0x0078, 0x1bea, 0x0c7f, 0x0c7e, 0x609c, 0x1078, 0x1e90,
436 0x600a, 0x6004, 0x6086, 0x1078, 0x1d74, 0x1078, 0x1dc6, 0x0078, 440 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1cd5, 0x2009, 0x0018, 0x6008,
437 0x1c80, 0x0c7f, 0x0c7e, 0x609c, 0x1078, 0x1e49, 0x0c7f, 0x609f, 441 0xc0cd, 0x600a, 0x6004, 0x6086, 0x7810, 0x007e, 0x84ff, 0x00c0,
438 0x0000, 0x1078, 0x1c84, 0x2009, 0x0018, 0x6087, 0x0103, 0x601b, 442 0x1c34, 0x85ff, 0x0040, 0x1c36, 0xc0c5, 0x7812, 0x1078, 0x1dbb,
439 0x0003, 0x1078, 0x1d74, 0x1078, 0x1dc6, 0x0078, 0x1c80, 0x0c7f, 443 0x007f, 0x7812, 0x1078, 0x1e0d, 0x0078, 0x1cd1, 0x0c7f, 0x0c7e,
440 0x7814, 0xd0e4, 0x00c0, 0x1c45, 0x6114, 0xd1fc, 0x0040, 0x1c2e, 444 0x609c, 0x1078, 0x1e90, 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1cd5,
441 0x1078, 0x1d64, 0x0040, 0x1c45, 0x0078, 0x1c32, 0x1078, 0x1d54, 445 0x2009, 0x0018, 0x6087, 0x0103, 0x601b, 0x0003, 0x7810, 0x007e,
442 0x0040, 0x1c45, 0x2029, 0x0000, 0x2520, 0x2009, 0x0018, 0x73c8, 446 0x84ff, 0x00c0, 0x1c56, 0x85ff, 0x0040, 0x1c58, 0xc0c5, 0x7812,
443 0x72cc, 0x6087, 0x0103, 0x601b, 0x0021, 0x1078, 0x1d74, 0x1078, 447 0x1078, 0x1dbb, 0x007f, 0x7812, 0x1078, 0x1e0d, 0x0078, 0x1cd1,
444 0x1dc6, 0x2001, 0x4007, 0x0078, 0x15bc, 0x74c4, 0x73c8, 0x72cc, 448 0x0c7f, 0x7814, 0xd0e4, 0x00c0, 0x1c8f, 0x6114, 0xd1fc, 0x0040,
445 0x6014, 0x2091, 0x8000, 0x0e7e, 0x2009, 0x0012, 0xd0fc, 0x00c0, 449 0x1c6f, 0x1078, 0x1dae, 0x0040, 0x1c8f, 0x0078, 0x1c73, 0x1078,
446 0x1c55, 0x2071, 0x4e40, 0x0078, 0x1c58, 0x2071, 0x4e80, 0xc1fd, 450 0x1da1, 0x0040, 0x1c8f, 0x1078, 0x1cd5, 0x2009, 0x0018, 0x6087,
447 0x792a, 0x7067, 0x0005, 0x71d4, 0xc1dc, 0x71d6, 0x736a, 0x726e, 451 0x0103, 0x601b, 0x0021, 0x7810, 0x007e, 0x84ff, 0x00c0, 0x1c83,
448 0x7472, 0x7076, 0x707b, 0x0000, 0x2c00, 0x707e, 0xa02e, 0x2530, 452 0x85ff, 0x0040, 0x1c85, 0xc0c5, 0x7812, 0x1078, 0x1dbb, 0x007f,
449 0x611c, 0xa184, 0x0060, 0x0040, 0x1c6f, 0x1078, 0x4632, 0x0e7f, 453 0x7812, 0x1078, 0x1e0d, 0x2001, 0x4007, 0x0078, 0x15c3, 0x74c4,
450 0x6596, 0x65a6, 0x669a, 0x66aa, 0x60af, 0x0000, 0x60b3, 0x0000, 454 0x73c8, 0x72cc, 0x6014, 0x2091, 0x8000, 0x0e7e, 0x2009, 0x0012,
451 0x6714, 0x6023, 0x0000, 0x1078, 0x2628, 0x2091, 0x8001, 0x007c, 455 0xd0fc, 0x00c0, 0x1c9f, 0x2071, 0x4f40, 0x0078, 0x1ca2, 0x2071,
452 0x70c3, 0x4005, 0x0078, 0x15bd, 0x20a9, 0x0005, 0x2099, 0x4e14, 456 0x4f80, 0xc1fd, 0x792a, 0x7067, 0x0005, 0x71d4, 0xc1dc, 0x71d6,
453 0x2091, 0x8000, 0x530a, 0x2091, 0x8001, 0x2100, 0xa210, 0xa399, 457 0x736a, 0x726e, 0x7472, 0x7076, 0x707b, 0x0000, 0x2c00, 0x707e,
454 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x007c, 0x71c4, 0x70c7, 458 0xa02e, 0x2530, 0x611c, 0xa184, 0x0060, 0x0040, 0x1cb9, 0x1078,
455 0x0000, 0x791e, 0x0078, 0x15ba, 0x71c4, 0x71c6, 0x2168, 0x0078, 459 0x46b6, 0x0e7f, 0x6596, 0x65a6, 0x669a, 0x66aa, 0x60af, 0x0000,
456 0x1ca3, 0x2069, 0x1000, 0x690c, 0xa016, 0x2d04, 0xa210, 0x8d68, 460 0x60b3, 0x0000, 0x6714, 0x6023, 0x0000, 0x6024, 0xa096, 0x0001,
457 0x8109, 0x00c0, 0x1ca5, 0xa285, 0x0000, 0x00c0, 0x1cb3, 0x70c3, 461 0x00c0, 0x1ccc, 0x8000, 0x6026, 0x1078, 0x266f, 0x2091, 0x8001,
458 0x4000, 0x0078, 0x1cb5, 0x70c3, 0x4003, 0x70ca, 0x0078, 0x15bd, 462 0x007c, 0x70c3, 0x4005, 0x0078, 0x15c4, 0x20a9, 0x0005, 0x2099,
459 0x7964, 0x71c6, 0x71c4, 0xa182, 0x0003, 0x00c8, 0x15b2, 0x7966, 463 0x4f14, 0x2091, 0x8000, 0x530a, 0x2091, 0x8001, 0x2100, 0xa210,
460 0x0078, 0x15ba, 0x7964, 0x71c6, 0x0078, 0x15ba, 0x7900, 0x71c6, 464 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x007c, 0x71c4,
461 0x71c4, 0x7902, 0x0078, 0x15ba, 0x7900, 0x71c6, 0x0078, 0x15ba, 465 0x70c7, 0x0000, 0x791e, 0x0078, 0x15c1, 0x71c4, 0x71c6, 0x2168,
462 0x70c4, 0x2011, 0x0000, 0xa08c, 0x000d, 0x0040, 0x1ce5, 0x810c, 466 0x0078, 0x1cf4, 0x2069, 0x1000, 0x690c, 0xa016, 0x2d04, 0xa210,
463 0x0048, 0x1ce1, 0x8210, 0x810c, 0x810c, 0x0048, 0x1ce1, 0x8210, 467 0x8d68, 0x8109, 0x00c0, 0x1cf6, 0xa285, 0x0000, 0x00c0, 0x1d04,
464 0x810c, 0x81ff, 0x00c0, 0x15b3, 0x8210, 0x7a0e, 0xd28c, 0x0040, 468 0x70c3, 0x4000, 0x0078, 0x1d06, 0x70c3, 0x4003, 0x70ca, 0x0078,
465 0x1d11, 0x7910, 0xc1cd, 0x7912, 0x2009, 0x0021, 0x2019, 0x0003, 469 0x15c4, 0x7964, 0x71c6, 0x71c4, 0xa182, 0x0003, 0x00c8, 0x15b9,
466 0xd284, 0x0040, 0x1d0b, 0x8108, 0x2019, 0x0041, 0x2011, 0x964e, 470 0x7966, 0x0078, 0x15c1, 0x7964, 0x71c6, 0x0078, 0x15c1, 0x7900,
467 0x2312, 0x2019, 0x0042, 0x8210, 0x2312, 0x2019, 0x0043, 0x8210, 471 0x71c6, 0x71c4, 0x7902, 0x0078, 0x15c1, 0x7900, 0x71c6, 0x0078,
468 0x2312, 0x2019, 0x0046, 0x8210, 0x2312, 0x2019, 0x0047, 0x8210, 472 0x15c1, 0x70c4, 0x2011, 0x0000, 0xa08c, 0x000d, 0x0040, 0x1d36,
469 0x2312, 0x2019, 0x0006, 0x2011, 0x9653, 0x2112, 0x2011, 0x9673, 473 0x810c, 0x0048, 0x1d32, 0x8210, 0x810c, 0x810c, 0x0048, 0x1d32,
470 0x2312, 0x7904, 0x7806, 0x0078, 0x15b9, 0x7804, 0x70c6, 0x0078, 474 0x8210, 0x810c, 0x81ff, 0x00c0, 0x15ba, 0x8210, 0x7a0e, 0xd28c,
471 0x15ba, 0x71c4, 0xd1fc, 0x00c0, 0x1d21, 0x2011, 0x52c0, 0x0078, 475 0x0040, 0x1d62, 0x7910, 0xc1cd, 0x7912, 0x2009, 0x0021, 0x2019,
472 0x1d23, 0x2011, 0x5340, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 476 0x0003, 0xd284, 0x0040, 0x1d5c, 0x8108, 0x2019, 0x0041, 0x2011,
473 0x8003, 0xa268, 0x6a14, 0xd2b4, 0x0040, 0x1d32, 0x2011, 0x0001, 477 0x974e, 0x2312, 0x2019, 0x0042, 0x8210, 0x2312, 0x2019, 0x0043,
474 0x0078, 0x1d34, 0x2011, 0x0000, 0x6b0c, 0x6800, 0x70da, 0x0078, 478 0x8210, 0x2312, 0x2019, 0x0046, 0x8210, 0x2312, 0x2019, 0x0047,
475 0x15b7, 0x017e, 0x7814, 0xd0f4, 0x0040, 0x1d46, 0x2001, 0x4007, 479 0x8210, 0x2312, 0x2019, 0x0006, 0x2011, 0x9753, 0x2112, 0x2011,
476 0x70db, 0x0000, 0xa18d, 0x0001, 0x0078, 0x1d52, 0xd0fc, 0x0040, 480 0x9773, 0x2312, 0x7904, 0x7806, 0x0078, 0x15c0, 0x7804, 0x70c6,
477 0x1d51, 0x2001, 0x4007, 0x70db, 0x0001, 0xa18d, 0x0001, 0x0078, 481 0x0078, 0x15c1, 0x71c4, 0xd1fc, 0x00c0, 0x1d72, 0x2011, 0x53c0,
478 0x1d52, 0xa006, 0x017f, 0x007c, 0x017e, 0x7814, 0xd0f4, 0x0040, 482 0x0078, 0x1d74, 0x2011, 0x5440, 0x8107, 0xa084, 0x000f, 0x8003,
479 0x1d61, 0x2001, 0x4007, 0x70db, 0x0000, 0xa18d, 0x0001, 0x0078, 483 0x8003, 0x8003, 0xa268, 0x6a14, 0xd2b4, 0x0040, 0x1d83, 0x2011,
480 0x1d62, 0xa006, 0x017f, 0x007c, 0x017e, 0x7814, 0xd0fc, 0x0040, 484 0x0001, 0x0078, 0x1d85, 0x2011, 0x0000, 0x6b0c, 0x6800, 0x70da,
481 0x1d71, 0x2001, 0x4007, 0x70db, 0x0001, 0xa18d, 0x0001, 0x0078, 485 0x0078, 0x15be, 0x7814, 0xd0f4, 0x0040, 0x1d95, 0x2001, 0x4007,
482 0x1d72, 0xa006, 0x017f, 0x007c, 0x7112, 0x721a, 0x731e, 0x7810, 486 0x70db, 0x0000, 0xa005, 0x0078, 0x1da0, 0xd0fc, 0x0040, 0x1d9f,
483 0xd0c4, 0x0040, 0x1d7d, 0x7422, 0x7526, 0xac80, 0x0001, 0x8108, 487 0x2001, 0x4007, 0x70db, 0x0001, 0xa005, 0x0078, 0x1da0, 0xa006,
484 0x810c, 0x81a9, 0x8098, 0x20a1, 0x0030, 0x7003, 0x0000, 0x6084, 488 0x007c, 0x7814, 0xd0f4, 0x0040, 0x1dac, 0x2001, 0x4007, 0x70db,
485 0x20a2, 0x53a6, 0x7007, 0x0001, 0x7974, 0xa184, 0xff00, 0x0040, 489 0x0000, 0xa005, 0x0078, 0x1dad, 0xa006, 0x007c, 0x7814, 0xd0fc,
486 0x1d9a, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 490 0x0040, 0x1db9, 0x2001, 0x4007, 0x70db, 0x0001, 0xa005, 0x0078,
487 0x0078, 0x1d9d, 0x8107, 0x8004, 0x8004, 0x797c, 0xa108, 0x7a78, 491 0x1dba, 0xa006, 0x007c, 0x7112, 0x721a, 0x731e, 0x7810, 0xd0c4,
488 0xa006, 0xa211, 0x7d10, 0xd5c4, 0x0040, 0x1daa, 0x7b84, 0xa319, 492 0x0040, 0x1dc4, 0x7422, 0x7526, 0xac80, 0x0001, 0x8108, 0x810c,
489 0x7c80, 0xa421, 0x7008, 0xd0fc, 0x0040, 0x1daa, 0x7003, 0x0001, 493 0x81a9, 0x8098, 0x20a1, 0x0030, 0x7003, 0x0000, 0x6084, 0x20a2,
490 0x7007, 0x0006, 0x711a, 0x721e, 0x7d10, 0xd5c4, 0x0040, 0x1dba, 494 0x53a6, 0x7007, 0x0001, 0x7974, 0xa184, 0xff00, 0x0040, 0x1de1,
491 0x7322, 0x7426, 0xa084, 0x01e0, 0x007c, 0x7848, 0xa065, 0x0040, 495 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0078,
492 0x1dc5, 0x2c04, 0x784a, 0x2063, 0x0000, 0x007c, 0x0f7e, 0x2079, 496 0x1de4, 0x8107, 0x8004, 0x8004, 0x797c, 0xa108, 0x7a78, 0xa006,
493 0x4e00, 0x7848, 0x2062, 0x2c00, 0xa005, 0x00c0, 0x1dd1, 0x1078, 497 0xa211, 0x7d10, 0xd5c4, 0x0040, 0x1df1, 0x7b84, 0xa319, 0x7c80,
494 0x296b, 0x784a, 0x0f7f, 0x007c, 0x2011, 0x9800, 0x7a4a, 0x7bc4, 498 0xa421, 0x7008, 0xd0fc, 0x0040, 0x1df1, 0x7003, 0x0001, 0x7007,
495 0x8319, 0x0040, 0x1de1, 0xa280, 0x0032, 0x2012, 0x2010, 0x0078, 499 0x0006, 0x711a, 0x721e, 0x7d10, 0xd5c4, 0x0040, 0x1e01, 0x7322,
496 0x1dd8, 0x2013, 0x0000, 0x007c, 0x017e, 0x027e, 0xd7fc, 0x00c0, 500 0x7426, 0xa084, 0x01e0, 0x007c, 0x7848, 0xa065, 0x0040, 0x1e0c,
497 0x1ded, 0x2011, 0x53c0, 0x0078, 0x1def, 0x2011, 0x73c0, 0xa784, 501 0x2c04, 0x784a, 0x2063, 0x0000, 0x007c, 0x0f7e, 0x2079, 0x4f00,
498 0x0f00, 0x800b, 0xa784, 0x001f, 0x0040, 0x1dfa, 0x8003, 0x8003, 502 0x7848, 0x2062, 0x2c00, 0xa005, 0x00c0, 0x1e18, 0x1078, 0x29b2,
499 0x8003, 0x8003, 0xa105, 0xa268, 0x027f, 0x017f, 0x007c, 0x1078, 503 0x784a, 0x0f7f, 0x007c, 0x2011, 0x9900, 0x7a4a, 0x7bc4, 0x8319,
500 0x1de4, 0x2900, 0x682a, 0x2a00, 0x682e, 0x6808, 0xa084, 0xf9ef, 504 0x0040, 0x1e28, 0xa280, 0x0032, 0x2012, 0x2010, 0x0078, 0x1e1f,
501 0xa80d, 0x690a, 0x0e7e, 0xd7fc, 0x00c0, 0x1e14, 0x2009, 0x4e53, 505 0x2013, 0x0000, 0x007c, 0x017e, 0x027e, 0xd7fc, 0x00c0, 0x1e34,
502 0x2071, 0x4e40, 0x0078, 0x1e18, 0x2009, 0x4e93, 0x2071, 0x4e80, 506 0x2011, 0x54c0, 0x0078, 0x1e36, 0x2011, 0x74c0, 0xa784, 0x0f00,
503 0x210c, 0x6804, 0xa005, 0x0040, 0x1e28, 0xa116, 0x00c0, 0x1e28, 507 0x800b, 0xa784, 0x001f, 0x0040, 0x1e41, 0x8003, 0x8003, 0x8003,
504 0x2060, 0x6000, 0x6806, 0x017e, 0x200b, 0x0000, 0x0078, 0x1e2b, 508 0x8003, 0xa105, 0xa268, 0x027f, 0x017f, 0x007c, 0x1078, 0x1e2b,
505 0x2009, 0x0000, 0x017e, 0x6804, 0xa065, 0x0040, 0x1e40, 0x6000, 509 0x2900, 0x682a, 0x2a00, 0x682e, 0x6808, 0xa084, 0xf9ef, 0xa80d,
506 0x6806, 0x1078, 0x1e5b, 0x1078, 0x201d, 0x6810, 0x7908, 0x8109, 510 0x690a, 0x0e7e, 0xd7fc, 0x00c0, 0x1e5b, 0x2009, 0x4f53, 0x2071,
507 0x790a, 0x8001, 0x6812, 0x00c0, 0x1e2b, 0x7910, 0xc1a5, 0x7912, 511 0x4f40, 0x0078, 0x1e5f, 0x2009, 0x4f93, 0x2071, 0x4f80, 0x210c,
508 0x017f, 0x6902, 0x6906, 0x2d00, 0x2060, 0x1078, 0x2acc, 0x0e7f, 512 0x6804, 0xa005, 0x0040, 0x1e6f, 0xa116, 0x00c0, 0x1e6f, 0x2060,
509 0x007c, 0xa065, 0x0040, 0x1e5a, 0x2008, 0x609c, 0xa005, 0x0040, 513 0x6000, 0x6806, 0x017e, 0x200b, 0x0000, 0x0078, 0x1e72, 0x2009,
510 0x1e57, 0x2062, 0x609f, 0x0000, 0xa065, 0x0078, 0x1e4d, 0x7848, 514 0x0000, 0x017e, 0x6804, 0xa065, 0x0040, 0x1e87, 0x6000, 0x6806,
511 0x794a, 0x2062, 0x007c, 0x6007, 0x0103, 0x608f, 0x0000, 0x20a9, 515 0x1078, 0x1ea2, 0x1078, 0x2064, 0x6810, 0x7908, 0x8109, 0x790a,
512 0x001c, 0xac80, 0x0005, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x6828, 516 0x8001, 0x6812, 0x00c0, 0x1e72, 0x7910, 0xc1a5, 0x7912, 0x017f,
513 0x601a, 0x682c, 0x6022, 0x007c, 0x0e7e, 0xd7fc, 0x00c0, 0x1e76, 517 0x6902, 0x6906, 0x2d00, 0x2060, 0x1078, 0x2b13, 0x0e7f, 0x007c,
514 0x2071, 0x4e40, 0x2031, 0x4ec0, 0x0078, 0x1e7a, 0x2071, 0x4e80, 518 0xa065, 0x0040, 0x1ea1, 0x2008, 0x609c, 0xa005, 0x0040, 0x1e9e,
515 0x2031, 0x50c0, 0x7050, 0xa08c, 0x0200, 0x00c0, 0x1e84, 0xa608, 519 0x2062, 0x609f, 0x0000, 0xa065, 0x0078, 0x1e94, 0x7848, 0x794a,
516 0x2d0a, 0x8000, 0x7052, 0xa006, 0x0e7f, 0x007c, 0x0f7e, 0xd7fc, 520 0x2062, 0x007c, 0x6007, 0x0103, 0x608f, 0x0000, 0x20a9, 0x001c,
517 0x00c0, 0x1e8e, 0x2079, 0x4e40, 0x0078, 0x1e90, 0x2079, 0x4e80, 521 0xac80, 0x0005, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x6828, 0x601a,
518 0x1078, 0x1de4, 0x2091, 0x8000, 0x6804, 0x780a, 0xa065, 0x0040, 522 0x682c, 0x6022, 0x007c, 0x0e7e, 0xd7fc, 0x00c0, 0x1ebd, 0x2071,
519 0x1ee4, 0x0078, 0x1ea2, 0x2c00, 0x780a, 0x2060, 0x6000, 0xa065, 523 0x4f40, 0x2031, 0x4fc0, 0x0078, 0x1ec1, 0x2071, 0x4f80, 0x2031,
520 0x0040, 0x1ee4, 0x6010, 0xa306, 0x00c0, 0x1e9b, 0x600c, 0xa206, 524 0x51c0, 0x7050, 0xa08c, 0x0200, 0x00c0, 0x1ecb, 0xa608, 0x2d0a,
521 0x00c0, 0x1e9b, 0x2c28, 0x784c, 0xac06, 0x00c0, 0x1eb1, 0x0078, 525 0x8000, 0x7052, 0xa006, 0x0e7f, 0x007c, 0x0f7e, 0xd7fc, 0x00c0,
522 0x1ee1, 0x6804, 0xac06, 0x00c0, 0x1ebf, 0x6000, 0x2060, 0x6806, 526 0x1ed5, 0x2079, 0x4f40, 0x0078, 0x1ed7, 0x2079, 0x4f80, 0x1078,
523 0xa005, 0x00c0, 0x1ebf, 0x6803, 0x0000, 0x0078, 0x1ec9, 0x6400, 527 0x1e2b, 0x2091, 0x8000, 0x6804, 0x780a, 0xa065, 0x0040, 0x1f2b,
524 0x7808, 0x2060, 0x6402, 0xa486, 0x0000, 0x00c0, 0x1ec9, 0x2c00, 528 0x0078, 0x1ee9, 0x2c00, 0x780a, 0x2060, 0x6000, 0xa065, 0x0040,
525 0x6802, 0x2560, 0x0f7f, 0x1078, 0x1e5b, 0x0f7e, 0x601b, 0x0005, 529 0x1f2b, 0x6010, 0xa306, 0x00c0, 0x1ee2, 0x600c, 0xa206, 0x00c0,
526 0x6023, 0x0020, 0x0f7f, 0x1078, 0x201d, 0x0f7e, 0x7908, 0x8109, 530 0x1ee2, 0x2c28, 0x784c, 0xac06, 0x00c0, 0x1ef8, 0x0078, 0x1f28,
527 0x790a, 0x6810, 0x8001, 0x6812, 0x00c0, 0x1ee1, 0x7810, 0xc0a5, 531 0x6804, 0xac06, 0x00c0, 0x1f06, 0x6000, 0x2060, 0x6806, 0xa005,
528 0x7812, 0x2001, 0xffff, 0xa005, 0x0f7f, 0x007c, 0x077e, 0x2700, 532 0x00c0, 0x1f06, 0x6803, 0x0000, 0x0078, 0x1f10, 0x6400, 0x7808,
529 0x2039, 0x0000, 0xd0fc, 0x0040, 0x1eee, 0xc7fd, 0x2041, 0x0021, 533 0x2060, 0x6402, 0xa486, 0x0000, 0x00c0, 0x1f10, 0x2c00, 0x6802,
530 0x2049, 0x0004, 0x2051, 0x0008, 0x2091, 0x8000, 0x1078, 0x1dff, 534 0x2560, 0x0f7f, 0x1078, 0x1ea2, 0x0f7e, 0x601b, 0x0005, 0x6023,
531 0x8738, 0xa784, 0x001f, 0x00c0, 0x1ef6, 0xa7bc, 0xff00, 0x873f, 535 0x0020, 0x0f7f, 0x1078, 0x2064, 0x0f7e, 0x7908, 0x8109, 0x790a,
532 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0, 0x1ef6, 0x2091, 0x8001, 536 0x6810, 0x8001, 0x6812, 0x00c0, 0x1f28, 0x7810, 0xc0a5, 0x7812,
533 0x077f, 0x007c, 0x786c, 0x2009, 0x9674, 0x210c, 0xa10d, 0x0040, 537 0x2001, 0xffff, 0xa005, 0x0f7f, 0x007c, 0x077e, 0x2700, 0x2039,
534 0x1f14, 0xa065, 0x0078, 0x2395, 0x2061, 0x0000, 0x6018, 0xd084, 538 0x0000, 0xd0fc, 0x0040, 0x1f35, 0xc7fd, 0x2041, 0x0021, 0x2049,
535 0x00c0, 0x1f34, 0x7810, 0xd08c, 0x0040, 0x1f25, 0xc08c, 0x7812, 539 0x0004, 0x2051, 0x0008, 0x2091, 0x8000, 0x1078, 0x1e46, 0x8738,
536 0xc7fc, 0x2069, 0x4e40, 0x0078, 0x1f2a, 0xc08d, 0x7812, 0x2069, 540 0xa784, 0x001f, 0x00c0, 0x1f3d, 0xa7bc, 0xff00, 0x873f, 0x8738,
537 0x4e80, 0xc7fd, 0x2091, 0x8000, 0x681c, 0x681f, 0x0000, 0x2091, 541 0x873f, 0xa784, 0x0f00, 0x00c0, 0x1f3d, 0x2091, 0x8001, 0x077f,
538 0x8001, 0xa005, 0x00c0, 0x1f35, 0x007c, 0xa08c, 0xfff0, 0x0040, 542 0x007c, 0x786c, 0x2009, 0x9774, 0x210c, 0xa10d, 0x0040, 0x1f5b,
539 0x1f3b, 0x1078, 0x296b, 0x0079, 0x1f3d, 0x1f4d, 0x1f50, 0x1f56, 543 0xa065, 0x0078, 0x23dc, 0x2061, 0x0000, 0x6018, 0xd084, 0x00c0,
540 0x1f5a, 0x1f4e, 0x1f5e, 0x1f4e, 0x1f4e, 0x1f4e, 0x1f64, 0x1f95, 544 0x1f7b, 0x7810, 0xd08c, 0x0040, 0x1f6c, 0xc08c, 0x7812, 0xc7fc,
541 0x1f99, 0x1f9f, 0x1fb4, 0x1f4e, 0x1f4e, 0x007c, 0x1078, 0x296b, 545 0x2069, 0x4f40, 0x0078, 0x1f71, 0xc08d, 0x7812, 0x2069, 0x4f80,
542 0x1078, 0x1ee6, 0x2001, 0x8001, 0x0078, 0x1fc0, 0x2001, 0x8003, 546 0xc7fd, 0x2091, 0x8000, 0x681c, 0x681f, 0x0000, 0x2091, 0x8001,
543 0x0078, 0x1fc0, 0x2001, 0x8004, 0x0078, 0x1fc0, 0x1078, 0x1ee6, 547 0xa005, 0x00c0, 0x1f7c, 0x007c, 0xa08c, 0xfff0, 0x0040, 0x1f82,
544 0x2001, 0x8006, 0x0078, 0x1fc0, 0x2091, 0x8000, 0x077e, 0xd7fc, 548 0x1078, 0x29b2, 0x0079, 0x1f84, 0x1f94, 0x1f97, 0x1f9d, 0x1fa1,
545 0x00c0, 0x1f70, 0x2069, 0x4e40, 0x2039, 0x0009, 0x0078, 0x1f74, 549 0x1f95, 0x1fa5, 0x1f95, 0x1f95, 0x1f95, 0x1fab, 0x1fdc, 0x1fe0,
546 0x2069, 0x4e80, 0x2039, 0x0009, 0x6800, 0xa086, 0x0000, 0x0040, 550 0x1fe6, 0x1ffb, 0x1f95, 0x1f95, 0x007c, 0x1078, 0x29b2, 0x1078,
547 0x1f7e, 0x007f, 0x6f1e, 0x2091, 0x8001, 0x007c, 0x6874, 0x077f, 551 0x1f2d, 0x2001, 0x8001, 0x0078, 0x2007, 0x2001, 0x8003, 0x0078,
548 0xa0bc, 0xff00, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0010, 552 0x2007, 0x2001, 0x8004, 0x0078, 0x2007, 0x1078, 0x1f2d, 0x2001,
549 0x1078, 0x1dff, 0x8738, 0xa784, 0x001f, 0x00c0, 0x1f88, 0x2091, 553 0x8006, 0x0078, 0x2007, 0x2091, 0x8000, 0x077e, 0xd7fc, 0x00c0,
550 0x8001, 0x2001, 0x800a, 0x0078, 0x1fc0, 0x2001, 0x800c, 0x0078, 554 0x1fb7, 0x2069, 0x4f40, 0x2039, 0x0009, 0x0078, 0x1fbb, 0x2069,
551 0x1fc0, 0x1078, 0x1ee6, 0x2001, 0x800d, 0x0078, 0x1fc0, 0x7814, 555 0x4f80, 0x2039, 0x0009, 0x6800, 0xa086, 0x0000, 0x0040, 0x1fc5,
552 0xd0e4, 0x00c0, 0x1fb2, 0xd0ec, 0x0040, 0x1fac, 0xd7fc, 0x0040, 556 0x007f, 0x6f1e, 0x2091, 0x8001, 0x007c, 0x6874, 0x077f, 0xa0bc,
553 0x1fac, 0x78e4, 0x0078, 0x1fad, 0x78e0, 0x70c6, 0x2001, 0x800e, 557 0xff00, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0010, 0x1078,
554 0x0078, 0x1fc0, 0x0078, 0x1f4e, 0xd7fc, 0x0040, 0x1fba, 0x78ec, 558 0x1e46, 0x8738, 0xa784, 0x001f, 0x00c0, 0x1fcf, 0x2091, 0x8001,
555 0x0078, 0x1fbb, 0x78e8, 0x70c6, 0x2001, 0x800f, 0x0078, 0x1fc0, 559 0x2001, 0x800a, 0x0078, 0x2007, 0x2001, 0x800c, 0x0078, 0x2007,
556 0x70c2, 0xd7fc, 0x00c0, 0x1fc8, 0x70db, 0x0000, 0x0078, 0x1fca, 560 0x1078, 0x1f2d, 0x2001, 0x800d, 0x0078, 0x2007, 0x7814, 0xd0e4,
557 0x70db, 0x0001, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x4080, 561 0x00c0, 0x1ff9, 0xd0ec, 0x0040, 0x1ff3, 0xd7fc, 0x0040, 0x1ff3,
558 0x007c, 0xac80, 0x0001, 0x81ff, 0x0040, 0x1ffc, 0x2099, 0x0030, 562 0x78e4, 0x0078, 0x1ff4, 0x78e0, 0x70c6, 0x2001, 0x800e, 0x0078,
559 0x20a0, 0x700c, 0xa084, 0x03ff, 0x0040, 0x1fde, 0x7018, 0x007e, 563 0x2007, 0x0078, 0x1f95, 0xd7fc, 0x0040, 0x2001, 0x78ec, 0x0078,
560 0x701c, 0x007e, 0x7020, 0x007e, 0x7024, 0x007e, 0x7112, 0x81ac, 564 0x2002, 0x78e8, 0x70c6, 0x2001, 0x800f, 0x0078, 0x2007, 0x70c2,
561 0x721a, 0x731e, 0x7422, 0x7526, 0x7003, 0x0001, 0x7007, 0x0001, 565 0xd7fc, 0x00c0, 0x200f, 0x70db, 0x0000, 0x0078, 0x2011, 0x70db,
562 0x7008, 0x800b, 0x00c8, 0x1ff0, 0x7007, 0x0002, 0xa08c, 0x01e0, 566 0x0001, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x4080, 0x007c,
563 0x00c0, 0x1ffc, 0x53a5, 0xa006, 0x7003, 0x0000, 0x7007, 0x0004, 567 0xac80, 0x0001, 0x81ff, 0x0040, 0x2043, 0x2099, 0x0030, 0x20a0,
564 0x007f, 0x7026, 0x007f, 0x7022, 0x007f, 0x701e, 0x007f, 0x701a, 568 0x700c, 0xa084, 0x03ff, 0x0040, 0x2025, 0x7018, 0x007e, 0x701c,
565 0x007c, 0x2011, 0x0020, 0x2009, 0x0010, 0x6b0a, 0x6c0e, 0x6803, 569 0x007e, 0x7020, 0x007e, 0x7024, 0x007e, 0x7112, 0x81ac, 0x721a,
566 0xfd00, 0x6807, 0x0018, 0x6a1a, 0x2d00, 0xa0e8, 0x0008, 0xa290, 570 0x731e, 0x7422, 0x7526, 0x7003, 0x0001, 0x7007, 0x0001, 0x7008,
567 0x0004, 0x8109, 0x00c0, 0x200d, 0x007c, 0x6004, 0x6086, 0x2c08, 571 0x800b, 0x00c8, 0x2037, 0x7007, 0x0002, 0xa08c, 0x01e0, 0x00c0,
568 0x2063, 0x0000, 0x7868, 0xa005, 0x796a, 0x0040, 0x202a, 0x2c02, 572 0x2043, 0x53a5, 0xa006, 0x7003, 0x0000, 0x7007, 0x0004, 0x007f,
569 0x0078, 0x202b, 0x796e, 0x007c, 0x0c7e, 0x2061, 0x4e00, 0x6887, 573 0x7026, 0x007f, 0x7022, 0x007f, 0x701e, 0x007f, 0x701a, 0x007c,
570 0x0103, 0x2d08, 0x206b, 0x0000, 0x6068, 0xa005, 0x616a, 0x0040, 574 0x2011, 0x0020, 0x2009, 0x0010, 0x6b0a, 0x6c0e, 0x6803, 0xfd00,
571 0x203c, 0x2d02, 0x0078, 0x203d, 0x616e, 0x0c7f, 0x007c, 0x2091, 575 0x6807, 0x0018, 0x6a1a, 0x2d00, 0xa0e8, 0x0008, 0xa290, 0x0004,
572 0x8000, 0x2c04, 0x786e, 0xa005, 0x00c0, 0x2047, 0x786a, 0x2091, 576 0x8109, 0x00c0, 0x2054, 0x007c, 0x6004, 0x6086, 0x2c08, 0x2063,
573 0x8001, 0x609c, 0xa005, 0x0040, 0x2060, 0x0c7e, 0x2060, 0x2008, 577 0x0000, 0x7868, 0xa005, 0x796a, 0x0040, 0x2071, 0x2c02, 0x0078,
574 0x609c, 0xa005, 0x0040, 0x205c, 0x2062, 0x609f, 0x0000, 0xa065, 578 0x2072, 0x796e, 0x007c, 0x0c7e, 0x2061, 0x4f00, 0x6887, 0x0103,
575 0x609c, 0xa005, 0x00c0, 0x2054, 0x7848, 0x794a, 0x2062, 0x0c7f, 579 0x2d08, 0x206b, 0x0000, 0x6068, 0xa005, 0x616a, 0x0040, 0x2083,
576 0x7848, 0x2062, 0x609f, 0x0000, 0xac85, 0x0000, 0x00c0, 0x206a, 580 0x2d02, 0x0078, 0x2084, 0x616e, 0x0c7f, 0x007c, 0x2091, 0x8000,
577 0x1078, 0x296b, 0x784a, 0x007c, 0x20a9, 0x0010, 0xa006, 0x8004, 581 0x2c04, 0x786e, 0xa005, 0x00c0, 0x208e, 0x786a, 0x2091, 0x8001,
578 0x8086, 0x818e, 0x00c8, 0x2075, 0xa200, 0x00f0, 0x2070, 0x8086, 582 0x609c, 0xa005, 0x0040, 0x20a7, 0x0c7e, 0x2060, 0x2008, 0x609c,
579 0x818e, 0x007c, 0x157e, 0x20a9, 0x0010, 0xa005, 0x0040, 0x209b, 583 0xa005, 0x0040, 0x20a3, 0x2062, 0x609f, 0x0000, 0xa065, 0x609c,
580 0xa11a, 0x00c8, 0x209b, 0x8213, 0x818d, 0x0048, 0x208e, 0xa11a, 584 0xa005, 0x00c0, 0x209b, 0x7848, 0x794a, 0x2062, 0x0c7f, 0x7848,
581 0x00c8, 0x208f, 0x00f0, 0x2083, 0x0078, 0x2093, 0xa11a, 0x2308, 585 0x2062, 0x609f, 0x0000, 0xac85, 0x0000, 0x00c0, 0x20b1, 0x1078,
582 0x8210, 0x00f0, 0x2083, 0x007e, 0x3200, 0xa084, 0xf7ff, 0x2080, 586 0x29b2, 0x784a, 0x007c, 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086,
583 0x007f, 0x157f, 0x007c, 0x007e, 0x3200, 0xa085, 0x0800, 0x0078, 587 0x818e, 0x00c8, 0x20bc, 0xa200, 0x00f0, 0x20b7, 0x8086, 0x818e,
584 0x2097, 0x7d74, 0x70d0, 0xa506, 0x0040, 0x2187, 0x7810, 0x2050, 588 0x007c, 0x157e, 0x20a9, 0x0010, 0xa005, 0x0040, 0x20e2, 0xa11a,
585 0x7800, 0xd08c, 0x0040, 0x20c3, 0xdaec, 0x0040, 0x20c3, 0x0e7e, 589 0x00c8, 0x20e2, 0x8213, 0x818d, 0x0048, 0x20d5, 0xa11a, 0x00c8,
586 0x2091, 0x8000, 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0, 0x20c0, 590 0x20d6, 0x00f0, 0x20ca, 0x0078, 0x20da, 0xa11a, 0x2308, 0x8210,
587 0x7008, 0x0e7f, 0xa086, 0x0008, 0x0040, 0x20c3, 0x0078, 0x2187, 591 0x00f0, 0x20ca, 0x007e, 0x3200, 0xa084, 0xf7ff, 0x2080, 0x007f,
588 0x0e7f, 0x0078, 0x2187, 0x1078, 0x1dbd, 0x0040, 0x2187, 0xa046, 592 0x157f, 0x007c, 0x007e, 0x3200, 0xa085, 0x0800, 0x0078, 0x20de,
589 0x7970, 0x2500, 0x8000, 0xa112, 0x2009, 0x0040, 0x00c8, 0x20d2, 593 0x7d74, 0x70d0, 0xa506, 0x0040, 0x21ce, 0x7810, 0x2050, 0x7800,
590 0x0078, 0x20d9, 0x72d0, 0xa206, 0x0040, 0x20d9, 0x8840, 0x2009, 594 0xd08c, 0x0040, 0x210a, 0xdaec, 0x0040, 0x210a, 0x0e7e, 0x2091,
591 0x0080, 0x0c7e, 0x7112, 0x7007, 0x0001, 0x2099, 0x0030, 0x20a9, 595 0x8000, 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0, 0x2107, 0x7008,
592 0x0020, 0xac80, 0x0001, 0x20a0, 0x2061, 0x0000, 0x88ff, 0x0040, 596 0x0e7f, 0xa086, 0x0008, 0x0040, 0x210a, 0x0078, 0x21ce, 0x0e7f,
593 0x20eb, 0x1078, 0x1dbd, 0x7008, 0xd0fc, 0x0040, 0x20eb, 0x7007, 597 0x0078, 0x21ce, 0x1078, 0x1e04, 0x0040, 0x21ce, 0xa046, 0x7970,
594 0x0002, 0x2091, 0x8001, 0xa08c, 0x01e0, 0x00c0, 0x2122, 0x53a5, 598 0x2500, 0x8000, 0xa112, 0x2009, 0x0040, 0x00c8, 0x2119, 0x0078,
595 0x8cff, 0x00c0, 0x2100, 0x88ff, 0x0040, 0x2171, 0x0078, 0x210a, 599 0x2120, 0x72d0, 0xa206, 0x0040, 0x2120, 0x8840, 0x2009, 0x0080,
596 0x2c00, 0x788e, 0x20a9, 0x0020, 0xac80, 0x0001, 0x20a0, 0x53a5, 600 0x0c7e, 0x7112, 0x7007, 0x0001, 0x2099, 0x0030, 0x20a9, 0x0020,
597 0x0078, 0x2171, 0xa046, 0x7218, 0x731c, 0xdac4, 0x0040, 0x2112, 601 0xac80, 0x0001, 0x20a0, 0x2061, 0x0000, 0x88ff, 0x0040, 0x2132,
598 0x7420, 0x7524, 0xa292, 0x0040, 0xa39b, 0x0000, 0xa4a3, 0x0000, 602 0x1078, 0x1e04, 0x7008, 0xd0fc, 0x0040, 0x2132, 0x7007, 0x0002,
599 0xa5ab, 0x0000, 0x721a, 0x731e, 0xdac4, 0x0040, 0x2122, 0x7422, 603 0x2091, 0x8001, 0xa08c, 0x01e0, 0x00c0, 0x2169, 0x53a5, 0x8cff,
600 0x7526, 0xa006, 0x7007, 0x0004, 0x0040, 0x2171, 0x8cff, 0x0040, 604 0x00c0, 0x2147, 0x88ff, 0x0040, 0x21b8, 0x0078, 0x2151, 0x2c00,
601 0x212b, 0x1078, 0x1dc6, 0x0c7f, 0x1078, 0x1dc6, 0xa046, 0x7888, 605 0x788e, 0x20a9, 0x0020, 0xac80, 0x0001, 0x20a0, 0x53a5, 0x0078,
602 0x8000, 0x788a, 0xa086, 0x0002, 0x0040, 0x2151, 0x7a7c, 0x7b78, 606 0x21b8, 0xa046, 0x7218, 0x731c, 0xdac4, 0x0040, 0x2159, 0x7420,
603 0xdac4, 0x0040, 0x213d, 0x7c84, 0x7d80, 0x7974, 0x8107, 0x8004, 607 0x7524, 0xa292, 0x0040, 0xa39b, 0x0000, 0xa4a3, 0x0000, 0xa5ab,
604 0x8004, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 608 0x0000, 0x721a, 0x731e, 0xdac4, 0x0040, 0x2169, 0x7422, 0x7526,
605 0x721a, 0x731e, 0xdac4, 0x0040, 0x2187, 0x7422, 0x7526, 0x0078, 609 0xa006, 0x7007, 0x0004, 0x0040, 0x21b8, 0x8cff, 0x0040, 0x2172,
606 0x2187, 0x6014, 0xd0fc, 0x00c0, 0x2159, 0x2069, 0x4e40, 0x0078, 610 0x1078, 0x1e0d, 0x0c7f, 0x1078, 0x1e0d, 0xa046, 0x7888, 0x8000,
607 0x215b, 0x2069, 0x4e80, 0x2091, 0x8000, 0x681f, 0x0002, 0x88ff, 611 0x788a, 0xa086, 0x0002, 0x0040, 0x2198, 0x7a7c, 0x7b78, 0xdac4,
608 0x0040, 0x2167, 0xa046, 0x788c, 0x2060, 0x0078, 0x2151, 0x788b, 612 0x0040, 0x2184, 0x7c84, 0x7d80, 0x7974, 0x8107, 0x8004, 0x8004,
609 0x0000, 0x78ac, 0xa085, 0x0003, 0x78ae, 0x2091, 0x8001, 0x0078, 613 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x721a,
610 0x2187, 0x0c7f, 0x788b, 0x0000, 0x1078, 0x2346, 0x6004, 0xa084, 614 0x731e, 0xdac4, 0x0040, 0x21ce, 0x7422, 0x7526, 0x0078, 0x21ce,
611 0x000f, 0x1078, 0x2188, 0x88ff, 0x0040, 0x2185, 0x788c, 0x2060, 615 0x6014, 0xd0fc, 0x00c0, 0x21a0, 0x2069, 0x4f40, 0x0078, 0x21a2,
612 0x6004, 0xa084, 0x000f, 0x1078, 0x2188, 0x0078, 0x20a1, 0x007c, 616 0x2069, 0x4f80, 0x2091, 0x8000, 0x681f, 0x0002, 0x88ff, 0x0040,
613 0x0079, 0x218a, 0x219a, 0x21b8, 0x21d6, 0x219a, 0x21e7, 0x21ab, 617 0x21ae, 0xa046, 0x788c, 0x2060, 0x0078, 0x2198, 0x788b, 0x0000,
614 0x219a, 0x219a, 0x219a, 0x21b6, 0x21d4, 0x219a, 0x219a, 0x219a, 618 0x78ac, 0xa085, 0x0003, 0x78ae, 0x2091, 0x8001, 0x0078, 0x21ce,
615 0x219a, 0x219a, 0x2039, 0x0400, 0x78bc, 0xa705, 0x78be, 0x6008, 619 0x0c7f, 0x788b, 0x0000, 0x1078, 0x238d, 0x6004, 0xa084, 0x000f,
616 0xa705, 0x600a, 0x1078, 0x222a, 0x609c, 0x78ba, 0x609f, 0x0000, 620 0x1078, 0x21cf, 0x88ff, 0x0040, 0x21cc, 0x788c, 0x2060, 0x6004,
617 0x1078, 0x2330, 0x007c, 0x78bc, 0xd0c4, 0x0040, 0x21b1, 0x0078, 621 0xa084, 0x000f, 0x1078, 0x21cf, 0x0078, 0x20e8, 0x007c, 0x0079,
618 0x219a, 0x601c, 0xc0bd, 0x601e, 0x0078, 0x21be, 0x1078, 0x2378, 622 0x21d1, 0x21e1, 0x21ff, 0x221d, 0x21e1, 0x222e, 0x21f2, 0x21e1,
619 0x78bc, 0xd0c4, 0x0040, 0x21be, 0x0078, 0x219a, 0x78bf, 0x0000, 623 0x21e1, 0x21e1, 0x21fd, 0x221b, 0x21e1, 0x21e1, 0x21e1, 0x21e1,
620 0x6004, 0x8007, 0xa084, 0x00ff, 0x78b2, 0x8001, 0x0040, 0x21d1, 624 0x21e1, 0x2039, 0x0400, 0x78bc, 0xa705, 0x78be, 0x6008, 0xa705,
621 0x1078, 0x222a, 0x0040, 0x21d1, 0x78bc, 0xc0c5, 0x78be, 0x0078, 625 0x600a, 0x1078, 0x2271, 0x609c, 0x78ba, 0x609f, 0x0000, 0x1078,
622 0x21d3, 0x0078, 0x2249, 0x007c, 0x1078, 0x2374, 0x78bc, 0xa08c, 626 0x2377, 0x007c, 0x78bc, 0xd0c4, 0x0040, 0x21f8, 0x0078, 0x21e1,
623 0x0e00, 0x00c0, 0x21de, 0xd0c4, 0x00c0, 0x21e0, 0x0078, 0x219a, 627 0x601c, 0xc0bd, 0x601e, 0x0078, 0x2205, 0x1078, 0x23bf, 0x78bc,
624 0x1078, 0x222a, 0x00c0, 0x21e6, 0x0078, 0x2249, 0x007c, 0x78bc, 628 0xd0c4, 0x0040, 0x2205, 0x0078, 0x21e1, 0x78bf, 0x0000, 0x6004,
625 0xd0c4, 0x0040, 0x21ed, 0x0078, 0x219a, 0x78bf, 0x0000, 0x6714, 629 0x8007, 0xa084, 0x00ff, 0x78b2, 0x8001, 0x0040, 0x2218, 0x1078,
626 0x2011, 0x0001, 0x22a8, 0x6018, 0xa084, 0x00ff, 0xa005, 0x0040, 630 0x2271, 0x0040, 0x2218, 0x78bc, 0xc0c5, 0x78be, 0x0078, 0x221a,
627 0x220d, 0xa7bc, 0xff00, 0x20a9, 0x0020, 0xa08e, 0x0001, 0x0040, 631 0x0078, 0x2290, 0x007c, 0x1078, 0x23bb, 0x78bc, 0xa08c, 0x0e00,
628 0x220d, 0xa7bc, 0x8000, 0x2011, 0x0002, 0x20a9, 0x0100, 0xa08e, 632 0x00c0, 0x2225, 0xd0c4, 0x00c0, 0x2227, 0x0078, 0x21e1, 0x1078,
629 0x0002, 0x0040, 0x220d, 0x0078, 0x2227, 0x1078, 0x1de4, 0x2d00, 633 0x2271, 0x00c0, 0x222d, 0x0078, 0x2290, 0x007c, 0x78bc, 0xd0c4,
630 0x2091, 0x8000, 0x682b, 0x0000, 0x682f, 0x0000, 0x6808, 0xa084, 634 0x0040, 0x2234, 0x0078, 0x21e1, 0x78bf, 0x0000, 0x6714, 0x2011,
631 0xffde, 0x680a, 0xade8, 0x0010, 0x2091, 0x8001, 0x00f0, 0x2210, 635 0x0001, 0x22a8, 0x6018, 0xa084, 0x00ff, 0xa005, 0x0040, 0x2254,
632 0x8211, 0x0040, 0x2227, 0x20a9, 0x0100, 0x0078, 0x2210, 0x1078, 636 0xa7bc, 0xff00, 0x20a9, 0x0020, 0xa08e, 0x0001, 0x0040, 0x2254,
633 0x1dc6, 0x007c, 0x609f, 0x0000, 0x78b4, 0xa06d, 0x2c00, 0x78b6, 637 0xa7bc, 0x8000, 0x2011, 0x0002, 0x20a9, 0x0100, 0xa08e, 0x0002,
634 0x00c0, 0x2235, 0x78ba, 0x0078, 0x223d, 0x689e, 0x2d00, 0x6002, 638 0x0040, 0x2254, 0x0078, 0x226e, 0x1078, 0x1e2b, 0x2d00, 0x2091,
635 0x78b8, 0xad06, 0x00c0, 0x223d, 0x6002, 0x78b0, 0x8001, 0x78b2, 639 0x8000, 0x682b, 0x0000, 0x682f, 0x0000, 0x6808, 0xa084, 0xffde,
636 0x00c0, 0x2248, 0x78bc, 0xc0c4, 0x78be, 0x78b8, 0x2060, 0xa006, 640 0x680a, 0xade8, 0x0010, 0x2091, 0x8001, 0x00f0, 0x2257, 0x8211,
637 0x007c, 0x0e7e, 0xa02e, 0x2530, 0x7dba, 0x7db6, 0x65ae, 0x65b2, 641 0x0040, 0x226e, 0x20a9, 0x0100, 0x0078, 0x2257, 0x1078, 0x1e0d,
638 0x601c, 0x60a2, 0x2048, 0xa984, 0xe1ff, 0x601e, 0xa984, 0x0060, 642 0x007c, 0x609f, 0x0000, 0x78b4, 0xa06d, 0x2c00, 0x78b6, 0x00c0,
639 0x0040, 0x225c, 0x1078, 0x4632, 0x6596, 0x65a6, 0x669a, 0x66aa, 643 0x227c, 0x78ba, 0x0078, 0x2284, 0x689e, 0x2d00, 0x6002, 0x78b8,
640 0x6714, 0x2071, 0x4e80, 0xd7fc, 0x00c0, 0x2268, 0x2071, 0x4e40, 644 0xad06, 0x00c0, 0x2284, 0x6002, 0x78b0, 0x8001, 0x78b2, 0x00c0,
641 0xa784, 0x0f00, 0x800b, 0xa784, 0x001f, 0x0040, 0x2273, 0x8003, 645 0x228f, 0x78bc, 0xc0c4, 0x78be, 0x78b8, 0x2060, 0xa006, 0x007c,
642 0x8003, 0x8003, 0x8003, 0xa105, 0x71c4, 0xa168, 0x2700, 0x8007, 646 0x0e7e, 0xa02e, 0x2530, 0x7dba, 0x7db6, 0x65ae, 0x65b2, 0x601c,
643 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0x71c8, 0xa100, 0x60c2, 647 0x60a2, 0x2048, 0xa984, 0xe1ff, 0x601e, 0xa984, 0x0060, 0x0040,
644 0x2091, 0x8000, 0x7814, 0xd0c4, 0x0040, 0x2298, 0xd0ec, 0x0040, 648 0x22a3, 0x1078, 0x46b6, 0x6596, 0x65a6, 0x669a, 0x66aa, 0x6714,
645 0x2294, 0xd7fc, 0x00c0, 0x2291, 0xd0f4, 0x00c0, 0x229f, 0x0078, 649 0x2071, 0x4f80, 0xd7fc, 0x00c0, 0x22af, 0x2071, 0x4f40, 0xa784,
646 0x2298, 0xd0fc, 0x00c0, 0x229f, 0x7810, 0xd0f4, 0x00c0, 0x229f, 650 0x0f00, 0x800b, 0xa784, 0x001f, 0x0040, 0x22ba, 0x8003, 0x8003,
647 0x6e08, 0xd684, 0x0040, 0x22c9, 0xd9fc, 0x00c0, 0x22c9, 0x2091, 651 0x8003, 0x8003, 0xa105, 0x71c4, 0xa168, 0x2700, 0x8007, 0xa084,
648 0x8001, 0x1078, 0x1e5b, 0x2091, 0x8000, 0x1078, 0x201d, 0x2091, 652 0x000f, 0x8003, 0x8003, 0x8003, 0x71c8, 0xa100, 0x60c2, 0x2091,
649 0x8001, 0x7814, 0xd0e4, 0x00c0, 0x232e, 0x7814, 0xd0c4, 0x0040, 653 0x8000, 0x7814, 0xd0c4, 0x0040, 0x22df, 0xd0ec, 0x0040, 0x22db,
650 0x232e, 0xd0ec, 0x0040, 0x22c1, 0xd7fc, 0x00c0, 0x22bc, 0xd0f4, 654 0xd7fc, 0x00c0, 0x22d8, 0xd0f4, 0x00c0, 0x22e6, 0x0078, 0x22df,
651 0x00c0, 0x22c5, 0x0078, 0x232e, 0xd0fc, 0x00c0, 0x22c5, 0x0078, 655 0xd0fc, 0x00c0, 0x22e6, 0x7810, 0xd0f4, 0x00c0, 0x22e6, 0x6e08,
652 0x232e, 0x7810, 0xd0f4, 0x0040, 0x232e, 0x601b, 0x0021, 0x0078, 656 0xd684, 0x0040, 0x2310, 0xd9fc, 0x00c0, 0x2310, 0x2091, 0x8001,
653 0x232e, 0x6024, 0xa096, 0x0001, 0x00c0, 0x22d0, 0x8000, 0x6026, 657 0x1078, 0x1ea2, 0x2091, 0x8000, 0x1078, 0x2064, 0x2091, 0x8001,
654 0x6a10, 0x6814, 0xa202, 0x0048, 0x22e3, 0x0040, 0x22e3, 0x2091, 658 0x7814, 0xd0e4, 0x00c0, 0x2375, 0x7814, 0xd0c4, 0x0040, 0x2375,
655 0x8001, 0x2039, 0x0200, 0x609c, 0x78ba, 0x609f, 0x0000, 0x1078, 659 0xd0ec, 0x0040, 0x2308, 0xd7fc, 0x00c0, 0x2303, 0xd0f4, 0x00c0,
656 0x2330, 0x0078, 0x232e, 0x2c08, 0xd9fc, 0x0040, 0x230b, 0x6800, 660 0x230c, 0x0078, 0x2375, 0xd0fc, 0x00c0, 0x230c, 0x0078, 0x2375,
657 0xa065, 0x0040, 0x230b, 0x6a04, 0x7000, 0xa084, 0x0002, 0x0040, 661 0x7810, 0xd0f4, 0x0040, 0x2375, 0x601b, 0x0021, 0x0078, 0x2375,
658 0x2301, 0x704c, 0xa206, 0x00c0, 0x2301, 0x6b04, 0x2160, 0x2304, 662 0x6024, 0xa096, 0x0001, 0x00c0, 0x2317, 0x8000, 0x6026, 0x6a10,
659 0x6002, 0xa005, 0x00c0, 0x22fd, 0x6902, 0x2260, 0x6102, 0x0078, 663 0x6814, 0xa202, 0x0048, 0x232a, 0x0040, 0x232a, 0x2091, 0x8001,
660 0x2317, 0x2d00, 0x2060, 0x1078, 0x2acc, 0x6e08, 0x2160, 0x6202, 664 0x2039, 0x0200, 0x609c, 0x78ba, 0x609f, 0x0000, 0x1078, 0x2377,
661 0x6906, 0x0078, 0x2317, 0x6800, 0x6902, 0xa065, 0x0040, 0x2313, 665 0x0078, 0x2375, 0x2c08, 0xd9fc, 0x0040, 0x2352, 0x6800, 0xa065,
662 0x6102, 0x0078, 0x2314, 0x6906, 0x2160, 0x6003, 0x0000, 0x2160, 666 0x0040, 0x2352, 0x6a04, 0x7000, 0xa084, 0x0002, 0x0040, 0x2348,
663 0xd9fc, 0x0040, 0x231e, 0xa6b4, 0xfffc, 0x6e0a, 0x6810, 0x7d08, 667 0x704c, 0xa206, 0x00c0, 0x2348, 0x6b04, 0x2160, 0x2304, 0x6002,
664 0x8528, 0x7d0a, 0x8000, 0x6812, 0x2091, 0x8001, 0xd6b4, 0x0040, 668 0xa005, 0x00c0, 0x2344, 0x6902, 0x2260, 0x6102, 0x0078, 0x235e,
665 0x232e, 0xa6b6, 0x0040, 0x6e0a, 0x1078, 0x1e6c, 0x0e7f, 0x007c, 669 0x2d00, 0x2060, 0x1078, 0x2b13, 0x6e08, 0x2160, 0x6202, 0x6906,
666 0x6008, 0xa705, 0x600a, 0x2091, 0x8000, 0x1078, 0x201d, 0x2091, 670 0x0078, 0x235e, 0x6800, 0x6902, 0xa065, 0x0040, 0x235a, 0x6102,
667 0x8001, 0x78b8, 0xa065, 0x0040, 0x2343, 0x609c, 0x78ba, 0x609f, 671 0x0078, 0x235b, 0x6906, 0x2160, 0x6003, 0x0000, 0x2160, 0xd9fc,
668 0x0000, 0x0078, 0x2330, 0x78b6, 0x78ba, 0x007c, 0x7970, 0x7874, 672 0x0040, 0x2365, 0xa6b4, 0xfffc, 0x6e0a, 0x6810, 0x7d08, 0x8528,
669 0x2818, 0xd384, 0x0040, 0x2350, 0x8000, 0xa112, 0x0048, 0x2355, 673 0x7d0a, 0x8000, 0x6812, 0x2091, 0x8001, 0xd6b4, 0x0040, 0x2375,
670 0x8000, 0xa112, 0x00c8, 0x2365, 0xc384, 0x7a7c, 0x721a, 0x7a78, 674 0xa6b6, 0x0040, 0x6e0a, 0x1078, 0x1eb3, 0x0e7f, 0x007c, 0x6008,
671 0x721e, 0xdac4, 0x0040, 0x2360, 0x7a84, 0x7222, 0x7a80, 0x7226, 675 0xa705, 0x600a, 0x2091, 0x8000, 0x1078, 0x2064, 0x2091, 0x8001,
672 0xa006, 0xd384, 0x0040, 0x2365, 0x8000, 0x7876, 0x70d2, 0x781c, 676 0x78b8, 0xa065, 0x0040, 0x238a, 0x609c, 0x78ba, 0x609f, 0x0000,
673 0xa005, 0x0040, 0x2373, 0x8001, 0x781e, 0x00c0, 0x2373, 0x0068, 677 0x0078, 0x2377, 0x78b6, 0x78ba, 0x007c, 0x7970, 0x7874, 0x2818,
674 0x2373, 0x2091, 0x4080, 0x007c, 0x2039, 0x238c, 0x0078, 0x237a, 678 0xd384, 0x0040, 0x2397, 0x8000, 0xa112, 0x0048, 0x239c, 0x8000,
675 0x2039, 0x2392, 0x2704, 0xa005, 0x0040, 0x238b, 0xac00, 0x2068, 679 0xa112, 0x00c8, 0x23ac, 0xc384, 0x7a7c, 0x721a, 0x7a78, 0x721e,
676 0x6908, 0x6810, 0x6912, 0x680a, 0x690c, 0x6814, 0x6916, 0x680e, 680 0xdac4, 0x0040, 0x23a7, 0x7a84, 0x7222, 0x7a80, 0x7226, 0xa006,
677 0x8738, 0x0078, 0x237a, 0x007c, 0x0003, 0x0009, 0x000f, 0x0015, 681 0xd384, 0x0040, 0x23ac, 0x8000, 0x7876, 0x70d2, 0x781c, 0xa005,
678 0x001b, 0x0000, 0x0015, 0x001b, 0x0000, 0x2041, 0x0000, 0x780c, 682 0x0040, 0x23ba, 0x8001, 0x781e, 0x00c0, 0x23ba, 0x0068, 0x23ba,
679 0x0079, 0x239a, 0x256c, 0x253f, 0x239e, 0x2417, 0x2039, 0x9674, 683 0x2091, 0x4080, 0x007c, 0x2039, 0x23d3, 0x0078, 0x23c1, 0x2039,
680 0x2734, 0x7d10, 0x0078, 0x23be, 0x6084, 0xa086, 0x0103, 0x00c0, 684 0x23d9, 0x2704, 0xa005, 0x0040, 0x23d2, 0xac00, 0x2068, 0x6908,
681 0x2400, 0x6114, 0x6018, 0xa105, 0x0040, 0x23b3, 0x86ff, 0x00c0, 685 0x6810, 0x6912, 0x680a, 0x690c, 0x6814, 0x6916, 0x680e, 0x8738,
682 0x23cf, 0x0078, 0x2400, 0x8603, 0xa080, 0x9655, 0x620c, 0x2202, 686 0x0078, 0x23c1, 0x007c, 0x0003, 0x0009, 0x000f, 0x0015, 0x001b,
683 0x8000, 0x6210, 0x2202, 0x1078, 0x203f, 0x8630, 0xa68e, 0x000f, 687 0x0000, 0x0015, 0x001b, 0x0000, 0x2041, 0x0000, 0x780c, 0x0079,
684 0x0040, 0x248b, 0x786c, 0xa065, 0x00c0, 0x23a4, 0x7808, 0xa602, 688 0x23e1, 0x25b3, 0x2586, 0x23e5, 0x245e, 0x2039, 0x9774, 0x2734,
685 0x00c8, 0x23cf, 0xd5ac, 0x00c0, 0x23cf, 0x263a, 0x007c, 0xa682, 689 0x7d10, 0x0078, 0x2405, 0x6084, 0xa086, 0x0103, 0x00c0, 0x2447,
686 0x0003, 0x00c8, 0x248b, 0x2091, 0x8000, 0x2069, 0x0000, 0x6818, 690 0x6114, 0x6018, 0xa105, 0x0040, 0x23fa, 0x86ff, 0x00c0, 0x2416,
687 0xd084, 0x00c0, 0x23fb, 0x2011, 0x9655, 0x2204, 0x70c6, 0x8210, 691 0x0078, 0x2447, 0x8603, 0xa080, 0x9755, 0x620c, 0x2202, 0x8000,
688 0x2204, 0x70ca, 0xd684, 0x00c0, 0x23eb, 0x8210, 0x2204, 0x70da, 692 0x6210, 0x2202, 0x1078, 0x2086, 0x8630, 0xa68e, 0x000f, 0x0040,
689 0x8210, 0x2204, 0x70de, 0xa685, 0x8020, 0x70c2, 0x681b, 0x0001, 693 0x24d2, 0x786c, 0xa065, 0x00c0, 0x23eb, 0x7808, 0xa602, 0x00c8,
694 0x2416, 0xd5ac, 0x00c0, 0x2416, 0x263a, 0x007c, 0xa682, 0x0003,
695 0x00c8, 0x24d2, 0x2091, 0x8000, 0x2069, 0x0000, 0x6818, 0xd084,
696 0x00c0, 0x2442, 0x2011, 0x9755, 0x2204, 0x70c6, 0x8210, 0x2204,
697 0x70ca, 0xd684, 0x00c0, 0x2432, 0x8210, 0x2204, 0x70da, 0x8210,
698 0x2204, 0x70de, 0xa685, 0x8020, 0x70c2, 0x681b, 0x0001, 0x2091,
699 0x4080, 0x7810, 0xa084, 0xffcf, 0x7812, 0x2091, 0x8001, 0x203b,
700 0x0000, 0x007c, 0x7810, 0xc0ad, 0x7812, 0x0078, 0x24d2, 0x263a,
701 0x1078, 0x25bd, 0x00c0, 0x25e0, 0x786c, 0xa065, 0x00c0, 0x23eb,
702 0x2091, 0x8000, 0x7810, 0xa084, 0xffcf, 0x86ff, 0x0040, 0x2459,
703 0xc0ad, 0x7812, 0x2091, 0x8001, 0x0078, 0x25e0, 0x2039, 0x9774,
704 0x2734, 0x7d10, 0x0078, 0x247a, 0x6084, 0xa086, 0x0103, 0x00c0,
705 0x24bb, 0x6114, 0x6018, 0xa105, 0x0040, 0x2473, 0x86ff, 0x00c0,
706 0x248b, 0x0078, 0x24bb, 0xa680, 0x9755, 0x620c, 0x2202, 0x1078,
707 0x2086, 0x8630, 0xa68e, 0x001e, 0x0040, 0x24d2, 0x786c, 0xa065,
708 0x00c0, 0x2464, 0x7808, 0xa602, 0x00c8, 0x248b, 0xd5ac, 0x00c0,
709 0x248b, 0x263a, 0x007c, 0xa682, 0x0006, 0x00c8, 0x24d2, 0x2091,
710 0x8000, 0x2069, 0x0000, 0x6818, 0xd084, 0x00c0, 0x24b6, 0x2011,
711 0x9755, 0x2009, 0x974e, 0x26a8, 0x211c, 0x2204, 0x201a, 0x8108,
712 0x8210, 0x00f0, 0x249c, 0xa685, 0x8030, 0x70c2, 0x681b, 0x0001,
690 0x2091, 0x4080, 0x7810, 0xa084, 0xffcf, 0x7812, 0x2091, 0x8001, 713 0x2091, 0x4080, 0x7810, 0xa084, 0xffcf, 0x7812, 0x2091, 0x8001,
691 0x203b, 0x0000, 0x007c, 0x7810, 0xc0ad, 0x7812, 0x0078, 0x248b, 714 0xa006, 0x2009, 0x9775, 0x200a, 0x203a, 0x007c, 0x7810, 0xc0ad,
692 0x263a, 0x1078, 0x2576, 0x00c0, 0x2599, 0x786c, 0xa065, 0x00c0, 715 0x7812, 0x0078, 0x24d2, 0x263a, 0x1078, 0x25bd, 0x00c0, 0x25e0,
693 0x23a4, 0x2091, 0x8000, 0x7810, 0xa084, 0xffcf, 0x86ff, 0x0040, 716 0x786c, 0xa065, 0x00c0, 0x2464, 0x2091, 0x8000, 0x7810, 0xa084,
694 0x2412, 0xc0ad, 0x7812, 0x2091, 0x8001, 0x0078, 0x2599, 0x2039, 717 0xffcf, 0x86ff, 0x0040, 0x24cd, 0xc0ad, 0x7812, 0x2091, 0x8001,
695 0x9674, 0x2734, 0x7d10, 0x0078, 0x2433, 0x6084, 0xa086, 0x0103, 718 0x0078, 0x25e0, 0x2091, 0x8000, 0x7007, 0x0004, 0x7994, 0x70d4,
696 0x00c0, 0x2474, 0x6114, 0x6018, 0xa105, 0x0040, 0x242c, 0x86ff, 719 0xa102, 0x0048, 0x24e3, 0x0040, 0x24ed, 0x7b90, 0xa302, 0x00c0,
697 0x00c0, 0x2444, 0x0078, 0x2474, 0xa680, 0x9655, 0x620c, 0x2202, 720 0x24ed, 0x0078, 0x24e6, 0x8002, 0x00c0, 0x24ed, 0x263a, 0x7810,
698 0x1078, 0x203f, 0x8630, 0xa68e, 0x001e, 0x0040, 0x248b, 0x786c, 721 0xc0ad, 0x7812, 0x2091, 0x8001, 0x007c, 0xa184, 0xff00, 0x0040,
699 0xa065, 0x00c0, 0x241d, 0x7808, 0xa602, 0x00c8, 0x2444, 0xd5ac, 722 0x24fa, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100,
700 0x00c0, 0x2444, 0x263a, 0x007c, 0xa682, 0x0006, 0x00c8, 0x248b, 723 0x0078, 0x24fd, 0x8107, 0x8004, 0x8004, 0x7a9c, 0xa210, 0x721a,
701 0x2091, 0x8000, 0x2069, 0x0000, 0x6818, 0xd084, 0x00c0, 0x246f, 724 0x7a98, 0xa006, 0xa211, 0x721e, 0xd4c4, 0x0040, 0x250d, 0x7aa4,
702 0x2011, 0x9655, 0x2009, 0x964e, 0x26a8, 0x211c, 0x2204, 0x201a, 725 0xa211, 0x7222, 0x7aa0, 0xa211, 0x7226, 0x20a1, 0x0030, 0x7003,
703 0x8108, 0x8210, 0x00f0, 0x2455, 0xa685, 0x8030, 0x70c2, 0x681b, 726 0x0000, 0x2009, 0x9754, 0x260a, 0x8109, 0x2198, 0x2104, 0xd084,
704 0x0001, 0x2091, 0x4080, 0x7810, 0xa084, 0xffcf, 0x7812, 0x2091, 727 0x0040, 0x251b, 0x8633, 0xa6b0, 0x0002, 0x26a8, 0x53a6, 0x8603,
705 0x8001, 0xa006, 0x2009, 0x9675, 0x200a, 0x203a, 0x007c, 0x7810, 728 0x7012, 0x7007, 0x0001, 0x7990, 0x7894, 0x8000, 0xa10a, 0x00c8,
706 0xc0ad, 0x7812, 0x0078, 0x248b, 0x263a, 0x1078, 0x2576, 0x00c0, 729 0x252a, 0xa006, 0x2028, 0x7974, 0xa184, 0xff00, 0x0040, 0x2539,
707 0x2599, 0x786c, 0xa065, 0x00c0, 0x241d, 0x2091, 0x8000, 0x7810, 730 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0078,
708 0xa084, 0xffcf, 0x86ff, 0x0040, 0x2486, 0xc0ad, 0x7812, 0x2091, 731 0x253c, 0x8107, 0x8004, 0x8004, 0x797c, 0xa108, 0x7a78, 0xa006,
709 0x8001, 0x0078, 0x2599, 0x2091, 0x8000, 0x7007, 0x0004, 0x7994, 732 0xa211, 0xd4c4, 0x0040, 0x2548, 0x7b84, 0xa319, 0x7c80, 0xa421,
710 0x70d4, 0xa102, 0x0048, 0x249c, 0x0040, 0x24a6, 0x7b90, 0xa302, 733 0x7008, 0xd0fc, 0x0040, 0x2548, 0xa084, 0x01e0, 0x0040, 0x256d,
711 0x00c0, 0x24a6, 0x0078, 0x249f, 0x8002, 0x00c0, 0x24a6, 0x263a, 734 0x7d10, 0x2031, 0x9754, 0x2634, 0x78a8, 0x8000, 0x78aa, 0xd08c,
712 0x7810, 0xc0ad, 0x7812, 0x2091, 0x8001, 0x007c, 0xa184, 0xff00, 735 0x00c0, 0x2562, 0x7007, 0x0006, 0x7004, 0xd094, 0x00c0, 0x255c,
713 0x0040, 0x24b3, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 736 0x0078, 0x24d4, 0x2069, 0x4f47, 0x206b, 0x0003, 0x78ac, 0xa085,
714 0xa100, 0x0078, 0x24b6, 0x8107, 0x8004, 0x8004, 0x7a9c, 0xa210, 737 0x0300, 0x78ae, 0xa006, 0x0078, 0x2576, 0x2030, 0x75d6, 0x2091,
715 0x721a, 0x7a98, 0xa006, 0xa211, 0x721e, 0xd4c4, 0x0040, 0x24c6, 738 0x4080, 0x7d96, 0x7d10, 0xa5ac, 0xffcf, 0x7d12, 0x2091, 0x8001,
716 0x7aa4, 0xa211, 0x7222, 0x7aa0, 0xa211, 0x7226, 0x20a1, 0x0030, 739 0x78aa, 0x7007, 0x0006, 0x263a, 0x7003, 0x0001, 0x711a, 0x721e,
717 0x7003, 0x0000, 0x2009, 0x9654, 0x260a, 0x8109, 0x2198, 0x2104, 740 0xd5c4, 0x0040, 0x2585, 0x7322, 0x7426, 0x007c, 0x6084, 0xa086,
718 0xd084, 0x0040, 0x24d4, 0x8633, 0xa6b0, 0x0002, 0x26a8, 0x53a6, 741 0x0103, 0x00c0, 0x25a9, 0x6114, 0x6018, 0xa105, 0x00c0, 0x25a9,
719 0x8603, 0x7012, 0x7007, 0x0001, 0x7990, 0x7894, 0x8000, 0xa10a, 742 0x2069, 0x0000, 0x6818, 0xd084, 0x00c0, 0x25a9, 0x600c, 0x70c6,
720 0x00c8, 0x24e3, 0xa006, 0x2028, 0x7974, 0xa184, 0xff00, 0x0040, 743 0x6010, 0x70ca, 0x70c3, 0x8020, 0x681b, 0x0001, 0x2091, 0x4080,
721 0x24f2, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 744 0x1078, 0x2086, 0x0068, 0x25a8, 0x786c, 0xa065, 0x00c0, 0x2586,
722 0x0078, 0x24f5, 0x8107, 0x8004, 0x8004, 0x797c, 0xa108, 0x7a78, 745 0x007c, 0x1078, 0x25bd, 0x00c0, 0x25e0, 0x786c, 0xa065, 0x00c0,
723 0xa006, 0xa211, 0xd4c4, 0x0040, 0x2501, 0x7b84, 0xa319, 0x7c80, 746 0x2586, 0x0078, 0x25e0, 0x1078, 0x25bd, 0x00c0, 0x25e0, 0x786c,
724 0xa421, 0x7008, 0xd0fc, 0x0040, 0x2501, 0xa084, 0x01e0, 0x0040, 747 0xa065, 0x00c0, 0x25b3, 0x0078, 0x25e0, 0x6084, 0xa086, 0x0103,
725 0x2526, 0x7d10, 0x2031, 0x9654, 0x2634, 0x78a8, 0x8000, 0x78aa, 748 0x00c0, 0x25d1, 0x6018, 0xc0fc, 0x601a, 0xa086, 0x0004, 0x00c0,
726 0xd08c, 0x00c0, 0x251b, 0x7007, 0x0006, 0x7004, 0xd094, 0x00c0, 749 0x25d1, 0x7804, 0xd0a4, 0x0040, 0x25d1, 0x1078, 0x2086, 0xa006,
727 0x2515, 0x0078, 0x248d, 0x2069, 0x4e47, 0x206b, 0x0003, 0x78ac, 750 0x007c, 0x1078, 0x25e6, 0x00c0, 0x25d8, 0xa085, 0x0001, 0x007c,
728 0xa085, 0x0300, 0x78ae, 0xa006, 0x0078, 0x252f, 0x2030, 0x75d6, 751 0x1078, 0x25f5, 0x00c0, 0x25de, 0x2041, 0x0001, 0x7d10, 0x007c,
729 0x2091, 0x4080, 0x7d96, 0x7d10, 0xa5ac, 0xffcf, 0x7d12, 0x2091, 752 0x88ff, 0x0040, 0x25e5, 0x2091, 0x4080, 0x007c, 0x7b90, 0x7994,
730 0x8001, 0x78aa, 0x7007, 0x0006, 0x263a, 0x7003, 0x0001, 0x711a, 753 0x70d4, 0xa102, 0x00c0, 0x25ef, 0xa385, 0x0000, 0x007c, 0x0048,
731 0x721e, 0xd5c4, 0x0040, 0x253e, 0x7322, 0x7426, 0x007c, 0x6084, 754 0x25f3, 0xa302, 0x007c, 0x8002, 0x007c, 0x7810, 0xd0ec, 0x0040,
732 0xa086, 0x0103, 0x00c0, 0x2562, 0x6114, 0x6018, 0xa105, 0x00c0, 755 0x260d, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x0020, 0x7004, 0xa005,
733 0x2562, 0x2069, 0x0000, 0x6818, 0xd084, 0x00c0, 0x2562, 0x600c, 756 0x00c0, 0x260a, 0x7008, 0x0e7f, 0xa086, 0x0008, 0x0040, 0x260d,
734 0x70c6, 0x6010, 0x70ca, 0x70c3, 0x8020, 0x681b, 0x0001, 0x2091, 757 0x0078, 0x265e, 0x0e7f, 0x0078, 0x265e, 0xa184, 0xff00, 0x0040,
735 0x4080, 0x1078, 0x203f, 0x0068, 0x2561, 0x786c, 0xa065, 0x00c0, 758 0x261a, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100,
736 0x253f, 0x007c, 0x1078, 0x2576, 0x00c0, 0x2599, 0x786c, 0xa065, 759 0x0078, 0x261d, 0x8107, 0x8004, 0x8004, 0x7a9c, 0x7b98, 0x7ca4,
737 0x00c0, 0x253f, 0x0078, 0x2599, 0x1078, 0x2576, 0x00c0, 0x2599, 760 0x7da0, 0xa210, 0xa006, 0xa319, 0xa421, 0xa529, 0x2009, 0x0018,
738 0x786c, 0xa065, 0x00c0, 0x256c, 0x0078, 0x2599, 0x6084, 0xa086, 761 0x6028, 0xa005, 0x0040, 0x262e, 0x2009, 0x0040, 0x1078, 0x1dbb,
739 0x0103, 0x00c0, 0x258a, 0x6018, 0xc0fc, 0x601a, 0xa086, 0x0004, 762 0x0040, 0x2650, 0x78a8, 0x8000, 0x78aa, 0xd08c, 0x00c0, 0x265e,
740 0x00c0, 0x258a, 0x7804, 0xd0a4, 0x0040, 0x258a, 0x1078, 0x203f, 763 0x6014, 0xd0fc, 0x00c0, 0x2640, 0x2069, 0x4f40, 0x0078, 0x2642,
741 0xa006, 0x007c, 0x1078, 0x259f, 0x00c0, 0x2591, 0xa085, 0x0001, 764 0x2069, 0x4f80, 0x2091, 0x8000, 0x681f, 0x0003, 0x78ab, 0x0000,
742 0x007c, 0x1078, 0x25ae, 0x00c0, 0x2597, 0x2041, 0x0001, 0x7d10, 765 0x78ac, 0xa085, 0x0300, 0x78ae, 0x2091, 0x8001, 0x0078, 0x265e,
743 0x007c, 0x88ff, 0x0040, 0x259e, 0x2091, 0x4080, 0x007c, 0x7b90, 766 0x78ab, 0x0000, 0x1078, 0x2086, 0x7990, 0x7894, 0x8000, 0xa10a,
744 0x7994, 0x70d4, 0xa102, 0x00c0, 0x25a8, 0xa385, 0x0000, 0x007c, 767 0x00c8, 0x265b, 0xa006, 0x7896, 0x70d6, 0xa006, 0x2071, 0x0010,
745 0x0048, 0x25ac, 0xa302, 0x007c, 0x8002, 0x007c, 0x7810, 0xd0ec, 768 0x2091, 0x8001, 0x007c, 0xd7fc, 0x00c0, 0x266a, 0x2009, 0x4f59,
746 0x0040, 0x25c6, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x0020, 0x7004, 769 0x0078, 0x266c, 0x2009, 0x4f99, 0x2091, 0x8000, 0x200a, 0x0f7e,
747 0xa005, 0x00c0, 0x25c3, 0x7008, 0x0e7f, 0xa086, 0x0008, 0x0040, 770 0xd7fc, 0x00c0, 0x2683, 0x2009, 0x4f40, 0x2001, 0x4f04, 0x2004,
748 0x25c6, 0x0078, 0x2617, 0x0e7f, 0x0078, 0x2617, 0xa184, 0xff00, 771 0xd0ec, 0x0040, 0x267f, 0x2079, 0x0100, 0x0078, 0x2687, 0x2079,
749 0x0040, 0x25d3, 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 772 0x0200, 0x0078, 0x2687, 0x2009, 0x4f80, 0x2079, 0x0100, 0x2104,
750 0xa100, 0x0078, 0x25d6, 0x8107, 0x8004, 0x8004, 0x7a9c, 0x7b98, 773 0xa086, 0x0000, 0x00c0, 0x26a0, 0xd7fc, 0x00c0, 0x2693, 0x2009,
751 0x7ca4, 0x7da0, 0xa210, 0xa006, 0xa319, 0xa421, 0xa529, 0x2009, 774 0x4f45, 0x0078, 0x2695, 0x2009, 0x4f85, 0x2104, 0xa005, 0x00c0,
752 0x0018, 0x6028, 0xa005, 0x0040, 0x25e7, 0x2009, 0x0040, 0x1078, 775 0x26a0, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x26a0, 0x781b, 0x0045,
753 0x1d74, 0x0040, 0x2609, 0x78a8, 0x8000, 0x78aa, 0xd08c, 0x00c0, 776 0x0f7f, 0x007c, 0x2009, 0x0002, 0x2069, 0x4f00, 0x6810, 0xd0ec,
754 0x2617, 0x6014, 0xd0fc, 0x00c0, 0x25f9, 0x2069, 0x4e40, 0x0078, 777 0x00c0, 0x270f, 0x2071, 0x4f80, 0x2079, 0x0100, 0x2021, 0x51bf,
755 0x25fb, 0x2069, 0x4e80, 0x2091, 0x8000, 0x681f, 0x0003, 0x78ab, 778 0x784b, 0x000f, 0x2019, 0x44a7, 0xd184, 0x0040, 0x26c3, 0x6810,
756 0x0000, 0x78ac, 0xa085, 0x0300, 0x78ae, 0x2091, 0x8001, 0x0078, 779 0xd0ec, 0x0040, 0x26bf, 0x20a1, 0x012b, 0x0078, 0x26c5, 0x20a1,
757 0x2617, 0x78ab, 0x0000, 0x1078, 0x203f, 0x7990, 0x7894, 0x8000, 780 0x022b, 0x0078, 0x26c5, 0x20a1, 0x012b, 0x2304, 0xa005, 0x0040,
758 0xa10a, 0x00c8, 0x2614, 0xa006, 0x7896, 0x70d6, 0xa006, 0x2071, 781 0x26d2, 0x789a, 0x8318, 0x23ac, 0x8318, 0x2398, 0x53a6, 0x3318,
759 0x0010, 0x2091, 0x8001, 0x007c, 0xd7fc, 0x00c0, 0x2623, 0x2009, 782 0x0078, 0x26c5, 0x789b, 0x0020, 0x20a9, 0x0010, 0x6814, 0xd0e4,
760 0x4e59, 0x0078, 0x2625, 0x2009, 0x4e99, 0x2091, 0x8000, 0x200a, 783 0x0040, 0x26e2, 0x78af, 0x0000, 0x78af, 0x9020, 0x00f0, 0x26da,
761 0x0f7e, 0xd7fc, 0x00c0, 0x263c, 0x2009, 0x4e40, 0x2001, 0x4e04, 784 0x0078, 0x26e8, 0x78af, 0x0000, 0x78af, 0x8020, 0x00f0, 0x26e2,
762 0x2004, 0xd0ec, 0x0040, 0x2638, 0x2079, 0x0100, 0x0078, 0x2640, 785 0x7003, 0x0000, 0x017e, 0xd18c, 0x2009, 0x0000, 0x0040, 0x26f1,
763 0x2079, 0x0200, 0x0078, 0x2640, 0x2009, 0x4e80, 0x2079, 0x0100, 786 0xc1bd, 0x1078, 0x28e2, 0x017f, 0x7020, 0xa084, 0x000f, 0x007e,
764 0x2104, 0xa086, 0x0000, 0x00c0, 0x2659, 0xd7fc, 0x00c0, 0x264c, 787 0x6814, 0xd0e4, 0x007f, 0x00c0, 0x2701, 0xa085, 0x6340, 0x0078,
765 0x2009, 0x4e45, 0x0078, 0x264e, 0x2009, 0x4e85, 0x2104, 0xa005, 788 0x2703, 0xa085, 0x62c0, 0x7806, 0x780f, 0x9200, 0x7843, 0x00d8,
766 0x00c0, 0x2659, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x2659, 0x781b, 789 0x7853, 0x0080, 0x780b, 0x0008, 0x7456, 0x7053, 0x0000, 0x8109,
767 0x0045, 0x0f7f, 0x007c, 0x2009, 0x0002, 0x2069, 0x4e00, 0x6810, 790 0x0040, 0x2722, 0x2071, 0x4f40, 0x6810, 0xd0ec, 0x0040, 0x271c,
768 0xd0ec, 0x00c0, 0x26c8, 0x2071, 0x4e80, 0x2079, 0x0100, 0x2021, 791 0x2079, 0x0100, 0x0078, 0x271e, 0x2079, 0x0200, 0x2021, 0x4fbf,
769 0x50bf, 0x784b, 0x000f, 0x2019, 0x4457, 0xd184, 0x0040, 0x267c, 792 0x0078, 0x26b0, 0x007c, 0x017e, 0xd1bc, 0x00c0, 0x2737, 0x007e,
770 0x6810, 0xd0ec, 0x0040, 0x2678, 0x20a1, 0x012b, 0x0078, 0x267e, 793 0x2001, 0x4f04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x2733, 0x2011,
771 0x20a1, 0x022b, 0x0078, 0x267e, 0x20a1, 0x012b, 0x2304, 0xa005, 794 0x0101, 0x0078, 0x2739, 0x2011, 0x0201, 0x0078, 0x2739, 0x2011,
772 0x0040, 0x268b, 0x789a, 0x8318, 0x23ac, 0x8318, 0x2398, 0x53a6, 795 0x0101, 0xa18c, 0x000f, 0x2204, 0xa084, 0xfff0, 0xa105, 0x2012,
773 0x3318, 0x0078, 0x267e, 0x789b, 0x0020, 0x20a9, 0x0010, 0x6814, 796 0x017f, 0x1078, 0x28e2, 0x007c, 0xd3fc, 0x00c0, 0x2757, 0x007e,
774 0xd0e4, 0x0040, 0x269b, 0x78af, 0x0000, 0x78af, 0x9020, 0x00f0, 797 0x2001, 0x4f04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x2753, 0x2011,
775 0x2693, 0x0078, 0x26a1, 0x78af, 0x0000, 0x78af, 0x8020, 0x00f0, 798 0x0101, 0x0078, 0x2759, 0x2011, 0x0201, 0x0078, 0x2759, 0x2011,
776 0x269b, 0x7003, 0x0000, 0x017e, 0xd18c, 0x2009, 0x0000, 0x0040, 799 0x0101, 0x20a9, 0x0009, 0x810b, 0x00f0, 0x275b, 0xa18c, 0x0e00,
777 0x26aa, 0xc1bd, 0x1078, 0x289b, 0x017f, 0x7020, 0xa084, 0x000f, 800 0x2204, 0xa084, 0xf1ff, 0xa105, 0x2012, 0x007c, 0x2019, 0x0002,
778 0x007e, 0x6814, 0xd0e4, 0x007f, 0x00c0, 0x26ba, 0xa085, 0x6340, 801 0x2001, 0x4f04, 0x2004, 0xd0ec, 0x0040, 0x2773, 0x8319, 0x2009,
779 0x0078, 0x26bc, 0xa085, 0x62c0, 0x7806, 0x780f, 0x9200, 0x7843, 802 0x0101, 0x0078, 0x2775, 0x2009, 0x0101, 0x20a9, 0x0005, 0x8213,
780 0x00d8, 0x7853, 0x0080, 0x780b, 0x0008, 0x7456, 0x7053, 0x0000, 803 0x00f0, 0x2777, 0xa294, 0x00e0, 0x2104, 0xa084, 0xff1f, 0xa205,
781 0x8109, 0x0040, 0x26db, 0x2071, 0x4e40, 0x6810, 0xd0ec, 0x0040, 804 0x200a, 0x8319, 0x0040, 0x2788, 0x2009, 0x0201, 0x0078, 0x2775,
782 0x26d5, 0x2079, 0x0100, 0x0078, 0x26d7, 0x2079, 0x0200, 0x2021, 805 0x007c, 0xd3fc, 0x00c0, 0x279c, 0x007e, 0x2001, 0x4f04, 0x2004,
783 0x4ebf, 0x0078, 0x2669, 0x007c, 0x017e, 0xd1bc, 0x00c0, 0x26f0, 806 0xd0ec, 0x007f, 0x0040, 0x2798, 0x2011, 0x0101, 0x0078, 0x279e,
784 0x007e, 0x2001, 0x4e04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x26ec, 807 0x2011, 0x0201, 0x0078, 0x279e, 0x2011, 0x0101, 0x20a9, 0x000c,
785 0x2011, 0x0101, 0x0078, 0x26f2, 0x2011, 0x0201, 0x0078, 0x26f2, 808 0x810b, 0x00f0, 0x27a0, 0xa18c, 0xf000, 0x2204, 0xa084, 0x0fff,
786 0x2011, 0x0101, 0xa18c, 0x000f, 0x2204, 0xa084, 0xfff0, 0xa105, 809 0xa105, 0x2012, 0x007c, 0xd3fc, 0x00c0, 0x27be, 0x007e, 0x2001,
787 0x2012, 0x017f, 0x1078, 0x289b, 0x007c, 0xd3fc, 0x00c0, 0x2710, 810 0x4f04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x27ba, 0x2011, 0x0102,
788 0x007e, 0x2001, 0x4e04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x270c, 811 0x0078, 0x27c0, 0x2011, 0x0202, 0x0078, 0x27c0, 0x2011, 0x0102,
789 0x2011, 0x0101, 0x0078, 0x2712, 0x2011, 0x0201, 0x0078, 0x2712, 812 0x2204, 0xa084, 0xffcf, 0xa105, 0x2012, 0x007c, 0x0c7e, 0xd1bc,
790 0x2011, 0x0101, 0x20a9, 0x0009, 0x810b, 0x00f0, 0x2714, 0xa18c, 813 0x00c0, 0x27da, 0x007e, 0x2001, 0x4f04, 0x2004, 0xd0ec, 0x007f,
791 0x0e00, 0x2204, 0xa084, 0xf1ff, 0xa105, 0x2012, 0x007c, 0x2019, 814 0x0040, 0x27d6, 0x2061, 0x0100, 0x0078, 0x27dc, 0x2061, 0x0200,
792 0x0002, 0x2001, 0x4e04, 0x2004, 0xd0ec, 0x0040, 0x272c, 0x8319, 815 0x0078, 0x27dc, 0x2061, 0x0100, 0xc1bc, 0x8103, 0x8003, 0xa080,
793 0x2009, 0x0101, 0x0078, 0x272e, 0x2009, 0x0101, 0x20a9, 0x0005, 816 0x0020, 0x609a, 0x62ac, 0x63ac, 0x0c7f, 0x007c, 0x0c7e, 0xd1bc,
794 0x8213, 0x00f0, 0x2730, 0xa294, 0x00e0, 0x2104, 0xa084, 0xff1f, 817 0x00c0, 0x27fa, 0x007e, 0x2001, 0x4f04, 0x2004, 0xd0ec, 0x007f,
795 0xa205, 0x200a, 0x8319, 0x0040, 0x2741, 0x2009, 0x0201, 0x0078, 818 0x0040, 0x27f6, 0x2061, 0x0100, 0x0078, 0x27fc, 0x2061, 0x0200,
796 0x272e, 0x007c, 0xd3fc, 0x00c0, 0x2755, 0x007e, 0x2001, 0x4e04, 819 0x0078, 0x27fc, 0x2061, 0x0100, 0xc1bc, 0x8103, 0x8003, 0xa080,
797 0x2004, 0xd0ec, 0x007f, 0x0040, 0x2751, 0x2011, 0x0101, 0x0078, 820 0x0022, 0x609a, 0x60a4, 0xa084, 0xffdf, 0x60ae, 0x0c7f, 0x007c,
798 0x2757, 0x2011, 0x0201, 0x0078, 0x2757, 0x2011, 0x0101, 0x20a9, 821 0x0c7e, 0xd1bc, 0x00c0, 0x281c, 0x007e, 0x2001, 0x4f04, 0x2004,
799 0x000c, 0x810b, 0x00f0, 0x2759, 0xa18c, 0xf000, 0x2204, 0xa084, 822 0xd0ec, 0x007f, 0x0040, 0x2818, 0x2061, 0x0100, 0x0078, 0x281e,
800 0x0fff, 0xa105, 0x2012, 0x007c, 0xd3fc, 0x00c0, 0x2777, 0x007e, 823 0x2061, 0x0200, 0x0078, 0x281e, 0x2061, 0x0100, 0xc1bc, 0x8103,
801 0x2001, 0x4e04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x2773, 0x2011, 824 0x8003, 0xa080, 0x0022, 0x609a, 0x60a4, 0xa085, 0x0020, 0x60ae,
802 0x0102, 0x0078, 0x2779, 0x2011, 0x0202, 0x0078, 0x2779, 0x2011, 825 0x0c7f, 0x007c, 0x0c7e, 0xd1bc, 0x00c0, 0x283e, 0x007e, 0x2001,
803 0x0102, 0x2204, 0xa084, 0xffcf, 0xa105, 0x2012, 0x007c, 0x0c7e, 826 0x4f04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x283a, 0x2061, 0x0100,
804 0xd1bc, 0x00c0, 0x2793, 0x007e, 0x2001, 0x4e04, 0x2004, 0xd0ec, 827 0x0078, 0x2840, 0x2061, 0x0200, 0x0078, 0x2840, 0x2061, 0x0100,
805 0x007f, 0x0040, 0x278f, 0x2061, 0x0100, 0x0078, 0x2795, 0x2061, 828 0xc1bc, 0x8103, 0x8003, 0xa080, 0x0020, 0x609a, 0x60a4, 0xa28c,
806 0x0200, 0x0078, 0x2795, 0x2061, 0x0100, 0xc1bc, 0x8103, 0x8003, 829 0x0020, 0x0040, 0x284e, 0xc2ac, 0xa39d, 0x4000, 0xc3fc, 0xd3b4,
807 0xa080, 0x0020, 0x609a, 0x62ac, 0x63ac, 0x0c7f, 0x007c, 0x0c7e, 830 0x00c0, 0x2853, 0xc3fd, 0x62ae, 0x2010, 0x60a4, 0x63ae, 0x2018,
808 0xd1bc, 0x00c0, 0x27b3, 0x007e, 0x2001, 0x4e04, 0x2004, 0xd0ec, 831 0x0c7f, 0x007c, 0x2091, 0x8000, 0x0c7e, 0x0e7e, 0x6818, 0xa005,
809 0x007f, 0x0040, 0x27af, 0x2061, 0x0100, 0x0078, 0x27b5, 0x2061, 832 0x0040, 0x28c0, 0xd1fc, 0x0040, 0x2869, 0x2061, 0x96d0, 0x0078,
810 0x0200, 0x0078, 0x27b5, 0x2061, 0x0100, 0xc1bc, 0x8103, 0x8003, 833 0x286b, 0x2061, 0x95c0, 0x1078, 0x28c8, 0x0040, 0x28a2, 0x20a9,
811 0xa080, 0x0022, 0x609a, 0x60a4, 0xa084, 0xffdf, 0x60ae, 0x0c7f, 834 0x0101, 0xd1fc, 0x0040, 0x2878, 0x2061, 0x95d0, 0x0078, 0x287a,
812 0x007c, 0x0c7e, 0xd1bc, 0x00c0, 0x27d5, 0x007e, 0x2001, 0x4e04, 835 0x2061, 0x94c0, 0x0c7e, 0x1078, 0x28c8, 0x0040, 0x2885, 0x0c7f,
813 0x2004, 0xd0ec, 0x007f, 0x0040, 0x27d1, 0x2061, 0x0100, 0x0078, 836 0x8c60, 0x00f0, 0x287a, 0x0078, 0x28c0, 0x007f, 0xd1fc, 0x0040,
814 0x27d7, 0x2061, 0x0200, 0x0078, 0x27d7, 0x2061, 0x0100, 0xc1bc, 837 0x288f, 0xa082, 0x95d0, 0x2071, 0x4f80, 0x0078, 0x2893, 0xa082,
815 0x8103, 0x8003, 0xa080, 0x0022, 0x609a, 0x60a4, 0xa085, 0x0020, 838 0x94c0, 0x2071, 0x4f40, 0x707a, 0x7176, 0x2138, 0x2001, 0x0004,
816 0x60ae, 0x0c7f, 0x007c, 0x0c7e, 0xd1bc, 0x00c0, 0x27f7, 0x007e, 839 0x7066, 0x7083, 0x000f, 0x71d4, 0xc1dc, 0x71d6, 0x1078, 0x2663,
817 0x2001, 0x4e04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x27f3, 0x2061, 840 0x0078, 0x28bc, 0xd1fc, 0x00c0, 0x28a9, 0x2071, 0x4f40, 0x0078,
818 0x0100, 0x0078, 0x27f9, 0x2061, 0x0200, 0x0078, 0x27f9, 0x2061, 841 0x28ab, 0x2071, 0x4f80, 0x6020, 0xc0dd, 0x6022, 0x7176, 0x2138,
819 0x0100, 0xc1bc, 0x8103, 0x8003, 0xa080, 0x0020, 0x609a, 0x60a4, 842 0x2c00, 0x707e, 0x2001, 0x0006, 0x7066, 0x7083, 0x000f, 0x71d4,
820 0xa28c, 0x0020, 0x0040, 0x2807, 0xc2ac, 0xa39d, 0x4000, 0xc3fc, 843 0xc1dc, 0x71d6, 0x1078, 0x2663, 0x2001, 0x0000, 0x0078, 0x28c2,
821 0xd3b4, 0x00c0, 0x280c, 0xc3fd, 0x62ae, 0x2010, 0x60a4, 0x63ae, 844 0x2001, 0x0001, 0x2091, 0x8001, 0xa005, 0x0e7f, 0x0c7f, 0x007c,
822 0x2018, 0x0c7f, 0x007c, 0x2091, 0x8000, 0x0c7e, 0x0e7e, 0x6818, 845 0x2c04, 0xa005, 0x0040, 0x28df, 0x2060, 0x6010, 0xa306, 0x00c0,
823 0xa005, 0x0040, 0x2879, 0xd1fc, 0x0040, 0x2822, 0x2061, 0x95d0, 846 0x28dc, 0x600c, 0xa206, 0x00c0, 0x28dc, 0x6014, 0xa106, 0x00c0,
824 0x0078, 0x2824, 0x2061, 0x94c0, 0x1078, 0x2881, 0x0040, 0x285b, 847 0x28dc, 0xa006, 0x0078, 0x28e1, 0x6000, 0x0078, 0x28c9, 0xa085,
825 0x20a9, 0x0101, 0xd1fc, 0x0040, 0x2831, 0x2061, 0x94d0, 0x0078, 848 0x0001, 0x007c, 0x0f7e, 0x0e7e, 0x017e, 0xd1bc, 0x00c0, 0x28fa,
826 0x2833, 0x2061, 0x93c0, 0x0c7e, 0x1078, 0x2881, 0x0040, 0x283e, 849 0x2079, 0x4f40, 0x007e, 0x2001, 0x4f04, 0x2004, 0xd0ec, 0x007f,
827 0x0c7f, 0x8c60, 0x00f0, 0x2833, 0x0078, 0x2879, 0x007f, 0xd1fc, 850 0x0040, 0x28f6, 0x2071, 0x0100, 0x0078, 0x28fe, 0x2071, 0x0200,
828 0x0040, 0x2848, 0xa082, 0x94d0, 0x2071, 0x4e80, 0x0078, 0x284c, 851 0x0078, 0x28fe, 0x2079, 0x4f80, 0x2071, 0x0100, 0x7920, 0xa18c,
829 0xa082, 0x93c0, 0x2071, 0x4e40, 0x707a, 0x7176, 0x2138, 0x2001, 852 0x000f, 0x70ec, 0xd0c4, 0x00c0, 0x2908, 0x017f, 0x0078, 0x2923,
830 0x0004, 0x7066, 0x7083, 0x000f, 0x71d4, 0xc1dc, 0x71d6, 0x1078, 853 0x810b, 0x810b, 0x810b, 0x810b, 0x007f, 0xd0bc, 0x00c0, 0x2920,
831 0x261c, 0x0078, 0x2875, 0xd1fc, 0x00c0, 0x2862, 0x2071, 0x4e40, 854 0x007e, 0x2001, 0x4f04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x291c,
832 0x0078, 0x2864, 0x2071, 0x4e80, 0x6020, 0xc0dd, 0x6022, 0x7176, 855 0xa18d, 0x0f00, 0x0078, 0x2922, 0xa18d, 0x0f00, 0x0078, 0x2922,
833 0x2138, 0x2c00, 0x707e, 0x2001, 0x0006, 0x7066, 0x7083, 0x000f, 856 0xa18d, 0x0800, 0x2104, 0x0e7f, 0x0f7f, 0x007c, 0x0e7e, 0x2001,
834 0x71d4, 0xc1dc, 0x71d6, 0x1078, 0x261c, 0x2001, 0x0000, 0x0078, 857 0x4f01, 0x2004, 0xd0ac, 0x00c0, 0x29a3, 0x68e4, 0xd0ac, 0x0040,
835 0x287b, 0x2001, 0x0001, 0x2091, 0x8001, 0xa005, 0x0e7f, 0x0c7f, 858 0x29a3, 0xa084, 0x0006, 0x00c0, 0x29a3, 0x6014, 0xd0fc, 0x00c0,
836 0x007c, 0x2c04, 0xa005, 0x0040, 0x2898, 0x2060, 0x6010, 0xa306, 859 0x293d, 0x2071, 0x53c0, 0x0078, 0x293f, 0x2071, 0x5440, 0x8007,
837 0x00c0, 0x2895, 0x600c, 0xa206, 0x00c0, 0x2895, 0x6014, 0xa106, 860 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xae70, 0x7004, 0xa084,
838 0x00c0, 0x2895, 0xa006, 0x0078, 0x289a, 0x6000, 0x0078, 0x2882, 861 0x000a, 0x00c0, 0x29a3, 0x7108, 0xa194, 0xff00, 0x0040, 0x29a3,
839 0xa085, 0x0001, 0x007c, 0x0f7e, 0x0e7e, 0x017e, 0xd1bc, 0x00c0, 862 0xa18c, 0x00ff, 0x2001, 0x000a, 0xa106, 0x0040, 0x2972, 0x2001,
840 0x28b3, 0x2079, 0x4e40, 0x007e, 0x2001, 0x4e04, 0x2004, 0xd0ec, 863 0x000c, 0xa106, 0x0040, 0x2976, 0x2001, 0x0012, 0xa106, 0x0040,
841 0x007f, 0x0040, 0x28af, 0x2071, 0x0100, 0x0078, 0x28b7, 0x2071, 864 0x297a, 0x2001, 0x0014, 0xa106, 0x0040, 0x297e, 0x2001, 0x0019,
842 0x0200, 0x0078, 0x28b7, 0x2079, 0x4e80, 0x2071, 0x0100, 0x7920, 865 0xa106, 0x0040, 0x2982, 0x2001, 0x0032, 0xa106, 0x0040, 0x2986,
843 0xa18c, 0x000f, 0x70ec, 0xd0c4, 0x00c0, 0x28c1, 0x017f, 0x0078, 866 0x0078, 0x298a, 0x2009, 0x000c, 0x0078, 0x298c, 0x2009, 0x0012,
844 0x28dc, 0x810b, 0x810b, 0x810b, 0x810b, 0x007f, 0xd0bc, 0x00c0, 867 0x0078, 0x298c, 0x2009, 0x0014, 0x0078, 0x298c, 0x2009, 0x0019,
845 0x28d9, 0x007e, 0x2001, 0x4e04, 0x2004, 0xd0ec, 0x007f, 0x0040, 868 0x0078, 0x298c, 0x2009, 0x0020, 0x0078, 0x298c, 0x2009, 0x003f,
846 0x28d5, 0xa18d, 0x0f00, 0x0078, 0x28db, 0xa18d, 0x0f00, 0x0078, 869 0x0078, 0x298c, 0x2011, 0x0000, 0x2100, 0xa205, 0x700a, 0x2071,
847 0x28db, 0xa18d, 0x0800, 0x2104, 0x0e7f, 0x0f7f, 0x007c, 0x0e7e, 870 0x4f00, 0x7004, 0xd0bc, 0x0040, 0x29a3, 0x6014, 0xd0fc, 0x00c0,
848 0x2001, 0x4e01, 0x2004, 0xd0ac, 0x00c0, 0x295c, 0x68e4, 0xd0ac, 871 0x299e, 0x70ea, 0x2071, 0x4f40, 0x0078, 0x29a1, 0x70ee, 0x2071,
849 0x0040, 0x295c, 0xa084, 0x0006, 0x00c0, 0x295c, 0x6014, 0xd0fc, 872 0x4f80, 0x701f, 0x000d, 0x0e7f, 0x007c, 0x2001, 0x4f05, 0x2004,
850 0x00c0, 0x28f6, 0x2071, 0x52c0, 0x0078, 0x28f8, 0x2071, 0x5340, 873 0xd0e4, 0x00c0, 0x29b1, 0x7804, 0xa084, 0xff1f, 0xa085, 0x6340,
851 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xae70, 0x7004, 874 0x7806, 0x007c, 0x0068, 0x29b2, 0x2091, 0x8000, 0x2071, 0x0000,
852 0xa084, 0x000a, 0x00c0, 0x295c, 0x7108, 0xa194, 0xff00, 0x0040, 875 0x007e, 0x7018, 0xd084, 0x00c0, 0x29b9, 0x007f, 0x2071, 0x0010,
853 0x295c, 0xa18c, 0x00ff, 0x2001, 0x000a, 0xa106, 0x0040, 0x292b, 876 0x70ca, 0x007f, 0x70c6, 0x70c3, 0x8002, 0x70db, 0x080f, 0x70df,
854 0x2001, 0x000c, 0xa106, 0x0040, 0x292f, 0x2001, 0x0012, 0xa106, 877 0x000b, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 0x0078,
855 0x0040, 0x2933, 0x2001, 0x0014, 0xa106, 0x0040, 0x2937, 0x2001, 878 0x29cf, 0x7f3c, 0x7e58, 0x7c30, 0x7d38, 0x78a0, 0x708e, 0x7592,
856 0x0019, 0xa106, 0x0040, 0x293b, 0x2001, 0x0032, 0xa106, 0x0040, 879 0x7496, 0x769a, 0x779e, 0xa594, 0x003f, 0xd4f4, 0x0040, 0x29e6,
857 0x293f, 0x0078, 0x2943, 0x2009, 0x000c, 0x0078, 0x2945, 0x2009, 880 0xa784, 0x007d, 0x00c0, 0x441d, 0x1078, 0x29b2, 0xa49c, 0x000f,
858 0x0012, 0x0078, 0x2945, 0x2009, 0x0014, 0x0078, 0x2945, 0x2009, 881 0xa382, 0x0004, 0x0050, 0x29f1, 0xa3a6, 0x0007, 0x00c0, 0x29b2,
859 0x0019, 0x0078, 0x2945, 0x2009, 0x0020, 0x0078, 0x2945, 0x2009, 882 0x2418, 0x8507, 0xa084, 0x000f, 0x0079, 0x29f6, 0x3071, 0x3162,
860 0x003f, 0x0078, 0x2945, 0x2011, 0x0000, 0x2100, 0xa205, 0x700a, 883 0x318d, 0x33ff, 0x37e8, 0x3862, 0x3917, 0x39a8, 0x3a96, 0x3b85,
861 0x2071, 0x4e00, 0x7004, 0xd0bc, 0x0040, 0x295c, 0x6014, 0xd0fc, 884 0x2a09, 0x2a06, 0x2e42, 0x2f65, 0x37b9, 0x2a06, 0x1078, 0x29b2,
862 0x00c0, 0x2957, 0x70ea, 0x2071, 0x4e40, 0x0078, 0x295a, 0x70ee, 885 0x007c, 0xa006, 0x0078, 0x2a13, 0x7808, 0xc08d, 0x780a, 0xa006,
863 0x2071, 0x4e80, 0x701f, 0x000d, 0x0e7f, 0x007c, 0x2001, 0x4e05, 886 0x7002, 0x704e, 0x7046, 0x70d2, 0x7060, 0xa005, 0x00c0, 0x2b79,
864 0x2004, 0xd0e4, 0x00c0, 0x296a, 0x7804, 0xa084, 0xff1f, 0xa085, 887 0x7064, 0xa084, 0x0007, 0x0079, 0x2a1d, 0x2a25, 0x2a98, 0x2aa1,
865 0x6340, 0x7806, 0x007c, 0x0068, 0x296b, 0x2091, 0x8000, 0x2071, 888 0x2aac, 0x2ab7, 0x2b5f, 0x2ac2, 0x2a98, 0x7830, 0xd0bc, 0x00c0,
866 0x0000, 0x007e, 0x7018, 0xd084, 0x00c0, 0x2972, 0x007f, 0x2071, 889 0x2a08, 0x71d4, 0xd1bc, 0x00c0, 0x2a08, 0xd1b4, 0x00c0, 0x2a75,
867 0x0010, 0x70ca, 0x007f, 0x70c6, 0x70c3, 0x8002, 0x70db, 0x080f, 890 0x70a4, 0xa086, 0x0001, 0x0040, 0x2a08, 0x70b4, 0xa06d, 0x6800,
868 0x70df, 0x0000, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, 891 0xa065, 0xa055, 0x789b, 0x0010, 0x6b0c, 0x7baa, 0x6808, 0xa045,
869 0x0078, 0x2988, 0x7f3c, 0x7e58, 0x7c30, 0x7d38, 0x78a0, 0x708e, 892 0x6d10, 0x6804, 0xa06d, 0xa05d, 0xa886, 0x0001, 0x0040, 0x2a4b,
870 0x7592, 0x7496, 0x769a, 0x779e, 0xa594, 0x003f, 0xd4f4, 0x0040, 893 0x69bc, 0x7daa, 0x79aa, 0x68c0, 0xa04d, 0x6e1c, 0x2001, 0x0010,
871 0x299f, 0xa784, 0x007d, 0x00c0, 0x43cd, 0x1078, 0x296b, 0xa49c, 894 0x0078, 0x2cd3, 0x7060, 0xa005, 0x00c0, 0x2a08, 0x0c7e, 0x0d7e,
872 0x000f, 0xa382, 0x0004, 0x0050, 0x29aa, 0xa3a6, 0x0007, 0x00c0, 895 0x70b4, 0xa06d, 0x6800, 0xa065, 0xa055, 0x789b, 0x0010, 0x6b0c,
873 0x296b, 0x2418, 0x8507, 0xa084, 0x000f, 0x0079, 0x29af, 0x3028, 896 0x7baa, 0x6808, 0xa045, 0x6d10, 0x6804, 0xa06d, 0xa05d, 0xa886,
874 0x3119, 0x3144, 0x33b6, 0x379f, 0x3819, 0x38ce, 0x395f, 0x3a4d, 897 0x0001, 0x0040, 0x2a6e, 0x69bc, 0x7daa, 0x79aa, 0x68c0, 0xa04d,
875 0x3b3c, 0x29c2, 0x29bf, 0x2df9, 0x2f1c, 0x3770, 0x29bf, 0x1078, 898 0x6e1c, 0x2001, 0x0020, 0x0078, 0x2cd3, 0x1078, 0x43b0, 0x00c0,
876 0x296b, 0x007c, 0xa006, 0x0078, 0x29cc, 0x7808, 0xc08d, 0x780a, 899 0x2a08, 0x781b, 0x005b, 0x70bc, 0xa06d, 0x68b4, 0x785a, 0x6894,
877 0xa006, 0x7002, 0x704e, 0x7046, 0x70d2, 0x7060, 0xa005, 0x00c0,
878 0x2b32, 0x7064, 0xa084, 0x0007, 0x0079, 0x29d6, 0x29de, 0x2a51,
879 0x2a5a, 0x2a65, 0x2a70, 0x2b18, 0x2a7b, 0x2a51, 0x7830, 0xd0bc,
880 0x00c0, 0x29c1, 0x71d4, 0xd1bc, 0x00c0, 0x29c1, 0xd1b4, 0x00c0,
881 0x2a2e, 0x70a4, 0xa086, 0x0001, 0x0040, 0x29c1, 0x70b4, 0xa06d,
882 0x6800, 0xa065, 0xa055, 0x789b, 0x0010, 0x6b0c, 0x7baa, 0x6808,
883 0xa045, 0x6d10, 0x6804, 0xa06d, 0xa05d, 0xa886, 0x0001, 0x0040,
884 0x2a04, 0x69bc, 0x7daa, 0x79aa, 0x68c0, 0xa04d, 0x6e1c, 0x2001,
885 0x0010, 0x0078, 0x2c8c, 0x7060, 0xa005, 0x00c0, 0x29c1, 0x0c7e,
886 0x0d7e, 0x70b4, 0xa06d, 0x6800, 0xa065, 0xa055, 0x789b, 0x0010,
887 0x6b0c, 0x7baa, 0x6808, 0xa045, 0x6d10, 0x6804, 0xa06d, 0xa05d,
888 0xa886, 0x0001, 0x0040, 0x2a27, 0x69bc, 0x7daa, 0x79aa, 0x68c0,
889 0xa04d, 0x6e1c, 0x2001, 0x0020, 0x0078, 0x2c8c, 0x1078, 0x4360,
890 0x00c0, 0x29c1, 0x781b, 0x005b, 0x70bc, 0xa06d, 0x68b4, 0x785a,
891 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0x7808, 0xc08d,
892 0x780a, 0x68bc, 0x7042, 0xc1b4, 0x71d6, 0x70b8, 0xa065, 0x68c0,
893 0x705a, 0x7003, 0x0002, 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046,
894 0x007c, 0x1078, 0x4360, 0x00c0, 0x2a59, 0x781b, 0x0047, 0x7003,
895 0x0004, 0x007c, 0x1078, 0x4360, 0x00c0, 0x2a64, 0x2011, 0x000c,
896 0x1078, 0x2a8b, 0x7003, 0x0004, 0x007c, 0x1078, 0x4360, 0x00c0,
897 0x2a6f, 0x2011, 0x0006, 0x1078, 0x2a8b, 0x7003, 0x0004, 0x007c,
898 0x1078, 0x4360, 0x00c0, 0x2a7a, 0x2011, 0x000d, 0x1078, 0x2a8b,
899 0x7003, 0x0004, 0x007c, 0x1078, 0x4360, 0x00c0, 0x2a8a, 0x2011,
900 0x0006, 0x1078, 0x2a8b, 0x707c, 0x707f, 0x0000, 0x2068, 0x704e,
901 0x7003, 0x0001, 0x007c, 0x7174, 0xc1fc, 0x8107, 0x7882, 0x789b,
902 0x0010, 0xa286, 0x000c, 0x00c0, 0x2a9a, 0x7aaa, 0x2001, 0x0001,
903 0x0078, 0x2aaf, 0xa18c, 0x001f, 0xa18d, 0x00c0, 0x79aa, 0xa286,
904 0x000d, 0x0040, 0x2aa8, 0x7aaa, 0x2001, 0x0002, 0x0078, 0x2aaf,
905 0x78ab, 0x0020, 0x7178, 0x79aa, 0x7aaa, 0x2001, 0x0004, 0x789b,
906 0x0060, 0x78aa, 0x785b, 0x0004, 0x781b, 0x0116, 0x1078, 0x4383,
907 0x7083, 0x000f, 0x70d4, 0xd0b4, 0x0040, 0x2acb, 0xc0b4, 0x70d6,
908 0x0c7e, 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018,
909 0x8001, 0x601a, 0x0c7f, 0x007c, 0x7014, 0xa005, 0x00c0, 0x2ada,
910 0x70d4, 0xd0b4, 0x0040, 0x2adb, 0x70b8, 0xac06, 0x00c0, 0x2adb,
911 0x1078, 0x2aba, 0x007c, 0x017e, 0x71a4, 0xa186, 0x0001, 0x0040,
912 0x2b0d, 0x0d7e, 0x027e, 0x2100, 0x2011, 0x0001, 0xa212, 0x70b4,
913 0x2068, 0x6800, 0xac06, 0x0040, 0x2af4, 0x8211, 0x0040, 0x2b0b,
914 0x1078, 0x2b0f, 0x0078, 0x2ae9, 0x0c7e, 0x2100, 0x2011, 0x0001,
915 0xa212, 0x70b4, 0x2068, 0x6800, 0x2060, 0x6008, 0xa084, 0xfbef,
916 0x600a, 0x8211, 0x0040, 0x2b08, 0x1078, 0x2b0f, 0x0078, 0x2afb,
917 0x70a7, 0x0001, 0x0c7f, 0x027f, 0x0d7f, 0x017f, 0x007c, 0xade8,
918 0x0005, 0x70ac, 0xad06, 0x00c0, 0x2b17, 0x70a8, 0x2068, 0x007c,
919 0x1078, 0x4360, 0x00c0, 0x29c1, 0x707c, 0x2068, 0x7774, 0x1078,
920 0x41fe, 0x2c50, 0x1078, 0x4442, 0x789b, 0x0010, 0x6814, 0xa084,
921 0x001f, 0xc0bd, 0x78aa, 0x6e1c, 0x2041, 0x0001, 0x2001, 0x0004,
922 0x0078, 0x2c92, 0x1078, 0x4360, 0x00c0, 0x29c1, 0x789b, 0x0010,
923 0x7060, 0x2068, 0x6f14, 0x70d4, 0xd0b4, 0x0040, 0x2b4c, 0xc0b4,
924 0x70d6, 0x0c7e, 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a,
925 0x6018, 0x8001, 0x601a, 0x0c7f, 0x1078, 0x41fe, 0x2c50, 0x1078,
926 0x4442, 0x6824, 0xa005, 0x0040, 0x2b5d, 0xa082, 0x0006, 0x0048,
927 0x2b5b, 0x0078, 0x2b5d, 0x6827, 0x0005, 0x6814, 0xa084, 0x001f,
928 0xc0bd, 0x78aa, 0x2031, 0x0020, 0x2041, 0x0001, 0x2001, 0x0003,
929 0x0078, 0x2c92, 0xc28d, 0x72d6, 0x72c0, 0xa200, 0xa015, 0x7154,
930 0x8108, 0xa12a, 0x0048, 0x2b75, 0x71c0, 0x2164, 0x6504, 0x85ff,
931 0x00c0, 0x2b8c, 0x7156, 0x8421, 0x00c0, 0x2b70, 0x70d4, 0xd08c,
932 0x0040, 0x2b88, 0x70d0, 0xa005, 0x00c0, 0x2b88, 0x70d3, 0x000a,
933 0x007c, 0x2200, 0x0078, 0x2b7a, 0x70d4, 0xc08c, 0x70d6, 0x70d3,
934 0x0000, 0x6034, 0xa005, 0x00c0, 0x2b89, 0x6708, 0xa784, 0x073f,
935 0x0040, 0x2bbb, 0xd7d4, 0x00c0, 0x2b89, 0xa784, 0x0021, 0x00c0,
936 0x2b89, 0xa784, 0x0002, 0x0040, 0x2bac, 0xa784, 0x0004, 0x0040,
937 0x2b89, 0xa7bc, 0xfffb, 0x670a, 0xa784, 0x0218, 0x00c0, 0x2b89,
938 0xa784, 0x0100, 0x0040, 0x2bbb, 0x6018, 0xa005, 0x00c0, 0x2b89,
939 0xa7bc, 0xfeff, 0x670a, 0x2568, 0x6823, 0x0000, 0x6e1c, 0xa684,
940 0x000e, 0x6318, 0x0040, 0x2bcc, 0x601c, 0xa302, 0x0048, 0x2bcf,
941 0x0040, 0x2bcf, 0x0078, 0x2b89, 0x83ff, 0x00c0, 0x2b89, 0x2d58,
942 0x2c50, 0x7156, 0xd7bc, 0x00c0, 0x2bd8, 0x7028, 0x6022, 0x603a,
943 0xc7bc, 0x670a, 0x68c0, 0xa065, 0xa04d, 0x6100, 0x2a60, 0x2041,
944 0x0001, 0x6b14, 0xa39c, 0x001f, 0xa39d, 0x00c0, 0xd1fc, 0x0040,
945 0x2bec, 0xd684, 0x0040, 0x2bee, 0xa39c, 0xffbf, 0xd6a4, 0x0040,
946 0x2bf3, 0xa39d, 0x0020, 0xa684, 0x000e, 0x00c0, 0x2c3e, 0xc7a5,
947 0x670a, 0x2c00, 0x68c6, 0x77a4, 0xa786, 0x0001, 0x00c0, 0x2c12,
948 0x70d4, 0xd0b4, 0x00c0, 0x2c12, 0x7000, 0xa082, 0x0002, 0x00c8,
949 0x2c12, 0x7830, 0xd0bc, 0x00c0, 0x2c12, 0x789b, 0x0010, 0x7baa,
950 0x0078, 0x2c8a, 0x8739, 0x77a6, 0x2750, 0x77b0, 0xa7b0, 0x0005,
951 0x70ac, 0xa606, 0x00c0, 0x2c1d, 0x76a8, 0x76b2, 0x2c3a, 0x8738,
952 0x2d3a, 0x8738, 0x283a, 0x8738, 0x233a, 0x8738, 0x253a, 0x7830,
953 0xd0bc, 0x0040, 0x2c35, 0x2091, 0x8000, 0x2091, 0x303d, 0x70d4,
954 0xa084, 0x303d, 0x2091, 0x8000, 0x2090, 0xaad5, 0x0000, 0x0040,
955 0x2c3d, 0x8421, 0x2200, 0x00c0, 0x2b6f, 0x007c, 0xd1dc, 0x0040,
956 0x3e00, 0x2029, 0x0020, 0xd69c, 0x00c0, 0x2c4b, 0x8528, 0xd68c,
957 0x00c0, 0x2c4b, 0x8528, 0x8840, 0x6f14, 0x610c, 0x8108, 0xa18c,
958 0x00ff, 0x70cc, 0xa160, 0x2c64, 0x8cff, 0x0040, 0x2c6a, 0x6014,
959 0xa706, 0x00c0, 0x2c53, 0x60b8, 0x8001, 0x60ba, 0x00c0, 0x2c4e,
960 0x2a60, 0x6008, 0xa085, 0x0100, 0x600a, 0x2200, 0x8421, 0x00c0,
961 0x2b6f, 0x007c, 0x2a60, 0x610e, 0x69be, 0x2c00, 0x68c6, 0x8840,
962 0x6008, 0xc0d5, 0x600a, 0x77a4, 0xa786, 0x0001, 0x00c0, 0x2c12,
963 0x70d4, 0xd0b4, 0x00c0, 0x2c12, 0x7000, 0xa082, 0x0002, 0x00c8,
964 0x2c12, 0x7830, 0xd0bc, 0x00c0, 0x2c12, 0x789b, 0x0010, 0x7baa,
965 0x7daa, 0x79aa, 0x2001, 0x0002, 0x007e, 0x6018, 0x8000, 0x601a,
966 0x0078, 0x2c93, 0x007e, 0x2960, 0x6104, 0x2a60, 0xa184, 0x0018,
967 0x0040, 0x2caf, 0xa184, 0x0010, 0x0040, 0x2ca2, 0x1078, 0x4011,
968 0x00c0, 0x2cd4, 0xa184, 0x0008, 0x0040, 0x2caf, 0x69a0, 0xa184,
969 0x0600, 0x00c0, 0x2caf, 0x1078, 0x3ef5, 0x0078, 0x2cd4, 0x69a0,
970 0xa184, 0x1e00, 0x0040, 0x2cdf, 0xa184, 0x0800, 0x0040, 0x2cc8,
971 0x0c7e, 0x2960, 0x6000, 0xa085, 0x2000, 0x6002, 0x6104, 0xa18d,
972 0x0010, 0x6106, 0x0c7f, 0x1078, 0x4011, 0x00c0, 0x2cd4, 0x69a0,
973 0xa184, 0x0200, 0x0040, 0x2cd0, 0x1078, 0x3f54, 0x0078, 0x2cd4,
974 0xa184, 0x0400, 0x00c0, 0x2cab, 0x69a0, 0xa184, 0x1000, 0x0040,
975 0x2cdf, 0x6914, 0xa18c, 0xff00, 0x810f, 0x1078, 0x279f, 0x027f,
976 0xa68c, 0x00e0, 0xa684, 0x0060, 0x0040, 0x2cec, 0xa086, 0x0060,
977 0x00c0, 0x2cec, 0xa18d, 0x4000, 0xa18d, 0x0104, 0x69b6, 0x789b,
978 0x0060, 0x2800, 0x78aa, 0x6818, 0xc0fd, 0x681a, 0xd6bc, 0x0040,
979 0x2d07, 0xc0fc, 0x7087, 0x0000, 0xa08a, 0x000d, 0x0050, 0x2d05,
980 0xa08a, 0x000c, 0x7186, 0x2001, 0x000c, 0x800c, 0x718a, 0x78aa,
981 0x3518, 0x3340, 0x3428, 0x8000, 0x80ac, 0xaf80, 0x002b, 0x20a0,
982 0x789b, 0x0000, 0xad80, 0x000b, 0x2098, 0x53a6, 0x23a8, 0x2898,
983 0x25a0, 0xa286, 0x0020, 0x00c0, 0x2d3f, 0x70d4, 0xc0b5, 0x70d6,
984 0x2c00, 0x70ba, 0x2d00, 0x70be, 0x6814, 0xc0fc, 0x8007, 0x7882,
985 0xa286, 0x0002, 0x0040, 0x2d75, 0x70a4, 0x8000, 0x70a6, 0x74b4,
986 0xa498, 0x0005, 0x70ac, 0xa306, 0x00c0, 0x2d37, 0x73a8, 0x73b6,
987 0xa286, 0x0010, 0x0040, 0x29c1, 0x0d7f, 0x0c7f, 0x007c, 0x7000,
988 0xa005, 0x00c0, 0x2d1d, 0xa286, 0x0002, 0x00c0, 0x2d8f, 0x1078,
989 0x4360, 0x00c0, 0x2d1d, 0x6814, 0xc0fc, 0x8007, 0x7882, 0x2091,
990 0x8000, 0x781b, 0x005b, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de,
991 0x6898, 0x78d2, 0x78da, 0x2091, 0x8001, 0x7808, 0xc08d, 0x780a,
992 0x127e, 0x0d7e, 0x0c7e, 0x70d4, 0xa084, 0x2700, 0x2090, 0x0c7f,
993 0x0d7f, 0x127f, 0x2900, 0x705a, 0x68bc, 0x7042, 0x7003, 0x0002,
994 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, 0x7830, 0xd0bc, 0x0040,
995 0x2d81, 0x2091, 0x303d, 0x70d4, 0xa084, 0x303d, 0x2091, 0x8000,
996 0x2090, 0x70a4, 0xa005, 0x00c0, 0x2d86, 0x007c, 0x8421, 0x0040,
997 0x2d85, 0x7250, 0x70c0, 0xa200, 0xa015, 0x0078, 0x2b6f, 0xa286,
998 0x0010, 0x00c0, 0x2dc0, 0x1078, 0x4360, 0x00c0, 0x2d1d, 0x6814,
999 0xc0fc, 0x8007, 0x7882, 0x781b, 0x005b, 0x68b4, 0x785a, 0x6894,
1000 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0x7808, 0xc08d, 0x780a, 900 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0x7808, 0xc08d, 0x780a,
1001 0x70a4, 0x8000, 0x70a6, 0x74b4, 0xa490, 0x0005, 0x70ac, 0xa206, 901 0x68bc, 0x7042, 0xc1b4, 0x71d6, 0x70b8, 0xa065, 0x68c0, 0x705a,
1002 0x00c0, 0x2db3, 0x72a8, 0x72b6, 0x2900, 0x705a, 0x68bc, 0x7042,
1003 0x7003, 0x0002, 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, 0x007c, 902 0x7003, 0x0002, 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, 0x007c,
1004 0x6bb4, 0xa39d, 0x2000, 0x7b5a, 0x6814, 0xc0fc, 0x8007, 0x7882, 903 0x1078, 0x43b0, 0x00c0, 0x2aa0, 0x781b, 0x0047, 0x7003, 0x0004,
1005 0x6b94, 0x7bd6, 0x7bde, 0x6e98, 0x7ed2, 0x7eda, 0x781b, 0x005b, 904 0x007c, 0x1078, 0x43b0, 0x00c0, 0x2aab, 0x2011, 0x000c, 0x1078,
1006 0x2900, 0x705a, 0x7202, 0x7808, 0xc08d, 0x780a, 0x2300, 0xa605, 905 0x2ad2, 0x7003, 0x0004, 0x007c, 0x1078, 0x43b0, 0x00c0, 0x2ab6,
1007 0x0040, 0x2deb, 0x70d4, 0xa084, 0x2700, 0xa086, 0x2300, 0x00c0, 906 0x2011, 0x0006, 0x1078, 0x2ad2, 0x7003, 0x0004, 0x007c, 0x1078,
1008 0x2de5, 0x2009, 0x0000, 0x0078, 0x2de7, 0x2009, 0x0001, 0xa284, 907 0x43b0, 0x00c0, 0x2ac1, 0x2011, 0x000d, 0x1078, 0x2ad2, 0x7003,
1009 0x000f, 0x1079, 0x2def, 0xad80, 0x0009, 0x7046, 0x007c, 0x2df7, 908 0x0004, 0x007c, 0x1078, 0x43b0, 0x00c0, 0x2ad1, 0x2011, 0x0006,
1010 0x48bd, 0x48bd, 0x48aa, 0x48bd, 0x2df7, 0x2df7, 0x2df7, 0x1078, 909 0x1078, 0x2ad2, 0x707c, 0x707f, 0x0000, 0x2068, 0x704e, 0x7003,
1011 0x296b, 0x7808, 0xa084, 0xfffd, 0x780a, 0x1078, 0x295e, 0x0f7e, 910 0x0001, 0x007c, 0x7174, 0xc1fc, 0x8107, 0x7882, 0x789b, 0x0010,
1012 0x2079, 0x4e00, 0x78ac, 0x0f7f, 0xd084, 0x0040, 0x2e21, 0x7064, 911 0xa286, 0x000c, 0x00c0, 0x2ae1, 0x7aaa, 0x2001, 0x0001, 0x0078,
1013 0xa086, 0x0001, 0x00c0, 0x2e0f, 0x7066, 0x0078, 0x2ef8, 0x7064, 912 0x2af6, 0xa18c, 0x001f, 0xa18d, 0x00c0, 0x79aa, 0xa286, 0x000d,
1014 0xa086, 0x0005, 0x00c0, 0x2e1f, 0x707c, 0x2068, 0x681b, 0x0004, 913 0x0040, 0x2aef, 0x7aaa, 0x2001, 0x0002, 0x0078, 0x2af6, 0x78ab,
1015 0x6817, 0x0000, 0x6820, 0xa084, 0x00ff, 0xc09d, 0x6822, 0x7067, 914 0x0020, 0x7178, 0x79aa, 0x7aaa, 0x2001, 0x0004, 0x789b, 0x0060,
1016 0x0000, 0x70a7, 0x0000, 0x70a8, 0x70b2, 0x70b6, 0x1078, 0x2aba, 915 0x78aa, 0x785b, 0x0004, 0x781b, 0x0116, 0x1078, 0x43d3, 0x7083,
1017 0x157e, 0x2011, 0x0004, 0x7164, 0xa186, 0x0001, 0x0040, 0x2e41, 916 0x000f, 0x70d4, 0xd0b4, 0x0040, 0x2b12, 0xc0b4, 0x70d6, 0x0c7e,
1018 0xa186, 0x0007, 0x00c0, 0x2e38, 0x701f, 0x0005, 0x0078, 0x2e41, 917 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001,
1019 0x701f, 0x0001, 0x7067, 0x0000, 0x70d4, 0xc0dd, 0x70d6, 0x0078, 918 0x601a, 0x0c7f, 0x007c, 0x7014, 0xa005, 0x00c0, 0x2b21, 0x70d4,
1020 0x2e43, 0x7067, 0x0000, 0x2001, 0x4e0a, 0x2004, 0xa084, 0x00ff, 919 0xd0b4, 0x0040, 0x2b22, 0x70b8, 0xac06, 0x00c0, 0x2b22, 0x1078,
1021 0xa086, 0x0018, 0x0040, 0x2e53, 0x7018, 0x7016, 0xa005, 0x00c0, 920 0x2b01, 0x007c, 0x017e, 0x71a4, 0xa186, 0x0001, 0x0040, 0x2b54,
1022 0x2e53, 0x70a7, 0x0001, 0x067e, 0x1078, 0x4586, 0x20a9, 0x0010, 921 0x0d7e, 0x027e, 0x2100, 0x2011, 0x0001, 0xa212, 0x70b4, 0x2068,
1023 0x2039, 0x0000, 0x1078, 0x40f8, 0xa7b8, 0x0100, 0x00f0, 0x2e5a, 922 0x6800, 0xac06, 0x0040, 0x2b3b, 0x8211, 0x0040, 0x2b52, 0x1078,
1024 0x067f, 0x7000, 0x0079, 0x2e64, 0x2e9e, 0x2e79, 0x2e79, 0x2e6e, 923 0x2b56, 0x0078, 0x2b30, 0x0c7e, 0x2100, 0x2011, 0x0001, 0xa212,
1025 0x2e9e, 0x2e9e, 0x2e9e, 0x2e6c, 0x1078, 0x296b, 0x7060, 0xa005, 924 0x70b4, 0x2068, 0x6800, 0x2060, 0x6008, 0xa084, 0xfbef, 0x600a,
1026 0x0040, 0x2e9e, 0xad06, 0x00c0, 0x2e79, 0x6800, 0x7062, 0x0078, 925 0x8211, 0x0040, 0x2b4f, 0x1078, 0x2b56, 0x0078, 0x2b42, 0x70a7,
1027 0x2e8b, 0x6820, 0xd084, 0x00c0, 0x2e87, 0x6f14, 0x1078, 0x41fe, 926 0x0001, 0x0c7f, 0x027f, 0x0d7f, 0x017f, 0x007c, 0xade8, 0x0005,
1028 0x6008, 0xc0d4, 0x600a, 0x1078, 0x3dd0, 0x0078, 0x2e8b, 0x705c, 927 0x70ac, 0xad06, 0x00c0, 0x2b5e, 0x70a8, 0x2068, 0x007c, 0x1078,
1029 0x2060, 0x6800, 0x6002, 0xa684, 0x5f00, 0x681e, 0x6818, 0xd0fc, 928 0x43b0, 0x00c0, 0x2a08, 0x707c, 0x2068, 0x7774, 0x1078, 0x424e,
1030 0x0040, 0x2e93, 0x6a1a, 0x6817, 0x0000, 0x682b, 0x0000, 0x6820, 929 0x2c50, 0x1078, 0x4492, 0x789b, 0x0010, 0x6814, 0xa084, 0x001f,
1031 0xa084, 0x00ff, 0xc09d, 0x6822, 0x1078, 0x202c, 0xb284, 0x0400, 930 0xc0bd, 0x78aa, 0x6e1c, 0x2041, 0x0001, 0x2001, 0x0004, 0x0078,
1032 0x0040, 0x2ea6, 0x2021, 0x95d0, 0x0078, 0x2ea8, 0x2021, 0x94c0, 931 0x2cd9, 0x1078, 0x43b0, 0x00c0, 0x2a08, 0x789b, 0x0010, 0x7060,
1033 0x1078, 0x2efd, 0xb284, 0x0400, 0x0040, 0x2eb2, 0x2021, 0x4e98, 932 0x2068, 0x6f14, 0x70d4, 0xd0b4, 0x0040, 0x2b93, 0xc0b4, 0x70d6,
1034 0x0078, 0x2eb4, 0x2021, 0x4e58, 0x1078, 0x2efd, 0x20a9, 0x0101, 933 0x0c7e, 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018,
1035 0xb284, 0x0400, 0x0040, 0x2ec0, 0x2021, 0x94d0, 0x0078, 0x2ec2, 934 0x8001, 0x601a, 0x0c7f, 0x1078, 0x424e, 0x2c50, 0x1078, 0x4492,
1036 0x2021, 0x93c0, 0x1078, 0x2efd, 0x8420, 0x00f0, 0x2ec2, 0xb284, 935 0x6824, 0xa005, 0x0040, 0x2ba4, 0xa082, 0x0006, 0x0048, 0x2ba2,
1037 0x0300, 0x0040, 0x2ecf, 0x2061, 0x53c0, 0x0078, 0x2ed1, 0x2061, 936 0x0078, 0x2ba4, 0x6827, 0x0005, 0x6814, 0xa084, 0x001f, 0xc0bd,
1038 0x73c0, 0x2021, 0x0002, 0x20a9, 0x0100, 0x6110, 0x81ff, 0x0040, 937 0x78aa, 0x2031, 0x0020, 0x2041, 0x0001, 0x2001, 0x0003, 0x0078,
1039 0x2eee, 0x6018, 0x017e, 0x007e, 0x2011, 0x4e02, 0x220c, 0xa102, 938 0x2cd9, 0xc28d, 0x72d6, 0x72c0, 0xa200, 0xa015, 0x7154, 0x8108,
1040 0x2012, 0x007f, 0x017f, 0xa102, 0x0050, 0x2eee, 0x6012, 0x00c0, 939 0xa12a, 0x0048, 0x2bbc, 0x71c0, 0x2164, 0x6504, 0x85ff, 0x00c0,
1041 0x2eee, 0x2011, 0x4e04, 0x2204, 0xc0a5, 0x2012, 0x601b, 0x0000, 940 0x2bd3, 0x7156, 0x8421, 0x00c0, 0x2bb7, 0x70d4, 0xd08c, 0x0040,
1042 0xace0, 0x0010, 0x00f0, 0x2ed5, 0x8421, 0x00c0, 0x2ed3, 0x157f, 941 0x2bcf, 0x70d0, 0xa005, 0x00c0, 0x2bcf, 0x70d3, 0x000a, 0x007c,
1043 0x7003, 0x0000, 0x704f, 0x0000, 0x007c, 0x047e, 0x2404, 0xa005, 942 0x2200, 0x0078, 0x2bc1, 0x70d4, 0xc08c, 0x70d6, 0x70d3, 0x0000,
1044 0x0040, 0x2f18, 0x2068, 0x6800, 0x007e, 0x6a1a, 0x6817, 0x0000, 943 0x6034, 0xa005, 0x00c0, 0x2bd0, 0x6708, 0xa784, 0x073f, 0x0040,
944 0x2c02, 0xd7d4, 0x00c0, 0x2bd0, 0xa784, 0x0021, 0x00c0, 0x2bd0,
945 0xa784, 0x0002, 0x0040, 0x2bf3, 0xa784, 0x0004, 0x0040, 0x2bd0,
946 0xa7bc, 0xfffb, 0x670a, 0xa784, 0x0218, 0x00c0, 0x2bd0, 0xa784,
947 0x0100, 0x0040, 0x2c02, 0x6018, 0xa005, 0x00c0, 0x2bd0, 0xa7bc,
948 0xfeff, 0x670a, 0x2568, 0x6823, 0x0000, 0x6e1c, 0xa684, 0x000e,
949 0x6318, 0x0040, 0x2c13, 0x601c, 0xa302, 0x0048, 0x2c16, 0x0040,
950 0x2c16, 0x0078, 0x2bd0, 0x83ff, 0x00c0, 0x2bd0, 0x2d58, 0x2c50,
951 0x7156, 0xd7bc, 0x00c0, 0x2c1f, 0x7028, 0x6022, 0x603a, 0xc7bc,
952 0x670a, 0x68c0, 0xa065, 0xa04d, 0x6100, 0x2a60, 0x2041, 0x0001,
953 0x6b14, 0xa39c, 0x001f, 0xa39d, 0x00c0, 0xd1fc, 0x0040, 0x2c33,
954 0xd684, 0x0040, 0x2c35, 0xa39c, 0xffbf, 0xd6a4, 0x0040, 0x2c3a,
955 0xa39d, 0x0020, 0xa684, 0x000e, 0x00c0, 0x2c85, 0xc7a5, 0x670a,
956 0x2c00, 0x68c6, 0x77a4, 0xa786, 0x0001, 0x00c0, 0x2c59, 0x70d4,
957 0xd0b4, 0x00c0, 0x2c59, 0x7000, 0xa082, 0x0002, 0x00c8, 0x2c59,
958 0x7830, 0xd0bc, 0x00c0, 0x2c59, 0x789b, 0x0010, 0x7baa, 0x0078,
959 0x2cd1, 0x8739, 0x77a6, 0x2750, 0x77b0, 0xa7b0, 0x0005, 0x70ac,
960 0xa606, 0x00c0, 0x2c64, 0x76a8, 0x76b2, 0x2c3a, 0x8738, 0x2d3a,
961 0x8738, 0x283a, 0x8738, 0x233a, 0x8738, 0x253a, 0x7830, 0xd0bc,
962 0x0040, 0x2c7c, 0x2091, 0x8000, 0x2091, 0x303d, 0x70d4, 0xa084,
963 0x303d, 0x2091, 0x8000, 0x2090, 0xaad5, 0x0000, 0x0040, 0x2c84,
964 0x8421, 0x2200, 0x00c0, 0x2bb6, 0x007c, 0xd1dc, 0x0040, 0x3e49,
965 0x2029, 0x0020, 0xd69c, 0x00c0, 0x2c92, 0x8528, 0xd68c, 0x00c0,
966 0x2c92, 0x8528, 0x8840, 0x6f14, 0x610c, 0x8108, 0xa18c, 0x00ff,
967 0x70cc, 0xa160, 0x2c64, 0x8cff, 0x0040, 0x2cb1, 0x6014, 0xa706,
968 0x00c0, 0x2c9a, 0x60b8, 0x8001, 0x60ba, 0x00c0, 0x2c95, 0x2a60,
969 0x6008, 0xa085, 0x0100, 0x600a, 0x2200, 0x8421, 0x00c0, 0x2bb6,
970 0x007c, 0x2a60, 0x610e, 0x69be, 0x2c00, 0x68c6, 0x8840, 0x6008,
971 0xc0d5, 0x600a, 0x77a4, 0xa786, 0x0001, 0x00c0, 0x2c59, 0x70d4,
972 0xd0b4, 0x00c0, 0x2c59, 0x7000, 0xa082, 0x0002, 0x00c8, 0x2c59,
973 0x7830, 0xd0bc, 0x00c0, 0x2c59, 0x789b, 0x0010, 0x7baa, 0x7daa,
974 0x79aa, 0x2001, 0x0002, 0x007e, 0x6018, 0x8000, 0x601a, 0x0078,
975 0x2cda, 0x007e, 0x2960, 0x6104, 0x2a60, 0xa184, 0x0018, 0x0040,
976 0x2cf6, 0xa184, 0x0010, 0x0040, 0x2ce9, 0x1078, 0x405e, 0x00c0,
977 0x2d1b, 0xa184, 0x0008, 0x0040, 0x2cf6, 0x69a0, 0xa184, 0x0600,
978 0x00c0, 0x2cf6, 0x1078, 0x3f3e, 0x0078, 0x2d1b, 0x69a0, 0xa184,
979 0x1e00, 0x0040, 0x2d26, 0xa184, 0x0800, 0x0040, 0x2d0f, 0x0c7e,
980 0x2960, 0x6000, 0xa085, 0x2000, 0x6002, 0x6104, 0xa18d, 0x0010,
981 0x6106, 0x0c7f, 0x1078, 0x405e, 0x00c0, 0x2d1b, 0x69a0, 0xa184,
982 0x0200, 0x0040, 0x2d17, 0x1078, 0x3fa1, 0x0078, 0x2d1b, 0xa184,
983 0x0400, 0x00c0, 0x2cf2, 0x69a0, 0xa184, 0x1000, 0x0040, 0x2d26,
984 0x6914, 0xa18c, 0xff00, 0x810f, 0x1078, 0x27e6, 0x027f, 0xa68c,
985 0x00e0, 0xa684, 0x0060, 0x0040, 0x2d33, 0xa086, 0x0060, 0x00c0,
986 0x2d33, 0xa18d, 0x4000, 0xa18d, 0x0104, 0x69b6, 0x789b, 0x0060,
987 0x2800, 0x78aa, 0x6818, 0xc0fd, 0x681a, 0xd6bc, 0x0040, 0x2d4e,
988 0xc0fc, 0x7087, 0x0000, 0xa08a, 0x000d, 0x0050, 0x2d4c, 0xa08a,
989 0x000c, 0x7186, 0x2001, 0x000c, 0x800c, 0x718a, 0x78aa, 0x3518,
990 0x3340, 0x3428, 0x8000, 0x80ac, 0xaf80, 0x002b, 0x20a0, 0x789b,
991 0x0000, 0xad80, 0x000b, 0x2098, 0x53a6, 0x23a8, 0x2898, 0x25a0,
992 0xa286, 0x0020, 0x00c0, 0x2d86, 0x70d4, 0xc0b5, 0x70d6, 0x2c00,
993 0x70ba, 0x2d00, 0x70be, 0x6814, 0xc0fc, 0x8007, 0x7882, 0xa286,
994 0x0002, 0x0040, 0x2dbc, 0x70a4, 0x8000, 0x70a6, 0x74b4, 0xa498,
995 0x0005, 0x70ac, 0xa306, 0x00c0, 0x2d7e, 0x73a8, 0x73b6, 0xa286,
996 0x0010, 0x0040, 0x2a08, 0x0d7f, 0x0c7f, 0x007c, 0x7000, 0xa005,
997 0x00c0, 0x2d64, 0xa286, 0x0002, 0x00c0, 0x2dd6, 0x1078, 0x43b0,
998 0x00c0, 0x2d64, 0x6814, 0xc0fc, 0x8007, 0x7882, 0x2091, 0x8000,
999 0x781b, 0x005b, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898,
1000 0x78d2, 0x78da, 0x2091, 0x8001, 0x7808, 0xc08d, 0x780a, 0x127e,
1001 0x0d7e, 0x0c7e, 0x70d4, 0xa084, 0x2700, 0x2090, 0x0c7f, 0x0d7f,
1002 0x127f, 0x2900, 0x705a, 0x68bc, 0x7042, 0x7003, 0x0002, 0x2d00,
1003 0x704e, 0xad80, 0x0009, 0x7046, 0x7830, 0xd0bc, 0x0040, 0x2dc8,
1004 0x2091, 0x303d, 0x70d4, 0xa084, 0x303d, 0x2091, 0x8000, 0x2090,
1005 0x70a4, 0xa005, 0x00c0, 0x2dcd, 0x007c, 0x8421, 0x0040, 0x2dcc,
1006 0x7250, 0x70c0, 0xa200, 0xa015, 0x0078, 0x2bb6, 0xa286, 0x0010,
1007 0x00c0, 0x2e07, 0x1078, 0x43b0, 0x00c0, 0x2d64, 0x6814, 0xc0fc,
1008 0x8007, 0x7882, 0x781b, 0x005b, 0x68b4, 0x785a, 0x6894, 0x78d6,
1009 0x78de, 0x6898, 0x78d2, 0x78da, 0x7808, 0xc08d, 0x780a, 0x70a4,
1010 0x8000, 0x70a6, 0x74b4, 0xa490, 0x0005, 0x70ac, 0xa206, 0x00c0,
1011 0x2dfa, 0x72a8, 0x72b6, 0x2900, 0x705a, 0x68bc, 0x7042, 0x7003,
1012 0x0002, 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, 0x007c, 0x6bb4,
1013 0xa39d, 0x2000, 0x7b5a, 0x6814, 0xc0fc, 0x8007, 0x7882, 0x6b94,
1014 0x7bd6, 0x7bde, 0x6e98, 0x7ed2, 0x7eda, 0x781b, 0x005b, 0x2900,
1015 0x705a, 0x7202, 0x7808, 0xc08d, 0x780a, 0x2300, 0xa605, 0x0040,
1016 0x2e32, 0x70d4, 0xa084, 0x2700, 0xa086, 0x2300, 0x00c0, 0x2e2c,
1017 0x2009, 0x0000, 0x0078, 0x2e2e, 0x2009, 0x0001, 0xa284, 0x000f,
1018 0x1079, 0x2e38, 0xad80, 0x0009, 0x7046, 0x2d00, 0x704e, 0x007c,
1019 0x2e40, 0x493f, 0x493f, 0x492c, 0x493f, 0x2e40, 0x2e40, 0x2e40,
1020 0x1078, 0x29b2, 0x7808, 0xa084, 0xfffd, 0x780a, 0x1078, 0x29a5,
1021 0x0f7e, 0x2079, 0x4f00, 0x78ac, 0x0f7f, 0xd084, 0x0040, 0x2e6a,
1022 0x7064, 0xa086, 0x0001, 0x00c0, 0x2e58, 0x7066, 0x0078, 0x2f41,
1023 0x7064, 0xa086, 0x0005, 0x00c0, 0x2e68, 0x707c, 0x2068, 0x681b,
1024 0x0004, 0x6817, 0x0000, 0x6820, 0xa084, 0x00ff, 0xc09d, 0x6822,
1025 0x7067, 0x0000, 0x70a7, 0x0000, 0x70a8, 0x70b2, 0x70b6, 0x1078,
1026 0x2b01, 0x157e, 0x2011, 0x0004, 0x7164, 0xa186, 0x0001, 0x0040,
1027 0x2e8a, 0xa186, 0x0007, 0x00c0, 0x2e81, 0x701f, 0x0005, 0x0078,
1028 0x2e8a, 0x701f, 0x0001, 0x7067, 0x0000, 0x70d4, 0xc0dd, 0x70d6,
1029 0x0078, 0x2e8c, 0x7067, 0x0000, 0x2001, 0x4f0a, 0x2004, 0xa084,
1030 0x00ff, 0xa086, 0x0018, 0x0040, 0x2e9c, 0x7018, 0x7016, 0xa005,
1031 0x00c0, 0x2e9c, 0x70a7, 0x0001, 0x067e, 0x1078, 0x45d6, 0x20a9,
1032 0x0010, 0x2039, 0x0000, 0x1078, 0x4148, 0xa7b8, 0x0100, 0x00f0,
1033 0x2ea3, 0x067f, 0x7000, 0x0079, 0x2ead, 0x2ee7, 0x2ec2, 0x2ec2,
1034 0x2eb7, 0x2ee7, 0x2ee7, 0x2ee7, 0x2eb5, 0x1078, 0x29b2, 0x7060,
1035 0xa005, 0x0040, 0x2ee7, 0xad06, 0x00c0, 0x2ec2, 0x6800, 0x7062,
1036 0x0078, 0x2ed4, 0x6820, 0xd084, 0x00c0, 0x2ed0, 0x6f14, 0x1078,
1037 0x424e, 0x6008, 0xc0d4, 0x600a, 0x1078, 0x3e19, 0x0078, 0x2ed4,
1038 0x705c, 0x2060, 0x6800, 0x6002, 0xa684, 0x5f00, 0x681e, 0x6818,
1039 0xd0fc, 0x0040, 0x2edc, 0x6a1a, 0x6817, 0x0000, 0x682b, 0x0000,
1040 0x6820, 0xa084, 0x00ff, 0xc09d, 0x6822, 0x1078, 0x2073, 0xb284,
1041 0x0400, 0x0040, 0x2eef, 0x2021, 0x96d0, 0x0078, 0x2ef1, 0x2021,
1042 0x95c0, 0x1078, 0x2f46, 0xb284, 0x0400, 0x0040, 0x2efb, 0x2021,
1043 0x4f98, 0x0078, 0x2efd, 0x2021, 0x4f58, 0x1078, 0x2f46, 0x20a9,
1044 0x0101, 0xb284, 0x0400, 0x0040, 0x2f09, 0x2021, 0x95d0, 0x0078,
1045 0x2f0b, 0x2021, 0x94c0, 0x1078, 0x2f46, 0x8420, 0x00f0, 0x2f0b,
1046 0xb284, 0x0300, 0x0040, 0x2f18, 0x2061, 0x54c0, 0x0078, 0x2f1a,
1047 0x2061, 0x74c0, 0x2021, 0x0002, 0x20a9, 0x0100, 0x6110, 0x81ff,
1048 0x0040, 0x2f37, 0x6018, 0x017e, 0x007e, 0x2011, 0x4f02, 0x220c,
1049 0xa102, 0x2012, 0x007f, 0x017f, 0xa102, 0x0050, 0x2f37, 0x6012,
1050 0x00c0, 0x2f37, 0x2011, 0x4f04, 0x2204, 0xc0a5, 0x2012, 0x601b,
1051 0x0000, 0xace0, 0x0010, 0x00f0, 0x2f1e, 0x8421, 0x00c0, 0x2f1c,
1052 0x157f, 0x7003, 0x0000, 0x704f, 0x0000, 0x007c, 0x047e, 0x2404,
1053 0xa005, 0x0040, 0x2f61, 0x2068, 0x6800, 0x007e, 0x6a1a, 0x6817,
1054 0x0000, 0x682b, 0x0000, 0x68b4, 0xa084, 0x5f00, 0x681e, 0x6820,
1055 0xa084, 0x00ff, 0xc09d, 0x6822, 0x1078, 0x2073, 0x007f, 0x0078,
1056 0x2f48, 0x047f, 0x2023, 0x0000, 0x007c, 0xa282, 0x0003, 0x0050,
1057 0x2f6b, 0x1078, 0x29b2, 0x2300, 0x0079, 0x2f6e, 0x2f71, 0x2ffc,
1058 0x3019, 0xa282, 0x0002, 0x0040, 0x2f77, 0x1078, 0x29b2, 0x7064,
1059 0x7067, 0x0000, 0x7083, 0x0000, 0x0079, 0x2f7e, 0x2f86, 0x2f86,
1060 0x2f88, 0x2fc8, 0x3e55, 0x2f86, 0x2fc8, 0x2f86, 0x1078, 0x29b2,
1061 0x7774, 0x1078, 0x4148, 0x7774, 0xa7bc, 0x8f00, 0x1078, 0x424e,
1062 0x6018, 0xa005, 0x0040, 0x2fbf, 0xd7fc, 0x00c0, 0x2f9b, 0x2021,
1063 0x95c0, 0x0078, 0x2f9d, 0x2021, 0x96d0, 0x2009, 0x0005, 0x2011,
1064 0x0010, 0x1078, 0x3034, 0x0040, 0x2fbf, 0x157e, 0x20a9, 0x0101,
1065 0xd7fc, 0x00c0, 0x2faf, 0x2021, 0x94c0, 0x0078, 0x2fb1, 0x2021,
1066 0x95d0, 0x047e, 0x2009, 0x0005, 0x2011, 0x0010, 0x1078, 0x3034,
1067 0x047f, 0x0040, 0x2fbe, 0x8420, 0x00f0, 0x2fb1, 0x157f, 0x8738,
1068 0xa784, 0x001f, 0x00c0, 0x2f8e, 0x0078, 0x2a0c, 0x0078, 0x2a0c,
1069 0x7774, 0x1078, 0x424e, 0x6018, 0xa005, 0x0040, 0x2ffa, 0xd7fc,
1070 0x00c0, 0x2fd6, 0x2021, 0x95c0, 0x0078, 0x2fd8, 0x2021, 0x96d0,
1071 0x2009, 0x0005, 0x2011, 0x0020, 0x1078, 0x3034, 0x0040, 0x2ffa,
1072 0x157e, 0x20a9, 0x0101, 0xd7fc, 0x00c0, 0x2fea, 0x2021, 0x94c0,
1073 0x0078, 0x2fec, 0x2021, 0x95d0, 0x047e, 0x2009, 0x0005, 0x2011,
1074 0x0020, 0x1078, 0x3034, 0x047f, 0x0040, 0x2ff9, 0x8420, 0x00f0,
1075 0x2fec, 0x157f, 0x0078, 0x2a0c, 0x2200, 0x0079, 0x2fff, 0x3002,
1076 0x3004, 0x3004, 0x1078, 0x29b2, 0x2009, 0x0012, 0x7064, 0xa086,
1077 0x0002, 0x0040, 0x300d, 0x2009, 0x000e, 0x6818, 0xd0fc, 0x0040,
1078 0x3012, 0x691a, 0x7067, 0x0000, 0x70d4, 0xc0dd, 0x70d6, 0x0078,
1079 0x435d, 0x2200, 0x0079, 0x301c, 0x3021, 0x3004, 0x301f, 0x1078,
1080 0x29b2, 0x1078, 0x45d6, 0x7000, 0xa086, 0x0002, 0x00c0, 0x3dc7,
1081 0x1078, 0x3e36, 0x6008, 0xa084, 0xfbef, 0x600a, 0x1078, 0x3db8,
1082 0x0040, 0x3dc7, 0x0078, 0x2a0c, 0x2404, 0xa005, 0x0040, 0x306d,
1083 0x2068, 0x2d04, 0x007e, 0x6814, 0xa706, 0x0040, 0x3043, 0x2d20,
1084 0x007f, 0x0078, 0x3035, 0x007f, 0x2022, 0x691a, 0x6817, 0x0000,
1045 0x682b, 0x0000, 0x68b4, 0xa084, 0x5f00, 0x681e, 0x6820, 0xa084, 1085 0x682b, 0x0000, 0x68b4, 0xa084, 0x5f00, 0x681e, 0x6820, 0xa084,
1046 0x00ff, 0xc09d, 0x6822, 0x1078, 0x202c, 0x007f, 0x0078, 0x2eff, 1086 0x00ff, 0xa205, 0x6822, 0x1078, 0x2073, 0x2021, 0x4f02, 0x241c,
1047 0x047f, 0x2023, 0x0000, 0x007c, 0xa282, 0x0003, 0x0050, 0x2f22, 1087 0x8319, 0x2322, 0x6010, 0x8001, 0x6012, 0x00c0, 0x3064, 0x2021,
1048 0x1078, 0x296b, 0x2300, 0x0079, 0x2f25, 0x2f28, 0x2fb3, 0x2fd0, 1088 0x4f04, 0x2404, 0xc0a5, 0x2022, 0x6008, 0xa084, 0xf9ef, 0x600a,
1049 0xa282, 0x0002, 0x0040, 0x2f2e, 0x1078, 0x296b, 0x7064, 0x7067, 1089 0x1078, 0x2b22, 0x1078, 0x3e36, 0x007c, 0xa085, 0x0001, 0x0078,
1050 0x0000, 0x7083, 0x0000, 0x0079, 0x2f35, 0x2f3d, 0x2f3d, 0x2f3f, 1090 0x306c, 0x2300, 0x0079, 0x3074, 0x3079, 0x3077, 0x30f9, 0x1078,
1051 0x2f7f, 0x3e0c, 0x2f3d, 0x2f7f, 0x2f3d, 0x1078, 0x296b, 0x7774, 1091 0x29b2, 0x78e4, 0xa005, 0x00d0, 0x30af, 0x3208, 0x007e, 0x2001,
1052 0x1078, 0x40f8, 0x7774, 0xa7bc, 0x8f00, 0x1078, 0x41fe, 0x6018, 1092 0x4f04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x308a, 0xa18c, 0x0300,
1053 0xa005, 0x0040, 0x2f76, 0xd7fc, 0x00c0, 0x2f52, 0x2021, 0x94c0, 1093 0x0078, 0x308c, 0xa18c, 0x0400, 0x0040, 0x3092, 0x0018, 0x2a08,
1054 0x0078, 0x2f54, 0x2021, 0x95d0, 0x2009, 0x0005, 0x2011, 0x0010, 1094 0x0078, 0x3094, 0x0028, 0x2a08, 0x2008, 0xa084, 0x0030, 0x00c0,
1055 0x1078, 0x2feb, 0x0040, 0x2f76, 0x157e, 0x20a9, 0x0101, 0xd7fc, 1095 0x309b, 0x0078, 0x37b9, 0x78ec, 0xa084, 0x0003, 0x0040, 0x3099,
1056 0x00c0, 0x2f66, 0x2021, 0x93c0, 0x0078, 0x2f68, 0x2021, 0x94d0, 1096 0x2100, 0xa084, 0x0007, 0x0079, 0x30a5, 0x30d9, 0x30e3, 0x30ce,
1057 0x047e, 0x2009, 0x0005, 0x2011, 0x0010, 0x1078, 0x2feb, 0x047f, 1097 0x30ad, 0x43a5, 0x43a5, 0x30ad, 0x30ee, 0x1078, 0x29b2, 0x7000,
1058 0x0040, 0x2f75, 0x8420, 0x00f0, 0x2f68, 0x157f, 0x8738, 0xa784, 1098 0xa086, 0x0004, 0x00c0, 0x30c9, 0x7064, 0xa086, 0x0002, 0x00c0,
1059 0x001f, 0x00c0, 0x2f45, 0x0078, 0x29c5, 0x0078, 0x29c5, 0x7774, 1099 0x30bf, 0x2011, 0x0002, 0x2019, 0x0000, 0x0078, 0x2f65, 0x7064,
1060 0x1078, 0x41fe, 0x6018, 0xa005, 0x0040, 0x2fb1, 0xd7fc, 0x00c0, 1100 0xa086, 0x0006, 0x0040, 0x30b9, 0x7064, 0xa086, 0x0004, 0x0040,
1061 0x2f8d, 0x2021, 0x94c0, 0x0078, 0x2f8f, 0x2021, 0x95d0, 0x2009, 1101 0x30b9, 0x79e4, 0x2001, 0x0003, 0x0078, 0x3443, 0x6818, 0xd0fc,
1062 0x0005, 0x2011, 0x0020, 0x1078, 0x2feb, 0x0040, 0x2fb1, 0x157e, 1102 0x0040, 0x30d4, 0x681b, 0x001d, 0x1078, 0x4118, 0x781b, 0x0064,
1063 0x20a9, 0x0101, 0xd7fc, 0x00c0, 0x2fa1, 0x2021, 0x93c0, 0x0078, 1103 0x007c, 0x6818, 0xd0fc, 0x0040, 0x30df, 0x681b, 0x001d, 0x1078,
1064 0x2fa3, 0x2021, 0x94d0, 0x047e, 0x2009, 0x0005, 0x2011, 0x0020, 1104 0x4118, 0x0078, 0x4381, 0x6818, 0xd0fc, 0x0040, 0x30e9, 0x681b,
1065 0x1078, 0x2feb, 0x047f, 0x0040, 0x2fb0, 0x8420, 0x00f0, 0x2fa3, 1105 0x001d, 0x1078, 0x4118, 0x781b, 0x00f8, 0x007c, 0x6818, 0xd0fc,
1066 0x157f, 0x0078, 0x29c5, 0x2200, 0x0079, 0x2fb6, 0x2fb9, 0x2fbb, 1106 0x0040, 0x30f4, 0x681b, 0x001d, 0x1078, 0x4118, 0x781b, 0x00c8,
1067 0x2fbb, 0x1078, 0x296b, 0x2009, 0x0012, 0x7064, 0xa086, 0x0002, 1107 0x007c, 0xa584, 0x000f, 0x00c0, 0x3118, 0x1078, 0x29a5, 0x7000,
1068 0x0040, 0x2fc4, 0x2009, 0x000e, 0x6818, 0xd0fc, 0x0040, 0x2fc9, 1108 0x0079, 0x3102, 0x2a0c, 0x310a, 0x310c, 0x3dc7, 0x3dc7, 0x3dc7,
1069 0x691a, 0x7067, 0x0000, 0x70d4, 0xc0dd, 0x70d6, 0x0078, 0x430d, 1109 0x310a, 0x310a, 0x1078, 0x29b2, 0x1078, 0x3e36, 0x6008, 0xa084,
1070 0x2200, 0x0079, 0x2fd3, 0x2fd8, 0x2fbb, 0x2fd6, 0x1078, 0x296b, 1110 0xfbef, 0x600a, 0x1078, 0x3db8, 0x0040, 0x3dc7, 0x0078, 0x2a0c,
1071 0x1078, 0x4586, 0x7000, 0xa086, 0x0002, 0x00c0, 0x3d7e, 0x1078, 1111 0x78e4, 0xa005, 0x00d0, 0x30af, 0x3208, 0x007e, 0x2001, 0x4f04,
1072 0x3ded, 0x6008, 0xa084, 0xfbef, 0x600a, 0x1078, 0x3d6f, 0x0040, 1112 0x2004, 0xd0ec, 0x007f, 0x0040, 0x3129, 0xa18c, 0x0300, 0x0078,
1073 0x3d7e, 0x0078, 0x29c5, 0x2404, 0xa005, 0x0040, 0x3024, 0x2068, 1113 0x312b, 0xa18c, 0x0400, 0x0040, 0x3131, 0x0018, 0x30af, 0x0078,
1074 0x2d04, 0x007e, 0x6814, 0xa706, 0x0040, 0x2ffa, 0x2d20, 0x007f, 1114 0x3133, 0x0028, 0x30af, 0x2008, 0xa084, 0x0030, 0x00c0, 0x313b,
1075 0x0078, 0x2fec, 0x007f, 0x2022, 0x691a, 0x6817, 0x0000, 0x682b, 1115 0x781b, 0x005b, 0x007c, 0x78ec, 0xa084, 0x0003, 0x0040, 0x3138,
1076 0x0000, 0x68b4, 0xa084, 0x5f00, 0x681e, 0x6820, 0xa084, 0x00ff, 1116 0x2100, 0xa184, 0x0007, 0x0079, 0x3145, 0x3154, 0x3158, 0x314f,
1077 0xa205, 0x6822, 0x1078, 0x202c, 0x2021, 0x4e02, 0x241c, 0x8319, 1117 0x314d, 0x43a5, 0x43a5, 0x314d, 0x439f, 0x1078, 0x29b2, 0x1078,
1078 0x2322, 0x6010, 0x8001, 0x6012, 0x00c0, 0x301b, 0x2021, 0x4e04, 1118 0x4120, 0x781b, 0x0064, 0x007c, 0x1078, 0x4120, 0x0078, 0x4381,
1079 0x2404, 0xc0a5, 0x2022, 0x6008, 0xa084, 0xf9ef, 0x600a, 0x1078, 1119 0x1078, 0x4120, 0x781b, 0x00f8, 0x007c, 0x1078, 0x4120, 0x781b,
1080 0x2adb, 0x1078, 0x3ded, 0x007c, 0xa085, 0x0001, 0x0078, 0x3023, 1120 0x00c8, 0x007c, 0x2300, 0x0079, 0x3165, 0x316a, 0x3168, 0x316c,
1081 0x2300, 0x0079, 0x302b, 0x3030, 0x302e, 0x30b0, 0x1078, 0x296b, 1121 0x1078, 0x29b2, 0x0078, 0x39a8, 0x681b, 0x0016, 0x78a3, 0x0000,
1082 0x78e4, 0xa005, 0x00d0, 0x3066, 0x3208, 0x007e, 0x2001, 0x4e04, 1122 0x79e4, 0xa184, 0x0030, 0x0040, 0x39a8, 0x78ec, 0xa084, 0x0003,
1083 0x2004, 0xd0ec, 0x007f, 0x0040, 0x3041, 0xa18c, 0x0300, 0x0078, 1123 0x0040, 0x39a8, 0xa184, 0x0100, 0x0040, 0x3170, 0xa184, 0x0007,
1084 0x3043, 0xa18c, 0x0400, 0x0040, 0x3049, 0x0018, 0x29c1, 0x0078, 1124 0x0079, 0x3182, 0x318a, 0x3158, 0x30ce, 0x435d, 0x43a5, 0x43a5,
1085 0x304b, 0x0028, 0x29c1, 0x2008, 0xa084, 0x0030, 0x00c0, 0x3052, 1125 0x435d, 0x439f, 0x1078, 0x4369, 0x007c, 0xa282, 0x0005, 0x0050,
1086 0x0078, 0x3770, 0x78ec, 0xa084, 0x0003, 0x0040, 0x3050, 0x2100, 1126 0x3193, 0x1078, 0x29b2, 0x2300, 0x0079, 0x3196, 0x3199, 0x33c9,
1087 0xa084, 0x0007, 0x0079, 0x305c, 0x3090, 0x309a, 0x3085, 0x3064, 1127 0x33d4, 0x2200, 0x0079, 0x319c, 0x31b6, 0x31a3, 0x31b6, 0x31a1,
1088 0x4355, 0x4355, 0x3064, 0x30a5, 0x1078, 0x296b, 0x7000, 0xa086, 1128 0x33ac, 0x1078, 0x29b2, 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff,
1089 0x0004, 0x00c0, 0x3080, 0x7064, 0xa086, 0x0002, 0x00c0, 0x3076, 1129 0xa082, 0x0020, 0x0048, 0x4107, 0xa08a, 0x0004, 0x00c8, 0x4107,
1090 0x2011, 0x0002, 0x2019, 0x0000, 0x0078, 0x2f1c, 0x7064, 0xa086, 1130 0x0079, 0x31b2, 0x4107, 0x4107, 0x4107, 0x40b1, 0x789b, 0x0018,
1091 0x0006, 0x0040, 0x3070, 0x7064, 0xa086, 0x0004, 0x0040, 0x3070, 1131 0x79a8, 0xa184, 0x0080, 0x0040, 0x31c7, 0x0078, 0x4107, 0x7000,
1092 0x79e4, 0x2001, 0x0003, 0x0078, 0x33fa, 0x6818, 0xd0fc, 0x0040, 1132 0xa005, 0x00c0, 0x31bd, 0x2011, 0x0004, 0x0078, 0x3b93, 0xa184,
1093 0x308b, 0x681b, 0x001d, 0x1078, 0x40c8, 0x781b, 0x0064, 0x007c, 1133 0x00ff, 0xa08a, 0x0010, 0x00c8, 0x4107, 0x0079, 0x31cf, 0x31e1,
1094 0x6818, 0xd0fc, 0x0040, 0x3096, 0x681b, 0x001d, 0x1078, 0x40c8, 1134 0x31df, 0x31f6, 0x31fa, 0x32cd, 0x4107, 0x4107, 0x32cf, 0x4107,
1095 0x0078, 0x4331, 0x6818, 0xd0fc, 0x0040, 0x30a0, 0x681b, 0x001d, 1135 0x4107, 0x33a8, 0x33a8, 0x4107, 0x4107, 0x4107, 0x33aa, 0x1078,
1096 0x1078, 0x40c8, 0x781b, 0x00f8, 0x007c, 0x6818, 0xd0fc, 0x0040, 1136 0x29b2, 0xd6e4, 0x0040, 0x31ec, 0x2001, 0x0300, 0x8000, 0x8000,
1097 0x30ab, 0x681b, 0x001d, 0x1078, 0x40c8, 0x781b, 0x00c8, 0x007c, 1137 0x783a, 0x781b, 0x00c3, 0x007c, 0x6818, 0xd0fc, 0x0040, 0x31f4,
1098 0xa584, 0x000f, 0x00c0, 0x30cf, 0x1078, 0x295e, 0x7000, 0x0079, 1138 0x681b, 0x001d, 0x0078, 0x31e4, 0x0078, 0x435d, 0x681b, 0x001d,
1099 0x30b9, 0x29c5, 0x30c1, 0x30c3, 0x3d7e, 0x3d7e, 0x3d7e, 0x30c1, 1139 0x0078, 0x4111, 0x6920, 0x6922, 0xa684, 0x1800, 0x00c0, 0x325f,
1100 0x30c1, 0x1078, 0x296b, 0x1078, 0x3ded, 0x6008, 0xa084, 0xfbef, 1140 0x6820, 0xd084, 0x00c0, 0x3265, 0x6818, 0xa086, 0x0008, 0x00c0,
1101 0x600a, 0x1078, 0x3d6f, 0x0040, 0x3d7e, 0x0078, 0x29c5, 0x78e4, 1141 0x320b, 0x681b, 0x0000, 0xd6d4, 0x0040, 0x32ca, 0xd6bc, 0x0040,
1102 0xa005, 0x00d0, 0x3066, 0x3208, 0x007e, 0x2001, 0x4e04, 0x2004, 1142 0x324b, 0x7087, 0x0000, 0x6818, 0xa084, 0x003f, 0xa08a, 0x000d,
1103 0xd0ec, 0x007f, 0x0040, 0x30e0, 0xa18c, 0x0300, 0x0078, 0x30e2, 1143 0x0050, 0x324b, 0xa08a, 0x000c, 0x7186, 0x2001, 0x000c, 0x800c,
1104 0xa18c, 0x0400, 0x0040, 0x30e8, 0x0018, 0x3066, 0x0078, 0x30ea, 1144 0x718a, 0x789b, 0x0061, 0x78aa, 0x157e, 0x137e, 0x147e, 0x017e,
1105 0x0028, 0x3066, 0x2008, 0xa084, 0x0030, 0x00c0, 0x30f2, 0x781b, 1145 0x3208, 0xa18c, 0x0300, 0x0040, 0x323d, 0x007e, 0x2001, 0x4f04,
1106 0x005b, 0x007c, 0x78ec, 0xa084, 0x0003, 0x0040, 0x30ef, 0x2100, 1146 0x2004, 0xd0ec, 0x007f, 0x0040, 0x3239, 0x20a1, 0x012b, 0x0078,
1107 0xa184, 0x0007, 0x0079, 0x30fc, 0x310b, 0x310f, 0x3106, 0x3104, 1147 0x323f, 0x20a1, 0x022b, 0x0078, 0x323f, 0x20a1, 0x012b, 0x017f,
1108 0x4355, 0x4355, 0x3104, 0x434f, 0x1078, 0x296b, 0x1078, 0x40d0, 1148 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6,
1109 0x781b, 0x0064, 0x007c, 0x1078, 0x40d0, 0x0078, 0x4331, 0x1078, 1149 0x147f, 0x137f, 0x157f, 0x6038, 0xa005, 0x00c0, 0x325a, 0x681c,
1110 0x40d0, 0x781b, 0x00f8, 0x007c, 0x1078, 0x40d0, 0x781b, 0x00c8, 1150 0xa084, 0x000e, 0x0040, 0x4111, 0x1078, 0x4127, 0x782b, 0x3008,
1111 0x007c, 0x2300, 0x0079, 0x311c, 0x3121, 0x311f, 0x3123, 0x1078, 1151 0x0078, 0x325c, 0x8001, 0x603a, 0x781b, 0x0067, 0x007c, 0xd6e4,
1112 0x296b, 0x0078, 0x395f, 0x681b, 0x0016, 0x78a3, 0x0000, 0x79e4, 1152 0x0040, 0x3265, 0x781b, 0x0079, 0x007c, 0xa684, 0x0060, 0x0040,
1113 0xa184, 0x0030, 0x0040, 0x395f, 0x78ec, 0xa084, 0x0003, 0x0040, 1153 0x32c7, 0xd6dc, 0x0040, 0x32c7, 0xd6fc, 0x00c0, 0x3271, 0x0078,
1114 0x395f, 0xa184, 0x0100, 0x0040, 0x3127, 0xa184, 0x0007, 0x0079, 1154 0x3288, 0xc6fc, 0x7e5a, 0x6eb6, 0x7adc, 0x79d8, 0x78d0, 0x801b,
1115 0x3139, 0x3141, 0x310f, 0x3085, 0x430d, 0x4355, 0x4355, 0x430d, 1155 0x00c8, 0x327b, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000,
1116 0x434f, 0x1078, 0x4319, 0x007c, 0xa282, 0x0005, 0x0050, 0x314a,
1117 0x1078, 0x296b, 0x2300, 0x0079, 0x314d, 0x3150, 0x3380, 0x338b,
1118 0x2200, 0x0079, 0x3153, 0x316d, 0x315a, 0x316d, 0x3158, 0x3363,
1119 0x1078, 0x296b, 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa082,
1120 0x0020, 0x0048, 0x40b7, 0xa08a, 0x0004, 0x00c8, 0x40b7, 0x0079,
1121 0x3169, 0x40b7, 0x40b7, 0x40b7, 0x4061, 0x789b, 0x0018, 0x79a8,
1122 0xa184, 0x0080, 0x0040, 0x317e, 0x0078, 0x40b7, 0x7000, 0xa005,
1123 0x00c0, 0x3174, 0x2011, 0x0004, 0x0078, 0x3b4a, 0xa184, 0x00ff,
1124 0xa08a, 0x0010, 0x00c8, 0x40b7, 0x0079, 0x3186, 0x3198, 0x3196,
1125 0x31ad, 0x31b1, 0x3284, 0x40b7, 0x40b7, 0x3286, 0x40b7, 0x40b7,
1126 0x335f, 0x335f, 0x40b7, 0x40b7, 0x40b7, 0x3361, 0x1078, 0x296b,
1127 0xd6e4, 0x0040, 0x31a3, 0x2001, 0x0300, 0x8000, 0x8000, 0x783a,
1128 0x781b, 0x00c3, 0x007c, 0x6818, 0xd0fc, 0x0040, 0x31ab, 0x681b,
1129 0x001d, 0x0078, 0x319b, 0x0078, 0x430d, 0x681b, 0x001d, 0x0078,
1130 0x40c1, 0x6920, 0x6922, 0xa684, 0x1800, 0x00c0, 0x3216, 0x6820,
1131 0xd084, 0x00c0, 0x321c, 0x6818, 0xa086, 0x0008, 0x00c0, 0x31c2,
1132 0x681b, 0x0000, 0xd6d4, 0x0040, 0x3281, 0xd6bc, 0x0040, 0x3202,
1133 0x7087, 0x0000, 0x6818, 0xa084, 0x003f, 0xa08a, 0x000d, 0x0050,
1134 0x3202, 0xa08a, 0x000c, 0x7186, 0x2001, 0x000c, 0x800c, 0x718a,
1135 0x789b, 0x0061, 0x78aa, 0x157e, 0x137e, 0x147e, 0x017e, 0x3208,
1136 0xa18c, 0x0300, 0x0040, 0x31f4, 0x007e, 0x2001, 0x4e04, 0x2004,
1137 0xd0ec, 0x007f, 0x0040, 0x31f0, 0x20a1, 0x012b, 0x0078, 0x31f6,
1138 0x20a1, 0x022b, 0x0078, 0x31f6, 0x20a1, 0x012b, 0x017f, 0x789b,
1139 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f,
1140 0x137f, 0x157f, 0x6038, 0xa005, 0x00c0, 0x3211, 0x681c, 0xa084,
1141 0x000e, 0x0040, 0x40c1, 0x1078, 0x40d7, 0x782b, 0x3008, 0x0078,
1142 0x3213, 0x8001, 0x603a, 0x781b, 0x0067, 0x007c, 0xd6e4, 0x0040,
1143 0x321c, 0x781b, 0x0079, 0x007c, 0xa684, 0x0060, 0x0040, 0x327e,
1144 0xd6dc, 0x0040, 0x327e, 0xd6fc, 0x00c0, 0x3228, 0x0078, 0x323f,
1145 0xc6fc, 0x7e5a, 0x6eb6, 0x7adc, 0x79d8, 0x78d0, 0x801b, 0x00c8,
1146 0x3232, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98,
1147 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0xd6f4,
1148 0x0040, 0x3245, 0xc6f4, 0x7e5a, 0x6eb6, 0x7000, 0xa086, 0x0003,
1149 0x00c0, 0x3253, 0x007e, 0x1078, 0x4586, 0x1078, 0x48bd, 0x007f,
1150 0x781b, 0x0076, 0x007c, 0xa006, 0x1078, 0x49c3, 0x6ab0, 0x69ac,
1151 0x6c98, 0x6b94, 0x2200, 0xa105, 0x0040, 0x3262, 0x2200, 0xa422,
1152 0x2100, 0xa31b, 0x6caa, 0x7cd2, 0x7cda, 0x6ba6, 0x7bd6, 0x7bde,
1153 0x2300, 0xa405, 0x00c0, 0x3272, 0xc6f5, 0x7e5a, 0x6eb6, 0x781b,
1154 0x0076, 0x007c, 0x781b, 0x0076, 0x2200, 0xa115, 0x00c0, 0x327b,
1155 0x1078, 0x48bd, 0x007c, 0x1078, 0x48f5, 0x007c, 0x781b, 0x0079,
1156 0x007c, 0x781b, 0x0067, 0x007c, 0x1078, 0x296b, 0x0078, 0x32d2,
1157 0x6920, 0xd1c4, 0x0040, 0x329b, 0xc1c4, 0x6922, 0x0c7e, 0x7058,
1158 0x2060, 0x6000, 0xc0e4, 0x6002, 0x6004, 0xa084, 0xfff5, 0x6006,
1159 0x0c7f, 0x0078, 0x32c6, 0xd1cc, 0x0040, 0x32c6, 0xc1cc, 0x6922,
1160 0x0c7e, 0x7058, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x6004, 0xc0a4,
1161 0x6006, 0x2008, 0x2c48, 0x0c7f, 0xd19c, 0x0040, 0x32c6, 0x1078,
1162 0x41fa, 0x1078, 0x3ef5, 0x88ff, 0x0040, 0x32c6, 0x789b, 0x0060,
1163 0x2800, 0x78aa, 0x7e58, 0xc695, 0x7e5a, 0xd6d4, 0x00c0, 0x32c3,
1164 0x781b, 0x0064, 0x007c, 0x781b, 0x0078, 0x007c, 0x7e58, 0xd6d4,
1165 0x00c0, 0x32cd, 0x781b, 0x0067, 0x007c, 0x781b, 0x0079, 0x007c,
1166 0x0078, 0x40bc, 0x2019, 0x0000, 0x7990, 0xa18c, 0x0007, 0x00c0,
1167 0x32e0, 0x6820, 0xa084, 0x0100, 0x0040, 0x32d0, 0x2009, 0x0008,
1168 0x789b, 0x0010, 0x78a8, 0xa094, 0x00ff, 0xa286, 0x0001, 0x00c0,
1169 0x32fc, 0x2300, 0x7ca8, 0xa400, 0x2018, 0xa102, 0x0040, 0x32f4,
1170 0x0048, 0x32f4, 0x0078, 0x32f6, 0x0078, 0x3288, 0x24a8, 0x7aa8,
1171 0x00f0, 0x32f6, 0x0078, 0x32e2, 0xa284, 0x00f0, 0xa086, 0x0020,
1172 0x00c0, 0x3350, 0x8318, 0x8318, 0x2300, 0xa102, 0x0040, 0x330c,
1173 0x0048, 0x330c, 0x0078, 0x334d, 0xa286, 0x0023, 0x0040, 0x32d0,
1174 0x681c, 0xa084, 0xfff1, 0x681e, 0x7e58, 0xa684, 0xfff1, 0xc0a5,
1175 0x2030, 0x7e5a, 0x6008, 0xc0a5, 0x600a, 0x0c7e, 0x7058, 0x2060,
1176 0x6004, 0x2008, 0x2c48, 0x0c7f, 0xd1a4, 0x0040, 0x332d, 0x1078,
1177 0x41fa, 0x1078, 0x4011, 0x0078, 0x333b, 0x0c7e, 0x7058, 0x2060,
1178 0x6004, 0x2008, 0x2c48, 0x0c7f, 0xd19c, 0x0040, 0x32c6, 0x1078,
1179 0x41fa, 0x1078, 0x3ef5, 0x88ff, 0x0040, 0x32c6, 0x789b, 0x0060,
1180 0x2800, 0x78aa, 0xc695, 0x7e5a, 0xd6d4, 0x00c0, 0x334a, 0x781b,
1181 0x0064, 0x007c, 0x781b, 0x0078, 0x007c, 0x7aa8, 0x0078, 0x32e2,
1182 0x8318, 0x2300, 0xa102, 0x0040, 0x3359, 0x0048, 0x3359, 0x0078,
1183 0x32e2, 0xa284, 0x0080, 0x00c0, 0x40c1, 0x0078, 0x40bc, 0x0078,
1184 0x40c1, 0x0078, 0x40b7, 0x7058, 0xa04d, 0x789b, 0x0018, 0x78a8,
1185 0xa084, 0x00ff, 0xa08e, 0x0001, 0x0040, 0x3370, 0x1078, 0x296b,
1186 0x7aa8, 0xa294, 0x00ff, 0x78a8, 0xa084, 0x00ff, 0xa08a, 0x0004,
1187 0x00c8, 0x40b7, 0x0079, 0x337c, 0x40b7, 0x3e46, 0x40b7, 0x3fb9,
1188 0xa282, 0x0000, 0x00c0, 0x3386, 0x1078, 0x296b, 0x1078, 0x40c8,
1189 0x781b, 0x0078, 0x007c, 0xa282, 0x0003, 0x00c0, 0x3391, 0x1078,
1190 0x296b, 0xd4fc, 0x00c0, 0x33b1, 0x7064, 0xa005, 0x0040, 0x339a,
1191 0x1078, 0x296b, 0x6f14, 0x7776, 0xa7bc, 0x8f00, 0x1078, 0x41fe,
1192 0x6008, 0xa085, 0x0021, 0x600a, 0x8738, 0xa784, 0x001f, 0x00c0,
1193 0x339e, 0x1078, 0x40cc, 0x7067, 0x0002, 0x701f, 0x0009, 0x0078,
1194 0x33b3, 0x1078, 0x40db, 0x781b, 0x0078, 0x007c, 0xa282, 0x0004,
1195 0x0050, 0x33bc, 0x1078, 0x296b, 0x2300, 0x0079, 0x33bf, 0x33c2,
1196 0x3582, 0x35c5, 0xa286, 0x0003, 0x0040, 0x33fa, 0x7200, 0x7cd8,
1197 0x7ddc, 0x7fd0, 0x71d4, 0xd1bc, 0x00c0, 0x33f2, 0xd1b4, 0x0040,
1198 0x33f2, 0x7868, 0xa084, 0x00ff, 0x00c0, 0x33f2, 0xa282, 0x0002,
1199 0x00c8, 0x33f2, 0x0d7e, 0x783b, 0x8300, 0x781b, 0x004c, 0x70bc,
1200 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2,
1201 0x78da, 0xc1b4, 0x71d6, 0x7003, 0x0030, 0x0d7f, 0x2001, 0x0000,
1202 0x0078, 0x33fe, 0x783b, 0x1300, 0x781b, 0x004a, 0x2001, 0x0000,
1203 0x0078, 0x33fe, 0x7200, 0x7cd8, 0x7ddc, 0x7fd0, 0x704a, 0x68a0,
1204 0xd0ec, 0x0040, 0x3406, 0x6008, 0xc08d, 0x600a, 0xa284, 0x000f,
1205 0x0079, 0x340a, 0x3562, 0x3417, 0x3414, 0x36c8, 0x3754, 0x29c5,
1206 0x3412, 0x3412, 0x1078, 0x296b, 0x6008, 0xc0d4, 0x600a, 0xd6e4,
1207 0x0040, 0x341f, 0x7048, 0xa086, 0x0014, 0x00c0, 0x343f, 0x1078,
1208 0x4586, 0x2009, 0x0000, 0x6818, 0xd0fc, 0x0040, 0x3428, 0x7048,
1209 0xa086, 0x0014, 0x0040, 0x3439, 0x6818, 0xa086, 0x0008, 0x00c0,
1210 0x351a, 0x7858, 0xd09c, 0x0040, 0x351a, 0x6820, 0xd0ac, 0x0040,
1211 0x351a, 0x681b, 0x0014, 0x2009, 0x0002, 0x0078, 0x347e, 0x7868,
1212 0xa08c, 0x00ff, 0x0040, 0x347e, 0xa186, 0x0008, 0x00c0, 0x3455,
1213 0x6008, 0xc0a4, 0x600a, 0x1078, 0x3d6f, 0x0040, 0x347e, 0x1078,
1214 0x3ded, 0x1078, 0x4586, 0x0078, 0x3466, 0xa186, 0x0028, 0x00c0,
1215 0x347e, 0x6018, 0xa005, 0x0040, 0x3448, 0x8001, 0x0040, 0x3448,
1216 0x8001, 0x0040, 0x3448, 0x601e, 0x0078, 0x3448, 0x6820, 0xd084,
1217 0x0040, 0x29c5, 0xc084, 0x6822, 0x1078, 0x2acc, 0x705c, 0x0c7e,
1218 0x2060, 0x6800, 0x6002, 0x0c7f, 0x6004, 0x6802, 0xa005, 0x2d00,
1219 0x00c0, 0x347b, 0x6002, 0x6006, 0x0078, 0x29c5, 0x017e, 0x81ff,
1220 0x00c0, 0x34c8, 0x7000, 0xa086, 0x0030, 0x0040, 0x34c8, 0x71d4,
1221 0xd1bc, 0x00c0, 0x34c8, 0xd1b4, 0x00c0, 0x34af, 0x7060, 0xa005,
1222 0x00c0, 0x34c8, 0x70a4, 0xa086, 0x0001, 0x0040, 0x34c8, 0x7003,
1223 0x0000, 0x047e, 0x057e, 0x077e, 0x067e, 0x0c7e, 0x0d7e, 0x1078,
1224 0x29ee, 0x0d7f, 0x0c7f, 0x067f, 0x077f, 0x057f, 0x047f, 0x71d4,
1225 0xd1b4, 0x00c0, 0x34c8, 0x7003, 0x0040, 0x0078, 0x34c8, 0x1078,
1226 0x4360, 0x00c0, 0x34c8, 0x781b, 0x005b, 0x0d7e, 0x70bc, 0xa06d,
1227 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da,
1228 0xc1b4, 0x71d6, 0x7003, 0x0030, 0x7808, 0xc08d, 0x780a, 0x0d7f,
1229 0x1078, 0x35ff, 0x017f, 0x81ff, 0x0040, 0x351a, 0xa684, 0xdf00,
1230 0x681e, 0x682b, 0x0000, 0x6f14, 0xa186, 0x0002, 0x00c0, 0x351b,
1231 0x6818, 0xa086, 0x0014, 0x00c0, 0x34e4, 0x2008, 0xd6e4, 0x0040,
1232 0x34e4, 0x7868, 0xa08c, 0x00ff, 0x1078, 0x2aba, 0x1078, 0x2adb,
1233 0x6820, 0xd0dc, 0x00c0, 0x351b, 0x8717, 0xa294, 0x000f, 0x8213,
1234 0x8213, 0x8213, 0xb284, 0x0300, 0x0040, 0x34fa, 0xa290, 0x52c0,
1235 0x0078, 0x34fc, 0xa290, 0x5340, 0xa290, 0x0000, 0x221c, 0xd3c4,
1236 0x00c0, 0x3504, 0x0078, 0x350a, 0x8210, 0x2204, 0xa085, 0x0018,
1237 0x2012, 0x8211, 0xd3d4, 0x0040, 0x3515, 0x68a0, 0xd0c4, 0x00c0,
1238 0x3515, 0x1078, 0x3679, 0x0078, 0x29c5, 0x6008, 0xc08d, 0x600a,
1239 0x0078, 0x351b, 0x692a, 0x6916, 0x6818, 0xd0fc, 0x0040, 0x3522,
1240 0x7048, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x6410, 0x84ff, 0x0040,
1241 0x3537, 0x2009, 0x4e02, 0x2104, 0x8001, 0x200a, 0x8421, 0x6412,
1242 0x00c0, 0x3537, 0x2021, 0x4e04, 0x2404, 0xc0a5, 0x2022, 0x6018,
1243 0xa005, 0x0040, 0x353f, 0x8001, 0x601a, 0x00c0, 0x3542, 0x6008,
1244 0xc0a4, 0x600a, 0x6820, 0xd084, 0x00c0, 0x354e, 0x6800, 0xa005,
1245 0x00c0, 0x354b, 0x6002, 0x6006, 0x0078, 0x3552, 0x705c, 0x2060,
1246 0x6800, 0x6002, 0x2061, 0x4e00, 0x6887, 0x0103, 0x2d08, 0x206b,
1247 0x0000, 0x6068, 0xa005, 0x616a, 0x0040, 0x3561, 0x2d02, 0x0078,
1248 0x3562, 0x616e, 0x7200, 0xa286, 0x0030, 0x0040, 0x3572, 0xa286,
1249 0x0040, 0x00c0, 0x29c5, 0x7003, 0x0002, 0x704c, 0x2068, 0x68c4,
1250 0x2060, 0x007c, 0x7003, 0x0002, 0x70bc, 0xa06d, 0x68bc, 0x7042,
1251 0x70b8, 0xa065, 0x68c0, 0x705a, 0x2d00, 0x704e, 0xad80, 0x0009,
1252 0x7046, 0x007c, 0xa282, 0x0004, 0x0048, 0x3588, 0x1078, 0x296b,
1253 0x2200, 0x0079, 0x358b, 0x358f, 0x35a0, 0x35ad, 0x35a0, 0xa586,
1254 0x1300, 0x0040, 0x35a0, 0xa586, 0x8300, 0x00c0, 0x3586, 0x7003,
1255 0x0000, 0x6018, 0x8001, 0x601a, 0x6008, 0xa084, 0xfbef, 0x600a,
1256 0x7000, 0xa086, 0x0005, 0x0040, 0x35aa, 0x1078, 0x40c8, 0x781b,
1257 0x0078, 0x007c, 0x781b, 0x0079, 0x007c, 0x7890, 0x8007, 0x8001,
1258 0xa084, 0x0007, 0xa080, 0x0018, 0x789a, 0x79a8, 0xa18c, 0x00ff,
1259 0xa186, 0x0003, 0x0040, 0x35c2, 0xa186, 0x0000, 0x0040, 0x35c2,
1260 0x0078, 0x40b7, 0x781b, 0x0079, 0x007c, 0x6820, 0xc095, 0x6822,
1261 0x82ff, 0x00c0, 0x35cf, 0x1078, 0x40c8, 0x0078, 0x35d6, 0x8211,
1262 0x0040, 0x35d4, 0x1078, 0x296b, 0x1078, 0x40db, 0x781b, 0x0078,
1263 0x007c, 0x1078, 0x4383, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x35fc,
1264 0x017e, 0x3208, 0x007e, 0x2001, 0x4e04, 0x2004, 0xd0ec, 0x007f,
1265 0x0040, 0x35ee, 0xa18c, 0x0300, 0x0078, 0x35f0, 0xa18c, 0x0400,
1266 0x017f, 0x0040, 0x35f7, 0x0018, 0x35fc, 0x0078, 0x35f9, 0x0028,
1267 0x35fc, 0x791a, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c, 0xa684,
1268 0x0060, 0x00c0, 0x3609, 0x682f, 0x0000, 0x6833, 0x0000, 0x0078,
1269 0x3678, 0xd6dc, 0x00c0, 0x3621, 0x68b4, 0xd0dc, 0x00c0, 0x3621,
1270 0x6998, 0x6a94, 0x692e, 0x6a32, 0x7048, 0xa005, 0x00c0, 0x361e,
1271 0x2200, 0xa105, 0x0040, 0x4586, 0x704b, 0x0015, 0x0078, 0x4586,
1272 0x007c, 0xd6ac, 0x0040, 0x3647, 0xd6f4, 0x0040, 0x362d, 0x682f,
1273 0x0000, 0x6833, 0x0000, 0x0078, 0x4586, 0x68b4, 0xa084, 0x4000,
1274 0xa635, 0xd6f4, 0x00c0, 0x3627, 0x7048, 0xa005, 0x00c0, 0x363a,
1275 0x704b, 0x0015, 0xd6dc, 0x00c0, 0x3643, 0x68b4, 0xd0dc, 0x0040,
1276 0x3643, 0x6ca8, 0x6da4, 0x6c2e, 0x6d32, 0x0078, 0x4586, 0xd6f4,
1277 0x0040, 0x3650, 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x4586,
1278 0x68b4, 0xa084, 0x4800, 0xa635, 0xd6f4, 0x00c0, 0x364a, 0x7048,
1279 0xa005, 0x00c0, 0x365d, 0x704b, 0x0015, 0x2408, 0x2510, 0x2700,
1280 0x80fb, 0x00c8, 0x3664, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291,
1281 0x0000, 0x692e, 0x6a32, 0x2100, 0xa205, 0x00c0, 0x3671, 0x0078,
1282 0x4586, 0x7000, 0xa086, 0x0006, 0x0040, 0x3678, 0x0078, 0x4586,
1283 0x007c, 0x6946, 0x6008, 0xc0cd, 0xd3cc, 0x0040, 0x3680, 0xc08d,
1284 0x600a, 0x6818, 0x683a, 0x681b, 0x0006, 0x688f, 0x0000, 0x6893,
1285 0x0000, 0x6a30, 0x692c, 0x6a3e, 0x6942, 0x682f, 0x0003, 0x6833,
1286 0x0000, 0x6837, 0x0020, 0x6897, 0x0000, 0x689b, 0x0020, 0x7000,
1287 0x0079, 0x369a, 0x29c5, 0x36ac, 0x36a4, 0x36a2, 0x36a2, 0x36a2,
1288 0x36a2, 0x36a2, 0x1078, 0x296b, 0x6820, 0xd084, 0x00c0, 0x36ac,
1289 0x1078, 0x3dd0, 0x0078, 0x36b2, 0x705c, 0x2c50, 0x2060, 0x6800,
1290 0x6002, 0x2a60, 0x3208, 0xa18c, 0x0300, 0x0040, 0x36bb, 0x2021,
1291 0x4e58, 0x0078, 0x36bd, 0x2021, 0x4e98, 0x2404, 0xa005, 0x0040,
1292 0x36c4, 0x2020, 0x0078, 0x36bd, 0x2d22, 0x206b, 0x0000, 0x007c,
1293 0x1078, 0x3dd7, 0x1078, 0x3ded, 0x6008, 0xc0cc, 0x600a, 0x682b,
1294 0x0000, 0x789b, 0x000e, 0x6f14, 0x6938, 0x691a, 0x6944, 0x6916,
1295 0x3208, 0xa18c, 0x0300, 0x0040, 0x36e1, 0x2009, 0x0000, 0x0078,
1296 0x36e3, 0x2009, 0x0001, 0x1078, 0x49f8, 0xd6dc, 0x0040, 0x36eb,
1297 0x691c, 0xc1ed, 0x691e, 0x6818, 0xd0fc, 0x0040, 0x36fa, 0x7868,
1298 0xa08c, 0x00ff, 0x0040, 0x36f8, 0x681b, 0x001e, 0x0078, 0x36fa,
1299 0x681b, 0x0000, 0xb284, 0x0300, 0x00c0, 0x3702, 0x2021, 0x4e98,
1300 0x0078, 0x3704, 0x2021, 0x4e58, 0x6800, 0x2022, 0x6a3c, 0x6940,
1301 0x6a32, 0x692e, 0x68c0, 0x2060, 0x6000, 0xd0a4, 0x0040, 0x3744,
1302 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x0d7e, 0x0f7e,
1303 0x157e, 0x147e, 0x2079, 0x4e00, 0x1078, 0x1dff, 0x147f, 0x157f,
1304 0x0f7f, 0x70cc, 0x2010, 0x2009, 0x0101, 0x027e, 0x2204, 0xa06d,
1305 0x0040, 0x3734, 0x6814, 0xa706, 0x0040, 0x3731, 0x6800, 0x0078,
1306 0x3727, 0x6820, 0xc0d5, 0x6822, 0x027f, 0x8210, 0x8109, 0x00c0,
1307 0x3725, 0x0d7f, 0x7067, 0x0003, 0x707f, 0x0000, 0x7776, 0x7083,
1308 0x000f, 0x71d4, 0xc1dc, 0x71d6, 0x6818, 0xa086, 0x0002, 0x00c0,
1309 0x3750, 0x6817, 0x0000, 0x682b, 0x0000, 0x681c, 0xc0ec, 0x681e,
1310 0x1078, 0x202c, 0x0078, 0x29c5, 0x7cd8, 0x7ddc, 0x7fd0, 0x1078,
1311 0x35ff, 0x682b, 0x0000, 0x789b, 0x000e, 0x6f14, 0x1078, 0x4387,
1312 0xa08c, 0x00ff, 0x6916, 0x6818, 0xd0fc, 0x0040, 0x3769, 0x7048,
1313 0x681a, 0xa68c, 0xdf00, 0x691e, 0x7067, 0x0000, 0x0078, 0x29c5,
1314 0x7000, 0xa005, 0x00c0, 0x3776, 0x0078, 0x29c5, 0xa006, 0x1078,
1315 0x4586, 0x6920, 0xd1ac, 0x00c0, 0x377f, 0x681b, 0x0014, 0xa68c,
1316 0xdf00, 0x691e, 0x682b, 0x0000, 0x6820, 0xa084, 0x00ff, 0x6822,
1317 0x7000, 0x0079, 0x378b, 0x29c5, 0x3795, 0x3795, 0x3798, 0x3798,
1318 0x3798, 0x3793, 0x3793, 0x1078, 0x296b, 0x6818, 0x0078, 0x33fa,
1319 0x6008, 0xc0a4, 0x600a, 0x6817, 0x0000, 0x0078, 0x3d95, 0x2300,
1320 0x0079, 0x37a2, 0x37a5, 0x37a7, 0x3817, 0x1078, 0x296b, 0xd6fc,
1321 0x00c0, 0x37fe, 0x7000, 0xa00d, 0x0079, 0x37ae, 0x29c5, 0x37b8,
1322 0x37b8, 0x37e8, 0x37b8, 0x37fb, 0x37b6, 0x37b6, 0x1078, 0x296b,
1323 0xa684, 0x0060, 0x0040, 0x37e8, 0xa086, 0x0060, 0x00c0, 0x37e5,
1324 0xc6ac, 0xc6f4, 0xc6ed, 0x7e5a, 0x6eb6, 0x681c, 0xc0ac, 0x681e,
1325 0xa186, 0x0002, 0x0040, 0x37d7, 0x1078, 0x4586, 0x69ac, 0x68b0,
1326 0xa115, 0x0040, 0x37d7, 0x1078, 0x48f5, 0x0078, 0x37d9, 0x1078,
1327 0x48bd, 0x781b, 0x0079, 0x71d4, 0xd1b4, 0x00c0, 0x29c1, 0x70a4,
1328 0xa086, 0x0001, 0x00c0, 0x2a0b, 0x007c, 0xd6ec, 0x0040, 0x37c2,
1329 0x6818, 0xd0fc, 0x0040, 0x37fb, 0xd6f4, 0x00c0, 0x37f5, 0x681b,
1330 0x0015, 0x781b, 0x0079, 0x0078, 0x29c1, 0x681b, 0x0007, 0x682f,
1331 0x0000, 0x6833, 0x0000, 0x1078, 0x4319, 0x007c, 0xc6fc, 0x7e5a,
1332 0x7adc, 0x79d8, 0x78d0, 0x801b, 0x00c8, 0x3807, 0x8000, 0xa084,
1333 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2,
1334 0x6b94, 0x2200, 0xa303, 0x68ae, 0x781b, 0x0079, 0x007c, 0x1078,
1335 0x296b, 0x2300, 0x0079, 0x381c, 0x3821, 0x3846, 0x38a6, 0x1078,
1336 0x296b, 0x7000, 0x0079, 0x3824, 0x382c, 0x382e, 0x3837, 0x382c,
1337 0x382c, 0x382c, 0x382c, 0x382c, 0x1078, 0x296b, 0x69ac, 0x68b0,
1338 0xa115, 0x0040, 0x3837, 0x1078, 0x48f5, 0x0078, 0x3839, 0x1078,
1339 0x48bd, 0x681c, 0xc0b4, 0x681e, 0x70d4, 0xd0b4, 0x00c0, 0x29c1,
1340 0x70a4, 0xa086, 0x0001, 0x00c0, 0x2a0b, 0x007c, 0xd6fc, 0x00c0,
1341 0x3896, 0x7000, 0xa00d, 0x0079, 0x384d, 0x29c5, 0x385d, 0x3857,
1342 0x388d, 0x385d, 0x3893, 0x3855, 0x3855, 0x1078, 0x296b, 0x6894,
1343 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0xa684, 0x0060, 0x0040,
1344 0x388d, 0xa086, 0x0060, 0x00c0, 0x388a, 0xa6b4, 0xbfbf, 0xc6ed,
1345 0x7e5a, 0x6eb6, 0xa186, 0x0002, 0x0040, 0x3879, 0x1078, 0x4586,
1346 0x69ac, 0x68b0, 0xa115, 0x0040, 0x3879, 0x1078, 0x48f5, 0x0078,
1347 0x387b, 0x1078, 0x48bd, 0x781b, 0x0079, 0x681c, 0xc0b4, 0x681e,
1348 0x71d4, 0xd1b4, 0x00c0, 0x29c1, 0x70a4, 0xa086, 0x0001, 0x00c0,
1349 0x2a0b, 0x007c, 0xd6ec, 0x0040, 0x3867, 0x6818, 0xd0fc, 0x0040,
1350 0x3893, 0x681b, 0x0007, 0x781b, 0x00f9, 0x007c, 0xc6fc, 0x7e5a,
1351 0x7adc, 0x79d8, 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200,
1352 0xa303, 0x68ae, 0x79d2, 0x781b, 0x0079, 0x007c, 0xd6dc, 0x0040,
1353 0x38af, 0x782b, 0x3009, 0x781b, 0x0079, 0x0078, 0x29c1, 0x7884,
1354 0xc0ac, 0x7886, 0x78e4, 0xa084, 0x0008, 0x00c0, 0x38c2, 0xa484,
1355 0x0200, 0x0040, 0x38bc, 0xc6f5, 0xc6dd, 0x7e5a, 0x781b, 0x0079,
1356 0x0078, 0x29c1, 0x6820, 0xc095, 0x6822, 0x1078, 0x4292, 0xc6dd,
1357 0x1078, 0x40c8, 0x781b, 0x0078, 0x0078, 0x29c1, 0x2300, 0x0079,
1358 0x38d1, 0x38d4, 0x38d6, 0x38d8, 0x1078, 0x296b, 0x0078, 0x40c1,
1359 0xd6d4, 0x00c0, 0x3913, 0x79e4, 0xd1ac, 0x0040, 0x38e6, 0x78ec,
1360 0xa084, 0x0003, 0x0040, 0x38e6, 0x782b, 0x3009, 0x789b, 0x0060,
1361 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, 0x79e4, 0xd1ac, 0x0040,
1362 0x38f6, 0x78ec, 0xa084, 0x0003, 0x00c0, 0x390f, 0x2001, 0x4e04,
1363 0x2004, 0xd0e4, 0x00c0, 0x390b, 0x6820, 0xd0c4, 0x0040, 0x390b,
1364 0x0c7e, 0x7058, 0x2060, 0x6004, 0xc09d, 0x6006, 0x6008, 0xa084,
1365 0x00ff, 0x600a, 0x0c7f, 0x2001, 0x0014, 0x0078, 0x33fa, 0xa184,
1366 0x0007, 0x0079, 0x3949, 0x7a90, 0xa294, 0x0007, 0x789b, 0x0060,
1367 0x79a8, 0x81ff, 0x0040, 0x3947, 0x789b, 0x0010, 0x7ba8, 0xa384,
1368 0x0001, 0x00c0, 0x393a, 0x7ba8, 0x7ba8, 0xa386, 0x0001, 0x00c0,
1369 0x392d, 0x2009, 0xfff7, 0x0078, 0x3933, 0xa386, 0x0003, 0x00c0,
1370 0x393a, 0x2009, 0xffef, 0x0c7e, 0x7058, 0x2060, 0x6004, 0xa104,
1371 0x6006, 0x0c7f, 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb,
1372 0x785a, 0x782b, 0x3009, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0078,
1373 0x430d, 0x3090, 0x309a, 0x3953, 0x3959, 0x3951, 0x3951, 0x430d,
1374 0x430d, 0x1078, 0x296b, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0078,
1375 0x4313, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0078, 0x430d, 0x79e4,
1376 0xa184, 0x0030, 0x0040, 0x3969, 0x78ec, 0xa084, 0x0003, 0x00c0,
1377 0x399d, 0x7000, 0xa086, 0x0004, 0x00c0, 0x3983, 0x7064, 0xa086,
1378 0x0002, 0x00c0, 0x3979, 0x2011, 0x0002, 0x2019, 0x0000, 0x0078,
1379 0x2f1c, 0x7064, 0xa086, 0x0006, 0x0040, 0x3973, 0x7064, 0xa086,
1380 0x0004, 0x0040, 0x3973, 0x7000, 0xa086, 0x0000, 0x0040, 0x29c1,
1381 0x6920, 0xa184, 0x0420, 0x0040, 0x3992, 0xc1d4, 0x6922, 0x6818,
1382 0x0078, 0x33fa, 0x6818, 0xa08e, 0x0002, 0x0040, 0x399b, 0xc0fd,
1383 0x681a, 0x2001, 0x0014, 0x0078, 0x33fa, 0xa184, 0x0007, 0x0079,
1384 0x39a1, 0x430d, 0x430d, 0x39a9, 0x430d, 0x4355, 0x4355, 0x430d,
1385 0x430d, 0xd6bc, 0x0040, 0x39eb, 0x7184, 0x81ff, 0x0040, 0x39eb,
1386 0xa182, 0x000d, 0x00d0, 0x39b8, 0x7087, 0x0000, 0x0078, 0x39bd,
1387 0xa182, 0x000c, 0x7086, 0x2009, 0x000c, 0x789b, 0x0061, 0x79aa,
1388 0x157e, 0x137e, 0x147e, 0x7088, 0x8114, 0xa210, 0x728a, 0xa080,
1389 0x000b, 0xad00, 0x2098, 0xb284, 0x0300, 0x0040, 0x39df, 0x007e,
1390 0x2001, 0x4e04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x39db, 0x20a1,
1391 0x012b, 0x0078, 0x39e1, 0x20a1, 0x022b, 0x0078, 0x39e1, 0x20a1,
1392 0x012b, 0x789b, 0x0000, 0x8108, 0x81ac, 0x53a6, 0x147f, 0x137f,
1393 0x157f, 0x0078, 0x4313, 0xd6d4, 0x00c0, 0x3a3f, 0x6820, 0xd084,
1394 0x0040, 0x4313, 0xa68c, 0x0060, 0xa684, 0x0060, 0x0040, 0x39fd,
1395 0xa086, 0x0060, 0x00c0, 0x39fd, 0xc1f5, 0xc194, 0x795a, 0x69b6,
1396 0x789b, 0x0060, 0x78ab, 0x0000, 0x789b, 0x0061, 0x6818, 0xc0fd,
1397 0x681a, 0x78aa, 0x8008, 0x810c, 0x0040, 0x3e06, 0xa18c, 0x00f8,
1398 0x00c0, 0x3e06, 0x157e, 0x137e, 0x147e, 0x017e, 0x3208, 0xa18c,
1399 0x0300, 0x0040, 0x3a2b, 0x007e, 0x2001, 0x4e04, 0x2004, 0xd0ec,
1400 0x007f, 0x0040, 0x3a27, 0x20a1, 0x012b, 0x0078, 0x3a2d, 0x20a1,
1401 0x022b, 0x0078, 0x3a2d, 0x20a1, 0x012b, 0x017f, 0x789b, 0x0000,
1402 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f,
1403 0x157f, 0x6814, 0xc0fc, 0x8007, 0x7882, 0x0078, 0x4313, 0x6818,
1404 0xd0fc, 0x0040, 0x3a45, 0x681b, 0x0008, 0x6820, 0xc0ad, 0x6822,
1405 0x1078, 0x40d0, 0x781b, 0x00ea, 0x007c, 0x2300, 0x0079, 0x3a50,
1406 0x3a55, 0x3b2d, 0x3a53, 0x1078, 0x296b, 0x7cd8, 0x7ddc, 0x7fd0,
1407 0x82ff, 0x00c0, 0x3a7e, 0x7200, 0xa286, 0x0003, 0x0040, 0x33c7,
1408 0x71d4, 0xd1bc, 0x00c0, 0x3a81, 0xd1b4, 0x0040, 0x3a81, 0x0d7e,
1409 0x783b, 0x8800, 0x781b, 0x004c, 0x70bc, 0xa06d, 0x68b4, 0xc0a5,
1410 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0xc1b4,
1411 0x71d6, 0x7003, 0x0030, 0x0d7f, 0x0078, 0x3a85, 0x7200, 0x0078,
1412 0x3a85, 0x783b, 0x1800, 0x781b, 0x004a, 0xa284, 0x000f, 0x0079,
1413 0x3a89, 0x3b18, 0x3ac7, 0x3a93, 0x33f6, 0x3a91, 0x3b18, 0x3a91,
1414 0x3a91, 0x1078, 0x296b, 0x681c, 0xd0ec, 0x0040, 0x3a9a, 0x6008,
1415 0xc08d, 0x600a, 0x6920, 0xc185, 0x6922, 0x6800, 0x6006, 0xa005,
1416 0x00c0, 0x3aa3, 0x6002, 0x6008, 0xc0d4, 0x600a, 0x681c, 0xa084,
1417 0x000e, 0x00c0, 0x3ab7, 0xb284, 0x0300, 0x0040, 0x3ab3, 0x2009,
1418 0x94c0, 0x0078, 0x3abc, 0x2009, 0x95d0, 0x0078, 0x3abc, 0x7030,
1419 0x68ba, 0x7140, 0x70cc, 0xa108, 0x2104, 0x6802, 0x2d0a, 0x715e,
1420 0xd6dc, 0x00c0, 0x3ac7, 0xc6fc, 0x6eb6, 0x0078, 0x3b18, 0x6eb6,
1421 0xa684, 0x0060, 0x00c0, 0x3ad1, 0xa684, 0x7fff, 0x68b6, 0x0078,
1422 0x3b18, 0xd6dc, 0x00c0, 0x3adf, 0xa684, 0x7fff, 0x68b6, 0x6894,
1423 0x68a6, 0x6898, 0x68aa, 0x1078, 0x4586, 0x0078, 0x3b18, 0xd6ac,
1424 0x0040, 0x3aeb, 0xa006, 0x1078, 0x4586, 0x2408, 0x2510, 0x69aa,
1425 0x6aa6, 0x0078, 0x3afb, 0x2408, 0x2510, 0x2700, 0x801b, 0x00c8,
1426 0x3af2, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x69aa,
1427 0x6aa6, 0x1078, 0x4586, 0xd6fc, 0x0040, 0x3b18, 0xa684, 0x7fff,
1428 0x68b6, 0x2510, 0x2408, 0xd6ac, 0x00c0, 0x3b10, 0x2700, 0x801b,
1429 0x00c8, 0x3b0b, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000,
1430 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 1156 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae,
1431 0x7000, 0xa086, 0x0030, 0x00c0, 0x29c5, 0x7003, 0x0002, 0x70bc, 1157 0xd6f4, 0x0040, 0x328e, 0xc6f4, 0x7e5a, 0x6eb6, 0x7000, 0xa086,
1432 0xa06d, 0x68bc, 0x7042, 0x70b8, 0xa065, 0x68c0, 0x705a, 0x2d00, 1158 0x0003, 0x00c0, 0x329c, 0x007e, 0x1078, 0x45d6, 0x1078, 0x493f,
1433 0x704e, 0xad80, 0x0009, 0x7046, 0x007c, 0xa586, 0x8800, 0x00c0, 1159 0x007f, 0x781b, 0x0076, 0x007c, 0xa006, 0x1078, 0x4a44, 0x6ab0,
1434 0x3b3a, 0x7003, 0x0000, 0x6018, 0x8001, 0x601a, 0x6008, 0xa084, 1160 0x69ac, 0x6c98, 0x6b94, 0x2200, 0xa105, 0x0040, 0x32ab, 0x2200,
1435 0xfbef, 0x600a, 0x0078, 0x40c1, 0x7047, 0x0000, 0xa282, 0x0006, 1161 0xa422, 0x2100, 0xa31b, 0x6caa, 0x7cd2, 0x7cda, 0x6ba6, 0x7bd6,
1436 0x0050, 0x3b44, 0x1078, 0x296b, 0x2300, 0x0079, 0x3b47, 0x3b4a, 1162 0x7bde, 0x2300, 0xa405, 0x00c0, 0x32bb, 0xc6f5, 0x7e5a, 0x6eb6,
1437 0x3b5c, 0x3b68, 0x2200, 0x0079, 0x3b4d, 0x3b53, 0x40c1, 0x3b55, 1163 0x781b, 0x0076, 0x007c, 0x781b, 0x0076, 0x2200, 0xa115, 0x00c0,
1438 0x3b53, 0x3ba2, 0x3bf7, 0x1078, 0x296b, 0x7a80, 0xa294, 0x0f00, 1164 0x32c4, 0x1078, 0x493f, 0x007c, 0x1078, 0x4977, 0x007c, 0x781b,
1439 0x1078, 0x3c81, 0x0078, 0x40b7, 0x1078, 0x3b79, 0x0079, 0x3b60, 1165 0x0079, 0x007c, 0x781b, 0x0067, 0x007c, 0x1078, 0x29b2, 0x0078,
1440 0x40c1, 0x3b66, 0x3b66, 0x3ba2, 0x3b66, 0x40c1, 0x1078, 0x296b, 1166 0x331b, 0x6920, 0xd1c4, 0x0040, 0x32e4, 0xc1c4, 0x6922, 0x0c7e,
1441 0x1078, 0x3b79, 0x0079, 0x3b6c, 0x3b74, 0x3b72, 0x3b72, 0x3b74, 1167 0x7058, 0x2060, 0x6000, 0xc0e4, 0x6002, 0x6004, 0xa084, 0xfff5,
1442 0x3b72, 0x3b74, 0x1078, 0x296b, 0x1078, 0x40db, 0x781b, 0x0078, 1168 0x6006, 0x0c7f, 0x0078, 0x330f, 0xd1cc, 0x0040, 0x330f, 0xc1cc,
1443 0x007c, 0x7000, 0xa086, 0x0002, 0x00c0, 0x3b8a, 0x1078, 0x3ded, 1169 0x6922, 0x0c7e, 0x7058, 0x2060, 0x6000, 0xc0ec, 0x6002, 0x6004,
1444 0x0078, 0x3b84, 0x1078, 0x4586, 0x6008, 0xa084, 0xfbef, 0x600a, 1170 0xc0a4, 0x6006, 0x2008, 0x2c48, 0x0c7f, 0xd19c, 0x0040, 0x330f,
1445 0x0078, 0x3b8f, 0x7000, 0xa086, 0x0003, 0x0040, 0x3b82, 0x7003, 1171 0x1078, 0x424a, 0x1078, 0x3f3e, 0x88ff, 0x0040, 0x330f, 0x789b,
1446 0x0005, 0xb284, 0x0300, 0x0040, 0x3b99, 0x2001, 0x95e0, 0x0078, 1172 0x0060, 0x2800, 0x78aa, 0x7e58, 0xc695, 0x7e5a, 0xd6d4, 0x00c0,
1447 0x3b9b, 0x2001, 0x9612, 0x2068, 0x704e, 0xad80, 0x0009, 0x7046, 1173 0x330c, 0x781b, 0x0064, 0x007c, 0x781b, 0x0078, 0x007c, 0x7e58,
1448 0x2200, 0x007c, 0x7000, 0xa086, 0x0002, 0x00c0, 0x3bb4, 0x70d4, 1174 0xd6d4, 0x00c0, 0x3316, 0x781b, 0x0067, 0x007c, 0x781b, 0x0079,
1449 0xc0b5, 0x70d6, 0x2c00, 0x70ba, 0x2d00, 0x70be, 0x0078, 0x3bb9, 1175 0x007c, 0x0078, 0x410c, 0x2019, 0x0000, 0x7990, 0xa18c, 0x0007,
1450 0x1078, 0x4586, 0x0078, 0x3bb9, 0x7000, 0xa086, 0x0003, 0x0040, 1176 0x00c0, 0x3329, 0x6820, 0xa084, 0x0100, 0x0040, 0x3319, 0x2009,
1451 0x3bb0, 0x7003, 0x0001, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 1177 0x0008, 0x789b, 0x0010, 0x78a8, 0xa094, 0x00ff, 0xa286, 0x0001,
1452 0x7ca8, 0xa484, 0x001f, 0xa215, 0x2069, 0x94c0, 0xb284, 0x0300, 1178 0x00c0, 0x3345, 0x2300, 0x7ca8, 0xa400, 0x2018, 0xa102, 0x0040,
1453 0x00c0, 0x3bcd, 0xc2fd, 0x2069, 0x95d0, 0x2d04, 0x2d08, 0x715e, 1179 0x333d, 0x0048, 0x333d, 0x0078, 0x333f, 0x0078, 0x32d1, 0x24a8,
1454 0xa06d, 0x0040, 0x3bda, 0x6814, 0xa206, 0x0040, 0x3bdc, 0x6800, 1180 0x7aa8, 0x00f0, 0x333f, 0x0078, 0x332b, 0xa284, 0x00f0, 0xa086,
1455 0x0078, 0x3bce, 0x1078, 0x3c81, 0x6eb4, 0x7e5a, 0x6920, 0xa184, 1181 0x0020, 0x00c0, 0x3399, 0x8318, 0x8318, 0x2300, 0xa102, 0x0040,
1456 0x0c00, 0x0040, 0x3cab, 0x7064, 0xa086, 0x0006, 0x00c0, 0x3bee, 1182 0x3355, 0x0048, 0x3355, 0x0078, 0x3396, 0xa286, 0x0023, 0x0040,
1457 0x7074, 0xa206, 0x00c0, 0x3bee, 0x7066, 0x707e, 0x681b, 0x0005, 1183 0x3319, 0x681c, 0xa084, 0xfff1, 0x681e, 0x7e58, 0xa684, 0xfff1,
1458 0xc1ad, 0xc1d4, 0x6922, 0x1078, 0x40d0, 0x0078, 0x3cab, 0x7200, 1184 0xc0a5, 0x2030, 0x7e5a, 0x6008, 0xc0a5, 0x600a, 0x0c7e, 0x7058,
1459 0xa286, 0x0002, 0x00c0, 0x3c09, 0x70d4, 0xc0b5, 0x70d6, 0x2c00, 1185 0x2060, 0x6004, 0x2008, 0x2c48, 0x0c7f, 0xd1a4, 0x0040, 0x3376,
1460 0x70ba, 0x2d00, 0x70be, 0x0078, 0x3c0d, 0x1078, 0x4586, 0x0078, 1186 0x1078, 0x424a, 0x1078, 0x405e, 0x0078, 0x3384, 0x0c7e, 0x7058,
1461 0x3c0d, 0xa286, 0x0003, 0x0040, 0x3c05, 0x7003, 0x0001, 0x7a80, 1187 0x2060, 0x6004, 0x2008, 0x2c48, 0x0c7f, 0xd19c, 0x0040, 0x330f,
1462 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, 0x001f, 0xa215, 1188 0x1078, 0x424a, 0x1078, 0x3f3e, 0x88ff, 0x0040, 0x330f, 0x789b,
1463 0xb284, 0x0300, 0x00c0, 0x3c1d, 0xc2fd, 0x79a8, 0x79a8, 0xa18c, 1189 0x0060, 0x2800, 0x78aa, 0xc695, 0x7e5a, 0xd6d4, 0x00c0, 0x3393,
1464 0x00ff, 0x2118, 0x70cc, 0xa168, 0x2d04, 0x2d08, 0x715e, 0xa06d, 1190 0x781b, 0x0064, 0x007c, 0x781b, 0x0078, 0x007c, 0x7aa8, 0x0078,
1465 0x0040, 0x3c31, 0x6814, 0xa206, 0x0040, 0x3c5a, 0x6800, 0x0078, 1191 0x332b, 0x8318, 0x2300, 0xa102, 0x0040, 0x33a2, 0x0048, 0x33a2,
1466 0x3c25, 0x7003, 0x0005, 0xb284, 0x0300, 0x0040, 0x3c3b, 0x2001, 1192 0x0078, 0x332b, 0xa284, 0x0080, 0x00c0, 0x4111, 0x0078, 0x410c,
1467 0x95e0, 0x0078, 0x3c3d, 0x2001, 0x9612, 0x2068, 0x704e, 0x157e, 1193 0x0078, 0x4111, 0x0078, 0x4107, 0x7058, 0xa04d, 0x789b, 0x0018,
1468 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, 0x00f0, 0x3c42, 0x157f, 1194 0x78a8, 0xa084, 0x00ff, 0xa08e, 0x0001, 0x0040, 0x33b9, 0x1078,
1469 0xb284, 0x0300, 0x0040, 0x3c4f, 0xc2fc, 0x0078, 0x3c50, 0xc2fd, 1195 0x29b2, 0x7aa8, 0xa294, 0x00ff, 0x78a8, 0xa084, 0x00ff, 0xa08a,
1470 0x6a16, 0xad80, 0x0009, 0x7046, 0x68b7, 0x0700, 0x6823, 0x0800, 1196 0x0004, 0x00c8, 0x4107, 0x0079, 0x33c5, 0x4107, 0x3e8f, 0x4107,
1471 0x6827, 0x0003, 0x6eb4, 0x6920, 0xa184, 0x0c00, 0x0040, 0x3cab, 1197 0x4006, 0xa282, 0x0000, 0x00c0, 0x33cf, 0x1078, 0x29b2, 0x1078,
1472 0xd0dc, 0x0040, 0x3c76, 0x7064, 0xa086, 0x0004, 0x00c0, 0x3c72, 1198 0x4118, 0x781b, 0x0078, 0x007c, 0xa282, 0x0003, 0x00c0, 0x33da,
1473 0x7074, 0xa206, 0x00c0, 0x3c72, 0x7078, 0xa306, 0x00c0, 0x3c72, 1199 0x1078, 0x29b2, 0xd4fc, 0x00c0, 0x33fa, 0x7064, 0xa005, 0x0040,
1474 0x7066, 0x707e, 0x1078, 0x40d7, 0x0078, 0x3cab, 0x681b, 0x0005, 1200 0x33e3, 0x1078, 0x29b2, 0x6f14, 0x7776, 0xa7bc, 0x8f00, 0x1078,
1475 0xc1ad, 0xc1d4, 0x6922, 0x1078, 0x40d0, 0x707f, 0x0000, 0x0078, 1201 0x424e, 0x6008, 0xa085, 0x0021, 0x600a, 0x8738, 0xa784, 0x001f,
1476 0x3cab, 0x7003, 0x0005, 0xb284, 0x0300, 0x0040, 0x3c8b, 0x2001, 1202 0x00c0, 0x33e7, 0x1078, 0x411c, 0x7067, 0x0002, 0x701f, 0x0009,
1477 0x95e0, 0x0078, 0x3c8d, 0x2001, 0x9612, 0x2068, 0x704e, 0x157e, 1203 0x0078, 0x33fc, 0x1078, 0x412b, 0x781b, 0x0078, 0x007c, 0xa282,
1478 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, 0x00f0, 0x3c92, 0x157f, 1204 0x0004, 0x0050, 0x3405, 0x1078, 0x29b2, 0x2300, 0x0079, 0x3408,
1479 0xb284, 0x0300, 0x0040, 0x3c9f, 0xc2fc, 0x0078, 0x3ca0, 0xc2fd, 1205 0x340b, 0x35cb, 0x360e, 0xa286, 0x0003, 0x0040, 0x3443, 0x7200,
1480 0x6a16, 0xad80, 0x0009, 0x7046, 0x68b7, 0x0700, 0x6823, 0x0800, 1206 0x7cd8, 0x7ddc, 0x7fd0, 0x71d4, 0xd1bc, 0x00c0, 0x343b, 0xd1b4,
1481 0x6827, 0x0003, 0x007c, 0xc6ec, 0xa6ac, 0x0060, 0x0040, 0x3cfd, 1207 0x0040, 0x343b, 0x7868, 0xa084, 0x00ff, 0x00c0, 0x343b, 0xa282,
1482 0x6b98, 0x6c94, 0x69ac, 0x68b0, 0xa105, 0x00c0, 0x3cd8, 0x7bd2, 1208 0x0002, 0x00c8, 0x343b, 0x0d7e, 0x783b, 0x8300, 0x781b, 0x004c,
1483 0x7bda, 0x7cd6, 0x7cde, 0xa586, 0x0060, 0x0040, 0x3d02, 0xd6f4, 1209 0x70bc, 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898,
1484 0x00c0, 0x3cc3, 0xc6ed, 0xa6b4, 0xb7ff, 0x7e5a, 0x2009, 0x0079, 1210 0x78d2, 0x78da, 0xc1b4, 0x71d6, 0x7003, 0x0030, 0x0d7f, 0x2001,
1485 0xd69c, 0x0040, 0x3cd0, 0x2009, 0x0078, 0x2019, 0x0000, 0x2320, 1211 0x0000, 0x0078, 0x3447, 0x783b, 0x1300, 0x781b, 0x004a, 0x2001,
1486 0x791a, 0xd6ec, 0x0040, 0x3d0d, 0x1078, 0x48bd, 0x0078, 0x3d0d, 1212 0x0000, 0x0078, 0x3447, 0x7200, 0x7cd8, 0x7ddc, 0x7fd0, 0x704a,
1487 0x68b0, 0xa31a, 0x2100, 0xa423, 0x2400, 0xa305, 0x0040, 0x3d04, 1213 0x68a0, 0xd0ec, 0x0040, 0x344f, 0x6008, 0xc08d, 0x600a, 0xa284,
1488 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0x68b0, 0xd6f4, 0x00c0, 0x3ce9, 1214 0x000f, 0x0079, 0x3453, 0x35ab, 0x3460, 0x345d, 0x3711, 0x379d,
1489 0xc6ed, 0xc6f4, 0x7e5a, 0x2011, 0x0079, 0xd69c, 0x0040, 0x3cf5, 1215 0x2a0c, 0x345b, 0x345b, 0x1078, 0x29b2, 0x6008, 0xc0d4, 0x600a,
1490 0x2011, 0x0078, 0x2019, 0x0000, 0x2320, 0x7a1a, 0xd6ec, 0x0040, 1216 0xd6e4, 0x0040, 0x3468, 0x7048, 0xa086, 0x0014, 0x00c0, 0x3488,
1491 0x3d0d, 0x1078, 0x48f5, 0x0078, 0x3d0d, 0x2019, 0x0000, 0x2320, 1217 0x1078, 0x45d6, 0x2009, 0x0000, 0x6818, 0xd0fc, 0x0040, 0x3471,
1492 0x0078, 0x3d04, 0xa6b4, 0xb7ff, 0x7e5a, 0x2009, 0x0079, 0xd69c, 1218 0x7048, 0xa086, 0x0014, 0x0040, 0x3482, 0x6818, 0xa086, 0x0008,
1493 0x0040, 0x3d0c, 0x2009, 0x0078, 0x791a, 0x68c0, 0x705a, 0x2d00, 1219 0x00c0, 0x3563, 0x7858, 0xd09c, 0x0040, 0x3563, 0x6820, 0xd0ac,
1494 0x704e, 0x68c4, 0x2060, 0x71d4, 0x2001, 0x4e01, 0x2004, 0xd0c4, 1220 0x0040, 0x3563, 0x681b, 0x0014, 0x2009, 0x0002, 0x0078, 0x34c7,
1495 0x00c0, 0x3d62, 0x70d8, 0xa02d, 0x0040, 0x3d3b, 0xd1bc, 0x0040, 1221 0x7868, 0xa08c, 0x00ff, 0x0040, 0x34c7, 0xa186, 0x0008, 0x00c0,
1496 0x3d55, 0x7a80, 0xa294, 0x0f00, 0x70dc, 0xa206, 0x0040, 0x3d2c, 1222 0x349e, 0x6008, 0xc0a4, 0x600a, 0x1078, 0x3db8, 0x0040, 0x34c7,
1497 0x78e0, 0xa504, 0x00c0, 0x3d62, 0x70da, 0xc1bc, 0x71d6, 0x0078, 1223 0x1078, 0x3e36, 0x1078, 0x45d6, 0x0078, 0x34af, 0xa186, 0x0028,
1498 0x3d62, 0x2031, 0x0001, 0x852c, 0x0048, 0x3d3a, 0x8633, 0x8210, 1224 0x00c0, 0x34c7, 0x6018, 0xa005, 0x0040, 0x3491, 0x8001, 0x0040,
1499 0x0078, 0x3d33, 0x007c, 0x7de0, 0xa594, 0xff00, 0x0040, 0x3d48, 1225 0x3491, 0x8001, 0x0040, 0x3491, 0x601e, 0x0078, 0x3491, 0x6820,
1500 0x2011, 0x0008, 0x852f, 0x1078, 0x3d31, 0x8637, 0x0078, 0x3d4a, 1226 0xd084, 0x0040, 0x2a0c, 0xc084, 0x6822, 0x1078, 0x2b13, 0x705c,
1501 0x1078, 0x3d31, 0x8217, 0x7880, 0xa084, 0x0f00, 0xa206, 0x0040, 1227 0x0c7e, 0x2060, 0x6800, 0x6002, 0x0c7f, 0x6004, 0x6802, 0xa005,
1502 0x3d62, 0x72de, 0x76da, 0x0078, 0x3d62, 0x7a80, 0xa294, 0x0f00, 1228 0x2d00, 0x00c0, 0x34c4, 0x6002, 0x6006, 0x0078, 0x2a0c, 0x017e,
1503 0x70dc, 0xa236, 0x0040, 0x3d52, 0x78e0, 0xa534, 0x0040, 0x3d52, 1229 0x81ff, 0x00c0, 0x3511, 0x7000, 0xa086, 0x0030, 0x0040, 0x3511,
1504 0xc1bd, 0x71d6, 0xd1b4, 0x00c0, 0x29c1, 0x2300, 0xa405, 0x0040, 1230 0x71d4, 0xd1bc, 0x00c0, 0x3511, 0xd1b4, 0x00c0, 0x34f8, 0x7060,
1505 0x29c1, 0x70a4, 0xa086, 0x0001, 0x00c0, 0x2a0b, 0x007c, 0x6020, 1231 0xa005, 0x00c0, 0x3511, 0x70a4, 0xa086, 0x0001, 0x0040, 0x3511,
1506 0xa005, 0x0040, 0x3d7d, 0x8001, 0x6022, 0x6008, 0xa085, 0x0008, 1232 0x7003, 0x0000, 0x047e, 0x057e, 0x077e, 0x067e, 0x0c7e, 0x0d7e,
1507 0x600a, 0x700f, 0x0100, 0x702c, 0x6026, 0x007c, 0xa006, 0x1078, 1233 0x1078, 0x2a35, 0x0d7f, 0x0c7f, 0x067f, 0x077f, 0x057f, 0x047f,
1508 0x4586, 0x7000, 0xa086, 0x0002, 0x0040, 0x3d8b, 0x7064, 0xa086, 1234 0x71d4, 0xd1b4, 0x00c0, 0x3511, 0x7003, 0x0040, 0x0078, 0x3511,
1509 0x0005, 0x00c0, 0x3d95, 0x682b, 0x0000, 0x6817, 0x0000, 0x681b, 1235 0x1078, 0x43b0, 0x00c0, 0x3511, 0x781b, 0x005b, 0x0d7e, 0x70bc,
1510 0x0001, 0x6823, 0x0040, 0x681f, 0x0100, 0x7000, 0xa084, 0x000f, 1236 0xa06d, 0x68b4, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2,
1511 0x0079, 0x3d9a, 0x29c5, 0x3daa, 0x3da4, 0x3dcc, 0x3db4, 0x29c5, 1237 0x78da, 0xc1b4, 0x71d6, 0x7003, 0x0030, 0x7808, 0xc08d, 0x780a,
1512 0x3da2, 0x3da2, 0x1078, 0x296b, 0x1078, 0x3dd7, 0x1078, 0x3dd0, 1238 0x0d7f, 0x1078, 0x3648, 0x017f, 0x81ff, 0x0040, 0x3563, 0xa684,
1513 0x0078, 0x3db0, 0x1078, 0x3dd7, 0x705c, 0x2060, 0x6800, 0x6002, 1239 0xdf00, 0x681e, 0x682b, 0x0000, 0x6f14, 0xa186, 0x0002, 0x00c0,
1514 0x1078, 0x202c, 0x0078, 0x29c5, 0x7064, 0x7067, 0x0000, 0x7083, 1240 0x3564, 0x6818, 0xa086, 0x0014, 0x00c0, 0x352d, 0x2008, 0xd6e4,
1515 0x0000, 0x0079, 0x3dbb, 0x3dc8, 0x3dc8, 0x3dc3, 0x3dc3, 0x3dc3, 1241 0x0040, 0x352d, 0x7868, 0xa08c, 0x00ff, 0x1078, 0x2b01, 0x1078,
1516 0x3dc8, 0x3dc3, 0x3dc8, 0x77d4, 0xc7dd, 0x77d6, 0x0079, 0x2f35, 1242 0x2b22, 0x6820, 0xd0dc, 0x00c0, 0x3564, 0x8717, 0xa294, 0x000f,
1517 0x7067, 0x0000, 0x0078, 0x29c5, 0x681b, 0x0000, 0x0078, 0x36c8, 1243 0x8213, 0x8213, 0x8213, 0xb284, 0x0300, 0x0040, 0x3543, 0xa290,
1518 0x6800, 0xa005, 0x00c0, 0x3dd5, 0x6002, 0x6006, 0x007c, 0x6410, 1244 0x53c0, 0x0078, 0x3545, 0xa290, 0x5440, 0xa290, 0x0000, 0x221c,
1519 0x84ff, 0x0040, 0x3de9, 0x2009, 0x4e02, 0x2104, 0x8001, 0x200a, 1245 0xd3c4, 0x00c0, 0x354d, 0x0078, 0x3553, 0x8210, 0x2204, 0xa085,
1520 0x8421, 0x6412, 0x00c0, 0x3de9, 0x2021, 0x4e04, 0x2404, 0xc0a5, 1246 0x0018, 0x2012, 0x8211, 0xd3d4, 0x0040, 0x355e, 0x68a0, 0xd0c4,
1521 0x2022, 0x6008, 0xc0a4, 0x600a, 0x007c, 0x6018, 0xa005, 0x0040, 1247 0x00c0, 0x355e, 0x1078, 0x36c2, 0x0078, 0x2a0c, 0x6008, 0xc08d,
1522 0x3df3, 0x8001, 0x601a, 0x007c, 0x1078, 0x4383, 0x681b, 0x0018, 1248 0x600a, 0x0078, 0x3564, 0x692a, 0x6916, 0x6818, 0xd0fc, 0x0040,
1523 0x0078, 0x3e34, 0x1078, 0x4383, 0x681b, 0x0019, 0x0078, 0x3e34, 1249 0x356b, 0x7048, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x6410, 0x84ff,
1524 0x1078, 0x4383, 0x681b, 0x001a, 0x0078, 0x3e34, 0x1078, 0x4383, 1250 0x0040, 0x3580, 0x2009, 0x4f02, 0x2104, 0x8001, 0x200a, 0x8421,
1525 0x681b, 0x0003, 0x0078, 0x3e34, 0x7774, 0x1078, 0x41fe, 0x7178, 1251 0x6412, 0x00c0, 0x3580, 0x2021, 0x4f04, 0x2404, 0xc0a5, 0x2022,
1526 0xa18c, 0x00ff, 0x3210, 0xa294, 0x0300, 0x0040, 0x3e1b, 0xa1e8, 1252 0x6018, 0xa005, 0x0040, 0x3588, 0x8001, 0x601a, 0x00c0, 0x358b,
1527 0x93c0, 0x0078, 0x3e1d, 0xa1e8, 0x94d0, 0x2d04, 0x2d08, 0x2068, 1253 0x6008, 0xc0a4, 0x600a, 0x6820, 0xd084, 0x00c0, 0x3597, 0x6800,
1528 0xa005, 0x00c0, 0x3e26, 0x707e, 0x0078, 0x29c5, 0x6814, 0x7274, 1254 0xa005, 0x00c0, 0x3594, 0x6002, 0x6006, 0x0078, 0x359b, 0x705c,
1529 0xa206, 0x0040, 0x3e2e, 0x6800, 0x0078, 0x3e1e, 0x6800, 0x200a, 1255 0x2060, 0x6800, 0x6002, 0x2061, 0x4f00, 0x6887, 0x0103, 0x2d08,
1530 0x681b, 0x0005, 0x707f, 0x0000, 0x1078, 0x3dd7, 0x6820, 0xd084, 1256 0x206b, 0x0000, 0x6068, 0xa005, 0x616a, 0x0040, 0x35aa, 0x2d02,
1531 0x00c0, 0x3e3c, 0x1078, 0x3dd0, 0x1078, 0x3ded, 0x681f, 0x0000, 1257 0x0078, 0x35ab, 0x616e, 0x7200, 0xa286, 0x0030, 0x0040, 0x35bb,
1532 0x6823, 0x0020, 0x1078, 0x202c, 0x0078, 0x29c5, 0xa282, 0x0003, 1258 0xa286, 0x0040, 0x00c0, 0x2a0c, 0x7003, 0x0002, 0x704c, 0x2068,
1533 0x00c0, 0x40b7, 0x7da8, 0xa5ac, 0x00ff, 0x7e5a, 0x7ea8, 0xa6b4, 1259 0x68c4, 0x2060, 0x007c, 0x7003, 0x0002, 0x70bc, 0xa06d, 0x68bc,
1534 0x00ff, 0x6920, 0xc1bd, 0x6922, 0xd1c4, 0x0040, 0x3ea1, 0xc1c4, 1260 0x7042, 0x70b8, 0xa065, 0x68c0, 0x705a, 0x2d00, 0x704e, 0xad80,
1535 0x6922, 0xa6b4, 0x00ff, 0x0040, 0x3e8e, 0xa682, 0x000c, 0x0048, 1261 0x0009, 0x7046, 0x007c, 0xa282, 0x0004, 0x0048, 0x35d1, 0x1078,
1536 0x3e65, 0x0040, 0x3e65, 0x2031, 0x000c, 0x2500, 0xa086, 0x000a, 1262 0x29b2, 0x2200, 0x0079, 0x35d4, 0x35d8, 0x35e9, 0x35f6, 0x35e9,
1537 0x0040, 0x3e6c, 0x852b, 0x852b, 0x1078, 0x4190, 0x0040, 0x3e74, 1263 0xa586, 0x1300, 0x0040, 0x35e9, 0xa586, 0x8300, 0x00c0, 0x35cf,
1538 0x1078, 0x3f6f, 0x0078, 0x3e97, 0x1078, 0x414b, 0x0c7e, 0x2960, 1264 0x7003, 0x0000, 0x6018, 0x8001, 0x601a, 0x6008, 0xa084, 0xfbef,
1539 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078, 0x3fa5, 0x0c7f, 0x6920, 1265 0x600a, 0x7000, 0xa086, 0x0005, 0x0040, 0x35f3, 0x1078, 0x4118,
1540 0xc1c5, 0x6922, 0x7e58, 0xc695, 0x7e5a, 0xd6d4, 0x00c0, 0x3e8b, 1266 0x781b, 0x0078, 0x007c, 0x781b, 0x0079, 0x007c, 0x7890, 0x8007,
1541 0x781b, 0x0064, 0x007c, 0x781b, 0x0078, 0x007c, 0x0c7e, 0x2960, 1267 0x8001, 0xa084, 0x0007, 0xa080, 0x0018, 0x789a, 0x79a8, 0xa18c,
1542 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078, 0x3fa5, 0x0c7f, 0x7e58, 1268 0x00ff, 0xa186, 0x0003, 0x0040, 0x360b, 0xa186, 0x0000, 0x0040,
1543 0xd6d4, 0x00c0, 0x3e9e, 0x781b, 0x0067, 0x007c, 0x781b, 0x0079, 1269 0x360b, 0x0078, 0x4107, 0x781b, 0x0079, 0x007c, 0x6820, 0xc095,
1544 0x007c, 0x0c7e, 0x7058, 0x2060, 0x6100, 0xd1e4, 0x0040, 0x3eea, 1270 0x6822, 0x82ff, 0x00c0, 0x3618, 0x1078, 0x4118, 0x0078, 0x361f,
1545 0x6208, 0x8217, 0xa294, 0x00ff, 0xa282, 0x000c, 0x0048, 0x3eb4, 1271 0x8211, 0x0040, 0x361d, 0x1078, 0x29b2, 0x1078, 0x412b, 0x781b,
1546 0x0040, 0x3eb4, 0x2011, 0x000c, 0x2600, 0xa202, 0x00c8, 0x3eb9, 1272 0x0078, 0x007c, 0x1078, 0x43d3, 0x7830, 0xa084, 0x00c0, 0x00c0,
1547 0x2230, 0x6208, 0xa294, 0x00ff, 0x2001, 0x4e05, 0x2004, 0xd0e4, 1273 0x3645, 0x017e, 0x3208, 0x007e, 0x2001, 0x4f04, 0x2004, 0xd0ec,
1548 0x00c0, 0x3ece, 0x78ec, 0xd0e4, 0x0040, 0x3ece, 0xa282, 0x000a, 1274 0x007f, 0x0040, 0x3637, 0xa18c, 0x0300, 0x0078, 0x3639, 0xa18c,
1549 0x00c8, 0x3ed4, 0x2011, 0x000a, 0x0078, 0x3ed4, 0xa282, 0x000c, 1275 0x0400, 0x017f, 0x0040, 0x3640, 0x0018, 0x3645, 0x0078, 0x3642,
1550 0x00c8, 0x3ed4, 0x2011, 0x000c, 0x2200, 0xa502, 0x00c8, 0x3ed9, 1276 0x0028, 0x3645, 0x791a, 0xa006, 0x007c, 0xa085, 0x0001, 0x007c,
1551 0x2228, 0x1078, 0x414f, 0x2500, 0xa086, 0x000a, 0x0040, 0x3ee2, 1277 0xa684, 0x0060, 0x00c0, 0x3652, 0x682f, 0x0000, 0x6833, 0x0000,
1552 0x852b, 0x852b, 0x1078, 0x4190, 0x0040, 0x3eea, 0x1078, 0x3f6f, 1278 0x0078, 0x36c1, 0xd6dc, 0x00c0, 0x366a, 0x68b4, 0xd0dc, 0x00c0,
1553 0x0078, 0x3eee, 0x1078, 0x414b, 0x1078, 0x3fa5, 0x7858, 0xc095, 1279 0x366a, 0x6998, 0x6a94, 0x692e, 0x6a32, 0x7048, 0xa005, 0x00c0,
1554 0x785a, 0x0c7f, 0x781b, 0x0078, 0x007c, 0x0c7e, 0x2960, 0x6000, 1280 0x3667, 0x2200, 0xa105, 0x0040, 0x45d6, 0x704b, 0x0015, 0x0078,
1555 0xd0e4, 0x00c0, 0x3f0b, 0xa084, 0x0040, 0x00c0, 0x3f05, 0x6104, 1281 0x45d6, 0x007c, 0xd6ac, 0x0040, 0x3690, 0xd6f4, 0x0040, 0x3676,
1556 0xa18c, 0xfff5, 0x6106, 0x0c7f, 0x007c, 0x2011, 0x0032, 0x2019, 1282 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x45d6, 0x68b4, 0xa084,
1557 0x0000, 0x0078, 0x3f36, 0x68a0, 0xd0cc, 0x00c0, 0x3f05, 0x6208, 1283 0x4000, 0xa635, 0xd6f4, 0x00c0, 0x3670, 0x7048, 0xa005, 0x00c0,
1558 0xa294, 0x00ff, 0x2001, 0x4e05, 0x2004, 0xd0e4, 0x00c0, 0x3f24, 1284 0x3683, 0x704b, 0x0015, 0xd6dc, 0x00c0, 0x368c, 0x68b4, 0xd0dc,
1559 0x78ec, 0xd0e4, 0x0040, 0x3f24, 0xa282, 0x000b, 0x00c8, 0x3f24, 1285 0x0040, 0x368c, 0x6ca8, 0x6da4, 0x6c2e, 0x6d32, 0x0078, 0x45d6,
1560 0x2011, 0x000a, 0x0078, 0x3f2a, 0xa282, 0x000c, 0x00c8, 0x3f2a, 1286 0xd6f4, 0x0040, 0x3699, 0x682f, 0x0000, 0x6833, 0x0000, 0x0078,
1561 0x2011, 0x000c, 0x6308, 0x831f, 0xa39c, 0x00ff, 0xa382, 0x000c, 1287 0x45d6, 0x68b4, 0xa084, 0x4800, 0xa635, 0xd6f4, 0x00c0, 0x3693,
1562 0x0048, 0x3f36, 0x0040, 0x3f36, 0x2019, 0x000c, 0x78ab, 0x0001, 1288 0x7048, 0xa005, 0x00c0, 0x36a6, 0x704b, 0x0015, 0x2408, 0x2510,
1563 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005, 1289 0x2700, 0x80fb, 0x00c8, 0x36ad, 0x8000, 0xa084, 0x003f, 0xa108,
1564 0x6820, 0xc0c5, 0x6822, 0x70d4, 0xd0b4, 0x0040, 0x3f52, 0xc0b4, 1290 0xa291, 0x0000, 0x692e, 0x6a32, 0x2100, 0xa205, 0x00c0, 0x36ba,
1565 0x70d6, 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 1291 0x0078, 0x45d6, 0x7000, 0xa086, 0x0006, 0x0040, 0x36c1, 0x0078,
1566 0x8001, 0x601a, 0x0c7f, 0x007c, 0x0c7e, 0x2960, 0x6104, 0xa18c, 1292 0x45d6, 0x007c, 0x6946, 0x6008, 0xc0cd, 0xd3cc, 0x0040, 0x36c9,
1567 0xfff5, 0x6106, 0x2011, 0x0032, 0x2019, 0x0000, 0x0078, 0x3f60, 1293 0xc08d, 0x600a, 0x6818, 0x683a, 0x681b, 0x0006, 0x688f, 0x0000,
1568 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 1294 0x6893, 0x0000, 0x6a30, 0x692c, 0x6a3e, 0x6942, 0x682f, 0x0003,
1569 0xa8c0, 0x0005, 0x6820, 0xc0c5, 0x6822, 0x0c7f, 0x007c, 0x0c7e, 1295 0x6833, 0x0000, 0x6837, 0x0020, 0x6897, 0x0000, 0x689b, 0x0020,
1570 0x7158, 0x2160, 0x2018, 0xa08c, 0x0020, 0x0040, 0x3f78, 0xc0ac, 1296 0x7000, 0x0079, 0x36e3, 0x2a0c, 0x36f5, 0x36ed, 0x36eb, 0x36eb,
1571 0x2008, 0xa084, 0xfff0, 0xa635, 0x7e86, 0x6018, 0x789a, 0x7eae, 1297 0x36eb, 0x36eb, 0x36eb, 0x1078, 0x29b2, 0x6820, 0xd084, 0x00c0,
1572 0x6612, 0x78a4, 0xa084, 0xfff0, 0xa18c, 0x000f, 0xa105, 0xc0f4, 1298 0x36f5, 0x1078, 0x3e19, 0x0078, 0x36fb, 0x705c, 0x2c50, 0x2060,
1573 0xa39c, 0x0020, 0x0040, 0x3f8e, 0xa085, 0x4000, 0xc0fc, 0xd0b4, 1299 0x6800, 0x6002, 0x2a60, 0x3208, 0xa18c, 0x0300, 0x0040, 0x3704,
1574 0x00c0, 0x3f93, 0xc0fd, 0x78a6, 0x6016, 0x788a, 0xa6b4, 0x000f, 1300 0x2021, 0x4f58, 0x0078, 0x3706, 0x2021, 0x4f98, 0x2404, 0xa005,
1575 0x8637, 0x8204, 0x8004, 0xa084, 0x00ff, 0xa605, 0x600e, 0x6004, 1301 0x0040, 0x370d, 0x2020, 0x0078, 0x3706, 0x2d22, 0x206b, 0x0000,
1576 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x007c, 0x0c7e, 0x7058, 0x2060, 1302 0x007c, 0x1078, 0x3e20, 0x1078, 0x3e36, 0x6008, 0xc0cc, 0x600a,
1577 0x6018, 0x789a, 0x78a4, 0xa084, 0xfff0, 0x78a6, 0x6012, 0x7884, 1303 0x682b, 0x0000, 0x789b, 0x000e, 0x6f14, 0x6938, 0x691a, 0x6944,
1578 0xa084, 0xfff0, 0x7886, 0x600c, 0xa084, 0x00ff, 0x600e, 0x0c7f, 1304 0x6916, 0x3208, 0xa18c, 0x0300, 0x0040, 0x372a, 0x2009, 0x0000,
1579 0x007c, 0xa282, 0x0002, 0x00c0, 0x40b7, 0x7aa8, 0x6920, 0xc1bd, 1305 0x0078, 0x372c, 0x2009, 0x0001, 0x1078, 0x4a81, 0xd6dc, 0x0040,
1580 0x6922, 0xd1cc, 0x0040, 0x3ff4, 0xc1cc, 0x6922, 0xa294, 0x00ff, 1306 0x3734, 0x691c, 0xc1ed, 0x691e, 0x6818, 0xd0fc, 0x0040, 0x3743,
1581 0xa282, 0x0002, 0x00c8, 0x40b7, 0x1078, 0x4044, 0x1078, 0x3fa5, 1307 0x7868, 0xa08c, 0x00ff, 0x0040, 0x3741, 0x681b, 0x001e, 0x0078,
1582 0xa980, 0x0001, 0x200c, 0x1078, 0x41fa, 0x1078, 0x3ef5, 0x88ff, 1308 0x3743, 0x681b, 0x0000, 0xb284, 0x0300, 0x00c0, 0x374b, 0x2021,
1583 0x0040, 0x3fea, 0x789b, 0x0060, 0x2800, 0x78aa, 0x7e58, 0xc695, 1309 0x4f98, 0x0078, 0x374d, 0x2021, 0x4f58, 0x6800, 0x2022, 0x6a3c,
1584 0x7e5a, 0xd6d4, 0x00c0, 0x3fe7, 0x781b, 0x0064, 0x007c, 0x781b, 1310 0x6940, 0x6a32, 0x692e, 0x68c0, 0x2060, 0x6000, 0xd0a4, 0x0040,
1585 0x0078, 0x007c, 0x7e58, 0xd6d4, 0x00c0, 0x3ff1, 0x781b, 0x0067, 1311 0x378d, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x0d7e,
1586 0x007c, 0x781b, 0x0079, 0x007c, 0xa282, 0x0002, 0x00c8, 0x3ffc, 1312 0x0f7e, 0x157e, 0x147e, 0x2079, 0x4f00, 0x1078, 0x1e46, 0x147f,
1587 0xa284, 0x0001, 0x0040, 0x4005, 0x7158, 0xa188, 0x0000, 0x210c, 1313 0x157f, 0x0f7f, 0x70cc, 0x2010, 0x2009, 0x0101, 0x027e, 0x2204,
1588 0xd1ec, 0x00c0, 0x4005, 0x2011, 0x0000, 0x1078, 0x412c, 0x1078, 1314 0xa06d, 0x0040, 0x377d, 0x6814, 0xa706, 0x0040, 0x377a, 0x6800,
1589 0x4044, 0x1078, 0x3fa5, 0x7858, 0xc095, 0x785a, 0x781b, 0x0078, 1315 0x0078, 0x3770, 0x6820, 0xc0d5, 0x6822, 0x027f, 0x8210, 0x8109,
1590 0x007c, 0x0c7e, 0x027e, 0x2960, 0x6000, 0x2011, 0x0001, 0xd0ec, 1316 0x00c0, 0x376e, 0x0d7f, 0x7067, 0x0003, 0x707f, 0x0000, 0x7776,
1591 0x00c0, 0x4025, 0xa084, 0x0080, 0x00c0, 0x4023, 0xc1a4, 0x6106, 1317 0x7083, 0x000f, 0x71d4, 0xc1dc, 0x71d6, 0x6818, 0xa086, 0x0002,
1592 0xa006, 0x0078, 0x4041, 0x2011, 0x0000, 0x78ab, 0x0001, 0x78ab, 1318 0x00c0, 0x3799, 0x6817, 0x0000, 0x682b, 0x0000, 0x681c, 0xc0ec,
1319 0x681e, 0x1078, 0x2073, 0x0078, 0x2a0c, 0x7cd8, 0x7ddc, 0x7fd0,
1320 0x1078, 0x3648, 0x682b, 0x0000, 0x789b, 0x000e, 0x6f14, 0x1078,
1321 0x43d7, 0xa08c, 0x00ff, 0x6916, 0x6818, 0xd0fc, 0x0040, 0x37b2,
1322 0x7048, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x7067, 0x0000, 0x0078,
1323 0x2a0c, 0x7000, 0xa005, 0x00c0, 0x37bf, 0x0078, 0x2a0c, 0xa006,
1324 0x1078, 0x45d6, 0x6920, 0xd1ac, 0x00c0, 0x37c8, 0x681b, 0x0014,
1325 0xa68c, 0xdf00, 0x691e, 0x682b, 0x0000, 0x6820, 0xa084, 0x00ff,
1326 0x6822, 0x7000, 0x0079, 0x37d4, 0x2a0c, 0x37de, 0x37de, 0x37e1,
1327 0x37e1, 0x37e1, 0x37dc, 0x37dc, 0x1078, 0x29b2, 0x6818, 0x0078,
1328 0x3443, 0x6008, 0xc0a4, 0x600a, 0x6817, 0x0000, 0x0078, 0x3dde,
1329 0x2300, 0x0079, 0x37eb, 0x37ee, 0x37f0, 0x3860, 0x1078, 0x29b2,
1330 0xd6fc, 0x00c0, 0x3847, 0x7000, 0xa00d, 0x0079, 0x37f7, 0x2a0c,
1331 0x3801, 0x3801, 0x3831, 0x3801, 0x3844, 0x37ff, 0x37ff, 0x1078,
1332 0x29b2, 0xa684, 0x0060, 0x0040, 0x3831, 0xa086, 0x0060, 0x00c0,
1333 0x382e, 0xc6ac, 0xc6f4, 0xc6ed, 0x7e5a, 0x6eb6, 0x681c, 0xc0ac,
1334 0x681e, 0xa186, 0x0002, 0x0040, 0x3820, 0x1078, 0x45d6, 0x69ac,
1335 0x68b0, 0xa115, 0x0040, 0x3820, 0x1078, 0x4977, 0x0078, 0x3822,
1336 0x1078, 0x493f, 0x781b, 0x0079, 0x71d4, 0xd1b4, 0x00c0, 0x2a08,
1337 0x70a4, 0xa086, 0x0001, 0x00c0, 0x2a52, 0x007c, 0xd6ec, 0x0040,
1338 0x380b, 0x6818, 0xd0fc, 0x0040, 0x3844, 0xd6f4, 0x00c0, 0x383e,
1339 0x681b, 0x0015, 0x781b, 0x0079, 0x0078, 0x2a08, 0x681b, 0x0007,
1340 0x682f, 0x0000, 0x6833, 0x0000, 0x1078, 0x4369, 0x007c, 0xc6fc,
1341 0x7e5a, 0x7adc, 0x79d8, 0x78d0, 0x801b, 0x00c8, 0x3850, 0x8000,
1342 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100, 0xa302,
1343 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x781b, 0x0079, 0x007c,
1344 0x1078, 0x29b2, 0x2300, 0x0079, 0x3865, 0x386a, 0x388f, 0x38ef,
1345 0x1078, 0x29b2, 0x7000, 0x0079, 0x386d, 0x3875, 0x3877, 0x3880,
1346 0x3875, 0x3875, 0x3875, 0x3875, 0x3875, 0x1078, 0x29b2, 0x69ac,
1347 0x68b0, 0xa115, 0x0040, 0x3880, 0x1078, 0x4977, 0x0078, 0x3882,
1348 0x1078, 0x493f, 0x681c, 0xc0b4, 0x681e, 0x70d4, 0xd0b4, 0x00c0,
1349 0x2a08, 0x70a4, 0xa086, 0x0001, 0x00c0, 0x2a52, 0x007c, 0xd6fc,
1350 0x00c0, 0x38df, 0x7000, 0xa00d, 0x0079, 0x3896, 0x2a0c, 0x38a6,
1351 0x38a0, 0x38d6, 0x38a6, 0x38dc, 0x389e, 0x389e, 0x1078, 0x29b2,
1352 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da, 0xa684, 0x0060,
1353 0x0040, 0x38d6, 0xa086, 0x0060, 0x00c0, 0x38d3, 0xa6b4, 0xbfbf,
1354 0xc6ed, 0x7e5a, 0x6eb6, 0xa186, 0x0002, 0x0040, 0x38c2, 0x1078,
1355 0x45d6, 0x69ac, 0x68b0, 0xa115, 0x0040, 0x38c2, 0x1078, 0x4977,
1356 0x0078, 0x38c4, 0x1078, 0x493f, 0x781b, 0x0079, 0x681c, 0xc0b4,
1357 0x681e, 0x71d4, 0xd1b4, 0x00c0, 0x2a08, 0x70a4, 0xa086, 0x0001,
1358 0x00c0, 0x2a52, 0x007c, 0xd6ec, 0x0040, 0x38b0, 0x6818, 0xd0fc,
1359 0x0040, 0x38dc, 0x681b, 0x0007, 0x781b, 0x00f9, 0x007c, 0xc6fc,
1360 0x7e5a, 0x7adc, 0x79d8, 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94,
1361 0x2200, 0xa303, 0x68ae, 0x79d2, 0x781b, 0x0079, 0x007c, 0xd6dc,
1362 0x0040, 0x38f8, 0x782b, 0x3009, 0x781b, 0x0079, 0x0078, 0x2a08,
1363 0x7884, 0xc0ac, 0x7886, 0x78e4, 0xa084, 0x0008, 0x00c0, 0x390b,
1364 0xa484, 0x0200, 0x0040, 0x3905, 0xc6f5, 0xc6dd, 0x7e5a, 0x781b,
1365 0x0079, 0x0078, 0x2a08, 0x6820, 0xc095, 0x6822, 0x1078, 0x42e2,
1366 0xc6dd, 0x1078, 0x4118, 0x781b, 0x0078, 0x0078, 0x2a08, 0x2300,
1367 0x0079, 0x391a, 0x391d, 0x391f, 0x3921, 0x1078, 0x29b2, 0x0078,
1368 0x4111, 0xd6d4, 0x00c0, 0x395c, 0x79e4, 0xd1ac, 0x0040, 0x392f,
1369 0x78ec, 0xa084, 0x0003, 0x0040, 0x392f, 0x782b, 0x3009, 0x789b,
1370 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, 0x79e4, 0xd1ac,
1371 0x0040, 0x393f, 0x78ec, 0xa084, 0x0003, 0x00c0, 0x3958, 0x2001,
1372 0x4f04, 0x2004, 0xd0e4, 0x00c0, 0x3954, 0x6820, 0xd0c4, 0x0040,
1373 0x3954, 0x0c7e, 0x7058, 0x2060, 0x6004, 0xc09d, 0x6006, 0x6008,
1374 0xa084, 0x00ff, 0x600a, 0x0c7f, 0x2001, 0x0014, 0x0078, 0x3443,
1375 0xa184, 0x0007, 0x0079, 0x3992, 0x7a90, 0xa294, 0x0007, 0x789b,
1376 0x0060, 0x79a8, 0x81ff, 0x0040, 0x3990, 0x789b, 0x0010, 0x7ba8,
1377 0xa384, 0x0001, 0x00c0, 0x3983, 0x7ba8, 0x7ba8, 0xa386, 0x0001,
1378 0x00c0, 0x3976, 0x2009, 0xfff7, 0x0078, 0x397c, 0xa386, 0x0003,
1379 0x00c0, 0x3983, 0x2009, 0xffef, 0x0c7e, 0x7058, 0x2060, 0x6004,
1380 0xa104, 0x6006, 0x0c7f, 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684,
1381 0xfffb, 0x785a, 0x782b, 0x3009, 0x6920, 0xa18c, 0xfcff, 0x6922,
1382 0x0078, 0x435d, 0x30d9, 0x30e3, 0x399c, 0x39a2, 0x399a, 0x399a,
1383 0x435d, 0x435d, 0x1078, 0x29b2, 0x6920, 0xa18c, 0xfcff, 0x6922,
1384 0x0078, 0x4363, 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0078, 0x435d,
1385 0x79e4, 0xa184, 0x0030, 0x0040, 0x39b2, 0x78ec, 0xa084, 0x0003,
1386 0x00c0, 0x39e6, 0x7000, 0xa086, 0x0004, 0x00c0, 0x39cc, 0x7064,
1387 0xa086, 0x0002, 0x00c0, 0x39c2, 0x2011, 0x0002, 0x2019, 0x0000,
1388 0x0078, 0x2f65, 0x7064, 0xa086, 0x0006, 0x0040, 0x39bc, 0x7064,
1389 0xa086, 0x0004, 0x0040, 0x39bc, 0x7000, 0xa086, 0x0000, 0x0040,
1390 0x2a08, 0x6920, 0xa184, 0x0420, 0x0040, 0x39db, 0xc1d4, 0x6922,
1391 0x6818, 0x0078, 0x3443, 0x6818, 0xa08e, 0x0002, 0x0040, 0x39e4,
1392 0xc0fd, 0x681a, 0x2001, 0x0014, 0x0078, 0x3443, 0xa184, 0x0007,
1393 0x0079, 0x39ea, 0x435d, 0x435d, 0x39f2, 0x435d, 0x43a5, 0x43a5,
1394 0x435d, 0x435d, 0xd6bc, 0x0040, 0x3a34, 0x7184, 0x81ff, 0x0040,
1395 0x3a34, 0xa182, 0x000d, 0x00d0, 0x3a01, 0x7087, 0x0000, 0x0078,
1396 0x3a06, 0xa182, 0x000c, 0x7086, 0x2009, 0x000c, 0x789b, 0x0061,
1397 0x79aa, 0x157e, 0x137e, 0x147e, 0x7088, 0x8114, 0xa210, 0x728a,
1398 0xa080, 0x000b, 0xad00, 0x2098, 0xb284, 0x0300, 0x0040, 0x3a28,
1399 0x007e, 0x2001, 0x4f04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x3a24,
1400 0x20a1, 0x012b, 0x0078, 0x3a2a, 0x20a1, 0x022b, 0x0078, 0x3a2a,
1401 0x20a1, 0x012b, 0x789b, 0x0000, 0x8108, 0x81ac, 0x53a6, 0x147f,
1402 0x137f, 0x157f, 0x0078, 0x4363, 0xd6d4, 0x00c0, 0x3a88, 0x6820,
1403 0xd084, 0x0040, 0x4363, 0xa68c, 0x0060, 0xa684, 0x0060, 0x0040,
1404 0x3a46, 0xa086, 0x0060, 0x00c0, 0x3a46, 0xc1f5, 0xc194, 0x795a,
1405 0x69b6, 0x789b, 0x0060, 0x78ab, 0x0000, 0x789b, 0x0061, 0x6818,
1406 0xc0fd, 0x681a, 0x78aa, 0x8008, 0x810c, 0x0040, 0x3e4f, 0xa18c,
1407 0x00f8, 0x00c0, 0x3e4f, 0x157e, 0x137e, 0x147e, 0x017e, 0x3208,
1408 0xa18c, 0x0300, 0x0040, 0x3a74, 0x007e, 0x2001, 0x4f04, 0x2004,
1409 0xd0ec, 0x007f, 0x0040, 0x3a70, 0x20a1, 0x012b, 0x0078, 0x3a76,
1410 0x20a1, 0x022b, 0x0078, 0x3a76, 0x20a1, 0x012b, 0x017f, 0x789b,
1411 0x0000, 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f,
1412 0x137f, 0x157f, 0x6814, 0xc0fc, 0x8007, 0x7882, 0x0078, 0x4363,
1413 0x6818, 0xd0fc, 0x0040, 0x3a8e, 0x681b, 0x0008, 0x6820, 0xc0ad,
1414 0x6822, 0x1078, 0x4120, 0x781b, 0x00ea, 0x007c, 0x2300, 0x0079,
1415 0x3a99, 0x3a9e, 0x3b76, 0x3a9c, 0x1078, 0x29b2, 0x7cd8, 0x7ddc,
1416 0x7fd0, 0x82ff, 0x00c0, 0x3ac7, 0x7200, 0xa286, 0x0003, 0x0040,
1417 0x3410, 0x71d4, 0xd1bc, 0x00c0, 0x3aca, 0xd1b4, 0x0040, 0x3aca,
1418 0x0d7e, 0x783b, 0x8800, 0x781b, 0x004c, 0x70bc, 0xa06d, 0x68b4,
1419 0xc0a5, 0x785a, 0x6894, 0x78d6, 0x78de, 0x6898, 0x78d2, 0x78da,
1420 0xc1b4, 0x71d6, 0x7003, 0x0030, 0x0d7f, 0x0078, 0x3ace, 0x7200,
1421 0x0078, 0x3ace, 0x783b, 0x1800, 0x781b, 0x004a, 0xa284, 0x000f,
1422 0x0079, 0x3ad2, 0x3b61, 0x3b10, 0x3adc, 0x343f, 0x3ada, 0x3b61,
1423 0x3ada, 0x3ada, 0x1078, 0x29b2, 0x681c, 0xd0ec, 0x0040, 0x3ae3,
1424 0x6008, 0xc08d, 0x600a, 0x6920, 0xc185, 0x6922, 0x6800, 0x6006,
1425 0xa005, 0x00c0, 0x3aec, 0x6002, 0x6008, 0xc0d4, 0x600a, 0x681c,
1426 0xa084, 0x000e, 0x00c0, 0x3b00, 0xb284, 0x0300, 0x0040, 0x3afc,
1427 0x2009, 0x95c0, 0x0078, 0x3b05, 0x2009, 0x96d0, 0x0078, 0x3b05,
1428 0x7030, 0x68ba, 0x7140, 0x70cc, 0xa108, 0x2104, 0x6802, 0x2d0a,
1429 0x715e, 0xd6dc, 0x00c0, 0x3b10, 0xc6fc, 0x6eb6, 0x0078, 0x3b61,
1430 0x6eb6, 0xa684, 0x0060, 0x00c0, 0x3b1a, 0xa684, 0x7fff, 0x68b6,
1431 0x0078, 0x3b61, 0xd6dc, 0x00c0, 0x3b28, 0xa684, 0x7fff, 0x68b6,
1432 0x6894, 0x68a6, 0x6898, 0x68aa, 0x1078, 0x45d6, 0x0078, 0x3b61,
1433 0xd6ac, 0x0040, 0x3b34, 0xa006, 0x1078, 0x45d6, 0x2408, 0x2510,
1434 0x69aa, 0x6aa6, 0x0078, 0x3b44, 0x2408, 0x2510, 0x2700, 0x801b,
1435 0x00c8, 0x3b3b, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000,
1436 0x69aa, 0x6aa6, 0x1078, 0x45d6, 0xd6fc, 0x0040, 0x3b61, 0xa684,
1437 0x7fff, 0x68b6, 0x2510, 0x2408, 0xd6ac, 0x00c0, 0x3b59, 0x2700,
1438 0x801b, 0x00c8, 0x3b54, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291,
1439 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303,
1440 0x68ae, 0x7000, 0xa086, 0x0030, 0x00c0, 0x2a0c, 0x7003, 0x0002,
1441 0x70bc, 0xa06d, 0x68bc, 0x7042, 0x70b8, 0xa065, 0x68c0, 0x705a,
1442 0x2d00, 0x704e, 0xad80, 0x0009, 0x7046, 0x007c, 0xa586, 0x8800,
1443 0x00c0, 0x3b83, 0x7003, 0x0000, 0x6018, 0x8001, 0x601a, 0x6008,
1444 0xa084, 0xfbef, 0x600a, 0x0078, 0x4111, 0x7047, 0x0000, 0xa282,
1445 0x0006, 0x0050, 0x3b8d, 0x1078, 0x29b2, 0x2300, 0x0079, 0x3b90,
1446 0x3b93, 0x3ba5, 0x3bb1, 0x2200, 0x0079, 0x3b96, 0x3b9c, 0x4111,
1447 0x3b9e, 0x3b9c, 0x3beb, 0x3c40, 0x1078, 0x29b2, 0x7a80, 0xa294,
1448 0x0f00, 0x1078, 0x3cca, 0x0078, 0x4107, 0x1078, 0x3bc2, 0x0079,
1449 0x3ba9, 0x4111, 0x3baf, 0x3baf, 0x3beb, 0x3baf, 0x4111, 0x1078,
1450 0x29b2, 0x1078, 0x3bc2, 0x0079, 0x3bb5, 0x3bbd, 0x3bbb, 0x3bbb,
1451 0x3bbd, 0x3bbb, 0x3bbd, 0x1078, 0x29b2, 0x1078, 0x412b, 0x781b,
1452 0x0078, 0x007c, 0x7000, 0xa086, 0x0002, 0x00c0, 0x3bd3, 0x1078,
1453 0x3e36, 0x0078, 0x3bcd, 0x1078, 0x45d6, 0x6008, 0xa084, 0xfbef,
1454 0x600a, 0x0078, 0x3bd8, 0x7000, 0xa086, 0x0003, 0x0040, 0x3bcb,
1455 0x7003, 0x0005, 0xb284, 0x0300, 0x0040, 0x3be2, 0x2001, 0x96e0,
1456 0x0078, 0x3be4, 0x2001, 0x9712, 0x2068, 0x704e, 0xad80, 0x0009,
1457 0x7046, 0x2200, 0x007c, 0x7000, 0xa086, 0x0002, 0x00c0, 0x3bfd,
1458 0x70d4, 0xc0b5, 0x70d6, 0x2c00, 0x70ba, 0x2d00, 0x70be, 0x0078,
1459 0x3c02, 0x1078, 0x45d6, 0x0078, 0x3c02, 0x7000, 0xa086, 0x0003,
1460 0x0040, 0x3bf9, 0x7003, 0x0001, 0x7a80, 0xa294, 0x0f00, 0x789b,
1461 0x0018, 0x7ca8, 0xa484, 0x001f, 0xa215, 0x2069, 0x95c0, 0xb284,
1462 0x0300, 0x00c0, 0x3c16, 0xc2fd, 0x2069, 0x96d0, 0x2d04, 0x2d08,
1463 0x715e, 0xa06d, 0x0040, 0x3c23, 0x6814, 0xa206, 0x0040, 0x3c25,
1464 0x6800, 0x0078, 0x3c17, 0x1078, 0x3cca, 0x6eb4, 0x7e5a, 0x6920,
1465 0xa184, 0x0c00, 0x0040, 0x3cf4, 0x7064, 0xa086, 0x0006, 0x00c0,
1466 0x3c37, 0x7074, 0xa206, 0x00c0, 0x3c37, 0x7066, 0x707e, 0x681b,
1467 0x0005, 0xc1ad, 0xc1d4, 0x6922, 0x1078, 0x4120, 0x0078, 0x3cf4,
1468 0x7200, 0xa286, 0x0002, 0x00c0, 0x3c52, 0x70d4, 0xc0b5, 0x70d6,
1469 0x2c00, 0x70ba, 0x2d00, 0x70be, 0x0078, 0x3c56, 0x1078, 0x45d6,
1470 0x0078, 0x3c56, 0xa286, 0x0003, 0x0040, 0x3c4e, 0x7003, 0x0001,
1471 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, 0x001f,
1472 0xa215, 0xb284, 0x0300, 0x00c0, 0x3c66, 0xc2fd, 0x79a8, 0x79a8,
1473 0xa18c, 0x00ff, 0x2118, 0x70cc, 0xa168, 0x2d04, 0x2d08, 0x715e,
1474 0xa06d, 0x0040, 0x3c7a, 0x6814, 0xa206, 0x0040, 0x3ca3, 0x6800,
1475 0x0078, 0x3c6e, 0x7003, 0x0005, 0xb284, 0x0300, 0x0040, 0x3c84,
1476 0x2001, 0x96e0, 0x0078, 0x3c86, 0x2001, 0x9712, 0x2068, 0x704e,
1477 0x157e, 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, 0x00f0, 0x3c8b,
1478 0x157f, 0xb284, 0x0300, 0x0040, 0x3c98, 0xc2fc, 0x0078, 0x3c99,
1479 0xc2fd, 0x6a16, 0xad80, 0x0009, 0x7046, 0x68b7, 0x0700, 0x6823,
1480 0x0800, 0x6827, 0x0003, 0x6eb4, 0x6920, 0xa184, 0x0c00, 0x0040,
1481 0x3cf4, 0xd0dc, 0x0040, 0x3cbf, 0x7064, 0xa086, 0x0004, 0x00c0,
1482 0x3cbb, 0x7074, 0xa206, 0x00c0, 0x3cbb, 0x7078, 0xa306, 0x00c0,
1483 0x3cbb, 0x7066, 0x707e, 0x1078, 0x4127, 0x0078, 0x3cf4, 0x681b,
1484 0x0005, 0xc1ad, 0xc1d4, 0x6922, 0x1078, 0x4120, 0x707f, 0x0000,
1485 0x0078, 0x3cf4, 0x7003, 0x0005, 0xb284, 0x0300, 0x0040, 0x3cd4,
1486 0x2001, 0x96e0, 0x0078, 0x3cd6, 0x2001, 0x9712, 0x2068, 0x704e,
1487 0x157e, 0x20a9, 0x0032, 0x2003, 0x0000, 0x8000, 0x00f0, 0x3cdb,
1488 0x157f, 0xb284, 0x0300, 0x0040, 0x3ce8, 0xc2fc, 0x0078, 0x3ce9,
1489 0xc2fd, 0x6a16, 0xad80, 0x0009, 0x7046, 0x68b7, 0x0700, 0x6823,
1490 0x0800, 0x6827, 0x0003, 0x007c, 0xc6ec, 0xa6ac, 0x0060, 0x0040,
1491 0x3d46, 0x6b98, 0x6c94, 0x69ac, 0x68b0, 0xa105, 0x00c0, 0x3d21,
1492 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0xa586, 0x0060, 0x0040, 0x3d4b,
1493 0xd6f4, 0x00c0, 0x3d0c, 0xc6ed, 0xa6b4, 0xb7ff, 0x7e5a, 0x2009,
1494 0x0079, 0xd69c, 0x0040, 0x3d19, 0x2009, 0x0078, 0x2019, 0x0000,
1495 0x2320, 0x791a, 0xd6ec, 0x0040, 0x3d56, 0x1078, 0x493f, 0x0078,
1496 0x3d56, 0x68b0, 0xa31a, 0x2100, 0xa423, 0x2400, 0xa305, 0x0040,
1497 0x3d4d, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0x68b0, 0xd6f4, 0x00c0,
1498 0x3d32, 0xc6ed, 0xc6f4, 0x7e5a, 0x2011, 0x0079, 0xd69c, 0x0040,
1499 0x3d3e, 0x2011, 0x0078, 0x2019, 0x0000, 0x2320, 0x7a1a, 0xd6ec,
1500 0x0040, 0x3d56, 0x1078, 0x4977, 0x0078, 0x3d56, 0x2019, 0x0000,
1501 0x2320, 0x0078, 0x3d4d, 0xa6b4, 0xb7ff, 0x7e5a, 0x2009, 0x0079,
1502 0xd69c, 0x0040, 0x3d55, 0x2009, 0x0078, 0x791a, 0x68c0, 0x705a,
1503 0x2d00, 0x704e, 0x68c4, 0x2060, 0x71d4, 0x2001, 0x4f01, 0x2004,
1504 0xd0c4, 0x00c0, 0x3dab, 0x70d8, 0xa02d, 0x0040, 0x3d84, 0xd1bc,
1505 0x0040, 0x3d9e, 0x7a80, 0xa294, 0x0f00, 0x70dc, 0xa206, 0x0040,
1506 0x3d75, 0x78e0, 0xa504, 0x00c0, 0x3dab, 0x70da, 0xc1bc, 0x71d6,
1507 0x0078, 0x3dab, 0x2031, 0x0001, 0x852c, 0x0048, 0x3d83, 0x8633,
1508 0x8210, 0x0078, 0x3d7c, 0x007c, 0x7de0, 0xa594, 0xff00, 0x0040,
1509 0x3d91, 0x2011, 0x0008, 0x852f, 0x1078, 0x3d7a, 0x8637, 0x0078,
1510 0x3d93, 0x1078, 0x3d7a, 0x8217, 0x7880, 0xa084, 0x0f00, 0xa206,
1511 0x0040, 0x3dab, 0x72de, 0x76da, 0x0078, 0x3dab, 0x7a80, 0xa294,
1512 0x0f00, 0x70dc, 0xa236, 0x0040, 0x3d9b, 0x78e0, 0xa534, 0x0040,
1513 0x3d9b, 0xc1bd, 0x71d6, 0xd1b4, 0x00c0, 0x2a08, 0x2300, 0xa405,
1514 0x0040, 0x2a08, 0x70a4, 0xa086, 0x0001, 0x00c0, 0x2a52, 0x007c,
1515 0x6020, 0xa005, 0x0040, 0x3dc6, 0x8001, 0x6022, 0x6008, 0xa085,
1516 0x0008, 0x600a, 0x700f, 0x0100, 0x702c, 0x6026, 0x007c, 0xa006,
1517 0x1078, 0x45d6, 0x7000, 0xa086, 0x0002, 0x0040, 0x3dd4, 0x7064,
1518 0xa086, 0x0005, 0x00c0, 0x3dde, 0x682b, 0x0000, 0x6817, 0x0000,
1519 0x681b, 0x0001, 0x6823, 0x0040, 0x681f, 0x0100, 0x7000, 0xa084,
1520 0x000f, 0x0079, 0x3de3, 0x2a0c, 0x3df3, 0x3ded, 0x3e15, 0x3dfd,
1521 0x2a0c, 0x3deb, 0x3deb, 0x1078, 0x29b2, 0x1078, 0x3e20, 0x1078,
1522 0x3e19, 0x0078, 0x3df9, 0x1078, 0x3e20, 0x705c, 0x2060, 0x6800,
1523 0x6002, 0x1078, 0x2073, 0x0078, 0x2a0c, 0x7064, 0x7067, 0x0000,
1524 0x7083, 0x0000, 0x0079, 0x3e04, 0x3e11, 0x3e11, 0x3e0c, 0x3e0c,
1525 0x3e0c, 0x3e11, 0x3e0c, 0x3e11, 0x77d4, 0xc7dd, 0x77d6, 0x0079,
1526 0x2f7e, 0x7067, 0x0000, 0x0078, 0x2a0c, 0x681b, 0x0000, 0x0078,
1527 0x3711, 0x6800, 0xa005, 0x00c0, 0x3e1e, 0x6002, 0x6006, 0x007c,
1528 0x6410, 0x84ff, 0x0040, 0x3e32, 0x2009, 0x4f02, 0x2104, 0x8001,
1529 0x200a, 0x8421, 0x6412, 0x00c0, 0x3e32, 0x2021, 0x4f04, 0x2404,
1530 0xc0a5, 0x2022, 0x6008, 0xc0a4, 0x600a, 0x007c, 0x6018, 0xa005,
1531 0x0040, 0x3e3c, 0x8001, 0x601a, 0x007c, 0x1078, 0x43d3, 0x681b,
1532 0x0018, 0x0078, 0x3e7d, 0x1078, 0x43d3, 0x681b, 0x0019, 0x0078,
1533 0x3e7d, 0x1078, 0x43d3, 0x681b, 0x001a, 0x0078, 0x3e7d, 0x1078,
1534 0x43d3, 0x681b, 0x0003, 0x0078, 0x3e7d, 0x7774, 0x1078, 0x424e,
1535 0x7178, 0xa18c, 0x00ff, 0x3210, 0xa294, 0x0300, 0x0040, 0x3e64,
1536 0xa1e8, 0x94c0, 0x0078, 0x3e66, 0xa1e8, 0x95d0, 0x2d04, 0x2d08,
1537 0x2068, 0xa005, 0x00c0, 0x3e6f, 0x707e, 0x0078, 0x2a0c, 0x6814,
1538 0x7274, 0xa206, 0x0040, 0x3e77, 0x6800, 0x0078, 0x3e67, 0x6800,
1539 0x200a, 0x681b, 0x0005, 0x707f, 0x0000, 0x1078, 0x3e20, 0x6820,
1540 0xd084, 0x00c0, 0x3e85, 0x1078, 0x3e19, 0x1078, 0x3e36, 0x681f,
1541 0x0000, 0x6823, 0x0020, 0x1078, 0x2073, 0x0078, 0x2a0c, 0xa282,
1542 0x0003, 0x00c0, 0x4107, 0x7da8, 0xa5ac, 0x00ff, 0x7e5a, 0x7ea8,
1543 0xa6b4, 0x00ff, 0x6920, 0xc1bd, 0x6922, 0xd1c4, 0x0040, 0x3eea,
1544 0xc1c4, 0x6922, 0xa6b4, 0x00ff, 0x0040, 0x3ed7, 0xa682, 0x000c,
1545 0x0048, 0x3eae, 0x0040, 0x3eae, 0x2031, 0x000c, 0x2500, 0xa086,
1546 0x000a, 0x0040, 0x3eb5, 0x852b, 0x852b, 0x1078, 0x41e0, 0x0040,
1547 0x3ebd, 0x1078, 0x3fbc, 0x0078, 0x3ee0, 0x1078, 0x419b, 0x0c7e,
1548 0x2960, 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078, 0x3ff2, 0x0c7f,
1549 0x6920, 0xc1c5, 0x6922, 0x7e58, 0xc695, 0x7e5a, 0xd6d4, 0x00c0,
1550 0x3ed4, 0x781b, 0x0064, 0x007c, 0x781b, 0x0078, 0x007c, 0x0c7e,
1551 0x2960, 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078, 0x3ff2, 0x0c7f,
1552 0x7e58, 0xd6d4, 0x00c0, 0x3ee7, 0x781b, 0x0067, 0x007c, 0x781b,
1553 0x0079, 0x007c, 0x0c7e, 0x7058, 0x2060, 0x6100, 0xd1e4, 0x0040,
1554 0x3f33, 0x6208, 0x8217, 0xa294, 0x00ff, 0xa282, 0x000c, 0x0048,
1555 0x3efd, 0x0040, 0x3efd, 0x2011, 0x000c, 0x2600, 0xa202, 0x00c8,
1556 0x3f02, 0x2230, 0x6208, 0xa294, 0x00ff, 0x2001, 0x4f05, 0x2004,
1557 0xd0e4, 0x00c0, 0x3f17, 0x78ec, 0xd0e4, 0x0040, 0x3f17, 0xa282,
1558 0x000a, 0x00c8, 0x3f1d, 0x2011, 0x000a, 0x0078, 0x3f1d, 0xa282,
1559 0x000c, 0x00c8, 0x3f1d, 0x2011, 0x000c, 0x2200, 0xa502, 0x00c8,
1560 0x3f22, 0x2228, 0x1078, 0x419f, 0x2500, 0xa086, 0x000a, 0x0040,
1561 0x3f2b, 0x852b, 0x852b, 0x1078, 0x41e0, 0x0040, 0x3f33, 0x1078,
1562 0x3fbc, 0x0078, 0x3f37, 0x1078, 0x419b, 0x1078, 0x3ff2, 0x7858,
1563 0xc095, 0x785a, 0x0c7f, 0x781b, 0x0078, 0x007c, 0x0c7e, 0x2960,
1564 0x6000, 0xd0e4, 0x00c0, 0x3f58, 0xd0b4, 0x00c0, 0x3f52, 0x6010,
1565 0xa084, 0x000f, 0x00c0, 0x3f52, 0x6104, 0xa18c, 0xfff5, 0x6106,
1566 0x0c7f, 0x007c, 0x2011, 0x0032, 0x2019, 0x0000, 0x0078, 0x3f83,
1567 0x68a0, 0xd0cc, 0x00c0, 0x3f52, 0x6208, 0xa294, 0x00ff, 0x2001,
1568 0x4f05, 0x2004, 0xd0e4, 0x00c0, 0x3f71, 0x78ec, 0xd0e4, 0x0040,
1569 0x3f71, 0xa282, 0x000b, 0x00c8, 0x3f71, 0x2011, 0x000a, 0x0078,
1570 0x3f77, 0xa282, 0x000c, 0x00c8, 0x3f77, 0x2011, 0x000c, 0x6308,
1571 0x831f, 0xa39c, 0x00ff, 0xa382, 0x000c, 0x0048, 0x3f83, 0x0040,
1572 0x3f83, 0x2019, 0x000c, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab,
1573 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005, 0x6820, 0xc0c5, 0x6822,
1574 0x70d4, 0xd0b4, 0x0040, 0x3f9f, 0xc0b4, 0x70d6, 0x70b8, 0xa065,
1575 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x0c7f,
1576 0x007c, 0x0c7e, 0x2960, 0x6104, 0xa18c, 0xfff5, 0x6106, 0x2011,
1577 0x0032, 0x2019, 0x0000, 0x0078, 0x3fad, 0x78ab, 0x0001, 0x78ab,
1578 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005, 0x6820,
1579 0xc0c5, 0x6822, 0x0c7f, 0x007c, 0x0c7e, 0x7158, 0x2160, 0x2018,
1580 0xa08c, 0x0020, 0x0040, 0x3fc5, 0xc0ac, 0x2008, 0xa084, 0xfff0,
1581 0xa635, 0x7e86, 0x6018, 0x789a, 0x7eae, 0x6612, 0x78a4, 0xa084,
1582 0xfff0, 0xa18c, 0x000f, 0xa105, 0xc0f4, 0xa39c, 0x0020, 0x0040,
1583 0x3fdb, 0xa085, 0x4000, 0xc0fc, 0xd0b4, 0x00c0, 0x3fe0, 0xc0fd,
1584 0x78a6, 0x6016, 0x788a, 0xa6b4, 0x000f, 0x8637, 0x8204, 0x8004,
1585 0xa084, 0x00ff, 0xa605, 0x600e, 0x6004, 0xa084, 0xfff5, 0x6006,
1586 0x0c7f, 0x007c, 0x0c7e, 0x7058, 0x2060, 0x6018, 0x789a, 0x78a4,
1587 0xa084, 0xfff0, 0x78a6, 0x6012, 0x7884, 0xa084, 0xfff0, 0x7886,
1588 0x600c, 0xa084, 0x00ff, 0x600e, 0x0c7f, 0x007c, 0xa282, 0x0002,
1589 0x00c0, 0x4107, 0x7aa8, 0x6920, 0xc1bd, 0x6922, 0xd1cc, 0x0040,
1590 0x4041, 0xc1cc, 0x6922, 0xa294, 0x00ff, 0xa282, 0x0002, 0x00c8,
1591 0x4107, 0x1078, 0x4094, 0x1078, 0x3ff2, 0xa980, 0x0001, 0x200c,
1592 0x1078, 0x424a, 0x1078, 0x3f3e, 0x88ff, 0x0040, 0x4037, 0x789b,
1593 0x0060, 0x2800, 0x78aa, 0x7e58, 0xc695, 0x7e5a, 0xd6d4, 0x00c0,
1594 0x4034, 0x781b, 0x0064, 0x007c, 0x781b, 0x0078, 0x007c, 0x7e58,
1595 0xd6d4, 0x00c0, 0x403e, 0x781b, 0x0067, 0x007c, 0x781b, 0x0079,
1596 0x007c, 0xa282, 0x0002, 0x00c8, 0x4049, 0xa284, 0x0001, 0x0040,
1597 0x4052, 0x7158, 0xa188, 0x0000, 0x210c, 0xd1ec, 0x00c0, 0x4052,
1598 0x2011, 0x0000, 0x1078, 0x417c, 0x1078, 0x4094, 0x1078, 0x3ff2,
1599 0x7858, 0xc095, 0x785a, 0x781b, 0x0078, 0x007c, 0x0c7e, 0x027e,
1600 0x2960, 0x6000, 0x2011, 0x0001, 0xd0ec, 0x00c0, 0x4075, 0xd0bc,
1601 0x00c0, 0x4073, 0x6014, 0xd0b4, 0x00c0, 0x4073, 0xc1a4, 0x6106,
1602 0xa006, 0x0078, 0x4091, 0x2011, 0x0000, 0x78ab, 0x0001, 0x78ab,
1593 0x0002, 0x78ab, 0x0003, 0x7aaa, 0xa8c0, 0x0004, 0x70d4, 0xd0b4, 1603 0x0002, 0x78ab, 0x0003, 0x7aaa, 0xa8c0, 0x0004, 0x70d4, 0xd0b4,
1594 0x0040, 0x403d, 0xc0b4, 0x70d6, 0x70b8, 0xa065, 0x6008, 0xa084, 1604 0x0040, 0x408d, 0xc0b4, 0x70d6, 0x70b8, 0xa065, 0x6008, 0xa084,
1595 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x6820, 0xa085, 0x0200, 1605 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x6820, 0xa085, 0x0200,
1596 0x6822, 0x027f, 0x0c7f, 0x007c, 0x0c7e, 0x7058, 0x2060, 0x82ff, 1606 0x6822, 0x027f, 0x0c7f, 0x007c, 0x0c7e, 0x7058, 0x2060, 0x82ff,
1597 0x0040, 0x404c, 0x2011, 0x0040, 0x6018, 0xa080, 0x0002, 0x789a, 1607 0x0040, 0x409c, 0x2011, 0x0040, 0x6018, 0xa080, 0x0002, 0x789a,
1598 0x78a4, 0xa084, 0xffbf, 0xa205, 0xc0fc, 0xd0b4, 0x00c0, 0x4059, 1608 0x78a4, 0xa084, 0xffbf, 0xa205, 0xc0fc, 0xd0b4, 0x00c0, 0x40a9,
1599 0xc0fd, 0x78a6, 0x6016, 0x788a, 0x6004, 0xc0a4, 0x6006, 0x0c7f, 1609 0xc0fd, 0x78a6, 0x6016, 0x788a, 0x6004, 0xc0a4, 0x6006, 0x0c7f,
1600 0x007c, 0x007e, 0x7000, 0xa086, 0x0003, 0x0040, 0x406a, 0x007f, 1610 0x007c, 0x007e, 0x7000, 0xa086, 0x0003, 0x0040, 0x40ba, 0x007f,
1601 0x0078, 0x406d, 0x007f, 0x0078, 0x40b4, 0xd6ac, 0x0040, 0x40b4, 1611 0x0078, 0x40bd, 0x007f, 0x0078, 0x4104, 0xd6ac, 0x0040, 0x4104,
1602 0x7888, 0xa084, 0x0040, 0x0040, 0x40b4, 0x7bb8, 0xa384, 0x003f, 1612 0x7888, 0xa084, 0x0040, 0x0040, 0x4104, 0x7bb8, 0xa384, 0x003f,
1603 0x831b, 0x00c8, 0x407c, 0x8000, 0xa005, 0x0040, 0x4091, 0x831b, 1613 0x831b, 0x00c8, 0x40cc, 0x8000, 0xa005, 0x0040, 0x40e1, 0x831b,
1604 0x00c8, 0x4085, 0x8001, 0x0040, 0x40b1, 0xd6f4, 0x0040, 0x4091, 1614 0x00c8, 0x40d5, 0x8001, 0x0040, 0x4101, 0xd6f4, 0x0040, 0x40e1,
1605 0x78b8, 0x801b, 0x00c8, 0x408d, 0x8000, 0xa084, 0x003f, 0x00c0, 1615 0x78b8, 0x801b, 0x00c8, 0x40dd, 0x8000, 0xa084, 0x003f, 0x00c0,
1606 0x40b1, 0xc6f4, 0x7e5a, 0x79d8, 0x7adc, 0x2001, 0x0001, 0xa108, 1616 0x4101, 0xc6f4, 0x7e5a, 0x79d8, 0x7adc, 0x2001, 0x0001, 0xa108,
1607 0x00c8, 0x409c, 0xa291, 0x0000, 0x79d2, 0x79da, 0x7ad6, 0x7ade, 1617 0x00c8, 0x40ec, 0xa291, 0x0000, 0x79d2, 0x79da, 0x7ad6, 0x7ade,
1608 0x1078, 0x49c3, 0x781b, 0x0076, 0xb284, 0x0300, 0x0040, 0x40ac, 1618 0x1078, 0x4a44, 0x781b, 0x0076, 0xb284, 0x0300, 0x0040, 0x40fc,
1609 0x2001, 0x0000, 0x0078, 0x40ae, 0x2001, 0x0001, 0x1078, 0x484b, 1619 0x2001, 0x0000, 0x0078, 0x40fe, 0x2001, 0x0001, 0x1078, 0x48ce,
1610 0x007c, 0x781b, 0x0076, 0x007c, 0x781b, 0x0079, 0x007c, 0x1078, 1620 0x007c, 0x781b, 0x0076, 0x007c, 0x781b, 0x0079, 0x007c, 0x1078,
1611 0x40df, 0x781b, 0x0078, 0x007c, 0x1078, 0x40c8, 0x781b, 0x0078, 1621 0x412f, 0x781b, 0x0078, 0x007c, 0x1078, 0x4118, 0x781b, 0x0078,
1612 0x007c, 0x6827, 0x0002, 0x1078, 0x40d0, 0x781b, 0x0078, 0x007c, 1622 0x007c, 0x6827, 0x0002, 0x1078, 0x4120, 0x781b, 0x0078, 0x007c,
1613 0x2001, 0x0005, 0x0078, 0x40e1, 0x2001, 0x000c, 0x0078, 0x40e1, 1623 0x2001, 0x0005, 0x0078, 0x4131, 0x2001, 0x000c, 0x0078, 0x4131,
1614 0x6820, 0xc0d5, 0x6822, 0x2001, 0x0006, 0x0078, 0x40e1, 0x2001, 1624 0x6820, 0xc0d5, 0x6822, 0x2001, 0x0006, 0x0078, 0x4131, 0x2001,
1615 0x000d, 0x0078, 0x40e1, 0x2001, 0x0009, 0x0078, 0x40e1, 0x2001, 1625 0x000d, 0x0078, 0x4131, 0x2001, 0x0009, 0x0078, 0x4131, 0x2001,
1616 0x0007, 0x789b, 0x007e, 0x78aa, 0xc69d, 0x7e5a, 0x70d4, 0xd0b4, 1626 0x0007, 0x789b, 0x007e, 0x78aa, 0xc69d, 0x7e5a, 0x70d4, 0xd0b4,
1617 0x0040, 0x40f7, 0xc0b4, 0x70d6, 0x0c7e, 0x70b8, 0xa065, 0x6008, 1627 0x0040, 0x4147, 0xc0b4, 0x70d6, 0x0c7e, 0x70b8, 0xa065, 0x6008,
1618 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x0c7f, 0x007c, 1628 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x0c7f, 0x007c,
1619 0x077e, 0x873f, 0xa7bc, 0x000f, 0x873b, 0x873b, 0x8703, 0x017e, 1629 0x077e, 0x873f, 0xa7bc, 0x000f, 0x873b, 0x873b, 0x8703, 0x017e,
1620 0xb28c, 0x0300, 0x0040, 0x4108, 0xa0e0, 0x52c0, 0x0078, 0x410a, 1630 0xb28c, 0x0300, 0x0040, 0x4158, 0xa0e0, 0x53c0, 0x0078, 0x415a,
1621 0xa0e0, 0x5340, 0x017f, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, 0xa184, 1631 0xa0e0, 0x5440, 0x017f, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, 0xa184,
1622 0x000f, 0x0040, 0x411a, 0xa184, 0xfff0, 0x78a6, 0x6012, 0x6004, 1632 0x000f, 0x0040, 0x416a, 0xa184, 0xfff0, 0x78a6, 0x6012, 0x6004,
1623 0xc09d, 0x6006, 0x8738, 0x8738, 0x7f9a, 0x79a4, 0xa184, 0x0040, 1633 0xc09d, 0x6006, 0x8738, 0x8738, 0x7f9a, 0x79a4, 0xa184, 0x0040,
1624 0x0040, 0x412a, 0xa184, 0xffbf, 0xc0fd, 0x78a6, 0x6016, 0x6004, 1634 0x0040, 0x417a, 0xa184, 0xffbf, 0xc0fd, 0x78a6, 0x6016, 0x6004,
1625 0xc0a5, 0x6006, 0x077f, 0x007c, 0x789b, 0x0010, 0x78ab, 0x0001, 1635 0xc0a5, 0x6006, 0x077f, 0x007c, 0x789b, 0x0010, 0x78ab, 0x0001,
1626 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0060, 0x78ab, 1636 0x78ab, 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0060, 0x78ab,
1627 0x0004, 0x70d4, 0xd0b4, 0x0040, 0x414a, 0xc0b4, 0x70d6, 0x0c7e, 1637 0x0004, 0x70d4, 0xd0b4, 0x0040, 0x419a, 0xc0b4, 0x70d6, 0x0c7e,
1628 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001, 1638 0x70b8, 0xa065, 0x6008, 0xa084, 0xfbef, 0x600a, 0x6018, 0x8001,
1629 0x601a, 0x0c7f, 0x007c, 0x2031, 0x0000, 0x2029, 0x0032, 0x789b, 1639 0x601a, 0x0c7f, 0x007c, 0x2031, 0x0000, 0x2029, 0x0032, 0x789b,
1630 0x0010, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa, 1640 0x0010, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa,
1631 0x7eaa, 0x789b, 0x0060, 0x78ab, 0x0005, 0x70d4, 0xd0b4, 0x0040, 1641 0x7eaa, 0x789b, 0x0060, 0x78ab, 0x0005, 0x70d4, 0xd0b4, 0x0040,
1632 0x416e, 0xc0b4, 0x70d6, 0x0c7e, 0x70b8, 0xa065, 0x6008, 0xa084, 1642 0x41be, 0xc0b4, 0x70d6, 0x0c7e, 0x70b8, 0xa065, 0x6008, 0xa084,
1633 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x0c7f, 0x007c, 0x157e, 1643 0xfbef, 0x600a, 0x6018, 0x8001, 0x601a, 0x0c7f, 0x007c, 0x157e,
1634 0x8007, 0xa084, 0x00ff, 0x8003, 0x8003, 0xa080, 0x0020, 0x789a, 1644 0x8007, 0xa084, 0x00ff, 0x8003, 0x8003, 0xa080, 0x0020, 0x789a,
1635 0x79a4, 0xa18c, 0xfff0, 0x2021, 0x41e3, 0x2019, 0x0011, 0x20a9, 1645 0x79a4, 0xa18c, 0xfff0, 0x2021, 0x4233, 0x2019, 0x0011, 0x20a9,
1636 0x000e, 0x2011, 0x0032, 0x2404, 0xa084, 0xfff0, 0xa106, 0x0040, 1646 0x000e, 0x2011, 0x0032, 0x2404, 0xa084, 0xfff0, 0xa106, 0x0040,
1637 0x418e, 0x8420, 0x2300, 0xa210, 0x00f0, 0x4183, 0x157f, 0x007c, 1647 0x41de, 0x8420, 0x2300, 0xa210, 0x00f0, 0x41d3, 0x157f, 0x007c,
1638 0x157e, 0x2001, 0x4e05, 0x2004, 0xd0e4, 0x00c0, 0x41c1, 0x2021, 1648 0x157e, 0x2001, 0x4f05, 0x2004, 0xd0e4, 0x00c0, 0x4211, 0x2021,
1639 0x41f1, 0x20a9, 0x0009, 0x2011, 0x0028, 0xa582, 0x0019, 0x0040, 1649 0x4241, 0x20a9, 0x0009, 0x2011, 0x0028, 0xa582, 0x0019, 0x0040,
1640 0x41d7, 0x0048, 0x41d7, 0x8420, 0x95a9, 0x2011, 0x0032, 0xa582, 1650 0x4227, 0x0048, 0x4227, 0x8420, 0x95a9, 0x2011, 0x0032, 0xa582,
1641 0x0032, 0x0040, 0x41d7, 0x0048, 0x41d7, 0x8420, 0x95a9, 0x2019, 1651 0x0032, 0x0040, 0x4227, 0x0048, 0x4227, 0x8420, 0x95a9, 0x2019,
1642 0x000a, 0x2011, 0x0064, 0x2200, 0xa502, 0x0040, 0x41d7, 0x0048, 1652 0x000a, 0x2011, 0x0064, 0x2200, 0xa502, 0x0040, 0x4227, 0x0048,
1643 0x41d7, 0x8420, 0x2300, 0xa210, 0x00f0, 0x41b3, 0x157f, 0x0078, 1653 0x4227, 0x8420, 0x2300, 0xa210, 0x00f0, 0x4203, 0x157f, 0x0078,
1644 0x41d5, 0x2021, 0x41e3, 0x2019, 0x0011, 0x20a9, 0x000e, 0x2011, 1654 0x4225, 0x2021, 0x4233, 0x2019, 0x0011, 0x20a9, 0x000e, 0x2011,
1645 0x0032, 0x2200, 0xa502, 0x0040, 0x41d7, 0x0048, 0x41d7, 0x8420, 1655 0x0032, 0x2200, 0xa502, 0x0040, 0x4227, 0x0048, 0x4227, 0x8420,
1646 0x2300, 0xa210, 0x00f0, 0x41c9, 0x157f, 0xa006, 0x007c, 0x157f, 1656 0x2300, 0xa210, 0x00f0, 0x4219, 0x157f, 0xa006, 0x007c, 0x157f,
1647 0xa582, 0x0064, 0x00c8, 0x41e0, 0x7808, 0xa085, 0x0070, 0x780a, 1657 0xa582, 0x0064, 0x00c8, 0x4230, 0x7808, 0xa085, 0x0070, 0x780a,
1648 0x2404, 0xa005, 0x007c, 0x1209, 0x3002, 0x3202, 0x4203, 0x4403, 1658 0x2404, 0xa005, 0x007c, 0x1209, 0x3002, 0x3202, 0x4203, 0x4403,
1649 0x5404, 0x5604, 0x6605, 0x6805, 0x7806, 0x7a06, 0x0c07, 0x0c07, 1659 0x5404, 0x5604, 0x6605, 0x6805, 0x7806, 0x7a06, 0x0c07, 0x0c07,
1650 0x0e07, 0x10e1, 0x330a, 0x5805, 0x5a05, 0x6a06, 0x6c06, 0x7c07, 1660 0x0e07, 0x10e1, 0x330a, 0x5805, 0x5a05, 0x6a06, 0x6c06, 0x7c07,
1651 0x7e07, 0x0e00, 0x789b, 0x0010, 0xa046, 0x007c, 0xa784, 0x0f00, 1661 0x7e07, 0x0e00, 0x789b, 0x0010, 0xa046, 0x007c, 0xa784, 0x0f00,
1652 0x800b, 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 1662 0x800b, 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105,
1653 0xd7fc, 0x0040, 0x420f, 0xa0e0, 0x73c0, 0x0078, 0x4211, 0xa0e0, 1663 0xd7fc, 0x0040, 0x425f, 0xa0e0, 0x74c0, 0x0078, 0x4261, 0xa0e0,
1654 0x53c0, 0x007c, 0x0e7e, 0x0f7e, 0xd084, 0x0040, 0x421f, 0x2079, 1664 0x54c0, 0x007c, 0x0e7e, 0x0f7e, 0xd084, 0x0040, 0x426f, 0x2079,
1655 0x0100, 0x2009, 0x4e80, 0x2071, 0x4e80, 0x0078, 0x422f, 0x2009, 1665 0x0100, 0x2009, 0x4f80, 0x2071, 0x4f80, 0x0078, 0x427f, 0x2009,
1656 0x4e40, 0x2071, 0x4e40, 0x2001, 0x4e04, 0x2004, 0xd0ec, 0x0040, 1666 0x4f40, 0x2071, 0x4f40, 0x2001, 0x4f04, 0x2004, 0xd0ec, 0x0040,
1657 0x422d, 0x2079, 0x0100, 0x0078, 0x422f, 0x2079, 0x0200, 0x2091, 1667 0x427d, 0x2079, 0x0100, 0x0078, 0x427f, 0x2079, 0x0200, 0x2091,
1658 0x8000, 0x2104, 0xa084, 0x000f, 0x0079, 0x4236, 0x4240, 0x4240, 1668 0x8000, 0x2104, 0xa084, 0x000f, 0x0079, 0x4286, 0x4290, 0x4290,
1659 0x4240, 0x4240, 0x4240, 0x4240, 0x423e, 0x423e, 0x1078, 0x296b, 1669 0x4290, 0x4290, 0x4290, 0x4290, 0x428e, 0x428e, 0x1078, 0x29b2,
1660 0x69b4, 0xc1f5, 0xa18c, 0xff9f, 0x69b6, 0xa005, 0x0040, 0x428f, 1670 0x69b4, 0xc1f5, 0xa18c, 0xff9f, 0x69b6, 0xa005, 0x0040, 0x42df,
1661 0x7858, 0xa084, 0xff9f, 0xa085, 0x6000, 0x785a, 0x7828, 0xa086, 1671 0x7858, 0xa084, 0xff9f, 0xa085, 0x6000, 0x785a, 0x7828, 0xa086,
1662 0x1814, 0x00c0, 0x428f, 0x784b, 0x0004, 0x7848, 0xa084, 0x0004, 1672 0x1814, 0x00c0, 0x42df, 0x784b, 0x0004, 0x7848, 0xa084, 0x0004,
1663 0x00c0, 0x4255, 0x784b, 0x0008, 0x7848, 0xa084, 0x0008, 0x00c0, 1673 0x00c0, 0x42a5, 0x784b, 0x0008, 0x7848, 0xa084, 0x0008, 0x00c0,
1664 0x425c, 0x7830, 0xd0bc, 0x00c0, 0x428f, 0x007e, 0x2001, 0x4e04, 1674 0x42ac, 0x7830, 0xd0bc, 0x00c0, 0x42df, 0x007e, 0x2001, 0x4f04,
1665 0x2004, 0xd0ec, 0x007f, 0x0040, 0x4271, 0xb284, 0x0300, 0x0078, 1675 0x2004, 0xd0ec, 0x007f, 0x0040, 0x42c1, 0xb284, 0x0300, 0x0078,
1666 0x4273, 0xb284, 0x0400, 0x0040, 0x4279, 0x0018, 0x428f, 0x0078, 1676 0x42c3, 0xb284, 0x0400, 0x0040, 0x42c9, 0x0018, 0x42df, 0x0078,
1667 0x427b, 0x0028, 0x428f, 0x79e4, 0xa184, 0x0030, 0x0040, 0x428f, 1677 0x42cb, 0x0028, 0x42df, 0x79e4, 0xa184, 0x0030, 0x0040, 0x42df,
1668 0x78ec, 0xa084, 0x0003, 0x0040, 0x428f, 0x681c, 0xd0ac, 0x00c0, 1678 0x78ec, 0xa084, 0x0003, 0x0040, 0x42df, 0x681c, 0xd0ac, 0x00c0,
1669 0x428d, 0x1078, 0x4319, 0x0078, 0x428f, 0x781b, 0x00f9, 0x0f7f, 1679 0x42dd, 0x1078, 0x4369, 0x0078, 0x42df, 0x781b, 0x00f9, 0x0f7f,
1670 0x0e7f, 0x007c, 0x0c7e, 0x2001, 0x4e01, 0x2004, 0xd0ac, 0x00c0, 1680 0x0e7f, 0x007c, 0x0c7e, 0x2001, 0x4f01, 0x2004, 0xd0ac, 0x00c0,
1671 0x430b, 0x6814, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 1681 0x435b, 0x6814, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003,
1672 0xb28c, 0x0300, 0x0040, 0x42a8, 0xa0e0, 0x52c0, 0x0078, 0x42aa, 1682 0xb28c, 0x0300, 0x0040, 0x42f8, 0xa0e0, 0x53c0, 0x0078, 0x42fa,
1673 0xa0e0, 0x5340, 0x6004, 0xa084, 0x000a, 0x00c0, 0x430b, 0x6108, 1683 0xa0e0, 0x5440, 0x6004, 0xa084, 0x000a, 0x00c0, 0x435b, 0x6108,
1674 0xa194, 0xff00, 0x0040, 0x430b, 0xa18c, 0x00ff, 0x2001, 0x000a, 1684 0xa194, 0xff00, 0x0040, 0x435b, 0xa18c, 0x00ff, 0x2001, 0x000a,
1675 0xa106, 0x0040, 0x42d6, 0x2001, 0x000c, 0xa106, 0x0040, 0x42da, 1685 0xa106, 0x0040, 0x4326, 0x2001, 0x000c, 0xa106, 0x0040, 0x432a,
1676 0x2001, 0x0012, 0xa106, 0x0040, 0x42de, 0x2001, 0x0014, 0xa106, 1686 0x2001, 0x0012, 0xa106, 0x0040, 0x432e, 0x2001, 0x0014, 0xa106,
1677 0x0040, 0x42e2, 0x2001, 0x0019, 0xa106, 0x0040, 0x42e6, 0x2001, 1687 0x0040, 0x4332, 0x2001, 0x0019, 0xa106, 0x0040, 0x4336, 0x2001,
1678 0x0032, 0xa106, 0x0040, 0x42ea, 0x0078, 0x42ee, 0x2009, 0x000c, 1688 0x0032, 0xa106, 0x0040, 0x433a, 0x0078, 0x433e, 0x2009, 0x000c,
1679 0x0078, 0x42f0, 0x2009, 0x0012, 0x0078, 0x42f0, 0x2009, 0x0014, 1689 0x0078, 0x4340, 0x2009, 0x0012, 0x0078, 0x4340, 0x2009, 0x0014,
1680 0x0078, 0x42f0, 0x2009, 0x0019, 0x0078, 0x42f0, 0x2009, 0x0020, 1690 0x0078, 0x4340, 0x2009, 0x0019, 0x0078, 0x4340, 0x2009, 0x0020,
1681 0x0078, 0x42f0, 0x2009, 0x003f, 0x0078, 0x42f0, 0x2011, 0x0000, 1691 0x0078, 0x4340, 0x2009, 0x003f, 0x0078, 0x4340, 0x2011, 0x0000,
1682 0x2100, 0xa205, 0x600a, 0x6004, 0xa085, 0x0002, 0x6006, 0x2061, 1692 0x2100, 0xa205, 0x600a, 0x6004, 0xa085, 0x0002, 0x6006, 0x2061,
1683 0x4e00, 0x6004, 0xd0bc, 0x0040, 0x430b, 0x6814, 0xd0fc, 0x00c0, 1693 0x4f00, 0x6004, 0xd0bc, 0x0040, 0x435b, 0x6814, 0xd0fc, 0x00c0,
1684 0x4306, 0x60ea, 0x2061, 0x4e40, 0x0078, 0x4309, 0x60ee, 0x2061, 1694 0x4356, 0x60ea, 0x2061, 0x4f40, 0x0078, 0x4359, 0x60ee, 0x2061,
1685 0x4e80, 0x601f, 0x800f, 0x0c7f, 0x007c, 0x781b, 0x0079, 0x007c, 1695 0x4f80, 0x601f, 0x800f, 0x0c7f, 0x007c, 0x781b, 0x0079, 0x007c,
1686 0x781b, 0x0078, 0x007c, 0x781b, 0x0067, 0x007c, 0x781b, 0x0064, 1696 0x781b, 0x0078, 0x007c, 0x781b, 0x0067, 0x007c, 0x781b, 0x0064,
1687 0x007c, 0x2009, 0x4e19, 0x210c, 0xa186, 0x0000, 0x0040, 0x432b, 1697 0x007c, 0x2009, 0x4f19, 0x210c, 0xa186, 0x0000, 0x0040, 0x437b,
1688 0xa186, 0x0001, 0x0040, 0x432e, 0x701f, 0x000b, 0x7067, 0x0001, 1698 0xa186, 0x0001, 0x0040, 0x437e, 0x701f, 0x000b, 0x7067, 0x0001,
1689 0x781b, 0x0047, 0x007c, 0x781b, 0x00f0, 0x007c, 0x701f, 0x000a, 1699 0x781b, 0x0047, 0x007c, 0x781b, 0x00f0, 0x007c, 0x701f, 0x000a,
1690 0x007c, 0x2009, 0x4e19, 0x210c, 0xa186, 0x0000, 0x0040, 0x4346, 1700 0x007c, 0x2009, 0x4f19, 0x210c, 0xa186, 0x0000, 0x0040, 0x4396,
1691 0xa186, 0x0001, 0x0040, 0x4343, 0x701f, 0x000b, 0x7067, 0x0001, 1701 0xa186, 0x0001, 0x0040, 0x4393, 0x701f, 0x000b, 0x7067, 0x0001,
1692 0x781b, 0x0047, 0x007c, 0x701f, 0x000a, 0x007c, 0x781b, 0x00ef, 1702 0x781b, 0x0047, 0x007c, 0x701f, 0x000a, 0x007c, 0x781b, 0x00ef,
1693 0x007c, 0x781b, 0x00f9, 0x007c, 0x781b, 0x00f8, 0x007c, 0x781b, 1703 0x007c, 0x781b, 0x00f9, 0x007c, 0x781b, 0x00f8, 0x007c, 0x781b,
1694 0x00c9, 0x007c, 0x781b, 0x00c8, 0x007c, 0x6818, 0xd0fc, 0x0040, 1704 0x00c9, 0x007c, 0x781b, 0x00c8, 0x007c, 0x6818, 0xd0fc, 0x0040,
1695 0x435b, 0x681b, 0x001d, 0x7067, 0x0001, 0x781b, 0x0047, 0x007c, 1705 0x43ab, 0x681b, 0x001d, 0x7067, 0x0001, 0x781b, 0x0047, 0x007c,
1696 0x7830, 0xa084, 0x00c0, 0x00c0, 0x4382, 0x7808, 0xc08c, 0x780a, 1706 0x7830, 0xa084, 0x00c0, 0x00c0, 0x43d2, 0x7808, 0xc08c, 0x780a,
1697 0x0005, 0x0005, 0x0005, 0x0005, 0x78ec, 0xa084, 0x0021, 0x00c0, 1707 0x0005, 0x0005, 0x0005, 0x0005, 0x78ec, 0xa084, 0x0021, 0x00c0,
1698 0x437f, 0x2001, 0x4e05, 0x2004, 0xd0e4, 0x00c0, 0x437d, 0x7804, 1708 0x43cf, 0x2001, 0x4f05, 0x2004, 0xd0e4, 0x00c0, 0x43cd, 0x7804,
1699 0xa084, 0xff1f, 0xa085, 0x00e0, 0x7806, 0xa006, 0x007c, 0x7808, 1709 0xa084, 0xff1f, 0xa085, 0x00e0, 0x7806, 0xa006, 0x007c, 0x7808,
1700 0xc08d, 0x780a, 0x007c, 0x7808, 0xc08d, 0x780a, 0x007c, 0x7830, 1710 0xc08d, 0x780a, 0x007c, 0x7808, 0xc08d, 0x780a, 0x007c, 0x7830,
1701 0xa084, 0x0040, 0x00c0, 0x4387, 0x2001, 0x4e04, 0x2004, 0xd0ec, 1711 0xa084, 0x0040, 0x00c0, 0x43d7, 0x2001, 0x4f04, 0x2004, 0xd0ec,
1702 0x0040, 0x4396, 0xb284, 0x0300, 0x0078, 0x4398, 0xb284, 0x0400, 1712 0x0040, 0x43e6, 0xb284, 0x0300, 0x0078, 0x43e8, 0xb284, 0x0400,
1703 0x0040, 0x439e, 0x0098, 0x43a2, 0x0078, 0x43a0, 0x00a8, 0x43a2, 1713 0x0040, 0x43ee, 0x0098, 0x43f2, 0x0078, 0x43f0, 0x00a8, 0x43f2,
1704 0x78ac, 0x007c, 0x7808, 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005, 1714 0x78ac, 0x007c, 0x7808, 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005,
1705 0x0005, 0x0005, 0x78ec, 0xa084, 0x0021, 0x0040, 0x43c5, 0x007e, 1715 0x0005, 0x0005, 0x78ec, 0xa084, 0x0021, 0x0040, 0x4415, 0x007e,
1706 0x2001, 0x4e04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x43bb, 0xb284, 1716 0x2001, 0x4f04, 0x2004, 0xd0ec, 0x007f, 0x0040, 0x440b, 0xb284,
1707 0x0300, 0x0078, 0x43bd, 0xb284, 0x0400, 0x0040, 0x43c3, 0x0098, 1717 0x0300, 0x0078, 0x440d, 0xb284, 0x0400, 0x0040, 0x4413, 0x0098,
1708 0x43bf, 0x0078, 0x43c5, 0x00a8, 0x43c3, 0x78ac, 0x007e, 0x7808, 1718 0x440f, 0x0078, 0x4415, 0x00a8, 0x4413, 0x78ac, 0x007e, 0x7808,
1709 0xa085, 0x0002, 0x780a, 0x007f, 0x007c, 0xa784, 0x0001, 0x00c0, 1719 0xa085, 0x0002, 0x780a, 0x007f, 0x007c, 0xa784, 0x0001, 0x00c0,
1710 0x3770, 0xa784, 0x0070, 0x0040, 0x43dd, 0x0c7e, 0x2d60, 0x2f68, 1720 0x37b9, 0xa784, 0x0070, 0x0040, 0x442d, 0x0c7e, 0x2d60, 0x2f68,
1711 0x1078, 0x28df, 0x2d78, 0x2c68, 0x0c7f, 0xa784, 0x0008, 0x0040, 1721 0x1078, 0x2926, 0x2d78, 0x2c68, 0x0c7f, 0xa784, 0x0008, 0x0040,
1712 0x43ea, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x3770, 1722 0x443a, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x37b9,
1713 0x0078, 0x430d, 0xa784, 0x0004, 0x0040, 0x4419, 0x78b8, 0xa084, 1723 0x0078, 0x435d, 0xa784, 0x0004, 0x0040, 0x4469, 0x78b8, 0xa084,
1714 0x4001, 0x0040, 0x4419, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 1724 0x4001, 0x0040, 0x4469, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003,
1715 0x0040, 0x3770, 0x78e4, 0xa084, 0x0007, 0xa086, 0x0001, 0x00c0, 1725 0x0040, 0x37b9, 0x78e4, 0xa084, 0x0007, 0xa086, 0x0001, 0x00c0,
1716 0x4419, 0x78c0, 0xa685, 0x4800, 0x2030, 0x7e5a, 0x781b, 0x00f9, 1726 0x4469, 0x78c0, 0xa685, 0x4800, 0x2030, 0x7e5a, 0x781b, 0x00f9,
1717 0x007c, 0x784b, 0x0008, 0x6818, 0xd0fc, 0x0040, 0x4416, 0x681b, 1727 0x007c, 0x784b, 0x0008, 0x6818, 0xd0fc, 0x0040, 0x4466, 0x681b,
1718 0x0015, 0xd6f4, 0x0040, 0x4416, 0x681b, 0x0007, 0x1078, 0x4319, 1728 0x0015, 0xd6f4, 0x0040, 0x4466, 0x681b, 0x0007, 0x1078, 0x4369,
1719 0x007c, 0x681b, 0x0003, 0x7858, 0xa084, 0x3f00, 0x681e, 0x682f, 1729 0x007c, 0x681b, 0x0003, 0x7858, 0xa084, 0x3f00, 0x681e, 0x682f,
1720 0x0000, 0x6833, 0x0000, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 1730 0x0000, 0x6833, 0x0000, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003,
1721 0x0040, 0x3066, 0x007e, 0x2001, 0x4e04, 0x2004, 0xd0ec, 0x007f, 1731 0x0040, 0x30af, 0x007e, 0x2001, 0x4f04, 0x2004, 0xd0ec, 0x007f,
1722 0x0040, 0x4436, 0xb284, 0x0300, 0x0078, 0x4438, 0xb284, 0x0400, 1732 0x0040, 0x4486, 0xb284, 0x0300, 0x0078, 0x4488, 0xb284, 0x0400,
1723 0x0040, 0x443e, 0x0018, 0x29c1, 0x0078, 0x4440, 0x0028, 0x29c1, 1733 0x0040, 0x448e, 0x0018, 0x2a08, 0x0078, 0x4490, 0x0028, 0x2a08,
1724 0x0078, 0x40bc, 0x6b14, 0x8307, 0xa084, 0x000f, 0x8003, 0x8003, 1734 0x0078, 0x410c, 0x6b14, 0x8307, 0xa084, 0x000f, 0x8003, 0x8003,
1725 0x8003, 0xd3fc, 0x0040, 0x4450, 0xa080, 0x5340, 0x0078, 0x4452, 1735 0x8003, 0xd3fc, 0x0040, 0x44a0, 0xa080, 0x5440, 0x0078, 0x44a2,
1726 0xa080, 0x52c0, 0x2060, 0x2048, 0x705a, 0x2a60, 0x007c, 0x0020, 1736 0xa080, 0x53c0, 0x2060, 0x2048, 0x705a, 0x2a60, 0x007c, 0x0020,
1727 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 1737 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
1728 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 1738 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
1729 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 1739 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000,
@@ -1763,255 +1773,276 @@ static unsigned short risc_code01[] = {
1763 0x0016, 0x7944, 0x8421, 0xa020, 0xa532, 0x84a1, 0x0016, 0x7944, 1773 0x0016, 0x7944, 0x8421, 0xa020, 0xa532, 0x84a1, 0x0016, 0x7944,
1764 0x8421, 0xa0df, 0x9532, 0x84a1, 0x0016, 0x0000, 0x127e, 0x70d4, 1774 0x8421, 0xa0df, 0x9532, 0x84a1, 0x0016, 0x0000, 0x127e, 0x70d4,
1765 0xa084, 0x4600, 0x8004, 0x2090, 0x7204, 0x7008, 0xc09c, 0xa205, 1775 0xa084, 0x4600, 0x8004, 0x2090, 0x7204, 0x7008, 0xc09c, 0xa205,
1766 0x00c0, 0x45a2, 0x720c, 0x82ff, 0x0040, 0x459d, 0x8aff, 0x00c0, 1776 0x00c0, 0x4602, 0x720c, 0x82ff, 0x0040, 0x45ed, 0x8aff, 0x00c0,
1767 0x45a2, 0x7200, 0xd284, 0x00c0, 0x45a2, 0x7003, 0x0008, 0x127f, 1777 0x4602, 0x7200, 0xd284, 0x00c0, 0x4602, 0x7804, 0xd0cc, 0x0040,
1778 0x45f3, 0x1078, 0x4acc, 0x7023, 0x0000, 0x7027, 0x0000, 0x7000,
1779 0xd084, 0x0040, 0x45fd, 0x7007, 0x0004, 0x7003, 0x0008, 0x127f,
1768 0x2000, 0x007c, 0x7000, 0xa084, 0x0003, 0x7002, 0xc69c, 0xd084, 1780 0x2000, 0x007c, 0x7000, 0xa084, 0x0003, 0x7002, 0xc69c, 0xd084,
1769 0x0040, 0x45e5, 0x7108, 0x0005, 0x7008, 0xa106, 0x00c0, 0x45aa, 1781 0x0040, 0x465b, 0x7108, 0x0005, 0x7008, 0xa106, 0x00c0, 0x460a,
1770 0xa184, 0x0003, 0x0040, 0x4616, 0xa184, 0x01e0, 0x00c0, 0x4616, 1782 0xa184, 0x0003, 0x0040, 0x468c, 0xa184, 0x01e0, 0x00c0, 0x468c,
1771 0xd1f4, 0x00c0, 0x45aa, 0xa184, 0x3000, 0xa086, 0x1000, 0x0040, 1783 0xd1f4, 0x00c0, 0x460a, 0xa184, 0x3000, 0xa086, 0x1000, 0x0040,
1772 0x45aa, 0x2011, 0x0180, 0x710c, 0x8211, 0x0040, 0x45cf, 0x7008, 1784 0x460a, 0x2001, 0x4f05, 0x2004, 0xd0e4, 0x0040, 0x4637, 0x2011,
1773 0xd0f4, 0x00c0, 0x45aa, 0x700c, 0xa106, 0x0040, 0x45c4, 0x7007, 1785 0x0180, 0x710c, 0x8211, 0x0040, 0x4645, 0x7008, 0xd0f4, 0x00c0,
1774 0x0012, 0x7108, 0x0005, 0x7008, 0xa106, 0x00c0, 0x45d1, 0xa184, 1786 0x460a, 0x700c, 0xa106, 0x0040, 0x462a, 0x0078, 0x4627, 0x2011,
1775 0x0003, 0x0040, 0x4616, 0xd194, 0x0040, 0x45d1, 0xd1f4, 0x0040, 1787 0x0180, 0x710c, 0x8211, 0x0040, 0x4645, 0x7008, 0xd0f4, 0x00c0,
1776 0x4616, 0x7007, 0x0002, 0x0078, 0x45aa, 0x7108, 0xd1fc, 0x0040, 1788 0x460a, 0x700c, 0xa106, 0x0040, 0x463a, 0x7007, 0x0012, 0x7108,
1777 0x45f0, 0x1078, 0x4769, 0x8aff, 0x0040, 0x458c, 0x0078, 0x45e5, 1789 0x0005, 0x7008, 0xa106, 0x00c0, 0x4647, 0xa184, 0x0003, 0x0040,
1778 0x700c, 0xa08c, 0x03ff, 0x0040, 0x461b, 0x7004, 0xd084, 0x0040, 1790 0x468c, 0xd194, 0x0040, 0x4647, 0xd1f4, 0x0040, 0x468c, 0x7007,
1779 0x460d, 0x7014, 0xa005, 0x00c0, 0x4609, 0x7010, 0x7310, 0xa306, 1791 0x0002, 0x0078, 0x460a, 0x7108, 0xd1fc, 0x0040, 0x4666, 0x1078,
1780 0x00c0, 0x45fd, 0x2300, 0xa005, 0x0040, 0x460d, 0xa102, 0x00c8, 1792 0x47ed, 0x8aff, 0x0040, 0x45dc, 0x0078, 0x465b, 0x700c, 0xa08c,
1781 0x45e5, 0x7007, 0x0010, 0x0078, 0x4616, 0x8aff, 0x0040, 0x461b, 1793 0x03ff, 0x0040, 0x4691, 0x7004, 0xd084, 0x0040, 0x4683, 0x7014,
1782 0x1078, 0x4970, 0x00c0, 0x4610, 0x0040, 0x45e5, 0x1078, 0x46b4, 1794 0xa005, 0x00c0, 0x467f, 0x7010, 0x7310, 0xa306, 0x00c0, 0x4673,
1783 0x127f, 0x2000, 0x007c, 0x7204, 0x7108, 0xc19c, 0x8103, 0x00c8, 1795 0x2300, 0xa005, 0x0040, 0x4683, 0xa102, 0x00c8, 0x465b, 0x7007,
1784 0x462a, 0x7007, 0x0002, 0x0078, 0x461b, 0x7003, 0x0008, 0x127f, 1796 0x0010, 0x0078, 0x468c, 0x8aff, 0x0040, 0x4691, 0x1078, 0x49f2,
1785 0x2000, 0x007c, 0xa205, 0x00c0, 0x4616, 0x7003, 0x0008, 0x127f, 1797 0x00c0, 0x4686, 0x0040, 0x465b, 0x1078, 0x4738, 0x127f, 0x2000,
1786 0x2000, 0x007c, 0x6428, 0x84ff, 0x0040, 0x465e, 0x2c70, 0x7004, 1798 0x007c, 0x7204, 0x7108, 0xc19c, 0x8103, 0x00c8, 0x46a0, 0x7007,
1787 0xa0bc, 0x000f, 0xa7b8, 0x466e, 0x273c, 0x87fb, 0x00c0, 0x464c, 1799 0x0002, 0x0078, 0x4691, 0x7003, 0x0008, 0x127f, 0x2000, 0x007c,
1788 0x0048, 0x4644, 0x1078, 0x296b, 0x609c, 0xa075, 0x0040, 0x465e, 1800 0xa205, 0x00c0, 0x468c, 0x7023, 0x0000, 0x7027, 0x0000, 0x7003,
1789 0x0078, 0x4637, 0x2039, 0x4663, 0x2704, 0xae68, 0x6808, 0xa630, 1801 0x0008, 0x007e, 0x2001, 0x4f01, 0x2004, 0xd0cc, 0x0040, 0x46b2,
1790 0x680c, 0xa529, 0x8421, 0x0040, 0x465e, 0x8738, 0x2704, 0xa005, 1802 0x1078, 0x4acc, 0x007f, 0x127f, 0x2000, 0x007c, 0x6428, 0x84ff,
1791 0x00c0, 0x464d, 0x709c, 0xa075, 0x00c0, 0x4637, 0x007c, 0x0000, 1803 0x0040, 0x46e2, 0x2c70, 0x7004, 0xa0bc, 0x000f, 0xa7b8, 0x46f2,
1792 0x0005, 0x0009, 0x000d, 0x0011, 0x0015, 0x0019, 0x001d, 0x0000, 1804 0x273c, 0x87fb, 0x00c0, 0x46d0, 0x0048, 0x46c8, 0x1078, 0x29b2,
1793 0x0003, 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0000, 0x4663, 1805 0x609c, 0xa075, 0x0040, 0x46e2, 0x0078, 0x46bb, 0x2039, 0x46e7,
1794 0x4660, 0x0000, 0x0000, 0x8000, 0x0000, 0x4663, 0x0000, 0x466b, 1806 0x2704, 0xae68, 0x6808, 0xa630, 0x680c, 0xa529, 0x8421, 0x0040,
1795 0x4668, 0x0000, 0x0000, 0x0000, 0x0000, 0x466b, 0x0000, 0x4666, 1807 0x46e2, 0x8738, 0x2704, 0xa005, 0x00c0, 0x46d1, 0x709c, 0xa075,
1796 0x4666, 0x0000, 0x0000, 0x8000, 0x0000, 0x4666, 0x0000, 0x466c, 1808 0x00c0, 0x46bb, 0x007c, 0x0000, 0x0005, 0x0009, 0x000d, 0x0011,
1797 0x466c, 0x0000, 0x0000, 0x0000, 0x0000, 0x466c, 0x2079, 0x4e00, 1809 0x0015, 0x0019, 0x001d, 0x0000, 0x0003, 0x0009, 0x000f, 0x0015,
1798 0x2071, 0x0010, 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, 0x0001, 1810 0x001b, 0x0000, 0x0000, 0x46e7, 0x46e4, 0x0000, 0x0000, 0x8000,
1799 0x7810, 0xd0ec, 0x0040, 0x46a2, 0x2009, 0x0001, 0x2071, 0x0020, 1811 0x0000, 0x46e7, 0x0000, 0x46ef, 0x46ec, 0x0000, 0x0000, 0x0000,
1800 0x0078, 0x46a6, 0x2009, 0x0002, 0x2071, 0x0050, 0x7007, 0x000a, 1812 0x0000, 0x46ef, 0x0000, 0x46ea, 0x46ea, 0x0000, 0x0000, 0x8000,
1801 0x7007, 0x0002, 0x7003, 0x0000, 0x8109, 0x0040, 0x46b3, 0x2071, 1813 0x0000, 0x46ea, 0x0000, 0x46f0, 0x46f0, 0x0000, 0x0000, 0x0000,
1802 0x0020, 0x0078, 0x46a6, 0x007c, 0x7004, 0x8004, 0x00c8, 0x473d, 1814 0x0000, 0x46f0, 0x2079, 0x4f00, 0x2071, 0x0010, 0x7007, 0x000a,
1803 0x7108, 0x7008, 0xa106, 0x00c0, 0x46b8, 0xa184, 0x01e0, 0x0040, 1815 0x7007, 0x0002, 0x7003, 0x0001, 0x7810, 0xd0ec, 0x0040, 0x4726,
1804 0x46c5, 0x1078, 0x47ac, 0x0078, 0x4765, 0x7007, 0x0012, 0x2019, 1816 0x2009, 0x0001, 0x2071, 0x0020, 0x0078, 0x472a, 0x2009, 0x0002,
1805 0x0000, 0x7108, 0x7008, 0xa106, 0x00c0, 0x46c9, 0xa184, 0x01e0, 1817 0x2071, 0x0050, 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, 0x0000,
1806 0x0040, 0x46d6, 0x1078, 0x47ac, 0x0078, 0x4765, 0x7810, 0xd0ec, 1818 0x8109, 0x0040, 0x4737, 0x2071, 0x0020, 0x0078, 0x472a, 0x007c,
1807 0x0040, 0x46f0, 0x2001, 0x04fd, 0x2004, 0xa086, 0x0003, 0x00c0, 1819 0x7004, 0x8004, 0x00c8, 0x47c1, 0x7108, 0x7008, 0xa106, 0x00c0,
1808 0x46f4, 0xa184, 0x4000, 0x0040, 0x46f8, 0xa382, 0x0003, 0x00c8, 1820 0x473c, 0xa184, 0x01e0, 0x0040, 0x4749, 0x1078, 0x4830, 0x0078,
1809 0x46f8, 0xa184, 0x0004, 0x0040, 0x46c9, 0x8318, 0x0078, 0x46c9, 1821 0x47e9, 0x7007, 0x0012, 0x2019, 0x0000, 0x7108, 0x7008, 0xa106,
1810 0x7814, 0xd0ec, 0x00c0, 0x46f8, 0xa184, 0x4000, 0x00c0, 0x46c9, 1822 0x00c0, 0x474d, 0xa184, 0x01e0, 0x0040, 0x475a, 0x1078, 0x4830,
1811 0xa19c, 0x300c, 0xa386, 0x2004, 0x0040, 0x4715, 0xa386, 0x0008, 1823 0x0078, 0x47e9, 0x7810, 0xd0ec, 0x0040, 0x4774, 0x2001, 0x04fd,
1812 0x0040, 0x4720, 0x7004, 0xd084, 0x00c0, 0x4711, 0x7108, 0x7008, 1824 0x2004, 0xa086, 0x0003, 0x00c0, 0x4778, 0xa184, 0x4000, 0x0040,
1813 0xa106, 0x00c0, 0x4706, 0xa184, 0x0003, 0x0040, 0x4711, 0x0078, 1825 0x477c, 0xa382, 0x0003, 0x00c8, 0x477c, 0xa184, 0x0004, 0x0040,
1814 0x47ac, 0xa386, 0x200c, 0x00c0, 0x46c9, 0x7200, 0x8204, 0x0048, 1826 0x474d, 0x8318, 0x0078, 0x474d, 0x7814, 0xd0ec, 0x00c0, 0x477c,
1815 0x4720, 0x730c, 0xa384, 0x03ff, 0x0040, 0x4720, 0x1078, 0x296b, 1827 0xa184, 0x4000, 0x00c0, 0x474d, 0xa19c, 0x300c, 0xa386, 0x2004,
1816 0x7108, 0x7008, 0xa106, 0x00c0, 0x4720, 0xa184, 0x01e0, 0x0040, 1828 0x0040, 0x4799, 0xa386, 0x0008, 0x0040, 0x47a4, 0x7004, 0xd084,
1817 0x472d, 0x1078, 0x47ac, 0x0078, 0x4765, 0x7007, 0x0012, 0x7000, 1829 0x00c0, 0x4795, 0x7108, 0x7008, 0xa106, 0x00c0, 0x478a, 0xa184,
1818 0xd084, 0x00c0, 0x473d, 0x7310, 0x7014, 0xa305, 0x0040, 0x473d, 1830 0x0003, 0x0040, 0x4795, 0x0078, 0x4830, 0xa386, 0x200c, 0x00c0,
1819 0x710c, 0xa184, 0x03ff, 0x00c0, 0x46b4, 0x7108, 0x7008, 0xa106, 1831 0x474d, 0x7200, 0x8204, 0x0048, 0x47a4, 0x730c, 0xa384, 0x03ff,
1820 0x00c0, 0x473d, 0xa184, 0x01e0, 0x0040, 0x474a, 0x1078, 0x47ac, 1832 0x0040, 0x47a4, 0x1078, 0x29b2, 0x7108, 0x7008, 0xa106, 0x00c0,
1821 0x0078, 0x4765, 0x7007, 0x0012, 0x7007, 0x0008, 0x7004, 0xd09c, 1833 0x47a4, 0xa184, 0x01e0, 0x0040, 0x47b1, 0x1078, 0x4830, 0x0078,
1822 0x00c0, 0x474e, 0x7108, 0x7008, 0xa106, 0x00c0, 0x4752, 0xa184, 1834 0x47e9, 0x7007, 0x0012, 0x7000, 0xd084, 0x00c0, 0x47c1, 0x7310,
1823 0x01e0, 0x0040, 0x475f, 0x1078, 0x47ac, 0x0078, 0x4765, 0x7007, 1835 0x7014, 0xa305, 0x0040, 0x47c1, 0x710c, 0xa184, 0x03ff, 0x00c0,
1824 0x0012, 0x7108, 0x8103, 0x0048, 0x4752, 0x7003, 0x0008, 0x007c, 1836 0x4738, 0x7108, 0x7008, 0xa106, 0x00c0, 0x47c1, 0xa184, 0x01e0,
1825 0x7108, 0xa184, 0x01e0, 0x00c0, 0x47ac, 0x7108, 0xa184, 0x01e0, 1837 0x0040, 0x47ce, 0x1078, 0x4830, 0x0078, 0x47e9, 0x7007, 0x0012,
1826 0x00c0, 0x47ac, 0xa184, 0x0007, 0x0079, 0x4776, 0x4780, 0x4790, 1838 0x7007, 0x0008, 0x7004, 0xd09c, 0x00c0, 0x47d2, 0x7108, 0x7008,
1827 0x477e, 0x4790, 0x477e, 0x47ee, 0x477e, 0x47ec, 0x1078, 0x296b, 1839 0xa106, 0x00c0, 0x47d6, 0xa184, 0x01e0, 0x0040, 0x47e3, 0x1078,
1828 0x7004, 0xa084, 0x0010, 0xc08d, 0x7006, 0x8aff, 0x00c0, 0x478b, 1840 0x4830, 0x0078, 0x47e9, 0x7007, 0x0012, 0x7108, 0x8103, 0x0048,
1829 0x2049, 0x0000, 0x007c, 0x1078, 0x4970, 0x00c0, 0x478b, 0x007c, 1841 0x47d6, 0x7003, 0x0008, 0x007c, 0x7108, 0xa184, 0x01e0, 0x00c0,
1830 0x7004, 0xa084, 0x0010, 0xc08d, 0x7006, 0x7004, 0xd084, 0x00c0, 1842 0x4830, 0x7108, 0xa184, 0x01e0, 0x00c0, 0x4830, 0xa184, 0x0007,
1831 0x47a4, 0x7108, 0x7008, 0xa106, 0x00c0, 0x4799, 0xa184, 0x0003, 1843 0x0079, 0x47fa, 0x4804, 0x4814, 0x4802, 0x4814, 0x4802, 0x4872,
1832 0x0040, 0x47a4, 0x0078, 0x47ac, 0x8aff, 0x0040, 0x47ab, 0x1078, 1844 0x4802, 0x4870, 0x1078, 0x29b2, 0x7004, 0xa084, 0x0010, 0xc08d,
1833 0x4970, 0x00c0, 0x47a7, 0x007c, 0x7007, 0x0012, 0x7108, 0x00e0, 1845 0x7006, 0x8aff, 0x00c0, 0x480f, 0x2049, 0x0000, 0x007c, 0x1078,
1834 0x47af, 0x2091, 0x6000, 0x00e0, 0x47b3, 0x2091, 0x6000, 0x7007, 1846 0x49f2, 0x00c0, 0x480f, 0x007c, 0x7004, 0xa084, 0x0010, 0xc08d,
1835 0x0012, 0x7007, 0x0008, 0x7004, 0xd09c, 0x00c0, 0x47bb, 0x7007, 1847 0x7006, 0x7004, 0xd084, 0x00c0, 0x4828, 0x7108, 0x7008, 0xa106,
1836 0x0012, 0x7108, 0xd1fc, 0x00c0, 0x47bf, 0x7003, 0x0000, 0x7000, 1848 0x00c0, 0x481d, 0xa184, 0x0003, 0x0040, 0x4828, 0x0078, 0x4830,
1837 0xa005, 0x00c0, 0x47d3, 0x7004, 0xa005, 0x00c0, 0x47d3, 0x700c, 1849 0x8aff, 0x0040, 0x482f, 0x1078, 0x49f2, 0x00c0, 0x482b, 0x007c,
1838 0xa005, 0x0040, 0x47d5, 0x0078, 0x47b7, 0x2049, 0x0000, 0xb284, 1850 0x7007, 0x0012, 0x7108, 0x00e0, 0x4833, 0x2091, 0x6000, 0x00e0,
1839 0x0100, 0x0040, 0x47df, 0x2001, 0x0000, 0x0078, 0x47e1, 0x2001, 1851 0x4837, 0x2091, 0x6000, 0x7007, 0x0012, 0x7007, 0x0008, 0x7004,
1840 0x0001, 0x1078, 0x4212, 0x681b, 0x0002, 0x2051, 0x0000, 0x007c, 1852 0xd09c, 0x00c0, 0x483f, 0x7007, 0x0012, 0x7108, 0xd1fc, 0x00c0,
1841 0x1078, 0x296b, 0x1078, 0x296b, 0x1078, 0x4836, 0x7210, 0x7114, 1853 0x4843, 0x7003, 0x0000, 0x7000, 0xa005, 0x00c0, 0x4857, 0x7004,
1842 0x700c, 0xa09c, 0x03ff, 0x2800, 0xa300, 0xa211, 0xa189, 0x0000, 1854 0xa005, 0x00c0, 0x4857, 0x700c, 0xa005, 0x0040, 0x4859, 0x0078,
1843 0x1078, 0x4836, 0x2704, 0x2c58, 0xac60, 0x6308, 0x2200, 0xa322, 1855 0x483b, 0x2049, 0x0000, 0xb284, 0x0100, 0x0040, 0x4863, 0x2001,
1844 0x630c, 0x2100, 0xa31b, 0x2400, 0xa305, 0x0040, 0x4811, 0x00c8, 1856 0x0000, 0x0078, 0x4865, 0x2001, 0x0001, 0x1078, 0x4262, 0x681b,
1845 0x4811, 0x8412, 0x8210, 0x830a, 0xa189, 0x0000, 0x2b60, 0x0078, 1857 0x0002, 0x2051, 0x0000, 0x007c, 0x1078, 0x29b2, 0x1078, 0x29b2,
1846 0x47f8, 0x2b60, 0x8a07, 0x007e, 0x6004, 0xa084, 0x0008, 0x0040, 1858 0x1078, 0x48b9, 0x7210, 0x7114, 0x700c, 0xa09c, 0x03ff, 0x2800,
1847 0x481d, 0xa7ba, 0x4668, 0x0078, 0x481f, 0xa7ba, 0x4660, 0x007f, 1859 0xa300, 0xa211, 0xa189, 0x0000, 0x1078, 0x48b9, 0x2704, 0x2c58,
1848 0xa73d, 0x2c00, 0x6886, 0x6f8a, 0x6c92, 0x6b8e, 0x7108, 0x7008, 1860 0xac60, 0x6308, 0x2200, 0xa322, 0x630c, 0x2100, 0xa31b, 0x2400,
1849 0xa106, 0x00c0, 0x4826, 0xa184, 0x01e0, 0x0040, 0x4831, 0x1078, 1861 0xa305, 0x0040, 0x4895, 0x00c8, 0x4895, 0x8412, 0x8210, 0x830a,
1850 0x47ac, 0x7007, 0x0012, 0x1078, 0x46b4, 0x007c, 0x8a50, 0x8739, 1862 0xa189, 0x0000, 0x2b60, 0x0078, 0x487c, 0x2b60, 0x8a07, 0x007e,
1851 0x2704, 0xa004, 0x00c0, 0x484a, 0x6000, 0xa064, 0x00c0, 0x4841, 1863 0x6004, 0xd09c, 0x0040, 0x48a0, 0xa7ba, 0x46ec, 0x0078, 0x48a2,
1852 0x2d60, 0x6004, 0xa084, 0x000f, 0xa080, 0x467e, 0x203c, 0x87fb, 1864 0xa7ba, 0x46e4, 0x007f, 0xa73d, 0x2c00, 0x6886, 0x6f8a, 0x6c92,
1853 0x1040, 0x296b, 0x007c, 0x127e, 0x0d7e, 0x70d4, 0xa084, 0x4600, 1865 0x6b8e, 0x7108, 0x7008, 0xa106, 0x00c0, 0x48a9, 0xa184, 0x01e0,
1854 0x8004, 0x2090, 0x0d7f, 0x6884, 0x2060, 0x6888, 0x6b8c, 0x6c90, 1866 0x0040, 0x48b4, 0x1078, 0x4830, 0x7007, 0x0012, 0x1078, 0x4738,
1855 0x8057, 0xaad4, 0x00ff, 0xa084, 0x00ff, 0x007e, 0x6804, 0xa084, 1867 0x007c, 0x8a50, 0x8739, 0x2704, 0xa004, 0x00c0, 0x48cd, 0x6000,
1856 0x0008, 0x007f, 0x0040, 0x4868, 0xa0b8, 0x4668, 0x0078, 0x486a, 1868 0xa064, 0x00c0, 0x48c4, 0x2d60, 0x6004, 0xa084, 0x000f, 0xa080,
1857 0xa0b8, 0x4660, 0xb284, 0x0100, 0x0040, 0x4871, 0x7e20, 0x0078, 1869 0x4702, 0x203c, 0x87fb, 0x1040, 0x29b2, 0x007c, 0x127e, 0x0d7e,
1858 0x4872, 0x7e24, 0xa6b5, 0x000c, 0x681c, 0xd0b4, 0x0040, 0x4879, 1870 0x70d4, 0xa084, 0x4600, 0x8004, 0x2090, 0x0d7f, 0x6884, 0x2060,
1859 0xc685, 0x2400, 0xa305, 0x0040, 0x48a3, 0x2c58, 0x2704, 0x6104, 1871 0x6888, 0x6b8c, 0x6c90, 0x8057, 0xaad4, 0x00ff, 0xa084, 0x00ff,
1860 0xac60, 0x6000, 0xa400, 0x701a, 0x6004, 0xa301, 0x701e, 0xa184, 1872 0x007e, 0x6804, 0xa084, 0x0008, 0x007f, 0x0040, 0x48eb, 0xa0b8,
1861 0x0008, 0x0040, 0x4893, 0x6010, 0xa081, 0x0000, 0x7022, 0x6014, 1873 0x46ec, 0x0078, 0x48ed, 0xa0b8, 0x46e4, 0xb284, 0x0100, 0x0040,
1862 0xa081, 0x0000, 0x7026, 0x6208, 0x2400, 0xa202, 0x7012, 0x620c, 1874 0x48f4, 0x7e20, 0x0078, 0x48f5, 0x7e24, 0xa6b5, 0x000c, 0x681c,
1863 0x2300, 0xa203, 0x7016, 0x7602, 0x7007, 0x0001, 0x2b60, 0x1078, 1875 0xd0b4, 0x0040, 0x48fc, 0xc685, 0x2400, 0xa305, 0x0040, 0x4925,
1864 0x499b, 0x0078, 0x48a5, 0x1078, 0x4970, 0x00c0, 0x48a3, 0x127f, 1876 0x2c58, 0x2704, 0x6104, 0xac60, 0x6000, 0xa400, 0x701a, 0x6004,
1865 0x2000, 0x007c, 0x127e, 0x0d7e, 0x70d4, 0xa084, 0x4600, 0x8004, 1877 0xa301, 0x701e, 0xd19c, 0x0040, 0x4915, 0x6010, 0xa081, 0x0000,
1866 0x2090, 0x0d7f, 0x7007, 0x0004, 0x7004, 0xd094, 0x00c0, 0x48b4, 1878 0x7022, 0x6014, 0xa081, 0x0000, 0x7026, 0x6208, 0x2400, 0xa202,
1867 0x7003, 0x0008, 0x127f, 0x2000, 0x007c, 0x127e, 0x0d7e, 0x70d4, 1879 0x7012, 0x620c, 0x2300, 0xa203, 0x7016, 0x7602, 0x7007, 0x0001,
1868 0xa084, 0x4600, 0x8004, 0x007e, 0x2090, 0x007f, 0x0d7f, 0x7e20, 1880 0x2b60, 0x1078, 0x4a1c, 0x0078, 0x4927, 0x1078, 0x49f2, 0x00c0,
1869 0xb284, 0x0100, 0x00c0, 0x48cd, 0x7e24, 0xa6b5, 0x000c, 0x681c, 1881 0x4925, 0x127f, 0x2000, 0x007c, 0x127e, 0x0d7e, 0x70d4, 0xa084,
1870 0xd0ac, 0x00c0, 0x48d8, 0xc685, 0x7003, 0x0000, 0x7007, 0x0004, 1882 0x4600, 0x8004, 0x2090, 0x0d7f, 0x7007, 0x0004, 0x7004, 0xd094,
1871 0x6828, 0x2050, 0x2d60, 0x6004, 0xa0bc, 0x000f, 0xa7b8, 0x466e, 1883 0x00c0, 0x4936, 0x7003, 0x0008, 0x127f, 0x2000, 0x007c, 0x127e,
1872 0x273c, 0x87fb, 0x00c0, 0x48ee, 0x0048, 0x48e8, 0x1078, 0x296b,
1873 0x689c, 0xa065, 0x0040, 0x48f2, 0x0078, 0x48db, 0x1078, 0x4970,
1874 0x00c0, 0x48ee, 0x127f, 0x2000, 0x007c, 0x127e, 0x007e, 0x017e,
1875 0x0d7e, 0x70d4, 0xa084, 0x4600, 0x8004, 0x007e, 0x2090, 0x007f, 1884 0x0d7e, 0x70d4, 0xa084, 0x4600, 0x8004, 0x007e, 0x2090, 0x007f,
1876 0x7e20, 0xb284, 0x0100, 0x00c0, 0x4906, 0x7e24, 0x0d7f, 0x037f, 1885 0x0d7f, 0x7e20, 0xb284, 0x0100, 0x00c0, 0x494f, 0x7e24, 0xa6b5,
1877 0x047f, 0xa6b5, 0x000c, 0x681c, 0xd0b4, 0x0040, 0x4914, 0xc685, 1886 0x000c, 0x681c, 0xd0ac, 0x00c0, 0x495a, 0xc685, 0x7003, 0x0000,
1878 0x7003, 0x0000, 0x7007, 0x0004, 0x2049, 0x48f5, 0x6828, 0xa055, 1887 0x7007, 0x0004, 0x6828, 0x2050, 0x2d60, 0x6004, 0xa0bc, 0x000f,
1879 0x0d7e, 0x0040, 0x496c, 0x2d70, 0x2e60, 0x7004, 0xa0bc, 0x000f, 1888 0xa7b8, 0x46f2, 0x273c, 0x87fb, 0x00c0, 0x4970, 0x0048, 0x496a,
1880 0xa7b8, 0x466e, 0x273c, 0x87fb, 0x00c0, 0x4931, 0x0048, 0x492a, 1889 0x1078, 0x29b2, 0x689c, 0xa065, 0x0040, 0x4974, 0x0078, 0x495d,
1881 0x1078, 0x296b, 0x709c, 0xa075, 0x2060, 0x0040, 0x496c, 0x0078, 1890 0x1078, 0x49f2, 0x00c0, 0x4970, 0x127f, 0x2000, 0x007c, 0x127e,
1882 0x491d, 0x2704, 0xae68, 0x6808, 0xa422, 0x680c, 0xa31b, 0x0048, 1891 0x007e, 0x017e, 0x0d7e, 0x70d4, 0xa084, 0x4600, 0x8004, 0x007e,
1883 0x494a, 0x8a51, 0x00c0, 0x493e, 0x1078, 0x296b, 0x8738, 0x2704, 1892 0x2090, 0x007f, 0x7e20, 0xb284, 0x0100, 0x00c0, 0x4988, 0x7e24,
1884 0xa005, 0x00c0, 0x4932, 0x709c, 0xa075, 0x2060, 0x0040, 0x496c, 1893 0x0d7f, 0x037f, 0x047f, 0xa6b5, 0x000c, 0x681c, 0xd0b4, 0x0040,
1885 0x0078, 0x491d, 0x8422, 0x8420, 0x831a, 0xa399, 0x0000, 0x6908, 1894 0x4996, 0xc685, 0x7003, 0x0000, 0x7007, 0x0004, 0x2049, 0x4977,
1886 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x00c8, 0x4959, 0x1078, 1895 0x6828, 0xa055, 0x0d7e, 0x0040, 0x49ee, 0x2d70, 0x2e60, 0x7004,
1887 0x296b, 0xb284, 0x0100, 0x0040, 0x4967, 0x2001, 0x4e04, 0x2004, 1896 0xa0bc, 0x000f, 0xa7b8, 0x46f2, 0x273c, 0x87fb, 0x00c0, 0x49b3,
1888 0xd0ec, 0x00c0, 0x4967, 0x2071, 0x0050, 0x0078, 0x4969, 0x2071, 1897 0x0048, 0x49ac, 0x1078, 0x29b2, 0x709c, 0xa075, 0x2060, 0x0040,
1889 0x0020, 0x0d7f, 0x0078, 0x4879, 0x0d7f, 0x127f, 0x2000, 0x007c, 1898 0x49ee, 0x0078, 0x499f, 0x2704, 0xae68, 0x6808, 0xa422, 0x680c,
1890 0x7008, 0x007e, 0xa084, 0x01e0, 0x007f, 0x0040, 0x4979, 0xa006, 1899 0xa31b, 0x0048, 0x49cc, 0x8a51, 0x00c0, 0x49c0, 0x1078, 0x29b2,
1891 0x007c, 0xa084, 0x0003, 0xa086, 0x0003, 0x00c0, 0x4980, 0x007c, 1900 0x8738, 0x2704, 0xa005, 0x00c0, 0x49b4, 0x709c, 0xa075, 0x2060,
1892 0x2704, 0xac78, 0x7800, 0x701a, 0x7804, 0x701e, 0x7808, 0x7012, 1901 0x0040, 0x49ee, 0x0078, 0x499f, 0x8422, 0x8420, 0x831a, 0xa399,
1893 0x780c, 0x7016, 0x6004, 0xa084, 0x0008, 0x0040, 0x4993, 0x7810, 1902 0x0000, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300, 0xa11b, 0x00c8,
1894 0x7022, 0x7814, 0x7026, 0x7602, 0x7004, 0xa084, 0x0010, 0xc085, 1903 0x49db, 0x1078, 0x29b2, 0xb284, 0x0100, 0x0040, 0x49e9, 0x2001,
1895 0x7006, 0x2079, 0x4e00, 0x8a51, 0x0040, 0x49bf, 0x8738, 0x2704, 1904 0x4f04, 0x2004, 0xd0ec, 0x00c0, 0x49e9, 0x2071, 0x0050, 0x0078,
1896 0xa005, 0x00c0, 0x49b1, 0x609c, 0xa005, 0x0040, 0x49c0, 0x2060, 1905 0x49eb, 0x2071, 0x0020, 0x0d7f, 0x0078, 0x48fc, 0x0d7f, 0x127f,
1897 0x6004, 0xa084, 0x000f, 0xa080, 0x466e, 0x203c, 0x87fb, 0x1040, 1906 0x2000, 0x007c, 0x7008, 0x007e, 0xa084, 0x01e0, 0x007f, 0x0040,
1898 0x296b, 0x7008, 0x007e, 0xa084, 0x01e0, 0x007f, 0x0040, 0x49bb, 1907 0x49fb, 0xa006, 0x007c, 0xa084, 0x0003, 0xa086, 0x0003, 0x00c0,
1899 0xa006, 0x0078, 0x49c0, 0xa084, 0x0003, 0xa086, 0x0003, 0x007c, 1908 0x4a02, 0x007c, 0x2704, 0xac78, 0x7800, 0x701a, 0x7804, 0x701e,
1900 0x2051, 0x0000, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x70d4, 0xa084, 1909 0x7808, 0x7012, 0x780c, 0x7016, 0x6004, 0xd09c, 0x0040, 0x4a14,
1901 0x4600, 0x8004, 0x2090, 0x0d7f, 0x087f, 0x7108, 0xa184, 0x0003, 1910 0x7810, 0x7022, 0x7814, 0x7026, 0x7602, 0x7004, 0xa084, 0x0010,
1902 0x00c0, 0x49d8, 0x6828, 0xa005, 0x0040, 0x49e8, 0x0078, 0x45a2, 1911 0xc085, 0x7006, 0x2079, 0x4f00, 0x8738, 0x8a51, 0x0040, 0x4a40,
1903 0x7108, 0xd1fc, 0x0040, 0x49e0, 0x1078, 0x4769, 0x0078, 0x49cd, 1912 0x2704, 0xa005, 0x00c0, 0x4a32, 0x609c, 0xa005, 0x0040, 0x4a41,
1904 0x7007, 0x0010, 0x7108, 0xd1fc, 0x0040, 0x49e2, 0x1078, 0x4769, 1913 0x2060, 0x6004, 0xa084, 0x000f, 0xa080, 0x46f2, 0x203c, 0x87fb,
1905 0x7008, 0xa086, 0x0008, 0x00c0, 0x49cd, 0x7000, 0xa005, 0x00c0, 1914 0x1040, 0x29b2, 0x7008, 0x007e, 0xa084, 0x01e0, 0x007f, 0x0040,
1906 0x49cd, 0x7003, 0x0000, 0x2049, 0x0000, 0x127f, 0x2000, 0x007c, 1915 0x4a3c, 0xa006, 0x0078, 0x4a41, 0xa084, 0x0003, 0xa086, 0x0003,
1907 0x127e, 0x147e, 0x137e, 0x157e, 0x0c7e, 0x0d7e, 0x70d4, 0xa084, 1916 0x007c, 0x2051, 0x0000, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x70d4,
1908 0x4600, 0x8004, 0x2090, 0x0d7f, 0x2049, 0x49f8, 0xad80, 0x0011, 1917 0xa084, 0x4600, 0x8004, 0x2090, 0x0d7f, 0x087f, 0x7108, 0xa184,
1909 0x20a0, 0xb284, 0x0100, 0x0040, 0x4a1b, 0x2001, 0x4e04, 0x2004, 1918 0x0003, 0x00c0, 0x4a59, 0x6828, 0xa005, 0x0040, 0x4a69, 0x0078,
1910 0xd0ec, 0x0040, 0x4a17, 0x2099, 0x0031, 0x0078, 0x4a1d, 0x2099, 1919 0x4602, 0x7108, 0xd1fc, 0x0040, 0x4a61, 0x1078, 0x47ed, 0x0078,
1911 0x0032, 0x0078, 0x4a1d, 0x2099, 0x0031, 0x700c, 0xa084, 0x03ff, 1920 0x4a4e, 0x7007, 0x0010, 0x7108, 0xd1fc, 0x0040, 0x4a63, 0x1078,
1912 0x682a, 0x7007, 0x0008, 0x7007, 0x0002, 0x7003, 0x0001, 0x0040, 1921 0x47ed, 0x7008, 0xa086, 0x0008, 0x00c0, 0x4a4e, 0x7000, 0xa005,
1913 0x4a2c, 0x8000, 0x80ac, 0x53a5, 0x700c, 0xa084, 0x03ff, 0x0040, 1922 0x00c0, 0x4a4e, 0x7003, 0x0000, 0x2049, 0x0000, 0x007e, 0x7804,
1914 0x4a38, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x4a33, 1923 0xd0cc, 0x0040, 0x4a7d, 0x1078, 0x4acc, 0x007f, 0x127f, 0x2000,
1915 0x0c7f, 0x2049, 0x0000, 0x7003, 0x0000, 0x157f, 0x137f, 0x147f, 1924 0x007c, 0x127e, 0x147e, 0x137e, 0x157e, 0x0c7e, 0x0d7e, 0x70d4,
1916 0x127f, 0x2000, 0x007c, 0x2091, 0x8000, 0x2091, 0x6000, 0x78ac, 1925 0xa084, 0x4600, 0x8004, 0x2090, 0x0d7f, 0x2049, 0x4a81, 0xad80,
1917 0xa005, 0x00c0, 0x4a5a, 0x7974, 0x70d0, 0xa106, 0x00c0, 0x4a5a, 1926 0x0011, 0x20a0, 0xb284, 0x0100, 0x0040, 0x4aa4, 0x2001, 0x4f04,
1918 0x781c, 0xa005, 0x0040, 0x4a5a, 0x781f, 0x0000, 0x0068, 0x4a5a, 1927 0x2004, 0xd0ec, 0x0040, 0x4aa0, 0x2099, 0x0031, 0x0078, 0x4aa6,
1919 0x2091, 0x4080, 0x7830, 0x8001, 0x7832, 0x00c0, 0x4ae2, 0x7834, 1928 0x2099, 0x0032, 0x0078, 0x4aa6, 0x2099, 0x0031, 0x700c, 0xa084,
1920 0x7832, 0x7810, 0xd0ec, 0x00c0, 0x4adb, 0x2061, 0x73c0, 0x2069, 1929 0x03ff, 0x682a, 0x7007, 0x0008, 0x7007, 0x0002, 0x7003, 0x0001,
1921 0x4e80, 0xc7fd, 0x68d0, 0xa005, 0x0040, 0x4a74, 0x8001, 0x68d2, 1930 0x0040, 0x4ab5, 0x8000, 0x80ac, 0x53a5, 0x700c, 0xa084, 0x03ff,
1922 0x00c0, 0x4a74, 0x1078, 0x4cb0, 0x6800, 0xa084, 0x000f, 0x0040, 1931 0x0040, 0x4ac1, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0,
1923 0x4a89, 0xa086, 0x0001, 0x0040, 0x4a89, 0x6844, 0xa00d, 0x0040, 1932 0x4abc, 0x0c7f, 0x2049, 0x0000, 0x7003, 0x0000, 0x157f, 0x137f,
1924 0x4a89, 0x2104, 0xa005, 0x0040, 0x4a89, 0x8001, 0x200a, 0x0040, 1933 0x147f, 0x127f, 0x2000, 0x007c, 0x6814, 0xd0fc, 0x0040, 0x4b11,
1925 0x4c23, 0x6814, 0xa005, 0x0040, 0x4aae, 0x8001, 0x6816, 0x00c0, 1934 0x7000, 0xd084, 0x0040, 0x4b11, 0x7e24, 0xa6b5, 0x0004, 0x7007,
1926 0x4aae, 0x68a7, 0x0001, 0x0f7e, 0xd7fc, 0x00c0, 0x4aa3, 0x7810, 1935 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x4ad9, 0x7118, 0x017e,
1927 0xd0ec, 0x0040, 0x4a9f, 0x2079, 0x0100, 0x0078, 0x4aa5, 0x2079, 1936 0x711c, 0x017e, 0x7120, 0x017e, 0x7124, 0x017e, 0xa00e, 0x711a,
1928 0x0200, 0x0078, 0x4aa5, 0x2079, 0x0100, 0x1078, 0x4383, 0x0f7f, 1937 0x701f, 0x3fff, 0x7122, 0x7126, 0x7013, 0x0004, 0x7116, 0x7602,
1929 0x6864, 0xa005, 0x0040, 0x4aae, 0x1078, 0x2628, 0x6880, 0xa005, 1938 0x7007, 0x0001, 0x2001, 0xffff, 0x2009, 0x0031, 0x200a, 0x200a,
1930 0x0040, 0x4abb, 0x8001, 0x6882, 0x00c0, 0x4abb, 0x6867, 0x0000, 1939 0x7108, 0x7008, 0xa106, 0x00c0, 0x4af8, 0xd1fc, 0x0040, 0x4af8,
1931 0x68d4, 0xc0dd, 0x68d6, 0x68d4, 0xd0fc, 0x0040, 0x4ad8, 0xc0fc, 1940 0x027f, 0x7226, 0x027f, 0x7222, 0x027f, 0x721e, 0x027f, 0x721a,
1932 0x68d6, 0x20a9, 0x0200, 0x6034, 0xa005, 0x0040, 0x4ad4, 0x8001, 1941 0x7007, 0x0002, 0x7008, 0xa086, 0x0008, 0x0040, 0x4b11, 0x0078,
1933 0x6036, 0x68d4, 0xc0fd, 0x68d6, 0x00c0, 0x4ad4, 0x6010, 0xa005, 1942 0x4830, 0x7007, 0x0004, 0x7003, 0x0000, 0x007c, 0x2091, 0x8000,
1934 0x0040, 0x4ad4, 0x1078, 0x2628, 0xace0, 0x0010, 0x00f0, 0x4ac3, 1943 0x2091, 0x6000, 0x78ac, 0xa005, 0x00c0, 0x4b2d, 0x7974, 0x70d0,
1935 0xd7fc, 0x0040, 0x4ae2, 0x2061, 0x53c0, 0x2069, 0x4e40, 0xc7fc, 1944 0xa106, 0x00c0, 0x4b2d, 0x781c, 0xa005, 0x0040, 0x4b2d, 0x781f,
1936 0x0078, 0x4a6a, 0x1078, 0x4b1e, 0x7838, 0x8001, 0x783a, 0x00c0, 1945 0x0000, 0x0068, 0x4b2d, 0x2091, 0x4080, 0x7830, 0x8001, 0x7832,
1937 0x4b04, 0x783c, 0x783a, 0x2061, 0x53c0, 0x2069, 0x4e40, 0xc7fc, 1946 0x00c0, 0x4bb5, 0x7834, 0x7832, 0x7810, 0xd0ec, 0x00c0, 0x4bae,
1938 0x680c, 0xa005, 0x0040, 0x4af6, 0x1078, 0x4b88, 0xd7fc, 0x00c0, 1947 0x2061, 0x74c0, 0x2069, 0x4f80, 0xc7fd, 0x68d0, 0xa005, 0x0040,
1939 0x4b04, 0x7810, 0xd0ec, 0x00c0, 0x4b04, 0x2061, 0x73c0, 0x2069, 1948 0x4b47, 0x8001, 0x68d2, 0x00c0, 0x4b47, 0x1078, 0x4d83, 0x6800,
1940 0x4e80, 0xc7fd, 0x0078, 0x4af0, 0x7814, 0xd0e4, 0x00c0, 0x4b08, 1949 0xa084, 0x000f, 0x0040, 0x4b5c, 0xa086, 0x0001, 0x0040, 0x4b5c,
1941 0x7810, 0xd0cc, 0x0040, 0x4b1b, 0xd0ac, 0x00c0, 0x4b14, 0xd0a4, 1950 0x6844, 0xa00d, 0x0040, 0x4b5c, 0x2104, 0xa005, 0x0040, 0x4b5c,
1942 0x0040, 0x4b1b, 0xc0ad, 0x7812, 0x2091, 0x8001, 0x0068, 0x4b1a, 1951 0x8001, 0x200a, 0x0040, 0x4cf6, 0x6814, 0xa005, 0x0040, 0x4b81,
1943 0x1078, 0x2395, 0x007c, 0x2091, 0x8001, 0x007c, 0x7840, 0x8001, 1952 0x8001, 0x6816, 0x00c0, 0x4b81, 0x68a7, 0x0001, 0x0f7e, 0xd7fc,
1944 0x7842, 0x00c0, 0x4b87, 0x7844, 0x7842, 0x2069, 0x4e40, 0xc7fc, 1953 0x00c0, 0x4b76, 0x7810, 0xd0ec, 0x0040, 0x4b72, 0x2079, 0x0100,
1945 0x7810, 0x2079, 0x0200, 0xd0ec, 0x0040, 0x4b30, 0x2079, 0x0100, 1954 0x0078, 0x4b78, 0x2079, 0x0200, 0x0078, 0x4b78, 0x2079, 0x0100,
1946 0x68d8, 0xa005, 0x0040, 0x4b3c, 0x7de0, 0xa504, 0x00c0, 0x4b3c, 1955 0x1078, 0x43d3, 0x0f7f, 0x6864, 0xa005, 0x0040, 0x4b81, 0x1078,
1947 0x68da, 0x68d4, 0xc0bc, 0x68d6, 0x2079, 0x4e00, 0x6810, 0xa005, 1956 0x266f, 0x6880, 0xa005, 0x0040, 0x4b8e, 0x8001, 0x6882, 0x00c0,
1948 0x00c0, 0x4b44, 0x2001, 0x0101, 0x8001, 0x6812, 0xd7fc, 0x0040, 1957 0x4b8e, 0x6867, 0x0000, 0x68d4, 0xc0dd, 0x68d6, 0x68d4, 0xd0fc,
1949 0x4b4d, 0xa080, 0x94d0, 0x0078, 0x4b4f, 0xa080, 0x93c0, 0x2040, 1958 0x0040, 0x4bab, 0xc0fc, 0x68d6, 0x20a9, 0x0200, 0x6034, 0xa005,
1950 0x2004, 0xa065, 0x0040, 0x4b79, 0x6024, 0xa005, 0x0040, 0x4b75, 1959 0x0040, 0x4ba7, 0x8001, 0x6036, 0x68d4, 0xc0fd, 0x68d6, 0x00c0,
1951 0x8001, 0x6026, 0x00c0, 0x4b75, 0x6800, 0xa005, 0x0040, 0x4b68, 1960 0x4ba7, 0x6010, 0xa005, 0x0040, 0x4ba7, 0x1078, 0x266f, 0xace0,
1952 0x684c, 0xac06, 0x00c0, 0x4b68, 0x1078, 0x4c23, 0x0078, 0x4b79, 1961 0x0010, 0x00f0, 0x4b96, 0xd7fc, 0x0040, 0x4bb5, 0x2061, 0x54c0,
1953 0x6864, 0xa005, 0x0040, 0x4b70, 0x6027, 0x0001, 0x0078, 0x4b75, 1962 0x2069, 0x4f40, 0xc7fc, 0x0078, 0x4b3d, 0x1078, 0x4bf1, 0x7838,
1954 0x1078, 0x4bd6, 0x2804, 0x0078, 0x4b51, 0x6000, 0x2c40, 0x0078, 1963 0x8001, 0x783a, 0x00c0, 0x4bd7, 0x783c, 0x783a, 0x2061, 0x54c0,
1955 0x4b51, 0xd7fc, 0x00c0, 0x4b87, 0x7810, 0xd0ec, 0x00c0, 0x4b87, 1964 0x2069, 0x4f40, 0xc7fc, 0x680c, 0xa005, 0x0040, 0x4bc9, 0x1078,
1956 0x2069, 0x4e80, 0xc7fd, 0x2079, 0x0100, 0x0078, 0x4b30, 0x007c, 1965 0x4c5b, 0xd7fc, 0x00c0, 0x4bd7, 0x7810, 0xd0ec, 0x00c0, 0x4bd7,
1957 0x2009, 0x0000, 0x20a9, 0x0200, 0x6008, 0xd09c, 0x0040, 0x4bc2, 1966 0x2061, 0x74c0, 0x2069, 0x4f80, 0xc7fd, 0x0078, 0x4bc3, 0x7814,
1958 0x6024, 0xa005, 0x0040, 0x4b98, 0x8001, 0x6026, 0x0078, 0x4bc0, 1967 0xd0e4, 0x00c0, 0x4bdb, 0x7810, 0xd0cc, 0x0040, 0x4bee, 0xd0ac,
1959 0x6008, 0xc09c, 0xd084, 0x00c0, 0x4ba0, 0xd0ac, 0x0040, 0x4bba, 1968 0x00c0, 0x4be7, 0xd0a4, 0x0040, 0x4bee, 0xc0ad, 0x7812, 0x2091,
1960 0x600a, 0x6004, 0xa005, 0x0040, 0x4bc2, 0x0d7e, 0x0c7e, 0x017e, 1969 0x8001, 0x0068, 0x4bed, 0x1078, 0x23dc, 0x007c, 0x2091, 0x8001,
1961 0x2068, 0x6010, 0x8001, 0x6012, 0x1078, 0x3dd0, 0x2d00, 0x2c68, 1970 0x007c, 0x7840, 0x8001, 0x7842, 0x00c0, 0x4c5a, 0x7844, 0x7842,
1962 0x2060, 0x1078, 0x1e5b, 0x1078, 0x201d, 0x017f, 0x0c7f, 0x0d7f, 1971 0x2069, 0x4f40, 0xc7fc, 0x7810, 0x2079, 0x0200, 0xd0ec, 0x0040,
1963 0x0078, 0x4bc2, 0xc0bd, 0x600a, 0xa18d, 0x0001, 0x0078, 0x4bc2, 1972 0x4c03, 0x2079, 0x0100, 0x68d8, 0xa005, 0x0040, 0x4c0f, 0x7de0,
1964 0xa18d, 0x0100, 0xace0, 0x0010, 0x00f0, 0x4b8c, 0xa184, 0x0001, 1973 0xa504, 0x00c0, 0x4c0f, 0x68da, 0x68d4, 0xc0bc, 0x68d6, 0x2079,
1965 0x0040, 0x4bd1, 0xa18c, 0xfffe, 0x690e, 0x1078, 0x2628, 0x0078, 1974 0x4f00, 0x6810, 0xa005, 0x00c0, 0x4c17, 0x2001, 0x0101, 0x8001,
1966 0x4bd2, 0x690e, 0x007c, 0x00c0, 0x4bd2, 0x786c, 0x2c00, 0x687e, 1975 0x6812, 0xd7fc, 0x0040, 0x4c20, 0xa080, 0x95d0, 0x0078, 0x4c22,
1967 0x6714, 0x6f76, 0x6017, 0x0000, 0x602b, 0x0000, 0x601b, 0x0006, 1976 0xa080, 0x94c0, 0x2040, 0x2004, 0xa065, 0x0040, 0x4c4c, 0x6024,
1968 0x60b4, 0xa084, 0x3f00, 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085, 1977 0xa005, 0x0040, 0x4c48, 0x8001, 0x6026, 0x00c0, 0x4c48, 0x6800,
1969 0x0060, 0x6022, 0x6000, 0x2042, 0x1078, 0x1de4, 0x6818, 0xa005, 1978 0xa005, 0x0040, 0x4c3b, 0x684c, 0xac06, 0x00c0, 0x4c3b, 0x1078,
1970 0x0040, 0x4bf4, 0x8001, 0x681a, 0x6808, 0xc0a4, 0x680a, 0x6810, 1979 0x4cf6, 0x0078, 0x4c4c, 0x6864, 0xa005, 0x0040, 0x4c43, 0x6027,
1971 0x7908, 0x8109, 0x790a, 0x8001, 0x00d0, 0x4c00, 0x1078, 0x296b, 1980 0x0001, 0x0078, 0x4c48, 0x1078, 0x4ca9, 0x2804, 0x0078, 0x4c24,
1972 0x6812, 0x00c0, 0x4c06, 0x7910, 0xc1a5, 0x7912, 0x602f, 0x0000, 1981 0x6000, 0x2c40, 0x0078, 0x4c24, 0xd7fc, 0x00c0, 0x4c5a, 0x7810,
1973 0x6033, 0x0000, 0x2c68, 0x1078, 0x202c, 0xd7fc, 0x00c0, 0x4c14, 1982 0xd0ec, 0x00c0, 0x4c5a, 0x2069, 0x4f80, 0xc7fd, 0x2079, 0x0100,
1974 0x2069, 0x4e40, 0x0078, 0x4c16, 0x2069, 0x4e80, 0x6910, 0xa184, 1983 0x0078, 0x4c03, 0x007c, 0x2009, 0x0000, 0x20a9, 0x0200, 0x6008,
1975 0x0100, 0x2001, 0x0006, 0x00c0, 0x4c20, 0x697a, 0x2001, 0x0004, 1984 0xd09c, 0x0040, 0x4c95, 0x6024, 0xa005, 0x0040, 0x4c6b, 0x8001,
1976 0x1078, 0x261c, 0x007c, 0x0d7e, 0x694c, 0x2160, 0xd7fc, 0x00c0, 1985 0x6026, 0x0078, 0x4c93, 0x6008, 0xc09c, 0xd084, 0x00c0, 0x4c73,
1977 0x4c35, 0x7810, 0xd0ec, 0x0040, 0x4c31, 0x2069, 0x0100, 0x0078, 1986 0xd0ac, 0x0040, 0x4c8d, 0x600a, 0x6004, 0xa005, 0x0040, 0x4c95,
1978 0x4c37, 0x2069, 0x0200, 0x0078, 0x4c37, 0x2069, 0x0100, 0x1078, 1987 0x0d7e, 0x0c7e, 0x017e, 0x2068, 0x6010, 0x8001, 0x6012, 0x1078,
1979 0x28df, 0x601b, 0x0006, 0x6858, 0xa084, 0x3f00, 0x601e, 0x6020, 1988 0x3e19, 0x2d00, 0x2c68, 0x2060, 0x1078, 0x1ea2, 0x1078, 0x2064,
1980 0xa084, 0x00ff, 0xa085, 0x0048, 0x6022, 0x602f, 0x0000, 0x6033, 1989 0x017f, 0x0c7f, 0x0d7f, 0x0078, 0x4c95, 0xc0bd, 0x600a, 0xa18d,
1981 0x0000, 0x6808, 0xa084, 0xfffd, 0x680a, 0x6830, 0xd0b4, 0x0040, 1990 0x0001, 0x0078, 0x4c95, 0xa18d, 0x0100, 0xace0, 0x0010, 0x00f0,
1982 0x4c69, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848, 0xd094, 0x0040, 1991 0x4c5f, 0xa184, 0x0001, 0x0040, 0x4ca4, 0xa18c, 0xfffe, 0x690e,
1983 0x4c5b, 0x00f0, 0x4c55, 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 1992 0x1078, 0x266f, 0x0078, 0x4ca5, 0x690e, 0x007c, 0x00c0, 0x4ca5,
1984 0xd084, 0x0040, 0x4c65, 0x00f0, 0x4c5f, 0x20a9, 0x00fa, 0x00f0, 1993 0x786c, 0x2c00, 0x687e, 0x6714, 0x6f76, 0x6017, 0x0000, 0x602b,
1985 0x4c67, 0x681b, 0x0047, 0x0d7f, 0x6867, 0x0007, 0x007c, 0x2079, 1994 0x0000, 0x601b, 0x0006, 0x60b4, 0xa084, 0x3f00, 0x601e, 0x6020,
1986 0x4e00, 0x1078, 0x4ca3, 0x1078, 0x4c89, 0x1078, 0x4c96, 0x2009, 1995 0xa084, 0x00ff, 0xa085, 0x0060, 0x6022, 0x6000, 0x2042, 0x1078,
1987 0x0002, 0x2069, 0x4e80, 0x680f, 0x0000, 0x6813, 0x0000, 0x6817, 1996 0x1e2b, 0x6818, 0xa005, 0x0040, 0x4cc7, 0x8001, 0x681a, 0x6808,
1988 0x0000, 0x8109, 0x0040, 0x4c88, 0x2069, 0x4e40, 0x0078, 0x4c7b, 1997 0xc0a4, 0x680a, 0x6810, 0x7908, 0x8109, 0x790a, 0x8001, 0x00d0,
1989 0x007c, 0x7810, 0xd0ec, 0x0040, 0x4c91, 0x2019, 0x00cc, 0x0078, 1998 0x4cd3, 0x1078, 0x29b2, 0x6812, 0x00c0, 0x4cd9, 0x7910, 0xc1a5,
1990 0x4c93, 0x2019, 0x007b, 0x7b3a, 0x7b3e, 0x007c, 0x7814, 0xd0e4, 1999 0x7912, 0x602f, 0x0000, 0x6033, 0x0000, 0x2c68, 0x1078, 0x2073,
1991 0x00c0, 0x4c9e, 0x2019, 0x0040, 0x0078, 0x4ca0, 0x2019, 0x0026, 2000 0xd7fc, 0x00c0, 0x4ce7, 0x2069, 0x4f40, 0x0078, 0x4ce9, 0x2069,
1992 0x7b42, 0x7b46, 0x007c, 0x7814, 0xd0e4, 0x00c0, 0x4cab, 0x2019, 2001 0x4f80, 0x6910, 0xa184, 0x0100, 0x2001, 0x0006, 0x00c0, 0x4cf3,
1993 0x3f94, 0x0078, 0x4cad, 0x2019, 0x2624, 0x7b32, 0x7b36, 0x007c, 2002 0x697a, 0x2001, 0x0004, 0x1078, 0x2663, 0x007c, 0x0d7e, 0x694c,
1994 0x6a50, 0xa285, 0x0000, 0x0040, 0x4cdc, 0x6954, 0x6bc0, 0xa300, 2003 0x2160, 0xd7fc, 0x00c0, 0x4d08, 0x7810, 0xd0ec, 0x0040, 0x4d04,
1995 0x0c7e, 0x2164, 0x6304, 0x83ff, 0x00c0, 0x4cc8, 0x8211, 0x0040, 2004 0x2069, 0x0100, 0x0078, 0x4d0a, 0x2069, 0x0200, 0x0078, 0x4d0a,
1996 0x4ccc, 0x8108, 0xa11a, 0x0048, 0x4cb9, 0x69c0, 0x0078, 0x4cb9, 2005 0x2069, 0x0100, 0x1078, 0x2926, 0x601b, 0x0006, 0x6858, 0xa084,
1997 0x68d3, 0x000a, 0x0c7f, 0x007c, 0x6950, 0x6ac0, 0x2264, 0x602b, 2006 0x3f00, 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085, 0x0048, 0x6022,
1998 0x0000, 0x602f, 0x0000, 0x6008, 0xc0b5, 0x600a, 0x8210, 0x8109, 2007 0x602f, 0x0000, 0x6033, 0x0000, 0x6808, 0xa084, 0xfffd, 0x680a,
1999 0x00c0, 0x4cce, 0x6952, 0x0c7f, 0x007c, 0x00e0, 0x4cdd, 0x2091, 2008 0x6830, 0xd0b4, 0x0040, 0x4d3c, 0x684b, 0x0004, 0x20a9, 0x0014,
2000 0x6000, 0x00e0, 0x4ce1, 0x2091, 0x6000, 0x70ec, 0xd0dc, 0x00c0, 2009 0x6848, 0xd094, 0x0040, 0x4d2e, 0x00f0, 0x4d28, 0x684b, 0x0009,
2001 0x4cee, 0xd0d4, 0x0040, 0x4d17, 0x0078, 0x4d1a, 0x2008, 0x7810, 2010 0x20a9, 0x0014, 0x6848, 0xd084, 0x0040, 0x4d38, 0x00f0, 0x4d32,
2002 0xd0ec, 0x0040, 0x4d01, 0xd1c4, 0x00c0, 0x4d39, 0x7814, 0xc0c5, 2011 0x20a9, 0x00fa, 0x00f0, 0x4d3a, 0x681b, 0x0047, 0x0d7f, 0x6867,
2003 0x7816, 0x7810, 0xc0f5, 0x7812, 0xd0ec, 0x0040, 0x4d35, 0x0078, 2012 0x0007, 0x007c, 0x2079, 0x4f00, 0x1078, 0x4d76, 0x1078, 0x4d5c,
2004 0x4d31, 0xae8e, 0x0100, 0x0040, 0x4d0e, 0x7814, 0xc0f5, 0xc0c5, 2013 0x1078, 0x4d69, 0x2009, 0x0002, 0x2069, 0x4f80, 0x680f, 0x0000,
2005 0x7816, 0xd0d4, 0x00c0, 0x4d35, 0x0078, 0x4d31, 0x7814, 0xc0fd, 2014 0x6813, 0x0000, 0x6817, 0x0000, 0x8109, 0x0040, 0x4d5b, 0x2069,
2006 0xc0c5, 0x7816, 0xd0d4, 0x00c0, 0x4d35, 0x0078, 0x4d31, 0xd0e4, 2015 0x4f40, 0x0078, 0x4d4e, 0x007c, 0x7810, 0xd0ec, 0x0040, 0x4d64,
2007 0x0040, 0x4d37, 0x00e0, 0x4d1a, 0x2091, 0x6000, 0x2009, 0x000c, 2016 0x2019, 0x00cc, 0x0078, 0x4d66, 0x2019, 0x007b, 0x7b3a, 0x7b3e,
2008 0x00e0, 0x4d20, 0x2091, 0x6000, 0x8109, 0x00c0, 0x4d20, 0x70e4, 2017 0x007c, 0x7814, 0xd0e4, 0x00c0, 0x4d71, 0x2019, 0x0040, 0x0078,
2009 0xa084, 0x01ff, 0xa086, 0x01ff, 0x00c0, 0x4d31, 0x70ec, 0x0078, 2018 0x4d73, 0x2019, 0x0026, 0x7b42, 0x7b46, 0x007c, 0x7814, 0xd0e4,
2010 0x4cee, 0x7804, 0xd08c, 0x0040, 0x4d37, 0x681f, 0x000c, 0x70a0, 2019 0x00c0, 0x4d7e, 0x2019, 0x3f94, 0x0078, 0x4d80, 0x2019, 0x2624,
2011 0x70a2, 0x007c, 0x205b 2020 0x7b32, 0x7b36, 0x007c, 0x6a50, 0xa285, 0x0000, 0x0040, 0x4daf,
2021 0x6954, 0x6bc0, 0xa300, 0x0c7e, 0x2164, 0x6304, 0x83ff, 0x00c0,
2022 0x4d9b, 0x8211, 0x0040, 0x4d9f, 0x8108, 0xa11a, 0x0048, 0x4d8c,
2023 0x69c0, 0x0078, 0x4d8c, 0x68d3, 0x000a, 0x0c7f, 0x007c, 0x6950,
2024 0x6ac0, 0x2264, 0x602b, 0x0000, 0x602f, 0x0000, 0x6008, 0xc0b5,
2025 0x600a, 0x8210, 0x8109, 0x00c0, 0x4da1, 0x6952, 0x0c7f, 0x007c,
2026 0x00e0, 0x4db0, 0x2091, 0x6000, 0x00e0, 0x4db4, 0x2091, 0x6000,
2027 0x70ec, 0xd0dc, 0x00c0, 0x4dc1, 0xd0d4, 0x0040, 0x4dea, 0x0078,
2028 0x4ded, 0x2008, 0x7810, 0xd0ec, 0x0040, 0x4dd4, 0xd1c4, 0x00c0,
2029 0x4e0e, 0x7814, 0xc0c5, 0x7816, 0x7810, 0xc0f5, 0x7812, 0xd0ec,
2030 0x0040, 0x4e0a, 0x0078, 0x4e06, 0xae8e, 0x0100, 0x0040, 0x4de1,
2031 0x7814, 0xc0f5, 0xc0c5, 0x7816, 0xd0d4, 0x00c0, 0x4e0a, 0x0078,
2032 0x4e06, 0x7814, 0xc0fd, 0xc0c5, 0x7816, 0xd0d4, 0x00c0, 0x4e0a,
2033 0x0078, 0x4e06, 0xd0e4, 0x0040, 0x4e0c, 0x00e0, 0x4ded, 0x2091,
2034 0x6000, 0x2009, 0x000c, 0x00e0, 0x4df3, 0x2091, 0x6000, 0x8109,
2035 0x00c0, 0x4df3, 0x70e4, 0xa084, 0x01ff, 0xa086, 0x01ff, 0x00c0,
2036 0x4e04, 0x70ec, 0x0078, 0x4dc1, 0x1078, 0x4e0f, 0x7804, 0xd08c,
2037 0x0040, 0x4e0c, 0x681f, 0x000c, 0x70a0, 0x70a2, 0x007c, 0x7910,
2038 0xd1ec, 0x0040, 0x4e19, 0x7814, 0xc0c4, 0xc1f4, 0x7912, 0x0078,
2039 0x4e2b, 0xae8e, 0x0100, 0x0040, 0x4e25, 0x7814, 0xc0f4, 0xd0fc,
2040 0x00c0, 0x4e2b, 0xc0c4, 0x0078, 0x4e2b, 0x7814, 0xc0fc, 0xd0f4,
2041 0x00c0, 0x4e2b, 0xc0c4, 0x7816, 0x007c, 0x14e3
2012}; 2042};
2013#ifdef UNIQUE_FW_NAME 2043#ifdef UNIQUE_FW_NAME
2014static unsigned short fw1280ei_length01 = 0x3d3b; 2044static unsigned short fw1280ei_length01 = 0x3e2e;
2015#else 2045#else
2016static unsigned short risc_code_length01 = 0x3d3b; 2046static unsigned short risc_code_length01 = 0x3e2e;
2017#endif 2047#endif
2048
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 4ad280814990..1a4ce1c39478 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -1098,7 +1098,13 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
1098static int 1098static int
1099qla1280_eh_abort(struct scsi_cmnd * cmd) 1099qla1280_eh_abort(struct scsi_cmnd * cmd)
1100{ 1100{
1101 return qla1280_error_action(cmd, ABORT_COMMAND); 1101 int rc;
1102
1103 spin_lock_irq(cmd->device->host->host_lock);
1104 rc = qla1280_error_action(cmd, ABORT_COMMAND);
1105 spin_unlock_irq(cmd->device->host->host_lock);
1106
1107 return rc;
1102} 1108}
1103 1109
1104/************************************************************************** 1110/**************************************************************************
@@ -1108,7 +1114,13 @@ qla1280_eh_abort(struct scsi_cmnd * cmd)
1108static int 1114static int
1109qla1280_eh_device_reset(struct scsi_cmnd *cmd) 1115qla1280_eh_device_reset(struct scsi_cmnd *cmd)
1110{ 1116{
1111 return qla1280_error_action(cmd, DEVICE_RESET); 1117 int rc;
1118
1119 spin_lock_irq(cmd->device->host->host_lock);
1120 rc = qla1280_error_action(cmd, DEVICE_RESET);
1121 spin_unlock_irq(cmd->device->host->host_lock);
1122
1123 return rc;
1112} 1124}
1113 1125
1114/************************************************************************** 1126/**************************************************************************
@@ -1118,7 +1130,13 @@ qla1280_eh_device_reset(struct scsi_cmnd *cmd)
1118static int 1130static int
1119qla1280_eh_bus_reset(struct scsi_cmnd *cmd) 1131qla1280_eh_bus_reset(struct scsi_cmnd *cmd)
1120{ 1132{
1121 return qla1280_error_action(cmd, BUS_RESET); 1133 int rc;
1134
1135 spin_lock_irq(cmd->device->host->host_lock);
1136 rc = qla1280_error_action(cmd, BUS_RESET);
1137 spin_unlock_irq(cmd->device->host->host_lock);
1138
1139 return rc;
1122} 1140}
1123 1141
1124/************************************************************************** 1142/**************************************************************************
@@ -1128,7 +1146,13 @@ qla1280_eh_bus_reset(struct scsi_cmnd *cmd)
1128static int 1146static int
1129qla1280_eh_adapter_reset(struct scsi_cmnd *cmd) 1147qla1280_eh_adapter_reset(struct scsi_cmnd *cmd)
1130{ 1148{
1131 return qla1280_error_action(cmd, ADAPTER_RESET); 1149 int rc;
1150
1151 spin_lock_irq(cmd->device->host->host_lock);
1152 rc = qla1280_error_action(cmd, ADAPTER_RESET);
1153 spin_unlock_irq(cmd->device->host->host_lock);
1154
1155 return rc;
1132} 1156}
1133 1157
1134static int 1158static int
@@ -4038,11 +4062,10 @@ qla1280_status_entry(struct scsi_qla_host *ha, struct response *pkt,
4038 scsi_status, handle); 4062 scsi_status, handle);
4039 } 4063 }
4040 4064
4041 /* Target busy */ 4065 /* Target busy or queue full */
4042 if (scsi_status & SS_BUSY_CONDITION && 4066 if ((scsi_status & 0xFF) == SAM_STAT_TASK_SET_FULL ||
4043 scsi_status != SS_RESERVE_CONFLICT) { 4067 (scsi_status & 0xFF) == SAM_STAT_BUSY) {
4044 CMD_RESULT(cmd) = 4068 CMD_RESULT(cmd) = scsi_status & 0xff;
4045 DID_BUS_BUSY << 16 | (scsi_status & 0xff);
4046 } else { 4069 } else {
4047 4070
4048 /* Save ISP completion status */ 4071 /* Save ISP completion status */
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index c4cd4ac414c4..329d1a1fa547 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -1063,8 +1063,7 @@ qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd)
1063 return; 1063 return;
1064 1064
1065 printk(" sp flags=0x%x\n", sp->flags); 1065 printk(" sp flags=0x%x\n", sp->flags);
1066 printk(" r_start=0x%lx, u_start=0x%lx, f_start=0x%lx, state=%d\n", 1066 printk(" state=%d\n", sp->state);
1067 sp->r_start, sp->u_start, sp->f_start, sp->state);
1068} 1067}
1069 1068
1070#if defined(QL_DEBUG_ROUTINES) 1069#if defined(QL_DEBUG_ROUTINES)
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 7d47b8d92047..83a32e403e29 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -252,31 +252,12 @@ typedef struct srb {
252 /* Request state */ 252 /* Request state */
253 uint16_t state; 253 uint16_t state;
254 254
255 /* Timing counts. */
256 unsigned long e_start; /* Start of extend timeout */
257 unsigned long r_start; /* Start of request */
258 unsigned long u_start; /* When sent to RISC */
259 unsigned long f_start; /* When placed in FO queue*/
260
261 /* Single transfer DMA context */ 255 /* Single transfer DMA context */
262 dma_addr_t dma_handle; 256 dma_addr_t dma_handle;
263 257
264 uint32_t request_sense_length; 258 uint32_t request_sense_length;
265 uint8_t *request_sense_ptr; 259 uint8_t *request_sense_ptr;
266 260
267 int ext_history;
268
269 /* Suspend delay */
270 int delay;
271
272 /* Raw completion info for use by failover ? */
273 uint8_t fo_retry_cnt; /* Retry count this request */
274 uint8_t err_id; /* error id */
275#define SRB_ERR_PORT 1 /* Request failed -- "port down" */
276#define SRB_ERR_LOOP 2 /* Request failed -- "loop down" */
277#define SRB_ERR_DEVICE 3 /* Request failed -- "device error" */
278#define SRB_ERR_OTHER 4
279
280 /* SRB magic number */ 261 /* SRB magic number */
281 uint16_t magic; 262 uint16_t magic;
282#define SRB_MAGIC 0x10CB 263#define SRB_MAGIC 0x10CB
@@ -2082,23 +2063,8 @@ typedef struct scsi_qla_host {
2082 uint32_t current_outstanding_cmd; 2063 uint32_t current_outstanding_cmd;
2083 srb_t *status_srb; /* Status continuation entry. */ 2064 srb_t *status_srb; /* Status continuation entry. */
2084 2065
2085 unsigned long last_irq_cpu; /* cpu where we got our last irq */
2086
2087 uint16_t revision; 2066 uint16_t revision;
2088 uint8_t ports; 2067 uint8_t ports;
2089 u_long actthreads;
2090 u_long ipreq_cnt;
2091 u_long qthreads;
2092
2093 uint32_t total_isr_cnt; /* Interrupt count */
2094 uint32_t total_isp_aborts; /* controller err cnt */
2095 uint32_t total_lip_cnt; /* LIP cnt */
2096 uint32_t total_dev_errs; /* device error cnt */
2097 uint32_t total_ios; /* IO cnt */
2098 uint64_t total_bytes; /* xfr byte cnt */
2099 uint32_t total_mbx_timeout; /* mailbox timeout cnt */
2100 uint32_t total_loop_resync; /* loop resyn cnt */
2101 uint32_t dropped_frame_error_cnt;
2102 2068
2103 /* ISP configuration data. */ 2069 /* ISP configuration data. */
2104 uint16_t loop_id; /* Host adapter loop id */ 2070 uint16_t loop_id; /* Host adapter loop id */
@@ -2124,8 +2090,6 @@ typedef struct scsi_qla_host {
2124#define P2P_LOOP 3 2090#define P2P_LOOP 3
2125 2091
2126 uint8_t marker_needed; 2092 uint8_t marker_needed;
2127 uint8_t sns_retry_cnt;
2128 uint8_t mem_err;
2129 2093
2130 uint8_t interrupts_on; 2094 uint8_t interrupts_on;
2131 2095
@@ -2138,16 +2102,11 @@ typedef struct scsi_qla_host {
2138 uint16_t nvram_base; 2102 uint16_t nvram_base;
2139 2103
2140 uint16_t loop_reset_delay; 2104 uint16_t loop_reset_delay;
2141 uint16_t minimum_timeout;
2142 uint8_t retry_count; 2105 uint8_t retry_count;
2143 uint8_t login_timeout; 2106 uint8_t login_timeout;
2144 uint16_t r_a_tov; 2107 uint16_t r_a_tov;
2145 int port_down_retry_count; 2108 int port_down_retry_count;
2146 uint8_t loop_down_timeout;
2147 uint8_t mbx_count; 2109 uint8_t mbx_count;
2148 uint16_t max_probe_luns;
2149 uint16_t max_luns;
2150 uint16_t max_targets;
2151 uint16_t last_loop_id; 2110 uint16_t last_loop_id;
2152 2111
2153 uint32_t login_retry_count; 2112 uint32_t login_retry_count;
@@ -2181,7 +2140,6 @@ typedef struct scsi_qla_host {
2181 uint8_t dpc_active; /* DPC routine is active */ 2140 uint8_t dpc_active; /* DPC routine is active */
2182 2141
2183 /* Timeout timers. */ 2142 /* Timeout timers. */
2184 uint8_t queue_restart_timer;
2185 uint8_t loop_down_abort_time; /* port down timer */ 2143 uint8_t loop_down_abort_time; /* port down timer */
2186 atomic_t loop_down_timer; /* loop down timer */ 2144 atomic_t loop_down_timer; /* loop down timer */
2187 uint8_t link_down_timeout; /* link down timeout */ 2145 uint8_t link_down_timeout; /* link down timeout */
@@ -2230,18 +2188,6 @@ typedef struct scsi_qla_host {
2230 2188
2231 mbx_cmd_t mc; 2189 mbx_cmd_t mc;
2232 2190
2233 uint8_t *cmdline;
2234
2235 uint32_t failover_type;
2236 uint32_t failback_delay;
2237 unsigned long cfg_flags;
2238#define CFG_ACTIVE 0 /* CFG during a failover, event update, or ioctl */
2239#define CFG_FAILOVER 1 /* CFG during path change */
2240
2241 uint32_t binding_type;
2242#define BIND_BY_PORT_NAME 0
2243#define BIND_BY_PORT_ID 1
2244
2245 /* Basic firmware related information. */ 2191 /* Basic firmware related information. */
2246 struct qla_board_info *brd_info; 2192 struct qla_board_info *brd_info;
2247 uint16_t fw_major_version; 2193 uint16_t fw_major_version;
@@ -2274,12 +2220,6 @@ typedef struct scsi_qla_host {
2274 uint8_t nvram_version; 2220 uint8_t nvram_version;
2275 uint32_t isp_abort_cnt; 2221 uint32_t isp_abort_cnt;
2276 2222
2277 /* Adapter I/O statistics for failover */
2278 uint64_t IosRequested;
2279 uint64_t BytesRequested;
2280 uint64_t IosExecuted;
2281 uint64_t BytesExecuted;
2282
2283 /* Needed for BEACON */ 2223 /* Needed for BEACON */
2284 uint16_t beacon_blink_led; 2224 uint16_t beacon_blink_led;
2285 uint16_t beacon_green_on; 2225 uint16_t beacon_green_on;
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 2efec6c24d60..164866b199e6 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -53,27 +53,13 @@ extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *);
53 */ 53 */
54extern char qla2x00_version_str[]; 54extern char qla2x00_version_str[];
55 55
56extern int num_hosts;
57extern int apiHBAInstance;
58
59extern struct _qla2x00stats qla2x00_stats;
60extern int ql2xretrycount;
61extern int ql2xlogintimeout; 56extern int ql2xlogintimeout;
62extern int qlport_down_retry; 57extern int qlport_down_retry;
63extern int ql2xmaxqdepth;
64extern int displayConfig;
65extern int ql2xplogiabsentdevice; 58extern int ql2xplogiabsentdevice;
66extern int ql2xenablezio; 59extern int ql2xenablezio;
67extern int ql2xintrdelaytimer; 60extern int ql2xintrdelaytimer;
68extern int ql2xloginretrycount; 61extern int ql2xloginretrycount;
69 62
70extern int ConfigRequired;
71
72extern int Bind;
73extern int ql2xsuspendcount;
74#if defined(MODULE)
75extern char *ql2xopts;
76#endif
77extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *); 63extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *);
78 64
79extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *); 65extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 0387005fcb6d..7629558eba25 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -85,9 +85,7 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha)
85 atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); 85 atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
86 atomic_set(&ha->loop_state, LOOP_DOWN); 86 atomic_set(&ha->loop_state, LOOP_DOWN);
87 ha->device_flags = 0; 87 ha->device_flags = 0;
88 ha->sns_retry_cnt = 0;
89 ha->dpc_flags = 0; 88 ha->dpc_flags = 0;
90 ha->failback_delay = 0;
91 ha->flags.management_server_logged_in = 0; 89 ha->flags.management_server_logged_in = 0;
92 ha->marker_needed = 0; 90 ha->marker_needed = 0;
93 ha->mbx_flags = 0; 91 ha->mbx_flags = 0;
@@ -171,8 +169,6 @@ check_fw_ready_again:
171 169
172 if (wait_time == 0) 170 if (wait_time == 0)
173 rval = QLA_FUNCTION_FAILED; 171 rval = QLA_FUNCTION_FAILED;
174 if (ha->mem_err)
175 restart_risc = 1;
176 } else if (ha->device_flags & DFLG_NO_CABLE) 172 } else if (ha->device_flags & DFLG_NO_CABLE)
177 /* If no cable, then all is good. */ 173 /* If no cable, then all is good. */
178 rval = QLA_SUCCESS; 174 rval = QLA_SUCCESS;
@@ -1410,13 +1406,8 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
1410 /* Set minimum RATOV to 200 tenths of a second. */ 1406 /* Set minimum RATOV to 200 tenths of a second. */
1411 ha->r_a_tov = 200; 1407 ha->r_a_tov = 200;
1412 1408
1413 ha->minimum_timeout =
1414 (ha->login_timeout * ha->retry_count) + nv->port_down_retry_count;
1415 ha->loop_reset_delay = nv->reset_delay; 1409 ha->loop_reset_delay = nv->reset_delay;
1416 1410
1417 /* Will get the value from NVRAM. */
1418 ha->loop_down_timeout = LOOP_DOWN_TIMEOUT;
1419
1420 /* Link Down Timeout = 0: 1411 /* Link Down Timeout = 0:
1421 * 1412 *
1422 * When Port Down timer expires we will start returning 1413 * When Port Down timer expires we will start returning
@@ -1429,18 +1420,13 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
1429 */ 1420 */
1430 if (nv->link_down_timeout == 0) { 1421 if (nv->link_down_timeout == 0) {
1431 ha->loop_down_abort_time = 1422 ha->loop_down_abort_time =
1432 (LOOP_DOWN_TIME - ha->loop_down_timeout); 1423 (LOOP_DOWN_TIME - LOOP_DOWN_TIMEOUT);
1433 } else { 1424 } else {
1434 ha->link_down_timeout = nv->link_down_timeout; 1425 ha->link_down_timeout = nv->link_down_timeout;
1435 ha->loop_down_abort_time = 1426 ha->loop_down_abort_time =
1436 (LOOP_DOWN_TIME - ha->link_down_timeout); 1427 (LOOP_DOWN_TIME - ha->link_down_timeout);
1437 } 1428 }
1438 1429
1439 ha->max_luns = MAX_LUNS;
1440 ha->max_probe_luns = le16_to_cpu(nv->max_luns_per_target);
1441 if (ha->max_probe_luns == 0)
1442 ha->max_probe_luns = MIN_LUNS;
1443
1444 /* 1430 /*
1445 * Need enough time to try and get the port back. 1431 * Need enough time to try and get the port back.
1446 */ 1432 */
@@ -1457,16 +1443,6 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
1457 if (ql2xloginretrycount) 1443 if (ql2xloginretrycount)
1458 ha->login_retry_count = ql2xloginretrycount; 1444 ha->login_retry_count = ql2xloginretrycount;
1459 1445
1460 ha->binding_type = Bind;
1461 if (ha->binding_type != BIND_BY_PORT_NAME &&
1462 ha->binding_type != BIND_BY_PORT_ID) {
1463 qla_printk(KERN_WARNING, ha,
1464 "Invalid binding type specified (%d), "
1465 "defaulting to BIND_BY_PORT_NAME!!!\n", ha->binding_type);
1466
1467 ha->binding_type = BIND_BY_PORT_NAME;
1468 }
1469
1470 icb->lun_enables = __constant_cpu_to_le16(0); 1446 icb->lun_enables = __constant_cpu_to_le16(0);
1471 icb->command_resource_count = 0; 1447 icb->command_resource_count = 0;
1472 icb->immediate_notify_resource_count = 0; 1448 icb->immediate_notify_resource_count = 0;
@@ -1578,7 +1554,6 @@ qla2x00_configure_loop(scsi_qla_host_t *ha)
1578 */ 1554 */
1579 clear_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags); 1555 clear_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
1580 clear_bit(RSCN_UPDATE, &ha->dpc_flags); 1556 clear_bit(RSCN_UPDATE, &ha->dpc_flags);
1581 ha->mem_err = 0 ;
1582 1557
1583 /* Determine what we need to do */ 1558 /* Determine what we need to do */
1584 if (ha->current_topology == ISP_CFG_FL && 1559 if (ha->current_topology == ISP_CFG_FL &&
@@ -2707,7 +2682,6 @@ qla2x00_loop_resync(scsi_qla_host_t *ha)
2707 rval = QLA_SUCCESS; 2682 rval = QLA_SUCCESS;
2708 2683
2709 atomic_set(&ha->loop_state, LOOP_UPDATE); 2684 atomic_set(&ha->loop_state, LOOP_UPDATE);
2710 qla2x00_stats.loop_resync++;
2711 clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags); 2685 clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags);
2712 if (ha->flags.online) { 2686 if (ha->flags.online) {
2713 if (!(rval = qla2x00_fw_ready(ha))) { 2687 if (!(rval = qla2x00_fw_ready(ha))) {
@@ -2786,9 +2760,6 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
2786 if (ha->flags.online) { 2760 if (ha->flags.online) {
2787 ha->flags.online = 0; 2761 ha->flags.online = 0;
2788 clear_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); 2762 clear_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
2789 qla2x00_stats.ispAbort++;
2790 ha->total_isp_aborts++; /* used by ioctl */
2791 ha->sns_retry_cnt = 0;
2792 2763
2793 qla_printk(KERN_INFO, ha, 2764 qla_printk(KERN_INFO, ha,
2794 "Performing ISP error recovery - ha= %p.\n", ha); 2765 "Performing ISP error recovery - ha= %p.\n", ha);
@@ -2810,8 +2781,6 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
2810 sp = ha->outstanding_cmds[cnt]; 2781 sp = ha->outstanding_cmds[cnt];
2811 if (sp) { 2782 if (sp) {
2812 ha->outstanding_cmds[cnt] = NULL; 2783 ha->outstanding_cmds[cnt] = NULL;
2813 if (ha->actthreads)
2814 ha->actthreads--;
2815 sp->flags = 0; 2784 sp->flags = 0;
2816 sp->cmd->result = DID_RESET << 16; 2785 sp->cmd->result = DID_RESET << 16;
2817 sp->cmd->host_scribble = (unsigned char *)NULL; 2786 sp->cmd->host_scribble = (unsigned char *)NULL;
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index af964bb3d870..ecaf9f83b2d4 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -433,11 +433,8 @@ qla2x00_start_scsi(srb_t *sp)
433 } else 433 } else
434 ha->request_ring_ptr++; 434 ha->request_ring_ptr++;
435 435
436 ha->actthreads++;
437 ha->total_ios++;
438 sp->flags |= SRB_DMA_VALID; 436 sp->flags |= SRB_DMA_VALID;
439 sp->state = SRB_ACTIVE_STATE; 437 sp->state = SRB_ACTIVE_STATE;
440 sp->u_start = jiffies;
441 438
442 /* Set chip new ring index. */ 439 /* Set chip new ring index. */
443 WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index); 440 WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index);
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 6792cfae56e2..e7a8b74157a5 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -91,9 +91,6 @@ qla2100_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
91 } 91 }
92 spin_unlock_irqrestore(&ha->hardware_lock, flags); 92 spin_unlock_irqrestore(&ha->hardware_lock, flags);
93 93
94 ha->last_irq_cpu = _smp_processor_id();
95 ha->total_isr_cnt++;
96
97 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) && 94 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) &&
98 (status & MBX_INTERRUPT) && ha->flags.mbox_int) { 95 (status & MBX_INTERRUPT) && ha->flags.mbox_int) {
99 spin_lock_irqsave(&ha->mbx_reg_lock, flags); 96 spin_lock_irqsave(&ha->mbx_reg_lock, flags);
@@ -200,9 +197,6 @@ qla2300_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
200 } 197 }
201 spin_unlock_irqrestore(&ha->hardware_lock, flags); 198 spin_unlock_irqrestore(&ha->hardware_lock, flags);
202 199
203 ha->last_irq_cpu = _smp_processor_id();
204 ha->total_isr_cnt++;
205
206 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) && 200 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) &&
207 (status & MBX_INTERRUPT) && ha->flags.mbox_int) { 201 (status & MBX_INTERRUPT) && ha->flags.mbox_int) {
208 spin_lock_irqsave(&ha->mbx_reg_lock, flags); 202 spin_lock_irqsave(&ha->mbx_reg_lock, flags);
@@ -417,7 +411,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint32_t mbx)
417 /* Update AEN queue. */ 411 /* Update AEN queue. */
418 qla2x00_enqueue_aen(ha, MBA_LIP_OCCURRED, NULL); 412 qla2x00_enqueue_aen(ha, MBA_LIP_OCCURRED, NULL);
419 413
420 ha->total_lip_cnt++;
421 break; 414 break;
422 415
423 case MBA_LOOP_UP: /* Loop Up Event */ 416 case MBA_LOOP_UP: /* Loop Up Event */
@@ -485,7 +478,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint32_t mbx)
485 /* Update AEN queue. */ 478 /* Update AEN queue. */
486 qla2x00_enqueue_aen(ha, MBA_LIP_RESET, NULL); 479 qla2x00_enqueue_aen(ha, MBA_LIP_RESET, NULL);
487 480
488 ha->total_lip_cnt++;
489 break; 481 break;
490 482
491 case MBA_POINT_TO_POINT: /* Point-to-Point */ 483 case MBA_POINT_TO_POINT: /* Point-to-Point */
@@ -695,14 +687,11 @@ qla2x00_process_completed_request(struct scsi_qla_host *ha, uint32_t index)
695 /* Free outstanding command slot. */ 687 /* Free outstanding command slot. */
696 ha->outstanding_cmds[index] = NULL; 688 ha->outstanding_cmds[index] = NULL;
697 689
698 if (ha->actthreads)
699 ha->actthreads--;
700 CMD_COMPL_STATUS(sp->cmd) = 0L; 690 CMD_COMPL_STATUS(sp->cmd) = 0L;
701 CMD_SCSI_STATUS(sp->cmd) = 0L; 691 CMD_SCSI_STATUS(sp->cmd) = 0L;
702 692
703 /* Save ISP completion status */ 693 /* Save ISP completion status */
704 sp->cmd->result = DID_OK << 16; 694 sp->cmd->result = DID_OK << 16;
705 sp->fo_retry_cnt = 0;
706 qla2x00_sp_compl(ha, sp); 695 qla2x00_sp_compl(ha, sp);
707 } else { 696 } else {
708 DEBUG2(printk("scsi(%ld): Invalid ISP SCSI completion handle\n", 697 DEBUG2(printk("scsi(%ld): Invalid ISP SCSI completion handle\n",
@@ -865,9 +854,6 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
865 return; 854 return;
866 } 855 }
867 856
868 if (ha->actthreads)
869 ha->actthreads--;
870
871 comp_status = le16_to_cpu(pkt->comp_status); 857 comp_status = le16_to_cpu(pkt->comp_status);
872 /* Mask of reserved bits 12-15, before we examine the scsi status */ 858 /* Mask of reserved bits 12-15, before we examine the scsi status */
873 scsi_status = le16_to_cpu(pkt->scsi_status) & SS_MASK; 859 scsi_status = le16_to_cpu(pkt->scsi_status) & SS_MASK;
@@ -1026,7 +1012,6 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
1026 cp->request_bufflen)); 1012 cp->request_bufflen));
1027 1013
1028 cp->result = DID_BUS_BUSY << 16; 1014 cp->result = DID_BUS_BUSY << 16;
1029 ha->dropped_frame_error_cnt++;
1030 break; 1015 break;
1031 } 1016 }
1032 1017
@@ -1233,8 +1218,7 @@ qla2x00_error_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
1233 if (sp) { 1218 if (sp) {
1234 /* Free outstanding command slot. */ 1219 /* Free outstanding command slot. */
1235 ha->outstanding_cmds[pkt->handle] = NULL; 1220 ha->outstanding_cmds[pkt->handle] = NULL;
1236 if (ha->actthreads) 1221
1237 ha->actthreads--;
1238 /* Bad payload or header */ 1222 /* Bad payload or header */
1239 if (pkt->entry_status & 1223 if (pkt->entry_status &
1240 (RF_INV_E_ORDER | RF_INV_E_COUNT | 1224 (RF_INV_E_ORDER | RF_INV_E_COUNT |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 15f6acaca305..eeaec7c50e6a 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -219,10 +219,8 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
219 ha->flags.mbox_int = 0; 219 ha->flags.mbox_int = 0;
220 clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags); 220 clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
221 221
222 if (ha->mailbox_out[0] != MBS_COMMAND_COMPLETE) { 222 if (ha->mailbox_out[0] != MBS_COMMAND_COMPLETE)
223 qla2x00_stats.mboxerr++;
224 rval = QLA_FUNCTION_FAILED; 223 rval = QLA_FUNCTION_FAILED;
225 }
226 224
227 /* Load return mailbox registers. */ 225 /* Load return mailbox registers. */
228 iptr2 = mcp->mb; 226 iptr2 = mcp->mb;
@@ -249,8 +247,6 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
249 qla2x00_dump_regs(ha); 247 qla2x00_dump_regs(ha);
250#endif 248#endif
251 249
252 qla2x00_stats.mboxtout++;
253 ha->total_mbx_timeout++;
254 rval = QLA_FUNCTION_TIMEOUT; 250 rval = QLA_FUNCTION_TIMEOUT;
255 } 251 }
256 252
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 579448222d69..0b12498b7672 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -36,27 +36,12 @@ char qla2x00_version_str[40];
36/* 36/*
37 * SRB allocation cache 37 * SRB allocation cache
38 */ 38 */
39char srb_cachep_name[16]; 39static kmem_cache_t *srb_cachep;
40kmem_cache_t *srb_cachep;
41
42/*
43 * Stats for all adpaters.
44 */
45struct _qla2x00stats qla2x00_stats;
46 40
47/* 41/*
48 * Ioctl related information. 42 * Ioctl related information.
49 */ 43 */
50int num_hosts; 44static int num_hosts;
51int apiHBAInstance;
52
53/*
54 * Module parameter information and variables
55 */
56int ql2xmaxqdepth;
57module_param(ql2xmaxqdepth, int, S_IRUGO|S_IWUSR);
58MODULE_PARM_DESC(ql2xmaxqdepth,
59 "Maximum queue depth to report for target devices.");
60 45
61int ql2xlogintimeout = 20; 46int ql2xlogintimeout = 20;
62module_param(ql2xlogintimeout, int, S_IRUGO|S_IRUSR); 47module_param(ql2xlogintimeout, int, S_IRUGO|S_IRUSR);
@@ -69,12 +54,6 @@ MODULE_PARM_DESC(qlport_down_retry,
69 "Maximum number of command retries to a port that returns" 54 "Maximum number of command retries to a port that returns"
70 "a PORT-DOWN status."); 55 "a PORT-DOWN status.");
71 56
72int ql2xretrycount = 20;
73module_param(ql2xretrycount, int, S_IRUGO|S_IWUSR);
74MODULE_PARM_DESC(ql2xretrycount,
75 "Maximum number of mid-layer retries allowed for a command. "
76 "Default value is 20, ");
77
78int ql2xplogiabsentdevice; 57int ql2xplogiabsentdevice;
79module_param(ql2xplogiabsentdevice, int, S_IRUGO|S_IWUSR); 58module_param(ql2xplogiabsentdevice, int, S_IRUGO|S_IWUSR);
80MODULE_PARM_DESC(ql2xplogiabsentdevice, 59MODULE_PARM_DESC(ql2xplogiabsentdevice,
@@ -95,25 +74,6 @@ MODULE_PARM_DESC(ql2xintrdelaytimer,
95 "ZIO: Waiting time for Firmware before it generates an " 74 "ZIO: Waiting time for Firmware before it generates an "
96 "interrupt to the host to notify completion of request."); 75 "interrupt to the host to notify completion of request.");
97 76
98int ConfigRequired;
99module_param(ConfigRequired, int, S_IRUGO|S_IRUSR);
100MODULE_PARM_DESC(ConfigRequired,
101 "If 1, then only configured devices passed in through the"
102 "ql2xopts parameter will be presented to the OS");
103
104int Bind = BIND_BY_PORT_NAME;
105module_param(Bind, int, S_IRUGO|S_IRUSR);
106MODULE_PARM_DESC(Bind,
107 "Target persistent binding method: "
108 "0 by Portname (default); 1 by PortID; 2 by Nodename. ");
109
110int ql2xsuspendcount = SUSPEND_COUNT;
111module_param(ql2xsuspendcount, int, S_IRUGO|S_IWUSR);
112MODULE_PARM_DESC(ql2xsuspendcount,
113 "Number of 6-second suspend iterations to perform while a "
114 "target returns a <NOT READY> status. Default is 10 "
115 "iterations.");
116
117int ql2xloginretrycount = 0; 77int ql2xloginretrycount = 0;
118module_param(ql2xloginretrycount, int, S_IRUGO|S_IRUSR); 78module_param(ql2xloginretrycount, int, S_IRUGO|S_IRUSR);
119MODULE_PARM_DESC(ql2xloginretrycount, 79MODULE_PARM_DESC(ql2xloginretrycount,
@@ -330,7 +290,6 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
330 sp->fcport = fcport; 290 sp->fcport = fcport;
331 sp->cmd = cmd; 291 sp->cmd = cmd;
332 sp->flags = 0; 292 sp->flags = 0;
333 sp->err_id = 0;
334 293
335 CMD_SP(cmd) = (void *)sp; 294 CMD_SP(cmd) = (void *)sp;
336 cmd->scsi_done = done; 295 cmd->scsi_done = done;
@@ -474,7 +433,6 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
474 433
475 while ((!atomic_read(&ha->loop_down_timer) && 434 while ((!atomic_read(&ha->loop_down_timer) &&
476 atomic_read(&ha->loop_state) == LOOP_DOWN) || 435 atomic_read(&ha->loop_state) == LOOP_DOWN) ||
477 test_bit(CFG_ACTIVE, &ha->cfg_flags) ||
478 atomic_read(&ha->loop_state) != LOOP_READY) { 436 atomic_read(&ha->loop_state) != LOOP_READY) {
479 msleep(1000); 437 msleep(1000);
480 if (time_after_eq(jiffies, loop_timeout)) { 438 if (time_after_eq(jiffies, loop_timeout)) {
@@ -507,6 +465,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
507 int ret, i; 465 int ret, i;
508 unsigned int id, lun; 466 unsigned int id, lun;
509 unsigned long serial; 467 unsigned long serial;
468 unsigned long flags;
510 469
511 if (!CMD_SP(cmd)) 470 if (!CMD_SP(cmd))
512 return FAILED; 471 return FAILED;
@@ -518,8 +477,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
518 serial = cmd->serial_number; 477 serial = cmd->serial_number;
519 478
520 /* Check active list for command command. */ 479 /* Check active list for command command. */
521 spin_unlock_irq(ha->host->host_lock); 480 spin_lock_irqsave(&ha->hardware_lock, flags);
522 spin_lock(&ha->hardware_lock);
523 for (i = 1; i < MAX_OUTSTANDING_COMMANDS; i++) { 481 for (i = 1; i < MAX_OUTSTANDING_COMMANDS; i++) {
524 sp = ha->outstanding_cmds[i]; 482 sp = ha->outstanding_cmds[i];
525 483
@@ -534,7 +492,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
534 sp->state)); 492 sp->state));
535 DEBUG3(qla2x00_print_scsi_cmd(cmd);) 493 DEBUG3(qla2x00_print_scsi_cmd(cmd);)
536 494
537 spin_unlock(&ha->hardware_lock); 495 spin_unlock_irqrestore(&ha->hardware_lock, flags);
538 if (qla2x00_abort_command(ha, sp)) { 496 if (qla2x00_abort_command(ha, sp)) {
539 DEBUG2(printk("%s(%ld): abort_command " 497 DEBUG2(printk("%s(%ld): abort_command "
540 "mbx failed.\n", __func__, ha->host_no)); 498 "mbx failed.\n", __func__, ha->host_no));
@@ -543,22 +501,20 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
543 "mbx success.\n", __func__, ha->host_no)); 501 "mbx success.\n", __func__, ha->host_no));
544 ret = SUCCESS; 502 ret = SUCCESS;
545 } 503 }
546 spin_lock(&ha->hardware_lock); 504 spin_lock_irqsave(&ha->hardware_lock, flags);
547 505
548 break; 506 break;
549 } 507 }
508 spin_unlock_irqrestore(&ha->hardware_lock, flags);
550 509
551 /* Wait for the command to be returned. */ 510 /* Wait for the command to be returned. */
552 if (ret == SUCCESS) { 511 if (ret == SUCCESS) {
553 spin_unlock(&ha->hardware_lock);
554 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) { 512 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) {
555 qla_printk(KERN_ERR, ha, 513 qla_printk(KERN_ERR, ha,
556 "scsi(%ld:%d:%d): Abort handler timed out -- %lx " 514 "scsi(%ld:%d:%d): Abort handler timed out -- %lx "
557 "%x.\n", ha->host_no, id, lun, serial, ret); 515 "%x.\n", ha->host_no, id, lun, serial, ret);
558 } 516 }
559 spin_lock(&ha->hardware_lock);
560 } 517 }
561 spin_lock_irq(ha->host->host_lock);
562 518
563 qla_printk(KERN_INFO, ha, 519 qla_printk(KERN_INFO, ha,
564 "scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no, 520 "scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no,
@@ -588,6 +544,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
588 int status; 544 int status;
589 srb_t *sp; 545 srb_t *sp;
590 struct scsi_cmnd *cmd; 546 struct scsi_cmnd *cmd;
547 unsigned long flags;
591 548
592 status = 0; 549 status = 0;
593 550
@@ -596,11 +553,11 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
596 * array 553 * array
597 */ 554 */
598 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { 555 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
599 spin_lock(&ha->hardware_lock); 556 spin_lock_irqsave(&ha->hardware_lock, flags);
600 sp = ha->outstanding_cmds[cnt]; 557 sp = ha->outstanding_cmds[cnt];
601 if (sp) { 558 if (sp) {
602 cmd = sp->cmd; 559 cmd = sp->cmd;
603 spin_unlock(&ha->hardware_lock); 560 spin_unlock_irqrestore(&ha->hardware_lock, flags);
604 if (cmd->device->id == t) { 561 if (cmd->device->id == t) {
605 if (!qla2x00_eh_wait_on_command(ha, cmd)) { 562 if (!qla2x00_eh_wait_on_command(ha, cmd)) {
606 status = 1; 563 status = 1;
@@ -608,7 +565,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
608 } 565 }
609 } 566 }
610 } else { 567 } else {
611 spin_unlock(&ha->hardware_lock); 568 spin_unlock_irqrestore(&ha->hardware_lock, flags);
612 } 569 }
613 } 570 }
614 return (status); 571 return (status);
@@ -657,12 +614,8 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
657 qla_printk(KERN_INFO, ha, 614 qla_printk(KERN_INFO, ha,
658 "scsi(%ld:%d:%d): DEVICE RESET ISSUED.\n", ha->host_no, id, lun); 615 "scsi(%ld:%d:%d): DEVICE RESET ISSUED.\n", ha->host_no, id, lun);
659 616
660 spin_unlock_irq(ha->host->host_lock); 617 if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS)
661
662 if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) {
663 spin_lock_irq(ha->host->host_lock);
664 goto eh_dev_reset_done; 618 goto eh_dev_reset_done;
665 }
666 619
667 if (qla2x00_wait_for_loop_ready(ha) == QLA_SUCCESS) { 620 if (qla2x00_wait_for_loop_ready(ha) == QLA_SUCCESS) {
668 if (qla2x00_device_reset(ha, fcport) == 0) 621 if (qla2x00_device_reset(ha, fcport) == 0)
@@ -713,8 +666,6 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
713 "scsi(%ld:%d:%d): DEVICE RESET SUCCEEDED.\n", ha->host_no, id, lun); 666 "scsi(%ld:%d:%d): DEVICE RESET SUCCEEDED.\n", ha->host_no, id, lun);
714 667
715eh_dev_reset_done: 668eh_dev_reset_done:
716 spin_lock_irq(ha->host->host_lock);
717
718 return ret; 669 return ret;
719} 670}
720 671
@@ -740,6 +691,7 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
740 int status; 691 int status;
741 srb_t *sp; 692 srb_t *sp;
742 struct scsi_cmnd *cmd; 693 struct scsi_cmnd *cmd;
694 unsigned long flags;
743 695
744 status = 1; 696 status = 1;
745 697
@@ -748,17 +700,17 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
748 * array 700 * array
749 */ 701 */
750 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { 702 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
751 spin_lock(&ha->hardware_lock); 703 spin_lock_irqsave(&ha->hardware_lock, flags);
752 sp = ha->outstanding_cmds[cnt]; 704 sp = ha->outstanding_cmds[cnt];
753 if (sp) { 705 if (sp) {
754 cmd = sp->cmd; 706 cmd = sp->cmd;
755 spin_unlock(&ha->hardware_lock); 707 spin_unlock_irqrestore(&ha->hardware_lock, flags);
756 status = qla2x00_eh_wait_on_command(ha, cmd); 708 status = qla2x00_eh_wait_on_command(ha, cmd);
757 if (status == 0) 709 if (status == 0)
758 break; 710 break;
759 } 711 }
760 else { 712 else {
761 spin_unlock(&ha->hardware_lock); 713 spin_unlock_irqrestore(&ha->hardware_lock, flags);
762 } 714 }
763 } 715 }
764 return (status); 716 return (status);
@@ -803,8 +755,6 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
803 qla_printk(KERN_INFO, ha, 755 qla_printk(KERN_INFO, ha,
804 "scsi(%ld:%d:%d): LOOP RESET ISSUED.\n", ha->host_no, id, lun); 756 "scsi(%ld:%d:%d): LOOP RESET ISSUED.\n", ha->host_no, id, lun);
805 757
806 spin_unlock_irq(ha->host->host_lock);
807
808 if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) { 758 if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) {
809 DEBUG2(printk("%s failed:board disabled\n",__func__)); 759 DEBUG2(printk("%s failed:board disabled\n",__func__));
810 goto eh_bus_reset_done; 760 goto eh_bus_reset_done;
@@ -826,8 +776,6 @@ eh_bus_reset_done:
826 qla_printk(KERN_INFO, ha, "%s: reset %s\n", __func__, 776 qla_printk(KERN_INFO, ha, "%s: reset %s\n", __func__,
827 (ret == FAILED) ? "failed" : "succeded"); 777 (ret == FAILED) ? "failed" : "succeded");
828 778
829 spin_lock_irq(ha->host->host_lock);
830
831 return ret; 779 return ret;
832} 780}
833 781
@@ -869,8 +817,6 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
869 qla_printk(KERN_INFO, ha, 817 qla_printk(KERN_INFO, ha,
870 "scsi(%ld:%d:%d): ADAPTER RESET ISSUED.\n", ha->host_no, id, lun); 818 "scsi(%ld:%d:%d): ADAPTER RESET ISSUED.\n", ha->host_no, id, lun);
871 819
872 spin_unlock_irq(ha->host->host_lock);
873
874 if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) 820 if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS)
875 goto eh_host_reset_lock; 821 goto eh_host_reset_lock;
876 822
@@ -899,8 +845,6 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
899 ret = SUCCESS; 845 ret = SUCCESS;
900 846
901eh_host_reset_lock: 847eh_host_reset_lock:
902 spin_lock_irq(ha->host->host_lock);
903
904 qla_printk(KERN_INFO, ha, "%s: reset %s\n", __func__, 848 qla_printk(KERN_INFO, ha, "%s: reset %s\n", __func__,
905 (ret == FAILED) ? "failed" : "succeded"); 849 (ret == FAILED) ? "failed" : "succeded");
906 850
@@ -1148,7 +1092,7 @@ iospace_error_exit:
1148 */ 1092 */
1149int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info) 1093int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1150{ 1094{
1151 int ret; 1095 int ret = -ENODEV;
1152 device_reg_t __iomem *reg; 1096 device_reg_t __iomem *reg;
1153 struct Scsi_Host *host; 1097 struct Scsi_Host *host;
1154 scsi_qla_host_t *ha; 1098 scsi_qla_host_t *ha;
@@ -1159,7 +1103,7 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1159 fc_port_t *fcport; 1103 fc_port_t *fcport;
1160 1104
1161 if (pci_enable_device(pdev)) 1105 if (pci_enable_device(pdev))
1162 return -1; 1106 goto probe_out;
1163 1107
1164 host = scsi_host_alloc(&qla2x00_driver_template, 1108 host = scsi_host_alloc(&qla2x00_driver_template,
1165 sizeof(scsi_qla_host_t)); 1109 sizeof(scsi_qla_host_t));
@@ -1181,9 +1125,8 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1181 1125
1182 /* Configure PCI I/O space */ 1126 /* Configure PCI I/O space */
1183 ret = qla2x00_iospace_config(ha); 1127 ret = qla2x00_iospace_config(ha);
1184 if (ret != 0) { 1128 if (ret)
1185 goto probe_alloc_failed; 1129 goto probe_failed;
1186 }
1187 1130
1188 /* Sanitize the information from PCI BIOS. */ 1131 /* Sanitize the information from PCI BIOS. */
1189 host->irq = pdev->irq; 1132 host->irq = pdev->irq;
@@ -1194,34 +1137,24 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1194 1137
1195 spin_lock_init(&ha->hardware_lock); 1138 spin_lock_init(&ha->hardware_lock);
1196 1139
1197 /* 4.23 Initialize /proc/scsi/qla2x00 counters */
1198 ha->actthreads = 0;
1199 ha->qthreads = 0;
1200 ha->total_isr_cnt = 0;
1201 ha->total_isp_aborts = 0;
1202 ha->total_lip_cnt = 0;
1203 ha->total_dev_errs = 0;
1204 ha->total_ios = 0;
1205 ha->total_bytes = 0;
1206
1207 ha->prev_topology = 0; 1140 ha->prev_topology = 0;
1208 ha->ports = MAX_BUSES; 1141 ha->ports = MAX_BUSES;
1209 1142
1210 if (IS_QLA2100(ha)) { 1143 if (IS_QLA2100(ha)) {
1211 ha->max_targets = MAX_TARGETS_2100; 1144 host->max_id = MAX_TARGETS_2100;
1212 ha->mbx_count = MAILBOX_REGISTER_COUNT_2100; 1145 ha->mbx_count = MAILBOX_REGISTER_COUNT_2100;
1213 ha->request_q_length = REQUEST_ENTRY_CNT_2100; 1146 ha->request_q_length = REQUEST_ENTRY_CNT_2100;
1214 ha->response_q_length = RESPONSE_ENTRY_CNT_2100; 1147 ha->response_q_length = RESPONSE_ENTRY_CNT_2100;
1215 ha->last_loop_id = SNS_LAST_LOOP_ID_2100; 1148 ha->last_loop_id = SNS_LAST_LOOP_ID_2100;
1216 host->sg_tablesize = 32; 1149 host->sg_tablesize = 32;
1217 } else if (IS_QLA2200(ha)) { 1150 } else if (IS_QLA2200(ha)) {
1218 ha->max_targets = MAX_TARGETS_2200; 1151 host->max_id = MAX_TARGETS_2200;
1219 ha->mbx_count = MAILBOX_REGISTER_COUNT; 1152 ha->mbx_count = MAILBOX_REGISTER_COUNT;
1220 ha->request_q_length = REQUEST_ENTRY_CNT_2200; 1153 ha->request_q_length = REQUEST_ENTRY_CNT_2200;
1221 ha->response_q_length = RESPONSE_ENTRY_CNT_2100; 1154 ha->response_q_length = RESPONSE_ENTRY_CNT_2100;
1222 ha->last_loop_id = SNS_LAST_LOOP_ID_2100; 1155 ha->last_loop_id = SNS_LAST_LOOP_ID_2100;
1223 } else /*if (IS_QLA2300(ha))*/ { 1156 } else /*if (IS_QLA2300(ha))*/ {
1224 ha->max_targets = MAX_TARGETS_2200; 1157 host->max_id = MAX_TARGETS_2200;
1225 ha->mbx_count = MAILBOX_REGISTER_COUNT; 1158 ha->mbx_count = MAILBOX_REGISTER_COUNT;
1226 ha->request_q_length = REQUEST_ENTRY_CNT_2200; 1159 ha->request_q_length = REQUEST_ENTRY_CNT_2200;
1227 ha->response_q_length = RESPONSE_ENTRY_CNT_2300; 1160 ha->response_q_length = RESPONSE_ENTRY_CNT_2300;
@@ -1256,23 +1189,10 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1256 qla_printk(KERN_WARNING, ha, 1189 qla_printk(KERN_WARNING, ha,
1257 "[ERROR] Failed to allocate memory for adapter\n"); 1190 "[ERROR] Failed to allocate memory for adapter\n");
1258 1191
1259 goto probe_alloc_failed; 1192 ret = -ENOMEM;
1193 goto probe_failed;
1260 } 1194 }
1261 1195
1262 pci_set_drvdata(pdev, ha);
1263 host->this_id = 255;
1264 host->cmd_per_lun = 3;
1265 host->unique_id = ha->instance;
1266 host->max_cmd_len = MAX_CMDSZ;
1267 host->max_channel = ha->ports - 1;
1268 host->max_id = ha->max_targets;
1269 host->max_lun = ha->max_luns;
1270 host->transportt = qla2xxx_transport_template;
1271 if (scsi_add_host(host, &pdev->dev))
1272 goto probe_alloc_failed;
1273
1274 qla2x00_alloc_sysfs_attr(ha);
1275
1276 if (qla2x00_initialize_adapter(ha) && 1196 if (qla2x00_initialize_adapter(ha) &&
1277 !(ha->device_flags & DFLG_NO_CABLE)) { 1197 !(ha->device_flags & DFLG_NO_CABLE)) {
1278 1198
@@ -1283,11 +1203,10 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1283 "Adapter flags %x.\n", 1203 "Adapter flags %x.\n",
1284 ha->host_no, ha->device_flags)); 1204 ha->host_no, ha->device_flags));
1285 1205
1206 ret = -ENODEV;
1286 goto probe_failed; 1207 goto probe_failed;
1287 } 1208 }
1288 1209
1289 qla2x00_init_host_attr(ha);
1290
1291 /* 1210 /*
1292 * Startup the kernel thread for this host adapter 1211 * Startup the kernel thread for this host adapter
1293 */ 1212 */
@@ -1297,17 +1216,26 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1297 qla_printk(KERN_WARNING, ha, 1216 qla_printk(KERN_WARNING, ha,
1298 "Unable to start DPC thread!\n"); 1217 "Unable to start DPC thread!\n");
1299 1218
1219 ret = -ENODEV;
1300 goto probe_failed; 1220 goto probe_failed;
1301 } 1221 }
1302 wait_for_completion(&ha->dpc_inited); 1222 wait_for_completion(&ha->dpc_inited);
1303 1223
1224 host->this_id = 255;
1225 host->cmd_per_lun = 3;
1226 host->unique_id = ha->instance;
1227 host->max_cmd_len = MAX_CMDSZ;
1228 host->max_channel = ha->ports - 1;
1229 host->max_lun = MAX_LUNS;
1230 host->transportt = qla2xxx_transport_template;
1231
1304 if (IS_QLA2100(ha) || IS_QLA2200(ha)) 1232 if (IS_QLA2100(ha) || IS_QLA2200(ha))
1305 ret = request_irq(host->irq, qla2100_intr_handler, 1233 ret = request_irq(host->irq, qla2100_intr_handler,
1306 SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha); 1234 SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha);
1307 else 1235 else
1308 ret = request_irq(host->irq, qla2300_intr_handler, 1236 ret = request_irq(host->irq, qla2300_intr_handler,
1309 SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha); 1237 SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha);
1310 if (ret != 0) { 1238 if (ret) {
1311 qla_printk(KERN_WARNING, ha, 1239 qla_printk(KERN_WARNING, ha,
1312 "Failed to reserve interrupt %d already in use.\n", 1240 "Failed to reserve interrupt %d already in use.\n",
1313 host->irq); 1241 host->irq);
@@ -1361,9 +1289,18 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1361 msleep(10); 1289 msleep(10);
1362 } 1290 }
1363 1291
1292 pci_set_drvdata(pdev, ha);
1364 ha->flags.init_done = 1; 1293 ha->flags.init_done = 1;
1365 num_hosts++; 1294 num_hosts++;
1366 1295
1296 ret = scsi_add_host(host, &pdev->dev);
1297 if (ret)
1298 goto probe_failed;
1299
1300 qla2x00_alloc_sysfs_attr(ha);
1301
1302 qla2x00_init_host_attr(ha);
1303
1367 qla_printk(KERN_INFO, ha, "\n" 1304 qla_printk(KERN_INFO, ha, "\n"
1368 " QLogic Fibre Channel HBA Driver: %s\n" 1305 " QLogic Fibre Channel HBA Driver: %s\n"
1369 " QLogic %s - %s\n" 1306 " QLogic %s - %s\n"
@@ -1382,9 +1319,6 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1382probe_failed: 1319probe_failed:
1383 fc_remove_host(ha->host); 1320 fc_remove_host(ha->host);
1384 1321
1385 scsi_remove_host(host);
1386
1387probe_alloc_failed:
1388 qla2x00_free_device(ha); 1322 qla2x00_free_device(ha);
1389 1323
1390 scsi_host_put(host); 1324 scsi_host_put(host);
@@ -1392,7 +1326,8 @@ probe_alloc_failed:
1392probe_disable_device: 1326probe_disable_device:
1393 pci_disable_device(pdev); 1327 pci_disable_device(pdev);
1394 1328
1395 return -1; 1329probe_out:
1330 return ret;
1396} 1331}
1397EXPORT_SYMBOL_GPL(qla2x00_probe_one); 1332EXPORT_SYMBOL_GPL(qla2x00_probe_one);
1398 1333
@@ -2336,8 +2271,7 @@ static int __init
2336qla2x00_module_init(void) 2271qla2x00_module_init(void)
2337{ 2272{
2338 /* Allocate cache for SRBs. */ 2273 /* Allocate cache for SRBs. */
2339 sprintf(srb_cachep_name, "qla2xxx_srbs"); 2274 srb_cachep = kmem_cache_create("qla2xxx_srbs", sizeof(srb_t), 0,
2340 srb_cachep = kmem_cache_create(srb_cachep_name, sizeof(srb_t), 0,
2341 SLAB_HWCACHE_ALIGN, NULL, NULL); 2275 SLAB_HWCACHE_ALIGN, NULL, NULL);
2342 if (srb_cachep == NULL) { 2276 if (srb_cachep == NULL) {
2343 printk(KERN_ERR 2277 printk(KERN_ERR
@@ -2365,16 +2299,7 @@ qla2x00_module_init(void)
2365static void __exit 2299static void __exit
2366qla2x00_module_exit(void) 2300qla2x00_module_exit(void)
2367{ 2301{
2368 /* Free SRBs cache. */ 2302 kmem_cache_destroy(srb_cachep);
2369 if (srb_cachep != NULL) {
2370 if (kmem_cache_destroy(srb_cachep) != 0) {
2371 printk(KERN_ERR
2372 "qla2xxx: Unable to free SRB cache...Memory pools "
2373 "still active?\n");
2374 }
2375 srb_cachep = NULL;
2376 }
2377
2378 fc_release_transport(qla2xxx_transport_template); 2303 fc_release_transport(qla2xxx_transport_template);
2379} 2304}
2380 2305
diff --git a/drivers/scsi/qlogicfas.c b/drivers/scsi/qlogicfas.c
index a1adb38f69bb..55e698b651d6 100644
--- a/drivers/scsi/qlogicfas.c
+++ b/drivers/scsi/qlogicfas.c
@@ -191,8 +191,6 @@ static Scsi_Host_Template qlogicfas_driver_template = {
191 .queuecommand = qlogicfas408_queuecommand, 191 .queuecommand = qlogicfas408_queuecommand,
192 .eh_abort_handler = qlogicfas408_abort, 192 .eh_abort_handler = qlogicfas408_abort,
193 .eh_bus_reset_handler = qlogicfas408_bus_reset, 193 .eh_bus_reset_handler = qlogicfas408_bus_reset,
194 .eh_device_reset_handler= qlogicfas408_device_reset,
195 .eh_host_reset_handler = qlogicfas408_host_reset,
196 .bios_param = qlogicfas408_biosparam, 194 .bios_param = qlogicfas408_biosparam,
197 .can_queue = 1, 195 .can_queue = 1,
198 .this_id = -1, 196 .this_id = -1,
diff --git a/drivers/scsi/qlogicfas408.c b/drivers/scsi/qlogicfas408.c
index 5b6ce0a88f08..cb75e0b7baea 100644
--- a/drivers/scsi/qlogicfas408.c
+++ b/drivers/scsi/qlogicfas408.c
@@ -511,27 +511,15 @@ int qlogicfas408_abort(Scsi_Cmnd * cmd)
511int qlogicfas408_bus_reset(Scsi_Cmnd * cmd) 511int qlogicfas408_bus_reset(Scsi_Cmnd * cmd)
512{ 512{
513 struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd); 513 struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd);
514 priv->qabort = 2; 514 unsigned long flags;
515 ql_zap(priv);
516 return SUCCESS;
517}
518
519/*
520 * Reset SCSI host controller
521 */
522 515
523int qlogicfas408_host_reset(Scsi_Cmnd * cmd) 516 priv->qabort = 2;
524{
525 return FAILED;
526}
527 517
528/* 518 spin_lock_irqsave(cmd->device->host->host_lock, flags);
529 * Reset SCSI device 519 ql_zap(priv);
530 */ 520 spin_unlock_irqrestore(cmd->device->host->host_lock, flags);
531 521
532int qlogicfas408_device_reset(Scsi_Cmnd * cmd) 522 return SUCCESS;
533{
534 return FAILED;
535} 523}
536 524
537/* 525/*
@@ -626,8 +614,6 @@ EXPORT_SYMBOL(qlogicfas408_info);
626EXPORT_SYMBOL(qlogicfas408_queuecommand); 614EXPORT_SYMBOL(qlogicfas408_queuecommand);
627EXPORT_SYMBOL(qlogicfas408_abort); 615EXPORT_SYMBOL(qlogicfas408_abort);
628EXPORT_SYMBOL(qlogicfas408_bus_reset); 616EXPORT_SYMBOL(qlogicfas408_bus_reset);
629EXPORT_SYMBOL(qlogicfas408_device_reset);
630EXPORT_SYMBOL(qlogicfas408_host_reset);
631EXPORT_SYMBOL(qlogicfas408_biosparam); 617EXPORT_SYMBOL(qlogicfas408_biosparam);
632EXPORT_SYMBOL(qlogicfas408_ihandl); 618EXPORT_SYMBOL(qlogicfas408_ihandl);
633EXPORT_SYMBOL(qlogicfas408_get_chip_type); 619EXPORT_SYMBOL(qlogicfas408_get_chip_type);
diff --git a/drivers/scsi/qlogicfas408.h b/drivers/scsi/qlogicfas408.h
index f01cbd66c224..4b3df2003660 100644
--- a/drivers/scsi/qlogicfas408.h
+++ b/drivers/scsi/qlogicfas408.h
@@ -109,8 +109,6 @@ int qlogicfas408_biosparam(struct scsi_device * disk,
109 sector_t capacity, int ip[]); 109 sector_t capacity, int ip[]);
110int qlogicfas408_abort(Scsi_Cmnd * cmd); 110int qlogicfas408_abort(Scsi_Cmnd * cmd);
111int qlogicfas408_bus_reset(Scsi_Cmnd * cmd); 111int qlogicfas408_bus_reset(Scsi_Cmnd * cmd);
112int qlogicfas408_host_reset(Scsi_Cmnd * cmd);
113int qlogicfas408_device_reset(Scsi_Cmnd * cmd);
114const char *qlogicfas408_info(struct Scsi_Host *host); 112const char *qlogicfas408_info(struct Scsi_Host *host);
115int qlogicfas408_get_chip_type(int qbase, int int_type); 113int qlogicfas408_get_chip_type(int qbase, int int_type);
116void qlogicfas408_setup(int qbase, int id, int int_type); 114void qlogicfas408_setup(int qbase, int id, int int_type);
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c
index 69009f853a49..b0403ccd8a25 100644
--- a/drivers/scsi/sata_nv.c
+++ b/drivers/scsi/sata_nv.c
@@ -329,6 +329,8 @@ static void nv_host_stop (struct ata_host_set *host_set)
329 host->host_desc->disable_hotplug(host_set); 329 host->host_desc->disable_hotplug(host_set);
330 330
331 kfree(host); 331 kfree(host);
332
333 ata_host_stop(host_set);
332} 334}
333 335
334static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) 336static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c
index c4e9e0298122..5c1d4411457a 100644
--- a/drivers/scsi/sata_promise.c
+++ b/drivers/scsi/sata_promise.c
@@ -59,6 +59,7 @@ enum {
59 59
60 board_2037x = 0, /* FastTrak S150 TX2plus */ 60 board_2037x = 0, /* FastTrak S150 TX2plus */
61 board_20319 = 1, /* FastTrak S150 TX4 */ 61 board_20319 = 1, /* FastTrak S150 TX4 */
62 board_20619 = 2, /* FastTrak TX4000 */
62 63
63 PDC_HAS_PATA = (1 << 1), /* PDC20375 has PATA */ 64 PDC_HAS_PATA = (1 << 1), /* PDC20375 has PATA */
64 65
@@ -122,6 +123,7 @@ static struct ata_port_operations pdc_ata_ops = {
122 .scr_write = pdc_sata_scr_write, 123 .scr_write = pdc_sata_scr_write,
123 .port_start = pdc_port_start, 124 .port_start = pdc_port_start,
124 .port_stop = pdc_port_stop, 125 .port_stop = pdc_port_stop,
126 .host_stop = ata_host_stop,
125}; 127};
126 128
127static struct ata_port_info pdc_port_info[] = { 129static struct ata_port_info pdc_port_info[] = {
@@ -146,6 +148,17 @@ static struct ata_port_info pdc_port_info[] = {
146 .udma_mask = 0x7f, /* udma0-6 ; FIXME */ 148 .udma_mask = 0x7f, /* udma0-6 ; FIXME */
147 .port_ops = &pdc_ata_ops, 149 .port_ops = &pdc_ata_ops,
148 }, 150 },
151
152 /* board_20619 */
153 {
154 .sht = &pdc_ata_sht,
155 .host_flags = ATA_FLAG_NO_LEGACY | ATA_FLAG_SRST |
156 ATA_FLAG_MMIO | ATA_FLAG_SLAVE_POSS,
157 .pio_mask = 0x1f, /* pio0-4 */
158 .mwdma_mask = 0x07, /* mwdma0-2 */
159 .udma_mask = 0x7f, /* udma0-6 ; FIXME */
160 .port_ops = &pdc_ata_ops,
161 },
149}; 162};
150 163
151static struct pci_device_id pdc_ata_pci_tbl[] = { 164static struct pci_device_id pdc_ata_pci_tbl[] = {
@@ -171,6 +184,9 @@ static struct pci_device_id pdc_ata_pci_tbl[] = {
171 { PCI_VENDOR_ID_PROMISE, 0x3d18, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 184 { PCI_VENDOR_ID_PROMISE, 0x3d18, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
172 board_20319 }, 185 board_20319 },
173 186
187 { PCI_VENDOR_ID_PROMISE, 0x6629, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
188 board_20619 },
189
174 { } /* terminate list */ 190 { } /* terminate list */
175}; 191};
176 192
@@ -635,6 +651,15 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
635 case board_2037x: 651 case board_2037x:
636 probe_ent->n_ports = 2; 652 probe_ent->n_ports = 2;
637 break; 653 break;
654 case board_20619:
655 probe_ent->n_ports = 4;
656
657 pdc_ata_setup_port(&probe_ent->port[2], base + 0x300);
658 pdc_ata_setup_port(&probe_ent->port[3], base + 0x380);
659
660 probe_ent->port[2].scr_addr = base + 0x600;
661 probe_ent->port[3].scr_addr = base + 0x700;
662 break;
638 default: 663 default:
639 BUG(); 664 BUG();
640 break; 665 break;
@@ -675,7 +700,7 @@ static void __exit pdc_ata_exit(void)
675 700
676 701
677MODULE_AUTHOR("Jeff Garzik"); 702MODULE_AUTHOR("Jeff Garzik");
678MODULE_DESCRIPTION("Promise SATA TX2/TX4 low-level driver"); 703MODULE_DESCRIPTION("Promise ATA TX2/TX4/TX4000 low-level driver");
679MODULE_LICENSE("GPL"); 704MODULE_LICENSE("GPL");
680MODULE_DEVICE_TABLE(pci, pdc_ata_pci_tbl); 705MODULE_DEVICE_TABLE(pci, pdc_ata_pci_tbl);
681MODULE_VERSION(DRV_VERSION); 706MODULE_VERSION(DRV_VERSION);
diff --git a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c
index dfd362104717..1383e8a28d72 100644
--- a/drivers/scsi/sata_qstor.c
+++ b/drivers/scsi/sata_qstor.c
@@ -536,6 +536,8 @@ static void qs_host_stop(struct ata_host_set *host_set)
536 536
537 writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */ 537 writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */
538 writeb(QS_CNFG3_GSRST, mmio_base + QS_HCF_CNFG3); /* global reset */ 538 writeb(QS_CNFG3_GSRST, mmio_base + QS_HCF_CNFG3); /* global reset */
539
540 ata_host_stop(host_set);
539} 541}
540 542
541static void qs_host_init(unsigned int chip_id, struct ata_probe_ent *pe) 543static void qs_host_init(unsigned int chip_id, struct ata_probe_ent *pe)
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c
index 2b2ff48be396..49ed557a4b66 100644
--- a/drivers/scsi/sata_sil.c
+++ b/drivers/scsi/sata_sil.c
@@ -161,6 +161,7 @@ static struct ata_port_operations sil_ops = {
161 .scr_write = sil_scr_write, 161 .scr_write = sil_scr_write,
162 .port_start = ata_port_start, 162 .port_start = ata_port_start,
163 .port_stop = ata_port_stop, 163 .port_stop = ata_port_stop,
164 .host_stop = ata_host_stop,
164}; 165};
165 166
166static struct ata_port_info sil_port_info[] = { 167static struct ata_port_info sil_port_info[] = {
@@ -431,7 +432,13 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
431 writeb(cls, mmio_base + SIL_FIFO_R0); 432 writeb(cls, mmio_base + SIL_FIFO_R0);
432 writeb(cls, mmio_base + SIL_FIFO_W0); 433 writeb(cls, mmio_base + SIL_FIFO_W0);
433 writeb(cls, mmio_base + SIL_FIFO_R1); 434 writeb(cls, mmio_base + SIL_FIFO_R1);
434 writeb(cls, mmio_base + SIL_FIFO_W2); 435 writeb(cls, mmio_base + SIL_FIFO_W1);
436 if (ent->driver_data == sil_3114) {
437 writeb(cls, mmio_base + SIL_FIFO_R2);
438 writeb(cls, mmio_base + SIL_FIFO_W2);
439 writeb(cls, mmio_base + SIL_FIFO_R3);
440 writeb(cls, mmio_base + SIL_FIFO_W3);
441 }
435 } else 442 } else
436 printk(KERN_WARNING DRV_NAME "(%s): cache line size not set. Driver may not function\n", 443 printk(KERN_WARNING DRV_NAME "(%s): cache line size not set. Driver may not function\n",
437 pci_name(pdev)); 444 pci_name(pdev));
diff --git a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c
index 5105ddd08447..e418b89c6b9d 100644
--- a/drivers/scsi/sata_sis.c
+++ b/drivers/scsi/sata_sis.c
@@ -114,6 +114,7 @@ static struct ata_port_operations sis_ops = {
114 .scr_write = sis_scr_write, 114 .scr_write = sis_scr_write,
115 .port_start = ata_port_start, 115 .port_start = ata_port_start,
116 .port_stop = ata_port_stop, 116 .port_stop = ata_port_stop,
117 .host_stop = ata_host_stop,
117}; 118};
118 119
119static struct ata_port_info sis_port_info = { 120static struct ata_port_info sis_port_info = {
diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c
index 05075bd3a893..858e07185dbd 100644
--- a/drivers/scsi/sata_svw.c
+++ b/drivers/scsi/sata_svw.c
@@ -49,7 +49,7 @@
49#endif /* CONFIG_PPC_OF */ 49#endif /* CONFIG_PPC_OF */
50 50
51#define DRV_NAME "sata_svw" 51#define DRV_NAME "sata_svw"
52#define DRV_VERSION "1.05" 52#define DRV_VERSION "1.06"
53 53
54/* Taskfile registers offsets */ 54/* Taskfile registers offsets */
55#define K2_SATA_TF_CMD_OFFSET 0x00 55#define K2_SATA_TF_CMD_OFFSET 0x00
@@ -313,6 +313,7 @@ static struct ata_port_operations k2_sata_ops = {
313 .scr_write = k2_sata_scr_write, 313 .scr_write = k2_sata_scr_write,
314 .port_start = ata_port_start, 314 .port_start = ata_port_start,
315 .port_stop = ata_port_stop, 315 .port_stop = ata_port_stop,
316 .host_stop = ata_host_stop,
316}; 317};
317 318
318static void k2_sata_setup_port(struct ata_ioports *port, unsigned long base) 319static void k2_sata_setup_port(struct ata_ioports *port, unsigned long base)
@@ -343,6 +344,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
343 void *mmio_base; 344 void *mmio_base;
344 int pci_dev_busy = 0; 345 int pci_dev_busy = 0;
345 int rc; 346 int rc;
347 int i;
346 348
347 if (!printed_version++) 349 if (!printed_version++)
348 printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); 350 printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
@@ -420,11 +422,11 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
420 probe_ent->mwdma_mask = 0x7; 422 probe_ent->mwdma_mask = 0x7;
421 probe_ent->udma_mask = 0x7f; 423 probe_ent->udma_mask = 0x7f;
422 424
423 /* We have 4 ports per PCI function */ 425 /* different controllers have different number of ports - currently 4 or 8 */
424 k2_sata_setup_port(&probe_ent->port[0], base + 0 * K2_SATA_PORT_OFFSET); 426 /* All ports are on the same function. Multi-function device is no
425 k2_sata_setup_port(&probe_ent->port[1], base + 1 * K2_SATA_PORT_OFFSET); 427 * longer available. This should not be seen in any system. */
426 k2_sata_setup_port(&probe_ent->port[2], base + 2 * K2_SATA_PORT_OFFSET); 428 for (i = 0; i < ent->driver_data; i++)
427 k2_sata_setup_port(&probe_ent->port[3], base + 3 * K2_SATA_PORT_OFFSET); 429 k2_sata_setup_port(&probe_ent->port[i], base + i * K2_SATA_PORT_OFFSET);
428 430
429 pci_set_master(pdev); 431 pci_set_master(pdev);
430 432
@@ -444,11 +446,17 @@ err_out:
444 return rc; 446 return rc;
445} 447}
446 448
447 449/* 0x240 is device ID for Apple K2 device
450 * 0x241 is device ID for Serverworks Frodo4
451 * 0x242 is device ID for Serverworks Frodo8
452 * 0x24a is device ID for BCM5785 (aka HT1000) HT southbridge integrated SATA
453 * controller
454 * */
448static struct pci_device_id k2_sata_pci_tbl[] = { 455static struct pci_device_id k2_sata_pci_tbl[] = {
449 { 0x1166, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 456 { 0x1166, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
450 { 0x1166, 0x0241, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 457 { 0x1166, 0x0241, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
451 { 0x1166, 0x0242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 458 { 0x1166, 0x0242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8 },
459 { 0x1166, 0x024a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
452 { } 460 { }
453}; 461};
454 462
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c
index 70118650c461..140cea05de3f 100644
--- a/drivers/scsi/sata_sx4.c
+++ b/drivers/scsi/sata_sx4.c
@@ -245,6 +245,8 @@ static void pdc20621_host_stop(struct ata_host_set *host_set)
245 245
246 iounmap(dimm_mmio); 246 iounmap(dimm_mmio);
247 kfree(hpriv); 247 kfree(hpriv);
248
249 ata_host_stop(host_set);
248} 250}
249 251
250static int pdc_port_start(struct ata_port *ap) 252static int pdc_port_start(struct ata_port *ap)
diff --git a/drivers/scsi/sata_uli.c b/drivers/scsi/sata_uli.c
index 0bff4f475f26..a71fb54eebd3 100644
--- a/drivers/scsi/sata_uli.c
+++ b/drivers/scsi/sata_uli.c
@@ -113,6 +113,7 @@ static struct ata_port_operations uli_ops = {
113 113
114 .port_start = ata_port_start, 114 .port_start = ata_port_start,
115 .port_stop = ata_port_stop, 115 .port_stop = ata_port_stop,
116 .host_stop = ata_host_stop,
116}; 117};
117 118
118static struct ata_port_info uli_port_info = { 119static struct ata_port_info uli_port_info = {
diff --git a/drivers/scsi/sata_via.c b/drivers/scsi/sata_via.c
index 3a7830667277..f43183c19a12 100644
--- a/drivers/scsi/sata_via.c
+++ b/drivers/scsi/sata_via.c
@@ -134,6 +134,7 @@ static struct ata_port_operations svia_sata_ops = {
134 134
135 .port_start = ata_port_start, 135 .port_start = ata_port_start,
136 .port_stop = ata_port_stop, 136 .port_stop = ata_port_stop,
137 .host_stop = ata_host_stop,
137}; 138};
138 139
139static struct ata_port_info svia_port_info = { 140static struct ata_port_info svia_port_info = {
diff --git a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c
index 2c28f0ad73c2..c5e09dc6f3de 100644
--- a/drivers/scsi/sata_vsc.c
+++ b/drivers/scsi/sata_vsc.c
@@ -21,6 +21,7 @@
21#include <linux/blkdev.h> 21#include <linux/blkdev.h>
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/dma-mapping.h>
24#include "scsi.h" 25#include "scsi.h"
25#include <scsi/scsi_host.h> 26#include <scsi/scsi_host.h>
26#include <linux/libata.h> 27#include <linux/libata.h>
@@ -230,6 +231,7 @@ static struct ata_port_operations vsc_sata_ops = {
230 .scr_write = vsc_sata_scr_write, 231 .scr_write = vsc_sata_scr_write,
231 .port_start = ata_port_start, 232 .port_start = ata_port_start,
232 .port_stop = ata_port_stop, 233 .port_stop = ata_port_stop,
234 .host_stop = ata_host_stop,
233}; 235};
234 236
235static void __devinit vsc_sata_setup_port(struct ata_ioports *port, unsigned long base) 237static void __devinit vsc_sata_setup_port(struct ata_ioports *port, unsigned long base)
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 184bcaeaf812..5578ae9a9e45 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -638,10 +638,12 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
638 } 638 }
639 spin_unlock_irqrestore(host->host_lock, flags); 639 spin_unlock_irqrestore(host->host_lock, flags);
640 if (rtn) { 640 if (rtn) {
641 atomic_inc(&cmd->device->iodone_cnt); 641 if (scsi_delete_timer(cmd)) {
642 scsi_queue_insert(cmd, 642 atomic_inc(&cmd->device->iodone_cnt);
643 (rtn == SCSI_MLQUEUE_DEVICE_BUSY) ? 643 scsi_queue_insert(cmd,
644 rtn : SCSI_MLQUEUE_HOST_BUSY); 644 (rtn == SCSI_MLQUEUE_DEVICE_BUSY) ?
645 rtn : SCSI_MLQUEUE_HOST_BUSY);
646 }
645 SCSI_LOG_MLQUEUE(3, 647 SCSI_LOG_MLQUEUE(3,
646 printk("queuecommand : request rejected\n")); 648 printk("queuecommand : request rejected\n"));
647 } 649 }
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 2bf1ee2b47b6..ceb4e0c99b37 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -434,8 +434,7 @@ static void scsi_eh_times_out(struct scsi_cmnd *scmd)
434 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd:%p\n", __FUNCTION__, 434 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd:%p\n", __FUNCTION__,
435 scmd)); 435 scmd));
436 436
437 if (scmd->device->host->eh_action) 437 up(scmd->device->host->eh_action);
438 up(scmd->device->host->eh_action);
439} 438}
440 439
441/** 440/**
@@ -457,8 +456,7 @@ static void scsi_eh_done(struct scsi_cmnd *scmd)
457 SCSI_LOG_ERROR_RECOVERY(3, printk("%s scmd: %p result: %x\n", 456 SCSI_LOG_ERROR_RECOVERY(3, printk("%s scmd: %p result: %x\n",
458 __FUNCTION__, scmd, scmd->result)); 457 __FUNCTION__, scmd, scmd->result));
459 458
460 if (scmd->device->host->eh_action) 459 up(scmd->device->host->eh_action);
461 up(scmd->device->host->eh_action);
462 } 460 }
463} 461}
464 462
@@ -528,10 +526,8 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
528 * abort a timed out command or not. not sure how 526 * abort a timed out command or not. not sure how
529 * we should treat them differently anyways. 527 * we should treat them differently anyways.
530 */ 528 */
531 spin_lock_irqsave(shost->host_lock, flags);
532 if (shost->hostt->eh_abort_handler) 529 if (shost->hostt->eh_abort_handler)
533 shost->hostt->eh_abort_handler(scmd); 530 shost->hostt->eh_abort_handler(scmd);
534 spin_unlock_irqrestore(shost->host_lock, flags);
535 531
536 scmd->request->rq_status = RQ_SCSI_DONE; 532 scmd->request->rq_status = RQ_SCSI_DONE;
537 scmd->owner = SCSI_OWNER_ERROR_HANDLER; 533 scmd->owner = SCSI_OWNER_ERROR_HANDLER;
@@ -737,11 +733,8 @@ static int scsi_eh_get_sense(struct list_head *work_q,
737 **/ 733 **/
738static int scsi_try_to_abort_cmd(struct scsi_cmnd *scmd) 734static int scsi_try_to_abort_cmd(struct scsi_cmnd *scmd)
739{ 735{
740 unsigned long flags;
741 int rtn = FAILED;
742
743 if (!scmd->device->host->hostt->eh_abort_handler) 736 if (!scmd->device->host->hostt->eh_abort_handler)
744 return rtn; 737 return FAILED;
745 738
746 /* 739 /*
747 * scsi_done was called just after the command timed out and before 740 * scsi_done was called just after the command timed out and before
@@ -752,11 +745,7 @@ static int scsi_try_to_abort_cmd(struct scsi_cmnd *scmd)
752 745
753 scmd->owner = SCSI_OWNER_LOWLEVEL; 746 scmd->owner = SCSI_OWNER_LOWLEVEL;
754 747
755 spin_lock_irqsave(scmd->device->host->host_lock, flags); 748 return scmd->device->host->hostt->eh_abort_handler(scmd);
756 rtn = scmd->device->host->hostt->eh_abort_handler(scmd);
757 spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
758
759 return rtn;
760} 749}
761 750
762/** 751/**
@@ -770,6 +759,7 @@ static int scsi_eh_tur(struct scsi_cmnd *scmd)
770{ 759{
771 static unsigned char tur_command[6] = {TEST_UNIT_READY, 0, 0, 0, 0, 0}; 760 static unsigned char tur_command[6] = {TEST_UNIT_READY, 0, 0, 0, 0, 0};
772 int retry_cnt = 1, rtn; 761 int retry_cnt = 1, rtn;
762 int saved_result;
773 763
774retry_tur: 764retry_tur:
775 memcpy(scmd->cmnd, tur_command, sizeof(tur_command)); 765 memcpy(scmd->cmnd, tur_command, sizeof(tur_command));
@@ -780,6 +770,7 @@ retry_tur:
780 */ 770 */
781 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer)); 771 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer));
782 772
773 saved_result = scmd->result;
783 scmd->request_buffer = NULL; 774 scmd->request_buffer = NULL;
784 scmd->request_bufflen = 0; 775 scmd->request_bufflen = 0;
785 scmd->use_sg = 0; 776 scmd->use_sg = 0;
@@ -794,6 +785,7 @@ retry_tur:
794 * the original request, so let's restore the original data. (db) 785 * the original request, so let's restore the original data. (db)
795 */ 786 */
796 scsi_setup_cmd_retry(scmd); 787 scsi_setup_cmd_retry(scmd);
788 scmd->result = saved_result;
797 789
798 /* 790 /*
799 * hey, we are done. let's look to see what happened. 791 * hey, we are done. let's look to see what happened.
@@ -865,17 +857,14 @@ static int scsi_eh_abort_cmds(struct list_head *work_q,
865 **/ 857 **/
866static int scsi_try_bus_device_reset(struct scsi_cmnd *scmd) 858static int scsi_try_bus_device_reset(struct scsi_cmnd *scmd)
867{ 859{
868 unsigned long flags; 860 int rtn;
869 int rtn = FAILED;
870 861
871 if (!scmd->device->host->hostt->eh_device_reset_handler) 862 if (!scmd->device->host->hostt->eh_device_reset_handler)
872 return rtn; 863 return FAILED;
873 864
874 scmd->owner = SCSI_OWNER_LOWLEVEL; 865 scmd->owner = SCSI_OWNER_LOWLEVEL;
875 866
876 spin_lock_irqsave(scmd->device->host->host_lock, flags);
877 rtn = scmd->device->host->hostt->eh_device_reset_handler(scmd); 867 rtn = scmd->device->host->hostt->eh_device_reset_handler(scmd);
878 spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
879 868
880 if (rtn == SUCCESS) { 869 if (rtn == SUCCESS) {
881 scmd->device->was_reset = 1; 870 scmd->device->was_reset = 1;
@@ -896,6 +885,7 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
896{ 885{
897 static unsigned char stu_command[6] = {START_STOP, 0, 0, 0, 1, 0}; 886 static unsigned char stu_command[6] = {START_STOP, 0, 0, 0, 1, 0};
898 int rtn; 887 int rtn;
888 int saved_result;
899 889
900 if (!scmd->device->allow_restart) 890 if (!scmd->device->allow_restart)
901 return 1; 891 return 1;
@@ -908,6 +898,7 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
908 */ 898 */
909 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer)); 899 memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer));
910 900
901 saved_result = scmd->result;
911 scmd->request_buffer = NULL; 902 scmd->request_buffer = NULL;
912 scmd->request_bufflen = 0; 903 scmd->request_bufflen = 0;
913 scmd->use_sg = 0; 904 scmd->use_sg = 0;
@@ -922,6 +913,7 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
922 * the original request, so let's restore the original data. (db) 913 * the original request, so let's restore the original data. (db)
923 */ 914 */
924 scsi_setup_cmd_retry(scmd); 915 scsi_setup_cmd_retry(scmd);
916 scmd->result = saved_result;
925 917
926 /* 918 /*
927 * hey, we are done. let's look to see what happened. 919 * hey, we are done. let's look to see what happened.
@@ -1061,9 +1053,7 @@ static int scsi_try_bus_reset(struct scsi_cmnd *scmd)
1061 if (!scmd->device->host->hostt->eh_bus_reset_handler) 1053 if (!scmd->device->host->hostt->eh_bus_reset_handler)
1062 return FAILED; 1054 return FAILED;
1063 1055
1064 spin_lock_irqsave(scmd->device->host->host_lock, flags);
1065 rtn = scmd->device->host->hostt->eh_bus_reset_handler(scmd); 1056 rtn = scmd->device->host->hostt->eh_bus_reset_handler(scmd);
1066 spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
1067 1057
1068 if (rtn == SUCCESS) { 1058 if (rtn == SUCCESS) {
1069 if (!scmd->device->host->hostt->skip_settle_delay) 1059 if (!scmd->device->host->hostt->skip_settle_delay)
@@ -1092,9 +1082,7 @@ static int scsi_try_host_reset(struct scsi_cmnd *scmd)
1092 if (!scmd->device->host->hostt->eh_host_reset_handler) 1082 if (!scmd->device->host->hostt->eh_host_reset_handler)
1093 return FAILED; 1083 return FAILED;
1094 1084
1095 spin_lock_irqsave(scmd->device->host->host_lock, flags);
1096 rtn = scmd->device->host->hostt->eh_host_reset_handler(scmd); 1085 rtn = scmd->device->host->hostt->eh_host_reset_handler(scmd);
1097 spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
1098 1086
1099 if (rtn == SUCCESS) { 1087 if (rtn == SUCCESS) {
1100 if (!scmd->device->host->hostt->skip_settle_delay) 1088 if (!scmd->device->host->hostt->skip_settle_delay)
@@ -1561,6 +1549,11 @@ static void scsi_eh_flush_done_q(struct list_head *done_q)
1561 scmd)); 1549 scmd));
1562 scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY); 1550 scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY);
1563 } else { 1551 } else {
1552 /*
1553 * If just we got sense for the device (called
1554 * scsi_eh_get_sense), scmd->result is already
1555 * set, do not set DRIVER_TIMEOUT.
1556 */
1564 if (!scmd->result) 1557 if (!scmd->result)
1565 scmd->result |= (DRIVER_TIMEOUT << 24); 1558 scmd->result |= (DRIVER_TIMEOUT << 24);
1566 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush finish" 1559 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush finish"
@@ -1870,7 +1863,6 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
1870 rtn = FAILED; 1863 rtn = FAILED;
1871 } 1864 }
1872 1865
1873 scsi_delete_timer(scmd);
1874 scsi_next_command(scmd); 1866 scsi_next_command(scmd);
1875 return rtn; 1867 return rtn;
1876} 1868}
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index d18da21c9c57..9f996499fa9d 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -92,10 +92,12 @@ int scsi_insert_special_req(struct scsi_request *sreq, int at_head)
92 */ 92 */
93 sreq->sr_request->flags &= ~REQ_DONTPREP; 93 sreq->sr_request->flags &= ~REQ_DONTPREP;
94 blk_insert_request(sreq->sr_device->request_queue, sreq->sr_request, 94 blk_insert_request(sreq->sr_device->request_queue, sreq->sr_request,
95 at_head, sreq, 0); 95 at_head, sreq);
96 return 0; 96 return 0;
97} 97}
98 98
99static void scsi_run_queue(struct request_queue *q);
100
99/* 101/*
100 * Function: scsi_queue_insert() 102 * Function: scsi_queue_insert()
101 * 103 *
@@ -119,18 +121,14 @@ int scsi_queue_insert(struct scsi_cmnd *cmd, int reason)
119{ 121{
120 struct Scsi_Host *host = cmd->device->host; 122 struct Scsi_Host *host = cmd->device->host;
121 struct scsi_device *device = cmd->device; 123 struct scsi_device *device = cmd->device;
124 struct request_queue *q = device->request_queue;
125 unsigned long flags;
122 126
123 SCSI_LOG_MLQUEUE(1, 127 SCSI_LOG_MLQUEUE(1,
124 printk("Inserting command %p into mlqueue\n", cmd)); 128 printk("Inserting command %p into mlqueue\n", cmd));
125 129
126 /* 130 /*
127 * We are inserting the command into the ml queue. First, we 131 * Set the appropriate busy bit for the device/host.
128 * cancel the timer, so it doesn't time out.
129 */
130 scsi_delete_timer(cmd);
131
132 /*
133 * Next, set the appropriate busy bit for the device/host.
134 * 132 *
135 * If the host/device isn't busy, assume that something actually 133 * If the host/device isn't busy, assume that something actually
136 * completed, and that we should be able to queue a command now. 134 * completed, and that we should be able to queue a command now.
@@ -160,17 +158,22 @@ int scsi_queue_insert(struct scsi_cmnd *cmd, int reason)
160 scsi_device_unbusy(device); 158 scsi_device_unbusy(device);
161 159
162 /* 160 /*
163 * Insert this command at the head of the queue for it's device. 161 * Requeue this command. It will go before all other commands
164 * It will go before all other commands that are already in the queue. 162 * that are already in the queue.
165 * 163 *
166 * NOTE: there is magic here about the way the queue is plugged if 164 * NOTE: there is magic here about the way the queue is plugged if
167 * we have no outstanding commands. 165 * we have no outstanding commands.
168 * 166 *
169 * Although this *doesn't* plug the queue, it does call the request 167 * Although we *don't* plug the queue, we call the request
170 * function. The SCSI request function detects the blocked condition 168 * function. The SCSI request function detects the blocked condition
171 * and plugs the queue appropriately. 169 * and plugs the queue appropriately.
172 */ 170 */
173 blk_insert_request(device->request_queue, cmd->request, 1, cmd, 1); 171 spin_lock_irqsave(q->queue_lock, flags);
172 blk_requeue_request(q, cmd->request);
173 spin_unlock_irqrestore(q->queue_lock, flags);
174
175 scsi_run_queue(q);
176
174 return 0; 177 return 0;
175} 178}
176 179
@@ -485,8 +488,13 @@ static void scsi_run_queue(struct request_queue *q)
485 */ 488 */
486static void scsi_requeue_command(struct request_queue *q, struct scsi_cmnd *cmd) 489static void scsi_requeue_command(struct request_queue *q, struct scsi_cmnd *cmd)
487{ 490{
491 unsigned long flags;
492
488 cmd->request->flags &= ~REQ_DONTPREP; 493 cmd->request->flags &= ~REQ_DONTPREP;
489 blk_insert_request(q, cmd->request, 1, cmd, 1); 494
495 spin_lock_irqsave(q->queue_lock, flags);
496 blk_requeue_request(q, cmd->request);
497 spin_unlock_irqrestore(q->queue_lock, flags);
490 498
491 scsi_run_queue(q); 499 scsi_run_queue(q);
492} 500}
@@ -941,10 +949,8 @@ static int scsi_init_io(struct scsi_cmnd *cmd)
941 * if sg table allocation fails, requeue request later. 949 * if sg table allocation fails, requeue request later.
942 */ 950 */
943 sgpnt = scsi_alloc_sgtable(cmd, GFP_ATOMIC); 951 sgpnt = scsi_alloc_sgtable(cmd, GFP_ATOMIC);
944 if (unlikely(!sgpnt)) { 952 if (unlikely(!sgpnt))
945 req->flags |= REQ_SPECIAL;
946 return BLKPREP_DEFER; 953 return BLKPREP_DEFER;
947 }
948 954
949 cmd->request_buffer = (char *) sgpnt; 955 cmd->request_buffer = (char *) sgpnt;
950 cmd->request_bufflen = req->nr_sectors << 9; 956 cmd->request_bufflen = req->nr_sectors << 9;
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index cca772624ae7..9fa209097e3b 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -293,6 +293,10 @@ static void scsi_target_dev_release(struct device *dev)
293{ 293{
294 struct device *parent = dev->parent; 294 struct device *parent = dev->parent;
295 struct scsi_target *starget = to_scsi_target(dev); 295 struct scsi_target *starget = to_scsi_target(dev);
296 struct Scsi_Host *shost = dev_to_shost(parent);
297
298 if (shost->hostt->target_destroy)
299 shost->hostt->target_destroy(starget);
296 kfree(starget); 300 kfree(starget);
297 put_device(parent); 301 put_device(parent);
298} 302}
@@ -360,9 +364,23 @@ static struct scsi_target *scsi_alloc_target(struct device *parent,
360 list_add_tail(&starget->siblings, &shost->__targets); 364 list_add_tail(&starget->siblings, &shost->__targets);
361 spin_unlock_irqrestore(shost->host_lock, flags); 365 spin_unlock_irqrestore(shost->host_lock, flags);
362 /* allocate and add */ 366 /* allocate and add */
363 transport_setup_device(&starget->dev); 367 transport_setup_device(dev);
364 device_add(&starget->dev); 368 device_add(dev);
365 transport_add_device(&starget->dev); 369 transport_add_device(dev);
370 if (shost->hostt->target_alloc) {
371 int error = shost->hostt->target_alloc(starget);
372
373 if(error) {
374 dev_printk(KERN_ERR, dev, "target allocation failed, error %d\n", error);
375 /* don't want scsi_target_reap to do the final
376 * put because it will be under the host lock */
377 get_device(dev);
378 scsi_target_reap(starget);
379 put_device(dev);
380 return NULL;
381 }
382 }
383
366 return starget; 384 return starget;
367 385
368 found: 386 found:
@@ -625,6 +643,7 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
625 case TYPE_MEDIUM_CHANGER: 643 case TYPE_MEDIUM_CHANGER:
626 case TYPE_ENCLOSURE: 644 case TYPE_ENCLOSURE:
627 case TYPE_COMM: 645 case TYPE_COMM:
646 case TYPE_RBC:
628 sdev->writeable = 1; 647 sdev->writeable = 1;
629 break; 648 break;
630 case TYPE_WORM: 649 case TYPE_WORM:
@@ -1197,6 +1216,7 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
1197 if (!starget) 1216 if (!starget)
1198 return ERR_PTR(-ENOMEM); 1217 return ERR_PTR(-ENOMEM);
1199 1218
1219 get_device(&starget->dev);
1200 down(&shost->scan_mutex); 1220 down(&shost->scan_mutex);
1201 res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, hostdata); 1221 res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, hostdata);
1202 if (res != SCSI_SCAN_LUN_PRESENT) 1222 if (res != SCSI_SCAN_LUN_PRESENT)
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index e75ee4671ee3..93b41100a6d8 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -230,7 +230,7 @@ void scsi_sysfs_unregister(void)
230 */ 230 */
231#define sdev_show_function(field, format_string) \ 231#define sdev_show_function(field, format_string) \
232static ssize_t \ 232static ssize_t \
233sdev_show_##field (struct device *dev, char *buf) \ 233sdev_show_##field (struct device *dev, struct device_attribute *attr, char *buf) \
234{ \ 234{ \
235 struct scsi_device *sdev; \ 235 struct scsi_device *sdev; \
236 sdev = to_scsi_device(dev); \ 236 sdev = to_scsi_device(dev); \
@@ -254,7 +254,7 @@ static DEVICE_ATTR(field, S_IRUGO, sdev_show_##field, NULL);
254 sdev_show_function(field, format_string) \ 254 sdev_show_function(field, format_string) \
255 \ 255 \
256static ssize_t \ 256static ssize_t \
257sdev_store_##field (struct device *dev, const char *buf, size_t count) \ 257sdev_store_##field (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
258{ \ 258{ \
259 struct scsi_device *sdev; \ 259 struct scsi_device *sdev; \
260 sdev = to_scsi_device(dev); \ 260 sdev = to_scsi_device(dev); \
@@ -274,7 +274,7 @@ static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, sdev_show_##field, sdev_store_##fie
274 sdev_show_function(field, "%d\n") \ 274 sdev_show_function(field, "%d\n") \
275 \ 275 \
276static ssize_t \ 276static ssize_t \
277sdev_store_##field (struct device *dev, const char *buf, size_t count) \ 277sdev_store_##field (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
278{ \ 278{ \
279 int ret; \ 279 int ret; \
280 struct scsi_device *sdev; \ 280 struct scsi_device *sdev; \
@@ -317,7 +317,7 @@ sdev_rd_attr (model, "%.16s\n");
317sdev_rd_attr (rev, "%.4s\n"); 317sdev_rd_attr (rev, "%.4s\n");
318 318
319static ssize_t 319static ssize_t
320sdev_show_timeout (struct device *dev, char *buf) 320sdev_show_timeout (struct device *dev, struct device_attribute *attr, char *buf)
321{ 321{
322 struct scsi_device *sdev; 322 struct scsi_device *sdev;
323 sdev = to_scsi_device(dev); 323 sdev = to_scsi_device(dev);
@@ -325,7 +325,7 @@ sdev_show_timeout (struct device *dev, char *buf)
325} 325}
326 326
327static ssize_t 327static ssize_t
328sdev_store_timeout (struct device *dev, const char *buf, size_t count) 328sdev_store_timeout (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
329{ 329{
330 struct scsi_device *sdev; 330 struct scsi_device *sdev;
331 int timeout; 331 int timeout;
@@ -337,14 +337,14 @@ sdev_store_timeout (struct device *dev, const char *buf, size_t count)
337static DEVICE_ATTR(timeout, S_IRUGO | S_IWUSR, sdev_show_timeout, sdev_store_timeout); 337static DEVICE_ATTR(timeout, S_IRUGO | S_IWUSR, sdev_show_timeout, sdev_store_timeout);
338 338
339static ssize_t 339static ssize_t
340store_rescan_field (struct device *dev, const char *buf, size_t count) 340store_rescan_field (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
341{ 341{
342 scsi_rescan_device(dev); 342 scsi_rescan_device(dev);
343 return count; 343 return count;
344} 344}
345static DEVICE_ATTR(rescan, S_IWUSR, NULL, store_rescan_field); 345static DEVICE_ATTR(rescan, S_IWUSR, NULL, store_rescan_field);
346 346
347static ssize_t sdev_store_delete(struct device *dev, const char *buf, 347static ssize_t sdev_store_delete(struct device *dev, struct device_attribute *attr, const char *buf,
348 size_t count) 348 size_t count)
349{ 349{
350 scsi_remove_device(to_scsi_device(dev)); 350 scsi_remove_device(to_scsi_device(dev));
@@ -353,7 +353,7 @@ static ssize_t sdev_store_delete(struct device *dev, const char *buf,
353static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete); 353static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete);
354 354
355static ssize_t 355static ssize_t
356store_state_field(struct device *dev, const char *buf, size_t count) 356store_state_field(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
357{ 357{
358 int i; 358 int i;
359 struct scsi_device *sdev = to_scsi_device(dev); 359 struct scsi_device *sdev = to_scsi_device(dev);
@@ -376,7 +376,7 @@ store_state_field(struct device *dev, const char *buf, size_t count)
376} 376}
377 377
378static ssize_t 378static ssize_t
379show_state_field(struct device *dev, char *buf) 379show_state_field(struct device *dev, struct device_attribute *attr, char *buf)
380{ 380{
381 struct scsi_device *sdev = to_scsi_device(dev); 381 struct scsi_device *sdev = to_scsi_device(dev);
382 const char *name = scsi_device_state_name(sdev->sdev_state); 382 const char *name = scsi_device_state_name(sdev->sdev_state);
@@ -390,7 +390,7 @@ show_state_field(struct device *dev, char *buf)
390static DEVICE_ATTR(state, S_IRUGO | S_IWUSR, show_state_field, store_state_field); 390static DEVICE_ATTR(state, S_IRUGO | S_IWUSR, show_state_field, store_state_field);
391 391
392static ssize_t 392static ssize_t
393show_queue_type_field(struct device *dev, char *buf) 393show_queue_type_field(struct device *dev, struct device_attribute *attr, char *buf)
394{ 394{
395 struct scsi_device *sdev = to_scsi_device(dev); 395 struct scsi_device *sdev = to_scsi_device(dev);
396 const char *name = "none"; 396 const char *name = "none";
@@ -406,7 +406,7 @@ show_queue_type_field(struct device *dev, char *buf)
406static DEVICE_ATTR(queue_type, S_IRUGO, show_queue_type_field, NULL); 406static DEVICE_ATTR(queue_type, S_IRUGO, show_queue_type_field, NULL);
407 407
408static ssize_t 408static ssize_t
409show_iostat_counterbits(struct device *dev, char *buf) 409show_iostat_counterbits(struct device *dev, struct device_attribute *attr, char *buf)
410{ 410{
411 return snprintf(buf, 20, "%d\n", (int)sizeof(atomic_t) * 8); 411 return snprintf(buf, 20, "%d\n", (int)sizeof(atomic_t) * 8);
412} 412}
@@ -415,7 +415,7 @@ static DEVICE_ATTR(iocounterbits, S_IRUGO, show_iostat_counterbits, NULL);
415 415
416#define show_sdev_iostat(field) \ 416#define show_sdev_iostat(field) \
417static ssize_t \ 417static ssize_t \
418show_iostat_##field(struct device *dev, char *buf) \ 418show_iostat_##field(struct device *dev, struct device_attribute *attr, char *buf) \
419{ \ 419{ \
420 struct scsi_device *sdev = to_scsi_device(dev); \ 420 struct scsi_device *sdev = to_scsi_device(dev); \
421 unsigned long long count = atomic_read(&sdev->field); \ 421 unsigned long long count = atomic_read(&sdev->field); \
@@ -449,7 +449,7 @@ static struct device_attribute *scsi_sysfs_sdev_attrs[] = {
449 NULL 449 NULL
450}; 450};
451 451
452static ssize_t sdev_store_queue_depth_rw(struct device *dev, const char *buf, 452static ssize_t sdev_store_queue_depth_rw(struct device *dev, struct device_attribute *attr, const char *buf,
453 size_t count) 453 size_t count)
454{ 454{
455 int depth, retval; 455 int depth, retval;
@@ -475,7 +475,7 @@ static struct device_attribute sdev_attr_queue_depth_rw =
475 __ATTR(queue_depth, S_IRUGO | S_IWUSR, sdev_show_queue_depth, 475 __ATTR(queue_depth, S_IRUGO | S_IWUSR, sdev_show_queue_depth,
476 sdev_store_queue_depth_rw); 476 sdev_store_queue_depth_rw);
477 477
478static ssize_t sdev_store_queue_type_rw(struct device *dev, const char *buf, 478static ssize_t sdev_store_queue_type_rw(struct device *dev, struct device_attribute *attr, const char *buf,
479 size_t count) 479 size_t count)
480{ 480{
481 struct scsi_device *sdev = to_scsi_device(dev); 481 struct scsi_device *sdev = to_scsi_device(dev);
@@ -669,6 +669,13 @@ void __scsi_remove_target(struct scsi_target *starget)
669 scsi_target_reap(starget); 669 scsi_target_reap(starget);
670} 670}
671 671
672static int __remove_child (struct device * dev, void * data)
673{
674 if (scsi_is_target_device(dev))
675 __scsi_remove_target(to_scsi_target(dev));
676 return 0;
677}
678
672/** 679/**
673 * scsi_remove_target - try to remove a target and all its devices 680 * scsi_remove_target - try to remove a target and all its devices
674 * @dev: generic starget or parent of generic stargets to be removed 681 * @dev: generic starget or parent of generic stargets to be removed
@@ -679,7 +686,7 @@ void __scsi_remove_target(struct scsi_target *starget)
679 */ 686 */
680void scsi_remove_target(struct device *dev) 687void scsi_remove_target(struct device *dev)
681{ 688{
682 struct device *rdev, *idev, *next; 689 struct device *rdev;
683 690
684 if (scsi_is_target_device(dev)) { 691 if (scsi_is_target_device(dev)) {
685 __scsi_remove_target(to_scsi_target(dev)); 692 __scsi_remove_target(to_scsi_target(dev));
@@ -687,10 +694,7 @@ void scsi_remove_target(struct device *dev)
687 } 694 }
688 695
689 rdev = get_device(dev); 696 rdev = get_device(dev);
690 list_for_each_entry_safe(idev, next, &dev->children, node) { 697 device_for_each_child(dev, NULL, __remove_child);
691 if (scsi_is_target_device(idev))
692 __scsi_remove_target(to_scsi_target(idev));
693 }
694 put_device(rdev); 698 put_device(rdev);
695} 699}
696EXPORT_SYMBOL(scsi_remove_target); 700EXPORT_SYMBOL(scsi_remove_target);
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 67c6cc40ce16..2918b9600db7 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -348,17 +348,21 @@ spi_transport_rd_attr(rd_strm, "%d\n");
348spi_transport_rd_attr(rti, "%d\n"); 348spi_transport_rd_attr(rti, "%d\n");
349spi_transport_rd_attr(pcomp_en, "%d\n"); 349spi_transport_rd_attr(pcomp_en, "%d\n");
350 350
351/* we only care about the first child device so we return 1 */
352static int child_iter(struct device *dev, void *data)
353{
354 struct scsi_device *sdev = to_scsi_device(dev);
355
356 spi_dv_device(sdev);
357 return 1;
358}
359
351static ssize_t 360static ssize_t
352store_spi_revalidate(struct class_device *cdev, const char *buf, size_t count) 361store_spi_revalidate(struct class_device *cdev, const char *buf, size_t count)
353{ 362{
354 struct scsi_target *starget = transport_class_to_starget(cdev); 363 struct scsi_target *starget = transport_class_to_starget(cdev);
355 364
356 /* FIXME: we're relying on an awful lot of device internals 365 device_for_each_child(&starget->dev, NULL, child_iter);
357 * here. We really need a function to get the first available
358 * child */
359 struct device *dev = container_of(starget->dev.children.next, struct device, node);
360 struct scsi_device *sdev = to_scsi_device(dev);
361 spi_dv_device(sdev);
362 return count; 366 return count;
363} 367}
364static CLASS_DEVICE_ATTR(revalidate, S_IWUSR, NULL, store_spi_revalidate); 368static CLASS_DEVICE_ATTR(revalidate, S_IWUSR, NULL, store_spi_revalidate);
@@ -669,6 +673,7 @@ spi_dv_retrain(struct scsi_request *sreq, u8 *buffer, u8 *ptr,
669{ 673{
670 struct spi_internal *i = to_spi_internal(sreq->sr_host->transportt); 674 struct spi_internal *i = to_spi_internal(sreq->sr_host->transportt);
671 struct scsi_device *sdev = sreq->sr_device; 675 struct scsi_device *sdev = sreq->sr_device;
676 struct scsi_target *starget = sdev->sdev_target;
672 int period = 0, prevperiod = 0; 677 int period = 0, prevperiod = 0;
673 enum spi_compare_returns retval; 678 enum spi_compare_returns retval;
674 679
@@ -682,24 +687,40 @@ spi_dv_retrain(struct scsi_request *sreq, u8 *buffer, u8 *ptr,
682 break; 687 break;
683 688
684 /* OK, retrain, fallback */ 689 /* OK, retrain, fallback */
690 if (i->f->get_iu)
691 i->f->get_iu(starget);
692 if (i->f->get_qas)
693 i->f->get_qas(starget);
685 if (i->f->get_period) 694 if (i->f->get_period)
686 i->f->get_period(sdev->sdev_target); 695 i->f->get_period(sdev->sdev_target);
687 newperiod = spi_period(sdev->sdev_target); 696
688 period = newperiod > period ? newperiod : period; 697 /* Here's the fallback sequence; first try turning off
689 if (period < 0x0d) 698 * IU, then QAS (if we can control them), then finally
690 period++; 699 * fall down the periods */
691 else 700 if (i->f->set_iu && spi_iu(starget)) {
692 period += period >> 1; 701 SPI_PRINTK(starget, KERN_ERR, "Domain Validation Disabing Information Units\n");
693 702 DV_SET(iu, 0);
694 if (unlikely(period > 0xff || period == prevperiod)) { 703 } else if (i->f->set_qas && spi_qas(starget)) {
695 /* Total failure; set to async and return */ 704 SPI_PRINTK(starget, KERN_ERR, "Domain Validation Disabing Quick Arbitration and Selection\n");
696 SPI_PRINTK(sdev->sdev_target, KERN_ERR, "Domain Validation Failure, dropping back to Asynchronous\n"); 705 DV_SET(qas, 0);
697 DV_SET(offset, 0); 706 } else {
698 return SPI_COMPARE_FAILURE; 707 newperiod = spi_period(starget);
708 period = newperiod > period ? newperiod : period;
709 if (period < 0x0d)
710 period++;
711 else
712 period += period >> 1;
713
714 if (unlikely(period > 0xff || period == prevperiod)) {
715 /* Total failure; set to async and return */
716 SPI_PRINTK(starget, KERN_ERR, "Domain Validation Failure, dropping back to Asynchronous\n");
717 DV_SET(offset, 0);
718 return SPI_COMPARE_FAILURE;
719 }
720 SPI_PRINTK(starget, KERN_ERR, "Domain Validation detected failure, dropping back\n");
721 DV_SET(period, period);
722 prevperiod = period;
699 } 723 }
700 SPI_PRINTK(sdev->sdev_target, KERN_ERR, "Domain Validation detected failure, dropping back\n");
701 DV_SET(period, period);
702 prevperiod = period;
703 } 724 }
704 return retval; 725 return retval;
705} 726}
@@ -768,23 +789,21 @@ spi_dv_device_internal(struct scsi_request *sreq, u8 *buffer)
768 789
769 if (spi_dv_device_compare_inquiry(sreq, buffer, buffer, DV_LOOPS) 790 if (spi_dv_device_compare_inquiry(sreq, buffer, buffer, DV_LOOPS)
770 != SPI_COMPARE_SUCCESS) { 791 != SPI_COMPARE_SUCCESS) {
771 SPI_PRINTK(sdev->sdev_target, KERN_ERR, "Domain Validation Initial Inquiry Failed\n"); 792 SPI_PRINTK(starget, KERN_ERR, "Domain Validation Initial Inquiry Failed\n");
772 /* FIXME: should probably offline the device here? */ 793 /* FIXME: should probably offline the device here? */
773 return; 794 return;
774 } 795 }
775 796
776 /* test width */ 797 /* test width */
777 if (i->f->set_width && spi_max_width(starget) && sdev->wdtr) { 798 if (i->f->set_width && spi_max_width(starget) && sdev->wdtr) {
778 i->f->set_width(sdev->sdev_target, 1); 799 i->f->set_width(starget, 1);
779
780 printk("WIDTH IS %d\n", spi_max_width(starget));
781 800
782 if (spi_dv_device_compare_inquiry(sreq, buffer, 801 if (spi_dv_device_compare_inquiry(sreq, buffer,
783 buffer + len, 802 buffer + len,
784 DV_LOOPS) 803 DV_LOOPS)
785 != SPI_COMPARE_SUCCESS) { 804 != SPI_COMPARE_SUCCESS) {
786 SPI_PRINTK(sdev->sdev_target, KERN_ERR, "Wide Transfers Fail\n"); 805 SPI_PRINTK(starget, KERN_ERR, "Wide Transfers Fail\n");
787 i->f->set_width(sdev->sdev_target, 0); 806 i->f->set_width(starget, 0);
788 } 807 }
789 } 808 }
790 809
@@ -792,7 +811,7 @@ spi_dv_device_internal(struct scsi_request *sreq, u8 *buffer)
792 return; 811 return;
793 812
794 /* device can't handle synchronous */ 813 /* device can't handle synchronous */
795 if(!sdev->ppr && !sdev->sdtr) 814 if (!sdev->ppr && !sdev->sdtr)
796 return; 815 return;
797 816
798 /* see if the device has an echo buffer. If it does we can 817 /* see if the device has an echo buffer. If it does we can
@@ -807,16 +826,30 @@ spi_dv_device_internal(struct scsi_request *sreq, u8 *buffer)
807 /* now set up to the maximum */ 826 /* now set up to the maximum */
808 DV_SET(offset, spi_max_offset(starget)); 827 DV_SET(offset, spi_max_offset(starget));
809 DV_SET(period, spi_min_period(starget)); 828 DV_SET(period, spi_min_period(starget));
829 /* try QAS requests; this should be harmless to set if the
830 * target supports it */
831 DV_SET(qas, 1);
832 /* Also try IU transfers */
833 DV_SET(iu, 1);
834 if (spi_min_period(starget) < 9) {
835 /* This u320 (or u640). Ignore the coupled parameters
836 * like DT and IU, but set the optional ones */
837 DV_SET(rd_strm, 1);
838 DV_SET(wr_flow, 1);
839 DV_SET(rti, 1);
840 if (spi_min_period(starget) == 8)
841 DV_SET(pcomp_en, 1);
842 }
810 843
811 if (len == 0) { 844 if (len == 0) {
812 SPI_PRINTK(sdev->sdev_target, KERN_INFO, "Domain Validation skipping write tests\n"); 845 SPI_PRINTK(starget, KERN_INFO, "Domain Validation skipping write tests\n");
813 spi_dv_retrain(sreq, buffer, buffer + len, 846 spi_dv_retrain(sreq, buffer, buffer + len,
814 spi_dv_device_compare_inquiry); 847 spi_dv_device_compare_inquiry);
815 return; 848 return;
816 } 849 }
817 850
818 if (len > SPI_MAX_ECHO_BUFFER_SIZE) { 851 if (len > SPI_MAX_ECHO_BUFFER_SIZE) {
819 SPI_PRINTK(sdev->sdev_target, KERN_WARNING, "Echo buffer size %d is too big, trimming to %d\n", len, SPI_MAX_ECHO_BUFFER_SIZE); 852 SPI_PRINTK(starget, KERN_WARNING, "Echo buffer size %d is too big, trimming to %d\n", len, SPI_MAX_ECHO_BUFFER_SIZE);
820 len = SPI_MAX_ECHO_BUFFER_SIZE; 853 len = SPI_MAX_ECHO_BUFFER_SIZE;
821 } 854 }
822 855
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 19afb25e44d3..bb8235598787 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1368,17 +1368,26 @@ sd_read_write_protect_flag(struct scsi_disk *sdkp, char *diskname,
1368 */ 1368 */
1369static void 1369static void
1370sd_read_cache_type(struct scsi_disk *sdkp, char *diskname, 1370sd_read_cache_type(struct scsi_disk *sdkp, char *diskname,
1371 struct scsi_request *SRpnt, unsigned char *buffer) { 1371 struct scsi_request *SRpnt, unsigned char *buffer)
1372{
1372 int len = 0, res; 1373 int len = 0, res;
1373 1374
1374 const int dbd = 0; /* DBD */ 1375 int dbd;
1375 const int modepage = 0x08; /* current values, cache page */ 1376 int modepage;
1376 struct scsi_mode_data data; 1377 struct scsi_mode_data data;
1377 struct scsi_sense_hdr sshdr; 1378 struct scsi_sense_hdr sshdr;
1378 1379
1379 if (sdkp->device->skip_ms_page_8) 1380 if (sdkp->device->skip_ms_page_8)
1380 goto defaults; 1381 goto defaults;
1381 1382
1383 if (sdkp->device->type == TYPE_RBC) {
1384 modepage = 6;
1385 dbd = 8;
1386 } else {
1387 modepage = 8;
1388 dbd = 0;
1389 }
1390
1382 /* cautiously ask */ 1391 /* cautiously ask */
1383 res = sd_do_mode_sense(SRpnt, dbd, modepage, buffer, 4, &data); 1392 res = sd_do_mode_sense(SRpnt, dbd, modepage, buffer, 4, &data);
1384 1393
@@ -1409,11 +1418,20 @@ sd_read_cache_type(struct scsi_disk *sdkp, char *diskname,
1409 "write back, no read (daft)" 1418 "write back, no read (daft)"
1410 }; 1419 };
1411 int ct = 0; 1420 int ct = 0;
1412 int offset = data.header_length + 1421 int offset = data.header_length + data.block_descriptor_length;
1413 data.block_descriptor_length + 2;
1414 1422
1415 sdkp->WCE = ((buffer[offset] & 0x04) != 0); 1423 if ((buffer[offset] & 0x3f) != modepage) {
1416 sdkp->RCD = ((buffer[offset] & 0x01) != 0); 1424 printk(KERN_ERR "%s: got wrong page\n", diskname);
1425 goto defaults;
1426 }
1427
1428 if (modepage == 8) {
1429 sdkp->WCE = ((buffer[offset + 2] & 0x04) != 0);
1430 sdkp->RCD = ((buffer[offset + 2] & 0x01) != 0);
1431 } else {
1432 sdkp->WCE = ((buffer[offset + 2] & 0x01) == 0);
1433 sdkp->RCD = 0;
1434 }
1417 1435
1418 ct = sdkp->RCD + 2*sdkp->WCE; 1436 ct = sdkp->RCD + 2*sdkp->WCE;
1419 1437
@@ -1533,7 +1551,7 @@ static int sd_probe(struct device *dev)
1533 int error; 1551 int error;
1534 1552
1535 error = -ENODEV; 1553 error = -ENODEV;
1536 if ((sdp->type != TYPE_DISK) && (sdp->type != TYPE_MOD)) 1554 if (sdp->type != TYPE_DISK && sdp->type != TYPE_MOD && sdp->type != TYPE_RBC)
1537 goto out; 1555 goto out;
1538 1556
1539 SCSI_LOG_HLQUEUE(3, printk("sd_attach: scsi device: <%d,%d,%d,%d>\n", 1557 SCSI_LOG_HLQUEUE(3, printk("sd_attach: scsi device: <%d,%d,%d,%d>\n",
@@ -1570,7 +1588,7 @@ static int sd_probe(struct device *dev)
1570 sdkp->openers = 0; 1588 sdkp->openers = 0;
1571 1589
1572 if (!sdp->timeout) { 1590 if (!sdp->timeout) {
1573 if (sdp->type == TYPE_DISK) 1591 if (sdp->type != TYPE_MOD)
1574 sdp->timeout = SD_TIMEOUT; 1592 sdp->timeout = SD_TIMEOUT;
1575 else 1593 else
1576 sdp->timeout = SD_MOD_TIMEOUT; 1594 sdp->timeout = SD_MOD_TIMEOUT;
diff --git a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c
index 4c95abb54057..a0cace9aeb79 100644
--- a/drivers/scsi/seagate.c
+++ b/drivers/scsi/seagate.c
@@ -97,6 +97,7 @@
97#include <linux/delay.h> 97#include <linux/delay.h>
98#include <linux/blkdev.h> 98#include <linux/blkdev.h>
99#include <linux/stat.h> 99#include <linux/stat.h>
100#include <linux/delay.h>
100 101
101#include <asm/io.h> 102#include <asm/io.h>
102#include <asm/system.h> 103#include <asm/system.h>
@@ -1631,7 +1632,7 @@ static int seagate_st0x_bus_reset(Scsi_Cmnd * SCpnt)
1631 /* assert RESET signal on SCSI bus. */ 1632 /* assert RESET signal on SCSI bus. */
1632 WRITE_CONTROL (BASE_CMD | CMD_RST); 1633 WRITE_CONTROL (BASE_CMD | CMD_RST);
1633 1634
1634 udelay (20 * 1000); 1635 mdelay (20);
1635 1636
1636 WRITE_CONTROL (BASE_CMD); 1637 WRITE_CONTROL (BASE_CMD);
1637 st0x_aborted = DID_RESET; 1638 st0x_aborted = DID_RESET;
@@ -1640,16 +1641,6 @@ static int seagate_st0x_bus_reset(Scsi_Cmnd * SCpnt)
1640 return SUCCESS; 1641 return SUCCESS;
1641} 1642}
1642 1643
1643static int seagate_st0x_host_reset(Scsi_Cmnd *SCpnt)
1644{
1645 return FAILED;
1646}
1647
1648static int seagate_st0x_device_reset(Scsi_Cmnd *SCpnt)
1649{
1650 return FAILED;
1651}
1652
1653static int seagate_st0x_release(struct Scsi_Host *shost) 1644static int seagate_st0x_release(struct Scsi_Host *shost)
1654{ 1645{
1655 if (shost->irq) 1646 if (shost->irq)
@@ -1665,8 +1656,6 @@ static Scsi_Host_Template driver_template = {
1665 .queuecommand = seagate_st0x_queue_command, 1656 .queuecommand = seagate_st0x_queue_command,
1666 .eh_abort_handler = seagate_st0x_abort, 1657 .eh_abort_handler = seagate_st0x_abort,
1667 .eh_bus_reset_handler = seagate_st0x_bus_reset, 1658 .eh_bus_reset_handler = seagate_st0x_bus_reset,
1668 .eh_host_reset_handler = seagate_st0x_host_reset,
1669 .eh_device_reset_handler = seagate_st0x_device_reset,
1670 .can_queue = 1, 1659 .can_queue = 1,
1671 .this_id = 7, 1660 .this_id = 7,
1672 .sg_tablesize = SG_ALL, 1661 .sg_tablesize = SG_ALL,
diff --git a/drivers/scsi/seagate.h b/drivers/scsi/seagate.h
index e49e8ecfb54d..8889ff1a6b20 100644
--- a/drivers/scsi/seagate.h
+++ b/drivers/scsi/seagate.h
@@ -15,7 +15,5 @@ static int seagate_st0x_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
15static int seagate_st0x_abort(Scsi_Cmnd *); 15static int seagate_st0x_abort(Scsi_Cmnd *);
16static const char *seagate_st0x_info(struct Scsi_Host *); 16static const char *seagate_st0x_info(struct Scsi_Host *);
17static int seagate_st0x_bus_reset(Scsi_Cmnd *); 17static int seagate_st0x_bus_reset(Scsi_Cmnd *);
18static int seagate_st0x_device_reset(Scsi_Cmnd *);
19static int seagate_st0x_host_reset(Scsi_Cmnd *);
20 18
21#endif /* _SEAGATE_H */ 19#endif /* _SEAGATE_H */
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 7936aafc3d05..51292f269ce5 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1430,7 +1430,7 @@ static struct file_operations sg_fops = {
1430 .fasync = sg_fasync, 1430 .fasync = sg_fasync,
1431}; 1431};
1432 1432
1433static struct class_simple * sg_sysfs_class; 1433static struct class *sg_sysfs_class;
1434 1434
1435static int sg_sysfs_valid = 0; 1435static int sg_sysfs_valid = 0;
1436 1436
@@ -1551,13 +1551,13 @@ sg_add(struct class_device *cl_dev)
1551 if (sg_sysfs_valid) { 1551 if (sg_sysfs_valid) {
1552 struct class_device * sg_class_member; 1552 struct class_device * sg_class_member;
1553 1553
1554 sg_class_member = class_simple_device_add(sg_sysfs_class, 1554 sg_class_member = class_device_create(sg_sysfs_class,
1555 MKDEV(SCSI_GENERIC_MAJOR, k), 1555 MKDEV(SCSI_GENERIC_MAJOR, k),
1556 cl_dev->dev, "%s", 1556 cl_dev->dev, "%s",
1557 disk->disk_name); 1557 disk->disk_name);
1558 if (IS_ERR(sg_class_member)) 1558 if (IS_ERR(sg_class_member))
1559 printk(KERN_WARNING "sg_add: " 1559 printk(KERN_WARNING "sg_add: "
1560 "class_simple_device_add failed\n"); 1560 "class_device_create failed\n");
1561 class_set_devdata(sg_class_member, sdp); 1561 class_set_devdata(sg_class_member, sdp);
1562 error = sysfs_create_link(&scsidp->sdev_gendev.kobj, 1562 error = sysfs_create_link(&scsidp->sdev_gendev.kobj,
1563 &sg_class_member->kobj, "generic"); 1563 &sg_class_member->kobj, "generic");
@@ -1636,7 +1636,7 @@ sg_remove(struct class_device *cl_dev)
1636 1636
1637 if (sdp) { 1637 if (sdp) {
1638 sysfs_remove_link(&scsidp->sdev_gendev.kobj, "generic"); 1638 sysfs_remove_link(&scsidp->sdev_gendev.kobj, "generic");
1639 class_simple_device_remove(MKDEV(SCSI_GENERIC_MAJOR, k)); 1639 class_device_destroy(sg_sysfs_class, MKDEV(SCSI_GENERIC_MAJOR, k));
1640 cdev_del(sdp->cdev); 1640 cdev_del(sdp->cdev);
1641 sdp->cdev = NULL; 1641 sdp->cdev = NULL;
1642 devfs_remove("%s/generic", scsidp->devfs_name); 1642 devfs_remove("%s/generic", scsidp->devfs_name);
@@ -1677,7 +1677,7 @@ init_sg(void)
1677 SG_MAX_DEVS, "sg"); 1677 SG_MAX_DEVS, "sg");
1678 if (rc) 1678 if (rc)
1679 return rc; 1679 return rc;
1680 sg_sysfs_class = class_simple_create(THIS_MODULE, "scsi_generic"); 1680 sg_sysfs_class = class_create(THIS_MODULE, "scsi_generic");
1681 if ( IS_ERR(sg_sysfs_class) ) { 1681 if ( IS_ERR(sg_sysfs_class) ) {
1682 rc = PTR_ERR(sg_sysfs_class); 1682 rc = PTR_ERR(sg_sysfs_class);
1683 goto err_out; 1683 goto err_out;
@@ -1690,7 +1690,7 @@ init_sg(void)
1690#endif /* CONFIG_SCSI_PROC_FS */ 1690#endif /* CONFIG_SCSI_PROC_FS */
1691 return 0; 1691 return 0;
1692 } 1692 }
1693 class_simple_destroy(sg_sysfs_class); 1693 class_destroy(sg_sysfs_class);
1694err_out: 1694err_out:
1695 unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), SG_MAX_DEVS); 1695 unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), SG_MAX_DEVS);
1696 return rc; 1696 return rc;
@@ -1703,7 +1703,7 @@ exit_sg(void)
1703 sg_proc_cleanup(); 1703 sg_proc_cleanup();
1704#endif /* CONFIG_SCSI_PROC_FS */ 1704#endif /* CONFIG_SCSI_PROC_FS */
1705 scsi_unregister_interface(&sg_interface); 1705 scsi_unregister_interface(&sg_interface);
1706 class_simple_destroy(sg_sysfs_class); 1706 class_destroy(sg_sysfs_class);
1707 sg_sysfs_valid = 0; 1707 sg_sysfs_valid = 0;
1708 unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), 1708 unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0),
1709 SG_MAX_DEVS); 1709 SG_MAX_DEVS);
@@ -2472,6 +2472,8 @@ sg_remove_request(Sg_fd * sfp, Sg_request * srp)
2472 if ((!sfp) || (!srp) || (!sfp->headrp)) 2472 if ((!sfp) || (!srp) || (!sfp->headrp))
2473 return res; 2473 return res;
2474 write_lock_irqsave(&sfp->rq_list_lock, iflags); 2474 write_lock_irqsave(&sfp->rq_list_lock, iflags);
2475 if (srp->my_cmdp)
2476 srp->my_cmdp->upper_private_data = NULL;
2475 prev_rp = sfp->headrp; 2477 prev_rp = sfp->headrp;
2476 if (srp == prev_rp) { 2478 if (srp == prev_rp) {
2477 sfp->headrp = prev_rp->nextrp; 2479 sfp->headrp = prev_rp->nextrp;
diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index 270f2aa88faa..a5ba2c692752 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -310,7 +310,14 @@ int sgiwd93_release(struct Scsi_Host *instance)
310static int sgiwd93_bus_reset(Scsi_Cmnd *cmd) 310static int sgiwd93_bus_reset(Scsi_Cmnd *cmd)
311{ 311{
312 /* FIXME perform bus-specific reset */ 312 /* FIXME perform bus-specific reset */
313
314 /* FIXME 2: kill this function, and let midlayer fallback
315 to the same result, calling wd33c93_host_reset() */
316
317 spin_lock_irq(cmd->device->host->host_lock);
313 wd33c93_host_reset(cmd); 318 wd33c93_host_reset(cmd);
319 spin_unlock_irq(cmd->device->host->host_lock);
320
314 return SUCCESS; 321 return SUCCESS;
315} 322}
316 323
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 265d1eed64fa..0291a8fb654d 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -17,7 +17,7 @@
17 Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support 17 Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support
18 */ 18 */
19 19
20static char *verstr = "20050312"; 20static char *verstr = "20050501";
21 21
22#include <linux/module.h> 22#include <linux/module.h>
23 23
@@ -29,6 +29,7 @@ static char *verstr = "20050312";
29#include <linux/string.h> 29#include <linux/string.h>
30#include <linux/errno.h> 30#include <linux/errno.h>
31#include <linux/mtio.h> 31#include <linux/mtio.h>
32#include <linux/cdrom.h>
32#include <linux/ioctl.h> 33#include <linux/ioctl.h>
33#include <linux/fcntl.h> 34#include <linux/fcntl.h>
34#include <linux/spinlock.h> 35#include <linux/spinlock.h>
@@ -50,6 +51,7 @@ static char *verstr = "20050312";
50#include <scsi/scsi_host.h> 51#include <scsi/scsi_host.h>
51#include <scsi/scsi_ioctl.h> 52#include <scsi/scsi_ioctl.h>
52#include <scsi/scsi_request.h> 53#include <scsi/scsi_request.h>
54#include <scsi/sg.h>
53 55
54 56
55/* The driver prints some debugging information on the console if DEBUG 57/* The driver prints some debugging information on the console if DEBUG
@@ -82,7 +84,7 @@ static int try_wdio = 1;
82static int st_dev_max; 84static int st_dev_max;
83static int st_nr_dev; 85static int st_nr_dev;
84 86
85static struct class_simple *st_sysfs_class; 87static struct class *st_sysfs_class;
86 88
87MODULE_AUTHOR("Kai Makisara"); 89MODULE_AUTHOR("Kai Makisara");
88MODULE_DESCRIPTION("SCSI Tape Driver"); 90MODULE_DESCRIPTION("SCSI Tape Driver");
@@ -3463,7 +3465,10 @@ static int st_ioctl(struct inode *inode, struct file *file,
3463 case SCSI_IOCTL_GET_BUS_NUMBER: 3465 case SCSI_IOCTL_GET_BUS_NUMBER:
3464 break; 3466 break;
3465 default: 3467 default:
3466 if (!capable(CAP_SYS_ADMIN)) 3468 if ((cmd_in == SG_IO ||
3469 cmd_in == SCSI_IOCTL_SEND_COMMAND ||
3470 cmd_in == CDROM_SEND_PACKET) &&
3471 !capable(CAP_SYS_RAWIO))
3467 i = -EPERM; 3472 i = -EPERM;
3468 else 3473 else
3469 i = scsi_cmd_ioctl(file, STp->disk, cmd_in, p); 3474 i = scsi_cmd_ioctl(file, STp->disk, cmd_in, p);
@@ -3471,10 +3476,12 @@ static int st_ioctl(struct inode *inode, struct file *file,
3471 return i; 3476 return i;
3472 break; 3477 break;
3473 } 3478 }
3474 if (!capable(CAP_SYS_ADMIN) && 3479 retval = scsi_ioctl(STp->device, cmd_in, p);
3475 (cmd_in == SCSI_IOCTL_START_UNIT || cmd_in == SCSI_IOCTL_STOP_UNIT)) 3480 if (!retval && cmd_in == SCSI_IOCTL_STOP_UNIT) { /* unload */
3476 return -EPERM; 3481 STp->rew_at_close = 0;
3477 return scsi_ioctl(STp->device, cmd_in, p); 3482 STp->ready = ST_NO_TAPE;
3483 }
3484 return retval;
3478 3485
3479 out: 3486 out:
3480 up(&STp->lock); 3487 up(&STp->lock);
@@ -4017,8 +4024,9 @@ out_free_tape:
4017 if (STm->cdevs[j]) { 4024 if (STm->cdevs[j]) {
4018 if (cdev == STm->cdevs[j]) 4025 if (cdev == STm->cdevs[j])
4019 cdev = NULL; 4026 cdev = NULL;
4020 class_simple_device_remove(MKDEV(SCSI_TAPE_MAJOR, 4027 class_device_destroy(st_sysfs_class,
4021 TAPE_MINOR(i, mode, j))); 4028 MKDEV(SCSI_TAPE_MAJOR,
4029 TAPE_MINOR(i, mode, j)));
4022 cdev_del(STm->cdevs[j]); 4030 cdev_del(STm->cdevs[j]);
4023 } 4031 }
4024 } 4032 }
@@ -4061,8 +4069,9 @@ static int st_remove(struct device *dev)
4061 devfs_remove("%s/mt%s", SDp->devfs_name, st_formats[j]); 4069 devfs_remove("%s/mt%s", SDp->devfs_name, st_formats[j]);
4062 devfs_remove("%s/mt%sn", SDp->devfs_name, st_formats[j]); 4070 devfs_remove("%s/mt%sn", SDp->devfs_name, st_formats[j]);
4063 for (j=0; j < 2; j++) { 4071 for (j=0; j < 2; j++) {
4064 class_simple_device_remove(MKDEV(SCSI_TAPE_MAJOR, 4072 class_device_destroy(st_sysfs_class,
4065 TAPE_MINOR(i, mode, j))); 4073 MKDEV(SCSI_TAPE_MAJOR,
4074 TAPE_MINOR(i, mode, j)));
4066 cdev_del(tpnt->modes[mode].cdevs[j]); 4075 cdev_del(tpnt->modes[mode].cdevs[j]);
4067 tpnt->modes[mode].cdevs[j] = NULL; 4076 tpnt->modes[mode].cdevs[j] = NULL;
4068 } 4077 }
@@ -4127,7 +4136,7 @@ static int __init init_st(void)
4127 "st: Version %s, fixed bufsize %d, s/g segs %d\n", 4136 "st: Version %s, fixed bufsize %d, s/g segs %d\n",
4128 verstr, st_fixed_buffer_size, st_max_sg_segs); 4137 verstr, st_fixed_buffer_size, st_max_sg_segs);
4129 4138
4130 st_sysfs_class = class_simple_create(THIS_MODULE, "scsi_tape"); 4139 st_sysfs_class = class_create(THIS_MODULE, "scsi_tape");
4131 if (IS_ERR(st_sysfs_class)) { 4140 if (IS_ERR(st_sysfs_class)) {
4132 st_sysfs_class = NULL; 4141 st_sysfs_class = NULL;
4133 printk(KERN_ERR "Unable create sysfs class for SCSI tapes\n"); 4142 printk(KERN_ERR "Unable create sysfs class for SCSI tapes\n");
@@ -4141,7 +4150,7 @@ static int __init init_st(void)
4141 return 0; 4150 return 0;
4142 } 4151 }
4143 if (st_sysfs_class) 4152 if (st_sysfs_class)
4144 class_simple_destroy(st_sysfs_class); 4153 class_destroy(st_sysfs_class);
4145 unregister_chrdev_region(MKDEV(SCSI_TAPE_MAJOR, 0), 4154 unregister_chrdev_region(MKDEV(SCSI_TAPE_MAJOR, 0),
4146 4155
4147 ST_MAX_TAPE_ENTRIES); 4156 ST_MAX_TAPE_ENTRIES);
@@ -4154,7 +4163,7 @@ static int __init init_st(void)
4154static void __exit exit_st(void) 4163static void __exit exit_st(void)
4155{ 4164{
4156 if (st_sysfs_class) 4165 if (st_sysfs_class)
4157 class_simple_destroy(st_sysfs_class); 4166 class_destroy(st_sysfs_class);
4158 st_sysfs_class = NULL; 4167 st_sysfs_class = NULL;
4159 do_remove_driverfs_files(); 4168 do_remove_driverfs_files();
4160 scsi_unregister_driver(&st_template.gendrv); 4169 scsi_unregister_driver(&st_template.gendrv);
@@ -4277,12 +4286,12 @@ static void do_create_class_files(struct scsi_tape *STp, int dev_num, int mode)
4277 snprintf(name, 10, "%s%s%s", rew ? "n" : "", 4286 snprintf(name, 10, "%s%s%s", rew ? "n" : "",
4278 STp->disk->disk_name, st_formats[i]); 4287 STp->disk->disk_name, st_formats[i]);
4279 st_class_member = 4288 st_class_member =
4280 class_simple_device_add(st_sysfs_class, 4289 class_device_create(st_sysfs_class,
4281 MKDEV(SCSI_TAPE_MAJOR, 4290 MKDEV(SCSI_TAPE_MAJOR,
4282 TAPE_MINOR(dev_num, mode, rew)), 4291 TAPE_MINOR(dev_num, mode, rew)),
4283 &STp->device->sdev_gendev, "%s", name); 4292 &STp->device->sdev_gendev, "%s", name);
4284 if (IS_ERR(st_class_member)) { 4293 if (IS_ERR(st_class_member)) {
4285 printk(KERN_WARNING "st%d: class_simple_device_add failed\n", 4294 printk(KERN_WARNING "st%d: class_device_create failed\n",
4286 dev_num); 4295 dev_num);
4287 goto out; 4296 goto out;
4288 } 4297 }
diff --git a/drivers/scsi/sun3x_esp.c b/drivers/scsi/sun3x_esp.c
index 5d1dc0e8ba21..09d7639079b4 100644
--- a/drivers/scsi/sun3x_esp.c
+++ b/drivers/scsi/sun3x_esp.c
@@ -23,8 +23,6 @@
23#include <asm/dvma.h> 23#include <asm/dvma.h>
24#include <asm/irq.h> 24#include <asm/irq.h>
25 25
26extern struct NCR_ESP *espchain;
27
28static void dma_barrier(struct NCR_ESP *esp); 26static void dma_barrier(struct NCR_ESP *esp);
29static int dma_bytes_sent(struct NCR_ESP *esp, int fifo_count); 27static int dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
30static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp); 28static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c
index ebfddd40ce67..ef19adc67eff 100644
--- a/drivers/scsi/sym53c416.c
+++ b/drivers/scsi/sym53c416.c
@@ -785,26 +785,14 @@ int sym53c416_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
785 return 0; 785 return 0;
786} 786}
787 787
788static int sym53c416_abort(Scsi_Cmnd *SCpnt)
789{
790 return FAILED;
791}
792
793static int sym53c416_bus_reset(Scsi_Cmnd *SCpnt)
794{
795 return FAILED;
796}
797
798static int sym53c416_device_reset(Scsi_Cmnd *SCpnt)
799{
800 return FAILED;
801}
802
803static int sym53c416_host_reset(Scsi_Cmnd *SCpnt) 788static int sym53c416_host_reset(Scsi_Cmnd *SCpnt)
804{ 789{
805 int base; 790 int base;
806 int scsi_id = -1; 791 int scsi_id = -1;
807 int i; 792 int i;
793 unsigned long flags;
794
795 spin_lock_irqsave(&sym53c416_lock, flags);
808 796
809 /* printk("sym53c416_reset\n"); */ 797 /* printk("sym53c416_reset\n"); */
810 base = SCpnt->device->host->io_port; 798 base = SCpnt->device->host->io_port;
@@ -816,6 +804,8 @@ static int sym53c416_host_reset(Scsi_Cmnd *SCpnt)
816 outb(NOOP | PIO_MODE, base + COMMAND_REG); 804 outb(NOOP | PIO_MODE, base + COMMAND_REG);
817 outb(RESET_SCSI_BUS, base + COMMAND_REG); 805 outb(RESET_SCSI_BUS, base + COMMAND_REG);
818 sym53c416_init(base, scsi_id); 806 sym53c416_init(base, scsi_id);
807
808 spin_unlock_irqrestore(&sym53c416_lock, flags);
819 return SUCCESS; 809 return SUCCESS;
820} 810}
821 811
@@ -865,10 +855,7 @@ static Scsi_Host_Template driver_template = {
865 .detect = sym53c416_detect, 855 .detect = sym53c416_detect,
866 .info = sym53c416_info, 856 .info = sym53c416_info,
867 .queuecommand = sym53c416_queuecommand, 857 .queuecommand = sym53c416_queuecommand,
868 .eh_abort_handler = sym53c416_abort,
869 .eh_host_reset_handler =sym53c416_host_reset, 858 .eh_host_reset_handler =sym53c416_host_reset,
870 .eh_bus_reset_handler = sym53c416_bus_reset,
871 .eh_device_reset_handler =sym53c416_device_reset,
872 .release = sym53c416_release, 859 .release = sym53c416_release,
873 .bios_param = sym53c416_bios_param, 860 .bios_param = sym53c416_bios_param,
874 .can_queue = 1, 861 .can_queue = 1,
diff --git a/drivers/scsi/sym53c416.h b/drivers/scsi/sym53c416.h
index 3c0e3f8301f1..fd6b120d38c4 100644
--- a/drivers/scsi/sym53c416.h
+++ b/drivers/scsi/sym53c416.h
@@ -26,10 +26,7 @@ static int sym53c416_detect(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 *));
29static int sym53c416_abort(Scsi_Cmnd *);
30static int sym53c416_host_reset(Scsi_Cmnd *); 29static int sym53c416_host_reset(Scsi_Cmnd *);
31static int sym53c416_bus_reset(Scsi_Cmnd *);
32static int sym53c416_device_reset(Scsi_Cmnd *);
33static int sym53c416_bios_param(struct scsi_device *, struct block_device *, 30static int sym53c416_bios_param(struct scsi_device *, struct block_device *,
34 sector_t, int *); 31 sector_t, int *);
35static void sym53c416_setup(char *str, int *ints); 32static void sym53c416_setup(char *str, int *ints);
diff --git a/drivers/scsi/sym53c8xx_2/sym_defs.h b/drivers/scsi/sym53c8xx_2/sym_defs.h
index 15bb89195c09..2d9437d7242b 100644
--- a/drivers/scsi/sym53c8xx_2/sym_defs.h
+++ b/drivers/scsi/sym53c8xx_2/sym_defs.h
@@ -40,7 +40,7 @@
40#ifndef SYM_DEFS_H 40#ifndef SYM_DEFS_H
41#define SYM_DEFS_H 41#define SYM_DEFS_H
42 42
43#define SYM_VERSION "2.2.0" 43#define SYM_VERSION "2.2.1"
44#define SYM_DRIVER_NAME "sym-" SYM_VERSION 44#define SYM_DRIVER_NAME "sym-" SYM_VERSION
45 45
46/* 46/*
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
index 5b07c6ec3ecc..d76766c3ce16 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -155,10 +155,11 @@ pci_get_base_address(struct pci_dev *pdev, int index, unsigned long *basep)
155 base = tmp; 155 base = tmp;
156 if ((tmp & 0x7) == PCI_BASE_ADDRESS_MEM_TYPE_64) { 156 if ((tmp & 0x7) == PCI_BASE_ADDRESS_MEM_TYPE_64) {
157 pci_read_config_dword(pdev, PCI_BAR_OFFSET(index++), &tmp); 157 pci_read_config_dword(pdev, PCI_BAR_OFFSET(index++), &tmp);
158 if (tmp > 0) 158 if (tmp > 0) {
159 dev_err(&pdev->dev, 159 dev_err(&pdev->dev,
160 "BAR %d is 64-bit, disabling\n", index - 1); 160 "BAR %d is 64-bit, disabling\n", index - 1);
161 base = 0; 161 base = 0;
162 }
162 } 163 }
163 164
164 if ((base & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO) { 165 if ((base & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO) {
@@ -389,13 +390,20 @@ static int sym_scatter_no_sglist(struct sym_hcb *np, struct sym_ccb *cp, struct
389{ 390{
390 struct sym_tblmove *data = &cp->phys.data[SYM_CONF_MAX_SG-1]; 391 struct sym_tblmove *data = &cp->phys.data[SYM_CONF_MAX_SG-1];
391 int segment; 392 int segment;
393 unsigned int len = cmd->request_bufflen;
392 394
393 cp->data_len = cmd->request_bufflen; 395 if (len) {
394
395 if (cmd->request_bufflen) {
396 dma_addr_t baddr = map_scsi_single_data(np, cmd); 396 dma_addr_t baddr = map_scsi_single_data(np, cmd);
397 if (baddr) { 397 if (baddr) {
398 sym_build_sge(np, data, baddr, cmd->request_bufflen); 398 if (len & 1) {
399 struct sym_tcb *tp = &np->target[cp->target];
400 if (tp->head.wval & EWS) {
401 len++;
402 cp->odd_byte_adjustment++;
403 }
404 }
405 cp->data_len = len;
406 sym_build_sge(np, data, baddr, len);
399 segment = 1; 407 segment = 1;
400 } else { 408 } else {
401 segment = -2; 409 segment = -2;
@@ -418,6 +426,7 @@ static int sym_scatter(struct sym_hcb *np, struct sym_ccb *cp, struct scsi_cmnd
418 segment = sym_scatter_no_sglist(np, cp, cmd); 426 segment = sym_scatter_no_sglist(np, cp, cmd);
419 else if ((use_sg = map_scsi_sg_data(np, cmd)) > 0) { 427 else if ((use_sg = map_scsi_sg_data(np, cmd)) > 0) {
420 struct scatterlist *scatter = (struct scatterlist *)cmd->buffer; 428 struct scatterlist *scatter = (struct scatterlist *)cmd->buffer;
429 struct sym_tcb *tp = &np->target[cp->target];
421 struct sym_tblmove *data; 430 struct sym_tblmove *data;
422 431
423 if (use_sg > SYM_CONF_MAX_SG) { 432 if (use_sg > SYM_CONF_MAX_SG) {
@@ -431,6 +440,11 @@ static int sym_scatter(struct sym_hcb *np, struct sym_ccb *cp, struct scsi_cmnd
431 dma_addr_t baddr = sg_dma_address(&scatter[segment]); 440 dma_addr_t baddr = sg_dma_address(&scatter[segment]);
432 unsigned int len = sg_dma_len(&scatter[segment]); 441 unsigned int len = sg_dma_len(&scatter[segment]);
433 442
443 if ((len & 1) && (tp->head.wval & EWS)) {
444 len++;
445 cp->odd_byte_adjustment++;
446 }
447
434 sym_build_sge(np, &data[segment], baddr, len); 448 sym_build_sge(np, &data[segment], baddr, len);
435 cp->data_len += len; 449 cp->data_len += len;
436 } 450 }
@@ -456,10 +470,8 @@ static int sym_queue_command(struct sym_hcb *np, struct scsi_cmnd *cmd)
456 * Minimal checkings, so that we will not 470 * Minimal checkings, so that we will not
457 * go outside our tables. 471 * go outside our tables.
458 */ 472 */
459 if (sdev->id == np->myaddr || 473 if (sdev->id == np->myaddr) {
460 sdev->id >= SYM_CONF_MAX_TARGET || 474 sym_xpt_done2(np, cmd, DID_NO_CONNECT);
461 sdev->lun >= SYM_CONF_MAX_LUN) {
462 sym_xpt_done2(np, cmd, CAM_DEV_NOT_THERE);
463 return 0; 475 return 0;
464 } 476 }
465 477
@@ -469,28 +481,6 @@ static int sym_queue_command(struct sym_hcb *np, struct scsi_cmnd *cmd)
469 tp = &np->target[sdev->id]; 481 tp = &np->target[sdev->id];
470 482
471 /* 483 /*
472 * Complete the 1st INQUIRY command with error
473 * condition if the device is flagged NOSCAN
474 * at BOOT in the NVRAM. This may speed up
475 * the boot and maintain coherency with BIOS
476 * device numbering. Clearing the flag allows
477 * user to rescan skipped devices later.
478 * We also return error for devices not flagged
479 * for SCAN LUNS in the NVRAM since some mono-lun
480 * devices behave badly when asked for some non
481 * zero LUN. Btw, this is an absolute hack.:-)
482 */
483 if (cmd->cmnd[0] == 0x12 || cmd->cmnd[0] == 0x0) {
484 if ((tp->usrflags & SYM_SCAN_BOOT_DISABLED) ||
485 ((tp->usrflags & SYM_SCAN_LUNS_DISABLED) &&
486 sdev->lun != 0)) {
487 tp->usrflags &= ~SYM_SCAN_BOOT_DISABLED;
488 sym_xpt_done2(np, cmd, CAM_DEV_NOT_THERE);
489 return 0;
490 }
491 }
492
493 /*
494 * Select tagged/untagged. 484 * Select tagged/untagged.
495 */ 485 */
496 lp = sym_lp(tp, sdev->lun); 486 lp = sym_lp(tp, sdev->lun);
@@ -511,23 +501,10 @@ static int sym_queue_command(struct sym_hcb *np, struct scsi_cmnd *cmd)
511 */ 501 */
512static inline int sym_setup_cdb(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp) 502static inline int sym_setup_cdb(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp)
513{ 503{
514 u32 cmd_ba;
515 int cmd_len;
516
517 /*
518 * CDB is 16 bytes max.
519 */
520 if (cmd->cmd_len > sizeof(cp->cdb_buf)) {
521 sym_set_cam_status(cp->cmd, CAM_REQ_INVALID);
522 return -1;
523 }
524
525 memcpy(cp->cdb_buf, cmd->cmnd, cmd->cmd_len); 504 memcpy(cp->cdb_buf, cmd->cmnd, cmd->cmd_len);
526 cmd_ba = CCB_BA (cp, cdb_buf[0]);
527 cmd_len = cmd->cmd_len;
528 505
529 cp->phys.cmd.addr = cpu_to_scr(cmd_ba); 506 cp->phys.cmd.addr = CCB_BA(cp, cdb_buf[0]);
530 cp->phys.cmd.size = cpu_to_scr(cmd_len); 507 cp->phys.cmd.size = cpu_to_scr(cmd->cmd_len);
531 508
532 return 0; 509 return 0;
533} 510}
@@ -554,10 +531,7 @@ int sym_setup_data_and_start(struct sym_hcb *np, struct scsi_cmnd *cmd, struct s
554 if (dir != DMA_NONE) { 531 if (dir != DMA_NONE) {
555 cp->segments = sym_scatter(np, cp, cmd); 532 cp->segments = sym_scatter(np, cp, cmd);
556 if (cp->segments < 0) { 533 if (cp->segments < 0) {
557 if (cp->segments == -2) 534 sym_set_cam_status(cmd, DID_ERROR);
558 sym_set_cam_status(cmd, CAM_RESRC_UNAVAIL);
559 else
560 sym_set_cam_status(cmd, CAM_REQ_TOO_BIG);
561 goto out_abort; 535 goto out_abort;
562 } 536 }
563 } else { 537 } else {
@@ -855,7 +829,7 @@ prepare:
855 ep->to_do = to_do; 829 ep->to_do = to_do;
856 /* Complete the command with locks held as required by the driver */ 830 /* Complete the command with locks held as required by the driver */
857 if (to_do == SYM_EH_DO_COMPLETE) 831 if (to_do == SYM_EH_DO_COMPLETE)
858 sym_xpt_done2(np, cmd, CAM_REQ_ABORTED); 832 sym_xpt_done2(np, cmd, DID_ABORT);
859 833
860 /* Wait for completion with locks released, as required by kernel */ 834 /* Wait for completion with locks released, as required by kernel */
861 if (to_do == SYM_EH_DO_WAIT) { 835 if (to_do == SYM_EH_DO_WAIT) {
@@ -882,22 +856,46 @@ prepare:
882 */ 856 */
883static int sym53c8xx_eh_abort_handler(struct scsi_cmnd *cmd) 857static int sym53c8xx_eh_abort_handler(struct scsi_cmnd *cmd)
884{ 858{
885 return sym_eh_handler(SYM_EH_ABORT, "ABORT", cmd); 859 int rc;
860
861 spin_lock_irq(cmd->device->host->host_lock);
862 rc = sym_eh_handler(SYM_EH_ABORT, "ABORT", cmd);
863 spin_unlock_irq(cmd->device->host->host_lock);
864
865 return rc;
886} 866}
887 867
888static int sym53c8xx_eh_device_reset_handler(struct scsi_cmnd *cmd) 868static int sym53c8xx_eh_device_reset_handler(struct scsi_cmnd *cmd)
889{ 869{
890 return sym_eh_handler(SYM_EH_DEVICE_RESET, "DEVICE RESET", cmd); 870 int rc;
871
872 spin_lock_irq(cmd->device->host->host_lock);
873 rc = sym_eh_handler(SYM_EH_DEVICE_RESET, "DEVICE RESET", cmd);
874 spin_unlock_irq(cmd->device->host->host_lock);
875
876 return rc;
891} 877}
892 878
893static int sym53c8xx_eh_bus_reset_handler(struct scsi_cmnd *cmd) 879static int sym53c8xx_eh_bus_reset_handler(struct scsi_cmnd *cmd)
894{ 880{
895 return sym_eh_handler(SYM_EH_BUS_RESET, "BUS RESET", cmd); 881 int rc;
882
883 spin_lock_irq(cmd->device->host->host_lock);
884 rc = sym_eh_handler(SYM_EH_BUS_RESET, "BUS RESET", cmd);
885 spin_unlock_irq(cmd->device->host->host_lock);
886
887 return rc;
896} 888}
897 889
898static int sym53c8xx_eh_host_reset_handler(struct scsi_cmnd *cmd) 890static int sym53c8xx_eh_host_reset_handler(struct scsi_cmnd *cmd)
899{ 891{
900 return sym_eh_handler(SYM_EH_HOST_RESET, "HOST RESET", cmd); 892 int rc;
893
894 spin_lock_irq(cmd->device->host->host_lock);
895 rc = sym_eh_handler(SYM_EH_HOST_RESET, "HOST RESET", cmd);
896 spin_unlock_irq(cmd->device->host->host_lock);
897
898 return rc;
901} 899}
902 900
903/* 901/*
@@ -921,7 +919,7 @@ static void sym_tune_dev_queuing(struct sym_tcb *tp, int lun, u_short reqtags)
921 lp->s.reqtags = reqtags; 919 lp->s.reqtags = reqtags;
922 920
923 if (reqtags != oldtags) { 921 if (reqtags != oldtags) {
924 dev_info(&tp->sdev->sdev_target->dev, 922 dev_info(&tp->starget->dev,
925 "tagged command queuing %s, command queue depth %d.\n", 923 "tagged command queuing %s, command queue depth %d.\n",
926 lp->s.reqtags ? "enabled" : "disabled", 924 lp->s.reqtags ? "enabled" : "disabled",
927 lp->started_limit); 925 lp->started_limit);
@@ -981,22 +979,34 @@ static int device_queue_depth(struct sym_hcb *np, int target, int lun)
981 return DEF_DEPTH; 979 return DEF_DEPTH;
982} 980}
983 981
984static int sym53c8xx_slave_alloc(struct scsi_device *device) 982static int sym53c8xx_slave_alloc(struct scsi_device *sdev)
985{ 983{
986 struct sym_hcb *np = sym_get_hcb(device->host); 984 struct sym_hcb *np;
987 struct sym_tcb *tp = &np->target[device->id]; 985 struct sym_tcb *tp;
988 if (!tp->sdev)
989 tp->sdev = device;
990 986
991 return 0; 987 if (sdev->id >= SYM_CONF_MAX_TARGET || sdev->lun >= SYM_CONF_MAX_LUN)
992} 988 return -ENXIO;
993 989
994static void sym53c8xx_slave_destroy(struct scsi_device *device) 990 np = sym_get_hcb(sdev->host);
995{ 991 tp = &np->target[sdev->id];
996 struct sym_hcb *np = sym_get_hcb(device->host); 992
997 struct sym_tcb *tp = &np->target[device->id]; 993 /*
998 if (tp->sdev == device) 994 * Fail the device init if the device is flagged NOSCAN at BOOT in
999 tp->sdev = NULL; 995 * the NVRAM. This may speed up boot and maintain coherency with
996 * BIOS device numbering. Clearing the flag allows the user to
997 * rescan skipped devices later. We also return an error for
998 * devices not flagged for SCAN LUNS in the NVRAM since some single
999 * lun devices behave badly when asked for a non zero LUN.
1000 */
1001
1002 if ((tp->usrflags & SYM_SCAN_BOOT_DISABLED) ||
1003 ((tp->usrflags & SYM_SCAN_LUNS_DISABLED) && sdev->lun != 0)) {
1004 tp->usrflags &= ~SYM_SCAN_BOOT_DISABLED;
1005 return -ENXIO;
1006 }
1007
1008 tp->starget = sdev->sdev_target;
1009 return 0;
1000} 1010}
1001 1011
1002/* 1012/*
@@ -1897,6 +1907,7 @@ static int sym_detach(struct sym_hcb *np, struct pci_dev *pdev)
1897 */ 1907 */
1898 printk("%s: resetting chip\n", sym_name(np)); 1908 printk("%s: resetting chip\n", sym_name(np));
1899 OUTB(np, nc_istat, SRST); 1909 OUTB(np, nc_istat, SRST);
1910 INB(np, nc_mbox1);
1900 udelay(10); 1911 udelay(10);
1901 OUTB(np, nc_istat, 0); 1912 OUTB(np, nc_istat, 0);
1902 1913
@@ -1915,7 +1926,6 @@ static struct scsi_host_template sym2_template = {
1915 .queuecommand = sym53c8xx_queue_command, 1926 .queuecommand = sym53c8xx_queue_command,
1916 .slave_alloc = sym53c8xx_slave_alloc, 1927 .slave_alloc = sym53c8xx_slave_alloc,
1917 .slave_configure = sym53c8xx_slave_configure, 1928 .slave_configure = sym53c8xx_slave_configure,
1918 .slave_destroy = sym53c8xx_slave_destroy,
1919 .eh_abort_handler = sym53c8xx_eh_abort_handler, 1929 .eh_abort_handler = sym53c8xx_eh_abort_handler,
1920 .eh_device_reset_handler = sym53c8xx_eh_device_reset_handler, 1930 .eh_device_reset_handler = sym53c8xx_eh_device_reset_handler,
1921 .eh_bus_reset_handler = sym53c8xx_eh_bus_reset_handler, 1931 .eh_bus_reset_handler = sym53c8xx_eh_bus_reset_handler,
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.h b/drivers/scsi/sym53c8xx_2/sym_glue.h
index e943f167fb51..d3d52f14d7c0 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.h
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.h
@@ -142,33 +142,6 @@
142#define scr_to_cpu(dw) le32_to_cpu(dw) 142#define scr_to_cpu(dw) le32_to_cpu(dw)
143 143
144/* 144/*
145 * Remap some status field values.
146 */
147#define CAM_REQ_CMP DID_OK
148#define CAM_SEL_TIMEOUT DID_NO_CONNECT
149#define CAM_CMD_TIMEOUT DID_TIME_OUT
150#define CAM_REQ_ABORTED DID_ABORT
151#define CAM_UNCOR_PARITY DID_PARITY
152#define CAM_SCSI_BUS_RESET DID_RESET
153#define CAM_REQUEUE_REQ DID_SOFT_ERROR
154#define CAM_UNEXP_BUSFREE DID_ERROR
155#define CAM_SCSI_BUSY DID_BUS_BUSY
156
157#define CAM_DEV_NOT_THERE DID_NO_CONNECT
158#define CAM_REQ_INVALID DID_ERROR
159#define CAM_REQ_TOO_BIG DID_ERROR
160
161#define CAM_RESRC_UNAVAIL DID_ERROR
162
163/*
164 * Remap data direction values.
165 */
166#define CAM_DIR_NONE DMA_NONE
167#define CAM_DIR_IN DMA_FROM_DEVICE
168#define CAM_DIR_OUT DMA_TO_DEVICE
169#define CAM_DIR_UNKNOWN DMA_BIDIRECTIONAL
170
171/*
172 * These ones are used as return code from 145 * These ones are used as return code from
173 * error recovery handlers under Linux. 146 * error recovery handlers under Linux.
174 */ 147 */
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index 50a176b3888d..e753ba27dc59 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -97,7 +97,7 @@ static void sym_print_msg(struct sym_ccb *cp, char *label, u_char *msg)
97static void sym_print_nego_msg(struct sym_hcb *np, int target, char *label, u_char *msg) 97static void sym_print_nego_msg(struct sym_hcb *np, int target, char *label, u_char *msg)
98{ 98{
99 struct sym_tcb *tp = &np->target[target]; 99 struct sym_tcb *tp = &np->target[target];
100 dev_info(&tp->sdev->sdev_target->dev, "%s: ", label); 100 dev_info(&tp->starget->dev, "%s: ", label);
101 101
102 sym_show_msg(msg); 102 sym_show_msg(msg);
103 printf(".\n"); 103 printf(".\n");
@@ -149,8 +149,10 @@ static char *sym_scsi_bus_mode(int mode)
149static void sym_chip_reset (struct sym_hcb *np) 149static void sym_chip_reset (struct sym_hcb *np)
150{ 150{
151 OUTB(np, nc_istat, SRST); 151 OUTB(np, nc_istat, SRST);
152 INB(np, nc_mbox1);
152 udelay(10); 153 udelay(10);
153 OUTB(np, nc_istat, 0); 154 OUTB(np, nc_istat, 0);
155 INB(np, nc_mbox1);
154 udelay(2000); /* For BUS MODE to settle */ 156 udelay(2000); /* For BUS MODE to settle */
155} 157}
156 158
@@ -216,6 +218,7 @@ int sym_reset_scsi_bus(struct sym_hcb *np, int enab_int)
216 OUTB(np, nc_stest3, TE); 218 OUTB(np, nc_stest3, TE);
217 OUTB(np, nc_dcntl, (np->rv_dcntl & IRQM)); 219 OUTB(np, nc_dcntl, (np->rv_dcntl & IRQM));
218 OUTB(np, nc_scntl1, CRST); 220 OUTB(np, nc_scntl1, CRST);
221 INB(np, nc_mbox1);
219 udelay(200); 222 udelay(200);
220 223
221 if (!SYM_SETUP_SCSI_BUS_CHECK) 224 if (!SYM_SETUP_SCSI_BUS_CHECK)
@@ -280,8 +283,10 @@ static void sym_selectclock(struct sym_hcb *np, u_char scntl3)
280 if (!i) 283 if (!i)
281 printf("%s: the chip cannot lock the frequency\n", 284 printf("%s: the chip cannot lock the frequency\n",
282 sym_name(np)); 285 sym_name(np));
283 } else 286 } else {
284 udelay((50+10)); 287 INB(np, nc_mbox1);
288 udelay(50+10);
289 }
285 OUTB(np, nc_stest3, HSC); /* Halt the scsi clock */ 290 OUTB(np, nc_stest3, HSC); /* Halt the scsi clock */
286 OUTB(np, nc_scntl3, scntl3); 291 OUTB(np, nc_scntl3, scntl3);
287 OUTB(np, nc_stest1, (DBLEN|DBLSEL));/* Select clock multiplier */ 292 OUTB(np, nc_stest1, (DBLEN|DBLSEL));/* Select clock multiplier */
@@ -1445,7 +1450,7 @@ static void sym_check_goals(struct sym_hcb *np, struct scsi_target *starget,
1445static int sym_prepare_nego(struct sym_hcb *np, struct sym_ccb *cp, u_char *msgptr) 1450static int sym_prepare_nego(struct sym_hcb *np, struct sym_ccb *cp, u_char *msgptr)
1446{ 1451{
1447 struct sym_tcb *tp = &np->target[cp->target]; 1452 struct sym_tcb *tp = &np->target[cp->target];
1448 struct scsi_target *starget = tp->sdev->sdev_target; 1453 struct scsi_target *starget = tp->starget;
1449 struct sym_trans *goal = &tp->tgoal; 1454 struct sym_trans *goal = &tp->tgoal;
1450 int msglen = 0; 1455 int msglen = 0;
1451 int nego; 1456 int nego;
@@ -1690,7 +1695,7 @@ static void sym_flush_comp_queue(struct sym_hcb *np, int cam_status)
1690 if (cam_status) 1695 if (cam_status)
1691 sym_set_cam_status(cmd, cam_status); 1696 sym_set_cam_status(cmd, cam_status);
1692#ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING 1697#ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING
1693 if (sym_get_cam_status(cmd) == CAM_REQUEUE_REQ) { 1698 if (sym_get_cam_status(cmd) == DID_SOFT_ERROR) {
1694 struct sym_tcb *tp = &np->target[cp->target]; 1699 struct sym_tcb *tp = &np->target[cp->target];
1695 struct sym_lcb *lp = sym_lp(tp, cp->lun); 1700 struct sym_lcb *lp = sym_lp(tp, cp->lun);
1696 if (lp) { 1701 if (lp) {
@@ -1791,12 +1796,13 @@ void sym_start_up (struct sym_hcb *np, int reason)
1791 /* 1796 /*
1792 * Wakeup all pending jobs. 1797 * Wakeup all pending jobs.
1793 */ 1798 */
1794 sym_flush_busy_queue(np, CAM_SCSI_BUS_RESET); 1799 sym_flush_busy_queue(np, DID_RESET);
1795 1800
1796 /* 1801 /*
1797 * Init chip. 1802 * Init chip.
1798 */ 1803 */
1799 OUTB(np, nc_istat, 0x00); /* Remove Reset, abort */ 1804 OUTB(np, nc_istat, 0x00); /* Remove Reset, abort */
1805 INB(np, nc_mbox1);
1800 udelay(2000); /* The 895 needs time for the bus mode to settle */ 1806 udelay(2000); /* The 895 needs time for the bus mode to settle */
1801 1807
1802 OUTB(np, nc_scntl0, np->rv_scntl0 | 0xc0); 1808 OUTB(np, nc_scntl0, np->rv_scntl0 | 0xc0);
@@ -1905,6 +1911,7 @@ void sym_start_up (struct sym_hcb *np, int reason)
1905 if (np->features & (FE_ULTRA2|FE_ULTRA3)) { 1911 if (np->features & (FE_ULTRA2|FE_ULTRA3)) {
1906 OUTONW(np, nc_sien, SBMC); 1912 OUTONW(np, nc_sien, SBMC);
1907 if (reason == 0) { 1913 if (reason == 0) {
1914 INB(np, nc_mbox1);
1908 mdelay(100); 1915 mdelay(100);
1909 INW(np, nc_sist); 1916 INW(np, nc_sist);
1910 } 1917 }
@@ -2074,7 +2081,7 @@ static void sym_settrans(struct sym_hcb *np, int target, u_char opts, u_char ofs
2074static void sym_setwide(struct sym_hcb *np, int target, u_char wide) 2081static void sym_setwide(struct sym_hcb *np, int target, u_char wide)
2075{ 2082{
2076 struct sym_tcb *tp = &np->target[target]; 2083 struct sym_tcb *tp = &np->target[target];
2077 struct scsi_target *starget = tp->sdev->sdev_target; 2084 struct scsi_target *starget = tp->starget;
2078 2085
2079 if (spi_width(starget) == wide) 2086 if (spi_width(starget) == wide)
2080 return; 2087 return;
@@ -2102,7 +2109,7 @@ sym_setsync(struct sym_hcb *np, int target,
2102 u_char ofs, u_char per, u_char div, u_char fak) 2109 u_char ofs, u_char per, u_char div, u_char fak)
2103{ 2110{
2104 struct sym_tcb *tp = &np->target[target]; 2111 struct sym_tcb *tp = &np->target[target];
2105 struct scsi_target *starget = tp->sdev->sdev_target; 2112 struct scsi_target *starget = tp->starget;
2106 u_char wide = (tp->head.wval & EWS) ? BUS_16_BIT : BUS_8_BIT; 2113 u_char wide = (tp->head.wval & EWS) ? BUS_16_BIT : BUS_8_BIT;
2107 2114
2108 sym_settrans(np, target, 0, ofs, per, wide, div, fak); 2115 sym_settrans(np, target, 0, ofs, per, wide, div, fak);
@@ -2129,7 +2136,7 @@ sym_setpprot(struct sym_hcb *np, int target, u_char opts, u_char ofs,
2129 u_char per, u_char wide, u_char div, u_char fak) 2136 u_char per, u_char wide, u_char div, u_char fak)
2130{ 2137{
2131 struct sym_tcb *tp = &np->target[target]; 2138 struct sym_tcb *tp = &np->target[target];
2132 struct scsi_target *starget = tp->sdev->sdev_target; 2139 struct scsi_target *starget = tp->starget;
2133 2140
2134 sym_settrans(np, target, opts, ofs, per, wide, div, fak); 2141 sym_settrans(np, target, opts, ofs, per, wide, div, fak);
2135 2142
@@ -2944,7 +2951,7 @@ unknown_int:
2944 * Dequeue from the START queue all CCBs that match 2951 * Dequeue from the START queue all CCBs that match
2945 * a given target/lun/task condition (-1 means all), 2952 * a given target/lun/task condition (-1 means all),
2946 * and move them from the BUSY queue to the COMP queue 2953 * and move them from the BUSY queue to the COMP queue
2947 * with CAM_REQUEUE_REQ status condition. 2954 * with DID_SOFT_ERROR status condition.
2948 * This function is used during error handling/recovery. 2955 * This function is used during error handling/recovery.
2949 * It is called with SCRIPTS not running. 2956 * It is called with SCRIPTS not running.
2950 */ 2957 */
@@ -2974,7 +2981,7 @@ sym_dequeue_from_squeue(struct sym_hcb *np, int i, int target, int lun, int task
2974 if ((target == -1 || cp->target == target) && 2981 if ((target == -1 || cp->target == target) &&
2975 (lun == -1 || cp->lun == lun) && 2982 (lun == -1 || cp->lun == lun) &&
2976 (task == -1 || cp->tag == task)) { 2983 (task == -1 || cp->tag == task)) {
2977 sym_set_cam_status(cp->cmd, CAM_REQUEUE_REQ); 2984 sym_set_cam_status(cp->cmd, DID_SOFT_ERROR);
2978 sym_remque(&cp->link_ccbq); 2985 sym_remque(&cp->link_ccbq);
2979 sym_insque_tail(&cp->link_ccbq, &np->comp_ccbq); 2986 sym_insque_tail(&cp->link_ccbq, &np->comp_ccbq);
2980 } 2987 }
@@ -3093,13 +3100,13 @@ static void sym_sir_bad_scsi_status(struct sym_hcb *np, int num, struct sym_ccb
3093 /* 3100 /*
3094 * Message table indirect structure. 3101 * Message table indirect structure.
3095 */ 3102 */
3096 cp->phys.smsg.addr = cpu_to_scr(CCB_BA(cp, scsi_smsg2)); 3103 cp->phys.smsg.addr = CCB_BA(cp, scsi_smsg2);
3097 cp->phys.smsg.size = cpu_to_scr(msglen); 3104 cp->phys.smsg.size = cpu_to_scr(msglen);
3098 3105
3099 /* 3106 /*
3100 * sense command 3107 * sense command
3101 */ 3108 */
3102 cp->phys.cmd.addr = cpu_to_scr(CCB_BA(cp, sensecmd)); 3109 cp->phys.cmd.addr = CCB_BA(cp, sensecmd);
3103 cp->phys.cmd.size = cpu_to_scr(6); 3110 cp->phys.cmd.size = cpu_to_scr(6);
3104 3111
3105 /* 3112 /*
@@ -3116,7 +3123,7 @@ static void sym_sir_bad_scsi_status(struct sym_hcb *np, int num, struct sym_ccb
3116 * sense data 3123 * sense data
3117 */ 3124 */
3118 memset(cp->sns_bbuf, 0, SYM_SNS_BBUF_LEN); 3125 memset(cp->sns_bbuf, 0, SYM_SNS_BBUF_LEN);
3119 cp->phys.sense.addr = cpu_to_scr(CCB_BA(cp, sns_bbuf)); 3126 cp->phys.sense.addr = CCB_BA(cp, sns_bbuf);
3120 cp->phys.sense.size = cpu_to_scr(SYM_SNS_BBUF_LEN); 3127 cp->phys.sense.size = cpu_to_scr(SYM_SNS_BBUF_LEN);
3121 3128
3122 /* 3129 /*
@@ -3198,7 +3205,7 @@ int sym_clear_tasks(struct sym_hcb *np, int cam_status, int target, int lun, int
3198 sym_insque_tail(&cp->link_ccbq, &np->comp_ccbq); 3205 sym_insque_tail(&cp->link_ccbq, &np->comp_ccbq);
3199 3206
3200 /* Preserve the software timeout condition */ 3207 /* Preserve the software timeout condition */
3201 if (sym_get_cam_status(cmd) != CAM_CMD_TIMEOUT) 3208 if (sym_get_cam_status(cmd) != DID_TIME_OUT)
3202 sym_set_cam_status(cmd, cam_status); 3209 sym_set_cam_status(cmd, cam_status);
3203 ++i; 3210 ++i;
3204#if 0 3211#if 0
@@ -3366,7 +3373,7 @@ static void sym_sir_task_recovery(struct sym_hcb *np, int num)
3366 * Make sure at least our IO to abort has been dequeued. 3373 * Make sure at least our IO to abort has been dequeued.
3367 */ 3374 */
3368#ifndef SYM_OPT_HANDLE_DEVICE_QUEUEING 3375#ifndef SYM_OPT_HANDLE_DEVICE_QUEUEING
3369 assert(i && sym_get_cam_status(cp->cmd) == CAM_REQUEUE_REQ); 3376 assert(i && sym_get_cam_status(cp->cmd) == DID_SOFT_ERROR);
3370#else 3377#else
3371 sym_remque(&cp->link_ccbq); 3378 sym_remque(&cp->link_ccbq);
3372 sym_insque_tail(&cp->link_ccbq, &np->comp_ccbq); 3379 sym_insque_tail(&cp->link_ccbq, &np->comp_ccbq);
@@ -3375,9 +3382,9 @@ static void sym_sir_task_recovery(struct sym_hcb *np, int num)
3375 * Keep track in cam status of the reason of the abort. 3382 * Keep track in cam status of the reason of the abort.
3376 */ 3383 */
3377 if (cp->to_abort == 2) 3384 if (cp->to_abort == 2)
3378 sym_set_cam_status(cp->cmd, CAM_CMD_TIMEOUT); 3385 sym_set_cam_status(cp->cmd, DID_TIME_OUT);
3379 else 3386 else
3380 sym_set_cam_status(cp->cmd, CAM_REQ_ABORTED); 3387 sym_set_cam_status(cp->cmd, DID_ABORT);
3381 3388
3382 /* 3389 /*
3383 * Complete with error everything that we have dequeued. 3390 * Complete with error everything that we have dequeued.
@@ -3491,7 +3498,7 @@ static void sym_sir_task_recovery(struct sym_hcb *np, int num)
3491 * conditions not due to timeout. 3498 * conditions not due to timeout.
3492 */ 3499 */
3493 if (cp->to_abort == 2) 3500 if (cp->to_abort == 2)
3494 sym_set_cam_status(cp->cmd, CAM_CMD_TIMEOUT); 3501 sym_set_cam_status(cp->cmd, DID_TIME_OUT);
3495 cp->to_abort = 0; /* We donnot expect to fail here */ 3502 cp->to_abort = 0; /* We donnot expect to fail here */
3496 break; 3503 break;
3497 3504
@@ -3502,7 +3509,7 @@ static void sym_sir_task_recovery(struct sym_hcb *np, int num)
3502 case SIR_ABORT_SENT: 3509 case SIR_ABORT_SENT:
3503 target = INB(np, nc_sdid) & 0xf; 3510 target = INB(np, nc_sdid) & 0xf;
3504 tp = &np->target[target]; 3511 tp = &np->target[target];
3505 starget = tp->sdev->sdev_target; 3512 starget = tp->starget;
3506 3513
3507 /* 3514 /*
3508 ** If we didn't abort anything, leave here. 3515 ** If we didn't abort anything, leave here.
@@ -3551,7 +3558,7 @@ static void sym_sir_task_recovery(struct sym_hcb *np, int num)
3551 */ 3558 */
3552 i = (INL(np, nc_scratcha) - np->squeue_ba) / 4; 3559 i = (INL(np, nc_scratcha) - np->squeue_ba) / 4;
3553 sym_dequeue_from_squeue(np, i, target, lun, -1); 3560 sym_dequeue_from_squeue(np, i, target, lun, -1);
3554 sym_clear_tasks(np, CAM_REQ_ABORTED, target, lun, task); 3561 sym_clear_tasks(np, DID_ABORT, target, lun, task);
3555 sym_flush_comp_queue(np, 0); 3562 sym_flush_comp_queue(np, 0);
3556 3563
3557 /* 3564 /*
@@ -3566,7 +3573,7 @@ static void sym_sir_task_recovery(struct sym_hcb *np, int num)
3566 * Print to the log the message we intend to send. 3573 * Print to the log the message we intend to send.
3567 */ 3574 */
3568 if (num == SIR_TARGET_SELECTED) { 3575 if (num == SIR_TARGET_SELECTED) {
3569 dev_info(&tp->sdev->sdev_target->dev, "control msgout:"); 3576 dev_info(&tp->starget->dev, "control msgout:");
3570 sym_printl_hex(np->abrt_msg, np->abrt_tbl.size); 3577 sym_printl_hex(np->abrt_msg, np->abrt_tbl.size);
3571 np->abrt_tbl.size = cpu_to_scr(np->abrt_tbl.size); 3578 np->abrt_tbl.size = cpu_to_scr(np->abrt_tbl.size);
3572 } 3579 }
@@ -3877,6 +3884,8 @@ int sym_compute_residual(struct sym_hcb *np, struct sym_ccb *cp)
3877 resid += (tmp & 0xffffff); 3884 resid += (tmp & 0xffffff);
3878 } 3885 }
3879 3886
3887 resid -= cp->odd_byte_adjustment;
3888
3880 /* 3889 /*
3881 * Hopefully, the result is not too wrong. 3890 * Hopefully, the result is not too wrong.
3882 */ 3891 */
@@ -4758,10 +4767,8 @@ struct sym_ccb *sym_get_ccb (struct sym_hcb *np, struct scsi_cmnd *cmd, u_char t
4758 } 4767 }
4759 4768
4760#endif 4769#endif
4761 /*
4762 * Remember all informations needed to free this CCB.
4763 */
4764 cp->to_abort = 0; 4770 cp->to_abort = 0;
4771 cp->odd_byte_adjustment = 0;
4765 cp->tag = tag; 4772 cp->tag = tag;
4766 cp->order = tag_order; 4773 cp->order = tag_order;
4767 cp->target = tn; 4774 cp->target = tn;
@@ -5104,7 +5111,7 @@ static void sym_alloc_lcb_tags (struct sym_hcb *np, u_char tn, u_char ln)
5104 lp->itlq_tbl = sym_calloc_dma(SYM_CONF_MAX_TASK*4, "ITLQ_TBL"); 5111 lp->itlq_tbl = sym_calloc_dma(SYM_CONF_MAX_TASK*4, "ITLQ_TBL");
5105 if (!lp->itlq_tbl) 5112 if (!lp->itlq_tbl)
5106 goto fail; 5113 goto fail;
5107 lp->cb_tags = kcalloc(SYM_CONF_MAX_TASK, 1, GFP_KERNEL); 5114 lp->cb_tags = kcalloc(SYM_CONF_MAX_TASK, 1, GFP_ATOMIC);
5108 if (!lp->cb_tags) { 5115 if (!lp->cb_tags) {
5109 sym_mfree_dma(lp->itlq_tbl, SYM_CONF_MAX_TASK*4, "ITLQ_TBL"); 5116 sym_mfree_dma(lp->itlq_tbl, SYM_CONF_MAX_TASK*4, "ITLQ_TBL");
5110 lp->itlq_tbl = NULL; 5117 lp->itlq_tbl = NULL;
@@ -5243,7 +5250,7 @@ int sym_queue_scsiio(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *
5243 /* 5250 /*
5244 * message 5251 * message
5245 */ 5252 */
5246 cp->phys.smsg.addr = cpu_to_scr(CCB_BA(cp, scsi_smsg)); 5253 cp->phys.smsg.addr = CCB_BA(cp, scsi_smsg);
5247 cp->phys.smsg.size = cpu_to_scr(msglen); 5254 cp->phys.smsg.size = cpu_to_scr(msglen);
5248 5255
5249 /* 5256 /*
@@ -5343,7 +5350,7 @@ int sym_abort_scsiio(struct sym_hcb *np, struct scsi_cmnd *cmd, int timed_out)
5343} 5350}
5344 5351
5345/* 5352/*
5346 * Complete execution of a SCSI command with extented 5353 * Complete execution of a SCSI command with extended
5347 * error, SCSI status error, or having been auto-sensed. 5354 * error, SCSI status error, or having been auto-sensed.
5348 * 5355 *
5349 * The SCRIPTS processor is not running there, so we 5356 * The SCRIPTS processor is not running there, so we
@@ -5441,7 +5448,7 @@ if (resid)
5441 /* 5448 /*
5442 * Let's requeue it to device. 5449 * Let's requeue it to device.
5443 */ 5450 */
5444 sym_set_cam_status(cmd, CAM_REQUEUE_REQ); 5451 sym_set_cam_status(cmd, DID_SOFT_ERROR);
5445 goto finish; 5452 goto finish;
5446 } 5453 }
5447weirdness: 5454weirdness:
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.h b/drivers/scsi/sym53c8xx_2/sym_hipd.h
index a95cbe4b8e39..c55c7a57afa0 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.h
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.h
@@ -444,7 +444,7 @@ struct sym_tcb {
444 */ 444 */
445 u_char usrflags; 445 u_char usrflags;
446 u_short usrtags; 446 u_short usrtags;
447 struct scsi_device *sdev; 447 struct scsi_target *starget;
448}; 448};
449 449
450/* 450/*
@@ -754,10 +754,8 @@ struct sym_ccb {
754 int segments; /* Number of SG segments */ 754 int segments; /* Number of SG segments */
755 755
756 u8 order; /* Tag type (if tagged command) */ 756 u8 order; /* Tag type (if tagged command) */
757 unsigned char odd_byte_adjustment; /* odd-sized req on wide bus */
757 758
758 /*
759 * Miscellaneous status'.
760 */
761 u_char nego_status; /* Negotiation status */ 759 u_char nego_status; /* Negotiation status */
762 u_char xerr_status; /* Extended error flags */ 760 u_char xerr_status; /* Extended error flags */
763 u32 extra_bytes; /* Extraneous bytes transferred */ 761 u32 extra_bytes; /* Extraneous bytes transferred */
@@ -809,7 +807,7 @@ struct sym_ccb {
809#endif 807#endif
810}; 808};
811 809
812#define CCB_BA(cp,lbl) (cp->ccb_ba + offsetof(struct sym_ccb, lbl)) 810#define CCB_BA(cp,lbl) cpu_to_scr(cp->ccb_ba + offsetof(struct sym_ccb, lbl))
813 811
814#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN 812#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN
815#define sym_goalp(cp) ((cp->host_flags & HF_DATA_IN) ? cp->goalp : cp->wgoalp) 813#define sym_goalp(cp) ((cp->host_flags & HF_DATA_IN) ? cp->goalp : cp->wgoalp)
@@ -1138,33 +1136,33 @@ static inline void sym_setup_data_pointers(struct sym_hcb *np,
1138 * No segments means no data. 1136 * No segments means no data.
1139 */ 1137 */
1140 if (!cp->segments) 1138 if (!cp->segments)
1141 dir = CAM_DIR_NONE; 1139 dir = DMA_NONE;
1142 1140
1143 /* 1141 /*
1144 * Set the data pointer. 1142 * Set the data pointer.
1145 */ 1143 */
1146 switch(dir) { 1144 switch(dir) {
1147#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN 1145#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN
1148 case CAM_DIR_UNKNOWN: 1146 case DMA_BIDIRECTIONAL:
1149#endif 1147#endif
1150 case CAM_DIR_OUT: 1148 case DMA_TO_DEVICE:
1151 goalp = SCRIPTA_BA(np, data_out2) + 8; 1149 goalp = SCRIPTA_BA(np, data_out2) + 8;
1152 lastp = goalp - 8 - (cp->segments * (2*4)); 1150 lastp = goalp - 8 - (cp->segments * (2*4));
1153#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN 1151#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN
1154 cp->wgoalp = cpu_to_scr(goalp); 1152 cp->wgoalp = cpu_to_scr(goalp);
1155 if (dir != CAM_DIR_UNKNOWN) 1153 if (dir != DMA_BIDIRECTIONAL)
1156 break; 1154 break;
1157 cp->phys.head.wlastp = cpu_to_scr(lastp); 1155 cp->phys.head.wlastp = cpu_to_scr(lastp);
1158 /* fall through */ 1156 /* fall through */
1159#else 1157#else
1160 break; 1158 break;
1161#endif 1159#endif
1162 case CAM_DIR_IN: 1160 case DMA_FROM_DEVICE:
1163 cp->host_flags |= HF_DATA_IN; 1161 cp->host_flags |= HF_DATA_IN;
1164 goalp = SCRIPTA_BA(np, data_in2) + 8; 1162 goalp = SCRIPTA_BA(np, data_in2) + 8;
1165 lastp = goalp - 8 - (cp->segments * (2*4)); 1163 lastp = goalp - 8 - (cp->segments * (2*4));
1166 break; 1164 break;
1167 case CAM_DIR_NONE: 1165 case DMA_NONE:
1168 default: 1166 default:
1169#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN 1167#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN
1170 cp->host_flags |= HF_DATA_IN; 1168 cp->host_flags |= HF_DATA_IN;
@@ -1185,7 +1183,7 @@ static inline void sym_setup_data_pointers(struct sym_hcb *np,
1185 /* 1183 /*
1186 * If direction is unknown, start at data_io. 1184 * If direction is unknown, start at data_io.
1187 */ 1185 */
1188 if (dir == CAM_DIR_UNKNOWN) 1186 if (dir == DMA_BIDIRECTIONAL)
1189 cp->phys.head.savep = cpu_to_scr(SCRIPTB_BA(np, data_io)); 1187 cp->phys.head.savep = cpu_to_scr(SCRIPTB_BA(np, data_io));
1190#endif 1188#endif
1191} 1189}
diff --git a/drivers/scsi/sym53c8xx_2/sym_nvram.c b/drivers/scsi/sym53c8xx_2/sym_nvram.c
index 1b721e3ec520..cd9140e158cf 100644
--- a/drivers/scsi/sym53c8xx_2/sym_nvram.c
+++ b/drivers/scsi/sym53c8xx_2/sym_nvram.c
@@ -270,6 +270,7 @@ static void S24C16_set_bit(struct sym_device *np, u_char write_bit, u_char *gpre
270 270
271 } 271 }
272 OUTB(np, nc_gpreg, *gpreg); 272 OUTB(np, nc_gpreg, *gpreg);
273 INB(np, nc_mbox1);
273 udelay(5); 274 udelay(5);
274} 275}
275 276
@@ -547,6 +548,7 @@ static int sym_read_Symbios_nvram(struct sym_device *np, Symbios_nvram *nvram)
547static void T93C46_Clk(struct sym_device *np, u_char *gpreg) 548static void T93C46_Clk(struct sym_device *np, u_char *gpreg)
548{ 549{
549 OUTB(np, nc_gpreg, *gpreg | 0x04); 550 OUTB(np, nc_gpreg, *gpreg | 0x04);
551 INB(np, nc_mbox1);
550 udelay(2); 552 udelay(2);
551 OUTB(np, nc_gpreg, *gpreg); 553 OUTB(np, nc_gpreg, *gpreg);
552} 554}
@@ -574,6 +576,7 @@ static void T93C46_Write_Bit(struct sym_device *np, u_char write_bit, u_char *gp
574 *gpreg |= 0x10; 576 *gpreg |= 0x10;
575 577
576 OUTB(np, nc_gpreg, *gpreg); 578 OUTB(np, nc_gpreg, *gpreg);
579 INB(np, nc_mbox1);
577 udelay(2); 580 udelay(2);
578 581
579 T93C46_Clk(np, gpreg); 582 T93C46_Clk(np, gpreg);
@@ -586,6 +589,7 @@ static void T93C46_Stop(struct sym_device *np, u_char *gpreg)
586{ 589{
587 *gpreg &= 0xef; 590 *gpreg &= 0xef;
588 OUTB(np, nc_gpreg, *gpreg); 591 OUTB(np, nc_gpreg, *gpreg);
592 INB(np, nc_mbox1);
589 udelay(2); 593 udelay(2);
590 594
591 T93C46_Clk(np, gpreg); 595 T93C46_Clk(np, gpreg);
@@ -733,7 +737,8 @@ static int sym_read_parisc_pdc(struct sym_device *np, struct pdc_initiator *pdc)
733 return SYM_PARISC_PDC; 737 return SYM_PARISC_PDC;
734} 738}
735#else 739#else
736static int sym_read_parisc_pdc(struct sym_device *np, struct pdc_initiator *x) 740static inline int sym_read_parisc_pdc(struct sym_device *np,
741 struct pdc_initiator *x)
737{ 742{
738 return 0; 743 return 0;
739} 744}
diff --git a/drivers/scsi/t128.c b/drivers/scsi/t128.c
index 6dc2897672a1..f4b780e35cb6 100644
--- a/drivers/scsi/t128.c
+++ b/drivers/scsi/t128.c
@@ -437,8 +437,6 @@ static Scsi_Host_Template driver_template = {
437 .queuecommand = t128_queue_command, 437 .queuecommand = t128_queue_command,
438 .eh_abort_handler = t128_abort, 438 .eh_abort_handler = t128_abort,
439 .eh_bus_reset_handler = t128_bus_reset, 439 .eh_bus_reset_handler = t128_bus_reset,
440 .eh_host_reset_handler = t128_host_reset,
441 .eh_device_reset_handler = t128_device_reset,
442 .bios_param = t128_biosparam, 440 .bios_param = t128_biosparam,
443 .can_queue = CAN_QUEUE, 441 .can_queue = CAN_QUEUE,
444 .this_id = 7, 442 .this_id = 7,
diff --git a/drivers/scsi/t128.h b/drivers/scsi/t128.h
index 161ba53d982b..9ad1d68827a7 100644
--- a/drivers/scsi/t128.h
+++ b/drivers/scsi/t128.h
@@ -96,9 +96,7 @@ static int t128_biosparam(struct scsi_device *, struct block_device *,
96 sector_t, int*); 96 sector_t, int*);
97static int t128_detect(Scsi_Host_Template *); 97static int t128_detect(Scsi_Host_Template *);
98static int t128_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 98static int t128_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
99static int t128_host_reset(Scsi_Cmnd *);
100static int t128_bus_reset(Scsi_Cmnd *); 99static int t128_bus_reset(Scsi_Cmnd *);
101static int t128_device_reset(Scsi_Cmnd *);
102 100
103#ifndef CMD_PER_LUN 101#ifndef CMD_PER_LUN
104#define CMD_PER_LUN 2 102#define CMD_PER_LUN 2
@@ -140,8 +138,6 @@ static int t128_device_reset(Scsi_Cmnd *);
140#define do_NCR5380_intr do_t128_intr 138#define do_NCR5380_intr do_t128_intr
141#define NCR5380_queue_command t128_queue_command 139#define NCR5380_queue_command t128_queue_command
142#define NCR5380_abort t128_abort 140#define NCR5380_abort t128_abort
143#define NCR5380_host_reset t128_host_reset
144#define NCR5380_device_reset t128_device_reset
145#define NCR5380_bus_reset t128_bus_reset 141#define NCR5380_bus_reset t128_bus_reset
146#define NCR5380_proc_info t128_proc_info 142#define NCR5380_proc_info t128_proc_info
147 143
diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c
index ee9df02efd5b..9589c67de535 100644
--- a/drivers/scsi/tmscsim.c
+++ b/drivers/scsi/tmscsim.c
@@ -2120,6 +2120,8 @@ static int DC390_bus_reset (struct scsi_cmnd *cmd)
2120 struct dc390_acb* pACB = (struct dc390_acb*) cmd->device->host->hostdata; 2120 struct dc390_acb* pACB = (struct dc390_acb*) cmd->device->host->hostdata;
2121 u8 bval; 2121 u8 bval;
2122 2122
2123 spin_lock_irq(cmd->device->host->host_lock);
2124
2123 bval = DC390_read8(CtrlReg1) | DIS_INT_ON_SCSI_RST; 2125 bval = DC390_read8(CtrlReg1) | DIS_INT_ON_SCSI_RST;
2124 DC390_write8(CtrlReg1, bval); /* disable IRQ on bus reset */ 2126 DC390_write8(CtrlReg1, bval); /* disable IRQ on bus reset */
2125 2127
@@ -2127,7 +2129,7 @@ static int DC390_bus_reset (struct scsi_cmnd *cmd)
2127 dc390_ResetSCSIBus(pACB); 2129 dc390_ResetSCSIBus(pACB);
2128 2130
2129 dc390_ResetDevParam(pACB); 2131 dc390_ResetDevParam(pACB);
2130 udelay(1000); 2132 mdelay(1);
2131 pACB->pScsiHost->last_reset = jiffies + 3*HZ/2 2133 pACB->pScsiHost->last_reset = jiffies + 3*HZ/2
2132 + HZ * dc390_eepromBuf[pACB->AdapterIndex][EE_DELAY]; 2134 + HZ * dc390_eepromBuf[pACB->AdapterIndex][EE_DELAY];
2133 2135
@@ -2142,6 +2144,8 @@ static int DC390_bus_reset (struct scsi_cmnd *cmd)
2142 bval = DC390_read8(CtrlReg1) & ~DIS_INT_ON_SCSI_RST; 2144 bval = DC390_read8(CtrlReg1) & ~DIS_INT_ON_SCSI_RST;
2143 DC390_write8(CtrlReg1, bval); /* re-enable interrupt */ 2145 DC390_write8(CtrlReg1, bval); /* re-enable interrupt */
2144 2146
2147 spin_unlock_irq(cmd->device->host->host_lock);
2148
2145 return SUCCESS; 2149 return SUCCESS;
2146} 2150}
2147 2151
diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c
index dca215411f68..98369ce09283 100644
--- a/drivers/scsi/u14-34f.c
+++ b/drivers/scsi/u14-34f.c
@@ -446,8 +446,6 @@ static struct scsi_host_template driver_template = {
446 .release = u14_34f_release, 446 .release = u14_34f_release,
447 .queuecommand = u14_34f_queuecommand, 447 .queuecommand = u14_34f_queuecommand,
448 .eh_abort_handler = u14_34f_eh_abort, 448 .eh_abort_handler = u14_34f_eh_abort,
449 .eh_device_reset_handler = NULL,
450 .eh_bus_reset_handler = NULL,
451 .eh_host_reset_handler = u14_34f_eh_host_reset, 449 .eh_host_reset_handler = u14_34f_eh_host_reset,
452 .bios_param = u14_34f_bios_param, 450 .bios_param = u14_34f_bios_param,
453 .slave_configure = u14_34f_slave_configure, 451 .slave_configure = u14_34f_slave_configure,
@@ -1419,16 +1417,20 @@ static int u14_34f_eh_host_reset(struct scsi_cmnd *SCarg) {
1419 printk("%s: reset, enter, target %d.%d:%d, pid %ld.\n", 1417 printk("%s: reset, enter, target %d.%d:%d, pid %ld.\n",
1420 BN(j), SCarg->device->channel, SCarg->device->id, SCarg->device->lun, SCarg->pid); 1418 BN(j), SCarg->device->channel, SCarg->device->id, SCarg->device->lun, SCarg->pid);
1421 1419
1420 spin_lock_irq(sh[j]->host_lock);
1421
1422 if (SCarg->host_scribble == NULL) 1422 if (SCarg->host_scribble == NULL)
1423 printk("%s: reset, pid %ld inactive.\n", BN(j), SCarg->pid); 1423 printk("%s: reset, pid %ld inactive.\n", BN(j), SCarg->pid);
1424 1424
1425 if (HD(j)->in_reset) { 1425 if (HD(j)->in_reset) {
1426 printk("%s: reset, exit, already in reset.\n", BN(j)); 1426 printk("%s: reset, exit, already in reset.\n", BN(j));
1427 spin_unlock_irq(sh[j]->host_lock);
1427 return FAILED; 1428 return FAILED;
1428 } 1429 }
1429 1430
1430 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { 1431 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {
1431 printk("%s: reset, exit, timeout error.\n", BN(j)); 1432 printk("%s: reset, exit, timeout error.\n", BN(j));
1433 spin_unlock_irq(sh[j]->host_lock);
1432 return FAILED; 1434 return FAILED;
1433 } 1435 }
1434 1436
@@ -1479,6 +1481,7 @@ static int u14_34f_eh_host_reset(struct scsi_cmnd *SCarg) {
1479 1481
1480 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) { 1482 if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {
1481 printk("%s: reset, cannot reset, timeout error.\n", BN(j)); 1483 printk("%s: reset, cannot reset, timeout error.\n", BN(j));
1484 spin_unlock_irq(sh[j]->host_lock);
1482 return FAILED; 1485 return FAILED;
1483 } 1486 }
1484 1487
@@ -1540,6 +1543,7 @@ static int u14_34f_eh_host_reset(struct scsi_cmnd *SCarg) {
1540 if (arg_done) printk("%s: reset, exit, pid %ld done.\n", BN(j), SCarg->pid); 1543 if (arg_done) printk("%s: reset, exit, pid %ld done.\n", BN(j), SCarg->pid);
1541 else printk("%s: reset, exit.\n", BN(j)); 1544 else printk("%s: reset, exit.\n", BN(j));
1542 1545
1546 spin_unlock_irq(sh[j]->host_lock);
1543 return SUCCESS; 1547 return SUCCESS;
1544} 1548}
1545 1549
diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
index 97f4d9112b48..486551bd54ba 100644
--- a/drivers/scsi/ultrastor.c
+++ b/drivers/scsi/ultrastor.c
@@ -879,7 +879,7 @@ static int ultrastor_abort(Scsi_Cmnd *SCpnt)
879 ogm_addr = (unsigned int)isa_bus_to_virt(inl(port0 + 23)); 879 ogm_addr = (unsigned int)isa_bus_to_virt(inl(port0 + 23));
880 icm_status = inb(port0 + 27); 880 icm_status = inb(port0 + 27);
881 icm_addr = (unsigned int)isa_bus_to_virt(inl(port0 + 28)); 881 icm_addr = (unsigned int)isa_bus_to_virt(inl(port0 + 28));
882 spin_lock_irqsave(host->host_lock, flags); 882 spin_unlock_irqrestore(host->host_lock, flags);
883 } 883 }
884 884
885 /* First check to see if an interrupt is pending. I suspect the SiS 885 /* First check to see if an interrupt is pending. I suspect the SiS
@@ -954,9 +954,7 @@ static int ultrastor_abort(Scsi_Cmnd *SCpnt)
954 SCpnt->result = DID_ABORT << 16; 954 SCpnt->result = DID_ABORT << 16;
955 955
956 /* Take the host lock to guard against scsi layer re-entry */ 956 /* Take the host lock to guard against scsi layer re-entry */
957 spin_lock_irqsave(host->host_lock, flags);
958 done(SCpnt); 957 done(SCpnt);
959 spin_unlock_irqrestore(host->host_lock, flags);
960 958
961 /* Need to set a timeout here in case command never completes. */ 959 /* Need to set a timeout here in case command never completes. */
962 return SUCCESS; 960 return SUCCESS;
diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c
index bf4a758e2801..fb54a87a80a3 100644
--- a/drivers/scsi/wd7000.c
+++ b/drivers/scsi/wd7000.c
@@ -1586,9 +1586,16 @@ static int wd7000_host_reset(struct scsi_cmnd *SCpnt)
1586{ 1586{
1587 Adapter *host = (Adapter *) SCpnt->device->host->hostdata; 1587 Adapter *host = (Adapter *) SCpnt->device->host->hostdata;
1588 1588
1589 if (wd7000_adapter_reset(host) < 0) 1589 spin_unlock_irq(SCpnt->device->host->host_lock);
1590
1591 if (wd7000_adapter_reset(host) < 0) {
1592 spin_unlock_irq(SCpnt->device->host->host_lock);
1590 return FAILED; 1593 return FAILED;
1594 }
1595
1591 wd7000_enable_intr(host); 1596 wd7000_enable_intr(host);
1597
1598 spin_unlock_irq(SCpnt->device->host->host_lock);
1592 return SUCCESS; 1599 return SUCCESS;
1593} 1600}
1594 1601
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 6e44b46c9e9d..25fcef2c42de 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -753,7 +753,7 @@ config SERIAL_MPC52xx_CONSOLE_BAUD
753 753
754config SERIAL_ICOM 754config SERIAL_ICOM
755 tristate "IBM Multiport Serial Adapter" 755 tristate "IBM Multiport Serial Adapter"
756 depends on PPC_ISERIES || PPC_PSERIES 756 depends on PCI && (PPC_ISERIES || PPC_PSERIES)
757 select SERIAL_CORE 757 select SERIAL_CORE
758 help 758 help
759 This driver is for a family of multiport serial adapters 759 This driver is for a family of multiport serial adapters
@@ -843,4 +843,13 @@ config SERIAL_JSM
843 To compile this driver as a module, choose M here: the 843 To compile this driver as a module, choose M here: the
844 module will be called jsm. 844 module will be called jsm.
845 845
846config SERIAL_SGI_IOC4
847 tristate "SGI IOC4 controller serial support"
848 depends on (IA64_GENERIC || IA64_SGI_SN2) && SGI_IOC4
849 select SERIAL_CORE
850 help
851 If you have an SGI Altix with an IOC4 based Base IO card
852 and wish to use the serial ports on this card, say Y.
853 Otherwise, say N.
854
846endmenu 855endmenu
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 81b77d769b84..8f1cdde7dbed 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -51,4 +51,4 @@ obj-$(CONFIG_ETRAX_SERIAL) += crisv10.o
51obj-$(CONFIG_SERIAL_JSM) += jsm/ 51obj-$(CONFIG_SERIAL_JSM) += jsm/
52obj-$(CONFIG_SERIAL_TXX9) += serial_txx9.o 52obj-$(CONFIG_SERIAL_TXX9) += serial_txx9.o
53obj-$(CONFIG_SERIAL_VR41XX) += vr41xx_siu.o 53obj-$(CONFIG_SERIAL_VR41XX) += vr41xx_siu.o
54obj-$(CONFIG_BLK_DEV_SGIIOC4) += ioc4_serial.o 54obj-$(CONFIG_SERIAL_SGI_IOC4) += ioc4_serial.o
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index b422c3abfba6..c4c8f4b44f53 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -134,12 +134,21 @@ void scc1_lineif(struct uart_cpm_port *pinfo)
134 134
135void scc2_lineif(struct uart_cpm_port *pinfo) 135void scc2_lineif(struct uart_cpm_port *pinfo)
136{ 136{
137 /*
138 * STx GP3 uses the SCC2 secondary option pin assignment
139 * which this driver doesn't account for in the static
140 * pin assignments. This kind of board specific info
141 * really has to get out of the driver so boards can
142 * be supported in a sane fashion.
143 */
144#ifndef CONFIG_STX_GP3
137 volatile iop_cpm2_t *io = &cpm2_immr->im_ioport; 145 volatile iop_cpm2_t *io = &cpm2_immr->im_ioport;
138 io->iop_pparb |= 0x008b0000; 146 io->iop_pparb |= 0x008b0000;
139 io->iop_pdirb |= 0x00880000; 147 io->iop_pdirb |= 0x00880000;
140 io->iop_psorb |= 0x00880000; 148 io->iop_psorb |= 0x00880000;
141 io->iop_pdirb &= ~0x00030000; 149 io->iop_pdirb &= ~0x00030000;
142 io->iop_psorb &= ~0x00030000; 150 io->iop_psorb &= ~0x00030000;
151#endif
143 cpm2_immr->im_cpmux.cmx_scr &= 0xff00ffff; 152 cpm2_immr->im_cpmux.cmx_scr &= 0xff00ffff;
144 cpm2_immr->im_cpmux.cmx_scr |= 0x00090000; 153 cpm2_immr->im_cpmux.cmx_scr |= 0x00090000;
145 pinfo->brg = 2; 154 pinfo->brg = 2;
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c
index ba4e13a22a50..793c3a7cbe47 100644
--- a/drivers/serial/ioc4_serial.c
+++ b/drivers/serial/ioc4_serial.c
@@ -20,7 +20,7 @@
20#include <linux/serial_reg.h> 20#include <linux/serial_reg.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/pci.h> 22#include <linux/pci.h>
23#include <linux/ioc4_common.h> 23#include <linux/ioc4.h>
24#include <linux/serial_core.h> 24#include <linux/serial_core.h>
25 25
26/* 26/*
@@ -130,12 +130,19 @@
130 IOC4_SIO_IR_S3_TX_EXPLICIT) 130 IOC4_SIO_IR_S3_TX_EXPLICIT)
131 131
132/* Bitmasks for IOC4_OTHER_IR, IOC4_OTHER_IEC, and IOC4_OTHER_IES */ 132/* Bitmasks for IOC4_OTHER_IR, IOC4_OTHER_IEC, and IOC4_OTHER_IES */
133#define IOC4_OTHER_IR_ATA_INT 0x00000001 /* ATAPI intr pass-thru */ 133#define IOC4_OTHER_IR_ATA_INT 0x00000001 /* ATAPI intr pass-thru */
134#define IOC4_OTHER_IR_ATA_MEMERR 0x00000002 /* ATAPI DMA PCI error */ 134#define IOC4_OTHER_IR_ATA_MEMERR 0x00000002 /* ATAPI DMA PCI error */
135#define IOC4_OTHER_IR_S0_MEMERR 0x00000004 /* Port 0 PCI error */ 135#define IOC4_OTHER_IR_S0_MEMERR 0x00000004 /* Port 0 PCI error */
136#define IOC4_OTHER_IR_S1_MEMERR 0x00000008 /* Port 1 PCI error */ 136#define IOC4_OTHER_IR_S1_MEMERR 0x00000008 /* Port 1 PCI error */
137#define IOC4_OTHER_IR_S2_MEMERR 0x00000010 /* Port 2 PCI error */ 137#define IOC4_OTHER_IR_S2_MEMERR 0x00000010 /* Port 2 PCI error */
138#define IOC4_OTHER_IR_S3_MEMERR 0x00000020 /* Port 3 PCI error */ 138#define IOC4_OTHER_IR_S3_MEMERR 0x00000020 /* Port 3 PCI error */
139#define IOC4_OTHER_IR_KBD_INT 0x00000040 /* Keyboard/mouse */
140#define IOC4_OTHER_IR_RESERVED 0x007fff80 /* Reserved */
141#define IOC4_OTHER_IR_RT_INT 0x00800000 /* INT_OUT section output */
142#define IOC4_OTHER_IR_GEN_INT 0xff000000 /* Generic pins */
143
144#define IOC4_OTHER_IR_SER_MEMERR (IOC4_OTHER_IR_S0_MEMERR | IOC4_OTHER_IR_S1_MEMERR | \
145 IOC4_OTHER_IR_S2_MEMERR | IOC4_OTHER_IR_S3_MEMERR)
139 146
140/* Bitmasks for IOC4_SIO_CR */ 147/* Bitmasks for IOC4_SIO_CR */
141#define IOC4_SIO_CR_CMD_PULSE_SHIFT 0 /* byte bus strobe shift */ 148#define IOC4_SIO_CR_CMD_PULSE_SHIFT 0 /* byte bus strobe shift */
@@ -274,70 +281,24 @@ struct ioc4_uartregs {
274#define i4u_dlm u2.dlm 281#define i4u_dlm u2.dlm
275#define i4u_fcr u3.fcr 282#define i4u_fcr u3.fcr
276 283
277/* PCI memory space register map addressed using pci_bar0 */ 284/* Serial port registers used for DMA serial I/O */
278struct ioc4_memregs { 285struct ioc4_serial {
279 struct ioc4_mem { 286 uint32_t sbbr01_l;
280 /* Miscellaneous IOC4 registers */ 287 uint32_t sbbr01_h;
281 uint32_t pci_err_addr_l; 288 uint32_t sbbr23_l;
282 uint32_t pci_err_addr_h; 289 uint32_t sbbr23_h;
283 uint32_t sio_ir; 290
284 uint32_t other_ir; 291 struct ioc4_serialregs port_0;
285 292 struct ioc4_serialregs port_1;
286 /* These registers are read-only for general kernel code. */ 293 struct ioc4_serialregs port_2;
287 uint32_t sio_ies_ro; 294 struct ioc4_serialregs port_3;
288 uint32_t other_ies_ro; 295 struct ioc4_uartregs uart_0;
289 uint32_t sio_iec_ro; 296 struct ioc4_uartregs uart_1;
290 uint32_t other_iec_ro; 297 struct ioc4_uartregs uart_2;
291 uint32_t sio_cr; 298 struct ioc4_uartregs uart_3;
292 uint32_t misc_fill1; 299} ioc4_serial;
293 uint32_t int_out;
294 uint32_t misc_fill2;
295 uint32_t gpcr_s;
296 uint32_t gpcr_c;
297 uint32_t gpdr;
298 uint32_t misc_fill3;
299 uint32_t gppr_0;
300 uint32_t gppr_1;
301 uint32_t gppr_2;
302 uint32_t gppr_3;
303 uint32_t gppr_4;
304 uint32_t gppr_5;
305 uint32_t gppr_6;
306 uint32_t gppr_7;
307 } ioc4_mem;
308
309 char misc_fill4[0x100 - 0x5C - 4];
310
311 /* ATA/ATAP registers */
312 uint32_t ata_notused[9];
313 char ata_fill1[0x140 - 0x120 - 4];
314 uint32_t ata_notused1[8];
315 char ata_fill2[0x200 - 0x15C - 4];
316
317 /* Keyboard and mouse registers */
318 uint32_t km_notused[5];;
319 char km_fill1[0x300 - 0x210 - 4];
320
321 /* Serial port registers used for DMA serial I/O */
322 struct ioc4_serial {
323 uint32_t sbbr01_l;
324 uint32_t sbbr01_h;
325 uint32_t sbbr23_l;
326 uint32_t sbbr23_h;
327
328 struct ioc4_serialregs port_0;
329 struct ioc4_serialregs port_1;
330 struct ioc4_serialregs port_2;
331 struct ioc4_serialregs port_3;
332 struct ioc4_uartregs uart_0;
333 struct ioc4_uartregs uart_1;
334 struct ioc4_uartregs uart_2;
335 struct ioc4_uartregs uart_3;
336 } ioc4_serial;
337};
338 300
339/* UART clock speed */ 301/* UART clock speed */
340#define IOC4_SER_XIN_CLK IOC4_SER_XIN_CLK_66
341#define IOC4_SER_XIN_CLK_66 66666667 302#define IOC4_SER_XIN_CLK_66 66666667
342#define IOC4_SER_XIN_CLK_33 33333333 303#define IOC4_SER_XIN_CLK_33 33333333
343 304
@@ -412,8 +373,8 @@ enum sio_proto {
412 | UART_LCR_WLEN7 | UART_LCR_WLEN8) 373 | UART_LCR_WLEN7 | UART_LCR_WLEN8)
413#define LCR_MASK_STOP_BITS (UART_LCR_STOP) 374#define LCR_MASK_STOP_BITS (UART_LCR_STOP)
414 375
415#define PENDING(_p) (readl(&(_p)->ip_mem->sio_ir) & _p->ip_ienb) 376#define PENDING(_p) (readl(&(_p)->ip_mem->sio_ir.raw) & _p->ip_ienb)
416#define READ_SIO_IR(_p) readl(&(_p)->ip_mem->sio_ir) 377#define READ_SIO_IR(_p) readl(&(_p)->ip_mem->sio_ir.raw)
417 378
418/* Default to 4k buffers */ 379/* Default to 4k buffers */
419#ifdef IOC4_1K_BUFFERS 380#ifdef IOC4_1K_BUFFERS
@@ -447,7 +408,7 @@ struct ioc4_control {
447 */ 408 */
448#define MAX_IOC4_INTR_ENTS (8 * sizeof(uint32_t)) 409#define MAX_IOC4_INTR_ENTS (8 * sizeof(uint32_t))
449struct ioc4_soft { 410struct ioc4_soft {
450 struct ioc4_mem __iomem *is_ioc4_mem_addr; 411 struct ioc4_misc_regs __iomem *is_ioc4_misc_addr;
451 struct ioc4_serial __iomem *is_ioc4_serial_addr; 412 struct ioc4_serial __iomem *is_ioc4_serial_addr;
452 413
453 /* Each interrupt type has an entry in the array */ 414 /* Each interrupt type has an entry in the array */
@@ -486,7 +447,7 @@ struct ioc4_port {
486 struct ioc4_soft *ip_ioc4_soft; 447 struct ioc4_soft *ip_ioc4_soft;
487 448
488 /* pci mem addresses */ 449 /* pci mem addresses */
489 struct ioc4_mem __iomem *ip_mem; 450 struct ioc4_misc_regs __iomem *ip_mem;
490 struct ioc4_serial __iomem *ip_serial; 451 struct ioc4_serial __iomem *ip_serial;
491 struct ioc4_serialregs __iomem *ip_serial_regs; 452 struct ioc4_serialregs __iomem *ip_serial_regs;
492 struct ioc4_uartregs __iomem *ip_uart_regs; 453 struct ioc4_uartregs __iomem *ip_uart_regs;
@@ -553,7 +514,7 @@ struct hooks {
553 uint32_t intr_dma_error; 514 uint32_t intr_dma_error;
554 uint32_t intr_clear; 515 uint32_t intr_clear;
555 uint32_t intr_all; 516 uint32_t intr_all;
556 char rs422_select_pin; 517 int rs422_select_pin;
557}; 518};
558 519
559static struct hooks hooks_array[IOC4_NUM_SERIAL_PORTS] = { 520static struct hooks hooks_array[IOC4_NUM_SERIAL_PORTS] = {
@@ -669,7 +630,7 @@ static void handle_intr(void *arg, uint32_t sio_ir);
669static inline void 630static inline void
670write_ireg(struct ioc4_soft *ioc4_soft, uint32_t val, int which, int type) 631write_ireg(struct ioc4_soft *ioc4_soft, uint32_t val, int which, int type)
671{ 632{
672 struct ioc4_mem __iomem *mem = ioc4_soft->is_ioc4_mem_addr; 633 struct ioc4_misc_regs __iomem *mem = ioc4_soft->is_ioc4_misc_addr;
673 unsigned long flags; 634 unsigned long flags;
674 635
675 spin_lock_irqsave(&ioc4_soft->is_ir_lock, flags); 636 spin_lock_irqsave(&ioc4_soft->is_ir_lock, flags);
@@ -678,11 +639,11 @@ write_ireg(struct ioc4_soft *ioc4_soft, uint32_t val, int which, int type)
678 case IOC4_SIO_INTR_TYPE: 639 case IOC4_SIO_INTR_TYPE:
679 switch (which) { 640 switch (which) {
680 case IOC4_W_IES: 641 case IOC4_W_IES:
681 writel(val, &mem->sio_ies_ro); 642 writel(val, &mem->sio_ies.raw);
682 break; 643 break;
683 644
684 case IOC4_W_IEC: 645 case IOC4_W_IEC:
685 writel(val, &mem->sio_iec_ro); 646 writel(val, &mem->sio_iec.raw);
686 break; 647 break;
687 } 648 }
688 break; 649 break;
@@ -690,11 +651,11 @@ write_ireg(struct ioc4_soft *ioc4_soft, uint32_t val, int which, int type)
690 case IOC4_OTHER_INTR_TYPE: 651 case IOC4_OTHER_INTR_TYPE:
691 switch (which) { 652 switch (which) {
692 case IOC4_W_IES: 653 case IOC4_W_IES:
693 writel(val, &mem->other_ies_ro); 654 writel(val, &mem->other_ies.raw);
694 break; 655 break;
695 656
696 case IOC4_W_IEC: 657 case IOC4_W_IEC:
697 writel(val, &mem->other_iec_ro); 658 writel(val, &mem->other_iec.raw);
698 break; 659 break;
699 } 660 }
700 break; 661 break;
@@ -747,7 +708,8 @@ static int set_baud(struct ioc4_port *port, int baud)
747 */ 708 */
748static struct ioc4_port *get_ioc4_port(struct uart_port *the_port) 709static struct ioc4_port *get_ioc4_port(struct uart_port *the_port)
749{ 710{
750 struct ioc4_control *control = dev_get_drvdata(the_port->dev); 711 struct ioc4_driver_data *idd = dev_get_drvdata(the_port->dev);
712 struct ioc4_control *control = idd->idd_serial_data;
751 int ii; 713 int ii;
752 714
753 if (control) { 715 if (control) {
@@ -782,7 +744,7 @@ static struct ioc4_port *get_ioc4_port(struct uart_port *the_port)
782static inline uint32_t 744static inline uint32_t
783pending_intrs(struct ioc4_soft *soft, int type) 745pending_intrs(struct ioc4_soft *soft, int type)
784{ 746{
785 struct ioc4_mem __iomem *mem = soft->is_ioc4_mem_addr; 747 struct ioc4_misc_regs __iomem *mem = soft->is_ioc4_misc_addr;
786 unsigned long flag; 748 unsigned long flag;
787 uint32_t intrs = 0; 749 uint32_t intrs = 0;
788 750
@@ -793,11 +755,11 @@ pending_intrs(struct ioc4_soft *soft, int type)
793 755
794 switch (type) { 756 switch (type) {
795 case IOC4_SIO_INTR_TYPE: 757 case IOC4_SIO_INTR_TYPE:
796 intrs = readl(&mem->sio_ir) & readl(&mem->sio_ies_ro); 758 intrs = readl(&mem->sio_ir.raw) & readl(&mem->sio_ies.raw);
797 break; 759 break;
798 760
799 case IOC4_OTHER_INTR_TYPE: 761 case IOC4_OTHER_INTR_TYPE:
800 intrs = readl(&mem->other_ir) & readl(&mem->other_ies_ro); 762 intrs = readl(&mem->other_ir.raw) & readl(&mem->other_ies.raw);
801 763
802 /* Don't process any ATA interrupte */ 764 /* Don't process any ATA interrupte */
803 intrs &= ~(IOC4_OTHER_IR_ATA_INT | IOC4_OTHER_IR_ATA_MEMERR); 765 intrs &= ~(IOC4_OTHER_IR_ATA_INT | IOC4_OTHER_IR_ATA_MEMERR);
@@ -826,7 +788,7 @@ static int inline port_init(struct ioc4_port *port)
826 788
827 /* Wait until any pending bus activity for this port has ceased */ 789 /* Wait until any pending bus activity for this port has ceased */
828 do 790 do
829 sio_cr = readl(&port->ip_mem->sio_cr); 791 sio_cr = readl(&port->ip_mem->sio_cr.raw);
830 while (!(sio_cr & IOC4_SIO_CR_SIO_DIAG_IDLE)); 792 while (!(sio_cr & IOC4_SIO_CR_SIO_DIAG_IDLE));
831 793
832 /* Finish reset sequence */ 794 /* Finish reset sequence */
@@ -899,7 +861,7 @@ static int inline port_init(struct ioc4_port *port)
899 write_ireg(port->ip_ioc4_soft, hooks->intr_clear, 861 write_ireg(port->ip_ioc4_soft, hooks->intr_clear,
900 IOC4_W_IEC, IOC4_SIO_INTR_TYPE); 862 IOC4_W_IEC, IOC4_SIO_INTR_TYPE);
901 port->ip_ienb &= ~hooks->intr_clear; 863 port->ip_ienb &= ~hooks->intr_clear;
902 writel(hooks->intr_clear, &port->ip_mem->sio_ir); 864 writel(hooks->intr_clear, &port->ip_mem->sio_ir.raw);
903 return 0; 865 return 0;
904} 866}
905 867
@@ -918,23 +880,23 @@ static void handle_dma_error_intr(void *arg, uint32_t other_ir)
918 spin_lock_irqsave(&port->ip_lock, flags); 880 spin_lock_irqsave(&port->ip_lock, flags);
919 881
920 /* ACK the interrupt */ 882 /* ACK the interrupt */
921 writel(hooks->intr_dma_error, &port->ip_mem->other_ir); 883 writel(hooks->intr_dma_error, &port->ip_mem->other_ir.raw);
922 884
923 if (readl(&port->ip_mem->pci_err_addr_l) & IOC4_PCI_ERR_ADDR_VLD) { 885 if (readl(&port->ip_mem->pci_err_addr_l.raw) & IOC4_PCI_ERR_ADDR_VLD) {
924 printk(KERN_ERR 886 printk(KERN_ERR
925 "PCI error address is 0x%lx, " 887 "PCI error address is 0x%lx, "
926 "master is serial port %c %s\n", 888 "master is serial port %c %s\n",
927 (((uint64_t)readl(&port->ip_mem->pci_err_addr_h) 889 (((uint64_t)readl(&port->ip_mem->pci_err_addr_h)
928 << 32) 890 << 32)
929 | readl(&port->ip_mem->pci_err_addr_l)) 891 | readl(&port->ip_mem->pci_err_addr_l.raw))
930 & IOC4_PCI_ERR_ADDR_ADDR_MSK, '1' + 892 & IOC4_PCI_ERR_ADDR_ADDR_MSK, '1' +
931 ((char)(readl(&port->ip_mem-> pci_err_addr_l) & 893 ((char)(readl(&port->ip_mem->pci_err_addr_l.raw) &
932 IOC4_PCI_ERR_ADDR_MST_NUM_MSK) >> 1), 894 IOC4_PCI_ERR_ADDR_MST_NUM_MSK) >> 1),
933 (readl(&port->ip_mem->pci_err_addr_l) 895 (readl(&port->ip_mem->pci_err_addr_l.raw)
934 & IOC4_PCI_ERR_ADDR_MST_TYP_MSK) 896 & IOC4_PCI_ERR_ADDR_MST_TYP_MSK)
935 ? "RX" : "TX"); 897 ? "RX" : "TX");
936 898
937 if (readl(&port->ip_mem->pci_err_addr_l) 899 if (readl(&port->ip_mem->pci_err_addr_l.raw)
938 & IOC4_PCI_ERR_ADDR_MUL_ERR) { 900 & IOC4_PCI_ERR_ADDR_MUL_ERR) {
939 printk(KERN_ERR 901 printk(KERN_ERR
940 "Multiple errors occurred\n"); 902 "Multiple errors occurred\n");
@@ -1018,26 +980,26 @@ static irqreturn_t ioc4_intr(int irq, void *arg, struct pt_regs *regs)
1018 "other_ies = 0x%x\n", 980 "other_ies = 0x%x\n",
1019 (intr_type == IOC4_SIO_INTR_TYPE) ? "sio" : 981 (intr_type == IOC4_SIO_INTR_TYPE) ? "sio" :
1020 "other", this_ir, 982 "other", this_ir,
1021 readl(&soft->is_ioc4_mem_addr->sio_ir), 983 readl(&soft->is_ioc4_misc_addr->sio_ir.raw),
1022 readl(&soft->is_ioc4_mem_addr->sio_ies_ro), 984 readl(&soft->is_ioc4_misc_addr->sio_ies.raw),
1023 readl(&soft->is_ioc4_mem_addr->other_ir), 985 readl(&soft->is_ioc4_misc_addr->other_ir.raw),
1024 readl(&soft->is_ioc4_mem_addr->other_ies_ro)); 986 readl(&soft->is_ioc4_misc_addr->other_ies.raw));
1025 } 987 }
1026 } 988 }
1027#ifdef DEBUG_INTERRUPTS 989#ifdef DEBUG_INTERRUPTS
1028 { 990 {
1029 struct ioc4_mem __iomem *mem = soft->is_ioc4_mem_addr; 991 struct ioc4_misc_regs __iomem *mem = soft->is_ioc4_misc_addr;
1030 spinlock_t *lp = &soft->is_ir_lock; 992 spinlock_t *lp = &soft->is_ir_lock;
1031 unsigned long flag; 993 unsigned long flag;
1032 994
1033 spin_lock_irqsave(&soft->is_ir_lock, flag); 995 spin_lock_irqsave(&soft->is_ir_lock, flag);
1034 printk ("%s : %d : mem 0x%p sio_ir 0x%x sio_ies_ro 0x%x " 996 printk ("%s : %d : mem 0x%p sio_ir 0x%x sio_ies 0x%x "
1035 "other_ir 0x%x other_ies_ro 0x%x mask 0x%x\n", 997 "other_ir 0x%x other_ies 0x%x mask 0x%x\n",
1036 __FUNCTION__, __LINE__, 998 __FUNCTION__, __LINE__,
1037 (void *)mem, readl(&mem->sio_ir), 999 (void *)mem, readl(&mem->sio_ir.raw),
1038 readl(&mem->sio_ies_ro), 1000 readl(&mem->sio_ies.raw),
1039 readl(&mem->other_ir), 1001 readl(&mem->other_ir.raw),
1040 readl(&mem->other_ies_ro), 1002 readl(&mem->other_ies.raw),
1041 IOC4_OTHER_IR_ATA_INT | IOC4_OTHER_IR_ATA_MEMERR); 1003 IOC4_OTHER_IR_ATA_INT | IOC4_OTHER_IR_ATA_MEMERR);
1042 spin_unlock_irqrestore(&soft->is_ir_lock, flag); 1004 spin_unlock_irqrestore(&soft->is_ir_lock, flag);
1043 } 1005 }
@@ -1049,21 +1011,20 @@ static irqreturn_t ioc4_intr(int irq, void *arg, struct pt_regs *regs)
1049 * ioc4_attach_local - Device initialization. 1011 * ioc4_attach_local - Device initialization.
1050 * Called at *_attach() time for each 1012 * Called at *_attach() time for each
1051 * IOC4 with serial ports in the system. 1013 * IOC4 with serial ports in the system.
1052 * @control: ioc4_control ptr 1014 * @idd: Master module data for this IOC4
1053 * @pdev: PCI handle for this device
1054 * @soft: soft struct for this device
1055 * @ioc4: ioc4 mem space
1056 */ 1015 */
1057static int inline ioc4_attach_local(struct pci_dev *pdev, 1016static int inline ioc4_attach_local(struct ioc4_driver_data *idd)
1058 struct ioc4_control *control,
1059 struct ioc4_soft *soft, void __iomem *ioc4_mem,
1060 void __iomem *ioc4_serial)
1061{ 1017{
1062 struct ioc4_port *port; 1018 struct ioc4_port *port;
1063 struct ioc4_port *ports[IOC4_NUM_SERIAL_PORTS]; 1019 struct ioc4_port *ports[IOC4_NUM_SERIAL_PORTS];
1064 int port_number; 1020 int port_number;
1065 uint16_t ioc4_revid_min = 62; 1021 uint16_t ioc4_revid_min = 62;
1066 uint16_t ioc4_revid; 1022 uint16_t ioc4_revid;
1023 struct pci_dev *pdev = idd->idd_pdev;
1024 struct ioc4_control* control = idd->idd_serial_data;
1025 struct ioc4_soft *soft = control->ic_soft;
1026 void __iomem *ioc4_misc = idd->idd_misc_regs;
1027 void __iomem *ioc4_serial = soft->is_ioc4_serial_addr;
1067 1028
1068 /* IOC4 firmware must be at least rev 62 */ 1029 /* IOC4 firmware must be at least rev 62 */
1069 pci_read_config_word(pdev, PCI_COMMAND_SPECIAL, &ioc4_revid); 1030 pci_read_config_word(pdev, PCI_COMMAND_SPECIAL, &ioc4_revid);
@@ -1076,7 +1037,7 @@ static int inline ioc4_attach_local(struct pci_dev *pdev,
1076 ioc4_revid, ioc4_revid_min); 1037 ioc4_revid, ioc4_revid_min);
1077 return -EPERM; 1038 return -EPERM;
1078 } 1039 }
1079 BUG_ON(ioc4_mem == NULL); 1040 BUG_ON(ioc4_misc == NULL);
1080 BUG_ON(ioc4_serial == NULL); 1041 BUG_ON(ioc4_serial == NULL);
1081 1042
1082 /* Create port structures for each port */ 1043 /* Create port structures for each port */
@@ -1100,10 +1061,18 @@ static int inline ioc4_attach_local(struct pci_dev *pdev,
1100 port->ip_ioc4_soft = soft; 1061 port->ip_ioc4_soft = soft;
1101 port->ip_pdev = pdev; 1062 port->ip_pdev = pdev;
1102 port->ip_ienb = 0; 1063 port->ip_ienb = 0;
1103 port->ip_pci_bus_speed = IOC4_SER_XIN_CLK; 1064 /* Use baud rate calculations based on detected PCI
1065 * bus speed. Simply test whether the PCI clock is
1066 * running closer to 66MHz or 33MHz.
1067 */
1068 if (idd->count_period/IOC4_EXTINT_COUNT_DIVISOR < 20) {
1069 port->ip_pci_bus_speed = IOC4_SER_XIN_CLK_66;
1070 } else {
1071 port->ip_pci_bus_speed = IOC4_SER_XIN_CLK_33;
1072 }
1104 port->ip_baud = 9600; 1073 port->ip_baud = 9600;
1105 port->ip_control = control; 1074 port->ip_control = control;
1106 port->ip_mem = ioc4_mem; 1075 port->ip_mem = ioc4_misc;
1107 port->ip_serial = ioc4_serial; 1076 port->ip_serial = ioc4_serial;
1108 1077
1109 /* point to the right hook */ 1078 /* point to the right hook */
@@ -1604,14 +1573,12 @@ static int ioc4_set_proto(struct ioc4_port *port, enum sio_proto proto)
1604 switch (proto) { 1573 switch (proto) {
1605 case PROTO_RS232: 1574 case PROTO_RS232:
1606 /* Clear the appropriate GIO pin */ 1575 /* Clear the appropriate GIO pin */
1607 writel(0, (&port->ip_mem->gppr_0 + 1576 writel(0, (&port->ip_mem->gppr[hooks->rs422_select_pin].raw));
1608 hooks->rs422_select_pin));
1609 break; 1577 break;
1610 1578
1611 case PROTO_RS422: 1579 case PROTO_RS422:
1612 /* Set the appropriate GIO pin */ 1580 /* Set the appropriate GIO pin */
1613 writel(1, (&port->ip_mem->gppr_0 + 1581 writel(1, (&port->ip_mem->gppr[hooks->rs422_select_pin].raw));
1614 hooks->rs422_select_pin));
1615 break; 1582 break;
1616 1583
1617 default: 1584 default:
@@ -1885,7 +1852,7 @@ static void handle_intr(void *arg, uint32_t sio_ir)
1885 if (sio_ir & hooks->intr_delta_dcd) { 1852 if (sio_ir & hooks->intr_delta_dcd) {
1886 /* ACK the interrupt */ 1853 /* ACK the interrupt */
1887 writel(hooks->intr_delta_dcd, 1854 writel(hooks->intr_delta_dcd,
1888 &port->ip_mem->sio_ir); 1855 &port->ip_mem->sio_ir.raw);
1889 1856
1890 shadow = readl(&port->ip_serial_regs->shadow); 1857 shadow = readl(&port->ip_serial_regs->shadow);
1891 1858
@@ -1907,7 +1874,7 @@ static void handle_intr(void *arg, uint32_t sio_ir)
1907 if (sio_ir & hooks->intr_delta_cts) { 1874 if (sio_ir & hooks->intr_delta_cts) {
1908 /* ACK the interrupt */ 1875 /* ACK the interrupt */
1909 writel(hooks->intr_delta_cts, 1876 writel(hooks->intr_delta_cts,
1910 &port->ip_mem->sio_ir); 1877 &port->ip_mem->sio_ir.raw);
1911 1878
1912 shadow = readl(&port->ip_serial_regs->shadow); 1879 shadow = readl(&port->ip_serial_regs->shadow);
1913 1880
@@ -1928,7 +1895,7 @@ static void handle_intr(void *arg, uint32_t sio_ir)
1928 if (sio_ir & hooks->intr_rx_timer) { 1895 if (sio_ir & hooks->intr_rx_timer) {
1929 /* ACK the interrupt */ 1896 /* ACK the interrupt */
1930 writel(hooks->intr_rx_timer, 1897 writel(hooks->intr_rx_timer,
1931 &port->ip_mem->sio_ir); 1898 &port->ip_mem->sio_ir.raw);
1932 1899
1933 if ((port->ip_notify & N_DATA_READY) 1900 if ((port->ip_notify & N_DATA_READY)
1934 && (port->ip_port)) { 1901 && (port->ip_port)) {
@@ -1974,7 +1941,7 @@ static void handle_intr(void *arg, uint32_t sio_ir)
1974 1941
1975 /* ACK the interrupt */ 1942 /* ACK the interrupt */
1976 writel(hooks->intr_tx_explicit, 1943 writel(hooks->intr_tx_explicit,
1977 &port->ip_mem->sio_ir); 1944 &port->ip_mem->sio_ir.raw);
1978 1945
1979 if (port->ip_notify & N_OUTPUT_LOWAT) 1946 if (port->ip_notify & N_OUTPUT_LOWAT)
1980 ioc4_cb_output_lowat(port); 1947 ioc4_cb_output_lowat(port);
@@ -2634,7 +2601,8 @@ ioc4_serial_core_attach(struct pci_dev *pdev)
2634{ 2601{
2635 struct ioc4_port *port; 2602 struct ioc4_port *port;
2636 struct uart_port *the_port; 2603 struct uart_port *the_port;
2637 struct ioc4_control *control = pci_get_drvdata(pdev); 2604 struct ioc4_driver_data *idd = pci_get_drvdata(pdev);
2605 struct ioc4_control *control = idd->idd_serial_data;
2638 int ii; 2606 int ii;
2639 2607
2640 DPRINT_CONFIG(("%s: attach pdev 0x%p - control 0x%p\n", 2608 DPRINT_CONFIG(("%s: attach pdev 0x%p - control 0x%p\n",
@@ -2680,55 +2648,29 @@ ioc4_serial_core_attach(struct pci_dev *pdev)
2680 2648
2681/** 2649/**
2682 * ioc4_serial_attach_one - register attach function 2650 * ioc4_serial_attach_one - register attach function
2683 * called per card found from ioc4_serial_detect as part 2651 * called per card found from IOC4 master module.
2684 * of module_init(). 2652 * @idd: Master module data for this IOC4
2685 * @pdev: handle for this card
2686 * @pci_id: pci id for this card
2687 */ 2653 */
2688int 2654int
2689ioc4_serial_attach_one(struct pci_dev *pdev, const struct pci_device_id *pci_id) 2655ioc4_serial_attach_one(struct ioc4_driver_data *idd)
2690{ 2656{
2691 struct ioc4_mem __iomem *mem; 2657 unsigned long tmp_addr1;
2692 unsigned long tmp_addr, tmp_addr1;
2693 struct ioc4_serial __iomem *serial; 2658 struct ioc4_serial __iomem *serial;
2694 struct ioc4_soft *soft; 2659 struct ioc4_soft *soft;
2695 struct ioc4_control *control; 2660 struct ioc4_control *control;
2696 int tmp, ret = 0; 2661 int ret = 0;
2697 2662
2698 2663
2699 DPRINT_CONFIG(("%s (0x%p, 0x%p)\n", __FUNCTION__, pdev, pci_id)); 2664 DPRINT_CONFIG(("%s (0x%p, 0x%p)\n", __FUNCTION__, idd->idd_pdev, idd->idd_pci_id));
2700
2701 /* Map in the ioc4 memory */
2702 tmp_addr = pci_resource_start(pdev, 0);
2703 if (!tmp_addr) {
2704 printk(KERN_WARNING
2705 "ioc4 (%p) : unable to get PIO mapping for "
2706 "MEM space\n", (void *)pdev);
2707 return -ENODEV;
2708 }
2709 if (!request_region(tmp_addr, sizeof(struct ioc4_mem), "sioc4_mem")) {
2710 printk(KERN_ALERT
2711 "ioc4 (%p): unable to get request region for "
2712 "MEM space\n", (void *)pdev);
2713 return -ENODEV;
2714 }
2715 mem = ioremap(tmp_addr, sizeof(struct ioc4_mem));
2716 if (!mem) {
2717 printk(KERN_WARNING
2718 "ioc4 (%p) : unable to remap ioc4 memory\n",
2719 (void *)pdev);
2720 ret = -ENODEV;
2721 goto out1;
2722 }
2723 2665
2724 /* request serial registers */ 2666 /* request serial registers */
2725 tmp_addr1 = pci_resource_start(pdev, 0) + IOC4_SERIAL_OFFSET; 2667 tmp_addr1 = idd->idd_bar0 + IOC4_SERIAL_OFFSET;
2726 2668
2727 if (!request_region(tmp_addr1, sizeof(struct ioc4_serial), 2669 if (!request_region(tmp_addr1, sizeof(struct ioc4_serial),
2728 "sioc4_uart")) { 2670 "sioc4_uart")) {
2729 printk(KERN_WARNING 2671 printk(KERN_WARNING
2730 "ioc4 (%p): unable to get request region for " 2672 "ioc4 (%p): unable to get request region for "
2731 "uart space\n", (void *)pdev); 2673 "uart space\n", (void *)idd->idd_pdev);
2732 ret = -ENODEV; 2674 ret = -ENODEV;
2733 goto out1; 2675 goto out1;
2734 } 2676 }
@@ -2736,12 +2678,12 @@ ioc4_serial_attach_one(struct pci_dev *pdev, const struct pci_device_id *pci_id)
2736 if (!serial) { 2678 if (!serial) {
2737 printk(KERN_WARNING 2679 printk(KERN_WARNING
2738 "ioc4 (%p) : unable to remap ioc4 serial register\n", 2680 "ioc4 (%p) : unable to remap ioc4 serial register\n",
2739 (void *)pdev); 2681 (void *)idd->idd_pdev);
2740 ret = -ENODEV; 2682 ret = -ENODEV;
2741 goto out2; 2683 goto out2;
2742 } 2684 }
2743 DPRINT_CONFIG(("%s : mem 0x%p, serial 0x%p\n", 2685 DPRINT_CONFIG(("%s : mem 0x%p, serial 0x%p\n",
2744 __FUNCTION__, (void *)mem, (void *)serial)); 2686 __FUNCTION__, (void *)idd->idd_misc_regs, (void *)serial));
2745 2687
2746 /* Get memory for the new card */ 2688 /* Get memory for the new card */
2747 control = kmalloc(sizeof(struct ioc4_control) * IOC4_NUM_SERIAL_PORTS, 2689 control = kmalloc(sizeof(struct ioc4_control) * IOC4_NUM_SERIAL_PORTS,
@@ -2754,59 +2696,56 @@ ioc4_serial_attach_one(struct pci_dev *pdev, const struct pci_device_id *pci_id)
2754 goto out2; 2696 goto out2;
2755 } 2697 }
2756 memset(control, 0, sizeof(struct ioc4_control)); 2698 memset(control, 0, sizeof(struct ioc4_control));
2757 pci_set_drvdata(pdev, control); 2699 idd->idd_serial_data = control;
2758 2700
2759 /* Allocate the soft structure */ 2701 /* Allocate the soft structure */
2760 soft = kmalloc(sizeof(struct ioc4_soft), GFP_KERNEL); 2702 soft = kmalloc(sizeof(struct ioc4_soft), GFP_KERNEL);
2761 if (!soft) { 2703 if (!soft) {
2762 printk(KERN_WARNING 2704 printk(KERN_WARNING
2763 "ioc4 (%p): unable to get memory for the soft struct\n", 2705 "ioc4 (%p): unable to get memory for the soft struct\n",
2764 (void *)pdev); 2706 (void *)idd->idd_pdev);
2765 ret = -ENOMEM; 2707 ret = -ENOMEM;
2766 goto out3; 2708 goto out3;
2767 } 2709 }
2768 memset(soft, 0, sizeof(struct ioc4_soft)); 2710 memset(soft, 0, sizeof(struct ioc4_soft));
2769 2711
2770 spin_lock_init(&soft->is_ir_lock); 2712 spin_lock_init(&soft->is_ir_lock);
2771 soft->is_ioc4_mem_addr = mem; 2713 soft->is_ioc4_misc_addr = idd->idd_misc_regs;
2772 soft->is_ioc4_serial_addr = serial; 2714 soft->is_ioc4_serial_addr = serial;
2773 2715
2774 /* Init the IOC4 */ 2716 /* Init the IOC4 */
2775 pci_read_config_dword(pdev, PCI_COMMAND, &tmp); 2717 writel(0xf << IOC4_SIO_CR_CMD_PULSE_SHIFT,
2776 pci_write_config_dword(pdev, PCI_COMMAND, 2718 &idd->idd_misc_regs->sio_cr.raw);
2777 tmp | PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
2778
2779 writel(0xf << IOC4_SIO_CR_CMD_PULSE_SHIFT, &mem->sio_cr);
2780 2719
2781 /* Enable serial port mode select generic PIO pins as outputs */ 2720 /* Enable serial port mode select generic PIO pins as outputs */
2782 writel(IOC4_GPCR_UART0_MODESEL | IOC4_GPCR_UART1_MODESEL 2721 writel(IOC4_GPCR_UART0_MODESEL | IOC4_GPCR_UART1_MODESEL
2783 | IOC4_GPCR_UART2_MODESEL | IOC4_GPCR_UART3_MODESEL, 2722 | IOC4_GPCR_UART2_MODESEL | IOC4_GPCR_UART3_MODESEL,
2784 &mem->gpcr_s); 2723 &idd->idd_misc_regs->gpcr_s.raw);
2785 2724
2786 /* Clear and disable all interrupts */ 2725 /* Clear and disable all serial interrupts */
2787 write_ireg(soft, ~0, IOC4_W_IEC, IOC4_SIO_INTR_TYPE); 2726 write_ireg(soft, ~0, IOC4_W_IEC, IOC4_SIO_INTR_TYPE);
2788 writel(~0, &mem->sio_ir); 2727 writel(~0, &idd->idd_misc_regs->sio_ir.raw);
2789 write_ireg(soft, ~(IOC4_OTHER_IR_ATA_INT | IOC4_OTHER_IR_ATA_MEMERR), 2728 write_ireg(soft, IOC4_OTHER_IR_SER_MEMERR, IOC4_W_IEC,
2790 IOC4_W_IEC, IOC4_OTHER_INTR_TYPE); 2729 IOC4_OTHER_INTR_TYPE);
2791 writel(~(IOC4_OTHER_IR_ATA_MEMERR | IOC4_OTHER_IR_ATA_MEMERR), 2730 writel(IOC4_OTHER_IR_SER_MEMERR, &idd->idd_misc_regs->other_ir.raw);
2792 &mem->other_ir);
2793 control->ic_soft = soft; 2731 control->ic_soft = soft;
2794 if (!request_irq(pdev->irq, ioc4_intr, SA_SHIRQ, 2732
2733 /* Hook up interrupt handler */
2734 if (!request_irq(idd->idd_pdev->irq, ioc4_intr, SA_SHIRQ,
2795 "sgi-ioc4serial", (void *)soft)) { 2735 "sgi-ioc4serial", (void *)soft)) {
2796 control->ic_irq = pdev->irq; 2736 control->ic_irq = idd->idd_pdev->irq;
2797 } else { 2737 } else {
2798 printk(KERN_WARNING 2738 printk(KERN_WARNING
2799 "%s : request_irq fails for IRQ 0x%x\n ", 2739 "%s : request_irq fails for IRQ 0x%x\n ",
2800 __FUNCTION__, pdev->irq); 2740 __FUNCTION__, idd->idd_pdev->irq);
2801 } 2741 }
2802 if ((ret = ioc4_attach_local(pdev, control, soft, 2742 ret = ioc4_attach_local(idd);
2803 soft->is_ioc4_mem_addr, 2743 if (ret)
2804 soft->is_ioc4_serial_addr)))
2805 goto out4; 2744 goto out4;
2806 2745
2807 /* register port with the serial core */ 2746 /* register port with the serial core */
2808 2747
2809 if ((ret = ioc4_serial_core_attach(pdev))) 2748 if ((ret = ioc4_serial_core_attach(idd->idd_pdev)))
2810 goto out4; 2749 goto out4;
2811 2750
2812 return ret; 2751 return ret;
@@ -2819,7 +2758,6 @@ out3:
2819out2: 2758out2:
2820 release_region(tmp_addr1, sizeof(struct ioc4_serial)); 2759 release_region(tmp_addr1, sizeof(struct ioc4_serial));
2821out1: 2760out1:
2822 release_region(tmp_addr, sizeof(struct ioc4_mem));
2823 2761
2824 return ret; 2762 return ret;
2825} 2763}
@@ -2828,11 +2766,10 @@ out1:
2828/** 2766/**
2829 * ioc4_serial_remove_one - detach function 2767 * ioc4_serial_remove_one - detach function
2830 * 2768 *
2831 * @pdev: handle for this card 2769 * @idd: IOC4 master module data for this IOC4
2832 */ 2770 */
2833 2771
2834#if 0 2772int ioc4_serial_remove_one(struct ioc4_driver_data *idd)
2835void ioc4_serial_remove_one(struct pci_dev *pdev)
2836{ 2773{
2837 int ii; 2774 int ii;
2838 struct ioc4_control *control; 2775 struct ioc4_control *control;
@@ -2840,7 +2777,7 @@ void ioc4_serial_remove_one(struct pci_dev *pdev)
2840 struct ioc4_port *port; 2777 struct ioc4_port *port;
2841 struct ioc4_soft *soft; 2778 struct ioc4_soft *soft;
2842 2779
2843 control = pci_get_drvdata(pdev); 2780 control = idd->idd_serial_data;
2844 2781
2845 for (ii = 0; ii < IOC4_NUM_SERIAL_PORTS; ii++) { 2782 for (ii = 0; ii < IOC4_NUM_SERIAL_PORTS; ii++) {
2846 the_port = &control->ic_port[ii].icp_uart_port; 2783 the_port = &control->ic_port[ii].icp_uart_port;
@@ -2867,10 +2804,17 @@ void ioc4_serial_remove_one(struct pci_dev *pdev)
2867 kfree(soft); 2804 kfree(soft);
2868 } 2805 }
2869 kfree(control); 2806 kfree(control);
2870 pci_set_drvdata(pdev, NULL); 2807 idd->idd_serial_data = NULL;
2871 uart_unregister_driver(&ioc4_uart); 2808
2809 return 0;
2872} 2810}
2873#endif 2811
2812static struct ioc4_submodule ioc4_serial_submodule = {
2813 .is_name = "IOC4_serial",
2814 .is_owner = THIS_MODULE,
2815 .is_probe = ioc4_serial_attach_one,
2816 .is_remove = ioc4_serial_remove_one,
2817};
2874 2818
2875/** 2819/**
2876 * ioc4_serial_init - module init 2820 * ioc4_serial_init - module init
@@ -2886,12 +2830,20 @@ int ioc4_serial_init(void)
2886 __FUNCTION__); 2830 __FUNCTION__);
2887 return ret; 2831 return ret;
2888 } 2832 }
2889 return 0; 2833
2834 /* register with IOC4 main module */
2835 return ioc4_register_submodule(&ioc4_serial_submodule);
2836}
2837
2838static void __devexit ioc4_serial_exit(void)
2839{
2840 ioc4_unregister_submodule(&ioc4_serial_submodule);
2841 uart_unregister_driver(&ioc4_uart);
2890} 2842}
2891 2843
2844module_init(ioc4_serial_init);
2845module_exit(ioc4_serial_exit);
2846
2892MODULE_AUTHOR("Pat Gefre - Silicon Graphics Inc. (SGI) <pfg@sgi.com>"); 2847MODULE_AUTHOR("Pat Gefre - Silicon Graphics Inc. (SGI) <pfg@sgi.com>");
2893MODULE_DESCRIPTION("Serial PCI driver module for SGI IOC4 Base-IO Card"); 2848MODULE_DESCRIPTION("Serial PCI driver module for SGI IOC4 Base-IO Card");
2894MODULE_LICENSE("GPL"); 2849MODULE_LICENSE("GPL");
2895
2896EXPORT_SYMBOL(ioc4_serial_init);
2897EXPORT_SYMBOL(ioc4_serial_attach_one);
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c
index 22565a67a57c..98641c3f5ab9 100644
--- a/drivers/serial/sa1100.c
+++ b/drivers/serial/sa1100.c
@@ -197,7 +197,7 @@ static void
197sa1100_rx_chars(struct sa1100_port *sport, struct pt_regs *regs) 197sa1100_rx_chars(struct sa1100_port *sport, struct pt_regs *regs)
198{ 198{
199 struct tty_struct *tty = sport->port.info->tty; 199 struct tty_struct *tty = sport->port.info->tty;
200 unsigned int status, ch, flg, ignored = 0; 200 unsigned int status, ch, flg;
201 201
202 status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) | 202 status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) |
203 UTSR0_TO_SM(UART_GET_UTSR0(sport)); 203 UTSR0_TO_SM(UART_GET_UTSR0(sport));
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c
index 5d2ceb623e6f..1f985327b0d4 100644
--- a/drivers/serial/vr41xx_siu.c
+++ b/drivers/serial/vr41xx_siu.c
@@ -234,7 +234,7 @@ static inline const char *siu_type_name(struct uart_port *port)
234 return "DSIU"; 234 return "DSIU";
235 } 235 }
236 236
237 return "unknown"; 237 return NULL;
238} 238}
239 239
240static unsigned int siu_tx_empty(struct uart_port *port) 240static unsigned int siu_tx_empty(struct uart_port *port)
@@ -482,9 +482,6 @@ static irqreturn_t siu_interrupt(int irq, void *dev_id, struct pt_regs *regs)
482 struct uart_port *port; 482 struct uart_port *port;
483 uint8_t iir, lsr; 483 uint8_t iir, lsr;
484 484
485 if (dev_id == NULL)
486 return IRQ_NONE;
487
488 port = (struct uart_port *)dev_id; 485 port = (struct uart_port *)dev_id;
489 486
490 iir = siu_read(port, UART_IIR); 487 iir = siu_read(port, UART_IIR);
@@ -507,6 +504,9 @@ static int siu_startup(struct uart_port *port)
507{ 504{
508 int retval; 505 int retval;
509 506
507 if (port->membase == NULL)
508 return -ENODEV;
509
510 siu_clear_fifo(port); 510 siu_clear_fifo(port);
511 511
512 (void)siu_read(port, UART_LSR); 512 (void)siu_read(port, UART_LSR);
@@ -545,9 +545,6 @@ static void siu_shutdown(struct uart_port *port)
545 unsigned long flags; 545 unsigned long flags;
546 uint8_t lcr; 546 uint8_t lcr;
547 547
548 if (port->membase == NULL)
549 return;
550
551 siu_write(port, UART_IER, 0); 548 siu_write(port, UART_IER, 0);
552 549
553 spin_lock_irqsave(&port->lock, flags); 550 spin_lock_irqsave(&port->lock, flags);
@@ -802,53 +799,6 @@ static int siu_init_ports(void)
802 799
803#ifdef CONFIG_SERIAL_VR41XX_CONSOLE 800#ifdef CONFIG_SERIAL_VR41XX_CONSOLE
804 801
805static void early_set_termios(struct uart_port *port, struct termios *new,
806 struct termios *old)
807{
808 tcflag_t c_cflag;
809 uint8_t lcr;
810 unsigned int baud, quot;
811
812 c_cflag = new->c_cflag;
813 switch (c_cflag & CSIZE) {
814 case CS5:
815 lcr = UART_LCR_WLEN5;
816 break;
817 case CS6:
818 lcr = UART_LCR_WLEN6;
819 break;
820 case CS7:
821 lcr = UART_LCR_WLEN7;
822 break;
823 default:
824 lcr = UART_LCR_WLEN8;
825 break;
826 }
827
828 if (c_cflag & CSTOPB)
829 lcr |= UART_LCR_STOP;
830 if (c_cflag & PARENB)
831 lcr |= UART_LCR_PARITY;
832 if ((c_cflag & PARODD) != PARODD)
833 lcr |= UART_LCR_EPAR;
834 if (c_cflag & CMSPAR)
835 lcr |= UART_LCR_SPAR;
836
837 baud = uart_get_baud_rate(port, new, old, 0, port->uartclk/16);
838 quot = uart_get_divisor(port, baud);
839
840 siu_write(port, UART_LCR, lcr | UART_LCR_DLAB);
841
842 siu_write(port, UART_DLL, (uint8_t)quot);
843 siu_write(port, UART_DLM, (uint8_t)(quot >> 8));
844
845 siu_write(port, UART_LCR, lcr);
846}
847
848static struct uart_ops early_uart_ops = {
849 .set_termios = early_set_termios,
850};
851
852#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) 802#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
853 803
854static void wait_for_xmitr(struct uart_port *port) 804static void wait_for_xmitr(struct uart_port *port)
@@ -915,7 +865,7 @@ static int siu_console_setup(struct console *con, char *options)
915 if (port->membase == NULL) { 865 if (port->membase == NULL) {
916 if (port->mapbase == 0) 866 if (port->mapbase == 0)
917 return -ENODEV; 867 return -ENODEV;
918 port->membase = (unsigned char __iomem *)KSEG1ADDR(port->mapbase); 868 port->membase = ioremap(port->mapbase, siu_port_size(port));
919 } 869 }
920 870
921 vr41xx_select_siu_interface(SIU_INTERFACE_RS232C); 871 vr41xx_select_siu_interface(SIU_INTERFACE_RS232C);
@@ -949,7 +899,7 @@ static int __devinit siu_console_init(void)
949 899
950 for (i = 0; i < num; i++) { 900 for (i = 0; i < num; i++) {
951 port = &siu_uart_ports[i]; 901 port = &siu_uart_ports[i];
952 port->ops = &early_uart_ops; 902 port->ops = &siu_uart_ops;
953 } 903 }
954 904
955 register_console(&siu_console); 905 register_console(&siu_console);
@@ -994,8 +944,10 @@ static int siu_probe(struct device *dev)
994 port->dev = dev; 944 port->dev = dev;
995 945
996 retval = uart_add_one_port(&siu_uart_driver, port); 946 retval = uart_add_one_port(&siu_uart_driver, port);
997 if (retval) 947 if (retval < 0) {
948 port->dev = NULL;
998 break; 949 break;
950 }
999 } 951 }
1000 952
1001 if (i == 0 && retval < 0) { 953 if (i == 0 && retval < 0) {
diff --git a/drivers/sh/superhyway/superhyway-sysfs.c b/drivers/sh/superhyway/superhyway-sysfs.c
index 39ab6a12da76..dc119ce68e3e 100644
--- a/drivers/sh/superhyway/superhyway-sysfs.c
+++ b/drivers/sh/superhyway/superhyway-sysfs.c
@@ -15,7 +15,7 @@
15#include <linux/superhyway.h> 15#include <linux/superhyway.h>
16 16
17#define superhyway_ro_attr(name, fmt, field) \ 17#define superhyway_ro_attr(name, fmt, field) \
18static ssize_t name##_show(struct device *dev, char *buf) \ 18static ssize_t name##_show(struct device *dev, struct device_attribute *attr, char *buf) \
19{ \ 19{ \
20 struct superhyway_device *s = to_superhyway_device(dev); \ 20 struct superhyway_device *s = to_superhyway_device(dev); \
21 return sprintf(buf, fmt, s->field); \ 21 return sprintf(buf, fmt, s->field); \
diff --git a/drivers/sn/Kconfig b/drivers/sn/Kconfig
new file mode 100644
index 000000000000..13b8d249da5c
--- /dev/null
+++ b/drivers/sn/Kconfig
@@ -0,0 +1,20 @@
1#
2# Miscellaneous SN-specific devices
3#
4
5menu "SN Devices"
6
7config SGI_IOC4
8 tristate "SGI IOC4 Base IO support"
9 depends on (IA64_GENERIC || IA64_SGI_SN2) && MMTIMER
10 default m
11 ---help---
12 This option enables basic support for the SGI IOC4-based Base IO
13 controller card. This option does not enable any specific
14 functions on such a card, but provides necessary infrastructure
15 for other drivers to utilize.
16
17 If you have an SGI Altix with an IOC4-based
18 I/O controller say Y. Otherwise say N.
19
20endmenu
diff --git a/drivers/sn/Makefile b/drivers/sn/Makefile
index 631e54958448..c2a284185372 100644
--- a/drivers/sn/Makefile
+++ b/drivers/sn/Makefile
@@ -3,4 +3,4 @@
3# 3#
4# 4#
5 5
6obj-$(CONFIG_BLK_DEV_SGIIOC4) += ioc4.o 6obj-$(CONFIG_SGI_IOC4) += ioc4.o
diff --git a/drivers/sn/ioc4.c b/drivers/sn/ioc4.c
index d9e4ee280e5f..ea75b3d0612b 100644
--- a/drivers/sn/ioc4.c
+++ b/drivers/sn/ioc4.c
@@ -6,60 +6,422 @@
6 * Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved. 6 * Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved.
7 */ 7 */
8 8
9/* 9/* This file contains the master driver module for use by SGI IOC4 subdrivers.
10 * This file contains a shim driver for the IOC4 IDE and serial drivers. 10 *
11 * It allocates any resources shared between multiple subdevices, and
12 * provides accessor functions (where needed) and the like for those
13 * resources. It also provides a mechanism for the subdevice modules
14 * to support loading and unloading.
15 *
16 * Non-shared resources (e.g. external interrupt A_INT_OUT register page
17 * alias, serial port and UART registers) are handled by the subdevice
18 * modules themselves.
19 *
20 * This is all necessary because IOC4 is not implemented as a multi-function
21 * PCI device, but an amalgamation of disparate registers for several
22 * types of device (ATA, serial, external interrupts). The normal
23 * resource management in the kernel doesn't have quite the right interfaces
24 * to handle this situation (e.g. multiple modules can't claim the same
25 * PCI ID), thus this IOC4 master module.
11 */ 26 */
12 27
13#include <linux/errno.h> 28#include <linux/errno.h>
14#include <linux/module.h> 29#include <linux/module.h>
15#include <linux/pci.h> 30#include <linux/pci.h>
16#include <linux/ioc4_common.h> 31#include <linux/ioc4.h>
17#include <linux/ide.h> 32#include <linux/mmtimer.h>
33#include <linux/rtc.h>
34#include <linux/rwsem.h>
35#include <asm/sn/addrs.h>
36#include <asm/sn/clksupport.h>
37#include <asm/sn/shub_mmr.h>
18 38
39/***************
40 * Definitions *
41 ***************/
19 42
20static int __devinit 43/* Tweakable values */
21ioc4_probe_one(struct pci_dev *pdev, const struct pci_device_id *pci_id) 44
45/* PCI bus speed detection/calibration */
46#define IOC4_CALIBRATE_COUNT 63 /* Calibration cycle period */
47#define IOC4_CALIBRATE_CYCLES 256 /* Average over this many cycles */
48#define IOC4_CALIBRATE_DISCARD 2 /* Discard first few cycles */
49#define IOC4_CALIBRATE_LOW_MHZ 25 /* Lower bound on bus speed sanity */
50#define IOC4_CALIBRATE_HIGH_MHZ 75 /* Upper bound on bus speed sanity */
51#define IOC4_CALIBRATE_DEFAULT_MHZ 66 /* Assumed if sanity check fails */
52
53/************************
54 * Submodule management *
55 ************************/
56
57static LIST_HEAD(ioc4_devices);
58static DECLARE_RWSEM(ioc4_devices_rwsem);
59
60static LIST_HEAD(ioc4_submodules);
61static DECLARE_RWSEM(ioc4_submodules_rwsem);
62
63/* Register an IOC4 submodule */
64int
65ioc4_register_submodule(struct ioc4_submodule *is)
66{
67 struct ioc4_driver_data *idd;
68
69 down_write(&ioc4_submodules_rwsem);
70 list_add(&is->is_list, &ioc4_submodules);
71 up_write(&ioc4_submodules_rwsem);
72
73 /* Initialize submodule for each IOC4 */
74 if (!is->is_probe)
75 return 0;
76
77 down_read(&ioc4_devices_rwsem);
78 list_for_each_entry(idd, &ioc4_devices, idd_list) {
79 if (is->is_probe(idd)) {
80 printk(KERN_WARNING
81 "%s: IOC4 submodule %s probe failed "
82 "for pci_dev %s",
83 __FUNCTION__, module_name(is->is_owner),
84 pci_name(idd->idd_pdev));
85 }
86 }
87 up_read(&ioc4_devices_rwsem);
88
89 return 0;
90}
91
92/* Unregister an IOC4 submodule */
93void
94ioc4_unregister_submodule(struct ioc4_submodule *is)
95{
96 struct ioc4_driver_data *idd;
97
98 down_write(&ioc4_submodules_rwsem);
99 list_del(&is->is_list);
100 up_write(&ioc4_submodules_rwsem);
101
102 /* Remove submodule for each IOC4 */
103 if (!is->is_remove)
104 return;
105
106 down_read(&ioc4_devices_rwsem);
107 list_for_each_entry(idd, &ioc4_devices, idd_list) {
108 if (is->is_remove(idd)) {
109 printk(KERN_WARNING
110 "%s: IOC4 submodule %s remove failed "
111 "for pci_dev %s.\n",
112 __FUNCTION__, module_name(is->is_owner),
113 pci_name(idd->idd_pdev));
114 }
115 }
116 up_read(&ioc4_devices_rwsem);
117}
118
119/*********************
120 * Device management *
121 *********************/
122
123#define IOC4_CALIBRATE_LOW_LIMIT \
124 (1000*IOC4_EXTINT_COUNT_DIVISOR/IOC4_CALIBRATE_LOW_MHZ)
125#define IOC4_CALIBRATE_HIGH_LIMIT \
126 (1000*IOC4_EXTINT_COUNT_DIVISOR/IOC4_CALIBRATE_HIGH_MHZ)
127#define IOC4_CALIBRATE_DEFAULT \
128 (1000*IOC4_EXTINT_COUNT_DIVISOR/IOC4_CALIBRATE_DEFAULT_MHZ)
129
130#define IOC4_CALIBRATE_END \
131 (IOC4_CALIBRATE_CYCLES + IOC4_CALIBRATE_DISCARD)
132
133#define IOC4_INT_OUT_MODE_TOGGLE 0x7 /* Toggle INT_OUT every COUNT+1 ticks */
134
135/* Determines external interrupt output clock period of the PCI bus an
136 * IOC4 is attached to. This value can be used to determine the PCI
137 * bus speed.
138 *
139 * IOC4 has a design feature that various internal timers are derived from
140 * the PCI bus clock. This causes IOC4 device drivers to need to take the
141 * bus speed into account when setting various register values (e.g. INT_OUT
142 * register COUNT field, UART divisors, etc). Since this information is
143 * needed by several subdrivers, it is determined by the main IOC4 driver,
144 * even though the following code utilizes external interrupt registers
145 * to perform the speed calculation.
146 */
147static void
148ioc4_clock_calibrate(struct ioc4_driver_data *idd)
149{
150 extern unsigned long sn_rtc_cycles_per_second;
151 union ioc4_int_out int_out;
152 union ioc4_gpcr gpcr;
153 unsigned int state, last_state = 1;
154 uint64_t start = 0, end, period;
155 unsigned int count = 0;
156
157 /* Enable output */
158 gpcr.raw = 0;
159 gpcr.fields.dir = IOC4_GPCR_DIR_0;
160 gpcr.fields.int_out_en = 1;
161 writel(gpcr.raw, &idd->idd_misc_regs->gpcr_s.raw);
162
163 /* Reset to power-on state */
164 writel(0, &idd->idd_misc_regs->int_out.raw);
165 mmiowb();
166
167 printk(KERN_INFO
168 "%s: Calibrating PCI bus speed "
169 "for pci_dev %s ... ", __FUNCTION__, pci_name(idd->idd_pdev));
170 /* Set up square wave */
171 int_out.raw = 0;
172 int_out.fields.count = IOC4_CALIBRATE_COUNT;
173 int_out.fields.mode = IOC4_INT_OUT_MODE_TOGGLE;
174 int_out.fields.diag = 0;
175 writel(int_out.raw, &idd->idd_misc_regs->int_out.raw);
176 mmiowb();
177
178 /* Check square wave period averaged over some number of cycles */
179 do {
180 int_out.raw = readl(&idd->idd_misc_regs->int_out.raw);
181 state = int_out.fields.int_out;
182 if (!last_state && state) {
183 count++;
184 if (count == IOC4_CALIBRATE_END) {
185 end = rtc_time();
186 break;
187 } else if (count == IOC4_CALIBRATE_DISCARD)
188 start = rtc_time();
189 }
190 last_state = state;
191 } while (1);
192
193 /* Calculation rearranged to preserve intermediate precision.
194 * Logically:
195 * 1. "end - start" gives us number of RTC cycles over all the
196 * square wave cycles measured.
197 * 2. Divide by number of square wave cycles to get number of
198 * RTC cycles per square wave cycle.
199 * 3. Divide by 2*(int_out.fields.count+1), which is the formula
200 * by which the IOC4 generates the square wave, to get the
201 * number of RTC cycles per IOC4 INT_OUT count.
202 * 4. Divide by sn_rtc_cycles_per_second to get seconds per
203 * count.
204 * 5. Multiply by 1E9 to get nanoseconds per count.
205 */
206 period = ((end - start) * 1000000000) /
207 (IOC4_CALIBRATE_CYCLES * 2 * (IOC4_CALIBRATE_COUNT + 1)
208 * sn_rtc_cycles_per_second);
209
210 /* Bounds check the result. */
211 if (period > IOC4_CALIBRATE_LOW_LIMIT ||
212 period < IOC4_CALIBRATE_HIGH_LIMIT) {
213 printk("failed. Assuming PCI clock ticks are %d ns.\n",
214 IOC4_CALIBRATE_DEFAULT / IOC4_EXTINT_COUNT_DIVISOR);
215 period = IOC4_CALIBRATE_DEFAULT;
216 } else {
217 printk("succeeded. PCI clock ticks are %ld ns.\n",
218 period / IOC4_EXTINT_COUNT_DIVISOR);
219 }
220
221 /* Remember results. We store the extint clock period rather
222 * than the PCI clock period so that greater precision is
223 * retained. Divide by IOC4_EXTINT_COUNT_DIVISOR to get
224 * PCI clock period.
225 */
226 idd->count_period = period;
227}
228
229/* Adds a new instance of an IOC4 card */
230static int
231ioc4_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
22{ 232{
233 struct ioc4_driver_data *idd;
234 struct ioc4_submodule *is;
235 uint32_t pcmd;
23 int ret; 236 int ret;
24 237
238 /* Enable IOC4 and take ownership of it */
25 if ((ret = pci_enable_device(pdev))) { 239 if ((ret = pci_enable_device(pdev))) {
26 printk(KERN_WARNING 240 printk(KERN_WARNING
27 "%s: Failed to enable device with " 241 "%s: Failed to enable IOC4 device for pci_dev %s.\n",
28 "pci_dev 0x%p... returning\n", 242 __FUNCTION__, pci_name(pdev));
29 __FUNCTION__, (void *)pdev); 243 goto out;
30 return ret;
31 } 244 }
32 pci_set_master(pdev); 245 pci_set_master(pdev);
33 246
34 /* attach each sub-device */ 247 /* Set up per-IOC4 data */
35 ret = ioc4_ide_attach_one(pdev, pci_id); 248 idd = kmalloc(sizeof(struct ioc4_driver_data), GFP_KERNEL);
36 if (ret) 249 if (!idd) {
37 return ret; 250 printk(KERN_WARNING
38 return ioc4_serial_attach_one(pdev, pci_id); 251 "%s: Failed to allocate IOC4 data for pci_dev %s.\n",
252 __FUNCTION__, pci_name(pdev));
253 ret = -ENODEV;
254 goto out_idd;
255 }
256 idd->idd_pdev = pdev;
257 idd->idd_pci_id = pci_id;
258
259 /* Map IOC4 misc registers. These are shared between subdevices
260 * so the main IOC4 module manages them.
261 */
262 idd->idd_bar0 = pci_resource_start(idd->idd_pdev, 0);
263 if (!idd->idd_bar0) {
264 printk(KERN_WARNING
265 "%s: Unable to find IOC4 misc resource "
266 "for pci_dev %s.\n",
267 __FUNCTION__, pci_name(idd->idd_pdev));
268 ret = -ENODEV;
269 goto out_pci;
270 }
271 if (!request_region(idd->idd_bar0, sizeof(struct ioc4_misc_regs),
272 "ioc4_misc")) {
273 printk(KERN_WARNING
274 "%s: Unable to request IOC4 misc region "
275 "for pci_dev %s.\n",
276 __FUNCTION__, pci_name(idd->idd_pdev));
277 ret = -ENODEV;
278 goto out_pci;
279 }
280 idd->idd_misc_regs = ioremap(idd->idd_bar0,
281 sizeof(struct ioc4_misc_regs));
282 if (!idd->idd_misc_regs) {
283 printk(KERN_WARNING
284 "%s: Unable to remap IOC4 misc region "
285 "for pci_dev %s.\n",
286 __FUNCTION__, pci_name(idd->idd_pdev));
287 ret = -ENODEV;
288 goto out_misc_region;
289 }
290
291 /* Failsafe portion of per-IOC4 initialization */
292
293 /* Initialize IOC4 */
294 pci_read_config_dword(idd->idd_pdev, PCI_COMMAND, &pcmd);
295 pci_write_config_dword(idd->idd_pdev, PCI_COMMAND,
296 pcmd | PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
297
298 /* Determine PCI clock */
299 ioc4_clock_calibrate(idd);
300
301 /* Disable/clear all interrupts. Need to do this here lest
302 * one submodule request the shared IOC4 IRQ, but interrupt
303 * is generated by a different subdevice.
304 */
305 /* Disable */
306 writel(~0, &idd->idd_misc_regs->other_iec.raw);
307 writel(~0, &idd->idd_misc_regs->sio_iec);
308 /* Clear (i.e. acknowledge) */
309 writel(~0, &idd->idd_misc_regs->other_ir.raw);
310 writel(~0, &idd->idd_misc_regs->sio_ir);
311
312 /* Track PCI-device specific data */
313 idd->idd_serial_data = NULL;
314 pci_set_drvdata(idd->idd_pdev, idd);
315 down_write(&ioc4_devices_rwsem);
316 list_add(&idd->idd_list, &ioc4_devices);
317 up_write(&ioc4_devices_rwsem);
318
319 /* Add this IOC4 to all submodules */
320 down_read(&ioc4_submodules_rwsem);
321 list_for_each_entry(is, &ioc4_submodules, is_list) {
322 if (is->is_probe && is->is_probe(idd)) {
323 printk(KERN_WARNING
324 "%s: IOC4 submodule 0x%s probe failed "
325 "for pci_dev %s.\n",
326 __FUNCTION__, module_name(is->is_owner),
327 pci_name(idd->idd_pdev));
328 }
329 }
330 up_read(&ioc4_submodules_rwsem);
331
332 return 0;
333
334out_misc_region:
335 release_region(idd->idd_bar0, sizeof(struct ioc4_misc_regs));
336out_pci:
337 kfree(idd);
338out_idd:
339 pci_disable_device(pdev);
340out:
341 return ret;
39} 342}
40 343
41/* pci device struct */ 344/* Removes a particular instance of an IOC4 card. */
42static struct pci_device_id ioc4_s_id_table[] = { 345static void
346ioc4_remove(struct pci_dev *pdev)
347{
348 struct ioc4_submodule *is;
349 struct ioc4_driver_data *idd;
350
351 idd = pci_get_drvdata(pdev);
352
353 /* Remove this IOC4 from all submodules */
354 down_read(&ioc4_submodules_rwsem);
355 list_for_each_entry(is, &ioc4_submodules, is_list) {
356 if (is->is_remove && is->is_remove(idd)) {
357 printk(KERN_WARNING
358 "%s: IOC4 submodule 0x%s remove failed "
359 "for pci_dev %s.\n",
360 __FUNCTION__, module_name(is->is_owner),
361 pci_name(idd->idd_pdev));
362 }
363 }
364 up_read(&ioc4_submodules_rwsem);
365
366 /* Release resources */
367 iounmap(idd->idd_misc_regs);
368 if (!idd->idd_bar0) {
369 printk(KERN_WARNING
370 "%s: Unable to get IOC4 misc mapping for pci_dev %s. "
371 "Device removal may be incomplete.\n",
372 __FUNCTION__, pci_name(idd->idd_pdev));
373 }
374 release_region(idd->idd_bar0, sizeof(struct ioc4_misc_regs));
375
376 /* Disable IOC4 and relinquish */
377 pci_disable_device(pdev);
378
379 /* Remove and free driver data */
380 down_write(&ioc4_devices_rwsem);
381 list_del(&idd->idd_list);
382 up_write(&ioc4_devices_rwsem);
383 kfree(idd);
384}
385
386static struct pci_device_id ioc4_id_table[] = {
43 {PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4, PCI_ANY_ID, 387 {PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4, PCI_ANY_ID,
44 PCI_ANY_ID, 0x0b4000, 0xFFFFFF}, 388 PCI_ANY_ID, 0x0b4000, 0xFFFFFF},
45 {0} 389 {0}
46}; 390};
47MODULE_DEVICE_TABLE(pci, ioc4_s_id_table);
48 391
49static struct pci_driver __devinitdata ioc4_s_driver = { 392static struct pci_driver __devinitdata ioc4_driver = {
50 .name = "IOC4", 393 .name = "IOC4",
51 .id_table = ioc4_s_id_table, 394 .id_table = ioc4_id_table,
52 .probe = ioc4_probe_one, 395 .probe = ioc4_probe,
396 .remove = ioc4_remove,
53}; 397};
54 398
55static int __devinit ioc4_detect(void) 399MODULE_DEVICE_TABLE(pci, ioc4_id_table);
400
401/*********************
402 * Module management *
403 *********************/
404
405/* Module load */
406static int __devinit
407ioc4_init(void)
56{ 408{
57 ioc4_serial_init(); 409 return pci_register_driver(&ioc4_driver);
410}
58 411
59 return pci_register_driver(&ioc4_s_driver); 412/* Module unload */
413static void __devexit
414ioc4_exit(void)
415{
416 pci_unregister_driver(&ioc4_driver);
60} 417}
61module_init(ioc4_detect);
62 418
63MODULE_AUTHOR("Pat Gefre - Silicon Graphics Inc. (SGI) <pfg@sgi.com>"); 419module_init(ioc4_init);
64MODULE_DESCRIPTION("PCI driver module for SGI IOC4 Base-IO Card"); 420module_exit(ioc4_exit);
421
422MODULE_AUTHOR("Brent Casavant - Silicon Graphics, Inc. <bcasavan@sgi.com>");
423MODULE_DESCRIPTION("PCI driver master module for SGI IOC4 Base-IO Card");
65MODULE_LICENSE("GPL"); 424MODULE_LICENSE("GPL");
425
426EXPORT_SYMBOL(ioc4_register_submodule);
427EXPORT_SYMBOL(ioc4_unregister_submodule);
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index ef0b35731ff0..83e815d3cd52 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -239,7 +239,7 @@ static char *usb_dump_interface_descriptor(char *start, char *end,
239 int setno) 239 int setno)
240{ 240{
241 const struct usb_interface_descriptor *desc = &intfc->altsetting[setno].desc; 241 const struct usb_interface_descriptor *desc = &intfc->altsetting[setno].desc;
242 char *driver_name = ""; 242 const char *driver_name = "";
243 243
244 if (start > end) 244 if (start > end)
245 return start; 245 return start;
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c
index 38ed2220c9fc..65ca131cc44c 100644
--- a/drivers/usb/core/file.c
+++ b/drivers/usb/core/file.c
@@ -68,7 +68,7 @@ static struct file_operations usb_fops = {
68 .open = usb_open, 68 .open = usb_open,
69}; 69};
70 70
71static struct class_simple *usb_class; 71static struct class *usb_class;
72 72
73int usb_major_init(void) 73int usb_major_init(void)
74{ 74{
@@ -80,9 +80,10 @@ int usb_major_init(void)
80 goto out; 80 goto out;
81 } 81 }
82 82
83 usb_class = class_simple_create(THIS_MODULE, "usb"); 83 usb_class = class_create(THIS_MODULE, "usb");
84 if (IS_ERR(usb_class)) { 84 if (IS_ERR(usb_class)) {
85 err("class_simple_create failed for usb devices"); 85 error = PTR_ERR(usb_class);
86 err("class_create failed for usb devices");
86 unregister_chrdev(USB_MAJOR, "usb"); 87 unregister_chrdev(USB_MAJOR, "usb");
87 goto out; 88 goto out;
88 } 89 }
@@ -95,7 +96,7 @@ out:
95 96
96void usb_major_cleanup(void) 97void usb_major_cleanup(void)
97{ 98{
98 class_simple_destroy(usb_class); 99 class_destroy(usb_class);
99 devfs_remove("usb"); 100 devfs_remove("usb");
100 unregister_chrdev(USB_MAJOR, "usb"); 101 unregister_chrdev(USB_MAJOR, "usb");
101} 102}
@@ -171,7 +172,7 @@ int usb_register_dev(struct usb_interface *intf,
171 ++temp; 172 ++temp;
172 else 173 else
173 temp = name; 174 temp = name;
174 intf->class_dev = class_simple_device_add(usb_class, MKDEV(USB_MAJOR, minor), &intf->dev, "%s", temp); 175 intf->class_dev = class_device_create(usb_class, MKDEV(USB_MAJOR, minor), &intf->dev, "%s", temp);
175 if (IS_ERR(intf->class_dev)) { 176 if (IS_ERR(intf->class_dev)) {
176 spin_lock (&minor_lock); 177 spin_lock (&minor_lock);
177 usb_minors[intf->minor] = NULL; 178 usb_minors[intf->minor] = NULL;
@@ -220,7 +221,7 @@ void usb_deregister_dev(struct usb_interface *intf,
220 221
221 snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base); 222 snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base);
222 devfs_remove (name); 223 devfs_remove (name);
223 class_simple_device_remove(MKDEV(USB_MAJOR, intf->minor)); 224 class_device_destroy(usb_class, MKDEV(USB_MAJOR, intf->minor));
224 intf->class_dev = NULL; 225 intf->class_dev = NULL;
225 intf->minor = -1; 226 intf->minor = -1;
226} 227}
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 266e9e06a9f5..d041782e0c8b 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -651,50 +651,45 @@ static int usb_rh_urb_dequeue (struct usb_hcd *hcd, struct urb *urb)
651/*-------------------------------------------------------------------------*/ 651/*-------------------------------------------------------------------------*/
652 652
653/* exported only within usbcore */ 653/* exported only within usbcore */
654struct usb_bus *usb_bus_get (struct usb_bus *bus) 654struct usb_bus *usb_bus_get(struct usb_bus *bus)
655{ 655{
656 struct class_device *tmp; 656 if (bus)
657 kref_get(&bus->kref);
658 return bus;
659}
657 660
658 if (!bus) 661static void usb_host_release(struct kref *kref)
659 return NULL; 662{
663 struct usb_bus *bus = container_of(kref, struct usb_bus, kref);
660 664
661 tmp = class_device_get(&bus->class_dev); 665 if (bus->release)
662 if (tmp) 666 bus->release(bus);
663 return to_usb_bus(tmp);
664 else
665 return NULL;
666} 667}
667 668
668/* exported only within usbcore */ 669/* exported only within usbcore */
669void usb_bus_put (struct usb_bus *bus) 670void usb_bus_put(struct usb_bus *bus)
670{ 671{
671 if (bus) 672 if (bus)
672 class_device_put(&bus->class_dev); 673 kref_put(&bus->kref, usb_host_release);
673} 674}
674 675
675/*-------------------------------------------------------------------------*/ 676/*-------------------------------------------------------------------------*/
676 677
677static void usb_host_release(struct class_device *class_dev) 678static struct class *usb_host_class;
678{
679 struct usb_bus *bus = to_usb_bus(class_dev);
680
681 if (bus->release)
682 bus->release(bus);
683}
684
685static struct class usb_host_class = {
686 .name = "usb_host",
687 .release = &usb_host_release,
688};
689 679
690int usb_host_init(void) 680int usb_host_init(void)
691{ 681{
692 return class_register(&usb_host_class); 682 int retval = 0;
683
684 usb_host_class = class_create(THIS_MODULE, "usb_host");
685 if (IS_ERR(usb_host_class))
686 retval = PTR_ERR(usb_host_class);
687 return retval;
693} 688}
694 689
695void usb_host_cleanup(void) 690void usb_host_cleanup(void)
696{ 691{
697 class_unregister(&usb_host_class); 692 class_destroy(usb_host_class);
698} 693}
699 694
700/** 695/**
@@ -719,8 +714,7 @@ static void usb_bus_init (struct usb_bus *bus)
719 714
720 INIT_LIST_HEAD (&bus->bus_list); 715 INIT_LIST_HEAD (&bus->bus_list);
721 716
722 class_device_initialize(&bus->class_dev); 717 kref_init(&bus->kref);
723 bus->class_dev.class = &usb_host_class;
724} 718}
725 719
726/** 720/**
@@ -761,7 +755,6 @@ struct usb_bus *usb_alloc_bus (struct usb_operations *op)
761static int usb_register_bus(struct usb_bus *bus) 755static int usb_register_bus(struct usb_bus *bus)
762{ 756{
763 int busnum; 757 int busnum;
764 int retval;
765 758
766 down (&usb_bus_list_lock); 759 down (&usb_bus_list_lock);
767 busnum = find_next_zero_bit (busmap.busmap, USB_MAXBUS, 1); 760 busnum = find_next_zero_bit (busmap.busmap, USB_MAXBUS, 1);
@@ -774,15 +767,15 @@ static int usb_register_bus(struct usb_bus *bus)
774 return -E2BIG; 767 return -E2BIG;
775 } 768 }
776 769
777 snprintf(bus->class_dev.class_id, BUS_ID_SIZE, "usb%d", busnum); 770 bus->class_dev = class_device_create(usb_host_class, MKDEV(0,0), bus->controller, "usb%d", busnum);
778 bus->class_dev.dev = bus->controller; 771 if (IS_ERR(bus->class_dev)) {
779 retval = class_device_add(&bus->class_dev);
780 if (retval) {
781 clear_bit(busnum, busmap.busmap); 772 clear_bit(busnum, busmap.busmap);
782 up(&usb_bus_list_lock); 773 up(&usb_bus_list_lock);
783 return retval; 774 return PTR_ERR(bus->class_dev);
784 } 775 }
785 776
777 class_set_devdata(bus->class_dev, bus);
778
786 /* Add it to the local list of buses */ 779 /* Add it to the local list of buses */
787 list_add (&bus->bus_list, &usb_bus_list); 780 list_add (&bus->bus_list, &usb_bus_list);
788 up (&usb_bus_list_lock); 781 up (&usb_bus_list_lock);
@@ -820,7 +813,7 @@ static void usb_deregister_bus (struct usb_bus *bus)
820 813
821 clear_bit (bus->busnum, busmap.busmap); 814 clear_bit (bus->busnum, busmap.busmap);
822 815
823 class_device_del(&bus->class_dev); 816 class_device_unregister(bus->class_dev);
824} 817}
825 818
826/** 819/**
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 4ab50009291d..740cb4c668df 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -24,7 +24,7 @@
24 24
25/* Active configuration fields */ 25/* Active configuration fields */
26#define usb_actconfig_show(field, multiplier, format_string) \ 26#define usb_actconfig_show(field, multiplier, format_string) \
27static ssize_t show_##field (struct device *dev, char *buf) \ 27static ssize_t show_##field (struct device *dev, struct device_attribute *attr, char *buf) \
28{ \ 28{ \
29 struct usb_device *udev; \ 29 struct usb_device *udev; \
30 struct usb_host_config *actconfig; \ 30 struct usb_host_config *actconfig; \
@@ -46,7 +46,7 @@ usb_actconfig_attr (bNumInterfaces, 1, "%2d\n")
46usb_actconfig_attr (bmAttributes, 1, "%2x\n") 46usb_actconfig_attr (bmAttributes, 1, "%2x\n")
47usb_actconfig_attr (bMaxPower, 2, "%3dmA\n") 47usb_actconfig_attr (bMaxPower, 2, "%3dmA\n")
48 48
49static ssize_t show_configuration_string(struct device *dev, char *buf) 49static ssize_t show_configuration_string(struct device *dev, struct device_attribute *attr, char *buf)
50{ 50{
51 struct usb_device *udev; 51 struct usb_device *udev;
52 struct usb_host_config *actconfig; 52 struct usb_host_config *actconfig;
@@ -69,7 +69,7 @@ static DEVICE_ATTR(configuration, S_IRUGO, show_configuration_string, NULL);
69usb_actconfig_show(bConfigurationValue, 1, "%u\n"); 69usb_actconfig_show(bConfigurationValue, 1, "%u\n");
70 70
71static ssize_t 71static ssize_t
72set_bConfigurationValue (struct device *dev, const char *buf, size_t count) 72set_bConfigurationValue (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
73{ 73{
74 struct usb_device *udev = udev = to_usb_device (dev); 74 struct usb_device *udev = udev = to_usb_device (dev);
75 int config, value; 75 int config, value;
@@ -87,7 +87,7 @@ static DEVICE_ATTR(bConfigurationValue, S_IRUGO | S_IWUSR,
87 87
88/* String fields */ 88/* String fields */
89#define usb_string_attr(name) \ 89#define usb_string_attr(name) \
90static ssize_t show_##name(struct device *dev, char *buf) \ 90static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \
91{ \ 91{ \
92 struct usb_device *udev; \ 92 struct usb_device *udev; \
93 int len; \ 93 int len; \
@@ -107,7 +107,7 @@ usb_string_attr(manufacturer);
107usb_string_attr(serial); 107usb_string_attr(serial);
108 108
109static ssize_t 109static ssize_t
110show_speed (struct device *dev, char *buf) 110show_speed (struct device *dev, struct device_attribute *attr, char *buf)
111{ 111{
112 struct usb_device *udev; 112 struct usb_device *udev;
113 char *speed; 113 char *speed;
@@ -133,7 +133,7 @@ show_speed (struct device *dev, char *buf)
133static DEVICE_ATTR(speed, S_IRUGO, show_speed, NULL); 133static DEVICE_ATTR(speed, S_IRUGO, show_speed, NULL);
134 134
135static ssize_t 135static ssize_t
136show_devnum (struct device *dev, char *buf) 136show_devnum (struct device *dev, struct device_attribute *attr, char *buf)
137{ 137{
138 struct usb_device *udev; 138 struct usb_device *udev;
139 139
@@ -143,7 +143,7 @@ show_devnum (struct device *dev, char *buf)
143static DEVICE_ATTR(devnum, S_IRUGO, show_devnum, NULL); 143static DEVICE_ATTR(devnum, S_IRUGO, show_devnum, NULL);
144 144
145static ssize_t 145static ssize_t
146show_version (struct device *dev, char *buf) 146show_version (struct device *dev, struct device_attribute *attr, char *buf)
147{ 147{
148 struct usb_device *udev; 148 struct usb_device *udev;
149 u16 bcdUSB; 149 u16 bcdUSB;
@@ -155,7 +155,7 @@ show_version (struct device *dev, char *buf)
155static DEVICE_ATTR(version, S_IRUGO, show_version, NULL); 155static DEVICE_ATTR(version, S_IRUGO, show_version, NULL);
156 156
157static ssize_t 157static ssize_t
158show_maxchild (struct device *dev, char *buf) 158show_maxchild (struct device *dev, struct device_attribute *attr, char *buf)
159{ 159{
160 struct usb_device *udev; 160 struct usb_device *udev;
161 161
@@ -167,7 +167,7 @@ static DEVICE_ATTR(maxchild, S_IRUGO, show_maxchild, NULL);
167/* Descriptor fields */ 167/* Descriptor fields */
168#define usb_descriptor_attr_le16(field, format_string) \ 168#define usb_descriptor_attr_le16(field, format_string) \
169static ssize_t \ 169static ssize_t \
170show_##field (struct device *dev, char *buf) \ 170show_##field (struct device *dev, struct device_attribute *attr, char *buf) \
171{ \ 171{ \
172 struct usb_device *udev; \ 172 struct usb_device *udev; \
173 \ 173 \
@@ -183,7 +183,7 @@ usb_descriptor_attr_le16(bcdDevice, "%04x\n")
183 183
184#define usb_descriptor_attr(field, format_string) \ 184#define usb_descriptor_attr(field, format_string) \
185static ssize_t \ 185static ssize_t \
186show_##field (struct device *dev, char *buf) \ 186show_##field (struct device *dev, struct device_attribute *attr, char *buf) \
187{ \ 187{ \
188 struct usb_device *udev; \ 188 struct usb_device *udev; \
189 \ 189 \
@@ -254,7 +254,7 @@ void usb_remove_sysfs_dev_files (struct usb_device *udev)
254/* Interface fields */ 254/* Interface fields */
255#define usb_intf_attr(field, format_string) \ 255#define usb_intf_attr(field, format_string) \
256static ssize_t \ 256static ssize_t \
257show_##field (struct device *dev, char *buf) \ 257show_##field (struct device *dev, struct device_attribute *attr, char *buf) \
258{ \ 258{ \
259 struct usb_interface *intf = to_usb_interface (dev); \ 259 struct usb_interface *intf = to_usb_interface (dev); \
260 \ 260 \
@@ -269,7 +269,7 @@ usb_intf_attr (bInterfaceClass, "%02x\n")
269usb_intf_attr (bInterfaceSubClass, "%02x\n") 269usb_intf_attr (bInterfaceSubClass, "%02x\n")
270usb_intf_attr (bInterfaceProtocol, "%02x\n") 270usb_intf_attr (bInterfaceProtocol, "%02x\n")
271 271
272static ssize_t show_interface_string(struct device *dev, char *buf) 272static ssize_t show_interface_string(struct device *dev, struct device_attribute *attr, char *buf)
273{ 273{
274 struct usb_interface *intf; 274 struct usb_interface *intf;
275 struct usb_device *udev; 275 struct usb_device *udev;
@@ -286,36 +286,34 @@ static ssize_t show_interface_string(struct device *dev, char *buf)
286} 286}
287static DEVICE_ATTR(interface, S_IRUGO, show_interface_string, NULL); 287static DEVICE_ATTR(interface, S_IRUGO, show_interface_string, NULL);
288 288
289static ssize_t show_modalias(struct device *dev, char *buf) 289static ssize_t show_modalias(struct device *dev, struct device_attribute *attr, char *buf)
290{ 290{
291 struct usb_interface *intf; 291 struct usb_interface *intf;
292 struct usb_device *udev; 292 struct usb_device *udev;
293 int len;
293 294
294 intf = to_usb_interface(dev); 295 intf = to_usb_interface(dev);
295 udev = interface_to_usbdev(intf); 296 udev = interface_to_usbdev(intf);
296 if (udev->descriptor.bDeviceClass == 0) {
297 struct usb_host_interface *alt = intf->cur_altsetting;
298 297
299 return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02X\n", 298 len = sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic",
300 le16_to_cpu(udev->descriptor.idVendor), 299 le16_to_cpu(udev->descriptor.idVendor),
301 le16_to_cpu(udev->descriptor.idProduct), 300 le16_to_cpu(udev->descriptor.idProduct),
302 le16_to_cpu(udev->descriptor.bcdDevice), 301 le16_to_cpu(udev->descriptor.bcdDevice),
303 udev->descriptor.bDeviceClass, 302 udev->descriptor.bDeviceClass,
304 udev->descriptor.bDeviceSubClass, 303 udev->descriptor.bDeviceSubClass,
305 udev->descriptor.bDeviceProtocol, 304 udev->descriptor.bDeviceProtocol);
305 buf += len;
306
307 if (udev->descriptor.bDeviceClass == 0) {
308 struct usb_host_interface *alt = intf->cur_altsetting;
309
310 return len + sprintf(buf, "%02Xisc%02Xip%02X\n",
306 alt->desc.bInterfaceClass, 311 alt->desc.bInterfaceClass,
307 alt->desc.bInterfaceSubClass, 312 alt->desc.bInterfaceSubClass,
308 alt->desc.bInterfaceProtocol); 313 alt->desc.bInterfaceProtocol);
309 } else { 314 } else {
310 return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic*isc*ip*\n", 315 return len + sprintf(buf, "*isc*ip*\n");
311 le16_to_cpu(udev->descriptor.idVendor),
312 le16_to_cpu(udev->descriptor.idProduct),
313 le16_to_cpu(udev->descriptor.bcdDevice),
314 udev->descriptor.bDeviceClass,
315 udev->descriptor.bDeviceSubClass,
316 udev->descriptor.bDeviceProtocol);
317 } 316 }
318
319} 317}
320static DEVICE_ATTR(modalias, S_IRUGO, show_modalias, NULL); 318static DEVICE_ATTR(modalias, S_IRUGO, show_modalias, NULL);
321 319
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 25cf7e9eccfa..a3c42203213a 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -293,7 +293,7 @@ int usb_driver_claim_interface(struct usb_driver *driver,
293 /* if interface was already added, bind now; else let 293 /* if interface was already added, bind now; else let
294 * the future device_add() bind it, bypassing probe() 294 * the future device_add() bind it, bypassing probe()
295 */ 295 */
296 if (!list_empty (&dev->bus_list)) 296 if (klist_node_attached(&dev->knode_bus))
297 device_bind_driver(dev); 297 device_bind_driver(dev);
298 298
299 return 0; 299 return 0;
@@ -322,9 +322,15 @@ void usb_driver_release_interface(struct usb_driver *driver,
322 if (!dev->driver || dev->driver != &driver->driver) 322 if (!dev->driver || dev->driver != &driver->driver)
323 return; 323 return;
324 324
325 /* don't disconnect from disconnect(), or before dev_add() */ 325 /* don't release from within disconnect() */
326 if (!list_empty (&dev->driver_list) && !list_empty (&dev->bus_list)) 326 if (iface->condition != USB_INTERFACE_BOUND)
327 return;
328
329 /* release only after device_add() */
330 if (klist_node_attached(&dev->knode_bus)) {
331 iface->condition = USB_INTERFACE_UNBINDING;
327 device_release_driver(dev); 332 device_release_driver(dev);
333 }
328 334
329 dev->driver = NULL; 335 dev->driver = NULL;
330 usb_set_intfdata(iface, NULL); 336 usb_set_intfdata(iface, NULL);
@@ -462,6 +468,25 @@ usb_match_id(struct usb_interface *interface, const struct usb_device_id *id)
462 return NULL; 468 return NULL;
463} 469}
464 470
471
472static int __find_interface(struct device * dev, void * data)
473{
474 struct usb_interface ** ret = (struct usb_interface **)data;
475 struct usb_interface * intf = *ret;
476 int *minor = (int *)data;
477
478 /* can't look at usb devices, only interfaces */
479 if (dev->driver == &usb_generic_driver)
480 return 0;
481
482 intf = to_usb_interface(dev);
483 if (intf->minor != -1 && intf->minor == *minor) {
484 *ret = intf;
485 return 1;
486 }
487 return 0;
488}
489
465/** 490/**
466 * usb_find_interface - find usb_interface pointer for driver and device 491 * usb_find_interface - find usb_interface pointer for driver and device
467 * @drv: the driver whose current configuration is considered 492 * @drv: the driver whose current configuration is considered
@@ -473,26 +498,12 @@ usb_match_id(struct usb_interface *interface, const struct usb_device_id *id)
473 */ 498 */
474struct usb_interface *usb_find_interface(struct usb_driver *drv, int minor) 499struct usb_interface *usb_find_interface(struct usb_driver *drv, int minor)
475{ 500{
476 struct list_head *entry; 501 struct usb_interface *intf = (struct usb_interface *)(long)minor;
477 struct device *dev; 502 int ret;
478 struct usb_interface *intf;
479 503
480 list_for_each(entry, &drv->driver.devices) { 504 ret = driver_for_each_device(&drv->driver, NULL, &intf, __find_interface);
481 dev = container_of(entry, struct device, driver_list);
482
483 /* can't look at usb devices, only interfaces */
484 if (dev->driver == &usb_generic_driver)
485 continue;
486
487 intf = to_usb_interface(dev);
488 if (intf->minor == -1)
489 continue;
490 if (intf->minor == minor)
491 return intf;
492 }
493 505
494 /* no device found that matches */ 506 return ret ? intf : NULL;
495 return NULL;
496} 507}
497 508
498static int usb_device_match (struct device *dev, struct device_driver *drv) 509static int usb_device_match (struct device *dev, struct device_driver *drv)
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 8ef8a9cd9ac4..c039d2fbe7ab 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -633,7 +633,7 @@ static const struct usb_gadget_ops dummy_ops = {
633 633
634/* "function" sysfs attribute */ 634/* "function" sysfs attribute */
635static ssize_t 635static ssize_t
636show_function (struct device *dev, char *buf) 636show_function (struct device *dev, struct device_attribute *attr, char *buf)
637{ 637{
638 struct dummy *dum = gadget_dev_to_dummy (dev); 638 struct dummy *dum = gadget_dev_to_dummy (dev);
639 639
@@ -1600,7 +1600,7 @@ show_urb (char *buf, size_t size, struct urb *urb)
1600} 1600}
1601 1601
1602static ssize_t 1602static ssize_t
1603show_urbs (struct device *dev, char *buf) 1603show_urbs (struct device *dev, struct device_attribute *attr, char *buf)
1604{ 1604{
1605 struct usb_hcd *hcd = dev_get_drvdata (dev); 1605 struct usb_hcd *hcd = dev_get_drvdata (dev);
1606 struct dummy *dum = hcd_to_dummy (hcd); 1606 struct dummy *dum = hcd_to_dummy (hcd);
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index 4857f0e4ef44..037a7f163822 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -3554,14 +3554,14 @@ static void close_all_backing_files(struct fsg_dev *fsg)
3554} 3554}
3555 3555
3556 3556
3557static ssize_t show_ro(struct device *dev, char *buf) 3557static ssize_t show_ro(struct device *dev, struct device_attribute *attr, char *buf)
3558{ 3558{
3559 struct lun *curlun = dev_to_lun(dev); 3559 struct lun *curlun = dev_to_lun(dev);
3560 3560
3561 return sprintf(buf, "%d\n", curlun->ro); 3561 return sprintf(buf, "%d\n", curlun->ro);
3562} 3562}
3563 3563
3564static ssize_t show_file(struct device *dev, char *buf) 3564static ssize_t show_file(struct device *dev, struct device_attribute *attr, char *buf)
3565{ 3565{
3566 struct lun *curlun = dev_to_lun(dev); 3566 struct lun *curlun = dev_to_lun(dev);
3567 struct fsg_dev *fsg = (struct fsg_dev *) dev_get_drvdata(dev); 3567 struct fsg_dev *fsg = (struct fsg_dev *) dev_get_drvdata(dev);
@@ -3589,7 +3589,7 @@ static ssize_t show_file(struct device *dev, char *buf)
3589} 3589}
3590 3590
3591 3591
3592static ssize_t store_ro(struct device *dev, const char *buf, size_t count) 3592static ssize_t store_ro(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
3593{ 3593{
3594 ssize_t rc = count; 3594 ssize_t rc = count;
3595 struct lun *curlun = dev_to_lun(dev); 3595 struct lun *curlun = dev_to_lun(dev);
@@ -3613,7 +3613,7 @@ static ssize_t store_ro(struct device *dev, const char *buf, size_t count)
3613 return rc; 3613 return rc;
3614} 3614}
3615 3615
3616static ssize_t store_file(struct device *dev, const char *buf, size_t count) 3616static ssize_t store_file(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
3617{ 3617{
3618 struct lun *curlun = dev_to_lun(dev); 3618 struct lun *curlun = dev_to_lun(dev);
3619 struct fsg_dev *fsg = (struct fsg_dev *) dev_get_drvdata(dev); 3619 struct fsg_dev *fsg = (struct fsg_dev *) dev_get_drvdata(dev);
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index e5457f2026cc..e47e398daeb5 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -1469,7 +1469,7 @@ static const struct usb_gadget_ops net2280_ops = {
1469 1469
1470/* "function" sysfs attribute */ 1470/* "function" sysfs attribute */
1471static ssize_t 1471static ssize_t
1472show_function (struct device *_dev, char *buf) 1472show_function (struct device *_dev, struct device_attribute *attr, char *buf)
1473{ 1473{
1474 struct net2280 *dev = dev_get_drvdata (_dev); 1474 struct net2280 *dev = dev_get_drvdata (_dev);
1475 1475
@@ -1482,7 +1482,7 @@ show_function (struct device *_dev, char *buf)
1482static DEVICE_ATTR (function, S_IRUGO, show_function, NULL); 1482static DEVICE_ATTR (function, S_IRUGO, show_function, NULL);
1483 1483
1484static ssize_t 1484static ssize_t
1485show_registers (struct device *_dev, char *buf) 1485show_registers (struct device *_dev, struct device_attribute *attr, char *buf)
1486{ 1486{
1487 struct net2280 *dev; 1487 struct net2280 *dev;
1488 char *next; 1488 char *next;
@@ -1637,7 +1637,7 @@ show_registers (struct device *_dev, char *buf)
1637static DEVICE_ATTR (registers, S_IRUGO, show_registers, NULL); 1637static DEVICE_ATTR (registers, S_IRUGO, show_registers, NULL);
1638 1638
1639static ssize_t 1639static ssize_t
1640show_queues (struct device *_dev, char *buf) 1640show_queues (struct device *_dev, struct device_attribute *attr, char *buf)
1641{ 1641{
1642 struct net2280 *dev; 1642 struct net2280 *dev;
1643 char *next; 1643 char *next;
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index 6390c5726d81..b8b4524ed746 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa2xx_udc.c
@@ -1429,7 +1429,7 @@ done:
1429 1429
1430/* "function" sysfs attribute */ 1430/* "function" sysfs attribute */
1431static ssize_t 1431static ssize_t
1432show_function (struct device *_dev, char *buf) 1432show_function (struct device *_dev, struct device_attribute *attr, char *buf)
1433{ 1433{
1434 struct pxa2xx_udc *dev = dev_get_drvdata (_dev); 1434 struct pxa2xx_udc *dev = dev_get_drvdata (_dev);
1435 1435
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 3196c3265ff5..19e598c9641f 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -124,3 +124,14 @@ config USB_SL811_HCD
124 To compile this driver as a module, choose M here: the 124 To compile this driver as a module, choose M here: the
125 module will be called sl811-hcd. 125 module will be called sl811-hcd.
126 126
127config USB_SL811_CS
128 tristate "CF/PCMCIA support for SL811HS HCD"
129 depends on USB_SL811_HCD && PCMCIA
130 default N
131 help
132 Wraps a PCMCIA driver around the SL811HS HCD, supporting the RATOC
133 REX-CFU1U CF card (often used with PDAs). If unsure, say N.
134
135 To compile this driver as a module, choose M here: the
136 module will be called "sl811_cs".
137
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index a574ca06cf6b..5dbd3e7a27c7 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -7,4 +7,5 @@ obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o
7obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o 7obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
8obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o 8obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
9obj-$(CONFIG_USB_SL811_HCD) += sl811-hcd.o 9obj-$(CONFIG_USB_SL811_HCD) += sl811-hcd.o
10obj-$(CONFIG_USB_SL811_CS) += sl811_cs.o
10obj-$(CONFIG_ETRAX_ARCH_V10) += hc_crisv10.o 11obj-$(CONFIG_ETRAX_ARCH_V10) += hc_crisv10.o
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 9b347d765383..2ff11d53567b 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -450,7 +450,7 @@ show_async (struct class_device *class_dev, char *buf)
450 450
451 *buf = 0; 451 *buf = 0;
452 452
453 bus = to_usb_bus(class_dev); 453 bus = class_get_devdata(class_dev);
454 hcd = bus->hcpriv; 454 hcd = bus->hcpriv;
455 ehci = hcd_to_ehci (hcd); 455 ehci = hcd_to_ehci (hcd);
456 next = buf; 456 next = buf;
@@ -496,7 +496,7 @@ show_periodic (struct class_device *class_dev, char *buf)
496 return 0; 496 return 0;
497 seen_count = 0; 497 seen_count = 0;
498 498
499 bus = to_usb_bus(class_dev); 499 bus = class_get_devdata(class_dev);
500 hcd = bus->hcpriv; 500 hcd = bus->hcpriv;
501 ehci = hcd_to_ehci (hcd); 501 ehci = hcd_to_ehci (hcd);
502 next = buf; 502 next = buf;
@@ -633,7 +633,7 @@ show_registers (struct class_device *class_dev, char *buf)
633 static char fmt [] = "%*s\n"; 633 static char fmt [] = "%*s\n";
634 static char label [] = ""; 634 static char label [] = "";
635 635
636 bus = to_usb_bus(class_dev); 636 bus = class_get_devdata(class_dev);
637 hcd = bus->hcpriv; 637 hcd = bus->hcpriv;
638 ehci = hcd_to_ehci (hcd); 638 ehci = hcd_to_ehci (hcd);
639 next = buf; 639 next = buf;
@@ -735,7 +735,7 @@ static CLASS_DEVICE_ATTR (registers, S_IRUGO, show_registers, NULL);
735 735
736static inline void create_debug_files (struct ehci_hcd *ehci) 736static inline void create_debug_files (struct ehci_hcd *ehci)
737{ 737{
738 struct class_device *cldev = &ehci_to_hcd(ehci)->self.class_dev; 738 struct class_device *cldev = ehci_to_hcd(ehci)->self.class_dev;
739 739
740 class_device_create_file(cldev, &class_device_attr_async); 740 class_device_create_file(cldev, &class_device_attr_async);
741 class_device_create_file(cldev, &class_device_attr_periodic); 741 class_device_create_file(cldev, &class_device_attr_periodic);
@@ -744,7 +744,7 @@ static inline void create_debug_files (struct ehci_hcd *ehci)
744 744
745static inline void remove_debug_files (struct ehci_hcd *ehci) 745static inline void remove_debug_files (struct ehci_hcd *ehci)
746{ 746{
747 struct class_device *cldev = &ehci_to_hcd(ehci)->self.class_dev; 747 struct class_device *cldev = ehci_to_hcd(ehci)->self.class_dev;
748 748
749 class_device_remove_file(cldev, &class_device_attr_async); 749 class_device_remove_file(cldev, &class_device_attr_async);
750 class_device_remove_file(cldev, &class_device_attr_periodic); 750 class_device_remove_file(cldev, &class_device_attr_periodic);
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 429330bc38de..d7b4f7939ded 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -439,9 +439,12 @@ static int ehci_hub_control (
439 /* force reset to complete */ 439 /* force reset to complete */
440 writel (temp & ~PORT_RESET, 440 writel (temp & ~PORT_RESET,
441 &ehci->regs->port_status [wIndex]); 441 &ehci->regs->port_status [wIndex]);
442 /* REVISIT: some hardware needs 550+ usec to clear
443 * this bit; seems too long to spin routinely...
444 */
442 retval = handshake ( 445 retval = handshake (
443 &ehci->regs->port_status [wIndex], 446 &ehci->regs->port_status [wIndex],
444 PORT_RESET, 0, 500); 447 PORT_RESET, 0, 750);
445 if (retval != 0) { 448 if (retval != 0) {
446 ehci_err (ehci, "port %d reset error %d\n", 449 ehci_err (ehci, "port %d reset error %d\n",
447 wIndex + 1, retval); 450 wIndex + 1, retval);
diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c
index 62f53a213808..c58408c95c3d 100644
--- a/drivers/usb/host/ohci-dbg.c
+++ b/drivers/usb/host/ohci-dbg.c
@@ -481,7 +481,7 @@ show_async (struct class_device *class_dev, char *buf)
481 size_t temp; 481 size_t temp;
482 unsigned long flags; 482 unsigned long flags;
483 483
484 bus = to_usb_bus(class_dev); 484 bus = class_get_devdata(class_dev);
485 hcd = bus->hcpriv; 485 hcd = bus->hcpriv;
486 ohci = hcd_to_ohci(hcd); 486 ohci = hcd_to_ohci(hcd);
487 487
@@ -514,7 +514,7 @@ show_periodic (struct class_device *class_dev, char *buf)
514 return 0; 514 return 0;
515 seen_count = 0; 515 seen_count = 0;
516 516
517 bus = to_usb_bus(class_dev); 517 bus = class_get_devdata(class_dev);
518 hcd = bus->hcpriv; 518 hcd = bus->hcpriv;
519 ohci = hcd_to_ohci(hcd); 519 ohci = hcd_to_ohci(hcd);
520 next = buf; 520 next = buf;
@@ -611,7 +611,7 @@ show_registers (struct class_device *class_dev, char *buf)
611 char *next; 611 char *next;
612 u32 rdata; 612 u32 rdata;
613 613
614 bus = to_usb_bus(class_dev); 614 bus = class_get_devdata(class_dev);
615 hcd = bus->hcpriv; 615 hcd = bus->hcpriv;
616 ohci = hcd_to_ohci(hcd); 616 ohci = hcd_to_ohci(hcd);
617 regs = ohci->regs; 617 regs = ohci->regs;
@@ -684,7 +684,7 @@ static CLASS_DEVICE_ATTR (registers, S_IRUGO, show_registers, NULL);
684 684
685static inline void create_debug_files (struct ohci_hcd *ohci) 685static inline void create_debug_files (struct ohci_hcd *ohci)
686{ 686{
687 struct class_device *cldev = &ohci_to_hcd(ohci)->self.class_dev; 687 struct class_device *cldev = ohci_to_hcd(ohci)->self.class_dev;
688 688
689 class_device_create_file(cldev, &class_device_attr_async); 689 class_device_create_file(cldev, &class_device_attr_async);
690 class_device_create_file(cldev, &class_device_attr_periodic); 690 class_device_create_file(cldev, &class_device_attr_periodic);
@@ -694,7 +694,7 @@ static inline void create_debug_files (struct ohci_hcd *ohci)
694 694
695static inline void remove_debug_files (struct ohci_hcd *ohci) 695static inline void remove_debug_files (struct ohci_hcd *ohci)
696{ 696{
697 struct class_device *cldev = &ohci_to_hcd(ohci)->self.class_dev; 697 struct class_device *cldev = ohci_to_hcd(ohci)->self.class_dev;
698 698
699 class_device_remove_file(cldev, &class_device_attr_async); 699 class_device_remove_file(cldev, &class_device_attr_async);
700 class_device_remove_file(cldev, &class_device_attr_periodic); 700 class_device_remove_file(cldev, &class_device_attr_periodic);
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index a374b7692073..99d43f758ad0 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -2,8 +2,8 @@
2 * SL811HS HCD (Host Controller Driver) for USB. 2 * SL811HS HCD (Host Controller Driver) for USB.
3 * 3 *
4 * Copyright (C) 2004 Psion Teklogix (for NetBook PRO) 4 * Copyright (C) 2004 Psion Teklogix (for NetBook PRO)
5 * Copyright (C) 2004 David Brownell 5 * Copyright (C) 2004-2005 David Brownell
6 * 6 *
7 * Periodic scheduling is based on Roman's OHCI code 7 * Periodic scheduling is based on Roman's OHCI code
8 * Copyright (C) 1999 Roman Weissgaerber 8 * Copyright (C) 1999 Roman Weissgaerber
9 * 9 *
@@ -15,7 +15,7 @@
15 * For documentation, see the SL811HS spec and the "SL811HS Embedded Host" 15 * For documentation, see the SL811HS spec and the "SL811HS Embedded Host"
16 * document (providing significant pieces missing from that spec); plus 16 * document (providing significant pieces missing from that spec); plus
17 * the SL811S spec if you want peripheral side info. 17 * the SL811S spec if you want peripheral side info.
18 */ 18 */
19 19
20/* 20/*
21 * Status: Passed basic stress testing, works with hubs, mice, keyboards, 21 * Status: Passed basic stress testing, works with hubs, mice, keyboards,
@@ -67,7 +67,7 @@
67MODULE_DESCRIPTION("SL811HS USB Host Controller Driver"); 67MODULE_DESCRIPTION("SL811HS USB Host Controller Driver");
68MODULE_LICENSE("GPL"); 68MODULE_LICENSE("GPL");
69 69
70#define DRIVER_VERSION "15 Dec 2004" 70#define DRIVER_VERSION "19 May 2005"
71 71
72 72
73#ifndef DEBUG 73#ifndef DEBUG
@@ -121,6 +121,10 @@ static void port_power(struct sl811 *sl811, int is_on)
121 /* reset as thoroughly as we can */ 121 /* reset as thoroughly as we can */
122 if (sl811->board && sl811->board->reset) 122 if (sl811->board && sl811->board->reset)
123 sl811->board->reset(hcd->self.controller); 123 sl811->board->reset(hcd->self.controller);
124 else {
125 sl811_write(sl811, SL11H_CTLREG1, SL11H_CTL1MASK_SE0);
126 mdelay(20);
127 }
124 128
125 sl811_write(sl811, SL11H_IRQ_ENABLE, 0); 129 sl811_write(sl811, SL11H_IRQ_ENABLE, 0);
126 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); 130 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1);
@@ -443,6 +447,7 @@ static void finish_request(
443 spin_lock(&urb->lock); 447 spin_lock(&urb->lock);
444 if (urb->status == -EINPROGRESS) 448 if (urb->status == -EINPROGRESS)
445 urb->status = status; 449 urb->status = status;
450 urb->hcpriv = NULL;
446 spin_unlock(&urb->lock); 451 spin_unlock(&urb->lock);
447 452
448 spin_unlock(&sl811->lock); 453 spin_unlock(&sl811->lock);
@@ -472,7 +477,7 @@ static void finish_request(
472 if (*prev) 477 if (*prev)
473 *prev = ep->next; 478 *prev = ep->next;
474 sl811->load[i] -= ep->load; 479 sl811->load[i] -= ep->load;
475 } 480 }
476 ep->branch = PERIODIC_SIZE; 481 ep->branch = PERIODIC_SIZE;
477 sl811->periodic_count--; 482 sl811->periodic_count--;
478 sl811_to_hcd(sl811)->self.bandwidth_allocated 483 sl811_to_hcd(sl811)->self.bandwidth_allocated
@@ -661,9 +666,9 @@ retry:
661 666
662#ifdef QUIRK2 667#ifdef QUIRK2
663 /* this may no longer be necessary ... */ 668 /* this may no longer be necessary ... */
664 if (irqstat == 0 && ret == IRQ_NONE) { 669 if (irqstat == 0) {
665 irqstat = checkdone(sl811); 670 irqstat = checkdone(sl811);
666 if (irqstat /* && irq != ~0 */ ) 671 if (irqstat)
667 sl811->stat_lost++; 672 sl811->stat_lost++;
668 } 673 }
669#endif 674#endif
@@ -722,7 +727,8 @@ retry:
722 if (sl811->active_a) { 727 if (sl811->active_a) {
723 sl811_write(sl811, SL811_EP_A(SL11H_HOSTCTLREG), 0); 728 sl811_write(sl811, SL811_EP_A(SL11H_HOSTCTLREG), 0);
724 finish_request(sl811, sl811->active_a, 729 finish_request(sl811, sl811->active_a,
725 container_of(sl811->active_a->hep->urb_list.next, 730 container_of(sl811->active_a
731 ->hep->urb_list.next,
726 struct urb, urb_list), 732 struct urb, urb_list),
727 NULL, -ESHUTDOWN); 733 NULL, -ESHUTDOWN);
728 sl811->active_a = NULL; 734 sl811->active_a = NULL;
@@ -731,7 +737,8 @@ retry:
731 if (sl811->active_b) { 737 if (sl811->active_b) {
732 sl811_write(sl811, SL811_EP_B(SL11H_HOSTCTLREG), 0); 738 sl811_write(sl811, SL811_EP_B(SL11H_HOSTCTLREG), 0);
733 finish_request(sl811, sl811->active_b, 739 finish_request(sl811, sl811->active_b,
734 container_of(sl811->active_b->hep->urb_list.next, 740 container_of(sl811->active_b
741 ->hep->urb_list.next,
735 struct urb, urb_list), 742 struct urb, urb_list),
736 NULL, -ESHUTDOWN); 743 NULL, -ESHUTDOWN);
737 sl811->active_b = NULL; 744 sl811->active_b = NULL;
@@ -761,7 +768,7 @@ retry:
761 goto retry; 768 goto retry;
762 } 769 }
763 770
764 if (sl811->periodic_count == 0 && list_empty(&sl811->async)) 771 if (sl811->periodic_count == 0 && list_empty(&sl811->async))
765 sofirq_off(sl811); 772 sofirq_off(sl811);
766 sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable); 773 sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable);
767 774
@@ -796,7 +803,7 @@ static int balance(struct sl811 *sl811, u16 period, u16 load)
796 } 803 }
797 if (j < PERIODIC_SIZE) 804 if (j < PERIODIC_SIZE)
798 continue; 805 continue;
799 branch = i; 806 branch = i;
800 } 807 }
801 } 808 }
802 return branch; 809 return branch;
@@ -890,6 +897,7 @@ static int sl811h_urb_enqueue(
890 break; 897 break;
891 } 898 }
892 899
900 ep->hep = hep;
893 hep->hcpriv = ep; 901 hep->hcpriv = ep;
894 } 902 }
895 903
@@ -961,15 +969,16 @@ fail:
961static int sl811h_urb_dequeue(struct usb_hcd *hcd, struct urb *urb) 969static int sl811h_urb_dequeue(struct usb_hcd *hcd, struct urb *urb)
962{ 970{
963 struct sl811 *sl811 = hcd_to_sl811(hcd); 971 struct sl811 *sl811 = hcd_to_sl811(hcd);
964 struct usb_host_endpoint *hep = urb->hcpriv; 972 struct usb_host_endpoint *hep;
965 unsigned long flags; 973 unsigned long flags;
966 struct sl811h_ep *ep; 974 struct sl811h_ep *ep;
967 int retval = 0; 975 int retval = 0;
968 976
977 spin_lock_irqsave(&sl811->lock, flags);
978 hep = urb->hcpriv;
969 if (!hep) 979 if (!hep)
970 return -EINVAL; 980 goto fail;
971 981
972 spin_lock_irqsave(&sl811->lock, flags);
973 ep = hep->hcpriv; 982 ep = hep->hcpriv;
974 if (ep) { 983 if (ep) {
975 /* finish right away if this urb can't be active ... 984 /* finish right away if this urb can't be active ...
@@ -1017,6 +1026,7 @@ static int sl811h_urb_dequeue(struct usb_hcd *hcd, struct urb *urb)
1017 VDBG("dequeue, urb %p active %s; wait4irq\n", urb, 1026 VDBG("dequeue, urb %p active %s; wait4irq\n", urb,
1018 (sl811->active_a == ep) ? "A" : "B"); 1027 (sl811->active_a == ep) ? "A" : "B");
1019 } else 1028 } else
1029fail:
1020 retval = -EINVAL; 1030 retval = -EINVAL;
1021 spin_unlock_irqrestore(&sl811->lock, flags); 1031 spin_unlock_irqrestore(&sl811->lock, flags);
1022 return retval; 1032 return retval;
@@ -1576,6 +1586,9 @@ sl811h_start(struct usb_hcd *hcd)
1576 if (sl811->board && sl811->board->power) 1586 if (sl811->board && sl811->board->power)
1577 hub_set_power_budget(udev, sl811->board->power * 2); 1587 hub_set_power_budget(udev, sl811->board->power * 2);
1578 1588
1589 /* enable power and interupts */
1590 port_power(sl811, 1);
1591
1579 return 0; 1592 return 0;
1580} 1593}
1581 1594
@@ -1618,7 +1631,7 @@ static struct hc_driver sl811h_hc_driver = {
1618 1631
1619/*-------------------------------------------------------------------------*/ 1632/*-------------------------------------------------------------------------*/
1620 1633
1621static int __init_or_module 1634static int __devexit
1622sl811h_remove(struct device *dev) 1635sl811h_remove(struct device *dev)
1623{ 1636{
1624 struct usb_hcd *hcd = dev_get_drvdata(dev); 1637 struct usb_hcd *hcd = dev_get_drvdata(dev);
@@ -1631,21 +1644,20 @@ sl811h_remove(struct device *dev)
1631 remove_debug_file(sl811); 1644 remove_debug_file(sl811);
1632 usb_remove_hcd(hcd); 1645 usb_remove_hcd(hcd);
1633 1646
1634 iounmap(sl811->data_reg); 1647 /* some platforms may use IORESOURCE_IO */
1635 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 1648 res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
1636 release_mem_region(res->start, 1); 1649 if (res)
1650 iounmap(sl811->data_reg);
1637 1651
1638 iounmap(sl811->addr_reg);
1639 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1652 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1640 release_mem_region(res->start, 1); 1653 if (res)
1654 iounmap(sl811->addr_reg);
1641 1655
1642 usb_put_hcd(hcd); 1656 usb_put_hcd(hcd);
1643 return 0; 1657 return 0;
1644} 1658}
1645 1659
1646#define resource_len(r) (((r)->end - (r)->start) + 1) 1660static int __devinit
1647
1648static int __init
1649sl811h_probe(struct device *dev) 1661sl811h_probe(struct device *dev)
1650{ 1662{
1651 struct usb_hcd *hcd; 1663 struct usb_hcd *hcd;
@@ -1656,7 +1668,7 @@ sl811h_probe(struct device *dev)
1656 void __iomem *addr_reg; 1668 void __iomem *addr_reg;
1657 void __iomem *data_reg; 1669 void __iomem *data_reg;
1658 int retval; 1670 int retval;
1659 u8 tmp; 1671 u8 tmp, ioaddr = 0;
1660 1672
1661 /* basic sanity checks first. board-specific init logic should 1673 /* basic sanity checks first. board-specific init logic should
1662 * have initialized these three resources and probably board 1674 * have initialized these three resources and probably board
@@ -1664,13 +1676,8 @@ sl811h_probe(struct device *dev)
1664 * minimal sanity checking. 1676 * minimal sanity checking.
1665 */ 1677 */
1666 pdev = container_of(dev, struct platform_device, dev); 1678 pdev = container_of(dev, struct platform_device, dev);
1667 if (pdev->num_resources < 3)
1668 return -ENODEV;
1669
1670 addr = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1671 data = platform_get_resource(pdev, IORESOURCE_MEM, 1);
1672 irq = platform_get_irq(pdev, 0); 1679 irq = platform_get_irq(pdev, 0);
1673 if (!addr || !data || irq < 0) 1680 if (pdev->num_resources < 3 || irq < 0)
1674 return -ENODEV; 1681 return -ENODEV;
1675 1682
1676 /* refuse to confuse usbcore */ 1683 /* refuse to confuse usbcore */
@@ -1679,24 +1686,31 @@ sl811h_probe(struct device *dev)
1679 return -EINVAL; 1686 return -EINVAL;
1680 } 1687 }
1681 1688
1682 if (!request_mem_region(addr->start, 1, hcd_name)) { 1689 /* the chip may be wired for either kind of addressing */
1683 retval = -EBUSY; 1690 addr = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1684 goto err1; 1691 data = platform_get_resource(pdev, IORESOURCE_MEM, 1);
1685 } 1692 retval = -EBUSY;
1686 addr_reg = ioremap(addr->start, resource_len(addr)); 1693 if (!addr || !data) {
1687 if (addr_reg == NULL) { 1694 addr = platform_get_resource(pdev, IORESOURCE_IO, 0);
1688 retval = -ENOMEM; 1695 data = platform_get_resource(pdev, IORESOURCE_IO, 1);
1689 goto err2; 1696 if (!addr || !data)
1690 } 1697 return -ENODEV;
1698 ioaddr = 1;
1699
1700 addr_reg = (void __iomem *) addr->start;
1701 data_reg = (void __iomem *) data->start;
1702 } else {
1703 addr_reg = ioremap(addr->start, 1);
1704 if (addr_reg == NULL) {
1705 retval = -ENOMEM;
1706 goto err2;
1707 }
1691 1708
1692 if (!request_mem_region(data->start, 1, hcd_name)) { 1709 data_reg = ioremap(data->start, 1);
1693 retval = -EBUSY; 1710 if (data_reg == NULL) {
1694 goto err3; 1711 retval = -ENOMEM;
1695 } 1712 goto err4;
1696 data_reg = ioremap(data->start, resource_len(addr)); 1713 }
1697 if (data_reg == NULL) {
1698 retval = -ENOMEM;
1699 goto err4;
1700 } 1714 }
1701 1715
1702 /* allocate and initialize hcd */ 1716 /* allocate and initialize hcd */
@@ -1737,12 +1751,14 @@ sl811h_probe(struct device *dev)
1737 goto err6; 1751 goto err6;
1738 } 1752 }
1739 1753
1740 /* sl811s would need a different handler for this irq */ 1754 /* The chip's IRQ is level triggered, active high. A requirement
1741#ifdef CONFIG_ARM 1755 * for platform device setup is to cope with things like signal
1742 /* Cypress docs say the IRQ is IRQT_HIGH ... */ 1756 * inverters (e.g. CF is active low) or working only with edge
1743 set_irq_type(irq, IRQT_RISING); 1757 * triggers (e.g. most ARM CPUs). Initial driver stress testing
1744#endif 1758 * was on a system with single edge triggering, so most sorts of
1745 retval = usb_add_hcd(hcd, irq, SA_INTERRUPT); 1759 * triggering arrangement should work.
1760 */
1761 retval = usb_add_hcd(hcd, irq, SA_INTERRUPT | SA_SHIRQ);
1746 if (retval != 0) 1762 if (retval != 0)
1747 goto err6; 1763 goto err6;
1748 1764
@@ -1752,14 +1768,12 @@ sl811h_probe(struct device *dev)
1752 err6: 1768 err6:
1753 usb_put_hcd(hcd); 1769 usb_put_hcd(hcd);
1754 err5: 1770 err5:
1755 iounmap(data_reg); 1771 if (!ioaddr)
1772 iounmap(data_reg);
1756 err4: 1773 err4:
1757 release_mem_region(data->start, 1); 1774 if (!ioaddr)
1758 err3: 1775 iounmap(addr_reg);
1759 iounmap(addr_reg);
1760 err2: 1776 err2:
1761 release_mem_region(addr->start, 1);
1762 err1:
1763 DBG("init error, %d\n", retval); 1777 DBG("init error, %d\n", retval);
1764 return retval; 1778 return retval;
1765} 1779}
@@ -1767,7 +1781,7 @@ sl811h_probe(struct device *dev)
1767#ifdef CONFIG_PM 1781#ifdef CONFIG_PM
1768 1782
1769/* for this device there's no useful distinction between the controller 1783/* for this device there's no useful distinction between the controller
1770 * and its root hub, except that the root hub only gets direct PM calls 1784 * and its root hub, except that the root hub only gets direct PM calls
1771 * when CONFIG_USB_SUSPEND is enabled. 1785 * when CONFIG_USB_SUSPEND is enabled.
1772 */ 1786 */
1773 1787
@@ -1821,20 +1835,22 @@ sl811h_resume(struct device *dev, u32 phase)
1821#endif 1835#endif
1822 1836
1823 1837
1824static struct device_driver sl811h_driver = { 1838/* this driver is exported so sl811_cs can depend on it */
1839struct device_driver sl811h_driver = {
1825 .name = (char *) hcd_name, 1840 .name = (char *) hcd_name,
1826 .bus = &platform_bus_type, 1841 .bus = &platform_bus_type,
1827 1842
1828 .probe = sl811h_probe, 1843 .probe = sl811h_probe,
1829 .remove = sl811h_remove, 1844 .remove = __devexit_p(sl811h_remove),
1830 1845
1831 .suspend = sl811h_suspend, 1846 .suspend = sl811h_suspend,
1832 .resume = sl811h_resume, 1847 .resume = sl811h_resume,
1833}; 1848};
1849EXPORT_SYMBOL(sl811h_driver);
1834 1850
1835/*-------------------------------------------------------------------------*/ 1851/*-------------------------------------------------------------------------*/
1836 1852
1837static int __init sl811h_init(void) 1853static int __init sl811h_init(void)
1838{ 1854{
1839 if (usb_disabled()) 1855 if (usb_disabled())
1840 return -ENODEV; 1856 return -ENODEV;
@@ -1844,8 +1860,8 @@ static int __init sl811h_init(void)
1844} 1860}
1845module_init(sl811h_init); 1861module_init(sl811h_init);
1846 1862
1847static void __exit sl811h_cleanup(void) 1863static void __exit sl811h_cleanup(void)
1848{ 1864{
1849 driver_unregister(&sl811h_driver); 1865 driver_unregister(&sl811h_driver);
1850} 1866}
1851module_exit(sl811h_cleanup); 1867module_exit(sl811h_cleanup);
diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c
new file mode 100644
index 000000000000..6e173265095c
--- /dev/null
+++ b/drivers/usb/host/sl811_cs.c
@@ -0,0 +1,442 @@
1/*
2 * PCMCIA driver for SL811HS (as found in REX-CFU1U)
3 * Filename: sl811_cs.c
4 * Author: Yukio Yamamoto
5 *
6 * Port to sl811-hcd and 2.6.x by
7 * Botond Botyanszki <boti@rocketmail.com>
8 * Simon Pickering
9 *
10 * Last update: 2005-05-12
11 */
12
13#include <linux/kernel.h>
14#include <linux/module.h>
15#include <linux/init.h>
16#include <linux/sched.h>
17#include <linux/ptrace.h>
18#include <linux/slab.h>
19#include <linux/string.h>
20#include <linux/timer.h>
21#include <linux/ioport.h>
22
23#include <pcmcia/version.h>
24#include <pcmcia/cs_types.h>
25#include <pcmcia/cs.h>
26#include <pcmcia/cistpl.h>
27#include <pcmcia/cisreg.h>
28#include <pcmcia/ds.h>
29
30#include <linux/usb_sl811.h>
31
32MODULE_AUTHOR("Botond Botyanszki");
33MODULE_DESCRIPTION("REX-CFU1U PCMCIA driver for 2.6");
34MODULE_LICENSE("GPL");
35
36
37/*====================================================================*/
38/* MACROS */
39/*====================================================================*/
40
41#if defined(DEBUG) || defined(CONFIG_USB_DEBUG) || defined(PCMCIA_DEBUG)
42
43static int pc_debug = 0;
44module_param(pc_debug, int, 0644);
45
46#define DBG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG "sl811_cs: " args)
47
48#else
49#define DBG(n, args...) do{}while(0)
50#endif /* no debugging */
51
52#define INFO(args...) printk(KERN_INFO "sl811_cs: " args)
53
54#define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0444)
55
56#define CS_CHECK(fn, ret) \
57 do { \
58 last_fn = (fn); \
59 if ((last_ret = (ret)) != 0) \
60 goto cs_failed; \
61 } while (0)
62
63/*====================================================================*/
64/* VARIABLES */
65/*====================================================================*/
66
67static const char driver_name[DEV_NAME_LEN] = "sl811_cs";
68
69static dev_link_t *dev_list = NULL;
70
71static int irq_list[4] = { -1 };
72static int irq_list_count;
73
74module_param_array(irq_list, int, &irq_list_count, 0444);
75
76INT_MODULE_PARM(irq_mask, 0xdeb8);
77
78typedef struct local_info_t {
79 dev_link_t link;
80 dev_node_t node;
81} local_info_t;
82
83/*====================================================================*/
84
85static void release_platform_dev(struct device * dev)
86{
87 DBG(0, "sl811_cs platform_dev release\n");
88 dev->parent = NULL;
89}
90
91static struct sl811_platform_data platform_data = {
92 .potpg = 100,
93 .power = 50, /* == 100mA */
94 // .reset = ... FIXME: invoke CF reset on the card
95};
96
97static struct resource resources[] = {
98 [0] = {
99 .flags = IORESOURCE_IRQ,
100 },
101 [1] = {
102 // .name = "address",
103 .flags = IORESOURCE_IO,
104 },
105 [2] = {
106 // .name = "data",
107 .flags = IORESOURCE_IO,
108 },
109};
110
111extern struct device_driver sl811h_driver;
112
113static struct platform_device platform_dev = {
114 .id = -1,
115 .dev = {
116 .platform_data = &platform_data,
117 .release = release_platform_dev,
118 },
119 .resource = resources,
120 .num_resources = ARRAY_SIZE(resources),
121};
122
123static int sl811_hc_init(struct device *parent, ioaddr_t base_addr, int irq)
124{
125 if (platform_dev.dev.parent)
126 return -EBUSY;
127 platform_dev.dev.parent = parent;
128
129 /* finish seting up the platform device */
130 resources[0].start = irq;
131
132 resources[1].start = base_addr;
133 resources[1].end = base_addr;
134
135 resources[2].start = base_addr + 1;
136 resources[2].end = base_addr + 1;
137
138 /* The driver core will probe for us. We know sl811-hcd has been
139 * initialized already because of the link order dependency.
140 */
141 platform_dev.name = sl811h_driver.name;
142 return platform_device_register(&platform_dev);
143}
144
145/*====================================================================*/
146
147static void sl811_cs_detach(dev_link_t *link)
148{
149 dev_link_t **linkp;
150
151 DBG(0, "sl811_cs_detach(0x%p)\n", link);
152
153 /* Locate device structure */
154 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) {
155 if (*linkp == link)
156 break;
157 }
158 if (*linkp == NULL)
159 return;
160
161 /* Break the link with Card Services */
162 if (link->handle)
163 pcmcia_deregister_client(link->handle);
164
165 /* Unlink device structure, and free it */
166 *linkp = link->next;
167 /* This points to the parent local_info_t struct */
168 kfree(link->priv);
169}
170
171static void sl811_cs_release(dev_link_t * link)
172{
173
174 DBG(0, "sl811_cs_release(0x%p)\n", link);
175
176 if (link->open) {
177 DBG(1, "sl811_cs: release postponed, '%s' still open\n",
178 link->dev->dev_name);
179 link->state |= DEV_STALE_CONFIG;
180 return;
181 }
182
183 /* Unlink the device chain */
184 link->dev = NULL;
185
186 platform_device_unregister(&platform_dev);
187 pcmcia_release_configuration(link->handle);
188 if (link->io.NumPorts1)
189 pcmcia_release_io(link->handle, &link->io);
190 if (link->irq.AssignedIRQ)
191 pcmcia_release_irq(link->handle, &link->irq);
192 link->state &= ~DEV_CONFIG;
193
194 if (link->state & DEV_STALE_LINK)
195 sl811_cs_detach(link);
196}
197
198static void sl811_cs_config(dev_link_t *link)
199{
200 client_handle_t handle = link->handle;
201 struct device *parent = &handle_to_dev(handle);
202 local_info_t *dev = link->priv;
203 tuple_t tuple;
204 cisparse_t parse;
205 int last_fn, last_ret;
206 u_char buf[64];
207 config_info_t conf;
208 cistpl_cftable_entry_t dflt = { 0 };
209
210 DBG(0, "sl811_cs_config(0x%p)\n", link);
211
212 tuple.DesiredTuple = CISTPL_CONFIG;
213 tuple.Attributes = 0;
214 tuple.TupleData = buf;
215 tuple.TupleDataMax = sizeof(buf);
216 tuple.TupleOffset = 0;
217 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
218 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
219 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
220 link->conf.ConfigBase = parse.config.base;
221 link->conf.Present = parse.config.rmask[0];
222
223 /* Configure card */
224 link->state |= DEV_CONFIG;
225
226 /* Look up the current Vcc */
227 CS_CHECK(GetConfigurationInfo,
228 pcmcia_get_configuration_info(handle, &conf));
229 link->conf.Vcc = conf.Vcc;
230
231 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
232 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
233 while (1) {
234 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
235
236 if (pcmcia_get_tuple_data(handle, &tuple) != 0
237 || pcmcia_parse_tuple(handle, &tuple, &parse)
238 != 0)
239 goto next_entry;
240
241 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) {
242 dflt = *cfg;
243 }
244
245 if (cfg->index == 0)
246 goto next_entry;
247
248 link->conf.ConfigIndex = cfg->index;
249
250 /* Use power settings for Vcc and Vpp if present */
251 /* Note that the CIS values need to be rescaled */
252 if (cfg->vcc.present & (1<<CISTPL_POWER_VNOM)) {
253 if (cfg->vcc.param[CISTPL_POWER_VNOM]/10000
254 != conf.Vcc)
255 goto next_entry;
256 } else if (dflt.vcc.present & (1<<CISTPL_POWER_VNOM)) {
257 if (dflt.vcc.param[CISTPL_POWER_VNOM]/10000
258 != conf.Vcc)
259 goto next_entry;
260 }
261
262 if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM))
263 link->conf.Vpp1 = link->conf.Vpp2 =
264 cfg->vpp1.param[CISTPL_POWER_VNOM]/10000;
265 else if (dflt.vpp1.present & (1<<CISTPL_POWER_VNOM))
266 link->conf.Vpp1 = link->conf.Vpp2 =
267 dflt.vpp1.param[CISTPL_POWER_VNOM]/10000;
268
269 /* we need an interrupt */
270 if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
271 link->conf.Attributes |= CONF_ENABLE_IRQ;
272
273 /* IO window settings */
274 link->io.NumPorts1 = link->io.NumPorts2 = 0;
275 if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
276 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
277
278 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
279 link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
280 link->io.BasePort1 = io->win[0].base;
281 link->io.NumPorts1 = io->win[0].len;
282
283 if (pcmcia_request_io(link->handle, &link->io) != 0)
284 goto next_entry;
285 }
286 break;
287
288next_entry:
289 if (link->io.NumPorts1)
290 pcmcia_release_io(link->handle, &link->io);
291 last_ret = pcmcia_get_next_tuple(handle, &tuple);
292 }
293
294 /* require an IRQ and two registers */
295 if (!link->io.NumPorts1 || link->io.NumPorts1 < 2)
296 goto cs_failed;
297 if (link->conf.Attributes & CONF_ENABLE_IRQ)
298 CS_CHECK(RequestIRQ,
299 pcmcia_request_irq(link->handle, &link->irq));
300 else
301 goto cs_failed;
302
303 CS_CHECK(RequestConfiguration,
304 pcmcia_request_configuration(link->handle, &link->conf));
305
306 sprintf(dev->node.dev_name, driver_name);
307 dev->node.major = dev->node.minor = 0;
308 link->dev = &dev->node;
309
310 printk(KERN_INFO "%s: index 0x%02x: Vcc %d.%d",
311 dev->node.dev_name, link->conf.ConfigIndex,
312 link->conf.Vcc/10, link->conf.Vcc%10);
313 if (link->conf.Vpp1)
314 printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10);
315 printk(", irq %d", link->irq.AssignedIRQ);
316 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
317 link->io.BasePort1+link->io.NumPorts1-1);
318 printk("\n");
319
320 link->state &= ~DEV_CONFIG_PENDING;
321
322 if (sl811_hc_init(parent, link->io.BasePort1, link->irq.AssignedIRQ)
323 < 0) {
324cs_failed:
325 printk("sl811_cs_config failed\n");
326 cs_error(link->handle, last_fn, last_ret);
327 sl811_cs_release(link);
328 link->state &= ~DEV_CONFIG_PENDING;
329 }
330}
331
332static int
333sl811_cs_event(event_t event, int priority, event_callback_args_t *args)
334{
335 dev_link_t *link = args->client_data;
336
337 DBG(1, "sl811_cs_event(0x%06x)\n", event);
338
339 switch (event) {
340 case CS_EVENT_CARD_REMOVAL:
341 link->state &= ~DEV_PRESENT;
342 if (link->state & DEV_CONFIG)
343 sl811_cs_release(link);
344 break;
345
346 case CS_EVENT_CARD_INSERTION:
347 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
348 sl811_cs_config(link);
349 break;
350
351 case CS_EVENT_PM_SUSPEND:
352 link->state |= DEV_SUSPEND;
353 /* Fall through... */
354 case CS_EVENT_RESET_PHYSICAL:
355 if (link->state & DEV_CONFIG)
356 pcmcia_release_configuration(link->handle);
357 break;
358
359 case CS_EVENT_PM_RESUME:
360 link->state &= ~DEV_SUSPEND;
361 /* Fall through... */
362 case CS_EVENT_CARD_RESET:
363 if (link->state & DEV_CONFIG)
364 pcmcia_request_configuration(link->handle, &link->conf);
365 DBG(0, "reset sl811-hcd here?\n");
366 break;
367 }
368 return 0;
369}
370
371static dev_link_t *sl811_cs_attach(void)
372{
373 local_info_t *local;
374 dev_link_t *link;
375 client_reg_t client_reg;
376 int ret, i;
377
378 local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
379 if (!local)
380 return NULL;
381 memset(local, 0, sizeof(local_info_t));
382 link = &local->link;
383 link->priv = local;
384
385 /* Initialize */
386 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
387 link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
388 if (irq_list[0] == -1)
389 link->irq.IRQInfo2 = irq_mask;
390 else
391 for (i = 0; i < irq_list_count; i++)
392 link->irq.IRQInfo2 |= 1 << irq_list[i];
393 link->irq.Handler = NULL;
394
395 link->conf.Attributes = 0;
396 link->conf.Vcc = 33;
397 link->conf.IntType = INT_MEMORY_AND_IO;
398
399 /* Register with Card Services */
400 link->next = dev_list;
401 dev_list = link;
402 client_reg.dev_info = (dev_info_t *) &driver_name;
403 client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
404 client_reg.EventMask =
405 CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
406 CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
407 CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
408 client_reg.event_handler = &sl811_cs_event;
409 client_reg.Version = 0x0210;
410 client_reg.event_callback_args.client_data = link;
411 ret = pcmcia_register_client(&link->handle, &client_reg);
412 if (ret != CS_SUCCESS) {
413 cs_error(link->handle, RegisterClient, ret);
414 sl811_cs_detach(link);
415 return NULL;
416 }
417
418 return link;
419}
420
421static struct pcmcia_driver sl811_cs_driver = {
422 .owner = THIS_MODULE,
423 .drv = {
424 .name = (char *)driver_name,
425 },
426 .attach = sl811_cs_attach,
427 .detach = sl811_cs_detach,
428};
429
430/*====================================================================*/
431
432static int __init init_sl811_cs(void)
433{
434 return pcmcia_register_driver(&sl811_cs_driver);
435}
436module_init(init_sl811_cs);
437
438static void __exit exit_sl811_cs(void)
439{
440 pcmcia_unregister_driver(&sl811_cs_driver);
441}
442module_exit(exit_sl811_cs);
diff --git a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c
index 94ce2a9ad50f..e991f7ed7330 100644
--- a/drivers/usb/input/aiptek.c
+++ b/drivers/usb/input/aiptek.c
@@ -1025,7 +1025,7 @@ static int aiptek_program_tablet(struct aiptek *aiptek)
1025/*********************************************************************** 1025/***********************************************************************
1026 * support the 'size' file -- display support 1026 * support the 'size' file -- display support
1027 */ 1027 */
1028static ssize_t show_tabletSize(struct device *dev, char *buf) 1028static ssize_t show_tabletSize(struct device *dev, struct device_attribute *attr, char *buf)
1029{ 1029{
1030 struct aiptek *aiptek = dev_get_drvdata(dev); 1030 struct aiptek *aiptek = dev_get_drvdata(dev);
1031 1031
@@ -1048,7 +1048,7 @@ static DEVICE_ATTR(size, S_IRUGO, show_tabletSize, NULL);
1048/*********************************************************************** 1048/***********************************************************************
1049 * support routines for the 'product_id' file 1049 * support routines for the 'product_id' file
1050 */ 1050 */
1051static ssize_t show_tabletProductId(struct device *dev, char *buf) 1051static ssize_t show_tabletProductId(struct device *dev, struct device_attribute *attr, char *buf)
1052{ 1052{
1053 struct aiptek *aiptek = dev_get_drvdata(dev); 1053 struct aiptek *aiptek = dev_get_drvdata(dev);
1054 1054
@@ -1064,7 +1064,7 @@ static DEVICE_ATTR(product_id, S_IRUGO, show_tabletProductId, NULL);
1064/*********************************************************************** 1064/***********************************************************************
1065 * support routines for the 'vendor_id' file 1065 * support routines for the 'vendor_id' file
1066 */ 1066 */
1067static ssize_t show_tabletVendorId(struct device *dev, char *buf) 1067static ssize_t show_tabletVendorId(struct device *dev, struct device_attribute *attr, char *buf)
1068{ 1068{
1069 struct aiptek *aiptek = dev_get_drvdata(dev); 1069 struct aiptek *aiptek = dev_get_drvdata(dev);
1070 1070
@@ -1079,7 +1079,7 @@ static DEVICE_ATTR(vendor_id, S_IRUGO, show_tabletVendorId, NULL);
1079/*********************************************************************** 1079/***********************************************************************
1080 * support routines for the 'vendor' file 1080 * support routines for the 'vendor' file
1081 */ 1081 */
1082static ssize_t show_tabletManufacturer(struct device *dev, char *buf) 1082static ssize_t show_tabletManufacturer(struct device *dev, struct device_attribute *attr, char *buf)
1083{ 1083{
1084 struct aiptek *aiptek = dev_get_drvdata(dev); 1084 struct aiptek *aiptek = dev_get_drvdata(dev);
1085 int retval; 1085 int retval;
@@ -1096,7 +1096,7 @@ static DEVICE_ATTR(vendor, S_IRUGO, show_tabletManufacturer, NULL);
1096/*********************************************************************** 1096/***********************************************************************
1097 * support routines for the 'product' file 1097 * support routines for the 'product' file
1098 */ 1098 */
1099static ssize_t show_tabletProduct(struct device *dev, char *buf) 1099static ssize_t show_tabletProduct(struct device *dev, struct device_attribute *attr, char *buf)
1100{ 1100{
1101 struct aiptek *aiptek = dev_get_drvdata(dev); 1101 struct aiptek *aiptek = dev_get_drvdata(dev);
1102 int retval; 1102 int retval;
@@ -1114,7 +1114,7 @@ static DEVICE_ATTR(product, S_IRUGO, show_tabletProduct, NULL);
1114 * support routines for the 'pointer_mode' file. Note that this file 1114 * support routines for the 'pointer_mode' file. Note that this file
1115 * both displays current setting and allows reprogramming. 1115 * both displays current setting and allows reprogramming.
1116 */ 1116 */
1117static ssize_t show_tabletPointerMode(struct device *dev, char *buf) 1117static ssize_t show_tabletPointerMode(struct device *dev, struct device_attribute *attr, char *buf)
1118{ 1118{
1119 struct aiptek *aiptek = dev_get_drvdata(dev); 1119 struct aiptek *aiptek = dev_get_drvdata(dev);
1120 char *s; 1120 char *s;
@@ -1143,7 +1143,7 @@ static ssize_t show_tabletPointerMode(struct device *dev, char *buf)
1143} 1143}
1144 1144
1145static ssize_t 1145static ssize_t
1146store_tabletPointerMode(struct device *dev, const char *buf, size_t count) 1146store_tabletPointerMode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1147{ 1147{
1148 struct aiptek *aiptek = dev_get_drvdata(dev); 1148 struct aiptek *aiptek = dev_get_drvdata(dev);
1149 if (aiptek == NULL) 1149 if (aiptek == NULL)
@@ -1168,7 +1168,7 @@ static DEVICE_ATTR(pointer_mode,
1168 * support routines for the 'coordinate_mode' file. Note that this file 1168 * support routines for the 'coordinate_mode' file. Note that this file
1169 * both displays current setting and allows reprogramming. 1169 * both displays current setting and allows reprogramming.
1170 */ 1170 */
1171static ssize_t show_tabletCoordinateMode(struct device *dev, char *buf) 1171static ssize_t show_tabletCoordinateMode(struct device *dev, struct device_attribute *attr, char *buf)
1172{ 1172{
1173 struct aiptek *aiptek = dev_get_drvdata(dev); 1173 struct aiptek *aiptek = dev_get_drvdata(dev);
1174 char *s; 1174 char *s;
@@ -1193,7 +1193,7 @@ static ssize_t show_tabletCoordinateMode(struct device *dev, char *buf)
1193} 1193}
1194 1194
1195static ssize_t 1195static ssize_t
1196store_tabletCoordinateMode(struct device *dev, const char *buf, size_t count) 1196store_tabletCoordinateMode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1197{ 1197{
1198 struct aiptek *aiptek = dev_get_drvdata(dev); 1198 struct aiptek *aiptek = dev_get_drvdata(dev);
1199 if (aiptek == NULL) 1199 if (aiptek == NULL)
@@ -1217,7 +1217,7 @@ static DEVICE_ATTR(coordinate_mode,
1217 * support routines for the 'tool_mode' file. Note that this file 1217 * support routines for the 'tool_mode' file. Note that this file
1218 * both displays current setting and allows reprogramming. 1218 * both displays current setting and allows reprogramming.
1219 */ 1219 */
1220static ssize_t show_tabletToolMode(struct device *dev, char *buf) 1220static ssize_t show_tabletToolMode(struct device *dev, struct device_attribute *attr, char *buf)
1221{ 1221{
1222 struct aiptek *aiptek = dev_get_drvdata(dev); 1222 struct aiptek *aiptek = dev_get_drvdata(dev);
1223 char *s; 1223 char *s;
@@ -1262,7 +1262,7 @@ static ssize_t show_tabletToolMode(struct device *dev, char *buf)
1262} 1262}
1263 1263
1264static ssize_t 1264static ssize_t
1265store_tabletToolMode(struct device *dev, const char *buf, size_t count) 1265store_tabletToolMode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1266{ 1266{
1267 struct aiptek *aiptek = dev_get_drvdata(dev); 1267 struct aiptek *aiptek = dev_get_drvdata(dev);
1268 if (aiptek == NULL) 1268 if (aiptek == NULL)
@@ -1295,7 +1295,7 @@ static DEVICE_ATTR(tool_mode,
1295 * support routines for the 'xtilt' file. Note that this file 1295 * support routines for the 'xtilt' file. Note that this file
1296 * both displays current setting and allows reprogramming. 1296 * both displays current setting and allows reprogramming.
1297 */ 1297 */
1298static ssize_t show_tabletXtilt(struct device *dev, char *buf) 1298static ssize_t show_tabletXtilt(struct device *dev, struct device_attribute *attr, char *buf)
1299{ 1299{
1300 struct aiptek *aiptek = dev_get_drvdata(dev); 1300 struct aiptek *aiptek = dev_get_drvdata(dev);
1301 1301
@@ -1311,7 +1311,7 @@ static ssize_t show_tabletXtilt(struct device *dev, char *buf)
1311} 1311}
1312 1312
1313static ssize_t 1313static ssize_t
1314store_tabletXtilt(struct device *dev, const char *buf, size_t count) 1314store_tabletXtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1315{ 1315{
1316 struct aiptek *aiptek = dev_get_drvdata(dev); 1316 struct aiptek *aiptek = dev_get_drvdata(dev);
1317 int x; 1317 int x;
@@ -1337,7 +1337,7 @@ static DEVICE_ATTR(xtilt,
1337 * support routines for the 'ytilt' file. Note that this file 1337 * support routines for the 'ytilt' file. Note that this file
1338 * both displays current setting and allows reprogramming. 1338 * both displays current setting and allows reprogramming.
1339 */ 1339 */
1340static ssize_t show_tabletYtilt(struct device *dev, char *buf) 1340static ssize_t show_tabletYtilt(struct device *dev, struct device_attribute *attr, char *buf)
1341{ 1341{
1342 struct aiptek *aiptek = dev_get_drvdata(dev); 1342 struct aiptek *aiptek = dev_get_drvdata(dev);
1343 1343
@@ -1353,7 +1353,7 @@ static ssize_t show_tabletYtilt(struct device *dev, char *buf)
1353} 1353}
1354 1354
1355static ssize_t 1355static ssize_t
1356store_tabletYtilt(struct device *dev, const char *buf, size_t count) 1356store_tabletYtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1357{ 1357{
1358 struct aiptek *aiptek = dev_get_drvdata(dev); 1358 struct aiptek *aiptek = dev_get_drvdata(dev);
1359 int y; 1359 int y;
@@ -1379,7 +1379,7 @@ static DEVICE_ATTR(ytilt,
1379 * support routines for the 'jitter' file. Note that this file 1379 * support routines for the 'jitter' file. Note that this file
1380 * both displays current setting and allows reprogramming. 1380 * both displays current setting and allows reprogramming.
1381 */ 1381 */
1382static ssize_t show_tabletJitterDelay(struct device *dev, char *buf) 1382static ssize_t show_tabletJitterDelay(struct device *dev, struct device_attribute *attr, char *buf)
1383{ 1383{
1384 struct aiptek *aiptek = dev_get_drvdata(dev); 1384 struct aiptek *aiptek = dev_get_drvdata(dev);
1385 1385
@@ -1390,7 +1390,7 @@ static ssize_t show_tabletJitterDelay(struct device *dev, char *buf)
1390} 1390}
1391 1391
1392static ssize_t 1392static ssize_t
1393store_tabletJitterDelay(struct device *dev, const char *buf, size_t count) 1393store_tabletJitterDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1394{ 1394{
1395 struct aiptek *aiptek = dev_get_drvdata(dev); 1395 struct aiptek *aiptek = dev_get_drvdata(dev);
1396 1396
@@ -1409,7 +1409,7 @@ static DEVICE_ATTR(jitter,
1409 * support routines for the 'delay' file. Note that this file 1409 * support routines for the 'delay' file. Note that this file
1410 * both displays current setting and allows reprogramming. 1410 * both displays current setting and allows reprogramming.
1411 */ 1411 */
1412static ssize_t show_tabletProgrammableDelay(struct device *dev, char *buf) 1412static ssize_t show_tabletProgrammableDelay(struct device *dev, struct device_attribute *attr, char *buf)
1413{ 1413{
1414 struct aiptek *aiptek = dev_get_drvdata(dev); 1414 struct aiptek *aiptek = dev_get_drvdata(dev);
1415 1415
@@ -1421,7 +1421,7 @@ static ssize_t show_tabletProgrammableDelay(struct device *dev, char *buf)
1421} 1421}
1422 1422
1423static ssize_t 1423static ssize_t
1424store_tabletProgrammableDelay(struct device *dev, const char *buf, size_t count) 1424store_tabletProgrammableDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1425{ 1425{
1426 struct aiptek *aiptek = dev_get_drvdata(dev); 1426 struct aiptek *aiptek = dev_get_drvdata(dev);
1427 1427
@@ -1440,7 +1440,7 @@ static DEVICE_ATTR(delay,
1440 * support routines for the 'input_path' file. Note that this file 1440 * support routines for the 'input_path' file. Note that this file
1441 * only displays current setting. 1441 * only displays current setting.
1442 */ 1442 */
1443static ssize_t show_tabletInputDevice(struct device *dev, char *buf) 1443static ssize_t show_tabletInputDevice(struct device *dev, struct device_attribute *attr, char *buf)
1444{ 1444{
1445 struct aiptek *aiptek = dev_get_drvdata(dev); 1445 struct aiptek *aiptek = dev_get_drvdata(dev);
1446 1446
@@ -1457,7 +1457,7 @@ static DEVICE_ATTR(input_path, S_IRUGO, show_tabletInputDevice, NULL);
1457 * support routines for the 'event_count' file. Note that this file 1457 * support routines for the 'event_count' file. Note that this file
1458 * only displays current setting. 1458 * only displays current setting.
1459 */ 1459 */
1460static ssize_t show_tabletEventsReceived(struct device *dev, char *buf) 1460static ssize_t show_tabletEventsReceived(struct device *dev, struct device_attribute *attr, char *buf)
1461{ 1461{
1462 struct aiptek *aiptek = dev_get_drvdata(dev); 1462 struct aiptek *aiptek = dev_get_drvdata(dev);
1463 1463
@@ -1473,7 +1473,7 @@ static DEVICE_ATTR(event_count, S_IRUGO, show_tabletEventsReceived, NULL);
1473 * support routines for the 'diagnostic' file. Note that this file 1473 * support routines for the 'diagnostic' file. Note that this file
1474 * only displays current setting. 1474 * only displays current setting.
1475 */ 1475 */
1476static ssize_t show_tabletDiagnosticMessage(struct device *dev, char *buf) 1476static ssize_t show_tabletDiagnosticMessage(struct device *dev, struct device_attribute *attr, char *buf)
1477{ 1477{
1478 struct aiptek *aiptek = dev_get_drvdata(dev); 1478 struct aiptek *aiptek = dev_get_drvdata(dev);
1479 char *retMsg; 1479 char *retMsg;
@@ -1515,7 +1515,7 @@ static DEVICE_ATTR(diagnostic, S_IRUGO, show_tabletDiagnosticMessage, NULL);
1515 * support routines for the 'stylus_upper' file. Note that this file 1515 * support routines for the 'stylus_upper' file. Note that this file
1516 * both displays current setting and allows for setting changing. 1516 * both displays current setting and allows for setting changing.
1517 */ 1517 */
1518static ssize_t show_tabletStylusUpper(struct device *dev, char *buf) 1518static ssize_t show_tabletStylusUpper(struct device *dev, struct device_attribute *attr, char *buf)
1519{ 1519{
1520 struct aiptek *aiptek = dev_get_drvdata(dev); 1520 struct aiptek *aiptek = dev_get_drvdata(dev);
1521 char *s; 1521 char *s;
@@ -1540,7 +1540,7 @@ static ssize_t show_tabletStylusUpper(struct device *dev, char *buf)
1540} 1540}
1541 1541
1542static ssize_t 1542static ssize_t
1543store_tabletStylusUpper(struct device *dev, const char *buf, size_t count) 1543store_tabletStylusUpper(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1544{ 1544{
1545 struct aiptek *aiptek = dev_get_drvdata(dev); 1545 struct aiptek *aiptek = dev_get_drvdata(dev);
1546 1546
@@ -1565,7 +1565,7 @@ static DEVICE_ATTR(stylus_upper,
1565 * support routines for the 'stylus_lower' file. Note that this file 1565 * support routines for the 'stylus_lower' file. Note that this file
1566 * both displays current setting and allows for setting changing. 1566 * both displays current setting and allows for setting changing.
1567 */ 1567 */
1568static ssize_t show_tabletStylusLower(struct device *dev, char *buf) 1568static ssize_t show_tabletStylusLower(struct device *dev, struct device_attribute *attr, char *buf)
1569{ 1569{
1570 struct aiptek *aiptek = dev_get_drvdata(dev); 1570 struct aiptek *aiptek = dev_get_drvdata(dev);
1571 char *s; 1571 char *s;
@@ -1590,7 +1590,7 @@ static ssize_t show_tabletStylusLower(struct device *dev, char *buf)
1590} 1590}
1591 1591
1592static ssize_t 1592static ssize_t
1593store_tabletStylusLower(struct device *dev, const char *buf, size_t count) 1593store_tabletStylusLower(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1594{ 1594{
1595 struct aiptek *aiptek = dev_get_drvdata(dev); 1595 struct aiptek *aiptek = dev_get_drvdata(dev);
1596 1596
@@ -1615,7 +1615,7 @@ static DEVICE_ATTR(stylus_lower,
1615 * support routines for the 'mouse_left' file. Note that this file 1615 * support routines for the 'mouse_left' file. Note that this file
1616 * both displays current setting and allows for setting changing. 1616 * both displays current setting and allows for setting changing.
1617 */ 1617 */
1618static ssize_t show_tabletMouseLeft(struct device *dev, char *buf) 1618static ssize_t show_tabletMouseLeft(struct device *dev, struct device_attribute *attr, char *buf)
1619{ 1619{
1620 struct aiptek *aiptek = dev_get_drvdata(dev); 1620 struct aiptek *aiptek = dev_get_drvdata(dev);
1621 char *s; 1621 char *s;
@@ -1644,7 +1644,7 @@ static ssize_t show_tabletMouseLeft(struct device *dev, char *buf)
1644} 1644}
1645 1645
1646static ssize_t 1646static ssize_t
1647store_tabletMouseLeft(struct device *dev, const char *buf, size_t count) 1647store_tabletMouseLeft(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1648{ 1648{
1649 struct aiptek *aiptek = dev_get_drvdata(dev); 1649 struct aiptek *aiptek = dev_get_drvdata(dev);
1650 1650
@@ -1669,7 +1669,7 @@ static DEVICE_ATTR(mouse_left,
1669 * support routines for the 'mouse_middle' file. Note that this file 1669 * support routines for the 'mouse_middle' file. Note that this file
1670 * both displays current setting and allows for setting changing. 1670 * both displays current setting and allows for setting changing.
1671 */ 1671 */
1672static ssize_t show_tabletMouseMiddle(struct device *dev, char *buf) 1672static ssize_t show_tabletMouseMiddle(struct device *dev, struct device_attribute *attr, char *buf)
1673{ 1673{
1674 struct aiptek *aiptek = dev_get_drvdata(dev); 1674 struct aiptek *aiptek = dev_get_drvdata(dev);
1675 char *s; 1675 char *s;
@@ -1698,7 +1698,7 @@ static ssize_t show_tabletMouseMiddle(struct device *dev, char *buf)
1698} 1698}
1699 1699
1700static ssize_t 1700static ssize_t
1701store_tabletMouseMiddle(struct device *dev, const char *buf, size_t count) 1701store_tabletMouseMiddle(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1702{ 1702{
1703 struct aiptek *aiptek = dev_get_drvdata(dev); 1703 struct aiptek *aiptek = dev_get_drvdata(dev);
1704 1704
@@ -1725,7 +1725,7 @@ static DEVICE_ATTR(mouse_middle,
1725 * support routines for the 'mouse_right' file. Note that this file 1725 * support routines for the 'mouse_right' file. Note that this file
1726 * both displays current setting and allows for setting changing. 1726 * both displays current setting and allows for setting changing.
1727 */ 1727 */
1728static ssize_t show_tabletMouseRight(struct device *dev, char *buf) 1728static ssize_t show_tabletMouseRight(struct device *dev, struct device_attribute *attr, char *buf)
1729{ 1729{
1730 struct aiptek *aiptek = dev_get_drvdata(dev); 1730 struct aiptek *aiptek = dev_get_drvdata(dev);
1731 char *s; 1731 char *s;
@@ -1754,7 +1754,7 @@ static ssize_t show_tabletMouseRight(struct device *dev, char *buf)
1754} 1754}
1755 1755
1756static ssize_t 1756static ssize_t
1757store_tabletMouseRight(struct device *dev, const char *buf, size_t count) 1757store_tabletMouseRight(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1758{ 1758{
1759 struct aiptek *aiptek = dev_get_drvdata(dev); 1759 struct aiptek *aiptek = dev_get_drvdata(dev);
1760 1760
@@ -1780,7 +1780,7 @@ static DEVICE_ATTR(mouse_right,
1780 * support routines for the 'wheel' file. Note that this file 1780 * support routines for the 'wheel' file. Note that this file
1781 * both displays current setting and allows for setting changing. 1781 * both displays current setting and allows for setting changing.
1782 */ 1782 */
1783static ssize_t show_tabletWheel(struct device *dev, char *buf) 1783static ssize_t show_tabletWheel(struct device *dev, struct device_attribute *attr, char *buf)
1784{ 1784{
1785 struct aiptek *aiptek = dev_get_drvdata(dev); 1785 struct aiptek *aiptek = dev_get_drvdata(dev);
1786 1786
@@ -1796,7 +1796,7 @@ static ssize_t show_tabletWheel(struct device *dev, char *buf)
1796} 1796}
1797 1797
1798static ssize_t 1798static ssize_t
1799store_tabletWheel(struct device *dev, const char *buf, size_t count) 1799store_tabletWheel(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1800{ 1800{
1801 struct aiptek *aiptek = dev_get_drvdata(dev); 1801 struct aiptek *aiptek = dev_get_drvdata(dev);
1802 1802
@@ -1814,7 +1814,7 @@ static DEVICE_ATTR(wheel,
1814 * support routines for the 'execute' file. Note that this file 1814 * support routines for the 'execute' file. Note that this file
1815 * both displays current setting and allows for setting changing. 1815 * both displays current setting and allows for setting changing.
1816 */ 1816 */
1817static ssize_t show_tabletExecute(struct device *dev, char *buf) 1817static ssize_t show_tabletExecute(struct device *dev, struct device_attribute *attr, char *buf)
1818{ 1818{
1819 struct aiptek *aiptek = dev_get_drvdata(dev); 1819 struct aiptek *aiptek = dev_get_drvdata(dev);
1820 1820
@@ -1829,7 +1829,7 @@ static ssize_t show_tabletExecute(struct device *dev, char *buf)
1829} 1829}
1830 1830
1831static ssize_t 1831static ssize_t
1832store_tabletExecute(struct device *dev, const char *buf, size_t count) 1832store_tabletExecute(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1833{ 1833{
1834 struct aiptek *aiptek = dev_get_drvdata(dev); 1834 struct aiptek *aiptek = dev_get_drvdata(dev);
1835 1835
@@ -1855,7 +1855,7 @@ static DEVICE_ATTR(execute,
1855 * support routines for the 'odm_code' file. Note that this file 1855 * support routines for the 'odm_code' file. Note that this file
1856 * only displays current setting. 1856 * only displays current setting.
1857 */ 1857 */
1858static ssize_t show_tabletODMCode(struct device *dev, char *buf) 1858static ssize_t show_tabletODMCode(struct device *dev, struct device_attribute *attr, char *buf)
1859{ 1859{
1860 struct aiptek *aiptek = dev_get_drvdata(dev); 1860 struct aiptek *aiptek = dev_get_drvdata(dev);
1861 1861
@@ -1871,7 +1871,7 @@ static DEVICE_ATTR(odm_code, S_IRUGO, show_tabletODMCode, NULL);
1871 * support routines for the 'model_code' file. Note that this file 1871 * support routines for the 'model_code' file. Note that this file
1872 * only displays current setting. 1872 * only displays current setting.
1873 */ 1873 */
1874static ssize_t show_tabletModelCode(struct device *dev, char *buf) 1874static ssize_t show_tabletModelCode(struct device *dev, struct device_attribute *attr, char *buf)
1875{ 1875{
1876 struct aiptek *aiptek = dev_get_drvdata(dev); 1876 struct aiptek *aiptek = dev_get_drvdata(dev);
1877 1877
@@ -1887,7 +1887,7 @@ static DEVICE_ATTR(model_code, S_IRUGO, show_tabletModelCode, NULL);
1887 * support routines for the 'firmware_code' file. Note that this file 1887 * support routines for the 'firmware_code' file. Note that this file
1888 * only displays current setting. 1888 * only displays current setting.
1889 */ 1889 */
1890static ssize_t show_firmwareCode(struct device *dev, char *buf) 1890static ssize_t show_firmwareCode(struct device *dev, struct device_attribute *attr, char *buf)
1891{ 1891{
1892 struct aiptek *aiptek = dev_get_drvdata(dev); 1892 struct aiptek *aiptek = dev_get_drvdata(dev);
1893 1893
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 869ff73690ac..2d8bd9dcc6ed 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -1315,6 +1315,8 @@ void hid_init_reports(struct hid_device *hid)
1315#define USB_DEVICE_ID_WACOM_INTUOS2 0x0040 1315#define USB_DEVICE_ID_WACOM_INTUOS2 0x0040
1316#define USB_DEVICE_ID_WACOM_VOLITO 0x0060 1316#define USB_DEVICE_ID_WACOM_VOLITO 0x0060
1317#define USB_DEVICE_ID_WACOM_PTU 0x0003 1317#define USB_DEVICE_ID_WACOM_PTU 0x0003
1318#define USB_DEVICE_ID_WACOM_INTUOS3 0x00B0
1319#define USB_DEVICE_ID_WACOM_CINTIQ 0x003F
1318 1320
1319#define USB_VENDOR_ID_KBGEAR 0x084e 1321#define USB_VENDOR_ID_KBGEAR 0x084e
1320#define USB_DEVICE_ID_KBGEAR_JAMSTUDIO 0x1001 1322#define USB_DEVICE_ID_KBGEAR_JAMSTUDIO 0x1001
@@ -1401,6 +1403,7 @@ void hid_init_reports(struct hid_device *hid)
1401 1403
1402#define USB_VENDOR_ID_DELORME 0x1163 1404#define USB_VENDOR_ID_DELORME 0x1163
1403#define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100 1405#define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100
1406#define USB_DEVICE_ID_DELORME_EM_LT20 0x0200
1404 1407
1405#define USB_VENDOR_ID_MCC 0x09db 1408#define USB_VENDOR_ID_MCC 0x09db
1406#define USB_DEVICE_ID_MCC_PMD1024LS 0x0076 1409#define USB_DEVICE_ID_MCC_PMD1024LS 0x0076
@@ -1412,6 +1415,12 @@ void hid_init_reports(struct hid_device *hid)
1412#define USB_VENDOR_ID_BTC 0x046e 1415#define USB_VENDOR_ID_BTC 0x046e
1413#define USB_DEVICE_ID_BTC_KEYBOARD 0x5303 1416#define USB_DEVICE_ID_BTC_KEYBOARD 0x5303
1414 1417
1418#define USB_VENDOR_ID_VERNIER 0x08f7
1419#define USB_DEVICE_ID_VERNIER_LABPRO 0x0001
1420#define USB_DEVICE_ID_VERNIER_GOTEMP 0x0002
1421#define USB_DEVICE_ID_VERNIER_SKIP 0x0003
1422#define USB_DEVICE_ID_VERNIER_CYCLOPS 0x0004
1423
1415 1424
1416/* 1425/*
1417 * Alphabetically sorted blacklist by quirk type. 1426 * Alphabetically sorted blacklist by quirk type.
@@ -1437,6 +1446,7 @@ static struct hid_blacklist {
1437 { USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW28, HID_QUIRK_IGNORE }, 1446 { USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW28, HID_QUIRK_IGNORE },
1438 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_HIDCOM, HID_QUIRK_IGNORE }, 1447 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_HIDCOM, HID_QUIRK_IGNORE },
1439 { USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE, HID_QUIRK_IGNORE }, 1448 { USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE, HID_QUIRK_IGNORE },
1449 { USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20, HID_QUIRK_IGNORE },
1440 { USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5, HID_QUIRK_IGNORE }, 1450 { USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5, HID_QUIRK_IGNORE },
1441 { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_4_PHIDGETSERVO_30, HID_QUIRK_IGNORE }, 1451 { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_4_PHIDGETSERVO_30, HID_QUIRK_IGNORE },
1442 { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_1_PHIDGETSERVO_30, HID_QUIRK_IGNORE }, 1452 { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_1_PHIDGETSERVO_30, HID_QUIRK_IGNORE },
@@ -1456,6 +1466,10 @@ static struct hid_blacklist {
1456 { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 300, HID_QUIRK_IGNORE }, 1466 { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 300, HID_QUIRK_IGNORE },
1457 { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 400, HID_QUIRK_IGNORE }, 1467 { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 400, HID_QUIRK_IGNORE },
1458 { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 500, HID_QUIRK_IGNORE }, 1468 { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 500, HID_QUIRK_IGNORE },
1469 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO, HID_QUIRK_IGNORE },
1470 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP, HID_QUIRK_IGNORE },
1471 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP, HID_QUIRK_IGNORE },
1472 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_CYCLOPS, HID_QUIRK_IGNORE },
1459 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PENPARTNER, HID_QUIRK_IGNORE }, 1473 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PENPARTNER, HID_QUIRK_IGNORE },
1460 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE, HID_QUIRK_IGNORE }, 1474 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE, HID_QUIRK_IGNORE },
1461 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 1, HID_QUIRK_IGNORE }, 1475 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 1, HID_QUIRK_IGNORE },
@@ -1481,6 +1495,10 @@ static struct hid_blacklist {
1481 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 7, HID_QUIRK_IGNORE }, 1495 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 7, HID_QUIRK_IGNORE },
1482 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO, HID_QUIRK_IGNORE }, 1496 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO, HID_QUIRK_IGNORE },
1483 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PTU, HID_QUIRK_IGNORE }, 1497 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PTU, HID_QUIRK_IGNORE },
1498 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3, HID_QUIRK_IGNORE },
1499 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 1, HID_QUIRK_IGNORE },
1500 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 2, HID_QUIRK_IGNORE },
1501 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_CINTIQ, HID_QUIRK_IGNORE },
1484 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, 1502 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
1485 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, 1503 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
1486 1504
diff --git a/drivers/usb/media/pwc/ChangeLog b/drivers/usb/media/pwc/ChangeLog
deleted file mode 100644
index b2eb71a9afb5..000000000000
--- a/drivers/usb/media/pwc/ChangeLog
+++ /dev/null
@@ -1,143 +0,0 @@
19.0.2
2
3* Adding #ifdef to compile PWC before and after 2.6.5
4
59.0.1
6
79.0
8
9
108.12
11
12* Implement motorized pan/tilt feature for Logitech QuickCam Orbit/Spere.
13
148.11.1
15
16* Fix for PCVC720/40, would not be able to set videomode
17* Fix for Samsung MPC models, appearantly they are based on a newer chipset
18
198.11
20
21* 20 dev_hints (per request)
22* Hot unplugging should be better, no more dangling pointers or memory leaks
23* Added reserved Logitech webcam IDs
24* Device now remembers size & fps between close()/open()
25* Removed palette stuff altogether
26
278.10.1
28
29* Added IDs for PCVC720K/40 and Creative Labs Webcam Pro
30
318.10
32
33* Fixed ID for QuickCam Notebook pro
34* Added GREALSIZE ioctl() call
35* Fixed bug in case PWCX was not loaded and invalid size was set
36
378.9
38
39* Merging with kernel 2.5.49
40* Adding IDs for QuickCam Zoom & QuickCam Notebook
41
428.8
43
44* Fixing 'leds' parameter
45* Adding IDs for Logitech QuickCam Pro 4000
46* Making URB init/cleanup a little nicer
47
488.7
49
50* Incorporating changes in ioctl() parameter passing
51* Also changes to URB mechanism
52
538.6
54
55* Added ID's for Visionite VCS UM100 and UC300
56* Removed YUV420-interlaced palette altogether (was confusing)
57* Removed MIRROR stuff as it didn't work anyway
58* Fixed a problem with the 'leds' parameter (wouldn't blink)
59* Added ioctl()s for advanced features: 'extended' whitebalance ioctl()s,
60 CONTOUR, BACKLIGHT, FLICKER, DYNNOISE.
61* VIDIOCGCAP.name now contains real camera model name instead of
62 'Philips xxx webcam'
63* Added PROBE ioctl (see previous point & API doc)
64
658.5
66
67* Adding IDs for Creative Labs Webcam 5
68* Adding IDs for SOTEC CMS-001 webcam
69* Solving possible hang in VIDIOCSYNC when unplugging the cam
70* Forgot to return structure in VIDIOCPWCGAWB, oops
71* Time interval for the LEDs are now in milliseconds
72
738.4
74
75* Fixing power_save option for Vesta range
76* Handling new error codes in ISOC callback
77* Adding dev_hint module parameter, to specify /dev/videoX device nodes
78
798.3
80
81* Adding Samsung C10 and C30 cameras
82* Removing palette module parameter
83* Fixed typo in ID of QuickCam 3000 Pro
84* Adding LED settings (blinking while in use) for ToUCam cameras.
85* Turns LED off when camera is not in use.
86
878.2
88
89* Making module more silent when trace = 0
90* Adding QuickCam 3000 Pro IDs
91* Chrominance control for the Vesta cameras
92* Hopefully fixed problems on machines with BIGMEM and > 1GB of RAM
93* Included Oliver Neukem's lock_kernel() patch
94* Allocates less memory for image buffers
95* Adds ioctl()s for the whitebalancing
96
978.1
98
99* Adding support for 750
100* Adding V4L GAUDIO/SAUDIO/UNIT ioctl() calls
101
1028.0
103* 'damage control' after inclusion in 2.4.5.
104* Changed wait-queue mechanism in read/mmap/poll according to the book.
105* Included YUV420P palette.
106* Changed interface to decompressor module.
107* Cleaned up pwc structure a bit.
108
1097.0
110
111* Fixed bug in vcvt_420i_yuyv; extra variables on stack were misaligned.
112* There is now a clear error message when an image size is selected that
113 is only supported using the decompressor, and the decompressor isn't
114 loaded.
115* When the decompressor wasn't loaded, selecting large image size
116 would create skewed or double images.
117
1186.3
119
120* Introduced spinlocks for the buffer pointer manipulation; a number of
121 reports seem to suggest the down()/up() semaphores were the cause of
122 lockups, since they are not suitable for interrupt/user locking.
123* Separated decompressor and core code into 2 modules.
124
1256.2
126
127* Non-integral image sizes are now padded with gray or black.
128* Added SHUTTERSPEED ioctl().
129* Fixed buglet in VIDIOCPWCSAGC; the function would always return an error,
130 even though the call succeeded.
131* Added hotplug support for 2.4.*.
132* Memory: the 645/646 uses less memory now.
133
1346.1
135
136* VIDIOCSPICT returns -EINVAL with invalid palettes.
137* Added saturation control.
138* Split decompressors from rest.
139* Fixed bug that would reset the framerate to the default framerate if
140 the rate field was set to 0 (which is not what I intended, nl. do not
141 change the framerate!).
142* VIDIOCPWCSCQUAL (setting compression quality) now takes effect immediately.
143* Workaround for a bug in the 730 sensor.
diff --git a/drivers/usb/media/pwc/Makefile b/drivers/usb/media/pwc/Makefile
index e0b41ed4407f..2d93a775011a 100644
--- a/drivers/usb/media/pwc/Makefile
+++ b/drivers/usb/media/pwc/Makefile
@@ -1,6 +1,6 @@
1ifneq ($(KERNELRELEASE),) 1ifneq ($(KERNELRELEASE),)
2 2
3pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o pwc-dec1.o pwc-dec23.o pwc-kiara.o pwc-timon.o 3pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o pwc-timon.o pwc-kiara.o
4 4
5obj-$(CONFIG_USB_PWC) += pwc.o 5obj-$(CONFIG_USB_PWC) += pwc.o
6 6
diff --git a/drivers/usb/media/pwc/pwc-ctrl.c b/drivers/usb/media/pwc/pwc-ctrl.c
index 42ec468d52d6..53099190952c 100644
--- a/drivers/usb/media/pwc/pwc-ctrl.c
+++ b/drivers/usb/media/pwc/pwc-ctrl.c
@@ -48,8 +48,6 @@
48#include "pwc-uncompress.h" 48#include "pwc-uncompress.h"
49#include "pwc-kiara.h" 49#include "pwc-kiara.h"
50#include "pwc-timon.h" 50#include "pwc-timon.h"
51#include "pwc-dec1.h"
52#include "pwc-dec23.h"
53 51
54/* Request types: video */ 52/* Request types: video */
55#define SET_LUM_CTL 0x01 53#define SET_LUM_CTL 0x01
@@ -246,7 +244,7 @@ static inline int set_video_mode_Nala(struct pwc_device *pdev, int size, int fra
246 switch(pdev->type) { 244 switch(pdev->type) {
247 case 645: 245 case 645:
248 case 646: 246 case 646:
249 pwc_dec1_init(pdev->type, pdev->release, buf, pdev->decompress_data); 247/* pwc_dec1_init(pdev->type, pdev->release, buf, pdev->decompress_data); */
250 break; 248 break;
251 249
252 case 675: 250 case 675:
@@ -256,7 +254,7 @@ static inline int set_video_mode_Nala(struct pwc_device *pdev, int size, int fra
256 case 730: 254 case 730:
257 case 740: 255 case 740:
258 case 750: 256 case 750:
259 pwc_dec23_init(pdev->type, pdev->release, buf, pdev->decompress_data); 257/* pwc_dec23_init(pdev->type, pdev->release, buf, pdev->decompress_data); */
260 break; 258 break;
261 } 259 }
262 } 260 }
@@ -318,8 +316,8 @@ static inline int set_video_mode_Timon(struct pwc_device *pdev, int size, int fr
318 if (ret < 0) 316 if (ret < 0)
319 return ret; 317 return ret;
320 318
321 if (pChoose->bandlength > 0 && pdev->vpalette != VIDEO_PALETTE_RAW) 319/* if (pChoose->bandlength > 0 && pdev->vpalette != VIDEO_PALETTE_RAW)
322 pwc_dec23_init(pdev->type, pdev->release, buf, pdev->decompress_data); 320 pwc_dec23_init(pdev->type, pdev->release, buf, pdev->decompress_data); */
323 321
324 pdev->cmd_len = 13; 322 pdev->cmd_len = 13;
325 memcpy(pdev->cmd_buf, buf, 13); 323 memcpy(pdev->cmd_buf, buf, 13);
@@ -397,8 +395,8 @@ static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int fr
397 if (ret < 0) 395 if (ret < 0)
398 return ret; 396 return ret;
399 397
400 if (pChoose->bandlength > 0 && pdev->vpalette != VIDEO_PALETTE_RAW) 398/* if (pChoose->bandlength > 0 && pdev->vpalette != VIDEO_PALETTE_RAW)
401 pwc_dec23_init(pdev->type, pdev->release, buf, pdev->decompress_data); 399 pwc_dec23_init(pdev->type, pdev->release, buf, pdev->decompress_data); */
402 400
403 pdev->cmd_len = 12; 401 pdev->cmd_len = 12;
404 memcpy(pdev->cmd_buf, buf, 12); 402 memcpy(pdev->cmd_buf, buf, 12);
diff --git a/drivers/usb/media/pwc/pwc-dec1.c b/drivers/usb/media/pwc/pwc-dec1.c
deleted file mode 100644
index 57d03d9178f6..000000000000
--- a/drivers/usb/media/pwc/pwc-dec1.c
+++ /dev/null
@@ -1,42 +0,0 @@
1/* Linux driver for Philips webcam
2 Decompression for chipset version 1
3 (C) 2004 Luc Saillard (luc@saillard.org)
4
5 NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
6 driver and thus may have bugs that are not present in the original version.
7 Please send bug reports and support requests to <luc@saillard.org>.
8 The decompression routines have been implemented by reverse-engineering the
9 Nemosoft binary pwcx module. Caveat emptor.
10
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24*/
25
26
27
28#include "pwc-dec1.h"
29
30
31void pwc_dec1_init(int type, int release, void *buffer, void *table)
32{
33
34}
35
36void pwc_dec1_exit(void)
37{
38
39
40
41}
42
diff --git a/drivers/usb/media/pwc/pwc-dec1.h b/drivers/usb/media/pwc/pwc-dec1.h
deleted file mode 100644
index a7ffd9c45a2c..000000000000
--- a/drivers/usb/media/pwc/pwc-dec1.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/* Linux driver for Philips webcam
2 (C) 2004 Luc Saillard (luc@saillard.org)
3
4 NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
5 driver and thus may have bugs that are not present in the original version.
6 Please send bug reports and support requests to <luc@saillard.org>.
7 The decompression routines have been implemented by reverse-engineering the
8 Nemosoft binary pwcx module. Caveat emptor.
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23*/
24
25
26
27#ifndef PWC_DEC1_H
28#define PWC_DEC1_H
29
30void pwc_dec1_init(int type, int release, void *buffer, void *private_data);
31void pwc_dec1_exit(void);
32
33#endif
34
35
36
diff --git a/drivers/usb/media/pwc/pwc-dec23.c b/drivers/usb/media/pwc/pwc-dec23.c
deleted file mode 100644
index 98fa3f7a9eff..000000000000
--- a/drivers/usb/media/pwc/pwc-dec23.c
+++ /dev/null
@@ -1,623 +0,0 @@
1/* Linux driver for Philips webcam
2 Decompression for chipset version 2 et 3
3 (C) 2004 Luc Saillard (luc@saillard.org)
4
5 NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
6 driver and thus may have bugs that are not present in the original version.
7 Please send bug reports and support requests to <luc@saillard.org>.
8 The decompression routines have been implemented by reverse-engineering the
9 Nemosoft binary pwcx module. Caveat emptor.
10
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24*/
25
26#include "pwc-timon.h"
27#include "pwc-kiara.h"
28#include "pwc-dec23.h"
29#include "pwc-ioctl.h"
30
31#include <linux/string.h>
32
33/****
34 *
35 *
36 *
37 */
38
39
40static void fill_table_a000(unsigned int *p)
41{
42 static unsigned int initial_values[12] = {
43 0xFFAD9B00, 0xFFDDEE00, 0x00221200, 0x00526500,
44 0xFFC21E00, 0x003DE200, 0xFF924B80, 0xFFD2A300,
45 0x002D5D00, 0x006DB480, 0xFFED3E00, 0x0012C200
46 };
47 static unsigned int values_derivated[12] = {
48 0x0000A4CA, 0x00004424, 0xFFFFBBDC, 0xFFFF5B36,
49 0x00007BC4, 0xFFFF843C, 0x0000DB69, 0x00005ABA,
50 0xFFFFA546, 0xFFFF2497, 0x00002584, 0xFFFFDA7C
51 };
52 unsigned int temp_values[12];
53 int i,j;
54
55 memcpy(temp_values,initial_values,sizeof(initial_values));
56 for (i=0;i<256;i++)
57 {
58 for (j=0;j<12;j++)
59 {
60 *p++ = temp_values[j];
61 temp_values[j] += values_derivated[j];
62 }
63 }
64}
65
66static void fill_table_d000(unsigned char *p)
67{
68 int bit,byte;
69
70 for (bit=0; bit<8; bit++)
71 {
72 unsigned char bitpower = 1<<bit;
73 unsigned char mask = bitpower-1;
74 for (byte=0; byte<256; byte++)
75 {
76 if (byte & bitpower)
77 *p++ = -(byte & mask);
78 else
79 *p++ = (byte & mask);
80 }
81 }
82}
83
84/*
85 *
86 * Kiara: 0 <= ver <= 7
87 * Timon: 0 <= ver <= 15
88 *
89 */
90static void fill_table_color(unsigned int version, const unsigned int *romtable,
91 unsigned char *p0004,
92 unsigned char *p8004)
93{
94 const unsigned int *table;
95 unsigned char *p0, *p8;
96 int i,j,k;
97 int dl,bit,pw;
98
99 romtable += version*256;
100
101 for (i=0; i<2; i++)
102 {
103 table = romtable + i*128;
104
105 for (dl=0; dl<16; dl++)
106 {
107 p0 = p0004 + (i<<14) + (dl<<10);
108 p8 = p8004 + (i<<12) + (dl<<8);
109
110 for (j=0; j<8; j++ , table++, p0+=128)
111 {
112 for (k=0; k<16; k++)
113 {
114 if (k==0)
115 bit=1;
116 else if (k>=1 && k<3)
117 bit=(table[0]>>15)&7;
118 else if (k>=3 && k<6)
119 bit=(table[0]>>12)&7;
120 else if (k>=6 && k<10)
121 bit=(table[0]>>9)&7;
122 else if (k>=10 && k<13)
123 bit=(table[0]>>6)&7;
124 else if (k>=13 && k<15)
125 bit=(table[0]>>3)&7;
126 else
127 bit=(table[0])&7;
128 if (k == 0)
129 *(unsigned char *)p8++ = 8;
130 else
131 *(unsigned char *)p8++ = j - bit;
132 *(unsigned char *)p8++ = bit;
133
134 pw = 1<<bit;
135 p0[k+0x00] = (1*pw) + 0x80;
136 p0[k+0x10] = (2*pw) + 0x80;
137 p0[k+0x20] = (3*pw) + 0x80;
138 p0[k+0x30] = (4*pw) + 0x80;
139 p0[k+0x40] = (-pw) + 0x80;
140 p0[k+0x50] = (2*-pw) + 0x80;
141 p0[k+0x60] = (3*-pw) + 0x80;
142 p0[k+0x70] = (4*-pw) + 0x80;
143 } /* end of for (k=0; k<16; k++, p8++) */
144 } /* end of for (j=0; j<8; j++ , table++) */
145 } /* end of for (dl=0; dl<16; dl++) */
146 } /* end of for (i=0; i<2; i++) */
147}
148
149/*
150 * precision = (pdev->xx + pdev->yy)
151 *
152 */
153static void fill_table_dc00_d800(unsigned int precision, unsigned int *pdc00, unsigned int *pd800)
154{
155 int i;
156 unsigned int offset1, offset2;
157
158 for(i=0,offset1=0x4000, offset2=0; i<256 ; i++,offset1+=0x7BC4, offset2+=0x7BC4)
159 {
160 unsigned int msb = offset1 >> 15;
161
162 if ( msb > 255)
163 {
164 if (msb)
165 msb=0;
166 else
167 msb=255;
168 }
169
170 *pdc00++ = msb << precision;
171 *pd800++ = offset2;
172 }
173
174}
175
176/*
177 * struct {
178 * unsigned char op; // operation to execute
179 * unsigned char bits; // bits use to perform operation
180 * unsigned char offset1; // offset to add to access in the table_0004 % 16
181 * unsigned char offset2; // offset to add to access in the table_0004
182 * }
183 *
184 */
185static unsigned int table_ops[] = {
1860x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x00, 0x00,0x04,0x01,0x10, 0x00,0x06,0x01,0x30,
1870x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x40, 0x00,0x05,0x01,0x20, 0x01,0x00,0x00,0x00,
1880x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x00, 0x00,0x04,0x01,0x50, 0x00,0x05,0x02,0x00,
1890x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x40, 0x00,0x05,0x03,0x00, 0x01,0x00,0x00,0x00,
1900x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x00, 0x00,0x04,0x01,0x10, 0x00,0x06,0x02,0x10,
1910x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x40, 0x00,0x05,0x01,0x60, 0x01,0x00,0x00,0x00,
1920x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x00, 0x00,0x04,0x01,0x50, 0x00,0x05,0x02,0x40,
1930x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x40, 0x00,0x05,0x03,0x40, 0x01,0x00,0x00,0x00,
1940x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x00, 0x00,0x04,0x01,0x10, 0x00,0x06,0x01,0x70,
1950x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x40, 0x00,0x05,0x01,0x20, 0x01,0x00,0x00,0x00,
1960x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x00, 0x00,0x04,0x01,0x50, 0x00,0x05,0x02,0x00,
1970x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x40, 0x00,0x05,0x03,0x00, 0x01,0x00,0x00,0x00,
1980x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x00, 0x00,0x04,0x01,0x10, 0x00,0x06,0x02,0x50,
1990x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x40, 0x00,0x05,0x01,0x60, 0x01,0x00,0x00,0x00,
2000x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x00, 0x00,0x04,0x01,0x50, 0x00,0x05,0x02,0x40,
2010x02,0x00,0x00,0x00, 0x00,0x03,0x01,0x40, 0x00,0x05,0x03,0x40, 0x01,0x00,0x00,0x00
202};
203
204/*
205 * TODO: multiply by 4 all values
206 *
207 */
208static unsigned int MulIdx[256] = {
209 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
210 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3,
211 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
212 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4,
213 6, 7, 8, 9, 7,10,11, 8, 8,11,10, 7, 9, 8, 7, 6,
214 4, 5, 5, 4, 4, 5, 5, 4, 4, 5, 5, 4, 4, 5, 5, 4,
215 1, 3, 0, 2, 1, 3, 0, 2, 1, 3, 0, 2, 1, 3, 0, 2,
216 0, 3, 3, 0, 1, 2, 2, 1, 2, 1, 1, 2, 3, 0, 0, 3,
217 0, 1, 2, 3, 3, 2, 1, 0, 3, 2, 1, 0, 0, 1, 2, 3,
218 1, 1, 1, 1, 3, 3, 3, 3, 0, 0, 0, 0, 2, 2, 2, 2,
219 7,10,11, 8, 9, 8, 7, 6, 6, 7, 8, 9, 8,11,10, 7,
220 4, 5, 5, 4, 5, 4, 4, 5, 5, 4, 4, 5, 4, 5, 5, 4,
221 7, 9, 6, 8,10, 8, 7,11,11, 7, 8,10, 8, 6, 9, 7,
222 1, 3, 0, 2, 2, 0, 3, 1, 2, 0, 3, 1, 1, 3, 0, 2,
223 1, 2, 2, 1, 3, 0, 0, 3, 0, 3, 3, 0, 2, 1, 1, 2,
22410, 8, 7,11, 8, 6, 9, 7, 7, 9, 6, 8,11, 7, 8,10
225};
226
227
228
229void pwc_dec23_init(int type, int release, unsigned char *mode, void *data)
230{
231 int flags;
232 struct pwc_dec23_private *pdev = data;
233 release = release;
234
235 switch (type)
236 {
237 case 720:
238 case 730:
239 case 740:
240 case 750:
241 flags = mode[2]&0x18; /* our: flags = 8, mode[2]==e8 */
242 if (flags==8)
243 pdev->zz = 7;
244 else if (flags==0x10)
245 pdev->zz = 8;
246 else
247 pdev->zz = 6;
248 flags = mode[2]>>5; /* our: 7 */
249
250 fill_table_color(flags, (unsigned int *)KiaraRomTable, pdev->table_0004, pdev->table_8004);
251 break;
252
253
254 case 675:
255 case 680:
256 case 690:
257 flags = mode[2]&6;
258 if (flags==2)
259 pdev->zz = 7;
260 else if (flags==4)
261 pdev->zz = 8;
262 else
263 pdev->zz = 6;
264 flags = mode[2]>>3;
265
266 fill_table_color(flags, (unsigned int *)TimonRomTable, pdev->table_0004, pdev->table_8004);
267 break;
268
269 default:
270 /* Not supported */
271 return;
272 }
273
274 /* * * * ** */
275 pdev->xx = 8 - pdev->zz;
276 pdev->yy = 15 - pdev->xx;
277 pdev->zzmask = 0xFF>>pdev->xx;
278 //pdev->zzmask = (1U<<pdev->zz)-1;
279
280
281 fill_table_dc00_d800(pdev->xx + pdev->yy, pdev->table_dc00, pdev->table_d800);
282 fill_table_a000(pdev->table_a004);
283 fill_table_d000(pdev->table_d004);
284}
285
286
287/*
288 * To manage the stream, we keep in a 32 bits variables,
289 * the next bits in the stream. fill_reservoir() add to
290 * the reservoir at least wanted nbits.
291 *
292 *
293 */
294#define fill_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted) do { \
295 while (nbits_in_reservoir<nbits_wanted) \
296 { \
297 reservoir |= (*(stream)++) << nbits_in_reservoir; \
298 nbits_in_reservoir+=8; \
299 } \
300} while(0);
301
302#define get_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted,result) do { \
303 fill_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted); \
304 result = (reservoir) & ((1U<<nbits_wanted)-1); \
305 reservoir >>= nbits_wanted; \
306 nbits_in_reservoir -= nbits_wanted; \
307} while(0);
308
309
310
311static void DecompressBand23(const struct pwc_dec23_private *pdev,
312 const unsigned char *rawyuv,
313 unsigned char *planar_y,
314 unsigned char *planar_u,
315 unsigned char *planar_v,
316 unsigned int image_x, /* aka number of pixels wanted ??? */
317 unsigned int pixels_per_line, /* aka number of pixels per line */
318 int flags)
319{
320
321
322 unsigned int reservoir, nbits_in_reservoir;
323 int first_4_bits;
324 unsigned int bytes_per_channel;
325 int line_size; /* size of the line (4Y+U+V) */
326 int passes;
327 const unsigned char *ptable0004, *ptable8004;
328
329 int even_line;
330 unsigned int temp_colors[16];
331 int nblocks;
332
333 const unsigned char *stream;
334 unsigned char *dest_y, *dest_u=NULL, *dest_v=NULL;
335 unsigned int offset_to_plane_u, offset_to_plane_v;
336
337 int i;
338
339
340 reservoir = 0;
341 nbits_in_reservoir = 0;
342 stream = rawyuv+1; /* The first byte of the stream is skipped */
343 even_line = 1;
344
345 get_nbits(reservoir,nbits_in_reservoir,stream,4,first_4_bits);
346
347 line_size = pixels_per_line*3;
348
349 for (passes=0;passes<2;passes++)
350 {
351 if (passes==0)
352 {
353 bytes_per_channel = pixels_per_line;
354 dest_y = planar_y;
355 nblocks = image_x/4;
356 }
357 else
358 {
359 /* Format planar: All Y, then all U, then all V */
360 bytes_per_channel = pixels_per_line/2;
361 dest_u = planar_u;
362 dest_v = planar_v;
363 dest_y = dest_u;
364 nblocks = image_x/8;
365 }
366
367 offset_to_plane_u = bytes_per_channel*2;
368 offset_to_plane_v = bytes_per_channel*3;
369 /*
370 printf("bytes_per_channel = %d\n",bytes_per_channel);
371 printf("offset_to_plane_u = %d\n",offset_to_plane_u);
372 printf("offset_to_plane_v = %d\n",offset_to_plane_v);
373 */
374
375 while (nblocks-->0)
376 {
377 unsigned int gray_index;
378
379 fill_nbits(reservoir,nbits_in_reservoir,stream,16);
380 gray_index = reservoir & pdev->zzmask;
381 reservoir >>= pdev->zz;
382 nbits_in_reservoir -= pdev->zz;
383
384 fill_nbits(reservoir,nbits_in_reservoir,stream,2);
385
386 if ( (reservoir & 3) == 0)
387 {
388 reservoir>>=2;
389 nbits_in_reservoir-=2;
390 for (i=0;i<16;i++)
391 temp_colors[i] = pdev->table_dc00[gray_index];
392
393 }
394 else
395 {
396 unsigned int channel_v, offset1;
397
398 /* swap bit 0 and 2 of offset_OR */
399 channel_v = ((reservoir & 1) << 2) | (reservoir & 2) | ((reservoir & 4)>>2);
400 reservoir>>=3;
401 nbits_in_reservoir-=3;
402
403 for (i=0;i<16;i++)
404 temp_colors[i] = pdev->table_d800[gray_index];
405
406 ptable0004 = pdev->table_0004 + (passes*16384) + (first_4_bits*1024) + (channel_v*128);
407 ptable8004 = pdev->table_8004 + (passes*4096) + (first_4_bits*256) + (channel_v*32);
408
409 offset1 = 0;
410 while(1)
411 {
412 unsigned int index_in_table_ops, op, rows=0;
413 fill_nbits(reservoir,nbits_in_reservoir,stream,16);
414
415 /* mode is 0,1 or 2 */
416 index_in_table_ops = (reservoir&0x3F);
417 op = table_ops[ index_in_table_ops*4 ];
418 if (op == 2)
419 {
420 reservoir >>= 2;
421 nbits_in_reservoir -= 2;
422 break; /* exit the while(1) */
423 }
424 if (op == 0)
425 {
426 unsigned int shift;
427
428 offset1 = (offset1 + table_ops[index_in_table_ops*4+2]) & 0x0F;
429 shift = table_ops[ index_in_table_ops*4+1 ];
430 reservoir >>= shift;
431 nbits_in_reservoir -= shift;
432 rows = ptable0004[ offset1 + table_ops[index_in_table_ops*4+3] ];
433 }
434 if (op == 1)
435 {
436 /* 10bits [ xxxx xxxx yyyy 000 ]
437 * yyy => offset in the table8004
438 * xxx => offset in the tabled004
439 */
440 unsigned int mask, shift;
441 unsigned int col1, row1, total_bits;
442
443 offset1 = (offset1 + ((reservoir>>3)&0x0F)+1) & 0x0F;
444
445 col1 = (reservoir>>7) & 0xFF;
446 row1 = ptable8004 [ offset1*2 ];
447
448 /* Bit mask table */
449 mask = pdev->table_d004[ (row1<<8) + col1 ];
450 shift = ptable8004 [ offset1*2 + 1];
451 rows = ((mask << shift) + 0x80) & 0xFF;
452
453 total_bits = row1 + 8;
454 reservoir >>= total_bits;
455 nbits_in_reservoir -= total_bits;
456 }
457 {
458 const unsigned int *table_a004 = pdev->table_a004 + rows*12;
459 unsigned int *poffset = MulIdx + offset1*16; /* 64/4 (int) */
460 for (i=0;i<16;i++)
461 {
462 temp_colors[i] += table_a004[ *poffset ];
463 poffset++;
464 }
465 }
466 }
467 }
468#define USE_SIGNED_INT_FOR_COLOR
469#ifdef USE_SIGNED_INT_FOR_COLOR
470# define CLAMP(x) ((x)>255?255:((x)<0?0:x))
471#else
472# define CLAMP(x) ((x)>255?255:x)
473#endif
474
475 if (passes == 0)
476 {
477#ifdef USE_SIGNED_INT_FOR_COLOR
478 const int *c = temp_colors;
479#else
480 const unsigned int *c = temp_colors;
481#endif
482 unsigned char *d;
483
484 d = dest_y;
485 for (i=0;i<4;i++,c++)
486 *d++ = CLAMP((*c) >> pdev->yy);
487
488 d = dest_y + bytes_per_channel;
489 for (i=0;i<4;i++,c++)
490 *d++ = CLAMP((*c) >> pdev->yy);
491
492 d = dest_y + offset_to_plane_u;
493 for (i=0;i<4;i++,c++)
494 *d++ = CLAMP((*c) >> pdev->yy);
495
496 d = dest_y + offset_to_plane_v;
497 for (i=0;i<4;i++,c++)
498 *d++ = CLAMP((*c) >> pdev->yy);
499
500 dest_y += 4;
501 }
502 else if (passes == 1)
503 {
504#ifdef USE_SIGNED_INT_FOR_COLOR
505 int *c1 = temp_colors;
506 int *c2 = temp_colors+4;
507#else
508 unsigned int *c1 = temp_colors;
509 unsigned int *c2 = temp_colors+4;
510#endif
511 unsigned char *d;
512
513 d = dest_y;
514 for (i=0;i<4;i++,c1++,c2++)
515 {
516 *d++ = CLAMP((*c1) >> pdev->yy);
517 *d++ = CLAMP((*c2) >> pdev->yy);
518 }
519 c1 = temp_colors+12;
520 //c2 = temp_colors+8;
521 d = dest_y + bytes_per_channel;
522 for (i=0;i<4;i++,c1++,c2++)
523 {
524 *d++ = CLAMP((*c1) >> pdev->yy);
525 *d++ = CLAMP((*c2) >> pdev->yy);
526 }
527
528 if (even_line) /* Each line, swap u/v */
529 {
530 even_line=0;
531 dest_y = dest_v;
532 dest_u += 8;
533 }
534 else
535 {
536 even_line=1;
537 dest_y = dest_u;
538 dest_v += 8;
539 }
540 }
541
542 } /* end of while (nblocks-->0) */
543
544 } /* end of for (passes=0;passes<2;passes++) */
545
546}
547
548
549/**
550 *
551 * image: size of the image wanted
552 * view : size of the image returned by the camera
553 * offset: (x,y) to displayer image in the view
554 *
555 * src: raw data
556 * dst: image output
557 * flags: PWCX_FLAG_PLANAR
558 * pdev: private buffer
559 * bandlength:
560 *
561 */
562void pwc_dec23_decompress(const struct pwc_coord *image,
563 const struct pwc_coord *view,
564 const struct pwc_coord *offset,
565 const void *src,
566 void *dst,
567 int flags,
568 const void *data,
569 int bandlength)
570{
571 const struct pwc_dec23_private *pdev = data;
572 unsigned char *pout, *pout_planar_y=NULL, *pout_planar_u=NULL, *pout_planar_v=NULL;
573 int i,n,stride,pixel_size;
574
575
576 if (flags & PWCX_FLAG_BAYER)
577 {
578 pout = dst + (view->x * offset->y) + offset->x;
579 pixel_size = view->x * 4;
580 }
581 else
582 {
583 n = view->x * view->y;
584
585 /* offset in Y plane */
586 stride = view->x * offset->y;
587 pout_planar_y = dst + stride + offset->x;
588
589 /* offsets in U/V planes */
590 stride = (view->x * offset->y)/4 + offset->x/2;
591 pout_planar_u = dst + n + + stride;
592 pout_planar_v = dst + n + n/4 + stride;
593
594 pixel_size = view->x * 4;
595 }
596
597
598 for (i=0;i<image->y;i+=4)
599 {
600 if (flags & PWCX_FLAG_BAYER)
601 {
602 //TODO:
603 //DecompressBandBayer(pdev,src,pout,image.x,view->x,flags);
604 src += bandlength;
605 pout += pixel_size;
606 }
607 else
608 {
609 DecompressBand23(pdev,src,pout_planar_y,pout_planar_u,pout_planar_v,image->x,view->x,flags);
610 src += bandlength;
611 pout_planar_y += pixel_size;
612 pout_planar_u += view->x;
613 pout_planar_v += view->x;
614 }
615 }
616}
617
618void pwc_dec23_exit(void)
619{
620 /* Do nothing */
621
622}
623
diff --git a/drivers/usb/media/pwc/pwc-dec23.h b/drivers/usb/media/pwc/pwc-dec23.h
deleted file mode 100644
index 5b2aacdefa6c..000000000000
--- a/drivers/usb/media/pwc/pwc-dec23.h
+++ /dev/null
@@ -1,58 +0,0 @@
1/* Linux driver for Philips webcam
2 (C) 2004 Luc Saillard (luc@saillard.org)
3
4 NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
5 driver and thus may have bugs that are not present in the original version.
6 Please send bug reports and support requests to <luc@saillard.org>.
7 The decompression routines have been implemented by reverse-engineering the
8 Nemosoft binary pwcx module. Caveat emptor.
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23*/
24
25#ifndef PWC_DEC23_H
26#define PWC_DEC23_H
27
28struct pwc_dec23_private
29{
30 unsigned char xx,yy,zz,zzmask;
31
32 unsigned char table_0004[2*0x4000];
33 unsigned char table_8004[2*0x1000];
34 unsigned int table_a004[256*12];
35
36 unsigned char table_d004[8*256];
37 unsigned int table_d800[256];
38 unsigned int table_dc00[256];
39};
40
41
42void pwc_dec23_init(int type, int release, unsigned char *buffer, void *private_data);
43void pwc_dec23_exit(void);
44void pwc_dec23_decompress(const struct pwc_coord *image,
45 const struct pwc_coord *view,
46 const struct pwc_coord *offset,
47 const void *src,
48 void *dst,
49 int flags,
50 const void *data,
51 int bandlength);
52
53
54
55#endif
56
57
58
diff --git a/drivers/usb/media/pwc/pwc-if.c b/drivers/usb/media/pwc/pwc-if.c
index cca47f480a8b..b77e65c03659 100644
--- a/drivers/usb/media/pwc/pwc-if.c
+++ b/drivers/usb/media/pwc/pwc-if.c
@@ -68,8 +68,6 @@
68#include "pwc-ioctl.h" 68#include "pwc-ioctl.h"
69#include "pwc-kiara.h" 69#include "pwc-kiara.h"
70#include "pwc-timon.h" 70#include "pwc-timon.h"
71#include "pwc-dec23.h"
72#include "pwc-dec1.h"
73#include "pwc-uncompress.h" 71#include "pwc-uncompress.h"
74 72
75/* Function prototypes and driver templates */ 73/* Function prototypes and driver templates */
@@ -322,6 +320,7 @@ static int pwc_allocate_buffers(struct pwc_device *pdev)
322 case 730: 320 case 730:
323 case 740: 321 case 740:
324 case 750: 322 case 750:
323#if 0
325 Trace(TRACE_MEMORY,"private_data(%zu)\n",sizeof(struct pwc_dec23_private)); 324 Trace(TRACE_MEMORY,"private_data(%zu)\n",sizeof(struct pwc_dec23_private));
326 kbuf = kmalloc(sizeof(struct pwc_dec23_private), GFP_KERNEL); /* Timon & Kiara */ 325 kbuf = kmalloc(sizeof(struct pwc_dec23_private), GFP_KERNEL); /* Timon & Kiara */
327 break; 326 break;
@@ -330,11 +329,9 @@ static int pwc_allocate_buffers(struct pwc_device *pdev)
330 /* TODO & FIXME */ 329 /* TODO & FIXME */
331 kbuf = kmalloc(sizeof(struct pwc_dec23_private), GFP_KERNEL); 330 kbuf = kmalloc(sizeof(struct pwc_dec23_private), GFP_KERNEL);
332 break; 331 break;
332#endif
333 ;
333 } 334 }
334 if (kbuf == NULL) {
335 Err("Failed to allocate decompress table.\n");
336 return -ENOMEM;
337 }
338 pdev->decompress_data = kbuf; 335 pdev->decompress_data = kbuf;
339 336
340 /* Allocate image buffer; double buffer for mmap() */ 337 /* Allocate image buffer; double buffer for mmap() */
@@ -1131,11 +1128,11 @@ static int pwc_video_close(struct inode *inode, struct file *file)
1131 case 730: 1128 case 730:
1132 case 740: 1129 case 740:
1133 case 750: 1130 case 750:
1134 pwc_dec23_exit(); /* Timon & Kiara */ 1131/* pwc_dec23_exit(); *//* Timon & Kiara */
1135 break; 1132 break;
1136 case 645: 1133 case 645:
1137 case 646: 1134 case 646:
1138 pwc_dec1_exit(); 1135/* pwc_dec1_exit(); */
1139 break; 1136 break;
1140 } 1137 }
1141 1138
diff --git a/drivers/usb/media/pwc/pwc-kiara.c b/drivers/usb/media/pwc/pwc-kiara.c
index 5485800efd83..c498c68bace1 100644
--- a/drivers/usb/media/pwc/pwc-kiara.c
+++ b/drivers/usb/media/pwc/pwc-kiara.c
@@ -316,576 +316,3 @@ const struct Kiara_table_entry Kiara_table[PSZ_MAX][6][4] =
316 }, 316 },
317}; 317};
318 318
319
320/*
321 * Rom table for kiara chips
322 *
323 * 32 roms tables (one for each resolution ?)
324 * 2 tables per roms (one for each passes) (Y, and U&V)
325 * 128 bytes per passes
326 */
327
328const unsigned int KiaraRomTable [8][2][16][8] =
329{
330 { /* version 0 */
331 { /* version 0, passes 0 */
332 {0x00000000,0x00000000,0x00000000,0x00000000,
333 0x00000000,0x00000000,0x00000001,0x00000001},
334 {0x00000000,0x00000000,0x00000009,0x00000009,
335 0x00000009,0x00000009,0x00000009,0x00000009},
336 {0x00000000,0x00000000,0x00000009,0x00000049,
337 0x00000049,0x00000049,0x00000049,0x00000049},
338 {0x00000000,0x00000000,0x00000049,0x00000049,
339 0x00000049,0x00000249,0x0000024a,0x00000049},
340 {0x00000000,0x00000000,0x00000049,0x00000049,
341 0x00000249,0x00000249,0x0000024a,0x0000024a},
342 {0x00000000,0x00000000,0x00000049,0x00000249,
343 0x00000249,0x0000124a,0x0000024a,0x0000024a},
344 {0x00000000,0x00000000,0x00000049,0x00000249,
345 0x0000124a,0x00009252,0x00001252,0x00001252},
346 {0x00000000,0x00000000,0x00000249,0x00000249,
347 0x00009252,0x00009292,0x00009292,0x00009292},
348 {0x00000000,0x00000000,0x00000249,0x00001249,
349 0x00009292,0x00009292,0x00009493,0x000124db},
350 {0x00000000,0x00000000,0x00000249,0x0000924a,
351 0x00009492,0x0000a49b,0x0000a49b,0x000124db},
352 {0x00000000,0x00000000,0x00001249,0x00009252,
353 0x0000a493,0x000124db,0x000124db,0x000126dc},
354 {0x00000000,0x00000000,0x00001249,0x00009493,
355 0x000124db,0x000126dc,0x000136e4,0x000126dc},
356 {0x00000000,0x00000000,0x00009292,0x0000a49b,
357 0x000124db,0x000136e4,0x000136e4,0x000136e4},
358 {0x00000000,0x00000000,0x00009292,0x0000a49b,
359 0x000126dc,0x0001b724,0x0001b92d,0x0001b925},
360 {0x00000000,0x00000000,0x00009492,0x000124db,
361 0x000136e4,0x0001b925,0x0001c96e,0x0001c92d},
362 {0x00000000,0x00000000,0x00000000,0x00000000,
363 0x00000000,0x00000000,0x00000000,0x00000000}
364 },
365 { /* version 0, passes 1 */
366 {0x00000000,0x00000000,0x00000000,0x00000000,
367 0x00000000,0x00000000,0x00000000,0x00000000},
368 {0x00000000,0x00000000,0x00000000,0x00000000,
369 0x00000000,0x00000000,0x00000000,0x00000000},
370 {0x00000000,0x00000000,0x00000001,0x00000009,
371 0x00000009,0x00000009,0x00000009,0x00000001},
372 {0x00000000,0x00000000,0x00000009,0x00000009,
373 0x00000049,0x00000049,0x00000049,0x00000049},
374 {0x00000000,0x00000000,0x00000049,0x00000049,
375 0x00000049,0x00000049,0x0000024a,0x0000024a},
376 {0x00000000,0x00000000,0x00000049,0x00000049,
377 0x00000249,0x00000249,0x0000024a,0x0000024a},
378 {0x00000000,0x00000000,0x00000049,0x00000249,
379 0x00000249,0x00000249,0x0000024a,0x00001252},
380 {0x00000000,0x00000000,0x00000049,0x00001249,
381 0x0000124a,0x0000124a,0x00001252,0x00009292},
382 {0x00000000,0x00000000,0x00000249,0x00001249,
383 0x00009252,0x00009252,0x00009292,0x00009493},
384 {0x00000000,0x00000000,0x00000249,0x0000924a,
385 0x00009292,0x00009292,0x00009292,0x00009493},
386 {0x00000000,0x00000000,0x00000249,0x00009292,
387 0x00009492,0x00009493,0x0000a49b,0x00009493},
388 {0x00000000,0x00000000,0x00001249,0x00009292,
389 0x0000a493,0x000124db,0x000126dc,0x000126dc},
390 {0x00000000,0x00000000,0x0000924a,0x00009493,
391 0x0000a493,0x000126dc,0x000136e4,0x000136e4},
392 {0x00000000,0x00000000,0x00009252,0x00009493,
393 0x000126dc,0x000126dc,0x000136e4,0x000136e4},
394 {0x00000000,0x00000000,0x00009292,0x0000a49b,
395 0x000136e4,0x000136e4,0x0001b725,0x0001b724},
396 {0x00000000,0x00000000,0x00000000,0x00000000,
397 0x00000000,0x00000000,0x00000000,0x00000000}
398 }
399 },
400 { /* version 1 */
401 { /* version 1, passes 0 */
402 {0x00000000,0x00000000,0x00000000,0x00000000,
403 0x00000000,0x00000000,0x00000000,0x00000001},
404 {0x00000000,0x00000000,0x00000009,0x00000009,
405 0x00000009,0x00000009,0x00000009,0x00000009},
406 {0x00000000,0x00000000,0x00000049,0x00000049,
407 0x00000049,0x00000049,0x00000049,0x00000049},
408 {0x00000000,0x00000000,0x00000049,0x00000049,
409 0x00000049,0x00000249,0x0000024a,0x0000024a},
410 {0x00000000,0x00000000,0x00000049,0x00000249,
411 0x00000249,0x00000249,0x0000024a,0x00001252},
412 {0x00000000,0x00000000,0x00000249,0x00000249,
413 0x00000249,0x0000124a,0x00001252,0x00001252},
414 {0x00000000,0x00000000,0x00000249,0x00000249,
415 0x0000124a,0x0000124a,0x00009292,0x00009292},
416 {0x00000000,0x00000000,0x00000249,0x00001249,
417 0x0000124a,0x00009252,0x00009292,0x00009292},
418 {0x00000000,0x00000000,0x00000249,0x00001249,
419 0x00009252,0x00009292,0x00009292,0x00009292},
420 {0x00000000,0x00000000,0x00000249,0x00001249,
421 0x00009252,0x00009292,0x00009493,0x00009493},
422 {0x00000000,0x00000000,0x00000249,0x0000924a,
423 0x00009252,0x00009493,0x00009493,0x00009493},
424 {0x00000000,0x00000000,0x00000249,0x0000924a,
425 0x00009292,0x00009493,0x00009493,0x00009493},
426 {0x00000000,0x00000000,0x00000249,0x00009252,
427 0x00009492,0x00009493,0x0000a49b,0x0000a49b},
428 {0x00000000,0x00000000,0x00001249,0x00009292,
429 0x00009492,0x000124db,0x000124db,0x000124db},
430 {0x00000000,0x00000000,0x0000924a,0x00009493,
431 0x0000a493,0x000126dc,0x000126dc,0x000126dc},
432 {0x00000000,0x00000000,0x00000000,0x00000000,
433 0x00000000,0x00000000,0x00000000,0x00000000}
434 },
435 { /* version 1, passes 1 */
436 {0x00000000,0x00000000,0x00000000,0x00000000,
437 0x00000000,0x00000000,0x00000000,0x00000000},
438 {0x00000000,0x00000000,0x00000049,0x00000009,
439 0x00000049,0x00000009,0x00000001,0x00000000},
440 {0x00000000,0x00000000,0x00000049,0x00000049,
441 0x00000049,0x00000049,0x00000049,0x00000000},
442 {0x00000000,0x00000000,0x00000249,0x00000049,
443 0x00000249,0x00000049,0x0000024a,0x00000001},
444 {0x00000000,0x00000000,0x00000249,0x00000249,
445 0x00000249,0x00000249,0x0000024a,0x00000001},
446 {0x00000000,0x00000000,0x00000249,0x00000249,
447 0x00000249,0x00000249,0x0000024a,0x00000001},
448 {0x00000000,0x00000000,0x00000249,0x00000249,
449 0x00000249,0x00000249,0x0000024a,0x00000009},
450 {0x00000000,0x00000000,0x00000249,0x00000249,
451 0x0000124a,0x0000124a,0x0000024a,0x00000009},
452 {0x00000000,0x00000000,0x00000249,0x00000249,
453 0x0000124a,0x0000124a,0x0000024a,0x00000009},
454 {0x00000000,0x00000000,0x00001249,0x00001249,
455 0x0000124a,0x00009252,0x00001252,0x00000049},
456 {0x00000000,0x00000000,0x00001249,0x00001249,
457 0x0000124a,0x00009292,0x00001252,0x00000049},
458 {0x00000000,0x00000000,0x00001249,0x00001249,
459 0x0000124a,0x00009292,0x00001252,0x00000049},
460 {0x00000000,0x00000000,0x00001249,0x00001249,
461 0x00009252,0x00009292,0x00001252,0x0000024a},
462 {0x00000000,0x00000000,0x00001249,0x00001249,
463 0x00009292,0x00009292,0x00001252,0x0000024a},
464 {0x00000000,0x00000000,0x0000924a,0x0000924a,
465 0x00009492,0x00009493,0x00009292,0x00001252},
466 {0x00000000,0x00000000,0x00000000,0x00000000,
467 0x00000000,0x00000000,0x00000000,0x00000000}
468 }
469 },
470 { /* version 2 */
471 { /* version 2, passes 0 */
472 {0x00000000,0x00000000,0x00000049,0x00000049,
473 0x00000049,0x00000049,0x0000024a,0x0000024a},
474 {0x00000000,0x00000000,0x00000249,0x00000249,
475 0x00000249,0x0000124a,0x00001252,0x00009292},
476 {0x00000000,0x00000000,0x00000249,0x00000249,
477 0x0000124a,0x00009252,0x00009292,0x00009292},
478 {0x00000000,0x00000000,0x00000249,0x00001249,
479 0x0000124a,0x00009292,0x00009493,0x00009493},
480 {0x00000000,0x00000000,0x00000249,0x00001249,
481 0x00009252,0x00009493,0x00009493,0x0000a49b},
482 {0x00000000,0x00000000,0x00000249,0x0000924a,
483 0x00009292,0x00009493,0x0000a49b,0x0000a49b},
484 {0x00000000,0x00000000,0x00001249,0x0000924a,
485 0x00009292,0x00009493,0x0000a49b,0x000124db},
486 {0x00000000,0x00000000,0x00001249,0x00009252,
487 0x00009492,0x0000a49b,0x0000a49b,0x000124db},
488 {0x00000000,0x00000000,0x00001249,0x00009292,
489 0x00009492,0x000124db,0x000124db,0x000126dc},
490 {0x00000000,0x00000000,0x00001249,0x00009292,
491 0x0000a493,0x000124db,0x000126dc,0x000126dc},
492 {0x00000000,0x00000000,0x00001249,0x00009493,
493 0x0000a493,0x000124db,0x000126dc,0x000136e4},
494 {0x00000000,0x00000000,0x00001249,0x00009493,
495 0x0000a493,0x000126dc,0x000136e4,0x000136e4},
496 {0x00000000,0x00000000,0x0000924a,0x00009493,
497 0x0001249b,0x000126dc,0x000136e4,0x000136e4},
498 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
499 0x000124db,0x000136e4,0x000136e4,0x0001b724},
500 {0x00000000,0x00000000,0x00009252,0x000124db,
501 0x000126dc,0x0001b724,0x0001b725,0x0001b925},
502 {0x00000000,0x00000000,0x00000000,0x00000000,
503 0x00000000,0x00000000,0x00000000,0x00000000}
504 },
505 { /* version 2, passes 1 */
506 {0x00000000,0x00000000,0x00000049,0x00000049,
507 0x00000049,0x00000049,0x00000049,0x00000049},
508 {0x00000000,0x00000000,0x00000249,0x00000249,
509 0x00000249,0x00000249,0x0000024a,0x00000049},
510 {0x00000000,0x00000000,0x00001249,0x00000249,
511 0x0000124a,0x0000124a,0x00001252,0x00000049},
512 {0x00000000,0x00000000,0x00001249,0x00001249,
513 0x0000124a,0x0000124a,0x00009292,0x0000024a},
514 {0x00000000,0x00000000,0x00001249,0x00001249,
515 0x00009252,0x00009292,0x00009292,0x0000024a},
516 {0x00000000,0x00000000,0x00001249,0x00001249,
517 0x00009252,0x00009292,0x0000a49b,0x0000024a},
518 {0x00000000,0x00000000,0x00001249,0x00001249,
519 0x00009292,0x00009493,0x0000a49b,0x00001252},
520 {0x00000000,0x00000000,0x00001249,0x00001249,
521 0x00009292,0x00009493,0x0000a49b,0x00001252},
522 {0x00000000,0x00000000,0x00001249,0x0000924a,
523 0x00009492,0x0000a49b,0x0000a49b,0x00001252},
524 {0x00000000,0x00000000,0x00001249,0x00009252,
525 0x00009492,0x0000a49b,0x0000a49b,0x00009292},
526 {0x00000000,0x00000000,0x00001249,0x00009292,
527 0x00009492,0x0000a49b,0x0000a49b,0x00009292},
528 {0x00000000,0x00000000,0x00001249,0x00009493,
529 0x0000a493,0x0000a49b,0x0000a49b,0x00009292},
530 {0x00000000,0x00000000,0x00001249,0x00009493,
531 0x0000a493,0x0000a49b,0x0000a49b,0x00009493},
532 {0x00000000,0x00000000,0x0000924a,0x00009493,
533 0x0000a493,0x000124db,0x0000a49b,0x00009493},
534 {0x00000000,0x00000000,0x00009252,0x0000a49b,
535 0x0001249b,0x000126dc,0x000124db,0x0000a49b},
536 {0x00000000,0x00000000,0x00000000,0x00000000,
537 0x00000000,0x00000000,0x00000000,0x00000000}
538 }
539 },
540 { /* version 3 */
541 { /* version 3, passes 0 */
542 {0x00000000,0x00000000,0x00000249,0x00000249,
543 0x0000124a,0x0000124a,0x00009292,0x00009292},
544 {0x00000000,0x00000000,0x00001249,0x00001249,
545 0x00009292,0x00009493,0x0000a49b,0x0000a49b},
546 {0x00000000,0x00000000,0x00001249,0x0000924a,
547 0x00009492,0x0000a49b,0x0000a49b,0x000124db},
548 {0x00000000,0x00000000,0x00001249,0x00009292,
549 0x00009492,0x000124db,0x000126dc,0x000126dc},
550 {0x00000000,0x00000000,0x00001249,0x00009493,
551 0x0000a493,0x000124db,0x000126dc,0x000126dc},
552 {0x00000000,0x00000000,0x00001249,0x00009493,
553 0x0000a493,0x000126dc,0x000136e4,0x000136e4},
554 {0x00000000,0x00000000,0x00001249,0x00009493,
555 0x0000a493,0x000126dc,0x000136e4,0x0001b724},
556 {0x00000000,0x00000000,0x00001249,0x00009493,
557 0x0001249b,0x000126dc,0x000136e4,0x0001b724},
558 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
559 0x0001249b,0x000126dc,0x000136e4,0x0001b724},
560 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
561 0x0001249b,0x000136e4,0x0001b725,0x0001b724},
562 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
563 0x000124db,0x000136e4,0x0001b725,0x0001b925},
564 {0x00000000,0x00000000,0x00009292,0x0000a49b,
565 0x000126dc,0x000136e4,0x0001b92d,0x0001b925},
566 {0x00000000,0x00000000,0x00009292,0x0000a49b,
567 0x000126dc,0x0001b724,0x0001b92d,0x0001c92d},
568 {0x00000000,0x00000000,0x00009492,0x000124db,
569 0x000126dc,0x0001b724,0x0001c96e,0x0001c92d},
570 {0x00000000,0x00000000,0x0000a492,0x000126db,
571 0x000136e4,0x0001b925,0x00025bb6,0x00024b77},
572 {0x00000000,0x00000000,0x00000000,0x00000000,
573 0x00000000,0x00000000,0x00000000,0x00000000}
574 },
575 { /* version 3, passes 1 */
576 {0x00000000,0x00000000,0x00001249,0x00000249,
577 0x0000124a,0x0000124a,0x00001252,0x00001252},
578 {0x00000000,0x00000000,0x00001249,0x00001249,
579 0x00009252,0x00009292,0x00009292,0x00001252},
580 {0x00000000,0x00000000,0x00001249,0x0000924a,
581 0x00009492,0x00009493,0x0000a49b,0x00001252},
582 {0x00000000,0x00000000,0x00001249,0x00009252,
583 0x00009492,0x0000a49b,0x0000a49b,0x00009292},
584 {0x00000000,0x00000000,0x00001249,0x00009292,
585 0x00009492,0x0000a49b,0x0000a49b,0x00009292},
586 {0x00000000,0x00000000,0x00001249,0x00009493,
587 0x0000a493,0x0000a49b,0x000126dc,0x00009292},
588 {0x00000000,0x00000000,0x0000924a,0x00009493,
589 0x0000a493,0x0000a49b,0x000126dc,0x00009493},
590 {0x00000000,0x00000000,0x0000924a,0x00009493,
591 0x0000a493,0x0000a49b,0x000126dc,0x00009493},
592 {0x00000000,0x00000000,0x0000924a,0x00009493,
593 0x0000a493,0x000124db,0x000126dc,0x00009493},
594 {0x00000000,0x00000000,0x0000924a,0x00009493,
595 0x0000a493,0x000124db,0x000126dc,0x0000a49b},
596 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
597 0x0000a493,0x000124db,0x000126dc,0x0000a49b},
598 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
599 0x0001249b,0x000126dc,0x000126dc,0x0000a49b},
600 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
601 0x000124db,0x000136e4,0x000126dc,0x000124db},
602 {0x00000000,0x00000000,0x00009492,0x0000a49b,
603 0x000136e4,0x000136e4,0x000126dc,0x000124db},
604 {0x00000000,0x00000000,0x0000a492,0x000124db,
605 0x0001b724,0x0001b724,0x000136e4,0x000126dc},
606 {0x00000000,0x00000000,0x00000000,0x00000000,
607 0x00000000,0x00000000,0x00000000,0x00000000}
608 }
609 },
610 { /* version 4 */
611 { /* version 4, passes 0 */
612 {0x00000000,0x00000000,0x00000049,0x00000049,
613 0x00000049,0x00000049,0x00000049,0x00000049},
614 {0x00000000,0x00000000,0x00000249,0x00000049,
615 0x00000249,0x00000249,0x0000024a,0x00000049},
616 {0x00000000,0x00000000,0x00000249,0x00000249,
617 0x0000124a,0x00009252,0x00001252,0x0000024a},
618 {0x00000000,0x00000000,0x00001249,0x00001249,
619 0x00009252,0x00009292,0x00009493,0x00001252},
620 {0x00000000,0x00000000,0x00001249,0x0000924a,
621 0x00009292,0x00009493,0x00009493,0x00001252},
622 {0x00000000,0x00000000,0x00001249,0x00009292,
623 0x00009492,0x0000a49b,0x0000a49b,0x00009292},
624 {0x00000000,0x00000000,0x00001249,0x00009493,
625 0x0000a493,0x000124db,0x000124db,0x00009493},
626 {0x00000000,0x00000000,0x0000924a,0x00009493,
627 0x0000a493,0x000124db,0x000126dc,0x0000a49b},
628 {0x00000000,0x00000000,0x0000924a,0x00009493,
629 0x0000a493,0x000124db,0x000126dc,0x0000a49b},
630 {0x00000000,0x00000000,0x0000924a,0x00009493,
631 0x0001249b,0x000126dc,0x000126dc,0x000124db},
632 {0x00000000,0x00000000,0x00009252,0x00009493,
633 0x000124db,0x000136e4,0x000136e4,0x000126dc},
634 {0x00000000,0x00000000,0x00009252,0x0000a49b,
635 0x000124db,0x000136e4,0x000136e4,0x000126dc},
636 {0x00000000,0x00000000,0x00009292,0x0000a49b,
637 0x000126dc,0x000136e4,0x000136e4,0x000136e4},
638 {0x00000000,0x00000000,0x00009492,0x0000a49b,
639 0x000126dc,0x0001b724,0x0001b725,0x0001b724},
640 {0x00000000,0x00000000,0x0000a492,0x000124db,
641 0x000136e4,0x0001b925,0x0001b92d,0x0001b925},
642 {0x00000000,0x00000000,0x00000000,0x00000000,
643 0x00000000,0x00000000,0x00000000,0x00000000}
644 },
645 { /* version 4, passes 1 */
646 {0x00000000,0x00000000,0x00000249,0x00000049,
647 0x00000009,0x00000009,0x00000009,0x00000009},
648 {0x00000000,0x00000000,0x00000249,0x00000249,
649 0x00000049,0x00000049,0x00000009,0x00000009},
650 {0x00000000,0x00000000,0x00001249,0x00001249,
651 0x0000124a,0x00000249,0x00000049,0x00000049},
652 {0x00000000,0x00000000,0x00001249,0x00001249,
653 0x0000124a,0x0000124a,0x00000049,0x00000049},
654 {0x00000000,0x00000000,0x00001249,0x00001249,
655 0x00009252,0x0000124a,0x0000024a,0x0000024a},
656 {0x00000000,0x00000000,0x00001249,0x0000924a,
657 0x00009252,0x0000124a,0x0000024a,0x0000024a},
658 {0x00000000,0x00000000,0x00001249,0x00009292,
659 0x00009492,0x00009252,0x00001252,0x00001252},
660 {0x00000000,0x00000000,0x00001249,0x00009493,
661 0x0000a493,0x00009292,0x00009292,0x00001252},
662 {0x00000000,0x00000000,0x0000924a,0x00009493,
663 0x0000a493,0x00009292,0x00009292,0x00009292},
664 {0x00000000,0x00000000,0x0000924a,0x00009493,
665 0x0000a493,0x00009493,0x00009493,0x00009292},
666 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
667 0x0000a493,0x0000a49b,0x00009493,0x00009493},
668 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
669 0x0000a493,0x0000a49b,0x0000a49b,0x00009493},
670 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
671 0x0001249b,0x000124db,0x0000a49b,0x0000a49b},
672 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
673 0x000136e4,0x000126dc,0x000124db,0x0000a49b},
674 {0x00000000,0x00000000,0x00009252,0x000124db,
675 0x0001b724,0x000136e4,0x000126dc,0x000124db},
676 {0x00000000,0x00000000,0x00000000,0x00000000,
677 0x00000000,0x00000000,0x00000000,0x00000000}
678 }
679 },
680 { /* version 5 */
681 { /* version 5, passes 0 */
682 {0x00000000,0x00000000,0x00000249,0x00000249,
683 0x00000249,0x00000249,0x00001252,0x00001252},
684 {0x00000000,0x00000000,0x00001249,0x00001249,
685 0x00009252,0x00009292,0x00009292,0x00001252},
686 {0x00000000,0x00000000,0x00001249,0x0000924a,
687 0x00009492,0x0000a49b,0x0000a49b,0x00009292},
688 {0x00000000,0x00000000,0x00001249,0x00009493,
689 0x0000a493,0x0000a49b,0x000124db,0x00009493},
690 {0x00000000,0x00000000,0x00001249,0x00009493,
691 0x0000a493,0x000124db,0x000126dc,0x00009493},
692 {0x00000000,0x00000000,0x0000924a,0x00009493,
693 0x0000a493,0x000126dc,0x000126dc,0x0000a49b},
694 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
695 0x0001249b,0x000126dc,0x000136e4,0x000124db},
696 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
697 0x000126dc,0x000136e4,0x000136e4,0x000126dc},
698 {0x00000000,0x00000000,0x00009292,0x0000a49b,
699 0x000126dc,0x000136e4,0x000136e4,0x000126dc},
700 {0x00000000,0x00000000,0x00009292,0x0000a49b,
701 0x000126dc,0x0001b724,0x0001b725,0x000136e4},
702 {0x00000000,0x00000000,0x00009292,0x0000a49b,
703 0x000136e4,0x0001b724,0x0001b92d,0x0001b724},
704 {0x00000000,0x00000000,0x00009492,0x0000a49b,
705 0x000136e4,0x0001b724,0x0001b92d,0x0001b724},
706 {0x00000000,0x00000000,0x00009492,0x000124db,
707 0x000136e4,0x0001b925,0x0001c96e,0x0001b925},
708 {0x00000000,0x00000000,0x00009492,0x000124db,
709 0x0001b724,0x0001b925,0x0001c96e,0x0001c92d},
710 {0x00000000,0x00000000,0x0000a492,0x000126db,
711 0x0001c924,0x0002496d,0x00025bb6,0x00024b77},
712 {0x00000000,0x00000000,0x00000000,0x00000000,
713 0x00000000,0x00000000,0x00000000,0x00000000}
714 },
715 { /* version 5, passes 1 */
716 {0x00000000,0x00000000,0x00001249,0x00000249,
717 0x00000249,0x00000249,0x0000024a,0x0000024a},
718 {0x00000000,0x00000000,0x00001249,0x00001249,
719 0x0000124a,0x0000124a,0x0000024a,0x0000024a},
720 {0x00000000,0x00000000,0x00001249,0x0000924a,
721 0x00009252,0x00009252,0x0000024a,0x0000024a},
722 {0x00000000,0x00000000,0x00001249,0x00009292,
723 0x00009492,0x0000a49b,0x00001252,0x00001252},
724 {0x00000000,0x00000000,0x0000924a,0x00009493,
725 0x0000a493,0x0000a49b,0x00001252,0x00001252},
726 {0x00000000,0x00000000,0x0000924a,0x00009493,
727 0x0000a493,0x0000a49b,0x00009292,0x00001252},
728 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
729 0x0000a493,0x0000a49b,0x00009292,0x00009292},
730 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
731 0x0000a493,0x0000a49b,0x00009493,0x00009292},
732 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
733 0x0001249b,0x000124db,0x00009493,0x00009292},
734 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
735 0x0001249b,0x000124db,0x00009493,0x00009493},
736 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
737 0x000124db,0x000124db,0x0000a49b,0x00009493},
738 {0x00000000,0x00000000,0x0000924a,0x000124db,
739 0x000126dc,0x000126dc,0x0000a49b,0x00009493},
740 {0x00000000,0x00000000,0x0000924a,0x000124db,
741 0x000136e4,0x000126dc,0x000124db,0x0000a49b},
742 {0x00000000,0x00000000,0x00009292,0x000124db,
743 0x000136e4,0x000126dc,0x000124db,0x0000a49b},
744 {0x00000000,0x00000000,0x00009492,0x000126db,
745 0x0001b724,0x000136e4,0x000126dc,0x000124db},
746 {0x00000000,0x00000000,0x00000000,0x00000000,
747 0x00000000,0x00000000,0x00000000,0x00000000}
748 }
749 },
750 { /* version 6 */
751 { /* version 6, passes 0 */
752 {0x00000000,0x00000000,0x00001249,0x00001249,
753 0x00009252,0x00009292,0x00009493,0x00009493},
754 {0x00000000,0x00000000,0x00001249,0x00009292,
755 0x0000a493,0x0000a49b,0x0000a49b,0x00009493},
756 {0x00000000,0x00000000,0x00001249,0x00009493,
757 0x0000a493,0x000124db,0x000124db,0x0000a49b},
758 {0x00000000,0x00000000,0x0000924a,0x00009493,
759 0x0000a493,0x000126dc,0x000126dc,0x0000a49b},
760 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
761 0x0001249b,0x000126dc,0x000136e4,0x000124db},
762 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
763 0x000126dc,0x000136e4,0x000136e4,0x000126dc},
764 {0x00000000,0x00000000,0x00009292,0x0000a49b,
765 0x000126dc,0x0001b724,0x0001b725,0x000126dc},
766 {0x00000000,0x00000000,0x00009292,0x0000a49b,
767 0x000136e4,0x0001b724,0x0001b92d,0x000136e4},
768 {0x00000000,0x00000000,0x00009492,0x0000a49b,
769 0x000136e4,0x0001b724,0x0001b92d,0x0001b724},
770 {0x00000000,0x00000000,0x00009492,0x000124db,
771 0x000136e4,0x0001b724,0x0001b92d,0x0001b724},
772 {0x00000000,0x00000000,0x00009492,0x000124db,
773 0x000136e4,0x0001b925,0x0001b92d,0x0001b925},
774 {0x00000000,0x00000000,0x00009492,0x000124db,
775 0x0001b724,0x0001b925,0x0001c96e,0x0001c92d},
776 {0x00000000,0x00000000,0x0000a492,0x000124db,
777 0x0001b724,0x0001c92d,0x0001c96e,0x0001c92d},
778 {0x00000000,0x00000000,0x0000a492,0x000124db,
779 0x0001b724,0x0001c92d,0x00024b76,0x0002496e},
780 {0x00000000,0x00000000,0x00012492,0x000126db,
781 0x0001c924,0x00024b6d,0x0002ddb6,0x00025bbf},
782 {0x00000000,0x00000000,0x00000000,0x00000000,
783 0x00000000,0x00000000,0x00000000,0x00000000}
784 },
785 { /* version 6, passes 1 */
786 {0x00000000,0x00000000,0x00001249,0x00001249,
787 0x0000124a,0x0000124a,0x00001252,0x00001252},
788 {0x00000000,0x00000000,0x00001249,0x00009292,
789 0x00009492,0x00009252,0x00001252,0x00001252},
790 {0x00000000,0x00000000,0x0000924a,0x00009493,
791 0x0000a493,0x00009292,0x00001252,0x00001252},
792 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
793 0x0000a493,0x0000a49b,0x00009292,0x00009292},
794 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
795 0x0000a493,0x0000a49b,0x00009292,0x00009292},
796 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
797 0x0001249b,0x0000a49b,0x00009493,0x00009292},
798 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
799 0x000124db,0x000124db,0x00009493,0x00009493},
800 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
801 0x000124db,0x000124db,0x0000a49b,0x00009493},
802 {0x00000000,0x00000000,0x0000924a,0x000124db,
803 0x000126dc,0x000124db,0x0000a49b,0x00009493},
804 {0x00000000,0x00000000,0x0000924a,0x000124db,
805 0x000126dc,0x000126dc,0x0000a49b,0x0000a49b},
806 {0x00000000,0x00000000,0x0000924a,0x000124db,
807 0x000136e4,0x000126dc,0x000124db,0x0000a49b},
808 {0x00000000,0x00000000,0x00009492,0x000126db,
809 0x000136e4,0x000126dc,0x000124db,0x0000a49b},
810 {0x00000000,0x00000000,0x00009492,0x000126db,
811 0x0001b724,0x000136e4,0x000126dc,0x000124db},
812 {0x00000000,0x00000000,0x00009492,0x000126db,
813 0x0001b724,0x000136e4,0x000126dc,0x000124db},
814 {0x00000000,0x00000000,0x0000a492,0x000136db,
815 0x0001c924,0x0001b724,0x000136e4,0x000126dc},
816 {0x00000000,0x00000000,0x00000000,0x00000000,
817 0x00000000,0x00000000,0x00000000,0x00000000}
818 }
819 },
820 { /* version 7 */
821 { /* version 7, passes 0 */
822 {0x00000000,0x00000000,0x00001249,0x00001249,
823 0x00009252,0x00009292,0x00009493,0x00009493},
824 {0x00000000,0x00000000,0x00001249,0x00009493,
825 0x0000a493,0x000124db,0x000126dc,0x00009493},
826 {0x00000000,0x00000000,0x00001249,0x0000a49b,
827 0x0001249b,0x000126dc,0x000126dc,0x0000a49b},
828 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
829 0x0001249b,0x000126dc,0x000136e4,0x0000a49b},
830 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
831 0x000126dc,0x000136e4,0x0001b725,0x000124db},
832 {0x00000000,0x00000000,0x00009292,0x0000a49b,
833 0x000136e4,0x0001b724,0x0001b725,0x000126dc},
834 {0x00000000,0x00000000,0x00009292,0x000124db,
835 0x000136e4,0x0001b724,0x0001b725,0x000126dc},
836 {0x00000000,0x00000000,0x00009492,0x000124db,
837 0x000136e4,0x0001b724,0x0001c96e,0x000136e4},
838 {0x00000000,0x00000000,0x00009492,0x000124db,
839 0x000136e4,0x0001c92d,0x0001c96e,0x0001b724},
840 {0x00000000,0x00000000,0x0000a492,0x000124db,
841 0x000136e4,0x0001c92d,0x0001c96e,0x0001b724},
842 {0x00000000,0x00000000,0x0000a492,0x000124db,
843 0x0001b724,0x0001c92d,0x0001c96e,0x0001b925},
844 {0x00000000,0x00000000,0x0000a492,0x000126db,
845 0x0001b724,0x0001c92d,0x00024b76,0x0001c92d},
846 {0x00000000,0x00000000,0x0000a492,0x000126db,
847 0x0001b924,0x0001c92d,0x00024b76,0x0001c92d},
848 {0x00000000,0x00000000,0x0000a492,0x000126db,
849 0x0001b924,0x0001c92d,0x00024b76,0x0002496e},
850 {0x00000000,0x00000000,0x00012492,0x000136db,
851 0x00024924,0x00024b6d,0x0002ddb6,0x00025bbf},
852 {0x00000000,0x00000000,0x00000000,0x00000000,
853 0x00000000,0x00000000,0x00000000,0x00000000}
854 },
855 { /* version 7, passes 1 */
856 {0x00000000,0x00000000,0x00001249,0x00001249,
857 0x0000124a,0x0000124a,0x00001252,0x00001252},
858 {0x00000000,0x00000000,0x0000924a,0x00009493,
859 0x00009492,0x00009292,0x00001252,0x00001252},
860 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
861 0x0000a493,0x0000a49b,0x00001252,0x00001252},
862 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
863 0x0000a493,0x0000a49b,0x00009292,0x00009292},
864 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
865 0x0000a493,0x0000a49b,0x00009292,0x00009292},
866 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
867 0x000126dc,0x0000a49b,0x00009493,0x00009292},
868 {0x00000000,0x00000000,0x0000924a,0x000124db,
869 0x000126dc,0x000124db,0x00009493,0x00009493},
870 {0x00000000,0x00000000,0x0000924a,0x000124db,
871 0x000136e4,0x000124db,0x0000a49b,0x00009493},
872 {0x00000000,0x00000000,0x0000924a,0x000136db,
873 0x0001b724,0x000124db,0x0000a49b,0x00009493},
874 {0x00000000,0x00000000,0x0000924a,0x000136db,
875 0x0001b724,0x000126dc,0x0000a49b,0x0000a49b},
876 {0x00000000,0x00000000,0x00009292,0x000136db,
877 0x0001b724,0x000126dc,0x000124db,0x0000a49b},
878 {0x00000000,0x00000000,0x00009492,0x000136db,
879 0x0001b724,0x000126dc,0x000124db,0x0000a49b},
880 {0x00000000,0x00000000,0x0000a492,0x000136db,
881 0x0001b724,0x000136e4,0x000126dc,0x000124db},
882 {0x00000000,0x00000000,0x0000a492,0x000136db,
883 0x0001b724,0x000136e4,0x000126dc,0x000124db},
884 {0x00000000,0x00000000,0x00012492,0x0001b6db,
885 0x0001c924,0x0001b724,0x000136e4,0x000126dc},
886 {0x00000000,0x00000000,0x00000000,0x00000000,
887 0x00000000,0x00000000,0x00000000,0x00000000}
888 }
889 }
890};
891
diff --git a/drivers/usb/media/pwc/pwc-timon.c b/drivers/usb/media/pwc/pwc-timon.c
index f950a4e5ed96..dee967173d6c 100644
--- a/drivers/usb/media/pwc/pwc-timon.c
+++ b/drivers/usb/media/pwc/pwc-timon.c
@@ -314,1133 +314,3 @@ const struct Timon_table_entry Timon_table[PSZ_MAX][6][4] =
314 }, 314 },
315}; 315};
316 316
317/*
318 * 16 versions:
319 * 2 tables (one for Y, and one for U&V)
320 * 16 levels of details per tables
321 * 8 blocs
322 */
323
324const unsigned int TimonRomTable [16][2][16][8] =
325{
326 { /* version 0 */
327 { /* version 0, passes 0 */
328 {0x00000000,0x00000000,0x00000000,0x00000000,
329 0x00000000,0x00000000,0x00000000,0x00000001},
330 {0x00000000,0x00000000,0x00000001,0x00000001,
331 0x00000001,0x00000001,0x00000001,0x00000001},
332 {0x00000000,0x00000000,0x00000001,0x00000001,
333 0x00000001,0x00000009,0x00000009,0x00000009},
334 {0x00000000,0x00000000,0x00000009,0x00000001,
335 0x00000009,0x00000009,0x00000009,0x00000009},
336 {0x00000000,0x00000000,0x00000009,0x00000009,
337 0x00000009,0x00000009,0x00000049,0x00000009},
338 {0x00000000,0x00000000,0x00000009,0x00000009,
339 0x00000009,0x00000049,0x00000049,0x00000049},
340 {0x00000000,0x00000000,0x00000009,0x00000009,
341 0x00000049,0x00000049,0x00000049,0x00000049},
342 {0x00000000,0x00000000,0x00000009,0x00000049,
343 0x00000049,0x00000049,0x00000049,0x00000049},
344 {0x00000000,0x00000000,0x00000049,0x00000049,
345 0x00000049,0x00000049,0x0000024a,0x0000024a},
346 {0x00000000,0x00000000,0x00000049,0x00000049,
347 0x00000049,0x00000249,0x0000024a,0x0000024a},
348 {0x00000000,0x00000000,0x00000049,0x00000049,
349 0x00000249,0x00000249,0x0000024a,0x0000024a},
350 {0x00000000,0x00000000,0x00000049,0x00000049,
351 0x00000249,0x00000249,0x00001252,0x0000024a},
352 {0x00000000,0x00000000,0x00000049,0x00000049,
353 0x00000249,0x0000124a,0x00001252,0x0000024a},
354 {0x00000000,0x00000000,0x00000049,0x00000249,
355 0x00000249,0x0000124a,0x00001252,0x0000024a},
356 {0x00000000,0x00000000,0x00000249,0x00001249,
357 0x0000124a,0x00009252,0x00009292,0x00001252},
358 {0x00000000,0x00000000,0x00000000,0x00000000,
359 0x00000000,0x00000000,0x00000000,0x00000000}
360 },
361 { /* version 0, passes 1 */
362 {0x00000000,0x00000000,0x00000000,0x00000000,
363 0x00000000,0x00000000,0x00000000,0x00000000},
364 {0x00000000,0x00000000,0x00000001,0x00000001,
365 0x00000001,0x00000001,0x00000000,0x00000000},
366 {0x00000000,0x00000000,0x00000009,0x00000001,
367 0x00000001,0x00000009,0x00000000,0x00000000},
368 {0x00000000,0x00000000,0x00000009,0x00000009,
369 0x00000009,0x00000009,0x00000000,0x00000000},
370 {0x00000000,0x00000000,0x00000009,0x00000009,
371 0x00000009,0x00000009,0x00000001,0x00000000},
372 {0x00000000,0x00000000,0x00000049,0x00000009,
373 0x00000009,0x00000049,0x00000001,0x00000001},
374 {0x00000000,0x00000000,0x00000049,0x00000009,
375 0x00000009,0x00000049,0x00000001,0x00000001},
376 {0x00000000,0x00000000,0x00000049,0x00000049,
377 0x00000049,0x00000049,0x00000009,0x00000001},
378 {0x00000000,0x00000000,0x00000049,0x00000049,
379 0x00000049,0x00000049,0x00000009,0x00000001},
380 {0x00000000,0x00000000,0x00000049,0x00000049,
381 0x00000049,0x00000049,0x00000009,0x00000001},
382 {0x00000000,0x00000000,0x00000049,0x00000049,
383 0x00000049,0x00000049,0x00000009,0x00000009},
384 {0x00000000,0x00000000,0x00000049,0x00000049,
385 0x00000049,0x00000249,0x00000049,0x00000009},
386 {0x00000000,0x00000000,0x00000049,0x00000049,
387 0x00000049,0x00000249,0x00000049,0x00000009},
388 {0x00000000,0x00000000,0x00000249,0x00000049,
389 0x00000249,0x00000249,0x00000049,0x00000009},
390 {0x00000000,0x00000000,0x00001249,0x00000249,
391 0x0000124a,0x0000124a,0x0000024a,0x00000049},
392 {0x00000000,0x00000000,0x00000000,0x00000000,
393 0x00000000,0x00000000,0x00000000,0x00000000}
394 }
395 },
396 { /* version 1 */
397 { /* version 1, passes 0 */
398 {0x00000000,0x00000000,0x00000000,0x00000000,
399 0x00000000,0x00000000,0x00000000,0x00000001},
400 {0x00000000,0x00000000,0x00000001,0x00000001,
401 0x00000001,0x00000009,0x00000009,0x00000009},
402 {0x00000000,0x00000000,0x00000009,0x00000009,
403 0x00000009,0x00000009,0x00000009,0x00000009},
404 {0x00000000,0x00000000,0x00000009,0x00000009,
405 0x00000009,0x00000049,0x00000049,0x00000049},
406 {0x00000000,0x00000000,0x00000009,0x00000049,
407 0x00000049,0x00000049,0x00000049,0x00000049},
408 {0x00000000,0x00000000,0x00000049,0x00000049,
409 0x00000049,0x00000249,0x0000024a,0x0000024a},
410 {0x00000000,0x00000000,0x00000049,0x00000049,
411 0x00000249,0x00000249,0x0000024a,0x0000024a},
412 {0x00000000,0x00000000,0x00000049,0x00000249,
413 0x00000249,0x00000249,0x0000024a,0x00001252},
414 {0x00000000,0x00000000,0x00000049,0x00000249,
415 0x00000249,0x0000124a,0x00001252,0x00001252},
416 {0x00000000,0x00000000,0x00000049,0x00000249,
417 0x0000124a,0x0000124a,0x00001252,0x00001252},
418 {0x00000000,0x00000000,0x00000249,0x00000249,
419 0x0000124a,0x0000124a,0x00009292,0x00009292},
420 {0x00000000,0x00000000,0x00000249,0x00001249,
421 0x0000124a,0x00009252,0x00009292,0x00009292},
422 {0x00000000,0x00000000,0x00000249,0x00001249,
423 0x00009252,0x00009252,0x00009292,0x00009292},
424 {0x00000000,0x00000000,0x00000249,0x0000924a,
425 0x00009292,0x00009493,0x00009493,0x00009493},
426 {0x00000000,0x00000000,0x00001249,0x00009252,
427 0x00009492,0x0000a49b,0x0000a49b,0x0000a49b},
428 {0x00000000,0x00000000,0x00000000,0x00000000,
429 0x00000000,0x00000000,0x00000000,0x00000000}
430 },
431 { /* version 1, passes 1 */
432 {0x00000000,0x00000000,0x00000000,0x00000000,
433 0x00000000,0x00000000,0x00000000,0x00000000},
434 {0x00000000,0x00000000,0x00000009,0x00000009,
435 0x00000009,0x00000001,0x00000001,0x00000000},
436 {0x00000000,0x00000000,0x00000009,0x00000009,
437 0x00000009,0x00000009,0x00000001,0x00000000},
438 {0x00000000,0x00000000,0x00000049,0x00000049,
439 0x00000049,0x00000009,0x00000001,0x00000000},
440 {0x00000000,0x00000000,0x00000049,0x00000049,
441 0x00000049,0x00000049,0x00000001,0x00000001},
442 {0x00000000,0x00000000,0x00000049,0x00000049,
443 0x00000049,0x00000049,0x00000009,0x00000001},
444 {0x00000000,0x00000000,0x00000249,0x00000049,
445 0x00000049,0x00000249,0x00000009,0x00000001},
446 {0x00000000,0x00000000,0x00000249,0x00000049,
447 0x00000249,0x00000249,0x00000009,0x00000009},
448 {0x00000000,0x00000000,0x00000249,0x00000249,
449 0x00000249,0x00000249,0x00000049,0x00000009},
450 {0x00000000,0x00000000,0x00000249,0x00000249,
451 0x00000249,0x0000124a,0x00000049,0x00000009},
452 {0x00000000,0x00000000,0x00000249,0x00000249,
453 0x00000249,0x0000124a,0x00000049,0x00000009},
454 {0x00000000,0x00000000,0x00000249,0x00000249,
455 0x00000249,0x0000124a,0x0000024a,0x00000049},
456 {0x00000000,0x00000000,0x00000249,0x00000249,
457 0x0000124a,0x0000124a,0x0000024a,0x00000049},
458 {0x00000000,0x00000000,0x00000249,0x00000249,
459 0x0000124a,0x0000124a,0x0000024a,0x00000049},
460 {0x00000000,0x00000000,0x00001249,0x00001249,
461 0x00009252,0x00009252,0x00001252,0x0000024a},
462 {0x00000000,0x00000000,0x00000000,0x00000000,
463 0x00000000,0x00000000,0x00000000,0x00000000}
464 }
465 },
466 { /* version 2 */
467 { /* version 2, passes 0 */
468 {0x00000000,0x00000000,0x00000000,0x00000000,
469 0x00000000,0x00000000,0x00000000,0x00000001},
470 {0x00000000,0x00000000,0x00000009,0x00000009,
471 0x00000009,0x00000009,0x00000009,0x00000009},
472 {0x00000000,0x00000000,0x00000049,0x00000049,
473 0x00000049,0x00000049,0x00000049,0x00000049},
474 {0x00000000,0x00000000,0x00000049,0x00000049,
475 0x00000049,0x00000249,0x0000024a,0x0000024a},
476 {0x00000000,0x00000000,0x00000049,0x00000249,
477 0x00000249,0x00000249,0x0000024a,0x00001252},
478 {0x00000000,0x00000000,0x00000249,0x00000249,
479 0x00000249,0x0000124a,0x00001252,0x00001252},
480 {0x00000000,0x00000000,0x00000249,0x00000249,
481 0x0000124a,0x0000124a,0x00009292,0x00009292},
482 {0x00000000,0x00000000,0x00000249,0x00001249,
483 0x0000124a,0x00009252,0x00009292,0x00009292},
484 {0x00000000,0x00000000,0x00000249,0x00001249,
485 0x00009252,0x00009292,0x00009292,0x00009292},
486 {0x00000000,0x00000000,0x00000249,0x00001249,
487 0x00009252,0x00009292,0x00009493,0x00009493},
488 {0x00000000,0x00000000,0x00000249,0x0000924a,
489 0x00009252,0x00009493,0x00009493,0x00009493},
490 {0x00000000,0x00000000,0x00000249,0x0000924a,
491 0x00009292,0x00009493,0x00009493,0x00009493},
492 {0x00000000,0x00000000,0x00000249,0x00009252,
493 0x00009492,0x00009493,0x0000a49b,0x0000a49b},
494 {0x00000000,0x00000000,0x00001249,0x00009292,
495 0x00009492,0x000124db,0x000124db,0x000124db},
496 {0x00000000,0x00000000,0x0000924a,0x00009493,
497 0x0000a493,0x000126dc,0x000126dc,0x000126dc},
498 {0x00000000,0x00000000,0x00000000,0x00000000,
499 0x00000000,0x00000000,0x00000000,0x00000000}
500 },
501 { /* version 2, passes 1 */
502 {0x00000000,0x00000000,0x00000000,0x00000000,
503 0x00000000,0x00000000,0x00000000,0x00000000},
504 {0x00000000,0x00000000,0x00000049,0x00000009,
505 0x00000049,0x00000009,0x00000001,0x00000000},
506 {0x00000000,0x00000000,0x00000049,0x00000049,
507 0x00000049,0x00000049,0x00000049,0x00000000},
508 {0x00000000,0x00000000,0x00000249,0x00000049,
509 0x00000249,0x00000049,0x0000024a,0x00000001},
510 {0x00000000,0x00000000,0x00000249,0x00000249,
511 0x00000249,0x00000249,0x0000024a,0x00000001},
512 {0x00000000,0x00000000,0x00000249,0x00000249,
513 0x00000249,0x00000249,0x0000024a,0x00000001},
514 {0x00000000,0x00000000,0x00000249,0x00000249,
515 0x00000249,0x00000249,0x0000024a,0x00000009},
516 {0x00000000,0x00000000,0x00000249,0x00000249,
517 0x0000124a,0x0000124a,0x0000024a,0x00000009},
518 {0x00000000,0x00000000,0x00000249,0x00000249,
519 0x0000124a,0x0000124a,0x0000024a,0x00000009},
520 {0x00000000,0x00000000,0x00001249,0x00001249,
521 0x0000124a,0x00009252,0x00001252,0x00000049},
522 {0x00000000,0x00000000,0x00001249,0x00001249,
523 0x0000124a,0x00009292,0x00001252,0x00000049},
524 {0x00000000,0x00000000,0x00001249,0x00001249,
525 0x0000124a,0x00009292,0x00001252,0x00000049},
526 {0x00000000,0x00000000,0x00001249,0x00001249,
527 0x00009252,0x00009292,0x00001252,0x0000024a},
528 {0x00000000,0x00000000,0x00001249,0x00001249,
529 0x00009292,0x00009292,0x00001252,0x0000024a},
530 {0x00000000,0x00000000,0x0000924a,0x0000924a,
531 0x00009492,0x00009493,0x00009292,0x00001252},
532 {0x00000000,0x00000000,0x00000000,0x00000000,
533 0x00000000,0x00000000,0x00000000,0x00000000}
534 }
535 },
536 { /* version 3 */
537 { /* version 3, passes 0 */
538 {0x00000000,0x00000000,0x00000000,0x00000000,
539 0x00000000,0x00000000,0x00000000,0x00000001},
540 {0x00000000,0x00000000,0x00000049,0x00000049,
541 0x00000049,0x00000049,0x00000049,0x00000049},
542 {0x00000000,0x00000000,0x00000049,0x00000249,
543 0x00000249,0x00000249,0x00001252,0x0000024a},
544 {0x00000000,0x00000000,0x00000249,0x00000249,
545 0x00000249,0x0000124a,0x00001252,0x00001252},
546 {0x00000000,0x00000000,0x00000249,0x00000249,
547 0x0000124a,0x00009252,0x00009292,0x00009292},
548 {0x00000000,0x00000000,0x00000249,0x00001249,
549 0x0000124a,0x00009292,0x00009292,0x00009493},
550 {0x00000000,0x00000000,0x00000249,0x00001249,
551 0x00009252,0x00009292,0x00009493,0x00009493},
552 {0x00000000,0x00000000,0x00000249,0x00001249,
553 0x00009292,0x00009493,0x00009493,0x00009493},
554 {0x00000000,0x00000000,0x00000249,0x00009252,
555 0x00009292,0x00009493,0x0000a49b,0x0000a49b},
556 {0x00000000,0x00000000,0x00001249,0x00009252,
557 0x00009292,0x0000a49b,0x0000a49b,0x0000a49b},
558 {0x00000000,0x00000000,0x00001249,0x00009252,
559 0x00009492,0x0000a49b,0x0000a49b,0x0000a49b},
560 {0x00000000,0x00000000,0x00001249,0x00009292,
561 0x00009492,0x0000a49b,0x000124db,0x000124db},
562 {0x00000000,0x00000000,0x00001249,0x00009292,
563 0x0000a493,0x0000a49b,0x000124db,0x000124db},
564 {0x00000000,0x00000000,0x00001249,0x00009493,
565 0x0001249b,0x000126dc,0x000136e4,0x000126dc},
566 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
567 0x000124db,0x000136e4,0x0001b725,0x000136e4},
568 {0x00000000,0x00000000,0x00000000,0x00000000,
569 0x00000000,0x00000000,0x00000000,0x00000000}
570 },
571 { /* version 3, passes 1 */
572 {0x00000000,0x00000000,0x00000000,0x00000000,
573 0x00000000,0x00000000,0x00000000,0x00000000},
574 {0x00000000,0x00000000,0x00000049,0x00000049,
575 0x00000049,0x00000049,0x00000001,0x00000000},
576 {0x00000000,0x00000000,0x00000249,0x00000249,
577 0x00000249,0x00000249,0x00000049,0x00000001},
578 {0x00000000,0x00000000,0x00000249,0x00000249,
579 0x00000249,0x0000124a,0x00001252,0x00000001},
580 {0x00000000,0x00000000,0x00000249,0x00000249,
581 0x0000124a,0x0000124a,0x00001252,0x00000009},
582 {0x00000000,0x00000000,0x00000249,0x00001249,
583 0x0000124a,0x00009252,0x00009292,0x00000009},
584 {0x00000000,0x00000000,0x00001249,0x00001249,
585 0x0000124a,0x00009252,0x00009292,0x00000049},
586 {0x00000000,0x00000000,0x00001249,0x00001249,
587 0x00009252,0x00009252,0x00009292,0x00000049},
588 {0x00000000,0x00000000,0x00001249,0x00001249,
589 0x00009252,0x00009493,0x00009292,0x0000024a},
590 {0x00000000,0x00000000,0x00001249,0x00001249,
591 0x00009252,0x00009493,0x00009292,0x0000024a},
592 {0x00000000,0x00000000,0x00001249,0x00001249,
593 0x00009252,0x00009493,0x00009493,0x00001252},
594 {0x00000000,0x00000000,0x00001249,0x0000924a,
595 0x00009292,0x00009493,0x00009493,0x00001252},
596 {0x00000000,0x00000000,0x00001249,0x0000924a,
597 0x00009492,0x00009493,0x00009493,0x00009292},
598 {0x00000000,0x00000000,0x00001249,0x00009252,
599 0x00009492,0x0000a49b,0x00009493,0x00009292},
600 {0x00000000,0x00000000,0x0000924a,0x00009292,
601 0x0000a493,0x000124db,0x0000a49b,0x00009493},
602 {0x00000000,0x00000000,0x00000000,0x00000000,
603 0x00000000,0x00000000,0x00000000,0x00000000}
604 }
605 },
606 { /* version 4 */
607 { /* version 4, passes 0 */
608 {0x00000000,0x00000000,0x00000049,0x00000049,
609 0x00000049,0x00000049,0x0000024a,0x0000024a},
610 {0x00000000,0x00000000,0x00000249,0x00000249,
611 0x00000249,0x0000124a,0x00001252,0x00009292},
612 {0x00000000,0x00000000,0x00000249,0x00000249,
613 0x0000124a,0x00009252,0x00009292,0x00009292},
614 {0x00000000,0x00000000,0x00000249,0x00001249,
615 0x0000124a,0x00009292,0x00009493,0x00009493},
616 {0x00000000,0x00000000,0x00000249,0x00001249,
617 0x00009252,0x00009493,0x00009493,0x0000a49b},
618 {0x00000000,0x00000000,0x00000249,0x0000924a,
619 0x00009292,0x00009493,0x0000a49b,0x0000a49b},
620 {0x00000000,0x00000000,0x00001249,0x0000924a,
621 0x00009292,0x00009493,0x0000a49b,0x000124db},
622 {0x00000000,0x00000000,0x00001249,0x00009252,
623 0x00009492,0x0000a49b,0x0000a49b,0x000124db},
624 {0x00000000,0x00000000,0x00001249,0x00009292,
625 0x00009492,0x000124db,0x000124db,0x000126dc},
626 {0x00000000,0x00000000,0x00001249,0x00009292,
627 0x0000a493,0x000124db,0x000126dc,0x000126dc},
628 {0x00000000,0x00000000,0x00001249,0x00009493,
629 0x0000a493,0x000124db,0x000126dc,0x000136e4},
630 {0x00000000,0x00000000,0x00001249,0x00009493,
631 0x0000a493,0x000126dc,0x000136e4,0x000136e4},
632 {0x00000000,0x00000000,0x0000924a,0x00009493,
633 0x0001249b,0x000126dc,0x000136e4,0x000136e4},
634 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
635 0x000124db,0x000136e4,0x000136e4,0x0001b724},
636 {0x00000000,0x00000000,0x00009252,0x000124db,
637 0x000126dc,0x0001b724,0x0001b725,0x0001b925},
638 {0x00000000,0x00000000,0x00000000,0x00000000,
639 0x00000000,0x00000000,0x00000000,0x00000000}
640 },
641 { /* version 4, passes 1 */
642 {0x00000000,0x00000000,0x00000049,0x00000049,
643 0x00000049,0x00000049,0x00000049,0x00000049},
644 {0x00000000,0x00000000,0x00000249,0x00000249,
645 0x00000249,0x00000249,0x0000024a,0x00000049},
646 {0x00000000,0x00000000,0x00001249,0x00000249,
647 0x0000124a,0x0000124a,0x00001252,0x00000049},
648 {0x00000000,0x00000000,0x00001249,0x00001249,
649 0x0000124a,0x0000124a,0x00009292,0x0000024a},
650 {0x00000000,0x00000000,0x00001249,0x00001249,
651 0x00009252,0x00009292,0x00009292,0x0000024a},
652 {0x00000000,0x00000000,0x00001249,0x00001249,
653 0x00009252,0x00009292,0x0000a49b,0x0000024a},
654 {0x00000000,0x00000000,0x00001249,0x00001249,
655 0x00009292,0x00009493,0x0000a49b,0x00001252},
656 {0x00000000,0x00000000,0x00001249,0x00001249,
657 0x00009292,0x00009493,0x0000a49b,0x00001252},
658 {0x00000000,0x00000000,0x00001249,0x0000924a,
659 0x00009492,0x0000a49b,0x0000a49b,0x00001252},
660 {0x00000000,0x00000000,0x00001249,0x00009252,
661 0x00009492,0x0000a49b,0x0000a49b,0x00009292},
662 {0x00000000,0x00000000,0x00001249,0x00009292,
663 0x00009492,0x0000a49b,0x0000a49b,0x00009292},
664 {0x00000000,0x00000000,0x00001249,0x00009493,
665 0x0000a493,0x0000a49b,0x0000a49b,0x00009292},
666 {0x00000000,0x00000000,0x00001249,0x00009493,
667 0x0000a493,0x0000a49b,0x0000a49b,0x00009493},
668 {0x00000000,0x00000000,0x0000924a,0x00009493,
669 0x0000a493,0x000124db,0x0000a49b,0x00009493},
670 {0x00000000,0x00000000,0x00009252,0x0000a49b,
671 0x0001249b,0x000126dc,0x000124db,0x0000a49b},
672 {0x00000000,0x00000000,0x00000000,0x00000000,
673 0x00000000,0x00000000,0x00000000,0x00000000}
674 }
675 },
676 { /* version 5 */
677 { /* version 5, passes 0 */
678 {0x00000000,0x00000000,0x00000249,0x00000249,
679 0x00000249,0x0000124a,0x00001252,0x00009292},
680 {0x00000000,0x00000000,0x00000249,0x00001249,
681 0x0000124a,0x00009292,0x00009292,0x00009493},
682 {0x00000000,0x00000000,0x00000249,0x0000924a,
683 0x00009292,0x00009493,0x0000a49b,0x0000a49b},
684 {0x00000000,0x00000000,0x00001249,0x0000924a,
685 0x00009292,0x00009493,0x0000a49b,0x0000a49b},
686 {0x00000000,0x00000000,0x00001249,0x0000924a,
687 0x00009492,0x0000a49b,0x0000a49b,0x000124db},
688 {0x00000000,0x00000000,0x00001249,0x00009292,
689 0x00009492,0x0000a49b,0x000124db,0x000124db},
690 {0x00000000,0x00000000,0x00001249,0x00009292,
691 0x0000a493,0x000124db,0x000124db,0x000126dc},
692 {0x00000000,0x00000000,0x00001249,0x00009493,
693 0x0000a493,0x000124db,0x000126dc,0x000126dc},
694 {0x00000000,0x00000000,0x00001249,0x00009493,
695 0x0000a493,0x000126dc,0x000136e4,0x000136e4},
696 {0x00000000,0x00000000,0x00001249,0x00009493,
697 0x0001249b,0x000126dc,0x000136e4,0x000136e4},
698 {0x00000000,0x00000000,0x00001249,0x00009493,
699 0x0001249b,0x000126dc,0x000136e4,0x000136e4},
700 {0x00000000,0x00000000,0x0000924a,0x00009493,
701 0x0001249b,0x000126dc,0x0001b725,0x0001b724},
702 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
703 0x000124db,0x000126dc,0x0001b725,0x0001b724},
704 {0x00000000,0x00000000,0x00009292,0x0000a49b,
705 0x000126dc,0x000136e4,0x0001b92d,0x0001b925},
706 {0x00000000,0x00000000,0x00009492,0x000124db,
707 0x000136e4,0x0001b724,0x0001c96e,0x0001c92d},
708 {0x00000000,0x00000000,0x00000000,0x00000000,
709 0x00000000,0x00000000,0x00000000,0x00000000}
710 },
711 { /* version 5, passes 1 */
712 {0x00000000,0x00000000,0x00000249,0x00000249,
713 0x0000124a,0x00000249,0x0000024a,0x0000024a},
714 {0x00000000,0x00000000,0x00001249,0x00001249,
715 0x0000124a,0x0000124a,0x00001252,0x0000024a},
716 {0x00000000,0x00000000,0x00001249,0x00001249,
717 0x00009292,0x00009493,0x00009493,0x0000024a},
718 {0x00000000,0x00000000,0x00001249,0x00001249,
719 0x00009292,0x00009493,0x00009493,0x00001252},
720 {0x00000000,0x00000000,0x00001249,0x00001249,
721 0x00009292,0x00009493,0x0000a49b,0x00001252},
722 {0x00000000,0x00000000,0x00001249,0x0000924a,
723 0x00009492,0x00009493,0x000124db,0x00001252},
724 {0x00000000,0x00000000,0x00001249,0x00009292,
725 0x00009492,0x00009493,0x000124db,0x00009292},
726 {0x00000000,0x00000000,0x00001249,0x00009292,
727 0x00009492,0x0000a49b,0x000124db,0x00009292},
728 {0x00000000,0x00000000,0x00001249,0x00009493,
729 0x0000a493,0x0000a49b,0x000124db,0x00009292},
730 {0x00000000,0x00000000,0x00001249,0x00009493,
731 0x0000a493,0x000124db,0x000124db,0x00009493},
732 {0x00000000,0x00000000,0x0000924a,0x00009493,
733 0x0000a493,0x000124db,0x000124db,0x00009493},
734 {0x00000000,0x00000000,0x0000924a,0x00009493,
735 0x0000a493,0x000124db,0x000124db,0x00009493},
736 {0x00000000,0x00000000,0x0000924a,0x00009493,
737 0x0000a493,0x000124db,0x000124db,0x0000a49b},
738 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
739 0x000124db,0x000126dc,0x000124db,0x0000a49b},
740 {0x00000000,0x00000000,0x00009252,0x000124db,
741 0x000126dc,0x000136e4,0x000126dc,0x000124db},
742 {0x00000000,0x00000000,0x00000000,0x00000000,
743 0x00000000,0x00000000,0x00000000,0x00000000}
744 }
745 },
746 { /* version 6 */
747 { /* version 6, passes 0 */
748 {0x00000000,0x00000000,0x00000249,0x00000249,
749 0x0000124a,0x0000124a,0x00009292,0x00009292},
750 {0x00000000,0x00000000,0x00001249,0x00001249,
751 0x00009292,0x00009493,0x0000a49b,0x0000a49b},
752 {0x00000000,0x00000000,0x00001249,0x0000924a,
753 0x00009492,0x0000a49b,0x0000a49b,0x000124db},
754 {0x00000000,0x00000000,0x00001249,0x00009292,
755 0x00009492,0x000124db,0x000126dc,0x000126dc},
756 {0x00000000,0x00000000,0x00001249,0x00009493,
757 0x0000a493,0x000124db,0x000126dc,0x000126dc},
758 {0x00000000,0x00000000,0x00001249,0x00009493,
759 0x0000a493,0x000126dc,0x000136e4,0x000136e4},
760 {0x00000000,0x00000000,0x00001249,0x00009493,
761 0x0000a493,0x000126dc,0x000136e4,0x0001b724},
762 {0x00000000,0x00000000,0x00001249,0x00009493,
763 0x0001249b,0x000126dc,0x000136e4,0x0001b724},
764 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
765 0x0001249b,0x000126dc,0x000136e4,0x0001b724},
766 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
767 0x0001249b,0x000136e4,0x0001b725,0x0001b724},
768 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
769 0x000124db,0x000136e4,0x0001b725,0x0001b925},
770 {0x00000000,0x00000000,0x00009292,0x0000a49b,
771 0x000126dc,0x000136e4,0x0001b92d,0x0001b925},
772 {0x00000000,0x00000000,0x00009292,0x0000a49b,
773 0x000126dc,0x0001b724,0x0001b92d,0x0001c92d},
774 {0x00000000,0x00000000,0x00009492,0x000124db,
775 0x000126dc,0x0001b724,0x0001c96e,0x0001c92d},
776 {0x00000000,0x00000000,0x0000a492,0x000126db,
777 0x000136e4,0x0001b925,0x00025bb6,0x00024b77},
778 {0x00000000,0x00000000,0x00000000,0x00000000,
779 0x00000000,0x00000000,0x00000000,0x00000000}
780 },
781 { /* version 6, passes 1 */
782 {0x00000000,0x00000000,0x00001249,0x00000249,
783 0x0000124a,0x0000124a,0x00001252,0x00001252},
784 {0x00000000,0x00000000,0x00001249,0x00001249,
785 0x00009252,0x00009292,0x00009292,0x00001252},
786 {0x00000000,0x00000000,0x00001249,0x0000924a,
787 0x00009492,0x00009493,0x0000a49b,0x00001252},
788 {0x00000000,0x00000000,0x00001249,0x00009252,
789 0x00009492,0x0000a49b,0x0000a49b,0x00009292},
790 {0x00000000,0x00000000,0x00001249,0x00009292,
791 0x00009492,0x0000a49b,0x0000a49b,0x00009292},
792 {0x00000000,0x00000000,0x00001249,0x00009493,
793 0x0000a493,0x0000a49b,0x000126dc,0x00009292},
794 {0x00000000,0x00000000,0x0000924a,0x00009493,
795 0x0000a493,0x0000a49b,0x000126dc,0x00009493},
796 {0x00000000,0x00000000,0x0000924a,0x00009493,
797 0x0000a493,0x0000a49b,0x000126dc,0x00009493},
798 {0x00000000,0x00000000,0x0000924a,0x00009493,
799 0x0000a493,0x000124db,0x000126dc,0x00009493},
800 {0x00000000,0x00000000,0x0000924a,0x00009493,
801 0x0000a493,0x000124db,0x000126dc,0x0000a49b},
802 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
803 0x0000a493,0x000124db,0x000126dc,0x0000a49b},
804 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
805 0x0001249b,0x000126dc,0x000126dc,0x0000a49b},
806 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
807 0x000124db,0x000136e4,0x000126dc,0x000124db},
808 {0x00000000,0x00000000,0x00009492,0x0000a49b,
809 0x000136e4,0x000136e4,0x000126dc,0x000124db},
810 {0x00000000,0x00000000,0x0000a492,0x000124db,
811 0x0001b724,0x0001b724,0x000136e4,0x000126dc},
812 {0x00000000,0x00000000,0x00000000,0x00000000,
813 0x00000000,0x00000000,0x00000000,0x00000000}
814 }
815 },
816 { /* version 7 */
817 { /* version 7, passes 0 */
818 {0x00000000,0x00000000,0x00001249,0x00001249,
819 0x00009292,0x00009493,0x0000a49b,0x000124db},
820 {0x00000000,0x00000000,0x00001249,0x00009292,
821 0x0000a493,0x0000a49b,0x000124db,0x000126dc},
822 {0x00000000,0x00000000,0x00001249,0x00009493,
823 0x0000a493,0x000124db,0x000126dc,0x000136e4},
824 {0x00000000,0x00000000,0x00001249,0x00009493,
825 0x0000a493,0x000124db,0x000136e4,0x000136e4},
826 {0x00000000,0x00000000,0x00001249,0x00009493,
827 0x0001249b,0x000126dc,0x000136e4,0x000136e4},
828 {0x00000000,0x00000000,0x00001249,0x0000a49b,
829 0x0001249b,0x000126dc,0x000136e4,0x0001b724},
830 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
831 0x0001249b,0x000126dc,0x000136e4,0x0001b724},
832 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
833 0x000124db,0x000136e4,0x0001b725,0x0001b724},
834 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
835 0x000126dc,0x000136e4,0x0001b725,0x0001b925},
836 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
837 0x000126dc,0x0001b724,0x0001b92d,0x0001b925},
838 {0x00000000,0x00000000,0x00009292,0x0000a49b,
839 0x000126dc,0x0001b724,0x0001c96e,0x0001c92d},
840 {0x00000000,0x00000000,0x00009292,0x000124db,
841 0x000126dc,0x0001b724,0x0001c96e,0x0001c92d},
842 {0x00000000,0x00000000,0x00009492,0x000124db,
843 0x000136e4,0x0001b724,0x0001c96e,0x0002496e},
844 {0x00000000,0x00000000,0x00009492,0x000126db,
845 0x000136e4,0x0001b925,0x0001c96e,0x0002496e},
846 {0x00000000,0x00000000,0x0000a492,0x000136db,
847 0x0001b724,0x0002496d,0x00025bb6,0x00025bbf},
848 {0x00000000,0x00000000,0x00000000,0x00000000,
849 0x00000000,0x00000000,0x00000000,0x00000000}
850 },
851 { /* version 7, passes 1 */
852 {0x00000000,0x00000000,0x00001249,0x00001249,
853 0x00009252,0x00009292,0x00009292,0x00009292},
854 {0x00000000,0x00000000,0x00001249,0x0000924a,
855 0x00009492,0x00009493,0x00009493,0x00009292},
856 {0x00000000,0x00000000,0x00001249,0x00009493,
857 0x0000a493,0x0000a49b,0x0000a49b,0x00009292},
858 {0x00000000,0x00000000,0x0000924a,0x00009493,
859 0x0000a493,0x0000a49b,0x000124db,0x00009493},
860 {0x00000000,0x00000000,0x0000924a,0x00009493,
861 0x0000a493,0x000124db,0x000124db,0x00009493},
862 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
863 0x0000a493,0x000124db,0x000136e4,0x00009493},
864 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
865 0x0000a493,0x000124db,0x000136e4,0x0000a49b},
866 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
867 0x0001249b,0x000124db,0x000136e4,0x0000a49b},
868 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
869 0x0001249b,0x000126dc,0x000136e4,0x0000a49b},
870 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
871 0x0001249b,0x000126dc,0x000136e4,0x000124db},
872 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
873 0x000126dc,0x000136e4,0x000136e4,0x000124db},
874 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
875 0x000126dc,0x000136e4,0x000136e4,0x000124db},
876 {0x00000000,0x00000000,0x0000924a,0x000124db,
877 0x000136e4,0x000136e4,0x000136e4,0x000126dc},
878 {0x00000000,0x00000000,0x0000a492,0x000124db,
879 0x000136e4,0x0001b724,0x000136e4,0x000126dc},
880 {0x00000000,0x00000000,0x00012492,0x000126db,
881 0x0001b724,0x0001b925,0x0001b725,0x000136e4},
882 {0x00000000,0x00000000,0x00000000,0x00000000,
883 0x00000000,0x00000000,0x00000000,0x00000000}
884 }
885 },
886 { /* version 8 */
887 { /* version 8, passes 0 */
888 {0x00000000,0x00000000,0x00001249,0x00001249,
889 0x00009292,0x00009493,0x0000a49b,0x000124db},
890 {0x00000000,0x00000000,0x00001249,0x00009292,
891 0x0000a493,0x000124db,0x000126dc,0x000126dc},
892 {0x00000000,0x00000000,0x00001249,0x00009493,
893 0x0000a493,0x000124db,0x000126dc,0x000136e4},
894 {0x00000000,0x00000000,0x00001249,0x0000a49b,
895 0x0001249b,0x000126dc,0x000136e4,0x0001b724},
896 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
897 0x0001249b,0x000126dc,0x000136e4,0x0001b724},
898 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
899 0x000124db,0x000136e4,0x0001b725,0x0001b724},
900 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
901 0x000126dc,0x000136e4,0x0001b725,0x0001b925},
902 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
903 0x000126dc,0x0001b724,0x0001b92d,0x0001c92d},
904 {0x00000000,0x00000000,0x00009252,0x000124db,
905 0x000126dc,0x0001b724,0x0001b92d,0x0001c92d},
906 {0x00000000,0x00000000,0x00009292,0x000124db,
907 0x000126dc,0x0001b925,0x0001c96e,0x0001c92d},
908 {0x00000000,0x00000000,0x00009492,0x000124db,
909 0x000136e4,0x0001b925,0x0001c96e,0x0001c92d},
910 {0x00000000,0x00000000,0x00009492,0x000124db,
911 0x000136e4,0x0001b925,0x00024b76,0x00024b77},
912 {0x00000000,0x00000000,0x00009492,0x000126db,
913 0x000136e4,0x0001b925,0x00024b76,0x00025bbf},
914 {0x00000000,0x00000000,0x0000a492,0x000126db,
915 0x000136e4,0x0001c92d,0x00024b76,0x00025bbf},
916 {0x00000000,0x00000000,0x00012492,0x000136db,
917 0x0001b724,0x00024b6d,0x0002ddb6,0x0002efff},
918 {0x00000000,0x00000000,0x00000000,0x00000000,
919 0x00000000,0x00000000,0x00000000,0x00000000}
920 },
921 { /* version 8, passes 1 */
922 {0x00000000,0x00000000,0x00001249,0x00001249,
923 0x00009252,0x00009493,0x00009493,0x00009493},
924 {0x00000000,0x00000000,0x00001249,0x00009292,
925 0x0000a493,0x0000a49b,0x0000a49b,0x00009493},
926 {0x00000000,0x00000000,0x0000924a,0x00009493,
927 0x0000a493,0x0000a49b,0x000124db,0x00009493},
928 {0x00000000,0x00000000,0x0000924a,0x00009493,
929 0x0000a493,0x000124db,0x000126dc,0x0000a49b},
930 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
931 0x0000a493,0x000124db,0x000126dc,0x0000a49b},
932 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
933 0x0000a493,0x000124db,0x000136e4,0x000124db},
934 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
935 0x0001249b,0x000126dc,0x000136e4,0x000124db},
936 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
937 0x000126dc,0x000126dc,0x000136e4,0x000126dc},
938 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
939 0x000126dc,0x000136e4,0x000136e4,0x000126dc},
940 {0x00000000,0x00000000,0x0000924a,0x000124db,
941 0x000126dc,0x000136e4,0x000136e4,0x000126dc},
942 {0x00000000,0x00000000,0x0000924a,0x000124db,
943 0x000126dc,0x000136e4,0x000136e4,0x000136e4},
944 {0x00000000,0x00000000,0x00009292,0x000124db,
945 0x000136e4,0x0001b724,0x0001b725,0x000136e4},
946 {0x00000000,0x00000000,0x00009492,0x000126db,
947 0x000136e4,0x0001b925,0x0001b725,0x0001b724},
948 {0x00000000,0x00000000,0x00009492,0x000126db,
949 0x000136e4,0x0001b925,0x0001b725,0x0001b724},
950 {0x00000000,0x00000000,0x0000a492,0x000136db,
951 0x0001b724,0x0002496d,0x0001b92d,0x0001b925},
952 {0x00000000,0x00000000,0x00000000,0x00000000,
953 0x00000000,0x00000000,0x00000000,0x00000000}
954 }
955 },
956 { /* version 9 */
957 { /* version 9, passes 0 */
958 {0x00000000,0x00000000,0x00000049,0x00000049,
959 0x00000049,0x00000049,0x00000049,0x00000049},
960 {0x00000000,0x00000000,0x00000249,0x00000049,
961 0x00000249,0x00000249,0x0000024a,0x00000049},
962 {0x00000000,0x00000000,0x00000249,0x00000249,
963 0x0000124a,0x00009252,0x00001252,0x0000024a},
964 {0x00000000,0x00000000,0x00001249,0x00001249,
965 0x00009252,0x00009292,0x00009493,0x00001252},
966 {0x00000000,0x00000000,0x00001249,0x0000924a,
967 0x00009292,0x00009493,0x00009493,0x00001252},
968 {0x00000000,0x00000000,0x00001249,0x00009292,
969 0x00009492,0x0000a49b,0x0000a49b,0x00009292},
970 {0x00000000,0x00000000,0x00001249,0x00009493,
971 0x0000a493,0x000124db,0x000124db,0x00009493},
972 {0x00000000,0x00000000,0x0000924a,0x00009493,
973 0x0000a493,0x000124db,0x000126dc,0x0000a49b},
974 {0x00000000,0x00000000,0x0000924a,0x00009493,
975 0x0000a493,0x000124db,0x000126dc,0x0000a49b},
976 {0x00000000,0x00000000,0x0000924a,0x00009493,
977 0x0001249b,0x000126dc,0x000126dc,0x000124db},
978 {0x00000000,0x00000000,0x00009252,0x00009493,
979 0x000124db,0x000136e4,0x000136e4,0x000126dc},
980 {0x00000000,0x00000000,0x00009252,0x0000a49b,
981 0x000124db,0x000136e4,0x000136e4,0x000126dc},
982 {0x00000000,0x00000000,0x00009292,0x0000a49b,
983 0x000126dc,0x000136e4,0x000136e4,0x000136e4},
984 {0x00000000,0x00000000,0x00009492,0x0000a49b,
985 0x000126dc,0x0001b724,0x0001b725,0x0001b724},
986 {0x00000000,0x00000000,0x0000a492,0x000124db,
987 0x000136e4,0x0001b925,0x0001b92d,0x0001b925},
988 {0x00000000,0x00000000,0x00000000,0x00000000,
989 0x00000000,0x00000000,0x00000000,0x00000000}
990 },
991 { /* version 9, passes 1 */
992 {0x00000000,0x00000000,0x00000249,0x00000049,
993 0x00000009,0x00000009,0x00000009,0x00000009},
994 {0x00000000,0x00000000,0x00000249,0x00000249,
995 0x00000049,0x00000049,0x00000009,0x00000009},
996 {0x00000000,0x00000000,0x00001249,0x00001249,
997 0x0000124a,0x00000249,0x00000049,0x00000049},
998 {0x00000000,0x00000000,0x00001249,0x00001249,
999 0x0000124a,0x0000124a,0x00000049,0x00000049},
1000 {0x00000000,0x00000000,0x00001249,0x00001249,
1001 0x00009252,0x0000124a,0x0000024a,0x0000024a},
1002 {0x00000000,0x00000000,0x00001249,0x0000924a,
1003 0x00009252,0x0000124a,0x0000024a,0x0000024a},
1004 {0x00000000,0x00000000,0x00001249,0x00009292,
1005 0x00009492,0x00009252,0x00001252,0x00001252},
1006 {0x00000000,0x00000000,0x00001249,0x00009493,
1007 0x0000a493,0x00009292,0x00009292,0x00001252},
1008 {0x00000000,0x00000000,0x0000924a,0x00009493,
1009 0x0000a493,0x00009292,0x00009292,0x00009292},
1010 {0x00000000,0x00000000,0x0000924a,0x00009493,
1011 0x0000a493,0x00009493,0x00009493,0x00009292},
1012 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1013 0x0000a493,0x0000a49b,0x00009493,0x00009493},
1014 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1015 0x0000a493,0x0000a49b,0x0000a49b,0x00009493},
1016 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1017 0x0001249b,0x000124db,0x0000a49b,0x0000a49b},
1018 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1019 0x000136e4,0x000126dc,0x000124db,0x0000a49b},
1020 {0x00000000,0x00000000,0x00009252,0x000124db,
1021 0x0001b724,0x000136e4,0x000126dc,0x000124db},
1022 {0x00000000,0x00000000,0x00000000,0x00000000,
1023 0x00000000,0x00000000,0x00000000,0x00000000}
1024 }
1025 },
1026 { /* version 10 */
1027 { /* version 10, passes 0 */
1028 {0x00000000,0x00000000,0x00000249,0x00000249,
1029 0x00000249,0x00000249,0x0000024a,0x0000024a},
1030 {0x00000000,0x00000000,0x00000249,0x00001249,
1031 0x00009252,0x00009292,0x00009292,0x0000024a},
1032 {0x00000000,0x00000000,0x00001249,0x00001249,
1033 0x00009252,0x00009292,0x00009292,0x00001252},
1034 {0x00000000,0x00000000,0x00001249,0x0000924a,
1035 0x00009492,0x00009493,0x0000a49b,0x00009292},
1036 {0x00000000,0x00000000,0x00001249,0x00009292,
1037 0x00009492,0x000124db,0x000124db,0x00009292},
1038 {0x00000000,0x00000000,0x00001249,0x00009493,
1039 0x0000a493,0x000124db,0x000124db,0x00009493},
1040 {0x00000000,0x00000000,0x00001249,0x00009493,
1041 0x0000a493,0x000124db,0x000126dc,0x0000a49b},
1042 {0x00000000,0x00000000,0x0000924a,0x00009493,
1043 0x0000a493,0x000124db,0x000126dc,0x000124db},
1044 {0x00000000,0x00000000,0x0000924a,0x00009493,
1045 0x0001249b,0x000126dc,0x000126dc,0x000124db},
1046 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1047 0x000124db,0x000126dc,0x000136e4,0x000126dc},
1048 {0x00000000,0x00000000,0x00009252,0x0000a49b,
1049 0x000124db,0x000136e4,0x000136e4,0x000136e4},
1050 {0x00000000,0x00000000,0x00009292,0x0000a49b,
1051 0x000126dc,0x000136e4,0x000136e4,0x000136e4},
1052 {0x00000000,0x00000000,0x00009492,0x0000a49b,
1053 0x000126dc,0x0001b724,0x0001b92d,0x0001b724},
1054 {0x00000000,0x00000000,0x00009492,0x000124db,
1055 0x000126dc,0x0001b925,0x0001b92d,0x0001b925},
1056 {0x00000000,0x00000000,0x0000a492,0x000126db,
1057 0x000136e4,0x0002496d,0x0001c96e,0x0001c92d},
1058 {0x00000000,0x00000000,0x00000000,0x00000000,
1059 0x00000000,0x00000000,0x00000000,0x00000000}
1060 },
1061 { /* version 10, passes 1 */
1062 {0x00000000,0x00000000,0x00000249,0x00000249,
1063 0x00000049,0x00000049,0x00000049,0x00000049},
1064 {0x00000000,0x00000000,0x00001249,0x00001249,
1065 0x0000124a,0x00000249,0x00000049,0x00000049},
1066 {0x00000000,0x00000000,0x00001249,0x00001249,
1067 0x0000124a,0x00009252,0x0000024a,0x00000049},
1068 {0x00000000,0x00000000,0x00001249,0x00001249,
1069 0x00009252,0x00009493,0x0000024a,0x0000024a},
1070 {0x00000000,0x00000000,0x00001249,0x00009252,
1071 0x00009492,0x00009493,0x00001252,0x0000024a},
1072 {0x00000000,0x00000000,0x00001249,0x00009292,
1073 0x00009492,0x00009493,0x00001252,0x00001252},
1074 {0x00000000,0x00000000,0x0000924a,0x00009493,
1075 0x00009492,0x00009493,0x00009292,0x00001252},
1076 {0x00000000,0x00000000,0x0000924a,0x00009493,
1077 0x0000a493,0x00009493,0x00009292,0x00009292},
1078 {0x00000000,0x00000000,0x0000924a,0x00009493,
1079 0x0000a493,0x0000a49b,0x00009493,0x00009292},
1080 {0x00000000,0x00000000,0x0000924a,0x00009493,
1081 0x0000a493,0x0000a49b,0x00009493,0x00009292},
1082 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1083 0x0000a493,0x000124db,0x0000a49b,0x00009493},
1084 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1085 0x0000a493,0x000124db,0x0000a49b,0x00009493},
1086 {0x00000000,0x00000000,0x0000924a,0x000124db,
1087 0x000136e4,0x000126dc,0x000124db,0x0000a49b},
1088 {0x00000000,0x00000000,0x0000924a,0x000124db,
1089 0x000136e4,0x000126dc,0x000124db,0x0000a49b},
1090 {0x00000000,0x00000000,0x00009252,0x000126db,
1091 0x0001b724,0x000136e4,0x000126dc,0x000124db},
1092 {0x00000000,0x00000000,0x00000000,0x00000000,
1093 0x00000000,0x00000000,0x00000000,0x00000000}
1094 }
1095 },
1096 { /* version 11 */
1097 { /* version 11, passes 0 */
1098 {0x00000000,0x00000000,0x00000249,0x00000249,
1099 0x00000249,0x00000249,0x00001252,0x00001252},
1100 {0x00000000,0x00000000,0x00001249,0x00001249,
1101 0x00009252,0x00009292,0x00009292,0x00001252},
1102 {0x00000000,0x00000000,0x00001249,0x0000924a,
1103 0x00009492,0x0000a49b,0x0000a49b,0x00009292},
1104 {0x00000000,0x00000000,0x00001249,0x00009493,
1105 0x0000a493,0x0000a49b,0x000124db,0x00009493},
1106 {0x00000000,0x00000000,0x00001249,0x00009493,
1107 0x0000a493,0x000124db,0x000126dc,0x00009493},
1108 {0x00000000,0x00000000,0x0000924a,0x00009493,
1109 0x0000a493,0x000126dc,0x000126dc,0x0000a49b},
1110 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1111 0x0001249b,0x000126dc,0x000136e4,0x000124db},
1112 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1113 0x000126dc,0x000136e4,0x000136e4,0x000126dc},
1114 {0x00000000,0x00000000,0x00009292,0x0000a49b,
1115 0x000126dc,0x000136e4,0x000136e4,0x000126dc},
1116 {0x00000000,0x00000000,0x00009292,0x0000a49b,
1117 0x000126dc,0x0001b724,0x0001b725,0x000136e4},
1118 {0x00000000,0x00000000,0x00009292,0x0000a49b,
1119 0x000136e4,0x0001b724,0x0001b92d,0x0001b724},
1120 {0x00000000,0x00000000,0x00009492,0x0000a49b,
1121 0x000136e4,0x0001b724,0x0001b92d,0x0001b724},
1122 {0x00000000,0x00000000,0x00009492,0x000124db,
1123 0x000136e4,0x0001b925,0x0001c96e,0x0001b925},
1124 {0x00000000,0x00000000,0x00009492,0x000124db,
1125 0x0001b724,0x0001b925,0x0001c96e,0x0001c92d},
1126 {0x00000000,0x00000000,0x0000a492,0x000126db,
1127 0x0001c924,0x0002496d,0x00025bb6,0x00024b77},
1128 {0x00000000,0x00000000,0x00000000,0x00000000,
1129 0x00000000,0x00000000,0x00000000,0x00000000}
1130 },
1131 { /* version 11, passes 1 */
1132 {0x00000000,0x00000000,0x00001249,0x00000249,
1133 0x00000249,0x00000249,0x0000024a,0x0000024a},
1134 {0x00000000,0x00000000,0x00001249,0x00001249,
1135 0x0000124a,0x0000124a,0x0000024a,0x0000024a},
1136 {0x00000000,0x00000000,0x00001249,0x0000924a,
1137 0x00009252,0x00009252,0x0000024a,0x0000024a},
1138 {0x00000000,0x00000000,0x00001249,0x00009292,
1139 0x00009492,0x0000a49b,0x00001252,0x00001252},
1140 {0x00000000,0x00000000,0x0000924a,0x00009493,
1141 0x0000a493,0x0000a49b,0x00001252,0x00001252},
1142 {0x00000000,0x00000000,0x0000924a,0x00009493,
1143 0x0000a493,0x0000a49b,0x00009292,0x00001252},
1144 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1145 0x0000a493,0x0000a49b,0x00009292,0x00009292},
1146 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1147 0x0000a493,0x0000a49b,0x00009493,0x00009292},
1148 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1149 0x0001249b,0x000124db,0x00009493,0x00009292},
1150 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1151 0x0001249b,0x000124db,0x00009493,0x00009493},
1152 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1153 0x000124db,0x000124db,0x0000a49b,0x00009493},
1154 {0x00000000,0x00000000,0x0000924a,0x000124db,
1155 0x000126dc,0x000126dc,0x0000a49b,0x00009493},
1156 {0x00000000,0x00000000,0x0000924a,0x000124db,
1157 0x000136e4,0x000126dc,0x000124db,0x0000a49b},
1158 {0x00000000,0x00000000,0x00009292,0x000124db,
1159 0x000136e4,0x000126dc,0x000124db,0x0000a49b},
1160 {0x00000000,0x00000000,0x00009492,0x000126db,
1161 0x0001b724,0x000136e4,0x000126dc,0x000124db},
1162 {0x00000000,0x00000000,0x00000000,0x00000000,
1163 0x00000000,0x00000000,0x00000000,0x00000000}
1164 }
1165 },
1166 { /* version 12 */
1167 { /* version 12, passes 0 */
1168 {0x00000000,0x00000000,0x00001249,0x00001249,
1169 0x00009252,0x00009292,0x00009493,0x00009493},
1170 {0x00000000,0x00000000,0x00001249,0x00009292,
1171 0x0000a493,0x0000a49b,0x0000a49b,0x00009493},
1172 {0x00000000,0x00000000,0x00001249,0x00009493,
1173 0x0000a493,0x000124db,0x000124db,0x0000a49b},
1174 {0x00000000,0x00000000,0x0000924a,0x00009493,
1175 0x0000a493,0x000126dc,0x000126dc,0x0000a49b},
1176 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1177 0x0001249b,0x000126dc,0x000136e4,0x000124db},
1178 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1179 0x000126dc,0x000136e4,0x000136e4,0x000126dc},
1180 {0x00000000,0x00000000,0x00009292,0x0000a49b,
1181 0x000126dc,0x0001b724,0x0001b725,0x000126dc},
1182 {0x00000000,0x00000000,0x00009292,0x0000a49b,
1183 0x000136e4,0x0001b724,0x0001b92d,0x000136e4},
1184 {0x00000000,0x00000000,0x00009492,0x0000a49b,
1185 0x000136e4,0x0001b724,0x0001b92d,0x0001b724},
1186 {0x00000000,0x00000000,0x00009492,0x000124db,
1187 0x000136e4,0x0001b724,0x0001b92d,0x0001b724},
1188 {0x00000000,0x00000000,0x00009492,0x000124db,
1189 0x000136e4,0x0001b925,0x0001b92d,0x0001b925},
1190 {0x00000000,0x00000000,0x00009492,0x000124db,
1191 0x0001b724,0x0001b925,0x0001c96e,0x0001c92d},
1192 {0x00000000,0x00000000,0x0000a492,0x000124db,
1193 0x0001b724,0x0001c92d,0x0001c96e,0x0001c92d},
1194 {0x00000000,0x00000000,0x0000a492,0x000124db,
1195 0x0001b724,0x0001c92d,0x00024b76,0x0002496e},
1196 {0x00000000,0x00000000,0x00012492,0x000126db,
1197 0x0001c924,0x00024b6d,0x0002ddb6,0x00025bbf},
1198 {0x00000000,0x00000000,0x00000000,0x00000000,
1199 0x00000000,0x00000000,0x00000000,0x00000000}
1200 },
1201 { /* version 12, passes 1 */
1202 {0x00000000,0x00000000,0x00001249,0x00001249,
1203 0x0000124a,0x0000124a,0x00001252,0x00001252},
1204 {0x00000000,0x00000000,0x00001249,0x00009292,
1205 0x00009492,0x00009252,0x00001252,0x00001252},
1206 {0x00000000,0x00000000,0x0000924a,0x00009493,
1207 0x0000a493,0x00009292,0x00001252,0x00001252},
1208 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1209 0x0000a493,0x0000a49b,0x00009292,0x00009292},
1210 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1211 0x0000a493,0x0000a49b,0x00009292,0x00009292},
1212 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1213 0x0001249b,0x0000a49b,0x00009493,0x00009292},
1214 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1215 0x000124db,0x000124db,0x00009493,0x00009493},
1216 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1217 0x000124db,0x000124db,0x0000a49b,0x00009493},
1218 {0x00000000,0x00000000,0x0000924a,0x000124db,
1219 0x000126dc,0x000124db,0x0000a49b,0x00009493},
1220 {0x00000000,0x00000000,0x0000924a,0x000124db,
1221 0x000126dc,0x000126dc,0x0000a49b,0x0000a49b},
1222 {0x00000000,0x00000000,0x0000924a,0x000124db,
1223 0x000136e4,0x000126dc,0x000124db,0x0000a49b},
1224 {0x00000000,0x00000000,0x00009492,0x000126db,
1225 0x000136e4,0x000126dc,0x000124db,0x0000a49b},
1226 {0x00000000,0x00000000,0x00009492,0x000126db,
1227 0x0001b724,0x000136e4,0x000126dc,0x000124db},
1228 {0x00000000,0x00000000,0x00009492,0x000126db,
1229 0x0001b724,0x000136e4,0x000126dc,0x000124db},
1230 {0x00000000,0x00000000,0x0000a492,0x000136db,
1231 0x0001c924,0x0001b724,0x000136e4,0x000126dc},
1232 {0x00000000,0x00000000,0x00000000,0x00000000,
1233 0x00000000,0x00000000,0x00000000,0x00000000}
1234 }
1235 },
1236 { /* version 13 */
1237 { /* version 13, passes 0 */
1238 {0x00000000,0x00000000,0x00001249,0x00001249,
1239 0x00009252,0x00009292,0x00009493,0x00009493},
1240 {0x00000000,0x00000000,0x00001249,0x00009493,
1241 0x0000a493,0x000124db,0x000126dc,0x00009493},
1242 {0x00000000,0x00000000,0x00001249,0x0000a49b,
1243 0x0001249b,0x000126dc,0x000126dc,0x0000a49b},
1244 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1245 0x0001249b,0x000126dc,0x000136e4,0x0000a49b},
1246 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1247 0x000126dc,0x000136e4,0x0001b725,0x000124db},
1248 {0x00000000,0x00000000,0x00009292,0x0000a49b,
1249 0x000136e4,0x0001b724,0x0001b725,0x000126dc},
1250 {0x00000000,0x00000000,0x00009292,0x000124db,
1251 0x000136e4,0x0001b724,0x0001b725,0x000126dc},
1252 {0x00000000,0x00000000,0x00009492,0x000124db,
1253 0x000136e4,0x0001b724,0x0001c96e,0x000136e4},
1254 {0x00000000,0x00000000,0x00009492,0x000124db,
1255 0x000136e4,0x0001c92d,0x0001c96e,0x0001b724},
1256 {0x00000000,0x00000000,0x0000a492,0x000124db,
1257 0x000136e4,0x0001c92d,0x0001c96e,0x0001b724},
1258 {0x00000000,0x00000000,0x0000a492,0x000124db,
1259 0x0001b724,0x0001c92d,0x0001c96e,0x0001b925},
1260 {0x00000000,0x00000000,0x0000a492,0x000126db,
1261 0x0001b724,0x0001c92d,0x00024b76,0x0001c92d},
1262 {0x00000000,0x00000000,0x0000a492,0x000126db,
1263 0x0001b924,0x0001c92d,0x00024b76,0x0001c92d},
1264 {0x00000000,0x00000000,0x0000a492,0x000126db,
1265 0x0001b924,0x0001c92d,0x00024b76,0x0002496e},
1266 {0x00000000,0x00000000,0x00012492,0x000136db,
1267 0x00024924,0x00024b6d,0x0002ddb6,0x00025bbf},
1268 {0x00000000,0x00000000,0x00000000,0x00000000,
1269 0x00000000,0x00000000,0x00000000,0x00000000}
1270 },
1271 { /* version 13, passes 1 */
1272 {0x00000000,0x00000000,0x00001249,0x00001249,
1273 0x0000124a,0x0000124a,0x00001252,0x00001252},
1274 {0x00000000,0x00000000,0x0000924a,0x00009493,
1275 0x00009492,0x00009292,0x00001252,0x00001252},
1276 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1277 0x0000a493,0x0000a49b,0x00001252,0x00001252},
1278 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1279 0x0000a493,0x0000a49b,0x00009292,0x00009292},
1280 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1281 0x0000a493,0x0000a49b,0x00009292,0x00009292},
1282 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1283 0x000126dc,0x0000a49b,0x00009493,0x00009292},
1284 {0x00000000,0x00000000,0x0000924a,0x000124db,
1285 0x000126dc,0x000124db,0x00009493,0x00009493},
1286 {0x00000000,0x00000000,0x0000924a,0x000124db,
1287 0x000136e4,0x000124db,0x0000a49b,0x00009493},
1288 {0x00000000,0x00000000,0x0000924a,0x000136db,
1289 0x0001b724,0x000124db,0x0000a49b,0x00009493},
1290 {0x00000000,0x00000000,0x0000924a,0x000136db,
1291 0x0001b724,0x000126dc,0x0000a49b,0x0000a49b},
1292 {0x00000000,0x00000000,0x00009292,0x000136db,
1293 0x0001b724,0x000126dc,0x000124db,0x0000a49b},
1294 {0x00000000,0x00000000,0x00009492,0x000136db,
1295 0x0001b724,0x000126dc,0x000124db,0x0000a49b},
1296 {0x00000000,0x00000000,0x0000a492,0x000136db,
1297 0x0001b724,0x000136e4,0x000126dc,0x000124db},
1298 {0x00000000,0x00000000,0x0000a492,0x000136db,
1299 0x0001b724,0x000136e4,0x000126dc,0x000124db},
1300 {0x00000000,0x00000000,0x00012492,0x0001b6db,
1301 0x0001c924,0x0001b724,0x000136e4,0x000126dc},
1302 {0x00000000,0x00000000,0x00000000,0x00000000,
1303 0x00000000,0x00000000,0x00000000,0x00000000}
1304 }
1305 },
1306 { /* version 14 */
1307 { /* version 14, passes 0 */
1308 {0x00000000,0x00000000,0x00001249,0x0000924a,
1309 0x00009292,0x00009493,0x00009493,0x00009493},
1310 {0x00000000,0x00000000,0x00001249,0x0000a49b,
1311 0x0000a493,0x000124db,0x000126dc,0x00009493},
1312 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1313 0x0001249b,0x000126dc,0x000136e4,0x0000a49b},
1314 {0x00000000,0x00000000,0x0000924a,0x000124db,
1315 0x000126dc,0x000136e4,0x0001b725,0x000124db},
1316 {0x00000000,0x00000000,0x00009292,0x000124db,
1317 0x000126dc,0x0001b724,0x0001b92d,0x000126dc},
1318 {0x00000000,0x00000000,0x00009492,0x000124db,
1319 0x000136e4,0x0001b724,0x0001b92d,0x000126dc},
1320 {0x00000000,0x00000000,0x00009492,0x000124db,
1321 0x000136e4,0x0001c92d,0x0001c96e,0x000136e4},
1322 {0x00000000,0x00000000,0x00009492,0x000124db,
1323 0x0001b724,0x0001c92d,0x0001c96e,0x0001b724},
1324 {0x00000000,0x00000000,0x0000a492,0x000124db,
1325 0x0001b724,0x0001c92d,0x00024b76,0x0001b925},
1326 {0x00000000,0x00000000,0x0000a492,0x000126db,
1327 0x0001b724,0x0001c92d,0x00024b76,0x0001c92d},
1328 {0x00000000,0x00000000,0x0000a492,0x000126db,
1329 0x0001b724,0x0001c92d,0x00024b76,0x0001c92d},
1330 {0x00000000,0x00000000,0x0000a492,0x000136db,
1331 0x0001b724,0x0001c92d,0x00024b76,0x0002496e},
1332 {0x00000000,0x00000000,0x0000a492,0x000136db,
1333 0x0001b924,0x0002496d,0x00024b76,0x00024b77},
1334 {0x00000000,0x00000000,0x0000a492,0x000136db,
1335 0x0001b924,0x00024b6d,0x0002ddb6,0x00025bbf},
1336 {0x00000000,0x00000000,0x00012492,0x0001b6db,
1337 0x00024924,0x0002db6d,0x00036db6,0x0002efff},
1338 {0x00000000,0x00000000,0x00000000,0x00000000,
1339 0x00000000,0x00000000,0x00000000,0x00000000}
1340 },
1341 { /* version 14, passes 1 */
1342 {0x00000000,0x00000000,0x00001249,0x00001249,
1343 0x0000124a,0x0000124a,0x00001252,0x00001252},
1344 {0x00000000,0x00000000,0x0000924a,0x00009493,
1345 0x0000a493,0x00009292,0x00001252,0x00001252},
1346 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1347 0x0000a493,0x0000a49b,0x00001252,0x00001252},
1348 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1349 0x0001249b,0x000136e4,0x00009292,0x00009292},
1350 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1351 0x0001249b,0x000136e4,0x00009292,0x00009292},
1352 {0x00000000,0x00000000,0x0000924a,0x000124db,
1353 0x000136e4,0x000136e4,0x00009493,0x00009292},
1354 {0x00000000,0x00000000,0x00009492,0x000136db,
1355 0x0001b724,0x000136e4,0x00009493,0x00009493},
1356 {0x00000000,0x00000000,0x00009492,0x000136db,
1357 0x0001b724,0x000136e4,0x0000a49b,0x00009493},
1358 {0x00000000,0x00000000,0x00009492,0x000136db,
1359 0x0001b724,0x000136e4,0x0000a49b,0x00009493},
1360 {0x00000000,0x00000000,0x00009492,0x000136db,
1361 0x0001b724,0x000136e4,0x0000a49b,0x0000a49b},
1362 {0x00000000,0x00000000,0x0000a492,0x000136db,
1363 0x0001b724,0x000136e4,0x000124db,0x0000a49b},
1364 {0x00000000,0x00000000,0x0000a492,0x000136db,
1365 0x0001b724,0x000136e4,0x000124db,0x0000a49b},
1366 {0x00000000,0x00000000,0x0000a492,0x000136db,
1367 0x0001b724,0x000136e4,0x000126dc,0x000124db},
1368 {0x00000000,0x00000000,0x0000a492,0x000136db,
1369 0x0001b724,0x000136e4,0x000126dc,0x000124db},
1370 {0x00000000,0x00000000,0x00012492,0x0001b6db,
1371 0x0001c924,0x0001b724,0x000136e4,0x000126dc},
1372 {0x00000000,0x00000000,0x00000000,0x00000000,
1373 0x00000000,0x00000000,0x00000000,0x00000000}
1374 }
1375 },
1376 { /* version 15 */
1377 { /* version 15, passes 0 */
1378 {0x00000000,0x00000000,0x00001249,0x00009493,
1379 0x0000a493,0x0000a49b,0x000124db,0x000124db},
1380 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1381 0x0001249b,0x000126dc,0x000136e4,0x000124db},
1382 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1383 0x000126dc,0x0001b724,0x0001b725,0x000126dc},
1384 {0x00000000,0x00000000,0x0000924a,0x000124db,
1385 0x000136e4,0x0001b724,0x0001b92d,0x000126dc},
1386 {0x00000000,0x00000000,0x00009492,0x000124db,
1387 0x000136e4,0x0001b925,0x0001c96e,0x000136e4},
1388 {0x00000000,0x00000000,0x00009492,0x000124db,
1389 0x0001b724,0x0001c92d,0x0001c96e,0x0001b724},
1390 {0x00000000,0x00000000,0x0000a492,0x000124db,
1391 0x0001b724,0x0001c92d,0x0001c96e,0x0001b724},
1392 {0x00000000,0x00000000,0x0000a492,0x000126db,
1393 0x0001b724,0x0001c92d,0x0001c96e,0x0001b925},
1394 {0x00000000,0x00000000,0x0000a492,0x000126db,
1395 0x0001b924,0x0001c92d,0x00024b76,0x0001c92d},
1396 {0x00000000,0x00000000,0x0000a492,0x000136db,
1397 0x0001b924,0x0001c92d,0x00024b76,0x0001c92d},
1398 {0x00000000,0x00000000,0x0000a492,0x000136db,
1399 0x0001b924,0x0002496d,0x00024b76,0x0002496e},
1400 {0x00000000,0x00000000,0x0000a492,0x000136db,
1401 0x0001c924,0x0002496d,0x00025bb6,0x00024b77},
1402 {0x00000000,0x00000000,0x0000a492,0x000136db,
1403 0x0001c924,0x00024b6d,0x00025bb6,0x00024b77},
1404 {0x00000000,0x00000000,0x00012492,0x000136db,
1405 0x0001c924,0x00024b6d,0x0002ddb6,0x00025bbf},
1406 {0x00000000,0x00000000,0x00012492,0x0001b6db,
1407 0x00024924,0x0002db6d,0x00036db6,0x0002efff},
1408 {0x00000000,0x00000000,0x00000000,0x00000000,
1409 0x00000000,0x00000000,0x00000000,0x00000000}
1410 },
1411 { /* version 15, passes 1 */
1412 {0x00000000,0x00000000,0x0000924a,0x0000924a,
1413 0x00009292,0x00009292,0x00009292,0x00009292},
1414 {0x00000000,0x00000000,0x0000924a,0x0000a49b,
1415 0x0000a493,0x000124db,0x00009292,0x00009292},
1416 {0x00000000,0x00000000,0x0000924a,0x000124db,
1417 0x000124db,0x0001b724,0x00009493,0x00009493},
1418 {0x00000000,0x00000000,0x0000924a,0x000124db,
1419 0x000126dc,0x0001b724,0x00009493,0x00009493},
1420 {0x00000000,0x00000000,0x0000924a,0x000124db,
1421 0x000136e4,0x0001b724,0x0000a49b,0x0000a49b},
1422 {0x00000000,0x00000000,0x00009292,0x000136db,
1423 0x0001b724,0x0001b724,0x0000a49b,0x0000a49b},
1424 {0x00000000,0x00000000,0x00009492,0x000136db,
1425 0x0001c924,0x0001b724,0x000124db,0x000124db},
1426 {0x00000000,0x00000000,0x00009492,0x000136db,
1427 0x0001c924,0x0001b724,0x000124db,0x000124db},
1428 {0x00000000,0x00000000,0x0000a492,0x000136db,
1429 0x0001c924,0x0001b724,0x000126dc,0x000126dc},
1430 {0x00000000,0x00000000,0x0000a492,0x000136db,
1431 0x0001c924,0x0001b925,0x000126dc,0x000126dc},
1432 {0x00000000,0x00000000,0x0000a492,0x000136db,
1433 0x0001c924,0x0001b925,0x000136e4,0x000136e4},
1434 {0x00000000,0x00000000,0x0000a492,0x000136db,
1435 0x0001c924,0x0001b925,0x000136e4,0x000136e4},
1436 {0x00000000,0x00000000,0x0000a492,0x000136db,
1437 0x0001c924,0x0001b925,0x0001b725,0x0001b724},
1438 {0x00000000,0x00000000,0x00012492,0x000136db,
1439 0x0001c924,0x0001b925,0x0001b725,0x0001b724},
1440 {0x00000000,0x00000000,0x00012492,0x0001b6db,
1441 0x00024924,0x0002496d,0x0001b92d,0x0001b925},
1442 {0x00000000,0x00000000,0x00000000,0x00000000,
1443 0x00000000,0x00000000,0x00000000,0x00000000}
1444 }
1445 }
1446};
diff --git a/drivers/usb/media/pwc/pwc-uncompress.c b/drivers/usb/media/pwc/pwc-uncompress.c
index c062e43b3ac5..bc3b1635eab0 100644
--- a/drivers/usb/media/pwc/pwc-uncompress.c
+++ b/drivers/usb/media/pwc/pwc-uncompress.c
@@ -29,8 +29,6 @@
29 29
30#include "pwc.h" 30#include "pwc.h"
31#include "pwc-uncompress.h" 31#include "pwc-uncompress.h"
32#include "pwc-dec1.h"
33#include "pwc-dec23.h"
34 32
35int pwc_decompress(struct pwc_device *pdev) 33int pwc_decompress(struct pwc_device *pdev)
36{ 34{
@@ -122,6 +120,7 @@ int pwc_decompress(struct pwc_device *pdev)
122 120
123 switch (pdev->type) 121 switch (pdev->type)
124 { 122 {
123#if 0
125 case 675: 124 case 675:
126 case 680: 125 case 680:
127 case 690: 126 case 690:
@@ -137,6 +136,7 @@ int pwc_decompress(struct pwc_device *pdev)
137 case 645: 136 case 645:
138 case 646: 137 case 646:
139 /* TODO & FIXME */ 138 /* TODO & FIXME */
139#endif
140 return -ENXIO; /* No such device or address: missing decompressor */ 140 return -ENXIO; /* No such device or address: missing decompressor */
141 break; 141 break;
142 } 142 }
diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c
index 626e2b05f719..b33044d56a1e 100644
--- a/drivers/usb/misc/cytherm.c
+++ b/drivers/usb/misc/cytherm.c
@@ -85,7 +85,7 @@ static int vendor_command(struct usb_device *dev, unsigned char request,
85#define BRIGHTNESS 0x2c /* RAM location for brightness value */ 85#define BRIGHTNESS 0x2c /* RAM location for brightness value */
86#define BRIGHTNESS_SEM 0x2b /* RAM location for brightness semaphore */ 86#define BRIGHTNESS_SEM 0x2b /* RAM location for brightness semaphore */
87 87
88static ssize_t show_brightness(struct device *dev, char *buf) 88static ssize_t show_brightness(struct device *dev, struct device_attribute *attr, char *buf)
89{ 89{
90 struct usb_interface *intf = to_usb_interface(dev); 90 struct usb_interface *intf = to_usb_interface(dev);
91 struct usb_cytherm *cytherm = usb_get_intfdata(intf); 91 struct usb_cytherm *cytherm = usb_get_intfdata(intf);
@@ -93,7 +93,7 @@ static ssize_t show_brightness(struct device *dev, char *buf)
93 return sprintf(buf, "%i", cytherm->brightness); 93 return sprintf(buf, "%i", cytherm->brightness);
94} 94}
95 95
96static ssize_t set_brightness(struct device *dev, const char *buf, 96static ssize_t set_brightness(struct device *dev, struct device_attribute *attr, const char *buf,
97 size_t count) 97 size_t count)
98{ 98{
99 struct usb_interface *intf = to_usb_interface(dev); 99 struct usb_interface *intf = to_usb_interface(dev);
@@ -138,7 +138,7 @@ static DEVICE_ATTR(brightness, S_IRUGO | S_IWUSR | S_IWGRP,
138#define TEMP 0x33 /* RAM location for temperature */ 138#define TEMP 0x33 /* RAM location for temperature */
139#define SIGN 0x34 /* RAM location for temperature sign */ 139#define SIGN 0x34 /* RAM location for temperature sign */
140 140
141static ssize_t show_temp(struct device *dev, char *buf) 141static ssize_t show_temp(struct device *dev, struct device_attribute *attr, char *buf)
142{ 142{
143 143
144 struct usb_interface *intf = to_usb_interface(dev); 144 struct usb_interface *intf = to_usb_interface(dev);
@@ -174,7 +174,7 @@ static ssize_t show_temp(struct device *dev, char *buf)
174} 174}
175 175
176 176
177static ssize_t set_temp(struct device *dev, const char *buf, size_t count) 177static ssize_t set_temp(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
178{ 178{
179 return count; 179 return count;
180} 180}
@@ -184,7 +184,7 @@ static DEVICE_ATTR(temp, S_IRUGO, show_temp, set_temp);
184 184
185#define BUTTON 0x7a 185#define BUTTON 0x7a
186 186
187static ssize_t show_button(struct device *dev, char *buf) 187static ssize_t show_button(struct device *dev, struct device_attribute *attr, char *buf)
188{ 188{
189 189
190 struct usb_interface *intf = to_usb_interface(dev); 190 struct usb_interface *intf = to_usb_interface(dev);
@@ -215,7 +215,7 @@ static ssize_t show_button(struct device *dev, char *buf)
215} 215}
216 216
217 217
218static ssize_t set_button(struct device *dev, const char *buf, size_t count) 218static ssize_t set_button(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
219{ 219{
220 return count; 220 return count;
221} 221}
@@ -223,7 +223,7 @@ static ssize_t set_button(struct device *dev, const char *buf, size_t count)
223static DEVICE_ATTR(button, S_IRUGO, show_button, set_button); 223static DEVICE_ATTR(button, S_IRUGO, show_button, set_button);
224 224
225 225
226static ssize_t show_port0(struct device *dev, char *buf) 226static ssize_t show_port0(struct device *dev, struct device_attribute *attr, char *buf)
227{ 227{
228 struct usb_interface *intf = to_usb_interface(dev); 228 struct usb_interface *intf = to_usb_interface(dev);
229 struct usb_cytherm *cytherm = usb_get_intfdata(intf); 229 struct usb_cytherm *cytherm = usb_get_intfdata(intf);
@@ -249,7 +249,7 @@ static ssize_t show_port0(struct device *dev, char *buf)
249} 249}
250 250
251 251
252static ssize_t set_port0(struct device *dev, const char *buf, size_t count) 252static ssize_t set_port0(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
253{ 253{
254 struct usb_interface *intf = to_usb_interface(dev); 254 struct usb_interface *intf = to_usb_interface(dev);
255 struct usb_cytherm *cytherm = usb_get_intfdata(intf); 255 struct usb_cytherm *cytherm = usb_get_intfdata(intf);
@@ -283,7 +283,7 @@ static ssize_t set_port0(struct device *dev, const char *buf, size_t count)
283 283
284static DEVICE_ATTR(port0, S_IRUGO | S_IWUSR | S_IWGRP, show_port0, set_port0); 284static DEVICE_ATTR(port0, S_IRUGO | S_IWUSR | S_IWGRP, show_port0, set_port0);
285 285
286static ssize_t show_port1(struct device *dev, char *buf) 286static ssize_t show_port1(struct device *dev, struct device_attribute *attr, char *buf)
287{ 287{
288 struct usb_interface *intf = to_usb_interface(dev); 288 struct usb_interface *intf = to_usb_interface(dev);
289 struct usb_cytherm *cytherm = usb_get_intfdata(intf); 289 struct usb_cytherm *cytherm = usb_get_intfdata(intf);
@@ -309,7 +309,7 @@ static ssize_t show_port1(struct device *dev, char *buf)
309} 309}
310 310
311 311
312static ssize_t set_port1(struct device *dev, const char *buf, size_t count) 312static ssize_t set_port1(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
313{ 313{
314 struct usb_interface *intf = to_usb_interface(dev); 314 struct usb_interface *intf = to_usb_interface(dev);
315 struct usb_cytherm *cytherm = usb_get_intfdata(intf); 315 struct usb_cytherm *cytherm = usb_get_intfdata(intf);
diff --git a/drivers/usb/misc/phidgetkit.c b/drivers/usb/misc/phidgetkit.c
index ddbf8e992368..067a81486921 100644
--- a/drivers/usb/misc/phidgetkit.c
+++ b/drivers/usb/misc/phidgetkit.c
@@ -173,7 +173,7 @@ exit:
173} 173}
174 174
175#define set_lcd_line(number) \ 175#define set_lcd_line(number) \
176static ssize_t lcd_line_##number(struct device *dev, const char *buf, size_t count) \ 176static ssize_t lcd_line_##number(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
177{ \ 177{ \
178 struct usb_interface *intf = to_usb_interface(dev); \ 178 struct usb_interface *intf = to_usb_interface(dev); \
179 struct phidget_interfacekit *kit = usb_get_intfdata(intf); \ 179 struct phidget_interfacekit *kit = usb_get_intfdata(intf); \
@@ -184,7 +184,7 @@ static DEVICE_ATTR(lcd_line_##number, S_IWUGO, NULL, lcd_line_##number);
184set_lcd_line(1); 184set_lcd_line(1);
185set_lcd_line(2); 185set_lcd_line(2);
186 186
187static ssize_t set_backlight(struct device *dev, const char *buf, size_t count) 187static ssize_t set_backlight(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
188{ 188{
189 struct usb_interface *intf = to_usb_interface(dev); 189 struct usb_interface *intf = to_usb_interface(dev);
190 struct phidget_interfacekit *kit = usb_get_intfdata(intf); 190 struct phidget_interfacekit *kit = usb_get_intfdata(intf);
@@ -232,7 +232,7 @@ static void remove_lcd_files(struct phidget_interfacekit *kit)
232 } 232 }
233} 233}
234 234
235static ssize_t enable_lcd_files(struct device *dev, const char *buf, size_t count) 235static ssize_t enable_lcd_files(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
236{ 236{
237 struct usb_interface *intf = to_usb_interface(dev); 237 struct usb_interface *intf = to_usb_interface(dev);
238 struct phidget_interfacekit *kit = usb_get_intfdata(intf); 238 struct phidget_interfacekit *kit = usb_get_intfdata(intf);
@@ -307,7 +307,7 @@ resubmit:
307} 307}
308 308
309#define show_set_output(value) \ 309#define show_set_output(value) \
310static ssize_t set_output##value(struct device *dev, const char *buf, \ 310static ssize_t set_output##value(struct device *dev, struct device_attribute *attr, const char *buf, \
311 size_t count) \ 311 size_t count) \
312{ \ 312{ \
313 struct usb_interface *intf = to_usb_interface(dev); \ 313 struct usb_interface *intf = to_usb_interface(dev); \
@@ -324,7 +324,7 @@ static ssize_t set_output##value(struct device *dev, const char *buf, \
324 return retval ? retval : count; \ 324 return retval ? retval : count; \
325} \ 325} \
326 \ 326 \
327static ssize_t show_output##value(struct device *dev, char *buf) \ 327static ssize_t show_output##value(struct device *dev, struct device_attribute *attr, char *buf) \
328{ \ 328{ \
329 struct usb_interface *intf = to_usb_interface(dev); \ 329 struct usb_interface *intf = to_usb_interface(dev); \
330 struct phidget_interfacekit *kit = usb_get_intfdata(intf); \ 330 struct phidget_interfacekit *kit = usb_get_intfdata(intf); \
@@ -343,7 +343,7 @@ show_set_output(7);
343show_set_output(8); /* should be MAX_INTERFACES - 1 */ 343show_set_output(8); /* should be MAX_INTERFACES - 1 */
344 344
345#define show_input(value) \ 345#define show_input(value) \
346static ssize_t show_input##value(struct device *dev, char *buf) \ 346static ssize_t show_input##value(struct device *dev, struct device_attribute *attr, char *buf) \
347{ \ 347{ \
348 struct usb_interface *intf = to_usb_interface(dev); \ 348 struct usb_interface *intf = to_usb_interface(dev); \
349 struct phidget_interfacekit *kit = usb_get_intfdata(intf); \ 349 struct phidget_interfacekit *kit = usb_get_intfdata(intf); \
@@ -362,7 +362,7 @@ show_input(7);
362show_input(8); /* should be MAX_INTERFACES - 1 */ 362show_input(8); /* should be MAX_INTERFACES - 1 */
363 363
364#define show_sensor(value) \ 364#define show_sensor(value) \
365static ssize_t show_sensor##value(struct device *dev, char *buf) \ 365static ssize_t show_sensor##value(struct device *dev, struct device_attribute *attr, char *buf) \
366{ \ 366{ \
367 struct usb_interface *intf = to_usb_interface(dev); \ 367 struct usb_interface *intf = to_usb_interface(dev); \
368 struct phidget_interfacekit *kit = usb_get_intfdata(intf); \ 368 struct phidget_interfacekit *kit = usb_get_intfdata(intf); \
diff --git a/drivers/usb/misc/phidgetservo.c b/drivers/usb/misc/phidgetservo.c
index 4bd291502a3c..b84eda631ab5 100644
--- a/drivers/usb/misc/phidgetservo.c
+++ b/drivers/usb/misc/phidgetservo.c
@@ -207,7 +207,7 @@ change_position_v20(struct phidget_servo *servo, int servo_no, int degrees,
207} 207}
208 208
209#define show_set(value) \ 209#define show_set(value) \
210static ssize_t set_servo##value (struct device *dev, \ 210static ssize_t set_servo##value (struct device *dev, struct device_attribute *attr, \
211 const char *buf, size_t count) \ 211 const char *buf, size_t count) \
212{ \ 212{ \
213 int degrees, minutes, retval; \ 213 int degrees, minutes, retval; \
@@ -233,7 +233,7 @@ static ssize_t set_servo##value (struct device *dev, \
233 return retval < 0 ? retval : count; \ 233 return retval < 0 ? retval : count; \
234} \ 234} \
235 \ 235 \
236static ssize_t show_servo##value (struct device *dev, char *buf) \ 236static ssize_t show_servo##value (struct device *dev, struct device_attribute *attr, char *buf) \
237{ \ 237{ \
238 struct usb_interface *intf = to_usb_interface (dev); \ 238 struct usb_interface *intf = to_usb_interface (dev); \
239 struct phidget_servo *servo = usb_get_intfdata (intf); \ 239 struct phidget_servo *servo = usb_get_intfdata (intf); \
diff --git a/drivers/usb/misc/usbled.c b/drivers/usb/misc/usbled.c
index ee329d5e1c5e..f6ba4c788dbc 100644
--- a/drivers/usb/misc/usbled.c
+++ b/drivers/usb/misc/usbled.c
@@ -81,14 +81,14 @@ static void change_color(struct usb_led *led)
81} 81}
82 82
83#define show_set(value) \ 83#define show_set(value) \
84static ssize_t show_##value(struct device *dev, char *buf) \ 84static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \
85{ \ 85{ \
86 struct usb_interface *intf = to_usb_interface(dev); \ 86 struct usb_interface *intf = to_usb_interface(dev); \
87 struct usb_led *led = usb_get_intfdata(intf); \ 87 struct usb_led *led = usb_get_intfdata(intf); \
88 \ 88 \
89 return sprintf(buf, "%d\n", led->value); \ 89 return sprintf(buf, "%d\n", led->value); \
90} \ 90} \
91static ssize_t set_##value(struct device *dev, const char *buf, size_t count) \ 91static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
92{ \ 92{ \
93 struct usb_interface *intf = to_usb_interface(dev); \ 93 struct usb_interface *intf = to_usb_interface(dev); \
94 struct usb_led *led = usb_get_intfdata(intf); \ 94 struct usb_led *led = usb_get_intfdata(intf); \
diff --git a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c
index a9a7cf4a38eb..fd6ff4cb2c62 100644
--- a/drivers/usb/net/kaweth.c
+++ b/drivers/usb/net/kaweth.c
@@ -520,7 +520,7 @@ static void int_callback(struct urb *u, struct pt_regs *regs)
520 520
521 /* we check the link state to report changes */ 521 /* we check the link state to report changes */
522 if (kaweth->linkstate != (act_state = ( kaweth->intbuffer[STATE_OFFSET] | STATE_MASK) >> STATE_SHIFT)) { 522 if (kaweth->linkstate != (act_state = ( kaweth->intbuffer[STATE_OFFSET] | STATE_MASK) >> STATE_SHIFT)) {
523 if (!act_state) 523 if (act_state)
524 netif_carrier_on(kaweth->net); 524 netif_carrier_on(kaweth->net);
525 else 525 else
526 netif_carrier_off(kaweth->net); 526 netif_carrier_off(kaweth->net);
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c
index 85476e76b244..4cbb408af727 100644
--- a/drivers/usb/net/usbnet.c
+++ b/drivers/usb/net/usbnet.c
@@ -2765,7 +2765,7 @@ static int blan_mdlm_bind (struct usbnet *dev, struct usb_interface *intf)
2765 } 2765 }
2766 /* expect bcdVersion 1.0, ignore */ 2766 /* expect bcdVersion 1.0, ignore */
2767 if (memcmp(&desc->bGUID, blan_guid, 16) 2767 if (memcmp(&desc->bGUID, blan_guid, 16)
2768 && memcmp(&desc->bGUID, blan_guid, 16) ) { 2768 && memcmp(&desc->bGUID, safe_guid, 16) ) {
2769 /* hey, this one might _really_ be MDLM! */ 2769 /* hey, this one might _really_ be MDLM! */
2770 dev_dbg (&intf->dev, "MDLM guid\n"); 2770 dev_dbg (&intf->dev, "MDLM guid\n");
2771 goto bad_desc; 2771 goto bad_desc;
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index bc798edf0358..9438909e87a5 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -455,6 +455,17 @@ config USB_SERIAL_XIRCOM
455 To compile this driver as a module, choose M here: the 455 To compile this driver as a module, choose M here: the
456 module will be called keyspan_pda. 456 module will be called keyspan_pda.
457 457
458config USB_SERIAL_OPTION
459 tristate "USB Option PCMCIA serial driver"
460 depends on USB_SERIAL && USB_OHCI_HCD && PCCARD
461 help
462 Say Y here if you want to use an Option card. This is a
463 GSM card, controlled by three serial ports which are connected
464 via an OHCI adapter located on a PC card.
465
466 To compile this driver as a module, choose M here: the
467 module will be called option.
468
458config USB_SERIAL_OMNINET 469config USB_SERIAL_OMNINET
459 tristate "USB ZyXEL omni.net LCD Plus Driver (EXPERIMENTAL)" 470 tristate "USB ZyXEL omni.net LCD Plus Driver (EXPERIMENTAL)"
460 depends on USB_SERIAL && EXPERIMENTAL 471 depends on USB_SERIAL && EXPERIMENTAL
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile
index d56ff6d86cce..6c7cdcc99a9e 100644
--- a/drivers/usb/serial/Makefile
+++ b/drivers/usb/serial/Makefile
@@ -32,6 +32,7 @@ obj-$(CONFIG_USB_SERIAL_KLSI) += kl5kusb105.o
32obj-$(CONFIG_USB_SERIAL_KOBIL_SCT) += kobil_sct.o 32obj-$(CONFIG_USB_SERIAL_KOBIL_SCT) += kobil_sct.o
33obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o 33obj-$(CONFIG_USB_SERIAL_MCT_U232) += mct_u232.o
34obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o 34obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o
35obj-$(CONFIG_USB_SERIAL_OPTION) += option.o
35obj-$(CONFIG_USB_SERIAL_PL2303) += pl2303.o 36obj-$(CONFIG_USB_SERIAL_PL2303) += pl2303.o
36obj-$(CONFIG_USB_SERIAL_SAFE) += safe_serial.o 37obj-$(CONFIG_USB_SERIAL_SAFE) += safe_serial.o
37obj-$(CONFIG_USB_SERIAL_TI) += ti_usb_3410_5052.o 38obj-$(CONFIG_USB_SERIAL_TI) += ti_usb_3410_5052.o
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c
index 7e9bb63eb466..4ace9964fc6b 100644
--- a/drivers/usb/serial/cp2101.c
+++ b/drivers/usb/serial/cp2101.c
@@ -7,6 +7,14 @@
7 * modify it under the terms of the GNU General Public License version 7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation. 8 * 2 as published by the Free Software Foundation.
9 * 9 *
10 * Support to set flow control line levels using TIOCMGET and TIOCMSET
11 * thanks to Karl Hiramoto karl@hiramoto.org. RTSCTS hardware flow
12 * control thanks to Munir Nassar nassarmu@real-time.com
13 *
14 * Outstanding Issues:
15 * Buffers are not flushed when the port is opened.
16 * Multiple calls to write() may fail with "Resource temporarily unavailable"
17 *
10 */ 18 */
11 19
12#include <linux/config.h> 20#include <linux/config.h>
@@ -24,7 +32,7 @@
24/* 32/*
25 * Version Information 33 * Version Information
26 */ 34 */
27#define DRIVER_VERSION "v0.03" 35#define DRIVER_VERSION "v0.04"
28#define DRIVER_DESC "Silicon Labs CP2101/CP2102 RS232 serial adaptor driver" 36#define DRIVER_DESC "Silicon Labs CP2101/CP2102 RS232 serial adaptor driver"
29 37
30/* 38/*
@@ -35,6 +43,9 @@ static void cp2101_cleanup(struct usb_serial_port*);
35static void cp2101_close(struct usb_serial_port*, struct file*); 43static void cp2101_close(struct usb_serial_port*, struct file*);
36static void cp2101_get_termios(struct usb_serial_port*); 44static void cp2101_get_termios(struct usb_serial_port*);
37static void cp2101_set_termios(struct usb_serial_port*, struct termios*); 45static void cp2101_set_termios(struct usb_serial_port*, struct termios*);
46static int cp2101_tiocmget (struct usb_serial_port *, struct file *);
47static int cp2101_tiocmset (struct usb_serial_port *, struct file *,
48 unsigned int, unsigned int);
38static void cp2101_break_ctl(struct usb_serial_port*, int); 49static void cp2101_break_ctl(struct usb_serial_port*, int);
39static int cp2101_startup (struct usb_serial *); 50static int cp2101_startup (struct usb_serial *);
40static void cp2101_shutdown(struct usb_serial*); 51static void cp2101_shutdown(struct usb_serial*);
@@ -43,9 +54,10 @@ static void cp2101_shutdown(struct usb_serial*);
43static int debug; 54static int debug;
44 55
45static struct usb_device_id id_table [] = { 56static struct usb_device_id id_table [] = {
46 {USB_DEVICE(0x10c4, 0xea60) }, /*Silicon labs factory default*/ 57 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
47 {USB_DEVICE(0x10ab, 0x10c5) }, /*Siemens MC60 Cable*/ 58 { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */
48 { } /* Terminating Entry*/ 59 { USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */
60 { } /* Terminating Entry */
49}; 61};
50 62
51MODULE_DEVICE_TABLE (usb, id_table); 63MODULE_DEVICE_TABLE (usb, id_table);
@@ -70,32 +82,35 @@ static struct usb_serial_device_type cp2101_device = {
70 .close = cp2101_close, 82 .close = cp2101_close,
71 .break_ctl = cp2101_break_ctl, 83 .break_ctl = cp2101_break_ctl,
72 .set_termios = cp2101_set_termios, 84 .set_termios = cp2101_set_termios,
85 .tiocmget = cp2101_tiocmget,
86 .tiocmset = cp2101_tiocmset,
73 .attach = cp2101_startup, 87 .attach = cp2101_startup,
74 .shutdown = cp2101_shutdown, 88 .shutdown = cp2101_shutdown,
75}; 89};
76 90
77/*Config request types*/ 91/* Config request types */
78#define REQTYPE_HOST_TO_DEVICE 0x41 92#define REQTYPE_HOST_TO_DEVICE 0x41
79#define REQTYPE_DEVICE_TO_HOST 0xc1 93#define REQTYPE_DEVICE_TO_HOST 0xc1
80 94
81/*Config SET requests. To GET, add 1 to the request number*/ 95/* Config SET requests. To GET, add 1 to the request number */
82#define CP2101_UART 0x00 /*Enable / Disable*/ 96#define CP2101_UART 0x00 /* Enable / Disable */
83#define CP2101_BAUDRATE 0x01 /*(BAUD_RATE_GEN_FREQ / baudrate)*/ 97#define CP2101_BAUDRATE 0x01 /* (BAUD_RATE_GEN_FREQ / baudrate) */
84#define CP2101_BITS 0x03 /*0x(0)(data bits)(parity)(stop bits)*/ 98#define CP2101_BITS 0x03 /* 0x(0)(databits)(parity)(stopbits) */
85#define CP2101_BREAK 0x05 /*On / Off*/ 99#define CP2101_BREAK 0x05 /* On / Off */
86#define CP2101_DTRRTS 0x07 /*101 / 202 ???*/ 100#define CP2101_CONTROL 0x07 /* Flow control line states */
87#define CP2101_CONFIG_16 0x13 /*16 bytes of config data ???*/ 101#define CP2101_MODEMCTL 0x13 /* Modem controls */
88#define CP2101_CONFIG_6 0x19 /*6 bytes of config data ???*/ 102#define CP2101_CONFIG_6 0x19 /* 6 bytes of config data ??? */
89 103
90/*CP2101_UART*/ 104/* CP2101_UART */
91#define UART_ENABLE 0x0001 105#define UART_ENABLE 0x0001
92#define UART_DISABLE 0x0000 106#define UART_DISABLE 0x0000
93 107
94/*CP2101_BAUDRATE*/ 108/* CP2101_BAUDRATE */
95#define BAUD_RATE_GEN_FREQ 0x384000 109#define BAUD_RATE_GEN_FREQ 0x384000
96 110
97/*CP2101_BITS*/ 111/* CP2101_BITS */
98#define BITS_DATA_MASK 0X0f00 112#define BITS_DATA_MASK 0X0f00
113#define BITS_DATA_5 0X0500
99#define BITS_DATA_6 0X0600 114#define BITS_DATA_6 0X0600
100#define BITS_DATA_7 0X0700 115#define BITS_DATA_7 0X0700
101#define BITS_DATA_8 0X0800 116#define BITS_DATA_8 0X0800
@@ -112,64 +127,137 @@ static struct usb_serial_device_type cp2101_device = {
112#define BITS_STOP_1 0x0000 127#define BITS_STOP_1 0x0000
113#define BITS_STOP_1_5 0x0001 128#define BITS_STOP_1_5 0x0001
114#define BITS_STOP_2 0x0002 129#define BITS_STOP_2 0x0002
130
131/* CP2101_BREAK */
115#define BREAK_ON 0x0000 132#define BREAK_ON 0x0000
116#define BREAK_OFF 0x0001 133#define BREAK_OFF 0x0001
117 134
135/* CP2101_CONTROL */
136#define CONTROL_DTR 0x0001
137#define CONTROL_RTS 0x0002
138#define CONTROL_CTS 0x0010
139#define CONTROL_DSR 0x0020
140#define CONTROL_RING 0x0040
141#define CONTROL_DCD 0x0080
142#define CONTROL_WRITE_DTR 0x0100
143#define CONTROL_WRITE_RTS 0x0200
118 144
119static int cp2101_get_config(struct usb_serial_port* port, u8 request) 145/*
146 * cp2101_get_config
147 * Reads from the CP2101 configuration registers
148 * 'size' is specified in bytes.
149 * 'data' is a pointer to a pre-allocated array of integers large
150 * enough to hold 'size' bytes (with 4 bytes to each integer)
151 */
152static int cp2101_get_config(struct usb_serial_port* port, u8 request,
153 unsigned int *data, int size)
120{ 154{
121 struct usb_serial *serial = port->serial; 155 struct usb_serial *serial = port->serial;
122 unsigned char buf[4]; 156 u32 *buf;
123 unsigned int value; 157 int result, i, length;
124 int result, i; 158
159 /* Number of integers required to contain the array */
160 length = (((size - 1) | 3) + 1)/4;
161
162 buf = kmalloc (length * sizeof(u32), GFP_KERNEL);
163 memset(buf, 0, length * sizeof(u32));
164
165 if (!buf) {
166 dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__);
167 return -ENOMEM;
168 }
125 169
126 /*For get requests, the request number must be incremented*/ 170 /* For get requests, the request number must be incremented */
127 request++; 171 request++;
128 172
129 /*Issue the request, attempting to read 4 bytes*/ 173 /* Issue the request, attempting to read 'size' bytes */
130 result = usb_control_msg (serial->dev,usb_rcvctrlpipe (serial->dev, 0), 174 result = usb_control_msg (serial->dev,usb_rcvctrlpipe (serial->dev, 0),
131 request, REQTYPE_DEVICE_TO_HOST, 0x0000, 175 request, REQTYPE_DEVICE_TO_HOST, 0x0000,
132 0, buf, 4, 300); 176 0, buf, size, 300);
133 177
134 if (result < 0) { 178 /* Convert data into an array of integers */
135 dev_err(&port->dev, "%s - Unable to send config request, " 179 for (i=0; i<length; i++)
136 "request=0x%x result=%d\n", 180 data[i] = le32_to_cpu(buf[i]);
137 __FUNCTION__, request, result);
138 return result;
139 }
140 181
141 /*Assemble each byte read into an integer value*/ 182 kfree(buf);
142 value = 0;
143 for (i=0; i<4 && i<result; i++)
144 value |= (buf[i] << (i * 8));
145 183
146 dbg( " %s - request=0x%x result=%d value=0x%x", 184 if (result != size) {
147 __FUNCTION__, request, result, value); 185 dev_err(&port->dev, "%s - Unable to send config request, "
186 "request=0x%x size=%d result=%d\n",
187 __FUNCTION__, request, size, result);
188 return -EPROTO;
189 }
148 190
149 return value; 191 return 0;
150} 192}
151 193
152static int cp2101_set_config(struct usb_serial_port* port, u8 request, u16 value) 194/*
195 * cp2101_set_config
196 * Writes to the CP2101 configuration registers
197 * Values less than 16 bits wide are sent directly
198 * 'size' is specified in bytes.
199 */
200static int cp2101_set_config(struct usb_serial_port* port, u8 request,
201 unsigned int *data, int size)
153{ 202{
154 struct usb_serial *serial = port->serial; 203 struct usb_serial *serial = port->serial;
155 int result; 204 u32 *buf;
156 result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), 205 int result, i, length;
157 request, REQTYPE_HOST_TO_DEVICE, value,
158 0, NULL, 0, 300);
159 206
160 if (result <0) { 207 /* Number of integers required to contain the array */
161 dev_err(&port->dev, "%s - Unable to send config request, " 208 length = (((size - 1) | 3) + 1)/4;
162 "request=0x%x value=0x%x result=%d\n", 209
163 __FUNCTION__, request, value, result); 210 buf = kmalloc(length * sizeof(u32), GFP_KERNEL);
164 return result; 211 if (!buf) {
212 dev_err(&port->dev, "%s - out of memory.\n",
213 __FUNCTION__);
214 return -ENOMEM;
215 }
216
217 /* Array of integers into bytes */
218 for (i = 0; i < length; i++)
219 buf[i] = cpu_to_le32(data[i]);
220
221 if (size > 2) {
222 result = usb_control_msg (serial->dev,
223 usb_sndctrlpipe(serial->dev, 0),
224 request, REQTYPE_HOST_TO_DEVICE, 0x0000,
225 0, buf, size, 300);
226 } else {
227 result = usb_control_msg (serial->dev,
228 usb_sndctrlpipe(serial->dev, 0),
229 request, REQTYPE_HOST_TO_DEVICE, data[0],
230 0, NULL, 0, 300);
165 } 231 }
166 232
167 dbg(" %s - request=0x%x value=0x%x result=%d", 233 kfree(buf);
168 __FUNCTION__, request, value, result); 234
235 if ((size > 2 && result != size) || result < 0) {
236 dev_err(&port->dev, "%s - Unable to send request, "
237 "request=0x%x size=%d result=%d\n",
238 __FUNCTION__, request, size, result);
239 return -EPROTO;
240 }
169 241
242 /* Single data value */
243 result = usb_control_msg (serial->dev,
244 usb_sndctrlpipe(serial->dev, 0),
245 request, REQTYPE_HOST_TO_DEVICE, data[0],
246 0, NULL, 0, 300);
170 return 0; 247 return 0;
171} 248}
172 249
250/*
251 * cp2101_set_config_single
252 * Convenience function for calling cp2101_set_config on single data values
253 * without requiring an integer pointer
254 */
255static inline int cp2101_set_config_single(struct usb_serial_port* port,
256 u8 request, unsigned int data)
257{
258 return cp2101_set_config(port, request, &data, 2);
259}
260
173static int cp2101_open (struct usb_serial_port *port, struct file *filp) 261static int cp2101_open (struct usb_serial_port *port, struct file *filp)
174{ 262{
175 struct usb_serial *serial = port->serial; 263 struct usb_serial *serial = port->serial;
@@ -177,7 +265,7 @@ static int cp2101_open (struct usb_serial_port *port, struct file *filp)
177 265
178 dbg("%s - port %d", __FUNCTION__, port->number); 266 dbg("%s - port %d", __FUNCTION__, port->number);
179 267
180 if (cp2101_set_config(port, CP2101_UART, UART_ENABLE)) { 268 if (cp2101_set_config_single(port, CP2101_UART, UART_ENABLE)) {
181 dev_err(&port->dev, "%s - Unable to enable UART\n", 269 dev_err(&port->dev, "%s - Unable to enable UART\n",
182 __FUNCTION__); 270 __FUNCTION__);
183 return -EPROTO; 271 return -EPROTO;
@@ -198,9 +286,12 @@ static int cp2101_open (struct usb_serial_port *port, struct file *filp)
198 return result; 286 return result;
199 } 287 }
200 288
201 /*Configure the termios structure*/ 289 /* Configure the termios structure */
202 cp2101_get_termios(port); 290 cp2101_get_termios(port);
203 291
292 /* Set the DTR and RTS pins low */
293 cp2101_tiocmset(port, NULL, TIOCM_DTR | TIOCM_RTS, 0);
294
204 return 0; 295 return 0;
205} 296}
206 297
@@ -228,16 +319,18 @@ static void cp2101_close (struct usb_serial_port *port, struct file * filp)
228 usb_kill_urb(port->write_urb); 319 usb_kill_urb(port->write_urb);
229 usb_kill_urb(port->read_urb); 320 usb_kill_urb(port->read_urb);
230 321
231 cp2101_set_config(port, CP2101_UART, UART_DISABLE); 322 cp2101_set_config_single(port, CP2101_UART, UART_DISABLE);
232} 323}
233 324
234/* cp2101_get_termios*/ 325/*
235/* Reads the baud rate, data bits, parity and stop bits from the device*/ 326 * cp2101_get_termios
236/* Corrects any unsupported values*/ 327 * Reads the baud rate, data bits, parity, stop bits and flow control mode
237/* Configures the termios structure to reflect the state of the device*/ 328 * from the device, corrects any unsupported values, and configures the
329 * termios structure to reflect the state of the device
330 */
238static void cp2101_get_termios (struct usb_serial_port *port) 331static void cp2101_get_termios (struct usb_serial_port *port)
239{ 332{
240 unsigned int cflag; 333 unsigned int cflag, modem_ctl[4];
241 int baud; 334 int baud;
242 int bits; 335 int bits;
243 336
@@ -249,15 +342,16 @@ static void cp2101_get_termios (struct usb_serial_port *port)
249 } 342 }
250 cflag = port->tty->termios->c_cflag; 343 cflag = port->tty->termios->c_cflag;
251 344
252 baud = cp2101_get_config(port, CP2101_BAUDRATE); 345 cp2101_get_config(port, CP2101_BAUDRATE, &baud, 2);
253 /*Convert to baudrate*/ 346 /* Convert to baudrate */
254 if (baud) 347 if (baud)
255 baud = BAUD_RATE_GEN_FREQ / baud; 348 baud = BAUD_RATE_GEN_FREQ / baud;
256 349
257 dbg("%s - baud rate = %d", __FUNCTION__, baud); 350 dbg("%s - baud rate = %d", __FUNCTION__, baud);
258 cflag &= ~CBAUD; 351 cflag &= ~CBAUD;
259 switch (baud) { 352 switch (baud) {
260 /* The baud rates which are commented out below 353 /*
354 * The baud rates which are commented out below
261 * appear to be supported by the device 355 * appear to be supported by the device
262 * but are non-standard 356 * but are non-standard
263 */ 357 */
@@ -284,14 +378,18 @@ static void cp2101_get_termios (struct usb_serial_port *port)
284 dbg("%s - Baud rate is not supported, " 378 dbg("%s - Baud rate is not supported, "
285 "using 9600 baud", __FUNCTION__); 379 "using 9600 baud", __FUNCTION__);
286 cflag |= B9600; 380 cflag |= B9600;
287 cp2101_set_config(port, CP2101_BAUDRATE, 381 cp2101_set_config_single(port, CP2101_BAUDRATE,
288 (BAUD_RATE_GEN_FREQ/9600)); 382 (BAUD_RATE_GEN_FREQ/9600));
289 break; 383 break;
290 } 384 }
291 385
292 bits = cp2101_get_config(port, CP2101_BITS); 386 cp2101_get_config(port, CP2101_BITS, &bits, 2);
293 cflag &= ~CSIZE; 387 cflag &= ~CSIZE;
294 switch(bits & BITS_DATA_MASK) { 388 switch(bits & BITS_DATA_MASK) {
389 case BITS_DATA_5:
390 dbg("%s - data bits = 5", __FUNCTION__);
391 cflag |= CS5;
392 break;
295 case BITS_DATA_6: 393 case BITS_DATA_6:
296 dbg("%s - data bits = 6", __FUNCTION__); 394 dbg("%s - data bits = 6", __FUNCTION__);
297 cflag |= CS6; 395 cflag |= CS6;
@@ -310,7 +408,7 @@ static void cp2101_get_termios (struct usb_serial_port *port)
310 cflag |= CS8; 408 cflag |= CS8;
311 bits &= ~BITS_DATA_MASK; 409 bits &= ~BITS_DATA_MASK;
312 bits |= BITS_DATA_8; 410 bits |= BITS_DATA_8;
313 cp2101_set_config(port, CP2101_BITS, bits); 411 cp2101_set_config(port, CP2101_BITS, &bits, 2);
314 break; 412 break;
315 default: 413 default:
316 dbg("%s - Unknown number of data bits, " 414 dbg("%s - Unknown number of data bits, "
@@ -318,7 +416,7 @@ static void cp2101_get_termios (struct usb_serial_port *port)
318 cflag |= CS8; 416 cflag |= CS8;
319 bits &= ~BITS_DATA_MASK; 417 bits &= ~BITS_DATA_MASK;
320 bits |= BITS_DATA_8; 418 bits |= BITS_DATA_8;
321 cp2101_set_config(port, CP2101_BITS, bits); 419 cp2101_set_config(port, CP2101_BITS, &bits, 2);
322 break; 420 break;
323 } 421 }
324 422
@@ -341,21 +439,21 @@ static void cp2101_get_termios (struct usb_serial_port *port)
341 "disabling parity)", __FUNCTION__); 439 "disabling parity)", __FUNCTION__);
342 cflag &= ~PARENB; 440 cflag &= ~PARENB;
343 bits &= ~BITS_PARITY_MASK; 441 bits &= ~BITS_PARITY_MASK;
344 cp2101_set_config(port, CP2101_BITS, bits); 442 cp2101_set_config(port, CP2101_BITS, &bits, 2);
345 break; 443 break;
346 case BITS_PARITY_SPACE: 444 case BITS_PARITY_SPACE:
347 dbg("%s - parity = SPACE (not supported, " 445 dbg("%s - parity = SPACE (not supported, "
348 "disabling parity)", __FUNCTION__); 446 "disabling parity)", __FUNCTION__);
349 cflag &= ~PARENB; 447 cflag &= ~PARENB;
350 bits &= ~BITS_PARITY_MASK; 448 bits &= ~BITS_PARITY_MASK;
351 cp2101_set_config(port, CP2101_BITS, bits); 449 cp2101_set_config(port, CP2101_BITS, &bits, 2);
352 break; 450 break;
353 default: 451 default:
354 dbg("%s - Unknown parity mode, " 452 dbg("%s - Unknown parity mode, "
355 "disabling parity", __FUNCTION__); 453 "disabling parity", __FUNCTION__);
356 cflag &= ~PARENB; 454 cflag &= ~PARENB;
357 bits &= ~BITS_PARITY_MASK; 455 bits &= ~BITS_PARITY_MASK;
358 cp2101_set_config(port, CP2101_BITS, bits); 456 cp2101_set_config(port, CP2101_BITS, &bits, 2);
359 break; 457 break;
360 } 458 }
361 459
@@ -366,9 +464,9 @@ static void cp2101_get_termios (struct usb_serial_port *port)
366 break; 464 break;
367 case BITS_STOP_1_5: 465 case BITS_STOP_1_5:
368 dbg("%s - stop bits = 1.5 (not supported, " 466 dbg("%s - stop bits = 1.5 (not supported, "
369 "using 1 stop bit", __FUNCTION__); 467 "using 1 stop bit)", __FUNCTION__);
370 bits &= ~BITS_STOP_MASK; 468 bits &= ~BITS_STOP_MASK;
371 cp2101_set_config(port, CP2101_BITS, bits); 469 cp2101_set_config(port, CP2101_BITS, &bits, 2);
372 break; 470 break;
373 case BITS_STOP_2: 471 case BITS_STOP_2:
374 dbg("%s - stop bits = 2", __FUNCTION__); 472 dbg("%s - stop bits = 2", __FUNCTION__);
@@ -378,10 +476,19 @@ static void cp2101_get_termios (struct usb_serial_port *port)
378 dbg("%s - Unknown number of stop bits, " 476 dbg("%s - Unknown number of stop bits, "
379 "using 1 stop bit", __FUNCTION__); 477 "using 1 stop bit", __FUNCTION__);
380 bits &= ~BITS_STOP_MASK; 478 bits &= ~BITS_STOP_MASK;
381 cp2101_set_config(port, CP2101_BITS, bits); 479 cp2101_set_config(port, CP2101_BITS, &bits, 2);
382 break; 480 break;
383 } 481 }
384 482
483 cp2101_get_config(port, CP2101_MODEMCTL, modem_ctl, 16);
484 if (modem_ctl[0] & 0x0008) {
485 dbg("%s - flow control = CRTSCTS", __FUNCTION__);
486 cflag |= CRTSCTS;
487 } else {
488 dbg("%s - flow control = NONE", __FUNCTION__);
489 cflag &= ~CRTSCTS;
490 }
491
385 port->tty->termios->c_cflag = cflag; 492 port->tty->termios->c_cflag = cflag;
386} 493}
387 494
@@ -389,8 +496,8 @@ static void cp2101_set_termios (struct usb_serial_port *port,
389 struct termios *old_termios) 496 struct termios *old_termios)
390{ 497{
391 unsigned int cflag, old_cflag=0; 498 unsigned int cflag, old_cflag=0;
392 int baud=0; 499 int baud=0, bits;
393 int bits; 500 unsigned int modem_ctl[4];
394 501
395 dbg("%s - port %d", __FUNCTION__, port->number); 502 dbg("%s - port %d", __FUNCTION__, port->number);
396 503
@@ -400,7 +507,7 @@ static void cp2101_set_termios (struct usb_serial_port *port,
400 } 507 }
401 cflag = port->tty->termios->c_cflag; 508 cflag = port->tty->termios->c_cflag;
402 509
403 /* check that they really want us to change something */ 510 /* Check that they really want us to change something */
404 if (old_termios) { 511 if (old_termios) {
405 if ((cflag == old_termios->c_cflag) && 512 if ((cflag == old_termios->c_cflag) &&
406 (RELEVANT_IFLAG(port->tty->termios->c_iflag) 513 (RELEVANT_IFLAG(port->tty->termios->c_iflag)
@@ -415,7 +522,8 @@ static void cp2101_set_termios (struct usb_serial_port *port,
415 /* If the baud rate is to be updated*/ 522 /* If the baud rate is to be updated*/
416 if ((cflag & CBAUD) != (old_cflag & CBAUD)) { 523 if ((cflag & CBAUD) != (old_cflag & CBAUD)) {
417 switch (cflag & CBAUD) { 524 switch (cflag & CBAUD) {
418 /* The baud rates which are commented out below 525 /*
526 * The baud rates which are commented out below
419 * appear to be supported by the device 527 * appear to be supported by the device
420 * but are non-standard 528 * but are non-standard
421 */ 529 */
@@ -448,18 +556,22 @@ static void cp2101_set_termios (struct usb_serial_port *port,
448 if (baud) { 556 if (baud) {
449 dbg("%s - Setting baud rate to %d baud", __FUNCTION__, 557 dbg("%s - Setting baud rate to %d baud", __FUNCTION__,
450 baud); 558 baud);
451 if (cp2101_set_config(port, CP2101_BAUDRATE, 559 if (cp2101_set_config_single(port, CP2101_BAUDRATE,
452 (BAUD_RATE_GEN_FREQ / baud))) 560 (BAUD_RATE_GEN_FREQ / baud)))
453 dev_err(&port->dev, "Baud rate requested not " 561 dev_err(&port->dev, "Baud rate requested not "
454 "supported by device\n"); 562 "supported by device\n");
455 } 563 }
456 } 564 }
457 565
458 /*If the number of data bits is to be updated*/ 566 /* If the number of data bits is to be updated */
459 if ((cflag & CSIZE) != (old_cflag & CSIZE)) { 567 if ((cflag & CSIZE) != (old_cflag & CSIZE)) {
460 bits = cp2101_get_config(port, CP2101_BITS); 568 cp2101_get_config(port, CP2101_BITS, &bits, 2);
461 bits &= ~BITS_DATA_MASK; 569 bits &= ~BITS_DATA_MASK;
462 switch (cflag & CSIZE) { 570 switch (cflag & CSIZE) {
571 case CS5:
572 bits |= BITS_DATA_5;
573 dbg("%s - data bits = 5", __FUNCTION__);
574 break;
463 case CS6: 575 case CS6:
464 bits |= BITS_DATA_6; 576 bits |= BITS_DATA_6;
465 dbg("%s - data bits = 6", __FUNCTION__); 577 dbg("%s - data bits = 6", __FUNCTION__);
@@ -483,13 +595,13 @@ static void cp2101_set_termios (struct usb_serial_port *port,
483 bits |= BITS_DATA_8; 595 bits |= BITS_DATA_8;
484 break; 596 break;
485 } 597 }
486 if (cp2101_set_config(port, CP2101_BITS, bits)) 598 if (cp2101_set_config(port, CP2101_BITS, &bits, 2))
487 dev_err(&port->dev, "Number of data bits requested " 599 dev_err(&port->dev, "Number of data bits requested "
488 "not supported by device\n"); 600 "not supported by device\n");
489 } 601 }
490 602
491 if ((cflag & (PARENB|PARODD)) != (old_cflag & (PARENB|PARODD))) { 603 if ((cflag & (PARENB|PARODD)) != (old_cflag & (PARENB|PARODD))) {
492 bits = cp2101_get_config(port, CP2101_BITS); 604 cp2101_get_config(port, CP2101_BITS, &bits, 2);
493 bits &= ~BITS_PARITY_MASK; 605 bits &= ~BITS_PARITY_MASK;
494 if (cflag & PARENB) { 606 if (cflag & PARENB) {
495 if (cflag & PARODD) { 607 if (cflag & PARODD) {
@@ -500,13 +612,13 @@ static void cp2101_set_termios (struct usb_serial_port *port,
500 dbg("%s - parity = EVEN", __FUNCTION__); 612 dbg("%s - parity = EVEN", __FUNCTION__);
501 } 613 }
502 } 614 }
503 if (cp2101_set_config(port, CP2101_BITS, bits)) 615 if (cp2101_set_config(port, CP2101_BITS, &bits, 2))
504 dev_err(&port->dev, "Parity mode not supported " 616 dev_err(&port->dev, "Parity mode not supported "
505 "by device\n"); 617 "by device\n");
506 } 618 }
507 619
508 if ((cflag & CSTOPB) != (old_cflag & CSTOPB)) { 620 if ((cflag & CSTOPB) != (old_cflag & CSTOPB)) {
509 bits = cp2101_get_config(port, CP2101_BITS); 621 cp2101_get_config(port, CP2101_BITS, &bits, 2);
510 bits &= ~BITS_STOP_MASK; 622 bits &= ~BITS_STOP_MASK;
511 if (cflag & CSTOPB) { 623 if (cflag & CSTOPB) {
512 bits |= BITS_STOP_2; 624 bits |= BITS_STOP_2;
@@ -515,15 +627,90 @@ static void cp2101_set_termios (struct usb_serial_port *port,
515 bits |= BITS_STOP_1; 627 bits |= BITS_STOP_1;
516 dbg("%s - stop bits = 1", __FUNCTION__); 628 dbg("%s - stop bits = 1", __FUNCTION__);
517 } 629 }
518 if (cp2101_set_config(port, CP2101_BITS, bits)) 630 if (cp2101_set_config(port, CP2101_BITS, &bits, 2))
519 dev_err(&port->dev, "Number of stop bits requested " 631 dev_err(&port->dev, "Number of stop bits requested "
520 "not supported by device\n"); 632 "not supported by device\n");
521 } 633 }
634
635 if ((cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
636 cp2101_get_config(port, CP2101_MODEMCTL, modem_ctl, 16);
637 dbg("%s - read modem controls = 0x%.4x 0x%.4x 0x%.4x 0x%.4x",
638 __FUNCTION__, modem_ctl[0], modem_ctl[1],
639 modem_ctl[2], modem_ctl[3]);
640
641 if (cflag & CRTSCTS) {
642 modem_ctl[0] &= ~0x7B;
643 modem_ctl[0] |= 0x09;
644 modem_ctl[1] = 0x80;
645 dbg("%s - flow control = CRTSCTS", __FUNCTION__);
646 } else {
647 modem_ctl[0] &= ~0x7B;
648 modem_ctl[0] |= 0x01;
649 modem_ctl[1] |= 0x40;
650 dbg("%s - flow control = NONE", __FUNCTION__);
651 }
652
653 dbg("%s - write modem controls = 0x%.4x 0x%.4x 0x%.4x 0x%.4x",
654 __FUNCTION__, modem_ctl[0], modem_ctl[1],
655 modem_ctl[2], modem_ctl[3]);
656 cp2101_set_config(port, CP2101_MODEMCTL, modem_ctl, 16);
657 }
658
659}
660
661static int cp2101_tiocmset (struct usb_serial_port *port, struct file *file,
662 unsigned int set, unsigned int clear)
663{
664 int control = 0;
665
666 dbg("%s - port %d", __FUNCTION__, port->number);
667
668 if (set & TIOCM_RTS) {
669 control |= CONTROL_RTS;
670 control |= CONTROL_WRITE_RTS;
671 }
672 if (set & TIOCM_DTR) {
673 control |= CONTROL_DTR;
674 control |= CONTROL_WRITE_DTR;
675 }
676 if (clear & TIOCM_RTS) {
677 control &= ~CONTROL_RTS;
678 control |= CONTROL_WRITE_RTS;
679 }
680 if (clear & TIOCM_DTR) {
681 control &= ~CONTROL_DTR;
682 control |= CONTROL_WRITE_DTR;
683 }
684
685 dbg("%s - control = 0x%.4x", __FUNCTION__, control);
686
687 return cp2101_set_config(port, CP2101_CONTROL, &control, 2);
688
689}
690
691static int cp2101_tiocmget (struct usb_serial_port *port, struct file *file)
692{
693 int control, result;
694
695 dbg("%s - port %d", __FUNCTION__, port->number);
696
697 cp2101_get_config(port, CP2101_CONTROL, &control, 1);
698
699 result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0)
700 |((control & CONTROL_RTS) ? TIOCM_RTS : 0)
701 |((control & CONTROL_CTS) ? TIOCM_CTS : 0)
702 |((control & CONTROL_DSR) ? TIOCM_DSR : 0)
703 |((control & CONTROL_RING)? TIOCM_RI : 0)
704 |((control & CONTROL_DCD) ? TIOCM_CD : 0);
705
706 dbg("%s - control = 0x%.2x", __FUNCTION__, control);
707
708 return result;
522} 709}
523 710
524static void cp2101_break_ctl (struct usb_serial_port *port, int break_state) 711static void cp2101_break_ctl (struct usb_serial_port *port, int break_state)
525{ 712{
526 u16 state; 713 int state;
527 714
528 dbg("%s - port %d", __FUNCTION__, port->number); 715 dbg("%s - port %d", __FUNCTION__, port->number);
529 if (break_state == 0) 716 if (break_state == 0)
@@ -532,12 +719,12 @@ static void cp2101_break_ctl (struct usb_serial_port *port, int break_state)
532 state = BREAK_ON; 719 state = BREAK_ON;
533 dbg("%s - turning break %s", __FUNCTION__, 720 dbg("%s - turning break %s", __FUNCTION__,
534 state==BREAK_OFF ? "off" : "on"); 721 state==BREAK_OFF ? "off" : "on");
535 cp2101_set_config(port, CP2101_BREAK, state); 722 cp2101_set_config(port, CP2101_BREAK, &state, 2);
536} 723}
537 724
538static int cp2101_startup (struct usb_serial *serial) 725static int cp2101_startup (struct usb_serial *serial)
539{ 726{
540 /*CP2101 buffers behave strangely unless device is reset*/ 727 /* CP2101 buffers behave strangely unless device is reset */
541 usb_reset_device(serial->dev); 728 usb_reset_device(serial->dev);
542 return 0; 729 return 0;
543} 730}
@@ -548,7 +735,7 @@ static void cp2101_shutdown (struct usb_serial *serial)
548 735
549 dbg("%s", __FUNCTION__); 736 dbg("%s", __FUNCTION__);
550 737
551 /* stop reads and writes on all ports */ 738 /* Stop reads and writes on all ports */
552 for (i=0; i < serial->num_ports; ++i) { 739 for (i=0; i < serial->num_ports; ++i) {
553 cp2101_cleanup(serial->port[i]); 740 cp2101_cleanup(serial->port[i]);
554 } 741 }
@@ -560,16 +747,16 @@ static int __init cp2101_init (void)
560 747
561 retval = usb_serial_register(&cp2101_device); 748 retval = usb_serial_register(&cp2101_device);
562 if (retval) 749 if (retval)
563 return retval; /*Failed to register*/ 750 return retval; /* Failed to register */
564 751
565 retval = usb_register(&cp2101_driver); 752 retval = usb_register(&cp2101_driver);
566 if (retval) { 753 if (retval) {
567 /*Failed to register*/ 754 /* Failed to register */
568 usb_serial_deregister(&cp2101_device); 755 usb_serial_deregister(&cp2101_device);
569 return retval; 756 return retval;
570 } 757 }
571 758
572 /*Success*/ 759 /* Success */
573 info(DRIVER_DESC " " DRIVER_VERSION); 760 info(DRIVER_DESC " " DRIVER_VERSION);
574 return 0; 761 return 0;
575} 762}
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 52394f08a947..d882fa3ad19a 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -264,7 +264,7 @@
264/* 264/*
265 * Version Information 265 * Version Information
266 */ 266 */
267#define DRIVER_VERSION "v1.4.1" 267#define DRIVER_VERSION "v1.4.2"
268#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>" 268#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>"
269#define DRIVER_DESC "USB FTDI Serial Converters Driver" 269#define DRIVER_DESC "USB FTDI Serial Converters Driver"
270 270
@@ -364,6 +364,7 @@ static struct usb_device_id id_table_8U232AM [] = {
364 { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_3, 0, 0x3ff) }, 364 { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_3, 0, 0x3ff) },
365 { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_4, 0, 0x3ff) }, 365 { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_4, 0, 0x3ff) },
366 { USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UO100_PID, 0, 0x3ff) }, 366 { USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UO100_PID, 0, 0x3ff) },
367 { USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UM100_PID, 0, 0x3ff) },
367 { USB_DEVICE_VER(FTDI_VID, INSIDE_ACCESSO, 0, 0x3ff) }, 368 { USB_DEVICE_VER(FTDI_VID, INSIDE_ACCESSO, 0, 0x3ff) },
368 { USB_DEVICE_VER(INTREPID_VID, INTREPID_VALUECAN_PID, 0, 0x3ff) }, 369 { USB_DEVICE_VER(INTREPID_VID, INTREPID_VALUECAN_PID, 0, 0x3ff) },
369 { USB_DEVICE_VER(INTREPID_VID, INTREPID_NEOVI_PID, 0, 0x3ff) }, 370 { USB_DEVICE_VER(INTREPID_VID, INTREPID_NEOVI_PID, 0, 0x3ff) },
@@ -475,6 +476,7 @@ static struct usb_device_id id_table_FT232BM [] = {
475 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88E_PID, 0x400, 0xffff) }, 476 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88E_PID, 0x400, 0xffff) },
476 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88F_PID, 0x400, 0xffff) }, 477 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88F_PID, 0x400, 0xffff) },
477 { USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UO100_PID, 0x400, 0xffff) }, 478 { USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UO100_PID, 0x400, 0xffff) },
479 { USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UM100_PID, 0x400, 0xffff) },
478 { USB_DEVICE_VER(FTDI_VID, LINX_SDMUSBQSS_PID, 0x400, 0xffff) }, 480 { USB_DEVICE_VER(FTDI_VID, LINX_SDMUSBQSS_PID, 0x400, 0xffff) },
479 { USB_DEVICE_VER(FTDI_VID, LINX_MASTERDEVEL2_PID, 0x400, 0xffff) }, 481 { USB_DEVICE_VER(FTDI_VID, LINX_MASTERDEVEL2_PID, 0x400, 0xffff) },
480 { USB_DEVICE_VER(FTDI_VID, LINX_FUTURE_0_PID, 0x400, 0xffff) }, 482 { USB_DEVICE_VER(FTDI_VID, LINX_FUTURE_0_PID, 0x400, 0xffff) },
@@ -618,6 +620,7 @@ static struct usb_device_id id_table_combined [] = {
618 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88E_PID, 0x400, 0xffff) }, 620 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88E_PID, 0x400, 0xffff) },
619 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88F_PID, 0x400, 0xffff) }, 621 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88F_PID, 0x400, 0xffff) },
620 { USB_DEVICE(FTDI_VID, FTDI_ELV_UO100_PID) }, 622 { USB_DEVICE(FTDI_VID, FTDI_ELV_UO100_PID) },
623 { USB_DEVICE(FTDI_VID, FTDI_ELV_UM100_PID) },
621 { USB_DEVICE_VER(FTDI_VID, LINX_SDMUSBQSS_PID, 0x400, 0xffff) }, 624 { USB_DEVICE_VER(FTDI_VID, LINX_SDMUSBQSS_PID, 0x400, 0xffff) },
622 { USB_DEVICE_VER(FTDI_VID, LINX_MASTERDEVEL2_PID, 0x400, 0xffff) }, 625 { USB_DEVICE_VER(FTDI_VID, LINX_MASTERDEVEL2_PID, 0x400, 0xffff) },
623 { USB_DEVICE_VER(FTDI_VID, LINX_FUTURE_0_PID, 0x400, 0xffff) }, 626 { USB_DEVICE_VER(FTDI_VID, LINX_FUTURE_0_PID, 0x400, 0xffff) },
@@ -684,6 +687,8 @@ struct ftdi_private {
684 char prev_status, diff_status; /* Used for TIOCMIWAIT */ 687 char prev_status, diff_status; /* Used for TIOCMIWAIT */
685 __u8 rx_flags; /* receive state flags (throttling) */ 688 __u8 rx_flags; /* receive state flags (throttling) */
686 spinlock_t rx_lock; /* spinlock for receive state */ 689 spinlock_t rx_lock; /* spinlock for receive state */
690 struct work_struct rx_work;
691 int rx_processed;
687 692
688 __u16 interface; /* FT2232C port interface (0 for FT232/245) */ 693 __u16 interface; /* FT2232C port interface (0 for FT232/245) */
689 694
@@ -714,7 +719,7 @@ static int ftdi_write_room (struct usb_serial_port *port);
714static int ftdi_chars_in_buffer (struct usb_serial_port *port); 719static int ftdi_chars_in_buffer (struct usb_serial_port *port);
715static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs); 720static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs);
716static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs); 721static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs);
717static void ftdi_process_read (struct usb_serial_port *port); 722static void ftdi_process_read (void *param);
718static void ftdi_set_termios (struct usb_serial_port *port, struct termios * old); 723static void ftdi_set_termios (struct usb_serial_port *port, struct termios * old);
719static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file); 724static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file);
720static int ftdi_tiocmset (struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear); 725static int ftdi_tiocmset (struct usb_serial_port *port, struct file * file, unsigned int set, unsigned int clear);
@@ -1213,7 +1218,7 @@ check_and_exit:
1213 * *************************************************************************** 1218 * ***************************************************************************
1214 */ 1219 */
1215 1220
1216static ssize_t show_latency_timer(struct device *dev, char *buf) 1221static ssize_t show_latency_timer(struct device *dev, struct device_attribute *attr, char *buf)
1217{ 1222{
1218 struct usb_serial_port *port = to_usb_serial_port(dev); 1223 struct usb_serial_port *port = to_usb_serial_port(dev);
1219 struct ftdi_private *priv = usb_get_serial_port_data(port); 1224 struct ftdi_private *priv = usb_get_serial_port_data(port);
@@ -1240,7 +1245,7 @@ static ssize_t show_latency_timer(struct device *dev, char *buf)
1240} 1245}
1241 1246
1242/* Write a new value of the latency timer, in units of milliseconds. */ 1247/* Write a new value of the latency timer, in units of milliseconds. */
1243static ssize_t store_latency_timer(struct device *dev, const char *valbuf, 1248static ssize_t store_latency_timer(struct device *dev, struct device_attribute *attr, const char *valbuf,
1244 size_t count) 1249 size_t count)
1245{ 1250{
1246 struct usb_serial_port *port = to_usb_serial_port(dev); 1251 struct usb_serial_port *port = to_usb_serial_port(dev);
@@ -1271,7 +1276,7 @@ static ssize_t store_latency_timer(struct device *dev, const char *valbuf,
1271 1276
1272/* Write an event character directly to the FTDI register. The ASCII 1277/* Write an event character directly to the FTDI register. The ASCII
1273 value is in the low 8 bits, with the enable bit in the 9th bit. */ 1278 value is in the low 8 bits, with the enable bit in the 9th bit. */
1274static ssize_t store_event_char(struct device *dev, const char *valbuf, 1279static ssize_t store_event_char(struct device *dev, struct device_attribute *attr, const char *valbuf,
1275 size_t count) 1280 size_t count)
1276{ 1281{
1277 struct usb_serial_port *port = to_usb_serial_port(dev); 1282 struct usb_serial_port *port = to_usb_serial_port(dev);
@@ -1384,6 +1389,8 @@ static int ftdi_common_startup (struct usb_serial *serial)
1384 port->read_urb->transfer_buffer_length = BUFSZ; 1389 port->read_urb->transfer_buffer_length = BUFSZ;
1385 } 1390 }
1386 1391
1392 INIT_WORK(&priv->rx_work, ftdi_process_read, port);
1393
1387 /* Free port's existing write urb and transfer buffer. */ 1394 /* Free port's existing write urb and transfer buffer. */
1388 if (port->write_urb) { 1395 if (port->write_urb) {
1389 usb_free_urb (port->write_urb); 1396 usb_free_urb (port->write_urb);
@@ -1614,6 +1621,7 @@ static int ftdi_open (struct usb_serial_port *port, struct file *filp)
1614 spin_unlock_irqrestore(&priv->rx_lock, flags); 1621 spin_unlock_irqrestore(&priv->rx_lock, flags);
1615 1622
1616 /* Start reading from the device */ 1623 /* Start reading from the device */
1624 priv->rx_processed = 0;
1617 usb_fill_bulk_urb(port->read_urb, dev, 1625 usb_fill_bulk_urb(port->read_urb, dev,
1618 usb_rcvbulkpipe(dev, port->bulk_in_endpointAddress), 1626 usb_rcvbulkpipe(dev, port->bulk_in_endpointAddress),
1619 port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, 1627 port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
@@ -1664,6 +1672,10 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp)
1664 err("Error from RTS LOW urb"); 1672 err("Error from RTS LOW urb");
1665 } 1673 }
1666 } /* Note change no line if hupcl is off */ 1674 } /* Note change no line if hupcl is off */
1675
1676 /* cancel any scheduled reading */
1677 cancel_delayed_work(&priv->rx_work);
1678 flush_scheduled_work();
1667 1679
1668 /* shutdown our bulk read */ 1680 /* shutdown our bulk read */
1669 if (port->read_urb) 1681 if (port->read_urb)
@@ -1859,23 +1871,14 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
1859 return; 1871 return;
1860 } 1872 }
1861 1873
1862 /* If throttled, delay receive processing until unthrottled. */
1863 spin_lock(&priv->rx_lock);
1864 if (priv->rx_flags & THROTTLED) {
1865 dbg("Deferring read urb processing until unthrottled");
1866 priv->rx_flags |= ACTUALLY_THROTTLED;
1867 spin_unlock(&priv->rx_lock);
1868 return;
1869 }
1870 spin_unlock(&priv->rx_lock);
1871
1872 ftdi_process_read(port); 1874 ftdi_process_read(port);
1873 1875
1874} /* ftdi_read_bulk_callback */ 1876} /* ftdi_read_bulk_callback */
1875 1877
1876 1878
1877static void ftdi_process_read (struct usb_serial_port *port) 1879static void ftdi_process_read (void *param)
1878{ /* ftdi_process_read */ 1880{ /* ftdi_process_read */
1881 struct usb_serial_port *port = (struct usb_serial_port*)param;
1879 struct urb *urb; 1882 struct urb *urb;
1880 struct tty_struct *tty; 1883 struct tty_struct *tty;
1881 struct ftdi_private *priv; 1884 struct ftdi_private *priv;
@@ -1886,6 +1889,7 @@ static void ftdi_process_read (struct usb_serial_port *port)
1886 int result; 1889 int result;
1887 int need_flip; 1890 int need_flip;
1888 int packet_offset; 1891 int packet_offset;
1892 unsigned long flags;
1889 1893
1890 dbg("%s - port %d", __FUNCTION__, port->number); 1894 dbg("%s - port %d", __FUNCTION__, port->number);
1891 1895
@@ -1912,12 +1916,18 @@ static void ftdi_process_read (struct usb_serial_port *port)
1912 1916
1913 data = urb->transfer_buffer; 1917 data = urb->transfer_buffer;
1914 1918
1915 /* The first two bytes of every read packet are status */ 1919 if (priv->rx_processed) {
1916 if (urb->actual_length > 2) { 1920 dbg("%s - already processed: %d bytes, %d remain", __FUNCTION__,
1917 usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data); 1921 priv->rx_processed,
1922 urb->actual_length - priv->rx_processed);
1918 } else { 1923 } else {
1919 dbg("Status only: %03oo %03oo",data[0],data[1]); 1924 /* The first two bytes of every read packet are status */
1920 } 1925 if (urb->actual_length > 2) {
1926 usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
1927 } else {
1928 dbg("Status only: %03oo %03oo",data[0],data[1]);
1929 }
1930 }
1921 1931
1922 1932
1923 /* TO DO -- check for hung up line and handle appropriately: */ 1933 /* TO DO -- check for hung up line and handle appropriately: */
@@ -1926,8 +1936,12 @@ static void ftdi_process_read (struct usb_serial_port *port)
1926 /* if CD is dropped and the line is not CLOCAL then we should hangup */ 1936 /* if CD is dropped and the line is not CLOCAL then we should hangup */
1927 1937
1928 need_flip = 0; 1938 need_flip = 0;
1929 for (packet_offset=0; packet_offset < urb->actual_length; packet_offset += PKTSZ) { 1939 for (packet_offset = priv->rx_processed; packet_offset < urb->actual_length; packet_offset += PKTSZ) {
1940 int length;
1941
1930 /* Compare new line status to the old one, signal if different */ 1942 /* Compare new line status to the old one, signal if different */
1943 /* N.B. packet may be processed more than once, but differences
1944 * are only processed once. */
1931 if (priv != NULL) { 1945 if (priv != NULL) {
1932 char new_status = data[packet_offset+0] & FTDI_STATUS_B0_MASK; 1946 char new_status = data[packet_offset+0] & FTDI_STATUS_B0_MASK;
1933 if (new_status != priv->prev_status) { 1947 if (new_status != priv->prev_status) {
@@ -1937,6 +1951,35 @@ static void ftdi_process_read (struct usb_serial_port *port)
1937 } 1951 }
1938 } 1952 }
1939 1953
1954 length = min(PKTSZ, urb->actual_length-packet_offset)-2;
1955 if (length < 0) {
1956 err("%s - bad packet length: %d", __FUNCTION__, length+2);
1957 length = 0;
1958 }
1959
1960 /* have to make sure we don't overflow the buffer
1961 with tty_insert_flip_char's */
1962 if (tty->flip.count+length > TTY_FLIPBUF_SIZE) {
1963 tty_flip_buffer_push(tty);
1964 need_flip = 0;
1965
1966 if (tty->flip.count != 0) {
1967 /* flip didn't work, this happens when ftdi_process_read() is
1968 * called from ftdi_unthrottle, because TTY_DONT_FLIP is set */
1969 dbg("%s - flip buffer push failed", __FUNCTION__);
1970 break;
1971 }
1972 }
1973 if (priv->rx_flags & THROTTLED) {
1974 dbg("%s - throttled", __FUNCTION__);
1975 break;
1976 }
1977 if (tty->ldisc.receive_room(tty)-tty->flip.count < length) {
1978 /* break out & wait for throttling/unthrottling to happen */
1979 dbg("%s - receive room low", __FUNCTION__);
1980 break;
1981 }
1982
1940 /* Handle errors and break */ 1983 /* Handle errors and break */
1941 error_flag = TTY_NORMAL; 1984 error_flag = TTY_NORMAL;
1942 /* Although the device uses a bitmask and hence can have multiple */ 1985 /* Although the device uses a bitmask and hence can have multiple */
@@ -1959,13 +2002,8 @@ static void ftdi_process_read (struct usb_serial_port *port)
1959 error_flag = TTY_FRAME; 2002 error_flag = TTY_FRAME;
1960 dbg("FRAMING error"); 2003 dbg("FRAMING error");
1961 } 2004 }
1962 if (urb->actual_length > packet_offset + 2) { 2005 if (length > 0) {
1963 for (i = 2; (i < PKTSZ) && ((i+packet_offset) < urb->actual_length); ++i) { 2006 for (i = 2; i < length+2; i++) {
1964 /* have to make sure we don't overflow the buffer
1965 with tty_insert_flip_char's */
1966 if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
1967 tty_flip_buffer_push(tty);
1968 }
1969 /* Note that the error flag is duplicated for 2007 /* Note that the error flag is duplicated for
1970 every character received since we don't know 2008 every character received since we don't know
1971 which character it applied to */ 2009 which character it applied to */
@@ -2002,6 +2040,35 @@ static void ftdi_process_read (struct usb_serial_port *port)
2002 tty_flip_buffer_push(tty); 2040 tty_flip_buffer_push(tty);
2003 } 2041 }
2004 2042
2043 if (packet_offset < urb->actual_length) {
2044 /* not completely processed - record progress */
2045 priv->rx_processed = packet_offset;
2046 dbg("%s - incomplete, %d bytes processed, %d remain",
2047 __FUNCTION__, packet_offset,
2048 urb->actual_length - packet_offset);
2049 /* check if we were throttled while processing */
2050 spin_lock_irqsave(&priv->rx_lock, flags);
2051 if (priv->rx_flags & THROTTLED) {
2052 priv->rx_flags |= ACTUALLY_THROTTLED;
2053 spin_unlock_irqrestore(&priv->rx_lock, flags);
2054 dbg("%s - deferring remainder until unthrottled",
2055 __FUNCTION__);
2056 return;
2057 }
2058 spin_unlock_irqrestore(&priv->rx_lock, flags);
2059 /* if the port is closed stop trying to read */
2060 if (port->open_count > 0){
2061 /* delay processing of remainder */
2062 schedule_delayed_work(&priv->rx_work, 1);
2063 } else {
2064 dbg("%s - port is closed", __FUNCTION__);
2065 }
2066 return;
2067 }
2068
2069 /* urb is completely processed */
2070 priv->rx_processed = 0;
2071
2005 /* if the port is closed stop trying to read */ 2072 /* if the port is closed stop trying to read */
2006 if (port->open_count > 0){ 2073 if (port->open_count > 0){
2007 /* Continue trying to always read */ 2074 /* Continue trying to always read */
@@ -2441,7 +2508,7 @@ static void ftdi_unthrottle (struct usb_serial_port *port)
2441 spin_unlock_irqrestore(&priv->rx_lock, flags); 2508 spin_unlock_irqrestore(&priv->rx_lock, flags);
2442 2509
2443 if (actually_throttled) 2510 if (actually_throttled)
2444 ftdi_process_read(port); 2511 schedule_work(&priv->rx_work);
2445} 2512}
2446 2513
2447static int __init ftdi_init (void) 2514static int __init ftdi_init (void)
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index a52bb13a9ce4..8866376823a5 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -144,6 +144,8 @@
144 144
145/* ELV USB Module UO100 (PID sent by Stefan Frings) */ 145/* ELV USB Module UO100 (PID sent by Stefan Frings) */
146#define FTDI_ELV_UO100_PID 0xFB58 /* Product Id */ 146#define FTDI_ELV_UO100_PID 0xFB58 /* Product Id */
147/* ELV USB Module UM100 (PID sent by Arnim Laeuger) */
148#define FTDI_ELV_UM100_PID 0xFB5A /* Product Id */
147 149
148/* 150/*
149 * Definitions for ID TECH (www.idt-net.com) devices 151 * Definitions for ID TECH (www.idt-net.com) devices
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
new file mode 100644
index 000000000000..b722175f108f
--- /dev/null
+++ b/drivers/usb/serial/option.c
@@ -0,0 +1,729 @@
1/*
2 Option Card (PCMCIA to) USB to Serial Driver
3
4 Copyright (C) 2005 Matthias Urlichs <smurf@smurf.noris.de>
5
6 This driver is free software; you can redistribute it and/or modify
7 it under the terms of Version 2 of the GNU General Public License as
8 published by the Free Software Foundation.
9
10 Portions copied from the Keyspan driver by Hugh Blemings <hugh@blemings.org>
11
12 History:
13
14 2005-05-19 v0.1 Initial version, based on incomplete docs
15 and analysis of misbehavior of the standard driver
16 2005-05-20 v0.2 Extended the input buffer to avoid losing
17 random 64-byte chunks of data
18 2005-05-21 v0.3 implemented chars_in_buffer()
19 turned on low_latency
20 simplified the code somewhat
21*/
22#define DRIVER_VERSION "v0.3"
23#define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>"
24#define DRIVER_DESC "Option Card (PC-Card to) USB to Serial Driver"
25
26#include <linux/config.h>
27#include <linux/kernel.h>
28#include <linux/jiffies.h>
29#include <linux/errno.h>
30#include <linux/tty.h>
31#include <linux/tty_flip.h>
32#include <linux/module.h>
33#include <linux/usb.h>
34#include "usb-serial.h"
35
36/* Function prototypes */
37static int option_open (struct usb_serial_port *port, struct file *filp);
38static void option_close (struct usb_serial_port *port, struct file *filp);
39static int option_startup (struct usb_serial *serial);
40static void option_shutdown (struct usb_serial *serial);
41static void option_rx_throttle (struct usb_serial_port *port);
42static void option_rx_unthrottle (struct usb_serial_port *port);
43static int option_write_room (struct usb_serial_port *port);
44
45static void option_instat_callback(struct urb *urb, struct pt_regs *regs);
46
47
48static int option_write (struct usb_serial_port *port,
49 const unsigned char *buf, int count);
50
51static int option_chars_in_buffer (struct usb_serial_port *port);
52static int option_ioctl (struct usb_serial_port *port, struct file *file,
53 unsigned int cmd, unsigned long arg);
54static void option_set_termios (struct usb_serial_port *port,
55 struct termios *old);
56static void option_break_ctl (struct usb_serial_port *port, int break_state);
57static int option_tiocmget (struct usb_serial_port *port, struct file *file);
58static int option_tiocmset (struct usb_serial_port *port, struct file *file,
59 unsigned int set, unsigned int clear);
60static int option_send_setup (struct usb_serial_port *port);
61
62/* Vendor and product IDs */
63#define OPTION_VENDOR_ID 0x0AF0
64
65#define OPTION_PRODUCT_OLD 0x5000
66#define OPTION_PRODUCT_WLAN 0x6000
67
68static struct usb_device_id option_ids[] = {
69 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) },
70 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_WLAN) },
71 { } /* Terminating entry */
72};
73
74MODULE_DEVICE_TABLE(usb, option_ids);
75
76static struct usb_driver option_driver = {
77 .owner = THIS_MODULE,
78 .name = "option",
79 .probe = usb_serial_probe,
80 .disconnect = usb_serial_disconnect,
81 .id_table = option_ids,
82};
83
84/* The card has three separate interfaces, wich the serial driver
85 * recognizes separately, thus num_port=1.
86 */
87static struct usb_serial_device_type option_3port_device = {
88 .owner = THIS_MODULE,
89 .name = "Option 3-port card",
90 .short_name = "option",
91 .id_table = option_ids,
92 .num_interrupt_in = NUM_DONT_CARE,
93 .num_bulk_in = NUM_DONT_CARE,
94 .num_bulk_out = NUM_DONT_CARE,
95 .num_ports = 1, /* 3 */
96 .open = option_open,
97 .close = option_close,
98 .write = option_write,
99 .write_room = option_write_room,
100 .chars_in_buffer = option_chars_in_buffer,
101 .throttle = option_rx_throttle,
102 .unthrottle = option_rx_unthrottle,
103 .ioctl = option_ioctl,
104 .set_termios = option_set_termios,
105 .break_ctl = option_break_ctl,
106 .tiocmget = option_tiocmget,
107 .tiocmset = option_tiocmset,
108 .attach = option_startup,
109 .shutdown = option_shutdown,
110 .read_int_callback = option_instat_callback,
111};
112
113static int debug;
114
115/* per port private data */
116
117#define N_IN_URB 4
118#define N_OUT_URB 1
119#define IN_BUFLEN 1024
120#define OUT_BUFLEN 1024
121
122struct option_port_private {
123 /* Input endpoints and buffer for this port */
124 struct urb *in_urbs[N_IN_URB];
125 char in_buffer[N_IN_URB][IN_BUFLEN];
126 /* Output endpoints and buffer for this port */
127 struct urb *out_urbs[N_OUT_URB];
128 char out_buffer[N_OUT_URB][OUT_BUFLEN];
129
130 /* Settings for the port */
131 int rts_state; /* Handshaking pins (outputs) */
132 int dtr_state;
133 int cts_state; /* Handshaking pins (inputs) */
134 int dsr_state;
135 int dcd_state;
136 int ri_state;
137 // int break_on;
138
139 unsigned long tx_start_time[N_OUT_URB];
140};
141
142
143/* Functions used by new usb-serial code. */
144static int __init
145option_init (void)
146{
147 int retval;
148 retval = usb_serial_register(&option_3port_device);
149 if (retval)
150 goto failed_3port_device_register;
151 retval = usb_register(&option_driver);
152 if (retval)
153 goto failed_driver_register;
154
155 info(DRIVER_DESC ": " DRIVER_VERSION);
156
157 return 0;
158
159failed_driver_register:
160 usb_serial_deregister (&option_3port_device);
161failed_3port_device_register:
162 return retval;
163}
164
165static void __exit
166option_exit (void)
167{
168 usb_deregister (&option_driver);
169 usb_serial_deregister (&option_3port_device);
170}
171
172module_init(option_init);
173module_exit(option_exit);
174
175static void
176option_rx_throttle (struct usb_serial_port *port)
177{
178 dbg("%s", __FUNCTION__);
179}
180
181
182static void
183option_rx_unthrottle (struct usb_serial_port *port)
184{
185 dbg("%s", __FUNCTION__);
186}
187
188
189static void
190option_break_ctl (struct usb_serial_port *port, int break_state)
191{
192 /* Unfortunately, I don't know how to send a break */
193 dbg("%s", __FUNCTION__);
194}
195
196
197static void
198option_set_termios (struct usb_serial_port *port,
199 struct termios *old_termios)
200{
201 dbg("%s", __FUNCTION__);
202
203 option_send_setup(port);
204}
205
206static int
207option_tiocmget(struct usb_serial_port *port, struct file *file)
208{
209 unsigned int value;
210 struct option_port_private *portdata;
211
212 portdata = usb_get_serial_port_data(port);
213
214 value = ((portdata->rts_state) ? TIOCM_RTS : 0) |
215 ((portdata->dtr_state) ? TIOCM_DTR : 0) |
216 ((portdata->cts_state) ? TIOCM_CTS : 0) |
217 ((portdata->dsr_state) ? TIOCM_DSR : 0) |
218 ((portdata->dcd_state) ? TIOCM_CAR : 0) |
219 ((portdata->ri_state) ? TIOCM_RNG : 0);
220
221 return value;
222}
223
224static int
225option_tiocmset (struct usb_serial_port *port, struct file *file,
226 unsigned int set, unsigned int clear)
227{
228 struct option_port_private *portdata;
229
230 portdata = usb_get_serial_port_data(port);
231
232 if (set & TIOCM_RTS)
233 portdata->rts_state = 1;
234 if (set & TIOCM_DTR)
235 portdata->dtr_state = 1;
236
237 if (clear & TIOCM_RTS)
238 portdata->rts_state = 0;
239 if (clear & TIOCM_DTR)
240 portdata->dtr_state = 0;
241 return option_send_setup(port);
242}
243
244static int
245option_ioctl (struct usb_serial_port *port, struct file *file,
246 unsigned int cmd, unsigned long arg)
247{
248 return -ENOIOCTLCMD;
249}
250
251/* Write */
252static int
253option_write(struct usb_serial_port *port,
254 const unsigned char *buf, int count)
255{
256 struct option_port_private *portdata;
257 int i;
258 int left, todo;
259 struct urb *this_urb = NULL; /* spurious */
260 int err;
261
262 portdata = usb_get_serial_port_data(port);
263
264 dbg("%s: write (%d chars)", __FUNCTION__, count);
265
266#if 0
267 spin_lock(&port->lock);
268 if (port->write_urb_busy) {
269 spin_unlock(&port->lock);
270 dbg("%s: already writing", __FUNCTION__);
271 return 0;
272 }
273 port->write_urb_busy = 1;
274 spin_unlock(&port->lock);
275#endif
276
277 i = 0;
278 left = count;
279 while (left>0) {
280 todo = left;
281 if (todo > OUT_BUFLEN)
282 todo = OUT_BUFLEN;
283
284 for (;i < N_OUT_URB; i++) {
285 /* Check we have a valid urb/endpoint before we use it... */
286 this_urb = portdata->out_urbs[i];
287 if (this_urb->status != -EINPROGRESS)
288 break;
289 if (this_urb->transfer_flags & URB_ASYNC_UNLINK)
290 continue;
291 if (time_before(jiffies, portdata->tx_start_time[i] + 10 * HZ))
292 continue;
293 this_urb->transfer_flags |= URB_ASYNC_UNLINK;
294 usb_unlink_urb(this_urb);
295 }
296
297 if (i == N_OUT_URB) {
298 /* no bulk out free! */
299 dbg("%s: no output urb -- left %d", __FUNCTION__,count-left);
300#if 0
301 port->write_urb_busy = 0;
302#endif
303 return count-left;
304 }
305
306 dbg("%s: endpoint %d buf %d", __FUNCTION__, usb_pipeendpoint(this_urb->pipe), i);
307
308 memcpy (this_urb->transfer_buffer, buf, todo);
309
310 /* send the data out the bulk port */
311 this_urb->transfer_buffer_length = todo;
312
313 this_urb->transfer_flags &= ~URB_ASYNC_UNLINK;
314 this_urb->dev = port->serial->dev;
315 err = usb_submit_urb(this_urb, GFP_ATOMIC);
316 if (err) {
317 dbg("usb_submit_urb %p (write bulk) failed (%d,, has %d)", this_urb, err, this_urb->status);
318 continue;
319 }
320 portdata->tx_start_time[i] = jiffies;
321 buf += todo;
322 left -= todo;
323 }
324
325 count -= left;
326#if 0
327 port->write_urb_busy = 0;
328#endif
329 dbg("%s: wrote (did %d)", __FUNCTION__, count);
330 return count;
331}
332
333static void
334option_indat_callback (struct urb *urb, struct pt_regs *regs)
335{
336 int i, err;
337 int endpoint;
338 struct usb_serial_port *port;
339 struct tty_struct *tty;
340 unsigned char *data = urb->transfer_buffer;
341
342 dbg("%s: %p", __FUNCTION__, urb);
343
344 endpoint = usb_pipeendpoint(urb->pipe);
345 port = (struct usb_serial_port *) urb->context;
346
347 if (urb->status) {
348 dbg("%s: nonzero status: %d on endpoint %02x.",
349 __FUNCTION__, urb->status, endpoint);
350 } else {
351 tty = port->tty;
352 if (urb->actual_length) {
353 for (i = 0; i < urb->actual_length ; ++i) {
354 if (tty->flip.count >= TTY_FLIPBUF_SIZE)
355 tty_flip_buffer_push(tty);
356 tty_insert_flip_char(tty, data[i], 0);
357 }
358 tty_flip_buffer_push(tty);
359 } else {
360 dbg("%s: empty read urb received", __FUNCTION__);
361 }
362
363 /* Resubmit urb so we continue receiving */
364 if (port->open_count && urb->status != -ESHUTDOWN) {
365 err = usb_submit_urb(urb, GFP_ATOMIC);
366 if (err)
367 printk(KERN_ERR "%s: resubmit read urb failed. (%d)", __FUNCTION__, err);
368 }
369 }
370 return;
371}
372
373static void
374option_outdat_callback (struct urb *urb, struct pt_regs *regs)
375{
376 struct usb_serial_port *port;
377
378 dbg("%s", __FUNCTION__);
379
380 port = (struct usb_serial_port *) urb->context;
381
382 if (port->open_count)
383 schedule_work(&port->work);
384}
385
386static void
387option_instat_callback (struct urb *urb, struct pt_regs *regs)
388{
389 int err;
390 struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
391 struct option_port_private *portdata = usb_get_serial_port_data(port);
392 struct usb_serial *serial = port->serial;
393
394 dbg("%s", __FUNCTION__);
395 dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata);
396
397 if (urb->status == 0) {
398 struct usb_ctrlrequest *req_pkt =
399 (struct usb_ctrlrequest *)urb->transfer_buffer;
400
401 if (!req_pkt) {
402 dbg("%s: NULL req_pkt\n", __FUNCTION__);
403 return;
404 }
405 if ((req_pkt->bRequestType == 0xA1) && (req_pkt->bRequest == 0x20)) {
406 int old_dcd_state;
407 unsigned char signals = *((unsigned char *)
408 urb->transfer_buffer + sizeof(struct usb_ctrlrequest));
409
410 dbg("%s: signal x%x", __FUNCTION__, signals);
411
412 old_dcd_state = portdata->dcd_state;
413 portdata->cts_state = 1;
414 portdata->dcd_state = ((signals & 0x01) ? 1 : 0);
415 portdata->dsr_state = ((signals & 0x02) ? 1 : 0);
416 portdata->ri_state = ((signals & 0x08) ? 1 : 0);
417
418 if (port->tty && !C_CLOCAL(port->tty)
419 && old_dcd_state && !portdata->dcd_state) {
420 tty_hangup(port->tty);
421 }
422 } else
423 dbg("%s: type %x req %x", __FUNCTION__, req_pkt->bRequestType,req_pkt->bRequest);
424 } else
425 dbg("%s: error %d", __FUNCTION__, urb->status);
426
427 /* Resubmit urb so we continue receiving IRQ data */
428 if (urb->status != -ESHUTDOWN) {
429 urb->dev = serial->dev;
430 err = usb_submit_urb(urb, GFP_ATOMIC);
431 if (err)
432 dbg("%s: resubmit intr urb failed. (%d)", __FUNCTION__, err);
433 }
434}
435
436
437static int
438option_write_room (struct usb_serial_port *port)
439{
440 struct option_port_private *portdata;
441 int i;
442 int data_len = 0;
443 struct urb *this_urb;
444
445 portdata = usb_get_serial_port_data(port);
446
447 for (i=0; i < N_OUT_URB; i++)
448 this_urb = portdata->out_urbs[i];
449 if (this_urb && this_urb->status != -EINPROGRESS)
450 data_len += OUT_BUFLEN;
451
452 dbg("%s: %d", __FUNCTION__, data_len);
453 return data_len;
454}
455
456
457static int
458option_chars_in_buffer (struct usb_serial_port *port)
459{
460 struct option_port_private *portdata;
461 int i;
462 int data_len = 0;
463 struct urb *this_urb;
464
465 portdata = usb_get_serial_port_data(port);
466
467 for (i=0; i < N_OUT_URB; i++)
468 this_urb = portdata->out_urbs[i];
469 if (this_urb && this_urb->status == -EINPROGRESS)
470 data_len += this_urb->transfer_buffer_length;
471
472 dbg("%s: %d", __FUNCTION__, data_len);
473 return data_len;
474}
475
476
477static int
478option_open (struct usb_serial_port *port, struct file *filp)
479{
480 struct option_port_private *portdata;
481 struct usb_serial *serial = port->serial;
482 int i, err;
483 struct urb *urb;
484
485 portdata = usb_get_serial_port_data(port);
486
487 dbg("%s", __FUNCTION__);
488
489 /* Set some sane defaults */
490 portdata->rts_state = 1;
491 portdata->dtr_state = 1;
492
493 /* Reset low level data toggle and start reading from endpoints */
494 for (i = 0; i < N_IN_URB; i++) {
495 urb = portdata->in_urbs[i];
496 if (! urb)
497 continue;
498 if (urb->dev != serial->dev) {
499 dbg("%s: dev %p != %p", __FUNCTION__, urb->dev, serial->dev);
500 continue;
501 }
502
503 /* make sure endpoint data toggle is synchronized with the device */
504
505 usb_clear_halt(urb->dev, urb->pipe);
506
507 err = usb_submit_urb(urb, GFP_KERNEL);
508 if (err) {
509 dbg("%s: submit urb %d failed (%d) %d", __FUNCTION__, i, err,
510 urb->transfer_buffer_length);
511 }
512 }
513
514 /* Reset low level data toggle on out endpoints */
515 for (i = 0; i < N_OUT_URB; i++) {
516 urb = portdata->out_urbs[i];
517 if (! urb)
518 continue;
519 urb->dev = serial->dev;
520 /* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe), 0); */
521 }
522
523 port->tty->low_latency = 1;
524
525 option_send_setup(port);
526
527 return (0);
528}
529
530static inline void
531stop_urb(struct urb *urb)
532{
533 if (urb && urb->status == -EINPROGRESS) {
534 urb->transfer_flags &= ~URB_ASYNC_UNLINK;
535 usb_kill_urb(urb);
536 }
537}
538
539static void
540option_close(struct usb_serial_port *port, struct file *filp)
541{
542 int i;
543 struct usb_serial *serial = port->serial;
544 struct option_port_private *portdata;
545
546 dbg("%s", __FUNCTION__);
547 portdata = usb_get_serial_port_data(port);
548
549 portdata->rts_state = 0;
550 portdata->dtr_state = 0;
551
552 if (serial->dev) {
553 option_send_setup(port);
554
555 /* Stop reading/writing urbs */
556 for (i = 0; i < N_IN_URB; i++)
557 stop_urb(portdata->in_urbs[i]);
558 for (i = 0; i < N_OUT_URB; i++)
559 stop_urb(portdata->out_urbs[i]);
560 }
561 port->tty = NULL;
562}
563
564
565/* Helper functions used by option_setup_urbs */
566static struct urb *
567option_setup_urb (struct usb_serial *serial, int endpoint,
568 int dir, void *ctx, char *buf, int len,
569 void (*callback)(struct urb *, struct pt_regs *regs))
570{
571 struct urb *urb;
572
573 if (endpoint == -1)
574 return NULL; /* endpoint not needed */
575
576 urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
577 if (urb == NULL) {
578 dbg("%s: alloc for endpoint %d failed.", __FUNCTION__, endpoint);
579 return NULL;
580 }
581
582 /* Fill URB using supplied data. */
583 usb_fill_bulk_urb(urb, serial->dev,
584 usb_sndbulkpipe(serial->dev, endpoint) | dir,
585 buf, len, callback, ctx);
586
587 return urb;
588}
589
590/* Setup urbs */
591static void
592option_setup_urbs(struct usb_serial *serial)
593{
594 int j;
595 struct usb_serial_port *port;
596 struct option_port_private *portdata;
597
598 dbg("%s", __FUNCTION__);
599
600 port = serial->port[0];
601 portdata = usb_get_serial_port_data(port);
602
603 /* Do indat endpoints first */
604 for (j = 0; j <= N_IN_URB; ++j) {
605 portdata->in_urbs[j] = option_setup_urb (serial,
606 port->bulk_in_endpointAddress, USB_DIR_IN, port,
607 portdata->in_buffer[j], IN_BUFLEN, option_indat_callback);
608 }
609
610 /* outdat endpoints */
611 for (j = 0; j <= N_OUT_URB; ++j) {
612 portdata->out_urbs[j] = option_setup_urb (serial,
613 port->bulk_out_endpointAddress, USB_DIR_OUT, port,
614 portdata->out_buffer[j], OUT_BUFLEN, option_outdat_callback);
615 }
616}
617
618
619static int
620option_send_setup(struct usb_serial_port *port)
621{
622 struct usb_serial *serial = port->serial;
623 struct option_port_private *portdata;
624
625 dbg("%s", __FUNCTION__);
626
627 portdata = usb_get_serial_port_data(port);
628
629 if (port->tty) {
630 int val = 0;
631 if (portdata->dtr_state)
632 val |= 0x01;
633 if (portdata->rts_state)
634 val |= 0x02;
635
636 return usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
637 0x22,0x21,val,0,NULL,0,USB_CTRL_SET_TIMEOUT);
638 }
639
640 return 0;
641}
642
643
644static int
645option_startup (struct usb_serial *serial)
646{
647 int i, err;
648 struct usb_serial_port *port;
649 struct option_port_private *portdata;
650
651 dbg("%s", __FUNCTION__);
652
653 /* Now setup per port private data */
654 for (i = 0; i < serial->num_ports; i++) {
655 port = serial->port[i];
656 portdata = kmalloc(sizeof(struct option_port_private), GFP_KERNEL);
657 if (!portdata) {
658 dbg("%s: kmalloc for option_port_private (%d) failed!.", __FUNCTION__, i);
659 return (1);
660 }
661 memset(portdata, 0, sizeof(struct option_port_private));
662
663 usb_set_serial_port_data(port, portdata);
664
665 if (! port->interrupt_in_urb)
666 continue;
667 err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
668 if (err)
669 dbg("%s: submit irq_in urb failed %d", __FUNCTION__, err);
670 }
671
672 option_setup_urbs(serial);
673
674 return (0);
675}
676
677static void
678option_shutdown (struct usb_serial *serial)
679{
680 int i, j;
681 struct usb_serial_port *port;
682 struct option_port_private *portdata;
683
684 dbg("%s", __FUNCTION__);
685
686 /* Stop reading/writing urbs */
687 for (i = 0; i < serial->num_ports; ++i) {
688 port = serial->port[i];
689 portdata = usb_get_serial_port_data(port);
690 for (j = 0; j < N_IN_URB; j++)
691 stop_urb(portdata->in_urbs[j]);
692 for (j = 0; j < N_OUT_URB; j++)
693 stop_urb(portdata->out_urbs[j]);
694 }
695
696 /* Now free them */
697 for (i = 0; i < serial->num_ports; ++i) {
698 port = serial->port[i];
699 portdata = usb_get_serial_port_data(port);
700
701 for (j = 0; j < N_IN_URB; j++) {
702 if (portdata->in_urbs[j]) {
703 usb_free_urb(portdata->in_urbs[j]);
704 portdata->in_urbs[j] = NULL;
705 }
706 }
707 for (j = 0; j < N_OUT_URB; j++) {
708 if (portdata->out_urbs[j]) {
709 usb_free_urb(portdata->out_urbs[j]);
710 portdata->out_urbs[j] = NULL;
711 }
712 }
713 }
714
715 /* Now free per port private data */
716 for (i = 0; i < serial->num_ports; i++) {
717 port = serial->port[i];
718 kfree(usb_get_serial_port_data(port));
719 }
720}
721
722MODULE_AUTHOR(DRIVER_AUTHOR);
723MODULE_DESCRIPTION(DRIVER_DESC);
724MODULE_VERSION(DRIVER_VERSION);
725MODULE_LICENSE("GPL");
726
727module_param(debug, bool, S_IRUGO | S_IWUSR);
728MODULE_PARM_DESC(debug, "Debug messages");
729
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 4536f63faaea..5da76dd8fb28 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -1297,13 +1297,6 @@ static int __init usb_serial_init(void)
1297 goto exit_bus; 1297 goto exit_bus;
1298 } 1298 }
1299 1299
1300 /* register the generic driver, if we should */
1301 result = usb_serial_generic_register(debug);
1302 if (result < 0) {
1303 err("%s - registering generic driver failed", __FUNCTION__);
1304 goto exit_generic;
1305 }
1306
1307 usb_serial_tty_driver->owner = THIS_MODULE; 1300 usb_serial_tty_driver->owner = THIS_MODULE;
1308 usb_serial_tty_driver->driver_name = "usbserial"; 1301 usb_serial_tty_driver->driver_name = "usbserial";
1309 usb_serial_tty_driver->devfs_name = "usb/tts/"; 1302 usb_serial_tty_driver->devfs_name = "usb/tts/";
@@ -1329,17 +1322,24 @@ static int __init usb_serial_init(void)
1329 goto exit_tty; 1322 goto exit_tty;
1330 } 1323 }
1331 1324
1325 /* register the generic driver, if we should */
1326 result = usb_serial_generic_register(debug);
1327 if (result < 0) {
1328 err("%s - registering generic driver failed", __FUNCTION__);
1329 goto exit_generic;
1330 }
1331
1332 info(DRIVER_DESC " " DRIVER_VERSION); 1332 info(DRIVER_DESC " " DRIVER_VERSION);
1333 1333
1334 return result; 1334 return result;
1335 1335
1336exit_generic:
1337 usb_deregister(&usb_serial_driver);
1338
1336exit_tty: 1339exit_tty:
1337 tty_unregister_driver(usb_serial_tty_driver); 1340 tty_unregister_driver(usb_serial_tty_driver);
1338 1341
1339exit_reg_driver: 1342exit_reg_driver:
1340 usb_serial_generic_deregister();
1341
1342exit_generic:
1343 bus_unregister(&usb_serial_bus_type); 1343 bus_unregister(&usb_serial_bus_type);
1344 1344
1345exit_bus: 1345exit_bus:
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 22e48a2b0bd1..e43eddc3d44b 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -233,13 +233,11 @@ static int command_abort(struct scsi_cmnd *srb)
233 set_bit(US_FLIDX_ABORTING, &us->flags); 233 set_bit(US_FLIDX_ABORTING, &us->flags);
234 usb_stor_stop_transport(us); 234 usb_stor_stop_transport(us);
235 } 235 }
236 scsi_unlock(us_to_host(us));
237 236
238 /* Wait for the aborted command to finish */ 237 /* Wait for the aborted command to finish */
239 wait_for_completion(&us->notify); 238 wait_for_completion(&us->notify);
240 239
241 /* Reacquire the lock and allow USB transfers to resume */ 240 /* Reacquire the lock and allow USB transfers to resume */
242 scsi_lock(us_to_host(us));
243 clear_bit(US_FLIDX_ABORTING, &us->flags); 241 clear_bit(US_FLIDX_ABORTING, &us->flags);
244 clear_bit(US_FLIDX_TIMED_OUT, &us->flags); 242 clear_bit(US_FLIDX_TIMED_OUT, &us->flags);
245 return SUCCESS; 243 return SUCCESS;
@@ -255,8 +253,6 @@ static int device_reset(struct scsi_cmnd *srb)
255 253
256 US_DEBUGP("%s called\n", __FUNCTION__); 254 US_DEBUGP("%s called\n", __FUNCTION__);
257 255
258 scsi_unlock(us_to_host(us));
259
260 /* lock the device pointers and do the reset */ 256 /* lock the device pointers and do the reset */
261 down(&(us->dev_semaphore)); 257 down(&(us->dev_semaphore));
262 if (test_bit(US_FLIDX_DISCONNECTING, &us->flags)) { 258 if (test_bit(US_FLIDX_DISCONNECTING, &us->flags)) {
@@ -266,8 +262,6 @@ static int device_reset(struct scsi_cmnd *srb)
266 result = us->transport_reset(us); 262 result = us->transport_reset(us);
267 up(&(us->dev_semaphore)); 263 up(&(us->dev_semaphore));
268 264
269 /* lock the host for the return */
270 scsi_lock(us_to_host(us));
271 return result; 265 return result;
272} 266}
273 267
@@ -282,8 +276,6 @@ static int bus_reset(struct scsi_cmnd *srb)
282 276
283 US_DEBUGP("%s called\n", __FUNCTION__); 277 US_DEBUGP("%s called\n", __FUNCTION__);
284 278
285 scsi_unlock(us_to_host(us));
286
287 /* The USB subsystem doesn't handle synchronisation between 279 /* The USB subsystem doesn't handle synchronisation between
288 * a device's several drivers. Therefore we reset only devices 280 * a device's several drivers. Therefore we reset only devices
289 * with just one interface, which we of course own. */ 281 * with just one interface, which we of course own. */
@@ -310,7 +302,6 @@ static int bus_reset(struct scsi_cmnd *srb)
310 up(&(us->dev_semaphore)); 302 up(&(us->dev_semaphore));
311 303
312 /* lock the host for the return */ 304 /* lock the host for the return */
313 scsi_lock(us_to_host(us));
314 return result < 0 ? FAILED : SUCCESS; 305 return result < 0 ? FAILED : SUCCESS;
315} 306}
316 307
@@ -407,7 +398,7 @@ US_DO_ALL_FLAGS
407 ***********************************************************************/ 398 ***********************************************************************/
408 399
409/* Output routine for the sysfs max_sectors file */ 400/* Output routine for the sysfs max_sectors file */
410static ssize_t show_max_sectors(struct device *dev, char *buf) 401static ssize_t show_max_sectors(struct device *dev, struct device_attribute *attr, char *buf)
411{ 402{
412 struct scsi_device *sdev = to_scsi_device(dev); 403 struct scsi_device *sdev = to_scsi_device(dev);
413 404
@@ -415,7 +406,7 @@ static ssize_t show_max_sectors(struct device *dev, char *buf)
415} 406}
416 407
417/* Input routine for the sysfs max_sectors file */ 408/* Input routine for the sysfs max_sectors file */
418static ssize_t store_max_sectors(struct device *dev, const char *buf, 409static ssize_t store_max_sectors(struct device *dev, struct device_attribute *attr, const char *buf,
419 size_t count) 410 size_t count)
420{ 411{
421 struct scsi_device *sdev = to_scsi_device(dev); 412 struct scsi_device *sdev = to_scsi_device(dev);
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index d2891f475793..9fcc7bd1fbe4 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -862,6 +862,15 @@ UNUSUAL_DEV( 0x090a, 0x1001, 0x0100, 0x0100,
862 US_SC_DEVICE, US_PR_BULK, NULL, 862 US_SC_DEVICE, US_PR_BULK, NULL,
863 US_FL_NEED_OVERRIDE ), 863 US_FL_NEED_OVERRIDE ),
864 864
865/* Reported by Filippo Bardelli <filibard@libero.it>
866 * The device reports a subclass of RBC, which is wrong.
867 */
868UNUSUAL_DEV( 0x090a, 0x1050, 0x0100, 0x0100,
869 "Trumpion Microelectronics, Inc.",
870 "33520 USB Digital Voice Recorder",
871 US_SC_UFI, US_PR_DEVICE, NULL,
872 0),
873
865/* Trumpion Microelectronics MP3 player (felipe_alfaro@linuxmail.org) */ 874/* Trumpion Microelectronics MP3 player (felipe_alfaro@linuxmail.org) */
866UNUSUAL_DEV( 0x090a, 0x1200, 0x0000, 0x9999, 875UNUSUAL_DEV( 0x090a, 0x1200, 0x0000, 0x9999,
867 "Trumpion", 876 "Trumpion",
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 6be8fbec0a0e..04d3120f7236 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -322,6 +322,22 @@ config FB_FM2
322 This is the frame buffer device driver for the Amiga FrameMaster 322 This is the frame buffer device driver for the Amiga FrameMaster
323 card from BSC (exhibited 1992 but not shipped as a CBM product). 323 card from BSC (exhibited 1992 but not shipped as a CBM product).
324 324
325config FB_ARC
326 tristate "Arc Monochrome LCD board support"
327 depends on FB && X86
328 select FB_CFB_FILLRECT
329 select FB_CFB_COPYAREA
330 select FB_CFB_IMAGEBLIT
331 select FB_SOFT_CURSOR
332 help
333 This enables support for the Arc Monochrome LCD board. The board
334 is based on the KS-108 lcd controller and is typically a matrix
335 of 2*n chips. This driver was tested with a 128x64 panel. This
336 driver supports it for use with x86 SBCs through a 16 bit GPIO
337 interface (8 bit data, 8 bit control). If you anticpate using
338 this driver, say Y or M; otherwise say N. You must specify the
339 GPIO IO address to be used for setting control and data.
340
325config FB_ATARI 341config FB_ATARI
326 bool "Atari native chipset support" 342 bool "Atari native chipset support"
327 depends on (FB = y) && ATARI && BROKEN 343 depends on (FB = y) && ATARI && BROKEN
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index bd8dc0ffe723..b018df4e95c8 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -21,6 +21,7 @@ obj-$(CONFIG_FB_MACMODES) += macmodes.o
21# Hardware specific drivers go first 21# Hardware specific drivers go first
22obj-$(CONFIG_FB_RETINAZ3) += retz3fb.o 22obj-$(CONFIG_FB_RETINAZ3) += retz3fb.o
23obj-$(CONFIG_FB_AMIGA) += amifb.o c2p.o 23obj-$(CONFIG_FB_AMIGA) += amifb.o c2p.o
24obj-$(CONFIG_FB_ARC) += arcfb.o
24obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o 25obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o
25obj-$(CONFIG_FB_CYBER) += cyberfb.o 26obj-$(CONFIG_FB_CYBER) += cyberfb.o
26obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o 27obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
new file mode 100644
index 000000000000..d28457e0c063
--- /dev/null
+++ b/drivers/video/arcfb.c
@@ -0,0 +1,684 @@
1/*
2 * linux/drivers/video/arcfb.c -- FB driver for Arc monochrome LCD board
3 *
4 * Copyright (C) 2005, Jaya Kumar <jayalk@intworks.biz>
5 * http://www.intworks.biz/arclcd
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file COPYING in the main directory of this archive for
9 * more details.
10 *
11 * Layout is based on skeletonfb.c by James Simmons and Geert Uytterhoeven.
12 *
13 * This driver was written to be used with the Arc LCD board. Arc uses a
14 * set of KS108 chips that control individual 64x64 LCD matrices. The board
15 * can be paneled in a variety of setups such as 2x1=128x64, 4x4=256x256 and
16 * so on. The interface between the board and the host is TTL based GPIO. The
17 * GPIO requirements are 8 writable data lines and 4+n lines for control. On a
18 * GPIO-less system, the board can be tested by connecting the respective sigs
19 * up to a parallel port connector. The driver requires the IO addresses for
20 * data and control GPIO at load time. It is unable to probe for the
21 * existence of the LCD so it must be told at load time whether it should
22 * be enabled or not.
23 *
24 * Todo:
25 * - testing with 4x4
26 * - testing with interrupt hw
27 *
28 * General notes:
29 * - User must set tuhold. It's in microseconds. According to the 108 spec,
30 * the hold time is supposed to be at least 1 microsecond.
31 * - User must set num_cols=x num_rows=y, eg: x=2 means 128
32 * - User must set arcfb_enable=1 to enable it
33 * - User must set dio_addr=0xIOADDR cio_addr=0xIOADDR
34 *
35 */
36
37#include <linux/module.h>
38#include <linux/kernel.h>
39#include <linux/errno.h>
40#include <linux/string.h>
41#include <linux/mm.h>
42#include <linux/tty.h>
43#include <linux/slab.h>
44#include <linux/vmalloc.h>
45#include <linux/delay.h>
46#include <linux/interrupt.h>
47#include <linux/fb.h>
48#include <linux/init.h>
49#include <linux/arcfb.h>
50
51#include <asm/uaccess.h>
52
53#define floor8(a) (a&(~0x07))
54#define floorXres(a,xres) (a&(~(xres - 1)))
55#define iceil8(a) (((int)((a+7)/8))*8)
56#define ceil64(a) (a|0x3F)
57#define ceilXres(a,xres) (a|(xres - 1))
58
59/* ks108 chipset specific defines and code */
60
61#define KS_SET_DPY_START_LINE 0xC0
62#define KS_SET_PAGE_NUM 0xB8
63#define KS_SET_X 0x40
64#define KS_CEHI 0x01
65#define KS_CELO 0x00
66#define KS_SEL_CMD 0x08
67#define KS_SEL_DATA 0x00
68#define KS_DPY_ON 0x3F
69#define KS_DPY_OFF 0x3E
70#define KS_INTACK 0x40
71#define KS_CLRINT 0x02
72
73struct arcfb_par {
74 unsigned long dio_addr;
75 unsigned long cio_addr;
76 unsigned long c2io_addr;
77 atomic_t ref_count;
78 unsigned char cslut[9];
79 struct fb_info *info;
80 unsigned int irq;
81 spinlock_t lock;
82};
83
84static struct fb_fix_screeninfo arcfb_fix __initdata = {
85 .id = "arcfb",
86 .type = FB_TYPE_PACKED_PIXELS,
87 .visual = FB_VISUAL_MONO01,
88 .xpanstep = 0,
89 .ypanstep = 1,
90 .ywrapstep = 0,
91 .accel = FB_ACCEL_NONE,
92};
93
94static struct fb_var_screeninfo arcfb_var __initdata = {
95 .xres = 128,
96 .yres = 64,
97 .xres_virtual = 128,
98 .yres_virtual = 64,
99 .bits_per_pixel = 1,
100 .nonstd = 1,
101};
102
103static unsigned long num_cols;
104static unsigned long num_rows;
105static unsigned long dio_addr;
106static unsigned long cio_addr;
107static unsigned long c2io_addr;
108static unsigned long splashval;
109static unsigned long tuhold;
110static unsigned int nosplash;
111static unsigned int arcfb_enable;
112static unsigned int irq;
113
114static DECLARE_WAIT_QUEUE_HEAD(arcfb_waitq);
115
116static void ks108_writeb_ctl(struct arcfb_par *par,
117 unsigned int chipindex, unsigned char value)
118{
119 unsigned char chipselval = par->cslut[chipindex];
120
121 outb(chipselval|KS_CEHI|KS_SEL_CMD, par->cio_addr);
122 outb(value, par->dio_addr);
123 udelay(tuhold);
124 outb(chipselval|KS_CELO|KS_SEL_CMD, par->cio_addr);
125}
126
127static void ks108_writeb_mainctl(struct arcfb_par *par, unsigned char value)
128{
129
130 outb(value, par->cio_addr);
131 udelay(tuhold);
132}
133
134static unsigned char ks108_readb_ctl2(struct arcfb_par *par)
135{
136 return inb(par->c2io_addr);
137}
138
139static void ks108_writeb_data(struct arcfb_par *par,
140 unsigned int chipindex, unsigned char value)
141{
142 unsigned char chipselval = par->cslut[chipindex];
143
144 outb(chipselval|KS_CEHI|KS_SEL_DATA, par->cio_addr);
145 outb(value, par->dio_addr);
146 udelay(tuhold);
147 outb(chipselval|KS_CELO|KS_SEL_DATA, par->cio_addr);
148}
149
150static void ks108_set_start_line(struct arcfb_par *par,
151 unsigned int chipindex, unsigned char y)
152{
153 ks108_writeb_ctl(par, chipindex, KS_SET_DPY_START_LINE|y);
154}
155
156static void ks108_set_yaddr(struct arcfb_par *par,
157 unsigned int chipindex, unsigned char y)
158{
159 ks108_writeb_ctl(par, chipindex, KS_SET_PAGE_NUM|y);
160}
161
162static void ks108_set_xaddr(struct arcfb_par *par,
163 unsigned int chipindex, unsigned char x)
164{
165 ks108_writeb_ctl(par, chipindex, KS_SET_X|x);
166}
167
168static void ks108_clear_lcd(struct arcfb_par *par, unsigned int chipindex)
169{
170 int i,j;
171
172 for (i = 0; i <= 8; i++) {
173 ks108_set_yaddr(par, chipindex, i);
174 ks108_set_xaddr(par, chipindex, 0);
175 for (j = 0; j < 64; j++) {
176 ks108_writeb_data(par, chipindex,
177 (unsigned char) splashval);
178 }
179 }
180}
181
182/* main arcfb functions */
183
184static int arcfb_open(struct fb_info *info, int user)
185{
186 struct arcfb_par *par = info->par;
187
188 atomic_inc(&par->ref_count);
189 return 0;
190}
191
192static int arcfb_release(struct fb_info *info, int user)
193{
194 struct arcfb_par *par = info->par;
195 int count = atomic_read(&par->ref_count);
196
197 if (!count)
198 return -EINVAL;
199 atomic_dec(&par->ref_count);
200 return 0;
201}
202
203static int arcfb_pan_display(struct fb_var_screeninfo *var,
204 struct fb_info *info)
205{
206 int i;
207 struct arcfb_par *par = info->par;
208
209 if ((var->vmode & FB_VMODE_YWRAP) && (var->yoffset < 64)
210 && (info->var.yres <= 64)) {
211 for (i = 0; i < num_cols; i++) {
212 ks108_set_start_line(par, i, var->yoffset);
213 }
214 info->var.yoffset = var->yoffset;
215 return 0;
216 }
217
218 return -EINVAL;
219}
220
221static irqreturn_t arcfb_interrupt(int vec, void *dev_instance,
222 struct pt_regs *regs)
223{
224 struct fb_info *info = dev_instance;
225 unsigned char ctl2status;
226 struct arcfb_par *par = info->par;
227
228 ctl2status = ks108_readb_ctl2(par);
229
230 if (!(ctl2status & KS_INTACK)) /* not arc generated interrupt */
231 return IRQ_NONE;
232
233 ks108_writeb_mainctl(par, KS_CLRINT);
234
235 spin_lock(&par->lock);
236 if (waitqueue_active(&arcfb_waitq)) {
237 wake_up(&arcfb_waitq);
238 }
239 spin_unlock(&par->lock);
240
241 return IRQ_HANDLED;
242}
243
244/*
245 * here we handle a specific page on the lcd. the complexity comes from
246 * the fact that the fb is laidout in 8xX vertical columns. we extract
247 * each write of 8 vertical pixels. then we shift out as we move along
248 * X. That's what rightshift does. bitmask selects the desired input bit.
249 */
250static void arcfb_lcd_update_page(struct arcfb_par *par, unsigned int upper,
251 unsigned int left, unsigned int right, unsigned int distance)
252{
253 unsigned char *src;
254 unsigned int xindex, yindex, chipindex, linesize;
255 int i, count;
256 unsigned char val;
257 unsigned char bitmask, rightshift;
258
259 xindex = left >> 6;
260 yindex = upper >> 6;
261 chipindex = (xindex + (yindex*num_cols));
262
263 ks108_set_yaddr(par, chipindex, upper/8);
264
265 linesize = par->info->var.xres/8;
266 src = par->info->screen_base + (left/8) + (upper * linesize);
267 ks108_set_xaddr(par, chipindex, left);
268
269 bitmask=1;
270 rightshift=0;
271 while (left <= right) {
272 val = 0;
273 for (i = 0; i < 8; i++) {
274 if ( i > rightshift) {
275 val |= (*(src + (i*linesize)) & bitmask)
276 << (i - rightshift);
277 } else {
278 val |= (*(src + (i*linesize)) & bitmask)
279 >> (rightshift - i);
280 }
281 }
282 ks108_writeb_data(par, chipindex, val);
283 left++;
284 count++;
285 if (bitmask == 0x80) {
286 bitmask = 1;
287 src++;
288 rightshift=0;
289 } else {
290 bitmask <<= 1;
291 rightshift++;
292 }
293 }
294}
295
296/*
297 * here we handle the entire vertical page of the update. we write across
298 * lcd chips. update_page uses the upper/left values to decide which
299 * chip to select for the right. upper is needed for setting the page
300 * desired for the write.
301 */
302static void arcfb_lcd_update_vert(struct arcfb_par *par, unsigned int top,
303 unsigned int bottom, unsigned int left, unsigned int right)
304{
305 unsigned int distance, upper, lower;
306
307 distance = (bottom - top) + 1;
308 upper = top;
309 lower = top + 7;
310
311 while (distance > 0) {
312 distance -= 8;
313 arcfb_lcd_update_page(par, upper, left, right, 8);
314 upper = lower + 1;
315 lower = upper + 7;
316 }
317}
318
319/*
320 * here we handle horizontal blocks for the update. update_vert will
321 * handle spaning multiple pages. we break out each horizontal
322 * block in to individual blocks no taller than 64 pixels.
323 */
324static void arcfb_lcd_update_horiz(struct arcfb_par *par, unsigned int left,
325 unsigned int right, unsigned int top, unsigned int h)
326{
327 unsigned int distance, upper, lower;
328
329 distance = h;
330 upper = floor8(top);
331 lower = min(upper + distance - 1, ceil64(upper));
332
333 while (distance > 0) {
334 distance -= ((lower - upper) + 1 );
335 arcfb_lcd_update_vert(par, upper, lower, left, right);
336 upper = lower + 1;
337 lower = min(upper + distance - 1, ceil64(upper));
338 }
339}
340
341/*
342 * here we start the process of spliting out the fb update into
343 * individual blocks of pixels. we end up spliting into 64x64 blocks
344 * and finally down to 64x8 pages.
345 */
346static void arcfb_lcd_update(struct arcfb_par *par, unsigned int dx,
347 unsigned int dy, unsigned int w, unsigned int h)
348{
349 unsigned int left, right, distance, y;
350
351 /* align the request first */
352 y = floor8(dy);
353 h += dy - y;
354 h = iceil8(h);
355
356 distance = w;
357 left = dx;
358 right = min(left + w - 1, ceil64(left));
359
360 while (distance > 0) {
361 arcfb_lcd_update_horiz(par, left, right, y, h);
362 distance -= ((right - left) + 1);
363 left = right + 1;
364 right = min(left + distance - 1, ceil64(left));
365 }
366}
367
368void arcfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
369{
370 struct arcfb_par *par = info->par;
371
372 cfb_fillrect(info, rect);
373
374 /* update the physical lcd */
375 arcfb_lcd_update(par, rect->dx, rect->dy, rect->width, rect->height);
376}
377
378void arcfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
379{
380 struct arcfb_par *par = info->par;
381
382 cfb_copyarea(info, area);
383
384 /* update the physical lcd */
385 arcfb_lcd_update(par, area->dx, area->dy, area->width, area->height);
386}
387
388void arcfb_imageblit(struct fb_info *info, const struct fb_image *image)
389{
390 struct arcfb_par *par = info->par;
391
392 cfb_imageblit(info, image);
393
394 /* update the physical lcd */
395 arcfb_lcd_update(par, image->dx, image->dy, image->width,
396 image->height);
397}
398
399static int arcfb_ioctl(struct inode *inode, struct file *file,
400 unsigned int cmd, unsigned long arg,
401 struct fb_info *info)
402{
403 void __user *argp = (void __user *)arg;
404 struct arcfb_par *par = info->par;
405 unsigned long flags;
406
407 switch (cmd) {
408 case FBIO_WAITEVENT:
409 {
410 DEFINE_WAIT(wait);
411 /* illegal to wait on arc if no irq will occur */
412 if (!par->irq)
413 return -EINVAL;
414
415 /* wait until the Arc has generated an interrupt
416 * which will wake us up */
417 spin_lock_irqsave(&par->lock, flags);
418 prepare_to_wait(&arcfb_waitq, &wait,
419 TASK_INTERRUPTIBLE);
420 spin_unlock_irqrestore(&par->lock, flags);
421 schedule();
422 finish_wait(&arcfb_waitq, &wait);
423 }
424 case FBIO_GETCONTROL2:
425 {
426 unsigned char ctl2;
427
428 ctl2 = ks108_readb_ctl2(info->par);
429 if (copy_to_user(argp, &ctl2, sizeof(ctl2)))
430 return -EFAULT;
431 return 0;
432 }
433 default:
434 return -EINVAL;
435 }
436}
437
438/*
439 * this is the access path from userspace. they can seek and write to
440 * the fb. it's inefficient for them to do anything less than 64*8
441 * writes since we update the lcd in each write() anyway.
442 */
443static ssize_t arcfb_write(struct file *file, const char *buf, size_t count,
444 loff_t *ppos)
445{
446 /* modded from epson 1355 */
447
448 struct inode *inode;
449 int fbidx;
450 struct fb_info *info;
451 unsigned long p;
452 int err=-EINVAL;
453 unsigned int fbmemlength,x,y,w,h, bitppos, startpos, endpos, bitcount;
454 struct arcfb_par *par;
455 unsigned int xres;
456
457 p = *ppos;
458 inode = file->f_dentry->d_inode;
459 fbidx = iminor(inode);
460 info = registered_fb[fbidx];
461 par = info->par;
462
463 if (!info || !info->screen_base)
464 return -ENODEV;
465
466 xres = info->var.xres;
467 fbmemlength = (xres * info->var.yres)/8;
468
469 if (p > fbmemlength)
470 return -ENOSPC;
471
472 err = 0;
473 if ((count + p) > fbmemlength) {
474 count = fbmemlength - p;
475 err = -ENOSPC;
476 }
477
478 if (count) {
479 char *base_addr;
480
481 base_addr = info->screen_base;
482 count -= copy_from_user(base_addr + p, buf, count);
483 *ppos += count;
484 err = -EFAULT;
485 }
486
487
488 bitppos = p*8;
489 startpos = floorXres(bitppos, xres);
490 endpos = ceilXres((bitppos + (count*8)), xres);
491 bitcount = endpos - startpos;
492
493 x = startpos % xres;
494 y = startpos / xres;
495 w = xres;
496 h = bitcount / xres;
497 arcfb_lcd_update(par, x, y, w, h);
498
499 if (count)
500 return count;
501 return err;
502}
503
504static void arcfb_platform_release(struct device *device)
505{
506}
507
508static struct fb_ops arcfb_ops = {
509 .owner = THIS_MODULE,
510 .fb_open = arcfb_open,
511 .fb_write = arcfb_write,
512 .fb_release = arcfb_release,
513 .fb_pan_display = arcfb_pan_display,
514 .fb_fillrect = arcfb_fillrect,
515 .fb_copyarea = arcfb_copyarea,
516 .fb_imageblit = arcfb_imageblit,
517 .fb_cursor = soft_cursor,
518 .fb_ioctl = arcfb_ioctl,
519};
520
521static int __init arcfb_probe(struct device *device)
522{
523 struct platform_device *dev = to_platform_device(device);
524 struct fb_info *info;
525 int retval = -ENOMEM;
526 int videomemorysize;
527 unsigned char *videomemory;
528 struct arcfb_par *par;
529 int i;
530
531 videomemorysize = (((64*64)*num_cols)*num_rows)/8;
532
533 /* We need a flat backing store for the Arc's
534 less-flat actual paged framebuffer */
535 if (!(videomemory = vmalloc(videomemorysize)))
536 return retval;
537
538 memset(videomemory, 0, videomemorysize);
539
540 info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
541 if (!info)
542 goto err;
543
544 info->screen_base = (char __iomem *)videomemory;
545 info->fbops = &arcfb_ops;
546
547 info->var = arcfb_var;
548 info->fix = arcfb_fix;
549 par = info->par;
550 par->info = info;
551
552 if (!dio_addr || !cio_addr || !c2io_addr) {
553 printk(KERN_WARNING "no IO addresses supplied\n");
554 goto err1;
555 }
556 par->dio_addr = dio_addr;
557 par->cio_addr = cio_addr;
558 par->c2io_addr = c2io_addr;
559 par->cslut[0] = 0x00;
560 par->cslut[1] = 0x06;
561 info->flags = FBINFO_FLAG_DEFAULT;
562 spin_lock_init(&par->lock);
563 retval = register_framebuffer(info);
564 if (retval < 0)
565 goto err1;
566 dev_set_drvdata(&dev->dev, info);
567 if (irq) {
568 par->irq = irq;
569 if (request_irq(par->irq, &arcfb_interrupt, SA_SHIRQ,
570 "arcfb", info)) {
571 printk(KERN_INFO
572 "arcfb: Failed req IRQ %d\n", par->irq);
573 goto err1;
574 }
575 }
576 printk(KERN_INFO
577 "fb%d: Arc frame buffer device, using %dK of video memory\n",
578 info->node, videomemorysize >> 10);
579
580 /* this inits the lcd but doesn't clear dirty pixels */
581 for (i = 0; i < num_cols * num_rows; i++) {
582 ks108_writeb_ctl(par, i, KS_DPY_OFF);
583 ks108_set_start_line(par, i, 0);
584 ks108_set_yaddr(par, i, 0);
585 ks108_set_xaddr(par, i, 0);
586 ks108_writeb_ctl(par, i, KS_DPY_ON);
587 }
588
589 /* if we were told to splash the screen, we just clear it */
590 if (!nosplash) {
591 for (i = 0; i < num_cols * num_rows; i++) {
592 printk(KERN_INFO "fb%d: splashing lcd %d\n",
593 info->node, i);
594 ks108_set_start_line(par, i, 0);
595 ks108_clear_lcd(par, i);
596 }
597 }
598
599 return 0;
600err1:
601 framebuffer_release(info);
602err:
603 vfree(videomemory);
604 return retval;
605}
606
607static int arcfb_remove(struct device *device)
608{
609 struct fb_info *info = dev_get_drvdata(device);
610
611 if (info) {
612 unregister_framebuffer(info);
613 vfree(info->screen_base);
614 framebuffer_release(info);
615 }
616 return 0;
617}
618
619static struct device_driver arcfb_driver = {
620 .name = "arcfb",
621 .bus = &platform_bus_type,
622 .probe = arcfb_probe,
623 .remove = arcfb_remove,
624};
625
626static struct platform_device arcfb_device = {
627 .name = "arcfb",
628 .id = 0,
629 .dev = {
630 .release = arcfb_platform_release,
631 }
632};
633
634static int __init arcfb_init(void)
635{
636 int ret;
637
638 if (!arcfb_enable)
639 return -ENXIO;
640
641 ret = driver_register(&arcfb_driver);
642 if (!ret) {
643 ret = platform_device_register(&arcfb_device);
644 if (ret)
645 driver_unregister(&arcfb_driver);
646 }
647 return ret;
648
649}
650
651static void __exit arcfb_exit(void)
652{
653 platform_device_unregister(&arcfb_device);
654 driver_unregister(&arcfb_driver);
655}
656
657module_param(num_cols, ulong, 0);
658MODULE_PARM_DESC(num_cols, "Num horiz panels, eg: 2 = 128 bit wide");
659module_param(num_rows, ulong, 0);
660MODULE_PARM_DESC(num_rows, "Num vert panels, eg: 1 = 64 bit high");
661module_param(nosplash, uint, 0);
662MODULE_PARM_DESC(nosplash, "Disable doing the splash screen");
663module_param(arcfb_enable, uint, 0);
664MODULE_PARM_DESC(arcfb_enable, "Enable communication with Arc board");
665module_param(dio_addr, ulong, 0);
666MODULE_PARM_DESC(dio_addr, "IO address for data, eg: 0x480");
667module_param(cio_addr, ulong, 0);
668MODULE_PARM_DESC(cio_addr, "IO address for control, eg: 0x400");
669module_param(c2io_addr, ulong, 0);
670MODULE_PARM_DESC(c2io_addr, "IO address for secondary control, eg: 0x408");
671module_param(splashval, ulong, 0);
672MODULE_PARM_DESC(splashval, "Splash pattern: 0xFF is black, 0x00 is green");
673module_param(tuhold, ulong, 0);
674MODULE_PARM_DESC(tuhold, "Time to hold between strobing data to Arc board");
675module_param(irq, uint, 0);
676MODULE_PARM_DESC(irq, "IRQ for the Arc board");
677
678module_init(arcfb_init);
679module_exit(arcfb_exit);
680
681MODULE_DESCRIPTION("fbdev driver for Arc monochrome LCD board");
682MODULE_AUTHOR("Jaya Kumar");
683MODULE_LICENSE("GPL");
684
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index ee25b9e8db60..47a6b12bc968 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -2374,10 +2374,9 @@ static int radeonfb_pci_register (struct pci_dev *pdev,
2374 } while ( rinfo->fb_base == 0 && 2374 } while ( rinfo->fb_base == 0 &&
2375 ((rinfo->mapped_vram /=2) >= MIN_MAPPED_VRAM) ); 2375 ((rinfo->mapped_vram /=2) >= MIN_MAPPED_VRAM) );
2376 2376
2377 if (rinfo->fb_base) 2377 if (rinfo->fb_base == NULL) {
2378 memset_io(rinfo->fb_base, 0, rinfo->mapped_vram); 2378 printk (KERN_ERR "radeonfb (%s): cannot map FB\n",
2379 else { 2379 pci_name(rinfo->pdev));
2380 printk (KERN_ERR "radeonfb (%s): cannot map FB\n", pci_name(rinfo->pdev));
2381 ret = -EIO; 2380 ret = -EIO;
2382 goto err_unmap_rom; 2381 goto err_unmap_rom;
2383 } 2382 }
diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c
index ab98f225fe3e..95e72550d43f 100644
--- a/drivers/video/chipsfb.c
+++ b/drivers/video/chipsfb.c
@@ -423,9 +423,6 @@ chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
423 pmu_register_sleep_notifier(&chips_sleep_notifier); 423 pmu_register_sleep_notifier(&chips_sleep_notifier);
424#endif /* CONFIG_PMAC_PBOOK */ 424#endif /* CONFIG_PMAC_PBOOK */
425 425
426 /* Clear the entire framebuffer */
427 memset(p->screen_base, 0, 0x100000);
428
429 pci_set_drvdata(dp, p); 426 pci_set_drvdata(dp, p);
430 return 0; 427 return 0;
431} 428}
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index ccf55811d24f..e4b91a4b936c 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -153,6 +153,15 @@ config FONT_6x11
153 Small console font with Macintosh-style high-half glyphs. Some Mac 153 Small console font with Macintosh-style high-half glyphs. Some Mac
154 framebuffer drivers don't support this one at all. 154 framebuffer drivers don't support this one at all.
155 155
156config FONT_7x14
157 bool "console 7x14 font (not supported by all drivers)" if FONTS
158 depends on FRAMEBUFFER_CONSOLE
159 default y if !SPARC32 && !SPARC64 && !FONTS
160 help
161 Console font with characters just a bit smaller than the default.
162 If the standard 8x16 font is a little too big for you, say Y.
163 Otherwise, say N.
164
156config FONT_PEARL_8x8 165config FONT_PEARL_8x8
157 bool "Pearl (old m68k) console 8x8 font" if FONTS 166 bool "Pearl (old m68k) console 8x8 font" if FONTS
158 depends on FRAMEBUFFER_CONSOLE 167 depends on FRAMEBUFFER_CONSOLE
@@ -187,5 +196,13 @@ config FONT_SUN12x22
187 big letters (like the letters used in the SPARC PROM). If the 196 big letters (like the letters used in the SPARC PROM). If the
188 standard font is unreadable for you, say Y, otherwise say N. 197 standard font is unreadable for you, say Y, otherwise say N.
189 198
199config FONT_10x18
200 bool "console 10x18 font (not supported by all drivers)"
201 depends on FONTS
202 help
203 This is a high resolution console font for machines with very
204 big letters. It fits between the sun 12x22 and the normal 8x16 font.
205 If other fonts are too big or too small for you, say Y, otherwise say N.
206
190endmenu 207endmenu
191 208
diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile
index 33516447f9f2..b562f6bb9d31 100644
--- a/drivers/video/console/Makefile
+++ b/drivers/video/console/Makefile
@@ -10,6 +10,8 @@ font-objs-$(CONFIG_FONT_SUN12x22) += font_sun12x22.o
10font-objs-$(CONFIG_FONT_8x8) += font_8x8.o 10font-objs-$(CONFIG_FONT_8x8) += font_8x8.o
11font-objs-$(CONFIG_FONT_8x16) += font_8x16.o 11font-objs-$(CONFIG_FONT_8x16) += font_8x16.o
12font-objs-$(CONFIG_FONT_6x11) += font_6x11.o 12font-objs-$(CONFIG_FONT_6x11) += font_6x11.o
13font-objs-$(CONFIG_FONT_7x14) += font_7x14.o
14font-objs-$(CONFIG_FONT_10x18) += font_10x18.o
13font-objs-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o 15font-objs-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o
14font-objs-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o 16font-objs-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o
15font-objs-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o 17font-objs-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o
diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c
index b28a4b0e395e..3c731577fed6 100644
--- a/drivers/video/console/bitblit.c
+++ b/drivers/video/console/bitblit.c
@@ -107,13 +107,6 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info,
107 const unsigned short *s, int count, int yy, int xx, 107 const unsigned short *s, int count, int yy, int xx,
108 int fg, int bg) 108 int fg, int bg)
109{ 109{
110 void (*move_unaligned)(struct fb_info *info, struct fb_pixmap *buf,
111 u8 *dst, u32 d_pitch, u8 *src, u32 idx,
112 u32 height, u32 shift_high, u32 shift_low,
113 u32 mod);
114 void (*move_aligned)(struct fb_info *info, struct fb_pixmap *buf,
115 u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch,
116 u32 height);
117 unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; 110 unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
118 unsigned int width = (vc->vc_font.width + 7) >> 3; 111 unsigned int width = (vc->vc_font.width + 7) >> 3;
119 unsigned int cellsize = vc->vc_font.height * width; 112 unsigned int cellsize = vc->vc_font.height * width;
@@ -141,13 +134,6 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info,
141 image.height = vc->vc_font.height; 134 image.height = vc->vc_font.height;
142 image.depth = 1; 135 image.depth = 1;
143 136
144 if (info->pixmap.outbuf && info->pixmap.inbuf) {
145 move_aligned = fb_iomove_buf_aligned;
146 move_unaligned = fb_iomove_buf_unaligned;
147 } else {
148 move_aligned = fb_sysmove_buf_aligned;
149 move_unaligned = fb_sysmove_buf_unaligned;
150 }
151 while (count) { 137 while (count) {
152 if (count > maxcnt) 138 if (count > maxcnt)
153 cnt = k = maxcnt; 139 cnt = k = maxcnt;
@@ -171,9 +157,9 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info,
171 src = buf; 157 src = buf;
172 } 158 }
173 159
174 move_unaligned(info, &info->pixmap, dst, pitch, 160 fb_pad_unaligned_buffer(dst, pitch, src, idx,
175 src, idx, image.height, 161 image.height, shift_high,
176 shift_high, shift_low, mod); 162 shift_low, mod);
177 shift_low += mod; 163 shift_low += mod;
178 dst += (shift_low >= 8) ? width : width - 1; 164 dst += (shift_low >= 8) ? width : width - 1;
179 shift_low &= 7; 165 shift_low &= 7;
@@ -189,8 +175,7 @@ static void bit_putcs(struct vc_data *vc, struct fb_info *info,
189 src = buf; 175 src = buf;
190 } 176 }
191 177
192 move_aligned(info, &info->pixmap, dst, pitch, 178 fb_pad_aligned_buffer(dst, pitch, src, idx, image.height);
193 src, idx, image.height);
194 dst += width; 179 dst += width;
195 } 180 }
196 } 181 }
diff --git a/drivers/video/console/font_10x18.c b/drivers/video/console/font_10x18.c
new file mode 100644
index 000000000000..ff0af96e4dfc
--- /dev/null
+++ b/drivers/video/console/font_10x18.c
@@ -0,0 +1,5146 @@
1/********************************
2 * adapted from font_sun12x22.c *
3 * by Jurriaan Kalkman 06-2005 *
4 ********************************/
5
6#include <linux/font.h>
7
8#define FONTDATAMAX 9216
9
10static unsigned char fontdata_10x18[FONTDATAMAX] = {
11
12 /* 0 0x00 '^@' */
13 0x00, 0x00, /* 0000000000 */
14 0x00, 0x00, /* 0000000000 */
15 0x00, 0x00, /* 0000000000 */
16 0x00, 0x00, /* 0000000000 */
17 0x00, 0x00, /* 0000000000 */
18 0x00, 0x00, /* 0000000000 */
19 0x00, 0x00, /* 0000000000 */
20 0x00, 0x00, /* 0000000000 */
21 0x00, 0x00, /* 0000000000 */
22 0x00, 0x00, /* 0000000000 */
23 0x00, 0x00, /* 0000000000 */
24 0x00, 0x00, /* 0000000000 */
25 0x00, 0x00, /* 0000000000 */
26 0x00, 0x00, /* 0000000000 */
27 0x00, 0x00, /* 0000000000 */
28 0x00, 0x00, /* 0000000000 */
29 0x00, 0x00, /* 0000000000 */
30 0x00, 0x00, /* 0000000000 */
31
32 /* 1 0x01 '^A' */
33 0x00, 0x00, /* 0000000000 */
34 0x00, 0x00, /* 0000000000 */
35 0x00, 0x00, /* 0000000000 */
36 0x00, 0x00, /* 0000000000 */
37 0x00, 0x00, /* 0000000000 */
38 0x3f, 0x80, /* 0011111110 */
39 0x40, 0x40, /* 0100000001 */
40 0x5b, 0x40, /* 0101101101 */
41 0x40, 0x40, /* 0100000001 */
42 0x44, 0x40, /* 0100010001 */
43 0x44, 0x40, /* 0100010001 */
44 0x51, 0x40, /* 0101000101 */
45 0x4e, 0x40, /* 0100111001 */
46 0x40, 0x40, /* 0100000001 */
47 0x3f, 0x80, /* 0011111110 */
48 0x00, 0x00, /* 0000000000 */
49 0x00, 0x00, /* 0000000000 */
50 0x00, 0x00, /* 0000000000 */
51
52 /* 2 0x02 '^B' */
53 0x00, 0x00, /* 0000000000 */
54 0x00, 0x00, /* 0000000000 */
55 0x00, 0x00, /* 0000000000 */
56 0x00, 0x00, /* 0000000000 */
57 0x00, 0x00, /* 0000000000 */
58 0x3f, 0x80, /* 0011111110 */
59 0x7f, 0xc0, /* 0111111111 */
60 0x64, 0xc0, /* 0110010011 */
61 0x7f, 0xc0, /* 0111111111 */
62 0x7b, 0xc0, /* 0111101111 */
63 0x7b, 0xc0, /* 0111101111 */
64 0x6e, 0xc0, /* 0110111011 */
65 0x71, 0xc0, /* 0111000111 */
66 0x7f, 0xc0, /* 0111111111 */
67 0x3f, 0x80, /* 0011111110 */
68 0x00, 0x00, /* 0000000000 */
69 0x00, 0x00, /* 0000000000 */
70 0x00, 0x00, /* 0000000000 */
71
72 /* 3 0x03 '^C' */
73 0x00, 0x00, /* 0000000000 */
74 0x00, 0x00, /* 0000000000 */
75 0x00, 0x00, /* 0000000000 */
76 0x00, 0x00, /* 0000000000 */
77 0x00, 0x00, /* 0000000000 */
78 0x11, 0x00, /* 0001000100 */
79 0x3b, 0x80, /* 0011101110 */
80 0x7f, 0xc0, /* 0111111111 */
81 0x3f, 0x80, /* 0011111110 */
82 0x3f, 0x80, /* 0011111110 */
83 0x1f, 0x00, /* 0001111100 */
84 0x1f, 0x00, /* 0001111100 */
85 0x0e, 0x00, /* 0000111000 */
86 0x0e, 0x00, /* 0000111000 */
87 0x04, 0x00, /* 0000010000 */
88 0x00, 0x00, /* 0000000000 */
89 0x00, 0x00, /* 0000000000 */
90 0x00, 0x00, /* 0000000000 */
91
92 /* 4 0x04 '^D' */
93 0x00, 0x00, /* 0000000000 */
94 0x00, 0x00, /* 0000000000 */
95 0x00, 0x00, /* 0000000000 */
96 0x00, 0x00, /* 0000000000 */
97 0x04, 0x00, /* 0000010000 */
98 0x0e, 0x00, /* 0000111000 */
99 0x0e, 0x00, /* 0000111000 */
100 0x1f, 0x00, /* 0001111100 */
101 0x1f, 0x00, /* 0001111100 */
102 0x3f, 0x80, /* 0011111110 */
103 0x1f, 0x00, /* 0001111100 */
104 0x1f, 0x00, /* 0001111100 */
105 0x0e, 0x00, /* 0000111000 */
106 0x0e, 0x00, /* 0000111000 */
107 0x04, 0x00, /* 0000010000 */
108 0x00, 0x00, /* 0000000000 */
109 0x00, 0x00, /* 0000000000 */
110 0x00, 0x00, /* 0000000000 */
111
112 /* 5 0x05 '^E' */
113 0x00, 0x00, /* 0000000000 */
114 0x00, 0x00, /* 0000000000 */
115 0x00, 0x00, /* 0000000000 */
116 0x00, 0x00, /* 0000000000 */
117 0x00, 0x00, /* 0000000000 */
118 0x00, 0x00, /* 0000000000 */
119 0x0c, 0x00, /* 0000110000 */
120 0x1e, 0x00, /* 0001111000 */
121 0x0c, 0x00, /* 0000110000 */
122 0x31, 0x80, /* 0011000110 */
123 0x7b, 0xc0, /* 0111101111 */
124 0x35, 0x80, /* 0011010110 */
125 0x04, 0x00, /* 0000010000 */
126 0x0e, 0x00, /* 0000111000 */
127 0x1f, 0x00, /* 0001111100 */
128 0x00, 0x00, /* 0000000000 */
129 0x00, 0x00, /* 0000000000 */
130 0x00, 0x00, /* 0000000000 */
131
132 /* 6 0x06 '^F' */
133 0x00, 0x00, /* 0000000000 */
134 0x00, 0x00, /* 0000000000 */
135 0x00, 0x00, /* 0000000000 */
136 0x00, 0x00, /* 0000000000 */
137 0x04, 0x00, /* 0000010000 */
138 0x0e, 0x00, /* 0000111000 */
139 0x1f, 0x00, /* 0001111100 */
140 0x1f, 0x00, /* 0001111100 */
141 0x3f, 0x80, /* 0011111110 */
142 0x7f, 0xc0, /* 0111111111 */
143 0x7f, 0xc0, /* 0111111111 */
144 0x35, 0x80, /* 0011010110 */
145 0x04, 0x00, /* 0000010000 */
146 0x0e, 0x00, /* 0000111000 */
147 0x1f, 0x00, /* 0001111100 */
148 0x00, 0x00, /* 0000000000 */
149 0x00, 0x00, /* 0000000000 */
150 0x00, 0x00, /* 0000000000 */
151
152 /* 7 0x07 '^G' */
153 0x00, 0x00, /* 0000000000 */
154 0x00, 0x00, /* 0000000000 */
155 0x00, 0x00, /* 0000000000 */
156 0x00, 0x00, /* 0000000000 */
157 0x00, 0x00, /* 0000000000 */
158 0x0c, 0x00, /* 0000110000 */
159 0x1e, 0x00, /* 0001111000 */
160 0x1e, 0x00, /* 0001111000 */
161 0x3f, 0x00, /* 0011111100 */
162 0x3f, 0x00, /* 0011111100 */
163 0x1e, 0x00, /* 0001111000 */
164 0x1e, 0x00, /* 0001111000 */
165 0x0c, 0x00, /* 0000110000 */
166 0x00, 0x00, /* 0000000000 */
167 0x00, 0x00, /* 0000000000 */
168 0x00, 0x00, /* 0000000000 */
169 0x00, 0x00, /* 0000000000 */
170 0x00, 0x00, /* 0000000000 */
171
172 /* 8 0x08 '^H' */
173 0xff, 0xc0, /* 1111111111 */
174 0xff, 0xc0, /* 1111111111 */
175 0xff, 0xc0, /* 1111111111 */
176 0xff, 0xc0, /* 1111111111 */
177 0xff, 0xc0, /* 1111111111 */
178 0xf3, 0xc0, /* 1111001111 */
179 0xe1, 0xc0, /* 1110000111 */
180 0xe1, 0xc0, /* 1110000111 */
181 0xc0, 0xc0, /* 1100000011 */
182 0xc0, 0xc0, /* 1100000011 */
183 0xe1, 0xc0, /* 1110000111 */
184 0xe1, 0xc0, /* 1110000111 */
185 0xf3, 0xc0, /* 1111001111 */
186 0xff, 0xc0, /* 1111111111 */
187 0xff, 0xc0, /* 1111111111 */
188 0xff, 0xc0, /* 1111111111 */
189 0xff, 0xc0, /* 1111111111 */
190 0xff, 0xc0, /* 1111111111 */
191
192 /* 9 0x09 '^I' */
193 0x00, 0x00, /* 0000000000 */
194 0x00, 0x00, /* 0000000000 */
195 0x00, 0x00, /* 0000000000 */
196 0x00, 0x00, /* 0000000000 */
197 0x00, 0x00, /* 0000000000 */
198 0x0c, 0x00, /* 0000110000 */
199 0x12, 0x00, /* 0001001000 */
200 0x12, 0x00, /* 0001001000 */
201 0x21, 0x00, /* 0010000100 */
202 0x21, 0x00, /* 0010000100 */
203 0x12, 0x00, /* 0001001000 */
204 0x12, 0x00, /* 0001001000 */
205 0x0c, 0x00, /* 0000110000 */
206 0x00, 0x00, /* 0000000000 */
207 0x00, 0x00, /* 0000000000 */
208 0x00, 0x00, /* 0000000000 */
209 0x00, 0x00, /* 0000000000 */
210 0x00, 0x00, /* 0000000000 */
211
212 /* 10 0x0a '^J' */
213 0xff, 0xc0, /* 1111111111 */
214 0xff, 0xc0, /* 1111111111 */
215 0xff, 0xc0, /* 1111111111 */
216 0xff, 0xc0, /* 1111111111 */
217 0xff, 0xc0, /* 1111111111 */
218 0xf3, 0xc0, /* 1111001111 */
219 0xed, 0xc0, /* 1110110111 */
220 0xed, 0xc0, /* 1110110111 */
221 0xde, 0xc0, /* 1101111011 */
222 0xde, 0xc0, /* 1101111011 */
223 0xed, 0xc0, /* 1110110111 */
224 0xed, 0xc0, /* 1110110111 */
225 0xf3, 0xc0, /* 1111001111 */
226 0xff, 0xc0, /* 1111111111 */
227 0xff, 0xc0, /* 1111111111 */
228 0xff, 0xc0, /* 1111111111 */
229 0xff, 0xc0, /* 1111111111 */
230 0xff, 0xc0, /* 1111111111 */
231
232 /* 11 0x0b '^K' */
233 0x00, 0x00, /* 0000000000 */
234 0x00, 0x00, /* 0000000000 */
235 0x0f, 0xc0, /* 0000111111 */
236 0x0f, 0xc0, /* 0000111111 */
237 0x03, 0xc0, /* 0000001111 */
238 0x06, 0xc0, /* 0000011011 */
239 0x0c, 0xc0, /* 0000110011 */
240 0x3c, 0x00, /* 0011110000 */
241 0x66, 0x00, /* 0110011000 */
242 0xc3, 0x00, /* 1100001100 */
243 0xc3, 0x00, /* 1100001100 */
244 0xc3, 0x00, /* 1100001100 */
245 0x66, 0x00, /* 0110011000 */
246 0x3c, 0x00, /* 0011110000 */
247 0x00, 0x00, /* 0000000000 */
248 0x00, 0x00, /* 0000000000 */
249 0x00, 0x00, /* 0000000000 */
250 0x00, 0x00, /* 0000000000 */
251
252 /* 12 0x0c '^L' */
253 0x00, 0x00, /* 0000000000 */
254 0x00, 0x00, /* 0000000000 */
255 0x00, 0x00, /* 0000000000 */
256 0x1e, 0x00, /* 0001111000 */
257 0x33, 0x00, /* 0011001100 */
258 0x61, 0x80, /* 0110000110 */
259 0x61, 0x80, /* 0110000110 */
260 0x61, 0x80, /* 0110000110 */
261 0x33, 0x00, /* 0011001100 */
262 0x1e, 0x00, /* 0001111000 */
263 0x0c, 0x00, /* 0000110000 */
264 0x0c, 0x00, /* 0000110000 */
265 0x3f, 0x00, /* 0011111100 */
266 0x0c, 0x00, /* 0000110000 */
267 0x0c, 0x00, /* 0000110000 */
268 0x00, 0x00, /* 0000000000 */
269 0x00, 0x00, /* 0000000000 */
270 0x00, 0x00, /* 0000000000 */
271
272 /* 13 0x0d '^M' */
273 0x00, 0x00, /* 0000000000 */
274 0x00, 0x00, /* 0000000000 */
275 0x00, 0x00, /* 0000000000 */
276 0x0f, 0x80, /* 0000111110 */
277 0x08, 0x80, /* 0000100010 */
278 0x0f, 0x80, /* 0000111110 */
279 0x08, 0x00, /* 0000100000 */
280 0x08, 0x00, /* 0000100000 */
281 0x08, 0x00, /* 0000100000 */
282 0x08, 0x00, /* 0000100000 */
283 0x08, 0x00, /* 0000100000 */
284 0x08, 0x00, /* 0000100000 */
285 0x38, 0x00, /* 0011100000 */
286 0x78, 0x00, /* 0111100000 */
287 0x30, 0x00, /* 0011000000 */
288 0x00, 0x00, /* 0000000000 */
289 0x00, 0x00, /* 0000000000 */
290 0x00, 0x00, /* 0000000000 */
291
292 /* 14 0x0e '^N' */
293 0x00, 0x00, /* 0000000000 */
294 0x00, 0x00, /* 0000000000 */
295 0x00, 0x00, /* 0000000000 */
296 0x1f, 0x80, /* 0001111110 */
297 0x10, 0x80, /* 0001000010 */
298 0x1f, 0x80, /* 0001111110 */
299 0x10, 0x80, /* 0001000010 */
300 0x10, 0x80, /* 0001000010 */
301 0x10, 0x80, /* 0001000010 */
302 0x10, 0x80, /* 0001000010 */
303 0x13, 0x80, /* 0001001110 */
304 0x17, 0x80, /* 0001011110 */
305 0x73, 0x00, /* 0111001100 */
306 0xf0, 0x00, /* 1111000000 */
307 0x60, 0x00, /* 0110000000 */
308 0x00, 0x00, /* 0000000000 */
309 0x00, 0x00, /* 0000000000 */
310 0x00, 0x00, /* 0000000000 */
311
312 /* 15 0x0f '^O' */
313 0x00, 0x00, /* 0000000000 */
314 0x00, 0x00, /* 0000000000 */
315 0x00, 0x00, /* 0000000000 */
316 0x04, 0x00, /* 0000010000 */
317 0x24, 0x80, /* 0010010010 */
318 0x15, 0x00, /* 0001010100 */
319 0x55, 0x40, /* 0101010101 */
320 0x3f, 0x80, /* 0011111110 */
321 0x0e, 0x00, /* 0000111000 */
322 0x00, 0x00, /* 0000000000 */
323 0x0e, 0x00, /* 0000111000 */
324 0x3f, 0x80, /* 0011111110 */
325 0x55, 0x40, /* 0101010101 */
326 0x15, 0x00, /* 0001010100 */
327 0x24, 0x80, /* 0010010010 */
328 0x00, 0x00, /* 0000000000 */
329 0x00, 0x00, /* 0000000000 */
330 0x00, 0x00, /* 0000000000 */
331
332 /* 16 0x10 '^P' */
333 0x00, 0x80, /* 0000000010 */
334 0x01, 0x80, /* 0000000110 */
335 0x03, 0x80, /* 0000001110 */
336 0x07, 0x80, /* 0000011110 */
337 0x0f, 0x80, /* 0000111110 */
338 0x1f, 0x80, /* 0001111110 */
339 0x3f, 0x80, /* 0011111110 */
340 0x7f, 0x80, /* 0111111110 */
341 0xff, 0x80, /* 1111111110 */
342 0x7f, 0x80, /* 0111111110 */
343 0x3f, 0x80, /* 0011111110 */
344 0x1f, 0x80, /* 0001111110 */
345 0x0f, 0x80, /* 0000111110 */
346 0x07, 0x80, /* 0000011110 */
347 0x03, 0x80, /* 0000001110 */
348 0x01, 0x80, /* 0000000110 */
349 0x00, 0x80, /* 0000000010 */
350 0x00, 0x00, /* 0000000000 */
351
352 /* 17 0x11 '^Q' */
353 0x40, 0x00, /* 0100000000 */
354 0x60, 0x00, /* 0110000000 */
355 0x70, 0x00, /* 0111000000 */
356 0x78, 0x00, /* 0111100000 */
357 0x7c, 0x00, /* 0111110000 */
358 0x7e, 0x00, /* 0111111000 */
359 0x7f, 0x00, /* 0111111100 */
360 0x7f, 0x80, /* 0111111110 */
361 0x7f, 0xc0, /* 0111111111 */
362 0x7f, 0x80, /* 0111111110 */
363 0x7f, 0x00, /* 0111111100 */
364 0x7e, 0x00, /* 0111111000 */
365 0x7c, 0x00, /* 0111110000 */
366 0x78, 0x00, /* 0111100000 */
367 0x70, 0x00, /* 0111000000 */
368 0x60, 0x00, /* 0110000000 */
369 0x40, 0x00, /* 0100000000 */
370 0x00, 0x00, /* 0000000000 */
371
372 /* 18 0x12 '^R' */
373 0x00, 0x00, /* 0000000000 */
374 0x00, 0x00, /* 0000000000 */
375 0x00, 0x00, /* 0000000000 */
376 0x00, 0x00, /* 0000000000 */
377 0x0c, 0x00, /* 0000110000 */
378 0x1e, 0x00, /* 0001111000 */
379 0x3f, 0x00, /* 0011111100 */
380 0x7f, 0x80, /* 0111111110 */
381 0x0c, 0x00, /* 0000110000 */
382 0x0c, 0x00, /* 0000110000 */
383 0x0c, 0x00, /* 0000110000 */
384 0x7f, 0x80, /* 0111111110 */
385 0x3f, 0x00, /* 0011111100 */
386 0x1e, 0x00, /* 0001111000 */
387 0x0c, 0x00, /* 0000110000 */
388 0x00, 0x00, /* 0000000000 */
389 0x00, 0x00, /* 0000000000 */
390 0x00, 0x00, /* 0000000000 */
391
392 /* 19 0x13 '^S' */
393 0x00, 0x00, /* 0000000000 */
394 0x33, 0x00, /* 0011001100 */
395 0x33, 0x00, /* 0011001100 */
396 0x33, 0x00, /* 0011001100 */
397 0x33, 0x00, /* 0011001100 */
398 0x33, 0x00, /* 0011001100 */
399 0x33, 0x00, /* 0011001100 */
400 0x33, 0x00, /* 0011001100 */
401 0x33, 0x00, /* 0011001100 */
402 0x33, 0x00, /* 0011001100 */
403 0x33, 0x00, /* 0011001100 */
404 0x00, 0x00, /* 0000000000 */
405 0x00, 0x00, /* 0000000000 */
406 0x33, 0x00, /* 0011001100 */
407 0x33, 0x00, /* 0011001100 */
408 0x00, 0x00, /* 0000000000 */
409 0x00, 0x00, /* 0000000000 */
410 0x00, 0x00, /* 0000000000 */
411
412 /* 20 0x14 '^T' */
413 0x00, 0x00, /* 0000000000 */
414 0x1f, 0xc0, /* 0001111111 */
415 0x39, 0x80, /* 0011100110 */
416 0x79, 0x80, /* 0111100110 */
417 0x79, 0x80, /* 0111100110 */
418 0x79, 0x80, /* 0111100110 */
419 0x39, 0x80, /* 0011100110 */
420 0x19, 0x80, /* 0001100110 */
421 0x19, 0x80, /* 0001100110 */
422 0x19, 0x80, /* 0001100110 */
423 0x19, 0x80, /* 0001100110 */
424 0x19, 0x80, /* 0001100110 */
425 0x19, 0x80, /* 0001100110 */
426 0x39, 0xc0, /* 0011100111 */
427 0x00, 0x00, /* 0000000000 */
428 0x00, 0x00, /* 0000000000 */
429 0x00, 0x00, /* 0000000000 */
430 0x00, 0x00, /* 0000000000 */
431
432 /* 21 0x15 '^U' */
433 0x00, 0x00, /* 0000000000 */
434 0x00, 0x00, /* 0000000000 */
435 0x3e, 0x00, /* 0011111000 */
436 0x63, 0x00, /* 0110001100 */
437 0x63, 0x00, /* 0110001100 */
438 0x60, 0x00, /* 0110000000 */
439 0x60, 0x00, /* 0110000000 */
440 0x3e, 0x00, /* 0011111000 */
441 0x63, 0x00, /* 0110001100 */
442 0x63, 0x00, /* 0110001100 */
443 0x3e, 0x00, /* 0011111000 */
444 0x03, 0x00, /* 0000001100 */
445 0x03, 0x00, /* 0000001100 */
446 0x63, 0x00, /* 0110001100 */
447 0x63, 0x00, /* 0110001100 */
448 0x3e, 0x00, /* 0011111000 */
449 0x00, 0x00, /* 0000000000 */
450 0x00, 0x00, /* 0000000000 */
451
452 /* 22 0x16 '^V' */
453 0x00, 0x00, /* 0000000000 */
454 0x00, 0x00, /* 0000000000 */
455 0x00, 0x00, /* 0000000000 */
456 0x00, 0x00, /* 0000000000 */
457 0x00, 0x00, /* 0000000000 */
458 0x00, 0x00, /* 0000000000 */
459 0x00, 0x00, /* 0000000000 */
460 0x00, 0x00, /* 0000000000 */
461 0x00, 0x00, /* 0000000000 */
462 0x00, 0x00, /* 0000000000 */
463 0x00, 0x00, /* 0000000000 */
464 0x00, 0x00, /* 0000000000 */
465 0x7f, 0x80, /* 0111111110 */
466 0x7f, 0x80, /* 0111111110 */
467 0x7f, 0x80, /* 0111111110 */
468 0x00, 0x00, /* 0000000000 */
469 0x00, 0x00, /* 0000000000 */
470 0x00, 0x00, /* 0000000000 */
471
472 /* 23 0x17 '^W' */
473 0x00, 0x00, /* 0000000000 */
474 0x00, 0x00, /* 0000000000 */
475 0x0c, 0x00, /* 0000110000 */
476 0x1e, 0x00, /* 0001111000 */
477 0x3f, 0x00, /* 0011111100 */
478 0x7f, 0x80, /* 0111111110 */
479 0x0c, 0x00, /* 0000110000 */
480 0x0c, 0x00, /* 0000110000 */
481 0x0c, 0x00, /* 0000110000 */
482 0x7f, 0x80, /* 0111111110 */
483 0x3f, 0x00, /* 0011111100 */
484 0x1e, 0x00, /* 0001111000 */
485 0x0c, 0x00, /* 0000110000 */
486 0x7f, 0x80, /* 0111111110 */
487 0x7f, 0x80, /* 0111111110 */
488 0x00, 0x00, /* 0000000000 */
489 0x00, 0x00, /* 0000000000 */
490 0x00, 0x00, /* 0000000000 */
491
492 /* 24 0x18 '^X' */
493 0x00, 0x00, /* 0000000000 */
494 0x00, 0x00, /* 0000000000 */
495 0x00, 0x00, /* 0000000000 */
496 0x0c, 0x00, /* 0000110000 */
497 0x1e, 0x00, /* 0001111000 */
498 0x3f, 0x00, /* 0011111100 */
499 0x7f, 0x80, /* 0111111110 */
500 0x0c, 0x00, /* 0000110000 */
501 0x0c, 0x00, /* 0000110000 */
502 0x0c, 0x00, /* 0000110000 */
503 0x0c, 0x00, /* 0000110000 */
504 0x0c, 0x00, /* 0000110000 */
505 0x0c, 0x00, /* 0000110000 */
506 0x0c, 0x00, /* 0000110000 */
507 0x0c, 0x00, /* 0000110000 */
508 0x00, 0x00, /* 0000000000 */
509 0x00, 0x00, /* 0000000000 */
510 0x00, 0x00, /* 0000000000 */
511
512 /* 25 0x19 '^Y' */
513 0x00, 0x00, /* 0000000000 */
514 0x00, 0x00, /* 0000000000 */
515 0x00, 0x00, /* 0000000000 */
516 0x0c, 0x00, /* 0000110000 */
517 0x0c, 0x00, /* 0000110000 */
518 0x0c, 0x00, /* 0000110000 */
519 0x0c, 0x00, /* 0000110000 */
520 0x0c, 0x00, /* 0000110000 */
521 0x0c, 0x00, /* 0000110000 */
522 0x0c, 0x00, /* 0000110000 */
523 0x0c, 0x00, /* 0000110000 */
524 0x7f, 0x80, /* 0111111110 */
525 0x3f, 0x00, /* 0011111100 */
526 0x1e, 0x00, /* 0001111000 */
527 0x0c, 0x00, /* 0000110000 */
528 0x00, 0x00, /* 0000000000 */
529 0x00, 0x00, /* 0000000000 */
530 0x00, 0x00, /* 0000000000 */
531
532 /* 26 0x1a '^Z' */
533 0x00, 0x00, /* 0000000000 */
534 0x00, 0x00, /* 0000000000 */
535 0x00, 0x00, /* 0000000000 */
536 0x00, 0x00, /* 0000000000 */
537 0x04, 0x00, /* 0000010000 */
538 0x06, 0x00, /* 0000011000 */
539 0x07, 0x00, /* 0000011100 */
540 0x7f, 0x80, /* 0111111110 */
541 0x7f, 0x80, /* 0111111110 */
542 0x07, 0x00, /* 0000011100 */
543 0x06, 0x00, /* 0000011000 */
544 0x04, 0x00, /* 0000010000 */
545 0x00, 0x00, /* 0000000000 */
546 0x00, 0x00, /* 0000000000 */
547 0x00, 0x00, /* 0000000000 */
548 0x00, 0x00, /* 0000000000 */
549 0x00, 0x00, /* 0000000000 */
550 0x00, 0x00, /* 0000000000 */
551
552 /* 27 0x1b '^[' */
553 0x00, 0x00, /* 0000000000 */
554 0x00, 0x00, /* 0000000000 */
555 0x00, 0x00, /* 0000000000 */
556 0x00, 0x00, /* 0000000000 */
557 0x00, 0x00, /* 0000000000 */
558 0x08, 0x00, /* 0000100000 */
559 0x18, 0x00, /* 0001100000 */
560 0x38, 0x00, /* 0011100000 */
561 0x7f, 0x80, /* 0111111110 */
562 0x7f, 0x80, /* 0111111110 */
563 0x38, 0x00, /* 0011100000 */
564 0x18, 0x00, /* 0001100000 */
565 0x08, 0x00, /* 0000100000 */
566 0x00, 0x00, /* 0000000000 */
567 0x00, 0x00, /* 0000000000 */
568 0x00, 0x00, /* 0000000000 */
569 0x00, 0x00, /* 0000000000 */
570 0x00, 0x00, /* 0000000000 */
571
572 /* 28 0x1c '^\' */
573 0x00, 0x00, /* 0000000000 */
574 0x00, 0x00, /* 0000000000 */
575 0x00, 0x00, /* 0000000000 */
576 0x00, 0x00, /* 0000000000 */
577 0x00, 0x00, /* 0000000000 */
578 0x60, 0x00, /* 0110000000 */
579 0x60, 0x00, /* 0110000000 */
580 0x60, 0x00, /* 0110000000 */
581 0x7f, 0x80, /* 0111111110 */
582 0x7f, 0x80, /* 0111111110 */
583 0x00, 0x00, /* 0000000000 */
584 0x00, 0x00, /* 0000000000 */
585 0x00, 0x00, /* 0000000000 */
586 0x00, 0x00, /* 0000000000 */
587 0x00, 0x00, /* 0000000000 */
588 0x00, 0x00, /* 0000000000 */
589 0x00, 0x00, /* 0000000000 */
590 0x00, 0x00, /* 0000000000 */
591
592 /* 29 0x1d '^]' */
593 0x00, 0x00, /* 0000000000 */
594 0x00, 0x00, /* 0000000000 */
595 0x00, 0x00, /* 0000000000 */
596 0x00, 0x00, /* 0000000000 */
597 0x00, 0x00, /* 0000000000 */
598 0x12, 0x00, /* 0001001000 */
599 0x33, 0x00, /* 0011001100 */
600 0x73, 0x80, /* 0111001110 */
601 0xff, 0xc0, /* 1111111111 */
602 0xff, 0xc0, /* 1111111111 */
603 0x73, 0x80, /* 0111001110 */
604 0x33, 0x00, /* 0011001100 */
605 0x12, 0x00, /* 0001001000 */
606 0x00, 0x00, /* 0000000000 */
607 0x00, 0x00, /* 0000000000 */
608 0x00, 0x00, /* 0000000000 */
609 0x00, 0x00, /* 0000000000 */
610 0x00, 0x00, /* 0000000000 */
611
612 /* 30 0x1e '^^' */
613 0x00, 0x00, /* 0000000000 */
614 0x00, 0x00, /* 0000000000 */
615 0x00, 0x00, /* 0000000000 */
616 0x00, 0x00, /* 0000000000 */
617 0x00, 0x00, /* 0000000000 */
618 0x04, 0x00, /* 0000010000 */
619 0x04, 0x00, /* 0000010000 */
620 0x0e, 0x00, /* 0000111000 */
621 0x0e, 0x00, /* 0000111000 */
622 0x1f, 0x00, /* 0001111100 */
623 0x1f, 0x00, /* 0001111100 */
624 0x3f, 0x80, /* 0011111110 */
625 0x3f, 0x80, /* 0011111110 */
626 0x7f, 0xc0, /* 0111111111 */
627 0x7f, 0xc0, /* 0111111111 */
628 0x00, 0x00, /* 0000000000 */
629 0x00, 0x00, /* 0000000000 */
630 0x00, 0x00, /* 0000000000 */
631
632 /* 31 0x1f '^_' */
633 0x00, 0x00, /* 0000000000 */
634 0x00, 0x00, /* 0000000000 */
635 0x00, 0x00, /* 0000000000 */
636 0x00, 0x00, /* 0000000000 */
637 0x00, 0x00, /* 0000000000 */
638 0x7f, 0xc0, /* 0111111111 */
639 0x7f, 0xc0, /* 0111111111 */
640 0x3f, 0x80, /* 0011111110 */
641 0x3f, 0x80, /* 0011111110 */
642 0x1f, 0x00, /* 0001111100 */
643 0x1f, 0x00, /* 0001111100 */
644 0x0e, 0x00, /* 0000111000 */
645 0x0e, 0x00, /* 0000111000 */
646 0x04, 0x00, /* 0000010000 */
647 0x04, 0x00, /* 0000010000 */
648 0x00, 0x00, /* 0000000000 */
649 0x00, 0x00, /* 0000000000 */
650 0x00, 0x00, /* 0000000000 */
651
652 /* 32 0x20 ' ' */
653 0x00, 0x00, /* 0000000000 */
654 0x00, 0x00, /* 0000000000 */
655 0x00, 0x00, /* 0000000000 */
656 0x00, 0x00, /* 0000000000 */
657 0x00, 0x00, /* 0000000000 */
658 0x00, 0x00, /* 0000000000 */
659 0x00, 0x00, /* 0000000000 */
660 0x00, 0x00, /* 0000000000 */
661 0x00, 0x00, /* 0000000000 */
662 0x00, 0x00, /* 0000000000 */
663 0x00, 0x00, /* 0000000000 */
664 0x00, 0x00, /* 0000000000 */
665 0x00, 0x00, /* 0000000000 */
666 0x00, 0x00, /* 0000000000 */
667 0x00, 0x00, /* 0000000000 */
668 0x00, 0x00, /* 0000000000 */
669 0x00, 0x00, /* 0000000000 */
670 0x00, 0x00, /* 0000000000 */
671
672 /* 33 0x21 '!' */
673 0x00, 0x00, /* 0000000000 */
674 0x0c, 0x00, /* 0000110000 */
675 0x0c, 0x00, /* 0000110000 */
676 0x0c, 0x00, /* 0000110000 */
677 0x0c, 0x00, /* 0000110000 */
678 0x0c, 0x00, /* 0000110000 */
679 0x0c, 0x00, /* 0000110000 */
680 0x0c, 0x00, /* 0000110000 */
681 0x0c, 0x00, /* 0000110000 */
682 0x0c, 0x00, /* 0000110000 */
683 0x0c, 0x00, /* 0000110000 */
684 0x00, 0x00, /* 0000000000 */
685 0x0c, 0x00, /* 0000110000 */
686 0x0c, 0x00, /* 0000110000 */
687 0x00, 0x00, /* 0000000000 */
688 0x00, 0x00, /* 0000000000 */
689 0x00, 0x00, /* 0000000000 */
690 0x00, 0x00, /* 0000000000 */
691
692 /* 34 0x22 '"' */
693 0x00, 0x00, /* 0000000000 */
694 0x63, 0x00, /* 0110001100 */
695 0xf7, 0x80, /* 1111011110 */
696 0xf7, 0x80, /* 1111011110 */
697 0x31, 0x80, /* 0011000110 */
698 0x31, 0x80, /* 0011000110 */
699 0x63, 0x00, /* 0110001100 */
700 0x42, 0x00, /* 0100001000 */
701 0x00, 0x00, /* 0000000000 */
702 0x00, 0x00, /* 0000000000 */
703 0x00, 0x00, /* 0000000000 */
704 0x00, 0x00, /* 0000000000 */
705 0x00, 0x00, /* 0000000000 */
706 0x00, 0x00, /* 0000000000 */
707 0x00, 0x00, /* 0000000000 */
708 0x00, 0x00, /* 0000000000 */
709 0x00, 0x00, /* 0000000000 */
710 0x00, 0x00, /* 0000000000 */
711
712 /* 35 0x23 '#' */
713 0x00, 0x00, /* 0000000000 */
714 0x33, 0x00, /* 0011001100 */
715 0x33, 0x00, /* 0011001100 */
716 0x7f, 0x80, /* 0111111110 */
717 0x7f, 0x80, /* 0111111110 */
718 0x33, 0x00, /* 0011001100 */
719 0x33, 0x00, /* 0011001100 */
720 0x33, 0x00, /* 0011001100 */
721 0x33, 0x00, /* 0011001100 */
722 0x7f, 0x80, /* 0111111110 */
723 0x7f, 0x80, /* 0111111110 */
724 0x33, 0x00, /* 0011001100 */
725 0x33, 0x00, /* 0011001100 */
726 0x00, 0x00, /* 0000000000 */
727 0x00, 0x00, /* 0000000000 */
728 0x00, 0x00, /* 0000000000 */
729 0x00, 0x00, /* 0000000000 */
730 0x00, 0x00, /* 0000000000 */
731
732 /* 36 0x24 '$' */
733 0x00, 0x00, /* 0000000000 */
734 0x0c, 0x00, /* 0000110000 */
735 0x3e, 0x00, /* 0011111000 */
736 0x3f, 0x00, /* 0011111100 */
737 0x6f, 0x80, /* 0110111110 */
738 0x6d, 0x80, /* 0110110110 */
739 0x6c, 0x80, /* 0110110010 */
740 0x3c, 0x00, /* 0011110000 */
741 0x0f, 0x00, /* 0000111100 */
742 0x0d, 0x80, /* 0000110110 */
743 0x4d, 0x80, /* 0100110110 */
744 0x6d, 0x80, /* 0110110110 */
745 0x7f, 0x00, /* 0111111100 */
746 0x3e, 0x00, /* 0011111000 */
747 0x0c, 0x00, /* 0000110000 */
748 0x00, 0x00, /* 0000000000 */
749 0x00, 0x00, /* 0000000000 */
750 0x00, 0x00, /* 0000000000 */
751
752 /* 37 0x25 '%' */
753 0x00, 0x00, /* 0000000000 */
754 0x31, 0x80, /* 0011000110 */
755 0x7b, 0x00, /* 0111101100 */
756 0x7b, 0x00, /* 0111101100 */
757 0x36, 0x00, /* 0011011000 */
758 0x06, 0x00, /* 0000011000 */
759 0x0c, 0x00, /* 0000110000 */
760 0x0c, 0x00, /* 0000110000 */
761 0x18, 0x00, /* 0001100000 */
762 0x1b, 0x00, /* 0001101100 */
763 0x37, 0x80, /* 0011011110 */
764 0x37, 0x80, /* 0011011110 */
765 0x63, 0x00, /* 0110001100 */
766 0x00, 0x00, /* 0000000000 */
767 0x00, 0x00, /* 0000000000 */
768 0x00, 0x00, /* 0000000000 */
769 0x00, 0x00, /* 0000000000 */
770 0x00, 0x00, /* 0000000000 */
771
772 /* 38 0x26 '&' */
773 0x00, 0x00, /* 0000000000 */
774 0x07, 0x00, /* 0000011100 */
775 0x0f, 0x80, /* 0000111110 */
776 0x19, 0x80, /* 0001100110 */
777 0x19, 0x80, /* 0001100110 */
778 0x0f, 0x80, /* 0000111110 */
779 0x1e, 0x00, /* 0001111000 */
780 0x3e, 0x00, /* 0011111000 */
781 0x76, 0x00, /* 0111011000 */
782 0x66, 0x40, /* 0110011001 */
783 0x63, 0xc0, /* 0110001111 */
784 0x63, 0x80, /* 0110001110 */
785 0x63, 0x00, /* 0110001100 */
786 0x3f, 0x80, /* 0011111110 */
787 0x1c, 0xc0, /* 0001110011 */
788 0x00, 0x00, /* 0000000000 */
789 0x00, 0x00, /* 0000000000 */
790 0x00, 0x00, /* 0000000000 */
791
792 /* 39 0x27 ''' */
793 0x00, 0x00, /* 0000000000 */
794 0x30, 0x00, /* 0011000000 */
795 0x78, 0x00, /* 0111100000 */
796 0x78, 0x00, /* 0111100000 */
797 0x18, 0x00, /* 0001100000 */
798 0x18, 0x00, /* 0001100000 */
799 0x30, 0x00, /* 0011000000 */
800 0x20, 0x00, /* 0010000000 */
801 0x00, 0x00, /* 0000000000 */
802 0x00, 0x00, /* 0000000000 */
803 0x00, 0x00, /* 0000000000 */
804 0x00, 0x00, /* 0000000000 */
805 0x00, 0x00, /* 0000000000 */
806 0x00, 0x00, /* 0000000000 */
807 0x00, 0x00, /* 0000000000 */
808 0x00, 0x00, /* 0000000000 */
809 0x00, 0x00, /* 0000000000 */
810 0x00, 0x00, /* 0000000000 */
811
812 /* 40 0x28 '(' */
813 0x00, 0x00, /* 0000000000 */
814 0x03, 0x00, /* 0000001100 */
815 0x06, 0x00, /* 0000011000 */
816 0x0c, 0x00, /* 0000110000 */
817 0x0c, 0x00, /* 0000110000 */
818 0x18, 0x00, /* 0001100000 */
819 0x18, 0x00, /* 0001100000 */
820 0x18, 0x00, /* 0001100000 */
821 0x18, 0x00, /* 0001100000 */
822 0x18, 0x00, /* 0001100000 */
823 0x18, 0x00, /* 0001100000 */
824 0x0c, 0x00, /* 0000110000 */
825 0x0c, 0x00, /* 0000110000 */
826 0x06, 0x00, /* 0000011000 */
827 0x03, 0x00, /* 0000001100 */
828 0x00, 0x00, /* 0000000000 */
829 0x00, 0x00, /* 0000000000 */
830 0x00, 0x00, /* 0000000000 */
831
832 /* 41 0x29 ')' */
833 0x00, 0x00, /* 0000000000 */
834 0x30, 0x00, /* 0011000000 */
835 0x18, 0x00, /* 0001100000 */
836 0x0c, 0x00, /* 0000110000 */
837 0x0c, 0x00, /* 0000110000 */
838 0x06, 0x00, /* 0000011000 */
839 0x06, 0x00, /* 0000011000 */
840 0x06, 0x00, /* 0000011000 */
841 0x06, 0x00, /* 0000011000 */
842 0x06, 0x00, /* 0000011000 */
843 0x06, 0x00, /* 0000011000 */
844 0x0c, 0x00, /* 0000110000 */
845 0x0c, 0x00, /* 0000110000 */
846 0x18, 0x00, /* 0001100000 */
847 0x30, 0x00, /* 0011000000 */
848 0x00, 0x00, /* 0000000000 */
849 0x00, 0x00, /* 0000000000 */
850 0x00, 0x00, /* 0000000000 */
851
852 /* 42 0x2a '*' */
853 0x00, 0x00, /* 0000000000 */
854 0x00, 0x00, /* 0000000000 */
855 0x00, 0x00, /* 0000000000 */
856 0x0c, 0x00, /* 0000110000 */
857 0x4c, 0x80, /* 0100110010 */
858 0x6d, 0x80, /* 0110110110 */
859 0x3f, 0x00, /* 0011111100 */
860 0x7f, 0x80, /* 0111111110 */
861 0x3f, 0x00, /* 0011111100 */
862 0x6d, 0x80, /* 0110110110 */
863 0x4c, 0x80, /* 0100110010 */
864 0x0c, 0x00, /* 0000110000 */
865 0x00, 0x00, /* 0000000000 */
866 0x00, 0x00, /* 0000000000 */
867 0x00, 0x00, /* 0000000000 */
868 0x00, 0x00, /* 0000000000 */
869 0x00, 0x00, /* 0000000000 */
870 0x00, 0x00, /* 0000000000 */
871
872 /* 43 0x2b '+' */
873 0x00, 0x00, /* 0000000000 */
874 0x00, 0x00, /* 0000000000 */
875 0x00, 0x00, /* 0000000000 */
876 0x0c, 0x00, /* 0000110000 */
877 0x0c, 0x00, /* 0000110000 */
878 0x0c, 0x00, /* 0000110000 */
879 0x0c, 0x00, /* 0000110000 */
880 0x7f, 0x80, /* 0111111110 */
881 0x7f, 0x80, /* 0111111110 */
882 0x0c, 0x00, /* 0000110000 */
883 0x0c, 0x00, /* 0000110000 */
884 0x0c, 0x00, /* 0000110000 */
885 0x0c, 0x00, /* 0000110000 */
886 0x00, 0x00, /* 0000000000 */
887 0x00, 0x00, /* 0000000000 */
888 0x00, 0x00, /* 0000000000 */
889 0x00, 0x00, /* 0000000000 */
890 0x00, 0x00, /* 0000000000 */
891
892 /* 44 0x2c ',' */
893 0x00, 0x00, /* 0000000000 */
894 0x00, 0x00, /* 0000000000 */
895 0x00, 0x00, /* 0000000000 */
896 0x00, 0x00, /* 0000000000 */
897 0x00, 0x00, /* 0000000000 */
898 0x00, 0x00, /* 0000000000 */
899 0x00, 0x00, /* 0000000000 */
900 0x00, 0x00, /* 0000000000 */
901 0x00, 0x00, /* 0000000000 */
902 0x00, 0x00, /* 0000000000 */
903 0x30, 0x00, /* 0011000000 */
904 0x78, 0x00, /* 0111100000 */
905 0x78, 0x00, /* 0111100000 */
906 0x18, 0x00, /* 0001100000 */
907 0x18, 0x00, /* 0001100000 */
908 0x30, 0x00, /* 0011000000 */
909 0x60, 0x00, /* 0110000000 */
910 0x40, 0x00, /* 0100000000 */
911
912 /* 45 0x2d '-' */
913 0x00, 0x00, /* 0000000000 */
914 0x00, 0x00, /* 0000000000 */
915 0x00, 0x00, /* 0000000000 */
916 0x00, 0x00, /* 0000000000 */
917 0x00, 0x00, /* 0000000000 */
918 0x00, 0x00, /* 0000000000 */
919 0x00, 0x00, /* 0000000000 */
920 0x00, 0x00, /* 0000000000 */
921 0x7f, 0x80, /* 0111111110 */
922 0x7f, 0x80, /* 0111111110 */
923 0x00, 0x00, /* 0000000000 */
924 0x00, 0x00, /* 0000000000 */
925 0x00, 0x00, /* 0000000000 */
926 0x00, 0x00, /* 0000000000 */
927 0x00, 0x00, /* 0000000000 */
928 0x00, 0x00, /* 0000000000 */
929 0x00, 0x00, /* 0000000000 */
930 0x00, 0x00, /* 0000000000 */
931
932 /* 46 0x2e '.' */
933 0x00, 0x00, /* 0000000000 */
934 0x00, 0x00, /* 0000000000 */
935 0x00, 0x00, /* 0000000000 */
936 0x00, 0x00, /* 0000000000 */
937 0x00, 0x00, /* 0000000000 */
938 0x00, 0x00, /* 0000000000 */
939 0x00, 0x00, /* 0000000000 */
940 0x00, 0x00, /* 0000000000 */
941 0x00, 0x00, /* 0000000000 */
942 0x00, 0x00, /* 0000000000 */
943 0x00, 0x00, /* 0000000000 */
944 0x18, 0x00, /* 0001100000 */
945 0x3c, 0x00, /* 0011110000 */
946 0x3c, 0x00, /* 0011110000 */
947 0x18, 0x00, /* 0001100000 */
948 0x00, 0x00, /* 0000000000 */
949 0x00, 0x00, /* 0000000000 */
950 0x00, 0x00, /* 0000000000 */
951
952 /* 47 0x2f '/' */
953 0x00, 0x00, /* 0000000000 */
954 0x01, 0x80, /* 0000000110 */
955 0x01, 0x80, /* 0000000110 */
956 0x03, 0x00, /* 0000001100 */
957 0x03, 0x00, /* 0000001100 */
958 0x06, 0x00, /* 0000011000 */
959 0x06, 0x00, /* 0000011000 */
960 0x0c, 0x00, /* 0000110000 */
961 0x0c, 0x00, /* 0000110000 */
962 0x18, 0x00, /* 0001100000 */
963 0x18, 0x00, /* 0001100000 */
964 0x30, 0x00, /* 0011000000 */
965 0x30, 0x00, /* 0011000000 */
966 0x60, 0x00, /* 0110000000 */
967 0x60, 0x00, /* 0110000000 */
968 0x00, 0x00, /* 0000000000 */
969 0x00, 0x00, /* 0000000000 */
970 0x00, 0x00, /* 0000000000 */
971
972 /* 48 0x30 '0' */
973 0x00, 0x00, /* 0000000000 */
974 0x0e, 0x00, /* 0000111000 */
975 0x1f, 0x00, /* 0001111100 */
976 0x23, 0x00, /* 0010001100 */
977 0x61, 0x80, /* 0110000110 */
978 0x63, 0x80, /* 0110001110 */
979 0x65, 0x80, /* 0110010110 */
980 0x65, 0x80, /* 0110010110 */
981 0x69, 0x80, /* 0110100110 */
982 0x69, 0x80, /* 0110100110 */
983 0x71, 0x80, /* 0111000110 */
984 0x61, 0x00, /* 0110000100 */
985 0x31, 0x00, /* 0011000100 */
986 0x3e, 0x00, /* 0011111000 */
987 0x1c, 0x00, /* 0001110000 */
988 0x00, 0x00, /* 0000000000 */
989 0x00, 0x00, /* 0000000000 */
990 0x00, 0x00, /* 0000000000 */
991
992 /* 49 0x31 '1' */
993 0x00, 0x00, /* 0000000000 */
994 0x04, 0x00, /* 0000010000 */
995 0x0c, 0x00, /* 0000110000 */
996 0x1c, 0x00, /* 0001110000 */
997 0x3c, 0x00, /* 0011110000 */
998 0x6c, 0x00, /* 0110110000 */
999 0x0c, 0x00, /* 0000110000 */
1000 0x0c, 0x00, /* 0000110000 */
1001 0x0c, 0x00, /* 0000110000 */
1002 0x0c, 0x00, /* 0000110000 */
1003 0x0c, 0x00, /* 0000110000 */
1004 0x0c, 0x00, /* 0000110000 */
1005 0x0c, 0x00, /* 0000110000 */
1006 0x0c, 0x00, /* 0000110000 */
1007 0x7f, 0x80, /* 0111111110 */
1008 0x00, 0x00, /* 0000000000 */
1009 0x00, 0x00, /* 0000000000 */
1010 0x00, 0x00, /* 0000000000 */
1011
1012 /* 50 0x32 '2' */
1013 0x00, 0x00, /* 0000000000 */
1014 0x1e, 0x00, /* 0001111000 */
1015 0x3f, 0x00, /* 0011111100 */
1016 0x63, 0x80, /* 0110001110 */
1017 0x41, 0x80, /* 0100000110 */
1018 0x01, 0x80, /* 0000000110 */
1019 0x01, 0x80, /* 0000000110 */
1020 0x03, 0x00, /* 0000001100 */
1021 0x06, 0x00, /* 0000011000 */
1022 0x06, 0x00, /* 0000011000 */
1023 0x0c, 0x00, /* 0000110000 */
1024 0x18, 0x00, /* 0001100000 */
1025 0x30, 0x80, /* 0011000010 */
1026 0x7f, 0x80, /* 0111111110 */
1027 0x7f, 0x80, /* 0111111110 */
1028 0x00, 0x00, /* 0000000000 */
1029 0x00, 0x00, /* 0000000000 */
1030 0x00, 0x00, /* 0000000000 */
1031
1032 /* 51 0x33 '3' */
1033 0x00, 0x00, /* 0000000000 */
1034 0x1c, 0x00, /* 0001110000 */
1035 0x3e, 0x00, /* 0011111000 */
1036 0x47, 0x00, /* 0100011100 */
1037 0x03, 0x00, /* 0000001100 */
1038 0x07, 0x00, /* 0000011100 */
1039 0x06, 0x00, /* 0000011000 */
1040 0x0e, 0x00, /* 0000111000 */
1041 0x07, 0x00, /* 0000011100 */
1042 0x03, 0x00, /* 0000001100 */
1043 0x01, 0x80, /* 0000000110 */
1044 0x41, 0x80, /* 0100000110 */
1045 0x61, 0x80, /* 0110000110 */
1046 0x3f, 0x00, /* 0011111100 */
1047 0x1e, 0x00, /* 0001111000 */
1048 0x00, 0x00, /* 0000000000 */
1049 0x00, 0x00, /* 0000000000 */
1050 0x00, 0x00, /* 0000000000 */
1051
1052 /* 52 0x34 '4' */
1053 0x00, 0x00, /* 0000000000 */
1054 0x06, 0x00, /* 0000011000 */
1055 0x0e, 0x00, /* 0000111000 */
1056 0x1e, 0x00, /* 0001111000 */
1057 0x36, 0x00, /* 0011011000 */
1058 0x36, 0x00, /* 0011011000 */
1059 0x66, 0x00, /* 0110011000 */
1060 0x66, 0x00, /* 0110011000 */
1061 0xc6, 0x00, /* 1100011000 */
1062 0xc6, 0x00, /* 1100011000 */
1063 0xff, 0x80, /* 1111111110 */
1064 0xff, 0x80, /* 1111111110 */
1065 0x06, 0x00, /* 0000011000 */
1066 0x06, 0x00, /* 0000011000 */
1067 0x06, 0x00, /* 0000011000 */
1068 0x00, 0x00, /* 0000000000 */
1069 0x00, 0x00, /* 0000000000 */
1070 0x00, 0x00, /* 0000000000 */
1071
1072 /* 53 0x35 '5' */
1073 0x00, 0x00, /* 0000000000 */
1074 0x1f, 0x00, /* 0001111100 */
1075 0x1f, 0x00, /* 0001111100 */
1076 0x30, 0x00, /* 0011000000 */
1077 0x30, 0x00, /* 0011000000 */
1078 0x60, 0x00, /* 0110000000 */
1079 0x7e, 0x00, /* 0111111000 */
1080 0x67, 0x00, /* 0110011100 */
1081 0x03, 0x80, /* 0000001110 */
1082 0x01, 0x80, /* 0000000110 */
1083 0x01, 0x80, /* 0000000110 */
1084 0x01, 0x80, /* 0000000110 */
1085 0x41, 0x80, /* 0100000110 */
1086 0x63, 0x00, /* 0110001100 */
1087 0x3e, 0x00, /* 0011111000 */
1088 0x00, 0x00, /* 0000000000 */
1089 0x00, 0x00, /* 0000000000 */
1090 0x00, 0x00, /* 0000000000 */
1091
1092 /* 54 0x36 '6' */
1093 0x00, 0x00, /* 0000000000 */
1094 0x06, 0x00, /* 0000011000 */
1095 0x0c, 0x00, /* 0000110000 */
1096 0x18, 0x00, /* 0001100000 */
1097 0x30, 0x00, /* 0011000000 */
1098 0x30, 0x00, /* 0011000000 */
1099 0x60, 0x00, /* 0110000000 */
1100 0x6e, 0x00, /* 0110111000 */
1101 0x7f, 0x00, /* 0111111100 */
1102 0x73, 0x80, /* 0111001110 */
1103 0x61, 0x80, /* 0110000110 */
1104 0x61, 0x80, /* 0110000110 */
1105 0x71, 0x00, /* 0111000100 */
1106 0x3e, 0x00, /* 0011111000 */
1107 0x1c, 0x00, /* 0001110000 */
1108 0x00, 0x00, /* 0000000000 */
1109 0x00, 0x00, /* 0000000000 */
1110 0x00, 0x00, /* 0000000000 */
1111
1112 /* 55 0x37 '7' */
1113 0x00, 0x00, /* 0000000000 */
1114 0x1f, 0x80, /* 0001111110 */
1115 0x3f, 0x80, /* 0011111110 */
1116 0x61, 0x80, /* 0110000110 */
1117 0x01, 0x80, /* 0000000110 */
1118 0x03, 0x00, /* 0000001100 */
1119 0x03, 0x00, /* 0000001100 */
1120 0x06, 0x00, /* 0000011000 */
1121 0x06, 0x00, /* 0000011000 */
1122 0x0c, 0x00, /* 0000110000 */
1123 0x0c, 0x00, /* 0000110000 */
1124 0x18, 0x00, /* 0001100000 */
1125 0x18, 0x00, /* 0001100000 */
1126 0x30, 0x00, /* 0011000000 */
1127 0x30, 0x00, /* 0011000000 */
1128 0x00, 0x00, /* 0000000000 */
1129 0x00, 0x00, /* 0000000000 */
1130 0x00, 0x00, /* 0000000000 */
1131
1132 /* 56 0x38 '8' */
1133 0x00, 0x00, /* 0000000000 */
1134 0x1e, 0x00, /* 0001111000 */
1135 0x23, 0x00, /* 0010001100 */
1136 0x61, 0x80, /* 0110000110 */
1137 0x61, 0x80, /* 0110000110 */
1138 0x31, 0x00, /* 0011000100 */
1139 0x1a, 0x00, /* 0001101000 */
1140 0x0c, 0x00, /* 0000110000 */
1141 0x16, 0x00, /* 0001011000 */
1142 0x23, 0x00, /* 0010001100 */
1143 0x61, 0x80, /* 0110000110 */
1144 0x61, 0x80, /* 0110000110 */
1145 0x61, 0x80, /* 0110000110 */
1146 0x31, 0x00, /* 0011000100 */
1147 0x1e, 0x00, /* 0001111000 */
1148 0x00, 0x00, /* 0000000000 */
1149 0x00, 0x00, /* 0000000000 */
1150 0x00, 0x00, /* 0000000000 */
1151
1152 /* 57 0x39 '9' */
1153 0x00, 0x00, /* 0000000000 */
1154 0x0e, 0x00, /* 0000111000 */
1155 0x17, 0x00, /* 0001011100 */
1156 0x23, 0x80, /* 0010001110 */
1157 0x61, 0x80, /* 0110000110 */
1158 0x61, 0x80, /* 0110000110 */
1159 0x61, 0x80, /* 0110000110 */
1160 0x73, 0x80, /* 0111001110 */
1161 0x3d, 0x80, /* 0011110110 */
1162 0x19, 0x80, /* 0001100110 */
1163 0x01, 0x80, /* 0000000110 */
1164 0x03, 0x00, /* 0000001100 */
1165 0x03, 0x00, /* 0000001100 */
1166 0x06, 0x00, /* 0000011000 */
1167 0x0c, 0x00, /* 0000110000 */
1168 0x18, 0x00, /* 0001100000 */
1169 0x00, 0x00, /* 0000000000 */
1170 0x00, 0x00, /* 0000000000 */
1171
1172 /* 58 0x3a ':' */
1173 0x00, 0x00, /* 0000000000 */
1174 0x00, 0x00, /* 0000000000 */
1175 0x00, 0x00, /* 0000000000 */
1176 0x00, 0x00, /* 0000000000 */
1177 0x18, 0x00, /* 0001100000 */
1178 0x3c, 0x00, /* 0011110000 */
1179 0x3c, 0x00, /* 0011110000 */
1180 0x18, 0x00, /* 0001100000 */
1181 0x00, 0x00, /* 0000000000 */
1182 0x00, 0x00, /* 0000000000 */
1183 0x18, 0x00, /* 0001100000 */
1184 0x3c, 0x00, /* 0011110000 */
1185 0x3c, 0x00, /* 0011110000 */
1186 0x18, 0x00, /* 0001100000 */
1187 0x00, 0x00, /* 0000000000 */
1188 0x00, 0x00, /* 0000000000 */
1189 0x00, 0x00, /* 0000000000 */
1190 0x00, 0x00, /* 0000000000 */
1191
1192 /* 59 0x3b ';' */
1193 0x00, 0x00, /* 0000000000 */
1194 0x00, 0x00, /* 0000000000 */
1195 0x00, 0x00, /* 0000000000 */
1196 0x00, 0x00, /* 0000000000 */
1197 0x00, 0x00, /* 0000000000 */
1198 0x00, 0x00, /* 0000000000 */
1199 0x18, 0x00, /* 0001100000 */
1200 0x3c, 0x00, /* 0011110000 */
1201 0x3c, 0x00, /* 0011110000 */
1202 0x18, 0x00, /* 0001100000 */
1203 0x00, 0x00, /* 0000000000 */
1204 0x18, 0x00, /* 0001100000 */
1205 0x3c, 0x00, /* 0011110000 */
1206 0x3c, 0x00, /* 0011110000 */
1207 0x0c, 0x00, /* 0000110000 */
1208 0x18, 0x00, /* 0001100000 */
1209 0x30, 0x00, /* 0011000000 */
1210 0x20, 0x00, /* 0010000000 */
1211
1212 /* 60 0x3c '<' */
1213 0x00, 0x00, /* 0000000000 */
1214 0x00, 0x00, /* 0000000000 */
1215 0x03, 0x00, /* 0000001100 */
1216 0x06, 0x00, /* 0000011000 */
1217 0x0c, 0x00, /* 0000110000 */
1218 0x18, 0x00, /* 0001100000 */
1219 0x30, 0x00, /* 0011000000 */
1220 0x60, 0x00, /* 0110000000 */
1221 0x60, 0x00, /* 0110000000 */
1222 0x30, 0x00, /* 0011000000 */
1223 0x18, 0x00, /* 0001100000 */
1224 0x0c, 0x00, /* 0000110000 */
1225 0x06, 0x00, /* 0000011000 */
1226 0x03, 0x00, /* 0000001100 */
1227 0x00, 0x00, /* 0000000000 */
1228 0x00, 0x00, /* 0000000000 */
1229 0x00, 0x00, /* 0000000000 */
1230 0x00, 0x00, /* 0000000000 */
1231
1232 /* 61 0x3d '=' */
1233 0x00, 0x00, /* 0000000000 */
1234 0x00, 0x00, /* 0000000000 */
1235 0x00, 0x00, /* 0000000000 */
1236 0x00, 0x00, /* 0000000000 */
1237 0x00, 0x00, /* 0000000000 */
1238 0x00, 0x00, /* 0000000000 */
1239 0x7f, 0x80, /* 0111111110 */
1240 0x7f, 0x80, /* 0111111110 */
1241 0x00, 0x00, /* 0000000000 */
1242 0x00, 0x00, /* 0000000000 */
1243 0x7f, 0x80, /* 0111111110 */
1244 0x7f, 0x80, /* 0111111110 */
1245 0x00, 0x00, /* 0000000000 */
1246 0x00, 0x00, /* 0000000000 */
1247 0x00, 0x00, /* 0000000000 */
1248 0x00, 0x00, /* 0000000000 */
1249 0x00, 0x00, /* 0000000000 */
1250 0x00, 0x00, /* 0000000000 */
1251
1252 /* 62 0x3e '>' */
1253 0x00, 0x00, /* 0000000000 */
1254 0x00, 0x00, /* 0000000000 */
1255 0x30, 0x00, /* 0011000000 */
1256 0x18, 0x00, /* 0001100000 */
1257 0x0c, 0x00, /* 0000110000 */
1258 0x06, 0x00, /* 0000011000 */
1259 0x03, 0x00, /* 0000001100 */
1260 0x01, 0x80, /* 0000000110 */
1261 0x01, 0x80, /* 0000000110 */
1262 0x03, 0x00, /* 0000001100 */
1263 0x06, 0x00, /* 0000011000 */
1264 0x0c, 0x00, /* 0000110000 */
1265 0x18, 0x00, /* 0001100000 */
1266 0x30, 0x00, /* 0011000000 */
1267 0x00, 0x00, /* 0000000000 */
1268 0x00, 0x00, /* 0000000000 */
1269 0x00, 0x00, /* 0000000000 */
1270 0x00, 0x00, /* 0000000000 */
1271
1272 /* 63 0x3f '?' */
1273 0x00, 0x00, /* 0000000000 */
1274 0x0e, 0x00, /* 0000111000 */
1275 0x1f, 0x00, /* 0001111100 */
1276 0x3b, 0x80, /* 0011101110 */
1277 0x21, 0x80, /* 0010000110 */
1278 0x01, 0x80, /* 0000000110 */
1279 0x03, 0x00, /* 0000001100 */
1280 0x06, 0x00, /* 0000011000 */
1281 0x06, 0x00, /* 0000011000 */
1282 0x0c, 0x00, /* 0000110000 */
1283 0x0c, 0x00, /* 0000110000 */
1284 0x00, 0x00, /* 0000000000 */
1285 0x00, 0x00, /* 0000000000 */
1286 0x0c, 0x00, /* 0000110000 */
1287 0x0c, 0x00, /* 0000110000 */
1288 0x00, 0x00, /* 0000000000 */
1289 0x00, 0x00, /* 0000000000 */
1290 0x00, 0x00, /* 0000000000 */
1291
1292 /* 64 0x40 '@' */
1293 0x00, 0x00, /* 0000000000 */
1294 0x00, 0x00, /* 0000000000 */
1295 0x0e, 0x00, /* 0000111000 */
1296 0x3f, 0x00, /* 0011111100 */
1297 0x31, 0x80, /* 0011000110 */
1298 0x65, 0x80, /* 0110010110 */
1299 0x6d, 0x80, /* 0110110110 */
1300 0x6d, 0x80, /* 0110110110 */
1301 0x6d, 0x80, /* 0110110110 */
1302 0x6d, 0x80, /* 0110110110 */
1303 0x6f, 0x80, /* 0110111110 */
1304 0x60, 0x00, /* 0110000000 */
1305 0x31, 0x80, /* 0011000110 */
1306 0x3f, 0x80, /* 0011111110 */
1307 0x0f, 0x00, /* 0000111100 */
1308 0x00, 0x00, /* 0000000000 */
1309 0x00, 0x00, /* 0000000000 */
1310 0x00, 0x00, /* 0000000000 */
1311
1312 /* 65 0x41 'A' */
1313 0x00, 0x00, /* 0000000000 */
1314 0x04, 0x00, /* 0000010000 */
1315 0x04, 0x00, /* 0000010000 */
1316 0x0e, 0x00, /* 0000111000 */
1317 0x0e, 0x00, /* 0000111000 */
1318 0x1b, 0x00, /* 0001101100 */
1319 0x1b, 0x00, /* 0001101100 */
1320 0x19, 0x80, /* 0001100110 */
1321 0x31, 0x80, /* 0011000110 */
1322 0x3f, 0x80, /* 0011111110 */
1323 0x31, 0x80, /* 0011000110 */
1324 0x61, 0x80, /* 0110000110 */
1325 0x60, 0xc0, /* 0110000011 */
1326 0x60, 0xc0, /* 0110000011 */
1327 0xf1, 0xc0, /* 1111000111 */
1328 0x00, 0x00, /* 0000000000 */
1329 0x00, 0x00, /* 0000000000 */
1330 0x00, 0x00, /* 0000000000 */
1331
1332 /* 66 0x42 'B' */
1333 0x00, 0x00, /* 0000000000 */
1334 0xfc, 0x00, /* 1111110000 */
1335 0x62, 0x00, /* 0110001000 */
1336 0x63, 0x00, /* 0110001100 */
1337 0x63, 0x00, /* 0110001100 */
1338 0x63, 0x00, /* 0110001100 */
1339 0x66, 0x00, /* 0110011000 */
1340 0x7e, 0x00, /* 0111111000 */
1341 0x63, 0x00, /* 0110001100 */
1342 0x61, 0x80, /* 0110000110 */
1343 0x61, 0x80, /* 0110000110 */
1344 0x61, 0x80, /* 0110000110 */
1345 0x61, 0x80, /* 0110000110 */
1346 0x63, 0x00, /* 0110001100 */
1347 0xfe, 0x00, /* 1111111000 */
1348 0x00, 0x00, /* 0000000000 */
1349 0x00, 0x00, /* 0000000000 */
1350 0x00, 0x00, /* 0000000000 */
1351
1352 /* 67 0x43 'C' */
1353 0x00, 0x00, /* 0000000000 */
1354 0x0f, 0x00, /* 0000111100 */
1355 0x11, 0x80, /* 0001000110 */
1356 0x20, 0x80, /* 0010000010 */
1357 0x20, 0x00, /* 0010000000 */
1358 0x60, 0x00, /* 0110000000 */
1359 0x60, 0x00, /* 0110000000 */
1360 0x60, 0x00, /* 0110000000 */
1361 0x60, 0x00, /* 0110000000 */
1362 0x60, 0x00, /* 0110000000 */
1363 0x60, 0x00, /* 0110000000 */
1364 0x20, 0x00, /* 0010000000 */
1365 0x30, 0x80, /* 0011000010 */
1366 0x19, 0x00, /* 0001100100 */
1367 0x0e, 0x00, /* 0000111000 */
1368 0x00, 0x00, /* 0000000000 */
1369 0x00, 0x00, /* 0000000000 */
1370 0x00, 0x00, /* 0000000000 */
1371
1372 /* 68 0x44 'D' */
1373 0x00, 0x00, /* 0000000000 */
1374 0xfc, 0x00, /* 1111110000 */
1375 0x67, 0x00, /* 0110011100 */
1376 0x63, 0x00, /* 0110001100 */
1377 0x61, 0x80, /* 0110000110 */
1378 0x61, 0x80, /* 0110000110 */
1379 0x61, 0x80, /* 0110000110 */
1380 0x61, 0x80, /* 0110000110 */
1381 0x61, 0x80, /* 0110000110 */
1382 0x61, 0x80, /* 0110000110 */
1383 0x61, 0x80, /* 0110000110 */
1384 0x61, 0x80, /* 0110000110 */
1385 0x61, 0x00, /* 0110000100 */
1386 0x66, 0x00, /* 0110011000 */
1387 0xf8, 0x00, /* 1111100000 */
1388 0x00, 0x00, /* 0000000000 */
1389 0x00, 0x00, /* 0000000000 */
1390 0x00, 0x00, /* 0000000000 */
1391
1392 /* 69 0x45 'E' */
1393 0x00, 0x00, /* 0000000000 */
1394 0x7f, 0x80, /* 0111111110 */
1395 0x30, 0x80, /* 0011000010 */
1396 0x30, 0x80, /* 0011000010 */
1397 0x30, 0x00, /* 0011000000 */
1398 0x30, 0x00, /* 0011000000 */
1399 0x31, 0x00, /* 0011000100 */
1400 0x3f, 0x00, /* 0011111100 */
1401 0x31, 0x00, /* 0011000100 */
1402 0x30, 0x00, /* 0011000000 */
1403 0x30, 0x00, /* 0011000000 */
1404 0x30, 0x00, /* 0011000000 */
1405 0x30, 0x80, /* 0011000010 */
1406 0x30, 0x80, /* 0011000010 */
1407 0x7f, 0x80, /* 0111111110 */
1408 0x00, 0x00, /* 0000000000 */
1409 0x00, 0x00, /* 0000000000 */
1410 0x00, 0x00, /* 0000000000 */
1411
1412 /* 70 0x46 'F' */
1413 0x00, 0x00, /* 0000000000 */
1414 0x7f, 0x80, /* 0111111110 */
1415 0x30, 0x80, /* 0011000010 */
1416 0x30, 0x80, /* 0011000010 */
1417 0x30, 0x00, /* 0011000000 */
1418 0x30, 0x00, /* 0011000000 */
1419 0x31, 0x00, /* 0011000100 */
1420 0x3f, 0x00, /* 0011111100 */
1421 0x31, 0x00, /* 0011000100 */
1422 0x30, 0x00, /* 0011000000 */
1423 0x30, 0x00, /* 0011000000 */
1424 0x30, 0x00, /* 0011000000 */
1425 0x30, 0x00, /* 0011000000 */
1426 0x30, 0x00, /* 0011000000 */
1427 0x78, 0x00, /* 0111100000 */
1428 0x00, 0x00, /* 0000000000 */
1429 0x00, 0x00, /* 0000000000 */
1430 0x00, 0x00, /* 0000000000 */
1431
1432 /* 71 0x47 'G' */
1433 0x00, 0x00, /* 0000000000 */
1434 0x0f, 0x00, /* 0000111100 */
1435 0x11, 0x80, /* 0001000110 */
1436 0x20, 0x80, /* 0010000010 */
1437 0x20, 0x00, /* 0010000000 */
1438 0x60, 0x00, /* 0110000000 */
1439 0x60, 0x00, /* 0110000000 */
1440 0x60, 0x00, /* 0110000000 */
1441 0x60, 0x00, /* 0110000000 */
1442 0x67, 0xc0, /* 0110011111 */
1443 0x61, 0x80, /* 0110000110 */
1444 0x21, 0x80, /* 0010000110 */
1445 0x31, 0x80, /* 0011000110 */
1446 0x19, 0x80, /* 0001100110 */
1447 0x0e, 0x00, /* 0000111000 */
1448 0x00, 0x00, /* 0000000000 */
1449 0x00, 0x00, /* 0000000000 */
1450 0x00, 0x00, /* 0000000000 */
1451
1452 /* 72 0x48 'H' */
1453 0x00, 0x00, /* 0000000000 */
1454 0xf3, 0xc0, /* 1111001111 */
1455 0x61, 0x80, /* 0110000110 */
1456 0x61, 0x80, /* 0110000110 */
1457 0x61, 0x80, /* 0110000110 */
1458 0x61, 0x80, /* 0110000110 */
1459 0x61, 0x80, /* 0110000110 */
1460 0x7f, 0x80, /* 0111111110 */
1461 0x61, 0x80, /* 0110000110 */
1462 0x61, 0x80, /* 0110000110 */
1463 0x61, 0x80, /* 0110000110 */
1464 0x61, 0x80, /* 0110000110 */
1465 0x61, 0x80, /* 0110000110 */
1466 0x61, 0x80, /* 0110000110 */
1467 0xf3, 0xc0, /* 1111001111 */
1468 0x00, 0x00, /* 0000000000 */
1469 0x00, 0x00, /* 0000000000 */
1470 0x00, 0x00, /* 0000000000 */
1471
1472 /* 73 0x49 'I' */
1473 0x00, 0x00, /* 0000000000 */
1474 0x3f, 0x00, /* 0011111100 */
1475 0x0c, 0x00, /* 0000110000 */
1476 0x0c, 0x00, /* 0000110000 */
1477 0x0c, 0x00, /* 0000110000 */
1478 0x0c, 0x00, /* 0000110000 */
1479 0x0c, 0x00, /* 0000110000 */
1480 0x0c, 0x00, /* 0000110000 */
1481 0x0c, 0x00, /* 0000110000 */
1482 0x0c, 0x00, /* 0000110000 */
1483 0x0c, 0x00, /* 0000110000 */
1484 0x0c, 0x00, /* 0000110000 */
1485 0x0c, 0x00, /* 0000110000 */
1486 0x0c, 0x00, /* 0000110000 */
1487 0x3f, 0x00, /* 0011111100 */
1488 0x00, 0x00, /* 0000000000 */
1489 0x00, 0x00, /* 0000000000 */
1490 0x00, 0x00, /* 0000000000 */
1491
1492 /* 74 0x4a 'J' */
1493 0x00, 0x00, /* 0000000000 */
1494 0x3f, 0x00, /* 0011111100 */
1495 0x0c, 0x00, /* 0000110000 */
1496 0x0c, 0x00, /* 0000110000 */
1497 0x0c, 0x00, /* 0000110000 */
1498 0x0c, 0x00, /* 0000110000 */
1499 0x0c, 0x00, /* 0000110000 */
1500 0x0c, 0x00, /* 0000110000 */
1501 0x0c, 0x00, /* 0000110000 */
1502 0x0c, 0x00, /* 0000110000 */
1503 0x0c, 0x00, /* 0000110000 */
1504 0x0c, 0x00, /* 0000110000 */
1505 0x0c, 0x00, /* 0000110000 */
1506 0x0c, 0x00, /* 0000110000 */
1507 0x08, 0x00, /* 0000100000 */
1508 0x70, 0x00, /* 0111000000 */
1509 0x60, 0x00, /* 0110000000 */
1510 0x00, 0x00, /* 0000000000 */
1511
1512 /* 75 0x4b 'K' */
1513 0x00, 0x00, /* 0000000000 */
1514 0xf1, 0x80, /* 1111000110 */
1515 0x63, 0x00, /* 0110001100 */
1516 0x66, 0x00, /* 0110011000 */
1517 0x6c, 0x00, /* 0110110000 */
1518 0x78, 0x00, /* 0111100000 */
1519 0x70, 0x00, /* 0111000000 */
1520 0x70, 0x00, /* 0111000000 */
1521 0x78, 0x00, /* 0111100000 */
1522 0x78, 0x00, /* 0111100000 */
1523 0x6c, 0x00, /* 0110110000 */
1524 0x66, 0x00, /* 0110011000 */
1525 0x63, 0x00, /* 0110001100 */
1526 0x61, 0x80, /* 0110000110 */
1527 0xf0, 0xc0, /* 1111000011 */
1528 0x00, 0x00, /* 0000000000 */
1529 0x00, 0x00, /* 0000000000 */
1530 0x00, 0x00, /* 0000000000 */
1531
1532 /* 76 0x4c 'L' */
1533 0x00, 0x00, /* 0000000000 */
1534 0x78, 0x00, /* 0111100000 */
1535 0x30, 0x00, /* 0011000000 */
1536 0x30, 0x00, /* 0011000000 */
1537 0x30, 0x00, /* 0011000000 */
1538 0x30, 0x00, /* 0011000000 */
1539 0x30, 0x00, /* 0011000000 */
1540 0x30, 0x00, /* 0011000000 */
1541 0x30, 0x00, /* 0011000000 */
1542 0x30, 0x00, /* 0011000000 */
1543 0x30, 0x00, /* 0011000000 */
1544 0x30, 0x00, /* 0011000000 */
1545 0x30, 0x80, /* 0011000010 */
1546 0x30, 0x80, /* 0011000010 */
1547 0x7f, 0x80, /* 0111111110 */
1548 0x00, 0x00, /* 0000000000 */
1549 0x00, 0x00, /* 0000000000 */
1550 0x00, 0x00, /* 0000000000 */
1551
1552 /* 77 0x4d 'M' */
1553 0x00, 0x00, /* 0000000000 */
1554 0xe0, 0xc0, /* 1110000011 */
1555 0x61, 0x80, /* 0110000110 */
1556 0x73, 0x80, /* 0111001110 */
1557 0x73, 0x80, /* 0111001110 */
1558 0x6d, 0x80, /* 0110110110 */
1559 0x6d, 0x80, /* 0110110110 */
1560 0x61, 0x80, /* 0110000110 */
1561 0x61, 0x80, /* 0110000110 */
1562 0x61, 0x80, /* 0110000110 */
1563 0x61, 0x80, /* 0110000110 */
1564 0x61, 0x80, /* 0110000110 */
1565 0x61, 0x80, /* 0110000110 */
1566 0x61, 0x80, /* 0110000110 */
1567 0xf3, 0xc0, /* 1111001111 */
1568 0x00, 0x00, /* 0000000000 */
1569 0x00, 0x00, /* 0000000000 */
1570 0x00, 0x00, /* 0000000000 */
1571
1572 /* 78 0x4e 'N' */
1573 0x00, 0x00, /* 0000000000 */
1574 0xf3, 0xc0, /* 1111001111 */
1575 0x61, 0x80, /* 0110000110 */
1576 0x61, 0x80, /* 0110000110 */
1577 0x71, 0x80, /* 0111000110 */
1578 0x79, 0x80, /* 0111100110 */
1579 0x79, 0x80, /* 0111100110 */
1580 0x6d, 0x80, /* 0110110110 */
1581 0x6d, 0x80, /* 0110110110 */
1582 0x67, 0x80, /* 0110011110 */
1583 0x67, 0x80, /* 0110011110 */
1584 0x63, 0x80, /* 0110001110 */
1585 0x61, 0x80, /* 0110000110 */
1586 0x61, 0x80, /* 0110000110 */
1587 0xf3, 0xc0, /* 1111001111 */
1588 0x00, 0x00, /* 0000000000 */
1589 0x00, 0x00, /* 0000000000 */
1590 0x00, 0x00, /* 0000000000 */
1591
1592 /* 79 0x4f 'O' */
1593 0x00, 0x00, /* 0000000000 */
1594 0x0c, 0x00, /* 0000110000 */
1595 0x17, 0x00, /* 0001011100 */
1596 0x23, 0x00, /* 0010001100 */
1597 0x21, 0x80, /* 0010000110 */
1598 0x61, 0x80, /* 0110000110 */
1599 0x61, 0x80, /* 0110000110 */
1600 0x61, 0x80, /* 0110000110 */
1601 0x61, 0x80, /* 0110000110 */
1602 0x61, 0x80, /* 0110000110 */
1603 0x61, 0x80, /* 0110000110 */
1604 0x21, 0x00, /* 0010000100 */
1605 0x31, 0x00, /* 0011000100 */
1606 0x1a, 0x00, /* 0001101000 */
1607 0x0c, 0x00, /* 0000110000 */
1608 0x00, 0x00, /* 0000000000 */
1609 0x00, 0x00, /* 0000000000 */
1610 0x00, 0x00, /* 0000000000 */
1611
1612 /* 80 0x50 'P' */
1613 0x00, 0x00, /* 0000000000 */
1614 0xfe, 0x00, /* 1111111000 */
1615 0x63, 0x00, /* 0110001100 */
1616 0x61, 0x80, /* 0110000110 */
1617 0x61, 0x80, /* 0110000110 */
1618 0x61, 0x80, /* 0110000110 */
1619 0x63, 0x00, /* 0110001100 */
1620 0x7e, 0x00, /* 0111111000 */
1621 0x60, 0x00, /* 0110000000 */
1622 0x60, 0x00, /* 0110000000 */
1623 0x60, 0x00, /* 0110000000 */
1624 0x60, 0x00, /* 0110000000 */
1625 0x60, 0x00, /* 0110000000 */
1626 0x60, 0x00, /* 0110000000 */
1627 0xf0, 0x00, /* 1111000000 */
1628 0x00, 0x00, /* 0000000000 */
1629 0x00, 0x00, /* 0000000000 */
1630 0x00, 0x00, /* 0000000000 */
1631
1632 /* 81 0x51 'Q' */
1633 0x00, 0x00, /* 0000000000 */
1634 0x0e, 0x00, /* 0000111000 */
1635 0x13, 0x00, /* 0001001100 */
1636 0x23, 0x00, /* 0010001100 */
1637 0x21, 0x80, /* 0010000110 */
1638 0x61, 0x80, /* 0110000110 */
1639 0x61, 0x80, /* 0110000110 */
1640 0x61, 0x80, /* 0110000110 */
1641 0x61, 0x80, /* 0110000110 */
1642 0x61, 0x80, /* 0110000110 */
1643 0x31, 0x80, /* 0011000110 */
1644 0x3b, 0x00, /* 0011101100 */
1645 0x1e, 0x00, /* 0001111000 */
1646 0x0c, 0x00, /* 0000110000 */
1647 0x1e, 0x00, /* 0001111000 */
1648 0x26, 0x00, /* 0010011000 */
1649 0x03, 0x80, /* 0000001110 */
1650 0x00, 0x00, /* 0000000000 */
1651
1652 /* 82 0x52 'R' */
1653 0x00, 0x00, /* 0000000000 */
1654 0xfe, 0x00, /* 1111111000 */
1655 0x63, 0x00, /* 0110001100 */
1656 0x61, 0x80, /* 0110000110 */
1657 0x61, 0x80, /* 0110000110 */
1658 0x61, 0x80, /* 0110000110 */
1659 0x61, 0x00, /* 0110000100 */
1660 0x7e, 0x00, /* 0111111000 */
1661 0x78, 0x00, /* 0111100000 */
1662 0x6c, 0x00, /* 0110110000 */
1663 0x6e, 0x00, /* 0110111000 */
1664 0x67, 0x00, /* 0110011100 */
1665 0x63, 0x80, /* 0110001110 */
1666 0x61, 0xc0, /* 0110000111 */
1667 0xf0, 0xc0, /* 1111000011 */
1668 0x00, 0x00, /* 0000000000 */
1669 0x00, 0x00, /* 0000000000 */
1670 0x00, 0x00, /* 0000000000 */
1671
1672 /* 83 0x53 'S' */
1673 0x00, 0x00, /* 0000000000 */
1674 0x1f, 0x00, /* 0001111100 */
1675 0x31, 0x80, /* 0011000110 */
1676 0x60, 0x80, /* 0110000010 */
1677 0x60, 0x00, /* 0110000000 */
1678 0x60, 0x00, /* 0110000000 */
1679 0x30, 0x00, /* 0011000000 */
1680 0x18, 0x00, /* 0001100000 */
1681 0x0c, 0x00, /* 0000110000 */
1682 0x06, 0x00, /* 0000011000 */
1683 0x03, 0x00, /* 0000001100 */
1684 0x01, 0x80, /* 0000000110 */
1685 0x41, 0x80, /* 0100000110 */
1686 0x63, 0x00, /* 0110001100 */
1687 0x3e, 0x00, /* 0011111000 */
1688 0x00, 0x00, /* 0000000000 */
1689 0x00, 0x00, /* 0000000000 */
1690 0x00, 0x00, /* 0000000000 */
1691
1692 /* 84 0x54 'T' */
1693 0x00, 0x00, /* 0000000000 */
1694 0x7f, 0x80, /* 0111111110 */
1695 0x4c, 0x80, /* 0100110010 */
1696 0x0c, 0x00, /* 0000110000 */
1697 0x0c, 0x00, /* 0000110000 */
1698 0x0c, 0x00, /* 0000110000 */
1699 0x0c, 0x00, /* 0000110000 */
1700 0x0c, 0x00, /* 0000110000 */
1701 0x0c, 0x00, /* 0000110000 */
1702 0x0c, 0x00, /* 0000110000 */
1703 0x0c, 0x00, /* 0000110000 */
1704 0x0c, 0x00, /* 0000110000 */
1705 0x0c, 0x00, /* 0000110000 */
1706 0x0c, 0x00, /* 0000110000 */
1707 0x3f, 0x00, /* 0011111100 */
1708 0x00, 0x00, /* 0000000000 */
1709 0x00, 0x00, /* 0000000000 */
1710 0x00, 0x00, /* 0000000000 */
1711
1712 /* 85 0x55 'U' */
1713 0x00, 0x00, /* 0000000000 */
1714 0xf3, 0xc0, /* 1111001111 */
1715 0x61, 0x80, /* 0110000110 */
1716 0x61, 0x80, /* 0110000110 */
1717 0x61, 0x80, /* 0110000110 */
1718 0x61, 0x80, /* 0110000110 */
1719 0x61, 0x80, /* 0110000110 */
1720 0x61, 0x80, /* 0110000110 */
1721 0x61, 0x80, /* 0110000110 */
1722 0x61, 0x80, /* 0110000110 */
1723 0x61, 0x80, /* 0110000110 */
1724 0x61, 0x80, /* 0110000110 */
1725 0x73, 0x00, /* 0111001100 */
1726 0x3f, 0x00, /* 0011111100 */
1727 0x1e, 0x00, /* 0001111000 */
1728 0x00, 0x00, /* 0000000000 */
1729 0x00, 0x00, /* 0000000000 */
1730 0x00, 0x00, /* 0000000000 */
1731
1732 /* 86 0x56 'V' */
1733 0x00, 0x00, /* 0000000000 */
1734 0xe1, 0xc0, /* 1110000111 */
1735 0xc0, 0xc0, /* 1100000011 */
1736 0x61, 0x80, /* 0110000110 */
1737 0x61, 0x80, /* 0110000110 */
1738 0x61, 0x80, /* 0110000110 */
1739 0x33, 0x00, /* 0011001100 */
1740 0x33, 0x00, /* 0011001100 */
1741 0x33, 0x00, /* 0011001100 */
1742 0x12, 0x00, /* 0001001000 */
1743 0x1e, 0x00, /* 0001111000 */
1744 0x1e, 0x00, /* 0001111000 */
1745 0x0c, 0x00, /* 0000110000 */
1746 0x0c, 0x00, /* 0000110000 */
1747 0x0c, 0x00, /* 0000110000 */
1748 0x00, 0x00, /* 0000000000 */
1749 0x00, 0x00, /* 0000000000 */
1750 0x00, 0x00, /* 0000000000 */
1751
1752 /* 87 0x57 'W' */
1753 0x00, 0x00, /* 0000000000 */
1754 0xe1, 0xc0, /* 1110000111 */
1755 0xc0, 0xc0, /* 1100000011 */
1756 0xc0, 0xc0, /* 1100000011 */
1757 0xc0, 0xc0, /* 1100000011 */
1758 0xe0, 0xc0, /* 1110000011 */
1759 0x61, 0x80, /* 0110000110 */
1760 0x6d, 0x80, /* 0110110110 */
1761 0x6d, 0x80, /* 0110110110 */
1762 0x7f, 0x80, /* 0111111110 */
1763 0x77, 0x00, /* 0111011100 */
1764 0x33, 0x00, /* 0011001100 */
1765 0x33, 0x00, /* 0011001100 */
1766 0x33, 0x00, /* 0011001100 */
1767 0x33, 0x00, /* 0011001100 */
1768 0x00, 0x00, /* 0000000000 */
1769 0x00, 0x00, /* 0000000000 */
1770 0x00, 0x00, /* 0000000000 */
1771
1772 /* 88 0x58 'X' */
1773 0x00, 0x00, /* 0000000000 */
1774 0xf7, 0x80, /* 1111011110 */
1775 0x63, 0x00, /* 0110001100 */
1776 0x63, 0x00, /* 0110001100 */
1777 0x36, 0x00, /* 0011011000 */
1778 0x36, 0x00, /* 0011011000 */
1779 0x36, 0x00, /* 0011011000 */
1780 0x1c, 0x00, /* 0001110000 */
1781 0x1c, 0x00, /* 0001110000 */
1782 0x36, 0x00, /* 0011011000 */
1783 0x36, 0x00, /* 0011011000 */
1784 0x36, 0x00, /* 0011011000 */
1785 0x63, 0x00, /* 0110001100 */
1786 0x63, 0x00, /* 0110001100 */
1787 0xf7, 0x80, /* 1111011110 */
1788 0x00, 0x00, /* 0000000000 */
1789 0x00, 0x00, /* 0000000000 */
1790 0x00, 0x00, /* 0000000000 */
1791
1792 /* 89 0x59 'Y' */
1793 0x00, 0x00, /* 0000000000 */
1794 0xf3, 0xc0, /* 1111001111 */
1795 0x61, 0x80, /* 0110000110 */
1796 0x61, 0x80, /* 0110000110 */
1797 0x33, 0x00, /* 0011001100 */
1798 0x33, 0x00, /* 0011001100 */
1799 0x1e, 0x00, /* 0001111000 */
1800 0x0c, 0x00, /* 0000110000 */
1801 0x0c, 0x00, /* 0000110000 */
1802 0x0c, 0x00, /* 0000110000 */
1803 0x0c, 0x00, /* 0000110000 */
1804 0x0c, 0x00, /* 0000110000 */
1805 0x0c, 0x00, /* 0000110000 */
1806 0x0c, 0x00, /* 0000110000 */
1807 0x1e, 0x00, /* 0001111000 */
1808 0x00, 0x00, /* 0000000000 */
1809 0x00, 0x00, /* 0000000000 */
1810 0x00, 0x00, /* 0000000000 */
1811
1812 /* 90 0x5a 'Z' */
1813 0x00, 0x00, /* 0000000000 */
1814 0x3f, 0x80, /* 0011111110 */
1815 0x21, 0x80, /* 0010000110 */
1816 0x01, 0x80, /* 0000000110 */
1817 0x03, 0x00, /* 0000001100 */
1818 0x03, 0x00, /* 0000001100 */
1819 0x06, 0x00, /* 0000011000 */
1820 0x06, 0x00, /* 0000011000 */
1821 0x0c, 0x00, /* 0000110000 */
1822 0x0c, 0x00, /* 0000110000 */
1823 0x18, 0x00, /* 0001100000 */
1824 0x18, 0x00, /* 0001100000 */
1825 0x30, 0x00, /* 0011000000 */
1826 0x30, 0x80, /* 0011000010 */
1827 0x3f, 0x80, /* 0011111110 */
1828 0x00, 0x00, /* 0000000000 */
1829 0x00, 0x00, /* 0000000000 */
1830 0x00, 0x00, /* 0000000000 */
1831
1832 /* 91 0x5b '[' */
1833 0x00, 0x00, /* 0000000000 */
1834 0x1f, 0x00, /* 0001111100 */
1835 0x1f, 0x00, /* 0001111100 */
1836 0x18, 0x00, /* 0001100000 */
1837 0x18, 0x00, /* 0001100000 */
1838 0x18, 0x00, /* 0001100000 */
1839 0x18, 0x00, /* 0001100000 */
1840 0x18, 0x00, /* 0001100000 */
1841 0x18, 0x00, /* 0001100000 */
1842 0x18, 0x00, /* 0001100000 */
1843 0x18, 0x00, /* 0001100000 */
1844 0x18, 0x00, /* 0001100000 */
1845 0x18, 0x00, /* 0001100000 */
1846 0x18, 0x00, /* 0001100000 */
1847 0x1f, 0x00, /* 0001111100 */
1848 0x1f, 0x00, /* 0001111100 */
1849 0x00, 0x00, /* 0000000000 */
1850 0x00, 0x00, /* 0000000000 */
1851
1852 /* 92 0x5c '\' */
1853 0x00, 0x00, /* 0000000000 */
1854 0xc0, 0x00, /* 1100000000 */
1855 0x60, 0x00, /* 0110000000 */
1856 0x60, 0x00, /* 0110000000 */
1857 0x30, 0x00, /* 0011000000 */
1858 0x30, 0x00, /* 0011000000 */
1859 0x18, 0x00, /* 0001100000 */
1860 0x18, 0x00, /* 0001100000 */
1861 0x0c, 0x00, /* 0000110000 */
1862 0x0c, 0x00, /* 0000110000 */
1863 0x06, 0x00, /* 0000011000 */
1864 0x06, 0x00, /* 0000011000 */
1865 0x03, 0x00, /* 0000001100 */
1866 0x03, 0x00, /* 0000001100 */
1867 0x01, 0x80, /* 0000000110 */
1868 0x01, 0x80, /* 0000000110 */
1869 0x00, 0xc0, /* 0000000011 */
1870 0x00, 0x00, /* 0000000000 */
1871
1872 /* 93 0x5d ']' */
1873 0x00, 0x00, /* 0000000000 */
1874 0x3e, 0x00, /* 0011111000 */
1875 0x3e, 0x00, /* 0011111000 */
1876 0x06, 0x00, /* 0000011000 */
1877 0x06, 0x00, /* 0000011000 */
1878 0x06, 0x00, /* 0000011000 */
1879 0x06, 0x00, /* 0000011000 */
1880 0x06, 0x00, /* 0000011000 */
1881 0x06, 0x00, /* 0000011000 */
1882 0x06, 0x00, /* 0000011000 */
1883 0x06, 0x00, /* 0000011000 */
1884 0x06, 0x00, /* 0000011000 */
1885 0x06, 0x00, /* 0000011000 */
1886 0x06, 0x00, /* 0000011000 */
1887 0x3e, 0x00, /* 0011111000 */
1888 0x3e, 0x00, /* 0011111000 */
1889 0x00, 0x00, /* 0000000000 */
1890 0x00, 0x00, /* 0000000000 */
1891
1892 /* 94 0x5e '^' */
1893 0x00, 0x00, /* 0000000000 */
1894 0x0c, 0x00, /* 0000110000 */
1895 0x1e, 0x00, /* 0001111000 */
1896 0x33, 0x00, /* 0011001100 */
1897 0x61, 0x80, /* 0110000110 */
1898 0x00, 0x00, /* 0000000000 */
1899 0x00, 0x00, /* 0000000000 */
1900 0x00, 0x00, /* 0000000000 */
1901 0x00, 0x00, /* 0000000000 */
1902 0x00, 0x00, /* 0000000000 */
1903 0x00, 0x00, /* 0000000000 */
1904 0x00, 0x00, /* 0000000000 */
1905 0x00, 0x00, /* 0000000000 */
1906 0x00, 0x00, /* 0000000000 */
1907 0x00, 0x00, /* 0000000000 */
1908 0x00, 0x00, /* 0000000000 */
1909 0x00, 0x00, /* 0000000000 */
1910 0x00, 0x00, /* 0000000000 */
1911
1912 /* 95 0x5f '_' */
1913 0x00, 0x00, /* 0000000000 */
1914 0x00, 0x00, /* 0000000000 */
1915 0x00, 0x00, /* 0000000000 */
1916 0x00, 0x00, /* 0000000000 */
1917 0x00, 0x00, /* 0000000000 */
1918 0x00, 0x00, /* 0000000000 */
1919 0x00, 0x00, /* 0000000000 */
1920 0x00, 0x00, /* 0000000000 */
1921 0x00, 0x00, /* 0000000000 */
1922 0x00, 0x00, /* 0000000000 */
1923 0x00, 0x00, /* 0000000000 */
1924 0x00, 0x00, /* 0000000000 */
1925 0x00, 0x00, /* 0000000000 */
1926 0x00, 0x00, /* 0000000000 */
1927 0x00, 0x00, /* 0000000000 */
1928 0xff, 0xc0, /* 1111111111 */
1929 0xff, 0xc0, /* 1111111111 */
1930 0x00, 0x00, /* 0000000000 */
1931
1932 /* 96 0x60 '`' */
1933 0x04, 0x00, /* 0000010000 */
1934 0x0c, 0x00, /* 0000110000 */
1935 0x18, 0x00, /* 0001100000 */
1936 0x18, 0x00, /* 0001100000 */
1937 0x1e, 0x00, /* 0001111000 */
1938 0x1e, 0x00, /* 0001111000 */
1939 0x0c, 0x00, /* 0000110000 */
1940 0x00, 0x00, /* 0000000000 */
1941 0x00, 0x00, /* 0000000000 */
1942 0x00, 0x00, /* 0000000000 */
1943 0x00, 0x00, /* 0000000000 */
1944 0x00, 0x00, /* 0000000000 */
1945 0x00, 0x00, /* 0000000000 */
1946 0x00, 0x00, /* 0000000000 */
1947 0x00, 0x00, /* 0000000000 */
1948 0x00, 0x00, /* 0000000000 */
1949 0x00, 0x00, /* 0000000000 */
1950 0x00, 0x00, /* 0000000000 */
1951
1952 /* 97 0x61 'a' */
1953 0x00, 0x00, /* 0000000000 */
1954 0x00, 0x00, /* 0000000000 */
1955 0x00, 0x00, /* 0000000000 */
1956 0x00, 0x00, /* 0000000000 */
1957 0x00, 0x00, /* 0000000000 */
1958 0x1f, 0x00, /* 0001111100 */
1959 0x31, 0x80, /* 0011000110 */
1960 0x21, 0x80, /* 0010000110 */
1961 0x07, 0x80, /* 0000011110 */
1962 0x39, 0x80, /* 0011100110 */
1963 0x61, 0x80, /* 0110000110 */
1964 0x61, 0x80, /* 0110000110 */
1965 0x61, 0x80, /* 0110000110 */
1966 0x73, 0x80, /* 0111001110 */
1967 0x3d, 0xc0, /* 0011110111 */
1968 0x00, 0x00, /* 0000000000 */
1969 0x00, 0x00, /* 0000000000 */
1970 0x00, 0x00, /* 0000000000 */
1971
1972 /* 98 0x62 'b' */
1973 0x20, 0x00, /* 0010000000 */
1974 0x60, 0x00, /* 0110000000 */
1975 0xe0, 0x00, /* 1110000000 */
1976 0x60, 0x00, /* 0110000000 */
1977 0x60, 0x00, /* 0110000000 */
1978 0x66, 0x00, /* 0110011000 */
1979 0x6f, 0x00, /* 0110111100 */
1980 0x73, 0x80, /* 0111001110 */
1981 0x61, 0x80, /* 0110000110 */
1982 0x61, 0x80, /* 0110000110 */
1983 0x61, 0x80, /* 0110000110 */
1984 0x61, 0x80, /* 0110000110 */
1985 0x71, 0x80, /* 0111000110 */
1986 0x7b, 0x00, /* 0111101100 */
1987 0x4e, 0x00, /* 0100111000 */
1988 0x00, 0x00, /* 0000000000 */
1989 0x00, 0x00, /* 0000000000 */
1990 0x00, 0x00, /* 0000000000 */
1991
1992 /* 99 0x63 'c' */
1993 0x00, 0x00, /* 0000000000 */
1994 0x00, 0x00, /* 0000000000 */
1995 0x00, 0x00, /* 0000000000 */
1996 0x00, 0x00, /* 0000000000 */
1997 0x00, 0x00, /* 0000000000 */
1998 0x1e, 0x00, /* 0001111000 */
1999 0x37, 0x00, /* 0011011100 */
2000 0x23, 0x00, /* 0010001100 */
2001 0x60, 0x00, /* 0110000000 */
2002 0x60, 0x00, /* 0110000000 */
2003 0x60, 0x00, /* 0110000000 */
2004 0x60, 0x00, /* 0110000000 */
2005 0x71, 0x00, /* 0111000100 */
2006 0x33, 0x00, /* 0011001100 */
2007 0x1e, 0x00, /* 0001111000 */
2008 0x00, 0x00, /* 0000000000 */
2009 0x00, 0x00, /* 0000000000 */
2010 0x00, 0x00, /* 0000000000 */
2011
2012 /* 100 0x64 'd' */
2013 0x01, 0x80, /* 0000000110 */
2014 0x03, 0x80, /* 0000001110 */
2015 0x01, 0x80, /* 0000000110 */
2016 0x01, 0x80, /* 0000000110 */
2017 0x01, 0x80, /* 0000000110 */
2018 0x0d, 0x80, /* 0000110110 */
2019 0x37, 0x80, /* 0011011110 */
2020 0x23, 0x80, /* 0010001110 */
2021 0x61, 0x80, /* 0110000110 */
2022 0x61, 0x80, /* 0110000110 */
2023 0x61, 0x80, /* 0110000110 */
2024 0x61, 0x80, /* 0110000110 */
2025 0x73, 0x80, /* 0111001110 */
2026 0x35, 0x80, /* 0011010110 */
2027 0x19, 0xc0, /* 0001100111 */
2028 0x00, 0x00, /* 0000000000 */
2029 0x00, 0x00, /* 0000000000 */
2030 0x00, 0x00, /* 0000000000 */
2031
2032 /* 101 0x65 'e' */
2033 0x00, 0x00, /* 0000000000 */
2034 0x00, 0x00, /* 0000000000 */
2035 0x00, 0x00, /* 0000000000 */
2036 0x00, 0x00, /* 0000000000 */
2037 0x00, 0x00, /* 0000000000 */
2038 0x0c, 0x00, /* 0000110000 */
2039 0x33, 0x00, /* 0011001100 */
2040 0x61, 0x80, /* 0110000110 */
2041 0x61, 0x80, /* 0110000110 */
2042 0x7f, 0x80, /* 0111111110 */
2043 0x60, 0x00, /* 0110000000 */
2044 0x60, 0x00, /* 0110000000 */
2045 0x30, 0x00, /* 0011000000 */
2046 0x19, 0x80, /* 0001100110 */
2047 0x0e, 0x00, /* 0000111000 */
2048 0x00, 0x00, /* 0000000000 */
2049 0x00, 0x00, /* 0000000000 */
2050 0x00, 0x00, /* 0000000000 */
2051
2052 /* 102 0x66 'f' */
2053 0x07, 0x00, /* 0000011100 */
2054 0x09, 0x80, /* 0000100110 */
2055 0x09, 0x80, /* 0000100110 */
2056 0x18, 0x00, /* 0001100000 */
2057 0x18, 0x00, /* 0001100000 */
2058 0x18, 0x00, /* 0001100000 */
2059 0x18, 0x00, /* 0001100000 */
2060 0x7f, 0x00, /* 0111111100 */
2061 0x18, 0x00, /* 0001100000 */
2062 0x18, 0x00, /* 0001100000 */
2063 0x18, 0x00, /* 0001100000 */
2064 0x18, 0x00, /* 0001100000 */
2065 0x18, 0x00, /* 0001100000 */
2066 0x18, 0x00, /* 0001100000 */
2067 0x3c, 0x00, /* 0011110000 */
2068 0x00, 0x00, /* 0000000000 */
2069 0x00, 0x00, /* 0000000000 */
2070 0x00, 0x00, /* 0000000000 */
2071
2072 /* 103 0x67 'g' */
2073 0x00, 0x00, /* 0000000000 */
2074 0x00, 0x00, /* 0000000000 */
2075 0x00, 0x00, /* 0000000000 */
2076 0x00, 0x00, /* 0000000000 */
2077 0x00, 0x00, /* 0000000000 */
2078 0x1c, 0x80, /* 0001110010 */
2079 0x37, 0x80, /* 0011011110 */
2080 0x63, 0x00, /* 0110001100 */
2081 0x63, 0x00, /* 0110001100 */
2082 0x36, 0x00, /* 0011011000 */
2083 0x3c, 0x00, /* 0011110000 */
2084 0x60, 0x00, /* 0110000000 */
2085 0x7f, 0x00, /* 0111111100 */
2086 0x3f, 0x80, /* 0011111110 */
2087 0x21, 0x80, /* 0010000110 */
2088 0x40, 0x80, /* 0100000010 */
2089 0x7f, 0x00, /* 0111111100 */
2090 0x3e, 0x00, /* 0011111000 */
2091
2092 /* 104 0x68 'h' */
2093 0x10, 0x00, /* 0001000000 */
2094 0x30, 0x00, /* 0011000000 */
2095 0x70, 0x00, /* 0111000000 */
2096 0x30, 0x00, /* 0011000000 */
2097 0x30, 0x00, /* 0011000000 */
2098 0x37, 0x00, /* 0011011100 */
2099 0x3b, 0x80, /* 0011101110 */
2100 0x31, 0x80, /* 0011000110 */
2101 0x31, 0x80, /* 0011000110 */
2102 0x31, 0x80, /* 0011000110 */
2103 0x31, 0x80, /* 0011000110 */
2104 0x31, 0x80, /* 0011000110 */
2105 0x31, 0x80, /* 0011000110 */
2106 0x31, 0x80, /* 0011000110 */
2107 0x7b, 0xc0, /* 0111101111 */
2108 0x00, 0x00, /* 0000000000 */
2109 0x00, 0x00, /* 0000000000 */
2110 0x00, 0x00, /* 0000000000 */
2111
2112 /* 105 0x69 'i' */
2113 0x00, 0x00, /* 0000000000 */
2114 0x0c, 0x00, /* 0000110000 */
2115 0x0c, 0x00, /* 0000110000 */
2116 0x00, 0x00, /* 0000000000 */
2117 0x00, 0x00, /* 0000000000 */
2118 0x3c, 0x00, /* 0011110000 */
2119 0x0c, 0x00, /* 0000110000 */
2120 0x0c, 0x00, /* 0000110000 */
2121 0x0c, 0x00, /* 0000110000 */
2122 0x0c, 0x00, /* 0000110000 */
2123 0x0c, 0x00, /* 0000110000 */
2124 0x0c, 0x00, /* 0000110000 */
2125 0x0c, 0x00, /* 0000110000 */
2126 0x0c, 0x00, /* 0000110000 */
2127 0x3f, 0x00, /* 0011111100 */
2128 0x00, 0x00, /* 0000000000 */
2129 0x00, 0x00, /* 0000000000 */
2130 0x00, 0x00, /* 0000000000 */
2131
2132 /* 106 0x6a 'j' */
2133 0x00, 0x00, /* 0000000000 */
2134 0x01, 0x80, /* 0000000110 */
2135 0x01, 0x80, /* 0000000110 */
2136 0x00, 0x00, /* 0000000000 */
2137 0x00, 0x00, /* 0000000000 */
2138 0x07, 0x80, /* 0000011110 */
2139 0x01, 0x80, /* 0000000110 */
2140 0x01, 0x80, /* 0000000110 */
2141 0x01, 0x80, /* 0000000110 */
2142 0x01, 0x80, /* 0000000110 */
2143 0x01, 0x80, /* 0000000110 */
2144 0x01, 0x80, /* 0000000110 */
2145 0x01, 0x80, /* 0000000110 */
2146 0x41, 0x80, /* 0100000110 */
2147 0x61, 0x80, /* 0110000110 */
2148 0x71, 0x80, /* 0111000110 */
2149 0x3f, 0x00, /* 0011111100 */
2150 0x1c, 0x00, /* 0001110000 */
2151
2152 /* 107 0x6b 'k' */
2153 0x60, 0x00, /* 0110000000 */
2154 0xe0, 0x00, /* 1110000000 */
2155 0x60, 0x00, /* 0110000000 */
2156 0x60, 0x00, /* 0110000000 */
2157 0x60, 0x00, /* 0110000000 */
2158 0x63, 0x80, /* 0110001110 */
2159 0x66, 0x00, /* 0110011000 */
2160 0x6c, 0x00, /* 0110110000 */
2161 0x78, 0x00, /* 0111100000 */
2162 0x70, 0x00, /* 0111000000 */
2163 0x78, 0x00, /* 0111100000 */
2164 0x6c, 0x00, /* 0110110000 */
2165 0x6e, 0x00, /* 0110111000 */
2166 0x67, 0x00, /* 0110011100 */
2167 0xf3, 0x80, /* 1111001110 */
2168 0x00, 0x00, /* 0000000000 */
2169 0x00, 0x00, /* 0000000000 */
2170 0x00, 0x00, /* 0000000000 */
2171
2172 /* 108 0x6c 'l' */
2173 0x3c, 0x00, /* 0011110000 */
2174 0x0c, 0x00, /* 0000110000 */
2175 0x0c, 0x00, /* 0000110000 */
2176 0x0c, 0x00, /* 0000110000 */
2177 0x0c, 0x00, /* 0000110000 */
2178 0x0c, 0x00, /* 0000110000 */
2179 0x0c, 0x00, /* 0000110000 */
2180 0x0c, 0x00, /* 0000110000 */
2181 0x0c, 0x00, /* 0000110000 */
2182 0x0c, 0x00, /* 0000110000 */
2183 0x0c, 0x00, /* 0000110000 */
2184 0x0c, 0x00, /* 0000110000 */
2185 0x0c, 0x00, /* 0000110000 */
2186 0x0c, 0x00, /* 0000110000 */
2187 0x3f, 0x00, /* 0011111100 */
2188 0x00, 0x00, /* 0000000000 */
2189 0x00, 0x00, /* 0000000000 */
2190 0x00, 0x00, /* 0000000000 */
2191
2192 /* 109 0x6d 'm' */
2193 0x00, 0x00, /* 0000000000 */
2194 0x00, 0x00, /* 0000000000 */
2195 0x00, 0x00, /* 0000000000 */
2196 0x00, 0x00, /* 0000000000 */
2197 0x00, 0x00, /* 0000000000 */
2198 0xdb, 0x80, /* 1101101110 */
2199 0x6d, 0x80, /* 0110110110 */
2200 0x6d, 0x80, /* 0110110110 */
2201 0x6d, 0x80, /* 0110110110 */
2202 0x6d, 0x80, /* 0110110110 */
2203 0x6d, 0x80, /* 0110110110 */
2204 0x6d, 0x80, /* 0110110110 */
2205 0x6d, 0x80, /* 0110110110 */
2206 0x6d, 0x80, /* 0110110110 */
2207 0xed, 0xc0, /* 1110110111 */
2208 0x00, 0x00, /* 0000000000 */
2209 0x00, 0x00, /* 0000000000 */
2210 0x00, 0x00, /* 0000000000 */
2211
2212 /* 110 0x6e 'n' */
2213 0x00, 0x00, /* 0000000000 */
2214 0x00, 0x00, /* 0000000000 */
2215 0x00, 0x00, /* 0000000000 */
2216 0x00, 0x00, /* 0000000000 */
2217 0x00, 0x00, /* 0000000000 */
2218 0x6f, 0x00, /* 0110111100 */
2219 0x7b, 0x80, /* 0111101110 */
2220 0x31, 0x80, /* 0011000110 */
2221 0x31, 0x80, /* 0011000110 */
2222 0x31, 0x80, /* 0011000110 */
2223 0x31, 0x80, /* 0011000110 */
2224 0x31, 0x80, /* 0011000110 */
2225 0x31, 0x80, /* 0011000110 */
2226 0x31, 0x80, /* 0011000110 */
2227 0x7b, 0xc0, /* 0111101111 */
2228 0x00, 0x00, /* 0000000000 */
2229 0x00, 0x00, /* 0000000000 */
2230 0x00, 0x00, /* 0000000000 */
2231
2232 /* 111 0x6f 'o' */
2233 0x00, 0x00, /* 0000000000 */
2234 0x00, 0x00, /* 0000000000 */
2235 0x00, 0x00, /* 0000000000 */
2236 0x00, 0x00, /* 0000000000 */
2237 0x00, 0x00, /* 0000000000 */
2238 0x3c, 0x00, /* 0011110000 */
2239 0x66, 0x00, /* 0110011000 */
2240 0xc3, 0x00, /* 1100001100 */
2241 0xc1, 0x80, /* 1100000110 */
2242 0xc1, 0x80, /* 1100000110 */
2243 0xc1, 0x80, /* 1100000110 */
2244 0xc1, 0x80, /* 1100000110 */
2245 0xe1, 0x80, /* 1110000110 */
2246 0x73, 0x00, /* 0111001100 */
2247 0x3c, 0x00, /* 0011110000 */
2248 0x00, 0x00, /* 0000000000 */
2249 0x00, 0x00, /* 0000000000 */
2250 0x00, 0x00, /* 0000000000 */
2251
2252 /* 112 0x70 'p' */
2253 0x00, 0x00, /* 0000000000 */
2254 0x00, 0x00, /* 0000000000 */
2255 0x00, 0x00, /* 0000000000 */
2256 0x00, 0x00, /* 0000000000 */
2257 0x00, 0x00, /* 0000000000 */
2258 0xde, 0x00, /* 1101111000 */
2259 0x76, 0x00, /* 0111011000 */
2260 0x63, 0x00, /* 0110001100 */
2261 0x61, 0x80, /* 0110000110 */
2262 0x61, 0x80, /* 0110000110 */
2263 0x61, 0x80, /* 0110000110 */
2264 0x61, 0x80, /* 0110000110 */
2265 0x71, 0x80, /* 0111000110 */
2266 0x7b, 0x00, /* 0111101100 */
2267 0x7e, 0x00, /* 0111111000 */
2268 0x60, 0x00, /* 0110000000 */
2269 0x60, 0x00, /* 0110000000 */
2270 0xf0, 0x00, /* 1111000000 */
2271
2272 /* 113 0x71 'q' */
2273 0x00, 0x00, /* 0000000000 */
2274 0x00, 0x00, /* 0000000000 */
2275 0x00, 0x00, /* 0000000000 */
2276 0x00, 0x00, /* 0000000000 */
2277 0x00, 0x00, /* 0000000000 */
2278 0x0e, 0xc0, /* 0000111011 */
2279 0x1b, 0x80, /* 0001101110 */
2280 0x33, 0x80, /* 0011001110 */
2281 0x61, 0x80, /* 0110000110 */
2282 0x61, 0x80, /* 0110000110 */
2283 0x61, 0x80, /* 0110000110 */
2284 0x61, 0x80, /* 0110000110 */
2285 0x71, 0x80, /* 0111000110 */
2286 0x3b, 0x80, /* 0011101110 */
2287 0x1f, 0x80, /* 0001111110 */
2288 0x01, 0x80, /* 0000000110 */
2289 0x01, 0x80, /* 0000000110 */
2290 0x03, 0xc0, /* 0000001111 */
2291
2292 /* 114 0x72 'r' */
2293 0x00, 0x00, /* 0000000000 */
2294 0x00, 0x00, /* 0000000000 */
2295 0x00, 0x00, /* 0000000000 */
2296 0x00, 0x00, /* 0000000000 */
2297 0x00, 0x00, /* 0000000000 */
2298 0x73, 0x00, /* 0111001100 */
2299 0x35, 0x80, /* 0011010110 */
2300 0x39, 0x80, /* 0011100110 */
2301 0x30, 0x00, /* 0011000000 */
2302 0x30, 0x00, /* 0011000000 */
2303 0x30, 0x00, /* 0011000000 */
2304 0x30, 0x00, /* 0011000000 */
2305 0x30, 0x00, /* 0011000000 */
2306 0x30, 0x00, /* 0011000000 */
2307 0x78, 0x00, /* 0111100000 */
2308 0x00, 0x00, /* 0000000000 */
2309 0x00, 0x00, /* 0000000000 */
2310 0x00, 0x00, /* 0000000000 */
2311
2312 /* 115 0x73 's' */
2313 0x00, 0x00, /* 0000000000 */
2314 0x00, 0x00, /* 0000000000 */
2315 0x00, 0x00, /* 0000000000 */
2316 0x00, 0x00, /* 0000000000 */
2317 0x00, 0x00, /* 0000000000 */
2318 0x3f, 0x00, /* 0011111100 */
2319 0x63, 0x00, /* 0110001100 */
2320 0x61, 0x00, /* 0110000100 */
2321 0x70, 0x00, /* 0111000000 */
2322 0x38, 0x00, /* 0011100000 */
2323 0x0e, 0x00, /* 0000111000 */
2324 0x07, 0x00, /* 0000011100 */
2325 0x43, 0x00, /* 0100001100 */
2326 0x63, 0x00, /* 0110001100 */
2327 0x7e, 0x00, /* 0111111000 */
2328 0x00, 0x00, /* 0000000000 */
2329 0x00, 0x00, /* 0000000000 */
2330 0x00, 0x00, /* 0000000000 */
2331
2332 /* 116 0x74 't' */
2333 0x00, 0x00, /* 0000000000 */
2334 0x00, 0x00, /* 0000000000 */
2335 0x08, 0x00, /* 0000100000 */
2336 0x08, 0x00, /* 0000100000 */
2337 0x18, 0x00, /* 0001100000 */
2338 0x7f, 0x80, /* 0111111110 */
2339 0x18, 0x00, /* 0001100000 */
2340 0x18, 0x00, /* 0001100000 */
2341 0x18, 0x00, /* 0001100000 */
2342 0x18, 0x00, /* 0001100000 */
2343 0x18, 0x00, /* 0001100000 */
2344 0x18, 0x00, /* 0001100000 */
2345 0x18, 0x00, /* 0001100000 */
2346 0x1c, 0x80, /* 0001110010 */
2347 0x0f, 0x00, /* 0000111100 */
2348 0x00, 0x00, /* 0000000000 */
2349 0x00, 0x00, /* 0000000000 */
2350 0x00, 0x00, /* 0000000000 */
2351
2352 /* 117 0x75 'u' */
2353 0x00, 0x00, /* 0000000000 */
2354 0x00, 0x00, /* 0000000000 */
2355 0x00, 0x00, /* 0000000000 */
2356 0x00, 0x00, /* 0000000000 */
2357 0x00, 0x00, /* 0000000000 */
2358 0xf7, 0x80, /* 1111011110 */
2359 0x63, 0x00, /* 0110001100 */
2360 0x63, 0x00, /* 0110001100 */
2361 0x63, 0x00, /* 0110001100 */
2362 0x63, 0x00, /* 0110001100 */
2363 0x63, 0x00, /* 0110001100 */
2364 0x63, 0x00, /* 0110001100 */
2365 0x63, 0x00, /* 0110001100 */
2366 0x77, 0x00, /* 0111011100 */
2367 0x3d, 0x80, /* 0011110110 */
2368 0x00, 0x00, /* 0000000000 */
2369 0x00, 0x00, /* 0000000000 */
2370 0x00, 0x00, /* 0000000000 */
2371
2372 /* 118 0x76 'v' */
2373 0x00, 0x00, /* 0000000000 */
2374 0x00, 0x00, /* 0000000000 */
2375 0x00, 0x00, /* 0000000000 */
2376 0x00, 0x00, /* 0000000000 */
2377 0x00, 0x00, /* 0000000000 */
2378 0xf1, 0xc0, /* 1111000111 */
2379 0x60, 0xc0, /* 0110000011 */
2380 0x31, 0x80, /* 0011000110 */
2381 0x31, 0x80, /* 0011000110 */
2382 0x19, 0x80, /* 0001100110 */
2383 0x1b, 0x00, /* 0001101100 */
2384 0x0f, 0x00, /* 0000111100 */
2385 0x0f, 0x00, /* 0000111100 */
2386 0x06, 0x00, /* 0000011000 */
2387 0x06, 0x00, /* 0000011000 */
2388 0x00, 0x00, /* 0000000000 */
2389 0x00, 0x00, /* 0000000000 */
2390 0x00, 0x00, /* 0000000000 */
2391
2392 /* 119 0x77 'w' */
2393 0x00, 0x00, /* 0000000000 */
2394 0x00, 0x00, /* 0000000000 */
2395 0x00, 0x00, /* 0000000000 */
2396 0x00, 0x00, /* 0000000000 */
2397 0x00, 0x00, /* 0000000000 */
2398 0xe3, 0xc0, /* 1110001111 */
2399 0xc1, 0x80, /* 1100000110 */
2400 0xc1, 0x80, /* 1100000110 */
2401 0xc1, 0x80, /* 1100000110 */
2402 0xc1, 0x80, /* 1100000110 */
2403 0x6b, 0x00, /* 0110101100 */
2404 0x6b, 0x00, /* 0110101100 */
2405 0x7e, 0x00, /* 0111111000 */
2406 0x36, 0x00, /* 0011011000 */
2407 0x36, 0x00, /* 0011011000 */
2408 0x00, 0x00, /* 0000000000 */
2409 0x00, 0x00, /* 0000000000 */
2410 0x00, 0x00, /* 0000000000 */
2411
2412 /* 120 0x78 'x' */
2413 0x00, 0x00, /* 0000000000 */
2414 0x00, 0x00, /* 0000000000 */
2415 0x00, 0x00, /* 0000000000 */
2416 0x00, 0x00, /* 0000000000 */
2417 0x00, 0x00, /* 0000000000 */
2418 0xf7, 0x80, /* 1111011110 */
2419 0x63, 0x00, /* 0110001100 */
2420 0x36, 0x00, /* 0011011000 */
2421 0x36, 0x00, /* 0011011000 */
2422 0x1c, 0x00, /* 0001110000 */
2423 0x1c, 0x00, /* 0001110000 */
2424 0x36, 0x00, /* 0011011000 */
2425 0x66, 0x00, /* 0110011000 */
2426 0x63, 0x00, /* 0110001100 */
2427 0xf7, 0x80, /* 1111011110 */
2428 0x00, 0x00, /* 0000000000 */
2429 0x00, 0x00, /* 0000000000 */
2430 0x00, 0x00, /* 0000000000 */
2431
2432 /* 121 0x79 'y' */
2433 0x00, 0x00, /* 0000000000 */
2434 0x00, 0x00, /* 0000000000 */
2435 0x00, 0x00, /* 0000000000 */
2436 0x00, 0x00, /* 0000000000 */
2437 0x00, 0x00, /* 0000000000 */
2438 0xf3, 0xc0, /* 1111001111 */
2439 0x61, 0x80, /* 0110000110 */
2440 0x33, 0x00, /* 0011001100 */
2441 0x1b, 0x00, /* 0001101100 */
2442 0x1e, 0x00, /* 0001111000 */
2443 0x0e, 0x00, /* 0000111000 */
2444 0x0c, 0x00, /* 0000110000 */
2445 0x0c, 0x00, /* 0000110000 */
2446 0x0c, 0x00, /* 0000110000 */
2447 0x0c, 0x00, /* 0000110000 */
2448 0x18, 0x00, /* 0001100000 */
2449 0x78, 0x00, /* 0111100000 */
2450 0x70, 0x00, /* 0111000000 */
2451
2452 /* 122 0x7a 'z' */
2453 0x00, 0x00, /* 0000000000 */
2454 0x00, 0x00, /* 0000000000 */
2455 0x00, 0x00, /* 0000000000 */
2456 0x00, 0x00, /* 0000000000 */
2457 0x00, 0x00, /* 0000000000 */
2458 0x7f, 0x80, /* 0111111110 */
2459 0x61, 0x80, /* 0110000110 */
2460 0x43, 0x00, /* 0100001100 */
2461 0x06, 0x00, /* 0000011000 */
2462 0x0c, 0x00, /* 0000110000 */
2463 0x18, 0x00, /* 0001100000 */
2464 0x30, 0x00, /* 0011000000 */
2465 0x60, 0x80, /* 0110000010 */
2466 0x61, 0x80, /* 0110000110 */
2467 0x7f, 0x80, /* 0111111110 */
2468 0x00, 0x00, /* 0000000000 */
2469 0x00, 0x00, /* 0000000000 */
2470 0x00, 0x00, /* 0000000000 */
2471
2472 /* 123 0x7b '{' */
2473 0x07, 0x00, /* 0000011100 */
2474 0x0c, 0x00, /* 0000110000 */
2475 0x0c, 0x00, /* 0000110000 */
2476 0x0c, 0x00, /* 0000110000 */
2477 0x0c, 0x00, /* 0000110000 */
2478 0x0c, 0x00, /* 0000110000 */
2479 0x18, 0x00, /* 0001100000 */
2480 0x70, 0x00, /* 0111000000 */
2481 0x18, 0x00, /* 0001100000 */
2482 0x0c, 0x00, /* 0000110000 */
2483 0x0c, 0x00, /* 0000110000 */
2484 0x0c, 0x00, /* 0000110000 */
2485 0x0c, 0x00, /* 0000110000 */
2486 0x0c, 0x00, /* 0000110000 */
2487 0x07, 0x00, /* 0000011100 */
2488 0x00, 0x00, /* 0000000000 */
2489 0x00, 0x00, /* 0000000000 */
2490 0x00, 0x00, /* 0000000000 */
2491
2492 /* 124 0x7c '|' */
2493 0x0c, 0x00, /* 0000110000 */
2494 0x0c, 0x00, /* 0000110000 */
2495 0x0c, 0x00, /* 0000110000 */
2496 0x0c, 0x00, /* 0000110000 */
2497 0x0c, 0x00, /* 0000110000 */
2498 0x0c, 0x00, /* 0000110000 */
2499 0x0c, 0x00, /* 0000110000 */
2500 0x0c, 0x00, /* 0000110000 */
2501 0x0c, 0x00, /* 0000110000 */
2502 0x0c, 0x00, /* 0000110000 */
2503 0x0c, 0x00, /* 0000110000 */
2504 0x0c, 0x00, /* 0000110000 */
2505 0x0c, 0x00, /* 0000110000 */
2506 0x0c, 0x00, /* 0000110000 */
2507 0x0c, 0x00, /* 0000110000 */
2508 0x0c, 0x00, /* 0000110000 */
2509 0x0c, 0x00, /* 0000110000 */
2510 0x00, 0x00, /* 0000000000 */
2511
2512 /* 125 0x7d '}' */
2513 0x38, 0x00, /* 0011100000 */
2514 0x0c, 0x00, /* 0000110000 */
2515 0x0c, 0x00, /* 0000110000 */
2516 0x0c, 0x00, /* 0000110000 */
2517 0x0c, 0x00, /* 0000110000 */
2518 0x0c, 0x00, /* 0000110000 */
2519 0x06, 0x00, /* 0000011000 */
2520 0x03, 0x80, /* 0000001110 */
2521 0x06, 0x00, /* 0000011000 */
2522 0x0c, 0x00, /* 0000110000 */
2523 0x0c, 0x00, /* 0000110000 */
2524 0x0c, 0x00, /* 0000110000 */
2525 0x0c, 0x00, /* 0000110000 */
2526 0x0c, 0x00, /* 0000110000 */
2527 0x38, 0x00, /* 0011100000 */
2528 0x00, 0x00, /* 0000000000 */
2529 0x00, 0x00, /* 0000000000 */
2530 0x00, 0x00, /* 0000000000 */
2531
2532 /* 126 0x7e '~' */
2533 0x00, 0x00, /* 0000000000 */
2534 0x18, 0x80, /* 0001100010 */
2535 0x3d, 0x80, /* 0011110110 */
2536 0x6f, 0x00, /* 0110111100 */
2537 0x46, 0x00, /* 0100011000 */
2538 0x00, 0x00, /* 0000000000 */
2539 0x00, 0x00, /* 0000000000 */
2540 0x00, 0x00, /* 0000000000 */
2541 0x00, 0x00, /* 0000000000 */
2542 0x00, 0x00, /* 0000000000 */
2543 0x00, 0x00, /* 0000000000 */
2544 0x00, 0x00, /* 0000000000 */
2545 0x00, 0x00, /* 0000000000 */
2546 0x00, 0x00, /* 0000000000 */
2547 0x00, 0x00, /* 0000000000 */
2548 0x00, 0x00, /* 0000000000 */
2549 0x00, 0x00, /* 0000000000 */
2550 0x00, 0x00, /* 0000000000 */
2551
2552 /* 127 0x7f '.' */
2553 0x00, 0x00, /* 0000000000 */
2554 0x00, 0x00, /* 0000000000 */
2555 0x00, 0x00, /* 0000000000 */
2556 0x00, 0x00, /* 0000000000 */
2557 0x00, 0x00, /* 0000000000 */
2558 0x00, 0x00, /* 0000000000 */
2559 0x00, 0x00, /* 0000000000 */
2560 0x00, 0x00, /* 0000000000 */
2561 0x0c, 0x00, /* 0000110000 */
2562 0x12, 0x00, /* 0001001000 */
2563 0x21, 0x00, /* 0010000100 */
2564 0x40, 0x80, /* 0100000010 */
2565 0x40, 0x80, /* 0100000010 */
2566 0x40, 0x80, /* 0100000010 */
2567 0x7f, 0x80, /* 0111111110 */
2568 0x00, 0x00, /* 0000000000 */
2569 0x00, 0x00, /* 0000000000 */
2570 0x00, 0x00, /* 0000000000 */
2571
2572 /* 128 0x80 '.' */
2573 0x00, 0x00, /* 0000000000 */
2574 0x1f, 0x00, /* 0001111100 */
2575 0x21, 0x80, /* 0010000110 */
2576 0x40, 0x80, /* 0100000010 */
2577 0x40, 0x00, /* 0100000000 */
2578 0x40, 0x00, /* 0100000000 */
2579 0x40, 0x00, /* 0100000000 */
2580 0x40, 0x00, /* 0100000000 */
2581 0x40, 0x00, /* 0100000000 */
2582 0x40, 0x00, /* 0100000000 */
2583 0x60, 0x80, /* 0110000010 */
2584 0x31, 0x00, /* 0011000100 */
2585 0x1e, 0x00, /* 0001111000 */
2586 0x08, 0x00, /* 0000100000 */
2587 0x04, 0x00, /* 0000010000 */
2588 0x02, 0x00, /* 0000001000 */
2589 0x02, 0x00, /* 0000001000 */
2590 0x1c, 0x00, /* 0001110000 */
2591
2592 /* 129 0x81 '.' */
2593 0x00, 0x00, /* 0000000000 */
2594 0x1b, 0x00, /* 0001101100 */
2595 0x1b, 0x00, /* 0001101100 */
2596 0x00, 0x00, /* 0000000000 */
2597 0x00, 0x00, /* 0000000000 */
2598 0x7b, 0x80, /* 0111101110 */
2599 0x31, 0x00, /* 0011000100 */
2600 0x31, 0x00, /* 0011000100 */
2601 0x31, 0x00, /* 0011000100 */
2602 0x31, 0x00, /* 0011000100 */
2603 0x31, 0x00, /* 0011000100 */
2604 0x31, 0x00, /* 0011000100 */
2605 0x31, 0x00, /* 0011000100 */
2606 0x3b, 0x00, /* 0011101100 */
2607 0x1c, 0x80, /* 0001110010 */
2608 0x00, 0x00, /* 0000000000 */
2609 0x00, 0x00, /* 0000000000 */
2610 0x00, 0x00, /* 0000000000 */
2611
2612 /* 130 0x82 '.' */
2613 0x00, 0x00, /* 0000000000 */
2614 0x01, 0x00, /* 0000000100 */
2615 0x02, 0x00, /* 0000001000 */
2616 0x04, 0x00, /* 0000010000 */
2617 0x00, 0x00, /* 0000000000 */
2618 0x0c, 0x00, /* 0000110000 */
2619 0x33, 0x00, /* 0011001100 */
2620 0x61, 0x80, /* 0110000110 */
2621 0x61, 0x80, /* 0110000110 */
2622 0x7f, 0x80, /* 0111111110 */
2623 0x60, 0x00, /* 0110000000 */
2624 0x60, 0x00, /* 0110000000 */
2625 0x30, 0x00, /* 0011000000 */
2626 0x19, 0x80, /* 0001100110 */
2627 0x0e, 0x00, /* 0000111000 */
2628 0x00, 0x00, /* 0000000000 */
2629 0x00, 0x00, /* 0000000000 */
2630 0x00, 0x00, /* 0000000000 */
2631
2632 /* 131 0x83 '.' */
2633 0x04, 0x00, /* 0000010000 */
2634 0x0e, 0x00, /* 0000111000 */
2635 0x1b, 0x00, /* 0001101100 */
2636 0x31, 0x80, /* 0011000110 */
2637 0x00, 0x00, /* 0000000000 */
2638 0x1f, 0x00, /* 0001111100 */
2639 0x31, 0x80, /* 0011000110 */
2640 0x21, 0x80, /* 0010000110 */
2641 0x07, 0x80, /* 0000011110 */
2642 0x39, 0x80, /* 0011100110 */
2643 0x61, 0x80, /* 0110000110 */
2644 0x61, 0x80, /* 0110000110 */
2645 0x61, 0x80, /* 0110000110 */
2646 0x73, 0x80, /* 0111001110 */
2647 0x3d, 0xc0, /* 0011110111 */
2648 0x00, 0x00, /* 0000000000 */
2649 0x00, 0x00, /* 0000000000 */
2650 0x00, 0x00, /* 0000000000 */
2651
2652 /* 132 0x84 '.' */
2653 0x00, 0x00, /* 0000000000 */
2654 0x1b, 0x00, /* 0001101100 */
2655 0x1b, 0x00, /* 0001101100 */
2656 0x00, 0x00, /* 0000000000 */
2657 0x00, 0x00, /* 0000000000 */
2658 0x1f, 0x00, /* 0001111100 */
2659 0x31, 0x80, /* 0011000110 */
2660 0x21, 0x80, /* 0010000110 */
2661 0x07, 0x80, /* 0000011110 */
2662 0x39, 0x80, /* 0011100110 */
2663 0x61, 0x80, /* 0110000110 */
2664 0x61, 0x80, /* 0110000110 */
2665 0x61, 0x80, /* 0110000110 */
2666 0x73, 0x80, /* 0111001110 */
2667 0x3d, 0xc0, /* 0011110111 */
2668 0x00, 0x00, /* 0000000000 */
2669 0x00, 0x00, /* 0000000000 */
2670 0x00, 0x00, /* 0000000000 */
2671
2672 /* 133 0x85 '.' */
2673 0x00, 0x00, /* 0000000000 */
2674 0x18, 0x00, /* 0001100000 */
2675 0x0c, 0x00, /* 0000110000 */
2676 0x06, 0x00, /* 0000011000 */
2677 0x00, 0x00, /* 0000000000 */
2678 0x1f, 0x00, /* 0001111100 */
2679 0x31, 0x80, /* 0011000110 */
2680 0x21, 0x80, /* 0010000110 */
2681 0x07, 0x80, /* 0000011110 */
2682 0x39, 0x80, /* 0011100110 */
2683 0x61, 0x80, /* 0110000110 */
2684 0x61, 0x80, /* 0110000110 */
2685 0x61, 0x80, /* 0110000110 */
2686 0x73, 0x80, /* 0111001110 */
2687 0x3d, 0xc0, /* 0011110111 */
2688 0x00, 0x00, /* 0000000000 */
2689 0x00, 0x00, /* 0000000000 */
2690 0x00, 0x00, /* 0000000000 */
2691
2692 /* 134 0x86 '.' */
2693 0x00, 0x00, /* 0000000000 */
2694 0x0e, 0x00, /* 0000111000 */
2695 0x1b, 0x00, /* 0001101100 */
2696 0x0e, 0x00, /* 0000111000 */
2697 0x00, 0x00, /* 0000000000 */
2698 0x1f, 0x00, /* 0001111100 */
2699 0x31, 0x80, /* 0011000110 */
2700 0x21, 0x80, /* 0010000110 */
2701 0x07, 0x80, /* 0000011110 */
2702 0x39, 0x80, /* 0011100110 */
2703 0x61, 0x80, /* 0110000110 */
2704 0x61, 0x80, /* 0110000110 */
2705 0x61, 0x80, /* 0110000110 */
2706 0x73, 0x80, /* 0111001110 */
2707 0x3d, 0xc0, /* 0011110111 */
2708 0x00, 0x00, /* 0000000000 */
2709 0x00, 0x00, /* 0000000000 */
2710 0x00, 0x00, /* 0000000000 */
2711
2712 /* 135 0x87 '.' */
2713 0x00, 0x00, /* 0000000000 */
2714 0x00, 0x00, /* 0000000000 */
2715 0x00, 0x00, /* 0000000000 */
2716 0x00, 0x00, /* 0000000000 */
2717 0x00, 0x00, /* 0000000000 */
2718 0x1f, 0x00, /* 0001111100 */
2719 0x31, 0x80, /* 0011000110 */
2720 0x20, 0x80, /* 0010000010 */
2721 0x60, 0x00, /* 0110000000 */
2722 0x60, 0x00, /* 0110000000 */
2723 0x60, 0x00, /* 0110000000 */
2724 0x70, 0x80, /* 0111000010 */
2725 0x30, 0x80, /* 0011000010 */
2726 0x1f, 0x00, /* 0001111100 */
2727 0x04, 0x00, /* 0000010000 */
2728 0x02, 0x00, /* 0000001000 */
2729 0x01, 0x00, /* 0000000100 */
2730 0x0e, 0x00, /* 0000111000 */
2731
2732 /* 136 0x88 '.' */
2733 0x04, 0x00, /* 0000010000 */
2734 0x0e, 0x00, /* 0000111000 */
2735 0x1b, 0x00, /* 0001101100 */
2736 0x31, 0x80, /* 0011000110 */
2737 0x00, 0x00, /* 0000000000 */
2738 0x0c, 0x00, /* 0000110000 */
2739 0x33, 0x00, /* 0011001100 */
2740 0x61, 0x80, /* 0110000110 */
2741 0x61, 0x80, /* 0110000110 */
2742 0x7f, 0x80, /* 0111111110 */
2743 0x60, 0x00, /* 0110000000 */
2744 0x60, 0x00, /* 0110000000 */
2745 0x30, 0x00, /* 0011000000 */
2746 0x19, 0x80, /* 0001100110 */
2747 0x0e, 0x00, /* 0000111000 */
2748 0x00, 0x00, /* 0000000000 */
2749 0x00, 0x00, /* 0000000000 */
2750 0x00, 0x00, /* 0000000000 */
2751
2752 /* 137 0x89 '.' */
2753 0x00, 0x00, /* 0000000000 */
2754 0x36, 0x00, /* 0011011000 */
2755 0x36, 0x00, /* 0011011000 */
2756 0x00, 0x00, /* 0000000000 */
2757 0x00, 0x00, /* 0000000000 */
2758 0x0c, 0x00, /* 0000110000 */
2759 0x33, 0x00, /* 0011001100 */
2760 0x61, 0x80, /* 0110000110 */
2761 0x61, 0x80, /* 0110000110 */
2762 0x7f, 0x80, /* 0111111110 */
2763 0x60, 0x00, /* 0110000000 */
2764 0x60, 0x00, /* 0110000000 */
2765 0x30, 0x00, /* 0011000000 */
2766 0x19, 0x80, /* 0001100110 */
2767 0x0e, 0x00, /* 0000111000 */
2768 0x00, 0x00, /* 0000000000 */
2769 0x00, 0x00, /* 0000000000 */
2770 0x00, 0x00, /* 0000000000 */
2771
2772 /* 138 0x8a '.' */
2773 0x00, 0x00, /* 0000000000 */
2774 0x30, 0x00, /* 0011000000 */
2775 0x18, 0x00, /* 0001100000 */
2776 0x0c, 0x00, /* 0000110000 */
2777 0x00, 0x00, /* 0000000000 */
2778 0x0c, 0x00, /* 0000110000 */
2779 0x33, 0x00, /* 0011001100 */
2780 0x61, 0x80, /* 0110000110 */
2781 0x61, 0x80, /* 0110000110 */
2782 0x7f, 0x80, /* 0111111110 */
2783 0x60, 0x00, /* 0110000000 */
2784 0x60, 0x00, /* 0110000000 */
2785 0x30, 0x00, /* 0011000000 */
2786 0x19, 0x80, /* 0001100110 */
2787 0x0e, 0x00, /* 0000111000 */
2788 0x00, 0x00, /* 0000000000 */
2789 0x00, 0x00, /* 0000000000 */
2790 0x00, 0x00, /* 0000000000 */
2791
2792 /* 139 0x8b '.' */
2793 0x00, 0x00, /* 0000000000 */
2794 0x36, 0x00, /* 0011011000 */
2795 0x36, 0x00, /* 0011011000 */
2796 0x00, 0x00, /* 0000000000 */
2797 0x00, 0x00, /* 0000000000 */
2798 0x3c, 0x00, /* 0011110000 */
2799 0x0c, 0x00, /* 0000110000 */
2800 0x0c, 0x00, /* 0000110000 */
2801 0x0c, 0x00, /* 0000110000 */
2802 0x0c, 0x00, /* 0000110000 */
2803 0x0c, 0x00, /* 0000110000 */
2804 0x0c, 0x00, /* 0000110000 */
2805 0x0c, 0x00, /* 0000110000 */
2806 0x0c, 0x00, /* 0000110000 */
2807 0x3f, 0x00, /* 0011111100 */
2808 0x00, 0x00, /* 0000000000 */
2809 0x00, 0x00, /* 0000000000 */
2810 0x00, 0x00, /* 0000000000 */
2811
2812 /* 140 0x8c '.' */
2813 0x08, 0x00, /* 0000100000 */
2814 0x1c, 0x00, /* 0001110000 */
2815 0x36, 0x00, /* 0011011000 */
2816 0x63, 0x00, /* 0110001100 */
2817 0x00, 0x00, /* 0000000000 */
2818 0x3c, 0x00, /* 0011110000 */
2819 0x0c, 0x00, /* 0000110000 */
2820 0x0c, 0x00, /* 0000110000 */
2821 0x0c, 0x00, /* 0000110000 */
2822 0x0c, 0x00, /* 0000110000 */
2823 0x0c, 0x00, /* 0000110000 */
2824 0x0c, 0x00, /* 0000110000 */
2825 0x0c, 0x00, /* 0000110000 */
2826 0x0c, 0x00, /* 0000110000 */
2827 0x3f, 0x00, /* 0011111100 */
2828 0x00, 0x00, /* 0000000000 */
2829 0x00, 0x00, /* 0000000000 */
2830 0x00, 0x00, /* 0000000000 */
2831
2832 /* 141 0x8d '.' */
2833 0x00, 0x00, /* 0000000000 */
2834 0x30, 0x00, /* 0011000000 */
2835 0x18, 0x00, /* 0001100000 */
2836 0x0c, 0x00, /* 0000110000 */
2837 0x00, 0x00, /* 0000000000 */
2838 0x3c, 0x00, /* 0011110000 */
2839 0x0c, 0x00, /* 0000110000 */
2840 0x0c, 0x00, /* 0000110000 */
2841 0x0c, 0x00, /* 0000110000 */
2842 0x0c, 0x00, /* 0000110000 */
2843 0x0c, 0x00, /* 0000110000 */
2844 0x0c, 0x00, /* 0000110000 */
2845 0x0c, 0x00, /* 0000110000 */
2846 0x0c, 0x00, /* 0000110000 */
2847 0x3f, 0x00, /* 0011111100 */
2848 0x00, 0x00, /* 0000000000 */
2849 0x00, 0x00, /* 0000000000 */
2850 0x00, 0x00, /* 0000000000 */
2851
2852 /* 142 0x8e '.' */
2853 0x31, 0x80, /* 0011000110 */
2854 0x31, 0x80, /* 0011000110 */
2855 0x04, 0x00, /* 0000010000 */
2856 0x04, 0x00, /* 0000010000 */
2857 0x0e, 0x00, /* 0000111000 */
2858 0x0e, 0x00, /* 0000111000 */
2859 0x0e, 0x00, /* 0000111000 */
2860 0x19, 0x00, /* 0001100100 */
2861 0x19, 0x00, /* 0001100100 */
2862 0x3f, 0x00, /* 0011111100 */
2863 0x31, 0x00, /* 0011000100 */
2864 0x31, 0x00, /* 0011000100 */
2865 0x60, 0x80, /* 0110000010 */
2866 0x60, 0x80, /* 0110000010 */
2867 0xf3, 0xc0, /* 1111001111 */
2868 0x00, 0x00, /* 0000000000 */
2869 0x00, 0x00, /* 0000000000 */
2870 0x00, 0x00, /* 0000000000 */
2871
2872 /* 143 0x8f '.' */
2873 0x04, 0x00, /* 0000010000 */
2874 0x0a, 0x00, /* 0000101000 */
2875 0x0a, 0x00, /* 0000101000 */
2876 0x04, 0x00, /* 0000010000 */
2877 0x0e, 0x00, /* 0000111000 */
2878 0x0e, 0x00, /* 0000111000 */
2879 0x0e, 0x00, /* 0000111000 */
2880 0x19, 0x00, /* 0001100100 */
2881 0x19, 0x00, /* 0001100100 */
2882 0x3f, 0x00, /* 0011111100 */
2883 0x31, 0x00, /* 0011000100 */
2884 0x31, 0x00, /* 0011000100 */
2885 0x60, 0x80, /* 0110000010 */
2886 0x60, 0x80, /* 0110000010 */
2887 0xf3, 0xc0, /* 1111001111 */
2888 0x00, 0x00, /* 0000000000 */
2889 0x00, 0x00, /* 0000000000 */
2890 0x00, 0x00, /* 0000000000 */
2891
2892 /* 144 0x90 '.' */
2893 0x03, 0x00, /* 0000001100 */
2894 0x06, 0x00, /* 0000011000 */
2895 0x0c, 0x00, /* 0000110000 */
2896 0x7f, 0x80, /* 0111111110 */
2897 0x30, 0x80, /* 0011000010 */
2898 0x30, 0x80, /* 0011000010 */
2899 0x30, 0x00, /* 0011000000 */
2900 0x31, 0x00, /* 0011000100 */
2901 0x3f, 0x00, /* 0011111100 */
2902 0x31, 0x00, /* 0011000100 */
2903 0x30, 0x00, /* 0011000000 */
2904 0x30, 0x00, /* 0011000000 */
2905 0x30, 0x80, /* 0011000010 */
2906 0x30, 0x80, /* 0011000010 */
2907 0x7f, 0x80, /* 0111111110 */
2908 0x00, 0x00, /* 0000000000 */
2909 0x00, 0x00, /* 0000000000 */
2910 0x00, 0x00, /* 0000000000 */
2911
2912 /* 145 0x91 '.' */
2913 0x00, 0x00, /* 0000000000 */
2914 0x00, 0x00, /* 0000000000 */
2915 0x00, 0x00, /* 0000000000 */
2916 0x00, 0x00, /* 0000000000 */
2917 0x00, 0x00, /* 0000000000 */
2918 0x3b, 0x80, /* 0011101110 */
2919 0x6c, 0xc0, /* 0110110011 */
2920 0x4c, 0xc0, /* 0100110011 */
2921 0x0c, 0xc0, /* 0000110011 */
2922 0x3f, 0xc0, /* 0011111111 */
2923 0x6c, 0x00, /* 0110110000 */
2924 0xcc, 0x00, /* 1100110000 */
2925 0xcc, 0x00, /* 1100110000 */
2926 0xee, 0xc0, /* 1110111011 */
2927 0x7b, 0x80, /* 0111101110 */
2928 0x00, 0x00, /* 0000000000 */
2929 0x00, 0x00, /* 0000000000 */
2930 0x00, 0x00, /* 0000000000 */
2931
2932 /* 146 0x92 '.' */
2933 0x00, 0x00, /* 0000000000 */
2934 0x07, 0xc0, /* 0000011111 */
2935 0x0e, 0x40, /* 0000111001 */
2936 0x0e, 0x40, /* 0000111001 */
2937 0x0e, 0x00, /* 0000111000 */
2938 0x16, 0x00, /* 0001011000 */
2939 0x16, 0x80, /* 0001011010 */
2940 0x17, 0x80, /* 0001011110 */
2941 0x16, 0x80, /* 0001011010 */
2942 0x3e, 0x00, /* 0011111000 */
2943 0x26, 0x00, /* 0010011000 */
2944 0x26, 0x00, /* 0010011000 */
2945 0x46, 0x40, /* 0100011001 */
2946 0x46, 0x40, /* 0100011001 */
2947 0xef, 0xc0, /* 1110111111 */
2948 0x00, 0x00, /* 0000000000 */
2949 0x00, 0x00, /* 0000000000 */
2950 0x00, 0x00, /* 0000000000 */
2951
2952 /* 147 0x93 '.' */
2953 0x00, 0x00, /* 0000000000 */
2954 0x08, 0x00, /* 0000100000 */
2955 0x1c, 0x00, /* 0001110000 */
2956 0x36, 0x00, /* 0011011000 */
2957 0x00, 0x00, /* 0000000000 */
2958 0x3c, 0x00, /* 0011110000 */
2959 0x66, 0x00, /* 0110011000 */
2960 0xc3, 0x00, /* 1100001100 */
2961 0xc1, 0x80, /* 1100000110 */
2962 0xc1, 0x80, /* 1100000110 */
2963 0xc1, 0x80, /* 1100000110 */
2964 0xc1, 0x80, /* 1100000110 */
2965 0xe1, 0x80, /* 1110000110 */
2966 0x73, 0x00, /* 0111001100 */
2967 0x3c, 0x00, /* 0011110000 */
2968 0x00, 0x00, /* 0000000000 */
2969 0x00, 0x00, /* 0000000000 */
2970 0x00, 0x00, /* 0000000000 */
2971
2972 /* 148 0x94 '.' */
2973 0x00, 0x00, /* 0000000000 */
2974 0x00, 0x00, /* 0000000000 */
2975 0x33, 0x00, /* 0011001100 */
2976 0x33, 0x00, /* 0011001100 */
2977 0x00, 0x00, /* 0000000000 */
2978 0x3c, 0x00, /* 0011110000 */
2979 0x66, 0x00, /* 0110011000 */
2980 0xc3, 0x00, /* 1100001100 */
2981 0xc1, 0x80, /* 1100000110 */
2982 0xc1, 0x80, /* 1100000110 */
2983 0xc1, 0x80, /* 1100000110 */
2984 0xc1, 0x80, /* 1100000110 */
2985 0xe1, 0x80, /* 1110000110 */
2986 0x73, 0x00, /* 0111001100 */
2987 0x3c, 0x00, /* 0011110000 */
2988 0x00, 0x00, /* 0000000000 */
2989 0x00, 0x00, /* 0000000000 */
2990 0x00, 0x00, /* 0000000000 */
2991
2992 /* 149 0x95 '.' */
2993 0x00, 0x00, /* 0000000000 */
2994 0x18, 0x00, /* 0001100000 */
2995 0x0c, 0x00, /* 0000110000 */
2996 0x06, 0x00, /* 0000011000 */
2997 0x00, 0x00, /* 0000000000 */
2998 0x3c, 0x00, /* 0011110000 */
2999 0x66, 0x00, /* 0110011000 */
3000 0xc3, 0x00, /* 1100001100 */
3001 0xc1, 0x80, /* 1100000110 */
3002 0xc1, 0x80, /* 1100000110 */
3003 0xc1, 0x80, /* 1100000110 */
3004 0xc1, 0x80, /* 1100000110 */
3005 0xe1, 0x80, /* 1110000110 */
3006 0x73, 0x00, /* 0111001100 */
3007 0x3c, 0x00, /* 0011110000 */
3008 0x00, 0x00, /* 0000000000 */
3009 0x00, 0x00, /* 0000000000 */
3010 0x00, 0x00, /* 0000000000 */
3011
3012 /* 150 0x96 '.' */
3013 0x08, 0x00, /* 0000100000 */
3014 0x1c, 0x00, /* 0001110000 */
3015 0x36, 0x00, /* 0011011000 */
3016 0x63, 0x00, /* 0110001100 */
3017 0x00, 0x00, /* 0000000000 */
3018 0xf7, 0x80, /* 1111011110 */
3019 0x63, 0x00, /* 0110001100 */
3020 0x63, 0x00, /* 0110001100 */
3021 0x63, 0x00, /* 0110001100 */
3022 0x63, 0x00, /* 0110001100 */
3023 0x63, 0x00, /* 0110001100 */
3024 0x63, 0x00, /* 0110001100 */
3025 0x63, 0x00, /* 0110001100 */
3026 0x77, 0x00, /* 0111011100 */
3027 0x3d, 0x80, /* 0011110110 */
3028 0x00, 0x00, /* 0000000000 */
3029 0x00, 0x00, /* 0000000000 */
3030 0x00, 0x00, /* 0000000000 */
3031
3032 /* 151 0x97 '.' */
3033 0x00, 0x00, /* 0000000000 */
3034 0x60, 0x00, /* 0110000000 */
3035 0x30, 0x00, /* 0011000000 */
3036 0x18, 0x00, /* 0001100000 */
3037 0x00, 0x00, /* 0000000000 */
3038 0xf7, 0x80, /* 1111011110 */
3039 0x63, 0x00, /* 0110001100 */
3040 0x63, 0x00, /* 0110001100 */
3041 0x63, 0x00, /* 0110001100 */
3042 0x63, 0x00, /* 0110001100 */
3043 0x63, 0x00, /* 0110001100 */
3044 0x63, 0x00, /* 0110001100 */
3045 0x63, 0x00, /* 0110001100 */
3046 0x77, 0x00, /* 0111011100 */
3047 0x3d, 0x80, /* 0011110110 */
3048 0x00, 0x00, /* 0000000000 */
3049 0x00, 0x00, /* 0000000000 */
3050 0x00, 0x00, /* 0000000000 */
3051
3052 /* 152 0x98 '.' */
3053 0x00, 0x00, /* 0000000000 */
3054 0x33, 0x00, /* 0011001100 */
3055 0x33, 0x00, /* 0011001100 */
3056 0x00, 0x00, /* 0000000000 */
3057 0x00, 0x00, /* 0000000000 */
3058 0xf3, 0xc0, /* 1111001111 */
3059 0x61, 0x80, /* 0110000110 */
3060 0x33, 0x00, /* 0011001100 */
3061 0x1b, 0x00, /* 0001101100 */
3062 0x1e, 0x00, /* 0001111000 */
3063 0x0e, 0x00, /* 0000111000 */
3064 0x0c, 0x00, /* 0000110000 */
3065 0x0c, 0x00, /* 0000110000 */
3066 0x0c, 0x00, /* 0000110000 */
3067 0x0c, 0x00, /* 0000110000 */
3068 0x18, 0x00, /* 0001100000 */
3069 0x78, 0x00, /* 0111100000 */
3070 0x70, 0x00, /* 0111000000 */
3071
3072 /* 153 0x99 '.' */
3073 0x61, 0x80, /* 0110000110 */
3074 0x61, 0x80, /* 0110000110 */
3075 0x0c, 0x00, /* 0000110000 */
3076 0x17, 0x00, /* 0001011100 */
3077 0x23, 0x00, /* 0010001100 */
3078 0x21, 0x80, /* 0010000110 */
3079 0x61, 0x80, /* 0110000110 */
3080 0x61, 0x80, /* 0110000110 */
3081 0x61, 0x80, /* 0110000110 */
3082 0x61, 0x80, /* 0110000110 */
3083 0x61, 0x80, /* 0110000110 */
3084 0x21, 0x00, /* 0010000100 */
3085 0x31, 0x00, /* 0011000100 */
3086 0x1a, 0x00, /* 0001101000 */
3087 0x0c, 0x00, /* 0000110000 */
3088 0x00, 0x00, /* 0000000000 */
3089 0x00, 0x00, /* 0000000000 */
3090 0x00, 0x00, /* 0000000000 */
3091
3092 /* 154 0x9a '.' */
3093 0x33, 0x00, /* 0011001100 */
3094 0x33, 0x00, /* 0011001100 */
3095 0x00, 0x00, /* 0000000000 */
3096 0xf1, 0xc0, /* 1111000111 */
3097 0x60, 0x80, /* 0110000010 */
3098 0x60, 0x80, /* 0110000010 */
3099 0x60, 0x80, /* 0110000010 */
3100 0x60, 0x80, /* 0110000010 */
3101 0x60, 0x80, /* 0110000010 */
3102 0x60, 0x80, /* 0110000010 */
3103 0x60, 0x80, /* 0110000010 */
3104 0x60, 0x80, /* 0110000010 */
3105 0x71, 0x00, /* 0111000100 */
3106 0x3f, 0x00, /* 0011111100 */
3107 0x1e, 0x00, /* 0001111000 */
3108 0x00, 0x00, /* 0000000000 */
3109 0x00, 0x00, /* 0000000000 */
3110 0x00, 0x00, /* 0000000000 */
3111
3112 /* 155 0x9b '.' */
3113 0x00, 0x00, /* 0000000000 */
3114 0x00, 0x00, /* 0000000000 */
3115 0x00, 0x00, /* 0000000000 */
3116 0x06, 0x00, /* 0000011000 */
3117 0x06, 0x00, /* 0000011000 */
3118 0x1f, 0x80, /* 0001111110 */
3119 0x36, 0x80, /* 0011011010 */
3120 0x26, 0x00, /* 0010011000 */
3121 0x66, 0x00, /* 0110011000 */
3122 0x66, 0x00, /* 0110011000 */
3123 0x66, 0x00, /* 0110011000 */
3124 0x66, 0x00, /* 0110011000 */
3125 0x76, 0x00, /* 0111011000 */
3126 0x36, 0x80, /* 0011011010 */
3127 0x1f, 0x80, /* 0001111110 */
3128 0x06, 0x00, /* 0000011000 */
3129 0x06, 0x00, /* 0000011000 */
3130 0x00, 0x00, /* 0000000000 */
3131
3132 /* 156 0x9c '.' */
3133 0x00, 0x00, /* 0000000000 */
3134 0x1e, 0x00, /* 0001111000 */
3135 0x3b, 0x00, /* 0011101100 */
3136 0x33, 0x00, /* 0011001100 */
3137 0x30, 0x00, /* 0011000000 */
3138 0x30, 0x00, /* 0011000000 */
3139 0x30, 0x00, /* 0011000000 */
3140 0x7e, 0x00, /* 0111111000 */
3141 0x7e, 0x00, /* 0111111000 */
3142 0x30, 0x00, /* 0011000000 */
3143 0x30, 0x00, /* 0011000000 */
3144 0x30, 0x00, /* 0011000000 */
3145 0x30, 0x00, /* 0011000000 */
3146 0x7c, 0x80, /* 0111110010 */
3147 0x7f, 0x80, /* 0111111110 */
3148 0x43, 0x00, /* 0100001100 */
3149 0x00, 0x00, /* 0000000000 */
3150 0x00, 0x00, /* 0000000000 */
3151
3152 /* 157 0x9d '.' */
3153 0x00, 0x00, /* 0000000000 */
3154 0x40, 0x80, /* 0100000010 */
3155 0x40, 0x80, /* 0100000010 */
3156 0x21, 0x00, /* 0010000100 */
3157 0x33, 0x00, /* 0011001100 */
3158 0x33, 0x00, /* 0011001100 */
3159 0x1e, 0x00, /* 0001111000 */
3160 0x0c, 0x00, /* 0000110000 */
3161 0x3f, 0x00, /* 0011111100 */
3162 0x0c, 0x00, /* 0000110000 */
3163 0x3f, 0x00, /* 0011111100 */
3164 0x0c, 0x00, /* 0000110000 */
3165 0x0c, 0x00, /* 0000110000 */
3166 0x0c, 0x00, /* 0000110000 */
3167 0x0c, 0x00, /* 0000110000 */
3168 0x00, 0x00, /* 0000000000 */
3169 0x00, 0x00, /* 0000000000 */
3170 0x00, 0x00, /* 0000000000 */
3171
3172 /* 158 0x9e '.' */
3173 0x00, 0x00, /* 0000000000 */
3174 0xbf, 0x00, /* 1011111100 */
3175 0x40, 0x80, /* 0100000010 */
3176 0x40, 0x80, /* 0100000010 */
3177 0x7f, 0x00, /* 0111111100 */
3178 0x40, 0x00, /* 0100000000 */
3179 0x48, 0x00, /* 0100100000 */
3180 0x48, 0x00, /* 0100100000 */
3181 0x5e, 0x00, /* 0101111000 */
3182 0x48, 0x00, /* 0100100000 */
3183 0x48, 0x00, /* 0100100000 */
3184 0x48, 0x00, /* 0100100000 */
3185 0x48, 0x80, /* 0100100010 */
3186 0x47, 0x00, /* 0100011100 */
3187 0xe0, 0x00, /* 1110000000 */
3188 0x00, 0x00, /* 0000000000 */
3189 0x00, 0x00, /* 0000000000 */
3190 0x00, 0x00, /* 0000000000 */
3191
3192 /* 159 0x9f '.' */
3193 0x00, 0x00, /* 0000000000 */
3194 0x03, 0x00, /* 0000001100 */
3195 0x04, 0x80, /* 0000010010 */
3196 0x08, 0x00, /* 0000100000 */
3197 0x08, 0x00, /* 0000100000 */
3198 0x08, 0x00, /* 0000100000 */
3199 0x08, 0x00, /* 0000100000 */
3200 0x09, 0x00, /* 0000100100 */
3201 0x3e, 0x00, /* 0011111000 */
3202 0x48, 0x00, /* 0100100000 */
3203 0x08, 0x00, /* 0000100000 */
3204 0x08, 0x00, /* 0000100000 */
3205 0x08, 0x00, /* 0000100000 */
3206 0x08, 0x00, /* 0000100000 */
3207 0x08, 0x00, /* 0000100000 */
3208 0x90, 0x00, /* 1001000000 */
3209 0x60, 0x00, /* 0110000000 */
3210 0x00, 0x00, /* 0000000000 */
3211
3212 /* 160 0xa0 '.' */
3213 0x00, 0x00, /* 0000000000 */
3214 0x03, 0x00, /* 0000001100 */
3215 0x06, 0x00, /* 0000011000 */
3216 0x0c, 0x00, /* 0000110000 */
3217 0x00, 0x00, /* 0000000000 */
3218 0x1f, 0x00, /* 0001111100 */
3219 0x31, 0x80, /* 0011000110 */
3220 0x21, 0x80, /* 0010000110 */
3221 0x07, 0x80, /* 0000011110 */
3222 0x39, 0x80, /* 0011100110 */
3223 0x61, 0x80, /* 0110000110 */
3224 0x61, 0x80, /* 0110000110 */
3225 0x61, 0x80, /* 0110000110 */
3226 0x73, 0x80, /* 0111001110 */
3227 0x3d, 0xc0, /* 0011110111 */
3228 0x00, 0x00, /* 0000000000 */
3229 0x00, 0x00, /* 0000000000 */
3230 0x00, 0x00, /* 0000000000 */
3231
3232 /* 161 0xa1 '.' */
3233 0x00, 0x00, /* 0000000000 */
3234 0x03, 0x00, /* 0000001100 */
3235 0x06, 0x00, /* 0000011000 */
3236 0x0c, 0x00, /* 0000110000 */
3237 0x00, 0x00, /* 0000000000 */
3238 0x3c, 0x00, /* 0011110000 */
3239 0x0c, 0x00, /* 0000110000 */
3240 0x0c, 0x00, /* 0000110000 */
3241 0x0c, 0x00, /* 0000110000 */
3242 0x0c, 0x00, /* 0000110000 */
3243 0x0c, 0x00, /* 0000110000 */
3244 0x0c, 0x00, /* 0000110000 */
3245 0x0c, 0x00, /* 0000110000 */
3246 0x0c, 0x00, /* 0000110000 */
3247 0x3f, 0x00, /* 0011111100 */
3248 0x00, 0x00, /* 0000000000 */
3249 0x00, 0x00, /* 0000000000 */
3250 0x00, 0x00, /* 0000000000 */
3251
3252 /* 162 0xa2 '.' */
3253 0x00, 0x00, /* 0000000000 */
3254 0x06, 0x00, /* 0000011000 */
3255 0x0c, 0x00, /* 0000110000 */
3256 0x18, 0x00, /* 0001100000 */
3257 0x00, 0x00, /* 0000000000 */
3258 0x3c, 0x00, /* 0011110000 */
3259 0x66, 0x00, /* 0110011000 */
3260 0xc3, 0x00, /* 1100001100 */
3261 0xc1, 0x80, /* 1100000110 */
3262 0xc1, 0x80, /* 1100000110 */
3263 0xc1, 0x80, /* 1100000110 */
3264 0xc1, 0x80, /* 1100000110 */
3265 0xe1, 0x80, /* 1110000110 */
3266 0x73, 0x00, /* 0111001100 */
3267 0x3c, 0x00, /* 0011110000 */
3268 0x00, 0x00, /* 0000000000 */
3269 0x00, 0x00, /* 0000000000 */
3270 0x00, 0x00, /* 0000000000 */
3271
3272 /* 163 0xa3 '.' */
3273 0x00, 0x00, /* 0000000000 */
3274 0x06, 0x00, /* 0000011000 */
3275 0x0c, 0x00, /* 0000110000 */
3276 0x18, 0x00, /* 0001100000 */
3277 0x00, 0x00, /* 0000000000 */
3278 0xf7, 0x80, /* 1111011110 */
3279 0x63, 0x00, /* 0110001100 */
3280 0x63, 0x00, /* 0110001100 */
3281 0x63, 0x00, /* 0110001100 */
3282 0x63, 0x00, /* 0110001100 */
3283 0x63, 0x00, /* 0110001100 */
3284 0x63, 0x00, /* 0110001100 */
3285 0x63, 0x00, /* 0110001100 */
3286 0x77, 0x00, /* 0111011100 */
3287 0x3d, 0x80, /* 0011110110 */
3288 0x00, 0x00, /* 0000000000 */
3289 0x00, 0x00, /* 0000000000 */
3290 0x00, 0x00, /* 0000000000 */
3291
3292 /* 164 0xa4 '.' */
3293 0x00, 0x00, /* 0000000000 */
3294 0x38, 0x80, /* 0011100010 */
3295 0x7f, 0x80, /* 0111111110 */
3296 0x47, 0x00, /* 0100011100 */
3297 0x00, 0x00, /* 0000000000 */
3298 0x6f, 0x00, /* 0110111100 */
3299 0x7b, 0x80, /* 0111101110 */
3300 0x31, 0x80, /* 0011000110 */
3301 0x31, 0x80, /* 0011000110 */
3302 0x31, 0x80, /* 0011000110 */
3303 0x31, 0x80, /* 0011000110 */
3304 0x31, 0x80, /* 0011000110 */
3305 0x31, 0x80, /* 0011000110 */
3306 0x31, 0x80, /* 0011000110 */
3307 0x7b, 0xc0, /* 0111101111 */
3308 0x00, 0x00, /* 0000000000 */
3309 0x00, 0x00, /* 0000000000 */
3310 0x00, 0x00, /* 0000000000 */
3311
3312 /* 165 0xa5 '.' */
3313 0x00, 0x00, /* 0000000000 */
3314 0x38, 0x80, /* 0011100010 */
3315 0x7f, 0x80, /* 0111111110 */
3316 0x47, 0x00, /* 0100011100 */
3317 0x00, 0x00, /* 0000000000 */
3318 0xe3, 0xc0, /* 1110001111 */
3319 0x71, 0x80, /* 0111000110 */
3320 0x79, 0x80, /* 0111100110 */
3321 0x79, 0x80, /* 0111100110 */
3322 0x6d, 0x80, /* 0110110110 */
3323 0x6d, 0x80, /* 0110110110 */
3324 0x67, 0x80, /* 0110011110 */
3325 0x63, 0x80, /* 0110001110 */
3326 0x61, 0x80, /* 0110000110 */
3327 0xf0, 0xc0, /* 1111000011 */
3328 0x00, 0x00, /* 0000000000 */
3329 0x00, 0x00, /* 0000000000 */
3330 0x00, 0x00, /* 0000000000 */
3331
3332 /* 166 0xa6 '.' */
3333 0x00, 0x00, /* 0000000000 */
3334 0x3e, 0x00, /* 0011111000 */
3335 0x63, 0x00, /* 0110001100 */
3336 0x03, 0x00, /* 0000001100 */
3337 0x0f, 0x00, /* 0000111100 */
3338 0x33, 0x00, /* 0011001100 */
3339 0x63, 0x00, /* 0110001100 */
3340 0x63, 0x00, /* 0110001100 */
3341 0x67, 0x00, /* 0110011100 */
3342 0x3b, 0x80, /* 0011101110 */
3343 0x00, 0x00, /* 0000000000 */
3344 0x7f, 0x80, /* 0111111110 */
3345 0x00, 0x00, /* 0000000000 */
3346 0x00, 0x00, /* 0000000000 */
3347 0x00, 0x00, /* 0000000000 */
3348 0x00, 0x00, /* 0000000000 */
3349 0x00, 0x00, /* 0000000000 */
3350 0x00, 0x00, /* 0000000000 */
3351
3352 /* 167 0xa7 '.' */
3353 0x00, 0x00, /* 0000000000 */
3354 0x0e, 0x00, /* 0000111000 */
3355 0x33, 0x00, /* 0011001100 */
3356 0x21, 0x80, /* 0010000110 */
3357 0x61, 0x80, /* 0110000110 */
3358 0x61, 0x80, /* 0110000110 */
3359 0x61, 0x80, /* 0110000110 */
3360 0x61, 0x00, /* 0110000100 */
3361 0x33, 0x00, /* 0011001100 */
3362 0x1c, 0x00, /* 0001110000 */
3363 0x00, 0x00, /* 0000000000 */
3364 0x7f, 0x80, /* 0111111110 */
3365 0x00, 0x00, /* 0000000000 */
3366 0x00, 0x00, /* 0000000000 */
3367 0x00, 0x00, /* 0000000000 */
3368 0x00, 0x00, /* 0000000000 */
3369 0x00, 0x00, /* 0000000000 */
3370 0x00, 0x00, /* 0000000000 */
3371
3372 /* 168 0xa8 '.' */
3373 0x00, 0x00, /* 0000000000 */
3374 0x06, 0x00, /* 0000011000 */
3375 0x06, 0x00, /* 0000011000 */
3376 0x00, 0x00, /* 0000000000 */
3377 0x06, 0x00, /* 0000011000 */
3378 0x06, 0x00, /* 0000011000 */
3379 0x0c, 0x00, /* 0000110000 */
3380 0x18, 0x00, /* 0001100000 */
3381 0x30, 0x00, /* 0011000000 */
3382 0x60, 0x00, /* 0110000000 */
3383 0x60, 0x00, /* 0110000000 */
3384 0x60, 0x80, /* 0110000010 */
3385 0x73, 0x80, /* 0111001110 */
3386 0x3f, 0x00, /* 0011111100 */
3387 0x1e, 0x00, /* 0001111000 */
3388 0x00, 0x00, /* 0000000000 */
3389 0x00, 0x00, /* 0000000000 */
3390 0x00, 0x00, /* 0000000000 */
3391
3392 /* 169 0xa9 '.' */
3393 0x00, 0x00, /* 0000000000 */
3394 0x00, 0x00, /* 0000000000 */
3395 0x00, 0x00, /* 0000000000 */
3396 0x00, 0x00, /* 0000000000 */
3397 0x00, 0x00, /* 0000000000 */
3398 0x00, 0x00, /* 0000000000 */
3399 0x00, 0x00, /* 0000000000 */
3400 0x00, 0x00, /* 0000000000 */
3401 0x7f, 0x80, /* 0111111110 */
3402 0x7f, 0x80, /* 0111111110 */
3403 0x60, 0x00, /* 0110000000 */
3404 0x60, 0x00, /* 0110000000 */
3405 0x60, 0x00, /* 0110000000 */
3406 0x00, 0x00, /* 0000000000 */
3407 0x00, 0x00, /* 0000000000 */
3408 0x00, 0x00, /* 0000000000 */
3409 0x00, 0x00, /* 0000000000 */
3410 0x00, 0x00, /* 0000000000 */
3411
3412 /* 170 0xaa '.' */
3413 0x00, 0x00, /* 0000000000 */
3414 0x00, 0x00, /* 0000000000 */
3415 0x00, 0x00, /* 0000000000 */
3416 0x00, 0x00, /* 0000000000 */
3417 0x00, 0x00, /* 0000000000 */
3418 0x00, 0x00, /* 0000000000 */
3419 0x00, 0x00, /* 0000000000 */
3420 0x00, 0x00, /* 0000000000 */
3421 0x7f, 0x80, /* 0111111110 */
3422 0x7f, 0x80, /* 0111111110 */
3423 0x01, 0x80, /* 0000000110 */
3424 0x01, 0x80, /* 0000000110 */
3425 0x01, 0x80, /* 0000000110 */
3426 0x00, 0x00, /* 0000000000 */
3427 0x00, 0x00, /* 0000000000 */
3428 0x00, 0x00, /* 0000000000 */
3429 0x00, 0x00, /* 0000000000 */
3430 0x00, 0x00, /* 0000000000 */
3431
3432 /* 171 0xab '.' */
3433 0x00, 0x00, /* 0000000000 */
3434 0x20, 0x00, /* 0010000000 */
3435 0x60, 0x00, /* 0110000000 */
3436 0x20, 0x00, /* 0010000000 */
3437 0x20, 0x80, /* 0010000010 */
3438 0x21, 0x00, /* 0010000100 */
3439 0x22, 0x00, /* 0010001000 */
3440 0x74, 0x00, /* 0111010000 */
3441 0x08, 0x00, /* 0000100000 */
3442 0x17, 0x00, /* 0001011100 */
3443 0x28, 0x80, /* 0010100010 */
3444 0x43, 0x00, /* 0100001100 */
3445 0x04, 0x00, /* 0000010000 */
3446 0x08, 0x00, /* 0000100000 */
3447 0x0f, 0x80, /* 0000111110 */
3448 0x00, 0x00, /* 0000000000 */
3449 0x00, 0x00, /* 0000000000 */
3450 0x00, 0x00, /* 0000000000 */
3451
3452 /* 172 0xac '.' */
3453 0x00, 0x00, /* 0000000000 */
3454 0x20, 0x00, /* 0010000000 */
3455 0x60, 0x00, /* 0110000000 */
3456 0x20, 0x00, /* 0010000000 */
3457 0x20, 0x80, /* 0010000010 */
3458 0x21, 0x00, /* 0010000100 */
3459 0x22, 0x00, /* 0010001000 */
3460 0x74, 0x00, /* 0111010000 */
3461 0x09, 0x00, /* 0000100100 */
3462 0x13, 0x00, /* 0001001100 */
3463 0x25, 0x00, /* 0010010100 */
3464 0x49, 0x00, /* 0100100100 */
3465 0x1f, 0x80, /* 0001111110 */
3466 0x01, 0x00, /* 0000000100 */
3467 0x01, 0x00, /* 0000000100 */
3468 0x00, 0x00, /* 0000000000 */
3469 0x00, 0x00, /* 0000000000 */
3470 0x00, 0x00, /* 0000000000 */
3471
3472 /* 173 0xad '.' */
3473 0x00, 0x00, /* 0000000000 */
3474 0x0c, 0x00, /* 0000110000 */
3475 0x0c, 0x00, /* 0000110000 */
3476 0x00, 0x00, /* 0000000000 */
3477 0x0c, 0x00, /* 0000110000 */
3478 0x0c, 0x00, /* 0000110000 */
3479 0x0c, 0x00, /* 0000110000 */
3480 0x0c, 0x00, /* 0000110000 */
3481 0x0c, 0x00, /* 0000110000 */
3482 0x0c, 0x00, /* 0000110000 */
3483 0x0c, 0x00, /* 0000110000 */
3484 0x0c, 0x00, /* 0000110000 */
3485 0x0c, 0x00, /* 0000110000 */
3486 0x0c, 0x00, /* 0000110000 */
3487 0x0c, 0x00, /* 0000110000 */
3488 0x00, 0x00, /* 0000000000 */
3489 0x00, 0x00, /* 0000000000 */
3490 0x00, 0x00, /* 0000000000 */
3491
3492 /* 174 0xae '.' */
3493 0x00, 0x00, /* 0000000000 */
3494 0x00, 0x00, /* 0000000000 */
3495 0x00, 0x00, /* 0000000000 */
3496 0x00, 0x00, /* 0000000000 */
3497 0x00, 0x00, /* 0000000000 */
3498 0x0d, 0x80, /* 0000110110 */
3499 0x1b, 0x00, /* 0001101100 */
3500 0x36, 0x00, /* 0011011000 */
3501 0x6c, 0x00, /* 0110110000 */
3502 0xd8, 0x00, /* 1101100000 */
3503 0x6c, 0x00, /* 0110110000 */
3504 0x36, 0x00, /* 0011011000 */
3505 0x1b, 0x00, /* 0001101100 */
3506 0x0d, 0x80, /* 0000110110 */
3507 0x00, 0x00, /* 0000000000 */
3508 0x00, 0x00, /* 0000000000 */
3509 0x00, 0x00, /* 0000000000 */
3510 0x00, 0x00, /* 0000000000 */
3511
3512 /* 175 0xaf '.' */
3513 0x00, 0x00, /* 0000000000 */
3514 0x00, 0x00, /* 0000000000 */
3515 0x00, 0x00, /* 0000000000 */
3516 0x00, 0x00, /* 0000000000 */
3517 0x00, 0x00, /* 0000000000 */
3518 0x6c, 0x00, /* 0110110000 */
3519 0x36, 0x00, /* 0011011000 */
3520 0x1b, 0x00, /* 0001101100 */
3521 0x0d, 0x80, /* 0000110110 */
3522 0x06, 0xc0, /* 0000011011 */
3523 0x0d, 0x80, /* 0000110110 */
3524 0x1b, 0x00, /* 0001101100 */
3525 0x36, 0x00, /* 0011011000 */
3526 0x6c, 0x00, /* 0110110000 */
3527 0x00, 0x00, /* 0000000000 */
3528 0x00, 0x00, /* 0000000000 */
3529 0x00, 0x00, /* 0000000000 */
3530 0x00, 0x00, /* 0000000000 */
3531
3532 /* 176 0xb0 '.' */
3533 0xc3, 0x00, /* 1100001100 */
3534 0x41, 0x00, /* 0100000100 */
3535 0x18, 0x40, /* 0001100001 */
3536 0x10, 0x40, /* 0001000001 */
3537 0xc3, 0x00, /* 1100001100 */
3538 0x41, 0x00, /* 0100000100 */
3539 0x18, 0x40, /* 0001100001 */
3540 0x10, 0x40, /* 0001000001 */
3541 0xc3, 0x00, /* 1100001100 */
3542 0x41, 0x00, /* 0100000100 */
3543 0x18, 0x40, /* 0001100001 */
3544 0x10, 0x40, /* 0001000001 */
3545 0xc3, 0x00, /* 1100001100 */
3546 0x41, 0x00, /* 0100000100 */
3547 0x18, 0x40, /* 0001100001 */
3548 0x10, 0x40, /* 0001000001 */
3549 0xc3, 0x00, /* 1100001100 */
3550 0x41, 0x00, /* 0100000100 */
3551
3552 /* 177 0xb1 '.' */
3553 0x11, 0x00, /* 0001000100 */
3554 0xbb, 0x80, /* 1011101110 */
3555 0x11, 0x00, /* 0001000100 */
3556 0x44, 0x40, /* 0100010001 */
3557 0xee, 0xc0, /* 1110111011 */
3558 0x44, 0x40, /* 0100010001 */
3559 0x11, 0x00, /* 0001000100 */
3560 0xbb, 0x80, /* 1011101110 */
3561 0x11, 0x00, /* 0001000100 */
3562 0x44, 0x40, /* 0100010001 */
3563 0xee, 0xc0, /* 1110111011 */
3564 0x44, 0x40, /* 0100010001 */
3565 0x11, 0x00, /* 0001000100 */
3566 0xbb, 0x80, /* 1011101110 */
3567 0x11, 0x00, /* 0001000100 */
3568 0x44, 0x40, /* 0100010001 */
3569 0xee, 0xc0, /* 1110111011 */
3570 0x44, 0x40, /* 0100010001 */
3571
3572 /* 178 0xb2 '.' */
3573 0x3c, 0xc0, /* 0011110011 */
3574 0xbe, 0xc0, /* 1011111011 */
3575 0xe7, 0x80, /* 1110011110 */
3576 0xef, 0x80, /* 1110111110 */
3577 0x3c, 0xc0, /* 0011110011 */
3578 0xbe, 0xc0, /* 1011111011 */
3579 0xe7, 0x80, /* 1110011110 */
3580 0xef, 0x80, /* 1110111110 */
3581 0x3c, 0xc0, /* 0011110011 */
3582 0xbe, 0xc0, /* 1011111011 */
3583 0xe7, 0x80, /* 1110011110 */
3584 0xef, 0x80, /* 1110111110 */
3585 0x3c, 0xc0, /* 0011110011 */
3586 0xbe, 0xc0, /* 1011111011 */
3587 0xe7, 0x80, /* 1110011110 */
3588 0xef, 0x80, /* 1110111110 */
3589 0x3c, 0xc0, /* 0011110011 */
3590 0xbe, 0xc0, /* 1011111011 */
3591
3592 /* 179 0xb3 '.' */
3593 0x0c, 0x00, /* 0000110000 */
3594 0x0c, 0x00, /* 0000110000 */
3595 0x0c, 0x00, /* 0000110000 */
3596 0x0c, 0x00, /* 0000110000 */
3597 0x0c, 0x00, /* 0000110000 */
3598 0x0c, 0x00, /* 0000110000 */
3599 0x0c, 0x00, /* 0000110000 */
3600 0x0c, 0x00, /* 0000110000 */
3601 0x0c, 0x00, /* 0000110000 */
3602 0x0c, 0x00, /* 0000110000 */
3603 0x0c, 0x00, /* 0000110000 */
3604 0x0c, 0x00, /* 0000110000 */
3605 0x0c, 0x00, /* 0000110000 */
3606 0x0c, 0x00, /* 0000110000 */
3607 0x0c, 0x00, /* 0000110000 */
3608 0x0c, 0x00, /* 0000110000 */
3609 0x0c, 0x00, /* 0000110000 */
3610 0x0c, 0x00, /* 0000110000 */
3611
3612 /* 180 0xb4 '.' */
3613 0x0c, 0x00, /* 0000110000 */
3614 0x0c, 0x00, /* 0000110000 */
3615 0x0c, 0x00, /* 0000110000 */
3616 0x0c, 0x00, /* 0000110000 */
3617 0x0c, 0x00, /* 0000110000 */
3618 0x0c, 0x00, /* 0000110000 */
3619 0x0c, 0x00, /* 0000110000 */
3620 0x0c, 0x00, /* 0000110000 */
3621 0xfc, 0x00, /* 1111110000 */
3622 0xfc, 0x00, /* 1111110000 */
3623 0x0c, 0x00, /* 0000110000 */
3624 0x0c, 0x00, /* 0000110000 */
3625 0x0c, 0x00, /* 0000110000 */
3626 0x0c, 0x00, /* 0000110000 */
3627 0x0c, 0x00, /* 0000110000 */
3628 0x0c, 0x00, /* 0000110000 */
3629 0x0c, 0x00, /* 0000110000 */
3630 0x0c, 0x00, /* 0000110000 */
3631
3632 /* 181 0xb5 '.' */
3633 0x0c, 0x00, /* 0000110000 */
3634 0x0c, 0x00, /* 0000110000 */
3635 0x0c, 0x00, /* 0000110000 */
3636 0x0c, 0x00, /* 0000110000 */
3637 0x0c, 0x00, /* 0000110000 */
3638 0xfc, 0x00, /* 1111110000 */
3639 0xfc, 0x00, /* 1111110000 */
3640 0x0c, 0x00, /* 0000110000 */
3641 0xfc, 0x00, /* 1111110000 */
3642 0xfc, 0x00, /* 1111110000 */
3643 0x0c, 0x00, /* 0000110000 */
3644 0x0c, 0x00, /* 0000110000 */
3645 0x0c, 0x00, /* 0000110000 */
3646 0x0c, 0x00, /* 0000110000 */
3647 0x0c, 0x00, /* 0000110000 */
3648 0x0c, 0x00, /* 0000110000 */
3649 0x0c, 0x00, /* 0000110000 */
3650 0x0c, 0x00, /* 0000110000 */
3651
3652 /* 182 0xb6 '.' */
3653 0x1b, 0x00, /* 0001101100 */
3654 0x1b, 0x00, /* 0001101100 */
3655 0x1b, 0x00, /* 0001101100 */
3656 0x1b, 0x00, /* 0001101100 */
3657 0x1b, 0x00, /* 0001101100 */
3658 0x1b, 0x00, /* 0001101100 */
3659 0x1b, 0x00, /* 0001101100 */
3660 0x1b, 0x00, /* 0001101100 */
3661 0xfb, 0x00, /* 1111101100 */
3662 0xfb, 0x00, /* 1111101100 */
3663 0x1b, 0x00, /* 0001101100 */
3664 0x1b, 0x00, /* 0001101100 */
3665 0x1b, 0x00, /* 0001101100 */
3666 0x1b, 0x00, /* 0001101100 */
3667 0x1b, 0x00, /* 0001101100 */
3668 0x1b, 0x00, /* 0001101100 */
3669 0x1b, 0x00, /* 0001101100 */
3670 0x1b, 0x00, /* 0001101100 */
3671
3672 /* 183 0xb7 '.' */
3673 0x00, 0x00, /* 0000000000 */
3674 0x00, 0x00, /* 0000000000 */
3675 0x00, 0x00, /* 0000000000 */
3676 0x00, 0x00, /* 0000000000 */
3677 0x00, 0x00, /* 0000000000 */
3678 0x00, 0x00, /* 0000000000 */
3679 0x00, 0x00, /* 0000000000 */
3680 0x00, 0x00, /* 0000000000 */
3681 0xff, 0x00, /* 1111111100 */
3682 0xff, 0x00, /* 1111111100 */
3683 0x1b, 0x00, /* 0001101100 */
3684 0x1b, 0x00, /* 0001101100 */
3685 0x1b, 0x00, /* 0001101100 */
3686 0x1b, 0x00, /* 0001101100 */
3687 0x1b, 0x00, /* 0001101100 */
3688 0x1b, 0x00, /* 0001101100 */
3689 0x1b, 0x00, /* 0001101100 */
3690 0x1b, 0x00, /* 0001101100 */
3691
3692 /* 184 0xb8 '.' */
3693 0x00, 0x00, /* 0000000000 */
3694 0x00, 0x00, /* 0000000000 */
3695 0x00, 0x00, /* 0000000000 */
3696 0x00, 0x00, /* 0000000000 */
3697 0x00, 0x00, /* 0000000000 */
3698 0xfc, 0x00, /* 1111110000 */
3699 0xfc, 0x00, /* 1111110000 */
3700 0x0c, 0x00, /* 0000110000 */
3701 0xfc, 0x00, /* 1111110000 */
3702 0xfc, 0x00, /* 1111110000 */
3703 0x0c, 0x00, /* 0000110000 */
3704 0x0c, 0x00, /* 0000110000 */
3705 0x0c, 0x00, /* 0000110000 */
3706 0x0c, 0x00, /* 0000110000 */
3707 0x0c, 0x00, /* 0000110000 */
3708 0x0c, 0x00, /* 0000110000 */
3709 0x0c, 0x00, /* 0000110000 */
3710 0x0c, 0x00, /* 0000110000 */
3711
3712 /* 185 0xb9 '.' */
3713 0x1b, 0x00, /* 0001101100 */
3714 0x1b, 0x00, /* 0001101100 */
3715 0x1b, 0x00, /* 0001101100 */
3716 0x1b, 0x00, /* 0001101100 */
3717 0x1b, 0x00, /* 0001101100 */
3718 0xfb, 0x00, /* 1111101100 */
3719 0xfb, 0x00, /* 1111101100 */
3720 0x03, 0x00, /* 0000001100 */
3721 0xfb, 0x00, /* 1111101100 */
3722 0xfb, 0x00, /* 1111101100 */
3723 0x1b, 0x00, /* 0001101100 */
3724 0x1b, 0x00, /* 0001101100 */
3725 0x1b, 0x00, /* 0001101100 */
3726 0x1b, 0x00, /* 0001101100 */
3727 0x1b, 0x00, /* 0001101100 */
3728 0x1b, 0x00, /* 0001101100 */
3729 0x1b, 0x00, /* 0001101100 */
3730 0x1b, 0x00, /* 0001101100 */
3731
3732 /* 186 0xba '.' */
3733 0x1b, 0x00, /* 0001101100 */
3734 0x1b, 0x00, /* 0001101100 */
3735 0x1b, 0x00, /* 0001101100 */
3736 0x1b, 0x00, /* 0001101100 */
3737 0x1b, 0x00, /* 0001101100 */
3738 0x1b, 0x00, /* 0001101100 */
3739 0x1b, 0x00, /* 0001101100 */
3740 0x1b, 0x00, /* 0001101100 */
3741 0x1b, 0x00, /* 0001101100 */
3742 0x1b, 0x00, /* 0001101100 */
3743 0x1b, 0x00, /* 0001101100 */
3744 0x1b, 0x00, /* 0001101100 */
3745 0x1b, 0x00, /* 0001101100 */
3746 0x1b, 0x00, /* 0001101100 */
3747 0x1b, 0x00, /* 0001101100 */
3748 0x1b, 0x00, /* 0001101100 */
3749 0x1b, 0x00, /* 0001101100 */
3750 0x1b, 0x00, /* 0001101100 */
3751
3752 /* 187 0xbb '.' */
3753 0x00, 0x00, /* 0000000000 */
3754 0x00, 0x00, /* 0000000000 */
3755 0x00, 0x00, /* 0000000000 */
3756 0x00, 0x00, /* 0000000000 */
3757 0x00, 0x00, /* 0000000000 */
3758 0xff, 0x00, /* 1111111100 */
3759 0xff, 0x00, /* 1111111100 */
3760 0x03, 0x00, /* 0000001100 */
3761 0xfb, 0x00, /* 1111101100 */
3762 0xfb, 0x00, /* 1111101100 */
3763 0x1b, 0x00, /* 0001101100 */
3764 0x1b, 0x00, /* 0001101100 */
3765 0x1b, 0x00, /* 0001101100 */
3766 0x1b, 0x00, /* 0001101100 */
3767 0x1b, 0x00, /* 0001101100 */
3768 0x1b, 0x00, /* 0001101100 */
3769 0x1b, 0x00, /* 0001101100 */
3770 0x1b, 0x00, /* 0001101100 */
3771
3772 /* 188 0xbc '.' */
3773 0x1b, 0x00, /* 0001101100 */
3774 0x1b, 0x00, /* 0001101100 */
3775 0x1b, 0x00, /* 0001101100 */
3776 0x1b, 0x00, /* 0001101100 */
3777 0x1b, 0x00, /* 0001101100 */
3778 0xfb, 0x00, /* 1111101100 */
3779 0xfb, 0x00, /* 1111101100 */
3780 0x03, 0x00, /* 0000001100 */
3781 0xff, 0x00, /* 1111111100 */
3782 0xff, 0x00, /* 1111111100 */
3783 0x00, 0x00, /* 0000000000 */
3784 0x00, 0x00, /* 0000000000 */
3785 0x00, 0x00, /* 0000000000 */
3786 0x00, 0x00, /* 0000000000 */
3787 0x00, 0x00, /* 0000000000 */
3788 0x00, 0x00, /* 0000000000 */
3789 0x00, 0x00, /* 0000000000 */
3790 0x00, 0x00, /* 0000000000 */
3791
3792 /* 189 0xbd '.' */
3793 0x1b, 0x00, /* 0001101100 */
3794 0x1b, 0x00, /* 0001101100 */
3795 0x1b, 0x00, /* 0001101100 */
3796 0x1b, 0x00, /* 0001101100 */
3797 0x1b, 0x00, /* 0001101100 */
3798 0x1b, 0x00, /* 0001101100 */
3799 0x1b, 0x00, /* 0001101100 */
3800 0x1b, 0x00, /* 0001101100 */
3801 0xff, 0x00, /* 1111111100 */
3802 0xff, 0x00, /* 1111111100 */
3803 0x00, 0x00, /* 0000000000 */
3804 0x00, 0x00, /* 0000000000 */
3805 0x00, 0x00, /* 0000000000 */
3806 0x00, 0x00, /* 0000000000 */
3807 0x00, 0x00, /* 0000000000 */
3808 0x00, 0x00, /* 0000000000 */
3809 0x00, 0x00, /* 0000000000 */
3810 0x00, 0x00, /* 0000000000 */
3811
3812 /* 190 0xbe '.' */
3813 0x0c, 0x00, /* 0000110000 */
3814 0x0c, 0x00, /* 0000110000 */
3815 0x0c, 0x00, /* 0000110000 */
3816 0x0c, 0x00, /* 0000110000 */
3817 0x0c, 0x00, /* 0000110000 */
3818 0xfc, 0x00, /* 1111110000 */
3819 0xfc, 0x00, /* 1111110000 */
3820 0x0c, 0x00, /* 0000110000 */
3821 0xfc, 0x00, /* 1111110000 */
3822 0xfc, 0x00, /* 1111110000 */
3823 0x00, 0x00, /* 0000000000 */
3824 0x00, 0x00, /* 0000000000 */
3825 0x00, 0x00, /* 0000000000 */
3826 0x00, 0x00, /* 0000000000 */
3827 0x00, 0x00, /* 0000000000 */
3828 0x00, 0x00, /* 0000000000 */
3829 0x00, 0x00, /* 0000000000 */
3830 0x00, 0x00, /* 0000000000 */
3831
3832 /* 191 0xbf '.' */
3833 0x00, 0x00, /* 0000000000 */
3834 0x00, 0x00, /* 0000000000 */
3835 0x00, 0x00, /* 0000000000 */
3836 0x00, 0x00, /* 0000000000 */
3837 0x00, 0x00, /* 0000000000 */
3838 0x00, 0x00, /* 0000000000 */
3839 0x00, 0x00, /* 0000000000 */
3840 0x00, 0x00, /* 0000000000 */
3841 0xfc, 0x00, /* 1111110000 */
3842 0xfc, 0x00, /* 1111110000 */
3843 0x0c, 0x00, /* 0000110000 */
3844 0x0c, 0x00, /* 0000110000 */
3845 0x0c, 0x00, /* 0000110000 */
3846 0x0c, 0x00, /* 0000110000 */
3847 0x0c, 0x00, /* 0000110000 */
3848 0x0c, 0x00, /* 0000110000 */
3849 0x0c, 0x00, /* 0000110000 */
3850 0x0c, 0x00, /* 0000110000 */
3851
3852 /* 192 0xc0 '.' */
3853 0x0c, 0x00, /* 0000110000 */
3854 0x0c, 0x00, /* 0000110000 */
3855 0x0c, 0x00, /* 0000110000 */
3856 0x0c, 0x00, /* 0000110000 */
3857 0x0c, 0x00, /* 0000110000 */
3858 0x0c, 0x00, /* 0000110000 */
3859 0x0c, 0x00, /* 0000110000 */
3860 0x0c, 0x00, /* 0000110000 */
3861 0x0f, 0xc0, /* 0000111111 */
3862 0x0f, 0xc0, /* 0000111111 */
3863 0x00, 0x00, /* 0000000000 */
3864 0x00, 0x00, /* 0000000000 */
3865 0x00, 0x00, /* 0000000000 */
3866 0x00, 0x00, /* 0000000000 */
3867 0x00, 0x00, /* 0000000000 */
3868 0x00, 0x00, /* 0000000000 */
3869 0x00, 0x00, /* 0000000000 */
3870 0x00, 0x00, /* 0000000000 */
3871
3872 /* 193 0xc1 '.' */
3873 0x0c, 0x00, /* 0000110000 */
3874 0x0c, 0x00, /* 0000110000 */
3875 0x0c, 0x00, /* 0000110000 */
3876 0x0c, 0x00, /* 0000110000 */
3877 0x0c, 0x00, /* 0000110000 */
3878 0x0c, 0x00, /* 0000110000 */
3879 0x0c, 0x00, /* 0000110000 */
3880 0x0c, 0x00, /* 0000110000 */
3881 0xff, 0xc0, /* 1111111111 */
3882 0xff, 0xc0, /* 1111111111 */
3883 0x00, 0x00, /* 0000000000 */
3884 0x00, 0x00, /* 0000000000 */
3885 0x00, 0x00, /* 0000000000 */
3886 0x00, 0x00, /* 0000000000 */
3887 0x00, 0x00, /* 0000000000 */
3888 0x00, 0x00, /* 0000000000 */
3889 0x00, 0x00, /* 0000000000 */
3890 0x00, 0x00, /* 0000000000 */
3891
3892 /* 194 0xc2 '.' */
3893 0x00, 0x00, /* 0000000000 */
3894 0x00, 0x00, /* 0000000000 */
3895 0x00, 0x00, /* 0000000000 */
3896 0x00, 0x00, /* 0000000000 */
3897 0x00, 0x00, /* 0000000000 */
3898 0x00, 0x00, /* 0000000000 */
3899 0x00, 0x00, /* 0000000000 */
3900 0x00, 0x00, /* 0000000000 */
3901 0xff, 0xc0, /* 1111111111 */
3902 0xff, 0xc0, /* 1111111111 */
3903 0x0c, 0x00, /* 0000110000 */
3904 0x0c, 0x00, /* 0000110000 */
3905 0x0c, 0x00, /* 0000110000 */
3906 0x0c, 0x00, /* 0000110000 */
3907 0x0c, 0x00, /* 0000110000 */
3908 0x0c, 0x00, /* 0000110000 */
3909 0x0c, 0x00, /* 0000110000 */
3910 0x0c, 0x00, /* 0000110000 */
3911
3912 /* 195 0xc3 '.' */
3913 0x0c, 0x00, /* 0000110000 */
3914 0x0c, 0x00, /* 0000110000 */
3915 0x0c, 0x00, /* 0000110000 */
3916 0x0c, 0x00, /* 0000110000 */
3917 0x0c, 0x00, /* 0000110000 */
3918 0x0c, 0x00, /* 0000110000 */
3919 0x0c, 0x00, /* 0000110000 */
3920 0x0c, 0x00, /* 0000110000 */
3921 0x0f, 0xc0, /* 0000111111 */
3922 0x0f, 0xc0, /* 0000111111 */
3923 0x0c, 0x00, /* 0000110000 */
3924 0x0c, 0x00, /* 0000110000 */
3925 0x0c, 0x00, /* 0000110000 */
3926 0x0c, 0x00, /* 0000110000 */
3927 0x0c, 0x00, /* 0000110000 */
3928 0x0c, 0x00, /* 0000110000 */
3929 0x0c, 0x00, /* 0000110000 */
3930 0x0c, 0x00, /* 0000110000 */
3931
3932 /* 196 0xc4 '.' */
3933 0x00, 0x00, /* 0000000000 */
3934 0x00, 0x00, /* 0000000000 */
3935 0x00, 0x00, /* 0000000000 */
3936 0x00, 0x00, /* 0000000000 */
3937 0x00, 0x00, /* 0000000000 */
3938 0x00, 0x00, /* 0000000000 */
3939 0x00, 0x00, /* 0000000000 */
3940 0x00, 0x00, /* 0000000000 */
3941 0xff, 0xc0, /* 1111111111 */
3942 0xff, 0xc0, /* 1111111111 */
3943 0x00, 0x00, /* 0000000000 */
3944 0x00, 0x00, /* 0000000000 */
3945 0x00, 0x00, /* 0000000000 */
3946 0x00, 0x00, /* 0000000000 */
3947 0x00, 0x00, /* 0000000000 */
3948 0x00, 0x00, /* 0000000000 */
3949 0x00, 0x00, /* 0000000000 */
3950 0x00, 0x00, /* 0000000000 */
3951
3952 /* 197 0xc5 '.' */
3953 0x0c, 0x00, /* 0000110000 */
3954 0x0c, 0x00, /* 0000110000 */
3955 0x0c, 0x00, /* 0000110000 */
3956 0x0c, 0x00, /* 0000110000 */
3957 0x0c, 0x00, /* 0000110000 */
3958 0x0c, 0x00, /* 0000110000 */
3959 0x0c, 0x00, /* 0000110000 */
3960 0x0c, 0x00, /* 0000110000 */
3961 0xff, 0xc0, /* 1111111111 */
3962 0xff, 0xc0, /* 1111111111 */
3963 0x0c, 0x00, /* 0000110000 */
3964 0x0c, 0x00, /* 0000110000 */
3965 0x0c, 0x00, /* 0000110000 */
3966 0x0c, 0x00, /* 0000110000 */
3967 0x0c, 0x00, /* 0000110000 */
3968 0x0c, 0x00, /* 0000110000 */
3969 0x0c, 0x00, /* 0000110000 */
3970 0x0c, 0x00, /* 0000110000 */
3971
3972 /* 198 0xc6 '.' */
3973 0x0c, 0x00, /* 0000110000 */
3974 0x0c, 0x00, /* 0000110000 */
3975 0x0c, 0x00, /* 0000110000 */
3976 0x0c, 0x00, /* 0000110000 */
3977 0x0c, 0x00, /* 0000110000 */
3978 0x0f, 0xc0, /* 0000111111 */
3979 0x0f, 0xc0, /* 0000111111 */
3980 0x0c, 0x00, /* 0000110000 */
3981 0x0f, 0xc0, /* 0000111111 */
3982 0x0f, 0xc0, /* 0000111111 */
3983 0x0c, 0x00, /* 0000110000 */
3984 0x0c, 0x00, /* 0000110000 */
3985 0x0c, 0x00, /* 0000110000 */
3986 0x0c, 0x00, /* 0000110000 */
3987 0x0c, 0x00, /* 0000110000 */
3988 0x0c, 0x00, /* 0000110000 */
3989 0x0c, 0x00, /* 0000110000 */
3990 0x0c, 0x00, /* 0000110000 */
3991
3992 /* 199 0xc7 '.' */
3993 0x1b, 0x00, /* 0001101100 */
3994 0x1b, 0x00, /* 0001101100 */
3995 0x1b, 0x00, /* 0001101100 */
3996 0x1b, 0x00, /* 0001101100 */
3997 0x1b, 0x00, /* 0001101100 */
3998 0x1b, 0x00, /* 0001101100 */
3999 0x1b, 0x00, /* 0001101100 */
4000 0x1b, 0x00, /* 0001101100 */
4001 0x1b, 0xc0, /* 0001101111 */
4002 0x1b, 0xc0, /* 0001101111 */
4003 0x1b, 0x00, /* 0001101100 */
4004 0x1b, 0x00, /* 0001101100 */
4005 0x1b, 0x00, /* 0001101100 */
4006 0x1b, 0x00, /* 0001101100 */
4007 0x1b, 0x00, /* 0001101100 */
4008 0x1b, 0x00, /* 0001101100 */
4009 0x1b, 0x00, /* 0001101100 */
4010 0x1b, 0x00, /* 0001101100 */
4011
4012 /* 200 0xc8 '.' */
4013 0x1b, 0x00, /* 0001101100 */
4014 0x1b, 0x00, /* 0001101100 */
4015 0x1b, 0x00, /* 0001101100 */
4016 0x1b, 0x00, /* 0001101100 */
4017 0x1b, 0x00, /* 0001101100 */
4018 0x1b, 0xc0, /* 0001101111 */
4019 0x1b, 0xc0, /* 0001101111 */
4020 0x18, 0x00, /* 0001100000 */
4021 0x1f, 0xc0, /* 0001111111 */
4022 0x1f, 0xc0, /* 0001111111 */
4023 0x00, 0x00, /* 0000000000 */
4024 0x00, 0x00, /* 0000000000 */
4025 0x00, 0x00, /* 0000000000 */
4026 0x00, 0x00, /* 0000000000 */
4027 0x00, 0x00, /* 0000000000 */
4028 0x00, 0x00, /* 0000000000 */
4029 0x00, 0x00, /* 0000000000 */
4030 0x00, 0x00, /* 0000000000 */
4031
4032 /* 201 0xc9 '.' */
4033 0x00, 0x00, /* 0000000000 */
4034 0x00, 0x00, /* 0000000000 */
4035 0x00, 0x00, /* 0000000000 */
4036 0x00, 0x00, /* 0000000000 */
4037 0x00, 0x00, /* 0000000000 */
4038 0x1f, 0xc0, /* 0001111111 */
4039 0x1f, 0xc0, /* 0001111111 */
4040 0x18, 0x00, /* 0001100000 */
4041 0x1b, 0xc0, /* 0001101111 */
4042 0x1b, 0xc0, /* 0001101111 */
4043 0x1b, 0x00, /* 0001101100 */
4044 0x1b, 0x00, /* 0001101100 */
4045 0x1b, 0x00, /* 0001101100 */
4046 0x1b, 0x00, /* 0001101100 */
4047 0x1b, 0x00, /* 0001101100 */
4048 0x1b, 0x00, /* 0001101100 */
4049 0x1b, 0x00, /* 0001101100 */
4050 0x1b, 0x00, /* 0001101100 */
4051
4052 /* 202 0xca '.' */
4053 0x1b, 0x00, /* 0001101100 */
4054 0x1b, 0x00, /* 0001101100 */
4055 0x1b, 0x00, /* 0001101100 */
4056 0x1b, 0x00, /* 0001101100 */
4057 0x1b, 0x00, /* 0001101100 */
4058 0xfb, 0xc0, /* 1111101111 */
4059 0xfb, 0xc0, /* 1111101111 */
4060 0x00, 0x00, /* 0000000000 */
4061 0xff, 0xc0, /* 1111111111 */
4062 0xff, 0xc0, /* 1111111111 */
4063 0x00, 0x00, /* 0000000000 */
4064 0x00, 0x00, /* 0000000000 */
4065 0x00, 0x00, /* 0000000000 */
4066 0x00, 0x00, /* 0000000000 */
4067 0x00, 0x00, /* 0000000000 */
4068 0x00, 0x00, /* 0000000000 */
4069 0x00, 0x00, /* 0000000000 */
4070 0x00, 0x00, /* 0000000000 */
4071
4072 /* 203 0xcb '.' */
4073 0x00, 0x00, /* 0000000000 */
4074 0x00, 0x00, /* 0000000000 */
4075 0x00, 0x00, /* 0000000000 */
4076 0x00, 0x00, /* 0000000000 */
4077 0x00, 0x00, /* 0000000000 */
4078 0xff, 0xc0, /* 1111111111 */
4079 0xff, 0xc0, /* 1111111111 */
4080 0x00, 0x00, /* 0000000000 */
4081 0xfb, 0xc0, /* 1111101111 */
4082 0xfb, 0xc0, /* 1111101111 */
4083 0x1b, 0x00, /* 0001101100 */
4084 0x1b, 0x00, /* 0001101100 */
4085 0x1b, 0x00, /* 0001101100 */
4086 0x1b, 0x00, /* 0001101100 */
4087 0x1b, 0x00, /* 0001101100 */
4088 0x1b, 0x00, /* 0001101100 */
4089 0x1b, 0x00, /* 0001101100 */
4090 0x1b, 0x00, /* 0001101100 */
4091
4092 /* 204 0xcc '.' */
4093 0x1b, 0x00, /* 0001101100 */
4094 0x1b, 0x00, /* 0001101100 */
4095 0x1b, 0x00, /* 0001101100 */
4096 0x1b, 0x00, /* 0001101100 */
4097 0x1b, 0x00, /* 0001101100 */
4098 0x1b, 0xc0, /* 0001101111 */
4099 0x1b, 0xc0, /* 0001101111 */
4100 0x18, 0x00, /* 0001100000 */
4101 0x1b, 0xc0, /* 0001101111 */
4102 0x1b, 0xc0, /* 0001101111 */
4103 0x1b, 0x00, /* 0001101100 */
4104 0x1b, 0x00, /* 0001101100 */
4105 0x1b, 0x00, /* 0001101100 */
4106 0x1b, 0x00, /* 0001101100 */
4107 0x1b, 0x00, /* 0001101100 */
4108 0x1b, 0x00, /* 0001101100 */
4109 0x1b, 0x00, /* 0001101100 */
4110 0x1b, 0x00, /* 0001101100 */
4111
4112 /* 205 0xcd '.' */
4113 0x00, 0x00, /* 0000000000 */
4114 0x00, 0x00, /* 0000000000 */
4115 0x00, 0x00, /* 0000000000 */
4116 0x00, 0x00, /* 0000000000 */
4117 0x00, 0x00, /* 0000000000 */
4118 0xff, 0xc0, /* 1111111111 */
4119 0xff, 0xc0, /* 1111111111 */
4120 0x00, 0x00, /* 0000000000 */
4121 0xff, 0xc0, /* 1111111111 */
4122 0xff, 0xc0, /* 1111111111 */
4123 0x00, 0x00, /* 0000000000 */
4124 0x00, 0x00, /* 0000000000 */
4125 0x00, 0x00, /* 0000000000 */
4126 0x00, 0x00, /* 0000000000 */
4127 0x00, 0x00, /* 0000000000 */
4128 0x00, 0x00, /* 0000000000 */
4129 0x00, 0x00, /* 0000000000 */
4130 0x00, 0x00, /* 0000000000 */
4131
4132 /* 206 0xce '.' */
4133 0x1b, 0x00, /* 0001101100 */
4134 0x1b, 0x00, /* 0001101100 */
4135 0x1b, 0x00, /* 0001101100 */
4136 0x1b, 0x00, /* 0001101100 */
4137 0x1b, 0x00, /* 0001101100 */
4138 0xfb, 0xc0, /* 1111101111 */
4139 0xfb, 0xc0, /* 1111101111 */
4140 0x00, 0x00, /* 0000000000 */
4141 0xfb, 0xc0, /* 1111101111 */
4142 0xfb, 0xc0, /* 1111101111 */
4143 0x1b, 0x00, /* 0001101100 */
4144 0x1b, 0x00, /* 0001101100 */
4145 0x1b, 0x00, /* 0001101100 */
4146 0x1b, 0x00, /* 0001101100 */
4147 0x1b, 0x00, /* 0001101100 */
4148 0x1b, 0x00, /* 0001101100 */
4149 0x1b, 0x00, /* 0001101100 */
4150 0x1b, 0x00, /* 0001101100 */
4151
4152 /* 207 0xcf '.' */
4153 0x0c, 0x00, /* 0000110000 */
4154 0x0c, 0x00, /* 0000110000 */
4155 0x0c, 0x00, /* 0000110000 */
4156 0x0c, 0x00, /* 0000110000 */
4157 0x0c, 0x00, /* 0000110000 */
4158 0xff, 0xc0, /* 1111111111 */
4159 0xff, 0xc0, /* 1111111111 */
4160 0x00, 0x00, /* 0000000000 */
4161 0xff, 0xc0, /* 1111111111 */
4162 0xff, 0xc0, /* 1111111111 */
4163 0x00, 0x00, /* 0000000000 */
4164 0x00, 0x00, /* 0000000000 */
4165 0x00, 0x00, /* 0000000000 */
4166 0x00, 0x00, /* 0000000000 */
4167 0x00, 0x00, /* 0000000000 */
4168 0x00, 0x00, /* 0000000000 */
4169 0x00, 0x00, /* 0000000000 */
4170 0x00, 0x00, /* 0000000000 */
4171
4172 /* 208 0xd0 '.' */
4173 0x1b, 0x00, /* 0001101100 */
4174 0x1b, 0x00, /* 0001101100 */
4175 0x1b, 0x00, /* 0001101100 */
4176 0x1b, 0x00, /* 0001101100 */
4177 0x1b, 0x00, /* 0001101100 */
4178 0x1b, 0x00, /* 0001101100 */
4179 0x1b, 0x00, /* 0001101100 */
4180 0x1b, 0x00, /* 0001101100 */
4181 0xff, 0xc0, /* 1111111111 */
4182 0xff, 0xc0, /* 1111111111 */
4183 0x00, 0x00, /* 0000000000 */
4184 0x00, 0x00, /* 0000000000 */
4185 0x00, 0x00, /* 0000000000 */
4186 0x00, 0x00, /* 0000000000 */
4187 0x00, 0x00, /* 0000000000 */
4188 0x00, 0x00, /* 0000000000 */
4189 0x00, 0x00, /* 0000000000 */
4190 0x00, 0x00, /* 0000000000 */
4191
4192 /* 209 0xd1 '.' */
4193 0x00, 0x00, /* 0000000000 */
4194 0x00, 0x00, /* 0000000000 */
4195 0x00, 0x00, /* 0000000000 */
4196 0x00, 0x00, /* 0000000000 */
4197 0x00, 0x00, /* 0000000000 */
4198 0xff, 0xc0, /* 1111111111 */
4199 0xff, 0xc0, /* 1111111111 */
4200 0x00, 0x00, /* 0000000000 */
4201 0xff, 0xc0, /* 1111111111 */
4202 0xff, 0xc0, /* 1111111111 */
4203 0x0c, 0x00, /* 0000110000 */
4204 0x0c, 0x00, /* 0000110000 */
4205 0x0c, 0x00, /* 0000110000 */
4206 0x0c, 0x00, /* 0000110000 */
4207 0x0c, 0x00, /* 0000110000 */
4208 0x0c, 0x00, /* 0000110000 */
4209 0x0c, 0x00, /* 0000110000 */
4210 0x0c, 0x00, /* 0000110000 */
4211
4212 /* 210 0xd2 '.' */
4213 0x00, 0x00, /* 0000000000 */
4214 0x00, 0x00, /* 0000000000 */
4215 0x00, 0x00, /* 0000000000 */
4216 0x00, 0x00, /* 0000000000 */
4217 0x00, 0x00, /* 0000000000 */
4218 0x00, 0x00, /* 0000000000 */
4219 0x00, 0x00, /* 0000000000 */
4220 0x00, 0x00, /* 0000000000 */
4221 0xff, 0xc0, /* 1111111111 */
4222 0xff, 0xc0, /* 1111111111 */
4223 0x1b, 0x00, /* 0001101100 */
4224 0x1b, 0x00, /* 0001101100 */
4225 0x1b, 0x00, /* 0001101100 */
4226 0x1b, 0x00, /* 0001101100 */
4227 0x1b, 0x00, /* 0001101100 */
4228 0x1b, 0x00, /* 0001101100 */
4229 0x1b, 0x00, /* 0001101100 */
4230 0x1b, 0x00, /* 0001101100 */
4231
4232 /* 211 0xd3 '.' */
4233 0x1b, 0x00, /* 0001101100 */
4234 0x1b, 0x00, /* 0001101100 */
4235 0x1b, 0x00, /* 0001101100 */
4236 0x1b, 0x00, /* 0001101100 */
4237 0x1b, 0x00, /* 0001101100 */
4238 0x1b, 0x00, /* 0001101100 */
4239 0x1b, 0x00, /* 0001101100 */
4240 0x1b, 0x00, /* 0001101100 */
4241 0x1f, 0xc0, /* 0001111111 */
4242 0x1f, 0xc0, /* 0001111111 */
4243 0x00, 0x00, /* 0000000000 */
4244 0x00, 0x00, /* 0000000000 */
4245 0x00, 0x00, /* 0000000000 */
4246 0x00, 0x00, /* 0000000000 */
4247 0x00, 0x00, /* 0000000000 */
4248 0x00, 0x00, /* 0000000000 */
4249 0x00, 0x00, /* 0000000000 */
4250 0x00, 0x00, /* 0000000000 */
4251
4252 /* 212 0xd4 '.' */
4253 0x0c, 0x00, /* 0000110000 */
4254 0x0c, 0x00, /* 0000110000 */
4255 0x0c, 0x00, /* 0000110000 */
4256 0x0c, 0x00, /* 0000110000 */
4257 0x0c, 0x00, /* 0000110000 */
4258 0x0f, 0xc0, /* 0000111111 */
4259 0x0f, 0xc0, /* 0000111111 */
4260 0x0c, 0x00, /* 0000110000 */
4261 0x0f, 0xc0, /* 0000111111 */
4262 0x0f, 0xc0, /* 0000111111 */
4263 0x00, 0x00, /* 0000000000 */
4264 0x00, 0x00, /* 0000000000 */
4265 0x00, 0x00, /* 0000000000 */
4266 0x00, 0x00, /* 0000000000 */
4267 0x00, 0x00, /* 0000000000 */
4268 0x00, 0x00, /* 0000000000 */
4269 0x00, 0x00, /* 0000000000 */
4270 0x00, 0x00, /* 0000000000 */
4271
4272 /* 213 0xd5 '.' */
4273 0x00, 0x00, /* 0000000000 */
4274 0x00, 0x00, /* 0000000000 */
4275 0x00, 0x00, /* 0000000000 */
4276 0x00, 0x00, /* 0000000000 */
4277 0x00, 0x00, /* 0000000000 */
4278 0x0f, 0xc0, /* 0000111111 */
4279 0x0f, 0xc0, /* 0000111111 */
4280 0x0c, 0x00, /* 0000110000 */
4281 0x0f, 0xc0, /* 0000111111 */
4282 0x0f, 0xc0, /* 0000111111 */
4283 0x0c, 0x00, /* 0000110000 */
4284 0x0c, 0x00, /* 0000110000 */
4285 0x0c, 0x00, /* 0000110000 */
4286 0x0c, 0x00, /* 0000110000 */
4287 0x0c, 0x00, /* 0000110000 */
4288 0x0c, 0x00, /* 0000110000 */
4289 0x0c, 0x00, /* 0000110000 */
4290 0x0c, 0x00, /* 0000110000 */
4291
4292 /* 214 0xd6 '.' */
4293 0x00, 0x00, /* 0000000000 */
4294 0x00, 0x00, /* 0000000000 */
4295 0x00, 0x00, /* 0000000000 */
4296 0x00, 0x00, /* 0000000000 */
4297 0x00, 0x00, /* 0000000000 */
4298 0x00, 0x00, /* 0000000000 */
4299 0x00, 0x00, /* 0000000000 */
4300 0x00, 0x00, /* 0000000000 */
4301 0x1f, 0xc0, /* 0001111111 */
4302 0x1f, 0xc0, /* 0001111111 */
4303 0x1b, 0x00, /* 0001101100 */
4304 0x1b, 0x00, /* 0001101100 */
4305 0x1b, 0x00, /* 0001101100 */
4306 0x1b, 0x00, /* 0001101100 */
4307 0x1b, 0x00, /* 0001101100 */
4308 0x1b, 0x00, /* 0001101100 */
4309 0x1b, 0x00, /* 0001101100 */
4310 0x1b, 0x00, /* 0001101100 */
4311
4312 /* 215 0xd7 '.' */
4313 0x1b, 0x00, /* 0001101100 */
4314 0x1b, 0x00, /* 0001101100 */
4315 0x1b, 0x00, /* 0001101100 */
4316 0x1b, 0x00, /* 0001101100 */
4317 0x1b, 0x00, /* 0001101100 */
4318 0x1b, 0x00, /* 0001101100 */
4319 0x1b, 0x00, /* 0001101100 */
4320 0x1b, 0x00, /* 0001101100 */
4321 0xff, 0xc0, /* 1111111111 */
4322 0xff, 0xc0, /* 1111111111 */
4323 0x1b, 0x00, /* 0001101100 */
4324 0x1b, 0x00, /* 0001101100 */
4325 0x1b, 0x00, /* 0001101100 */
4326 0x1b, 0x00, /* 0001101100 */
4327 0x1b, 0x00, /* 0001101100 */
4328 0x1b, 0x00, /* 0001101100 */
4329 0x1b, 0x00, /* 0001101100 */
4330 0x1b, 0x00, /* 0001101100 */
4331
4332 /* 216 0xd8 '.' */
4333 0x0c, 0x00, /* 0000110000 */
4334 0x0c, 0x00, /* 0000110000 */
4335 0x0c, 0x00, /* 0000110000 */
4336 0x0c, 0x00, /* 0000110000 */
4337 0x0c, 0x00, /* 0000110000 */
4338 0xff, 0xc0, /* 1111111111 */
4339 0xff, 0xc0, /* 1111111111 */
4340 0x0c, 0x00, /* 0000110000 */
4341 0xff, 0xc0, /* 1111111111 */
4342 0xff, 0xc0, /* 1111111111 */
4343 0x0c, 0x00, /* 0000110000 */
4344 0x0c, 0x00, /* 0000110000 */
4345 0x0c, 0x00, /* 0000110000 */
4346 0x0c, 0x00, /* 0000110000 */
4347 0x0c, 0x00, /* 0000110000 */
4348 0x0c, 0x00, /* 0000110000 */
4349 0x0c, 0x00, /* 0000110000 */
4350 0x0c, 0x00, /* 0000110000 */
4351
4352 /* 217 0xd9 '.' */
4353 0x0c, 0x00, /* 0000110000 */
4354 0x0c, 0x00, /* 0000110000 */
4355 0x0c, 0x00, /* 0000110000 */
4356 0x0c, 0x00, /* 0000110000 */
4357 0x0c, 0x00, /* 0000110000 */
4358 0x0c, 0x00, /* 0000110000 */
4359 0x0c, 0x00, /* 0000110000 */
4360 0x0c, 0x00, /* 0000110000 */
4361 0xfc, 0x00, /* 1111110000 */
4362 0xfc, 0x00, /* 1111110000 */
4363 0x00, 0x00, /* 0000000000 */
4364 0x00, 0x00, /* 0000000000 */
4365 0x00, 0x00, /* 0000000000 */
4366 0x00, 0x00, /* 0000000000 */
4367 0x00, 0x00, /* 0000000000 */
4368 0x00, 0x00, /* 0000000000 */
4369 0x00, 0x00, /* 0000000000 */
4370 0x00, 0x00, /* 0000000000 */
4371
4372 /* 218 0xda '.' */
4373 0x00, 0x00, /* 0000000000 */
4374 0x00, 0x00, /* 0000000000 */
4375 0x00, 0x00, /* 0000000000 */
4376 0x00, 0x00, /* 0000000000 */
4377 0x00, 0x00, /* 0000000000 */
4378 0x00, 0x00, /* 0000000000 */
4379 0x00, 0x00, /* 0000000000 */
4380 0x00, 0x00, /* 0000000000 */
4381 0x0f, 0xc0, /* 0000111111 */
4382 0x0f, 0xc0, /* 0000111111 */
4383 0x0c, 0x00, /* 0000110000 */
4384 0x0c, 0x00, /* 0000110000 */
4385 0x0c, 0x00, /* 0000110000 */
4386 0x0c, 0x00, /* 0000110000 */
4387 0x0c, 0x00, /* 0000110000 */
4388 0x0c, 0x00, /* 0000110000 */
4389 0x0c, 0x00, /* 0000110000 */
4390 0x0c, 0x00, /* 0000110000 */
4391
4392 /* 219 0xdb '.' */
4393 0xff, 0xc0, /* 1111111111 */
4394 0xff, 0xc0, /* 1111111111 */
4395 0xff, 0xc0, /* 1111111111 */
4396 0xff, 0xc0, /* 1111111111 */
4397 0xff, 0xc0, /* 1111111111 */
4398 0xff, 0xc0, /* 1111111111 */
4399 0xff, 0xc0, /* 1111111111 */
4400 0xff, 0xc0, /* 1111111111 */
4401 0xff, 0xc0, /* 1111111111 */
4402 0xff, 0xc0, /* 1111111111 */
4403 0xff, 0xc0, /* 1111111111 */
4404 0xff, 0xc0, /* 1111111111 */
4405 0xff, 0xc0, /* 1111111111 */
4406 0xff, 0xc0, /* 1111111111 */
4407 0xff, 0xc0, /* 1111111111 */
4408 0xff, 0xc0, /* 1111111111 */
4409 0xff, 0xc0, /* 1111111111 */
4410 0xff, 0xc0, /* 1111111111 */
4411
4412 /* 220 0xdc '.' */
4413 0x00, 0x00, /* 0000000000 */
4414 0x00, 0x00, /* 0000000000 */
4415 0x00, 0x00, /* 0000000000 */
4416 0x00, 0x00, /* 0000000000 */
4417 0x00, 0x00, /* 0000000000 */
4418 0x00, 0x00, /* 0000000000 */
4419 0x00, 0x00, /* 0000000000 */
4420 0x00, 0x00, /* 0000000000 */
4421 0xff, 0xc0, /* 1111111111 */
4422 0xff, 0xc0, /* 1111111111 */
4423 0xff, 0xc0, /* 1111111111 */
4424 0xff, 0xc0, /* 1111111111 */
4425 0xff, 0xc0, /* 1111111111 */
4426 0xff, 0xc0, /* 1111111111 */
4427 0xff, 0xc0, /* 1111111111 */
4428 0xff, 0xc0, /* 1111111111 */
4429 0xff, 0xc0, /* 1111111111 */
4430 0xff, 0xc0, /* 1111111111 */
4431
4432 /* 221 0xdd '.' */
4433 0xf8, 0x00, /* 1111100000 */
4434 0xf8, 0x00, /* 1111100000 */
4435 0xf8, 0x00, /* 1111100000 */
4436 0xf8, 0x00, /* 1111100000 */
4437 0xf8, 0x00, /* 1111100000 */
4438 0xf8, 0x00, /* 1111100000 */
4439 0xf8, 0x00, /* 1111100000 */
4440 0xf8, 0x00, /* 1111100000 */
4441 0xf8, 0x00, /* 1111100000 */
4442 0xf8, 0x00, /* 1111100000 */
4443 0xf8, 0x00, /* 1111100000 */
4444 0xf8, 0x00, /* 1111100000 */
4445 0xf8, 0x00, /* 1111100000 */
4446 0xf8, 0x00, /* 1111100000 */
4447 0xf8, 0x00, /* 1111100000 */
4448 0xf8, 0x00, /* 1111100000 */
4449 0xf8, 0x00, /* 1111100000 */
4450 0xf8, 0x00, /* 1111100000 */
4451
4452 /* 222 0xde '.' */
4453 0x07, 0xc0, /* 0000011111 */
4454 0x07, 0xc0, /* 0000011111 */
4455 0x07, 0xc0, /* 0000011111 */
4456 0x07, 0xc0, /* 0000011111 */
4457 0x07, 0xc0, /* 0000011111 */
4458 0x07, 0xc0, /* 0000011111 */
4459 0x07, 0xc0, /* 0000011111 */
4460 0x07, 0xc0, /* 0000011111 */
4461 0x07, 0xc0, /* 0000011111 */
4462 0x07, 0xc0, /* 0000011111 */
4463 0x07, 0xc0, /* 0000011111 */
4464 0x07, 0xc0, /* 0000011111 */
4465 0x07, 0xc0, /* 0000011111 */
4466 0x07, 0xc0, /* 0000011111 */
4467 0x07, 0xc0, /* 0000011111 */
4468 0x07, 0xc0, /* 0000011111 */
4469 0x07, 0xc0, /* 0000011111 */
4470 0x07, 0xc0, /* 0000011111 */
4471
4472 /* 223 0xdf '.' */
4473 0xff, 0xc0, /* 1111111111 */
4474 0xff, 0xc0, /* 1111111111 */
4475 0xff, 0xc0, /* 1111111111 */
4476 0xff, 0xc0, /* 1111111111 */
4477 0xff, 0xc0, /* 1111111111 */
4478 0xff, 0xc0, /* 1111111111 */
4479 0xff, 0xc0, /* 1111111111 */
4480 0xff, 0xc0, /* 1111111111 */
4481 0x00, 0x00, /* 0000000000 */
4482 0x00, 0x00, /* 0000000000 */
4483 0x00, 0x00, /* 0000000000 */
4484 0x00, 0x00, /* 0000000000 */
4485 0x00, 0x00, /* 0000000000 */
4486 0x00, 0x00, /* 0000000000 */
4487 0x00, 0x00, /* 0000000000 */
4488 0x00, 0x00, /* 0000000000 */
4489 0x00, 0x00, /* 0000000000 */
4490 0x00, 0x00, /* 0000000000 */
4491
4492 /* 224 0xe0 '.' */
4493 0x00, 0x00, /* 0000000000 */
4494 0x00, 0x00, /* 0000000000 */
4495 0x00, 0x00, /* 0000000000 */
4496 0x00, 0x00, /* 0000000000 */
4497 0x00, 0x00, /* 0000000000 */
4498 0x1c, 0x80, /* 0001110010 */
4499 0x35, 0x80, /* 0011010110 */
4500 0x63, 0x00, /* 0110001100 */
4501 0x63, 0x00, /* 0110001100 */
4502 0x63, 0x00, /* 0110001100 */
4503 0x63, 0x00, /* 0110001100 */
4504 0x63, 0x00, /* 0110001100 */
4505 0x63, 0x00, /* 0110001100 */
4506 0x37, 0x80, /* 0011011110 */
4507 0x1c, 0x80, /* 0001110010 */
4508 0x00, 0x00, /* 0000000000 */
4509 0x00, 0x00, /* 0000000000 */
4510 0x00, 0x00, /* 0000000000 */
4511
4512 /* 225 0xe1 '.' */
4513 0x00, 0x00, /* 0000000000 */
4514 0x1e, 0x00, /* 0001111000 */
4515 0x33, 0x00, /* 0011001100 */
4516 0x61, 0x80, /* 0110000110 */
4517 0x61, 0x80, /* 0110000110 */
4518 0x61, 0x80, /* 0110000110 */
4519 0x63, 0x00, /* 0110001100 */
4520 0x6f, 0x00, /* 0110111100 */
4521 0x63, 0x00, /* 0110001100 */
4522 0x61, 0x80, /* 0110000110 */
4523 0x61, 0x80, /* 0110000110 */
4524 0x61, 0x80, /* 0110000110 */
4525 0x61, 0x80, /* 0110000110 */
4526 0x63, 0x00, /* 0110001100 */
4527 0x6e, 0x00, /* 0110111000 */
4528 0x00, 0x00, /* 0000000000 */
4529 0x00, 0x00, /* 0000000000 */
4530 0x00, 0x00, /* 0000000000 */
4531
4532 /* 226 0xe2 '.' */
4533 0x00, 0x00, /* 0000000000 */
4534 0x7f, 0x80, /* 0111111110 */
4535 0x61, 0x80, /* 0110000110 */
4536 0x61, 0x80, /* 0110000110 */
4537 0x60, 0x00, /* 0110000000 */
4538 0x60, 0x00, /* 0110000000 */
4539 0x60, 0x00, /* 0110000000 */
4540 0x60, 0x00, /* 0110000000 */
4541 0x60, 0x00, /* 0110000000 */
4542 0x60, 0x00, /* 0110000000 */
4543 0x60, 0x00, /* 0110000000 */
4544 0x60, 0x00, /* 0110000000 */
4545 0x60, 0x00, /* 0110000000 */
4546 0x60, 0x00, /* 0110000000 */
4547 0x60, 0x00, /* 0110000000 */
4548 0x00, 0x00, /* 0000000000 */
4549 0x00, 0x00, /* 0000000000 */
4550 0x00, 0x00, /* 0000000000 */
4551
4552 /* 227 0xe3 '.' */
4553 0x00, 0x00, /* 0000000000 */
4554 0x00, 0x00, /* 0000000000 */
4555 0x00, 0x00, /* 0000000000 */
4556 0x00, 0x00, /* 0000000000 */
4557 0x00, 0x00, /* 0000000000 */
4558 0x00, 0x00, /* 0000000000 */
4559 0x7f, 0x80, /* 0111111110 */
4560 0x33, 0x00, /* 0011001100 */
4561 0x33, 0x00, /* 0011001100 */
4562 0x33, 0x00, /* 0011001100 */
4563 0x33, 0x00, /* 0011001100 */
4564 0x33, 0x00, /* 0011001100 */
4565 0x33, 0x00, /* 0011001100 */
4566 0x33, 0x00, /* 0011001100 */
4567 0x33, 0x00, /* 0011001100 */
4568 0x00, 0x00, /* 0000000000 */
4569 0x00, 0x00, /* 0000000000 */
4570 0x00, 0x00, /* 0000000000 */
4571
4572 /* 228 0xe4 '.' */
4573 0x00, 0x00, /* 0000000000 */
4574 0x00, 0x00, /* 0000000000 */
4575 0xff, 0x80, /* 1111111110 */
4576 0x60, 0x00, /* 0110000000 */
4577 0x30, 0x00, /* 0011000000 */
4578 0x30, 0x00, /* 0011000000 */
4579 0x18, 0x00, /* 0001100000 */
4580 0x18, 0x00, /* 0001100000 */
4581 0x0c, 0x00, /* 0000110000 */
4582 0x0c, 0x00, /* 0000110000 */
4583 0x18, 0x00, /* 0001100000 */
4584 0x30, 0x00, /* 0011000000 */
4585 0x30, 0x80, /* 0011000010 */
4586 0x61, 0x80, /* 0110000110 */
4587 0xff, 0x80, /* 1111111110 */
4588 0x00, 0x00, /* 0000000000 */
4589 0x00, 0x00, /* 0000000000 */
4590 0x00, 0x00, /* 0000000000 */
4591
4592 /* 229 0xe5 '.' */
4593 0x00, 0x00, /* 0000000000 */
4594 0x00, 0x00, /* 0000000000 */
4595 0x00, 0x00, /* 0000000000 */
4596 0x00, 0x00, /* 0000000000 */
4597 0x00, 0x00, /* 0000000000 */
4598 0x00, 0x00, /* 0000000000 */
4599 0x00, 0x00, /* 0000000000 */
4600 0x1f, 0xc0, /* 0001111111 */
4601 0x36, 0x00, /* 0011011000 */
4602 0x63, 0x00, /* 0110001100 */
4603 0x61, 0x80, /* 0110000110 */
4604 0x61, 0x80, /* 0110000110 */
4605 0x61, 0x80, /* 0110000110 */
4606 0x33, 0x00, /* 0011001100 */
4607 0x3e, 0x00, /* 0011111000 */
4608 0x00, 0x00, /* 0000000000 */
4609 0x00, 0x00, /* 0000000000 */
4610 0x00, 0x00, /* 0000000000 */
4611
4612 /* 230 0xe6 '.' */
4613 0x00, 0x00, /* 0000000000 */
4614 0x00, 0x00, /* 0000000000 */
4615 0x00, 0x00, /* 0000000000 */
4616 0x61, 0x80, /* 0110000110 */
4617 0x61, 0x80, /* 0110000110 */
4618 0x61, 0x80, /* 0110000110 */
4619 0x61, 0x80, /* 0110000110 */
4620 0x61, 0x80, /* 0110000110 */
4621 0x61, 0x80, /* 0110000110 */
4622 0x61, 0x80, /* 0110000110 */
4623 0x61, 0x80, /* 0110000110 */
4624 0x73, 0x80, /* 0111001110 */
4625 0x6d, 0x80, /* 0110110110 */
4626 0x60, 0x00, /* 0110000000 */
4627 0x60, 0x00, /* 0110000000 */
4628 0x60, 0x00, /* 0110000000 */
4629 0x60, 0x00, /* 0110000000 */
4630 0xc0, 0x00, /* 1100000000 */
4631
4632 /* 231 0xe7 '.' */
4633 0x00, 0x00, /* 0000000000 */
4634 0x00, 0x00, /* 0000000000 */
4635 0x00, 0x00, /* 0000000000 */
4636 0x01, 0x80, /* 0000000110 */
4637 0x36, 0x40, /* 0011011001 */
4638 0x5e, 0x00, /* 0101111000 */
4639 0x8c, 0x00, /* 1000110000 */
4640 0x0c, 0x00, /* 0000110000 */
4641 0x0c, 0x00, /* 0000110000 */
4642 0x0c, 0x00, /* 0000110000 */
4643 0x0c, 0x00, /* 0000110000 */
4644 0x0c, 0x00, /* 0000110000 */
4645 0x0c, 0x00, /* 0000110000 */
4646 0x0c, 0x00, /* 0000110000 */
4647 0x0c, 0x00, /* 0000110000 */
4648 0x00, 0x00, /* 0000000000 */
4649 0x00, 0x00, /* 0000000000 */
4650 0x00, 0x00, /* 0000000000 */
4651
4652 /* 232 0xe8 '.' */
4653 0x00, 0x00, /* 0000000000 */
4654 0x00, 0x00, /* 0000000000 */
4655 0x7f, 0x80, /* 0111111110 */
4656 0x0c, 0x00, /* 0000110000 */
4657 0x0c, 0x00, /* 0000110000 */
4658 0x1e, 0x00, /* 0001111000 */
4659 0x33, 0x00, /* 0011001100 */
4660 0x61, 0x80, /* 0110000110 */
4661 0x61, 0x80, /* 0110000110 */
4662 0x61, 0x80, /* 0110000110 */
4663 0x33, 0x00, /* 0011001100 */
4664 0x1e, 0x00, /* 0001111000 */
4665 0x0c, 0x00, /* 0000110000 */
4666 0x0c, 0x00, /* 0000110000 */
4667 0x7f, 0x80, /* 0111111110 */
4668 0x00, 0x00, /* 0000000000 */
4669 0x00, 0x00, /* 0000000000 */
4670 0x00, 0x00, /* 0000000000 */
4671
4672 /* 233 0xe9 '.' */
4673 0x00, 0x00, /* 0000000000 */
4674 0x00, 0x00, /* 0000000000 */
4675 0x00, 0x00, /* 0000000000 */
4676 0x0e, 0x00, /* 0000111000 */
4677 0x1f, 0x00, /* 0001111100 */
4678 0x31, 0x80, /* 0011000110 */
4679 0x31, 0x80, /* 0011000110 */
4680 0x60, 0xc0, /* 0110000011 */
4681 0x7f, 0xc0, /* 0111111111 */
4682 0x7f, 0xc0, /* 0111111111 */
4683 0x60, 0xc0, /* 0110000011 */
4684 0x31, 0x80, /* 0011000110 */
4685 0x31, 0x80, /* 0011000110 */
4686 0x1f, 0x00, /* 0001111100 */
4687 0x0e, 0x00, /* 0000111000 */
4688 0x00, 0x00, /* 0000000000 */
4689 0x00, 0x00, /* 0000000000 */
4690 0x00, 0x00, /* 0000000000 */
4691
4692 /* 234 0xea '.' */
4693 0x00, 0x00, /* 0000000000 */
4694 0x00, 0x00, /* 0000000000 */
4695 0x00, 0x00, /* 0000000000 */
4696 0x00, 0x00, /* 0000000000 */
4697 0x1e, 0x00, /* 0001111000 */
4698 0x33, 0x00, /* 0011001100 */
4699 0x61, 0x80, /* 0110000110 */
4700 0xc0, 0xc0, /* 1100000011 */
4701 0xc0, 0xc0, /* 1100000011 */
4702 0xc0, 0xc0, /* 1100000011 */
4703 0x61, 0x80, /* 0110000110 */
4704 0x33, 0x00, /* 0011001100 */
4705 0x33, 0x00, /* 0011001100 */
4706 0x33, 0x00, /* 0011001100 */
4707 0x33, 0x00, /* 0011001100 */
4708 0xf3, 0xc0, /* 1111001111 */
4709 0x00, 0x00, /* 0000000000 */
4710 0x00, 0x00, /* 0000000000 */
4711
4712 /* 235 0xeb '.' */
4713 0x00, 0x00, /* 0000000000 */
4714 0x07, 0x00, /* 0000011100 */
4715 0x1f, 0x80, /* 0001111110 */
4716 0x30, 0xc0, /* 0011000011 */
4717 0x30, 0x00, /* 0011000000 */
4718 0x18, 0x00, /* 0001100000 */
4719 0x0c, 0x00, /* 0000110000 */
4720 0x0c, 0x00, /* 0000110000 */
4721 0x3e, 0x00, /* 0011111000 */
4722 0x66, 0x00, /* 0110011000 */
4723 0xc3, 0x00, /* 1100001100 */
4724 0xc3, 0x00, /* 1100001100 */
4725 0xc3, 0x00, /* 1100001100 */
4726 0x66, 0x00, /* 0110011000 */
4727 0x3c, 0x00, /* 0011110000 */
4728 0x18, 0x00, /* 0001100000 */
4729 0x00, 0x00, /* 0000000000 */
4730 0x00, 0x00, /* 0000000000 */
4731
4732 /* 236 0xec '.' */
4733 0x00, 0x00, /* 0000000000 */
4734 0x00, 0x00, /* 0000000000 */
4735 0x00, 0x00, /* 0000000000 */
4736 0x00, 0x00, /* 0000000000 */
4737 0x00, 0x00, /* 0000000000 */
4738 0x33, 0x00, /* 0011001100 */
4739 0x6d, 0x80, /* 0110110110 */
4740 0xcc, 0xc0, /* 1100110011 */
4741 0xcc, 0xc0, /* 1100110011 */
4742 0xcc, 0xc0, /* 1100110011 */
4743 0xcc, 0xc0, /* 1100110011 */
4744 0x6d, 0x80, /* 0110110110 */
4745 0x33, 0x00, /* 0011001100 */
4746 0x00, 0x00, /* 0000000000 */
4747 0x00, 0x00, /* 0000000000 */
4748 0x00, 0x00, /* 0000000000 */
4749 0x00, 0x00, /* 0000000000 */
4750 0x00, 0x00, /* 0000000000 */
4751
4752 /* 237 0xed '.' */
4753 0x00, 0x00, /* 0000000000 */
4754 0x01, 0x80, /* 0000000110 */
4755 0x01, 0x80, /* 0000000110 */
4756 0x03, 0x00, /* 0000001100 */
4757 0x03, 0x00, /* 0000001100 */
4758 0x37, 0x00, /* 0011011100 */
4759 0x6d, 0x80, /* 0110110110 */
4760 0xcc, 0xc0, /* 1100110011 */
4761 0xcc, 0xc0, /* 1100110011 */
4762 0xcc, 0xc0, /* 1100110011 */
4763 0xcc, 0xc0, /* 1100110011 */
4764 0x6d, 0x80, /* 0110110110 */
4765 0x3b, 0x00, /* 0011101100 */
4766 0x30, 0x00, /* 0011000000 */
4767 0x30, 0x00, /* 0011000000 */
4768 0x60, 0x00, /* 0110000000 */
4769 0x60, 0x00, /* 0110000000 */
4770 0x00, 0x00, /* 0000000000 */
4771
4772 /* 238 0xee '.' */
4773 0x00, 0x00, /* 0000000000 */
4774 0x03, 0x80, /* 0000001110 */
4775 0x0e, 0x00, /* 0000111000 */
4776 0x18, 0x00, /* 0001100000 */
4777 0x18, 0x00, /* 0001100000 */
4778 0x30, 0x00, /* 0011000000 */
4779 0x30, 0x00, /* 0011000000 */
4780 0x3f, 0x80, /* 0011111110 */
4781 0x3f, 0x80, /* 0011111110 */
4782 0x30, 0x00, /* 0011000000 */
4783 0x30, 0x00, /* 0011000000 */
4784 0x18, 0x00, /* 0001100000 */
4785 0x18, 0x00, /* 0001100000 */
4786 0x0e, 0x00, /* 0000111000 */
4787 0x03, 0x80, /* 0000001110 */
4788 0x00, 0x00, /* 0000000000 */
4789 0x00, 0x00, /* 0000000000 */
4790 0x00, 0x00, /* 0000000000 */
4791
4792 /* 239 0xef '.' */
4793 0x00, 0x00, /* 0000000000 */
4794 0x00, 0x00, /* 0000000000 */
4795 0x00, 0x00, /* 0000000000 */
4796 0x00, 0x00, /* 0000000000 */
4797 0x1e, 0x00, /* 0001111000 */
4798 0x33, 0x00, /* 0011001100 */
4799 0x61, 0x80, /* 0110000110 */
4800 0x61, 0x80, /* 0110000110 */
4801 0x61, 0x80, /* 0110000110 */
4802 0x61, 0x80, /* 0110000110 */
4803 0x61, 0x80, /* 0110000110 */
4804 0x61, 0x80, /* 0110000110 */
4805 0x61, 0x80, /* 0110000110 */
4806 0x61, 0x80, /* 0110000110 */
4807 0x61, 0x80, /* 0110000110 */
4808 0x00, 0x00, /* 0000000000 */
4809 0x00, 0x00, /* 0000000000 */
4810 0x00, 0x00, /* 0000000000 */
4811
4812 /* 240 0xf0 '.' */
4813 0x00, 0x00, /* 0000000000 */
4814 0x00, 0x00, /* 0000000000 */
4815 0x00, 0x00, /* 0000000000 */
4816 0x00, 0x00, /* 0000000000 */
4817 0x00, 0x00, /* 0000000000 */
4818 0x7f, 0x80, /* 0111111110 */
4819 0x7f, 0x80, /* 0111111110 */
4820 0x00, 0x00, /* 0000000000 */
4821 0x00, 0x00, /* 0000000000 */
4822 0x7f, 0x80, /* 0111111110 */
4823 0x7f, 0x80, /* 0111111110 */
4824 0x00, 0x00, /* 0000000000 */
4825 0x00, 0x00, /* 0000000000 */
4826 0x7f, 0x80, /* 0111111110 */
4827 0x7f, 0x80, /* 0111111110 */
4828 0x00, 0x00, /* 0000000000 */
4829 0x00, 0x00, /* 0000000000 */
4830 0x00, 0x00, /* 0000000000 */
4831
4832 /* 241 0xf1 '.' */
4833 0x00, 0x00, /* 0000000000 */
4834 0x00, 0x00, /* 0000000000 */
4835 0x0c, 0x00, /* 0000110000 */
4836 0x0c, 0x00, /* 0000110000 */
4837 0x0c, 0x00, /* 0000110000 */
4838 0x0c, 0x00, /* 0000110000 */
4839 0x7f, 0x80, /* 0111111110 */
4840 0x7f, 0x80, /* 0111111110 */
4841 0x0c, 0x00, /* 0000110000 */
4842 0x0c, 0x00, /* 0000110000 */
4843 0x0c, 0x00, /* 0000110000 */
4844 0x0c, 0x00, /* 0000110000 */
4845 0x00, 0x00, /* 0000000000 */
4846 0x7f, 0x80, /* 0111111110 */
4847 0x7f, 0x80, /* 0111111110 */
4848 0x00, 0x00, /* 0000000000 */
4849 0x00, 0x00, /* 0000000000 */
4850 0x00, 0x00, /* 0000000000 */
4851
4852 /* 242 0xf2 '.' */
4853 0x00, 0x00, /* 0000000000 */
4854 0x00, 0x00, /* 0000000000 */
4855 0x00, 0x00, /* 0000000000 */
4856 0x00, 0x00, /* 0000000000 */
4857 0x00, 0x00, /* 0000000000 */
4858 0xe0, 0x00, /* 1110000000 */
4859 0x38, 0x00, /* 0011100000 */
4860 0x0e, 0x00, /* 0000111000 */
4861 0x03, 0x80, /* 0000001110 */
4862 0x0e, 0x00, /* 0000111000 */
4863 0x38, 0x00, /* 0011100000 */
4864 0xe0, 0x00, /* 1110000000 */
4865 0x00, 0x00, /* 0000000000 */
4866 0xff, 0x00, /* 1111111100 */
4867 0xff, 0x00, /* 1111111100 */
4868 0x00, 0x00, /* 0000000000 */
4869 0x00, 0x00, /* 0000000000 */
4870 0x00, 0x00, /* 0000000000 */
4871
4872 /* 243 0xf3 '.' */
4873 0x00, 0x00, /* 0000000000 */
4874 0x00, 0x00, /* 0000000000 */
4875 0x00, 0x00, /* 0000000000 */
4876 0x00, 0x00, /* 0000000000 */
4877 0x00, 0x00, /* 0000000000 */
4878 0x03, 0x80, /* 0000001110 */
4879 0x0e, 0x00, /* 0000111000 */
4880 0x38, 0x00, /* 0011100000 */
4881 0xe0, 0x00, /* 1110000000 */
4882 0x38, 0x00, /* 0011100000 */
4883 0x0e, 0x00, /* 0000111000 */
4884 0x03, 0x80, /* 0000001110 */
4885 0x00, 0x00, /* 0000000000 */
4886 0xff, 0x80, /* 1111111110 */
4887 0xff, 0x80, /* 1111111110 */
4888 0x00, 0x00, /* 0000000000 */
4889 0x00, 0x00, /* 0000000000 */
4890 0x00, 0x00, /* 0000000000 */
4891
4892 /* 244 0xf4 '.' */
4893 0x00, 0x00, /* 0000000000 */
4894 0x00, 0x00, /* 0000000000 */
4895 0x1e, 0x00, /* 0001111000 */
4896 0x33, 0x00, /* 0011001100 */
4897 0x33, 0x00, /* 0011001100 */
4898 0x30, 0x00, /* 0011000000 */
4899 0x30, 0x00, /* 0011000000 */
4900 0x30, 0x00, /* 0011000000 */
4901 0x30, 0x00, /* 0011000000 */
4902 0x30, 0x00, /* 0011000000 */
4903 0x30, 0x00, /* 0011000000 */
4904 0x30, 0x00, /* 0011000000 */
4905 0x30, 0x00, /* 0011000000 */
4906 0x30, 0x00, /* 0011000000 */
4907 0x30, 0x00, /* 0011000000 */
4908 0x30, 0x00, /* 0011000000 */
4909 0x30, 0x00, /* 0011000000 */
4910 0x00, 0x00, /* 0000000000 */
4911
4912 /* 245 0xf5 '.' */
4913 0x00, 0x00, /* 0000000000 */
4914 0x00, 0x00, /* 0000000000 */
4915 0x1e, 0x00, /* 0001111000 */
4916 0x33, 0x00, /* 0011001100 */
4917 0x33, 0x00, /* 0011001100 */
4918 0x03, 0x00, /* 0000001100 */
4919 0x03, 0x00, /* 0000001100 */
4920 0x03, 0x00, /* 0000001100 */
4921 0x03, 0x00, /* 0000001100 */
4922 0x03, 0x00, /* 0000001100 */
4923 0x03, 0x00, /* 0000001100 */
4924 0x03, 0x00, /* 0000001100 */
4925 0x03, 0x00, /* 0000001100 */
4926 0x03, 0x00, /* 0000001100 */
4927 0x03, 0x00, /* 0000001100 */
4928 0x03, 0x00, /* 0000001100 */
4929 0x03, 0x00, /* 0000001100 */
4930 0x00, 0x00, /* 0000000000 */
4931
4932 /* 246 0xf6 '.' */
4933 0x00, 0x00, /* 0000000000 */
4934 0x00, 0x00, /* 0000000000 */
4935 0x00, 0x00, /* 0000000000 */
4936 0x00, 0x00, /* 0000000000 */
4937 0x00, 0x00, /* 0000000000 */
4938 0x0c, 0x00, /* 0000110000 */
4939 0x0c, 0x00, /* 0000110000 */
4940 0x00, 0x00, /* 0000000000 */
4941 0x00, 0x00, /* 0000000000 */
4942 0x7f, 0x80, /* 0111111110 */
4943 0x7f, 0x80, /* 0111111110 */
4944 0x00, 0x00, /* 0000000000 */
4945 0x00, 0x00, /* 0000000000 */
4946 0x0c, 0x00, /* 0000110000 */
4947 0x0c, 0x00, /* 0000110000 */
4948 0x00, 0x00, /* 0000000000 */
4949 0x00, 0x00, /* 0000000000 */
4950 0x00, 0x00, /* 0000000000 */
4951
4952 /* 247 0xf7 '.' */
4953 0x00, 0x00, /* 0000000000 */
4954 0x00, 0x00, /* 0000000000 */
4955 0x00, 0x00, /* 0000000000 */
4956 0x00, 0x00, /* 0000000000 */
4957 0x00, 0x00, /* 0000000000 */
4958 0x00, 0x00, /* 0000000000 */
4959 0x38, 0x00, /* 0011100000 */
4960 0x6c, 0x00, /* 0110110000 */
4961 0x06, 0xc0, /* 0000011011 */
4962 0x03, 0x80, /* 0000001110 */
4963 0x38, 0x00, /* 0011100000 */
4964 0x6c, 0x00, /* 0110110000 */
4965 0x06, 0xc0, /* 0000011011 */
4966 0x03, 0x80, /* 0000001110 */
4967 0x00, 0x00, /* 0000000000 */
4968 0x00, 0x00, /* 0000000000 */
4969 0x00, 0x00, /* 0000000000 */
4970 0x00, 0x00, /* 0000000000 */
4971
4972 /* 248 0xf8 '.' */
4973 0x00, 0x00, /* 0000000000 */
4974 0x1e, 0x00, /* 0001111000 */
4975 0x33, 0x00, /* 0011001100 */
4976 0x33, 0x00, /* 0011001100 */
4977 0x1e, 0x00, /* 0001111000 */
4978 0x00, 0x00, /* 0000000000 */
4979 0x00, 0x00, /* 0000000000 */
4980 0x00, 0x00, /* 0000000000 */
4981 0x00, 0x00, /* 0000000000 */
4982 0x00, 0x00, /* 0000000000 */
4983 0x00, 0x00, /* 0000000000 */
4984 0x00, 0x00, /* 0000000000 */
4985 0x00, 0x00, /* 0000000000 */
4986 0x00, 0x00, /* 0000000000 */
4987 0x00, 0x00, /* 0000000000 */
4988 0x00, 0x00, /* 0000000000 */
4989 0x00, 0x00, /* 0000000000 */
4990 0x00, 0x00, /* 0000000000 */
4991
4992 /* 249 0xf9 '.' */
4993 0x00, 0x00, /* 0000000000 */
4994 0x00, 0x00, /* 0000000000 */
4995 0x00, 0x00, /* 0000000000 */
4996 0x00, 0x00, /* 0000000000 */
4997 0x00, 0x00, /* 0000000000 */
4998 0x00, 0x00, /* 0000000000 */
4999 0x00, 0x00, /* 0000000000 */
5000 0x00, 0x00, /* 0000000000 */
5001 0x0c, 0x00, /* 0000110000 */
5002 0x1e, 0x00, /* 0001111000 */
5003 0x1e, 0x00, /* 0001111000 */
5004 0x0c, 0x00, /* 0000110000 */
5005 0x00, 0x00, /* 0000000000 */
5006 0x00, 0x00, /* 0000000000 */
5007 0x00, 0x00, /* 0000000000 */
5008 0x00, 0x00, /* 0000000000 */
5009 0x00, 0x00, /* 0000000000 */
5010 0x00, 0x00, /* 0000000000 */
5011
5012 /* 250 0xfa '.' */
5013 0x00, 0x00, /* 0000000000 */
5014 0x00, 0x00, /* 0000000000 */
5015 0x00, 0x00, /* 0000000000 */
5016 0x00, 0x00, /* 0000000000 */
5017 0x00, 0x00, /* 0000000000 */
5018 0x00, 0x00, /* 0000000000 */
5019 0x00, 0x00, /* 0000000000 */
5020 0x00, 0x00, /* 0000000000 */
5021 0x00, 0x00, /* 0000000000 */
5022 0x0c, 0x00, /* 0000110000 */
5023 0x0c, 0x00, /* 0000110000 */
5024 0x00, 0x00, /* 0000000000 */
5025 0x00, 0x00, /* 0000000000 */
5026 0x00, 0x00, /* 0000000000 */
5027 0x00, 0x00, /* 0000000000 */
5028 0x00, 0x00, /* 0000000000 */
5029 0x00, 0x00, /* 0000000000 */
5030 0x00, 0x00, /* 0000000000 */
5031
5032 /* 251 0xfb '.' */
5033 0x00, 0x00, /* 0000000000 */
5034 0x00, 0x00, /* 0000000000 */
5035 0x0f, 0xc0, /* 0000111111 */
5036 0x0f, 0xc0, /* 0000111111 */
5037 0x0c, 0x00, /* 0000110000 */
5038 0x0c, 0x00, /* 0000110000 */
5039 0x0c, 0x00, /* 0000110000 */
5040 0x0c, 0x00, /* 0000110000 */
5041 0x0c, 0x00, /* 0000110000 */
5042 0x0c, 0x00, /* 0000110000 */
5043 0xcc, 0x00, /* 1100110000 */
5044 0x6c, 0x00, /* 0110110000 */
5045 0x3c, 0x00, /* 0011110000 */
5046 0x1c, 0x00, /* 0001110000 */
5047 0x0c, 0x00, /* 0000110000 */
5048 0x00, 0x00, /* 0000000000 */
5049 0x00, 0x00, /* 0000000000 */
5050 0x00, 0x00, /* 0000000000 */
5051
5052 /* 252 0xfc '.' */
5053 0x00, 0x00, /* 0000000000 */
5054 0x27, 0x00, /* 0010011100 */
5055 0x7b, 0x00, /* 0111101100 */
5056 0x31, 0x00, /* 0011000100 */
5057 0x31, 0x00, /* 0011000100 */
5058 0x31, 0x00, /* 0011000100 */
5059 0x7b, 0x80, /* 0111101110 */
5060 0x00, 0x00, /* 0000000000 */
5061 0x00, 0x00, /* 0000000000 */
5062 0x00, 0x00, /* 0000000000 */
5063 0x00, 0x00, /* 0000000000 */
5064 0x00, 0x00, /* 0000000000 */
5065 0x00, 0x00, /* 0000000000 */
5066 0x00, 0x00, /* 0000000000 */
5067 0x00, 0x00, /* 0000000000 */
5068 0x00, 0x00, /* 0000000000 */
5069 0x00, 0x00, /* 0000000000 */
5070 0x00, 0x00, /* 0000000000 */
5071
5072 /* 253 0xfd '.' */
5073 0x00, 0x00, /* 0000000000 */
5074 0x1e, 0x00, /* 0001111000 */
5075 0x3f, 0x00, /* 0011111100 */
5076 0x63, 0x00, /* 0110001100 */
5077 0x43, 0x00, /* 0100001100 */
5078 0x06, 0x00, /* 0000011000 */
5079 0x0c, 0x00, /* 0000110000 */
5080 0x18, 0x00, /* 0001100000 */
5081 0x30, 0x80, /* 0011000010 */
5082 0x7f, 0x80, /* 0111111110 */
5083 0x7f, 0x80, /* 0111111110 */
5084 0x00, 0x00, /* 0000000000 */
5085 0x00, 0x00, /* 0000000000 */
5086 0x00, 0x00, /* 0000000000 */
5087 0x00, 0x00, /* 0000000000 */
5088 0x00, 0x00, /* 0000000000 */
5089 0x00, 0x00, /* 0000000000 */
5090 0x00, 0x00, /* 0000000000 */
5091
5092 /* 254 0xfe '.' */
5093 0x00, 0x00, /* 0000000000 */
5094 0x00, 0x00, /* 0000000000 */
5095 0x00, 0x00, /* 0000000000 */
5096 0x3f, 0x00, /* 0011111100 */
5097 0x3f, 0x00, /* 0011111100 */
5098 0x3f, 0x00, /* 0011111100 */
5099 0x3f, 0x00, /* 0011111100 */
5100 0x3f, 0x00, /* 0011111100 */
5101 0x3f, 0x00, /* 0011111100 */
5102 0x3f, 0x00, /* 0011111100 */
5103 0x3f, 0x00, /* 0011111100 */
5104 0x3f, 0x00, /* 0011111100 */
5105 0x3f, 0x00, /* 0011111100 */
5106 0x3f, 0x00, /* 0011111100 */
5107 0x3f, 0x00, /* 0011111100 */
5108 0x00, 0x00, /* 0000000000 */
5109 0x00, 0x00, /* 0000000000 */
5110 0x00, 0x00, /* 0000000000 */
5111
5112 /* 255 0xff '.' */
5113 0x00, 0x00, /* 0000000000 */
5114 0x00, 0x00, /* 0000000000 */
5115 0x00, 0x00, /* 0000000000 */
5116 0x00, 0x00, /* 0000000000 */
5117 0x00, 0x00, /* 0000000000 */
5118 0x00, 0x00, /* 0000000000 */
5119 0x00, 0x00, /* 0000000000 */
5120 0x00, 0x00, /* 0000000000 */
5121 0x00, 0x00, /* 0000000000 */
5122 0x00, 0x00, /* 0000000000 */
5123 0x00, 0x00, /* 0000000000 */
5124 0x00, 0x00, /* 0000000000 */
5125 0x00, 0x00, /* 0000000000 */
5126 0x00, 0x00, /* 0000000000 */
5127 0x00, 0x00, /* 0000000000 */
5128 0x00, 0x00, /* 0000000000 */
5129 0x00, 0x00, /* 0000000000 */
5130 0x00, 0x00, /* 0000000000 */
5131
5132};
5133
5134
5135struct font_desc font_10x18 = {
5136 FONT10x18_IDX,
5137 "10x18",
5138 10,
5139 18,
5140 fontdata_10x18,
5141#ifdef __sparc__
5142 5
5143#else
5144 -1
5145#endif
5146};
diff --git a/drivers/video/console/font_7x14.c b/drivers/video/console/font_7x14.c
new file mode 100644
index 000000000000..1fa7fcf2ff72
--- /dev/null
+++ b/drivers/video/console/font_7x14.c
@@ -0,0 +1,4118 @@
1/**************************************/
2/* this file adapted from font_8x16.c */
3/* by Jurriaan Kalkman 05-2005 */
4/**************************************/
5
6#include <linux/font.h>
7
8#define FONTDATAMAX 3584
9
10static unsigned char fontdata_7x14[FONTDATAMAX] = {
11
12 /* 0 0x00 '^@' */
13 0x00, /* 0000000 */
14 0x00, /* 0000000 */
15 0x00, /* 0000000 */
16 0x00, /* 0000000 */
17 0x00, /* 0000000 */
18 0x00, /* 0000000 */
19 0x00, /* 0000000 */
20 0x00, /* 0000000 */
21 0x00, /* 0000000 */
22 0x00, /* 0000000 */
23 0x00, /* 0000000 */
24 0x00, /* 0000000 */
25 0x00, /* 0000000 */
26 0x00, /* 0000000 */
27
28 /* 1 0x01 '^A' */
29 0x00, /* 0000000 */
30 0x7c, /* 0111110 */
31 0x82, /* 1000001 */
32 0xaa, /* 1010101 */
33 0x82, /* 1000001 */
34 0x82, /* 1000001 */
35 0xba, /* 1011101 */
36 0x92, /* 1001001 */
37 0x82, /* 1000001 */
38 0x7c, /* 0111110 */
39 0x00, /* 0000000 */
40 0x00, /* 0000000 */
41 0x00, /* 0000000 */
42 0x00, /* 0000000 */
43
44 /* 2 0x02 '^B' */
45 0x00, /* 0000000 */
46 0x7c, /* 0111110 */
47 0xfe, /* 1111111 */
48 0xd6, /* 1101011 */
49 0xfe, /* 1111111 */
50 0xfe, /* 1111111 */
51 0xc6, /* 1100011 */
52 0xee, /* 1110111 */
53 0xfe, /* 1111111 */
54 0xfe, /* 1111111 */
55 0x7c, /* 0111110 */
56 0x00, /* 0000000 */
57 0x00, /* 0000000 */
58 0x00, /* 0000000 */
59
60 /* 3 0x03 '^C' */
61 0x00, /* 0000000 */
62 0x00, /* 0000000 */
63 0x00, /* 0000000 */
64 0x00, /* 0000000 */
65 0x6c, /* 0110110 */
66 0x7c, /* 0111110 */
67 0xfe, /* 1111111 */
68 0x7c, /* 0111110 */
69 0x38, /* 0011100 */
70 0x18, /* 0001100 */
71 0x10, /* 0001000 */
72 0x00, /* 0000000 */
73 0x00, /* 0000000 */
74 0x00, /* 0000000 */
75
76 /* 4 0x04 '^D' */
77 0x00, /* 0000000 */
78 0x00, /* 0000000 */
79 0x00, /* 0000000 */
80 0x10, /* 0001000 */
81 0x38, /* 0011100 */
82 0x7c, /* 0111110 */
83 0xfe, /* 1111111 */
84 0x7c, /* 0111110 */
85 0x38, /* 0011100 */
86 0x10, /* 0001000 */
87 0x00, /* 0000000 */
88 0x00, /* 0000000 */
89 0x00, /* 0000000 */
90 0x00, /* 0000000 */
91
92 /* 5 0x05 '^E' */
93 0x00, /* 0000000 */
94 0x00, /* 0000000 */
95 0x38, /* 0011100 */
96 0x38, /* 0011100 */
97 0x38, /* 0011100 */
98 0xee, /* 1110111 */
99 0xee, /* 1110111 */
100 0xee, /* 1110111 */
101 0x10, /* 0001000 */
102 0x10, /* 0001000 */
103 0x38, /* 0011100 */
104 0x00, /* 0000000 */
105 0x00, /* 0000000 */
106 0x00, /* 0000000 */
107
108 /* 6 0x06 '^F' */
109 0x00, /* 0000000 */
110 0x00, /* 0000000 */
111 0x10, /* 0001000 */
112 0x38, /* 0011100 */
113 0x7c, /* 0111110 */
114 0xfe, /* 1111111 */
115 0xfe, /* 1111111 */
116 0x7c, /* 0111110 */
117 0x10, /* 0001000 */
118 0x10, /* 0001000 */
119 0x38, /* 0011100 */
120 0x00, /* 0000000 */
121 0x00, /* 0000000 */
122 0x00, /* 0000000 */
123
124 /* 7 0x07 '^G' */
125 0x00, /* 0000000 */
126 0x00, /* 0000000 */
127 0x00, /* 0000000 */
128 0x00, /* 0000000 */
129 0x00, /* 0000000 */
130 0x18, /* 0001100 */
131 0x3c, /* 0011110 */
132 0x3c, /* 0011110 */
133 0x18, /* 0001100 */
134 0x00, /* 0000000 */
135 0x00, /* 0000000 */
136 0x00, /* 0000000 */
137 0x00, /* 0000000 */
138 0x00, /* 0000000 */
139
140 /* 8 0x08 '^H' */
141 0xfe, /* 1111111 */
142 0xfe, /* 1111111 */
143 0xfe, /* 1111111 */
144 0xfe, /* 1111111 */
145 0xfe, /* 1111111 */
146 0xe6, /* 1110011 */
147 0xc2, /* 1100001 */
148 0xc2, /* 1100001 */
149 0xe6, /* 1110011 */
150 0xfe, /* 1111111 */
151 0xfe, /* 1111111 */
152 0xfe, /* 1111111 */
153 0xfe, /* 1111111 */
154 0xfe, /* 1111111 */
155
156 /* 9 0x09 '^I' */
157 0x00, /* 0000000 */
158 0x00, /* 0000000 */
159 0x00, /* 0000000 */
160 0x00, /* 0000000 */
161 0x00, /* 0000000 */
162 0x38, /* 0011100 */
163 0x6c, /* 0110110 */
164 0x44, /* 0100010 */
165 0x6c, /* 0110110 */
166 0x38, /* 0011100 */
167 0x00, /* 0000000 */
168 0x00, /* 0000000 */
169 0x00, /* 0000000 */
170 0x00, /* 0000000 */
171
172 /* 10 0x0a '^J' */
173 0xfe, /* 1111111 */
174 0xfe, /* 1111111 */
175 0xfe, /* 1111111 */
176 0xfe, /* 1111111 */
177 0xfe, /* 1111111 */
178 0xc6, /* 1100011 */
179 0x92, /* 1001001 */
180 0xba, /* 1011101 */
181 0x92, /* 1001001 */
182 0xc6, /* 1100011 */
183 0xfe, /* 1111111 */
184 0xfe, /* 1111111 */
185 0xfe, /* 1111111 */
186 0xfe, /* 1111111 */
187
188 /* 11 0x0b '^K' */
189 0x00, /* 0000000 */
190 0x1e, /* 0001111 */
191 0x0e, /* 0000111 */
192 0x1a, /* 0001101 */
193 0x1a, /* 0001101 */
194 0x78, /* 0111100 */
195 0xcc, /* 1100110 */
196 0xcc, /* 1100110 */
197 0xcc, /* 1100110 */
198 0xcc, /* 1100110 */
199 0x78, /* 0111100 */
200 0x00, /* 0000000 */
201 0x00, /* 0000000 */
202 0x00, /* 0000000 */
203
204 /* 12 0x0c '^L' */
205 0x00, /* 0000000 */
206 0x3c, /* 0011110 */
207 0x66, /* 0110011 */
208 0x66, /* 0110011 */
209 0x66, /* 0110011 */
210 0x66, /* 0110011 */
211 0x3c, /* 0011110 */
212 0x18, /* 0001100 */
213 0x7e, /* 0111111 */
214 0x18, /* 0001100 */
215 0x18, /* 0001100 */
216 0x00, /* 0000000 */
217 0x00, /* 0000000 */
218 0x00, /* 0000000 */
219
220 /* 13 0x0d '^M' */
221 0x00, /* 0000000 */
222 0x3e, /* 0011111 */
223 0x36, /* 0011011 */
224 0x3e, /* 0011111 */
225 0x30, /* 0011000 */
226 0x30, /* 0011000 */
227 0x30, /* 0011000 */
228 0x30, /* 0011000 */
229 0x70, /* 0111000 */
230 0xf0, /* 1111000 */
231 0xe0, /* 1110000 */
232 0x00, /* 0000000 */
233 0x00, /* 0000000 */
234 0x00, /* 0000000 */
235
236 /* 14 0x0e '^N' */
237 0x00, /* 0000000 */
238 0x7e, /* 0111111 */
239 0x66, /* 0110011 */
240 0x7e, /* 0111111 */
241 0x66, /* 0110011 */
242 0x66, /* 0110011 */
243 0x66, /* 0110011 */
244 0x66, /* 0110011 */
245 0x6e, /* 0110111 */
246 0xee, /* 1110111 */
247 0xec, /* 1110110 */
248 0xc0, /* 1100000 */
249 0x00, /* 0000000 */
250 0x00, /* 0000000 */
251
252 /* 15 0x0f '^O' */
253 0x00, /* 0000000 */
254 0x00, /* 0000000 */
255 0x10, /* 0001000 */
256 0x10, /* 0001000 */
257 0xd6, /* 1101011 */
258 0x38, /* 0011100 */
259 0xee, /* 1110111 */
260 0x38, /* 0011100 */
261 0xd6, /* 1101011 */
262 0x10, /* 0001000 */
263 0x10, /* 0001000 */
264 0x00, /* 0000000 */
265 0x00, /* 0000000 */
266 0x00, /* 0000000 */
267
268 /* 16 0x10 '^P' */
269 0x00, /* 0000000 */
270 0x80, /* 1000000 */
271 0xc0, /* 1100000 */
272 0xe0, /* 1110000 */
273 0xf0, /* 1111000 */
274 0xfc, /* 1111110 */
275 0xf0, /* 1111000 */
276 0xe0, /* 1110000 */
277 0xc0, /* 1100000 */
278 0x80, /* 1000000 */
279 0x00, /* 0000000 */
280 0x00, /* 0000000 */
281 0x00, /* 0000000 */
282 0x00, /* 0000000 */
283
284 /* 17 0x11 '^Q' */
285 0x00, /* 0000000 */
286 0x04, /* 0000010 */
287 0x0c, /* 0000110 */
288 0x1c, /* 0001110 */
289 0x3c, /* 0011110 */
290 0xfc, /* 1111110 */
291 0x3c, /* 0011110 */
292 0x1c, /* 0001110 */
293 0x0c, /* 0000110 */
294 0x04, /* 0000010 */
295 0x00, /* 0000000 */
296 0x00, /* 0000000 */
297 0x00, /* 0000000 */
298 0x00, /* 0000000 */
299
300 /* 18 0x12 '^R' */
301 0x00, /* 0000000 */
302 0x18, /* 0001100 */
303 0x3c, /* 0011110 */
304 0x7e, /* 0111111 */
305 0x18, /* 0001100 */
306 0x18, /* 0001100 */
307 0x18, /* 0001100 */
308 0x7e, /* 0111111 */
309 0x3c, /* 0011110 */
310 0x18, /* 0001100 */
311 0x00, /* 0000000 */
312 0x00, /* 0000000 */
313 0x00, /* 0000000 */
314 0x00, /* 0000000 */
315
316 /* 19 0x13 '^S' */
317 0x00, /* 0000000 */
318 0x6c, /* 0110110 */
319 0x6c, /* 0110110 */
320 0x6c, /* 0110110 */
321 0x6c, /* 0110110 */
322 0x6c, /* 0110110 */
323 0x6c, /* 0110110 */
324 0x6c, /* 0110110 */
325 0x00, /* 0000000 */
326 0x6c, /* 0110110 */
327 0x6c, /* 0110110 */
328 0x00, /* 0000000 */
329 0x00, /* 0000000 */
330 0x00, /* 0000000 */
331
332 /* 20 0x14 '^T' */
333 0x00, /* 0000000 */
334 0x7e, /* 0111111 */
335 0xd4, /* 1101010 */
336 0xd4, /* 1101010 */
337 0xd4, /* 1101010 */
338 0x74, /* 0111010 */
339 0x14, /* 0001010 */
340 0x14, /* 0001010 */
341 0x14, /* 0001010 */
342 0x14, /* 0001010 */
343 0x16, /* 0001011 */
344 0x00, /* 0000000 */
345 0x00, /* 0000000 */
346 0x00, /* 0000000 */
347
348 /* 21 0x15 '^U' */
349 0x78, /* 0111100 */
350 0xcc, /* 1100110 */
351 0x60, /* 0110000 */
352 0x38, /* 0011100 */
353 0x6c, /* 0110110 */
354 0xc6, /* 1100011 */
355 0xc6, /* 1100011 */
356 0x6c, /* 0110110 */
357 0x38, /* 0011100 */
358 0x18, /* 0001100 */
359 0xcc, /* 1100110 */
360 0x78, /* 0111100 */
361 0x00, /* 0000000 */
362 0x00, /* 0000000 */
363
364 /* 22 0x16 '^V' */
365 0x00, /* 0000000 */
366 0x00, /* 0000000 */
367 0x00, /* 0000000 */
368 0x00, /* 0000000 */
369 0x00, /* 0000000 */
370 0x00, /* 0000000 */
371 0x00, /* 0000000 */
372 0xfc, /* 1111110 */
373 0xfc, /* 1111110 */
374 0xfc, /* 1111110 */
375 0xfc, /* 1111110 */
376 0x00, /* 0000000 */
377 0x00, /* 0000000 */
378 0x00, /* 0000000 */
379
380 /* 23 0x17 '^W' */
381 0x00, /* 0000000 */
382 0x18, /* 0001100 */
383 0x3c, /* 0011110 */
384 0x7e, /* 0111111 */
385 0x18, /* 0001100 */
386 0x18, /* 0001100 */
387 0x18, /* 0001100 */
388 0x7e, /* 0111111 */
389 0x3c, /* 0011110 */
390 0x18, /* 0001100 */
391 0x7e, /* 0111111 */
392 0x00, /* 0000000 */
393 0x00, /* 0000000 */
394 0x00, /* 0000000 */
395
396 /* 24 0x18 '^X' */
397 0x00, /* 0000000 */
398 0x18, /* 0001100 */
399 0x3c, /* 0011110 */
400 0x7e, /* 0111111 */
401 0x18, /* 0001100 */
402 0x18, /* 0001100 */
403 0x18, /* 0001100 */
404 0x18, /* 0001100 */
405 0x18, /* 0001100 */
406 0x18, /* 0001100 */
407 0x18, /* 0001100 */
408 0x00, /* 0000000 */
409 0x00, /* 0000000 */
410 0x00, /* 0000000 */
411
412 /* 25 0x19 '^Y' */
413 0x00, /* 0000000 */
414 0x18, /* 0001100 */
415 0x18, /* 0001100 */
416 0x18, /* 0001100 */
417 0x18, /* 0001100 */
418 0x18, /* 0001100 */
419 0x18, /* 0001100 */
420 0x18, /* 0001100 */
421 0x7e, /* 0111111 */
422 0x3c, /* 0011110 */
423 0x18, /* 0001100 */
424 0x00, /* 0000000 */
425 0x00, /* 0000000 */
426 0x00, /* 0000000 */
427
428 /* 26 0x1a '^Z' */
429 0x00, /* 0000000 */
430 0x00, /* 0000000 */
431 0x00, /* 0000000 */
432 0x00, /* 0000000 */
433 0x30, /* 0011000 */
434 0x18, /* 0001100 */
435 0xfc, /* 1111110 */
436 0x18, /* 0001100 */
437 0x30, /* 0011000 */
438 0x00, /* 0000000 */
439 0x00, /* 0000000 */
440 0x00, /* 0000000 */
441 0x00, /* 0000000 */
442 0x00, /* 0000000 */
443
444 /* 27 0x1b '^[' */
445 0x00, /* 0000000 */
446 0x00, /* 0000000 */
447 0x00, /* 0000000 */
448 0x00, /* 0000000 */
449 0x30, /* 0011000 */
450 0x60, /* 0110000 */
451 0xfc, /* 1111110 */
452 0x60, /* 0110000 */
453 0x30, /* 0011000 */
454 0x00, /* 0000000 */
455 0x00, /* 0000000 */
456 0x00, /* 0000000 */
457 0x00, /* 0000000 */
458 0x00, /* 0000000 */
459
460 /* 28 0x1c '^\' */
461 0x00, /* 0000000 */
462 0x00, /* 0000000 */
463 0x00, /* 0000000 */
464 0x00, /* 0000000 */
465 0x00, /* 0000000 */
466 0xc0, /* 1100000 */
467 0xc0, /* 1100000 */
468 0xc0, /* 1100000 */
469 0xfc, /* 1111110 */
470 0x00, /* 0000000 */
471 0x00, /* 0000000 */
472 0x00, /* 0000000 */
473 0x00, /* 0000000 */
474 0x00, /* 0000000 */
475
476 /* 29 0x1d '^]' */
477 0x00, /* 0000000 */
478 0x00, /* 0000000 */
479 0x00, /* 0000000 */
480 0x00, /* 0000000 */
481 0x28, /* 0010100 */
482 0x6c, /* 0110110 */
483 0xfe, /* 1111111 */
484 0x6c, /* 0110110 */
485 0x28, /* 0010100 */
486 0x00, /* 0000000 */
487 0x00, /* 0000000 */
488 0x00, /* 0000000 */
489 0x00, /* 0000000 */
490 0x00, /* 0000000 */
491
492 /* 30 0x1e '^^' */
493 0x00, /* 0000000 */
494 0x00, /* 0000000 */
495 0x00, /* 0000000 */
496 0x00, /* 0000000 */
497 0x30, /* 0011000 */
498 0x30, /* 0011000 */
499 0x78, /* 0111100 */
500 0x78, /* 0111100 */
501 0xfc, /* 1111110 */
502 0xfc, /* 1111110 */
503 0x00, /* 0000000 */
504 0x00, /* 0000000 */
505 0x00, /* 0000000 */
506 0x00, /* 0000000 */
507
508 /* 31 0x1f '^_' */
509 0x00, /* 0000000 */
510 0x00, /* 0000000 */
511 0x00, /* 0000000 */
512 0x00, /* 0000000 */
513 0xfc, /* 1111110 */
514 0xfc, /* 1111110 */
515 0x78, /* 0111100 */
516 0x78, /* 0111100 */
517 0x30, /* 0011000 */
518 0x30, /* 0011000 */
519 0x00, /* 0000000 */
520 0x00, /* 0000000 */
521 0x00, /* 0000000 */
522 0x00, /* 0000000 */
523
524 /* 32 0x20 ' ' */
525 0x00, /* 0000000 */
526 0x00, /* 0000000 */
527 0x00, /* 0000000 */
528 0x00, /* 0000000 */
529 0x00, /* 0000000 */
530 0x00, /* 0000000 */
531 0x00, /* 0000000 */
532 0x00, /* 0000000 */
533 0x00, /* 0000000 */
534 0x00, /* 0000000 */
535 0x00, /* 0000000 */
536 0x00, /* 0000000 */
537 0x00, /* 0000000 */
538 0x00, /* 0000000 */
539
540 /* 33 0x21 '!' */
541 0x00, /* 0000000 */
542 0x18, /* 0001100 */
543 0x3c, /* 0011110 */
544 0x3c, /* 0011110 */
545 0x3c, /* 0011110 */
546 0x18, /* 0001100 */
547 0x18, /* 0001100 */
548 0x18, /* 0001100 */
549 0x00, /* 0000000 */
550 0x18, /* 0001100 */
551 0x18, /* 0001100 */
552 0x00, /* 0000000 */
553 0x00, /* 0000000 */
554 0x00, /* 0000000 */
555
556 /* 34 0x22 '"' */
557 0x00, /* 0000000 */
558 0x6c, /* 0110110 */
559 0x6c, /* 0110110 */
560 0x6c, /* 0110110 */
561 0x28, /* 0010100 */
562 0x00, /* 0000000 */
563 0x00, /* 0000000 */
564 0x00, /* 0000000 */
565 0x00, /* 0000000 */
566 0x00, /* 0000000 */
567 0x00, /* 0000000 */
568 0x00, /* 0000000 */
569 0x00, /* 0000000 */
570 0x00, /* 0000000 */
571
572 /* 35 0x23 '#' */
573 0x00, /* 0000000 */
574 0x6c, /* 0110110 */
575 0x6c, /* 0110110 */
576 0xfe, /* 1111111 */
577 0xfe, /* 1111111 */
578 0x6c, /* 0110110 */
579 0x6c, /* 0110110 */
580 0xfe, /* 1111111 */
581 0xfe, /* 1111111 */
582 0x6c, /* 0110110 */
583 0x6c, /* 0110110 */
584 0x00, /* 0000000 */
585 0x00, /* 0000000 */
586 0x00, /* 0000000 */
587
588 /* 36 0x24 '$' */
589 0x30, /* 0011000 */
590 0x30, /* 0011000 */
591 0x78, /* 0111100 */
592 0xcc, /* 1100110 */
593 0xc4, /* 1100010 */
594 0xc0, /* 1100000 */
595 0x78, /* 0111100 */
596 0x0c, /* 0000110 */
597 0x8c, /* 1000110 */
598 0xcc, /* 1100110 */
599 0x78, /* 0111100 */
600 0x30, /* 0011000 */
601 0x30, /* 0011000 */
602 0x00, /* 0000000 */
603
604 /* 37 0x25 '%' */
605 0x00, /* 0000000 */
606 0x00, /* 0000000 */
607 0x00, /* 0000000 */
608 0xc0, /* 1100000 */
609 0xc4, /* 1100010 */
610 0x0c, /* 0000110 */
611 0x18, /* 0001100 */
612 0x30, /* 0011000 */
613 0x60, /* 0110000 */
614 0xcc, /* 1100110 */
615 0x8c, /* 1000110 */
616 0x00, /* 0000000 */
617 0x00, /* 0000000 */
618 0x00, /* 0000000 */
619
620 /* 38 0x26 '&' */
621 0x00, /* 0000000 */
622 0x38, /* 0011100 */
623 0x6c, /* 0110110 */
624 0x6c, /* 0110110 */
625 0x38, /* 0011100 */
626 0x78, /* 0111100 */
627 0xde, /* 1101111 */
628 0xcc, /* 1100110 */
629 0xcc, /* 1100110 */
630 0xdc, /* 1101110 */
631 0x76, /* 0111011 */
632 0x00, /* 0000000 */
633 0x00, /* 0000000 */
634 0x00, /* 0000000 */
635
636 /* 39 0x27 ''' */
637 0x00, /* 0000000 */
638 0x30, /* 0011000 */
639 0x30, /* 0011000 */
640 0x30, /* 0011000 */
641 0x60, /* 0110000 */
642 0x00, /* 0000000 */
643 0x00, /* 0000000 */
644 0x00, /* 0000000 */
645 0x00, /* 0000000 */
646 0x00, /* 0000000 */
647 0x00, /* 0000000 */
648 0x00, /* 0000000 */
649 0x00, /* 0000000 */
650 0x00, /* 0000000 */
651
652 /* 40 0x28 '(' */
653 0x00, /* 0000000 */
654 0x0c, /* 0000110 */
655 0x18, /* 0001100 */
656 0x30, /* 0011000 */
657 0x30, /* 0011000 */
658 0x30, /* 0011000 */
659 0x30, /* 0011000 */
660 0x30, /* 0011000 */
661 0x30, /* 0011000 */
662 0x18, /* 0001100 */
663 0x0c, /* 0000110 */
664 0x00, /* 0000000 */
665 0x00, /* 0000000 */
666 0x00, /* 0000000 */
667
668 /* 41 0x29 ')' */
669 0x00, /* 0000000 */
670 0x30, /* 0011000 */
671 0x18, /* 0001100 */
672 0x0c, /* 0000110 */
673 0x0c, /* 0000110 */
674 0x0c, /* 0000110 */
675 0x0c, /* 0000110 */
676 0x0c, /* 0000110 */
677 0x0c, /* 0000110 */
678 0x18, /* 0001100 */
679 0x30, /* 0011000 */
680 0x00, /* 0000000 */
681 0x00, /* 0000000 */
682 0x00, /* 0000000 */
683
684 /* 42 0x2a '*' */
685 0x00, /* 0000000 */
686 0x00, /* 0000000 */
687 0x00, /* 0000000 */
688 0x00, /* 0000000 */
689 0x6c, /* 0110110 */
690 0x38, /* 0011100 */
691 0xfe, /* 1111111 */
692 0x38, /* 0011100 */
693 0x6c, /* 0110110 */
694 0x00, /* 0000000 */
695 0x00, /* 0000000 */
696 0x00, /* 0000000 */
697 0x00, /* 0000000 */
698 0x00, /* 0000000 */
699
700 /* 43 0x2b '+' */
701 0x00, /* 0000000 */
702 0x00, /* 0000000 */
703 0x00, /* 0000000 */
704 0x00, /* 0000000 */
705 0x10, /* 0001000 */
706 0x10, /* 0001000 */
707 0x7c, /* 0111110 */
708 0x10, /* 0001000 */
709 0x10, /* 0001000 */
710 0x00, /* 0000000 */
711 0x00, /* 0000000 */
712 0x00, /* 0000000 */
713 0x00, /* 0000000 */
714 0x00, /* 0000000 */
715
716 /* 44 0x2c ',' */
717 0x00, /* 0000000 */
718 0x00, /* 0000000 */
719 0x00, /* 0000000 */
720 0x00, /* 0000000 */
721 0x00, /* 0000000 */
722 0x00, /* 0000000 */
723 0x00, /* 0000000 */
724 0x00, /* 0000000 */
725 0x18, /* 0001100 */
726 0x18, /* 0001100 */
727 0x18, /* 0001100 */
728 0x30, /* 0011000 */
729 0x00, /* 0000000 */
730 0x00, /* 0000000 */
731
732 /* 45 0x2d '-' */
733 0x00, /* 0000000 */
734 0x00, /* 0000000 */
735 0x00, /* 0000000 */
736 0x00, /* 0000000 */
737 0x00, /* 0000000 */
738 0x00, /* 0000000 */
739 0xfc, /* 1111110 */
740 0x00, /* 0000000 */
741 0x00, /* 0000000 */
742 0x00, /* 0000000 */
743 0x00, /* 0000000 */
744 0x00, /* 0000000 */
745 0x00, /* 0000000 */
746 0x00, /* 0000000 */
747
748 /* 46 0x2e '.' */
749 0x00, /* 0000000 */
750 0x00, /* 0000000 */
751 0x00, /* 0000000 */
752 0x00, /* 0000000 */
753 0x00, /* 0000000 */
754 0x00, /* 0000000 */
755 0x00, /* 0000000 */
756 0x00, /* 0000000 */
757 0x00, /* 0000000 */
758 0x18, /* 0001100 */
759 0x18, /* 0001100 */
760 0x00, /* 0000000 */
761 0x00, /* 0000000 */
762 0x00, /* 0000000 */
763
764 /* 47 0x2f '/' */
765 0x00, /* 0000000 */
766 0x00, /* 0000000 */
767 0x00, /* 0000000 */
768 0x00, /* 0000000 */
769 0x04, /* 0000010 */
770 0x0c, /* 0000110 */
771 0x18, /* 0001100 */
772 0x30, /* 0011000 */
773 0x60, /* 0110000 */
774 0xc0, /* 1100000 */
775 0x80, /* 1000000 */
776 0x00, /* 0000000 */
777 0x00, /* 0000000 */
778 0x00, /* 0000000 */
779
780 /* 48 0x30 '0' */
781 0x00, /* 0000000 */
782 0x30, /* 0011000 */
783 0x78, /* 0111100 */
784 0xcc, /* 1100110 */
785 0xcc, /* 1100110 */
786 0xdc, /* 1101110 */
787 0xec, /* 1110110 */
788 0xcc, /* 1100110 */
789 0xcc, /* 1100110 */
790 0x78, /* 0111100 */
791 0x30, /* 0011000 */
792 0x00, /* 0000000 */
793 0x00, /* 0000000 */
794 0x00, /* 0000000 */
795
796 /* 49 0x31 '1' */
797 0x00, /* 0000000 */
798 0x18, /* 0001100 */
799 0x38, /* 0011100 */
800 0x78, /* 0111100 */
801 0x18, /* 0001100 */
802 0x18, /* 0001100 */
803 0x18, /* 0001100 */
804 0x18, /* 0001100 */
805 0x18, /* 0001100 */
806 0x18, /* 0001100 */
807 0x7c, /* 0111110 */
808 0x00, /* 0000000 */
809 0x00, /* 0000000 */
810 0x00, /* 0000000 */
811
812 /* 50 0x32 '2' */
813 0x00, /* 0000000 */
814 0x78, /* 0111100 */
815 0xcc, /* 1100110 */
816 0x0c, /* 0000110 */
817 0x18, /* 0001100 */
818 0x18, /* 0001100 */
819 0x30, /* 0011000 */
820 0x60, /* 0110000 */
821 0xc0, /* 1100000 */
822 0xcc, /* 1100110 */
823 0xfc, /* 1111110 */
824 0x00, /* 0000000 */
825 0x00, /* 0000000 */
826 0x00, /* 0000000 */
827
828 /* 51 0x33 '3' */
829 0x00, /* 0000000 */
830 0x78, /* 0111100 */
831 0xcc, /* 1100110 */
832 0x0c, /* 0000110 */
833 0x0c, /* 0000110 */
834 0x38, /* 0011100 */
835 0x0c, /* 0000110 */
836 0x0c, /* 0000110 */
837 0x0c, /* 0000110 */
838 0xcc, /* 1100110 */
839 0x78, /* 0111100 */
840 0x00, /* 0000000 */
841 0x00, /* 0000000 */
842 0x00, /* 0000000 */
843
844 /* 52 0x34 '4' */
845 0x00, /* 0000000 */
846 0x0c, /* 0000110 */
847 0x1c, /* 0001110 */
848 0x3c, /* 0011110 */
849 0x6c, /* 0110110 */
850 0xcc, /* 1100110 */
851 0xfe, /* 1111111 */
852 0x0c, /* 0000110 */
853 0x0c, /* 0000110 */
854 0x0c, /* 0000110 */
855 0x0c, /* 0000110 */
856 0x00, /* 0000000 */
857 0x00, /* 0000000 */
858 0x00, /* 0000000 */
859
860 /* 53 0x35 '5' */
861 0x00, /* 0000000 */
862 0xfc, /* 1111110 */
863 0xc0, /* 1100000 */
864 0xc0, /* 1100000 */
865 0xc0, /* 1100000 */
866 0xf8, /* 1111100 */
867 0x0c, /* 0000110 */
868 0x0c, /* 0000110 */
869 0x0c, /* 0000110 */
870 0xcc, /* 1100110 */
871 0x78, /* 0111100 */
872 0x00, /* 0000000 */
873 0x00, /* 0000000 */
874 0x00, /* 0000000 */
875
876 /* 54 0x36 '6' */
877 0x00, /* 0000000 */
878 0x30, /* 0011000 */
879 0x60, /* 0110000 */
880 0xc0, /* 1100000 */
881 0xc0, /* 1100000 */
882 0xf8, /* 1111100 */
883 0xcc, /* 1100110 */
884 0xcc, /* 1100110 */
885 0xcc, /* 1100110 */
886 0xcc, /* 1100110 */
887 0x78, /* 0111100 */
888 0x00, /* 0000000 */
889 0x00, /* 0000000 */
890 0x00, /* 0000000 */
891
892 /* 55 0x37 '7' */
893 0x00, /* 0000000 */
894 0xfc, /* 1111110 */
895 0xcc, /* 1100110 */
896 0x0c, /* 0000110 */
897 0x0c, /* 0000110 */
898 0x18, /* 0001100 */
899 0x18, /* 0001100 */
900 0x30, /* 0011000 */
901 0x30, /* 0011000 */
902 0x30, /* 0011000 */
903 0x30, /* 0011000 */
904 0x00, /* 0000000 */
905 0x00, /* 0000000 */
906 0x00, /* 0000000 */
907
908 /* 56 0x38 '8' */
909 0x00, /* 0000000 */
910 0x78, /* 0111100 */
911 0xcc, /* 1100110 */
912 0xcc, /* 1100110 */
913 0xcc, /* 1100110 */
914 0x78, /* 0111100 */
915 0xcc, /* 1100110 */
916 0xcc, /* 1100110 */
917 0xcc, /* 1100110 */
918 0xcc, /* 1100110 */
919 0x78, /* 0111100 */
920 0x00, /* 0000000 */
921 0x00, /* 0000000 */
922 0x00, /* 0000000 */
923
924 /* 57 0x39 '9' */
925 0x00, /* 0000000 */
926 0x78, /* 0111100 */
927 0xcc, /* 1100110 */
928 0xcc, /* 1100110 */
929 0xcc, /* 1100110 */
930 0x7c, /* 0111110 */
931 0x0c, /* 0000110 */
932 0x0c, /* 0000110 */
933 0x0c, /* 0000110 */
934 0x18, /* 0001100 */
935 0x70, /* 0111000 */
936 0x00, /* 0000000 */
937 0x00, /* 0000000 */
938 0x00, /* 0000000 */
939
940 /* 58 0x3a ':' */
941 0x00, /* 0000000 */
942 0x00, /* 0000000 */
943 0x00, /* 0000000 */
944 0x18, /* 0001100 */
945 0x18, /* 0001100 */
946 0x00, /* 0000000 */
947 0x00, /* 0000000 */
948 0x00, /* 0000000 */
949 0x18, /* 0001100 */
950 0x18, /* 0001100 */
951 0x00, /* 0000000 */
952 0x00, /* 0000000 */
953 0x00, /* 0000000 */
954 0x00, /* 0000000 */
955
956 /* 59 0x3b ';' */
957 0x00, /* 0000000 */
958 0x00, /* 0000000 */
959 0x00, /* 0000000 */
960 0x18, /* 0001100 */
961 0x18, /* 0001100 */
962 0x00, /* 0000000 */
963 0x00, /* 0000000 */
964 0x00, /* 0000000 */
965 0x18, /* 0001100 */
966 0x18, /* 0001100 */
967 0x30, /* 0011000 */
968 0x00, /* 0000000 */
969 0x00, /* 0000000 */
970 0x00, /* 0000000 */
971
972 /* 60 0x3c '<' */
973 0x00, /* 0000000 */
974 0x00, /* 0000000 */
975 0x04, /* 0000010 */
976 0x0c, /* 0000110 */
977 0x18, /* 0001100 */
978 0x30, /* 0011000 */
979 0x60, /* 0110000 */
980 0x30, /* 0011000 */
981 0x18, /* 0001100 */
982 0x0c, /* 0000110 */
983 0x04, /* 0000010 */
984 0x00, /* 0000000 */
985 0x00, /* 0000000 */
986 0x00, /* 0000000 */
987
988 /* 61 0x3d '=' */
989 0x00, /* 0000000 */
990 0x00, /* 0000000 */
991 0x00, /* 0000000 */
992 0x00, /* 0000000 */
993 0x7c, /* 0111110 */
994 0x00, /* 0000000 */
995 0x00, /* 0000000 */
996 0x7c, /* 0111110 */
997 0x00, /* 0000000 */
998 0x00, /* 0000000 */
999 0x00, /* 0000000 */
1000 0x00, /* 0000000 */
1001 0x00, /* 0000000 */
1002 0x00, /* 0000000 */
1003
1004 /* 62 0x3e '>' */
1005 0x00, /* 0000000 */
1006 0x00, /* 0000000 */
1007 0x40, /* 0100000 */
1008 0x60, /* 0110000 */
1009 0x30, /* 0011000 */
1010 0x18, /* 0001100 */
1011 0x0c, /* 0000110 */
1012 0x18, /* 0001100 */
1013 0x30, /* 0011000 */
1014 0x60, /* 0110000 */
1015 0x40, /* 0100000 */
1016 0x00, /* 0000000 */
1017 0x00, /* 0000000 */
1018 0x00, /* 0000000 */
1019
1020 /* 63 0x3f '?' */
1021 0x00, /* 0000000 */
1022 0x78, /* 0111100 */
1023 0xcc, /* 1100110 */
1024 0xcc, /* 1100110 */
1025 0x18, /* 0001100 */
1026 0x30, /* 0011000 */
1027 0x30, /* 0011000 */
1028 0x30, /* 0011000 */
1029 0x00, /* 0000000 */
1030 0x30, /* 0011000 */
1031 0x30, /* 0011000 */
1032 0x00, /* 0000000 */
1033 0x00, /* 0000000 */
1034 0x00, /* 0000000 */
1035
1036 /* 64 0x40 '@' */
1037 0x00, /* 0000000 */
1038 0x00, /* 0000000 */
1039 0x00, /* 0000000 */
1040 0x78, /* 0111100 */
1041 0xcc, /* 1100110 */
1042 0xcc, /* 1100110 */
1043 0xdc, /* 1101110 */
1044 0xdc, /* 1101110 */
1045 0xd8, /* 1101100 */
1046 0xc0, /* 1100000 */
1047 0x78, /* 0111100 */
1048 0x00, /* 0000000 */
1049 0x00, /* 0000000 */
1050 0x00, /* 0000000 */
1051
1052 /* 65 0x41 'A' */
1053 0x00, /* 0000000 */
1054 0x30, /* 0011000 */
1055 0x78, /* 0111100 */
1056 0xcc, /* 1100110 */
1057 0xcc, /* 1100110 */
1058 0xcc, /* 1100110 */
1059 0xfc, /* 1111110 */
1060 0xcc, /* 1100110 */
1061 0xcc, /* 1100110 */
1062 0xcc, /* 1100110 */
1063 0xcc, /* 1100110 */
1064 0x00, /* 0000000 */
1065 0x00, /* 0000000 */
1066 0x00, /* 0000000 */
1067
1068 /* 66 0x42 'B' */
1069 0x00, /* 0000000 */
1070 0xf8, /* 1111100 */
1071 0x6c, /* 0110110 */
1072 0x6c, /* 0110110 */
1073 0x6c, /* 0110110 */
1074 0x78, /* 0111100 */
1075 0x6c, /* 0110110 */
1076 0x6c, /* 0110110 */
1077 0x6c, /* 0110110 */
1078 0x6c, /* 0110110 */
1079 0xf8, /* 1111100 */
1080 0x00, /* 0000000 */
1081 0x00, /* 0000000 */
1082 0x00, /* 0000000 */
1083
1084 /* 67 0x43 'C' */
1085 0x00, /* 0000000 */
1086 0x38, /* 0011100 */
1087 0x6c, /* 0110110 */
1088 0xc4, /* 1100010 */
1089 0xc0, /* 1100000 */
1090 0xc0, /* 1100000 */
1091 0xc0, /* 1100000 */
1092 0xc0, /* 1100000 */
1093 0xc4, /* 1100010 */
1094 0x6c, /* 0110110 */
1095 0x38, /* 0011100 */
1096 0x00, /* 0000000 */
1097 0x00, /* 0000000 */
1098 0x00, /* 0000000 */
1099
1100 /* 68 0x44 'D' */
1101 0x00, /* 0000000 */
1102 0xf0, /* 1111000 */
1103 0xd8, /* 1101100 */
1104 0xcc, /* 1100110 */
1105 0xcc, /* 1100110 */
1106 0xcc, /* 1100110 */
1107 0xcc, /* 1100110 */
1108 0xcc, /* 1100110 */
1109 0xcc, /* 1100110 */
1110 0xd8, /* 1101100 */
1111 0xf0, /* 1111000 */
1112 0x00, /* 0000000 */
1113 0x00, /* 0000000 */
1114 0x00, /* 0000000 */
1115
1116 /* 69 0x45 'E' */
1117 0x00, /* 0000000 */
1118 0x7c, /* 0111110 */
1119 0x6c, /* 0110110 */
1120 0x64, /* 0110010 */
1121 0x68, /* 0110100 */
1122 0x78, /* 0111100 */
1123 0x68, /* 0110100 */
1124 0x60, /* 0110000 */
1125 0x64, /* 0110010 */
1126 0x6c, /* 0110110 */
1127 0x7c, /* 0111110 */
1128 0x00, /* 0000000 */
1129 0x00, /* 0000000 */
1130 0x00, /* 0000000 */
1131
1132 /* 70 0x46 'F' */
1133 0x00, /* 0000000 */
1134 0x7c, /* 0111110 */
1135 0x64, /* 0110010 */
1136 0x60, /* 0110000 */
1137 0x68, /* 0110100 */
1138 0x78, /* 0111100 */
1139 0x68, /* 0110100 */
1140 0x60, /* 0110000 */
1141 0x60, /* 0110000 */
1142 0x60, /* 0110000 */
1143 0x70, /* 0111000 */
1144 0x00, /* 0000000 */
1145 0x00, /* 0000000 */
1146 0x00, /* 0000000 */
1147
1148 /* 71 0x47 'G' */
1149 0x00, /* 0000000 */
1150 0x38, /* 0011100 */
1151 0x6c, /* 0110110 */
1152 0xc4, /* 1100010 */
1153 0xc0, /* 1100000 */
1154 0xc0, /* 1100000 */
1155 0xdc, /* 1101110 */
1156 0xcc, /* 1100110 */
1157 0xcc, /* 1100110 */
1158 0x6c, /* 0110110 */
1159 0x34, /* 0011010 */
1160 0x00, /* 0000000 */
1161 0x00, /* 0000000 */
1162 0x00, /* 0000000 */
1163
1164 /* 72 0x48 'H' */
1165 0x00, /* 0000000 */
1166 0xcc, /* 1100110 */
1167 0xcc, /* 1100110 */
1168 0xcc, /* 1100110 */
1169 0xcc, /* 1100110 */
1170 0xfc, /* 1111110 */
1171 0xcc, /* 1100110 */
1172 0xcc, /* 1100110 */
1173 0xcc, /* 1100110 */
1174 0xcc, /* 1100110 */
1175 0xcc, /* 1100110 */
1176 0x00, /* 0000000 */
1177 0x00, /* 0000000 */
1178 0x00, /* 0000000 */
1179
1180 /* 73 0x49 'I' */
1181 0x00, /* 0000000 */
1182 0x3c, /* 0011110 */
1183 0x18, /* 0001100 */
1184 0x18, /* 0001100 */
1185 0x18, /* 0001100 */
1186 0x18, /* 0001100 */
1187 0x18, /* 0001100 */
1188 0x18, /* 0001100 */
1189 0x18, /* 0001100 */
1190 0x18, /* 0001100 */
1191 0x3c, /* 0011110 */
1192 0x00, /* 0000000 */
1193 0x00, /* 0000000 */
1194 0x00, /* 0000000 */
1195
1196 /* 74 0x4a 'J' */
1197 0x00, /* 0000000 */
1198 0x1c, /* 0001110 */
1199 0x0c, /* 0000110 */
1200 0x0c, /* 0000110 */
1201 0x0c, /* 0000110 */
1202 0x0c, /* 0000110 */
1203 0x0c, /* 0000110 */
1204 0xcc, /* 1100110 */
1205 0xcc, /* 1100110 */
1206 0xcc, /* 1100110 */
1207 0x78, /* 0111100 */
1208 0x00, /* 0000000 */
1209 0x00, /* 0000000 */
1210 0x00, /* 0000000 */
1211
1212 /* 75 0x4b 'K' */
1213 0x00, /* 0000000 */
1214 0xcc, /* 1100110 */
1215 0xcc, /* 1100110 */
1216 0xcc, /* 1100110 */
1217 0xd8, /* 1101100 */
1218 0xf0, /* 1111000 */
1219 0xf0, /* 1111000 */
1220 0xd8, /* 1101100 */
1221 0xcc, /* 1100110 */
1222 0xcc, /* 1100110 */
1223 0xcc, /* 1100110 */
1224 0x00, /* 0000000 */
1225 0x00, /* 0000000 */
1226 0x00, /* 0000000 */
1227
1228 /* 76 0x4c 'L' */
1229 0x00, /* 0000000 */
1230 0xc0, /* 1100000 */
1231 0xc0, /* 1100000 */
1232 0xc0, /* 1100000 */
1233 0xc0, /* 1100000 */
1234 0xc0, /* 1100000 */
1235 0xc0, /* 1100000 */
1236 0xc0, /* 1100000 */
1237 0xc4, /* 1100010 */
1238 0xcc, /* 1100110 */
1239 0xfc, /* 1111110 */
1240 0x00, /* 0000000 */
1241 0x00, /* 0000000 */
1242 0x00, /* 0000000 */
1243
1244 /* 77 0x4d 'M' */
1245 0x00, /* 0000000 */
1246 0xc6, /* 1100011 */
1247 0xee, /* 1110111 */
1248 0xfe, /* 1111111 */
1249 0xfe, /* 1111111 */
1250 0xd6, /* 1101011 */
1251 0xc6, /* 1100011 */
1252 0xc6, /* 1100011 */
1253 0xc6, /* 1100011 */
1254 0xc6, /* 1100011 */
1255 0xc6, /* 1100011 */
1256 0x00, /* 0000000 */
1257 0x00, /* 0000000 */
1258 0x00, /* 0000000 */
1259
1260 /* 78 0x4e 'N' */
1261 0x00, /* 0000000 */
1262 0xcc, /* 1100110 */
1263 0xec, /* 1110110 */
1264 0xec, /* 1110110 */
1265 0xfc, /* 1111110 */
1266 0xdc, /* 1101110 */
1267 0xdc, /* 1101110 */
1268 0xcc, /* 1100110 */
1269 0xcc, /* 1100110 */
1270 0xcc, /* 1100110 */
1271 0xcc, /* 1100110 */
1272 0x00, /* 0000000 */
1273 0x00, /* 0000000 */
1274 0x00, /* 0000000 */
1275
1276 /* 79 0x4f 'O' */
1277 0x00, /* 0000000 */
1278 0x78, /* 0111100 */
1279 0xcc, /* 1100110 */
1280 0xcc, /* 1100110 */
1281 0xcc, /* 1100110 */
1282 0xcc, /* 1100110 */
1283 0xcc, /* 1100110 */
1284 0xcc, /* 1100110 */
1285 0xcc, /* 1100110 */
1286 0xcc, /* 1100110 */
1287 0x78, /* 0111100 */
1288 0x00, /* 0000000 */
1289 0x00, /* 0000000 */
1290 0x00, /* 0000000 */
1291
1292 /* 80 0x50 'P' */
1293 0x00, /* 0000000 */
1294 0xf8, /* 1111100 */
1295 0xcc, /* 1100110 */
1296 0xcc, /* 1100110 */
1297 0xcc, /* 1100110 */
1298 0xf8, /* 1111100 */
1299 0xc0, /* 1100000 */
1300 0xc0, /* 1100000 */
1301 0xc0, /* 1100000 */
1302 0xc0, /* 1100000 */
1303 0xc0, /* 1100000 */
1304 0x00, /* 0000000 */
1305 0x00, /* 0000000 */
1306 0x00, /* 0000000 */
1307
1308 /* 81 0x51 'Q' */
1309 0x00, /* 0000000 */
1310 0x78, /* 0111100 */
1311 0xcc, /* 1100110 */
1312 0xcc, /* 1100110 */
1313 0xcc, /* 1100110 */
1314 0xcc, /* 1100110 */
1315 0xcc, /* 1100110 */
1316 0xcc, /* 1100110 */
1317 0xcc, /* 1100110 */
1318 0xdc, /* 1101110 */
1319 0x78, /* 0111100 */
1320 0x18, /* 0001100 */
1321 0x1c, /* 0001110 */
1322 0x00, /* 0000000 */
1323
1324 /* 82 0x52 'R' */
1325 0x00, /* 0000000 */
1326 0xf8, /* 1111100 */
1327 0xcc, /* 1100110 */
1328 0xcc, /* 1100110 */
1329 0xcc, /* 1100110 */
1330 0xf8, /* 1111100 */
1331 0xd8, /* 1101100 */
1332 0xcc, /* 1100110 */
1333 0xcc, /* 1100110 */
1334 0xcc, /* 1100110 */
1335 0xcc, /* 1100110 */
1336 0x00, /* 0000000 */
1337 0x00, /* 0000000 */
1338 0x00, /* 0000000 */
1339
1340 /* 83 0x53 'S' */
1341 0x00, /* 0000000 */
1342 0x7c, /* 0111110 */
1343 0xc4, /* 1100010 */
1344 0xc0, /* 1100000 */
1345 0xc0, /* 1100000 */
1346 0x60, /* 0110000 */
1347 0x38, /* 0011100 */
1348 0x0c, /* 0000110 */
1349 0x0c, /* 0000110 */
1350 0x8c, /* 1000110 */
1351 0xf8, /* 1111100 */
1352 0x00, /* 0000000 */
1353 0x00, /* 0000000 */
1354 0x00, /* 0000000 */
1355
1356 /* 84 0x54 'T' */
1357 0x00, /* 0000000 */
1358 0xfc, /* 1111110 */
1359 0xfc, /* 1111110 */
1360 0xb4, /* 1011010 */
1361 0x30, /* 0011000 */
1362 0x30, /* 0011000 */
1363 0x30, /* 0011000 */
1364 0x30, /* 0011000 */
1365 0x30, /* 0011000 */
1366 0x30, /* 0011000 */
1367 0x78, /* 0111100 */
1368 0x00, /* 0000000 */
1369 0x00, /* 0000000 */
1370 0x00, /* 0000000 */
1371
1372 /* 85 0x55 'U' */
1373 0x00, /* 0000000 */
1374 0xcc, /* 1100110 */
1375 0xcc, /* 1100110 */
1376 0xcc, /* 1100110 */
1377 0xcc, /* 1100110 */
1378 0xcc, /* 1100110 */
1379 0xcc, /* 1100110 */
1380 0xcc, /* 1100110 */
1381 0xcc, /* 1100110 */
1382 0xcc, /* 1100110 */
1383 0x78, /* 0111100 */
1384 0x00, /* 0000000 */
1385 0x00, /* 0000000 */
1386 0x00, /* 0000000 */
1387
1388 /* 86 0x56 'V' */
1389 0x00, /* 0000000 */
1390 0xcc, /* 1100110 */
1391 0xcc, /* 1100110 */
1392 0xcc, /* 1100110 */
1393 0xcc, /* 1100110 */
1394 0xcc, /* 1100110 */
1395 0xcc, /* 1100110 */
1396 0xcc, /* 1100110 */
1397 0x78, /* 0111100 */
1398 0x78, /* 0111100 */
1399 0x30, /* 0011000 */
1400 0x00, /* 0000000 */
1401 0x00, /* 0000000 */
1402 0x00, /* 0000000 */
1403
1404 /* 87 0x57 'W' */
1405 0x00, /* 0000000 */
1406 0xcc, /* 1100110 */
1407 0xcc, /* 1100110 */
1408 0xcc, /* 1100110 */
1409 0xcc, /* 1100110 */
1410 0xcc, /* 1100110 */
1411 0xcc, /* 1100110 */
1412 0xcc, /* 1100110 */
1413 0xfc, /* 1111110 */
1414 0xfc, /* 1111110 */
1415 0x48, /* 0100100 */
1416 0x00, /* 0000000 */
1417 0x00, /* 0000000 */
1418 0x00, /* 0000000 */
1419
1420 /* 88 0x58 'X' */
1421 0x00, /* 0000000 */
1422 0xcc, /* 1100110 */
1423 0xcc, /* 1100110 */
1424 0x78, /* 0111100 */
1425 0x78, /* 0111100 */
1426 0x30, /* 0011000 */
1427 0x30, /* 0011000 */
1428 0x78, /* 0111100 */
1429 0x78, /* 0111100 */
1430 0xcc, /* 1100110 */
1431 0xcc, /* 1100110 */
1432 0x00, /* 0000000 */
1433 0x00, /* 0000000 */
1434 0x00, /* 0000000 */
1435
1436 /* 89 0x59 'Y' */
1437 0x00, /* 0000000 */
1438 0xcc, /* 1100110 */
1439 0xcc, /* 1100110 */
1440 0xcc, /* 1100110 */
1441 0xcc, /* 1100110 */
1442 0x78, /* 0111100 */
1443 0x30, /* 0011000 */
1444 0x30, /* 0011000 */
1445 0x30, /* 0011000 */
1446 0x30, /* 0011000 */
1447 0x30, /* 0011000 */
1448 0x00, /* 0000000 */
1449 0x00, /* 0000000 */
1450 0x00, /* 0000000 */
1451
1452 /* 90 0x5a 'Z' */
1453 0x00, /* 0000000 */
1454 0xfc, /* 1111110 */
1455 0xcc, /* 1100110 */
1456 0x8c, /* 1000110 */
1457 0x18, /* 0001100 */
1458 0x18, /* 0001100 */
1459 0x30, /* 0011000 */
1460 0x60, /* 0110000 */
1461 0xc4, /* 1100010 */
1462 0xcc, /* 1100110 */
1463 0xfc, /* 1111110 */
1464 0x00, /* 0000000 */
1465 0x00, /* 0000000 */
1466 0x00, /* 0000000 */
1467
1468 /* 91 0x5b '[' */
1469 0x00, /* 0000000 */
1470 0x78, /* 0111100 */
1471 0x60, /* 0110000 */
1472 0x60, /* 0110000 */
1473 0x60, /* 0110000 */
1474 0x60, /* 0110000 */
1475 0x60, /* 0110000 */
1476 0x60, /* 0110000 */
1477 0x60, /* 0110000 */
1478 0x60, /* 0110000 */
1479 0x78, /* 0111100 */
1480 0x00, /* 0000000 */
1481 0x00, /* 0000000 */
1482 0x00, /* 0000000 */
1483
1484 /* 92 0x5c '\' */
1485 0x00, /* 0000000 */
1486 0x00, /* 0000000 */
1487 0x00, /* 0000000 */
1488 0x80, /* 1000000 */
1489 0xc0, /* 1100000 */
1490 0xe0, /* 1110000 */
1491 0x70, /* 0111000 */
1492 0x38, /* 0011100 */
1493 0x1c, /* 0001110 */
1494 0x0c, /* 0000110 */
1495 0x04, /* 0000010 */
1496 0x00, /* 0000000 */
1497 0x00, /* 0000000 */
1498 0x00, /* 0000000 */
1499
1500 /* 93 0x5d ']' */
1501 0x00, /* 0000000 */
1502 0x78, /* 0111100 */
1503 0x18, /* 0001100 */
1504 0x18, /* 0001100 */
1505 0x18, /* 0001100 */
1506 0x18, /* 0001100 */
1507 0x18, /* 0001100 */
1508 0x18, /* 0001100 */
1509 0x18, /* 0001100 */
1510 0x18, /* 0001100 */
1511 0x78, /* 0111100 */
1512 0x00, /* 0000000 */
1513 0x00, /* 0000000 */
1514 0x00, /* 0000000 */
1515
1516 /* 94 0x5e '^' */
1517 0x10, /* 0001000 */
1518 0x38, /* 0011100 */
1519 0x6c, /* 0110110 */
1520 0xc6, /* 1100011 */
1521 0x00, /* 0000000 */
1522 0x00, /* 0000000 */
1523 0x00, /* 0000000 */
1524 0x00, /* 0000000 */
1525 0x00, /* 0000000 */
1526 0x00, /* 0000000 */
1527 0x00, /* 0000000 */
1528 0x00, /* 0000000 */
1529 0x00, /* 0000000 */
1530 0x00, /* 0000000 */
1531
1532 /* 95 0x5f '_' */
1533 0x00, /* 0000000 */
1534 0x00, /* 0000000 */
1535 0x00, /* 0000000 */
1536 0x00, /* 0000000 */
1537 0x00, /* 0000000 */
1538 0x00, /* 0000000 */
1539 0x00, /* 0000000 */
1540 0x00, /* 0000000 */
1541 0x00, /* 0000000 */
1542 0x00, /* 0000000 */
1543 0x00, /* 0000000 */
1544 0x00, /* 0000000 */
1545 0xfe, /* 1111111 */
1546 0x00, /* 0000000 */
1547
1548 /* 96 0x60 '`' */
1549 0x00, /* 0000000 */
1550 0x60, /* 0110000 */
1551 0x30, /* 0011000 */
1552 0x18, /* 0001100 */
1553 0x00, /* 0000000 */
1554 0x00, /* 0000000 */
1555 0x00, /* 0000000 */
1556 0x00, /* 0000000 */
1557 0x00, /* 0000000 */
1558 0x00, /* 0000000 */
1559 0x00, /* 0000000 */
1560 0x00, /* 0000000 */
1561 0x00, /* 0000000 */
1562 0x00, /* 0000000 */
1563
1564 /* 97 0x61 'a' */
1565 0x00, /* 0000000 */
1566 0x00, /* 0000000 */
1567 0x00, /* 0000000 */
1568 0x00, /* 0000000 */
1569 0x78, /* 0111100 */
1570 0x0c, /* 0000110 */
1571 0x7c, /* 0111110 */
1572 0xcc, /* 1100110 */
1573 0xcc, /* 1100110 */
1574 0xcc, /* 1100110 */
1575 0x76, /* 0111011 */
1576 0x00, /* 0000000 */
1577 0x00, /* 0000000 */
1578 0x00, /* 0000000 */
1579
1580 /* 98 0x62 'b' */
1581 0x00, /* 0000000 */
1582 0xc0, /* 1100000 */
1583 0xc0, /* 1100000 */
1584 0xc0, /* 1100000 */
1585 0xf0, /* 1111000 */
1586 0xd8, /* 1101100 */
1587 0xcc, /* 1100110 */
1588 0xcc, /* 1100110 */
1589 0xcc, /* 1100110 */
1590 0xcc, /* 1100110 */
1591 0xf8, /* 1111100 */
1592 0x00, /* 0000000 */
1593 0x00, /* 0000000 */
1594 0x00, /* 0000000 */
1595
1596 /* 99 0x63 'c' */
1597 0x00, /* 0000000 */
1598 0x00, /* 0000000 */
1599 0x00, /* 0000000 */
1600 0x00, /* 0000000 */
1601 0x78, /* 0111100 */
1602 0xcc, /* 1100110 */
1603 0xc0, /* 1100000 */
1604 0xc0, /* 1100000 */
1605 0xc0, /* 1100000 */
1606 0xcc, /* 1100110 */
1607 0x78, /* 0111100 */
1608 0x00, /* 0000000 */
1609 0x00, /* 0000000 */
1610 0x00, /* 0000000 */
1611
1612 /* 100 0x64 'd' */
1613 0x00, /* 0000000 */
1614 0x1c, /* 0001110 */
1615 0x0c, /* 0000110 */
1616 0x0c, /* 0000110 */
1617 0x3c, /* 0011110 */
1618 0x6c, /* 0110110 */
1619 0xcc, /* 1100110 */
1620 0xcc, /* 1100110 */
1621 0xcc, /* 1100110 */
1622 0xcc, /* 1100110 */
1623 0x76, /* 0111011 */
1624 0x00, /* 0000000 */
1625 0x00, /* 0000000 */
1626 0x00, /* 0000000 */
1627
1628 /* 101 0x65 'e' */
1629 0x00, /* 0000000 */
1630 0x00, /* 0000000 */
1631 0x00, /* 0000000 */
1632 0x00, /* 0000000 */
1633 0x78, /* 0111100 */
1634 0xcc, /* 1100110 */
1635 0xfc, /* 1111110 */
1636 0xc0, /* 1100000 */
1637 0xc0, /* 1100000 */
1638 0xcc, /* 1100110 */
1639 0x78, /* 0111100 */
1640 0x00, /* 0000000 */
1641 0x00, /* 0000000 */
1642 0x00, /* 0000000 */
1643
1644 /* 102 0x66 'f' */
1645 0x00, /* 0000000 */
1646 0x38, /* 0011100 */
1647 0x6c, /* 0110110 */
1648 0x64, /* 0110010 */
1649 0x60, /* 0110000 */
1650 0xf0, /* 1111000 */
1651 0x60, /* 0110000 */
1652 0x60, /* 0110000 */
1653 0x60, /* 0110000 */
1654 0x60, /* 0110000 */
1655 0xf0, /* 1111000 */
1656 0x00, /* 0000000 */
1657 0x00, /* 0000000 */
1658 0x00, /* 0000000 */
1659
1660 /* 103 0x67 'g' */
1661 0x00, /* 0000000 */
1662 0x00, /* 0000000 */
1663 0x00, /* 0000000 */
1664 0x00, /* 0000000 */
1665 0x76, /* 0111011 */
1666 0xcc, /* 1100110 */
1667 0xcc, /* 1100110 */
1668 0xcc, /* 1100110 */
1669 0xcc, /* 1100110 */
1670 0xcc, /* 1100110 */
1671 0x7c, /* 0111110 */
1672 0x0c, /* 0000110 */
1673 0xcc, /* 1100110 */
1674 0x78, /* 0111100 */
1675
1676 /* 104 0x68 'h' */
1677 0x00, /* 0000000 */
1678 0xc0, /* 1100000 */
1679 0xc0, /* 1100000 */
1680 0xc0, /* 1100000 */
1681 0xd8, /* 1101100 */
1682 0xec, /* 1110110 */
1683 0xcc, /* 1100110 */
1684 0xcc, /* 1100110 */
1685 0xcc, /* 1100110 */
1686 0xcc, /* 1100110 */
1687 0xcc, /* 1100110 */
1688 0x00, /* 0000000 */
1689 0x00, /* 0000000 */
1690 0x00, /* 0000000 */
1691
1692 /* 105 0x69 'i' */
1693 0x00, /* 0000000 */
1694 0x30, /* 0011000 */
1695 0x30, /* 0011000 */
1696 0x00, /* 0000000 */
1697 0x70, /* 0111000 */
1698 0x30, /* 0011000 */
1699 0x30, /* 0011000 */
1700 0x30, /* 0011000 */
1701 0x30, /* 0011000 */
1702 0x30, /* 0011000 */
1703 0x78, /* 0111100 */
1704 0x00, /* 0000000 */
1705 0x00, /* 0000000 */
1706 0x00, /* 0000000 */
1707
1708 /* 106 0x6a 'j' */
1709 0x00, /* 0000000 */
1710 0x0c, /* 0000110 */
1711 0x0c, /* 0000110 */
1712 0x00, /* 0000000 */
1713 0x1c, /* 0001110 */
1714 0x0c, /* 0000110 */
1715 0x0c, /* 0000110 */
1716 0x0c, /* 0000110 */
1717 0x0c, /* 0000110 */
1718 0x0c, /* 0000110 */
1719 0x0c, /* 0000110 */
1720 0xcc, /* 1100110 */
1721 0xcc, /* 1100110 */
1722 0x78, /* 0111100 */
1723
1724 /* 107 0x6b 'k' */
1725 0x00, /* 0000000 */
1726 0xc0, /* 1100000 */
1727 0xc0, /* 1100000 */
1728 0xc0, /* 1100000 */
1729 0xcc, /* 1100110 */
1730 0xd8, /* 1101100 */
1731 0xf0, /* 1111000 */
1732 0xf0, /* 1111000 */
1733 0xd8, /* 1101100 */
1734 0xcc, /* 1100110 */
1735 0xcc, /* 1100110 */
1736 0x00, /* 0000000 */
1737 0x00, /* 0000000 */
1738 0x00, /* 0000000 */
1739
1740 /* 108 0x6c 'l' */
1741 0x00, /* 0000000 */
1742 0x70, /* 0111000 */
1743 0x30, /* 0011000 */
1744 0x30, /* 0011000 */
1745 0x30, /* 0011000 */
1746 0x30, /* 0011000 */
1747 0x30, /* 0011000 */
1748 0x30, /* 0011000 */
1749 0x30, /* 0011000 */
1750 0x30, /* 0011000 */
1751 0x78, /* 0111100 */
1752 0x00, /* 0000000 */
1753 0x00, /* 0000000 */
1754 0x00, /* 0000000 */
1755
1756 /* 109 0x6d 'm' */
1757 0x00, /* 0000000 */
1758 0x00, /* 0000000 */
1759 0x00, /* 0000000 */
1760 0x00, /* 0000000 */
1761 0xec, /* 1110110 */
1762 0xfe, /* 1111111 */
1763 0xd6, /* 1101011 */
1764 0xd6, /* 1101011 */
1765 0xd6, /* 1101011 */
1766 0xd6, /* 1101011 */
1767 0xd6, /* 1101011 */
1768 0x00, /* 0000000 */
1769 0x00, /* 0000000 */
1770 0x00, /* 0000000 */
1771
1772 /* 110 0x6e 'n' */
1773 0x00, /* 0000000 */
1774 0x00, /* 0000000 */
1775 0x00, /* 0000000 */
1776 0x00, /* 0000000 */
1777 0xb8, /* 1011100 */
1778 0xcc, /* 1100110 */
1779 0xcc, /* 1100110 */
1780 0xcc, /* 1100110 */
1781 0xcc, /* 1100110 */
1782 0xcc, /* 1100110 */
1783 0xcc, /* 1100110 */
1784 0x00, /* 0000000 */
1785 0x00, /* 0000000 */
1786 0x00, /* 0000000 */
1787
1788 /* 111 0x6f 'o' */
1789 0x00, /* 0000000 */
1790 0x00, /* 0000000 */
1791 0x00, /* 0000000 */
1792 0x00, /* 0000000 */
1793 0x78, /* 0111100 */
1794 0xcc, /* 1100110 */
1795 0xcc, /* 1100110 */
1796 0xcc, /* 1100110 */
1797 0xcc, /* 1100110 */
1798 0xcc, /* 1100110 */
1799 0x78, /* 0111100 */
1800 0x00, /* 0000000 */
1801 0x00, /* 0000000 */
1802 0x00, /* 0000000 */
1803
1804 /* 112 0x70 'p' */
1805 0x00, /* 0000000 */
1806 0x00, /* 0000000 */
1807 0x00, /* 0000000 */
1808 0x00, /* 0000000 */
1809 0xb8, /* 1011100 */
1810 0xcc, /* 1100110 */
1811 0xcc, /* 1100110 */
1812 0xcc, /* 1100110 */
1813 0xcc, /* 1100110 */
1814 0xcc, /* 1100110 */
1815 0xf8, /* 1111100 */
1816 0xc0, /* 1100000 */
1817 0xc0, /* 1100000 */
1818 0xc0, /* 1100000 */
1819
1820 /* 113 0x71 'q' */
1821 0x00, /* 0000000 */
1822 0x00, /* 0000000 */
1823 0x00, /* 0000000 */
1824 0x00, /* 0000000 */
1825 0x74, /* 0111010 */
1826 0xcc, /* 1100110 */
1827 0xcc, /* 1100110 */
1828 0xcc, /* 1100110 */
1829 0xcc, /* 1100110 */
1830 0xcc, /* 1100110 */
1831 0x7c, /* 0111110 */
1832 0x0c, /* 0000110 */
1833 0x0c, /* 0000110 */
1834 0x0c, /* 0000110 */
1835
1836 /* 114 0x72 'r' */
1837 0x00, /* 0000000 */
1838 0x00, /* 0000000 */
1839 0x00, /* 0000000 */
1840 0x00, /* 0000000 */
1841 0xb8, /* 1011100 */
1842 0xec, /* 1110110 */
1843 0xcc, /* 1100110 */
1844 0xc0, /* 1100000 */
1845 0xc0, /* 1100000 */
1846 0xc0, /* 1100000 */
1847 0xc0, /* 1100000 */
1848 0x00, /* 0000000 */
1849 0x00, /* 0000000 */
1850 0x00, /* 0000000 */
1851
1852 /* 115 0x73 's' */
1853 0x00, /* 0000000 */
1854 0x00, /* 0000000 */
1855 0x00, /* 0000000 */
1856 0x00, /* 0000000 */
1857 0x78, /* 0111100 */
1858 0xcc, /* 1100110 */
1859 0x60, /* 0110000 */
1860 0x30, /* 0011000 */
1861 0x18, /* 0001100 */
1862 0xcc, /* 1100110 */
1863 0x78, /* 0111100 */
1864 0x00, /* 0000000 */
1865 0x00, /* 0000000 */
1866 0x00, /* 0000000 */
1867
1868 /* 116 0x74 't' */
1869 0x00, /* 0000000 */
1870 0x10, /* 0001000 */
1871 0x30, /* 0011000 */
1872 0x30, /* 0011000 */
1873 0xfc, /* 1111110 */
1874 0x30, /* 0011000 */
1875 0x30, /* 0011000 */
1876 0x30, /* 0011000 */
1877 0x30, /* 0011000 */
1878 0x36, /* 0011011 */
1879 0x1c, /* 0001110 */
1880 0x00, /* 0000000 */
1881 0x00, /* 0000000 */
1882 0x00, /* 0000000 */
1883
1884 /* 117 0x75 'u' */
1885 0x00, /* 0000000 */
1886 0x00, /* 0000000 */
1887 0x00, /* 0000000 */
1888 0x00, /* 0000000 */
1889 0xcc, /* 1100110 */
1890 0xcc, /* 1100110 */
1891 0xcc, /* 1100110 */
1892 0xcc, /* 1100110 */
1893 0xcc, /* 1100110 */
1894 0xcc, /* 1100110 */
1895 0x76, /* 0111011 */
1896 0x00, /* 0000000 */
1897 0x00, /* 0000000 */
1898 0x00, /* 0000000 */
1899
1900 /* 118 0x76 'v' */
1901 0x00, /* 0000000 */
1902 0x00, /* 0000000 */
1903 0x00, /* 0000000 */
1904 0x00, /* 0000000 */
1905 0xcc, /* 1100110 */
1906 0xcc, /* 1100110 */
1907 0xcc, /* 1100110 */
1908 0xcc, /* 1100110 */
1909 0xcc, /* 1100110 */
1910 0x78, /* 0111100 */
1911 0x30, /* 0011000 */
1912 0x00, /* 0000000 */
1913 0x00, /* 0000000 */
1914 0x00, /* 0000000 */
1915
1916 /* 119 0x77 'w' */
1917 0x00, /* 0000000 */
1918 0x00, /* 0000000 */
1919 0x00, /* 0000000 */
1920 0x00, /* 0000000 */
1921 0xc6, /* 1100011 */
1922 0xc6, /* 1100011 */
1923 0xd6, /* 1101011 */
1924 0xd6, /* 1101011 */
1925 0xd6, /* 1101011 */
1926 0xfe, /* 1111111 */
1927 0x6c, /* 0110110 */
1928 0x00, /* 0000000 */
1929 0x00, /* 0000000 */
1930 0x00, /* 0000000 */
1931
1932 /* 120 0x78 'x' */
1933 0x00, /* 0000000 */
1934 0x00, /* 0000000 */
1935 0x00, /* 0000000 */
1936 0x00, /* 0000000 */
1937 0xcc, /* 1100110 */
1938 0xcc, /* 1100110 */
1939 0x78, /* 0111100 */
1940 0x30, /* 0011000 */
1941 0x78, /* 0111100 */
1942 0xcc, /* 1100110 */
1943 0xcc, /* 1100110 */
1944 0x00, /* 0000000 */
1945 0x00, /* 0000000 */
1946 0x00, /* 0000000 */
1947
1948 /* 121 0x79 'y' */
1949 0x00, /* 0000000 */
1950 0x00, /* 0000000 */
1951 0x00, /* 0000000 */
1952 0x00, /* 0000000 */
1953 0xcc, /* 1100110 */
1954 0xcc, /* 1100110 */
1955 0xcc, /* 1100110 */
1956 0xcc, /* 1100110 */
1957 0xcc, /* 1100110 */
1958 0xcc, /* 1100110 */
1959 0x7c, /* 0111110 */
1960 0x0c, /* 0000110 */
1961 0x18, /* 0001100 */
1962 0xf0, /* 1111000 */
1963
1964 /* 122 0x7a 'z' */
1965 0x00, /* 0000000 */
1966 0x00, /* 0000000 */
1967 0x00, /* 0000000 */
1968 0x00, /* 0000000 */
1969 0xfc, /* 1111110 */
1970 0xcc, /* 1100110 */
1971 0x18, /* 0001100 */
1972 0x30, /* 0011000 */
1973 0x60, /* 0110000 */
1974 0xcc, /* 1100110 */
1975 0xfc, /* 1111110 */
1976 0x00, /* 0000000 */
1977 0x00, /* 0000000 */
1978 0x00, /* 0000000 */
1979
1980 /* 123 0x7b '{' */
1981 0x00, /* 0000000 */
1982 0x1c, /* 0001110 */
1983 0x30, /* 0011000 */
1984 0x30, /* 0011000 */
1985 0x30, /* 0011000 */
1986 0xe0, /* 1110000 */
1987 0x30, /* 0011000 */
1988 0x30, /* 0011000 */
1989 0x30, /* 0011000 */
1990 0x30, /* 0011000 */
1991 0x1c, /* 0001110 */
1992 0x00, /* 0000000 */
1993 0x00, /* 0000000 */
1994 0x00, /* 0000000 */
1995
1996 /* 124 0x7c '|' */
1997 0x00, /* 0000000 */
1998 0x30, /* 0011000 */
1999 0x30, /* 0011000 */
2000 0x30, /* 0011000 */
2001 0x30, /* 0011000 */
2002 0x30, /* 0011000 */
2003 0x30, /* 0011000 */
2004 0x30, /* 0011000 */
2005 0x30, /* 0011000 */
2006 0x30, /* 0011000 */
2007 0x30, /* 0011000 */
2008 0x00, /* 0000000 */
2009 0x00, /* 0000000 */
2010 0x00, /* 0000000 */
2011
2012 /* 125 0x7d '}' */
2013 0x00, /* 0000000 */
2014 0x70, /* 0111000 */
2015 0x18, /* 0001100 */
2016 0x18, /* 0001100 */
2017 0x18, /* 0001100 */
2018 0x0e, /* 0000111 */
2019 0x18, /* 0001100 */
2020 0x18, /* 0001100 */
2021 0x18, /* 0001100 */
2022 0x18, /* 0001100 */
2023 0x70, /* 0111000 */
2024 0x00, /* 0000000 */
2025 0x00, /* 0000000 */
2026 0x00, /* 0000000 */
2027
2028 /* 126 0x7e '~' */
2029 0x00, /* 0000000 */
2030 0xec, /* 1110110 */
2031 0xb8, /* 1011100 */
2032 0x00, /* 0000000 */
2033 0x00, /* 0000000 */
2034 0x00, /* 0000000 */
2035 0x00, /* 0000000 */
2036 0x00, /* 0000000 */
2037 0x00, /* 0000000 */
2038 0x00, /* 0000000 */
2039 0x00, /* 0000000 */
2040 0x00, /* 0000000 */
2041 0x00, /* 0000000 */
2042 0x00, /* 0000000 */
2043
2044 /* 127 0x7f '' */
2045 0x00, /* 0000000 */
2046 0x00, /* 0000000 */
2047 0x00, /* 0000000 */
2048 0x10, /* 0001000 */
2049 0x38, /* 0011100 */
2050 0x6c, /* 0110110 */
2051 0xc6, /* 1100011 */
2052 0xc6, /* 1100011 */
2053 0xc6, /* 1100011 */
2054 0xfe, /* 1111111 */
2055 0x00, /* 0000000 */
2056 0x00, /* 0000000 */
2057 0x00, /* 0000000 */
2058 0x00, /* 0000000 */
2059
2060 /* 128 0x80 '€' */
2061 0x00, /* 0000000 */
2062 0x38, /* 0011100 */
2063 0x6c, /* 0110110 */
2064 0xc4, /* 1100010 */
2065 0xc0, /* 1100000 */
2066 0xc0, /* 1100000 */
2067 0xc0, /* 1100000 */
2068 0xc0, /* 1100000 */
2069 0xc4, /* 1100010 */
2070 0x6c, /* 0110110 */
2071 0x38, /* 0011100 */
2072 0x18, /* 0001100 */
2073 0x70, /* 0111000 */
2074 0x00, /* 0000000 */
2075
2076 /* 129 0x81 '' */
2077 0x00, /* 0000000 */
2078 0xcc, /* 1100110 */
2079 0x00, /* 0000000 */
2080 0x00, /* 0000000 */
2081 0xcc, /* 1100110 */
2082 0xcc, /* 1100110 */
2083 0xcc, /* 1100110 */
2084 0xcc, /* 1100110 */
2085 0xcc, /* 1100110 */
2086 0xcc, /* 1100110 */
2087 0x76, /* 0111011 */
2088 0x00, /* 0000000 */
2089 0x00, /* 0000000 */
2090 0x00, /* 0000000 */
2091
2092 /* 130 0x82 '‚' */
2093 0x0c, /* 0000110 */
2094 0x18, /* 0001100 */
2095 0x30, /* 0011000 */
2096 0x00, /* 0000000 */
2097 0x78, /* 0111100 */
2098 0xcc, /* 1100110 */
2099 0xfc, /* 1111110 */
2100 0xc0, /* 1100000 */
2101 0xc0, /* 1100000 */
2102 0xcc, /* 1100110 */
2103 0x78, /* 0111100 */
2104 0x00, /* 0000000 */
2105 0x00, /* 0000000 */
2106 0x00, /* 0000000 */
2107
2108 /* 131 0x83 'ƒ' */
2109 0x10, /* 0001000 */
2110 0x38, /* 0011100 */
2111 0x6c, /* 0110110 */
2112 0x00, /* 0000000 */
2113 0x78, /* 0111100 */
2114 0x0c, /* 0000110 */
2115 0x7c, /* 0111110 */
2116 0xcc, /* 1100110 */
2117 0xcc, /* 1100110 */
2118 0xcc, /* 1100110 */
2119 0x76, /* 0111011 */
2120 0x00, /* 0000000 */
2121 0x00, /* 0000000 */
2122 0x00, /* 0000000 */
2123
2124 /* 132 0x84 '„' */
2125 0x00, /* 0000000 */
2126 0xcc, /* 1100110 */
2127 0x00, /* 0000000 */
2128 0x00, /* 0000000 */
2129 0x78, /* 0111100 */
2130 0x0c, /* 0000110 */
2131 0x7c, /* 0111110 */
2132 0xcc, /* 1100110 */
2133 0xcc, /* 1100110 */
2134 0xcc, /* 1100110 */
2135 0x76, /* 0111011 */
2136 0x00, /* 0000000 */
2137 0x00, /* 0000000 */
2138 0x00, /* 0000000 */
2139
2140 /* 133 0x85 '…' */
2141 0x60, /* 0110000 */
2142 0x30, /* 0011000 */
2143 0x18, /* 0001100 */
2144 0x00, /* 0000000 */
2145 0x78, /* 0111100 */
2146 0x0c, /* 0000110 */
2147 0x7c, /* 0111110 */
2148 0xcc, /* 1100110 */
2149 0xcc, /* 1100110 */
2150 0xcc, /* 1100110 */
2151 0x76, /* 0111011 */
2152 0x00, /* 0000000 */
2153 0x00, /* 0000000 */
2154 0x00, /* 0000000 */
2155
2156 /* 134 0x86 '†' */
2157 0x38, /* 0011100 */
2158 0x6c, /* 0110110 */
2159 0x38, /* 0011100 */
2160 0x00, /* 0000000 */
2161 0x78, /* 0111100 */
2162 0x0c, /* 0000110 */
2163 0x7c, /* 0111110 */
2164 0xcc, /* 1100110 */
2165 0xcc, /* 1100110 */
2166 0xcc, /* 1100110 */
2167 0x76, /* 0111011 */
2168 0x00, /* 0000000 */
2169 0x00, /* 0000000 */
2170 0x00, /* 0000000 */
2171
2172 /* 135 0x87 '‡' */
2173 0x00, /* 0000000 */
2174 0x00, /* 0000000 */
2175 0x00, /* 0000000 */
2176 0x00, /* 0000000 */
2177 0x78, /* 0111100 */
2178 0xcc, /* 1100110 */
2179 0xc0, /* 1100000 */
2180 0xc0, /* 1100000 */
2181 0xc0, /* 1100000 */
2182 0xcc, /* 1100110 */
2183 0x78, /* 0111100 */
2184 0x30, /* 0011000 */
2185 0x30, /* 0011000 */
2186 0xe0, /* 1110000 */
2187
2188 /* 136 0x88 'ˆ' */
2189 0x10, /* 0001000 */
2190 0x38, /* 0011100 */
2191 0x6c, /* 0110110 */
2192 0x00, /* 0000000 */
2193 0x78, /* 0111100 */
2194 0xcc, /* 1100110 */
2195 0xfc, /* 1111110 */
2196 0xc0, /* 1100000 */
2197 0xc0, /* 1100000 */
2198 0xcc, /* 1100110 */
2199 0x78, /* 0111100 */
2200 0x00, /* 0000000 */
2201 0x00, /* 0000000 */
2202 0x00, /* 0000000 */
2203
2204 /* 137 0x89 '‰' */
2205 0x00, /* 0000000 */
2206 0xcc, /* 1100110 */
2207 0x00, /* 0000000 */
2208 0x00, /* 0000000 */
2209 0x78, /* 0111100 */
2210 0xcc, /* 1100110 */
2211 0xfc, /* 1111110 */
2212 0xc0, /* 1100000 */
2213 0xc0, /* 1100000 */
2214 0xcc, /* 1100110 */
2215 0x78, /* 0111100 */
2216 0x00, /* 0000000 */
2217 0x00, /* 0000000 */
2218 0x00, /* 0000000 */
2219
2220 /* 138 0x8a 'Š' */
2221 0xc0, /* 1100000 */
2222 0x60, /* 0110000 */
2223 0x30, /* 0011000 */
2224 0x00, /* 0000000 */
2225 0x78, /* 0111100 */
2226 0xcc, /* 1100110 */
2227 0xfc, /* 1111110 */
2228 0xc0, /* 1100000 */
2229 0xc0, /* 1100000 */
2230 0xcc, /* 1100110 */
2231 0x78, /* 0111100 */
2232 0x00, /* 0000000 */
2233 0x00, /* 0000000 */
2234 0x00, /* 0000000 */
2235
2236 /* 139 0x8b '‹' */
2237 0x00, /* 0000000 */
2238 0x6c, /* 0110110 */
2239 0x00, /* 0000000 */
2240 0x00, /* 0000000 */
2241 0x38, /* 0011100 */
2242 0x18, /* 0001100 */
2243 0x18, /* 0001100 */
2244 0x18, /* 0001100 */
2245 0x18, /* 0001100 */
2246 0x18, /* 0001100 */
2247 0x3c, /* 0011110 */
2248 0x00, /* 0000000 */
2249 0x00, /* 0000000 */
2250 0x00, /* 0000000 */
2251
2252 /* 140 0x8c 'Œ' */
2253 0x30, /* 0011000 */
2254 0x78, /* 0111100 */
2255 0xcc, /* 1100110 */
2256 0x00, /* 0000000 */
2257 0x70, /* 0111000 */
2258 0x30, /* 0011000 */
2259 0x30, /* 0011000 */
2260 0x30, /* 0011000 */
2261 0x30, /* 0011000 */
2262 0x30, /* 0011000 */
2263 0x78, /* 0111100 */
2264 0x00, /* 0000000 */
2265 0x00, /* 0000000 */
2266 0x00, /* 0000000 */
2267
2268 /* 141 0x8d '' */
2269 0xc0, /* 1100000 */
2270 0x60, /* 0110000 */
2271 0x30, /* 0011000 */
2272 0x00, /* 0000000 */
2273 0x70, /* 0111000 */
2274 0x30, /* 0011000 */
2275 0x30, /* 0011000 */
2276 0x30, /* 0011000 */
2277 0x30, /* 0011000 */
2278 0x30, /* 0011000 */
2279 0x78, /* 0111100 */
2280 0x00, /* 0000000 */
2281 0x00, /* 0000000 */
2282 0x00, /* 0000000 */
2283
2284 /* 142 0x8e 'Ž' */
2285 0x00, /* 0000000 */
2286 0xcc, /* 1100110 */
2287 0x00, /* 0000000 */
2288 0x30, /* 0011000 */
2289 0x78, /* 0111100 */
2290 0xcc, /* 1100110 */
2291 0xcc, /* 1100110 */
2292 0xfc, /* 1111110 */
2293 0xcc, /* 1100110 */
2294 0xcc, /* 1100110 */
2295 0xcc, /* 1100110 */
2296 0x00, /* 0000000 */
2297 0x00, /* 0000000 */
2298 0x00, /* 0000000 */
2299
2300 /* 143 0x8f '' */
2301 0x30, /* 0011000 */
2302 0x48, /* 0100100 */
2303 0x48, /* 0100100 */
2304 0x30, /* 0011000 */
2305 0x78, /* 0111100 */
2306 0xcc, /* 1100110 */
2307 0xfc, /* 1111110 */
2308 0xcc, /* 1100110 */
2309 0xcc, /* 1100110 */
2310 0xcc, /* 1100110 */
2311 0xcc, /* 1100110 */
2312 0x00, /* 0000000 */
2313 0x00, /* 0000000 */
2314 0x00, /* 0000000 */
2315
2316 /* 144 0x90 '' */
2317 0x18, /* 0001100 */
2318 0x30, /* 0011000 */
2319 0xfc, /* 1111110 */
2320 0xcc, /* 1100110 */
2321 0xc4, /* 1100010 */
2322 0xd0, /* 1101000 */
2323 0xf0, /* 1111000 */
2324 0xd0, /* 1101000 */
2325 0xc4, /* 1100010 */
2326 0xcc, /* 1100110 */
2327 0xfc, /* 1111110 */
2328 0x00, /* 0000000 */
2329 0x00, /* 0000000 */
2330 0x00, /* 0000000 */
2331
2332 /* 145 0x91 '‘' */
2333 0x00, /* 0000000 */
2334 0x00, /* 0000000 */
2335 0x00, /* 0000000 */
2336 0x00, /* 0000000 */
2337 0xec, /* 1110110 */
2338 0x36, /* 0011011 */
2339 0x36, /* 0011011 */
2340 0x7e, /* 0111111 */
2341 0xd8, /* 1101100 */
2342 0xd8, /* 1101100 */
2343 0x6e, /* 0110111 */
2344 0x00, /* 0000000 */
2345 0x00, /* 0000000 */
2346 0x00, /* 0000000 */
2347
2348 /* 146 0x92 '’' */
2349 0x00, /* 0000000 */
2350 0x3e, /* 0011111 */
2351 0x6c, /* 0110110 */
2352 0xcc, /* 1100110 */
2353 0xcc, /* 1100110 */
2354 0xfe, /* 1111111 */
2355 0xcc, /* 1100110 */
2356 0xcc, /* 1100110 */
2357 0xcc, /* 1100110 */
2358 0xcc, /* 1100110 */
2359 0xce, /* 1100111 */
2360 0x00, /* 0000000 */
2361 0x00, /* 0000000 */
2362 0x00, /* 0000000 */
2363
2364 /* 147 0x93 '“' */
2365 0x10, /* 0001000 */
2366 0x38, /* 0011100 */
2367 0x6c, /* 0110110 */
2368 0x00, /* 0000000 */
2369 0x78, /* 0111100 */
2370 0xcc, /* 1100110 */
2371 0xcc, /* 1100110 */
2372 0xcc, /* 1100110 */
2373 0xcc, /* 1100110 */
2374 0xcc, /* 1100110 */
2375 0x78, /* 0111100 */
2376 0x00, /* 0000000 */
2377 0x00, /* 0000000 */
2378 0x00, /* 0000000 */
2379
2380 /* 148 0x94 '”' */
2381 0x00, /* 0000000 */
2382 0xcc, /* 1100110 */
2383 0x00, /* 0000000 */
2384 0x00, /* 0000000 */
2385 0x78, /* 0111100 */
2386 0xcc, /* 1100110 */
2387 0xcc, /* 1100110 */
2388 0xcc, /* 1100110 */
2389 0xcc, /* 1100110 */
2390 0xcc, /* 1100110 */
2391 0x78, /* 0111100 */
2392 0x00, /* 0000000 */
2393 0x00, /* 0000000 */
2394 0x00, /* 0000000 */
2395
2396 /* 149 0x95 '•' */
2397 0xc0, /* 1100000 */
2398 0x60, /* 0110000 */
2399 0x30, /* 0011000 */
2400 0x00, /* 0000000 */
2401 0x78, /* 0111100 */
2402 0xcc, /* 1100110 */
2403 0xcc, /* 1100110 */
2404 0xcc, /* 1100110 */
2405 0xcc, /* 1100110 */
2406 0xcc, /* 1100110 */
2407 0x78, /* 0111100 */
2408 0x00, /* 0000000 */
2409 0x00, /* 0000000 */
2410 0x00, /* 0000000 */
2411
2412 /* 150 0x96 '–' */
2413 0x30, /* 0011000 */
2414 0x78, /* 0111100 */
2415 0xcc, /* 1100110 */
2416 0x00, /* 0000000 */
2417 0xcc, /* 1100110 */
2418 0xcc, /* 1100110 */
2419 0xcc, /* 1100110 */
2420 0xcc, /* 1100110 */
2421 0xcc, /* 1100110 */
2422 0xcc, /* 1100110 */
2423 0x76, /* 0111011 */
2424 0x00, /* 0000000 */
2425 0x00, /* 0000000 */
2426 0x00, /* 0000000 */
2427
2428 /* 151 0x97 '—' */
2429 0x60, /* 0110000 */
2430 0x30, /* 0011000 */
2431 0x18, /* 0001100 */
2432 0x00, /* 0000000 */
2433 0xcc, /* 1100110 */
2434 0xcc, /* 1100110 */
2435 0xcc, /* 1100110 */
2436 0xcc, /* 1100110 */
2437 0xcc, /* 1100110 */
2438 0xcc, /* 1100110 */
2439 0x76, /* 0111011 */
2440 0x00, /* 0000000 */
2441 0x00, /* 0000000 */
2442 0x00, /* 0000000 */
2443
2444 /* 152 0x98 '˜' */
2445 0x00, /* 0000000 */
2446 0xcc, /* 1100110 */
2447 0x00, /* 0000000 */
2448 0x00, /* 0000000 */
2449 0xcc, /* 1100110 */
2450 0xcc, /* 1100110 */
2451 0xcc, /* 1100110 */
2452 0xcc, /* 1100110 */
2453 0xcc, /* 1100110 */
2454 0xcc, /* 1100110 */
2455 0x7c, /* 0111110 */
2456 0x0c, /* 0000110 */
2457 0x18, /* 0001100 */
2458 0x70, /* 0111000 */
2459
2460 /* 153 0x99 '™' */
2461 0xcc, /* 1100110 */
2462 0x00, /* 0000000 */
2463 0x78, /* 0111100 */
2464 0xcc, /* 1100110 */
2465 0xcc, /* 1100110 */
2466 0xcc, /* 1100110 */
2467 0xcc, /* 1100110 */
2468 0xcc, /* 1100110 */
2469 0xcc, /* 1100110 */
2470 0xcc, /* 1100110 */
2471 0x78, /* 0111100 */
2472 0x00, /* 0000000 */
2473 0x00, /* 0000000 */
2474 0x00, /* 0000000 */
2475
2476 /* 154 0x9a 'š' */
2477 0xcc, /* 1100110 */
2478 0x00, /* 0000000 */
2479 0xcc, /* 1100110 */
2480 0xcc, /* 1100110 */
2481 0xcc, /* 1100110 */
2482 0xcc, /* 1100110 */
2483 0xcc, /* 1100110 */
2484 0xcc, /* 1100110 */
2485 0xcc, /* 1100110 */
2486 0xcc, /* 1100110 */
2487 0x78, /* 0111100 */
2488 0x00, /* 0000000 */
2489 0x00, /* 0000000 */
2490 0x00, /* 0000000 */
2491
2492 /* 155 0x9b '›' */
2493 0x30, /* 0011000 */
2494 0x30, /* 0011000 */
2495 0x7c, /* 0111110 */
2496 0xcc, /* 1100110 */
2497 0xc0, /* 1100000 */
2498 0xc0, /* 1100000 */
2499 0xc0, /* 1100000 */
2500 0xcc, /* 1100110 */
2501 0x7c, /* 0111110 */
2502 0x30, /* 0011000 */
2503 0x30, /* 0011000 */
2504 0x00, /* 0000000 */
2505 0x00, /* 0000000 */
2506 0x00, /* 0000000 */
2507
2508 /* 156 0x9c 'œ' */
2509 0x38, /* 0011100 */
2510 0x6c, /* 0110110 */
2511 0x64, /* 0110010 */
2512 0x60, /* 0110000 */
2513 0xf0, /* 1111000 */
2514 0x60, /* 0110000 */
2515 0x60, /* 0110000 */
2516 0x60, /* 0110000 */
2517 0x60, /* 0110000 */
2518 0xe6, /* 1110011 */
2519 0xfc, /* 1111110 */
2520 0x00, /* 0000000 */
2521 0x00, /* 0000000 */
2522 0x00, /* 0000000 */
2523
2524 /* 157 0x9d '' */
2525 0x00, /* 0000000 */
2526 0xcc, /* 1100110 */
2527 0xcc, /* 1100110 */
2528 0x78, /* 0111100 */
2529 0x30, /* 0011000 */
2530 0xfc, /* 1111110 */
2531 0x30, /* 0011000 */
2532 0xfc, /* 1111110 */
2533 0x30, /* 0011000 */
2534 0x30, /* 0011000 */
2535 0x30, /* 0011000 */
2536 0x00, /* 0000000 */
2537 0x00, /* 0000000 */
2538 0x00, /* 0000000 */
2539
2540 /* 158 0x9e 'ž' */
2541 0xf8, /* 1111100 */
2542 0xcc, /* 1100110 */
2543 0xcc, /* 1100110 */
2544 0xf8, /* 1111100 */
2545 0xc4, /* 1100010 */
2546 0xcc, /* 1100110 */
2547 0xde, /* 1101111 */
2548 0xcc, /* 1100110 */
2549 0xcc, /* 1100110 */
2550 0xcc, /* 1100110 */
2551 0xc6, /* 1100011 */
2552 0x00, /* 0000000 */
2553 0x00, /* 0000000 */
2554 0x00, /* 0000000 */
2555
2556 /* 159 0x9f 'Ÿ' */
2557 0x1c, /* 0001110 */
2558 0x36, /* 0011011 */
2559 0x30, /* 0011000 */
2560 0x30, /* 0011000 */
2561 0x30, /* 0011000 */
2562 0xfc, /* 1111110 */
2563 0x30, /* 0011000 */
2564 0x30, /* 0011000 */
2565 0x30, /* 0011000 */
2566 0xb0, /* 1011000 */
2567 0xe0, /* 1110000 */
2568 0x00, /* 0000000 */
2569 0x00, /* 0000000 */
2570 0x00, /* 0000000 */
2571
2572 /* 160 0xa0 ' ' */
2573 0x18, /* 0001100 */
2574 0x30, /* 0011000 */
2575 0x60, /* 0110000 */
2576 0x00, /* 0000000 */
2577 0x78, /* 0111100 */
2578 0x0c, /* 0000110 */
2579 0x7c, /* 0111110 */
2580 0xcc, /* 1100110 */
2581 0xcc, /* 1100110 */
2582 0xcc, /* 1100110 */
2583 0x76, /* 0111011 */
2584 0x00, /* 0000000 */
2585 0x00, /* 0000000 */
2586 0x00, /* 0000000 */
2587
2588 /* 161 0xa1 '¡' */
2589 0x18, /* 0001100 */
2590 0x30, /* 0011000 */
2591 0x60, /* 0110000 */
2592 0x00, /* 0000000 */
2593 0x70, /* 0111000 */
2594 0x30, /* 0011000 */
2595 0x30, /* 0011000 */
2596 0x30, /* 0011000 */
2597 0x30, /* 0011000 */
2598 0x30, /* 0011000 */
2599 0x78, /* 0111100 */
2600 0x00, /* 0000000 */
2601 0x00, /* 0000000 */
2602 0x00, /* 0000000 */
2603
2604 /* 162 0xa2 '¢' */
2605 0x18, /* 0001100 */
2606 0x30, /* 0011000 */
2607 0x60, /* 0110000 */
2608 0x00, /* 0000000 */
2609 0x78, /* 0111100 */
2610 0xcc, /* 1100110 */
2611 0xcc, /* 1100110 */
2612 0xcc, /* 1100110 */
2613 0xcc, /* 1100110 */
2614 0xcc, /* 1100110 */
2615 0x78, /* 0111100 */
2616 0x00, /* 0000000 */
2617 0x00, /* 0000000 */
2618 0x00, /* 0000000 */
2619
2620 /* 163 0xa3 '£' */
2621 0x18, /* 0001100 */
2622 0x30, /* 0011000 */
2623 0x60, /* 0110000 */
2624 0x00, /* 0000000 */
2625 0xcc, /* 1100110 */
2626 0xcc, /* 1100110 */
2627 0xcc, /* 1100110 */
2628 0xcc, /* 1100110 */
2629 0xcc, /* 1100110 */
2630 0xcc, /* 1100110 */
2631 0x76, /* 0111011 */
2632 0x00, /* 0000000 */
2633 0x00, /* 0000000 */
2634 0x00, /* 0000000 */
2635
2636 /* 164 0xa4 '¤' */
2637 0x00, /* 0000000 */
2638 0x76, /* 0111011 */
2639 0xdc, /* 1101110 */
2640 0x00, /* 0000000 */
2641 0xb8, /* 1011100 */
2642 0xcc, /* 1100110 */
2643 0xcc, /* 1100110 */
2644 0xcc, /* 1100110 */
2645 0xcc, /* 1100110 */
2646 0xcc, /* 1100110 */
2647 0xcc, /* 1100110 */
2648 0x00, /* 0000000 */
2649 0x00, /* 0000000 */
2650 0x00, /* 0000000 */
2651
2652 /* 165 0xa5 '¥' */
2653 0x76, /* 0111011 */
2654 0xdc, /* 1101110 */
2655 0x00, /* 0000000 */
2656 0xcc, /* 1100110 */
2657 0xec, /* 1110110 */
2658 0xec, /* 1110110 */
2659 0xfc, /* 1111110 */
2660 0xdc, /* 1101110 */
2661 0xcc, /* 1100110 */
2662 0xcc, /* 1100110 */
2663 0xcc, /* 1100110 */
2664 0x00, /* 0000000 */
2665 0x00, /* 0000000 */
2666 0x00, /* 0000000 */
2667
2668 /* 166 0xa6 '¦' */
2669 0x00, /* 0000000 */
2670 0x78, /* 0111100 */
2671 0xd8, /* 1101100 */
2672 0xd8, /* 1101100 */
2673 0x7c, /* 0111110 */
2674 0x00, /* 0000000 */
2675 0xfc, /* 1111110 */
2676 0x00, /* 0000000 */
2677 0x00, /* 0000000 */
2678 0x00, /* 0000000 */
2679 0x00, /* 0000000 */
2680 0x00, /* 0000000 */
2681 0x00, /* 0000000 */
2682 0x00, /* 0000000 */
2683
2684 /* 167 0xa7 '§' */
2685 0x00, /* 0000000 */
2686 0x70, /* 0111000 */
2687 0xd8, /* 1101100 */
2688 0xd8, /* 1101100 */
2689 0x70, /* 0111000 */
2690 0x00, /* 0000000 */
2691 0xf8, /* 1111100 */
2692 0x00, /* 0000000 */
2693 0x00, /* 0000000 */
2694 0x00, /* 0000000 */
2695 0x00, /* 0000000 */
2696 0x00, /* 0000000 */
2697 0x00, /* 0000000 */
2698 0x00, /* 0000000 */
2699
2700 /* 168 0xa8 '¨' */
2701 0x00, /* 0000000 */
2702 0x30, /* 0011000 */
2703 0x30, /* 0011000 */
2704 0x00, /* 0000000 */
2705 0x30, /* 0011000 */
2706 0x30, /* 0011000 */
2707 0x60, /* 0110000 */
2708 0xc0, /* 1100000 */
2709 0xcc, /* 1100110 */
2710 0xcc, /* 1100110 */
2711 0x78, /* 0111100 */
2712 0x00, /* 0000000 */
2713 0x00, /* 0000000 */
2714 0x00, /* 0000000 */
2715
2716 /* 169 0xa9 '©' */
2717 0x00, /* 0000000 */
2718 0x00, /* 0000000 */
2719 0x00, /* 0000000 */
2720 0x00, /* 0000000 */
2721 0x00, /* 0000000 */
2722 0xfc, /* 1111110 */
2723 0xc0, /* 1100000 */
2724 0xc0, /* 1100000 */
2725 0xc0, /* 1100000 */
2726 0xc0, /* 1100000 */
2727 0x00, /* 0000000 */
2728 0x00, /* 0000000 */
2729 0x00, /* 0000000 */
2730 0x00, /* 0000000 */
2731
2732 /* 170 0xaa 'ª' */
2733 0x00, /* 0000000 */
2734 0x00, /* 0000000 */
2735 0x00, /* 0000000 */
2736 0x00, /* 0000000 */
2737 0x00, /* 0000000 */
2738 0xfc, /* 1111110 */
2739 0x0c, /* 0000110 */
2740 0x0c, /* 0000110 */
2741 0x0c, /* 0000110 */
2742 0x0c, /* 0000110 */
2743 0x00, /* 0000000 */
2744 0x00, /* 0000000 */
2745 0x00, /* 0000000 */
2746 0x00, /* 0000000 */
2747
2748 /* 171 0xab '«' */
2749 0x60, /* 0110000 */
2750 0xe0, /* 1110000 */
2751 0x62, /* 0110001 */
2752 0x66, /* 0110011 */
2753 0x6c, /* 0110110 */
2754 0x18, /* 0001100 */
2755 0x30, /* 0011000 */
2756 0x60, /* 0110000 */
2757 0xc0, /* 1100000 */
2758 0xb8, /* 1011100 */
2759 0x4c, /* 0100110 */
2760 0x18, /* 0001100 */
2761 0x30, /* 0011000 */
2762 0x7c, /* 0111110 */
2763
2764 /* 172 0xac '¬' */
2765 0x60, /* 0110000 */
2766 0xe0, /* 1110000 */
2767 0x62, /* 0110001 */
2768 0x66, /* 0110011 */
2769 0x6c, /* 0110110 */
2770 0x18, /* 0001100 */
2771 0x30, /* 0011000 */
2772 0x6c, /* 0110110 */
2773 0xdc, /* 1101110 */
2774 0xb4, /* 1011010 */
2775 0x7e, /* 0111111 */
2776 0x0c, /* 0000110 */
2777 0x0c, /* 0000110 */
2778 0x00, /* 0000000 */
2779
2780 /* 173 0xad '­' */
2781 0x00, /* 0000000 */
2782 0x30, /* 0011000 */
2783 0x30, /* 0011000 */
2784 0x00, /* 0000000 */
2785 0x30, /* 0011000 */
2786 0x30, /* 0011000 */
2787 0x30, /* 0011000 */
2788 0x78, /* 0111100 */
2789 0x78, /* 0111100 */
2790 0x78, /* 0111100 */
2791 0x30, /* 0011000 */
2792 0x00, /* 0000000 */
2793 0x00, /* 0000000 */
2794 0x00, /* 0000000 */
2795
2796 /* 174 0xae '®' */
2797 0x00, /* 0000000 */
2798 0x00, /* 0000000 */
2799 0x00, /* 0000000 */
2800 0x00, /* 0000000 */
2801 0x36, /* 0011011 */
2802 0x6c, /* 0110110 */
2803 0xd8, /* 1101100 */
2804 0x6c, /* 0110110 */
2805 0x36, /* 0011011 */
2806 0x00, /* 0000000 */
2807 0x00, /* 0000000 */
2808 0x00, /* 0000000 */
2809 0x00, /* 0000000 */
2810 0x00, /* 0000000 */
2811
2812 /* 175 0xaf '¯' */
2813 0x00, /* 0000000 */
2814 0x00, /* 0000000 */
2815 0x00, /* 0000000 */
2816 0x00, /* 0000000 */
2817 0xd8, /* 1101100 */
2818 0x6c, /* 0110110 */
2819 0x36, /* 0011011 */
2820 0x6c, /* 0110110 */
2821 0xd8, /* 1101100 */
2822 0x00, /* 0000000 */
2823 0x00, /* 0000000 */
2824 0x00, /* 0000000 */
2825 0x00, /* 0000000 */
2826 0x00, /* 0000000 */
2827
2828 /* 176 0xb0 '°' */
2829 0x88, /* 1000100 */
2830 0x22, /* 0010001 */
2831 0x88, /* 1000100 */
2832 0x22, /* 0010001 */
2833 0x88, /* 1000100 */
2834 0x22, /* 0010001 */
2835 0x88, /* 1000100 */
2836 0x22, /* 0010001 */
2837 0x88, /* 1000100 */
2838 0x22, /* 0010001 */
2839 0x88, /* 1000100 */
2840 0x22, /* 0010001 */
2841 0x88, /* 1000100 */
2842 0x22, /* 0010001 */
2843
2844 /* 177 0xb1 '±' */
2845 0x54, /* 0101010 */
2846 0xaa, /* 1010101 */
2847 0x54, /* 0101010 */
2848 0xaa, /* 1010101 */
2849 0x54, /* 0101010 */
2850 0xaa, /* 1010101 */
2851 0x54, /* 0101010 */
2852 0xaa, /* 1010101 */
2853 0x54, /* 0101010 */
2854 0xaa, /* 1010101 */
2855 0x54, /* 0101010 */
2856 0xaa, /* 1010101 */
2857 0x54, /* 0101010 */
2858 0xaa, /* 1010101 */
2859
2860 /* 178 0xb2 '²' */
2861 0xee, /* 1110111 */
2862 0xba, /* 1011101 */
2863 0xee, /* 1110111 */
2864 0xba, /* 1011101 */
2865 0xee, /* 1110111 */
2866 0xba, /* 1011101 */
2867 0xee, /* 1110111 */
2868 0xba, /* 1011101 */
2869 0xee, /* 1110111 */
2870 0xba, /* 1011101 */
2871 0xee, /* 1110111 */
2872 0xba, /* 1011101 */
2873 0xee, /* 1110111 */
2874 0xba, /* 1011101 */
2875
2876 /* 179 0xb3 '³' */
2877 0x30, /* 0011000 */
2878 0x30, /* 0011000 */
2879 0x30, /* 0011000 */
2880 0x30, /* 0011000 */
2881 0x30, /* 0011000 */
2882 0x30, /* 0011000 */
2883 0x30, /* 0011000 */
2884 0x30, /* 0011000 */
2885 0x30, /* 0011000 */
2886 0x30, /* 0011000 */
2887 0x30, /* 0011000 */
2888 0x30, /* 0011000 */
2889 0x30, /* 0011000 */
2890 0x30, /* 0011000 */
2891
2892 /* 180 0xb4 '´' */
2893 0x30, /* 0011000 */
2894 0x30, /* 0011000 */
2895 0x30, /* 0011000 */
2896 0x30, /* 0011000 */
2897 0x30, /* 0011000 */
2898 0x30, /* 0011000 */
2899 0xf0, /* 1111000 */
2900 0x30, /* 0011000 */
2901 0x30, /* 0011000 */
2902 0x30, /* 0011000 */
2903 0x30, /* 0011000 */
2904 0x30, /* 0011000 */
2905 0x30, /* 0011000 */
2906 0x30, /* 0011000 */
2907
2908 /* 181 0xb5 'µ' */
2909 0x30, /* 0011000 */
2910 0x30, /* 0011000 */
2911 0x30, /* 0011000 */
2912 0x30, /* 0011000 */
2913 0xf0, /* 1111000 */
2914 0x30, /* 0011000 */
2915 0xf0, /* 1111000 */
2916 0x30, /* 0011000 */
2917 0x30, /* 0011000 */
2918 0x30, /* 0011000 */
2919 0x30, /* 0011000 */
2920 0x30, /* 0011000 */
2921 0x30, /* 0011000 */
2922 0x30, /* 0011000 */
2923
2924 /* 182 0xb6 '¶' */
2925 0x6c, /* 0110110 */
2926 0x6c, /* 0110110 */
2927 0x6c, /* 0110110 */
2928 0x6c, /* 0110110 */
2929 0x6c, /* 0110110 */
2930 0x6c, /* 0110110 */
2931 0xec, /* 1110110 */
2932 0x6c, /* 0110110 */
2933 0x6c, /* 0110110 */
2934 0x6c, /* 0110110 */
2935 0x6c, /* 0110110 */
2936 0x6c, /* 0110110 */
2937 0x6c, /* 0110110 */
2938 0x6c, /* 0110110 */
2939
2940 /* 183 0xb7 '·' */
2941 0x00, /* 0000000 */
2942 0x00, /* 0000000 */
2943 0x00, /* 0000000 */
2944 0x00, /* 0000000 */
2945 0x00, /* 0000000 */
2946 0x00, /* 0000000 */
2947 0xfc, /* 1111110 */
2948 0x6c, /* 0110110 */
2949 0x6c, /* 0110110 */
2950 0x6c, /* 0110110 */
2951 0x6c, /* 0110110 */
2952 0x6c, /* 0110110 */
2953 0x6c, /* 0110110 */
2954 0x6c, /* 0110110 */
2955
2956 /* 184 0xb8 '¸' */
2957 0x00, /* 0000000 */
2958 0x00, /* 0000000 */
2959 0x00, /* 0000000 */
2960 0x00, /* 0000000 */
2961 0xf0, /* 1111000 */
2962 0x30, /* 0011000 */
2963 0xf0, /* 1111000 */
2964 0x30, /* 0011000 */
2965 0x30, /* 0011000 */
2966 0x30, /* 0011000 */
2967 0x30, /* 0011000 */
2968 0x30, /* 0011000 */
2969 0x30, /* 0011000 */
2970 0x30, /* 0011000 */
2971
2972 /* 185 0xb9 '¹' */
2973 0x6c, /* 0110110 */
2974 0x6c, /* 0110110 */
2975 0x6c, /* 0110110 */
2976 0x6c, /* 0110110 */
2977 0xec, /* 1110110 */
2978 0x0c, /* 0000110 */
2979 0xec, /* 1110110 */
2980 0x6c, /* 0110110 */
2981 0x6c, /* 0110110 */
2982 0x6c, /* 0110110 */
2983 0x6c, /* 0110110 */
2984 0x6c, /* 0110110 */
2985 0x6c, /* 0110110 */
2986 0x6c, /* 0110110 */
2987
2988 /* 186 0xba 'º' */
2989 0x6c, /* 0110110 */
2990 0x6c, /* 0110110 */
2991 0x6c, /* 0110110 */
2992 0x6c, /* 0110110 */
2993 0x6c, /* 0110110 */
2994 0x6c, /* 0110110 */
2995 0x6c, /* 0110110 */
2996 0x6c, /* 0110110 */
2997 0x6c, /* 0110110 */
2998 0x6c, /* 0110110 */
2999 0x6c, /* 0110110 */
3000 0x6c, /* 0110110 */
3001 0x6c, /* 0110110 */
3002 0x6c, /* 0110110 */
3003
3004 /* 187 0xbb '»' */
3005 0x00, /* 0000000 */
3006 0x00, /* 0000000 */
3007 0x00, /* 0000000 */
3008 0x00, /* 0000000 */
3009 0xfc, /* 1111110 */
3010 0x0c, /* 0000110 */
3011 0xec, /* 1110110 */
3012 0x6c, /* 0110110 */
3013 0x6c, /* 0110110 */
3014 0x6c, /* 0110110 */
3015 0x6c, /* 0110110 */
3016 0x6c, /* 0110110 */
3017 0x6c, /* 0110110 */
3018 0x6c, /* 0110110 */
3019
3020 /* 188 0xbc '¼' */
3021 0x6c, /* 0110110 */
3022 0x6c, /* 0110110 */
3023 0x6c, /* 0110110 */
3024 0x6c, /* 0110110 */
3025 0xec, /* 1110110 */
3026 0x0c, /* 0000110 */
3027 0xfc, /* 1111110 */
3028 0x00, /* 0000000 */
3029 0x00, /* 0000000 */
3030 0x00, /* 0000000 */
3031 0x00, /* 0000000 */
3032 0x00, /* 0000000 */
3033 0x00, /* 0000000 */
3034 0x00, /* 0000000 */
3035
3036 /* 189 0xbd '½' */
3037 0x6c, /* 0110110 */
3038 0x6c, /* 0110110 */
3039 0x6c, /* 0110110 */
3040 0x6c, /* 0110110 */
3041 0x6c, /* 0110110 */
3042 0x6c, /* 0110110 */
3043 0xfc, /* 1111110 */
3044 0x00, /* 0000000 */
3045 0x00, /* 0000000 */
3046 0x00, /* 0000000 */
3047 0x00, /* 0000000 */
3048 0x00, /* 0000000 */
3049 0x00, /* 0000000 */
3050 0x00, /* 0000000 */
3051
3052 /* 190 0xbe '¾' */
3053 0x30, /* 0011000 */
3054 0x30, /* 0011000 */
3055 0x30, /* 0011000 */
3056 0x30, /* 0011000 */
3057 0xf0, /* 1111000 */
3058 0x30, /* 0011000 */
3059 0xf0, /* 1111000 */
3060 0x00, /* 0000000 */
3061 0x00, /* 0000000 */
3062 0x00, /* 0000000 */
3063 0x00, /* 0000000 */
3064 0x00, /* 0000000 */
3065 0x00, /* 0000000 */
3066 0x00, /* 0000000 */
3067
3068 /* 191 0xbf '¿' */
3069 0x00, /* 0000000 */
3070 0x00, /* 0000000 */
3071 0x00, /* 0000000 */
3072 0x00, /* 0000000 */
3073 0x00, /* 0000000 */
3074 0x00, /* 0000000 */
3075 0xf0, /* 1111000 */
3076 0x30, /* 0011000 */
3077 0x30, /* 0011000 */
3078 0x30, /* 0011000 */
3079 0x30, /* 0011000 */
3080 0x30, /* 0011000 */
3081 0x30, /* 0011000 */
3082 0x30, /* 0011000 */
3083
3084 /* 192 0xc0 'À' */
3085 0x30, /* 0011000 */
3086 0x30, /* 0011000 */
3087 0x30, /* 0011000 */
3088 0x30, /* 0011000 */
3089 0x30, /* 0011000 */
3090 0x30, /* 0011000 */
3091 0x3e, /* 0011111 */
3092 0x00, /* 0000000 */
3093 0x00, /* 0000000 */
3094 0x00, /* 0000000 */
3095 0x00, /* 0000000 */
3096 0x00, /* 0000000 */
3097 0x00, /* 0000000 */
3098 0x00, /* 0000000 */
3099
3100 /* 193 0xc1 'Á' */
3101 0x30, /* 0011000 */
3102 0x30, /* 0011000 */
3103 0x30, /* 0011000 */
3104 0x30, /* 0011000 */
3105 0x30, /* 0011000 */
3106 0x30, /* 0011000 */
3107 0xfe, /* 1111111 */
3108 0x00, /* 0000000 */
3109 0x00, /* 0000000 */
3110 0x00, /* 0000000 */
3111 0x00, /* 0000000 */
3112 0x00, /* 0000000 */
3113 0x00, /* 0000000 */
3114 0x00, /* 0000000 */
3115
3116 /* 194 0xc2 'Â' */
3117 0x00, /* 0000000 */
3118 0x00, /* 0000000 */
3119 0x00, /* 0000000 */
3120 0x00, /* 0000000 */
3121 0x00, /* 0000000 */
3122 0x00, /* 0000000 */
3123 0xfe, /* 1111111 */
3124 0x30, /* 0011000 */
3125 0x30, /* 0011000 */
3126 0x30, /* 0011000 */
3127 0x30, /* 0011000 */
3128 0x30, /* 0011000 */
3129 0x30, /* 0011000 */
3130 0x30, /* 0011000 */
3131
3132 /* 195 0xc3 'Ã' */
3133 0x30, /* 0011000 */
3134 0x30, /* 0011000 */
3135 0x30, /* 0011000 */
3136 0x30, /* 0011000 */
3137 0x30, /* 0011000 */
3138 0x30, /* 0011000 */
3139 0x3e, /* 0011111 */
3140 0x30, /* 0011000 */
3141 0x30, /* 0011000 */
3142 0x30, /* 0011000 */
3143 0x30, /* 0011000 */
3144 0x30, /* 0011000 */
3145 0x30, /* 0011000 */
3146 0x30, /* 0011000 */
3147
3148 /* 196 0xc4 'Ä' */
3149 0x00, /* 0000000 */
3150 0x00, /* 0000000 */
3151 0x00, /* 0000000 */
3152 0x00, /* 0000000 */
3153 0x00, /* 0000000 */
3154 0x00, /* 0000000 */
3155 0xfe, /* 1111111 */
3156 0x00, /* 0000000 */
3157 0x00, /* 0000000 */
3158 0x00, /* 0000000 */
3159 0x00, /* 0000000 */
3160 0x00, /* 0000000 */
3161 0x00, /* 0000000 */
3162 0x00, /* 0000000 */
3163
3164 /* 197 0xc5 'Å' */
3165 0x30, /* 0011000 */
3166 0x30, /* 0011000 */
3167 0x30, /* 0011000 */
3168 0x30, /* 0011000 */
3169 0x30, /* 0011000 */
3170 0x30, /* 0011000 */
3171 0xfe, /* 1111111 */
3172 0x30, /* 0011000 */
3173 0x30, /* 0011000 */
3174 0x30, /* 0011000 */
3175 0x30, /* 0011000 */
3176 0x30, /* 0011000 */
3177 0x30, /* 0011000 */
3178 0x30, /* 0011000 */
3179
3180 /* 198 0xc6 'Æ' */
3181 0x30, /* 0011000 */
3182 0x30, /* 0011000 */
3183 0x30, /* 0011000 */
3184 0x30, /* 0011000 */
3185 0x3e, /* 0011111 */
3186 0x30, /* 0011000 */
3187 0x3e, /* 0011111 */
3188 0x30, /* 0011000 */
3189 0x30, /* 0011000 */
3190 0x30, /* 0011000 */
3191 0x30, /* 0011000 */
3192 0x30, /* 0011000 */
3193 0x30, /* 0011000 */
3194 0x30, /* 0011000 */
3195
3196 /* 199 0xc7 'Ç' */
3197 0x6c, /* 0110110 */
3198 0x6c, /* 0110110 */
3199 0x6c, /* 0110110 */
3200 0x6c, /* 0110110 */
3201 0x6c, /* 0110110 */
3202 0x6c, /* 0110110 */
3203 0x6e, /* 0110111 */
3204 0x6c, /* 0110110 */
3205 0x6c, /* 0110110 */
3206 0x6c, /* 0110110 */
3207 0x6c, /* 0110110 */
3208 0x6c, /* 0110110 */
3209 0x6c, /* 0110110 */
3210 0x6c, /* 0110110 */
3211
3212 /* 200 0xc8 'È' */
3213 0x6c, /* 0110110 */
3214 0x6c, /* 0110110 */
3215 0x6c, /* 0110110 */
3216 0x6c, /* 0110110 */
3217 0x6e, /* 0110111 */
3218 0x60, /* 0110000 */
3219 0x7e, /* 0111111 */
3220 0x00, /* 0000000 */
3221 0x00, /* 0000000 */
3222 0x00, /* 0000000 */
3223 0x00, /* 0000000 */
3224 0x00, /* 0000000 */
3225 0x00, /* 0000000 */
3226 0x00, /* 0000000 */
3227
3228 /* 201 0xc9 'É' */
3229 0x00, /* 0000000 */
3230 0x00, /* 0000000 */
3231 0x00, /* 0000000 */
3232 0x00, /* 0000000 */
3233 0x7e, /* 0111111 */
3234 0x60, /* 0110000 */
3235 0x6e, /* 0110111 */
3236 0x6c, /* 0110110 */
3237 0x6c, /* 0110110 */
3238 0x6c, /* 0110110 */
3239 0x6c, /* 0110110 */
3240 0x6c, /* 0110110 */
3241 0x6c, /* 0110110 */
3242 0x6c, /* 0110110 */
3243
3244 /* 202 0xca 'Ê' */
3245 0x6c, /* 0110110 */
3246 0x6c, /* 0110110 */
3247 0x6c, /* 0110110 */
3248 0x6c, /* 0110110 */
3249 0xee, /* 1110111 */
3250 0x00, /* 0000000 */
3251 0xfe, /* 1111111 */
3252 0x00, /* 0000000 */
3253 0x00, /* 0000000 */
3254 0x00, /* 0000000 */
3255 0x00, /* 0000000 */
3256 0x00, /* 0000000 */
3257 0x00, /* 0000000 */
3258 0x00, /* 0000000 */
3259
3260 /* 203 0xcb 'Ë' */
3261 0x00, /* 0000000 */
3262 0x00, /* 0000000 */
3263 0x00, /* 0000000 */
3264 0x00, /* 0000000 */
3265 0xfe, /* 1111111 */
3266 0x00, /* 0000000 */
3267 0xee, /* 1110111 */
3268 0x6c, /* 0110110 */
3269 0x6c, /* 0110110 */
3270 0x6c, /* 0110110 */
3271 0x6c, /* 0110110 */
3272 0x6c, /* 0110110 */
3273 0x6c, /* 0110110 */
3274 0x6c, /* 0110110 */
3275
3276 /* 204 0xcc 'Ì' */
3277 0x6c, /* 0110110 */
3278 0x6c, /* 0110110 */
3279 0x6c, /* 0110110 */
3280 0x6c, /* 0110110 */
3281 0x6e, /* 0110111 */
3282 0x60, /* 0110000 */
3283 0x6e, /* 0110111 */
3284 0x6c, /* 0110110 */
3285 0x6c, /* 0110110 */
3286 0x6c, /* 0110110 */
3287 0x6c, /* 0110110 */
3288 0x6c, /* 0110110 */
3289 0x6c, /* 0110110 */
3290 0x6c, /* 0110110 */
3291
3292 /* 205 0xcd 'Í' */
3293 0x00, /* 0000000 */
3294 0x00, /* 0000000 */
3295 0x00, /* 0000000 */
3296 0x00, /* 0000000 */
3297 0xfe, /* 1111111 */
3298 0x00, /* 0000000 */
3299 0xfe, /* 1111111 */
3300 0x00, /* 0000000 */
3301 0x00, /* 0000000 */
3302 0x00, /* 0000000 */
3303 0x00, /* 0000000 */
3304 0x00, /* 0000000 */
3305 0x00, /* 0000000 */
3306 0x00, /* 0000000 */
3307
3308 /* 206 0xce 'Î' */
3309 0x6c, /* 0110110 */
3310 0x6c, /* 0110110 */
3311 0x6c, /* 0110110 */
3312 0x6c, /* 0110110 */
3313 0xee, /* 1110111 */
3314 0x00, /* 0000000 */
3315 0xee, /* 1110111 */
3316 0x6c, /* 0110110 */
3317 0x6c, /* 0110110 */
3318 0x6c, /* 0110110 */
3319 0x6c, /* 0110110 */
3320 0x6c, /* 0110110 */
3321 0x6c, /* 0110110 */
3322 0x6c, /* 0110110 */
3323
3324 /* 207 0xcf 'Ï' */
3325 0x30, /* 0011000 */
3326 0x30, /* 0011000 */
3327 0x30, /* 0011000 */
3328 0x30, /* 0011000 */
3329 0xfe, /* 1111111 */
3330 0x00, /* 0000000 */
3331 0xfe, /* 1111111 */
3332 0x00, /* 0000000 */
3333 0x00, /* 0000000 */
3334 0x00, /* 0000000 */
3335 0x00, /* 0000000 */
3336 0x00, /* 0000000 */
3337 0x00, /* 0000000 */
3338 0x00, /* 0000000 */
3339
3340 /* 208 0xd0 'Ð' */
3341 0x6c, /* 0110110 */
3342 0x6c, /* 0110110 */
3343 0x6c, /* 0110110 */
3344 0x6c, /* 0110110 */
3345 0x6c, /* 0110110 */
3346 0x6c, /* 0110110 */
3347 0xfe, /* 1111111 */
3348 0x00, /* 0000000 */
3349 0x00, /* 0000000 */
3350 0x00, /* 0000000 */
3351 0x00, /* 0000000 */
3352 0x00, /* 0000000 */
3353 0x00, /* 0000000 */
3354 0x00, /* 0000000 */
3355
3356 /* 209 0xd1 'Ñ' */
3357 0x00, /* 0000000 */
3358 0x00, /* 0000000 */
3359 0x00, /* 0000000 */
3360 0x00, /* 0000000 */
3361 0xfe, /* 1111111 */
3362 0x00, /* 0000000 */
3363 0xfe, /* 1111111 */
3364 0x30, /* 0011000 */
3365 0x30, /* 0011000 */
3366 0x30, /* 0011000 */
3367 0x30, /* 0011000 */
3368 0x30, /* 0011000 */
3369 0x30, /* 0011000 */
3370 0x30, /* 0011000 */
3371
3372 /* 210 0xd2 'Ò' */
3373 0x00, /* 0000000 */
3374 0x00, /* 0000000 */
3375 0x00, /* 0000000 */
3376 0x00, /* 0000000 */
3377 0x00, /* 0000000 */
3378 0x00, /* 0000000 */
3379 0xfe, /* 1111111 */
3380 0x6c, /* 0110110 */
3381 0x6c, /* 0110110 */
3382 0x6c, /* 0110110 */
3383 0x6c, /* 0110110 */
3384 0x6c, /* 0110110 */
3385 0x6c, /* 0110110 */
3386 0x6c, /* 0110110 */
3387
3388 /* 211 0xd3 'Ó' */
3389 0x6c, /* 0110110 */
3390 0x6c, /* 0110110 */
3391 0x6c, /* 0110110 */
3392 0x6c, /* 0110110 */
3393 0x6c, /* 0110110 */
3394 0x6c, /* 0110110 */
3395 0x7e, /* 0111111 */
3396 0x00, /* 0000000 */
3397 0x00, /* 0000000 */
3398 0x00, /* 0000000 */
3399 0x00, /* 0000000 */
3400 0x00, /* 0000000 */
3401 0x00, /* 0000000 */
3402 0x00, /* 0000000 */
3403
3404 /* 212 0xd4 'Ô' */
3405 0x30, /* 0011000 */
3406 0x30, /* 0011000 */
3407 0x30, /* 0011000 */
3408 0x30, /* 0011000 */
3409 0x3e, /* 0011111 */
3410 0x30, /* 0011000 */
3411 0x3e, /* 0011111 */
3412 0x00, /* 0000000 */
3413 0x00, /* 0000000 */
3414 0x00, /* 0000000 */
3415 0x00, /* 0000000 */
3416 0x00, /* 0000000 */
3417 0x00, /* 0000000 */
3418 0x00, /* 0000000 */
3419
3420 /* 213 0xd5 'Õ' */
3421 0x00, /* 0000000 */
3422 0x00, /* 0000000 */
3423 0x00, /* 0000000 */
3424 0x00, /* 0000000 */
3425 0x3e, /* 0011111 */
3426 0x30, /* 0011000 */
3427 0x3e, /* 0011111 */
3428 0x30, /* 0011000 */
3429 0x30, /* 0011000 */
3430 0x30, /* 0011000 */
3431 0x30, /* 0011000 */
3432 0x30, /* 0011000 */
3433 0x30, /* 0011000 */
3434 0x30, /* 0011000 */
3435
3436 /* 214 0xd6 'Ö' */
3437 0x00, /* 0000000 */
3438 0x00, /* 0000000 */
3439 0x00, /* 0000000 */
3440 0x00, /* 0000000 */
3441 0x00, /* 0000000 */
3442 0x00, /* 0000000 */
3443 0x7e, /* 0111111 */
3444 0x6c, /* 0110110 */
3445 0x6c, /* 0110110 */
3446 0x6c, /* 0110110 */
3447 0x6c, /* 0110110 */
3448 0x6c, /* 0110110 */
3449 0x6c, /* 0110110 */
3450 0x6c, /* 0110110 */
3451
3452 /* 215 0xd7 '×' */
3453 0x6c, /* 0110110 */
3454 0x6c, /* 0110110 */
3455 0x6c, /* 0110110 */
3456 0x6c, /* 0110110 */
3457 0x6c, /* 0110110 */
3458 0x6c, /* 0110110 */
3459 0xfe, /* 1111111 */
3460 0x6c, /* 0110110 */
3461 0x6c, /* 0110110 */
3462 0x6c, /* 0110110 */
3463 0x6c, /* 0110110 */
3464 0x6c, /* 0110110 */
3465 0x6c, /* 0110110 */
3466 0x6c, /* 0110110 */
3467
3468 /* 216 0xd8 'Ø' */
3469 0x30, /* 0011000 */
3470 0x30, /* 0011000 */
3471 0x30, /* 0011000 */
3472 0x30, /* 0011000 */
3473 0xfe, /* 1111111 */
3474 0x30, /* 0011000 */
3475 0xfe, /* 1111111 */
3476 0x30, /* 0011000 */
3477 0x30, /* 0011000 */
3478 0x30, /* 0011000 */
3479 0x30, /* 0011000 */
3480 0x30, /* 0011000 */
3481 0x30, /* 0011000 */
3482 0x30, /* 0011000 */
3483
3484 /* 217 0xd9 'Ù' */
3485 0x30, /* 0011000 */
3486 0x30, /* 0011000 */
3487 0x30, /* 0011000 */
3488 0x30, /* 0011000 */
3489 0x30, /* 0011000 */
3490 0x30, /* 0011000 */
3491 0xf0, /* 1111000 */
3492 0x00, /* 0000000 */
3493 0x00, /* 0000000 */
3494 0x00, /* 0000000 */
3495 0x00, /* 0000000 */
3496 0x00, /* 0000000 */
3497 0x00, /* 0000000 */
3498 0x00, /* 0000000 */
3499
3500 /* 218 0xda 'Ú' */
3501 0x00, /* 0000000 */
3502 0x00, /* 0000000 */
3503 0x00, /* 0000000 */
3504 0x00, /* 0000000 */
3505 0x00, /* 0000000 */
3506 0x00, /* 0000000 */
3507 0x3e, /* 0011111 */
3508 0x30, /* 0011000 */
3509 0x30, /* 0011000 */
3510 0x30, /* 0011000 */
3511 0x30, /* 0011000 */
3512 0x30, /* 0011000 */
3513 0x30, /* 0011000 */
3514 0x30, /* 0011000 */
3515
3516 /* 219 0xdb 'Û' */
3517 0xfe, /* 1111111 */
3518 0xfe, /* 1111111 */
3519 0xfe, /* 1111111 */
3520 0xfe, /* 1111111 */
3521 0xfe, /* 1111111 */
3522 0xfe, /* 1111111 */
3523 0xfe, /* 1111111 */
3524 0xfe, /* 1111111 */
3525 0xfe, /* 1111111 */
3526 0xfe, /* 1111111 */
3527 0xfe, /* 1111111 */
3528 0xfe, /* 1111111 */
3529 0xfe, /* 1111111 */
3530 0xfe, /* 1111111 */
3531
3532 /* 220 0xdc 'Ü' */
3533 0x00, /* 0000000 */
3534 0x00, /* 0000000 */
3535 0x00, /* 0000000 */
3536 0x00, /* 0000000 */
3537 0x00, /* 0000000 */
3538 0x00, /* 0000000 */
3539 0xfe, /* 1111111 */
3540 0xfe, /* 1111111 */
3541 0xfe, /* 1111111 */
3542 0xfe, /* 1111111 */
3543 0xfe, /* 1111111 */
3544 0xfe, /* 1111111 */
3545 0xfe, /* 1111111 */
3546 0xfe, /* 1111111 */
3547
3548 /* 221 0xdd 'Ý' */
3549 0xe0, /* 1110000 */
3550 0xe0, /* 1110000 */
3551 0xe0, /* 1110000 */
3552 0xe0, /* 1110000 */
3553 0xe0, /* 1110000 */
3554 0xe0, /* 1110000 */
3555 0xe0, /* 1110000 */
3556 0xe0, /* 1110000 */
3557 0xe0, /* 1110000 */
3558 0xe0, /* 1110000 */
3559 0xe0, /* 1110000 */
3560 0xe0, /* 1110000 */
3561 0xe0, /* 1110000 */
3562 0xe0, /* 1110000 */
3563
3564 /* 222 0xde 'Þ' */
3565 0x1e, /* 0001111 */
3566 0x1e, /* 0001111 */
3567 0x1e, /* 0001111 */
3568 0x1e, /* 0001111 */
3569 0x1e, /* 0001111 */
3570 0x1e, /* 0001111 */
3571 0x1e, /* 0001111 */
3572 0x1e, /* 0001111 */
3573 0x1e, /* 0001111 */
3574 0x1e, /* 0001111 */
3575 0x1e, /* 0001111 */
3576 0x1e, /* 0001111 */
3577 0x1e, /* 0001111 */
3578 0x1e, /* 0001111 */
3579
3580 /* 223 0xdf 'ß' */
3581 0xfe, /* 1111111 */
3582 0xfe, /* 1111111 */
3583 0xfe, /* 1111111 */
3584 0xfe, /* 1111111 */
3585 0xfe, /* 1111111 */
3586 0xfe, /* 1111111 */
3587 0x00, /* 0000000 */
3588 0x00, /* 0000000 */
3589 0x00, /* 0000000 */
3590 0x00, /* 0000000 */
3591 0x00, /* 0000000 */
3592 0x00, /* 0000000 */
3593 0x00, /* 0000000 */
3594 0x00, /* 0000000 */
3595
3596 /* 224 0xe0 'à' */
3597 0x00, /* 0000000 */
3598 0x00, /* 0000000 */
3599 0x00, /* 0000000 */
3600 0x00, /* 0000000 */
3601 0x76, /* 0111011 */
3602 0xdc, /* 1101110 */
3603 0xd8, /* 1101100 */
3604 0xd8, /* 1101100 */
3605 0xd8, /* 1101100 */
3606 0xdc, /* 1101110 */
3607 0x76, /* 0111011 */
3608 0x00, /* 0000000 */
3609 0x00, /* 0000000 */
3610 0x00, /* 0000000 */
3611
3612 /* 225 0xe1 'á' */
3613 0x00, /* 0000000 */
3614 0x78, /* 0111100 */
3615 0xcc, /* 1100110 */
3616 0xcc, /* 1100110 */
3617 0xcc, /* 1100110 */
3618 0xd8, /* 1101100 */
3619 0xcc, /* 1100110 */
3620 0xc6, /* 1100011 */
3621 0xc6, /* 1100011 */
3622 0xc6, /* 1100011 */
3623 0xcc, /* 1100110 */
3624 0x00, /* 0000000 */
3625 0x00, /* 0000000 */
3626 0x00, /* 0000000 */
3627
3628 /* 226 0xe2 'â' */
3629 0x00, /* 0000000 */
3630 0xfc, /* 1111110 */
3631 0xcc, /* 1100110 */
3632 0xcc, /* 1100110 */
3633 0xc0, /* 1100000 */
3634 0xc0, /* 1100000 */
3635 0xc0, /* 1100000 */
3636 0xc0, /* 1100000 */
3637 0xc0, /* 1100000 */
3638 0xc0, /* 1100000 */
3639 0xc0, /* 1100000 */
3640 0x00, /* 0000000 */
3641 0x00, /* 0000000 */
3642 0x00, /* 0000000 */
3643
3644 /* 227 0xe3 'ã' */
3645 0x00, /* 0000000 */
3646 0x00, /* 0000000 */
3647 0xfe, /* 1111111 */
3648 0xfe, /* 1111111 */
3649 0x6c, /* 0110110 */
3650 0x6c, /* 0110110 */
3651 0x6c, /* 0110110 */
3652 0x6c, /* 0110110 */
3653 0x6c, /* 0110110 */
3654 0x6c, /* 0110110 */
3655 0x6c, /* 0110110 */
3656 0x00, /* 0000000 */
3657 0x00, /* 0000000 */
3658 0x00, /* 0000000 */
3659
3660 /* 228 0xe4 'ä' */
3661 0x00, /* 0000000 */
3662 0xfc, /* 1111110 */
3663 0xcc, /* 1100110 */
3664 0x60, /* 0110000 */
3665 0x30, /* 0011000 */
3666 0x18, /* 0001100 */
3667 0x18, /* 0001100 */
3668 0x30, /* 0011000 */
3669 0x60, /* 0110000 */
3670 0xcc, /* 1100110 */
3671 0xfc, /* 1111110 */
3672 0x00, /* 0000000 */
3673 0x00, /* 0000000 */
3674 0x00, /* 0000000 */
3675
3676 /* 229 0xe5 'å' */
3677 0x00, /* 0000000 */
3678 0x00, /* 0000000 */
3679 0x00, /* 0000000 */
3680 0x00, /* 0000000 */
3681 0x7e, /* 0111111 */
3682 0xd8, /* 1101100 */
3683 0xd8, /* 1101100 */
3684 0xd8, /* 1101100 */
3685 0xd8, /* 1101100 */
3686 0xd8, /* 1101100 */
3687 0x70, /* 0111000 */
3688 0x00, /* 0000000 */
3689 0x00, /* 0000000 */
3690 0x00, /* 0000000 */
3691
3692 /* 230 0xe6 'æ' */
3693 0x00, /* 0000000 */
3694 0x00, /* 0000000 */
3695 0x00, /* 0000000 */
3696 0x00, /* 0000000 */
3697 0xcc, /* 1100110 */
3698 0xcc, /* 1100110 */
3699 0xcc, /* 1100110 */
3700 0xcc, /* 1100110 */
3701 0xcc, /* 1100110 */
3702 0xcc, /* 1100110 */
3703 0xf8, /* 1111100 */
3704 0xc0, /* 1100000 */
3705 0xc0, /* 1100000 */
3706 0x80, /* 1000000 */
3707
3708 /* 231 0xe7 'ç' */
3709 0x00, /* 0000000 */
3710 0x00, /* 0000000 */
3711 0x00, /* 0000000 */
3712 0x76, /* 0111011 */
3713 0xdc, /* 1101110 */
3714 0x18, /* 0001100 */
3715 0x18, /* 0001100 */
3716 0x18, /* 0001100 */
3717 0x18, /* 0001100 */
3718 0x18, /* 0001100 */
3719 0x18, /* 0001100 */
3720 0x00, /* 0000000 */
3721 0x00, /* 0000000 */
3722 0x00, /* 0000000 */
3723
3724 /* 232 0xe8 'è' */
3725 0x00, /* 0000000 */
3726 0xfc, /* 1111110 */
3727 0x30, /* 0011000 */
3728 0x78, /* 0111100 */
3729 0xcc, /* 1100110 */
3730 0xcc, /* 1100110 */
3731 0xcc, /* 1100110 */
3732 0xcc, /* 1100110 */
3733 0x78, /* 0111100 */
3734 0x30, /* 0011000 */
3735 0xfc, /* 1111110 */
3736 0x00, /* 0000000 */
3737 0x00, /* 0000000 */
3738 0x00, /* 0000000 */
3739
3740 /* 233 0xe9 'é' */
3741 0x00, /* 0000000 */
3742 0x38, /* 0011100 */
3743 0x6c, /* 0110110 */
3744 0xcc, /* 1100110 */
3745 0xcc, /* 1100110 */
3746 0xfc, /* 1111110 */
3747 0xcc, /* 1100110 */
3748 0xcc, /* 1100110 */
3749 0xcc, /* 1100110 */
3750 0x6c, /* 0110110 */
3751 0x38, /* 0011100 */
3752 0x00, /* 0000000 */
3753 0x00, /* 0000000 */
3754 0x00, /* 0000000 */
3755
3756 /* 234 0xea 'ê' */
3757 0x00, /* 0000000 */
3758 0x38, /* 0011100 */
3759 0x6c, /* 0110110 */
3760 0xc6, /* 1100011 */
3761 0xc6, /* 1100011 */
3762 0xc6, /* 1100011 */
3763 0x6c, /* 0110110 */
3764 0x6c, /* 0110110 */
3765 0x6c, /* 0110110 */
3766 0x6c, /* 0110110 */
3767 0xee, /* 1110111 */
3768 0x00, /* 0000000 */
3769 0x00, /* 0000000 */
3770 0x00, /* 0000000 */
3771
3772 /* 235 0xeb 'ë' */
3773 0x00, /* 0000000 */
3774 0x3c, /* 0011110 */
3775 0x60, /* 0110000 */
3776 0x30, /* 0011000 */
3777 0x18, /* 0001100 */
3778 0x7c, /* 0111110 */
3779 0xcc, /* 1100110 */
3780 0xcc, /* 1100110 */
3781 0xcc, /* 1100110 */
3782 0xcc, /* 1100110 */
3783 0x78, /* 0111100 */
3784 0x00, /* 0000000 */
3785 0x00, /* 0000000 */
3786 0x00, /* 0000000 */
3787
3788 /* 236 0xec 'ì' */
3789 0x00, /* 0000000 */
3790 0x00, /* 0000000 */
3791 0x00, /* 0000000 */
3792 0x00, /* 0000000 */
3793 0x7c, /* 0111110 */
3794 0xd6, /* 1101011 */
3795 0xd6, /* 1101011 */
3796 0xd6, /* 1101011 */
3797 0x7c, /* 0111110 */
3798 0x00, /* 0000000 */
3799 0x00, /* 0000000 */
3800 0x00, /* 0000000 */
3801 0x00, /* 0000000 */
3802 0x00, /* 0000000 */
3803
3804 /* 237 0xed 'í' */
3805 0x00, /* 0000000 */
3806 0x00, /* 0000000 */
3807 0x06, /* 0000011 */
3808 0x0c, /* 0000110 */
3809 0x7c, /* 0111110 */
3810 0xd6, /* 1101011 */
3811 0xd6, /* 1101011 */
3812 0xe6, /* 1110011 */
3813 0x7c, /* 0111110 */
3814 0x60, /* 0110000 */
3815 0xc0, /* 1100000 */
3816 0x00, /* 0000000 */
3817 0x00, /* 0000000 */
3818 0x00, /* 0000000 */
3819
3820 /* 238 0xee 'î' */
3821 0x00, /* 0000000 */
3822 0x1c, /* 0001110 */
3823 0x30, /* 0011000 */
3824 0x60, /* 0110000 */
3825 0x60, /* 0110000 */
3826 0x7c, /* 0111110 */
3827 0x60, /* 0110000 */
3828 0x60, /* 0110000 */
3829 0x60, /* 0110000 */
3830 0x30, /* 0011000 */
3831 0x1c, /* 0001110 */
3832 0x00, /* 0000000 */
3833 0x00, /* 0000000 */
3834 0x00, /* 0000000 */
3835
3836 /* 239 0xef 'ï' */
3837 0x00, /* 0000000 */
3838 0x00, /* 0000000 */
3839 0x78, /* 0111100 */
3840 0xcc, /* 1100110 */
3841 0xcc, /* 1100110 */
3842 0xcc, /* 1100110 */
3843 0xcc, /* 1100110 */
3844 0xcc, /* 1100110 */
3845 0xcc, /* 1100110 */
3846 0xcc, /* 1100110 */
3847 0xcc, /* 1100110 */
3848 0x00, /* 0000000 */
3849 0x00, /* 0000000 */
3850 0x00, /* 0000000 */
3851
3852 /* 240 0xf0 'ð' */
3853 0x00, /* 0000000 */
3854 0x00, /* 0000000 */
3855 0x00, /* 0000000 */
3856 0xfc, /* 1111110 */
3857 0x00, /* 0000000 */
3858 0x00, /* 0000000 */
3859 0xfc, /* 1111110 */
3860 0x00, /* 0000000 */
3861 0x00, /* 0000000 */
3862 0xfc, /* 1111110 */
3863 0x00, /* 0000000 */
3864 0x00, /* 0000000 */
3865 0x00, /* 0000000 */
3866 0x00, /* 0000000 */
3867
3868 /* 241 0xf1 'ñ' */
3869 0x00, /* 0000000 */
3870 0x00, /* 0000000 */
3871 0x00, /* 0000000 */
3872 0x30, /* 0011000 */
3873 0x30, /* 0011000 */
3874 0xfc, /* 1111110 */
3875 0x30, /* 0011000 */
3876 0x30, /* 0011000 */
3877 0x00, /* 0000000 */
3878 0x00, /* 0000000 */
3879 0xfc, /* 1111110 */
3880 0x00, /* 0000000 */
3881 0x00, /* 0000000 */
3882 0x00, /* 0000000 */
3883
3884 /* 242 0xf2 'ò' */
3885 0x00, /* 0000000 */
3886 0x00, /* 0000000 */
3887 0x60, /* 0110000 */
3888 0x30, /* 0011000 */
3889 0x18, /* 0001100 */
3890 0x0c, /* 0000110 */
3891 0x18, /* 0001100 */
3892 0x30, /* 0011000 */
3893 0x60, /* 0110000 */
3894 0x00, /* 0000000 */
3895 0xfc, /* 1111110 */
3896 0x00, /* 0000000 */
3897 0x00, /* 0000000 */
3898 0x00, /* 0000000 */
3899
3900 /* 243 0xf3 'ó' */
3901 0x00, /* 0000000 */
3902 0x00, /* 0000000 */
3903 0x18, /* 0001100 */
3904 0x30, /* 0011000 */
3905 0x60, /* 0110000 */
3906 0xc0, /* 1100000 */
3907 0x60, /* 0110000 */
3908 0x30, /* 0011000 */
3909 0x18, /* 0001100 */
3910 0x00, /* 0000000 */
3911 0xfc, /* 1111110 */
3912 0x00, /* 0000000 */
3913 0x00, /* 0000000 */
3914 0x00, /* 0000000 */
3915
3916 /* 244 0xf4 'ô' */
3917 0x00, /* 0000000 */
3918 0x1c, /* 0001110 */
3919 0x36, /* 0011011 */
3920 0x36, /* 0011011 */
3921 0x30, /* 0011000 */
3922 0x30, /* 0011000 */
3923 0x30, /* 0011000 */
3924 0x30, /* 0011000 */
3925 0x30, /* 0011000 */
3926 0x30, /* 0011000 */
3927 0x30, /* 0011000 */
3928 0x30, /* 0011000 */
3929 0x30, /* 0011000 */
3930 0x30, /* 0011000 */
3931
3932 /* 245 0xf5 'õ' */
3933 0x18, /* 0001100 */
3934 0x18, /* 0001100 */
3935 0x18, /* 0001100 */
3936 0x18, /* 0001100 */
3937 0x18, /* 0001100 */
3938 0x18, /* 0001100 */
3939 0x18, /* 0001100 */
3940 0x18, /* 0001100 */
3941 0xd8, /* 1101100 */
3942 0xd8, /* 1101100 */
3943 0xd8, /* 1101100 */
3944 0x70, /* 0111000 */
3945 0x00, /* 0000000 */
3946 0x00, /* 0000000 */
3947
3948 /* 246 0xf6 'ö' */
3949 0x00, /* 0000000 */
3950 0x00, /* 0000000 */
3951 0x00, /* 0000000 */
3952 0x00, /* 0000000 */
3953 0x30, /* 0011000 */
3954 0x00, /* 0000000 */
3955 0xfc, /* 1111110 */
3956 0x00, /* 0000000 */
3957 0x30, /* 0011000 */
3958 0x00, /* 0000000 */
3959 0x00, /* 0000000 */
3960 0x00, /* 0000000 */
3961 0x00, /* 0000000 */
3962 0x00, /* 0000000 */
3963
3964 /* 247 0xf7 '÷' */
3965 0x00, /* 0000000 */
3966 0x00, /* 0000000 */
3967 0x00, /* 0000000 */
3968 0x00, /* 0000000 */
3969 0x76, /* 0111011 */
3970 0xdc, /* 1101110 */
3971 0x00, /* 0000000 */
3972 0x76, /* 0111011 */
3973 0xdc, /* 1101110 */
3974 0x00, /* 0000000 */
3975 0x00, /* 0000000 */
3976 0x00, /* 0000000 */
3977 0x00, /* 0000000 */
3978 0x00, /* 0000000 */
3979
3980 /* 248 0xf8 'ø' */
3981 0x38, /* 0011100 */
3982 0x6c, /* 0110110 */
3983 0x6c, /* 0110110 */
3984 0x38, /* 0011100 */
3985 0x00, /* 0000000 */
3986 0x00, /* 0000000 */
3987 0x00, /* 0000000 */
3988 0x00, /* 0000000 */
3989 0x00, /* 0000000 */
3990 0x00, /* 0000000 */
3991 0x00, /* 0000000 */
3992 0x00, /* 0000000 */
3993 0x00, /* 0000000 */
3994 0x00, /* 0000000 */
3995
3996 /* 249 0xf9 'ù' */
3997 0x00, /* 0000000 */
3998 0x00, /* 0000000 */
3999 0x00, /* 0000000 */
4000 0x00, /* 0000000 */
4001 0x00, /* 0000000 */
4002 0x00, /* 0000000 */
4003 0x30, /* 0011000 */
4004 0x30, /* 0011000 */
4005 0x00, /* 0000000 */
4006 0x00, /* 0000000 */
4007 0x00, /* 0000000 */
4008 0x00, /* 0000000 */
4009 0x00, /* 0000000 */
4010 0x00, /* 0000000 */
4011
4012 /* 250 0xfa 'ú' */
4013 0x00, /* 0000000 */
4014 0x00, /* 0000000 */
4015 0x00, /* 0000000 */
4016 0x00, /* 0000000 */
4017 0x00, /* 0000000 */
4018 0x00, /* 0000000 */
4019 0x30, /* 0011000 */
4020 0x00, /* 0000000 */
4021 0x00, /* 0000000 */
4022 0x00, /* 0000000 */
4023 0x00, /* 0000000 */
4024 0x00, /* 0000000 */
4025 0x00, /* 0000000 */
4026 0x00, /* 0000000 */
4027
4028 /* 251 0xfb 'û' */
4029 0x1e, /* 0001111 */
4030 0x18, /* 0001100 */
4031 0x18, /* 0001100 */
4032 0x18, /* 0001100 */
4033 0x18, /* 0001100 */
4034 0x18, /* 0001100 */
4035 0xd8, /* 1101100 */
4036 0xd8, /* 1101100 */
4037 0xd8, /* 1101100 */
4038 0x78, /* 0111100 */
4039 0x38, /* 0011100 */
4040 0x00, /* 0000000 */
4041 0x00, /* 0000000 */
4042 0x00, /* 0000000 */
4043
4044 /* 252 0xfc 'ü' */
4045 0xd8, /* 1101100 */
4046 0x6c, /* 0110110 */
4047 0x6c, /* 0110110 */
4048 0x6c, /* 0110110 */
4049 0x6c, /* 0110110 */
4050 0x6c, /* 0110110 */
4051 0x00, /* 0000000 */
4052 0x00, /* 0000000 */
4053 0x00, /* 0000000 */
4054 0x00, /* 0000000 */
4055 0x00, /* 0000000 */
4056 0x00, /* 0000000 */
4057 0x00, /* 0000000 */
4058 0x00, /* 0000000 */
4059
4060 /* 253 0xfd 'ý' */
4061 0x78, /* 0111100 */
4062 0xcc, /* 1100110 */
4063 0x18, /* 0001100 */
4064 0x30, /* 0011000 */
4065 0x64, /* 0110010 */
4066 0xfc, /* 1111110 */
4067 0x00, /* 0000000 */
4068 0x00, /* 0000000 */
4069 0x00, /* 0000000 */
4070 0x00, /* 0000000 */
4071 0x00, /* 0000000 */
4072 0x00, /* 0000000 */
4073 0x00, /* 0000000 */
4074 0x00, /* 0000000 */
4075
4076 /* 254 0xfe 'þ' */
4077 0x00, /* 0000000 */
4078 0x00, /* 0000000 */
4079 0x00, /* 0000000 */
4080 0x7c, /* 0111110 */
4081 0x7c, /* 0111110 */
4082 0x7c, /* 0111110 */
4083 0x7c, /* 0111110 */
4084 0x7c, /* 0111110 */
4085 0x7c, /* 0111110 */
4086 0x7c, /* 0111110 */
4087 0x00, /* 0000000 */
4088 0x00, /* 0000000 */
4089 0x00, /* 0000000 */
4090 0x00, /* 0000000 */
4091
4092 /* 255 0xff 'ÿ' */
4093 0x00, /* 0000000 */
4094 0x00, /* 0000000 */
4095 0x00, /* 0000000 */
4096 0x00, /* 0000000 */
4097 0x00, /* 0000000 */
4098 0x00, /* 0000000 */
4099 0x00, /* 0000000 */
4100 0x00, /* 0000000 */
4101 0x00, /* 0000000 */
4102 0x00, /* 0000000 */
4103 0x00, /* 0000000 */
4104 0x00, /* 0000000 */
4105 0x00, /* 0000000 */
4106 0x00, /* 0000000 */
4107
4108};
4109
4110
4111struct font_desc font_7x14 = {
4112 FONT7x14_IDX,
4113 "7x14",
4114 7,
4115 14,
4116 fontdata_7x14,
4117 0
4118};
diff --git a/drivers/video/console/font_sun12x22.c b/drivers/video/console/font_sun12x22.c
index 05215d0c3e09..c7bd967ea100 100644
--- a/drivers/video/console/font_sun12x22.c
+++ b/drivers/video/console/font_sun12x22.c
@@ -29,24 +29,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
29 0x00, 0x00, /* 000000000000 */ 29 0x00, 0x00, /* 000000000000 */
30 30
31 /* 1 0x01 '^A' */ 31 /* 1 0x01 '^A' */
32 /* FIXME */
33 0x00, 0x00, /* 000000000000 */ 32 0x00, 0x00, /* 000000000000 */
34 0x00, 0x00, /* 000000000000 */ 33 0x00, 0x00, /* 000000000000 */
35 0x00, 0x00, /* 000000000000 */ 34 0x00, 0x00, /* 000000000000 */
36 0x00, 0x00, /* 000000000000 */ 35 0x00, 0x00, /* 000000000000 */
36 0x1f, 0xc0, /* 000111111100 */
37 0x30, 0x60, /* 001100000110 */
38 0x65, 0x30, /* 011001010011 */
39 0x6d, 0xb0, /* 011011011011 */
40 0x60, 0x30, /* 011000000011 */
41 0x62, 0x30, /* 011000100011 */
42 0x62, 0x30, /* 011000100011 */
43 0x60, 0x30, /* 011000000011 */
44 0x6f, 0xb0, /* 011011111011 */
45 0x67, 0x30, /* 011001110011 */
46 0x30, 0x60, /* 001100000110 */
47 0x1f, 0xc0, /* 000111111100 */
37 0x00, 0x00, /* 000000000000 */ 48 0x00, 0x00, /* 000000000000 */
38 0x3f, 0xc0, /* 001111111100 */
39 0x3f, 0xc0, /* 001111111100 */
40 0x3f, 0xc0, /* 001111111100 */
41 0x3f, 0xc0, /* 001111111100 */
42 0x3f, 0xc0, /* 001111111100 */
43 0x3f, 0xc0, /* 001111111100 */
44 0x3f, 0xc0, /* 001111111100 */
45 0x3f, 0xc0, /* 001111111100 */
46 0x3f, 0xc0, /* 001111111100 */
47 0x3f, 0xc0, /* 001111111100 */
48 0x3f, 0xc0, /* 001111111100 */
49 0x3f, 0xc0, /* 001111111100 */
50 0x00, 0x00, /* 000000000000 */ 49 0x00, 0x00, /* 000000000000 */
51 0x00, 0x00, /* 000000000000 */ 50 0x00, 0x00, /* 000000000000 */
52 0x00, 0x00, /* 000000000000 */ 51 0x00, 0x00, /* 000000000000 */
@@ -54,24 +53,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
54 0x00, 0x00, /* 000000000000 */ 53 0x00, 0x00, /* 000000000000 */
55 54
56 /* 2 0x02 '^B' */ 55 /* 2 0x02 '^B' */
57 /* FIXME */
58 0x00, 0x00, /* 000000000000 */ 56 0x00, 0x00, /* 000000000000 */
59 0x00, 0x00, /* 000000000000 */ 57 0x00, 0x00, /* 000000000000 */
60 0x00, 0x00, /* 000000000000 */ 58 0x00, 0x00, /* 000000000000 */
61 0x00, 0x00, /* 000000000000 */ 59 0x00, 0x00, /* 000000000000 */
60 0x1f, 0xc0, /* 000111111100 */
61 0x3f, 0xe0, /* 001111111110 */
62 0x7a, 0xf0, /* 011110101111 */
63 0x72, 0x70, /* 011100100111 */
64 0x7f, 0xf0, /* 011111111111 */
65 0x7d, 0xf0, /* 011111011111 */
66 0x7d, 0xf0, /* 011111011111 */
67 0x7f, 0xf0, /* 011111111111 */
68 0x70, 0x70, /* 011100000111 */
69 0x78, 0xf0, /* 011110001111 */
70 0x3f, 0xe0, /* 001111111110 */
71 0x1f, 0xc0, /* 000111111100 */
62 0x00, 0x00, /* 000000000000 */ 72 0x00, 0x00, /* 000000000000 */
63 0x3f, 0xc0, /* 001111111100 */
64 0x3f, 0xc0, /* 001111111100 */
65 0x3f, 0xc0, /* 001111111100 */
66 0x3f, 0xc0, /* 001111111100 */
67 0x3f, 0xc0, /* 001111111100 */
68 0x3f, 0xc0, /* 001111111100 */
69 0x3f, 0xc0, /* 001111111100 */
70 0x3f, 0xc0, /* 001111111100 */
71 0x3f, 0xc0, /* 001111111100 */
72 0x3f, 0xc0, /* 001111111100 */
73 0x3f, 0xc0, /* 001111111100 */
74 0x3f, 0xc0, /* 001111111100 */
75 0x00, 0x00, /* 000000000000 */ 73 0x00, 0x00, /* 000000000000 */
76 0x00, 0x00, /* 000000000000 */ 74 0x00, 0x00, /* 000000000000 */
77 0x00, 0x00, /* 000000000000 */ 75 0x00, 0x00, /* 000000000000 */
@@ -79,24 +77,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
79 0x00, 0x00, /* 000000000000 */ 77 0x00, 0x00, /* 000000000000 */
80 78
81 /* 3 0x03 '^C' */ 79 /* 3 0x03 '^C' */
82 /* FIXME */
83 0x00, 0x00, /* 000000000000 */ 80 0x00, 0x00, /* 000000000000 */
84 0x00, 0x00, /* 000000000000 */ 81 0x00, 0x00, /* 000000000000 */
85 0x00, 0x00, /* 000000000000 */ 82 0x00, 0x00, /* 000000000000 */
86 0x00, 0x00, /* 000000000000 */ 83 0x00, 0x00, /* 000000000000 */
87 0x00, 0x00, /* 000000000000 */ 84 0x00, 0x00, /* 000000000000 */
85 0x00, 0x00, /* 000000000000 */
86 0x19, 0x80, /* 000110011000 */
88 0x3f, 0xc0, /* 001111111100 */ 87 0x3f, 0xc0, /* 001111111100 */
88 0x7f, 0xe0, /* 011111111110 */
89 0x3f, 0xc0, /* 001111111100 */ 89 0x3f, 0xc0, /* 001111111100 */
90 0x3f, 0xc0, /* 001111111100 */ 90 0x3f, 0xc0, /* 001111111100 */
91 0x3f, 0xc0, /* 001111111100 */ 91 0x1f, 0x80, /* 000111111000 */
92 0x3f, 0xc0, /* 001111111100 */ 92 0x1f, 0x80, /* 000111111000 */
93 0x3f, 0xc0, /* 001111111100 */ 93 0x0f, 0x00, /* 000011110000 */
94 0x3f, 0xc0, /* 001111111100 */ 94 0x0f, 0x00, /* 000011110000 */
95 0x3f, 0xc0, /* 001111111100 */ 95 0x06, 0x00, /* 000001100000 */
96 0x3f, 0xc0, /* 001111111100 */ 96 0x00, 0x00, /* 000000000000 */
97 0x3f, 0xc0, /* 001111111100 */
98 0x3f, 0xc0, /* 001111111100 */
99 0x3f, 0xc0, /* 001111111100 */
100 0x00, 0x00, /* 000000000000 */ 97 0x00, 0x00, /* 000000000000 */
101 0x00, 0x00, /* 000000000000 */ 98 0x00, 0x00, /* 000000000000 */
102 0x00, 0x00, /* 000000000000 */ 99 0x00, 0x00, /* 000000000000 */
@@ -104,49 +101,47 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
104 0x00, 0x00, /* 000000000000 */ 101 0x00, 0x00, /* 000000000000 */
105 102
106 /* 4 0x04 '^D' */ 103 /* 4 0x04 '^D' */
107 /* FIXME */
108 0x00, 0x00, /* 000000000000 */ 104 0x00, 0x00, /* 000000000000 */
109 0x00, 0x00, /* 000000000000 */ 105 0x00, 0x00, /* 000000000000 */
110 0x00, 0x00, /* 000000000000 */ 106 0x00, 0x00, /* 000000000000 */
107 0x02, 0x00, /* 000000100000 */
108 0x07, 0x00, /* 000001110000 */
109 0x0f, 0x80, /* 000011111000 */
110 0x0f, 0x80, /* 000011111000 */
111 0x1f, 0xc0, /* 000111111100 */
112 0x1f, 0xc0, /* 000111111100 */
113 0x3f, 0xe0, /* 001111111110 */
114 0x1f, 0xc0, /* 000111111100 */
115 0x1f, 0xc0, /* 000111111100 */
116 0x0f, 0x80, /* 000011111000 */
117 0x0f, 0x80, /* 000011111000 */
118 0x07, 0x00, /* 000001110000 */
119 0x02, 0x00, /* 000000100000 */
111 0x00, 0x00, /* 000000000000 */ 120 0x00, 0x00, /* 000000000000 */
112 0x00, 0x00, /* 000000000000 */ 121 0x00, 0x00, /* 000000000000 */
113 0x3f, 0xc0, /* 001111111100 */
114 0x3f, 0xc0, /* 001111111100 */
115 0x3f, 0xc0, /* 001111111100 */
116 0x3f, 0xc0, /* 001111111100 */
117 0x3f, 0xc0, /* 001111111100 */
118 0x3f, 0xc0, /* 001111111100 */
119 0x3f, 0xc0, /* 001111111100 */
120 0x3f, 0xc0, /* 001111111100 */
121 0x3f, 0xc0, /* 001111111100 */
122 0x3f, 0xc0, /* 001111111100 */
123 0x3f, 0xc0, /* 001111111100 */
124 0x3f, 0xc0, /* 001111111100 */
125 0x00, 0x00, /* 000000000000 */
126 0x00, 0x00, /* 000000000000 */ 122 0x00, 0x00, /* 000000000000 */
127 0x00, 0x00, /* 000000000000 */ 123 0x00, 0x00, /* 000000000000 */
128 0x00, 0x00, /* 000000000000 */ 124 0x00, 0x00, /* 000000000000 */
129 0x00, 0x00, /* 000000000000 */ 125 0x00, 0x00, /* 000000000000 */
130 126
131 /* 5 0x05 '^E' */ 127 /* 5 0x05 '^E' */
132 /* FIXME */
133 0x00, 0x00, /* 000000000000 */ 128 0x00, 0x00, /* 000000000000 */
134 0x00, 0x00, /* 000000000000 */ 129 0x00, 0x00, /* 000000000000 */
135 0x00, 0x00, /* 000000000000 */ 130 0x00, 0x00, /* 000000000000 */
136 0x00, 0x00, /* 000000000000 */ 131 0x00, 0x00, /* 000000000000 */
132 0x02, 0x00, /* 000000100000 */
133 0x07, 0x00, /* 000001110000 */
134 0x07, 0x00, /* 000001110000 */
135 0x02, 0x00, /* 000000100000 */
136 0x18, 0xc0, /* 000110001100 */
137 0x3d, 0xe0, /* 001111011110 */
138 0x3d, 0xe0, /* 001111011110 */
139 0x1a, 0xc0, /* 000110101100 */
140 0x02, 0x00, /* 000000100000 */
141 0x07, 0x00, /* 000001110000 */
142 0x0f, 0x80, /* 000011111000 */
143 0x1f, 0xc0, /* 000111111100 */
137 0x00, 0x00, /* 000000000000 */ 144 0x00, 0x00, /* 000000000000 */
138 0x3f, 0xc0, /* 001111111100 */
139 0x3f, 0xc0, /* 001111111100 */
140 0x3f, 0xc0, /* 001111111100 */
141 0x3f, 0xc0, /* 001111111100 */
142 0x3f, 0xc0, /* 001111111100 */
143 0x3f, 0xc0, /* 001111111100 */
144 0x3f, 0xc0, /* 001111111100 */
145 0x3f, 0xc0, /* 001111111100 */
146 0x3f, 0xc0, /* 001111111100 */
147 0x3f, 0xc0, /* 001111111100 */
148 0x3f, 0xc0, /* 001111111100 */
149 0x3f, 0xc0, /* 001111111100 */
150 0x00, 0x00, /* 000000000000 */ 145 0x00, 0x00, /* 000000000000 */
151 0x00, 0x00, /* 000000000000 */ 146 0x00, 0x00, /* 000000000000 */
152 0x00, 0x00, /* 000000000000 */ 147 0x00, 0x00, /* 000000000000 */
@@ -154,23 +149,22 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
154 0x00, 0x00, /* 000000000000 */ 149 0x00, 0x00, /* 000000000000 */
155 150
156 /* 6 0x06 '^F' */ 151 /* 6 0x06 '^F' */
157 /* FIXME */
158 0x00, 0x00, /* 000000000000 */
159 0x00, 0x00, /* 000000000000 */ 152 0x00, 0x00, /* 000000000000 */
160 0x00, 0x00, /* 000000000000 */ 153 0x00, 0x00, /* 000000000000 */
161 0x00, 0x00, /* 000000000000 */ 154 0x00, 0x00, /* 000000000000 */
162 0x00, 0x00, /* 000000000000 */ 155 0x00, 0x00, /* 000000000000 */
156 0x06, 0x00, /* 000001100000 */
157 0x0f, 0x00, /* 000011110000 */
158 0x1f, 0x80, /* 000111111000 */
159 0x1f, 0x80, /* 000111111000 */
163 0x3f, 0xc0, /* 001111111100 */ 160 0x3f, 0xc0, /* 001111111100 */
164 0x3f, 0xc0, /* 001111111100 */ 161 0x7f, 0xe0, /* 011111111110 */
165 0x3f, 0xc0, /* 001111111100 */ 162 0x7f, 0xe0, /* 011111111110 */
166 0x3f, 0xc0, /* 001111111100 */ 163 0x36, 0xc0, /* 001101101100 */
167 0x3f, 0xc0, /* 001111111100 */ 164 0x06, 0x00, /* 000001100000 */
168 0x3f, 0xc0, /* 001111111100 */ 165 0x06, 0x00, /* 000001100000 */
169 0x3f, 0xc0, /* 001111111100 */ 166 0x0f, 0x00, /* 000011110000 */
170 0x3f, 0xc0, /* 001111111100 */ 167 0x1f, 0x80, /* 000111111000 */
171 0x3f, 0xc0, /* 001111111100 */
172 0x3f, 0xc0, /* 001111111100 */
173 0x3f, 0xc0, /* 001111111100 */
174 0x3f, 0xc0, /* 001111111100 */ 168 0x3f, 0xc0, /* 001111111100 */
175 0x00, 0x00, /* 000000000000 */ 169 0x00, 0x00, /* 000000000000 */
176 0x00, 0x00, /* 000000000000 */ 170 0x00, 0x00, /* 000000000000 */
@@ -179,24 +173,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
179 0x00, 0x00, /* 000000000000 */ 173 0x00, 0x00, /* 000000000000 */
180 174
181 /* 7 0x07 '^G' */ 175 /* 7 0x07 '^G' */
182 /* FIXME */
183 0x00, 0x00, /* 000000000000 */
184 0x00, 0x00, /* 000000000000 */ 176 0x00, 0x00, /* 000000000000 */
185 0x00, 0x00, /* 000000000000 */ 177 0x00, 0x00, /* 000000000000 */
186 0x00, 0x00, /* 000000000000 */ 178 0x00, 0x00, /* 000000000000 */
187 0x00, 0x00, /* 000000000000 */ 179 0x00, 0x00, /* 000000000000 */
180 0x06, 0x00, /* 000001100000 */
181 0x0f, 0x00, /* 000011110000 */
182 0x0f, 0x00, /* 000011110000 */
183 0x1f, 0x80, /* 000111111000 */
184 0x1f, 0x80, /* 000111111000 */
188 0x3f, 0xc0, /* 001111111100 */ 185 0x3f, 0xc0, /* 001111111100 */
189 0x3f, 0xc0, /* 001111111100 */ 186 0x3f, 0xc0, /* 001111111100 */
190 0x3f, 0xc0, /* 001111111100 */ 187 0x1f, 0x80, /* 000111111000 */
191 0x3f, 0xc0, /* 001111111100 */ 188 0x1f, 0x80, /* 000111111000 */
192 0x3f, 0xc0, /* 001111111100 */ 189 0x0f, 0x00, /* 000011110000 */
193 0x3f, 0xc0, /* 001111111100 */ 190 0x0f, 0x00, /* 000011110000 */
194 0x3f, 0xc0, /* 001111111100 */ 191 0x06, 0x00, /* 000001100000 */
195 0x3f, 0xc0, /* 001111111100 */ 192 0x00, 0x00, /* 000000000000 */
196 0x3f, 0xc0, /* 001111111100 */
197 0x3f, 0xc0, /* 001111111100 */
198 0x3f, 0xc0, /* 001111111100 */
199 0x3f, 0xc0, /* 001111111100 */
200 0x00, 0x00, /* 000000000000 */ 193 0x00, 0x00, /* 000000000000 */
201 0x00, 0x00, /* 000000000000 */ 194 0x00, 0x00, /* 000000000000 */
202 0x00, 0x00, /* 000000000000 */ 195 0x00, 0x00, /* 000000000000 */
@@ -204,49 +197,47 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
204 0x00, 0x00, /* 000000000000 */ 197 0x00, 0x00, /* 000000000000 */
205 198
206 /* 8 0x08 '^H' */ 199 /* 8 0x08 '^H' */
207 /* FIXME */ 200 0xff, 0xf0, /* 111111111111 */
208 0x00, 0x00, /* 000000000000 */ 201 0xff, 0xf0, /* 111111111111 */
209 0x00, 0x00, /* 000000000000 */ 202 0xff, 0xf0, /* 111111111111 */
210 0x00, 0x00, /* 000000000000 */ 203 0xff, 0xf0, /* 111111111111 */
211 0x00, 0x00, /* 000000000000 */ 204 0xf9, 0xf0, /* 111110011111 */
212 0x00, 0x00, /* 000000000000 */ 205 0xf0, 0xf0, /* 111100001111 */
213 0x3f, 0xc0, /* 001111111100 */ 206 0xf0, 0xf0, /* 111100001111 */
214 0x3f, 0xc0, /* 001111111100 */ 207 0xe0, 0x70, /* 111000000111 */
215 0x3f, 0xc0, /* 001111111100 */ 208 0xe0, 0x70, /* 111000000111 */
216 0x3f, 0xc0, /* 001111111100 */ 209 0xc0, 0x30, /* 110000000011 */
217 0x3f, 0xc0, /* 001111111100 */ 210 0xc0, 0x30, /* 110000000011 */
218 0x3f, 0xc0, /* 001111111100 */ 211 0xe0, 0x70, /* 111000000111 */
219 0x3f, 0xc0, /* 001111111100 */ 212 0xe0, 0x70, /* 111000000111 */
220 0x3f, 0xc0, /* 001111111100 */ 213 0xf0, 0xf0, /* 111100001111 */
221 0x3f, 0xc0, /* 001111111100 */ 214 0xf0, 0xf0, /* 111100001111 */
222 0x3f, 0xc0, /* 001111111100 */ 215 0xf9, 0xf0, /* 111110011111 */
223 0x3f, 0xc0, /* 001111111100 */ 216 0xff, 0xf0, /* 111111111111 */
224 0x3f, 0xc0, /* 001111111100 */ 217 0xff, 0xf0, /* 111111111111 */
225 0x00, 0x00, /* 000000000000 */ 218 0xff, 0xf0, /* 111111111111 */
226 0x00, 0x00, /* 000000000000 */ 219 0xff, 0xf0, /* 111111111111 */
227 0x00, 0x00, /* 000000000000 */ 220 0xff, 0xf0, /* 111111111111 */
228 0x00, 0x00, /* 000000000000 */ 221 0xff, 0xf0, /* 111111111111 */
229 0x00, 0x00, /* 000000000000 */
230 222
231 /* 9 0x09 '^I' */ 223 /* 9 0x09 '^I' */
232 /* FIXME */
233 0x00, 0x00, /* 000000000000 */ 224 0x00, 0x00, /* 000000000000 */
234 0x00, 0x00, /* 000000000000 */ 225 0x00, 0x00, /* 000000000000 */
235 0x00, 0x00, /* 000000000000 */ 226 0x00, 0x00, /* 000000000000 */
236 0x00, 0x00, /* 000000000000 */ 227 0x00, 0x00, /* 000000000000 */
228 0x06, 0x00, /* 000001100000 */
229 0x0f, 0x00, /* 000011110000 */
230 0x0f, 0x00, /* 000011110000 */
231 0x19, 0x80, /* 000110011000 */
232 0x19, 0x80, /* 000110011000 */
233 0x30, 0xc0, /* 001100001100 */
234 0x30, 0xc0, /* 001100001100 */
235 0x19, 0x80, /* 000110011000 */
236 0x19, 0x80, /* 000110011000 */
237 0x0f, 0x00, /* 000011110000 */
238 0x0f, 0x00, /* 000011110000 */
239 0x06, 0x00, /* 000001100000 */
237 0x00, 0x00, /* 000000000000 */ 240 0x00, 0x00, /* 000000000000 */
238 0x3f, 0xc0, /* 001111111100 */
239 0x3f, 0xc0, /* 001111111100 */
240 0x3f, 0xc0, /* 001111111100 */
241 0x3f, 0xc0, /* 001111111100 */
242 0x3f, 0xc0, /* 001111111100 */
243 0x3f, 0xc0, /* 001111111100 */
244 0x3f, 0xc0, /* 001111111100 */
245 0x3f, 0xc0, /* 001111111100 */
246 0x3f, 0xc0, /* 001111111100 */
247 0x3f, 0xc0, /* 001111111100 */
248 0x3f, 0xc0, /* 001111111100 */
249 0x3f, 0xc0, /* 001111111100 */
250 0x00, 0x00, /* 000000000000 */ 241 0x00, 0x00, /* 000000000000 */
251 0x00, 0x00, /* 000000000000 */ 242 0x00, 0x00, /* 000000000000 */
252 0x00, 0x00, /* 000000000000 */ 243 0x00, 0x00, /* 000000000000 */
@@ -254,49 +245,47 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
254 0x00, 0x00, /* 000000000000 */ 245 0x00, 0x00, /* 000000000000 */
255 246
256 /* 10 0x0a '^J' */ 247 /* 10 0x0a '^J' */
257 /* FIXME */ 248 0xff, 0xf0, /* 111111111111 */
258 0x00, 0x00, /* 000000000000 */ 249 0xff, 0xf0, /* 111111111111 */
259 0x00, 0x00, /* 000000000000 */ 250 0xff, 0xf0, /* 111111111111 */
260 0x00, 0x00, /* 000000000000 */ 251 0xff, 0xf0, /* 111111111111 */
261 0x00, 0x00, /* 000000000000 */ 252 0xf9, 0xf0, /* 111110011111 */
262 0x00, 0x00, /* 000000000000 */ 253 0xf0, 0xf0, /* 111100001111 */
263 0x3f, 0xc0, /* 001111111100 */ 254 0xf0, 0xf0, /* 111100001111 */
264 0x3f, 0xc0, /* 001111111100 */ 255 0xe6, 0x70, /* 111001100111 */
265 0x3f, 0xc0, /* 001111111100 */ 256 0xe6, 0x70, /* 111001100111 */
266 0x3f, 0xc0, /* 001111111100 */ 257 0xcf, 0x30, /* 110011110011 */
267 0x3f, 0xc0, /* 001111111100 */ 258 0xcf, 0x30, /* 110011110011 */
268 0x3f, 0xc0, /* 001111111100 */ 259 0xe6, 0x70, /* 111001100111 */
269 0x3f, 0xc0, /* 001111111100 */ 260 0xe6, 0x70, /* 111001100111 */
270 0x3f, 0xc0, /* 001111111100 */ 261 0xf0, 0xf0, /* 111100001111 */
271 0x3f, 0xc0, /* 001111111100 */ 262 0xf0, 0xf0, /* 111100001111 */
272 0x3f, 0xc0, /* 001111111100 */ 263 0xf9, 0xf0, /* 111110011111 */
273 0x3f, 0xc0, /* 001111111100 */ 264 0xff, 0xf0, /* 111111111111 */
274 0x3f, 0xc0, /* 001111111100 */ 265 0xff, 0xf0, /* 111111111111 */
275 0x00, 0x00, /* 000000000000 */ 266 0xff, 0xf0, /* 111111111111 */
276 0x00, 0x00, /* 000000000000 */ 267 0xff, 0xf0, /* 111111111111 */
277 0x00, 0x00, /* 000000000000 */ 268 0xff, 0xf0, /* 111111111111 */
278 0x00, 0x00, /* 000000000000 */ 269 0xff, 0xf0, /* 111111111111 */
279 0x00, 0x00, /* 000000000000 */
280 270
281 /* 11 0x0b '^K' */ 271 /* 11 0x0b '^K' */
282 /* FIXME */
283 0x00, 0x00, /* 000000000000 */
284 0x00, 0x00, /* 000000000000 */
285 0x00, 0x00, /* 000000000000 */ 272 0x00, 0x00, /* 000000000000 */
286 0x00, 0x00, /* 000000000000 */ 273 0x00, 0x00, /* 000000000000 */
274 0x0f, 0xe0, /* 000011111110 */
275 0x0f, 0xe0, /* 000011111110 */
276 0x01, 0xe0, /* 000000011110 */
277 0x03, 0x60, /* 000000110110 */
278 0x06, 0x60, /* 000001100110 */
279 0x1e, 0x00, /* 000111100000 */
280 0x33, 0x00, /* 001100110000 */
281 0x33, 0x00, /* 001100110000 */
282 0x61, 0x80, /* 011000011000 */
283 0x61, 0x80, /* 011000011000 */
284 0x33, 0x00, /* 001100110000 */
285 0x33, 0x00, /* 001100110000 */
286 0x1e, 0x00, /* 000111100000 */
287 0x0c, 0x00, /* 000011000000 */
287 0x00, 0x00, /* 000000000000 */ 288 0x00, 0x00, /* 000000000000 */
288 0x3f, 0xc0, /* 001111111100 */
289 0x3f, 0xc0, /* 001111111100 */
290 0x3f, 0xc0, /* 001111111100 */
291 0x3f, 0xc0, /* 001111111100 */
292 0x3f, 0xc0, /* 001111111100 */
293 0x3f, 0xc0, /* 001111111100 */
294 0x3f, 0xc0, /* 001111111100 */
295 0x3f, 0xc0, /* 001111111100 */
296 0x3f, 0xc0, /* 001111111100 */
297 0x3f, 0xc0, /* 001111111100 */
298 0x3f, 0xc0, /* 001111111100 */
299 0x3f, 0xc0, /* 001111111100 */
300 0x00, 0x00, /* 000000000000 */ 289 0x00, 0x00, /* 000000000000 */
301 0x00, 0x00, /* 000000000000 */ 290 0x00, 0x00, /* 000000000000 */
302 0x00, 0x00, /* 000000000000 */ 291 0x00, 0x00, /* 000000000000 */
@@ -304,24 +293,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
304 0x00, 0x00, /* 000000000000 */ 293 0x00, 0x00, /* 000000000000 */
305 294
306 /* 12 0x0c '^L' */ 295 /* 12 0x0c '^L' */
307 /* FIXME */
308 0x00, 0x00, /* 000000000000 */
309 0x00, 0x00, /* 000000000000 */
310 0x00, 0x00, /* 000000000000 */
311 0x00, 0x00, /* 000000000000 */ 296 0x00, 0x00, /* 000000000000 */
312 0x00, 0x00, /* 000000000000 */ 297 0x00, 0x00, /* 000000000000 */
298 0x06, 0x00, /* 000001100000 */
299 0x0f, 0x00, /* 000011110000 */
300 0x19, 0x80, /* 000110011000 */
301 0x30, 0xc0, /* 001100001100 */
302 0x30, 0xc0, /* 001100001100 */
303 0x19, 0x80, /* 000110011000 */
304 0x0f, 0x00, /* 000011110000 */
305 0x06, 0x00, /* 000001100000 */
306 0x06, 0x00, /* 000001100000 */
307 0x06, 0x00, /* 000001100000 */
313 0x3f, 0xc0, /* 001111111100 */ 308 0x3f, 0xc0, /* 001111111100 */
314 0x3f, 0xc0, /* 001111111100 */ 309 0x3f, 0xc0, /* 001111111100 */
315 0x3f, 0xc0, /* 001111111100 */ 310 0x06, 0x00, /* 000001100000 */
316 0x3f, 0xc0, /* 001111111100 */ 311 0x06, 0x00, /* 000001100000 */
317 0x3f, 0xc0, /* 001111111100 */ 312 0x00, 0x00, /* 000000000000 */
318 0x3f, 0xc0, /* 001111111100 */
319 0x3f, 0xc0, /* 001111111100 */
320 0x3f, 0xc0, /* 001111111100 */
321 0x3f, 0xc0, /* 001111111100 */
322 0x3f, 0xc0, /* 001111111100 */
323 0x3f, 0xc0, /* 001111111100 */
324 0x3f, 0xc0, /* 001111111100 */
325 0x00, 0x00, /* 000000000000 */ 313 0x00, 0x00, /* 000000000000 */
326 0x00, 0x00, /* 000000000000 */ 314 0x00, 0x00, /* 000000000000 */
327 0x00, 0x00, /* 000000000000 */ 315 0x00, 0x00, /* 000000000000 */
@@ -329,149 +317,143 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
329 0x00, 0x00, /* 000000000000 */ 317 0x00, 0x00, /* 000000000000 */
330 318
331 /* 13 0x0d '^M' */ 319 /* 13 0x0d '^M' */
332 /* FIXME */
333 0x00, 0x00, /* 000000000000 */
334 0x00, 0x00, /* 000000000000 */
335 0x00, 0x00, /* 000000000000 */
336 0x00, 0x00, /* 000000000000 */
337 0x00, 0x00, /* 000000000000 */
338 0x3f, 0xc0, /* 001111111100 */
339 0x3f, 0xc0, /* 001111111100 */
340 0x3f, 0xc0, /* 001111111100 */
341 0x3f, 0xc0, /* 001111111100 */
342 0x3f, 0xc0, /* 001111111100 */
343 0x3f, 0xc0, /* 001111111100 */
344 0x3f, 0xc0, /* 001111111100 */
345 0x3f, 0xc0, /* 001111111100 */
346 0x3f, 0xc0, /* 001111111100 */
347 0x3f, 0xc0, /* 001111111100 */
348 0x3f, 0xc0, /* 001111111100 */
349 0x3f, 0xc0, /* 001111111100 */
350 0x00, 0x00, /* 000000000000 */ 320 0x00, 0x00, /* 000000000000 */
351 0x00, 0x00, /* 000000000000 */ 321 0x00, 0x00, /* 000000000000 */
322 0x0f, 0xe0, /* 000011111110 */
323 0x0c, 0x60, /* 000011000110 */
324 0x0c, 0x60, /* 000011000110 */
325 0x0f, 0xe0, /* 000011111110 */
326 0x0c, 0x00, /* 000011000000 */
327 0x0c, 0x00, /* 000011000000 */
328 0x0c, 0x00, /* 000011000000 */
329 0x0c, 0x00, /* 000011000000 */
330 0x0c, 0x00, /* 000011000000 */
331 0x0c, 0x00, /* 000011000000 */
332 0x0c, 0x00, /* 000011000000 */
333 0x0c, 0x00, /* 000011000000 */
334 0x0c, 0x00, /* 000011000000 */
335 0x3c, 0x00, /* 001111000000 */
336 0x7c, 0x00, /* 011111000000 */
337 0x78, 0x00, /* 011110000000 */
338 0x30, 0x00, /* 001100000000 */
352 0x00, 0x00, /* 000000000000 */ 339 0x00, 0x00, /* 000000000000 */
353 0x00, 0x00, /* 000000000000 */ 340 0x00, 0x00, /* 000000000000 */
354 0x00, 0x00, /* 000000000000 */ 341 0x00, 0x00, /* 000000000000 */
355 342
356 /* 14 0x0e '^N' */ 343 /* 14 0x0e '^N' */
357 /* FIXME */
358 0x00, 0x00, /* 000000000000 */
359 0x00, 0x00, /* 000000000000 */
360 0x00, 0x00, /* 000000000000 */
361 0x00, 0x00, /* 000000000000 */
362 0x00, 0x00, /* 000000000000 */
363 0x3f, 0xc0, /* 001111111100 */
364 0x3f, 0xc0, /* 001111111100 */
365 0x3f, 0xc0, /* 001111111100 */
366 0x3f, 0xc0, /* 001111111100 */
367 0x3f, 0xc0, /* 001111111100 */
368 0x3f, 0xc0, /* 001111111100 */
369 0x3f, 0xc0, /* 001111111100 */
370 0x3f, 0xc0, /* 001111111100 */
371 0x3f, 0xc0, /* 001111111100 */
372 0x3f, 0xc0, /* 001111111100 */
373 0x3f, 0xc0, /* 001111111100 */
374 0x3f, 0xc0, /* 001111111100 */
375 0x00, 0x00, /* 000000000000 */ 344 0x00, 0x00, /* 000000000000 */
376 0x00, 0x00, /* 000000000000 */ 345 0x00, 0x00, /* 000000000000 */
346 0x1f, 0xe0, /* 000111111110 */
347 0x18, 0x60, /* 000110000110 */
348 0x18, 0x60, /* 000110000110 */
349 0x1f, 0xe0, /* 000111111110 */
350 0x18, 0x60, /* 000110000110 */
351 0x18, 0x60, /* 000110000110 */
352 0x18, 0x60, /* 000110000110 */
353 0x18, 0x60, /* 000110000110 */
354 0x18, 0x60, /* 000110000110 */
355 0x18, 0x60, /* 000110000110 */
356 0x19, 0xe0, /* 000110011110 */
357 0x1b, 0xe0, /* 000110111110 */
358 0x1b, 0xc0, /* 000110111100 */
359 0x79, 0x80, /* 011110011000 */
360 0xf8, 0x00, /* 111110000000 */
361 0xf0, 0x00, /* 111100000000 */
362 0x60, 0x00, /* 011000000000 */
377 0x00, 0x00, /* 000000000000 */ 363 0x00, 0x00, /* 000000000000 */
378 0x00, 0x00, /* 000000000000 */ 364 0x00, 0x00, /* 000000000000 */
379 0x00, 0x00, /* 000000000000 */ 365 0x00, 0x00, /* 000000000000 */
380 366
381 /* 15 0x0f '^O' */ 367 /* 15 0x0f '^O' */
382 /* FIXME */
383 0x00, 0x00, /* 000000000000 */
384 0x00, 0x00, /* 000000000000 */ 368 0x00, 0x00, /* 000000000000 */
385 0x00, 0x00, /* 000000000000 */ 369 0x00, 0x00, /* 000000000000 */
386 0x00, 0x00, /* 000000000000 */ 370 0x00, 0x00, /* 000000000000 */
387 0x00, 0x00, /* 000000000000 */ 371 0x00, 0x00, /* 000000000000 */
388 0x3f, 0xc0, /* 001111111100 */
389 0x3f, 0xc0, /* 001111111100 */
390 0x3f, 0xc0, /* 001111111100 */
391 0x3f, 0xc0, /* 001111111100 */
392 0x3f, 0xc0, /* 001111111100 */
393 0x3f, 0xc0, /* 001111111100 */
394 0x3f, 0xc0, /* 001111111100 */
395 0x3f, 0xc0, /* 001111111100 */
396 0x3f, 0xc0, /* 001111111100 */
397 0x3f, 0xc0, /* 001111111100 */
398 0x3f, 0xc0, /* 001111111100 */
399 0x3f, 0xc0, /* 001111111100 */
400 0x00, 0x00, /* 000000000000 */
401 0x00, 0x00, /* 000000000000 */
402 0x00, 0x00, /* 000000000000 */ 372 0x00, 0x00, /* 000000000000 */
403 0x00, 0x00, /* 000000000000 */ 373 0x00, 0x00, /* 000000000000 */
404 0x00, 0x00, /* 000000000000 */ 374 0x00, 0x00, /* 000000000000 */
405 375 0x18, 0xc0, /* 000110001100 */
406 /* 16 0x10 '^P' */ 376 0x0d, 0x80, /* 000011011000 */
407 /* FIXME */ 377 0x6d, 0xb0, /* 011011011011 */
378 0x3d, 0xe0, /* 001111011110 */
408 0x00, 0x00, /* 000000000000 */ 379 0x00, 0x00, /* 000000000000 */
380 0x3d, 0xe0, /* 001111011110 */
381 0x6d, 0xb0, /* 011011011011 */
382 0x0d, 0x80, /* 000011011000 */
383 0x18, 0xc0, /* 000110001100 */
409 0x00, 0x00, /* 000000000000 */ 384 0x00, 0x00, /* 000000000000 */
410 0x00, 0x00, /* 000000000000 */ 385 0x00, 0x00, /* 000000000000 */
411 0x00, 0x00, /* 000000000000 */ 386 0x00, 0x00, /* 000000000000 */
412 0x00, 0x00, /* 000000000000 */ 387 0x00, 0x00, /* 000000000000 */
413 0x3f, 0xc0, /* 001111111100 */
414 0x3f, 0xc0, /* 001111111100 */
415 0x3f, 0xc0, /* 001111111100 */
416 0x3f, 0xc0, /* 001111111100 */
417 0x3f, 0xc0, /* 001111111100 */
418 0x3f, 0xc0, /* 001111111100 */
419 0x3f, 0xc0, /* 001111111100 */
420 0x3f, 0xc0, /* 001111111100 */
421 0x3f, 0xc0, /* 001111111100 */
422 0x3f, 0xc0, /* 001111111100 */
423 0x3f, 0xc0, /* 001111111100 */
424 0x3f, 0xc0, /* 001111111100 */
425 0x00, 0x00, /* 000000000000 */ 388 0x00, 0x00, /* 000000000000 */
426 0x00, 0x00, /* 000000000000 */ 389 0x00, 0x00, /* 000000000000 */
390
391 /* 16 0x10 '^P' */
427 0x00, 0x00, /* 000000000000 */ 392 0x00, 0x00, /* 000000000000 */
393 0x00, 0x20, /* 000000000010 */
394 0x00, 0x60, /* 000000000110 */
395 0x00, 0xe0, /* 000000001110 */
396 0x01, 0xe0, /* 000000011110 */
397 0x03, 0xe0, /* 000000111110 */
398 0x07, 0xe0, /* 000001111110 */
399 0x0f, 0xe0, /* 000011111110 */
400 0x1f, 0xe0, /* 000111111110 */
401 0x3f, 0xe0, /* 001111111110 */
402 0x7f, 0xe0, /* 011111111110 */
403 0x3f, 0xe0, /* 001111111110 */
404 0x1f, 0xe0, /* 000111111110 */
405 0x0f, 0xe0, /* 000011111110 */
406 0x07, 0xe0, /* 000001111110 */
407 0x03, 0xe0, /* 000000111110 */
408 0x01, 0xe0, /* 000000011110 */
409 0x00, 0xe0, /* 000000001110 */
410 0x00, 0x60, /* 000000000110 */
411 0x00, 0x20, /* 000000000010 */
428 0x00, 0x00, /* 000000000000 */ 412 0x00, 0x00, /* 000000000000 */
429 0x00, 0x00, /* 000000000000 */ 413 0x00, 0x00, /* 000000000000 */
430 414
431 /* 17 0x11 '^Q' */ 415 /* 17 0x11 '^Q' */
432 /* FIXME */
433 0x00, 0x00, /* 000000000000 */
434 0x00, 0x00, /* 000000000000 */
435 0x00, 0x00, /* 000000000000 */
436 0x00, 0x00, /* 000000000000 */
437 0x00, 0x00, /* 000000000000 */
438 0x3f, 0xc0, /* 001111111100 */
439 0x3f, 0xc0, /* 001111111100 */
440 0x3f, 0xc0, /* 001111111100 */
441 0x3f, 0xc0, /* 001111111100 */
442 0x3f, 0xc0, /* 001111111100 */
443 0x3f, 0xc0, /* 001111111100 */
444 0x3f, 0xc0, /* 001111111100 */
445 0x3f, 0xc0, /* 001111111100 */
446 0x3f, 0xc0, /* 001111111100 */
447 0x3f, 0xc0, /* 001111111100 */
448 0x3f, 0xc0, /* 001111111100 */
449 0x3f, 0xc0, /* 001111111100 */
450 0x00, 0x00, /* 000000000000 */
451 0x00, 0x00, /* 000000000000 */
452 0x00, 0x00, /* 000000000000 */ 416 0x00, 0x00, /* 000000000000 */
417 0x40, 0x00, /* 010000000000 */
418 0x60, 0x00, /* 011000000000 */
419 0x70, 0x00, /* 011100000000 */
420 0x78, 0x00, /* 011110000000 */
421 0x7c, 0x00, /* 011111000000 */
422 0x7e, 0x00, /* 011111100000 */
423 0x7f, 0x00, /* 011111110000 */
424 0x7f, 0x80, /* 011111111000 */
425 0x7f, 0xc0, /* 011111111100 */
426 0x7f, 0xe0, /* 011111111110 */
427 0x7f, 0xc0, /* 011111111100 */
428 0x7f, 0x80, /* 011111111000 */
429 0x7f, 0x00, /* 011111110000 */
430 0x7e, 0x00, /* 011111100000 */
431 0x7c, 0x00, /* 011111000000 */
432 0x78, 0x00, /* 011110000000 */
433 0x70, 0x00, /* 011100000000 */
434 0x60, 0x00, /* 011000000000 */
435 0x40, 0x00, /* 010000000000 */
453 0x00, 0x00, /* 000000000000 */ 436 0x00, 0x00, /* 000000000000 */
454 0x00, 0x00, /* 000000000000 */ 437 0x00, 0x00, /* 000000000000 */
455 438
456 /* 18 0x12 '^R' */ 439 /* 18 0x12 '^R' */
457 /* FIXME */
458 0x00, 0x00, /* 000000000000 */ 440 0x00, 0x00, /* 000000000000 */
459 0x00, 0x00, /* 000000000000 */ 441 0x00, 0x00, /* 000000000000 */
460 0x00, 0x00, /* 000000000000 */ 442 0x00, 0x00, /* 000000000000 */
461 0x00, 0x00, /* 000000000000 */ 443 0x00, 0x00, /* 000000000000 */
444 0x04, 0x00, /* 000001000000 */
445 0x0e, 0x00, /* 000011100000 */
446 0x1f, 0x00, /* 000111110000 */
447 0x3f, 0x80, /* 001111111000 */
448 0x7f, 0xc0, /* 011111111100 */
449 0x0e, 0x00, /* 000011100000 */
450 0x0e, 0x00, /* 000011100000 */
451 0x7f, 0xc0, /* 011111111100 */
452 0x3f, 0x80, /* 001111111000 */
453 0x1f, 0x00, /* 000111110000 */
454 0x0e, 0x00, /* 000011100000 */
455 0x04, 0x00, /* 000001000000 */
462 0x00, 0x00, /* 000000000000 */ 456 0x00, 0x00, /* 000000000000 */
463 0x3f, 0xc0, /* 001111111100 */
464 0x3f, 0xc0, /* 001111111100 */
465 0x3f, 0xc0, /* 001111111100 */
466 0x3f, 0xc0, /* 001111111100 */
467 0x3f, 0xc0, /* 001111111100 */
468 0x3f, 0xc0, /* 001111111100 */
469 0x3f, 0xc0, /* 001111111100 */
470 0x3f, 0xc0, /* 001111111100 */
471 0x3f, 0xc0, /* 001111111100 */
472 0x3f, 0xc0, /* 001111111100 */
473 0x3f, 0xc0, /* 001111111100 */
474 0x3f, 0xc0, /* 001111111100 */
475 0x00, 0x00, /* 000000000000 */ 457 0x00, 0x00, /* 000000000000 */
476 0x00, 0x00, /* 000000000000 */ 458 0x00, 0x00, /* 000000000000 */
477 0x00, 0x00, /* 000000000000 */ 459 0x00, 0x00, /* 000000000000 */
@@ -551,99 +533,95 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
551 0x00, 0x00, /* 000000000000 */ 533 0x00, 0x00, /* 000000000000 */
552 534
553 /* 22 0x16 '^V' */ 535 /* 22 0x16 '^V' */
554 /* FIXME */
555 0x00, 0x00, /* 000000000000 */ 536 0x00, 0x00, /* 000000000000 */
556 0x00, 0x00, /* 000000000000 */ 537 0x00, 0x00, /* 000000000000 */
557 0x00, 0x00, /* 000000000000 */ 538 0x00, 0x00, /* 000000000000 */
558 0x00, 0x00, /* 000000000000 */ 539 0x00, 0x00, /* 000000000000 */
559 0x00, 0x00, /* 000000000000 */ 540 0x00, 0x00, /* 000000000000 */
560 0x3f, 0xc0, /* 001111111100 */
561 0x3f, 0xc0, /* 001111111100 */
562 0x3f, 0xc0, /* 001111111100 */
563 0x3f, 0xc0, /* 001111111100 */
564 0x3f, 0xc0, /* 001111111100 */
565 0x3f, 0xc0, /* 001111111100 */
566 0x3f, 0xc0, /* 001111111100 */
567 0x3f, 0xc0, /* 001111111100 */
568 0x3f, 0xc0, /* 001111111100 */
569 0x3f, 0xc0, /* 001111111100 */
570 0x3f, 0xc0, /* 001111111100 */
571 0x3f, 0xc0, /* 001111111100 */
572 0x00, 0x00, /* 000000000000 */
573 0x00, 0x00, /* 000000000000 */ 541 0x00, 0x00, /* 000000000000 */
574 0x00, 0x00, /* 000000000000 */ 542 0x00, 0x00, /* 000000000000 */
575 0x00, 0x00, /* 000000000000 */ 543 0x00, 0x00, /* 000000000000 */
576 0x00, 0x00, /* 000000000000 */ 544 0x00, 0x00, /* 000000000000 */
577
578 /* 23 0x17 '^W' */
579 /* FIXME */
580 0x00, 0x00, /* 000000000000 */ 545 0x00, 0x00, /* 000000000000 */
581 0x00, 0x00, /* 000000000000 */ 546 0x00, 0x00, /* 000000000000 */
582 0x00, 0x00, /* 000000000000 */ 547 0x00, 0x00, /* 000000000000 */
583 0x00, 0x00, /* 000000000000 */ 548 0x00, 0x00, /* 000000000000 */
549 0x7f, 0xe0, /* 011111111110 */
550 0x7f, 0xe0, /* 011111111110 */
551 0x7f, 0xe0, /* 011111111110 */
584 0x00, 0x00, /* 000000000000 */ 552 0x00, 0x00, /* 000000000000 */
585 0x3f, 0xc0, /* 001111111100 */
586 0x3f, 0xc0, /* 001111111100 */
587 0x3f, 0xc0, /* 001111111100 */
588 0x3f, 0xc0, /* 001111111100 */
589 0x3f, 0xc0, /* 001111111100 */
590 0x3f, 0xc0, /* 001111111100 */
591 0x3f, 0xc0, /* 001111111100 */
592 0x3f, 0xc0, /* 001111111100 */
593 0x3f, 0xc0, /* 001111111100 */
594 0x3f, 0xc0, /* 001111111100 */
595 0x3f, 0xc0, /* 001111111100 */
596 0x3f, 0xc0, /* 001111111100 */
597 0x00, 0x00, /* 000000000000 */ 553 0x00, 0x00, /* 000000000000 */
598 0x00, 0x00, /* 000000000000 */ 554 0x00, 0x00, /* 000000000000 */
599 0x00, 0x00, /* 000000000000 */ 555 0x00, 0x00, /* 000000000000 */
600 0x00, 0x00, /* 000000000000 */ 556 0x00, 0x00, /* 000000000000 */
601 0x00, 0x00, /* 000000000000 */ 557 0x00, 0x00, /* 000000000000 */
602 558
603 /* 24 0x18 '^X' */ 559 /* 23 0x17 '^W' */
604 /* FIXME */
605 0x00, 0x00, /* 000000000000 */ 560 0x00, 0x00, /* 000000000000 */
606 0x00, 0x00, /* 000000000000 */ 561 0x00, 0x00, /* 000000000000 */
562 0x04, 0x00, /* 000001000000 */
563 0x0e, 0x00, /* 000011100000 */
564 0x1f, 0x00, /* 000111110000 */
565 0x3f, 0x80, /* 001111111000 */
566 0x7f, 0xc0, /* 011111111100 */
567 0x0e, 0x00, /* 000011100000 */
568 0x0e, 0x00, /* 000011100000 */
569 0x7f, 0xc0, /* 011111111100 */
570 0x3f, 0x80, /* 001111111000 */
571 0x1f, 0x00, /* 000111110000 */
572 0x0e, 0x00, /* 000011100000 */
573 0x04, 0x00, /* 000001000000 */
607 0x00, 0x00, /* 000000000000 */ 574 0x00, 0x00, /* 000000000000 */
575 0x7f, 0xe0, /* 011111111110 */
576 0x7f, 0xe0, /* 011111111110 */
608 0x00, 0x00, /* 000000000000 */ 577 0x00, 0x00, /* 000000000000 */
609 0x00, 0x00, /* 000000000000 */ 578 0x00, 0x00, /* 000000000000 */
610 0x3f, 0xc0, /* 001111111100 */
611 0x3f, 0xc0, /* 001111111100 */
612 0x3f, 0xc0, /* 001111111100 */
613 0x3f, 0xc0, /* 001111111100 */
614 0x3f, 0xc0, /* 001111111100 */
615 0x3f, 0xc0, /* 001111111100 */
616 0x3f, 0xc0, /* 001111111100 */
617 0x3f, 0xc0, /* 001111111100 */
618 0x3f, 0xc0, /* 001111111100 */
619 0x3f, 0xc0, /* 001111111100 */
620 0x3f, 0xc0, /* 001111111100 */
621 0x3f, 0xc0, /* 001111111100 */
622 0x00, 0x00, /* 000000000000 */ 579 0x00, 0x00, /* 000000000000 */
623 0x00, 0x00, /* 000000000000 */ 580 0x00, 0x00, /* 000000000000 */
624 0x00, 0x00, /* 000000000000 */ 581 0x00, 0x00, /* 000000000000 */
582
583 /* 24 0x18 '^X' */
625 0x00, 0x00, /* 000000000000 */ 584 0x00, 0x00, /* 000000000000 */
626 0x00, 0x00, /* 000000000000 */ 585 0x00, 0x00, /* 000000000000 */
627 586 0x04, 0x00, /* 000001000000 */
628 /* 25 0x19 '^Y' */ 587 0x0e, 0x00, /* 000011100000 */
629 /* FIXME */ 588 0x1f, 0x00, /* 000111110000 */
589 0x3f, 0x80, /* 001111111000 */
590 0x7f, 0xc0, /* 011111111100 */
591 0x0e, 0x00, /* 000011100000 */
592 0x0e, 0x00, /* 000011100000 */
593 0x0e, 0x00, /* 000011100000 */
594 0x0e, 0x00, /* 000011100000 */
595 0x0e, 0x00, /* 000011100000 */
596 0x0e, 0x00, /* 000011100000 */
597 0x0e, 0x00, /* 000011100000 */
598 0x0e, 0x00, /* 000011100000 */
599 0x0e, 0x00, /* 000011100000 */
630 0x00, 0x00, /* 000000000000 */ 600 0x00, 0x00, /* 000000000000 */
631 0x00, 0x00, /* 000000000000 */ 601 0x00, 0x00, /* 000000000000 */
632 0x00, 0x00, /* 000000000000 */ 602 0x00, 0x00, /* 000000000000 */
633 0x00, 0x00, /* 000000000000 */ 603 0x00, 0x00, /* 000000000000 */
634 0x00, 0x00, /* 000000000000 */ 604 0x00, 0x00, /* 000000000000 */
635 0x3f, 0xc0, /* 001111111100 */ 605 0x00, 0x00, /* 000000000000 */
636 0x3f, 0xc0, /* 001111111100 */ 606
637 0x3f, 0xc0, /* 001111111100 */ 607 /* 25 0x19 '^Y' */
638 0x3f, 0xc0, /* 001111111100 */ 608 0x00, 0x00, /* 000000000000 */
639 0x3f, 0xc0, /* 001111111100 */ 609 0x00, 0x00, /* 000000000000 */
640 0x3f, 0xc0, /* 001111111100 */ 610 0x0e, 0x00, /* 000011100000 */
641 0x3f, 0xc0, /* 001111111100 */ 611 0x0e, 0x00, /* 000011100000 */
642 0x3f, 0xc0, /* 001111111100 */ 612 0x0e, 0x00, /* 000011100000 */
643 0x3f, 0xc0, /* 001111111100 */ 613 0x0e, 0x00, /* 000011100000 */
644 0x3f, 0xc0, /* 001111111100 */ 614 0x0e, 0x00, /* 000011100000 */
645 0x3f, 0xc0, /* 001111111100 */ 615 0x0e, 0x00, /* 000011100000 */
646 0x3f, 0xc0, /* 001111111100 */ 616 0x0e, 0x00, /* 000011100000 */
617 0x0e, 0x00, /* 000011100000 */
618 0x0e, 0x00, /* 000011100000 */
619 0x0e, 0x00, /* 000011100000 */
620 0x7f, 0xc0, /* 011111111100 */
621 0x3f, 0x80, /* 001111111000 */
622 0x1f, 0x00, /* 000111110000 */
623 0x0e, 0x00, /* 000011100000 */
624 0x04, 0x00, /* 000001000000 */
647 0x00, 0x00, /* 000000000000 */ 625 0x00, 0x00, /* 000000000000 */
648 0x00, 0x00, /* 000000000000 */ 626 0x00, 0x00, /* 000000000000 */
649 0x00, 0x00, /* 000000000000 */ 627 0x00, 0x00, /* 000000000000 */
@@ -651,24 +629,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
651 0x00, 0x00, /* 000000000000 */ 629 0x00, 0x00, /* 000000000000 */
652 630
653 /* 26 0x1a '^Z' */ 631 /* 26 0x1a '^Z' */
654 /* FIXME */
655 0x00, 0x00, /* 000000000000 */ 632 0x00, 0x00, /* 000000000000 */
656 0x00, 0x00, /* 000000000000 */ 633 0x00, 0x00, /* 000000000000 */
657 0x00, 0x00, /* 000000000000 */ 634 0x00, 0x00, /* 000000000000 */
658 0x00, 0x00, /* 000000000000 */ 635 0x00, 0x00, /* 000000000000 */
659 0x00, 0x00, /* 000000000000 */ 636 0x00, 0x00, /* 000000000000 */
660 0x3f, 0xc0, /* 001111111100 */ 637 0x00, 0x00, /* 000000000000 */
661 0x3f, 0xc0, /* 001111111100 */ 638 0x08, 0x00, /* 000010000000 */
662 0x3f, 0xc0, /* 001111111100 */ 639 0x18, 0x00, /* 000110000000 */
663 0x3f, 0xc0, /* 001111111100 */ 640 0x38, 0x00, /* 001110000000 */
664 0x3f, 0xc0, /* 001111111100 */ 641 0x7f, 0xe0, /* 011111111110 */
665 0x3f, 0xc0, /* 001111111100 */ 642 0xff, 0xe0, /* 111111111110 */
666 0x3f, 0xc0, /* 001111111100 */ 643 0x7f, 0xe0, /* 011111111110 */
667 0x3f, 0xc0, /* 001111111100 */ 644 0x38, 0x00, /* 001110000000 */
668 0x3f, 0xc0, /* 001111111100 */ 645 0x18, 0x00, /* 000110000000 */
669 0x3f, 0xc0, /* 001111111100 */ 646 0x08, 0x00, /* 000010000000 */
670 0x3f, 0xc0, /* 001111111100 */ 647 0x00, 0x00, /* 000000000000 */
671 0x3f, 0xc0, /* 001111111100 */ 648 0x00, 0x00, /* 000000000000 */
672 0x00, 0x00, /* 000000000000 */ 649 0x00, 0x00, /* 000000000000 */
673 0x00, 0x00, /* 000000000000 */ 650 0x00, 0x00, /* 000000000000 */
674 0x00, 0x00, /* 000000000000 */ 651 0x00, 0x00, /* 000000000000 */
@@ -676,24 +653,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
676 0x00, 0x00, /* 000000000000 */ 653 0x00, 0x00, /* 000000000000 */
677 654
678 /* 27 0x1b '^[' */ 655 /* 27 0x1b '^[' */
679 /* FIXME */
680 0x00, 0x00, /* 000000000000 */ 656 0x00, 0x00, /* 000000000000 */
681 0x00, 0x00, /* 000000000000 */ 657 0x00, 0x00, /* 000000000000 */
682 0x00, 0x00, /* 000000000000 */ 658 0x00, 0x00, /* 000000000000 */
683 0x00, 0x00, /* 000000000000 */ 659 0x00, 0x00, /* 000000000000 */
684 0x00, 0x00, /* 000000000000 */ 660 0x00, 0x00, /* 000000000000 */
685 0x3f, 0xc0, /* 001111111100 */ 661 0x00, 0x00, /* 000000000000 */
686 0x3f, 0xc0, /* 001111111100 */ 662 0x01, 0x00, /* 000000010000 */
687 0x3f, 0xc0, /* 001111111100 */ 663 0x01, 0x80, /* 000000011000 */
688 0x3f, 0xc0, /* 001111111100 */ 664 0x01, 0xc0, /* 000000011100 */
689 0x3f, 0xc0, /* 001111111100 */ 665 0x7f, 0xe0, /* 011111111110 */
690 0x3f, 0xc0, /* 001111111100 */ 666 0x7f, 0xf0, /* 011111111111 */
691 0x3f, 0xc0, /* 001111111100 */ 667 0x7f, 0xe0, /* 011111111110 */
692 0x3f, 0xc0, /* 001111111100 */ 668 0x01, 0xc0, /* 000000011100 */
693 0x3f, 0xc0, /* 001111111100 */ 669 0x01, 0x80, /* 000000011000 */
694 0x3f, 0xc0, /* 001111111100 */ 670 0x01, 0x00, /* 000000010000 */
695 0x3f, 0xc0, /* 001111111100 */ 671 0x00, 0x00, /* 000000000000 */
696 0x3f, 0xc0, /* 001111111100 */ 672 0x00, 0x00, /* 000000000000 */
697 0x00, 0x00, /* 000000000000 */ 673 0x00, 0x00, /* 000000000000 */
698 0x00, 0x00, /* 000000000000 */ 674 0x00, 0x00, /* 000000000000 */
699 0x00, 0x00, /* 000000000000 */ 675 0x00, 0x00, /* 000000000000 */
@@ -701,24 +677,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
701 0x00, 0x00, /* 000000000000 */ 677 0x00, 0x00, /* 000000000000 */
702 678
703 /* 28 0x1c '^\' */ 679 /* 28 0x1c '^\' */
704 /* FIXME */
705 0x00, 0x00, /* 000000000000 */ 680 0x00, 0x00, /* 000000000000 */
706 0x00, 0x00, /* 000000000000 */ 681 0x00, 0x00, /* 000000000000 */
707 0x00, 0x00, /* 000000000000 */ 682 0x00, 0x00, /* 000000000000 */
708 0x00, 0x00, /* 000000000000 */ 683 0x00, 0x00, /* 000000000000 */
709 0x00, 0x00, /* 000000000000 */ 684 0x00, 0x00, /* 000000000000 */
710 0x3f, 0xc0, /* 001111111100 */ 685 0x00, 0x00, /* 000000000000 */
711 0x3f, 0xc0, /* 001111111100 */ 686 0x00, 0x00, /* 000000000000 */
712 0x3f, 0xc0, /* 001111111100 */ 687 0x00, 0x00, /* 000000000000 */
713 0x3f, 0xc0, /* 001111111100 */ 688 0x00, 0x00, /* 000000000000 */
714 0x3f, 0xc0, /* 001111111100 */ 689 0x00, 0x00, /* 000000000000 */
715 0x3f, 0xc0, /* 001111111100 */ 690 0x00, 0x00, /* 000000000000 */
716 0x3f, 0xc0, /* 001111111100 */ 691 0x00, 0x00, /* 000000000000 */
717 0x3f, 0xc0, /* 001111111100 */ 692 0x00, 0x00, /* 000000000000 */
718 0x3f, 0xc0, /* 001111111100 */ 693 0x30, 0x00, /* 001100000000 */
719 0x3f, 0xc0, /* 001111111100 */ 694 0x30, 0x00, /* 001100000000 */
720 0x3f, 0xc0, /* 001111111100 */ 695 0x3f, 0xe0, /* 001111111110 */
721 0x3f, 0xc0, /* 001111111100 */ 696 0x3f, 0xe0, /* 001111111110 */
722 0x00, 0x00, /* 000000000000 */ 697 0x00, 0x00, /* 000000000000 */
723 0x00, 0x00, /* 000000000000 */ 698 0x00, 0x00, /* 000000000000 */
724 0x00, 0x00, /* 000000000000 */ 699 0x00, 0x00, /* 000000000000 */
@@ -726,24 +701,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
726 0x00, 0x00, /* 000000000000 */ 701 0x00, 0x00, /* 000000000000 */
727 702
728 /* 29 0x1d '^]' */ 703 /* 29 0x1d '^]' */
729 /* FIXME */
730 0x00, 0x00, /* 000000000000 */ 704 0x00, 0x00, /* 000000000000 */
731 0x00, 0x00, /* 000000000000 */ 705 0x00, 0x00, /* 000000000000 */
732 0x00, 0x00, /* 000000000000 */ 706 0x00, 0x00, /* 000000000000 */
733 0x00, 0x00, /* 000000000000 */ 707 0x00, 0x00, /* 000000000000 */
734 0x00, 0x00, /* 000000000000 */ 708 0x00, 0x00, /* 000000000000 */
735 0x3f, 0xc0, /* 001111111100 */ 709 0x00, 0x00, /* 000000000000 */
736 0x3f, 0xc0, /* 001111111100 */ 710 0x09, 0x00, /* 000010010000 */
737 0x3f, 0xc0, /* 001111111100 */ 711 0x19, 0x80, /* 000110011000 */
738 0x3f, 0xc0, /* 001111111100 */ 712 0x39, 0xc0, /* 001110011100 */
739 0x3f, 0xc0, /* 001111111100 */ 713 0x7f, 0xe0, /* 011111111110 */
740 0x3f, 0xc0, /* 001111111100 */ 714 0xff, 0xf0, /* 111111111111 */
741 0x3f, 0xc0, /* 001111111100 */ 715 0x7f, 0xe0, /* 011111111110 */
742 0x3f, 0xc0, /* 001111111100 */ 716 0x39, 0xc0, /* 001110011100 */
743 0x3f, 0xc0, /* 001111111100 */ 717 0x19, 0x80, /* 000110011000 */
744 0x3f, 0xc0, /* 001111111100 */ 718 0x09, 0x00, /* 000010010000 */
745 0x3f, 0xc0, /* 001111111100 */ 719 0x00, 0x00, /* 000000000000 */
746 0x3f, 0xc0, /* 001111111100 */ 720 0x00, 0x00, /* 000000000000 */
747 0x00, 0x00, /* 000000000000 */ 721 0x00, 0x00, /* 000000000000 */
748 0x00, 0x00, /* 000000000000 */ 722 0x00, 0x00, /* 000000000000 */
749 0x00, 0x00, /* 000000000000 */ 723 0x00, 0x00, /* 000000000000 */
@@ -751,24 +725,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
751 0x00, 0x00, /* 000000000000 */ 725 0x00, 0x00, /* 000000000000 */
752 726
753 /* 30 0x1e '^^' */ 727 /* 30 0x1e '^^' */
754 /* FIXME */
755 0x00, 0x00, /* 000000000000 */ 728 0x00, 0x00, /* 000000000000 */
756 0x00, 0x00, /* 000000000000 */ 729 0x00, 0x00, /* 000000000000 */
757 0x00, 0x00, /* 000000000000 */ 730 0x00, 0x00, /* 000000000000 */
758 0x00, 0x00, /* 000000000000 */ 731 0x00, 0x00, /* 000000000000 */
759 0x00, 0x00, /* 000000000000 */ 732 0x00, 0x00, /* 000000000000 */
760 0x3f, 0xc0, /* 001111111100 */ 733 0x00, 0x00, /* 000000000000 */
761 0x3f, 0xc0, /* 001111111100 */ 734 0x04, 0x00, /* 000001000000 */
762 0x3f, 0xc0, /* 001111111100 */ 735 0x04, 0x00, /* 000001000000 */
763 0x3f, 0xc0, /* 001111111100 */ 736 0x0e, 0x00, /* 000011100000 */
764 0x3f, 0xc0, /* 001111111100 */ 737 0x0e, 0x00, /* 000011100000 */
765 0x3f, 0xc0, /* 001111111100 */ 738 0x1f, 0x00, /* 000111110000 */
766 0x3f, 0xc0, /* 001111111100 */ 739 0x1f, 0x00, /* 000111110000 */
767 0x3f, 0xc0, /* 001111111100 */ 740 0x3f, 0x80, /* 001111111000 */
768 0x3f, 0xc0, /* 001111111100 */ 741 0x3f, 0x80, /* 001111111000 */
769 0x3f, 0xc0, /* 001111111100 */ 742 0x7f, 0xc0, /* 011111111100 */
770 0x3f, 0xc0, /* 001111111100 */ 743 0x7f, 0xc0, /* 011111111100 */
771 0x3f, 0xc0, /* 001111111100 */ 744 0x00, 0x00, /* 000000000000 */
772 0x00, 0x00, /* 000000000000 */ 745 0x00, 0x00, /* 000000000000 */
773 0x00, 0x00, /* 000000000000 */ 746 0x00, 0x00, /* 000000000000 */
774 0x00, 0x00, /* 000000000000 */ 747 0x00, 0x00, /* 000000000000 */
@@ -776,24 +749,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
776 0x00, 0x00, /* 000000000000 */ 749 0x00, 0x00, /* 000000000000 */
777 750
778 /* 31 0x1f '^_' */ 751 /* 31 0x1f '^_' */
779 /* FIXME */
780 0x00, 0x00, /* 000000000000 */ 752 0x00, 0x00, /* 000000000000 */
781 0x00, 0x00, /* 000000000000 */ 753 0x00, 0x00, /* 000000000000 */
782 0x00, 0x00, /* 000000000000 */ 754 0x00, 0x00, /* 000000000000 */
783 0x00, 0x00, /* 000000000000 */ 755 0x00, 0x00, /* 000000000000 */
784 0x00, 0x00, /* 000000000000 */ 756 0x00, 0x00, /* 000000000000 */
785 0x3f, 0xc0, /* 001111111100 */ 757 0x00, 0x00, /* 000000000000 */
786 0x3f, 0xc0, /* 001111111100 */ 758 0x7f, 0xc0, /* 011111111100 */
787 0x3f, 0xc0, /* 001111111100 */ 759 0x7f, 0xc0, /* 011111111100 */
788 0x3f, 0xc0, /* 001111111100 */ 760 0x3f, 0x80, /* 001111111000 */
789 0x3f, 0xc0, /* 001111111100 */ 761 0x3f, 0x80, /* 001111111000 */
790 0x3f, 0xc0, /* 001111111100 */ 762 0x1f, 0x00, /* 000111110000 */
791 0x3f, 0xc0, /* 001111111100 */ 763 0x1f, 0x00, /* 000111110000 */
792 0x3f, 0xc0, /* 001111111100 */ 764 0x0e, 0x00, /* 000011100000 */
793 0x3f, 0xc0, /* 001111111100 */ 765 0x0e, 0x00, /* 000011100000 */
794 0x3f, 0xc0, /* 001111111100 */ 766 0x04, 0x00, /* 000001000000 */
795 0x3f, 0xc0, /* 001111111100 */ 767 0x04, 0x00, /* 000001000000 */
796 0x3f, 0xc0, /* 001111111100 */ 768 0x00, 0x00, /* 000000000000 */
797 0x00, 0x00, /* 000000000000 */ 769 0x00, 0x00, /* 000000000000 */
798 0x00, 0x00, /* 000000000000 */ 770 0x00, 0x00, /* 000000000000 */
799 0x00, 0x00, /* 000000000000 */ 771 0x00, 0x00, /* 000000000000 */
@@ -3081,29 +3053,28 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
3081 0x00, 0x00, /* 000000000000 */ 3053 0x00, 0x00, /* 000000000000 */
3082 3054
3083 /* 127 0x7f '.' */ 3055 /* 127 0x7f '.' */
3084 /* FIXME */
3085 0x00, 0x00, /* 000000000000 */ 3056 0x00, 0x00, /* 000000000000 */
3086 0x00, 0x00, /* 000000000000 */ 3057 0x00, 0x00, /* 000000000000 */
3087 0x00, 0x00, /* 000000000000 */ 3058 0x00, 0x00, /* 000000000000 */
3088 0x00, 0x00, /* 000000000000 */ 3059 0x00, 0x00, /* 000000000000 */
3089 0x00, 0x00, /* 000000000000 */ 3060 0x00, 0x00, /* 000000000000 */
3090 0x3f, 0xc0, /* 001111111100 */
3091 0x3f, 0xc0, /* 001111111100 */
3092 0x3f, 0xc0, /* 001111111100 */
3093 0x3f, 0xc0, /* 001111111100 */
3094 0x3f, 0xc0, /* 001111111100 */
3095 0x3f, 0xc0, /* 001111111100 */
3096 0x3f, 0xc0, /* 001111111100 */
3097 0x3f, 0xc0, /* 001111111100 */
3098 0x3f, 0xc0, /* 001111111100 */
3099 0x3f, 0xc0, /* 001111111100 */
3100 0x3f, 0xc0, /* 001111111100 */
3101 0x3f, 0xc0, /* 001111111100 */
3102 0x00, 0x00, /* 000000000000 */ 3061 0x00, 0x00, /* 000000000000 */
3103 0x00, 0x00, /* 000000000000 */ 3062 0x00, 0x00, /* 000000000000 */
3104 0x00, 0x00, /* 000000000000 */ 3063 0x00, 0x00, /* 000000000000 */
3105 0x00, 0x00, /* 000000000000 */ 3064 0x00, 0x00, /* 000000000000 */
3106 0x00, 0x00, /* 000000000000 */ 3065 0x00, 0x00, /* 000000000000 */
3066 0x00, 0x00, /* 000000000000 */
3067 0x00, 0x00, /* 000000000000 */
3068 0x00, 0x00, /* 000000000000 */
3069 0x00, 0x00, /* 000000000000 */
3070 0x00, 0x00, /* 000000000000 */
3071 0x00, 0x00, /* 000000000000 */
3072 0x00, 0x00, /* 000000000000 */
3073 0x00, 0x00, /* 000000000000 */
3074 0x00, 0x00, /* 000000000000 */
3075 0xff, 0xf0, /* 111111111111 */
3076 0xff, 0xf0, /* 111111111111 */
3077 0x00, 0x00, /* 000000000000 */
3107 3078
3108 /* 128 0x80 '.' */ 3079 /* 128 0x80 '.' */
3109 0x00, 0x00, /* 000000000000 */ 3080 0x00, 0x00, /* 000000000000 */
@@ -3826,24 +3797,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
3826 0x00, 0x00, /* 000000000000 */ 3797 0x00, 0x00, /* 000000000000 */
3827 3798
3828 /* 158 0x9e '.' */ 3799 /* 158 0x9e '.' */
3829 /* FIXME */
3830 0x00, 0x00, /* 000000000000 */
3831 0x00, 0x00, /* 000000000000 */
3832 0x00, 0x00, /* 000000000000 */
3833 0x00, 0x00, /* 000000000000 */ 3800 0x00, 0x00, /* 000000000000 */
3801 0x7f, 0x80, /* 011111111000 */
3802 0x30, 0xc0, /* 001100001100 */
3803 0x30, 0x60, /* 001100000110 */
3804 0x30, 0x60, /* 001100000110 */
3805 0x30, 0x60, /* 001100000110 */
3806 0x30, 0xc0, /* 001100001100 */
3807 0x37, 0x80, /* 001101111000 */
3808 0x30, 0x00, /* 001100000000 */
3809 0x33, 0x00, /* 001100110000 */
3810 0x37, 0x80, /* 001101111000 */
3811 0x33, 0x00, /* 001100110000 */
3812 0x33, 0x00, /* 001100110000 */
3813 0x33, 0x30, /* 001100110011 */
3814 0x31, 0xe0, /* 001100011110 */
3815 0x78, 0xc0, /* 011110001100 */
3834 0x00, 0x00, /* 000000000000 */ 3816 0x00, 0x00, /* 000000000000 */
3835 0x3f, 0xc0, /* 001111111100 */
3836 0x3f, 0xc0, /* 001111111100 */
3837 0x3f, 0xc0, /* 001111111100 */
3838 0x3f, 0xc0, /* 001111111100 */
3839 0x3f, 0xc0, /* 001111111100 */
3840 0x3f, 0xc0, /* 001111111100 */
3841 0x3f, 0xc0, /* 001111111100 */
3842 0x3f, 0xc0, /* 001111111100 */
3843 0x3f, 0xc0, /* 001111111100 */
3844 0x3f, 0xc0, /* 001111111100 */
3845 0x3f, 0xc0, /* 001111111100 */
3846 0x3f, 0xc0, /* 001111111100 */
3847 0x00, 0x00, /* 000000000000 */ 3817 0x00, 0x00, /* 000000000000 */
3848 0x00, 0x00, /* 000000000000 */ 3818 0x00, 0x00, /* 000000000000 */
3849 0x00, 0x00, /* 000000000000 */ 3819 0x00, 0x00, /* 000000000000 */
@@ -3851,28 +3821,27 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
3851 0x00, 0x00, /* 000000000000 */ 3821 0x00, 0x00, /* 000000000000 */
3852 3822
3853 /* 159 0x9f '.' */ 3823 /* 159 0x9f '.' */
3854 /* FIXME */
3855 0x00, 0x00, /* 000000000000 */
3856 0x00, 0x00, /* 000000000000 */
3857 0x00, 0x00, /* 000000000000 */
3858 0x00, 0x00, /* 000000000000 */
3859 0x00, 0x00, /* 000000000000 */
3860 0x3f, 0xc0, /* 001111111100 */
3861 0x3f, 0xc0, /* 001111111100 */
3862 0x3f, 0xc0, /* 001111111100 */
3863 0x3f, 0xc0, /* 001111111100 */
3864 0x3f, 0xc0, /* 001111111100 */
3865 0x3f, 0xc0, /* 001111111100 */
3866 0x3f, 0xc0, /* 001111111100 */
3867 0x3f, 0xc0, /* 001111111100 */
3868 0x3f, 0xc0, /* 001111111100 */
3869 0x3f, 0xc0, /* 001111111100 */
3870 0x3f, 0xc0, /* 001111111100 */
3871 0x3f, 0xc0, /* 001111111100 */
3872 0x00, 0x00, /* 000000000000 */
3873 0x00, 0x00, /* 000000000000 */
3874 0x00, 0x00, /* 000000000000 */
3875 0x00, 0x00, /* 000000000000 */ 3824 0x00, 0x00, /* 000000000000 */
3825 0x00, 0xc0, /* 000000001100 */
3826 0x01, 0xe0, /* 000000011110 */
3827 0x03, 0x30, /* 000000110011 */
3828 0x06, 0x00, /* 000001100000 */
3829 0x06, 0x00, /* 000001100000 */
3830 0x06, 0x00, /* 000001100000 */
3831 0x06, 0x00, /* 000001100000 */
3832 0x06, 0x00, /* 000001100000 */
3833 0x06, 0x00, /* 000001100000 */
3834 0x3f, 0xe0, /* 001111111110 */
3835 0x7f, 0xc0, /* 011111111100 */
3836 0x06, 0x00, /* 000001100000 */
3837 0x06, 0x00, /* 000001100000 */
3838 0x06, 0x00, /* 000001100000 */
3839 0x06, 0x00, /* 000001100000 */
3840 0x06, 0x00, /* 000001100000 */
3841 0x06, 0x00, /* 000001100000 */
3842 0xcc, 0x00, /* 110011000000 */
3843 0x78, 0x00, /* 011110000000 */
3844 0x30, 0x00, /* 001100000000 */
3876 0x00, 0x00, /* 000000000000 */ 3845 0x00, 0x00, /* 000000000000 */
3877 3846
3878 /* 160 0xa0 '.' */ 3847 /* 160 0xa0 '.' */
@@ -4092,24 +4061,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
4092 0x00, 0x00, /* 000000000000 */ 4061 0x00, 0x00, /* 000000000000 */
4093 4062
4094 /* 169 0xa9 '.' */ 4063 /* 169 0xa9 '.' */
4095 /* FIXME */
4096 0x00, 0x00, /* 000000000000 */
4097 0x00, 0x00, /* 000000000000 */ 4064 0x00, 0x00, /* 000000000000 */
4098 0x00, 0x00, /* 000000000000 */ 4065 0x00, 0x00, /* 000000000000 */
4099 0x00, 0x00, /* 000000000000 */ 4066 0x00, 0x00, /* 000000000000 */
4100 0x00, 0x00, /* 000000000000 */ 4067 0x00, 0x00, /* 000000000000 */
4101 0x3f, 0xc0, /* 001111111100 */ 4068 0x3f, 0xc0, /* 001111111100 */
4102 0x3f, 0xc0, /* 001111111100 */ 4069 0x3f, 0xc0, /* 001111111100 */
4103 0x3f, 0xc0, /* 001111111100 */ 4070 0x30, 0x00, /* 001100000000 */
4104 0x3f, 0xc0, /* 001111111100 */ 4071 0x30, 0x00, /* 001100000000 */
4105 0x3f, 0xc0, /* 001111111100 */ 4072 0x30, 0x00, /* 001100000000 */
4106 0x3f, 0xc0, /* 001111111100 */ 4073 0x00, 0x00, /* 000000000000 */
4107 0x3f, 0xc0, /* 001111111100 */ 4074 0x00, 0x00, /* 000000000000 */
4108 0x3f, 0xc0, /* 001111111100 */ 4075 0x00, 0x00, /* 000000000000 */
4109 0x3f, 0xc0, /* 001111111100 */ 4076 0x00, 0x00, /* 000000000000 */
4110 0x3f, 0xc0, /* 001111111100 */ 4077 0x00, 0x00, /* 000000000000 */
4111 0x3f, 0xc0, /* 001111111100 */ 4078 0x00, 0x00, /* 000000000000 */
4112 0x3f, 0xc0, /* 001111111100 */ 4079 0x00, 0x00, /* 000000000000 */
4080 0x00, 0x00, /* 000000000000 */
4113 0x00, 0x00, /* 000000000000 */ 4081 0x00, 0x00, /* 000000000000 */
4114 0x00, 0x00, /* 000000000000 */ 4082 0x00, 0x00, /* 000000000000 */
4115 0x00, 0x00, /* 000000000000 */ 4083 0x00, 0x00, /* 000000000000 */
@@ -5413,24 +5381,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5413 0x00, 0x00, /* 000000000000 */ 5381 0x00, 0x00, /* 000000000000 */
5414 5382
5415 /* 224 0xe0 '.' */ 5383 /* 224 0xe0 '.' */
5416 /* FIXME */
5417 0x00, 0x00, /* 000000000000 */ 5384 0x00, 0x00, /* 000000000000 */
5418 0x00, 0x00, /* 000000000000 */ 5385 0x00, 0x00, /* 000000000000 */
5419 0x00, 0x00, /* 000000000000 */ 5386 0x00, 0x00, /* 000000000000 */
5420 0x00, 0x00, /* 000000000000 */ 5387 0x00, 0x00, /* 000000000000 */
5421 0x00, 0x00, /* 000000000000 */ 5388 0x00, 0x00, /* 000000000000 */
5422 0x3f, 0xc0, /* 001111111100 */ 5389 0x00, 0x00, /* 000000000000 */
5423 0x3f, 0xc0, /* 001111111100 */ 5390 0x0f, 0x60, /* 000011110110 */
5424 0x3f, 0xc0, /* 001111111100 */ 5391 0x13, 0xe0, /* 000100111110 */
5425 0x3f, 0xc0, /* 001111111100 */ 5392 0x21, 0xc0, /* 001000011100 */
5426 0x3f, 0xc0, /* 001111111100 */ 5393 0x60, 0xc0, /* 011000001100 */
5427 0x3f, 0xc0, /* 001111111100 */ 5394 0x60, 0xc0, /* 011000001100 */
5428 0x3f, 0xc0, /* 001111111100 */ 5395 0x60, 0xc0, /* 011000001100 */
5429 0x3f, 0xc0, /* 001111111100 */ 5396 0x60, 0xc0, /* 011000001100 */
5430 0x3f, 0xc0, /* 001111111100 */ 5397 0x70, 0x80, /* 011100001000 */
5431 0x3f, 0xc0, /* 001111111100 */ 5398 0x39, 0xc0, /* 001110011100 */
5432 0x3f, 0xc0, /* 001111111100 */ 5399 0x1f, 0x60, /* 000111110110 */
5433 0x3f, 0xc0, /* 001111111100 */ 5400 0x00, 0x00, /* 000000000000 */
5434 0x00, 0x00, /* 000000000000 */ 5401 0x00, 0x00, /* 000000000000 */
5435 0x00, 0x00, /* 000000000000 */ 5402 0x00, 0x00, /* 000000000000 */
5436 0x00, 0x00, /* 000000000000 */ 5403 0x00, 0x00, /* 000000000000 */
@@ -5462,24 +5429,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5462 0x00, 0x00, /* 000000000000 */ 5429 0x00, 0x00, /* 000000000000 */
5463 5430
5464 /* 226 0xe2 '.' */ 5431 /* 226 0xe2 '.' */
5465 /* FIXME */
5466 0x00, 0x00, /* 000000000000 */
5467 0x00, 0x00, /* 000000000000 */
5468 0x00, 0x00, /* 000000000000 */ 5432 0x00, 0x00, /* 000000000000 */
5469 0x00, 0x00, /* 000000000000 */ 5433 0x00, 0x00, /* 000000000000 */
5434 0x3f, 0xe0, /* 001111111110 */
5435 0x3f, 0xe0, /* 001111111110 */
5436 0x30, 0x60, /* 001100000110 */
5437 0x30, 0x60, /* 001100000110 */
5438 0x30, 0x00, /* 001100000000 */
5439 0x30, 0x00, /* 001100000000 */
5440 0x30, 0x00, /* 001100000000 */
5441 0x30, 0x00, /* 001100000000 */
5442 0x30, 0x00, /* 001100000000 */
5443 0x30, 0x00, /* 001100000000 */
5444 0x30, 0x00, /* 001100000000 */
5445 0x30, 0x00, /* 001100000000 */
5446 0x30, 0x00, /* 001100000000 */
5447 0x30, 0x00, /* 001100000000 */
5470 0x00, 0x00, /* 000000000000 */ 5448 0x00, 0x00, /* 000000000000 */
5471 0x3f, 0xc0, /* 001111111100 */
5472 0x3f, 0xc0, /* 001111111100 */
5473 0x3f, 0xc0, /* 001111111100 */
5474 0x3f, 0xc0, /* 001111111100 */
5475 0x3f, 0xc0, /* 001111111100 */
5476 0x3f, 0xc0, /* 001111111100 */
5477 0x3f, 0xc0, /* 001111111100 */
5478 0x3f, 0xc0, /* 001111111100 */
5479 0x3f, 0xc0, /* 001111111100 */
5480 0x3f, 0xc0, /* 001111111100 */
5481 0x3f, 0xc0, /* 001111111100 */
5482 0x3f, 0xc0, /* 001111111100 */
5483 0x00, 0x00, /* 000000000000 */ 5449 0x00, 0x00, /* 000000000000 */
5484 0x00, 0x00, /* 000000000000 */ 5450 0x00, 0x00, /* 000000000000 */
5485 0x00, 0x00, /* 000000000000 */ 5451 0x00, 0x00, /* 000000000000 */
@@ -5487,49 +5453,47 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5487 0x00, 0x00, /* 000000000000 */ 5453 0x00, 0x00, /* 000000000000 */
5488 5454
5489 /* 227 0xe3 '.' */ 5455 /* 227 0xe3 '.' */
5490 /* FIXME */
5491 0x00, 0x00, /* 000000000000 */ 5456 0x00, 0x00, /* 000000000000 */
5492 0x00, 0x00, /* 000000000000 */ 5457 0x00, 0x00, /* 000000000000 */
5493 0x00, 0x00, /* 000000000000 */ 5458 0x00, 0x00, /* 000000000000 */
5494 0x00, 0x00, /* 000000000000 */ 5459 0x00, 0x00, /* 000000000000 */
5495 0x00, 0x00, /* 000000000000 */ 5460 0x00, 0x00, /* 000000000000 */
5496 0x3f, 0xc0, /* 001111111100 */
5497 0x3f, 0xc0, /* 001111111100 */
5498 0x3f, 0xc0, /* 001111111100 */
5499 0x3f, 0xc0, /* 001111111100 */
5500 0x3f, 0xc0, /* 001111111100 */
5501 0x3f, 0xc0, /* 001111111100 */
5502 0x3f, 0xc0, /* 001111111100 */
5503 0x3f, 0xc0, /* 001111111100 */
5504 0x3f, 0xc0, /* 001111111100 */
5505 0x3f, 0xc0, /* 001111111100 */
5506 0x3f, 0xc0, /* 001111111100 */
5507 0x3f, 0xc0, /* 001111111100 */
5508 0x00, 0x00, /* 000000000000 */
5509 0x00, 0x00, /* 000000000000 */ 5461 0x00, 0x00, /* 000000000000 */
5462 0x7f, 0xe0, /* 011111111110 */
5463 0x7f, 0xe0, /* 011111111110 */
5464 0x19, 0x80, /* 000110011000 */
5465 0x19, 0x80, /* 000110011000 */
5466 0x19, 0x80, /* 000110011000 */
5467 0x19, 0x80, /* 000110011000 */
5468 0x19, 0x80, /* 000110011000 */
5469 0x19, 0x80, /* 000110011000 */
5470 0x19, 0x80, /* 000110011000 */
5471 0x19, 0x80, /* 000110011000 */
5510 0x00, 0x00, /* 000000000000 */ 5472 0x00, 0x00, /* 000000000000 */
5511 0x00, 0x00, /* 000000000000 */ 5473 0x00, 0x00, /* 000000000000 */
5512 0x00, 0x00, /* 000000000000 */ 5474 0x00, 0x00, /* 000000000000 */
5513
5514 /* 228 0xe4 '.' */
5515 /* FIXME */
5516 0x00, 0x00, /* 000000000000 */ 5475 0x00, 0x00, /* 000000000000 */
5517 0x00, 0x00, /* 000000000000 */ 5476 0x00, 0x00, /* 000000000000 */
5518 0x00, 0x00, /* 000000000000 */ 5477 0x00, 0x00, /* 000000000000 */
5478
5479 /* 228 0xe4 '.' */
5519 0x00, 0x00, /* 000000000000 */ 5480 0x00, 0x00, /* 000000000000 */
5481 0x7f, 0xe0, /* 011111111110 */
5482 0x7f, 0xe0, /* 011111111110 */
5483 0x60, 0x60, /* 011000000110 */
5484 0x30, 0x60, /* 001100000110 */
5485 0x30, 0x00, /* 001100000000 */
5486 0x18, 0x00, /* 000110000000 */
5487 0x18, 0x00, /* 000110000000 */
5488 0x0c, 0x00, /* 000011000000 */
5489 0x18, 0x00, /* 000110000000 */
5490 0x18, 0x00, /* 000110000000 */
5491 0x30, 0x00, /* 001100000000 */
5492 0x30, 0x60, /* 001100000110 */
5493 0x60, 0x60, /* 011000000110 */
5494 0x7f, 0xe0, /* 011111111110 */
5495 0x7f, 0xe0, /* 011111111110 */
5520 0x00, 0x00, /* 000000000000 */ 5496 0x00, 0x00, /* 000000000000 */
5521 0x3f, 0xc0, /* 001111111100 */
5522 0x3f, 0xc0, /* 001111111100 */
5523 0x3f, 0xc0, /* 001111111100 */
5524 0x3f, 0xc0, /* 001111111100 */
5525 0x3f, 0xc0, /* 001111111100 */
5526 0x3f, 0xc0, /* 001111111100 */
5527 0x3f, 0xc0, /* 001111111100 */
5528 0x3f, 0xc0, /* 001111111100 */
5529 0x3f, 0xc0, /* 001111111100 */
5530 0x3f, 0xc0, /* 001111111100 */
5531 0x3f, 0xc0, /* 001111111100 */
5532 0x3f, 0xc0, /* 001111111100 */
5533 0x00, 0x00, /* 000000000000 */ 5497 0x00, 0x00, /* 000000000000 */
5534 0x00, 0x00, /* 000000000000 */ 5498 0x00, 0x00, /* 000000000000 */
5535 0x00, 0x00, /* 000000000000 */ 5499 0x00, 0x00, /* 000000000000 */
@@ -5537,24 +5501,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5537 0x00, 0x00, /* 000000000000 */ 5501 0x00, 0x00, /* 000000000000 */
5538 5502
5539 /* 229 0xe5 '.' */ 5503 /* 229 0xe5 '.' */
5540 /* FIXME */
5541 0x00, 0x00, /* 000000000000 */ 5504 0x00, 0x00, /* 000000000000 */
5542 0x00, 0x00, /* 000000000000 */ 5505 0x00, 0x00, /* 000000000000 */
5543 0x00, 0x00, /* 000000000000 */ 5506 0x00, 0x00, /* 000000000000 */
5544 0x00, 0x00, /* 000000000000 */ 5507 0x00, 0x00, /* 000000000000 */
5545 0x00, 0x00, /* 000000000000 */ 5508 0x00, 0x00, /* 000000000000 */
5546 0x3f, 0xc0, /* 001111111100 */ 5509 0x07, 0xe0, /* 000001111110 */
5547 0x3f, 0xc0, /* 001111111100 */ 5510 0x0f, 0xe0, /* 000011111110 */
5548 0x3f, 0xc0, /* 001111111100 */ 5511 0x13, 0x80, /* 000100111000 */
5549 0x3f, 0xc0, /* 001111111100 */ 5512 0x21, 0xc0, /* 001000011100 */
5550 0x3f, 0xc0, /* 001111111100 */ 5513 0x60, 0xc0, /* 011000001100 */
5551 0x3f, 0xc0, /* 001111111100 */ 5514 0x60, 0xc0, /* 011000001100 */
5552 0x3f, 0xc0, /* 001111111100 */ 5515 0x60, 0xc0, /* 011000001100 */
5553 0x3f, 0xc0, /* 001111111100 */ 5516 0x60, 0xc0, /* 011000001100 */
5554 0x3f, 0xc0, /* 001111111100 */ 5517 0x70, 0x80, /* 011100001000 */
5555 0x3f, 0xc0, /* 001111111100 */ 5518 0x39, 0x00, /* 001110010000 */
5556 0x3f, 0xc0, /* 001111111100 */ 5519 0x1e, 0x00, /* 000111100000 */
5557 0x3f, 0xc0, /* 001111111100 */ 5520 0x00, 0x00, /* 000000000000 */
5558 0x00, 0x00, /* 000000000000 */ 5521 0x00, 0x00, /* 000000000000 */
5559 0x00, 0x00, /* 000000000000 */ 5522 0x00, 0x00, /* 000000000000 */
5560 0x00, 0x00, /* 000000000000 */ 5523 0x00, 0x00, /* 000000000000 */
@@ -5586,24 +5549,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5586 0x00, 0x00, /* 000000000000 */ 5549 0x00, 0x00, /* 000000000000 */
5587 5550
5588 /* 231 0xe7 '.' */ 5551 /* 231 0xe7 '.' */
5589 /* FIXME */
5590 0x00, 0x00, /* 000000000000 */
5591 0x00, 0x00, /* 000000000000 */
5592 0x00, 0x00, /* 000000000000 */
5593 0x00, 0x00, /* 000000000000 */ 5552 0x00, 0x00, /* 000000000000 */
5594 0x00, 0x00, /* 000000000000 */ 5553 0x19, 0x80, /* 000110011000 */
5595 0x3f, 0xc0, /* 001111111100 */
5596 0x3f, 0xc0, /* 001111111100 */
5597 0x3f, 0xc0, /* 001111111100 */
5598 0x3f, 0xc0, /* 001111111100 */
5599 0x3f, 0xc0, /* 001111111100 */
5600 0x3f, 0xc0, /* 001111111100 */
5601 0x3f, 0xc0, /* 001111111100 */
5602 0x3f, 0xc0, /* 001111111100 */
5603 0x3f, 0xc0, /* 001111111100 */
5604 0x3f, 0xc0, /* 001111111100 */
5605 0x3f, 0xc0, /* 001111111100 */
5606 0x3f, 0xc0, /* 001111111100 */ 5554 0x3f, 0xc0, /* 001111111100 */
5555 0x66, 0x60, /* 011001100110 */
5556 0x66, 0x60, /* 011001100110 */
5557 0x06, 0x00, /* 000001100000 */
5558 0x06, 0x00, /* 000001100000 */
5559 0x06, 0x00, /* 000001100000 */
5560 0x06, 0x00, /* 000001100000 */
5561 0x06, 0x00, /* 000001100000 */
5562 0x06, 0x00, /* 000001100000 */
5563 0x06, 0x00, /* 000001100000 */
5564 0x06, 0x00, /* 000001100000 */
5565 0x06, 0x00, /* 000001100000 */
5566 0x06, 0x00, /* 000001100000 */
5567 0x06, 0x00, /* 000001100000 */
5568 0x00, 0x00, /* 000000000000 */
5607 0x00, 0x00, /* 000000000000 */ 5569 0x00, 0x00, /* 000000000000 */
5608 0x00, 0x00, /* 000000000000 */ 5570 0x00, 0x00, /* 000000000000 */
5609 0x00, 0x00, /* 000000000000 */ 5571 0x00, 0x00, /* 000000000000 */
@@ -5611,24 +5573,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5611 0x00, 0x00, /* 000000000000 */ 5573 0x00, 0x00, /* 000000000000 */
5612 5574
5613 /* 232 0xe8 '.' */ 5575 /* 232 0xe8 '.' */
5614 /* FIXME */
5615 0x00, 0x00, /* 000000000000 */
5616 0x00, 0x00, /* 000000000000 */
5617 0x00, 0x00, /* 000000000000 */ 5576 0x00, 0x00, /* 000000000000 */
5618 0x00, 0x00, /* 000000000000 */ 5577 0x00, 0x00, /* 000000000000 */
5578 0x7f, 0xe0, /* 011111111110 */
5579 0x7f, 0xe0, /* 011111111110 */
5580 0x06, 0x00, /* 000001100000 */
5581 0x06, 0x00, /* 000001100000 */
5582 0x0f, 0x00, /* 000011110000 */
5583 0x19, 0x80, /* 000110011000 */
5584 0x30, 0xc0, /* 001100001100 */
5585 0x30, 0xc0, /* 001100001100 */
5586 0x19, 0x80, /* 000110011000 */
5587 0x0f, 0x00, /* 000011110000 */
5588 0x06, 0x00, /* 000001100000 */
5589 0x06, 0x00, /* 000001100000 */
5590 0x7f, 0xe0, /* 011111111110 */
5591 0x7f, 0xe0, /* 011111111110 */
5619 0x00, 0x00, /* 000000000000 */ 5592 0x00, 0x00, /* 000000000000 */
5620 0x3f, 0xc0, /* 001111111100 */
5621 0x3f, 0xc0, /* 001111111100 */
5622 0x3f, 0xc0, /* 001111111100 */
5623 0x3f, 0xc0, /* 001111111100 */
5624 0x3f, 0xc0, /* 001111111100 */
5625 0x3f, 0xc0, /* 001111111100 */
5626 0x3f, 0xc0, /* 001111111100 */
5627 0x3f, 0xc0, /* 001111111100 */
5628 0x3f, 0xc0, /* 001111111100 */
5629 0x3f, 0xc0, /* 001111111100 */
5630 0x3f, 0xc0, /* 001111111100 */
5631 0x3f, 0xc0, /* 001111111100 */
5632 0x00, 0x00, /* 000000000000 */ 5593 0x00, 0x00, /* 000000000000 */
5633 0x00, 0x00, /* 000000000000 */ 5594 0x00, 0x00, /* 000000000000 */
5634 0x00, 0x00, /* 000000000000 */ 5595 0x00, 0x00, /* 000000000000 */
@@ -5636,24 +5597,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5636 0x00, 0x00, /* 000000000000 */ 5597 0x00, 0x00, /* 000000000000 */
5637 5598
5638 /* 233 0xe9 '.' */ 5599 /* 233 0xe9 '.' */
5639 /* FIXME */
5640 0x00, 0x00, /* 000000000000 */ 5600 0x00, 0x00, /* 000000000000 */
5641 0x00, 0x00, /* 000000000000 */ 5601 0x00, 0x00, /* 000000000000 */
5642 0x00, 0x00, /* 000000000000 */ 5602 0x00, 0x00, /* 000000000000 */
5643 0x00, 0x00, /* 000000000000 */ 5603 0x00, 0x00, /* 000000000000 */
5604 0x0f, 0x00, /* 000011110000 */
5605 0x1f, 0x80, /* 000111111000 */
5606 0x30, 0xc0, /* 001100001100 */
5607 0x60, 0x60, /* 011000000110 */
5608 0x60, 0x60, /* 011000000110 */
5609 0x7f, 0xe0, /* 011111111110 */
5610 0x7f, 0xe0, /* 011111111110 */
5611 0x60, 0x60, /* 011000000110 */
5612 0x60, 0x60, /* 011000000110 */
5613 0x30, 0xc0, /* 001100001100 */
5614 0x1f, 0x80, /* 000111111000 */
5615 0x0f, 0x00, /* 000011110000 */
5644 0x00, 0x00, /* 000000000000 */ 5616 0x00, 0x00, /* 000000000000 */
5645 0x3f, 0xc0, /* 001111111100 */
5646 0x3f, 0xc0, /* 001111111100 */
5647 0x3f, 0xc0, /* 001111111100 */
5648 0x3f, 0xc0, /* 001111111100 */
5649 0x3f, 0xc0, /* 001111111100 */
5650 0x3f, 0xc0, /* 001111111100 */
5651 0x3f, 0xc0, /* 001111111100 */
5652 0x3f, 0xc0, /* 001111111100 */
5653 0x3f, 0xc0, /* 001111111100 */
5654 0x3f, 0xc0, /* 001111111100 */
5655 0x3f, 0xc0, /* 001111111100 */
5656 0x3f, 0xc0, /* 001111111100 */
5657 0x00, 0x00, /* 000000000000 */ 5617 0x00, 0x00, /* 000000000000 */
5658 0x00, 0x00, /* 000000000000 */ 5618 0x00, 0x00, /* 000000000000 */
5659 0x00, 0x00, /* 000000000000 */ 5619 0x00, 0x00, /* 000000000000 */
@@ -5661,24 +5621,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5661 0x00, 0x00, /* 000000000000 */ 5621 0x00, 0x00, /* 000000000000 */
5662 5622
5663 /* 234 0xea '.' */ 5623 /* 234 0xea '.' */
5664 /* FIXME */
5665 0x00, 0x00, /* 000000000000 */ 5624 0x00, 0x00, /* 000000000000 */
5666 0x00, 0x00, /* 000000000000 */ 5625 0x00, 0x00, /* 000000000000 */
5667 0x00, 0x00, /* 000000000000 */ 5626 0x00, 0x00, /* 000000000000 */
5668 0x00, 0x00, /* 000000000000 */ 5627 0x00, 0x00, /* 000000000000 */
5628 0x1f, 0x00, /* 000111110000 */
5629 0x31, 0x80, /* 001100011000 */
5630 0x30, 0xc0, /* 001100001100 */
5631 0x30, 0xc0, /* 001100001100 */
5632 0x60, 0x60, /* 011000000110 */
5633 0x60, 0x60, /* 011000000110 */
5634 0x30, 0xc0, /* 001100001100 */
5635 0x30, 0xc0, /* 001100001100 */
5636 0x19, 0x80, /* 000110011000 */
5637 0x19, 0x80, /* 000110011000 */
5638 0xd9, 0xb0, /* 110110011011 */
5639 0x79, 0xe0, /* 011110011110 */
5669 0x00, 0x00, /* 000000000000 */ 5640 0x00, 0x00, /* 000000000000 */
5670 0x3f, 0xc0, /* 001111111100 */
5671 0x3f, 0xc0, /* 001111111100 */
5672 0x3f, 0xc0, /* 001111111100 */
5673 0x3f, 0xc0, /* 001111111100 */
5674 0x3f, 0xc0, /* 001111111100 */
5675 0x3f, 0xc0, /* 001111111100 */
5676 0x3f, 0xc0, /* 001111111100 */
5677 0x3f, 0xc0, /* 001111111100 */
5678 0x3f, 0xc0, /* 001111111100 */
5679 0x3f, 0xc0, /* 001111111100 */
5680 0x3f, 0xc0, /* 001111111100 */
5681 0x3f, 0xc0, /* 001111111100 */
5682 0x00, 0x00, /* 000000000000 */ 5641 0x00, 0x00, /* 000000000000 */
5683 0x00, 0x00, /* 000000000000 */ 5642 0x00, 0x00, /* 000000000000 */
5684 0x00, 0x00, /* 000000000000 */ 5643 0x00, 0x00, /* 000000000000 */
@@ -5686,24 +5645,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5686 0x00, 0x00, /* 000000000000 */ 5645 0x00, 0x00, /* 000000000000 */
5687 5646
5688 /* 235 0xeb '.' */ 5647 /* 235 0xeb '.' */
5689 /* FIXME */
5690 0x00, 0x00, /* 000000000000 */
5691 0x00, 0x00, /* 000000000000 */
5692 0x00, 0x00, /* 000000000000 */
5693 0x00, 0x00, /* 000000000000 */ 5648 0x00, 0x00, /* 000000000000 */
5649 0x07, 0x80, /* 000001111000 */
5650 0x0c, 0xc0, /* 000011001100 */
5651 0x18, 0x60, /* 000110000110 */
5652 0x18, 0x00, /* 000110000000 */
5653 0x0c, 0x00, /* 000011000000 */
5654 0x06, 0x00, /* 000001100000 */
5655 0x03, 0x00, /* 000000110000 */
5656 0x0f, 0x80, /* 000011111000 */
5657 0x11, 0xc0, /* 000100011100 */
5658 0x20, 0xe0, /* 001000001110 */
5659 0x60, 0x60, /* 011000000110 */
5660 0x60, 0x60, /* 011000000110 */
5661 0x70, 0x40, /* 011100000100 */
5662 0x38, 0x80, /* 001110001000 */
5663 0x1f, 0x00, /* 000111110000 */
5694 0x00, 0x00, /* 000000000000 */ 5664 0x00, 0x00, /* 000000000000 */
5695 0x3f, 0xc0, /* 001111111100 */
5696 0x3f, 0xc0, /* 001111111100 */
5697 0x3f, 0xc0, /* 001111111100 */
5698 0x3f, 0xc0, /* 001111111100 */
5699 0x3f, 0xc0, /* 001111111100 */
5700 0x3f, 0xc0, /* 001111111100 */
5701 0x3f, 0xc0, /* 001111111100 */
5702 0x3f, 0xc0, /* 001111111100 */
5703 0x3f, 0xc0, /* 001111111100 */
5704 0x3f, 0xc0, /* 001111111100 */
5705 0x3f, 0xc0, /* 001111111100 */
5706 0x3f, 0xc0, /* 001111111100 */
5707 0x00, 0x00, /* 000000000000 */ 5665 0x00, 0x00, /* 000000000000 */
5708 0x00, 0x00, /* 000000000000 */ 5666 0x00, 0x00, /* 000000000000 */
5709 0x00, 0x00, /* 000000000000 */ 5667 0x00, 0x00, /* 000000000000 */
@@ -5711,99 +5669,95 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5711 0x00, 0x00, /* 000000000000 */ 5669 0x00, 0x00, /* 000000000000 */
5712 5670
5713 /* 236 0xec '.' */ 5671 /* 236 0xec '.' */
5714 /* FIXME */
5715 0x00, 0x00, /* 000000000000 */ 5672 0x00, 0x00, /* 000000000000 */
5716 0x00, 0x00, /* 000000000000 */ 5673 0x00, 0x00, /* 000000000000 */
5717 0x00, 0x00, /* 000000000000 */ 5674 0x00, 0x00, /* 000000000000 */
5718 0x00, 0x00, /* 000000000000 */ 5675 0x00, 0x00, /* 000000000000 */
5719 0x00, 0x00, /* 000000000000 */ 5676 0x00, 0x00, /* 000000000000 */
5720 0x3f, 0xc0, /* 001111111100 */
5721 0x3f, 0xc0, /* 001111111100 */
5722 0x3f, 0xc0, /* 001111111100 */
5723 0x3f, 0xc0, /* 001111111100 */
5724 0x3f, 0xc0, /* 001111111100 */
5725 0x3f, 0xc0, /* 001111111100 */
5726 0x3f, 0xc0, /* 001111111100 */
5727 0x3f, 0xc0, /* 001111111100 */
5728 0x3f, 0xc0, /* 001111111100 */
5729 0x3f, 0xc0, /* 001111111100 */
5730 0x3f, 0xc0, /* 001111111100 */
5731 0x3f, 0xc0, /* 001111111100 */
5732 0x00, 0x00, /* 000000000000 */ 5677 0x00, 0x00, /* 000000000000 */
5733 0x00, 0x00, /* 000000000000 */ 5678 0x00, 0x00, /* 000000000000 */
5734 0x00, 0x00, /* 000000000000 */ 5679 0x00, 0x00, /* 000000000000 */
5680 0x39, 0xc0, /* 001110011100 */
5681 0x6f, 0x60, /* 011011110110 */
5682 0x66, 0x60, /* 011001100110 */
5683 0xc6, 0x30, /* 110001100011 */
5684 0xc6, 0x30, /* 110001100011 */
5685 0x66, 0x60, /* 011001100110 */
5686 0x6f, 0x60, /* 011011110110 */
5687 0x39, 0xc0, /* 001110011100 */
5735 0x00, 0x00, /* 000000000000 */ 5688 0x00, 0x00, /* 000000000000 */
5736 0x00, 0x00, /* 000000000000 */ 5689 0x00, 0x00, /* 000000000000 */
5737
5738 /* 237 0xed '.' */
5739 /* FIXME */
5740 0x00, 0x00, /* 000000000000 */ 5690 0x00, 0x00, /* 000000000000 */
5741 0x00, 0x00, /* 000000000000 */ 5691 0x00, 0x00, /* 000000000000 */
5742 0x00, 0x00, /* 000000000000 */ 5692 0x00, 0x00, /* 000000000000 */
5743 0x00, 0x00, /* 000000000000 */ 5693 0x00, 0x00, /* 000000000000 */
5694
5695 /* 237 0xed '.' */
5744 0x00, 0x00, /* 000000000000 */ 5696 0x00, 0x00, /* 000000000000 */
5745 0x3f, 0xc0, /* 001111111100 */
5746 0x3f, 0xc0, /* 001111111100 */
5747 0x3f, 0xc0, /* 001111111100 */
5748 0x3f, 0xc0, /* 001111111100 */
5749 0x3f, 0xc0, /* 001111111100 */
5750 0x3f, 0xc0, /* 001111111100 */
5751 0x3f, 0xc0, /* 001111111100 */
5752 0x3f, 0xc0, /* 001111111100 */
5753 0x3f, 0xc0, /* 001111111100 */
5754 0x3f, 0xc0, /* 001111111100 */
5755 0x3f, 0xc0, /* 001111111100 */
5756 0x3f, 0xc0, /* 001111111100 */
5757 0x00, 0x00, /* 000000000000 */ 5697 0x00, 0x00, /* 000000000000 */
5758 0x00, 0x00, /* 000000000000 */ 5698 0x00, 0x00, /* 000000000000 */
5759 0x00, 0x00, /* 000000000000 */ 5699 0x00, 0x00, /* 000000000000 */
5700 0x00, 0xc0, /* 000000001100 */
5701 0x00, 0xc0, /* 000000001100 */
5702 0x01, 0x80, /* 000000011000 */
5703 0x01, 0x80, /* 000000011000 */
5704 0x3b, 0xc0, /* 001110111100 */
5705 0x6f, 0x60, /* 011011110110 */
5706 0x66, 0x60, /* 011001100110 */
5707 0xc6, 0x30, /* 110001100011 */
5708 0xc6, 0x30, /* 110001100011 */
5709 0x66, 0x60, /* 011001100110 */
5710 0x6f, 0x60, /* 011011110110 */
5711 0x3d, 0xc0, /* 001111011100 */
5712 0x18, 0x00, /* 000110000000 */
5713 0x18, 0x00, /* 000110000000 */
5714 0x30, 0x00, /* 001100000000 */
5715 0x30, 0x00, /* 001100000000 */
5760 0x00, 0x00, /* 000000000000 */ 5716 0x00, 0x00, /* 000000000000 */
5761 0x00, 0x00, /* 000000000000 */ 5717 0x00, 0x00, /* 000000000000 */
5762 5718
5763 /* 238 0xee '.' */ 5719 /* 238 0xee '.' */
5764 /* FIXME */
5765 0x00, 0x00, /* 000000000000 */ 5720 0x00, 0x00, /* 000000000000 */
5721 0x01, 0xc0, /* 000000011100 */
5722 0x03, 0x00, /* 000000110000 */
5723 0x06, 0x00, /* 000001100000 */
5724 0x06, 0x00, /* 000001100000 */
5725 0x0c, 0x00, /* 000011000000 */
5726 0x0c, 0x00, /* 000011000000 */
5727 0x18, 0x00, /* 000110000000 */
5728 0x1f, 0xc0, /* 000111111100 */
5729 0x18, 0x00, /* 000110000000 */
5730 0x0c, 0x00, /* 000011000000 */
5731 0x0c, 0x00, /* 000011000000 */
5732 0x06, 0x00, /* 000001100000 */
5733 0x06, 0x00, /* 000001100000 */
5734 0x03, 0x00, /* 000000110000 */
5735 0x01, 0xc0, /* 000000011100 */
5766 0x00, 0x00, /* 000000000000 */ 5736 0x00, 0x00, /* 000000000000 */
5767 0x00, 0x00, /* 000000000000 */ 5737 0x00, 0x00, /* 000000000000 */
5768 0x00, 0x00, /* 000000000000 */ 5738 0x00, 0x00, /* 000000000000 */
5769 0x00, 0x00, /* 000000000000 */ 5739 0x00, 0x00, /* 000000000000 */
5770 0x3f, 0xc0, /* 001111111100 */
5771 0x3f, 0xc0, /* 001111111100 */
5772 0x3f, 0xc0, /* 001111111100 */
5773 0x3f, 0xc0, /* 001111111100 */
5774 0x3f, 0xc0, /* 001111111100 */
5775 0x3f, 0xc0, /* 001111111100 */
5776 0x3f, 0xc0, /* 001111111100 */
5777 0x3f, 0xc0, /* 001111111100 */
5778 0x3f, 0xc0, /* 001111111100 */
5779 0x3f, 0xc0, /* 001111111100 */
5780 0x3f, 0xc0, /* 001111111100 */
5781 0x3f, 0xc0, /* 001111111100 */
5782 0x00, 0x00, /* 000000000000 */
5783 0x00, 0x00, /* 000000000000 */
5784 0x00, 0x00, /* 000000000000 */
5785 0x00, 0x00, /* 000000000000 */ 5740 0x00, 0x00, /* 000000000000 */
5786 0x00, 0x00, /* 000000000000 */ 5741 0x00, 0x00, /* 000000000000 */
5787 5742
5788 /* 239 0xef '.' */ 5743 /* 239 0xef '.' */
5789 /* FIXME */
5790 0x00, 0x00, /* 000000000000 */ 5744 0x00, 0x00, /* 000000000000 */
5791 0x00, 0x00, /* 000000000000 */ 5745 0x00, 0x00, /* 000000000000 */
5792 0x00, 0x00, /* 000000000000 */ 5746 0x00, 0x00, /* 000000000000 */
5793 0x00, 0x00, /* 000000000000 */ 5747 0x00, 0x00, /* 000000000000 */
5794 0x00, 0x00, /* 000000000000 */ 5748 0x00, 0x00, /* 000000000000 */
5795 0x3f, 0xc0, /* 001111111100 */ 5749 0x0f, 0x00, /* 000011110000 */
5796 0x3f, 0xc0, /* 001111111100 */ 5750 0x1f, 0x80, /* 000111111000 */
5797 0x3f, 0xc0, /* 001111111100 */ 5751 0x39, 0xc0, /* 001110011100 */
5798 0x3f, 0xc0, /* 001111111100 */ 5752 0x30, 0xc0, /* 001100001100 */
5799 0x3f, 0xc0, /* 001111111100 */ 5753 0x30, 0xc0, /* 001100001100 */
5800 0x3f, 0xc0, /* 001111111100 */ 5754 0x30, 0xc0, /* 001100001100 */
5801 0x3f, 0xc0, /* 001111111100 */ 5755 0x30, 0xc0, /* 001100001100 */
5802 0x3f, 0xc0, /* 001111111100 */ 5756 0x30, 0xc0, /* 001100001100 */
5803 0x3f, 0xc0, /* 001111111100 */ 5757 0x30, 0xc0, /* 001100001100 */
5804 0x3f, 0xc0, /* 001111111100 */ 5758 0x30, 0xc0, /* 001100001100 */
5805 0x3f, 0xc0, /* 001111111100 */ 5759 0x30, 0xc0, /* 001100001100 */
5806 0x3f, 0xc0, /* 001111111100 */ 5760 0x30, 0xc0, /* 001100001100 */
5807 0x00, 0x00, /* 000000000000 */ 5761 0x00, 0x00, /* 000000000000 */
5808 0x00, 0x00, /* 000000000000 */ 5762 0x00, 0x00, /* 000000000000 */
5809 0x00, 0x00, /* 000000000000 */ 5763 0x00, 0x00, /* 000000000000 */
@@ -5811,24 +5765,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5811 0x00, 0x00, /* 000000000000 */ 5765 0x00, 0x00, /* 000000000000 */
5812 5766
5813 /* 240 0xf0 '.' */ 5767 /* 240 0xf0 '.' */
5814 /* FIXME */
5815 0x00, 0x00, /* 000000000000 */ 5768 0x00, 0x00, /* 000000000000 */
5816 0x00, 0x00, /* 000000000000 */ 5769 0x00, 0x00, /* 000000000000 */
5817 0x00, 0x00, /* 000000000000 */ 5770 0x00, 0x00, /* 000000000000 */
5818 0x00, 0x00, /* 000000000000 */ 5771 0x00, 0x00, /* 000000000000 */
5819 0x00, 0x00, /* 000000000000 */ 5772 0x00, 0x00, /* 000000000000 */
5820 0x3f, 0xc0, /* 001111111100 */ 5773 0x7f, 0xe0, /* 011111111110 */
5821 0x3f, 0xc0, /* 001111111100 */ 5774 0x7f, 0xe0, /* 011111111110 */
5822 0x3f, 0xc0, /* 001111111100 */ 5775 0x00, 0x00, /* 000000000000 */
5823 0x3f, 0xc0, /* 001111111100 */ 5776 0x00, 0x00, /* 000000000000 */
5824 0x3f, 0xc0, /* 001111111100 */ 5777 0x00, 0x00, /* 000000000000 */
5825 0x3f, 0xc0, /* 001111111100 */ 5778 0x7f, 0xe0, /* 011111111110 */
5826 0x3f, 0xc0, /* 001111111100 */ 5779 0x7f, 0xe0, /* 011111111110 */
5827 0x3f, 0xc0, /* 001111111100 */ 5780 0x00, 0x00, /* 000000000000 */
5828 0x3f, 0xc0, /* 001111111100 */ 5781 0x00, 0x00, /* 000000000000 */
5829 0x3f, 0xc0, /* 001111111100 */ 5782 0x00, 0x00, /* 000000000000 */
5830 0x3f, 0xc0, /* 001111111100 */ 5783 0x7f, 0xe0, /* 011111111110 */
5831 0x3f, 0xc0, /* 001111111100 */ 5784 0x7f, 0xe0, /* 011111111110 */
5832 0x00, 0x00, /* 000000000000 */ 5785 0x00, 0x00, /* 000000000000 */
5833 0x00, 0x00, /* 000000000000 */ 5786 0x00, 0x00, /* 000000000000 */
5834 0x00, 0x00, /* 000000000000 */ 5787 0x00, 0x00, /* 000000000000 */
@@ -5860,24 +5813,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5860 0x00, 0x00, /* 000000000000 */ 5813 0x00, 0x00, /* 000000000000 */
5861 5814
5862 /* 242 0xf2 '.' */ 5815 /* 242 0xf2 '.' */
5863 /* FIXME */
5864 0x00, 0x00, /* 000000000000 */ 5816 0x00, 0x00, /* 000000000000 */
5865 0x00, 0x00, /* 000000000000 */ 5817 0x00, 0x00, /* 000000000000 */
5866 0x00, 0x00, /* 000000000000 */ 5818 0x00, 0x00, /* 000000000000 */
5867 0x00, 0x00, /* 000000000000 */ 5819 0x00, 0x00, /* 000000000000 */
5820 0x60, 0x00, /* 011000000000 */
5821 0x38, 0x00, /* 001110000000 */
5822 0x0e, 0x00, /* 000011100000 */
5823 0x03, 0x80, /* 000000111000 */
5824 0x00, 0xe0, /* 000000001110 */
5825 0x00, 0xe0, /* 000000001110 */
5826 0x03, 0x80, /* 000000111000 */
5827 0x0e, 0x00, /* 000011100000 */
5828 0x38, 0x00, /* 001110000000 */
5829 0x60, 0x00, /* 011000000000 */
5868 0x00, 0x00, /* 000000000000 */ 5830 0x00, 0x00, /* 000000000000 */
5869 0x3f, 0xc0, /* 001111111100 */ 5831 0x7f, 0xe0, /* 011111111110 */
5870 0x3f, 0xc0, /* 001111111100 */ 5832 0x7f, 0xe0, /* 011111111110 */
5871 0x3f, 0xc0, /* 001111111100 */
5872 0x3f, 0xc0, /* 001111111100 */
5873 0x3f, 0xc0, /* 001111111100 */
5874 0x3f, 0xc0, /* 001111111100 */
5875 0x3f, 0xc0, /* 001111111100 */
5876 0x3f, 0xc0, /* 001111111100 */
5877 0x3f, 0xc0, /* 001111111100 */
5878 0x3f, 0xc0, /* 001111111100 */
5879 0x3f, 0xc0, /* 001111111100 */
5880 0x3f, 0xc0, /* 001111111100 */
5881 0x00, 0x00, /* 000000000000 */ 5833 0x00, 0x00, /* 000000000000 */
5882 0x00, 0x00, /* 000000000000 */ 5834 0x00, 0x00, /* 000000000000 */
5883 0x00, 0x00, /* 000000000000 */ 5835 0x00, 0x00, /* 000000000000 */
@@ -5885,24 +5837,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5885 0x00, 0x00, /* 000000000000 */ 5837 0x00, 0x00, /* 000000000000 */
5886 5838
5887 /* 243 0xf3 '.' */ 5839 /* 243 0xf3 '.' */
5888 /* FIXME */
5889 0x00, 0x00, /* 000000000000 */ 5840 0x00, 0x00, /* 000000000000 */
5890 0x00, 0x00, /* 000000000000 */ 5841 0x00, 0x00, /* 000000000000 */
5891 0x00, 0x00, /* 000000000000 */ 5842 0x00, 0x00, /* 000000000000 */
5843 0x00, 0x60, /* 000000000110 */
5844 0x01, 0xc0, /* 000000011100 */
5845 0x07, 0x00, /* 000001110000 */
5846 0x1c, 0x00, /* 000111000000 */
5847 0x70, 0x00, /* 011100000000 */
5848 0x70, 0x00, /* 011100000000 */
5849 0x1c, 0x00, /* 000111000000 */
5850 0x07, 0x00, /* 000001110000 */
5851 0x01, 0xc0, /* 000000011100 */
5852 0x00, 0x60, /* 000000000110 */
5892 0x00, 0x00, /* 000000000000 */ 5853 0x00, 0x00, /* 000000000000 */
5854 0x7f, 0xe0, /* 011111111110 */
5855 0x7f, 0xe0, /* 011111111110 */
5893 0x00, 0x00, /* 000000000000 */ 5856 0x00, 0x00, /* 000000000000 */
5894 0x3f, 0xc0, /* 001111111100 */
5895 0x3f, 0xc0, /* 001111111100 */
5896 0x3f, 0xc0, /* 001111111100 */
5897 0x3f, 0xc0, /* 001111111100 */
5898 0x3f, 0xc0, /* 001111111100 */
5899 0x3f, 0xc0, /* 001111111100 */
5900 0x3f, 0xc0, /* 001111111100 */
5901 0x3f, 0xc0, /* 001111111100 */
5902 0x3f, 0xc0, /* 001111111100 */
5903 0x3f, 0xc0, /* 001111111100 */
5904 0x3f, 0xc0, /* 001111111100 */
5905 0x3f, 0xc0, /* 001111111100 */
5906 0x00, 0x00, /* 000000000000 */ 5857 0x00, 0x00, /* 000000000000 */
5907 0x00, 0x00, /* 000000000000 */ 5858 0x00, 0x00, /* 000000000000 */
5908 0x00, 0x00, /* 000000000000 */ 5859 0x00, 0x00, /* 000000000000 */
@@ -5910,54 +5861,52 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5910 0x00, 0x00, /* 000000000000 */ 5861 0x00, 0x00, /* 000000000000 */
5911 5862
5912 /* 244 0xf4 '.' */ 5863 /* 244 0xf4 '.' */
5913 /* FIXME */
5914 0x00, 0x00, /* 000000000000 */
5915 0x00, 0x00, /* 000000000000 */
5916 0x00, 0x00, /* 000000000000 */
5917 0x00, 0x00, /* 000000000000 */
5918 0x00, 0x00, /* 000000000000 */
5919 0x3f, 0xc0, /* 001111111100 */
5920 0x3f, 0xc0, /* 001111111100 */
5921 0x3f, 0xc0, /* 001111111100 */
5922 0x3f, 0xc0, /* 001111111100 */
5923 0x3f, 0xc0, /* 001111111100 */
5924 0x3f, 0xc0, /* 001111111100 */
5925 0x3f, 0xc0, /* 001111111100 */
5926 0x3f, 0xc0, /* 001111111100 */
5927 0x3f, 0xc0, /* 001111111100 */
5928 0x3f, 0xc0, /* 001111111100 */
5929 0x3f, 0xc0, /* 001111111100 */
5930 0x3f, 0xc0, /* 001111111100 */
5931 0x00, 0x00, /* 000000000000 */
5932 0x00, 0x00, /* 000000000000 */
5933 0x00, 0x00, /* 000000000000 */
5934 0x00, 0x00, /* 000000000000 */
5935 0x00, 0x00, /* 000000000000 */ 5864 0x00, 0x00, /* 000000000000 */
5865 0x03, 0x80, /* 000000111000 */
5866 0x07, 0xc0, /* 000001111100 */
5867 0x0c, 0x60, /* 000011000110 */
5868 0x0c, 0x60, /* 000011000110 */
5869 0x0c, 0x00, /* 000011000000 */
5870 0x0c, 0x00, /* 000011000000 */
5871 0x0c, 0x00, /* 000011000000 */
5872 0x0c, 0x00, /* 000011000000 */
5873 0x0c, 0x00, /* 000011000000 */
5874 0x0c, 0x00, /* 000011000000 */
5875 0x0c, 0x00, /* 000011000000 */
5876 0x0c, 0x00, /* 000011000000 */
5877 0x0c, 0x00, /* 000011000000 */
5878 0x0c, 0x00, /* 000011000000 */
5879 0x0c, 0x00, /* 000011000000 */
5880 0x0c, 0x00, /* 000011000000 */
5881 0x0c, 0x00, /* 000011000000 */
5882 0x0c, 0x00, /* 000011000000 */
5883 0x0c, 0x00, /* 000011000000 */
5884 0x0c, 0x00, /* 000011000000 */
5885 0x0c, 0x00, /* 000011000000 */
5936 5886
5937 /* 245 0xf5 '.' */ 5887 /* 245 0xf5 '.' */
5938 /* FIXME */
5939 0x00, 0x00, /* 000000000000 */
5940 0x00, 0x00, /* 000000000000 */
5941 0x00, 0x00, /* 000000000000 */
5942 0x00, 0x00, /* 000000000000 */
5943 0x00, 0x00, /* 000000000000 */
5944 0x3f, 0xc0, /* 001111111100 */
5945 0x3f, 0xc0, /* 001111111100 */
5946 0x3f, 0xc0, /* 001111111100 */
5947 0x3f, 0xc0, /* 001111111100 */
5948 0x3f, 0xc0, /* 001111111100 */
5949 0x3f, 0xc0, /* 001111111100 */
5950 0x3f, 0xc0, /* 001111111100 */
5951 0x3f, 0xc0, /* 001111111100 */
5952 0x3f, 0xc0, /* 001111111100 */
5953 0x3f, 0xc0, /* 001111111100 */
5954 0x3f, 0xc0, /* 001111111100 */
5955 0x3f, 0xc0, /* 001111111100 */
5956 0x00, 0x00, /* 000000000000 */
5957 0x00, 0x00, /* 000000000000 */
5958 0x00, 0x00, /* 000000000000 */
5959 0x00, 0x00, /* 000000000000 */
5960 0x00, 0x00, /* 000000000000 */ 5888 0x00, 0x00, /* 000000000000 */
5889 0x1c, 0x00, /* 000111000000 */
5890 0x3e, 0x00, /* 001111100000 */
5891 0x63, 0x00, /* 011000110000 */
5892 0x63, 0x00, /* 011000110000 */
5893 0x03, 0x00, /* 000000110000 */
5894 0x03, 0x00, /* 000000110000 */
5895 0x03, 0x00, /* 000000110000 */
5896 0x03, 0x00, /* 000000110000 */
5897 0x03, 0x00, /* 000000110000 */
5898 0x03, 0x00, /* 000000110000 */
5899 0x03, 0x00, /* 000000110000 */
5900 0x03, 0x00, /* 000000110000 */
5901 0x03, 0x00, /* 000000110000 */
5902 0x03, 0x00, /* 000000110000 */
5903 0x03, 0x00, /* 000000110000 */
5904 0x03, 0x00, /* 000000110000 */
5905 0x03, 0x00, /* 000000110000 */
5906 0x03, 0x00, /* 000000110000 */
5907 0x03, 0x00, /* 000000110000 */
5908 0x03, 0x00, /* 000000110000 */
5909 0x03, 0x00, /* 000000110000 */
5961 5910
5962 /* 246 0xf6 '.' */ 5911 /* 246 0xf6 '.' */
5963 0x00, 0x00, /* 000000000000 */ 5912 0x00, 0x00, /* 000000000000 */
@@ -5984,24 +5933,23 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
5984 0x00, 0x00, /* 000000000000 */ 5933 0x00, 0x00, /* 000000000000 */
5985 5934
5986 /* 247 0xf7 '.' */ 5935 /* 247 0xf7 '.' */
5987 /* FIXME */
5988 0x00, 0x00, /* 000000000000 */ 5936 0x00, 0x00, /* 000000000000 */
5989 0x00, 0x00, /* 000000000000 */ 5937 0x00, 0x00, /* 000000000000 */
5990 0x00, 0x00, /* 000000000000 */ 5938 0x00, 0x00, /* 000000000000 */
5991 0x00, 0x00, /* 000000000000 */ 5939 0x00, 0x00, /* 000000000000 */
5992 0x00, 0x00, /* 000000000000 */ 5940 0x00, 0x00, /* 000000000000 */
5993 0x3f, 0xc0, /* 001111111100 */ 5941 0x00, 0x00, /* 000000000000 */
5994 0x3f, 0xc0, /* 001111111100 */ 5942 0x00, 0x00, /* 000000000000 */
5995 0x3f, 0xc0, /* 001111111100 */ 5943 0x38, 0x00, /* 001110000000 */
5996 0x3f, 0xc0, /* 001111111100 */ 5944 0x6c, 0x00, /* 011011000000 */
5997 0x3f, 0xc0, /* 001111111100 */ 5945 0x06, 0x30, /* 000001100011 */
5998 0x3f, 0xc0, /* 001111111100 */ 5946 0x03, 0x60, /* 000000110110 */
5999 0x3f, 0xc0, /* 001111111100 */ 5947 0x39, 0xc0, /* 001110011100 */
6000 0x3f, 0xc0, /* 001111111100 */ 5948 0x6c, 0x00, /* 011011000000 */
6001 0x3f, 0xc0, /* 001111111100 */ 5949 0x06, 0x30, /* 000001100011 */
6002 0x3f, 0xc0, /* 001111111100 */ 5950 0x03, 0x60, /* 000000110110 */
6003 0x3f, 0xc0, /* 001111111100 */ 5951 0x01, 0xc0, /* 000000011100 */
6004 0x3f, 0xc0, /* 001111111100 */ 5952 0x00, 0x00, /* 000000000000 */
6005 0x00, 0x00, /* 000000000000 */ 5953 0x00, 0x00, /* 000000000000 */
6006 0x00, 0x00, /* 000000000000 */ 5954 0x00, 0x00, /* 000000000000 */
6007 0x00, 0x00, /* 000000000000 */ 5955 0x00, 0x00, /* 000000000000 */
@@ -6033,44 +5981,31 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
6033 0x00, 0x00, /* 000000000000 */ 5981 0x00, 0x00, /* 000000000000 */
6034 5982
6035 /* 249 0xf9 '.' */ 5983 /* 249 0xf9 '.' */
6036 /* FIXME */
6037 0x00, 0x00, /* 000000000000 */ 5984 0x00, 0x00, /* 000000000000 */
6038 0x00, 0x00, /* 000000000000 */ 5985 0x00, 0x00, /* 000000000000 */
6039 0x00, 0x00, /* 000000000000 */ 5986 0x00, 0x00, /* 000000000000 */
6040 0x00, 0x00, /* 000000000000 */ 5987 0x00, 0x00, /* 000000000000 */
6041 0x00, 0x00, /* 000000000000 */ 5988 0x00, 0x00, /* 000000000000 */
6042 0x3f, 0xc0, /* 001111111100 */
6043 0x3f, 0xc0, /* 001111111100 */
6044 0x3f, 0xc0, /* 001111111100 */
6045 0x3f, 0xc0, /* 001111111100 */
6046 0x3f, 0xc0, /* 001111111100 */
6047 0x3f, 0xc0, /* 001111111100 */
6048 0x3f, 0xc0, /* 001111111100 */
6049 0x3f, 0xc0, /* 001111111100 */
6050 0x3f, 0xc0, /* 001111111100 */
6051 0x3f, 0xc0, /* 001111111100 */
6052 0x3f, 0xc0, /* 001111111100 */
6053 0x3f, 0xc0, /* 001111111100 */
6054 0x00, 0x00, /* 000000000000 */ 5989 0x00, 0x00, /* 000000000000 */
6055 0x00, 0x00, /* 000000000000 */ 5990 0x00, 0x00, /* 000000000000 */
6056 0x00, 0x00, /* 000000000000 */ 5991 0x00, 0x00, /* 000000000000 */
6057 0x00, 0x00, /* 000000000000 */ 5992 0x00, 0x00, /* 000000000000 */
6058 0x00, 0x00, /* 000000000000 */ 5993 0x00, 0x00, /* 000000000000 */
6059
6060 /* 250 0xfa '.' */
6061 0x00, 0x00, /* 000000000000 */
6062 0x00, 0x00, /* 000000000000 */ 5994 0x00, 0x00, /* 000000000000 */
5995 0x1c, 0x00, /* 000111000000 */
5996 0x3e, 0x00, /* 001111100000 */
5997 0x3e, 0x00, /* 001111100000 */
5998 0x3e, 0x00, /* 001111100000 */
5999 0x1c, 0x00, /* 000111000000 */
6063 0x00, 0x00, /* 000000000000 */ 6000 0x00, 0x00, /* 000000000000 */
6064 0x00, 0x00, /* 000000000000 */ 6001 0x00, 0x00, /* 000000000000 */
6065 0x00, 0x00, /* 000000000000 */ 6002 0x00, 0x00, /* 000000000000 */
6066 0x00, 0x00, /* 000000000000 */ 6003 0x00, 0x00, /* 000000000000 */
6067 0x00, 0x00, /* 000000000000 */ 6004 0x00, 0x00, /* 000000000000 */
6068 0x00, 0x00, /* 000000000000 */ 6005 0x00, 0x00, /* 000000000000 */
6006
6007 /* 250 0xfa '.' */
6069 0x00, 0x00, /* 000000000000 */ 6008 0x00, 0x00, /* 000000000000 */
6070 0x06, 0x00, /* 000001100000 */
6071 0x0f, 0x00, /* 000011110000 */
6072 0x0f, 0x00, /* 000011110000 */
6073 0x06, 0x00, /* 000001100000 */
6074 0x00, 0x00, /* 000000000000 */ 6009 0x00, 0x00, /* 000000000000 */
6075 0x00, 0x00, /* 000000000000 */ 6010 0x00, 0x00, /* 000000000000 */
6076 0x00, 0x00, /* 000000000000 */ 6011 0x00, 0x00, /* 000000000000 */
@@ -6080,51 +6015,61 @@ static unsigned char fontdata_sun12x22[FONTDATAMAX] = {
6080 0x00, 0x00, /* 000000000000 */ 6015 0x00, 0x00, /* 000000000000 */
6081 0x00, 0x00, /* 000000000000 */ 6016 0x00, 0x00, /* 000000000000 */
6082 0x00, 0x00, /* 000000000000 */ 6017 0x00, 0x00, /* 000000000000 */
6083
6084 /* 251 0xfb '.' */
6085 /* FIXME */
6086 0x00, 0x00, /* 000000000000 */ 6018 0x00, 0x00, /* 000000000000 */
6087 0x00, 0x00, /* 000000000000 */ 6019 0x00, 0x00, /* 000000000000 */
6020 0x18, 0x00, /* 000110000000 */
6021 0x3c, 0x00, /* 001111000000 */
6022 0x3c, 0x00, /* 001111000000 */
6023 0x18, 0x00, /* 000110000000 */
6088 0x00, 0x00, /* 000000000000 */ 6024 0x00, 0x00, /* 000000000000 */
6089 0x00, 0x00, /* 000000000000 */ 6025 0x00, 0x00, /* 000000000000 */
6090 0x00, 0x00, /* 000000000000 */ 6026 0x00, 0x00, /* 000000000000 */
6091 0x3f, 0xc0, /* 001111111100 */
6092 0x3f, 0xc0, /* 001111111100 */
6093 0x3f, 0xc0, /* 001111111100 */
6094 0x3f, 0xc0, /* 001111111100 */
6095 0x3f, 0xc0, /* 001111111100 */
6096 0x3f, 0xc0, /* 001111111100 */
6097 0x3f, 0xc0, /* 001111111100 */
6098 0x3f, 0xc0, /* 001111111100 */
6099 0x3f, 0xc0, /* 001111111100 */
6100 0x3f, 0xc0, /* 001111111100 */
6101 0x3f, 0xc0, /* 001111111100 */
6102 0x3f, 0xc0, /* 001111111100 */
6103 0x00, 0x00, /* 000000000000 */ 6027 0x00, 0x00, /* 000000000000 */
6104 0x00, 0x00, /* 000000000000 */ 6028 0x00, 0x00, /* 000000000000 */
6105 0x00, 0x00, /* 000000000000 */ 6029 0x00, 0x00, /* 000000000000 */
6030
6031 /* 251 0xfb '.' */
6106 0x00, 0x00, /* 000000000000 */ 6032 0x00, 0x00, /* 000000000000 */
6033 0x07, 0xe0, /* 000001111110 */
6034 0x06, 0x00, /* 000001100000 */
6035 0x06, 0x00, /* 000001100000 */
6036 0x06, 0x00, /* 000001100000 */
6037 0x06, 0x00, /* 000001100000 */
6038 0x06, 0x00, /* 000001100000 */
6039 0x06, 0x00, /* 000001100000 */
6040 0x06, 0x00, /* 000001100000 */
6041 0x06, 0x00, /* 000001100000 */
6042 0x06, 0x00, /* 000001100000 */
6043 0x06, 0x00, /* 000001100000 */
6044 0x06, 0x00, /* 000001100000 */
6045 0x06, 0x00, /* 000001100000 */
6046 0xc6, 0x00, /* 110001100000 */
6047 0x66, 0x00, /* 011001100000 */
6048 0x36, 0x00, /* 001101100000 */
6049 0x1e, 0x00, /* 000111100000 */
6050 0x0e, 0x00, /* 000011100000 */
6051 0x06, 0x00, /* 000001100000 */
6052 0x02, 0x00, /* 000000100000 */
6107 0x00, 0x00, /* 000000000000 */ 6053 0x00, 0x00, /* 000000000000 */
6108 6054
6109 /* 252 0xfc '.' */ 6055 /* 252 0xfc '.' */
6110 /* FIXME */ 6056 0x00, 0x00, /* 000000000000 */
6057 0x00, 0x00, /* 000000000000 */
6058 0x13, 0x80, /* 000100111000 */
6059 0x3d, 0xc0, /* 001111011100 */
6060 0x18, 0xc0, /* 000110001100 */
6061 0x18, 0xc0, /* 000110001100 */
6062 0x18, 0xc0, /* 000110001100 */
6063 0x18, 0xc0, /* 000110001100 */
6064 0x3d, 0xe0, /* 001111011110 */
6065 0x00, 0x00, /* 000000000000 */
6066 0x00, 0x00, /* 000000000000 */
6067 0x00, 0x00, /* 000000000000 */
6111 0x00, 0x00, /* 000000000000 */ 6068 0x00, 0x00, /* 000000000000 */
6112 0x00, 0x00, /* 000000000000 */ 6069 0x00, 0x00, /* 000000000000 */
6113 0x00, 0x00, /* 000000000000 */ 6070 0x00, 0x00, /* 000000000000 */
6114 0x00, 0x00, /* 000000000000 */ 6071 0x00, 0x00, /* 000000000000 */
6115 0x00, 0x00, /* 000000000000 */ 6072 0x00, 0x00, /* 000000000000 */
6116 0x3f, 0xc0, /* 001111111100 */
6117 0x3f, 0xc0, /* 001111111100 */
6118 0x3f, 0xc0, /* 001111111100 */
6119 0x3f, 0xc0, /* 001111111100 */
6120 0x3f, 0xc0, /* 001111111100 */
6121 0x3f, 0xc0, /* 001111111100 */
6122 0x3f, 0xc0, /* 001111111100 */
6123 0x3f, 0xc0, /* 001111111100 */
6124 0x3f, 0xc0, /* 001111111100 */
6125 0x3f, 0xc0, /* 001111111100 */
6126 0x3f, 0xc0, /* 001111111100 */
6127 0x3f, 0xc0, /* 001111111100 */
6128 0x00, 0x00, /* 000000000000 */ 6073 0x00, 0x00, /* 000000000000 */
6129 0x00, 0x00, /* 000000000000 */ 6074 0x00, 0x00, /* 000000000000 */
6130 0x00, 0x00, /* 000000000000 */ 6075 0x00, 0x00, /* 000000000000 */
diff --git a/drivers/video/console/fonts.c b/drivers/video/console/fonts.c
index 465d678230ae..e79b29702649 100644
--- a/drivers/video/console/fonts.c
+++ b/drivers/video/console/fonts.c
@@ -36,6 +36,10 @@ static struct font_desc *fonts[] = {
36#undef NO_FONTS 36#undef NO_FONTS
37 &font_vga_6x11, 37 &font_vga_6x11,
38#endif 38#endif
39#ifdef CONFIG_FONT_7x14
40#undef NO_FONTS
41 &font_7x14,
42#endif
39#ifdef CONFIG_FONT_SUN8x16 43#ifdef CONFIG_FONT_SUN8x16
40#undef NO_FONTS 44#undef NO_FONTS
41 &font_sun_8x16, 45 &font_sun_8x16,
@@ -44,6 +48,10 @@ static struct font_desc *fonts[] = {
44#undef NO_FONTS 48#undef NO_FONTS
45 &font_sun_12x22, 49 &font_sun_12x22,
46#endif 50#endif
51#ifdef CONFIG_FONT_10x18
52#undef NO_FONTS
53 &font_10x18,
54#endif
47#ifdef CONFIG_FONT_ACORN_8x8 55#ifdef CONFIG_FONT_ACORN_8x8
48#undef NO_FONTS 56#undef NO_FONTS
49 &font_acorn_8x8, 57 &font_acorn_8x8,
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index bcf59b28a14f..d27fa91e5886 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -95,6 +95,7 @@ static unsigned long vgacon_uni_pagedir[2];
95/* Description of the hardware situation */ 95/* Description of the hardware situation */
96static unsigned long vga_vram_base; /* Base of video memory */ 96static unsigned long vga_vram_base; /* Base of video memory */
97static unsigned long vga_vram_end; /* End of video memory */ 97static unsigned long vga_vram_end; /* End of video memory */
98static int vga_vram_size; /* Size of video memory */
98static u16 vga_video_port_reg; /* Video register select port */ 99static u16 vga_video_port_reg; /* Video register select port */
99static u16 vga_video_port_val; /* Video register value port */ 100static u16 vga_video_port_val; /* Video register value port */
100static unsigned int vga_video_num_columns; /* Number of text columns */ 101static unsigned int vga_video_num_columns; /* Number of text columns */
@@ -288,6 +289,7 @@ static const char __init *vgacon_startup(void)
288 289
289 vga_vram_base = VGA_MAP_MEM(vga_vram_base); 290 vga_vram_base = VGA_MAP_MEM(vga_vram_base);
290 vga_vram_end = VGA_MAP_MEM(vga_vram_end); 291 vga_vram_end = VGA_MAP_MEM(vga_vram_end);
292 vga_vram_size = vga_vram_end - vga_vram_base;
291 293
292 /* 294 /*
293 * Find out if there is a graphics card present. 295 * Find out if there is a graphics card present.
@@ -504,9 +506,13 @@ static int vgacon_switch(struct vc_data *c)
504 */ 506 */
505 vga_video_num_columns = c->vc_cols; 507 vga_video_num_columns = c->vc_cols;
506 vga_video_num_lines = c->vc_rows; 508 vga_video_num_lines = c->vc_rows;
509
510 /* We can only copy out the size of the video buffer here,
511 * otherwise we get into VGA BIOS */
512
507 if (!vga_is_gfx) 513 if (!vga_is_gfx)
508 scr_memcpyw((u16 *) c->vc_origin, (u16 *) c->vc_screenbuf, 514 scr_memcpyw((u16 *) c->vc_origin, (u16 *) c->vc_screenbuf,
509 c->vc_screenbuf_size); 515 c->vc_screenbuf_size > vga_vram_size ? vga_vram_size : c->vc_screenbuf_size);
510 return 0; /* Redrawing not needed */ 516 return 0; /* Redrawing not needed */
511} 517}
512 518
@@ -961,7 +967,6 @@ static int vgacon_scrolldelta(struct vc_data *c, int lines)
961 if (!lines) /* Turn scrollback off */ 967 if (!lines) /* Turn scrollback off */
962 c->vc_visible_origin = c->vc_origin; 968 c->vc_visible_origin = c->vc_origin;
963 else { 969 else {
964 int vram_size = vga_vram_end - vga_vram_base;
965 int margin = c->vc_size_row * 4; 970 int margin = c->vc_size_row * 4;
966 int ul, we, p, st; 971 int ul, we, p, st;
967 972
@@ -971,7 +976,7 @@ static int vgacon_scrolldelta(struct vc_data *c, int lines)
971 we = vga_rolled_over + c->vc_size_row; 976 we = vga_rolled_over + c->vc_size_row;
972 } else { 977 } else {
973 ul = 0; 978 ul = 0;
974 we = vram_size; 979 we = vga_vram_size;
975 } 980 }
976 p = (c->vc_visible_origin - vga_vram_base - ul + we) % we + 981 p = (c->vc_visible_origin - vga_vram_base - ul + we) % we +
977 lines * c->vc_size_row; 982 lines * c->vc_size_row;
@@ -1012,9 +1017,13 @@ static void vgacon_save_screen(struct vc_data *c)
1012 c->vc_x = ORIG_X; 1017 c->vc_x = ORIG_X;
1013 c->vc_y = ORIG_Y; 1018 c->vc_y = ORIG_Y;
1014 } 1019 }
1020
1021 /* We can't copy in more then the size of the video buffer,
1022 * or we'll be copying in VGA BIOS */
1023
1015 if (!vga_is_gfx) 1024 if (!vga_is_gfx)
1016 scr_memcpyw((u16 *) c->vc_screenbuf, (u16 *) c->vc_origin, 1025 scr_memcpyw((u16 *) c->vc_screenbuf, (u16 *) c->vc_origin,
1017 c->vc_screenbuf_size); 1026 c->vc_screenbuf_size > vga_vram_size ? vga_vram_size : c->vc_screenbuf_size);
1018} 1027}
1019 1028
1020static int vgacon_scroll(struct vc_data *c, int t, int b, int dir, 1029static int vgacon_scroll(struct vc_data *c, int t, int b, int dir,
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 7705070191d9..2222de6ad844 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -76,70 +76,22 @@ int fb_get_color_depth(struct fb_var_screeninfo *var)
76EXPORT_SYMBOL(fb_get_color_depth); 76EXPORT_SYMBOL(fb_get_color_depth);
77 77
78/* 78/*
79 * Drawing helpers. 79 * Data padding functions.
80 */ 80 */
81void fb_iomove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf, 81void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height)
82 u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch,
83 u32 height)
84{ 82{
85 int i; 83 int i;
86 84
87 for (i = height; i--; ) { 85 for (i = height; i--; ) {
88 buf->outbuf(info, dst, src, s_pitch); 86 memcpy(dst, src, s_pitch);
89 src += s_pitch; 87 src += s_pitch;
90 dst += d_pitch; 88 dst += d_pitch;
91 } 89 }
92} 90}
91EXPORT_SYMBOL(fb_pad_aligned_buffer);
93 92
94void fb_sysmove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf, 93void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx, u32 height,
95 u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, 94 u32 shift_high, u32 shift_low, u32 mod)
96 u32 height)
97{
98 int i, j;
99
100 for (i = height; i--; ) {
101 for (j = 0; j < s_pitch; j++)
102 dst[j] = src[j];
103 src += s_pitch;
104 dst += d_pitch;
105 }
106}
107
108void fb_iomove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf,
109 u8 *dst, u32 d_pitch, u8 *src, u32 idx,
110 u32 height, u32 shift_high, u32 shift_low,
111 u32 mod)
112{
113 u8 mask = (u8) (0xfff << shift_high), tmp;
114 int i, j;
115
116 for (i = height; i--; ) {
117 for (j = 0; j < idx; j++) {
118 tmp = buf->inbuf(info, dst+j);
119 tmp &= mask;
120 tmp |= *src >> shift_low;
121 buf->outbuf(info, dst+j, &tmp, 1);
122 tmp = *src << shift_high;
123 buf->outbuf(info, dst+j+1, &tmp, 1);
124 src++;
125 }
126 tmp = buf->inbuf(info, dst+idx);
127 tmp &= mask;
128 tmp |= *src >> shift_low;
129 buf->outbuf(info, dst+idx, &tmp, 1);
130 if (shift_high < mod) {
131 tmp = *src << shift_high;
132 buf->outbuf(info, dst+idx+1, &tmp, 1);
133 }
134 src++;
135 dst += d_pitch;
136 }
137}
138
139void fb_sysmove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf,
140 u8 *dst, u32 d_pitch, u8 *src, u32 idx,
141 u32 height, u32 shift_high, u32 shift_low,
142 u32 mod)
143{ 95{
144 u8 mask = (u8) (0xfff << shift_high), tmp; 96 u8 mask = (u8) (0xfff << shift_high), tmp;
145 int i, j; 97 int i, j;
@@ -166,6 +118,7 @@ void fb_sysmove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf,
166 dst += d_pitch; 118 dst += d_pitch;
167 } 119 }
168} 120}
121EXPORT_SYMBOL(fb_pad_unaligned_buffer);
169 122
170/* 123/*
171 * we need to lock this section since fb_cursor 124 * we need to lock this section since fb_cursor
@@ -1040,7 +993,7 @@ static struct file_operations fb_fops = {
1040#endif 993#endif
1041}; 994};
1042 995
1043static struct class_simple *fb_class; 996static struct class *fb_class;
1044 997
1045/** 998/**
1046 * register_framebuffer - registers a frame buffer device 999 * register_framebuffer - registers a frame buffer device
@@ -1066,7 +1019,7 @@ register_framebuffer(struct fb_info *fb_info)
1066 break; 1019 break;
1067 fb_info->node = i; 1020 fb_info->node = i;
1068 1021
1069 fb_info->class_device = class_simple_device_add(fb_class, MKDEV(FB_MAJOR, i), 1022 fb_info->class_device = class_device_create(fb_class, MKDEV(FB_MAJOR, i),
1070 fb_info->device, "fb%d", i); 1023 fb_info->device, "fb%d", i);
1071 if (IS_ERR(fb_info->class_device)) { 1024 if (IS_ERR(fb_info->class_device)) {
1072 /* Not fatal */ 1025 /* Not fatal */
@@ -1081,7 +1034,7 @@ register_framebuffer(struct fb_info *fb_info)
1081 fb_info->pixmap.size = FBPIXMAPSIZE; 1034 fb_info->pixmap.size = FBPIXMAPSIZE;
1082 fb_info->pixmap.buf_align = 1; 1035 fb_info->pixmap.buf_align = 1;
1083 fb_info->pixmap.scan_align = 1; 1036 fb_info->pixmap.scan_align = 1;
1084 fb_info->pixmap.access_align = 4; 1037 fb_info->pixmap.access_align = 32;
1085 fb_info->pixmap.flags = FB_PIXMAP_DEFAULT; 1038 fb_info->pixmap.flags = FB_PIXMAP_DEFAULT;
1086 } 1039 }
1087 } 1040 }
@@ -1134,7 +1087,7 @@ unregister_framebuffer(struct fb_info *fb_info)
1134 registered_fb[i]=NULL; 1087 registered_fb[i]=NULL;
1135 num_registered_fb--; 1088 num_registered_fb--;
1136 fb_cleanup_class_device(fb_info); 1089 fb_cleanup_class_device(fb_info);
1137 class_simple_device_remove(MKDEV(FB_MAJOR, i)); 1090 class_device_destroy(fb_class, MKDEV(FB_MAJOR, i));
1138 return 0; 1091 return 0;
1139} 1092}
1140 1093
@@ -1197,7 +1150,7 @@ fbmem_init(void)
1197 if (register_chrdev(FB_MAJOR,"fb",&fb_fops)) 1150 if (register_chrdev(FB_MAJOR,"fb",&fb_fops))
1198 printk("unable to get major %d for fb devs\n", FB_MAJOR); 1151 printk("unable to get major %d for fb devs\n", FB_MAJOR);
1199 1152
1200 fb_class = class_simple_create(THIS_MODULE, "graphics"); 1153 fb_class = class_create(THIS_MODULE, "graphics");
1201 if (IS_ERR(fb_class)) { 1154 if (IS_ERR(fb_class)) {
1202 printk(KERN_WARNING "Unable to create fb class; errno = %ld\n", PTR_ERR(fb_class)); 1155 printk(KERN_WARNING "Unable to create fb class; errno = %ld\n", PTR_ERR(fb_class));
1203 fb_class = NULL; 1156 fb_class = NULL;
@@ -1210,7 +1163,7 @@ module_init(fbmem_init);
1210static void __exit 1163static void __exit
1211fbmem_exit(void) 1164fbmem_exit(void)
1212{ 1165{
1213 class_simple_destroy(fb_class); 1166 class_destroy(fb_class);
1214} 1167}
1215 1168
1216module_exit(fbmem_exit); 1169module_exit(fbmem_exit);
@@ -1357,10 +1310,6 @@ EXPORT_SYMBOL(fb_set_var);
1357EXPORT_SYMBOL(fb_blank); 1310EXPORT_SYMBOL(fb_blank);
1358EXPORT_SYMBOL(fb_pan_display); 1311EXPORT_SYMBOL(fb_pan_display);
1359EXPORT_SYMBOL(fb_get_buffer_offset); 1312EXPORT_SYMBOL(fb_get_buffer_offset);
1360EXPORT_SYMBOL(fb_iomove_buf_unaligned);
1361EXPORT_SYMBOL(fb_iomove_buf_aligned);
1362EXPORT_SYMBOL(fb_sysmove_buf_unaligned);
1363EXPORT_SYMBOL(fb_sysmove_buf_aligned);
1364EXPORT_SYMBOL(fb_set_suspend); 1313EXPORT_SYMBOL(fb_set_suspend);
1365EXPORT_SYMBOL(fb_register_client); 1314EXPORT_SYMBOL(fb_register_client);
1366EXPORT_SYMBOL(fb_unregister_client); 1315EXPORT_SYMBOL(fb_unregister_client);
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c
index c78a2c5961d3..277d733c6d00 100644
--- a/drivers/video/fbsysfs.c
+++ b/drivers/video/fbsysfs.c
@@ -241,7 +241,7 @@ static ssize_t show_virtual(struct class_device *class_device, char *buf)
241 struct fb_info *fb_info = 241 struct fb_info *fb_info =
242 (struct fb_info *)class_get_devdata(class_device); 242 (struct fb_info *)class_get_devdata(class_device);
243 return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xres_virtual, 243 return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xres_virtual,
244 fb_info->var.xres_virtual); 244 fb_info->var.yres_virtual);
245} 245}
246 246
247static ssize_t store_cmap(struct class_device *class_device, const char * buf, 247static ssize_t store_cmap(struct class_device *class_device, const char * buf,
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index 2a023282d7a3..d3c1922cb13a 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -1045,14 +1045,14 @@ static struct fb_ops gbefb_ops = {
1045 * sysfs 1045 * sysfs
1046 */ 1046 */
1047 1047
1048static ssize_t gbefb_show_memsize(struct device *dev, char *buf) 1048static ssize_t gbefb_show_memsize(struct device *dev, struct device_attribute *attr, char *buf)
1049{ 1049{
1050 return snprintf(buf, PAGE_SIZE, "%d\n", gbe_mem_size); 1050 return snprintf(buf, PAGE_SIZE, "%d\n", gbe_mem_size);
1051} 1051}
1052 1052
1053static DEVICE_ATTR(size, S_IRUGO, gbefb_show_memsize, NULL); 1053static DEVICE_ATTR(size, S_IRUGO, gbefb_show_memsize, NULL);
1054 1054
1055static ssize_t gbefb_show_rev(struct device *device, char *buf) 1055static ssize_t gbefb_show_rev(struct device *device, struct device_attribute *attr, char *buf)
1056{ 1056{
1057 return snprintf(buf, PAGE_SIZE, "%d\n", gbe_revision); 1057 return snprintf(buf, PAGE_SIZE, "%d\n", gbe_revision);
1058} 1058}
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index a9a618f2aa6a..7513fb9b19cf 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -1885,6 +1885,7 @@ static int __devinit i810fb_init_pci (struct pci_dev *dev,
1885 memset(info->pixmap.addr, 0, 8*1024); 1885 memset(info->pixmap.addr, 0, 8*1024);
1886 info->pixmap.size = 8*1024; 1886 info->pixmap.size = 8*1024;
1887 info->pixmap.buf_align = 8; 1887 info->pixmap.buf_align = 8;
1888 info->pixmap.access_align = 32;
1888 info->pixmap.flags = FB_PIXMAP_SYSTEM; 1889 info->pixmap.flags = FB_PIXMAP_SYSTEM;
1889 1890
1890 if ((err = i810_allocate_pci_resource(par, entry))) { 1891 if ((err = i810_allocate_pci_resource(par, entry))) {
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 549e22939260..298bc9cd99e7 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -214,7 +214,7 @@ static struct fb_ops intel_fb_ops = {
214 214
215/* PCI driver module table */ 215/* PCI driver module table */
216static struct pci_driver intelfb_driver = { 216static struct pci_driver intelfb_driver = {
217 .name = "Intel(R) " SUPPORTED_CHIPSETS " Framebuffer Driver", 217 .name = "intelfb",
218 .id_table = intelfb_pci_table, 218 .id_table = intelfb_pci_table,
219 .probe = intelfb_pci_register, 219 .probe = intelfb_pci_register,
220 .remove = __devexit_p(intelfb_pci_unregister) 220 .remove = __devexit_p(intelfb_pci_unregister)
@@ -228,22 +228,25 @@ MODULE_DESCRIPTION(
228MODULE_LICENSE("Dual BSD/GPL"); 228MODULE_LICENSE("Dual BSD/GPL");
229MODULE_DEVICE_TABLE(pci, intelfb_pci_table); 229MODULE_DEVICE_TABLE(pci, intelfb_pci_table);
230 230
231static int accel __initdata = 1; 231static int accel = 1;
232static int vram __initdata = 4; 232static int vram = 4;
233static int hwcursor __initdata = 1; 233static int hwcursor = 1;
234static int mtrr __initdata = 1; 234static int mtrr = 1;
235static int fixed __initdata = 0; 235static int fixed = 0;
236static int noinit __initdata = 0; 236static int noinit = 0;
237static int noregister __initdata = 0; 237static int noregister = 0;
238static int probeonly __initdata = 0; 238static int probeonly = 0;
239static int idonly __initdata = 0; 239static int idonly = 0;
240static int bailearly __initdata = 0; 240static int bailearly = 0;
241static char *mode __initdata = NULL; 241static int voffset = 48;
242static char *mode = NULL;
242 243
243module_param(accel, bool, S_IRUGO); 244module_param(accel, bool, S_IRUGO);
244MODULE_PARM_DESC(accel, "Enable console acceleration"); 245MODULE_PARM_DESC(accel, "Enable console acceleration");
245module_param(vram, int, S_IRUGO); 246module_param(vram, int, S_IRUGO);
246MODULE_PARM_DESC(vram, "System RAM to allocate to framebuffer in MiB"); 247MODULE_PARM_DESC(vram, "System RAM to allocate to framebuffer in MiB");
248module_param(voffset, int, S_IRUGO);
249MODULE_PARM_DESC(voffset, "Offset of framebuffer in MiB");
247module_param(hwcursor, bool, S_IRUGO); 250module_param(hwcursor, bool, S_IRUGO);
248MODULE_PARM_DESC(hwcursor, "Enable HW cursor"); 251MODULE_PARM_DESC(hwcursor, "Enable HW cursor");
249module_param(mtrr, bool, S_IRUGO); 252module_param(mtrr, bool, S_IRUGO);
@@ -503,6 +506,7 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
503 struct agp_bridge_data *bridge; 506 struct agp_bridge_data *bridge;
504 int aperture_bar = 0; 507 int aperture_bar = 0;
505 int mmio_bar = 1; 508 int mmio_bar = 1;
509 int offset;
506 510
507 DBG_MSG("intelfb_pci_register\n"); 511 DBG_MSG("intelfb_pci_register\n");
508 512
@@ -659,17 +663,21 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
659 return -ENODEV; 663 return -ENODEV;
660 } 664 }
661 665
666 if (MB(voffset) < stolen_size)
667 offset = (stolen_size >> 12);
668 else
669 offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE;
670
662 /* set the mem offsets - set them after the already used pages */ 671 /* set the mem offsets - set them after the already used pages */
663 if (dinfo->accel) { 672 if (dinfo->accel) {
664 dinfo->ring.offset = (stolen_size >> 12) 673 dinfo->ring.offset = offset + gtt_info.current_memory;
665 + gtt_info.current_memory;
666 } 674 }
667 if (dinfo->hwcursor) { 675 if (dinfo->hwcursor) {
668 dinfo->cursor.offset = (stolen_size >> 12) + 676 dinfo->cursor.offset = offset +
669 + gtt_info.current_memory + (dinfo->ring.size >> 12); 677 + gtt_info.current_memory + (dinfo->ring.size >> 12);
670 } 678 }
671 if (dinfo->fbmem_gart) { 679 if (dinfo->fbmem_gart) {
672 dinfo->fb.offset = (stolen_size >> 12) + 680 dinfo->fb.offset = offset +
673 + gtt_info.current_memory + (dinfo->ring.size >> 12) 681 + gtt_info.current_memory + (dinfo->ring.size >> 12)
674 + (dinfo->cursor.size >> 12); 682 + (dinfo->cursor.size >> 12);
675 } 683 }
@@ -1083,6 +1091,7 @@ intelfb_set_fbinfo(struct intelfb_info *dinfo)
1083 1091
1084 info->pixmap.size = 64*1024; 1092 info->pixmap.size = 64*1024;
1085 info->pixmap.buf_align = 8; 1093 info->pixmap.buf_align = 8;
1094 info->pixmap.access_align = 32;
1086 info->pixmap.flags = FB_PIXMAP_SYSTEM; 1095 info->pixmap.flags = FB_PIXMAP_SYSTEM;
1087 1096
1088 if (intelfb_init_var(dinfo)) 1097 if (intelfb_init_var(dinfo))
@@ -1293,7 +1302,7 @@ intelfb_set_par(struct fb_info *info)
1293 1302
1294 intelfb_blank(FB_BLANK_POWERDOWN, info); 1303 intelfb_blank(FB_BLANK_POWERDOWN, info);
1295 1304
1296 if (dinfo->accel) 1305 if (ACCEL(dinfo, info))
1297 intelfbhw_2d_stop(dinfo); 1306 intelfbhw_2d_stop(dinfo);
1298 1307
1299 memcpy(hw, &dinfo->save_state, sizeof(*hw)); 1308 memcpy(hw, &dinfo->save_state, sizeof(*hw));
@@ -1309,7 +1318,7 @@ intelfb_set_par(struct fb_info *info)
1309 1318
1310 update_dinfo(dinfo, &info->var); 1319 update_dinfo(dinfo, &info->var);
1311 1320
1312 if (dinfo->accel) 1321 if (ACCEL(dinfo, info))
1313 intelfbhw_2d_start(dinfo); 1322 intelfbhw_2d_start(dinfo);
1314 1323
1315 intelfb_pan_display(&info->var, info); 1324 intelfb_pan_display(&info->var, info);
diff --git a/drivers/video/macmodes.c b/drivers/video/macmodes.c
index de5a0f383600..2fc71081f7e7 100644
--- a/drivers/video/macmodes.c
+++ b/drivers/video/macmodes.c
@@ -387,3 +387,4 @@ int __init mac_find_mode(struct fb_var_screeninfo *var, struct fb_info *info,
387} 387}
388EXPORT_SYMBOL(mac_find_mode); 388EXPORT_SYMBOL(mac_find_mode);
389 389
390MODULE_LICENSE("GPL");
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c
index 47733f58153b..b2e6b2407869 100644
--- a/drivers/video/nvidia/nvidia.c
+++ b/drivers/video/nvidia/nvidia.c
@@ -516,9 +516,9 @@ static struct backlight_controller nvidia_backlight_controller = {
516static void nvidiafb_load_cursor_image(struct nvidia_par *par, u8 * data8, 516static void nvidiafb_load_cursor_image(struct nvidia_par *par, u8 * data8,
517 u16 bg, u16 fg, u32 w, u32 h) 517 u16 bg, u16 fg, u32 w, u32 h)
518{ 518{
519 u32 *data = (u32 *) data8;
519 int i, j, k = 0; 520 int i, j, k = 0;
520 u32 b, tmp; 521 u32 b, tmp;
521 u32 *data = (u32 *) data8;
522 522
523 w = (w + 1) & ~1; 523 w = (w + 1) & ~1;
524 524
@@ -890,11 +890,11 @@ static int nvidiafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
890{ 890{
891 struct nvidia_par *par = info->par; 891 struct nvidia_par *par = info->par;
892 u8 data[MAX_CURS * MAX_CURS / 8]; 892 u8 data[MAX_CURS * MAX_CURS / 8];
893 u16 fg, bg;
894 int i, set = cursor->set; 893 int i, set = cursor->set;
894 u16 fg, bg;
895 895
896 if (cursor->image.width > MAX_CURS || cursor->image.height > MAX_CURS) 896 if (cursor->image.width > MAX_CURS || cursor->image.height > MAX_CURS)
897 return soft_cursor(info, cursor); 897 return -ENXIO;
898 898
899 NVShowHideCursor(par, 0); 899 NVShowHideCursor(par, 0);
900 900
@@ -931,21 +931,18 @@ static int nvidiafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
931 if (src) { 931 if (src) {
932 switch (cursor->rop) { 932 switch (cursor->rop) {
933 case ROP_XOR: 933 case ROP_XOR:
934 for (i = 0; i < s_pitch * cursor->image.height; 934 for (i = 0; i < s_pitch * cursor->image.height; i++)
935 i++)
936 src[i] = dat[i] ^ msk[i]; 935 src[i] = dat[i] ^ msk[i];
937 break; 936 break;
938 case ROP_COPY: 937 case ROP_COPY:
939 default: 938 default:
940 for (i = 0; i < s_pitch * cursor->image.height; 939 for (i = 0; i < s_pitch * cursor->image.height; i++)
941 i++)
942 src[i] = dat[i] & msk[i]; 940 src[i] = dat[i] & msk[i];
943 break; 941 break;
944 } 942 }
945 943
946 fb_sysmove_buf_aligned(info, &info->pixmap, data, 944 fb_pad_aligned_buffer(data, d_pitch, src, s_pitch,
947 d_pitch, src, s_pitch, 945 cursor->image.height);
948 cursor->image.height);
949 946
950 bg = ((info->cmap.red[bg_idx] & 0xf8) << 7) | 947 bg = ((info->cmap.red[bg_idx] & 0xf8) << 7) |
951 ((info->cmap.green[bg_idx] & 0xf8) << 2) | 948 ((info->cmap.green[bg_idx] & 0xf8) << 2) |
@@ -1348,6 +1345,7 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info)
1348 1345
1349 info->pixmap.scan_align = 4; 1346 info->pixmap.scan_align = 4;
1350 info->pixmap.buf_align = 4; 1347 info->pixmap.buf_align = 4;
1348 info->pixmap.access_align = 32;
1351 info->pixmap.size = 8 * 1024; 1349 info->pixmap.size = 8 * 1024;
1352 info->pixmap.flags = FB_PIXMAP_SYSTEM; 1350 info->pixmap.flags = FB_PIXMAP_SYSTEM;
1353 1351
diff --git a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c
index 8e024aad1b57..e0dad948467b 100644
--- a/drivers/video/pm3fb.c
+++ b/drivers/video/pm3fb.c
@@ -5,7 +5,7 @@
5 * Based on code written by: 5 * Based on code written by:
6 * Sven Luther, <luther@dpt-info.u-strasbg.fr> 6 * Sven Luther, <luther@dpt-info.u-strasbg.fr>
7 * Alan Hourihane, <alanh@fairlite.demon.co.uk> 7 * Alan Hourihane, <alanh@fairlite.demon.co.uk>
8 * Russel King, <rmk@arm.linux.org.uk> 8 * Russell King, <rmk@arm.linux.org.uk>
9 * Based on linux/drivers/video/skeletonfb.c: 9 * Based on linux/drivers/video/skeletonfb.c:
10 * Copyright (C) 1997 Geert Uytterhoeven 10 * Copyright (C) 1997 Geert Uytterhoeven
11 * Based on linux/driver/video/pm2fb.c: 11 * Based on linux/driver/video/pm2fb.c:
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index b0c886de0404..6a9e183be41b 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -1582,12 +1582,11 @@ static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
1582{ 1582{
1583 struct riva_par *par = (struct riva_par *) info->par; 1583 struct riva_par *par = (struct riva_par *) info->par;
1584 u8 data[MAX_CURS * MAX_CURS/8]; 1584 u8 data[MAX_CURS * MAX_CURS/8];
1585 u16 fg, bg;
1586 int i, set = cursor->set; 1585 int i, set = cursor->set;
1586 u16 fg, bg;
1587 1587
1588 if (cursor->image.width > MAX_CURS || 1588 if (cursor->image.width > MAX_CURS || cursor->image.height > MAX_CURS)
1589 cursor->image.height > MAX_CURS) 1589 return -ENXIO;
1590 return soft_cursor(info, cursor);
1591 1590
1592 par->riva.ShowHideCursor(&par->riva, 0); 1591 par->riva.ShowHideCursor(&par->riva, 0);
1593 1592
@@ -1625,21 +1624,18 @@ static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
1625 if (src) { 1624 if (src) {
1626 switch (cursor->rop) { 1625 switch (cursor->rop) {
1627 case ROP_XOR: 1626 case ROP_XOR:
1628 for (i = 0; i < s_pitch * cursor->image.height; 1627 for (i = 0; i < s_pitch * cursor->image.height; i++)
1629 i++)
1630 src[i] = dat[i] ^ msk[i]; 1628 src[i] = dat[i] ^ msk[i];
1631 break; 1629 break;
1632 case ROP_COPY: 1630 case ROP_COPY:
1633 default: 1631 default:
1634 for (i = 0; i < s_pitch * cursor->image.height; 1632 for (i = 0; i < s_pitch * cursor->image.height; i++)
1635 i++)
1636 src[i] = dat[i] & msk[i]; 1633 src[i] = dat[i] & msk[i];
1637 break; 1634 break;
1638 } 1635 }
1639 1636
1640 fb_sysmove_buf_aligned(info, &info->pixmap, data, 1637 fb_pad_aligned_buffer(data, d_pitch, src, s_pitch,
1641 d_pitch, src, s_pitch, 1638 cursor->image.height);
1642 cursor->image.height);
1643 1639
1644 bg = ((info->cmap.red[bg_idx] & 0xf8) << 7) | 1640 bg = ((info->cmap.red[bg_idx] & 0xf8) << 7) |
1645 ((info->cmap.green[bg_idx] & 0xf8) << 2) | 1641 ((info->cmap.green[bg_idx] & 0xf8) << 2) |
@@ -1727,6 +1723,7 @@ static int __devinit riva_set_fbinfo(struct fb_info *info)
1727 1723
1728 info->pixmap.size = 8 * 1024; 1724 info->pixmap.size = 8 * 1024;
1729 info->pixmap.buf_align = 4; 1725 info->pixmap.buf_align = 4;
1726 info->pixmap.access_align = 32;
1730 info->pixmap.flags = FB_PIXMAP_SYSTEM; 1727 info->pixmap.flags = FB_PIXMAP_SYSTEM;
1731 info->var.yres_virtual = -1; 1728 info->var.yres_virtual = -1;
1732 NVTRACE_LEAVE(); 1729 NVTRACE_LEAVE();
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c
index b637c389e4f4..789de13f461f 100644
--- a/drivers/video/s1d13xxxfb.c
+++ b/drivers/video/s1d13xxxfb.c
@@ -493,7 +493,7 @@ s1d13xxxfb_fetch_hw_state(struct fb_info *info)
493} 493}
494 494
495 495
496static int __devexit 496static int
497s1d13xxxfb_remove(struct device *dev) 497s1d13xxxfb_remove(struct device *dev)
498{ 498{
499 struct fb_info *info = dev_get_drvdata(dev); 499 struct fb_info *info = dev_get_drvdata(dev);
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index 03d74e8ee067..8fadcdae6f42 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -1897,7 +1897,7 @@ static int __devinit savage_init_fb_info (struct fb_info *info,
1897 info->pixmap.size = 8*1024; 1897 info->pixmap.size = 8*1024;
1898 info->pixmap.scan_align = 4; 1898 info->pixmap.scan_align = 4;
1899 info->pixmap.buf_align = 4; 1899 info->pixmap.buf_align = 4;
1900 info->pixmap.access_align = 4; 1900 info->pixmap.access_align = 32;
1901 1901
1902 fb_alloc_cmap (&info->cmap, NR_PALETTE, 0); 1902 fb_alloc_cmap (&info->cmap, NR_PALETTE, 0);
1903 info->flags |= FBINFO_HWACCEL_COPYAREA | 1903 info->flags |= FBINFO_HWACCEL_COPYAREA |
diff --git a/drivers/video/softcursor.c b/drivers/video/softcursor.c
index 13a4511539a1..229c4bc35079 100644
--- a/drivers/video/softcursor.c
+++ b/drivers/video/softcursor.c
@@ -58,17 +58,10 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
58 } else 58 } else
59 memcpy(src, image->data, dsize); 59 memcpy(src, image->data, dsize);
60 60
61 if (info->pixmap.outbuf) 61 fb_pad_aligned_buffer(dst, d_pitch, src, s_pitch, image->height);
62 fb_iomove_buf_aligned(info, &info->pixmap, dst, d_pitch, src,
63 s_pitch, image->height);
64 else
65 fb_sysmove_buf_aligned(info, &info->pixmap, dst, d_pitch, src,
66 s_pitch, image->height);
67
68 image->data = dst; 62 image->data = dst;
69 info->fbops->fb_imageblit(info, image); 63 info->fbops->fb_imageblit(info, image);
70 kfree(src); 64 kfree(src);
71
72 return 0; 65 return 0;
73} 66}
74 67
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
index 3027841f9c24..f3069b01e248 100644
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -271,7 +271,7 @@ static int __init vesafb_probe(struct device *device)
271 271
272 if (!request_mem_region(vesafb_fix.smem_start, size_total, "vesafb")) { 272 if (!request_mem_region(vesafb_fix.smem_start, size_total, "vesafb")) {
273 printk(KERN_WARNING 273 printk(KERN_WARNING
274 "vesafb: abort, cannot reserve video memory at 0x%lx\n", 274 "vesafb: cannot reserve video memory at 0x%lx\n",
275 vesafb_fix.smem_start); 275 vesafb_fix.smem_start);
276 /* We cannot make this fatal. Sometimes this comes from magic 276 /* We cannot make this fatal. Sometimes this comes from magic
277 spaces our resource handlers simply don't know about */ 277 spaces our resource handlers simply don't know about */
@@ -279,13 +279,13 @@ static int __init vesafb_probe(struct device *device)
279 279
280 info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev); 280 info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev);
281 if (!info) { 281 if (!info) {
282 release_mem_region(vesafb_fix.smem_start, vesafb_fix.smem_len); 282 release_mem_region(vesafb_fix.smem_start, size_total);
283 return -ENOMEM; 283 return -ENOMEM;
284 } 284 }
285 info->pseudo_palette = info->par; 285 info->pseudo_palette = info->par;
286 info->par = NULL; 286 info->par = NULL;
287 287
288 info->screen_base = ioremap(vesafb_fix.smem_start, vesafb_fix.smem_len); 288 info->screen_base = ioremap(vesafb_fix.smem_start, vesafb_fix.smem_len);
289 if (!info->screen_base) { 289 if (!info->screen_base) {
290 printk(KERN_ERR 290 printk(KERN_ERR
291 "vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n", 291 "vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n",
@@ -386,7 +386,7 @@ static int __init vesafb_probe(struct device *device)
386 request_region(0x3c0, 32, "vesafb"); 386 request_region(0x3c0, 32, "vesafb");
387 387
388 if (mtrr) { 388 if (mtrr) {
389 int temp_size = size_total; 389 unsigned int temp_size = size_total;
390 /* Find the largest power-of-two */ 390 /* Find the largest power-of-two */
391 while (temp_size & (temp_size - 1)) 391 while (temp_size & (temp_size - 1))
392 temp_size &= (temp_size - 1); 392 temp_size &= (temp_size - 1);
diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
index 58cd2ad84afb..adcda697ea60 100644
--- a/drivers/video/w100fb.c
+++ b/drivers/video/w100fb.c
@@ -101,7 +101,7 @@ static void(*w100fb_ssp_send)(u8 adrs, u8 data);
101 * Sysfs functions 101 * Sysfs functions
102 */ 102 */
103 103
104static ssize_t rotation_show(struct device *dev, char *buf) 104static ssize_t rotation_show(struct device *dev, struct device_attribute *attr, char *buf)
105{ 105{
106 struct fb_info *info = dev_get_drvdata(dev); 106 struct fb_info *info = dev_get_drvdata(dev);
107 struct w100fb_par *par=info->par; 107 struct w100fb_par *par=info->par;
@@ -109,7 +109,7 @@ static ssize_t rotation_show(struct device *dev, char *buf)
109 return sprintf(buf, "%d\n",par->rotation_flag); 109 return sprintf(buf, "%d\n",par->rotation_flag);
110} 110}
111 111
112static ssize_t rotation_store(struct device *dev, const char *buf, size_t count) 112static ssize_t rotation_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
113{ 113{
114 unsigned int rotate; 114 unsigned int rotate;
115 struct fb_info *info = dev_get_drvdata(dev); 115 struct fb_info *info = dev_get_drvdata(dev);
@@ -134,7 +134,7 @@ static ssize_t rotation_store(struct device *dev, const char *buf, size_t count)
134 134
135static DEVICE_ATTR(rotation, 0644, rotation_show, rotation_store); 135static DEVICE_ATTR(rotation, 0644, rotation_show, rotation_store);
136 136
137static ssize_t w100fb_reg_read(struct device *dev, const char *buf, size_t count) 137static ssize_t w100fb_reg_read(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
138{ 138{
139 unsigned long param; 139 unsigned long param;
140 unsigned long regs; 140 unsigned long regs;
@@ -146,7 +146,7 @@ static ssize_t w100fb_reg_read(struct device *dev, const char *buf, size_t count
146 146
147static DEVICE_ATTR(reg_read, 0200, NULL, w100fb_reg_read); 147static DEVICE_ATTR(reg_read, 0200, NULL, w100fb_reg_read);
148 148
149static ssize_t w100fb_reg_write(struct device *dev, const char *buf, size_t count) 149static ssize_t w100fb_reg_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
150{ 150{
151 unsigned long regs; 151 unsigned long regs;
152 unsigned long param; 152 unsigned long param;
@@ -163,7 +163,7 @@ static ssize_t w100fb_reg_write(struct device *dev, const char *buf, size_t coun
163static DEVICE_ATTR(reg_write, 0200, NULL, w100fb_reg_write); 163static DEVICE_ATTR(reg_write, 0200, NULL, w100fb_reg_write);
164 164
165 165
166static ssize_t fastsysclk_show(struct device *dev, char *buf) 166static ssize_t fastsysclk_show(struct device *dev, struct device_attribute *attr, char *buf)
167{ 167{
168 struct fb_info *info = dev_get_drvdata(dev); 168 struct fb_info *info = dev_get_drvdata(dev);
169 struct w100fb_par *par=info->par; 169 struct w100fb_par *par=info->par;
@@ -171,7 +171,7 @@ static ssize_t fastsysclk_show(struct device *dev, char *buf)
171 return sprintf(buf, "%d\n",par->fastsysclk_mode); 171 return sprintf(buf, "%d\n",par->fastsysclk_mode);
172} 172}
173 173
174static ssize_t fastsysclk_store(struct device *dev, const char *buf, size_t count) 174static ssize_t fastsysclk_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
175{ 175{
176 int param; 176 int param;
177 struct fb_info *info = dev_get_drvdata(dev); 177 struct fb_info *info = dev_get_drvdata(dev);
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 8d7821899cc1..24a192e3b8b4 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -88,7 +88,7 @@ static void w1_slave_release(struct device *dev)
88 complete(&sl->dev_released); 88 complete(&sl->dev_released);
89} 89}
90 90
91static ssize_t w1_default_read_name(struct device *dev, char *buf) 91static ssize_t w1_default_read_name(struct device *dev, struct device_attribute *attr, char *buf)
92{ 92{
93 return sprintf(buf, "No family registered.\n"); 93 return sprintf(buf, "No family registered.\n");
94} 94}
@@ -137,7 +137,7 @@ static struct device_attribute w1_slave_attribute_val = {
137 .show = &w1_default_read_name, 137 .show = &w1_default_read_name,
138}; 138};
139 139
140static ssize_t w1_master_attribute_show_name(struct device *dev, char *buf) 140static ssize_t w1_master_attribute_show_name(struct device *dev, struct device_attribute *attr, char *buf)
141{ 141{
142 struct w1_master *md = container_of (dev, struct w1_master, dev); 142 struct w1_master *md = container_of (dev, struct w1_master, dev);
143 ssize_t count; 143 ssize_t count;
@@ -152,7 +152,7 @@ static ssize_t w1_master_attribute_show_name(struct device *dev, char *buf)
152 return count; 152 return count;
153} 153}
154 154
155static ssize_t w1_master_attribute_show_pointer(struct device *dev, char *buf) 155static ssize_t w1_master_attribute_show_pointer(struct device *dev, struct device_attribute *attr, char *buf)
156{ 156{
157 struct w1_master *md = container_of(dev, struct w1_master, dev); 157 struct w1_master *md = container_of(dev, struct w1_master, dev);
158 ssize_t count; 158 ssize_t count;
@@ -166,14 +166,14 @@ static ssize_t w1_master_attribute_show_pointer(struct device *dev, char *buf)
166 return count; 166 return count;
167} 167}
168 168
169static ssize_t w1_master_attribute_show_timeout(struct device *dev, char *buf) 169static ssize_t w1_master_attribute_show_timeout(struct device *dev, struct device_attribute *attr, char *buf)
170{ 170{
171 ssize_t count; 171 ssize_t count;
172 count = sprintf(buf, "%d\n", w1_timeout); 172 count = sprintf(buf, "%d\n", w1_timeout);
173 return count; 173 return count;
174} 174}
175 175
176static ssize_t w1_master_attribute_show_max_slave_count(struct device *dev, char *buf) 176static ssize_t w1_master_attribute_show_max_slave_count(struct device *dev, struct device_attribute *attr, char *buf)
177{ 177{
178 struct w1_master *md = container_of(dev, struct w1_master, dev); 178 struct w1_master *md = container_of(dev, struct w1_master, dev);
179 ssize_t count; 179 ssize_t count;
@@ -187,7 +187,7 @@ static ssize_t w1_master_attribute_show_max_slave_count(struct device *dev, char
187 return count; 187 return count;
188} 188}
189 189
190static ssize_t w1_master_attribute_show_attempts(struct device *dev, char *buf) 190static ssize_t w1_master_attribute_show_attempts(struct device *dev, struct device_attribute *attr, char *buf)
191{ 191{
192 struct w1_master *md = container_of(dev, struct w1_master, dev); 192 struct w1_master *md = container_of(dev, struct w1_master, dev);
193 ssize_t count; 193 ssize_t count;
@@ -201,7 +201,7 @@ static ssize_t w1_master_attribute_show_attempts(struct device *dev, char *buf)
201 return count; 201 return count;
202} 202}
203 203
204static ssize_t w1_master_attribute_show_slave_count(struct device *dev, char *buf) 204static ssize_t w1_master_attribute_show_slave_count(struct device *dev, struct device_attribute *attr, char *buf)
205{ 205{
206 struct w1_master *md = container_of(dev, struct w1_master, dev); 206 struct w1_master *md = container_of(dev, struct w1_master, dev);
207 ssize_t count; 207 ssize_t count;
@@ -215,7 +215,7 @@ static ssize_t w1_master_attribute_show_slave_count(struct device *dev, char *bu
215 return count; 215 return count;
216} 216}
217 217
218static ssize_t w1_master_attribute_show_slaves(struct device *dev, char *buf) 218static ssize_t w1_master_attribute_show_slaves(struct device *dev, struct device_attribute *attr, char *buf)
219 219
220{ 220{
221 struct w1_master *md = container_of(dev, struct w1_master, dev); 221 struct w1_master *md = container_of(dev, struct w1_master, dev);
diff --git a/drivers/w1/w1_family.h b/drivers/w1/w1_family.h
index 03a2de7a601f..07fa49412a90 100644
--- a/drivers/w1/w1_family.h
+++ b/drivers/w1/w1_family.h
@@ -34,10 +34,10 @@
34 34
35struct w1_family_ops 35struct w1_family_ops
36{ 36{
37 ssize_t (* rname)(struct device *, char *); 37 ssize_t (* rname)(struct device *, struct device_attribute *, char *);
38 ssize_t (* rbin)(struct kobject *, char *, loff_t, size_t); 38 ssize_t (* rbin)(struct kobject *, char *, loff_t, size_t);
39 39
40 ssize_t (* rval)(struct device *, char *); 40 ssize_t (* rval)(struct device *, struct device_attribute *, char *);
41 unsigned char rvalname[MAXNAMELEN]; 41 unsigned char rvalname[MAXNAMELEN];
42}; 42};
43 43
diff --git a/drivers/w1/w1_smem.c b/drivers/w1/w1_smem.c
index a54e425217a0..674eb75a9bad 100644
--- a/drivers/w1/w1_smem.c
+++ b/drivers/w1/w1_smem.c
@@ -36,8 +36,8 @@ MODULE_LICENSE("GPL");
36MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>"); 36MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>");
37MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, 64bit memory family."); 37MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, 64bit memory family.");
38 38
39static ssize_t w1_smem_read_name(struct device *, char *); 39static ssize_t w1_smem_read_name(struct device *, struct device_attribute *attr, char *);
40static ssize_t w1_smem_read_val(struct device *, char *); 40static ssize_t w1_smem_read_val(struct device *, struct device_attribute *attr, char *);
41static ssize_t w1_smem_read_bin(struct kobject *, char *, loff_t, size_t); 41static ssize_t w1_smem_read_bin(struct kobject *, char *, loff_t, size_t);
42 42
43static struct w1_family_ops w1_smem_fops = { 43static struct w1_family_ops w1_smem_fops = {
@@ -47,14 +47,14 @@ static struct w1_family_ops w1_smem_fops = {
47 .rvalname = "id", 47 .rvalname = "id",
48}; 48};
49 49
50static ssize_t w1_smem_read_name(struct device *dev, char *buf) 50static ssize_t w1_smem_read_name(struct device *dev, struct device_attribute *attr, char *buf)
51{ 51{
52 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); 52 struct w1_slave *sl = container_of(dev, struct w1_slave, dev);
53 53
54 return sprintf(buf, "%s\n", sl->name); 54 return sprintf(buf, "%s\n", sl->name);
55} 55}
56 56
57static ssize_t w1_smem_read_val(struct device *dev, char *buf) 57static ssize_t w1_smem_read_val(struct device *dev, struct device_attribute *attr, char *buf)
58{ 58{
59 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); 59 struct w1_slave *sl = container_of(dev, struct w1_slave, dev);
60 int i; 60 int i;
diff --git a/drivers/w1/w1_therm.c b/drivers/w1/w1_therm.c
index 0b1817890503..70310f7a722e 100644
--- a/drivers/w1/w1_therm.c
+++ b/drivers/w1/w1_therm.c
@@ -42,8 +42,8 @@ static u8 bad_roms[][9] = {
42 {} 42 {}
43 }; 43 };
44 44
45static ssize_t w1_therm_read_name(struct device *, char *); 45static ssize_t w1_therm_read_name(struct device *, struct device_attribute *attr, char *);
46static ssize_t w1_therm_read_temp(struct device *, char *); 46static ssize_t w1_therm_read_temp(struct device *, struct device_attribute *attr, char *);
47static ssize_t w1_therm_read_bin(struct kobject *, char *, loff_t, size_t); 47static ssize_t w1_therm_read_bin(struct kobject *, char *, loff_t, size_t);
48 48
49static struct w1_family_ops w1_therm_fops = { 49static struct w1_family_ops w1_therm_fops = {
@@ -53,7 +53,7 @@ static struct w1_family_ops w1_therm_fops = {
53 .rvalname = "temp1_input", 53 .rvalname = "temp1_input",
54}; 54};
55 55
56static ssize_t w1_therm_read_name(struct device *dev, char *buf) 56static ssize_t w1_therm_read_name(struct device *dev, struct device_attribute *attr, char *buf)
57{ 57{
58 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); 58 struct w1_slave *sl = container_of(dev, struct w1_slave, dev);
59 59
@@ -77,7 +77,7 @@ static inline int w1_convert_temp(u8 rom[9])
77 return t; 77 return t;
78} 78}
79 79
80static ssize_t w1_therm_read_temp(struct device *dev, char *buf) 80static ssize_t w1_therm_read_temp(struct device *dev, struct device_attribute *attr, char *buf)
81{ 81{
82 struct w1_slave *sl = container_of(dev, struct w1_slave, dev); 82 struct w1_slave *sl = container_of(dev, struct w1_slave, dev);
83 83
diff --git a/drivers/zorro/zorro-sysfs.c b/drivers/zorro/zorro-sysfs.c
index dad03fc33a44..04ca8840acf1 100644
--- a/drivers/zorro/zorro-sysfs.c
+++ b/drivers/zorro/zorro-sysfs.c
@@ -21,7 +21,7 @@
21/* show configuration fields */ 21/* show configuration fields */
22#define zorro_config_attr(name, field, format_string) \ 22#define zorro_config_attr(name, field, format_string) \
23static ssize_t \ 23static ssize_t \
24show_##name(struct device *dev, char *buf) \ 24show_##name(struct device *dev, struct device_attribute *attr, char *buf) \
25{ \ 25{ \
26 struct zorro_dev *z; \ 26 struct zorro_dev *z; \
27 \ 27 \
@@ -36,7 +36,7 @@ zorro_config_attr(serial, rom.er_SerialNumber, "0x%08x\n");
36zorro_config_attr(slotaddr, slotaddr, "0x%04x\n"); 36zorro_config_attr(slotaddr, slotaddr, "0x%04x\n");
37zorro_config_attr(slotsize, slotsize, "0x%04x\n"); 37zorro_config_attr(slotsize, slotsize, "0x%04x\n");
38 38
39static ssize_t zorro_show_resource(struct device *dev, char *buf) 39static ssize_t zorro_show_resource(struct device *dev, struct device_attribute *attr, char *buf)
40{ 40{
41 struct zorro_dev *z = to_zorro_dev(dev); 41 struct zorro_dev *z = to_zorro_dev(dev);
42 42