| 1 | |
| 2 | * Initio 9100 device driver for Linux.
|
| 3 | *
|
| 4 | * Copyright (c) 1994-1998 Initio Corporation
|
| 5 | * All rights reserved.
|
| 6 | *
|
| 7 | * Cleanups (c) Copyright 2007 Red Hat <[email protected]>
|
| 8 | *
|
| 9 | * This program is free software; you can redistribute it and/or modify
|
| 10 | * it under the terms of the GNU General Public License as published by
|
| 11 | * the Free Software Foundation; either version 2, or (at your option)
|
| 12 | * any later version.
|
| 13 | *
|
| 14 | * This program is distributed in the hope that it will be useful,
|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 17 | * GNU General Public License for more details.
|
| 18 | *
|
| 19 | * You should have received a copy of the GNU General Public License
|
| 20 | * along with this program; see the file COPYING. If not, write to
|
| 21 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
| 22 | *
|
| 23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
| 24 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
| 27 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
| 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
| 30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
| 31 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
| 32 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
| 33 | * SUCH DAMAGE.
|
| 34 | *
|
| 35 | *************************************************************************
|
| 36 |
|
| 37 |
|
| 38 | #include <linux/types.h>
|
| 39 |
|
| 40 | #define TOTAL_SG_ENTRY 32
|
| 41 | #define MAX_SUPPORTED_ADAPTERS 8
|
| 42 | #define MAX_OFFSET 15
|
| 43 | #define MAX_TARGETS 16
|
| 44 |
|
| 45 | typedef struct {
|
| 46 | unsigned short base;
|
| 47 | unsigned short vec;
|
| 48 | } i91u_config;
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 | #define TUL_PVID 0x00
|
| 54 | #define TUL_PDID 0x02
|
| 55 | #define TUL_PCMD 0x04
|
| 56 | #define TUL_PSTUS 0x06
|
| 57 | #define TUL_PRID 0x08
|
| 58 | #define TUL_PPI 0x09
|
| 59 | #define TUL_PSC 0x0A
|
| 60 | #define TUL_PBC 0x0B
|
| 61 | #define TUL_PCLS 0x0C
|
| 62 | #define TUL_PLTR 0x0D
|
| 63 | #define TUL_PHDT 0x0E
|
| 64 | #define TUL_PBIST 0x0F
|
| 65 | #define TUL_PBAD 0x10
|
| 66 | #define TUL_PBAD1 0x14
|
| 67 | #define TUL_PBAD2 0x18
|
| 68 | #define TUL_PBAD3 0x1C
|
| 69 | #define TUL_PBAD4 0x20
|
| 70 | #define TUL_PBAD5 0x24
|
| 71 | #define TUL_PRSVD 0x28
|
| 72 | #define TUL_PRSVD1 0x2C
|
| 73 | #define TUL_PRAD 0x30
|
| 74 | #define TUL_PRSVD2 0x34
|
| 75 | #define TUL_PRSVD3 0x38
|
| 76 | #define TUL_PINTL 0x3C
|
| 77 | #define TUL_PINTP 0x3D
|
| 78 | #define TUL_PIGNT 0x3E
|
| 79 | #define TUL_PMGNT 0x3F
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 | #define TUL_HACFG0 0x40
|
| 85 | #define TUL_HACFG1 0x41
|
| 86 | #define TUL_HACFG2 0x42
|
| 87 |
|
| 88 | #define TUL_SDCFG0 0x44
|
| 89 | #define TUL_SDCFG1 0x45
|
| 90 | #define TUL_SDCFG2 0x46
|
| 91 | #define TUL_SDCFG3 0x47
|
| 92 |
|
| 93 | #define TUL_GINTS 0x50
|
| 94 | #define TUL_GIMSK 0x52
|
| 95 | #define TUL_GCTRL 0x54
|
| 96 | #define TUL_GCTRL_EEPROM_BIT 0x04
|
| 97 | #define TUL_GCTRL1 0x55
|
| 98 | #define TUL_DMACFG 0x5B
|
| 99 | #define TUL_NVRAM 0x5D
|
| 100 |
|
| 101 | #define TUL_SCnt0 0x80
|
| 102 | #define TUL_SCnt1 0x81
|
| 103 | #define TUL_SCnt2 0x82
|
| 104 | #define TUL_SFifoCnt 0x83
|
| 105 | #define TUL_SIntEnable 0x84
|
| 106 | #define TUL_SInt 0x84
|
| 107 | #define TUL_SCtrl0 0x85
|
| 108 | #define TUL_SStatus0 0x85
|
| 109 | #define TUL_SCtrl1 0x86
|
| 110 | #define TUL_SStatus1 0x86
|
| 111 | #define TUL_SConfig 0x87
|
| 112 | #define TUL_SStatus2 0x87
|
| 113 | #define TUL_SPeriod 0x88
|
| 114 | #define TUL_SOffset 0x88
|
| 115 | #define TUL_SScsiId 0x89
|
| 116 | #define TUL_SBusId 0x89
|
| 117 | #define TUL_STimeOut 0x8A
|
| 118 | #define TUL_SIdent 0x8A
|
| 119 | #define TUL_SAvail 0x8A
|
| 120 | #define TUL_SData 0x8B
|
| 121 | #define TUL_SFifo 0x8C
|
| 122 | #define TUL_SSignal 0x90
|
| 123 | #define TUL_SCmd 0x91
|
| 124 | #define TUL_STest0 0x92
|
| 125 | #define TUL_STest1 0x93
|
| 126 | #define TUL_SCFG1 0x94
|
| 127 |
|
| 128 | #define TUL_XAddH 0xC0
|
| 129 | #define TUL_XAddW 0xC8
|
| 130 | #define TUL_XCntH 0xD0
|
| 131 | #define TUL_XCntW 0xD4
|
| 132 | #define TUL_XCmd 0xD8
|
| 133 | #define TUL_Int 0xDC
|
| 134 | #define TUL_XStatus 0xDD
|
| 135 | #define TUL_Mask 0xE0
|
| 136 | #define TUL_XCtrl 0xE4
|
| 137 | #define TUL_XCtrl1 0xE5
|
| 138 | #define TUL_XFifo 0xE8
|
| 139 |
|
| 140 | #define TUL_WCtrl 0xF7
|
| 141 | #define TUL_DCtrl 0xFB
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 | #define BUSMS 0x04
|
| 147 | #define IOSPA 0x01
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 | #define TSC_EN_RESEL 0x80
|
| 153 | #define TSC_CMD_COMP 0x84
|
| 154 | #define TSC_SEL 0x01
|
| 155 | #define TSC_SEL_ATN 0x11
|
| 156 | #define TSC_SEL_ATN_DMA 0x51
|
| 157 | #define TSC_SEL_ATN3 0x31
|
| 158 | #define TSC_SEL_ATNSTOP 0x12
|
| 159 | #define TSC_SELATNSTOP 0x1E
|
| 160 |
|
| 161 | #define TSC_SEL_ATN_DIRECT_IN 0x95
|
| 162 | #define TSC_SEL_ATN_DIRECT_OUT 0x15
|
| 163 | #define TSC_SEL_ATN3_DIRECT_IN 0xB5
|
| 164 | #define TSC_SEL_ATN3_DIRECT_OUT 0x35
|
| 165 | #define TSC_XF_DMA_OUT_DIRECT 0x06
|
| 166 | #define TSC_XF_DMA_IN_DIRECT 0x86
|
| 167 |
|
| 168 | #define TSC_XF_DMA_OUT 0x43
|
| 169 | #define TSC_XF_DMA_IN 0xC3
|
| 170 | #define TSC_XF_FIFO_OUT 0x03
|
| 171 | #define TSC_XF_FIFO_IN 0x83
|
| 172 |
|
| 173 | #define TSC_MSG_ACCEPT 0x0F
|
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 | #define TSC_RST_SEQ 0x20
|
| 179 | #define TSC_FLUSH_FIFO 0x10
|
| 180 | #define TSC_ABT_CMD 0x04
|
| 181 | #define TSC_RST_CHIP 0x02
|
| 182 | #define TSC_RST_BUS 0x01
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 | #define TSC_EN_SCAM 0x80
|
| 188 | #define TSC_TIMER 0x40
|
| 189 | #define TSC_EN_SCSI2 0x20
|
| 190 | #define TSC_PWDN 0x10
|
| 191 | #define TSC_WIDE_CPU 0x08
|
| 192 | #define TSC_HW_RESELECT 0x04
|
| 193 | #define TSC_EN_BUS_OUT 0x02
|
| 194 | #define TSC_EN_BUS_IN 0x01
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 | #define TSC_EN_LATCH 0x80
|
| 200 | #define TSC_INITIATOR 0x40
|
| 201 | #define TSC_EN_SCSI_PAR 0x20
|
| 202 | #define TSC_DMA_8BIT 0x10
|
| 203 | #define TSC_DMA_16BIT 0x08
|
| 204 | #define TSC_EN_WDACK 0x04
|
| 205 | #define TSC_ALT_PERIOD 0x02
|
| 206 | #define TSC_DIS_SCSIRST 0x01
|
| 207 |
|
| 208 | #define TSC_INITDEFAULT (TSC_INITIATOR | TSC_EN_LATCH | TSC_ALT_PERIOD | TSC_DIS_SCSIRST)
|
| 209 |
|
| 210 | #define TSC_WIDE_SCSI 0x80
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 | #define TSC_RST_ACK 0x00
|
| 216 | #define TSC_RST_ATN 0x00
|
| 217 | #define TSC_RST_BSY 0x00
|
| 218 |
|
| 219 | #define TSC_SET_ACK 0x40
|
| 220 | #define TSC_SET_ATN 0x08
|
| 221 |
|
| 222 | #define TSC_REQI 0x80
|
| 223 | #define TSC_ACKI 0x40
|
| 224 | #define TSC_BSYI 0x20
|
| 225 | #define TSC_SELI 0x10
|
| 226 | #define TSC_ATNI 0x08
|
| 227 | #define TSC_MSGI 0x04
|
| 228 | #define TSC_CDI 0x02
|
| 229 | #define TSC_IOI 0x01
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 | #define TSS_INT_PENDING 0x80
|
| 236 | #define TSS_SEQ_ACTIVE 0x40
|
| 237 | #define TSS_XFER_CNT 0x20
|
| 238 | #define TSS_FIFO_EMPTY 0x10
|
| 239 | #define TSS_PAR_ERROR 0x08
|
| 240 | #define TSS_PH_MASK 0x07
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 | #define TSS_STATUS_RCV 0x08
|
| 246 | #define TSS_MSG_SEND 0x40
|
| 247 | #define TSS_CMD_PH_CMP 0x20
|
| 248 | #define TSS_DATA_PH_CMP 0x10
|
| 249 | #define TSS_STATUS_SEND 0x08
|
| 250 | #define TSS_XFER_CMP 0x04
|
| 251 | #define TSS_SEL_CMP 0x02
|
| 252 | #define TSS_ARB_CMP 0x01
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 | #define TSS_CMD_ABTED 0x80
|
| 258 | #define TSS_OFFSET_0 0x40
|
| 259 | #define TSS_FIFO_FULL 0x20
|
| 260 | #define TSS_TIMEOUT_0 0x10
|
| 261 | #define TSS_BUSY_RLS 0x08
|
| 262 | #define TSS_PH_MISMATCH 0x04
|
| 263 | #define TSS_SCSI_BUS_EN 0x02
|
| 264 | #define TSS_SCSIRST 0x01
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 | #define TSS_RESEL_INT 0x80
|
| 270 | #define TSS_SEL_TIMEOUT 0x40
|
| 271 | #define TSS_BUS_SERV 0x20
|
| 272 | #define TSS_SCSIRST_INT 0x10
|
| 273 | #define TSS_DISC_INT 0x08
|
| 274 | #define TSS_SEL_INT 0x04
|
| 275 | #define TSS_SCAM_SEL 0x02
|
| 276 | #define TSS_FUNC_COMP 0x01
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 | #define DATA_OUT 0
|
| 282 | #define DATA_IN 1
|
| 283 | #define CMD_OUT 2
|
| 284 | #define STATUS_IN 3
|
| 285 | #define MSG_OUT 6
|
| 286 | #define MSG_IN 7
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 | #define TAX_X_FORC 0x02
|
| 294 | #define TAX_X_ABT 0x04
|
| 295 | #define TAX_X_CLR_FIFO 0x08
|
| 296 |
|
| 297 | #define TAX_X_IN 0x21
|
| 298 | #define TAX_X_OUT 0x01
|
| 299 | #define TAX_SG_IN 0xA1
|
| 300 | #define TAX_SG_OUT 0x81
|
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
|
| 305 | #define XCMP 0x01
|
| 306 | #define FCMP 0x02
|
| 307 | #define XABT 0x04
|
| 308 | #define XERR 0x08
|
| 309 | #define SCMP 0x10
|
| 310 | #define IPEND 0x80
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
|
| 315 | #define XPEND 0x01
|
| 316 | #define FEMPTY 0x02
|
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
|
| 323 | #define EXTSG 0x80
|
| 324 | #define EXTAD 0x60
|
| 325 | #define SEG4K 0x08
|
| 326 | #define EEPRG 0x04
|
| 327 | #define MRMUL 0x02
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 | #define SE2CS 0x08
|
| 333 | #define SE2CLK 0x04
|
| 334 | #define SE2DO 0x02
|
| 335 | #define SE2DI 0x01
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 | struct sg_entry {
|
| 342 | u32 data;
|
| 343 | u32 len;
|
| 344 | };
|
| 345 |
|
| 346 | |
| 347 | SCSI Control Block
|
| 348 | ***********************************************************************
|
| 349 | struct scsi_ctrl_blk {
|
| 350 | struct scsi_ctrl_blk *next;
|
| 351 | u8 status;
|
| 352 | u8 next_state;
|
| 353 | u8 mode;
|
| 354 | u8 msgin;
|
| 355 | u16 sgidx;
|
| 356 | u16 sgmax;
|
| 357 | #ifdef ALPHA
|
| 358 | u32 reserved[2];
|
| 359 | #else
|
| 360 | u32 reserved[3];
|
| 361 | #endif
|
| 362 |
|
| 363 | u32 xferlen;
|
| 364 | u32 totxlen;
|
| 365 | u32 paddr;
|
| 366 |
|
| 367 | u8 opcode;
|
| 368 | u8 flags;
|
| 369 | u8 target;
|
| 370 | u8 lun;
|
| 371 | u32 bufptr;
|
| 372 | u32 buflen;
|
| 373 | u8 sglen;
|
| 374 | u8 senselen;
|
| 375 | u8 hastat;
|
| 376 | u8 tastat;
|
| 377 | u8 cdblen;
|
| 378 | u8 ident;
|
| 379 | u8 tagmsg;
|
| 380 | u8 tagid;
|
| 381 | u8 cdb[12];
|
| 382 | u32 sgpaddr;
|
| 383 | u32 senseptr;
|
| 384 | void (*post) (u8 *, u8 *);
|
| 385 | struct scsi_cmnd *srb;
|
| 386 | struct sg_entry sglist[TOTAL_SG_ENTRY];
|
| 387 | };
|
| 388 |
|
| 389 |
|
| 390 | #define SCB_RENT 0x01
|
| 391 | #define SCB_PEND 0x02
|
| 392 | #define SCB_CONTIG 0x04
|
| 393 | #define SCB_SELECT 0x08
|
| 394 | #define SCB_BUSY 0x10
|
| 395 | #define SCB_DONE 0x20
|
| 396 |
|
| 397 |
|
| 398 |
|
| 399 | #define ExecSCSI 0x1
|
| 400 | #define BusDevRst 0x2
|
| 401 | #define AbortCmd 0x3
|
| 402 |
|
| 403 |
|
| 404 |
|
| 405 | #define SCM_RSENS 0x01
|
| 406 |
|
| 407 |
|
| 408 |
|
| 409 | #define SCF_DONE 0x01
|
| 410 | #define SCF_POST 0x02
|
| 411 | #define SCF_SENSE 0x04
|
| 412 | #define SCF_DIR 0x18
|
| 413 | #define SCF_NO_DCHK 0x00
|
| 414 | #define SCF_DIN 0x08
|
| 415 | #define SCF_DOUT 0x10
|
| 416 | #define SCF_NO_XF 0x18
|
| 417 | #define SCF_WR_VF 0x20
|
| 418 | #define SCF_POLL 0x40
|
| 419 | #define SCF_SG 0x80
|
| 420 |
|
| 421 |
|
| 422 | #define HOST_SEL_TOUT 0x11
|
| 423 | #define HOST_DO_DU 0x12
|
| 424 | #define HOST_BUS_FREE 0x13
|
| 425 | #define HOST_BAD_PHAS 0x14
|
| 426 | #define HOST_INV_CMD 0x16
|
| 427 | #define HOST_ABORTED 0x1A
|
| 428 | #define HOST_SCSI_RST 0x1B
|
| 429 | #define HOST_DEV_RST 0x1C
|
| 430 |
|
| 431 |
|
| 432 | #define TARGET_CHKCOND 0x02
|
| 433 | #define TARGET_BUSY 0x08
|
| 434 | #define INI_QUEUE_FULL 0x28
|
| 435 |
|
| 436 | |
| 437 | Target Device Control Structure
|
| 438 | *********************************************************************
|
| 439 |
|
| 440 | struct target_control {
|
| 441 | u16 flags;
|
| 442 | u8 js_period;
|
| 443 | u8 sconfig0;
|
| 444 | u16 drv_flags;
|
| 445 | u8 heads;
|
| 446 | u8 sectors;
|
| 447 | };
|
| 448 |
|
| 449 | |
| 450 | Target Device Control Structure
|
| 451 | *********************************************************************
|
| 452 |
|
| 453 |
|
| 454 | #define TCF_SCSI_RATE 0x0007
|
| 455 | #define TCF_EN_DISC 0x0008
|
| 456 | #define TCF_NO_SYNC_NEGO 0x0010
|
| 457 | #define TCF_NO_WDTR 0x0020
|
| 458 | #define TCF_EN_255 0x0040
|
| 459 | #define TCF_EN_START 0x0080
|
| 460 | #define TCF_WDTR_DONE 0x0100
|
| 461 | #define TCF_SYNC_DONE 0x0200
|
| 462 | #define TCF_BUSY 0x0400
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 | #define TCF_DRV_BUSY 0x01
|
| 467 | #define TCF_DRV_EN_TAG 0x0800
|
| 468 | #define TCF_DRV_255_63 0x0400
|
| 469 |
|
| 470 | |
| 471 | Host Adapter Control Structure
|
| 472 | ***********************************************************************
|
| 473 | struct initio_host {
|
| 474 | u16 addr;
|
| 475 | u16 bios_addr;
|
| 476 | u8 irq;
|
| 477 | u8 scsi_id;
|
| 478 | u8 max_tar;
|
| 479 | u8 num_scbs;
|
| 480 |
|
| 481 | u8 flags;
|
| 482 | u8 index;
|
| 483 | u8 ha_id;
|
| 484 | u8 config;
|
| 485 | u16 idmask;
|
| 486 | u8 semaph;
|
| 487 | u8 phase;
|
| 488 | u8 jsstatus0;
|
| 489 | u8 jsint;
|
| 490 | u8 jsstatus1;
|
| 491 | u8 sconf1;
|
| 492 |
|
| 493 | u8 msg[8];
|
| 494 | struct scsi_ctrl_blk *next_avail;
|
| 495 | struct scsi_ctrl_blk *scb;
|
| 496 | struct scsi_ctrl_blk *scb_end;
|
| 497 | struct scsi_ctrl_blk *next_pending;
|
| 498 | struct scsi_ctrl_blk *next_contig;
|
| 499 | struct scsi_ctrl_blk *active;
|
| 500 | struct target_control *active_tc;
|
| 501 |
|
| 502 | struct scsi_ctrl_blk *first_avail;
|
| 503 | struct scsi_ctrl_blk *last_avail;
|
| 504 | struct scsi_ctrl_blk *first_pending;
|
| 505 | struct scsi_ctrl_blk *last_pending;
|
| 506 | struct scsi_ctrl_blk *first_busy;
|
| 507 | struct scsi_ctrl_blk *last_busy;
|
| 508 | struct scsi_ctrl_blk *first_done;
|
| 509 | struct scsi_ctrl_blk *last_done;
|
| 510 | u8 max_tags[16];
|
| 511 | u8 act_tags[16];
|
| 512 | struct target_control targets[MAX_TARGETS];
|
| 513 | spinlock_t avail_lock;
|
| 514 | spinlock_t semaph_lock;
|
| 515 | struct pci_dev *pci_dev;
|
| 516 | };
|
| 517 |
|
| 518 |
|
| 519 | #define HCC_SCSI_RESET 0x01
|
| 520 | #define HCC_EN_PAR 0x02
|
| 521 | #define HCC_ACT_TERM1 0x04
|
| 522 | #define HCC_ACT_TERM2 0x08
|
| 523 | #define HCC_AUTO_TERM 0x10
|
| 524 | #define HCC_EN_PWR 0x80
|
| 525 |
|
| 526 |
|
| 527 | #define HCF_EXPECT_DISC 0x01
|
| 528 | #define HCF_EXPECT_SELECT 0x02
|
| 529 | #define HCF_EXPECT_RESET 0x10
|
| 530 | #define HCF_EXPECT_DONE_DISC 0x20
|
| 531 |
|
| 532 | |
| 533 | Serial EEProm
|
| 534 | ******************************************************************
|
| 535 |
|
| 536 | typedef struct _NVRAM_SCSI {
|
| 537 | u8 NVM_ChSCSIID;
|
| 538 | u8 NVM_ChConfig1;
|
| 539 | u8 NVM_ChConfig2;
|
| 540 | u8 NVM_NumOfTarg;
|
| 541 |
|
| 542 | u8 NVM_Targ0Config;
|
| 543 | u8 NVM_Targ1Config;
|
| 544 | u8 NVM_Targ2Config;
|
| 545 | u8 NVM_Targ3Config;
|
| 546 | u8 NVM_Targ4Config;
|
| 547 | u8 NVM_Targ5Config;
|
| 548 | u8 NVM_Targ6Config;
|
| 549 | u8 NVM_Targ7Config;
|
| 550 | u8 NVM_Targ8Config;
|
| 551 | u8 NVM_Targ9Config;
|
| 552 | u8 NVM_TargAConfig;
|
| 553 | u8 NVM_TargBConfig;
|
| 554 | u8 NVM_TargCConfig;
|
| 555 | u8 NVM_TargDConfig;
|
| 556 | u8 NVM_TargEConfig;
|
| 557 | u8 NVM_TargFConfig;
|
| 558 | } NVRAM_SCSI;
|
| 559 |
|
| 560 | typedef struct _NVRAM {
|
| 561 |
|
| 562 | u16 NVM_Signature;
|
| 563 | u8 NVM_Size;
|
| 564 | u8 NVM_Revision;
|
| 565 |
|
| 566 | u8 NVM_ModelByte0;
|
| 567 | u8 NVM_ModelByte1;
|
| 568 | u8 NVM_ModelInfo;
|
| 569 | u8 NVM_NumOfCh;
|
| 570 | u8 NVM_BIOSConfig1;
|
| 571 | u8 NVM_BIOSConfig2;
|
| 572 | u8 NVM_HAConfig1;
|
| 573 | u8 NVM_HAConfig2;
|
| 574 | NVRAM_SCSI NVM_SCSIInfo[2];
|
| 575 | u8 NVM_reserved[10];
|
| 576 |
|
| 577 | u16 NVM_CheckSum;
|
| 578 | } NVRAM, *PNVRAM;
|
| 579 |
|
| 580 |
|
| 581 | #define NBC1_ENABLE 0x01
|
| 582 | #define NBC1_8DRIVE 0x02
|
| 583 | #define NBC1_REMOVABLE 0x04
|
| 584 | #define NBC1_INT19 0x08
|
| 585 | #define NBC1_BIOSSCAN 0x10
|
| 586 | #define NBC1_LUNSUPPORT 0x40
|
| 587 |
|
| 588 |
|
| 589 | #define NHC1_BOOTIDMASK 0x0F
|
| 590 | #define NHC1_LUNMASK 0x70
|
| 591 | #define NHC1_CHANMASK 0x80
|
| 592 |
|
| 593 |
|
| 594 | #define NCC1_BUSRESET 0x01
|
| 595 | #define NCC1_PARITYCHK 0x02
|
| 596 | #define NCC1_ACTTERM1 0x04
|
| 597 | #define NCC1_ACTTERM2 0x08
|
| 598 | #define NCC1_AUTOTERM 0x10
|
| 599 | #define NCC1_PWRMGR 0x80
|
| 600 |
|
| 601 |
|
| 602 | #define NTC_DISCONNECT 0x08
|
| 603 | #define NTC_SYNC 0x10
|
| 604 | #define NTC_NO_WDTR 0x20
|
| 605 | #define NTC_1GIGA 0x40
|
| 606 | #define NTC_SPINUP 0x80
|
| 607 |
|
| 608 |
|
| 609 | #define INI_SIGNATURE 0xC925
|
| 610 | #define NBC1_DEFAULT (NBC1_ENABLE)
|
| 611 | #define NCC1_DEFAULT (NCC1_BUSRESET | NCC1_AUTOTERM | NCC1_PARITYCHK)
|
| 612 | #define NTC_DEFAULT (NTC_NO_WDTR | NTC_1GIGA | NTC_DISCONNECT)
|
| 613 |
|
| 614 |
|
| 615 | #define DISC_NOT_ALLOW 0x80
|
| 616 | #define DISC_ALLOW 0xC0
|
| 617 | #define SCSICMD_RequestSense 0x03
|
| 618 |
|
| 619 | #define SCSI_ABORT_SNOOZE 0
|
| 620 | #define SCSI_ABORT_SUCCESS 1
|
| 621 | #define SCSI_ABORT_PENDING 2
|
| 622 | #define SCSI_ABORT_BUSY 3
|
| 623 | #define SCSI_ABORT_NOT_RUNNING 4
|
| 624 | #define SCSI_ABORT_ERROR 5
|
| 625 |
|
| 626 | #define SCSI_RESET_SNOOZE 0
|
| 627 | #define SCSI_RESET_PUNT 1
|
| 628 | #define SCSI_RESET_SUCCESS 2
|
| 629 | #define SCSI_RESET_PENDING 3
|
| 630 | #define SCSI_RESET_WAKEUP 4
|
| 631 | #define SCSI_RESET_NOT_RUNNING 5
|
| 632 | #define SCSI_RESET_ERROR 6
|
| 633 |
|
| 634 | #define SCSI_RESET_SYNCHRONOUS 0x01
|
| 635 | #define SCSI_RESET_ASYNCHRONOUS 0x02
|
| 636 | #define SCSI_RESET_SUGGEST_BUS_RESET 0x04
|
| 637 | #define SCSI_RESET_SUGGEST_HOST_RESET 0x08
|
| 638 |
|
| 639 | #define SCSI_RESET_BUS_RESET 0x100
|
| 640 | #define SCSI_RESET_HOST_RESET 0x200
|
| 641 | #define SCSI_RESET_ACTION 0xff
|
| 642 |
|
| 643 | struct initio_cmd_priv {
|
| 644 | dma_addr_t sense_dma_addr;
|
| 645 | dma_addr_t sglist_dma_addr;
|
| 646 | };
|
| 647 |
|
| 648 | static inline struct initio_cmd_priv *initio_priv(struct scsi_cmnd *cmd)
|
| 649 | {
|
| 650 | return scsi_cmd_priv(cmd);
|
| 651 | }
|