📄 scsireg.h
字号:
int sc_prevpha; /* Previous bus phase */ int sc_fstate; /* State for sz_fuzzy state machine *//* int sc_fevent; NOT USED /* Event for sz_fuzzy state machine */ int (*port_start)(); /* pointer to the port start routine */ int (*port_reset)(); /* pointer to the port reset routine */ int (*device_comp[NDPS])(); /* pointer to device completion func */ int (*rmbcopy)(); /* copy routine used to copy data to */ /* the rambuffer */ int (*wmbcopy)(); /* copy routine used to copy data */ /* from the rambuffer */ int (*wmbzero)(); /* routine used to zero out the rambuf*/ int sc_sel_retry[NDPS]; /* Select failure retry count */ int sc_rmv_media; /* Save removable media bit per target*/ /* Pointers for the Pseudo DMA functions. The control structure */ /* is one for each target. */ int (*dma_init)(); /* pointer to the init routine */ int (*dma_setup)(); /* pointer to the setup routine */ int (*dma_start)(); /* pointer to the start routine */ int (*dma_cont)(); /* pointer to the cont routine */ int (*dma_end)(); /* pointer to the end routine */ int (*dma_rbcopy)(); /* pointer for DATA-IN xfer routine */ int (*dma_wbcopy)(); /* pointer for DATA-OUT xfer routine */ int (*dma_bzero)(); /* pointer to the zero fill routine */ int (*dma_flush)(); /* pointer to the pipe flush routine */ int dma_pflags; /* general flags for these routines */ PDMA pdma_ctrl[NDPS]; /* control structure for the PDMA */ long sc_dmaxfer[NDPS]; /* running count of DMA data xfer */ long sc_sdpxfer[NDPS]; /* save data pointers for data xfer */#ifdef __vax char *sc_rambuff; /* Holds pointer to the RAM buffer */ int sc_dummy[5]; /* Align sz_softc for ADB */ int sc_i_spin1[NDPS]; /* TODO: debug */ int sc_i_spcmd[NDPS]; int sc_i_phase[NDPS]; int sc_ss_spin1[NDPS]; /* TODO: debug */ int sc_ss_spcmd[NDPS]; int sc_ss_phase[NDPS];#endif /* __vax */#ifdef __mips volatile char *pdma_rambuff; /* Holds pointer to the RAM buffer */ volatile char *pdma_addrreg; /* Holds pointer to th DMAengine */ volatile char *sc_rambuff; /* Holds pointer to the RAM buffer */ volatile char *sc_slotvaddr; /* Holds pointer to the slot address */ struct scsi_devtab *sc_devtab[NDPS]; /* Pointer to scsi_devtab */ volatile char *ioasicp; /* Indicates ioasic exists for driver */ /* and points to it */#endif /* __mips */#ifdef __vax u_char sc_extmessg[NDPS][5]; /* For extended messages */#endif /* __vax */#ifdef __mips u_char sc_extmessg[NDPS][6]; /* For extended messages */#endif /* __mips */ u_char *sc_messgptr[NDPS]; /* Used for extended messages */ char sc_messg_len[NDPS]; /* Len of messg byte received */ u_char sc_messg_xfer[NDPS]; /* Len of current ext. messg DMA */ u_char sc_oddbyte[NDPS]; /* Used for SII to hold the ODD BYTE */ u_char sc_asc_sr; /* ASC status register */ u_char sc_asc_isr; /* ASC interrupt status register */ u_char sc_asc_ssr; /* ASC sequence step register */ u_char sc_asccmd; /* Last command written to ASC */ int sc_siisentsync[NDPS]; /* Tells if Sync DataXfer Messg sent */ int sc_siidmacount[NDPS]; /* Used for SII for I/O transfers >8K */ int sc_szflags[NDPS]; /* Flags for requesting other action */ int sc_selstat[NDPS]; /* Cntlr state: SEL RESEL DISCON IDLE */ int sc_dcstart[NDPS]; /* TODO1: debug */ int sc_dcend[NDPS]; /* TODO1: debug */ int sc_dcdiff[NDPS]; /* TODO1: debug */ int sc_dcavg[NDPS]; /* TODO1: debug */ struct buf *sc_bp[NDPS]; /* Saved buffer pointer */ int sc_b_bcount[NDPS]; /* part of bp->b_bcount for this xfer */ int sc_bpcount[NDPS]; /* Xfer size, not always bp->b_bcount */ int sc_segcnt[NDPS]; /* Max byte count for xfer (segment) */ int sc_xfercnt[NDPS]; /* Number of bytes transfered so far */ int sc_resid[NDPS]; /* Copy of last bc */ int sc_savcnt[NDPS]; /* Bytes remaining in transfer when a */ daddr_t sc_blkno[NDPS]; /* Starting block number of xfer */ int sc_openf[NDPS]; /* Lock against multiple opens */ daddr_t sc_disksize[NDPS]; /* DISK: number of LBNs on disk */ struct size *sc_dstp[NDPS]; /* Pointer to default psrtition sizes */ long sc_flags[NDPS]; /* Flags */ long sc_category_flags[NDPS];/* Category flags */ /* TODO: err cnts not fully implement */ u_long sc_softcnt[NDPS]; /* Soft error count total */ u_long sc_hardcnt[NDPS]; /* Hard error count total */ int sc_devtyp[NDPS]; /* Device class/type ID */ int sc_dkn[NDPS]; /* Saved DK number for iostat */ int sc_alive[NDPS]; /* Is a device at this SCSI target ID */ int sc_attached[NDPS]; /* Device attached at this scsi id? */ int sc_unit[NDPS]; /* Logical unit number for this ID */ char sc_device[NDPS][DEV_SIZE]; /* Device type string,ADB 64 bytes */ int sc_curcmd[NDPS]; /* Current cmd, eg: TUR, MODSEL, R/W */ int sc_actcmd[NDPS]; /* Actual cmd, eg: RQSNS after R/W */ int sc_xstate[NDPS]; /* State for sz_start state machine */ int sc_xevent[NDPS]; /* Event for sz_start state machine */ int sc_pxstate[NDPS]; /* Save state in case target busy */ /* disconnect occurs */ int sc_c_status[NDPS]; /* Status of last ??command() */ int sc_c_snskey[NDPS]; /* Sense Key for last ??command() */ int sc_c_asc[NDPS]; /* Additional Sense code (disks only) */ char *sc_SZ_bufmap[NDPS]; /* Virtual address for buffer mapping */ struct pte *sc_szbufmap[NDPS]; /* PTEs from get_sys_ptes() call */ char *sc_bufp[NDPS]; /* Pointer to user buffer */ long sc_dboff[NDPS][2]; /* Target's offset in 128K h/w buffer */ u_char sc_cmdlog[NDPS][12]; /* Copy of current command (cdb) */ union { /* ADB: size is 22 bytes */ struct sz_cmdfmt sz_cmd; /* Complete command packet */ struct { u_char cmd[6]; /* Command portion of comand packet */ u_char dat[16]; /* Data portion of command packet */ } altcmd; } sc_cmdpkt[NDPS]; /* Command packet */ struct sz_datfmt sz_dat[NDPS]; /* Return status data, ADB size 44b */ u_char sc_status[NDPS]; /* Status for current command */ u_char sc_statlog[NDPS]; /* Copy of status byte for error log */ u_char sc_message[NDPS]; /* Current message */ /* TODO1: why in diff place from data for other commands? */ struct sz_exsns_dt sc_sns[NDPS]; /* extended sense data,ADB size 44b */ char sc_devnam[NDPS][SZ_DNSIZE]; /* ASCII device name (8*24b) */ char sc_revlvl[NDPS][SZ_REV_LEN]; /* ASCII dev rev level (8*4b) */ u_char sc_siioddbyte[NDPS]; /* Used for SII to hold the ODD BYTE */ int sc_ascsyncper[NDPS]; /* Synchronous Period value */ int sc_siireqack[NDPS]; /* The req/ack offset for each target */ long sc_siidboff[NDPS]; /* Special RAM buffer offsets for SII */ long sc_actbp[NDPS]; long sc_dboff_busy[NDPS][2]; long sc_iodir[NDPS]; long sc_dboff_len[NDPS][2]; int sc_rzspecial[NDPS]; /* Used for the "rzdisk" utility */ char *sc_rzparams[NDPS]; /* Used for the "rzdisk" utility */ char *sc_rzaddr[NDPS]; /* Used for the "rzdisk" utility */ struct sz_exsns_dt sc_rzsns[NDPS];/* Used for the "rzdisk" utility */ u_short sc_mc_cnt[NDPS]; /* Floppy media changed counter */ /* TODO: sc_progress set but not used */ struct timeval sc_progress; /* last time progress occurred */ long targ_lun[NDPS]; /* target lun global (for ECRM) */ /* Parameters for the BBR code */ int sc_bbr_active[NDPS]; /* Active flag for BBR state machine */ int sc_bbr_state[NDPS]; /* State for bbr state machine */ int sc_bbr_oper[NDPS]; /* Current operation for bbr */ int sc_bbr_read[NDPS]; /* Read counts */ int sc_bbr_rawr[NDPS]; /* Reassign/write counts */ int sc_bbr_write[NDPS]; /* Write counts */ char *sc_bbraddr[NDPS]; /* Used for BBR data location */ char *sc_bbrparams[NDPS]; /* Used for BBR REASSIGN parameters */ caddr_t sc_scsiaddr; /* Address to SCSI chip */ short scsi_bus_idle; /* SCSI bus is idle flag */ short scsi_completed[NDPS]; /* Command complete flag */ short scsi_polled_mode; /* SCSI polled mode flag */ short no_disconnects; /* Allow no disconnects */ short use_programmed_io; /* Programmed IO Mode flag */ short sii_was_reset; /* SII was reset flag */ struct sz_rqsns_save rqs[NDPS]; /* For async. RQSNS processing */ int asc_sync_offset; /* sync offset for controller */};/* * sz_softc names shortened */#define sc_cmd sc_cmdpkt[targid].altcmd.cmd /* Cmd part of cmd pkt*/#define sc_dat sc_cmdpkt[targid].altcmd.dat /* Dat part of cmd pkt*/#define sz_command sc_cmdpkt[targid].sz_cmd /* Command Packet */#define sz_opcode sc_cmdpkt[targid].sz_cmd.opcode /* Command Opcode */#define sz_tur sc_cmdpkt[targid].sz_cmd.cmd.tur /* TEST UNIT READY */#define sz_rwd sc_cmdpkt[targid].sz_cmd.cmd.rwd /* REWIND Command */#define sz_rqsns sc_cmdpkt[targid].sz_cmd.cmd.sense /* REQUEST SENSE */#define sz_rbl sc_cmdpkt[targid].sz_cmd.cmd.rbl /* REQUEST BLOCK LMTS */ /* DISK: */#define sz_rdcap sc_cmdpkt[targid].sz_cmd.cmd.rdcap /* READ CAPACITY */#define sz_rwl sc_cmdpkt[targid].sz_cmd.cmd.rwl /* Read/Write long */ /* TAPE: */#define sz_t_read sc_cmdpkt[targid].sz_cmd.cmd.t_rw /* READ Command */#define sz_t_write sc_cmdpkt[targid].sz_cmd.cmd.t_rw /* WRITE Command */ /* DISK: */#define sz_d_read sc_cmdpkt[targid].sz_cmd.cmd.d_rw /* READ Command */#define sz_d_write sc_cmdpkt[targid].sz_cmd.cmd.d_rw /* WRITE Command */#define sz_d_rw10 sc_cmdpkt[targid].sz_cmd.cmd.d_rw10 /* R/W 10-byte CDB */#define sz_d_seek sc_cmdpkt[targid].sz_cmd.cmd.d_rw10 /* SEEK 10-byte CDB */#define sz_d_fu sc_cmdpkt[targid].sz_cmd.cmd.d_fu /* FORMAT UNIT */#define sz_d_rb sc_cmdpkt[targid].sz_cmd.cmd.d_rb /* REASSIGN BLOCK */#define sz_d_rdd sc_cmdpkt[targid].sz_cmd.cmd.d_rdd /* READ DEFECT DATA */#define sz_d_vd sc_cmdpkt[targid].sz_cmd.cmd.d_vd /* VERIFY DATA */#define sz_trksel sc_cmdpkt[targid].sz_cmd.cmd.trksel /* TRACK SELECT */#define sz_resunit sc_cmdpkt[targid].sz_cmd.cmd.runit /* RESERVE UNIT */#define sz_wfm sc_cmdpkt[targid].sz_cmd.cmd.wfm /* WRITE FILEMARKS */#define sz_space sc_cmdpkt[targid].sz_cmd.cmd.space /* SPACE Command */#define sz_inq sc_cmdpkt[targid].sz_cmd.cmd.inq /* INQUIRY Command */#define sz_vfy sc_cmdpkt[targid].sz_cmd.cmd.vfy /* VERIFY Command */#define sz_rbd sc_cmdpkt[targid].sz_cmd.cmd.rw /* RCVR BUFFERED DATA */#define sz_modsel sc_cmdpkt[targid].sz_cmd.cmd.modsel /* MODE SELECT */#define sz_relunit sc_cmdpkt[targid].sz_cmd.cmd.runit /* RELEASE UNIT */#define sz_erase sc_cmdpkt[targid].sz_cmd.cmd.erase /* ERASE Command */#define sz_modsns sc_cmdpkt[targid].sz_cmd.cmd.sense /* MODE SENSE Command */#define sz_load sc_cmdpkt[targid].sz_cmd.cmd.ld /* LOAD Command */#define sz_unload sc_cmdpkt[targid].sz_cmd.cmd.ld /* UNLOAD Command */#define sz_recdiag sc_cmdpkt[targid].sz_cmd.cmd.recdiag /* REC DIAG RESULT */#define sz_snddiag sc_cmdpkt[targid].sz_cmd.cmd.diag /* SEND DIAGNOSTIC */#define sz_copy sc_cmdpkt[targid].sz_cmd.cmd.copy /* SEND COPY */#define sz_mr sc_cmdpkt[targid].sz_cmd.cmd.mr /* MEDIUM REMOVAL */#define sz_ssu sc_cmdpkt[targid].sz_cmd.cmd.ssu /* START/STOP UNIT */#define sz_cd_pa sc_cmdpkt[targid].sz_cmd.cmd.d_rw10 /* PLAY AUDIO */#define sz_cd_msf sc_cmdpkt[targid].sz_cmd.cmd.msf /* PLAY AUDIO MSF */#define sz_cd_ti sc_cmdpkt[targid].sz_cmd.cmd.ti /* PLAY AUDIO TI */#define sz_cd_tr sc_cmdpkt[targid].sz_cmd.cmd.tr /* PLAY TRACK RELATIVE */#define sz_cd_pb sc_cmdpkt[targid].sz_cmd.cmd.pb /* PLAYBACK CONTROL/STATUS */#define sz_cd_pr sc_cmdpkt[targid].sz_cmd.cmd.pr /* PAUSE/RESUME Command */#define sz_cd_pt sc_cmdpkt[targid].sz_cmd.cmd.pt /* PLAY TRACK Command */#define sz_cd_rh sc_cmdpkt[targid].sz_cmd.cmd.rh /* READ HEADER Command */#define sz_cd_toc sc_cmdpkt[targid].sz_cmd.cmd.toc /* READ TOC Command */#define sz_cd_sch sc_cmdpkt[targid].sz_cmd.cmd.sch /* READ SUB-CHANNEL Cmd */#define sz_cd_saf sc_cmdpkt[targid].sz_cmd.cmd.saf /* SET ADDRESS FORMAT Cmd *//* * Values for sc_selstat */#define SZ_IDLE 0 /* The device is not selected (BUS Free) */#define SZ_SELECT 1 /* The device is selected */#define SZ_DISCONN 2 /* The device has disconnected */#define SZ_RESELECT 3 /* The device is in the reselection process */#define SZ_BBWAIT 4 /* Bus Busy Wait (wait for bus free) *//* * State Machine Events */#define SZ_CONT 0 /* Continue wherever processing left off */#define SZ_BEGIN 1 /* BEGIN processing requests from the queue */#define SZ_DMA_DONE 2 /* DMA count to zero interrupt */#define SZ_PAR_ERR 3 /* Parity Error interrupt */#define SZ_PHA_MIS 4 /* Phase Mismatch interrupt */#define SZ_RESET 5 /* RST interrupt */#define SZ_CMD 6 /* In Command Mode (Status/Positioning Cmd) */#define SZ_DMA 7 /* Data transfer using DMA */#define SZ_ABORT 8 /* Abort the fuzzy transfer */#define SZ_ERROR 9 /* An error event occured */#define SZ_TIMEOUT 10 /* Timer expired */#define SZ_FREEB 11 /* Bus needs to be freed */#define SZ_SELRETRY_CMD 12 /* Select failed for CMD due to reselection */#define SZ_SELRETRY_SNS 13 /* Select failed for RQSNS due to reselection *//* * Number of retries for data transfer (RW) * and non data transfer (SP) commands. * Note: values are equal for now, but that could change. */#define SZ_SP_RTCNT 1#define SZ_RW_RTCNT 1/** Number of seconds to wait before retrying the command* when a target return busy status. Currently we wait* one half second.* NOTE: used by SII code, not by NCR 5380 code.*/#define SZ_BUSY_WAIT hz/2/* * Return Status from various routines * TODO: make sure all are actually used. */#define SZ_SUCCESS 0 /* Success */#define SZ_IP 1 /* In Progress */#define SZ_RET_ERR 2 /* Error condition occured */#define SZ_RET_ABORT 3 /* Command aborted in scsistart() */#define SZ_DISCONNECT 4 /* Phase Error */#define SZ_RETRY 5 /* The command failed, retries may succeed */#define SZ_FATAL 6 /* The command failed, retries will fail */#define SZ_BUSBUSY 7 /* SCSI bus arbitration failed (put off cmd) */#define SZ_SELBUSY 8 /* Wait for 250 MS select timeout */#define SZ_RET_RESET 9 /* Bus being reset (bail out, restart later) */#define SZ_TARGBUSY 10 /* Target is busy, resend command later */#define b_retry b_bufsize /* Local command buffer [see tzcommand()] */#define b_comand b_gid /* Local command buffer [see tzcommand()] *//* * General defines for Common values used with the option tables. * Ie generic densities etc.*/#define NO_OPTTABLE 0X0 /* make sure its null if no option table */ /* Block sizes defined - some of the common ones */#define SCSI_QIC_FIXED 512 /* for densities 24, 120, 150 */#define SCSI_QIC_320_FIXED 1024 /* for fixed 320 density */#define SCSI_VARIABLE 0 /* varible block size */ /* QIC SCSI density codes */#define SCSI_QIC_UNKNOWN 0x0 /* QIC density is unknown. */#define SCSI_QIC_24_DENS 0x5 /* QIC 24 density code */#define SCSI_QIC_120_DENS_ECC 0xd /* QIC 120 density with ECC. */#define SCSI_QIC_150_DENS_ECC 0xe /* QIC 150 density with ECC. */#define SCSI_QIC_120_DENS 0xf /* QIC 120 density code */#define SCSI_QIC_150_DENS 0x10 /* QIC 150 density code */#define SCSI_QIC_320_DENS 0x11 /* QIC 320 density code */ /* SCSI 9 track density codes */#define SCSI_DENS_DEFAULT 0 /* they all default with this density */#define SCSI_800 0x1 /* 800 bpi */#define SCSI_1600 0x2 /* 1600 bpi */#define SCSI_6250 0x3 /* 6250 bpi */#define SCSI_SPEED_MASK 0xf /* Mask off the char to 4 bits. */#define SCSI_DENS_MASK 0xff /* Mask off the int to a char *//* Instructions for setting up a tape_opt_tab structure. * * The tape option table structure allows for easy addition of a * a SCSI bus tape drive. The table directs the SCSI driver to * format scsi command packets with certain lengths, density codes * number of file marks on close etc. The tape option table is * and array of structures each having the type of struct tape_opt_tab. * The struct devtab entry for the device has a pointer declared called * opt_tab. This pointer can either be null for no option table or can * contain the address of the tape option table entry for this device. * There are some pre-defined tape option table entries for units already * known. If there is not an entry that describes your tape device you * can add an entry to the end of the table. * * Each tape option table structure has 2 parts. The first part is the * device specific part which describes what type of tape unit the * device is, and some out/in going data sizes. The second part of * the struct is an array of structures that descibes the actions * for each of the possible densities. There can be only 4 densities * descibed by the major/minor pair for the device. Below is an
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -