📄 qlogicpti.h
字号:
#define MBOX_GET_INIT_SCSI_ID 0x0020#define MBOX_GET_SELECT_TIMEOUT 0x0021#define MBOX_GET_RETRY_COUNT 0x0022#define MBOX_GET_TAG_AGE_LIMIT 0x0023#define MBOX_GET_CLOCK_RATE 0x0024#define MBOX_GET_ACT_NEG_STATE 0x0025#define MBOX_GET_ASYNC_DATA_SETUP_TIME 0x0026#define MBOX_GET_SBUS_PARAMS 0x0027#define MBOX_GET_TARGET_PARAMS 0x0028#define MBOX_GET_DEV_QUEUE_PARAMS 0x0029#define MBOX_SET_INIT_SCSI_ID 0x0030#define MBOX_SET_SELECT_TIMEOUT 0x0031#define MBOX_SET_RETRY_COUNT 0x0032#define MBOX_SET_TAG_AGE_LIMIT 0x0033#define MBOX_SET_CLOCK_RATE 0x0034#define MBOX_SET_ACTIVE_NEG_STATE 0x0035#define MBOX_SET_ASYNC_DATA_SETUP_TIME 0x0036#define MBOX_SET_SBUS_CONTROL_PARAMS 0x0037#define MBOX_SET_TARGET_PARAMS 0x0038#define MBOX_SET_DEV_QUEUE_PARAMS 0x0039struct host_param { u_short initiator_scsi_id; u_short bus_reset_delay; u_short retry_count; u_short retry_delay; u_short async_data_setup_time; u_short req_ack_active_negation; u_short data_line_active_negation; u_short data_dma_burst_enable; u_short command_dma_burst_enable; u_short tag_aging; u_short selection_timeout; u_short max_queue_depth;};/* * Device Flags: * * Bit Name * --------- * 7 Disconnect Privilege * 6 Parity Checking * 5 Wide Data Transfers * 4 Synchronous Data Transfers * 3 Tagged Queuing * 2 Automatic Request Sense * 1 Stop Queue on Check Condition * 0 Renegotiate on Error */struct dev_param { u_short device_flags; u_short execution_throttle; u_short synchronous_period; u_short synchronous_offset; u_short device_enable; u_short reserved; /* pad */};/* * The result queue can be quite a bit smaller since continuation entries * do not show up there: */#define RES_QUEUE_LEN 255 /* Must be power of two - 1 */#define QUEUE_ENTRY_LEN 64#define NEXT_REQ_PTR(wheee) (((wheee) + 1) & QLOGICPTI_REQ_QUEUE_LEN)#define NEXT_RES_PTR(wheee) (((wheee) + 1) & RES_QUEUE_LEN)#define PREV_REQ_PTR(wheee) (((wheee) - 1) & QLOGICPTI_REQ_QUEUE_LEN)#define PREV_RES_PTR(wheee) (((wheee) - 1) & RES_QUEUE_LEN)struct pti_queue_entry { char __opaque[QUEUE_ENTRY_LEN];};/* Software state for the driver. */struct qlogicpti { /* These are the hot elements in the cache, so they come first. */ spinlock_t lock; /* Driver mutex */ unsigned long qregs; /* Adapter registers */ struct pti_queue_entry *res_cpu; /* Ptr to RESPONSE bufs (CPU) */ struct pti_queue_entry *req_cpu; /* Ptr to REQUEST bufs (CPU) */ u_int req_in_ptr; /* index of next request slot */ u_int res_out_ptr; /* index of next result slot */ long send_marker; /* must we send a marker? */ struct sbus_dev *sdev; unsigned long __pad; int cmd_count[MAX_TARGETS]; unsigned long tag_ages[MAX_TARGETS]; /* The cmd->handler is only 32-bits, so that things work even on monster * Ex000 sparc64 machines with >4GB of ram we just keep track of the * scsi command pointers here. This is essentially what Matt Jacob does. -DaveM */ Scsi_Cmnd *cmd_slots[QLOGICPTI_REQ_QUEUE_LEN + 1]; /* The rest of the elements are unimportant for performance. */ struct qlogicpti *next; __u32 res_dvma; /* Ptr to RESPONSE bufs (DVMA)*/ __u32 req_dvma; /* Ptr to REQUEST bufs (DVMA) */ u_char fware_majrev, fware_minrev, fware_micrev; struct Scsi_Host *qhost; int qpti_id; int scsi_id; int prom_node; char prom_name[64]; int irq; char differential, ultra, clock; unsigned char bursts; struct host_param host_param; struct dev_param dev_param[MAX_TARGETS]; unsigned long sreg;#define SREG_TPOWER 0x80 /* State of termpwr */#define SREG_FUSE 0x40 /* State of on board fuse */#define SREG_PDISAB 0x20 /* Disable state for power on */#define SREG_DSENSE 0x10 /* Sense for differential */#define SREG_IMASK 0x0c /* Interrupt level */#define SREG_SPMASK 0x03 /* Mask for switch pack */ unsigned char swsreg; unsigned int gotirq : 1, /* this instance got an irq */ is_pti : 1, /* Non-zero if this is a PTI board. */ sbits : 16; /* syncmode known bits */};/* How to twiddle them bits... *//* SBUS config register one. */#define SBUS_CFG1_EPAR 0x0100 /* Enable parity checking */#define SBUS_CFG1_FMASK 0x00f0 /* Forth code cycle mask */#define SBUS_CFG1_BENAB 0x0004 /* Burst dvma enable */#define SBUS_CFG1_B64 0x0003 /* Enable 64byte bursts */#define SBUS_CFG1_B32 0x0002 /* Enable 32byte bursts */#define SBUS_CFG1_B16 0x0001 /* Enable 16byte bursts */#define SBUS_CFG1_B8 0x0008 /* Enable 8byte bursts *//* SBUS control register */#define SBUS_CTRL_EDIRQ 0x0020 /* Enable Data DVMA Interrupts */#define SBUS_CTRL_ECIRQ 0x0010 /* Enable Command DVMA Interrupts */#define SBUS_CTRL_ESIRQ 0x0008 /* Enable SCSI Processor Interrupts */#define SBUS_CTRL_ERIRQ 0x0004 /* Enable RISC Processor Interrupts */#define SBUS_CTRL_GENAB 0x0002 /* Global Interrupt Enable */#define SBUS_CTRL_RESET 0x0001 /* Soft Reset *//* SBUS status register */#define SBUS_STAT_DINT 0x0020 /* Data DVMA IRQ pending */#define SBUS_STAT_CINT 0x0010 /* Command DVMA IRQ pending */#define SBUS_STAT_SINT 0x0008 /* SCSI Processor IRQ pending */#define SBUS_STAT_RINT 0x0004 /* RISC Processor IRQ pending */#define SBUS_STAT_GINT 0x0002 /* Global IRQ pending *//* SBUS semaphore register */#define SBUS_SEMAPHORE_STAT 0x0002 /* Semaphore status bit */#define SBUS_SEMAPHORE_LCK 0x0001 /* Semaphore lock bit *//* DVMA control register */#define DMA_CTRL_CSUSPEND 0x0010 /* DMA channel suspend */#define DMA_CTRL_CCLEAR 0x0008 /* DMA channel clear and reset */#define DMA_CTRL_FCLEAR 0x0004 /* DMA fifo clear */#define DMA_CTRL_CIRQ 0x0002 /* DMA irq clear */#define DMA_CTRL_DMASTART 0x0001 /* DMA transfer start *//* SCSI processor override register */#define CPU_ORIDE_ETRIG 0x8000 /* External trigger enable */#define CPU_ORIDE_STEP 0x4000 /* Single step mode enable */#define CPU_ORIDE_BKPT 0x2000 /* Breakpoint reg enable */#define CPU_ORIDE_PWRITE 0x1000 /* SCSI pin write enable */#define CPU_ORIDE_OFORCE 0x0800 /* Force outputs on */#define CPU_ORIDE_LBACK 0x0400 /* SCSI loopback enable */#define CPU_ORIDE_PTEST 0x0200 /* Parity test enable */#define CPU_ORIDE_TENAB 0x0100 /* SCSI pins tristate enable */#define CPU_ORIDE_TPINS 0x0080 /* SCSI pins enable */#define CPU_ORIDE_FRESET 0x0008 /* FIFO reset */#define CPU_ORIDE_CTERM 0x0004 /* Command terminate */#define CPU_ORIDE_RREG 0x0002 /* Reset SCSI processor regs */#define CPU_ORIDE_RMOD 0x0001 /* Reset SCSI processor module *//* SCSI processor commands */#define CPU_CMD_BRESET 0x300b /* Reset SCSI bus *//* SCSI processor pin control register */#define CPU_PCTRL_PVALID 0x8000 /* Phase bits are valid */#define CPU_PCTRL_PHI 0x0400 /* Parity bit high */#define CPU_PCTRL_PLO 0x0200 /* Parity bit low */#define CPU_PCTRL_REQ 0x0100 /* REQ bus signal */#define CPU_PCTRL_ACK 0x0080 /* ACK bus signal */#define CPU_PCTRL_RST 0x0040 /* RST bus signal */#define CPU_PCTRL_BSY 0x0020 /* BSY bus signal */#define CPU_PCTRL_SEL 0x0010 /* SEL bus signal */#define CPU_PCTRL_ATN 0x0008 /* ATN bus signal */#define CPU_PCTRL_MSG 0x0004 /* MSG bus signal */#define CPU_PCTRL_CD 0x0002 /* CD bus signal */#define CPU_PCTRL_IO 0x0001 /* IO bus signal *//* SCSI processor differential pins register */#define CPU_PDIFF_SENSE 0x0200 /* Differential sense */#define CPU_PDIFF_MODE 0x0100 /* Differential mode */#define CPU_PDIFF_OENAB 0x0080 /* Outputs enable */#define CPU_PDIFF_PMASK 0x007c /* Differential control pins */#define CPU_PDIFF_TGT 0x0002 /* Target mode enable */#define CPU_PDIFF_INIT 0x0001 /* Initiator mode enable *//* RISC processor status register */#define RISC_PSR_FTRUE 0x8000 /* Force true */#define RISC_PSR_LCD 0x4000 /* Loop counter shows done status */#define RISC_PSR_RIRQ 0x2000 /* RISC irq status */#define RISC_PSR_TOFLOW 0x1000 /* Timer overflow (rollover) */#define RISC_PSR_AOFLOW 0x0800 /* Arithmetic overflow */#define RISC_PSR_AMSB 0x0400 /* Arithmetic big endian */#define RISC_PSR_ACARRY 0x0200 /* Arithmetic carry */#define RISC_PSR_AZERO 0x0100 /* Arithmetic zero */#define RISC_PSR_ULTRA 0x0020 /* Ultra mode */#define RISC_PSR_DIRQ 0x0010 /* DVMA interrupt */#define RISC_PSR_SIRQ 0x0008 /* SCSI processor interrupt */#define RISC_PSR_HIRQ 0x0004 /* Host interrupt */#define RISC_PSR_IPEND 0x0002 /* Interrupt pending */#define RISC_PSR_FFALSE 0x0001 /* Force false *//* RISC processor memory timing register */#define RISC_MTREG_P1DFLT 0x1200 /* Default read/write timing, pg1 */#define RISC_MTREG_P0DFLT 0x0012 /* Default read/write timing, pg0 */#define RISC_MTREG_P1ULTRA 0x2300 /* Ultra-mode rw timing, pg1 */#define RISC_MTREG_P0ULTRA 0x0023 /* Ultra-mode rw timing, pg0 *//* Host command/ctrl register */#define HCCTRL_NOP 0x0000 /* CMD: No operation */#define HCCTRL_RESET 0x1000 /* CMD: Reset RISC cpu */#define HCCTRL_PAUSE 0x2000 /* CMD: Pause RISC cpu */#define HCCTRL_REL 0x3000 /* CMD: Release paused RISC cpu */#define HCCTRL_STEP 0x4000 /* CMD: Single step RISC cpu */#define HCCTRL_SHIRQ 0x5000 /* CMD: Set host irq */#define HCCTRL_CHIRQ 0x6000 /* CMD: Clear host irq */#define HCCTRL_CRIRQ 0x7000 /* CMD: Clear RISC cpu irq */#define HCCTRL_BKPT 0x8000 /* CMD: Breakpoint enables change */#define HCCTRL_TMODE 0xf000 /* CMD: Enable test mode */#define HCCTRL_HIRQ 0x0080 /* Host IRQ pending */#define HCCTRL_RRIP 0x0040 /* RISC cpu reset in happening now */#define HCCTRL_RPAUSED 0x0020 /* RISC cpu is paused now */#define HCCTRL_EBENAB 0x0010 /* External breakpoint enable */#define HCCTRL_B1ENAB 0x0008 /* Breakpoint 1 enable */#define HCCTRL_B0ENAB 0x0004 /* Breakpoint 0 enable */#define QLOGICPTI { \ detect: qlogicpti_detect, \ release: qlogicpti_release, \ info: qlogicpti_info, \ queuecommand: qlogicpti_queuecommand_slow, \ abort: qlogicpti_abort, \ reset: qlogicpti_reset, \ can_queue: QLOGICPTI_REQ_QUEUE_LEN, \ this_id: 7, \ sg_tablesize: QLOGICPTI_MAX_SG(QLOGICPTI_REQ_QUEUE_LEN), \ cmd_per_lun: 1, \ use_clustering: ENABLE_CLUSTERING, \ use_new_eh_code: 0 \}/* For our interrupt engine. */#define for_each_qlogicpti(qp) \ for((qp) = qptichain; (qp); (qp) = (qp)->next)#endif /* !(_QLOGICPTI_H) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -