📄 sym895.h
字号:
* This has to be defined to include support for SCATTER-GATHER memory * operations. *//* #define SCATTER_GATHER *//* Maximum number of scattered data elements. */#define MAX_NO_OF_SCAT_ELEMENTS 255/* * Structure to hold the scattered data, to be gathered by the SIOP while * in scripts. Gathered Data is transferred using chained block moves, one * after the other (block wise) with out the intervention of the host. */typedef struct scatGather { ULONG noElems; /* No of places to gather the scattered the data */ MOVE_PARAMS Elements[MAX_NO_OF_SCAT_ELEMENTS]; } SCAT_DATA;/* * Shared structure defining all information about a SCSI connection * visible to the script. * For more details, please refer to PCI-SCSI programmers guide (8) * Every element in this structure _must_ be aligned on * a 4-byte boundary, otherwise the script will fail (illegal instruction). */typedef struct sym895Shared { ULONG device; /* target bus ID, sync xfer params */ MOVE_PARAMS command; /* command bytes sent to target */ MOVE_PARAMS dataIn; /* data bytes from target */ MOVE_PARAMS dataOut; /* data bytes to target */ MOVE_PARAMS status; /* command status byte from target */ MOVE_PARAMS identOut; /* outgoing identification msg */ MOVE_PARAMS identIn; /* incoming identification msg */ MOVE_PARAMS msgOut; /* message bytes sent to target */ MOVE_PARAMS msgIn; /* message bytes recvd from target */ MOVE_PARAMS msgInSecond; /* second byte of multi-byte msg */ MOVE_PARAMS msgInRest; /* remainder of multi-byte message */#ifdef SCATTER_GATHER SCAT_DATA scatData; /* scatter - gather memory moves */#endif } SYM895_SHARED;/* The Typedefs and the structure definitions *//* * Shared structure exclusively used by the diagnostic scripts for * loopback mode. Every element of this structure must be 4-byte aligned. */typedef struct sym895Loopback{ ULONG device ; /* target bus ID, sync xfer params */ MOVE_PARAMS identOut ; /* Identify buffer for loopback mode */ MOVE_PARAMS dataOut ; /* data buffer for loopback mode */} SYM895_LOOPBACK;/* Sym895 Thread strcuture. */typedef struct sym895Thread { SCSI_THREAD scsiThread ; /* generic SCSI Thread */ struct sym895Shared * pShMem ; /* Pointer to SIOP shared */ /* data area */ struct sym895Shared * pShMemDuplicate ; /* Pointer to SIOP */ /* shared data area */ /* * Every thread has its own context, which is the image of some of the * SIOP registers. Whenever the execution comes out of thread, the * current values of those registers are saved in these variables, and * retreived, when the execution is back to the thread. */ UINT8 nHostFlags; /* Scratch A register byte 0 */ UINT8 msgOutStatus; /* Scratch A register byte 1 */ UINT8 msgInStatus; /* Scratch A register byte 2 */ UINT8 targetId; /* Scratch A register byte 3 */ UINT8 busPhase; /* Scratch B register byte 0 */ UINT8 sxfer; /* SXFER register */ UINT8 scntl3; /* SCNTL3 registers */ /* scatter gather memory support */ UINT8 isScatTransfer; /* Scratch C register byte 0 */ UINT8 totalScatElements; /* Scratch C register byte 1 */ UINT8 noRemaining; /* Scratch C register byte 2 */ }SYM895_THREAD;/* Sym895 Event Structure. */typedef struct sym895Event { SCSI_EVENT scsiEvent ; /* generic SCSI Event */ UINT remCount ; /* Remaining Byte Count */ /* (Phase Mismatch) */ }SYM895_EVENT;/* * Script Entry Point Identifiers. These are the 4 Scripts that VxWorks * requires. If some more are to be added, they have to be added here and in * sym895StartScript() to ensure that the script starts when required. */typedef enum sym895ScriptEntries { SYM895_SCRIPT_WAIT = 0, /* Wait for ReSelect or Host Command */ SYM895_SCRIPT_INIT_START, /* Start an Initiator Thread */ SYM895_SCRIPT_INIT_CONTINUE, /* Continue an Initiator Thread */ SYM895_SCRIPT_TGT_DISCONNECT, /* Disconnect a Target Thread */ SYM895_SCRIPT_DIAG }SYM895_SCRIPT_ENTRY;/* SIOP operating States */typedef enum sym895State { SYM895_STATE_IDLE = 0, /* Not running any script */ SYM895_STATE_PASSIVE, /* Wait for ReSelect or Host Command */ SYM895_STATE_ACTIVE /* Running a script */ }SYM895_STATE;/* * SIOP hardware configuration structure. This is used to set/reset various * options available in SYM895. This is used as a parameter for the * sym895SetHWOptions() functions. This is a bit-field structure and has * to be operated with caution. * * Note : AWS bit affects all the SCSI phases while EWS bit affects only the * data transfers. EWS, unlike AWS, doesn't affect the command, status and * message phases. */typedef struct sym895HWOptions { UINT SCLK : 1; /* STEST1:b7,if false,uses PCI Clock for SCSI*/ UINT QEN : 1; /* STEST1:b3, Clock Quadrapler Enable */ UINT SCE : 1; /* STEST2:b7,enable assertion of SCSI thro SOCL */ /* and SODL registers */ UINT DIF : 1; /* STEST2:b5, enable differential SCSI */ UINT AWS : 1; /* STEST2:b2, Always Wide SCSI */ UINT EWS : 1; /* SCNTL3:b3, Enable Wide SCSI */ UINT EXTEND : 1; /* STEST2:b1, Extend SREQ/SACK filtering */ UINT TE : 1; /* STEST3:b7, TolerANT Enable */ UINT BL : 3; /* DMODE:b7,b6, CTEST5:b2 : Burst length */ /* when set to any of 32/64/128 burst length */ /* transfers, requires the DMA Fifo size to be */ /* 816 bytes (ctest5:b5 = 1). */ UINT SIOM : 1; /* DMODE:b5, Source I/O Memory Enable */ UINT DIOM : 1; /* DMODE:b4, Destination I/O Memory Enable */ UINT EXC : 1; /* SCNTL1:b7, Slow Cable Mode */ UINT ULTRA : 1; /* SCNTL3:b7, Ultra Enable */ UINT DFS : 1; /* CTEST5:b5, DMA Fifo size 112/816 bytes */ }SYM895_HW_OPTIONS;/* * The Default HW Options as the driver initialies the Sym 895 Chip * These options SHOULD correspond to the above mentioned structure. * * Use SCSI Clock and not PCI clock * Enable Clock Quadrapler * SCSI signal assertion through regsiters - disable * Disable High Voltage differential SCSI * Not always WIDE SCSI * Enable Wide SCSI * No filtering via SREQ/ SACK * TolerANT Enable * 128 burst transfer * Disable IO mode for both source and destination * No slow cable mode * Ultra SCSI * DMA Fifo size - 816 bytes * * NOTE: These options can be overriden by sym895SetHwOptions() call in * "sysScsi.c". */#define SYM895_ULTRA2_SCSI_OPTIONS { 0,1,0,0,0,1,0,1,6,0,0,0,1,1 }#define SYM895_FAST_SCSI_OPTIONS { 0,0,0,0,0,1,0,1,6,0,0,0,0,1 }/* * SCSI Controller Structure * * This the structure describing the SCSI controller chip and the SCSI * parameters used on the SCSI Bus. This structure also contains the * shared memory areas and the Thread information like what threads is * being executed by the SCRIPT processor currently and what script is * scheduled to run next etc. * * As this structure contains shared memory areas which are accessed * by both the SCSI controller and the CPU, this entire structure and * its memory buffers must be located in the cache-coherent memory, safe for * the dma transfers. */typedef struct sym895ScsiCtrl { SCSI_CTRL scsiCtrl; /* generic SCSI Controller info. */ /* used by both the driver and SCSI */ /* Manager.*/ SEM_ID singleStepSem; /* used to debug script */ SYM895_STATE state; /* Current state of the controller */ UINT clkPeriod; /* Clock Period; nSec*100 */ UINT clkDiv; /* SYNC/ASYNC clock divisor */ UINT devType; /* Currently 895 */ BOOL isParityCheck; /* Enable/Disable Paritychecks on Bus*/ BOOL isScriptsCopy; /* Copy SCRIPTS to on-chip RAM */ BOOL isCmdPending; /* Is there a new command to start */ BOOL isSingleStep; /* is Single Step Debugging enabled */ /* * The following identMsg buffer is used for initialising the pointer * for the current thread's IdentOut Message buffer. This buffer is also * defined in the SCSI_THREAD structure and was previously used for the * IdentOut Message buffer. The additional 5 bytes are for wide/sync SCSI */ UINT8 identMsg[SCSI_MAX_IDENT_MSG_LENGTH + 5]; UINT identMsgLength; SYM895_THREAD * pCurThread; /* Thread corresponding to current */ /* running script */ SYM895_THREAD * pNewThread; /* Thread to be activated next */ SYM895_SHARED * pIdentShMem; /* Shared Data Area for Identification */ /* Thread */ SYM895_SHARED * pClientShMem; /* Shared Data Area for Client thread*/ volatile UINT8 * baseAddress; /* Address where the Chip is mapped */ /* in memory */ volatile UINT8 * siopRamBaseAddress; /* Base Address for internal Ram */ SYM895_HW_OPTIONS hwOptions; /* 895 Options used/not being used */ }SYM895_SCSI_CTRL;/* Function Declarations */IMPORT SYM895_SCSI_CTRL * sym895CtrlCreate ( UINT8 * siopBaseAdrs, UINT clkPeriod, UINT16 devType, UINT8 * siopRamBaseAdrs, UINT16 flags );IMPORT STATUS sym895CtrlInit ( SYM895_SCSI_CTRL * pSiop, UINT scsiCtrlBusId );IMPORT STATUS sym895SetHwOptions ( SYM895_SCSI_CTRL * pSiop, SYM895_HW_OPTIONS * pHwRegs );IMPORT void sym895Intr (SYM895_SCSI_CTRL * pSiop);IMPORT STATUS sym895Show (SYM895_SCSI_CTRL * pSiop);IMPORT void sym895StepEnable (SYM895_SCSI_CTRL * pSiop, BOOL enable);IMPORT void sym895SingleStep (SYM895_SCSI_CTRL * pSiop, BOOL verbose);#endif /* _ASMLANGUAGE */#ifdef __cplusplus}#endif /* __cplusplus */#endif /* __INCsym895h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -