diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2007-06-15 09:45:30 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-06-17 17:09:29 -0400 |
commit | 4023c4747861e8c56f46e5fa50bd4feb63fc91fc (patch) | |
tree | a1e5988f2df2395842b298b899d4cfef9209269d /drivers/scsi/a100u2w.h | |
parent | 0d2fcd9f9858a34f7056b3b1cb60ce0f883d06b6 (diff) |
[SCSI] a100u2w: Convert into Linux style
I was investigating strange driver behaviour and thought that readable
code and proper visible types might help explain why it didn't work right
the moment a second SCB was outstanding to the controller. I was right
- Cleanup, linuxise, demacro
- Remove the BSD dual licence on the new work
- Switch the if ALPHA to if __LP64__. (struct size is then right
elsewhere) and then to CONFIG_64BIT as per Christoph's request
- Fix the recursive locking on a reset. This is the only actual real code
change (I hope ;)).
I'm not clear what the right way to handle the BIOS param stuff is on n
on x86-32/64. Using phys_to_virt and stuff is ugly and probably doesn't
make sense elsewhere
Still has a couple of odd things - and there seems to be a commonly shared
EEPROM handling error several drivers have. Roughly speaking several SCSI
drivers go
try and read EEPROM
It failed..
Write any changes between the default and the data we read
Which is great as for some paths we've no idea what was in
before, so each boot won't write it all back, won't checksum but will
repeat the bug
Also it can still sleep for a second with IRQ off, and there is some
dubious looking error path locking marked FIXME in case anyone feels
inspired to work on it. Not a newly introduced bug, and at least its now
marked.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/a100u2w.h')
-rw-r--r-- | drivers/scsi/a100u2w.h | 297 |
1 files changed, 126 insertions, 171 deletions
diff --git a/drivers/scsi/a100u2w.h b/drivers/scsi/a100u2w.h index 6f542d2600ea..d40e0c528198 100644 --- a/drivers/scsi/a100u2w.h +++ b/drivers/scsi/a100u2w.h | |||
@@ -18,27 +18,6 @@ | |||
18 | * along with this program; see the file COPYING. If not, write to | 18 | * along with this program; see the file COPYING. If not, write to |
19 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | * | 20 | * |
21 | * -------------------------------------------------------------------------- | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | ||
24 | * modification, are permitted provided that the following conditions | ||
25 | * are met: | ||
26 | * 1. Redistributions of source code must retain the above copyright | ||
27 | * notice, this list of conditions, and the following disclaimer, | ||
28 | * without modification, immediately at the beginning of the file. | ||
29 | * 2. Redistributions in binary form must reproduce the above copyright | ||
30 | * notice, this list of conditions and the following disclaimer in the | ||
31 | * documentation and/or other materials provided with the distribution. | ||
32 | * 3. The name of the author may not be used to endorse or promote products | ||
33 | * derived from this software without specific prior written permission. | ||
34 | * | ||
35 | * Where this Software is combined with software released under the terms of | ||
36 | * the GNU General Public License ("GPL") and the terms of the GPL would require the | ||
37 | * combined work to also be released under the terms of the GPL, the terms | ||
38 | * and conditions of this License will apply in addition to those of the | ||
39 | * GPL with the exception of any terms or conditions of this License that | ||
40 | * conflict with, or are expressly prohibited by, the GPL. | ||
41 | * | ||
42 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
43 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
44 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
@@ -50,30 +29,19 @@ | |||
50 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
51 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
52 | * SUCH DAMAGE. | 31 | * SUCH DAMAGE. |
53 | */ | 32 | * |
54 | |||
55 | /* | ||
56 | * Revision History: | 33 | * Revision History: |
57 | * 06/18/98 HL, Initial production Version 1.02 | 34 | * 06/18/98 HL, Initial production Version 1.02 |
58 | * 12/19/98 bv, Use spinlocks for 2.1.95 and up | 35 | * 12/19/98 bv, Use spinlocks for 2.1.95 and up |
59 | * 06/25/02 Doug Ledford <dledford@redhat.com> | 36 | * 06/25/02 Doug Ledford <dledford@redhat.com> |
60 | * - This and the i60uscsi.h file are almost identical, | 37 | * - This and the i60uscsi.h file are almost identical, |
61 | * merged them into a single header used by both .c files. | 38 | * merged them into a single header used by both .c files. |
39 | * 14/06/07 Alan Cox <alan@redhat.com> | ||
40 | * - Grand cleanup and Linuxisation | ||
62 | */ | 41 | */ |
63 | 42 | ||
64 | #define inia100_REVID "Initio INI-A100U2W SCSI device driver; Revision: 1.02d" | 43 | #define inia100_REVID "Initio INI-A100U2W SCSI device driver; Revision: 1.02d" |
65 | 44 | ||
66 | #define ULONG unsigned long | ||
67 | #define USHORT unsigned short | ||
68 | #define UCHAR unsigned char | ||
69 | #define BYTE unsigned char | ||
70 | #define WORD unsigned short | ||
71 | #define DWORD unsigned long | ||
72 | #define UBYTE unsigned char | ||
73 | #define UWORD unsigned short | ||
74 | #define UDWORD unsigned long | ||
75 | #define U32 u32 | ||
76 | |||
77 | #if 1 | 45 | #if 1 |
78 | #define ORC_MAXQUEUE 245 | 46 | #define ORC_MAXQUEUE 245 |
79 | #define ORC_MAXTAGS 64 | 47 | #define ORC_MAXTAGS 64 |
@@ -90,10 +58,10 @@ | |||
90 | /************************************************************************/ | 58 | /************************************************************************/ |
91 | /* Scatter-Gather Element Structure */ | 59 | /* Scatter-Gather Element Structure */ |
92 | /************************************************************************/ | 60 | /************************************************************************/ |
93 | typedef struct ORC_SG_Struc { | 61 | struct orc_sgent { |
94 | U32 SG_Ptr; /* Data Pointer */ | 62 | u32 base; /* Data Pointer */ |
95 | U32 SG_Len; /* Data Length */ | 63 | u32 length; /* Data Length */ |
96 | } ORC_SG; | 64 | }; |
97 | 65 | ||
98 | /* SCSI related definition */ | 66 | /* SCSI related definition */ |
99 | #define DISC_NOT_ALLOW 0x80 /* Disconnect is not allowed */ | 67 | #define DISC_NOT_ALLOW 0x80 /* Disconnect is not allowed */ |
@@ -165,42 +133,45 @@ typedef struct ORC_SG_Struc { | |||
165 | #define ORC_PRGMCTR1 0xE3 /* RISC program counter */ | 133 | #define ORC_PRGMCTR1 0xE3 /* RISC program counter */ |
166 | #define ORC_RISCRAM 0xEC /* RISC RAM data port 4 bytes */ | 134 | #define ORC_RISCRAM 0xEC /* RISC RAM data port 4 bytes */ |
167 | 135 | ||
168 | typedef struct orc_extended_scb { /* Extended SCB */ | 136 | struct orc_extended_scb { /* Extended SCB */ |
169 | ORC_SG ESCB_SGList[TOTAL_SG_ENTRY]; /*0 Start of SG list */ | 137 | struct orc_sgent sglist[TOTAL_SG_ENTRY]; /*0 Start of SG list */ |
170 | struct scsi_cmnd *SCB_Srb; /*50 SRB Pointer */ | 138 | struct scsi_cmnd *srb; /*50 SRB Pointer */ |
171 | } ESCB; | 139 | }; |
172 | 140 | ||
173 | /*********************************************************************** | 141 | /*********************************************************************** |
174 | SCSI Control Block | 142 | SCSI Control Block |
143 | |||
144 | 0x40 bytes long, the last 8 are user bytes | ||
175 | ************************************************************************/ | 145 | ************************************************************************/ |
176 | typedef struct orc_scb { /* Scsi_Ctrl_Blk */ | 146 | struct orc_scb { /* Scsi_Ctrl_Blk */ |
177 | UBYTE SCB_Opcode; /*00 SCB command code&residual */ | 147 | u8 opcode; /*00 SCB command code&residual */ |
178 | UBYTE SCB_Flags; /*01 SCB Flags */ | 148 | u8 flags; /*01 SCB Flags */ |
179 | UBYTE SCB_Target; /*02 Target Id */ | 149 | u8 target; /*02 Target Id */ |
180 | UBYTE SCB_Lun; /*03 Lun */ | 150 | u8 lun; /*03 Lun */ |
181 | U32 SCB_Reserved0; /*04 Reserved for ORCHID must 0 */ | 151 | u32 reserved0; /*04 Reserved for ORCHID must 0 */ |
182 | U32 SCB_XferLen; /*08 Data Transfer Length */ | 152 | u32 xferlen; /*08 Data Transfer Length */ |
183 | U32 SCB_Reserved1; /*0C Reserved for ORCHID must 0 */ | 153 | u32 reserved1; /*0C Reserved for ORCHID must 0 */ |
184 | U32 SCB_SGLen; /*10 SG list # * 8 */ | 154 | u32 sg_len; /*10 SG list # * 8 */ |
185 | U32 SCB_SGPAddr; /*14 SG List Buf physical Addr */ | 155 | u32 sg_addr; /*14 SG List Buf physical Addr */ |
186 | U32 SCB_SGPAddrHigh; /*18 SG Buffer high physical Addr */ | 156 | u32 sg_addrhigh; /*18 SG Buffer high physical Addr */ |
187 | UBYTE SCB_HaStat; /*1C Host Status */ | 157 | u8 hastat; /*1C Host Status */ |
188 | UBYTE SCB_TaStat; /*1D Target Status */ | 158 | u8 tastat; /*1D Target Status */ |
189 | UBYTE SCB_Status; /*1E SCB status */ | 159 | u8 status; /*1E SCB status */ |
190 | UBYTE SCB_Link; /*1F Link pointer, default 0xFF */ | 160 | u8 link; /*1F Link pointer, default 0xFF */ |
191 | UBYTE SCB_SenseLen; /*20 Sense Allocation Length */ | 161 | u8 sense_len; /*20 Sense Allocation Length */ |
192 | UBYTE SCB_CDBLen; /*21 CDB Length */ | 162 | u8 cdb_len; /*21 CDB Length */ |
193 | UBYTE SCB_Ident; /*22 Identify */ | 163 | u8 ident; /*22 Identify */ |
194 | UBYTE SCB_TagMsg; /*23 Tag Message */ | 164 | u8 tag_msg; /*23 Tag Message */ |
195 | UBYTE SCB_CDB[IMAX_CDB]; /*24 SCSI CDBs */ | 165 | u8 cdb[IMAX_CDB]; /*24 SCSI CDBs */ |
196 | UBYTE SCB_ScbIdx; /*3C Index for this ORCSCB */ | 166 | u8 scbidx; /*3C Index for this ORCSCB */ |
197 | U32 SCB_SensePAddr; /*34 Sense Buffer physical Addr */ | 167 | u32 sense_addr; /*34 Sense Buffer physical Addr */ |
198 | 168 | ||
199 | ESCB *SCB_EScb; /*38 Extended SCB Pointer */ | 169 | struct orc_extended_scb *escb; /*38 Extended SCB Pointer */ |
200 | #ifndef ALPHA | 170 | /* 64bit pointer or 32bit pointer + reserved ? */ |
201 | UBYTE SCB_Reserved2[4]; /*3E Reserved for Driver use */ | 171 | #ifndef CONFIG_64BIT |
172 | u8 reserved2[4]; /*3E Reserved for Driver use */ | ||
202 | #endif | 173 | #endif |
203 | } ORC_SCB; | 174 | }; |
204 | 175 | ||
205 | /* Opcodes of ORCSCB_Opcode */ | 176 | /* Opcodes of ORCSCB_Opcode */ |
206 | #define ORC_EXECSCSI 0x00 /* SCSI initiator command with residual */ | 177 | #define ORC_EXECSCSI 0x00 /* SCSI initiator command with residual */ |
@@ -239,13 +210,13 @@ typedef struct orc_scb { /* Scsi_Ctrl_Blk */ | |||
239 | Target Device Control Structure | 210 | Target Device Control Structure |
240 | **********************************************************************/ | 211 | **********************************************************************/ |
241 | 212 | ||
242 | typedef struct ORC_Tar_Ctrl_Struc { | 213 | struct orc_target { |
243 | UBYTE TCS_DrvDASD; /* 6 */ | 214 | u8 TCS_DrvDASD; /* 6 */ |
244 | UBYTE TCS_DrvSCSI; /* 7 */ | 215 | u8 TCS_DrvSCSI; /* 7 */ |
245 | UBYTE TCS_DrvHead; /* 8 */ | 216 | u8 TCS_DrvHead; /* 8 */ |
246 | UWORD TCS_DrvFlags; /* 4 */ | 217 | u16 TCS_DrvFlags; /* 4 */ |
247 | UBYTE TCS_DrvSector; /* 7 */ | 218 | u8 TCS_DrvSector; /* 7 */ |
248 | } ORC_TCS; | 219 | }; |
249 | 220 | ||
250 | /* Bit Definition for TCF_DrvFlags */ | 221 | /* Bit Definition for TCF_DrvFlags */ |
251 | #define TCS_DF_NODASD_SUPT 0x20 /* Suppress OS/2 DASD Mgr support */ | 222 | #define TCS_DF_NODASD_SUPT 0x20 /* Suppress OS/2 DASD Mgr support */ |
@@ -255,32 +226,23 @@ typedef struct ORC_Tar_Ctrl_Struc { | |||
255 | /*********************************************************************** | 226 | /*********************************************************************** |
256 | Host Adapter Control Structure | 227 | Host Adapter Control Structure |
257 | ************************************************************************/ | 228 | ************************************************************************/ |
258 | typedef struct ORC_Ha_Ctrl_Struc { | 229 | struct orc_host { |
259 | USHORT HCS_Base; /* 00 */ | 230 | unsigned long base; /* Base address */ |
260 | UBYTE HCS_Index; /* 02 */ | 231 | u8 index; /* Index (Channel)*/ |
261 | UBYTE HCS_Intr; /* 04 */ | 232 | u8 scsi_id; /* H/A SCSI ID */ |
262 | UBYTE HCS_SCSI_ID; /* 06 H/A SCSI ID */ | 233 | u8 BIOScfg; /*BIOS configuration */ |
263 | UBYTE HCS_BIOS; /* 07 BIOS configuration */ | 234 | u8 flags; |
264 | 235 | u8 max_targets; /* SCSI0MAXTags */ | |
265 | UBYTE HCS_Flags; /* 0B */ | 236 | struct orc_scb *scb_virt; /* Virtual Pointer to SCB array */ |
266 | UBYTE HCS_HAConfig1; /* 1B SCSI0MAXTags */ | 237 | dma_addr_t scb_phys; /* Scb Physical address */ |
267 | UBYTE HCS_MaxTar; /* 1B SCSI0MAXTags */ | 238 | struct orc_extended_scb *escb_virt; /* Virtual pointer to ESCB Scatter list */ |
268 | 239 | dma_addr_t escb_phys; /* scatter list Physical address */ | |
269 | USHORT HCS_Units; /* Number of units this adapter */ | 240 | u8 target_flag[16]; /* target configuration, TCF_EN_TAG */ |
270 | USHORT HCS_AFlags; /* Adapter info. defined flags */ | 241 | u8 max_tags[16]; /* ORC_MAX_SCBS */ |
271 | ULONG HCS_Timeout; /* Adapter timeout value */ | 242 | u32 allocation_map[MAX_CHANNELS][8]; /* Max STB is 256, So 256/32 */ |
272 | ORC_SCB *HCS_virScbArray; /* 28 Virtual Pointer to SCB array */ | 243 | spinlock_t allocation_lock; |
273 | dma_addr_t HCS_physScbArray; /* Scb Physical address */ | ||
274 | ESCB *HCS_virEscbArray; /* Virtual pointer to ESCB Scatter list */ | ||
275 | dma_addr_t HCS_physEscbArray; /* scatter list Physical address */ | ||
276 | UBYTE TargetFlag[16]; /* 30 target configuration, TCF_EN_TAG */ | ||
277 | UBYTE MaximumTags[16]; /* 40 ORC_MAX_SCBS */ | ||
278 | UBYTE ActiveTags[16][16]; /* 50 */ | ||
279 | ORC_TCS HCS_Tcs[16]; /* 28 */ | ||
280 | U32 BitAllocFlag[MAX_CHANNELS][8]; /* Max STB is 256, So 256/32 */ | ||
281 | spinlock_t BitAllocFlagLock; | ||
282 | struct pci_dev *pdev; | 244 | struct pci_dev *pdev; |
283 | } ORC_HCS; | 245 | }; |
284 | 246 | ||
285 | /* Bit Definition for HCS_Flags */ | 247 | /* Bit Definition for HCS_Flags */ |
286 | 248 | ||
@@ -301,79 +263,79 @@ typedef struct ORC_Ha_Ctrl_Struc { | |||
301 | #define HCS_AF_DISABLE_RESET 0x10 /* Adapter disable reset */ | 263 | #define HCS_AF_DISABLE_RESET 0x10 /* Adapter disable reset */ |
302 | #define HCS_AF_DISABLE_ADPT 0x80 /* Adapter disable */ | 264 | #define HCS_AF_DISABLE_ADPT 0x80 /* Adapter disable */ |
303 | 265 | ||
304 | typedef struct _NVRAM { | 266 | struct orc_nvram { |
305 | /*----------header ---------------*/ | 267 | /*----------header ---------------*/ |
306 | UCHAR SubVendorID0; /* 00 - Sub Vendor ID */ | 268 | u8 SubVendorID0; /* 00 - Sub Vendor ID */ |
307 | UCHAR SubVendorID1; /* 00 - Sub Vendor ID */ | 269 | u8 SubVendorID1; /* 00 - Sub Vendor ID */ |
308 | UCHAR SubSysID0; /* 02 - Sub System ID */ | 270 | u8 SubSysID0; /* 02 - Sub System ID */ |
309 | UCHAR SubSysID1; /* 02 - Sub System ID */ | 271 | u8 SubSysID1; /* 02 - Sub System ID */ |
310 | UCHAR SubClass; /* 04 - Sub Class */ | 272 | u8 SubClass; /* 04 - Sub Class */ |
311 | UCHAR VendorID0; /* 05 - Vendor ID */ | 273 | u8 VendorID0; /* 05 - Vendor ID */ |
312 | UCHAR VendorID1; /* 05 - Vendor ID */ | 274 | u8 VendorID1; /* 05 - Vendor ID */ |
313 | UCHAR DeviceID0; /* 07 - Device ID */ | 275 | u8 DeviceID0; /* 07 - Device ID */ |
314 | UCHAR DeviceID1; /* 07 - Device ID */ | 276 | u8 DeviceID1; /* 07 - Device ID */ |
315 | UCHAR Reserved0[2]; /* 09 - Reserved */ | 277 | u8 Reserved0[2]; /* 09 - Reserved */ |
316 | UCHAR Revision; /* 0B - Revision of data structure */ | 278 | u8 revision; /* 0B - revision of data structure */ |
317 | /* ----Host Adapter Structure ---- */ | 279 | /* ----Host Adapter Structure ---- */ |
318 | UCHAR NumOfCh; /* 0C - Number of SCSI channel */ | 280 | u8 NumOfCh; /* 0C - Number of SCSI channel */ |
319 | UCHAR BIOSConfig1; /* 0D - BIOS configuration 1 */ | 281 | u8 BIOSConfig1; /* 0D - BIOS configuration 1 */ |
320 | UCHAR BIOSConfig2; /* 0E - BIOS boot channel&target ID */ | 282 | u8 BIOSConfig2; /* 0E - BIOS boot channel&target ID */ |
321 | UCHAR BIOSConfig3; /* 0F - BIOS configuration 3 */ | 283 | u8 BIOSConfig3; /* 0F - BIOS configuration 3 */ |
322 | /* ----SCSI channel Structure ---- */ | 284 | /* ----SCSI channel Structure ---- */ |
323 | /* from "CTRL-I SCSI Host Adapter SetUp menu " */ | 285 | /* from "CTRL-I SCSI Host Adapter SetUp menu " */ |
324 | UCHAR SCSI0Id; /* 10 - Channel 0 SCSI ID */ | 286 | u8 scsi_id; /* 10 - Channel 0 SCSI ID */ |
325 | UCHAR SCSI0Config; /* 11 - Channel 0 SCSI configuration */ | 287 | u8 SCSI0Config; /* 11 - Channel 0 SCSI configuration */ |
326 | UCHAR SCSI0MaxTags; /* 12 - Channel 0 Maximum tags */ | 288 | u8 SCSI0MaxTags; /* 12 - Channel 0 Maximum tags */ |
327 | UCHAR SCSI0ResetTime; /* 13 - Channel 0 Reset recovering time */ | 289 | u8 SCSI0ResetTime; /* 13 - Channel 0 Reset recovering time */ |
328 | UCHAR ReservedforChannel0[2]; /* 14 - Reserved */ | 290 | u8 ReservedforChannel0[2]; /* 14 - Reserved */ |
329 | 291 | ||
330 | /* ----SCSI target Structure ---- */ | 292 | /* ----SCSI target Structure ---- */ |
331 | /* from "CTRL-I SCSI device SetUp menu " */ | 293 | /* from "CTRL-I SCSI device SetUp menu " */ |
332 | UCHAR Target00Config; /* 16 - Channel 0 Target 0 config */ | 294 | u8 Target00Config; /* 16 - Channel 0 Target 0 config */ |
333 | UCHAR Target01Config; /* 17 - Channel 0 Target 1 config */ | 295 | u8 Target01Config; /* 17 - Channel 0 Target 1 config */ |
334 | UCHAR Target02Config; /* 18 - Channel 0 Target 2 config */ | 296 | u8 Target02Config; /* 18 - Channel 0 Target 2 config */ |
335 | UCHAR Target03Config; /* 19 - Channel 0 Target 3 config */ | 297 | u8 Target03Config; /* 19 - Channel 0 Target 3 config */ |
336 | UCHAR Target04Config; /* 1A - Channel 0 Target 4 config */ | 298 | u8 Target04Config; /* 1A - Channel 0 Target 4 config */ |
337 | UCHAR Target05Config; /* 1B - Channel 0 Target 5 config */ | 299 | u8 Target05Config; /* 1B - Channel 0 Target 5 config */ |
338 | UCHAR Target06Config; /* 1C - Channel 0 Target 6 config */ | 300 | u8 Target06Config; /* 1C - Channel 0 Target 6 config */ |
339 | UCHAR Target07Config; /* 1D - Channel 0 Target 7 config */ | 301 | u8 Target07Config; /* 1D - Channel 0 Target 7 config */ |
340 | UCHAR Target08Config; /* 1E - Channel 0 Target 8 config */ | 302 | u8 Target08Config; /* 1E - Channel 0 Target 8 config */ |
341 | UCHAR Target09Config; /* 1F - Channel 0 Target 9 config */ | 303 | u8 Target09Config; /* 1F - Channel 0 Target 9 config */ |
342 | UCHAR Target0AConfig; /* 20 - Channel 0 Target A config */ | 304 | u8 Target0AConfig; /* 20 - Channel 0 Target A config */ |
343 | UCHAR Target0BConfig; /* 21 - Channel 0 Target B config */ | 305 | u8 Target0BConfig; /* 21 - Channel 0 Target B config */ |
344 | UCHAR Target0CConfig; /* 22 - Channel 0 Target C config */ | 306 | u8 Target0CConfig; /* 22 - Channel 0 Target C config */ |
345 | UCHAR Target0DConfig; /* 23 - Channel 0 Target D config */ | 307 | u8 Target0DConfig; /* 23 - Channel 0 Target D config */ |
346 | UCHAR Target0EConfig; /* 24 - Channel 0 Target E config */ | 308 | u8 Target0EConfig; /* 24 - Channel 0 Target E config */ |
347 | UCHAR Target0FConfig; /* 25 - Channel 0 Target F config */ | 309 | u8 Target0FConfig; /* 25 - Channel 0 Target F config */ |
348 | 310 | ||
349 | UCHAR SCSI1Id; /* 26 - Channel 1 SCSI ID */ | 311 | u8 SCSI1Id; /* 26 - Channel 1 SCSI ID */ |
350 | UCHAR SCSI1Config; /* 27 - Channel 1 SCSI configuration */ | 312 | u8 SCSI1Config; /* 27 - Channel 1 SCSI configuration */ |
351 | UCHAR SCSI1MaxTags; /* 28 - Channel 1 Maximum tags */ | 313 | u8 SCSI1MaxTags; /* 28 - Channel 1 Maximum tags */ |
352 | UCHAR SCSI1ResetTime; /* 29 - Channel 1 Reset recovering time */ | 314 | u8 SCSI1ResetTime; /* 29 - Channel 1 Reset recovering time */ |
353 | UCHAR ReservedforChannel1[2]; /* 2A - Reserved */ | 315 | u8 ReservedforChannel1[2]; /* 2A - Reserved */ |
354 | 316 | ||
355 | /* ----SCSI target Structure ---- */ | 317 | /* ----SCSI target Structure ---- */ |
356 | /* from "CTRL-I SCSI device SetUp menu " */ | 318 | /* from "CTRL-I SCSI device SetUp menu " */ |
357 | UCHAR Target10Config; /* 2C - Channel 1 Target 0 config */ | 319 | u8 Target10Config; /* 2C - Channel 1 Target 0 config */ |
358 | UCHAR Target11Config; /* 2D - Channel 1 Target 1 config */ | 320 | u8 Target11Config; /* 2D - Channel 1 Target 1 config */ |
359 | UCHAR Target12Config; /* 2E - Channel 1 Target 2 config */ | 321 | u8 Target12Config; /* 2E - Channel 1 Target 2 config */ |
360 | UCHAR Target13Config; /* 2F - Channel 1 Target 3 config */ | 322 | u8 Target13Config; /* 2F - Channel 1 Target 3 config */ |
361 | UCHAR Target14Config; /* 30 - Channel 1 Target 4 config */ | 323 | u8 Target14Config; /* 30 - Channel 1 Target 4 config */ |
362 | UCHAR Target15Config; /* 31 - Channel 1 Target 5 config */ | 324 | u8 Target15Config; /* 31 - Channel 1 Target 5 config */ |
363 | UCHAR Target16Config; /* 32 - Channel 1 Target 6 config */ | 325 | u8 Target16Config; /* 32 - Channel 1 Target 6 config */ |
364 | UCHAR Target17Config; /* 33 - Channel 1 Target 7 config */ | 326 | u8 Target17Config; /* 33 - Channel 1 Target 7 config */ |
365 | UCHAR Target18Config; /* 34 - Channel 1 Target 8 config */ | 327 | u8 Target18Config; /* 34 - Channel 1 Target 8 config */ |
366 | UCHAR Target19Config; /* 35 - Channel 1 Target 9 config */ | 328 | u8 Target19Config; /* 35 - Channel 1 Target 9 config */ |
367 | UCHAR Target1AConfig; /* 36 - Channel 1 Target A config */ | 329 | u8 Target1AConfig; /* 36 - Channel 1 Target A config */ |
368 | UCHAR Target1BConfig; /* 37 - Channel 1 Target B config */ | 330 | u8 Target1BConfig; /* 37 - Channel 1 Target B config */ |
369 | UCHAR Target1CConfig; /* 38 - Channel 1 Target C config */ | 331 | u8 Target1CConfig; /* 38 - Channel 1 Target C config */ |
370 | UCHAR Target1DConfig; /* 39 - Channel 1 Target D config */ | 332 | u8 Target1DConfig; /* 39 - Channel 1 Target D config */ |
371 | UCHAR Target1EConfig; /* 3A - Channel 1 Target E config */ | 333 | u8 Target1EConfig; /* 3A - Channel 1 Target E config */ |
372 | UCHAR Target1FConfig; /* 3B - Channel 1 Target F config */ | 334 | u8 Target1FConfig; /* 3B - Channel 1 Target F config */ |
373 | UCHAR reserved[3]; /* 3C - Reserved */ | 335 | u8 reserved[3]; /* 3C - Reserved */ |
374 | /* ---------- CheckSum ---------- */ | 336 | /* ---------- CheckSum ---------- */ |
375 | UCHAR CheckSum; /* 3F - Checksum of NVRam */ | 337 | u8 CheckSum; /* 3F - Checksum of NVRam */ |
376 | } NVRAM, *PNVRAM; | 338 | }; |
377 | 339 | ||
378 | /* Bios Configuration for nvram->BIOSConfig1 */ | 340 | /* Bios Configuration for nvram->BIOSConfig1 */ |
379 | #define NBC_BIOSENABLE 0x01 /* BIOS enable */ | 341 | #define NBC_BIOSENABLE 0x01 /* BIOS enable */ |
@@ -407,10 +369,3 @@ typedef struct _NVRAM { | |||
407 | #define NCC_RESET_TIME 0x0A /* SCSI RESET recovering time */ | 369 | #define NCC_RESET_TIME 0x0A /* SCSI RESET recovering time */ |
408 | #define NTC_DEFAULT (NTC_1GIGA | NTC_NO_WIDESYNC | NTC_DISC_ENABLE) | 370 | #define NTC_DEFAULT (NTC_1GIGA | NTC_NO_WIDESYNC | NTC_DISC_ENABLE) |
409 | 371 | ||
410 | #define ORC_RD(x,y) (UCHAR)(inb( (int)((ULONG)((ULONG)x+(UCHAR)y)) )) | ||
411 | #define ORC_RDWORD(x,y) (short)(inl((int)((ULONG)((ULONG)x+(UCHAR)y)) )) | ||
412 | #define ORC_RDLONG(x,y) (long)(inl((int)((ULONG)((ULONG)x+(UCHAR)y)) )) | ||
413 | |||
414 | #define ORC_WR( adr,data) outb( (UCHAR)(data), (int)(adr)) | ||
415 | #define ORC_WRSHORT(adr,data) outw( (UWORD)(data), (int)(adr)) | ||
416 | #define ORC_WRLONG( adr,data) outl( (ULONG)(data), (int)(adr)) | ||