⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scsi.h

📁 用于TM1300/PNX1300系列DSP(主要用于视频处理)的操作系统pSOS。包括全部源码
💻 H
📖 第 1 页 / 共 4 页
字号:
#define REWIND_DLEN 6 #ifdef	MRItypedef packed struct#endif#ifdef	GHS#pragma pack(1)typedef struct#endif#if _SDS#pragma maxalign(1)typedef struct#endif    {    unsigned char       code;    unsigned char       lun     :3,                                :4,                        immed   :1;    unsigned char       reserved[3];    unsigned char       vu      :2,                                :4,                        flag    :1,                        link    :1;    } REWIND_STRUCT;#ifdef	GHS#pragma pack()#endif#if _SDS#pragma maxalign()#endif/***********************************************************************//* Unload                                                              *//***********************************************************************/#define UNLOAD 0x1B#define UNLOAD_DLEN 6 #ifdef	MRItypedef packed struct#endif#ifdef	GHS#pragma pack(1)typedef struct#endif#if _SDS#pragma maxalign(1)typedef struct#endif    {    unsigned char       code;    unsigned char       lun     :3,                                :4,                        immed   :1;    unsigned char       reserved[2];    unsigned char               :5,                             eot:1,                           reten:1,                            load:1;       unsigned char       vu      :2,                                :4,                        flag    :1,                        link    :1;    } UNLOAD_STRUCT;#ifdef	GHS#pragma pack()#endif#if _SDS#pragma maxalign()#endif/***********************************************************************//* Erase                                                               *//***********************************************************************/#define ERASE 0x19#define ERASE_DLEN 6 typedef struct    {    unsigned char       code;    unsigned char       lun     :3,                                :3,                        immed   :1,                        elong   :1;    unsigned char       reserved[3];    unsigned char       vu      :2,                                :4,                        flag    :1,                        link    :1;    } ERASE_STRUCT;/***********************************************************************//* SPACE                                                               *//***********************************************************************/#define SPACE 0x11#define SPACE_DLEN 6#ifdef	MRItypedef packed struct#endif#ifdef	GHS#pragma pack(1)typedef struct#endif#if _SDS#pragma maxalign(1)typedef struct#endif    {    unsigned char       code;    unsigned long       lun     :3,                                :2,                        space   :3,                        count   :24;    unsigned char       vu      :2,                                :4,                        flag    :1,                        link    :1;    } SPACE_STRUCT;#ifdef	GHS#pragma pack()#endif#if _SDS#pragma maxalign()#endif/***********************************************************************//* Message codes.                                                      *//***********************************************************************/#define MSG_COMPLETE     0x00#define MSG_EXTENDED     0x01#define MSG_SAVE_DPTR    0x02#define MSG_RESTORE_PTRS 0x03#define MSG_DISCONNECT   0x04#define MSG_ERROR        0x05#define MSG_ABORT        0x06#define MSG_REJECT       0x07#define MSG_NOP          0x08#define MSG_PARITY       0x09#define MSG_LINK         0x0a#define MSG_FLAG         0x0b#define MSG_RESET        0x0c#define MSG_SQTAG        0x20#define MSG_IDENTIFY     0x80#define MSG_IDENTIFY_D   0xC0        /* IDENTIFY + allow disconnect    *//***********************************************************************//* Extended message codes.                                             *//***********************************************************************/#define EMSG_MODIFY  0x00            /* Modify data pointer            */#define EMSG_SYNCH   0x01            /* Syncronous data transfer req   */#define EMSG_IDENT   0x02            /* Extended idenify SCSI 1        */#define EMSG_WDTR    0x03            /* Wide Data Transfer req         *//***********************************************************************//* extended message offset values                                      *//***********************************************************************/#define EOFF_XMSG       0x00         /* "extended message" message     */#define EOFF_LENGTH     0x01         /* # of bytes remaining in msg    */#define EOFF_CODE       0x02         /* extended message code i.e. SDTR*/#define EOFF_WIDTH      0x03         /* WDTR transfer width            */#define EOFF_PERIOD     0x03         /* SDTR transfer period           */#define EOFF_OFFSET     0x04         /* SDTR req/ack offset            *//***********************************************************************//* Sense Key codes.                                                    *//***********************************************************************/#define NO_SENSE         0x00#define RECOVERED_ERROR  0x01#define NOT_READY        0x02#define MEDIUM_ERROR     0x03#define HARDWARE_ERROR   0x04#define ILLEGAL_REQUEST  0x05#define UNIT_ATTENTION   0x06#define DATA_PROTECT     0x07#define BLANK_CHECK      0x08#define VENDOR_CODE      0x09#define COPY_ABORTED     0x0A#define ABORTED_COMMAND  0x0B#define EQUAL            0x0C#define VOLUME_OVERFLOW  0x0D#define MISCOMPARE       0x0E/***********************************************************************//* Device interface structure                                          *//***********************************************************************/#define STATLEN 4                   /* allow 4 bytes of status         */#define MAXMSG 8                    /* max size of a message           */#define capacity sizes.cap#define limits   sizes.limtypedef struct    {    volatile unsigned int flags;    /* status flags                    */    volatile unsigned int state;    /* state of target                 */    unsigned char open;             /* count of number of users.       */    unsigned char loaded;           /* medium is loaded flag.          */    unsigned char rewind;           /* opened with rewind.             */    unsigned char exclusive;        /* opened exclusively for 1 user.  */    unsigned long st_access_id;     /* command access semaphore ID     */    unsigned long st_cont_id;       /* command continue semaphore ID   */    unsigned char id;               /* device ID                       */    unsigned char lun;              /* logical unit number             */    unsigned char bus_width;        /* SCSI bus width                  */    unsigned char resev0;           /* reserved  (make long alignment) */    unsigned long block_size;       /* Tape block size                 */    char *trans_blk;                /* pointer to transaction block    */    union        {        CAPACITY_RET_STRUCT cap;    /* capacity of disk drive          */        BLOCK_LIMITS_RET_STRUCT lim;/* limits of tape device           */        } sizes;    INQUIRY_RET_STRUCT  inquiry;    /* inquiry information             */    REQUEST_SENSE_RET_STRUCT sense; /* sense info valid on error only  */    PARTITION_INFO partition[4];    /* MSDOS partition info.           */    } TARGET_DEV;/*---------------------------------------------------------------------*//* TARGET_DEV flag bits                                                *//*---------------------------------------------------------------------*/#define ABORT_OPERATION 0x000001    /* Operation to be aborted         */#define RESET_DEVICE    0x000002    /* Device to be reset              */#define WIDE_SUPPORT    0x000004    /* Device supports wide xfers      */#define WIDE_INITIATE   0x000008    /* Tells low level to request wide */#define WIDE_DISABLE    0x000010    /* Low level disable WIDE because  */                                    /* of PARITY error.                */#define SYNC_REJECT     0x000020    /* Target rejected sync request    */#define WIDE_REJECT     0x000040    /* Target rejected wide request    */#define DISC_SUPPORT    0x000100    /* Device disconnect support       */#define SYNC_SUPPORT    0x000200    /* Device supports sync xfers      */#define SYNC_INITIATE   0x000400    /* Tells low level to request sync */#define IDENT_SUPPORT   0x000800    /* Identify msg supported          */#define ERROR           0x001000    /* Device Error occured            */#define DISCONNECT      0x002000    /* Device disconnect received      */#define WRITE_PROTECT   0x004000    /* Device is write protected       */#define TAPE_BLOCK_MODE 0x008000    /* Mode for tape transfer          */#define IN_USE          0x010000    /* Command block is in use         */#define INQUIRED        0x020000    /* Inquiry completed               */#define CAPACITY        0x040000    /* Capacity completed              */#define LIMITS          0x040000    /* Limits completed                */#define CONTROLLER      0x080000    /* SCSI bus controller             */#define REQSENSE        0x100000    /* Request Sense being performed   */#define NO_DEVICE       0x200000    /* No device at this target        */#define PARTITIONED     0x400000    /* DOS partitioning flag           */#define GETDEVINFO      0x800000    /* getdevinfo being performed      *//*---------------------------------------------------------------------*//* TARGET_DEV state bits                                               *//*---------------------------------------------------------------------*//* NOTE lower byte, bits 0 - 7 are  reserved for initurrpt bits.       *//* example: target_dev->state |= CMD_COMPLETE;                         *//*---------------------------------------------------------------------*/#define DMA_TRANSFER    0x00000100  /* dma transfer in progress        */#define PGM_TRANSFER    0x00000200  /* program transfer in progress    */#define PHASE_CHG       0x00000400  /* phase change during transfer    */#define DISCONNECTED    0x00000800  /* target disconnected from bus    */#define RESTART         0x00001000  /* target disconnected from bus    */#define DISCONNECT_MSG  0x00010000  /* disconnect message received     */#define SAVE_DPTR_MSG   0x00020000  /* save data pointer message       */#define RESTORE_PTR_MSG 0x00040000  /* restore data pointer message    */#define REJECT_MSG      0x00080000  /* reject last message received    */#define LINK_MSG        0x00100000  /* linked command complete         */#define FLAG_MSG        0x00200000  /* linked command complete flag    */#define IDENTIFY_MSG    0x00400000  /* establish nexus                 */#define CLEAR_MESSAGE_FLAGS 0xFF0000 /* &= ~ will clear message flags  */#endif /* _SCSI_H */#if defined(__cplusplus)}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -