aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/cciss.txt29
-rw-r--r--Documentation/scsi/00-INDEX2
-rw-r--r--Documentation/scsi/qlogicfas.txt3
-rw-r--r--Documentation/scsi/qlogicisp.txt30
-rw-r--r--Documentation/scsi/scsi_eh.txt8
-rw-r--r--Documentation/scsi/scsi_mid_low_api.txt4
-rw-r--r--drivers/block/acsi.c1
-rw-r--r--drivers/block/cciss.c188
-rw-r--r--drivers/block/cciss.h11
-rw-r--r--drivers/block/cciss_scsi.c82
-rw-r--r--drivers/scsi/53c7xx.c6
-rw-r--r--drivers/scsi/53c7xx.h2
-rw-r--r--drivers/scsi/Kconfig29
-rw-r--r--drivers/scsi/Makefile1
-rw-r--r--drivers/scsi/NCR53C9x.c10
-rw-r--r--drivers/scsi/NCR53C9x.h6
-rw-r--r--drivers/scsi/NCR53c406a.c4
-rw-r--r--drivers/scsi/a2091.c4
-rw-r--r--drivers/scsi/a2091.h2
-rw-r--r--drivers/scsi/a3000.c4
-rw-r--r--drivers/scsi/a3000.h2
-rw-r--r--drivers/scsi/aacraid/aachba.c23
-rw-r--r--drivers/scsi/aacraid/commsup.c4
-rw-r--r--drivers/scsi/advansys.c6
-rw-r--r--drivers/scsi/advansys.h2
-rw-r--r--drivers/scsi/aha152x.c4
-rw-r--r--drivers/scsi/aha1542.c4
-rw-r--r--drivers/scsi/aha1542.h2
-rw-r--r--drivers/scsi/aha1740.c2
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.c37
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.c39
-rw-r--r--drivers/scsi/aic7xxx_old.c18
-rw-r--r--drivers/scsi/amiga7xx.c8
-rw-r--r--drivers/scsi/amiga7xx.h2
-rw-r--r--drivers/scsi/arm/acornscsi.c6
-rw-r--r--drivers/scsi/arm/acornscsi.h2
-rw-r--r--drivers/scsi/arm/arxescsi.c8
-rw-r--r--drivers/scsi/arm/cumana_1.c2
-rw-r--r--drivers/scsi/arm/cumana_2.c8
-rw-r--r--drivers/scsi/arm/ecoscsi.c2
-rw-r--r--drivers/scsi/arm/eesox.c8
-rw-r--r--drivers/scsi/arm/fas216.c10
-rw-r--r--drivers/scsi/arm/fas216.h8
-rw-r--r--drivers/scsi/arm/oak.c2
-rw-r--r--drivers/scsi/arm/powertec.c6
-rw-r--r--drivers/scsi/arm/scsi.h8
-rw-r--r--drivers/scsi/atari_NCR5380.c2
-rw-r--r--drivers/scsi/atari_scsi.c4
-rw-r--r--drivers/scsi/atari_scsi.h2
-rw-r--r--drivers/scsi/blz1230.c4
-rw-r--r--drivers/scsi/blz2060.c4
-rw-r--r--drivers/scsi/bvme6000.c4
-rw-r--r--drivers/scsi/bvme6000.h2
-rw-r--r--drivers/scsi/cyberstorm.c4
-rw-r--r--drivers/scsi/cyberstormII.c4
-rw-r--r--drivers/scsi/dec_esp.c2
-rw-r--r--drivers/scsi/dpti.h2
-rw-r--r--drivers/scsi/dtc.c6
-rw-r--r--drivers/scsi/dtc.h2
-rw-r--r--drivers/scsi/fastlane.c4
-rw-r--r--drivers/scsi/fcal.c8
-rw-r--r--drivers/scsi/fcal.h4
-rw-r--r--drivers/scsi/fd_mcs.c4
-rw-r--r--drivers/scsi/g_NCR5380.c6
-rw-r--r--drivers/scsi/g_NCR5380.h2
-rw-r--r--drivers/scsi/gdth.c12
-rw-r--r--drivers/scsi/gdth.h4
-rw-r--r--drivers/scsi/gdth_proc.c10
-rw-r--r--drivers/scsi/gvp11.c4
-rw-r--r--drivers/scsi/gvp11.h2
-rw-r--r--drivers/scsi/ibmmca.c8
-rw-r--r--drivers/scsi/ibmmca.h2
-rw-r--r--drivers/scsi/ide-scsi.c2
-rw-r--r--drivers/scsi/in2000.c4
-rw-r--r--drivers/scsi/in2000.h2
-rw-r--r--drivers/scsi/ipr.c904
-rw-r--r--drivers/scsi/ipr.h243
-rw-r--r--drivers/scsi/ips.c150
-rw-r--r--drivers/scsi/ips.h4
-rw-r--r--drivers/scsi/jazz_esp.c4
-rw-r--r--drivers/scsi/mac_esp.c4
-rw-r--r--drivers/scsi/mac_scsi.c6
-rw-r--r--drivers/scsi/mca_53c9x.c4
-rw-r--r--drivers/scsi/megaraid.c34
-rw-r--r--drivers/scsi/megaraid.h10
-rw-r--r--drivers/scsi/megaraid/mega_common.h2
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.c81
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.c5
-rw-r--r--drivers/scsi/mvme147.c4
-rw-r--r--drivers/scsi/mvme147.h2
-rw-r--r--drivers/scsi/mvme16x.c4
-rw-r--r--drivers/scsi/mvme16x.h2
-rw-r--r--drivers/scsi/nsp32.c6
-rw-r--r--drivers/scsi/oktagon_esp.c4
-rw-r--r--drivers/scsi/pas16.c6
-rw-r--r--drivers/scsi/pas16.h2
-rw-r--r--drivers/scsi/pci2000.h2
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c8
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.h6
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c4
-rw-r--r--drivers/scsi/pluto.c8
-rw-r--r--drivers/scsi/pluto.h4
-rw-r--r--drivers/scsi/psi240i.c4
-rw-r--r--drivers/scsi/qla1280.c8
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.c8
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c28
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c10
-rw-r--r--drivers/scsi/qla2xxx/qla_sup.c5
-rw-r--r--drivers/scsi/qla2xxx/qla_version.h4
-rw-r--r--drivers/scsi/qlogicfas.c6
-rw-r--r--drivers/scsi/qlogicfc.c4
-rw-r--r--drivers/scsi/qlogicisp.c1934
-rw-r--r--drivers/scsi/qlogicisp_asm.c2034
-rw-r--r--drivers/scsi/raid_class.c96
-rw-r--r--drivers/scsi/scsi_debug.c2
-rw-r--r--drivers/scsi/scsi_error.c157
-rw-r--r--drivers/scsi/scsi_lib.c58
-rw-r--r--drivers/scsi/scsi_priv.h1
-rw-r--r--drivers/scsi/scsi_scan.c54
-rw-r--r--drivers/scsi/scsi_sysfs.c9
-rw-r--r--drivers/scsi/scsi_typedefs.h3
-rw-r--r--drivers/scsi/sd.c22
-rw-r--r--drivers/scsi/seagate.c4
-rw-r--r--drivers/scsi/seagate.h2
-rw-r--r--drivers/scsi/sgiwd93.c6
-rw-r--r--drivers/scsi/sun3_NCR5380.c2
-rw-r--r--drivers/scsi/sun3_scsi.c6
-rw-r--r--drivers/scsi/sun3_scsi.h2
-rw-r--r--drivers/scsi/sun3_scsi_vme.c6
-rw-r--r--drivers/scsi/sun3x_esp.c4
-rw-r--r--drivers/scsi/sym53c416.c4
-rw-r--r--drivers/scsi/sym53c416.h2
-rw-r--r--drivers/scsi/t128.c6
-rw-r--r--drivers/scsi/t128.h2
-rw-r--r--drivers/scsi/u14-34f.c2
-rw-r--r--drivers/scsi/ultrastor.c8
-rw-r--r--drivers/scsi/ultrastor.h2
-rw-r--r--drivers/usb/image/microtek.c2
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/pci_ids.h2
-rw-r--r--include/linux/raid_class.h32
-rw-r--r--include/scsi/scsi_host.h7
-rw-r--r--include/scsi/scsi_request.h3
143 files changed, 1733 insertions, 5102 deletions
diff --git a/Documentation/cciss.txt b/Documentation/cciss.txt
index 68a711fb82cf..15378422fc46 100644
--- a/Documentation/cciss.txt
+++ b/Documentation/cciss.txt
@@ -133,3 +133,32 @@ hardware and it is important to prevent the kernel from attempting to directly
133access these devices too, as if the array controller were merely a SCSI 133access these devices too, as if the array controller were merely a SCSI
134controller in the same way that we are allowing it to access SCSI tape drives. 134controller in the same way that we are allowing it to access SCSI tape drives.
135 135
136SCSI error handling for tape drives and medium changers
137-------------------------------------------------------
138
139The linux SCSI mid layer provides an error handling protocol which
140kicks into gear whenever a SCSI command fails to complete within a
141certain amount of time (which can vary depending on the command).
142The cciss driver participates in this protocol to some extent. The
143normal protocol is a four step process. First the device is told
144to abort the command. If that doesn't work, the device is reset.
145If that doesn't work, the SCSI bus is reset. If that doesn't work
146the host bus adapter is reset. Because the cciss driver is a block
147driver as well as a SCSI driver and only the tape drives and medium
148changers are presented to the SCSI mid layer, and unlike more
149straightforward SCSI drivers, disk i/o continues through the block
150side during the SCSI error recovery process, the cciss driver only
151implements the first two of these actions, aborting the command, and
152resetting the device. Additionally, most tape drives will not oblige
153in aborting commands, and sometimes it appears they will not even
154obey a reset coommand, though in most circumstances they will. In
155the case that the command cannot be aborted and the device cannot be
156reset, the device will be set offline.
157
158In the event the error handling code is triggered and a tape drive is
159successfully reset or the tardy command is successfully aborted, the
160tape drive may still not allow i/o to continue until some command
161is issued which positions the tape to a known position. Typically you
162must rewind the tape (by issuing "mt -f /dev/st0 rewind" for example)
163before i/o can proceed again to a tape drive which was reset.
164
diff --git a/Documentation/scsi/00-INDEX b/Documentation/scsi/00-INDEX
index fef92ebf266f..e7da8c3a255b 100644
--- a/Documentation/scsi/00-INDEX
+++ b/Documentation/scsi/00-INDEX
@@ -52,8 +52,6 @@ ppa.txt
52 - info on driver for IOmega zip drive 52 - info on driver for IOmega zip drive
53qlogicfas.txt 53qlogicfas.txt
54 - info on driver for QLogic FASxxx based adapters 54 - info on driver for QLogic FASxxx based adapters
55qlogicisp.txt
56 - info on driver for QLogic ISP 1020 based adapters
57scsi-generic.txt 55scsi-generic.txt
58 - info on the sg driver for generic (non-disk/CD/tape) SCSI devices. 56 - info on the sg driver for generic (non-disk/CD/tape) SCSI devices.
59scsi.txt 57scsi.txt
diff --git a/Documentation/scsi/qlogicfas.txt b/Documentation/scsi/qlogicfas.txt
index 398f99168077..c211d827fef2 100644
--- a/Documentation/scsi/qlogicfas.txt
+++ b/Documentation/scsi/qlogicfas.txt
@@ -11,8 +11,7 @@ Qlogic boards:
11 * IQ-PCI-10 11 * IQ-PCI-10
12 * IQ-PCI-D 12 * IQ-PCI-D
13 13
14is provided by the qlogicisp.c driver. Check README.qlogicisp for 14is provided by the qla1280 driver.
15details.
16 15
17Nor does it support the PCI-Basic, which is supported by the 16Nor does it support the PCI-Basic, which is supported by the
18'am53c974' driver. 17'am53c974' driver.
diff --git a/Documentation/scsi/qlogicisp.txt b/Documentation/scsi/qlogicisp.txt
deleted file mode 100644
index 6920f6c76a9f..000000000000
--- a/Documentation/scsi/qlogicisp.txt
+++ /dev/null
@@ -1,30 +0,0 @@
1Notes for the QLogic ISP1020 PCI SCSI Driver:
2
3This driver works well in practice, but does not support disconnect/
4reconnect, which makes using it with tape drives impractical.
5
6It should work for most host adaptors with the ISP1020 chip. The
7QLogic Corporation produces several PCI SCSI adapters which should
8work:
9
10 * IQ-PCI
11 * IQ-PCI-10
12 * IQ-PCI-D
13
14This driver may work with boards containing the ISP1020A or ISP1040A
15chips, but that has not been tested.
16
17This driver will NOT work with:
18
19 * ISA or VL Bus Qlogic cards (they use the 'qlogicfas' driver)
20 * PCI-basic (it uses the 'am53c974' driver)
21
22Much thanks to QLogic's tech support for providing the latest ISP1020
23firmware, and for taking the time to review my code.
24
25Erik Moe
26ehm@cris.com
27
28Revised:
29Michael A. Griffith
30grif@cs.ucr.edu
diff --git a/Documentation/scsi/scsi_eh.txt b/Documentation/scsi/scsi_eh.txt
index 534a50922a7b..331afd791cbb 100644
--- a/Documentation/scsi/scsi_eh.txt
+++ b/Documentation/scsi/scsi_eh.txt
@@ -83,11 +83,11 @@ with the command.
83 The timeout handler is scsi_times_out(). When a timeout occurs, this 83 The timeout handler is scsi_times_out(). When a timeout occurs, this
84function 84function
85 85
86 1. invokes optional hostt->eh_timedout() callback. Return value can 86 1. invokes optional hostt->eh_timed_out() callback. Return value can
87 be one of 87 be one of
88 88
89 - EH_HANDLED 89 - EH_HANDLED
90 This indicates that eh_timedout() dealt with the timeout. The 90 This indicates that eh_timed_out() dealt with the timeout. The
91 scmd is passed to __scsi_done() and thus linked into per-cpu 91 scmd is passed to __scsi_done() and thus linked into per-cpu
92 scsi_done_q. Normal command completion described in [1-2-1] 92 scsi_done_q. Normal command completion described in [1-2-1]
93 follows. 93 follows.
@@ -105,7 +105,7 @@ function
105 command will time out again. 105 command will time out again.
106 106
107 - EH_NOT_HANDLED 107 - EH_NOT_HANDLED
108 This is the same as when eh_timedout() callback doesn't exist. 108 This is the same as when eh_timed_out() callback doesn't exist.
109 Step #2 is taken. 109 Step #2 is taken.
110 110
111 2. scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD) is invoked for the 111 2. scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD) is invoked for the
@@ -142,7 +142,7 @@ are linked on shost->eh_cmd_q.
142 Note that this does not mean lower layers are quiescent. If a LLDD 142 Note that this does not mean lower layers are quiescent. If a LLDD
143completed a scmd with error status, the LLDD and lower layers are 143completed a scmd with error status, the LLDD and lower layers are
144assumed to forget about the scmd at that point. However, if a scmd 144assumed to forget about the scmd at that point. However, if a scmd
145has timed out, unless hostt->eh_timedout() made lower layers forget 145has timed out, unless hostt->eh_timed_out() made lower layers forget
146about the scmd, which currently no LLDD does, the command is still 146about the scmd, which currently no LLDD does, the command is still
147active as long as lower layers are concerned and completion could 147active as long as lower layers are concerned and completion could
148occur at any time. Of course, all such completions are ignored as the 148occur at any time. Of course, all such completions are ignored as the
diff --git a/Documentation/scsi/scsi_mid_low_api.txt b/Documentation/scsi/scsi_mid_low_api.txt
index 44df89c9c049..66565d42288f 100644
--- a/Documentation/scsi/scsi_mid_low_api.txt
+++ b/Documentation/scsi/scsi_mid_low_api.txt
@@ -346,7 +346,7 @@ Next, there is a movement to "outlaw" typedefs introducing synonyms for
346struct tags. Both can be still found in the SCSI subsystem, but 346struct tags. Both can be still found in the SCSI subsystem, but
347the typedefs have been moved to a single file, scsi_typedefs.h to 347the typedefs have been moved to a single file, scsi_typedefs.h to
348make their future removal easier, for example: 348make their future removal easier, for example:
349"typedef struct scsi_host_template Scsi_Host_Template;" 349"typedef struct scsi_cmnd Scsi_Cmnd;"
350 350
351Also, most C99 enhancements are encouraged to the extent they are supported 351Also, most C99 enhancements are encouraged to the extent they are supported
352by the relevant gcc compilers. So C99 style structure and array 352by the relevant gcc compilers. So C99 style structure and array
@@ -718,7 +718,7 @@ void scsi_report_bus_reset(struct Scsi_Host * shost, int channel)
718 * 718 *
719 * Defined in: drivers/scsi/scsi.c . 719 * Defined in: drivers/scsi/scsi.c .
720 **/ 720 **/
721int scsi_track_queue_full(Scsi_Device *sdev, int depth) 721int scsi_track_queue_full(struct scsi_device *sdev, int depth)
722 722
723 723
724/** 724/**
diff --git a/drivers/block/acsi.c b/drivers/block/acsi.c
index 0e1f34fef0c8..5d2d649f7e8d 100644
--- a/drivers/block/acsi.c
+++ b/drivers/block/acsi.c
@@ -58,7 +58,6 @@
58#include <linux/slab.h> 58#include <linux/slab.h>
59#include <linux/interrupt.h> 59#include <linux/interrupt.h>
60#include <scsi/scsi.h> /* for SCSI_IOCTL_GET_IDLUN */ 60#include <scsi/scsi.h> /* for SCSI_IOCTL_GET_IDLUN */
61typedef void Scsi_Device; /* hack to avoid including scsi.h */
62#include <scsi/scsi_ioctl.h> 61#include <scsi/scsi_ioctl.h>
63#include <linux/hdreg.h> /* for HDIO_GETGEO */ 62#include <linux/hdreg.h> /* for HDIO_GETGEO */
64#include <linux/blkpg.h> 63#include <linux/blkpg.h>
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index a97c80b57737..e239a6c29230 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -148,6 +148,7 @@ static struct board_type products[] = {
148static ctlr_info_t *hba[MAX_CTLR]; 148static ctlr_info_t *hba[MAX_CTLR];
149 149
150static void do_cciss_request(request_queue_t *q); 150static void do_cciss_request(request_queue_t *q);
151static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs);
151static int cciss_open(struct inode *inode, struct file *filep); 152static int cciss_open(struct inode *inode, struct file *filep);
152static int cciss_release(struct inode *inode, struct file *filep); 153static int cciss_release(struct inode *inode, struct file *filep);
153static int cciss_ioctl(struct inode *inode, struct file *filep, 154static int cciss_ioctl(struct inode *inode, struct file *filep,
@@ -1583,6 +1584,24 @@ static int fill_cmd(CommandList_struct *c, __u8 cmd, int ctlr, void *buff,
1583 } 1584 }
1584 } else if (cmd_type == TYPE_MSG) { 1585 } else if (cmd_type == TYPE_MSG) {
1585 switch (cmd) { 1586 switch (cmd) {
1587 case 0: /* ABORT message */
1588 c->Request.CDBLen = 12;
1589 c->Request.Type.Attribute = ATTR_SIMPLE;
1590 c->Request.Type.Direction = XFER_WRITE;
1591 c->Request.Timeout = 0;
1592 c->Request.CDB[0] = cmd; /* abort */
1593 c->Request.CDB[1] = 0; /* abort a command */
1594 /* buff contains the tag of the command to abort */
1595 memcpy(&c->Request.CDB[4], buff, 8);
1596 break;
1597 case 1: /* RESET message */
1598 c->Request.CDBLen = 12;
1599 c->Request.Type.Attribute = ATTR_SIMPLE;
1600 c->Request.Type.Direction = XFER_WRITE;
1601 c->Request.Timeout = 0;
1602 memset(&c->Request.CDB[0], 0, sizeof(c->Request.CDB));
1603 c->Request.CDB[0] = cmd; /* reset */
1604 c->Request.CDB[1] = 0x04; /* reset a LUN */
1586 case 3: /* No-Op message */ 1605 case 3: /* No-Op message */
1587 c->Request.CDBLen = 1; 1606 c->Request.CDBLen = 1;
1588 c->Request.Type.Attribute = ATTR_SIMPLE; 1607 c->Request.Type.Attribute = ATTR_SIMPLE;
@@ -1869,6 +1888,52 @@ static unsigned long pollcomplete(int ctlr)
1869 /* Invalid address to tell caller we ran out of time */ 1888 /* Invalid address to tell caller we ran out of time */
1870 return 1; 1889 return 1;
1871} 1890}
1891
1892static int add_sendcmd_reject(__u8 cmd, int ctlr, unsigned long complete)
1893{
1894 /* We get in here if sendcmd() is polling for completions
1895 and gets some command back that it wasn't expecting --
1896 something other than that which it just sent down.
1897 Ordinarily, that shouldn't happen, but it can happen when
1898 the scsi tape stuff gets into error handling mode, and
1899 starts using sendcmd() to try to abort commands and
1900 reset tape drives. In that case, sendcmd may pick up
1901 completions of commands that were sent to logical drives
1902 through the block i/o system, or cciss ioctls completing, etc.
1903 In that case, we need to save those completions for later
1904 processing by the interrupt handler.
1905 */
1906
1907#ifdef CONFIG_CISS_SCSI_TAPE
1908 struct sendcmd_reject_list *srl = &hba[ctlr]->scsi_rejects;
1909
1910 /* If it's not the scsi tape stuff doing error handling, (abort */
1911 /* or reset) then we don't expect anything weird. */
1912 if (cmd != CCISS_RESET_MSG && cmd != CCISS_ABORT_MSG) {
1913#endif
1914 printk( KERN_WARNING "cciss cciss%d: SendCmd "
1915 "Invalid command list address returned! (%lx)\n",
1916 ctlr, complete);
1917 /* not much we can do. */
1918#ifdef CONFIG_CISS_SCSI_TAPE
1919 return 1;
1920 }
1921
1922 /* We've sent down an abort or reset, but something else
1923 has completed */
1924 if (srl->ncompletions >= (NR_CMDS + 2)) {
1925 /* Uh oh. No room to save it for later... */
1926 printk(KERN_WARNING "cciss%d: Sendcmd: Invalid command addr, "
1927 "reject list overflow, command lost!\n", ctlr);
1928 return 1;
1929 }
1930 /* Save it for later */
1931 srl->complete[srl->ncompletions] = complete;
1932 srl->ncompletions++;
1933#endif
1934 return 0;
1935}
1936
1872/* 1937/*
1873 * Send a command to the controller, and wait for it to complete. 1938 * Send a command to the controller, and wait for it to complete.
1874 * Only used at init time. 1939 * Only used at init time.
@@ -1891,7 +1956,7 @@ static int sendcmd(
1891 unsigned long complete; 1956 unsigned long complete;
1892 ctlr_info_t *info_p= hba[ctlr]; 1957 ctlr_info_t *info_p= hba[ctlr];
1893 u64bit buff_dma_handle; 1958 u64bit buff_dma_handle;
1894 int status; 1959 int status, done = 0;
1895 1960
1896 if ((c = cmd_alloc(info_p, 1)) == NULL) { 1961 if ((c = cmd_alloc(info_p, 1)) == NULL) {
1897 printk(KERN_WARNING "cciss: unable to get memory"); 1962 printk(KERN_WARNING "cciss: unable to get memory");
@@ -1913,7 +1978,9 @@ resend_cmd1:
1913 info_p->access.set_intr_mask(info_p, CCISS_INTR_OFF); 1978 info_p->access.set_intr_mask(info_p, CCISS_INTR_OFF);
1914 1979
1915 /* Make sure there is room in the command FIFO */ 1980 /* Make sure there is room in the command FIFO */
1916 /* Actually it should be completely empty at this time. */ 1981 /* Actually it should be completely empty at this time */
1982 /* unless we are in here doing error handling for the scsi */
1983 /* tape side of the driver. */
1917 for (i = 200000; i > 0; i--) 1984 for (i = 200000; i > 0; i--)
1918 { 1985 {
1919 /* if fifo isn't full go */ 1986 /* if fifo isn't full go */
@@ -1930,13 +1997,25 @@ resend_cmd1:
1930 * Send the cmd 1997 * Send the cmd
1931 */ 1998 */
1932 info_p->access.submit_command(info_p, c); 1999 info_p->access.submit_command(info_p, c);
1933 complete = pollcomplete(ctlr); 2000 done = 0;
2001 do {
2002 complete = pollcomplete(ctlr);
1934 2003
1935#ifdef CCISS_DEBUG 2004#ifdef CCISS_DEBUG
1936 printk(KERN_DEBUG "cciss: command completed\n"); 2005 printk(KERN_DEBUG "cciss: command completed\n");
1937#endif /* CCISS_DEBUG */ 2006#endif /* CCISS_DEBUG */
1938 2007
1939 if (complete != 1) { 2008 if (complete == 1) {
2009 printk( KERN_WARNING
2010 "cciss cciss%d: SendCmd Timeout out, "
2011 "No command list address returned!\n",
2012 ctlr);
2013 status = IO_ERROR;
2014 done = 1;
2015 break;
2016 }
2017
2018 /* This will need to change for direct lookup completions */
1940 if ( (complete & CISS_ERROR_BIT) 2019 if ( (complete & CISS_ERROR_BIT)
1941 && (complete & ~CISS_ERROR_BIT) == c->busaddr) 2020 && (complete & ~CISS_ERROR_BIT) == c->busaddr)
1942 { 2021 {
@@ -1976,6 +2055,10 @@ resend_cmd1:
1976 status = IO_ERROR; 2055 status = IO_ERROR;
1977 goto cleanup1; 2056 goto cleanup1;
1978 } 2057 }
2058 } else if (c->err_info->CommandStatus == CMD_UNABORTABLE) {
2059 printk(KERN_WARNING "cciss%d: command could not be aborted.\n", ctlr);
2060 status = IO_ERROR;
2061 goto cleanup1;
1979 } 2062 }
1980 printk(KERN_WARNING "ciss ciss%d: sendcmd" 2063 printk(KERN_WARNING "ciss ciss%d: sendcmd"
1981 " Error %x \n", ctlr, 2064 " Error %x \n", ctlr,
@@ -1990,20 +2073,15 @@ resend_cmd1:
1990 goto cleanup1; 2073 goto cleanup1;
1991 } 2074 }
1992 } 2075 }
2076 /* This will need changing for direct lookup completions */
1993 if (complete != c->busaddr) { 2077 if (complete != c->busaddr) {
1994 printk( KERN_WARNING "cciss cciss%d: SendCmd " 2078 if (add_sendcmd_reject(cmd, ctlr, complete) != 0) {
1995 "Invalid command list address returned! (%lx)\n", 2079 BUG(); /* we are pretty much hosed if we get here. */
1996 ctlr, complete); 2080 }
1997 status = IO_ERROR; 2081 continue;
1998 goto cleanup1; 2082 } else
1999 } 2083 done = 1;
2000 } else { 2084 } while (!done);
2001 printk( KERN_WARNING
2002 "cciss cciss%d: SendCmd Timeout out, "
2003 "No command list address returned!\n",
2004 ctlr);
2005 status = IO_ERROR;
2006 }
2007 2085
2008cleanup1: 2086cleanup1:
2009 /* unlock the data buffer from DMA */ 2087 /* unlock the data buffer from DMA */
@@ -2011,6 +2089,11 @@ cleanup1:
2011 buff_dma_handle.val32.upper = c->SG[0].Addr.upper; 2089 buff_dma_handle.val32.upper = c->SG[0].Addr.upper;
2012 pci_unmap_single(info_p->pdev, (dma_addr_t) buff_dma_handle.val, 2090 pci_unmap_single(info_p->pdev, (dma_addr_t) buff_dma_handle.val,
2013 c->SG[0].Len, PCI_DMA_BIDIRECTIONAL); 2091 c->SG[0].Len, PCI_DMA_BIDIRECTIONAL);
2092#ifdef CONFIG_CISS_SCSI_TAPE
2093 /* if we saved some commands for later, process them now. */
2094 if (info_p->scsi_rejects.ncompletions > 0)
2095 do_cciss_intr(0, info_p, NULL);
2096#endif
2014 cmd_free(info_p, c, 1); 2097 cmd_free(info_p, c, 1);
2015 return (status); 2098 return (status);
2016} 2099}
@@ -2335,6 +2418,48 @@ startio:
2335 start_io(h); 2418 start_io(h);
2336} 2419}
2337 2420
2421static inline unsigned long get_next_completion(ctlr_info_t *h)
2422{
2423#ifdef CONFIG_CISS_SCSI_TAPE
2424 /* Any rejects from sendcmd() lying around? Process them first */
2425 if (h->scsi_rejects.ncompletions == 0)
2426 return h->access.command_completed(h);
2427 else {
2428 struct sendcmd_reject_list *srl;
2429 int n;
2430 srl = &h->scsi_rejects;
2431 n = --srl->ncompletions;
2432 /* printk("cciss%d: processing saved reject\n", h->ctlr); */
2433 printk("p");
2434 return srl->complete[n];
2435 }
2436#else
2437 return h->access.command_completed(h);
2438#endif
2439}
2440
2441static inline int interrupt_pending(ctlr_info_t *h)
2442{
2443#ifdef CONFIG_CISS_SCSI_TAPE
2444 return ( h->access.intr_pending(h)
2445 || (h->scsi_rejects.ncompletions > 0));
2446#else
2447 return h->access.intr_pending(h);
2448#endif
2449}
2450
2451static inline long interrupt_not_for_us(ctlr_info_t *h)
2452{
2453#ifdef CONFIG_CISS_SCSI_TAPE
2454 return (((h->access.intr_pending(h) == 0) ||
2455 (h->interrupts_enabled == 0))
2456 && (h->scsi_rejects.ncompletions == 0));
2457#else
2458 return (((h->access.intr_pending(h) == 0) ||
2459 (h->interrupts_enabled == 0)));
2460#endif
2461}
2462
2338static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs) 2463static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs)
2339{ 2464{
2340 ctlr_info_t *h = dev_id; 2465 ctlr_info_t *h = dev_id;
@@ -2344,19 +2469,15 @@ static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs)
2344 int j; 2469 int j;
2345 int start_queue = h->next_to_run; 2470 int start_queue = h->next_to_run;
2346 2471
2347 /* Is this interrupt for us? */ 2472 if (interrupt_not_for_us(h))
2348 if (( h->access.intr_pending(h) == 0) || (h->interrupts_enabled == 0))
2349 return IRQ_NONE; 2473 return IRQ_NONE;
2350
2351 /* 2474 /*
2352 * If there are completed commands in the completion queue, 2475 * If there are completed commands in the completion queue,
2353 * we had better do something about it. 2476 * we had better do something about it.
2354 */ 2477 */
2355 spin_lock_irqsave(CCISS_LOCK(h->ctlr), flags); 2478 spin_lock_irqsave(CCISS_LOCK(h->ctlr), flags);
2356 while( h->access.intr_pending(h)) 2479 while (interrupt_pending(h)) {
2357 { 2480 while((a = get_next_completion(h)) != FIFO_EMPTY) {
2358 while((a = h->access.command_completed(h)) != FIFO_EMPTY)
2359 {
2360 a1 = a; 2481 a1 = a;
2361 if ((a & 0x04)) { 2482 if ((a & 0x04)) {
2362 a2 = (a >> 3); 2483 a2 = (a >> 3);
@@ -2963,7 +3084,15 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
2963 printk( KERN_ERR "cciss: out of memory"); 3084 printk( KERN_ERR "cciss: out of memory");
2964 goto clean4; 3085 goto clean4;
2965 } 3086 }
2966 3087#ifdef CONFIG_CISS_SCSI_TAPE
3088 hba[i]->scsi_rejects.complete =
3089 kmalloc(sizeof(hba[i]->scsi_rejects.complete[0]) *
3090 (NR_CMDS + 5), GFP_KERNEL);
3091 if (hba[i]->scsi_rejects.complete == NULL) {
3092 printk( KERN_ERR "cciss: out of memory");
3093 goto clean4;
3094 }
3095#endif
2967 spin_lock_init(&hba[i]->lock); 3096 spin_lock_init(&hba[i]->lock);
2968 3097
2969 /* Initialize the pdev driver private data. 3098 /* Initialize the pdev driver private data.
@@ -3031,6 +3160,10 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
3031 return(1); 3160 return(1);
3032 3161
3033clean4: 3162clean4:
3163#ifdef CONFIG_CISS_SCSI_TAPE
3164 if(hba[i]->scsi_rejects.complete)
3165 kfree(hba[i]->scsi_rejects.complete);
3166#endif
3034 kfree(hba[i]->cmd_pool_bits); 3167 kfree(hba[i]->cmd_pool_bits);
3035 if(hba[i]->cmd_pool) 3168 if(hba[i]->cmd_pool)
3036 pci_free_consistent(hba[i]->pdev, 3169 pci_free_consistent(hba[i]->pdev,
@@ -3103,6 +3236,9 @@ static void __devexit cciss_remove_one (struct pci_dev *pdev)
3103 pci_free_consistent(hba[i]->pdev, NR_CMDS * sizeof( ErrorInfo_struct), 3236 pci_free_consistent(hba[i]->pdev, NR_CMDS * sizeof( ErrorInfo_struct),
3104 hba[i]->errinfo_pool, hba[i]->errinfo_pool_dhandle); 3237 hba[i]->errinfo_pool, hba[i]->errinfo_pool_dhandle);
3105 kfree(hba[i]->cmd_pool_bits); 3238 kfree(hba[i]->cmd_pool_bits);
3239#ifdef CONFIG_CISS_SCSI_TAPE
3240 kfree(hba[i]->scsi_rejects.complete);
3241#endif
3106 release_io_mem(hba[i]); 3242 release_io_mem(hba[i]);
3107 free_hba(i); 3243 free_hba(i);
3108} 3244}
diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h
index ef277baee9fd..3b0858c83897 100644
--- a/drivers/block/cciss.h
+++ b/drivers/block/cciss.h
@@ -44,6 +44,14 @@ typedef struct _drive_info_struct
44 */ 44 */
45} drive_info_struct; 45} drive_info_struct;
46 46
47#ifdef CONFIG_CISS_SCSI_TAPE
48
49struct sendcmd_reject_list {
50 int ncompletions;
51 unsigned long *complete; /* array of NR_CMDS tags */
52};
53
54#endif
47struct ctlr_info 55struct ctlr_info
48{ 56{
49 int ctlr; 57 int ctlr;
@@ -100,6 +108,9 @@ struct ctlr_info
100 struct gendisk *gendisk[NWD]; 108 struct gendisk *gendisk[NWD];
101#ifdef CONFIG_CISS_SCSI_TAPE 109#ifdef CONFIG_CISS_SCSI_TAPE
102 void *scsi_ctlr; /* ptr to structure containing scsi related stuff */ 110 void *scsi_ctlr; /* ptr to structure containing scsi related stuff */
111 /* list of block side commands the scsi error handling sucked up */
112 /* and saved for later processing */
113 struct sendcmd_reject_list scsi_rejects;
103#endif 114#endif
104 unsigned char alive; 115 unsigned char alive;
105}; 116};
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
index ec27976a57da..3226aa11c6ef 100644
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -42,6 +42,9 @@
42 42
43#include "cciss_scsi.h" 43#include "cciss_scsi.h"
44 44
45#define CCISS_ABORT_MSG 0x00
46#define CCISS_RESET_MSG 0x01
47
45/* some prototypes... */ 48/* some prototypes... */
46static int sendcmd( 49static int sendcmd(
47 __u8 cmd, 50 __u8 cmd,
@@ -67,6 +70,8 @@ static int cciss_scsi_proc_info(
67 70
68static int cciss_scsi_queue_command (struct scsi_cmnd *cmd, 71static int cciss_scsi_queue_command (struct scsi_cmnd *cmd,
69 void (* done)(struct scsi_cmnd *)); 72 void (* done)(struct scsi_cmnd *));
73static int cciss_eh_device_reset_handler(struct scsi_cmnd *);
74static int cciss_eh_abort_handler(struct scsi_cmnd *);
70 75
71static struct cciss_scsi_hba_t ccissscsi[MAX_CTLR] = { 76static struct cciss_scsi_hba_t ccissscsi[MAX_CTLR] = {
72 { .name = "cciss0", .ndevices = 0 }, 77 { .name = "cciss0", .ndevices = 0 },
@@ -90,6 +95,9 @@ static struct scsi_host_template cciss_driver_template = {
90 .sg_tablesize = MAXSGENTRIES, 95 .sg_tablesize = MAXSGENTRIES,
91 .cmd_per_lun = 1, 96 .cmd_per_lun = 1,
92 .use_clustering = DISABLE_CLUSTERING, 97 .use_clustering = DISABLE_CLUSTERING,
98 /* Can't have eh_bus_reset_handler or eh_host_reset_handler for cciss */
99 .eh_device_reset_handler= cciss_eh_device_reset_handler,
100 .eh_abort_handler = cciss_eh_abort_handler,
93}; 101};
94 102
95#pragma pack(1) 103#pragma pack(1)
@@ -247,7 +255,7 @@ scsi_cmd_stack_free(int ctlr)
247#define DEVICETYPE(n) (n<0 || n>MAX_SCSI_DEVICE_CODE) ? \ 255#define DEVICETYPE(n) (n<0 || n>MAX_SCSI_DEVICE_CODE) ? \
248 "Unknown" : scsi_device_types[n] 256 "Unknown" : scsi_device_types[n]
249 257
250#if 0 258#if 1
251static int xmargin=8; 259static int xmargin=8;
252static int amargin=60; 260static int amargin=60;
253 261
@@ -1448,6 +1456,78 @@ cciss_proc_tape_report(int ctlr, unsigned char *buffer, off_t *pos, off_t *len)
1448 *pos += size; *len += size; 1456 *pos += size; *len += size;
1449} 1457}
1450 1458
1459/* Need at least one of these error handlers to keep ../scsi/hosts.c from
1460 * complaining. Doing a host- or bus-reset can't do anything good here.
1461 * Despite what it might say in scsi_error.c, there may well be commands
1462 * on the controller, as the cciss driver registers twice, once as a block
1463 * device for the logical drives, and once as a scsi device, for any tape
1464 * drives. So we know there are no commands out on the tape drives, but we
1465 * don't know there are no commands on the controller, and it is likely
1466 * that there probably are, as the cciss block device is most commonly used
1467 * as a boot device (embedded controller on HP/Compaq systems.)
1468*/
1469
1470static int cciss_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
1471{
1472 int rc;
1473 CommandList_struct *cmd_in_trouble;
1474 ctlr_info_t **c;
1475 int ctlr;
1476
1477 /* find the controller to which the command to be aborted was sent */
1478 c = (ctlr_info_t **) &scsicmd->device->host->hostdata[0];
1479 if (c == NULL) /* paranoia */
1480 return FAILED;
1481 ctlr = (*c)->ctlr;
1482 printk(KERN_WARNING "cciss%d: resetting tape drive or medium changer.\n", ctlr);
1483
1484 /* find the command that's giving us trouble */
1485 cmd_in_trouble = (CommandList_struct *) scsicmd->host_scribble;
1486 if (cmd_in_trouble == NULL) { /* paranoia */
1487 return FAILED;
1488 }
1489 /* send a reset to the SCSI LUN which the command was sent to */
1490 rc = sendcmd(CCISS_RESET_MSG, ctlr, NULL, 0, 2, 0, 0,
1491 (unsigned char *) &cmd_in_trouble->Header.LUN.LunAddrBytes[0],
1492 TYPE_MSG);
1493 /* sendcmd turned off interrputs on the board, turn 'em back on. */
1494 (*c)->access.set_intr_mask(*c, CCISS_INTR_ON);
1495 if (rc == 0)
1496 return SUCCESS;
1497 printk(KERN_WARNING "cciss%d: resetting device failed.\n", ctlr);
1498 return FAILED;
1499}
1500
1501static int cciss_eh_abort_handler(struct scsi_cmnd *scsicmd)
1502{
1503 int rc;
1504 CommandList_struct *cmd_to_abort;
1505 ctlr_info_t **c;
1506 int ctlr;
1507
1508 /* find the controller to which the command to be aborted was sent */
1509 c = (ctlr_info_t **) &scsicmd->device->host->hostdata[0];
1510 if (c == NULL) /* paranoia */
1511 return FAILED;
1512 ctlr = (*c)->ctlr;
1513 printk(KERN_WARNING "cciss%d: aborting tardy SCSI cmd\n", ctlr);
1514
1515 /* find the command to be aborted */
1516 cmd_to_abort = (CommandList_struct *) scsicmd->host_scribble;
1517 if (cmd_to_abort == NULL) /* paranoia */
1518 return FAILED;
1519 rc = sendcmd(CCISS_ABORT_MSG, ctlr, &cmd_to_abort->Header.Tag,
1520 0, 2, 0, 0,
1521 (unsigned char *) &cmd_to_abort->Header.LUN.LunAddrBytes[0],
1522 TYPE_MSG);
1523 /* sendcmd turned off interrputs on the board, turn 'em back on. */
1524 (*c)->access.set_intr_mask(*c, CCISS_INTR_ON);
1525 if (rc == 0)
1526 return SUCCESS;
1527 return FAILED;
1528
1529}
1530
1451#else /* no CONFIG_CISS_SCSI_TAPE */ 1531#else /* no CONFIG_CISS_SCSI_TAPE */
1452 1532
1453/* If no tape support, then these become defined out of existence */ 1533/* If no tape support, then these become defined out of existence */
diff --git a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c
index 7a33c708f5b3..9cb5dd48383f 100644
--- a/drivers/scsi/53c7xx.c
+++ b/drivers/scsi/53c7xx.c
@@ -343,7 +343,7 @@ static void NCR53c7x0_soft_reset (struct Scsi_Host *host);
343/* Size of event list (per host adapter) */ 343/* Size of event list (per host adapter) */
344static int track_events = 0; 344static int track_events = 0;
345static struct Scsi_Host *first_host = NULL; /* Head of list of NCR boards */ 345static struct Scsi_Host *first_host = NULL; /* Head of list of NCR boards */
346static Scsi_Host_Template *the_template = NULL; 346static struct scsi_host_template *the_template = NULL;
347 347
348/* NCR53c710 script handling code */ 348/* NCR53c710 script handling code */
349 349
@@ -1103,7 +1103,7 @@ NCR53c7x0_init (struct Scsi_Host *host) {
1103} 1103}
1104 1104
1105/* 1105/*
1106 * Function : int ncr53c7xx_init(Scsi_Host_Template *tpnt, int board, int chip, 1106 * Function : int ncr53c7xx_init(struct scsi_host_template *tpnt, int board, int chip,
1107 * unsigned long base, int io_port, int irq, int dma, long long options, 1107 * unsigned long base, int io_port, int irq, int dma, long long options,
1108 * int clock); 1108 * int clock);
1109 * 1109 *
@@ -1118,7 +1118,7 @@ NCR53c7x0_init (struct Scsi_Host *host) {
1118 */ 1118 */
1119 1119
1120int 1120int
1121ncr53c7xx_init (Scsi_Host_Template *tpnt, int board, int chip, 1121ncr53c7xx_init (struct scsi_host_template *tpnt, int board, int chip,
1122 unsigned long base, int io_port, int irq, int dma, 1122 unsigned long base, int io_port, int irq, int dma,
1123 long long options, int clock) 1123 long long options, int clock)
1124{ 1124{
diff --git a/drivers/scsi/53c7xx.h b/drivers/scsi/53c7xx.h
index d9098bdace05..218f3b901537 100644
--- a/drivers/scsi/53c7xx.h
+++ b/drivers/scsi/53c7xx.h
@@ -1600,7 +1600,7 @@ struct NCR53c7x0_hostdata {
1600/* Paranoid people could use panic() here. */ 1600/* Paranoid people could use panic() here. */
1601#define FATAL(host) shutdown((host)); 1601#define FATAL(host) shutdown((host));
1602 1602
1603extern int ncr53c7xx_init(Scsi_Host_Template *tpnt, int board, int chip, 1603extern int ncr53c7xx_init(struct scsi_host_template *tpnt, int board, int chip,
1604 unsigned long base, int io_port, int irq, int dma, 1604 unsigned long base, int io_port, int irq, int dma,
1605 long long options, int clock); 1605 long long options, int clock);
1606 1606
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index afeca325b4dc..84c42c44e04d 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1295,27 +1295,6 @@ config SCSI_QLOGIC_FAS
1295 To compile this driver as a module, choose M here: the 1295 To compile this driver as a module, choose M here: the
1296 module will be called qlogicfas. 1296 module will be called qlogicfas.
1297 1297
1298config SCSI_QLOGIC_ISP
1299 tristate "Qlogic ISP SCSI support (old driver)"
1300 depends on PCI && SCSI && BROKEN
1301 ---help---
1302 This driver works for all QLogic PCI SCSI host adapters (IQ-PCI,
1303 IQ-PCI-10, IQ_PCI-D) except for the PCI-basic card. (This latter
1304 card is supported by the "AM53/79C974 PCI SCSI" driver.)
1305
1306 If you say Y here, make sure to choose "BIOS" at the question "PCI
1307 access mode".
1308
1309 Please read the file <file:Documentation/scsi/qlogicisp.txt>. You
1310 should also read the SCSI-HOWTO, available from
1311 <http://www.tldp.org/docs.html#howto>.
1312
1313 To compile this driver as a module, choose M here: the
1314 module will be called qlogicisp.
1315
1316 These days the hardware is also supported by the more modern qla1280
1317 driver. In doubt use that one instead of qlogicisp.
1318
1319config SCSI_QLOGIC_FC 1298config SCSI_QLOGIC_FC
1320 tristate "Qlogic ISP FC SCSI support" 1299 tristate "Qlogic ISP FC SCSI support"
1321 depends on PCI && SCSI 1300 depends on PCI && SCSI
@@ -1342,14 +1321,6 @@ config SCSI_QLOGIC_1280
1342 To compile this driver as a module, choose M here: the 1321 To compile this driver as a module, choose M here: the
1343 module will be called qla1280. 1322 module will be called qla1280.
1344 1323
1345config SCSI_QLOGIC_1280_1040
1346 bool "Qlogic QLA 1020/1040 SCSI support"
1347 depends on SCSI_QLOGIC_1280 && SCSI_QLOGIC_ISP!=y
1348 help
1349 Say Y here if you have a QLogic ISP1020/1040 SCSI host adapter and
1350 do not want to use the old driver. This option enables support in
1351 the qla1280 driver for those host adapters.
1352
1353config SCSI_QLOGICPTI 1324config SCSI_QLOGICPTI
1354 tristate "PTI Qlogic, ISP Driver" 1325 tristate "PTI Qlogic, ISP Driver"
1355 depends on SBUS && SCSI 1326 depends on SBUS && SCSI
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index b88b8c455598..f062ea0f813a 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -78,7 +78,6 @@ obj-$(CONFIG_SCSI_NCR_Q720) += NCR_Q720_mod.o
78obj-$(CONFIG_SCSI_SYM53C416) += sym53c416.o 78obj-$(CONFIG_SCSI_SYM53C416) += sym53c416.o
79obj-$(CONFIG_SCSI_QLOGIC_FAS) += qlogicfas408.o qlogicfas.o 79obj-$(CONFIG_SCSI_QLOGIC_FAS) += qlogicfas408.o qlogicfas.o
80obj-$(CONFIG_PCMCIA_QLOGIC) += qlogicfas408.o 80obj-$(CONFIG_PCMCIA_QLOGIC) += qlogicfas408.o
81obj-$(CONFIG_SCSI_QLOGIC_ISP) += qlogicisp.o
82obj-$(CONFIG_SCSI_QLOGIC_FC) += qlogicfc.o 81obj-$(CONFIG_SCSI_QLOGIC_FC) += qlogicfc.o
83obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o 82obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o
84obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx/ 83obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx/
diff --git a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c
index 26146a4b67b8..640590bd014a 100644
--- a/drivers/scsi/NCR53C9x.c
+++ b/drivers/scsi/NCR53C9x.c
@@ -529,7 +529,7 @@ void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs)
529/* Allocate structure and insert basic data such as SCSI chip frequency 529/* Allocate structure and insert basic data such as SCSI chip frequency
530 * data and a pointer to the device 530 * data and a pointer to the device
531 */ 531 */
532struct NCR_ESP* esp_allocate(Scsi_Host_Template *tpnt, void *esp_dev) 532struct NCR_ESP* esp_allocate(struct scsi_host_template *tpnt, void *esp_dev)
533{ 533{
534 struct NCR_ESP *esp, *elink; 534 struct NCR_ESP *esp, *elink;
535 struct Scsi_Host *esp_host; 535 struct Scsi_Host *esp_host;
@@ -1006,7 +1006,7 @@ static void esp_exec_cmd(struct NCR_ESP *esp)
1006 struct ESP_regs *eregs = esp->eregs; 1006 struct ESP_regs *eregs = esp->eregs;
1007 struct esp_device *esp_dev; 1007 struct esp_device *esp_dev;
1008 Scsi_Cmnd *SCptr; 1008 Scsi_Cmnd *SCptr;
1009 Scsi_Device *SDptr; 1009 struct scsi_device *SDptr;
1010 volatile unchar *cmdp = esp->esp_command; 1010 volatile unchar *cmdp = esp->esp_command;
1011 unsigned char the_esp_command; 1011 unsigned char the_esp_command;
1012 int lun, target; 1012 int lun, target;
@@ -1687,7 +1687,7 @@ static inline int reconnect_lun(struct NCR_ESP *esp, struct ESP_regs *eregs)
1687static inline void esp_connect(struct NCR_ESP *esp, struct ESP_regs *eregs, 1687static inline void esp_connect(struct NCR_ESP *esp, struct ESP_regs *eregs,
1688 Scsi_Cmnd *sp) 1688 Scsi_Cmnd *sp)
1689{ 1689{
1690 Scsi_Device *dp = sp->device; 1690 struct scsi_device *dp = sp->device;
1691 struct esp_device *esp_dev = dp->hostdata; 1691 struct esp_device *esp_dev = dp->hostdata;
1692 1692
1693 if(esp->prev_soff != esp_dev->sync_max_offset || 1693 if(esp->prev_soff != esp_dev->sync_max_offset ||
@@ -3605,7 +3605,7 @@ out:
3605} 3605}
3606#endif 3606#endif
3607 3607
3608int esp_slave_alloc(Scsi_Device *SDptr) 3608int esp_slave_alloc(struct scsi_device *SDptr)
3609{ 3609{
3610 struct esp_device *esp_dev = 3610 struct esp_device *esp_dev =
3611 kmalloc(sizeof(struct esp_device), GFP_ATOMIC); 3611 kmalloc(sizeof(struct esp_device), GFP_ATOMIC);
@@ -3617,7 +3617,7 @@ int esp_slave_alloc(Scsi_Device *SDptr)
3617 return 0; 3617 return 0;
3618} 3618}
3619 3619
3620void esp_slave_destroy(Scsi_Device *SDptr) 3620void esp_slave_destroy(struct scsi_device *SDptr)
3621{ 3621{
3622 struct NCR_ESP *esp = (struct NCR_ESP *) SDptr->host->hostdata; 3622 struct NCR_ESP *esp = (struct NCR_ESP *) SDptr->host->hostdata;
3623 3623
diff --git a/drivers/scsi/NCR53C9x.h b/drivers/scsi/NCR53C9x.h
index 06e7edf23326..65a9b377a410 100644
--- a/drivers/scsi/NCR53C9x.h
+++ b/drivers/scsi/NCR53C9x.h
@@ -653,7 +653,7 @@ extern int nesps, esps_in_use, esps_running;
653 653
654/* External functions */ 654/* External functions */
655extern void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs); 655extern void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs);
656extern struct NCR_ESP *esp_allocate(Scsi_Host_Template *, void *); 656extern struct NCR_ESP *esp_allocate(struct scsi_host_template *, void *);
657extern void esp_deallocate(struct NCR_ESP *); 657extern void esp_deallocate(struct NCR_ESP *);
658extern void esp_release(void); 658extern void esp_release(void);
659extern void esp_initialize(struct NCR_ESP *); 659extern void esp_initialize(struct NCR_ESP *);
@@ -664,6 +664,6 @@ extern int esp_abort(Scsi_Cmnd *);
664extern int esp_reset(Scsi_Cmnd *); 664extern int esp_reset(Scsi_Cmnd *);
665extern int esp_proc_info(struct Scsi_Host *shost, char *buffer, char **start, off_t offset, int length, 665extern int esp_proc_info(struct Scsi_Host *shost, char *buffer, char **start, off_t offset, int length,
666 int inout); 666 int inout);
667extern int esp_slave_alloc(Scsi_Device *); 667extern int esp_slave_alloc(struct scsi_device *);
668extern void esp_slave_destroy(Scsi_Device *); 668extern void esp_slave_destroy(struct scsi_device *);
669#endif /* !(NCR53C9X_H) */ 669#endif /* !(NCR53C9X_H) */
diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c
index 135376992a57..ae37d3ab9c4a 100644
--- a/drivers/scsi/NCR53c406a.c
+++ b/drivers/scsi/NCR53c406a.c
@@ -447,7 +447,7 @@ static __inline__ int NCR53c406a_pio_write(unsigned char *request, unsigned int
447} 447}
448#endif /* USE_PIO */ 448#endif /* USE_PIO */
449 449
450static int __init NCR53c406a_detect(Scsi_Host_Template * tpnt) 450static int __init NCR53c406a_detect(struct scsi_host_template * tpnt)
451{ 451{
452 int present = 0; 452 int present = 0;
453 struct Scsi_Host *shpnt = NULL; 453 struct Scsi_Host *shpnt = NULL;
@@ -1057,7 +1057,7 @@ MODULE_LICENSE("GPL");
1057 * Use SG_NONE if DMA mode is enabled! 1057 * Use SG_NONE if DMA mode is enabled!
1058 */ 1058 */
1059 1059
1060static Scsi_Host_Template driver_template = 1060static struct scsi_host_template driver_template =
1061{ 1061{
1062 .proc_name = "NCR53c406a" /* proc_name */, 1062 .proc_name = "NCR53c406a" /* proc_name */,
1063 .name = "NCR53c406a" /* name */, 1063 .name = "NCR53c406a" /* name */,
diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c
index 30a14ba77a6a..54996eaae979 100644
--- a/drivers/scsi/a2091.c
+++ b/drivers/scsi/a2091.c
@@ -172,7 +172,7 @@ static void dma_stop (struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
172 } 172 }
173} 173}
174 174
175int __init a2091_detect(Scsi_Host_Template *tpnt) 175int __init a2091_detect(struct scsi_host_template *tpnt)
176{ 176{
177 static unsigned char called = 0; 177 static unsigned char called = 0;
178 struct Scsi_Host *instance; 178 struct Scsi_Host *instance;
@@ -233,7 +233,7 @@ static int a2091_bus_reset(Scsi_Cmnd *cmd)
233 233
234#define HOSTS_C 234#define HOSTS_C
235 235
236static Scsi_Host_Template driver_template = { 236static struct scsi_host_template driver_template = {
237 .proc_name = "A2901", 237 .proc_name = "A2901",
238 .name = "Commodore A2091/A590 SCSI", 238 .name = "Commodore A2091/A590 SCSI",
239 .detect = a2091_detect, 239 .detect = a2091_detect,
diff --git a/drivers/scsi/a2091.h b/drivers/scsi/a2091.h
index 54993972dcc6..22d6a13dd8be 100644
--- a/drivers/scsi/a2091.h
+++ b/drivers/scsi/a2091.h
@@ -11,7 +11,7 @@
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13 13
14int a2091_detect(Scsi_Host_Template *); 14int a2091_detect(struct scsi_host_template *);
15int a2091_release(struct Scsi_Host *); 15int a2091_release(struct Scsi_Host *);
16const char *wd33c93_info(void); 16const char *wd33c93_info(void);
17int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 17int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c
index 306caf56f3d9..f425d424bf08 100644
--- a/drivers/scsi/a3000.c
+++ b/drivers/scsi/a3000.c
@@ -168,7 +168,7 @@ static void dma_stop (struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
168 } 168 }
169} 169}
170 170
171int __init a3000_detect(Scsi_Host_Template *tpnt) 171int __init a3000_detect(struct scsi_host_template *tpnt)
172{ 172{
173 wd33c93_regs regs; 173 wd33c93_regs regs;
174 174
@@ -221,7 +221,7 @@ static int a3000_bus_reset(Scsi_Cmnd *cmd)
221 221
222#define HOSTS_C 222#define HOSTS_C
223 223
224static Scsi_Host_Template driver_template = { 224static struct scsi_host_template driver_template = {
225 .proc_name = "A3000", 225 .proc_name = "A3000",
226 .name = "Amiga 3000 built-in SCSI", 226 .name = "Amiga 3000 built-in SCSI",
227 .detect = a3000_detect, 227 .detect = a3000_detect,
diff --git a/drivers/scsi/a3000.h b/drivers/scsi/a3000.h
index b1eda731877d..5535a65150a4 100644
--- a/drivers/scsi/a3000.h
+++ b/drivers/scsi/a3000.h
@@ -11,7 +11,7 @@
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13 13
14int a3000_detect(Scsi_Host_Template *); 14int a3000_detect(struct scsi_host_template *);
15int a3000_release(struct Scsi_Host *); 15int a3000_release(struct Scsi_Host *);
16const char *wd33c93_info(void); 16const char *wd33c93_info(void);
17int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 17int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 2a128a156aa1..7139659dd952 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -1579,18 +1579,10 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1579 break; 1579 break;
1580 { 1580 {
1581 u64 capacity; 1581 u64 capacity;
1582 char cp[12]; 1582 char cp[13];
1583 unsigned int offset = 0;
1584 1583
1585 dprintk((KERN_DEBUG "READ CAPACITY_16 command.\n")); 1584 dprintk((KERN_DEBUG "READ CAPACITY_16 command.\n"));
1586 capacity = fsa_dev_ptr[cid].size - 1; 1585 capacity = fsa_dev_ptr[cid].size - 1;
1587 if (scsicmd->cmnd[13] > 12) {
1588 offset = scsicmd->cmnd[13] - 12;
1589 if (offset > sizeof(cp))
1590 break;
1591 memset(cp, 0, offset);
1592 aac_internal_transfer(scsicmd, cp, 0, offset);
1593 }
1594 cp[0] = (capacity >> 56) & 0xff; 1586 cp[0] = (capacity >> 56) & 0xff;
1595 cp[1] = (capacity >> 48) & 0xff; 1587 cp[1] = (capacity >> 48) & 0xff;
1596 cp[2] = (capacity >> 40) & 0xff; 1588 cp[2] = (capacity >> 40) & 0xff;
@@ -1603,7 +1595,18 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1603 cp[9] = 0; 1595 cp[9] = 0;
1604 cp[10] = 2; 1596 cp[10] = 2;
1605 cp[11] = 0; 1597 cp[11] = 0;
1606 aac_internal_transfer(scsicmd, cp, offset, sizeof(cp)); 1598 cp[12] = 0;
1599 aac_internal_transfer(scsicmd, cp, 0,
1600 min((unsigned int)scsicmd->cmnd[13], sizeof(cp)));
1601 if (sizeof(cp) < scsicmd->cmnd[13]) {
1602 unsigned int len, offset = sizeof(cp);
1603
1604 memset(cp, 0, offset);
1605 do {
1606 len = min(scsicmd->cmnd[13]-offset, sizeof(cp));
1607 aac_internal_transfer(scsicmd, cp, offset, len);
1608 } while ((offset += len) < scsicmd->cmnd[13]);
1609 }
1607 1610
1608 /* Do not cache partition table for arrays */ 1611 /* Do not cache partition table for arrays */
1609 scsicmd->device->removable = 1; 1612 scsicmd->device->removable = 1;
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 723c0cea7c04..38d6d00fb0fc 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -820,7 +820,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
820 break; 820 break;
821 821
822 /* 822 /*
823 * Find the Scsi_Device associated with the SCSI 823 * Find the scsi_device associated with the SCSI
824 * address. Make sure we have the right array, and if 824 * address. Make sure we have the right array, and if
825 * so set the flag to initiate a new re-config once we 825 * so set the flag to initiate a new re-config once we
826 * see an AifEnConfigChange AIF come through. 826 * see an AifEnConfigChange AIF come through.
@@ -987,7 +987,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
987 987
988 988
989 /* 989 /*
990 * Find the Scsi_Device associated with the SCSI address, 990 * Find the scsi_device associated with the SCSI address,
991 * and mark it as changed, invalidating the cache. This deals 991 * and mark it as changed, invalidating the cache. This deals
992 * with changes to existing device IDs. 992 * with changes to existing device IDs.
993 */ 993 */
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index f4cfb8f29620..28b93057b607 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -114,7 +114,7 @@
114 #include "advansys.h" 114 #include "advansys.h"
115 #endif 115 #endif
116 116
117 and after "static Scsi_Host_Template builtin_scsi_hosts[] =": 117 and after "static struct scsi_host_template builtin_scsi_hosts[] =":
118 118
119 #ifdef CONFIG_SCSI_ADVANSYS 119 #ifdef CONFIG_SCSI_ADVANSYS
120 ADVANSYS, 120 ADVANSYS,
@@ -160,7 +160,7 @@
160 --- Driver Structures 160 --- Driver Structures
161 --- Driver Data 161 --- Driver Data
162 --- Driver Function Prototypes 162 --- Driver Function Prototypes
163 --- Linux 'Scsi_Host_Template' and advansys_setup() Functions 163 --- Linux 'struct scsi_host_template' and advansys_setup() Functions
164 --- Loadable Driver Support 164 --- Loadable Driver Support
165 --- Miscellaneous Driver Functions 165 --- Miscellaneous Driver Functions
166 --- Functions Required by the Asc Library 166 --- Functions Required by the Asc Library
@@ -4068,7 +4068,7 @@ STATIC void asc_prt_hex(char *f, uchar *, int);
4068 4068
4069 4069
4070/* 4070/*
4071 * --- Linux 'Scsi_Host_Template' and advansys_setup() Functions 4071 * --- Linux 'struct scsi_host_template' and advansys_setup() Functions
4072 */ 4072 */
4073 4073
4074#ifdef CONFIG_PROC_FS 4074#ifdef CONFIG_PROC_FS
diff --git a/drivers/scsi/advansys.h b/drivers/scsi/advansys.h
index 3f4bde02302e..8ee7fb16a725 100644
--- a/drivers/scsi/advansys.h
+++ b/drivers/scsi/advansys.h
@@ -19,7 +19,7 @@
19#define _ADVANSYS_H 19#define _ADVANSYS_H
20 20
21/* 21/*
22 * Scsi_Host_Template function prototypes. 22 * struct scsi_host_template function prototypes.
23 */ 23 */
24int advansys_detect(struct scsi_host_template *); 24int advansys_detect(struct scsi_host_template *);
25int advansys_release(struct Scsi_Host *); 25int advansys_release(struct Scsi_Host *);
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index 9b7caf504a56..9df23b654cec 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -424,7 +424,7 @@ MODULE_DEVICE_TABLE(isapnp, id_table);
424 424
425static int registered_count=0; 425static int registered_count=0;
426static struct Scsi_Host *aha152x_host[2]; 426static struct Scsi_Host *aha152x_host[2];
427static Scsi_Host_Template aha152x_driver_template; 427static struct scsi_host_template aha152x_driver_template;
428 428
429/* 429/*
430 * internal states of the host 430 * internal states of the host
@@ -3464,7 +3464,7 @@ static int aha152x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start
3464 return thislength < length ? thislength : length; 3464 return thislength < length ? thislength : length;
3465} 3465}
3466 3466
3467static Scsi_Host_Template aha152x_driver_template = { 3467static struct scsi_host_template aha152x_driver_template = {
3468 .module = THIS_MODULE, 3468 .module = THIS_MODULE,
3469 .name = AHA152X_REVID, 3469 .name = AHA152X_REVID,
3470 .proc_name = "aha152x", 3470 .proc_name = "aha152x",
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 1b1adfb384cb..51bad7a1e773 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -1021,7 +1021,7 @@ __setup("aha1542=",do_setup);
1021#endif 1021#endif
1022 1022
1023/* return non-zero on detection */ 1023/* return non-zero on detection */
1024static int __init aha1542_detect(Scsi_Host_Template * tpnt) 1024static int __init aha1542_detect(struct scsi_host_template * tpnt)
1025{ 1025{
1026 unsigned char dma_chan; 1026 unsigned char dma_chan;
1027 unsigned char irq_level; 1027 unsigned char irq_level;
@@ -1789,7 +1789,7 @@ static int aha1542_biosparam(struct scsi_device *sdev,
1789MODULE_LICENSE("GPL"); 1789MODULE_LICENSE("GPL");
1790 1790
1791 1791
1792static Scsi_Host_Template driver_template = { 1792static struct scsi_host_template driver_template = {
1793 .proc_name = "aha1542", 1793 .proc_name = "aha1542",
1794 .name = "Adaptec 1542", 1794 .name = "Adaptec 1542",
1795 .detect = aha1542_detect, 1795 .detect = aha1542_detect,
diff --git a/drivers/scsi/aha1542.h b/drivers/scsi/aha1542.h
index 3821ee17f471..1db538552d56 100644
--- a/drivers/scsi/aha1542.h
+++ b/drivers/scsi/aha1542.h
@@ -131,7 +131,7 @@ struct ccb { /* Command Control Block 5.3 */
131 /* REQUEST SENSE */ 131 /* REQUEST SENSE */
132}; 132};
133 133
134static int aha1542_detect(Scsi_Host_Template *); 134static int aha1542_detect(struct scsi_host_template *);
135static int aha1542_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 135static int aha1542_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
136static int aha1542_bus_reset(Scsi_Cmnd * SCpnt); 136static int aha1542_bus_reset(Scsi_Cmnd * SCpnt);
137static int aha1542_dev_reset(Scsi_Cmnd * SCpnt); 137static int aha1542_dev_reset(Scsi_Cmnd * SCpnt);
diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c
index 8f85dcc0e7fa..4b8c6a543925 100644
--- a/drivers/scsi/aha1740.c
+++ b/drivers/scsi/aha1740.c
@@ -570,7 +570,7 @@ static int aha1740_eh_abort_handler (Scsi_Cmnd *dummy)
570 return 0; 570 return 0;
571} 571}
572 572
573static Scsi_Host_Template aha1740_template = { 573static struct scsi_host_template aha1740_template = {
574 .module = THIS_MODULE, 574 .module = THIS_MODULE,
575 .proc_name = "aha1740", 575 .proc_name = "aha1740",
576 .proc_info = aha1740_proc_info, 576 .proc_info = aha1740_proc_info,
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index cfb46c241b38..31e9f40e79a2 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -436,29 +436,20 @@ ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
436{ 436{
437 struct ahd_softc *ahd; 437 struct ahd_softc *ahd;
438 struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); 438 struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device);
439 int rtn = SCSI_MLQUEUE_HOST_BUSY;
440 unsigned long flags;
439 441
440 ahd = *(struct ahd_softc **)cmd->device->host->hostdata; 442 ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
441 443
442 /* 444 ahd_lock(ahd, &flags);
443 * Close the race of a command that was in the process of 445 if (ahd->platform_data->qfrozen == 0) {
444 * being queued to us just as our simq was frozen. Let 446 cmd->scsi_done = scsi_done;
445 * DV commands through so long as we are only frozen to 447 cmd->result = CAM_REQ_INPROG << 16;
446 * perform DV. 448 rtn = ahd_linux_run_command(ahd, dev, cmd);
447 */
448 if (ahd->platform_data->qfrozen != 0) {
449 printf("%s: queue frozen\n", ahd_name(ahd));
450 449
451 return SCSI_MLQUEUE_HOST_BUSY;
452 } 450 }
453 451 ahd_unlock(ahd, &flags);
454 /* 452 return rtn;
455 * Save the callback on completion function.
456 */
457 cmd->scsi_done = scsi_done;
458
459 cmd->result = CAM_REQ_INPROG << 16;
460
461 return ahd_linux_run_command(ahd, dev, cmd);
462} 453}
463 454
464static inline struct scsi_target ** 455static inline struct scsi_target **
@@ -1081,7 +1072,6 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa
1081 1072
1082 *((struct ahd_softc **)host->hostdata) = ahd; 1073 *((struct ahd_softc **)host->hostdata) = ahd;
1083 ahd_lock(ahd, &s); 1074 ahd_lock(ahd, &s);
1084 scsi_assign_lock(host, &ahd->platform_data->spin_lock);
1085 ahd->platform_data->host = host; 1075 ahd->platform_data->host = host;
1086 host->can_queue = AHD_MAX_QUEUE; 1076 host->can_queue = AHD_MAX_QUEUE;
1087 host->cmd_per_lun = 2; 1077 host->cmd_per_lun = 2;
@@ -2062,6 +2052,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2062 int wait; 2052 int wait;
2063 int disconnected; 2053 int disconnected;
2064 ahd_mode_state saved_modes; 2054 ahd_mode_state saved_modes;
2055 unsigned long flags;
2065 2056
2066 pending_scb = NULL; 2057 pending_scb = NULL;
2067 paused = FALSE; 2058 paused = FALSE;
@@ -2077,7 +2068,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2077 printf(" 0x%x", cmd->cmnd[cdb_byte]); 2068 printf(" 0x%x", cmd->cmnd[cdb_byte]);
2078 printf("\n"); 2069 printf("\n");
2079 2070
2080 spin_lock_irq(&ahd->platform_data->spin_lock); 2071 ahd_lock(ahd, &flags);
2081 2072
2082 /* 2073 /*
2083 * First determine if we currently own this command. 2074 * First determine if we currently own this command.
@@ -2291,7 +2282,8 @@ done:
2291 int ret; 2282 int ret;
2292 2283
2293 ahd->platform_data->flags |= AHD_SCB_UP_EH_SEM; 2284 ahd->platform_data->flags |= AHD_SCB_UP_EH_SEM;
2294 spin_unlock_irq(&ahd->platform_data->spin_lock); 2285 ahd_unlock(ahd, &flags);
2286
2295 init_timer(&timer); 2287 init_timer(&timer);
2296 timer.data = (u_long)ahd; 2288 timer.data = (u_long)ahd;
2297 timer.expires = jiffies + (5 * HZ); 2289 timer.expires = jiffies + (5 * HZ);
@@ -2305,9 +2297,8 @@ done:
2305 printf("Timer Expired\n"); 2297 printf("Timer Expired\n");
2306 retval = FAILED; 2298 retval = FAILED;
2307 } 2299 }
2308 spin_lock_irq(&ahd->platform_data->spin_lock);
2309 } 2300 }
2310 spin_unlock_irq(&ahd->platform_data->spin_lock); 2301 ahd_unlock(ahd, &flags);
2311 return (retval); 2302 return (retval);
2312} 2303}
2313 2304
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index 1861407422e4..7fc6454068e4 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -476,26 +476,20 @@ ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
476{ 476{
477 struct ahc_softc *ahc; 477 struct ahc_softc *ahc;
478 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device); 478 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device);
479 int rtn = SCSI_MLQUEUE_HOST_BUSY;
480 unsigned long flags;
479 481
480 ahc = *(struct ahc_softc **)cmd->device->host->hostdata; 482 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
481 483
482 /* 484 ahc_lock(ahc, &flags);
483 * Save the callback on completion function. 485 if (ahc->platform_data->qfrozen == 0) {
484 */ 486 cmd->scsi_done = scsi_done;
485 cmd->scsi_done = scsi_done; 487 cmd->result = CAM_REQ_INPROG << 16;
486 488 rtn = ahc_linux_run_command(ahc, dev, cmd);
487 /* 489 }
488 * Close the race of a command that was in the process of 490 ahc_unlock(ahc, &flags);
489 * being queued to us just as our simq was frozen. Let
490 * DV commands through so long as we are only frozen to
491 * perform DV.
492 */
493 if (ahc->platform_data->qfrozen != 0)
494 return SCSI_MLQUEUE_HOST_BUSY;
495
496 cmd->result = CAM_REQ_INPROG << 16;
497 491
498 return ahc_linux_run_command(ahc, dev, cmd); 492 return rtn;
499} 493}
500 494
501static inline struct scsi_target ** 495static inline struct scsi_target **
@@ -1079,7 +1073,6 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa
1079 1073
1080 *((struct ahc_softc **)host->hostdata) = ahc; 1074 *((struct ahc_softc **)host->hostdata) = ahc;
1081 ahc_lock(ahc, &s); 1075 ahc_lock(ahc, &s);
1082 scsi_assign_lock(host, &ahc->platform_data->spin_lock);
1083 ahc->platform_data->host = host; 1076 ahc->platform_data->host = host;
1084 host->can_queue = AHC_MAX_QUEUE; 1077 host->can_queue = AHC_MAX_QUEUE;
1085 host->cmd_per_lun = 2; 1078 host->cmd_per_lun = 2;
@@ -2111,6 +2104,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2111 int paused; 2104 int paused;
2112 int wait; 2105 int wait;
2113 int disconnected; 2106 int disconnected;
2107 unsigned long flags;
2114 2108
2115 pending_scb = NULL; 2109 pending_scb = NULL;
2116 paused = FALSE; 2110 paused = FALSE;
@@ -2125,7 +2119,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2125 printf(" 0x%x", cmd->cmnd[cdb_byte]); 2119 printf(" 0x%x", cmd->cmnd[cdb_byte]);
2126 printf("\n"); 2120 printf("\n");
2127 2121
2128 spin_lock_irq(&ahc->platform_data->spin_lock); 2122 ahc_lock(ahc, &flags);
2129 2123
2130 /* 2124 /*
2131 * First determine if we currently own this command. 2125 * First determine if we currently own this command.
@@ -2357,7 +2351,8 @@ done:
2357 int ret; 2351 int ret;
2358 2352
2359 ahc->platform_data->flags |= AHC_UP_EH_SEMAPHORE; 2353 ahc->platform_data->flags |= AHC_UP_EH_SEMAPHORE;
2360 spin_unlock_irq(&ahc->platform_data->spin_lock); 2354 ahc_unlock(ahc, &flags);
2355
2361 init_timer(&timer); 2356 init_timer(&timer);
2362 timer.data = (u_long)ahc; 2357 timer.data = (u_long)ahc;
2363 timer.expires = jiffies + (5 * HZ); 2358 timer.expires = jiffies + (5 * HZ);
@@ -2371,10 +2366,8 @@ done:
2371 printf("Timer Expired\n"); 2366 printf("Timer Expired\n");
2372 retval = FAILED; 2367 retval = FAILED;
2373 } 2368 }
2374 spin_lock_irq(&ahc->platform_data->spin_lock); 2369 } else
2375 } 2370 ahc_unlock(ahc, &flags);
2376
2377 spin_unlock_irq(&ahc->platform_data->spin_lock);
2378 return (retval); 2371 return (retval);
2379} 2372}
2380 2373
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
index 880e2d9ffe9b..33d56c344944 100644
--- a/drivers/scsi/aic7xxx_old.c
+++ b/drivers/scsi/aic7xxx_old.c
@@ -6514,7 +6514,7 @@ do_aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
6514static void 6514static void
6515aic7xxx_init_transinfo(struct aic7xxx_host *p, struct aic_dev_data *aic_dev) 6515aic7xxx_init_transinfo(struct aic7xxx_host *p, struct aic_dev_data *aic_dev)
6516{ 6516{
6517 Scsi_Device *sdpnt = aic_dev->SDptr; 6517 struct scsi_device *sdpnt = aic_dev->SDptr;
6518 unsigned char tindex; 6518 unsigned char tindex;
6519 6519
6520 tindex = sdpnt->id | (sdpnt->channel << 3); 6520 tindex = sdpnt->id | (sdpnt->channel << 3);
@@ -6581,7 +6581,7 @@ aic7xxx_init_transinfo(struct aic7xxx_host *p, struct aic_dev_data *aic_dev)
6581 * Set up the initial aic_dev struct pointers 6581 * Set up the initial aic_dev struct pointers
6582 *-F*************************************************************************/ 6582 *-F*************************************************************************/
6583static int 6583static int
6584aic7xxx_slave_alloc(Scsi_Device *SDptr) 6584aic7xxx_slave_alloc(struct scsi_device *SDptr)
6585{ 6585{
6586 struct aic7xxx_host *p = (struct aic7xxx_host *)SDptr->host->hostdata; 6586 struct aic7xxx_host *p = (struct aic7xxx_host *)SDptr->host->hostdata;
6587 struct aic_dev_data *aic_dev; 6587 struct aic_dev_data *aic_dev;
@@ -6644,7 +6644,7 @@ aic7xxx_slave_alloc(Scsi_Device *SDptr)
6644 * queueing to be [en|dis]abled for a specific adapter. 6644 * queueing to be [en|dis]abled for a specific adapter.
6645 *-F*************************************************************************/ 6645 *-F*************************************************************************/
6646static void 6646static void
6647aic7xxx_device_queue_depth(struct aic7xxx_host *p, Scsi_Device *device) 6647aic7xxx_device_queue_depth(struct aic7xxx_host *p, struct scsi_device *device)
6648{ 6648{
6649 int tag_enabled = FALSE; 6649 int tag_enabled = FALSE;
6650 struct aic_dev_data *aic_dev = device->hostdata; 6650 struct aic_dev_data *aic_dev = device->hostdata;
@@ -6734,7 +6734,7 @@ aic7xxx_device_queue_depth(struct aic7xxx_host *p, Scsi_Device *device)
6734 * prepare for this device to go away 6734 * prepare for this device to go away
6735 *-F*************************************************************************/ 6735 *-F*************************************************************************/
6736static void 6736static void
6737aic7xxx_slave_destroy(Scsi_Device *SDptr) 6737aic7xxx_slave_destroy(struct scsi_device *SDptr)
6738{ 6738{
6739 struct aic_dev_data *aic_dev = SDptr->hostdata; 6739 struct aic_dev_data *aic_dev = SDptr->hostdata;
6740 6740
@@ -6754,7 +6754,7 @@ aic7xxx_slave_destroy(Scsi_Device *SDptr)
6754 * depths, allocate command structs, etc. 6754 * depths, allocate command structs, etc.
6755 *-F*************************************************************************/ 6755 *-F*************************************************************************/
6756static int 6756static int
6757aic7xxx_slave_configure(Scsi_Device *SDptr) 6757aic7xxx_slave_configure(struct scsi_device *SDptr)
6758{ 6758{
6759 struct aic7xxx_host *p = (struct aic7xxx_host *) SDptr->host->hostdata; 6759 struct aic7xxx_host *p = (struct aic7xxx_host *) SDptr->host->hostdata;
6760 struct aic_dev_data *aic_dev; 6760 struct aic_dev_data *aic_dev;
@@ -7865,7 +7865,7 @@ detect_maxscb(struct aic7xxx_host *p)
7865 * Register a Adaptec aic7xxx chip SCSI controller with the kernel. 7865 * Register a Adaptec aic7xxx chip SCSI controller with the kernel.
7866 *-F*************************************************************************/ 7866 *-F*************************************************************************/
7867static int 7867static int
7868aic7xxx_register(Scsi_Host_Template *template, struct aic7xxx_host *p, 7868aic7xxx_register(struct scsi_host_template *template, struct aic7xxx_host *p,
7869 int reset_delay) 7869 int reset_delay)
7870{ 7870{
7871 int i, result; 7871 int i, result;
@@ -8412,7 +8412,7 @@ aic7xxx_chip_reset(struct aic7xxx_host *p)
8412 * and a pointer to a aic7xxx_host struct upon success. 8412 * and a pointer to a aic7xxx_host struct upon success.
8413 *-F*************************************************************************/ 8413 *-F*************************************************************************/
8414static struct aic7xxx_host * 8414static struct aic7xxx_host *
8415aic7xxx_alloc(Scsi_Host_Template *sht, struct aic7xxx_host *temp) 8415aic7xxx_alloc(struct scsi_host_template *sht, struct aic7xxx_host *temp)
8416{ 8416{
8417 struct aic7xxx_host *p = NULL; 8417 struct aic7xxx_host *p = NULL;
8418 struct Scsi_Host *host; 8418 struct Scsi_Host *host;
@@ -8991,7 +8991,7 @@ aic7xxx_configure_bugs(struct aic7xxx_host *p)
8991 * mid-level SCSI code is overhauled. 8991 * mid-level SCSI code is overhauled.
8992 *-F*************************************************************************/ 8992 *-F*************************************************************************/
8993static int 8993static int
8994aic7xxx_detect(Scsi_Host_Template *template) 8994aic7xxx_detect(struct scsi_host_template *template)
8995{ 8995{
8996 struct aic7xxx_host *temp_p = NULL; 8996 struct aic7xxx_host *temp_p = NULL;
8997 struct aic7xxx_host *current_p = NULL; 8997 struct aic7xxx_host *current_p = NULL;
@@ -11161,7 +11161,7 @@ MODULE_LICENSE("Dual BSD/GPL");
11161MODULE_VERSION(AIC7XXX_H_VERSION); 11161MODULE_VERSION(AIC7XXX_H_VERSION);
11162 11162
11163 11163
11164static Scsi_Host_Template driver_template = { 11164static struct scsi_host_template driver_template = {
11165 .proc_info = aic7xxx_proc_info, 11165 .proc_info = aic7xxx_proc_info,
11166 .detect = aic7xxx_detect, 11166 .detect = aic7xxx_detect,
11167 .release = aic7xxx_release, 11167 .release = aic7xxx_release,
diff --git a/drivers/scsi/amiga7xx.c b/drivers/scsi/amiga7xx.c
index dea8446f5360..c0844fa32c5d 100644
--- a/drivers/scsi/amiga7xx.c
+++ b/drivers/scsi/amiga7xx.c
@@ -29,7 +29,7 @@
29#include "amiga7xx.h" 29#include "amiga7xx.h"
30 30
31 31
32static int amiga7xx_register_one(Scsi_Host_Template *tpnt, 32static int amiga7xx_register_one(struct scsi_host_template *tpnt,
33 unsigned long address) 33 unsigned long address)
34{ 34{
35 long long options; 35 long long options;
@@ -65,7 +65,7 @@ static struct {
65 { 0 } 65 { 0 }
66}; 66};
67 67
68static int __init amiga7xx_zorro_detect(Scsi_Host_Template *tpnt) 68static int __init amiga7xx_zorro_detect(struct scsi_host_template *tpnt)
69{ 69{
70 int num = 0, i; 70 int num = 0, i;
71 struct zorro_dev *z = NULL; 71 struct zorro_dev *z = NULL;
@@ -89,7 +89,7 @@ static int __init amiga7xx_zorro_detect(Scsi_Host_Template *tpnt)
89#endif /* CONFIG_ZORRO */ 89#endif /* CONFIG_ZORRO */
90 90
91 91
92int __init amiga7xx_detect(Scsi_Host_Template *tpnt) 92int __init amiga7xx_detect(struct scsi_host_template *tpnt)
93{ 93{
94 static unsigned char called = 0; 94 static unsigned char called = 0;
95 int num = 0; 95 int num = 0;
@@ -122,7 +122,7 @@ static int amiga7xx_release(struct Scsi_Host *shost)
122 return 0; 122 return 0;
123} 123}
124 124
125static Scsi_Host_Template driver_template = { 125static struct scsi_host_template driver_template = {
126 .name = "Amiga NCR53c710 SCSI", 126 .name = "Amiga NCR53c710 SCSI",
127 .detect = amiga7xx_detect, 127 .detect = amiga7xx_detect,
128 .release = amiga7xx_release, 128 .release = amiga7xx_release,
diff --git a/drivers/scsi/amiga7xx.h b/drivers/scsi/amiga7xx.h
index 8cc54a5b889e..1b637592d5ae 100644
--- a/drivers/scsi/amiga7xx.h
+++ b/drivers/scsi/amiga7xx.h
@@ -2,7 +2,7 @@
2 2
3#include <linux/types.h> 3#include <linux/types.h>
4 4
5int amiga7xx_detect(Scsi_Host_Template *); 5int amiga7xx_detect(struct scsi_host_template *);
6const char *NCR53c7x0_info(void); 6const char *NCR53c7x0_info(void);
7int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 7int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
8int NCR53c7xx_abort(Scsi_Cmnd *); 8int NCR53c7xx_abort(Scsi_Cmnd *);
diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c
index be2caecbbdd9..b7b20c689c24 100644
--- a/drivers/scsi/arm/acornscsi.c
+++ b/drivers/scsi/arm/acornscsi.c
@@ -896,7 +896,7 @@ void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result)
896 * Notes : this will only be one SG entry or less 896 * Notes : this will only be one SG entry or less
897 */ 897 */
898static 898static
899void acornscsi_data_updateptr(AS_Host *host, Scsi_Pointer *SCp, unsigned int length) 899void acornscsi_data_updateptr(AS_Host *host, struct scsi_pointer *SCp, unsigned int length)
900{ 900{
901 SCp->ptr += length; 901 SCp->ptr += length;
902 SCp->this_residual -= length; 902 SCp->this_residual -= length;
@@ -2862,7 +2862,7 @@ int acornscsi_proc_info(struct Scsi_Host *instance, char *buffer, char **start,
2862 int length, int inout) 2862 int length, int inout)
2863{ 2863{
2864 int pos, begin = 0, devidx; 2864 int pos, begin = 0, devidx;
2865 Scsi_Device *scd; 2865 struct scsi_device *scd;
2866 AS_Host *host; 2866 AS_Host *host;
2867 char *p = buffer; 2867 char *p = buffer;
2868 2868
@@ -2971,7 +2971,7 @@ int acornscsi_proc_info(struct Scsi_Host *instance, char *buffer, char **start,
2971 return pos; 2971 return pos;
2972} 2972}
2973 2973
2974static Scsi_Host_Template acornscsi_template = { 2974static struct scsi_host_template acornscsi_template = {
2975 .module = THIS_MODULE, 2975 .module = THIS_MODULE,
2976 .proc_info = acornscsi_proc_info, 2976 .proc_info = acornscsi_proc_info,
2977 .name = "AcornSCSI", 2977 .name = "AcornSCSI",
diff --git a/drivers/scsi/arm/acornscsi.h b/drivers/scsi/arm/acornscsi.h
index 03881f091645..2142290f8404 100644
--- a/drivers/scsi/arm/acornscsi.h
+++ b/drivers/scsi/arm/acornscsi.h
@@ -292,7 +292,7 @@ typedef struct acornscsi_hostdata {
292 unsigned char tag; /* reconnected tag */ 292 unsigned char tag; /* reconnected tag */
293 } reconnected; 293 } reconnected;
294 294
295 Scsi_Pointer SCp; /* current commands data pointer */ 295 struct scsi_pointer SCp; /* current commands data pointer */
296 296
297 MsgQueue_t msgs; 297 MsgQueue_t msgs;
298 298
diff --git a/drivers/scsi/arm/arxescsi.c b/drivers/scsi/arm/arxescsi.c
index 29811f5891ee..804125e35fc3 100644
--- a/drivers/scsi/arm/arxescsi.c
+++ b/drivers/scsi/arm/arxescsi.c
@@ -65,7 +65,7 @@ struct arxescsi_info {
65 * Returns : 0 if we should not set CMD_WITHDMA for transfer info command 65 * Returns : 0 if we should not set CMD_WITHDMA for transfer info command
66 */ 66 */
67static fasdmatype_t 67static fasdmatype_t
68arxescsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, 68arxescsi_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
69 fasdmadir_t direction, fasdmatype_t min_type) 69 fasdmadir_t direction, fasdmatype_t min_type)
70{ 70{
71 /* 71 /*
@@ -111,7 +111,7 @@ static void arxescsi_pseudo_dma_write(unsigned char *addr, void __iomem *base)
111 * transfer - minimum number of bytes we expect to transfer 111 * transfer - minimum number of bytes we expect to transfer
112 */ 112 */
113static void 113static void
114arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, 114arxescsi_dma_pseudo(struct Scsi_Host *host, struct scsi_pointer *SCp,
115 fasdmadir_t direction, int transfer) 115 fasdmadir_t direction, int transfer)
116{ 116{
117 struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata; 117 struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata;
@@ -197,7 +197,7 @@ arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
197 * Params : host - host 197 * Params : host - host
198 * SCpnt - command 198 * SCpnt - command
199 */ 199 */
200static void arxescsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) 200static void arxescsi_dma_stop(struct Scsi_Host *host, struct scsi_pointer *SCp)
201{ 201{
202 /* 202 /*
203 * no DMA to stop 203 * no DMA to stop
@@ -261,7 +261,7 @@ arxescsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t off
261 return pos; 261 return pos;
262} 262}
263 263
264static Scsi_Host_Template arxescsi_template = { 264static struct scsi_host_template arxescsi_template = {
265 .proc_info = arxescsi_proc_info, 265 .proc_info = arxescsi_proc_info,
266 .name = "ARXE SCSI card", 266 .name = "ARXE SCSI card",
267 .info = arxescsi_info, 267 .info = arxescsi_info,
diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c
index 26498553a7cc..81e266be26d0 100644
--- a/drivers/scsi/arm/cumana_1.c
+++ b/drivers/scsi/arm/cumana_1.c
@@ -238,7 +238,7 @@ static void cumanascsi_write(struct Scsi_Host *instance, int reg, int value)
238 238
239#include "../NCR5380.c" 239#include "../NCR5380.c"
240 240
241static Scsi_Host_Template cumanascsi_template = { 241static struct scsi_host_template cumanascsi_template = {
242 .module = THIS_MODULE, 242 .module = THIS_MODULE,
243 .name = "Cumana 16-bit SCSI", 243 .name = "Cumana 16-bit SCSI",
244 .info = cumanascsi_info, 244 .info = cumanascsi_info,
diff --git a/drivers/scsi/arm/cumana_2.c b/drivers/scsi/arm/cumana_2.c
index 0ef0644eeb29..3a7a46b0dc41 100644
--- a/drivers/scsi/arm/cumana_2.c
+++ b/drivers/scsi/arm/cumana_2.c
@@ -157,7 +157,7 @@ cumanascsi_2_intr(int irq, void *dev_id, struct pt_regs *regs)
157 * Returns : type of transfer to be performed 157 * Returns : type of transfer to be performed
158 */ 158 */
159static fasdmatype_t 159static fasdmatype_t
160cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, 160cumanascsi_2_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
161 fasdmadir_t direction, fasdmatype_t min_type) 161 fasdmadir_t direction, fasdmatype_t min_type)
162{ 162{
163 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; 163 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
@@ -209,7 +209,7 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
209 * transfer - minimum number of bytes we expect to transfer 209 * transfer - minimum number of bytes we expect to transfer
210 */ 210 */
211static void 211static void
212cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, 212cumanascsi_2_dma_pseudo(struct Scsi_Host *host, struct scsi_pointer *SCp,
213 fasdmadir_t direction, int transfer) 213 fasdmadir_t direction, int transfer)
214{ 214{
215 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; 215 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
@@ -283,7 +283,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
283 * SCpnt - command 283 * SCpnt - command
284 */ 284 */
285static void 285static void
286cumanascsi_2_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) 286cumanascsi_2_dma_stop(struct Scsi_Host *host, struct scsi_pointer *SCp)
287{ 287{
288 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; 288 struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
289 if (info->info.scsi.dma != NO_DMA) { 289 if (info->info.scsi.dma != NO_DMA) {
@@ -381,7 +381,7 @@ int cumanascsi_2_proc_info (struct Scsi_Host *host, char *buffer, char **start,
381 return pos; 381 return pos;
382} 382}
383 383
384static Scsi_Host_Template cumanascsi2_template = { 384static struct scsi_host_template cumanascsi2_template = {
385 .module = THIS_MODULE, 385 .module = THIS_MODULE,
386 .proc_info = cumanascsi_2_proc_info, 386 .proc_info = cumanascsi_2_proc_info,
387 .name = "Cumana SCSI II", 387 .name = "Cumana SCSI II",
diff --git a/drivers/scsi/arm/ecoscsi.c b/drivers/scsi/arm/ecoscsi.c
index f8a7fdd3c465..6adcccbf444b 100644
--- a/drivers/scsi/arm/ecoscsi.c
+++ b/drivers/scsi/arm/ecoscsi.c
@@ -155,7 +155,7 @@ printk("reading %p len %d\n",addr, len);
155 155
156#include "../NCR5380.c" 156#include "../NCR5380.c"
157 157
158static Scsi_Host_Template ecoscsi_template = { 158static struct scsi_host_template ecoscsi_template = {
159 .module = THIS_MODULE, 159 .module = THIS_MODULE,
160 .name = "Serial Port EcoSCSI NCR5380", 160 .name = "Serial Port EcoSCSI NCR5380",
161 .proc_name = "ecoscsi", 161 .proc_name = "ecoscsi",
diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c
index ce711f166cfb..4d1e8f52c924 100644
--- a/drivers/scsi/arm/eesox.c
+++ b/drivers/scsi/arm/eesox.c
@@ -158,7 +158,7 @@ eesoxscsi_intr(int irq, void *dev_id, struct pt_regs *regs)
158 * Returns : type of transfer to be performed 158 * Returns : type of transfer to be performed
159 */ 159 */
160static fasdmatype_t 160static fasdmatype_t
161eesoxscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, 161eesoxscsi_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
162 fasdmadir_t direction, fasdmatype_t min_type) 162 fasdmadir_t direction, fasdmatype_t min_type)
163{ 163{
164 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; 164 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
@@ -353,7 +353,7 @@ static void eesoxscsi_buffer_out(void *buf, int length, void __iomem *base)
353} 353}
354 354
355static void 355static void
356eesoxscsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, 356eesoxscsi_dma_pseudo(struct Scsi_Host *host, struct scsi_pointer *SCp,
357 fasdmadir_t dir, int transfer_size) 357 fasdmadir_t dir, int transfer_size)
358{ 358{
359 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; 359 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
@@ -370,7 +370,7 @@ eesoxscsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
370 * SCpnt - command 370 * SCpnt - command
371 */ 371 */
372static void 372static void
373eesoxscsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) 373eesoxscsi_dma_stop(struct Scsi_Host *host, struct scsi_pointer *SCp)
374{ 374{
375 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; 375 struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
376 if (info->info.scsi.dma != NO_DMA) 376 if (info->info.scsi.dma != NO_DMA)
@@ -499,7 +499,7 @@ static ssize_t eesoxscsi_store_term(struct device *dev, struct device_attribute
499static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR, 499static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR,
500 eesoxscsi_show_term, eesoxscsi_store_term); 500 eesoxscsi_show_term, eesoxscsi_store_term);
501 501
502static Scsi_Host_Template eesox_template = { 502static struct scsi_host_template eesox_template = {
503 .module = THIS_MODULE, 503 .module = THIS_MODULE,
504 .proc_info = eesoxscsi_proc_info, 504 .proc_info = eesoxscsi_proc_info,
505 .name = "EESOX SCSI", 505 .name = "EESOX SCSI",
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index 4772fb317f3e..3e1053f111dc 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -173,7 +173,7 @@ static void fas216_dumpstate(FAS216_Info *info)
173 fas216_readb(info, REG_CTCH)); 173 fas216_readb(info, REG_CTCH));
174} 174}
175 175
176static void print_SCp(Scsi_Pointer *SCp, const char *prefix, const char *suffix) 176static void print_SCp(struct scsi_pointer *SCp, const char *prefix, const char *suffix)
177{ 177{
178 printk("%sptr %p this_residual 0x%x buffer %p buffers_residual 0x%x%s", 178 printk("%sptr %p this_residual 0x%x buffer %p buffers_residual 0x%x%s",
179 prefix, SCp->ptr, SCp->this_residual, SCp->buffer, 179 prefix, SCp->ptr, SCp->this_residual, SCp->buffer,
@@ -628,7 +628,7 @@ static void fas216_handlesync(FAS216_Info *info, char *msg)
628 */ 628 */
629static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred) 629static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred)
630{ 630{
631 Scsi_Pointer *SCp = &info->scsi.SCp; 631 struct scsi_pointer *SCp = &info->scsi.SCp;
632 632
633 fas216_checkmagic(info); 633 fas216_checkmagic(info);
634 634
@@ -668,7 +668,7 @@ static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred)
668 */ 668 */
669static void fas216_pio(FAS216_Info *info, fasdmadir_t direction) 669static void fas216_pio(FAS216_Info *info, fasdmadir_t direction)
670{ 670{
671 Scsi_Pointer *SCp = &info->scsi.SCp; 671 struct scsi_pointer *SCp = &info->scsi.SCp;
672 672
673 fas216_checkmagic(info); 673 fas216_checkmagic(info);
674 674
@@ -2559,7 +2559,7 @@ int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt)
2559{ 2559{
2560 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2560 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
2561 unsigned long flags; 2561 unsigned long flags;
2562 Scsi_Device *SDpnt; 2562 struct scsi_device *SDpnt;
2563 2563
2564 fas216_checkmagic(info); 2564 fas216_checkmagic(info);
2565 fas216_log(info, LOG_ERROR, "resetting bus"); 2565 fas216_log(info, LOG_ERROR, "resetting bus");
@@ -3000,7 +3000,7 @@ int fas216_print_stats(FAS216_Info *info, char *buffer)
3000int fas216_print_devices(FAS216_Info *info, char *buffer) 3000int fas216_print_devices(FAS216_Info *info, char *buffer)
3001{ 3001{
3002 struct fas216_device *dev; 3002 struct fas216_device *dev;
3003 Scsi_Device *scd; 3003 struct scsi_device *scd;
3004 char *p = buffer; 3004 char *p = buffer;
3005 3005
3006 p += sprintf(p, "Device/Lun TaggedQ Parity Sync\n"); 3006 p += sprintf(p, "Device/Lun TaggedQ Parity Sync\n");
diff --git a/drivers/scsi/arm/fas216.h b/drivers/scsi/arm/fas216.h
index 60a2a120205b..540914d6fd32 100644
--- a/drivers/scsi/arm/fas216.h
+++ b/drivers/scsi/arm/fas216.h
@@ -243,7 +243,7 @@ typedef struct {
243 unsigned int irq; /* interrupt */ 243 unsigned int irq; /* interrupt */
244 int dma; /* dma channel */ 244 int dma; /* dma channel */
245 245
246 Scsi_Pointer SCp; /* current commands data pointer */ 246 struct scsi_pointer SCp; /* current commands data pointer */
247 247
248 MsgQueue_t msgs; /* message queue for connected device */ 248 MsgQueue_t msgs; /* message queue for connected device */
249 249
@@ -304,9 +304,9 @@ typedef struct {
304 /* dma */ 304 /* dma */
305 struct { 305 struct {
306 fasdmatype_t transfer_type; /* current type of DMA transfer */ 306 fasdmatype_t transfer_type; /* current type of DMA transfer */
307 fasdmatype_t (*setup) (struct Scsi_Host *host, Scsi_Pointer *SCp, fasdmadir_t direction, fasdmatype_t min_dma); 307 fasdmatype_t (*setup) (struct Scsi_Host *host, struct scsi_pointer *SCp, fasdmadir_t direction, fasdmatype_t min_dma);
308 void (*pseudo)(struct Scsi_Host *host, Scsi_Pointer *SCp, fasdmadir_t direction, int transfer); 308 void (*pseudo)(struct Scsi_Host *host, struct scsi_pointer *SCp, fasdmadir_t direction, int transfer);
309 void (*stop) (struct Scsi_Host *host, Scsi_Pointer *SCp); 309 void (*stop) (struct Scsi_Host *host, struct scsi_pointer *SCp);
310 } dma; 310 } dma;
311 311
312 /* miscellaneous */ 312 /* miscellaneous */
diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c
index de24bb991f1d..d806b024c3bd 100644
--- a/drivers/scsi/arm/oak.c
+++ b/drivers/scsi/arm/oak.c
@@ -111,7 +111,7 @@ printk("reading %p len %d\n", addr, len);
111 111
112#include "../NCR5380.c" 112#include "../NCR5380.c"
113 113
114static Scsi_Host_Template oakscsi_template = { 114static struct scsi_host_template oakscsi_template = {
115 .module = THIS_MODULE, 115 .module = THIS_MODULE,
116 .proc_info = oakscsi_proc_info, 116 .proc_info = oakscsi_proc_info,
117 .name = "Oak 16-bit SCSI", 117 .name = "Oak 16-bit SCSI",
diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c
index abda216113f1..3333d7b39139 100644
--- a/drivers/scsi/arm/powertec.c
+++ b/drivers/scsi/arm/powertec.c
@@ -132,7 +132,7 @@ powertecscsi_intr(int irq, void *dev_id, struct pt_regs *regs)
132 * Returns : type of transfer to be performed 132 * Returns : type of transfer to be performed
133 */ 133 */
134static fasdmatype_t 134static fasdmatype_t
135powertecscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, 135powertecscsi_dma_setup(struct Scsi_Host *host, struct scsi_pointer *SCp,
136 fasdmadir_t direction, fasdmatype_t min_type) 136 fasdmadir_t direction, fasdmatype_t min_type)
137{ 137{
138 struct powertec_info *info = (struct powertec_info *)host->hostdata; 138 struct powertec_info *info = (struct powertec_info *)host->hostdata;
@@ -174,7 +174,7 @@ powertecscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
174 * SCpnt - command 174 * SCpnt - command
175 */ 175 */
176static void 176static void
177powertecscsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) 177powertecscsi_dma_stop(struct Scsi_Host *host, struct scsi_pointer *SCp)
178{ 178{
179 struct powertec_info *info = (struct powertec_info *)host->hostdata; 179 struct powertec_info *info = (struct powertec_info *)host->hostdata;
180 if (info->info.scsi.dma != NO_DMA) 180 if (info->info.scsi.dma != NO_DMA)
@@ -293,7 +293,7 @@ powertecscsi_store_term(struct device *dev, struct device_attribute *attr, const
293static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR, 293static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR,
294 powertecscsi_show_term, powertecscsi_store_term); 294 powertecscsi_show_term, powertecscsi_store_term);
295 295
296static Scsi_Host_Template powertecscsi_template = { 296static struct scsi_host_template powertecscsi_template = {
297 .module = THIS_MODULE, 297 .module = THIS_MODULE,
298 .proc_info = powertecscsi_proc_info, 298 .proc_info = powertecscsi_proc_info,
299 .name = "PowerTec SCSI", 299 .name = "PowerTec SCSI",
diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
index 19937640e2e7..6dd544a5eb56 100644
--- a/drivers/scsi/arm/scsi.h
+++ b/drivers/scsi/arm/scsi.h
@@ -18,7 +18,7 @@
18 * The scatter-gather list handling. This contains all 18 * The scatter-gather list handling. This contains all
19 * the yucky stuff that needs to be fixed properly. 19 * the yucky stuff that needs to be fixed properly.
20 */ 20 */
21static inline int copy_SCp_to_sg(struct scatterlist *sg, Scsi_Pointer *SCp, int max) 21static inline int copy_SCp_to_sg(struct scatterlist *sg, struct scsi_pointer *SCp, int max)
22{ 22{
23 int bufs = SCp->buffers_residual; 23 int bufs = SCp->buffers_residual;
24 24
@@ -32,7 +32,7 @@ static inline int copy_SCp_to_sg(struct scatterlist *sg, Scsi_Pointer *SCp, int
32 return bufs + 1; 32 return bufs + 1;
33} 33}
34 34
35static inline int next_SCp(Scsi_Pointer *SCp) 35static inline int next_SCp(struct scsi_pointer *SCp)
36{ 36{
37 int ret = SCp->buffers_residual; 37 int ret = SCp->buffers_residual;
38 if (ret) { 38 if (ret) {
@@ -49,7 +49,7 @@ static inline int next_SCp(Scsi_Pointer *SCp)
49 return ret; 49 return ret;
50} 50}
51 51
52static inline unsigned char get_next_SCp_byte(Scsi_Pointer *SCp) 52static inline unsigned char get_next_SCp_byte(struct scsi_pointer *SCp)
53{ 53{
54 char c = *SCp->ptr; 54 char c = *SCp->ptr;
55 55
@@ -59,7 +59,7 @@ static inline unsigned char get_next_SCp_byte(Scsi_Pointer *SCp)
59 return c; 59 return c;
60} 60}
61 61
62static inline void put_next_SCp_byte(Scsi_Pointer *SCp, unsigned char c) 62static inline void put_next_SCp_byte(struct scsi_pointer *SCp, unsigned char c)
63{ 63{
64 *SCp->ptr = c; 64 *SCp->ptr = c;
65 SCp->ptr += 1; 65 SCp->ptr += 1;
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index 2c12be72c4c6..2ae31ceb32a8 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -255,7 +255,7 @@
255 */ 255 */
256 256
257static struct Scsi_Host *first_instance = NULL; 257static struct Scsi_Host *first_instance = NULL;
258static Scsi_Host_Template *the_template = NULL; 258static struct scsi_host_template *the_template = NULL;
259 259
260/* Macros ease life... :-) */ 260/* Macros ease life... :-) */
261#define SETUP_HOSTDATA(in) \ 261#define SETUP_HOSTDATA(in) \
diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c
index af8adb629b33..f4c1ca7c1572 100644
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -600,7 +600,7 @@ int atari_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
600#endif 600#endif
601 601
602 602
603int atari_scsi_detect (Scsi_Host_Template *host) 603int atari_scsi_detect (struct scsi_host_template *host)
604{ 604{
605 static int called = 0; 605 static int called = 0;
606 struct Scsi_Host *instance; 606 struct Scsi_Host *instance;
@@ -1141,7 +1141,7 @@ static void atari_scsi_falcon_reg_write( unsigned char reg, unsigned char value
1141 1141
1142#include "atari_NCR5380.c" 1142#include "atari_NCR5380.c"
1143 1143
1144static Scsi_Host_Template driver_template = { 1144static struct scsi_host_template driver_template = {
1145 .proc_info = atari_scsi_proc_info, 1145 .proc_info = atari_scsi_proc_info,
1146 .name = "Atari native SCSI", 1146 .name = "Atari native SCSI",
1147 .detect = atari_scsi_detect, 1147 .detect = atari_scsi_detect,
diff --git a/drivers/scsi/atari_scsi.h b/drivers/scsi/atari_scsi.h
index cc1256988841..f917bdd09b41 100644
--- a/drivers/scsi/atari_scsi.h
+++ b/drivers/scsi/atari_scsi.h
@@ -18,7 +18,7 @@
18/* (I_HAVE_OVERRUNS stuff removed) */ 18/* (I_HAVE_OVERRUNS stuff removed) */
19 19
20#ifndef ASM 20#ifndef ASM
21int atari_scsi_detect (Scsi_Host_Template *); 21int atari_scsi_detect (struct scsi_host_template *);
22const char *atari_scsi_info (struct Scsi_Host *); 22const char *atari_scsi_info (struct Scsi_Host *);
23int atari_scsi_reset (Scsi_Cmnd *, unsigned int); 23int atari_scsi_reset (Scsi_Cmnd *, unsigned int);
24#ifdef MODULE 24#ifdef MODULE
diff --git a/drivers/scsi/blz1230.c b/drivers/scsi/blz1230.c
index 4cd9fcf4dc50..763e409a1ff3 100644
--- a/drivers/scsi/blz1230.c
+++ b/drivers/scsi/blz1230.c
@@ -94,7 +94,7 @@ static volatile unsigned char cmd_buffer[16];
94 */ 94 */
95 95
96/***************************************************************** Detection */ 96/***************************************************************** Detection */
97int __init blz1230_esp_detect(Scsi_Host_Template *tpnt) 97int __init blz1230_esp_detect(struct scsi_host_template *tpnt)
98{ 98{
99 struct NCR_ESP *esp; 99 struct NCR_ESP *esp;
100 struct zorro_dev *z = NULL; 100 struct zorro_dev *z = NULL;
@@ -328,7 +328,7 @@ int blz1230_esp_release(struct Scsi_Host *instance)
328} 328}
329 329
330 330
331static Scsi_Host_Template driver_template = { 331static struct scsi_host_template driver_template = {
332 .proc_name = "esp-blz1230", 332 .proc_name = "esp-blz1230",
333 .proc_info = esp_proc_info, 333 .proc_info = esp_proc_info,
334 .name = "Blizzard1230 SCSI IV", 334 .name = "Blizzard1230 SCSI IV",
diff --git a/drivers/scsi/blz2060.c b/drivers/scsi/blz2060.c
index c5221d0de5ca..d72d05fffdfa 100644
--- a/drivers/scsi/blz2060.c
+++ b/drivers/scsi/blz2060.c
@@ -90,7 +90,7 @@ static volatile unsigned char cmd_buffer[16];
90 */ 90 */
91 91
92/***************************************************************** Detection */ 92/***************************************************************** Detection */
93int __init blz2060_esp_detect(Scsi_Host_Template *tpnt) 93int __init blz2060_esp_detect(struct scsi_host_template *tpnt)
94{ 94{
95 struct NCR_ESP *esp; 95 struct NCR_ESP *esp;
96 struct zorro_dev *z = NULL; 96 struct zorro_dev *z = NULL;
@@ -282,7 +282,7 @@ int blz2060_esp_release(struct Scsi_Host *instance)
282} 282}
283 283
284 284
285static Scsi_Host_Template driver_template = { 285static struct scsi_host_template driver_template = {
286 .proc_name = "esp-blz2060", 286 .proc_name = "esp-blz2060",
287 .proc_info = esp_proc_info, 287 .proc_info = esp_proc_info,
288 .name = "Blizzard2060 SCSI", 288 .name = "Blizzard2060 SCSI",
diff --git a/drivers/scsi/bvme6000.c b/drivers/scsi/bvme6000.c
index 130f30f51a9b..2958b8c2bfb7 100644
--- a/drivers/scsi/bvme6000.c
+++ b/drivers/scsi/bvme6000.c
@@ -23,7 +23,7 @@
23#include<linux/stat.h> 23#include<linux/stat.h>
24 24
25 25
26int bvme6000_scsi_detect(Scsi_Host_Template *tpnt) 26int bvme6000_scsi_detect(struct scsi_host_template *tpnt)
27{ 27{
28 static unsigned char called = 0; 28 static unsigned char called = 0;
29 int clock; 29 int clock;
@@ -59,7 +59,7 @@ static int bvme6000_scsi_release(struct Scsi_Host *shost)
59 return 0; 59 return 0;
60} 60}
61 61
62static Scsi_Host_Template driver_template = { 62static struct scsi_host_template driver_template = {
63 .name = "BVME6000 NCR53c710 SCSI", 63 .name = "BVME6000 NCR53c710 SCSI",
64 .detect = bvme6000_scsi_detect, 64 .detect = bvme6000_scsi_detect,
65 .release = bvme6000_scsi_release, 65 .release = bvme6000_scsi_release,
diff --git a/drivers/scsi/bvme6000.h b/drivers/scsi/bvme6000.h
index 49b6bbb0978e..7c9c0366cc08 100644
--- a/drivers/scsi/bvme6000.h
+++ b/drivers/scsi/bvme6000.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6int bvme6000_scsi_detect(Scsi_Host_Template *); 6int bvme6000_scsi_detect(struct scsi_host_template *);
7const char *NCR53c7x0_info(void); 7const char *NCR53c7x0_info(void);
8int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 8int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
9int NCR53c7xx_abort(Scsi_Cmnd *); 9int NCR53c7xx_abort(Scsi_Cmnd *);
diff --git a/drivers/scsi/cyberstorm.c b/drivers/scsi/cyberstorm.c
index bdbca85d1675..f9b940e56430 100644
--- a/drivers/scsi/cyberstorm.c
+++ b/drivers/scsi/cyberstorm.c
@@ -104,7 +104,7 @@ static volatile unsigned char cmd_buffer[16];
104 */ 104 */
105 105
106/***************************************************************** Detection */ 106/***************************************************************** Detection */
107int __init cyber_esp_detect(Scsi_Host_Template *tpnt) 107int __init cyber_esp_detect(struct scsi_host_template *tpnt)
108{ 108{
109 struct NCR_ESP *esp; 109 struct NCR_ESP *esp;
110 struct zorro_dev *z = NULL; 110 struct zorro_dev *z = NULL;
@@ -353,7 +353,7 @@ int cyber_esp_release(struct Scsi_Host *instance)
353} 353}
354 354
355 355
356static Scsi_Host_Template driver_template = { 356static struct scsi_host_template driver_template = {
357 .proc_name = "esp-cyberstorm", 357 .proc_name = "esp-cyberstorm",
358 .proc_info = esp_proc_info, 358 .proc_info = esp_proc_info,
359 .name = "CyberStorm SCSI", 359 .name = "CyberStorm SCSI",
diff --git a/drivers/scsi/cyberstormII.c b/drivers/scsi/cyberstormII.c
index 845d9259821e..a3caabfd7557 100644
--- a/drivers/scsi/cyberstormII.c
+++ b/drivers/scsi/cyberstormII.c
@@ -81,7 +81,7 @@ static volatile unsigned char cmd_buffer[16];
81 */ 81 */
82 82
83/***************************************************************** Detection */ 83/***************************************************************** Detection */
84int __init cyberII_esp_detect(Scsi_Host_Template *tpnt) 84int __init cyberII_esp_detect(struct scsi_host_template *tpnt)
85{ 85{
86 struct NCR_ESP *esp; 86 struct NCR_ESP *esp;
87 struct zorro_dev *z = NULL; 87 struct zorro_dev *z = NULL;
@@ -290,7 +290,7 @@ int cyberII_esp_release(struct Scsi_Host *instance)
290} 290}
291 291
292 292
293static Scsi_Host_Template driver_template = { 293static struct scsi_host_template driver_template = {
294 .proc_name = "esp-cyberstormII", 294 .proc_name = "esp-cyberstormII",
295 .proc_info = esp_proc_info, 295 .proc_info = esp_proc_info,
296 .name = "CyberStorm Mk II SCSI", 296 .name = "CyberStorm Mk II SCSI",
diff --git a/drivers/scsi/dec_esp.c b/drivers/scsi/dec_esp.c
index 256d6baf8df3..a35ee43a48df 100644
--- a/drivers/scsi/dec_esp.c
+++ b/drivers/scsi/dec_esp.c
@@ -133,7 +133,7 @@ static struct scsi_host_template driver_template = {
133#include "scsi_module.c" 133#include "scsi_module.c"
134 134
135/***************************************************************** Detection */ 135/***************************************************************** Detection */
136static int dec_esp_detect(Scsi_Host_Template * tpnt) 136static int dec_esp_detect(struct scsi_host_template * tpnt)
137{ 137{
138 struct NCR_ESP *esp; 138 struct NCR_ESP *esp;
139 struct ConfigDev *esp_dev; 139 struct ConfigDev *esp_dev;
diff --git a/drivers/scsi/dpti.h b/drivers/scsi/dpti.h
index 489194af43d0..2ad2a89b5db4 100644
--- a/drivers/scsi/dpti.h
+++ b/drivers/scsi/dpti.h
@@ -44,7 +44,7 @@ static int adpt_device_reset(struct scsi_cmnd* cmd);
44 44
45 45
46/* 46/*
47 * Scsi_Host_Template (see hosts.h) 47 * struct scsi_host_template (see hosts.h)
48 */ 48 */
49 49
50#define DPT_DRIVER_NAME "Adaptec I2O RAID" 50#define DPT_DRIVER_NAME "Adaptec I2O RAID"
diff --git a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c
index 897743b23342..310d2f488668 100644
--- a/drivers/scsi/dtc.c
+++ b/drivers/scsi/dtc.c
@@ -199,7 +199,7 @@ static void __init dtc_setup(char *str, int *ints)
199#endif 199#endif
200 200
201/* 201/*
202 * Function : int dtc_detect(Scsi_Host_Template * tpnt) 202 * Function : int dtc_detect(struct scsi_host_template * tpnt)
203 * 203 *
204 * Purpose : detects and initializes DTC 3180/3280 controllers 204 * Purpose : detects and initializes DTC 3180/3280 controllers
205 * that were autoprobed, overridden on the LILO command line, 205 * that were autoprobed, overridden on the LILO command line,
@@ -211,7 +211,7 @@ static void __init dtc_setup(char *str, int *ints)
211 * 211 *
212*/ 212*/
213 213
214static int __init dtc_detect(Scsi_Host_Template * tpnt) 214static int __init dtc_detect(struct scsi_host_template * tpnt)
215{ 215{
216 static int current_override = 0, current_base = 0; 216 static int current_override = 0, current_base = 0;
217 struct Scsi_Host *instance; 217 struct Scsi_Host *instance;
@@ -471,7 +471,7 @@ static int dtc_release(struct Scsi_Host *shost)
471 return 0; 471 return 0;
472} 472}
473 473
474static Scsi_Host_Template driver_template = { 474static struct scsi_host_template driver_template = {
475 .name = "DTC 3180/3280 ", 475 .name = "DTC 3180/3280 ",
476 .detect = dtc_detect, 476 .detect = dtc_detect,
477 .release = dtc_release, 477 .release = dtc_release,
diff --git a/drivers/scsi/dtc.h b/drivers/scsi/dtc.h
index 277cd015ee4e..0b205f8c7326 100644
--- a/drivers/scsi/dtc.h
+++ b/drivers/scsi/dtc.h
@@ -35,7 +35,7 @@
35static int dtc_abort(Scsi_Cmnd *); 35static int dtc_abort(Scsi_Cmnd *);
36static int dtc_biosparam(struct scsi_device *, struct block_device *, 36static int dtc_biosparam(struct scsi_device *, struct block_device *,
37 sector_t, int*); 37 sector_t, int*);
38static int dtc_detect(Scsi_Host_Template *); 38static int dtc_detect(struct scsi_host_template *);
39static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 39static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
40static int dtc_bus_reset(Scsi_Cmnd *); 40static int dtc_bus_reset(Scsi_Cmnd *);
41 41
diff --git a/drivers/scsi/fastlane.c b/drivers/scsi/fastlane.c
index ae47612b3614..ccee68b52f7e 100644
--- a/drivers/scsi/fastlane.c
+++ b/drivers/scsi/fastlane.c
@@ -125,7 +125,7 @@ static inline void dma_clear(struct NCR_ESP *esp)
125} 125}
126 126
127/***************************************************************** Detection */ 127/***************************************************************** Detection */
128int __init fastlane_esp_detect(Scsi_Host_Template *tpnt) 128int __init fastlane_esp_detect(struct scsi_host_template *tpnt)
129{ 129{
130 struct NCR_ESP *esp; 130 struct NCR_ESP *esp;
131 struct zorro_dev *z = NULL; 131 struct zorro_dev *z = NULL;
@@ -398,7 +398,7 @@ int fastlane_esp_release(struct Scsi_Host *instance)
398} 398}
399 399
400 400
401static Scsi_Host_Template driver_template = { 401static struct scsi_host_template driver_template = {
402 .proc_name = "esp-fastlane", 402 .proc_name = "esp-fastlane",
403 .proc_info = esp_proc_info, 403 .proc_info = esp_proc_info,
404 .name = "Fastlane SCSI", 404 .name = "Fastlane SCSI",
diff --git a/drivers/scsi/fcal.c b/drivers/scsi/fcal.c
index a6f120dcdfc3..03416548f20c 100644
--- a/drivers/scsi/fcal.c
+++ b/drivers/scsi/fcal.c
@@ -70,7 +70,7 @@ static unsigned char target2alpa[] = {
70 70
71static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd); 71static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd);
72 72
73int fcal_slave_configure(Scsi_Device *device) 73int fcal_slave_configure(struct scsi_device *device)
74{ 74{
75 int depth_to_use; 75 int depth_to_use;
76 76
@@ -89,7 +89,7 @@ int fcal_slave_configure(Scsi_Device *device)
89 89
90/* Detect all FC Arbitrated Loops attached to the machine. 90/* Detect all FC Arbitrated Loops attached to the machine.
91 fc4 module has done all the work for us... */ 91 fc4 module has done all the work for us... */
92int __init fcal_detect(Scsi_Host_Template *tpnt) 92int __init fcal_detect(struct scsi_host_template *tpnt)
93{ 93{
94 int nfcals = 0; 94 int nfcals = 0;
95 fc_channel *fc; 95 fc_channel *fc;
@@ -244,7 +244,7 @@ int fcal_proc_info (struct Scsi_Host *host, char *buffer, char **start, off_t of
244 SPRINTF (" [AL-PA: %02x, Port WWN: %08x%08x, Node WWN: %08x%08x] Not responded to PRLI\n", 244 SPRINTF (" [AL-PA: %02x, Port WWN: %08x%08x, Node WWN: %08x%08x] Not responded to PRLI\n",
245 alpa, u1[0], u1[1], u2[0], u2[1]); 245 alpa, u1[0], u1[1], u2[0], u2[1]);
246 } else { 246 } else {
247 Scsi_Device *scd; 247 struct scsi_device *scd;
248 shost_for_each_device(scd, host) 248 shost_for_each_device(scd, host)
249 if (scd->id == target) { 249 if (scd->id == target) {
250 SPRINTF (" [AL-PA: %02x, Id: %02d, Port WWN: %08x%08x, Node WWN: %08x%08x] ", 250 SPRINTF (" [AL-PA: %02x, Id: %02d, Port WWN: %08x%08x, Node WWN: %08x%08x] ",
@@ -297,7 +297,7 @@ static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmn
297 return 0; 297 return 0;
298} 298}
299 299
300static Scsi_Host_Template driver_template = { 300static struct scsi_host_template driver_template = {
301 .name = "Fibre Channel Arbitrated Loop", 301 .name = "Fibre Channel Arbitrated Loop",
302 .detect = fcal_detect, 302 .detect = fcal_detect,
303 .release = fcal_release, 303 .release = fcal_release,
diff --git a/drivers/scsi/fcal.h b/drivers/scsi/fcal.h
index 21aa32ef9134..7ff2c3494f9e 100644
--- a/drivers/scsi/fcal.h
+++ b/drivers/scsi/fcal.h
@@ -20,8 +20,8 @@ struct fcal {
20 for a particular channel */ 20 for a particular channel */
21#define FCAL_CAN_QUEUE 512 21#define FCAL_CAN_QUEUE 512
22 22
23int fcal_detect(Scsi_Host_Template *); 23int fcal_detect(struct scsi_host_template *);
24int fcal_release(struct Scsi_Host *); 24int fcal_release(struct Scsi_Host *);
25int fcal_slave_configure(Scsi_Device *); 25int fcal_slave_configure(struct scsi_device *);
26 26
27#endif /* !(_FCAL_H) */ 27#endif /* !(_FCAL_H) */
diff --git a/drivers/scsi/fd_mcs.c b/drivers/scsi/fd_mcs.c
index 6d44602aae78..cca485a2b438 100644
--- a/drivers/scsi/fd_mcs.c
+++ b/drivers/scsi/fd_mcs.c
@@ -343,7 +343,7 @@ static void fd_mcs_make_bus_idle(struct Scsi_Host *shpnt)
343 outb(0x01 | PARITY_MASK, TMC_Cntl_port); 343 outb(0x01 | PARITY_MASK, TMC_Cntl_port);
344} 344}
345 345
346static int fd_mcs_detect(Scsi_Host_Template * tpnt) 346static int fd_mcs_detect(struct scsi_host_template * tpnt)
347{ 347{
348 int loop; 348 int loop;
349 struct Scsi_Host *shpnt; 349 struct Scsi_Host *shpnt;
@@ -1343,7 +1343,7 @@ static int fd_mcs_biosparam(struct scsi_device * disk, struct block_device *bdev
1343 return 0; 1343 return 0;
1344} 1344}
1345 1345
1346static Scsi_Host_Template driver_template = { 1346static struct scsi_host_template driver_template = {
1347 .proc_name = "fd_mcs", 1347 .proc_name = "fd_mcs",
1348 .proc_info = fd_mcs_proc_info, 1348 .proc_info = fd_mcs_proc_info,
1349 .detect = fd_mcs_detect, 1349 .detect = fd_mcs_detect,
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index a3aa729b9d3c..45756fa90777 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -285,7 +285,7 @@ static int __init do_DTC3181E_setup(char *str)
285 * Locks: none 285 * Locks: none
286 */ 286 */
287 287
288int __init generic_NCR5380_detect(Scsi_Host_Template * tpnt) 288int __init generic_NCR5380_detect(struct scsi_host_template * tpnt)
289{ 289{
290 static int current_override = 0; 290 static int current_override = 0;
291 int count, i; 291 int count, i;
@@ -798,7 +798,7 @@ static int generic_NCR5380_proc_info(struct Scsi_Host *scsi_ptr, char *buffer, c
798 Scsi_Cmnd *ptr; 798 Scsi_Cmnd *ptr;
799 struct NCR5380_hostdata *hostdata; 799 struct NCR5380_hostdata *hostdata;
800#ifdef NCR5380_STATS 800#ifdef NCR5380_STATS
801 Scsi_Device *dev; 801 struct scsi_device *dev;
802 extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; 802 extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
803#endif 803#endif
804 804
@@ -899,7 +899,7 @@ static int generic_NCR5380_proc_info(struct Scsi_Host *scsi_ptr, char *buffer, c
899#undef PRINTP 899#undef PRINTP
900#undef ANDP 900#undef ANDP
901 901
902static Scsi_Host_Template driver_template = { 902static struct scsi_host_template driver_template = {
903 .proc_info = generic_NCR5380_proc_info, 903 .proc_info = generic_NCR5380_proc_info,
904 .name = "Generic NCR5380/NCR53C400 Scsi Driver", 904 .name = "Generic NCR5380/NCR53C400 Scsi Driver",
905 .detect = generic_NCR5380_detect, 905 .detect = generic_NCR5380_detect,
diff --git a/drivers/scsi/g_NCR5380.h b/drivers/scsi/g_NCR5380.h
index c8adc5a94884..656fbe2f91f6 100644
--- a/drivers/scsi/g_NCR5380.h
+++ b/drivers/scsi/g_NCR5380.h
@@ -45,7 +45,7 @@
45 45
46#ifndef ASM 46#ifndef ASM
47static int generic_NCR5380_abort(Scsi_Cmnd *); 47static int generic_NCR5380_abort(Scsi_Cmnd *);
48static int generic_NCR5380_detect(Scsi_Host_Template *); 48static int generic_NCR5380_detect(struct scsi_host_template *);
49static int generic_NCR5380_release_resources(struct Scsi_Host *); 49static int generic_NCR5380_release_resources(struct Scsi_Host *);
50static int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 50static int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
51static int generic_NCR5380_bus_reset(Scsi_Cmnd *); 51static int generic_NCR5380_bus_reset(Scsi_Cmnd *);
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index af682301beac..a6deb016584c 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -94,7 +94,7 @@
94 * Bugfix free_irq() 94 * Bugfix free_irq()
95 * 95 *
96 * Revision 1.56 2001/08/09 11:19:39 achim 96 * Revision 1.56 2001/08/09 11:19:39 achim
97 * Scsi_Host_Template changes 97 * struct scsi_host_template changes
98 * 98 *
99 * Revision 1.55 2001/08/09 10:11:28 achim 99 * Revision 1.55 2001/08/09 10:11:28 achim
100 * Command HOST_UNFREEZE_IO before cache service init. 100 * Command HOST_UNFREEZE_IO before cache service init.
@@ -4153,7 +4153,7 @@ int __init option_setup(char *str)
4153 return 1; 4153 return 1;
4154} 4154}
4155 4155
4156static int __init gdth_detect(Scsi_Host_Template *shtp) 4156static int __init gdth_detect(struct scsi_host_template *shtp)
4157{ 4157{
4158 struct Scsi_Host *shp; 4158 struct Scsi_Host *shp;
4159 gdth_pci_str pcistr[MAXHA]; 4159 gdth_pci_str pcistr[MAXHA];
@@ -5562,7 +5562,7 @@ static void gdth_flush(int hanum)
5562#else 5562#else
5563 Scsi_Cmnd *scp; 5563 Scsi_Cmnd *scp;
5564#endif 5564#endif
5565 Scsi_Device *sdev; 5565 struct scsi_device *sdev;
5566 char cmnd[MAX_COMMAND_SIZE]; 5566 char cmnd[MAX_COMMAND_SIZE];
5567 memset(cmnd, 0xff, MAX_COMMAND_SIZE); 5567 memset(cmnd, 0xff, MAX_COMMAND_SIZE);
5568 5568
@@ -5624,10 +5624,10 @@ static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
5624 gdth_cmd_str gdtcmd; 5624 gdth_cmd_str gdtcmd;
5625#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 5625#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
5626 Scsi_Request *srp; 5626 Scsi_Request *srp;
5627 Scsi_Device *sdev; 5627 struct scsi_device *sdev;
5628#else 5628#else
5629 Scsi_Cmnd *scp; 5629 Scsi_Cmnd *scp;
5630 Scsi_Device *sdev; 5630 struct scsi_device *sdev;
5631#endif 5631#endif
5632 char cmnd[MAX_COMMAND_SIZE]; 5632 char cmnd[MAX_COMMAND_SIZE];
5633#endif 5633#endif
@@ -5683,7 +5683,7 @@ static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
5683 return NOTIFY_OK; 5683 return NOTIFY_OK;
5684} 5684}
5685 5685
5686static Scsi_Host_Template driver_template = { 5686static struct scsi_host_template driver_template = {
5687 .proc_name = "gdth", 5687 .proc_name = "gdth",
5688 .proc_info = gdth_proc_info, 5688 .proc_info = gdth_proc_info,
5689 .name = "GDT SCSI Disk Array Controller", 5689 .name = "GDT SCSI Disk Array Controller",
diff --git a/drivers/scsi/gdth.h b/drivers/scsi/gdth.h
index c0f1e3411524..cc4882fb97ad 100644
--- a/drivers/scsi/gdth.h
+++ b/drivers/scsi/gdth.h
@@ -944,9 +944,9 @@ typedef struct {
944 ulong dma32_cnt, dma64_cnt; /* statistics: DMA buffer */ 944 ulong dma32_cnt, dma64_cnt; /* statistics: DMA buffer */
945#endif 945#endif
946#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) 946#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
947 Scsi_Device *sdev; 947 struct scsi_device *sdev;
948#else 948#else
949 Scsi_Device sdev; 949 struct scsi_device sdev;
950#endif 950#endif
951} gdth_ha_str; 951} gdth_ha_str;
952 952
diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c
index 1bd02f8d1e6a..5e8657f9cdf6 100644
--- a/drivers/scsi/gdth_proc.c
+++ b/drivers/scsi/gdth_proc.c
@@ -54,10 +54,10 @@ static int gdth_set_info(char *buffer,int length,struct Scsi_Host *host,
54 int ret_val = -EINVAL; 54 int ret_val = -EINVAL;
55#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 55#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
56 Scsi_Request *scp; 56 Scsi_Request *scp;
57 Scsi_Device *sdev; 57 struct scsi_device *sdev;
58#else 58#else
59 Scsi_Cmnd *scp; 59 Scsi_Cmnd *scp;
60 Scsi_Device *sdev; 60 struct scsi_device *sdev;
61#endif 61#endif
62 TRACE2(("gdth_set_info() ha %d bus %d\n",hanum,busnum)); 62 TRACE2(("gdth_set_info() ha %d bus %d\n",hanum,busnum));
63 63
@@ -232,10 +232,10 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
232 gdth_evt_str *estr; 232 gdth_evt_str *estr;
233#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 233#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
234 Scsi_Request *scp; 234 Scsi_Request *scp;
235 Scsi_Device *sdev; 235 struct scsi_device *sdev;
236#else 236#else
237 Scsi_Cmnd *scp; 237 Scsi_Cmnd *scp;
238 Scsi_Device *sdev; 238 struct scsi_device *sdev;
239#endif 239#endif
240 char hrec[161]; 240 char hrec[161];
241 struct timeval tv; 241 struct timeval tv;
@@ -275,7 +275,7 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
275 scp->cmd_len = 12; 275 scp->cmd_len = 12;
276 scp->use_sg = 0; 276 scp->use_sg = 0;
277#else 277#else
278 memset(&sdev,0,sizeof(Scsi_Device)); 278 memset(&sdev,0,sizeof(struct scsi_device));
279 memset(&scp, 0,sizeof(Scsi_Cmnd)); 279 memset(&scp, 0,sizeof(Scsi_Cmnd));
280 sdev.host = scp.host = host; 280 sdev.host = scp.host = host;
281 sdev.id = scp.target = sdev.host->this_id; 281 sdev.id = scp.target = sdev.host->this_id;
diff --git a/drivers/scsi/gvp11.c b/drivers/scsi/gvp11.c
index ab22387c9df1..5b154498056d 100644
--- a/drivers/scsi/gvp11.c
+++ b/drivers/scsi/gvp11.c
@@ -169,7 +169,7 @@ static void dma_stop (struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
169 169
170#define CHECK_WD33C93 170#define CHECK_WD33C93
171 171
172int __init gvp11_detect(Scsi_Host_Template *tpnt) 172int __init gvp11_detect(struct scsi_host_template *tpnt)
173{ 173{
174 static unsigned char called = 0; 174 static unsigned char called = 0;
175 struct Scsi_Host *instance; 175 struct Scsi_Host *instance;
@@ -361,7 +361,7 @@ static int gvp11_bus_reset(Scsi_Cmnd *cmd)
361 361
362#include "gvp11.h" 362#include "gvp11.h"
363 363
364static Scsi_Host_Template driver_template = { 364static struct scsi_host_template driver_template = {
365 .proc_name = "GVP11", 365 .proc_name = "GVP11",
366 .name = "GVP Series II SCSI", 366 .name = "GVP Series II SCSI",
367 .detect = gvp11_detect, 367 .detect = gvp11_detect,
diff --git a/drivers/scsi/gvp11.h b/drivers/scsi/gvp11.h
index 5148d9fada19..575d219d14ba 100644
--- a/drivers/scsi/gvp11.h
+++ b/drivers/scsi/gvp11.h
@@ -11,7 +11,7 @@
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13 13
14int gvp11_detect(Scsi_Host_Template *); 14int gvp11_detect(struct scsi_host_template *);
15int gvp11_release(struct Scsi_Host *); 15int gvp11_release(struct Scsi_Host *);
16const char *wd33c93_info(void); 16const char *wd33c93_info(void);
17int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 17int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c
index 8d97999db60e..b60c1b9270f1 100644
--- a/drivers/scsi/ibmmca.c
+++ b/drivers/scsi/ibmmca.c
@@ -492,7 +492,7 @@ static char *ibmrate(unsigned int, int);
492static int probe_display(int); 492static int probe_display(int);
493static int probe_bus_mode(int); 493static int probe_bus_mode(int);
494static int device_exists(int, int, int *, int *); 494static int device_exists(int, int, int *, int *);
495static struct Scsi_Host *ibmmca_register(Scsi_Host_Template *, int, int, int, char *); 495static struct Scsi_Host *ibmmca_register(struct scsi_host_template *, int, int, int, char *);
496static int option_setup(char *); 496static int option_setup(char *);
497/* local functions needed for proc_info */ 497/* local functions needed for proc_info */
498static int ldn_access_load(int, int); 498static int ldn_access_load(int, int);
@@ -1483,7 +1483,7 @@ static int ibmmca_getinfo(char *buf, int slot, void *dev_id)
1483 return len; 1483 return len;
1484} 1484}
1485 1485
1486int ibmmca_detect(Scsi_Host_Template * scsi_template) 1486int ibmmca_detect(struct scsi_host_template * scsi_template)
1487{ 1487{
1488 struct Scsi_Host *shpnt; 1488 struct Scsi_Host *shpnt;
1489 int port, id, i, j, k, list_size, slot; 1489 int port, id, i, j, k, list_size, slot;
@@ -1736,7 +1736,7 @@ int ibmmca_detect(Scsi_Host_Template * scsi_template)
1736 return found; /* return the number of found SCSI hosts. Should be 1 or 0. */ 1736 return found; /* return the number of found SCSI hosts. Should be 1 or 0. */
1737} 1737}
1738 1738
1739static struct Scsi_Host *ibmmca_register(Scsi_Host_Template * scsi_template, int port, int id, int adaptertype, char *hostname) 1739static struct Scsi_Host *ibmmca_register(struct scsi_host_template * scsi_template, int port, int id, int adaptertype, char *hostname)
1740{ 1740{
1741 struct Scsi_Host *shpnt; 1741 struct Scsi_Host *shpnt;
1742 int i, j; 1742 int i, j;
@@ -2494,7 +2494,7 @@ static int option_setup(char *str)
2494 2494
2495__setup("ibmmcascsi=", option_setup); 2495__setup("ibmmcascsi=", option_setup);
2496 2496
2497static Scsi_Host_Template driver_template = { 2497static struct scsi_host_template driver_template = {
2498 .proc_name = "ibmmca", 2498 .proc_name = "ibmmca",
2499 .proc_info = ibmmca_proc_info, 2499 .proc_info = ibmmca_proc_info,
2500 .name = "IBM SCSI-Subsystem", 2500 .name = "IBM SCSI-Subsystem",
diff --git a/drivers/scsi/ibmmca.h b/drivers/scsi/ibmmca.h
index 6d68f603e9b8..017ee2fa6d63 100644
--- a/drivers/scsi/ibmmca.h
+++ b/drivers/scsi/ibmmca.h
@@ -11,7 +11,7 @@
11/* Common forward declarations for all Linux-versions: */ 11/* Common forward declarations for all Linux-versions: */
12 12
13/* Interfaces to the midlevel Linux SCSI driver */ 13/* Interfaces to the midlevel Linux SCSI driver */
14static int ibmmca_detect (Scsi_Host_Template *); 14static int ibmmca_detect (struct scsi_host_template *);
15static int ibmmca_release (struct Scsi_Host *); 15static int ibmmca_release (struct Scsi_Host *);
16static int ibmmca_queuecommand (Scsi_Cmnd *, void (*done) (Scsi_Cmnd *)); 16static int ibmmca_queuecommand (Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
17static int ibmmca_abort (Scsi_Cmnd *); 17static int ibmmca_abort (Scsi_Cmnd *);
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 3553da0e1cd5..e1960d69fb90 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -882,7 +882,7 @@ static inline int should_transform(ide_drive_t *drive, struct scsi_cmnd *cmd)
882 struct gendisk *disk = cmd->request->rq_disk; 882 struct gendisk *disk = cmd->request->rq_disk;
883 883
884 if (disk) { 884 if (disk) {
885 struct Scsi_Device_Template **p = disk->private_data; 885 struct struct scsi_device_Template **p = disk->private_data;
886 if (strcmp((*p)->scsi_driverfs_driver.name, "sg") == 0) 886 if (strcmp((*p)->scsi_driverfs_driver.name, "sg") == 0)
887 return test_bit(IDESCSI_SG_TRANSFORM, &scsi->transform); 887 return test_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
888 } 888 }
diff --git a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c
index fe387b5ce8bd..34daa3e068de 100644
--- a/drivers/scsi/in2000.c
+++ b/drivers/scsi/in2000.c
@@ -1899,7 +1899,7 @@ static int int_tab[] in2000__INITDATA = {
1899}; 1899};
1900 1900
1901 1901
1902static int __init in2000_detect(Scsi_Host_Template * tpnt) 1902static int __init in2000_detect(struct scsi_host_template * tpnt)
1903{ 1903{
1904 struct Scsi_Host *instance; 1904 struct Scsi_Host *instance;
1905 struct IN2000_hostdata *hostdata; 1905 struct IN2000_hostdata *hostdata;
@@ -2305,7 +2305,7 @@ static int in2000_proc_info(struct Scsi_Host *instance, char *buf, char **start,
2305MODULE_LICENSE("GPL"); 2305MODULE_LICENSE("GPL");
2306 2306
2307 2307
2308static Scsi_Host_Template driver_template = { 2308static struct scsi_host_template driver_template = {
2309 .proc_name = "in2000", 2309 .proc_name = "in2000",
2310 .proc_info = in2000_proc_info, 2310 .proc_info = in2000_proc_info,
2311 .name = "Always IN2000", 2311 .name = "Always IN2000",
diff --git a/drivers/scsi/in2000.h b/drivers/scsi/in2000.h
index a240b52554d8..0fb8b06b8392 100644
--- a/drivers/scsi/in2000.h
+++ b/drivers/scsi/in2000.h
@@ -395,7 +395,7 @@ struct IN2000_hostdata {
395# define CLISPIN_UNLOCK(host,flags) spin_unlock_irqrestore(host->host_lock, \ 395# define CLISPIN_UNLOCK(host,flags) spin_unlock_irqrestore(host->host_lock, \
396 flags) 396 flags)
397 397
398static int in2000_detect(Scsi_Host_Template *) in2000__INIT; 398static int in2000_detect(struct scsi_host_template *) in2000__INIT;
399static int in2000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 399static int in2000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
400static int in2000_abort(Scsi_Cmnd *); 400static int in2000_abort(Scsi_Cmnd *);
401static void in2000_setup(char *, int *) in2000__INIT; 401static void in2000_setup(char *, int *) in2000__INIT;
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index e0039dfae8e5..fa2cb3582cfa 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -91,11 +91,14 @@ static unsigned int ipr_max_speed = 1;
91static int ipr_testmode = 0; 91static int ipr_testmode = 0;
92static unsigned int ipr_fastfail = 0; 92static unsigned int ipr_fastfail = 0;
93static unsigned int ipr_transop_timeout = IPR_OPERATIONAL_TIMEOUT; 93static unsigned int ipr_transop_timeout = IPR_OPERATIONAL_TIMEOUT;
94static unsigned int ipr_enable_cache = 1;
95static unsigned int ipr_debug = 0;
96static int ipr_auto_create = 1;
94static DEFINE_SPINLOCK(ipr_driver_lock); 97static DEFINE_SPINLOCK(ipr_driver_lock);
95 98
96/* This table describes the differences between DMA controller chips */ 99/* This table describes the differences between DMA controller chips */
97static const struct ipr_chip_cfg_t ipr_chip_cfg[] = { 100static const struct ipr_chip_cfg_t ipr_chip_cfg[] = {
98 { /* Gemstone and Citrine */ 101 { /* Gemstone, Citrine, and Obsidian */
99 .mailbox = 0x0042C, 102 .mailbox = 0x0042C,
100 .cache_line_size = 0x20, 103 .cache_line_size = 0x20,
101 { 104 {
@@ -130,6 +133,8 @@ static const struct ipr_chip_cfg_t ipr_chip_cfg[] = {
130static const struct ipr_chip_t ipr_chip[] = { 133static const struct ipr_chip_t ipr_chip[] = {
131 { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, &ipr_chip_cfg[0] }, 134 { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, &ipr_chip_cfg[0] },
132 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, &ipr_chip_cfg[0] }, 135 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, &ipr_chip_cfg[0] },
136 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN, &ipr_chip_cfg[0] },
137 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN, &ipr_chip_cfg[0] },
133 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE, &ipr_chip_cfg[1] }, 138 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE, &ipr_chip_cfg[1] },
134 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, &ipr_chip_cfg[1] } 139 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, &ipr_chip_cfg[1] }
135}; 140};
@@ -150,6 +155,12 @@ module_param_named(fastfail, ipr_fastfail, int, 0);
150MODULE_PARM_DESC(fastfail, "Reduce timeouts and retries"); 155MODULE_PARM_DESC(fastfail, "Reduce timeouts and retries");
151module_param_named(transop_timeout, ipr_transop_timeout, int, 0); 156module_param_named(transop_timeout, ipr_transop_timeout, int, 0);
152MODULE_PARM_DESC(transop_timeout, "Time in seconds to wait for adapter to come operational (default: 300)"); 157MODULE_PARM_DESC(transop_timeout, "Time in seconds to wait for adapter to come operational (default: 300)");
158module_param_named(enable_cache, ipr_enable_cache, int, 0);
159MODULE_PARM_DESC(enable_cache, "Enable adapter's non-volatile write cache (default: 1)");
160module_param_named(debug, ipr_debug, int, 0);
161MODULE_PARM_DESC(debug, "Enable device driver debugging logging. Set to 1 to enable. (default: 0)");
162module_param_named(auto_create, ipr_auto_create, int, 0);
163MODULE_PARM_DESC(auto_create, "Auto-create single device RAID 0 arrays when initialized (default: 1)");
153MODULE_LICENSE("GPL"); 164MODULE_LICENSE("GPL");
154MODULE_VERSION(IPR_DRIVER_VERSION); 165MODULE_VERSION(IPR_DRIVER_VERSION);
155 166
@@ -285,12 +296,18 @@ struct ipr_error_table_t ipr_error_table[] = {
285 "3110: Device bus error, message or command phase"}, 296 "3110: Device bus error, message or command phase"},
286 {0x04670400, 0, 1, 297 {0x04670400, 0, 1,
287 "9091: Incorrect hardware configuration change has been detected"}, 298 "9091: Incorrect hardware configuration change has been detected"},
299 {0x04678000, 0, 1,
300 "9073: Invalid multi-adapter configuration"},
288 {0x046E0000, 0, 1, 301 {0x046E0000, 0, 1,
289 "FFF4: Command to logical unit failed"}, 302 "FFF4: Command to logical unit failed"},
290 {0x05240000, 1, 0, 303 {0x05240000, 1, 0,
291 "Illegal request, invalid request type or request packet"}, 304 "Illegal request, invalid request type or request packet"},
292 {0x05250000, 0, 0, 305 {0x05250000, 0, 0,
293 "Illegal request, invalid resource handle"}, 306 "Illegal request, invalid resource handle"},
307 {0x05258000, 0, 0,
308 "Illegal request, commands not allowed to this device"},
309 {0x05258100, 0, 0,
310 "Illegal request, command not allowed to a secondary adapter"},
294 {0x05260000, 0, 0, 311 {0x05260000, 0, 0,
295 "Illegal request, invalid field in parameter list"}, 312 "Illegal request, invalid field in parameter list"},
296 {0x05260100, 0, 0, 313 {0x05260100, 0, 0,
@@ -299,6 +316,8 @@ struct ipr_error_table_t ipr_error_table[] = {
299 "Illegal request, parameter value invalid"}, 316 "Illegal request, parameter value invalid"},
300 {0x052C0000, 0, 0, 317 {0x052C0000, 0, 0,
301 "Illegal request, command sequence error"}, 318 "Illegal request, command sequence error"},
319 {0x052C8000, 1, 0,
320 "Illegal request, dual adapter support not enabled"},
302 {0x06040500, 0, 1, 321 {0x06040500, 0, 1,
303 "9031: Array protection temporarily suspended, protection resuming"}, 322 "9031: Array protection temporarily suspended, protection resuming"},
304 {0x06040600, 0, 1, 323 {0x06040600, 0, 1,
@@ -315,18 +334,26 @@ struct ipr_error_table_t ipr_error_table[] = {
315 "3029: A device replacement has occurred"}, 334 "3029: A device replacement has occurred"},
316 {0x064C8000, 0, 1, 335 {0x064C8000, 0, 1,
317 "9051: IOA cache data exists for a missing or failed device"}, 336 "9051: IOA cache data exists for a missing or failed device"},
337 {0x064C8100, 0, 1,
338 "9055: Auxiliary cache IOA contains cache data needed by the primary IOA"},
318 {0x06670100, 0, 1, 339 {0x06670100, 0, 1,
319 "9025: Disk unit is not supported at its physical location"}, 340 "9025: Disk unit is not supported at its physical location"},
320 {0x06670600, 0, 1, 341 {0x06670600, 0, 1,
321 "3020: IOA detected a SCSI bus configuration error"}, 342 "3020: IOA detected a SCSI bus configuration error"},
322 {0x06678000, 0, 1, 343 {0x06678000, 0, 1,
323 "3150: SCSI bus configuration error"}, 344 "3150: SCSI bus configuration error"},
345 {0x06678100, 0, 1,
346 "9074: Asymmetric advanced function disk configuration"},
324 {0x06690200, 0, 1, 347 {0x06690200, 0, 1,
325 "9041: Array protection temporarily suspended"}, 348 "9041: Array protection temporarily suspended"},
326 {0x06698200, 0, 1, 349 {0x06698200, 0, 1,
327 "9042: Corrupt array parity detected on specified device"}, 350 "9042: Corrupt array parity detected on specified device"},
328 {0x066B0200, 0, 1, 351 {0x066B0200, 0, 1,
329 "9030: Array no longer protected due to missing or failed disk unit"}, 352 "9030: Array no longer protected due to missing or failed disk unit"},
353 {0x066B8000, 0, 1,
354 "9071: Link operational transition"},
355 {0x066B8100, 0, 1,
356 "9072: Link not operational transition"},
330 {0x066B8200, 0, 1, 357 {0x066B8200, 0, 1,
331 "9032: Array exposed but still protected"}, 358 "9032: Array exposed but still protected"},
332 {0x07270000, 0, 0, 359 {0x07270000, 0, 0,
@@ -789,7 +816,7 @@ static void ipr_send_hcam(struct ipr_ioa_cfg *ioa_cfg, u8 type,
789 **/ 816 **/
790static void ipr_init_res_entry(struct ipr_resource_entry *res) 817static void ipr_init_res_entry(struct ipr_resource_entry *res)
791{ 818{
792 res->needs_sync_complete = 1; 819 res->needs_sync_complete = 0;
793 res->in_erp = 0; 820 res->in_erp = 0;
794 res->add_to_ml = 0; 821 res->add_to_ml = 0;
795 res->del_from_ml = 0; 822 res->del_from_ml = 0;
@@ -889,29 +916,74 @@ static void ipr_process_ccn(struct ipr_cmnd *ipr_cmd)
889 916
890/** 917/**
891 * ipr_log_vpd - Log the passed VPD to the error log. 918 * ipr_log_vpd - Log the passed VPD to the error log.
892 * @vpids: vendor/product id struct 919 * @vpd: vendor/product id/sn struct
893 * @serial_num: serial number string
894 * 920 *
895 * Return value: 921 * Return value:
896 * none 922 * none
897 **/ 923 **/
898static void ipr_log_vpd(struct ipr_std_inq_vpids *vpids, u8 *serial_num) 924static void ipr_log_vpd(struct ipr_vpd *vpd)
899{ 925{
900 char buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN 926 char buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN
901 + IPR_SERIAL_NUM_LEN]; 927 + IPR_SERIAL_NUM_LEN];
902 928
903 memcpy(buffer, vpids->vendor_id, IPR_VENDOR_ID_LEN); 929 memcpy(buffer, vpd->vpids.vendor_id, IPR_VENDOR_ID_LEN);
904 memcpy(buffer + IPR_VENDOR_ID_LEN, vpids->product_id, 930 memcpy(buffer + IPR_VENDOR_ID_LEN, vpd->vpids.product_id,
905 IPR_PROD_ID_LEN); 931 IPR_PROD_ID_LEN);
906 buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN] = '\0'; 932 buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN] = '\0';
907 ipr_err("Vendor/Product ID: %s\n", buffer); 933 ipr_err("Vendor/Product ID: %s\n", buffer);
908 934
909 memcpy(buffer, serial_num, IPR_SERIAL_NUM_LEN); 935 memcpy(buffer, vpd->sn, IPR_SERIAL_NUM_LEN);
910 buffer[IPR_SERIAL_NUM_LEN] = '\0'; 936 buffer[IPR_SERIAL_NUM_LEN] = '\0';
911 ipr_err(" Serial Number: %s\n", buffer); 937 ipr_err(" Serial Number: %s\n", buffer);
912} 938}
913 939
914/** 940/**
941 * ipr_log_ext_vpd - Log the passed extended VPD to the error log.
942 * @vpd: vendor/product id/sn/wwn struct
943 *
944 * Return value:
945 * none
946 **/
947static void ipr_log_ext_vpd(struct ipr_ext_vpd *vpd)
948{
949 ipr_log_vpd(&vpd->vpd);
950 ipr_err(" WWN: %08X%08X\n", be32_to_cpu(vpd->wwid[0]),
951 be32_to_cpu(vpd->wwid[1]));
952}
953
954/**
955 * ipr_log_enhanced_cache_error - Log a cache error.
956 * @ioa_cfg: ioa config struct
957 * @hostrcb: hostrcb struct
958 *
959 * Return value:
960 * none
961 **/
962static void ipr_log_enhanced_cache_error(struct ipr_ioa_cfg *ioa_cfg,
963 struct ipr_hostrcb *hostrcb)
964{
965 struct ipr_hostrcb_type_12_error *error =
966 &hostrcb->hcam.u.error.u.type_12_error;
967
968 ipr_err("-----Current Configuration-----\n");
969 ipr_err("Cache Directory Card Information:\n");
970 ipr_log_ext_vpd(&error->ioa_vpd);
971 ipr_err("Adapter Card Information:\n");
972 ipr_log_ext_vpd(&error->cfc_vpd);
973
974 ipr_err("-----Expected Configuration-----\n");
975 ipr_err("Cache Directory Card Information:\n");
976 ipr_log_ext_vpd(&error->ioa_last_attached_to_cfc_vpd);
977 ipr_err("Adapter Card Information:\n");
978 ipr_log_ext_vpd(&error->cfc_last_attached_to_ioa_vpd);
979
980 ipr_err("Additional IOA Data: %08X %08X %08X\n",
981 be32_to_cpu(error->ioa_data[0]),
982 be32_to_cpu(error->ioa_data[1]),
983 be32_to_cpu(error->ioa_data[2]));
984}
985
986/**
915 * ipr_log_cache_error - Log a cache error. 987 * ipr_log_cache_error - Log a cache error.
916 * @ioa_cfg: ioa config struct 988 * @ioa_cfg: ioa config struct
917 * @hostrcb: hostrcb struct 989 * @hostrcb: hostrcb struct
@@ -927,17 +999,15 @@ static void ipr_log_cache_error(struct ipr_ioa_cfg *ioa_cfg,
927 999
928 ipr_err("-----Current Configuration-----\n"); 1000 ipr_err("-----Current Configuration-----\n");
929 ipr_err("Cache Directory Card Information:\n"); 1001 ipr_err("Cache Directory Card Information:\n");
930 ipr_log_vpd(&error->ioa_vpids, error->ioa_sn); 1002 ipr_log_vpd(&error->ioa_vpd);
931 ipr_err("Adapter Card Information:\n"); 1003 ipr_err("Adapter Card Information:\n");
932 ipr_log_vpd(&error->cfc_vpids, error->cfc_sn); 1004 ipr_log_vpd(&error->cfc_vpd);
933 1005
934 ipr_err("-----Expected Configuration-----\n"); 1006 ipr_err("-----Expected Configuration-----\n");
935 ipr_err("Cache Directory Card Information:\n"); 1007 ipr_err("Cache Directory Card Information:\n");
936 ipr_log_vpd(&error->ioa_last_attached_to_cfc_vpids, 1008 ipr_log_vpd(&error->ioa_last_attached_to_cfc_vpd);
937 error->ioa_last_attached_to_cfc_sn);
938 ipr_err("Adapter Card Information:\n"); 1009 ipr_err("Adapter Card Information:\n");
939 ipr_log_vpd(&error->cfc_last_attached_to_ioa_vpids, 1010 ipr_log_vpd(&error->cfc_last_attached_to_ioa_vpd);
940 error->cfc_last_attached_to_ioa_sn);
941 1011
942 ipr_err("Additional IOA Data: %08X %08X %08X\n", 1012 ipr_err("Additional IOA Data: %08X %08X %08X\n",
943 be32_to_cpu(error->ioa_data[0]), 1013 be32_to_cpu(error->ioa_data[0]),
@@ -946,6 +1016,46 @@ static void ipr_log_cache_error(struct ipr_ioa_cfg *ioa_cfg,
946} 1016}
947 1017
948/** 1018/**
1019 * ipr_log_enhanced_config_error - Log a configuration error.
1020 * @ioa_cfg: ioa config struct
1021 * @hostrcb: hostrcb struct
1022 *
1023 * Return value:
1024 * none
1025 **/
1026static void ipr_log_enhanced_config_error(struct ipr_ioa_cfg *ioa_cfg,
1027 struct ipr_hostrcb *hostrcb)
1028{
1029 int errors_logged, i;
1030 struct ipr_hostrcb_device_data_entry_enhanced *dev_entry;
1031 struct ipr_hostrcb_type_13_error *error;
1032
1033 error = &hostrcb->hcam.u.error.u.type_13_error;
1034 errors_logged = be32_to_cpu(error->errors_logged);
1035
1036 ipr_err("Device Errors Detected/Logged: %d/%d\n",
1037 be32_to_cpu(error->errors_detected), errors_logged);
1038
1039 dev_entry = error->dev;
1040
1041 for (i = 0; i < errors_logged; i++, dev_entry++) {
1042 ipr_err_separator;
1043
1044 ipr_phys_res_err(ioa_cfg, dev_entry->dev_res_addr, "Device %d", i + 1);
1045 ipr_log_ext_vpd(&dev_entry->vpd);
1046
1047 ipr_err("-----New Device Information-----\n");
1048 ipr_log_ext_vpd(&dev_entry->new_vpd);
1049
1050 ipr_err("Cache Directory Card Information:\n");
1051 ipr_log_ext_vpd(&dev_entry->ioa_last_with_dev_vpd);
1052
1053 ipr_err("Adapter Card Information:\n");
1054 ipr_log_ext_vpd(&dev_entry->cfc_last_with_dev_vpd);
1055 }
1056}
1057
1058/**
949 * ipr_log_config_error - Log a configuration error. 1059 * ipr_log_config_error - Log a configuration error.
950 * @ioa_cfg: ioa config struct 1060 * @ioa_cfg: ioa config struct
951 * @hostrcb: hostrcb struct 1061 * @hostrcb: hostrcb struct
@@ -966,30 +1076,22 @@ static void ipr_log_config_error(struct ipr_ioa_cfg *ioa_cfg,
966 ipr_err("Device Errors Detected/Logged: %d/%d\n", 1076 ipr_err("Device Errors Detected/Logged: %d/%d\n",
967 be32_to_cpu(error->errors_detected), errors_logged); 1077 be32_to_cpu(error->errors_detected), errors_logged);
968 1078
969 dev_entry = error->dev_entry; 1079 dev_entry = error->dev;
970 1080
971 for (i = 0; i < errors_logged; i++, dev_entry++) { 1081 for (i = 0; i < errors_logged; i++, dev_entry++) {
972 ipr_err_separator; 1082 ipr_err_separator;
973 1083
974 if (dev_entry->dev_res_addr.bus >= IPR_MAX_NUM_BUSES) { 1084 ipr_phys_res_err(ioa_cfg, dev_entry->dev_res_addr, "Device %d", i + 1);
975 ipr_err("Device %d: missing\n", i + 1); 1085 ipr_log_vpd(&dev_entry->vpd);
976 } else {
977 ipr_err("Device %d: %d:%d:%d:%d\n", i + 1,
978 ioa_cfg->host->host_no, dev_entry->dev_res_addr.bus,
979 dev_entry->dev_res_addr.target, dev_entry->dev_res_addr.lun);
980 }
981 ipr_log_vpd(&dev_entry->dev_vpids, dev_entry->dev_sn);
982 1086
983 ipr_err("-----New Device Information-----\n"); 1087 ipr_err("-----New Device Information-----\n");
984 ipr_log_vpd(&dev_entry->new_dev_vpids, dev_entry->new_dev_sn); 1088 ipr_log_vpd(&dev_entry->new_vpd);
985 1089
986 ipr_err("Cache Directory Card Information:\n"); 1090 ipr_err("Cache Directory Card Information:\n");
987 ipr_log_vpd(&dev_entry->ioa_last_with_dev_vpids, 1091 ipr_log_vpd(&dev_entry->ioa_last_with_dev_vpd);
988 dev_entry->ioa_last_with_dev_sn);
989 1092
990 ipr_err("Adapter Card Information:\n"); 1093 ipr_err("Adapter Card Information:\n");
991 ipr_log_vpd(&dev_entry->cfc_last_with_dev_vpids, 1094 ipr_log_vpd(&dev_entry->cfc_last_with_dev_vpd);
992 dev_entry->cfc_last_with_dev_sn);
993 1095
994 ipr_err("Additional IOA Data: %08X %08X %08X %08X %08X\n", 1096 ipr_err("Additional IOA Data: %08X %08X %08X %08X %08X\n",
995 be32_to_cpu(dev_entry->ioa_data[0]), 1097 be32_to_cpu(dev_entry->ioa_data[0]),
@@ -1001,6 +1103,57 @@ static void ipr_log_config_error(struct ipr_ioa_cfg *ioa_cfg,
1001} 1103}
1002 1104
1003/** 1105/**
1106 * ipr_log_enhanced_array_error - Log an array configuration error.
1107 * @ioa_cfg: ioa config struct
1108 * @hostrcb: hostrcb struct
1109 *
1110 * Return value:
1111 * none
1112 **/
1113static void ipr_log_enhanced_array_error(struct ipr_ioa_cfg *ioa_cfg,
1114 struct ipr_hostrcb *hostrcb)
1115{
1116 int i, num_entries;
1117 struct ipr_hostrcb_type_14_error *error;
1118 struct ipr_hostrcb_array_data_entry_enhanced *array_entry;
1119 const u8 zero_sn[IPR_SERIAL_NUM_LEN] = { [0 ... IPR_SERIAL_NUM_LEN-1] = '0' };
1120
1121 error = &hostrcb->hcam.u.error.u.type_14_error;
1122
1123 ipr_err_separator;
1124
1125 ipr_err("RAID %s Array Configuration: %d:%d:%d:%d\n",
1126 error->protection_level,
1127 ioa_cfg->host->host_no,
1128 error->last_func_vset_res_addr.bus,
1129 error->last_func_vset_res_addr.target,
1130 error->last_func_vset_res_addr.lun);
1131
1132 ipr_err_separator;
1133
1134 array_entry = error->array_member;
1135 num_entries = min_t(u32, be32_to_cpu(error->num_entries),
1136 sizeof(error->array_member));
1137
1138 for (i = 0; i < num_entries; i++, array_entry++) {
1139 if (!memcmp(array_entry->vpd.vpd.sn, zero_sn, IPR_SERIAL_NUM_LEN))
1140 continue;
1141
1142 if (be32_to_cpu(error->exposed_mode_adn) == i)
1143 ipr_err("Exposed Array Member %d:\n", i);
1144 else
1145 ipr_err("Array Member %d:\n", i);
1146
1147 ipr_log_ext_vpd(&array_entry->vpd);
1148 ipr_phys_res_err(ioa_cfg, array_entry->dev_res_addr, "Current Location");
1149 ipr_phys_res_err(ioa_cfg, array_entry->expected_dev_res_addr,
1150 "Expected Location");
1151
1152 ipr_err_separator;
1153 }
1154}
1155
1156/**
1004 * ipr_log_array_error - Log an array configuration error. 1157 * ipr_log_array_error - Log an array configuration error.
1005 * @ioa_cfg: ioa config struct 1158 * @ioa_cfg: ioa config struct
1006 * @hostrcb: hostrcb struct 1159 * @hostrcb: hostrcb struct
@@ -1032,36 +1185,19 @@ static void ipr_log_array_error(struct ipr_ioa_cfg *ioa_cfg,
1032 array_entry = error->array_member; 1185 array_entry = error->array_member;
1033 1186
1034 for (i = 0; i < 18; i++) { 1187 for (i = 0; i < 18; i++) {
1035 if (!memcmp(array_entry->serial_num, zero_sn, IPR_SERIAL_NUM_LEN)) 1188 if (!memcmp(array_entry->vpd.sn, zero_sn, IPR_SERIAL_NUM_LEN))
1036 continue; 1189 continue;
1037 1190
1038 if (be32_to_cpu(error->exposed_mode_adn) == i) { 1191 if (be32_to_cpu(error->exposed_mode_adn) == i)
1039 ipr_err("Exposed Array Member %d:\n", i); 1192 ipr_err("Exposed Array Member %d:\n", i);
1040 } else { 1193 else
1041 ipr_err("Array Member %d:\n", i); 1194 ipr_err("Array Member %d:\n", i);
1042 }
1043 1195
1044 ipr_log_vpd(&array_entry->vpids, array_entry->serial_num); 1196 ipr_log_vpd(&array_entry->vpd);
1045
1046 if (array_entry->dev_res_addr.bus >= IPR_MAX_NUM_BUSES) {
1047 ipr_err("Current Location: unknown\n");
1048 } else {
1049 ipr_err("Current Location: %d:%d:%d:%d\n",
1050 ioa_cfg->host->host_no,
1051 array_entry->dev_res_addr.bus,
1052 array_entry->dev_res_addr.target,
1053 array_entry->dev_res_addr.lun);
1054 }
1055 1197
1056 if (array_entry->expected_dev_res_addr.bus >= IPR_MAX_NUM_BUSES) { 1198 ipr_phys_res_err(ioa_cfg, array_entry->dev_res_addr, "Current Location");
1057 ipr_err("Expected Location: unknown\n"); 1199 ipr_phys_res_err(ioa_cfg, array_entry->expected_dev_res_addr,
1058 } else { 1200 "Expected Location");
1059 ipr_err("Expected Location: %d:%d:%d:%d\n",
1060 ioa_cfg->host->host_no,
1061 array_entry->expected_dev_res_addr.bus,
1062 array_entry->expected_dev_res_addr.target,
1063 array_entry->expected_dev_res_addr.lun);
1064 }
1065 1201
1066 ipr_err_separator; 1202 ipr_err_separator;
1067 1203
@@ -1073,35 +1209,95 @@ static void ipr_log_array_error(struct ipr_ioa_cfg *ioa_cfg,
1073} 1209}
1074 1210
1075/** 1211/**
1076 * ipr_log_generic_error - Log an adapter error. 1212 * ipr_log_hex_data - Log additional hex IOA error data.
1077 * @ioa_cfg: ioa config struct 1213 * @data: IOA error data
1078 * @hostrcb: hostrcb struct 1214 * @len: data length
1079 * 1215 *
1080 * Return value: 1216 * Return value:
1081 * none 1217 * none
1082 **/ 1218 **/
1083static void ipr_log_generic_error(struct ipr_ioa_cfg *ioa_cfg, 1219static void ipr_log_hex_data(u32 *data, int len)
1084 struct ipr_hostrcb *hostrcb)
1085{ 1220{
1086 int i; 1221 int i;
1087 int ioa_data_len = be32_to_cpu(hostrcb->hcam.length);
1088 1222
1089 if (ioa_data_len == 0) 1223 if (len == 0)
1090 return; 1224 return;
1091 1225
1092 ipr_err("IOA Error Data:\n"); 1226 for (i = 0; i < len / 4; i += 4) {
1093 ipr_err("Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F\n");
1094
1095 for (i = 0; i < ioa_data_len / 4; i += 4) {
1096 ipr_err("%08X: %08X %08X %08X %08X\n", i*4, 1227 ipr_err("%08X: %08X %08X %08X %08X\n", i*4,
1097 be32_to_cpu(hostrcb->hcam.u.raw.data[i]), 1228 be32_to_cpu(data[i]),
1098 be32_to_cpu(hostrcb->hcam.u.raw.data[i+1]), 1229 be32_to_cpu(data[i+1]),
1099 be32_to_cpu(hostrcb->hcam.u.raw.data[i+2]), 1230 be32_to_cpu(data[i+2]),
1100 be32_to_cpu(hostrcb->hcam.u.raw.data[i+3])); 1231 be32_to_cpu(data[i+3]));
1101 } 1232 }
1102} 1233}
1103 1234
1104/** 1235/**
1236 * ipr_log_enhanced_dual_ioa_error - Log an enhanced dual adapter error.
1237 * @ioa_cfg: ioa config struct
1238 * @hostrcb: hostrcb struct
1239 *
1240 * Return value:
1241 * none
1242 **/
1243static void ipr_log_enhanced_dual_ioa_error(struct ipr_ioa_cfg *ioa_cfg,
1244 struct ipr_hostrcb *hostrcb)
1245{
1246 struct ipr_hostrcb_type_17_error *error;
1247
1248 error = &hostrcb->hcam.u.error.u.type_17_error;
1249 error->failure_reason[sizeof(error->failure_reason) - 1] = '\0';
1250
1251 ipr_err("%s\n", error->failure_reason);
1252 ipr_err("Remote Adapter VPD:\n");
1253 ipr_log_ext_vpd(&error->vpd);
1254 ipr_log_hex_data(error->data,
1255 be32_to_cpu(hostrcb->hcam.length) -
1256 (offsetof(struct ipr_hostrcb_error, u) +
1257 offsetof(struct ipr_hostrcb_type_17_error, data)));
1258}
1259
1260/**
1261 * ipr_log_dual_ioa_error - Log a dual adapter error.
1262 * @ioa_cfg: ioa config struct
1263 * @hostrcb: hostrcb struct
1264 *
1265 * Return value:
1266 * none
1267 **/
1268static void ipr_log_dual_ioa_error(struct ipr_ioa_cfg *ioa_cfg,
1269 struct ipr_hostrcb *hostrcb)
1270{
1271 struct ipr_hostrcb_type_07_error *error;
1272
1273 error = &hostrcb->hcam.u.error.u.type_07_error;
1274 error->failure_reason[sizeof(error->failure_reason) - 1] = '\0';
1275
1276 ipr_err("%s\n", error->failure_reason);
1277 ipr_err("Remote Adapter VPD:\n");
1278 ipr_log_vpd(&error->vpd);
1279 ipr_log_hex_data(error->data,
1280 be32_to_cpu(hostrcb->hcam.length) -
1281 (offsetof(struct ipr_hostrcb_error, u) +
1282 offsetof(struct ipr_hostrcb_type_07_error, data)));
1283}
1284
1285/**
1286 * ipr_log_generic_error - Log an adapter error.
1287 * @ioa_cfg: ioa config struct
1288 * @hostrcb: hostrcb struct
1289 *
1290 * Return value:
1291 * none
1292 **/
1293static void ipr_log_generic_error(struct ipr_ioa_cfg *ioa_cfg,
1294 struct ipr_hostrcb *hostrcb)
1295{
1296 ipr_log_hex_data(hostrcb->hcam.u.raw.data,
1297 be32_to_cpu(hostrcb->hcam.length));
1298}
1299
1300/**
1105 * ipr_get_error - Find the specfied IOASC in the ipr_error_table. 1301 * ipr_get_error - Find the specfied IOASC in the ipr_error_table.
1106 * @ioasc: IOASC 1302 * @ioasc: IOASC
1107 * 1303 *
@@ -1172,11 +1368,10 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
1172 1368
1173 if (ioa_cfg->log_level < IPR_DEFAULT_LOG_LEVEL) 1369 if (ioa_cfg->log_level < IPR_DEFAULT_LOG_LEVEL)
1174 return; 1370 return;
1371 if (be32_to_cpu(hostrcb->hcam.length) > sizeof(hostrcb->hcam.u.raw))
1372 hostrcb->hcam.length = cpu_to_be32(sizeof(hostrcb->hcam.u.raw));
1175 1373
1176 switch (hostrcb->hcam.overlay_id) { 1374 switch (hostrcb->hcam.overlay_id) {
1177 case IPR_HOST_RCB_OVERLAY_ID_1:
1178 ipr_log_generic_error(ioa_cfg, hostrcb);
1179 break;
1180 case IPR_HOST_RCB_OVERLAY_ID_2: 1375 case IPR_HOST_RCB_OVERLAY_ID_2:
1181 ipr_log_cache_error(ioa_cfg, hostrcb); 1376 ipr_log_cache_error(ioa_cfg, hostrcb);
1182 break; 1377 break;
@@ -1187,13 +1382,26 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
1187 case IPR_HOST_RCB_OVERLAY_ID_6: 1382 case IPR_HOST_RCB_OVERLAY_ID_6:
1188 ipr_log_array_error(ioa_cfg, hostrcb); 1383 ipr_log_array_error(ioa_cfg, hostrcb);
1189 break; 1384 break;
1190 case IPR_HOST_RCB_OVERLAY_ID_DEFAULT: 1385 case IPR_HOST_RCB_OVERLAY_ID_7:
1191 ipr_log_generic_error(ioa_cfg, hostrcb); 1386 ipr_log_dual_ioa_error(ioa_cfg, hostrcb);
1387 break;
1388 case IPR_HOST_RCB_OVERLAY_ID_12:
1389 ipr_log_enhanced_cache_error(ioa_cfg, hostrcb);
1390 break;
1391 case IPR_HOST_RCB_OVERLAY_ID_13:
1392 ipr_log_enhanced_config_error(ioa_cfg, hostrcb);
1393 break;
1394 case IPR_HOST_RCB_OVERLAY_ID_14:
1395 case IPR_HOST_RCB_OVERLAY_ID_16:
1396 ipr_log_enhanced_array_error(ioa_cfg, hostrcb);
1192 break; 1397 break;
1398 case IPR_HOST_RCB_OVERLAY_ID_17:
1399 ipr_log_enhanced_dual_ioa_error(ioa_cfg, hostrcb);
1400 break;
1401 case IPR_HOST_RCB_OVERLAY_ID_1:
1402 case IPR_HOST_RCB_OVERLAY_ID_DEFAULT:
1193 default: 1403 default:
1194 dev_err(&ioa_cfg->pdev->dev, 1404 ipr_log_generic_error(ioa_cfg, hostrcb);
1195 "Unknown error received. Overlay ID: %d\n",
1196 hostrcb->hcam.overlay_id);
1197 break; 1405 break;
1198 } 1406 }
1199} 1407}
@@ -1972,6 +2180,103 @@ static struct bin_attribute ipr_trace_attr = {
1972}; 2180};
1973#endif 2181#endif
1974 2182
2183static const struct {
2184 enum ipr_cache_state state;
2185 char *name;
2186} cache_state [] = {
2187 { CACHE_NONE, "none" },
2188 { CACHE_DISABLED, "disabled" },
2189 { CACHE_ENABLED, "enabled" }
2190};
2191
2192/**
2193 * ipr_show_write_caching - Show the write caching attribute
2194 * @class_dev: class device struct
2195 * @buf: buffer
2196 *
2197 * Return value:
2198 * number of bytes printed to buffer
2199 **/
2200static ssize_t ipr_show_write_caching(struct class_device *class_dev, char *buf)
2201{
2202 struct Scsi_Host *shost = class_to_shost(class_dev);
2203 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
2204 unsigned long lock_flags = 0;
2205 int i, len = 0;
2206
2207 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2208 for (i = 0; i < ARRAY_SIZE(cache_state); i++) {
2209 if (cache_state[i].state == ioa_cfg->cache_state) {
2210 len = snprintf(buf, PAGE_SIZE, "%s\n", cache_state[i].name);
2211 break;
2212 }
2213 }
2214 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2215 return len;
2216}
2217
2218
2219/**
2220 * ipr_store_write_caching - Enable/disable adapter write cache
2221 * @class_dev: class_device struct
2222 * @buf: buffer
2223 * @count: buffer size
2224 *
2225 * This function will enable/disable adapter write cache.
2226 *
2227 * Return value:
2228 * count on success / other on failure
2229 **/
2230static ssize_t ipr_store_write_caching(struct class_device *class_dev,
2231 const char *buf, size_t count)
2232{
2233 struct Scsi_Host *shost = class_to_shost(class_dev);
2234 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
2235 unsigned long lock_flags = 0;
2236 enum ipr_cache_state new_state = CACHE_INVALID;
2237 int i;
2238
2239 if (!capable(CAP_SYS_ADMIN))
2240 return -EACCES;
2241 if (ioa_cfg->cache_state == CACHE_NONE)
2242 return -EINVAL;
2243
2244 for (i = 0; i < ARRAY_SIZE(cache_state); i++) {
2245 if (!strncmp(cache_state[i].name, buf, strlen(cache_state[i].name))) {
2246 new_state = cache_state[i].state;
2247 break;
2248 }
2249 }
2250
2251 if (new_state != CACHE_DISABLED && new_state != CACHE_ENABLED)
2252 return -EINVAL;
2253
2254 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2255 if (ioa_cfg->cache_state == new_state) {
2256 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2257 return count;
2258 }
2259
2260 ioa_cfg->cache_state = new_state;
2261 dev_info(&ioa_cfg->pdev->dev, "%s adapter write cache.\n",
2262 new_state == CACHE_ENABLED ? "Enabling" : "Disabling");
2263 if (!ioa_cfg->in_reset_reload)
2264 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NORMAL);
2265 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2266 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
2267
2268 return count;
2269}
2270
2271static struct class_device_attribute ipr_ioa_cache_attr = {
2272 .attr = {
2273 .name = "write_cache",
2274 .mode = S_IRUGO | S_IWUSR,
2275 },
2276 .show = ipr_show_write_caching,
2277 .store = ipr_store_write_caching
2278};
2279
1975/** 2280/**
1976 * ipr_show_fw_version - Show the firmware version 2281 * ipr_show_fw_version - Show the firmware version
1977 * @class_dev: class device struct 2282 * @class_dev: class device struct
@@ -2112,6 +2417,74 @@ static struct class_device_attribute ipr_diagnostics_attr = {
2112}; 2417};
2113 2418
2114/** 2419/**
2420 * ipr_show_adapter_state - Show the adapter's state
2421 * @class_dev: class device struct
2422 * @buf: buffer
2423 *
2424 * Return value:
2425 * number of bytes printed to buffer
2426 **/
2427static ssize_t ipr_show_adapter_state(struct class_device *class_dev, char *buf)
2428{
2429 struct Scsi_Host *shost = class_to_shost(class_dev);
2430 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
2431 unsigned long lock_flags = 0;
2432 int len;
2433
2434 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2435 if (ioa_cfg->ioa_is_dead)
2436 len = snprintf(buf, PAGE_SIZE, "offline\n");
2437 else
2438 len = snprintf(buf, PAGE_SIZE, "online\n");
2439 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2440 return len;
2441}
2442
2443/**
2444 * ipr_store_adapter_state - Change adapter state
2445 * @class_dev: class_device struct
2446 * @buf: buffer
2447 * @count: buffer size
2448 *
2449 * This function will change the adapter's state.
2450 *
2451 * Return value:
2452 * count on success / other on failure
2453 **/
2454static ssize_t ipr_store_adapter_state(struct class_device *class_dev,
2455 const char *buf, size_t count)
2456{
2457 struct Scsi_Host *shost = class_to_shost(class_dev);
2458 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
2459 unsigned long lock_flags;
2460 int result = count;
2461
2462 if (!capable(CAP_SYS_ADMIN))
2463 return -EACCES;
2464
2465 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2466 if (ioa_cfg->ioa_is_dead && !strncmp(buf, "online", 6)) {
2467 ioa_cfg->ioa_is_dead = 0;
2468 ioa_cfg->reset_retries = 0;
2469 ioa_cfg->in_ioa_bringdown = 0;
2470 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NONE);
2471 }
2472 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2473 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
2474
2475 return result;
2476}
2477
2478static struct class_device_attribute ipr_ioa_state_attr = {
2479 .attr = {
2480 .name = "state",
2481 .mode = S_IRUGO | S_IWUSR,
2482 },
2483 .show = ipr_show_adapter_state,
2484 .store = ipr_store_adapter_state
2485};
2486
2487/**
2115 * ipr_store_reset_adapter - Reset the adapter 2488 * ipr_store_reset_adapter - Reset the adapter
2116 * @class_dev: class_device struct 2489 * @class_dev: class_device struct
2117 * @buf: buffer 2490 * @buf: buffer
@@ -2183,7 +2556,7 @@ static struct ipr_sglist *ipr_alloc_ucode_buffer(int buf_len)
2183 num_elem = buf_len / bsize_elem; 2556 num_elem = buf_len / bsize_elem;
2184 2557
2185 /* Allocate a scatter/gather list for the DMA */ 2558 /* Allocate a scatter/gather list for the DMA */
2186 sglist = kmalloc(sizeof(struct ipr_sglist) + 2559 sglist = kzalloc(sizeof(struct ipr_sglist) +
2187 (sizeof(struct scatterlist) * (num_elem - 1)), 2560 (sizeof(struct scatterlist) * (num_elem - 1)),
2188 GFP_KERNEL); 2561 GFP_KERNEL);
2189 2562
@@ -2192,9 +2565,6 @@ static struct ipr_sglist *ipr_alloc_ucode_buffer(int buf_len)
2192 return NULL; 2565 return NULL;
2193 } 2566 }
2194 2567
2195 memset(sglist, 0, sizeof(struct ipr_sglist) +
2196 (sizeof(struct scatterlist) * (num_elem - 1)));
2197
2198 scatterlist = sglist->scatterlist; 2568 scatterlist = sglist->scatterlist;
2199 2569
2200 sglist->order = order; 2570 sglist->order = order;
@@ -2289,31 +2659,24 @@ static int ipr_copy_ucode_buffer(struct ipr_sglist *sglist,
2289} 2659}
2290 2660
2291/** 2661/**
2292 * ipr_map_ucode_buffer - Map a microcode download buffer 2662 * ipr_build_ucode_ioadl - Build a microcode download IOADL
2293 * @ipr_cmd: ipr command struct 2663 * @ipr_cmd: ipr command struct
2294 * @sglist: scatter/gather list 2664 * @sglist: scatter/gather list
2295 * @len: total length of download buffer
2296 * 2665 *
2297 * Maps a microcode download scatter/gather list for DMA and 2666 * Builds a microcode download IOA data list (IOADL).
2298 * builds the IOADL.
2299 * 2667 *
2300 * Return value:
2301 * 0 on success / -EIO on failure
2302 **/ 2668 **/
2303static int ipr_map_ucode_buffer(struct ipr_cmnd *ipr_cmd, 2669static void ipr_build_ucode_ioadl(struct ipr_cmnd *ipr_cmd,
2304 struct ipr_sglist *sglist, int len) 2670 struct ipr_sglist *sglist)
2305{ 2671{
2306 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
2307 struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb; 2672 struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb;
2308 struct ipr_ioadl_desc *ioadl = ipr_cmd->ioadl; 2673 struct ipr_ioadl_desc *ioadl = ipr_cmd->ioadl;
2309 struct scatterlist *scatterlist = sglist->scatterlist; 2674 struct scatterlist *scatterlist = sglist->scatterlist;
2310 int i; 2675 int i;
2311 2676
2312 ipr_cmd->dma_use_sg = pci_map_sg(ioa_cfg->pdev, scatterlist, 2677 ipr_cmd->dma_use_sg = sglist->num_dma_sg;
2313 sglist->num_sg, DMA_TO_DEVICE);
2314
2315 ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_WRITE_NOT_READ; 2678 ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_WRITE_NOT_READ;
2316 ioarcb->write_data_transfer_length = cpu_to_be32(len); 2679 ioarcb->write_data_transfer_length = cpu_to_be32(sglist->buffer_len);
2317 ioarcb->write_ioadl_len = 2680 ioarcb->write_ioadl_len =
2318 cpu_to_be32(sizeof(struct ipr_ioadl_desc) * ipr_cmd->dma_use_sg); 2681 cpu_to_be32(sizeof(struct ipr_ioadl_desc) * ipr_cmd->dma_use_sg);
2319 2682
@@ -2324,15 +2687,52 @@ static int ipr_map_ucode_buffer(struct ipr_cmnd *ipr_cmd,
2324 cpu_to_be32(sg_dma_address(&scatterlist[i])); 2687 cpu_to_be32(sg_dma_address(&scatterlist[i]));
2325 } 2688 }
2326 2689
2327 if (likely(ipr_cmd->dma_use_sg)) { 2690 ioadl[i-1].flags_and_data_len |=
2328 ioadl[i-1].flags_and_data_len |= 2691 cpu_to_be32(IPR_IOADL_FLAGS_LAST);
2329 cpu_to_be32(IPR_IOADL_FLAGS_LAST); 2692}
2693
2694/**
2695 * ipr_update_ioa_ucode - Update IOA's microcode
2696 * @ioa_cfg: ioa config struct
2697 * @sglist: scatter/gather list
2698 *
2699 * Initiate an adapter reset to update the IOA's microcode
2700 *
2701 * Return value:
2702 * 0 on success / -EIO on failure
2703 **/
2704static int ipr_update_ioa_ucode(struct ipr_ioa_cfg *ioa_cfg,
2705 struct ipr_sglist *sglist)
2706{
2707 unsigned long lock_flags;
2708
2709 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2710
2711 if (ioa_cfg->ucode_sglist) {
2712 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2713 dev_err(&ioa_cfg->pdev->dev,
2714 "Microcode download already in progress\n");
2715 return -EIO;
2330 } 2716 }
2331 else { 2717
2332 dev_err(&ioa_cfg->pdev->dev, "pci_map_sg failed!\n"); 2718 sglist->num_dma_sg = pci_map_sg(ioa_cfg->pdev, sglist->scatterlist,
2719 sglist->num_sg, DMA_TO_DEVICE);
2720
2721 if (!sglist->num_dma_sg) {
2722 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2723 dev_err(&ioa_cfg->pdev->dev,
2724 "Failed to map microcode download buffer!\n");
2333 return -EIO; 2725 return -EIO;
2334 } 2726 }
2335 2727
2728 ioa_cfg->ucode_sglist = sglist;
2729 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NORMAL);
2730 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2731 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
2732
2733 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2734 ioa_cfg->ucode_sglist = NULL;
2735 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2336 return 0; 2736 return 0;
2337} 2737}
2338 2738
@@ -2355,7 +2755,6 @@ static ssize_t ipr_store_update_fw(struct class_device *class_dev,
2355 struct ipr_ucode_image_header *image_hdr; 2755 struct ipr_ucode_image_header *image_hdr;
2356 const struct firmware *fw_entry; 2756 const struct firmware *fw_entry;
2357 struct ipr_sglist *sglist; 2757 struct ipr_sglist *sglist;
2358 unsigned long lock_flags;
2359 char fname[100]; 2758 char fname[100];
2360 char *src; 2759 char *src;
2361 int len, result, dnld_size; 2760 int len, result, dnld_size;
@@ -2396,35 +2795,17 @@ static ssize_t ipr_store_update_fw(struct class_device *class_dev,
2396 if (result) { 2795 if (result) {
2397 dev_err(&ioa_cfg->pdev->dev, 2796 dev_err(&ioa_cfg->pdev->dev,
2398 "Microcode buffer copy to DMA buffer failed\n"); 2797 "Microcode buffer copy to DMA buffer failed\n");
2399 ipr_free_ucode_buffer(sglist); 2798 goto out;
2400 release_firmware(fw_entry);
2401 return result;
2402 }
2403
2404 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2405
2406 if (ioa_cfg->ucode_sglist) {
2407 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2408 dev_err(&ioa_cfg->pdev->dev,
2409 "Microcode download already in progress\n");
2410 ipr_free_ucode_buffer(sglist);
2411 release_firmware(fw_entry);
2412 return -EIO;
2413 } 2799 }
2414 2800
2415 ioa_cfg->ucode_sglist = sglist; 2801 result = ipr_update_ioa_ucode(ioa_cfg, sglist);
2416 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NORMAL);
2417 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2418 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
2419
2420 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2421 ioa_cfg->ucode_sglist = NULL;
2422 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2423 2802
2803 if (!result)
2804 result = count;
2805out:
2424 ipr_free_ucode_buffer(sglist); 2806 ipr_free_ucode_buffer(sglist);
2425 release_firmware(fw_entry); 2807 release_firmware(fw_entry);
2426 2808 return result;
2427 return count;
2428} 2809}
2429 2810
2430static struct class_device_attribute ipr_update_fw_attr = { 2811static struct class_device_attribute ipr_update_fw_attr = {
@@ -2439,8 +2820,10 @@ static struct class_device_attribute *ipr_ioa_attrs[] = {
2439 &ipr_fw_version_attr, 2820 &ipr_fw_version_attr,
2440 &ipr_log_level_attr, 2821 &ipr_log_level_attr,
2441 &ipr_diagnostics_attr, 2822 &ipr_diagnostics_attr,
2823 &ipr_ioa_state_attr,
2442 &ipr_ioa_reset_attr, 2824 &ipr_ioa_reset_attr,
2443 &ipr_update_fw_attr, 2825 &ipr_update_fw_attr,
2826 &ipr_ioa_cache_attr,
2444 NULL, 2827 NULL,
2445}; 2828};
2446 2829
@@ -2548,14 +2931,13 @@ static int ipr_alloc_dump(struct ipr_ioa_cfg *ioa_cfg)
2548 unsigned long lock_flags = 0; 2931 unsigned long lock_flags = 0;
2549 2932
2550 ENTER; 2933 ENTER;
2551 dump = kmalloc(sizeof(struct ipr_dump), GFP_KERNEL); 2934 dump = kzalloc(sizeof(struct ipr_dump), GFP_KERNEL);
2552 2935
2553 if (!dump) { 2936 if (!dump) {
2554 ipr_err("Dump memory allocation failed\n"); 2937 ipr_err("Dump memory allocation failed\n");
2555 return -ENOMEM; 2938 return -ENOMEM;
2556 } 2939 }
2557 2940
2558 memset(dump, 0, sizeof(struct ipr_dump));
2559 kref_init(&dump->kref); 2941 kref_init(&dump->kref);
2560 dump->ioa_cfg = ioa_cfg; 2942 dump->ioa_cfg = ioa_cfg;
2561 2943
@@ -2824,8 +3206,10 @@ static int ipr_slave_configure(struct scsi_device *sdev)
2824 if (res) { 3206 if (res) {
2825 if (ipr_is_af_dasd_device(res)) 3207 if (ipr_is_af_dasd_device(res))
2826 sdev->type = TYPE_RAID; 3208 sdev->type = TYPE_RAID;
2827 if (ipr_is_af_dasd_device(res) || ipr_is_ioa_resource(res)) 3209 if (ipr_is_af_dasd_device(res) || ipr_is_ioa_resource(res)) {
2828 sdev->scsi_level = 4; 3210 sdev->scsi_level = 4;
3211 sdev->no_uld_attach = 1;
3212 }
2829 if (ipr_is_vset_device(res)) { 3213 if (ipr_is_vset_device(res)) {
2830 sdev->timeout = IPR_VSET_RW_TIMEOUT; 3214 sdev->timeout = IPR_VSET_RW_TIMEOUT;
2831 blk_queue_max_sectors(sdev->request_queue, IPR_VSET_MAX_SECTORS); 3215 blk_queue_max_sectors(sdev->request_queue, IPR_VSET_MAX_SECTORS);
@@ -2848,13 +3232,14 @@ static int ipr_slave_configure(struct scsi_device *sdev)
2848 * handling new commands. 3232 * handling new commands.
2849 * 3233 *
2850 * Return value: 3234 * Return value:
2851 * 0 on success 3235 * 0 on success / -ENXIO if device does not exist
2852 **/ 3236 **/
2853static int ipr_slave_alloc(struct scsi_device *sdev) 3237static int ipr_slave_alloc(struct scsi_device *sdev)
2854{ 3238{
2855 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata; 3239 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata;
2856 struct ipr_resource_entry *res; 3240 struct ipr_resource_entry *res;
2857 unsigned long lock_flags; 3241 unsigned long lock_flags;
3242 int rc = -ENXIO;
2858 3243
2859 sdev->hostdata = NULL; 3244 sdev->hostdata = NULL;
2860 3245
@@ -2868,14 +3253,16 @@ static int ipr_slave_alloc(struct scsi_device *sdev)
2868 res->add_to_ml = 0; 3253 res->add_to_ml = 0;
2869 res->in_erp = 0; 3254 res->in_erp = 0;
2870 sdev->hostdata = res; 3255 sdev->hostdata = res;
2871 res->needs_sync_complete = 1; 3256 if (!ipr_is_naca_model(res))
3257 res->needs_sync_complete = 1;
3258 rc = 0;
2872 break; 3259 break;
2873 } 3260 }
2874 } 3261 }
2875 3262
2876 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 3263 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2877 3264
2878 return 0; 3265 return rc;
2879} 3266}
2880 3267
2881/** 3268/**
@@ -2939,7 +3326,7 @@ static int __ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd)
2939 ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata; 3326 ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata;
2940 res = scsi_cmd->device->hostdata; 3327 res = scsi_cmd->device->hostdata;
2941 3328
2942 if (!res || (!ipr_is_gscsi(res) && !ipr_is_vset_device(res))) 3329 if (!res)
2943 return FAILED; 3330 return FAILED;
2944 3331
2945 /* 3332 /*
@@ -3131,7 +3518,8 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd)
3131 } 3518 }
3132 3519
3133 list_add_tail(&ipr_cmd->queue, &ioa_cfg->free_q); 3520 list_add_tail(&ipr_cmd->queue, &ioa_cfg->free_q);
3134 res->needs_sync_complete = 1; 3521 if (!ipr_is_naca_model(res))
3522 res->needs_sync_complete = 1;
3135 3523
3136 LEAVE; 3524 LEAVE;
3137 return (IPR_IOASC_SENSE_KEY(ioasc) ? FAILED : SUCCESS); 3525 return (IPR_IOASC_SENSE_KEY(ioasc) ? FAILED : SUCCESS);
@@ -3435,7 +3823,8 @@ static void ipr_erp_done(struct ipr_cmnd *ipr_cmd)
3435 } 3823 }
3436 3824
3437 if (res) { 3825 if (res) {
3438 res->needs_sync_complete = 1; 3826 if (!ipr_is_naca_model(res))
3827 res->needs_sync_complete = 1;
3439 res->in_erp = 0; 3828 res->in_erp = 0;
3440 } 3829 }
3441 ipr_unmap_sglist(ioa_cfg, ipr_cmd); 3830 ipr_unmap_sglist(ioa_cfg, ipr_cmd);
@@ -3705,6 +4094,30 @@ static void ipr_gen_sense(struct ipr_cmnd *ipr_cmd)
3705} 4094}
3706 4095
3707/** 4096/**
4097 * ipr_get_autosense - Copy autosense data to sense buffer
4098 * @ipr_cmd: ipr command struct
4099 *
4100 * This function copies the autosense buffer to the buffer
4101 * in the scsi_cmd, if there is autosense available.
4102 *
4103 * Return value:
4104 * 1 if autosense was available / 0 if not
4105 **/
4106static int ipr_get_autosense(struct ipr_cmnd *ipr_cmd)
4107{
4108 struct ipr_ioasa *ioasa = &ipr_cmd->ioasa;
4109
4110 if ((be32_to_cpu(ioasa->ioasc_specific) &
4111 (IPR_ADDITIONAL_STATUS_FMT | IPR_AUTOSENSE_VALID)) == 0)
4112 return 0;
4113
4114 memcpy(ipr_cmd->scsi_cmd->sense_buffer, ioasa->auto_sense.data,
4115 min_t(u16, be16_to_cpu(ioasa->auto_sense.auto_sense_len),
4116 SCSI_SENSE_BUFFERSIZE));
4117 return 1;
4118}
4119
4120/**
3708 * ipr_erp_start - Process an error response for a SCSI op 4121 * ipr_erp_start - Process an error response for a SCSI op
3709 * @ioa_cfg: ioa config struct 4122 * @ioa_cfg: ioa config struct
3710 * @ipr_cmd: ipr command struct 4123 * @ipr_cmd: ipr command struct
@@ -3734,14 +4147,19 @@ static void ipr_erp_start(struct ipr_ioa_cfg *ioa_cfg,
3734 4147
3735 switch (ioasc & IPR_IOASC_IOASC_MASK) { 4148 switch (ioasc & IPR_IOASC_IOASC_MASK) {
3736 case IPR_IOASC_ABORTED_CMD_TERM_BY_HOST: 4149 case IPR_IOASC_ABORTED_CMD_TERM_BY_HOST:
3737 scsi_cmd->result |= (DID_IMM_RETRY << 16); 4150 if (ipr_is_naca_model(res))
4151 scsi_cmd->result |= (DID_ABORT << 16);
4152 else
4153 scsi_cmd->result |= (DID_IMM_RETRY << 16);
3738 break; 4154 break;
3739 case IPR_IOASC_IR_RESOURCE_HANDLE: 4155 case IPR_IOASC_IR_RESOURCE_HANDLE:
4156 case IPR_IOASC_IR_NO_CMDS_TO_2ND_IOA:
3740 scsi_cmd->result |= (DID_NO_CONNECT << 16); 4157 scsi_cmd->result |= (DID_NO_CONNECT << 16);
3741 break; 4158 break;
3742 case IPR_IOASC_HW_SEL_TIMEOUT: 4159 case IPR_IOASC_HW_SEL_TIMEOUT:
3743 scsi_cmd->result |= (DID_NO_CONNECT << 16); 4160 scsi_cmd->result |= (DID_NO_CONNECT << 16);
3744 res->needs_sync_complete = 1; 4161 if (!ipr_is_naca_model(res))
4162 res->needs_sync_complete = 1;
3745 break; 4163 break;
3746 case IPR_IOASC_SYNC_REQUIRED: 4164 case IPR_IOASC_SYNC_REQUIRED:
3747 if (!res->in_erp) 4165 if (!res->in_erp)
@@ -3749,6 +4167,7 @@ static void ipr_erp_start(struct ipr_ioa_cfg *ioa_cfg,
3749 scsi_cmd->result |= (DID_IMM_RETRY << 16); 4167 scsi_cmd->result |= (DID_IMM_RETRY << 16);
3750 break; 4168 break;
3751 case IPR_IOASC_MED_DO_NOT_REALLOC: /* prevent retries */ 4169 case IPR_IOASC_MED_DO_NOT_REALLOC: /* prevent retries */
4170 case IPR_IOASA_IR_DUAL_IOA_DISABLED:
3752 scsi_cmd->result |= (DID_PASSTHROUGH << 16); 4171 scsi_cmd->result |= (DID_PASSTHROUGH << 16);
3753 break; 4172 break;
3754 case IPR_IOASC_BUS_WAS_RESET: 4173 case IPR_IOASC_BUS_WAS_RESET:
@@ -3760,21 +4179,27 @@ static void ipr_erp_start(struct ipr_ioa_cfg *ioa_cfg,
3760 if (!res->resetting_device) 4179 if (!res->resetting_device)
3761 scsi_report_bus_reset(ioa_cfg->host, scsi_cmd->device->channel); 4180 scsi_report_bus_reset(ioa_cfg->host, scsi_cmd->device->channel);
3762 scsi_cmd->result |= (DID_ERROR << 16); 4181 scsi_cmd->result |= (DID_ERROR << 16);
3763 res->needs_sync_complete = 1; 4182 if (!ipr_is_naca_model(res))
4183 res->needs_sync_complete = 1;
3764 break; 4184 break;
3765 case IPR_IOASC_HW_DEV_BUS_STATUS: 4185 case IPR_IOASC_HW_DEV_BUS_STATUS:
3766 scsi_cmd->result |= IPR_IOASC_SENSE_STATUS(ioasc); 4186 scsi_cmd->result |= IPR_IOASC_SENSE_STATUS(ioasc);
3767 if (IPR_IOASC_SENSE_STATUS(ioasc) == SAM_STAT_CHECK_CONDITION) { 4187 if (IPR_IOASC_SENSE_STATUS(ioasc) == SAM_STAT_CHECK_CONDITION) {
3768 ipr_erp_cancel_all(ipr_cmd); 4188 if (!ipr_get_autosense(ipr_cmd)) {
3769 return; 4189 if (!ipr_is_naca_model(res)) {
4190 ipr_erp_cancel_all(ipr_cmd);
4191 return;
4192 }
4193 }
3770 } 4194 }
3771 res->needs_sync_complete = 1; 4195 if (!ipr_is_naca_model(res))
4196 res->needs_sync_complete = 1;
3772 break; 4197 break;
3773 case IPR_IOASC_NR_INIT_CMD_REQUIRED: 4198 case IPR_IOASC_NR_INIT_CMD_REQUIRED:
3774 break; 4199 break;
3775 default: 4200 default:
3776 scsi_cmd->result |= (DID_ERROR << 16); 4201 scsi_cmd->result |= (DID_ERROR << 16);
3777 if (!ipr_is_vset_device(res)) 4202 if (!ipr_is_vset_device(res) && !ipr_is_naca_model(res))
3778 res->needs_sync_complete = 1; 4203 res->needs_sync_complete = 1;
3779 break; 4204 break;
3780 } 4205 }
@@ -4073,6 +4498,7 @@ static int ipr_ioa_reset_done(struct ipr_cmnd *ipr_cmd)
4073 ioa_cfg->in_reset_reload = 0; 4498 ioa_cfg->in_reset_reload = 0;
4074 ioa_cfg->allow_cmds = 1; 4499 ioa_cfg->allow_cmds = 1;
4075 ioa_cfg->reset_cmd = NULL; 4500 ioa_cfg->reset_cmd = NULL;
4501 ioa_cfg->doorbell |= IPR_RUNTIME_RESET;
4076 4502
4077 list_for_each_entry(res, &ioa_cfg->used_res_q, queue) { 4503 list_for_each_entry(res, &ioa_cfg->used_res_q, queue) {
4078 if (ioa_cfg->allow_ml_add_del && (res->add_to_ml || res->del_from_ml)) { 4504 if (ioa_cfg->allow_ml_add_del && (res->add_to_ml || res->del_from_ml)) {
@@ -4146,7 +4572,7 @@ static int ipr_set_supported_devs(struct ipr_cmnd *ipr_cmd)
4146 ipr_cmd->job_step = ipr_ioa_reset_done; 4572 ipr_cmd->job_step = ipr_ioa_reset_done;
4147 4573
4148 list_for_each_entry_continue(res, &ioa_cfg->used_res_q, queue) { 4574 list_for_each_entry_continue(res, &ioa_cfg->used_res_q, queue) {
4149 if (!ipr_is_af_dasd_device(res)) 4575 if (!IPR_IS_DASD_DEVICE(res->cfgte.std_inq_data))
4150 continue; 4576 continue;
4151 4577
4152 ipr_cmd->u.res = res; 4578 ipr_cmd->u.res = res;
@@ -4179,6 +4605,36 @@ static int ipr_set_supported_devs(struct ipr_cmnd *ipr_cmd)
4179} 4605}
4180 4606
4181/** 4607/**
4608 * ipr_setup_write_cache - Disable write cache if needed
4609 * @ipr_cmd: ipr command struct
4610 *
4611 * This function sets up adapters write cache to desired setting
4612 *
4613 * Return value:
4614 * IPR_RC_JOB_CONTINUE / IPR_RC_JOB_RETURN
4615 **/
4616static int ipr_setup_write_cache(struct ipr_cmnd *ipr_cmd)
4617{
4618 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
4619
4620 ipr_cmd->job_step = ipr_set_supported_devs;
4621 ipr_cmd->u.res = list_entry(ioa_cfg->used_res_q.next,
4622 struct ipr_resource_entry, queue);
4623
4624 if (ioa_cfg->cache_state != CACHE_DISABLED)
4625 return IPR_RC_JOB_CONTINUE;
4626
4627 ipr_cmd->ioarcb.res_handle = cpu_to_be32(IPR_IOA_RES_HANDLE);
4628 ipr_cmd->ioarcb.cmd_pkt.request_type = IPR_RQTYPE_IOACMD;
4629 ipr_cmd->ioarcb.cmd_pkt.cdb[0] = IPR_IOA_SHUTDOWN;
4630 ipr_cmd->ioarcb.cmd_pkt.cdb[1] = IPR_SHUTDOWN_PREPARE_FOR_NORMAL;
4631
4632 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout, IPR_INTERNAL_TIMEOUT);
4633
4634 return IPR_RC_JOB_RETURN;
4635}
4636
4637/**
4182 * ipr_get_mode_page - Locate specified mode page 4638 * ipr_get_mode_page - Locate specified mode page
4183 * @mode_pages: mode page buffer 4639 * @mode_pages: mode page buffer
4184 * @page_code: page code to find 4640 * @page_code: page code to find
@@ -4389,10 +4845,7 @@ static int ipr_ioafp_mode_select_page28(struct ipr_cmnd *ipr_cmd)
4389 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, mode_pages), 4845 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, mode_pages),
4390 length); 4846 length);
4391 4847
4392 ipr_cmd->job_step = ipr_set_supported_devs; 4848 ipr_cmd->job_step = ipr_setup_write_cache;
4393 ipr_cmd->u.res = list_entry(ioa_cfg->used_res_q.next,
4394 struct ipr_resource_entry, queue);
4395
4396 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout, IPR_INTERNAL_TIMEOUT); 4849 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout, IPR_INTERNAL_TIMEOUT);
4397 4850
4398 LEAVE; 4851 LEAVE;
@@ -4431,6 +4884,51 @@ static void ipr_build_mode_sense(struct ipr_cmnd *ipr_cmd,
4431} 4884}
4432 4885
4433/** 4886/**
4887 * ipr_reset_cmd_failed - Handle failure of IOA reset command
4888 * @ipr_cmd: ipr command struct
4889 *
4890 * This function handles the failure of an IOA bringup command.
4891 *
4892 * Return value:
4893 * IPR_RC_JOB_RETURN
4894 **/
4895static int ipr_reset_cmd_failed(struct ipr_cmnd *ipr_cmd)
4896{
4897 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
4898 u32 ioasc = be32_to_cpu(ipr_cmd->ioasa.ioasc);
4899
4900 dev_err(&ioa_cfg->pdev->dev,
4901 "0x%02X failed with IOASC: 0x%08X\n",
4902 ipr_cmd->ioarcb.cmd_pkt.cdb[0], ioasc);
4903
4904 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NONE);
4905 list_add_tail(&ipr_cmd->queue, &ioa_cfg->free_q);
4906 return IPR_RC_JOB_RETURN;
4907}
4908
4909/**
4910 * ipr_reset_mode_sense_failed - Handle failure of IOAFP mode sense
4911 * @ipr_cmd: ipr command struct
4912 *
4913 * This function handles the failure of a Mode Sense to the IOAFP.
4914 * Some adapters do not handle all mode pages.
4915 *
4916 * Return value:
4917 * IPR_RC_JOB_CONTINUE / IPR_RC_JOB_RETURN
4918 **/
4919static int ipr_reset_mode_sense_failed(struct ipr_cmnd *ipr_cmd)
4920{
4921 u32 ioasc = be32_to_cpu(ipr_cmd->ioasa.ioasc);
4922
4923 if (ioasc == IPR_IOASC_IR_INVALID_REQ_TYPE_OR_PKT) {
4924 ipr_cmd->job_step = ipr_setup_write_cache;
4925 return IPR_RC_JOB_CONTINUE;
4926 }
4927
4928 return ipr_reset_cmd_failed(ipr_cmd);
4929}
4930
4931/**
4434 * ipr_ioafp_mode_sense_page28 - Issue Mode Sense Page 28 to IOA 4932 * ipr_ioafp_mode_sense_page28 - Issue Mode Sense Page 28 to IOA
4435 * @ipr_cmd: ipr command struct 4933 * @ipr_cmd: ipr command struct
4436 * 4934 *
@@ -4451,6 +4949,7 @@ static int ipr_ioafp_mode_sense_page28(struct ipr_cmnd *ipr_cmd)
4451 sizeof(struct ipr_mode_pages)); 4949 sizeof(struct ipr_mode_pages));
4452 4950
4453 ipr_cmd->job_step = ipr_ioafp_mode_select_page28; 4951 ipr_cmd->job_step = ipr_ioafp_mode_select_page28;
4952 ipr_cmd->job_step_failed = ipr_reset_mode_sense_failed;
4454 4953
4455 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout, IPR_INTERNAL_TIMEOUT); 4954 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout, IPR_INTERNAL_TIMEOUT);
4456 4955
@@ -4612,6 +5111,27 @@ static void ipr_ioafp_inquiry(struct ipr_cmnd *ipr_cmd, u8 flags, u8 page,
4612} 5111}
4613 5112
4614/** 5113/**
5114 * ipr_inquiry_page_supported - Is the given inquiry page supported
5115 * @page0: inquiry page 0 buffer
5116 * @page: page code.
5117 *
5118 * This function determines if the specified inquiry page is supported.
5119 *
5120 * Return value:
5121 * 1 if page is supported / 0 if not
5122 **/
5123static int ipr_inquiry_page_supported(struct ipr_inquiry_page0 *page0, u8 page)
5124{
5125 int i;
5126
5127 for (i = 0; i < min_t(u8, page0->len, IPR_INQUIRY_PAGE0_ENTRIES); i++)
5128 if (page0->page[i] == page)
5129 return 1;
5130
5131 return 0;
5132}
5133
5134/**
4615 * ipr_ioafp_page3_inquiry - Send a Page 3 Inquiry to the adapter. 5135 * ipr_ioafp_page3_inquiry - Send a Page 3 Inquiry to the adapter.
4616 * @ipr_cmd: ipr command struct 5136 * @ipr_cmd: ipr command struct
4617 * 5137 *
@@ -4624,6 +5144,36 @@ static void ipr_ioafp_inquiry(struct ipr_cmnd *ipr_cmd, u8 flags, u8 page,
4624static int ipr_ioafp_page3_inquiry(struct ipr_cmnd *ipr_cmd) 5144static int ipr_ioafp_page3_inquiry(struct ipr_cmnd *ipr_cmd)
4625{ 5145{
4626 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; 5146 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
5147 struct ipr_inquiry_page0 *page0 = &ioa_cfg->vpd_cbs->page0_data;
5148
5149 ENTER;
5150
5151 if (!ipr_inquiry_page_supported(page0, 1))
5152 ioa_cfg->cache_state = CACHE_NONE;
5153
5154 ipr_cmd->job_step = ipr_ioafp_query_ioa_cfg;
5155
5156 ipr_ioafp_inquiry(ipr_cmd, 1, 3,
5157 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, page3_data),
5158 sizeof(struct ipr_inquiry_page3));
5159
5160 LEAVE;
5161 return IPR_RC_JOB_RETURN;
5162}
5163
5164/**
5165 * ipr_ioafp_page0_inquiry - Send a Page 0 Inquiry to the adapter.
5166 * @ipr_cmd: ipr command struct
5167 *
5168 * This function sends a Page 0 inquiry to the adapter
5169 * to retrieve supported inquiry pages.
5170 *
5171 * Return value:
5172 * IPR_RC_JOB_CONTINUE / IPR_RC_JOB_RETURN
5173 **/
5174static int ipr_ioafp_page0_inquiry(struct ipr_cmnd *ipr_cmd)
5175{
5176 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
4627 char type[5]; 5177 char type[5];
4628 5178
4629 ENTER; 5179 ENTER;
@@ -4633,11 +5183,11 @@ static int ipr_ioafp_page3_inquiry(struct ipr_cmnd *ipr_cmd)
4633 type[4] = '\0'; 5183 type[4] = '\0';
4634 ioa_cfg->type = simple_strtoul((char *)type, NULL, 16); 5184 ioa_cfg->type = simple_strtoul((char *)type, NULL, 16);
4635 5185
4636 ipr_cmd->job_step = ipr_ioafp_query_ioa_cfg; 5186 ipr_cmd->job_step = ipr_ioafp_page3_inquiry;
4637 5187
4638 ipr_ioafp_inquiry(ipr_cmd, 1, 3, 5188 ipr_ioafp_inquiry(ipr_cmd, 1, 0,
4639 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, page3_data), 5189 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, page0_data),
4640 sizeof(struct ipr_inquiry_page3)); 5190 sizeof(struct ipr_inquiry_page0));
4641 5191
4642 LEAVE; 5192 LEAVE;
4643 return IPR_RC_JOB_RETURN; 5193 return IPR_RC_JOB_RETURN;
@@ -4657,7 +5207,7 @@ static int ipr_ioafp_std_inquiry(struct ipr_cmnd *ipr_cmd)
4657 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; 5207 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
4658 5208
4659 ENTER; 5209 ENTER;
4660 ipr_cmd->job_step = ipr_ioafp_page3_inquiry; 5210 ipr_cmd->job_step = ipr_ioafp_page0_inquiry;
4661 5211
4662 ipr_ioafp_inquiry(ipr_cmd, 0, 0, 5212 ipr_ioafp_inquiry(ipr_cmd, 0, 0,
4663 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, ioa_vpd), 5213 ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, ioa_vpd),
@@ -4815,7 +5365,7 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd)
4815 } 5365 }
4816 5366
4817 /* Enable destructive diagnostics on IOA */ 5367 /* Enable destructive diagnostics on IOA */
4818 writel(IPR_DOORBELL, ioa_cfg->regs.set_uproc_interrupt_reg); 5368 writel(ioa_cfg->doorbell, ioa_cfg->regs.set_uproc_interrupt_reg);
4819 5369
4820 writel(IPR_PCII_OPER_INTERRUPTS, ioa_cfg->regs.clr_interrupt_mask_reg); 5370 writel(IPR_PCII_OPER_INTERRUPTS, ioa_cfg->regs.clr_interrupt_mask_reg);
4821 int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg); 5371 int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg);
@@ -5147,12 +5697,7 @@ static int ipr_reset_ucode_download(struct ipr_cmnd *ipr_cmd)
5147 ipr_cmd->ioarcb.cmd_pkt.cdb[7] = (sglist->buffer_len & 0x00ff00) >> 8; 5697 ipr_cmd->ioarcb.cmd_pkt.cdb[7] = (sglist->buffer_len & 0x00ff00) >> 8;
5148 ipr_cmd->ioarcb.cmd_pkt.cdb[8] = sglist->buffer_len & 0x0000ff; 5698 ipr_cmd->ioarcb.cmd_pkt.cdb[8] = sglist->buffer_len & 0x0000ff;
5149 5699
5150 if (ipr_map_ucode_buffer(ipr_cmd, sglist, sglist->buffer_len)) { 5700 ipr_build_ucode_ioadl(ipr_cmd, sglist);
5151 dev_err(&ioa_cfg->pdev->dev,
5152 "Failed to map microcode download buffer\n");
5153 return IPR_RC_JOB_CONTINUE;
5154 }
5155
5156 ipr_cmd->job_step = ipr_reset_ucode_download_done; 5701 ipr_cmd->job_step = ipr_reset_ucode_download_done;
5157 5702
5158 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout, 5703 ipr_do_req(ipr_cmd, ipr_reset_ioa_job, ipr_timeout,
@@ -5217,7 +5762,6 @@ static int ipr_reset_shutdown_ioa(struct ipr_cmnd *ipr_cmd)
5217static void ipr_reset_ioa_job(struct ipr_cmnd *ipr_cmd) 5762static void ipr_reset_ioa_job(struct ipr_cmnd *ipr_cmd)
5218{ 5763{
5219 u32 rc, ioasc; 5764 u32 rc, ioasc;
5220 unsigned long scratch = ipr_cmd->u.scratch;
5221 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; 5765 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
5222 5766
5223 do { 5767 do {
@@ -5233,17 +5777,13 @@ static void ipr_reset_ioa_job(struct ipr_cmnd *ipr_cmd)
5233 } 5777 }
5234 5778
5235 if (IPR_IOASC_SENSE_KEY(ioasc)) { 5779 if (IPR_IOASC_SENSE_KEY(ioasc)) {
5236 dev_err(&ioa_cfg->pdev->dev, 5780 rc = ipr_cmd->job_step_failed(ipr_cmd);
5237 "0x%02X failed with IOASC: 0x%08X\n", 5781 if (rc == IPR_RC_JOB_RETURN)
5238 ipr_cmd->ioarcb.cmd_pkt.cdb[0], ioasc); 5782 return;
5239
5240 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NONE);
5241 list_add_tail(&ipr_cmd->queue, &ioa_cfg->free_q);
5242 return;
5243 } 5783 }
5244 5784
5245 ipr_reinit_ipr_cmnd(ipr_cmd); 5785 ipr_reinit_ipr_cmnd(ipr_cmd);
5246 ipr_cmd->u.scratch = scratch; 5786 ipr_cmd->job_step_failed = ipr_reset_cmd_failed;
5247 rc = ipr_cmd->job_step(ipr_cmd); 5787 rc = ipr_cmd->job_step(ipr_cmd);
5248 } while(rc == IPR_RC_JOB_CONTINUE); 5788 } while(rc == IPR_RC_JOB_CONTINUE);
5249} 5789}
@@ -5517,15 +6057,12 @@ static int __devinit ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
5517 int i, rc = -ENOMEM; 6057 int i, rc = -ENOMEM;
5518 6058
5519 ENTER; 6059 ENTER;
5520 ioa_cfg->res_entries = kmalloc(sizeof(struct ipr_resource_entry) * 6060 ioa_cfg->res_entries = kzalloc(sizeof(struct ipr_resource_entry) *
5521 IPR_MAX_PHYSICAL_DEVS, GFP_KERNEL); 6061 IPR_MAX_PHYSICAL_DEVS, GFP_KERNEL);
5522 6062
5523 if (!ioa_cfg->res_entries) 6063 if (!ioa_cfg->res_entries)
5524 goto out; 6064 goto out;
5525 6065
5526 memset(ioa_cfg->res_entries, 0,
5527 sizeof(struct ipr_resource_entry) * IPR_MAX_PHYSICAL_DEVS);
5528
5529 for (i = 0; i < IPR_MAX_PHYSICAL_DEVS; i++) 6066 for (i = 0; i < IPR_MAX_PHYSICAL_DEVS; i++)
5530 list_add_tail(&ioa_cfg->res_entries[i].queue, &ioa_cfg->free_res_q); 6067 list_add_tail(&ioa_cfg->res_entries[i].queue, &ioa_cfg->free_res_q);
5531 6068
@@ -5566,15 +6103,12 @@ static int __devinit ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
5566 list_add_tail(&ioa_cfg->hostrcb[i]->queue, &ioa_cfg->hostrcb_free_q); 6103 list_add_tail(&ioa_cfg->hostrcb[i]->queue, &ioa_cfg->hostrcb_free_q);
5567 } 6104 }
5568 6105
5569 ioa_cfg->trace = kmalloc(sizeof(struct ipr_trace_entry) * 6106 ioa_cfg->trace = kzalloc(sizeof(struct ipr_trace_entry) *
5570 IPR_NUM_TRACE_ENTRIES, GFP_KERNEL); 6107 IPR_NUM_TRACE_ENTRIES, GFP_KERNEL);
5571 6108
5572 if (!ioa_cfg->trace) 6109 if (!ioa_cfg->trace)
5573 goto out_free_hostrcb_dma; 6110 goto out_free_hostrcb_dma;
5574 6111
5575 memset(ioa_cfg->trace, 0,
5576 sizeof(struct ipr_trace_entry) * IPR_NUM_TRACE_ENTRIES);
5577
5578 rc = 0; 6112 rc = 0;
5579out: 6113out:
5580 LEAVE; 6114 LEAVE;
@@ -5642,6 +6176,9 @@ static void __devinit ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg,
5642 ioa_cfg->host = host; 6176 ioa_cfg->host = host;
5643 ioa_cfg->pdev = pdev; 6177 ioa_cfg->pdev = pdev;
5644 ioa_cfg->log_level = ipr_log_level; 6178 ioa_cfg->log_level = ipr_log_level;
6179 ioa_cfg->doorbell = IPR_DOORBELL;
6180 if (!ipr_auto_create)
6181 ioa_cfg->doorbell |= IPR_RUNTIME_RESET;
5645 sprintf(ioa_cfg->eye_catcher, IPR_EYECATCHER); 6182 sprintf(ioa_cfg->eye_catcher, IPR_EYECATCHER);
5646 sprintf(ioa_cfg->trace_start, IPR_TRACE_START_LABEL); 6183 sprintf(ioa_cfg->trace_start, IPR_TRACE_START_LABEL);
5647 sprintf(ioa_cfg->ipr_free_label, IPR_FREEQ_LABEL); 6184 sprintf(ioa_cfg->ipr_free_label, IPR_FREEQ_LABEL);
@@ -5660,6 +6197,10 @@ static void __devinit ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg,
5660 INIT_WORK(&ioa_cfg->work_q, ipr_worker_thread, ioa_cfg); 6197 INIT_WORK(&ioa_cfg->work_q, ipr_worker_thread, ioa_cfg);
5661 init_waitqueue_head(&ioa_cfg->reset_wait_q); 6198 init_waitqueue_head(&ioa_cfg->reset_wait_q);
5662 ioa_cfg->sdt_state = INACTIVE; 6199 ioa_cfg->sdt_state = INACTIVE;
6200 if (ipr_enable_cache)
6201 ioa_cfg->cache_state = CACHE_ENABLED;
6202 else
6203 ioa_cfg->cache_state = CACHE_DISABLED;
5663 6204
5664 ipr_initialize_bus_attr(ioa_cfg); 6205 ipr_initialize_bus_attr(ioa_cfg);
5665 6206
@@ -6008,6 +6549,7 @@ static int __devinit ipr_probe(struct pci_dev *pdev,
6008 ipr_scan_vsets(ioa_cfg); 6549 ipr_scan_vsets(ioa_cfg);
6009 scsi_add_device(ioa_cfg->host, IPR_IOA_BUS, IPR_IOA_TARGET, IPR_IOA_LUN); 6550 scsi_add_device(ioa_cfg->host, IPR_IOA_BUS, IPR_IOA_TARGET, IPR_IOA_LUN);
6010 ioa_cfg->allow_ml_add_del = 1; 6551 ioa_cfg->allow_ml_add_del = 1;
6552 ioa_cfg->host->max_channel = IPR_VSET_BUS;
6011 schedule_work(&ioa_cfg->work_q); 6553 schedule_work(&ioa_cfg->work_q);
6012 return 0; 6554 return 0;
6013} 6555}
@@ -6055,12 +6597,30 @@ static struct pci_device_id ipr_pci_table[] __devinitdata = {
6055 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, 6597 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE,
6056 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571A, 6598 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571A,
6057 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, 6599 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] },
6600 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE,
6601 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575B,
6602 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] },
6603 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN,
6604 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A,
6605 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] },
6606 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN,
6607 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B,
6608 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] },
6609 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN,
6610 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A,
6611 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] },
6612 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN,
6613 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B,
6614 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] },
6058 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE, 6615 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE,
6059 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_2780, 6616 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_2780,
6060 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] }, 6617 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] },
6061 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, 6618 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP,
6062 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571E, 6619 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571E,
6063 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] }, 6620 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] },
6621 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP,
6622 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571F,
6623 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] },
6064 { } 6624 { }
6065}; 6625};
6066MODULE_DEVICE_TABLE(pci, ipr_pci_table); 6626MODULE_DEVICE_TABLE(pci, ipr_pci_table);
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 8cf967108500..6bec673c925c 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -36,23 +36,8 @@
36/* 36/*
37 * Literals 37 * Literals
38 */ 38 */
39#define IPR_DRIVER_VERSION "2.0.14" 39#define IPR_DRIVER_VERSION "2.1.0"
40#define IPR_DRIVER_DATE "(May 2, 2005)" 40#define IPR_DRIVER_DATE "(October 31, 2005)"
41
42/*
43 * IPR_DBG_TRACE: Setting this to 1 will turn on some general function tracing
44 * resulting in a bunch of extra debugging printks to the console
45 *
46 * IPR_DEBUG: Setting this to 1 will turn on some error path tracing.
47 * Enables the ipr_trace macro.
48 */
49#ifdef IPR_DEBUG_ALL
50#define IPR_DEBUG 1
51#define IPR_DBG_TRACE 1
52#else
53#define IPR_DEBUG 0
54#define IPR_DBG_TRACE 0
55#endif
56 41
57/* 42/*
58 * IPR_MAX_CMD_PER_LUN: This defines the maximum number of outstanding 43 * IPR_MAX_CMD_PER_LUN: This defines the maximum number of outstanding
@@ -76,6 +61,10 @@
76#define IPR_SUBS_DEV_ID_571A 0x02C0 61#define IPR_SUBS_DEV_ID_571A 0x02C0
77#define IPR_SUBS_DEV_ID_571B 0x02BE 62#define IPR_SUBS_DEV_ID_571B 0x02BE
78#define IPR_SUBS_DEV_ID_571E 0x02BF 63#define IPR_SUBS_DEV_ID_571E 0x02BF
64#define IPR_SUBS_DEV_ID_571F 0x02D5
65#define IPR_SUBS_DEV_ID_572A 0x02C1
66#define IPR_SUBS_DEV_ID_572B 0x02C2
67#define IPR_SUBS_DEV_ID_575B 0x030D
79 68
80#define IPR_NAME "ipr" 69#define IPR_NAME "ipr"
81 70
@@ -95,7 +84,10 @@
95#define IPR_IOASC_HW_DEV_BUS_STATUS 0x04448500 84#define IPR_IOASC_HW_DEV_BUS_STATUS 0x04448500
96#define IPR_IOASC_IOASC_MASK 0xFFFFFF00 85#define IPR_IOASC_IOASC_MASK 0xFFFFFF00
97#define IPR_IOASC_SCSI_STATUS_MASK 0x000000FF 86#define IPR_IOASC_SCSI_STATUS_MASK 0x000000FF
87#define IPR_IOASC_IR_INVALID_REQ_TYPE_OR_PKT 0x05240000
98#define IPR_IOASC_IR_RESOURCE_HANDLE 0x05250000 88#define IPR_IOASC_IR_RESOURCE_HANDLE 0x05250000
89#define IPR_IOASC_IR_NO_CMDS_TO_2ND_IOA 0x05258100
90#define IPR_IOASA_IR_DUAL_IOA_DISABLED 0x052C8000
99#define IPR_IOASC_BUS_WAS_RESET 0x06290000 91#define IPR_IOASC_BUS_WAS_RESET 0x06290000
100#define IPR_IOASC_BUS_WAS_RESET_BY_OTHER 0x06298000 92#define IPR_IOASC_BUS_WAS_RESET_BY_OTHER 0x06298000
101#define IPR_IOASC_ABORTED_CMD_TERM_BY_HOST 0x0B5A0000 93#define IPR_IOASC_ABORTED_CMD_TERM_BY_HOST 0x0B5A0000
@@ -107,14 +99,14 @@
107#define IPR_NUM_LOG_HCAMS 2 99#define IPR_NUM_LOG_HCAMS 2
108#define IPR_NUM_CFG_CHG_HCAMS 2 100#define IPR_NUM_CFG_CHG_HCAMS 2
109#define IPR_NUM_HCAMS (IPR_NUM_LOG_HCAMS + IPR_NUM_CFG_CHG_HCAMS) 101#define IPR_NUM_HCAMS (IPR_NUM_LOG_HCAMS + IPR_NUM_CFG_CHG_HCAMS)
110#define IPR_MAX_NUM_TARGETS_PER_BUS 0x10 102#define IPR_MAX_NUM_TARGETS_PER_BUS 256
111#define IPR_MAX_NUM_LUNS_PER_TARGET 256 103#define IPR_MAX_NUM_LUNS_PER_TARGET 256
112#define IPR_MAX_NUM_VSET_LUNS_PER_TARGET 8 104#define IPR_MAX_NUM_VSET_LUNS_PER_TARGET 8
113#define IPR_VSET_BUS 0xff 105#define IPR_VSET_BUS 0xff
114#define IPR_IOA_BUS 0xff 106#define IPR_IOA_BUS 0xff
115#define IPR_IOA_TARGET 0xff 107#define IPR_IOA_TARGET 0xff
116#define IPR_IOA_LUN 0xff 108#define IPR_IOA_LUN 0xff
117#define IPR_MAX_NUM_BUSES 4 109#define IPR_MAX_NUM_BUSES 8
118#define IPR_MAX_BUS_TO_SCAN IPR_MAX_NUM_BUSES 110#define IPR_MAX_BUS_TO_SCAN IPR_MAX_NUM_BUSES
119 111
120#define IPR_NUM_RESET_RELOAD_RETRIES 3 112#define IPR_NUM_RESET_RELOAD_RETRIES 3
@@ -205,6 +197,7 @@
205#define IPR_SDT_FMT2_EXP_ROM_SEL 0x8 197#define IPR_SDT_FMT2_EXP_ROM_SEL 0x8
206#define IPR_FMT2_SDT_READY_TO_USE 0xC4D4E3F2 198#define IPR_FMT2_SDT_READY_TO_USE 0xC4D4E3F2
207#define IPR_DOORBELL 0x82800000 199#define IPR_DOORBELL 0x82800000
200#define IPR_RUNTIME_RESET 0x40000000
208 201
209#define IPR_PCII_IOA_TRANS_TO_OPER (0x80000000 >> 0) 202#define IPR_PCII_IOA_TRANS_TO_OPER (0x80000000 >> 0)
210#define IPR_PCII_IOARCB_XFER_FAILED (0x80000000 >> 3) 203#define IPR_PCII_IOARCB_XFER_FAILED (0x80000000 >> 3)
@@ -261,6 +254,16 @@ struct ipr_std_inq_vpids {
261 u8 product_id[IPR_PROD_ID_LEN]; 254 u8 product_id[IPR_PROD_ID_LEN];
262}__attribute__((packed)); 255}__attribute__((packed));
263 256
257struct ipr_vpd {
258 struct ipr_std_inq_vpids vpids;
259 u8 sn[IPR_SERIAL_NUM_LEN];
260}__attribute__((packed));
261
262struct ipr_ext_vpd {
263 struct ipr_vpd vpd;
264 __be32 wwid[2];
265}__attribute__((packed));
266
264struct ipr_std_inq_data { 267struct ipr_std_inq_data {
265 u8 peri_qual_dev_type; 268 u8 peri_qual_dev_type;
266#define IPR_STD_INQ_PERI_QUAL(peri) ((peri) >> 5) 269#define IPR_STD_INQ_PERI_QUAL(peri) ((peri) >> 5)
@@ -304,6 +307,10 @@ struct ipr_config_table_entry {
304#define IPR_SUBTYPE_GENERIC_SCSI 1 307#define IPR_SUBTYPE_GENERIC_SCSI 1
305#define IPR_SUBTYPE_VOLUME_SET 2 308#define IPR_SUBTYPE_VOLUME_SET 2
306 309
310#define IPR_QUEUEING_MODEL(res) ((((res)->cfgte.flags) & 0x70) >> 4)
311#define IPR_QUEUE_FROZEN_MODEL 0
312#define IPR_QUEUE_NACA_MODEL 1
313
307 struct ipr_res_addr res_addr; 314 struct ipr_res_addr res_addr;
308 __be32 res_handle; 315 __be32 res_handle;
309 __be32 reserved4[2]; 316 __be32 reserved4[2];
@@ -410,23 +417,26 @@ struct ipr_ioadl_desc {
410struct ipr_ioasa_vset { 417struct ipr_ioasa_vset {
411 __be32 failing_lba_hi; 418 __be32 failing_lba_hi;
412 __be32 failing_lba_lo; 419 __be32 failing_lba_lo;
413 __be32 ioa_data[22]; 420 __be32 reserved;
414}__attribute__((packed, aligned (4))); 421}__attribute__((packed, aligned (4)));
415 422
416struct ipr_ioasa_af_dasd { 423struct ipr_ioasa_af_dasd {
417 __be32 failing_lba; 424 __be32 failing_lba;
425 __be32 reserved[2];
418}__attribute__((packed, aligned (4))); 426}__attribute__((packed, aligned (4)));
419 427
420struct ipr_ioasa_gpdd { 428struct ipr_ioasa_gpdd {
421 u8 end_state; 429 u8 end_state;
422 u8 bus_phase; 430 u8 bus_phase;
423 __be16 reserved; 431 __be16 reserved;
424 __be32 ioa_data[23]; 432 __be32 ioa_data[2];
425}__attribute__((packed, aligned (4))); 433}__attribute__((packed, aligned (4)));
426 434
427struct ipr_ioasa_raw { 435struct ipr_auto_sense {
428 __be32 ioa_data[24]; 436 __be16 auto_sense_len;
429}__attribute__((packed, aligned (4))); 437 __be16 ioa_data_len;
438 __be32 data[SCSI_SENSE_BUFFERSIZE/sizeof(__be32)];
439};
430 440
431struct ipr_ioasa { 441struct ipr_ioasa {
432 __be32 ioasc; 442 __be32 ioasc;
@@ -453,6 +463,8 @@ struct ipr_ioasa {
453 __be32 fd_res_handle; 463 __be32 fd_res_handle;
454 464
455 __be32 ioasc_specific; /* status code specific field */ 465 __be32 ioasc_specific; /* status code specific field */
466#define IPR_ADDITIONAL_STATUS_FMT 0x80000000
467#define IPR_AUTOSENSE_VALID 0x40000000
456#define IPR_IOASC_SPECIFIC_MASK 0x00ffffff 468#define IPR_IOASC_SPECIFIC_MASK 0x00ffffff
457#define IPR_FIELD_POINTER_VALID (0x80000000 >> 8) 469#define IPR_FIELD_POINTER_VALID (0x80000000 >> 8)
458#define IPR_FIELD_POINTER_MASK 0x0000ffff 470#define IPR_FIELD_POINTER_MASK 0x0000ffff
@@ -461,8 +473,9 @@ struct ipr_ioasa {
461 struct ipr_ioasa_vset vset; 473 struct ipr_ioasa_vset vset;
462 struct ipr_ioasa_af_dasd dasd; 474 struct ipr_ioasa_af_dasd dasd;
463 struct ipr_ioasa_gpdd gpdd; 475 struct ipr_ioasa_gpdd gpdd;
464 struct ipr_ioasa_raw raw;
465 } u; 476 } u;
477
478 struct ipr_auto_sense auto_sense;
466}__attribute__((packed, aligned (4))); 479}__attribute__((packed, aligned (4)));
467 480
468struct ipr_mode_parm_hdr { 481struct ipr_mode_parm_hdr {
@@ -536,28 +549,49 @@ struct ipr_inquiry_page3 {
536 u8 patch_number[4]; 549 u8 patch_number[4];
537}__attribute__((packed)); 550}__attribute__((packed));
538 551
552#define IPR_INQUIRY_PAGE0_ENTRIES 20
553struct ipr_inquiry_page0 {
554 u8 peri_qual_dev_type;
555 u8 page_code;
556 u8 reserved1;
557 u8 len;
558 u8 page[IPR_INQUIRY_PAGE0_ENTRIES];
559}__attribute__((packed));
560
539struct ipr_hostrcb_device_data_entry { 561struct ipr_hostrcb_device_data_entry {
540 struct ipr_std_inq_vpids dev_vpids; 562 struct ipr_vpd vpd;
541 u8 dev_sn[IPR_SERIAL_NUM_LEN];
542 struct ipr_res_addr dev_res_addr; 563 struct ipr_res_addr dev_res_addr;
543 struct ipr_std_inq_vpids new_dev_vpids; 564 struct ipr_vpd new_vpd;
544 u8 new_dev_sn[IPR_SERIAL_NUM_LEN]; 565 struct ipr_vpd ioa_last_with_dev_vpd;
545 struct ipr_std_inq_vpids ioa_last_with_dev_vpids; 566 struct ipr_vpd cfc_last_with_dev_vpd;
546 u8 ioa_last_with_dev_sn[IPR_SERIAL_NUM_LEN];
547 struct ipr_std_inq_vpids cfc_last_with_dev_vpids;
548 u8 cfc_last_with_dev_sn[IPR_SERIAL_NUM_LEN];
549 __be32 ioa_data[5]; 567 __be32 ioa_data[5];
550}__attribute__((packed, aligned (4))); 568}__attribute__((packed, aligned (4)));
551 569
570struct ipr_hostrcb_device_data_entry_enhanced {
571 struct ipr_ext_vpd vpd;
572 u8 ccin[4];
573 struct ipr_res_addr dev_res_addr;
574 struct ipr_ext_vpd new_vpd;
575 u8 new_ccin[4];
576 struct ipr_ext_vpd ioa_last_with_dev_vpd;
577 struct ipr_ext_vpd cfc_last_with_dev_vpd;
578}__attribute__((packed, aligned (4)));
579
552struct ipr_hostrcb_array_data_entry { 580struct ipr_hostrcb_array_data_entry {
553 struct ipr_std_inq_vpids vpids; 581 struct ipr_vpd vpd;
554 u8 serial_num[IPR_SERIAL_NUM_LEN]; 582 struct ipr_res_addr expected_dev_res_addr;
583 struct ipr_res_addr dev_res_addr;
584}__attribute__((packed, aligned (4)));
585
586struct ipr_hostrcb_array_data_entry_enhanced {
587 struct ipr_ext_vpd vpd;
588 u8 ccin[4];
555 struct ipr_res_addr expected_dev_res_addr; 589 struct ipr_res_addr expected_dev_res_addr;
556 struct ipr_res_addr dev_res_addr; 590 struct ipr_res_addr dev_res_addr;
557}__attribute__((packed, aligned (4))); 591}__attribute__((packed, aligned (4)));
558 592
559struct ipr_hostrcb_type_ff_error { 593struct ipr_hostrcb_type_ff_error {
560 __be32 ioa_data[246]; 594 __be32 ioa_data[502];
561}__attribute__((packed, aligned (4))); 595}__attribute__((packed, aligned (4)));
562 596
563struct ipr_hostrcb_type_01_error { 597struct ipr_hostrcb_type_01_error {
@@ -568,47 +602,75 @@ struct ipr_hostrcb_type_01_error {
568}__attribute__((packed, aligned (4))); 602}__attribute__((packed, aligned (4)));
569 603
570struct ipr_hostrcb_type_02_error { 604struct ipr_hostrcb_type_02_error {
571 struct ipr_std_inq_vpids ioa_vpids; 605 struct ipr_vpd ioa_vpd;
572 u8 ioa_sn[IPR_SERIAL_NUM_LEN]; 606 struct ipr_vpd cfc_vpd;
573 struct ipr_std_inq_vpids cfc_vpids; 607 struct ipr_vpd ioa_last_attached_to_cfc_vpd;
574 u8 cfc_sn[IPR_SERIAL_NUM_LEN]; 608 struct ipr_vpd cfc_last_attached_to_ioa_vpd;
575 struct ipr_std_inq_vpids ioa_last_attached_to_cfc_vpids; 609 __be32 ioa_data[3];
576 u8 ioa_last_attached_to_cfc_sn[IPR_SERIAL_NUM_LEN]; 610}__attribute__((packed, aligned (4)));
577 struct ipr_std_inq_vpids cfc_last_attached_to_ioa_vpids; 611
578 u8 cfc_last_attached_to_ioa_sn[IPR_SERIAL_NUM_LEN]; 612struct ipr_hostrcb_type_12_error {
613 struct ipr_ext_vpd ioa_vpd;
614 struct ipr_ext_vpd cfc_vpd;
615 struct ipr_ext_vpd ioa_last_attached_to_cfc_vpd;
616 struct ipr_ext_vpd cfc_last_attached_to_ioa_vpd;
579 __be32 ioa_data[3]; 617 __be32 ioa_data[3];
580 u8 reserved[844];
581}__attribute__((packed, aligned (4))); 618}__attribute__((packed, aligned (4)));
582 619
583struct ipr_hostrcb_type_03_error { 620struct ipr_hostrcb_type_03_error {
584 struct ipr_std_inq_vpids ioa_vpids; 621 struct ipr_vpd ioa_vpd;
585 u8 ioa_sn[IPR_SERIAL_NUM_LEN]; 622 struct ipr_vpd cfc_vpd;
586 struct ipr_std_inq_vpids cfc_vpids;
587 u8 cfc_sn[IPR_SERIAL_NUM_LEN];
588 __be32 errors_detected; 623 __be32 errors_detected;
589 __be32 errors_logged; 624 __be32 errors_logged;
590 u8 ioa_data[12]; 625 u8 ioa_data[12];
591 struct ipr_hostrcb_device_data_entry dev_entry[3]; 626 struct ipr_hostrcb_device_data_entry dev[3];
592 u8 reserved[444]; 627}__attribute__((packed, aligned (4)));
628
629struct ipr_hostrcb_type_13_error {
630 struct ipr_ext_vpd ioa_vpd;
631 struct ipr_ext_vpd cfc_vpd;
632 __be32 errors_detected;
633 __be32 errors_logged;
634 struct ipr_hostrcb_device_data_entry_enhanced dev[3];
593}__attribute__((packed, aligned (4))); 635}__attribute__((packed, aligned (4)));
594 636
595struct ipr_hostrcb_type_04_error { 637struct ipr_hostrcb_type_04_error {
596 struct ipr_std_inq_vpids ioa_vpids; 638 struct ipr_vpd ioa_vpd;
597 u8 ioa_sn[IPR_SERIAL_NUM_LEN]; 639 struct ipr_vpd cfc_vpd;
598 struct ipr_std_inq_vpids cfc_vpids;
599 u8 cfc_sn[IPR_SERIAL_NUM_LEN];
600 u8 ioa_data[12]; 640 u8 ioa_data[12];
601 struct ipr_hostrcb_array_data_entry array_member[10]; 641 struct ipr_hostrcb_array_data_entry array_member[10];
602 __be32 exposed_mode_adn; 642 __be32 exposed_mode_adn;
603 __be32 array_id; 643 __be32 array_id;
604 struct ipr_std_inq_vpids incomp_dev_vpids; 644 struct ipr_vpd incomp_dev_vpd;
605 u8 incomp_dev_sn[IPR_SERIAL_NUM_LEN];
606 __be32 ioa_data2; 645 __be32 ioa_data2;
607 struct ipr_hostrcb_array_data_entry array_member2[8]; 646 struct ipr_hostrcb_array_data_entry array_member2[8];
608 struct ipr_res_addr last_func_vset_res_addr; 647 struct ipr_res_addr last_func_vset_res_addr;
609 u8 vset_serial_num[IPR_SERIAL_NUM_LEN]; 648 u8 vset_serial_num[IPR_SERIAL_NUM_LEN];
610 u8 protection_level[8]; 649 u8 protection_level[8];
611 u8 reserved[124]; 650}__attribute__((packed, aligned (4)));
651
652struct ipr_hostrcb_type_14_error {
653 struct ipr_ext_vpd ioa_vpd;
654 struct ipr_ext_vpd cfc_vpd;
655 __be32 exposed_mode_adn;
656 __be32 array_id;
657 struct ipr_res_addr last_func_vset_res_addr;
658 u8 vset_serial_num[IPR_SERIAL_NUM_LEN];
659 u8 protection_level[8];
660 __be32 num_entries;
661 struct ipr_hostrcb_array_data_entry_enhanced array_member[18];
662}__attribute__((packed, aligned (4)));
663
664struct ipr_hostrcb_type_07_error {
665 u8 failure_reason[64];
666 struct ipr_vpd vpd;
667 u32 data[222];
668}__attribute__((packed, aligned (4)));
669
670struct ipr_hostrcb_type_17_error {
671 u8 failure_reason[64];
672 struct ipr_ext_vpd vpd;
673 u32 data[476];
612}__attribute__((packed, aligned (4))); 674}__attribute__((packed, aligned (4)));
613 675
614struct ipr_hostrcb_error { 676struct ipr_hostrcb_error {
@@ -622,6 +684,11 @@ struct ipr_hostrcb_error {
622 struct ipr_hostrcb_type_02_error type_02_error; 684 struct ipr_hostrcb_type_02_error type_02_error;
623 struct ipr_hostrcb_type_03_error type_03_error; 685 struct ipr_hostrcb_type_03_error type_03_error;
624 struct ipr_hostrcb_type_04_error type_04_error; 686 struct ipr_hostrcb_type_04_error type_04_error;
687 struct ipr_hostrcb_type_07_error type_07_error;
688 struct ipr_hostrcb_type_12_error type_12_error;
689 struct ipr_hostrcb_type_13_error type_13_error;
690 struct ipr_hostrcb_type_14_error type_14_error;
691 struct ipr_hostrcb_type_17_error type_17_error;
625 } u; 692 } u;
626}__attribute__((packed, aligned (4))); 693}__attribute__((packed, aligned (4)));
627 694
@@ -655,6 +722,12 @@ struct ipr_hcam {
655#define IPR_HOST_RCB_OVERLAY_ID_3 0x03 722#define IPR_HOST_RCB_OVERLAY_ID_3 0x03
656#define IPR_HOST_RCB_OVERLAY_ID_4 0x04 723#define IPR_HOST_RCB_OVERLAY_ID_4 0x04
657#define IPR_HOST_RCB_OVERLAY_ID_6 0x06 724#define IPR_HOST_RCB_OVERLAY_ID_6 0x06
725#define IPR_HOST_RCB_OVERLAY_ID_7 0x07
726#define IPR_HOST_RCB_OVERLAY_ID_12 0x12
727#define IPR_HOST_RCB_OVERLAY_ID_13 0x13
728#define IPR_HOST_RCB_OVERLAY_ID_14 0x14
729#define IPR_HOST_RCB_OVERLAY_ID_16 0x16
730#define IPR_HOST_RCB_OVERLAY_ID_17 0x17
658#define IPR_HOST_RCB_OVERLAY_ID_DEFAULT 0xFF 731#define IPR_HOST_RCB_OVERLAY_ID_DEFAULT 0xFF
659 732
660 u8 reserved1[3]; 733 u8 reserved1[3];
@@ -743,6 +816,7 @@ struct ipr_resource_table {
743 816
744struct ipr_misc_cbs { 817struct ipr_misc_cbs {
745 struct ipr_ioa_vpd ioa_vpd; 818 struct ipr_ioa_vpd ioa_vpd;
819 struct ipr_inquiry_page0 page0_data;
746 struct ipr_inquiry_page3 page3_data; 820 struct ipr_inquiry_page3 page3_data;
747 struct ipr_mode_pages mode_pages; 821 struct ipr_mode_pages mode_pages;
748 struct ipr_supported_device supp_dev; 822 struct ipr_supported_device supp_dev;
@@ -813,6 +887,7 @@ struct ipr_trace_entry {
813struct ipr_sglist { 887struct ipr_sglist {
814 u32 order; 888 u32 order;
815 u32 num_sg; 889 u32 num_sg;
890 u32 num_dma_sg;
816 u32 buffer_len; 891 u32 buffer_len;
817 struct scatterlist scatterlist[1]; 892 struct scatterlist scatterlist[1];
818}; 893};
@@ -825,6 +900,13 @@ enum ipr_sdt_state {
825 DUMP_OBTAINED 900 DUMP_OBTAINED
826}; 901};
827 902
903enum ipr_cache_state {
904 CACHE_NONE,
905 CACHE_DISABLED,
906 CACHE_ENABLED,
907 CACHE_INVALID
908};
909
828/* Per-controller data */ 910/* Per-controller data */
829struct ipr_ioa_cfg { 911struct ipr_ioa_cfg {
830 char eye_catcher[8]; 912 char eye_catcher[8];
@@ -841,6 +923,7 @@ struct ipr_ioa_cfg {
841 u8 allow_cmds:1; 923 u8 allow_cmds:1;
842 u8 allow_ml_add_del:1; 924 u8 allow_ml_add_del:1;
843 925
926 enum ipr_cache_state cache_state;
844 u16 type; /* CCIN of the card */ 927 u16 type; /* CCIN of the card */
845 928
846 u8 log_level; 929 u8 log_level;
@@ -911,6 +994,7 @@ struct ipr_ioa_cfg {
911 u16 reset_retries; 994 u16 reset_retries;
912 995
913 u32 errors_logged; 996 u32 errors_logged;
997 u32 doorbell;
914 998
915 struct Scsi_Host *host; 999 struct Scsi_Host *host;
916 struct pci_dev *pdev; 1000 struct pci_dev *pdev;
@@ -948,6 +1032,7 @@ struct ipr_cmnd {
948 struct timer_list timer; 1032 struct timer_list timer;
949 void (*done) (struct ipr_cmnd *); 1033 void (*done) (struct ipr_cmnd *);
950 int (*job_step) (struct ipr_cmnd *); 1034 int (*job_step) (struct ipr_cmnd *);
1035 int (*job_step_failed) (struct ipr_cmnd *);
951 u16 cmd_index; 1036 u16 cmd_index;
952 u8 sense_buffer[SCSI_SENSE_BUFFERSIZE]; 1037 u8 sense_buffer[SCSI_SENSE_BUFFERSIZE];
953 dma_addr_t sense_buffer_dma; 1038 dma_addr_t sense_buffer_dma;
@@ -1083,11 +1168,7 @@ struct ipr_ucode_image_header {
1083/* 1168/*
1084 * Macros 1169 * Macros
1085 */ 1170 */
1086#if IPR_DEBUG 1171#define IPR_DBG_CMD(CMD) if (ipr_debug) { CMD; }
1087#define IPR_DBG_CMD(CMD) do { CMD; } while (0)
1088#else
1089#define IPR_DBG_CMD(CMD)
1090#endif
1091 1172
1092#ifdef CONFIG_SCSI_IPR_TRACE 1173#ifdef CONFIG_SCSI_IPR_TRACE
1093#define ipr_create_trace_file(kobj, attr) sysfs_create_bin_file(kobj, attr) 1174#define ipr_create_trace_file(kobj, attr) sysfs_create_bin_file(kobj, attr)
@@ -1135,16 +1216,22 @@ struct ipr_ucode_image_header {
1135#define ipr_res_dbg(ioa_cfg, res, fmt, ...) \ 1216#define ipr_res_dbg(ioa_cfg, res, fmt, ...) \
1136 IPR_DBG_CMD(ipr_res_printk(KERN_INFO, ioa_cfg, res, fmt, ##__VA_ARGS__)) 1217 IPR_DBG_CMD(ipr_res_printk(KERN_INFO, ioa_cfg, res, fmt, ##__VA_ARGS__))
1137 1218
1219#define ipr_phys_res_err(ioa_cfg, res, fmt, ...) \
1220{ \
1221 if ((res).bus >= IPR_MAX_NUM_BUSES) { \
1222 ipr_err(fmt": unknown\n", ##__VA_ARGS__); \
1223 } else { \
1224 ipr_err(fmt": %d:%d:%d:%d\n", \
1225 ##__VA_ARGS__, (ioa_cfg)->host->host_no, \
1226 (res).bus, (res).target, (res).lun); \
1227 } \
1228}
1229
1138#define ipr_trace ipr_dbg("%s: %s: Line: %d\n",\ 1230#define ipr_trace ipr_dbg("%s: %s: Line: %d\n",\
1139 __FILE__, __FUNCTION__, __LINE__) 1231 __FILE__, __FUNCTION__, __LINE__)
1140 1232
1141#if IPR_DBG_TRACE 1233#define ENTER IPR_DBG_CMD(printk(KERN_INFO IPR_NAME": Entering %s\n", __FUNCTION__))
1142#define ENTER printk(KERN_INFO IPR_NAME": Entering %s\n", __FUNCTION__) 1234#define LEAVE IPR_DBG_CMD(printk(KERN_INFO IPR_NAME": Leaving %s\n", __FUNCTION__))
1143#define LEAVE printk(KERN_INFO IPR_NAME": Leaving %s\n", __FUNCTION__)
1144#else
1145#define ENTER
1146#define LEAVE
1147#endif
1148 1235
1149#define ipr_err_separator \ 1236#define ipr_err_separator \
1150ipr_err("----------------------------------------------------------\n") 1237ipr_err("----------------------------------------------------------\n")
@@ -1217,6 +1304,20 @@ static inline int ipr_is_gscsi(struct ipr_resource_entry *res)
1217} 1304}
1218 1305
1219/** 1306/**
1307 * ipr_is_naca_model - Determine if a resource is using NACA queueing model
1308 * @res: resource entry struct
1309 *
1310 * Return value:
1311 * 1 if NACA queueing model / 0 if not NACA queueing model
1312 **/
1313static inline int ipr_is_naca_model(struct ipr_resource_entry *res)
1314{
1315 if (ipr_is_gscsi(res) && IPR_QUEUEING_MODEL(res) == IPR_QUEUE_NACA_MODEL)
1316 return 1;
1317 return 0;
1318}
1319
1320/**
1220 * ipr_is_device - Determine if resource address is that of a device 1321 * ipr_is_device - Determine if resource address is that of a device
1221 * @res_addr: resource address struct 1322 * @res_addr: resource address struct
1222 * 1323 *
@@ -1226,7 +1327,7 @@ static inline int ipr_is_gscsi(struct ipr_resource_entry *res)
1226static inline int ipr_is_device(struct ipr_res_addr *res_addr) 1327static inline int ipr_is_device(struct ipr_res_addr *res_addr)
1227{ 1328{
1228 if ((res_addr->bus < IPR_MAX_NUM_BUSES) && 1329 if ((res_addr->bus < IPR_MAX_NUM_BUSES) &&
1229 (res_addr->target < IPR_MAX_NUM_TARGETS_PER_BUS)) 1330 (res_addr->target < (IPR_MAX_NUM_TARGETS_PER_BUS - 1)))
1230 return 1; 1331 return 1;
1231 1332
1232 return 0; 1333 return 0;
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index cd9b95db5a7d..3882d48a42bf 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -139,6 +139,7 @@
139/* - Remove 3 unused "inline" functions */ 139/* - Remove 3 unused "inline" functions */
140/* 7.12.xx - Use STATIC functions whereever possible */ 140/* 7.12.xx - Use STATIC functions whereever possible */
141/* - Clean up deprecated MODULE_PARM calls */ 141/* - Clean up deprecated MODULE_PARM calls */
142/* 7.12.05 - Remove Version Matching per IBM request */
142/*****************************************************************************/ 143/*****************************************************************************/
143 144
144/* 145/*
@@ -210,7 +211,7 @@ module_param(ips, charp, 0);
210 * DRIVER_VER 211 * DRIVER_VER
211 */ 212 */
212#define IPS_VERSION_HIGH "7.12" 213#define IPS_VERSION_HIGH "7.12"
213#define IPS_VERSION_LOW ".02 " 214#define IPS_VERSION_LOW ".05 "
214 215
215#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__) 216#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__)
216#warning "This driver has only been tested on the x86/ia64/x86_64 platforms" 217#warning "This driver has only been tested on the x86/ia64/x86_64 platforms"
@@ -247,7 +248,7 @@ module_param(ips, charp, 0);
247/* 248/*
248 * Function prototypes 249 * Function prototypes
249 */ 250 */
250static int ips_detect(Scsi_Host_Template *); 251static int ips_detect(struct scsi_host_template *);
251static int ips_release(struct Scsi_Host *); 252static int ips_release(struct Scsi_Host *);
252static int ips_eh_abort(Scsi_Cmnd *); 253static int ips_eh_abort(Scsi_Cmnd *);
253static int ips_eh_reset(Scsi_Cmnd *); 254static int ips_eh_reset(Scsi_Cmnd *);
@@ -347,8 +348,6 @@ static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
347static int ips_host_info(ips_ha_t *, char *, off_t, int); 348static int ips_host_info(ips_ha_t *, char *, off_t, int);
348static void copy_mem_info(IPS_INFOSTR *, char *, int); 349static void copy_mem_info(IPS_INFOSTR *, char *, int);
349static int copy_info(IPS_INFOSTR *, char *, ...); 350static int copy_info(IPS_INFOSTR *, char *, ...);
350static int ips_get_version_info(ips_ha_t * ha, dma_addr_t, int intr);
351static void ips_version_check(ips_ha_t * ha, int intr);
352static int ips_abort_init(ips_ha_t * ha, int index); 351static int ips_abort_init(ips_ha_t * ha, int index);
353static int ips_init_phase2(int index); 352static int ips_init_phase2(int index);
354 353
@@ -378,7 +377,7 @@ static char *ips_FlashData = NULL; /* CD Boot - Flash Data Buffer */
378static dma_addr_t ips_flashbusaddr; 377static dma_addr_t ips_flashbusaddr;
379static long ips_FlashDataInUse; /* CD Boot - Flash Data In Use Flag */ 378static long ips_FlashDataInUse; /* CD Boot - Flash Data In Use Flag */
380static uint32_t MaxLiteCmds = 32; /* Max Active Cmds for a Lite Adapter */ 379static uint32_t MaxLiteCmds = 32; /* Max Active Cmds for a Lite Adapter */
381static Scsi_Host_Template ips_driver_template = { 380static struct scsi_host_template ips_driver_template = {
382 .detect = ips_detect, 381 .detect = ips_detect,
383 .release = ips_release, 382 .release = ips_release,
384 .info = ips_info, 383 .info = ips_info,
@@ -406,8 +405,6 @@ static Scsi_Host_Template ips_driver_template = {
406#endif 405#endif
407}; 406};
408 407
409static IPS_DEFINE_COMPAT_TABLE( Compatable ); /* Version Compatability Table */
410
411 408
412/* This table describes all ServeRAID Adapters */ 409/* This table describes all ServeRAID Adapters */
413static struct pci_device_id ips_pci_table[] = { 410static struct pci_device_id ips_pci_table[] = {
@@ -590,7 +587,7 @@ __setup("ips=", ips_setup);
590/* */ 587/* */
591/****************************************************************************/ 588/****************************************************************************/
592static int 589static int
593ips_detect(Scsi_Host_Template * SHT) 590ips_detect(struct scsi_host_template * SHT)
594{ 591{
595 int i; 592 int i;
596 593
@@ -1265,9 +1262,9 @@ ips_proc24_info(char *buffer, char **start, off_t offset, int length,
1265/* */ 1262/* */
1266/****************************************************************************/ 1263/****************************************************************************/
1267static void 1264static void
1268ips_select_queue_depth(struct Scsi_Host *host, Scsi_Device * scsi_devs) 1265ips_select_queue_depth(struct Scsi_Host *host, struct scsi_device * scsi_devs)
1269{ 1266{
1270 Scsi_Device *device; 1267 struct scsi_device *device;
1271 ips_ha_t *ha; 1268 ips_ha_t *ha;
1272 int count = 0; 1269 int count = 0;
1273 int min; 1270 int min;
@@ -1310,7 +1307,7 @@ ips_select_queue_depth(struct Scsi_Host *host, Scsi_Device * scsi_devs)
1310/* */ 1307/* */
1311/****************************************************************************/ 1308/****************************************************************************/
1312static int 1309static int
1313ips_slave_configure(Scsi_Device * SDptr) 1310ips_slave_configure(struct scsi_device * SDptr)
1314{ 1311{
1315 ips_ha_t *ha; 1312 ips_ha_t *ha;
1316 int min; 1313 int min;
@@ -5930,7 +5927,7 @@ ips_write_driver_status(ips_ha_t * ha, int intr)
5930 strncpy((char *) ha->nvram->bios_high, ha->bios_version, 4); 5927 strncpy((char *) ha->nvram->bios_high, ha->bios_version, 4);
5931 strncpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4); 5928 strncpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4);
5932 5929
5933 ips_version_check(ha, intr); /* Check BIOS/FW/Driver Versions */ 5930 ha->nvram->versioning = 0; /* Indicate the Driver Does Not Support Versioning */
5934 5931
5935 /* now update the page */ 5932 /* now update the page */
5936 if (!ips_readwrite_page5(ha, TRUE, intr)) { 5933 if (!ips_readwrite_page5(ha, TRUE, intr)) {
@@ -6847,135 +6844,6 @@ ips_verify_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize,
6847 return (0); 6844 return (0);
6848} 6845}
6849 6846
6850/*---------------------------------------------------------------------------*/
6851/* Routine Name: ips_version_check */
6852/* */
6853/* Dependencies: */
6854/* Assumes that ips_read_adapter_status() is called first filling in */
6855/* the data for SubSystem Parameters. */
6856/* Called from ips_write_driver_status() so it also assumes NVRAM Page 5 */
6857/* Data is available. */
6858/* */
6859/*---------------------------------------------------------------------------*/
6860static void
6861ips_version_check(ips_ha_t * ha, int intr)
6862{
6863 IPS_VERSION_DATA *VersionInfo;
6864 uint8_t FirmwareVersion[IPS_COMPAT_ID_LENGTH + 1];
6865 uint8_t BiosVersion[IPS_COMPAT_ID_LENGTH + 1];
6866 int MatchError;
6867 int rc;
6868 char BiosString[10];
6869 char FirmwareString[10];
6870
6871 METHOD_TRACE("ips_version_check", 1);
6872
6873 VersionInfo = ( IPS_VERSION_DATA * ) ha->ioctl_data;
6874
6875 memset(FirmwareVersion, 0, IPS_COMPAT_ID_LENGTH + 1);
6876 memset(BiosVersion, 0, IPS_COMPAT_ID_LENGTH + 1);
6877
6878 /* Get the Compatible BIOS Version from NVRAM Page 5 */
6879 memcpy(BiosVersion, ha->nvram->BiosCompatibilityID,
6880 IPS_COMPAT_ID_LENGTH);
6881
6882 rc = IPS_FAILURE;
6883 if (ha->subsys->param[4] & IPS_GET_VERSION_SUPPORT) { /* If Versioning is Supported */
6884 /* Get the Version Info with a Get Version Command */
6885 memset( VersionInfo, 0, sizeof (IPS_VERSION_DATA));
6886 rc = ips_get_version_info(ha, ha->ioctl_busaddr, intr);
6887 if (rc == IPS_SUCCESS)
6888 memcpy(FirmwareVersion, VersionInfo->compatibilityId,
6889 IPS_COMPAT_ID_LENGTH);
6890 }
6891
6892 if (rc != IPS_SUCCESS) { /* If Data Not Obtainable from a GetVersion Command */
6893 /* Get the Firmware Version from Enquiry Data */
6894 memcpy(FirmwareVersion, ha->enq->CodeBlkVersion,
6895 IPS_COMPAT_ID_LENGTH);
6896 }
6897
6898 /* printk(KERN_WARNING "Adapter's BIOS Version = %s\n", BiosVersion); */
6899 /* printk(KERN_WARNING "BIOS Compatible Version = %s\n", IPS_COMPAT_BIOS); */
6900 /* printk(KERN_WARNING "Adapter's Firmware Version = %s\n", FirmwareVersion); */
6901 /* printk(KERN_WARNING "Firmware Compatible Version = %s \n", Compatable[ ha->nvram->adapter_type ]); */
6902
6903 MatchError = 0;
6904
6905 if (strncmp
6906 (FirmwareVersion, Compatable[ha->nvram->adapter_type],
6907 IPS_COMPAT_ID_LENGTH) != 0)
6908 MatchError = 1;
6909
6910 if (strncmp(BiosVersion, IPS_COMPAT_BIOS, IPS_COMPAT_ID_LENGTH) != 0)
6911 MatchError = 1;
6912
6913 ha->nvram->versioning = 1; /* Indicate the Driver Supports Versioning */
6914
6915 if (MatchError) {
6916 ha->nvram->version_mismatch = 1;
6917 if (ips_cd_boot == 0) {
6918 strncpy(&BiosString[0], ha->nvram->bios_high, 4);
6919 strncpy(&BiosString[4], ha->nvram->bios_low, 4);
6920 BiosString[8] = 0;
6921
6922 strncpy(&FirmwareString[0], ha->enq->CodeBlkVersion, 8);
6923 FirmwareString[8] = 0;
6924
6925 IPS_PRINTK(KERN_WARNING, ha->pcidev,
6926 "Warning ! ! ! ServeRAID Version Mismatch\n");
6927 IPS_PRINTK(KERN_WARNING, ha->pcidev,
6928 "Bios = %s, Firmware = %s, Device Driver = %s%s\n",
6929 BiosString, FirmwareString, IPS_VERSION_HIGH,
6930 IPS_VERSION_LOW);
6931 IPS_PRINTK(KERN_WARNING, ha->pcidev,
6932 "These levels should match to avoid possible compatibility problems.\n");
6933 }
6934 } else {
6935 ha->nvram->version_mismatch = 0;
6936 }
6937
6938 return;
6939}
6940
6941/*---------------------------------------------------------------------------*/
6942/* Routine Name: ips_get_version_info */
6943/* */
6944/* Routine Description: */
6945/* Issue an internal GETVERSION Command */
6946/* */
6947/* Return Value: */
6948/* 0 if Successful, else non-zero */
6949/*---------------------------------------------------------------------------*/
6950static int
6951ips_get_version_info(ips_ha_t * ha, dma_addr_t Buffer, int intr)
6952{
6953 ips_scb_t *scb;
6954 int rc;
6955
6956 METHOD_TRACE("ips_get_version_info", 1);
6957
6958 scb = &ha->scbs[ha->max_cmds - 1];
6959
6960 ips_init_scb(ha, scb);
6961
6962 scb->timeout = ips_cmd_timeout;
6963 scb->cdb[0] = IPS_CMD_GET_VERSION_INFO;
6964 scb->cmd.version_info.op_code = IPS_CMD_GET_VERSION_INFO;
6965 scb->cmd.version_info.command_id = IPS_COMMAND_ID(ha, scb);
6966 scb->cmd.version_info.reserved = 0;
6967 scb->cmd.version_info.count = sizeof (IPS_VERSION_DATA);
6968 scb->cmd.version_info.reserved2 = 0;
6969 scb->data_len = sizeof (IPS_VERSION_DATA);
6970 scb->data_busaddr = Buffer;
6971 scb->cmd.version_info.buffer_addr = Buffer;
6972 scb->flags = 0;
6973
6974 /* issue command */
6975 rc = ips_send_wait(ha, scb, ips_cmd_timeout, intr);
6976 return (rc);
6977}
6978
6979/****************************************************************************/ 6847/****************************************************************************/
6980/* */ 6848/* */
6981/* Routine Name: ips_abort_init */ 6849/* Routine Name: ips_abort_init */
diff --git a/drivers/scsi/ips.h b/drivers/scsi/ips.h
index adc6eabbf610..f46c382e5599 100644
--- a/drivers/scsi/ips.h
+++ b/drivers/scsi/ips.h
@@ -450,13 +450,13 @@
450 */ 450 */
451#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 451#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
452 static int ips_proc24_info(char *, char **, off_t, int, int, int); 452 static int ips_proc24_info(char *, char **, off_t, int, int, int);
453 static void ips_select_queue_depth(struct Scsi_Host *, Scsi_Device *); 453 static void ips_select_queue_depth(struct Scsi_Host *, struct scsi_device *);
454 static int ips_biosparam(Disk *disk, kdev_t dev, int geom[]); 454 static int ips_biosparam(Disk *disk, kdev_t dev, int geom[]);
455#else 455#else
456 static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); 456 static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
457 static int ips_biosparam(struct scsi_device *sdev, struct block_device *bdev, 457 static int ips_biosparam(struct scsi_device *sdev, struct block_device *bdev,
458 sector_t capacity, int geom[]); 458 sector_t capacity, int geom[]);
459 static int ips_slave_configure(Scsi_Device *SDptr); 459 static int ips_slave_configure(struct scsi_device *SDptr);
460#endif 460#endif
461 461
462/* 462/*
diff --git a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c
index a642f736cf85..23728d1c980c 100644
--- a/drivers/scsi/jazz_esp.c
+++ b/drivers/scsi/jazz_esp.c
@@ -52,7 +52,7 @@ static volatile unsigned char cmd_buffer[16];
52 * via PIO. 52 * via PIO.
53 */ 53 */
54 54
55int jazz_esp_detect(Scsi_Host_Template *tpnt); 55int jazz_esp_detect(struct scsi_host_template *tpnt);
56static int jazz_esp_release(struct Scsi_Host *shost) 56static int jazz_esp_release(struct Scsi_Host *shost)
57{ 57{
58 if (shost->irq) 58 if (shost->irq)
@@ -65,7 +65,7 @@ static int jazz_esp_release(struct Scsi_Host *shost)
65 return 0; 65 return 0;
66} 66}
67 67
68static Scsi_Host_Template driver_template = { 68static struct scsi_host_template driver_template = {
69 .proc_name = "jazz_esp", 69 .proc_name = "jazz_esp",
70 .proc_info = &esp_proc_info, 70 .proc_info = &esp_proc_info,
71 .name = "ESP 100/100a/200", 71 .name = "ESP 100/100a/200",
diff --git a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c
index c94c8db84651..e31fadd61904 100644
--- a/drivers/scsi/mac_esp.c
+++ b/drivers/scsi/mac_esp.c
@@ -300,7 +300,7 @@ unsigned long get_base(int chip_num)
300 * Model dependent ESP setup 300 * Model dependent ESP setup
301 */ 301 */
302 302
303int mac_esp_detect(Scsi_Host_Template * tpnt) 303int mac_esp_detect(struct scsi_host_template * tpnt)
304{ 304{
305 int quick = 0; 305 int quick = 0;
306 int chipnum, chipspresent = 0; 306 int chipnum, chipspresent = 0;
@@ -730,7 +730,7 @@ static void dma_setup_quick(struct NCR_ESP * esp, __u32 addr, int count, int wri
730#endif 730#endif
731} 731}
732 732
733static Scsi_Host_Template driver_template = { 733static struct scsi_host_template driver_template = {
734 .proc_name = "mac_esp", 734 .proc_name = "mac_esp",
735 .name = "Mac 53C9x SCSI", 735 .name = "Mac 53C9x SCSI",
736 .detect = mac_esp_detect, 736 .detect = mac_esp_detect,
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index 92d2c8379abf..777f9bcd1179 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -222,7 +222,7 @@ static struct Scsi_Host *default_instance;
222#endif 222#endif
223 223
224/* 224/*
225 * Function : int macscsi_detect(Scsi_Host_Template * tpnt) 225 * Function : int macscsi_detect(struct scsi_host_template * tpnt)
226 * 226 *
227 * Purpose : initializes mac NCR5380 driver based on the 227 * Purpose : initializes mac NCR5380 driver based on the
228 * command line / compile time port and irq definitions. 228 * command line / compile time port and irq definitions.
@@ -233,7 +233,7 @@ static struct Scsi_Host *default_instance;
233 * 233 *
234 */ 234 */
235 235
236int macscsi_detect(Scsi_Host_Template * tpnt) 236int macscsi_detect(struct scsi_host_template * tpnt)
237{ 237{
238 static int called = 0; 238 static int called = 0;
239 int flags = 0; 239 int flags = 0;
@@ -581,7 +581,7 @@ static int macscsi_pwrite (struct Scsi_Host *instance,
581 581
582#include "NCR5380.c" 582#include "NCR5380.c"
583 583
584static Scsi_Host_Template driver_template = { 584static struct scsi_host_template driver_template = {
585 .proc_name = "Mac5380", 585 .proc_name = "Mac5380",
586 .proc_info = macscsi_proc_info, 586 .proc_info = macscsi_proc_info,
587 .name = "Macintosh NCR5380 SCSI", 587 .name = "Macintosh NCR5380 SCSI",
diff --git a/drivers/scsi/mca_53c9x.c b/drivers/scsi/mca_53c9x.c
index 194c75451faf..998a8bbc1a4b 100644
--- a/drivers/scsi/mca_53c9x.c
+++ b/drivers/scsi/mca_53c9x.c
@@ -103,7 +103,7 @@ static volatile unsigned char cmd_buffer[16];
103static struct ESP_regs eregs; 103static struct ESP_regs eregs;
104 104
105/***************************************************************** Detection */ 105/***************************************************************** Detection */
106static int mca_esp_detect(Scsi_Host_Template *tpnt) 106static int mca_esp_detect(struct scsi_host_template *tpnt)
107{ 107{
108 struct NCR_ESP *esp; 108 struct NCR_ESP *esp;
109 static int io_port_by_pos[] = MCA_53C9X_IO_PORTS; 109 static int io_port_by_pos[] = MCA_53C9X_IO_PORTS;
@@ -444,7 +444,7 @@ static void dma_led_off(struct NCR_ESP *esp)
444 outb(inb(PS2_SYS_CTR) & 0x3f, PS2_SYS_CTR); 444 outb(inb(PS2_SYS_CTR) & 0x3f, PS2_SYS_CTR);
445} 445}
446 446
447static Scsi_Host_Template driver_template = { 447static struct scsi_host_template driver_template = {
448 .proc_name = "mca_53c9x", 448 .proc_name = "mca_53c9x",
449 .name = "NCR 53c9x SCSI", 449 .name = "NCR 53c9x SCSI",
450 .detect = mca_esp_detect, 450 .detect = mca_esp_detect,
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 61a6fd810bb4..dfea346b00a5 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -362,6 +362,7 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
362 adapter_t *adapter; 362 adapter_t *adapter;
363 scb_t *scb; 363 scb_t *scb;
364 int busy=0; 364 int busy=0;
365 unsigned long flags;
365 366
366 adapter = (adapter_t *)scmd->device->host->hostdata; 367 adapter = (adapter_t *)scmd->device->host->hostdata;
367 368
@@ -377,6 +378,7 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
377 * return 0 in that case. 378 * return 0 in that case.
378 */ 379 */
379 380
381 spin_lock_irqsave(&adapter->lock, flags);
380 scb = mega_build_cmd(adapter, scmd, &busy); 382 scb = mega_build_cmd(adapter, scmd, &busy);
381 383
382 if(scb) { 384 if(scb) {
@@ -393,6 +395,7 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
393 } 395 }
394 return 0; 396 return 0;
395 } 397 }
398 spin_unlock_irqrestore(&adapter->lock, flags);
396 399
397 return busy; 400 return busy;
398} 401}
@@ -1683,7 +1686,7 @@ mega_rundoneq (adapter_t *adapter)
1683 1686
1684 list_for_each(pos, &adapter->completed_list) { 1687 list_for_each(pos, &adapter->completed_list) {
1685 1688
1686 Scsi_Pointer* spos = (Scsi_Pointer *)pos; 1689 struct scsi_pointer* spos = (struct scsi_pointer *)pos;
1687 1690
1688 cmd = list_entry(spos, Scsi_Cmnd, SCp); 1691 cmd = list_entry(spos, Scsi_Cmnd, SCp);
1689 cmd->scsi_done(cmd); 1692 cmd->scsi_done(cmd);
@@ -1981,7 +1984,7 @@ megaraid_reset(struct scsi_cmnd *cmd)
1981 mc.cmd = MEGA_CLUSTER_CMD; 1984 mc.cmd = MEGA_CLUSTER_CMD;
1982 mc.opcode = MEGA_RESET_RESERVATIONS; 1985 mc.opcode = MEGA_RESET_RESERVATIONS;
1983 1986
1984 if( mega_internal_command(adapter, LOCK_INT, &mc, NULL) != 0 ) { 1987 if( mega_internal_command(adapter, &mc, NULL) != 0 ) {
1985 printk(KERN_WARNING 1988 printk(KERN_WARNING
1986 "megaraid: reservation reset failed.\n"); 1989 "megaraid: reservation reset failed.\n");
1987 } 1990 }
@@ -3011,7 +3014,7 @@ proc_rdrv(adapter_t *adapter, char *page, int start, int end )
3011 mc.cmd = FC_NEW_CONFIG; 3014 mc.cmd = FC_NEW_CONFIG;
3012 mc.opcode = OP_DCMD_READ_CONFIG; 3015 mc.opcode = OP_DCMD_READ_CONFIG;
3013 3016
3014 if( mega_internal_command(adapter, LOCK_INT, &mc, NULL) ) { 3017 if( mega_internal_command(adapter, &mc, NULL) ) {
3015 3018
3016 len = sprintf(page, "40LD read config failed.\n"); 3019 len = sprintf(page, "40LD read config failed.\n");
3017 3020
@@ -3029,11 +3032,11 @@ proc_rdrv(adapter_t *adapter, char *page, int start, int end )
3029 else { 3032 else {
3030 mc.cmd = NEW_READ_CONFIG_8LD; 3033 mc.cmd = NEW_READ_CONFIG_8LD;
3031 3034
3032 if( mega_internal_command(adapter, LOCK_INT, &mc, NULL) ) { 3035 if( mega_internal_command(adapter, &mc, NULL) ) {
3033 3036
3034 mc.cmd = READ_CONFIG_8LD; 3037 mc.cmd = READ_CONFIG_8LD;
3035 3038
3036 if( mega_internal_command(adapter, LOCK_INT, &mc, 3039 if( mega_internal_command(adapter, &mc,
3037 NULL) ){ 3040 NULL) ){
3038 3041
3039 len = sprintf(page, 3042 len = sprintf(page,
@@ -3632,7 +3635,7 @@ megadev_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
3632 /* 3635 /*
3633 * Issue the command 3636 * Issue the command
3634 */ 3637 */
3635 mega_internal_command(adapter, LOCK_INT, &mc, pthru); 3638 mega_internal_command(adapter, &mc, pthru);
3636 3639
3637 rval = mega_n_to_m((void __user *)arg, &mc); 3640 rval = mega_n_to_m((void __user *)arg, &mc);
3638 3641
@@ -3715,7 +3718,7 @@ freemem_and_return:
3715 /* 3718 /*
3716 * Issue the command 3719 * Issue the command
3717 */ 3720 */
3718 mega_internal_command(adapter, LOCK_INT, &mc, NULL); 3721 mega_internal_command(adapter, &mc, NULL);
3719 3722
3720 rval = mega_n_to_m((void __user *)arg, &mc); 3723 rval = mega_n_to_m((void __user *)arg, &mc);
3721 3724
@@ -4234,7 +4237,7 @@ mega_do_del_logdrv(adapter_t *adapter, int logdrv)
4234 mc.opcode = OP_DEL_LOGDRV; 4237 mc.opcode = OP_DEL_LOGDRV;
4235 mc.subopcode = logdrv; 4238 mc.subopcode = logdrv;
4236 4239
4237 rval = mega_internal_command(adapter, LOCK_INT, &mc, NULL); 4240 rval = mega_internal_command(adapter, &mc, NULL);
4238 4241
4239 /* log this event */ 4242 /* log this event */
4240 if(rval) { 4243 if(rval) {
@@ -4367,7 +4370,7 @@ mega_adapinq(adapter_t *adapter, dma_addr_t dma_handle)
4367 4370
4368 mc.xferaddr = (u32)dma_handle; 4371 mc.xferaddr = (u32)dma_handle;
4369 4372
4370 if ( mega_internal_command(adapter, LOCK_INT, &mc, NULL) != 0 ) { 4373 if ( mega_internal_command(adapter, &mc, NULL) != 0 ) {
4371 return -1; 4374 return -1;
4372 } 4375 }
4373 4376
@@ -4435,7 +4438,7 @@ mega_internal_dev_inquiry(adapter_t *adapter, u8 ch, u8 tgt,
4435 mc.cmd = MEGA_MBOXCMD_PASSTHRU; 4438 mc.cmd = MEGA_MBOXCMD_PASSTHRU;
4436 mc.xferaddr = (u32)pthru_dma_handle; 4439 mc.xferaddr = (u32)pthru_dma_handle;
4437 4440
4438 rval = mega_internal_command(adapter, LOCK_INT, &mc, pthru); 4441 rval = mega_internal_command(adapter, &mc, pthru);
4439 4442
4440 pci_free_consistent(pdev, sizeof(mega_passthru), pthru, 4443 pci_free_consistent(pdev, sizeof(mega_passthru), pthru,
4441 pthru_dma_handle); 4444 pthru_dma_handle);
@@ -4449,7 +4452,6 @@ mega_internal_dev_inquiry(adapter_t *adapter, u8 ch, u8 tgt,
4449/** 4452/**
4450 * mega_internal_command() 4453 * mega_internal_command()
4451 * @adapter - pointer to our soft state 4454 * @adapter - pointer to our soft state
4452 * @ls - the scope of the exclusion lock.
4453 * @mc - the mailbox command 4455 * @mc - the mailbox command
4454 * @pthru - Passthru structure for DCDB commands 4456 * @pthru - Passthru structure for DCDB commands
4455 * 4457 *
@@ -4463,8 +4465,7 @@ mega_internal_dev_inquiry(adapter_t *adapter, u8 ch, u8 tgt,
4463 * Note: parameter 'pthru' is null for non-passthru commands. 4465 * Note: parameter 'pthru' is null for non-passthru commands.
4464 */ 4466 */
4465static int 4467static int
4466mega_internal_command(adapter_t *adapter, lockscope_t ls, megacmd_t *mc, 4468mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru)
4467 mega_passthru *pthru )
4468{ 4469{
4469 Scsi_Cmnd *scmd; 4470 Scsi_Cmnd *scmd;
4470 struct scsi_device *sdev; 4471 struct scsi_device *sdev;
@@ -4508,15 +4509,8 @@ mega_internal_command(adapter_t *adapter, lockscope_t ls, megacmd_t *mc,
4508 4509
4509 scb->idx = CMDID_INT_CMDS; 4510 scb->idx = CMDID_INT_CMDS;
4510 4511
4511 /*
4512 * Get the lock only if the caller has not acquired it already
4513 */
4514 if( ls == LOCK_INT ) spin_lock_irqsave(&adapter->lock, flags);
4515
4516 megaraid_queue(scmd, mega_internal_done); 4512 megaraid_queue(scmd, mega_internal_done);
4517 4513
4518 if( ls == LOCK_INT ) spin_unlock_irqrestore(&adapter->lock, flags);
4519
4520 wait_for_completion(&adapter->int_waitq); 4514 wait_for_completion(&adapter->int_waitq);
4521 4515
4522 rval = scmd->result; 4516 rval = scmd->result;
diff --git a/drivers/scsi/megaraid.h b/drivers/scsi/megaraid.h
index 4facf557cd19..6f9078025748 100644
--- a/drivers/scsi/megaraid.h
+++ b/drivers/scsi/megaraid.h
@@ -926,13 +926,6 @@ struct mega_hbas {
926#define MEGA_SGLIST 0x0002 926#define MEGA_SGLIST 0x0002
927 927
928/* 928/*
929 * lockscope definitions, callers can specify the lock scope with this data
930 * type. LOCK_INT would mean the caller has not acquired the lock before
931 * making the call and LOCK_EXT would mean otherwise.
932 */
933typedef enum { LOCK_INT, LOCK_EXT } lockscope_t;
934
935/*
936 * Parameters for the io-mapped controllers 929 * Parameters for the io-mapped controllers
937 */ 930 */
938 931
@@ -1062,8 +1055,7 @@ static int mega_support_random_del(adapter_t *);
1062static int mega_del_logdrv(adapter_t *, int); 1055static int mega_del_logdrv(adapter_t *, int);
1063static int mega_do_del_logdrv(adapter_t *, int); 1056static int mega_do_del_logdrv(adapter_t *, int);
1064static void mega_get_max_sgl(adapter_t *); 1057static void mega_get_max_sgl(adapter_t *);
1065static int mega_internal_command(adapter_t *, lockscope_t, megacmd_t *, 1058static int mega_internal_command(adapter_t *, megacmd_t *, mega_passthru *);
1066 mega_passthru *);
1067static void mega_internal_done(Scsi_Cmnd *); 1059static void mega_internal_done(Scsi_Cmnd *);
1068static int mega_support_cluster(adapter_t *); 1060static int mega_support_cluster(adapter_t *);
1069#endif 1061#endif
diff --git a/drivers/scsi/megaraid/mega_common.h b/drivers/scsi/megaraid/mega_common.h
index 8e547130e97d..4675343228ad 100644
--- a/drivers/scsi/megaraid/mega_common.h
+++ b/drivers/scsi/megaraid/mega_common.h
@@ -96,7 +96,6 @@ typedef struct {
96 * @param dpc_h : tasklet handle 96 * @param dpc_h : tasklet handle
97 * @param pdev : pci configuration pointer for kernel 97 * @param pdev : pci configuration pointer for kernel
98 * @param host : pointer to host structure of mid-layer 98 * @param host : pointer to host structure of mid-layer
99 * @param host_lock : pointer to appropriate lock
100 * @param lock : synchronization lock for mid-layer and driver 99 * @param lock : synchronization lock for mid-layer and driver
101 * @param quiescent : driver is quiescent for now. 100 * @param quiescent : driver is quiescent for now.
102 * @param outstanding_cmds : number of commands pending in the driver 101 * @param outstanding_cmds : number of commands pending in the driver
@@ -151,7 +150,6 @@ typedef struct {
151 struct tasklet_struct dpc_h; 150 struct tasklet_struct dpc_h;
152 struct pci_dev *pdev; 151 struct pci_dev *pdev;
153 struct Scsi_Host *host; 152 struct Scsi_Host *host;
154 spinlock_t *host_lock;
155 spinlock_t lock; 153 spinlock_t lock;
156 uint8_t quiescent; 154 uint8_t quiescent;
157 int outstanding_cmds; 155 int outstanding_cmds;
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index 1a3d195a2d36..4b5d420d2f4d 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -533,8 +533,6 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
533 533
534 // Initialize the synchronization lock for kernel and LLD 534 // Initialize the synchronization lock for kernel and LLD
535 spin_lock_init(&adapter->lock); 535 spin_lock_init(&adapter->lock);
536 adapter->host_lock = &adapter->lock;
537
538 536
539 // Initialize the command queues: the list of free SCBs and the list 537 // Initialize the command queues: the list of free SCBs and the list
540 // of pending SCBs. 538 // of pending SCBs.
@@ -715,9 +713,6 @@ megaraid_io_attach(adapter_t *adapter)
715 SCSIHOST2ADAP(host) = (caddr_t)adapter; 713 SCSIHOST2ADAP(host) = (caddr_t)adapter;
716 adapter->host = host; 714 adapter->host = host;
717 715
718 // export the parameters required by the mid-layer
719 scsi_assign_lock(host, adapter->host_lock);
720
721 host->irq = adapter->irq; 716 host->irq = adapter->irq;
722 host->unique_id = adapter->unique_id; 717 host->unique_id = adapter->unique_id;
723 host->can_queue = adapter->max_cmds; 718 host->can_queue = adapter->max_cmds;
@@ -1560,10 +1555,6 @@ megaraid_queue_command(struct scsi_cmnd *scp, void (* done)(struct scsi_cmnd *))
1560 scp->scsi_done = done; 1555 scp->scsi_done = done;
1561 scp->result = 0; 1556 scp->result = 0;
1562 1557
1563 assert_spin_locked(adapter->host_lock);
1564
1565 spin_unlock(adapter->host_lock);
1566
1567 /* 1558 /*
1568 * Allocate and build a SCB request 1559 * Allocate and build a SCB request
1569 * if_busy flag will be set if megaraid_mbox_build_cmd() command could 1560 * if_busy flag will be set if megaraid_mbox_build_cmd() command could
@@ -1573,23 +1564,16 @@ megaraid_queue_command(struct scsi_cmnd *scp, void (* done)(struct scsi_cmnd *))
1573 * return 0 in that case, and we would do the callback right away. 1564 * return 0 in that case, and we would do the callback right away.
1574 */ 1565 */
1575 if_busy = 0; 1566 if_busy = 0;
1576 scb = megaraid_mbox_build_cmd(adapter, scp, &if_busy); 1567 scb = megaraid_mbox_build_cmd(adapter, scp, &if_busy);
1577
1578 if (scb) {
1579 megaraid_mbox_runpendq(adapter, scb);
1580 }
1581
1582 spin_lock(adapter->host_lock);
1583
1584 if (!scb) { // command already completed 1568 if (!scb) { // command already completed
1585 done(scp); 1569 done(scp);
1586 return 0; 1570 return 0;
1587 } 1571 }
1588 1572
1573 megaraid_mbox_runpendq(adapter, scb);
1589 return if_busy; 1574 return if_busy;
1590} 1575}
1591 1576
1592
1593/** 1577/**
1594 * megaraid_mbox_build_cmd - transform the mid-layer scsi command to megaraid 1578 * megaraid_mbox_build_cmd - transform the mid-layer scsi command to megaraid
1595 * firmware lingua 1579 * firmware lingua
@@ -2546,9 +2530,7 @@ megaraid_mbox_dpc(unsigned long devp)
2546 megaraid_dealloc_scb(adapter, scb); 2530 megaraid_dealloc_scb(adapter, scb);
2547 2531
2548 // send the scsi packet back to kernel 2532 // send the scsi packet back to kernel
2549 spin_lock(adapter->host_lock);
2550 scp->scsi_done(scp); 2533 scp->scsi_done(scp);
2551 spin_unlock(adapter->host_lock);
2552 } 2534 }
2553 2535
2554 return; 2536 return;
@@ -2563,7 +2545,7 @@ megaraid_mbox_dpc(unsigned long devp)
2563 * aborted. All the commands issued to the F/W must complete. 2545 * aborted. All the commands issued to the F/W must complete.
2564 **/ 2546 **/
2565static int 2547static int
2566__megaraid_abort_handler(struct scsi_cmnd *scp) 2548megaraid_abort_handler(struct scsi_cmnd *scp)
2567{ 2549{
2568 adapter_t *adapter; 2550 adapter_t *adapter;
2569 mraid_device_t *raid_dev; 2551 mraid_device_t *raid_dev;
@@ -2577,8 +2559,6 @@ __megaraid_abort_handler(struct scsi_cmnd *scp)
2577 adapter = SCP2ADAPTER(scp); 2559 adapter = SCP2ADAPTER(scp);
2578 raid_dev = ADAP2RAIDDEV(adapter); 2560 raid_dev = ADAP2RAIDDEV(adapter);
2579 2561
2580 assert_spin_locked(adapter->host_lock);
2581
2582 con_log(CL_ANN, (KERN_WARNING 2562 con_log(CL_ANN, (KERN_WARNING
2583 "megaraid: aborting-%ld cmd=%x <c=%d t=%d l=%d>\n", 2563 "megaraid: aborting-%ld cmd=%x <c=%d t=%d l=%d>\n",
2584 scp->serial_number, scp->cmnd[0], SCP2CHANNEL(scp), 2564 scp->serial_number, scp->cmnd[0], SCP2CHANNEL(scp),
@@ -2658,6 +2638,7 @@ __megaraid_abort_handler(struct scsi_cmnd *scp)
2658 // traverse through the list of all SCB, since driver does not 2638 // traverse through the list of all SCB, since driver does not
2659 // maintain these SCBs on any list 2639 // maintain these SCBs on any list
2660 found = 0; 2640 found = 0;
2641 spin_lock_irq(&adapter->lock);
2661 for (i = 0; i < MBOX_MAX_SCSI_CMDS; i++) { 2642 for (i = 0; i < MBOX_MAX_SCSI_CMDS; i++) {
2662 scb = adapter->kscb_list + i; 2643 scb = adapter->kscb_list + i;
2663 2644
@@ -2680,6 +2661,7 @@ __megaraid_abort_handler(struct scsi_cmnd *scp)
2680 } 2661 }
2681 } 2662 }
2682 } 2663 }
2664 spin_unlock_irq(&adapter->lock);
2683 2665
2684 if (!found) { 2666 if (!found) {
2685 con_log(CL_ANN, (KERN_WARNING 2667 con_log(CL_ANN, (KERN_WARNING
@@ -2696,22 +2678,6 @@ __megaraid_abort_handler(struct scsi_cmnd *scp)
2696 return FAILED; 2678 return FAILED;
2697} 2679}
2698 2680
2699static int
2700megaraid_abort_handler(struct scsi_cmnd *scp)
2701{
2702 adapter_t *adapter;
2703 int rc;
2704
2705 adapter = SCP2ADAPTER(scp);
2706
2707 spin_lock_irq(adapter->host_lock);
2708 rc = __megaraid_abort_handler(scp);
2709 spin_unlock_irq(adapter->host_lock);
2710
2711 return rc;
2712}
2713
2714
2715/** 2681/**
2716 * megaraid_reset_handler - device reset hadler for mailbox based driver 2682 * megaraid_reset_handler - device reset hadler for mailbox based driver
2717 * @scp : reference command 2683 * @scp : reference command
@@ -2723,7 +2689,7 @@ megaraid_abort_handler(struct scsi_cmnd *scp)
2723 * host 2689 * host
2724 **/ 2690 **/
2725static int 2691static int
2726__megaraid_reset_handler(struct scsi_cmnd *scp) 2692megaraid_reset_handler(struct scsi_cmnd *scp)
2727{ 2693{
2728 adapter_t *adapter; 2694 adapter_t *adapter;
2729 scb_t *scb; 2695 scb_t *scb;
@@ -2739,10 +2705,6 @@ __megaraid_reset_handler(struct scsi_cmnd *scp)
2739 adapter = SCP2ADAPTER(scp); 2705 adapter = SCP2ADAPTER(scp);
2740 raid_dev = ADAP2RAIDDEV(adapter); 2706 raid_dev = ADAP2RAIDDEV(adapter);
2741 2707
2742 assert_spin_locked(adapter->host_lock);
2743
2744 con_log(CL_ANN, (KERN_WARNING "megaraid: reseting the host...\n"));
2745
2746 // return failure if adapter is not responding 2708 // return failure if adapter is not responding
2747 if (raid_dev->hw_error) { 2709 if (raid_dev->hw_error) {
2748 con_log(CL_ANN, (KERN_NOTICE 2710 con_log(CL_ANN, (KERN_NOTICE
@@ -2779,8 +2741,6 @@ __megaraid_reset_handler(struct scsi_cmnd *scp)
2779 adapter->outstanding_cmds, MBOX_RESET_WAIT)); 2741 adapter->outstanding_cmds, MBOX_RESET_WAIT));
2780 } 2742 }
2781 2743
2782 spin_unlock(adapter->host_lock);
2783
2784 recovery_window = MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT; 2744 recovery_window = MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT;
2785 2745
2786 recovering = adapter->outstanding_cmds; 2746 recovering = adapter->outstanding_cmds;
@@ -2806,7 +2766,7 @@ __megaraid_reset_handler(struct scsi_cmnd *scp)
2806 msleep(1000); 2766 msleep(1000);
2807 } 2767 }
2808 2768
2809 spin_lock(adapter->host_lock); 2769 spin_lock(&adapter->lock);
2810 2770
2811 // If still outstanding commands, bail out 2771 // If still outstanding commands, bail out
2812 if (adapter->outstanding_cmds) { 2772 if (adapter->outstanding_cmds) {
@@ -2815,7 +2775,8 @@ __megaraid_reset_handler(struct scsi_cmnd *scp)
2815 2775
2816 raid_dev->hw_error = 1; 2776 raid_dev->hw_error = 1;
2817 2777
2818 return FAILED; 2778 rval = FAILED;
2779 goto out;
2819 } 2780 }
2820 else { 2781 else {
2821 con_log(CL_ANN, (KERN_NOTICE 2782 con_log(CL_ANN, (KERN_NOTICE
@@ -2824,7 +2785,10 @@ __megaraid_reset_handler(struct scsi_cmnd *scp)
2824 2785
2825 2786
2826 // If the controller supports clustering, reset reservations 2787 // If the controller supports clustering, reset reservations
2827 if (!adapter->ha) return SUCCESS; 2788 if (!adapter->ha) {
2789 rval = SUCCESS;
2790 goto out;
2791 }
2828 2792
2829 // clear reservations if any 2793 // clear reservations if any
2830 raw_mbox[0] = CLUSTER_CMD; 2794 raw_mbox[0] = CLUSTER_CMD;
@@ -2841,22 +2805,11 @@ __megaraid_reset_handler(struct scsi_cmnd *scp)
2841 "megaraid: reservation reset failed\n")); 2805 "megaraid: reservation reset failed\n"));
2842 } 2806 }
2843 2807
2808 out:
2809 spin_unlock_irq(&adapter->lock);
2844 return rval; 2810 return rval;
2845} 2811}
2846 2812
2847static int
2848megaraid_reset_handler(struct scsi_cmnd *cmd)
2849{
2850 int rc;
2851
2852 spin_lock_irq(cmd->device->host->host_lock);
2853 rc = __megaraid_reset_handler(cmd);
2854 spin_unlock_irq(cmd->device->host->host_lock);
2855
2856 return rc;
2857}
2858
2859
2860/* 2813/*
2861 * START: internal commands library 2814 * START: internal commands library
2862 * 2815 *
@@ -3776,9 +3729,9 @@ wait_till_fw_empty(adapter_t *adapter)
3776 /* 3729 /*
3777 * Set the quiescent flag to stop issuing cmds to FW. 3730 * Set the quiescent flag to stop issuing cmds to FW.
3778 */ 3731 */
3779 spin_lock_irqsave(adapter->host_lock, flags); 3732 spin_lock_irqsave(&adapter->lock, flags);
3780 adapter->quiescent++; 3733 adapter->quiescent++;
3781 spin_unlock_irqrestore(adapter->host_lock, flags); 3734 spin_unlock_irqrestore(&adapter->lock, flags);
3782 3735
3783 /* 3736 /*
3784 * Wait till there are no more cmds outstanding at FW. Try for at most 3737 * Wait till there are no more cmds outstanding at FW. Try for at most
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index 801a63bea8a5..3c32e69afcd9 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -766,17 +766,12 @@ static int megasas_generic_reset(struct scsi_cmnd *scmd)
766 return FAILED; 766 return FAILED;
767 } 767 }
768 768
769 spin_unlock(scmd->device->host->host_lock);
770
771 ret_val = megasas_wait_for_outstanding(instance); 769 ret_val = megasas_wait_for_outstanding(instance);
772
773 if (ret_val == SUCCESS) 770 if (ret_val == SUCCESS)
774 printk(KERN_NOTICE "megasas: reset successful \n"); 771 printk(KERN_NOTICE "megasas: reset successful \n");
775 else 772 else
776 printk(KERN_ERR "megasas: failed to do reset\n"); 773 printk(KERN_ERR "megasas: failed to do reset\n");
777 774
778 spin_lock(scmd->device->host->host_lock);
779
780 return ret_val; 775 return ret_val;
781} 776}
782 777
diff --git a/drivers/scsi/mvme147.c b/drivers/scsi/mvme147.c
index 33380cee9b77..cb367c2c5c78 100644
--- a/drivers/scsi/mvme147.c
+++ b/drivers/scsi/mvme147.c
@@ -63,7 +63,7 @@ static void dma_stop (struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
63 m147_pcc->dma_cntrl = 0; 63 m147_pcc->dma_cntrl = 0;
64} 64}
65 65
66int mvme147_detect(Scsi_Host_Template *tpnt) 66int mvme147_detect(struct scsi_host_template *tpnt)
67{ 67{
68 static unsigned char called = 0; 68 static unsigned char called = 0;
69 wd33c93_regs regs; 69 wd33c93_regs regs;
@@ -130,7 +130,7 @@ static int mvme147_bus_reset(Scsi_Cmnd *cmd)
130 130
131#include "mvme147.h" 131#include "mvme147.h"
132 132
133static Scsi_Host_Template driver_template = { 133static struct scsi_host_template driver_template = {
134 .proc_name = "MVME147", 134 .proc_name = "MVME147",
135 .name = "MVME147 built-in SCSI", 135 .name = "MVME147 built-in SCSI",
136 .detect = mvme147_detect, 136 .detect = mvme147_detect,
diff --git a/drivers/scsi/mvme147.h b/drivers/scsi/mvme147.h
index d8903f096182..2f56d69bd180 100644
--- a/drivers/scsi/mvme147.h
+++ b/drivers/scsi/mvme147.h
@@ -10,7 +10,7 @@
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12 12
13int mvme147_detect(Scsi_Host_Template *); 13int mvme147_detect(struct scsi_host_template *);
14int mvme147_release(struct Scsi_Host *); 14int mvme147_release(struct Scsi_Host *);
15const char *wd33c93_info(void); 15const char *wd33c93_info(void);
16int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 16int wd33c93_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
diff --git a/drivers/scsi/mvme16x.c b/drivers/scsi/mvme16x.c
index 29ec699e0e4d..890e9e232dab 100644
--- a/drivers/scsi/mvme16x.c
+++ b/drivers/scsi/mvme16x.c
@@ -21,7 +21,7 @@
21#include<linux/stat.h> 21#include<linux/stat.h>
22 22
23 23
24int mvme16x_scsi_detect(Scsi_Host_Template *tpnt) 24int mvme16x_scsi_detect(struct scsi_host_template *tpnt)
25{ 25{
26 static unsigned char called = 0; 26 static unsigned char called = 0;
27 int clock; 27 int clock;
@@ -61,7 +61,7 @@ static int mvme16x_scsi_release(struct Scsi_Host *shost)
61 return 0; 61 return 0;
62} 62}
63 63
64static Scsi_Host_Template driver_template = { 64static struct scsi_host_template driver_template = {
65 .name = "MVME16x NCR53c710 SCSI", 65 .name = "MVME16x NCR53c710 SCSI",
66 .detect = mvme16x_scsi_detect, 66 .detect = mvme16x_scsi_detect,
67 .release = mvme16x_scsi_release, 67 .release = mvme16x_scsi_release,
diff --git a/drivers/scsi/mvme16x.h b/drivers/scsi/mvme16x.h
index 25173c891d3c..c7a12533fb2c 100644
--- a/drivers/scsi/mvme16x.h
+++ b/drivers/scsi/mvme16x.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6int mvme16x_scsi_detect(Scsi_Host_Template *); 6int mvme16x_scsi_detect(struct scsi_host_template *);
7const char *NCR53c7x0_info(void); 7const char *NCR53c7x0_info(void);
8int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 8int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
9int NCR53c7xx_abort(Scsi_Cmnd *); 9int NCR53c7xx_abort(Scsi_Cmnd *);
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index e4ff4f00676d..a279ebb61447 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -198,7 +198,7 @@ static void __devexit nsp32_remove(struct pci_dev *);
198static int __init init_nsp32 (void); 198static int __init init_nsp32 (void);
199static void __exit exit_nsp32 (void); 199static void __exit exit_nsp32 (void);
200 200
201/* struct Scsi_Host_Template */ 201/* struct struct scsi_host_template */
202#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) 202#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73))
203static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int); 203static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int);
204#else 204#else
@@ -208,7 +208,7 @@ static int nsp32_proc_info (char *, char **, off_t, int, int, int);
208#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) 208#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73))
209static int nsp32_detect (struct pci_dev *pdev); 209static int nsp32_detect (struct pci_dev *pdev);
210#else 210#else
211static int nsp32_detect (Scsi_Host_Template *); 211static int nsp32_detect (struct scsi_host_template *);
212#endif 212#endif
213static int nsp32_queuecommand(struct scsi_cmnd *, 213static int nsp32_queuecommand(struct scsi_cmnd *,
214 void (*done)(struct scsi_cmnd *)); 214 void (*done)(struct scsi_cmnd *));
@@ -2683,7 +2683,7 @@ static int nsp32_detect(struct pci_dev *pdev)
2683#define DETECT_OK 1 2683#define DETECT_OK 1
2684#define DETECT_NG 0 2684#define DETECT_NG 0
2685#define PCIDEV (data->Pci) 2685#define PCIDEV (data->Pci)
2686static int nsp32_detect(Scsi_Host_Template *sht) 2686static int nsp32_detect(struct scsi_host_template *sht)
2687#endif 2687#endif
2688{ 2688{
2689 struct Scsi_Host *host; /* registered host structure */ 2689 struct Scsi_Host *host; /* registered host structure */
diff --git a/drivers/scsi/oktagon_esp.c b/drivers/scsi/oktagon_esp.c
index 573d7ef93f08..5d9c9ada814f 100644
--- a/drivers/scsi/oktagon_esp.c
+++ b/drivers/scsi/oktagon_esp.c
@@ -114,7 +114,7 @@ static volatile unsigned char cmd_buffer[16];
114 */ 114 */
115 115
116/***************************************************************** Detection */ 116/***************************************************************** Detection */
117int oktagon_esp_detect(Scsi_Host_Template *tpnt) 117int oktagon_esp_detect(struct scsi_host_template *tpnt)
118{ 118{
119 struct NCR_ESP *esp; 119 struct NCR_ESP *esp;
120 struct zorro_dev *z = NULL; 120 struct zorro_dev *z = NULL;
@@ -585,7 +585,7 @@ int oktagon_esp_release(struct Scsi_Host *instance)
585} 585}
586 586
587 587
588static Scsi_Host_Template driver_template = { 588static struct scsi_host_template driver_template = {
589 .proc_name = "esp-oktagon", 589 .proc_name = "esp-oktagon",
590 .proc_info = &esp_proc_info, 590 .proc_info = &esp_proc_info,
591 .name = "BSC Oktagon SCSI", 591 .name = "BSC Oktagon SCSI",
diff --git a/drivers/scsi/pas16.c b/drivers/scsi/pas16.c
index 72bc947e45b6..f09e94af9ade 100644
--- a/drivers/scsi/pas16.c
+++ b/drivers/scsi/pas16.c
@@ -369,7 +369,7 @@ void __init pas16_setup(char *str, int *ints)
369} 369}
370 370
371/* 371/*
372 * Function : int pas16_detect(Scsi_Host_Template * tpnt) 372 * Function : int pas16_detect(struct scsi_host_template * tpnt)
373 * 373 *
374 * Purpose : detects and initializes PAS16 controllers 374 * Purpose : detects and initializes PAS16 controllers
375 * that were autoprobed, overridden on the LILO command line, 375 * that were autoprobed, overridden on the LILO command line,
@@ -381,7 +381,7 @@ void __init pas16_setup(char *str, int *ints)
381 * 381 *
382 */ 382 */
383 383
384int __init pas16_detect(Scsi_Host_Template * tpnt) 384int __init pas16_detect(struct scsi_host_template * tpnt)
385{ 385{
386 static int current_override = 0; 386 static int current_override = 0;
387 static unsigned short current_base = 0; 387 static unsigned short current_base = 0;
@@ -615,7 +615,7 @@ static int pas16_release(struct Scsi_Host *shost)
615 return 0; 615 return 0;
616} 616}
617 617
618static Scsi_Host_Template driver_template = { 618static struct scsi_host_template driver_template = {
619 .name = "Pro Audio Spectrum-16 SCSI", 619 .name = "Pro Audio Spectrum-16 SCSI",
620 .detect = pas16_detect, 620 .detect = pas16_detect,
621 .release = pas16_release, 621 .release = pas16_release,
diff --git a/drivers/scsi/pas16.h b/drivers/scsi/pas16.h
index 65ce1cc40d9a..8dc5b1a5f5da 100644
--- a/drivers/scsi/pas16.h
+++ b/drivers/scsi/pas16.h
@@ -117,7 +117,7 @@
117static int pas16_abort(Scsi_Cmnd *); 117static int pas16_abort(Scsi_Cmnd *);
118static int pas16_biosparam(struct scsi_device *, struct block_device *, 118static int pas16_biosparam(struct scsi_device *, struct block_device *,
119 sector_t, int*); 119 sector_t, int*);
120static int pas16_detect(Scsi_Host_Template *); 120static int pas16_detect(struct scsi_host_template *);
121static int pas16_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 121static int pas16_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
122static int pas16_bus_reset(Scsi_Cmnd *); 122static int pas16_bus_reset(Scsi_Cmnd *);
123 123
diff --git a/drivers/scsi/pci2000.h b/drivers/scsi/pci2000.h
index 6c962d7dca47..0ebd8ce9e1de 100644
--- a/drivers/scsi/pci2000.h
+++ b/drivers/scsi/pci2000.h
@@ -184,7 +184,7 @@ typedef struct _INQUIRYDATA
184#endif 184#endif
185 185
186// function prototypes 186// function prototypes
187int Pci2000_Detect (Scsi_Host_Template *tpnt); 187int Pci2000_Detect (struct scsi_host_template *tpnt);
188int Pci2000_Command (Scsi_Cmnd *SCpnt); 188int Pci2000_Command (Scsi_Cmnd *SCpnt);
189int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)); 189int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *));
190int Pci2000_Abort (Scsi_Cmnd *SCpnt); 190int Pci2000_Abort (Scsi_Cmnd *SCpnt);
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 3d2f71051fe5..050ea13ff80b 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -81,7 +81,7 @@ module_param(free_ports, bool, 0);
81MODULE_PARM_DESC(free_ports, "Release IO ports after configuration? (default: 0 (=no))"); 81MODULE_PARM_DESC(free_ports, "Release IO ports after configuration? (default: 0 (=no))");
82 82
83/* /usr/src/linux/drivers/scsi/hosts.h */ 83/* /usr/src/linux/drivers/scsi/hosts.h */
84static Scsi_Host_Template nsp_driver_template = { 84static struct scsi_host_template nsp_driver_template = {
85 .proc_name = "nsp_cs", 85 .proc_name = "nsp_cs",
86 .proc_info = nsp_proc_info, 86 .proc_info = nsp_proc_info,
87 .name = "WorkBit NinjaSCSI-3/32Bi(16bit)", 87 .name = "WorkBit NinjaSCSI-3/32Bi(16bit)",
@@ -1310,7 +1310,7 @@ timer_out:
1310/*----------------------------------------------------------------*/ 1310/*----------------------------------------------------------------*/
1311/* look for ninja3 card and init if found */ 1311/* look for ninja3 card and init if found */
1312/*----------------------------------------------------------------*/ 1312/*----------------------------------------------------------------*/
1313static struct Scsi_Host *nsp_detect(Scsi_Host_Template *sht) 1313static struct Scsi_Host *nsp_detect(struct scsi_host_template *sht)
1314{ 1314{
1315 struct Scsi_Host *host; /* registered host structure */ 1315 struct Scsi_Host *host; /* registered host structure */
1316 nsp_hw_data *data_b = &nsp_data_base, *data; 1316 nsp_hw_data *data_b = &nsp_data_base, *data;
@@ -1358,7 +1358,7 @@ static struct Scsi_Host *nsp_detect(Scsi_Host_Template *sht)
1358} 1358}
1359 1359
1360#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 1360#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
1361static int nsp_detect_old(Scsi_Host_Template *sht) 1361static int nsp_detect_old(struct scsi_host_template *sht)
1362{ 1362{
1363 if (nsp_detect(sht) == NULL) { 1363 if (nsp_detect(sht) == NULL) {
1364 return 0; 1364 return 0;
@@ -1717,7 +1717,7 @@ static void nsp_cs_config(dev_link_t *link)
1717 struct Scsi_Host *host; 1717 struct Scsi_Host *host;
1718 nsp_hw_data *data = &nsp_data_base; 1718 nsp_hw_data *data = &nsp_data_base;
1719#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,74)) 1719#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,74))
1720 Scsi_Device *dev; 1720 struct scsi_device *dev;
1721 dev_node_t **tail, *node; 1721 dev_node_t **tail, *node;
1722#endif 1722#endif
1723 1723
diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h
index c201b52e063a..f8b943082717 100644
--- a/drivers/scsi/pcmcia/nsp_cs.h
+++ b/drivers/scsi/pcmcia/nsp_cs.h
@@ -303,9 +303,9 @@ static void nsp_cs_config (dev_link_t *link);
303static int nsp_cs_event (event_t event, int priority, event_callback_args_t *args); 303static int nsp_cs_event (event_t event, int priority, event_callback_args_t *args);
304 304
305/* Linux SCSI subsystem specific functions */ 305/* Linux SCSI subsystem specific functions */
306static struct Scsi_Host *nsp_detect (Scsi_Host_Template *sht); 306static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht);
307#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 307#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
308static int nsp_detect_old (Scsi_Host_Template *sht); 308static int nsp_detect_old (struct scsi_host_template *sht);
309static int nsp_release_old(struct Scsi_Host *shpnt); 309static int nsp_release_old(struct Scsi_Host *shpnt);
310#endif 310#endif
311static const char *nsp_info (struct Scsi_Host *shpnt); 311static const char *nsp_info (struct Scsi_Host *shpnt);
@@ -345,7 +345,7 @@ static int nsp_expect_signal (Scsi_Cmnd *SCpnt, unsigned char current_phase,
345static int nsp_xfer (Scsi_Cmnd *SCpnt, int phase); 345static int nsp_xfer (Scsi_Cmnd *SCpnt, int phase);
346static int nsp_dataphase_bypass (Scsi_Cmnd *SCpnt); 346static int nsp_dataphase_bypass (Scsi_Cmnd *SCpnt);
347static int nsp_reselected (Scsi_Cmnd *SCpnt); 347static int nsp_reselected (Scsi_Cmnd *SCpnt);
348static struct Scsi_Host *nsp_detect(Scsi_Host_Template *sht); 348static struct Scsi_Host *nsp_detect(struct scsi_host_template *sht);
349 349
350/* Interrupt handler */ 350/* Interrupt handler */
351//static irqreturn_t nspintr(int irq, void *dev_id, struct pt_regs *regs); 351//static irqreturn_t nspintr(int irq, void *dev_id, struct pt_regs *regs);
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 7a516f35834e..bb091a45a880 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -72,7 +72,7 @@ static char *version = "qlogic_cs.c 1.79-ac 2002/10/26 (David Hinds)";
72#define DEBUG(n, args...) 72#define DEBUG(n, args...)
73#endif 73#endif
74 74
75static Scsi_Host_Template qlogicfas_driver_template = { 75static struct scsi_host_template qlogicfas_driver_template = {
76 .module = THIS_MODULE, 76 .module = THIS_MODULE,
77 .name = qlogic_name, 77 .name = qlogic_name,
78 .proc_name = qlogic_name, 78 .proc_name = qlogic_name,
@@ -108,7 +108,7 @@ static dev_link_t *dev_list = NULL;
108 108
109static dev_info_t dev_info = "qlogic_cs"; 109static dev_info_t dev_info = "qlogic_cs";
110 110
111static struct Scsi_Host *qlogic_detect(Scsi_Host_Template *host, 111static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host,
112 dev_link_t *link, int qbase, int qlirq) 112 dev_link_t *link, int qbase, int qlirq)
113{ 113{
114 int qltyp; /* type of chip */ 114 int qltyp; /* type of chip */
diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c
index c89da7d5b6df..46624ab9c3d2 100644
--- a/drivers/scsi/pluto.c
+++ b/drivers/scsi/pluto.c
@@ -71,7 +71,7 @@ static void __init pluto_detect_scsi_done(Scsi_Cmnd *SCpnt)
71 up(&fc_sem); 71 up(&fc_sem);
72} 72}
73 73
74int pluto_slave_configure(Scsi_Device *device) 74int pluto_slave_configure(struct scsi_device *device)
75{ 75{
76 int depth_to_use; 76 int depth_to_use;
77 77
@@ -90,11 +90,11 @@ int pluto_slave_configure(Scsi_Device *device)
90 90
91/* Detect all SSAs attached to the machine. 91/* Detect all SSAs attached to the machine.
92 To be fast, do it on all online FC channels at the same time. */ 92 To be fast, do it on all online FC channels at the same time. */
93int __init pluto_detect(Scsi_Host_Template *tpnt) 93int __init pluto_detect(struct scsi_host_template *tpnt)
94{ 94{
95 int i, retry, nplutos; 95 int i, retry, nplutos;
96 fc_channel *fc; 96 fc_channel *fc;
97 Scsi_Device dev; 97 struct scsi_device dev;
98 DEFINE_TIMER(fc_timer, pluto_detect_timeout, 0, 0); 98 DEFINE_TIMER(fc_timer, pluto_detect_timeout, 0, 0);
99 99
100 tpnt->proc_name = "pluto"; 100 tpnt->proc_name = "pluto";
@@ -339,7 +339,7 @@ static int pluto_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cm
339 return 0; 339 return 0;
340} 340}
341 341
342static Scsi_Host_Template driver_template = { 342static struct scsi_host_template driver_template = {
343 .name = "Sparc Storage Array 100/200", 343 .name = "Sparc Storage Array 100/200",
344 .detect = pluto_detect, 344 .detect = pluto_detect,
345 .release = pluto_release, 345 .release = pluto_release,
diff --git a/drivers/scsi/pluto.h b/drivers/scsi/pluto.h
index beb844aafccd..5da20616ac36 100644
--- a/drivers/scsi/pluto.h
+++ b/drivers/scsi/pluto.h
@@ -38,10 +38,10 @@ struct pluto_inquiry {
38/* This is the max number of outstanding SCSI commands per pluto */ 38/* This is the max number of outstanding SCSI commands per pluto */
39#define PLUTO_CAN_QUEUE 254 39#define PLUTO_CAN_QUEUE 254
40 40
41int pluto_detect(Scsi_Host_Template *); 41int pluto_detect(struct scsi_host_template *);
42int pluto_release(struct Scsi_Host *); 42int pluto_release(struct Scsi_Host *);
43const char * pluto_info(struct Scsi_Host *); 43const char * pluto_info(struct Scsi_Host *);
44int pluto_slave_configure(Scsi_Device *); 44int pluto_slave_configure(struct scsi_device *);
45 45
46#endif /* !(_PLUTO_H) */ 46#endif /* !(_PLUTO_H) */
47 47
diff --git a/drivers/scsi/psi240i.c b/drivers/scsi/psi240i.c
index 4322c95c995c..5c2cdf523c3b 100644
--- a/drivers/scsi/psi240i.c
+++ b/drivers/scsi/psi240i.c
@@ -538,7 +538,7 @@ static void ReadChipMemory (void *pdata, USHORT base, USHORT length, USHORT port
538 * Returns: Number of adapters found. 538 * Returns: Number of adapters found.
539 * 539 *
540 ****************************************************************/ 540 ****************************************************************/
541static int Psi240i_Detect (Scsi_Host_Template *tpnt) 541static int Psi240i_Detect (struct scsi_host_template *tpnt)
542 { 542 {
543 int board; 543 int board;
544 int count = 0; 544 int count = 0;
@@ -669,7 +669,7 @@ static int Psi240i_BiosParam (struct scsi_device *sdev, struct block_device *dev
669 669
670MODULE_LICENSE("GPL"); 670MODULE_LICENSE("GPL");
671 671
672static Scsi_Host_Template driver_template = { 672static struct scsi_host_template driver_template = {
673 .proc_name = "psi240i", 673 .proc_name = "psi240i",
674 .name = "PSI-240I EIDE Disk Controller", 674 .name = "PSI-240I EIDE Disk Controller",
675 .detect = Psi240i_Detect, 675 .detect = Psi240i_Detect,
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 637fb6565d28..0878f95b5449 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -465,7 +465,7 @@ scsi_adjust_queue_depth(struct scsi_device *device, int tag, int depth)
465 } 465 }
466 device->queue_depth = depth; 466 device->queue_depth = depth;
467} 467}
468static inline struct Scsi_Host *scsi_host_alloc(Scsi_Host_Template *t, size_t s) 468static inline struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *t, size_t s)
469{ 469{
470 return scsi_register(t, s); 470 return scsi_register(t, s);
471} 471}
@@ -639,10 +639,8 @@ struct qla_boards {
639static struct pci_device_id qla1280_pci_tbl[] = { 639static struct pci_device_id qla1280_pci_tbl[] = {
640 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP12160, 640 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP12160,
641 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 641 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
642#ifdef CONFIG_SCSI_QLOGIC_1280_1040
643 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1020, 642 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1020,
644 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 643 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
645#endif
646 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1080, 644 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1080,
647 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, 645 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
648 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1240, 646 {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1240,
@@ -1177,7 +1175,7 @@ qla1280_biosparam(struct scsi_device *sdev, struct block_device *bdev,
1177 1175
1178#if LINUX_VERSION_CODE < 0x020600 1176#if LINUX_VERSION_CODE < 0x020600
1179static int 1177static int
1180qla1280_detect(Scsi_Host_Template *template) 1178qla1280_detect(struct scsi_host_template *template)
1181{ 1179{
1182 struct pci_device_id *id = &qla1280_pci_tbl[0]; 1180 struct pci_device_id *id = &qla1280_pci_tbl[0];
1183 struct pci_dev *pdev = NULL; 1181 struct pci_dev *pdev = NULL;
@@ -4507,7 +4505,7 @@ static struct scsi_host_template qla1280_driver_template = {
4507 .use_clustering = ENABLE_CLUSTERING, 4505 .use_clustering = ENABLE_CLUSTERING,
4508}; 4506};
4509#else 4507#else
4510static Scsi_Host_Template qla1280_driver_template = { 4508static struct scsi_host_template qla1280_driver_template = {
4511 .proc_name = "qla1280", 4509 .proc_name = "qla1280",
4512 .name = "Qlogic ISP 1280/12160", 4510 .name = "Qlogic ISP 1280/12160",
4513 .detect = qla1280_detect, 4511 .detect = qla1280_detect,
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 89793c1c06b1..5c5d2315cfab 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -970,7 +970,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
970 int rval; 970 int rval;
971 uint32_t cnt, timer; 971 uint32_t cnt, timer;
972 uint32_t risc_address; 972 uint32_t risc_address;
973 uint16_t mb[4]; 973 uint16_t mb[4], wd;
974 974
975 uint32_t stat; 975 uint32_t stat;
976 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 976 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
@@ -1514,10 +1514,10 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
1514 1514
1515 WRT_REG_DWORD(&reg->ctrl_status, 1515 WRT_REG_DWORD(&reg->ctrl_status,
1516 CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES); 1516 CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES);
1517 RD_REG_DWORD(&reg->ctrl_status); 1517 pci_read_config_word(ha->pdev, PCI_COMMAND, &wd);
1518 1518
1519 udelay(100);
1519 /* Wait for firmware to complete NVRAM accesses. */ 1520 /* Wait for firmware to complete NVRAM accesses. */
1520 udelay(5);
1521 mb[0] = (uint32_t) RD_REG_WORD(&reg->mailbox0); 1521 mb[0] = (uint32_t) RD_REG_WORD(&reg->mailbox0);
1522 for (cnt = 10000 ; cnt && mb[0]; cnt--) { 1522 for (cnt = 10000 ; cnt && mb[0]; cnt--) {
1523 udelay(5); 1523 udelay(5);
@@ -1525,7 +1525,7 @@ qla24xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
1525 barrier(); 1525 barrier();
1526 } 1526 }
1527 1527
1528 udelay(20); 1528 /* Wait for soft-reset to complete. */
1529 for (cnt = 0; cnt < 30000; cnt++) { 1529 for (cnt = 0; cnt < 30000; cnt++) {
1530 if ((RD_REG_DWORD(&reg->ctrl_status) & 1530 if ((RD_REG_DWORD(&reg->ctrl_status) &
1531 CSRX_ISP_SOFT_RESET) == 0) 1531 CSRX_ISP_SOFT_RESET) == 0)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 72d9090df3df..2d720121a0d3 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -147,8 +147,8 @@ check_fw_ready_again:
147 * LIP to complete 147 * LIP to complete
148 */ 148 */
149 149
150 if (atomic_read(&ha->loop_state) == 150 if (atomic_read(&ha->loop_state) !=
151 LOOP_DOWN && retry--) { 151 LOOP_READY && retry--) {
152 goto check_fw_ready_again; 152 goto check_fw_ready_again;
153 } 153 }
154 wait_time--; 154 wait_time--;
@@ -567,6 +567,7 @@ qla24xx_reset_risc(scsi_qla_host_t *ha)
567 unsigned long flags = 0; 567 unsigned long flags = 0;
568 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 568 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
569 uint32_t cnt, d2; 569 uint32_t cnt, d2;
570 uint16_t wd;
570 571
571 spin_lock_irqsave(&ha->hardware_lock, flags); 572 spin_lock_irqsave(&ha->hardware_lock, flags);
572 573
@@ -581,10 +582,10 @@ qla24xx_reset_risc(scsi_qla_host_t *ha)
581 582
582 WRT_REG_DWORD(&reg->ctrl_status, 583 WRT_REG_DWORD(&reg->ctrl_status,
583 CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES); 584 CSRX_ISP_SOFT_RESET|CSRX_DMA_SHUTDOWN|MWB_4096_BYTES);
584 RD_REG_DWORD(&reg->ctrl_status); 585 pci_read_config_word(ha->pdev, PCI_COMMAND, &wd);
585 586
587 udelay(100);
586 /* Wait for firmware to complete NVRAM accesses. */ 588 /* Wait for firmware to complete NVRAM accesses. */
587 udelay(5);
588 d2 = (uint32_t) RD_REG_WORD(&reg->mailbox0); 589 d2 = (uint32_t) RD_REG_WORD(&reg->mailbox0);
589 for (cnt = 10000 ; cnt && d2; cnt--) { 590 for (cnt = 10000 ; cnt && d2; cnt--) {
590 udelay(5); 591 udelay(5);
@@ -592,7 +593,7 @@ qla24xx_reset_risc(scsi_qla_host_t *ha)
592 barrier(); 593 barrier();
593 } 594 }
594 595
595 udelay(20); 596 /* Wait for soft-reset to complete. */
596 d2 = RD_REG_DWORD(&reg->ctrl_status); 597 d2 = RD_REG_DWORD(&reg->ctrl_status);
597 for (cnt = 6000000 ; cnt && (d2 & CSRX_ISP_SOFT_RESET); cnt--) { 598 for (cnt = 6000000 ; cnt && (d2 & CSRX_ISP_SOFT_RESET); cnt--) {
598 udelay(5); 599 udelay(5);
@@ -1258,9 +1259,15 @@ qla2x00_configure_hba(scsi_qla_host_t *ha)
1258 rval = qla2x00_get_adapter_id(ha, 1259 rval = qla2x00_get_adapter_id(ha,
1259 &loop_id, &al_pa, &area, &domain, &topo); 1260 &loop_id, &al_pa, &area, &domain, &topo);
1260 if (rval != QLA_SUCCESS) { 1261 if (rval != QLA_SUCCESS) {
1261 qla_printk(KERN_WARNING, ha, 1262 if (LOOP_NOT_READY(ha) || atomic_read(&ha->loop_down_timer) ||
1262 "ERROR -- Unable to get host loop ID.\n"); 1263 (rval == QLA_COMMAND_ERROR && loop_id == 0x7)) {
1263 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); 1264 DEBUG2(printk("%s(%ld) Loop is in a transition state\n",
1265 __func__, ha->host_no));
1266 } else {
1267 qla_printk(KERN_WARNING, ha,
1268 "ERROR -- Unable to get host loop ID.\n");
1269 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
1270 }
1264 return (rval); 1271 return (rval);
1265 } 1272 }
1266 1273
@@ -1789,7 +1796,7 @@ qla2x00_configure_loop(scsi_qla_host_t *ha)
1789 } 1796 }
1790 1797
1791 if (rval == QLA_SUCCESS && test_bit(RSCN_UPDATE, &flags)) { 1798 if (rval == QLA_SUCCESS && test_bit(RSCN_UPDATE, &flags)) {
1792 if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) { 1799 if (LOOP_NOT_READY(ha)) {
1793 rval = QLA_FUNCTION_FAILED; 1800 rval = QLA_FUNCTION_FAILED;
1794 } else { 1801 } else {
1795 rval = qla2x00_configure_fabric(ha); 1802 rval = qla2x00_configure_fabric(ha);
@@ -2362,8 +2369,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
2362 if (qla2x00_is_reserved_id(ha, loop_id)) 2369 if (qla2x00_is_reserved_id(ha, loop_id))
2363 continue; 2370 continue;
2364 2371
2365 if (atomic_read(&ha->loop_down_timer) || 2372 if (atomic_read(&ha->loop_down_timer) || LOOP_NOT_READY(ha))
2366 test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))
2367 break; 2373 break;
2368 2374
2369 if (swl != NULL) { 2375 if (swl != NULL) {
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index ad3cacb9192d..9746cd1e664b 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -868,10 +868,6 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp)
868 DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no);) 868 DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no);)
869 869
870 fcport = sp->fcport; 870 fcport = sp->fcport;
871 if (atomic_read(&ha->loop_state) == LOOP_DOWN ||
872 atomic_read(&fcport->state) == FCS_DEVICE_LOST) {
873 return 1;
874 }
875 871
876 spin_lock_irqsave(&ha->hardware_lock, flags); 872 spin_lock_irqsave(&ha->hardware_lock, flags);
877 for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { 873 for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) {
@@ -1008,6 +1004,8 @@ qla2x00_get_adapter_id(scsi_qla_host_t *ha, uint16_t *id, uint8_t *al_pa,
1008 mcp->tov = 30; 1004 mcp->tov = 30;
1009 mcp->flags = 0; 1005 mcp->flags = 0;
1010 rval = qla2x00_mailbox_command(ha, mcp); 1006 rval = qla2x00_mailbox_command(ha, mcp);
1007 if (mcp->mb[0] == MBS_COMMAND_ERROR)
1008 rval = QLA_COMMAND_ERROR;
1011 1009
1012 /* Return data. */ 1010 /* Return data. */
1013 *id = mcp->mb[1]; 1011 *id = mcp->mb[1];
@@ -2179,10 +2177,6 @@ qla24xx_abort_command(scsi_qla_host_t *ha, srb_t *sp)
2179 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);) 2177 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
2180 2178
2181 fcport = sp->fcport; 2179 fcport = sp->fcport;
2182 if (atomic_read(&ha->loop_state) == LOOP_DOWN ||
2183 atomic_read(&fcport->state) == FCS_DEVICE_LOST) {
2184 return QLA_FUNCTION_FAILED;
2185 }
2186 2180
2187 spin_lock_irqsave(&ha->hardware_lock, flags); 2181 spin_lock_irqsave(&ha->hardware_lock, flags);
2188 for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { 2182 for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) {
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index 4bec0b4fb6b4..d54d2a99c3d3 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -126,6 +126,7 @@ qla2x00_write_nvram_word(scsi_qla_host_t *ha, uint32_t addr, uint16_t data)
126 126
127 /* Wait for NVRAM to become ready */ 127 /* Wait for NVRAM to become ready */
128 WRT_REG_WORD(&reg->nvram, NVR_SELECT); 128 WRT_REG_WORD(&reg->nvram, NVR_SELECT);
129 RD_REG_WORD(&reg->nvram); /* PCI Posting. */
129 do { 130 do {
130 NVRAM_DELAY(); 131 NVRAM_DELAY();
131 word = RD_REG_WORD(&reg->nvram); 132 word = RD_REG_WORD(&reg->nvram);
@@ -178,6 +179,7 @@ qla2x00_write_nvram_word_tmo(scsi_qla_host_t *ha, uint32_t addr, uint16_t data,
178 179
179 /* Wait for NVRAM to become ready */ 180 /* Wait for NVRAM to become ready */
180 WRT_REG_WORD(&reg->nvram, NVR_SELECT); 181 WRT_REG_WORD(&reg->nvram, NVR_SELECT);
182 RD_REG_WORD(&reg->nvram); /* PCI Posting. */
181 do { 183 do {
182 NVRAM_DELAY(); 184 NVRAM_DELAY();
183 word = RD_REG_WORD(&reg->nvram); 185 word = RD_REG_WORD(&reg->nvram);
@@ -235,6 +237,7 @@ qla2x00_nvram_request(scsi_qla_host_t *ha, uint32_t nv_cmd)
235 /* Read data from NVRAM. */ 237 /* Read data from NVRAM. */
236 for (cnt = 0; cnt < 16; cnt++) { 238 for (cnt = 0; cnt < 16; cnt++) {
237 WRT_REG_WORD(&reg->nvram, NVR_SELECT | NVR_CLOCK); 239 WRT_REG_WORD(&reg->nvram, NVR_SELECT | NVR_CLOCK);
240 RD_REG_WORD(&reg->nvram); /* PCI Posting. */
238 NVRAM_DELAY(); 241 NVRAM_DELAY();
239 data <<= 1; 242 data <<= 1;
240 reg_data = RD_REG_WORD(&reg->nvram); 243 reg_data = RD_REG_WORD(&reg->nvram);
@@ -337,6 +340,7 @@ qla2x00_clear_nvram_protection(scsi_qla_host_t *ha)
337 340
338 /* Wait for NVRAM to become ready. */ 341 /* Wait for NVRAM to become ready. */
339 WRT_REG_WORD(&reg->nvram, NVR_SELECT); 342 WRT_REG_WORD(&reg->nvram, NVR_SELECT);
343 RD_REG_WORD(&reg->nvram); /* PCI Posting. */
340 do { 344 do {
341 NVRAM_DELAY(); 345 NVRAM_DELAY();
342 word = RD_REG_WORD(&reg->nvram); 346 word = RD_REG_WORD(&reg->nvram);
@@ -388,6 +392,7 @@ qla2x00_set_nvram_protection(scsi_qla_host_t *ha, int stat)
388 392
389 /* Wait for NVRAM to become ready. */ 393 /* Wait for NVRAM to become ready. */
390 WRT_REG_WORD(&reg->nvram, NVR_SELECT); 394 WRT_REG_WORD(&reg->nvram, NVR_SELECT);
395 RD_REG_WORD(&reg->nvram); /* PCI Posting. */
391 do { 396 do {
392 NVRAM_DELAY(); 397 NVRAM_DELAY();
393 word = RD_REG_WORD(&reg->nvram); 398 word = RD_REG_WORD(&reg->nvram);
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index 0d5472f2f59b..f7937f7f9c68 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -7,9 +7,9 @@
7/* 7/*
8 * Driver version 8 * Driver version
9 */ 9 */
10#define QLA2XXX_VERSION "8.01.00-k" 10#define QLA2XXX_VERSION "8.01.03-k"
11 11
12#define QLA_DRIVER_MAJOR_VER 8 12#define QLA_DRIVER_MAJOR_VER 8
13#define QLA_DRIVER_MINOR_VER 1 13#define QLA_DRIVER_MINOR_VER 1
14#define QLA_DRIVER_PATCH_VER 0 14#define QLA_DRIVER_PATCH_VER 3
15#define QLA_DRIVER_BETA_VER 0 15#define QLA_DRIVER_BETA_VER 0
diff --git a/drivers/scsi/qlogicfas.c b/drivers/scsi/qlogicfas.c
index 55e698b651d6..94baca840efe 100644
--- a/drivers/scsi/qlogicfas.c
+++ b/drivers/scsi/qlogicfas.c
@@ -47,7 +47,7 @@ static char qlogicfas_name[] = "qlogicfas";
47 * Look for qlogic card and init if found 47 * Look for qlogic card and init if found
48 */ 48 */
49 49
50static struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host, 50static struct Scsi_Host *__qlogicfas_detect(struct scsi_host_template *host,
51 int qbase, 51 int qbase,
52 int qlirq) 52 int qlirq)
53{ 53{
@@ -142,7 +142,7 @@ module_param_array(irq, int, NULL, 0);
142MODULE_PARM_DESC(iobase, "I/O address"); 142MODULE_PARM_DESC(iobase, "I/O address");
143MODULE_PARM_DESC(irq, "IRQ"); 143MODULE_PARM_DESC(irq, "IRQ");
144 144
145static int __devinit qlogicfas_detect(Scsi_Host_Template *sht) 145static int __devinit qlogicfas_detect(struct scsi_host_template *sht)
146{ 146{
147 struct Scsi_Host *shost; 147 struct Scsi_Host *shost;
148 struct qlogicfas408_priv *priv; 148 struct qlogicfas408_priv *priv;
@@ -183,7 +183,7 @@ static int qlogicfas_release(struct Scsi_Host *shost)
183/* 183/*
184 * The driver template is also needed for PCMCIA 184 * The driver template is also needed for PCMCIA
185 */ 185 */
186static Scsi_Host_Template qlogicfas_driver_template = { 186static struct scsi_host_template qlogicfas_driver_template = {
187 .module = THIS_MODULE, 187 .module = THIS_MODULE,
188 .name = qlogicfas_name, 188 .name = qlogicfas_name,
189 .proc_name = qlogicfas_name, 189 .proc_name = qlogicfas_name,
diff --git a/drivers/scsi/qlogicfc.c b/drivers/scsi/qlogicfc.c
index a4b3b3fd4815..94ef3f08d378 100644
--- a/drivers/scsi/qlogicfc.c
+++ b/drivers/scsi/qlogicfc.c
@@ -711,7 +711,7 @@ static inline void isp2x00_disable_irqs(struct Scsi_Host *host)
711} 711}
712 712
713 713
714static int isp2x00_detect(Scsi_Host_Template * tmpt) 714static int isp2x00_detect(struct scsi_host_template * tmpt)
715{ 715{
716 int hosts = 0; 716 int hosts = 0;
717 unsigned long wait_time; 717 unsigned long wait_time;
@@ -2210,7 +2210,7 @@ void isp2x00_print_scsi_cmd(Scsi_Cmnd * cmd)
2210 2210
2211MODULE_LICENSE("GPL"); 2211MODULE_LICENSE("GPL");
2212 2212
2213static Scsi_Host_Template driver_template = { 2213static struct scsi_host_template driver_template = {
2214 .detect = isp2x00_detect, 2214 .detect = isp2x00_detect,
2215 .release = isp2x00_release, 2215 .release = isp2x00_release,
2216 .info = isp2x00_info, 2216 .info = isp2x00_info,
diff --git a/drivers/scsi/qlogicisp.c b/drivers/scsi/qlogicisp.c
deleted file mode 100644
index 6c9266b8ffdf..000000000000
--- a/drivers/scsi/qlogicisp.c
+++ /dev/null
@@ -1,1934 +0,0 @@
1/*
2 * QLogic ISP1020 Intelligent SCSI Processor Driver (PCI)
3 * Written by Erik H. Moe, ehm@cris.com
4 * Copyright 1995, Erik H. Moe
5 * Copyright 1996, 1997 Michael A. Griffith <grif@acm.org>
6 * Copyright 2000, Jayson C. Vantuyl <vantuyl@csc.smsu.edu>
7 * and Bryon W. Roche <bryon@csc.smsu.edu>
8 *
9 * 64-bit addressing added by Kanoj Sarcar <kanoj@sgi.com>
10 * and Leo Dagum <dagum@sgi.com>
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2, or (at your option) any
15 * later version.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 */
22
23#include <linux/blkdev.h>
24#include <linux/config.h>
25#include <linux/kernel.h>
26#include <linux/string.h>
27#include <linux/ioport.h>
28#include <linux/sched.h>
29#include <linux/types.h>
30#include <linux/pci.h>
31#include <linux/delay.h>
32#include <linux/unistd.h>
33#include <linux/spinlock.h>
34#include <linux/interrupt.h>
35#include <asm/io.h>
36#include <asm/irq.h>
37#include <asm/byteorder.h>
38#include "scsi.h"
39#include <scsi/scsi_host.h>
40
41/*
42 * With the qlogic interface, every queue slot can hold a SCSI
43 * command with up to 4 scatter/gather entries. If we need more
44 * than 4 entries, continuation entries can be used that hold
45 * another 7 entries each. Unlike for other drivers, this means
46 * that the maximum number of scatter/gather entries we can
47 * support at any given time is a function of the number of queue
48 * slots available. That is, host->can_queue and host->sg_tablesize
49 * are dynamic and _not_ independent. This all works fine because
50 * requests are queued serially and the scatter/gather limit is
51 * determined for each queue request anew.
52 */
53#define QLOGICISP_REQ_QUEUE_LEN 63 /* must be power of two - 1 */
54#define QLOGICISP_MAX_SG(ql) (4 + ((ql) > 0) ? 7*((ql) - 1) : 0)
55
56/* Configuration section *****************************************************/
57
58/* Set the following macro to 1 to reload the ISP1020's firmware. This is
59 the latest firmware provided by QLogic. This may be an earlier/later
60 revision than supplied by your board. */
61
62#define RELOAD_FIRMWARE 1
63
64/* Set the following macro to 1 to reload the ISP1020's defaults from nvram.
65 If you are not sure of your settings, leave this alone, the driver will
66 use a set of 'safe' defaults */
67
68#define USE_NVRAM_DEFAULTS 0
69
70/* Macros used for debugging */
71
72#define DEBUG_ISP1020 0
73#define DEBUG_ISP1020_INTR 0
74#define DEBUG_ISP1020_SETUP 0
75#define TRACE_ISP 0
76
77#define DEFAULT_LOOP_COUNT 1000000
78
79/* End Configuration section *************************************************/
80
81#include <linux/module.h>
82
83#if TRACE_ISP
84
85# define TRACE_BUF_LEN (32*1024)
86
87struct {
88 u_long next;
89 struct {
90 u_long time;
91 u_int index;
92 u_int addr;
93 u_char * name;
94 } buf[TRACE_BUF_LEN];
95} trace;
96
97#define TRACE(w, i, a) \
98{ \
99 unsigned long flags; \
100 \
101 trace.buf[trace.next].name = (w); \
102 trace.buf[trace.next].time = jiffies; \
103 trace.buf[trace.next].index = (i); \
104 trace.buf[trace.next].addr = (long) (a); \
105 trace.next = (trace.next + 1) & (TRACE_BUF_LEN - 1); \
106}
107
108#else
109# define TRACE(w, i, a)
110#endif
111
112#if DEBUG_ISP1020
113#define ENTER(x) printk("isp1020 : entering %s()\n", x);
114#define LEAVE(x) printk("isp1020 : leaving %s()\n", x);
115#define DEBUG(x) x
116#else
117#define ENTER(x)
118#define LEAVE(x)
119#define DEBUG(x)
120#endif /* DEBUG_ISP1020 */
121
122#if DEBUG_ISP1020_INTR
123#define ENTER_INTR(x) printk("isp1020 : entering %s()\n", x);
124#define LEAVE_INTR(x) printk("isp1020 : leaving %s()\n", x);
125#define DEBUG_INTR(x) x
126#else
127#define ENTER_INTR(x)
128#define LEAVE_INTR(x)
129#define DEBUG_INTR(x)
130#endif /* DEBUG ISP1020_INTR */
131
132#define ISP1020_REV_ID 1
133
134#define MAX_TARGETS 16
135#define MAX_LUNS 8
136
137/* host configuration and control registers */
138#define HOST_HCCR 0xc0 /* host command and control */
139
140/* pci bus interface registers */
141#define PCI_ID_LOW 0x00 /* vendor id */
142#define PCI_ID_HIGH 0x02 /* device id */
143#define ISP_CFG0 0x04 /* configuration register #0 */
144#define ISP_CFG0_HWMSK 0x000f /* Hardware revision mask */
145#define ISP_CFG0_1020 0x0001 /* ISP1020 */
146#define ISP_CFG0_1020A 0x0002 /* ISP1020A */
147#define ISP_CFG0_1040 0x0003 /* ISP1040 */
148#define ISP_CFG0_1040A 0x0004 /* ISP1040A */
149#define ISP_CFG0_1040B 0x0005 /* ISP1040B */
150#define ISP_CFG0_1040C 0x0006 /* ISP1040C */
151#define ISP_CFG1 0x06 /* configuration register #1 */
152#define ISP_CFG1_F128 0x0040 /* 128-byte FIFO threshold */
153#define ISP_CFG1_F64 0x0030 /* 128-byte FIFO threshold */
154#define ISP_CFG1_F32 0x0020 /* 128-byte FIFO threshold */
155#define ISP_CFG1_F16 0x0010 /* 128-byte FIFO threshold */
156#define ISP_CFG1_BENAB 0x0004 /* Global Bus burst enable */
157#define ISP_CFG1_SXP 0x0001 /* SXP register select */
158#define PCI_INTF_CTL 0x08 /* pci interface control */
159#define PCI_INTF_STS 0x0a /* pci interface status */
160#define PCI_SEMAPHORE 0x0c /* pci semaphore */
161#define PCI_NVRAM 0x0e /* pci nvram interface */
162#define CDMA_CONF 0x20 /* Command DMA Config */
163#define DDMA_CONF 0x40 /* Data DMA Config */
164#define DMA_CONF_SENAB 0x0008 /* SXP to DMA Data enable */
165#define DMA_CONF_RIRQ 0x0004 /* RISC interrupt enable */
166#define DMA_CONF_BENAB 0x0002 /* Bus burst enable */
167#define DMA_CONF_DIR 0x0001 /* DMA direction (0=fifo->host 1=host->fifo) */
168
169/* mailbox registers */
170#define MBOX0 0x70 /* mailbox 0 */
171#define MBOX1 0x72 /* mailbox 1 */
172#define MBOX2 0x74 /* mailbox 2 */
173#define MBOX3 0x76 /* mailbox 3 */
174#define MBOX4 0x78 /* mailbox 4 */
175#define MBOX5 0x7a /* mailbox 5 */
176#define MBOX6 0x7c /* mailbox 6 */
177#define MBOX7 0x7e /* mailbox 7 */
178
179/* mailbox command complete status codes */
180#define MBOX_COMMAND_COMPLETE 0x4000
181#define INVALID_COMMAND 0x4001
182#define HOST_INTERFACE_ERROR 0x4002
183#define TEST_FAILED 0x4003
184#define COMMAND_ERROR 0x4005
185#define COMMAND_PARAM_ERROR 0x4006
186
187/* async event status codes */
188#define ASYNC_SCSI_BUS_RESET 0x8001
189#define SYSTEM_ERROR 0x8002
190#define REQUEST_TRANSFER_ERROR 0x8003
191#define RESPONSE_TRANSFER_ERROR 0x8004
192#define REQUEST_QUEUE_WAKEUP 0x8005
193#define EXECUTION_TIMEOUT_RESET 0x8006
194
195#ifdef CONFIG_QL_ISP_A64
196#define IOCB_SEGS 2
197#define CONTINUATION_SEGS 5
198#define MAX_CONTINUATION_ENTRIES 254
199#else
200#define IOCB_SEGS 4
201#define CONTINUATION_SEGS 7
202#endif /* CONFIG_QL_ISP_A64 */
203
204struct Entry_header {
205 u_char entry_type;
206 u_char entry_cnt;
207 u_char sys_def_1;
208 u_char flags;
209};
210
211/* entry header type commands */
212#ifdef CONFIG_QL_ISP_A64
213#define ENTRY_COMMAND 9
214#define ENTRY_CONTINUATION 0xa
215#else
216#define ENTRY_COMMAND 1
217#define ENTRY_CONTINUATION 2
218#endif /* CONFIG_QL_ISP_A64 */
219
220#define ENTRY_STATUS 3
221#define ENTRY_MARKER 4
222#define ENTRY_EXTENDED_COMMAND 5
223
224/* entry header flag definitions */
225#define EFLAG_CONTINUATION 1
226#define EFLAG_BUSY 2
227#define EFLAG_BAD_HEADER 4
228#define EFLAG_BAD_PAYLOAD 8
229
230struct dataseg {
231 u_int d_base;
232#ifdef CONFIG_QL_ISP_A64
233 u_int d_base_hi;
234#endif
235 u_int d_count;
236};
237
238struct Command_Entry {
239 struct Entry_header hdr;
240 u_int handle;
241 u_char target_lun;
242 u_char target_id;
243 u_short cdb_length;
244 u_short control_flags;
245 u_short rsvd;
246 u_short time_out;
247 u_short segment_cnt;
248 u_char cdb[12];
249#ifdef CONFIG_QL_ISP_A64
250 u_int rsvd1;
251 u_int rsvd2;
252#endif
253 struct dataseg dataseg[IOCB_SEGS];
254};
255
256/* command entry control flag definitions */
257#define CFLAG_NODISC 0x01
258#define CFLAG_HEAD_TAG 0x02
259#define CFLAG_ORDERED_TAG 0x04
260#define CFLAG_SIMPLE_TAG 0x08
261#define CFLAG_TAR_RTN 0x10
262#define CFLAG_READ 0x20
263#define CFLAG_WRITE 0x40
264
265struct Ext_Command_Entry {
266 struct Entry_header hdr;
267 u_int handle;
268 u_char target_lun;
269 u_char target_id;
270 u_short cdb_length;
271 u_short control_flags;
272 u_short rsvd;
273 u_short time_out;
274 u_short segment_cnt;
275 u_char cdb[44];
276};
277
278struct Continuation_Entry {
279 struct Entry_header hdr;
280#ifndef CONFIG_QL_ISP_A64
281 u_int reserved;
282#endif
283 struct dataseg dataseg[CONTINUATION_SEGS];
284};
285
286struct Marker_Entry {
287 struct Entry_header hdr;
288 u_int reserved;
289 u_char target_lun;
290 u_char target_id;
291 u_char modifier;
292 u_char rsvd;
293 u_char rsvds[52];
294};
295
296/* marker entry modifier definitions */
297#define SYNC_DEVICE 0
298#define SYNC_TARGET 1
299#define SYNC_ALL 2
300
301struct Status_Entry {
302 struct Entry_header hdr;
303 u_int handle;
304 u_short scsi_status;
305 u_short completion_status;
306 u_short state_flags;
307 u_short status_flags;
308 u_short time;
309 u_short req_sense_len;
310 u_int residual;
311 u_char rsvd[8];
312 u_char req_sense_data[32];
313};
314
315/* status entry completion status definitions */
316#define CS_COMPLETE 0x0000
317#define CS_INCOMPLETE 0x0001
318#define CS_DMA_ERROR 0x0002
319#define CS_TRANSPORT_ERROR 0x0003
320#define CS_RESET_OCCURRED 0x0004
321#define CS_ABORTED 0x0005
322#define CS_TIMEOUT 0x0006
323#define CS_DATA_OVERRUN 0x0007
324#define CS_COMMAND_OVERRUN 0x0008
325#define CS_STATUS_OVERRUN 0x0009
326#define CS_BAD_MESSAGE 0x000a
327#define CS_NO_MESSAGE_OUT 0x000b
328#define CS_EXT_ID_FAILED 0x000c
329#define CS_IDE_MSG_FAILED 0x000d
330#define CS_ABORT_MSG_FAILED 0x000e
331#define CS_REJECT_MSG_FAILED 0x000f
332#define CS_NOP_MSG_FAILED 0x0010
333#define CS_PARITY_ERROR_MSG_FAILED 0x0011
334#define CS_DEVICE_RESET_MSG_FAILED 0x0012
335#define CS_ID_MSG_FAILED 0x0013
336#define CS_UNEXP_BUS_FREE 0x0014
337#define CS_DATA_UNDERRUN 0x0015
338
339/* status entry state flag definitions */
340#define SF_GOT_BUS 0x0100
341#define SF_GOT_TARGET 0x0200
342#define SF_SENT_CDB 0x0400
343#define SF_TRANSFERRED_DATA 0x0800
344#define SF_GOT_STATUS 0x1000
345#define SF_GOT_SENSE 0x2000
346
347/* status entry status flag definitions */
348#define STF_DISCONNECT 0x0001
349#define STF_SYNCHRONOUS 0x0002
350#define STF_PARITY_ERROR 0x0004
351#define STF_BUS_RESET 0x0008
352#define STF_DEVICE_RESET 0x0010
353#define STF_ABORTED 0x0020
354#define STF_TIMEOUT 0x0040
355#define STF_NEGOTIATION 0x0080
356
357/* interface control commands */
358#define ISP_RESET 0x0001
359#define ISP_EN_INT 0x0002
360#define ISP_EN_RISC 0x0004
361
362/* host control commands */
363#define HCCR_NOP 0x0000
364#define HCCR_RESET 0x1000
365#define HCCR_PAUSE 0x2000
366#define HCCR_RELEASE 0x3000
367#define HCCR_SINGLE_STEP 0x4000
368#define HCCR_SET_HOST_INTR 0x5000
369#define HCCR_CLEAR_HOST_INTR 0x6000
370#define HCCR_CLEAR_RISC_INTR 0x7000
371#define HCCR_BP_ENABLE 0x8000
372#define HCCR_BIOS_DISABLE 0x9000
373#define HCCR_TEST_MODE 0xf000
374
375#define RISC_BUSY 0x0004
376
377/* mailbox commands */
378#define MBOX_NO_OP 0x0000
379#define MBOX_LOAD_RAM 0x0001
380#define MBOX_EXEC_FIRMWARE 0x0002
381#define MBOX_DUMP_RAM 0x0003
382#define MBOX_WRITE_RAM_WORD 0x0004
383#define MBOX_READ_RAM_WORD 0x0005
384#define MBOX_MAILBOX_REG_TEST 0x0006
385#define MBOX_VERIFY_CHECKSUM 0x0007
386#define MBOX_ABOUT_FIRMWARE 0x0008
387#define MBOX_CHECK_FIRMWARE 0x000e
388#define MBOX_INIT_REQ_QUEUE 0x0010
389#define MBOX_INIT_RES_QUEUE 0x0011
390#define MBOX_EXECUTE_IOCB 0x0012
391#define MBOX_WAKE_UP 0x0013
392#define MBOX_STOP_FIRMWARE 0x0014
393#define MBOX_ABORT 0x0015
394#define MBOX_ABORT_DEVICE 0x0016
395#define MBOX_ABORT_TARGET 0x0017
396#define MBOX_BUS_RESET 0x0018
397#define MBOX_STOP_QUEUE 0x0019
398#define MBOX_START_QUEUE 0x001a
399#define MBOX_SINGLE_STEP_QUEUE 0x001b
400#define MBOX_ABORT_QUEUE 0x001c
401#define MBOX_GET_DEV_QUEUE_STATUS 0x001d
402#define MBOX_GET_FIRMWARE_STATUS 0x001f
403#define MBOX_GET_INIT_SCSI_ID 0x0020
404#define MBOX_GET_SELECT_TIMEOUT 0x0021
405#define MBOX_GET_RETRY_COUNT 0x0022
406#define MBOX_GET_TAG_AGE_LIMIT 0x0023
407#define MBOX_GET_CLOCK_RATE 0x0024
408#define MBOX_GET_ACT_NEG_STATE 0x0025
409#define MBOX_GET_ASYNC_DATA_SETUP_TIME 0x0026
410#define MBOX_GET_PCI_PARAMS 0x0027
411#define MBOX_GET_TARGET_PARAMS 0x0028
412#define MBOX_GET_DEV_QUEUE_PARAMS 0x0029
413#define MBOX_SET_INIT_SCSI_ID 0x0030
414#define MBOX_SET_SELECT_TIMEOUT 0x0031
415#define MBOX_SET_RETRY_COUNT 0x0032
416#define MBOX_SET_TAG_AGE_LIMIT 0x0033
417#define MBOX_SET_CLOCK_RATE 0x0034
418#define MBOX_SET_ACTIVE_NEG_STATE 0x0035
419#define MBOX_SET_ASYNC_DATA_SETUP_TIME 0x0036
420#define MBOX_SET_PCI_CONTROL_PARAMS 0x0037
421#define MBOX_SET_TARGET_PARAMS 0x0038
422#define MBOX_SET_DEV_QUEUE_PARAMS 0x0039
423#define MBOX_RETURN_BIOS_BLOCK_ADDR 0x0040
424#define MBOX_WRITE_FOUR_RAM_WORDS 0x0041
425#define MBOX_EXEC_BIOS_IOCB 0x0042
426
427#ifdef CONFIG_QL_ISP_A64
428#define MBOX_CMD_INIT_REQUEST_QUEUE_64 0x0052
429#define MBOX_CMD_INIT_RESPONSE_QUEUE_64 0x0053
430#endif /* CONFIG_QL_ISP_A64 */
431
432#include "qlogicisp_asm.c"
433
434#define PACKB(a, b) (((a)<<4)|(b))
435
436static const u_char mbox_param[] = {
437 PACKB(1, 1), /* MBOX_NO_OP */
438 PACKB(5, 5), /* MBOX_LOAD_RAM */
439 PACKB(2, 0), /* MBOX_EXEC_FIRMWARE */
440 PACKB(5, 5), /* MBOX_DUMP_RAM */
441 PACKB(3, 3), /* MBOX_WRITE_RAM_WORD */
442 PACKB(2, 3), /* MBOX_READ_RAM_WORD */
443 PACKB(6, 6), /* MBOX_MAILBOX_REG_TEST */
444 PACKB(2, 3), /* MBOX_VERIFY_CHECKSUM */
445 PACKB(1, 3), /* MBOX_ABOUT_FIRMWARE */
446 PACKB(0, 0), /* 0x0009 */
447 PACKB(0, 0), /* 0x000a */
448 PACKB(0, 0), /* 0x000b */
449 PACKB(0, 0), /* 0x000c */
450 PACKB(0, 0), /* 0x000d */
451 PACKB(1, 2), /* MBOX_CHECK_FIRMWARE */
452 PACKB(0, 0), /* 0x000f */
453 PACKB(5, 5), /* MBOX_INIT_REQ_QUEUE */
454 PACKB(6, 6), /* MBOX_INIT_RES_QUEUE */
455 PACKB(4, 4), /* MBOX_EXECUTE_IOCB */
456 PACKB(2, 2), /* MBOX_WAKE_UP */
457 PACKB(1, 6), /* MBOX_STOP_FIRMWARE */
458 PACKB(4, 4), /* MBOX_ABORT */
459 PACKB(2, 2), /* MBOX_ABORT_DEVICE */
460 PACKB(3, 3), /* MBOX_ABORT_TARGET */
461 PACKB(2, 2), /* MBOX_BUS_RESET */
462 PACKB(2, 3), /* MBOX_STOP_QUEUE */
463 PACKB(2, 3), /* MBOX_START_QUEUE */
464 PACKB(2, 3), /* MBOX_SINGLE_STEP_QUEUE */
465 PACKB(2, 3), /* MBOX_ABORT_QUEUE */
466 PACKB(2, 4), /* MBOX_GET_DEV_QUEUE_STATUS */
467 PACKB(0, 0), /* 0x001e */
468 PACKB(1, 3), /* MBOX_GET_FIRMWARE_STATUS */
469 PACKB(1, 2), /* MBOX_GET_INIT_SCSI_ID */
470 PACKB(1, 2), /* MBOX_GET_SELECT_TIMEOUT */
471 PACKB(1, 3), /* MBOX_GET_RETRY_COUNT */
472 PACKB(1, 2), /* MBOX_GET_TAG_AGE_LIMIT */
473 PACKB(1, 2), /* MBOX_GET_CLOCK_RATE */
474 PACKB(1, 2), /* MBOX_GET_ACT_NEG_STATE */
475 PACKB(1, 2), /* MBOX_GET_ASYNC_DATA_SETUP_TIME */
476 PACKB(1, 3), /* MBOX_GET_PCI_PARAMS */
477 PACKB(2, 4), /* MBOX_GET_TARGET_PARAMS */
478 PACKB(2, 4), /* MBOX_GET_DEV_QUEUE_PARAMS */
479 PACKB(0, 0), /* 0x002a */
480 PACKB(0, 0), /* 0x002b */
481 PACKB(0, 0), /* 0x002c */
482 PACKB(0, 0), /* 0x002d */
483 PACKB(0, 0), /* 0x002e */
484 PACKB(0, 0), /* 0x002f */
485 PACKB(2, 2), /* MBOX_SET_INIT_SCSI_ID */
486 PACKB(2, 2), /* MBOX_SET_SELECT_TIMEOUT */
487 PACKB(3, 3), /* MBOX_SET_RETRY_COUNT */
488 PACKB(2, 2), /* MBOX_SET_TAG_AGE_LIMIT */
489 PACKB(2, 2), /* MBOX_SET_CLOCK_RATE */
490 PACKB(2, 2), /* MBOX_SET_ACTIVE_NEG_STATE */
491 PACKB(2, 2), /* MBOX_SET_ASYNC_DATA_SETUP_TIME */
492 PACKB(3, 3), /* MBOX_SET_PCI_CONTROL_PARAMS */
493 PACKB(4, 4), /* MBOX_SET_TARGET_PARAMS */
494 PACKB(4, 4), /* MBOX_SET_DEV_QUEUE_PARAMS */
495 PACKB(0, 0), /* 0x003a */
496 PACKB(0, 0), /* 0x003b */
497 PACKB(0, 0), /* 0x003c */
498 PACKB(0, 0), /* 0x003d */
499 PACKB(0, 0), /* 0x003e */
500 PACKB(0, 0), /* 0x003f */
501 PACKB(1, 2), /* MBOX_RETURN_BIOS_BLOCK_ADDR */
502 PACKB(6, 1), /* MBOX_WRITE_FOUR_RAM_WORDS */
503 PACKB(2, 3) /* MBOX_EXEC_BIOS_IOCB */
504#ifdef CONFIG_QL_ISP_A64
505 ,PACKB(0, 0), /* 0x0043 */
506 PACKB(0, 0), /* 0x0044 */
507 PACKB(0, 0), /* 0x0045 */
508 PACKB(0, 0), /* 0x0046 */
509 PACKB(0, 0), /* 0x0047 */
510 PACKB(0, 0), /* 0x0048 */
511 PACKB(0, 0), /* 0x0049 */
512 PACKB(0, 0), /* 0x004a */
513 PACKB(0, 0), /* 0x004b */
514 PACKB(0, 0), /* 0x004c */
515 PACKB(0, 0), /* 0x004d */
516 PACKB(0, 0), /* 0x004e */
517 PACKB(0, 0), /* 0x004f */
518 PACKB(0, 0), /* 0x0050 */
519 PACKB(0, 0), /* 0x0051 */
520 PACKB(8, 8), /* MBOX_CMD_INIT_REQUEST_QUEUE_64 (0x0052) */
521 PACKB(8, 8) /* MBOX_CMD_INIT_RESPONSE_QUEUE_64 (0x0053) */
522#endif /* CONFIG_QL_ISP_A64 */
523};
524
525#define MAX_MBOX_COMMAND (sizeof(mbox_param)/sizeof(u_short))
526
527struct host_param {
528 u_short fifo_threshold;
529 u_short host_adapter_enable;
530 u_short initiator_scsi_id;
531 u_short bus_reset_delay;
532 u_short retry_count;
533 u_short retry_delay;
534 u_short async_data_setup_time;
535 u_short req_ack_active_negation;
536 u_short data_line_active_negation;
537 u_short data_dma_burst_enable;
538 u_short command_dma_burst_enable;
539 u_short tag_aging;
540 u_short selection_timeout;
541 u_short max_queue_depth;
542};
543
544/*
545 * Device Flags:
546 *
547 * Bit Name
548 * ---------
549 * 7 Disconnect Privilege
550 * 6 Parity Checking
551 * 5 Wide Data Transfers
552 * 4 Synchronous Data Transfers
553 * 3 Tagged Queuing
554 * 2 Automatic Request Sense
555 * 1 Stop Queue on Check Condition
556 * 0 Renegotiate on Error
557 */
558
559struct dev_param {
560 u_short device_flags;
561 u_short execution_throttle;
562 u_short synchronous_period;
563 u_short synchronous_offset;
564 u_short device_enable;
565 u_short reserved; /* pad */
566};
567
568/*
569 * The result queue can be quite a bit smaller since continuation entries
570 * do not show up there:
571 */
572#define RES_QUEUE_LEN ((QLOGICISP_REQ_QUEUE_LEN + 1) / 8 - 1)
573#define QUEUE_ENTRY_LEN 64
574#define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN)
575
576struct isp_queue_entry {
577 char __opaque[QUEUE_ENTRY_LEN];
578};
579
580struct isp1020_hostdata {
581 void __iomem *memaddr;
582 u_char revision;
583 struct host_param host_param;
584 struct dev_param dev_param[MAX_TARGETS];
585 struct pci_dev *pci_dev;
586
587 struct isp_queue_entry *res_cpu; /* CPU-side address of response queue. */
588 struct isp_queue_entry *req_cpu; /* CPU-size address of request queue. */
589
590 /* result and request queues (shared with isp1020): */
591 u_int req_in_ptr; /* index of next request slot */
592 u_int res_out_ptr; /* index of next result slot */
593
594 /* this is here so the queues are nicely aligned */
595 long send_marker; /* do we need to send a marker? */
596
597 /* The cmd->handle has a fixed size, and is only 32-bits. We
598 * need to take care to handle 64-bit systems correctly thus what
599 * we actually place in cmd->handle is an index to the following
600 * table. Kudos to Matt Jacob for the technique. -DaveM
601 */
602 Scsi_Cmnd *cmd_slots[QLOGICISP_REQ_QUEUE_LEN + 1];
603
604 dma_addr_t res_dma; /* PCI side view of response queue */
605 dma_addr_t req_dma; /* PCI side view of request queue */
606};
607
608/* queue length's _must_ be power of two: */
609#define QUEUE_DEPTH(in, out, ql) ((in - out) & (ql))
610#define REQ_QUEUE_DEPTH(in, out) QUEUE_DEPTH(in, out, \
611 QLOGICISP_REQ_QUEUE_LEN)
612#define RES_QUEUE_DEPTH(in, out) QUEUE_DEPTH(in, out, RES_QUEUE_LEN)
613
614static void isp1020_enable_irqs(struct Scsi_Host *);
615static void isp1020_disable_irqs(struct Scsi_Host *);
616static int isp1020_init(struct Scsi_Host *);
617static int isp1020_reset_hardware(struct Scsi_Host *);
618static int isp1020_set_defaults(struct Scsi_Host *);
619static int isp1020_load_parameters(struct Scsi_Host *);
620static int isp1020_mbox_command(struct Scsi_Host *, u_short []);
621static int isp1020_return_status(struct Status_Entry *);
622static void isp1020_intr_handler(int, void *, struct pt_regs *);
623static irqreturn_t do_isp1020_intr_handler(int, void *, struct pt_regs *);
624
625#if USE_NVRAM_DEFAULTS
626static int isp1020_get_defaults(struct Scsi_Host *);
627static int isp1020_verify_nvram(struct Scsi_Host *);
628static u_short isp1020_read_nvram_word(struct Scsi_Host *, u_short);
629#endif
630
631#if DEBUG_ISP1020
632static void isp1020_print_scsi_cmd(Scsi_Cmnd *);
633#endif
634#if DEBUG_ISP1020_INTR
635static void isp1020_print_status_entry(struct Status_Entry *);
636#endif
637
638/* memaddr should be used to determine if memmapped port i/o is being used
639 * non-null memaddr == mmap'd
640 * JV 7-Jan-2000
641 */
642static inline u_short isp_inw(struct Scsi_Host *host, long offset)
643{
644 struct isp1020_hostdata *h = (struct isp1020_hostdata *)host->hostdata;
645 if (h->memaddr)
646 return readw(h->memaddr + offset);
647 else
648 return inw(host->io_port + offset);
649}
650
651static inline void isp_outw(u_short val, struct Scsi_Host *host, long offset)
652{
653 struct isp1020_hostdata *h = (struct isp1020_hostdata *)host->hostdata;
654 if (h->memaddr)
655 writew(val, h->memaddr + offset);
656 else
657 outw(val, host->io_port + offset);
658}
659
660static inline void isp1020_enable_irqs(struct Scsi_Host *host)
661{
662 isp_outw(ISP_EN_INT|ISP_EN_RISC, host, PCI_INTF_CTL);
663}
664
665
666static inline void isp1020_disable_irqs(struct Scsi_Host *host)
667{
668 isp_outw(0x0, host, PCI_INTF_CTL);
669}
670
671
672static int isp1020_detect(Scsi_Host_Template *tmpt)
673{
674 int hosts = 0;
675 struct Scsi_Host *host;
676 struct isp1020_hostdata *hostdata;
677 struct pci_dev *pdev = NULL;
678
679 ENTER("isp1020_detect");
680
681 tmpt->proc_name = "isp1020";
682
683 while ((pdev = pci_find_device(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1020, pdev)))
684 {
685 if (pci_enable_device(pdev))
686 continue;
687
688 host = scsi_register(tmpt, sizeof(struct isp1020_hostdata));
689 if (!host)
690 continue;
691
692 hostdata = (struct isp1020_hostdata *) host->hostdata;
693
694 memset(hostdata, 0, sizeof(struct isp1020_hostdata));
695
696 hostdata->pci_dev = pdev;
697
698 if (isp1020_init(host))
699 goto fail_and_unregister;
700
701 if (isp1020_reset_hardware(host)
702#if USE_NVRAM_DEFAULTS
703 || isp1020_get_defaults(host)
704#else
705 || isp1020_set_defaults(host)
706#endif /* USE_NVRAM_DEFAULTS */
707 || isp1020_load_parameters(host)) {
708 goto fail_uninit;
709 }
710
711 host->this_id = hostdata->host_param.initiator_scsi_id;
712 host->max_sectors = 64;
713
714 if (request_irq(host->irq, do_isp1020_intr_handler, SA_INTERRUPT | SA_SHIRQ,
715 "qlogicisp", host))
716 {
717 printk("qlogicisp : interrupt %d already in use\n",
718 host->irq);
719 goto fail_uninit;
720 }
721
722 isp_outw(0x0, host, PCI_SEMAPHORE);
723 isp_outw(HCCR_CLEAR_RISC_INTR, host, HOST_HCCR);
724 isp1020_enable_irqs(host);
725
726 hosts++;
727 continue;
728
729 fail_uninit:
730 iounmap(hostdata->memaddr);
731 release_region(host->io_port, 0xff);
732 fail_and_unregister:
733 if (hostdata->res_cpu)
734 pci_free_consistent(hostdata->pci_dev,
735 QSIZE(RES_QUEUE_LEN),
736 hostdata->res_cpu,
737 hostdata->res_dma);
738 if (hostdata->req_cpu)
739 pci_free_consistent(hostdata->pci_dev,
740 QSIZE(QLOGICISP_REQ_QUEUE_LEN),
741 hostdata->req_cpu,
742 hostdata->req_dma);
743 scsi_unregister(host);
744 }
745
746 LEAVE("isp1020_detect");
747
748 return hosts;
749}
750
751
752static int isp1020_release(struct Scsi_Host *host)
753{
754 struct isp1020_hostdata *hostdata;
755
756 ENTER("isp1020_release");
757
758 hostdata = (struct isp1020_hostdata *) host->hostdata;
759
760 isp_outw(0x0, host, PCI_INTF_CTL);
761 free_irq(host->irq, host);
762
763 iounmap(hostdata->memaddr);
764
765 release_region(host->io_port, 0xff);
766
767 LEAVE("isp1020_release");
768
769 return 0;
770}
771
772
773static const char *isp1020_info(struct Scsi_Host *host)
774{
775 static char buf[80];
776 struct isp1020_hostdata *hostdata;
777
778 ENTER("isp1020_info");
779
780 hostdata = (struct isp1020_hostdata *) host->hostdata;
781 sprintf(buf,
782 "QLogic ISP1020 SCSI on PCI bus %02x device %02x irq %d %s base 0x%lx",
783 hostdata->pci_dev->bus->number, hostdata->pci_dev->devfn, host->irq,
784 (hostdata->memaddr ? "MEM" : "I/O"),
785 (hostdata->memaddr ? (unsigned long)hostdata->memaddr : host->io_port));
786
787 LEAVE("isp1020_info");
788
789 return buf;
790}
791
792
793/*
794 * The middle SCSI layer ensures that queuecommand never gets invoked
795 * concurrently with itself or the interrupt handler (though the
796 * interrupt handler may call this routine as part of
797 * request-completion handling).
798 */
799static int isp1020_queuecommand(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *))
800{
801 int i, n, num_free;
802 u_int in_ptr, out_ptr;
803 struct dataseg * ds;
804 struct scatterlist *sg;
805 struct Command_Entry *cmd;
806 struct Continuation_Entry *cont;
807 struct Scsi_Host *host;
808 struct isp1020_hostdata *hostdata;
809 dma_addr_t dma_addr;
810
811 ENTER("isp1020_queuecommand");
812
813 host = Cmnd->device->host;
814 hostdata = (struct isp1020_hostdata *) host->hostdata;
815 Cmnd->scsi_done = done;
816
817 DEBUG(isp1020_print_scsi_cmd(Cmnd));
818
819 out_ptr = isp_inw(host, + MBOX4);
820 in_ptr = hostdata->req_in_ptr;
821
822 DEBUG(printk("qlogicisp : request queue depth %d\n",
823 REQ_QUEUE_DEPTH(in_ptr, out_ptr)));
824
825 cmd = (struct Command_Entry *) &hostdata->req_cpu[in_ptr];
826 in_ptr = (in_ptr + 1) & QLOGICISP_REQ_QUEUE_LEN;
827 if (in_ptr == out_ptr) {
828 printk("qlogicisp : request queue overflow\n");
829 return 1;
830 }
831
832 if (hostdata->send_marker) {
833 struct Marker_Entry *marker;
834
835 TRACE("queue marker", in_ptr, 0);
836
837 DEBUG(printk("qlogicisp : adding marker entry\n"));
838 marker = (struct Marker_Entry *) cmd;
839 memset(marker, 0, sizeof(struct Marker_Entry));
840
841 marker->hdr.entry_type = ENTRY_MARKER;
842 marker->hdr.entry_cnt = 1;
843 marker->modifier = SYNC_ALL;
844
845 hostdata->send_marker = 0;
846
847 if (((in_ptr + 1) & QLOGICISP_REQ_QUEUE_LEN) == out_ptr) {
848 isp_outw(in_ptr, host, MBOX4);
849 hostdata->req_in_ptr = in_ptr;
850 printk("qlogicisp : request queue overflow\n");
851 return 1;
852 }
853 cmd = (struct Command_Entry *) &hostdata->req_cpu[in_ptr];
854 in_ptr = (in_ptr + 1) & QLOGICISP_REQ_QUEUE_LEN;
855 }
856
857 TRACE("queue command", in_ptr, Cmnd);
858
859 memset(cmd, 0, sizeof(struct Command_Entry));
860
861 cmd->hdr.entry_type = ENTRY_COMMAND;
862 cmd->hdr.entry_cnt = 1;
863
864 cmd->target_lun = Cmnd->device->lun;
865 cmd->target_id = Cmnd->device->id;
866 cmd->cdb_length = cpu_to_le16(Cmnd->cmd_len);
867 cmd->control_flags = cpu_to_le16(CFLAG_READ | CFLAG_WRITE);
868 cmd->time_out = cpu_to_le16(30);
869
870 memcpy(cmd->cdb, Cmnd->cmnd, Cmnd->cmd_len);
871
872 if (Cmnd->use_sg) {
873 int sg_count;
874
875 sg = (struct scatterlist *) Cmnd->request_buffer;
876 ds = cmd->dataseg;
877
878 sg_count = pci_map_sg(hostdata->pci_dev, sg, Cmnd->use_sg,
879 Cmnd->sc_data_direction);
880
881 cmd->segment_cnt = cpu_to_le16(sg_count);
882
883 /* fill in first four sg entries: */
884 n = sg_count;
885 if (n > IOCB_SEGS)
886 n = IOCB_SEGS;
887 for (i = 0; i < n; i++) {
888 dma_addr = sg_dma_address(sg);
889 ds[i].d_base = cpu_to_le32((u32) dma_addr);
890#ifdef CONFIG_QL_ISP_A64
891 ds[i].d_base_hi = cpu_to_le32((u32) (dma_addr>>32));
892#endif /* CONFIG_QL_ISP_A64 */
893 ds[i].d_count = cpu_to_le32(sg_dma_len(sg));
894 ++sg;
895 }
896 sg_count -= IOCB_SEGS;
897
898 while (sg_count > 0) {
899 ++cmd->hdr.entry_cnt;
900 cont = (struct Continuation_Entry *)
901 &hostdata->req_cpu[in_ptr];
902 in_ptr = (in_ptr + 1) & QLOGICISP_REQ_QUEUE_LEN;
903 if (in_ptr == out_ptr) {
904 printk("isp1020: unexpected request queue "
905 "overflow\n");
906 return 1;
907 }
908 TRACE("queue continuation", in_ptr, 0);
909 cont->hdr.entry_type = ENTRY_CONTINUATION;
910 cont->hdr.entry_cnt = 0;
911 cont->hdr.sys_def_1 = 0;
912 cont->hdr.flags = 0;
913#ifndef CONFIG_QL_ISP_A64
914 cont->reserved = 0;
915#endif
916 ds = cont->dataseg;
917 n = sg_count;
918 if (n > CONTINUATION_SEGS)
919 n = CONTINUATION_SEGS;
920 for (i = 0; i < n; ++i) {
921 dma_addr = sg_dma_address(sg);
922 ds[i].d_base = cpu_to_le32((u32) dma_addr);
923#ifdef CONFIG_QL_ISP_A64
924 ds[i].d_base_hi = cpu_to_le32((u32)(dma_addr>>32));
925#endif /* CONFIG_QL_ISP_A64 */
926 ds[i].d_count = cpu_to_le32(sg_dma_len(sg));
927 ++sg;
928 }
929 sg_count -= n;
930 }
931 } else if (Cmnd->request_bufflen) {
932 /*Cmnd->SCp.ptr = (char *)(unsigned long)*/
933 dma_addr = pci_map_single(hostdata->pci_dev,
934 Cmnd->request_buffer,
935 Cmnd->request_bufflen,
936 Cmnd->sc_data_direction);
937 Cmnd->SCp.ptr = (char *)(unsigned long) dma_addr;
938
939 cmd->dataseg[0].d_base =
940 cpu_to_le32((u32) dma_addr);
941#ifdef CONFIG_QL_ISP_A64
942 cmd->dataseg[0].d_base_hi =
943 cpu_to_le32((u32) (dma_addr>>32));
944#endif /* CONFIG_QL_ISP_A64 */
945 cmd->dataseg[0].d_count =
946 cpu_to_le32((u32)Cmnd->request_bufflen);
947 cmd->segment_cnt = cpu_to_le16(1);
948 } else {
949 cmd->dataseg[0].d_base = 0;
950#ifdef CONFIG_QL_ISP_A64
951 cmd->dataseg[0].d_base_hi = 0;
952#endif /* CONFIG_QL_ISP_A64 */
953 cmd->dataseg[0].d_count = 0;
954 cmd->segment_cnt = cpu_to_le16(1); /* Shouldn't this be 0? */
955 }
956
957 /* Committed, record Scsi_Cmd so we can find it later. */
958 cmd->handle = in_ptr;
959 hostdata->cmd_slots[in_ptr] = Cmnd;
960
961 isp_outw(in_ptr, host, MBOX4);
962 hostdata->req_in_ptr = in_ptr;
963
964 num_free = QLOGICISP_REQ_QUEUE_LEN - REQ_QUEUE_DEPTH(in_ptr, out_ptr);
965 host->can_queue = host->host_busy + num_free;
966 host->sg_tablesize = QLOGICISP_MAX_SG(num_free);
967
968 LEAVE("isp1020_queuecommand");
969
970 return 0;
971}
972
973
974#define ASYNC_EVENT_INTERRUPT 0x01
975
976irqreturn_t do_isp1020_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
977{
978 struct Scsi_Host *host = dev_id;
979 unsigned long flags;
980
981 spin_lock_irqsave(host->host_lock, flags);
982 isp1020_intr_handler(irq, dev_id, regs);
983 spin_unlock_irqrestore(host->host_lock, flags);
984
985 return IRQ_HANDLED;
986}
987
988void isp1020_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
989{
990 Scsi_Cmnd *Cmnd;
991 struct Status_Entry *sts;
992 struct Scsi_Host *host = dev_id;
993 struct isp1020_hostdata *hostdata;
994 u_int in_ptr, out_ptr;
995 u_short status;
996
997 ENTER_INTR("isp1020_intr_handler");
998
999 hostdata = (struct isp1020_hostdata *) host->hostdata;
1000
1001 DEBUG_INTR(printk("qlogicisp : interrupt on line %d\n", irq));
1002
1003 if (!(isp_inw(host, PCI_INTF_STS) & 0x04)) {
1004 /* spurious interrupts can happen legally */
1005 DEBUG_INTR(printk("qlogicisp: got spurious interrupt\n"));
1006 return;
1007 }
1008 in_ptr = isp_inw(host, MBOX5);
1009 isp_outw(HCCR_CLEAR_RISC_INTR, host, HOST_HCCR);
1010
1011 if ((isp_inw(host, PCI_SEMAPHORE) & ASYNC_EVENT_INTERRUPT)) {
1012 status = isp_inw(host, MBOX0);
1013
1014 DEBUG_INTR(printk("qlogicisp : mbox completion status: %x\n",
1015 status));
1016
1017 switch (status) {
1018 case ASYNC_SCSI_BUS_RESET:
1019 case EXECUTION_TIMEOUT_RESET:
1020 hostdata->send_marker = 1;
1021 break;
1022 case INVALID_COMMAND:
1023 case HOST_INTERFACE_ERROR:
1024 case COMMAND_ERROR:
1025 case COMMAND_PARAM_ERROR:
1026 printk("qlogicisp : bad mailbox return status\n");
1027 break;
1028 }
1029 isp_outw(0x0, host, PCI_SEMAPHORE);
1030 }
1031 out_ptr = hostdata->res_out_ptr;
1032
1033 DEBUG_INTR(printk("qlogicisp : response queue update\n"));
1034 DEBUG_INTR(printk("qlogicisp : response queue depth %d\n",
1035 QUEUE_DEPTH(in_ptr, out_ptr, RES_QUEUE_LEN)));
1036
1037 while (out_ptr != in_ptr) {
1038 u_int cmd_slot;
1039
1040 sts = (struct Status_Entry *) &hostdata->res_cpu[out_ptr];
1041 out_ptr = (out_ptr + 1) & RES_QUEUE_LEN;
1042
1043 cmd_slot = sts->handle;
1044 Cmnd = hostdata->cmd_slots[cmd_slot];
1045 hostdata->cmd_slots[cmd_slot] = NULL;
1046
1047 TRACE("done", out_ptr, Cmnd);
1048
1049 if (le16_to_cpu(sts->completion_status) == CS_RESET_OCCURRED
1050 || le16_to_cpu(sts->completion_status) == CS_ABORTED
1051 || (le16_to_cpu(sts->status_flags) & STF_BUS_RESET))
1052 hostdata->send_marker = 1;
1053
1054 if (le16_to_cpu(sts->state_flags) & SF_GOT_SENSE)
1055 memcpy(Cmnd->sense_buffer, sts->req_sense_data,
1056 sizeof(Cmnd->sense_buffer));
1057
1058 DEBUG_INTR(isp1020_print_status_entry(sts));
1059
1060 if (sts->hdr.entry_type == ENTRY_STATUS)
1061 Cmnd->result = isp1020_return_status(sts);
1062 else
1063 Cmnd->result = DID_ERROR << 16;
1064
1065 if (Cmnd->use_sg)
1066 pci_unmap_sg(hostdata->pci_dev,
1067 (struct scatterlist *)Cmnd->buffer,
1068 Cmnd->use_sg,
1069 Cmnd->sc_data_direction);
1070 else if (Cmnd->request_bufflen)
1071 pci_unmap_single(hostdata->pci_dev,
1072#ifdef CONFIG_QL_ISP_A64
1073 (dma_addr_t)((long)Cmnd->SCp.ptr),
1074#else
1075 (u32)((long)Cmnd->SCp.ptr),
1076#endif
1077 Cmnd->request_bufflen,
1078 Cmnd->sc_data_direction);
1079
1080 isp_outw(out_ptr, host, MBOX5);
1081 (*Cmnd->scsi_done)(Cmnd);
1082 }
1083 hostdata->res_out_ptr = out_ptr;
1084
1085 LEAVE_INTR("isp1020_intr_handler");
1086}
1087
1088
1089static int isp1020_return_status(struct Status_Entry *sts)
1090{
1091 int host_status = DID_ERROR;
1092#if DEBUG_ISP1020_INTR
1093 static char *reason[] = {
1094 "DID_OK",
1095 "DID_NO_CONNECT",
1096 "DID_BUS_BUSY",
1097 "DID_TIME_OUT",
1098 "DID_BAD_TARGET",
1099 "DID_ABORT",
1100 "DID_PARITY",
1101 "DID_ERROR",
1102 "DID_RESET",
1103 "DID_BAD_INTR"
1104 };
1105#endif /* DEBUG_ISP1020_INTR */
1106
1107 ENTER("isp1020_return_status");
1108
1109 DEBUG(printk("qlogicisp : completion status = 0x%04x\n",
1110 le16_to_cpu(sts->completion_status)));
1111
1112 switch(le16_to_cpu(sts->completion_status)) {
1113 case CS_COMPLETE:
1114 host_status = DID_OK;
1115 break;
1116 case CS_INCOMPLETE:
1117 if (!(le16_to_cpu(sts->state_flags) & SF_GOT_BUS))
1118 host_status = DID_NO_CONNECT;
1119 else if (!(le16_to_cpu(sts->state_flags) & SF_GOT_TARGET))
1120 host_status = DID_BAD_TARGET;
1121 else if (!(le16_to_cpu(sts->state_flags) & SF_SENT_CDB))
1122 host_status = DID_ERROR;
1123 else if (!(le16_to_cpu(sts->state_flags) & SF_TRANSFERRED_DATA))
1124 host_status = DID_ERROR;
1125 else if (!(le16_to_cpu(sts->state_flags) & SF_GOT_STATUS))
1126 host_status = DID_ERROR;
1127 else if (!(le16_to_cpu(sts->state_flags) & SF_GOT_SENSE))
1128 host_status = DID_ERROR;
1129 break;
1130 case CS_DMA_ERROR:
1131 case CS_TRANSPORT_ERROR:
1132 host_status = DID_ERROR;
1133 break;
1134 case CS_RESET_OCCURRED:
1135 host_status = DID_RESET;
1136 break;
1137 case CS_ABORTED:
1138 host_status = DID_ABORT;
1139 break;
1140 case CS_TIMEOUT:
1141 host_status = DID_TIME_OUT;
1142 break;
1143 case CS_DATA_OVERRUN:
1144 case CS_COMMAND_OVERRUN:
1145 case CS_STATUS_OVERRUN:
1146 case CS_BAD_MESSAGE:
1147 case CS_NO_MESSAGE_OUT:
1148 case CS_EXT_ID_FAILED:
1149 case CS_IDE_MSG_FAILED:
1150 case CS_ABORT_MSG_FAILED:
1151 case CS_NOP_MSG_FAILED:
1152 case CS_PARITY_ERROR_MSG_FAILED:
1153 case CS_DEVICE_RESET_MSG_FAILED:
1154 case CS_ID_MSG_FAILED:
1155 case CS_UNEXP_BUS_FREE:
1156 host_status = DID_ERROR;
1157 break;
1158 case CS_DATA_UNDERRUN:
1159 host_status = DID_OK;
1160 break;
1161 default:
1162 printk("qlogicisp : unknown completion status 0x%04x\n",
1163 le16_to_cpu(sts->completion_status));
1164 host_status = DID_ERROR;
1165 break;
1166 }
1167
1168 DEBUG_INTR(printk("qlogicisp : host status (%s) scsi status %x\n",
1169 reason[host_status], le16_to_cpu(sts->scsi_status)));
1170
1171 LEAVE("isp1020_return_status");
1172
1173 return (le16_to_cpu(sts->scsi_status) & STATUS_MASK) | (host_status << 16);
1174}
1175
1176
1177static int isp1020_biosparam(struct scsi_device *sdev, struct block_device *n,
1178 sector_t capacity, int ip[])
1179{
1180 int size = capacity;
1181
1182 ENTER("isp1020_biosparam");
1183
1184 ip[0] = 64;
1185 ip[1] = 32;
1186 ip[2] = size >> 11;
1187 if (ip[2] > 1024) {
1188 ip[0] = 255;
1189 ip[1] = 63;
1190 ip[2] = size / (ip[0] * ip[1]);
1191#if 0
1192 if (ip[2] > 1023)
1193 ip[2] = 1023;
1194#endif
1195 }
1196
1197 LEAVE("isp1020_biosparam");
1198
1199 return 0;
1200}
1201
1202
1203static int isp1020_reset_hardware(struct Scsi_Host *host)
1204{
1205 u_short param[6];
1206 int loop_count;
1207
1208 ENTER("isp1020_reset_hardware");
1209
1210 isp_outw(ISP_RESET, host, PCI_INTF_CTL);
1211 udelay(100);
1212 isp_outw(HCCR_RESET, host, HOST_HCCR);
1213 udelay(100);
1214 isp_outw(HCCR_RELEASE, host, HOST_HCCR);
1215 isp_outw(HCCR_BIOS_DISABLE, host, HOST_HCCR);
1216
1217 loop_count = DEFAULT_LOOP_COUNT;
1218 while (--loop_count && isp_inw(host, HOST_HCCR) == RISC_BUSY) {
1219 barrier();
1220 cpu_relax();
1221 }
1222 if (!loop_count)
1223 printk("qlogicisp: reset_hardware loop timeout\n");
1224
1225 isp_outw(0, host, ISP_CFG1);
1226
1227#if DEBUG_ISP1020
1228 printk("qlogicisp : mbox 0 0x%04x \n", isp_inw(host, MBOX0));
1229 printk("qlogicisp : mbox 1 0x%04x \n", isp_inw(host, MBOX1));
1230 printk("qlogicisp : mbox 2 0x%04x \n", isp_inw(host, MBOX2));
1231 printk("qlogicisp : mbox 3 0x%04x \n", isp_inw(host, MBOX3));
1232 printk("qlogicisp : mbox 4 0x%04x \n", isp_inw(host, MBOX4));
1233 printk("qlogicisp : mbox 5 0x%04x \n", isp_inw(host, MBOX5));
1234#endif /* DEBUG_ISP1020 */
1235
1236 param[0] = MBOX_NO_OP;
1237 isp1020_mbox_command(host, param);
1238 if (param[0] != MBOX_COMMAND_COMPLETE) {
1239 printk("qlogicisp : NOP test failed\n");
1240 return 1;
1241 }
1242
1243 DEBUG(printk("qlogicisp : loading risc ram\n"));
1244
1245#if RELOAD_FIRMWARE
1246 for (loop_count = 0; loop_count < risc_code_length01; loop_count++) {
1247 param[0] = MBOX_WRITE_RAM_WORD;
1248 param[1] = risc_code_addr01 + loop_count;
1249 param[2] = risc_code01[loop_count];
1250 isp1020_mbox_command(host, param);
1251 if (param[0] != MBOX_COMMAND_COMPLETE) {
1252 printk("qlogicisp : firmware load failure at %d\n",
1253 loop_count);
1254 return 1;
1255 }
1256 }
1257#endif /* RELOAD_FIRMWARE */
1258
1259 DEBUG(printk("qlogicisp : verifying checksum\n"));
1260
1261 param[0] = MBOX_VERIFY_CHECKSUM;
1262 param[1] = risc_code_addr01;
1263
1264 isp1020_mbox_command(host, param);
1265
1266 if (param[0] != MBOX_COMMAND_COMPLETE) {
1267 printk("qlogicisp : ram checksum failure\n");
1268 return 1;
1269 }
1270
1271 DEBUG(printk("qlogicisp : executing firmware\n"));
1272
1273 param[0] = MBOX_EXEC_FIRMWARE;
1274 param[1] = risc_code_addr01;
1275
1276 isp1020_mbox_command(host, param);
1277
1278 param[0] = MBOX_ABOUT_FIRMWARE;
1279
1280 isp1020_mbox_command(host, param);
1281
1282 if (param[0] != MBOX_COMMAND_COMPLETE) {
1283 printk("qlogicisp : about firmware failure\n");
1284 return 1;
1285 }
1286
1287 DEBUG(printk("qlogicisp : firmware major revision %d\n", param[1]));
1288 DEBUG(printk("qlogicisp : firmware minor revision %d\n", param[2]));
1289
1290 LEAVE("isp1020_reset_hardware");
1291
1292 return 0;
1293}
1294
1295
1296static int isp1020_init(struct Scsi_Host *sh)
1297{
1298 u_long io_base, mem_base, io_flags, mem_flags;
1299 struct isp1020_hostdata *hostdata;
1300 u_char revision;
1301 u_int irq;
1302 u_short command;
1303 struct pci_dev *pdev;
1304
1305 ENTER("isp1020_init");
1306
1307 hostdata = (struct isp1020_hostdata *) sh->hostdata;
1308 pdev = hostdata->pci_dev;
1309
1310 if (pci_read_config_word(pdev, PCI_COMMAND, &command)
1311 || pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision))
1312 {
1313 printk("qlogicisp : error reading PCI configuration\n");
1314 return 1;
1315 }
1316
1317 io_base = pci_resource_start(pdev, 0);
1318 mem_base = pci_resource_start(pdev, 1);
1319 io_flags = pci_resource_flags(pdev, 0);
1320 mem_flags = pci_resource_flags(pdev, 1);
1321 irq = pdev->irq;
1322
1323 if (pdev->vendor != PCI_VENDOR_ID_QLOGIC) {
1324 printk("qlogicisp : 0x%04x is not QLogic vendor ID\n",
1325 pdev->vendor);
1326 return 1;
1327 }
1328
1329 if (pdev->device != PCI_DEVICE_ID_QLOGIC_ISP1020) {
1330 printk("qlogicisp : 0x%04x does not match ISP1020 device id\n",
1331 pdev->device);
1332 return 1;
1333 }
1334
1335#ifdef __alpha__
1336 /* Force ALPHA to use bus I/O and not bus MEM.
1337 This is to avoid having to use HAE_MEM registers,
1338 which is broken on some platforms and with SMP. */
1339 command &= ~PCI_COMMAND_MEMORY;
1340#endif
1341
1342 sh->io_port = io_base;
1343
1344 if (!request_region(sh->io_port, 0xff, "qlogicisp")) {
1345 printk("qlogicisp : i/o region 0x%lx-0x%lx already "
1346 "in use\n",
1347 sh->io_port, sh->io_port + 0xff);
1348 return 1;
1349 }
1350
1351 if ((command & PCI_COMMAND_MEMORY) &&
1352 ((mem_flags & 1) == 0)) {
1353 hostdata->memaddr = ioremap(mem_base, PAGE_SIZE);
1354 if (!hostdata->memaddr) {
1355 printk("qlogicisp : i/o remapping failed.\n");
1356 goto out_release;
1357 }
1358 } else {
1359 if (command & PCI_COMMAND_IO && (io_flags & 3) != 1) {
1360 printk("qlogicisp : i/o mapping is disabled\n");
1361 goto out_release;
1362 }
1363 hostdata->memaddr = NULL; /* zero to signify no i/o mapping */
1364 mem_base = 0;
1365 }
1366
1367 if (revision != ISP1020_REV_ID)
1368 printk("qlogicisp : new isp1020 revision ID (%d)\n", revision);
1369
1370 if (isp_inw(sh, PCI_ID_LOW) != PCI_VENDOR_ID_QLOGIC
1371 || isp_inw(sh, PCI_ID_HIGH) != PCI_DEVICE_ID_QLOGIC_ISP1020)
1372 {
1373 printk("qlogicisp : can't decode %s address space 0x%lx\n",
1374 (io_base ? "I/O" : "MEM"),
1375 (io_base ? io_base : mem_base));
1376 goto out_unmap;
1377 }
1378
1379 hostdata->revision = revision;
1380
1381 sh->irq = irq;
1382 sh->max_id = MAX_TARGETS;
1383 sh->max_lun = MAX_LUNS;
1384
1385 hostdata->res_cpu = pci_alloc_consistent(hostdata->pci_dev,
1386 QSIZE(RES_QUEUE_LEN),
1387 &hostdata->res_dma);
1388 if (hostdata->res_cpu == NULL) {
1389 printk("qlogicisp : can't allocate response queue\n");
1390 goto out_unmap;
1391 }
1392
1393 hostdata->req_cpu = pci_alloc_consistent(hostdata->pci_dev,
1394 QSIZE(QLOGICISP_REQ_QUEUE_LEN),
1395 &hostdata->req_dma);
1396 if (hostdata->req_cpu == NULL) {
1397 pci_free_consistent(hostdata->pci_dev,
1398 QSIZE(RES_QUEUE_LEN),
1399 hostdata->res_cpu,
1400 hostdata->res_dma);
1401 printk("qlogicisp : can't allocate request queue\n");
1402 goto out_unmap;
1403 }
1404
1405 pci_set_master(pdev);
1406
1407 LEAVE("isp1020_init");
1408
1409 return 0;
1410
1411out_unmap:
1412 iounmap(hostdata->memaddr);
1413out_release:
1414 release_region(sh->io_port, 0xff);
1415 return 1;
1416}
1417
1418
1419#if USE_NVRAM_DEFAULTS
1420
1421static int isp1020_get_defaults(struct Scsi_Host *host)
1422{
1423 int i;
1424 u_short value;
1425 struct isp1020_hostdata *hostdata =
1426 (struct isp1020_hostdata *) host->hostdata;
1427
1428 ENTER("isp1020_get_defaults");
1429
1430 if (!isp1020_verify_nvram(host)) {
1431 printk("qlogicisp : nvram checksum failure\n");
1432 printk("qlogicisp : attempting to use default parameters\n");
1433 return isp1020_set_defaults(host);
1434 }
1435
1436 value = isp1020_read_nvram_word(host, 2);
1437 hostdata->host_param.fifo_threshold = (value >> 8) & 0x03;
1438 hostdata->host_param.host_adapter_enable = (value >> 11) & 0x01;
1439 hostdata->host_param.initiator_scsi_id = (value >> 12) & 0x0f;
1440
1441 value = isp1020_read_nvram_word(host, 3);
1442 hostdata->host_param.bus_reset_delay = value & 0xff;
1443 hostdata->host_param.retry_count = value >> 8;
1444
1445 value = isp1020_read_nvram_word(host, 4);
1446 hostdata->host_param.retry_delay = value & 0xff;
1447 hostdata->host_param.async_data_setup_time = (value >> 8) & 0x0f;
1448 hostdata->host_param.req_ack_active_negation = (value >> 12) & 0x01;
1449 hostdata->host_param.data_line_active_negation = (value >> 13) & 0x01;
1450 hostdata->host_param.data_dma_burst_enable = (value >> 14) & 0x01;
1451 hostdata->host_param.command_dma_burst_enable = (value >> 15);
1452
1453 value = isp1020_read_nvram_word(host, 5);
1454 hostdata->host_param.tag_aging = value & 0xff;
1455
1456 value = isp1020_read_nvram_word(host, 6);
1457 hostdata->host_param.selection_timeout = value & 0xffff;
1458
1459 value = isp1020_read_nvram_word(host, 7);
1460 hostdata->host_param.max_queue_depth = value & 0xffff;
1461
1462#if DEBUG_ISP1020_SETUP
1463 printk("qlogicisp : fifo threshold=%d\n",
1464 hostdata->host_param.fifo_threshold);
1465 printk("qlogicisp : initiator scsi id=%d\n",
1466 hostdata->host_param.initiator_scsi_id);
1467 printk("qlogicisp : bus reset delay=%d\n",
1468 hostdata->host_param.bus_reset_delay);
1469 printk("qlogicisp : retry count=%d\n",
1470 hostdata->host_param.retry_count);
1471 printk("qlogicisp : retry delay=%d\n",
1472 hostdata->host_param.retry_delay);
1473 printk("qlogicisp : async data setup time=%d\n",
1474 hostdata->host_param.async_data_setup_time);
1475 printk("qlogicisp : req/ack active negation=%d\n",
1476 hostdata->host_param.req_ack_active_negation);
1477 printk("qlogicisp : data line active negation=%d\n",
1478 hostdata->host_param.data_line_active_negation);
1479 printk("qlogicisp : data DMA burst enable=%d\n",
1480 hostdata->host_param.data_dma_burst_enable);
1481 printk("qlogicisp : command DMA burst enable=%d\n",
1482 hostdata->host_param.command_dma_burst_enable);
1483 printk("qlogicisp : tag age limit=%d\n",
1484 hostdata->host_param.tag_aging);
1485 printk("qlogicisp : selection timeout limit=%d\n",
1486 hostdata->host_param.selection_timeout);
1487 printk("qlogicisp : max queue depth=%d\n",
1488 hostdata->host_param.max_queue_depth);
1489#endif /* DEBUG_ISP1020_SETUP */
1490
1491 for (i = 0; i < MAX_TARGETS; i++) {
1492
1493 value = isp1020_read_nvram_word(host, 14 + i * 3);
1494 hostdata->dev_param[i].device_flags = value & 0xff;
1495 hostdata->dev_param[i].execution_throttle = value >> 8;
1496
1497 value = isp1020_read_nvram_word(host, 15 + i * 3);
1498 hostdata->dev_param[i].synchronous_period = value & 0xff;
1499 hostdata->dev_param[i].synchronous_offset = (value >> 8) & 0x0f;
1500 hostdata->dev_param[i].device_enable = (value >> 12) & 0x01;
1501
1502#if DEBUG_ISP1020_SETUP
1503 printk("qlogicisp : target 0x%02x\n", i);
1504 printk("qlogicisp : device flags=0x%02x\n",
1505 hostdata->dev_param[i].device_flags);
1506 printk("qlogicisp : execution throttle=%d\n",
1507 hostdata->dev_param[i].execution_throttle);
1508 printk("qlogicisp : synchronous period=%d\n",
1509 hostdata->dev_param[i].synchronous_period);
1510 printk("qlogicisp : synchronous offset=%d\n",
1511 hostdata->dev_param[i].synchronous_offset);
1512 printk("qlogicisp : device enable=%d\n",
1513 hostdata->dev_param[i].device_enable);
1514#endif /* DEBUG_ISP1020_SETUP */
1515 }
1516
1517 LEAVE("isp1020_get_defaults");
1518
1519 return 0;
1520}
1521
1522
1523#define ISP1020_NVRAM_LEN 0x40
1524#define ISP1020_NVRAM_SIG1 0x5349
1525#define ISP1020_NVRAM_SIG2 0x2050
1526
1527static int isp1020_verify_nvram(struct Scsi_Host *host)
1528{
1529 int i;
1530 u_short value;
1531 u_char checksum = 0;
1532
1533 for (i = 0; i < ISP1020_NVRAM_LEN; i++) {
1534 value = isp1020_read_nvram_word(host, i);
1535
1536 switch (i) {
1537 case 0:
1538 if (value != ISP1020_NVRAM_SIG1) return 0;
1539 break;
1540 case 1:
1541 if (value != ISP1020_NVRAM_SIG2) return 0;
1542 break;
1543 case 2:
1544 if ((value & 0xff) != 0x02) return 0;
1545 break;
1546 }
1547 checksum += value & 0xff;
1548 checksum += value >> 8;
1549 }
1550
1551 return (checksum == 0);
1552}
1553
1554#define NVRAM_DELAY() udelay(2) /* 2 microsecond delay */
1555
1556
1557u_short isp1020_read_nvram_word(struct Scsi_Host *host, u_short byte)
1558{
1559 int i;
1560 u_short value, output, input;
1561
1562 byte &= 0x3f; byte |= 0x0180;
1563
1564 for (i = 8; i >= 0; i--) {
1565 output = ((byte >> i) & 0x1) ? 0x4 : 0x0;
1566 isp_outw(output | 0x2, host, PCI_NVRAM); NVRAM_DELAY();
1567 isp_outw(output | 0x3, host, PCI_NVRAM); NVRAM_DELAY();
1568 isp_outw(output | 0x2, host, PCI_NVRAM); NVRAM_DELAY();
1569 }
1570
1571 for (i = 0xf, value = 0; i >= 0; i--) {
1572 value <<= 1;
1573 isp_outw(0x3, host, PCI_NVRAM); NVRAM_DELAY();
1574 input = isp_inw(host, PCI_NVRAM); NVRAM_DELAY();
1575 isp_outw(0x2, host, PCI_NVRAM); NVRAM_DELAY();
1576 if (input & 0x8) value |= 1;
1577 }
1578
1579 isp_outw(0x0, host, PCI_NVRAM); NVRAM_DELAY();
1580
1581 return value;
1582}
1583
1584#endif /* USE_NVRAM_DEFAULTS */
1585
1586
1587static int isp1020_set_defaults(struct Scsi_Host *host)
1588{
1589 struct isp1020_hostdata *hostdata =
1590 (struct isp1020_hostdata *) host->hostdata;
1591 int i;
1592
1593 ENTER("isp1020_set_defaults");
1594
1595 hostdata->host_param.fifo_threshold = 2;
1596 hostdata->host_param.host_adapter_enable = 1;
1597 hostdata->host_param.initiator_scsi_id = 7;
1598 hostdata->host_param.bus_reset_delay = 3;
1599 hostdata->host_param.retry_count = 0;
1600 hostdata->host_param.retry_delay = 1;
1601 hostdata->host_param.async_data_setup_time = 6;
1602 hostdata->host_param.req_ack_active_negation = 1;
1603 hostdata->host_param.data_line_active_negation = 1;
1604 hostdata->host_param.data_dma_burst_enable = 1;
1605 hostdata->host_param.command_dma_burst_enable = 1;
1606 hostdata->host_param.tag_aging = 8;
1607 hostdata->host_param.selection_timeout = 250;
1608 hostdata->host_param.max_queue_depth = 256;
1609
1610 for (i = 0; i < MAX_TARGETS; i++) {
1611 hostdata->dev_param[i].device_flags = 0xfd;
1612 hostdata->dev_param[i].execution_throttle = 16;
1613 hostdata->dev_param[i].synchronous_period = 25;
1614 hostdata->dev_param[i].synchronous_offset = 12;
1615 hostdata->dev_param[i].device_enable = 1;
1616 }
1617
1618 LEAVE("isp1020_set_defaults");
1619
1620 return 0;
1621}
1622
1623
1624static int isp1020_load_parameters(struct Scsi_Host *host)
1625{
1626 int i, k;
1627#ifdef CONFIG_QL_ISP_A64
1628 u_long queue_addr;
1629 u_short param[8];
1630#else
1631 u_int queue_addr;
1632 u_short param[6];
1633#endif
1634 u_short isp_cfg1, hwrev;
1635 struct isp1020_hostdata *hostdata =
1636 (struct isp1020_hostdata *) host->hostdata;
1637
1638 ENTER("isp1020_load_parameters");
1639
1640 hwrev = isp_inw(host, ISP_CFG0) & ISP_CFG0_HWMSK;
1641 isp_cfg1 = ISP_CFG1_F64 | ISP_CFG1_BENAB;
1642 if (hwrev == ISP_CFG0_1040A) {
1643 /* Busted fifo, says mjacob. */
1644 isp_cfg1 &= ISP_CFG1_BENAB;
1645 }
1646
1647 isp_outw(isp_inw(host, ISP_CFG1) | isp_cfg1, host, ISP_CFG1);
1648 isp_outw(isp_inw(host, CDMA_CONF) | DMA_CONF_BENAB, host, CDMA_CONF);
1649 isp_outw(isp_inw(host, DDMA_CONF) | DMA_CONF_BENAB, host, DDMA_CONF);
1650
1651 param[0] = MBOX_SET_INIT_SCSI_ID;
1652 param[1] = hostdata->host_param.initiator_scsi_id;
1653
1654 isp1020_mbox_command(host, param);
1655
1656 if (param[0] != MBOX_COMMAND_COMPLETE) {
1657 printk("qlogicisp : set initiator id failure\n");
1658 return 1;
1659 }
1660
1661 param[0] = MBOX_SET_RETRY_COUNT;
1662 param[1] = hostdata->host_param.retry_count;
1663 param[2] = hostdata->host_param.retry_delay;
1664
1665 isp1020_mbox_command(host, param);
1666
1667 if (param[0] != MBOX_COMMAND_COMPLETE) {
1668 printk("qlogicisp : set retry count failure\n");
1669 return 1;
1670 }
1671
1672 param[0] = MBOX_SET_ASYNC_DATA_SETUP_TIME;
1673 param[1] = hostdata->host_param.async_data_setup_time;
1674
1675 isp1020_mbox_command(host, param);
1676
1677 if (param[0] != MBOX_COMMAND_COMPLETE) {
1678 printk("qlogicisp : async data setup time failure\n");
1679 return 1;
1680 }
1681
1682 param[0] = MBOX_SET_ACTIVE_NEG_STATE;
1683 param[1] = (hostdata->host_param.req_ack_active_negation << 4)
1684 | (hostdata->host_param.data_line_active_negation << 5);
1685
1686 isp1020_mbox_command(host, param);
1687
1688 if (param[0] != MBOX_COMMAND_COMPLETE) {
1689 printk("qlogicisp : set active negation state failure\n");
1690 return 1;
1691 }
1692
1693 param[0] = MBOX_SET_PCI_CONTROL_PARAMS;
1694 param[1] = hostdata->host_param.data_dma_burst_enable << 1;
1695 param[2] = hostdata->host_param.command_dma_burst_enable << 1;
1696
1697 isp1020_mbox_command(host, param);
1698
1699 if (param[0] != MBOX_COMMAND_COMPLETE) {
1700 printk("qlogicisp : set pci control parameter failure\n");
1701 return 1;
1702 }
1703
1704 param[0] = MBOX_SET_TAG_AGE_LIMIT;
1705 param[1] = hostdata->host_param.tag_aging;
1706
1707 isp1020_mbox_command(host, param);
1708
1709 if (param[0] != MBOX_COMMAND_COMPLETE) {
1710 printk("qlogicisp : set tag age limit failure\n");
1711 return 1;
1712 }
1713
1714 param[0] = MBOX_SET_SELECT_TIMEOUT;
1715 param[1] = hostdata->host_param.selection_timeout;
1716
1717 isp1020_mbox_command(host, param);
1718
1719 if (param[0] != MBOX_COMMAND_COMPLETE) {
1720 printk("qlogicisp : set selection timeout failure\n");
1721 return 1;
1722 }
1723
1724 for (i = 0; i < MAX_TARGETS; i++) {
1725
1726 if (!hostdata->dev_param[i].device_enable)
1727 continue;
1728
1729 param[0] = MBOX_SET_TARGET_PARAMS;
1730 param[1] = i << 8;
1731 param[2] = hostdata->dev_param[i].device_flags << 8;
1732 param[3] = (hostdata->dev_param[i].synchronous_offset << 8)
1733 | hostdata->dev_param[i].synchronous_period;
1734
1735 isp1020_mbox_command(host, param);
1736
1737 if (param[0] != MBOX_COMMAND_COMPLETE) {
1738 printk("qlogicisp : set target parameter failure\n");
1739 return 1;
1740 }
1741
1742 for (k = 0; k < MAX_LUNS; k++) {
1743
1744 param[0] = MBOX_SET_DEV_QUEUE_PARAMS;
1745 param[1] = (i << 8) | k;
1746 param[2] = hostdata->host_param.max_queue_depth;
1747 param[3] = hostdata->dev_param[i].execution_throttle;
1748
1749 isp1020_mbox_command(host, param);
1750
1751 if (param[0] != MBOX_COMMAND_COMPLETE) {
1752 printk("qlogicisp : set device queue "
1753 "parameter failure\n");
1754 return 1;
1755 }
1756 }
1757 }
1758
1759 queue_addr = hostdata->res_dma;
1760#ifdef CONFIG_QL_ISP_A64
1761 param[0] = MBOX_CMD_INIT_RESPONSE_QUEUE_64;
1762#else
1763 param[0] = MBOX_INIT_RES_QUEUE;
1764#endif
1765 param[1] = RES_QUEUE_LEN + 1;
1766 param[2] = (u_short) (queue_addr >> 16);
1767 param[3] = (u_short) (queue_addr & 0xffff);
1768 param[4] = 0;
1769 param[5] = 0;
1770#ifdef CONFIG_QL_ISP_A64
1771 param[6] = (u_short) (queue_addr >> 48);
1772 param[7] = (u_short) (queue_addr >> 32);
1773#endif
1774
1775 isp1020_mbox_command(host, param);
1776
1777 if (param[0] != MBOX_COMMAND_COMPLETE) {
1778 printk("qlogicisp : set response queue failure\n");
1779 return 1;
1780 }
1781
1782 queue_addr = hostdata->req_dma;
1783#ifdef CONFIG_QL_ISP_A64
1784 param[0] = MBOX_CMD_INIT_REQUEST_QUEUE_64;
1785#else
1786 param[0] = MBOX_INIT_REQ_QUEUE;
1787#endif
1788 param[1] = QLOGICISP_REQ_QUEUE_LEN + 1;
1789 param[2] = (u_short) (queue_addr >> 16);
1790 param[3] = (u_short) (queue_addr & 0xffff);
1791 param[4] = 0;
1792
1793#ifdef CONFIG_QL_ISP_A64
1794 param[5] = 0;
1795 param[6] = (u_short) (queue_addr >> 48);
1796 param[7] = (u_short) (queue_addr >> 32);
1797#endif
1798
1799 isp1020_mbox_command(host, param);
1800
1801 if (param[0] != MBOX_COMMAND_COMPLETE) {
1802 printk("qlogicisp : set request queue failure\n");
1803 return 1;
1804 }
1805
1806 LEAVE("isp1020_load_parameters");
1807
1808 return 0;
1809}
1810
1811
1812/*
1813 * currently, this is only called during initialization or abort/reset,
1814 * at which times interrupts are disabled, so polling is OK, I guess...
1815 */
1816static int isp1020_mbox_command(struct Scsi_Host *host, u_short param[])
1817{
1818 int loop_count;
1819
1820 if (mbox_param[param[0]] == 0)
1821 return 1;
1822
1823 loop_count = DEFAULT_LOOP_COUNT;
1824 while (--loop_count && isp_inw(host, HOST_HCCR) & 0x0080) {
1825 barrier();
1826 cpu_relax();
1827 }
1828 if (!loop_count)
1829 printk("qlogicisp: mbox_command loop timeout #1\n");
1830
1831 switch(mbox_param[param[0]] >> 4) {
1832 case 8: isp_outw(param[7], host, MBOX7);
1833 case 7: isp_outw(param[6], host, MBOX6);
1834 case 6: isp_outw(param[5], host, MBOX5);
1835 case 5: isp_outw(param[4], host, MBOX4);
1836 case 4: isp_outw(param[3], host, MBOX3);
1837 case 3: isp_outw(param[2], host, MBOX2);
1838 case 2: isp_outw(param[1], host, MBOX1);
1839 case 1: isp_outw(param[0], host, MBOX0);
1840 }
1841
1842 isp_outw(0x0, host, PCI_SEMAPHORE);
1843 isp_outw(HCCR_CLEAR_RISC_INTR, host, HOST_HCCR);
1844 isp_outw(HCCR_SET_HOST_INTR, host, HOST_HCCR);
1845
1846 loop_count = DEFAULT_LOOP_COUNT;
1847 while (--loop_count && !(isp_inw(host, PCI_INTF_STS) & 0x04)) {
1848 barrier();
1849 cpu_relax();
1850 }
1851 if (!loop_count)
1852 printk("qlogicisp: mbox_command loop timeout #2\n");
1853
1854 loop_count = DEFAULT_LOOP_COUNT;
1855 while (--loop_count && isp_inw(host, MBOX0) == 0x04) {
1856 barrier();
1857 cpu_relax();
1858 }
1859 if (!loop_count)
1860 printk("qlogicisp: mbox_command loop timeout #3\n");
1861
1862 switch(mbox_param[param[0]] & 0xf) {
1863 case 8: param[7] = isp_inw(host, MBOX7);
1864 case 7: param[6] = isp_inw(host, MBOX6);
1865 case 6: param[5] = isp_inw(host, MBOX5);
1866 case 5: param[4] = isp_inw(host, MBOX4);
1867 case 4: param[3] = isp_inw(host, MBOX3);
1868 case 3: param[2] = isp_inw(host, MBOX2);
1869 case 2: param[1] = isp_inw(host, MBOX1);
1870 case 1: param[0] = isp_inw(host, MBOX0);
1871 }
1872
1873 isp_outw(0x0, host, PCI_SEMAPHORE);
1874 isp_outw(HCCR_CLEAR_RISC_INTR, host, HOST_HCCR);
1875
1876 return 0;
1877}
1878
1879
1880#if DEBUG_ISP1020_INTR
1881
1882void isp1020_print_status_entry(struct Status_Entry *status)
1883{
1884 int i;
1885
1886 printk("qlogicisp : entry count = 0x%02x, type = 0x%02x, flags = 0x%02x\n",
1887 status->hdr.entry_cnt, status->hdr.entry_type, status->hdr.flags);
1888 printk("qlogicisp : scsi status = 0x%04x, completion status = 0x%04x\n",
1889 le16_to_cpu(status->scsi_status), le16_to_cpu(status->completion_status));
1890 printk("qlogicisp : state flags = 0x%04x, status flags = 0x%04x\n",
1891 le16_to_cpu(status->state_flags), le16_to_cpu(status->status_flags));
1892 printk("qlogicisp : time = 0x%04x, request sense length = 0x%04x\n",
1893 le16_to_cpu(status->time), le16_to_cpu(status->req_sense_len));
1894 printk("qlogicisp : residual transfer length = 0x%08x\n",
1895 le32_to_cpu(status->residual));
1896
1897 for (i = 0; i < le16_to_cpu(status->req_sense_len); i++)
1898 printk("qlogicisp : sense data = 0x%02x\n", status->req_sense_data[i]);
1899}
1900
1901#endif /* DEBUG_ISP1020_INTR */
1902
1903
1904#if DEBUG_ISP1020
1905
1906void isp1020_print_scsi_cmd(Scsi_Cmnd *cmd)
1907{
1908 int i;
1909
1910 printk("qlogicisp : target = 0x%02x, lun = 0x%02x, cmd_len = 0x%02x\n",
1911 cmd->target, cmd->lun, cmd->cmd_len);
1912 printk("qlogicisp : command = ");
1913 for (i = 0; i < cmd->cmd_len; i++)
1914 printk("0x%02x ", cmd->cmnd[i]);
1915 printk("\n");
1916}
1917
1918#endif /* DEBUG_ISP1020 */
1919
1920MODULE_LICENSE("GPL");
1921
1922static Scsi_Host_Template driver_template = {
1923 .detect = isp1020_detect,
1924 .release = isp1020_release,
1925 .info = isp1020_info,
1926 .queuecommand = isp1020_queuecommand,
1927 .bios_param = isp1020_biosparam,
1928 .can_queue = QLOGICISP_REQ_QUEUE_LEN,
1929 .this_id = -1,
1930 .sg_tablesize = QLOGICISP_MAX_SG(QLOGICISP_REQ_QUEUE_LEN),
1931 .cmd_per_lun = 1,
1932 .use_clustering = DISABLE_CLUSTERING,
1933};
1934#include "scsi_module.c"
diff --git a/drivers/scsi/qlogicisp_asm.c b/drivers/scsi/qlogicisp_asm.c
deleted file mode 100644
index 9ea4beca4ac5..000000000000
--- a/drivers/scsi/qlogicisp_asm.c
+++ /dev/null
@@ -1,2034 +0,0 @@
1/*
2 * Firmware Version 7.63.00 (12:07 Jan 27, 1999)
3 */
4static const unsigned short risc_code_version = 7*1024+63;
5
6static const unsigned short risc_code_addr01 = 0x1000 ;
7
8#if RELOAD_FIRMWARE
9
10static const unsigned short risc_code01[] = {
11 0x0078, 0x103a, 0x0000, 0x3f14, 0x0000, 0x2043, 0x4f50, 0x5952,
12 0x4947, 0x4854, 0x2031, 0x3939, 0x3520, 0x514c, 0x4f47, 0x4943,
13 0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
14 0x3130, 0x3230, 0x2049, 0x2f54, 0x2046, 0x6972, 0x6d77, 0x6172,
15 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030, 0x372e, 0x3633,
16 0x2020, 0x2043, 0x7573, 0x746f, 0x6d65, 0x7220, 0x4e6f, 0x2e20,
17 0x3030, 0x2050, 0x726f, 0x6475, 0x6374, 0x204e, 0x6f2e, 0x2020,
18 0x3031, 0x2024, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x0048,
19 0x1045, 0x0038, 0x104b, 0x0078, 0x1047, 0x0028, 0x104b, 0x20b9,
20 0x1212, 0x0078, 0x104d, 0x20b9, 0x2222, 0x20c1, 0x0008, 0x2071,
21 0x0010, 0x70c3, 0x0004, 0x20c9, 0x76ff, 0x2089, 0x1186, 0x70c7,
22 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3, 0x0007, 0x3f00,
23 0x70d6, 0x20c1, 0x0008, 0x2019, 0x0000, 0x2009, 0xfeff, 0x2100,
24 0x200b, 0xa5a5, 0xa1ec, 0x7fff, 0x2d64, 0x206b, 0x0a0a, 0xaddc,
25 0x3fff, 0x2b54, 0x205b, 0x5050, 0x2114, 0xa286, 0xa5a5, 0x0040,
26 0x10bf, 0xa386, 0x000f, 0x0040, 0x1085, 0x2c6a, 0x2a5a, 0x20c1,
27 0x0000, 0x2019, 0x000f, 0x0078, 0x1065, 0x2c6a, 0x2a5a, 0x20c1,
28 0x0008, 0x2009, 0x7fff, 0x2148, 0x2944, 0x204b, 0x0a0a, 0xa9bc,
29 0x3fff, 0x2734, 0x203b, 0x5050, 0x2114, 0xa286, 0x0a0a, 0x0040,
30 0x10a9, 0x284a, 0x263a, 0x20c1, 0x0004, 0x2009, 0x3fff, 0x2134,
31 0x200b, 0x5050, 0x2114, 0xa286, 0x5050, 0x0040, 0x10aa, 0x0078,
32 0x118e, 0x284a, 0x263a, 0x98c0, 0xa188, 0x1000, 0x212c, 0x200b,
33 0xa5a5, 0x2114, 0xa286, 0xa5a5, 0x0040, 0x10bc, 0x250a, 0xa18a,
34 0x1000, 0x98c1, 0x0078, 0x10c1, 0x250a, 0x0078, 0x10c1, 0x2c6a,
35 0x2a5a, 0x2130, 0xa18a, 0x0040, 0x2128, 0xa1a2, 0x5000, 0x8424,
36 0x8424, 0x8424, 0x8424, 0x8424, 0x8424, 0xa192, 0x7700, 0x2009,
37 0x0000, 0x2001, 0x0031, 0x1078, 0x1c9d, 0x2218, 0x2079, 0x5000,
38 0x2fa0, 0x2408, 0x2011, 0x0000, 0x20a9, 0x0040, 0x42a4, 0x8109,
39 0x00c0, 0x10dc, 0x7ef2, 0x8528, 0x7de6, 0x7cea, 0x7bee, 0x7883,
40 0x0000, 0x2031, 0x0030, 0x78cf, 0x0101, 0x780b, 0x0002, 0x780f,
41 0x0002, 0x784f, 0x0003, 0x2069, 0x5040, 0x2001, 0x04fd, 0x2004,
42 0xa082, 0x0005, 0x0048, 0x1104, 0x0038, 0x1100, 0x0078, 0x1108,
43 0x681b, 0x003c, 0x0078, 0x110a, 0x00a8, 0x1108, 0x681b, 0x003c,
44 0x681b, 0x0028, 0x6807, 0x0007, 0x680b, 0x00fa, 0x680f, 0x0008,
45 0x6813, 0x0005, 0x6823, 0x0000, 0x6827, 0x0006, 0x6817, 0x0008,
46 0x682b, 0x0000, 0x681f, 0x0019, 0x2069, 0x5280, 0x2011, 0x0020,
47 0x2009, 0x0010, 0x680b, 0x080c, 0x680f, 0x0019, 0x6803, 0xfd00,
48 0x6807, 0x0018, 0x6a1a, 0x2d00, 0xa0e8, 0x0008, 0xa290, 0x0004,
49 0x8109, 0x00c0, 0x1122, 0x2069, 0x5300, 0x2009, 0x0002, 0x20a9,
50 0x0100, 0x6837, 0x0000, 0x680b, 0x0040, 0x7bf0, 0xa386, 0xfeff,
51 0x00c0, 0x1148, 0x6817, 0x0100, 0x681f, 0x0064, 0x0078, 0x114c,
52 0x6817, 0x0064, 0x681f, 0x0002, 0xade8, 0x0010, 0x0070, 0x1152,
53 0x0078, 0x1139, 0x8109, 0x00c0, 0x1137, 0x1078, 0x21e9, 0x1078,
54 0x46e9, 0x1078, 0x1946, 0x1078, 0x4bdf, 0x3200, 0xa085, 0x000d,
55 0x2090, 0x70c3, 0x0000, 0x0090, 0x116c, 0x70c0, 0xa086, 0x0002,
56 0x00c0, 0x116c, 0x1078, 0x1284, 0x1078, 0x1196, 0x78cc, 0xa005,
57 0x00c0, 0x117a, 0x1078, 0x1cc6, 0x0010, 0x1180, 0x0068, 0x1180,
58 0x1078, 0x20c8, 0x0010, 0x1180, 0x0068, 0x1180, 0x1078, 0x1a2b,
59 0x00e0, 0x116c, 0x1078, 0x4a66, 0x0078, 0x116c, 0x118e, 0x1190,
60 0x23ea, 0x23ea, 0x476a, 0x476a, 0x23ea, 0x23ea, 0x0078, 0x118e,
61 0x0078, 0x1190, 0x0078, 0x1192, 0x0078, 0x1194, 0x0068, 0x1201,
62 0x2061, 0x0000, 0x6018, 0xa084, 0x0001, 0x00c0, 0x1201, 0x7814,
63 0xa005, 0x00c0, 0x11a7, 0x0010, 0x1202, 0x0078, 0x1201, 0x2009,
64 0x505b, 0x2104, 0xa005, 0x00c0, 0x1201, 0x2009, 0x5064, 0x200b,
65 0x0000, 0x7914, 0xa186, 0x0042, 0x00c0, 0x11cc, 0x7816, 0x2009,
66 0x5062, 0x2164, 0x200b, 0x0000, 0x6018, 0x70c6, 0x6014, 0x70ca,
67 0x611c, 0xa18c, 0xff00, 0x6020, 0xa084, 0x00ff, 0xa105, 0x70ce,
68 0x1078, 0x192b, 0x0078, 0x11ff, 0x7814, 0xa086, 0x0018, 0x00c0,
69 0x11d3, 0x1078, 0x165a, 0x7817, 0x0000, 0x2009, 0x5062, 0x2104,
70 0xa065, 0x0040, 0x11ef, 0x0c7e, 0x609c, 0x2060, 0x1078, 0x1996,
71 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1730, 0x2009, 0x000c, 0x6007,
72 0x0103, 0x1078, 0x1907, 0x00c0, 0x11fb, 0x1078, 0x192b, 0x2009,
73 0x5062, 0x200b, 0x0000, 0x2009, 0x505c, 0x2104, 0x200b, 0x0000,
74 0xa005, 0x0040, 0x11ff, 0x2001, 0x4005, 0x0078, 0x1286, 0x0078,
75 0x1284, 0x007c, 0x70c3, 0x0000, 0x70c7, 0x0000, 0x70cb, 0x0000,
76 0x70cf, 0x0000, 0x70c0, 0xa0bc, 0xffc0, 0x00c0, 0x1252, 0x2038,
77 0x0079, 0x1212, 0x1284, 0x12e5, 0x12a9, 0x12fe, 0x130d, 0x1313,
78 0x12a0, 0x1748, 0x1317, 0x1298, 0x12ad, 0x12af, 0x12b1, 0x12b3,
79 0x174d, 0x1298, 0x1329, 0x1360, 0x1672, 0x1742, 0x12b5, 0x1591,
80 0x15ad, 0x15c9, 0x15f4, 0x154a, 0x1558, 0x156c, 0x1580, 0x13df,
81 0x1298, 0x138d, 0x1393, 0x1398, 0x139d, 0x13a3, 0x13a8, 0x13ad,
82 0x13b2, 0x13b7, 0x13bb, 0x13d0, 0x13dc, 0x1298, 0x1298, 0x1298,
83 0x1298, 0x13eb, 0x13f4, 0x1403, 0x1429, 0x1433, 0x143a, 0x1480,
84 0x148f, 0x149e, 0x14b0, 0x152a, 0x153a, 0x1298, 0x1298, 0x1298,
85 0x1298, 0x153f, 0xa0bc, 0xffa0, 0x00c0, 0x1298, 0x2038, 0xa084,
86 0x001f, 0x0079, 0x125b, 0x1786, 0x1789, 0x1799, 0x1298, 0x1298,
87 0x18d8, 0x18f5, 0x1298, 0x1298, 0x1298, 0x18f9, 0x1901, 0x1298,
88 0x1298, 0x1298, 0x1298, 0x12db, 0x12f4, 0x131f, 0x1356, 0x1668,
89 0x1764, 0x1778, 0x1298, 0x1829, 0x1298, 0x18b4, 0x18be, 0x18c2,
90 0x18d0, 0x1298, 0x1298, 0x72ca, 0x71c6, 0x2001, 0x4006, 0x0078,
91 0x1286, 0x73ce, 0x72ca, 0x71c6, 0x2001, 0x4000, 0x70c2, 0x0068,
92 0x1287, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, 0x5000, 0x00e0,
93 0x128f, 0x00e0, 0x1291, 0x0068, 0x1291, 0x2091, 0x4080, 0x007c,
94 0x70c3, 0x4001, 0x0078, 0x1287, 0x70c3, 0x4006, 0x0078, 0x1287,
95 0x2099, 0x0041, 0x20a1, 0x0041, 0x20a9, 0x0005, 0x53a3, 0x0078,
96 0x1284, 0x70c4, 0x70c3, 0x0004, 0x007a, 0x0078, 0x1284, 0x0078,
97 0x1284, 0x0078, 0x1284, 0x0078, 0x1284, 0x2091, 0x8000, 0x70c3,
98 0x0000, 0x70c7, 0x4953, 0x70cb, 0x5020, 0x70cf, 0x2020, 0x70d3,
99 0x0007, 0x3f00, 0x70d6, 0x2079, 0x0000, 0x781b, 0x0001, 0x2031,
100 0x0030, 0x2059, 0x1000, 0x2029, 0x0457, 0x2051, 0x0470, 0x2061,
101 0x0472, 0x20b9, 0xffff, 0x20c1, 0x0000, 0x2091, 0x5000, 0x2091,
102 0x4080, 0x0078, 0x0455, 0x1078, 0x1b36, 0x00c0, 0x129c, 0x75d8,
103 0x74dc, 0x75da, 0x74de, 0x0078, 0x12e8, 0x2029, 0x0000, 0x2520,
104 0x71d0, 0x73c8, 0x72cc, 0x70c4, 0x1078, 0x1a70, 0x0040, 0x1284,
105 0x70c3, 0x4002, 0x0078, 0x1284, 0x1078, 0x1b36, 0x00c0, 0x129c,
106 0x75d8, 0x74dc, 0x75da, 0x74de, 0x0078, 0x1301, 0x2029, 0x0000,
107 0x2520, 0x71d0, 0x73c8, 0x72cc, 0x70c4, 0x1078, 0x1ad0, 0x0040,
108 0x1284, 0x70c3, 0x4002, 0x0078, 0x1284, 0x71c4, 0x70c8, 0x2114,
109 0x200a, 0x0078, 0x1282, 0x71c4, 0x2114, 0x0078, 0x1282, 0x70c7,
110 0x0007, 0x70cb, 0x003f, 0x70cf, 0x0000, 0x0078, 0x1284, 0x1078,
111 0x1b36, 0x00c0, 0x129c, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078,
112 0x132c, 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d0,
113 0x70c6, 0x72ca, 0x73ce, 0x74d2, 0xa005, 0x0040, 0x1350, 0x8001,
114 0x7892, 0xa084, 0xfc00, 0x0040, 0x1345, 0x78cc, 0xa085, 0x0001,
115 0x78ce, 0x2001, 0x4005, 0x0078, 0x1286, 0x7a9a, 0x7b9e, 0x7da2,
116 0x7ea6, 0x7c96, 0x78cc, 0xa084, 0xfffc, 0x78ce, 0x0078, 0x1354,
117 0x78cc, 0xa085, 0x0001, 0x78ce, 0x0078, 0x1284, 0x1078, 0x1b36,
118 0x00c0, 0x129c, 0x75d8, 0x76dc, 0x75da, 0x76de, 0x0078, 0x1363,
119 0x2029, 0x0000, 0x2530, 0x70c4, 0x72c8, 0x73cc, 0x74d4, 0x70c6,
120 0x72ca, 0x73ce, 0x74d6, 0xa005, 0x0040, 0x1387, 0x8001, 0x78ae,
121 0xa084, 0xfc00, 0x0040, 0x137c, 0x78cc, 0xa085, 0x0100, 0x78ce,
122 0x2001, 0x4005, 0x0078, 0x1286, 0x7ab6, 0x7bba, 0x7dbe, 0x7ec2,
123 0x7cb2, 0x78cc, 0xa084, 0xfcff, 0x78ce, 0x0078, 0x138b, 0x78cc,
124 0xa085, 0x0100, 0x78ce, 0x0078, 0x1284, 0x2009, 0x5061, 0x210c,
125 0x7aec, 0x0078, 0x1282, 0x2009, 0x5041, 0x210c, 0x0078, 0x1283,
126 0x2009, 0x5042, 0x210c, 0x0078, 0x1283, 0x2061, 0x5040, 0x610c,
127 0x6210, 0x0078, 0x1282, 0x2009, 0x5045, 0x210c, 0x0078, 0x1283,
128 0x2009, 0x5046, 0x210c, 0x0078, 0x1283, 0x2009, 0x5048, 0x210c,
129 0x0078, 0x1283, 0x2009, 0x5049, 0x210c, 0x0078, 0x1283, 0x7908,
130 0x7a0c, 0x0078, 0x1282, 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003,
131 0x8003, 0x8003, 0xa0e8, 0x5280, 0x6a00, 0x6804, 0xa084, 0x0008,
132 0x0040, 0x13cd, 0x6b08, 0x0078, 0x13ce, 0x6b0c, 0x0078, 0x1281,
133 0x77c4, 0x1078, 0x1956, 0x2091, 0x8000, 0x6b1c, 0x6a14, 0x2091,
134 0x8001, 0x2708, 0x0078, 0x1281, 0x794c, 0x0078, 0x1283, 0x77c4,
135 0x1078, 0x1956, 0x2091, 0x8000, 0x6908, 0x6a18, 0x6b10, 0x2091,
136 0x8001, 0x0078, 0x1281, 0x71c4, 0xa182, 0x0010, 0x00c8, 0x127c,
137 0x1078, 0x22c1, 0x0078, 0x1281, 0x71c4, 0xa182, 0x0010, 0x00c8,
138 0x127c, 0x2011, 0x5041, 0x2204, 0x007e, 0x2112, 0x1078, 0x227a,
139 0x017f, 0x0078, 0x1283, 0x71c4, 0x2011, 0x1421, 0x20a9, 0x0008,
140 0x2204, 0xa106, 0x0040, 0x1413, 0x8210, 0x0070, 0x1411, 0x0078,
141 0x1408, 0x0078, 0x127c, 0xa292, 0x1421, 0x027e, 0x2011, 0x5042,
142 0x2204, 0x2112, 0x017f, 0x007e, 0x1078, 0x2286, 0x017f, 0x0078,
143 0x1283, 0x03e8, 0x00fa, 0x01f4, 0x02ee, 0x0064, 0x0019, 0x0032,
144 0x004b, 0x2061, 0x5040, 0x610c, 0x6210, 0x70c4, 0x600e, 0x70c8,
145 0x6012, 0x0078, 0x1282, 0x2061, 0x5040, 0x6114, 0x70c4, 0x6016,
146 0x0078, 0x1283, 0x2061, 0x5040, 0x71c4, 0x2011, 0x0004, 0x601f,
147 0x0019, 0x2019, 0x1212, 0xa186, 0x0028, 0x0040, 0x145b, 0x2011,
148 0x0005, 0x601f, 0x0019, 0x2019, 0x1212, 0xa186, 0x0032, 0x0040,
149 0x145b, 0x2011, 0x0006, 0x601f, 0x000c, 0x2019, 0x2222, 0xa186,
150 0x003c, 0x00c0, 0x127c, 0x6018, 0x007e, 0x611a, 0x7800, 0xa084,
151 0x0001, 0x00c0, 0x1476, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005,
152 0x0048, 0x146e, 0x0038, 0x1472, 0x0078, 0x1476, 0x0028, 0x1472,
153 0x0078, 0x1476, 0x2019, 0x2222, 0x0078, 0x1478, 0x2019, 0x1212,
154 0x23b8, 0x1078, 0x2297, 0x1078, 0x4bdf, 0x017f, 0x0078, 0x1283,
155 0x71c4, 0xa184, 0xffcf, 0x00c0, 0x127c, 0x2011, 0x5048, 0x2204,
156 0x2112, 0x007e, 0x1078, 0x22b9, 0x017f, 0x0078, 0x1283, 0x71c4,
157 0xa182, 0x0010, 0x00c8, 0x127c, 0x2011, 0x5049, 0x2204, 0x007e,
158 0x2112, 0x1078, 0x22a8, 0x017f, 0x0078, 0x1283, 0x71c4, 0x72c8,
159 0xa184, 0xfffd, 0x00c0, 0x127b, 0xa284, 0xfffd, 0x00c0, 0x127b,
160 0x2100, 0x7908, 0x780a, 0x2200, 0x7a0c, 0x780e, 0x0078, 0x1282,
161 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e8,
162 0x5280, 0x2019, 0x0000, 0x72c8, 0xa284, 0x0080, 0x0040, 0x14c6,
163 0x6c14, 0x84ff, 0x00c0, 0x14c6, 0x6817, 0x0040, 0xa284, 0x0040,
164 0x0040, 0x14d0, 0x6c10, 0x84ff, 0x00c0, 0x14d0, 0x6813, 0x0001,
165 0x6800, 0x007e, 0xa226, 0x0040, 0x14f3, 0x6a02, 0xa484, 0x2000,
166 0x0040, 0x14dc, 0xa39d, 0x0010, 0xa484, 0x1000, 0x0040, 0x14e2,
167 0xa39d, 0x0008, 0xa484, 0x4000, 0x0040, 0x14f3, 0x810f, 0xa284,
168 0x4000, 0x0040, 0x14ef, 0x1078, 0x22db, 0x0078, 0x14f3, 0x1078,
169 0x22cd, 0x0078, 0x14f3, 0x72cc, 0x6808, 0xa206, 0x0040, 0x1522,
170 0xa2a4, 0x00ff, 0x2061, 0x5040, 0x6118, 0xa186, 0x0028, 0x0040,
171 0x1509, 0xa186, 0x0032, 0x0040, 0x150f, 0xa186, 0x003c, 0x0040,
172 0x1515, 0xa482, 0x0064, 0x0048, 0x151f, 0x0078, 0x1519, 0xa482,
173 0x0050, 0x0048, 0x151f, 0x0078, 0x1519, 0xa482, 0x0043, 0x0048,
174 0x151f, 0x71c4, 0x71c6, 0x027f, 0x72ca, 0x0078, 0x127d, 0x6a0a,
175 0xa39d, 0x000a, 0x6804, 0xa305, 0x6806, 0x027f, 0x6b0c, 0x71c4,
176 0x0078, 0x1281, 0x77c4, 0x1078, 0x1956, 0x2091, 0x8000, 0x6a14,
177 0x6b1c, 0x2091, 0x8001, 0x70c8, 0x6816, 0x70cc, 0x681e, 0x2708,
178 0x0078, 0x1281, 0x70c4, 0x794c, 0x784e, 0x0078, 0x1283, 0x71c4,
179 0x72c8, 0x73cc, 0xa182, 0x0010, 0x00c8, 0x127c, 0x1078, 0x22e9,
180 0x0078, 0x1281, 0x77c4, 0x1078, 0x1956, 0x2091, 0x8000, 0x6a08,
181 0xa295, 0x0002, 0x6a0a, 0x2091, 0x8001, 0x2708, 0x0078, 0x1282,
182 0x77c4, 0x1078, 0x1956, 0x2091, 0x8000, 0x6a08, 0xa294, 0xfff9,
183 0x6a0a, 0x6804, 0xa005, 0x0040, 0x1567, 0x1078, 0x21b1, 0x2091,
184 0x8001, 0x2708, 0x0078, 0x1282, 0x77c4, 0x1078, 0x1956, 0x2091,
185 0x8000, 0x6a08, 0xa295, 0x0004, 0x6a0a, 0x6804, 0xa005, 0x0040,
186 0x157b, 0x1078, 0x21b1, 0x2091, 0x8001, 0x2708, 0x0078, 0x1282,
187 0x77c4, 0x2041, 0x0001, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091,
188 0x8000, 0x1078, 0x1963, 0x2091, 0x8001, 0x2708, 0x6a08, 0x0078,
189 0x1282, 0x77c4, 0x72c8, 0x73cc, 0x77c6, 0x72ca, 0x73ce, 0x1078,
190 0x19c4, 0x00c0, 0x15a9, 0x6818, 0xa005, 0x0040, 0x15a9, 0x2708,
191 0x1078, 0x22f9, 0x00c0, 0x15a9, 0x7817, 0x0015, 0x2091, 0x8001,
192 0x007c, 0x2091, 0x8001, 0x0078, 0x1284, 0x77c4, 0x77c6, 0x2041,
193 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 0x1078,
194 0x1963, 0x2061, 0x5040, 0x606f, 0x0003, 0x6782, 0x6093, 0x000f,
195 0x6073, 0x0000, 0x7817, 0x0016, 0x1078, 0x21b1, 0x2091, 0x8001,
196 0x007c, 0x77c8, 0x77ca, 0x77c4, 0x77c6, 0xa7bc, 0xff00, 0x2091,
197 0x8000, 0x2061, 0x5040, 0x606f, 0x0002, 0x6073, 0x0000, 0x6782,
198 0x6093, 0x000f, 0x7817, 0x0017, 0x1078, 0x21b1, 0x2091, 0x8001,
199 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0010, 0x2091, 0x8000,
200 0x1078, 0x1963, 0x70c8, 0x6836, 0x8738, 0xa784, 0x001f, 0x00c0,
201 0x15e8, 0x2091, 0x8001, 0x007c, 0x78cc, 0xa084, 0x0003, 0x00c0,
202 0x1618, 0x2039, 0x0000, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051,
203 0x0008, 0x1078, 0x1956, 0x2091, 0x8000, 0x6808, 0xa80d, 0x690a,
204 0x2091, 0x8001, 0x8738, 0xa784, 0x001f, 0x00c0, 0x1601, 0xa7bc,
205 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0, 0x1601,
206 0x2091, 0x8000, 0x2069, 0x0100, 0x6830, 0xa084, 0x0040, 0x0040,
207 0x1641, 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0004,
208 0x0040, 0x162e, 0x0070, 0x162e, 0x0078, 0x1625, 0x684b, 0x0009,
209 0x20a9, 0x0014, 0x6848, 0xa084, 0x0001, 0x0040, 0x163b, 0x0070,
210 0x163b, 0x0078, 0x1632, 0x20a9, 0x00fa, 0x0070, 0x1641, 0x0078,
211 0x163d, 0x2079, 0x5000, 0x7817, 0x0018, 0x2061, 0x5040, 0x606f,
212 0x0001, 0x6073, 0x0000, 0x6093, 0x000f, 0x78cc, 0xa085, 0x0002,
213 0x78ce, 0x6808, 0xa084, 0xfffd, 0x680a, 0x681b, 0x0048, 0x2091,
214 0x8001, 0x007c, 0x78cc, 0xa084, 0xfffd, 0x78ce, 0xa084, 0x0001,
215 0x00c0, 0x1664, 0x1078, 0x1a0e, 0x71c4, 0x71c6, 0x794a, 0x007c,
216 0x1078, 0x1b36, 0x00c0, 0x129c, 0x75d8, 0x74dc, 0x75da, 0x74de,
217 0x0078, 0x1675, 0x2029, 0x0000, 0x2520, 0x71c4, 0x73c8, 0x72cc,
218 0x71c6, 0x73ca, 0x72ce, 0x2079, 0x5000, 0x2091, 0x8000, 0x1078,
219 0x1911, 0x2091, 0x8001, 0x0040, 0x172c, 0x20a9, 0x0005, 0x20a1,
220 0x5018, 0x2091, 0x8000, 0x41a1, 0x2091, 0x8001, 0x2009, 0x0020,
221 0x1078, 0x190c, 0x0040, 0x1698, 0x1078, 0x192b, 0x0078, 0x172c,
222 0x6004, 0xa084, 0xff00, 0x8007, 0x8009, 0x0040, 0x16fb, 0x0c7e,
223 0x2c68, 0x2091, 0x8000, 0x1078, 0x1911, 0x2091, 0x8001, 0x0040,
224 0x16cc, 0x2c00, 0x689e, 0x8109, 0x00c0, 0x16a0, 0x609f, 0x0000,
225 0x0c7f, 0x0c7e, 0x7218, 0x731c, 0x7420, 0x7524, 0x2c68, 0x689c,
226 0xa065, 0x0040, 0x16fa, 0x2009, 0x0020, 0x1078, 0x190c, 0x00c0,
227 0x16e3, 0x6004, 0xa084, 0x00ff, 0xa086, 0x0002, 0x00c0, 0x16cc,
228 0x2d00, 0x6002, 0x0078, 0x16b2, 0x0c7f, 0x0c7e, 0x609c, 0x2060,
229 0x1078, 0x1996, 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1730, 0x2009,
230 0x000c, 0x6008, 0xa085, 0x0200, 0x600a, 0x1078, 0x1907, 0x1078,
231 0x192b, 0x0078, 0x172c, 0x0c7f, 0x0c7e, 0x609c, 0x2060, 0x1078,
232 0x1996, 0x0c7f, 0x609f, 0x0000, 0x1078, 0x1730, 0x2009, 0x000c,
233 0x6007, 0x0103, 0x601b, 0x0003, 0x1078, 0x1907, 0x1078, 0x192b,
234 0x0078, 0x172c, 0x0c7f, 0x74c4, 0x73c8, 0x72cc, 0x6014, 0x2091,
235 0x8000, 0x7817, 0x0012, 0x0e7e, 0x2071, 0x5040, 0x706f, 0x0005,
236 0x7073, 0x0000, 0x7376, 0x727a, 0x747e, 0x7082, 0x7087, 0x0000,
237 0x2c00, 0x708a, 0x708f, 0x0000, 0xa02e, 0x2530, 0x611c, 0x61a2,
238 0xa184, 0x0060, 0x0040, 0x171e, 0x1078, 0x467f, 0x0e7f, 0x6596,
239 0x65a6, 0x669a, 0x66aa, 0x60af, 0x0000, 0x60b3, 0x0000, 0x1078,
240 0x21b1, 0x2091, 0x8001, 0x007c, 0x70c3, 0x4005, 0x0078, 0x1287,
241 0x20a9, 0x0005, 0x2099, 0x5018, 0x2091, 0x8000, 0x530a, 0x2091,
242 0x8001, 0x2100, 0xa210, 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9,
243 0x0000, 0x007c, 0x71c4, 0x70c7, 0x0000, 0x7906, 0x0078, 0x1284,
244 0x71c4, 0x71c6, 0x2168, 0x0078, 0x174f, 0x2069, 0x1000, 0x690c,
245 0xa016, 0x2d04, 0xa210, 0x8d68, 0x8109, 0x00c0, 0x1751, 0xa285,
246 0x0000, 0x00c0, 0x175f, 0x70c3, 0x4000, 0x0078, 0x1761, 0x70c3,
247 0x4003, 0x70ca, 0x0078, 0x1287, 0x2011, 0x5067, 0x220c, 0x70c4,
248 0x8003, 0x0048, 0x1771, 0x1078, 0x3b49, 0xa184, 0x7fff, 0x0078,
249 0x1775, 0x1078, 0x3b3c, 0xa185, 0x8000, 0x2012, 0x0078, 0x1283,
250 0x71c4, 0x1078, 0x3b33, 0x6100, 0x2001, 0x5067, 0x2004, 0xa084,
251 0x8000, 0xa10d, 0x6204, 0x6308, 0x0078, 0x1281, 0x79e4, 0x0078,
252 0x1283, 0x71c4, 0x71c6, 0x2198, 0x20a1, 0x0042, 0x20a9, 0x0004,
253 0x53a3, 0x21a0, 0x2099, 0x0042, 0x20a9, 0x0004, 0x53a3, 0x0078,
254 0x1284, 0x70c4, 0x2068, 0x2079, 0x5000, 0x2091, 0x8000, 0x1078,
255 0x1911, 0x2091, 0x8001, 0x0040, 0x1825, 0x6007, 0x0001, 0x600b,
256 0x0000, 0x602b, 0x0000, 0x601b, 0x0006, 0x6a10, 0xa28c, 0x000f,
257 0xa284, 0x00f0, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0x6016,
258 0xa284, 0x0800, 0x0040, 0x17c0, 0x601b, 0x000a, 0x0078, 0x17c6,
259 0xa284, 0x1000, 0x0040, 0x17c6, 0x601b, 0x000c, 0xa284, 0x0300,
260 0x0040, 0x17cf, 0x602b, 0x0001, 0x8004, 0x8004, 0x8004, 0xa085,
261 0x0001, 0x601e, 0x6023, 0x0000, 0x6027, 0x0000, 0xa284, 0x0400,
262 0x0040, 0x17dc, 0x602b, 0x0000, 0x20a9, 0x0006, 0xac80, 0x000b,
263 0x20a0, 0xad80, 0x0005, 0x2098, 0x53a3, 0xa284, 0x0300, 0x00c0,
264 0x17f1, 0x6046, 0x604a, 0x604e, 0x6052, 0x6096, 0x609a, 0x0078,
265 0x17fb, 0x6800, 0x6046, 0x6804, 0x604a, 0x6e08, 0x664e, 0x6d0c,
266 0x6552, 0x6596, 0x669a, 0x6014, 0x2091, 0x8000, 0x7817, 0x0042,
267 0x2c08, 0x2061, 0x5040, 0x606f, 0x0005, 0x6073, 0x0000, 0x6077,
268 0x0000, 0x607b, 0x0000, 0x607f, 0x0000, 0x6082, 0x618a, 0xa284,
269 0x0400, 0x608e, 0x2091, 0x8001, 0x0e7e, 0x2071, 0x0020, 0x7007,
270 0x000a, 0x7007, 0x0002, 0x7003, 0x0000, 0x0e7f, 0x2091, 0x8000,
271 0x1078, 0x21b1, 0x2091, 0x8001, 0x007c, 0x70c3, 0x4005, 0x0078,
272 0x1287, 0x0c7e, 0x0d7e, 0x0e7e, 0x0f7e, 0x2091, 0x8000, 0x2071,
273 0x5040, 0x2079, 0x0100, 0x2061, 0x0010, 0x70a0, 0xa06d, 0x0040,
274 0x18aa, 0x6a04, 0xa294, 0x00ff, 0xa286, 0x0007, 0x0040, 0x1844,
275 0xa286, 0x000f, 0x00c0, 0x18aa, 0x691c, 0xa184, 0x0080, 0x00c0,
276 0x18aa, 0x6824, 0xa18c, 0xff00, 0xa085, 0x0019, 0x6826, 0x71b0,
277 0x81ff, 0x0040, 0x1865, 0x0d7e, 0x2069, 0x0020, 0x6908, 0x6808,
278 0xa106, 0x00c0, 0x1856, 0x690c, 0x680c, 0xa106, 0x00c0, 0x185b,
279 0xa184, 0x00ff, 0x00c0, 0x185b, 0x0d7f, 0x78b8, 0xa084, 0x801f,
280 0x00c0, 0x1865, 0x7848, 0xa085, 0x000c, 0x784a, 0x71b0, 0x81ff,
281 0x0040, 0x1888, 0x70b3, 0x0000, 0x0d7e, 0x2069, 0x0020, 0x6807,
282 0x0008, 0x6804, 0xa084, 0x0008, 0x00c0, 0x1879, 0x6807, 0x0008,
283 0x6804, 0xa084, 0x0008, 0x00c0, 0x1880, 0x6807, 0x0002, 0x0d7f,
284 0x61c4, 0x62c8, 0x63cc, 0x61c6, 0x62ca, 0x63ce, 0x0e7e, 0x2071,
285 0x5000, 0x7266, 0x736a, 0xae80, 0x0019, 0x0e7f, 0x1078, 0x4598,
286 0x78a3, 0x0000, 0x7858, 0xa084, 0xedff, 0x785a, 0x70b4, 0xa080,
287 0x00da, 0x781a, 0x0f7f, 0x0e7f, 0x0d7f, 0x0c7f, 0x2091, 0x8001,
288 0x0078, 0x1284, 0x0f7f, 0x0e7f, 0x0d7f, 0x0c7f, 0x2091, 0x8001,
289 0x2001, 0x4005, 0x0078, 0x1286, 0x7980, 0x71c6, 0x71c4, 0xa182,
290 0x0003, 0x00c8, 0x127c, 0x7982, 0x0078, 0x1284, 0x7980, 0x71c6,
291 0x0078, 0x1284, 0x7974, 0x71c6, 0x71c4, 0x7976, 0x7978, 0x71ca,
292 0x71c8, 0x797a, 0x797c, 0x71ce, 0x71cc, 0x797e, 0x0078, 0x1284,
293 0x7974, 0x71c6, 0x7978, 0x71ca, 0x797c, 0x71ce, 0x0078, 0x1284,
294 0x7900, 0x71c6, 0x71c4, 0x7902, 0x2001, 0x04fd, 0x2004, 0xa082,
295 0x0005, 0x0048, 0x18e7, 0x0038, 0x18e9, 0x0078, 0x18f3, 0x00a8,
296 0x18f3, 0xa18c, 0x0001, 0x00c0, 0x18f1, 0x20b9, 0x2222, 0x0078,
297 0x18f3, 0x20b9, 0x1212, 0x0078, 0x1284, 0x7900, 0x71c6, 0x0078,
298 0x1284, 0x2009, 0x5074, 0x2104, 0x70c6, 0x70c4, 0x200a, 0x0078,
299 0x1284, 0x2009, 0x5074, 0x2104, 0x70c6, 0x0078, 0x1284, 0xac80,
300 0x0001, 0x1078, 0x1af2, 0x007c, 0xac80, 0x0001, 0x1078, 0x1a92,
301 0x007c, 0x7850, 0xa065, 0x0040, 0x1919, 0x2c04, 0x7852, 0x2063,
302 0x0000, 0x007c, 0x0f7e, 0x2079, 0x5000, 0x7850, 0xa06d, 0x0040,
303 0x1929, 0x2d04, 0x7852, 0x6803, 0x0000, 0x6807, 0x0000, 0x680b,
304 0x0000, 0x0f7f, 0x007c, 0x2091, 0x8000, 0x0f7e, 0x2079, 0x5000,
305 0x7850, 0x2062, 0x2c00, 0xa005, 0x00c0, 0x1938, 0x1078, 0x23ca,
306 0x7852, 0x0f7f, 0x2091, 0x8001, 0x007c, 0x0f7e, 0x2079, 0x5000,
307 0x7850, 0x206a, 0x2d00, 0x7852, 0x0f7f, 0x007c, 0x2011, 0x7700,
308 0x7a52, 0x7bec, 0x8319, 0x0040, 0x1953, 0xa280, 0x0031, 0x2012,
309 0x2010, 0x0078, 0x194a, 0x2013, 0x0000, 0x007c, 0xa784, 0x0f00,
310 0x800b, 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105,
311 0xa0e8, 0x5300, 0x007c, 0x1078, 0x1956, 0x2900, 0x682a, 0x2a00,
312 0x682e, 0x6808, 0xa084, 0xffef, 0xa80d, 0x690a, 0x2009, 0x5052,
313 0x210c, 0x6804, 0xa005, 0x0040, 0x1995, 0xa116, 0x00c0, 0x1980,
314 0x2060, 0x6000, 0x6806, 0x017e, 0x200b, 0x0000, 0x0078, 0x1983,
315 0x2009, 0x0000, 0x017e, 0x6804, 0xa065, 0x0040, 0x1992, 0x6000,
316 0x6806, 0x1078, 0x19a3, 0x1078, 0x1c42, 0x6810, 0x8001, 0x6812,
317 0x00c0, 0x1983, 0x017f, 0x6902, 0x6906, 0x007c, 0xa065, 0x0040,
318 0x19a2, 0x609c, 0x609f, 0x0000, 0x2008, 0x1078, 0x192b, 0x2100,
319 0x0078, 0x1996, 0x007c, 0x6007, 0x0103, 0x608f, 0x0000, 0x20a9,
320 0x001c, 0xac80, 0x0005, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x6828,
321 0x601a, 0x682c, 0x6022, 0x007c, 0x0e7e, 0x2071, 0x5040, 0x704c,
322 0xa08c, 0x0200, 0x00c0, 0x19c2, 0xa088, 0x5080, 0x2d0a, 0x8000,
323 0x704e, 0xa006, 0x0e7f, 0x007c, 0x1078, 0x1956, 0x2091, 0x8000,
324 0x6804, 0x781e, 0xa065, 0x0040, 0x1a0d, 0x0078, 0x19d5, 0x2c00,
325 0x781e, 0x6000, 0xa065, 0x0040, 0x1a0d, 0x600c, 0xa306, 0x00c0,
326 0x19cf, 0x6010, 0xa206, 0x00c0, 0x19cf, 0x2c28, 0x2001, 0x5052,
327 0x2004, 0xac06, 0x00c0, 0x19e6, 0x0078, 0x1a0b, 0x6804, 0xac06,
328 0x00c0, 0x19f3, 0x6000, 0xa065, 0x6806, 0x00c0, 0x19fd, 0x6803,
329 0x0000, 0x0078, 0x19fd, 0x6400, 0x781c, 0x2060, 0x6402, 0xa486,
330 0x0000, 0x00c0, 0x19fd, 0x2c00, 0x6802, 0x2560, 0x1078, 0x19a3,
331 0x601b, 0x0005, 0x6023, 0x0020, 0x1078, 0x1c42, 0x6810, 0x8001,
332 0x1050, 0x23ca, 0x6812, 0xa085, 0xffff, 0x007c, 0x2039, 0x0000,
333 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 0x2091, 0x8000,
334 0x1078, 0x1963, 0x8738, 0xa784, 0x001f, 0x00c0, 0x1a18, 0xa7bc,
335 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, 0x00c0, 0x1a18,
336 0x2091, 0x8001, 0x007c, 0x2061, 0x0000, 0x6018, 0xa084, 0x0001,
337 0x00c0, 0x1a3c, 0x2091, 0x8000, 0x78e0, 0x78e3, 0x0000, 0x2091,
338 0x8001, 0xa005, 0x00c0, 0x1a3d, 0x007c, 0xa08c, 0xfff0, 0x0040,
339 0x1a43, 0x1078, 0x23ca, 0x0079, 0x1a45, 0x1a55, 0x1a58, 0x1a5e,
340 0x1a62, 0x1a56, 0x1a66, 0x1a6c, 0x1a56, 0x1a56, 0x1c0c, 0x1c30,
341 0x1c34, 0x1a56, 0x1a56, 0x1a56, 0x1a56, 0x007c, 0x1078, 0x23ca,
342 0x1078, 0x1a0e, 0x2001, 0x8001, 0x0078, 0x1c3a, 0x2001, 0x8003,
343 0x0078, 0x1c3a, 0x2001, 0x8004, 0x0078, 0x1c3a, 0x1078, 0x1a0e,
344 0x2001, 0x8006, 0x0078, 0x1c3a, 0x2001, 0x8007, 0x0078, 0x1c3a,
345 0x2030, 0x2138, 0xa782, 0x0021, 0x0048, 0x1a78, 0x2009, 0x0020,
346 0x2600, 0x1078, 0x1a92, 0x00c0, 0x1a91, 0xa7ba, 0x0020, 0x0048,
347 0x1a90, 0x0040, 0x1a90, 0x2708, 0xa6b0, 0x0020, 0xa290, 0x0040,
348 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x0078, 0x1a72,
349 0xa006, 0x007c, 0x81ff, 0x0040, 0x1acd, 0x2099, 0x0030, 0x20a0,
350 0x700c, 0xa084, 0x00ff, 0x0040, 0x1aa4, 0x7007, 0x0004, 0x7004,
351 0xa084, 0x0004, 0x00c0, 0x1a9f, 0x21a8, 0x7017, 0x0000, 0x810b,
352 0x7112, 0x721a, 0x731e, 0x7422, 0x7526, 0x780c, 0xa085, 0x0001,
353 0x7002, 0x7007, 0x0001, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005,
354 0x00c8, 0x1ac1, 0x2009, 0x0022, 0x2104, 0xa084, 0x4000, 0x00c0,
355 0x1ab3, 0x7008, 0x800b, 0x00c8, 0x1ab3, 0x7007, 0x0002, 0xa08c,
356 0x01e0, 0x00c0, 0x1acd, 0x53a5, 0xa006, 0x7003, 0x0000, 0x007c,
357 0x2030, 0x2138, 0xa782, 0x0021, 0x0048, 0x1ad8, 0x2009, 0x0020,
358 0x2600, 0x1078, 0x1af2, 0x00c0, 0x1af1, 0xa7ba, 0x0020, 0x0048,
359 0x1af0, 0x0040, 0x1af0, 0x2708, 0xa6b0, 0x0020, 0xa290, 0x0040,
360 0xa399, 0x0000, 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x0078, 0x1ad2,
361 0xa006, 0x007c, 0x81ff, 0x0040, 0x1b33, 0x2098, 0x20a1, 0x0030,
362 0x700c, 0xa084, 0x00ff, 0x0040, 0x1b04, 0x7007, 0x0004, 0x7004,
363 0xa084, 0x0004, 0x00c0, 0x1aff, 0x21a8, 0x7017, 0x0000, 0x810b,
364 0x7112, 0x721a, 0x731e, 0x7422, 0x7526, 0x780c, 0xa085, 0x0000,
365 0x7002, 0x53a6, 0x7007, 0x0001, 0x2001, 0x04fd, 0x2004, 0xa082,
366 0x0005, 0x00c8, 0x1b22, 0x2009, 0x0022, 0x2104, 0xa084, 0x4000,
367 0x00c0, 0x1b14, 0x7010, 0xa084, 0xf000, 0x0040, 0x1b2b, 0x7007,
368 0x0008, 0x0078, 0x1b2f, 0x7108, 0x8103, 0x00c8, 0x1b14, 0x7007,
369 0x0002, 0xa184, 0x01e0, 0x7003, 0x0000, 0x007c, 0x2001, 0x04fd,
370 0x2004, 0xa082, 0x0004, 0x00c8, 0x1b3f, 0x0078, 0x1b42, 0xa006,
371 0x0078, 0x1b44, 0xa085, 0x0001, 0x007c, 0x0e7e, 0x2071, 0x5000,
372 0x2d08, 0x7058, 0x6802, 0xa005, 0x00c0, 0x1b4f, 0x715e, 0x715a,
373 0x0e7f, 0x007c, 0x2c08, 0x7858, 0x6002, 0xa005, 0x00c0, 0x1b59,
374 0x795e, 0x795a, 0x007c, 0x2091, 0x8000, 0x6003, 0x0000, 0x2c08,
375 0x785c, 0xa065, 0x00c0, 0x1b67, 0x795a, 0x0078, 0x1b68, 0x6102,
376 0x795e, 0x2091, 0x8001, 0x1078, 0x21ce, 0x007c, 0x0e7e, 0x2071,
377 0x5000, 0x7058, 0xa06d, 0x0040, 0x1b7c, 0x6800, 0x705a, 0xa005,
378 0x00c0, 0x1b7b, 0x705e, 0x8dff, 0x0e7f, 0x007c, 0x0d7e, 0x0c7e,
379 0x0f7e, 0x2079, 0x5000, 0xaf80, 0x0016, 0x2060, 0x6000, 0xa005,
380 0x0040, 0x1bac, 0x2068, 0x6814, 0xa306, 0x00c0, 0x1b95, 0x6828,
381 0xa084, 0x00ff, 0xa406, 0x0040, 0x1b98, 0x2d60, 0x0078, 0x1b86,
382 0x6800, 0xa005, 0x6002, 0x00c0, 0x1ba4, 0xaf80, 0x0016, 0xac06,
383 0x0040, 0x1ba3, 0x2c00, 0x785e, 0x0d7e, 0x689c, 0xa005, 0x0040,
384 0x1bab, 0x1078, 0x1996, 0x007f, 0x0f7f, 0x0c7f, 0x0d7f, 0xa005,
385 0x007c, 0x0d7e, 0x0c7e, 0x0f7e, 0x2079, 0x5000, 0xaf80, 0x0016,
386 0x2060, 0x6000, 0xa005, 0x0040, 0x1bdb, 0x2068, 0x6814, 0xa084,
387 0x00ff, 0xa306, 0x0040, 0x1bc7, 0x2d60, 0x0078, 0x1bb9, 0x6800,
388 0xa005, 0x6002, 0x00c0, 0x1bd3, 0xaf80, 0x0016, 0xac06, 0x0040,
389 0x1bd2, 0x2c00, 0x785e, 0x0d7e, 0x689c, 0xa005, 0x0040, 0x1bda,
390 0x1078, 0x1996, 0x007f, 0x0f7f, 0x0c7f, 0x0d7f, 0xa005, 0x007c,
391 0x0d7e, 0x0c7e, 0x0f7e, 0x2079, 0x5000, 0xaf80, 0x0016, 0x2060,
392 0x6000, 0xa06d, 0x0040, 0x1c07, 0x6814, 0xa306, 0x0040, 0x1bf3,
393 0x2d60, 0x0078, 0x1be8, 0x6800, 0xa005, 0x6002, 0x00c0, 0x1bff,
394 0xaf80, 0x0016, 0xac06, 0x0040, 0x1bfe, 0x2c00, 0x785e, 0x0d7e,
395 0x689c, 0xa005, 0x0040, 0x1c06, 0x1078, 0x1996, 0x007f, 0x0f7f,
396 0x0c7f, 0x0d7f, 0xa005, 0x007c, 0x2091, 0x8000, 0x2069, 0x5040,
397 0x6800, 0xa086, 0x0000, 0x0040, 0x1c1a, 0x2091, 0x8001, 0x78e3,
398 0x0009, 0x007c, 0x6880, 0xa0bc, 0xff00, 0x2041, 0x0021, 0x2049,
399 0x0004, 0x2051, 0x0010, 0x1078, 0x1963, 0x8738, 0xa784, 0x001f,
400 0x00c0, 0x1c23, 0x2091, 0x8001, 0x2001, 0x800a, 0x0078, 0x1c3a,
401 0x2001, 0x800c, 0x0078, 0x1c3a, 0x1078, 0x1a0e, 0x2001, 0x800d,
402 0x0078, 0x1c3a, 0x70c2, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091,
403 0x4080, 0x007c, 0x6004, 0x2c08, 0x2063, 0x0000, 0x7884, 0x8000,
404 0x7886, 0x7888, 0xa005, 0x798a, 0x0040, 0x1c51, 0x2c02, 0x0078,
405 0x1c52, 0x798e, 0x007c, 0x6807, 0x0103, 0x0c7e, 0x2061, 0x5000,
406 0x2d08, 0x206b, 0x0000, 0x6084, 0x8000, 0x6086, 0x6088, 0xa005,
407 0x618a, 0x0040, 0x1c66, 0x2d02, 0x0078, 0x1c67, 0x618e, 0x0c7f,
408 0x007c, 0x1078, 0x1c7a, 0x0040, 0x1c79, 0x0c7e, 0x609c, 0xa065,
409 0x0040, 0x1c74, 0x1078, 0x1996, 0x0c7f, 0x609f, 0x0000, 0x1078,
410 0x192b, 0x007c, 0x788c, 0xa065, 0x0040, 0x1c8c, 0x2091, 0x8000,
411 0x7884, 0x8001, 0x7886, 0x2c04, 0x788e, 0xa005, 0x00c0, 0x1c8a,
412 0x788a, 0x8000, 0x2091, 0x8001, 0x007c, 0x20a9, 0x0010, 0xa006,
413 0x8004, 0x8086, 0x818e, 0x00c8, 0x1c96, 0xa200, 0x0070, 0x1c9a,
414 0x0078, 0x1c91, 0x8086, 0x818e, 0x007c, 0x157e, 0x20a9, 0x0010,
415 0xa005, 0x0040, 0x1cc0, 0xa11a, 0x00c8, 0x1cc0, 0x8213, 0x818d,
416 0x0048, 0x1cb1, 0xa11a, 0x00c8, 0x1cb2, 0x0070, 0x1cb8, 0x0078,
417 0x1ca6, 0xa11a, 0x2308, 0x8210, 0x0070, 0x1cb8, 0x0078, 0x1ca6,
418 0x007e, 0x3200, 0xa084, 0xf7ff, 0x2080, 0x007f, 0x157f, 0x007c,
419 0x007e, 0x3200, 0xa085, 0x0800, 0x0078, 0x1cbc, 0x7994, 0x70d0,
420 0xa106, 0x0040, 0x1d34, 0x2091, 0x8000, 0x2071, 0x0020, 0x7004,
421 0xa005, 0x00c0, 0x1d34, 0x7008, 0x7208, 0xa206, 0x00c0, 0x1d34,
422 0xa286, 0x0008, 0x00c0, 0x1d34, 0x2071, 0x0010, 0x1078, 0x1911,
423 0x0040, 0x1d34, 0x7a9c, 0x7b98, 0x7ca4, 0x7da0, 0xa184, 0xff00,
424 0x0040, 0x1d02, 0x2031, 0x0000, 0x810b, 0x86b5, 0x810b, 0x86b5,
425 0x810b, 0x86b5, 0x810b, 0x86b5, 0x810b, 0x86b5, 0x810b, 0x86b5,
426 0x2100, 0xa210, 0x2600, 0xa319, 0xa4a1, 0x0000, 0xa5a9, 0x0000,
427 0x0078, 0x1d0c, 0x8107, 0x8004, 0x8004, 0xa210, 0xa399, 0x0000,
428 0xa4a1, 0x0000, 0xa5a9, 0x0000, 0x2009, 0x0020, 0x1078, 0x190c,
429 0x2091, 0x8001, 0x0040, 0x1d2b, 0x1078, 0x192b, 0x78a8, 0x8000,
430 0x78aa, 0xa086, 0x0002, 0x00c0, 0x1d34, 0x2091, 0x8000, 0x78e3,
431 0x0002, 0x78ab, 0x0000, 0x78cc, 0xa085, 0x0003, 0x78ce, 0x2091,
432 0x8001, 0x0078, 0x1d34, 0x78ab, 0x0000, 0x1078, 0x208b, 0x6004,
433 0xa084, 0x000f, 0x0079, 0x1d39, 0x2071, 0x0010, 0x2091, 0x8001,
434 0x007c, 0x1d49, 0x1d6b, 0x1d91, 0x1d49, 0x1dae, 0x1d58, 0x1f0d,
435 0x1f28, 0x1d49, 0x1d65, 0x1d8b, 0x1df6, 0x1e63, 0x1eb3, 0x1ec5,
436 0x1f24, 0x2039, 0x0400, 0x78dc, 0xa705, 0x78de, 0x6008, 0xa705,
437 0x600a, 0x1078, 0x1fa6, 0x609c, 0x78da, 0x1078, 0x2073, 0x007c,
438 0x78dc, 0xa084, 0x0100, 0x0040, 0x1d5f, 0x0078, 0x1d49, 0x601c,
439 0xa085, 0x0080, 0x601e, 0x0078, 0x1d72, 0x1078, 0x1b36, 0x00c0,
440 0x1d49, 0x1078, 0x20a5, 0x78dc, 0xa084, 0x0100, 0x0040, 0x1d72,
441 0x0078, 0x1d49, 0x78df, 0x0000, 0x6004, 0x8007, 0xa084, 0x00ff,
442 0x78d2, 0x8001, 0x609f, 0x0000, 0x0040, 0x1d88, 0x1078, 0x1fa6,
443 0x0040, 0x1d88, 0x78dc, 0xa085, 0x0100, 0x78de, 0x0078, 0x1d8a,
444 0x1078, 0x1fca, 0x007c, 0x1078, 0x1b36, 0x00c0, 0x1d49, 0x1078,
445 0x20a1, 0x78dc, 0xa08c, 0x0e00, 0x00c0, 0x1d9a, 0xa084, 0x0100,
446 0x00c0, 0x1d9c, 0x0078, 0x1d49, 0x1078, 0x1fa6, 0x00c0, 0x1dad,
447 0x6104, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x1f63, 0xa186,
448 0x000f, 0x0040, 0x1f63, 0x1078, 0x1fca, 0x007c, 0x78dc, 0xa084,
449 0x0100, 0x0040, 0x1db5, 0x0078, 0x1d49, 0x78df, 0x0000, 0x6714,
450 0x2011, 0x0001, 0x20a9, 0x0001, 0x6018, 0xa084, 0x00ff, 0xa005,
451 0x0040, 0x1dd8, 0x2011, 0x0001, 0xa7bc, 0xff00, 0x20a9, 0x0020,
452 0xa08e, 0x0001, 0x0040, 0x1dd8, 0x2039, 0x0000, 0x2011, 0x0002,
453 0x20a9, 0x0100, 0xa08e, 0x0002, 0x0040, 0x1dd8, 0x0078, 0x1df3,
454 0x1078, 0x1956, 0x2091, 0x8000, 0x682b, 0x0000, 0x682f, 0x0000,
455 0x6808, 0xa084, 0xffde, 0x680a, 0xade8, 0x0010, 0x2091, 0x8001,
456 0x0070, 0x1dec, 0x0078, 0x1dda, 0x8211, 0x0040, 0x1df3, 0x20a9,
457 0x0100, 0x0078, 0x1dda, 0x1078, 0x192b, 0x007c, 0x2001, 0x5067,
458 0x2004, 0xa084, 0x8000, 0x0040, 0x1f8b, 0x6114, 0x1078, 0x20c2,
459 0x6900, 0xa184, 0x0001, 0x0040, 0x1e17, 0x6028, 0xa084, 0x00ff,
460 0x00c0, 0x1f83, 0x6800, 0xa084, 0x0001, 0x0040, 0x1f8b, 0x6803,
461 0x0000, 0x680b, 0x0000, 0x6807, 0x0000, 0x0078, 0x1f93, 0x2011,
462 0x0001, 0x6020, 0xa084, 0x4000, 0x0040, 0x1e20, 0xa295, 0x0002,
463 0x6020, 0xa084, 0x0100, 0x0040, 0x1e27, 0xa295, 0x0008, 0x601c,
464 0xa084, 0x0002, 0x0040, 0x1e2e, 0xa295, 0x0004, 0x602c, 0xa08c,
465 0x00ff, 0xa182, 0x0002, 0x0048, 0x1f8f, 0xa182, 0x001b, 0x00c8,
466 0x1f8f, 0x0040, 0x1f8f, 0x690e, 0x602c, 0x8007, 0xa08c, 0x00ff,
467 0xa182, 0x0002, 0x0048, 0x1f8f, 0xa182, 0x001b, 0x00c8, 0x1f8f,
468 0x0040, 0x1f8f, 0x6912, 0x6030, 0xa005, 0x00c0, 0x1e51, 0x2001,
469 0x001e, 0x8000, 0x6816, 0x6028, 0xa084, 0x00ff, 0x0040, 0x1f8b,
470 0x6806, 0x6028, 0x8007, 0xa084, 0x00ff, 0x0040, 0x1f8b, 0x680a,
471 0x6a02, 0x0078, 0x1f93, 0x2001, 0x5067, 0x2004, 0xa084, 0x8000,
472 0x0040, 0x1f8b, 0x6114, 0x1078, 0x20c2, 0x2091, 0x8000, 0x6a04,
473 0x6b08, 0x6418, 0xa484, 0x0003, 0x0040, 0x1e89, 0x6128, 0xa18c,
474 0x00ff, 0x8001, 0x00c0, 0x1e82, 0x2100, 0xa210, 0x0048, 0x1eaf,
475 0x0078, 0x1e89, 0x8001, 0x00c0, 0x1eaf, 0x2100, 0xa212, 0x0048,
476 0x1eaf, 0xa484, 0x000c, 0x0040, 0x1ea3, 0x6128, 0x810f, 0xa18c,
477 0x00ff, 0xa082, 0x0004, 0x00c0, 0x1e9b, 0x2100, 0xa318, 0x0048,
478 0x1eaf, 0x0078, 0x1ea3, 0xa082, 0x0004, 0x00c0, 0x1eaf, 0x2100,
479 0xa31a, 0x0048, 0x1eaf, 0x6030, 0xa005, 0x0040, 0x1ea9, 0x8000,
480 0x6816, 0x6a06, 0x6b0a, 0x2091, 0x8001, 0x0078, 0x1f93, 0x2091,
481 0x8001, 0x0078, 0x1f8f, 0x6114, 0x1078, 0x20c2, 0x2091, 0x8000,
482 0x6b08, 0x8318, 0x0048, 0x1ec1, 0x6b0a, 0x2091, 0x8001, 0x0078,
483 0x1fa2, 0x2091, 0x8001, 0x0078, 0x1f8f, 0x6024, 0x8007, 0xa084,
484 0x00ff, 0x0040, 0x1ee3, 0xa086, 0x0080, 0x00c0, 0x1f0b, 0x20a9,
485 0x0008, 0x2069, 0x7410, 0x2091, 0x8000, 0x6800, 0xa084, 0xfcff,
486 0x6802, 0xade8, 0x0008, 0x0070, 0x1edf, 0x0078, 0x1ed5, 0x2091,
487 0x8001, 0x0078, 0x1f93, 0x6028, 0xa015, 0x0040, 0x1f0b, 0x6114,
488 0x1078, 0x20c2, 0x0d7e, 0xade8, 0x0007, 0x2091, 0x8000, 0x6800,
489 0xa00d, 0x0040, 0x1f08, 0xa206, 0x0040, 0x1ef9, 0x2168, 0x0078,
490 0x1eef, 0x0c7e, 0x2160, 0x6000, 0x6802, 0x1078, 0x192b, 0x0c7f,
491 0x0d7f, 0x6808, 0x8000, 0x680a, 0x2091, 0x8001, 0x0078, 0x1fa2,
492 0x2091, 0x8001, 0x0d7f, 0x0078, 0x1f8b, 0x6114, 0x1078, 0x20c2,
493 0x6800, 0xa084, 0x0001, 0x0040, 0x1f7b, 0x2091, 0x8000, 0x6a04,
494 0x8210, 0x0048, 0x1f20, 0x6a06, 0x2091, 0x8001, 0x0078, 0x1fa2,
495 0x2091, 0x8001, 0x0078, 0x1f8f, 0x1078, 0x1b36, 0x00c0, 0x1d49,
496 0x6114, 0x1078, 0x20c2, 0x60be, 0x6900, 0xa184, 0x0008, 0x0040,
497 0x1f35, 0x6020, 0xa085, 0x0100, 0x6022, 0xa184, 0x0001, 0x0040,
498 0x1f8b, 0xa184, 0x0100, 0x00c0, 0x1f77, 0xa184, 0x0200, 0x00c0,
499 0x1f73, 0x681c, 0xa005, 0x00c0, 0x1f7f, 0x6004, 0xa084, 0x00ff,
500 0xa086, 0x000f, 0x00c0, 0x1f4e, 0x1078, 0x20a5, 0x78df, 0x0000,
501 0x6004, 0x8007, 0xa084, 0x00ff, 0x78d2, 0x8001, 0x609f, 0x0000,
502 0x0040, 0x1f63, 0x1078, 0x1fa6, 0x0040, 0x1f63, 0x78dc, 0xa085,
503 0x0100, 0x78de, 0x007c, 0x78d7, 0x0000, 0x78db, 0x0000, 0x6024,
504 0xa084, 0xff00, 0x6026, 0x1078, 0x39aa, 0x0040, 0x1cc6, 0x1078,
505 0x1b5b, 0x0078, 0x1cc6, 0x2009, 0x0017, 0x0078, 0x1f95, 0x2009,
506 0x000e, 0x0078, 0x1f95, 0x2009, 0x0007, 0x0078, 0x1f95, 0x2009,
507 0x0035, 0x0078, 0x1f95, 0x2009, 0x003e, 0x0078, 0x1f95, 0x2009,
508 0x0004, 0x0078, 0x1f95, 0x2009, 0x0006, 0x0078, 0x1f95, 0x2009,
509 0x0016, 0x0078, 0x1f95, 0x2009, 0x0001, 0x6024, 0xa084, 0xff00,
510 0xa105, 0x6026, 0x2091, 0x8000, 0x1078, 0x1c42, 0x2091, 0x8001,
511 0x0078, 0x1cc6, 0x1078, 0x192b, 0x0078, 0x1cc6, 0x78d4, 0xa06d,
512 0x00c0, 0x1fb1, 0x2c00, 0x78d6, 0x78da, 0x609f, 0x0000, 0x0078,
513 0x1fbd, 0x2c00, 0x689e, 0x609f, 0x0000, 0x78d6, 0x2d00, 0x6002,
514 0x78d8, 0xad06, 0x00c0, 0x1fbd, 0x6002, 0x78d0, 0x8001, 0x78d2,
515 0x00c0, 0x1fc9, 0x78dc, 0xa084, 0xfeff, 0x78de, 0x78d8, 0x2060,
516 0xa006, 0x007c, 0xa02e, 0x2530, 0x611c, 0x61a2, 0xa184, 0xe1ff,
517 0x601e, 0xa184, 0x0060, 0x0040, 0x1fd9, 0x0e7e, 0x1078, 0x467f,
518 0x0e7f, 0x6596, 0x65a6, 0x669a, 0x66aa, 0x60af, 0x0000, 0x60b3,
519 0x0000, 0x6714, 0x1078, 0x1956, 0x2091, 0x8000, 0x60a0, 0xa084,
520 0x8000, 0x00c0, 0x2000, 0x6808, 0xa084, 0x0001, 0x0040, 0x2000,
521 0x2091, 0x8001, 0x1078, 0x19a3, 0x2091, 0x8000, 0x1078, 0x1c42,
522 0x2091, 0x8001, 0x78d7, 0x0000, 0x78db, 0x0000, 0x0078, 0x2072,
523 0x6024, 0xa096, 0x0001, 0x00c0, 0x2007, 0x8000, 0x6026, 0x6a10,
524 0x6814, 0x2091, 0x8001, 0xa202, 0x0048, 0x2016, 0x0040, 0x2016,
525 0x2039, 0x0200, 0x1078, 0x2073, 0x0078, 0x2072, 0x2c08, 0x2091,
526 0x8000, 0x60a0, 0xa084, 0x8000, 0x0040, 0x2043, 0x6800, 0xa065,
527 0x0040, 0x2048, 0x6a04, 0x0e7e, 0x2071, 0x5040, 0x7000, 0xa084,
528 0x0001, 0x0040, 0x203d, 0x7048, 0xa206, 0x00c0, 0x203d, 0x6b04,
529 0x231c, 0x2160, 0x6302, 0x2300, 0xa005, 0x00c0, 0x2038, 0x6902,
530 0x2260, 0x6102, 0x0e7f, 0x0078, 0x204f, 0x2160, 0x6202, 0x6906,
531 0x0e7f, 0x0078, 0x204f, 0x6800, 0xa065, 0x0040, 0x2048, 0x6102,
532 0x6902, 0x00c0, 0x204c, 0x6906, 0x2160, 0x6003, 0x0000, 0x2160,
533 0x60a0, 0xa084, 0x8000, 0x0040, 0x2059, 0x6808, 0xa084, 0xfffc,
534 0x680a, 0x6810, 0x8000, 0x6812, 0x2091, 0x8001, 0x6808, 0xa08c,
535 0x0040, 0x0040, 0x2068, 0xa086, 0x0040, 0x680a, 0x1078, 0x19b4,
536 0x2091, 0x8000, 0x1078, 0x21b1, 0x2091, 0x8001, 0x78db, 0x0000,
537 0x78d7, 0x0000, 0x007c, 0x6008, 0xa705, 0x600a, 0x2091, 0x8000,
538 0x1078, 0x1c42, 0x2091, 0x8001, 0x78d8, 0xa065, 0x0040, 0x2086,
539 0x609c, 0x78da, 0x609f, 0x0000, 0x0078, 0x2076, 0x78d7, 0x0000,
540 0x78db, 0x0000, 0x007c, 0x7990, 0x7894, 0x8000, 0xa10a, 0x00c8,
541 0x2092, 0xa006, 0x7896, 0x70d2, 0x7804, 0xa005, 0x0040, 0x20a0,
542 0x8001, 0x7806, 0x00c0, 0x20a0, 0x0068, 0x20a0, 0x2091, 0x4080,
543 0x007c, 0x2039, 0x20b9, 0x0078, 0x20a7, 0x2039, 0x20bf, 0x2704,
544 0xa005, 0x0040, 0x20b8, 0xac00, 0x2068, 0x6b08, 0x6c0c, 0x6910,
545 0x6a14, 0x690a, 0x6a0e, 0x6b12, 0x6c16, 0x8738, 0x0078, 0x20a7,
546 0x007c, 0x0003, 0x0009, 0x000f, 0x0015, 0x001b, 0x0000, 0x0015,
547 0x001b, 0x0000, 0x0c7e, 0x1078, 0x3b33, 0x2c68, 0x0c7f, 0x007c,
548 0x0010, 0x2139, 0x0068, 0x2139, 0x2029, 0x0000, 0x78cb, 0x0000,
549 0x788c, 0xa065, 0x0040, 0x2132, 0x2009, 0x5074, 0x2104, 0xa084,
550 0x0001, 0x0040, 0x2100, 0x6004, 0xa086, 0x0103, 0x00c0, 0x2100,
551 0x6018, 0xa005, 0x00c0, 0x2100, 0x6014, 0xa005, 0x00c0, 0x2100,
552 0x0d7e, 0x2069, 0x0000, 0x6818, 0xa084, 0x0001, 0x00c0, 0x20ff,
553 0x600c, 0x70c6, 0x6010, 0x70ca, 0x70c3, 0x8020, 0x681b, 0x0001,
554 0x2091, 0x4080, 0x0d7f, 0x1078, 0x1c69, 0x0078, 0x2137, 0x0d7f,
555 0x1078, 0x213a, 0x0040, 0x2132, 0x6204, 0xa294, 0x00ff, 0xa296,
556 0x0003, 0x0040, 0x2112, 0x6204, 0xa296, 0x0110, 0x00c0, 0x2120,
557 0x78cb, 0x0001, 0x6204, 0xa294, 0xff00, 0x8217, 0x8211, 0x0040,
558 0x2120, 0x85ff, 0x00c0, 0x2132, 0x8210, 0xa202, 0x00c8, 0x2132,
559 0x057e, 0x1078, 0x2149, 0x057f, 0x0040, 0x212d, 0x78e0, 0xa086,
560 0x0003, 0x0040, 0x2132, 0x0078, 0x2120, 0x8528, 0x78c8, 0xa005,
561 0x0040, 0x20d0, 0x85ff, 0x0040, 0x2139, 0x2091, 0x4080, 0x78b0,
562 0x70d6, 0x007c, 0x7bac, 0x79b0, 0x70d4, 0xa102, 0x00c0, 0x2143,
563 0x2300, 0xa005, 0x007c, 0x0048, 0x2147, 0xa302, 0x007c, 0x8002,
564 0x007c, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x00c8, 0x2163,
565 0x2091, 0x8000, 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0, 0x2198,
566 0x7008, 0x7208, 0xa206, 0x00c0, 0x2198, 0xa286, 0x0008, 0x00c0,
567 0x2198, 0x2071, 0x0010, 0x1078, 0x219d, 0x2009, 0x0020, 0x6004,
568 0xa086, 0x0103, 0x00c0, 0x2172, 0x6028, 0xa005, 0x00c0, 0x2172,
569 0x2009, 0x000c, 0x1078, 0x1907, 0x0040, 0x218b, 0x78c4, 0x8000,
570 0x78c6, 0xa086, 0x0002, 0x00c0, 0x2198, 0x2091, 0x8000, 0x78e3,
571 0x0003, 0x78c7, 0x0000, 0x78cc, 0xa085, 0x0300, 0x78ce, 0x2091,
572 0x8001, 0x0078, 0x2198, 0x78c7, 0x0000, 0x1078, 0x1c69, 0x79ac,
573 0x78b0, 0x8000, 0xa10a, 0x00c8, 0x2196, 0xa006, 0x78b2, 0xa006,
574 0x2071, 0x0010, 0x2091, 0x8001, 0x007c, 0x8107, 0x8004, 0x8004,
575 0x7ab8, 0x7bb4, 0x7cc0, 0x7dbc, 0xa210, 0xa399, 0x0000, 0xa4a1,
576 0x0000, 0xa5a9, 0x0000, 0x007c, 0x2009, 0x505b, 0x2091, 0x8000,
577 0x200a, 0x0f7e, 0x0e7e, 0x2071, 0x5040, 0x7000, 0xa086, 0x0000,
578 0x00c0, 0x21cb, 0x2009, 0x5012, 0x2104, 0xa005, 0x00c0, 0x21cb,
579 0x2079, 0x0100, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x21cb, 0x0018,
580 0x21cb, 0x781b, 0x004b, 0x0e7f, 0x0f7f, 0x007c, 0x0f7e, 0x0e7e,
581 0x2071, 0x5040, 0x2091, 0x8000, 0x7000, 0xa086, 0x0000, 0x00c0,
582 0x21e4, 0x2079, 0x0100, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x21e4,
583 0x0018, 0x21e4, 0x781b, 0x004d, 0x2091, 0x8001, 0x0e7f, 0x0f7f,
584 0x007c, 0x127e, 0x2091, 0x2300, 0x2071, 0x5040, 0x2079, 0x0100,
585 0x784b, 0x000f, 0x0098, 0x21f7, 0x7838, 0x0078, 0x21f0, 0x20a9,
586 0x0040, 0x7800, 0xa082, 0x0004, 0x0048, 0x2200, 0x20a9, 0x0060,
587 0x789b, 0x0000, 0x78af, 0x0000, 0x78af, 0x0000, 0x0070, 0x220a,
588 0x0078, 0x2202, 0x7800, 0xa082, 0x0004, 0x0048, 0x2219, 0x70b7,
589 0x009b, 0x2019, 0x4da4, 0x1078, 0x2255, 0x702f, 0x8001, 0x0078,
590 0x2225, 0x70b7, 0x0000, 0x2019, 0x4c1c, 0x1078, 0x2255, 0x2019,
591 0x4c5b, 0x1078, 0x2255, 0x702f, 0x8000, 0x7003, 0x0000, 0x1078,
592 0x235e, 0x7004, 0xa084, 0x000f, 0x017e, 0x2009, 0x04fd, 0x210c,
593 0xa18a, 0x0005, 0x0048, 0x223a, 0x0038, 0x2240, 0xa085, 0x6280,
594 0x0078, 0x2242, 0x0028, 0x2240, 0xa085, 0x6280, 0x0078, 0x2242,
595 0xa085, 0x62c0, 0x017f, 0x7806, 0x780f, 0xb204, 0x7843, 0x00d8,
596 0x7853, 0x0080, 0x780b, 0x0008, 0x7047, 0x0008, 0x7053, 0x507f,
597 0x704f, 0x0000, 0x127f, 0x2000, 0x007c, 0x137e, 0x147e, 0x157e,
598 0x047e, 0x20a1, 0x012b, 0x2304, 0xa005, 0x789a, 0x0040, 0x2275,
599 0x8318, 0x2324, 0x8318, 0x2398, 0x24a8, 0xa484, 0xff00, 0x0040,
600 0x226d, 0xa482, 0x0100, 0x20a9, 0x0100, 0x2020, 0x53a6, 0xa005,
601 0x00c0, 0x2264, 0x3318, 0x0078, 0x225b, 0x047f, 0x157f, 0x147f,
602 0x137f, 0x007c, 0xa18c, 0x000f, 0x2011, 0x0101, 0x2204, 0xa084,
603 0xfff0, 0xa105, 0x2012, 0x1078, 0x235e, 0x007c, 0x2011, 0x0101,
604 0x20a9, 0x0009, 0x810b, 0x0070, 0x228f, 0x0078, 0x228a, 0xa18c,
605 0x0e00, 0x2204, 0xa084, 0xf1ff, 0xa105, 0x2012, 0x007c, 0x2009,
606 0x0101, 0x20a9, 0x0005, 0x8213, 0x0070, 0x22a0, 0x0078, 0x229b,
607 0xa294, 0x00e0, 0x2104, 0xa084, 0xff1f, 0xa205, 0x200a, 0x007c,
608 0x2011, 0x0101, 0x20a9, 0x000c, 0x810b, 0x0070, 0x22b1, 0x0078,
609 0x22ac, 0xa18c, 0xf000, 0x2204, 0xa084, 0x0fff, 0xa105, 0x2012,
610 0x007c, 0x2011, 0x0102, 0x2204, 0xa084, 0xffcf, 0xa105, 0x2012,
611 0x007c, 0x8103, 0x8003, 0xa080, 0x0020, 0x0c7e, 0x2061, 0x0100,
612 0x609a, 0x62ac, 0x63ac, 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080,
613 0x0022, 0x0c7e, 0x2061, 0x0100, 0x609a, 0x60a4, 0xa084, 0xffdf,
614 0x60ae, 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080, 0x0022, 0x0c7e,
615 0x2061, 0x0100, 0x609a, 0x60a4, 0xa085, 0x0020, 0x60ae, 0x0c7f,
616 0x007c, 0x8103, 0x8003, 0xa080, 0x0020, 0x0c7e, 0x2061, 0x0100,
617 0x609a, 0x60a4, 0x62ae, 0x2010, 0x60a4, 0x63ae, 0x2018, 0x0c7f,
618 0x007c, 0x2091, 0x8000, 0x0c7e, 0x0e7e, 0x6818, 0xa005, 0x0040,
619 0x233c, 0x2061, 0x7400, 0x1078, 0x2344, 0x0040, 0x2328, 0x20a9,
620 0x0000, 0x2061, 0x7300, 0x0c7e, 0x1078, 0x2344, 0x0040, 0x2318,
621 0x0c7f, 0x8c60, 0x0070, 0x2316, 0x0078, 0x230b, 0x0078, 0x233c,
622 0x007f, 0xa082, 0x7300, 0x2071, 0x5040, 0x7086, 0x7182, 0x2001,
623 0x0004, 0x706e, 0x7093, 0x000f, 0x1078, 0x21ac, 0x0078, 0x2338,
624 0x60c0, 0xa005, 0x00c0, 0x233c, 0x2071, 0x5040, 0x7182, 0x2c00,
625 0x708a, 0x2001, 0x0006, 0x706e, 0x7093, 0x000f, 0x1078, 0x21ac,
626 0x2001, 0x0000, 0x0078, 0x233e, 0x2001, 0x0001, 0x2091, 0x8001,
627 0xa005, 0x0e7f, 0x0c7f, 0x007c, 0x2c04, 0xa005, 0x0040, 0x235b,
628 0x2060, 0x600c, 0xa306, 0x00c0, 0x2358, 0x6010, 0xa206, 0x00c0,
629 0x2358, 0x6014, 0xa106, 0x00c0, 0x2358, 0xa006, 0x0078, 0x235d,
630 0x6000, 0x0078, 0x2345, 0xa085, 0x0001, 0x007c, 0x2011, 0x5041,
631 0x220c, 0xa18c, 0x000f, 0x2011, 0x013b, 0x2204, 0xa084, 0x0100,
632 0x0040, 0x2374, 0x2021, 0xff04, 0x2122, 0x810b, 0x810b, 0x810b,
633 0x810b, 0xa18d, 0x0f00, 0x2104, 0x007c, 0x0e7e, 0x68e4, 0xa08c,
634 0x0020, 0x0040, 0x23c8, 0xa084, 0x0006, 0x00c0, 0x23c8, 0x6014,
635 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0f0, 0x5280,
636 0x7004, 0xa084, 0x000a, 0x00c0, 0x23c8, 0x7108, 0xa194, 0xff00,
637 0x0040, 0x23c8, 0xa18c, 0x00ff, 0x2001, 0x000c, 0xa106, 0x0040,
638 0x23af, 0x2001, 0x0012, 0xa106, 0x0040, 0x23b3, 0x2001, 0x0014,
639 0xa106, 0x0040, 0x23b7, 0x2001, 0x0019, 0xa106, 0x0040, 0x23bb,
640 0x2001, 0x0032, 0xa106, 0x0040, 0x23bf, 0x0078, 0x23c3, 0x2009,
641 0x0012, 0x0078, 0x23c5, 0x2009, 0x0014, 0x0078, 0x23c5, 0x2009,
642 0x0019, 0x0078, 0x23c5, 0x2009, 0x0020, 0x0078, 0x23c5, 0x2009,
643 0x003f, 0x0078, 0x23c5, 0x2011, 0x0000, 0x2100, 0xa205, 0x700a,
644 0x0e7f, 0x007c, 0x0068, 0x23ca, 0x2091, 0x8000, 0x2071, 0x0000,
645 0x007e, 0x7018, 0xa084, 0x0001, 0x00c0, 0x23d1, 0x007f, 0x2071,
646 0x0010, 0x70ca, 0x007f, 0x70c6, 0x70c3, 0x8002, 0x70db, 0x073f,
647 0x70df, 0x0000, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080,
648 0x0078, 0x23e8, 0x107e, 0x007e, 0x127e, 0x2091, 0x2300, 0x7f3c,
649 0x7e58, 0x7c30, 0x7d38, 0x77c2, 0x74c6, 0x76ca, 0x75ce, 0xa594,
650 0x003f, 0xa49c, 0x0003, 0xa484, 0x000f, 0x0079, 0x23ff, 0x2411,
651 0x2411, 0x2411, 0x274b, 0x3907, 0x240f, 0x2440, 0x244a, 0x240f,
652 0x240f, 0x240f, 0x240f, 0x240f, 0x240f, 0x240f, 0x240f, 0x1078,
653 0x23ca, 0x8507, 0xa084, 0x001f, 0x0079, 0x2416, 0x2454, 0x274b,
654 0x2905, 0x2a02, 0x2a2a, 0x2cc3, 0x2f6e, 0x2fb1, 0x2ffc, 0x3081,
655 0x3139, 0x31e2, 0x2440, 0x2827, 0x2f43, 0x2436, 0x3c78, 0x3c98,
656 0x3e5e, 0x3e6a, 0x3f3f, 0x2436, 0x2436, 0x4012, 0x4016, 0x3c76,
657 0x2436, 0x3dc9, 0x2436, 0x3b56, 0x244a, 0x2436, 0x1078, 0x23ca,
658 0x0018, 0x23ef, 0x127f, 0x2091, 0x8001, 0x007f, 0x107f, 0x007c,
659 0x2019, 0x4cfd, 0x1078, 0x2255, 0x702f, 0x0001, 0x781b, 0x004f,
660 0x0078, 0x2438, 0x2019, 0x4c5b, 0x1078, 0x2255, 0x702f, 0x8000,
661 0x781b, 0x00d5, 0x0078, 0x2438, 0x7242, 0x2009, 0x500f, 0x200b,
662 0x0000, 0xa584, 0x0001, 0x00c0, 0x3b6a, 0x0040, 0x2471, 0x1078,
663 0x23ca, 0x7003, 0x0000, 0x704b, 0x0000, 0x7043, 0x0000, 0x7037,
664 0x0000, 0x1078, 0x38de, 0x0018, 0x23ef, 0x2009, 0x500f, 0x200b,
665 0x0000, 0x7068, 0xa005, 0x00c0, 0x253c, 0x706c, 0xa084, 0x0007,
666 0x0079, 0x247a, 0x2573, 0x2482, 0x248e, 0x24ab, 0x24cd, 0x251a,
667 0x24f3, 0x2482, 0x1078, 0x38c6, 0x2009, 0x0048, 0x1078, 0x2e0f,
668 0x00c0, 0x248c, 0x7003, 0x0004, 0x0078, 0x2438, 0x1078, 0x38c6,
669 0x00c0, 0x24a9, 0x7080, 0x8007, 0x7882, 0x789b, 0x0010, 0x78ab,
670 0x000c, 0x789b, 0x0060, 0x78ab, 0x0001, 0x785b, 0x0004, 0x2009,
671 0x00e5, 0x1078, 0x2e03, 0x00c0, 0x24a9, 0x7003, 0x0004, 0x7093,
672 0x000f, 0x0078, 0x2438, 0x1078, 0x38c6, 0x00c0, 0x24cb, 0x7180,
673 0x8107, 0x7882, 0x789b, 0x0010, 0xa18c, 0x001f, 0xa18d, 0x00c0,
674 0x79aa, 0x78ab, 0x0006, 0x789b, 0x0060, 0x78ab, 0x0002, 0x785b,
675 0x0004, 0x2009, 0x00e5, 0x1078, 0x2e03, 0x00c0, 0x24cb, 0x7003,
676 0x0004, 0x7093, 0x000f, 0x0078, 0x2438, 0x1078, 0x38c6, 0x00c0,
677 0x24f1, 0x7180, 0x8107, 0x7882, 0x789b, 0x0010, 0xa18c, 0x001f,
678 0xa18d, 0x00c0, 0x79aa, 0x78ab, 0x0020, 0x7184, 0x79aa, 0x78ab,
679 0x000d, 0x789b, 0x0060, 0x78ab, 0x0004, 0x785b, 0x0004, 0x2009,
680 0x00e5, 0x1078, 0x2e03, 0x00c0, 0x24f1, 0x7003, 0x0004, 0x7093,
681 0x000f, 0x0078, 0x2438, 0x1078, 0x38c6, 0x00c0, 0x2518, 0x7180,
682 0x8107, 0x7882, 0x789b, 0x0010, 0xa18c, 0x001f, 0xa18d, 0x00c0,
683 0x79aa, 0x78ab, 0x0006, 0x789b, 0x0060, 0x78ab, 0x0002, 0x785b,
684 0x0004, 0x2009, 0x00e5, 0x1078, 0x2e03, 0x00c0, 0x2518, 0x7088,
685 0x708b, 0x0000, 0x2068, 0x704a, 0x7003, 0x0002, 0x7093, 0x000f,
686 0x0078, 0x2438, 0x1078, 0x38c6, 0x00c0, 0x2438, 0x7088, 0x2068,
687 0x6f14, 0x1078, 0x37bd, 0x2c50, 0x1078, 0x3978, 0x789b, 0x0010,
688 0x6814, 0xa084, 0x001f, 0xa085, 0x0080, 0x78aa, 0x6e1c, 0x2041,
689 0x0001, 0x708c, 0xa084, 0x0400, 0x2001, 0x0004, 0x0040, 0x253a,
690 0x2001, 0x0006, 0x0078, 0x265b, 0x1078, 0x38c6, 0x00c0, 0x2438,
691 0x789b, 0x0010, 0x7068, 0x2068, 0x6f14, 0x1078, 0x37bd, 0x2c50,
692 0x1078, 0x3978, 0x6008, 0xa085, 0x0010, 0x600a, 0x6824, 0xa005,
693 0x0040, 0x255a, 0xa082, 0x0006, 0x0048, 0x2558, 0x0078, 0x255a,
694 0x6827, 0x0005, 0x6b14, 0xa39c, 0x001f, 0xa39d, 0x00c0, 0x7058,
695 0xa084, 0x8000, 0x0040, 0x2568, 0xa684, 0x0001, 0x0040, 0x256a,
696 0xa39c, 0xffbf, 0x7baa, 0x2031, 0x0020, 0x2041, 0x0001, 0x2001,
697 0x0003, 0x0078, 0x265b, 0x0018, 0x23ef, 0x744c, 0xa485, 0x0000,
698 0x0040, 0x258d, 0xa080, 0x5080, 0x2030, 0x7150, 0x8108, 0xa12a,
699 0x0048, 0x2584, 0x2009, 0x5080, 0x2164, 0x6504, 0x85ff, 0x00c0,
700 0x259e, 0x8421, 0x00c0, 0x257e, 0x7152, 0x7003, 0x0000, 0x704b,
701 0x0000, 0x7040, 0xa005, 0x0040, 0x3b6a, 0x0078, 0x2438, 0x764c,
702 0xa6b0, 0x5080, 0x7150, 0x2600, 0x0078, 0x2589, 0x7152, 0x2568,
703 0x2558, 0x754a, 0x2c50, 0x6034, 0xa085, 0x0000, 0x00c0, 0x259b,
704 0x6708, 0x773a, 0xa784, 0x033f, 0x0040, 0x25d4, 0xa784, 0x0021,
705 0x00c0, 0x259b, 0xa784, 0x0002, 0x0040, 0x25bd, 0xa784, 0x0004,
706 0x0040, 0x259b, 0xa7bc, 0xfffb, 0x670a, 0xa784, 0x0008, 0x00c0,
707 0x259b, 0xa784, 0x0010, 0x00c0, 0x259b, 0xa784, 0x0200, 0x00c0,
708 0x259b, 0xa784, 0x0100, 0x0040, 0x25d4, 0x6018, 0xa005, 0x00c0,
709 0x259b, 0xa7bc, 0xfeff, 0x670a, 0x6823, 0x0000, 0x6e1c, 0xa684,
710 0x000e, 0x6118, 0x0040, 0x25e4, 0x601c, 0xa102, 0x0048, 0x25e7,
711 0x0040, 0x25e7, 0x0078, 0x2597, 0x81ff, 0x00c0, 0x2597, 0x68c3,
712 0x0000, 0xa784, 0x0080, 0x00c0, 0x25ef, 0x700c, 0x6022, 0xa7bc,
713 0xff7f, 0x670a, 0x1078, 0x3978, 0x0018, 0x23ef, 0x789b, 0x0010,
714 0xa046, 0x1078, 0x38c6, 0x00c0, 0x2438, 0x6b14, 0xa39c, 0x001f,
715 0xa39d, 0x00c0, 0x7058, 0xa084, 0x8000, 0x0040, 0x260b, 0xa684,
716 0x0001, 0x0040, 0x260d, 0xa39c, 0xffbf, 0xa684, 0x0010, 0x0040,
717 0x2613, 0xa39d, 0x0020, 0x7baa, 0x8840, 0xa684, 0x000e, 0x00c0,
718 0x261e, 0xa7bd, 0x0010, 0x670a, 0x0078, 0x2659, 0x7158, 0xa18c,
719 0x0800, 0x0040, 0x33d7, 0x2011, 0x0020, 0xa684, 0x0008, 0x00c0,
720 0x262f, 0x8210, 0xa684, 0x0002, 0x00c0, 0x262f, 0x8210, 0x7aaa,
721 0x8840, 0x1078, 0x38de, 0x6a14, 0x610c, 0x8108, 0xa18c, 0x00ff,
722 0xa1e0, 0x7300, 0x2c64, 0x8cff, 0x0040, 0x2650, 0x6014, 0xa206,
723 0x00c0, 0x263a, 0x60b8, 0x8001, 0x60ba, 0x00c0, 0x2635, 0x0c7e,
724 0x2a60, 0x6008, 0xa085, 0x0100, 0x600a, 0x0c7f, 0x0078, 0x2573,
725 0x1078, 0x38c6, 0x00c0, 0x2438, 0x2a60, 0x610e, 0x79aa, 0x8840,
726 0x7132, 0x2001, 0x0001, 0x007e, 0x715c, 0xa184, 0x0018, 0x0040,
727 0x2676, 0xa184, 0x0010, 0x0040, 0x2669, 0x1078, 0x35d6, 0x00c0,
728 0x2699, 0xa184, 0x0008, 0x0040, 0x2676, 0x69a0, 0xa184, 0x0600,
729 0x00c0, 0x2676, 0x1078, 0x34c7, 0x0078, 0x2699, 0x69a0, 0xa184,
730 0x0800, 0x0040, 0x268d, 0x0c7e, 0x027e, 0x2960, 0x6000, 0xa085,
731 0x2000, 0x6002, 0x6104, 0xa18d, 0x0010, 0x6106, 0x027f, 0x0c7f,
732 0x1078, 0x35d6, 0x00c0, 0x2699, 0x69a0, 0xa184, 0x0200, 0x0040,
733 0x2695, 0x1078, 0x3516, 0x0078, 0x2699, 0xa184, 0x0400, 0x00c0,
734 0x2672, 0x69a0, 0xa184, 0x1000, 0x0040, 0x26a4, 0x6914, 0xa18c,
735 0xff00, 0x810f, 0x1078, 0x22cd, 0x007f, 0x7002, 0xa68c, 0x00e0,
736 0xa684, 0x0060, 0x0040, 0x26b2, 0xa086, 0x0060, 0x00c0, 0x26b2,
737 0xa18d, 0x4000, 0x88ff, 0x0040, 0x26b7, 0xa18d, 0x0004, 0x795a,
738 0x69b6, 0x789b, 0x0060, 0x2800, 0x78aa, 0x789b, 0x0061, 0x6818,
739 0xa08d, 0x8000, 0xa084, 0x7fff, 0x691a, 0xa68c, 0x0080, 0x0040,
740 0x26d6, 0x7097, 0x0000, 0xa08a, 0x000d, 0x0050, 0x26d4, 0xa08a,
741 0x000c, 0x7196, 0x2001, 0x000c, 0x800c, 0x719a, 0x78aa, 0x8008,
742 0x810c, 0x0040, 0x33dd, 0xa18c, 0x00f8, 0x00c0, 0x33dd, 0x157e,
743 0x137e, 0x147e, 0x20a1, 0x012b, 0x789b, 0x0000, 0x8000, 0x80ac,
744 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 0x6814,
745 0x8007, 0x7882, 0x6d94, 0x7dd6, 0x7dde, 0x6e98, 0x7ed2, 0x7eda,
746 0x1078, 0x38c6, 0x00c0, 0x270d, 0x702c, 0x8003, 0x0048, 0x2706,
747 0x2019, 0x4c5b, 0x1078, 0x2255, 0x702f, 0x8000, 0x7830, 0xa084,
748 0x00c0, 0x00c0, 0x270d, 0x0098, 0x2715, 0x6008, 0xa084, 0xffef,
749 0x600a, 0x1078, 0x38de, 0x0078, 0x2461, 0x7200, 0xa284, 0x0007,
750 0xa086, 0x0001, 0x00c0, 0x2722, 0x781b, 0x004f, 0x1078, 0x38de,
751 0x0078, 0x2733, 0x6ab4, 0xa295, 0x2000, 0x7a5a, 0x781b, 0x004f,
752 0x1078, 0x38de, 0x7200, 0x2500, 0xa605, 0x0040, 0x2733, 0xa284,
753 0x0007, 0x1079, 0x2741, 0xad80, 0x0009, 0x7036, 0xa284, 0x0007,
754 0xa086, 0x0001, 0x00c0, 0x2438, 0x6018, 0x8000, 0x601a, 0x0078,
755 0x2438, 0x2749, 0x48f7, 0x48f7, 0x48e6, 0x48f7, 0x2749, 0x48e6,
756 0x2749, 0x1078, 0x23ca, 0x1078, 0x38c6, 0x0f7e, 0x2079, 0x5000,
757 0x78cc, 0x0f7f, 0xa084, 0x0001, 0x0040, 0x276f, 0x706c, 0xa086,
758 0x0001, 0x00c0, 0x275e, 0x706e, 0x0078, 0x2802, 0x706c, 0xa086,
759 0x0005, 0x00c0, 0x276d, 0x7088, 0x2068, 0x681b, 0x0004, 0x6817,
760 0x0000, 0x6820, 0xa085, 0x0008, 0x6822, 0x706f, 0x0000, 0x2011,
761 0x0004, 0x716c, 0xa186, 0x0001, 0x0040, 0x2790, 0xa186, 0x0007,
762 0x00c0, 0x2780, 0x2009, 0x5038, 0x200b, 0x0005, 0x0078, 0x2790,
763 0x2009, 0x5013, 0x2104, 0x2009, 0x5012, 0x200a, 0x2009, 0x5038,
764 0x200b, 0x0001, 0x706f, 0x0000, 0x7073, 0x0001, 0x0078, 0x2792,
765 0x706f, 0x0000, 0x1078, 0x4633, 0x157e, 0x20a9, 0x0010, 0x2039,
766 0x0000, 0x1078, 0x36b0, 0xa7b8, 0x0100, 0x0070, 0x27a1, 0x0078,
767 0x2799, 0x157f, 0x7000, 0x0079, 0x27a5, 0x27d3, 0x27ba, 0x27ba,
768 0x27ad, 0x27d3, 0x27d3, 0x27d3, 0x27d3, 0x2021, 0x505a, 0x2404,
769 0xa005, 0x0040, 0x27d3, 0xad06, 0x00c0, 0x27ba, 0x6800, 0x2022,
770 0x0078, 0x27ca, 0x6820, 0xa084, 0x0001, 0x00c0, 0x27c6, 0x6f14,
771 0x1078, 0x37bd, 0x1078, 0x33ae, 0x0078, 0x27ca, 0x7060, 0x2060,
772 0x6800, 0x6002, 0x6a1a, 0x6817, 0x0000, 0x6820, 0xa085, 0x0008,
773 0x6822, 0x1078, 0x1c53, 0x2021, 0x7400, 0x1078, 0x280f, 0x2021,
774 0x505a, 0x1078, 0x280f, 0x157e, 0x20a9, 0x0000, 0x2021, 0x7300,
775 0x1078, 0x280f, 0x8420, 0x0070, 0x27e7, 0x0078, 0x27e0, 0x2061,
776 0x5300, 0x2021, 0x0002, 0x20a9, 0x0100, 0x6018, 0x6110, 0x81ff,
777 0x0040, 0x27f6, 0xa102, 0x0050, 0x27f6, 0x6012, 0x601b, 0x0000,
778 0xace0, 0x0010, 0x0070, 0x27fe, 0x0078, 0x27ed, 0x8421, 0x00c0,
779 0x27eb, 0x157f, 0x709c, 0xa084, 0x8000, 0x0040, 0x2809, 0x1078,
780 0x39cc, 0x7003, 0x0000, 0x704b, 0x0000, 0x0078, 0x2438, 0x047e,
781 0x2404, 0xa005, 0x0040, 0x2823, 0x2068, 0x6800, 0x007e, 0x6a1a,
782 0x6817, 0x0000, 0x6820, 0xa085, 0x0008, 0x6822, 0x1078, 0x1c53,
783 0x007f, 0x0078, 0x2811, 0x047f, 0x2023, 0x0000, 0x007c, 0xa282,
784 0x0003, 0x0050, 0x282d, 0x1078, 0x23ca, 0x2300, 0x0079, 0x2830,
785 0x2833, 0x28a6, 0x28c3, 0xa282, 0x0002, 0x0040, 0x2839, 0x1078,
786 0x23ca, 0x706c, 0x706f, 0x0000, 0x7093, 0x0000, 0x0079, 0x2840,
787 0x2848, 0x2848, 0x284a, 0x287e, 0x33e3, 0x2848, 0x287e, 0x2848,
788 0x1078, 0x23ca, 0x7780, 0x1078, 0x36b0, 0x7780, 0xa7bc, 0x0f00,
789 0x1078, 0x37bd, 0x6018, 0xa005, 0x0040, 0x2875, 0x2021, 0x7400,
790 0x2009, 0x0004, 0x2011, 0x0010, 0x1078, 0x28de, 0x0040, 0x2875,
791 0x157e, 0x20a9, 0x0000, 0x2021, 0x7300, 0x047e, 0x2009, 0x0004,
792 0x2011, 0x0010, 0x1078, 0x28de, 0x047f, 0x0040, 0x2874, 0x8420,
793 0x0070, 0x2874, 0x0078, 0x2865, 0x157f, 0x8738, 0xa784, 0x001f,
794 0x00c0, 0x2850, 0x0078, 0x2461, 0x0078, 0x2461, 0x7780, 0x1078,
795 0x37bd, 0x6018, 0xa005, 0x0040, 0x28a4, 0x2021, 0x7400, 0x2009,
796 0x0005, 0x2011, 0x0020, 0x1078, 0x28de, 0x0040, 0x28a4, 0x157e,
797 0x20a9, 0x0000, 0x2021, 0x7300, 0x047e, 0x2009, 0x0005, 0x2011,
798 0x0020, 0x1078, 0x28de, 0x047f, 0x0040, 0x28a3, 0x8420, 0x0070,
799 0x28a3, 0x0078, 0x2894, 0x157f, 0x0078, 0x2461, 0x2200, 0x0079,
800 0x28a9, 0x28ac, 0x28ae, 0x28ae, 0x1078, 0x23ca, 0x2009, 0x0012,
801 0x706c, 0xa086, 0x0002, 0x0040, 0x28b7, 0x2009, 0x000e, 0x6818,
802 0xa084, 0x8000, 0x0040, 0x28bd, 0x691a, 0x706f, 0x0000, 0x7073,
803 0x0001, 0x0078, 0x3854, 0x2200, 0x0079, 0x28c6, 0x28cb, 0x28ae,
804 0x28c9, 0x1078, 0x23ca, 0x1078, 0x4633, 0x7000, 0xa086, 0x0001,
805 0x00c0, 0x3373, 0x1078, 0x33c4, 0x6008, 0xa084, 0xffef, 0x600a,
806 0x1078, 0x3366, 0x0040, 0x3373, 0x0078, 0x2573, 0x2404, 0xa005,
807 0x0040, 0x2901, 0x2068, 0x2d04, 0x007e, 0x6814, 0xa706, 0x0040,
808 0x28ed, 0x2d20, 0x007f, 0x0078, 0x28df, 0x007f, 0x2022, 0x691a,
809 0x6817, 0x0000, 0x6820, 0xa205, 0x6822, 0x1078, 0x1c53, 0x6010,
810 0x8001, 0x6012, 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x33c4,
811 0x007c, 0xa085, 0x0001, 0x0078, 0x2900, 0x2300, 0x0079, 0x2908,
812 0x290d, 0x290b, 0x29a6, 0x1078, 0x23ca, 0x78ec, 0xa084, 0x0001,
813 0x00c0, 0x2921, 0x7000, 0xa086, 0x0004, 0x00c0, 0x2919, 0x0078,
814 0x2944, 0x1078, 0x33c4, 0x6008, 0xa084, 0xffef, 0x600a, 0x0078,
815 0x3373, 0x78e4, 0xa005, 0x00d0, 0x2944, 0x0018, 0x2438, 0x2008,
816 0xa084, 0x0030, 0x00c0, 0x2930, 0x781b, 0x004f, 0x0078, 0x2438,
817 0x78ec, 0xa084, 0x0003, 0x0040, 0x292c, 0x2100, 0xa084, 0x0007,
818 0x0079, 0x293a, 0x297d, 0x2988, 0x296e, 0x2942, 0x38b9, 0x38b9,
819 0x2942, 0x2997, 0x1078, 0x23ca, 0x7000, 0xa086, 0x0004, 0x00c0,
820 0x295e, 0x706c, 0xa086, 0x0002, 0x00c0, 0x2954, 0x2011, 0x0002,
821 0x2019, 0x0000, 0x0078, 0x2827, 0x706c, 0xa086, 0x0006, 0x0040,
822 0x294e, 0x706c, 0xa086, 0x0004, 0x0040, 0x294e, 0x79e4, 0xa184,
823 0x0030, 0x0040, 0x2968, 0x78ec, 0xa084, 0x0003, 0x00c0, 0x296a,
824 0x0078, 0x2f43, 0x2001, 0x0003, 0x0078, 0x2cd7, 0x6818, 0xa084,
825 0x8000, 0x0040, 0x2975, 0x681b, 0x001d, 0x1078, 0x368f, 0x782b,
826 0x3008, 0x781b, 0x0056, 0x0078, 0x2438, 0x6818, 0xa084, 0x8000,
827 0x0040, 0x2984, 0x681b, 0x001d, 0x1078, 0x368f, 0x0078, 0x3884,
828 0x6818, 0xa084, 0x8000, 0x0040, 0x298f, 0x681b, 0x001d, 0x1078,
829 0x368f, 0x782b, 0x3008, 0x781b, 0x00d2, 0x0078, 0x2438, 0x6818,
830 0xa084, 0x8000, 0x0040, 0x299e, 0x681b, 0x001d, 0x1078, 0x368f,
831 0x782b, 0x3008, 0x781b, 0x0093, 0x0078, 0x2438, 0xa584, 0x000f,
832 0x00c0, 0x29c3, 0x7000, 0x0079, 0x29ad, 0x2461, 0x29b7, 0x29b5,
833 0x3373, 0x3373, 0x3373, 0x3373, 0x29b5, 0x1078, 0x23ca, 0x1078,
834 0x33c4, 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x3366, 0x0040,
835 0x3373, 0x0078, 0x2573, 0x78e4, 0xa005, 0x00d0, 0x2944, 0x0018,
836 0x2944, 0x2008, 0xa084, 0x0030, 0x00c0, 0x29d2, 0x781b, 0x004f,
837 0x0078, 0x2438, 0x78ec, 0xa084, 0x0003, 0x0040, 0x29ce, 0x2100,
838 0xa184, 0x0007, 0x0079, 0x29dc, 0x29ee, 0x29f2, 0x29e6, 0x29e4,
839 0x38b9, 0x38b9, 0x29e4, 0x38af, 0x1078, 0x23ca, 0x1078, 0x3697,
840 0x782b, 0x3008, 0x781b, 0x0056, 0x0078, 0x2438, 0x1078, 0x3697,
841 0x0078, 0x3884, 0x1078, 0x3697, 0x782b, 0x3008, 0x781b, 0x00d2,
842 0x0078, 0x2438, 0x1078, 0x3697, 0x782b, 0x3008, 0x781b, 0x0093,
843 0x0078, 0x2438, 0x2300, 0x0079, 0x2a05, 0x2a0a, 0x2a08, 0x2a0c,
844 0x1078, 0x23ca, 0x0078, 0x3081, 0x681b, 0x0008, 0x78a3, 0x0000,
845 0x79e4, 0xa184, 0x0030, 0x0040, 0x3081, 0x78ec, 0xa084, 0x0003,
846 0x0040, 0x3081, 0xa184, 0x0007, 0x0079, 0x2a1e, 0x2a26, 0x29f2,
847 0x296e, 0x3854, 0x38b9, 0x38b9, 0x2a26, 0x38af, 0x1078, 0x3868,
848 0x0078, 0x2438, 0xa282, 0x0005, 0x0050, 0x2a30, 0x1078, 0x23ca,
849 0x2300, 0x0079, 0x2a33, 0x2a36, 0x2c84, 0x2c92, 0x2200, 0x0079,
850 0x2a39, 0x2a53, 0x2a40, 0x2a53, 0x2a3e, 0x2c69, 0x1078, 0x23ca,
851 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa082, 0x0020, 0x0048,
852 0x366b, 0xa08a, 0x0004, 0x00c8, 0x366b, 0x0079, 0x2a4f, 0x366b,
853 0x366b, 0x366b, 0x3619, 0x789b, 0x0018, 0x79a8, 0xa184, 0x0080,
854 0x0040, 0x2a64, 0x0078, 0x366b, 0x7000, 0xa005, 0x00c0, 0x2a5a,
855 0x2011, 0x0004, 0x0078, 0x31f5, 0xa184, 0x00ff, 0xa08a, 0x0010,
856 0x00c8, 0x366b, 0x0079, 0x2a6c, 0x2a7e, 0x2a7c, 0x2a96, 0x2a9a,
857 0x2b55, 0x366b, 0x366b, 0x2b57, 0x366b, 0x366b, 0x2c65, 0x2c65,
858 0x366b, 0x366b, 0x366b, 0x2c67, 0x1078, 0x23ca, 0xa684, 0x1000,
859 0x0040, 0x2a8b, 0x2001, 0x0500, 0x8000, 0x8000, 0x783a, 0x781b,
860 0x0091, 0x0078, 0x2438, 0x6818, 0xa084, 0x8000, 0x0040, 0x2a94,
861 0x681b, 0x001d, 0x0078, 0x2a82, 0x0078, 0x3854, 0x681b, 0x001d,
862 0x0078, 0x367b, 0x6920, 0x6922, 0xa684, 0x1800, 0x00c0, 0x2adb,
863 0x6820, 0xa084, 0x0001, 0x00c0, 0x2ae1, 0x6818, 0xa086, 0x0008,
864 0x00c0, 0x2aac, 0x681b, 0x0000, 0xa684, 0x0400, 0x0040, 0x2b51,
865 0xa684, 0x0080, 0x0040, 0x2ad7, 0x7097, 0x0000, 0x6818, 0xa084,
866 0x003f, 0xa08a, 0x000d, 0x0050, 0x2ad7, 0xa08a, 0x000c, 0x7196,
867 0x2001, 0x000c, 0x800c, 0x719a, 0x789b, 0x0061, 0x78aa, 0x157e,
868 0x137e, 0x147e, 0x20a1, 0x012b, 0x789b, 0x0000, 0x8000, 0x80ac,
869 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 0x781b,
870 0x0058, 0x0078, 0x2438, 0xa684, 0x1000, 0x0040, 0x2ae1, 0x0078,
871 0x2438, 0xa684, 0x0060, 0x0040, 0x2b4d, 0xa684, 0x0800, 0x0040,
872 0x2b4d, 0xa684, 0x8000, 0x00c0, 0x2aef, 0x0078, 0x2b09, 0xa6b4,
873 0x7fff, 0x7e5a, 0x6eb6, 0x789b, 0x0076, 0x7aac, 0x79ac, 0x78ac,
874 0x801b, 0x00c8, 0x2afc, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291,
875 0x0000, 0x6b98, 0x2100, 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303,
876 0x68ae, 0xa684, 0x4000, 0x0040, 0x2b11, 0xa6b4, 0xbfff, 0x7e5a,
877 0x6eb6, 0x7000, 0xa086, 0x0003, 0x00c0, 0x2b1e, 0x1078, 0x46e9,
878 0x1078, 0x48e6, 0x781b, 0x0064, 0x0078, 0x2438, 0xa006, 0x1078,
879 0x49ed, 0x6ab0, 0x69ac, 0x6c98, 0x6b94, 0x2200, 0xa105, 0x0040,
880 0x2b2d, 0x2200, 0xa422, 0x2100, 0xa31b, 0x6caa, 0x7cd2, 0x7cda,
881 0x6ba6, 0x7bd6, 0x7bde, 0x2300, 0xa405, 0x00c0, 0x2b3f, 0xa6b5,
882 0x4000, 0x7e5a, 0x6eb6, 0x781b, 0x0064, 0x0078, 0x2438, 0x781b,
883 0x0064, 0x2200, 0xa115, 0x00c0, 0x2b49, 0x1078, 0x48f7, 0x0078,
884 0x2438, 0x1078, 0x4942, 0x0078, 0x2438, 0x781b, 0x0065, 0x0078,
885 0x2438, 0x781b, 0x0058, 0x0078, 0x2438, 0x1078, 0x23ca, 0x0078,
886 0x2bb8, 0x6920, 0xa184, 0x0100, 0x0040, 0x2b6f, 0xa18c, 0xfeff,
887 0x6922, 0x0c7e, 0x7054, 0x2060, 0x6000, 0xa084, 0xefff, 0x6002,
888 0x6004, 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x0078, 0x2ba7, 0xa184,
889 0x0200, 0x0040, 0x2ba7, 0xa18c, 0xfdff, 0x6922, 0x0c7e, 0x7054,
890 0x2060, 0x6000, 0xa084, 0xdfff, 0x6002, 0x6004, 0xa084, 0xffef,
891 0x6006, 0x2008, 0x2c48, 0x0c7f, 0xa184, 0x0008, 0x0040, 0x2ba7,
892 0x1078, 0x37b9, 0x1078, 0x34c7, 0x88ff, 0x0040, 0x2ba7, 0x789b,
893 0x0060, 0x2800, 0x78aa, 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684,
894 0x0400, 0x00c0, 0x2ba1, 0x782b, 0x3008, 0x781b, 0x0056, 0x0078,
895 0x2438, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x7e58,
896 0xa684, 0x0400, 0x00c0, 0x2bb0, 0x781b, 0x0058, 0x0078, 0x2438,
897 0x781b, 0x0065, 0x0078, 0x2438, 0x0078, 0x3673, 0x0078, 0x3673,
898 0x2019, 0x0000, 0x7990, 0xa18c, 0x0007, 0x0040, 0x2bb6, 0x789b,
899 0x0010, 0x78a8, 0xa094, 0x00ff, 0xa286, 0x0001, 0x00c0, 0x2bf6,
900 0x2300, 0x7ca8, 0xa400, 0x2018, 0xa102, 0x0040, 0x2bee, 0x0048,
901 0x2bd3, 0x0078, 0x2bf0, 0xa380, 0x0002, 0xa102, 0x00c8, 0x2bee,
902 0x6920, 0xa18c, 0xfcff, 0x6922, 0x0c7e, 0x7054, 0x2060, 0x6000,
903 0xa084, 0xefef, 0x6002, 0x6004, 0xa084, 0xffe5, 0x6006, 0x0c7f,
904 0x7e58, 0xa6b4, 0xfffb, 0x7e5a, 0x0078, 0x2ba8, 0x0078, 0x2b59,
905 0x24a8, 0x7aa8, 0x00f0, 0x2bf0, 0x0078, 0x2bc1, 0xa284, 0x00f0,
906 0xa086, 0x0020, 0x00c0, 0x2c56, 0x8318, 0x8318, 0x2300, 0xa102,
907 0x0040, 0x2c06, 0x0048, 0x2c06, 0x0078, 0x2c53, 0xa286, 0x0023,
908 0x0040, 0x2bb6, 0x681c, 0xa084, 0xfff1, 0x681e, 0x7e58, 0xa684,
909 0xfff1, 0xa085, 0x0010, 0x2030, 0x7e5a, 0x6008, 0xa085, 0x0010,
910 0x600a, 0x0c7e, 0x7054, 0x2060, 0x6004, 0x2008, 0x2c48, 0x0c7f,
911 0xa184, 0x0010, 0x0040, 0x2c2a, 0x1078, 0x37b9, 0x1078, 0x35d6,
912 0x0078, 0x2c39, 0x0c7e, 0x7054, 0x2060, 0x6004, 0x2008, 0x2c48,
913 0x0c7f, 0xa184, 0x0008, 0x0040, 0x2ba7, 0x1078, 0x37b9, 0x1078,
914 0x34c7, 0x88ff, 0x0040, 0x2ba7, 0x789b, 0x0060, 0x2800, 0x78aa,
915 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x2c4d, 0x782b,
916 0x3008, 0x781b, 0x0056, 0x0078, 0x2438, 0x782b, 0x3008, 0x781b,
917 0x0065, 0x0078, 0x2438, 0x7aa8, 0x0078, 0x2bc1, 0x8318, 0x2300,
918 0xa102, 0x0040, 0x2c5f, 0x0048, 0x2c5f, 0x0078, 0x2bc1, 0xa284,
919 0x0080, 0x00c0, 0x367b, 0x0078, 0x3673, 0x0078, 0x367b, 0x0078,
920 0x366b, 0x789b, 0x0018, 0x78a8, 0xa084, 0x00ff, 0xa08e, 0x0001,
921 0x0040, 0x2c74, 0x1078, 0x23ca, 0x7aa8, 0xa294, 0x00ff, 0x78a8,
922 0xa084, 0x00ff, 0xa08a, 0x0004, 0x00c8, 0x366b, 0x0079, 0x2c80,
923 0x366b, 0x3414, 0x366b, 0x356b, 0xa282, 0x0000, 0x00c0, 0x2c8a,
924 0x1078, 0x23ca, 0x1078, 0x368f, 0x782b, 0x3008, 0x781b, 0x0065,
925 0x0078, 0x2438, 0xa282, 0x0003, 0x00c0, 0x2c98, 0x1078, 0x23ca,
926 0xa484, 0x8000, 0x00c0, 0x2cbb, 0x706c, 0xa005, 0x0040, 0x2ca2,
927 0x1078, 0x23ca, 0x6f14, 0x7782, 0xa7bc, 0x0f00, 0x1078, 0x37bd,
928 0x6008, 0xa085, 0x0021, 0x600a, 0x8738, 0xa784, 0x001f, 0x00c0,
929 0x2ca6, 0x1078, 0x3693, 0x706f, 0x0002, 0x2009, 0x5038, 0x200b,
930 0x0009, 0x0078, 0x2cbd, 0x1078, 0x369f, 0x782b, 0x3008, 0x781b,
931 0x0065, 0x0078, 0x2438, 0xa282, 0x0004, 0x0050, 0x2cc9, 0x1078,
932 0x23ca, 0x2300, 0x0079, 0x2ccc, 0x2ccf, 0x2db8, 0x2deb, 0xa286,
933 0x0003, 0x0040, 0x2cd5, 0x1078, 0x23ca, 0x2001, 0x0000, 0x007e,
934 0x68c0, 0xa005, 0x0040, 0x2cde, 0x7003, 0x0003, 0x68a0, 0xa084,
935 0x2000, 0x0040, 0x2ce7, 0x6008, 0xa085, 0x0002, 0x600a, 0x007f,
936 0x703e, 0x7000, 0xa084, 0x0007, 0x0079, 0x2cee, 0x2461, 0x2cf8,
937 0x2cf8, 0x2eed, 0x2f29, 0x2461, 0x2f29, 0x2cf6, 0x1078, 0x23ca,
938 0xa684, 0x1000, 0x00c0, 0x2d00, 0x1078, 0x4633, 0x0040, 0x2d92,
939 0x7868, 0xa08c, 0x00ff, 0x0040, 0x2d48, 0xa186, 0x0008, 0x00c0,
940 0x2d17, 0x1078, 0x33c4, 0x6008, 0xa084, 0xffef, 0x600a, 0x1078,
941 0x3366, 0x0040, 0x2d48, 0x1078, 0x4633, 0x0078, 0x2d2f, 0xa186,
942 0x0028, 0x00c0, 0x2d48, 0x1078, 0x4633, 0x6008, 0xa084, 0xffef,
943 0x600a, 0x6018, 0xa005, 0x0040, 0x2d2f, 0x8001, 0x601a, 0xa005,
944 0x0040, 0x2d2f, 0x8001, 0xa005, 0x0040, 0x2d2f, 0x601e, 0x6820,
945 0xa084, 0x0001, 0x0040, 0x2461, 0x6820, 0xa084, 0xfffe, 0x6822,
946 0x7060, 0x0c7e, 0x2060, 0x6800, 0x6002, 0x0c7f, 0x6004, 0x6802,
947 0xa005, 0x2d00, 0x00c0, 0x2d45, 0x6002, 0x6006, 0x0078, 0x2461,
948 0x017e, 0x1078, 0x2e1c, 0x017f, 0xa684, 0xdf00, 0x681e, 0x682b,
949 0x0000, 0x6f14, 0x81ff, 0x0040, 0x2d92, 0xa186, 0x0002, 0x00c0,
950 0x2d92, 0xa684, 0x0800, 0x00c0, 0x2d65, 0xa684, 0x0060, 0x0040,
951 0x2d65, 0x78d8, 0x7adc, 0x682e, 0x6a32, 0x6820, 0xa084, 0x0800,
952 0x00c0, 0x2d92, 0x8717, 0xa294, 0x000f, 0x8213, 0x8213, 0x8213,
953 0xa290, 0x5280, 0xa290, 0x0000, 0x221c, 0xa384, 0x0100, 0x00c0,
954 0x2d7b, 0x0078, 0x2d81, 0x8210, 0x2204, 0xa085, 0x0018, 0x2012,
955 0x8211, 0xa384, 0x0400, 0x0040, 0x2d8e, 0x68a0, 0xa084, 0x0100,
956 0x00c0, 0x2d8e, 0x1078, 0x2ea0, 0x0078, 0x2461, 0x6008, 0xa085,
957 0x0002, 0x600a, 0x6916, 0x6818, 0xa084, 0x8000, 0x0040, 0x2d9a,
958 0x703c, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x1078, 0x33b5, 0x1078,
959 0x33c4, 0x00c0, 0x2da7, 0x6008, 0xa084, 0xffef, 0x600a, 0x6820,
960 0xa084, 0x0001, 0x00c0, 0x2db0, 0x1078, 0x33ae, 0x0078, 0x2db4,
961 0x7060, 0x2060, 0x6800, 0x6002, 0x1078, 0x1c53, 0x0078, 0x2461,
962 0xa282, 0x0004, 0x0048, 0x2dbe, 0x1078, 0x23ca, 0x2200, 0x0079,
963 0x2dc1, 0x2dbc, 0x2dc5, 0x2dd2, 0x2dc5, 0x7000, 0xa086, 0x0005,
964 0x0040, 0x2dce, 0x1078, 0x368f, 0x782b, 0x3008, 0x781b, 0x0065,
965 0x0078, 0x2438, 0x7890, 0x8007, 0x8001, 0xa084, 0x0007, 0xa080,
966 0x0018, 0x789a, 0x79a8, 0xa18c, 0x00ff, 0xa186, 0x0003, 0x0040,
967 0x2de7, 0xa186, 0x0000, 0x0040, 0x2de7, 0x0078, 0x366b, 0x781b,
968 0x0065, 0x0078, 0x2438, 0x6820, 0xa085, 0x0004, 0x6822, 0x82ff,
969 0x00c0, 0x2df6, 0x1078, 0x368f, 0x0078, 0x2dfd, 0x8211, 0x0040,
970 0x2dfb, 0x1078, 0x23ca, 0x1078, 0x369f, 0x782b, 0x3008, 0x781b,
971 0x0065, 0x0078, 0x2438, 0x702c, 0x8003, 0x0048, 0x2e0d, 0x2019,
972 0x4c5b, 0x1078, 0x2255, 0x702f, 0x8000, 0x1078, 0x38de, 0x7830,
973 0xa084, 0x00c0, 0x00c0, 0x2e19, 0x0018, 0x2e19, 0x791a, 0xa006,
974 0x007c, 0xa085, 0x0001, 0x007c, 0xa684, 0x0060, 0x00c0, 0x2e26,
975 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x2e9f, 0xa684, 0x0800,
976 0x00c0, 0x2e48, 0x68b4, 0xa084, 0x4800, 0xa635, 0xa684, 0x0800,
977 0x00c0, 0x2e48, 0x6998, 0x6a94, 0x692e, 0x6a32, 0x703c, 0xa005,
978 0x00c0, 0x2e40, 0x2200, 0xa105, 0x0040, 0x2e47, 0x703f, 0x0015,
979 0x7000, 0xa086, 0x0006, 0x0040, 0x2e47, 0x1078, 0x4633, 0x007c,
980 0xa684, 0x0020, 0x0040, 0x2e6a, 0xa684, 0x4000, 0x0040, 0x2e56,
981 0x682f, 0x0000, 0x6833, 0x0000, 0x0078, 0x2e40, 0x68b4, 0xa084,
982 0x4800, 0xa635, 0xa684, 0x4000, 0x00c0, 0x2e50, 0x703c, 0xa005,
983 0x00c0, 0x2e64, 0x703f, 0x0015, 0x79d8, 0x7adc, 0x692e, 0x6a32,
984 0x0078, 0x2e40, 0xa684, 0x4000, 0x0040, 0x2e74, 0x682f, 0x0000,
985 0x6833, 0x0000, 0x0078, 0x2e40, 0x68b4, 0xa084, 0x4800, 0xa635,
986 0xa684, 0x4000, 0x00c0, 0x2e6e, 0x703c, 0xa005, 0x00c0, 0x2e82,
987 0x703f, 0x0015, 0x79d8, 0x7adc, 0x78d0, 0x80fb, 0x00c8, 0x2e89,
988 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x692e, 0x6a32,
989 0x2100, 0xa205, 0x00c0, 0x2e96, 0x0078, 0x2e40, 0x7000, 0xa086,
990 0x0006, 0x0040, 0x2e9f, 0x1078, 0x49ed, 0x0078, 0x2e40, 0x007c,
991 0x6008, 0xa085, 0x0200, 0x600a, 0xa384, 0x0200, 0x0040, 0x2eac,
992 0x6008, 0xa085, 0x0002, 0x600a, 0x681b, 0x0006, 0x688f, 0x0000,
993 0x6893, 0x0000, 0x6a30, 0x692c, 0x6a3e, 0x6942, 0x682f, 0x0003,
994 0x6833, 0x0000, 0x6837, 0x0020, 0x6897, 0x0000, 0x689b, 0x0020,
995 0x68b3, 0x0000, 0x68af, 0x0000, 0x7000, 0x0079, 0x2ec7, 0x2461,
996 0x2ed1, 0x2eda, 0x2ecf, 0x2ecf, 0x2ecf, 0x2ecf, 0x2ecf, 0x1078,
997 0x23ca, 0x6820, 0xa084, 0x0001, 0x00c0, 0x2eda, 0x1078, 0x33ae,
998 0x0078, 0x2ee0, 0x7060, 0x2c50, 0x2060, 0x6800, 0x6002, 0x2a60,
999 0x2021, 0x505a, 0x2404, 0xa005, 0x0040, 0x2ee9, 0x2020, 0x0078,
1000 0x2ee2, 0x2d22, 0x206b, 0x0000, 0x007c, 0x1078, 0x33b5, 0x1078,
1001 0x33c4, 0x6008, 0xa084, 0xfdff, 0x600a, 0x682b, 0x0000, 0x789b,
1002 0x000e, 0x6f14, 0x6817, 0x0002, 0x1078, 0x4a35, 0xa684, 0x0800,
1003 0x0040, 0x2f06, 0x691c, 0xa18d, 0x2000, 0x691e, 0x6818, 0xa084,
1004 0x8000, 0x0040, 0x2f16, 0x7868, 0xa08c, 0x00ff, 0x0040, 0x2f14,
1005 0x681b, 0x001e, 0x0078, 0x2f16, 0x681b, 0x0000, 0x2021, 0x505a,
1006 0x2404, 0xad06, 0x0040, 0x2f1d, 0x7460, 0x6800, 0x2022, 0x68c3,
1007 0x0000, 0x6a3c, 0x6940, 0x6a32, 0x692e, 0x1078, 0x1c53, 0x0078,
1008 0x2461, 0x1078, 0x2e1c, 0x682b, 0x0000, 0x2001, 0x000e, 0x6f14,
1009 0x1078, 0x38e4, 0xa08c, 0x00ff, 0x6916, 0x6818, 0xa084, 0x8000,
1010 0x0040, 0x2f3c, 0x703c, 0x681a, 0xa68c, 0xdf00, 0x691e, 0x706f,
1011 0x0000, 0x0078, 0x2461, 0x7000, 0xa005, 0x00c0, 0x2f49, 0x0078,
1012 0x2461, 0xa006, 0x1078, 0x4633, 0x6817, 0x0000, 0x681b, 0x0014,
1013 0xa68c, 0xdf00, 0x691e, 0x682b, 0x0000, 0x6820, 0xa085, 0x00ff,
1014 0x6822, 0x7000, 0x0079, 0x2f5c, 0x2461, 0x2f66, 0x2f66, 0x2f68,
1015 0x2f68, 0x2f68, 0x2f68, 0x2f64, 0x1078, 0x23ca, 0x1078, 0x33c4,
1016 0x6008, 0xa084, 0xffef, 0x600a, 0x0078, 0x337e, 0x2300, 0x0079,
1017 0x2f71, 0x2f74, 0x2f76, 0x2faf, 0x1078, 0x23ca, 0x7000, 0x0079,
1018 0x2f79, 0x2461, 0x2f83, 0x2f83, 0x2f9e, 0x2f83, 0x2fab, 0x2f9e,
1019 0x2f81, 0x1078, 0x23ca, 0xa684, 0x0060, 0xa086, 0x0060, 0x00c0,
1020 0x2f9a, 0xa6b4, 0xffdf, 0xa6b4, 0xbfff, 0xa6b5, 0x2000, 0x7e5a,
1021 0x681c, 0xa084, 0xffdf, 0x681e, 0x1078, 0x4633, 0x1078, 0x48f7,
1022 0x0078, 0x3854, 0xa684, 0x2000, 0x0040, 0x2f8d, 0x6818, 0xa084,
1023 0x8000, 0x0040, 0x2fab, 0x681b, 0x0015, 0xa684, 0x4000, 0x0040,
1024 0x2fab, 0x681b, 0x0007, 0x1078, 0x3868, 0x0078, 0x2438, 0x1078,
1025 0x23ca, 0x2300, 0x0079, 0x2fb4, 0x2fb7, 0x2fb9, 0x2fec, 0x1078,
1026 0x23ca, 0x7000, 0x0079, 0x2fbc, 0x2461, 0x2fc6, 0x2fc6, 0x2fe1,
1027 0x2fc6, 0x2fe8, 0x2fe1, 0x2fc4, 0x1078, 0x23ca, 0xa684, 0x0060,
1028 0xa086, 0x0060, 0x00c0, 0x2fdd, 0xa6b4, 0xffbf, 0xa6b4, 0xbfff,
1029 0xa6b5, 0x2000, 0x7e5a, 0x681c, 0xa084, 0xffbf, 0x681e, 0x1078,
1030 0x4633, 0x1078, 0x48f7, 0x0078, 0x3854, 0xa684, 0x2000, 0x0040,
1031 0x2fd0, 0x6818, 0xa084, 0x8000, 0x0040, 0x2fe8, 0x681b, 0x0007,
1032 0x781b, 0x00d2, 0x0078, 0x2438, 0x6820, 0xa085, 0x0004, 0x6822,
1033 0x1078, 0x381f, 0xa6b5, 0x0800, 0x1078, 0x368f, 0x782b, 0x3008,
1034 0x781b, 0x0065, 0x0078, 0x2438, 0x2300, 0x0079, 0x2fff, 0x3002,
1035 0x3004, 0x3006, 0x1078, 0x23ca, 0x0078, 0x367b, 0xa684, 0x0400,
1036 0x00c0, 0x302f, 0x79e4, 0xa184, 0x0020, 0x0040, 0x3016, 0x78ec,
1037 0xa084, 0x0003, 0x0040, 0x3016, 0x782b, 0x3009, 0x789b, 0x0060,
1038 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, 0x79e4, 0xa184, 0x0020,
1039 0x0040, 0x3027, 0x78ec, 0xa084, 0x0003, 0x00c0, 0x302b, 0x2001,
1040 0x0014, 0x0078, 0x2cd7, 0xa184, 0x0007, 0x0079, 0x3067, 0x7a90,
1041 0xa294, 0x0007, 0x789b, 0x0060, 0x79a8, 0x81ff, 0x0040, 0x3065,
1042 0x789b, 0x0010, 0x7ba8, 0xa384, 0x0001, 0x00c0, 0x3056, 0x7ba8,
1043 0x7ba8, 0xa386, 0x0001, 0x00c0, 0x3049, 0x2009, 0xfff7, 0x0078,
1044 0x304f, 0xa386, 0x0003, 0x00c0, 0x3056, 0x2009, 0xffef, 0x0c7e,
1045 0x7054, 0x2060, 0x6004, 0xa104, 0x6006, 0x0c7f, 0x789b, 0x0060,
1046 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, 0x782b, 0x3009, 0x6920,
1047 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x6922, 0x0078, 0x3854, 0x297d,
1048 0x2988, 0x3071, 0x3079, 0x306f, 0x306f, 0x3854, 0x3854, 0x1078,
1049 0x23ca, 0x6920, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x6922, 0x0078,
1050 0x385e, 0x6920, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x6922, 0x0078,
1051 0x3854, 0x79e4, 0xa184, 0x0030, 0x0040, 0x308b, 0x78ec, 0xa084,
1052 0x0003, 0x00c0, 0x30b2, 0x7000, 0xa086, 0x0004, 0x00c0, 0x30a5,
1053 0x706c, 0xa086, 0x0002, 0x00c0, 0x309b, 0x2011, 0x0002, 0x2019,
1054 0x0000, 0x0078, 0x2827, 0x706c, 0xa086, 0x0006, 0x0040, 0x3095,
1055 0x706c, 0xa086, 0x0004, 0x0040, 0x3095, 0x7000, 0xa086, 0x0000,
1056 0x0040, 0x2438, 0x6818, 0xa085, 0x8000, 0x681a, 0x2001, 0x0014,
1057 0x0078, 0x2cd7, 0xa184, 0x0007, 0x0079, 0x30b6, 0x3854, 0x3854,
1058 0x30be, 0x3854, 0x38b9, 0x38b9, 0x3854, 0x3854, 0xa684, 0x0080,
1059 0x0040, 0x30ed, 0x7194, 0x81ff, 0x0040, 0x30ed, 0xa182, 0x000d,
1060 0x00d0, 0x30ce, 0x7097, 0x0000, 0x0078, 0x30d3, 0xa182, 0x000c,
1061 0x7096, 0x2009, 0x000c, 0x789b, 0x0061, 0x79aa, 0x157e, 0x137e,
1062 0x147e, 0x7098, 0x8114, 0xa210, 0x729a, 0xa080, 0x000b, 0xad00,
1063 0x2098, 0x20a1, 0x012b, 0x789b, 0x0000, 0x8108, 0x81ac, 0x53a6,
1064 0x147f, 0x137f, 0x157f, 0x0078, 0x385e, 0xa684, 0x0400, 0x00c0,
1065 0x312e, 0x6820, 0xa084, 0x0001, 0x0040, 0x385e, 0xa68c, 0x0060,
1066 0xa684, 0x0060, 0x0040, 0x3102, 0xa086, 0x0060, 0x00c0, 0x3102,
1067 0xa18d, 0x4000, 0xa18c, 0xfffb, 0x795a, 0x69b6, 0x789b, 0x0060,
1068 0x78ab, 0x0000, 0x789b, 0x0061, 0x6818, 0xa085, 0x8000, 0x681a,
1069 0x78aa, 0x8008, 0x810c, 0x0040, 0x33dd, 0xa18c, 0x00f8, 0x00c0,
1070 0x33dd, 0x157e, 0x137e, 0x147e, 0x20a1, 0x012b, 0x789b, 0x0000,
1071 0x8000, 0x80ac, 0xad80, 0x000b, 0x2098, 0x53a6, 0x147f, 0x137f,
1072 0x157f, 0x6814, 0x8007, 0x7882, 0x0078, 0x385e, 0x6818, 0xa084,
1073 0x8000, 0x0040, 0x3135, 0x681b, 0x0008, 0x781b, 0x00c8, 0x0078,
1074 0x2438, 0x2300, 0x0079, 0x313c, 0x3141, 0x31e0, 0x313f, 0x1078,
1075 0x23ca, 0x7000, 0xa084, 0x0007, 0x0079, 0x3146, 0x2461, 0x3150,
1076 0x3185, 0x315b, 0x314e, 0x2461, 0x314e, 0x314e, 0x1078, 0x23ca,
1077 0x681c, 0xa084, 0x2000, 0x0040, 0x3169, 0x6008, 0xa085, 0x0002,
1078 0x600a, 0x0078, 0x3169, 0x68c0, 0xa005, 0x00c0, 0x3185, 0x6920,
1079 0xa18d, 0x0001, 0x6922, 0x68c3, 0x0001, 0x6800, 0x706a, 0x0078,
1080 0x317f, 0x6920, 0xa18d, 0x0001, 0x6922, 0x6800, 0x6006, 0xa005,
1081 0x00c0, 0x3173, 0x6002, 0x681c, 0xa084, 0x000e, 0x0040, 0x317f,
1082 0x7014, 0x68ba, 0x7130, 0xa188, 0x7300, 0x0078, 0x3181, 0x2009,
1083 0x7400, 0x2104, 0x6802, 0x2d0a, 0x7162, 0x6eb6, 0xa684, 0x0060,
1084 0x0040, 0x31de, 0xa684, 0x0800, 0x00c0, 0x3199, 0xa684, 0x7fff,
1085 0x68b6, 0x6894, 0x68a6, 0x6898, 0x68aa, 0x1078, 0x4633, 0x0078,
1086 0x31de, 0xa684, 0x0020, 0x0040, 0x31ae, 0x68c0, 0xa005, 0x0040,
1087 0x31a5, 0x1078, 0x4a35, 0x0078, 0x31a8, 0xa006, 0x1078, 0x49ed,
1088 0x79d8, 0x7adc, 0x69aa, 0x6aa6, 0x0078, 0x31b4, 0x1078, 0x37ca,
1089 0x69aa, 0x6aa6, 0x1078, 0x49ed, 0xa684, 0x8000, 0x0040, 0x31de,
1090 0xa684, 0x7fff, 0x68b6, 0x2001, 0x0076, 0x1078, 0x38e4, 0x2010,
1091 0x2001, 0x0078, 0x1078, 0x38e4, 0x2008, 0xa684, 0x0020, 0x00c0,
1092 0x31d6, 0x2001, 0x007a, 0x1078, 0x38e4, 0x801b, 0x00c8, 0x31d1,
1093 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b98, 0x2100,
1094 0xa302, 0x68b2, 0x6b94, 0x2200, 0xa303, 0x68ae, 0x0078, 0x2461,
1095 0x0078, 0x367b, 0x7037, 0x0000, 0xa282, 0x0006, 0x0050, 0x31ea,
1096 0x1078, 0x23ca, 0x7000, 0xa084, 0x0007, 0x10c0, 0x398a, 0x2300,
1097 0x0079, 0x31f2, 0x31f5, 0x321e, 0x3232, 0x2200, 0x0079, 0x31f8,
1098 0x321c, 0x367b, 0x31fe, 0x321c, 0x324e, 0x3290, 0x7003, 0x0005,
1099 0x2001, 0x7510, 0x2068, 0x704a, 0x157e, 0x20a9, 0x0031, 0x2003,
1100 0x0000, 0x8000, 0x0070, 0x320e, 0x0078, 0x3207, 0x157f, 0xad80,
1101 0x0009, 0x7036, 0x6817, 0x0000, 0x68b7, 0x0700, 0x6823, 0x0800,
1102 0x6827, 0x0003, 0x0078, 0x366b, 0x1078, 0x23ca, 0x7003, 0x0005,
1103 0x2001, 0x7510, 0x2068, 0x704a, 0xad80, 0x0009, 0x7036, 0x2200,
1104 0x0079, 0x322a, 0x367b, 0x3230, 0x3230, 0x324e, 0x3230, 0x367b,
1105 0x1078, 0x23ca, 0x7003, 0x0005, 0x2001, 0x7510, 0x2068, 0x704a,
1106 0xad80, 0x0009, 0x7036, 0x2200, 0x0079, 0x323e, 0x3246, 0x3244,
1107 0x3244, 0x3246, 0x3244, 0x3246, 0x1078, 0x23ca, 0x1078, 0x369f,
1108 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x7003, 0x0002,
1109 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, 0xa484, 0x001f,
1110 0xa215, 0x2069, 0x7400, 0x2d04, 0x2d08, 0x7162, 0x2068, 0xa005,
1111 0x0040, 0x3269, 0x6814, 0xa206, 0x0040, 0x3285, 0x6800, 0x0078,
1112 0x325c, 0x7003, 0x0005, 0x2001, 0x7510, 0x2068, 0x704a, 0x7036,
1113 0x157e, 0x20a9, 0x0031, 0x2003, 0x0000, 0x8000, 0x0070, 0x327a,
1114 0x0078, 0x3273, 0x157f, 0xad80, 0x0009, 0x7036, 0x6a16, 0x68b7,
1115 0x0700, 0x6823, 0x0800, 0x6827, 0x0003, 0x6eb4, 0x7e5a, 0x6820,
1116 0xa084, 0x0c00, 0x0040, 0x32df, 0x1078, 0x3697, 0x0078, 0x32df,
1117 0x7003, 0x0002, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8,
1118 0xa484, 0x001f, 0xa215, 0x79a8, 0x79a8, 0xa18c, 0x00ff, 0xa1e8,
1119 0x7300, 0x2d04, 0x2d08, 0x7162, 0x2068, 0xa005, 0x0040, 0x32af,
1120 0x6814, 0xa206, 0x0040, 0x32ca, 0x6800, 0x0078, 0x32a2, 0x7003,
1121 0x0005, 0x2001, 0x7510, 0x2068, 0x704a, 0x157e, 0x20a9, 0x0031,
1122 0x2003, 0x0000, 0x8000, 0x0070, 0x32bf, 0x0078, 0x32b8, 0x157f,
1123 0xad80, 0x0009, 0x7036, 0x6a16, 0x68b7, 0x0700, 0x6823, 0x0800,
1124 0x6827, 0x0003, 0x6eb4, 0x7e5a, 0x6820, 0xa084, 0x0c00, 0x0040,
1125 0x32df, 0xa084, 0x0800, 0x0040, 0x32d9, 0x1078, 0x369b, 0x0078,
1126 0x32df, 0x1078, 0x3697, 0x708b, 0x0000, 0x0078, 0x32df, 0x027e,
1127 0x8207, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x5280,
1128 0x2060, 0x7056, 0x6000, 0x705a, 0x6004, 0x705e, 0xa684, 0x0060,
1129 0x0040, 0x3337, 0x6b98, 0x6c94, 0x69ac, 0x68b0, 0xa105, 0x00c0,
1130 0x3319, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0xa6b4, 0xb7ff, 0x7e5a,
1131 0xa684, 0x0060, 0xa086, 0x0060, 0x0040, 0x3337, 0x68c0, 0xa005,
1132 0x0040, 0x3312, 0x7003, 0x0003, 0x682b, 0x0000, 0x1078, 0x48e6,
1133 0x0078, 0x3314, 0x1078, 0x48f7, 0xa6b5, 0x2000, 0x7e5a, 0x0078,
1134 0x3337, 0x68b0, 0xa31a, 0x2100, 0xa423, 0x2400, 0xa305, 0x0040,
1135 0x3337, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0x68b0, 0xa6b4, 0xbfff,
1136 0x7e5a, 0x007e, 0x68c0, 0xa005, 0x007f, 0x0040, 0x3335, 0x7003,
1137 0x0003, 0x1078, 0x48e6, 0x0078, 0x3337, 0x1078, 0x4942, 0x077f,
1138 0x1078, 0x37bd, 0x2009, 0x0065, 0xa684, 0x0004, 0x0040, 0x3358,
1139 0x78e4, 0xa084, 0x0030, 0x0040, 0x3350, 0x78ec, 0xa084, 0x0003,
1140 0x0040, 0x3350, 0x782b, 0x3008, 0x2009, 0x0065, 0x0078, 0x3358,
1141 0x0f7e, 0x2079, 0x5000, 0x1078, 0x4633, 0x0f7f, 0x0040, 0x2461,
1142 0x791a, 0x2d00, 0x704a, 0x8207, 0xa084, 0x000f, 0x8003, 0x8003,
1143 0x8003, 0xa080, 0x5280, 0x2048, 0x0078, 0x2438, 0x6020, 0xa005,
1144 0x0040, 0x3372, 0x8001, 0x6022, 0x6008, 0xa085, 0x0008, 0x600a,
1145 0x7010, 0x6026, 0x007c, 0xa006, 0x1078, 0x4633, 0x6817, 0x0000,
1146 0x681b, 0x0001, 0x6823, 0x0040, 0x681f, 0x0100, 0x7000, 0xa084,
1147 0x0007, 0x0079, 0x3383, 0x2461, 0x338d, 0x338d, 0x33aa, 0x3395,
1148 0x3393, 0x3395, 0x338b, 0x1078, 0x23ca, 0x1078, 0x33b5, 0x1078,
1149 0x33ae, 0x1078, 0x1c53, 0x0078, 0x2461, 0x706c, 0x706f, 0x0000,
1150 0x7093, 0x0000, 0x0079, 0x339c, 0x33a6, 0x33a6, 0x33a4, 0x33a4,
1151 0x33a4, 0x33a6, 0x33a4, 0x33a6, 0x0079, 0x2840, 0x706f, 0x0000,
1152 0x0078, 0x2461, 0x681b, 0x0000, 0x0078, 0x2eed, 0x6800, 0xa005,
1153 0x00c0, 0x33b3, 0x6002, 0x6006, 0x007c, 0x6010, 0xa005, 0x0040,
1154 0x33be, 0x8001, 0x00d0, 0x33be, 0x1078, 0x23ca, 0x6012, 0x6008,
1155 0xa084, 0xffef, 0x600a, 0x007c, 0x6018, 0xa005, 0x0040, 0x33ca,
1156 0x8001, 0x601a, 0x007c, 0x1078, 0x38de, 0x681b, 0x0018, 0x0078,
1157 0x3401, 0x1078, 0x38de, 0x681b, 0x0019, 0x0078, 0x3401, 0x1078,
1158 0x38de, 0x681b, 0x001a, 0x0078, 0x3401, 0x1078, 0x38de, 0x681b,
1159 0x0003, 0x0078, 0x3401, 0x7780, 0x1078, 0x37bd, 0x7184, 0xa18c,
1160 0x00ff, 0xa1e8, 0x7300, 0x2d04, 0x2d08, 0x2068, 0xa005, 0x00c0,
1161 0x33f3, 0x0078, 0x2461, 0x6814, 0x7280, 0xa206, 0x0040, 0x33fb,
1162 0x6800, 0x0078, 0x33ec, 0x6800, 0x200a, 0x681b, 0x0005, 0x708b,
1163 0x0000, 0x1078, 0x33b5, 0x6820, 0xa084, 0x0001, 0x00c0, 0x340a,
1164 0x1078, 0x33ae, 0x1078, 0x33c4, 0x681f, 0x0000, 0x6823, 0x0020,
1165 0x1078, 0x1c53, 0x0078, 0x2461, 0xa282, 0x0003, 0x00c0, 0x366b,
1166 0x7da8, 0xa5ac, 0x00ff, 0x7ca8, 0xa4a4, 0x00ff, 0x6920, 0xa18d,
1167 0x0080, 0x6922, 0xa184, 0x0100, 0x0040, 0x3478, 0xa18c, 0xfeff,
1168 0x6922, 0xa4a4, 0x00ff, 0x0040, 0x3462, 0xa482, 0x000c, 0x0048,
1169 0x3435, 0x0040, 0x3435, 0x2021, 0x000c, 0x852b, 0x852b, 0x1078,
1170 0x372e, 0x0040, 0x343f, 0x1078, 0x3531, 0x0078, 0x346b, 0x1078,
1171 0x36e9, 0x0c7e, 0x2960, 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078,
1172 0x3558, 0x0c7f, 0x6920, 0xa18d, 0x0100, 0x6922, 0x7e58, 0xa6b5,
1173 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x345c, 0x782b, 0x3008,
1174 0x781b, 0x0056, 0x0078, 0x2438, 0x782b, 0x3008, 0x781b, 0x0065,
1175 0x0078, 0x2438, 0x0c7e, 0x2960, 0x6004, 0xa084, 0xfff5, 0x6006,
1176 0x1078, 0x3558, 0x0c7f, 0x7e58, 0xa684, 0x0400, 0x00c0, 0x3474,
1177 0x781b, 0x0058, 0x0078, 0x2438, 0x781b, 0x0065, 0x0078, 0x2438,
1178 0x0c7e, 0x7054, 0x2060, 0x6100, 0xa18c, 0x1000, 0x0040, 0x34b8,
1179 0x6208, 0x8217, 0xa294, 0x00ff, 0xa282, 0x000c, 0x0048, 0x348c,
1180 0x0040, 0x348c, 0x2011, 0x000c, 0x2400, 0xa202, 0x00c8, 0x3491,
1181 0x2220, 0x6208, 0xa294, 0x00ff, 0x7018, 0xa086, 0x0028, 0x00c0,
1182 0x34a1, 0xa282, 0x0019, 0x00c8, 0x34a7, 0x2011, 0x0019, 0x0078,
1183 0x34a7, 0xa282, 0x000c, 0x00c8, 0x34a7, 0x2011, 0x000c, 0x2200,
1184 0xa502, 0x00c8, 0x34ac, 0x2228, 0x1078, 0x36ed, 0x852b, 0x852b,
1185 0x1078, 0x372e, 0x0040, 0x34b8, 0x1078, 0x3531, 0x0078, 0x34bc,
1186 0x1078, 0x36e9, 0x1078, 0x3558, 0x7858, 0xa085, 0x0004, 0x785a,
1187 0x0c7f, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x0c7e,
1188 0x2960, 0x6000, 0xa084, 0x1000, 0x00c0, 0x34df, 0x6010, 0xa084,
1189 0x000f, 0x00c0, 0x34d9, 0x6104, 0xa18c, 0xfff5, 0x6106, 0x0c7f,
1190 0x007c, 0x2011, 0x0032, 0x2019, 0x0000, 0x0078, 0x3506, 0x68a0,
1191 0xa084, 0x0200, 0x00c0, 0x34d9, 0x6208, 0xa294, 0x00ff, 0x7018,
1192 0xa086, 0x0028, 0x00c0, 0x34f4, 0xa282, 0x0019, 0x00c8, 0x34fa,
1193 0x2011, 0x0019, 0x0078, 0x34fa, 0xa282, 0x000c, 0x00c8, 0x34fa,
1194 0x2011, 0x000c, 0x6308, 0x831f, 0xa39c, 0x00ff, 0xa382, 0x000c,
1195 0x0048, 0x3506, 0x0040, 0x3506, 0x2019, 0x000c, 0x78ab, 0x0001,
1196 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005,
1197 0x6820, 0xa085, 0x0100, 0x6822, 0x0c7f, 0x007c, 0x0c7e, 0x2960,
1198 0xa18c, 0xfff5, 0x6106, 0x2011, 0x0032, 0x2019, 0x0000, 0x0078,
1199 0x3521, 0x78ab, 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7aaa,
1200 0x7baa, 0xa8c0, 0x0005, 0x6820, 0xa085, 0x0100, 0x6822, 0x0c7f,
1201 0x007c, 0x0c7e, 0x7154, 0x2160, 0x1078, 0x3538, 0x0c7f, 0x007c,
1202 0x2008, 0xa084, 0xfff0, 0xa425, 0x7c86, 0x6018, 0x789a, 0x7cae,
1203 0x6412, 0x78a4, 0xa084, 0xfff8, 0xa18c, 0x0007, 0xa105, 0x78a6,
1204 0x6016, 0x788a, 0xa4a4, 0x000f, 0x8427, 0x8204, 0x8004, 0xa084,
1205 0x00ff, 0xa405, 0x600e, 0x6004, 0xa084, 0xfff5, 0x6006, 0x007c,
1206 0x0c7e, 0x7054, 0x2060, 0x1078, 0x355f, 0x0c7f, 0x007c, 0x6018,
1207 0x789a, 0x78a4, 0xa084, 0xfff0, 0x78a6, 0x6012, 0x7884, 0xa084,
1208 0xfff0, 0x7886, 0x007c, 0xa282, 0x0002, 0x00c0, 0x366b, 0x7aa8,
1209 0x6920, 0xa18d, 0x0080, 0x6922, 0xa184, 0x0200, 0x0040, 0x35b4,
1210 0xa18c, 0xfdff, 0x6922, 0xa294, 0x00ff, 0xa282, 0x0002, 0x00c8,
1211 0x366b, 0x1078, 0x35fd, 0x1078, 0x3558, 0xa980, 0x0001, 0x200c,
1212 0x1078, 0x37b9, 0x1078, 0x34c7, 0x88ff, 0x0040, 0x35a7, 0x789b,
1213 0x0060, 0x2800, 0x78aa, 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684,
1214 0x0400, 0x00c0, 0x35a1, 0x782b, 0x3008, 0x781b, 0x0056, 0x0078,
1215 0x2438, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x7e58,
1216 0xa684, 0x0400, 0x00c0, 0x35b0, 0x781b, 0x0058, 0x0078, 0x2438,
1217 0x781b, 0x0065, 0x0078, 0x2438, 0xa282, 0x0002, 0x00c8, 0x35bc,
1218 0xa284, 0x0001, 0x0040, 0x35c6, 0x7154, 0xa188, 0x0000, 0x210c,
1219 0xa18c, 0x2000, 0x00c0, 0x35c6, 0x2011, 0x0000, 0x1078, 0x36db,
1220 0x1078, 0x35fd, 0x1078, 0x3558, 0x7858, 0xa085, 0x0004, 0x785a,
1221 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x0c7e, 0x027e,
1222 0x2960, 0x6000, 0x2011, 0x0001, 0xa084, 0x2000, 0x00c0, 0x35ed,
1223 0x6014, 0xa084, 0x0040, 0x00c0, 0x35eb, 0xa18c, 0xffef, 0x6106,
1224 0xa006, 0x0078, 0x35fa, 0x2011, 0x0000, 0x78ab, 0x0001, 0x78ab,
1225 0x0002, 0x78ab, 0x0003, 0x7aaa, 0xa8c0, 0x0004, 0x6820, 0xa085,
1226 0x0200, 0x6822, 0x027f, 0x0c7f, 0x007c, 0x0c7e, 0x7054, 0x2060,
1227 0x1078, 0x3604, 0x0c7f, 0x007c, 0x82ff, 0x0040, 0x3609, 0x2011,
1228 0x0040, 0x6018, 0xa080, 0x0002, 0x789a, 0x78a4, 0xa084, 0xffbf,
1229 0xa205, 0x78a6, 0x788a, 0x6016, 0x6004, 0xa084, 0xffef, 0x6006,
1230 0x007c, 0x007e, 0x7000, 0xa086, 0x0003, 0x0040, 0x3622, 0x007f,
1231 0x0078, 0x3625, 0x007f, 0x0078, 0x3667, 0xa684, 0x0020, 0x0040,
1232 0x3667, 0x7888, 0xa084, 0x0040, 0x0040, 0x3667, 0x7bb8, 0xa384,
1233 0x003f, 0x831b, 0x00c8, 0x3635, 0x8000, 0xa005, 0x0040, 0x364b,
1234 0x831b, 0x00c8, 0x363e, 0x8001, 0x0040, 0x3663, 0xa684, 0x4000,
1235 0x0040, 0x364b, 0x78b8, 0x801b, 0x00c8, 0x3647, 0x8000, 0xa084,
1236 0x003f, 0x00c0, 0x3663, 0xa6b4, 0xbfff, 0x7e5a, 0x79d8, 0x7adc,
1237 0x2001, 0x0001, 0xa108, 0x00c8, 0x3657, 0xa291, 0x0000, 0x79d2,
1238 0x79da, 0x7ad6, 0x7ade, 0x1078, 0x49ed, 0x781b, 0x0064, 0x1078,
1239 0x4872, 0x0078, 0x2438, 0x781b, 0x0064, 0x0078, 0x2438, 0x781b,
1240 0x0065, 0x0078, 0x2438, 0x1078, 0x36a3, 0x782b, 0x3008, 0x781b,
1241 0x0065, 0x0078, 0x2438, 0x1078, 0x368f, 0x782b, 0x3008, 0x781b,
1242 0x0065, 0x0078, 0x2438, 0x6827, 0x0002, 0x1078, 0x3697, 0x78e4,
1243 0xa084, 0x0030, 0x0040, 0x2461, 0x78ec, 0xa084, 0x0003, 0x0040,
1244 0x2461, 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x2001,
1245 0x0005, 0x0078, 0x36a5, 0x2001, 0x000c, 0x0078, 0x36a5, 0x2001,
1246 0x0006, 0x0078, 0x36a5, 0x2001, 0x000d, 0x0078, 0x36a5, 0x2001,
1247 0x0009, 0x0078, 0x36a5, 0x2001, 0x0007, 0x789b, 0x0010, 0x78aa,
1248 0x789b, 0x0060, 0x78ab, 0x0001, 0xa6b5, 0x0004, 0x7e5a, 0x007c,
1249 0x077e, 0x873f, 0xa7bc, 0x000f, 0x873b, 0x873b, 0x8703, 0xa0e0,
1250 0x5280, 0xa7b8, 0x0020, 0x7f9a, 0x79a4, 0xa184, 0x000f, 0x0040,
1251 0x36c9, 0xa184, 0xfff0, 0x78a6, 0x6012, 0x6004, 0xa085, 0x0008,
1252 0x6006, 0x8738, 0x8738, 0x7f9a, 0x79a4, 0xa184, 0x0040, 0x0040,
1253 0x36d9, 0xa184, 0xffbf, 0x78a6, 0x6016, 0x6004, 0xa085, 0x0010,
1254 0x6006, 0x077f, 0x007c, 0x789b, 0x0010, 0x78ab, 0x0001, 0x78ab,
1255 0x0002, 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0060, 0x78ab, 0x0004,
1256 0x007c, 0x2021, 0x0000, 0x2029, 0x0032, 0x789b, 0x0010, 0x78ab,
1257 0x0001, 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa, 0x7caa, 0x789b,
1258 0x0060, 0x78ab, 0x0005, 0x007c, 0x157e, 0x8007, 0xa084, 0x00ff,
1259 0x8003, 0x8003, 0xa080, 0x0020, 0x789a, 0x79a4, 0xa18c, 0xfff0,
1260 0x2001, 0x5046, 0x2004, 0xa082, 0x0028, 0x0040, 0x3717, 0x2021,
1261 0x37a0, 0x2019, 0x0014, 0x20a9, 0x000c, 0x0078, 0x371d, 0x2021,
1262 0x37ac, 0x2019, 0x0019, 0x20a9, 0x000d, 0x2011, 0x0064, 0x2404,
1263 0xa084, 0xfff0, 0xa106, 0x0040, 0x372c, 0x8420, 0x2300, 0xa210,
1264 0x0070, 0x372c, 0x0078, 0x371f, 0x157f, 0x007c, 0x157e, 0x2009,
1265 0x5046, 0x210c, 0xa182, 0x0032, 0x0048, 0x3742, 0x0040, 0x3746,
1266 0x2009, 0x3792, 0x2019, 0x0011, 0x20a9, 0x000e, 0x2011, 0x0032,
1267 0x0078, 0x3758, 0xa182, 0x0028, 0x0040, 0x3750, 0x2009, 0x37a0,
1268 0x2019, 0x0014, 0x20a9, 0x000c, 0x2011, 0x0064, 0x0078, 0x3758,
1269 0x2009, 0x37ac, 0x2019, 0x0019, 0x20a9, 0x000d, 0x2011, 0x0064,
1270 0x2200, 0xa502, 0x0040, 0x3768, 0x0048, 0x3768, 0x8108, 0x2300,
1271 0xa210, 0x0070, 0x3765, 0x0078, 0x3758, 0x157f, 0xa006, 0x007c,
1272 0x157f, 0xa582, 0x0064, 0x00c8, 0x3777, 0x7808, 0xa085, 0x0070,
1273 0x780a, 0x7044, 0xa085, 0x0070, 0x7046, 0x0078, 0x3777, 0x78ec,
1274 0xa084, 0x0300, 0x0040, 0x377f, 0x2104, 0x0078, 0x3790, 0x2104,
1275 0xa09e, 0x1102, 0x00c0, 0x3790, 0x2001, 0x04fd, 0x2004, 0xa082,
1276 0x0005, 0x0048, 0x378f, 0x2001, 0x1201, 0x0078, 0x3790, 0x2104,
1277 0xa005, 0x007c, 0x1102, 0x3002, 0x3202, 0x4203, 0x4403, 0x5404,
1278 0x5604, 0x6605, 0x6805, 0x7806, 0x7a06, 0x0c07, 0x0c07, 0x0e07,
1279 0x3202, 0x4202, 0x5202, 0x6202, 0x7202, 0x6605, 0x7605, 0x7805,
1280 0x7a05, 0x7c05, 0x7e05, 0x7f05, 0x2202, 0x3202, 0x4202, 0x5202,
1281 0x5404, 0x6404, 0x7404, 0x7604, 0x7804, 0x7a04, 0x7c04, 0x7e04,
1282 0x7f04, 0x789b, 0x0010, 0xa046, 0x007c, 0xa784, 0x0f00, 0x800b,
1283 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, 0x8003, 0xa105, 0xa0e0,
1284 0x5300, 0x007c, 0x79d8, 0x7adc, 0x78d0, 0x801b, 0x00c8, 0x37d1,
1285 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x007c, 0x0f7e,
1286 0x2079, 0x0100, 0x2009, 0x5040, 0x2091, 0x8000, 0x2104, 0x0079,
1287 0x37e1, 0x3817, 0x37eb, 0x37eb, 0x37eb, 0x37eb, 0x37eb, 0x37eb,
1288 0x381b, 0x1078, 0x23ca, 0x784b, 0x0004, 0x7848, 0xa084, 0x0004,
1289 0x00c0, 0x37ed, 0x784b, 0x0008, 0x7848, 0xa084, 0x0008, 0x00c0,
1290 0x37f4, 0x68b4, 0xa085, 0x4000, 0x68b6, 0x7858, 0xa085, 0x4000,
1291 0x785a, 0x7830, 0xa084, 0x0080, 0x00c0, 0x3817, 0x0018, 0x3817,
1292 0x681c, 0xa084, 0x0020, 0x00c0, 0x3815, 0x0e7e, 0x2071, 0x5040,
1293 0x1078, 0x3868, 0x0e7f, 0x0078, 0x3817, 0x781b, 0x00d2, 0x2091,
1294 0x8001, 0x0f7f, 0x007c, 0x1078, 0x3a42, 0x0078, 0x3817, 0x0c7e,
1295 0x6814, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e0,
1296 0x5280, 0x6004, 0xa084, 0x000a, 0x00c0, 0x3852, 0x6108, 0xa194,
1297 0xff00, 0x0040, 0x3852, 0xa18c, 0x00ff, 0x2001, 0x0019, 0xa106,
1298 0x0040, 0x3841, 0x2001, 0x0032, 0xa106, 0x0040, 0x3845, 0x0078,
1299 0x3849, 0x2009, 0x0020, 0x0078, 0x384b, 0x2009, 0x003f, 0x0078,
1300 0x384b, 0x2011, 0x0000, 0x2100, 0xa205, 0x600a, 0x6004, 0xa085,
1301 0x0002, 0x6006, 0x0c7f, 0x007c, 0x781b, 0x0065, 0x0078, 0x2438,
1302 0x782b, 0x3008, 0x781b, 0x0065, 0x0078, 0x2438, 0x781b, 0x0058,
1303 0x0078, 0x2438, 0x782b, 0x3008, 0x781b, 0x0056, 0x0078, 0x2438,
1304 0x2009, 0x5020, 0x210c, 0xa186, 0x0000, 0x0040, 0x387c, 0xa186,
1305 0x0001, 0x0040, 0x387f, 0x2009, 0x5038, 0x200b, 0x000b, 0x706f,
1306 0x0001, 0x781b, 0x0048, 0x007c, 0x781b, 0x00cc, 0x007c, 0x2009,
1307 0x5038, 0x200b, 0x000a, 0x007c, 0x2009, 0x5020, 0x210c, 0xa186,
1308 0x0000, 0x0040, 0x389f, 0xa186, 0x0001, 0x0040, 0x3899, 0x2009,
1309 0x5038, 0x200b, 0x000b, 0x706f, 0x0001, 0x781b, 0x0048, 0x0078,
1310 0x2438, 0x2009, 0x5038, 0x200b, 0x000a, 0x0078, 0x2438, 0x782b,
1311 0x3008, 0x781b, 0x00cc, 0x0078, 0x2438, 0x781b, 0x00d2, 0x0078,
1312 0x2438, 0x782b, 0x3008, 0x781b, 0x00d2, 0x0078, 0x2438, 0x781b,
1313 0x0093, 0x0078, 0x2438, 0x782b, 0x3008, 0x781b, 0x0093, 0x0078,
1314 0x2438, 0x6818, 0xa084, 0x8000, 0x0040, 0x38c0, 0x681b, 0x001d,
1315 0x706f, 0x0001, 0x781b, 0x0048, 0x0078, 0x2438, 0x007e, 0x7830,
1316 0xa084, 0x00c0, 0x00c0, 0x38dc, 0x7808, 0xa084, 0xfffc, 0x780a,
1317 0x0005, 0x0005, 0x0005, 0x0005, 0x78ec, 0xa084, 0x0021, 0x0040,
1318 0x38dc, 0x7044, 0x780a, 0xa005, 0x007f, 0x007c, 0x7044, 0xa085,
1319 0x0002, 0x7046, 0x780a, 0x007c, 0x007e, 0x7830, 0xa084, 0x0040,
1320 0x00c0, 0x38e5, 0x0098, 0x38f0, 0x007f, 0x789a, 0x78ac, 0x007c,
1321 0x7808, 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005, 0x0005, 0x0005,
1322 0x78ec, 0xa084, 0x0021, 0x0040, 0x38ff, 0x0098, 0x38fd, 0x007f,
1323 0x789a, 0x78ac, 0x007e, 0x7044, 0x780a, 0x007f, 0x007c, 0x78ec,
1324 0xa084, 0x0002, 0x00c0, 0x461d, 0xa784, 0x007d, 0x00c0, 0x3913,
1325 0x2700, 0x1078, 0x23ca, 0xa784, 0x0001, 0x00c0, 0x2f43, 0xa784,
1326 0x0070, 0x0040, 0x3923, 0x0c7e, 0x2d60, 0x2f68, 0x1078, 0x2375,
1327 0x2d78, 0x2c68, 0x0c7f, 0xa784, 0x0008, 0x0040, 0x3930, 0x784b,
1328 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x2461, 0x0078, 0x3854,
1329 0xa784, 0x0004, 0x0040, 0x3963, 0x78b8, 0xa084, 0x4001, 0x0040,
1330 0x3963, 0x784b, 0x0008, 0x78ec, 0xa084, 0x0003, 0x0040, 0x2461,
1331 0x78e4, 0xa084, 0x0007, 0xa086, 0x0001, 0x00c0, 0x3963, 0x78c0,
1332 0xa085, 0x4800, 0x2030, 0x7e5a, 0x781b, 0x00d2, 0x0078, 0x2438,
1333 0x784b, 0x0008, 0x6818, 0xa084, 0x8000, 0x0040, 0x395f, 0x681b,
1334 0x0015, 0xa684, 0x4000, 0x0040, 0x395f, 0x681b, 0x0007, 0x1078,
1335 0x3868, 0x0078, 0x2438, 0x681b, 0x0003, 0x7858, 0xa084, 0x3f00,
1336 0x681e, 0x682f, 0x0000, 0x6833, 0x0000, 0x784b, 0x0008, 0x78ec,
1337 0xa084, 0x0003, 0x0040, 0x2944, 0x0018, 0x2438, 0x0078, 0x3673,
1338 0x6b14, 0x8307, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080,
1339 0x5280, 0x2060, 0x2048, 0x7056, 0x6000, 0x705a, 0x6004, 0x705e,
1340 0x2a60, 0x007c, 0x0079, 0x398c, 0x3994, 0x3995, 0x3994, 0x3997,
1341 0x3994, 0x3994, 0x3994, 0x399c, 0x007c, 0x1078, 0x33c4, 0x1078,
1342 0x4633, 0x7038, 0x600a, 0x007c, 0x70a0, 0xa005, 0x0040, 0x39a9,
1343 0x2068, 0x1078, 0x1b45, 0x1078, 0x45b5, 0x1078, 0x45bc, 0x70a3,
1344 0x0000, 0x007c, 0x0e7e, 0x2091, 0x8000, 0x2071, 0x5040, 0x7000,
1345 0xa086, 0x0007, 0x00c0, 0x39c0, 0x6110, 0x70bc, 0xa106, 0x00c0,
1346 0x39c0, 0x0e7f, 0x1078, 0x1b52, 0x1078, 0x39c6, 0xa006, 0x007c,
1347 0x2091, 0x8001, 0x0e7f, 0xa085, 0x0001, 0x007c, 0x0f7e, 0x0e7e,
1348 0x2071, 0x5040, 0x0078, 0x21d9, 0x785b, 0x0000, 0x70af, 0x000e,
1349 0x2009, 0x0100, 0x017e, 0x70a0, 0xa06d, 0x0040, 0x39db, 0x70a3,
1350 0x0000, 0x0078, 0x39e1, 0x70b3, 0x0000, 0x1078, 0x1b6e, 0x0040,
1351 0x39e7, 0x70ac, 0x6826, 0x1078, 0x3ac2, 0x0078, 0x39db, 0x017f,
1352 0x157e, 0x0c7e, 0x0d7e, 0x20a9, 0x0008, 0x2061, 0x7410, 0x6000,
1353 0xa105, 0x6002, 0x601c, 0xa06d, 0x0040, 0x39ff, 0x6800, 0x601e,
1354 0x1078, 0x193d, 0x6008, 0x8000, 0x600a, 0x0078, 0x39f2, 0x6018,
1355 0xa06d, 0x0040, 0x3a09, 0x6800, 0x601a, 0x1078, 0x193d, 0x0078,
1356 0x39ff, 0xace0, 0x0008, 0x0070, 0x3a0f, 0x0078, 0x39ef, 0x709c,
1357 0xa084, 0x8000, 0x0040, 0x3a16, 0x1078, 0x3b3c, 0x0d7f, 0x0c7f,
1358 0x157f, 0x007c, 0x127e, 0x2091, 0x2300, 0x6804, 0xa084, 0x000f,
1359 0x0079, 0x3a22, 0x3a32, 0x3a32, 0x3a32, 0x3a32, 0x3a32, 0x3a32,
1360 0x3a34, 0x3a3a, 0x3a32, 0x3a32, 0x3a32, 0x3a32, 0x3a32, 0x3a3c,
1361 0x3a32, 0x3a34, 0x1078, 0x23ca, 0x1078, 0x4466, 0x1078, 0x193d,
1362 0x0078, 0x3a40, 0x6827, 0x000b, 0x1078, 0x4466, 0x1078, 0x3ac2,
1363 0x127f, 0x007c, 0x127e, 0x2091, 0x2300, 0x0098, 0x3a5e, 0x7830,
1364 0xa084, 0x00c0, 0x00c0, 0x3a5e, 0x0d7e, 0x1078, 0x45c5, 0x2d00,
1365 0x682e, 0x2009, 0x0004, 0x2001, 0x0000, 0x6827, 0x0084, 0x1078,
1366 0x457e, 0x1078, 0x3ac2, 0x0d7f, 0x0078, 0x3a90, 0x7948, 0xa185,
1367 0x4000, 0x784a, 0x0098, 0x3a67, 0x794a, 0x0078, 0x3a4c, 0x7828,
1368 0xa086, 0x1834, 0x00c0, 0x3a70, 0xa185, 0x0004, 0x0078, 0x3a77,
1369 0x7828, 0xa186, 0x1814, 0x00c0, 0x3a64, 0xa185, 0x000c, 0x784a,
1370 0x789b, 0x000e, 0x78ab, 0x0002, 0x7858, 0xa084, 0x00ff, 0xa085,
1371 0x0400, 0x785a, 0x70b4, 0xa080, 0x0091, 0x781a, 0x6827, 0x0002,
1372 0x6827, 0x0084, 0x2009, 0x0004, 0x2001, 0x0000, 0x1078, 0x457e,
1373 0x127f, 0x007c, 0x0d7e, 0x6b14, 0x1078, 0x1be0, 0x0040, 0x3a9f,
1374 0x2068, 0x6827, 0x0002, 0x1078, 0x3ac2, 0x0078, 0x3a94, 0x0d7f,
1375 0x007c, 0x0d7e, 0x6b14, 0x6c28, 0xa4a4, 0x00ff, 0x1078, 0x1b7e,
1376 0x0040, 0x3aaf, 0x2068, 0x6827, 0x0002, 0x1078, 0x3ac2, 0x0d7f,
1377 0x007c, 0x0d7e, 0x6b14, 0xa39c, 0x00ff, 0x1078, 0x1bb1, 0x0040,
1378 0x3ac0, 0x2068, 0x6827, 0x0002, 0x1078, 0x3ac2, 0x0078, 0x3ab5,
1379 0x0d7f, 0x007c, 0x0c7e, 0x6914, 0x1078, 0x3b33, 0x6904, 0xa18c,
1380 0x00ff, 0xa186, 0x0006, 0x0040, 0x3add, 0xa186, 0x000d, 0x0040,
1381 0x3afc, 0xa186, 0x0017, 0x00c0, 0x3ad9, 0x1078, 0x193d, 0x0078,
1382 0x3adb, 0x1078, 0x1c55, 0x0c7f, 0x007c, 0x6004, 0x8001, 0x0048,
1383 0x3afa, 0x6006, 0x2009, 0x0000, 0xa684, 0x0001, 0x00c0, 0x3aea,
1384 0xa18d, 0x8000, 0xa684, 0x0004, 0x0040, 0x3af0, 0xa18d, 0x0002,
1385 0x691e, 0x6823, 0x0000, 0x7104, 0x810f, 0x6818, 0xa105, 0x681a,
1386 0x0078, 0x3ad9, 0x1078, 0x23ca, 0x6018, 0xa005, 0x00c0, 0x3b0b,
1387 0x6008, 0x8001, 0x0048, 0x3b0b, 0x600a, 0x601c, 0x6802, 0x2d00,
1388 0x601e, 0x0078, 0x3b21, 0xac88, 0x0006, 0x2104, 0xa005, 0x0040,
1389 0x3b14, 0x2008, 0x0078, 0x3b0d, 0x6802, 0x2d0a, 0x6008, 0x8001,
1390 0x0048, 0x3adb, 0x600a, 0x6018, 0x2068, 0x6800, 0x601a, 0x0078,
1391 0x3b05, 0x157e, 0x137e, 0x147e, 0x0c7e, 0x0d7e, 0x1078, 0x191a,
1392 0x2da0, 0x137f, 0x20a9, 0x0031, 0x53a3, 0x0c7f, 0x147f, 0x137f,
1393 0x157f, 0x0078, 0x3ad9, 0xa184, 0x001f, 0x8003, 0x8003, 0x8003,
1394 0xa080, 0x7410, 0x2060, 0x007c, 0x2019, 0x5051, 0x2304, 0xa085,
1395 0x0001, 0x201a, 0x2019, 0x0102, 0x2304, 0xa085, 0x0001, 0x201a,
1396 0x007c, 0x2019, 0x5051, 0x2304, 0xa084, 0xfffe, 0x201a, 0x2019,
1397 0x0102, 0x2304, 0xa084, 0xfffe, 0x201a, 0x007c, 0x7990, 0xa18c,
1398 0xfff8, 0x7992, 0x70b4, 0xa080, 0x00d8, 0x781a, 0x0078, 0x2438,
1399 0x70a3, 0x0000, 0x7003, 0x0000, 0x7043, 0x0001, 0x7037, 0x0000,
1400 0x0018, 0x23ef, 0x1078, 0x1b6e, 0x0040, 0x3b91, 0x2009, 0x500f,
1401 0x200b, 0x0000, 0x68bc, 0x2060, 0x6100, 0xa184, 0x0300, 0x0040,
1402 0x3b85, 0x6827, 0x000e, 0xa084, 0x0200, 0x0040, 0x3b81, 0x6827,
1403 0x0017, 0x1078, 0x3ac2, 0x0078, 0x3b60, 0x7000, 0xa086, 0x0007,
1404 0x00c0, 0x3be3, 0x2d00, 0x70a2, 0xad80, 0x000f, 0x7036, 0x0078,
1405 0x3b98, 0x7040, 0xa086, 0x0001, 0x0040, 0x2471, 0x0078, 0x2438,
1406 0x2031, 0x0000, 0x691c, 0xa184, 0x0002, 0x0040, 0x3ba1, 0xa6b5,
1407 0x0004, 0xa184, 0x00c0, 0x8003, 0x8003, 0x8007, 0xa080, 0x3c72,
1408 0x2004, 0xa635, 0x6820, 0xa084, 0x0400, 0x0040, 0x3bb9, 0x789b,
1409 0x0018, 0x78ab, 0x0003, 0x789b, 0x0081, 0x78ab, 0x0001, 0xa6b5,
1410 0x1000, 0x6820, 0xa084, 0x8000, 0x0040, 0x3bc5, 0xa6b5, 0x0400,
1411 0x789b, 0x000e, 0x6824, 0x8007, 0x78aa, 0xa684, 0x0200, 0x0040,
1412 0x3bdf, 0x682c, 0x78d2, 0x6830, 0x78d6, 0xa684, 0x0100, 0x0040,
1413 0x3bdd, 0x682c, 0xa084, 0x0001, 0x0040, 0x3bdd, 0x7888, 0xa084,
1414 0x0040, 0x0040, 0x3bdd, 0xa6b5, 0x8000, 0x1078, 0x45ad, 0x7e5a,
1415 0x6eb6, 0x0078, 0x45e4, 0x1078, 0x38c6, 0x00c0, 0x3c6c, 0x702c,
1416 0x8004, 0x0048, 0x3bf1, 0x2019, 0x4cfd, 0x1078, 0x2255, 0x702f,
1417 0x0001, 0x2011, 0x0001, 0x2031, 0x1000, 0x789b, 0x0018, 0x6814,
1418 0xa084, 0x001f, 0xa085, 0x0080, 0x78aa, 0x691c, 0xa184, 0x0002,
1419 0x0040, 0x3c0a, 0xa6b5, 0x0004, 0x78ab, 0x0020, 0x6828, 0x78aa,
1420 0xa290, 0x0002, 0x6820, 0xa084, 0x8000, 0x0040, 0x3c18, 0xa6b5,
1421 0x0400, 0x789b, 0x000e, 0x6824, 0x8007, 0x78aa, 0x0078, 0x3c26,
1422 0x681c, 0xa084, 0x8000, 0x00c0, 0x3c26, 0xa6b5, 0x0800, 0x6820,
1423 0xa084, 0x0100, 0x0040, 0x3c26, 0xa6b5, 0x4000, 0x681c, 0xa084,
1424 0x00c0, 0x8003, 0x8003, 0x8007, 0xa080, 0x3c72, 0x2004, 0xa635,
1425 0xa684, 0x0100, 0x0040, 0x3c40, 0x682c, 0xa084, 0x0001, 0x0040,
1426 0x3c40, 0x7888, 0xa084, 0x0040, 0x0040, 0x3c40, 0xa6b5, 0x8000,
1427 0x789b, 0x007e, 0x7eae, 0x6eb6, 0x6814, 0x8007, 0x78aa, 0x7882,
1428 0x7aaa, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x3c6c, 0x0018, 0x3c6c,
1429 0x70b4, 0xa080, 0x00dd, 0x781a, 0x1078, 0x38de, 0xa684, 0x0200,
1430 0x0040, 0x3c60, 0x682c, 0x78d2, 0x6830, 0x78d6, 0x1078, 0x45ad,
1431 0x2d00, 0x70a2, 0x704a, 0x6810, 0x70be, 0x7003, 0x0007, 0xad80,
1432 0x000f, 0x7036, 0x0078, 0x2438, 0x1078, 0x1b45, 0x1078, 0x38de,
1433 0x0078, 0x2438, 0x0000, 0x0300, 0x0200, 0x0000, 0x1078, 0x23ca,
1434 0x2300, 0x0079, 0x3c7b, 0x3c7e, 0x3c7e, 0x3c80, 0x1078, 0x23ca,
1435 0x1078, 0x45bc, 0x6924, 0xa184, 0x00ff, 0xa086, 0x000a, 0x0040,
1436 0x3c92, 0xa184, 0xff00, 0xa085, 0x000a, 0x6826, 0x1078, 0x1b45,
1437 0x0078, 0x3b60, 0x2001, 0x000a, 0x1078, 0x454c, 0x0078, 0x3b60,
1438 0xa282, 0x0005, 0x0050, 0x3c9e, 0x1078, 0x23ca, 0x7000, 0xa084,
1439 0x0007, 0x10c0, 0x398a, 0x1078, 0x191a, 0x00c0, 0x3cbd, 0xa684,
1440 0x0004, 0x0040, 0x3caf, 0x2001, 0x2800, 0x0078, 0x3cb1, 0x2001,
1441 0x0800, 0x71b4, 0xa188, 0x0091, 0x789b, 0x000e, 0x78aa, 0x2031,
1442 0x0400, 0x7e5a, 0x791a, 0x0078, 0x2438, 0x6807, 0x0106, 0x680b,
1443 0x0000, 0x689f, 0x0000, 0x6827, 0x0000, 0xa386, 0x0002, 0x00c0,
1444 0x3cde, 0xa286, 0x0002, 0x00c0, 0x3cde, 0x78a0, 0xa005, 0x00c0,
1445 0x3cde, 0xa484, 0x8000, 0x00c0, 0x3cde, 0x78e4, 0xa084, 0x0008,
1446 0x0040, 0x3cde, 0xa6b5, 0x0008, 0x2019, 0x0000, 0x1078, 0x40d3,
1447 0x2d00, 0x70a2, 0x704a, 0x7003, 0x0007, 0x7037, 0x0000, 0x6824,
1448 0xa084, 0x0080, 0x0040, 0x3cf0, 0x1078, 0x4180, 0x0078, 0x2438,
1449 0x2300, 0x0079, 0x3cf3, 0x3cf6, 0x3d77, 0x3d96, 0x2200, 0x0079,
1450 0x3cf9, 0x3cfe, 0x3d0e, 0x3d34, 0x3d40, 0x3d63, 0x2029, 0x0001,
1451 0xa026, 0x2011, 0x0000, 0x1078, 0x428d, 0x0079, 0x3d07, 0x3d0c,
1452 0x2438, 0x3b60, 0x3d0c, 0x3d0c, 0x1078, 0x23ca, 0x7990, 0xa18c,
1453 0x0007, 0x00c0, 0x3d15, 0x2009, 0x0008, 0x2011, 0x0001, 0xa684,
1454 0x0004, 0x0040, 0x3d1d, 0x2011, 0x0003, 0x2220, 0xa12a, 0x2011,
1455 0x0001, 0x1078, 0x428d, 0x0079, 0x3d25, 0x3d2a, 0x2438, 0x3b60,
1456 0x3d32, 0x3d2c, 0x0078, 0x45ea, 0x70ab, 0x3d30, 0x0078, 0x2438,
1457 0x0078, 0x3d2a, 0x1078, 0x23ca, 0xa684, 0x0010, 0x0040, 0x3d3e,
1458 0x1078, 0x414f, 0x0040, 0x3d3e, 0x0078, 0x2438, 0x0078, 0x41bc,
1459 0x6000, 0xa084, 0x0002, 0x0040, 0x3d5d, 0x70b4, 0xa080, 0x00cd,
1460 0x781a, 0x0d7e, 0x1078, 0x45c5, 0x2d00, 0x682e, 0x6827, 0x0000,
1461 0x1078, 0x3ac2, 0x0d7f, 0x1078, 0x193d, 0x7003, 0x0000, 0x7037,
1462 0x0000, 0x704b, 0x0000, 0x0078, 0x3b60, 0xa684, 0x0004, 0x00c0,
1463 0x3d63, 0x0078, 0x45ea, 0x6000, 0xa084, 0x0004, 0x00c0, 0x3d75,
1464 0x6000, 0xa084, 0x0001, 0x0040, 0x3d75, 0x70ab, 0x3d75, 0x2001,
1465 0x0007, 0x1078, 0x4544, 0x0078, 0x45f0, 0x0078, 0x45ea, 0x2200,
1466 0x0079, 0x3d7a, 0x3d7f, 0x3d7f, 0x3d7f, 0x3d81, 0x3d7f, 0x1078,
1467 0x23ca, 0x70a7, 0x3d85, 0x0078, 0x45f6, 0x2011, 0x0018, 0x1078,
1468 0x4287, 0x0079, 0x3d8b, 0x3d90, 0x2438, 0x3b60, 0x3d92, 0x3d94,
1469 0x1078, 0x23ca, 0x1078, 0x23ca, 0x1078, 0x23ca, 0x2200, 0x0079,
1470 0x3d99, 0x3d9e, 0x3da0, 0x3da0, 0x3d9e, 0x3d9e, 0x1078, 0x23ca,
1471 0x78e4, 0xa084, 0x0008, 0x0040, 0x3db5, 0x70a7, 0x3da9, 0x0078,
1472 0x45f6, 0x2011, 0x0004, 0x1078, 0x4287, 0x0079, 0x3daf, 0x3db5,
1473 0x2438, 0x3b60, 0x3db5, 0x3dbf, 0x3dc3, 0x70ab, 0x3dbd, 0x2001,
1474 0x0003, 0x1078, 0x4544, 0x0078, 0x45f0, 0x0078, 0x45ea, 0x70ab,
1475 0x3db5, 0x0078, 0x2438, 0x70ab, 0x3dc7, 0x0078, 0x2438, 0x0078,
1476 0x3dbd, 0xa282, 0x0003, 0x0050, 0x3dcf, 0x1078, 0x23ca, 0xa386,
1477 0x0002, 0x00c0, 0x3de8, 0xa286, 0x0002, 0x00c0, 0x3dee, 0x78a0,
1478 0xa005, 0x00c0, 0x3dee, 0xa484, 0x8000, 0x00c0, 0x3dee, 0x78e4,
1479 0xa084, 0x0008, 0x0040, 0x3de8, 0xa6b5, 0x0008, 0x2019, 0x0000,
1480 0xa684, 0x0008, 0x0040, 0x3dee, 0x1078, 0x412c, 0x6810, 0x70be,
1481 0x7003, 0x0007, 0x2300, 0x0079, 0x3df5, 0x3df8, 0x3e25, 0x3e2d,
1482 0x2200, 0x0079, 0x3dfb, 0x3e00, 0x3dfe, 0x3e19, 0x1078, 0x23ca,
1483 0x7990, 0xa1ac, 0x0007, 0xa026, 0x2011, 0x0001, 0x1078, 0x428d,
1484 0x0079, 0x3e0a, 0x3e0f, 0x2438, 0x3b60, 0x3e17, 0x3e11, 0x0078,
1485 0x45ea, 0x70ab, 0x3e15, 0x0078, 0x2438, 0x0078, 0x3e0f, 0x1078,
1486 0x23ca, 0xa684, 0x0010, 0x0040, 0x3e23, 0x1078, 0x414f, 0x0040,
1487 0x3e23, 0x0078, 0x2438, 0x0078, 0x41bc, 0x2200, 0x0079, 0x3e28,
1488 0x3e2b, 0x3e2b, 0x3e2b, 0x1078, 0x23ca, 0x2200, 0x0079, 0x3e30,
1489 0x3e33, 0x3e35, 0x3e35, 0x1078, 0x23ca, 0x78e4, 0xa084, 0x0008,
1490 0x0040, 0x3e4a, 0x70a7, 0x3e3e, 0x0078, 0x45f6, 0x2011, 0x0004,
1491 0x1078, 0x4287, 0x0079, 0x3e44, 0x3e4a, 0x2438, 0x3b60, 0x3e4a,
1492 0x3e54, 0x3e58, 0x70ab, 0x3e52, 0x2001, 0x0003, 0x1078, 0x4544,
1493 0x0078, 0x45f0, 0x0078, 0x45ea, 0x70ab, 0x3e4a, 0x0078, 0x2438,
1494 0x70ab, 0x3e5c, 0x0078, 0x2438, 0x0078, 0x3e52, 0x2300, 0x0079,
1495 0x3e61, 0x3e66, 0x3e68, 0x3e64, 0x1078, 0x23ca, 0x70a4, 0x007a,
1496 0x70a4, 0x007a, 0xa282, 0x0002, 0x0050, 0x3e70, 0x1078, 0x23ca,
1497 0xa684, 0x0200, 0x0040, 0x3e7a, 0x1078, 0x45b5, 0x1078, 0x426f,
1498 0x1078, 0x45bc, 0x2300, 0x0079, 0x3e7d, 0x3e80, 0x3ea4, 0x3f0a,
1499 0xa286, 0x0001, 0x0040, 0x3e86, 0x1078, 0x23ca, 0xa684, 0x0200,
1500 0x0040, 0x3e8e, 0x1078, 0x45b5, 0x1078, 0x45bc, 0x2001, 0x0001,
1501 0x1078, 0x454c, 0x78b8, 0xa084, 0xc001, 0x0040, 0x3ea0, 0x7848,
1502 0xa085, 0x0008, 0x784a, 0x7848, 0xa084, 0x0008, 0x00c0, 0x3e9b,
1503 0x7003, 0x0000, 0x0078, 0x3b60, 0x2200, 0x0079, 0x3ea7, 0x3ea9,
1504 0x3eda, 0x70a7, 0x3ead, 0x0078, 0x45f6, 0x2011, 0x000d, 0x1078,
1505 0x4287, 0x0079, 0x3eb3, 0x3eba, 0x2438, 0x3b60, 0x3ec2, 0x3eca,
1506 0x3ed0, 0x3ed2, 0xa6b4, 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a,
1507 0x0078, 0x45e4, 0xa6b4, 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a,
1508 0x0078, 0x45e4, 0x70ab, 0x3ece, 0x0078, 0x2438, 0x0078, 0x3eba,
1509 0x1078, 0x23ca, 0x70ab, 0x3ed6, 0x0078, 0x2438, 0x1078, 0x45fc,
1510 0x0078, 0x2438, 0x70a7, 0x3ede, 0x0078, 0x45f6, 0x2011, 0x0012,
1511 0x1078, 0x4287, 0x0079, 0x3ee4, 0x3eea, 0x2438, 0x3b60, 0x3ef6,
1512 0x3efe, 0x3f04, 0xa6b4, 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a,
1513 0x70b4, 0xa080, 0x00a5, 0x781a, 0x0078, 0x2438, 0xa6b4, 0x00ff,
1514 0xa6b5, 0x0400, 0x6eb6, 0x7e5a, 0x0078, 0x45e4, 0x70ab, 0x3f02,
1515 0x0078, 0x2438, 0x0078, 0x3eea, 0x70ab, 0x3f08, 0x0078, 0x2438,
1516 0x0078, 0x3ef6, 0xa286, 0x0001, 0x0040, 0x3f10, 0x1078, 0x23ca,
1517 0x70a7, 0x3f14, 0x0078, 0x45f6, 0x2011, 0x0015, 0x1078, 0x4287,
1518 0x0079, 0x3f1a, 0x3f1f, 0x2438, 0x3b60, 0x3f2d, 0x3f39, 0xa6b4,
1519 0x00ff, 0xa6b5, 0x0400, 0x6eb6, 0x7e5a, 0x783b, 0x1301, 0x70b4,
1520 0xa080, 0x00b5, 0x781a, 0x0078, 0x2438, 0xa6b4, 0x00ff, 0xa6b5,
1521 0x0400, 0x6eb6, 0x7e5a, 0x70b4, 0xa080, 0x00a5, 0x781a, 0x0078,
1522 0x2438, 0x70ab, 0x3f3d, 0x0078, 0x2438, 0x0078, 0x3f1f, 0xa282,
1523 0x0003, 0x0050, 0x3f45, 0x1078, 0x23ca, 0x2300, 0x0079, 0x3f48,
1524 0x3f4b, 0x3f82, 0x3fdd, 0xa286, 0x0001, 0x0040, 0x3f51, 0x1078,
1525 0x23ca, 0x6804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0, 0x3f5e,
1526 0x1078, 0x3ac2, 0x7003, 0x0000, 0x0078, 0x3b60, 0x683b, 0x0000,
1527 0x6837, 0x0000, 0xa684, 0x0200, 0x0040, 0x3f6c, 0x1078, 0x45b5,
1528 0x1078, 0x426f, 0x1078, 0x45bc, 0x2001, 0x0001, 0x1078, 0x454c,
1529 0x78b8, 0xa084, 0xc001, 0x0040, 0x3f7e, 0x7848, 0xa085, 0x0008,
1530 0x784a, 0x7848, 0xa084, 0x0008, 0x00c0, 0x3f79, 0x7003, 0x0000,
1531 0x0078, 0x3b60, 0x2200, 0x0079, 0x3f85, 0x3f87, 0x3fb8, 0x70a7,
1532 0x3f8b, 0x0078, 0x45f6, 0x2011, 0x000d, 0x1078, 0x4287, 0x0079,
1533 0x3f91, 0x3f98, 0x2438, 0x3b60, 0x3fa0, 0x3fa8, 0x3fae, 0x3fb0,
1534 0xa6b4, 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x45e4,
1535 0xa6b4, 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x45e4,
1536 0x70ab, 0x3fac, 0x0078, 0x2438, 0x0078, 0x3f98, 0x1078, 0x23ca,
1537 0x70ab, 0x3fb4, 0x0078, 0x2438, 0x1078, 0x45fc, 0x0078, 0x2438,
1538 0x70a7, 0x3fbc, 0x0078, 0x45f6, 0x2011, 0x0005, 0x1078, 0x4287,
1539 0x0079, 0x3fc2, 0x3fc7, 0x2438, 0x3b60, 0x3fcf, 0x3fd7, 0xa6b4,
1540 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x45e4, 0xa6b4,
1541 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x45e4, 0x70ab,
1542 0x3fdb, 0x0078, 0x2438, 0x0078, 0x3fc7, 0xa286, 0x0001, 0x0040,
1543 0x3fe3, 0x1078, 0x23ca, 0x70a7, 0x3fe7, 0x0078, 0x45f6, 0x2011,
1544 0x0006, 0x1078, 0x4287, 0x0079, 0x3fed, 0x3ff2, 0x2438, 0x3b60,
1545 0x3ff8, 0x4002, 0xa6b5, 0x0800, 0x6eb6, 0x7e5a, 0x0078, 0x45e4,
1546 0xa6b4, 0x00ff, 0xa6b5, 0x0800, 0x6eb6, 0xa6b5, 0x4000, 0x7e5a,
1547 0x0078, 0x45e4, 0x70ab, 0x4006, 0x0078, 0x2438, 0x0078, 0x3ff2,
1548 0x2300, 0x0079, 0x400b, 0x4010, 0x400e, 0x400e, 0x1078, 0x23ca,
1549 0x1078, 0x23ca, 0x2300, 0x71a8, 0xa005, 0x017a, 0x6810, 0x70be,
1550 0xa282, 0x0003, 0x0050, 0x401e, 0x1078, 0x23ca, 0x2300, 0x0079,
1551 0x4021, 0x4024, 0x4037, 0x4059, 0x82ff, 0x00c0, 0x4029, 0x1078,
1552 0x23ca, 0xa684, 0x0200, 0x0040, 0x4031, 0x1078, 0x45b5, 0x1078,
1553 0x45bc, 0x2001, 0x0001, 0x1078, 0x454c, 0x0078, 0x2438, 0xa296,
1554 0x0002, 0x0040, 0x4040, 0x82ff, 0x0040, 0x4040, 0x1078, 0x23ca,
1555 0x70a7, 0x4044, 0x0078, 0x45f6, 0x2011, 0x0018, 0x1078, 0x4287,
1556 0x0079, 0x404a, 0x404f, 0x2438, 0x3b60, 0x4051, 0x4053, 0x0078,
1557 0x45e4, 0x0078, 0x45e4, 0x70ab, 0x4057, 0x0078, 0x2438, 0x0078,
1558 0x404f, 0x2200, 0x0079, 0x405c, 0x405e, 0x4077, 0x70a7, 0x4062,
1559 0x0078, 0x45f6, 0x2011, 0x0017, 0x1078, 0x4287, 0x0079, 0x4068,
1560 0x406d, 0x2438, 0x3b60, 0x406f, 0x4071, 0x0078, 0x45e4, 0x0078,
1561 0x45e4, 0x70ab, 0x4075, 0x0078, 0x2438, 0x0078, 0x406d, 0xa484,
1562 0x8000, 0x00c0, 0x40c1, 0xa684, 0x0100, 0x0040, 0x408b, 0x1078,
1563 0x45b5, 0x1078, 0x426f, 0x1078, 0x45bc, 0x7848, 0xa085, 0x000c,
1564 0x784a, 0x0078, 0x408f, 0x78d8, 0x78d2, 0x78dc, 0x78d6, 0xa6b4,
1565 0xefff, 0x7e5a, 0x70a7, 0x4096, 0x0078, 0x45f6, 0x2011, 0x000d,
1566 0x1078, 0x4287, 0x0079, 0x409c, 0x40a3, 0x2438, 0x3b60, 0x40a3,
1567 0x40b1, 0x40b7, 0x40b9, 0xa684, 0x0100, 0x0040, 0x40af, 0x1078,
1568 0x4573, 0x682c, 0x78d2, 0x6830, 0x78d6, 0x1078, 0x45ad, 0x0078,
1569 0x45e4, 0x70ab, 0x40b5, 0x0078, 0x2438, 0x0078, 0x40a3, 0x1078,
1570 0x23ca, 0x70ab, 0x40bd, 0x0078, 0x2438, 0x1078, 0x45fc, 0x0078,
1571 0x2438, 0x1078, 0x45bc, 0x70ab, 0x40cb, 0x2001, 0x0003, 0x1078,
1572 0x4544, 0x0078, 0x45f0, 0x1078, 0x45ad, 0x682c, 0x78d2, 0x6830,
1573 0x78d6, 0x0078, 0x45e4, 0x70b8, 0x6812, 0x70be, 0x8000, 0x70ba,
1574 0x681b, 0x0000, 0xa684, 0x0008, 0x0040, 0x40f6, 0x157e, 0x137e,
1575 0x147e, 0x7890, 0x8004, 0x8004, 0x8004, 0x8004, 0xa084, 0x000f,
1576 0x681a, 0x80ac, 0x789b, 0x0000, 0xaf80, 0x002b, 0x2098, 0xad80,
1577 0x000b, 0x20a0, 0x53a5, 0x147f, 0x137f, 0x157f, 0xa6c4, 0x0f00,
1578 0xa684, 0x0002, 0x00c0, 0x4102, 0x692c, 0x810d, 0x810d, 0x810d,
1579 0x0078, 0x410f, 0x789b, 0x0010, 0x79ac, 0x0078, 0x410f, 0x017e,
1580 0x2009, 0x0005, 0x2001, 0x3d00, 0x1078, 0x457e, 0x017f, 0xa184,
1581 0x001f, 0xa805, 0x6816, 0x1078, 0x3b33, 0x68be, 0xa684, 0x0004,
1582 0x0040, 0x4120, 0xa18c, 0xff00, 0x78a8, 0xa084, 0x00ff, 0xa105,
1583 0x682a, 0xa6b4, 0x00ff, 0x6000, 0xa084, 0x0008, 0x0040, 0x412a,
1584 0xa6b5, 0x4000, 0x6eb6, 0x007c, 0x157e, 0x137e, 0x147e, 0x6918,
1585 0x7890, 0x8004, 0x8004, 0x8004, 0x8004, 0xa084, 0x000f, 0x007e,
1586 0xa100, 0x681a, 0x007f, 0x8000, 0x8004, 0x0040, 0x414b, 0x20a8,
1587 0x8104, 0xa080, 0x000b, 0xad00, 0x20a0, 0x789b, 0x0000, 0xaf80,
1588 0x002b, 0x2098, 0x53a5, 0x147f, 0x137f, 0x157f, 0x007c, 0x682c,
1589 0xa084, 0x0020, 0x00c0, 0x4157, 0x620c, 0x0078, 0x4158, 0x6210,
1590 0x6b18, 0x2300, 0xa202, 0x0040, 0x4178, 0x2018, 0xa382, 0x000e,
1591 0x0048, 0x4168, 0x0040, 0x4168, 0x2019, 0x000e, 0x0078, 0x416c,
1592 0x7858, 0xa084, 0xffef, 0x785a, 0x783b, 0x1b01, 0x7893, 0x0000,
1593 0x7ba2, 0x70b4, 0xa080, 0x008e, 0x781a, 0xa085, 0x0001, 0x007c,
1594 0x7858, 0xa084, 0xffef, 0x785a, 0x7893, 0x0000, 0xa006, 0x007c,
1595 0x6904, 0xa18c, 0x00ff, 0xa196, 0x0007, 0x0040, 0x418d, 0xa196,
1596 0x000f, 0x0040, 0x418d, 0x6807, 0x0117, 0x6914, 0x1078, 0x3b33,
1597 0x6100, 0x8104, 0x00c8, 0x41a8, 0x601c, 0xa005, 0x0040, 0x419c,
1598 0x2001, 0x0800, 0x0078, 0x41aa, 0x0d7e, 0x6824, 0x007e, 0x1078,
1599 0x45c5, 0x007f, 0x6826, 0x2d00, 0x682e, 0x1078, 0x3ac2, 0x0d7f,
1600 0x2001, 0x0200, 0x6826, 0x8007, 0x789b, 0x000e, 0x78aa, 0x6820,
1601 0xa085, 0x8000, 0x6822, 0x2031, 0x0400, 0x6eb6, 0x7e5a, 0x71b4,
1602 0xa188, 0x0091, 0x791a, 0x007c, 0xa6c4, 0x0f00, 0xa684, 0x0002,
1603 0x00c0, 0x41cf, 0x692c, 0x810d, 0x810d, 0x810d, 0xa184, 0x001f,
1604 0xa805, 0x6816, 0x1078, 0x3b33, 0x68be, 0x0078, 0x41d2, 0x6914,
1605 0x1078, 0x3b33, 0x6100, 0x8104, 0x00c8, 0x421c, 0xa184, 0x0300,
1606 0x0040, 0x41de, 0x6807, 0x0117, 0x0078, 0x41fc, 0x6004, 0xa005,
1607 0x00c0, 0x4205, 0x6807, 0x0117, 0x601c, 0xa005, 0x00c0, 0x41f2,
1608 0x0d7e, 0x1078, 0x45c5, 0x6827, 0x0034, 0x2d00, 0x682e, 0x1078,
1609 0x3ac2, 0x0d7f, 0xa684, 0x0004, 0x0040, 0x41fc, 0x2031, 0x0400,
1610 0x2001, 0x2800, 0x0078, 0x4200, 0x2031, 0x0400, 0x2001, 0x0800,
1611 0x71b4, 0xa188, 0x0091, 0x0078, 0x424a, 0x6018, 0xa005, 0x00c0,
1612 0x41f2, 0x601c, 0xa005, 0x00c0, 0x41f2, 0x689f, 0x0000, 0x6827,
1613 0x003d, 0xa684, 0x0001, 0x0040, 0x4258, 0xa6b5, 0x0800, 0x71b4,
1614 0xa188, 0x00ae, 0x0078, 0x4253, 0x6807, 0x0117, 0x2031, 0x0400,
1615 0x692c, 0xa18c, 0x00ff, 0xa186, 0x0012, 0x00c0, 0x422d, 0x2001,
1616 0x4265, 0x2009, 0x0001, 0x0078, 0x423e, 0xa186, 0x0003, 0x00c0,
1617 0x4237, 0x2001, 0x4266, 0x2009, 0x0012, 0x0078, 0x423e, 0x2001,
1618 0x0200, 0x71b4, 0xa188, 0x0091, 0x0078, 0x424a, 0x1078, 0x4598,
1619 0x78a3, 0x0000, 0x681c, 0xa085, 0x0040, 0x681e, 0x71b4, 0xa188,
1620 0x00da, 0xa006, 0x6826, 0x8007, 0x789b, 0x000e, 0x78aa, 0x6820,
1621 0xa085, 0x8000, 0x6822, 0x6eb6, 0x7e5a, 0x791a, 0x0078, 0x2438,
1622 0x6eb6, 0x1078, 0x3ac2, 0x6810, 0x70be, 0x7003, 0x0007, 0x70a3,
1623 0x0000, 0x704b, 0x0000, 0x0078, 0x2438, 0x0023, 0x0070, 0x0005,
1624 0x0000, 0x0a00, 0x0000, 0x0000, 0x0025, 0x0000, 0x0000, 0x683b,
1625 0x0000, 0x6837, 0x0000, 0xa684, 0x0200, 0x0040, 0x4286, 0x78b8,
1626 0xa08c, 0x001f, 0xa084, 0x8000, 0x0040, 0x427f, 0x8108, 0x78d8,
1627 0xa100, 0x6836, 0x78dc, 0xa081, 0x0000, 0x683a, 0x007c, 0x7990,
1628 0x810f, 0xa5ac, 0x0007, 0x2021, 0x0000, 0xa480, 0x0010, 0x789a,
1629 0x79a8, 0xa18c, 0x00ff, 0xa184, 0x0080, 0x00c0, 0x42b5, 0xa182,
1630 0x0020, 0x00c8, 0x42cf, 0xa182, 0x0012, 0x00c8, 0x4536, 0x2100,
1631 0x1079, 0x42a3, 0x007c, 0x4536, 0x447e, 0x4536, 0x4536, 0x42dc,
1632 0x42df, 0x4319, 0x434f, 0x4381, 0x4384, 0x4536, 0x4536, 0x433a,
1633 0x43a8, 0x43e2, 0x4536, 0x4536, 0x4409, 0xa18c, 0x001f, 0x6814,
1634 0xa084, 0x001f, 0xa106, 0x0040, 0x42cc, 0x70b4, 0xa080, 0x00cd,
1635 0x781a, 0x2001, 0x0014, 0x1078, 0x454c, 0x1078, 0x45bc, 0x7003,
1636 0x0000, 0x2001, 0x0002, 0x007c, 0x2001, 0x0000, 0x007c, 0xa182,
1637 0x0024, 0x00c8, 0x4536, 0xa184, 0x0003, 0x1079, 0x42a3, 0x007c,
1638 0x4536, 0x4536, 0x4536, 0x4536, 0x1078, 0x4536, 0x007c, 0x2200,
1639 0x0079, 0x42e2, 0x440c, 0x440c, 0x4306, 0x4306, 0x4306, 0x4306,
1640 0x4306, 0x4306, 0x4306, 0x4306, 0x4304, 0x4306, 0x42fb, 0x4306,
1641 0x4306, 0x4306, 0x4306, 0x4306, 0x430e, 0x4311, 0x440c, 0x4311,
1642 0x4306, 0x4306, 0x4306, 0x0c7e, 0x077e, 0x6f14, 0x1078, 0x36b0,
1643 0x077f, 0x0c7f, 0x0078, 0x4306, 0x1078, 0x44d1, 0x6827, 0x02b3,
1644 0x2009, 0x000b, 0x2001, 0x4800, 0x0078, 0x4440, 0x1078, 0x452b,
1645 0x007c, 0x6827, 0x0093, 0x2009, 0x000b, 0x2001, 0x4800, 0x0078,
1646 0x4428, 0x2d58, 0x6804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
1647 0x4323, 0x6807, 0x0117, 0x6827, 0x0002, 0x1078, 0x45c5, 0x6827,
1648 0x0036, 0x6932, 0x2d00, 0x682e, 0x0d7e, 0x1078, 0x3a92, 0x1078,
1649 0x4466, 0x2b68, 0x1078, 0x3ac2, 0x0d7f, 0x1078, 0x3ac2, 0x2001,
1650 0x0002, 0x007c, 0x1078, 0x4466, 0x2001, 0x0017, 0x1078, 0x454c,
1651 0x70a3, 0x0000, 0x2009, 0x5038, 0x200b, 0x0006, 0x70af, 0x0017,
1652 0x2009, 0x0200, 0x1078, 0x39d2, 0x2001, 0x0001, 0x007c, 0x2200,
1653 0x0079, 0x4352, 0x440c, 0x443d, 0x443d, 0x443d, 0x4373, 0x444d,
1654 0x4379, 0x444d, 0x444d, 0x4450, 0x4450, 0x4455, 0x4455, 0x436b,
1655 0x436b, 0x443d, 0x443d, 0x444d, 0x443d, 0x4379, 0x440c, 0x4379,
1656 0x4379, 0x4379, 0x4379, 0x6827, 0x0084, 0x2009, 0x000b, 0x2001,
1657 0x4300, 0x0078, 0x445f, 0x2009, 0x000b, 0x2001, 0x4300, 0x0078,
1658 0x4440, 0x6827, 0x0093, 0x2009, 0x000b, 0x2001, 0x4300, 0x0078,
1659 0x4428, 0x2001, 0x0000, 0x007c, 0x2200, 0x0079, 0x4387, 0x440c,
1660 0x43a0, 0x43a0, 0x43a0, 0x43a0, 0x444d, 0x444d, 0x444d, 0x444d,
1661 0x444d, 0x444d, 0x444d, 0x444d, 0x43a0, 0x43a0, 0x43a0, 0x43a0,
1662 0x444d, 0x43a0, 0x43a0, 0x444d, 0x444d, 0x444d, 0x444d, 0x440c,
1663 0x6827, 0x0093, 0x2009, 0x000b, 0x2001, 0x4300, 0x0078, 0x4428,
1664 0xa684, 0x0004, 0x00c0, 0x43bc, 0x6804, 0xa084, 0x00ff, 0xa086,
1665 0x0006, 0x00c0, 0x4536, 0x1078, 0x4466, 0x6807, 0x0117, 0x1078,
1666 0x3ac2, 0x2001, 0x0002, 0x007c, 0x6000, 0xa084, 0x0004, 0x0040,
1667 0x4536, 0x2d58, 0x6804, 0xa084, 0x00ff, 0xa086, 0x0006, 0x00c0,
1668 0x43cb, 0x6807, 0x0117, 0x6827, 0x0002, 0x1078, 0x45c5, 0x6827,
1669 0x0036, 0x6932, 0x2d00, 0x682e, 0x0d7e, 0x1078, 0x3aa1, 0x1078,
1670 0x4466, 0x2b68, 0x1078, 0x3ac2, 0x0d7f, 0x1078, 0x3ac2, 0x2001,
1671 0x0002, 0x007c, 0x6000, 0xa084, 0x0004, 0x0040, 0x4536, 0x2d58,
1672 0x6a04, 0xa294, 0x00ff, 0xa286, 0x0006, 0x00c0, 0x43f1, 0x6807,
1673 0x0117, 0x6827, 0x0002, 0x2d58, 0x1078, 0x45c5, 0x6827, 0x0036,
1674 0x6932, 0x2d00, 0x682e, 0x0d7e, 0x1078, 0x3ab1, 0x1078, 0x4466,
1675 0x2b68, 0x1078, 0x3ac2, 0x0d7f, 0x1078, 0x3ac2, 0x2001, 0x0002,
1676 0x007c, 0x1078, 0x4536, 0x007c, 0x70b4, 0xa080, 0x00cd, 0x781a,
1677 0x2001, 0x0001, 0x1078, 0x454c, 0x1078, 0x45bc, 0x7003, 0x0000,
1678 0x2001, 0x0002, 0x007c, 0x1078, 0x457e, 0x1078, 0x45b5, 0x1078,
1679 0x426f, 0x1078, 0x4180, 0x1078, 0x45bc, 0x2001, 0x0001, 0x007c,
1680 0x1078, 0x457e, 0x1078, 0x45b5, 0x1078, 0x426f, 0x70b4, 0xa080,
1681 0x00cd, 0x781a, 0x2001, 0x0013, 0x1078, 0x454c, 0x1078, 0x45bc,
1682 0x7003, 0x0000, 0x2001, 0x0002, 0x007c, 0x1078, 0x4536, 0x007c,
1683 0x1078, 0x457e, 0x1078, 0x45b5, 0x1078, 0x426f, 0x1078, 0x4180,
1684 0x1078, 0x45bc, 0x2001, 0x0001, 0x007c, 0x2001, 0x0003, 0x007c,
1685 0x1078, 0x44d1, 0x2001, 0x0000, 0x007c, 0x0c7e, 0x077e, 0x6f14,
1686 0x1078, 0x36b0, 0x077f, 0x0c7f, 0x2001, 0x0000, 0x007c, 0x1078,
1687 0x457e, 0x1078, 0x4536, 0x2001, 0x0006, 0x007c, 0x6904, 0xa18c,
1688 0x00ff, 0xa186, 0x0007, 0x0040, 0x4471, 0xa186, 0x000f, 0x00c0,
1689 0x4475, 0x1078, 0x45b5, 0x1078, 0x426f, 0x70b4, 0xa080, 0x00cd,
1690 0x781a, 0x1078, 0x45bc, 0x7003, 0x0000, 0x007c, 0x7aa8, 0xa294,
1691 0x00ff, 0x78a8, 0xa084, 0x00ff, 0xa08a, 0x0004, 0x00c8, 0x4536,
1692 0x1079, 0x448b, 0x007c, 0x4536, 0x448f, 0x4536, 0x44df, 0xa282,
1693 0x0003, 0x0040, 0x4496, 0x1078, 0x4536, 0x007c, 0x7da8, 0xa5ac,
1694 0x00ff, 0x7ca8, 0xa4a4, 0x00ff, 0xa482, 0x000c, 0x0048, 0x44a4,
1695 0x0040, 0x44a4, 0x2021, 0x000c, 0x701c, 0xa502, 0x00c8, 0x44a9,
1696 0x751c, 0x1078, 0x451c, 0x852b, 0x852b, 0x1078, 0x372e, 0x0040,
1697 0x44b5, 0x1078, 0x44c3, 0x0078, 0x44b9, 0x1078, 0x4518, 0x1078,
1698 0x44d1, 0xa6b5, 0x1000, 0x7e5a, 0x70b4, 0xa080, 0x00b9, 0x781a,
1699 0x2001, 0x0004, 0x007c, 0x0c7e, 0x6914, 0x810f, 0xa18c, 0x000f,
1700 0x810b, 0x810b, 0x810b, 0xa1e0, 0x5280, 0x1078, 0x3538, 0x0c7f,
1701 0x007c, 0x0c7e, 0x6814, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003,
1702 0x8003, 0xa0e0, 0x5280, 0x1078, 0x355f, 0x0c7f, 0x007c, 0xa282,
1703 0x0002, 0x00c0, 0x4536, 0x7aa8, 0xa294, 0x00ff, 0xa284, 0xfffe,
1704 0x0040, 0x44ec, 0x2011, 0x0001, 0x1078, 0x450a, 0x1078, 0x44fc,
1705 0x1078, 0x44d1, 0xa6b5, 0x1000, 0x7e5a, 0x70b4, 0xa080, 0x00b9,
1706 0x781a, 0x2001, 0x0004, 0x007c, 0x0c7e, 0x6814, 0x8007, 0xa084,
1707 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e0, 0x5280, 0x1078, 0x3604,
1708 0x0c7f, 0x007c, 0x789b, 0x0018, 0x78ab, 0x0001, 0x78ab, 0x0002,
1709 0x78ab, 0x0003, 0x7aaa, 0x789b, 0x0081, 0x78ab, 0x0004, 0x007c,
1710 0x2021, 0x0000, 0x2029, 0x0032, 0x789b, 0x0018, 0x78ab, 0x0001,
1711 0x78ab, 0x0003, 0x78ab, 0x0001, 0x7daa, 0x7caa, 0x789b, 0x0081,
1712 0x78ab, 0x0005, 0x007c, 0x2001, 0x0003, 0x1078, 0x4544, 0x70b4,
1713 0xa080, 0x00b9, 0x781a, 0x2001, 0x0005, 0x007c, 0x2001, 0x0007,
1714 0x1078, 0x4544, 0xa6b5, 0x1000, 0x7e5a, 0x70b4, 0xa080, 0x00b9,
1715 0x781a, 0x2001, 0x0004, 0x007c, 0x789b, 0x0018, 0x78aa, 0x789b,
1716 0x0081, 0x78ab, 0x0001, 0x007c, 0x6904, 0xa18c, 0x00ff, 0xa196,
1717 0x0007, 0x0040, 0x455a, 0xa196, 0x000f, 0x0040, 0x455a, 0x1078,
1718 0x193d, 0x007c, 0x6924, 0xa194, 0x003f, 0x00c0, 0x4563, 0xa18c,
1719 0xffc0, 0xa105, 0x6826, 0x1078, 0x3ac2, 0x691c, 0xa184, 0x0100,
1720 0x0040, 0x4572, 0x1078, 0x1b7e, 0x6914, 0x1078, 0x3b33, 0x6204,
1721 0x8210, 0x6206, 0x007c, 0x692c, 0x6834, 0x682e, 0xa112, 0x6930,
1722 0x6838, 0x6832, 0xa11b, 0xa200, 0xa301, 0x007c, 0x0c7e, 0xade0,
1723 0x0018, 0x6003, 0x0070, 0x6106, 0x600b, 0x0000, 0x600f, 0x0a00,
1724 0x6013, 0x0000, 0x6017, 0x0000, 0x8007, 0x601a, 0x601f, 0x0000,
1725 0x6023, 0x0000, 0x0c7f, 0x6824, 0xa085, 0x0080, 0x6826, 0x007c,
1726 0x157e, 0x137e, 0x147e, 0x2098, 0xaf80, 0x002d, 0x20a0, 0x81ac,
1727 0x0040, 0x45a3, 0x53a6, 0xa184, 0x0001, 0x0040, 0x45a9, 0x3304,
1728 0x78be, 0x147f, 0x137f, 0x157f, 0x007c, 0x70b0, 0xa005, 0x10c0,
1729 0x23ca, 0x70b3, 0x8000, 0x0078, 0x48f7, 0x71b0, 0x81ff, 0x0040,
1730 0x45bb, 0x1078, 0x49ed, 0x007c, 0x71b0, 0x81ff, 0x0040, 0x45c4,
1731 0x70b3, 0x0000, 0x1078, 0x4633, 0x007c, 0x0c7e, 0x0d7e, 0x1078,
1732 0x191a, 0x0c7f, 0x157e, 0x137e, 0x147e, 0x2da0, 0x2c98, 0x20a9,
1733 0x0031, 0x53a3, 0x147f, 0x137f, 0x157f, 0x6807, 0x010d, 0x680b,
1734 0x0000, 0x7004, 0x8007, 0x681a, 0x6823, 0x0000, 0x681f, 0x0000,
1735 0x689f, 0x0000, 0x0c7f, 0x007c, 0x70b4, 0xa080, 0x0091, 0x781a,
1736 0x0078, 0x2438, 0x70b4, 0xa080, 0x0081, 0x781a, 0x0078, 0x2438,
1737 0x70b4, 0xa080, 0x00b9, 0x781a, 0x0078, 0x2438, 0x70b4, 0xa080,
1738 0x00c3, 0x781a, 0x0078, 0x2438, 0x6904, 0xa18c, 0x00ff, 0xa196,
1739 0x0007, 0x0040, 0x4609, 0xa196, 0x000f, 0x0040, 0x4609, 0x6807,
1740 0x0117, 0x2001, 0x0200, 0x6826, 0x8007, 0x789b, 0x000e, 0x78aa,
1741 0x6820, 0xa085, 0x8000, 0x6822, 0x2031, 0x0400, 0x6eb6, 0x7e5a,
1742 0x71b4, 0xa188, 0x0091, 0x791a, 0x007c, 0x1078, 0x45bc, 0x7848,
1743 0xa085, 0x000c, 0x784a, 0x70b4, 0xa080, 0x00cd, 0x781a, 0x2009,
1744 0x000b, 0x2001, 0x4400, 0x1078, 0x457e, 0x2001, 0x0013, 0x1078,
1745 0x454c, 0x0078, 0x3b60, 0x127e, 0x2091, 0x2200, 0x2049, 0x4633,
1746 0x7000, 0x7204, 0xa205, 0x720c, 0xa215, 0x7008, 0xa084, 0xfff7,
1747 0xa205, 0x0040, 0x4645, 0x0078, 0x464a, 0x7003, 0x0000, 0x127f,
1748 0x2000, 0x007c, 0x7000, 0xa084, 0x0001, 0x00c0, 0x4678, 0x7108,
1749 0x8103, 0x00c8, 0x4657, 0x1078, 0x477a, 0x0078, 0x464f, 0x700c,
1750 0xa08c, 0x00ff, 0x0040, 0x4678, 0x7004, 0x8004, 0x00c8, 0x466f,
1751 0x7014, 0xa005, 0x00c0, 0x466b, 0x7010, 0xa005, 0x0040, 0x466f,
1752 0xa102, 0x00c8, 0x464f, 0x7007, 0x0010, 0x0078, 0x4678, 0x8aff,
1753 0x0040, 0x4678, 0x1078, 0x49c4, 0x00c0, 0x4672, 0x0040, 0x464f,
1754 0x1078, 0x4703, 0x7003, 0x0000, 0x127f, 0x2000, 0x007c, 0x017e,
1755 0x6104, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x468b, 0xa18e,
1756 0x000f, 0x00c0, 0x468e, 0x6040, 0x0078, 0x468f, 0x6428, 0x017f,
1757 0x84ff, 0x0040, 0x46b9, 0x2c70, 0x7004, 0xa0bc, 0x000f, 0xa7b8,
1758 0x46c9, 0x273c, 0x87fb, 0x00c0, 0x46a7, 0x0048, 0x46a1, 0x1078,
1759 0x23ca, 0x609c, 0xa075, 0x0040, 0x46b9, 0x0078, 0x4694, 0x2704,
1760 0xae68, 0x6808, 0xa630, 0x680c, 0xa529, 0x8421, 0x0040, 0x46b9,
1761 0x8738, 0x2704, 0xa005, 0x00c0, 0x46a8, 0x709c, 0xa075, 0x00c0,
1762 0x4694, 0x007c, 0x0000, 0x0005, 0x0009, 0x000d, 0x0011, 0x0015,
1763 0x0019, 0x001d, 0x0000, 0x0003, 0x0009, 0x000f, 0x0015, 0x001b,
1764 0x0000, 0x0000, 0x46be, 0x46bb, 0x0000, 0x0000, 0x8000, 0x0000,
1765 0x46be, 0x0000, 0x46c6, 0x46c3, 0x0000, 0x0000, 0x0000, 0x0000,
1766 0x46c6, 0x0000, 0x46c1, 0x46c1, 0x0000, 0x0000, 0x8000, 0x0000,
1767 0x46c1, 0x0000, 0x46c7, 0x46c7, 0x0000, 0x0000, 0x0000, 0x0000,
1768 0x46c7, 0x127e, 0x2091, 0x2200, 0x2079, 0x5000, 0x2071, 0x0010,
1769 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, 0x0000, 0x2071, 0x0020,
1770 0x7007, 0x000a, 0x7007, 0x0002, 0x7003, 0x0000, 0x2049, 0x0000,
1771 0x127f, 0x2000, 0x007c, 0x2049, 0x4703, 0x2019, 0x0000, 0x7004,
1772 0x8004, 0x00c8, 0x4756, 0x7007, 0x0012, 0x7108, 0x7008, 0xa106,
1773 0x00c0, 0x470d, 0xa184, 0x01e0, 0x0040, 0x4718, 0x1078, 0x23ca,
1774 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x00c8, 0x4723, 0xa184,
1775 0x4000, 0x00c0, 0x470d, 0xa19c, 0x300c, 0xa386, 0x2004, 0x0040,
1776 0x4731, 0xa386, 0x0008, 0x0040, 0x473c, 0xa386, 0x200c, 0x00c0,
1777 0x470d, 0x7200, 0x8204, 0x0048, 0x473c, 0x730c, 0xa384, 0x00ff,
1778 0x0040, 0x473c, 0x1078, 0x23ca, 0x7007, 0x0012, 0x7000, 0xa084,
1779 0x0001, 0x00c0, 0x4756, 0x7008, 0xa084, 0x01e0, 0x00c0, 0x4756,
1780 0x7310, 0x7014, 0xa305, 0x0040, 0x4756, 0x710c, 0xa184, 0x0300,
1781 0x00c0, 0x4756, 0xa184, 0x00ff, 0x00c0, 0x4703, 0x7007, 0x0012,
1782 0x7007, 0x0008, 0x7004, 0xa084, 0x0008, 0x00c0, 0x475a, 0x7007,
1783 0x0012, 0x7108, 0x8103, 0x0048, 0x475f, 0x7003, 0x0000, 0x2049,
1784 0x0000, 0x007c, 0x107e, 0x007e, 0x127e, 0x157e, 0x2091, 0x2200,
1785 0x7108, 0x1078, 0x477a, 0x157f, 0x127f, 0x2091, 0x8001, 0x007f,
1786 0x107f, 0x007c, 0x7204, 0x7500, 0x730c, 0xa384, 0x0300, 0x00c0,
1787 0x47a1, 0xa184, 0x01e0, 0x00c0, 0x47c5, 0x7108, 0xa184, 0x01e0,
1788 0x00c0, 0x47c5, 0x2001, 0x04fd, 0x2004, 0xa082, 0x0005, 0x00c8,
1789 0x4795, 0xa184, 0x4000, 0x00c0, 0x4785, 0xa184, 0x0007, 0x0079,
1790 0x4799, 0x47a3, 0x47b5, 0x47a1, 0x47b5, 0x47a1, 0x4801, 0x47a1,
1791 0x47ff, 0x1078, 0x23ca, 0x7004, 0xa084, 0x0010, 0xa085, 0x0002,
1792 0x7006, 0x8aff, 0x00c0, 0x47b0, 0x2049, 0x0000, 0x0078, 0x47b4,
1793 0x1078, 0x49c4, 0x00c0, 0x47b0, 0x007c, 0x7004, 0xa084, 0x0010,
1794 0xa085, 0x0002, 0x7006, 0x8aff, 0x00c0, 0x47c0, 0x0078, 0x47c4,
1795 0x1078, 0x49c4, 0x00c0, 0x47c0, 0x007c, 0x7007, 0x0012, 0x7108,
1796 0x00e0, 0x47c8, 0x2091, 0x6000, 0x00e0, 0x47cc, 0x2091, 0x6000,
1797 0x7007, 0x0012, 0x7007, 0x0008, 0x7004, 0xa084, 0x0008, 0x00c0,
1798 0x47d4, 0x7007, 0x0012, 0x7108, 0x8103, 0x0048, 0x47d9, 0x7003,
1799 0x0000, 0x7000, 0xa005, 0x00c0, 0x47ed, 0x7004, 0xa005, 0x00c0,
1800 0x47ed, 0x700c, 0xa005, 0x0040, 0x47ef, 0x0078, 0x47d0, 0x2049,
1801 0x0000, 0x1078, 0x37d7, 0x6818, 0xa084, 0x8000, 0x0040, 0x47fa,
1802 0x681b, 0x0002, 0x007c, 0x1078, 0x23ca, 0x1078, 0x23ca, 0x1078,
1803 0x485d, 0x7210, 0x7114, 0x700c, 0xa09c, 0x00ff, 0x2800, 0xa300,
1804 0xa211, 0xa189, 0x0000, 0x1078, 0x485d, 0x2704, 0x2c58, 0xac60,
1805 0x6308, 0x2200, 0xa322, 0x630c, 0x2100, 0xa31b, 0x2400, 0xa305,
1806 0x0040, 0x4824, 0x00c8, 0x4824, 0x8412, 0x8210, 0x830a, 0xa189,
1807 0x0000, 0x2b60, 0x0078, 0x480b, 0x2b60, 0x8a07, 0x007e, 0x6004,
1808 0xa084, 0x0008, 0x0040, 0x4830, 0xa7ba, 0x46c3, 0x0078, 0x4832,
1809 0xa7ba, 0x46bb, 0x007f, 0xa73d, 0x2c00, 0x6886, 0x6f8a, 0x6c92,
1810 0x6b8e, 0x7007, 0x0012, 0x1078, 0x4703, 0x007c, 0x8738, 0x2704,
1811 0xa005, 0x00c0, 0x4851, 0x609c, 0xa005, 0x0040, 0x485a, 0x2060,
1812 0x6004, 0xa084, 0x000f, 0xa080, 0x46c9, 0x203c, 0x87fb, 0x1040,
1813 0x23ca, 0x8a51, 0x0040, 0x4859, 0x7008, 0xa084, 0x0003, 0xa086,
1814 0x0003, 0x007c, 0x2051, 0x0000, 0x007c, 0x8a50, 0x8739, 0x2704,
1815 0xa004, 0x00c0, 0x4871, 0x6000, 0xa064, 0x00c0, 0x4868, 0x2d60,
1816 0x6004, 0xa084, 0x000f, 0xa080, 0x46d9, 0x203c, 0x87fb, 0x1040,
1817 0x23ca, 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x6884,
1818 0x2060, 0x6888, 0x6b8c, 0x6c90, 0x8057, 0xaad4, 0x00ff, 0xa084,
1819 0x00ff, 0x007e, 0x6804, 0xa084, 0x0008, 0x007f, 0x0040, 0x488c,
1820 0xa0b8, 0x46c3, 0x0078, 0x488e, 0xa0b8, 0x46bb, 0x7e08, 0xa6b5,
1821 0x000c, 0x6904, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x489c,
1822 0xa18e, 0x000f, 0x00c0, 0x48a5, 0x681c, 0xa084, 0x0040, 0x0040,
1823 0x48ac, 0xa6b5, 0x0001, 0x0078, 0x48ac, 0x681c, 0xa084, 0x0040,
1824 0x0040, 0x48ac, 0xa6b5, 0x0001, 0x7007, 0x0004, 0x7004, 0xa084,
1825 0x0004, 0x00c0, 0x48ae, 0x2400, 0xa305, 0x00c0, 0x48b9, 0x0078,
1826 0x48df, 0x2c58, 0x2704, 0x6104, 0xac60, 0x6000, 0xa400, 0x701a,
1827 0x6004, 0xa301, 0x701e, 0xa184, 0x0008, 0x0040, 0x48cf, 0x6010,
1828 0xa081, 0x0000, 0x7022, 0x6014, 0xa081, 0x0000, 0x7026, 0x6208,
1829 0x2400, 0xa202, 0x7012, 0x620c, 0x2300, 0xa203, 0x7016, 0x7602,
1830 0x7007, 0x0001, 0x2b60, 0x1078, 0x483e, 0x0078, 0x48e1, 0x1078,
1831 0x49c4, 0x00c0, 0x48df, 0x127f, 0x2000, 0x007c, 0x127e, 0x0d7e,
1832 0x2091, 0x2200, 0x0d7f, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004,
1833 0x00c0, 0x48ed, 0x7003, 0x0008, 0x127f, 0x2000, 0x007c, 0x127e,
1834 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x2049, 0x48f7, 0x7007, 0x0004,
1835 0x7004, 0xa084, 0x0004, 0x00c0, 0x4900, 0x7e08, 0xa6b5, 0x000c,
1836 0x6904, 0xa18c, 0x00ff, 0xa186, 0x0007, 0x0040, 0x4913, 0xa18e,
1837 0x000f, 0x00c0, 0x491e, 0x681c, 0xa084, 0x0040, 0x0040, 0x491a,
1838 0xa6b5, 0x0001, 0x6840, 0x2050, 0x0078, 0x4927, 0x681c, 0xa084,
1839 0x0020, 0x00c0, 0x4925, 0xa6b5, 0x0001, 0x6828, 0x2050, 0x2d60,
1840 0x6004, 0xa0bc, 0x000f, 0xa7b8, 0x46c9, 0x273c, 0x87fb, 0x00c0,
1841 0x493b, 0x0048, 0x4935, 0x1078, 0x23ca, 0x689c, 0xa065, 0x0040,
1842 0x493f, 0x0078, 0x4928, 0x1078, 0x49c4, 0x00c0, 0x493b, 0x127f,
1843 0x2000, 0x007c, 0x127e, 0x007e, 0x017e, 0x0d7e, 0x2091, 0x2200,
1844 0x0d7f, 0x037f, 0x047f, 0x7e08, 0xa6b5, 0x000c, 0x6904, 0xa18c,
1845 0x00ff, 0xa186, 0x0007, 0x0040, 0x4959, 0xa18e, 0x000f, 0x00c0,
1846 0x4962, 0x681c, 0xa084, 0x0040, 0x0040, 0x4969, 0xa6b5, 0x0001,
1847 0x0078, 0x4969, 0x681c, 0xa084, 0x0040, 0x0040, 0x4969, 0xa6b5,
1848 0x0001, 0x2049, 0x4942, 0x017e, 0x6904, 0xa18c, 0x00ff, 0xa186,
1849 0x0007, 0x0040, 0x4977, 0xa18e, 0x000f, 0x00c0, 0x497a, 0x6840,
1850 0x0078, 0x497b, 0x6828, 0x017f, 0xa055, 0x0040, 0x49c1, 0x2d70,
1851 0x2e60, 0x7004, 0xa0bc, 0x000f, 0xa7b8, 0x46c9, 0x273c, 0x87fb,
1852 0x00c0, 0x4995, 0x0048, 0x498e, 0x1078, 0x23ca, 0x709c, 0xa075,
1853 0x2060, 0x0040, 0x49c1, 0x0078, 0x4981, 0x2704, 0xae68, 0x6808,
1854 0xa422, 0x680c, 0xa31b, 0x0048, 0x49ae, 0x8a51, 0x00c0, 0x49a2,
1855 0x1078, 0x23ca, 0x8738, 0x2704, 0xa005, 0x00c0, 0x4996, 0x709c,
1856 0xa075, 0x2060, 0x0040, 0x49c1, 0x0078, 0x4981, 0x8422, 0x8420,
1857 0x831a, 0xa399, 0x0000, 0x6908, 0x2400, 0xa122, 0x690c, 0x2300,
1858 0xa11b, 0x00c8, 0x49bd, 0x1078, 0x23ca, 0x2071, 0x0020, 0x0078,
1859 0x48ac, 0x127f, 0x2000, 0x007c, 0x7008, 0xa084, 0x0003, 0xa086,
1860 0x0003, 0x0040, 0x49ec, 0x2704, 0xac08, 0x2104, 0x701a, 0x8108,
1861 0x2104, 0x701e, 0x8108, 0x2104, 0x7012, 0x8108, 0x2104, 0x7016,
1862 0x6004, 0xa084, 0x0008, 0x0040, 0x49e3, 0x8108, 0x2104, 0x7022,
1863 0x8108, 0x2104, 0x7026, 0x7602, 0x7004, 0xa084, 0x0010, 0xa085,
1864 0x0001, 0x7006, 0x1078, 0x483e, 0x007c, 0x127e, 0x007e, 0x0d7e,
1865 0x2091, 0x2200, 0x2049, 0x49ed, 0x0d7f, 0x087f, 0x7108, 0xa184,
1866 0x0003, 0x00c0, 0x4a17, 0x017e, 0x6904, 0xa18c, 0x00ff, 0xa186,
1867 0x0007, 0x0040, 0x4a07, 0xa18e, 0x000f, 0x00c0, 0x4a0a, 0x6840,
1868 0x0078, 0x4a0b, 0x6828, 0x017f, 0xa005, 0x0040, 0x4a25, 0x0078,
1869 0x464a, 0x0020, 0x4a17, 0x1078, 0x4801, 0x0078, 0x4a25, 0x00a0,
1870 0x4a1e, 0x7108, 0x1078, 0x477a, 0x0078, 0x49f6, 0x7007, 0x0010,
1871 0x00a0, 0x4a20, 0x7108, 0x1078, 0x477a, 0x7008, 0xa086, 0x0008,
1872 0x00c0, 0x49f6, 0x7000, 0xa005, 0x00c0, 0x49f6, 0x7003, 0x0000,
1873 0x2049, 0x0000, 0x127f, 0x2000, 0x007c, 0x127e, 0x147e, 0x137e,
1874 0x157e, 0x0c7e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x2049, 0x4a35,
1875 0xad80, 0x0011, 0x20a0, 0x2099, 0x0031, 0x700c, 0xa084, 0x00ff,
1876 0x682a, 0x7007, 0x0008, 0x7007, 0x0002, 0x7003, 0x0001, 0x0040,
1877 0x4a54, 0x8000, 0x80ac, 0x53a5, 0x7007, 0x0004, 0x7004, 0xa084,
1878 0x0004, 0x00c0, 0x4a56, 0x0c7f, 0x2049, 0x0000, 0x7003, 0x0000,
1879 0x157f, 0x137f, 0x147f, 0x127f, 0x2000, 0x007c, 0x2091, 0x6000,
1880 0x2091, 0x8000, 0x78cc, 0xa005, 0x0040, 0x4a7d, 0x7994, 0x70d0,
1881 0xa106, 0x00c0, 0x4a7d, 0x7804, 0xa005, 0x0040, 0x4a7d, 0x7807,
1882 0x0000, 0x0068, 0x4a7d, 0x2091, 0x4080, 0x7820, 0x8001, 0x7822,
1883 0x00c0, 0x4ad8, 0x7824, 0x7822, 0x2069, 0x5040, 0x6800, 0xa084,
1884 0x0007, 0x0040, 0x4a9b, 0xa086, 0x0002, 0x0040, 0x4a9b, 0x6834,
1885 0xa00d, 0x0040, 0x4a9b, 0x2104, 0xa005, 0x0040, 0x4a9b, 0x8001,
1886 0x200a, 0x0040, 0x4b80, 0x7848, 0xa005, 0x0040, 0x4aa9, 0x8001,
1887 0x784a, 0x00c0, 0x4aa9, 0x2009, 0x0102, 0x6844, 0x200a, 0x1078,
1888 0x21b1, 0x6890, 0xa005, 0x0040, 0x4ab5, 0x8001, 0x6892, 0x00c0,
1889 0x4ab5, 0x686f, 0x0000, 0x6873, 0x0001, 0x2061, 0x5300, 0x20a9,
1890 0x0100, 0x2009, 0x0002, 0x6034, 0xa005, 0x0040, 0x4acb, 0x8001,
1891 0x6036, 0x00c0, 0x4acb, 0x6010, 0xa005, 0x0040, 0x4acb, 0x017e,
1892 0x1078, 0x21b1, 0x017f, 0xace0, 0x0010, 0x0070, 0x4ad1, 0x0078,
1893 0x4abb, 0x8109, 0x0040, 0x4ad8, 0x20a9, 0x0100, 0x0078, 0x4abb,
1894 0x1078, 0x4ae5, 0x1078, 0x4b0a, 0x2009, 0x5051, 0x2104, 0x2009,
1895 0x0102, 0x200a, 0x2091, 0x8001, 0x007c, 0x7834, 0x8001, 0x7836,
1896 0x00c0, 0x4b09, 0x7838, 0x7836, 0x2091, 0x8000, 0x7844, 0xa005,
1897 0x00c0, 0x4af4, 0x2001, 0x0101, 0x8001, 0x7846, 0xa080, 0x7300,
1898 0x2040, 0x2004, 0xa065, 0x0040, 0x4b09, 0x6024, 0xa005, 0x0040,
1899 0x4b05, 0x8001, 0x6026, 0x0040, 0x4b39, 0x6000, 0x2c40, 0x0078,
1900 0x4afa, 0x007c, 0x7828, 0x8001, 0x782a, 0x00c0, 0x4b38, 0x782c,
1901 0x782a, 0x7830, 0xa005, 0x00c0, 0x4b17, 0x2001, 0x0200, 0x8001,
1902 0x7832, 0x8003, 0x8003, 0x8003, 0x8003, 0xa090, 0x5300, 0xa298,
1903 0x0002, 0x2304, 0xa084, 0x0008, 0x0040, 0x4b38, 0xa290, 0x0009,
1904 0x2204, 0xa005, 0x0040, 0x4b30, 0x8001, 0x2012, 0x00c0, 0x4b38,
1905 0x2304, 0xa084, 0xfff7, 0xa085, 0x0080, 0x201a, 0x1078, 0x21b1,
1906 0x007c, 0x2069, 0x5040, 0x6800, 0xa005, 0x0040, 0x4b43, 0x6848,
1907 0xac06, 0x0040, 0x4b80, 0x601b, 0x0006, 0x60b4, 0xa084, 0x3f00,
1908 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085, 0x0060, 0x6022, 0x6000,
1909 0x2042, 0x6714, 0x6f82, 0x1078, 0x1956, 0x6818, 0xa005, 0x0040,
1910 0x4b5b, 0x8001, 0x681a, 0x6808, 0xa084, 0xffef, 0x680a, 0x6810,
1911 0x8001, 0x00d0, 0x4b65, 0x1078, 0x23ca, 0x6812, 0x602f, 0x0000,
1912 0x6033, 0x0000, 0x2c68, 0x1078, 0x1c53, 0x2069, 0x5040, 0x7944,
1913 0xa184, 0x0100, 0x2001, 0x0006, 0x686e, 0x00c0, 0x4b7b, 0x6986,
1914 0x2001, 0x0004, 0x686e, 0x1078, 0x21ac, 0x2091, 0x8001, 0x007c,
1915 0x2069, 0x0100, 0x2009, 0x5040, 0x2104, 0xa084, 0x0007, 0x0040,
1916 0x4bdc, 0xa086, 0x0007, 0x00c0, 0x4b96, 0x0d7e, 0x2009, 0x5052,
1917 0x216c, 0x1078, 0x3a1a, 0x0d7f, 0x0078, 0x4bdc, 0x2009, 0x5052,
1918 0x2164, 0x1078, 0x2375, 0x601b, 0x0006, 0x6858, 0xa084, 0x3f00,
1919 0x601e, 0x6020, 0xa084, 0x00ff, 0xa085, 0x0048, 0x6022, 0x602f,
1920 0x0000, 0x6033, 0x0000, 0x6830, 0xa084, 0x0040, 0x0040, 0x4bd0,
1921 0x684b, 0x0004, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0004, 0x0040,
1922 0x4bbd, 0x0070, 0x4bbd, 0x0078, 0x4bb4, 0x684b, 0x0009, 0x20a9,
1923 0x0014, 0x6848, 0xa084, 0x0001, 0x0040, 0x4bca, 0x0070, 0x4bca,
1924 0x0078, 0x4bc1, 0x20a9, 0x00fa, 0x0070, 0x4bd0, 0x0078, 0x4bcc,
1925 0x6808, 0xa084, 0xfffd, 0x680a, 0x681b, 0x0048, 0x2009, 0x505b,
1926 0x200b, 0x0007, 0x784c, 0x784a, 0x2091, 0x8001, 0x007c, 0x2079,
1927 0x5000, 0x1078, 0x4c0a, 0x1078, 0x4bee, 0x1078, 0x4bfc, 0x7833,
1928 0x0000, 0x7847, 0x0000, 0x784b, 0x0000, 0x007c, 0x2019, 0x0003,
1929 0x2011, 0x5046, 0x2204, 0xa086, 0x003c, 0x0040, 0x4bf9, 0x2019,
1930 0x0002, 0x7b2a, 0x7b2e, 0x007c, 0x2019, 0x0039, 0x2011, 0x5046,
1931 0x2204, 0xa086, 0x003c, 0x0040, 0x4c07, 0x2019, 0x0027, 0x7b36,
1932 0x7b3a, 0x007c, 0x2019, 0x3971, 0x2011, 0x5046, 0x2204, 0xa086,
1933 0x003c, 0x0040, 0x4c15, 0x2019, 0x2626, 0x7b22, 0x7b26, 0x783f,
1934 0x0000, 0x7843, 0x000a, 0x007c, 0x0020, 0x002b, 0x0000, 0x0020,
1935 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1936 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1937 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1938 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0014,
1939 0x0014, 0x9849, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014,
1940 0x0014, 0x0080, 0x000f, 0x0000, 0x0201, 0x0604, 0x0c08, 0x2120,
1941 0x4022, 0xf880, 0x0018, 0x300b, 0xa201, 0x0014, 0xa200, 0x0014,
1942 0xa200, 0x0214, 0x0000, 0x006c, 0x0002, 0x0014, 0x98d5, 0x009e,
1943 0x009b, 0xa202, 0x8838, 0x3806, 0x8839, 0x20c3, 0x0864, 0x9889,
1944 0x28c1, 0x9cb6, 0xa203, 0x300c, 0x2846, 0x8161, 0x846a, 0x8300,
1945 0x1856, 0x883a, 0x9865, 0x28f2, 0x9c95, 0x9858, 0x300c, 0x28e1,
1946 0x9c95, 0x2809, 0xa206, 0x64c0, 0x67a0, 0x6fc0, 0x1814, 0x883b,
1947 0x782c, 0x786d, 0x9879, 0x282b, 0xa207, 0x64a0, 0x67a0, 0x6fc0,
1948 0x1814, 0x883b, 0x7822, 0x883e, 0x987d, 0x8576, 0x8677, 0x206b,
1949 0x28c1, 0x9cb6, 0x2044, 0x2103, 0x20a2, 0x2081, 0x9865, 0xa209,
1950 0x2901, 0x9891, 0x0014, 0xa205, 0xa300, 0x1872, 0x879a, 0x883c,
1951 0x1fe2, 0xc601, 0xa20a, 0x856e, 0x0704, 0x9c95, 0x0014, 0xa204,
1952 0xa300, 0x3009, 0x19e2, 0xf868, 0x8176, 0x86eb, 0x85eb, 0x872e,
1953 0x87a9, 0x883f, 0x08e6, 0x9895, 0xf881, 0x9890, 0xc801, 0x0014,
1954 0xf8c1, 0x0016, 0x85b2, 0x80f0, 0x9532, 0xfb02, 0x1de2, 0x0014,
1955 0x8532, 0xf241, 0x0014, 0x1de2, 0x84a8, 0xd7a0, 0x1fe6, 0x0014,
1956 0xa208, 0x6043, 0x8008, 0x1dc1, 0x0016, 0x8300, 0x8160, 0x842a,
1957 0xf041, 0x3008, 0x84a8, 0x11d6, 0x7042, 0x20dd, 0x0011, 0x20d5,
1958 0x8822, 0x0016, 0x8000, 0x2847, 0x1011, 0x98c8, 0x8000, 0xa000,
1959 0x2802, 0x1011, 0x98ce, 0x9865, 0x283e, 0x1011, 0x98d2, 0xa20b,
1960 0x0017, 0x300c, 0xa300, 0x1de2, 0xdb81, 0x0014, 0x0210, 0x98df,
1961 0x0014, 0x26e0, 0x873a, 0xfb02, 0x19f2, 0x1fe2, 0x0014, 0xa20d,
1962 0x3806, 0x0210, 0x9cbb, 0x0704, 0x0000, 0x006c, 0x0002, 0x984f,
1963 0x0014, 0x009e, 0x00a0, 0x0017, 0x60ff, 0x300c, 0x8720, 0xa211,
1964 0x9cd0, 0x8772, 0x8837, 0x2101, 0x987a, 0x10d2, 0x78e2, 0x9cd3,
1965 0x9859, 0xd984, 0xf0e2, 0xf0a1, 0x98cd, 0x0014, 0x8831, 0xd166,
1966 0x8830, 0x800f, 0x9401, 0xb520, 0xc802, 0x8820, 0x987a, 0x2301,
1967 0x987a, 0x10d2, 0x78e4, 0x9cd3, 0x8821, 0x8820, 0x9859, 0xf123,
1968 0xf142, 0xf101, 0x98c6, 0x10d2, 0x70f6, 0x8832, 0x8203, 0x870c,
1969 0xd99e, 0x6001, 0x0014, 0x6845, 0x0214, 0xa21b, 0x9cd0, 0x2001,
1970 0x98c5, 0x8201, 0x1852, 0xd184, 0xd163, 0x8834, 0x8001, 0x988d,
1971 0x3027, 0x84a8, 0x1a56, 0x8833, 0x0014, 0xa218, 0x6981, 0x9cbc,
1972 0x6b2a, 0x6902, 0x1834, 0x989d, 0x1814, 0x8010, 0x8592, 0x8026,
1973 0x84b9, 0x7021, 0x0014, 0xa300, 0x69e1, 0x9ca9, 0x694b, 0xa213,
1974 0x1462, 0xa213, 0x8000, 0x16e1, 0x98b5, 0x8023, 0x16e1, 0x8001,
1975 0x10f1, 0x0016, 0x6969, 0xa214, 0x61c2, 0x8002, 0x14e1, 0x8004,
1976 0x16e1, 0x0101, 0x300a, 0x8827, 0x0014, 0xa217, 0x9cbc, 0x0014,
1977 0xa300, 0x8181, 0x842a, 0x84a8, 0x1ce6, 0x882c, 0x0016, 0xa212,
1978 0x9cd0, 0x10d2, 0x70e4, 0x0004, 0x8007, 0x9424, 0xcc1a, 0x9cd3,
1979 0x98c5, 0x8827, 0x300a, 0x0013, 0x8000, 0x84a4, 0x0016, 0x11c2,
1980 0x211e, 0x870e, 0xa21d, 0x0014, 0x878e, 0x0016, 0xa21c, 0x1035,
1981 0x9891, 0xa210, 0xa000, 0x8010, 0x8592, 0x853b, 0xd044, 0x8022,
1982 0x3807, 0x84bb, 0x98ea, 0x8021, 0x3807, 0x84b9, 0x300c, 0x817e,
1983 0x872b, 0x8772, 0x9891, 0x0000, 0x0020, 0x002b, 0x0000, 0x0020,
1984 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1985 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1986 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020,
1987 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0020, 0x0000, 0x0014,
1988 0x0014, 0x9849, 0x0014, 0x0014, 0x98ea, 0x98d5, 0x0014, 0x0014,
1989 0x0014, 0x0080, 0x013f, 0x0000, 0x0201, 0x0604, 0x0c08, 0x2120,
1990 0x4022, 0xf880, 0x0018, 0x300b, 0xa201, 0x0014, 0xa200, 0x0014,
1991 0xa200, 0x0214, 0xa202, 0x8838, 0x3806, 0x8839, 0x20c3, 0x0864,
1992 0xa833, 0x28c1, 0x9cb6, 0xa203, 0x300c, 0x2846, 0x8161, 0x846a,
1993 0x8300, 0x1856, 0x883a, 0xa804, 0x28f2, 0x9c95, 0xa8f4, 0x300c,
1994 0x28e1, 0x9c95, 0x2809, 0xa206, 0x64c0, 0x67a0, 0x6fc0, 0x1814,
1995 0x883b, 0x782c, 0x786d, 0xa808, 0x282b, 0xa207, 0x64a0, 0x67a0,
1996 0x6fc0, 0x1814, 0x883b, 0x7822, 0x883e, 0xa802, 0x8576, 0x8677,
1997 0x206b, 0x28c1, 0x9cb6, 0x2044, 0x2103, 0x20a2, 0x2081, 0xa8e0,
1998 0xa209, 0x2901, 0xa809, 0x0014, 0xa205, 0xa300, 0x1872, 0x879a,
1999 0x883c, 0x1fe2, 0xc601, 0xa20a, 0x856e, 0x0704, 0x9c95, 0x0014,
2000 0xa204, 0xa300, 0x3009, 0x19e2, 0xf868, 0x8176, 0x86eb, 0x85eb,
2001 0x872e, 0x87a9, 0x883f, 0x08e6, 0xa8f3, 0xf881, 0xa8ec, 0xc801,
2002 0x0014, 0xf8c1, 0x0016, 0x85b2, 0x80f0, 0x9532, 0xfb02, 0x1de2,
2003 0x0014, 0x8532, 0xf241, 0x0014, 0x1de2, 0x84a8, 0xd7a0, 0x1fe6,
2004 0x0014, 0xa208, 0x6043, 0x8008, 0x1dc1, 0x0016, 0x8300, 0x8160,
2005 0x842a, 0xf041, 0x3008, 0x84a8, 0x11d6, 0x7042, 0x20dd, 0x0011,
2006 0x20d5, 0x8822, 0x0016, 0x8000, 0x2847, 0x1011, 0xa8fc, 0x8000,
2007 0xa000, 0x2802, 0x1011, 0xa8fd, 0xa893, 0x283e, 0x1011, 0xa8fd,
2008 0xa20b, 0x0017, 0x300c, 0xa300, 0x1de2, 0xdb81, 0x0014, 0x0210,
2009 0xa801, 0x0014, 0x26e0, 0x873a, 0xfb02, 0x19f2, 0x1fe2, 0x0014,
2010 0xa20d, 0x3806, 0x0210, 0x9cbb, 0x0704, 0x0017, 0x60ff, 0x300c,
2011 0x8720, 0xa211, 0x9d6b, 0x8772, 0x8837, 0x2101, 0xa821, 0x10d2,
2012 0x78e2, 0x9d6e, 0xa8fc, 0xd984, 0xf0e2, 0xf0a1, 0xa86c, 0x0014,
2013 0x8831, 0xd166, 0x8830, 0x800f, 0x9401, 0xb520, 0xc802, 0x8820,
2014 0xa80f, 0x2301, 0xa80d, 0x10d2, 0x78e4, 0x9d6e, 0x8821, 0x8820,
2015 0xa8e6, 0xf123, 0xf142, 0xf101, 0xa84f, 0x10d2, 0x70f6, 0x8832,
2016 0x8203, 0x870c, 0xd99e, 0x6001, 0x0014, 0x6845, 0x0214, 0xa21b,
2017 0x9d6b, 0x2001, 0xa840, 0x8201, 0x1852, 0xd184, 0xd163, 0x8834,
2018 0x8001, 0xa801, 0x3027, 0x84a8, 0x1a56, 0x8833, 0x0014, 0xa218,
2019 0x6981, 0x9d57, 0x6b2a, 0x6902, 0x1834, 0xa805, 0x1814, 0x8010,
2020 0x8592, 0x8026, 0x84b9, 0x7021, 0x0014, 0xa300, 0x69e1, 0x9d44,
2021 0x694b, 0xa213, 0x1462, 0xa213, 0x8000, 0x16e1, 0xa80c, 0x8023,
2022 0x16e1, 0x8001, 0x10f1, 0x0016, 0x6969, 0xa214, 0x61c2, 0x8002,
2023 0x14e1, 0x8004, 0x16e1, 0x0101, 0x300a, 0x8827, 0x0014, 0xa217,
2024 0x9d57, 0x0014, 0xa300, 0x8181, 0x842a, 0x84a8, 0x1ce6, 0x882c,
2025 0x0016, 0xa212, 0x9d6b, 0x10d2, 0x70e4, 0x0004, 0x8007, 0x9424,
2026 0xcc1a, 0x9d6e, 0xa8f8, 0x8827, 0x300a, 0x0013, 0x8000, 0x84a4,
2027 0x0016, 0x11c2, 0x211e, 0x870e, 0xa21d, 0x0014, 0x878e, 0x0016,
2028 0xa21c, 0x1035, 0xa8b4, 0xa210, 0x3807, 0x300c, 0x817e, 0x872b,
2029 0x8772, 0xa8ad, 0x0000, 0x8ec6
2030};
2031
2032#endif /* RELOAD_FIRMWARE */
2033
2034static const unsigned short risc_code_length01 = 0x3f14;
diff --git a/drivers/scsi/raid_class.c b/drivers/scsi/raid_class.c
index caa0c3629626..5b1c12041a4f 100644
--- a/drivers/scsi/raid_class.c
+++ b/drivers/scsi/raid_class.c
@@ -1,5 +1,13 @@
1/* 1/*
2 * RAID Attributes 2 * raid_class.c - implementation of a simple raid visualisation class
3 *
4 * Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com>
5 *
6 * This file is licensed under GPLv2
7 *
8 * This class is designed to allow raid attributes to be visualised and
9 * manipulated in a form independent of the underlying raid. Ultimately this
10 * should work for both hardware and software raids.
3 */ 11 */
4#include <linux/init.h> 12#include <linux/init.h>
5#include <linux/module.h> 13#include <linux/module.h>
@@ -24,7 +32,7 @@ struct raid_internal {
24 32
25struct raid_component { 33struct raid_component {
26 struct list_head node; 34 struct list_head node;
27 struct device *dev; 35 struct class_device cdev;
28 int num; 36 int num;
29}; 37};
30 38
@@ -74,11 +82,10 @@ static int raid_setup(struct transport_container *tc, struct device *dev,
74 82
75 BUG_ON(class_get_devdata(cdev)); 83 BUG_ON(class_get_devdata(cdev));
76 84
77 rd = kmalloc(sizeof(*rd), GFP_KERNEL); 85 rd = kzalloc(sizeof(*rd), GFP_KERNEL);
78 if (!rd) 86 if (!rd)
79 return -ENOMEM; 87 return -ENOMEM;
80 88
81 memset(rd, 0, sizeof(*rd));
82 INIT_LIST_HEAD(&rd->component_list); 89 INIT_LIST_HEAD(&rd->component_list);
83 class_set_devdata(cdev, rd); 90 class_set_devdata(cdev, rd);
84 91
@@ -90,15 +97,15 @@ static int raid_remove(struct transport_container *tc, struct device *dev,
90{ 97{
91 struct raid_data *rd = class_get_devdata(cdev); 98 struct raid_data *rd = class_get_devdata(cdev);
92 struct raid_component *rc, *next; 99 struct raid_component *rc, *next;
100 dev_printk(KERN_ERR, dev, "RAID REMOVE\n");
93 class_set_devdata(cdev, NULL); 101 class_set_devdata(cdev, NULL);
94 list_for_each_entry_safe(rc, next, &rd->component_list, node) { 102 list_for_each_entry_safe(rc, next, &rd->component_list, node) {
95 char buf[40];
96 snprintf(buf, sizeof(buf), "component-%d", rc->num);
97 list_del(&rc->node); 103 list_del(&rc->node);
98 sysfs_remove_link(&cdev->kobj, buf); 104 dev_printk(KERN_ERR, rc->cdev.dev, "RAID COMPONENT REMOVE\n");
99 kfree(rc); 105 class_device_unregister(&rc->cdev);
100 } 106 }
101 kfree(class_get_devdata(cdev)); 107 dev_printk(KERN_ERR, dev, "RAID REMOVE DONE\n");
108 kfree(rd);
102 return 0; 109 return 0;
103} 110}
104 111
@@ -112,10 +119,11 @@ static struct {
112 enum raid_state value; 119 enum raid_state value;
113 char *name; 120 char *name;
114} raid_states[] = { 121} raid_states[] = {
115 { RAID_ACTIVE, "active" }, 122 { RAID_STATE_UNKNOWN, "unknown" },
116 { RAID_DEGRADED, "degraded" }, 123 { RAID_STATE_ACTIVE, "active" },
117 { RAID_RESYNCING, "resyncing" }, 124 { RAID_STATE_DEGRADED, "degraded" },
118 { RAID_OFFLINE, "offline" }, 125 { RAID_STATE_RESYNCING, "resyncing" },
126 { RAID_STATE_OFFLINE, "offline" },
119}; 127};
120 128
121static const char *raid_state_name(enum raid_state state) 129static const char *raid_state_name(enum raid_state state)
@@ -132,6 +140,33 @@ static const char *raid_state_name(enum raid_state state)
132 return name; 140 return name;
133} 141}
134 142
143static struct {
144 enum raid_level value;
145 char *name;
146} raid_levels[] = {
147 { RAID_LEVEL_UNKNOWN, "unknown" },
148 { RAID_LEVEL_LINEAR, "linear" },
149 { RAID_LEVEL_0, "raid0" },
150 { RAID_LEVEL_1, "raid1" },
151 { RAID_LEVEL_3, "raid3" },
152 { RAID_LEVEL_4, "raid4" },
153 { RAID_LEVEL_5, "raid5" },
154 { RAID_LEVEL_6, "raid6" },
155};
156
157static const char *raid_level_name(enum raid_level level)
158{
159 int i;
160 char *name = NULL;
161
162 for (i = 0; i < sizeof(raid_levels)/sizeof(raid_levels[0]); i++) {
163 if (raid_levels[i].value == level) {
164 name = raid_levels[i].name;
165 break;
166 }
167 }
168 return name;
169}
135 170
136#define raid_attr_show_internal(attr, fmt, var, code) \ 171#define raid_attr_show_internal(attr, fmt, var, code) \
137static ssize_t raid_show_##attr(struct class_device *cdev, char *buf) \ 172static ssize_t raid_show_##attr(struct class_device *cdev, char *buf) \
@@ -161,11 +196,22 @@ static CLASS_DEVICE_ATTR(attr, S_IRUGO, raid_show_##attr, NULL)
161 196
162#define raid_attr_ro(attr) raid_attr_ro_internal(attr, ) 197#define raid_attr_ro(attr) raid_attr_ro_internal(attr, )
163#define raid_attr_ro_fn(attr) raid_attr_ro_internal(attr, ATTR_CODE(attr)) 198#define raid_attr_ro_fn(attr) raid_attr_ro_internal(attr, ATTR_CODE(attr))
164#define raid_attr_ro_state(attr) raid_attr_ro_states(attr, attr, ATTR_CODE(attr)) 199#define raid_attr_ro_state(attr) raid_attr_ro_states(attr, attr, )
200#define raid_attr_ro_state_fn(attr) raid_attr_ro_states(attr, attr, ATTR_CODE(attr))
201
165 202
166raid_attr_ro(level); 203raid_attr_ro_state(level);
167raid_attr_ro_fn(resync); 204raid_attr_ro_fn(resync);
168raid_attr_ro_state(state); 205raid_attr_ro_state_fn(state);
206
207static void raid_component_release(struct class_device *cdev)
208{
209 struct raid_component *rc = container_of(cdev, struct raid_component,
210 cdev);
211 dev_printk(KERN_ERR, rc->cdev.dev, "COMPONENT RELEASE\n");
212 put_device(rc->cdev.dev);
213 kfree(rc);
214}
169 215
170void raid_component_add(struct raid_template *r,struct device *raid_dev, 216void raid_component_add(struct raid_template *r,struct device *raid_dev,
171 struct device *component_dev) 217 struct device *component_dev)
@@ -175,34 +221,36 @@ void raid_component_add(struct raid_template *r,struct device *raid_dev,
175 raid_dev); 221 raid_dev);
176 struct raid_component *rc; 222 struct raid_component *rc;
177 struct raid_data *rd = class_get_devdata(cdev); 223 struct raid_data *rd = class_get_devdata(cdev);
178 char buf[40];
179 224
180 rc = kmalloc(sizeof(*rc), GFP_KERNEL); 225 rc = kzalloc(sizeof(*rc), GFP_KERNEL);
181 if (!rc) 226 if (!rc)
182 return; 227 return;
183 228
184 INIT_LIST_HEAD(&rc->node); 229 INIT_LIST_HEAD(&rc->node);
185 rc->dev = component_dev; 230 class_device_initialize(&rc->cdev);
231 rc->cdev.release = raid_component_release;
232 rc->cdev.dev = get_device(component_dev);
186 rc->num = rd->component_count++; 233 rc->num = rd->component_count++;
187 234
188 snprintf(buf, sizeof(buf), "component-%d", rc->num); 235 snprintf(rc->cdev.class_id, sizeof(rc->cdev.class_id),
236 "component-%d", rc->num);
189 list_add_tail(&rc->node, &rd->component_list); 237 list_add_tail(&rc->node, &rd->component_list);
190 sysfs_create_link(&cdev->kobj, &component_dev->kobj, buf); 238 rc->cdev.parent = cdev;
239 rc->cdev.class = &raid_class.class;
240 class_device_add(&rc->cdev);
191} 241}
192EXPORT_SYMBOL(raid_component_add); 242EXPORT_SYMBOL(raid_component_add);
193 243
194struct raid_template * 244struct raid_template *
195raid_class_attach(struct raid_function_template *ft) 245raid_class_attach(struct raid_function_template *ft)
196{ 246{
197 struct raid_internal *i = kmalloc(sizeof(struct raid_internal), 247 struct raid_internal *i = kzalloc(sizeof(struct raid_internal),
198 GFP_KERNEL); 248 GFP_KERNEL);
199 int count = 0; 249 int count = 0;
200 250
201 if (unlikely(!i)) 251 if (unlikely(!i))
202 return NULL; 252 return NULL;
203 253
204 memset(i, 0, sizeof(*i));
205
206 i->f = ft; 254 i->f = ft;
207 255
208 i->r.raid_attrs.ac.class = &raid_class.class; 256 i->r.raid_attrs.ac.class = &raid_class.class;
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index b61fb1295b8b..3ded9daaf4a0 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -178,7 +178,7 @@ struct sdebug_queued_cmd {
178}; 178};
179static struct sdebug_queued_cmd queued_arr[SCSI_DEBUG_CANQUEUE]; 179static struct sdebug_queued_cmd queued_arr[SCSI_DEBUG_CANQUEUE];
180 180
181static Scsi_Host_Template sdebug_driver_template = { 181static struct scsi_host_template sdebug_driver_template = {
182 .proc_info = scsi_debug_proc_info, 182 .proc_info = scsi_debug_proc_info,
183 .name = "SCSI DEBUG", 183 .name = "SCSI DEBUG",
184 .info = scsi_debug_info, 184 .info = scsi_debug_info,
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 0c5b02d4c7f8..18c5d2523014 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -417,43 +417,15 @@ static int scsi_eh_completed_normally(struct scsi_cmnd *scmd)
417} 417}
418 418
419/** 419/**
420 * scsi_eh_times_out - timeout function for error handling.
421 * @scmd: Cmd that is timing out.
422 *
423 * Notes:
424 * During error handling, the kernel thread will be sleeping waiting
425 * for some action to complete on the device. our only job is to
426 * record that it timed out, and to wake up the thread.
427 **/
428static void scsi_eh_times_out(struct scsi_cmnd *scmd)
429{
430 scmd->eh_eflags |= SCSI_EH_REC_TIMEOUT;
431 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd:%p\n", __FUNCTION__,
432 scmd));
433
434 up(scmd->device->host->eh_action);
435}
436
437/**
438 * scsi_eh_done - Completion function for error handling. 420 * scsi_eh_done - Completion function for error handling.
439 * @scmd: Cmd that is done. 421 * @scmd: Cmd that is done.
440 **/ 422 **/
441static void scsi_eh_done(struct scsi_cmnd *scmd) 423static void scsi_eh_done(struct scsi_cmnd *scmd)
442{ 424{
443 /* 425 SCSI_LOG_ERROR_RECOVERY(3,
444 * if the timeout handler is already running, then just set the 426 printk("%s scmd: %p result: %x\n",
445 * flag which says we finished late, and return. we have no 427 __FUNCTION__, scmd, scmd->result));
446 * way of stopping the timeout handler from running, so we must 428 complete(scmd->device->host->eh_action);
447 * always defer to it.
448 */
449 if (del_timer(&scmd->eh_timeout)) {
450 scmd->request->rq_status = RQ_SCSI_DONE;
451
452 SCSI_LOG_ERROR_RECOVERY(3, printk("%s scmd: %p result: %x\n",
453 __FUNCTION__, scmd, scmd->result));
454
455 up(scmd->device->host->eh_action);
456 }
457} 429}
458 430
459/** 431/**
@@ -461,10 +433,6 @@ static void scsi_eh_done(struct scsi_cmnd *scmd)
461 * @scmd: SCSI Cmd to send. 433 * @scmd: SCSI Cmd to send.
462 * @timeout: Timeout for cmd. 434 * @timeout: Timeout for cmd.
463 * 435 *
464 * Notes:
465 * The initialization of the structures is quite a bit different in
466 * this case, and furthermore, there is a different completion handler
467 * vs scsi_dispatch_cmd.
468 * Return value: 436 * Return value:
469 * SUCCESS or FAILED or NEEDS_RETRY 437 * SUCCESS or FAILED or NEEDS_RETRY
470 **/ 438 **/
@@ -472,24 +440,16 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
472{ 440{
473 struct scsi_device *sdev = scmd->device; 441 struct scsi_device *sdev = scmd->device;
474 struct Scsi_Host *shost = sdev->host; 442 struct Scsi_Host *shost = sdev->host;
475 DECLARE_MUTEX_LOCKED(sem); 443 DECLARE_COMPLETION(done);
444 unsigned long timeleft;
476 unsigned long flags; 445 unsigned long flags;
477 int rtn = SUCCESS; 446 int rtn;
478 447
479 /*
480 * we will use a queued command if possible, otherwise we will
481 * emulate the queuing and calling of completion function ourselves.
482 */
483 if (sdev->scsi_level <= SCSI_2) 448 if (sdev->scsi_level <= SCSI_2)
484 scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) | 449 scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) |
485 (sdev->lun << 5 & 0xe0); 450 (sdev->lun << 5 & 0xe0);
486 451
487 scsi_add_timer(scmd, timeout, scsi_eh_times_out); 452 shost->eh_action = &done;
488
489 /*
490 * set up the semaphore so we wait for the command to complete.
491 */
492 shost->eh_action = &sem;
493 scmd->request->rq_status = RQ_SCSI_BUSY; 453 scmd->request->rq_status = RQ_SCSI_BUSY;
494 454
495 spin_lock_irqsave(shost->host_lock, flags); 455 spin_lock_irqsave(shost->host_lock, flags);
@@ -497,47 +457,29 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
497 shost->hostt->queuecommand(scmd, scsi_eh_done); 457 shost->hostt->queuecommand(scmd, scsi_eh_done);
498 spin_unlock_irqrestore(shost->host_lock, flags); 458 spin_unlock_irqrestore(shost->host_lock, flags);
499 459
500 down(&sem); 460 timeleft = wait_for_completion_timeout(&done, timeout);
501 scsi_log_completion(scmd, SUCCESS);
502 461
462 scmd->request->rq_status = RQ_SCSI_DONE;
503 shost->eh_action = NULL; 463 shost->eh_action = NULL;
504 464
505 /* 465 scsi_log_completion(scmd, SUCCESS);
506 * see if timeout. if so, tell the host to forget about it.
507 * in other words, we don't want a callback any more.
508 */
509 if (scmd->eh_eflags & SCSI_EH_REC_TIMEOUT) {
510 scmd->eh_eflags &= ~SCSI_EH_REC_TIMEOUT;
511
512 /*
513 * as far as the low level driver is
514 * concerned, this command is still active, so
515 * we must give the low level driver a chance
516 * to abort it. (db)
517 *
518 * FIXME(eric) - we are not tracking whether we could
519 * abort a timed out command or not. not sure how
520 * we should treat them differently anyways.
521 */
522 if (shost->hostt->eh_abort_handler)
523 shost->hostt->eh_abort_handler(scmd);
524
525 scmd->request->rq_status = RQ_SCSI_DONE;
526 rtn = FAILED;
527 }
528 466
529 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd: %p, rtn:%x\n", 467 SCSI_LOG_ERROR_RECOVERY(3,
530 __FUNCTION__, scmd, rtn)); 468 printk("%s: scmd: %p, timeleft: %ld\n",
469 __FUNCTION__, scmd, timeleft));
531 470
532 /* 471 /*
533 * now examine the actual status codes to see whether the command 472 * If there is time left scsi_eh_done got called, and we will
534 * actually did complete normally. 473 * examine the actual status codes to see whether the command
474 * actually did complete normally, else tell the host to forget
475 * about this command.
535 */ 476 */
536 if (rtn == SUCCESS) { 477 if (timeleft) {
537 rtn = scsi_eh_completed_normally(scmd); 478 rtn = scsi_eh_completed_normally(scmd);
538 SCSI_LOG_ERROR_RECOVERY(3, 479 SCSI_LOG_ERROR_RECOVERY(3,
539 printk("%s: scsi_eh_completed_normally %x\n", 480 printk("%s: scsi_eh_completed_normally %x\n",
540 __FUNCTION__, rtn)); 481 __FUNCTION__, rtn));
482
541 switch (rtn) { 483 switch (rtn) {
542 case SUCCESS: 484 case SUCCESS:
543 case NEEDS_RETRY: 485 case NEEDS_RETRY:
@@ -547,6 +489,15 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
547 rtn = FAILED; 489 rtn = FAILED;
548 break; 490 break;
549 } 491 }
492 } else {
493 /*
494 * FIXME(eric) - we are not tracking whether we could
495 * abort a timed out command or not. not sure how
496 * we should treat them differently anyways.
497 */
498 if (shost->hostt->eh_abort_handler)
499 shost->hostt->eh_abort_handler(scmd);
500 rtn = FAILED;
550 } 501 }
551 502
552 return rtn; 503 return rtn;
@@ -1571,50 +1522,41 @@ static void scsi_unjam_host(struct Scsi_Host *shost)
1571} 1522}
1572 1523
1573/** 1524/**
1574 * scsi_error_handler - Handle errors/timeouts of SCSI cmds. 1525 * scsi_error_handler - SCSI error handler thread
1575 * @data: Host for which we are running. 1526 * @data: Host for which we are running.
1576 * 1527 *
1577 * Notes: 1528 * Notes:
1578 * This is always run in the context of a kernel thread. The idea is 1529 * This is the main error handling loop. This is run as a kernel thread
1579 * that we start this thing up when the kernel starts up (one per host 1530 * for every SCSI host and handles all error handling activity.
1580 * that we detect), and it immediately goes to sleep and waits for some
1581 * event (i.e. failure). When this takes place, we have the job of
1582 * trying to unjam the bus and restarting things.
1583 **/ 1531 **/
1584int scsi_error_handler(void *data) 1532int scsi_error_handler(void *data)
1585{ 1533{
1586 struct Scsi_Host *shost = (struct Scsi_Host *) data; 1534 struct Scsi_Host *shost = data;
1587 int rtn;
1588 1535
1589 current->flags |= PF_NOFREEZE; 1536 current->flags |= PF_NOFREEZE;
1590 1537
1591
1592 /* 1538 /*
1593 * Note - we always use TASK_INTERRUPTIBLE even if the module 1539 * We use TASK_INTERRUPTIBLE so that the thread is not
1594 * was loaded as part of the kernel. The reason is that 1540 * counted against the load average as a running process.
1595 * UNINTERRUPTIBLE would cause this thread to be counted in 1541 * We never actually get interrupted because kthread_run
1596 * the load average as a running process, and an interruptible 1542 * disables singal delivery for the created thread.
1597 * wait doesn't.
1598 */ 1543 */
1599 set_current_state(TASK_INTERRUPTIBLE); 1544 set_current_state(TASK_INTERRUPTIBLE);
1600 while (!kthread_should_stop()) { 1545 while (!kthread_should_stop()) {
1601 if (shost->host_failed == 0 || 1546 if (shost->host_failed == 0 ||
1602 shost->host_failed != shost->host_busy) { 1547 shost->host_failed != shost->host_busy) {
1603 SCSI_LOG_ERROR_RECOVERY(1, printk("Error handler" 1548 SCSI_LOG_ERROR_RECOVERY(1,
1604 " scsi_eh_%d" 1549 printk("Error handler scsi_eh_%d sleeping\n",
1605 " sleeping\n", 1550 shost->host_no));
1606 shost->host_no));
1607 schedule(); 1551 schedule();
1608 set_current_state(TASK_INTERRUPTIBLE); 1552 set_current_state(TASK_INTERRUPTIBLE);
1609 continue; 1553 continue;
1610 } 1554 }
1611 1555
1612 __set_current_state(TASK_RUNNING); 1556 __set_current_state(TASK_RUNNING);
1613 SCSI_LOG_ERROR_RECOVERY(1, printk("Error handler" 1557 SCSI_LOG_ERROR_RECOVERY(1,
1614 " scsi_eh_%d waking" 1558 printk("Error handler scsi_eh_%d waking up\n",
1615 " up\n",shost->host_no)); 1559 shost->host_no));
1616
1617 shost->eh_active = 1;
1618 1560
1619 /* 1561 /*
1620 * We have a host that is failing for some reason. Figure out 1562 * We have a host that is failing for some reason. Figure out
@@ -1622,12 +1564,10 @@ int scsi_error_handler(void *data)
1622 * If we fail, we end up taking the thing offline. 1564 * If we fail, we end up taking the thing offline.
1623 */ 1565 */
1624 if (shost->hostt->eh_strategy_handler) 1566 if (shost->hostt->eh_strategy_handler)
1625 rtn = shost->hostt->eh_strategy_handler(shost); 1567 shost->hostt->eh_strategy_handler(shost);
1626 else 1568 else
1627 scsi_unjam_host(shost); 1569 scsi_unjam_host(shost);
1628 1570
1629 shost->eh_active = 0;
1630
1631 /* 1571 /*
1632 * Note - if the above fails completely, the action is to take 1572 * Note - if the above fails completely, the action is to take
1633 * individual devices offline and flush the queue of any 1573 * individual devices offline and flush the queue of any
@@ -1638,15 +1578,10 @@ int scsi_error_handler(void *data)
1638 scsi_restart_operations(shost); 1578 scsi_restart_operations(shost);
1639 set_current_state(TASK_INTERRUPTIBLE); 1579 set_current_state(TASK_INTERRUPTIBLE);
1640 } 1580 }
1641
1642 __set_current_state(TASK_RUNNING); 1581 __set_current_state(TASK_RUNNING);
1643 1582
1644 SCSI_LOG_ERROR_RECOVERY(1, printk("Error handler scsi_eh_%d" 1583 SCSI_LOG_ERROR_RECOVERY(1,
1645 " exiting\n",shost->host_no)); 1584 printk("Error handler scsi_eh_%d exiting\n", shost->host_no));
1646
1647 /*
1648 * Make sure that nobody tries to wake us up again.
1649 */
1650 shost->ehandler = NULL; 1585 shost->ehandler = NULL;
1651 return 0; 1586 return 0;
1652} 1587}
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index e40c8b66da40..ce9d73a292e2 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -254,55 +254,6 @@ void scsi_do_req(struct scsi_request *sreq, const void *cmnd,
254} 254}
255EXPORT_SYMBOL(scsi_do_req); 255EXPORT_SYMBOL(scsi_do_req);
256 256
257/* This is the end routine we get to if a command was never attached
258 * to the request. Simply complete the request without changing
259 * rq_status; this will cause a DRIVER_ERROR. */
260static void scsi_wait_req_end_io(struct request *req)
261{
262 BUG_ON(!req->waiting);
263
264 complete(req->waiting);
265}
266
267void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer,
268 unsigned bufflen, int timeout, int retries)
269{
270 DECLARE_COMPLETION(wait);
271 int write = (sreq->sr_data_direction == DMA_TO_DEVICE);
272 struct request *req;
273
274 req = blk_get_request(sreq->sr_device->request_queue, write,
275 __GFP_WAIT);
276 if (bufflen && blk_rq_map_kern(sreq->sr_device->request_queue, req,
277 buffer, bufflen, __GFP_WAIT)) {
278 sreq->sr_result = DRIVER_ERROR << 24;
279 blk_put_request(req);
280 return;
281 }
282
283 req->flags |= REQ_NOMERGE;
284 req->waiting = &wait;
285 req->end_io = scsi_wait_req_end_io;
286 req->cmd_len = COMMAND_SIZE(((u8 *)cmnd)[0]);
287 req->sense = sreq->sr_sense_buffer;
288 req->sense_len = 0;
289 memcpy(req->cmd, cmnd, req->cmd_len);
290 req->timeout = timeout;
291 req->flags |= REQ_BLOCK_PC;
292 req->rq_disk = NULL;
293 blk_insert_request(sreq->sr_device->request_queue, req,
294 sreq->sr_data_direction == DMA_TO_DEVICE, NULL);
295 wait_for_completion(&wait);
296 sreq->sr_request->waiting = NULL;
297 sreq->sr_result = req->errors;
298 if (req->errors)
299 sreq->sr_result |= (DRIVER_ERROR << 24);
300
301 blk_put_request(req);
302}
303
304EXPORT_SYMBOL(scsi_wait_req);
305
306/** 257/**
307 * scsi_execute - insert request and wait for the result 258 * scsi_execute - insert request and wait for the result
308 * @sdev: scsi device 259 * @sdev: scsi device
@@ -591,10 +542,17 @@ static void scsi_requeue_command(struct request_queue *q, struct scsi_cmnd *cmd)
591 542
592void scsi_next_command(struct scsi_cmnd *cmd) 543void scsi_next_command(struct scsi_cmnd *cmd)
593{ 544{
594 struct request_queue *q = cmd->device->request_queue; 545 struct scsi_device *sdev = cmd->device;
546 struct request_queue *q = sdev->request_queue;
547
548 /* need to hold a reference on the device before we let go of the cmd */
549 get_device(&sdev->sdev_gendev);
595 550
596 scsi_put_command(cmd); 551 scsi_put_command(cmd);
597 scsi_run_queue(q); 552 scsi_run_queue(q);
553
554 /* ok to remove device now */
555 put_device(&sdev->sdev_gendev);
598} 556}
599 557
600void scsi_run_host_queues(struct Scsi_Host *shost) 558void scsi_run_host_queues(struct Scsi_Host *shost)
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index d05f778d31a8..d632d9e1493c 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -22,7 +22,6 @@ struct Scsi_Host;
22 * Scsi Error Handler Flags 22 * Scsi Error Handler Flags
23 */ 23 */
24#define SCSI_EH_CANCEL_CMD 0x0001 /* Cancel this cmd */ 24#define SCSI_EH_CANCEL_CMD 0x0001 /* Cancel this cmd */
25#define SCSI_EH_REC_TIMEOUT 0x0002 /* EH retry timed out */
26 25
27#define SCSI_SENSE_VALID(scmd) \ 26#define SCSI_SENSE_VALID(scmd) \
28 (((scmd)->sense_buffer[0] & 0x70) == 0x70) 27 (((scmd)->sense_buffer[0] & 0x70) == 0x70)
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 7eb3a2d40dc5..374853df9cca 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -9,7 +9,7 @@
9 * global variable (boot or module load time) settings. 9 * global variable (boot or module load time) settings.
10 * 10 *
11 * A specific LUN is scanned via an INQUIRY command; if the LUN has a 11 * A specific LUN is scanned via an INQUIRY command; if the LUN has a
12 * device attached, a Scsi_Device is allocated and setup for it. 12 * device attached, a scsi_device is allocated and setup for it.
13 * 13 *
14 * For every id of every channel on the given host: 14 * For every id of every channel on the given host:
15 * 15 *
@@ -17,7 +17,7 @@
17 * device or storage attached to LUN 0): 17 * device or storage attached to LUN 0):
18 * 18 *
19 * If LUN 0 has a device attached, allocate and setup a 19 * If LUN 0 has a device attached, allocate and setup a
20 * Scsi_Device for it. 20 * scsi_device for it.
21 * 21 *
22 * If target is SCSI-3 or up, issue a REPORT LUN, and scan 22 * If target is SCSI-3 or up, issue a REPORT LUN, and scan
23 * all of the LUNs returned by the REPORT LUN; else, 23 * all of the LUNs returned by the REPORT LUN; else,
@@ -441,7 +441,7 @@ void scsi_target_reap(struct scsi_target *starget)
441 * 441 *
442 * If the INQUIRY is successful, zero is returned and the 442 * If the INQUIRY is successful, zero is returned and the
443 * INQUIRY data is in @inq_result; the scsi_level and INQUIRY length 443 * INQUIRY data is in @inq_result; the scsi_level and INQUIRY length
444 * are copied to the Scsi_Device any flags value is stored in *@bflags. 444 * are copied to the scsi_device any flags value is stored in *@bflags.
445 **/ 445 **/
446static int scsi_probe_lun(struct scsi_device *sdev, char *inq_result, 446static int scsi_probe_lun(struct scsi_device *sdev, char *inq_result,
447 int result_len, int *bflags) 447 int result_len, int *bflags)
@@ -509,8 +509,8 @@ static int scsi_probe_lun(struct scsi_device *sdev, char *inq_result,
509 /* 509 /*
510 * Get any flags for this device. 510 * Get any flags for this device.
511 * 511 *
512 * XXX add a bflags to Scsi_Device, and replace the 512 * XXX add a bflags to scsi_device, and replace the
513 * corresponding bit fields in Scsi_Device, so bflags 513 * corresponding bit fields in scsi_device, so bflags
514 * need not be passed as an argument. 514 * need not be passed as an argument.
515 */ 515 */
516 *bflags = scsi_get_device_flags(sdev, &inq_result[8], 516 *bflags = scsi_get_device_flags(sdev, &inq_result[8],
@@ -592,21 +592,21 @@ static int scsi_probe_lun(struct scsi_device *sdev, char *inq_result,
592} 592}
593 593
594/** 594/**
595 * scsi_add_lun - allocate and fully initialze a Scsi_Device 595 * scsi_add_lun - allocate and fully initialze a scsi_device
596 * @sdevscan: holds information to be stored in the new Scsi_Device 596 * @sdevscan: holds information to be stored in the new scsi_device
597 * @sdevnew: store the address of the newly allocated Scsi_Device 597 * @sdevnew: store the address of the newly allocated scsi_device
598 * @inq_result: holds the result of a previous INQUIRY to the LUN 598 * @inq_result: holds the result of a previous INQUIRY to the LUN
599 * @bflags: black/white list flag 599 * @bflags: black/white list flag
600 * 600 *
601 * Description: 601 * Description:
602 * Allocate and initialize a Scsi_Device matching sdevscan. Optionally 602 * Allocate and initialize a scsi_device matching sdevscan. Optionally
603 * set fields based on values in *@bflags. If @sdevnew is not 603 * set fields based on values in *@bflags. If @sdevnew is not
604 * NULL, store the address of the new Scsi_Device in *@sdevnew (needed 604 * NULL, store the address of the new scsi_device in *@sdevnew (needed
605 * when scanning a particular LUN). 605 * when scanning a particular LUN).
606 * 606 *
607 * Return: 607 * Return:
608 * SCSI_SCAN_NO_RESPONSE: could not allocate or setup a Scsi_Device 608 * SCSI_SCAN_NO_RESPONSE: could not allocate or setup a scsi_device
609 * SCSI_SCAN_LUN_PRESENT: a new Scsi_Device was allocated and initialized 609 * SCSI_SCAN_LUN_PRESENT: a new scsi_device was allocated and initialized
610 **/ 610 **/
611static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags) 611static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
612{ 612{
@@ -674,7 +674,7 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
674 * 674 *
675 * The above is vague, as it implies that we could treat 001 and 675 * The above is vague, as it implies that we could treat 001 and
676 * 011 the same. Stay compatible with previous code, and create a 676 * 011 the same. Stay compatible with previous code, and create a
677 * Scsi_Device for a PQ of 1 677 * scsi_device for a PQ of 1
678 * 678 *
679 * Don't set the device offline here; rather let the upper 679 * Don't set the device offline here; rather let the upper
680 * level drivers eval the PQ to decide whether they should 680 * level drivers eval the PQ to decide whether they should
@@ -784,8 +784,8 @@ static inline void scsi_destroy_sdev(struct scsi_device *sdev)
784 * scsi_probe_and_add_lun - probe a LUN, if a LUN is found add it 784 * scsi_probe_and_add_lun - probe a LUN, if a LUN is found add it
785 * @starget: pointer to target device structure 785 * @starget: pointer to target device structure
786 * @lun: LUN of target device 786 * @lun: LUN of target device
787 * @sdevscan: probe the LUN corresponding to this Scsi_Device 787 * @sdevscan: probe the LUN corresponding to this scsi_device
788 * @sdevnew: store the value of any new Scsi_Device allocated 788 * @sdevnew: store the value of any new scsi_device allocated
789 * @bflagsp: store bflags here if not NULL 789 * @bflagsp: store bflags here if not NULL
790 * 790 *
791 * Description: 791 * Description:
@@ -793,10 +793,10 @@ static inline void scsi_destroy_sdev(struct scsi_device *sdev)
793 * allocate and set it up by calling scsi_add_lun. 793 * allocate and set it up by calling scsi_add_lun.
794 * 794 *
795 * Return: 795 * Return:
796 * SCSI_SCAN_NO_RESPONSE: could not allocate or setup a Scsi_Device 796 * SCSI_SCAN_NO_RESPONSE: could not allocate or setup a scsi_device
797 * SCSI_SCAN_TARGET_PRESENT: target responded, but no device is 797 * SCSI_SCAN_TARGET_PRESENT: target responded, but no device is
798 * attached at the LUN 798 * attached at the LUN
799 * SCSI_SCAN_LUN_PRESENT: a new Scsi_Device was allocated and initialized 799 * SCSI_SCAN_LUN_PRESENT: a new scsi_device was allocated and initialized
800 **/ 800 **/
801static int scsi_probe_and_add_lun(struct scsi_target *starget, 801static int scsi_probe_and_add_lun(struct scsi_target *starget,
802 uint lun, int *bflagsp, 802 uint lun, int *bflagsp,
@@ -1046,7 +1046,7 @@ EXPORT_SYMBOL(int_to_scsilun);
1046 1046
1047/** 1047/**
1048 * scsi_report_lun_scan - Scan using SCSI REPORT LUN results 1048 * scsi_report_lun_scan - Scan using SCSI REPORT LUN results
1049 * @sdevscan: scan the host, channel, and id of this Scsi_Device 1049 * @sdevscan: scan the host, channel, and id of this scsi_device
1050 * 1050 *
1051 * Description: 1051 * Description:
1052 * If @sdevscan is for a SCSI-3 or up device, send a REPORT LUN 1052 * If @sdevscan is for a SCSI-3 or up device, send a REPORT LUN
@@ -1074,6 +1074,7 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
1074 struct scsi_sense_hdr sshdr; 1074 struct scsi_sense_hdr sshdr;
1075 struct scsi_device *sdev; 1075 struct scsi_device *sdev;
1076 struct Scsi_Host *shost = dev_to_shost(&starget->dev); 1076 struct Scsi_Host *shost = dev_to_shost(&starget->dev);
1077 int ret = 0;
1077 1078
1078 /* 1079 /*
1079 * Only support SCSI-3 and up devices if BLIST_NOREPORTLUN is not set. 1080 * Only support SCSI-3 and up devices if BLIST_NOREPORTLUN is not set.
@@ -1169,8 +1170,8 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
1169 /* 1170 /*
1170 * The device probably does not support a REPORT LUN command 1171 * The device probably does not support a REPORT LUN command
1171 */ 1172 */
1172 kfree(lun_data); 1173 ret = 1;
1173 return 1; 1174 goto out_err;
1174 } 1175 }
1175 1176
1176 /* 1177 /*
@@ -1238,6 +1239,7 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
1238 } 1239 }
1239 } 1240 }
1240 1241
1242 out_err:
1241 kfree(lun_data); 1243 kfree(lun_data);
1242 out: 1244 out:
1243 scsi_device_put(sdev); 1245 scsi_device_put(sdev);
@@ -1246,7 +1248,7 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
1246 * the sdev we used didn't appear in the report luns scan 1248 * the sdev we used didn't appear in the report luns scan
1247 */ 1249 */
1248 scsi_destroy_sdev(sdev); 1250 scsi_destroy_sdev(sdev);
1249 return 0; 1251 return ret;
1250} 1252}
1251 1253
1252struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel, 1254struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
@@ -1472,16 +1474,16 @@ void scsi_forget_host(struct Scsi_Host *shost)
1472/* 1474/*
1473 * Function: scsi_get_host_dev() 1475 * Function: scsi_get_host_dev()
1474 * 1476 *
1475 * Purpose: Create a Scsi_Device that points to the host adapter itself. 1477 * Purpose: Create a scsi_device that points to the host adapter itself.
1476 * 1478 *
1477 * Arguments: SHpnt - Host that needs a Scsi_Device 1479 * Arguments: SHpnt - Host that needs a scsi_device
1478 * 1480 *
1479 * Lock status: None assumed. 1481 * Lock status: None assumed.
1480 * 1482 *
1481 * Returns: The Scsi_Device or NULL 1483 * Returns: The scsi_device or NULL
1482 * 1484 *
1483 * Notes: 1485 * Notes:
1484 * Attach a single Scsi_Device to the Scsi_Host - this should 1486 * Attach a single scsi_device to the Scsi_Host - this should
1485 * be made to look like a "pseudo-device" that points to the 1487 * be made to look like a "pseudo-device" that points to the
1486 * HA itself. 1488 * HA itself.
1487 * 1489 *
@@ -1518,7 +1520,7 @@ EXPORT_SYMBOL(scsi_get_host_dev);
1518 * 1520 *
1519 * Purpose: Free a scsi_device that points to the host adapter itself. 1521 * Purpose: Free a scsi_device that points to the host adapter itself.
1520 * 1522 *
1521 * Arguments: SHpnt - Host that needs a Scsi_Device 1523 * Arguments: SHpnt - Host that needs a scsi_device
1522 * 1524 *
1523 * Lock status: None assumed. 1525 * Lock status: None assumed.
1524 * 1526 *
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 72a6550a056c..46349293de08 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -691,16 +691,19 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
691 691
692void __scsi_remove_device(struct scsi_device *sdev) 692void __scsi_remove_device(struct scsi_device *sdev)
693{ 693{
694 struct device *dev = &sdev->sdev_gendev;
695
694 if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0) 696 if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0)
695 return; 697 return;
696 698
697 class_device_unregister(&sdev->sdev_classdev); 699 class_device_unregister(&sdev->sdev_classdev);
698 device_del(&sdev->sdev_gendev); 700 transport_remove_device(dev);
701 device_del(dev);
699 scsi_device_set_state(sdev, SDEV_DEL); 702 scsi_device_set_state(sdev, SDEV_DEL);
700 if (sdev->host->hostt->slave_destroy) 703 if (sdev->host->hostt->slave_destroy)
701 sdev->host->hostt->slave_destroy(sdev); 704 sdev->host->hostt->slave_destroy(sdev);
702 transport_unregister_device(&sdev->sdev_gendev); 705 transport_destroy_device(dev);
703 put_device(&sdev->sdev_gendev); 706 put_device(dev);
704} 707}
705 708
706/** 709/**
diff --git a/drivers/scsi/scsi_typedefs.h b/drivers/scsi/scsi_typedefs.h
index 6c431323581c..29f038b42f60 100644
--- a/drivers/scsi/scsi_typedefs.h
+++ b/drivers/scsi/scsi_typedefs.h
@@ -1,6 +1,3 @@
1 1
2typedef struct scsi_host_template Scsi_Host_Template;
3typedef struct scsi_device Scsi_Device;
4typedef struct scsi_cmnd Scsi_Cmnd; 2typedef struct scsi_cmnd Scsi_Cmnd;
5typedef struct scsi_request Scsi_Request; 3typedef struct scsi_request Scsi_Request;
6typedef struct scsi_pointer Scsi_Pointer;
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index bb5b242ac6b4..8613a1317712 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -769,20 +769,16 @@ static void sd_end_flush(request_queue_t *q, struct request *flush_rq)
769static int sd_prepare_flush(request_queue_t *q, struct request *rq) 769static int sd_prepare_flush(request_queue_t *q, struct request *rq)
770{ 770{
771 struct scsi_device *sdev = q->queuedata; 771 struct scsi_device *sdev = q->queuedata;
772 struct scsi_disk *sdkp = scsi_disk_get_from_dev(&sdev->sdev_gendev); 772 struct scsi_disk *sdkp = dev_get_drvdata(&sdev->sdev_gendev);
773 int ret = 0;
774 773
775 if (sdkp) { 774 if (!sdkp || !sdkp->WCE)
776 if (sdkp->WCE) { 775 return 0;
777 memset(rq->cmd, 0, sizeof(rq->cmd)); 776
778 rq->flags |= REQ_BLOCK_PC | REQ_SOFTBARRIER; 777 memset(rq->cmd, 0, sizeof(rq->cmd));
779 rq->timeout = SD_TIMEOUT; 778 rq->flags |= REQ_BLOCK_PC | REQ_SOFTBARRIER;
780 rq->cmd[0] = SYNCHRONIZE_CACHE; 779 rq->timeout = SD_TIMEOUT;
781 ret = 1; 780 rq->cmd[0] = SYNCHRONIZE_CACHE;
782 } 781 return 1;
783 scsi_disk_put(sdkp);
784 }
785 return ret;
786} 782}
787 783
788static void sd_rescan(struct device *dev) 784static void sd_rescan(struct device *dev)
diff --git a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c
index a0cace9aeb79..0ff83ddf13fe 100644
--- a/drivers/scsi/seagate.c
+++ b/drivers/scsi/seagate.c
@@ -418,7 +418,7 @@ static inline void borken_wait (void)
418#define ULOOP( i ) for (clock = i*8;;) 418#define ULOOP( i ) for (clock = i*8;;)
419#define TIMEOUT (!(clock--)) 419#define TIMEOUT (!(clock--))
420 420
421int __init seagate_st0x_detect (Scsi_Host_Template * tpnt) 421int __init seagate_st0x_detect (struct scsi_host_template * tpnt)
422{ 422{
423 struct Scsi_Host *instance; 423 struct Scsi_Host *instance;
424 int i, j; 424 int i, j;
@@ -1649,7 +1649,7 @@ static int seagate_st0x_release(struct Scsi_Host *shost)
1649 return 0; 1649 return 0;
1650} 1650}
1651 1651
1652static Scsi_Host_Template driver_template = { 1652static struct scsi_host_template driver_template = {
1653 .detect = seagate_st0x_detect, 1653 .detect = seagate_st0x_detect,
1654 .release = seagate_st0x_release, 1654 .release = seagate_st0x_release,
1655 .info = seagate_st0x_info, 1655 .info = seagate_st0x_info,
diff --git a/drivers/scsi/seagate.h b/drivers/scsi/seagate.h
index 8889ff1a6b20..fb5f380fa4b3 100644
--- a/drivers/scsi/seagate.h
+++ b/drivers/scsi/seagate.h
@@ -9,7 +9,7 @@
9#ifndef _SEAGATE_H 9#ifndef _SEAGATE_H
10#define SEAGATE_H 10#define SEAGATE_H
11 11
12static int seagate_st0x_detect(Scsi_Host_Template *); 12static int seagate_st0x_detect(struct scsi_host_template *);
13static int seagate_st0x_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 13static int seagate_st0x_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
14 14
15static int seagate_st0x_abort(Scsi_Cmnd *); 15static int seagate_st0x_abort(Scsi_Cmnd *);
diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index f37147f8f7bf..bf2ceb54354c 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -217,7 +217,7 @@ static inline void init_hpc_chain(struct hpc_data *hd)
217} 217}
218 218
219static struct Scsi_Host * __init sgiwd93_setup_scsi( 219static struct Scsi_Host * __init sgiwd93_setup_scsi(
220 Scsi_Host_Template *SGIblows, int unit, int irq, 220 struct scsi_host_template *SGIblows, int unit, int irq,
221 struct hpc3_scsiregs *hregs, unsigned char *wdregs) 221 struct hpc3_scsiregs *hregs, unsigned char *wdregs)
222{ 222{
223 struct ip22_hostdata *hdata; 223 struct ip22_hostdata *hdata;
@@ -265,7 +265,7 @@ out_unregister:
265 return NULL; 265 return NULL;
266} 266}
267 267
268int __init sgiwd93_detect(Scsi_Host_Template *SGIblows) 268int __init sgiwd93_detect(struct scsi_host_template *SGIblows)
269{ 269{
270 int found = 0; 270 int found = 0;
271 271
@@ -324,7 +324,7 @@ static int sgiwd93_bus_reset(Scsi_Cmnd *cmd)
324 * arguments not with pointers. So this is going to blow up beautyfully 324 * arguments not with pointers. So this is going to blow up beautyfully
325 * on 64-bit systems with memory outside the compat address spaces. 325 * on 64-bit systems with memory outside the compat address spaces.
326 */ 326 */
327static Scsi_Host_Template driver_template = { 327static struct scsi_host_template driver_template = {
328 .proc_name = "SGIWD93", 328 .proc_name = "SGIWD93",
329 .name = "SGI WD93", 329 .name = "SGI WD93",
330 .detect = sgiwd93_detect, 330 .detect = sgiwd93_detect,
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c
index 7e19589e71a0..c041bfd56e12 100644
--- a/drivers/scsi/sun3_NCR5380.c
+++ b/drivers/scsi/sun3_NCR5380.c
@@ -257,7 +257,7 @@
257 */ 257 */
258 258
259static struct Scsi_Host *first_instance = NULL; 259static struct Scsi_Host *first_instance = NULL;
260static Scsi_Host_Template *the_template = NULL; 260static struct scsi_host_template *the_template = NULL;
261 261
262/* Macros ease life... :-) */ 262/* Macros ease life... :-) */
263#define SETUP_HOSTDATA(in) \ 263#define SETUP_HOSTDATA(in) \
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
index e3ea99f23d60..837173415d4c 100644
--- a/drivers/scsi/sun3_scsi.c
+++ b/drivers/scsi/sun3_scsi.c
@@ -185,7 +185,7 @@ static inline void sun3_udc_write(unsigned short val, unsigned char reg)
185static struct Scsi_Host *default_instance; 185static struct Scsi_Host *default_instance;
186 186
187/* 187/*
188 * Function : int sun3scsi_detect(Scsi_Host_Template * tpnt) 188 * Function : int sun3scsi_detect(struct scsi_host_template * tpnt)
189 * 189 *
190 * Purpose : initializes mac NCR5380 driver based on the 190 * Purpose : initializes mac NCR5380 driver based on the
191 * command line / compile time port and irq definitions. 191 * command line / compile time port and irq definitions.
@@ -196,7 +196,7 @@ static struct Scsi_Host *default_instance;
196 * 196 *
197 */ 197 */
198 198
199int sun3scsi_detect(Scsi_Host_Template * tpnt) 199int sun3scsi_detect(struct scsi_host_template * tpnt)
200{ 200{
201 unsigned long ioaddr; 201 unsigned long ioaddr;
202 static int called = 0; 202 static int called = 0;
@@ -621,7 +621,7 @@ static int sun3scsi_dma_finish(int write_flag)
621 621
622#include "sun3_NCR5380.c" 622#include "sun3_NCR5380.c"
623 623
624static Scsi_Host_Template driver_template = { 624static struct scsi_host_template driver_template = {
625 .name = SUN3_SCSI_NAME, 625 .name = SUN3_SCSI_NAME,
626 .detect = sun3scsi_detect, 626 .detect = sun3scsi_detect,
627 .release = sun3scsi_release, 627 .release = sun3scsi_release,
diff --git a/drivers/scsi/sun3_scsi.h b/drivers/scsi/sun3_scsi.h
index 155282b92a95..834dab428019 100644
--- a/drivers/scsi/sun3_scsi.h
+++ b/drivers/scsi/sun3_scsi.h
@@ -48,7 +48,7 @@
48#define IOBASE_SUN3_VMESCSI 0xff200000 48#define IOBASE_SUN3_VMESCSI 0xff200000
49 49
50static int sun3scsi_abort (Scsi_Cmnd *); 50static int sun3scsi_abort (Scsi_Cmnd *);
51static int sun3scsi_detect (Scsi_Host_Template *); 51static int sun3scsi_detect (struct scsi_host_template *);
52static const char *sun3scsi_info (struct Scsi_Host *); 52static const char *sun3scsi_info (struct Scsi_Host *);
53static int sun3scsi_bus_reset(Scsi_Cmnd *); 53static int sun3scsi_bus_reset(Scsi_Cmnd *);
54static int sun3scsi_queue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 54static int sun3scsi_queue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
diff --git a/drivers/scsi/sun3_scsi_vme.c b/drivers/scsi/sun3_scsi_vme.c
index 9acb5ddebb07..008a82ab8521 100644
--- a/drivers/scsi/sun3_scsi_vme.c
+++ b/drivers/scsi/sun3_scsi_vme.c
@@ -127,7 +127,7 @@ static inline void sun3scsi_write(int reg, int value)
127static struct Scsi_Host *default_instance; 127static struct Scsi_Host *default_instance;
128 128
129/* 129/*
130 * Function : int sun3scsi_detect(Scsi_Host_Template * tpnt) 130 * Function : int sun3scsi_detect(struct scsi_host_template * tpnt)
131 * 131 *
132 * Purpose : initializes mac NCR5380 driver based on the 132 * Purpose : initializes mac NCR5380 driver based on the
133 * command line / compile time port and irq definitions. 133 * command line / compile time port and irq definitions.
@@ -138,7 +138,7 @@ static struct Scsi_Host *default_instance;
138 * 138 *
139 */ 139 */
140 140
141static int sun3scsi_detect(Scsi_Host_Template * tpnt) 141static int sun3scsi_detect(struct scsi_host_template * tpnt)
142{ 142{
143 unsigned long ioaddr, irq = 0; 143 unsigned long ioaddr, irq = 0;
144 static int called = 0; 144 static int called = 0;
@@ -564,7 +564,7 @@ static int sun3scsi_dma_finish(int write_flag)
564 564
565#include "sun3_NCR5380.c" 565#include "sun3_NCR5380.c"
566 566
567static Scsi_Host_Template driver_template = { 567static struct scsi_host_template driver_template = {
568 .name = SUN3_SCSI_NAME, 568 .name = SUN3_SCSI_NAME,
569 .detect = sun3scsi_detect, 569 .detect = sun3scsi_detect,
570 .release = sun3scsi_release, 570 .release = sun3scsi_release,
diff --git a/drivers/scsi/sun3x_esp.c b/drivers/scsi/sun3x_esp.c
index 09d7639079b4..cc990bed9683 100644
--- a/drivers/scsi/sun3x_esp.c
+++ b/drivers/scsi/sun3x_esp.c
@@ -47,7 +47,7 @@ static void dma_advance_sg (Scsi_Cmnd *sp);
47/* Detecting ESP chips on the machine. This is the simple and easy 47/* Detecting ESP chips on the machine. This is the simple and easy
48 * version. 48 * version.
49 */ 49 */
50int sun3x_esp_detect(Scsi_Host_Template *tpnt) 50int sun3x_esp_detect(struct scsi_host_template *tpnt)
51{ 51{
52 struct NCR_ESP *esp; 52 struct NCR_ESP *esp;
53 struct ConfigDev *esp_dev; 53 struct ConfigDev *esp_dev;
@@ -367,7 +367,7 @@ static int sun3x_esp_release(struct Scsi_Host *instance)
367 367
368} 368}
369 369
370static Scsi_Host_Template driver_template = { 370static struct scsi_host_template driver_template = {
371 .proc_name = "sun3x_esp", 371 .proc_name = "sun3x_esp",
372 .proc_info = &esp_proc_info, 372 .proc_info = &esp_proc_info,
373 .name = "Sun ESP 100/100a/200", 373 .name = "Sun ESP 100/100a/200",
diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c
index 93dc7b665ccf..8640253d6215 100644
--- a/drivers/scsi/sym53c416.c
+++ b/drivers/scsi/sym53c416.c
@@ -633,7 +633,7 @@ static void sym53c416_probe(void)
633 } 633 }
634} 634}
635 635
636int __init sym53c416_detect(Scsi_Host_Template *tpnt) 636int __init sym53c416_detect(struct scsi_host_template *tpnt)
637{ 637{
638 unsigned long flags; 638 unsigned long flags;
639 struct Scsi_Host * shpnt = NULL; 639 struct Scsi_Host * shpnt = NULL;
@@ -849,7 +849,7 @@ module_param_array(sym53c416_3, uint, NULL, 0);
849 849
850#endif 850#endif
851 851
852static Scsi_Host_Template driver_template = { 852static struct scsi_host_template driver_template = {
853 .proc_name = "sym53c416", 853 .proc_name = "sym53c416",
854 .name = "Symbios Logic 53c416", 854 .name = "Symbios Logic 53c416",
855 .detect = sym53c416_detect, 855 .detect = sym53c416_detect,
diff --git a/drivers/scsi/sym53c416.h b/drivers/scsi/sym53c416.h
index fd6b120d38c4..77860d0748ff 100644
--- a/drivers/scsi/sym53c416.h
+++ b/drivers/scsi/sym53c416.h
@@ -22,7 +22,7 @@
22 22
23#define SYM53C416_SCSI_ID 7 23#define SYM53C416_SCSI_ID 7
24 24
25static int sym53c416_detect(Scsi_Host_Template *); 25static int sym53c416_detect(struct scsi_host_template *);
26static const char *sym53c416_info(struct Scsi_Host *); 26static const char *sym53c416_info(struct Scsi_Host *);
27static int sym53c416_release(struct Scsi_Host *); 27static int sym53c416_release(struct Scsi_Host *);
28static int sym53c416_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 28static int sym53c416_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
diff --git a/drivers/scsi/t128.c b/drivers/scsi/t128.c
index f4b780e35cb6..21305fc91479 100644
--- a/drivers/scsi/t128.c
+++ b/drivers/scsi/t128.c
@@ -183,7 +183,7 @@ void __init t128_setup(char *str, int *ints){
183} 183}
184 184
185/* 185/*
186 * Function : int t128_detect(Scsi_Host_Template * tpnt) 186 * Function : int t128_detect(struct scsi_host_template * tpnt)
187 * 187 *
188 * Purpose : detects and initializes T128,T128F, or T228 controllers 188 * Purpose : detects and initializes T128,T128F, or T228 controllers
189 * that were autoprobed, overridden on the LILO command line, 189 * that were autoprobed, overridden on the LILO command line,
@@ -195,7 +195,7 @@ void __init t128_setup(char *str, int *ints){
195 * 195 *
196 */ 196 */
197 197
198int __init t128_detect(Scsi_Host_Template * tpnt){ 198int __init t128_detect(struct scsi_host_template * tpnt){
199 static int current_override = 0, current_base = 0; 199 static int current_override = 0, current_base = 0;
200 struct Scsi_Host *instance; 200 struct Scsi_Host *instance;
201 unsigned long base; 201 unsigned long base;
@@ -430,7 +430,7 @@ MODULE_LICENSE("GPL");
430 430
431#include "NCR5380.c" 431#include "NCR5380.c"
432 432
433static Scsi_Host_Template driver_template = { 433static struct scsi_host_template driver_template = {
434 .name = "Trantor T128/T128F/T228", 434 .name = "Trantor T128/T128F/T228",
435 .detect = t128_detect, 435 .detect = t128_detect,
436 .release = t128_release, 436 .release = t128_release,
diff --git a/drivers/scsi/t128.h b/drivers/scsi/t128.h
index 596f3a32a1c6..646e840266e2 100644
--- a/drivers/scsi/t128.h
+++ b/drivers/scsi/t128.h
@@ -95,7 +95,7 @@
95static int t128_abort(Scsi_Cmnd *); 95static int t128_abort(Scsi_Cmnd *);
96static int t128_biosparam(struct scsi_device *, struct block_device *, 96static int t128_biosparam(struct scsi_device *, struct block_device *,
97 sector_t, int*); 97 sector_t, int*);
98static int t128_detect(Scsi_Host_Template *); 98static int t128_detect(struct scsi_host_template *);
99static int t128_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 99static int t128_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
100static int t128_bus_reset(Scsi_Cmnd *); 100static int t128_bus_reset(Scsi_Cmnd *);
101 101
diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c
index 1ce29ba683eb..33cd90fc657b 100644
--- a/drivers/scsi/u14-34f.c
+++ b/drivers/scsi/u14-34f.c
@@ -282,7 +282,7 @@
282 * clustering is enabled. ENABLE_CLUSTERING provides a performance increase 282 * clustering is enabled. ENABLE_CLUSTERING provides a performance increase
283 * up to 50% on sequential access. 283 * up to 50% on sequential access.
284 * 284 *
285 * Since the Scsi_Host_Template structure is shared among all 14F and 34F, 285 * Since the struct scsi_host_template structure is shared among all 14F and 34F,
286 * the last setting of use_clustering is in effect for all of these boards. 286 * the last setting of use_clustering is in effect for all of these boards.
287 * 287 *
288 * Here a sample configuration using two U14F boards: 288 * Here a sample configuration using two U14F boards:
diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
index 486551bd54ba..e681681ab7a2 100644
--- a/drivers/scsi/ultrastor.c
+++ b/drivers/scsi/ultrastor.c
@@ -343,7 +343,7 @@ static void log_ultrastor_abort(struct ultrastor_config *config,
343} 343}
344#endif 344#endif
345 345
346static int ultrastor_14f_detect(Scsi_Host_Template * tpnt) 346static int ultrastor_14f_detect(struct scsi_host_template * tpnt)
347{ 347{
348 size_t i; 348 size_t i;
349 unsigned char in_byte, version_byte = 0; 349 unsigned char in_byte, version_byte = 0;
@@ -525,7 +525,7 @@ out_release_port:
525 return FALSE; 525 return FALSE;
526} 526}
527 527
528static int ultrastor_24f_detect(Scsi_Host_Template * tpnt) 528static int ultrastor_24f_detect(struct scsi_host_template * tpnt)
529{ 529{
530 int i; 530 int i;
531 struct Scsi_Host * shpnt = NULL; 531 struct Scsi_Host * shpnt = NULL;
@@ -637,7 +637,7 @@ static int ultrastor_24f_detect(Scsi_Host_Template * tpnt)
637 return FALSE; 637 return FALSE;
638} 638}
639 639
640static int ultrastor_detect(Scsi_Host_Template * tpnt) 640static int ultrastor_detect(struct scsi_host_template * tpnt)
641{ 641{
642 tpnt->proc_name = "ultrastor"; 642 tpnt->proc_name = "ultrastor";
643 return ultrastor_14f_detect(tpnt) || ultrastor_24f_detect(tpnt); 643 return ultrastor_14f_detect(tpnt) || ultrastor_24f_detect(tpnt);
@@ -1184,7 +1184,7 @@ static irqreturn_t do_ultrastor_interrupt(int irq, void *dev_id,
1184 1184
1185MODULE_LICENSE("GPL"); 1185MODULE_LICENSE("GPL");
1186 1186
1187static Scsi_Host_Template driver_template = { 1187static struct scsi_host_template driver_template = {
1188 .name = "UltraStor 14F/24F/34F", 1188 .name = "UltraStor 14F/24F/34F",
1189 .detect = ultrastor_detect, 1189 .detect = ultrastor_detect,
1190 .release = ultrastor_release, 1190 .release = ultrastor_release,
diff --git a/drivers/scsi/ultrastor.h b/drivers/scsi/ultrastor.h
index 0a0f8df9e871..da759a11deff 100644
--- a/drivers/scsi/ultrastor.h
+++ b/drivers/scsi/ultrastor.h
@@ -13,7 +13,7 @@
13#ifndef _ULTRASTOR_H 13#ifndef _ULTRASTOR_H
14#define _ULTRASTOR_H 14#define _ULTRASTOR_H
15 15
16static int ultrastor_detect(Scsi_Host_Template *); 16static int ultrastor_detect(struct scsi_host_template *);
17static const char *ultrastor_info(struct Scsi_Host * shpnt); 17static const char *ultrastor_info(struct Scsi_Host * shpnt);
18static int ultrastor_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 18static int ultrastor_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
19static int ultrastor_abort(Scsi_Cmnd *); 19static int ultrastor_abort(Scsi_Cmnd *);
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index c89d0769b3da..61a2604cce4f 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -632,7 +632,7 @@ out:
632 return err; 632 return err;
633} 633}
634 634
635static Scsi_Host_Template mts_scsi_host_template = { 635static struct scsi_host_template mts_scsi_host_template = {
636 .module = THIS_MODULE, 636 .module = THIS_MODULE,
637 .name = "microtekX6", 637 .name = "microtekX6",
638 .proc_name = "microtekX6", 638 .proc_name = "microtekX6",
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 1464a7586de8..ad5996183ec2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -399,7 +399,7 @@ struct ata_port_operations {
399}; 399};
400 400
401struct ata_port_info { 401struct ata_port_info {
402 struct scsi_host_template *sht; 402 struct scsi_host_template *sht;
403 unsigned long host_flags; 403 unsigned long host_flags;
404 unsigned long pio_mask; 404 unsigned long pio_mask;
405 unsigned long mwdma_mask; 405 unsigned long mwdma_mask;
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 4e06eb0f4451..d00f8ba7f22b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -442,6 +442,7 @@
442#define PCI_DEVICE_ID_IBM_SNIPE 0x0180 442#define PCI_DEVICE_ID_IBM_SNIPE 0x0180
443#define PCI_DEVICE_ID_IBM_CITRINE 0x028C 443#define PCI_DEVICE_ID_IBM_CITRINE 0x028C
444#define PCI_DEVICE_ID_IBM_GEMSTONE 0xB166 444#define PCI_DEVICE_ID_IBM_GEMSTONE 0xB166
445#define PCI_DEVICE_ID_IBM_OBSIDIAN 0x02BD
445#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_1 0x0031 446#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_1 0x0031
446#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2 0x0219 447#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2 0x0219
447#define PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX 0x021A 448#define PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX 0x021A
@@ -2147,6 +2148,7 @@
2147#define PCI_DEVICE_ID_ADAPTEC2_7899B 0x00c1 2148#define PCI_DEVICE_ID_ADAPTEC2_7899B 0x00c1
2148#define PCI_DEVICE_ID_ADAPTEC2_7899D 0x00c3 2149#define PCI_DEVICE_ID_ADAPTEC2_7899D 0x00c3
2149#define PCI_DEVICE_ID_ADAPTEC2_7899P 0x00cf 2150#define PCI_DEVICE_ID_ADAPTEC2_7899P 0x00cf
2151#define PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN 0x0500
2150#define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503 2152#define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503
2151 2153
2152 2154
diff --git a/include/linux/raid_class.h b/include/linux/raid_class.h
index a71123c28272..48831eac2910 100644
--- a/include/linux/raid_class.h
+++ b/include/linux/raid_class.h
@@ -1,4 +1,9 @@
1/* 1/*
2 * raid_class.h - a generic raid visualisation class
3 *
4 * Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com>
5 *
6 * This file is licensed under GPLv2
2 */ 7 */
3#include <linux/transport_class.h> 8#include <linux/transport_class.h>
4 9
@@ -14,20 +19,35 @@ struct raid_function_template {
14}; 19};
15 20
16enum raid_state { 21enum raid_state {
17 RAID_ACTIVE = 1, 22 RAID_STATE_UNKNOWN = 0,
18 RAID_DEGRADED, 23 RAID_STATE_ACTIVE,
19 RAID_RESYNCING, 24 RAID_STATE_DEGRADED,
20 RAID_OFFLINE, 25 RAID_STATE_RESYNCING,
26 RAID_STATE_OFFLINE,
27};
28
29enum raid_level {
30 RAID_LEVEL_UNKNOWN = 0,
31 RAID_LEVEL_LINEAR,
32 RAID_LEVEL_0,
33 RAID_LEVEL_1,
34 RAID_LEVEL_3,
35 RAID_LEVEL_4,
36 RAID_LEVEL_5,
37 RAID_LEVEL_6,
21}; 38};
22 39
23struct raid_data { 40struct raid_data {
24 struct list_head component_list; 41 struct list_head component_list;
25 int component_count; 42 int component_count;
26 int level; 43 enum raid_level level;
27 enum raid_state state; 44 enum raid_state state;
28 int resync; 45 int resync;
29}; 46};
30 47
48/* resync complete goes from 0 to this */
49#define RAID_MAX_RESYNC (10000)
50
31#define DEFINE_RAID_ATTRIBUTE(type, attr) \ 51#define DEFINE_RAID_ATTRIBUTE(type, attr) \
32static inline void \ 52static inline void \
33raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \ 53raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \
@@ -48,7 +68,7 @@ raid_get_##attr(struct raid_template *r, struct device *dev) { \
48 return rd->attr; \ 68 return rd->attr; \
49} 69}
50 70
51DEFINE_RAID_ATTRIBUTE(int, level) 71DEFINE_RAID_ATTRIBUTE(enum raid_level, level)
52DEFINE_RAID_ATTRIBUTE(int, resync) 72DEFINE_RAID_ATTRIBUTE(int, resync)
53DEFINE_RAID_ATTRIBUTE(enum raid_state, state) 73DEFINE_RAID_ATTRIBUTE(enum raid_state, state)
54 74
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index ecd53d7872d2..6cbb1982ed03 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -7,6 +7,7 @@
7#include <linux/workqueue.h> 7#include <linux/workqueue.h>
8 8
9struct block_device; 9struct block_device;
10struct completion;
10struct module; 11struct module;
11struct scsi_cmnd; 12struct scsi_cmnd;
12struct scsi_device; 13struct scsi_device;
@@ -467,10 +468,8 @@ struct Scsi_Host {
467 468
468 struct list_head eh_cmd_q; 469 struct list_head eh_cmd_q;
469 struct task_struct * ehandler; /* Error recovery thread. */ 470 struct task_struct * ehandler; /* Error recovery thread. */
470 struct semaphore * eh_action; /* Wait for specific actions on the 471 struct completion * eh_action; /* Wait for specific actions on the
471 host. */ 472 host. */
472 unsigned int eh_active:1; /* Indicates the eh thread is awake and active if
473 this is true. */
474 wait_queue_head_t host_wait; 473 wait_queue_head_t host_wait;
475 struct scsi_host_template *hostt; 474 struct scsi_host_template *hostt;
476 struct scsi_transport_template *transportt; 475 struct scsi_transport_template *transportt;
diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h
index 2539debb7993..98d69fdb851c 100644
--- a/include/scsi/scsi_request.h
+++ b/include/scsi/scsi_request.h
@@ -47,9 +47,6 @@ struct scsi_request {
47 47
48extern struct scsi_request *scsi_allocate_request(struct scsi_device *, gfp_t); 48extern struct scsi_request *scsi_allocate_request(struct scsi_device *, gfp_t);
49extern void scsi_release_request(struct scsi_request *); 49extern void scsi_release_request(struct scsi_request *);
50extern void scsi_wait_req(struct scsi_request *, const void *cmnd,
51 void *buffer, unsigned bufflen,
52 int timeout, int retries);
53extern void scsi_do_req(struct scsi_request *, const void *cmnd, 50extern void scsi_do_req(struct scsi_request *, const void *cmnd,
54 void *buffer, unsigned bufflen, 51 void *buffer, unsigned bufflen,
55 void (*done) (struct scsi_cmnd *), 52 void (*done) (struct scsi_cmnd *),