📄 idetask.h
字号:
MSGHEADIDE msgHead; /* Message header section */
UCHAR msgData[MSGIDE_DATSIZE];/* Message data section */
} MSGIDE, *PMSGIDE;
/*--------------------------------------------------------------------------*/
/* Internal information */
/*--------------------------------------------------------------------------*/
/* Parameter of the receiveing command */
typedef struct _idetaskcmdpara{
/* Receiving paramter */
UCHAR cmdBlock[12];
ULONG reqDataLen; /* The length of the request */
/* data transfer length */
UCHAR cmdType; /* command type */
UCHAR LUN; /* Logical unit number */
UCHAR opeMode; /* Command processing mode */
UCHAR xferMode; /* Transfer mode */
UCHAR *bufferPtr; /* The pointer of transfer memory */
CALLBACK_PROC pfnCallback; /* Callback pointer used when */
/* CirestCopy completed. */
/* Conversion in the task */
UCHAR deviceCmdBlock[12]; /* For the output of the */
/* connected device */
ULONG dataSize; /* The data length in the */
/* command(in the unit of byte) */
ULONG allSize; /* All processing size */
/* (in the unit of byte) */
ULONG tranTotalSize; /* Process size (in the unit of */
/* byte) */
UCHAR dataMode; /* Prosee mode */
UCHAR xferCount; /* Number of times the command */
/* is processed */
UCHAR xferDir; /* Direction of data transfer */
}IDE_TASK_CMDPARA;
typedef struct _idetaskinf{
UCHAR mState; /* IDE TASK Main state */
UCHAR sState; /* IDE TASK Sub state */
}IDE_TASK_INF;
/* sense */
typedef struct _idetasksensedata{
UCHAR senseKey;
UCHAR ascKey;
UCHAR ascqKey;
}IDE_TASK_SENSE_DATA;
/* UNIT Atention Flag */
typedef struct _idetaskunitflag{
UCHAR aten :1;
UCHAR reserve :7;
}IDE_TASK_UNIT_FLAG;
/*--------------------------------------------------------------------------*/
/* Message */
/*--------------------------------------------------------------------------*/
/*------------------------------------------------------------------*/
/* MSG_NTFY_IDE_HRST */
/*------------------------------------------------------------------*/
typedef struct _PARAM_MSG_NTFY_IDE_HRST{
UCHAR result; /* Process result */
UCHAR deviceCnt; /* Number of connected devices */
UCHAR deviceType[2]; /* Device type of the logical unit*/
}PARAM_MSG_NTFY_IDE_HRST;
/*------------------------------------------------------------------*/
/* MSG_NTFY_IDE_SRST */
/*------------------------------------------------------------------*/
typedef struct _PARAM_MSG_NTFY_IDE_SRST{
UCHAR result; /* Process result */
}PARAM_MSG_NTFY_IDE_SRST;
/*------------------------------------------------------------------*/
/* MSG_REQ_IDE_CMD */
/*------------------------------------------------------------------*/
typedef struct _PARAM_MSG_REQ_IDE_CMD{
UCHAR IDECmd[12]; /* ATA/ATAPI command packet */
UCHAR cmdType; /* Command type */
UCHAR LUN; /* Logical unit number */
UCHAR opeMode; /* Command process mode */
UCHAR xferMode; /* Transfer mode */
ULONG reqDataLen; /* Number of bytes that request to transfer */
UCHAR *bufferPtr; /* The pointer of transfer memory */
CALLBACK_PROC pfnCallback; /* Callback pointer used when CirestCopy completed.*/
UCHAR xferDir; /* Direction of data transfer */
}PARAM_MSG_REQ_IDE_CMD;
/*------------------------------------------------------------------*/
/* MSG_NTFY_IDE_CMD */
/*------------------------------------------------------------------*/
typedef struct _PARAM_MSG_NTFY_IDE_CMD{
UCHAR result; /* Process result of the command*/
UCHAR reserved[3]; /* Reserved */
ULONG xferDataLen; /* Number of data transfered */
}PARAM_MSG_NTFY_IDE_CMD;
/*------------------------------------------------------------------*/
/* MSG_NTFY_IDE_CMP_XFER_READY */
/*------------------------------------------------------------------*/
typedef struct _PARAM_MSG_NTFY_IDE_CMP_XFER_READY{
ULONG xferDataLen; /* Number of data to transfer (when divided) */
UCHAR xferCount; /* Data count (when divided) */
}PARAM_MSG_NTFY_IDE_CMP_XFER_READY;
/*------------------------------------------------------------------*/
/* MSG_REQ_IDE_XFER_START */
/*------------------------------------------------------------------*/
typedef struct _PARAM_MSG_REQ_IDE_XFER_START{
UCHAR *bufferPtr; /* The pointer of transfer memory */
}PARAM_MSG_REQ_IDE_XFER_START;
/*------------------------------------------------------------------*/
/* MSG_NTFY_IDE_XFER_CMP */
/*------------------------------------------------------------------*/
typedef struct _PARAM_MSG_NTFY_IDE_XFER_CMP{
UCHAR result; /* Process result */
}PARAM_MSG_NTFY_IDE_XFER_CMP;
/*------------------------------------------------------------------*/
/* MSG_REQ_IDE_DEV_LIST */
/*------------------------------------------------------------------*/
typedef struct _PARAM_MSG_REQ_IDE_DEV_LIST{
UCHAR *bufferPtr; /* The pointer of transfer memory */
}PARAM_MSG_REQ_IDE_DEV_LIST;
/* Device list strusture */
typedef struct _STR_DEV_LIST{
UCHAR deviceCnt; /* Number of connected devices */
UCHAR deviceType[2]; /* Device type */
}STR_DEV_LIST;
/*------------------------------------------------------------------*/
/* MSG_NTFY_IDE_DEV_LIST */
/*------------------------------------------------------------------*/
typedef struct _PARAM_MSG_NTFY_IDE_DEV_LIST{
UCHAR result; /* Process result */
}PARAM_MSG_NTFY_IDE_DEV_LIST;
/*------------------------------------------------------------------*/
/* MSG_REQ_IDE_SET_XFERRATE */
/*------------------------------------------------------------------*/
typedef struct _PARAM_MSG_REQ_IDE_SET_XFERRATE{
UCHAR LUN; /* Logical unit numaber */
UCHAR PIOMode; /* PIO transfer */
UCHAR multiDMAMode; /* Multi word DMA */
UCHAR ultraDMAMode; /* Ultra DMA */
}PARAM_MSG_REQ_IDE_SET_XFERRATE;
/*------------------------------------------------------------------*/
/* MSG_NTFY_IDE_SET_XFERRATE */
/*------------------------------------------------------------------*/
typedef struct _PARAM_MSG_NTFY_IDE_SET_XFERRATE{
UCHAR result; /* Process result of the command */
}PARAM_MSG_NTFY_IDE_SET_XFERRATE;
/*STRAGE_lib.h*/
/* Sense information */
#define NO_SENSE_ERROR 0x00 /* No error information */
#define ILLEGAL_REQUEST 0x05 /* Illegal Request */
#define UNIT_ATTENTION 0x06 /**/
/* Additional sense information */
#define INVALID_OPE_CODE 0x20 /* Invalid Command Operation Code */
#define INVALID_CDB 0x24 /* Invalid Field in CDB */
#define POWER_ON 0x29 /* Power On, Reset, Bus Device Reset Occurred */
/**/
#define SENSE_NO_SENSE_ERROR 0x000000
#define SENSE_NO_SEEK_COMPLETE 0x030200
#define SENSE_UNRECOVERED_READ_ERROR 0x031100
#define SENSE_HARDWARE_ERROR 0x040000
#define SENSE_LOGICAL_UNIT_COMMUNICATION_ERROR 0x040803
#define SENSE_PARAMETER_LIST_LENGTH_ERROR 0x051A00
#define SENSE_INVALID_COMMAND_OPERATION_CODE 0x052000
#define SENSE_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE 0x052100
#define SENSE_INVALID_FIELD_IN_COMMAND_PACKET 0x052400
#define SENSE_LOGICAL_UNIT_NOT_SUPPORTED 0x052500
#define SENSE_INVALID_FIELD_IN_PARAMETER_LIST 0x052600
#define SENSE_SAVING_PARAMETERS_NOT_SUPPORTED 0x053900
#define SENSE_POWER_ON_RESET_OR_BUS_DEVICE_RESET_OCCURRED 0x062900
#endif /* IDE_TASK_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -