Go to the documentation of this file.
10 #define SBUS_CFG1 0x006UL
11 #define SBUS_CTRL 0x008UL
12 #define SBUS_STAT 0x00aUL
13 #define SBUS_SEMAPHORE 0x00cUL
14 #define CMD_DMA_CTRL 0x022UL
15 #define DATA_DMA_CTRL 0x042UL
22 #define CPU_CMD 0x214UL
23 #define CPU_ORIDE 0x224UL
24 #define CPU_PCTRL 0x272UL
25 #define CPU_PDIFF 0x276UL
26 #define RISC_PSR 0x420UL
27 #define RISC_MTREG 0x42EUL
28 #define HCCTRL 0x440UL
31 #define MAX_TARGETS 16
45 #define QLOGICPTI_REQ_QUEUE_LEN 255
46 #define QLOGICPTI_MAX_SG(ql) (4 + (((ql) > 0) ? 7*((ql) - 1) : 0))
49 #define MBOX_COMMAND_COMPLETE 0x4000
50 #define INVALID_COMMAND 0x4001
51 #define HOST_INTERFACE_ERROR 0x4002
52 #define TEST_FAILED 0x4003
53 #define COMMAND_ERROR 0x4005
54 #define COMMAND_PARAM_ERROR 0x4006
57 #define ASYNC_SCSI_BUS_RESET 0x8001
58 #define SYSTEM_ERROR 0x8002
59 #define REQUEST_TRANSFER_ERROR 0x8003
60 #define RESPONSE_TRANSFER_ERROR 0x8004
61 #define REQUEST_QUEUE_WAKEUP 0x8005
62 #define EXECUTION_TIMEOUT_RESET 0x8006
80 #define ENTRY_COMMAND 1
81 #define ENTRY_CONTINUATION 2
82 #define ENTRY_STATUS 3
83 #define ENTRY_MARKER 4
84 #define ENTRY_EXTENDED_COMMAND 5
87 #define EFLAG_CONTINUATION 1
89 #define EFLAG_BAD_HEADER 4
90 #define EFLAG_BAD_PAYLOAD 8
117 #define CFLAG_NODISC 0x01
118 #define CFLAG_HEAD_TAG 0x02
119 #define CFLAG_ORDERED_TAG 0x04
120 #define CFLAG_SIMPLE_TAG 0x08
121 #define CFLAG_TAR_RTN 0x10
122 #define CFLAG_READ 0x20
123 #define CFLAG_WRITE 0x40
170 #define SYNC_DEVICE 0
171 #define SYNC_TARGET 1
189 #define CS_COMPLETE 0x0000
190 #define CS_INCOMPLETE 0x0001
191 #define CS_DMA_ERROR 0x0002
192 #define CS_TRANSPORT_ERROR 0x0003
193 #define CS_RESET_OCCURRED 0x0004
194 #define CS_ABORTED 0x0005
195 #define CS_TIMEOUT 0x0006
196 #define CS_DATA_OVERRUN 0x0007
197 #define CS_COMMAND_OVERRUN 0x0008
198 #define CS_STATUS_OVERRUN 0x0009
199 #define CS_BAD_MESSAGE 0x000a
200 #define CS_NO_MESSAGE_OUT 0x000b
201 #define CS_EXT_ID_FAILED 0x000c
202 #define CS_IDE_MSG_FAILED 0x000d
203 #define CS_ABORT_MSG_FAILED 0x000e
204 #define CS_REJECT_MSG_FAILED 0x000f
205 #define CS_NOP_MSG_FAILED 0x0010
206 #define CS_PARITY_ERROR_MSG_FAILED 0x0011
207 #define CS_DEVICE_RESET_MSG_FAILED 0x0012
208 #define CS_ID_MSG_FAILED 0x0013
209 #define CS_UNEXP_BUS_FREE 0x0014
210 #define CS_DATA_UNDERRUN 0x0015
211 #define CS_BUS_RESET 0x001c
214 #define SF_GOT_BUS 0x0100
215 #define SF_GOT_TARGET 0x0200
216 #define SF_SENT_CDB 0x0400
217 #define SF_TRANSFERRED_DATA 0x0800
218 #define SF_GOT_STATUS 0x1000
219 #define SF_GOT_SENSE 0x2000
222 #define STF_DISCONNECT 0x0001
223 #define STF_SYNCHRONOUS 0x0002
224 #define STF_PARITY_ERROR 0x0004
225 #define STF_BUS_RESET 0x0008
226 #define STF_DEVICE_RESET 0x0010
227 #define STF_ABORTED 0x0020
228 #define STF_TIMEOUT 0x0040
229 #define STF_NEGOTIATION 0x0080
232 #define MBOX_NO_OP 0x0000
233 #define MBOX_LOAD_RAM 0x0001
234 #define MBOX_EXEC_FIRMWARE 0x0002
235 #define MBOX_DUMP_RAM 0x0003
236 #define MBOX_WRITE_RAM_WORD 0x0004
237 #define MBOX_READ_RAM_WORD 0x0005
238 #define MBOX_MAILBOX_REG_TEST 0x0006
239 #define MBOX_VERIFY_CHECKSUM 0x0007
240 #define MBOX_ABOUT_FIRMWARE 0x0008
241 #define MBOX_CHECK_FIRMWARE 0x000e
242 #define MBOX_INIT_REQ_QUEUE 0x0010
243 #define MBOX_INIT_RES_QUEUE 0x0011
244 #define MBOX_EXECUTE_IOCB 0x0012
245 #define MBOX_WAKE_UP 0x0013
246 #define MBOX_STOP_FIRMWARE 0x0014
247 #define MBOX_ABORT 0x0015
248 #define MBOX_ABORT_DEVICE 0x0016
249 #define MBOX_ABORT_TARGET 0x0017
250 #define MBOX_BUS_RESET 0x0018
251 #define MBOX_STOP_QUEUE 0x0019
252 #define MBOX_START_QUEUE 0x001a
253 #define MBOX_SINGLE_STEP_QUEUE 0x001b
254 #define MBOX_ABORT_QUEUE 0x001c
255 #define MBOX_GET_DEV_QUEUE_STATUS 0x001d
256 #define MBOX_GET_FIRMWARE_STATUS 0x001f
257 #define MBOX_GET_INIT_SCSI_ID 0x0020
258 #define MBOX_GET_SELECT_TIMEOUT 0x0021
259 #define MBOX_GET_RETRY_COUNT 0x0022
260 #define MBOX_GET_TAG_AGE_LIMIT 0x0023
261 #define MBOX_GET_CLOCK_RATE 0x0024
262 #define MBOX_GET_ACT_NEG_STATE 0x0025
263 #define MBOX_GET_ASYNC_DATA_SETUP_TIME 0x0026
264 #define MBOX_GET_SBUS_PARAMS 0x0027
265 #define MBOX_GET_TARGET_PARAMS 0x0028
266 #define MBOX_GET_DEV_QUEUE_PARAMS 0x0029
267 #define MBOX_SET_INIT_SCSI_ID 0x0030
268 #define MBOX_SET_SELECT_TIMEOUT 0x0031
269 #define MBOX_SET_RETRY_COUNT 0x0032
270 #define MBOX_SET_TAG_AGE_LIMIT 0x0033
271 #define MBOX_SET_CLOCK_RATE 0x0034
272 #define MBOX_SET_ACTIVE_NEG_STATE 0x0035
273 #define MBOX_SET_ASYNC_DATA_SETUP_TIME 0x0036
274 #define MBOX_SET_SBUS_CONTROL_PARAMS 0x0037
275 #define MBOX_SET_TARGET_PARAMS 0x0038
276 #define MBOX_SET_DEV_QUEUE_PARAMS 0x0039
321 #define RES_QUEUE_LEN 255
322 #define QUEUE_ENTRY_LEN 64
324 #define NEXT_REQ_PTR(wheee) (((wheee) + 1) & QLOGICPTI_REQ_QUEUE_LEN)
325 #define NEXT_RES_PTR(wheee) (((wheee) + 1) & RES_QUEUE_LEN)
326 #define PREV_REQ_PTR(wheee) (((wheee) - 1) & QLOGICPTI_REQ_QUEUE_LEN)
327 #define PREV_RES_PTR(wheee) (((wheee) - 1) & RES_QUEUE_LEN)
374 #define SREG_TPOWER 0x80
375 #define SREG_FUSE 0x40
376 #define SREG_PDISAB 0x20
377 #define SREG_DSENSE 0x10
378 #define SREG_IMASK 0x0c
379 #define SREG_SPMASK 0x03
389 #define SBUS_CFG1_EPAR 0x0100
390 #define SBUS_CFG1_FMASK 0x00f0
391 #define SBUS_CFG1_BENAB 0x0004
392 #define SBUS_CFG1_B64 0x0003
393 #define SBUS_CFG1_B32 0x0002
394 #define SBUS_CFG1_B16 0x0001
395 #define SBUS_CFG1_B8 0x0008
398 #define SBUS_CTRL_EDIRQ 0x0020
399 #define SBUS_CTRL_ECIRQ 0x0010
400 #define SBUS_CTRL_ESIRQ 0x0008
401 #define SBUS_CTRL_ERIRQ 0x0004
402 #define SBUS_CTRL_GENAB 0x0002
403 #define SBUS_CTRL_RESET 0x0001
406 #define SBUS_STAT_DINT 0x0020
407 #define SBUS_STAT_CINT 0x0010
408 #define SBUS_STAT_SINT 0x0008
409 #define SBUS_STAT_RINT 0x0004
410 #define SBUS_STAT_GINT 0x0002
413 #define SBUS_SEMAPHORE_STAT 0x0002
414 #define SBUS_SEMAPHORE_LCK 0x0001
417 #define DMA_CTRL_CSUSPEND 0x0010
418 #define DMA_CTRL_CCLEAR 0x0008
419 #define DMA_CTRL_FCLEAR 0x0004
420 #define DMA_CTRL_CIRQ 0x0002
421 #define DMA_CTRL_DMASTART 0x0001
424 #define CPU_ORIDE_ETRIG 0x8000
425 #define CPU_ORIDE_STEP 0x4000
426 #define CPU_ORIDE_BKPT 0x2000
427 #define CPU_ORIDE_PWRITE 0x1000
428 #define CPU_ORIDE_OFORCE 0x0800
429 #define CPU_ORIDE_LBACK 0x0400
430 #define CPU_ORIDE_PTEST 0x0200
431 #define CPU_ORIDE_TENAB 0x0100
432 #define CPU_ORIDE_TPINS 0x0080
433 #define CPU_ORIDE_FRESET 0x0008
434 #define CPU_ORIDE_CTERM 0x0004
435 #define CPU_ORIDE_RREG 0x0002
436 #define CPU_ORIDE_RMOD 0x0001
439 #define CPU_CMD_BRESET 0x300b
442 #define CPU_PCTRL_PVALID 0x8000
443 #define CPU_PCTRL_PHI 0x0400
444 #define CPU_PCTRL_PLO 0x0200
445 #define CPU_PCTRL_REQ 0x0100
446 #define CPU_PCTRL_ACK 0x0080
447 #define CPU_PCTRL_RST 0x0040
448 #define CPU_PCTRL_BSY 0x0020
449 #define CPU_PCTRL_SEL 0x0010
450 #define CPU_PCTRL_ATN 0x0008
451 #define CPU_PCTRL_MSG 0x0004
452 #define CPU_PCTRL_CD 0x0002
453 #define CPU_PCTRL_IO 0x0001
456 #define CPU_PDIFF_SENSE 0x0200
457 #define CPU_PDIFF_MODE 0x0100
458 #define CPU_PDIFF_OENAB 0x0080
459 #define CPU_PDIFF_PMASK 0x007c
460 #define CPU_PDIFF_TGT 0x0002
461 #define CPU_PDIFF_INIT 0x0001
464 #define RISC_PSR_FTRUE 0x8000
465 #define RISC_PSR_LCD 0x4000
466 #define RISC_PSR_RIRQ 0x2000
467 #define RISC_PSR_TOFLOW 0x1000
468 #define RISC_PSR_AOFLOW 0x0800
469 #define RISC_PSR_AMSB 0x0400
470 #define RISC_PSR_ACARRY 0x0200
471 #define RISC_PSR_AZERO 0x0100
472 #define RISC_PSR_ULTRA 0x0020
473 #define RISC_PSR_DIRQ 0x0010
474 #define RISC_PSR_SIRQ 0x0008
475 #define RISC_PSR_HIRQ 0x0004
476 #define RISC_PSR_IPEND 0x0002
477 #define RISC_PSR_FFALSE 0x0001
480 #define RISC_MTREG_P1DFLT 0x1200
481 #define RISC_MTREG_P0DFLT 0x0012
482 #define RISC_MTREG_P1ULTRA 0x2300
483 #define RISC_MTREG_P0ULTRA 0x0023
486 #define HCCTRL_NOP 0x0000
487 #define HCCTRL_RESET 0x1000
488 #define HCCTRL_PAUSE 0x2000
489 #define HCCTRL_REL 0x3000
490 #define HCCTRL_STEP 0x4000
491 #define HCCTRL_SHIRQ 0x5000
492 #define HCCTRL_CHIRQ 0x6000
493 #define HCCTRL_CRIRQ 0x7000
494 #define HCCTRL_BKPT 0x8000
495 #define HCCTRL_TMODE 0xf000
496 #define HCCTRL_HIRQ 0x0080
497 #define HCCTRL_RRIP 0x0040
498 #define HCCTRL_RPAUSED 0x0020
499 #define HCCTRL_EBENAB 0x0010
500 #define HCCTRL_B1ENAB 0x0008
501 #define HCCTRL_B0ENAB 0x0004
504 #define for_each_qlogicpti(qp) \
505 for((qp) = qptichain; (qp); (qp) = (qp)->next)